pygame_sdl2-2.1.0-for-renpy-6.99.14.1/0000755000175000017500000000000013235720531016245 5ustar tomtom00000000000000pygame_sdl2-2.1.0-for-renpy-6.99.14.1/PKG-INFO0000644000175000017500000000043113235720531017340 0ustar tomtom00000000000000Metadata-Version: 1.0 Name: pygame_sdl2 Version: 2.1.0-for-renpy-6.99.14.1 Summary: UNKNOWN Home-page: https://github.com/renpy/pygame_sdl2 Author: Tom Rothamel Author-email: tom@rothamel.us License: UNKNOWN Description-Content-Type: UNKNOWN Description: UNKNOWN Platform: UNKNOWN pygame_sdl2-2.1.0-for-renpy-6.99.14.1/COPYING.ZLIB0000664000175000017500000000146212431263036020043 0ustar tomtom00000000000000This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages arising from the use of this software. Permission is granted to anyone to use this software for any purpose, including commercial applications, and to alter it and redistribute it freely, subject to the following restrictions: 1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required. 2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software. 3. This notice may not be removed or altered from any source distribution. pygame_sdl2-2.1.0-for-renpy-6.99.14.1/include/0000755000175000017500000000000013235720531017670 5ustar tomtom00000000000000pygame_sdl2-2.1.0-for-renpy-6.99.14.1/include/sdl2_ttf.pxd0000664000175000017500000001010212426562233022126 0ustar tomtom00000000000000from sdl2 cimport * cdef extern from "SDL_ttf.h" nogil: cdef enum: SDL_TTF_MAJOR_VERSION SDL_TTF_MINOR_VERSION SDL_TTF_PATCHLEVEL const SDL_version * TTF_Linked_Version() cdef enum: UNICODE_BOM_NATIVE UNICODE_BOM_SWAPPED void TTF_ByteSwappedUNICODE(int swapped) ctypedef struct _TTF_Font ctypedef _TTF_Font TTF_Font int TTF_Init() TTF_Font * TTF_OpenFont(const char *file, int ptsize) TTF_Font * TTF_OpenFontIndex(const char *file, int ptsize, long index) TTF_Font * TTF_OpenFontRW(SDL_RWops *src, int freesrc, int ptsize) TTF_Font * TTF_OpenFontIndexRW(SDL_RWops *src, int freesrc, int ptsize, long index) cdef enum: TTF_STYLE_NORMAL TTF_STYLE_BOLD TTF_STYLE_ITALIC TTF_STYLE_UNDERLINE TTF_STYLE_STRIKETHROUGH int TTF_GetFontStyle(const TTF_Font *font) void TTF_SetFontStyle(TTF_Font *font, int style) int TTF_GetFontOutline(const TTF_Font *font) void TTF_SetFontOutline(TTF_Font *font, int outline) cdef enum: TTF_HINTING_NORMAL TTF_HINTING_LIGHT TTF_HINTING_MONO TTF_HINTING_NONE int TTF_GetFontHinting(const TTF_Font *font) void TTF_SetFontHinting(TTF_Font *font, int hinting) int TTF_FontHeight(const TTF_Font *font) int TTF_FontAscent(const TTF_Font *font) int TTF_FontDescent(const TTF_Font *font) int TTF_FontLineSkip(const TTF_Font *font) int TTF_GetFontKerning(const TTF_Font *font) void TTF_SetFontKerning(TTF_Font *font, int allowed) long TTF_FontFaces(const TTF_Font *font) int TTF_FontFaceIsFixedWidth(const TTF_Font *font) char * TTF_FontFaceFamilyName(const TTF_Font *font) char * TTF_FontFaceStyleName(const TTF_Font *font) int TTF_GlyphIsProvided(const TTF_Font *font, Uint16 ch) int TTF_GlyphMetrics(TTF_Font *font, Uint16 ch, int *minx, int *maxx, int *miny, int *maxy, int *advance) int TTF_SizeText(TTF_Font *font, const char *text, int *w, int *h) int TTF_SizeUTF8(TTF_Font *font, const char *text, int *w, int *h) int TTF_SizeUNICODE(TTF_Font *font, const Uint16 *text, int *w, int *h) SDL_Surface * TTF_RenderText_Solid(TTF_Font *font, const char *text, SDL_Color fg) SDL_Surface * TTF_RenderUTF8_Solid(TTF_Font *font, const char *text, SDL_Color fg) SDL_Surface * TTF_RenderUNICODE_Solid(TTF_Font *font, const Uint16 *text, SDL_Color fg) SDL_Surface * TTF_RenderGlyph_Solid(TTF_Font *font, Uint16 ch, SDL_Color fg) SDL_Surface * TTF_RenderText_Shaded(TTF_Font *font, const char *text, SDL_Color fg, SDL_Color bg) SDL_Surface * TTF_RenderUTF8_Shaded(TTF_Font *font, const char *text, SDL_Color fg, SDL_Color bg) SDL_Surface * TTF_RenderUNICODE_Shaded(TTF_Font *font, const Uint16 *text, SDL_Color fg, SDL_Color bg) SDL_Surface * TTF_RenderGlyph_Shaded(TTF_Font *font, Uint16 ch, SDL_Color fg, SDL_Color bg) SDL_Surface * TTF_RenderText_Blended(TTF_Font *font, const char *text, SDL_Color fg) SDL_Surface * TTF_RenderUTF8_Blended(TTF_Font *font, const char *text, SDL_Color fg) SDL_Surface * TTF_RenderUNICODE_Blended(TTF_Font *font, const Uint16 *text, SDL_Color fg) SDL_Surface * TTF_RenderText_Blended_Wrapped(TTF_Font *font, const char *text, SDL_Color fg, Uint32 wrapLength) SDL_Surface * TTF_RenderUTF8_Blended_Wrapped(TTF_Font *font, const char *text, SDL_Color fg, Uint32 wrapLength) SDL_Surface * TTF_RenderUNICODE_Blended_Wrapped(TTF_Font *font, const Uint16 *text, SDL_Color fg, Uint32 wrapLength) SDL_Surface * TTF_RenderGlyph_Blended(TTF_Font *font, Uint16 ch, SDL_Color fg) void TTF_CloseFont(TTF_Font *font) void TTF_Quit() int TTF_WasInit() int TTF_GetFontKerningSize(TTF_Font *font, int prev_index, int index) pygame_sdl2-2.1.0-for-renpy-6.99.14.1/include/sdl2_mixer.pxd0000664000175000017500000001122312427546115022464 0ustar tomtom00000000000000from sdl2 cimport * # Acquire the GIL for callbacks. cdef extern from "SDL_mixer.h": void Mix_ChannelFinished(void (*channel_finished)(int channel)) void Mix_HookMusicFinished(void (*music_finished)()) void Mix_SetPostMix(void (*mix_func)(void *udata, Uint8 *stream, int len), void *arg) void Mix_HookMusic(void (*mix_func)(void *udata, Uint8 *stream, int len), void *arg) cdef extern from "SDL_mixer.h" nogil: cdef enum: SDL_MIXER_MAJOR_VERSION SDL_MIXER_MINOR_VERSION SDL_MIXER_PATCHLEVEL const SDL_version * Mix_Linked_Version() ctypedef enum MIX_InitFlags: MIX_INIT_FLAC MIX_INIT_MOD MIX_INIT_MODPLUG MIX_INIT_MP3 MIX_INIT_OGG MIX_INIT_FLUIDSYNTH int Mix_Init(int flags) void Mix_Quit() cdef enum: MIX_CHANNELS MIX_DEFAULT_FREQUENCY MIX_DEFAULT_FORMAT MIX_DEFAULT_CHANNELS MIX_MAX_VOLUME ctypedef struct Mix_Chunk: int allocated Uint8 *abuf Uint32 alen Uint8 volume ctypedef enum Mix_Fading: MIX_NO_FADING MIX_FADING_OUT MIX_FADING_IN ctypedef enum Mix_MusicType: MUS_NONE MUS_CMD MUS_WAV MUS_MOD MUS_MID MUS_OGG MUS_MP3 MUS_MP3_MAD MUS_FLAC MUS_MODPLUG ctypedef struct _Mix_Music ctypedef _Mix_Music Mix_Music int Mix_OpenAudio(int frequency, Uint16 format, int channels, int chunksize) int Mix_AllocateChannels(int numchans) int Mix_QuerySpec(int *frequency,Uint16 *format,int *channels) Mix_Chunk * Mix_LoadWAV_RW(SDL_RWops *src, int freesrc) Mix_Music * Mix_LoadMUS(const char *file) Mix_Music * Mix_LoadMUS_RW(SDL_RWops *src, int freesrc) Mix_Music * Mix_LoadMUSType_RW(SDL_RWops *src, Mix_MusicType type, int freesrc) Mix_Chunk * Mix_QuickLoad_WAV(Uint8 *mem) Mix_Chunk * Mix_QuickLoad_RAW(Uint8 *mem, Uint32 len) void Mix_FreeChunk(Mix_Chunk *chunk) void Mix_FreeMusic(Mix_Music *music) int Mix_GetNumChunkDecoders() const char * Mix_GetChunkDecoder(int index) int Mix_GetNumMusicDecoders() const char * Mix_GetMusicDecoder(int index) Mix_MusicType Mix_GetMusicType(const Mix_Music *music) void * Mix_GetMusicHookData() cdef enum: MIX_CHANNEL_POST ctypedef void (*Mix_EffectFunc_t)(int chan, void *stream, int len, void *udata) ctypedef void (*Mix_EffectDone_t)(int chan, void *udata) int Mix_RegisterEffect(int chan, Mix_EffectFunc_t f, Mix_EffectDone_t d, void *arg) int Mix_UnregisterEffect(int channel, Mix_EffectFunc_t f) int Mix_UnregisterAllEffects(int channel) cdef enum: MIX_EFFECTSMAXSPEED int Mix_SetPanning(int channel, Uint8 left, Uint8 right) int Mix_SetPosition(int channel, Sint16 angle, Uint8 distance) int Mix_SetDistance(int channel, Uint8 distance) int Mix_SetReverseStereo(int channel, int flip) int Mix_ReserveChannels(int num) int Mix_GroupChannel(int which, int tag) int Mix_GroupChannels(int from_, int to, int tag) int Mix_GroupAvailable(int tag) int Mix_GroupCount(int tag) int Mix_GroupOldest(int tag) int Mix_GroupNewer(int tag) int Mix_PlayChannelTimed(int channel, Mix_Chunk *chunk, int loops, int ticks) int Mix_PlayMusic(Mix_Music *music, int loops) int Mix_FadeInMusic(Mix_Music *music, int loops, int ms) int Mix_FadeInMusicPos(Mix_Music *music, int loops, int ms, double position) int Mix_FadeInChannelTimed(int channel, Mix_Chunk *chunk, int loops, int ms, int ticks) int Mix_Volume(int channel, int volume) int Mix_VolumeChunk(Mix_Chunk *chunk, int volume) int Mix_VolumeMusic(int volume) int Mix_HaltChannel(int channel) int Mix_HaltGroup(int tag) int Mix_HaltMusic() int Mix_ExpireChannel(int channel, int ticks) int Mix_FadeOutChannel(int which, int ms) int Mix_FadeOutGroup(int tag, int ms) int Mix_FadeOutMusic(int ms) Mix_Fading Mix_FadingMusic() Mix_Fading Mix_FadingChannel(int which) void Mix_Pause(int channel) void Mix_Resume(int channel) int Mix_Paused(int channel) void Mix_PauseMusic() void Mix_ResumeMusic() void Mix_RewindMusic() int Mix_PausedMusic() int Mix_SetMusicPosition(double position) int Mix_Playing(int channel) int Mix_PlayingMusic() int Mix_SetMusicCMD(const char *command) int Mix_SetSynchroValue(int value) int Mix_GetSynchroValue() int Mix_SetSoundFonts(const char *paths) const char* Mix_GetSoundFonts() int Mix_EachSoundFont(int (*function)(const char*, void*), void *data) Mix_Chunk * Mix_GetChunk(int channel) void Mix_CloseAudio() pygame_sdl2-2.1.0-for-renpy-6.99.14.1/include/sdl2_image.pxd0000664000175000017500000000147212423717412022423 0ustar tomtom00000000000000from sdl2 cimport * cdef extern from "SDL_image.h" nogil: ctypedef enum IMG_InitFlags: IMG_INIT_JPG IMG_INIT_PNG IMG_INIT_TIF IMG_INIT_WEBP int IMG_Init(int flags) void IMG_Quit() SDL_Surface *IMG_Load(const char *file) SDL_Surface *IMG_Load_RW(SDL_RWops *src, int freesrc) SDL_Surface *IMG_LoadTyped_RW(SDL_RWops *src, int freesrc, const char *type) SDL_Texture *IMG_LoadTexture(SDL_Renderer *renderer, const char *file) SDL_Texture *IMG_LoadTexture_RW(SDL_Renderer *renderer, SDL_RWops *src, int freesrc) SDL_Texture *IMG_LoadTextureTyped_RW(SDL_Renderer *renderer, SDL_RWops *src, int freesrc, const char *type) int IMG_SavePNG(SDL_Surface *surface, const char *file) int IMG_SavePNG_RW(SDL_Surface *surface, SDL_RWops *dst, int freedst) pygame_sdl2-2.1.0-for-renpy-6.99.14.1/include/sdl2_gfx.pxd0000664000175000017500000001644212513730040022120 0ustar tomtom00000000000000from sdl2 cimport * cdef extern from "SDL2_rotozoom.h" nogil: cdef enum: SMOOTHING_OFF SMOOTHING_ON SDL_Surface *rotozoomSurface(SDL_Surface * src, double angle, double zoom, int smooth) SDL_Surface *rotozoomSurfaceXY(SDL_Surface * src, double angle, double zoomx, double zoomy, int smooth) void rotozoomSurfaceSize(int width, int height, double angle, double zoom, int *dstwidth, int *dstheight) void rotozoomSurfaceSizeXY(int width, int height, double angle, double zoomx, double zoomy, int *dstwidth, int *dstheight) SDL_Surface *zoomSurface(SDL_Surface * src, double zoomx, double zoomy, int smooth) void zoomSurfaceSize(int width, int height, double zoomx, double zoomy, int *dstwidth, int *dstheight) SDL_Surface *shrinkSurface(SDL_Surface * src, int factorx, int factory) SDL_Surface* rotateSurface90Degrees(SDL_Surface* src, int numClockwiseTurns) cdef extern from "SDL_gfxPrimitives.h" nogil: int pixelColor(SDL_Surface * dst, Sint16 x, Sint16 y, Uint32 color) int pixelRGBA(SDL_Surface * dst, Sint16 x, Sint16 y, Uint8 r, Uint8 g, Uint8 b, Uint8 a) int hlineColor(SDL_Surface * dst, Sint16 x1, Sint16 x2, Sint16 y, Uint32 color) int hlineRGBA(SDL_Surface * dst, Sint16 x1, Sint16 x2, Sint16 y, Uint8 r, Uint8 g, Uint8 b, Uint8 a) int vlineColor(SDL_Surface * dst, Sint16 x, Sint16 y1, Sint16 y2, Uint32 color) int vlineRGBA(SDL_Surface * dst, Sint16 x, Sint16 y1, Sint16 y2, Uint8 r, Uint8 g, Uint8 b, Uint8 a) int rectangleColor(SDL_Surface * dst, Sint16 x1, Sint16 y1, Sint16 x2, Sint16 y2, Uint32 color) int rectangleRGBA(SDL_Surface * dst, Sint16 x1, Sint16 y1, Sint16 x2, Sint16 y2, Uint8 r, Uint8 g, Uint8 b, Uint8 a) int roundedRectangleColor(SDL_Surface * dst, Sint16 x1, Sint16 y1, Sint16 x2, Sint16 y2, Sint16 rad, Uint32 color) int roundedRectangleRGBA(SDL_Surface * dst, Sint16 x1, Sint16 y1, Sint16 x2, Sint16 y2, Sint16 rad, Uint8 r, Uint8 g, Uint8 b, Uint8 a) int boxColor(SDL_Surface * dst, Sint16 x1, Sint16 y1, Sint16 x2, Sint16 y2, Uint32 color) int boxRGBA(SDL_Surface * dst, Sint16 x1, Sint16 y1, Sint16 x2, Sint16 y2, Uint8 r, Uint8 g, Uint8 b, Uint8 a) int roundedBoxColor(SDL_Surface * dst, Sint16 x1, Sint16 y1, Sint16 x2, Sint16 y2, Sint16 rad, Uint32 color) int roundedBoxRGBA(SDL_Surface * dst, Sint16 x1, Sint16 y1, Sint16 x2, Sint16 y2, Sint16 rad, Uint8 r, Uint8 g, Uint8 b, Uint8 a) int lineColor(SDL_Surface * dst, Sint16 x1, Sint16 y1, Sint16 x2, Sint16 y2, Uint32 color) int lineRGBA(SDL_Surface * dst, Sint16 x1, Sint16 y1, Sint16 x2, Sint16 y2, Uint8 r, Uint8 g, Uint8 b, Uint8 a) int aalineColor(SDL_Surface * dst, Sint16 x1, Sint16 y1, Sint16 x2, Sint16 y2, Uint32 color) int aalineRGBA(SDL_Surface * dst, Sint16 x1, Sint16 y1, Sint16 x2, Sint16 y2, Uint8 r, Uint8 g, Uint8 b, Uint8 a) int thickLineColor(SDL_Surface * dst, Sint16 x1, Sint16 y1, Sint16 x2, Sint16 y2, Uint8 width, Uint32 color) int thickLineRGBA(SDL_Surface * dst, Sint16 x1, Sint16 y1, Sint16 x2, Sint16 y2, Uint8 width, Uint8 r, Uint8 g, Uint8 b, Uint8 a) int circleColor(SDL_Surface * dst, Sint16 x, Sint16 y, Sint16 rad, Uint32 color) int circleRGBA(SDL_Surface * dst, Sint16 x, Sint16 y, Sint16 rad, Uint8 r, Uint8 g, Uint8 b, Uint8 a) int arcColor(SDL_Surface * dst, Sint16 x, Sint16 y, Sint16 rad, Sint16 start, Sint16 end, Uint32 color) int arcRGBA(SDL_Surface * dst, Sint16 x, Sint16 y, Sint16 rad, Sint16 start, Sint16 end, Uint8 r, Uint8 g, Uint8 b, Uint8 a) int aacircleColor(SDL_Surface * dst, Sint16 x, Sint16 y, Sint16 rad, Uint32 color) int aacircleRGBA(SDL_Surface * dst, Sint16 x, Sint16 y, Sint16 rad, Uint8 r, Uint8 g, Uint8 b, Uint8 a) int filledCircleColor(SDL_Surface * dst, Sint16 x, Sint16 y, Sint16 r, Uint32 color) int filledCircleRGBA(SDL_Surface * dst, Sint16 x, Sint16 y, Sint16 rad, Uint8 r, Uint8 g, Uint8 b, Uint8 a) int ellipseColor(SDL_Surface * dst, Sint16 x, Sint16 y, Sint16 rx, Sint16 ry, Uint32 color) int ellipseRGBA(SDL_Surface * dst, Sint16 x, Sint16 y, Sint16 rx, Sint16 ry, Uint8 r, Uint8 g, Uint8 b, Uint8 a) int aaellipseColor(SDL_Surface * dst, Sint16 x, Sint16 y, Sint16 rx, Sint16 ry, Uint32 color) int aaellipseRGBA(SDL_Surface * dst, Sint16 x, Sint16 y, Sint16 rx, Sint16 ry, Uint8 r, Uint8 g, Uint8 b, Uint8 a) int filledEllipseColor(SDL_Surface * dst, Sint16 x, Sint16 y, Sint16 rx, Sint16 ry, Uint32 color) int filledEllipseRGBA(SDL_Surface * dst, Sint16 x, Sint16 y, Sint16 rx, Sint16 ry, Uint8 r, Uint8 g, Uint8 b, Uint8 a) int pieColor(SDL_Surface * dst, Sint16 x, Sint16 y, Sint16 rad, Sint16 start, Sint16 end, Uint32 color) int pieRGBA(SDL_Surface * dst, Sint16 x, Sint16 y, Sint16 rad, Sint16 start, Sint16 end, Uint8 r, Uint8 g, Uint8 b, Uint8 a) int filledPieColor(SDL_Surface * dst, Sint16 x, Sint16 y, Sint16 rad, Sint16 start, Sint16 end, Uint32 color) int filledPieRGBA(SDL_Surface * dst, Sint16 x, Sint16 y, Sint16 rad, Sint16 start, Sint16 end, Uint8 r, Uint8 g, Uint8 b, Uint8 a) int trigonColor(SDL_Surface * dst, Sint16 x1, Sint16 y1, Sint16 x2, Sint16 y2, Sint16 x3, Sint16 y3, Uint32 color) int trigonRGBA(SDL_Surface * dst, Sint16 x1, Sint16 y1, Sint16 x2, Sint16 y2, Sint16 x3, Sint16 y3, Uint8 r, Uint8 g, Uint8 b, Uint8 a) int aatrigonColor(SDL_Surface * dst, Sint16 x1, Sint16 y1, Sint16 x2, Sint16 y2, Sint16 x3, Sint16 y3, Uint32 color) int aatrigonRGBA(SDL_Surface * dst, Sint16 x1, Sint16 y1, Sint16 x2, Sint16 y2, Sint16 x3, Sint16 y3, Uint8 r, Uint8 g, Uint8 b, Uint8 a) int filledTrigonColor(SDL_Surface * dst, Sint16 x1, Sint16 y1, Sint16 x2, Sint16 y2, Sint16 x3, Sint16 y3, Uint32 color) int filledTrigonRGBA(SDL_Surface * dst, Sint16 x1, Sint16 y1, Sint16 x2, Sint16 y2, Sint16 x3, Sint16 y3, Uint8 r, Uint8 g, Uint8 b, Uint8 a) int polygonColor(SDL_Surface * dst, const Sint16 * vx, const Sint16 * vy, int n, Uint32 color) int polygonRGBA(SDL_Surface * dst, const Sint16 * vx, const Sint16 * vy, int n, Uint8 r, Uint8 g, Uint8 b, Uint8 a) int aapolygonColor(SDL_Surface * dst, const Sint16 * vx, const Sint16 * vy, int n, Uint32 color) int aapolygonRGBA(SDL_Surface * dst, const Sint16 * vx, const Sint16 * vy, int n, Uint8 r, Uint8 g, Uint8 b, Uint8 a) int filledPolygonColor(SDL_Surface * dst, const Sint16 * vx, const Sint16 * vy, int n, Uint32 color) int filledPolygonRGBA(SDL_Surface * dst, const Sint16 * vx, const Sint16 * vy, int n, Uint8 r, Uint8 g, Uint8 b, Uint8 a) int texturedPolygon(SDL_Surface * dst, const Sint16 * vx, const Sint16 * vy, int n, SDL_Surface * texture,int texture_dx,int texture_dy) int bezierColor(SDL_Surface * dst, const Sint16 * vx, const Sint16 * vy, int n, int s, Uint32 color) int bezierRGBA(SDL_Surface * dst, const Sint16 * vx, const Sint16 * vy, int n, int s, Uint8 r, Uint8 g, Uint8 b, Uint8 a) void gfxPrimitivesSetFont(const void *fontdata, Uint32 cw, Uint32 ch) void gfxPrimitivesSetFontRotation(Uint32 rotation) int characterColor(SDL_Surface * dst, Sint16 x, Sint16 y, char c, Uint32 color) int characterRGBA(SDL_Surface * dst, Sint16 x, Sint16 y, char c, Uint8 r, Uint8 g, Uint8 b, Uint8 a) int stringColor(SDL_Surface * dst, Sint16 x, Sint16 y, const char *s, Uint32 color) int stringRGBA(SDL_Surface * dst, Sint16 x, Sint16 y, const char *s, Uint8 r, Uint8 g, Uint8 b, Uint8 a) pygame_sdl2-2.1.0-for-renpy-6.99.14.1/include/controller.pxi0000664000175000017500000000256012560526240022603 0ustar tomtom00000000000000CONTROLLER_BUTTON_INVALID = SDL_CONTROLLER_BUTTON_INVALID CONTROLLER_BUTTON_A = SDL_CONTROLLER_BUTTON_A CONTROLLER_BUTTON_B = SDL_CONTROLLER_BUTTON_B CONTROLLER_BUTTON_X = SDL_CONTROLLER_BUTTON_X CONTROLLER_BUTTON_Y = SDL_CONTROLLER_BUTTON_Y CONTROLLER_BUTTON_BACK = SDL_CONTROLLER_BUTTON_BACK CONTROLLER_BUTTON_GUIDE = SDL_CONTROLLER_BUTTON_GUIDE CONTROLLER_BUTTON_START = SDL_CONTROLLER_BUTTON_START CONTROLLER_BUTTON_LEFTSTICK = SDL_CONTROLLER_BUTTON_LEFTSTICK CONTROLLER_BUTTON_RIGHTSTICK = SDL_CONTROLLER_BUTTON_RIGHTSTICK CONTROLLER_BUTTON_LEFTSHOULDER = SDL_CONTROLLER_BUTTON_LEFTSHOULDER CONTROLLER_BUTTON_RIGHTSHOULDER = SDL_CONTROLLER_BUTTON_RIGHTSHOULDER CONTROLLER_BUTTON_DPAD_UP = SDL_CONTROLLER_BUTTON_DPAD_UP CONTROLLER_BUTTON_DPAD_DOWN = SDL_CONTROLLER_BUTTON_DPAD_DOWN CONTROLLER_BUTTON_DPAD_LEFT = SDL_CONTROLLER_BUTTON_DPAD_LEFT CONTROLLER_BUTTON_DPAD_RIGHT = SDL_CONTROLLER_BUTTON_DPAD_RIGHT CONTROLLER_BUTTON_MAX = SDL_CONTROLLER_BUTTON_MAX CONTROLLER_AXIS_INVALID = SDL_CONTROLLER_AXIS_INVALID CONTROLLER_AXIS_LEFTX = SDL_CONTROLLER_AXIS_LEFTX CONTROLLER_AXIS_LEFTY = SDL_CONTROLLER_AXIS_LEFTY CONTROLLER_AXIS_RIGHTX = SDL_CONTROLLER_AXIS_RIGHTX CONTROLLER_AXIS_RIGHTY = SDL_CONTROLLER_AXIS_RIGHTY CONTROLLER_AXIS_TRIGGERLEFT = SDL_CONTROLLER_AXIS_TRIGGERLEFT CONTROLLER_AXIS_TRIGGERRIGHT = SDL_CONTROLLER_AXIS_TRIGGERRIGHT CONTROLLER_AXIS_MAX = SDL_CONTROLLER_AXIS_MAX pygame_sdl2-2.1.0-for-renpy-6.99.14.1/include/event_names.pxi0000664000175000017500000000352212422340257022722 0ustar tomtom00000000000000# Automatically generated by generate_event_list.py # Do not edit! event_names = { SDL_FIRSTEVENT : u'NOEVENT', SDL_QUIT : 'QUIT', SDL_APP_TERMINATING : 'APP_TERMINATING', SDL_APP_LOWMEMORY : 'APP_LOWMEMORY', SDL_APP_WILLENTERBACKGROUND : 'APP_WILLENTERBACKGROUND', SDL_APP_DIDENTERBACKGROUND : 'APP_DIDENTERBACKGROUND', SDL_APP_WILLENTERFOREGROUND : 'APP_WILLENTERFOREGROUND', SDL_APP_DIDENTERFOREGROUND : 'APP_DIDENTERFOREGROUND', SDL_WINDOWEVENT : 'WINDOWEVENT', SDL_SYSWMEVENT : 'SYSWMEVENT', SDL_KEYDOWN : 'KEYDOWN', SDL_KEYUP : 'KEYUP', SDL_TEXTEDITING : 'TEXTEDITING', SDL_TEXTINPUT : 'TEXTINPUT', SDL_MOUSEMOTION : 'MOUSEMOTION', SDL_MOUSEBUTTONDOWN : 'MOUSEBUTTONDOWN', SDL_MOUSEBUTTONUP : 'MOUSEBUTTONUP', SDL_MOUSEWHEEL : 'MOUSEWHEEL', SDL_JOYAXISMOTION : 'JOYAXISMOTION', SDL_JOYBALLMOTION : 'JOYBALLMOTION', SDL_JOYHATMOTION : 'JOYHATMOTION', SDL_JOYBUTTONDOWN : 'JOYBUTTONDOWN', SDL_JOYBUTTONUP : 'JOYBUTTONUP', SDL_JOYDEVICEADDED : 'JOYDEVICEADDED', SDL_JOYDEVICEREMOVED : 'JOYDEVICEREMOVED', SDL_CONTROLLERAXISMOTION : 'CONTROLLERAXISMOTION', SDL_CONTROLLERBUTTONDOWN : 'CONTROLLERBUTTONDOWN', SDL_CONTROLLERBUTTONUP : 'CONTROLLERBUTTONUP', SDL_CONTROLLERDEVICEADDED : 'CONTROLLERDEVICEADDED', SDL_CONTROLLERDEVICEREMOVED : 'CONTROLLERDEVICEREMOVED', SDL_CONTROLLERDEVICEREMAPPED : 'CONTROLLERDEVICEREMAPPED', SDL_FINGERDOWN : 'FINGERDOWN', SDL_FINGERUP : 'FINGERUP', SDL_FINGERMOTION : 'FINGERMOTION', SDL_DOLLARGESTURE : 'DOLLARGESTURE', SDL_DOLLARRECORD : 'DOLLARRECORD', SDL_MULTIGESTURE : 'MULTIGESTURE', SDL_CLIPBOARDUPDATE : 'CLIPBOARDUPDATE', SDL_DROPFILE : 'DROPFILE', SDL_RENDER_TARGETS_RESET : 'RENDER_TARGETS_RESET', SDL_USEREVENT : 'USEREVENT', SDL_LASTEVENT : 'LASTEVENT', } pygame_sdl2-2.1.0-for-renpy-6.99.14.1/include/event_enum.pxi0000664000175000017500000000233412422340257022563 0ustar tomtom00000000000000# Automatically generated by generate_event_list.py # Do not edit! cdef extern from "SDL.h": enum SDL_EventType: SDL_FIRSTEVENT SDL_QUIT SDL_APP_TERMINATING SDL_APP_LOWMEMORY SDL_APP_WILLENTERBACKGROUND SDL_APP_DIDENTERBACKGROUND SDL_APP_WILLENTERFOREGROUND SDL_APP_DIDENTERFOREGROUND SDL_WINDOWEVENT SDL_SYSWMEVENT SDL_KEYDOWN SDL_KEYUP SDL_TEXTEDITING SDL_TEXTINPUT SDL_MOUSEMOTION SDL_MOUSEBUTTONDOWN SDL_MOUSEBUTTONUP SDL_MOUSEWHEEL SDL_JOYAXISMOTION SDL_JOYBALLMOTION SDL_JOYHATMOTION SDL_JOYBUTTONDOWN SDL_JOYBUTTONUP SDL_JOYDEVICEADDED SDL_JOYDEVICEREMOVED SDL_CONTROLLERAXISMOTION SDL_CONTROLLERBUTTONDOWN SDL_CONTROLLERBUTTONUP SDL_CONTROLLERDEVICEADDED SDL_CONTROLLERDEVICEREMOVED SDL_CONTROLLERDEVICEREMAPPED SDL_FINGERDOWN SDL_FINGERUP SDL_FINGERMOTION SDL_DOLLARGESTURE SDL_DOLLARRECORD SDL_MULTIGESTURE SDL_CLIPBOARDUPDATE SDL_DROPFILE SDL_RENDER_TARGETS_RESET SDL_USEREVENT SDL_LASTEVENT pygame_sdl2-2.1.0-for-renpy-6.99.14.1/include/keycode_list.pxi0000664000175000017500000001264012424701417023076 0ustar tomtom00000000000000# Automatically generated by generate_keycode_list.py # Do not edit! K_UNKNOWN = SDLK_UNKNOWN K_RETURN = SDLK_RETURN K_ESCAPE = SDLK_ESCAPE K_BACKSPACE = SDLK_BACKSPACE K_TAB = SDLK_TAB K_SPACE = SDLK_SPACE K_EXCLAIM = SDLK_EXCLAIM K_QUOTEDBL = SDLK_QUOTEDBL K_HASH = SDLK_HASH K_PERCENT = SDLK_PERCENT K_DOLLAR = SDLK_DOLLAR K_AMPERSAND = SDLK_AMPERSAND K_QUOTE = SDLK_QUOTE K_LEFTPAREN = SDLK_LEFTPAREN K_RIGHTPAREN = SDLK_RIGHTPAREN K_ASTERISK = SDLK_ASTERISK K_PLUS = SDLK_PLUS K_COMMA = SDLK_COMMA K_MINUS = SDLK_MINUS K_PERIOD = SDLK_PERIOD K_SLASH = SDLK_SLASH K_0 = SDLK_0 K_1 = SDLK_1 K_2 = SDLK_2 K_3 = SDLK_3 K_4 = SDLK_4 K_5 = SDLK_5 K_6 = SDLK_6 K_7 = SDLK_7 K_8 = SDLK_8 K_9 = SDLK_9 K_COLON = SDLK_COLON K_SEMICOLON = SDLK_SEMICOLON K_LESS = SDLK_LESS K_EQUALS = SDLK_EQUALS K_GREATER = SDLK_GREATER K_QUESTION = SDLK_QUESTION K_AT = SDLK_AT K_LEFTBRACKET = SDLK_LEFTBRACKET K_BACKSLASH = SDLK_BACKSLASH K_RIGHTBRACKET = SDLK_RIGHTBRACKET K_CARET = SDLK_CARET K_UNDERSCORE = SDLK_UNDERSCORE K_BACKQUOTE = SDLK_BACKQUOTE K_a = SDLK_a K_b = SDLK_b K_c = SDLK_c K_d = SDLK_d K_e = SDLK_e K_f = SDLK_f K_g = SDLK_g K_h = SDLK_h K_i = SDLK_i K_j = SDLK_j K_k = SDLK_k K_l = SDLK_l K_m = SDLK_m K_n = SDLK_n K_o = SDLK_o K_p = SDLK_p K_q = SDLK_q K_r = SDLK_r K_s = SDLK_s K_t = SDLK_t K_u = SDLK_u K_v = SDLK_v K_w = SDLK_w K_x = SDLK_x K_y = SDLK_y K_z = SDLK_z K_CAPSLOCK = SDLK_CAPSLOCK K_F1 = SDLK_F1 K_F2 = SDLK_F2 K_F3 = SDLK_F3 K_F4 = SDLK_F4 K_F5 = SDLK_F5 K_F6 = SDLK_F6 K_F7 = SDLK_F7 K_F8 = SDLK_F8 K_F9 = SDLK_F9 K_F10 = SDLK_F10 K_F11 = SDLK_F11 K_F12 = SDLK_F12 K_PRINTSCREEN = SDLK_PRINTSCREEN K_SCROLLLOCK = SDLK_SCROLLLOCK K_PAUSE = SDLK_PAUSE K_INSERT = SDLK_INSERT K_HOME = SDLK_HOME K_PAGEUP = SDLK_PAGEUP K_DELETE = SDLK_DELETE K_END = SDLK_END K_PAGEDOWN = SDLK_PAGEDOWN K_RIGHT = SDLK_RIGHT K_LEFT = SDLK_LEFT K_DOWN = SDLK_DOWN K_UP = SDLK_UP K_NUMLOCKCLEAR = SDLK_NUMLOCKCLEAR K_KP_DIVIDE = SDLK_KP_DIVIDE K_KP_MULTIPLY = SDLK_KP_MULTIPLY K_KP_MINUS = SDLK_KP_MINUS K_KP_PLUS = SDLK_KP_PLUS K_KP_ENTER = SDLK_KP_ENTER K_KP_1 = SDLK_KP_1 K_KP_2 = SDLK_KP_2 K_KP_3 = SDLK_KP_3 K_KP_4 = SDLK_KP_4 K_KP_5 = SDLK_KP_5 K_KP_6 = SDLK_KP_6 K_KP_7 = SDLK_KP_7 K_KP_8 = SDLK_KP_8 K_KP_9 = SDLK_KP_9 K_KP_0 = SDLK_KP_0 K_KP_PERIOD = SDLK_KP_PERIOD K_APPLICATION = SDLK_APPLICATION K_POWER = SDLK_POWER K_KP_EQUALS = SDLK_KP_EQUALS K_F13 = SDLK_F13 K_F14 = SDLK_F14 K_F15 = SDLK_F15 K_F16 = SDLK_F16 K_F17 = SDLK_F17 K_F18 = SDLK_F18 K_F19 = SDLK_F19 K_F20 = SDLK_F20 K_F21 = SDLK_F21 K_F22 = SDLK_F22 K_F23 = SDLK_F23 K_F24 = SDLK_F24 K_EXECUTE = SDLK_EXECUTE K_HELP = SDLK_HELP K_MENU = SDLK_MENU K_SELECT = SDLK_SELECT K_STOP = SDLK_STOP K_AGAIN = SDLK_AGAIN K_UNDO = SDLK_UNDO K_CUT = SDLK_CUT K_COPY = SDLK_COPY K_PASTE = SDLK_PASTE K_FIND = SDLK_FIND K_MUTE = SDLK_MUTE K_VOLUMEUP = SDLK_VOLUMEUP K_VOLUMEDOWN = SDLK_VOLUMEDOWN K_KP_COMMA = SDLK_KP_COMMA K_KP_EQUALSAS400 = SDLK_KP_EQUALSAS400 K_ALTERASE = SDLK_ALTERASE K_SYSREQ = SDLK_SYSREQ K_CANCEL = SDLK_CANCEL K_CLEAR = SDLK_CLEAR K_PRIOR = SDLK_PRIOR K_RETURN2 = SDLK_RETURN2 K_SEPARATOR = SDLK_SEPARATOR K_OUT = SDLK_OUT K_OPER = SDLK_OPER K_CLEARAGAIN = SDLK_CLEARAGAIN K_CRSEL = SDLK_CRSEL K_EXSEL = SDLK_EXSEL K_KP_00 = SDLK_KP_00 K_KP_000 = SDLK_KP_000 K_THOUSANDSSEPARATOR = SDLK_THOUSANDSSEPARATOR K_DECIMALSEPARATOR = SDLK_DECIMALSEPARATOR K_CURRENCYUNIT = SDLK_CURRENCYUNIT K_CURRENCYSUBUNIT = SDLK_CURRENCYSUBUNIT K_KP_LEFTPAREN = SDLK_KP_LEFTPAREN K_KP_RIGHTPAREN = SDLK_KP_RIGHTPAREN K_KP_LEFTBRACE = SDLK_KP_LEFTBRACE K_KP_RIGHTBRACE = SDLK_KP_RIGHTBRACE K_KP_TAB = SDLK_KP_TAB K_KP_BACKSPACE = SDLK_KP_BACKSPACE K_KP_A = SDLK_KP_A K_KP_B = SDLK_KP_B K_KP_C = SDLK_KP_C K_KP_D = SDLK_KP_D K_KP_E = SDLK_KP_E K_KP_F = SDLK_KP_F K_KP_XOR = SDLK_KP_XOR K_KP_POWER = SDLK_KP_POWER K_KP_PERCENT = SDLK_KP_PERCENT K_KP_LESS = SDLK_KP_LESS K_KP_GREATER = SDLK_KP_GREATER K_KP_AMPERSAND = SDLK_KP_AMPERSAND K_KP_DBLAMPERSAND = SDLK_KP_DBLAMPERSAND K_KP_VERTICALBAR = SDLK_KP_VERTICALBAR K_KP_DBLVERTICALBAR = SDLK_KP_DBLVERTICALBAR K_KP_COLON = SDLK_KP_COLON K_KP_HASH = SDLK_KP_HASH K_KP_SPACE = SDLK_KP_SPACE K_KP_AT = SDLK_KP_AT K_KP_EXCLAM = SDLK_KP_EXCLAM K_KP_MEMSTORE = SDLK_KP_MEMSTORE K_KP_MEMRECALL = SDLK_KP_MEMRECALL K_KP_MEMCLEAR = SDLK_KP_MEMCLEAR K_KP_MEMADD = SDLK_KP_MEMADD K_KP_MEMSUBTRACT = SDLK_KP_MEMSUBTRACT K_KP_MEMMULTIPLY = SDLK_KP_MEMMULTIPLY K_KP_MEMDIVIDE = SDLK_KP_MEMDIVIDE K_KP_PLUSMINUS = SDLK_KP_PLUSMINUS K_KP_CLEAR = SDLK_KP_CLEAR K_KP_CLEARENTRY = SDLK_KP_CLEARENTRY K_KP_BINARY = SDLK_KP_BINARY K_KP_OCTAL = SDLK_KP_OCTAL K_KP_DECIMAL = SDLK_KP_DECIMAL K_KP_HEXADECIMAL = SDLK_KP_HEXADECIMAL K_LCTRL = SDLK_LCTRL K_LSHIFT = SDLK_LSHIFT K_LALT = SDLK_LALT K_LGUI = SDLK_LGUI K_RCTRL = SDLK_RCTRL K_RSHIFT = SDLK_RSHIFT K_RALT = SDLK_RALT K_RGUI = SDLK_RGUI K_MODE = SDLK_MODE K_AUDIONEXT = SDLK_AUDIONEXT K_AUDIOPREV = SDLK_AUDIOPREV K_AUDIOSTOP = SDLK_AUDIOSTOP K_AUDIOPLAY = SDLK_AUDIOPLAY K_AUDIOMUTE = SDLK_AUDIOMUTE K_MEDIASELECT = SDLK_MEDIASELECT K_WWW = SDLK_WWW K_MAIL = SDLK_MAIL K_CALCULATOR = SDLK_CALCULATOR K_COMPUTER = SDLK_COMPUTER K_AC_SEARCH = SDLK_AC_SEARCH K_AC_HOME = SDLK_AC_HOME K_AC_BACK = SDLK_AC_BACK K_AC_FORWARD = SDLK_AC_FORWARD K_AC_STOP = SDLK_AC_STOP K_AC_REFRESH = SDLK_AC_REFRESH K_AC_BOOKMARKS = SDLK_AC_BOOKMARKS K_BRIGHTNESSDOWN = SDLK_BRIGHTNESSDOWN K_BRIGHTNESSUP = SDLK_BRIGHTNESSUP K_DISPLAYSWITCH = SDLK_DISPLAYSWITCH K_KBDILLUMTOGGLE = SDLK_KBDILLUMTOGGLE K_KBDILLUMDOWN = SDLK_KBDILLUMDOWN K_KBDILLUMUP = SDLK_KBDILLUMUP K_EJECT = SDLK_EJECT K_SLEEP = SDLK_SLEEP pygame_sdl2-2.1.0-for-renpy-6.99.14.1/include/glattr.pxi0000664000175000017500000000202612425521225021710 0ustar tomtom00000000000000GL_RED_SIZE = SDL_GL_RED_SIZE GL_GREEN_SIZE = SDL_GL_GREEN_SIZE GL_BLUE_SIZE = SDL_GL_BLUE_SIZE GL_ALPHA_SIZE = SDL_GL_ALPHA_SIZE GL_BUFFER_SIZE = SDL_GL_BUFFER_SIZE GL_DOUBLEBUFFER = SDL_GL_DOUBLEBUFFER GL_DEPTH_SIZE = SDL_GL_DEPTH_SIZE GL_STENCIL_SIZE = SDL_GL_STENCIL_SIZE GL_ACCUM_RED_SIZE = SDL_GL_ACCUM_RED_SIZE GL_ACCUM_GREEN_SIZE = SDL_GL_ACCUM_GREEN_SIZE GL_ACCUM_BLUE_SIZE = SDL_GL_ACCUM_BLUE_SIZE GL_ACCUM_ALPHA_SIZE = SDL_GL_ACCUM_ALPHA_SIZE GL_STEREO = SDL_GL_STEREO GL_MULTISAMPLEBUFFERS = SDL_GL_MULTISAMPLEBUFFERS GL_MULTISAMPLESAMPLES = SDL_GL_MULTISAMPLESAMPLES GL_ACCELERATED_VISUAL = SDL_GL_ACCELERATED_VISUAL GL_RETAINED_BACKING = SDL_GL_RETAINED_BACKING GL_CONTEXT_MAJOR_VERSION = SDL_GL_CONTEXT_MAJOR_VERSION GL_CONTEXT_MINOR_VERSION = SDL_GL_CONTEXT_MINOR_VERSION GL_CONTEXT_EGL = SDL_GL_CONTEXT_EGL GL_CONTEXT_FLAGS = SDL_GL_CONTEXT_FLAGS GL_CONTEXT_PROFILE_MASK = SDL_GL_CONTEXT_PROFILE_MASK GL_SHARE_WITH_CURRENT_CONTEXT = SDL_GL_SHARE_WITH_CURRENT_CONTEXT GL_FRAMEBUFFER_SRGB_CAPABLE = SDL_GL_FRAMEBUFFER_SRGB_CAPABLE pygame_sdl2-2.1.0-for-renpy-6.99.14.1/include/event_list.pxi0000664000175000017500000000303112422340257022565 0ustar tomtom00000000000000# Automatically generated by generate_event_list.py # Do not edit! NOEVENT = SDL_FIRSTEVENT QUIT = SDL_QUIT APP_TERMINATING = SDL_APP_TERMINATING APP_LOWMEMORY = SDL_APP_LOWMEMORY APP_WILLENTERBACKGROUND = SDL_APP_WILLENTERBACKGROUND APP_DIDENTERBACKGROUND = SDL_APP_DIDENTERBACKGROUND APP_WILLENTERFOREGROUND = SDL_APP_WILLENTERFOREGROUND APP_DIDENTERFOREGROUND = SDL_APP_DIDENTERFOREGROUND WINDOWEVENT = SDL_WINDOWEVENT SYSWMEVENT = SDL_SYSWMEVENT KEYDOWN = SDL_KEYDOWN KEYUP = SDL_KEYUP TEXTEDITING = SDL_TEXTEDITING TEXTINPUT = SDL_TEXTINPUT MOUSEMOTION = SDL_MOUSEMOTION MOUSEBUTTONDOWN = SDL_MOUSEBUTTONDOWN MOUSEBUTTONUP = SDL_MOUSEBUTTONUP MOUSEWHEEL = SDL_MOUSEWHEEL JOYAXISMOTION = SDL_JOYAXISMOTION JOYBALLMOTION = SDL_JOYBALLMOTION JOYHATMOTION = SDL_JOYHATMOTION JOYBUTTONDOWN = SDL_JOYBUTTONDOWN JOYBUTTONUP = SDL_JOYBUTTONUP JOYDEVICEADDED = SDL_JOYDEVICEADDED JOYDEVICEREMOVED = SDL_JOYDEVICEREMOVED CONTROLLERAXISMOTION = SDL_CONTROLLERAXISMOTION CONTROLLERBUTTONDOWN = SDL_CONTROLLERBUTTONDOWN CONTROLLERBUTTONUP = SDL_CONTROLLERBUTTONUP CONTROLLERDEVICEADDED = SDL_CONTROLLERDEVICEADDED CONTROLLERDEVICEREMOVED = SDL_CONTROLLERDEVICEREMOVED CONTROLLERDEVICEREMAPPED = SDL_CONTROLLERDEVICEREMAPPED FINGERDOWN = SDL_FINGERDOWN FINGERUP = SDL_FINGERUP FINGERMOTION = SDL_FINGERMOTION DOLLARGESTURE = SDL_DOLLARGESTURE DOLLARRECORD = SDL_DOLLARRECORD MULTIGESTURE = SDL_MULTIGESTURE CLIPBOARDUPDATE = SDL_CLIPBOARDUPDATE DROPFILE = SDL_DROPFILE RENDER_TARGETS_RESET = SDL_RENDER_TARGETS_RESET USEREVENT = SDL_USEREVENT LASTEVENT = SDL_LASTEVENT pygame_sdl2-2.1.0-for-renpy-6.99.14.1/include/color_dict.pxi0000664000175000017500000005401612425046637022553 0ustar tomtom00000000000000# Automatically generated by generate_colordict.py # Do not edit! cdef object colors = { 'aliceblue' : (240, 248, 255), 'antiquewhite' : (250, 235, 215), 'antiquewhite1' : (255, 239, 219), 'antiquewhite2' : (238, 223, 204), 'antiquewhite3' : (205, 192, 176), 'antiquewhite4' : (139, 131, 120), 'aqua' : (0, 255, 255), 'aquamarine' : (127, 255, 212), 'aquamarine1' : (127, 255, 212), 'aquamarine2' : (118, 238, 198), 'aquamarine3' : (102, 205, 170), 'aquamarine4' : (69, 139, 116), 'azure' : (240, 255, 255), 'azure1' : (240, 255, 255), 'azure2' : (224, 238, 238), 'azure3' : (193, 205, 205), 'azure4' : (131, 139, 139), 'beige' : (245, 245, 220), 'bisque' : (255, 228, 196), 'bisque1' : (255, 228, 196), 'bisque2' : (238, 213, 183), 'bisque3' : (205, 183, 158), 'bisque4' : (139, 125, 107), 'black' : (0, 0, 0), 'blanchedalmond' : (255, 235, 205), 'blue' : (0, 0, 255), 'blue1' : (0, 0, 255), 'blue2' : (0, 0, 238), 'blue3' : (0, 0, 205), 'blue4' : (0, 0, 139), 'blueviolet' : (138, 43, 226), 'brown' : (165, 42, 42), 'brown1' : (255, 64, 64), 'brown2' : (238, 59, 59), 'brown3' : (205, 51, 51), 'brown4' : (139, 35, 35), 'burlywood' : (222, 184, 135), 'burlywood1' : (255, 211, 155), 'burlywood2' : (238, 197, 145), 'burlywood3' : (205, 170, 125), 'burlywood4' : (139, 115, 85), 'cadetblue' : (95, 158, 160), 'cadetblue1' : (152, 245, 255), 'cadetblue2' : (142, 229, 238), 'cadetblue3' : (122, 197, 205), 'cadetblue4' : (83, 134, 139), 'chartreuse' : (127, 255, 0), 'chartreuse1' : (127, 255, 0), 'chartreuse2' : (118, 238, 0), 'chartreuse3' : (102, 205, 0), 'chartreuse4' : (69, 139, 0), 'chocolate' : (210, 105, 30), 'chocolate1' : (255, 127, 36), 'chocolate2' : (238, 118, 33), 'chocolate3' : (205, 102, 29), 'chocolate4' : (139, 69, 19), 'coral' : (255, 127, 80), 'coral1' : (255, 114, 86), 'coral2' : (238, 106, 80), 'coral3' : (205, 91, 69), 'coral4' : (139, 62, 47), 'cornflowerblue' : (100, 149, 237), 'cornsilk' : (255, 248, 220), 'cornsilk1' : (255, 248, 220), 'cornsilk2' : (238, 232, 205), 'cornsilk3' : (205, 200, 177), 'cornsilk4' : (139, 136, 120), 'crimson' : (220, 20, 60), 'cyan' : (0, 255, 255), 'cyan1' : (0, 255, 255), 'cyan2' : (0, 238, 238), 'cyan3' : (0, 205, 205), 'cyan4' : (0, 139, 139), 'darkblue' : (0, 0, 139), 'darkcyan' : (0, 139, 139), 'darkgoldenrod' : (184, 134, 11), 'darkgoldenrod1' : (255, 185, 15), 'darkgoldenrod2' : (238, 173, 14), 'darkgoldenrod3' : (205, 149, 12), 'darkgoldenrod4' : (139, 101, 8), 'darkgray' : (169, 169, 169), 'darkgreen' : (0, 100, 0), 'darkgrey' : (169, 169, 169), 'darkkhaki' : (189, 183, 107), 'darkmagenta' : (139, 0, 139), 'darkolivegreen' : (85, 107, 47), 'darkolivegreen1' : (202, 255, 112), 'darkolivegreen2' : (188, 238, 104), 'darkolivegreen3' : (162, 205, 90), 'darkolivegreen4' : (110, 139, 61), 'darkorange' : (255, 140, 0), 'darkorange1' : (255, 127, 0), 'darkorange2' : (238, 118, 0), 'darkorange3' : (205, 102, 0), 'darkorange4' : (139, 69, 0), 'darkorchid' : (153, 50, 204), 'darkorchid1' : (191, 62, 255), 'darkorchid2' : (178, 58, 238), 'darkorchid3' : (154, 50, 205), 'darkorchid4' : (104, 34, 139), 'darkred' : (139, 0, 0), 'darksalmon' : (233, 150, 122), 'darkseagreen' : (143, 188, 143), 'darkseagreen1' : (193, 255, 193), 'darkseagreen2' : (180, 238, 180), 'darkseagreen3' : (155, 205, 155), 'darkseagreen4' : (105, 139, 105), 'darkslateblue' : (72, 61, 139), 'darkslategray' : (47, 79, 79), 'darkslategray1' : (151, 255, 255), 'darkslategray2' : (141, 238, 238), 'darkslategray3' : (121, 205, 205), 'darkslategray4' : (82, 139, 139), 'darkslategrey' : (47, 79, 79), 'darkturquoise' : (0, 206, 209), 'darkviolet' : (148, 0, 211), 'deeppink' : (255, 20, 147), 'deeppink1' : (255, 20, 147), 'deeppink2' : (238, 18, 137), 'deeppink3' : (205, 16, 118), 'deeppink4' : (139, 10, 80), 'deepskyblue' : (0, 191, 255), 'deepskyblue1' : (0, 191, 255), 'deepskyblue2' : (0, 178, 238), 'deepskyblue3' : (0, 154, 205), 'deepskyblue4' : (0, 104, 139), 'dimgray' : (105, 105, 105), 'dimgrey' : (105, 105, 105), 'dodgerblue' : (30, 144, 255), 'dodgerblue1' : (30, 144, 255), 'dodgerblue2' : (28, 134, 238), 'dodgerblue3' : (24, 116, 205), 'dodgerblue4' : (16, 78, 139), 'firebrick' : (178, 34, 34), 'firebrick1' : (255, 48, 48), 'firebrick2' : (238, 44, 44), 'firebrick3' : (205, 38, 38), 'firebrick4' : (139, 26, 26), 'floralwhite' : (255, 250, 240), 'forestgreen' : (34, 139, 34), 'fuchsia' : (255, 0, 255), 'gainsboro' : (220, 220, 220), 'ghostwhite' : (248, 248, 255), 'gold' : (255, 215, 0), 'gold1' : (255, 215, 0), 'gold2' : (238, 201, 0), 'gold3' : (205, 173, 0), 'gold4' : (139, 117, 0), 'goldenrod' : (218, 165, 32), 'goldenrod1' : (255, 193, 37), 'goldenrod2' : (238, 180, 34), 'goldenrod3' : (205, 155, 29), 'goldenrod4' : (139, 105, 20), 'gray' : (190, 190, 190), 'gray0' : (0, 0, 0), 'gray1' : (3, 3, 3), 'gray10' : (26, 26, 26), 'gray100' : (255, 255, 255), 'gray11' : (28, 28, 28), 'gray12' : (31, 31, 31), 'gray13' : (33, 33, 33), 'gray14' : (36, 36, 36), 'gray15' : (38, 38, 38), 'gray16' : (41, 41, 41), 'gray17' : (43, 43, 43), 'gray18' : (46, 46, 46), 'gray19' : (48, 48, 48), 'gray2' : (5, 5, 5), 'gray20' : (51, 51, 51), 'gray21' : (54, 54, 54), 'gray22' : (56, 56, 56), 'gray23' : (59, 59, 59), 'gray24' : (61, 61, 61), 'gray25' : (64, 64, 64), 'gray26' : (66, 66, 66), 'gray27' : (69, 69, 69), 'gray28' : (71, 71, 71), 'gray29' : (74, 74, 74), 'gray3' : (8, 8, 8), 'gray30' : (77, 77, 77), 'gray31' : (79, 79, 79), 'gray32' : (82, 82, 82), 'gray33' : (84, 84, 84), 'gray34' : (87, 87, 87), 'gray35' : (89, 89, 89), 'gray36' : (92, 92, 92), 'gray37' : (94, 94, 94), 'gray38' : (97, 97, 97), 'gray39' : (99, 99, 99), 'gray4' : (10, 10, 10), 'gray40' : (102, 102, 102), 'gray41' : (105, 105, 105), 'gray42' : (107, 107, 107), 'gray43' : (110, 110, 110), 'gray44' : (112, 112, 112), 'gray45' : (115, 115, 115), 'gray46' : (117, 117, 117), 'gray47' : (120, 120, 120), 'gray48' : (122, 122, 122), 'gray49' : (125, 125, 125), 'gray5' : (13, 13, 13), 'gray50' : (127, 127, 127), 'gray51' : (130, 130, 130), 'gray52' : (133, 133, 133), 'gray53' : (135, 135, 135), 'gray54' : (138, 138, 138), 'gray55' : (140, 140, 140), 'gray56' : (143, 143, 143), 'gray57' : (145, 145, 145), 'gray58' : (148, 148, 148), 'gray59' : (150, 150, 150), 'gray6' : (15, 15, 15), 'gray60' : (153, 153, 153), 'gray61' : (156, 156, 156), 'gray62' : (158, 158, 158), 'gray63' : (161, 161, 161), 'gray64' : (163, 163, 163), 'gray65' : (166, 166, 166), 'gray66' : (168, 168, 168), 'gray67' : (171, 171, 171), 'gray68' : (173, 173, 173), 'gray69' : (176, 176, 176), 'gray7' : (18, 18, 18), 'gray70' : (179, 179, 179), 'gray71' : (181, 181, 181), 'gray72' : (184, 184, 184), 'gray73' : (186, 186, 186), 'gray74' : (189, 189, 189), 'gray75' : (191, 191, 191), 'gray76' : (194, 194, 194), 'gray77' : (196, 196, 196), 'gray78' : (199, 199, 199), 'gray79' : (201, 201, 201), 'gray8' : (20, 20, 20), 'gray80' : (204, 204, 204), 'gray81' : (207, 207, 207), 'gray82' : (209, 209, 209), 'gray83' : (212, 212, 212), 'gray84' : (214, 214, 214), 'gray85' : (217, 217, 217), 'gray86' : (219, 219, 219), 'gray87' : (222, 222, 222), 'gray88' : (224, 224, 224), 'gray89' : (227, 227, 227), 'gray9' : (23, 23, 23), 'gray90' : (229, 229, 229), 'gray91' : (232, 232, 232), 'gray92' : (235, 235, 235), 'gray93' : (237, 237, 237), 'gray94' : (240, 240, 240), 'gray95' : (242, 242, 242), 'gray96' : (245, 245, 245), 'gray97' : (247, 247, 247), 'gray98' : (250, 250, 250), 'gray99' : (252, 252, 252), 'green' : (0, 255, 0), 'green1' : (0, 255, 0), 'green2' : (0, 238, 0), 'green3' : (0, 205, 0), 'green4' : (0, 139, 0), 'greenyellow' : (173, 255, 47), 'grey' : (190, 190, 190), 'grey0' : (0, 0, 0), 'grey1' : (3, 3, 3), 'grey10' : (26, 26, 26), 'grey100' : (255, 255, 255), 'grey11' : (28, 28, 28), 'grey12' : (31, 31, 31), 'grey13' : (33, 33, 33), 'grey14' : (36, 36, 36), 'grey15' : (38, 38, 38), 'grey16' : (41, 41, 41), 'grey17' : (43, 43, 43), 'grey18' : (46, 46, 46), 'grey19' : (48, 48, 48), 'grey2' : (5, 5, 5), 'grey20' : (51, 51, 51), 'grey21' : (54, 54, 54), 'grey22' : (56, 56, 56), 'grey23' : (59, 59, 59), 'grey24' : (61, 61, 61), 'grey25' : (64, 64, 64), 'grey26' : (66, 66, 66), 'grey27' : (69, 69, 69), 'grey28' : (71, 71, 71), 'grey29' : (74, 74, 74), 'grey3' : (8, 8, 8), 'grey30' : (77, 77, 77), 'grey31' : (79, 79, 79), 'grey32' : (82, 82, 82), 'grey33' : (84, 84, 84), 'grey34' : (87, 87, 87), 'grey35' : (89, 89, 89), 'grey36' : (92, 92, 92), 'grey37' : (94, 94, 94), 'grey38' : (97, 97, 97), 'grey39' : (99, 99, 99), 'grey4' : (10, 10, 10), 'grey40' : (102, 102, 102), 'grey41' : (105, 105, 105), 'grey42' : (107, 107, 107), 'grey43' : (110, 110, 110), 'grey44' : (112, 112, 112), 'grey45' : (115, 115, 115), 'grey46' : (117, 117, 117), 'grey47' : (120, 120, 120), 'grey48' : (122, 122, 122), 'grey49' : (125, 125, 125), 'grey5' : (13, 13, 13), 'grey50' : (127, 127, 127), 'grey51' : (130, 130, 130), 'grey52' : (133, 133, 133), 'grey53' : (135, 135, 135), 'grey54' : (138, 138, 138), 'grey55' : (140, 140, 140), 'grey56' : (143, 143, 143), 'grey57' : (145, 145, 145), 'grey58' : (148, 148, 148), 'grey59' : (150, 150, 150), 'grey6' : (15, 15, 15), 'grey60' : (153, 153, 153), 'grey61' : (156, 156, 156), 'grey62' : (158, 158, 158), 'grey63' : (161, 161, 161), 'grey64' : (163, 163, 163), 'grey65' : (166, 166, 166), 'grey66' : (168, 168, 168), 'grey67' : (171, 171, 171), 'grey68' : (173, 173, 173), 'grey69' : (176, 176, 176), 'grey7' : (18, 18, 18), 'grey70' : (179, 179, 179), 'grey71' : (181, 181, 181), 'grey72' : (184, 184, 184), 'grey73' : (186, 186, 186), 'grey74' : (189, 189, 189), 'grey75' : (191, 191, 191), 'grey76' : (194, 194, 194), 'grey77' : (196, 196, 196), 'grey78' : (199, 199, 199), 'grey79' : (201, 201, 201), 'grey8' : (20, 20, 20), 'grey80' : (204, 204, 204), 'grey81' : (207, 207, 207), 'grey82' : (209, 209, 209), 'grey83' : (212, 212, 212), 'grey84' : (214, 214, 214), 'grey85' : (217, 217, 217), 'grey86' : (219, 219, 219), 'grey87' : (222, 222, 222), 'grey88' : (224, 224, 224), 'grey89' : (227, 227, 227), 'grey9' : (23, 23, 23), 'grey90' : (229, 229, 229), 'grey91' : (232, 232, 232), 'grey92' : (235, 235, 235), 'grey93' : (237, 237, 237), 'grey94' : (240, 240, 240), 'grey95' : (242, 242, 242), 'grey96' : (245, 245, 245), 'grey97' : (247, 247, 247), 'grey98' : (250, 250, 250), 'grey99' : (252, 252, 252), 'honeydew' : (240, 255, 240), 'honeydew1' : (240, 255, 240), 'honeydew2' : (224, 238, 224), 'honeydew3' : (193, 205, 193), 'honeydew4' : (131, 139, 131), 'hotpink' : (255, 105, 180), 'hotpink1' : (255, 110, 180), 'hotpink2' : (238, 106, 167), 'hotpink3' : (205, 96, 144), 'hotpink4' : (139, 58, 98), 'indianred' : (205, 92, 92), 'indianred1' : (255, 106, 106), 'indianred2' : (238, 99, 99), 'indianred3' : (205, 85, 85), 'indianred4' : (139, 58, 58), 'indigo' : (75, 0, 130), 'ivory' : (255, 255, 240), 'ivory1' : (255, 255, 240), 'ivory2' : (238, 238, 224), 'ivory3' : (205, 205, 193), 'ivory4' : (139, 139, 131), 'khaki' : (240, 230, 140), 'khaki1' : (255, 246, 143), 'khaki2' : (238, 230, 133), 'khaki3' : (205, 198, 115), 'khaki4' : (139, 134, 78), 'lavender' : (230, 230, 250), 'lavenderblush' : (255, 240, 245), 'lavenderblush1' : (255, 240, 245), 'lavenderblush2' : (238, 224, 229), 'lavenderblush3' : (205, 193, 197), 'lavenderblush4' : (139, 131, 134), 'lawngreen' : (124, 252, 0), 'lemonchiffon' : (255, 250, 205), 'lemonchiffon1' : (255, 250, 205), 'lemonchiffon2' : (238, 233, 191), 'lemonchiffon3' : (205, 201, 165), 'lemonchiffon4' : (139, 137, 112), 'lightblue' : (173, 216, 230), 'lightblue1' : (191, 239, 255), 'lightblue2' : (178, 223, 238), 'lightblue3' : (154, 192, 205), 'lightblue4' : (104, 131, 139), 'lightcoral' : (240, 128, 128), 'lightcyan' : (224, 255, 255), 'lightcyan1' : (224, 255, 255), 'lightcyan2' : (209, 238, 238), 'lightcyan3' : (180, 205, 205), 'lightcyan4' : (122, 139, 139), 'lightgoldenrod' : (238, 221, 130), 'lightgoldenrod1' : (255, 236, 139), 'lightgoldenrod2' : (238, 220, 130), 'lightgoldenrod3' : (205, 190, 112), 'lightgoldenrod4' : (139, 129, 76), 'lightgoldenrodyellow' : (250, 250, 210), 'lightgray' : (211, 211, 211), 'lightgreen' : (144, 238, 144), 'lightgrey' : (211, 211, 211), 'lightpink' : (255, 182, 193), 'lightpink1' : (255, 174, 185), 'lightpink2' : (238, 162, 173), 'lightpink3' : (205, 140, 149), 'lightpink4' : (139, 95, 101), 'lightsalmon' : (255, 160, 122), 'lightsalmon1' : (255, 160, 122), 'lightsalmon2' : (238, 149, 114), 'lightsalmon3' : (205, 129, 98), 'lightsalmon4' : (139, 87, 66), 'lightseagreen' : (32, 178, 170), 'lightskyblue' : (135, 206, 250), 'lightskyblue1' : (176, 226, 255), 'lightskyblue2' : (164, 211, 238), 'lightskyblue3' : (141, 182, 205), 'lightskyblue4' : (96, 123, 139), 'lightslateblue' : (132, 112, 255), 'lightslategray' : (119, 136, 153), 'lightslategrey' : (119, 136, 153), 'lightsteelblue' : (176, 196, 222), 'lightsteelblue1' : (202, 225, 255), 'lightsteelblue2' : (188, 210, 238), 'lightsteelblue3' : (162, 181, 205), 'lightsteelblue4' : (110, 123, 139), 'lightyellow' : (255, 255, 224), 'lightyellow1' : (255, 255, 224), 'lightyellow2' : (238, 238, 209), 'lightyellow3' : (205, 205, 180), 'lightyellow4' : (139, 139, 122), 'lime' : (0, 255, 0), 'limegreen' : (50, 205, 50), 'linen' : (250, 240, 230), 'magenta' : (255, 0, 255), 'magenta1' : (255, 0, 255), 'magenta2' : (238, 0, 238), 'magenta3' : (205, 0, 205), 'magenta4' : (139, 0, 139), 'maroon' : (176, 48, 96), 'maroon1' : (255, 52, 179), 'maroon2' : (238, 48, 167), 'maroon3' : (205, 41, 144), 'maroon4' : (139, 28, 98), 'mediumaquamarine' : (102, 205, 170), 'mediumblue' : (0, 0, 205), 'mediumorchid' : (186, 85, 211), 'mediumorchid1' : (224, 102, 255), 'mediumorchid2' : (209, 95, 238), 'mediumorchid3' : (180, 82, 205), 'mediumorchid4' : (122, 55, 139), 'mediumpurple' : (147, 112, 219), 'mediumpurple1' : (171, 130, 255), 'mediumpurple2' : (159, 121, 238), 'mediumpurple3' : (137, 104, 205), 'mediumpurple4' : (93, 71, 139), 'mediumseagreen' : (60, 179, 113), 'mediumslateblue' : (123, 104, 238), 'mediumspringgreen' : (0, 250, 154), 'mediumturquoise' : (72, 209, 204), 'mediumvioletred' : (199, 21, 133), 'midnightblue' : (25, 25, 112), 'mintcream' : (245, 255, 250), 'mistyrose' : (255, 228, 225), 'mistyrose1' : (255, 228, 225), 'mistyrose2' : (238, 213, 210), 'mistyrose3' : (205, 183, 181), 'mistyrose4' : (139, 125, 123), 'moccasin' : (255, 228, 181), 'navajowhite' : (255, 222, 173), 'navajowhite1' : (255, 222, 173), 'navajowhite2' : (238, 207, 161), 'navajowhite3' : (205, 179, 139), 'navajowhite4' : (139, 121, 94), 'navy' : (0, 0, 128), 'navyblue' : (0, 0, 128), 'oldlace' : (253, 245, 230), 'olive' : (128, 128, 0), 'olivedrab' : (107, 142, 35), 'olivedrab1' : (192, 255, 62), 'olivedrab2' : (179, 238, 58), 'olivedrab3' : (154, 205, 50), 'olivedrab4' : (105, 139, 34), 'orange' : (255, 165, 0), 'orange1' : (255, 165, 0), 'orange2' : (238, 154, 0), 'orange3' : (205, 133, 0), 'orange4' : (139, 90, 0), 'orangered' : (255, 69, 0), 'orangered1' : (255, 69, 0), 'orangered2' : (238, 64, 0), 'orangered3' : (205, 55, 0), 'orangered4' : (139, 37, 0), 'orchid' : (218, 112, 214), 'orchid1' : (255, 131, 250), 'orchid2' : (238, 122, 233), 'orchid3' : (205, 105, 201), 'orchid4' : (139, 71, 137), 'palegoldenrod' : (238, 232, 170), 'palegreen' : (152, 251, 152), 'palegreen1' : (154, 255, 154), 'palegreen2' : (144, 238, 144), 'palegreen3' : (124, 205, 124), 'palegreen4' : (84, 139, 84), 'paleturquoise' : (175, 238, 238), 'paleturquoise1' : (187, 255, 255), 'paleturquoise2' : (174, 238, 238), 'paleturquoise3' : (150, 205, 205), 'paleturquoise4' : (102, 139, 139), 'palevioletred' : (219, 112, 147), 'palevioletred1' : (255, 130, 171), 'palevioletred2' : (238, 121, 159), 'palevioletred3' : (205, 104, 137), 'palevioletred4' : (139, 71, 93), 'papayawhip' : (255, 239, 213), 'peachpuff' : (255, 218, 185), 'peachpuff1' : (255, 218, 185), 'peachpuff2' : (238, 203, 173), 'peachpuff3' : (205, 175, 149), 'peachpuff4' : (139, 119, 101), 'peru' : (205, 133, 63), 'pink' : (255, 192, 203), 'pink1' : (255, 181, 197), 'pink2' : (238, 169, 184), 'pink3' : (205, 145, 158), 'pink4' : (139, 99, 108), 'plum' : (221, 160, 221), 'plum1' : (255, 187, 255), 'plum2' : (238, 174, 238), 'plum3' : (205, 150, 205), 'plum4' : (139, 102, 139), 'powderblue' : (176, 224, 230), 'purple' : (160, 32, 240), 'purple1' : (155, 48, 255), 'purple2' : (145, 44, 238), 'purple3' : (125, 38, 205), 'purple4' : (85, 26, 139), 'rebeccapurple' : (102, 51, 153), 'red' : (255, 0, 0), 'red1' : (255, 0, 0), 'red2' : (238, 0, 0), 'red3' : (205, 0, 0), 'red4' : (139, 0, 0), 'rosybrown' : (188, 143, 143), 'rosybrown1' : (255, 193, 193), 'rosybrown2' : (238, 180, 180), 'rosybrown3' : (205, 155, 155), 'rosybrown4' : (139, 105, 105), 'royalblue' : (65, 105, 225), 'royalblue1' : (72, 118, 255), 'royalblue2' : (67, 110, 238), 'royalblue3' : (58, 95, 205), 'royalblue4' : (39, 64, 139), 'saddlebrown' : (139, 69, 19), 'salmon' : (250, 128, 114), 'salmon1' : (255, 140, 105), 'salmon2' : (238, 130, 98), 'salmon3' : (205, 112, 84), 'salmon4' : (139, 76, 57), 'sandybrown' : (244, 164, 96), 'seagreen' : (46, 139, 87), 'seagreen1' : (84, 255, 159), 'seagreen2' : (78, 238, 148), 'seagreen3' : (67, 205, 128), 'seagreen4' : (46, 139, 87), 'seashell' : (255, 245, 238), 'seashell1' : (255, 245, 238), 'seashell2' : (238, 229, 222), 'seashell3' : (205, 197, 191), 'seashell4' : (139, 134, 130), 'sienna' : (160, 82, 45), 'sienna1' : (255, 130, 71), 'sienna2' : (238, 121, 66), 'sienna3' : (205, 104, 57), 'sienna4' : (139, 71, 38), 'silver' : (192, 192, 192), 'skyblue' : (135, 206, 235), 'skyblue1' : (135, 206, 255), 'skyblue2' : (126, 192, 238), 'skyblue3' : (108, 166, 205), 'skyblue4' : (74, 112, 139), 'slateblue' : (106, 90, 205), 'slateblue1' : (131, 111, 255), 'slateblue2' : (122, 103, 238), 'slateblue3' : (105, 89, 205), 'slateblue4' : (71, 60, 139), 'slategray' : (112, 128, 144), 'slategray1' : (198, 226, 255), 'slategray2' : (185, 211, 238), 'slategray3' : (159, 182, 205), 'slategray4' : (108, 123, 139), 'slategrey' : (112, 128, 144), 'snow' : (255, 250, 250), 'snow1' : (255, 250, 250), 'snow2' : (238, 233, 233), 'snow3' : (205, 201, 201), 'snow4' : (139, 137, 137), 'springgreen' : (0, 255, 127), 'springgreen1' : (0, 255, 127), 'springgreen2' : (0, 238, 118), 'springgreen3' : (0, 205, 102), 'springgreen4' : (0, 139, 69), 'steelblue' : (70, 130, 180), 'steelblue1' : (99, 184, 255), 'steelblue2' : (92, 172, 238), 'steelblue3' : (79, 148, 205), 'steelblue4' : (54, 100, 139), 'tan' : (210, 180, 140), 'tan1' : (255, 165, 79), 'tan2' : (238, 154, 73), 'tan3' : (205, 133, 63), 'tan4' : (139, 90, 43), 'teal' : (0, 128, 128), 'thistle' : (216, 191, 216), 'thistle1' : (255, 225, 255), 'thistle2' : (238, 210, 238), 'thistle3' : (205, 181, 205), 'thistle4' : (139, 123, 139), 'tomato' : (255, 99, 71), 'tomato1' : (255, 99, 71), 'tomato2' : (238, 92, 66), 'tomato3' : (205, 79, 57), 'tomato4' : (139, 54, 38), 'turquoise' : (64, 224, 208), 'turquoise1' : (0, 245, 255), 'turquoise2' : (0, 229, 238), 'turquoise3' : (0, 197, 205), 'turquoise4' : (0, 134, 139), 'violet' : (238, 130, 238), 'violetred' : (208, 32, 144), 'violetred1' : (255, 62, 150), 'violetred2' : (238, 58, 140), 'violetred3' : (205, 50, 120), 'violetred4' : (139, 34, 82), 'webgray' : (128, 128, 128), 'webgreen' : (0, 128, 0), 'webgrey' : (128, 128, 128), 'webmaroon' : (128, 0, 0), 'webpurple' : (128, 0, 128), 'wheat' : (245, 222, 179), 'wheat1' : (255, 231, 186), 'wheat2' : (238, 216, 174), 'wheat3' : (205, 186, 150), 'wheat4' : (139, 126, 102), 'white' : (255, 255, 255), 'whitesmoke' : (245, 245, 245), 'x11gray' : (190, 190, 190), 'x11green' : (0, 255, 0), 'x11grey' : (190, 190, 190), 'x11maroon' : (176, 48, 96), 'x11purple' : (160, 32, 240), 'yellow' : (255, 255, 0), 'yellow1' : (255, 255, 0), 'yellow2' : (238, 238, 0), 'yellow3' : (205, 205, 0), 'yellow4' : (139, 139, 0), 'yellowgreen' : (154, 205, 50), } pygame_sdl2-2.1.0-for-renpy-6.99.14.1/include/sdl2.pxd0000664000175000017500000021511012426033620021250 0ustar tomtom00000000000000from libc.stdint cimport * from libc.stdio cimport * from libc.stddef cimport * cdef extern from "SDL.h" nogil: cdef struct _SDL_iconv_t cdef struct SDL_BlitMap ctypedef struct SDL_AudioCVT const char *SDL_GetPlatform() ctypedef enum SDL_bool: SDL_FALSE SDL_TRUE ctypedef int8_t Sint8 ctypedef uint8_t Uint8 ctypedef int16_t Sint16 ctypedef uint16_t Uint16 ctypedef int32_t Sint32 ctypedef uint32_t Uint32 ctypedef int64_t Sint64 ctypedef uint64_t Uint64 void *SDL_malloc(size_t size) void *SDL_calloc(size_t nmemb, size_t size) void *SDL_realloc(void *mem, size_t size) void SDL_free(void *mem) char *SDL_getenv(const char *name) int SDL_setenv(const char *name, const char *value, int overwrite) void SDL_qsort(void *base, size_t nmemb, size_t size, int (*compare)(const void *, const void *)) int SDL_abs(int x) int SDL_isdigit(int x) int SDL_isspace(int x) int SDL_toupper(int x) int SDL_tolower(int x) void *SDL_memset(void *dst, int c, size_t len) void *SDL_memcpy(void *dst, const void *src, size_t len) void *SDL_memmove(void *dst, const void *src, size_t len) int SDL_memcmp(const void *s1, const void *s2, size_t len) size_t SDL_wcslen(const wchar_t *wstr) size_t SDL_wcslcpy(wchar_t *dst, const wchar_t *src, size_t maxlen) size_t SDL_wcslcat(wchar_t *dst, const wchar_t *src, size_t maxlen) size_t SDL_strlen(const char *str) size_t SDL_strlcpy(char *dst, const char *src, size_t maxlen) size_t SDL_utf8strlcpy(char *dst, const char *src, size_t dst_bytes) size_t SDL_strlcat(char *dst, const char *src, size_t maxlen) char *SDL_strdup(const char *str) char *SDL_strrev(char *str) char *SDL_strupr(char *str) char *SDL_strlwr(char *str) char *SDL_strchr(const char *str, int c) char *SDL_strrchr(const char *str, int c) char *SDL_strstr(const char *haystack, const char *needle) char *SDL_itoa(int value, char *str, int radix) char *SDL_uitoa(unsigned int value, char *str, int radix) char *SDL_ltoa(long value, char *str, int radix) char *SDL_ultoa(unsigned long value, char *str, int radix) char *SDL_lltoa(Sint64 value, char *str, int radix) char *SDL_ulltoa(Uint64 value, char *str, int radix) int SDL_atoi(const char *str) double SDL_atof(const char *str) long SDL_strtol(const char *str, char **endp, int base) unsigned long SDL_strtoul(const char *str, char **endp, int base) Sint64 SDL_strtoll(const char *str, char **endp, int base) Uint64 SDL_strtoull(const char *str, char **endp, int base) double SDL_strtod(const char *str, char **endp) int SDL_strcmp(const char *str1, const char *str2) int SDL_strncmp(const char *str1, const char *str2, size_t maxlen) int SDL_strcasecmp(const char *str1, const char *str2) int SDL_strncasecmp(const char *str1, const char *str2, size_t len) int SDL_sscanf(const char *text, const char *fmt, ...) int SDL_snprintf(char *text, size_t maxlen, const char *fmt, ...) double SDL_acos(double x) double SDL_asin(double x) double SDL_atan(double x) double SDL_atan2(double x, double y) double SDL_ceil(double x) double SDL_copysign(double x, double y) double SDL_cos(double x) float SDL_cosf(float x) double SDL_fabs(double x) double SDL_floor(double x) double SDL_log(double x) double SDL_pow(double x, double y) double SDL_scalbn(double x, int n) double SDL_sin(double x) float SDL_sinf(float x) double SDL_sqrt(double x) ctypedef _SDL_iconv_t *SDL_iconv_t SDL_iconv_t SDL_iconv_open(const char *tocode, const char *fromcode) int SDL_iconv_close(SDL_iconv_t cd) size_t SDL_iconv(SDL_iconv_t cd, const char **inbuf, size_t *inbytesleft, char **outbuf, size_t *outbytesleft) char *SDL_iconv_string(const char *tocode, const char *fromcode, const char *inbuf, size_t inbytesleft) int SDL_main(int argc, char *argv[]) void SDL_SetMainReady() ctypedef enum SDL_assert_state: SDL_ASSERTION_RETRY SDL_ASSERTION_BREAK SDL_ASSERTION_ABORT SDL_ASSERTION_IGNORE SDL_ASSERTION_ALWAYS_IGNORE ctypedef struct SDL_assert_data: int always_ignore unsigned int trigger_count const char *condition const char *filename int linenum const char *function const SDL_assert_data *next SDL_assert_state SDL_ReportAssertion(SDL_assert_data *, const char *, const char *, int) ctypedef SDL_assert_state (*SDL_AssertionHandler)(const SDL_assert_data *data, void *userdata) void SDL_SetAssertionHandler(SDL_AssertionHandler handler, void *userdata) SDL_AssertionHandler SDL_GetDefaultAssertionHandler() SDL_AssertionHandler SDL_GetAssertionHandler(void **puserdata) const SDL_assert_data *SDL_GetAssertionReport() void SDL_ResetAssertionReport() ctypedef int SDL_SpinLock SDL_bool SDL_AtomicTryLock(SDL_SpinLock *lock) void SDL_AtomicLock(SDL_SpinLock *lock) void SDL_AtomicUnlock(SDL_SpinLock *lock) ctypedef struct SDL_atomic_t: int value SDL_bool SDL_AtomicCAS(SDL_atomic_t *a, int oldval, int newval) int SDL_AtomicSet(SDL_atomic_t *a, int v) int SDL_AtomicGet(SDL_atomic_t *a) int SDL_AtomicAdd(SDL_atomic_t *a, int v) SDL_bool SDL_AtomicCASPtr(void **a, void *oldval, void *newval) void *SDL_AtomicSetPtr(void **a, void *v) void *SDL_AtomicGetPtr(void **a) int SDL_SetError(const char *fmt, ...) const char *SDL_GetError() void SDL_ClearError() ctypedef enum SDL_errorcode: SDL_ENOMEM SDL_EFREAD SDL_EFWRITE SDL_EFSEEK SDL_UNSUPPORTED SDL_LASTERROR int SDL_Error(SDL_errorcode code) ctypedef struct SDL_mutex SDL_mutex *SDL_CreateMutex() int SDL_LockMutex(SDL_mutex *mutex) int SDL_TryLockMutex(SDL_mutex *mutex) int SDL_UnlockMutex(SDL_mutex *mutex) void SDL_DestroyMutex(SDL_mutex *mutex) cdef struct SDL_semaphore ctypedef struct SDL_sem SDL_sem *SDL_CreateSemaphore(Uint32 initial_value) void SDL_DestroySemaphore(SDL_sem *sem) int SDL_SemWait(SDL_sem *sem) int SDL_SemTryWait(SDL_sem *sem) int SDL_SemWaitTimeout(SDL_sem *sem, Uint32 ms) int SDL_SemPost(SDL_sem *sem) Uint32 SDL_SemValue(SDL_sem *sem) ctypedef struct SDL_cond SDL_cond *SDL_CreateCond() void SDL_DestroyCond(SDL_cond *cond) int SDL_CondSignal(SDL_cond *cond) int SDL_CondBroadcast(SDL_cond *cond) int SDL_CondWait(SDL_cond *cond, SDL_mutex *mutex) int SDL_CondWaitTimeout(SDL_cond *cond, SDL_mutex *mutex, Uint32 ms) ctypedef struct SDL_Thread ctypedef unsigned long SDL_threadID ctypedef unsigned int SDL_TLSID ctypedef enum SDL_ThreadPriority: SDL_THREAD_PRIORITY_LOW SDL_THREAD_PRIORITY_NORMAL SDL_THREAD_PRIORITY_HIGH ctypedef int (*SDL_ThreadFunction)(void *data) SDL_Thread *SDL_CreateThread(SDL_ThreadFunction fn, const char *name, void *data) const char *SDL_GetThreadName(SDL_Thread *thread) SDL_threadID SDL_ThreadID() SDL_threadID SDL_GetThreadID(SDL_Thread *thread) int SDL_SetThreadPriority(SDL_ThreadPriority priority) void SDL_WaitThread(SDL_Thread *thread, int *status) void SDL_DetachThread(SDL_Thread *thread) SDL_TLSID SDL_TLSCreate() void *SDL_TLSGet(SDL_TLSID id) int SDL_TLSSet(SDL_TLSID id, const void *value, void (*destructor)(void *)) cdef struct anon_struct_2: SDL_bool autoclose FILE *fp cdef struct anon_struct_3: Uint8 *base Uint8 *here Uint8 *stop cdef struct anon_struct_4: void *data1 void *data2 cdef union anon_union_1: anon_struct_2 stdio anon_struct_3 mem anon_struct_4 unknown ctypedef struct SDL_RWops: Sint64 (*size)(SDL_RWops *context) Sint64 (*seek)(SDL_RWops *context, Sint64 offset, int whence) size_t (*read)(SDL_RWops *context, void *ptr, size_t size, size_t maxnum) size_t (*write)(SDL_RWops *context, const void *ptr, size_t size, size_t num) int (*close)(SDL_RWops *context) Uint32 type anon_union_1 hidden SDL_RWops *SDL_RWFromFile(const char *file, const char *mode) SDL_RWops *SDL_RWFromFP(FILE *fp, SDL_bool autoclose) SDL_RWops *SDL_RWFromMem(void *mem, int size) SDL_RWops *SDL_RWFromConstMem(const void *mem, int size) SDL_RWops *SDL_AllocRW() void SDL_FreeRW(SDL_RWops *area) Uint8 SDL_ReadU8(SDL_RWops *src) Uint16 SDL_ReadLE16(SDL_RWops *src) Uint16 SDL_ReadBE16(SDL_RWops *src) Uint32 SDL_ReadLE32(SDL_RWops *src) Uint32 SDL_ReadBE32(SDL_RWops *src) Uint64 SDL_ReadLE64(SDL_RWops *src) Uint64 SDL_ReadBE64(SDL_RWops *src) size_t SDL_WriteU8(SDL_RWops *dst, Uint8 value) size_t SDL_WriteLE16(SDL_RWops *dst, Uint16 value) size_t SDL_WriteBE16(SDL_RWops *dst, Uint16 value) size_t SDL_WriteLE32(SDL_RWops *dst, Uint32 value) size_t SDL_WriteBE32(SDL_RWops *dst, Uint32 value) size_t SDL_WriteLE64(SDL_RWops *dst, Uint64 value) size_t SDL_WriteBE64(SDL_RWops *dst, Uint64 value) ctypedef Uint16 SDL_AudioFormat ctypedef void (*SDL_AudioCallback)(void *userdata, Uint8 *stream, int len) ctypedef struct SDL_AudioSpec: int freq SDL_AudioFormat format Uint8 channels Uint8 silence Uint16 samples Uint16 padding Uint32 size SDL_AudioCallback callback void *userdata ctypedef void (*SDL_AudioFilter)(SDL_AudioCVT *cvt, SDL_AudioFormat format) ctypedef struct SDL_AudioCVT: int needed SDL_AudioFormat src_format SDL_AudioFormat dst_format double rate_incr Uint8 *buf int len int len_cvt int len_mult double len_ratio SDL_AudioFilter filters[10] int filter_index int SDL_GetNumAudioDrivers() const char *SDL_GetAudioDriver(int index) int SDL_AudioInit(const char *driver_name) void SDL_AudioQuit() const char *SDL_GetCurrentAudioDriver() int SDL_OpenAudio(SDL_AudioSpec *desired, SDL_AudioSpec *obtained) ctypedef Uint32 SDL_AudioDeviceID int SDL_GetNumAudioDevices(int iscapture) const char *SDL_GetAudioDeviceName(int index, int iscapture) SDL_AudioDeviceID SDL_OpenAudioDevice(const char *device, int iscapture, const SDL_AudioSpec *desired, SDL_AudioSpec *obtained, int allowed_changes) ctypedef enum SDL_AudioStatus: SDL_AUDIO_STOPPED SDL_AUDIO_PLAYING SDL_AUDIO_PAUSED SDL_AudioStatus SDL_GetAudioStatus() SDL_AudioStatus SDL_GetAudioDeviceStatus(SDL_AudioDeviceID dev) void SDL_PauseAudio(int pause_on) void SDL_PauseAudioDevice(SDL_AudioDeviceID dev, int pause_on) SDL_AudioSpec *SDL_LoadWAV_RW(SDL_RWops *src, int freesrc, SDL_AudioSpec *spec, Uint8 **audio_buf, Uint32 *audio_len) void SDL_FreeWAV(Uint8 *audio_buf) int SDL_BuildAudioCVT(SDL_AudioCVT *cvt, SDL_AudioFormat src_format, Uint8 src_channels, int src_rate, SDL_AudioFormat dst_format, Uint8 dst_channels, int dst_rate) int SDL_ConvertAudio(SDL_AudioCVT *cvt) void SDL_MixAudio(Uint8 *dst, const Uint8 *src, Uint32 len, int volume) void SDL_MixAudioFormat(Uint8 *dst, const Uint8 *src, SDL_AudioFormat format, Uint32 len, int volume) void SDL_LockAudio() void SDL_LockAudioDevice(SDL_AudioDeviceID dev) void SDL_UnlockAudio() void SDL_UnlockAudioDevice(SDL_AudioDeviceID dev) void SDL_CloseAudio() void SDL_CloseAudioDevice(SDL_AudioDeviceID dev) int SDL_SetClipboardText(const char *text) char *SDL_GetClipboardText() SDL_bool SDL_HasClipboardText() int SDL_GetCPUCount() int SDL_GetCPUCacheLineSize() SDL_bool SDL_HasRDTSC() SDL_bool SDL_HasAltiVec() SDL_bool SDL_HasMMX() SDL_bool SDL_Has3DNow() SDL_bool SDL_HasSSE() SDL_bool SDL_HasSSE2() SDL_bool SDL_HasSSE3() SDL_bool SDL_HasSSE41() SDL_bool SDL_HasSSE42() SDL_bool SDL_HasAVX() int SDL_GetSystemRAM() cdef enum: SDL_PIXELTYPE_UNKNOWN SDL_PIXELTYPE_INDEX1 SDL_PIXELTYPE_INDEX4 SDL_PIXELTYPE_INDEX8 SDL_PIXELTYPE_PACKED8 SDL_PIXELTYPE_PACKED16 SDL_PIXELTYPE_PACKED32 SDL_PIXELTYPE_ARRAYU8 SDL_PIXELTYPE_ARRAYU16 SDL_PIXELTYPE_ARRAYU32 SDL_PIXELTYPE_ARRAYF16 SDL_PIXELTYPE_ARRAYF32 cdef enum: SDL_BITMAPORDER_NONE SDL_BITMAPORDER_4321 SDL_BITMAPORDER_1234 cdef enum: SDL_PACKEDORDER_NONE SDL_PACKEDORDER_XRGB SDL_PACKEDORDER_RGBX SDL_PACKEDORDER_ARGB SDL_PACKEDORDER_RGBA SDL_PACKEDORDER_XBGR SDL_PACKEDORDER_BGRX SDL_PACKEDORDER_ABGR SDL_PACKEDORDER_BGRA cdef enum: SDL_ARRAYORDER_NONE SDL_ARRAYORDER_RGB SDL_ARRAYORDER_RGBA SDL_ARRAYORDER_ARGB SDL_ARRAYORDER_BGR SDL_ARRAYORDER_BGRA SDL_ARRAYORDER_ABGR cdef enum: SDL_PACKEDLAYOUT_NONE SDL_PACKEDLAYOUT_332 SDL_PACKEDLAYOUT_4444 SDL_PACKEDLAYOUT_1555 SDL_PACKEDLAYOUT_5551 SDL_PACKEDLAYOUT_565 SDL_PACKEDLAYOUT_8888 SDL_PACKEDLAYOUT_2101010 SDL_PACKEDLAYOUT_1010102 cdef enum: SDL_PIXELFORMAT_UNKNOWN SDL_PIXELFORMAT_INDEX1LSB SDL_PIXELFORMAT_INDEX1MSB SDL_PIXELFORMAT_INDEX4LSB SDL_PIXELFORMAT_INDEX4MSB SDL_PIXELFORMAT_INDEX8 SDL_PIXELFORMAT_RGB332 SDL_PIXELFORMAT_RGB444 SDL_PIXELFORMAT_RGB555 SDL_PIXELFORMAT_BGR555 SDL_PIXELFORMAT_ARGB4444 SDL_PIXELFORMAT_RGBA4444 SDL_PIXELFORMAT_ABGR4444 SDL_PIXELFORMAT_BGRA4444 SDL_PIXELFORMAT_ARGB1555 SDL_PIXELFORMAT_RGBA5551 SDL_PIXELFORMAT_ABGR1555 SDL_PIXELFORMAT_BGRA5551 SDL_PIXELFORMAT_RGB565 SDL_PIXELFORMAT_BGR565 SDL_PIXELFORMAT_RGB24 SDL_PIXELFORMAT_BGR24 SDL_PIXELFORMAT_RGB888 SDL_PIXELFORMAT_RGBX8888 SDL_PIXELFORMAT_BGR888 SDL_PIXELFORMAT_BGRX8888 SDL_PIXELFORMAT_ARGB8888 SDL_PIXELFORMAT_RGBA8888 SDL_PIXELFORMAT_ABGR8888 SDL_PIXELFORMAT_BGRA8888 SDL_PIXELFORMAT_ARGB2101010 SDL_PIXELFORMAT_YV12 SDL_PIXELFORMAT_IYUV SDL_PIXELFORMAT_YUY2 SDL_PIXELFORMAT_UYVY SDL_PIXELFORMAT_YVYU ctypedef struct SDL_Color: Uint8 r Uint8 g Uint8 b Uint8 a ctypedef struct SDL_Palette: int ncolors SDL_Color *colors Uint32 version int refcount ctypedef struct SDL_PixelFormat: Uint32 format SDL_Palette *palette Uint8 BitsPerPixel Uint8 BytesPerPixel Uint8 padding[2] Uint32 Rmask Uint32 Gmask Uint32 Bmask Uint32 Amask Uint8 Rloss Uint8 Gloss Uint8 Bloss Uint8 Aloss Uint8 Rshift Uint8 Gshift Uint8 Bshift Uint8 Ashift int refcount SDL_PixelFormat *next const char *SDL_GetPixelFormatName(Uint32 format) SDL_bool SDL_PixelFormatEnumToMasks(Uint32 format, int *bpp, Uint32 *Rmask, Uint32 *Gmask, Uint32 *Bmask, Uint32 *Amask) Uint32 SDL_MasksToPixelFormatEnum(int bpp, Uint32 Rmask, Uint32 Gmask, Uint32 Bmask, Uint32 Amask) SDL_PixelFormat *SDL_AllocFormat(Uint32 pixel_format) void SDL_FreeFormat(SDL_PixelFormat *format) SDL_Palette *SDL_AllocPalette(int ncolors) int SDL_SetPixelFormatPalette(SDL_PixelFormat *format, SDL_Palette *palette) int SDL_SetPaletteColors(SDL_Palette *palette, const SDL_Color *colors, int firstcolor, int ncolors) void SDL_FreePalette(SDL_Palette *palette) Uint32 SDL_MapRGB(const SDL_PixelFormat *format, Uint8 r, Uint8 g, Uint8 b) Uint32 SDL_MapRGBA(const SDL_PixelFormat *format, Uint8 r, Uint8 g, Uint8 b, Uint8 a) void SDL_GetRGB(Uint32 pixel, const SDL_PixelFormat *format, Uint8 *r, Uint8 *g, Uint8 *b) void SDL_GetRGBA(Uint32 pixel, const SDL_PixelFormat *format, Uint8 *r, Uint8 *g, Uint8 *b, Uint8 *a) void SDL_CalculateGammaRamp(float gamma, Uint16 *ramp) ctypedef struct SDL_Point: int x int y ctypedef struct SDL_Rect: int x int y int w int h SDL_bool SDL_HasIntersection(const SDL_Rect *A, const SDL_Rect *B) SDL_bool SDL_IntersectRect(const SDL_Rect *A, const SDL_Rect *B, SDL_Rect *result) void SDL_UnionRect(const SDL_Rect *A, const SDL_Rect *B, SDL_Rect *result) SDL_bool SDL_EnclosePoints(const SDL_Point *points, int count, const SDL_Rect *clip, SDL_Rect *result) SDL_bool SDL_IntersectRectAndLine(const SDL_Rect *rect, int *X1, int *Y1, int *X2, int *Y2) ctypedef enum SDL_BlendMode: SDL_BLENDMODE_NONE SDL_BLENDMODE_BLEND SDL_BLENDMODE_ADD SDL_BLENDMODE_MOD ctypedef struct SDL_Surface: Uint32 flags SDL_PixelFormat *format int w int h int pitch void *pixels void *userdata int locked void *lock_data SDL_Rect clip_rect SDL_BlitMap *map int refcount ctypedef int (*SDL_blit)(SDL_Surface *src, SDL_Rect *srcrect, SDL_Surface *dst, SDL_Rect *dstrect) SDL_Surface *SDL_CreateRGBSurface(Uint32 flags, int width, int height, int depth, Uint32 Rmask, Uint32 Gmask, Uint32 Bmask, Uint32 Amask) SDL_Surface *SDL_CreateRGBSurfaceFrom(void *pixels, int width, int height, int depth, int pitch, Uint32 Rmask, Uint32 Gmask, Uint32 Bmask, Uint32 Amask) void SDL_FreeSurface(SDL_Surface *surface) int SDL_SetSurfacePalette(SDL_Surface *surface, SDL_Palette *palette) int SDL_LockSurface(SDL_Surface *surface) void SDL_UnlockSurface(SDL_Surface *surface) SDL_Surface *SDL_LoadBMP_RW(SDL_RWops *src, int freesrc) int SDL_SaveBMP_RW(SDL_Surface *surface, SDL_RWops *dst, int freedst) int SDL_SetSurfaceRLE(SDL_Surface *surface, int flag) int SDL_SetColorKey(SDL_Surface *surface, int flag, Uint32 key) int SDL_GetColorKey(SDL_Surface *surface, Uint32 *key) int SDL_SetSurfaceColorMod(SDL_Surface *surface, Uint8 r, Uint8 g, Uint8 b) int SDL_GetSurfaceColorMod(SDL_Surface *surface, Uint8 *r, Uint8 *g, Uint8 *b) int SDL_SetSurfaceAlphaMod(SDL_Surface *surface, Uint8 alpha) int SDL_GetSurfaceAlphaMod(SDL_Surface *surface, Uint8 *alpha) int SDL_SetSurfaceBlendMode(SDL_Surface *surface, SDL_BlendMode blendMode) int SDL_GetSurfaceBlendMode(SDL_Surface *surface, SDL_BlendMode *blendMode) SDL_bool SDL_SetClipRect(SDL_Surface *surface, const SDL_Rect *rect) void SDL_GetClipRect(SDL_Surface *surface, SDL_Rect *rect) SDL_Surface *SDL_ConvertSurface(SDL_Surface *src, const SDL_PixelFormat *fmt, Uint32 flags) SDL_Surface *SDL_ConvertSurfaceFormat(SDL_Surface *src, Uint32 pixel_format, Uint32 flags) int SDL_ConvertPixels(int width, int height, Uint32 src_format, const void *src, int src_pitch, Uint32 dst_format, void *dst, int dst_pitch) int SDL_FillRect(SDL_Surface *dst, const SDL_Rect *rect, Uint32 color) int SDL_FillRects(SDL_Surface *dst, const SDL_Rect *rects, int count, Uint32 color) int SDL_UpperBlit(SDL_Surface *src, const SDL_Rect *srcrect, SDL_Surface *dst, SDL_Rect *dstrect) int SDL_LowerBlit(SDL_Surface *src, SDL_Rect *srcrect, SDL_Surface *dst, SDL_Rect *dstrect) int SDL_SoftStretch(SDL_Surface *src, const SDL_Rect *srcrect, SDL_Surface *dst, const SDL_Rect *dstrect) int SDL_UpperBlitScaled(SDL_Surface *src, const SDL_Rect *srcrect, SDL_Surface *dst, SDL_Rect *dstrect) int SDL_LowerBlitScaled(SDL_Surface *src, SDL_Rect *srcrect, SDL_Surface *dst, SDL_Rect *dstrect) ctypedef struct SDL_DisplayMode: Uint32 format int w int h int refresh_rate void *driverdata ctypedef struct SDL_Window ctypedef enum SDL_WindowFlags: SDL_WINDOW_FULLSCREEN SDL_WINDOW_OPENGL SDL_WINDOW_SHOWN SDL_WINDOW_HIDDEN SDL_WINDOW_BORDERLESS SDL_WINDOW_RESIZABLE SDL_WINDOW_MINIMIZED SDL_WINDOW_MAXIMIZED SDL_WINDOW_INPUT_GRABBED SDL_WINDOW_INPUT_FOCUS SDL_WINDOW_MOUSE_FOCUS SDL_WINDOW_FULLSCREEN_DESKTOP SDL_WINDOW_FOREIGN SDL_WINDOW_ALLOW_HIGHDPI ctypedef enum SDL_WindowEventID: SDL_WINDOWEVENT_NONE SDL_WINDOWEVENT_SHOWN SDL_WINDOWEVENT_HIDDEN SDL_WINDOWEVENT_EXPOSED SDL_WINDOWEVENT_MOVED SDL_WINDOWEVENT_RESIZED SDL_WINDOWEVENT_SIZE_CHANGED SDL_WINDOWEVENT_MINIMIZED SDL_WINDOWEVENT_MAXIMIZED SDL_WINDOWEVENT_RESTORED SDL_WINDOWEVENT_ENTER SDL_WINDOWEVENT_LEAVE SDL_WINDOWEVENT_FOCUS_GAINED SDL_WINDOWEVENT_FOCUS_LOST SDL_WINDOWEVENT_CLOSE ctypedef void *SDL_GLContext ctypedef 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_RETAINED_BACKING SDL_GL_CONTEXT_MAJOR_VERSION SDL_GL_CONTEXT_MINOR_VERSION SDL_GL_CONTEXT_EGL SDL_GL_CONTEXT_FLAGS SDL_GL_CONTEXT_PROFILE_MASK SDL_GL_SHARE_WITH_CURRENT_CONTEXT SDL_GL_FRAMEBUFFER_SRGB_CAPABLE ctypedef enum SDL_GLprofile: SDL_GL_CONTEXT_PROFILE_CORE SDL_GL_CONTEXT_PROFILE_COMPATIBILITY SDL_GL_CONTEXT_PROFILE_ES ctypedef enum SDL_GLcontextFlag: SDL_GL_CONTEXT_DEBUG_FLAG SDL_GL_CONTEXT_FORWARD_COMPATIBLE_FLAG SDL_GL_CONTEXT_ROBUST_ACCESS_FLAG SDL_GL_CONTEXT_RESET_ISOLATION_FLAG int SDL_GetNumVideoDrivers() const char *SDL_GetVideoDriver(int index) int SDL_VideoInit(const char *driver_name) void SDL_VideoQuit() const char *SDL_GetCurrentVideoDriver() int SDL_GetNumVideoDisplays() const char *SDL_GetDisplayName(int displayIndex) int SDL_GetDisplayBounds(int displayIndex, SDL_Rect *rect) int SDL_GetNumDisplayModes(int displayIndex) int SDL_GetDisplayMode(int displayIndex, int modeIndex, SDL_DisplayMode *mode) int SDL_GetDesktopDisplayMode(int displayIndex, SDL_DisplayMode *mode) int SDL_GetCurrentDisplayMode(int displayIndex, SDL_DisplayMode *mode) SDL_DisplayMode *SDL_GetClosestDisplayMode(int displayIndex, const SDL_DisplayMode *mode, SDL_DisplayMode *closest) int SDL_GetWindowDisplayIndex(SDL_Window *window) int SDL_SetWindowDisplayMode(SDL_Window *window, const SDL_DisplayMode *mode) int SDL_GetWindowDisplayMode(SDL_Window *window, SDL_DisplayMode *mode) Uint32 SDL_GetWindowPixelFormat(SDL_Window *window) SDL_Window *SDL_CreateWindow(const char *title, int x, int y, int w, int h, Uint32 flags) SDL_Window *SDL_CreateWindowFrom(const void *data) Uint32 SDL_GetWindowID(SDL_Window *window) SDL_Window *SDL_GetWindowFromID(Uint32 id) Uint32 SDL_GetWindowFlags(SDL_Window *window) void SDL_SetWindowTitle(SDL_Window *window, const char *title) const char *SDL_GetWindowTitle(SDL_Window *window) void SDL_SetWindowIcon(SDL_Window *window, SDL_Surface *icon) void *SDL_SetWindowData(SDL_Window *window, const char *name, void *userdata) void *SDL_GetWindowData(SDL_Window *window, const char *name) void SDL_SetWindowPosition(SDL_Window *window, int x, int y) void SDL_GetWindowPosition(SDL_Window *window, int *x, int *y) void SDL_SetWindowSize(SDL_Window *window, int w, int h) void SDL_GetWindowSize(SDL_Window *window, int *w, int *h) void SDL_SetWindowMinimumSize(SDL_Window *window, int min_w, int min_h) void SDL_GetWindowMinimumSize(SDL_Window *window, int *w, int *h) void SDL_SetWindowMaximumSize(SDL_Window *window, int max_w, int max_h) void SDL_GetWindowMaximumSize(SDL_Window *window, int *w, int *h) void SDL_SetWindowBordered(SDL_Window *window, SDL_bool bordered) void SDL_ShowWindow(SDL_Window *window) void SDL_HideWindow(SDL_Window *window) void SDL_RaiseWindow(SDL_Window *window) void SDL_MaximizeWindow(SDL_Window *window) void SDL_MinimizeWindow(SDL_Window *window) void SDL_RestoreWindow(SDL_Window *window) int SDL_SetWindowFullscreen(SDL_Window *window, Uint32 flags) SDL_Surface *SDL_GetWindowSurface(SDL_Window *window) int SDL_UpdateWindowSurface(SDL_Window *window) int SDL_UpdateWindowSurfaceRects(SDL_Window *window, const SDL_Rect *rects, int numrects) void SDL_SetWindowGrab(SDL_Window *window, SDL_bool grabbed) SDL_bool SDL_GetWindowGrab(SDL_Window *window) int SDL_SetWindowBrightness(SDL_Window *window, float brightness) float SDL_GetWindowBrightness(SDL_Window *window) int SDL_SetWindowGammaRamp(SDL_Window *window, const Uint16 *red, const Uint16 *green, const Uint16 *blue) int SDL_GetWindowGammaRamp(SDL_Window *window, Uint16 *red, Uint16 *green, Uint16 *blue) void SDL_DestroyWindow(SDL_Window *window) SDL_bool SDL_IsScreenSaverEnabled() void SDL_EnableScreenSaver() void SDL_DisableScreenSaver() int SDL_GL_LoadLibrary(const char *path) void *SDL_GL_GetProcAddress(const char *proc) void SDL_GL_UnloadLibrary() SDL_bool SDL_GL_ExtensionSupported(const char *extension) void SDL_GL_ResetAttributes() int SDL_GL_SetAttribute(SDL_GLattr attr, int value) int SDL_GL_GetAttribute(SDL_GLattr attr, int *value) SDL_GLContext SDL_GL_CreateContext(SDL_Window *window) int SDL_GL_MakeCurrent(SDL_Window *window, SDL_GLContext context) SDL_Window *SDL_GL_GetCurrentWindow() SDL_GLContext SDL_GL_GetCurrentContext() void SDL_GL_GetDrawableSize(SDL_Window *window, int *w, int *h) int SDL_GL_SetSwapInterval(int interval) int SDL_GL_GetSwapInterval() void SDL_GL_SwapWindow(SDL_Window *window) void SDL_GL_DeleteContext(SDL_GLContext context) ctypedef enum SDL_Scancode: SDL_SCANCODE_UNKNOWN SDL_SCANCODE_A SDL_SCANCODE_B SDL_SCANCODE_C SDL_SCANCODE_D SDL_SCANCODE_E SDL_SCANCODE_F SDL_SCANCODE_G SDL_SCANCODE_H SDL_SCANCODE_I SDL_SCANCODE_J SDL_SCANCODE_K SDL_SCANCODE_L SDL_SCANCODE_M SDL_SCANCODE_N SDL_SCANCODE_O SDL_SCANCODE_P SDL_SCANCODE_Q SDL_SCANCODE_R SDL_SCANCODE_S SDL_SCANCODE_T SDL_SCANCODE_U SDL_SCANCODE_V SDL_SCANCODE_W SDL_SCANCODE_X SDL_SCANCODE_Y SDL_SCANCODE_Z SDL_SCANCODE_1 SDL_SCANCODE_2 SDL_SCANCODE_3 SDL_SCANCODE_4 SDL_SCANCODE_5 SDL_SCANCODE_6 SDL_SCANCODE_7 SDL_SCANCODE_8 SDL_SCANCODE_9 SDL_SCANCODE_0 SDL_SCANCODE_RETURN SDL_SCANCODE_ESCAPE SDL_SCANCODE_BACKSPACE SDL_SCANCODE_TAB SDL_SCANCODE_SPACE SDL_SCANCODE_MINUS SDL_SCANCODE_EQUALS SDL_SCANCODE_LEFTBRACKET SDL_SCANCODE_RIGHTBRACKET SDL_SCANCODE_BACKSLASH SDL_SCANCODE_NONUSHASH SDL_SCANCODE_SEMICOLON SDL_SCANCODE_APOSTROPHE SDL_SCANCODE_GRAVE SDL_SCANCODE_COMMA SDL_SCANCODE_PERIOD SDL_SCANCODE_SLASH SDL_SCANCODE_CAPSLOCK SDL_SCANCODE_F1 SDL_SCANCODE_F2 SDL_SCANCODE_F3 SDL_SCANCODE_F4 SDL_SCANCODE_F5 SDL_SCANCODE_F6 SDL_SCANCODE_F7 SDL_SCANCODE_F8 SDL_SCANCODE_F9 SDL_SCANCODE_F10 SDL_SCANCODE_F11 SDL_SCANCODE_F12 SDL_SCANCODE_PRINTSCREEN SDL_SCANCODE_SCROLLLOCK SDL_SCANCODE_PAUSE SDL_SCANCODE_INSERT SDL_SCANCODE_HOME SDL_SCANCODE_PAGEUP SDL_SCANCODE_DELETE SDL_SCANCODE_END SDL_SCANCODE_PAGEDOWN SDL_SCANCODE_RIGHT SDL_SCANCODE_LEFT SDL_SCANCODE_DOWN SDL_SCANCODE_UP SDL_SCANCODE_NUMLOCKCLEAR SDL_SCANCODE_KP_DIVIDE SDL_SCANCODE_KP_MULTIPLY SDL_SCANCODE_KP_MINUS SDL_SCANCODE_KP_PLUS SDL_SCANCODE_KP_ENTER SDL_SCANCODE_KP_1 SDL_SCANCODE_KP_2 SDL_SCANCODE_KP_3 SDL_SCANCODE_KP_4 SDL_SCANCODE_KP_5 SDL_SCANCODE_KP_6 SDL_SCANCODE_KP_7 SDL_SCANCODE_KP_8 SDL_SCANCODE_KP_9 SDL_SCANCODE_KP_0 SDL_SCANCODE_KP_PERIOD SDL_SCANCODE_NONUSBACKSLASH SDL_SCANCODE_APPLICATION SDL_SCANCODE_POWER SDL_SCANCODE_KP_EQUALS SDL_SCANCODE_F13 SDL_SCANCODE_F14 SDL_SCANCODE_F15 SDL_SCANCODE_F16 SDL_SCANCODE_F17 SDL_SCANCODE_F18 SDL_SCANCODE_F19 SDL_SCANCODE_F20 SDL_SCANCODE_F21 SDL_SCANCODE_F22 SDL_SCANCODE_F23 SDL_SCANCODE_F24 SDL_SCANCODE_EXECUTE SDL_SCANCODE_HELP SDL_SCANCODE_MENU SDL_SCANCODE_SELECT SDL_SCANCODE_STOP SDL_SCANCODE_AGAIN SDL_SCANCODE_UNDO SDL_SCANCODE_CUT SDL_SCANCODE_COPY SDL_SCANCODE_PASTE SDL_SCANCODE_FIND SDL_SCANCODE_MUTE SDL_SCANCODE_VOLUMEUP SDL_SCANCODE_VOLUMEDOWN SDL_SCANCODE_KP_COMMA SDL_SCANCODE_KP_EQUALSAS400 SDL_SCANCODE_INTERNATIONAL1 SDL_SCANCODE_INTERNATIONAL2 SDL_SCANCODE_INTERNATIONAL3 SDL_SCANCODE_INTERNATIONAL4 SDL_SCANCODE_INTERNATIONAL5 SDL_SCANCODE_INTERNATIONAL6 SDL_SCANCODE_INTERNATIONAL7 SDL_SCANCODE_INTERNATIONAL8 SDL_SCANCODE_INTERNATIONAL9 SDL_SCANCODE_LANG1 SDL_SCANCODE_LANG2 SDL_SCANCODE_LANG3 SDL_SCANCODE_LANG4 SDL_SCANCODE_LANG5 SDL_SCANCODE_LANG6 SDL_SCANCODE_LANG7 SDL_SCANCODE_LANG8 SDL_SCANCODE_LANG9 SDL_SCANCODE_ALTERASE SDL_SCANCODE_SYSREQ SDL_SCANCODE_CANCEL SDL_SCANCODE_CLEAR SDL_SCANCODE_PRIOR SDL_SCANCODE_RETURN2 SDL_SCANCODE_SEPARATOR SDL_SCANCODE_OUT SDL_SCANCODE_OPER SDL_SCANCODE_CLEARAGAIN SDL_SCANCODE_CRSEL SDL_SCANCODE_EXSEL SDL_SCANCODE_KP_00 SDL_SCANCODE_KP_000 SDL_SCANCODE_THOUSANDSSEPARATOR SDL_SCANCODE_DECIMALSEPARATOR SDL_SCANCODE_CURRENCYUNIT SDL_SCANCODE_CURRENCYSUBUNIT SDL_SCANCODE_KP_LEFTPAREN SDL_SCANCODE_KP_RIGHTPAREN SDL_SCANCODE_KP_LEFTBRACE SDL_SCANCODE_KP_RIGHTBRACE SDL_SCANCODE_KP_TAB SDL_SCANCODE_KP_BACKSPACE SDL_SCANCODE_KP_A SDL_SCANCODE_KP_B SDL_SCANCODE_KP_C SDL_SCANCODE_KP_D SDL_SCANCODE_KP_E SDL_SCANCODE_KP_F SDL_SCANCODE_KP_XOR SDL_SCANCODE_KP_POWER SDL_SCANCODE_KP_PERCENT SDL_SCANCODE_KP_LESS SDL_SCANCODE_KP_GREATER SDL_SCANCODE_KP_AMPERSAND SDL_SCANCODE_KP_DBLAMPERSAND SDL_SCANCODE_KP_VERTICALBAR SDL_SCANCODE_KP_DBLVERTICALBAR SDL_SCANCODE_KP_COLON SDL_SCANCODE_KP_HASH SDL_SCANCODE_KP_SPACE SDL_SCANCODE_KP_AT SDL_SCANCODE_KP_EXCLAM SDL_SCANCODE_KP_MEMSTORE SDL_SCANCODE_KP_MEMRECALL SDL_SCANCODE_KP_MEMCLEAR SDL_SCANCODE_KP_MEMADD SDL_SCANCODE_KP_MEMSUBTRACT SDL_SCANCODE_KP_MEMMULTIPLY SDL_SCANCODE_KP_MEMDIVIDE SDL_SCANCODE_KP_PLUSMINUS SDL_SCANCODE_KP_CLEAR SDL_SCANCODE_KP_CLEARENTRY SDL_SCANCODE_KP_BINARY SDL_SCANCODE_KP_OCTAL SDL_SCANCODE_KP_DECIMAL SDL_SCANCODE_KP_HEXADECIMAL SDL_SCANCODE_LCTRL SDL_SCANCODE_LSHIFT SDL_SCANCODE_LALT SDL_SCANCODE_LGUI SDL_SCANCODE_RCTRL SDL_SCANCODE_RSHIFT SDL_SCANCODE_RALT SDL_SCANCODE_RGUI SDL_SCANCODE_MODE SDL_SCANCODE_AUDIONEXT SDL_SCANCODE_AUDIOPREV SDL_SCANCODE_AUDIOSTOP SDL_SCANCODE_AUDIOPLAY SDL_SCANCODE_AUDIOMUTE SDL_SCANCODE_MEDIASELECT SDL_SCANCODE_WWW SDL_SCANCODE_MAIL SDL_SCANCODE_CALCULATOR SDL_SCANCODE_COMPUTER SDL_SCANCODE_AC_SEARCH SDL_SCANCODE_AC_HOME SDL_SCANCODE_AC_BACK SDL_SCANCODE_AC_FORWARD SDL_SCANCODE_AC_STOP SDL_SCANCODE_AC_REFRESH SDL_SCANCODE_AC_BOOKMARKS SDL_SCANCODE_BRIGHTNESSDOWN SDL_SCANCODE_BRIGHTNESSUP SDL_SCANCODE_DISPLAYSWITCH SDL_SCANCODE_KBDILLUMTOGGLE SDL_SCANCODE_KBDILLUMDOWN SDL_SCANCODE_KBDILLUMUP SDL_SCANCODE_EJECT SDL_SCANCODE_SLEEP SDL_SCANCODE_APP1 SDL_SCANCODE_APP2 SDL_NUM_SCANCODES ctypedef Sint32 SDL_Keycode cdef enum: SDLK_UNKNOWN SDLK_RETURN SDLK_ESCAPE SDLK_BACKSPACE SDLK_TAB SDLK_SPACE SDLK_EXCLAIM SDLK_QUOTEDBL SDLK_HASH SDLK_PERCENT SDLK_DOLLAR SDLK_AMPERSAND SDLK_QUOTE SDLK_LEFTPAREN SDLK_RIGHTPAREN SDLK_ASTERISK SDLK_PLUS SDLK_COMMA SDLK_MINUS SDLK_PERIOD SDLK_SLASH SDLK_0 SDLK_1 SDLK_2 SDLK_3 SDLK_4 SDLK_5 SDLK_6 SDLK_7 SDLK_8 SDLK_9 SDLK_COLON SDLK_SEMICOLON SDLK_LESS SDLK_EQUALS SDLK_GREATER SDLK_QUESTION SDLK_AT SDLK_LEFTBRACKET SDLK_BACKSLASH SDLK_RIGHTBRACKET SDLK_CARET SDLK_UNDERSCORE SDLK_BACKQUOTE SDLK_a SDLK_b SDLK_c SDLK_d SDLK_e SDLK_f SDLK_g SDLK_h SDLK_i SDLK_j SDLK_k SDLK_l SDLK_m SDLK_n SDLK_o SDLK_p SDLK_q SDLK_r SDLK_s SDLK_t SDLK_u SDLK_v SDLK_w SDLK_x SDLK_y SDLK_z SDLK_CAPSLOCK SDLK_F1 SDLK_F2 SDLK_F3 SDLK_F4 SDLK_F5 SDLK_F6 SDLK_F7 SDLK_F8 SDLK_F9 SDLK_F10 SDLK_F11 SDLK_F12 SDLK_PRINTSCREEN SDLK_SCROLLLOCK SDLK_PAUSE SDLK_INSERT SDLK_HOME SDLK_PAGEUP SDLK_DELETE SDLK_END SDLK_PAGEDOWN SDLK_RIGHT SDLK_LEFT SDLK_DOWN SDLK_UP SDLK_NUMLOCKCLEAR SDLK_KP_DIVIDE SDLK_KP_MULTIPLY SDLK_KP_MINUS SDLK_KP_PLUS SDLK_KP_ENTER SDLK_KP_1 SDLK_KP_2 SDLK_KP_3 SDLK_KP_4 SDLK_KP_5 SDLK_KP_6 SDLK_KP_7 SDLK_KP_8 SDLK_KP_9 SDLK_KP_0 SDLK_KP_PERIOD SDLK_APPLICATION SDLK_POWER SDLK_KP_EQUALS SDLK_F13 SDLK_F14 SDLK_F15 SDLK_F16 SDLK_F17 SDLK_F18 SDLK_F19 SDLK_F20 SDLK_F21 SDLK_F22 SDLK_F23 SDLK_F24 SDLK_EXECUTE SDLK_HELP SDLK_MENU SDLK_SELECT SDLK_STOP SDLK_AGAIN SDLK_UNDO SDLK_CUT SDLK_COPY SDLK_PASTE SDLK_FIND SDLK_MUTE SDLK_VOLUMEUP SDLK_VOLUMEDOWN SDLK_KP_COMMA SDLK_KP_EQUALSAS400 SDLK_ALTERASE SDLK_SYSREQ SDLK_CANCEL SDLK_CLEAR SDLK_PRIOR SDLK_RETURN2 SDLK_SEPARATOR SDLK_OUT SDLK_OPER SDLK_CLEARAGAIN SDLK_CRSEL SDLK_EXSEL SDLK_KP_00 SDLK_KP_000 SDLK_THOUSANDSSEPARATOR SDLK_DECIMALSEPARATOR SDLK_CURRENCYUNIT SDLK_CURRENCYSUBUNIT SDLK_KP_LEFTPAREN SDLK_KP_RIGHTPAREN SDLK_KP_LEFTBRACE SDLK_KP_RIGHTBRACE SDLK_KP_TAB SDLK_KP_BACKSPACE SDLK_KP_A SDLK_KP_B SDLK_KP_C SDLK_KP_D SDLK_KP_E SDLK_KP_F SDLK_KP_XOR SDLK_KP_POWER SDLK_KP_PERCENT SDLK_KP_LESS SDLK_KP_GREATER SDLK_KP_AMPERSAND SDLK_KP_DBLAMPERSAND SDLK_KP_VERTICALBAR SDLK_KP_DBLVERTICALBAR SDLK_KP_COLON SDLK_KP_HASH SDLK_KP_SPACE SDLK_KP_AT SDLK_KP_EXCLAM SDLK_KP_MEMSTORE SDLK_KP_MEMRECALL SDLK_KP_MEMCLEAR SDLK_KP_MEMADD SDLK_KP_MEMSUBTRACT SDLK_KP_MEMMULTIPLY SDLK_KP_MEMDIVIDE SDLK_KP_PLUSMINUS SDLK_KP_CLEAR SDLK_KP_CLEARENTRY SDLK_KP_BINARY SDLK_KP_OCTAL SDLK_KP_DECIMAL SDLK_KP_HEXADECIMAL SDLK_LCTRL SDLK_LSHIFT SDLK_LALT SDLK_LGUI SDLK_RCTRL SDLK_RSHIFT SDLK_RALT SDLK_RGUI SDLK_MODE SDLK_AUDIONEXT SDLK_AUDIOPREV SDLK_AUDIOSTOP SDLK_AUDIOPLAY SDLK_AUDIOMUTE SDLK_MEDIASELECT SDLK_WWW SDLK_MAIL SDLK_CALCULATOR SDLK_COMPUTER SDLK_AC_SEARCH SDLK_AC_HOME SDLK_AC_BACK SDLK_AC_FORWARD SDLK_AC_STOP SDLK_AC_REFRESH SDLK_AC_BOOKMARKS SDLK_BRIGHTNESSDOWN SDLK_BRIGHTNESSUP SDLK_DISPLAYSWITCH SDLK_KBDILLUMTOGGLE SDLK_KBDILLUMDOWN SDLK_KBDILLUMUP SDLK_EJECT SDLK_SLEEP ctypedef enum SDL_Keymod: KMOD_NONE KMOD_LSHIFT KMOD_RSHIFT KMOD_LCTRL KMOD_RCTRL KMOD_LALT KMOD_RALT KMOD_LGUI KMOD_RGUI KMOD_NUM KMOD_CAPS KMOD_MODE KMOD_RESERVED ctypedef struct SDL_Keysym: SDL_Scancode scancode SDL_Keycode sym Uint16 mod Uint32 unused SDL_Window *SDL_GetKeyboardFocus() const Uint8 *SDL_GetKeyboardState(int *numkeys) SDL_Keymod SDL_GetModState() void SDL_SetModState(SDL_Keymod modstate) SDL_Keycode SDL_GetKeyFromScancode(SDL_Scancode scancode) SDL_Scancode SDL_GetScancodeFromKey(SDL_Keycode key) const char *SDL_GetScancodeName(SDL_Scancode scancode) SDL_Scancode SDL_GetScancodeFromName(const char *name) const char *SDL_GetKeyName(SDL_Keycode key) SDL_Keycode SDL_GetKeyFromName(const char *name) void SDL_StartTextInput() SDL_bool SDL_IsTextInputActive() void SDL_StopTextInput() void SDL_SetTextInputRect(SDL_Rect *rect) SDL_bool SDL_HasScreenKeyboardSupport() SDL_bool SDL_IsScreenKeyboardShown(SDL_Window *window) ctypedef struct SDL_Cursor ctypedef enum SDL_SystemCursor: SDL_SYSTEM_CURSOR_ARROW SDL_SYSTEM_CURSOR_IBEAM SDL_SYSTEM_CURSOR_WAIT SDL_SYSTEM_CURSOR_CROSSHAIR SDL_SYSTEM_CURSOR_WAITARROW SDL_SYSTEM_CURSOR_SIZENWSE SDL_SYSTEM_CURSOR_SIZENESW SDL_SYSTEM_CURSOR_SIZEWE SDL_SYSTEM_CURSOR_SIZENS SDL_SYSTEM_CURSOR_SIZEALL SDL_SYSTEM_CURSOR_NO SDL_SYSTEM_CURSOR_HAND SDL_NUM_SYSTEM_CURSORS SDL_Window *SDL_GetMouseFocus() Uint32 SDL_GetMouseState(int *x, int *y) Uint32 SDL_GetRelativeMouseState(int *x, int *y) void SDL_WarpMouseInWindow(SDL_Window *window, int x, int y) int SDL_SetRelativeMouseMode(SDL_bool enabled) SDL_bool SDL_GetRelativeMouseMode() SDL_Cursor *SDL_CreateCursor(const Uint8 *data, const Uint8 *mask, int w, int h, int hot_x, int hot_y) SDL_Cursor *SDL_CreateColorCursor(SDL_Surface *surface, int hot_x, int hot_y) SDL_Cursor *SDL_CreateSystemCursor(SDL_SystemCursor id) void SDL_SetCursor(SDL_Cursor *cursor) SDL_Cursor *SDL_GetCursor() SDL_Cursor *SDL_GetDefaultCursor() void SDL_FreeCursor(SDL_Cursor *cursor) int SDL_ShowCursor(int toggle) ctypedef struct SDL_Joystick ctypedef struct SDL_JoystickGUID: Uint8 data[16] ctypedef Sint32 SDL_JoystickID int SDL_NumJoysticks() const char *SDL_JoystickNameForIndex(int device_index) SDL_Joystick *SDL_JoystickOpen(int device_index) const char *SDL_JoystickName(SDL_Joystick *joystick) SDL_JoystickGUID SDL_JoystickGetDeviceGUID(int device_index) SDL_JoystickGUID SDL_JoystickGetGUID(SDL_Joystick *joystick) void SDL_JoystickGetGUIDString(SDL_JoystickGUID guid, char *pszGUID, int cbGUID) SDL_JoystickGUID SDL_JoystickGetGUIDFromString(const char *pchGUID) SDL_bool SDL_JoystickGetAttached(SDL_Joystick *joystick) SDL_JoystickID SDL_JoystickInstanceID(SDL_Joystick *joystick) int SDL_JoystickNumAxes(SDL_Joystick *joystick) int SDL_JoystickNumBalls(SDL_Joystick *joystick) int SDL_JoystickNumHats(SDL_Joystick *joystick) int SDL_JoystickNumButtons(SDL_Joystick *joystick) void SDL_JoystickUpdate() int SDL_JoystickEventState(int state) Sint16 SDL_JoystickGetAxis(SDL_Joystick *joystick, int axis) Uint8 SDL_JoystickGetHat(SDL_Joystick *joystick, int hat) int SDL_JoystickGetBall(SDL_Joystick *joystick, int ball, int *dx, int *dy) Uint8 SDL_JoystickGetButton(SDL_Joystick *joystick, int button) void SDL_JoystickClose(SDL_Joystick *joystick) ctypedef struct SDL_GameController ctypedef enum SDL_GameControllerBindType: SDL_CONTROLLER_BINDTYPE_NONE SDL_CONTROLLER_BINDTYPE_BUTTON SDL_CONTROLLER_BINDTYPE_AXIS SDL_CONTROLLER_BINDTYPE_HAT cdef struct anon_struct_6: int hat int hat_mask cdef union anon_union_5: int button int axis anon_struct_6 hat ctypedef struct SDL_GameControllerButtonBind: SDL_GameControllerBindType bindType anon_union_5 value int SDL_GameControllerAddMappingsFromRW(SDL_RWops *rw, int freerw) int SDL_GameControllerAddMapping(const char *mappingString) char *SDL_GameControllerMappingForGUID(SDL_JoystickGUID guid) char *SDL_GameControllerMapping(SDL_GameController *gamecontroller) SDL_bool SDL_IsGameController(int joystick_index) const char *SDL_GameControllerNameForIndex(int joystick_index) SDL_GameController *SDL_GameControllerOpen(int joystick_index) const char *SDL_GameControllerName(SDL_GameController *gamecontroller) SDL_bool SDL_GameControllerGetAttached(SDL_GameController *gamecontroller) SDL_Joystick *SDL_GameControllerGetJoystick(SDL_GameController *gamecontroller) int SDL_GameControllerEventState(int state) void SDL_GameControllerUpdate() ctypedef enum SDL_GameControllerAxis: SDL_CONTROLLER_AXIS_INVALID SDL_CONTROLLER_AXIS_LEFTX SDL_CONTROLLER_AXIS_LEFTY SDL_CONTROLLER_AXIS_RIGHTX SDL_CONTROLLER_AXIS_RIGHTY SDL_CONTROLLER_AXIS_TRIGGERLEFT SDL_CONTROLLER_AXIS_TRIGGERRIGHT SDL_CONTROLLER_AXIS_MAX SDL_GameControllerAxis SDL_GameControllerGetAxisFromString(const char *pchString) const char *SDL_GameControllerGetStringForAxis(SDL_GameControllerAxis axis) SDL_GameControllerButtonBind SDL_GameControllerGetBindForAxis(SDL_GameController *gamecontroller, SDL_GameControllerAxis axis) Sint16 SDL_GameControllerGetAxis(SDL_GameController *gamecontroller, SDL_GameControllerAxis axis) ctypedef enum SDL_GameControllerButton: SDL_CONTROLLER_BUTTON_INVALID SDL_CONTROLLER_BUTTON_A SDL_CONTROLLER_BUTTON_B SDL_CONTROLLER_BUTTON_X SDL_CONTROLLER_BUTTON_Y SDL_CONTROLLER_BUTTON_BACK SDL_CONTROLLER_BUTTON_GUIDE SDL_CONTROLLER_BUTTON_START SDL_CONTROLLER_BUTTON_LEFTSTICK SDL_CONTROLLER_BUTTON_RIGHTSTICK SDL_CONTROLLER_BUTTON_LEFTSHOULDER SDL_CONTROLLER_BUTTON_RIGHTSHOULDER SDL_CONTROLLER_BUTTON_DPAD_UP SDL_CONTROLLER_BUTTON_DPAD_DOWN SDL_CONTROLLER_BUTTON_DPAD_LEFT SDL_CONTROLLER_BUTTON_DPAD_RIGHT SDL_CONTROLLER_BUTTON_MAX SDL_GameControllerButton SDL_GameControllerGetButtonFromString(const char *pchString) const char *SDL_GameControllerGetStringForButton(SDL_GameControllerButton button) SDL_GameControllerButtonBind SDL_GameControllerGetBindForButton(SDL_GameController *gamecontroller, SDL_GameControllerButton button) Uint8 SDL_GameControllerGetButton(SDL_GameController *gamecontroller, SDL_GameControllerButton button) void SDL_GameControllerClose(SDL_GameController *gamecontroller) ctypedef Sint64 SDL_TouchID ctypedef Sint64 SDL_FingerID ctypedef struct SDL_Finger: SDL_FingerID id float x float y float pressure int SDL_GetNumTouchDevices() SDL_TouchID SDL_GetTouchDevice(int index) int SDL_GetNumTouchFingers(SDL_TouchID touchID) SDL_Finger *SDL_GetTouchFinger(SDL_TouchID touchID, int index) ctypedef Sint64 SDL_GestureID int SDL_RecordGesture(SDL_TouchID touchId) int SDL_SaveAllDollarTemplates(SDL_RWops *dst) int SDL_SaveDollarTemplate(SDL_GestureID gestureId, SDL_RWops *dst) int SDL_LoadDollarTemplates(SDL_TouchID touchId, SDL_RWops *src) ctypedef enum SDL_EventType: SDL_FIRSTEVENT SDL_QUIT SDL_APP_TERMINATING SDL_APP_LOWMEMORY SDL_APP_WILLENTERBACKGROUND SDL_APP_DIDENTERBACKGROUND SDL_APP_WILLENTERFOREGROUND SDL_APP_DIDENTERFOREGROUND SDL_WINDOWEVENT SDL_SYSWMEVENT SDL_KEYDOWN SDL_KEYUP SDL_TEXTEDITING SDL_TEXTINPUT SDL_MOUSEMOTION SDL_MOUSEBUTTONDOWN SDL_MOUSEBUTTONUP SDL_MOUSEWHEEL SDL_JOYAXISMOTION SDL_JOYBALLMOTION SDL_JOYHATMOTION SDL_JOYBUTTONDOWN SDL_JOYBUTTONUP SDL_JOYDEVICEADDED SDL_JOYDEVICEREMOVED SDL_CONTROLLERAXISMOTION SDL_CONTROLLERBUTTONDOWN SDL_CONTROLLERBUTTONUP SDL_CONTROLLERDEVICEADDED SDL_CONTROLLERDEVICEREMOVED SDL_CONTROLLERDEVICEREMAPPED SDL_FINGERDOWN SDL_FINGERUP SDL_FINGERMOTION SDL_DOLLARGESTURE SDL_DOLLARRECORD SDL_MULTIGESTURE SDL_CLIPBOARDUPDATE SDL_DROPFILE SDL_RENDER_TARGETS_RESET SDL_USEREVENT SDL_LASTEVENT ctypedef struct SDL_CommonEvent: Uint32 type Uint32 timestamp ctypedef struct SDL_WindowEvent: Uint32 type Uint32 timestamp Uint32 windowID Uint8 event Uint8 padding1 Uint8 padding2 Uint8 padding3 Sint32 data1 Sint32 data2 ctypedef struct SDL_KeyboardEvent: Uint32 type Uint32 timestamp Uint32 windowID Uint8 state Uint8 repeat Uint8 padding2 Uint8 padding3 SDL_Keysym keysym ctypedef struct SDL_TextEditingEvent: Uint32 type Uint32 timestamp Uint32 windowID char text[32] Sint32 start Sint32 length ctypedef struct SDL_TextInputEvent: Uint32 type Uint32 timestamp Uint32 windowID char text[32] ctypedef struct SDL_MouseMotionEvent: Uint32 type Uint32 timestamp Uint32 windowID Uint32 which Uint32 state Sint32 x Sint32 y Sint32 xrel Sint32 yrel ctypedef struct SDL_MouseButtonEvent: Uint32 type Uint32 timestamp Uint32 windowID Uint32 which Uint8 button Uint8 state Uint8 clicks Uint8 padding1 Sint32 x Sint32 y ctypedef struct SDL_MouseWheelEvent: Uint32 type Uint32 timestamp Uint32 windowID Uint32 which Sint32 x Sint32 y ctypedef struct SDL_JoyAxisEvent: Uint32 type Uint32 timestamp SDL_JoystickID which Uint8 axis Uint8 padding1 Uint8 padding2 Uint8 padding3 Sint16 value Uint16 padding4 ctypedef struct SDL_JoyBallEvent: Uint32 type Uint32 timestamp SDL_JoystickID which Uint8 ball Uint8 padding1 Uint8 padding2 Uint8 padding3 Sint16 xrel Sint16 yrel ctypedef struct SDL_JoyHatEvent: Uint32 type Uint32 timestamp SDL_JoystickID which Uint8 hat Uint8 value Uint8 padding1 Uint8 padding2 ctypedef struct SDL_JoyButtonEvent: Uint32 type Uint32 timestamp SDL_JoystickID which Uint8 button Uint8 state Uint8 padding1 Uint8 padding2 ctypedef struct SDL_JoyDeviceEvent: Uint32 type Uint32 timestamp Sint32 which ctypedef struct SDL_ControllerAxisEvent: Uint32 type Uint32 timestamp SDL_JoystickID which Uint8 axis Uint8 padding1 Uint8 padding2 Uint8 padding3 Sint16 value Uint16 padding4 ctypedef struct SDL_ControllerButtonEvent: Uint32 type Uint32 timestamp SDL_JoystickID which Uint8 button Uint8 state Uint8 padding1 Uint8 padding2 ctypedef struct SDL_ControllerDeviceEvent: Uint32 type Uint32 timestamp Sint32 which ctypedef struct SDL_TouchFingerEvent: Uint32 type Uint32 timestamp SDL_TouchID touchId SDL_FingerID fingerId float x float y float dx float dy float pressure ctypedef struct SDL_MultiGestureEvent: Uint32 type Uint32 timestamp SDL_TouchID touchId float dTheta float dDist float x float y Uint16 numFingers Uint16 padding ctypedef struct SDL_DollarGestureEvent: Uint32 type Uint32 timestamp SDL_TouchID touchId SDL_GestureID gestureId Uint32 numFingers float error float x float y ctypedef struct SDL_DropEvent: Uint32 type Uint32 timestamp char *file ctypedef struct SDL_QuitEvent: Uint32 type Uint32 timestamp ctypedef struct SDL_OSEvent: Uint32 type Uint32 timestamp ctypedef struct SDL_UserEvent: Uint32 type Uint32 timestamp Uint32 windowID Sint32 code void *data1 void *data2 ctypedef struct SDL_SysWMmsg ctypedef struct SDL_SysWMEvent: Uint32 type Uint32 timestamp SDL_SysWMmsg *msg ctypedef union SDL_Event: Uint32 type SDL_CommonEvent common SDL_WindowEvent window SDL_KeyboardEvent key SDL_TextEditingEvent edit SDL_TextInputEvent text SDL_MouseMotionEvent motion SDL_MouseButtonEvent button SDL_MouseWheelEvent wheel SDL_JoyAxisEvent jaxis SDL_JoyBallEvent jball SDL_JoyHatEvent jhat SDL_JoyButtonEvent jbutton SDL_JoyDeviceEvent jdevice SDL_ControllerAxisEvent caxis SDL_ControllerButtonEvent cbutton SDL_ControllerDeviceEvent cdevice SDL_QuitEvent quit SDL_UserEvent user SDL_SysWMEvent syswm SDL_TouchFingerEvent tfinger SDL_MultiGestureEvent mgesture SDL_DollarGestureEvent dgesture SDL_DropEvent drop Uint8 padding[56] void SDL_PumpEvents() ctypedef enum SDL_eventaction: SDL_ADDEVENT SDL_PEEKEVENT SDL_GETEVENT int SDL_PeepEvents(SDL_Event *events, int numevents, SDL_eventaction action, Uint32 minType, Uint32 maxType) SDL_bool SDL_HasEvent(Uint32 type) SDL_bool SDL_HasEvents(Uint32 minType, Uint32 maxType) void SDL_FlushEvent(Uint32 type) void SDL_FlushEvents(Uint32 minType, Uint32 maxType) int SDL_PollEvent(SDL_Event *event) int SDL_WaitEvent(SDL_Event *event) int SDL_WaitEventTimeout(SDL_Event *event, int timeout) int SDL_PushEvent(SDL_Event *event) ctypedef int (*SDL_EventFilter)(void *userdata, SDL_Event *event) void SDL_SetEventFilter(SDL_EventFilter filter, void *userdata) SDL_bool SDL_GetEventFilter(SDL_EventFilter *filter, void **userdata) void SDL_AddEventWatch(SDL_EventFilter filter, void *userdata) void SDL_DelEventWatch(SDL_EventFilter filter, void *userdata) void SDL_FilterEvents(SDL_EventFilter filter, void *userdata) Uint8 SDL_EventState(Uint32 type, int state) Uint32 SDL_RegisterEvents(int numevents) char *SDL_GetBasePath() char *SDL_GetPrefPath(const char *org, const char *app) ctypedef struct SDL_Haptic ctypedef struct SDL_HapticDirection: Uint8 type Sint32 dir[3] ctypedef struct SDL_HapticConstant: Uint16 type SDL_HapticDirection direction Uint32 length Uint16 delay Uint16 button Uint16 interval Sint16 level Uint16 attack_length Uint16 attack_level Uint16 fade_length Uint16 fade_level ctypedef struct SDL_HapticPeriodic: Uint16 type SDL_HapticDirection direction Uint32 length Uint16 delay Uint16 button Uint16 interval Uint16 period Sint16 magnitude Sint16 offset Uint16 phase Uint16 attack_length Uint16 attack_level Uint16 fade_length Uint16 fade_level ctypedef struct SDL_HapticCondition: Uint16 type SDL_HapticDirection direction Uint32 length Uint16 delay Uint16 button Uint16 interval Uint16 right_sat[3] Uint16 left_sat[3] Sint16 right_coeff[3] Sint16 left_coeff[3] Uint16 deadband[3] Sint16 center[3] ctypedef struct SDL_HapticRamp: Uint16 type SDL_HapticDirection direction Uint32 length Uint16 delay Uint16 button Uint16 interval Sint16 start Sint16 end Uint16 attack_length Uint16 attack_level Uint16 fade_length Uint16 fade_level ctypedef struct SDL_HapticLeftRight: Uint16 type Uint32 length Uint16 large_magnitude Uint16 small_magnitude ctypedef struct SDL_HapticCustom: Uint16 type SDL_HapticDirection direction Uint32 length Uint16 delay Uint16 button Uint16 interval Uint8 channels Uint16 period Uint16 samples Uint16 *data Uint16 attack_length Uint16 attack_level Uint16 fade_length Uint16 fade_level ctypedef union SDL_HapticEffect: Uint16 type SDL_HapticConstant constant SDL_HapticPeriodic periodic SDL_HapticCondition condition SDL_HapticRamp ramp SDL_HapticLeftRight leftright SDL_HapticCustom custom int SDL_NumHaptics() const char *SDL_HapticName(int device_index) SDL_Haptic *SDL_HapticOpen(int device_index) int SDL_HapticOpened(int device_index) int SDL_HapticIndex(SDL_Haptic *haptic) int SDL_MouseIsHaptic() SDL_Haptic *SDL_HapticOpenFromMouse() int SDL_JoystickIsHaptic(SDL_Joystick *joystick) SDL_Haptic *SDL_HapticOpenFromJoystick(SDL_Joystick *joystick) void SDL_HapticClose(SDL_Haptic *haptic) int SDL_HapticNumEffects(SDL_Haptic *haptic) int SDL_HapticNumEffectsPlaying(SDL_Haptic *haptic) unsigned int SDL_HapticQuery(SDL_Haptic *haptic) int SDL_HapticNumAxes(SDL_Haptic *haptic) int SDL_HapticEffectSupported(SDL_Haptic *haptic, SDL_HapticEffect *effect) int SDL_HapticNewEffect(SDL_Haptic *haptic, SDL_HapticEffect *effect) int SDL_HapticUpdateEffect(SDL_Haptic *haptic, int effect, SDL_HapticEffect *data) int SDL_HapticRunEffect(SDL_Haptic *haptic, int effect, Uint32 iterations) int SDL_HapticStopEffect(SDL_Haptic *haptic, int effect) void SDL_HapticDestroyEffect(SDL_Haptic *haptic, int effect) int SDL_HapticGetEffectStatus(SDL_Haptic *haptic, int effect) int SDL_HapticSetGain(SDL_Haptic *haptic, int gain) int SDL_HapticSetAutocenter(SDL_Haptic *haptic, int autocenter) int SDL_HapticPause(SDL_Haptic *haptic) int SDL_HapticUnpause(SDL_Haptic *haptic) int SDL_HapticStopAll(SDL_Haptic *haptic) int SDL_HapticRumbleSupported(SDL_Haptic *haptic) int SDL_HapticRumbleInit(SDL_Haptic *haptic) int SDL_HapticRumblePlay(SDL_Haptic *haptic, float strength, Uint32 length) int SDL_HapticRumbleStop(SDL_Haptic *haptic) ctypedef enum SDL_HintPriority: SDL_HINT_DEFAULT SDL_HINT_NORMAL SDL_HINT_OVERRIDE SDL_bool SDL_SetHintWithPriority(const char *name, const char *value, SDL_HintPriority priority) SDL_bool SDL_SetHint(const char *name, const char *value) const char *SDL_GetHint(const char *name) ctypedef void (*SDL_HintCallback)(void *userdata, const char *name, const char *oldValue, const char *newValue) void SDL_AddHintCallback(const char *name, SDL_HintCallback callback, void *userdata) void SDL_DelHintCallback(const char *name, SDL_HintCallback callback, void *userdata) void SDL_ClearHints() void *SDL_LoadObject(const char *sofile) void *SDL_LoadFunction(void *handle, const char *name) void SDL_UnloadObject(void *handle) cdef enum: SDL_LOG_CATEGORY_APPLICATION SDL_LOG_CATEGORY_ERROR SDL_LOG_CATEGORY_ASSERT SDL_LOG_CATEGORY_SYSTEM SDL_LOG_CATEGORY_AUDIO SDL_LOG_CATEGORY_VIDEO SDL_LOG_CATEGORY_RENDER SDL_LOG_CATEGORY_INPUT SDL_LOG_CATEGORY_TEST SDL_LOG_CATEGORY_RESERVED1 SDL_LOG_CATEGORY_RESERVED2 SDL_LOG_CATEGORY_RESERVED3 SDL_LOG_CATEGORY_RESERVED4 SDL_LOG_CATEGORY_RESERVED5 SDL_LOG_CATEGORY_RESERVED6 SDL_LOG_CATEGORY_RESERVED7 SDL_LOG_CATEGORY_RESERVED8 SDL_LOG_CATEGORY_RESERVED9 SDL_LOG_CATEGORY_RESERVED10 SDL_LOG_CATEGORY_CUSTOM ctypedef enum SDL_LogPriority: SDL_LOG_PRIORITY_VERBOSE SDL_LOG_PRIORITY_DEBUG SDL_LOG_PRIORITY_INFO SDL_LOG_PRIORITY_WARN SDL_LOG_PRIORITY_ERROR SDL_LOG_PRIORITY_CRITICAL SDL_NUM_LOG_PRIORITIES void SDL_LogSetAllPriority(SDL_LogPriority priority) void SDL_LogSetPriority(int category, SDL_LogPriority priority) SDL_LogPriority SDL_LogGetPriority(int category) void SDL_LogResetPriorities() void SDL_Log(const char *fmt, ...) void SDL_LogVerbose(int category, const char *fmt, ...) void SDL_LogDebug(int category, const char *fmt, ...) void SDL_LogInfo(int category, const char *fmt, ...) void SDL_LogWarn(int category, const char *fmt, ...) void SDL_LogError(int category, const char *fmt, ...) void SDL_LogCritical(int category, const char *fmt, ...) void SDL_LogMessage(int category, SDL_LogPriority priority, const char *fmt, ...) ctypedef void (*SDL_LogOutputFunction)(void *userdata, int category, SDL_LogPriority priority, const char *message) void SDL_LogGetOutputFunction(SDL_LogOutputFunction *callback, void **userdata) void SDL_LogSetOutputFunction(SDL_LogOutputFunction callback, void *userdata) ctypedef enum SDL_MessageBoxFlags: SDL_MESSAGEBOX_ERROR SDL_MESSAGEBOX_WARNING SDL_MESSAGEBOX_INFORMATION ctypedef enum SDL_MessageBoxButtonFlags: SDL_MESSAGEBOX_BUTTON_RETURNKEY_DEFAULT SDL_MESSAGEBOX_BUTTON_ESCAPEKEY_DEFAULT ctypedef struct SDL_MessageBoxButtonData: Uint32 flags int buttonid const char *text ctypedef struct SDL_MessageBoxColor: Uint8 r Uint8 g Uint8 b ctypedef enum SDL_MessageBoxColorType: SDL_MESSAGEBOX_COLOR_BACKGROUND SDL_MESSAGEBOX_COLOR_TEXT SDL_MESSAGEBOX_COLOR_BUTTON_BORDER SDL_MESSAGEBOX_COLOR_BUTTON_BACKGROUND SDL_MESSAGEBOX_COLOR_BUTTON_SELECTED SDL_MESSAGEBOX_COLOR_MAX ctypedef struct SDL_MessageBoxColorScheme: SDL_MessageBoxColor colors[5] ctypedef struct SDL_MessageBoxData: Uint32 flags SDL_Window *window const char *title const char *message int numbuttons const SDL_MessageBoxButtonData *buttons const SDL_MessageBoxColorScheme *colorScheme int SDL_ShowMessageBox(const SDL_MessageBoxData *messageboxdata, int *buttonid) int SDL_ShowSimpleMessageBox(Uint32 flags, const char *title, const char *message, SDL_Window *window) ctypedef enum SDL_PowerState: SDL_POWERSTATE_UNKNOWN SDL_POWERSTATE_ON_BATTERY SDL_POWERSTATE_NO_BATTERY SDL_POWERSTATE_CHARGING SDL_POWERSTATE_CHARGED SDL_PowerState SDL_GetPowerInfo(int *secs, int *pct) ctypedef enum SDL_RendererFlags: SDL_RENDERER_SOFTWARE SDL_RENDERER_ACCELERATED SDL_RENDERER_PRESENTVSYNC SDL_RENDERER_TARGETTEXTURE ctypedef struct SDL_RendererInfo: const char *name Uint32 flags Uint32 num_texture_formats Uint32 texture_formats[16] int max_texture_width int max_texture_height ctypedef enum SDL_TextureAccess: SDL_TEXTUREACCESS_STATIC SDL_TEXTUREACCESS_STREAMING SDL_TEXTUREACCESS_TARGET ctypedef enum SDL_TextureModulate: SDL_TEXTUREMODULATE_NONE SDL_TEXTUREMODULATE_COLOR SDL_TEXTUREMODULATE_ALPHA ctypedef enum SDL_RendererFlip: SDL_FLIP_NONE SDL_FLIP_HORIZONTAL SDL_FLIP_VERTICAL ctypedef struct SDL_Renderer ctypedef struct SDL_Texture int SDL_GetNumRenderDrivers() int SDL_GetRenderDriverInfo(int index, SDL_RendererInfo *info) int SDL_CreateWindowAndRenderer(int width, int height, Uint32 window_flags, SDL_Window **window, SDL_Renderer **renderer) SDL_Renderer *SDL_CreateRenderer(SDL_Window *window, int index, Uint32 flags) SDL_Renderer *SDL_CreateSoftwareRenderer(SDL_Surface *surface) SDL_Renderer *SDL_GetRenderer(SDL_Window *window) int SDL_GetRendererInfo(SDL_Renderer *renderer, SDL_RendererInfo *info) int SDL_GetRendererOutputSize(SDL_Renderer *renderer, int *w, int *h) SDL_Texture *SDL_CreateTexture(SDL_Renderer *renderer, Uint32 format, int access, int w, int h) SDL_Texture *SDL_CreateTextureFromSurface(SDL_Renderer *renderer, SDL_Surface *surface) int SDL_QueryTexture(SDL_Texture *texture, Uint32 *format, int *access, int *w, int *h) int SDL_SetTextureColorMod(SDL_Texture *texture, Uint8 r, Uint8 g, Uint8 b) int SDL_GetTextureColorMod(SDL_Texture *texture, Uint8 *r, Uint8 *g, Uint8 *b) int SDL_SetTextureAlphaMod(SDL_Texture *texture, Uint8 alpha) int SDL_GetTextureAlphaMod(SDL_Texture *texture, Uint8 *alpha) int SDL_SetTextureBlendMode(SDL_Texture *texture, SDL_BlendMode blendMode) int SDL_GetTextureBlendMode(SDL_Texture *texture, SDL_BlendMode *blendMode) int SDL_UpdateTexture(SDL_Texture *texture, const SDL_Rect *rect, const void *pixels, int pitch) int SDL_UpdateYUVTexture(SDL_Texture *texture, const SDL_Rect *rect, const Uint8 *Yplane, int Ypitch, const Uint8 *Uplane, int Upitch, const Uint8 *Vplane, int Vpitch) int SDL_LockTexture(SDL_Texture *texture, const SDL_Rect *rect, void **pixels, int *pitch) void SDL_UnlockTexture(SDL_Texture *texture) SDL_bool SDL_RenderTargetSupported(SDL_Renderer *renderer) int SDL_SetRenderTarget(SDL_Renderer *renderer, SDL_Texture *texture) SDL_Texture *SDL_GetRenderTarget(SDL_Renderer *renderer) int SDL_RenderSetLogicalSize(SDL_Renderer *renderer, int w, int h) void SDL_RenderGetLogicalSize(SDL_Renderer *renderer, int *w, int *h) int SDL_RenderSetViewport(SDL_Renderer *renderer, const SDL_Rect *rect) void SDL_RenderGetViewport(SDL_Renderer *renderer, SDL_Rect *rect) int SDL_RenderSetClipRect(SDL_Renderer *renderer, const SDL_Rect *rect) void SDL_RenderGetClipRect(SDL_Renderer *renderer, SDL_Rect *rect) int SDL_RenderSetScale(SDL_Renderer *renderer, float scaleX, float scaleY) void SDL_RenderGetScale(SDL_Renderer *renderer, float *scaleX, float *scaleY) int SDL_SetRenderDrawColor(SDL_Renderer *renderer, Uint8 r, Uint8 g, Uint8 b, Uint8 a) int SDL_GetRenderDrawColor(SDL_Renderer *renderer, Uint8 *r, Uint8 *g, Uint8 *b, Uint8 *a) int SDL_SetRenderDrawBlendMode(SDL_Renderer *renderer, SDL_BlendMode blendMode) int SDL_GetRenderDrawBlendMode(SDL_Renderer *renderer, SDL_BlendMode *blendMode) int SDL_RenderClear(SDL_Renderer *renderer) int SDL_RenderDrawPoint(SDL_Renderer *renderer, int x, int y) int SDL_RenderDrawPoints(SDL_Renderer *renderer, const SDL_Point *points, int count) int SDL_RenderDrawLine(SDL_Renderer *renderer, int x1, int y1, int x2, int y2) int SDL_RenderDrawLines(SDL_Renderer *renderer, const SDL_Point *points, int count) int SDL_RenderDrawRect(SDL_Renderer *renderer, const SDL_Rect *rect) int SDL_RenderDrawRects(SDL_Renderer *renderer, const SDL_Rect *rects, int count) int SDL_RenderFillRect(SDL_Renderer *renderer, const SDL_Rect *rect) int SDL_RenderFillRects(SDL_Renderer *renderer, const SDL_Rect *rects, int count) int SDL_RenderCopy(SDL_Renderer *renderer, SDL_Texture *texture, const SDL_Rect *srcrect, const SDL_Rect *dstrect) int SDL_RenderCopyEx(SDL_Renderer *renderer, SDL_Texture *texture, const SDL_Rect *srcrect, const SDL_Rect *dstrect, const double angle, const SDL_Point *center, const SDL_RendererFlip flip) int SDL_RenderReadPixels(SDL_Renderer *renderer, const SDL_Rect *rect, Uint32 format, void *pixels, int pitch) void SDL_RenderPresent(SDL_Renderer *renderer) void SDL_DestroyTexture(SDL_Texture *texture) void SDL_DestroyRenderer(SDL_Renderer *renderer) int SDL_GL_BindTexture(SDL_Texture *texture, float *texw, float *texh) int SDL_GL_UnbindTexture(SDL_Texture *texture) Uint32 SDL_GetTicks() Uint64 SDL_GetPerformanceCounter() Uint64 SDL_GetPerformanceFrequency() void SDL_Delay(Uint32 ms) ctypedef Uint32 (*SDL_TimerCallback)(Uint32 interval, void *param) ctypedef int SDL_TimerID SDL_TimerID SDL_AddTimer(Uint32 interval, SDL_TimerCallback callback, void *param) SDL_bool SDL_RemoveTimer(SDL_TimerID id) ctypedef struct SDL_version: Uint8 major Uint8 minor Uint8 patch void SDL_GetVersion(SDL_version *ver) const char *SDL_GetRevision() int SDL_GetRevisionNumber() int SDL_Init(Uint32 flags) int SDL_InitSubSystem(Uint32 flags) void SDL_QuitSubSystem(Uint32 flags) Uint32 SDL_WasInit(Uint32 flags) void SDL_Quit() cdef enum: AUDIO_F32 AUDIO_F32LSB AUDIO_F32MSB AUDIO_F32SYS AUDIO_S16 AUDIO_S16LSB AUDIO_S16MSB AUDIO_S16SYS AUDIO_S32 AUDIO_S32LSB AUDIO_S32MSB AUDIO_S32SYS AUDIO_S8 AUDIO_U16 AUDIO_U16LSB AUDIO_U16MSB AUDIO_U16SYS AUDIO_U8 KMOD_ALT KMOD_CTRL KMOD_GUI KMOD_SHIFT RW_SEEK_CUR RW_SEEK_END RW_SEEK_SET SDLK_SCANCODE_MASK SDL_AUDIOCVT_PACKED SDL_AUDIO_ALLOW_ANY_CHANGE SDL_AUDIO_ALLOW_CHANNELS_CHANGE SDL_AUDIO_ALLOW_FORMAT_CHANGE SDL_AUDIO_ALLOW_FREQUENCY_CHANGE SDL_AUDIO_BITSIZE SDL_AUDIO_DRIVER_ALSA SDL_AUDIO_DRIVER_DISK SDL_AUDIO_DRIVER_DUMMY SDL_AUDIO_DRIVER_OSS SDL_AUDIO_DRIVER_PULSEAUDIO SDL_AUDIO_ISBIGENDIAN SDL_AUDIO_ISFLOAT SDL_AUDIO_ISINT SDL_AUDIO_ISLITTLEENDIAN SDL_AUDIO_ISSIGNED SDL_AUDIO_ISUNSIGNED SDL_AUDIO_MASK_BITSIZE SDL_AUDIO_MASK_DATATYPE SDL_AUDIO_MASK_ENDIAN SDL_AUDIO_MASK_SIGNED SDL_BIG_ENDIAN SDL_BUTTON SDL_BUTTON_LEFT SDL_BUTTON_LMASK SDL_BUTTON_MIDDLE SDL_BUTTON_MMASK SDL_BUTTON_RIGHT SDL_BUTTON_RMASK SDL_BUTTON_X1 SDL_BUTTON_X1MASK SDL_BUTTON_X2 SDL_BUTTON_X2MASK SDL_BYTEORDER SDL_DISABLE SDL_DONTFREE SDL_ENABLE SDL_HAPTIC_AUTOCENTER SDL_HAPTIC_CARTESIAN SDL_HAPTIC_CONSTANT SDL_HAPTIC_CUSTOM SDL_HAPTIC_DAMPER SDL_HAPTIC_FRICTION SDL_HAPTIC_GAIN SDL_HAPTIC_INERTIA SDL_HAPTIC_INFINITY SDL_HAPTIC_LEFTRIGHT SDL_HAPTIC_LINUX SDL_HAPTIC_PAUSE SDL_HAPTIC_POLAR SDL_HAPTIC_RAMP SDL_HAPTIC_SAWTOOTHDOWN SDL_HAPTIC_SAWTOOTHUP SDL_HAPTIC_SINE SDL_HAPTIC_SPHERICAL SDL_HAPTIC_SPRING SDL_HAPTIC_STATUS SDL_HAPTIC_TRIANGLE SDL_HAT_CENTERED SDL_HAT_DOWN SDL_HAT_LEFT SDL_HAT_LEFTDOWN SDL_HAT_LEFTUP SDL_HAT_RIGHT SDL_HAT_RIGHTDOWN SDL_HAT_RIGHTUP SDL_HAT_UP SDL_HINT_ACCELEROMETER_AS_JOYSTICK SDL_HINT_ALLOW_TOPMOST SDL_HINT_FRAMEBUFFER_ACCELERATION SDL_HINT_GAMECONTROLLERCONFIG SDL_HINT_GRAB_KEYBOARD SDL_HINT_IDLE_TIMER_DISABLED SDL_HINT_JOYSTICK_ALLOW_BACKGROUND_EVENTS SDL_HINT_MAC_CTRL_CLICK_EMULATE_RIGHT_CLICK SDL_HINT_MOUSE_RELATIVE_MODE_WARP SDL_HINT_ORIENTATIONS SDL_HINT_RENDER_DIRECT3D_THREADSAFE SDL_HINT_RENDER_DRIVER SDL_HINT_RENDER_OPENGL_SHADERS SDL_HINT_RENDER_SCALE_QUALITY SDL_HINT_RENDER_VSYNC SDL_HINT_TIMER_RESOLUTION SDL_HINT_VIDEO_ALLOW_SCREENSAVER SDL_HINT_VIDEO_HIGHDPI_DISABLED SDL_HINT_VIDEO_MAC_FULLSCREEN_SPACES SDL_HINT_VIDEO_MINIMIZE_ON_FOCUS_LOSS SDL_HINT_VIDEO_WINDOW_SHARE_PIXEL_FORMAT SDL_HINT_VIDEO_WIN_D3DCOMPILER SDL_HINT_VIDEO_X11_XINERAMA SDL_HINT_VIDEO_X11_XRANDR SDL_HINT_VIDEO_X11_XVIDMODE SDL_HINT_XINPUT_ENABLED SDL_IGNORE SDL_INIT_AUDIO SDL_INIT_EVENTS SDL_INIT_EVERYTHING SDL_INIT_GAMECONTROLLER SDL_INIT_HAPTIC SDL_INIT_JOYSTICK SDL_INIT_NOPARACHUTE SDL_INIT_TIMER SDL_INIT_VIDEO SDL_LIL_ENDIAN SDL_MAJOR_VERSION SDL_MINOR_VERSION SDL_PATCHLEVEL SDL_PREALLOC SDL_PRESSED SDL_QUERY SDL_RELEASED SDL_RLEACCEL SDL_RWOPS_JNIFILE SDL_RWOPS_MEMORY SDL_RWOPS_MEMORY_RO SDL_RWOPS_STDFILE SDL_RWOPS_UNKNOWN SDL_RWOPS_WINFILE SDL_SWSURFACE SDL_TEXTEDITINGEVENT_TEXT_SIZE SDL_TEXTINPUTEVENT_TEXT_SIZE SDL_WINDOWPOS_CENTERED SDL_WINDOWPOS_CENTERED_DISPLAY SDL_WINDOWPOS_CENTERED_MASK SDL_WINDOWPOS_UNDEFINED SDL_WINDOWPOS_UNDEFINED_DISPLAY SDL_WINDOWPOS_UNDEFINED_MASK int SDL_MUSTLOCK(SDL_Surface *) pygame_sdl2-2.1.0-for-renpy-6.99.14.1/setuplib.py0000664000175000017500000002000412651175307020452 0ustar tomtom00000000000000# Copyright 2014 Tom Rothamel # # This software is provided 'as-is', without any express or implied # warranty. In no event will the authors be held liable for any damages # arising from the use of this software. # # Permission is granted to anyone to use this software for any purpose, # including commercial applications, and to alter it and redistribute it # freely, subject to the following restrictions: # # 1. The origin of this software must not be misrepresented; you must not # claim that you wrote the original software. If you use this software # in a product, an acknowledgment in the product documentation would be # appreciated but is not required. # 2. Altered source versions must be plainly marked as such, and must not be # misrepresented as being the original software. # 3. This notice may not be removed or altered from any source distribution. from __future__ import division, absolute_import, print_function import os import sys import re import subprocess import platform try: import setuptools except: import distutils.core as setuptools # The include and library dirs that we compile against. include_dirs = [ ".", "src" ] library_dirs = [ ] # Extra arguments that will be given to the compiler. extra_compile_args = [ ] extra_link_args = [ ] # Data files (including DLLs) to include with the package. package_data = [ ] # A list of extension objects that we use. extensions = [ ] # A list of macros that are defined for all modules. global_macros = [ ] # True if we're building on android. android = "PYGAME_SDL2_ANDROID" in os.environ # True if we're building on ios. ios = "PYGAME_SDL2_IOS" in os.environ windows = platform.win32_ver()[0] # The cython command. if windows: cython_command = os.path.join(os.path.dirname(sys.executable), "Scripts", "cython.exe") else: cython_command = "cython" if sys.version_info[0] >= 3: version_flag = "-3" gen = "gen3" else: version_flag = "-2" gen = "gen" def system_path(path): """ On windows/msys, converts a unix-style path returned from sdl2-config to a windows path. Otherwise, returns path. """ if "MSYSTEM" in os.environ: path = subprocess.check_output([ "sh", "-c", "cmd //c echo " + path ]).strip() return path def parse_cflags(command): """ Runs `command`, and uses the command's output to set up include_dirs and extra_compile_args. if `command` is None, parses the cflags from the environment. """ if "PYGAME_SDL2_CFLAGS" in os.environ: output = os.environ["PYGAME_SDL2_CFLAGS"] elif command is not None: output = subprocess.check_output(command, universal_newlines=True) else: output = os.environ.get("CFLAGS", "") for i in output.split(): if i.startswith("-I"): include_dirs.append(system_path(i[2:])) else: extra_compile_args.append(i) parse_cflags(None) def parse_libs(command): """ Runs `command`, and uses the command's output to set up library_dirs and extra_link_args. Returns a list of libraries to link against. If `command` is None, parses LDFLAGS from the environment. """ if "PYGAME_SDL2_LDFLAGS" in os.environ: output = os.environ["PYGAME_SDL2_LDFLAGS"] else: output = subprocess.check_output(command, universal_newlines=True) libs = [ ] for i in output.split(): if i.startswith("-L"): library_dirs.append(system_path(i[2:])) elif i.startswith("-l"): libs.append(i[2:]) else: extra_compile_args.append(i) return libs # A list of modules we do not wish to include. exclude = set(os.environ.get("PYGAME_SDL2_EXCLUDE", "").split()) def cmodule(name, source, libs=[], define_macros=[]): """ Compiles the python module `name` from the files given in `source`, and the libraries in `libs`. """ if name in exclude: return extensions.append(setuptools.Extension( name, source, include_dirs=include_dirs, library_dirs=library_dirs, extra_compile_args=extra_compile_args, extra_link_args=extra_link_args, libraries=libs, define_macros=define_macros + global_macros, )) necessary_gen = [ ] def cython(name, source=[], libs=[], compile_if=True, define_macros=[]): """ Compiles a cython module. This takes care of regenerating it as necessary when it, or any of the files it depends on, changes. """ # Find the pyx file. split_name = name.split(".") fn = "src/" + "/".join(split_name) + ".pyx" if not os.path.exists(fn): print("Could not find {0}.".format(fn)) sys.exit(-1) module_dir = os.path.dirname(fn) # Figure out what it depends on. deps = [ fn ] f = open(fn, "r") for l in f: m = re.search(r'from\s*([\w.]+)\s*cimport', l) if m: deps.append(m.group(1).replace(".", "/") + ".pxd") continue m = re.search(r'cimport\s*([\w.]+)', l) if m: deps.append(m.group(1).replace(".", "/") + ".pxd") continue m = re.search(r'include\s*"(.*?)"', l) if m: deps.append(m.group(1)) continue f.close() # Filter out cython stdlib dependencies. deps = [ i for i in deps if (not i.startswith("cpython/")) and (not i.startswith("libc/")) ] # Determine if any of the dependencies are newer than the c file. c_fn = os.path.join(gen, name + ".c") necessary_gen.append(name + ".c") if os.path.exists(c_fn): c_mtime = os.path.getmtime(c_fn) else: c_mtime = 0 out_of_date = False # print c_fn, "depends on", deps for dep_fn in deps: if os.path.exists(os.path.join("src", dep_fn)): dep_fn = os.path.join("src", dep_fn) elif os.path.exists(os.path.join("include", dep_fn)): dep_fn = os.path.join("include", dep_fn) elif os.path.exists(os.path.join(gen, dep_fn)): dep_fn = os.path.join(gen, dep_fn) elif os.path.exists(dep_fn): pass else: print("{0} depends on {1}, which can't be found.".format(fn, dep_fn)) sys.exit(-1) if os.path.getmtime(dep_fn) > c_mtime: out_of_date = True if out_of_date and not cython_command: print("WARNING:", name, "is out of date, but RENPY_CYTHON isn't set.") out_of_date = False # If the file is out of date, regenerate it. if out_of_date: print(name, "is out of date.") try: subprocess.check_call([ cython_command, version_flag, "-Iinclude", "-I" + gen, "-a", fn, "-o", c_fn]) except subprocess.CalledProcessError as e: print() print(str(e)) print() sys.exit(-1) # Build the module normally once we have the c file. if compile_if: cmodule(name, [ c_fn ] + source, libs=libs, define_macros=define_macros) def find_unnecessary_gen(): for i in os.listdir(gen): if not i.endswith(".c"): continue if i in necessary_gen: continue print("Unnecessary file", os.path.join(gen, i)) py_modules = [ ] def pymodule(name): """ Causes a python module to be included in the build. """ if name in exclude: return py_modules.append(name) def setup(name, version, **kwargs): """ Calls the distutils setup function. """ setuptools.setup( name = name, version = version, ext_modules = extensions, py_modules = py_modules, packages = [ name ], package_dir = { name : 'src/' + name }, package_data = { name : package_data }, zip_safe=False, **kwargs ) # Start in the directory containing setup.py. os.chdir(os.path.abspath(os.path.dirname(sys.argv[0]))) # Ensure the gen directory exists. if not os.path.exists(gen): os.mkdir(gen) pygame_sdl2-2.1.0-for-renpy-6.99.14.1/gen3/0000755000175000017500000000000013235720531017101 5ustar tomtom00000000000000pygame_sdl2-2.1.0-for-renpy-6.99.14.1/gen3/pygame_sdl2.event.c0000644000175000017500000224153513204610604022602 0ustar tomtom00000000000000/* Generated by Cython 0.24 */ #define PY_SSIZE_T_CLEAN #include "Python.h" #ifndef Py_PYTHON_H #error Python headers needed to compile C extensions, please install development version of Python. #elif PY_VERSION_HEX < 0x02060000 || (0x03000000 <= PY_VERSION_HEX && PY_VERSION_HEX < 0x03020000) #error Cython requires Python 2.6+ or Python 3.2+. #else #define CYTHON_ABI "0_24" #include #ifndef offsetof #define offsetof(type, member) ( (size_t) & ((type*)0) -> member ) #endif #if !defined(WIN32) && !defined(MS_WINDOWS) #ifndef __stdcall #define __stdcall #endif #ifndef __cdecl #define __cdecl #endif #ifndef __fastcall #define __fastcall #endif #endif #ifndef DL_IMPORT #define DL_IMPORT(t) t #endif #ifndef DL_EXPORT #define DL_EXPORT(t) t #endif #ifndef PY_LONG_LONG #define PY_LONG_LONG LONG_LONG #endif #ifndef Py_HUGE_VAL #define Py_HUGE_VAL HUGE_VAL #endif #ifdef PYPY_VERSION #define CYTHON_COMPILING_IN_PYPY 1 #define CYTHON_COMPILING_IN_CPYTHON 0 #else #define CYTHON_COMPILING_IN_PYPY 0 #define CYTHON_COMPILING_IN_CPYTHON 1 #endif #if !defined(CYTHON_USE_PYLONG_INTERNALS) && CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x02070000 #define CYTHON_USE_PYLONG_INTERNALS 1 #endif #if CYTHON_USE_PYLONG_INTERNALS #include "longintrepr.h" #undef SHIFT #undef BASE #undef MASK #endif #if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX < 0x02070600 && !defined(Py_OptimizeFlag) #define Py_OptimizeFlag 0 #endif #define __PYX_BUILD_PY_SSIZE_T "n" #define CYTHON_FORMAT_SSIZE_T "z" #if PY_MAJOR_VERSION < 3 #define __Pyx_BUILTIN_MODULE_NAME "__builtin__" #define __Pyx_PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)\ PyCode_New(a+k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos) #define __Pyx_DefaultClassType PyClass_Type #else #define __Pyx_BUILTIN_MODULE_NAME "builtins" #define __Pyx_PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)\ PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos) #define __Pyx_DefaultClassType PyType_Type #endif #ifndef Py_TPFLAGS_CHECKTYPES #define Py_TPFLAGS_CHECKTYPES 0 #endif #ifndef Py_TPFLAGS_HAVE_INDEX #define Py_TPFLAGS_HAVE_INDEX 0 #endif #ifndef Py_TPFLAGS_HAVE_NEWBUFFER #define Py_TPFLAGS_HAVE_NEWBUFFER 0 #endif #ifndef Py_TPFLAGS_HAVE_FINALIZE #define Py_TPFLAGS_HAVE_FINALIZE 0 #endif #if PY_VERSION_HEX > 0x03030000 && defined(PyUnicode_KIND) #define CYTHON_PEP393_ENABLED 1 #define __Pyx_PyUnicode_READY(op) (likely(PyUnicode_IS_READY(op)) ?\ 0 : _PyUnicode_Ready((PyObject *)(op))) #define __Pyx_PyUnicode_GET_LENGTH(u) PyUnicode_GET_LENGTH(u) #define __Pyx_PyUnicode_READ_CHAR(u, i) PyUnicode_READ_CHAR(u, i) #define __Pyx_PyUnicode_KIND(u) PyUnicode_KIND(u) #define __Pyx_PyUnicode_DATA(u) PyUnicode_DATA(u) #define __Pyx_PyUnicode_READ(k, d, i) PyUnicode_READ(k, d, i) #define __Pyx_PyUnicode_IS_TRUE(u) (0 != (likely(PyUnicode_IS_READY(u)) ? PyUnicode_GET_LENGTH(u) : PyUnicode_GET_SIZE(u))) #else #define CYTHON_PEP393_ENABLED 0 #define __Pyx_PyUnicode_READY(op) (0) #define __Pyx_PyUnicode_GET_LENGTH(u) PyUnicode_GET_SIZE(u) #define __Pyx_PyUnicode_READ_CHAR(u, i) ((Py_UCS4)(PyUnicode_AS_UNICODE(u)[i])) #define __Pyx_PyUnicode_KIND(u) (sizeof(Py_UNICODE)) #define __Pyx_PyUnicode_DATA(u) ((void*)PyUnicode_AS_UNICODE(u)) #define __Pyx_PyUnicode_READ(k, d, i) ((void)(k), (Py_UCS4)(((Py_UNICODE*)d)[i])) #define __Pyx_PyUnicode_IS_TRUE(u) (0 != PyUnicode_GET_SIZE(u)) #endif #if CYTHON_COMPILING_IN_PYPY #define __Pyx_PyUnicode_Concat(a, b) PyNumber_Add(a, b) #define __Pyx_PyUnicode_ConcatSafe(a, b) PyNumber_Add(a, b) #else #define __Pyx_PyUnicode_Concat(a, b) PyUnicode_Concat(a, b) #define __Pyx_PyUnicode_ConcatSafe(a, b) ((unlikely((a) == Py_None) || unlikely((b) == Py_None)) ?\ PyNumber_Add(a, b) : __Pyx_PyUnicode_Concat(a, b)) #endif #if CYTHON_COMPILING_IN_PYPY && !defined(PyUnicode_Contains) #define PyUnicode_Contains(u, s) PySequence_Contains(u, s) #endif #if CYTHON_COMPILING_IN_PYPY && !defined(PyObject_Format) #define PyObject_Format(obj, fmt) PyObject_CallMethod(obj, "__format__", "O", fmt) #endif #if CYTHON_COMPILING_IN_PYPY && !defined(PyObject_Malloc) #define PyObject_Malloc(s) PyMem_Malloc(s) #define PyObject_Free(p) PyMem_Free(p) #define PyObject_Realloc(p) PyMem_Realloc(p) #endif #define __Pyx_PyString_FormatSafe(a, b) ((unlikely((a) == Py_None)) ? PyNumber_Remainder(a, b) : __Pyx_PyString_Format(a, b)) #define __Pyx_PyUnicode_FormatSafe(a, b) ((unlikely((a) == Py_None)) ? PyNumber_Remainder(a, b) : PyUnicode_Format(a, b)) #if PY_MAJOR_VERSION >= 3 #define __Pyx_PyString_Format(a, b) PyUnicode_Format(a, b) #else #define __Pyx_PyString_Format(a, b) PyString_Format(a, b) #endif #if PY_MAJOR_VERSION < 3 && !defined(PyObject_ASCII) #define PyObject_ASCII(o) PyObject_Repr(o) #endif #if PY_MAJOR_VERSION >= 3 #define PyBaseString_Type PyUnicode_Type #define PyStringObject PyUnicodeObject #define PyString_Type PyUnicode_Type #define PyString_Check PyUnicode_Check #define PyString_CheckExact PyUnicode_CheckExact #endif #if PY_MAJOR_VERSION >= 3 #define __Pyx_PyBaseString_Check(obj) PyUnicode_Check(obj) #define __Pyx_PyBaseString_CheckExact(obj) PyUnicode_CheckExact(obj) #else #define __Pyx_PyBaseString_Check(obj) (PyString_Check(obj) || PyUnicode_Check(obj)) #define __Pyx_PyBaseString_CheckExact(obj) (PyString_CheckExact(obj) || PyUnicode_CheckExact(obj)) #endif #ifndef PySet_CheckExact #define PySet_CheckExact(obj) (Py_TYPE(obj) == &PySet_Type) #endif #define __Pyx_TypeCheck(obj, type) PyObject_TypeCheck(obj, (PyTypeObject *)type) #if PY_MAJOR_VERSION >= 3 #define PyIntObject PyLongObject #define PyInt_Type PyLong_Type #define PyInt_Check(op) PyLong_Check(op) #define PyInt_CheckExact(op) PyLong_CheckExact(op) #define PyInt_FromString PyLong_FromString #define PyInt_FromUnicode PyLong_FromUnicode #define PyInt_FromLong PyLong_FromLong #define PyInt_FromSize_t PyLong_FromSize_t #define PyInt_FromSsize_t PyLong_FromSsize_t #define PyInt_AsLong PyLong_AsLong #define PyInt_AS_LONG PyLong_AS_LONG #define PyInt_AsSsize_t PyLong_AsSsize_t #define PyInt_AsUnsignedLongMask PyLong_AsUnsignedLongMask #define PyInt_AsUnsignedLongLongMask PyLong_AsUnsignedLongLongMask #define PyNumber_Int PyNumber_Long #endif #if PY_MAJOR_VERSION >= 3 #define PyBoolObject PyLongObject #endif #if PY_MAJOR_VERSION >= 3 && CYTHON_COMPILING_IN_PYPY #ifndef PyUnicode_InternFromString #define PyUnicode_InternFromString(s) PyUnicode_FromString(s) #endif #endif #if PY_VERSION_HEX < 0x030200A4 typedef long Py_hash_t; #define __Pyx_PyInt_FromHash_t PyInt_FromLong #define __Pyx_PyInt_AsHash_t PyInt_AsLong #else #define __Pyx_PyInt_FromHash_t PyInt_FromSsize_t #define __Pyx_PyInt_AsHash_t PyInt_AsSsize_t #endif #if PY_MAJOR_VERSION >= 3 #define __Pyx_PyMethod_New(func, self, klass) ((self) ? PyMethod_New(func, self) : PyInstanceMethod_New(func)) #else #define __Pyx_PyMethod_New(func, self, klass) PyMethod_New(func, self, klass) #endif #if PY_VERSION_HEX >= 0x030500B1 #define __Pyx_PyAsyncMethodsStruct PyAsyncMethods #define __Pyx_PyType_AsAsync(obj) (Py_TYPE(obj)->tp_as_async) #elif CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3 typedef struct { unaryfunc am_await; unaryfunc am_aiter; unaryfunc am_anext; } __Pyx_PyAsyncMethodsStruct; #define __Pyx_PyType_AsAsync(obj) ((__Pyx_PyAsyncMethodsStruct*) (Py_TYPE(obj)->tp_reserved)) #else #define __Pyx_PyType_AsAsync(obj) NULL #endif #ifndef CYTHON_RESTRICT #if defined(__GNUC__) #define CYTHON_RESTRICT __restrict__ #elif defined(_MSC_VER) && _MSC_VER >= 1400 #define CYTHON_RESTRICT __restrict #elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L #define CYTHON_RESTRICT restrict #else #define CYTHON_RESTRICT #endif #endif #define __Pyx_void_to_None(void_result) ((void)(void_result), Py_INCREF(Py_None), Py_None) #ifndef CYTHON_INLINE #if defined(__GNUC__) #define CYTHON_INLINE __inline__ #elif defined(_MSC_VER) #define CYTHON_INLINE __inline #elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L #define CYTHON_INLINE inline #else #define CYTHON_INLINE #endif #endif #if defined(WIN32) || defined(MS_WINDOWS) #define _USE_MATH_DEFINES #endif #include #ifdef NAN #define __PYX_NAN() ((float) NAN) #else static CYTHON_INLINE float __PYX_NAN() { float value; memset(&value, 0xFF, sizeof(value)); return value; } #endif #define __PYX_ERR(f_index, lineno, Ln_error) \ { \ __pyx_filename = __pyx_f[f_index]; __pyx_lineno = lineno; __pyx_clineno = __LINE__; goto Ln_error; \ } #if PY_MAJOR_VERSION >= 3 #define __Pyx_PyNumber_Divide(x,y) PyNumber_TrueDivide(x,y) #define __Pyx_PyNumber_InPlaceDivide(x,y) PyNumber_InPlaceTrueDivide(x,y) #else #define __Pyx_PyNumber_Divide(x,y) PyNumber_TrueDivide(x,y) #define __Pyx_PyNumber_InPlaceDivide(x,y) PyNumber_InPlaceTrueDivide(x,y) #endif #ifndef __PYX_EXTERN_C #ifdef __cplusplus #define __PYX_EXTERN_C extern "C" #else #define __PYX_EXTERN_C extern #endif #endif #define __PYX_HAVE__pygame_sdl2__event #define __PYX_HAVE_API__pygame_sdl2__event #include "string.h" #include "stdio.h" #include "stdint.h" #include "stddef.h" #include "SDL.h" #ifdef _OPENMP #include #endif /* _OPENMP */ #ifdef PYREX_WITHOUT_ASSERTIONS #define CYTHON_WITHOUT_ASSERTIONS #endif #ifndef CYTHON_UNUSED # if defined(__GNUC__) # if !(defined(__cplusplus)) || (__GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 4)) # define CYTHON_UNUSED __attribute__ ((__unused__)) # else # define CYTHON_UNUSED # endif # elif defined(__ICC) || (defined(__INTEL_COMPILER) && !defined(_MSC_VER)) # define CYTHON_UNUSED __attribute__ ((__unused__)) # else # define CYTHON_UNUSED # endif #endif #ifndef CYTHON_NCP_UNUSED # if CYTHON_COMPILING_IN_CPYTHON # define CYTHON_NCP_UNUSED # else # define CYTHON_NCP_UNUSED CYTHON_UNUSED # endif #endif typedef struct {PyObject **p; const char *s; const Py_ssize_t n; const char* encoding; const char is_unicode; const char is_str; const char intern; } __Pyx_StringTabEntry; #define __PYX_DEFAULT_STRING_ENCODING_IS_ASCII 0 #define __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT 0 #define __PYX_DEFAULT_STRING_ENCODING "" #define __Pyx_PyObject_FromString __Pyx_PyBytes_FromString #define __Pyx_PyObject_FromStringAndSize __Pyx_PyBytes_FromStringAndSize #define __Pyx_uchar_cast(c) ((unsigned char)c) #define __Pyx_long_cast(x) ((long)x) #define __Pyx_fits_Py_ssize_t(v, type, is_signed) (\ (sizeof(type) < sizeof(Py_ssize_t)) ||\ (sizeof(type) > sizeof(Py_ssize_t) &&\ likely(v < (type)PY_SSIZE_T_MAX ||\ v == (type)PY_SSIZE_T_MAX) &&\ (!is_signed || likely(v > (type)PY_SSIZE_T_MIN ||\ v == (type)PY_SSIZE_T_MIN))) ||\ (sizeof(type) == sizeof(Py_ssize_t) &&\ (is_signed || likely(v < (type)PY_SSIZE_T_MAX ||\ v == (type)PY_SSIZE_T_MAX))) ) #if defined (__cplusplus) && __cplusplus >= 201103L #include #define __Pyx_sst_abs(value) std::abs(value) #elif SIZEOF_INT >= SIZEOF_SIZE_T #define __Pyx_sst_abs(value) abs(value) #elif SIZEOF_LONG >= SIZEOF_SIZE_T #define __Pyx_sst_abs(value) labs(value) #elif defined (_MSC_VER) && defined (_M_X64) #define __Pyx_sst_abs(value) _abs64(value) #elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L #define __Pyx_sst_abs(value) llabs(value) #elif defined (__GNUC__) #define __Pyx_sst_abs(value) __builtin_llabs(value) #else #define __Pyx_sst_abs(value) ((value<0) ? -value : value) #endif static CYTHON_INLINE char* __Pyx_PyObject_AsString(PyObject*); static CYTHON_INLINE char* __Pyx_PyObject_AsStringAndSize(PyObject*, Py_ssize_t* length); #define __Pyx_PyByteArray_FromString(s) PyByteArray_FromStringAndSize((const char*)s, strlen((const char*)s)) #define __Pyx_PyByteArray_FromStringAndSize(s, l) PyByteArray_FromStringAndSize((const char*)s, l) #define __Pyx_PyBytes_FromString PyBytes_FromString #define __Pyx_PyBytes_FromStringAndSize PyBytes_FromStringAndSize static CYTHON_INLINE PyObject* __Pyx_PyUnicode_FromString(const char*); #if PY_MAJOR_VERSION < 3 #define __Pyx_PyStr_FromString __Pyx_PyBytes_FromString #define __Pyx_PyStr_FromStringAndSize __Pyx_PyBytes_FromStringAndSize #else #define __Pyx_PyStr_FromString __Pyx_PyUnicode_FromString #define __Pyx_PyStr_FromStringAndSize __Pyx_PyUnicode_FromStringAndSize #endif #define __Pyx_PyObject_AsSString(s) ((signed char*) __Pyx_PyObject_AsString(s)) #define __Pyx_PyObject_AsUString(s) ((unsigned char*) __Pyx_PyObject_AsString(s)) #define __Pyx_PyObject_FromCString(s) __Pyx_PyObject_FromString((const char*)s) #define __Pyx_PyBytes_FromCString(s) __Pyx_PyBytes_FromString((const char*)s) #define __Pyx_PyByteArray_FromCString(s) __Pyx_PyByteArray_FromString((const char*)s) #define __Pyx_PyStr_FromCString(s) __Pyx_PyStr_FromString((const char*)s) #define __Pyx_PyUnicode_FromCString(s) __Pyx_PyUnicode_FromString((const char*)s) #if PY_MAJOR_VERSION < 3 static CYTHON_INLINE size_t __Pyx_Py_UNICODE_strlen(const Py_UNICODE *u) { const Py_UNICODE *u_end = u; while (*u_end++) ; return (size_t)(u_end - u - 1); } #else #define __Pyx_Py_UNICODE_strlen Py_UNICODE_strlen #endif #define __Pyx_PyUnicode_FromUnicode(u) PyUnicode_FromUnicode(u, __Pyx_Py_UNICODE_strlen(u)) #define __Pyx_PyUnicode_FromUnicodeAndLength PyUnicode_FromUnicode #define __Pyx_PyUnicode_AsUnicode PyUnicode_AsUnicode #define __Pyx_NewRef(obj) (Py_INCREF(obj), obj) #define __Pyx_Owned_Py_None(b) __Pyx_NewRef(Py_None) #define __Pyx_PyBool_FromLong(b) ((b) ? __Pyx_NewRef(Py_True) : __Pyx_NewRef(Py_False)) static CYTHON_INLINE int __Pyx_PyObject_IsTrue(PyObject*); static CYTHON_INLINE PyObject* __Pyx_PyNumber_IntOrLong(PyObject* x); static CYTHON_INLINE Py_ssize_t __Pyx_PyIndex_AsSsize_t(PyObject*); static CYTHON_INLINE PyObject * __Pyx_PyInt_FromSize_t(size_t); #if CYTHON_COMPILING_IN_CPYTHON #define __pyx_PyFloat_AsDouble(x) (PyFloat_CheckExact(x) ? PyFloat_AS_DOUBLE(x) : PyFloat_AsDouble(x)) #else #define __pyx_PyFloat_AsDouble(x) PyFloat_AsDouble(x) #endif #define __pyx_PyFloat_AsFloat(x) ((float) __pyx_PyFloat_AsDouble(x)) #if PY_MAJOR_VERSION >= 3 #define __Pyx_PyNumber_Int(x) (PyLong_CheckExact(x) ? __Pyx_NewRef(x) : PyNumber_Long(x)) #else #define __Pyx_PyNumber_Int(x) (PyInt_CheckExact(x) ? __Pyx_NewRef(x) : PyNumber_Int(x)) #endif #define __Pyx_PyNumber_Float(x) (PyFloat_CheckExact(x) ? __Pyx_NewRef(x) : PyNumber_Float(x)) #if PY_MAJOR_VERSION < 3 && __PYX_DEFAULT_STRING_ENCODING_IS_ASCII static int __Pyx_sys_getdefaultencoding_not_ascii; static int __Pyx_init_sys_getdefaultencoding_params(void) { PyObject* sys; PyObject* default_encoding = NULL; PyObject* ascii_chars_u = NULL; PyObject* ascii_chars_b = NULL; const char* default_encoding_c; sys = PyImport_ImportModule("sys"); if (!sys) goto bad; default_encoding = PyObject_CallMethod(sys, (char*) "getdefaultencoding", NULL); Py_DECREF(sys); if (!default_encoding) goto bad; default_encoding_c = PyBytes_AsString(default_encoding); if (!default_encoding_c) goto bad; if (strcmp(default_encoding_c, "ascii") == 0) { __Pyx_sys_getdefaultencoding_not_ascii = 0; } else { char ascii_chars[128]; int c; for (c = 0; c < 128; c++) { ascii_chars[c] = c; } __Pyx_sys_getdefaultencoding_not_ascii = 1; ascii_chars_u = PyUnicode_DecodeASCII(ascii_chars, 128, NULL); if (!ascii_chars_u) goto bad; ascii_chars_b = PyUnicode_AsEncodedString(ascii_chars_u, default_encoding_c, NULL); if (!ascii_chars_b || !PyBytes_Check(ascii_chars_b) || memcmp(ascii_chars, PyBytes_AS_STRING(ascii_chars_b), 128) != 0) { PyErr_Format( PyExc_ValueError, "This module compiled with c_string_encoding=ascii, but default encoding '%.200s' is not a superset of ascii.", default_encoding_c); goto bad; } Py_DECREF(ascii_chars_u); Py_DECREF(ascii_chars_b); } Py_DECREF(default_encoding); return 0; bad: Py_XDECREF(default_encoding); Py_XDECREF(ascii_chars_u); Py_XDECREF(ascii_chars_b); return -1; } #endif #if __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT && PY_MAJOR_VERSION >= 3 #define __Pyx_PyUnicode_FromStringAndSize(c_str, size) PyUnicode_DecodeUTF8(c_str, size, NULL) #else #define __Pyx_PyUnicode_FromStringAndSize(c_str, size) PyUnicode_Decode(c_str, size, __PYX_DEFAULT_STRING_ENCODING, NULL) #if __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT static char* __PYX_DEFAULT_STRING_ENCODING; static int __Pyx_init_sys_getdefaultencoding_params(void) { PyObject* sys; PyObject* default_encoding = NULL; char* default_encoding_c; sys = PyImport_ImportModule("sys"); if (!sys) goto bad; default_encoding = PyObject_CallMethod(sys, (char*) (const char*) "getdefaultencoding", NULL); Py_DECREF(sys); if (!default_encoding) goto bad; default_encoding_c = PyBytes_AsString(default_encoding); if (!default_encoding_c) goto bad; __PYX_DEFAULT_STRING_ENCODING = (char*) malloc(strlen(default_encoding_c)); if (!__PYX_DEFAULT_STRING_ENCODING) goto bad; strcpy(__PYX_DEFAULT_STRING_ENCODING, default_encoding_c); Py_DECREF(default_encoding); return 0; bad: Py_XDECREF(default_encoding); return -1; } #endif #endif /* Test for GCC > 2.95 */ #if defined(__GNUC__) && (__GNUC__ > 2 || (__GNUC__ == 2 && (__GNUC_MINOR__ > 95))) #define likely(x) __builtin_expect(!!(x), 1) #define unlikely(x) __builtin_expect(!!(x), 0) #else /* !__GNUC__ or GCC < 2.95 */ #define likely(x) (x) #define unlikely(x) (x) #endif /* __GNUC__ */ static PyObject *__pyx_m; static PyObject *__pyx_d; static PyObject *__pyx_b; static PyObject *__pyx_empty_tuple; static PyObject *__pyx_empty_bytes; static PyObject *__pyx_empty_unicode; static int __pyx_lineno; static int __pyx_clineno = 0; static const char * __pyx_cfilenm= __FILE__; static const char *__pyx_filename; static const char *__pyx_f[] = { "src/pygame_sdl2/event.pyx", "type.pxd", "src/pygame_sdl2/surface.pxd", "src/pygame_sdl2/display.pxd", "include/event_names.pxi", }; /*--- Type declarations ---*/ struct __pyx_obj_11pygame_sdl2_7surface_Surface; struct __pyx_obj_11pygame_sdl2_7display_Window; /* "pygame_sdl2/surface.pxd":23 * from sdl2 cimport SDL_Surface * * cdef class Surface: # <<<<<<<<<<<<<< * # Allow weak references. * cdef object __weakref__ */ struct __pyx_obj_11pygame_sdl2_7surface_Surface { PyObject_HEAD struct __pyx_vtabstruct_11pygame_sdl2_7surface_Surface *__pyx_vtab; PyObject *__weakref__; SDL_Surface *surface; int owns_surface; int window_surface; PyObject *locklist; struct __pyx_obj_11pygame_sdl2_7surface_Surface *parent; struct __pyx_obj_11pygame_sdl2_7surface_Surface *root; int offset_x; int offset_y; PyObject *get_window_flags; int has_alpha; }; /* "pygame_sdl2/display.pxd":23 * from pygame_sdl2.surface cimport Surface * * cdef class Window: # <<<<<<<<<<<<<< * # Allow weak references. * cdef object __weakref__ */ struct __pyx_obj_11pygame_sdl2_7display_Window { PyObject_HEAD PyObject *__weakref__; SDL_Window *window; SDL_Surface *window_surface; struct __pyx_obj_11pygame_sdl2_7surface_Surface *surface; SDL_GLContext gl_context; Uint32 create_flags; }; /* "pygame_sdl2/surface.pxd":23 * from sdl2 cimport SDL_Surface * * cdef class Surface: # <<<<<<<<<<<<<< * # Allow weak references. * cdef object __weakref__ */ struct __pyx_vtabstruct_11pygame_sdl2_7surface_Surface { void (*take_surface)(struct __pyx_obj_11pygame_sdl2_7surface_Surface *, SDL_Surface *); }; static struct __pyx_vtabstruct_11pygame_sdl2_7surface_Surface *__pyx_vtabptr_11pygame_sdl2_7surface_Surface; /* --- Runtime support code (head) --- */ /* Refnanny.proto */ #ifndef CYTHON_REFNANNY #define CYTHON_REFNANNY 0 #endif #if CYTHON_REFNANNY typedef struct { void (*INCREF)(void*, PyObject*, int); void (*DECREF)(void*, PyObject*, int); void (*GOTREF)(void*, PyObject*, int); void (*GIVEREF)(void*, PyObject*, int); void* (*SetupContext)(const char*, int, const char*); void (*FinishContext)(void**); } __Pyx_RefNannyAPIStruct; static __Pyx_RefNannyAPIStruct *__Pyx_RefNanny = NULL; static __Pyx_RefNannyAPIStruct *__Pyx_RefNannyImportAPI(const char *modname); #define __Pyx_RefNannyDeclarations void *__pyx_refnanny = NULL; #ifdef WITH_THREAD #define __Pyx_RefNannySetupContext(name, acquire_gil)\ if (acquire_gil) {\ PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure();\ __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), __LINE__, __FILE__);\ PyGILState_Release(__pyx_gilstate_save);\ } else {\ __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), __LINE__, __FILE__);\ } #else #define __Pyx_RefNannySetupContext(name, acquire_gil)\ __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), __LINE__, __FILE__) #endif #define __Pyx_RefNannyFinishContext()\ __Pyx_RefNanny->FinishContext(&__pyx_refnanny) #define __Pyx_INCREF(r) __Pyx_RefNanny->INCREF(__pyx_refnanny, (PyObject *)(r), __LINE__) #define __Pyx_DECREF(r) __Pyx_RefNanny->DECREF(__pyx_refnanny, (PyObject *)(r), __LINE__) #define __Pyx_GOTREF(r) __Pyx_RefNanny->GOTREF(__pyx_refnanny, (PyObject *)(r), __LINE__) #define __Pyx_GIVEREF(r) __Pyx_RefNanny->GIVEREF(__pyx_refnanny, (PyObject *)(r), __LINE__) #define __Pyx_XINCREF(r) do { if((r) != NULL) {__Pyx_INCREF(r); }} while(0) #define __Pyx_XDECREF(r) do { if((r) != NULL) {__Pyx_DECREF(r); }} while(0) #define __Pyx_XGOTREF(r) do { if((r) != NULL) {__Pyx_GOTREF(r); }} while(0) #define __Pyx_XGIVEREF(r) do { if((r) != NULL) {__Pyx_GIVEREF(r);}} while(0) #else #define __Pyx_RefNannyDeclarations #define __Pyx_RefNannySetupContext(name, acquire_gil) #define __Pyx_RefNannyFinishContext() #define __Pyx_INCREF(r) Py_INCREF(r) #define __Pyx_DECREF(r) Py_DECREF(r) #define __Pyx_GOTREF(r) #define __Pyx_GIVEREF(r) #define __Pyx_XINCREF(r) Py_XINCREF(r) #define __Pyx_XDECREF(r) Py_XDECREF(r) #define __Pyx_XGOTREF(r) #define __Pyx_XGIVEREF(r) #endif #define __Pyx_XDECREF_SET(r, v) do {\ PyObject *tmp = (PyObject *) r;\ r = v; __Pyx_XDECREF(tmp);\ } while (0) #define __Pyx_DECREF_SET(r, v) do {\ PyObject *tmp = (PyObject *) r;\ r = v; __Pyx_DECREF(tmp);\ } while (0) #define __Pyx_CLEAR(r) do { PyObject* tmp = ((PyObject*)(r)); r = NULL; __Pyx_DECREF(tmp);} while(0) #define __Pyx_XCLEAR(r) do { if((r) != NULL) {PyObject* tmp = ((PyObject*)(r)); r = NULL; __Pyx_DECREF(tmp);}} while(0) /* PyObjectGetAttrStr.proto */ #if CYTHON_COMPILING_IN_CPYTHON static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStr(PyObject* obj, PyObject* attr_name) { PyTypeObject* tp = Py_TYPE(obj); if (likely(tp->tp_getattro)) return tp->tp_getattro(obj, attr_name); #if PY_MAJOR_VERSION < 3 if (likely(tp->tp_getattr)) return tp->tp_getattr(obj, PyString_AS_STRING(attr_name)); #endif return PyObject_GetAttr(obj, attr_name); } #else #define __Pyx_PyObject_GetAttrStr(o,n) PyObject_GetAttr(o,n) #endif /* GetBuiltinName.proto */ static PyObject *__Pyx_GetBuiltinName(PyObject *name); /* RaiseArgTupleInvalid.proto */ static void __Pyx_RaiseArgtupleInvalid(const char* func_name, int exact, Py_ssize_t num_min, Py_ssize_t num_max, Py_ssize_t num_found); /* RaiseDoubleKeywords.proto */ static void __Pyx_RaiseDoubleKeywordsError(const char* func_name, PyObject* kw_name); /* ParseKeywords.proto */ static int __Pyx_ParseOptionalKeywords(PyObject *kwds, PyObject **argnames[],\ PyObject *kwds2, PyObject *values[], Py_ssize_t num_pos_args,\ const char* function_name); /* PyObjectSetAttrStr.proto */ #if CYTHON_COMPILING_IN_CPYTHON #define __Pyx_PyObject_DelAttrStr(o,n) __Pyx_PyObject_SetAttrStr(o,n,NULL) static CYTHON_INLINE int __Pyx_PyObject_SetAttrStr(PyObject* obj, PyObject* attr_name, PyObject* value) { PyTypeObject* tp = Py_TYPE(obj); if (likely(tp->tp_setattro)) return tp->tp_setattro(obj, attr_name, value); #if PY_MAJOR_VERSION < 3 if (likely(tp->tp_setattr)) return tp->tp_setattr(obj, PyString_AS_STRING(attr_name), value); #endif return PyObject_SetAttr(obj, attr_name, value); } #else #define __Pyx_PyObject_DelAttrStr(o,n) PyObject_DelAttr(o,n) #define __Pyx_PyObject_SetAttrStr(o,n,v) PyObject_SetAttr(o,n,v) #endif /* PyObjectCall.proto */ #if CYTHON_COMPILING_IN_CPYTHON static CYTHON_INLINE PyObject* __Pyx_PyObject_Call(PyObject *func, PyObject *arg, PyObject *kw); #else #define __Pyx_PyObject_Call(func, arg, kw) PyObject_Call(func, arg, kw) #endif /* PyObjectCallMethO.proto */ #if CYTHON_COMPILING_IN_CPYTHON static CYTHON_INLINE PyObject* __Pyx_PyObject_CallMethO(PyObject *func, PyObject *arg); #endif /* PyObjectCallOneArg.proto */ static CYTHON_INLINE PyObject* __Pyx_PyObject_CallOneArg(PyObject *func, PyObject *arg); /* GetModuleGlobalName.proto */ static CYTHON_INLINE PyObject *__Pyx_GetModuleGlobalName(PyObject *name); /* PyThreadStateGet.proto */ #if CYTHON_COMPILING_IN_CPYTHON #define __Pyx_PyThreadState_declare PyThreadState *__pyx_tstate; #define __Pyx_PyThreadState_assign __pyx_tstate = PyThreadState_GET(); #else #define __Pyx_PyThreadState_declare #define __Pyx_PyThreadState_assign #endif /* SaveResetException.proto */ #if CYTHON_COMPILING_IN_CPYTHON #define __Pyx_ExceptionSave(type, value, tb) __Pyx__ExceptionSave(__pyx_tstate, type, value, tb) static CYTHON_INLINE void __Pyx__ExceptionSave(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb); #define __Pyx_ExceptionReset(type, value, tb) __Pyx__ExceptionReset(__pyx_tstate, type, value, tb) static CYTHON_INLINE void __Pyx__ExceptionReset(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb); #else #define __Pyx_ExceptionSave(type, value, tb) PyErr_GetExcInfo(type, value, tb) #define __Pyx_ExceptionReset(type, value, tb) PyErr_SetExcInfo(type, value, tb) #endif /* PyErrExceptionMatches.proto */ #if CYTHON_COMPILING_IN_CPYTHON #define __Pyx_PyErr_ExceptionMatches(err) __Pyx_PyErr_ExceptionMatchesInState(__pyx_tstate, err) static CYTHON_INLINE int __Pyx_PyErr_ExceptionMatchesInState(PyThreadState* tstate, PyObject* err); #else #define __Pyx_PyErr_ExceptionMatches(err) PyErr_ExceptionMatches(err) #endif /* GetException.proto */ #if CYTHON_COMPILING_IN_CPYTHON #define __Pyx_GetException(type, value, tb) __Pyx__GetException(__pyx_tstate, type, value, tb) static int __Pyx__GetException(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb); #else static int __Pyx_GetException(PyObject **type, PyObject **value, PyObject **tb); #endif /* PyObjectCallNoArg.proto */ #if CYTHON_COMPILING_IN_CPYTHON static CYTHON_INLINE PyObject* __Pyx_PyObject_CallNoArg(PyObject *func); #else #define __Pyx_PyObject_CallNoArg(func) __Pyx_PyObject_Call(func, __pyx_empty_tuple, NULL) #endif /* IncludeStringH.proto */ #include /* decode_c_string.proto */ static CYTHON_INLINE PyObject* __Pyx_decode_c_string( const char* cstring, Py_ssize_t start, Py_ssize_t stop, const char* encoding, const char* errors, PyObject* (*decode_func)(const char *s, Py_ssize_t size, const char *errors)); /* PyIntBinop.proto */ #if CYTHON_COMPILING_IN_CPYTHON static PyObject* __Pyx_PyInt_AddObjC(PyObject *op1, PyObject *op2, long intval, int inplace); #else #define __Pyx_PyInt_AddObjC(op1, op2, intval, inplace)\ (inplace ? PyNumber_InPlaceAdd(op1, op2) : PyNumber_Add(op1, op2)) #endif /* PySequenceContains.proto */ static CYTHON_INLINE int __Pyx_PySequence_ContainsTF(PyObject* item, PyObject* seq, int eq) { int result = PySequence_Contains(seq, item); return unlikely(result < 0) ? result : (result == (eq == Py_EQ)); } /* PyErrFetchRestore.proto */ #if CYTHON_COMPILING_IN_CPYTHON #define __Pyx_ErrRestoreWithState(type, value, tb) __Pyx_ErrRestoreInState(PyThreadState_GET(), type, value, tb) #define __Pyx_ErrFetchWithState(type, value, tb) __Pyx_ErrFetchInState(PyThreadState_GET(), type, value, tb) #define __Pyx_ErrRestore(type, value, tb) __Pyx_ErrRestoreInState(__pyx_tstate, type, value, tb) #define __Pyx_ErrFetch(type, value, tb) __Pyx_ErrFetchInState(__pyx_tstate, type, value, tb) static CYTHON_INLINE void __Pyx_ErrRestoreInState(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb); static CYTHON_INLINE void __Pyx_ErrFetchInState(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb); #else #define __Pyx_ErrRestoreWithState(type, value, tb) PyErr_Restore(type, value, tb) #define __Pyx_ErrFetchWithState(type, value, tb) PyErr_Fetch(type, value, tb) #define __Pyx_ErrRestore(type, value, tb) PyErr_Restore(type, value, tb) #define __Pyx_ErrFetch(type, value, tb) PyErr_Fetch(type, value, tb) #endif /* WriteUnraisableException.proto */ static void __Pyx_WriteUnraisable(const char *name, int clineno, int lineno, const char *filename, int full_traceback, int nogil); /* ListAppend.proto */ #if CYTHON_COMPILING_IN_CPYTHON static CYTHON_INLINE int __Pyx_PyList_Append(PyObject* list, PyObject* x) { PyListObject* L = (PyListObject*) list; Py_ssize_t len = Py_SIZE(list); if (likely(L->allocated > len) & likely(len > (L->allocated >> 1))) { Py_INCREF(x); PyList_SET_ITEM(list, len, x); Py_SIZE(list) = len+1; return 0; } return PyList_Append(list, x); } #else #define __Pyx_PyList_Append(L,x) PyList_Append(L,x) #endif /* PyObjectLookupSpecial.proto */ #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x02070000 static CYTHON_INLINE PyObject* __Pyx_PyObject_LookupSpecial(PyObject* obj, PyObject* attr_name) { PyObject *res; PyTypeObject *tp = Py_TYPE(obj); #if PY_MAJOR_VERSION < 3 if (unlikely(PyInstance_Check(obj))) return __Pyx_PyObject_GetAttrStr(obj, attr_name); #endif res = _PyType_Lookup(tp, attr_name); if (likely(res)) { descrgetfunc f = Py_TYPE(res)->tp_descr_get; if (!f) { Py_INCREF(res); } else { res = f(res, obj, (PyObject *)tp); } } else { PyErr_SetObject(PyExc_AttributeError, attr_name); } return res; } #else #define __Pyx_PyObject_LookupSpecial(o,n) __Pyx_PyObject_GetAttrStr(o,n) #endif /* PyObjectCallMethod1.proto */ static PyObject* __Pyx_PyObject_CallMethod1(PyObject* obj, PyObject* method_name, PyObject* arg); /* append.proto */ static CYTHON_INLINE int __Pyx_PyObject_Append(PyObject* L, PyObject* x); /* None.proto */ static CYTHON_INLINE void __Pyx_RaiseUnboundLocalError(const char *varname); /* pop_index.proto */ static PyObject* __Pyx__PyObject_PopNewIndex(PyObject* L, PyObject* py_ix); static PyObject* __Pyx__PyObject_PopIndex(PyObject* L, PyObject* py_ix); #if CYTHON_COMPILING_IN_CPYTHON static PyObject* __Pyx__PyList_PopIndex(PyObject* L, PyObject* py_ix, Py_ssize_t ix); #define __Pyx_PyObject_PopIndex(L, py_ix, ix, is_signed, type, to_py_func) (\ (likely(PyList_CheckExact(L) && __Pyx_fits_Py_ssize_t(ix, type, is_signed))) ?\ __Pyx__PyList_PopIndex(L, py_ix, ix) : (\ (unlikely(py_ix == Py_None)) ? __Pyx__PyObject_PopNewIndex(L, to_py_func(ix)) :\ __Pyx__PyObject_PopIndex(L, py_ix))) #define __Pyx_PyList_PopIndex(L, py_ix, ix, is_signed, type, to_py_func) (\ __Pyx_fits_Py_ssize_t(ix, type, is_signed) ?\ __Pyx__PyList_PopIndex(L, py_ix, ix) : (\ (unlikely(py_ix == Py_None)) ? __Pyx__PyObject_PopNewIndex(L, to_py_func(ix)) :\ __Pyx__PyObject_PopIndex(L, py_ix))) #else #define __Pyx_PyList_PopIndex(L, py_ix, ix, is_signed, type, to_py_func)\ __Pyx_PyObject_PopIndex(L, py_ix, ix, is_signed, type, to_py_func) #define __Pyx_PyObject_PopIndex(L, py_ix, ix, is_signed, type, to_py_func) (\ (unlikely(py_ix == Py_None)) ? __Pyx__PyObject_PopNewIndex(L, to_py_func(ix)) :\ __Pyx__PyObject_PopIndex(L, py_ix)) #endif /* IterFinish.proto */ static CYTHON_INLINE int __Pyx_IterFinish(void); /* PyObjectCallMethod0.proto */ static PyObject* __Pyx_PyObject_CallMethod0(PyObject* obj, PyObject* method_name); /* RaiseNeedMoreValuesToUnpack.proto */ static CYTHON_INLINE void __Pyx_RaiseNeedMoreValuesError(Py_ssize_t index); /* RaiseTooManyValuesToUnpack.proto */ static CYTHON_INLINE void __Pyx_RaiseTooManyValuesError(Py_ssize_t expected); /* UnpackItemEndCheck.proto */ static int __Pyx_IternextUnpackEndCheck(PyObject *retval, Py_ssize_t expected); /* RaiseNoneIterError.proto */ static CYTHON_INLINE void __Pyx_RaiseNoneNotIterableError(void); /* UnpackTupleError.proto */ static void __Pyx_UnpackTupleError(PyObject *, Py_ssize_t index); /* UnpackTuple2.proto */ static CYTHON_INLINE int __Pyx_unpack_tuple2(PyObject* tuple, PyObject** value1, PyObject** value2, int is_tuple, int has_known_size, int decref_tuple); /* dict_iter.proto */ static CYTHON_INLINE PyObject* __Pyx_dict_iterator(PyObject* dict, int is_dict, PyObject* method_name, Py_ssize_t* p_orig_length, int* p_is_dict); static CYTHON_INLINE int __Pyx_dict_iter_next(PyObject* dict_or_iter, Py_ssize_t orig_length, Py_ssize_t* ppos, PyObject** pkey, PyObject** pvalue, PyObject** pitem, int is_dict); /* ListCompAppend.proto */ #if CYTHON_COMPILING_IN_CPYTHON static CYTHON_INLINE int __Pyx_ListComp_Append(PyObject* list, PyObject* x) { PyListObject* L = (PyListObject*) list; Py_ssize_t len = Py_SIZE(list); if (likely(L->allocated > len)) { Py_INCREF(x); PyList_SET_ITEM(list, len, x); Py_SIZE(list) = len+1; return 0; } return PyList_Append(list, x); } #else #define __Pyx_ListComp_Append(L,x) PyList_Append(L,x) #endif /* RaiseException.proto */ static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, PyObject *cause); /* SetItemInt.proto */ #define __Pyx_SetItemInt(o, i, v, type, is_signed, to_py_func, is_list, wraparound, boundscheck)\ (__Pyx_fits_Py_ssize_t(i, type, is_signed) ?\ __Pyx_SetItemInt_Fast(o, (Py_ssize_t)i, v, is_list, wraparound, boundscheck) :\ (is_list ? (PyErr_SetString(PyExc_IndexError, "list assignment index out of range"), -1) :\ __Pyx_SetItemInt_Generic(o, to_py_func(i), v))) static CYTHON_INLINE int __Pyx_SetItemInt_Generic(PyObject *o, PyObject *j, PyObject *v); static CYTHON_INLINE int __Pyx_SetItemInt_Fast(PyObject *o, Py_ssize_t i, PyObject *v, int is_list, int wraparound, int boundscheck); /* SliceObject.proto */ static CYTHON_INLINE PyObject* __Pyx_PyObject_GetSlice( PyObject* obj, Py_ssize_t cstart, Py_ssize_t cstop, PyObject** py_start, PyObject** py_stop, PyObject** py_slice, int has_cstart, int has_cstop, int wraparound); /* GetVTable.proto */ static void* __Pyx_GetVtable(PyObject *dict); /* Import.proto */ static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list, int level); /* GetItemInt.proto */ #define __Pyx_GetItemInt(o, i, type, is_signed, to_py_func, is_list, wraparound, boundscheck)\ (__Pyx_fits_Py_ssize_t(i, type, is_signed) ?\ __Pyx_GetItemInt_Fast(o, (Py_ssize_t)i, is_list, wraparound, boundscheck) :\ (is_list ? (PyErr_SetString(PyExc_IndexError, "list index out of range"), (PyObject*)NULL) :\ __Pyx_GetItemInt_Generic(o, to_py_func(i)))) #define __Pyx_GetItemInt_List(o, i, type, is_signed, to_py_func, is_list, wraparound, boundscheck)\ (__Pyx_fits_Py_ssize_t(i, type, is_signed) ?\ __Pyx_GetItemInt_List_Fast(o, (Py_ssize_t)i, wraparound, boundscheck) :\ (PyErr_SetString(PyExc_IndexError, "list index out of range"), (PyObject*)NULL)) static CYTHON_INLINE PyObject *__Pyx_GetItemInt_List_Fast(PyObject *o, Py_ssize_t i, int wraparound, int boundscheck); #define __Pyx_GetItemInt_Tuple(o, i, type, is_signed, to_py_func, is_list, wraparound, boundscheck)\ (__Pyx_fits_Py_ssize_t(i, type, is_signed) ?\ __Pyx_GetItemInt_Tuple_Fast(o, (Py_ssize_t)i, wraparound, boundscheck) :\ (PyErr_SetString(PyExc_IndexError, "tuple index out of range"), (PyObject*)NULL)) static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Tuple_Fast(PyObject *o, Py_ssize_t i, int wraparound, int boundscheck); static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Generic(PyObject *o, PyObject* j); static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Fast(PyObject *o, Py_ssize_t i, int is_list, int wraparound, int boundscheck); /* CalculateMetaclass.proto */ static PyObject *__Pyx_CalculateMetaclass(PyTypeObject *metaclass, PyObject *bases); /* FetchCommonType.proto */ static PyTypeObject* __Pyx_FetchCommonType(PyTypeObject* type); /* CythonFunction.proto */ #define __Pyx_CyFunction_USED 1 #include #define __Pyx_CYFUNCTION_STATICMETHOD 0x01 #define __Pyx_CYFUNCTION_CLASSMETHOD 0x02 #define __Pyx_CYFUNCTION_CCLASS 0x04 #define __Pyx_CyFunction_GetClosure(f)\ (((__pyx_CyFunctionObject *) (f))->func_closure) #define __Pyx_CyFunction_GetClassObj(f)\ (((__pyx_CyFunctionObject *) (f))->func_classobj) #define __Pyx_CyFunction_Defaults(type, f)\ ((type *)(((__pyx_CyFunctionObject *) (f))->defaults)) #define __Pyx_CyFunction_SetDefaultsGetter(f, g)\ ((__pyx_CyFunctionObject *) (f))->defaults_getter = (g) typedef struct { PyCFunctionObject func; #if PY_VERSION_HEX < 0x030500A0 PyObject *func_weakreflist; #endif PyObject *func_dict; PyObject *func_name; PyObject *func_qualname; PyObject *func_doc; PyObject *func_globals; PyObject *func_code; PyObject *func_closure; PyObject *func_classobj; void *defaults; int defaults_pyobjects; int flags; PyObject *defaults_tuple; PyObject *defaults_kwdict; PyObject *(*defaults_getter)(PyObject *); PyObject *func_annotations; } __pyx_CyFunctionObject; static PyTypeObject *__pyx_CyFunctionType = 0; #define __Pyx_CyFunction_NewEx(ml, flags, qualname, self, module, globals, code)\ __Pyx_CyFunction_New(__pyx_CyFunctionType, ml, flags, qualname, self, module, globals, code) static PyObject *__Pyx_CyFunction_New(PyTypeObject *, PyMethodDef *ml, int flags, PyObject* qualname, PyObject *self, PyObject *module, PyObject *globals, PyObject* code); static CYTHON_INLINE void *__Pyx_CyFunction_InitDefaults(PyObject *m, size_t size, int pyobjects); static CYTHON_INLINE void __Pyx_CyFunction_SetDefaultsTuple(PyObject *m, PyObject *tuple); static CYTHON_INLINE void __Pyx_CyFunction_SetDefaultsKwDict(PyObject *m, PyObject *dict); static CYTHON_INLINE void __Pyx_CyFunction_SetAnnotationsDict(PyObject *m, PyObject *dict); static int __pyx_CyFunction_init(void); /* Py3ClassCreate.proto */ static PyObject *__Pyx_Py3MetaclassPrepare(PyObject *metaclass, PyObject *bases, PyObject *name, PyObject *qualname, PyObject *mkw, PyObject *modname, PyObject *doc); static PyObject *__Pyx_Py3ClassCreate(PyObject *metaclass, PyObject *name, PyObject *bases, PyObject *dict, PyObject *mkw, int calculate_metaclass, int allow_py2_metaclass); /* CodeObjectCache.proto */ typedef struct { PyCodeObject* code_object; int code_line; } __Pyx_CodeObjectCacheEntry; struct __Pyx_CodeObjectCache { int count; int max_count; __Pyx_CodeObjectCacheEntry* entries; }; static struct __Pyx_CodeObjectCache __pyx_code_cache = {0,0,NULL}; static int __pyx_bisect_code_objects(__Pyx_CodeObjectCacheEntry* entries, int count, int code_line); static PyCodeObject *__pyx_find_code_object(int code_line); static void __pyx_insert_code_object(int code_line, PyCodeObject* code_object); /* AddTraceback.proto */ static void __Pyx_AddTraceback(const char *funcname, int c_line, int py_line, const char *filename); /* CIntToPy.proto */ static CYTHON_INLINE PyObject* __Pyx_PyInt_From_long(long value); /* CIntToPy.proto */ static CYTHON_INLINE PyObject* __Pyx_PyInt_From_SDL_EventType(SDL_EventType value); /* CIntToPy.proto */ static CYTHON_INLINE PyObject* __Pyx_PyInt_From_SDL_Scancode(SDL_Scancode value); /* CIntToPy.proto */ static CYTHON_INLINE PyObject* __Pyx_PyInt_From_int32_t(int32_t value); /* CIntToPy.proto */ static CYTHON_INLINE PyObject* __Pyx_PyInt_From_uint16_t(uint16_t value); /* CIntToPy.proto */ static CYTHON_INLINE PyObject* __Pyx_PyInt_From_uint8_t(uint8_t value); /* CIntToPy.proto */ static CYTHON_INLINE PyObject* __Pyx_PyInt_From_uint32_t(uint32_t value); /* CIntToPy.proto */ static CYTHON_INLINE PyObject* __Pyx_PyInt_From_int(int value); /* CIntToPy.proto */ static CYTHON_INLINE PyObject* __Pyx_PyInt_From_int16_t(int16_t value); /* CIntToPy.proto */ static CYTHON_INLINE PyObject* __Pyx_PyInt_From_int64_t(int64_t value); /* ForceInitThreads.proto */ #ifndef __PYX_FORCE_INIT_THREADS #define __PYX_FORCE_INIT_THREADS 0 #endif /* CIntToPy.proto */ static CYTHON_INLINE PyObject* __Pyx_PyInt_From_SDL_bool(SDL_bool value); /* CIntFromPy.proto */ static CYTHON_INLINE uint32_t __Pyx_PyInt_As_uint32_t(PyObject *); /* CIntFromPy.proto */ static CYTHON_INLINE SDL_bool __Pyx_PyInt_As_SDL_bool(PyObject *); /* CIntFromPy.proto */ static CYTHON_INLINE long __Pyx_PyInt_As_long(PyObject *); /* CIntFromPy.proto */ static CYTHON_INLINE int __Pyx_PyInt_As_int(PyObject *); /* CheckBinaryVersion.proto */ static int __Pyx_check_binary_version(void); /* PyIdentifierFromString.proto */ #if !defined(__Pyx_PyIdentifier_FromString) #if PY_MAJOR_VERSION < 3 #define __Pyx_PyIdentifier_FromString(s) PyString_FromString(s) #else #define __Pyx_PyIdentifier_FromString(s) PyUnicode_FromString(s) #endif #endif /* ModuleImport.proto */ static PyObject *__Pyx_ImportModule(const char *name); /* TypeImport.proto */ static PyTypeObject *__Pyx_ImportType(const char *module_name, const char *class_name, size_t size, int strict); /* VoidPtrImport.proto */ static int __Pyx_ImportVoidPtr(PyObject *module, const char *name, void **p, const char *sig); /* InitStrings.proto */ static int __Pyx_InitStrings(__Pyx_StringTabEntry *t); /* Module declarations from 'libc.string' */ /* Module declarations from 'libc.stdio' */ /* Module declarations from '__builtin__' */ /* Module declarations from 'cpython.type' */ static PyTypeObject *__pyx_ptype_7cpython_4type_type = 0; /* Module declarations from 'cpython' */ /* Module declarations from 'cpython.object' */ /* Module declarations from 'cpython.ref' */ /* Module declarations from 'libc.stdint' */ /* Module declarations from 'libc.stddef' */ /* Module declarations from 'sdl2' */ /* Module declarations from 'pygame_sdl2.surface' */ static PyTypeObject *__pyx_ptype_11pygame_sdl2_7surface_Surface = 0; /* Module declarations from 'pygame_sdl2.display' */ static PyTypeObject *__pyx_ptype_11pygame_sdl2_7display_Window = 0; static struct __pyx_obj_11pygame_sdl2_7display_Window **__pyx_vp_11pygame_sdl2_7display_main_window = 0; #define __pyx_v_11pygame_sdl2_7display_main_window (*__pyx_vp_11pygame_sdl2_7display_main_window) /* Module declarations from 'pygame_sdl2.event' */ static int __pyx_v_11pygame_sdl2_5event_POSTEDEVENT; static int __pyx_v_11pygame_sdl2_5event_mousewheel_buttons; __PYX_EXTERN_C DL_EXPORT(PyObject) *event_queue; static PyObject *__pyx_f_11pygame_sdl2_5event_get_textinput(void); /*proto*/ static PyObject *__pyx_f_11pygame_sdl2_5event_make_keyboard_event(SDL_KeyboardEvent *); /*proto*/ static PyObject *__pyx_f_11pygame_sdl2_5event_make_mousemotion_event(SDL_MouseMotionEvent *); /*proto*/ static PyObject *__pyx_f_11pygame_sdl2_5event_make_mousebtn_event(SDL_MouseButtonEvent *); /*proto*/ static PyObject *__pyx_f_11pygame_sdl2_5event_make_mousewheel_event(SDL_MouseWheelEvent *); /*proto*/ static PyObject *__pyx_f_11pygame_sdl2_5event_make_joyaxis_event(SDL_JoyAxisEvent *); /*proto*/ static PyObject *__pyx_f_11pygame_sdl2_5event_make_joyball_event(SDL_JoyBallEvent *); /*proto*/ static PyObject *__pyx_f_11pygame_sdl2_5event_make_joyhat_event(SDL_JoyHatEvent *); /*proto*/ static PyObject *__pyx_f_11pygame_sdl2_5event_make_joybtn_event(SDL_JoyButtonEvent *); /*proto*/ static PyObject *__pyx_f_11pygame_sdl2_5event_make_textinput_event(SDL_TextInputEvent *); /*proto*/ static PyObject *__pyx_f_11pygame_sdl2_5event_make_textediting_event(SDL_TextEditingEvent *); /*proto*/ static PyObject *__pyx_f_11pygame_sdl2_5event_make_window_event(SDL_WindowEvent *); /*proto*/ static PyObject *__pyx_f_11pygame_sdl2_5event_make_event(SDL_Event *); /*proto*/ static int __pyx_f_11pygame_sdl2_5event_has_event(PyObject *); /*proto*/ static PyObject *__pyx_f_11pygame_sdl2_5event_get_events(PyObject *); /*proto*/ static int __pyx_f_11pygame_sdl2_5event_poll_sdl(void); /*proto*/ #define __Pyx_MODULE_NAME "pygame_sdl2.event" int __pyx_module_is_main_pygame_sdl2__event = 0; /* Implementation of 'pygame_sdl2.event' */ static PyObject *__pyx_builtin_chr; static PyObject *__pyx_builtin_object; static PyObject *__pyx_builtin_property; static PyObject *__pyx_builtin_KeyError; static const char __pyx_k_[] = ""; static const char __pyx_k_d[] = "d"; static const char __pyx_k_e[] = "e"; static const char __pyx_k_h[] = "h"; static const char __pyx_k_t[] = "t"; static const char __pyx_k_w[] = "w"; static const char __pyx_k_x[] = "x"; static const char __pyx_k_y[] = "y"; static const char __pyx_k_dx[] = "dx"; static const char __pyx_k_dy[] = "dy"; static const char __pyx_k_eq[] = "__eq__"; static const char __pyx_k_et[] = "et"; static const char __pyx_k_ne[] = "__ne__"; static const char __pyx_k_on[] = "on"; static const char __pyx_k_rv[] = "rv"; static const char __pyx_k_chr[] = "chr"; static const char __pyx_k_doc[] = "__doc__"; static const char __pyx_k_evt[] = "evt"; static const char __pyx_k_get[] = "get"; static const char __pyx_k_hat[] = "hat"; static const char __pyx_k_joy[] = "joy"; static const char __pyx_k_key[] = "key"; static const char __pyx_k_mod[] = "mod"; static const char __pyx_k_pop[] = "pop"; static const char __pyx_k_pos[] = "pos"; static const char __pyx_k_rel[] = "rel"; static const char __pyx_k_sys[] = "sys"; static const char __pyx_k_QUIT[] = "QUIT"; static const char __pyx_k_axis[] = "axis"; static const char __pyx_k_ball[] = "ball"; static const char __pyx_k_code[] = "code"; static const char __pyx_k_copy[] = "copy"; static const char __pyx_k_dict[] = "dict"; static const char __pyx_k_exit[] = "__exit__"; static const char __pyx_k_flag[] = "flag"; static const char __pyx_k_gain[] = "gain"; static const char __pyx_k_init[] = "__init__"; static const char __pyx_k_keys[] = "keys"; static const char __pyx_k_lock[] = "lock"; static const char __pyx_k_main[] = "__main__"; static const char __pyx_k_name[] = "name"; static const char __pyx_k_peek[] = "peek"; static const char __pyx_k_poll[] = "poll"; static const char __pyx_k_post[] = "post"; static const char __pyx_k_pump[] = "pump"; static const char __pyx_k_repr[] = "__repr__"; static const char __pyx_k_self[] = "self"; static const char __pyx_k_size[] = "size"; static const char __pyx_k_test[] = "__test__"; static const char __pyx_k_text[] = "text"; static const char __pyx_k_type[] = "type"; static const char __pyx_k_wait[] = "wait"; static const char __pyx_k_Event[] = "Event"; static const char __pyx_k_KEYUP[] = "KEYUP"; static const char __pyx_k_RLock[] = "RLock"; static const char __pyx_k_clear[] = "clear"; static const char __pyx_k_dDist[] = "dDist"; static const char __pyx_k_data1[] = "data1"; static const char __pyx_k_data2[] = "data2"; static const char __pyx_k_ename[] = "ename"; static const char __pyx_k_enter[] = "__enter__"; static const char __pyx_k_error[] = "error"; static const char __pyx_k_event[] = "event"; static const char __pyx_k_other[] = "other"; static const char __pyx_k_start[] = "start"; static const char __pyx_k_state[] = "state"; static const char __pyx_k_value[] = "value"; static const char __pyx_k_which[] = "which"; static const char __pyx_k_append[] = "append"; static const char __pyx_k_button[] = "button"; static const char __pyx_k_dTheta[] = "dTheta"; static const char __pyx_k_dict_2[] = "__dict__"; static const char __pyx_k_import[] = "__import__"; static const char __pyx_k_init_2[] = "init"; static const char __pyx_k_insert[] = "insert"; static const char __pyx_k_kwargs[] = "kwargs"; static const char __pyx_k_length[] = "length"; static const char __pyx_k_module[] = "__module__"; static const char __pyx_k_object[] = "object"; static const char __pyx_k_repeat[] = "repeat"; static const char __pyx_k_result[] = "result"; static const char __pyx_k_type_2[] = "_type"; static const char __pyx_k_unichr[] = "unichr"; static const char __pyx_k_update[] = "update"; static const char __pyx_k_KEYDOWN[] = "KEYDOWN"; static const char __pyx_k_NOEVENT[] = "NOEVENT"; static const char __pyx_k_UNKNOWN[] = "UNKNOWN"; static const char __pyx_k_buttons[] = "buttons"; static const char __pyx_k_display[] = "display"; static const char __pyx_k_nonzero[] = "__nonzero__"; static const char __pyx_k_prepare[] = "__prepare__"; static const char __pyx_k_touchId[] = "touchId"; static const char __pyx_k_unicode[] = "unicode"; static const char __pyx_k_DROPFILE[] = "DROPFILE"; static const char __pyx_k_FINGERUP[] = "FINGERUP"; static const char __pyx_k_KeyError[] = "KeyError"; static const char __pyx_k_fingerId[] = "fingerId"; static const char __pyx_k_get_grab[] = "get_grab"; static const char __pyx_k_pressure[] = "pressure"; static const char __pyx_k_property[] = "property"; static const char __pyx_k_qualname[] = "__qualname__"; static const char __pyx_k_register[] = "register"; static const char __pyx_k_scancode[] = "scancode"; static const char __pyx_k_set_grab[] = "set_grab"; static const char __pyx_k_EventType[] = "EventType"; static const char __pyx_k_LASTEVENT[] = "LASTEVENT"; static const char __pyx_k_TEXTINPUT[] = "TEXTINPUT"; static const char __pyx_k_USEREVENT[] = "USEREVENT"; static const char __pyx_k_metaclass[] = "__metaclass__"; static const char __pyx_k_threading[] = "threading"; static const char __pyx_k_FINGERDOWN[] = "FINGERDOWN"; static const char __pyx_k_MOUSEWHEEL[] = "MOUSEWHEEL"; static const char __pyx_k_SYSWMEVENT[] = "SYSWMEVENT"; static const char __pyx_k_event_name[] = "event_name"; static const char __pyx_k_numFingers[] = "numFingers"; static const char __pyx_k_pyx_vtable[] = "__pyx_vtable__"; static const char __pyx_k_text_input[] = "text_input"; static const char __pyx_k_ACTIVEEVENT[] = "ACTIVEEVENT"; static const char __pyx_k_Event_d_s_s[] = ""; static const char __pyx_k_JOYBUTTONUP[] = "JOYBUTTONUP"; static const char __pyx_k_MOUSEMOTION[] = "MOUSEMOTION"; static const char __pyx_k_TEXTEDITING[] = "TEXTEDITING"; static const char __pyx_k_UserEvent_d[] = "UserEvent%d"; static const char __pyx_k_VIDEOEXPOSE[] = "VIDEOEXPOSE"; static const char __pyx_k_VIDEORESIZE[] = "VIDEORESIZE"; static const char __pyx_k_WINDOWEVENT[] = "WINDOWEVENT"; static const char __pyx_k_event_names[] = "event_names"; static const char __pyx_k_get_blocked[] = "get_blocked"; static const char __pyx_k_pygame_sdl2[] = "pygame_sdl2"; static const char __pyx_k_set_allowed[] = "set_allowed"; static const char __pyx_k_set_blocked[] = "set_blocked"; static const char __pyx_k_DOLLARRECORD[] = "DOLLARRECORD"; static const char __pyx_k_FINGERMOTION[] = "FINGERMOTION"; static const char __pyx_k_JOYHATMOTION[] = "JOYHATMOTION"; static const char __pyx_k_MULTIGESTURE[] = "MULTIGESTURE"; static const char __pyx_k_version_info[] = "version_info"; static const char __pyx_k_APP_LOWMEMORY[] = "APP_LOWMEMORY"; static const char __pyx_k_DOLLARGESTURE[] = "DOLLARGESTURE"; static const char __pyx_k_JOYAXISMOTION[] = "JOYAXISMOTION"; static const char __pyx_k_JOYBALLMOTION[] = "JOYBALLMOTION"; static const char __pyx_k_JOYBUTTONDOWN[] = "JOYBUTTONDOWN"; static const char __pyx_k_MOUSEBUTTONUP[] = "MOUSEBUTTONUP"; static const char __pyx_k_NOEVENT_EVENT[] = "NOEVENT_EVENT"; static const char __pyx_k_USEREVENT_MAX[] = "USEREVENT_MAX"; static const char __pyx_k_sdl_main_init[] = "sdl_main_init"; static const char __pyx_k_EventType___eq[] = "EventType.__eq__"; static const char __pyx_k_EventType___ne[] = "EventType.__ne__"; static const char __pyx_k_EventType_dict[] = "EventType.dict"; static const char __pyx_k_EventType_type[] = "EventType.type"; static const char __pyx_k_JOYDEVICEADDED[] = "JOYDEVICEADDED"; static const char __pyx_k_APP_TERMINATING[] = "APP_TERMINATING"; static const char __pyx_k_CLIPBOARDUPDATE[] = "CLIPBOARDUPDATE"; static const char __pyx_k_MOUSEBUTTONDOWN[] = "MOUSEBUTTONDOWN"; static const char __pyx_k_EventType___init[] = "EventType.__init__"; static const char __pyx_k_EventType___repr[] = "EventType.__repr__"; static const char __pyx_k_JOYDEVICEREMOVED[] = "JOYDEVICEREMOVED"; static const char __pyx_k_copy_event_queue[] = "copy_event_queue"; static const char __pyx_k_pygame_sdl2_event[] = "pygame_sdl2.event"; static const char __pyx_k_CONTROLLERBUTTONUP[] = "CONTROLLERBUTTONUP"; static const char __pyx_k_EventType___nonzero[] = "EventType.__nonzero__"; static const char __pyx_k_get_standard_events[] = "get_standard_events"; static const char __pyx_k_CONTROLLERAXISMOTION[] = "CONTROLLERAXISMOTION"; static const char __pyx_k_CONTROLLERBUTTONDOWN[] = "CONTROLLERBUTTONDOWN"; static const char __pyx_k_RENDER_TARGETS_RESET[] = "RENDER_TARGETS_RESET"; static const char __pyx_k_CONTROLLERDEVICEADDED[] = "CONTROLLERDEVICEADDED"; static const char __pyx_k_APP_DIDENTERBACKGROUND[] = "APP_DIDENTERBACKGROUND"; static const char __pyx_k_APP_DIDENTERFOREGROUND[] = "APP_DIDENTERFOREGROUND"; static const char __pyx_k_get_mousewheel_buttons[] = "get_mousewheel_buttons"; static const char __pyx_k_set_mousewheel_buttons[] = "set_mousewheel_buttons"; static const char __pyx_k_APP_WILLENTERBACKGROUND[] = "APP_WILLENTERBACKGROUND"; static const char __pyx_k_APP_WILLENTERFOREGROUND[] = "APP_WILLENTERFOREGROUND"; static const char __pyx_k_CONTROLLERDEVICEREMOVED[] = "CONTROLLERDEVICEREMOVED"; static const char __pyx_k_CONTROLLERDEVICEREMAPPED[] = "CONTROLLERDEVICEREMAPPED"; static const char __pyx_k_home_tom_ab_pygame_sdl2_src_pyg[] = "/home/tom/ab/pygame_sdl2/src/pygame_sdl2/event.pyx"; static const char __pyx_k_event_post_must_be_called_with_a[] = "event.post must be called with an Event."; static PyObject *__pyx_kp_u_; static PyObject *__pyx_n_s_ACTIVEEVENT; static PyObject *__pyx_n_u_ACTIVEEVENT; static PyObject *__pyx_n_u_APP_DIDENTERBACKGROUND; static PyObject *__pyx_n_u_APP_DIDENTERFOREGROUND; static PyObject *__pyx_n_u_APP_LOWMEMORY; static PyObject *__pyx_n_u_APP_TERMINATING; static PyObject *__pyx_n_u_APP_WILLENTERBACKGROUND; static PyObject *__pyx_n_u_APP_WILLENTERFOREGROUND; static PyObject *__pyx_n_u_CLIPBOARDUPDATE; static PyObject *__pyx_n_u_CONTROLLERAXISMOTION; static PyObject *__pyx_n_u_CONTROLLERBUTTONDOWN; static PyObject *__pyx_n_u_CONTROLLERBUTTONUP; static PyObject *__pyx_n_u_CONTROLLERDEVICEADDED; static PyObject *__pyx_n_u_CONTROLLERDEVICEREMAPPED; static PyObject *__pyx_n_u_CONTROLLERDEVICEREMOVED; static PyObject *__pyx_n_u_DOLLARGESTURE; static PyObject *__pyx_n_u_DOLLARRECORD; static PyObject *__pyx_n_u_DROPFILE; static PyObject *__pyx_n_s_Event; static PyObject *__pyx_n_s_EventType; static PyObject *__pyx_n_s_EventType___eq; static PyObject *__pyx_n_s_EventType___init; static PyObject *__pyx_n_s_EventType___ne; static PyObject *__pyx_n_s_EventType___nonzero; static PyObject *__pyx_n_s_EventType___repr; static PyObject *__pyx_n_s_EventType_dict; static PyObject *__pyx_n_s_EventType_type; static PyObject *__pyx_kp_u_Event_d_s_s; static PyObject *__pyx_n_u_FINGERDOWN; static PyObject *__pyx_n_u_FINGERMOTION; static PyObject *__pyx_n_u_FINGERUP; static PyObject *__pyx_n_u_JOYAXISMOTION; static PyObject *__pyx_n_u_JOYBALLMOTION; static PyObject *__pyx_n_u_JOYBUTTONDOWN; static PyObject *__pyx_n_u_JOYBUTTONUP; static PyObject *__pyx_n_u_JOYDEVICEADDED; static PyObject *__pyx_n_u_JOYDEVICEREMOVED; static PyObject *__pyx_n_u_JOYHATMOTION; static PyObject *__pyx_n_u_KEYDOWN; static PyObject *__pyx_n_u_KEYUP; static PyObject *__pyx_n_s_KeyError; static PyObject *__pyx_n_u_LASTEVENT; static PyObject *__pyx_n_u_MOUSEBUTTONDOWN; static PyObject *__pyx_n_u_MOUSEBUTTONUP; static PyObject *__pyx_n_u_MOUSEMOTION; static PyObject *__pyx_n_u_MOUSEWHEEL; static PyObject *__pyx_n_u_MULTIGESTURE; static PyObject *__pyx_n_u_NOEVENT; static PyObject *__pyx_n_s_NOEVENT_EVENT; static PyObject *__pyx_n_u_QUIT; static PyObject *__pyx_n_u_RENDER_TARGETS_RESET; static PyObject *__pyx_n_s_RLock; static PyObject *__pyx_n_u_SYSWMEVENT; static PyObject *__pyx_n_u_TEXTEDITING; static PyObject *__pyx_n_u_TEXTINPUT; static PyObject *__pyx_n_u_UNKNOWN; static PyObject *__pyx_n_u_USEREVENT; static PyObject *__pyx_n_s_USEREVENT_MAX; static PyObject *__pyx_kp_u_UserEvent_d; static PyObject *__pyx_n_s_VIDEOEXPOSE; static PyObject *__pyx_n_u_VIDEOEXPOSE; static PyObject *__pyx_n_s_VIDEORESIZE; static PyObject *__pyx_n_u_VIDEORESIZE; static PyObject *__pyx_n_u_WINDOWEVENT; static PyObject *__pyx_n_s_append; static PyObject *__pyx_n_s_axis; static PyObject *__pyx_n_s_ball; static PyObject *__pyx_n_s_button; static PyObject *__pyx_n_s_buttons; static PyObject *__pyx_n_s_chr; static PyObject *__pyx_n_s_clear; static PyObject *__pyx_n_s_code; static PyObject *__pyx_n_s_copy; static PyObject *__pyx_n_s_copy_event_queue; static PyObject *__pyx_n_s_d; static PyObject *__pyx_n_s_dDist; static PyObject *__pyx_n_s_dTheta; static PyObject *__pyx_n_s_data1; static PyObject *__pyx_n_s_data2; static PyObject *__pyx_n_s_dict; static PyObject *__pyx_n_s_dict_2; static PyObject *__pyx_n_s_display; static PyObject *__pyx_n_s_doc; static PyObject *__pyx_n_s_dx; static PyObject *__pyx_n_s_dy; static PyObject *__pyx_n_s_e; static PyObject *__pyx_n_s_ename; static PyObject *__pyx_n_s_enter; static PyObject *__pyx_n_s_eq; static PyObject *__pyx_n_s_error; static PyObject *__pyx_n_s_et; static PyObject *__pyx_n_s_event; static PyObject *__pyx_n_s_event_name; static PyObject *__pyx_n_s_event_names; static PyObject *__pyx_kp_u_event_post_must_be_called_with_a; static PyObject *__pyx_n_s_evt; static PyObject *__pyx_n_s_exit; static PyObject *__pyx_n_s_fingerId; static PyObject *__pyx_n_s_flag; static PyObject *__pyx_n_s_gain; static PyObject *__pyx_n_s_get; static PyObject *__pyx_n_s_get_blocked; static PyObject *__pyx_n_s_get_grab; static PyObject *__pyx_n_s_get_mousewheel_buttons; static PyObject *__pyx_n_s_get_standard_events; static PyObject *__pyx_n_s_h; static PyObject *__pyx_n_s_hat; static PyObject *__pyx_kp_s_home_tom_ab_pygame_sdl2_src_pyg; static PyObject *__pyx_n_s_import; static PyObject *__pyx_n_s_init; static PyObject *__pyx_n_s_init_2; static PyObject *__pyx_n_s_insert; static PyObject *__pyx_n_s_joy; static PyObject *__pyx_n_s_key; static PyObject *__pyx_n_u_key; static PyObject *__pyx_n_s_keys; static PyObject *__pyx_n_s_kwargs; static PyObject *__pyx_n_s_length; static PyObject *__pyx_n_s_lock; static PyObject *__pyx_n_s_main; static PyObject *__pyx_n_s_metaclass; static PyObject *__pyx_n_u_mod; static PyObject *__pyx_n_s_module; static PyObject *__pyx_n_s_name; static PyObject *__pyx_n_s_ne; static PyObject *__pyx_n_s_nonzero; static PyObject *__pyx_n_s_numFingers; static PyObject *__pyx_n_s_object; static PyObject *__pyx_n_s_on; static PyObject *__pyx_n_s_other; static PyObject *__pyx_n_s_peek; static PyObject *__pyx_n_s_poll; static PyObject *__pyx_n_s_pop; static PyObject *__pyx_n_s_pos; static PyObject *__pyx_n_s_post; static PyObject *__pyx_n_s_prepare; static PyObject *__pyx_n_s_pressure; static PyObject *__pyx_n_s_property; static PyObject *__pyx_n_s_pump; static PyObject *__pyx_n_s_pygame_sdl2; static PyObject *__pyx_n_s_pygame_sdl2_event; static PyObject *__pyx_n_s_pyx_vtable; static PyObject *__pyx_n_s_qualname; static PyObject *__pyx_n_s_register; static PyObject *__pyx_n_s_rel; static PyObject *__pyx_n_s_repeat; static PyObject *__pyx_n_u_repeat; static PyObject *__pyx_n_s_repr; static PyObject *__pyx_n_s_result; static PyObject *__pyx_n_s_rv; static PyObject *__pyx_n_u_scancode; static PyObject *__pyx_n_s_sdl_main_init; static PyObject *__pyx_n_s_self; static PyObject *__pyx_n_s_set_allowed; static PyObject *__pyx_n_s_set_blocked; static PyObject *__pyx_n_s_set_grab; static PyObject *__pyx_n_s_set_mousewheel_buttons; static PyObject *__pyx_n_s_size; static PyObject *__pyx_n_s_start; static PyObject *__pyx_n_s_state; static PyObject *__pyx_n_s_sys; static PyObject *__pyx_n_s_t; static PyObject *__pyx_n_s_test; static PyObject *__pyx_n_s_text; static PyObject *__pyx_n_s_text_input; static PyObject *__pyx_n_s_threading; static PyObject *__pyx_n_s_touchId; static PyObject *__pyx_n_s_type; static PyObject *__pyx_n_s_type_2; static PyObject *__pyx_n_u_type_2; static PyObject *__pyx_n_s_unichr; static PyObject *__pyx_n_u_unicode; static PyObject *__pyx_n_s_update; static PyObject *__pyx_n_s_value; static PyObject *__pyx_n_s_version_info; static PyObject *__pyx_n_s_w; static PyObject *__pyx_n_s_wait; static PyObject *__pyx_n_s_which; static PyObject *__pyx_n_s_x; static PyObject *__pyx_n_s_y; static PyObject *__pyx_pf_11pygame_sdl2_5event_9EventType___init__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_type, PyObject *__pyx_v_dict, PyObject *__pyx_v_kwargs); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_5event_9EventType_2__repr__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_5event_9EventType_4dict(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_5event_9EventType_6type(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_5event_9EventType_8__eq__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_other); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_5event_9EventType_10__ne__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_other); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_5event_9EventType_12__nonzero__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_5event_pump(CYTHON_UNUSED PyObject *__pyx_self); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_5event_2get(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_t); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_5event_4poll(CYTHON_UNUSED PyObject *__pyx_self); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_5event_6wait(CYTHON_UNUSED PyObject *__pyx_self); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_5event_8peek(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_t); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_5event_10clear(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_t); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_5event_12get_standard_events(CYTHON_UNUSED PyObject *__pyx_self); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_5event_14event_name(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_t); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_5event_16set_blocked(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_t); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_5event_18set_allowed(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_t); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_5event_20get_blocked(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_t); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_5event_22set_grab(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_on); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_5event_24get_grab(CYTHON_UNUSED PyObject *__pyx_self); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_5event_26set_mousewheel_buttons(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_flag); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_5event_28get_mousewheel_buttons(CYTHON_UNUSED PyObject *__pyx_self); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_5event_30post(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_e); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_5event_32register(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_name); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_5event_34copy_event_queue(CYTHON_UNUSED PyObject *__pyx_self); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_5event_36init(CYTHON_UNUSED PyObject *__pyx_self); /* proto */ static PyObject *__pyx_int_0; static PyObject *__pyx_int_1; static PyObject *__pyx_int_2; static PyObject *__pyx_int_3; static PyObject *__pyx_int_4; static PyObject *__pyx_tuple__2; static PyObject *__pyx_tuple__3; static PyObject *__pyx_tuple__4; static PyObject *__pyx_tuple__5; static PyObject *__pyx_tuple__6; static PyObject *__pyx_tuple__7; static PyObject *__pyx_tuple__8; static PyObject *__pyx_tuple__9; static PyObject *__pyx_slice__13; static PyObject *__pyx_tuple__10; static PyObject *__pyx_tuple__11; static PyObject *__pyx_tuple__12; static PyObject *__pyx_tuple__14; static PyObject *__pyx_tuple__16; static PyObject *__pyx_tuple__17; static PyObject *__pyx_tuple__19; static PyObject *__pyx_tuple__21; static PyObject *__pyx_tuple__23; static PyObject *__pyx_tuple__25; static PyObject *__pyx_tuple__27; static PyObject *__pyx_tuple__29; static PyObject *__pyx_tuple__31; static PyObject *__pyx_tuple__34; static PyObject *__pyx_tuple__36; static PyObject *__pyx_tuple__38; static PyObject *__pyx_tuple__41; static PyObject *__pyx_tuple__43; static PyObject *__pyx_tuple__45; static PyObject *__pyx_tuple__47; static PyObject *__pyx_tuple__49; static PyObject *__pyx_tuple__52; static PyObject *__pyx_tuple__55; static PyObject *__pyx_tuple__57; static PyObject *__pyx_codeobj__15; static PyObject *__pyx_codeobj__18; static PyObject *__pyx_codeobj__20; static PyObject *__pyx_codeobj__22; static PyObject *__pyx_codeobj__24; static PyObject *__pyx_codeobj__26; static PyObject *__pyx_codeobj__28; static PyObject *__pyx_codeobj__30; static PyObject *__pyx_codeobj__32; static PyObject *__pyx_codeobj__33; static PyObject *__pyx_codeobj__35; static PyObject *__pyx_codeobj__37; static PyObject *__pyx_codeobj__39; static PyObject *__pyx_codeobj__40; static PyObject *__pyx_codeobj__42; static PyObject *__pyx_codeobj__44; static PyObject *__pyx_codeobj__46; static PyObject *__pyx_codeobj__48; static PyObject *__pyx_codeobj__50; static PyObject *__pyx_codeobj__51; static PyObject *__pyx_codeobj__53; static PyObject *__pyx_codeobj__54; static PyObject *__pyx_codeobj__56; static PyObject *__pyx_codeobj__58; static PyObject *__pyx_codeobj__59; static PyObject *__pyx_codeobj__60; PyObject *event_queue = 0; /* "pygame_sdl2/event.pyx":57 * class EventType(object): * * def __init__(self, type, dict=None, **kwargs): # <<<<<<<<<<<<<< * self._type = type * */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_5event_9EventType_1__init__(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static PyMethodDef __pyx_mdef_11pygame_sdl2_5event_9EventType_1__init__ = {"__init__", (PyCFunction)__pyx_pw_11pygame_sdl2_5event_9EventType_1__init__, METH_VARARGS|METH_KEYWORDS, 0}; static PyObject *__pyx_pw_11pygame_sdl2_5event_9EventType_1__init__(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_self = 0; PyObject *__pyx_v_type = 0; PyObject *__pyx_v_dict = 0; PyObject *__pyx_v_kwargs = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__init__ (wrapper)", 0); __pyx_v_kwargs = PyDict_New(); if (unlikely(!__pyx_v_kwargs)) return NULL; __Pyx_GOTREF(__pyx_v_kwargs); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_type,&__pyx_n_s_dict,0}; PyObject* values[3] = {0,0,0}; values[2] = ((PyObject *)((PyObject *)Py_None)); if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_self)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; case 1: if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_type)) != 0)) kw_args--; else { __Pyx_RaiseArgtupleInvalid("__init__", 0, 2, 3, 1); __PYX_ERR(0, 57, __pyx_L3_error) } case 2: if (kw_args > 0) { PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_dict); if (value) { values[2] = value; kw_args--; } } } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, __pyx_v_kwargs, values, pos_args, "__init__") < 0)) __PYX_ERR(0, 57, __pyx_L3_error) } } else { switch (PyTuple_GET_SIZE(__pyx_args)) { case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); values[0] = PyTuple_GET_ITEM(__pyx_args, 0); break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_self = values[0]; __pyx_v_type = values[1]; __pyx_v_dict = values[2]; } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("__init__", 0, 2, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 57, __pyx_L3_error) __pyx_L3_error:; __Pyx_DECREF(__pyx_v_kwargs); __pyx_v_kwargs = 0; __Pyx_AddTraceback("pygame_sdl2.event.EventType.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_11pygame_sdl2_5event_9EventType___init__(__pyx_self, __pyx_v_self, __pyx_v_type, __pyx_v_dict, __pyx_v_kwargs); /* function exit code */ __Pyx_XDECREF(__pyx_v_kwargs); __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_5event_9EventType___init__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_type, PyObject *__pyx_v_dict, PyObject *__pyx_v_kwargs) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; PyObject *__pyx_t_5 = NULL; __Pyx_RefNannySetupContext("__init__", 0); /* "pygame_sdl2/event.pyx":58 * * def __init__(self, type, dict=None, **kwargs): * self._type = type # <<<<<<<<<<<<<< * * if dict: */ if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_type_2, __pyx_v_type) < 0) __PYX_ERR(0, 58, __pyx_L1_error) /* "pygame_sdl2/event.pyx":60 * self._type = type * * if dict: # <<<<<<<<<<<<<< * self.__dict__.update(dict) * */ __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_dict); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(0, 60, __pyx_L1_error) if (__pyx_t_1) { /* "pygame_sdl2/event.pyx":61 * * if dict: * self.__dict__.update(dict) # <<<<<<<<<<<<<< * * self.__dict__.update(kwargs) */ __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_dict_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 61, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_update); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 61, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_3 = NULL; if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_4))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_4); if (likely(__pyx_t_3)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_4, function); } } if (!__pyx_t_3) { __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_v_dict); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 61, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); } else { __pyx_t_5 = PyTuple_New(1+1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 61, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_3); __pyx_t_3 = NULL; __Pyx_INCREF(__pyx_v_dict); __Pyx_GIVEREF(__pyx_v_dict); PyTuple_SET_ITEM(__pyx_t_5, 0+1, __pyx_v_dict); __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_5, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 61, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; } __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "pygame_sdl2/event.pyx":60 * self._type = type * * if dict: # <<<<<<<<<<<<<< * self.__dict__.update(dict) * */ } /* "pygame_sdl2/event.pyx":63 * self.__dict__.update(dict) * * self.__dict__.update(kwargs) # <<<<<<<<<<<<<< * * def __repr__(self): */ __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_dict_2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 63, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_update); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 63, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_t_4 = NULL; if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_5))) { __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_5); if (likely(__pyx_t_4)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5); __Pyx_INCREF(__pyx_t_4); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_5, function); } } if (!__pyx_t_4) { __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_v_kwargs); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 63, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); } else { __pyx_t_3 = PyTuple_New(1+1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 63, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_4); __pyx_t_4 = NULL; __Pyx_INCREF(__pyx_v_kwargs); __Pyx_GIVEREF(__pyx_v_kwargs); PyTuple_SET_ITEM(__pyx_t_3, 0+1, __pyx_v_kwargs); __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_3, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 63, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "pygame_sdl2/event.pyx":57 * class EventType(object): * * def __init__(self, type, dict=None, **kwargs): # <<<<<<<<<<<<<< * self._type = type * */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_5); __Pyx_AddTraceback("pygame_sdl2.event.EventType.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/event.pyx":65 * self.__dict__.update(kwargs) * * def __repr__(self): # <<<<<<<<<<<<<< * if SDL_USEREVENT <= self.type < VIDEOEXPOSE: * ename = "UserEvent%d" % (self.type - SDL_USEREVENT) */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_5event_9EventType_3__repr__(PyObject *__pyx_self, PyObject *__pyx_v_self); /*proto*/ static PyMethodDef __pyx_mdef_11pygame_sdl2_5event_9EventType_3__repr__ = {"__repr__", (PyCFunction)__pyx_pw_11pygame_sdl2_5event_9EventType_3__repr__, METH_O, 0}; static PyObject *__pyx_pw_11pygame_sdl2_5event_9EventType_3__repr__(PyObject *__pyx_self, PyObject *__pyx_v_self) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__repr__ (wrapper)", 0); __pyx_r = __pyx_pf_11pygame_sdl2_5event_9EventType_2__repr__(__pyx_self, ((PyObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_5event_9EventType_2__repr__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self) { PyObject *__pyx_v_ename = NULL; PyObject *__pyx_v_d = NULL; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; int __pyx_t_5; PyObject *__pyx_t_6 = NULL; PyObject *__pyx_t_7 = NULL; PyObject *__pyx_t_8 = NULL; int __pyx_t_9; __Pyx_RefNannySetupContext("__repr__", 0); /* "pygame_sdl2/event.pyx":66 * * def __repr__(self): * if SDL_USEREVENT <= self.type < VIDEOEXPOSE: # <<<<<<<<<<<<<< * ename = "UserEvent%d" % (self.type - SDL_USEREVENT) * else: */ __pyx_t_1 = __Pyx_PyInt_From_SDL_EventType(SDL_USEREVENT); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 66, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_type); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 66, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = PyObject_RichCompare(__pyx_t_1, __pyx_t_2, Py_LE); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 66, __pyx_L1_error) if (__Pyx_PyObject_IsTrue(__pyx_t_3)) { __Pyx_DECREF(__pyx_t_3); __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_VIDEOEXPOSE); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 66, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_3 = PyObject_RichCompare(__pyx_t_2, __pyx_t_4, Py_LT); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 66, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_5 < 0)) __PYX_ERR(0, 66, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; if (__pyx_t_5) { /* "pygame_sdl2/event.pyx":67 * def __repr__(self): * if SDL_USEREVENT <= self.type < VIDEOEXPOSE: * ename = "UserEvent%d" % (self.type - SDL_USEREVENT) # <<<<<<<<<<<<<< * else: * try: */ __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_type); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 67, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_2 = __Pyx_PyInt_From_SDL_EventType(SDL_USEREVENT); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 67, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_1 = PyNumber_Subtract(__pyx_t_3, __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 67, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_2 = PyUnicode_Format(__pyx_kp_u_UserEvent_d, __pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 67, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_v_ename = __pyx_t_2; __pyx_t_2 = 0; /* "pygame_sdl2/event.pyx":66 * * def __repr__(self): * if SDL_USEREVENT <= self.type < VIDEOEXPOSE: # <<<<<<<<<<<<<< * ename = "UserEvent%d" % (self.type - SDL_USEREVENT) * else: */ goto __pyx_L3; } /* "pygame_sdl2/event.pyx":69 * ename = "UserEvent%d" % (self.type - SDL_USEREVENT) * else: * try: # <<<<<<<<<<<<<< * ename = event_names[self.type] * except KeyError: */ /*else*/ { { __Pyx_PyThreadState_declare __Pyx_PyThreadState_assign __Pyx_ExceptionSave(&__pyx_t_6, &__pyx_t_7, &__pyx_t_8); __Pyx_XGOTREF(__pyx_t_6); __Pyx_XGOTREF(__pyx_t_7); __Pyx_XGOTREF(__pyx_t_8); /*try:*/ { /* "pygame_sdl2/event.pyx":70 * else: * try: * ename = event_names[self.type] # <<<<<<<<<<<<<< * except KeyError: * ename = "UNKNOWN" */ __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_event_names); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 70, __pyx_L4_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_type); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 70, __pyx_L4_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_3 = PyObject_GetItem(__pyx_t_2, __pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 70, __pyx_L4_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_v_ename = __pyx_t_3; __pyx_t_3 = 0; /* "pygame_sdl2/event.pyx":69 * ename = "UserEvent%d" % (self.type - SDL_USEREVENT) * else: * try: # <<<<<<<<<<<<<< * ename = event_names[self.type] * except KeyError: */ } __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0; goto __pyx_L11_try_end; __pyx_L4_error:; __Pyx_PyThreadState_assign __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; /* "pygame_sdl2/event.pyx":71 * try: * ename = event_names[self.type] * except KeyError: # <<<<<<<<<<<<<< * ename = "UNKNOWN" * */ __pyx_t_9 = __Pyx_PyErr_ExceptionMatches(__pyx_builtin_KeyError); if (__pyx_t_9) { __Pyx_AddTraceback("pygame_sdl2.event.EventType.__repr__", __pyx_clineno, __pyx_lineno, __pyx_filename); if (__Pyx_GetException(&__pyx_t_3, &__pyx_t_1, &__pyx_t_2) < 0) __PYX_ERR(0, 71, __pyx_L6_except_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_GOTREF(__pyx_t_1); __Pyx_GOTREF(__pyx_t_2); /* "pygame_sdl2/event.pyx":72 * ename = event_names[self.type] * except KeyError: * ename = "UNKNOWN" # <<<<<<<<<<<<<< * * d = self.__dict__.copy() */ __Pyx_INCREF(__pyx_n_u_UNKNOWN); __Pyx_XDECREF_SET(__pyx_v_ename, __pyx_n_u_UNKNOWN); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; goto __pyx_L5_exception_handled; } goto __pyx_L6_except_error; __pyx_L6_except_error:; /* "pygame_sdl2/event.pyx":69 * ename = "UserEvent%d" % (self.type - SDL_USEREVENT) * else: * try: # <<<<<<<<<<<<<< * ename = event_names[self.type] * except KeyError: */ __Pyx_PyThreadState_assign __Pyx_XGIVEREF(__pyx_t_6); __Pyx_XGIVEREF(__pyx_t_7); __Pyx_XGIVEREF(__pyx_t_8); __Pyx_ExceptionReset(__pyx_t_6, __pyx_t_7, __pyx_t_8); goto __pyx_L1_error; __pyx_L5_exception_handled:; __Pyx_PyThreadState_assign __Pyx_XGIVEREF(__pyx_t_6); __Pyx_XGIVEREF(__pyx_t_7); __Pyx_XGIVEREF(__pyx_t_8); __Pyx_ExceptionReset(__pyx_t_6, __pyx_t_7, __pyx_t_8); __pyx_L11_try_end:; } } __pyx_L3:; /* "pygame_sdl2/event.pyx":74 * ename = "UNKNOWN" * * d = self.__dict__.copy() # <<<<<<<<<<<<<< * del d['_type'] * return '' % (self.type, ename, d) */ __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_dict_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 74, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_copy); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 74, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_1 = NULL; if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_3))) { __pyx_t_1 = PyMethod_GET_SELF(__pyx_t_3); if (likely(__pyx_t_1)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); __Pyx_INCREF(__pyx_t_1); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_3, function); } } if (__pyx_t_1) { __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 74, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; } else { __pyx_t_2 = __Pyx_PyObject_CallNoArg(__pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 74, __pyx_L1_error) } __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_v_d = __pyx_t_2; __pyx_t_2 = 0; /* "pygame_sdl2/event.pyx":75 * * d = self.__dict__.copy() * del d['_type'] # <<<<<<<<<<<<<< * return '' % (self.type, ename, d) * */ if (unlikely(PyObject_DelItem(__pyx_v_d, __pyx_n_u_type_2) < 0)) __PYX_ERR(0, 75, __pyx_L1_error) /* "pygame_sdl2/event.pyx":76 * d = self.__dict__.copy() * del d['_type'] * return '' % (self.type, ename, d) # <<<<<<<<<<<<<< * * @property */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_type); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 76, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = PyTuple_New(3); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 76, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_GIVEREF(__pyx_t_2); PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_2); __Pyx_INCREF(__pyx_v_ename); __Pyx_GIVEREF(__pyx_v_ename); PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_v_ename); __Pyx_INCREF(__pyx_v_d); __Pyx_GIVEREF(__pyx_v_d); PyTuple_SET_ITEM(__pyx_t_3, 2, __pyx_v_d); __pyx_t_2 = 0; __pyx_t_2 = PyUnicode_Format(__pyx_kp_u_Event_d_s_s, __pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 76, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; /* "pygame_sdl2/event.pyx":65 * self.__dict__.update(kwargs) * * def __repr__(self): # <<<<<<<<<<<<<< * if SDL_USEREVENT <= self.type < VIDEOEXPOSE: * ename = "UserEvent%d" % (self.type - SDL_USEREVENT) */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_AddTraceback("pygame_sdl2.event.EventType.__repr__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF(__pyx_v_ename); __Pyx_XDECREF(__pyx_v_d); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/event.pyx":79 * * @property * def dict(self): # <<<<<<<<<<<<<< * return self.__dict__ * */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_5event_9EventType_5dict(PyObject *__pyx_self, PyObject *__pyx_v_self); /*proto*/ static PyMethodDef __pyx_mdef_11pygame_sdl2_5event_9EventType_5dict = {"dict", (PyCFunction)__pyx_pw_11pygame_sdl2_5event_9EventType_5dict, METH_O, 0}; static PyObject *__pyx_pw_11pygame_sdl2_5event_9EventType_5dict(PyObject *__pyx_self, PyObject *__pyx_v_self) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("dict (wrapper)", 0); __pyx_r = __pyx_pf_11pygame_sdl2_5event_9EventType_4dict(__pyx_self, ((PyObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_5event_9EventType_4dict(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; __Pyx_RefNannySetupContext("dict", 0); /* "pygame_sdl2/event.pyx":80 * @property * def dict(self): * return self.__dict__ # <<<<<<<<<<<<<< * * @property */ __Pyx_XDECREF(__pyx_r); __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_dict_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 80, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "pygame_sdl2/event.pyx":79 * * @property * def dict(self): # <<<<<<<<<<<<<< * return self.__dict__ * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("pygame_sdl2.event.EventType.dict", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/event.pyx":83 * * @property * def type(self): # <<<<<<<<<<<<<< * return self._type * */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_5event_9EventType_7type(PyObject *__pyx_self, PyObject *__pyx_v_self); /*proto*/ static PyMethodDef __pyx_mdef_11pygame_sdl2_5event_9EventType_7type = {"type", (PyCFunction)__pyx_pw_11pygame_sdl2_5event_9EventType_7type, METH_O, 0}; static PyObject *__pyx_pw_11pygame_sdl2_5event_9EventType_7type(PyObject *__pyx_self, PyObject *__pyx_v_self) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("type (wrapper)", 0); __pyx_r = __pyx_pf_11pygame_sdl2_5event_9EventType_6type(__pyx_self, ((PyObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_5event_9EventType_6type(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; __Pyx_RefNannySetupContext("type", 0); /* "pygame_sdl2/event.pyx":84 * @property * def type(self): * return self._type # <<<<<<<<<<<<<< * * def __eq__(self, other): */ __Pyx_XDECREF(__pyx_r); __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_type_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 84, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "pygame_sdl2/event.pyx":83 * * @property * def type(self): # <<<<<<<<<<<<<< * return self._type * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("pygame_sdl2.event.EventType.type", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/event.pyx":86 * return self._type * * def __eq__(self, other): # <<<<<<<<<<<<<< * return self.__dict__ == other.__dict__ * */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_5event_9EventType_9__eq__(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static PyMethodDef __pyx_mdef_11pygame_sdl2_5event_9EventType_9__eq__ = {"__eq__", (PyCFunction)__pyx_pw_11pygame_sdl2_5event_9EventType_9__eq__, METH_VARARGS|METH_KEYWORDS, 0}; static PyObject *__pyx_pw_11pygame_sdl2_5event_9EventType_9__eq__(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_self = 0; PyObject *__pyx_v_other = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__eq__ (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_other,0}; PyObject* values[2] = {0,0}; if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_self)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; case 1: if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_other)) != 0)) kw_args--; else { __Pyx_RaiseArgtupleInvalid("__eq__", 1, 2, 2, 1); __PYX_ERR(0, 86, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__eq__") < 0)) __PYX_ERR(0, 86, __pyx_L3_error) } } else if (PyTuple_GET_SIZE(__pyx_args) != 2) { goto __pyx_L5_argtuple_error; } else { values[0] = PyTuple_GET_ITEM(__pyx_args, 0); values[1] = PyTuple_GET_ITEM(__pyx_args, 1); } __pyx_v_self = values[0]; __pyx_v_other = values[1]; } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("__eq__", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 86, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("pygame_sdl2.event.EventType.__eq__", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_11pygame_sdl2_5event_9EventType_8__eq__(__pyx_self, __pyx_v_self, __pyx_v_other); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_5event_9EventType_8__eq__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_other) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; __Pyx_RefNannySetupContext("__eq__", 0); /* "pygame_sdl2/event.pyx":87 * * def __eq__(self, other): * return self.__dict__ == other.__dict__ # <<<<<<<<<<<<<< * * def __ne__(self, other): */ __Pyx_XDECREF(__pyx_r); __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_dict_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 87, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_other, __pyx_n_s_dict_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 87, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = PyObject_RichCompare(__pyx_t_1, __pyx_t_2, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 87, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_r = __pyx_t_3; __pyx_t_3 = 0; goto __pyx_L0; /* "pygame_sdl2/event.pyx":86 * return self._type * * def __eq__(self, other): # <<<<<<<<<<<<<< * return self.__dict__ == other.__dict__ * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("pygame_sdl2.event.EventType.__eq__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/event.pyx":89 * return self.__dict__ == other.__dict__ * * def __ne__(self, other): # <<<<<<<<<<<<<< * return not (self == other) * */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_5event_9EventType_11__ne__(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static PyMethodDef __pyx_mdef_11pygame_sdl2_5event_9EventType_11__ne__ = {"__ne__", (PyCFunction)__pyx_pw_11pygame_sdl2_5event_9EventType_11__ne__, METH_VARARGS|METH_KEYWORDS, 0}; static PyObject *__pyx_pw_11pygame_sdl2_5event_9EventType_11__ne__(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_self = 0; PyObject *__pyx_v_other = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__ne__ (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_other,0}; PyObject* values[2] = {0,0}; if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_self)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; case 1: if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_other)) != 0)) kw_args--; else { __Pyx_RaiseArgtupleInvalid("__ne__", 1, 2, 2, 1); __PYX_ERR(0, 89, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__ne__") < 0)) __PYX_ERR(0, 89, __pyx_L3_error) } } else if (PyTuple_GET_SIZE(__pyx_args) != 2) { goto __pyx_L5_argtuple_error; } else { values[0] = PyTuple_GET_ITEM(__pyx_args, 0); values[1] = PyTuple_GET_ITEM(__pyx_args, 1); } __pyx_v_self = values[0]; __pyx_v_other = values[1]; } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("__ne__", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 89, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("pygame_sdl2.event.EventType.__ne__", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_11pygame_sdl2_5event_9EventType_10__ne__(__pyx_self, __pyx_v_self, __pyx_v_other); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_5event_9EventType_10__ne__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_other) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_t_2; __Pyx_RefNannySetupContext("__ne__", 0); /* "pygame_sdl2/event.pyx":90 * * def __ne__(self, other): * return not (self == other) # <<<<<<<<<<<<<< * * def __nonzero__(self): */ __Pyx_XDECREF(__pyx_r); __pyx_t_1 = PyObject_RichCompare(__pyx_v_self, __pyx_v_other, Py_EQ); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 90, __pyx_L1_error) __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 90, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_1 = __Pyx_PyBool_FromLong((!__pyx_t_2)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 90, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "pygame_sdl2/event.pyx":89 * return self.__dict__ == other.__dict__ * * def __ne__(self, other): # <<<<<<<<<<<<<< * return not (self == other) * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("pygame_sdl2.event.EventType.__ne__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/event.pyx":92 * return not (self == other) * * def __nonzero__(self): # <<<<<<<<<<<<<< * return self.type != 0 * */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_5event_9EventType_13__nonzero__(PyObject *__pyx_self, PyObject *__pyx_v_self); /*proto*/ static PyMethodDef __pyx_mdef_11pygame_sdl2_5event_9EventType_13__nonzero__ = {"__nonzero__", (PyCFunction)__pyx_pw_11pygame_sdl2_5event_9EventType_13__nonzero__, METH_O, 0}; static PyObject *__pyx_pw_11pygame_sdl2_5event_9EventType_13__nonzero__(PyObject *__pyx_self, PyObject *__pyx_v_self) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__nonzero__ (wrapper)", 0); __pyx_r = __pyx_pf_11pygame_sdl2_5event_9EventType_12__nonzero__(__pyx_self, ((PyObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_5event_9EventType_12__nonzero__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; __Pyx_RefNannySetupContext("__nonzero__", 0); /* "pygame_sdl2/event.pyx":93 * * def __nonzero__(self): * return self.type != 0 # <<<<<<<<<<<<<< * * Event = EventType */ __Pyx_XDECREF(__pyx_r); __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_type); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 93, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = PyObject_RichCompare(__pyx_t_1, __pyx_int_0, Py_NE); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 93, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; /* "pygame_sdl2/event.pyx":92 * return not (self == other) * * def __nonzero__(self): # <<<<<<<<<<<<<< * return self.type != 0 * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_AddTraceback("pygame_sdl2.event.EventType.__nonzero__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/event.pyx":97 * Event = EventType * * cdef get_textinput(): # <<<<<<<<<<<<<< * cdef SDL_Event evt * */ static PyObject *__pyx_f_11pygame_sdl2_5event_get_textinput(void) { SDL_Event __pyx_v_evt; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; char *__pyx_t_2; PyObject *__pyx_t_3 = NULL; __Pyx_RefNannySetupContext("get_textinput", 0); /* "pygame_sdl2/event.pyx":100 * cdef SDL_Event evt * * SDL_PumpEvents() # <<<<<<<<<<<<<< * * if SDL_PeepEvents(&evt, 1, SDL_GETEVENT, SDL_TEXTINPUT, SDL_TEXTINPUT) > 0: */ SDL_PumpEvents(); /* "pygame_sdl2/event.pyx":102 * SDL_PumpEvents() * * if SDL_PeepEvents(&evt, 1, SDL_GETEVENT, SDL_TEXTINPUT, SDL_TEXTINPUT) > 0: # <<<<<<<<<<<<<< * return evt.text.text.decode('utf-8') * return u'' */ __pyx_t_1 = ((SDL_PeepEvents((&__pyx_v_evt), 1, SDL_GETEVENT, SDL_TEXTINPUT, SDL_TEXTINPUT) > 0) != 0); if (__pyx_t_1) { /* "pygame_sdl2/event.pyx":103 * * if SDL_PeepEvents(&evt, 1, SDL_GETEVENT, SDL_TEXTINPUT, SDL_TEXTINPUT) > 0: * return evt.text.text.decode('utf-8') # <<<<<<<<<<<<<< * return u'' * */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __pyx_v_evt.text.text; __pyx_t_3 = __Pyx_decode_c_string(__pyx_t_2, 0, strlen(__pyx_t_2), NULL, NULL, PyUnicode_DecodeUTF8); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 103, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_INCREF(__pyx_t_3); __pyx_r = __pyx_t_3; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; goto __pyx_L0; /* "pygame_sdl2/event.pyx":102 * SDL_PumpEvents() * * if SDL_PeepEvents(&evt, 1, SDL_GETEVENT, SDL_TEXTINPUT, SDL_TEXTINPUT) > 0: # <<<<<<<<<<<<<< * return evt.text.text.decode('utf-8') * return u'' */ } /* "pygame_sdl2/event.pyx":104 * if SDL_PeepEvents(&evt, 1, SDL_GETEVENT, SDL_TEXTINPUT, SDL_TEXTINPUT) > 0: * return evt.text.text.decode('utf-8') * return u'' # <<<<<<<<<<<<<< * * cdef make_keyboard_event(SDL_KeyboardEvent *e): */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(__pyx_kp_u_); __pyx_r = __pyx_kp_u_; goto __pyx_L0; /* "pygame_sdl2/event.pyx":97 * Event = EventType * * cdef get_textinput(): # <<<<<<<<<<<<<< * cdef SDL_Event evt * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("pygame_sdl2.event.get_textinput", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/event.pyx":106 * return u'' * * cdef make_keyboard_event(SDL_KeyboardEvent *e): # <<<<<<<<<<<<<< * dargs = { 'scancode' : e.keysym.scancode, * 'key' : e.keysym.sym, */ static PyObject *__pyx_f_11pygame_sdl2_5event_make_keyboard_event(SDL_KeyboardEvent *__pyx_v_e) { PyObject *__pyx_v_dargs = NULL; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; int __pyx_t_3; int __pyx_t_4; PyObject *__pyx_t_5 = NULL; PyObject *__pyx_t_6 = NULL; PyObject *__pyx_t_7 = NULL; __Pyx_RefNannySetupContext("make_keyboard_event", 0); /* "pygame_sdl2/event.pyx":107 * * cdef make_keyboard_event(SDL_KeyboardEvent *e): * dargs = { 'scancode' : e.keysym.scancode, # <<<<<<<<<<<<<< * 'key' : e.keysym.sym, * 'mod' : e.keysym.mod, */ __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 107, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = __Pyx_PyInt_From_SDL_Scancode(__pyx_v_e->keysym.scancode); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 107, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_t_1, __pyx_n_u_scancode, __pyx_t_2) < 0) __PYX_ERR(0, 107, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "pygame_sdl2/event.pyx":108 * cdef make_keyboard_event(SDL_KeyboardEvent *e): * dargs = { 'scancode' : e.keysym.scancode, * 'key' : e.keysym.sym, # <<<<<<<<<<<<<< * 'mod' : e.keysym.mod, * 'unicode' : '', */ __pyx_t_2 = __Pyx_PyInt_From_int32_t(__pyx_v_e->keysym.sym); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 108, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_t_1, __pyx_n_u_key, __pyx_t_2) < 0) __PYX_ERR(0, 107, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "pygame_sdl2/event.pyx":109 * dargs = { 'scancode' : e.keysym.scancode, * 'key' : e.keysym.sym, * 'mod' : e.keysym.mod, # <<<<<<<<<<<<<< * 'unicode' : '', * 'repeat' : e.repeat, */ __pyx_t_2 = __Pyx_PyInt_From_uint16_t(__pyx_v_e->keysym.mod); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 109, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_t_1, __pyx_n_u_mod, __pyx_t_2) < 0) __PYX_ERR(0, 107, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; if (PyDict_SetItem(__pyx_t_1, __pyx_n_u_unicode, __pyx_kp_u_) < 0) __PYX_ERR(0, 107, __pyx_L1_error) /* "pygame_sdl2/event.pyx":111 * 'mod' : e.keysym.mod, * 'unicode' : '', * 'repeat' : e.repeat, # <<<<<<<<<<<<<< * } * */ __pyx_t_2 = __Pyx_PyInt_From_uint8_t(__pyx_v_e->repeat); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 111, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_t_1, __pyx_n_u_repeat, __pyx_t_2) < 0) __PYX_ERR(0, 107, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_v_dargs = ((PyObject*)__pyx_t_1); __pyx_t_1 = 0; /* "pygame_sdl2/event.pyx":114 * } * * if not pygame_sdl2.key.text_input: # <<<<<<<<<<<<<< * * if e.type == SDL_KEYDOWN: */ __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_pygame_sdl2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 114, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_key); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 114, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_text_input); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 114, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(0, 114, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_4 = ((!__pyx_t_3) != 0); if (__pyx_t_4) { /* "pygame_sdl2/event.pyx":116 * if not pygame_sdl2.key.text_input: * * if e.type == SDL_KEYDOWN: # <<<<<<<<<<<<<< * # Be careful to only check for a TEXTINPUT event when you know that * # there will be one associated with this KEYDOWN event. */ __pyx_t_4 = ((__pyx_v_e->type == SDL_KEYDOWN) != 0); if (__pyx_t_4) { /* "pygame_sdl2/event.pyx":119 * # Be careful to only check for a TEXTINPUT event when you know that * # there will be one associated with this KEYDOWN event. * if e.keysym.sym < 0x20: # <<<<<<<<<<<<<< * dargs['unicode'] = unichr(e.keysym.sym) * elif e.keysym.sym <= 0xFFFF: */ __pyx_t_4 = ((__pyx_v_e->keysym.sym < 0x20) != 0); if (__pyx_t_4) { /* "pygame_sdl2/event.pyx":120 * # there will be one associated with this KEYDOWN event. * if e.keysym.sym < 0x20: * dargs['unicode'] = unichr(e.keysym.sym) # <<<<<<<<<<<<<< * elif e.keysym.sym <= 0xFFFF: * dargs['unicode'] = get_textinput() */ __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_unichr); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 120, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_5 = __Pyx_PyInt_From_int32_t(__pyx_v_e->keysym.sym); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 120, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_6 = NULL; if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_2))) { __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_2); if (likely(__pyx_t_6)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_6); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); } } if (!__pyx_t_6) { __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_5); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 120, __pyx_L1_error) __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_GOTREF(__pyx_t_1); } else { __pyx_t_7 = PyTuple_New(1+1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 120, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_GIVEREF(__pyx_t_6); PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_6); __pyx_t_6 = NULL; __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_7, 0+1, __pyx_t_5); __pyx_t_5 = 0; __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_7, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 120, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; } __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; if (unlikely(PyDict_SetItem(__pyx_v_dargs, __pyx_n_u_unicode, __pyx_t_1) < 0)) __PYX_ERR(0, 120, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "pygame_sdl2/event.pyx":119 * # Be careful to only check for a TEXTINPUT event when you know that * # there will be one associated with this KEYDOWN event. * if e.keysym.sym < 0x20: # <<<<<<<<<<<<<< * dargs['unicode'] = unichr(e.keysym.sym) * elif e.keysym.sym <= 0xFFFF: */ goto __pyx_L5; } /* "pygame_sdl2/event.pyx":121 * if e.keysym.sym < 0x20: * dargs['unicode'] = unichr(e.keysym.sym) * elif e.keysym.sym <= 0xFFFF: # <<<<<<<<<<<<<< * dargs['unicode'] = get_textinput() * */ __pyx_t_4 = ((__pyx_v_e->keysym.sym <= 0xFFFF) != 0); if (__pyx_t_4) { /* "pygame_sdl2/event.pyx":122 * dargs['unicode'] = unichr(e.keysym.sym) * elif e.keysym.sym <= 0xFFFF: * dargs['unicode'] = get_textinput() # <<<<<<<<<<<<<< * * return EventType(e.type, dict=dargs, repeat=e.repeat) */ __pyx_t_1 = __pyx_f_11pygame_sdl2_5event_get_textinput(); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 122, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (unlikely(PyDict_SetItem(__pyx_v_dargs, __pyx_n_u_unicode, __pyx_t_1) < 0)) __PYX_ERR(0, 122, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "pygame_sdl2/event.pyx":121 * if e.keysym.sym < 0x20: * dargs['unicode'] = unichr(e.keysym.sym) * elif e.keysym.sym <= 0xFFFF: # <<<<<<<<<<<<<< * dargs['unicode'] = get_textinput() * */ } __pyx_L5:; /* "pygame_sdl2/event.pyx":116 * if not pygame_sdl2.key.text_input: * * if e.type == SDL_KEYDOWN: # <<<<<<<<<<<<<< * # Be careful to only check for a TEXTINPUT event when you know that * # there will be one associated with this KEYDOWN event. */ } /* "pygame_sdl2/event.pyx":114 * } * * if not pygame_sdl2.key.text_input: # <<<<<<<<<<<<<< * * if e.type == SDL_KEYDOWN: */ } /* "pygame_sdl2/event.pyx":124 * dargs['unicode'] = get_textinput() * * return EventType(e.type, dict=dargs, repeat=e.repeat) # <<<<<<<<<<<<<< * * cdef make_mousemotion_event(SDL_MouseMotionEvent *e): */ __Pyx_XDECREF(__pyx_r); __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_EventType); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 124, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = __Pyx_PyInt_From_uint32_t(__pyx_v_e->type); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 124, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_7 = PyTuple_New(1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 124, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_GIVEREF(__pyx_t_2); PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_2); __pyx_t_2 = 0; __pyx_t_2 = PyDict_New(); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 124, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_dict, __pyx_v_dargs) < 0) __PYX_ERR(0, 124, __pyx_L1_error) __pyx_t_5 = __Pyx_PyInt_From_uint8_t(__pyx_v_e->repeat); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 124, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_repeat, __pyx_t_5) < 0) __PYX_ERR(0, 124, __pyx_L1_error) __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_7, __pyx_t_2); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 124, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_r = __pyx_t_5; __pyx_t_5 = 0; goto __pyx_L0; /* "pygame_sdl2/event.pyx":106 * return u'' * * cdef make_keyboard_event(SDL_KeyboardEvent *e): # <<<<<<<<<<<<<< * dargs = { 'scancode' : e.keysym.scancode, * 'key' : e.keysym.sym, */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_5); __Pyx_XDECREF(__pyx_t_6); __Pyx_XDECREF(__pyx_t_7); __Pyx_AddTraceback("pygame_sdl2.event.make_keyboard_event", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XDECREF(__pyx_v_dargs); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/event.pyx":126 * return EventType(e.type, dict=dargs, repeat=e.repeat) * * cdef make_mousemotion_event(SDL_MouseMotionEvent *e): # <<<<<<<<<<<<<< * buttons = (1 if e.state & SDL_BUTTON_LMASK else 0, * 1 if e.state & SDL_BUTTON_MMASK else 0, */ static PyObject *__pyx_f_11pygame_sdl2_5event_make_mousemotion_event(SDL_MouseMotionEvent *__pyx_v_e) { PyObject *__pyx_v_buttons = NULL; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; PyObject *__pyx_t_5 = NULL; PyObject *__pyx_t_6 = NULL; __Pyx_RefNannySetupContext("make_mousemotion_event", 0); /* "pygame_sdl2/event.pyx":127 * * cdef make_mousemotion_event(SDL_MouseMotionEvent *e): * buttons = (1 if e.state & SDL_BUTTON_LMASK else 0, # <<<<<<<<<<<<<< * 1 if e.state & SDL_BUTTON_MMASK else 0, * 1 if e.state & SDL_BUTTON_RMASK else 0) */ if (((__pyx_v_e->state & SDL_BUTTON_LMASK) != 0)) { __Pyx_INCREF(__pyx_int_1); __pyx_t_1 = __pyx_int_1; } else { __Pyx_INCREF(__pyx_int_0); __pyx_t_1 = __pyx_int_0; } /* "pygame_sdl2/event.pyx":128 * cdef make_mousemotion_event(SDL_MouseMotionEvent *e): * buttons = (1 if e.state & SDL_BUTTON_LMASK else 0, * 1 if e.state & SDL_BUTTON_MMASK else 0, # <<<<<<<<<<<<<< * 1 if e.state & SDL_BUTTON_RMASK else 0) * return EventType(e.type, pos=(e.x, e.y), rel=(e.xrel, e.yrel), which=e.which, buttons=buttons) */ if (((__pyx_v_e->state & SDL_BUTTON_MMASK) != 0)) { __Pyx_INCREF(__pyx_int_1); __pyx_t_2 = __pyx_int_1; } else { __Pyx_INCREF(__pyx_int_0); __pyx_t_2 = __pyx_int_0; } /* "pygame_sdl2/event.pyx":129 * buttons = (1 if e.state & SDL_BUTTON_LMASK else 0, * 1 if e.state & SDL_BUTTON_MMASK else 0, * 1 if e.state & SDL_BUTTON_RMASK else 0) # <<<<<<<<<<<<<< * return EventType(e.type, pos=(e.x, e.y), rel=(e.xrel, e.yrel), which=e.which, buttons=buttons) * */ if (((__pyx_v_e->state & SDL_BUTTON_RMASK) != 0)) { __Pyx_INCREF(__pyx_int_1); __pyx_t_3 = __pyx_int_1; } else { __Pyx_INCREF(__pyx_int_0); __pyx_t_3 = __pyx_int_0; } /* "pygame_sdl2/event.pyx":127 * * cdef make_mousemotion_event(SDL_MouseMotionEvent *e): * buttons = (1 if e.state & SDL_BUTTON_LMASK else 0, # <<<<<<<<<<<<<< * 1 if e.state & SDL_BUTTON_MMASK else 0, * 1 if e.state & SDL_BUTTON_RMASK else 0) */ __pyx_t_4 = PyTuple_New(3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 127, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_GIVEREF(__pyx_t_1); PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_1); __Pyx_GIVEREF(__pyx_t_2); PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_2); __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_4, 2, __pyx_t_3); __pyx_t_1 = 0; __pyx_t_2 = 0; __pyx_t_3 = 0; __pyx_v_buttons = __pyx_t_4; __pyx_t_4 = 0; /* "pygame_sdl2/event.pyx":130 * 1 if e.state & SDL_BUTTON_MMASK else 0, * 1 if e.state & SDL_BUTTON_RMASK else 0) * return EventType(e.type, pos=(e.x, e.y), rel=(e.xrel, e.yrel), which=e.which, buttons=buttons) # <<<<<<<<<<<<<< * * cdef make_mousebtn_event(SDL_MouseButtonEvent *e): */ __Pyx_XDECREF(__pyx_r); __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_EventType); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 130, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_3 = __Pyx_PyInt_From_uint32_t(__pyx_v_e->type); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 130, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 130, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_3); __pyx_t_3 = 0; __pyx_t_3 = PyDict_New(); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 130, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_1 = __Pyx_PyInt_From_int32_t(__pyx_v_e->x); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 130, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_5 = __Pyx_PyInt_From_int32_t(__pyx_v_e->y); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 130, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_6 = PyTuple_New(2); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 130, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_GIVEREF(__pyx_t_1); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_1); __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_6, 1, __pyx_t_5); __pyx_t_1 = 0; __pyx_t_5 = 0; if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_pos, __pyx_t_6) < 0) __PYX_ERR(0, 130, __pyx_L1_error) __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __pyx_t_6 = __Pyx_PyInt_From_int32_t(__pyx_v_e->xrel); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 130, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __pyx_t_5 = __Pyx_PyInt_From_int32_t(__pyx_v_e->yrel); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 130, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 130, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_GIVEREF(__pyx_t_6); PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_6); __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_t_5); __pyx_t_6 = 0; __pyx_t_5 = 0; if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_rel, __pyx_t_1) < 0) __PYX_ERR(0, 130, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_1 = __Pyx_PyInt_From_uint32_t(__pyx_v_e->which); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 130, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_which, __pyx_t_1) < 0) __PYX_ERR(0, 130, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_buttons, __pyx_v_buttons) < 0) __PYX_ERR(0, 130, __pyx_L1_error) __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 130, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "pygame_sdl2/event.pyx":126 * return EventType(e.type, dict=dargs, repeat=e.repeat) * * cdef make_mousemotion_event(SDL_MouseMotionEvent *e): # <<<<<<<<<<<<<< * buttons = (1 if e.state & SDL_BUTTON_LMASK else 0, * 1 if e.state & SDL_BUTTON_MMASK else 0, */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_5); __Pyx_XDECREF(__pyx_t_6); __Pyx_AddTraceback("pygame_sdl2.event.make_mousemotion_event", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XDECREF(__pyx_v_buttons); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/event.pyx":132 * return EventType(e.type, pos=(e.x, e.y), rel=(e.xrel, e.yrel), which=e.which, buttons=buttons) * * cdef make_mousebtn_event(SDL_MouseButtonEvent *e): # <<<<<<<<<<<<<< * btn = e.button * */ static PyObject *__pyx_f_11pygame_sdl2_5event_make_mousebtn_event(SDL_MouseButtonEvent *__pyx_v_e) { PyObject *__pyx_v_btn = NULL; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_t_2; int __pyx_t_3; PyObject *__pyx_t_4 = NULL; PyObject *__pyx_t_5 = NULL; PyObject *__pyx_t_6 = NULL; PyObject *__pyx_t_7 = NULL; PyObject *__pyx_t_8 = NULL; __Pyx_RefNannySetupContext("make_mousebtn_event", 0); /* "pygame_sdl2/event.pyx":133 * * cdef make_mousebtn_event(SDL_MouseButtonEvent *e): * btn = e.button # <<<<<<<<<<<<<< * * # SDL 1.x maps wheel to buttons 4/5 */ __pyx_t_1 = __Pyx_PyInt_From_uint8_t(__pyx_v_e->button); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 133, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_btn = __pyx_t_1; __pyx_t_1 = 0; /* "pygame_sdl2/event.pyx":136 * * # SDL 1.x maps wheel to buttons 4/5 * if mousewheel_buttons and btn >= 4: # <<<<<<<<<<<<<< * btn += 2 * */ __pyx_t_3 = (__pyx_v_11pygame_sdl2_5event_mousewheel_buttons != 0); if (__pyx_t_3) { } else { __pyx_t_2 = __pyx_t_3; goto __pyx_L4_bool_binop_done; } __pyx_t_1 = PyObject_RichCompare(__pyx_v_btn, __pyx_int_4, Py_GE); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 136, __pyx_L1_error) __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(0, 136, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_2 = __pyx_t_3; __pyx_L4_bool_binop_done:; if (__pyx_t_2) { /* "pygame_sdl2/event.pyx":137 * # SDL 1.x maps wheel to buttons 4/5 * if mousewheel_buttons and btn >= 4: * btn += 2 # <<<<<<<<<<<<<< * * return EventType(e.type, button=btn, pos=(e.x, e.y), which=e.which) */ __pyx_t_1 = __Pyx_PyInt_AddObjC(__pyx_v_btn, __pyx_int_2, 2, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 137, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF_SET(__pyx_v_btn, __pyx_t_1); __pyx_t_1 = 0; /* "pygame_sdl2/event.pyx":136 * * # SDL 1.x maps wheel to buttons 4/5 * if mousewheel_buttons and btn >= 4: # <<<<<<<<<<<<<< * btn += 2 * */ } /* "pygame_sdl2/event.pyx":139 * btn += 2 * * return EventType(e.type, button=btn, pos=(e.x, e.y), which=e.which) # <<<<<<<<<<<<<< * * cdef make_mousewheel_event(SDL_MouseWheelEvent *e): */ __Pyx_XDECREF(__pyx_r); __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_EventType); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 139, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_4 = __Pyx_PyInt_From_uint32_t(__pyx_v_e->type); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 139, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 139, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_4); __pyx_t_4 = 0; __pyx_t_4 = PyDict_New(); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 139, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_button, __pyx_v_btn) < 0) __PYX_ERR(0, 139, __pyx_L1_error) __pyx_t_6 = __Pyx_PyInt_From_int32_t(__pyx_v_e->x); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 139, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __pyx_t_7 = __Pyx_PyInt_From_int32_t(__pyx_v_e->y); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 139, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __pyx_t_8 = PyTuple_New(2); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 139, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __Pyx_GIVEREF(__pyx_t_6); PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_6); __Pyx_GIVEREF(__pyx_t_7); PyTuple_SET_ITEM(__pyx_t_8, 1, __pyx_t_7); __pyx_t_6 = 0; __pyx_t_7 = 0; if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_pos, __pyx_t_8) < 0) __PYX_ERR(0, 139, __pyx_L1_error) __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; __pyx_t_8 = __Pyx_PyInt_From_uint32_t(__pyx_v_e->which); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 139, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_which, __pyx_t_8) < 0) __PYX_ERR(0, 139, __pyx_L1_error) __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; __pyx_t_8 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_5, __pyx_t_4); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 139, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_r = __pyx_t_8; __pyx_t_8 = 0; goto __pyx_L0; /* "pygame_sdl2/event.pyx":132 * return EventType(e.type, pos=(e.x, e.y), rel=(e.xrel, e.yrel), which=e.which, buttons=buttons) * * cdef make_mousebtn_event(SDL_MouseButtonEvent *e): # <<<<<<<<<<<<<< * btn = e.button * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_5); __Pyx_XDECREF(__pyx_t_6); __Pyx_XDECREF(__pyx_t_7); __Pyx_XDECREF(__pyx_t_8); __Pyx_AddTraceback("pygame_sdl2.event.make_mousebtn_event", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XDECREF(__pyx_v_btn); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/event.pyx":141 * return EventType(e.type, button=btn, pos=(e.x, e.y), which=e.which) * * cdef make_mousewheel_event(SDL_MouseWheelEvent *e): # <<<<<<<<<<<<<< * * cdef int x, y */ static PyObject *__pyx_f_11pygame_sdl2_5event_make_mousewheel_event(SDL_MouseWheelEvent *__pyx_v_e) { int __pyx_v_x; int __pyx_v_y; long __pyx_v_btn; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; PyObject *__pyx_t_5 = NULL; Sint32 __pyx_t_6; PyObject *__pyx_t_7 = NULL; PyObject *__pyx_t_8 = NULL; PyObject *__pyx_t_9 = NULL; PyObject *__pyx_t_10 = NULL; Py_ssize_t __pyx_t_11; __Pyx_RefNannySetupContext("make_mousewheel_event", 0); /* "pygame_sdl2/event.pyx":146 * * # SDL2-style, if the user has opted-in. * if not mousewheel_buttons: # <<<<<<<<<<<<<< * return EventType(e.type, which=e.which, x=e.x, y=e.y) * */ __pyx_t_1 = ((!(__pyx_v_11pygame_sdl2_5event_mousewheel_buttons != 0)) != 0); if (__pyx_t_1) { /* "pygame_sdl2/event.pyx":147 * # SDL2-style, if the user has opted-in. * if not mousewheel_buttons: * return EventType(e.type, which=e.which, x=e.x, y=e.y) # <<<<<<<<<<<<<< * * # Otherwise, follow the SDL1 approach. */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_EventType); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 147, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = __Pyx_PyInt_From_uint32_t(__pyx_v_e->type); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 147, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 147, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_3); __pyx_t_3 = 0; __pyx_t_3 = PyDict_New(); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 147, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_5 = __Pyx_PyInt_From_uint32_t(__pyx_v_e->which); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 147, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_which, __pyx_t_5) < 0) __PYX_ERR(0, 147, __pyx_L1_error) __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __pyx_t_5 = __Pyx_PyInt_From_int32_t(__pyx_v_e->x); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 147, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_x, __pyx_t_5) < 0) __PYX_ERR(0, 147, __pyx_L1_error) __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __pyx_t_5 = __Pyx_PyInt_From_int32_t(__pyx_v_e->y); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 147, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_y, __pyx_t_5) < 0) __PYX_ERR(0, 147, __pyx_L1_error) __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_4, __pyx_t_3); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 147, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_r = __pyx_t_5; __pyx_t_5 = 0; goto __pyx_L0; /* "pygame_sdl2/event.pyx":146 * * # SDL2-style, if the user has opted-in. * if not mousewheel_buttons: # <<<<<<<<<<<<<< * return EventType(e.type, which=e.which, x=e.x, y=e.y) * */ } /* "pygame_sdl2/event.pyx":151 * # Otherwise, follow the SDL1 approach. * * y = e.y # <<<<<<<<<<<<<< * * # TODO: Implement when 2.0.4 becomes widespread. */ __pyx_t_6 = __pyx_v_e->y; __pyx_v_y = __pyx_t_6; /* "pygame_sdl2/event.pyx":157 * # y = -y * * if y > 0: # <<<<<<<<<<<<<< * btn = 4 * elif y < 0: */ __pyx_t_1 = ((__pyx_v_y > 0) != 0); if (__pyx_t_1) { /* "pygame_sdl2/event.pyx":158 * * if y > 0: * btn = 4 # <<<<<<<<<<<<<< * elif y < 0: * btn = 5 */ __pyx_v_btn = 4; /* "pygame_sdl2/event.pyx":157 * # y = -y * * if y > 0: # <<<<<<<<<<<<<< * btn = 4 * elif y < 0: */ goto __pyx_L4; } /* "pygame_sdl2/event.pyx":159 * if y > 0: * btn = 4 * elif y < 0: # <<<<<<<<<<<<<< * btn = 5 * else: */ __pyx_t_1 = ((__pyx_v_y < 0) != 0); if (__pyx_t_1) { /* "pygame_sdl2/event.pyx":160 * btn = 4 * elif y < 0: * btn = 5 # <<<<<<<<<<<<<< * else: * return EventType(0) # x axis scrolling produces no event in pygame */ __pyx_v_btn = 5; /* "pygame_sdl2/event.pyx":159 * if y > 0: * btn = 4 * elif y < 0: # <<<<<<<<<<<<<< * btn = 5 * else: */ goto __pyx_L4; } /* "pygame_sdl2/event.pyx":162 * btn = 5 * else: * return EventType(0) # x axis scrolling produces no event in pygame # <<<<<<<<<<<<<< * * # This is not the mouse position at the time of the event */ /*else*/ { __Pyx_XDECREF(__pyx_r); __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_EventType); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 162, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_tuple__2, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 162, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __pyx_r = __pyx_t_3; __pyx_t_3 = 0; goto __pyx_L0; } __pyx_L4:; /* "pygame_sdl2/event.pyx":165 * * # This is not the mouse position at the time of the event * SDL_GetMouseState(&x, &y) # <<<<<<<<<<<<<< * * # MOUSEBUTTONUP event should follow immediately after */ SDL_GetMouseState((&__pyx_v_x), (&__pyx_v_y)); /* "pygame_sdl2/event.pyx":168 * * # MOUSEBUTTONUP event should follow immediately after * event_queue.insert(0, EventType(SDL_MOUSEBUTTONUP, button=btn, pos=(x,y))) # <<<<<<<<<<<<<< * return EventType(SDL_MOUSEBUTTONDOWN, button=btn, pos=(x,y)) * */ __pyx_t_5 = __Pyx_PyObject_GetAttrStr(event_queue, __pyx_n_s_insert); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 168, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_EventType); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 168, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_2 = __Pyx_PyInt_From_SDL_EventType(SDL_MOUSEBUTTONUP); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 168, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_7 = PyTuple_New(1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 168, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_GIVEREF(__pyx_t_2); PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_2); __pyx_t_2 = 0; __pyx_t_2 = PyDict_New(); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 168, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_8 = __Pyx_PyInt_From_long(__pyx_v_btn); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 168, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_button, __pyx_t_8) < 0) __PYX_ERR(0, 168, __pyx_L1_error) __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; __pyx_t_8 = __Pyx_PyInt_From_int(__pyx_v_x); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 168, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __pyx_t_9 = __Pyx_PyInt_From_int(__pyx_v_y); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 168, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); __pyx_t_10 = PyTuple_New(2); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 168, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_10); __Pyx_GIVEREF(__pyx_t_8); PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_t_8); __Pyx_GIVEREF(__pyx_t_9); PyTuple_SET_ITEM(__pyx_t_10, 1, __pyx_t_9); __pyx_t_8 = 0; __pyx_t_9 = 0; if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_pos, __pyx_t_10) < 0) __PYX_ERR(0, 168, __pyx_L1_error) __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; __pyx_t_10 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_7, __pyx_t_2); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 168, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_10); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_2 = NULL; __pyx_t_11 = 0; if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_5))) { __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_5); if (likely(__pyx_t_2)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5); __Pyx_INCREF(__pyx_t_2); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_5, function); __pyx_t_11 = 1; } } __pyx_t_7 = PyTuple_New(2+__pyx_t_11); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 168, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); if (__pyx_t_2) { __Pyx_GIVEREF(__pyx_t_2); PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_2); __pyx_t_2 = NULL; } __Pyx_INCREF(__pyx_int_0); __Pyx_GIVEREF(__pyx_int_0); PyTuple_SET_ITEM(__pyx_t_7, 0+__pyx_t_11, __pyx_int_0); __Pyx_GIVEREF(__pyx_t_10); PyTuple_SET_ITEM(__pyx_t_7, 1+__pyx_t_11, __pyx_t_10); __pyx_t_10 = 0; __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_7, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 168, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "pygame_sdl2/event.pyx":169 * # MOUSEBUTTONUP event should follow immediately after * event_queue.insert(0, EventType(SDL_MOUSEBUTTONUP, button=btn, pos=(x,y))) * return EventType(SDL_MOUSEBUTTONDOWN, button=btn, pos=(x,y)) # <<<<<<<<<<<<<< * * cdef make_mousewheel_event_sdl2(SDL_MouseWheelEvent *e): */ __Pyx_XDECREF(__pyx_r); __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_EventType); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 169, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_5 = __Pyx_PyInt_From_SDL_EventType(SDL_MOUSEBUTTONDOWN); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 169, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_7 = PyTuple_New(1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 169, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_5); __pyx_t_5 = 0; __pyx_t_5 = PyDict_New(); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 169, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_10 = __Pyx_PyInt_From_long(__pyx_v_btn); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 169, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_10); if (PyDict_SetItem(__pyx_t_5, __pyx_n_s_button, __pyx_t_10) < 0) __PYX_ERR(0, 169, __pyx_L1_error) __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; __pyx_t_10 = __Pyx_PyInt_From_int(__pyx_v_x); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 169, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_10); __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_v_y); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 169, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 169, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_GIVEREF(__pyx_t_10); PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_10); __Pyx_GIVEREF(__pyx_t_2); PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_2); __pyx_t_10 = 0; __pyx_t_2 = 0; if (PyDict_SetItem(__pyx_t_5, __pyx_n_s_pos, __pyx_t_4) < 0) __PYX_ERR(0, 169, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_7, __pyx_t_5); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 169, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __pyx_r = __pyx_t_4; __pyx_t_4 = 0; goto __pyx_L0; /* "pygame_sdl2/event.pyx":141 * return EventType(e.type, button=btn, pos=(e.x, e.y), which=e.which) * * cdef make_mousewheel_event(SDL_MouseWheelEvent *e): # <<<<<<<<<<<<<< * * cdef int x, y */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_5); __Pyx_XDECREF(__pyx_t_7); __Pyx_XDECREF(__pyx_t_8); __Pyx_XDECREF(__pyx_t_9); __Pyx_XDECREF(__pyx_t_10); __Pyx_AddTraceback("pygame_sdl2.event.make_mousewheel_event", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/event.pyx":171 * return EventType(SDL_MOUSEBUTTONDOWN, button=btn, pos=(x,y)) * * cdef make_mousewheel_event_sdl2(SDL_MouseWheelEvent *e): # <<<<<<<<<<<<<< * return EventType(e.type, x=e.x, y=e.y) * */ static PyObject *__pyx_f_11pygame_sdl2_5event_make_mousewheel_event_sdl2(SDL_MouseWheelEvent *__pyx_v_e) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; __Pyx_RefNannySetupContext("make_mousewheel_event_sdl2", 0); /* "pygame_sdl2/event.pyx":172 * * cdef make_mousewheel_event_sdl2(SDL_MouseWheelEvent *e): * return EventType(e.type, x=e.x, y=e.y) # <<<<<<<<<<<<<< * * cdef make_joyaxis_event(SDL_JoyAxisEvent *e): */ __Pyx_XDECREF(__pyx_r); __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_EventType); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 172, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = __Pyx_PyInt_From_uint32_t(__pyx_v_e->type); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 172, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 172, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_GIVEREF(__pyx_t_2); PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_2); __pyx_t_2 = 0; __pyx_t_2 = PyDict_New(); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 172, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_4 = __Pyx_PyInt_From_int32_t(__pyx_v_e->x); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 172, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_x, __pyx_t_4) < 0) __PYX_ERR(0, 172, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_t_4 = __Pyx_PyInt_From_int32_t(__pyx_v_e->y); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 172, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_y, __pyx_t_4) < 0) __PYX_ERR(0, 172, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_3, __pyx_t_2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 172, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_r = __pyx_t_4; __pyx_t_4 = 0; goto __pyx_L0; /* "pygame_sdl2/event.pyx":171 * return EventType(SDL_MOUSEBUTTONDOWN, button=btn, pos=(x,y)) * * cdef make_mousewheel_event_sdl2(SDL_MouseWheelEvent *e): # <<<<<<<<<<<<<< * return EventType(e.type, x=e.x, y=e.y) * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_AddTraceback("pygame_sdl2.event.make_mousewheel_event_sdl2", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/event.pyx":174 * return EventType(e.type, x=e.x, y=e.y) * * cdef make_joyaxis_event(SDL_JoyAxisEvent *e): # <<<<<<<<<<<<<< * return EventType(e.type, joy=e.which, axis=e.axis, value=e.value/32768.0) * */ static PyObject *__pyx_f_11pygame_sdl2_5event_make_joyaxis_event(SDL_JoyAxisEvent *__pyx_v_e) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; __Pyx_RefNannySetupContext("make_joyaxis_event", 0); /* "pygame_sdl2/event.pyx":175 * * cdef make_joyaxis_event(SDL_JoyAxisEvent *e): * return EventType(e.type, joy=e.which, axis=e.axis, value=e.value/32768.0) # <<<<<<<<<<<<<< * * cdef make_joyball_event(SDL_JoyBallEvent *e): */ __Pyx_XDECREF(__pyx_r); __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_EventType); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 175, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = __Pyx_PyInt_From_uint32_t(__pyx_v_e->type); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 175, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 175, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_GIVEREF(__pyx_t_2); PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_2); __pyx_t_2 = 0; __pyx_t_2 = PyDict_New(); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 175, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_4 = __Pyx_PyInt_From_int32_t(__pyx_v_e->which); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 175, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_joy, __pyx_t_4) < 0) __PYX_ERR(0, 175, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_t_4 = __Pyx_PyInt_From_uint8_t(__pyx_v_e->axis); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 175, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_axis, __pyx_t_4) < 0) __PYX_ERR(0, 175, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_t_4 = PyFloat_FromDouble((((double)__pyx_v_e->value) / 32768.0)); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 175, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_value, __pyx_t_4) < 0) __PYX_ERR(0, 175, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_3, __pyx_t_2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 175, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_r = __pyx_t_4; __pyx_t_4 = 0; goto __pyx_L0; /* "pygame_sdl2/event.pyx":174 * return EventType(e.type, x=e.x, y=e.y) * * cdef make_joyaxis_event(SDL_JoyAxisEvent *e): # <<<<<<<<<<<<<< * return EventType(e.type, joy=e.which, axis=e.axis, value=e.value/32768.0) * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_AddTraceback("pygame_sdl2.event.make_joyaxis_event", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/event.pyx":177 * return EventType(e.type, joy=e.which, axis=e.axis, value=e.value/32768.0) * * cdef make_joyball_event(SDL_JoyBallEvent *e): # <<<<<<<<<<<<<< * return EventType(e.type, joy=e.which, ball=e.ball, rel=(e.xrel, e.yrel)) * */ static PyObject *__pyx_f_11pygame_sdl2_5event_make_joyball_event(SDL_JoyBallEvent *__pyx_v_e) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; PyObject *__pyx_t_5 = NULL; PyObject *__pyx_t_6 = NULL; __Pyx_RefNannySetupContext("make_joyball_event", 0); /* "pygame_sdl2/event.pyx":178 * * cdef make_joyball_event(SDL_JoyBallEvent *e): * return EventType(e.type, joy=e.which, ball=e.ball, rel=(e.xrel, e.yrel)) # <<<<<<<<<<<<<< * * cdef make_joyhat_event(SDL_JoyHatEvent *e): */ __Pyx_XDECREF(__pyx_r); __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_EventType); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 178, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = __Pyx_PyInt_From_uint32_t(__pyx_v_e->type); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 178, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 178, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_GIVEREF(__pyx_t_2); PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_2); __pyx_t_2 = 0; __pyx_t_2 = PyDict_New(); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 178, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_4 = __Pyx_PyInt_From_int32_t(__pyx_v_e->which); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 178, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_joy, __pyx_t_4) < 0) __PYX_ERR(0, 178, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_t_4 = __Pyx_PyInt_From_uint8_t(__pyx_v_e->ball); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 178, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_ball, __pyx_t_4) < 0) __PYX_ERR(0, 178, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_t_4 = __Pyx_PyInt_From_int16_t(__pyx_v_e->xrel); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 178, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_5 = __Pyx_PyInt_From_int16_t(__pyx_v_e->yrel); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 178, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_6 = PyTuple_New(2); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 178, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_4); __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_6, 1, __pyx_t_5); __pyx_t_4 = 0; __pyx_t_5 = 0; if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_rel, __pyx_t_6) < 0) __PYX_ERR(0, 178, __pyx_L1_error) __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_3, __pyx_t_2); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 178, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_r = __pyx_t_6; __pyx_t_6 = 0; goto __pyx_L0; /* "pygame_sdl2/event.pyx":177 * return EventType(e.type, joy=e.which, axis=e.axis, value=e.value/32768.0) * * cdef make_joyball_event(SDL_JoyBallEvent *e): # <<<<<<<<<<<<<< * return EventType(e.type, joy=e.which, ball=e.ball, rel=(e.xrel, e.yrel)) * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_5); __Pyx_XDECREF(__pyx_t_6); __Pyx_AddTraceback("pygame_sdl2.event.make_joyball_event", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/event.pyx":180 * return EventType(e.type, joy=e.which, ball=e.ball, rel=(e.xrel, e.yrel)) * * cdef make_joyhat_event(SDL_JoyHatEvent *e): # <<<<<<<<<<<<<< * return EventType(e.type, joy=e.which, hat=e.hat, value=e.value) * */ static PyObject *__pyx_f_11pygame_sdl2_5event_make_joyhat_event(SDL_JoyHatEvent *__pyx_v_e) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; __Pyx_RefNannySetupContext("make_joyhat_event", 0); /* "pygame_sdl2/event.pyx":181 * * cdef make_joyhat_event(SDL_JoyHatEvent *e): * return EventType(e.type, joy=e.which, hat=e.hat, value=e.value) # <<<<<<<<<<<<<< * * cdef make_joybtn_event(SDL_JoyButtonEvent *e): */ __Pyx_XDECREF(__pyx_r); __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_EventType); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 181, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = __Pyx_PyInt_From_uint32_t(__pyx_v_e->type); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 181, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 181, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_GIVEREF(__pyx_t_2); PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_2); __pyx_t_2 = 0; __pyx_t_2 = PyDict_New(); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 181, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_4 = __Pyx_PyInt_From_int32_t(__pyx_v_e->which); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 181, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_joy, __pyx_t_4) < 0) __PYX_ERR(0, 181, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_t_4 = __Pyx_PyInt_From_uint8_t(__pyx_v_e->hat); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 181, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_hat, __pyx_t_4) < 0) __PYX_ERR(0, 181, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_t_4 = __Pyx_PyInt_From_uint8_t(__pyx_v_e->value); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 181, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_value, __pyx_t_4) < 0) __PYX_ERR(0, 181, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_3, __pyx_t_2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 181, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_r = __pyx_t_4; __pyx_t_4 = 0; goto __pyx_L0; /* "pygame_sdl2/event.pyx":180 * return EventType(e.type, joy=e.which, ball=e.ball, rel=(e.xrel, e.yrel)) * * cdef make_joyhat_event(SDL_JoyHatEvent *e): # <<<<<<<<<<<<<< * return EventType(e.type, joy=e.which, hat=e.hat, value=e.value) * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_AddTraceback("pygame_sdl2.event.make_joyhat_event", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/event.pyx":183 * return EventType(e.type, joy=e.which, hat=e.hat, value=e.value) * * cdef make_joybtn_event(SDL_JoyButtonEvent *e): # <<<<<<<<<<<<<< * return EventType(e.type, joy=e.which, button=e.button) * */ static PyObject *__pyx_f_11pygame_sdl2_5event_make_joybtn_event(SDL_JoyButtonEvent *__pyx_v_e) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; __Pyx_RefNannySetupContext("make_joybtn_event", 0); /* "pygame_sdl2/event.pyx":184 * * cdef make_joybtn_event(SDL_JoyButtonEvent *e): * return EventType(e.type, joy=e.which, button=e.button) # <<<<<<<<<<<<<< * * cdef make_textinput_event(SDL_TextInputEvent *e): */ __Pyx_XDECREF(__pyx_r); __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_EventType); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 184, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = __Pyx_PyInt_From_uint32_t(__pyx_v_e->type); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 184, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 184, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_GIVEREF(__pyx_t_2); PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_2); __pyx_t_2 = 0; __pyx_t_2 = PyDict_New(); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 184, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_4 = __Pyx_PyInt_From_int32_t(__pyx_v_e->which); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 184, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_joy, __pyx_t_4) < 0) __PYX_ERR(0, 184, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_t_4 = __Pyx_PyInt_From_uint8_t(__pyx_v_e->button); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 184, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_button, __pyx_t_4) < 0) __PYX_ERR(0, 184, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_3, __pyx_t_2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 184, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_r = __pyx_t_4; __pyx_t_4 = 0; goto __pyx_L0; /* "pygame_sdl2/event.pyx":183 * return EventType(e.type, joy=e.which, hat=e.hat, value=e.value) * * cdef make_joybtn_event(SDL_JoyButtonEvent *e): # <<<<<<<<<<<<<< * return EventType(e.type, joy=e.which, button=e.button) * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_AddTraceback("pygame_sdl2.event.make_joybtn_event", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/event.pyx":186 * return EventType(e.type, joy=e.which, button=e.button) * * cdef make_textinput_event(SDL_TextInputEvent *e): # <<<<<<<<<<<<<< * return EventType(e.type, text=e.text.decode("utf-8")) * */ static PyObject *__pyx_f_11pygame_sdl2_5event_make_textinput_event(SDL_TextInputEvent *__pyx_v_e) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; char *__pyx_t_4; PyObject *__pyx_t_5 = NULL; __Pyx_RefNannySetupContext("make_textinput_event", 0); /* "pygame_sdl2/event.pyx":187 * * cdef make_textinput_event(SDL_TextInputEvent *e): * return EventType(e.type, text=e.text.decode("utf-8")) # <<<<<<<<<<<<<< * * cdef make_textediting_event(SDL_TextEditingEvent *e): */ __Pyx_XDECREF(__pyx_r); __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_EventType); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 187, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = __Pyx_PyInt_From_uint32_t(__pyx_v_e->type); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 187, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 187, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_GIVEREF(__pyx_t_2); PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_2); __pyx_t_2 = 0; __pyx_t_2 = PyDict_New(); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 187, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_4 = __pyx_v_e->text; __pyx_t_5 = __Pyx_decode_c_string(__pyx_t_4, 0, strlen(__pyx_t_4), NULL, NULL, PyUnicode_DecodeUTF8); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 187, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_text, __pyx_t_5) < 0) __PYX_ERR(0, 187, __pyx_L1_error) __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_3, __pyx_t_2); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 187, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_r = __pyx_t_5; __pyx_t_5 = 0; goto __pyx_L0; /* "pygame_sdl2/event.pyx":186 * return EventType(e.type, joy=e.which, button=e.button) * * cdef make_textinput_event(SDL_TextInputEvent *e): # <<<<<<<<<<<<<< * return EventType(e.type, text=e.text.decode("utf-8")) * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_5); __Pyx_AddTraceback("pygame_sdl2.event.make_textinput_event", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/event.pyx":189 * return EventType(e.type, text=e.text.decode("utf-8")) * * cdef make_textediting_event(SDL_TextEditingEvent *e): # <<<<<<<<<<<<<< * return EventType(e.type, text=e.text.decode("utf-8"), start=e.start, length=e.length) * */ static PyObject *__pyx_f_11pygame_sdl2_5event_make_textediting_event(SDL_TextEditingEvent *__pyx_v_e) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; char *__pyx_t_4; PyObject *__pyx_t_5 = NULL; __Pyx_RefNannySetupContext("make_textediting_event", 0); /* "pygame_sdl2/event.pyx":190 * * cdef make_textediting_event(SDL_TextEditingEvent *e): * return EventType(e.type, text=e.text.decode("utf-8"), start=e.start, length=e.length) # <<<<<<<<<<<<<< * * cdef make_window_event(SDL_WindowEvent *e): */ __Pyx_XDECREF(__pyx_r); __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_EventType); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 190, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = __Pyx_PyInt_From_uint32_t(__pyx_v_e->type); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 190, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 190, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_GIVEREF(__pyx_t_2); PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_2); __pyx_t_2 = 0; __pyx_t_2 = PyDict_New(); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 190, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_4 = __pyx_v_e->text; __pyx_t_5 = __Pyx_decode_c_string(__pyx_t_4, 0, strlen(__pyx_t_4), NULL, NULL, PyUnicode_DecodeUTF8); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 190, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_text, __pyx_t_5) < 0) __PYX_ERR(0, 190, __pyx_L1_error) __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __pyx_t_5 = __Pyx_PyInt_From_int32_t(__pyx_v_e->start); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 190, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_start, __pyx_t_5) < 0) __PYX_ERR(0, 190, __pyx_L1_error) __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __pyx_t_5 = __Pyx_PyInt_From_int32_t(__pyx_v_e->length); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 190, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_length, __pyx_t_5) < 0) __PYX_ERR(0, 190, __pyx_L1_error) __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_3, __pyx_t_2); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 190, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_r = __pyx_t_5; __pyx_t_5 = 0; goto __pyx_L0; /* "pygame_sdl2/event.pyx":189 * return EventType(e.type, text=e.text.decode("utf-8")) * * cdef make_textediting_event(SDL_TextEditingEvent *e): # <<<<<<<<<<<<<< * return EventType(e.type, text=e.text.decode("utf-8"), start=e.start, length=e.length) * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_5); __Pyx_AddTraceback("pygame_sdl2.event.make_textediting_event", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/event.pyx":192 * return EventType(e.type, text=e.text.decode("utf-8"), start=e.start, length=e.length) * * cdef make_window_event(SDL_WindowEvent *e): # <<<<<<<<<<<<<< * # SDL_APPMOUSEFOCUS * if e.event == SDL_WINDOWEVENT_ENTER: */ static PyObject *__pyx_f_11pygame_sdl2_5event_make_window_event(SDL_WindowEvent *__pyx_v_e) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; PyObject *__pyx_t_5 = NULL; PyObject *__pyx_t_6 = NULL; __Pyx_RefNannySetupContext("make_window_event", 0); /* "pygame_sdl2/event.pyx":194 * cdef make_window_event(SDL_WindowEvent *e): * # SDL_APPMOUSEFOCUS * if e.event == SDL_WINDOWEVENT_ENTER: # <<<<<<<<<<<<<< * return EventType(ACTIVEEVENT, state=1, gain=1) * elif e.event == SDL_WINDOWEVENT_LEAVE: */ switch (__pyx_v_e->event) { case SDL_WINDOWEVENT_ENTER: /* "pygame_sdl2/event.pyx":195 * # SDL_APPMOUSEFOCUS * if e.event == SDL_WINDOWEVENT_ENTER: * return EventType(ACTIVEEVENT, state=1, gain=1) # <<<<<<<<<<<<<< * elif e.event == SDL_WINDOWEVENT_LEAVE: * return EventType(ACTIVEEVENT, state=1, gain=0) */ __Pyx_XDECREF(__pyx_r); __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_EventType); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 195, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_ACTIVEEVENT); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 195, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 195, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_GIVEREF(__pyx_t_2); PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_2); __pyx_t_2 = 0; __pyx_t_2 = PyDict_New(); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 195, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_state, __pyx_int_1) < 0) __PYX_ERR(0, 195, __pyx_L1_error) if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_gain, __pyx_int_1) < 0) __PYX_ERR(0, 195, __pyx_L1_error) __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_3, __pyx_t_2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 195, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_r = __pyx_t_4; __pyx_t_4 = 0; goto __pyx_L0; /* "pygame_sdl2/event.pyx":194 * cdef make_window_event(SDL_WindowEvent *e): * # SDL_APPMOUSEFOCUS * if e.event == SDL_WINDOWEVENT_ENTER: # <<<<<<<<<<<<<< * return EventType(ACTIVEEVENT, state=1, gain=1) * elif e.event == SDL_WINDOWEVENT_LEAVE: */ break; /* "pygame_sdl2/event.pyx":196 * if e.event == SDL_WINDOWEVENT_ENTER: * return EventType(ACTIVEEVENT, state=1, gain=1) * elif e.event == SDL_WINDOWEVENT_LEAVE: # <<<<<<<<<<<<<< * return EventType(ACTIVEEVENT, state=1, gain=0) * */ case SDL_WINDOWEVENT_LEAVE: /* "pygame_sdl2/event.pyx":197 * return EventType(ACTIVEEVENT, state=1, gain=1) * elif e.event == SDL_WINDOWEVENT_LEAVE: * return EventType(ACTIVEEVENT, state=1, gain=0) # <<<<<<<<<<<<<< * * # SDL_APPINPUTFOCUS */ __Pyx_XDECREF(__pyx_r); __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_EventType); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 197, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_ACTIVEEVENT); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 197, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 197, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_GIVEREF(__pyx_t_2); PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_2); __pyx_t_2 = 0; __pyx_t_2 = PyDict_New(); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 197, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_state, __pyx_int_1) < 0) __PYX_ERR(0, 197, __pyx_L1_error) if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_gain, __pyx_int_0) < 0) __PYX_ERR(0, 197, __pyx_L1_error) __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_3, __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 197, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "pygame_sdl2/event.pyx":196 * if e.event == SDL_WINDOWEVENT_ENTER: * return EventType(ACTIVEEVENT, state=1, gain=1) * elif e.event == SDL_WINDOWEVENT_LEAVE: # <<<<<<<<<<<<<< * return EventType(ACTIVEEVENT, state=1, gain=0) * */ break; /* "pygame_sdl2/event.pyx":200 * * # SDL_APPINPUTFOCUS * elif e.event == SDL_WINDOWEVENT_FOCUS_GAINED: # <<<<<<<<<<<<<< * return EventType(ACTIVEEVENT, state=2, gain=1) * elif e.event == SDL_WINDOWEVENT_FOCUS_LOST: */ case SDL_WINDOWEVENT_FOCUS_GAINED: /* "pygame_sdl2/event.pyx":201 * # SDL_APPINPUTFOCUS * elif e.event == SDL_WINDOWEVENT_FOCUS_GAINED: * return EventType(ACTIVEEVENT, state=2, gain=1) # <<<<<<<<<<<<<< * elif e.event == SDL_WINDOWEVENT_FOCUS_LOST: * return EventType(ACTIVEEVENT, state=2, gain=0) */ __Pyx_XDECREF(__pyx_r); __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_EventType); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 201, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_ACTIVEEVENT); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 201, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 201, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_GIVEREF(__pyx_t_2); PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_2); __pyx_t_2 = 0; __pyx_t_2 = PyDict_New(); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 201, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_state, __pyx_int_2) < 0) __PYX_ERR(0, 201, __pyx_L1_error) if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_gain, __pyx_int_1) < 0) __PYX_ERR(0, 201, __pyx_L1_error) __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_3, __pyx_t_2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 201, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_r = __pyx_t_4; __pyx_t_4 = 0; goto __pyx_L0; /* "pygame_sdl2/event.pyx":200 * * # SDL_APPINPUTFOCUS * elif e.event == SDL_WINDOWEVENT_FOCUS_GAINED: # <<<<<<<<<<<<<< * return EventType(ACTIVEEVENT, state=2, gain=1) * elif e.event == SDL_WINDOWEVENT_FOCUS_LOST: */ break; /* "pygame_sdl2/event.pyx":202 * elif e.event == SDL_WINDOWEVENT_FOCUS_GAINED: * return EventType(ACTIVEEVENT, state=2, gain=1) * elif e.event == SDL_WINDOWEVENT_FOCUS_LOST: # <<<<<<<<<<<<<< * return EventType(ACTIVEEVENT, state=2, gain=0) * */ case SDL_WINDOWEVENT_FOCUS_LOST: /* "pygame_sdl2/event.pyx":203 * return EventType(ACTIVEEVENT, state=2, gain=1) * elif e.event == SDL_WINDOWEVENT_FOCUS_LOST: * return EventType(ACTIVEEVENT, state=2, gain=0) # <<<<<<<<<<<<<< * * # SDL_APPACTIVE */ __Pyx_XDECREF(__pyx_r); __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_EventType); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 203, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_ACTIVEEVENT); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 203, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 203, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_GIVEREF(__pyx_t_2); PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_2); __pyx_t_2 = 0; __pyx_t_2 = PyDict_New(); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 203, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_state, __pyx_int_2) < 0) __PYX_ERR(0, 203, __pyx_L1_error) if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_gain, __pyx_int_0) < 0) __PYX_ERR(0, 203, __pyx_L1_error) __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_3, __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 203, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "pygame_sdl2/event.pyx":202 * elif e.event == SDL_WINDOWEVENT_FOCUS_GAINED: * return EventType(ACTIVEEVENT, state=2, gain=1) * elif e.event == SDL_WINDOWEVENT_FOCUS_LOST: # <<<<<<<<<<<<<< * return EventType(ACTIVEEVENT, state=2, gain=0) * */ break; /* "pygame_sdl2/event.pyx":206 * * # SDL_APPACTIVE * elif e.event == SDL_WINDOWEVENT_RESTORED: # <<<<<<<<<<<<<< * return EventType(ACTIVEEVENT, state=4, gain=1) * elif e.event == SDL_WINDOWEVENT_MINIMIZED: */ case SDL_WINDOWEVENT_RESTORED: /* "pygame_sdl2/event.pyx":207 * # SDL_APPACTIVE * elif e.event == SDL_WINDOWEVENT_RESTORED: * return EventType(ACTIVEEVENT, state=4, gain=1) # <<<<<<<<<<<<<< * elif e.event == SDL_WINDOWEVENT_MINIMIZED: * return EventType(ACTIVEEVENT, state=4, gain=0) */ __Pyx_XDECREF(__pyx_r); __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_EventType); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 207, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_ACTIVEEVENT); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 207, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 207, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_GIVEREF(__pyx_t_2); PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_2); __pyx_t_2 = 0; __pyx_t_2 = PyDict_New(); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 207, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_state, __pyx_int_4) < 0) __PYX_ERR(0, 207, __pyx_L1_error) if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_gain, __pyx_int_1) < 0) __PYX_ERR(0, 207, __pyx_L1_error) __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_3, __pyx_t_2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 207, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_r = __pyx_t_4; __pyx_t_4 = 0; goto __pyx_L0; /* "pygame_sdl2/event.pyx":206 * * # SDL_APPACTIVE * elif e.event == SDL_WINDOWEVENT_RESTORED: # <<<<<<<<<<<<<< * return EventType(ACTIVEEVENT, state=4, gain=1) * elif e.event == SDL_WINDOWEVENT_MINIMIZED: */ break; /* "pygame_sdl2/event.pyx":208 * elif e.event == SDL_WINDOWEVENT_RESTORED: * return EventType(ACTIVEEVENT, state=4, gain=1) * elif e.event == SDL_WINDOWEVENT_MINIMIZED: # <<<<<<<<<<<<<< * return EventType(ACTIVEEVENT, state=4, gain=0) * */ case SDL_WINDOWEVENT_MINIMIZED: /* "pygame_sdl2/event.pyx":209 * return EventType(ACTIVEEVENT, state=4, gain=1) * elif e.event == SDL_WINDOWEVENT_MINIMIZED: * return EventType(ACTIVEEVENT, state=4, gain=0) # <<<<<<<<<<<<<< * * elif e.event == SDL_WINDOWEVENT_RESIZED: */ __Pyx_XDECREF(__pyx_r); __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_EventType); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 209, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_ACTIVEEVENT); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 209, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 209, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_GIVEREF(__pyx_t_2); PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_2); __pyx_t_2 = 0; __pyx_t_2 = PyDict_New(); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 209, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_state, __pyx_int_4) < 0) __PYX_ERR(0, 209, __pyx_L1_error) if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_gain, __pyx_int_0) < 0) __PYX_ERR(0, 209, __pyx_L1_error) __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_3, __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 209, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "pygame_sdl2/event.pyx":208 * elif e.event == SDL_WINDOWEVENT_RESTORED: * return EventType(ACTIVEEVENT, state=4, gain=1) * elif e.event == SDL_WINDOWEVENT_MINIMIZED: # <<<<<<<<<<<<<< * return EventType(ACTIVEEVENT, state=4, gain=0) * */ break; /* "pygame_sdl2/event.pyx":211 * return EventType(ACTIVEEVENT, state=4, gain=0) * * elif e.event == SDL_WINDOWEVENT_RESIZED: # <<<<<<<<<<<<<< * return EventType(VIDEORESIZE, size=(e.data1, e.data2), w=e.data1, h=e.data2) * */ case SDL_WINDOWEVENT_RESIZED: /* "pygame_sdl2/event.pyx":212 * * elif e.event == SDL_WINDOWEVENT_RESIZED: * return EventType(VIDEORESIZE, size=(e.data1, e.data2), w=e.data1, h=e.data2) # <<<<<<<<<<<<<< * * elif e.event == SDL_WINDOWEVENT_EXPOSED: */ __Pyx_XDECREF(__pyx_r); __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_EventType); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 212, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_VIDEORESIZE); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 212, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 212, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_GIVEREF(__pyx_t_2); PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_2); __pyx_t_2 = 0; __pyx_t_2 = PyDict_New(); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 212, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_4 = __Pyx_PyInt_From_int32_t(__pyx_v_e->data1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 212, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_5 = __Pyx_PyInt_From_int32_t(__pyx_v_e->data2); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 212, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_6 = PyTuple_New(2); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 212, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_4); __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_6, 1, __pyx_t_5); __pyx_t_4 = 0; __pyx_t_5 = 0; if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_size, __pyx_t_6) < 0) __PYX_ERR(0, 212, __pyx_L1_error) __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __pyx_t_6 = __Pyx_PyInt_From_int32_t(__pyx_v_e->data1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 212, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_w, __pyx_t_6) < 0) __PYX_ERR(0, 212, __pyx_L1_error) __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __pyx_t_6 = __Pyx_PyInt_From_int32_t(__pyx_v_e->data2); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 212, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_h, __pyx_t_6) < 0) __PYX_ERR(0, 212, __pyx_L1_error) __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_3, __pyx_t_2); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 212, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_r = __pyx_t_6; __pyx_t_6 = 0; goto __pyx_L0; /* "pygame_sdl2/event.pyx":211 * return EventType(ACTIVEEVENT, state=4, gain=0) * * elif e.event == SDL_WINDOWEVENT_RESIZED: # <<<<<<<<<<<<<< * return EventType(VIDEORESIZE, size=(e.data1, e.data2), w=e.data1, h=e.data2) * */ break; /* "pygame_sdl2/event.pyx":214 * return EventType(VIDEORESIZE, size=(e.data1, e.data2), w=e.data1, h=e.data2) * * elif e.event == SDL_WINDOWEVENT_EXPOSED: # <<<<<<<<<<<<<< * return EventType(VIDEOEXPOSE) * */ case SDL_WINDOWEVENT_EXPOSED: /* "pygame_sdl2/event.pyx":215 * * elif e.event == SDL_WINDOWEVENT_EXPOSED: * return EventType(VIDEOEXPOSE) # <<<<<<<<<<<<<< * * return EventType(SDL_WINDOWEVENT, event=e.event, data1=e.data1, data2=e.data2) */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_EventType); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 215, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_VIDEOEXPOSE); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 215, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_1 = NULL; if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_2))) { __pyx_t_1 = PyMethod_GET_SELF(__pyx_t_2); if (likely(__pyx_t_1)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_1); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); } } if (!__pyx_t_1) { __pyx_t_6 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 215, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_GOTREF(__pyx_t_6); } else { __pyx_t_5 = PyTuple_New(1+1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 215, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_GIVEREF(__pyx_t_1); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_1); __pyx_t_1 = NULL; __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_5, 0+1, __pyx_t_3); __pyx_t_3 = 0; __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_5, NULL); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 215, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; } __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_r = __pyx_t_6; __pyx_t_6 = 0; goto __pyx_L0; /* "pygame_sdl2/event.pyx":214 * return EventType(VIDEORESIZE, size=(e.data1, e.data2), w=e.data1, h=e.data2) * * elif e.event == SDL_WINDOWEVENT_EXPOSED: # <<<<<<<<<<<<<< * return EventType(VIDEOEXPOSE) * */ break; default: break; } /* "pygame_sdl2/event.pyx":217 * return EventType(VIDEOEXPOSE) * * return EventType(SDL_WINDOWEVENT, event=e.event, data1=e.data1, data2=e.data2) # <<<<<<<<<<<<<< * * cdef make_event(SDL_Event *e): */ __Pyx_XDECREF(__pyx_r); __pyx_t_6 = __Pyx_GetModuleGlobalName(__pyx_n_s_EventType); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 217, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __pyx_t_2 = __Pyx_PyInt_From_SDL_EventType(SDL_WINDOWEVENT); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 217, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 217, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_GIVEREF(__pyx_t_2); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_2); __pyx_t_2 = 0; __pyx_t_2 = PyDict_New(); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 217, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = __Pyx_PyInt_From_uint8_t(__pyx_v_e->event); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 217, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_event, __pyx_t_3) < 0) __PYX_ERR(0, 217, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_3 = __Pyx_PyInt_From_int32_t(__pyx_v_e->data1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 217, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_data1, __pyx_t_3) < 0) __PYX_ERR(0, 217, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_3 = __Pyx_PyInt_From_int32_t(__pyx_v_e->data2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 217, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_data2, __pyx_t_3) < 0) __PYX_ERR(0, 217, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_5, __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 217, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_r = __pyx_t_3; __pyx_t_3 = 0; goto __pyx_L0; /* "pygame_sdl2/event.pyx":192 * return EventType(e.type, text=e.text.decode("utf-8"), start=e.start, length=e.length) * * cdef make_window_event(SDL_WindowEvent *e): # <<<<<<<<<<<<<< * # SDL_APPMOUSEFOCUS * if e.event == SDL_WINDOWEVENT_ENTER: */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_5); __Pyx_XDECREF(__pyx_t_6); __Pyx_AddTraceback("pygame_sdl2.event.make_window_event", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/event.pyx":219 * return EventType(SDL_WINDOWEVENT, event=e.event, data1=e.data1, data2=e.data2) * * cdef make_event(SDL_Event *e): # <<<<<<<<<<<<<< * cdef object o * */ static PyObject *__pyx_f_11pygame_sdl2_5event_make_event(SDL_Event *__pyx_v_e) { PyObject *__pyx_v_o = 0; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; PyObject *__pyx_t_2 = NULL; int __pyx_t_3; PyObject *__pyx_t_4 = NULL; PyObject *__pyx_t_5 = NULL; PyObject *__pyx_t_6 = NULL; PyObject *__pyx_t_7 = NULL; __Pyx_RefNannySetupContext("make_event", 0); /* "pygame_sdl2/event.pyx":222 * cdef object o * * if e.type == SDL_MOUSEMOTION: # <<<<<<<<<<<<<< * return make_mousemotion_event(e) * elif e.type in (SDL_MOUSEBUTTONDOWN, SDL_MOUSEBUTTONUP): */ __pyx_t_1 = ((__pyx_v_e->type == SDL_MOUSEMOTION) != 0); if (__pyx_t_1) { /* "pygame_sdl2/event.pyx":223 * * if e.type == SDL_MOUSEMOTION: * return make_mousemotion_event(e) # <<<<<<<<<<<<<< * elif e.type in (SDL_MOUSEBUTTONDOWN, SDL_MOUSEBUTTONUP): * return make_mousebtn_event(e) */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __pyx_f_11pygame_sdl2_5event_make_mousemotion_event(((SDL_MouseMotionEvent *)__pyx_v_e)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 223, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; /* "pygame_sdl2/event.pyx":222 * cdef object o * * if e.type == SDL_MOUSEMOTION: # <<<<<<<<<<<<<< * return make_mousemotion_event(e) * elif e.type in (SDL_MOUSEBUTTONDOWN, SDL_MOUSEBUTTONUP): */ } /* "pygame_sdl2/event.pyx":224 * if e.type == SDL_MOUSEMOTION: * return make_mousemotion_event(e) * elif e.type in (SDL_MOUSEBUTTONDOWN, SDL_MOUSEBUTTONUP): # <<<<<<<<<<<<<< * return make_mousebtn_event(e) * */ switch (__pyx_v_e->type) { case SDL_MOUSEBUTTONDOWN: case SDL_MOUSEBUTTONUP: __pyx_t_1 = 1; break; default: __pyx_t_1 = 0; break; } __pyx_t_3 = (__pyx_t_1 != 0); if (__pyx_t_3) { /* "pygame_sdl2/event.pyx":225 * return make_mousemotion_event(e) * elif e.type in (SDL_MOUSEBUTTONDOWN, SDL_MOUSEBUTTONUP): * return make_mousebtn_event(e) # <<<<<<<<<<<<<< * * elif e.type == SDL_MOUSEWHEEL: */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __pyx_f_11pygame_sdl2_5event_make_mousebtn_event(((SDL_MouseButtonEvent *)__pyx_v_e)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 225, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; /* "pygame_sdl2/event.pyx":224 * if e.type == SDL_MOUSEMOTION: * return make_mousemotion_event(e) * elif e.type in (SDL_MOUSEBUTTONDOWN, SDL_MOUSEBUTTONUP): # <<<<<<<<<<<<<< * return make_mousebtn_event(e) * */ } /* "pygame_sdl2/event.pyx":227 * return make_mousebtn_event(e) * * elif e.type == SDL_MOUSEWHEEL: # <<<<<<<<<<<<<< * return make_mousewheel_event(e) * elif e.type in (SDL_KEYDOWN, SDL_KEYUP): */ __pyx_t_3 = ((__pyx_v_e->type == SDL_MOUSEWHEEL) != 0); if (__pyx_t_3) { /* "pygame_sdl2/event.pyx":228 * * elif e.type == SDL_MOUSEWHEEL: * return make_mousewheel_event(e) # <<<<<<<<<<<<<< * elif e.type in (SDL_KEYDOWN, SDL_KEYUP): * return make_keyboard_event(e) */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __pyx_f_11pygame_sdl2_5event_make_mousewheel_event(((SDL_MouseWheelEvent *)__pyx_v_e)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 228, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; /* "pygame_sdl2/event.pyx":227 * return make_mousebtn_event(e) * * elif e.type == SDL_MOUSEWHEEL: # <<<<<<<<<<<<<< * return make_mousewheel_event(e) * elif e.type in (SDL_KEYDOWN, SDL_KEYUP): */ } /* "pygame_sdl2/event.pyx":229 * elif e.type == SDL_MOUSEWHEEL: * return make_mousewheel_event(e) * elif e.type in (SDL_KEYDOWN, SDL_KEYUP): # <<<<<<<<<<<<<< * return make_keyboard_event(e) * elif e.type == SDL_JOYAXISMOTION: */ switch (__pyx_v_e->type) { case SDL_KEYDOWN: case SDL_KEYUP: __pyx_t_3 = 1; break; default: __pyx_t_3 = 0; break; } __pyx_t_1 = (__pyx_t_3 != 0); if (__pyx_t_1) { /* "pygame_sdl2/event.pyx":230 * return make_mousewheel_event(e) * elif e.type in (SDL_KEYDOWN, SDL_KEYUP): * return make_keyboard_event(e) # <<<<<<<<<<<<<< * elif e.type == SDL_JOYAXISMOTION: * return make_joyaxis_event(e) */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __pyx_f_11pygame_sdl2_5event_make_keyboard_event(((SDL_KeyboardEvent *)__pyx_v_e)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 230, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; /* "pygame_sdl2/event.pyx":229 * elif e.type == SDL_MOUSEWHEEL: * return make_mousewheel_event(e) * elif e.type in (SDL_KEYDOWN, SDL_KEYUP): # <<<<<<<<<<<<<< * return make_keyboard_event(e) * elif e.type == SDL_JOYAXISMOTION: */ } /* "pygame_sdl2/event.pyx":231 * elif e.type in (SDL_KEYDOWN, SDL_KEYUP): * return make_keyboard_event(e) * elif e.type == SDL_JOYAXISMOTION: # <<<<<<<<<<<<<< * return make_joyaxis_event(e) * elif e.type == SDL_JOYBALLMOTION: */ __pyx_t_1 = ((__pyx_v_e->type == SDL_JOYAXISMOTION) != 0); if (__pyx_t_1) { /* "pygame_sdl2/event.pyx":232 * return make_keyboard_event(e) * elif e.type == SDL_JOYAXISMOTION: * return make_joyaxis_event(e) # <<<<<<<<<<<<<< * elif e.type == SDL_JOYBALLMOTION: * return make_joyball_event(e) */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __pyx_f_11pygame_sdl2_5event_make_joyaxis_event(((SDL_JoyAxisEvent *)__pyx_v_e)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 232, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; /* "pygame_sdl2/event.pyx":231 * elif e.type in (SDL_KEYDOWN, SDL_KEYUP): * return make_keyboard_event(e) * elif e.type == SDL_JOYAXISMOTION: # <<<<<<<<<<<<<< * return make_joyaxis_event(e) * elif e.type == SDL_JOYBALLMOTION: */ } /* "pygame_sdl2/event.pyx":233 * elif e.type == SDL_JOYAXISMOTION: * return make_joyaxis_event(e) * elif e.type == SDL_JOYBALLMOTION: # <<<<<<<<<<<<<< * return make_joyball_event(e) * elif e.type == SDL_JOYHATMOTION: */ __pyx_t_1 = ((__pyx_v_e->type == SDL_JOYBALLMOTION) != 0); if (__pyx_t_1) { /* "pygame_sdl2/event.pyx":234 * return make_joyaxis_event(e) * elif e.type == SDL_JOYBALLMOTION: * return make_joyball_event(e) # <<<<<<<<<<<<<< * elif e.type == SDL_JOYHATMOTION: * return make_joyhat_event(e) */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __pyx_f_11pygame_sdl2_5event_make_joyball_event(((SDL_JoyBallEvent *)__pyx_v_e)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 234, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; /* "pygame_sdl2/event.pyx":233 * elif e.type == SDL_JOYAXISMOTION: * return make_joyaxis_event(e) * elif e.type == SDL_JOYBALLMOTION: # <<<<<<<<<<<<<< * return make_joyball_event(e) * elif e.type == SDL_JOYHATMOTION: */ } /* "pygame_sdl2/event.pyx":235 * elif e.type == SDL_JOYBALLMOTION: * return make_joyball_event(e) * elif e.type == SDL_JOYHATMOTION: # <<<<<<<<<<<<<< * return make_joyhat_event(e) * elif e.type in (SDL_JOYBUTTONDOWN, SDL_JOYBUTTONUP): */ __pyx_t_1 = ((__pyx_v_e->type == SDL_JOYHATMOTION) != 0); if (__pyx_t_1) { /* "pygame_sdl2/event.pyx":236 * return make_joyball_event(e) * elif e.type == SDL_JOYHATMOTION: * return make_joyhat_event(e) # <<<<<<<<<<<<<< * elif e.type in (SDL_JOYBUTTONDOWN, SDL_JOYBUTTONUP): * return make_joybtn_event(e) */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __pyx_f_11pygame_sdl2_5event_make_joyhat_event(((SDL_JoyHatEvent *)__pyx_v_e)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 236, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; /* "pygame_sdl2/event.pyx":235 * elif e.type == SDL_JOYBALLMOTION: * return make_joyball_event(e) * elif e.type == SDL_JOYHATMOTION: # <<<<<<<<<<<<<< * return make_joyhat_event(e) * elif e.type in (SDL_JOYBUTTONDOWN, SDL_JOYBUTTONUP): */ } /* "pygame_sdl2/event.pyx":237 * elif e.type == SDL_JOYHATMOTION: * return make_joyhat_event(e) * elif e.type in (SDL_JOYBUTTONDOWN, SDL_JOYBUTTONUP): # <<<<<<<<<<<<<< * return make_joybtn_event(e) * elif e.type in (SDL_JOYDEVICEADDED, SDL_JOYDEVICEREMOVED): */ switch (__pyx_v_e->type) { case SDL_JOYBUTTONDOWN: case SDL_JOYBUTTONUP: __pyx_t_1 = 1; break; default: __pyx_t_1 = 0; break; } __pyx_t_3 = (__pyx_t_1 != 0); if (__pyx_t_3) { /* "pygame_sdl2/event.pyx":238 * return make_joyhat_event(e) * elif e.type in (SDL_JOYBUTTONDOWN, SDL_JOYBUTTONUP): * return make_joybtn_event(e) # <<<<<<<<<<<<<< * elif e.type in (SDL_JOYDEVICEADDED, SDL_JOYDEVICEREMOVED): * return EventType(e.type, which=e.jdevice.which) */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __pyx_f_11pygame_sdl2_5event_make_joybtn_event(((SDL_JoyButtonEvent *)__pyx_v_e)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 238, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; /* "pygame_sdl2/event.pyx":237 * elif e.type == SDL_JOYHATMOTION: * return make_joyhat_event(e) * elif e.type in (SDL_JOYBUTTONDOWN, SDL_JOYBUTTONUP): # <<<<<<<<<<<<<< * return make_joybtn_event(e) * elif e.type in (SDL_JOYDEVICEADDED, SDL_JOYDEVICEREMOVED): */ } /* "pygame_sdl2/event.pyx":239 * elif e.type in (SDL_JOYBUTTONDOWN, SDL_JOYBUTTONUP): * return make_joybtn_event(e) * elif e.type in (SDL_JOYDEVICEADDED, SDL_JOYDEVICEREMOVED): # <<<<<<<<<<<<<< * return EventType(e.type, which=e.jdevice.which) * elif e.type == SDL_WINDOWEVENT: */ switch (__pyx_v_e->type) { case SDL_JOYDEVICEADDED: case SDL_JOYDEVICEREMOVED: __pyx_t_3 = 1; break; default: __pyx_t_3 = 0; break; } __pyx_t_1 = (__pyx_t_3 != 0); if (__pyx_t_1) { /* "pygame_sdl2/event.pyx":240 * return make_joybtn_event(e) * elif e.type in (SDL_JOYDEVICEADDED, SDL_JOYDEVICEREMOVED): * return EventType(e.type, which=e.jdevice.which) # <<<<<<<<<<<<<< * elif e.type == SDL_WINDOWEVENT: * return make_window_event(e) */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_EventType); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 240, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_4 = __Pyx_PyInt_From_uint32_t(__pyx_v_e->type); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 240, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 240, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_4); __pyx_t_4 = 0; __pyx_t_4 = PyDict_New(); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 240, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_6 = __Pyx_PyInt_From_int32_t(__pyx_v_e->jdevice.which); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 240, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_which, __pyx_t_6) < 0) __PYX_ERR(0, 240, __pyx_L1_error) __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_5, __pyx_t_4); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 240, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_r = __pyx_t_6; __pyx_t_6 = 0; goto __pyx_L0; /* "pygame_sdl2/event.pyx":239 * elif e.type in (SDL_JOYBUTTONDOWN, SDL_JOYBUTTONUP): * return make_joybtn_event(e) * elif e.type in (SDL_JOYDEVICEADDED, SDL_JOYDEVICEREMOVED): # <<<<<<<<<<<<<< * return EventType(e.type, which=e.jdevice.which) * elif e.type == SDL_WINDOWEVENT: */ } /* "pygame_sdl2/event.pyx":241 * elif e.type in (SDL_JOYDEVICEADDED, SDL_JOYDEVICEREMOVED): * return EventType(e.type, which=e.jdevice.which) * elif e.type == SDL_WINDOWEVENT: # <<<<<<<<<<<<<< * return make_window_event(e) * elif e.type == SDL_TEXTINPUT: */ __pyx_t_1 = ((__pyx_v_e->type == SDL_WINDOWEVENT) != 0); if (__pyx_t_1) { /* "pygame_sdl2/event.pyx":242 * return EventType(e.type, which=e.jdevice.which) * elif e.type == SDL_WINDOWEVENT: * return make_window_event(e) # <<<<<<<<<<<<<< * elif e.type == SDL_TEXTINPUT: * return make_textinput_event( e) */ __Pyx_XDECREF(__pyx_r); __pyx_t_6 = __pyx_f_11pygame_sdl2_5event_make_window_event(((SDL_WindowEvent *)__pyx_v_e)); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 242, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __pyx_r = __pyx_t_6; __pyx_t_6 = 0; goto __pyx_L0; /* "pygame_sdl2/event.pyx":241 * elif e.type in (SDL_JOYDEVICEADDED, SDL_JOYDEVICEREMOVED): * return EventType(e.type, which=e.jdevice.which) * elif e.type == SDL_WINDOWEVENT: # <<<<<<<<<<<<<< * return make_window_event(e) * elif e.type == SDL_TEXTINPUT: */ } /* "pygame_sdl2/event.pyx":243 * elif e.type == SDL_WINDOWEVENT: * return make_window_event(e) * elif e.type == SDL_TEXTINPUT: # <<<<<<<<<<<<<< * return make_textinput_event( e) * elif e.type == SDL_TEXTEDITING: */ __pyx_t_1 = ((__pyx_v_e->type == SDL_TEXTINPUT) != 0); if (__pyx_t_1) { /* "pygame_sdl2/event.pyx":244 * return make_window_event(e) * elif e.type == SDL_TEXTINPUT: * return make_textinput_event( e) # <<<<<<<<<<<<<< * elif e.type == SDL_TEXTEDITING: * return make_textediting_event( e) */ __Pyx_XDECREF(__pyx_r); __pyx_t_6 = __pyx_f_11pygame_sdl2_5event_make_textinput_event(((SDL_TextInputEvent *)__pyx_v_e)); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 244, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __pyx_r = __pyx_t_6; __pyx_t_6 = 0; goto __pyx_L0; /* "pygame_sdl2/event.pyx":243 * elif e.type == SDL_WINDOWEVENT: * return make_window_event(e) * elif e.type == SDL_TEXTINPUT: # <<<<<<<<<<<<<< * return make_textinput_event( e) * elif e.type == SDL_TEXTEDITING: */ } /* "pygame_sdl2/event.pyx":245 * elif e.type == SDL_TEXTINPUT: * return make_textinput_event( e) * elif e.type == SDL_TEXTEDITING: # <<<<<<<<<<<<<< * return make_textediting_event( e) * elif e.type == SDL_CONTROLLERAXISMOTION: */ __pyx_t_1 = ((__pyx_v_e->type == SDL_TEXTEDITING) != 0); if (__pyx_t_1) { /* "pygame_sdl2/event.pyx":246 * return make_textinput_event( e) * elif e.type == SDL_TEXTEDITING: * return make_textediting_event( e) # <<<<<<<<<<<<<< * elif e.type == SDL_CONTROLLERAXISMOTION: * return EventType(e.type, which=e.caxis.which, axis=e.caxis.axis, value=e.caxis.value) */ __Pyx_XDECREF(__pyx_r); __pyx_t_6 = __pyx_f_11pygame_sdl2_5event_make_textediting_event(((SDL_TextEditingEvent *)__pyx_v_e)); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 246, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __pyx_r = __pyx_t_6; __pyx_t_6 = 0; goto __pyx_L0; /* "pygame_sdl2/event.pyx":245 * elif e.type == SDL_TEXTINPUT: * return make_textinput_event( e) * elif e.type == SDL_TEXTEDITING: # <<<<<<<<<<<<<< * return make_textediting_event( e) * elif e.type == SDL_CONTROLLERAXISMOTION: */ } /* "pygame_sdl2/event.pyx":247 * elif e.type == SDL_TEXTEDITING: * return make_textediting_event( e) * elif e.type == SDL_CONTROLLERAXISMOTION: # <<<<<<<<<<<<<< * return EventType(e.type, which=e.caxis.which, axis=e.caxis.axis, value=e.caxis.value) * elif e.type in (SDL_CONTROLLERBUTTONDOWN, SDL_CONTROLLERBUTTONUP): */ __pyx_t_1 = ((__pyx_v_e->type == SDL_CONTROLLERAXISMOTION) != 0); if (__pyx_t_1) { /* "pygame_sdl2/event.pyx":248 * return make_textediting_event( e) * elif e.type == SDL_CONTROLLERAXISMOTION: * return EventType(e.type, which=e.caxis.which, axis=e.caxis.axis, value=e.caxis.value) # <<<<<<<<<<<<<< * elif e.type in (SDL_CONTROLLERBUTTONDOWN, SDL_CONTROLLERBUTTONUP): * return EventType(e.type, which=e.cbutton.which, button=e.cbutton.button, state=e.cbutton.state) */ __Pyx_XDECREF(__pyx_r); __pyx_t_6 = __Pyx_GetModuleGlobalName(__pyx_n_s_EventType); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 248, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __pyx_t_4 = __Pyx_PyInt_From_uint32_t(__pyx_v_e->type); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 248, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 248, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_4); __pyx_t_4 = 0; __pyx_t_4 = PyDict_New(); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 248, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_2 = __Pyx_PyInt_From_int32_t(__pyx_v_e->caxis.which); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 248, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_which, __pyx_t_2) < 0) __PYX_ERR(0, 248, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_2 = __Pyx_PyInt_From_uint8_t(__pyx_v_e->caxis.axis); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 248, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_axis, __pyx_t_2) < 0) __PYX_ERR(0, 248, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_2 = __Pyx_PyInt_From_int16_t(__pyx_v_e->caxis.value); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 248, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_value, __pyx_t_2) < 0) __PYX_ERR(0, 248, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_5, __pyx_t_4); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 248, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; /* "pygame_sdl2/event.pyx":247 * elif e.type == SDL_TEXTEDITING: * return make_textediting_event( e) * elif e.type == SDL_CONTROLLERAXISMOTION: # <<<<<<<<<<<<<< * return EventType(e.type, which=e.caxis.which, axis=e.caxis.axis, value=e.caxis.value) * elif e.type in (SDL_CONTROLLERBUTTONDOWN, SDL_CONTROLLERBUTTONUP): */ } /* "pygame_sdl2/event.pyx":249 * elif e.type == SDL_CONTROLLERAXISMOTION: * return EventType(e.type, which=e.caxis.which, axis=e.caxis.axis, value=e.caxis.value) * elif e.type in (SDL_CONTROLLERBUTTONDOWN, SDL_CONTROLLERBUTTONUP): # <<<<<<<<<<<<<< * return EventType(e.type, which=e.cbutton.which, button=e.cbutton.button, state=e.cbutton.state) * elif e.type in (SDL_CONTROLLERDEVICEADDED, SDL_CONTROLLERDEVICEREMOVED, SDL_CONTROLLERDEVICEREMAPPED): */ switch (__pyx_v_e->type) { case SDL_CONTROLLERBUTTONDOWN: case SDL_CONTROLLERBUTTONUP: __pyx_t_1 = 1; break; default: __pyx_t_1 = 0; break; } __pyx_t_3 = (__pyx_t_1 != 0); if (__pyx_t_3) { /* "pygame_sdl2/event.pyx":250 * return EventType(e.type, which=e.caxis.which, axis=e.caxis.axis, value=e.caxis.value) * elif e.type in (SDL_CONTROLLERBUTTONDOWN, SDL_CONTROLLERBUTTONUP): * return EventType(e.type, which=e.cbutton.which, button=e.cbutton.button, state=e.cbutton.state) # <<<<<<<<<<<<<< * elif e.type in (SDL_CONTROLLERDEVICEADDED, SDL_CONTROLLERDEVICEREMOVED, SDL_CONTROLLERDEVICEREMAPPED): * return EventType(e.type, which=e.cdevice.which) */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_EventType); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 250, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_4 = __Pyx_PyInt_From_uint32_t(__pyx_v_e->type); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 250, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 250, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_4); __pyx_t_4 = 0; __pyx_t_4 = PyDict_New(); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 250, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_6 = __Pyx_PyInt_From_int32_t(__pyx_v_e->cbutton.which); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 250, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_which, __pyx_t_6) < 0) __PYX_ERR(0, 250, __pyx_L1_error) __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __pyx_t_6 = __Pyx_PyInt_From_uint8_t(__pyx_v_e->cbutton.button); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 250, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_button, __pyx_t_6) < 0) __PYX_ERR(0, 250, __pyx_L1_error) __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __pyx_t_6 = __Pyx_PyInt_From_uint8_t(__pyx_v_e->cbutton.state); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 250, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_state, __pyx_t_6) < 0) __PYX_ERR(0, 250, __pyx_L1_error) __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_5, __pyx_t_4); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 250, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_r = __pyx_t_6; __pyx_t_6 = 0; goto __pyx_L0; /* "pygame_sdl2/event.pyx":249 * elif e.type == SDL_CONTROLLERAXISMOTION: * return EventType(e.type, which=e.caxis.which, axis=e.caxis.axis, value=e.caxis.value) * elif e.type in (SDL_CONTROLLERBUTTONDOWN, SDL_CONTROLLERBUTTONUP): # <<<<<<<<<<<<<< * return EventType(e.type, which=e.cbutton.which, button=e.cbutton.button, state=e.cbutton.state) * elif e.type in (SDL_CONTROLLERDEVICEADDED, SDL_CONTROLLERDEVICEREMOVED, SDL_CONTROLLERDEVICEREMAPPED): */ } /* "pygame_sdl2/event.pyx":251 * elif e.type in (SDL_CONTROLLERBUTTONDOWN, SDL_CONTROLLERBUTTONUP): * return EventType(e.type, which=e.cbutton.which, button=e.cbutton.button, state=e.cbutton.state) * elif e.type in (SDL_CONTROLLERDEVICEADDED, SDL_CONTROLLERDEVICEREMOVED, SDL_CONTROLLERDEVICEREMAPPED): # <<<<<<<<<<<<<< * return EventType(e.type, which=e.cdevice.which) * elif e.type in (SDL_FINGERMOTION, SDL_FINGERDOWN, SDL_FINGERUP): */ switch (__pyx_v_e->type) { case SDL_CONTROLLERDEVICEADDED: case SDL_CONTROLLERDEVICEREMOVED: case SDL_CONTROLLERDEVICEREMAPPED: __pyx_t_3 = 1; break; default: __pyx_t_3 = 0; break; } __pyx_t_1 = (__pyx_t_3 != 0); if (__pyx_t_1) { /* "pygame_sdl2/event.pyx":252 * return EventType(e.type, which=e.cbutton.which, button=e.cbutton.button, state=e.cbutton.state) * elif e.type in (SDL_CONTROLLERDEVICEADDED, SDL_CONTROLLERDEVICEREMOVED, SDL_CONTROLLERDEVICEREMAPPED): * return EventType(e.type, which=e.cdevice.which) # <<<<<<<<<<<<<< * elif e.type in (SDL_FINGERMOTION, SDL_FINGERDOWN, SDL_FINGERUP): * return EventType(e.type, touchId=e.tfinger.touchId, fingerId=e.tfinger.fingerId, x=e.tfinger.x, y=e.tfinger.y, dx=e.tfinger.dx, dy=e.tfinger.dy, pressure=e.tfinger.pressure) */ __Pyx_XDECREF(__pyx_r); __pyx_t_6 = __Pyx_GetModuleGlobalName(__pyx_n_s_EventType); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 252, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __pyx_t_4 = __Pyx_PyInt_From_uint32_t(__pyx_v_e->type); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 252, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 252, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_4); __pyx_t_4 = 0; __pyx_t_4 = PyDict_New(); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 252, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_2 = __Pyx_PyInt_From_int32_t(__pyx_v_e->cdevice.which); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 252, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_which, __pyx_t_2) < 0) __PYX_ERR(0, 252, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_5, __pyx_t_4); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 252, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; /* "pygame_sdl2/event.pyx":251 * elif e.type in (SDL_CONTROLLERBUTTONDOWN, SDL_CONTROLLERBUTTONUP): * return EventType(e.type, which=e.cbutton.which, button=e.cbutton.button, state=e.cbutton.state) * elif e.type in (SDL_CONTROLLERDEVICEADDED, SDL_CONTROLLERDEVICEREMOVED, SDL_CONTROLLERDEVICEREMAPPED): # <<<<<<<<<<<<<< * return EventType(e.type, which=e.cdevice.which) * elif e.type in (SDL_FINGERMOTION, SDL_FINGERDOWN, SDL_FINGERUP): */ } /* "pygame_sdl2/event.pyx":253 * elif e.type in (SDL_CONTROLLERDEVICEADDED, SDL_CONTROLLERDEVICEREMOVED, SDL_CONTROLLERDEVICEREMAPPED): * return EventType(e.type, which=e.cdevice.which) * elif e.type in (SDL_FINGERMOTION, SDL_FINGERDOWN, SDL_FINGERUP): # <<<<<<<<<<<<<< * return EventType(e.type, touchId=e.tfinger.touchId, fingerId=e.tfinger.fingerId, x=e.tfinger.x, y=e.tfinger.y, dx=e.tfinger.dx, dy=e.tfinger.dy, pressure=e.tfinger.pressure) * elif e.type == SDL_MULTIGESTURE: */ switch (__pyx_v_e->type) { case SDL_FINGERMOTION: case SDL_FINGERDOWN: case SDL_FINGERUP: __pyx_t_1 = 1; break; default: __pyx_t_1 = 0; break; } __pyx_t_3 = (__pyx_t_1 != 0); if (__pyx_t_3) { /* "pygame_sdl2/event.pyx":254 * return EventType(e.type, which=e.cdevice.which) * elif e.type in (SDL_FINGERMOTION, SDL_FINGERDOWN, SDL_FINGERUP): * return EventType(e.type, touchId=e.tfinger.touchId, fingerId=e.tfinger.fingerId, x=e.tfinger.x, y=e.tfinger.y, dx=e.tfinger.dx, dy=e.tfinger.dy, pressure=e.tfinger.pressure) # <<<<<<<<<<<<<< * elif e.type == SDL_MULTIGESTURE: * return EventType(e.type, touchId=e.mgesture.touchId, dTheta=e.mgesture.dTheta, dDist=e.mgesture.dDist, x=e.mgesture.x, y=e.mgesture.y, numFingers=e.mgesture.numFingers) */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_EventType); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 254, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_4 = __Pyx_PyInt_From_uint32_t(__pyx_v_e->type); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 254, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 254, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_4); __pyx_t_4 = 0; __pyx_t_4 = PyDict_New(); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 254, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_6 = __Pyx_PyInt_From_int64_t(__pyx_v_e->tfinger.touchId); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 254, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_touchId, __pyx_t_6) < 0) __PYX_ERR(0, 254, __pyx_L1_error) __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __pyx_t_6 = __Pyx_PyInt_From_int64_t(__pyx_v_e->tfinger.fingerId); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 254, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_fingerId, __pyx_t_6) < 0) __PYX_ERR(0, 254, __pyx_L1_error) __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __pyx_t_6 = PyFloat_FromDouble(__pyx_v_e->tfinger.x); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 254, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_x, __pyx_t_6) < 0) __PYX_ERR(0, 254, __pyx_L1_error) __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __pyx_t_6 = PyFloat_FromDouble(__pyx_v_e->tfinger.y); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 254, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_y, __pyx_t_6) < 0) __PYX_ERR(0, 254, __pyx_L1_error) __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __pyx_t_6 = PyFloat_FromDouble(__pyx_v_e->tfinger.dx); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 254, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_dx, __pyx_t_6) < 0) __PYX_ERR(0, 254, __pyx_L1_error) __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __pyx_t_6 = PyFloat_FromDouble(__pyx_v_e->tfinger.dy); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 254, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_dy, __pyx_t_6) < 0) __PYX_ERR(0, 254, __pyx_L1_error) __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __pyx_t_6 = PyFloat_FromDouble(__pyx_v_e->tfinger.pressure); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 254, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_pressure, __pyx_t_6) < 0) __PYX_ERR(0, 254, __pyx_L1_error) __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_5, __pyx_t_4); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 254, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_r = __pyx_t_6; __pyx_t_6 = 0; goto __pyx_L0; /* "pygame_sdl2/event.pyx":253 * elif e.type in (SDL_CONTROLLERDEVICEADDED, SDL_CONTROLLERDEVICEREMOVED, SDL_CONTROLLERDEVICEREMAPPED): * return EventType(e.type, which=e.cdevice.which) * elif e.type in (SDL_FINGERMOTION, SDL_FINGERDOWN, SDL_FINGERUP): # <<<<<<<<<<<<<< * return EventType(e.type, touchId=e.tfinger.touchId, fingerId=e.tfinger.fingerId, x=e.tfinger.x, y=e.tfinger.y, dx=e.tfinger.dx, dy=e.tfinger.dy, pressure=e.tfinger.pressure) * elif e.type == SDL_MULTIGESTURE: */ } /* "pygame_sdl2/event.pyx":255 * elif e.type in (SDL_FINGERMOTION, SDL_FINGERDOWN, SDL_FINGERUP): * return EventType(e.type, touchId=e.tfinger.touchId, fingerId=e.tfinger.fingerId, x=e.tfinger.x, y=e.tfinger.y, dx=e.tfinger.dx, dy=e.tfinger.dy, pressure=e.tfinger.pressure) * elif e.type == SDL_MULTIGESTURE: # <<<<<<<<<<<<<< * return EventType(e.type, touchId=e.mgesture.touchId, dTheta=e.mgesture.dTheta, dDist=e.mgesture.dDist, x=e.mgesture.x, y=e.mgesture.y, numFingers=e.mgesture.numFingers) * elif e.type == POSTEDEVENT: */ __pyx_t_3 = ((__pyx_v_e->type == SDL_MULTIGESTURE) != 0); if (__pyx_t_3) { /* "pygame_sdl2/event.pyx":256 * return EventType(e.type, touchId=e.tfinger.touchId, fingerId=e.tfinger.fingerId, x=e.tfinger.x, y=e.tfinger.y, dx=e.tfinger.dx, dy=e.tfinger.dy, pressure=e.tfinger.pressure) * elif e.type == SDL_MULTIGESTURE: * return EventType(e.type, touchId=e.mgesture.touchId, dTheta=e.mgesture.dTheta, dDist=e.mgesture.dDist, x=e.mgesture.x, y=e.mgesture.y, numFingers=e.mgesture.numFingers) # <<<<<<<<<<<<<< * elif e.type == POSTEDEVENT: * o = e.user.data1 */ __Pyx_XDECREF(__pyx_r); __pyx_t_6 = __Pyx_GetModuleGlobalName(__pyx_n_s_EventType); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 256, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __pyx_t_4 = __Pyx_PyInt_From_uint32_t(__pyx_v_e->type); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 256, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 256, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_4); __pyx_t_4 = 0; __pyx_t_4 = PyDict_New(); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 256, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_2 = __Pyx_PyInt_From_int64_t(__pyx_v_e->mgesture.touchId); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 256, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_touchId, __pyx_t_2) < 0) __PYX_ERR(0, 256, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_2 = PyFloat_FromDouble(__pyx_v_e->mgesture.dTheta); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 256, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_dTheta, __pyx_t_2) < 0) __PYX_ERR(0, 256, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_2 = PyFloat_FromDouble(__pyx_v_e->mgesture.dDist); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 256, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_dDist, __pyx_t_2) < 0) __PYX_ERR(0, 256, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_2 = PyFloat_FromDouble(__pyx_v_e->mgesture.x); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 256, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_x, __pyx_t_2) < 0) __PYX_ERR(0, 256, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_2 = PyFloat_FromDouble(__pyx_v_e->mgesture.y); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 256, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_y, __pyx_t_2) < 0) __PYX_ERR(0, 256, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_2 = __Pyx_PyInt_From_uint16_t(__pyx_v_e->mgesture.numFingers); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 256, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_numFingers, __pyx_t_2) < 0) __PYX_ERR(0, 256, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_5, __pyx_t_4); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 256, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; /* "pygame_sdl2/event.pyx":255 * elif e.type in (SDL_FINGERMOTION, SDL_FINGERDOWN, SDL_FINGERUP): * return EventType(e.type, touchId=e.tfinger.touchId, fingerId=e.tfinger.fingerId, x=e.tfinger.x, y=e.tfinger.y, dx=e.tfinger.dx, dy=e.tfinger.dy, pressure=e.tfinger.pressure) * elif e.type == SDL_MULTIGESTURE: # <<<<<<<<<<<<<< * return EventType(e.type, touchId=e.mgesture.touchId, dTheta=e.mgesture.dTheta, dDist=e.mgesture.dDist, x=e.mgesture.x, y=e.mgesture.y, numFingers=e.mgesture.numFingers) * elif e.type == POSTEDEVENT: */ } /* "pygame_sdl2/event.pyx":257 * elif e.type == SDL_MULTIGESTURE: * return EventType(e.type, touchId=e.mgesture.touchId, dTheta=e.mgesture.dTheta, dDist=e.mgesture.dDist, x=e.mgesture.x, y=e.mgesture.y, numFingers=e.mgesture.numFingers) * elif e.type == POSTEDEVENT: # <<<<<<<<<<<<<< * o = e.user.data1 * Py_DECREF(o) */ __pyx_t_3 = ((__pyx_v_e->type == __pyx_v_11pygame_sdl2_5event_POSTEDEVENT) != 0); if (__pyx_t_3) { /* "pygame_sdl2/event.pyx":258 * return EventType(e.type, touchId=e.mgesture.touchId, dTheta=e.mgesture.dTheta, dDist=e.mgesture.dDist, x=e.mgesture.x, y=e.mgesture.y, numFingers=e.mgesture.numFingers) * elif e.type == POSTEDEVENT: * o = e.user.data1 # <<<<<<<<<<<<<< * Py_DECREF(o) * return o */ __pyx_t_2 = ((PyObject *)__pyx_v_e->user.data1); __Pyx_INCREF(__pyx_t_2); __pyx_v_o = __pyx_t_2; __pyx_t_2 = 0; /* "pygame_sdl2/event.pyx":259 * elif e.type == POSTEDEVENT: * o = e.user.data1 * Py_DECREF(o) # <<<<<<<<<<<<<< * return o * elif e.type >= SDL_USEREVENT: */ Py_DECREF(__pyx_v_o); /* "pygame_sdl2/event.pyx":260 * o = e.user.data1 * Py_DECREF(o) * return o # <<<<<<<<<<<<<< * elif e.type >= SDL_USEREVENT: * # Can't do anything useful with data1 and data2 here. */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(__pyx_v_o); __pyx_r = __pyx_v_o; goto __pyx_L0; /* "pygame_sdl2/event.pyx":257 * elif e.type == SDL_MULTIGESTURE: * return EventType(e.type, touchId=e.mgesture.touchId, dTheta=e.mgesture.dTheta, dDist=e.mgesture.dDist, x=e.mgesture.x, y=e.mgesture.y, numFingers=e.mgesture.numFingers) * elif e.type == POSTEDEVENT: # <<<<<<<<<<<<<< * o = e.user.data1 * Py_DECREF(o) */ } /* "pygame_sdl2/event.pyx":261 * Py_DECREF(o) * return o * elif e.type >= SDL_USEREVENT: # <<<<<<<<<<<<<< * # Can't do anything useful with data1 and data2 here. * return EventType(e.type, code=e.user.code) */ __pyx_t_3 = ((__pyx_v_e->type >= SDL_USEREVENT) != 0); if (__pyx_t_3) { /* "pygame_sdl2/event.pyx":263 * elif e.type >= SDL_USEREVENT: * # Can't do anything useful with data1 and data2 here. * return EventType(e.type, code=e.user.code) # <<<<<<<<<<<<<< * * return EventType(e.type) */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_EventType); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 263, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_4 = __Pyx_PyInt_From_uint32_t(__pyx_v_e->type); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 263, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 263, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_4); __pyx_t_4 = 0; __pyx_t_4 = PyDict_New(); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 263, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_6 = __Pyx_PyInt_From_int32_t(__pyx_v_e->user.code); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 263, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_code, __pyx_t_6) < 0) __PYX_ERR(0, 263, __pyx_L1_error) __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_5, __pyx_t_4); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 263, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_r = __pyx_t_6; __pyx_t_6 = 0; goto __pyx_L0; /* "pygame_sdl2/event.pyx":261 * Py_DECREF(o) * return o * elif e.type >= SDL_USEREVENT: # <<<<<<<<<<<<<< * # Can't do anything useful with data1 and data2 here. * return EventType(e.type, code=e.user.code) */ } /* "pygame_sdl2/event.pyx":265 * return EventType(e.type, code=e.user.code) * * return EventType(e.type) # <<<<<<<<<<<<<< * * */ __Pyx_XDECREF(__pyx_r); __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_EventType); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 265, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_5 = __Pyx_PyInt_From_uint32_t(__pyx_v_e->type); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 265, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_2 = NULL; if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_4))) { __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_4); if (likely(__pyx_t_2)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4); __Pyx_INCREF(__pyx_t_2); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_4, function); } } if (!__pyx_t_2) { __pyx_t_6 = __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_5); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 265, __pyx_L1_error) __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_GOTREF(__pyx_t_6); } else { __pyx_t_7 = PyTuple_New(1+1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 265, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_GIVEREF(__pyx_t_2); PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_2); __pyx_t_2 = NULL; __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_7, 0+1, __pyx_t_5); __pyx_t_5 = 0; __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_7, NULL); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 265, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; } __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_r = __pyx_t_6; __pyx_t_6 = 0; goto __pyx_L0; /* "pygame_sdl2/event.pyx":219 * return EventType(SDL_WINDOWEVENT, event=e.event, data1=e.data1, data2=e.data2) * * cdef make_event(SDL_Event *e): # <<<<<<<<<<<<<< * cdef object o * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_5); __Pyx_XDECREF(__pyx_t_6); __Pyx_XDECREF(__pyx_t_7); __Pyx_AddTraceback("pygame_sdl2.event.make_event", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XDECREF(__pyx_v_o); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/event.pyx":278 * * * cdef bint has_event(kinds): # <<<<<<<<<<<<<< * """ * Returns true if at least one event in the queue has a type in `kinds`, */ static int __pyx_f_11pygame_sdl2_5event_has_event(PyObject *__pyx_v_kinds) { PyObject *__pyx_v_i = NULL; int __pyx_r; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; Py_ssize_t __pyx_t_2; PyObject *(*__pyx_t_3)(PyObject *); PyObject *__pyx_t_4 = NULL; int __pyx_t_5; int __pyx_t_6; __Pyx_RefNannySetupContext("has_event", 0); /* "pygame_sdl2/event.pyx":286 * """ * * for i in event_queue: # <<<<<<<<<<<<<< * if i._type in kinds: * return True */ if (likely(PyList_CheckExact(event_queue)) || PyTuple_CheckExact(event_queue)) { __pyx_t_1 = event_queue; __Pyx_INCREF(__pyx_t_1); __pyx_t_2 = 0; __pyx_t_3 = NULL; } else { __pyx_t_2 = -1; __pyx_t_1 = PyObject_GetIter(event_queue); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 286, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_3 = Py_TYPE(__pyx_t_1)->tp_iternext; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 286, __pyx_L1_error) } for (;;) { if (likely(!__pyx_t_3)) { if (likely(PyList_CheckExact(__pyx_t_1))) { if (__pyx_t_2 >= PyList_GET_SIZE(__pyx_t_1)) break; #if CYTHON_COMPILING_IN_CPYTHON __pyx_t_4 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_2); __Pyx_INCREF(__pyx_t_4); __pyx_t_2++; if (unlikely(0 < 0)) __PYX_ERR(0, 286, __pyx_L1_error) #else __pyx_t_4 = PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 286, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); #endif } else { if (__pyx_t_2 >= PyTuple_GET_SIZE(__pyx_t_1)) break; #if CYTHON_COMPILING_IN_CPYTHON __pyx_t_4 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_2); __Pyx_INCREF(__pyx_t_4); __pyx_t_2++; if (unlikely(0 < 0)) __PYX_ERR(0, 286, __pyx_L1_error) #else __pyx_t_4 = PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 286, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); #endif } } else { __pyx_t_4 = __pyx_t_3(__pyx_t_1); if (unlikely(!__pyx_t_4)) { PyObject* exc_type = PyErr_Occurred(); if (exc_type) { if (likely(exc_type == PyExc_StopIteration || PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); else __PYX_ERR(0, 286, __pyx_L1_error) } break; } __Pyx_GOTREF(__pyx_t_4); } __Pyx_XDECREF_SET(__pyx_v_i, __pyx_t_4); __pyx_t_4 = 0; /* "pygame_sdl2/event.pyx":287 * * for i in event_queue: * if i._type in kinds: # <<<<<<<<<<<<<< * return True * */ __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_i, __pyx_n_s_type_2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 287, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_5 = (__Pyx_PySequence_ContainsTF(__pyx_t_4, __pyx_v_kinds, Py_EQ)); if (unlikely(__pyx_t_5 < 0)) __PYX_ERR(0, 287, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_t_6 = (__pyx_t_5 != 0); if (__pyx_t_6) { /* "pygame_sdl2/event.pyx":288 * for i in event_queue: * if i._type in kinds: * return True # <<<<<<<<<<<<<< * * */ __pyx_r = 1; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; goto __pyx_L0; /* "pygame_sdl2/event.pyx":287 * * for i in event_queue: * if i._type in kinds: # <<<<<<<<<<<<<< * return True * */ } /* "pygame_sdl2/event.pyx":286 * """ * * for i in event_queue: # <<<<<<<<<<<<<< * if i._type in kinds: * return True */ } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "pygame_sdl2/event.pyx":278 * * * cdef bint has_event(kinds): # <<<<<<<<<<<<<< * """ * Returns true if at least one event in the queue has a type in `kinds`, */ /* function exit code */ __pyx_r = 0; goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_4); __Pyx_WriteUnraisable("pygame_sdl2.event.has_event", __pyx_clineno, __pyx_lineno, __pyx_filename, 0, 0); __pyx_r = 0; __pyx_L0:; __Pyx_XDECREF(__pyx_v_i); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/event.pyx":291 * * * cdef object get_events(kinds): # <<<<<<<<<<<<<< * """ * Returns a list containing all events in the event queue with type `kinds`. */ static PyObject *__pyx_f_11pygame_sdl2_5event_get_events(PyObject *__pyx_v_kinds) { PyObject *__pyx_v_rv = 0; PyObject *__pyx_v_new_queue = 0; PyObject *__pyx_v_i = NULL; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; int __pyx_t_2; int __pyx_t_3; PyObject *__pyx_t_4 = NULL; Py_ssize_t __pyx_t_5; PyObject *(*__pyx_t_6)(PyObject *); PyObject *__pyx_t_7 = NULL; int __pyx_t_8; __Pyx_RefNannySetupContext("get_events", 0); __Pyx_INCREF(__pyx_v_kinds); /* "pygame_sdl2/event.pyx":299 * """ * * if isinstance(kinds, (int, long)): # <<<<<<<<<<<<<< * kinds = [ kinds ] * */ __pyx_t_2 = PyInt_Check(__pyx_v_kinds); __pyx_t_3 = (__pyx_t_2 != 0); if (!__pyx_t_3) { } else { __pyx_t_1 = __pyx_t_3; goto __pyx_L4_bool_binop_done; } __pyx_t_3 = PyLong_Check(__pyx_v_kinds); __pyx_t_2 = (__pyx_t_3 != 0); __pyx_t_1 = __pyx_t_2; __pyx_L4_bool_binop_done:; __pyx_t_2 = (__pyx_t_1 != 0); if (__pyx_t_2) { /* "pygame_sdl2/event.pyx":300 * * if isinstance(kinds, (int, long)): * kinds = [ kinds ] # <<<<<<<<<<<<<< * * global event_queue */ __pyx_t_4 = PyList_New(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 300, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_INCREF(__pyx_v_kinds); __Pyx_GIVEREF(__pyx_v_kinds); PyList_SET_ITEM(__pyx_t_4, 0, __pyx_v_kinds); __Pyx_DECREF_SET(__pyx_v_kinds, __pyx_t_4); __pyx_t_4 = 0; /* "pygame_sdl2/event.pyx":299 * """ * * if isinstance(kinds, (int, long)): # <<<<<<<<<<<<<< * kinds = [ kinds ] * */ } /* "pygame_sdl2/event.pyx":304 * global event_queue * * cdef list rv = [ ] # <<<<<<<<<<<<<< * cdef list new_queue = [ ] * */ __pyx_t_4 = PyList_New(0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 304, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_v_rv = ((PyObject*)__pyx_t_4); __pyx_t_4 = 0; /* "pygame_sdl2/event.pyx":305 * * cdef list rv = [ ] * cdef list new_queue = [ ] # <<<<<<<<<<<<<< * * for i in event_queue: */ __pyx_t_4 = PyList_New(0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 305, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_v_new_queue = ((PyObject*)__pyx_t_4); __pyx_t_4 = 0; /* "pygame_sdl2/event.pyx":307 * cdef list new_queue = [ ] * * for i in event_queue: # <<<<<<<<<<<<<< * if i._type in kinds: * rv.append(i) */ if (likely(PyList_CheckExact(event_queue)) || PyTuple_CheckExact(event_queue)) { __pyx_t_4 = event_queue; __Pyx_INCREF(__pyx_t_4); __pyx_t_5 = 0; __pyx_t_6 = NULL; } else { __pyx_t_5 = -1; __pyx_t_4 = PyObject_GetIter(event_queue); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 307, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_6 = Py_TYPE(__pyx_t_4)->tp_iternext; if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 307, __pyx_L1_error) } for (;;) { if (likely(!__pyx_t_6)) { if (likely(PyList_CheckExact(__pyx_t_4))) { if (__pyx_t_5 >= PyList_GET_SIZE(__pyx_t_4)) break; #if CYTHON_COMPILING_IN_CPYTHON __pyx_t_7 = PyList_GET_ITEM(__pyx_t_4, __pyx_t_5); __Pyx_INCREF(__pyx_t_7); __pyx_t_5++; if (unlikely(0 < 0)) __PYX_ERR(0, 307, __pyx_L1_error) #else __pyx_t_7 = PySequence_ITEM(__pyx_t_4, __pyx_t_5); __pyx_t_5++; if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 307, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); #endif } else { if (__pyx_t_5 >= PyTuple_GET_SIZE(__pyx_t_4)) break; #if CYTHON_COMPILING_IN_CPYTHON __pyx_t_7 = PyTuple_GET_ITEM(__pyx_t_4, __pyx_t_5); __Pyx_INCREF(__pyx_t_7); __pyx_t_5++; if (unlikely(0 < 0)) __PYX_ERR(0, 307, __pyx_L1_error) #else __pyx_t_7 = PySequence_ITEM(__pyx_t_4, __pyx_t_5); __pyx_t_5++; if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 307, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); #endif } } else { __pyx_t_7 = __pyx_t_6(__pyx_t_4); if (unlikely(!__pyx_t_7)) { PyObject* exc_type = PyErr_Occurred(); if (exc_type) { if (likely(exc_type == PyExc_StopIteration || PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); else __PYX_ERR(0, 307, __pyx_L1_error) } break; } __Pyx_GOTREF(__pyx_t_7); } __Pyx_XDECREF_SET(__pyx_v_i, __pyx_t_7); __pyx_t_7 = 0; /* "pygame_sdl2/event.pyx":308 * * for i in event_queue: * if i._type in kinds: # <<<<<<<<<<<<<< * rv.append(i) * else: */ __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_v_i, __pyx_n_s_type_2); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 308, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __pyx_t_2 = (__Pyx_PySequence_ContainsTF(__pyx_t_7, __pyx_v_kinds, Py_EQ)); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 308, __pyx_L1_error) __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __pyx_t_1 = (__pyx_t_2 != 0); if (__pyx_t_1) { /* "pygame_sdl2/event.pyx":309 * for i in event_queue: * if i._type in kinds: * rv.append(i) # <<<<<<<<<<<<<< * else: * new_queue.append(i) */ __pyx_t_8 = __Pyx_PyList_Append(__pyx_v_rv, __pyx_v_i); if (unlikely(__pyx_t_8 == -1)) __PYX_ERR(0, 309, __pyx_L1_error) /* "pygame_sdl2/event.pyx":308 * * for i in event_queue: * if i._type in kinds: # <<<<<<<<<<<<<< * rv.append(i) * else: */ goto __pyx_L8; } /* "pygame_sdl2/event.pyx":311 * rv.append(i) * else: * new_queue.append(i) # <<<<<<<<<<<<<< * * event_queue = new_queue */ /*else*/ { __pyx_t_8 = __Pyx_PyList_Append(__pyx_v_new_queue, __pyx_v_i); if (unlikely(__pyx_t_8 == -1)) __PYX_ERR(0, 311, __pyx_L1_error) } __pyx_L8:; /* "pygame_sdl2/event.pyx":307 * cdef list new_queue = [ ] * * for i in event_queue: # <<<<<<<<<<<<<< * if i._type in kinds: * rv.append(i) */ } __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; /* "pygame_sdl2/event.pyx":313 * new_queue.append(i) * * event_queue = new_queue # <<<<<<<<<<<<<< * * return rv */ __Pyx_INCREF(__pyx_v_new_queue); __Pyx_XGOTREF(event_queue); __Pyx_DECREF_SET(event_queue, __pyx_v_new_queue); __Pyx_GIVEREF(__pyx_v_new_queue); /* "pygame_sdl2/event.pyx":315 * event_queue = new_queue * * return rv # <<<<<<<<<<<<<< * * */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(__pyx_v_rv); __pyx_r = __pyx_v_rv; goto __pyx_L0; /* "pygame_sdl2/event.pyx":291 * * * cdef object get_events(kinds): # <<<<<<<<<<<<<< * """ * Returns a list containing all events in the event queue with type `kinds`. */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_7); __Pyx_AddTraceback("pygame_sdl2.event.get_events", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XDECREF(__pyx_v_rv); __Pyx_XDECREF(__pyx_v_new_queue); __Pyx_XDECREF(__pyx_v_i); __Pyx_XDECREF(__pyx_v_kinds); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/event.pyx":318 * * * cdef int poll_sdl() except 1: # <<<<<<<<<<<<<< * """ * Polls SDL for pending events, and places those events onto the event q */ static int __pyx_f_11pygame_sdl2_5event_poll_sdl(void) { SDL_Event __pyx_v_evt; int __pyx_r; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; PyObject *__pyx_t_5 = NULL; PyObject *__pyx_t_6 = NULL; PyObject *__pyx_t_7 = NULL; PyObject *__pyx_t_8 = NULL; int __pyx_t_9; int __pyx_t_10; PyObject *__pyx_t_11 = NULL; int __pyx_t_12; __Pyx_RefNannySetupContext("poll_sdl", 0); /* "pygame_sdl2/event.pyx":326 * cdef SDL_Event evt * * with lock: # <<<<<<<<<<<<<< * while SDL_PollEvent(&evt): * event_queue.append(make_event(&evt)) */ /*with:*/ { __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_lock); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 326, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = __Pyx_PyObject_LookupSpecial(__pyx_t_1, __pyx_n_s_exit); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 326, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_4 = __Pyx_PyObject_LookupSpecial(__pyx_t_1, __pyx_n_s_enter); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 326, __pyx_L3_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_5 = NULL; if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_4))) { __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4); if (likely(__pyx_t_5)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4); __Pyx_INCREF(__pyx_t_5); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_4, function); } } if (__pyx_t_5) { __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_5); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 326, __pyx_L3_error) __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; } else { __pyx_t_3 = __Pyx_PyObject_CallNoArg(__pyx_t_4); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 326, __pyx_L3_error) } __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /*try:*/ { { __Pyx_PyThreadState_declare __Pyx_PyThreadState_assign __Pyx_ExceptionSave(&__pyx_t_6, &__pyx_t_7, &__pyx_t_8); __Pyx_XGOTREF(__pyx_t_6); __Pyx_XGOTREF(__pyx_t_7); __Pyx_XGOTREF(__pyx_t_8); /*try:*/ { /* "pygame_sdl2/event.pyx":327 * * with lock: * while SDL_PollEvent(&evt): # <<<<<<<<<<<<<< * event_queue.append(make_event(&evt)) * */ while (1) { __pyx_t_9 = (SDL_PollEvent((&__pyx_v_evt)) != 0); if (!__pyx_t_9) break; /* "pygame_sdl2/event.pyx":328 * with lock: * while SDL_PollEvent(&evt): * event_queue.append(make_event(&evt)) # <<<<<<<<<<<<<< * * return 0 */ __pyx_t_1 = __pyx_f_11pygame_sdl2_5event_make_event((&__pyx_v_evt)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 328, __pyx_L7_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_10 = __Pyx_PyObject_Append(event_queue, __pyx_t_1); if (unlikely(__pyx_t_10 == -1)) __PYX_ERR(0, 328, __pyx_L7_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; } /* "pygame_sdl2/event.pyx":326 * cdef SDL_Event evt * * with lock: # <<<<<<<<<<<<<< * while SDL_PollEvent(&evt): * event_queue.append(make_event(&evt)) */ } __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0; goto __pyx_L14_try_end; __pyx_L7_error:; __Pyx_PyThreadState_assign __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; /*except:*/ { __Pyx_AddTraceback("pygame_sdl2.event.poll_sdl", __pyx_clineno, __pyx_lineno, __pyx_filename); if (__Pyx_GetException(&__pyx_t_1, &__pyx_t_3, &__pyx_t_4) < 0) __PYX_ERR(0, 326, __pyx_L9_except_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_GOTREF(__pyx_t_3); __Pyx_GOTREF(__pyx_t_4); __pyx_t_5 = PyTuple_Pack(3, __pyx_t_1, __pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 326, __pyx_L9_except_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_11 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_5, NULL); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 326, __pyx_L9_except_error) __Pyx_GOTREF(__pyx_t_11); __pyx_t_9 = __Pyx_PyObject_IsTrue(__pyx_t_11); __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; if (__pyx_t_9 < 0) __PYX_ERR(0, 326, __pyx_L9_except_error) __pyx_t_12 = ((!(__pyx_t_9 != 0)) != 0); if (__pyx_t_12) { __Pyx_GIVEREF(__pyx_t_1); __Pyx_GIVEREF(__pyx_t_3); __Pyx_XGIVEREF(__pyx_t_4); __Pyx_ErrRestoreWithState(__pyx_t_1, __pyx_t_3, __pyx_t_4); __pyx_t_1 = 0; __pyx_t_3 = 0; __pyx_t_4 = 0; __PYX_ERR(0, 326, __pyx_L9_except_error) } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; goto __pyx_L8_exception_handled; } __pyx_L9_except_error:; __Pyx_PyThreadState_assign __Pyx_XGIVEREF(__pyx_t_6); __Pyx_XGIVEREF(__pyx_t_7); __Pyx_XGIVEREF(__pyx_t_8); __Pyx_ExceptionReset(__pyx_t_6, __pyx_t_7, __pyx_t_8); goto __pyx_L1_error; __pyx_L8_exception_handled:; __Pyx_PyThreadState_assign __Pyx_XGIVEREF(__pyx_t_6); __Pyx_XGIVEREF(__pyx_t_7); __Pyx_XGIVEREF(__pyx_t_8); __Pyx_ExceptionReset(__pyx_t_6, __pyx_t_7, __pyx_t_8); __pyx_L14_try_end:; } } /*finally:*/ { /*normal exit:*/{ if (__pyx_t_2) { __pyx_t_8 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_tuple__3, NULL); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 326, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; } goto __pyx_L6; } __pyx_L6:; } goto __pyx_L20; __pyx_L3_error:; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; goto __pyx_L1_error; __pyx_L20:; } /* "pygame_sdl2/event.pyx":330 * event_queue.append(make_event(&evt)) * * return 0 # <<<<<<<<<<<<<< * * */ __pyx_r = 0; goto __pyx_L0; /* "pygame_sdl2/event.pyx":318 * * * cdef int poll_sdl() except 1: # <<<<<<<<<<<<<< * """ * Polls SDL for pending events, and places those events onto the event q */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_5); __Pyx_AddTraceback("pygame_sdl2.event.poll_sdl", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 1; __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/event.pyx":333 * * * def pump(): # <<<<<<<<<<<<<< * with lock: * poll_sdl() */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_5event_1pump(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused); /*proto*/ static PyMethodDef __pyx_mdef_11pygame_sdl2_5event_1pump = {"pump", (PyCFunction)__pyx_pw_11pygame_sdl2_5event_1pump, METH_NOARGS, 0}; static PyObject *__pyx_pw_11pygame_sdl2_5event_1pump(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("pump (wrapper)", 0); __pyx_r = __pyx_pf_11pygame_sdl2_5event_pump(__pyx_self); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_5event_pump(CYTHON_UNUSED PyObject *__pyx_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; PyObject *__pyx_t_5 = NULL; PyObject *__pyx_t_6 = NULL; PyObject *__pyx_t_7 = NULL; PyObject *__pyx_t_8 = NULL; int __pyx_t_9; PyObject *__pyx_t_10 = NULL; int __pyx_t_11; int __pyx_t_12; __Pyx_RefNannySetupContext("pump", 0); /* "pygame_sdl2/event.pyx":334 * * def pump(): * with lock: # <<<<<<<<<<<<<< * poll_sdl() * */ /*with:*/ { __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_lock); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 334, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = __Pyx_PyObject_LookupSpecial(__pyx_t_1, __pyx_n_s_exit); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 334, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_4 = __Pyx_PyObject_LookupSpecial(__pyx_t_1, __pyx_n_s_enter); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 334, __pyx_L3_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_5 = NULL; if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_4))) { __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4); if (likely(__pyx_t_5)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4); __Pyx_INCREF(__pyx_t_5); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_4, function); } } if (__pyx_t_5) { __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_5); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 334, __pyx_L3_error) __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; } else { __pyx_t_3 = __Pyx_PyObject_CallNoArg(__pyx_t_4); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 334, __pyx_L3_error) } __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /*try:*/ { { __Pyx_PyThreadState_declare __Pyx_PyThreadState_assign __Pyx_ExceptionSave(&__pyx_t_6, &__pyx_t_7, &__pyx_t_8); __Pyx_XGOTREF(__pyx_t_6); __Pyx_XGOTREF(__pyx_t_7); __Pyx_XGOTREF(__pyx_t_8); /*try:*/ { /* "pygame_sdl2/event.pyx":335 * def pump(): * with lock: * poll_sdl() # <<<<<<<<<<<<<< * * */ __pyx_t_9 = __pyx_f_11pygame_sdl2_5event_poll_sdl(); if (unlikely(__pyx_t_9 == 1)) __PYX_ERR(0, 335, __pyx_L7_error) /* "pygame_sdl2/event.pyx":334 * * def pump(): * with lock: # <<<<<<<<<<<<<< * poll_sdl() * */ } __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0; goto __pyx_L14_try_end; __pyx_L7_error:; __Pyx_PyThreadState_assign __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; /*except:*/ { __Pyx_AddTraceback("pygame_sdl2.event.pump", __pyx_clineno, __pyx_lineno, __pyx_filename); if (__Pyx_GetException(&__pyx_t_1, &__pyx_t_3, &__pyx_t_4) < 0) __PYX_ERR(0, 334, __pyx_L9_except_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_GOTREF(__pyx_t_3); __Pyx_GOTREF(__pyx_t_4); __pyx_t_5 = PyTuple_Pack(3, __pyx_t_1, __pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 334, __pyx_L9_except_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_10 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_5, NULL); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 334, __pyx_L9_except_error) __Pyx_GOTREF(__pyx_t_10); __pyx_t_11 = __Pyx_PyObject_IsTrue(__pyx_t_10); __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; if (__pyx_t_11 < 0) __PYX_ERR(0, 334, __pyx_L9_except_error) __pyx_t_12 = ((!(__pyx_t_11 != 0)) != 0); if (__pyx_t_12) { __Pyx_GIVEREF(__pyx_t_1); __Pyx_GIVEREF(__pyx_t_3); __Pyx_XGIVEREF(__pyx_t_4); __Pyx_ErrRestoreWithState(__pyx_t_1, __pyx_t_3, __pyx_t_4); __pyx_t_1 = 0; __pyx_t_3 = 0; __pyx_t_4 = 0; __PYX_ERR(0, 334, __pyx_L9_except_error) } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; goto __pyx_L8_exception_handled; } __pyx_L9_except_error:; __Pyx_PyThreadState_assign __Pyx_XGIVEREF(__pyx_t_6); __Pyx_XGIVEREF(__pyx_t_7); __Pyx_XGIVEREF(__pyx_t_8); __Pyx_ExceptionReset(__pyx_t_6, __pyx_t_7, __pyx_t_8); goto __pyx_L1_error; __pyx_L8_exception_handled:; __Pyx_PyThreadState_assign __Pyx_XGIVEREF(__pyx_t_6); __Pyx_XGIVEREF(__pyx_t_7); __Pyx_XGIVEREF(__pyx_t_8); __Pyx_ExceptionReset(__pyx_t_6, __pyx_t_7, __pyx_t_8); __pyx_L14_try_end:; } } /*finally:*/ { /*normal exit:*/{ if (__pyx_t_2) { __pyx_t_8 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_tuple__4, NULL); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 334, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; } goto __pyx_L6; } __pyx_L6:; } goto __pyx_L18; __pyx_L3_error:; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; goto __pyx_L1_error; __pyx_L18:; } /* "pygame_sdl2/event.pyx":333 * * * def pump(): # <<<<<<<<<<<<<< * with lock: * poll_sdl() */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_5); __Pyx_AddTraceback("pygame_sdl2.event.pump", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/event.pyx":338 * * * def get(t=None): # <<<<<<<<<<<<<< * * global event_queue */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_5event_3get(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static PyMethodDef __pyx_mdef_11pygame_sdl2_5event_3get = {"get", (PyCFunction)__pyx_pw_11pygame_sdl2_5event_3get, METH_VARARGS|METH_KEYWORDS, 0}; static PyObject *__pyx_pw_11pygame_sdl2_5event_3get(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_t = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("get (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_t,0}; PyObject* values[1] = {0}; values[0] = ((PyObject *)Py_None); if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (kw_args > 0) { PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_t); if (value) { values[0] = value; kw_args--; } } } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "get") < 0)) __PYX_ERR(0, 338, __pyx_L3_error) } } else { switch (PyTuple_GET_SIZE(__pyx_args)) { case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); case 0: break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_t = values[0]; } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("get", 0, 0, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 338, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("pygame_sdl2.event.get", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_11pygame_sdl2_5event_2get(__pyx_self, __pyx_v_t); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_5event_2get(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_t) { PyObject *__pyx_v_rv = NULL; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; PyObject *__pyx_t_5 = NULL; PyObject *__pyx_t_6 = NULL; PyObject *__pyx_t_7 = NULL; PyObject *__pyx_t_8 = NULL; int __pyx_t_9; int __pyx_t_10; int __pyx_t_11; PyObject *__pyx_t_12 = NULL; __Pyx_RefNannySetupContext("get", 0); /* "pygame_sdl2/event.pyx":342 * global event_queue * * with lock: # <<<<<<<<<<<<<< * poll_sdl() * */ /*with:*/ { __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_lock); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 342, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = __Pyx_PyObject_LookupSpecial(__pyx_t_1, __pyx_n_s_exit); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 342, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_4 = __Pyx_PyObject_LookupSpecial(__pyx_t_1, __pyx_n_s_enter); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 342, __pyx_L3_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_5 = NULL; if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_4))) { __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4); if (likely(__pyx_t_5)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4); __Pyx_INCREF(__pyx_t_5); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_4, function); } } if (__pyx_t_5) { __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_5); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 342, __pyx_L3_error) __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; } else { __pyx_t_3 = __Pyx_PyObject_CallNoArg(__pyx_t_4); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 342, __pyx_L3_error) } __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /*try:*/ { { __Pyx_PyThreadState_declare __Pyx_PyThreadState_assign __Pyx_ExceptionSave(&__pyx_t_6, &__pyx_t_7, &__pyx_t_8); __Pyx_XGOTREF(__pyx_t_6); __Pyx_XGOTREF(__pyx_t_7); __Pyx_XGOTREF(__pyx_t_8); /*try:*/ { /* "pygame_sdl2/event.pyx":343 * * with lock: * poll_sdl() # <<<<<<<<<<<<<< * * if t is None: */ __pyx_t_9 = __pyx_f_11pygame_sdl2_5event_poll_sdl(); if (unlikely(__pyx_t_9 == 1)) __PYX_ERR(0, 343, __pyx_L7_error) /* "pygame_sdl2/event.pyx":345 * poll_sdl() * * if t is None: # <<<<<<<<<<<<<< * rv = event_queue * event_queue = [ ] */ __pyx_t_10 = (__pyx_v_t == Py_None); __pyx_t_11 = (__pyx_t_10 != 0); if (__pyx_t_11) { /* "pygame_sdl2/event.pyx":346 * * if t is None: * rv = event_queue # <<<<<<<<<<<<<< * event_queue = [ ] * */ __Pyx_INCREF(event_queue); __pyx_v_rv = event_queue; /* "pygame_sdl2/event.pyx":347 * if t is None: * rv = event_queue * event_queue = [ ] # <<<<<<<<<<<<<< * * elif isinstance(t, int): */ __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 347, __pyx_L7_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_XGOTREF(event_queue); __Pyx_DECREF_SET(event_queue, __pyx_t_1); __Pyx_GIVEREF(__pyx_t_1); __pyx_t_1 = 0; /* "pygame_sdl2/event.pyx":345 * poll_sdl() * * if t is None: # <<<<<<<<<<<<<< * rv = event_queue * event_queue = [ ] */ goto __pyx_L15; } /* "pygame_sdl2/event.pyx":349 * event_queue = [ ] * * elif isinstance(t, int): # <<<<<<<<<<<<<< * rv = get_events(( t, )) * */ __pyx_t_11 = PyInt_Check(__pyx_v_t); __pyx_t_10 = (__pyx_t_11 != 0); if (__pyx_t_10) { /* "pygame_sdl2/event.pyx":350 * * elif isinstance(t, int): * rv = get_events(( t, )) # <<<<<<<<<<<<<< * * else: */ __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 350, __pyx_L7_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_INCREF(__pyx_v_t); __Pyx_GIVEREF(__pyx_v_t); PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_t); __pyx_t_3 = __pyx_f_11pygame_sdl2_5event_get_events(__pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 350, __pyx_L7_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_v_rv = __pyx_t_3; __pyx_t_3 = 0; /* "pygame_sdl2/event.pyx":349 * event_queue = [ ] * * elif isinstance(t, int): # <<<<<<<<<<<<<< * rv = get_events(( t, )) * */ goto __pyx_L15; } /* "pygame_sdl2/event.pyx":353 * * else: * rv = get_events(t) # <<<<<<<<<<<<<< * * return rv */ /*else*/ { __pyx_t_3 = __pyx_f_11pygame_sdl2_5event_get_events(__pyx_v_t); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 353, __pyx_L7_error) __Pyx_GOTREF(__pyx_t_3); __pyx_v_rv = __pyx_t_3; __pyx_t_3 = 0; } __pyx_L15:; /* "pygame_sdl2/event.pyx":342 * global event_queue * * with lock: # <<<<<<<<<<<<<< * poll_sdl() * */ } __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0; goto __pyx_L14_try_end; __pyx_L7_error:; __Pyx_PyThreadState_assign __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; /*except:*/ { __Pyx_AddTraceback("pygame_sdl2.event.get", __pyx_clineno, __pyx_lineno, __pyx_filename); if (__Pyx_GetException(&__pyx_t_3, &__pyx_t_1, &__pyx_t_4) < 0) __PYX_ERR(0, 342, __pyx_L9_except_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_GOTREF(__pyx_t_1); __Pyx_GOTREF(__pyx_t_4); __pyx_t_5 = PyTuple_Pack(3, __pyx_t_3, __pyx_t_1, __pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 342, __pyx_L9_except_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_12 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_5, NULL); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 342, __pyx_L9_except_error) __Pyx_GOTREF(__pyx_t_12); __pyx_t_10 = __Pyx_PyObject_IsTrue(__pyx_t_12); __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; if (__pyx_t_10 < 0) __PYX_ERR(0, 342, __pyx_L9_except_error) __pyx_t_11 = ((!(__pyx_t_10 != 0)) != 0); if (__pyx_t_11) { __Pyx_GIVEREF(__pyx_t_3); __Pyx_GIVEREF(__pyx_t_1); __Pyx_XGIVEREF(__pyx_t_4); __Pyx_ErrRestoreWithState(__pyx_t_3, __pyx_t_1, __pyx_t_4); __pyx_t_3 = 0; __pyx_t_1 = 0; __pyx_t_4 = 0; __PYX_ERR(0, 342, __pyx_L9_except_error) } __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; goto __pyx_L8_exception_handled; } __pyx_L9_except_error:; __Pyx_PyThreadState_assign __Pyx_XGIVEREF(__pyx_t_6); __Pyx_XGIVEREF(__pyx_t_7); __Pyx_XGIVEREF(__pyx_t_8); __Pyx_ExceptionReset(__pyx_t_6, __pyx_t_7, __pyx_t_8); goto __pyx_L1_error; __pyx_L8_exception_handled:; __Pyx_PyThreadState_assign __Pyx_XGIVEREF(__pyx_t_6); __Pyx_XGIVEREF(__pyx_t_7); __Pyx_XGIVEREF(__pyx_t_8); __Pyx_ExceptionReset(__pyx_t_6, __pyx_t_7, __pyx_t_8); __pyx_L14_try_end:; } } /*finally:*/ { /*normal exit:*/{ if (__pyx_t_2) { __pyx_t_8 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_tuple__5, NULL); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 342, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; } goto __pyx_L6; } __pyx_L6:; } goto __pyx_L19; __pyx_L3_error:; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; goto __pyx_L1_error; __pyx_L19:; } /* "pygame_sdl2/event.pyx":355 * rv = get_events(t) * * return rv # <<<<<<<<<<<<<< * * */ __Pyx_XDECREF(__pyx_r); if (unlikely(!__pyx_v_rv)) { __Pyx_RaiseUnboundLocalError("rv"); __PYX_ERR(0, 355, __pyx_L1_error) } __Pyx_INCREF(__pyx_v_rv); __pyx_r = __pyx_v_rv; goto __pyx_L0; /* "pygame_sdl2/event.pyx":338 * * * def get(t=None): # <<<<<<<<<<<<<< * * global event_queue */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_5); __Pyx_AddTraceback("pygame_sdl2.event.get", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF(__pyx_v_rv); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/event.pyx":358 * * * def poll(): # <<<<<<<<<<<<<< * * with lock: */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_5event_5poll(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused); /*proto*/ static PyMethodDef __pyx_mdef_11pygame_sdl2_5event_5poll = {"poll", (PyCFunction)__pyx_pw_11pygame_sdl2_5event_5poll, METH_NOARGS, 0}; static PyObject *__pyx_pw_11pygame_sdl2_5event_5poll(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("poll (wrapper)", 0); __pyx_r = __pyx_pf_11pygame_sdl2_5event_4poll(__pyx_self); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_5event_4poll(CYTHON_UNUSED PyObject *__pyx_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; PyObject *__pyx_t_5 = NULL; PyObject *__pyx_t_6 = NULL; PyObject *__pyx_t_7 = NULL; PyObject *__pyx_t_8 = NULL; int __pyx_t_9; int __pyx_t_10; PyObject *__pyx_t_11 = NULL; int __pyx_t_12; __Pyx_RefNannySetupContext("poll", 0); /* "pygame_sdl2/event.pyx":360 * def poll(): * * with lock: # <<<<<<<<<<<<<< * poll_sdl() * */ /*with:*/ { __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_lock); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 360, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = __Pyx_PyObject_LookupSpecial(__pyx_t_1, __pyx_n_s_exit); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 360, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_4 = __Pyx_PyObject_LookupSpecial(__pyx_t_1, __pyx_n_s_enter); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 360, __pyx_L3_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_5 = NULL; if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_4))) { __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4); if (likely(__pyx_t_5)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4); __Pyx_INCREF(__pyx_t_5); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_4, function); } } if (__pyx_t_5) { __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_5); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 360, __pyx_L3_error) __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; } else { __pyx_t_3 = __Pyx_PyObject_CallNoArg(__pyx_t_4); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 360, __pyx_L3_error) } __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /*try:*/ { { __Pyx_PyThreadState_declare __Pyx_PyThreadState_assign __Pyx_ExceptionSave(&__pyx_t_6, &__pyx_t_7, &__pyx_t_8); __Pyx_XGOTREF(__pyx_t_6); __Pyx_XGOTREF(__pyx_t_7); __Pyx_XGOTREF(__pyx_t_8); /*try:*/ { /* "pygame_sdl2/event.pyx":361 * * with lock: * poll_sdl() # <<<<<<<<<<<<<< * * if event_queue: */ __pyx_t_9 = __pyx_f_11pygame_sdl2_5event_poll_sdl(); if (unlikely(__pyx_t_9 == 1)) __PYX_ERR(0, 361, __pyx_L7_error) /* "pygame_sdl2/event.pyx":363 * poll_sdl() * * if event_queue: # <<<<<<<<<<<<<< * return event_queue.pop(0) * */ __pyx_t_10 = __Pyx_PyObject_IsTrue(event_queue); if (unlikely(__pyx_t_10 < 0)) __PYX_ERR(0, 363, __pyx_L7_error) if (__pyx_t_10) { /* "pygame_sdl2/event.pyx":364 * * if event_queue: * return event_queue.pop(0) # <<<<<<<<<<<<<< * * return NOEVENT_EVENT */ __Pyx_XDECREF(__pyx_r); __pyx_t_1 = __Pyx_PyObject_PopIndex(event_queue, __pyx_int_0, 0, 1, Py_ssize_t, PyInt_FromSsize_t); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 364, __pyx_L7_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L11_try_return; /* "pygame_sdl2/event.pyx":363 * poll_sdl() * * if event_queue: # <<<<<<<<<<<<<< * return event_queue.pop(0) * */ } /* "pygame_sdl2/event.pyx":366 * return event_queue.pop(0) * * return NOEVENT_EVENT # <<<<<<<<<<<<<< * * */ __Pyx_XDECREF(__pyx_r); __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_NOEVENT_EVENT); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 366, __pyx_L7_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L11_try_return; /* "pygame_sdl2/event.pyx":360 * def poll(): * * with lock: # <<<<<<<<<<<<<< * poll_sdl() * */ } __pyx_L7_error:; __Pyx_PyThreadState_assign __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; /*except:*/ { __Pyx_AddTraceback("pygame_sdl2.event.poll", __pyx_clineno, __pyx_lineno, __pyx_filename); if (__Pyx_GetException(&__pyx_t_1, &__pyx_t_3, &__pyx_t_4) < 0) __PYX_ERR(0, 360, __pyx_L9_except_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_GOTREF(__pyx_t_3); __Pyx_GOTREF(__pyx_t_4); __pyx_t_5 = PyTuple_Pack(3, __pyx_t_1, __pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 360, __pyx_L9_except_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_11 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_5, NULL); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 360, __pyx_L9_except_error) __Pyx_GOTREF(__pyx_t_11); __pyx_t_10 = __Pyx_PyObject_IsTrue(__pyx_t_11); __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; if (__pyx_t_10 < 0) __PYX_ERR(0, 360, __pyx_L9_except_error) __pyx_t_12 = ((!(__pyx_t_10 != 0)) != 0); if (__pyx_t_12) { __Pyx_GIVEREF(__pyx_t_1); __Pyx_GIVEREF(__pyx_t_3); __Pyx_XGIVEREF(__pyx_t_4); __Pyx_ErrRestoreWithState(__pyx_t_1, __pyx_t_3, __pyx_t_4); __pyx_t_1 = 0; __pyx_t_3 = 0; __pyx_t_4 = 0; __PYX_ERR(0, 360, __pyx_L9_except_error) } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; goto __pyx_L8_exception_handled; } __pyx_L9_except_error:; __Pyx_PyThreadState_assign __Pyx_XGIVEREF(__pyx_t_6); __Pyx_XGIVEREF(__pyx_t_7); __Pyx_XGIVEREF(__pyx_t_8); __Pyx_ExceptionReset(__pyx_t_6, __pyx_t_7, __pyx_t_8); goto __pyx_L1_error; __pyx_L11_try_return:; __Pyx_PyThreadState_assign __Pyx_XGIVEREF(__pyx_t_6); __Pyx_XGIVEREF(__pyx_t_7); __Pyx_XGIVEREF(__pyx_t_8); __Pyx_ExceptionReset(__pyx_t_6, __pyx_t_7, __pyx_t_8); goto __pyx_L4_return; __pyx_L8_exception_handled:; __Pyx_PyThreadState_assign __Pyx_XGIVEREF(__pyx_t_6); __Pyx_XGIVEREF(__pyx_t_7); __Pyx_XGIVEREF(__pyx_t_8); __Pyx_ExceptionReset(__pyx_t_6, __pyx_t_7, __pyx_t_8); } } /*finally:*/ { /*normal exit:*/{ if (__pyx_t_2) { __pyx_t_8 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_tuple__6, NULL); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 360, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; } goto __pyx_L6; } __pyx_L4_return: { __pyx_t_8 = __pyx_r; __pyx_r = 0; if (__pyx_t_2) { __pyx_t_7 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_tuple__7, NULL); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 360, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; } __pyx_r = __pyx_t_8; __pyx_t_8 = 0; goto __pyx_L0; } __pyx_L6:; } goto __pyx_L19; __pyx_L3_error:; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; goto __pyx_L1_error; __pyx_L19:; } /* "pygame_sdl2/event.pyx":358 * * * def poll(): # <<<<<<<<<<<<<< * * with lock: */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_5); __Pyx_AddTraceback("pygame_sdl2.event.poll", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/event.pyx":369 * * * def wait(): # <<<<<<<<<<<<<< * * cdef SDL_Event evt */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_5event_7wait(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused); /*proto*/ static PyMethodDef __pyx_mdef_11pygame_sdl2_5event_7wait = {"wait", (PyCFunction)__pyx_pw_11pygame_sdl2_5event_7wait, METH_NOARGS, 0}; static PyObject *__pyx_pw_11pygame_sdl2_5event_7wait(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("wait (wrapper)", 0); __pyx_r = __pyx_pf_11pygame_sdl2_5event_6wait(__pyx_self); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_5event_6wait(CYTHON_UNUSED PyObject *__pyx_self) { SDL_Event __pyx_v_evt; int __pyx_v_result; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; PyObject *__pyx_t_5 = NULL; PyObject *__pyx_t_6 = NULL; PyObject *__pyx_t_7 = NULL; PyObject *__pyx_t_8 = NULL; int __pyx_t_9; int __pyx_t_10; PyObject *__pyx_t_11 = NULL; int __pyx_t_12; __Pyx_RefNannySetupContext("wait", 0); /* "pygame_sdl2/event.pyx":374 * cdef int result * * with lock: # <<<<<<<<<<<<<< * poll_sdl() * */ /*with:*/ { __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_lock); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 374, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = __Pyx_PyObject_LookupSpecial(__pyx_t_1, __pyx_n_s_exit); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 374, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_4 = __Pyx_PyObject_LookupSpecial(__pyx_t_1, __pyx_n_s_enter); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 374, __pyx_L3_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_5 = NULL; if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_4))) { __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4); if (likely(__pyx_t_5)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4); __Pyx_INCREF(__pyx_t_5); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_4, function); } } if (__pyx_t_5) { __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_5); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 374, __pyx_L3_error) __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; } else { __pyx_t_3 = __Pyx_PyObject_CallNoArg(__pyx_t_4); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 374, __pyx_L3_error) } __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /*try:*/ { { __Pyx_PyThreadState_declare __Pyx_PyThreadState_assign __Pyx_ExceptionSave(&__pyx_t_6, &__pyx_t_7, &__pyx_t_8); __Pyx_XGOTREF(__pyx_t_6); __Pyx_XGOTREF(__pyx_t_7); __Pyx_XGOTREF(__pyx_t_8); /*try:*/ { /* "pygame_sdl2/event.pyx":375 * * with lock: * poll_sdl() # <<<<<<<<<<<<<< * * if event_queue: */ __pyx_t_9 = __pyx_f_11pygame_sdl2_5event_poll_sdl(); if (unlikely(__pyx_t_9 == 1)) __PYX_ERR(0, 375, __pyx_L7_error) /* "pygame_sdl2/event.pyx":377 * poll_sdl() * * if event_queue: # <<<<<<<<<<<<<< * return event_queue.pop(0) * */ __pyx_t_10 = __Pyx_PyObject_IsTrue(event_queue); if (unlikely(__pyx_t_10 < 0)) __PYX_ERR(0, 377, __pyx_L7_error) if (__pyx_t_10) { /* "pygame_sdl2/event.pyx":378 * * if event_queue: * return event_queue.pop(0) # <<<<<<<<<<<<<< * * with nogil: */ __Pyx_XDECREF(__pyx_r); __pyx_t_1 = __Pyx_PyObject_PopIndex(event_queue, __pyx_int_0, 0, 1, Py_ssize_t, PyInt_FromSsize_t); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 378, __pyx_L7_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L11_try_return; /* "pygame_sdl2/event.pyx":377 * poll_sdl() * * if event_queue: # <<<<<<<<<<<<<< * return event_queue.pop(0) * */ } /* "pygame_sdl2/event.pyx":374 * cdef int result * * with lock: # <<<<<<<<<<<<<< * poll_sdl() * */ } __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0; goto __pyx_L14_try_end; __pyx_L7_error:; __Pyx_PyThreadState_assign __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; /*except:*/ { __Pyx_AddTraceback("pygame_sdl2.event.wait", __pyx_clineno, __pyx_lineno, __pyx_filename); if (__Pyx_GetException(&__pyx_t_1, &__pyx_t_3, &__pyx_t_4) < 0) __PYX_ERR(0, 374, __pyx_L9_except_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_GOTREF(__pyx_t_3); __Pyx_GOTREF(__pyx_t_4); __pyx_t_5 = PyTuple_Pack(3, __pyx_t_1, __pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 374, __pyx_L9_except_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_11 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_5, NULL); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 374, __pyx_L9_except_error) __Pyx_GOTREF(__pyx_t_11); __pyx_t_10 = __Pyx_PyObject_IsTrue(__pyx_t_11); __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; if (__pyx_t_10 < 0) __PYX_ERR(0, 374, __pyx_L9_except_error) __pyx_t_12 = ((!(__pyx_t_10 != 0)) != 0); if (__pyx_t_12) { __Pyx_GIVEREF(__pyx_t_1); __Pyx_GIVEREF(__pyx_t_3); __Pyx_XGIVEREF(__pyx_t_4); __Pyx_ErrRestoreWithState(__pyx_t_1, __pyx_t_3, __pyx_t_4); __pyx_t_1 = 0; __pyx_t_3 = 0; __pyx_t_4 = 0; __PYX_ERR(0, 374, __pyx_L9_except_error) } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; goto __pyx_L8_exception_handled; } __pyx_L9_except_error:; __Pyx_PyThreadState_assign __Pyx_XGIVEREF(__pyx_t_6); __Pyx_XGIVEREF(__pyx_t_7); __Pyx_XGIVEREF(__pyx_t_8); __Pyx_ExceptionReset(__pyx_t_6, __pyx_t_7, __pyx_t_8); goto __pyx_L1_error; __pyx_L11_try_return:; __Pyx_PyThreadState_assign __Pyx_XGIVEREF(__pyx_t_6); __Pyx_XGIVEREF(__pyx_t_7); __Pyx_XGIVEREF(__pyx_t_8); __Pyx_ExceptionReset(__pyx_t_6, __pyx_t_7, __pyx_t_8); goto __pyx_L4_return; __pyx_L8_exception_handled:; __Pyx_PyThreadState_assign __Pyx_XGIVEREF(__pyx_t_6); __Pyx_XGIVEREF(__pyx_t_7); __Pyx_XGIVEREF(__pyx_t_8); __Pyx_ExceptionReset(__pyx_t_6, __pyx_t_7, __pyx_t_8); __pyx_L14_try_end:; } } /*finally:*/ { /*normal exit:*/{ if (__pyx_t_2) { __pyx_t_8 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_tuple__8, NULL); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 374, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; } goto __pyx_L6; } __pyx_L4_return: { __pyx_t_8 = __pyx_r; __pyx_r = 0; if (__pyx_t_2) { __pyx_t_7 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_tuple__9, NULL); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 374, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; } __pyx_r = __pyx_t_8; __pyx_t_8 = 0; goto __pyx_L0; } __pyx_L6:; } goto __pyx_L19; __pyx_L3_error:; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; goto __pyx_L1_error; __pyx_L19:; } /* "pygame_sdl2/event.pyx":380 * return event_queue.pop(0) * * with nogil: # <<<<<<<<<<<<<< * result = SDL_WaitEvent(&evt) * */ { #ifdef WITH_THREAD PyThreadState *_save; Py_UNBLOCK_THREADS #endif /*try:*/ { /* "pygame_sdl2/event.pyx":381 * * with nogil: * result = SDL_WaitEvent(&evt) # <<<<<<<<<<<<<< * * if result: */ __pyx_v_result = SDL_WaitEvent((&__pyx_v_evt)); } /* "pygame_sdl2/event.pyx":380 * return event_queue.pop(0) * * with nogil: # <<<<<<<<<<<<<< * result = SDL_WaitEvent(&evt) * */ /*finally:*/ { /*normal exit:*/{ #ifdef WITH_THREAD Py_BLOCK_THREADS #endif goto __pyx_L22; } __pyx_L22:; } } /* "pygame_sdl2/event.pyx":383 * result = SDL_WaitEvent(&evt) * * if result: # <<<<<<<<<<<<<< * return make_event(&evt) * else: */ __pyx_t_12 = (__pyx_v_result != 0); if (__pyx_t_12) { /* "pygame_sdl2/event.pyx":384 * * if result: * return make_event(&evt) # <<<<<<<<<<<<<< * else: * return NOEVENT_EVENT */ __Pyx_XDECREF(__pyx_r); __pyx_t_4 = __pyx_f_11pygame_sdl2_5event_make_event((&__pyx_v_evt)); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 384, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_r = __pyx_t_4; __pyx_t_4 = 0; goto __pyx_L0; /* "pygame_sdl2/event.pyx":383 * result = SDL_WaitEvent(&evt) * * if result: # <<<<<<<<<<<<<< * return make_event(&evt) * else: */ } /* "pygame_sdl2/event.pyx":386 * return make_event(&evt) * else: * return NOEVENT_EVENT # <<<<<<<<<<<<<< * * */ /*else*/ { __Pyx_XDECREF(__pyx_r); __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_NOEVENT_EVENT); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 386, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_r = __pyx_t_4; __pyx_t_4 = 0; goto __pyx_L0; } /* "pygame_sdl2/event.pyx":369 * * * def wait(): # <<<<<<<<<<<<<< * * cdef SDL_Event evt */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_5); __Pyx_AddTraceback("pygame_sdl2.event.wait", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/event.pyx":389 * * * def peek(t=None): # <<<<<<<<<<<<<< * * with lock: */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_5event_9peek(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static PyMethodDef __pyx_mdef_11pygame_sdl2_5event_9peek = {"peek", (PyCFunction)__pyx_pw_11pygame_sdl2_5event_9peek, METH_VARARGS|METH_KEYWORDS, 0}; static PyObject *__pyx_pw_11pygame_sdl2_5event_9peek(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_t = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("peek (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_t,0}; PyObject* values[1] = {0}; values[0] = ((PyObject *)Py_None); if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (kw_args > 0) { PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_t); if (value) { values[0] = value; kw_args--; } } } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "peek") < 0)) __PYX_ERR(0, 389, __pyx_L3_error) } } else { switch (PyTuple_GET_SIZE(__pyx_args)) { case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); case 0: break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_t = values[0]; } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("peek", 0, 0, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 389, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("pygame_sdl2.event.peek", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_11pygame_sdl2_5event_8peek(__pyx_self, __pyx_v_t); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_5event_8peek(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_t) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; PyObject *__pyx_t_5 = NULL; PyObject *__pyx_t_6 = NULL; PyObject *__pyx_t_7 = NULL; PyObject *__pyx_t_8 = NULL; int __pyx_t_9; int __pyx_t_10; int __pyx_t_11; Py_ssize_t __pyx_t_12; PyObject *__pyx_t_13 = NULL; __Pyx_RefNannySetupContext("peek", 0); /* "pygame_sdl2/event.pyx":391 * def peek(t=None): * * with lock: # <<<<<<<<<<<<<< * poll_sdl() * */ /*with:*/ { __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_lock); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 391, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = __Pyx_PyObject_LookupSpecial(__pyx_t_1, __pyx_n_s_exit); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 391, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_4 = __Pyx_PyObject_LookupSpecial(__pyx_t_1, __pyx_n_s_enter); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 391, __pyx_L3_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_5 = NULL; if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_4))) { __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4); if (likely(__pyx_t_5)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4); __Pyx_INCREF(__pyx_t_5); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_4, function); } } if (__pyx_t_5) { __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_5); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 391, __pyx_L3_error) __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; } else { __pyx_t_3 = __Pyx_PyObject_CallNoArg(__pyx_t_4); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 391, __pyx_L3_error) } __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /*try:*/ { { __Pyx_PyThreadState_declare __Pyx_PyThreadState_assign __Pyx_ExceptionSave(&__pyx_t_6, &__pyx_t_7, &__pyx_t_8); __Pyx_XGOTREF(__pyx_t_6); __Pyx_XGOTREF(__pyx_t_7); __Pyx_XGOTREF(__pyx_t_8); /*try:*/ { /* "pygame_sdl2/event.pyx":392 * * with lock: * poll_sdl() # <<<<<<<<<<<<<< * * if t is None: */ __pyx_t_9 = __pyx_f_11pygame_sdl2_5event_poll_sdl(); if (unlikely(__pyx_t_9 == 1)) __PYX_ERR(0, 392, __pyx_L7_error) /* "pygame_sdl2/event.pyx":394 * poll_sdl() * * if t is None: # <<<<<<<<<<<<<< * return len(event_queue) != 0 * elif isinstance(t, int): */ __pyx_t_10 = (__pyx_v_t == Py_None); __pyx_t_11 = (__pyx_t_10 != 0); if (__pyx_t_11) { /* "pygame_sdl2/event.pyx":395 * * if t is None: * return len(event_queue) != 0 # <<<<<<<<<<<<<< * elif isinstance(t, int): * return has_event(( t, )) */ __Pyx_XDECREF(__pyx_r); __pyx_t_1 = event_queue; __Pyx_INCREF(__pyx_t_1); __pyx_t_12 = PyObject_Length(__pyx_t_1); if (unlikely(__pyx_t_12 == -1)) __PYX_ERR(0, 395, __pyx_L7_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_1 = __Pyx_PyBool_FromLong((__pyx_t_12 != 0)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 395, __pyx_L7_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L11_try_return; /* "pygame_sdl2/event.pyx":394 * poll_sdl() * * if t is None: # <<<<<<<<<<<<<< * return len(event_queue) != 0 * elif isinstance(t, int): */ } /* "pygame_sdl2/event.pyx":396 * if t is None: * return len(event_queue) != 0 * elif isinstance(t, int): # <<<<<<<<<<<<<< * return has_event(( t, )) * else: */ __pyx_t_11 = PyInt_Check(__pyx_v_t); __pyx_t_10 = (__pyx_t_11 != 0); if (__pyx_t_10) { /* "pygame_sdl2/event.pyx":397 * return len(event_queue) != 0 * elif isinstance(t, int): * return has_event(( t, )) # <<<<<<<<<<<<<< * else: * return has_event(t) */ __Pyx_XDECREF(__pyx_r); __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 397, __pyx_L7_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_INCREF(__pyx_v_t); __Pyx_GIVEREF(__pyx_v_t); PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_t); __pyx_t_3 = __Pyx_PyBool_FromLong(__pyx_f_11pygame_sdl2_5event_has_event(__pyx_t_1)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 397, __pyx_L7_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_r = __pyx_t_3; __pyx_t_3 = 0; goto __pyx_L11_try_return; /* "pygame_sdl2/event.pyx":396 * if t is None: * return len(event_queue) != 0 * elif isinstance(t, int): # <<<<<<<<<<<<<< * return has_event(( t, )) * else: */ } /* "pygame_sdl2/event.pyx":399 * return has_event(( t, )) * else: * return has_event(t) # <<<<<<<<<<<<<< * * */ /*else*/ { __Pyx_XDECREF(__pyx_r); __pyx_t_3 = __Pyx_PyBool_FromLong(__pyx_f_11pygame_sdl2_5event_has_event(__pyx_v_t)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 399, __pyx_L7_error) __Pyx_GOTREF(__pyx_t_3); __pyx_r = __pyx_t_3; __pyx_t_3 = 0; goto __pyx_L11_try_return; } /* "pygame_sdl2/event.pyx":391 * def peek(t=None): * * with lock: # <<<<<<<<<<<<<< * poll_sdl() * */ } __pyx_L7_error:; __Pyx_PyThreadState_assign __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; /*except:*/ { __Pyx_AddTraceback("pygame_sdl2.event.peek", __pyx_clineno, __pyx_lineno, __pyx_filename); if (__Pyx_GetException(&__pyx_t_3, &__pyx_t_1, &__pyx_t_4) < 0) __PYX_ERR(0, 391, __pyx_L9_except_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_GOTREF(__pyx_t_1); __Pyx_GOTREF(__pyx_t_4); __pyx_t_5 = PyTuple_Pack(3, __pyx_t_3, __pyx_t_1, __pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 391, __pyx_L9_except_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_13 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_5, NULL); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 391, __pyx_L9_except_error) __Pyx_GOTREF(__pyx_t_13); __pyx_t_10 = __Pyx_PyObject_IsTrue(__pyx_t_13); __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; if (__pyx_t_10 < 0) __PYX_ERR(0, 391, __pyx_L9_except_error) __pyx_t_11 = ((!(__pyx_t_10 != 0)) != 0); if (__pyx_t_11) { __Pyx_GIVEREF(__pyx_t_3); __Pyx_GIVEREF(__pyx_t_1); __Pyx_XGIVEREF(__pyx_t_4); __Pyx_ErrRestoreWithState(__pyx_t_3, __pyx_t_1, __pyx_t_4); __pyx_t_3 = 0; __pyx_t_1 = 0; __pyx_t_4 = 0; __PYX_ERR(0, 391, __pyx_L9_except_error) } __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; goto __pyx_L8_exception_handled; } __pyx_L9_except_error:; __Pyx_PyThreadState_assign __Pyx_XGIVEREF(__pyx_t_6); __Pyx_XGIVEREF(__pyx_t_7); __Pyx_XGIVEREF(__pyx_t_8); __Pyx_ExceptionReset(__pyx_t_6, __pyx_t_7, __pyx_t_8); goto __pyx_L1_error; __pyx_L11_try_return:; __Pyx_PyThreadState_assign __Pyx_XGIVEREF(__pyx_t_6); __Pyx_XGIVEREF(__pyx_t_7); __Pyx_XGIVEREF(__pyx_t_8); __Pyx_ExceptionReset(__pyx_t_6, __pyx_t_7, __pyx_t_8); goto __pyx_L4_return; __pyx_L8_exception_handled:; __Pyx_PyThreadState_assign __Pyx_XGIVEREF(__pyx_t_6); __Pyx_XGIVEREF(__pyx_t_7); __Pyx_XGIVEREF(__pyx_t_8); __Pyx_ExceptionReset(__pyx_t_6, __pyx_t_7, __pyx_t_8); } } /*finally:*/ { /*normal exit:*/{ if (__pyx_t_2) { __pyx_t_8 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_tuple__10, NULL); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 391, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; } goto __pyx_L6; } __pyx_L4_return: { __pyx_t_8 = __pyx_r; __pyx_r = 0; if (__pyx_t_2) { __pyx_t_7 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_tuple__11, NULL); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 391, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; } __pyx_r = __pyx_t_8; __pyx_t_8 = 0; goto __pyx_L0; } __pyx_L6:; } goto __pyx_L19; __pyx_L3_error:; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; goto __pyx_L1_error; __pyx_L19:; } /* "pygame_sdl2/event.pyx":389 * * * def peek(t=None): # <<<<<<<<<<<<<< * * with lock: */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_5); __Pyx_AddTraceback("pygame_sdl2.event.peek", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/event.pyx":402 * * * def clear(t=None): # <<<<<<<<<<<<<< * * # Clear is implemented in terms of get. */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_5event_11clear(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static PyMethodDef __pyx_mdef_11pygame_sdl2_5event_11clear = {"clear", (PyCFunction)__pyx_pw_11pygame_sdl2_5event_11clear, METH_VARARGS|METH_KEYWORDS, 0}; static PyObject *__pyx_pw_11pygame_sdl2_5event_11clear(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_t = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("clear (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_t,0}; PyObject* values[1] = {0}; values[0] = ((PyObject *)Py_None); if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (kw_args > 0) { PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_t); if (value) { values[0] = value; kw_args--; } } } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "clear") < 0)) __PYX_ERR(0, 402, __pyx_L3_error) } } else { switch (PyTuple_GET_SIZE(__pyx_args)) { case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); case 0: break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_t = values[0]; } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("clear", 0, 0, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 402, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("pygame_sdl2.event.clear", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_11pygame_sdl2_5event_10clear(__pyx_self, __pyx_v_t); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_5event_10clear(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_t) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; __Pyx_RefNannySetupContext("clear", 0); /* "pygame_sdl2/event.pyx":405 * * # Clear is implemented in terms of get. * get(t) # <<<<<<<<<<<<<< * * def get_standard_events(): */ __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_get); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 405, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = NULL; if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_2))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); if (likely(__pyx_t_3)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); } } if (!__pyx_t_3) { __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_v_t); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 405, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); } else { __pyx_t_4 = PyTuple_New(1+1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 405, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_3); __pyx_t_3 = NULL; __Pyx_INCREF(__pyx_v_t); __Pyx_GIVEREF(__pyx_v_t); PyTuple_SET_ITEM(__pyx_t_4, 0+1, __pyx_v_t); __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_4, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 405, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; } __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "pygame_sdl2/event.pyx":402 * * * def clear(t=None): # <<<<<<<<<<<<<< * * # Clear is implemented in terms of get. */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_AddTraceback("pygame_sdl2.event.clear", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/event.pyx":407 * get(t) * * def get_standard_events(): # <<<<<<<<<<<<<< * """ * Returns a list of standard events that pygame_sdl2 knows about. */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_5event_13get_standard_events(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused); /*proto*/ static char __pyx_doc_11pygame_sdl2_5event_12get_standard_events[] = "\n Returns a list of standard events that pygame_sdl2 knows about.\n "; static PyMethodDef __pyx_mdef_11pygame_sdl2_5event_13get_standard_events = {"get_standard_events", (PyCFunction)__pyx_pw_11pygame_sdl2_5event_13get_standard_events, METH_NOARGS, __pyx_doc_11pygame_sdl2_5event_12get_standard_events}; static PyObject *__pyx_pw_11pygame_sdl2_5event_13get_standard_events(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("get_standard_events (wrapper)", 0); __pyx_r = __pyx_pf_11pygame_sdl2_5event_12get_standard_events(__pyx_self); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_5event_12get_standard_events(CYTHON_UNUSED PyObject *__pyx_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; Py_ssize_t __pyx_t_3; Py_ssize_t __pyx_t_4; int __pyx_t_5; PyObject *__pyx_t_6 = NULL; PyObject *__pyx_t_7 = NULL; int __pyx_t_8; int __pyx_t_9; int __pyx_t_10; __Pyx_RefNannySetupContext("get_standard_events", 0); /* "pygame_sdl2/event.pyx":412 * """ * * return [ i for i in event_names.keys() if (i < SDL_USEREVENT) or (i > USEREVENT_MAX) ] # <<<<<<<<<<<<<< * * def event_name(t): */ __Pyx_XDECREF(__pyx_r); { /* enter inner scope */ PyObject *__pyx_7genexpr__pyx_v_i = NULL; __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 412, __pyx_L5_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_3 = 0; __pyx_t_6 = __Pyx_GetModuleGlobalName(__pyx_n_s_event_names); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 412, __pyx_L5_error) __Pyx_GOTREF(__pyx_t_6); if (unlikely(__pyx_t_6 == Py_None)) { PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%s'", "keys"); __PYX_ERR(0, 412, __pyx_L5_error) } __pyx_t_7 = __Pyx_dict_iterator(__pyx_t_6, 0, __pyx_n_s_keys, (&__pyx_t_4), (&__pyx_t_5)); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 412, __pyx_L5_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = __pyx_t_7; __pyx_t_7 = 0; while (1) { __pyx_t_8 = __Pyx_dict_iter_next(__pyx_t_2, __pyx_t_4, &__pyx_t_3, &__pyx_t_7, NULL, NULL, __pyx_t_5); if (unlikely(__pyx_t_8 == 0)) break; if (unlikely(__pyx_t_8 == -1)) __PYX_ERR(0, 412, __pyx_L5_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_XDECREF_SET(__pyx_7genexpr__pyx_v_i, __pyx_t_7); __pyx_t_7 = 0; __pyx_t_7 = __Pyx_PyInt_From_SDL_EventType(SDL_USEREVENT); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 412, __pyx_L5_error) __Pyx_GOTREF(__pyx_t_7); __pyx_t_6 = PyObject_RichCompare(__pyx_7genexpr__pyx_v_i, __pyx_t_7, Py_LT); __Pyx_XGOTREF(__pyx_t_6); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 412, __pyx_L5_error) __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __pyx_t_10 = __Pyx_PyObject_IsTrue(__pyx_t_6); if (unlikely(__pyx_t_10 < 0)) __PYX_ERR(0, 412, __pyx_L5_error) __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; if (!__pyx_t_10) { } else { __pyx_t_9 = __pyx_t_10; goto __pyx_L9_bool_binop_done; } __pyx_t_6 = __Pyx_GetModuleGlobalName(__pyx_n_s_USEREVENT_MAX); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 412, __pyx_L5_error) __Pyx_GOTREF(__pyx_t_6); __pyx_t_7 = PyObject_RichCompare(__pyx_7genexpr__pyx_v_i, __pyx_t_6, Py_GT); __Pyx_XGOTREF(__pyx_t_7); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 412, __pyx_L5_error) __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __pyx_t_10 = __Pyx_PyObject_IsTrue(__pyx_t_7); if (unlikely(__pyx_t_10 < 0)) __PYX_ERR(0, 412, __pyx_L5_error) __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __pyx_t_9 = __pyx_t_10; __pyx_L9_bool_binop_done:; if (__pyx_t_9) { if (unlikely(__Pyx_ListComp_Append(__pyx_t_1, (PyObject*)__pyx_7genexpr__pyx_v_i))) __PYX_ERR(0, 412, __pyx_L5_error) } } __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_XDECREF(__pyx_7genexpr__pyx_v_i); goto __pyx_L11_exit_scope; __pyx_L5_error:; __Pyx_XDECREF(__pyx_7genexpr__pyx_v_i); goto __pyx_L1_error; __pyx_L11_exit_scope:; } /* exit inner scope */ __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "pygame_sdl2/event.pyx":407 * get(t) * * def get_standard_events(): # <<<<<<<<<<<<<< * """ * Returns a list of standard events that pygame_sdl2 knows about. */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_6); __Pyx_XDECREF(__pyx_t_7); __Pyx_AddTraceback("pygame_sdl2.event.get_standard_events", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/event.pyx":414 * return [ i for i in event_names.keys() if (i < SDL_USEREVENT) or (i > USEREVENT_MAX) ] * * def event_name(t): # <<<<<<<<<<<<<< * try: * return event_names[t] */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_5event_15event_name(PyObject *__pyx_self, PyObject *__pyx_v_t); /*proto*/ static PyMethodDef __pyx_mdef_11pygame_sdl2_5event_15event_name = {"event_name", (PyCFunction)__pyx_pw_11pygame_sdl2_5event_15event_name, METH_O, 0}; static PyObject *__pyx_pw_11pygame_sdl2_5event_15event_name(PyObject *__pyx_self, PyObject *__pyx_v_t) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("event_name (wrapper)", 0); __pyx_r = __pyx_pf_11pygame_sdl2_5event_14event_name(__pyx_self, ((PyObject *)__pyx_v_t)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_5event_14event_name(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_t) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; PyObject *__pyx_t_5 = NULL; int __pyx_t_6; PyObject *__pyx_t_7 = NULL; __Pyx_RefNannySetupContext("event_name", 0); /* "pygame_sdl2/event.pyx":415 * * def event_name(t): * try: # <<<<<<<<<<<<<< * return event_names[t] * except KeyError: */ { __Pyx_PyThreadState_declare __Pyx_PyThreadState_assign __Pyx_ExceptionSave(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3); __Pyx_XGOTREF(__pyx_t_1); __Pyx_XGOTREF(__pyx_t_2); __Pyx_XGOTREF(__pyx_t_3); /*try:*/ { /* "pygame_sdl2/event.pyx":416 * def event_name(t): * try: * return event_names[t] # <<<<<<<<<<<<<< * except KeyError: * return "UNKNOWN" */ __Pyx_XDECREF(__pyx_r); __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_event_names); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 416, __pyx_L3_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_5 = PyObject_GetItem(__pyx_t_4, __pyx_v_t); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 416, __pyx_L3_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_r = __pyx_t_5; __pyx_t_5 = 0; goto __pyx_L7_try_return; /* "pygame_sdl2/event.pyx":415 * * def event_name(t): * try: # <<<<<<<<<<<<<< * return event_names[t] * except KeyError: */ } __pyx_L3_error:; __Pyx_PyThreadState_assign __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; /* "pygame_sdl2/event.pyx":417 * try: * return event_names[t] * except KeyError: # <<<<<<<<<<<<<< * return "UNKNOWN" * */ __pyx_t_6 = __Pyx_PyErr_ExceptionMatches(__pyx_builtin_KeyError); if (__pyx_t_6) { __Pyx_AddTraceback("pygame_sdl2.event.event_name", __pyx_clineno, __pyx_lineno, __pyx_filename); if (__Pyx_GetException(&__pyx_t_5, &__pyx_t_4, &__pyx_t_7) < 0) __PYX_ERR(0, 417, __pyx_L5_except_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_GOTREF(__pyx_t_4); __Pyx_GOTREF(__pyx_t_7); /* "pygame_sdl2/event.pyx":418 * return event_names[t] * except KeyError: * return "UNKNOWN" # <<<<<<<<<<<<<< * * def set_blocked(t=None): */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(__pyx_n_u_UNKNOWN); __pyx_r = __pyx_n_u_UNKNOWN; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; goto __pyx_L6_except_return; } goto __pyx_L5_except_error; __pyx_L5_except_error:; /* "pygame_sdl2/event.pyx":415 * * def event_name(t): * try: # <<<<<<<<<<<<<< * return event_names[t] * except KeyError: */ __Pyx_PyThreadState_assign __Pyx_XGIVEREF(__pyx_t_1); __Pyx_XGIVEREF(__pyx_t_2); __Pyx_XGIVEREF(__pyx_t_3); __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3); goto __pyx_L1_error; __pyx_L7_try_return:; __Pyx_PyThreadState_assign __Pyx_XGIVEREF(__pyx_t_1); __Pyx_XGIVEREF(__pyx_t_2); __Pyx_XGIVEREF(__pyx_t_3); __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3); goto __pyx_L0; __pyx_L6_except_return:; __Pyx_PyThreadState_assign __Pyx_XGIVEREF(__pyx_t_1); __Pyx_XGIVEREF(__pyx_t_2); __Pyx_XGIVEREF(__pyx_t_3); __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3); goto __pyx_L0; } /* "pygame_sdl2/event.pyx":414 * return [ i for i in event_names.keys() if (i < SDL_USEREVENT) or (i > USEREVENT_MAX) ] * * def event_name(t): # <<<<<<<<<<<<<< * try: * return event_names[t] */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_5); __Pyx_XDECREF(__pyx_t_7); __Pyx_AddTraceback("pygame_sdl2.event.event_name", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/event.pyx":420 * return "UNKNOWN" * * def set_blocked(t=None): # <<<<<<<<<<<<<< * if t == None: * for et in event_names.keys(): */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_5event_17set_blocked(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static PyMethodDef __pyx_mdef_11pygame_sdl2_5event_17set_blocked = {"set_blocked", (PyCFunction)__pyx_pw_11pygame_sdl2_5event_17set_blocked, METH_VARARGS|METH_KEYWORDS, 0}; static PyObject *__pyx_pw_11pygame_sdl2_5event_17set_blocked(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_t = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("set_blocked (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_t,0}; PyObject* values[1] = {0}; values[0] = ((PyObject *)Py_None); if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (kw_args > 0) { PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_t); if (value) { values[0] = value; kw_args--; } } } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "set_blocked") < 0)) __PYX_ERR(0, 420, __pyx_L3_error) } } else { switch (PyTuple_GET_SIZE(__pyx_args)) { case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); case 0: break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_t = values[0]; } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("set_blocked", 0, 0, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 420, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("pygame_sdl2.event.set_blocked", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_11pygame_sdl2_5event_16set_blocked(__pyx_self, __pyx_v_t); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_5event_16set_blocked(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_t) { PyObject *__pyx_v_et = NULL; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_t_2; Py_ssize_t __pyx_t_3; Py_ssize_t __pyx_t_4; int __pyx_t_5; PyObject *__pyx_t_6 = NULL; PyObject *__pyx_t_7 = NULL; int __pyx_t_8; Uint32 __pyx_t_9; int __pyx_t_10; int __pyx_t_11; PyObject *(*__pyx_t_12)(PyObject *); __Pyx_RefNannySetupContext("set_blocked", 0); /* "pygame_sdl2/event.pyx":421 * * def set_blocked(t=None): * if t == None: # <<<<<<<<<<<<<< * for et in event_names.keys(): * SDL_EventState(et, SDL_ENABLE) */ __pyx_t_1 = PyObject_RichCompare(__pyx_v_t, Py_None, Py_EQ); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 421, __pyx_L1_error) __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 421, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (__pyx_t_2) { /* "pygame_sdl2/event.pyx":422 * def set_blocked(t=None): * if t == None: * for et in event_names.keys(): # <<<<<<<<<<<<<< * SDL_EventState(et, SDL_ENABLE) * elif isinstance(t, (int, long)): */ __pyx_t_3 = 0; __pyx_t_6 = __Pyx_GetModuleGlobalName(__pyx_n_s_event_names); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 422, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); if (unlikely(__pyx_t_6 == Py_None)) { PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%s'", "keys"); __PYX_ERR(0, 422, __pyx_L1_error) } __pyx_t_7 = __Pyx_dict_iterator(__pyx_t_6, 0, __pyx_n_s_keys, (&__pyx_t_4), (&__pyx_t_5)); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 422, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = __pyx_t_7; __pyx_t_7 = 0; while (1) { __pyx_t_8 = __Pyx_dict_iter_next(__pyx_t_1, __pyx_t_4, &__pyx_t_3, &__pyx_t_7, NULL, NULL, __pyx_t_5); if (unlikely(__pyx_t_8 == 0)) break; if (unlikely(__pyx_t_8 == -1)) __PYX_ERR(0, 422, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_XDECREF_SET(__pyx_v_et, __pyx_t_7); __pyx_t_7 = 0; /* "pygame_sdl2/event.pyx":423 * if t == None: * for et in event_names.keys(): * SDL_EventState(et, SDL_ENABLE) # <<<<<<<<<<<<<< * elif isinstance(t, (int, long)): * SDL_EventState(t, SDL_IGNORE) */ __pyx_t_9 = __Pyx_PyInt_As_uint32_t(__pyx_v_et); if (unlikely((__pyx_t_9 == (Uint32)-1) && PyErr_Occurred())) __PYX_ERR(0, 423, __pyx_L1_error) SDL_EventState(__pyx_t_9, SDL_ENABLE); } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "pygame_sdl2/event.pyx":421 * * def set_blocked(t=None): * if t == None: # <<<<<<<<<<<<<< * for et in event_names.keys(): * SDL_EventState(et, SDL_ENABLE) */ goto __pyx_L3; } /* "pygame_sdl2/event.pyx":424 * for et in event_names.keys(): * SDL_EventState(et, SDL_ENABLE) * elif isinstance(t, (int, long)): # <<<<<<<<<<<<<< * SDL_EventState(t, SDL_IGNORE) * else: */ __pyx_t_10 = PyInt_Check(__pyx_v_t); __pyx_t_11 = (__pyx_t_10 != 0); if (!__pyx_t_11) { } else { __pyx_t_2 = __pyx_t_11; goto __pyx_L6_bool_binop_done; } __pyx_t_11 = PyLong_Check(__pyx_v_t); __pyx_t_10 = (__pyx_t_11 != 0); __pyx_t_2 = __pyx_t_10; __pyx_L6_bool_binop_done:; __pyx_t_10 = (__pyx_t_2 != 0); if (__pyx_t_10) { /* "pygame_sdl2/event.pyx":425 * SDL_EventState(et, SDL_ENABLE) * elif isinstance(t, (int, long)): * SDL_EventState(t, SDL_IGNORE) # <<<<<<<<<<<<<< * else: * for et in t: */ __pyx_t_9 = __Pyx_PyInt_As_uint32_t(__pyx_v_t); if (unlikely((__pyx_t_9 == (Uint32)-1) && PyErr_Occurred())) __PYX_ERR(0, 425, __pyx_L1_error) SDL_EventState(__pyx_t_9, SDL_IGNORE); /* "pygame_sdl2/event.pyx":424 * for et in event_names.keys(): * SDL_EventState(et, SDL_ENABLE) * elif isinstance(t, (int, long)): # <<<<<<<<<<<<<< * SDL_EventState(t, SDL_IGNORE) * else: */ goto __pyx_L3; } /* "pygame_sdl2/event.pyx":427 * SDL_EventState(t, SDL_IGNORE) * else: * for et in t: # <<<<<<<<<<<<<< * SDL_EventState(et, SDL_IGNORE) * */ /*else*/ { if (likely(PyList_CheckExact(__pyx_v_t)) || PyTuple_CheckExact(__pyx_v_t)) { __pyx_t_1 = __pyx_v_t; __Pyx_INCREF(__pyx_t_1); __pyx_t_4 = 0; __pyx_t_12 = NULL; } else { __pyx_t_4 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_v_t); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 427, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_12 = Py_TYPE(__pyx_t_1)->tp_iternext; if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 427, __pyx_L1_error) } for (;;) { if (likely(!__pyx_t_12)) { if (likely(PyList_CheckExact(__pyx_t_1))) { if (__pyx_t_4 >= PyList_GET_SIZE(__pyx_t_1)) break; #if CYTHON_COMPILING_IN_CPYTHON __pyx_t_7 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_4); __Pyx_INCREF(__pyx_t_7); __pyx_t_4++; if (unlikely(0 < 0)) __PYX_ERR(0, 427, __pyx_L1_error) #else __pyx_t_7 = PySequence_ITEM(__pyx_t_1, __pyx_t_4); __pyx_t_4++; if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 427, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); #endif } else { if (__pyx_t_4 >= PyTuple_GET_SIZE(__pyx_t_1)) break; #if CYTHON_COMPILING_IN_CPYTHON __pyx_t_7 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_4); __Pyx_INCREF(__pyx_t_7); __pyx_t_4++; if (unlikely(0 < 0)) __PYX_ERR(0, 427, __pyx_L1_error) #else __pyx_t_7 = PySequence_ITEM(__pyx_t_1, __pyx_t_4); __pyx_t_4++; if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 427, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); #endif } } else { __pyx_t_7 = __pyx_t_12(__pyx_t_1); if (unlikely(!__pyx_t_7)) { PyObject* exc_type = PyErr_Occurred(); if (exc_type) { if (likely(exc_type == PyExc_StopIteration || PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); else __PYX_ERR(0, 427, __pyx_L1_error) } break; } __Pyx_GOTREF(__pyx_t_7); } __Pyx_XDECREF_SET(__pyx_v_et, __pyx_t_7); __pyx_t_7 = 0; /* "pygame_sdl2/event.pyx":428 * else: * for et in t: * SDL_EventState(et, SDL_IGNORE) # <<<<<<<<<<<<<< * * def set_allowed(t=None): */ __pyx_t_9 = __Pyx_PyInt_As_uint32_t(__pyx_v_et); if (unlikely((__pyx_t_9 == (Uint32)-1) && PyErr_Occurred())) __PYX_ERR(0, 428, __pyx_L1_error) SDL_EventState(__pyx_t_9, SDL_IGNORE); /* "pygame_sdl2/event.pyx":427 * SDL_EventState(t, SDL_IGNORE) * else: * for et in t: # <<<<<<<<<<<<<< * SDL_EventState(et, SDL_IGNORE) * */ } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; } __pyx_L3:; /* "pygame_sdl2/event.pyx":420 * return "UNKNOWN" * * def set_blocked(t=None): # <<<<<<<<<<<<<< * if t == None: * for et in event_names.keys(): */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_6); __Pyx_XDECREF(__pyx_t_7); __Pyx_AddTraceback("pygame_sdl2.event.set_blocked", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF(__pyx_v_et); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/event.pyx":430 * SDL_EventState(et, SDL_IGNORE) * * def set_allowed(t=None): # <<<<<<<<<<<<<< * if t == None: * for et in event_names.keys(): */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_5event_19set_allowed(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static PyMethodDef __pyx_mdef_11pygame_sdl2_5event_19set_allowed = {"set_allowed", (PyCFunction)__pyx_pw_11pygame_sdl2_5event_19set_allowed, METH_VARARGS|METH_KEYWORDS, 0}; static PyObject *__pyx_pw_11pygame_sdl2_5event_19set_allowed(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_t = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("set_allowed (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_t,0}; PyObject* values[1] = {0}; values[0] = ((PyObject *)Py_None); if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (kw_args > 0) { PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_t); if (value) { values[0] = value; kw_args--; } } } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "set_allowed") < 0)) __PYX_ERR(0, 430, __pyx_L3_error) } } else { switch (PyTuple_GET_SIZE(__pyx_args)) { case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); case 0: break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_t = values[0]; } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("set_allowed", 0, 0, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 430, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("pygame_sdl2.event.set_allowed", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_11pygame_sdl2_5event_18set_allowed(__pyx_self, __pyx_v_t); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_5event_18set_allowed(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_t) { PyObject *__pyx_v_et = NULL; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_t_2; Py_ssize_t __pyx_t_3; Py_ssize_t __pyx_t_4; int __pyx_t_5; PyObject *__pyx_t_6 = NULL; PyObject *__pyx_t_7 = NULL; int __pyx_t_8; Uint32 __pyx_t_9; int __pyx_t_10; int __pyx_t_11; PyObject *(*__pyx_t_12)(PyObject *); __Pyx_RefNannySetupContext("set_allowed", 0); /* "pygame_sdl2/event.pyx":431 * * def set_allowed(t=None): * if t == None: # <<<<<<<<<<<<<< * for et in event_names.keys(): * SDL_EventState(et, SDL_IGNORE) */ __pyx_t_1 = PyObject_RichCompare(__pyx_v_t, Py_None, Py_EQ); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 431, __pyx_L1_error) __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 431, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (__pyx_t_2) { /* "pygame_sdl2/event.pyx":432 * def set_allowed(t=None): * if t == None: * for et in event_names.keys(): # <<<<<<<<<<<<<< * SDL_EventState(et, SDL_IGNORE) * elif isinstance(t, (int, long)): */ __pyx_t_3 = 0; __pyx_t_6 = __Pyx_GetModuleGlobalName(__pyx_n_s_event_names); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 432, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); if (unlikely(__pyx_t_6 == Py_None)) { PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%s'", "keys"); __PYX_ERR(0, 432, __pyx_L1_error) } __pyx_t_7 = __Pyx_dict_iterator(__pyx_t_6, 0, __pyx_n_s_keys, (&__pyx_t_4), (&__pyx_t_5)); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 432, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = __pyx_t_7; __pyx_t_7 = 0; while (1) { __pyx_t_8 = __Pyx_dict_iter_next(__pyx_t_1, __pyx_t_4, &__pyx_t_3, &__pyx_t_7, NULL, NULL, __pyx_t_5); if (unlikely(__pyx_t_8 == 0)) break; if (unlikely(__pyx_t_8 == -1)) __PYX_ERR(0, 432, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_XDECREF_SET(__pyx_v_et, __pyx_t_7); __pyx_t_7 = 0; /* "pygame_sdl2/event.pyx":433 * if t == None: * for et in event_names.keys(): * SDL_EventState(et, SDL_IGNORE) # <<<<<<<<<<<<<< * elif isinstance(t, (int, long)): * SDL_EventState(t, SDL_ENABLE) */ __pyx_t_9 = __Pyx_PyInt_As_uint32_t(__pyx_v_et); if (unlikely((__pyx_t_9 == (Uint32)-1) && PyErr_Occurred())) __PYX_ERR(0, 433, __pyx_L1_error) SDL_EventState(__pyx_t_9, SDL_IGNORE); } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "pygame_sdl2/event.pyx":431 * * def set_allowed(t=None): * if t == None: # <<<<<<<<<<<<<< * for et in event_names.keys(): * SDL_EventState(et, SDL_IGNORE) */ goto __pyx_L3; } /* "pygame_sdl2/event.pyx":434 * for et in event_names.keys(): * SDL_EventState(et, SDL_IGNORE) * elif isinstance(t, (int, long)): # <<<<<<<<<<<<<< * SDL_EventState(t, SDL_ENABLE) * else: */ __pyx_t_10 = PyInt_Check(__pyx_v_t); __pyx_t_11 = (__pyx_t_10 != 0); if (!__pyx_t_11) { } else { __pyx_t_2 = __pyx_t_11; goto __pyx_L6_bool_binop_done; } __pyx_t_11 = PyLong_Check(__pyx_v_t); __pyx_t_10 = (__pyx_t_11 != 0); __pyx_t_2 = __pyx_t_10; __pyx_L6_bool_binop_done:; __pyx_t_10 = (__pyx_t_2 != 0); if (__pyx_t_10) { /* "pygame_sdl2/event.pyx":435 * SDL_EventState(et, SDL_IGNORE) * elif isinstance(t, (int, long)): * SDL_EventState(t, SDL_ENABLE) # <<<<<<<<<<<<<< * else: * for et in t: */ __pyx_t_9 = __Pyx_PyInt_As_uint32_t(__pyx_v_t); if (unlikely((__pyx_t_9 == (Uint32)-1) && PyErr_Occurred())) __PYX_ERR(0, 435, __pyx_L1_error) SDL_EventState(__pyx_t_9, SDL_ENABLE); /* "pygame_sdl2/event.pyx":434 * for et in event_names.keys(): * SDL_EventState(et, SDL_IGNORE) * elif isinstance(t, (int, long)): # <<<<<<<<<<<<<< * SDL_EventState(t, SDL_ENABLE) * else: */ goto __pyx_L3; } /* "pygame_sdl2/event.pyx":437 * SDL_EventState(t, SDL_ENABLE) * else: * for et in t: # <<<<<<<<<<<<<< * SDL_EventState(et, SDL_ENABLE) * */ /*else*/ { if (likely(PyList_CheckExact(__pyx_v_t)) || PyTuple_CheckExact(__pyx_v_t)) { __pyx_t_1 = __pyx_v_t; __Pyx_INCREF(__pyx_t_1); __pyx_t_4 = 0; __pyx_t_12 = NULL; } else { __pyx_t_4 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_v_t); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 437, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_12 = Py_TYPE(__pyx_t_1)->tp_iternext; if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 437, __pyx_L1_error) } for (;;) { if (likely(!__pyx_t_12)) { if (likely(PyList_CheckExact(__pyx_t_1))) { if (__pyx_t_4 >= PyList_GET_SIZE(__pyx_t_1)) break; #if CYTHON_COMPILING_IN_CPYTHON __pyx_t_7 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_4); __Pyx_INCREF(__pyx_t_7); __pyx_t_4++; if (unlikely(0 < 0)) __PYX_ERR(0, 437, __pyx_L1_error) #else __pyx_t_7 = PySequence_ITEM(__pyx_t_1, __pyx_t_4); __pyx_t_4++; if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 437, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); #endif } else { if (__pyx_t_4 >= PyTuple_GET_SIZE(__pyx_t_1)) break; #if CYTHON_COMPILING_IN_CPYTHON __pyx_t_7 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_4); __Pyx_INCREF(__pyx_t_7); __pyx_t_4++; if (unlikely(0 < 0)) __PYX_ERR(0, 437, __pyx_L1_error) #else __pyx_t_7 = PySequence_ITEM(__pyx_t_1, __pyx_t_4); __pyx_t_4++; if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 437, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); #endif } } else { __pyx_t_7 = __pyx_t_12(__pyx_t_1); if (unlikely(!__pyx_t_7)) { PyObject* exc_type = PyErr_Occurred(); if (exc_type) { if (likely(exc_type == PyExc_StopIteration || PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); else __PYX_ERR(0, 437, __pyx_L1_error) } break; } __Pyx_GOTREF(__pyx_t_7); } __Pyx_XDECREF_SET(__pyx_v_et, __pyx_t_7); __pyx_t_7 = 0; /* "pygame_sdl2/event.pyx":438 * else: * for et in t: * SDL_EventState(et, SDL_ENABLE) # <<<<<<<<<<<<<< * * def get_blocked(t): */ __pyx_t_9 = __Pyx_PyInt_As_uint32_t(__pyx_v_et); if (unlikely((__pyx_t_9 == (Uint32)-1) && PyErr_Occurred())) __PYX_ERR(0, 438, __pyx_L1_error) SDL_EventState(__pyx_t_9, SDL_ENABLE); /* "pygame_sdl2/event.pyx":437 * SDL_EventState(t, SDL_ENABLE) * else: * for et in t: # <<<<<<<<<<<<<< * SDL_EventState(et, SDL_ENABLE) * */ } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; } __pyx_L3:; /* "pygame_sdl2/event.pyx":430 * SDL_EventState(et, SDL_IGNORE) * * def set_allowed(t=None): # <<<<<<<<<<<<<< * if t == None: * for et in event_names.keys(): */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_6); __Pyx_XDECREF(__pyx_t_7); __Pyx_AddTraceback("pygame_sdl2.event.set_allowed", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF(__pyx_v_et); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/event.pyx":440 * SDL_EventState(et, SDL_ENABLE) * * def get_blocked(t): # <<<<<<<<<<<<<< * return SDL_EventState(t, SDL_QUERY) == SDL_IGNORE * */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_5event_21get_blocked(PyObject *__pyx_self, PyObject *__pyx_v_t); /*proto*/ static PyMethodDef __pyx_mdef_11pygame_sdl2_5event_21get_blocked = {"get_blocked", (PyCFunction)__pyx_pw_11pygame_sdl2_5event_21get_blocked, METH_O, 0}; static PyObject *__pyx_pw_11pygame_sdl2_5event_21get_blocked(PyObject *__pyx_self, PyObject *__pyx_v_t) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("get_blocked (wrapper)", 0); __pyx_r = __pyx_pf_11pygame_sdl2_5event_20get_blocked(__pyx_self, ((PyObject *)__pyx_v_t)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_5event_20get_blocked(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_t) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations Uint32 __pyx_t_1; PyObject *__pyx_t_2 = NULL; __Pyx_RefNannySetupContext("get_blocked", 0); /* "pygame_sdl2/event.pyx":441 * * def get_blocked(t): * return SDL_EventState(t, SDL_QUERY) == SDL_IGNORE # <<<<<<<<<<<<<< * * def set_grab(on): */ __Pyx_XDECREF(__pyx_r); __pyx_t_1 = __Pyx_PyInt_As_uint32_t(__pyx_v_t); if (unlikely((__pyx_t_1 == (Uint32)-1) && PyErr_Occurred())) __PYX_ERR(0, 441, __pyx_L1_error) __pyx_t_2 = __Pyx_PyBool_FromLong((SDL_EventState(__pyx_t_1, SDL_QUERY) == SDL_IGNORE)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 441, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; /* "pygame_sdl2/event.pyx":440 * SDL_EventState(et, SDL_ENABLE) * * def get_blocked(t): # <<<<<<<<<<<<<< * return SDL_EventState(t, SDL_QUERY) == SDL_IGNORE * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_AddTraceback("pygame_sdl2.event.get_blocked", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/event.pyx":443 * return SDL_EventState(t, SDL_QUERY) == SDL_IGNORE * * def set_grab(on): # <<<<<<<<<<<<<< * SDL_SetWindowGrab(main_window.window, on) * */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_5event_23set_grab(PyObject *__pyx_self, PyObject *__pyx_v_on); /*proto*/ static PyMethodDef __pyx_mdef_11pygame_sdl2_5event_23set_grab = {"set_grab", (PyCFunction)__pyx_pw_11pygame_sdl2_5event_23set_grab, METH_O, 0}; static PyObject *__pyx_pw_11pygame_sdl2_5event_23set_grab(PyObject *__pyx_self, PyObject *__pyx_v_on) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("set_grab (wrapper)", 0); __pyx_r = __pyx_pf_11pygame_sdl2_5event_22set_grab(__pyx_self, ((PyObject *)__pyx_v_on)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_5event_22set_grab(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_on) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations SDL_bool __pyx_t_1; __Pyx_RefNannySetupContext("set_grab", 0); /* "pygame_sdl2/event.pyx":444 * * def set_grab(on): * SDL_SetWindowGrab(main_window.window, on) # <<<<<<<<<<<<<< * * def get_grab(): */ __pyx_t_1 = ((SDL_bool)__Pyx_PyInt_As_SDL_bool(__pyx_v_on)); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 444, __pyx_L1_error) SDL_SetWindowGrab(__pyx_v_11pygame_sdl2_7display_main_window->window, __pyx_t_1); /* "pygame_sdl2/event.pyx":443 * return SDL_EventState(t, SDL_QUERY) == SDL_IGNORE * * def set_grab(on): # <<<<<<<<<<<<<< * SDL_SetWindowGrab(main_window.window, on) * */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("pygame_sdl2.event.set_grab", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/event.pyx":446 * SDL_SetWindowGrab(main_window.window, on) * * def get_grab(): # <<<<<<<<<<<<<< * return SDL_GetWindowGrab(main_window.window) * */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_5event_25get_grab(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused); /*proto*/ static PyMethodDef __pyx_mdef_11pygame_sdl2_5event_25get_grab = {"get_grab", (PyCFunction)__pyx_pw_11pygame_sdl2_5event_25get_grab, METH_NOARGS, 0}; static PyObject *__pyx_pw_11pygame_sdl2_5event_25get_grab(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("get_grab (wrapper)", 0); __pyx_r = __pyx_pf_11pygame_sdl2_5event_24get_grab(__pyx_self); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_5event_24get_grab(CYTHON_UNUSED PyObject *__pyx_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; __Pyx_RefNannySetupContext("get_grab", 0); /* "pygame_sdl2/event.pyx":447 * * def get_grab(): * return SDL_GetWindowGrab(main_window.window) # <<<<<<<<<<<<<< * * def set_mousewheel_buttons(flag): */ __Pyx_XDECREF(__pyx_r); __pyx_t_1 = __Pyx_PyInt_From_SDL_bool(SDL_GetWindowGrab(__pyx_v_11pygame_sdl2_7display_main_window->window)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 447, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "pygame_sdl2/event.pyx":446 * SDL_SetWindowGrab(main_window.window, on) * * def get_grab(): # <<<<<<<<<<<<<< * return SDL_GetWindowGrab(main_window.window) * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("pygame_sdl2.event.get_grab", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/event.pyx":449 * return SDL_GetWindowGrab(main_window.window) * * def set_mousewheel_buttons(flag): # <<<<<<<<<<<<<< * """ * If true (the default), the mousewheel will generate events involving */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_5event_27set_mousewheel_buttons(PyObject *__pyx_self, PyObject *__pyx_v_flag); /*proto*/ static char __pyx_doc_11pygame_sdl2_5event_26set_mousewheel_buttons[] = "\n If true (the default), the mousewheel will generate events involving\n mouse buttons 4 and 5, and mousebuttons 4 and higher will be mapped to 6 and higher.\n\n If false, MOUSEWHEEL events are generated, and the mousebuttons are\n not remapped.\n "; static PyMethodDef __pyx_mdef_11pygame_sdl2_5event_27set_mousewheel_buttons = {"set_mousewheel_buttons", (PyCFunction)__pyx_pw_11pygame_sdl2_5event_27set_mousewheel_buttons, METH_O, __pyx_doc_11pygame_sdl2_5event_26set_mousewheel_buttons}; static PyObject *__pyx_pw_11pygame_sdl2_5event_27set_mousewheel_buttons(PyObject *__pyx_self, PyObject *__pyx_v_flag) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("set_mousewheel_buttons (wrapper)", 0); __pyx_r = __pyx_pf_11pygame_sdl2_5event_26set_mousewheel_buttons(__pyx_self, ((PyObject *)__pyx_v_flag)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_5event_26set_mousewheel_buttons(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_flag) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; __Pyx_RefNannySetupContext("set_mousewheel_buttons", 0); /* "pygame_sdl2/event.pyx":459 * * global mousewheel_buttons * mousewheel_buttons = flag # <<<<<<<<<<<<<< * * def get_mousewheel_buttons(): */ __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_flag); if (unlikely((__pyx_t_1 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 459, __pyx_L1_error) __pyx_v_11pygame_sdl2_5event_mousewheel_buttons = __pyx_t_1; /* "pygame_sdl2/event.pyx":449 * return SDL_GetWindowGrab(main_window.window) * * def set_mousewheel_buttons(flag): # <<<<<<<<<<<<<< * """ * If true (the default), the mousewheel will generate events involving */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("pygame_sdl2.event.set_mousewheel_buttons", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/event.pyx":461 * mousewheel_buttons = flag * * def get_mousewheel_buttons(): # <<<<<<<<<<<<<< * """ * Returns the value set by mousehweel buttons,. */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_5event_29get_mousewheel_buttons(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused); /*proto*/ static char __pyx_doc_11pygame_sdl2_5event_28get_mousewheel_buttons[] = "\n Returns the value set by mousehweel buttons,.\n "; static PyMethodDef __pyx_mdef_11pygame_sdl2_5event_29get_mousewheel_buttons = {"get_mousewheel_buttons", (PyCFunction)__pyx_pw_11pygame_sdl2_5event_29get_mousewheel_buttons, METH_NOARGS, __pyx_doc_11pygame_sdl2_5event_28get_mousewheel_buttons}; static PyObject *__pyx_pw_11pygame_sdl2_5event_29get_mousewheel_buttons(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("get_mousewheel_buttons (wrapper)", 0); __pyx_r = __pyx_pf_11pygame_sdl2_5event_28get_mousewheel_buttons(__pyx_self); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_5event_28get_mousewheel_buttons(CYTHON_UNUSED PyObject *__pyx_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; __Pyx_RefNannySetupContext("get_mousewheel_buttons", 0); /* "pygame_sdl2/event.pyx":466 * """ * * return mousewheel_buttons # <<<<<<<<<<<<<< * * def post(e): */ __Pyx_XDECREF(__pyx_r); __pyx_t_1 = __Pyx_PyBool_FromLong(__pyx_v_11pygame_sdl2_5event_mousewheel_buttons); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 466, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "pygame_sdl2/event.pyx":461 * mousewheel_buttons = flag * * def get_mousewheel_buttons(): # <<<<<<<<<<<<<< * """ * Returns the value set by mousehweel buttons,. */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("pygame_sdl2.event.get_mousewheel_buttons", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/event.pyx":468 * return mousewheel_buttons * * def post(e): # <<<<<<<<<<<<<< * """ * Posts event object `e` to the event queue. */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_5event_31post(PyObject *__pyx_self, PyObject *__pyx_v_e); /*proto*/ static char __pyx_doc_11pygame_sdl2_5event_30post[] = "\n Posts event object `e` to the event queue.\n "; static PyMethodDef __pyx_mdef_11pygame_sdl2_5event_31post = {"post", (PyCFunction)__pyx_pw_11pygame_sdl2_5event_31post, METH_O, __pyx_doc_11pygame_sdl2_5event_30post}; static PyObject *__pyx_pw_11pygame_sdl2_5event_31post(PyObject *__pyx_self, PyObject *__pyx_v_e) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("post (wrapper)", 0); __pyx_r = __pyx_pf_11pygame_sdl2_5event_30post(__pyx_self, ((PyObject *)__pyx_v_e)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_5event_30post(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_e) { SDL_Event __pyx_v_event; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_t_2; int __pyx_t_3; PyObject *__pyx_t_4 = NULL; PyObject *__pyx_t_5 = NULL; PyObject *__pyx_t_6 = NULL; PyObject *__pyx_t_7 = NULL; __Pyx_RefNannySetupContext("post", 0); /* "pygame_sdl2/event.pyx":475 * cdef SDL_Event event; * * if not isinstance(e, EventType): # <<<<<<<<<<<<<< * raise pygame_sdl2.error("event.post must be called with an Event.") * */ __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_EventType); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 475, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = PyObject_IsInstance(__pyx_v_e, __pyx_t_1); if (unlikely(__pyx_t_2 == -1)) __PYX_ERR(0, 475, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_3 = ((!(__pyx_t_2 != 0)) != 0); if (__pyx_t_3) { /* "pygame_sdl2/event.pyx":476 * * if not isinstance(e, EventType): * raise pygame_sdl2.error("event.post must be called with an Event.") # <<<<<<<<<<<<<< * * if get_blocked(e.type): */ __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_pygame_sdl2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 476, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_error); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 476, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_tuple__12, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 476, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_Raise(__pyx_t_1, 0, 0, 0); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __PYX_ERR(0, 476, __pyx_L1_error) /* "pygame_sdl2/event.pyx":475 * cdef SDL_Event event; * * if not isinstance(e, EventType): # <<<<<<<<<<<<<< * raise pygame_sdl2.error("event.post must be called with an Event.") * */ } /* "pygame_sdl2/event.pyx":478 * raise pygame_sdl2.error("event.post must be called with an Event.") * * if get_blocked(e.type): # <<<<<<<<<<<<<< * return * */ __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_get_blocked); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 478, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_e, __pyx_n_s_type); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 478, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_6 = NULL; if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_4))) { __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_4); if (likely(__pyx_t_6)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4); __Pyx_INCREF(__pyx_t_6); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_4, function); } } if (!__pyx_t_6) { __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_5); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 478, __pyx_L1_error) __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_GOTREF(__pyx_t_1); } else { __pyx_t_7 = PyTuple_New(1+1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 478, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_GIVEREF(__pyx_t_6); PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_6); __pyx_t_6 = NULL; __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_7, 0+1, __pyx_t_5); __pyx_t_5 = 0; __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_7, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 478, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; } __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(0, 478, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (__pyx_t_3) { /* "pygame_sdl2/event.pyx":479 * * if get_blocked(e.type): * return # <<<<<<<<<<<<<< * * Py_INCREF(e) */ __Pyx_XDECREF(__pyx_r); __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; /* "pygame_sdl2/event.pyx":478 * raise pygame_sdl2.error("event.post must be called with an Event.") * * if get_blocked(e.type): # <<<<<<<<<<<<<< * return * */ } /* "pygame_sdl2/event.pyx":481 * return * * Py_INCREF(e) # <<<<<<<<<<<<<< * * event.type = POSTEDEVENT */ Py_INCREF(__pyx_v_e); /* "pygame_sdl2/event.pyx":483 * Py_INCREF(e) * * event.type = POSTEDEVENT # <<<<<<<<<<<<<< * event.user.data1 = e * */ __pyx_v_event.type = __pyx_v_11pygame_sdl2_5event_POSTEDEVENT; /* "pygame_sdl2/event.pyx":484 * * event.type = POSTEDEVENT * event.user.data1 = e # <<<<<<<<<<<<<< * * SDL_PushEvent(&event) */ __pyx_v_event.user.data1 = ((void *)__pyx_v_e); /* "pygame_sdl2/event.pyx":486 * event.user.data1 = e * * SDL_PushEvent(&event) # <<<<<<<<<<<<<< * * def register(name): */ SDL_PushEvent((&__pyx_v_event)); /* "pygame_sdl2/event.pyx":468 * return mousewheel_buttons * * def post(e): # <<<<<<<<<<<<<< * """ * Posts event object `e` to the event queue. */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_5); __Pyx_XDECREF(__pyx_t_6); __Pyx_XDECREF(__pyx_t_7); __Pyx_AddTraceback("pygame_sdl2.event.post", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/event.pyx":488 * SDL_PushEvent(&event) * * def register(name): # <<<<<<<<<<<<<< * """ * Registers a unique event number and returns that number. */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_5event_33register(PyObject *__pyx_self, PyObject *__pyx_v_name); /*proto*/ static char __pyx_doc_11pygame_sdl2_5event_32register[] = "\n Registers a unique event number and returns that number.\n\n `name`\n A string name for the event. This is used when calling `repr` on\n the event.\n "; static PyMethodDef __pyx_mdef_11pygame_sdl2_5event_33register = {"register", (PyCFunction)__pyx_pw_11pygame_sdl2_5event_33register, METH_O, __pyx_doc_11pygame_sdl2_5event_32register}; static PyObject *__pyx_pw_11pygame_sdl2_5event_33register(PyObject *__pyx_self, PyObject *__pyx_v_name) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("register (wrapper)", 0); __pyx_r = __pyx_pf_11pygame_sdl2_5event_32register(__pyx_self, ((PyObject *)__pyx_v_name)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_5event_32register(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_name) { Uint32 __pyx_v_rv; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; __Pyx_RefNannySetupContext("register", 0); /* "pygame_sdl2/event.pyx":497 * """ * * rv = SDL_RegisterEvents(1) # <<<<<<<<<<<<<< * * event_names[rv] = name */ __pyx_v_rv = SDL_RegisterEvents(1); /* "pygame_sdl2/event.pyx":499 * rv = SDL_RegisterEvents(1) * * event_names[rv] = name # <<<<<<<<<<<<<< * return rv * */ __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_event_names); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 499, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (unlikely(__Pyx_SetItemInt(__pyx_t_1, __pyx_v_rv, __pyx_v_name, Uint32, 0, __Pyx_PyInt_From_uint32_t, 0, 0, 1) < 0)) __PYX_ERR(0, 499, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "pygame_sdl2/event.pyx":500 * * event_names[rv] = name * return rv # <<<<<<<<<<<<<< * * def copy_event_queue(): */ __Pyx_XDECREF(__pyx_r); __pyx_t_1 = __Pyx_PyInt_From_uint32_t(__pyx_v_rv); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 500, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "pygame_sdl2/event.pyx":488 * SDL_PushEvent(&event) * * def register(name): # <<<<<<<<<<<<<< * """ * Registers a unique event number and returns that number. */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("pygame_sdl2.event.register", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/event.pyx":502 * return rv * * def copy_event_queue(): # <<<<<<<<<<<<<< * """ * Returns a copy of the event queue. The copy cannot be used for modifying */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_5event_35copy_event_queue(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused); /*proto*/ static char __pyx_doc_11pygame_sdl2_5event_34copy_event_queue[] = "\n Returns a copy of the event queue. The copy cannot be used for modifying\n the event queue.\n "; static PyMethodDef __pyx_mdef_11pygame_sdl2_5event_35copy_event_queue = {"copy_event_queue", (PyCFunction)__pyx_pw_11pygame_sdl2_5event_35copy_event_queue, METH_NOARGS, __pyx_doc_11pygame_sdl2_5event_34copy_event_queue}; static PyObject *__pyx_pw_11pygame_sdl2_5event_35copy_event_queue(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("copy_event_queue (wrapper)", 0); __pyx_r = __pyx_pf_11pygame_sdl2_5event_34copy_event_queue(__pyx_self); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_5event_34copy_event_queue(CYTHON_UNUSED PyObject *__pyx_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; __Pyx_RefNannySetupContext("copy_event_queue", 0); /* "pygame_sdl2/event.pyx":508 * """ * * return event_queue[:] # <<<<<<<<<<<<<< * * # Usually called by display.init. */ __Pyx_XDECREF(__pyx_r); __pyx_t_1 = __Pyx_PyObject_GetSlice(event_queue, 0, 0, NULL, NULL, &__pyx_slice__13, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 508, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "pygame_sdl2/event.pyx":502 * return rv * * def copy_event_queue(): # <<<<<<<<<<<<<< * """ * Returns a copy of the event queue. The copy cannot be used for modifying */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("pygame_sdl2.event.copy_event_queue", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/event.pyx":511 * * # Usually called by display.init. * def init(): # <<<<<<<<<<<<<< * if not SDL_WasInit(SDL_INIT_EVENTS): * */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_5event_37init(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused); /*proto*/ static PyMethodDef __pyx_mdef_11pygame_sdl2_5event_37init = {"init", (PyCFunction)__pyx_pw_11pygame_sdl2_5event_37init, METH_NOARGS, 0}; static PyObject *__pyx_pw_11pygame_sdl2_5event_37init(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("init (wrapper)", 0); __pyx_r = __pyx_pf_11pygame_sdl2_5event_36init(__pyx_self); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_5event_36init(CYTHON_UNUSED PyObject *__pyx_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; __Pyx_RefNannySetupContext("init", 0); /* "pygame_sdl2/event.pyx":512 * # Usually called by display.init. * def init(): * if not SDL_WasInit(SDL_INIT_EVENTS): # <<<<<<<<<<<<<< * * pygame_sdl2.display.sdl_main_init() */ __pyx_t_1 = ((!(SDL_WasInit(SDL_INIT_EVENTS) != 0)) != 0); if (__pyx_t_1) { /* "pygame_sdl2/event.pyx":514 * if not SDL_WasInit(SDL_INIT_EVENTS): * * pygame_sdl2.display.sdl_main_init() # <<<<<<<<<<<<<< * * if SDL_InitSubSystem(SDL_INIT_EVENTS): */ __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_pygame_sdl2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 514, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_display); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 514, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_sdl_main_init); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 514, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_t_4 = NULL; if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_3))) { __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3); if (likely(__pyx_t_4)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); __Pyx_INCREF(__pyx_t_4); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_3, function); } } if (__pyx_t_4) { __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 514, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; } else { __pyx_t_2 = __Pyx_PyObject_CallNoArg(__pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 514, __pyx_L1_error) } __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "pygame_sdl2/event.pyx":516 * pygame_sdl2.display.sdl_main_init() * * if SDL_InitSubSystem(SDL_INIT_EVENTS): # <<<<<<<<<<<<<< * raise pygame_sdl2.error.error() */ __pyx_t_1 = (SDL_InitSubSystem(SDL_INIT_EVENTS) != 0); if (__pyx_t_1) { /* "pygame_sdl2/event.pyx":517 * * if SDL_InitSubSystem(SDL_INIT_EVENTS): * raise pygame_sdl2.error.error() # <<<<<<<<<<<<<< */ __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_pygame_sdl2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 517, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_error); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 517, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_error); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 517, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_t_4 = NULL; if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_3))) { __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3); if (likely(__pyx_t_4)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); __Pyx_INCREF(__pyx_t_4); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_3, function); } } if (__pyx_t_4) { __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 517, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; } else { __pyx_t_2 = __Pyx_PyObject_CallNoArg(__pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 517, __pyx_L1_error) } __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_Raise(__pyx_t_2, 0, 0, 0); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __PYX_ERR(0, 517, __pyx_L1_error) /* "pygame_sdl2/event.pyx":516 * pygame_sdl2.display.sdl_main_init() * * if SDL_InitSubSystem(SDL_INIT_EVENTS): # <<<<<<<<<<<<<< * raise pygame_sdl2.error.error() */ } /* "pygame_sdl2/event.pyx":512 * # Usually called by display.init. * def init(): * if not SDL_WasInit(SDL_INIT_EVENTS): # <<<<<<<<<<<<<< * * pygame_sdl2.display.sdl_main_init() */ } /* "pygame_sdl2/event.pyx":511 * * # Usually called by display.init. * def init(): # <<<<<<<<<<<<<< * if not SDL_WasInit(SDL_INIT_EVENTS): * */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_AddTraceback("pygame_sdl2.event.init", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyMethodDef __pyx_methods[] = { {0, 0, 0, 0} }; #if PY_MAJOR_VERSION >= 3 static struct PyModuleDef __pyx_moduledef = { #if PY_VERSION_HEX < 0x03020000 { PyObject_HEAD_INIT(NULL) NULL, 0, NULL }, #else PyModuleDef_HEAD_INIT, #endif "event", 0, /* m_doc */ -1, /* m_size */ __pyx_methods /* m_methods */, NULL, /* m_reload */ NULL, /* m_traverse */ NULL, /* m_clear */ NULL /* m_free */ }; #endif static __Pyx_StringTabEntry __pyx_string_tab[] = { {&__pyx_kp_u_, __pyx_k_, sizeof(__pyx_k_), 0, 1, 0, 0}, {&__pyx_n_s_ACTIVEEVENT, __pyx_k_ACTIVEEVENT, sizeof(__pyx_k_ACTIVEEVENT), 0, 0, 1, 1}, {&__pyx_n_u_ACTIVEEVENT, __pyx_k_ACTIVEEVENT, sizeof(__pyx_k_ACTIVEEVENT), 0, 1, 0, 1}, {&__pyx_n_u_APP_DIDENTERBACKGROUND, __pyx_k_APP_DIDENTERBACKGROUND, sizeof(__pyx_k_APP_DIDENTERBACKGROUND), 0, 1, 0, 1}, {&__pyx_n_u_APP_DIDENTERFOREGROUND, __pyx_k_APP_DIDENTERFOREGROUND, sizeof(__pyx_k_APP_DIDENTERFOREGROUND), 0, 1, 0, 1}, {&__pyx_n_u_APP_LOWMEMORY, __pyx_k_APP_LOWMEMORY, sizeof(__pyx_k_APP_LOWMEMORY), 0, 1, 0, 1}, {&__pyx_n_u_APP_TERMINATING, __pyx_k_APP_TERMINATING, sizeof(__pyx_k_APP_TERMINATING), 0, 1, 0, 1}, {&__pyx_n_u_APP_WILLENTERBACKGROUND, __pyx_k_APP_WILLENTERBACKGROUND, sizeof(__pyx_k_APP_WILLENTERBACKGROUND), 0, 1, 0, 1}, {&__pyx_n_u_APP_WILLENTERFOREGROUND, __pyx_k_APP_WILLENTERFOREGROUND, sizeof(__pyx_k_APP_WILLENTERFOREGROUND), 0, 1, 0, 1}, {&__pyx_n_u_CLIPBOARDUPDATE, __pyx_k_CLIPBOARDUPDATE, sizeof(__pyx_k_CLIPBOARDUPDATE), 0, 1, 0, 1}, {&__pyx_n_u_CONTROLLERAXISMOTION, __pyx_k_CONTROLLERAXISMOTION, sizeof(__pyx_k_CONTROLLERAXISMOTION), 0, 1, 0, 1}, {&__pyx_n_u_CONTROLLERBUTTONDOWN, __pyx_k_CONTROLLERBUTTONDOWN, sizeof(__pyx_k_CONTROLLERBUTTONDOWN), 0, 1, 0, 1}, {&__pyx_n_u_CONTROLLERBUTTONUP, __pyx_k_CONTROLLERBUTTONUP, sizeof(__pyx_k_CONTROLLERBUTTONUP), 0, 1, 0, 1}, {&__pyx_n_u_CONTROLLERDEVICEADDED, __pyx_k_CONTROLLERDEVICEADDED, sizeof(__pyx_k_CONTROLLERDEVICEADDED), 0, 1, 0, 1}, {&__pyx_n_u_CONTROLLERDEVICEREMAPPED, __pyx_k_CONTROLLERDEVICEREMAPPED, sizeof(__pyx_k_CONTROLLERDEVICEREMAPPED), 0, 1, 0, 1}, {&__pyx_n_u_CONTROLLERDEVICEREMOVED, __pyx_k_CONTROLLERDEVICEREMOVED, sizeof(__pyx_k_CONTROLLERDEVICEREMOVED), 0, 1, 0, 1}, {&__pyx_n_u_DOLLARGESTURE, __pyx_k_DOLLARGESTURE, sizeof(__pyx_k_DOLLARGESTURE), 0, 1, 0, 1}, {&__pyx_n_u_DOLLARRECORD, __pyx_k_DOLLARRECORD, sizeof(__pyx_k_DOLLARRECORD), 0, 1, 0, 1}, {&__pyx_n_u_DROPFILE, __pyx_k_DROPFILE, sizeof(__pyx_k_DROPFILE), 0, 1, 0, 1}, {&__pyx_n_s_Event, __pyx_k_Event, sizeof(__pyx_k_Event), 0, 0, 1, 1}, {&__pyx_n_s_EventType, __pyx_k_EventType, sizeof(__pyx_k_EventType), 0, 0, 1, 1}, {&__pyx_n_s_EventType___eq, __pyx_k_EventType___eq, sizeof(__pyx_k_EventType___eq), 0, 0, 1, 1}, {&__pyx_n_s_EventType___init, __pyx_k_EventType___init, sizeof(__pyx_k_EventType___init), 0, 0, 1, 1}, {&__pyx_n_s_EventType___ne, __pyx_k_EventType___ne, sizeof(__pyx_k_EventType___ne), 0, 0, 1, 1}, {&__pyx_n_s_EventType___nonzero, __pyx_k_EventType___nonzero, sizeof(__pyx_k_EventType___nonzero), 0, 0, 1, 1}, {&__pyx_n_s_EventType___repr, __pyx_k_EventType___repr, sizeof(__pyx_k_EventType___repr), 0, 0, 1, 1}, {&__pyx_n_s_EventType_dict, __pyx_k_EventType_dict, sizeof(__pyx_k_EventType_dict), 0, 0, 1, 1}, {&__pyx_n_s_EventType_type, __pyx_k_EventType_type, sizeof(__pyx_k_EventType_type), 0, 0, 1, 1}, {&__pyx_kp_u_Event_d_s_s, __pyx_k_Event_d_s_s, sizeof(__pyx_k_Event_d_s_s), 0, 1, 0, 0}, {&__pyx_n_u_FINGERDOWN, __pyx_k_FINGERDOWN, sizeof(__pyx_k_FINGERDOWN), 0, 1, 0, 1}, {&__pyx_n_u_FINGERMOTION, __pyx_k_FINGERMOTION, sizeof(__pyx_k_FINGERMOTION), 0, 1, 0, 1}, {&__pyx_n_u_FINGERUP, __pyx_k_FINGERUP, sizeof(__pyx_k_FINGERUP), 0, 1, 0, 1}, {&__pyx_n_u_JOYAXISMOTION, __pyx_k_JOYAXISMOTION, sizeof(__pyx_k_JOYAXISMOTION), 0, 1, 0, 1}, {&__pyx_n_u_JOYBALLMOTION, __pyx_k_JOYBALLMOTION, sizeof(__pyx_k_JOYBALLMOTION), 0, 1, 0, 1}, {&__pyx_n_u_JOYBUTTONDOWN, __pyx_k_JOYBUTTONDOWN, sizeof(__pyx_k_JOYBUTTONDOWN), 0, 1, 0, 1}, {&__pyx_n_u_JOYBUTTONUP, __pyx_k_JOYBUTTONUP, sizeof(__pyx_k_JOYBUTTONUP), 0, 1, 0, 1}, {&__pyx_n_u_JOYDEVICEADDED, __pyx_k_JOYDEVICEADDED, sizeof(__pyx_k_JOYDEVICEADDED), 0, 1, 0, 1}, {&__pyx_n_u_JOYDEVICEREMOVED, __pyx_k_JOYDEVICEREMOVED, sizeof(__pyx_k_JOYDEVICEREMOVED), 0, 1, 0, 1}, {&__pyx_n_u_JOYHATMOTION, __pyx_k_JOYHATMOTION, sizeof(__pyx_k_JOYHATMOTION), 0, 1, 0, 1}, {&__pyx_n_u_KEYDOWN, __pyx_k_KEYDOWN, sizeof(__pyx_k_KEYDOWN), 0, 1, 0, 1}, {&__pyx_n_u_KEYUP, __pyx_k_KEYUP, sizeof(__pyx_k_KEYUP), 0, 1, 0, 1}, {&__pyx_n_s_KeyError, __pyx_k_KeyError, sizeof(__pyx_k_KeyError), 0, 0, 1, 1}, {&__pyx_n_u_LASTEVENT, __pyx_k_LASTEVENT, sizeof(__pyx_k_LASTEVENT), 0, 1, 0, 1}, {&__pyx_n_u_MOUSEBUTTONDOWN, __pyx_k_MOUSEBUTTONDOWN, sizeof(__pyx_k_MOUSEBUTTONDOWN), 0, 1, 0, 1}, {&__pyx_n_u_MOUSEBUTTONUP, __pyx_k_MOUSEBUTTONUP, sizeof(__pyx_k_MOUSEBUTTONUP), 0, 1, 0, 1}, {&__pyx_n_u_MOUSEMOTION, __pyx_k_MOUSEMOTION, sizeof(__pyx_k_MOUSEMOTION), 0, 1, 0, 1}, {&__pyx_n_u_MOUSEWHEEL, __pyx_k_MOUSEWHEEL, sizeof(__pyx_k_MOUSEWHEEL), 0, 1, 0, 1}, {&__pyx_n_u_MULTIGESTURE, __pyx_k_MULTIGESTURE, sizeof(__pyx_k_MULTIGESTURE), 0, 1, 0, 1}, {&__pyx_n_u_NOEVENT, __pyx_k_NOEVENT, sizeof(__pyx_k_NOEVENT), 0, 1, 0, 1}, {&__pyx_n_s_NOEVENT_EVENT, __pyx_k_NOEVENT_EVENT, sizeof(__pyx_k_NOEVENT_EVENT), 0, 0, 1, 1}, {&__pyx_n_u_QUIT, __pyx_k_QUIT, sizeof(__pyx_k_QUIT), 0, 1, 0, 1}, {&__pyx_n_u_RENDER_TARGETS_RESET, __pyx_k_RENDER_TARGETS_RESET, sizeof(__pyx_k_RENDER_TARGETS_RESET), 0, 1, 0, 1}, {&__pyx_n_s_RLock, __pyx_k_RLock, sizeof(__pyx_k_RLock), 0, 0, 1, 1}, {&__pyx_n_u_SYSWMEVENT, __pyx_k_SYSWMEVENT, sizeof(__pyx_k_SYSWMEVENT), 0, 1, 0, 1}, {&__pyx_n_u_TEXTEDITING, __pyx_k_TEXTEDITING, sizeof(__pyx_k_TEXTEDITING), 0, 1, 0, 1}, {&__pyx_n_u_TEXTINPUT, __pyx_k_TEXTINPUT, sizeof(__pyx_k_TEXTINPUT), 0, 1, 0, 1}, {&__pyx_n_u_UNKNOWN, __pyx_k_UNKNOWN, sizeof(__pyx_k_UNKNOWN), 0, 1, 0, 1}, {&__pyx_n_u_USEREVENT, __pyx_k_USEREVENT, sizeof(__pyx_k_USEREVENT), 0, 1, 0, 1}, {&__pyx_n_s_USEREVENT_MAX, __pyx_k_USEREVENT_MAX, sizeof(__pyx_k_USEREVENT_MAX), 0, 0, 1, 1}, {&__pyx_kp_u_UserEvent_d, __pyx_k_UserEvent_d, sizeof(__pyx_k_UserEvent_d), 0, 1, 0, 0}, {&__pyx_n_s_VIDEOEXPOSE, __pyx_k_VIDEOEXPOSE, sizeof(__pyx_k_VIDEOEXPOSE), 0, 0, 1, 1}, {&__pyx_n_u_VIDEOEXPOSE, __pyx_k_VIDEOEXPOSE, sizeof(__pyx_k_VIDEOEXPOSE), 0, 1, 0, 1}, {&__pyx_n_s_VIDEORESIZE, __pyx_k_VIDEORESIZE, sizeof(__pyx_k_VIDEORESIZE), 0, 0, 1, 1}, {&__pyx_n_u_VIDEORESIZE, __pyx_k_VIDEORESIZE, sizeof(__pyx_k_VIDEORESIZE), 0, 1, 0, 1}, {&__pyx_n_u_WINDOWEVENT, __pyx_k_WINDOWEVENT, sizeof(__pyx_k_WINDOWEVENT), 0, 1, 0, 1}, {&__pyx_n_s_append, __pyx_k_append, sizeof(__pyx_k_append), 0, 0, 1, 1}, {&__pyx_n_s_axis, __pyx_k_axis, sizeof(__pyx_k_axis), 0, 0, 1, 1}, {&__pyx_n_s_ball, __pyx_k_ball, sizeof(__pyx_k_ball), 0, 0, 1, 1}, {&__pyx_n_s_button, __pyx_k_button, sizeof(__pyx_k_button), 0, 0, 1, 1}, {&__pyx_n_s_buttons, __pyx_k_buttons, sizeof(__pyx_k_buttons), 0, 0, 1, 1}, {&__pyx_n_s_chr, __pyx_k_chr, sizeof(__pyx_k_chr), 0, 0, 1, 1}, {&__pyx_n_s_clear, __pyx_k_clear, sizeof(__pyx_k_clear), 0, 0, 1, 1}, {&__pyx_n_s_code, __pyx_k_code, sizeof(__pyx_k_code), 0, 0, 1, 1}, {&__pyx_n_s_copy, __pyx_k_copy, sizeof(__pyx_k_copy), 0, 0, 1, 1}, {&__pyx_n_s_copy_event_queue, __pyx_k_copy_event_queue, sizeof(__pyx_k_copy_event_queue), 0, 0, 1, 1}, {&__pyx_n_s_d, __pyx_k_d, sizeof(__pyx_k_d), 0, 0, 1, 1}, {&__pyx_n_s_dDist, __pyx_k_dDist, sizeof(__pyx_k_dDist), 0, 0, 1, 1}, {&__pyx_n_s_dTheta, __pyx_k_dTheta, sizeof(__pyx_k_dTheta), 0, 0, 1, 1}, {&__pyx_n_s_data1, __pyx_k_data1, sizeof(__pyx_k_data1), 0, 0, 1, 1}, {&__pyx_n_s_data2, __pyx_k_data2, sizeof(__pyx_k_data2), 0, 0, 1, 1}, {&__pyx_n_s_dict, __pyx_k_dict, sizeof(__pyx_k_dict), 0, 0, 1, 1}, {&__pyx_n_s_dict_2, __pyx_k_dict_2, sizeof(__pyx_k_dict_2), 0, 0, 1, 1}, {&__pyx_n_s_display, __pyx_k_display, sizeof(__pyx_k_display), 0, 0, 1, 1}, {&__pyx_n_s_doc, __pyx_k_doc, sizeof(__pyx_k_doc), 0, 0, 1, 1}, {&__pyx_n_s_dx, __pyx_k_dx, sizeof(__pyx_k_dx), 0, 0, 1, 1}, {&__pyx_n_s_dy, __pyx_k_dy, sizeof(__pyx_k_dy), 0, 0, 1, 1}, {&__pyx_n_s_e, __pyx_k_e, sizeof(__pyx_k_e), 0, 0, 1, 1}, {&__pyx_n_s_ename, __pyx_k_ename, sizeof(__pyx_k_ename), 0, 0, 1, 1}, {&__pyx_n_s_enter, __pyx_k_enter, sizeof(__pyx_k_enter), 0, 0, 1, 1}, {&__pyx_n_s_eq, __pyx_k_eq, sizeof(__pyx_k_eq), 0, 0, 1, 1}, {&__pyx_n_s_error, __pyx_k_error, sizeof(__pyx_k_error), 0, 0, 1, 1}, {&__pyx_n_s_et, __pyx_k_et, sizeof(__pyx_k_et), 0, 0, 1, 1}, {&__pyx_n_s_event, __pyx_k_event, sizeof(__pyx_k_event), 0, 0, 1, 1}, {&__pyx_n_s_event_name, __pyx_k_event_name, sizeof(__pyx_k_event_name), 0, 0, 1, 1}, {&__pyx_n_s_event_names, __pyx_k_event_names, sizeof(__pyx_k_event_names), 0, 0, 1, 1}, {&__pyx_kp_u_event_post_must_be_called_with_a, __pyx_k_event_post_must_be_called_with_a, sizeof(__pyx_k_event_post_must_be_called_with_a), 0, 1, 0, 0}, {&__pyx_n_s_evt, __pyx_k_evt, sizeof(__pyx_k_evt), 0, 0, 1, 1}, {&__pyx_n_s_exit, __pyx_k_exit, sizeof(__pyx_k_exit), 0, 0, 1, 1}, {&__pyx_n_s_fingerId, __pyx_k_fingerId, sizeof(__pyx_k_fingerId), 0, 0, 1, 1}, {&__pyx_n_s_flag, __pyx_k_flag, sizeof(__pyx_k_flag), 0, 0, 1, 1}, {&__pyx_n_s_gain, __pyx_k_gain, sizeof(__pyx_k_gain), 0, 0, 1, 1}, {&__pyx_n_s_get, __pyx_k_get, sizeof(__pyx_k_get), 0, 0, 1, 1}, {&__pyx_n_s_get_blocked, __pyx_k_get_blocked, sizeof(__pyx_k_get_blocked), 0, 0, 1, 1}, {&__pyx_n_s_get_grab, __pyx_k_get_grab, sizeof(__pyx_k_get_grab), 0, 0, 1, 1}, {&__pyx_n_s_get_mousewheel_buttons, __pyx_k_get_mousewheel_buttons, sizeof(__pyx_k_get_mousewheel_buttons), 0, 0, 1, 1}, {&__pyx_n_s_get_standard_events, __pyx_k_get_standard_events, sizeof(__pyx_k_get_standard_events), 0, 0, 1, 1}, {&__pyx_n_s_h, __pyx_k_h, sizeof(__pyx_k_h), 0, 0, 1, 1}, {&__pyx_n_s_hat, __pyx_k_hat, sizeof(__pyx_k_hat), 0, 0, 1, 1}, {&__pyx_kp_s_home_tom_ab_pygame_sdl2_src_pyg, __pyx_k_home_tom_ab_pygame_sdl2_src_pyg, sizeof(__pyx_k_home_tom_ab_pygame_sdl2_src_pyg), 0, 0, 1, 0}, {&__pyx_n_s_import, __pyx_k_import, sizeof(__pyx_k_import), 0, 0, 1, 1}, {&__pyx_n_s_init, __pyx_k_init, sizeof(__pyx_k_init), 0, 0, 1, 1}, {&__pyx_n_s_init_2, __pyx_k_init_2, sizeof(__pyx_k_init_2), 0, 0, 1, 1}, {&__pyx_n_s_insert, __pyx_k_insert, sizeof(__pyx_k_insert), 0, 0, 1, 1}, {&__pyx_n_s_joy, __pyx_k_joy, sizeof(__pyx_k_joy), 0, 0, 1, 1}, {&__pyx_n_s_key, __pyx_k_key, sizeof(__pyx_k_key), 0, 0, 1, 1}, {&__pyx_n_u_key, __pyx_k_key, sizeof(__pyx_k_key), 0, 1, 0, 1}, {&__pyx_n_s_keys, __pyx_k_keys, sizeof(__pyx_k_keys), 0, 0, 1, 1}, {&__pyx_n_s_kwargs, __pyx_k_kwargs, sizeof(__pyx_k_kwargs), 0, 0, 1, 1}, {&__pyx_n_s_length, __pyx_k_length, sizeof(__pyx_k_length), 0, 0, 1, 1}, {&__pyx_n_s_lock, __pyx_k_lock, sizeof(__pyx_k_lock), 0, 0, 1, 1}, {&__pyx_n_s_main, __pyx_k_main, sizeof(__pyx_k_main), 0, 0, 1, 1}, {&__pyx_n_s_metaclass, __pyx_k_metaclass, sizeof(__pyx_k_metaclass), 0, 0, 1, 1}, {&__pyx_n_u_mod, __pyx_k_mod, sizeof(__pyx_k_mod), 0, 1, 0, 1}, {&__pyx_n_s_module, __pyx_k_module, sizeof(__pyx_k_module), 0, 0, 1, 1}, {&__pyx_n_s_name, __pyx_k_name, sizeof(__pyx_k_name), 0, 0, 1, 1}, {&__pyx_n_s_ne, __pyx_k_ne, sizeof(__pyx_k_ne), 0, 0, 1, 1}, {&__pyx_n_s_nonzero, __pyx_k_nonzero, sizeof(__pyx_k_nonzero), 0, 0, 1, 1}, {&__pyx_n_s_numFingers, __pyx_k_numFingers, sizeof(__pyx_k_numFingers), 0, 0, 1, 1}, {&__pyx_n_s_object, __pyx_k_object, sizeof(__pyx_k_object), 0, 0, 1, 1}, {&__pyx_n_s_on, __pyx_k_on, sizeof(__pyx_k_on), 0, 0, 1, 1}, {&__pyx_n_s_other, __pyx_k_other, sizeof(__pyx_k_other), 0, 0, 1, 1}, {&__pyx_n_s_peek, __pyx_k_peek, sizeof(__pyx_k_peek), 0, 0, 1, 1}, {&__pyx_n_s_poll, __pyx_k_poll, sizeof(__pyx_k_poll), 0, 0, 1, 1}, {&__pyx_n_s_pop, __pyx_k_pop, sizeof(__pyx_k_pop), 0, 0, 1, 1}, {&__pyx_n_s_pos, __pyx_k_pos, sizeof(__pyx_k_pos), 0, 0, 1, 1}, {&__pyx_n_s_post, __pyx_k_post, sizeof(__pyx_k_post), 0, 0, 1, 1}, {&__pyx_n_s_prepare, __pyx_k_prepare, sizeof(__pyx_k_prepare), 0, 0, 1, 1}, {&__pyx_n_s_pressure, __pyx_k_pressure, sizeof(__pyx_k_pressure), 0, 0, 1, 1}, {&__pyx_n_s_property, __pyx_k_property, sizeof(__pyx_k_property), 0, 0, 1, 1}, {&__pyx_n_s_pump, __pyx_k_pump, sizeof(__pyx_k_pump), 0, 0, 1, 1}, {&__pyx_n_s_pygame_sdl2, __pyx_k_pygame_sdl2, sizeof(__pyx_k_pygame_sdl2), 0, 0, 1, 1}, {&__pyx_n_s_pygame_sdl2_event, __pyx_k_pygame_sdl2_event, sizeof(__pyx_k_pygame_sdl2_event), 0, 0, 1, 1}, {&__pyx_n_s_pyx_vtable, __pyx_k_pyx_vtable, sizeof(__pyx_k_pyx_vtable), 0, 0, 1, 1}, {&__pyx_n_s_qualname, __pyx_k_qualname, sizeof(__pyx_k_qualname), 0, 0, 1, 1}, {&__pyx_n_s_register, __pyx_k_register, sizeof(__pyx_k_register), 0, 0, 1, 1}, {&__pyx_n_s_rel, __pyx_k_rel, sizeof(__pyx_k_rel), 0, 0, 1, 1}, {&__pyx_n_s_repeat, __pyx_k_repeat, sizeof(__pyx_k_repeat), 0, 0, 1, 1}, {&__pyx_n_u_repeat, __pyx_k_repeat, sizeof(__pyx_k_repeat), 0, 1, 0, 1}, {&__pyx_n_s_repr, __pyx_k_repr, sizeof(__pyx_k_repr), 0, 0, 1, 1}, {&__pyx_n_s_result, __pyx_k_result, sizeof(__pyx_k_result), 0, 0, 1, 1}, {&__pyx_n_s_rv, __pyx_k_rv, sizeof(__pyx_k_rv), 0, 0, 1, 1}, {&__pyx_n_u_scancode, __pyx_k_scancode, sizeof(__pyx_k_scancode), 0, 1, 0, 1}, {&__pyx_n_s_sdl_main_init, __pyx_k_sdl_main_init, sizeof(__pyx_k_sdl_main_init), 0, 0, 1, 1}, {&__pyx_n_s_self, __pyx_k_self, sizeof(__pyx_k_self), 0, 0, 1, 1}, {&__pyx_n_s_set_allowed, __pyx_k_set_allowed, sizeof(__pyx_k_set_allowed), 0, 0, 1, 1}, {&__pyx_n_s_set_blocked, __pyx_k_set_blocked, sizeof(__pyx_k_set_blocked), 0, 0, 1, 1}, {&__pyx_n_s_set_grab, __pyx_k_set_grab, sizeof(__pyx_k_set_grab), 0, 0, 1, 1}, {&__pyx_n_s_set_mousewheel_buttons, __pyx_k_set_mousewheel_buttons, sizeof(__pyx_k_set_mousewheel_buttons), 0, 0, 1, 1}, {&__pyx_n_s_size, __pyx_k_size, sizeof(__pyx_k_size), 0, 0, 1, 1}, {&__pyx_n_s_start, __pyx_k_start, sizeof(__pyx_k_start), 0, 0, 1, 1}, {&__pyx_n_s_state, __pyx_k_state, sizeof(__pyx_k_state), 0, 0, 1, 1}, {&__pyx_n_s_sys, __pyx_k_sys, sizeof(__pyx_k_sys), 0, 0, 1, 1}, {&__pyx_n_s_t, __pyx_k_t, sizeof(__pyx_k_t), 0, 0, 1, 1}, {&__pyx_n_s_test, __pyx_k_test, sizeof(__pyx_k_test), 0, 0, 1, 1}, {&__pyx_n_s_text, __pyx_k_text, sizeof(__pyx_k_text), 0, 0, 1, 1}, {&__pyx_n_s_text_input, __pyx_k_text_input, sizeof(__pyx_k_text_input), 0, 0, 1, 1}, {&__pyx_n_s_threading, __pyx_k_threading, sizeof(__pyx_k_threading), 0, 0, 1, 1}, {&__pyx_n_s_touchId, __pyx_k_touchId, sizeof(__pyx_k_touchId), 0, 0, 1, 1}, {&__pyx_n_s_type, __pyx_k_type, sizeof(__pyx_k_type), 0, 0, 1, 1}, {&__pyx_n_s_type_2, __pyx_k_type_2, sizeof(__pyx_k_type_2), 0, 0, 1, 1}, {&__pyx_n_u_type_2, __pyx_k_type_2, sizeof(__pyx_k_type_2), 0, 1, 0, 1}, {&__pyx_n_s_unichr, __pyx_k_unichr, sizeof(__pyx_k_unichr), 0, 0, 1, 1}, {&__pyx_n_u_unicode, __pyx_k_unicode, sizeof(__pyx_k_unicode), 0, 1, 0, 1}, {&__pyx_n_s_update, __pyx_k_update, sizeof(__pyx_k_update), 0, 0, 1, 1}, {&__pyx_n_s_value, __pyx_k_value, sizeof(__pyx_k_value), 0, 0, 1, 1}, {&__pyx_n_s_version_info, __pyx_k_version_info, sizeof(__pyx_k_version_info), 0, 0, 1, 1}, {&__pyx_n_s_w, __pyx_k_w, sizeof(__pyx_k_w), 0, 0, 1, 1}, {&__pyx_n_s_wait, __pyx_k_wait, sizeof(__pyx_k_wait), 0, 0, 1, 1}, {&__pyx_n_s_which, __pyx_k_which, sizeof(__pyx_k_which), 0, 0, 1, 1}, {&__pyx_n_s_x, __pyx_k_x, sizeof(__pyx_k_x), 0, 0, 1, 1}, {&__pyx_n_s_y, __pyx_k_y, sizeof(__pyx_k_y), 0, 0, 1, 1}, {0, 0, 0, 0, 0, 0, 0} }; static int __Pyx_InitCachedBuiltins(void) { __pyx_builtin_chr = __Pyx_GetBuiltinName(__pyx_n_s_chr); if (!__pyx_builtin_chr) __PYX_ERR(0, 29, __pyx_L1_error) __pyx_builtin_object = __Pyx_GetBuiltinName(__pyx_n_s_object); if (!__pyx_builtin_object) __PYX_ERR(0, 55, __pyx_L1_error) __pyx_builtin_property = __Pyx_GetBuiltinName(__pyx_n_s_property); if (!__pyx_builtin_property) __PYX_ERR(0, 78, __pyx_L1_error) __pyx_builtin_KeyError = __Pyx_GetBuiltinName(__pyx_n_s_KeyError); if (!__pyx_builtin_KeyError) __PYX_ERR(0, 71, __pyx_L1_error) return 0; __pyx_L1_error:; return -1; } static int __Pyx_InitCachedConstants(void) { __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__Pyx_InitCachedConstants", 0); /* "pygame_sdl2/event.pyx":162 * btn = 5 * else: * return EventType(0) # x axis scrolling produces no event in pygame # <<<<<<<<<<<<<< * * # This is not the mouse position at the time of the event */ __pyx_tuple__2 = PyTuple_Pack(1, __pyx_int_0); if (unlikely(!__pyx_tuple__2)) __PYX_ERR(0, 162, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__2); __Pyx_GIVEREF(__pyx_tuple__2); /* "pygame_sdl2/event.pyx":326 * cdef SDL_Event evt * * with lock: # <<<<<<<<<<<<<< * while SDL_PollEvent(&evt): * event_queue.append(make_event(&evt)) */ __pyx_tuple__3 = PyTuple_Pack(3, Py_None, Py_None, Py_None); if (unlikely(!__pyx_tuple__3)) __PYX_ERR(0, 326, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__3); __Pyx_GIVEREF(__pyx_tuple__3); /* "pygame_sdl2/event.pyx":334 * * def pump(): * with lock: # <<<<<<<<<<<<<< * poll_sdl() * */ __pyx_tuple__4 = PyTuple_Pack(3, Py_None, Py_None, Py_None); if (unlikely(!__pyx_tuple__4)) __PYX_ERR(0, 334, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__4); __Pyx_GIVEREF(__pyx_tuple__4); /* "pygame_sdl2/event.pyx":342 * global event_queue * * with lock: # <<<<<<<<<<<<<< * poll_sdl() * */ __pyx_tuple__5 = PyTuple_Pack(3, Py_None, Py_None, Py_None); if (unlikely(!__pyx_tuple__5)) __PYX_ERR(0, 342, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__5); __Pyx_GIVEREF(__pyx_tuple__5); /* "pygame_sdl2/event.pyx":360 * def poll(): * * with lock: # <<<<<<<<<<<<<< * poll_sdl() * */ __pyx_tuple__6 = PyTuple_Pack(3, Py_None, Py_None, Py_None); if (unlikely(!__pyx_tuple__6)) __PYX_ERR(0, 360, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__6); __Pyx_GIVEREF(__pyx_tuple__6); __pyx_tuple__7 = PyTuple_Pack(3, Py_None, Py_None, Py_None); if (unlikely(!__pyx_tuple__7)) __PYX_ERR(0, 360, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__7); __Pyx_GIVEREF(__pyx_tuple__7); /* "pygame_sdl2/event.pyx":374 * cdef int result * * with lock: # <<<<<<<<<<<<<< * poll_sdl() * */ __pyx_tuple__8 = PyTuple_Pack(3, Py_None, Py_None, Py_None); if (unlikely(!__pyx_tuple__8)) __PYX_ERR(0, 374, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__8); __Pyx_GIVEREF(__pyx_tuple__8); __pyx_tuple__9 = PyTuple_Pack(3, Py_None, Py_None, Py_None); if (unlikely(!__pyx_tuple__9)) __PYX_ERR(0, 374, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__9); __Pyx_GIVEREF(__pyx_tuple__9); /* "pygame_sdl2/event.pyx":391 * def peek(t=None): * * with lock: # <<<<<<<<<<<<<< * poll_sdl() * */ __pyx_tuple__10 = PyTuple_Pack(3, Py_None, Py_None, Py_None); if (unlikely(!__pyx_tuple__10)) __PYX_ERR(0, 391, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__10); __Pyx_GIVEREF(__pyx_tuple__10); __pyx_tuple__11 = PyTuple_Pack(3, Py_None, Py_None, Py_None); if (unlikely(!__pyx_tuple__11)) __PYX_ERR(0, 391, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__11); __Pyx_GIVEREF(__pyx_tuple__11); /* "pygame_sdl2/event.pyx":476 * * if not isinstance(e, EventType): * raise pygame_sdl2.error("event.post must be called with an Event.") # <<<<<<<<<<<<<< * * if get_blocked(e.type): */ __pyx_tuple__12 = PyTuple_Pack(1, __pyx_kp_u_event_post_must_be_called_with_a); if (unlikely(!__pyx_tuple__12)) __PYX_ERR(0, 476, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__12); __Pyx_GIVEREF(__pyx_tuple__12); /* "pygame_sdl2/event.pyx":508 * """ * * return event_queue[:] # <<<<<<<<<<<<<< * * # Usually called by display.init. */ __pyx_slice__13 = PySlice_New(Py_None, Py_None, Py_None); if (unlikely(!__pyx_slice__13)) __PYX_ERR(0, 508, __pyx_L1_error) __Pyx_GOTREF(__pyx_slice__13); __Pyx_GIVEREF(__pyx_slice__13); /* "pygame_sdl2/event.pyx":57 * class EventType(object): * * def __init__(self, type, dict=None, **kwargs): # <<<<<<<<<<<<<< * self._type = type * */ __pyx_tuple__14 = PyTuple_Pack(4, __pyx_n_s_self, __pyx_n_s_type, __pyx_n_s_dict, __pyx_n_s_kwargs); if (unlikely(!__pyx_tuple__14)) __PYX_ERR(0, 57, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__14); __Pyx_GIVEREF(__pyx_tuple__14); __pyx_codeobj__15 = (PyObject*)__Pyx_PyCode_New(3, 0, 4, 0, CO_VARKEYWORDS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__14, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_tom_ab_pygame_sdl2_src_pyg, __pyx_n_s_init, 57, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__15)) __PYX_ERR(0, 57, __pyx_L1_error) __pyx_tuple__16 = PyTuple_Pack(1, ((PyObject *)Py_None)); if (unlikely(!__pyx_tuple__16)) __PYX_ERR(0, 57, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__16); __Pyx_GIVEREF(__pyx_tuple__16); /* "pygame_sdl2/event.pyx":65 * self.__dict__.update(kwargs) * * def __repr__(self): # <<<<<<<<<<<<<< * if SDL_USEREVENT <= self.type < VIDEOEXPOSE: * ename = "UserEvent%d" % (self.type - SDL_USEREVENT) */ __pyx_tuple__17 = PyTuple_Pack(3, __pyx_n_s_self, __pyx_n_s_ename, __pyx_n_s_d); if (unlikely(!__pyx_tuple__17)) __PYX_ERR(0, 65, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__17); __Pyx_GIVEREF(__pyx_tuple__17); __pyx_codeobj__18 = (PyObject*)__Pyx_PyCode_New(1, 0, 3, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__17, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_tom_ab_pygame_sdl2_src_pyg, __pyx_n_s_repr, 65, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__18)) __PYX_ERR(0, 65, __pyx_L1_error) /* "pygame_sdl2/event.pyx":79 * * @property * def dict(self): # <<<<<<<<<<<<<< * return self.__dict__ * */ __pyx_tuple__19 = PyTuple_Pack(1, __pyx_n_s_self); if (unlikely(!__pyx_tuple__19)) __PYX_ERR(0, 79, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__19); __Pyx_GIVEREF(__pyx_tuple__19); __pyx_codeobj__20 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__19, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_tom_ab_pygame_sdl2_src_pyg, __pyx_n_s_dict, 79, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__20)) __PYX_ERR(0, 79, __pyx_L1_error) /* "pygame_sdl2/event.pyx":83 * * @property * def type(self): # <<<<<<<<<<<<<< * return self._type * */ __pyx_tuple__21 = PyTuple_Pack(1, __pyx_n_s_self); if (unlikely(!__pyx_tuple__21)) __PYX_ERR(0, 83, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__21); __Pyx_GIVEREF(__pyx_tuple__21); __pyx_codeobj__22 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__21, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_tom_ab_pygame_sdl2_src_pyg, __pyx_n_s_type, 83, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__22)) __PYX_ERR(0, 83, __pyx_L1_error) /* "pygame_sdl2/event.pyx":86 * return self._type * * def __eq__(self, other): # <<<<<<<<<<<<<< * return self.__dict__ == other.__dict__ * */ __pyx_tuple__23 = PyTuple_Pack(2, __pyx_n_s_self, __pyx_n_s_other); if (unlikely(!__pyx_tuple__23)) __PYX_ERR(0, 86, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__23); __Pyx_GIVEREF(__pyx_tuple__23); __pyx_codeobj__24 = (PyObject*)__Pyx_PyCode_New(2, 0, 2, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__23, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_tom_ab_pygame_sdl2_src_pyg, __pyx_n_s_eq, 86, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__24)) __PYX_ERR(0, 86, __pyx_L1_error) /* "pygame_sdl2/event.pyx":89 * return self.__dict__ == other.__dict__ * * def __ne__(self, other): # <<<<<<<<<<<<<< * return not (self == other) * */ __pyx_tuple__25 = PyTuple_Pack(2, __pyx_n_s_self, __pyx_n_s_other); if (unlikely(!__pyx_tuple__25)) __PYX_ERR(0, 89, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__25); __Pyx_GIVEREF(__pyx_tuple__25); __pyx_codeobj__26 = (PyObject*)__Pyx_PyCode_New(2, 0, 2, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__25, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_tom_ab_pygame_sdl2_src_pyg, __pyx_n_s_ne, 89, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__26)) __PYX_ERR(0, 89, __pyx_L1_error) /* "pygame_sdl2/event.pyx":92 * return not (self == other) * * def __nonzero__(self): # <<<<<<<<<<<<<< * return self.type != 0 * */ __pyx_tuple__27 = PyTuple_Pack(1, __pyx_n_s_self); if (unlikely(!__pyx_tuple__27)) __PYX_ERR(0, 92, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__27); __Pyx_GIVEREF(__pyx_tuple__27); __pyx_codeobj__28 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__27, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_tom_ab_pygame_sdl2_src_pyg, __pyx_n_s_nonzero, 92, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__28)) __PYX_ERR(0, 92, __pyx_L1_error) /* "pygame_sdl2/event.pyx":275 * * # This is the object that is returned when no event exists. * NOEVENT_EVENT = EventType(0) # <<<<<<<<<<<<<< * * */ __pyx_tuple__29 = PyTuple_Pack(1, __pyx_int_0); if (unlikely(!__pyx_tuple__29)) __PYX_ERR(0, 275, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__29); __Pyx_GIVEREF(__pyx_tuple__29); /* "pygame_sdl2/event.pyx":333 * * * def pump(): # <<<<<<<<<<<<<< * with lock: * poll_sdl() */ __pyx_codeobj__30 = (PyObject*)__Pyx_PyCode_New(0, 0, 0, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_tom_ab_pygame_sdl2_src_pyg, __pyx_n_s_pump, 333, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__30)) __PYX_ERR(0, 333, __pyx_L1_error) /* "pygame_sdl2/event.pyx":338 * * * def get(t=None): # <<<<<<<<<<<<<< * * global event_queue */ __pyx_tuple__31 = PyTuple_Pack(2, __pyx_n_s_t, __pyx_n_s_rv); if (unlikely(!__pyx_tuple__31)) __PYX_ERR(0, 338, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__31); __Pyx_GIVEREF(__pyx_tuple__31); __pyx_codeobj__32 = (PyObject*)__Pyx_PyCode_New(1, 0, 2, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__31, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_tom_ab_pygame_sdl2_src_pyg, __pyx_n_s_get, 338, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__32)) __PYX_ERR(0, 338, __pyx_L1_error) /* "pygame_sdl2/event.pyx":358 * * * def poll(): # <<<<<<<<<<<<<< * * with lock: */ __pyx_codeobj__33 = (PyObject*)__Pyx_PyCode_New(0, 0, 0, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_tom_ab_pygame_sdl2_src_pyg, __pyx_n_s_poll, 358, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__33)) __PYX_ERR(0, 358, __pyx_L1_error) /* "pygame_sdl2/event.pyx":369 * * * def wait(): # <<<<<<<<<<<<<< * * cdef SDL_Event evt */ __pyx_tuple__34 = PyTuple_Pack(2, __pyx_n_s_evt, __pyx_n_s_result); if (unlikely(!__pyx_tuple__34)) __PYX_ERR(0, 369, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__34); __Pyx_GIVEREF(__pyx_tuple__34); __pyx_codeobj__35 = (PyObject*)__Pyx_PyCode_New(0, 0, 2, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__34, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_tom_ab_pygame_sdl2_src_pyg, __pyx_n_s_wait, 369, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__35)) __PYX_ERR(0, 369, __pyx_L1_error) /* "pygame_sdl2/event.pyx":389 * * * def peek(t=None): # <<<<<<<<<<<<<< * * with lock: */ __pyx_tuple__36 = PyTuple_Pack(1, __pyx_n_s_t); if (unlikely(!__pyx_tuple__36)) __PYX_ERR(0, 389, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__36); __Pyx_GIVEREF(__pyx_tuple__36); __pyx_codeobj__37 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__36, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_tom_ab_pygame_sdl2_src_pyg, __pyx_n_s_peek, 389, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__37)) __PYX_ERR(0, 389, __pyx_L1_error) /* "pygame_sdl2/event.pyx":402 * * * def clear(t=None): # <<<<<<<<<<<<<< * * # Clear is implemented in terms of get. */ __pyx_tuple__38 = PyTuple_Pack(1, __pyx_n_s_t); if (unlikely(!__pyx_tuple__38)) __PYX_ERR(0, 402, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__38); __Pyx_GIVEREF(__pyx_tuple__38); __pyx_codeobj__39 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__38, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_tom_ab_pygame_sdl2_src_pyg, __pyx_n_s_clear, 402, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__39)) __PYX_ERR(0, 402, __pyx_L1_error) /* "pygame_sdl2/event.pyx":407 * get(t) * * def get_standard_events(): # <<<<<<<<<<<<<< * """ * Returns a list of standard events that pygame_sdl2 knows about. */ __pyx_codeobj__40 = (PyObject*)__Pyx_PyCode_New(0, 0, 0, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_tom_ab_pygame_sdl2_src_pyg, __pyx_n_s_get_standard_events, 407, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__40)) __PYX_ERR(0, 407, __pyx_L1_error) /* "pygame_sdl2/event.pyx":414 * return [ i for i in event_names.keys() if (i < SDL_USEREVENT) or (i > USEREVENT_MAX) ] * * def event_name(t): # <<<<<<<<<<<<<< * try: * return event_names[t] */ __pyx_tuple__41 = PyTuple_Pack(1, __pyx_n_s_t); if (unlikely(!__pyx_tuple__41)) __PYX_ERR(0, 414, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__41); __Pyx_GIVEREF(__pyx_tuple__41); __pyx_codeobj__42 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__41, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_tom_ab_pygame_sdl2_src_pyg, __pyx_n_s_event_name, 414, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__42)) __PYX_ERR(0, 414, __pyx_L1_error) /* "pygame_sdl2/event.pyx":420 * return "UNKNOWN" * * def set_blocked(t=None): # <<<<<<<<<<<<<< * if t == None: * for et in event_names.keys(): */ __pyx_tuple__43 = PyTuple_Pack(2, __pyx_n_s_t, __pyx_n_s_et); if (unlikely(!__pyx_tuple__43)) __PYX_ERR(0, 420, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__43); __Pyx_GIVEREF(__pyx_tuple__43); __pyx_codeobj__44 = (PyObject*)__Pyx_PyCode_New(1, 0, 2, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__43, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_tom_ab_pygame_sdl2_src_pyg, __pyx_n_s_set_blocked, 420, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__44)) __PYX_ERR(0, 420, __pyx_L1_error) /* "pygame_sdl2/event.pyx":430 * SDL_EventState(et, SDL_IGNORE) * * def set_allowed(t=None): # <<<<<<<<<<<<<< * if t == None: * for et in event_names.keys(): */ __pyx_tuple__45 = PyTuple_Pack(2, __pyx_n_s_t, __pyx_n_s_et); if (unlikely(!__pyx_tuple__45)) __PYX_ERR(0, 430, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__45); __Pyx_GIVEREF(__pyx_tuple__45); __pyx_codeobj__46 = (PyObject*)__Pyx_PyCode_New(1, 0, 2, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__45, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_tom_ab_pygame_sdl2_src_pyg, __pyx_n_s_set_allowed, 430, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__46)) __PYX_ERR(0, 430, __pyx_L1_error) /* "pygame_sdl2/event.pyx":440 * SDL_EventState(et, SDL_ENABLE) * * def get_blocked(t): # <<<<<<<<<<<<<< * return SDL_EventState(t, SDL_QUERY) == SDL_IGNORE * */ __pyx_tuple__47 = PyTuple_Pack(1, __pyx_n_s_t); if (unlikely(!__pyx_tuple__47)) __PYX_ERR(0, 440, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__47); __Pyx_GIVEREF(__pyx_tuple__47); __pyx_codeobj__48 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__47, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_tom_ab_pygame_sdl2_src_pyg, __pyx_n_s_get_blocked, 440, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__48)) __PYX_ERR(0, 440, __pyx_L1_error) /* "pygame_sdl2/event.pyx":443 * return SDL_EventState(t, SDL_QUERY) == SDL_IGNORE * * def set_grab(on): # <<<<<<<<<<<<<< * SDL_SetWindowGrab(main_window.window, on) * */ __pyx_tuple__49 = PyTuple_Pack(1, __pyx_n_s_on); if (unlikely(!__pyx_tuple__49)) __PYX_ERR(0, 443, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__49); __Pyx_GIVEREF(__pyx_tuple__49); __pyx_codeobj__50 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__49, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_tom_ab_pygame_sdl2_src_pyg, __pyx_n_s_set_grab, 443, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__50)) __PYX_ERR(0, 443, __pyx_L1_error) /* "pygame_sdl2/event.pyx":446 * SDL_SetWindowGrab(main_window.window, on) * * def get_grab(): # <<<<<<<<<<<<<< * return SDL_GetWindowGrab(main_window.window) * */ __pyx_codeobj__51 = (PyObject*)__Pyx_PyCode_New(0, 0, 0, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_tom_ab_pygame_sdl2_src_pyg, __pyx_n_s_get_grab, 446, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__51)) __PYX_ERR(0, 446, __pyx_L1_error) /* "pygame_sdl2/event.pyx":449 * return SDL_GetWindowGrab(main_window.window) * * def set_mousewheel_buttons(flag): # <<<<<<<<<<<<<< * """ * If true (the default), the mousewheel will generate events involving */ __pyx_tuple__52 = PyTuple_Pack(1, __pyx_n_s_flag); if (unlikely(!__pyx_tuple__52)) __PYX_ERR(0, 449, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__52); __Pyx_GIVEREF(__pyx_tuple__52); __pyx_codeobj__53 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__52, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_tom_ab_pygame_sdl2_src_pyg, __pyx_n_s_set_mousewheel_buttons, 449, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__53)) __PYX_ERR(0, 449, __pyx_L1_error) /* "pygame_sdl2/event.pyx":461 * mousewheel_buttons = flag * * def get_mousewheel_buttons(): # <<<<<<<<<<<<<< * """ * Returns the value set by mousehweel buttons,. */ __pyx_codeobj__54 = (PyObject*)__Pyx_PyCode_New(0, 0, 0, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_tom_ab_pygame_sdl2_src_pyg, __pyx_n_s_get_mousewheel_buttons, 461, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__54)) __PYX_ERR(0, 461, __pyx_L1_error) /* "pygame_sdl2/event.pyx":468 * return mousewheel_buttons * * def post(e): # <<<<<<<<<<<<<< * """ * Posts event object `e` to the event queue. */ __pyx_tuple__55 = PyTuple_Pack(2, __pyx_n_s_e, __pyx_n_s_event); if (unlikely(!__pyx_tuple__55)) __PYX_ERR(0, 468, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__55); __Pyx_GIVEREF(__pyx_tuple__55); __pyx_codeobj__56 = (PyObject*)__Pyx_PyCode_New(1, 0, 2, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__55, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_tom_ab_pygame_sdl2_src_pyg, __pyx_n_s_post, 468, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__56)) __PYX_ERR(0, 468, __pyx_L1_error) /* "pygame_sdl2/event.pyx":488 * SDL_PushEvent(&event) * * def register(name): # <<<<<<<<<<<<<< * """ * Registers a unique event number and returns that number. */ __pyx_tuple__57 = PyTuple_Pack(2, __pyx_n_s_name, __pyx_n_s_rv); if (unlikely(!__pyx_tuple__57)) __PYX_ERR(0, 488, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__57); __Pyx_GIVEREF(__pyx_tuple__57); __pyx_codeobj__58 = (PyObject*)__Pyx_PyCode_New(1, 0, 2, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__57, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_tom_ab_pygame_sdl2_src_pyg, __pyx_n_s_register, 488, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__58)) __PYX_ERR(0, 488, __pyx_L1_error) /* "pygame_sdl2/event.pyx":502 * return rv * * def copy_event_queue(): # <<<<<<<<<<<<<< * """ * Returns a copy of the event queue. The copy cannot be used for modifying */ __pyx_codeobj__59 = (PyObject*)__Pyx_PyCode_New(0, 0, 0, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_tom_ab_pygame_sdl2_src_pyg, __pyx_n_s_copy_event_queue, 502, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__59)) __PYX_ERR(0, 502, __pyx_L1_error) /* "pygame_sdl2/event.pyx":511 * * # Usually called by display.init. * def init(): # <<<<<<<<<<<<<< * if not SDL_WasInit(SDL_INIT_EVENTS): * */ __pyx_codeobj__60 = (PyObject*)__Pyx_PyCode_New(0, 0, 0, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_tom_ab_pygame_sdl2_src_pyg, __pyx_n_s_init_2, 511, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__60)) __PYX_ERR(0, 511, __pyx_L1_error) __Pyx_RefNannyFinishContext(); return 0; __pyx_L1_error:; __Pyx_RefNannyFinishContext(); return -1; } static int __Pyx_InitGlobals(void) { if (__Pyx_InitStrings(__pyx_string_tab) < 0) __PYX_ERR(0, 1, __pyx_L1_error); __pyx_int_0 = PyInt_FromLong(0); if (unlikely(!__pyx_int_0)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_int_1 = PyInt_FromLong(1); if (unlikely(!__pyx_int_1)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_int_2 = PyInt_FromLong(2); if (unlikely(!__pyx_int_2)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_int_3 = PyInt_FromLong(3); if (unlikely(!__pyx_int_3)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_int_4 = PyInt_FromLong(4); if (unlikely(!__pyx_int_4)) __PYX_ERR(0, 1, __pyx_L1_error) return 0; __pyx_L1_error:; return -1; } #if PY_MAJOR_VERSION < 3 PyMODINIT_FUNC initevent(void); /*proto*/ PyMODINIT_FUNC initevent(void) #else PyMODINIT_FUNC PyInit_event(void); /*proto*/ PyMODINIT_FUNC PyInit_event(void) #endif { PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; int __pyx_t_4; PyObject *__pyx_t_5 = NULL; PyObject *__pyx_t_6 = NULL; PyObject *__pyx_t_7 = NULL; __Pyx_RefNannyDeclarations #if CYTHON_REFNANNY __Pyx_RefNanny = __Pyx_RefNannyImportAPI("refnanny"); if (!__Pyx_RefNanny) { PyErr_Clear(); __Pyx_RefNanny = __Pyx_RefNannyImportAPI("Cython.Runtime.refnanny"); if (!__Pyx_RefNanny) Py_FatalError("failed to import 'refnanny' module"); } #endif __Pyx_RefNannySetupContext("PyMODINIT_FUNC PyInit_event(void)", 0); if (__Pyx_check_binary_version() < 0) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_empty_tuple = PyTuple_New(0); if (unlikely(!__pyx_empty_tuple)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_empty_bytes = PyBytes_FromStringAndSize("", 0); if (unlikely(!__pyx_empty_bytes)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_empty_unicode = PyUnicode_FromStringAndSize("", 0); if (unlikely(!__pyx_empty_unicode)) __PYX_ERR(0, 1, __pyx_L1_error) #ifdef __Pyx_CyFunction_USED if (__pyx_CyFunction_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error) #endif #ifdef __Pyx_FusedFunction_USED if (__pyx_FusedFunction_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error) #endif #ifdef __Pyx_Coroutine_USED if (__pyx_Coroutine_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error) #endif #ifdef __Pyx_Generator_USED if (__pyx_Generator_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error) #endif #ifdef __Pyx_StopAsyncIteration_USED if (__pyx_StopAsyncIteration_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error) #endif /*--- Library function declarations ---*/ /*--- Threads initialization code ---*/ #if defined(__PYX_FORCE_INIT_THREADS) && __PYX_FORCE_INIT_THREADS #ifdef WITH_THREAD /* Python build with threading support? */ PyEval_InitThreads(); #endif #endif /*--- Module creation code ---*/ #if PY_MAJOR_VERSION < 3 __pyx_m = Py_InitModule4("event", __pyx_methods, 0, 0, PYTHON_API_VERSION); Py_XINCREF(__pyx_m); #else __pyx_m = PyModule_Create(&__pyx_moduledef); #endif if (unlikely(!__pyx_m)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_d = PyModule_GetDict(__pyx_m); if (unlikely(!__pyx_d)) __PYX_ERR(0, 1, __pyx_L1_error) Py_INCREF(__pyx_d); __pyx_b = PyImport_AddModule(__Pyx_BUILTIN_MODULE_NAME); if (unlikely(!__pyx_b)) __PYX_ERR(0, 1, __pyx_L1_error) #if CYTHON_COMPILING_IN_PYPY Py_INCREF(__pyx_b); #endif if (PyObject_SetAttrString(__pyx_m, "__builtins__", __pyx_b) < 0) __PYX_ERR(0, 1, __pyx_L1_error); /*--- Initialize various global constants etc. ---*/ if (__Pyx_InitGlobals() < 0) __PYX_ERR(0, 1, __pyx_L1_error) #if PY_MAJOR_VERSION < 3 && (__PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT) if (__Pyx_init_sys_getdefaultencoding_params() < 0) __PYX_ERR(0, 1, __pyx_L1_error) #endif if (__pyx_module_is_main_pygame_sdl2__event) { if (PyObject_SetAttrString(__pyx_m, "__name__", __pyx_n_s_main) < 0) __PYX_ERR(0, 1, __pyx_L1_error) } #if PY_MAJOR_VERSION >= 3 { PyObject *modules = PyImport_GetModuleDict(); if (unlikely(!modules)) __PYX_ERR(0, 1, __pyx_L1_error) if (!PyDict_GetItemString(modules, "pygame_sdl2.event")) { if (unlikely(PyDict_SetItemString(modules, "pygame_sdl2.event", __pyx_m) < 0)) __PYX_ERR(0, 1, __pyx_L1_error) } } #endif /*--- Builtin init code ---*/ if (__Pyx_InitCachedBuiltins() < 0) __PYX_ERR(0, 1, __pyx_L1_error) /*--- Constants init code ---*/ if (__Pyx_InitCachedConstants() < 0) __PYX_ERR(0, 1, __pyx_L1_error) /*--- Global init code ---*/ event_queue = Py_None; Py_INCREF(Py_None); /*--- Variable export code ---*/ /*--- Function export code ---*/ /*--- Type init code ---*/ /*--- Type import code ---*/ __pyx_ptype_7cpython_4type_type = __Pyx_ImportType(__Pyx_BUILTIN_MODULE_NAME, "type", #if CYTHON_COMPILING_IN_PYPY sizeof(PyTypeObject), #else sizeof(PyHeapTypeObject), #endif 0); if (unlikely(!__pyx_ptype_7cpython_4type_type)) __PYX_ERR(1, 9, __pyx_L1_error) __pyx_ptype_11pygame_sdl2_7surface_Surface = __Pyx_ImportType("pygame_sdl2.surface", "Surface", sizeof(struct __pyx_obj_11pygame_sdl2_7surface_Surface), 1); if (unlikely(!__pyx_ptype_11pygame_sdl2_7surface_Surface)) __PYX_ERR(2, 23, __pyx_L1_error) __pyx_vtabptr_11pygame_sdl2_7surface_Surface = (struct __pyx_vtabstruct_11pygame_sdl2_7surface_Surface*)__Pyx_GetVtable(__pyx_ptype_11pygame_sdl2_7surface_Surface->tp_dict); if (unlikely(!__pyx_vtabptr_11pygame_sdl2_7surface_Surface)) __PYX_ERR(2, 23, __pyx_L1_error) __pyx_ptype_11pygame_sdl2_7display_Window = __Pyx_ImportType("pygame_sdl2.display", "Window", sizeof(struct __pyx_obj_11pygame_sdl2_7display_Window), 1); if (unlikely(!__pyx_ptype_11pygame_sdl2_7display_Window)) __PYX_ERR(3, 23, __pyx_L1_error) /*--- Variable import code ---*/ __pyx_t_1 = __Pyx_ImportModule("pygame_sdl2.display"); if (!__pyx_t_1) __PYX_ERR(0, 1, __pyx_L1_error) if (__Pyx_ImportVoidPtr(__pyx_t_1, "main_window", (void **)&__pyx_vp_11pygame_sdl2_7display_main_window, "struct __pyx_obj_11pygame_sdl2_7display_Window *") < 0) __PYX_ERR(0, 1, __pyx_L1_error) Py_DECREF(__pyx_t_1); __pyx_t_1 = 0; /*--- Function import code ---*/ /*--- Execution code ---*/ #if defined(__Pyx_Generator_USED) || defined(__Pyx_Coroutine_USED) if (__Pyx_patch_abc() < 0) __PYX_ERR(0, 1, __pyx_L1_error) #endif /* "pygame_sdl2/event.pyx":24 * from sdl2 cimport * * from pygame_sdl2.display cimport Window, main_window * import threading # <<<<<<<<<<<<<< * import pygame_sdl2 * import sys */ __pyx_t_2 = __Pyx_Import(__pyx_n_s_threading, 0, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 24, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_threading, __pyx_t_2) < 0) __PYX_ERR(0, 24, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "pygame_sdl2/event.pyx":25 * from pygame_sdl2.display cimport Window, main_window * import threading * import pygame_sdl2 # <<<<<<<<<<<<<< * import sys * */ __pyx_t_2 = __Pyx_Import(__pyx_n_s_pygame_sdl2, 0, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 25, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_pygame_sdl2, __pyx_t_2) < 0) __PYX_ERR(0, 25, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "pygame_sdl2/event.pyx":26 * import threading * import pygame_sdl2 * import sys # <<<<<<<<<<<<<< * * if sys.version_info[0] >= 3: */ __pyx_t_2 = __Pyx_Import(__pyx_n_s_sys, 0, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 26, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_sys, __pyx_t_2) < 0) __PYX_ERR(0, 26, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "pygame_sdl2/event.pyx":28 * import sys * * if sys.version_info[0] >= 3: # <<<<<<<<<<<<<< * unichr = chr * */ __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_sys); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 28, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_version_info); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 28, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_2 = __Pyx_GetItemInt(__pyx_t_3, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 28, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_3 = PyObject_RichCompare(__pyx_t_2, __pyx_int_3, Py_GE); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 28, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(0, 28, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; if (__pyx_t_4) { /* "pygame_sdl2/event.pyx":29 * * if sys.version_info[0] >= 3: * unichr = chr # <<<<<<<<<<<<<< * * include "event_names.pxi" */ if (PyDict_SetItem(__pyx_d, __pyx_n_s_unichr, __pyx_builtin_chr) < 0) __PYX_ERR(0, 29, __pyx_L1_error) /* "pygame_sdl2/event.pyx":28 * import sys * * if sys.version_info[0] >= 3: # <<<<<<<<<<<<<< * unichr = chr * */ } /* "include/event_names.pxi":5 * * event_names = { * SDL_FIRSTEVENT : u'NOEVENT', # <<<<<<<<<<<<<< * SDL_QUIT : 'QUIT', * SDL_APP_TERMINATING : 'APP_TERMINATING', */ __pyx_t_3 = PyDict_New(); if (unlikely(!__pyx_t_3)) __PYX_ERR(4, 5, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_2 = __Pyx_PyInt_From_SDL_EventType(SDL_FIRSTEVENT); if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 5, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_t_3, __pyx_t_2, __pyx_n_u_NOEVENT) < 0) __PYX_ERR(4, 5, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "include/event_names.pxi":6 * event_names = { * SDL_FIRSTEVENT : u'NOEVENT', * SDL_QUIT : 'QUIT', # <<<<<<<<<<<<<< * SDL_APP_TERMINATING : 'APP_TERMINATING', * SDL_APP_LOWMEMORY : 'APP_LOWMEMORY', */ __pyx_t_2 = __Pyx_PyInt_From_SDL_EventType(SDL_QUIT); if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 6, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_t_3, __pyx_t_2, __pyx_n_u_QUIT) < 0) __PYX_ERR(4, 5, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "include/event_names.pxi":7 * SDL_FIRSTEVENT : u'NOEVENT', * SDL_QUIT : 'QUIT', * SDL_APP_TERMINATING : 'APP_TERMINATING', # <<<<<<<<<<<<<< * SDL_APP_LOWMEMORY : 'APP_LOWMEMORY', * SDL_APP_WILLENTERBACKGROUND : 'APP_WILLENTERBACKGROUND', */ __pyx_t_2 = __Pyx_PyInt_From_SDL_EventType(SDL_APP_TERMINATING); if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 7, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_t_3, __pyx_t_2, __pyx_n_u_APP_TERMINATING) < 0) __PYX_ERR(4, 5, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "include/event_names.pxi":8 * SDL_QUIT : 'QUIT', * SDL_APP_TERMINATING : 'APP_TERMINATING', * SDL_APP_LOWMEMORY : 'APP_LOWMEMORY', # <<<<<<<<<<<<<< * SDL_APP_WILLENTERBACKGROUND : 'APP_WILLENTERBACKGROUND', * SDL_APP_DIDENTERBACKGROUND : 'APP_DIDENTERBACKGROUND', */ __pyx_t_2 = __Pyx_PyInt_From_SDL_EventType(SDL_APP_LOWMEMORY); if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 8, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_t_3, __pyx_t_2, __pyx_n_u_APP_LOWMEMORY) < 0) __PYX_ERR(4, 5, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "include/event_names.pxi":9 * SDL_APP_TERMINATING : 'APP_TERMINATING', * SDL_APP_LOWMEMORY : 'APP_LOWMEMORY', * SDL_APP_WILLENTERBACKGROUND : 'APP_WILLENTERBACKGROUND', # <<<<<<<<<<<<<< * SDL_APP_DIDENTERBACKGROUND : 'APP_DIDENTERBACKGROUND', * SDL_APP_WILLENTERFOREGROUND : 'APP_WILLENTERFOREGROUND', */ __pyx_t_2 = __Pyx_PyInt_From_SDL_EventType(SDL_APP_WILLENTERBACKGROUND); if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 9, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_t_3, __pyx_t_2, __pyx_n_u_APP_WILLENTERBACKGROUND) < 0) __PYX_ERR(4, 5, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "include/event_names.pxi":10 * SDL_APP_LOWMEMORY : 'APP_LOWMEMORY', * SDL_APP_WILLENTERBACKGROUND : 'APP_WILLENTERBACKGROUND', * SDL_APP_DIDENTERBACKGROUND : 'APP_DIDENTERBACKGROUND', # <<<<<<<<<<<<<< * SDL_APP_WILLENTERFOREGROUND : 'APP_WILLENTERFOREGROUND', * SDL_APP_DIDENTERFOREGROUND : 'APP_DIDENTERFOREGROUND', */ __pyx_t_2 = __Pyx_PyInt_From_SDL_EventType(SDL_APP_DIDENTERBACKGROUND); if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 10, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_t_3, __pyx_t_2, __pyx_n_u_APP_DIDENTERBACKGROUND) < 0) __PYX_ERR(4, 5, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "include/event_names.pxi":11 * SDL_APP_WILLENTERBACKGROUND : 'APP_WILLENTERBACKGROUND', * SDL_APP_DIDENTERBACKGROUND : 'APP_DIDENTERBACKGROUND', * SDL_APP_WILLENTERFOREGROUND : 'APP_WILLENTERFOREGROUND', # <<<<<<<<<<<<<< * SDL_APP_DIDENTERFOREGROUND : 'APP_DIDENTERFOREGROUND', * SDL_WINDOWEVENT : 'WINDOWEVENT', */ __pyx_t_2 = __Pyx_PyInt_From_SDL_EventType(SDL_APP_WILLENTERFOREGROUND); if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 11, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_t_3, __pyx_t_2, __pyx_n_u_APP_WILLENTERFOREGROUND) < 0) __PYX_ERR(4, 5, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "include/event_names.pxi":12 * SDL_APP_DIDENTERBACKGROUND : 'APP_DIDENTERBACKGROUND', * SDL_APP_WILLENTERFOREGROUND : 'APP_WILLENTERFOREGROUND', * SDL_APP_DIDENTERFOREGROUND : 'APP_DIDENTERFOREGROUND', # <<<<<<<<<<<<<< * SDL_WINDOWEVENT : 'WINDOWEVENT', * SDL_SYSWMEVENT : 'SYSWMEVENT', */ __pyx_t_2 = __Pyx_PyInt_From_SDL_EventType(SDL_APP_DIDENTERFOREGROUND); if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 12, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_t_3, __pyx_t_2, __pyx_n_u_APP_DIDENTERFOREGROUND) < 0) __PYX_ERR(4, 5, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "include/event_names.pxi":13 * SDL_APP_WILLENTERFOREGROUND : 'APP_WILLENTERFOREGROUND', * SDL_APP_DIDENTERFOREGROUND : 'APP_DIDENTERFOREGROUND', * SDL_WINDOWEVENT : 'WINDOWEVENT', # <<<<<<<<<<<<<< * SDL_SYSWMEVENT : 'SYSWMEVENT', * SDL_KEYDOWN : 'KEYDOWN', */ __pyx_t_2 = __Pyx_PyInt_From_SDL_EventType(SDL_WINDOWEVENT); if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 13, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_t_3, __pyx_t_2, __pyx_n_u_WINDOWEVENT) < 0) __PYX_ERR(4, 5, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "include/event_names.pxi":14 * SDL_APP_DIDENTERFOREGROUND : 'APP_DIDENTERFOREGROUND', * SDL_WINDOWEVENT : 'WINDOWEVENT', * SDL_SYSWMEVENT : 'SYSWMEVENT', # <<<<<<<<<<<<<< * SDL_KEYDOWN : 'KEYDOWN', * SDL_KEYUP : 'KEYUP', */ __pyx_t_2 = __Pyx_PyInt_From_SDL_EventType(SDL_SYSWMEVENT); if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 14, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_t_3, __pyx_t_2, __pyx_n_u_SYSWMEVENT) < 0) __PYX_ERR(4, 5, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "include/event_names.pxi":15 * SDL_WINDOWEVENT : 'WINDOWEVENT', * SDL_SYSWMEVENT : 'SYSWMEVENT', * SDL_KEYDOWN : 'KEYDOWN', # <<<<<<<<<<<<<< * SDL_KEYUP : 'KEYUP', * SDL_TEXTEDITING : 'TEXTEDITING', */ __pyx_t_2 = __Pyx_PyInt_From_SDL_EventType(SDL_KEYDOWN); if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 15, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_t_3, __pyx_t_2, __pyx_n_u_KEYDOWN) < 0) __PYX_ERR(4, 5, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "include/event_names.pxi":16 * SDL_SYSWMEVENT : 'SYSWMEVENT', * SDL_KEYDOWN : 'KEYDOWN', * SDL_KEYUP : 'KEYUP', # <<<<<<<<<<<<<< * SDL_TEXTEDITING : 'TEXTEDITING', * SDL_TEXTINPUT : 'TEXTINPUT', */ __pyx_t_2 = __Pyx_PyInt_From_SDL_EventType(SDL_KEYUP); if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 16, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_t_3, __pyx_t_2, __pyx_n_u_KEYUP) < 0) __PYX_ERR(4, 5, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "include/event_names.pxi":17 * SDL_KEYDOWN : 'KEYDOWN', * SDL_KEYUP : 'KEYUP', * SDL_TEXTEDITING : 'TEXTEDITING', # <<<<<<<<<<<<<< * SDL_TEXTINPUT : 'TEXTINPUT', * SDL_MOUSEMOTION : 'MOUSEMOTION', */ __pyx_t_2 = __Pyx_PyInt_From_SDL_EventType(SDL_TEXTEDITING); if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 17, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_t_3, __pyx_t_2, __pyx_n_u_TEXTEDITING) < 0) __PYX_ERR(4, 5, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "include/event_names.pxi":18 * SDL_KEYUP : 'KEYUP', * SDL_TEXTEDITING : 'TEXTEDITING', * SDL_TEXTINPUT : 'TEXTINPUT', # <<<<<<<<<<<<<< * SDL_MOUSEMOTION : 'MOUSEMOTION', * SDL_MOUSEBUTTONDOWN : 'MOUSEBUTTONDOWN', */ __pyx_t_2 = __Pyx_PyInt_From_SDL_EventType(SDL_TEXTINPUT); if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 18, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_t_3, __pyx_t_2, __pyx_n_u_TEXTINPUT) < 0) __PYX_ERR(4, 5, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "include/event_names.pxi":19 * SDL_TEXTEDITING : 'TEXTEDITING', * SDL_TEXTINPUT : 'TEXTINPUT', * SDL_MOUSEMOTION : 'MOUSEMOTION', # <<<<<<<<<<<<<< * SDL_MOUSEBUTTONDOWN : 'MOUSEBUTTONDOWN', * SDL_MOUSEBUTTONUP : 'MOUSEBUTTONUP', */ __pyx_t_2 = __Pyx_PyInt_From_SDL_EventType(SDL_MOUSEMOTION); if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 19, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_t_3, __pyx_t_2, __pyx_n_u_MOUSEMOTION) < 0) __PYX_ERR(4, 5, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "include/event_names.pxi":20 * SDL_TEXTINPUT : 'TEXTINPUT', * SDL_MOUSEMOTION : 'MOUSEMOTION', * SDL_MOUSEBUTTONDOWN : 'MOUSEBUTTONDOWN', # <<<<<<<<<<<<<< * SDL_MOUSEBUTTONUP : 'MOUSEBUTTONUP', * SDL_MOUSEWHEEL : 'MOUSEWHEEL', */ __pyx_t_2 = __Pyx_PyInt_From_SDL_EventType(SDL_MOUSEBUTTONDOWN); if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 20, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_t_3, __pyx_t_2, __pyx_n_u_MOUSEBUTTONDOWN) < 0) __PYX_ERR(4, 5, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "include/event_names.pxi":21 * SDL_MOUSEMOTION : 'MOUSEMOTION', * SDL_MOUSEBUTTONDOWN : 'MOUSEBUTTONDOWN', * SDL_MOUSEBUTTONUP : 'MOUSEBUTTONUP', # <<<<<<<<<<<<<< * SDL_MOUSEWHEEL : 'MOUSEWHEEL', * SDL_JOYAXISMOTION : 'JOYAXISMOTION', */ __pyx_t_2 = __Pyx_PyInt_From_SDL_EventType(SDL_MOUSEBUTTONUP); if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 21, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_t_3, __pyx_t_2, __pyx_n_u_MOUSEBUTTONUP) < 0) __PYX_ERR(4, 5, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "include/event_names.pxi":22 * SDL_MOUSEBUTTONDOWN : 'MOUSEBUTTONDOWN', * SDL_MOUSEBUTTONUP : 'MOUSEBUTTONUP', * SDL_MOUSEWHEEL : 'MOUSEWHEEL', # <<<<<<<<<<<<<< * SDL_JOYAXISMOTION : 'JOYAXISMOTION', * SDL_JOYBALLMOTION : 'JOYBALLMOTION', */ __pyx_t_2 = __Pyx_PyInt_From_SDL_EventType(SDL_MOUSEWHEEL); if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 22, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_t_3, __pyx_t_2, __pyx_n_u_MOUSEWHEEL) < 0) __PYX_ERR(4, 5, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "include/event_names.pxi":23 * SDL_MOUSEBUTTONUP : 'MOUSEBUTTONUP', * SDL_MOUSEWHEEL : 'MOUSEWHEEL', * SDL_JOYAXISMOTION : 'JOYAXISMOTION', # <<<<<<<<<<<<<< * SDL_JOYBALLMOTION : 'JOYBALLMOTION', * SDL_JOYHATMOTION : 'JOYHATMOTION', */ __pyx_t_2 = __Pyx_PyInt_From_SDL_EventType(SDL_JOYAXISMOTION); if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 23, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_t_3, __pyx_t_2, __pyx_n_u_JOYAXISMOTION) < 0) __PYX_ERR(4, 5, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "include/event_names.pxi":24 * SDL_MOUSEWHEEL : 'MOUSEWHEEL', * SDL_JOYAXISMOTION : 'JOYAXISMOTION', * SDL_JOYBALLMOTION : 'JOYBALLMOTION', # <<<<<<<<<<<<<< * SDL_JOYHATMOTION : 'JOYHATMOTION', * SDL_JOYBUTTONDOWN : 'JOYBUTTONDOWN', */ __pyx_t_2 = __Pyx_PyInt_From_SDL_EventType(SDL_JOYBALLMOTION); if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 24, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_t_3, __pyx_t_2, __pyx_n_u_JOYBALLMOTION) < 0) __PYX_ERR(4, 5, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "include/event_names.pxi":25 * SDL_JOYAXISMOTION : 'JOYAXISMOTION', * SDL_JOYBALLMOTION : 'JOYBALLMOTION', * SDL_JOYHATMOTION : 'JOYHATMOTION', # <<<<<<<<<<<<<< * SDL_JOYBUTTONDOWN : 'JOYBUTTONDOWN', * SDL_JOYBUTTONUP : 'JOYBUTTONUP', */ __pyx_t_2 = __Pyx_PyInt_From_SDL_EventType(SDL_JOYHATMOTION); if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 25, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_t_3, __pyx_t_2, __pyx_n_u_JOYHATMOTION) < 0) __PYX_ERR(4, 5, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "include/event_names.pxi":26 * SDL_JOYBALLMOTION : 'JOYBALLMOTION', * SDL_JOYHATMOTION : 'JOYHATMOTION', * SDL_JOYBUTTONDOWN : 'JOYBUTTONDOWN', # <<<<<<<<<<<<<< * SDL_JOYBUTTONUP : 'JOYBUTTONUP', * SDL_JOYDEVICEADDED : 'JOYDEVICEADDED', */ __pyx_t_2 = __Pyx_PyInt_From_SDL_EventType(SDL_JOYBUTTONDOWN); if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 26, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_t_3, __pyx_t_2, __pyx_n_u_JOYBUTTONDOWN) < 0) __PYX_ERR(4, 5, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "include/event_names.pxi":27 * SDL_JOYHATMOTION : 'JOYHATMOTION', * SDL_JOYBUTTONDOWN : 'JOYBUTTONDOWN', * SDL_JOYBUTTONUP : 'JOYBUTTONUP', # <<<<<<<<<<<<<< * SDL_JOYDEVICEADDED : 'JOYDEVICEADDED', * SDL_JOYDEVICEREMOVED : 'JOYDEVICEREMOVED', */ __pyx_t_2 = __Pyx_PyInt_From_SDL_EventType(SDL_JOYBUTTONUP); if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 27, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_t_3, __pyx_t_2, __pyx_n_u_JOYBUTTONUP) < 0) __PYX_ERR(4, 5, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "include/event_names.pxi":28 * SDL_JOYBUTTONDOWN : 'JOYBUTTONDOWN', * SDL_JOYBUTTONUP : 'JOYBUTTONUP', * SDL_JOYDEVICEADDED : 'JOYDEVICEADDED', # <<<<<<<<<<<<<< * SDL_JOYDEVICEREMOVED : 'JOYDEVICEREMOVED', * SDL_CONTROLLERAXISMOTION : 'CONTROLLERAXISMOTION', */ __pyx_t_2 = __Pyx_PyInt_From_SDL_EventType(SDL_JOYDEVICEADDED); if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 28, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_t_3, __pyx_t_2, __pyx_n_u_JOYDEVICEADDED) < 0) __PYX_ERR(4, 5, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "include/event_names.pxi":29 * SDL_JOYBUTTONUP : 'JOYBUTTONUP', * SDL_JOYDEVICEADDED : 'JOYDEVICEADDED', * SDL_JOYDEVICEREMOVED : 'JOYDEVICEREMOVED', # <<<<<<<<<<<<<< * SDL_CONTROLLERAXISMOTION : 'CONTROLLERAXISMOTION', * SDL_CONTROLLERBUTTONDOWN : 'CONTROLLERBUTTONDOWN', */ __pyx_t_2 = __Pyx_PyInt_From_SDL_EventType(SDL_JOYDEVICEREMOVED); if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 29, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_t_3, __pyx_t_2, __pyx_n_u_JOYDEVICEREMOVED) < 0) __PYX_ERR(4, 5, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "include/event_names.pxi":30 * SDL_JOYDEVICEADDED : 'JOYDEVICEADDED', * SDL_JOYDEVICEREMOVED : 'JOYDEVICEREMOVED', * SDL_CONTROLLERAXISMOTION : 'CONTROLLERAXISMOTION', # <<<<<<<<<<<<<< * SDL_CONTROLLERBUTTONDOWN : 'CONTROLLERBUTTONDOWN', * SDL_CONTROLLERBUTTONUP : 'CONTROLLERBUTTONUP', */ __pyx_t_2 = __Pyx_PyInt_From_SDL_EventType(SDL_CONTROLLERAXISMOTION); if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 30, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_t_3, __pyx_t_2, __pyx_n_u_CONTROLLERAXISMOTION) < 0) __PYX_ERR(4, 5, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "include/event_names.pxi":31 * SDL_JOYDEVICEREMOVED : 'JOYDEVICEREMOVED', * SDL_CONTROLLERAXISMOTION : 'CONTROLLERAXISMOTION', * SDL_CONTROLLERBUTTONDOWN : 'CONTROLLERBUTTONDOWN', # <<<<<<<<<<<<<< * SDL_CONTROLLERBUTTONUP : 'CONTROLLERBUTTONUP', * SDL_CONTROLLERDEVICEADDED : 'CONTROLLERDEVICEADDED', */ __pyx_t_2 = __Pyx_PyInt_From_SDL_EventType(SDL_CONTROLLERBUTTONDOWN); if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 31, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_t_3, __pyx_t_2, __pyx_n_u_CONTROLLERBUTTONDOWN) < 0) __PYX_ERR(4, 5, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "include/event_names.pxi":32 * SDL_CONTROLLERAXISMOTION : 'CONTROLLERAXISMOTION', * SDL_CONTROLLERBUTTONDOWN : 'CONTROLLERBUTTONDOWN', * SDL_CONTROLLERBUTTONUP : 'CONTROLLERBUTTONUP', # <<<<<<<<<<<<<< * SDL_CONTROLLERDEVICEADDED : 'CONTROLLERDEVICEADDED', * SDL_CONTROLLERDEVICEREMOVED : 'CONTROLLERDEVICEREMOVED', */ __pyx_t_2 = __Pyx_PyInt_From_SDL_EventType(SDL_CONTROLLERBUTTONUP); if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 32, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_t_3, __pyx_t_2, __pyx_n_u_CONTROLLERBUTTONUP) < 0) __PYX_ERR(4, 5, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "include/event_names.pxi":33 * SDL_CONTROLLERBUTTONDOWN : 'CONTROLLERBUTTONDOWN', * SDL_CONTROLLERBUTTONUP : 'CONTROLLERBUTTONUP', * SDL_CONTROLLERDEVICEADDED : 'CONTROLLERDEVICEADDED', # <<<<<<<<<<<<<< * SDL_CONTROLLERDEVICEREMOVED : 'CONTROLLERDEVICEREMOVED', * SDL_CONTROLLERDEVICEREMAPPED : 'CONTROLLERDEVICEREMAPPED', */ __pyx_t_2 = __Pyx_PyInt_From_SDL_EventType(SDL_CONTROLLERDEVICEADDED); if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 33, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_t_3, __pyx_t_2, __pyx_n_u_CONTROLLERDEVICEADDED) < 0) __PYX_ERR(4, 5, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "include/event_names.pxi":34 * SDL_CONTROLLERBUTTONUP : 'CONTROLLERBUTTONUP', * SDL_CONTROLLERDEVICEADDED : 'CONTROLLERDEVICEADDED', * SDL_CONTROLLERDEVICEREMOVED : 'CONTROLLERDEVICEREMOVED', # <<<<<<<<<<<<<< * SDL_CONTROLLERDEVICEREMAPPED : 'CONTROLLERDEVICEREMAPPED', * SDL_FINGERDOWN : 'FINGERDOWN', */ __pyx_t_2 = __Pyx_PyInt_From_SDL_EventType(SDL_CONTROLLERDEVICEREMOVED); if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 34, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_t_3, __pyx_t_2, __pyx_n_u_CONTROLLERDEVICEREMOVED) < 0) __PYX_ERR(4, 5, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "include/event_names.pxi":35 * SDL_CONTROLLERDEVICEADDED : 'CONTROLLERDEVICEADDED', * SDL_CONTROLLERDEVICEREMOVED : 'CONTROLLERDEVICEREMOVED', * SDL_CONTROLLERDEVICEREMAPPED : 'CONTROLLERDEVICEREMAPPED', # <<<<<<<<<<<<<< * SDL_FINGERDOWN : 'FINGERDOWN', * SDL_FINGERUP : 'FINGERUP', */ __pyx_t_2 = __Pyx_PyInt_From_SDL_EventType(SDL_CONTROLLERDEVICEREMAPPED); if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 35, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_t_3, __pyx_t_2, __pyx_n_u_CONTROLLERDEVICEREMAPPED) < 0) __PYX_ERR(4, 5, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "include/event_names.pxi":36 * SDL_CONTROLLERDEVICEREMOVED : 'CONTROLLERDEVICEREMOVED', * SDL_CONTROLLERDEVICEREMAPPED : 'CONTROLLERDEVICEREMAPPED', * SDL_FINGERDOWN : 'FINGERDOWN', # <<<<<<<<<<<<<< * SDL_FINGERUP : 'FINGERUP', * SDL_FINGERMOTION : 'FINGERMOTION', */ __pyx_t_2 = __Pyx_PyInt_From_SDL_EventType(SDL_FINGERDOWN); if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 36, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_t_3, __pyx_t_2, __pyx_n_u_FINGERDOWN) < 0) __PYX_ERR(4, 5, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "include/event_names.pxi":37 * SDL_CONTROLLERDEVICEREMAPPED : 'CONTROLLERDEVICEREMAPPED', * SDL_FINGERDOWN : 'FINGERDOWN', * SDL_FINGERUP : 'FINGERUP', # <<<<<<<<<<<<<< * SDL_FINGERMOTION : 'FINGERMOTION', * SDL_DOLLARGESTURE : 'DOLLARGESTURE', */ __pyx_t_2 = __Pyx_PyInt_From_SDL_EventType(SDL_FINGERUP); if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 37, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_t_3, __pyx_t_2, __pyx_n_u_FINGERUP) < 0) __PYX_ERR(4, 5, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "include/event_names.pxi":38 * SDL_FINGERDOWN : 'FINGERDOWN', * SDL_FINGERUP : 'FINGERUP', * SDL_FINGERMOTION : 'FINGERMOTION', # <<<<<<<<<<<<<< * SDL_DOLLARGESTURE : 'DOLLARGESTURE', * SDL_DOLLARRECORD : 'DOLLARRECORD', */ __pyx_t_2 = __Pyx_PyInt_From_SDL_EventType(SDL_FINGERMOTION); if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 38, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_t_3, __pyx_t_2, __pyx_n_u_FINGERMOTION) < 0) __PYX_ERR(4, 5, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "include/event_names.pxi":39 * SDL_FINGERUP : 'FINGERUP', * SDL_FINGERMOTION : 'FINGERMOTION', * SDL_DOLLARGESTURE : 'DOLLARGESTURE', # <<<<<<<<<<<<<< * SDL_DOLLARRECORD : 'DOLLARRECORD', * SDL_MULTIGESTURE : 'MULTIGESTURE', */ __pyx_t_2 = __Pyx_PyInt_From_SDL_EventType(SDL_DOLLARGESTURE); if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 39, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_t_3, __pyx_t_2, __pyx_n_u_DOLLARGESTURE) < 0) __PYX_ERR(4, 5, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "include/event_names.pxi":40 * SDL_FINGERMOTION : 'FINGERMOTION', * SDL_DOLLARGESTURE : 'DOLLARGESTURE', * SDL_DOLLARRECORD : 'DOLLARRECORD', # <<<<<<<<<<<<<< * SDL_MULTIGESTURE : 'MULTIGESTURE', * SDL_CLIPBOARDUPDATE : 'CLIPBOARDUPDATE', */ __pyx_t_2 = __Pyx_PyInt_From_SDL_EventType(SDL_DOLLARRECORD); if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 40, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_t_3, __pyx_t_2, __pyx_n_u_DOLLARRECORD) < 0) __PYX_ERR(4, 5, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "include/event_names.pxi":41 * SDL_DOLLARGESTURE : 'DOLLARGESTURE', * SDL_DOLLARRECORD : 'DOLLARRECORD', * SDL_MULTIGESTURE : 'MULTIGESTURE', # <<<<<<<<<<<<<< * SDL_CLIPBOARDUPDATE : 'CLIPBOARDUPDATE', * SDL_DROPFILE : 'DROPFILE', */ __pyx_t_2 = __Pyx_PyInt_From_SDL_EventType(SDL_MULTIGESTURE); if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 41, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_t_3, __pyx_t_2, __pyx_n_u_MULTIGESTURE) < 0) __PYX_ERR(4, 5, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "include/event_names.pxi":42 * SDL_DOLLARRECORD : 'DOLLARRECORD', * SDL_MULTIGESTURE : 'MULTIGESTURE', * SDL_CLIPBOARDUPDATE : 'CLIPBOARDUPDATE', # <<<<<<<<<<<<<< * SDL_DROPFILE : 'DROPFILE', * SDL_RENDER_TARGETS_RESET : 'RENDER_TARGETS_RESET', */ __pyx_t_2 = __Pyx_PyInt_From_SDL_EventType(SDL_CLIPBOARDUPDATE); if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 42, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_t_3, __pyx_t_2, __pyx_n_u_CLIPBOARDUPDATE) < 0) __PYX_ERR(4, 5, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "include/event_names.pxi":43 * SDL_MULTIGESTURE : 'MULTIGESTURE', * SDL_CLIPBOARDUPDATE : 'CLIPBOARDUPDATE', * SDL_DROPFILE : 'DROPFILE', # <<<<<<<<<<<<<< * SDL_RENDER_TARGETS_RESET : 'RENDER_TARGETS_RESET', * SDL_USEREVENT : 'USEREVENT', */ __pyx_t_2 = __Pyx_PyInt_From_SDL_EventType(SDL_DROPFILE); if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 43, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_t_3, __pyx_t_2, __pyx_n_u_DROPFILE) < 0) __PYX_ERR(4, 5, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "include/event_names.pxi":44 * SDL_CLIPBOARDUPDATE : 'CLIPBOARDUPDATE', * SDL_DROPFILE : 'DROPFILE', * SDL_RENDER_TARGETS_RESET : 'RENDER_TARGETS_RESET', # <<<<<<<<<<<<<< * SDL_USEREVENT : 'USEREVENT', * SDL_LASTEVENT : 'LASTEVENT', */ __pyx_t_2 = __Pyx_PyInt_From_SDL_EventType(SDL_RENDER_TARGETS_RESET); if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 44, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_t_3, __pyx_t_2, __pyx_n_u_RENDER_TARGETS_RESET) < 0) __PYX_ERR(4, 5, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "include/event_names.pxi":45 * SDL_DROPFILE : 'DROPFILE', * SDL_RENDER_TARGETS_RESET : 'RENDER_TARGETS_RESET', * SDL_USEREVENT : 'USEREVENT', # <<<<<<<<<<<<<< * SDL_LASTEVENT : 'LASTEVENT', * } */ __pyx_t_2 = __Pyx_PyInt_From_SDL_EventType(SDL_USEREVENT); if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 45, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_t_3, __pyx_t_2, __pyx_n_u_USEREVENT) < 0) __PYX_ERR(4, 5, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "include/event_names.pxi":46 * SDL_RENDER_TARGETS_RESET : 'RENDER_TARGETS_RESET', * SDL_USEREVENT : 'USEREVENT', * SDL_LASTEVENT : 'LASTEVENT', # <<<<<<<<<<<<<< * } */ __pyx_t_2 = __Pyx_PyInt_From_SDL_EventType(SDL_LASTEVENT); if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 46, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_t_3, __pyx_t_2, __pyx_n_u_LASTEVENT) < 0) __PYX_ERR(4, 5, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; if (PyDict_SetItem(__pyx_d, __pyx_n_s_event_names, __pyx_t_3) < 0) __PYX_ERR(4, 4, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "pygame_sdl2/event.pyx":34 * * # Add events to emulate SDL 1.2. These also need to be added in locals. * ACTIVEEVENT = SDL_LASTEVENT - 1 # <<<<<<<<<<<<<< * VIDEORESIZE = SDL_LASTEVENT - 2 * VIDEOEXPOSE = SDL_LASTEVENT - 3 */ __pyx_t_3 = __Pyx_PyInt_From_long((SDL_LASTEVENT - 1)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 34, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); if (PyDict_SetItem(__pyx_d, __pyx_n_s_ACTIVEEVENT, __pyx_t_3) < 0) __PYX_ERR(0, 34, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "pygame_sdl2/event.pyx":35 * # Add events to emulate SDL 1.2. These also need to be added in locals. * ACTIVEEVENT = SDL_LASTEVENT - 1 * VIDEORESIZE = SDL_LASTEVENT - 2 # <<<<<<<<<<<<<< * VIDEOEXPOSE = SDL_LASTEVENT - 3 * */ __pyx_t_3 = __Pyx_PyInt_From_long((SDL_LASTEVENT - 2)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 35, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); if (PyDict_SetItem(__pyx_d, __pyx_n_s_VIDEORESIZE, __pyx_t_3) < 0) __PYX_ERR(0, 35, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "pygame_sdl2/event.pyx":36 * ACTIVEEVENT = SDL_LASTEVENT - 1 * VIDEORESIZE = SDL_LASTEVENT - 2 * VIDEOEXPOSE = SDL_LASTEVENT - 3 # <<<<<<<<<<<<<< * * event_names[ACTIVEEVENT] = "ACTIVEEVENT" */ __pyx_t_3 = __Pyx_PyInt_From_long((SDL_LASTEVENT - 3)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 36, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); if (PyDict_SetItem(__pyx_d, __pyx_n_s_VIDEOEXPOSE, __pyx_t_3) < 0) __PYX_ERR(0, 36, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "pygame_sdl2/event.pyx":38 * VIDEOEXPOSE = SDL_LASTEVENT - 3 * * event_names[ACTIVEEVENT] = "ACTIVEEVENT" # <<<<<<<<<<<<<< * event_names[VIDEORESIZE] = "VIDEORESIZE" * event_names[VIDEOEXPOSE] = "VIDEOEXPOSE" */ __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_event_names); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 38, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_ACTIVEEVENT); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 38, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (unlikely(PyObject_SetItem(__pyx_t_3, __pyx_t_2, __pyx_n_u_ACTIVEEVENT) < 0)) __PYX_ERR(0, 38, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "pygame_sdl2/event.pyx":39 * * event_names[ACTIVEEVENT] = "ACTIVEEVENT" * event_names[VIDEORESIZE] = "VIDEORESIZE" # <<<<<<<<<<<<<< * event_names[VIDEOEXPOSE] = "VIDEOEXPOSE" * */ __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_event_names); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 39, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_VIDEORESIZE); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 39, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); if (unlikely(PyObject_SetItem(__pyx_t_2, __pyx_t_3, __pyx_n_u_VIDEORESIZE) < 0)) __PYX_ERR(0, 39, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "pygame_sdl2/event.pyx":40 * event_names[ACTIVEEVENT] = "ACTIVEEVENT" * event_names[VIDEORESIZE] = "VIDEORESIZE" * event_names[VIDEOEXPOSE] = "VIDEOEXPOSE" # <<<<<<<<<<<<<< * * # This is used for events posted to the event queue. This won't be returned */ __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_event_names); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 40, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_VIDEOEXPOSE); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 40, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (unlikely(PyObject_SetItem(__pyx_t_3, __pyx_t_2, __pyx_n_u_VIDEOEXPOSE) < 0)) __PYX_ERR(0, 40, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "pygame_sdl2/event.pyx":46 * # giving the type. * cdef int POSTEDEVENT * POSTEDEVENT = SDL_LASTEVENT - 4 # <<<<<<<<<<<<<< * * # The maximum number of a user-defined event. */ __pyx_v_11pygame_sdl2_5event_POSTEDEVENT = (SDL_LASTEVENT - 4); /* "pygame_sdl2/event.pyx":49 * * # The maximum number of a user-defined event. * USEREVENT_MAX = SDL_LASTEVENT - 5 # <<<<<<<<<<<<<< * * # If true, the mousewheel is mapped to buttons 4 and 5. Otherwise, a */ __pyx_t_2 = __Pyx_PyInt_From_long((SDL_LASTEVENT - 5)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 49, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_USEREVENT_MAX, __pyx_t_2) < 0) __PYX_ERR(0, 49, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "pygame_sdl2/event.pyx":53 * # If true, the mousewheel is mapped to buttons 4 and 5. Otherwise, a * # MOUSEWHEEL event is created. * cdef bint mousewheel_buttons = 1 # <<<<<<<<<<<<<< * * class EventType(object): */ __pyx_v_11pygame_sdl2_5event_mousewheel_buttons = 1; /* "pygame_sdl2/event.pyx":55 * cdef bint mousewheel_buttons = 1 * * class EventType(object): # <<<<<<<<<<<<<< * * def __init__(self, type, dict=None, **kwargs): */ __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 55, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_INCREF(__pyx_builtin_object); __Pyx_GIVEREF(__pyx_builtin_object); PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_builtin_object); __pyx_t_3 = __Pyx_CalculateMetaclass(NULL, __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 55, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_5 = __Pyx_Py3MetaclassPrepare(__pyx_t_3, __pyx_t_2, __pyx_n_s_EventType, __pyx_n_s_EventType, (PyObject *) NULL, __pyx_n_s_pygame_sdl2_event, (PyObject *) NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 55, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); /* "pygame_sdl2/event.pyx":57 * class EventType(object): * * def __init__(self, type, dict=None, **kwargs): # <<<<<<<<<<<<<< * self._type = type * */ __pyx_t_6 = __Pyx_CyFunction_NewEx(&__pyx_mdef_11pygame_sdl2_5event_9EventType_1__init__, 0, __pyx_n_s_EventType___init, NULL, __pyx_n_s_pygame_sdl2_event, __pyx_d, ((PyObject *)__pyx_codeobj__15)); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 57, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_6, __pyx_tuple__16); if (PyObject_SetItem(__pyx_t_5, __pyx_n_s_init, __pyx_t_6) < 0) __PYX_ERR(0, 57, __pyx_L1_error) __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; /* "pygame_sdl2/event.pyx":65 * self.__dict__.update(kwargs) * * def __repr__(self): # <<<<<<<<<<<<<< * if SDL_USEREVENT <= self.type < VIDEOEXPOSE: * ename = "UserEvent%d" % (self.type - SDL_USEREVENT) */ __pyx_t_6 = __Pyx_CyFunction_NewEx(&__pyx_mdef_11pygame_sdl2_5event_9EventType_3__repr__, 0, __pyx_n_s_EventType___repr, NULL, __pyx_n_s_pygame_sdl2_event, __pyx_d, ((PyObject *)__pyx_codeobj__18)); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 65, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); if (PyObject_SetItem(__pyx_t_5, __pyx_n_s_repr, __pyx_t_6) < 0) __PYX_ERR(0, 65, __pyx_L1_error) __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; /* "pygame_sdl2/event.pyx":79 * * @property * def dict(self): # <<<<<<<<<<<<<< * return self.__dict__ * */ __pyx_t_6 = __Pyx_CyFunction_NewEx(&__pyx_mdef_11pygame_sdl2_5event_9EventType_5dict, 0, __pyx_n_s_EventType_dict, NULL, __pyx_n_s_pygame_sdl2_event, __pyx_d, ((PyObject *)__pyx_codeobj__20)); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 79, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); /* "pygame_sdl2/event.pyx":78 * return '' % (self.type, ename, d) * * @property # <<<<<<<<<<<<<< * def dict(self): * return self.__dict__ */ __pyx_t_7 = PyTuple_New(1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 78, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_GIVEREF(__pyx_t_6); PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_6); __pyx_t_6 = 0; __pyx_t_6 = __Pyx_PyObject_Call(__pyx_builtin_property, __pyx_t_7, NULL); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 78, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; if (PyObject_SetItem(__pyx_t_5, __pyx_n_s_dict, __pyx_t_6) < 0) __PYX_ERR(0, 79, __pyx_L1_error) __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; /* "pygame_sdl2/event.pyx":83 * * @property * def type(self): # <<<<<<<<<<<<<< * return self._type * */ __pyx_t_6 = __Pyx_CyFunction_NewEx(&__pyx_mdef_11pygame_sdl2_5event_9EventType_7type, 0, __pyx_n_s_EventType_type, NULL, __pyx_n_s_pygame_sdl2_event, __pyx_d, ((PyObject *)__pyx_codeobj__22)); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 83, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); /* "pygame_sdl2/event.pyx":82 * return self.__dict__ * * @property # <<<<<<<<<<<<<< * def type(self): * return self._type */ __pyx_t_7 = PyTuple_New(1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 82, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_GIVEREF(__pyx_t_6); PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_6); __pyx_t_6 = 0; __pyx_t_6 = __Pyx_PyObject_Call(__pyx_builtin_property, __pyx_t_7, NULL); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 82, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; if (PyObject_SetItem(__pyx_t_5, __pyx_n_s_type, __pyx_t_6) < 0) __PYX_ERR(0, 83, __pyx_L1_error) __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; /* "pygame_sdl2/event.pyx":86 * return self._type * * def __eq__(self, other): # <<<<<<<<<<<<<< * return self.__dict__ == other.__dict__ * */ __pyx_t_6 = __Pyx_CyFunction_NewEx(&__pyx_mdef_11pygame_sdl2_5event_9EventType_9__eq__, 0, __pyx_n_s_EventType___eq, NULL, __pyx_n_s_pygame_sdl2_event, __pyx_d, ((PyObject *)__pyx_codeobj__24)); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 86, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); if (PyObject_SetItem(__pyx_t_5, __pyx_n_s_eq, __pyx_t_6) < 0) __PYX_ERR(0, 86, __pyx_L1_error) __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; /* "pygame_sdl2/event.pyx":89 * return self.__dict__ == other.__dict__ * * def __ne__(self, other): # <<<<<<<<<<<<<< * return not (self == other) * */ __pyx_t_6 = __Pyx_CyFunction_NewEx(&__pyx_mdef_11pygame_sdl2_5event_9EventType_11__ne__, 0, __pyx_n_s_EventType___ne, NULL, __pyx_n_s_pygame_sdl2_event, __pyx_d, ((PyObject *)__pyx_codeobj__26)); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 89, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); if (PyObject_SetItem(__pyx_t_5, __pyx_n_s_ne, __pyx_t_6) < 0) __PYX_ERR(0, 89, __pyx_L1_error) __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; /* "pygame_sdl2/event.pyx":92 * return not (self == other) * * def __nonzero__(self): # <<<<<<<<<<<<<< * return self.type != 0 * */ __pyx_t_6 = __Pyx_CyFunction_NewEx(&__pyx_mdef_11pygame_sdl2_5event_9EventType_13__nonzero__, 0, __pyx_n_s_EventType___nonzero, NULL, __pyx_n_s_pygame_sdl2_event, __pyx_d, ((PyObject *)__pyx_codeobj__28)); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 92, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); if (PyObject_SetItem(__pyx_t_5, __pyx_n_s_nonzero, __pyx_t_6) < 0) __PYX_ERR(0, 92, __pyx_L1_error) __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; /* "pygame_sdl2/event.pyx":55 * cdef bint mousewheel_buttons = 1 * * class EventType(object): # <<<<<<<<<<<<<< * * def __init__(self, type, dict=None, **kwargs): */ __pyx_t_6 = __Pyx_Py3ClassCreate(__pyx_t_3, __pyx_n_s_EventType, __pyx_t_2, __pyx_t_5, NULL, 0, 0); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 55, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); if (PyDict_SetItem(__pyx_d, __pyx_n_s_EventType, __pyx_t_6) < 0) __PYX_ERR(0, 55, __pyx_L1_error) __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "pygame_sdl2/event.pyx":95 * return self.type != 0 * * Event = EventType # <<<<<<<<<<<<<< * * cdef get_textinput(): */ __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_EventType); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 95, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_Event, __pyx_t_2) < 0) __PYX_ERR(0, 95, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "pygame_sdl2/event.pyx":269 * * # The event queue - a list of pending events from oldest to newest. * cdef public event_queue = list() # <<<<<<<<<<<<<< * * # The lock that protects the event queue. */ __pyx_t_2 = PyList_New(0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 269, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_XGOTREF(event_queue); __Pyx_DECREF_SET(event_queue, __pyx_t_2); __Pyx_GIVEREF(__pyx_t_2); __pyx_t_2 = 0; /* "pygame_sdl2/event.pyx":272 * * # The lock that protects the event queue. * lock = threading.RLock() # <<<<<<<<<<<<<< * * # This is the object that is returned when no event exists. */ __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_threading); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 272, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_RLock); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 272, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_3 = NULL; if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_5))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_5); if (likely(__pyx_t_3)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_5, function); } } if (__pyx_t_3) { __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 272, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } else { __pyx_t_2 = __Pyx_PyObject_CallNoArg(__pyx_t_5); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 272, __pyx_L1_error) } __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; if (PyDict_SetItem(__pyx_d, __pyx_n_s_lock, __pyx_t_2) < 0) __PYX_ERR(0, 272, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "pygame_sdl2/event.pyx":275 * * # This is the object that is returned when no event exists. * NOEVENT_EVENT = EventType(0) # <<<<<<<<<<<<<< * * */ __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_EventType); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 275, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_tuple__29, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 275, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; if (PyDict_SetItem(__pyx_d, __pyx_n_s_NOEVENT_EVENT, __pyx_t_5) < 0) __PYX_ERR(0, 275, __pyx_L1_error) __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; /* "pygame_sdl2/event.pyx":333 * * * def pump(): # <<<<<<<<<<<<<< * with lock: * poll_sdl() */ __pyx_t_5 = PyCFunction_NewEx(&__pyx_mdef_11pygame_sdl2_5event_1pump, NULL, __pyx_n_s_pygame_sdl2_event); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 333, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); if (PyDict_SetItem(__pyx_d, __pyx_n_s_pump, __pyx_t_5) < 0) __PYX_ERR(0, 333, __pyx_L1_error) __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; /* "pygame_sdl2/event.pyx":338 * * * def get(t=None): # <<<<<<<<<<<<<< * * global event_queue */ __pyx_t_5 = PyCFunction_NewEx(&__pyx_mdef_11pygame_sdl2_5event_3get, NULL, __pyx_n_s_pygame_sdl2_event); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 338, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); if (PyDict_SetItem(__pyx_d, __pyx_n_s_get, __pyx_t_5) < 0) __PYX_ERR(0, 338, __pyx_L1_error) __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; /* "pygame_sdl2/event.pyx":358 * * * def poll(): # <<<<<<<<<<<<<< * * with lock: */ __pyx_t_5 = PyCFunction_NewEx(&__pyx_mdef_11pygame_sdl2_5event_5poll, NULL, __pyx_n_s_pygame_sdl2_event); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 358, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); if (PyDict_SetItem(__pyx_d, __pyx_n_s_poll, __pyx_t_5) < 0) __PYX_ERR(0, 358, __pyx_L1_error) __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; /* "pygame_sdl2/event.pyx":369 * * * def wait(): # <<<<<<<<<<<<<< * * cdef SDL_Event evt */ __pyx_t_5 = PyCFunction_NewEx(&__pyx_mdef_11pygame_sdl2_5event_7wait, NULL, __pyx_n_s_pygame_sdl2_event); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 369, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); if (PyDict_SetItem(__pyx_d, __pyx_n_s_wait, __pyx_t_5) < 0) __PYX_ERR(0, 369, __pyx_L1_error) __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; /* "pygame_sdl2/event.pyx":389 * * * def peek(t=None): # <<<<<<<<<<<<<< * * with lock: */ __pyx_t_5 = PyCFunction_NewEx(&__pyx_mdef_11pygame_sdl2_5event_9peek, NULL, __pyx_n_s_pygame_sdl2_event); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 389, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); if (PyDict_SetItem(__pyx_d, __pyx_n_s_peek, __pyx_t_5) < 0) __PYX_ERR(0, 389, __pyx_L1_error) __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; /* "pygame_sdl2/event.pyx":402 * * * def clear(t=None): # <<<<<<<<<<<<<< * * # Clear is implemented in terms of get. */ __pyx_t_5 = PyCFunction_NewEx(&__pyx_mdef_11pygame_sdl2_5event_11clear, NULL, __pyx_n_s_pygame_sdl2_event); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 402, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); if (PyDict_SetItem(__pyx_d, __pyx_n_s_clear, __pyx_t_5) < 0) __PYX_ERR(0, 402, __pyx_L1_error) __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; /* "pygame_sdl2/event.pyx":407 * get(t) * * def get_standard_events(): # <<<<<<<<<<<<<< * """ * Returns a list of standard events that pygame_sdl2 knows about. */ __pyx_t_5 = PyCFunction_NewEx(&__pyx_mdef_11pygame_sdl2_5event_13get_standard_events, NULL, __pyx_n_s_pygame_sdl2_event); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 407, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); if (PyDict_SetItem(__pyx_d, __pyx_n_s_get_standard_events, __pyx_t_5) < 0) __PYX_ERR(0, 407, __pyx_L1_error) __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; /* "pygame_sdl2/event.pyx":414 * return [ i for i in event_names.keys() if (i < SDL_USEREVENT) or (i > USEREVENT_MAX) ] * * def event_name(t): # <<<<<<<<<<<<<< * try: * return event_names[t] */ __pyx_t_5 = PyCFunction_NewEx(&__pyx_mdef_11pygame_sdl2_5event_15event_name, NULL, __pyx_n_s_pygame_sdl2_event); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 414, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); if (PyDict_SetItem(__pyx_d, __pyx_n_s_event_name, __pyx_t_5) < 0) __PYX_ERR(0, 414, __pyx_L1_error) __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; /* "pygame_sdl2/event.pyx":420 * return "UNKNOWN" * * def set_blocked(t=None): # <<<<<<<<<<<<<< * if t == None: * for et in event_names.keys(): */ __pyx_t_5 = PyCFunction_NewEx(&__pyx_mdef_11pygame_sdl2_5event_17set_blocked, NULL, __pyx_n_s_pygame_sdl2_event); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 420, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); if (PyDict_SetItem(__pyx_d, __pyx_n_s_set_blocked, __pyx_t_5) < 0) __PYX_ERR(0, 420, __pyx_L1_error) __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; /* "pygame_sdl2/event.pyx":430 * SDL_EventState(et, SDL_IGNORE) * * def set_allowed(t=None): # <<<<<<<<<<<<<< * if t == None: * for et in event_names.keys(): */ __pyx_t_5 = PyCFunction_NewEx(&__pyx_mdef_11pygame_sdl2_5event_19set_allowed, NULL, __pyx_n_s_pygame_sdl2_event); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 430, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); if (PyDict_SetItem(__pyx_d, __pyx_n_s_set_allowed, __pyx_t_5) < 0) __PYX_ERR(0, 430, __pyx_L1_error) __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; /* "pygame_sdl2/event.pyx":440 * SDL_EventState(et, SDL_ENABLE) * * def get_blocked(t): # <<<<<<<<<<<<<< * return SDL_EventState(t, SDL_QUERY) == SDL_IGNORE * */ __pyx_t_5 = PyCFunction_NewEx(&__pyx_mdef_11pygame_sdl2_5event_21get_blocked, NULL, __pyx_n_s_pygame_sdl2_event); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 440, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); if (PyDict_SetItem(__pyx_d, __pyx_n_s_get_blocked, __pyx_t_5) < 0) __PYX_ERR(0, 440, __pyx_L1_error) __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; /* "pygame_sdl2/event.pyx":443 * return SDL_EventState(t, SDL_QUERY) == SDL_IGNORE * * def set_grab(on): # <<<<<<<<<<<<<< * SDL_SetWindowGrab(main_window.window, on) * */ __pyx_t_5 = PyCFunction_NewEx(&__pyx_mdef_11pygame_sdl2_5event_23set_grab, NULL, __pyx_n_s_pygame_sdl2_event); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 443, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); if (PyDict_SetItem(__pyx_d, __pyx_n_s_set_grab, __pyx_t_5) < 0) __PYX_ERR(0, 443, __pyx_L1_error) __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; /* "pygame_sdl2/event.pyx":446 * SDL_SetWindowGrab(main_window.window, on) * * def get_grab(): # <<<<<<<<<<<<<< * return SDL_GetWindowGrab(main_window.window) * */ __pyx_t_5 = PyCFunction_NewEx(&__pyx_mdef_11pygame_sdl2_5event_25get_grab, NULL, __pyx_n_s_pygame_sdl2_event); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 446, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); if (PyDict_SetItem(__pyx_d, __pyx_n_s_get_grab, __pyx_t_5) < 0) __PYX_ERR(0, 446, __pyx_L1_error) __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; /* "pygame_sdl2/event.pyx":449 * return SDL_GetWindowGrab(main_window.window) * * def set_mousewheel_buttons(flag): # <<<<<<<<<<<<<< * """ * If true (the default), the mousewheel will generate events involving */ __pyx_t_5 = PyCFunction_NewEx(&__pyx_mdef_11pygame_sdl2_5event_27set_mousewheel_buttons, NULL, __pyx_n_s_pygame_sdl2_event); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 449, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); if (PyDict_SetItem(__pyx_d, __pyx_n_s_set_mousewheel_buttons, __pyx_t_5) < 0) __PYX_ERR(0, 449, __pyx_L1_error) __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; /* "pygame_sdl2/event.pyx":461 * mousewheel_buttons = flag * * def get_mousewheel_buttons(): # <<<<<<<<<<<<<< * """ * Returns the value set by mousehweel buttons,. */ __pyx_t_5 = PyCFunction_NewEx(&__pyx_mdef_11pygame_sdl2_5event_29get_mousewheel_buttons, NULL, __pyx_n_s_pygame_sdl2_event); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 461, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); if (PyDict_SetItem(__pyx_d, __pyx_n_s_get_mousewheel_buttons, __pyx_t_5) < 0) __PYX_ERR(0, 461, __pyx_L1_error) __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; /* "pygame_sdl2/event.pyx":468 * return mousewheel_buttons * * def post(e): # <<<<<<<<<<<<<< * """ * Posts event object `e` to the event queue. */ __pyx_t_5 = PyCFunction_NewEx(&__pyx_mdef_11pygame_sdl2_5event_31post, NULL, __pyx_n_s_pygame_sdl2_event); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 468, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); if (PyDict_SetItem(__pyx_d, __pyx_n_s_post, __pyx_t_5) < 0) __PYX_ERR(0, 468, __pyx_L1_error) __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; /* "pygame_sdl2/event.pyx":488 * SDL_PushEvent(&event) * * def register(name): # <<<<<<<<<<<<<< * """ * Registers a unique event number and returns that number. */ __pyx_t_5 = PyCFunction_NewEx(&__pyx_mdef_11pygame_sdl2_5event_33register, NULL, __pyx_n_s_pygame_sdl2_event); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 488, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); if (PyDict_SetItem(__pyx_d, __pyx_n_s_register, __pyx_t_5) < 0) __PYX_ERR(0, 488, __pyx_L1_error) __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; /* "pygame_sdl2/event.pyx":502 * return rv * * def copy_event_queue(): # <<<<<<<<<<<<<< * """ * Returns a copy of the event queue. The copy cannot be used for modifying */ __pyx_t_5 = PyCFunction_NewEx(&__pyx_mdef_11pygame_sdl2_5event_35copy_event_queue, NULL, __pyx_n_s_pygame_sdl2_event); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 502, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); if (PyDict_SetItem(__pyx_d, __pyx_n_s_copy_event_queue, __pyx_t_5) < 0) __PYX_ERR(0, 502, __pyx_L1_error) __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; /* "pygame_sdl2/event.pyx":511 * * # Usually called by display.init. * def init(): # <<<<<<<<<<<<<< * if not SDL_WasInit(SDL_INIT_EVENTS): * */ __pyx_t_5 = PyCFunction_NewEx(&__pyx_mdef_11pygame_sdl2_5event_37init, NULL, __pyx_n_s_pygame_sdl2_event); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 511, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); if (PyDict_SetItem(__pyx_d, __pyx_n_s_init_2, __pyx_t_5) < 0) __PYX_ERR(0, 511, __pyx_L1_error) __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; /* "pygame_sdl2/event.pyx":1 * # Copyright 2014 Patrick Dawson # <<<<<<<<<<<<<< * # Copyright 2014 Tom Rothamel * # */ __pyx_t_5 = PyDict_New(); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); if (PyDict_SetItem(__pyx_d, __pyx_n_s_test, __pyx_t_5) < 0) __PYX_ERR(0, 1, __pyx_L1_error) __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; /*--- Wrapped vars code ---*/ goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_5); __Pyx_XDECREF(__pyx_t_6); __Pyx_XDECREF(__pyx_t_7); if (__pyx_m) { if (__pyx_d) { __Pyx_AddTraceback("init pygame_sdl2.event", __pyx_clineno, __pyx_lineno, __pyx_filename); } Py_DECREF(__pyx_m); __pyx_m = 0; } else if (!PyErr_Occurred()) { PyErr_SetString(PyExc_ImportError, "init pygame_sdl2.event"); } __pyx_L0:; __Pyx_RefNannyFinishContext(); #if PY_MAJOR_VERSION < 3 return; #else return __pyx_m; #endif } /* --- Runtime support code --- */ /* Refnanny */ #if CYTHON_REFNANNY static __Pyx_RefNannyAPIStruct *__Pyx_RefNannyImportAPI(const char *modname) { PyObject *m = NULL, *p = NULL; void *r = NULL; m = PyImport_ImportModule((char *)modname); if (!m) goto end; p = PyObject_GetAttrString(m, (char *)"RefNannyAPI"); if (!p) goto end; r = PyLong_AsVoidPtr(p); end: Py_XDECREF(p); Py_XDECREF(m); return (__Pyx_RefNannyAPIStruct *)r; } #endif /* GetBuiltinName */ static PyObject *__Pyx_GetBuiltinName(PyObject *name) { PyObject* result = __Pyx_PyObject_GetAttrStr(__pyx_b, name); if (unlikely(!result)) { PyErr_Format(PyExc_NameError, #if PY_MAJOR_VERSION >= 3 "name '%U' is not defined", name); #else "name '%.200s' is not defined", PyString_AS_STRING(name)); #endif } return result; } /* RaiseArgTupleInvalid */ static void __Pyx_RaiseArgtupleInvalid( const char* func_name, int exact, Py_ssize_t num_min, Py_ssize_t num_max, Py_ssize_t num_found) { Py_ssize_t num_expected; const char *more_or_less; if (num_found < num_min) { num_expected = num_min; more_or_less = "at least"; } else { num_expected = num_max; more_or_less = "at most"; } if (exact) { more_or_less = "exactly"; } PyErr_Format(PyExc_TypeError, "%.200s() takes %.8s %" CYTHON_FORMAT_SSIZE_T "d positional argument%.1s (%" CYTHON_FORMAT_SSIZE_T "d given)", func_name, more_or_less, num_expected, (num_expected == 1) ? "" : "s", num_found); } /* RaiseDoubleKeywords */ static void __Pyx_RaiseDoubleKeywordsError( const char* func_name, PyObject* kw_name) { PyErr_Format(PyExc_TypeError, #if PY_MAJOR_VERSION >= 3 "%s() got multiple values for keyword argument '%U'", func_name, kw_name); #else "%s() got multiple values for keyword argument '%s'", func_name, PyString_AsString(kw_name)); #endif } /* ParseKeywords */ static int __Pyx_ParseOptionalKeywords( PyObject *kwds, PyObject **argnames[], PyObject *kwds2, PyObject *values[], Py_ssize_t num_pos_args, const char* function_name) { PyObject *key = 0, *value = 0; Py_ssize_t pos = 0; PyObject*** name; PyObject*** first_kw_arg = argnames + num_pos_args; while (PyDict_Next(kwds, &pos, &key, &value)) { name = first_kw_arg; while (*name && (**name != key)) name++; if (*name) { values[name-argnames] = value; continue; } name = first_kw_arg; #if PY_MAJOR_VERSION < 3 if (likely(PyString_CheckExact(key)) || likely(PyString_Check(key))) { while (*name) { if ((CYTHON_COMPILING_IN_PYPY || PyString_GET_SIZE(**name) == PyString_GET_SIZE(key)) && _PyString_Eq(**name, key)) { values[name-argnames] = value; break; } name++; } if (*name) continue; else { PyObject*** argname = argnames; while (argname != first_kw_arg) { if ((**argname == key) || ( (CYTHON_COMPILING_IN_PYPY || PyString_GET_SIZE(**argname) == PyString_GET_SIZE(key)) && _PyString_Eq(**argname, key))) { goto arg_passed_twice; } argname++; } } } else #endif if (likely(PyUnicode_Check(key))) { while (*name) { int cmp = (**name == key) ? 0 : #if !CYTHON_COMPILING_IN_PYPY && PY_MAJOR_VERSION >= 3 (PyUnicode_GET_SIZE(**name) != PyUnicode_GET_SIZE(key)) ? 1 : #endif PyUnicode_Compare(**name, key); if (cmp < 0 && unlikely(PyErr_Occurred())) goto bad; if (cmp == 0) { values[name-argnames] = value; break; } name++; } if (*name) continue; else { PyObject*** argname = argnames; while (argname != first_kw_arg) { int cmp = (**argname == key) ? 0 : #if !CYTHON_COMPILING_IN_PYPY && PY_MAJOR_VERSION >= 3 (PyUnicode_GET_SIZE(**argname) != PyUnicode_GET_SIZE(key)) ? 1 : #endif PyUnicode_Compare(**argname, key); if (cmp < 0 && unlikely(PyErr_Occurred())) goto bad; if (cmp == 0) goto arg_passed_twice; argname++; } } } else goto invalid_keyword_type; if (kwds2) { if (unlikely(PyDict_SetItem(kwds2, key, value))) goto bad; } else { goto invalid_keyword; } } return 0; arg_passed_twice: __Pyx_RaiseDoubleKeywordsError(function_name, key); goto bad; invalid_keyword_type: PyErr_Format(PyExc_TypeError, "%.200s() keywords must be strings", function_name); goto bad; invalid_keyword: PyErr_Format(PyExc_TypeError, #if PY_MAJOR_VERSION < 3 "%.200s() got an unexpected keyword argument '%.200s'", function_name, PyString_AsString(key)); #else "%s() got an unexpected keyword argument '%U'", function_name, key); #endif bad: return -1; } /* PyObjectCall */ #if CYTHON_COMPILING_IN_CPYTHON static CYTHON_INLINE PyObject* __Pyx_PyObject_Call(PyObject *func, PyObject *arg, PyObject *kw) { PyObject *result; ternaryfunc call = func->ob_type->tp_call; if (unlikely(!call)) return PyObject_Call(func, arg, kw); if (unlikely(Py_EnterRecursiveCall((char*)" while calling a Python object"))) return NULL; result = (*call)(func, arg, kw); Py_LeaveRecursiveCall(); if (unlikely(!result) && unlikely(!PyErr_Occurred())) { PyErr_SetString( PyExc_SystemError, "NULL result without error in PyObject_Call"); } return result; } #endif /* PyObjectCallMethO */ #if CYTHON_COMPILING_IN_CPYTHON static CYTHON_INLINE PyObject* __Pyx_PyObject_CallMethO(PyObject *func, PyObject *arg) { PyObject *self, *result; PyCFunction cfunc; cfunc = PyCFunction_GET_FUNCTION(func); self = PyCFunction_GET_SELF(func); if (unlikely(Py_EnterRecursiveCall((char*)" while calling a Python object"))) return NULL; result = cfunc(self, arg); Py_LeaveRecursiveCall(); if (unlikely(!result) && unlikely(!PyErr_Occurred())) { PyErr_SetString( PyExc_SystemError, "NULL result without error in PyObject_Call"); } return result; } #endif /* PyObjectCallOneArg */ #if CYTHON_COMPILING_IN_CPYTHON static PyObject* __Pyx__PyObject_CallOneArg(PyObject *func, PyObject *arg) { PyObject *result; PyObject *args = PyTuple_New(1); if (unlikely(!args)) return NULL; Py_INCREF(arg); PyTuple_SET_ITEM(args, 0, arg); result = __Pyx_PyObject_Call(func, args, NULL); Py_DECREF(args); return result; } static CYTHON_INLINE PyObject* __Pyx_PyObject_CallOneArg(PyObject *func, PyObject *arg) { #ifdef __Pyx_CyFunction_USED if (likely(PyCFunction_Check(func) || PyObject_TypeCheck(func, __pyx_CyFunctionType))) { #else if (likely(PyCFunction_Check(func))) { #endif if (likely(PyCFunction_GET_FLAGS(func) & METH_O)) { return __Pyx_PyObject_CallMethO(func, arg); } } return __Pyx__PyObject_CallOneArg(func, arg); } #else static CYTHON_INLINE PyObject* __Pyx_PyObject_CallOneArg(PyObject *func, PyObject *arg) { PyObject *result; PyObject *args = PyTuple_Pack(1, arg); if (unlikely(!args)) return NULL; result = __Pyx_PyObject_Call(func, args, NULL); Py_DECREF(args); return result; } #endif /* GetModuleGlobalName */ static CYTHON_INLINE PyObject *__Pyx_GetModuleGlobalName(PyObject *name) { PyObject *result; #if CYTHON_COMPILING_IN_CPYTHON result = PyDict_GetItem(__pyx_d, name); if (likely(result)) { Py_INCREF(result); } else { #else result = PyObject_GetItem(__pyx_d, name); if (!result) { PyErr_Clear(); #endif result = __Pyx_GetBuiltinName(name); } return result; } /* SaveResetException */ #if CYTHON_COMPILING_IN_CPYTHON static CYTHON_INLINE void __Pyx__ExceptionSave(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb) { *type = tstate->exc_type; *value = tstate->exc_value; *tb = tstate->exc_traceback; Py_XINCREF(*type); Py_XINCREF(*value); Py_XINCREF(*tb); } static CYTHON_INLINE void __Pyx__ExceptionReset(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb) { PyObject *tmp_type, *tmp_value, *tmp_tb; tmp_type = tstate->exc_type; tmp_value = tstate->exc_value; tmp_tb = tstate->exc_traceback; tstate->exc_type = type; tstate->exc_value = value; tstate->exc_traceback = tb; Py_XDECREF(tmp_type); Py_XDECREF(tmp_value); Py_XDECREF(tmp_tb); } #endif /* PyErrExceptionMatches */ #if CYTHON_COMPILING_IN_CPYTHON static CYTHON_INLINE int __Pyx_PyErr_ExceptionMatchesInState(PyThreadState* tstate, PyObject* err) { PyObject *exc_type = tstate->curexc_type; if (exc_type == err) return 1; if (unlikely(!exc_type)) return 0; return PyErr_GivenExceptionMatches(exc_type, err); } #endif /* GetException */ #if CYTHON_COMPILING_IN_CPYTHON static int __Pyx__GetException(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb) { #else static int __Pyx_GetException(PyObject **type, PyObject **value, PyObject **tb) { #endif PyObject *local_type, *local_value, *local_tb; #if CYTHON_COMPILING_IN_CPYTHON PyObject *tmp_type, *tmp_value, *tmp_tb; local_type = tstate->curexc_type; local_value = tstate->curexc_value; local_tb = tstate->curexc_traceback; tstate->curexc_type = 0; tstate->curexc_value = 0; tstate->curexc_traceback = 0; #else PyErr_Fetch(&local_type, &local_value, &local_tb); #endif PyErr_NormalizeException(&local_type, &local_value, &local_tb); #if CYTHON_COMPILING_IN_CPYTHON if (unlikely(tstate->curexc_type)) #else if (unlikely(PyErr_Occurred())) #endif goto bad; #if PY_MAJOR_VERSION >= 3 if (local_tb) { if (unlikely(PyException_SetTraceback(local_value, local_tb) < 0)) goto bad; } #endif Py_XINCREF(local_tb); Py_XINCREF(local_type); Py_XINCREF(local_value); *type = local_type; *value = local_value; *tb = local_tb; #if CYTHON_COMPILING_IN_CPYTHON tmp_type = tstate->exc_type; tmp_value = tstate->exc_value; tmp_tb = tstate->exc_traceback; tstate->exc_type = local_type; tstate->exc_value = local_value; tstate->exc_traceback = local_tb; Py_XDECREF(tmp_type); Py_XDECREF(tmp_value); Py_XDECREF(tmp_tb); #else PyErr_SetExcInfo(local_type, local_value, local_tb); #endif return 0; bad: *type = 0; *value = 0; *tb = 0; Py_XDECREF(local_type); Py_XDECREF(local_value); Py_XDECREF(local_tb); return -1; } /* PyObjectCallNoArg */ #if CYTHON_COMPILING_IN_CPYTHON static CYTHON_INLINE PyObject* __Pyx_PyObject_CallNoArg(PyObject *func) { #ifdef __Pyx_CyFunction_USED if (likely(PyCFunction_Check(func) || PyObject_TypeCheck(func, __pyx_CyFunctionType))) { #else if (likely(PyCFunction_Check(func))) { #endif if (likely(PyCFunction_GET_FLAGS(func) & METH_NOARGS)) { return __Pyx_PyObject_CallMethO(func, NULL); } } return __Pyx_PyObject_Call(func, __pyx_empty_tuple, NULL); } #endif /* decode_c_string */ static CYTHON_INLINE PyObject* __Pyx_decode_c_string( const char* cstring, Py_ssize_t start, Py_ssize_t stop, const char* encoding, const char* errors, PyObject* (*decode_func)(const char *s, Py_ssize_t size, const char *errors)) { Py_ssize_t length; if (unlikely((start < 0) | (stop < 0))) { size_t slen = strlen(cstring); if (unlikely(slen > (size_t) PY_SSIZE_T_MAX)) { PyErr_SetString(PyExc_OverflowError, "c-string too long to convert to Python"); return NULL; } length = (Py_ssize_t) slen; if (start < 0) { start += length; if (start < 0) start = 0; } if (stop < 0) stop += length; } length = stop - start; if (unlikely(length <= 0)) return PyUnicode_FromUnicode(NULL, 0); cstring += start; if (decode_func) { return decode_func(cstring, length, errors); } else { return PyUnicode_Decode(cstring, length, encoding, errors); } } /* PyIntBinop */ #if CYTHON_COMPILING_IN_CPYTHON static PyObject* __Pyx_PyInt_AddObjC(PyObject *op1, PyObject *op2, CYTHON_UNUSED long intval, CYTHON_UNUSED int inplace) { #if PY_MAJOR_VERSION < 3 if (likely(PyInt_CheckExact(op1))) { const long b = intval; long x; long a = PyInt_AS_LONG(op1); x = (long)((unsigned long)a + b); if (likely((x^a) >= 0 || (x^b) >= 0)) return PyInt_FromLong(x); return PyLong_Type.tp_as_number->nb_add(op1, op2); } #endif #if CYTHON_USE_PYLONG_INTERNALS && PY_MAJOR_VERSION >= 3 if (likely(PyLong_CheckExact(op1))) { const long b = intval; long a, x; const PY_LONG_LONG llb = intval; PY_LONG_LONG lla, llx; const digit* digits = ((PyLongObject*)op1)->ob_digit; const Py_ssize_t size = Py_SIZE(op1); if (likely(__Pyx_sst_abs(size) <= 1)) { a = likely(size) ? digits[0] : 0; if (size == -1) a = -a; } else { switch (size) { case -2: if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) { a = -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])); break; } else if (8 * sizeof(PY_LONG_LONG) - 1 > 2 * PyLong_SHIFT) { lla = -(PY_LONG_LONG) (((((unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0])); goto long_long; } case 2: if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) { a = (long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])); break; } else if (8 * sizeof(PY_LONG_LONG) - 1 > 2 * PyLong_SHIFT) { lla = (PY_LONG_LONG) (((((unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0])); goto long_long; } case -3: if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) { a = -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])); break; } else if (8 * sizeof(PY_LONG_LONG) - 1 > 3 * PyLong_SHIFT) { lla = -(PY_LONG_LONG) (((((((unsigned PY_LONG_LONG)digits[2]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0])); goto long_long; } case 3: if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) { a = (long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])); break; } else if (8 * sizeof(PY_LONG_LONG) - 1 > 3 * PyLong_SHIFT) { lla = (PY_LONG_LONG) (((((((unsigned PY_LONG_LONG)digits[2]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0])); goto long_long; } case -4: if (8 * sizeof(long) - 1 > 4 * PyLong_SHIFT) { a = -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])); break; } else if (8 * sizeof(PY_LONG_LONG) - 1 > 4 * PyLong_SHIFT) { lla = -(PY_LONG_LONG) (((((((((unsigned PY_LONG_LONG)digits[3]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[2]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0])); goto long_long; } case 4: if (8 * sizeof(long) - 1 > 4 * PyLong_SHIFT) { a = (long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])); break; } else if (8 * sizeof(PY_LONG_LONG) - 1 > 4 * PyLong_SHIFT) { lla = (PY_LONG_LONG) (((((((((unsigned PY_LONG_LONG)digits[3]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[2]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0])); goto long_long; } default: return PyLong_Type.tp_as_number->nb_add(op1, op2); } } x = a + b; return PyLong_FromLong(x); long_long: llx = lla + llb; return PyLong_FromLongLong(llx); } #endif if (PyFloat_CheckExact(op1)) { const long b = intval; double a = PyFloat_AS_DOUBLE(op1); double result; PyFPE_START_PROTECT("add", return NULL) result = ((double)a) + (double)b; PyFPE_END_PROTECT(result) return PyFloat_FromDouble(result); } return (inplace ? PyNumber_InPlaceAdd : PyNumber_Add)(op1, op2); } #endif /* PyErrFetchRestore */ #if CYTHON_COMPILING_IN_CPYTHON static CYTHON_INLINE void __Pyx_ErrRestoreInState(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb) { PyObject *tmp_type, *tmp_value, *tmp_tb; tmp_type = tstate->curexc_type; tmp_value = tstate->curexc_value; tmp_tb = tstate->curexc_traceback; tstate->curexc_type = type; tstate->curexc_value = value; tstate->curexc_traceback = tb; Py_XDECREF(tmp_type); Py_XDECREF(tmp_value); Py_XDECREF(tmp_tb); } static CYTHON_INLINE void __Pyx_ErrFetchInState(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb) { *type = tstate->curexc_type; *value = tstate->curexc_value; *tb = tstate->curexc_traceback; tstate->curexc_type = 0; tstate->curexc_value = 0; tstate->curexc_traceback = 0; } #endif /* WriteUnraisableException */ static void __Pyx_WriteUnraisable(const char *name, CYTHON_UNUSED int clineno, CYTHON_UNUSED int lineno, CYTHON_UNUSED const char *filename, int full_traceback, CYTHON_UNUSED int nogil) { PyObject *old_exc, *old_val, *old_tb; PyObject *ctx; __Pyx_PyThreadState_declare #ifdef WITH_THREAD PyGILState_STATE state; if (nogil) state = PyGILState_Ensure(); #ifdef _MSC_VER else state = (PyGILState_STATE)-1; #endif #endif __Pyx_PyThreadState_assign __Pyx_ErrFetch(&old_exc, &old_val, &old_tb); if (full_traceback) { Py_XINCREF(old_exc); Py_XINCREF(old_val); Py_XINCREF(old_tb); __Pyx_ErrRestore(old_exc, old_val, old_tb); PyErr_PrintEx(1); } #if PY_MAJOR_VERSION < 3 ctx = PyString_FromString(name); #else ctx = PyUnicode_FromString(name); #endif __Pyx_ErrRestore(old_exc, old_val, old_tb); if (!ctx) { PyErr_WriteUnraisable(Py_None); } else { PyErr_WriteUnraisable(ctx); Py_DECREF(ctx); } #ifdef WITH_THREAD if (nogil) PyGILState_Release(state); #endif } /* PyObjectCallMethod1 */ static PyObject* __Pyx_PyObject_CallMethod1(PyObject* obj, PyObject* method_name, PyObject* arg) { PyObject *method, *result = NULL; method = __Pyx_PyObject_GetAttrStr(obj, method_name); if (unlikely(!method)) goto bad; #if CYTHON_COMPILING_IN_CPYTHON if (likely(PyMethod_Check(method))) { PyObject *self = PyMethod_GET_SELF(method); if (likely(self)) { PyObject *args; PyObject *function = PyMethod_GET_FUNCTION(method); args = PyTuple_New(2); if (unlikely(!args)) goto bad; Py_INCREF(self); PyTuple_SET_ITEM(args, 0, self); Py_INCREF(arg); PyTuple_SET_ITEM(args, 1, arg); Py_INCREF(function); Py_DECREF(method); method = NULL; result = __Pyx_PyObject_Call(function, args, NULL); Py_DECREF(args); Py_DECREF(function); return result; } } #endif result = __Pyx_PyObject_CallOneArg(method, arg); bad: Py_XDECREF(method); return result; } /* append */ static CYTHON_INLINE int __Pyx_PyObject_Append(PyObject* L, PyObject* x) { if (likely(PyList_CheckExact(L))) { if (unlikely(__Pyx_PyList_Append(L, x) < 0)) return -1; } else { PyObject* retval = __Pyx_PyObject_CallMethod1(L, __pyx_n_s_append, x); if (unlikely(!retval)) return -1; Py_DECREF(retval); } return 0; } /* None */ static CYTHON_INLINE void __Pyx_RaiseUnboundLocalError(const char *varname) { PyErr_Format(PyExc_UnboundLocalError, "local variable '%s' referenced before assignment", varname); } /* pop_index */ static PyObject* __Pyx__PyObject_PopNewIndex(PyObject* L, PyObject* py_ix) { PyObject *r; if (unlikely(!py_ix)) return NULL; r = __Pyx__PyObject_PopIndex(L, py_ix); Py_DECREF(py_ix); return r; } static PyObject* __Pyx__PyObject_PopIndex(PyObject* L, PyObject* py_ix) { return __Pyx_PyObject_CallMethod1(L, __pyx_n_s_pop, py_ix); } #if CYTHON_COMPILING_IN_CPYTHON static PyObject* __Pyx__PyList_PopIndex(PyObject* L, PyObject* py_ix, Py_ssize_t ix) { Py_ssize_t size = PyList_GET_SIZE(L); if (likely(size > (((PyListObject*)L)->allocated >> 1))) { Py_ssize_t cix = ix; if (cix < 0) { cix += size; } if (likely(0 <= cix && cix < size)) { PyObject* v = PyList_GET_ITEM(L, cix); Py_SIZE(L) -= 1; size -= 1; memmove(&PyList_GET_ITEM(L, cix), &PyList_GET_ITEM(L, cix+1), (size_t)(size-cix)*sizeof(PyObject*)); return v; } } if (py_ix == Py_None) { return __Pyx__PyObject_PopNewIndex(L, PyInt_FromSsize_t(ix)); } else { return __Pyx__PyObject_PopIndex(L, py_ix); } } #endif /* IterFinish */ static CYTHON_INLINE int __Pyx_IterFinish(void) { #if CYTHON_COMPILING_IN_CPYTHON PyThreadState *tstate = PyThreadState_GET(); PyObject* exc_type = tstate->curexc_type; if (unlikely(exc_type)) { if (likely(exc_type == PyExc_StopIteration) || PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration)) { PyObject *exc_value, *exc_tb; exc_value = tstate->curexc_value; exc_tb = tstate->curexc_traceback; tstate->curexc_type = 0; tstate->curexc_value = 0; tstate->curexc_traceback = 0; Py_DECREF(exc_type); Py_XDECREF(exc_value); Py_XDECREF(exc_tb); return 0; } else { return -1; } } return 0; #else if (unlikely(PyErr_Occurred())) { if (likely(PyErr_ExceptionMatches(PyExc_StopIteration))) { PyErr_Clear(); return 0; } else { return -1; } } return 0; #endif } /* PyObjectCallMethod0 */ static PyObject* __Pyx_PyObject_CallMethod0(PyObject* obj, PyObject* method_name) { PyObject *method, *result = NULL; method = __Pyx_PyObject_GetAttrStr(obj, method_name); if (unlikely(!method)) goto bad; #if CYTHON_COMPILING_IN_CPYTHON if (likely(PyMethod_Check(method))) { PyObject *self = PyMethod_GET_SELF(method); if (likely(self)) { PyObject *function = PyMethod_GET_FUNCTION(method); result = __Pyx_PyObject_CallOneArg(function, self); Py_DECREF(method); return result; } } #endif result = __Pyx_PyObject_CallNoArg(method); Py_DECREF(method); bad: return result; } /* RaiseNeedMoreValuesToUnpack */ static CYTHON_INLINE void __Pyx_RaiseNeedMoreValuesError(Py_ssize_t index) { PyErr_Format(PyExc_ValueError, "need more than %" CYTHON_FORMAT_SSIZE_T "d value%.1s to unpack", index, (index == 1) ? "" : "s"); } /* RaiseTooManyValuesToUnpack */ static CYTHON_INLINE void __Pyx_RaiseTooManyValuesError(Py_ssize_t expected) { PyErr_Format(PyExc_ValueError, "too many values to unpack (expected %" CYTHON_FORMAT_SSIZE_T "d)", expected); } /* UnpackItemEndCheck */ static int __Pyx_IternextUnpackEndCheck(PyObject *retval, Py_ssize_t expected) { if (unlikely(retval)) { Py_DECREF(retval); __Pyx_RaiseTooManyValuesError(expected); return -1; } else { return __Pyx_IterFinish(); } return 0; } /* RaiseNoneIterError */ static CYTHON_INLINE void __Pyx_RaiseNoneNotIterableError(void) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable"); } /* UnpackTupleError */ static void __Pyx_UnpackTupleError(PyObject *t, Py_ssize_t index) { if (t == Py_None) { __Pyx_RaiseNoneNotIterableError(); } else if (PyTuple_GET_SIZE(t) < index) { __Pyx_RaiseNeedMoreValuesError(PyTuple_GET_SIZE(t)); } else { __Pyx_RaiseTooManyValuesError(index); } } /* UnpackTuple2 */ static CYTHON_INLINE int __Pyx_unpack_tuple2(PyObject* tuple, PyObject** pvalue1, PyObject** pvalue2, int is_tuple, int has_known_size, int decref_tuple) { Py_ssize_t index; PyObject *value1 = NULL, *value2 = NULL, *iter = NULL; if (!is_tuple && unlikely(!PyTuple_Check(tuple))) { iternextfunc iternext; iter = PyObject_GetIter(tuple); if (unlikely(!iter)) goto bad; if (decref_tuple) { Py_DECREF(tuple); tuple = NULL; } iternext = Py_TYPE(iter)->tp_iternext; value1 = iternext(iter); if (unlikely(!value1)) { index = 0; goto unpacking_failed; } value2 = iternext(iter); if (unlikely(!value2)) { index = 1; goto unpacking_failed; } if (!has_known_size && unlikely(__Pyx_IternextUnpackEndCheck(iternext(iter), 2))) goto bad; Py_DECREF(iter); } else { if (!has_known_size && unlikely(PyTuple_GET_SIZE(tuple) != 2)) { __Pyx_UnpackTupleError(tuple, 2); goto bad; } #if CYTHON_COMPILING_IN_PYPY value1 = PySequence_ITEM(tuple, 0); if (unlikely(!value1)) goto bad; value2 = PySequence_ITEM(tuple, 1); if (unlikely(!value2)) goto bad; #else value1 = PyTuple_GET_ITEM(tuple, 0); value2 = PyTuple_GET_ITEM(tuple, 1); Py_INCREF(value1); Py_INCREF(value2); #endif if (decref_tuple) { Py_DECREF(tuple); } } *pvalue1 = value1; *pvalue2 = value2; return 0; unpacking_failed: if (!has_known_size && __Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); bad: Py_XDECREF(iter); Py_XDECREF(value1); Py_XDECREF(value2); if (decref_tuple) { Py_XDECREF(tuple); } return -1; } /* dict_iter */ static CYTHON_INLINE PyObject* __Pyx_dict_iterator(PyObject* iterable, int is_dict, PyObject* method_name, Py_ssize_t* p_orig_length, int* p_source_is_dict) { is_dict = is_dict || likely(PyDict_CheckExact(iterable)); *p_source_is_dict = is_dict; #if !CYTHON_COMPILING_IN_PYPY if (is_dict) { *p_orig_length = PyDict_Size(iterable); Py_INCREF(iterable); return iterable; } #endif *p_orig_length = 0; if (method_name) { PyObject* iter; iterable = __Pyx_PyObject_CallMethod0(iterable, method_name); if (!iterable) return NULL; #if !CYTHON_COMPILING_IN_PYPY if (PyTuple_CheckExact(iterable) || PyList_CheckExact(iterable)) return iterable; #endif iter = PyObject_GetIter(iterable); Py_DECREF(iterable); return iter; } return PyObject_GetIter(iterable); } static CYTHON_INLINE int __Pyx_dict_iter_next( PyObject* iter_obj, CYTHON_NCP_UNUSED Py_ssize_t orig_length, CYTHON_NCP_UNUSED Py_ssize_t* ppos, PyObject** pkey, PyObject** pvalue, PyObject** pitem, int source_is_dict) { PyObject* next_item; #if !CYTHON_COMPILING_IN_PYPY if (source_is_dict) { PyObject *key, *value; if (unlikely(orig_length != PyDict_Size(iter_obj))) { PyErr_SetString(PyExc_RuntimeError, "dictionary changed size during iteration"); return -1; } if (unlikely(!PyDict_Next(iter_obj, ppos, &key, &value))) { return 0; } if (pitem) { PyObject* tuple = PyTuple_New(2); if (unlikely(!tuple)) { return -1; } Py_INCREF(key); Py_INCREF(value); PyTuple_SET_ITEM(tuple, 0, key); PyTuple_SET_ITEM(tuple, 1, value); *pitem = tuple; } else { if (pkey) { Py_INCREF(key); *pkey = key; } if (pvalue) { Py_INCREF(value); *pvalue = value; } } return 1; } else if (PyTuple_CheckExact(iter_obj)) { Py_ssize_t pos = *ppos; if (unlikely(pos >= PyTuple_GET_SIZE(iter_obj))) return 0; *ppos = pos + 1; next_item = PyTuple_GET_ITEM(iter_obj, pos); Py_INCREF(next_item); } else if (PyList_CheckExact(iter_obj)) { Py_ssize_t pos = *ppos; if (unlikely(pos >= PyList_GET_SIZE(iter_obj))) return 0; *ppos = pos + 1; next_item = PyList_GET_ITEM(iter_obj, pos); Py_INCREF(next_item); } else #endif { next_item = PyIter_Next(iter_obj); if (unlikely(!next_item)) { return __Pyx_IterFinish(); } } if (pitem) { *pitem = next_item; } else if (pkey && pvalue) { if (__Pyx_unpack_tuple2(next_item, pkey, pvalue, source_is_dict, source_is_dict, 1)) return -1; } else if (pkey) { *pkey = next_item; } else { *pvalue = next_item; } return 1; } /* RaiseException */ #if PY_MAJOR_VERSION < 3 static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, CYTHON_UNUSED PyObject *cause) { __Pyx_PyThreadState_declare Py_XINCREF(type); if (!value || value == Py_None) value = NULL; else Py_INCREF(value); if (!tb || tb == Py_None) tb = NULL; else { Py_INCREF(tb); if (!PyTraceBack_Check(tb)) { PyErr_SetString(PyExc_TypeError, "raise: arg 3 must be a traceback or None"); goto raise_error; } } if (PyType_Check(type)) { #if CYTHON_COMPILING_IN_PYPY if (!value) { Py_INCREF(Py_None); value = Py_None; } #endif PyErr_NormalizeException(&type, &value, &tb); } else { if (value) { PyErr_SetString(PyExc_TypeError, "instance exception may not have a separate value"); goto raise_error; } value = type; type = (PyObject*) Py_TYPE(type); Py_INCREF(type); if (!PyType_IsSubtype((PyTypeObject *)type, (PyTypeObject *)PyExc_BaseException)) { PyErr_SetString(PyExc_TypeError, "raise: exception class must be a subclass of BaseException"); goto raise_error; } } __Pyx_PyThreadState_assign __Pyx_ErrRestore(type, value, tb); return; raise_error: Py_XDECREF(value); Py_XDECREF(type); Py_XDECREF(tb); return; } #else static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, PyObject *cause) { PyObject* owned_instance = NULL; if (tb == Py_None) { tb = 0; } else if (tb && !PyTraceBack_Check(tb)) { PyErr_SetString(PyExc_TypeError, "raise: arg 3 must be a traceback or None"); goto bad; } if (value == Py_None) value = 0; if (PyExceptionInstance_Check(type)) { if (value) { PyErr_SetString(PyExc_TypeError, "instance exception may not have a separate value"); goto bad; } value = type; type = (PyObject*) Py_TYPE(value); } else if (PyExceptionClass_Check(type)) { PyObject *instance_class = NULL; if (value && PyExceptionInstance_Check(value)) { instance_class = (PyObject*) Py_TYPE(value); if (instance_class != type) { int is_subclass = PyObject_IsSubclass(instance_class, type); if (!is_subclass) { instance_class = NULL; } else if (unlikely(is_subclass == -1)) { goto bad; } else { type = instance_class; } } } if (!instance_class) { PyObject *args; if (!value) args = PyTuple_New(0); else if (PyTuple_Check(value)) { Py_INCREF(value); args = value; } else args = PyTuple_Pack(1, value); if (!args) goto bad; owned_instance = PyObject_Call(type, args, NULL); Py_DECREF(args); if (!owned_instance) goto bad; value = owned_instance; if (!PyExceptionInstance_Check(value)) { PyErr_Format(PyExc_TypeError, "calling %R should have returned an instance of " "BaseException, not %R", type, Py_TYPE(value)); goto bad; } } } else { PyErr_SetString(PyExc_TypeError, "raise: exception class must be a subclass of BaseException"); goto bad; } #if PY_VERSION_HEX >= 0x03030000 if (cause) { #else if (cause && cause != Py_None) { #endif PyObject *fixed_cause; if (cause == Py_None) { fixed_cause = NULL; } else if (PyExceptionClass_Check(cause)) { fixed_cause = PyObject_CallObject(cause, NULL); if (fixed_cause == NULL) goto bad; } else if (PyExceptionInstance_Check(cause)) { fixed_cause = cause; Py_INCREF(fixed_cause); } else { PyErr_SetString(PyExc_TypeError, "exception causes must derive from " "BaseException"); goto bad; } PyException_SetCause(value, fixed_cause); } PyErr_SetObject(type, value); if (tb) { #if CYTHON_COMPILING_IN_PYPY PyObject *tmp_type, *tmp_value, *tmp_tb; PyErr_Fetch(&tmp_type, &tmp_value, &tmp_tb); Py_INCREF(tb); PyErr_Restore(tmp_type, tmp_value, tb); Py_XDECREF(tmp_tb); #else PyThreadState *tstate = PyThreadState_GET(); PyObject* tmp_tb = tstate->curexc_traceback; if (tb != tmp_tb) { Py_INCREF(tb); tstate->curexc_traceback = tb; Py_XDECREF(tmp_tb); } #endif } bad: Py_XDECREF(owned_instance); return; } #endif /* SetItemInt */ static CYTHON_INLINE int __Pyx_SetItemInt_Generic(PyObject *o, PyObject *j, PyObject *v) { int r; if (!j) return -1; r = PyObject_SetItem(o, j, v); Py_DECREF(j); return r; } static CYTHON_INLINE int __Pyx_SetItemInt_Fast(PyObject *o, Py_ssize_t i, PyObject *v, int is_list, CYTHON_NCP_UNUSED int wraparound, CYTHON_NCP_UNUSED int boundscheck) { #if CYTHON_COMPILING_IN_CPYTHON if (is_list || PyList_CheckExact(o)) { Py_ssize_t n = (!wraparound) ? i : ((likely(i >= 0)) ? i : i + PyList_GET_SIZE(o)); if ((!boundscheck) || likely((n >= 0) & (n < PyList_GET_SIZE(o)))) { PyObject* old = PyList_GET_ITEM(o, n); Py_INCREF(v); PyList_SET_ITEM(o, n, v); Py_DECREF(old); return 1; } } else { PySequenceMethods *m = Py_TYPE(o)->tp_as_sequence; if (likely(m && m->sq_ass_item)) { if (wraparound && unlikely(i < 0) && likely(m->sq_length)) { Py_ssize_t l = m->sq_length(o); if (likely(l >= 0)) { i += l; } else { if (!PyErr_ExceptionMatches(PyExc_OverflowError)) return -1; PyErr_Clear(); } } return m->sq_ass_item(o, i, v); } } #else #if CYTHON_COMPILING_IN_PYPY if (is_list || (PySequence_Check(o) && !PyDict_Check(o))) { #else if (is_list || PySequence_Check(o)) { #endif return PySequence_SetItem(o, i, v); } #endif return __Pyx_SetItemInt_Generic(o, PyInt_FromSsize_t(i), v); } /* SliceObject */ static CYTHON_INLINE PyObject* __Pyx_PyObject_GetSlice(PyObject* obj, Py_ssize_t cstart, Py_ssize_t cstop, PyObject** _py_start, PyObject** _py_stop, PyObject** _py_slice, int has_cstart, int has_cstop, CYTHON_UNUSED int wraparound) { #if CYTHON_COMPILING_IN_CPYTHON PyMappingMethods* mp; #if PY_MAJOR_VERSION < 3 PySequenceMethods* ms = Py_TYPE(obj)->tp_as_sequence; if (likely(ms && ms->sq_slice)) { if (!has_cstart) { if (_py_start && (*_py_start != Py_None)) { cstart = __Pyx_PyIndex_AsSsize_t(*_py_start); if ((cstart == (Py_ssize_t)-1) && PyErr_Occurred()) goto bad; } else cstart = 0; } if (!has_cstop) { if (_py_stop && (*_py_stop != Py_None)) { cstop = __Pyx_PyIndex_AsSsize_t(*_py_stop); if ((cstop == (Py_ssize_t)-1) && PyErr_Occurred()) goto bad; } else cstop = PY_SSIZE_T_MAX; } if (wraparound && unlikely((cstart < 0) | (cstop < 0)) && likely(ms->sq_length)) { Py_ssize_t l = ms->sq_length(obj); if (likely(l >= 0)) { if (cstop < 0) { cstop += l; if (cstop < 0) cstop = 0; } if (cstart < 0) { cstart += l; if (cstart < 0) cstart = 0; } } else { if (!PyErr_ExceptionMatches(PyExc_OverflowError)) goto bad; PyErr_Clear(); } } return ms->sq_slice(obj, cstart, cstop); } #endif mp = Py_TYPE(obj)->tp_as_mapping; if (likely(mp && mp->mp_subscript)) #endif { PyObject* result; PyObject *py_slice, *py_start, *py_stop; if (_py_slice) { py_slice = *_py_slice; } else { PyObject* owned_start = NULL; PyObject* owned_stop = NULL; if (_py_start) { py_start = *_py_start; } else { if (has_cstart) { owned_start = py_start = PyInt_FromSsize_t(cstart); if (unlikely(!py_start)) goto bad; } else py_start = Py_None; } if (_py_stop) { py_stop = *_py_stop; } else { if (has_cstop) { owned_stop = py_stop = PyInt_FromSsize_t(cstop); if (unlikely(!py_stop)) { Py_XDECREF(owned_start); goto bad; } } else py_stop = Py_None; } py_slice = PySlice_New(py_start, py_stop, Py_None); Py_XDECREF(owned_start); Py_XDECREF(owned_stop); if (unlikely(!py_slice)) goto bad; } #if CYTHON_COMPILING_IN_CPYTHON result = mp->mp_subscript(obj, py_slice); #else result = PyObject_GetItem(obj, py_slice); #endif if (!_py_slice) { Py_DECREF(py_slice); } return result; } PyErr_Format(PyExc_TypeError, "'%.200s' object is unsliceable", Py_TYPE(obj)->tp_name); bad: return NULL; } /* GetVTable */ static void* __Pyx_GetVtable(PyObject *dict) { void* ptr; PyObject *ob = PyObject_GetItem(dict, __pyx_n_s_pyx_vtable); if (!ob) goto bad; #if PY_VERSION_HEX >= 0x02070000 ptr = PyCapsule_GetPointer(ob, 0); #else ptr = PyCObject_AsVoidPtr(ob); #endif if (!ptr && !PyErr_Occurred()) PyErr_SetString(PyExc_RuntimeError, "invalid vtable found for imported type"); Py_DECREF(ob); return ptr; bad: Py_XDECREF(ob); return NULL; } /* Import */ static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list, int level) { PyObject *empty_list = 0; PyObject *module = 0; PyObject *global_dict = 0; PyObject *empty_dict = 0; PyObject *list; #if PY_VERSION_HEX < 0x03030000 PyObject *py_import; py_import = __Pyx_PyObject_GetAttrStr(__pyx_b, __pyx_n_s_import); if (!py_import) goto bad; #endif if (from_list) list = from_list; else { empty_list = PyList_New(0); if (!empty_list) goto bad; list = empty_list; } global_dict = PyModule_GetDict(__pyx_m); if (!global_dict) goto bad; empty_dict = PyDict_New(); if (!empty_dict) goto bad; { #if PY_MAJOR_VERSION >= 3 if (level == -1) { if (strchr(__Pyx_MODULE_NAME, '.')) { #if PY_VERSION_HEX < 0x03030000 PyObject *py_level = PyInt_FromLong(1); if (!py_level) goto bad; module = PyObject_CallFunctionObjArgs(py_import, name, global_dict, empty_dict, list, py_level, NULL); Py_DECREF(py_level); #else module = PyImport_ImportModuleLevelObject( name, global_dict, empty_dict, list, 1); #endif if (!module) { if (!PyErr_ExceptionMatches(PyExc_ImportError)) goto bad; PyErr_Clear(); } } level = 0; } #endif if (!module) { #if PY_VERSION_HEX < 0x03030000 PyObject *py_level = PyInt_FromLong(level); if (!py_level) goto bad; module = PyObject_CallFunctionObjArgs(py_import, name, global_dict, empty_dict, list, py_level, NULL); Py_DECREF(py_level); #else module = PyImport_ImportModuleLevelObject( name, global_dict, empty_dict, list, level); #endif } } bad: #if PY_VERSION_HEX < 0x03030000 Py_XDECREF(py_import); #endif Py_XDECREF(empty_list); Py_XDECREF(empty_dict); return module; } /* GetItemInt */ static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Generic(PyObject *o, PyObject* j) { PyObject *r; if (!j) return NULL; r = PyObject_GetItem(o, j); Py_DECREF(j); return r; } static CYTHON_INLINE PyObject *__Pyx_GetItemInt_List_Fast(PyObject *o, Py_ssize_t i, CYTHON_NCP_UNUSED int wraparound, CYTHON_NCP_UNUSED int boundscheck) { #if CYTHON_COMPILING_IN_CPYTHON if (wraparound & unlikely(i < 0)) i += PyList_GET_SIZE(o); if ((!boundscheck) || likely((0 <= i) & (i < PyList_GET_SIZE(o)))) { PyObject *r = PyList_GET_ITEM(o, i); Py_INCREF(r); return r; } return __Pyx_GetItemInt_Generic(o, PyInt_FromSsize_t(i)); #else return PySequence_GetItem(o, i); #endif } static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Tuple_Fast(PyObject *o, Py_ssize_t i, CYTHON_NCP_UNUSED int wraparound, CYTHON_NCP_UNUSED int boundscheck) { #if CYTHON_COMPILING_IN_CPYTHON if (wraparound & unlikely(i < 0)) i += PyTuple_GET_SIZE(o); if ((!boundscheck) || likely((0 <= i) & (i < PyTuple_GET_SIZE(o)))) { PyObject *r = PyTuple_GET_ITEM(o, i); Py_INCREF(r); return r; } return __Pyx_GetItemInt_Generic(o, PyInt_FromSsize_t(i)); #else return PySequence_GetItem(o, i); #endif } static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Fast(PyObject *o, Py_ssize_t i, int is_list, CYTHON_NCP_UNUSED int wraparound, CYTHON_NCP_UNUSED int boundscheck) { #if CYTHON_COMPILING_IN_CPYTHON if (is_list || PyList_CheckExact(o)) { Py_ssize_t n = ((!wraparound) | likely(i >= 0)) ? i : i + PyList_GET_SIZE(o); if ((!boundscheck) || (likely((n >= 0) & (n < PyList_GET_SIZE(o))))) { PyObject *r = PyList_GET_ITEM(o, n); Py_INCREF(r); return r; } } else if (PyTuple_CheckExact(o)) { Py_ssize_t n = ((!wraparound) | likely(i >= 0)) ? i : i + PyTuple_GET_SIZE(o); if ((!boundscheck) || likely((n >= 0) & (n < PyTuple_GET_SIZE(o)))) { PyObject *r = PyTuple_GET_ITEM(o, n); Py_INCREF(r); return r; } } else { PySequenceMethods *m = Py_TYPE(o)->tp_as_sequence; if (likely(m && m->sq_item)) { if (wraparound && unlikely(i < 0) && likely(m->sq_length)) { Py_ssize_t l = m->sq_length(o); if (likely(l >= 0)) { i += l; } else { if (!PyErr_ExceptionMatches(PyExc_OverflowError)) return NULL; PyErr_Clear(); } } return m->sq_item(o, i); } } #else if (is_list || PySequence_Check(o)) { return PySequence_GetItem(o, i); } #endif return __Pyx_GetItemInt_Generic(o, PyInt_FromSsize_t(i)); } /* CalculateMetaclass */ static PyObject *__Pyx_CalculateMetaclass(PyTypeObject *metaclass, PyObject *bases) { Py_ssize_t i, nbases = PyTuple_GET_SIZE(bases); for (i=0; i < nbases; i++) { PyTypeObject *tmptype; PyObject *tmp = PyTuple_GET_ITEM(bases, i); tmptype = Py_TYPE(tmp); #if PY_MAJOR_VERSION < 3 if (tmptype == &PyClass_Type) continue; #endif if (!metaclass) { metaclass = tmptype; continue; } if (PyType_IsSubtype(metaclass, tmptype)) continue; if (PyType_IsSubtype(tmptype, metaclass)) { metaclass = tmptype; continue; } PyErr_SetString(PyExc_TypeError, "metaclass conflict: " "the metaclass of a derived class " "must be a (non-strict) subclass " "of the metaclasses of all its bases"); return NULL; } if (!metaclass) { #if PY_MAJOR_VERSION < 3 metaclass = &PyClass_Type; #else metaclass = &PyType_Type; #endif } Py_INCREF((PyObject*) metaclass); return (PyObject*) metaclass; } /* FetchCommonType */ static PyTypeObject* __Pyx_FetchCommonType(PyTypeObject* type) { PyObject* fake_module; PyTypeObject* cached_type = NULL; fake_module = PyImport_AddModule((char*) "_cython_" CYTHON_ABI); if (!fake_module) return NULL; Py_INCREF(fake_module); cached_type = (PyTypeObject*) PyObject_GetAttrString(fake_module, type->tp_name); if (cached_type) { if (!PyType_Check((PyObject*)cached_type)) { PyErr_Format(PyExc_TypeError, "Shared Cython type %.200s is not a type object", type->tp_name); goto bad; } if (cached_type->tp_basicsize != type->tp_basicsize) { PyErr_Format(PyExc_TypeError, "Shared Cython type %.200s has the wrong size, try recompiling", type->tp_name); goto bad; } } else { if (!PyErr_ExceptionMatches(PyExc_AttributeError)) goto bad; PyErr_Clear(); if (PyType_Ready(type) < 0) goto bad; if (PyObject_SetAttrString(fake_module, type->tp_name, (PyObject*) type) < 0) goto bad; Py_INCREF(type); cached_type = type; } done: Py_DECREF(fake_module); return cached_type; bad: Py_XDECREF(cached_type); cached_type = NULL; goto done; } /* CythonFunction */ static PyObject * __Pyx_CyFunction_get_doc(__pyx_CyFunctionObject *op, CYTHON_UNUSED void *closure) { if (unlikely(op->func_doc == NULL)) { if (op->func.m_ml->ml_doc) { #if PY_MAJOR_VERSION >= 3 op->func_doc = PyUnicode_FromString(op->func.m_ml->ml_doc); #else op->func_doc = PyString_FromString(op->func.m_ml->ml_doc); #endif if (unlikely(op->func_doc == NULL)) return NULL; } else { Py_INCREF(Py_None); return Py_None; } } Py_INCREF(op->func_doc); return op->func_doc; } static int __Pyx_CyFunction_set_doc(__pyx_CyFunctionObject *op, PyObject *value) { PyObject *tmp = op->func_doc; if (value == NULL) { value = Py_None; } Py_INCREF(value); op->func_doc = value; Py_XDECREF(tmp); return 0; } static PyObject * __Pyx_CyFunction_get_name(__pyx_CyFunctionObject *op) { if (unlikely(op->func_name == NULL)) { #if PY_MAJOR_VERSION >= 3 op->func_name = PyUnicode_InternFromString(op->func.m_ml->ml_name); #else op->func_name = PyString_InternFromString(op->func.m_ml->ml_name); #endif if (unlikely(op->func_name == NULL)) return NULL; } Py_INCREF(op->func_name); return op->func_name; } static int __Pyx_CyFunction_set_name(__pyx_CyFunctionObject *op, PyObject *value) { PyObject *tmp; #if PY_MAJOR_VERSION >= 3 if (unlikely(value == NULL || !PyUnicode_Check(value))) { #else if (unlikely(value == NULL || !PyString_Check(value))) { #endif PyErr_SetString(PyExc_TypeError, "__name__ must be set to a string object"); return -1; } tmp = op->func_name; Py_INCREF(value); op->func_name = value; Py_XDECREF(tmp); return 0; } static PyObject * __Pyx_CyFunction_get_qualname(__pyx_CyFunctionObject *op) { Py_INCREF(op->func_qualname); return op->func_qualname; } static int __Pyx_CyFunction_set_qualname(__pyx_CyFunctionObject *op, PyObject *value) { PyObject *tmp; #if PY_MAJOR_VERSION >= 3 if (unlikely(value == NULL || !PyUnicode_Check(value))) { #else if (unlikely(value == NULL || !PyString_Check(value))) { #endif PyErr_SetString(PyExc_TypeError, "__qualname__ must be set to a string object"); return -1; } tmp = op->func_qualname; Py_INCREF(value); op->func_qualname = value; Py_XDECREF(tmp); return 0; } static PyObject * __Pyx_CyFunction_get_self(__pyx_CyFunctionObject *m, CYTHON_UNUSED void *closure) { PyObject *self; self = m->func_closure; if (self == NULL) self = Py_None; Py_INCREF(self); return self; } static PyObject * __Pyx_CyFunction_get_dict(__pyx_CyFunctionObject *op) { if (unlikely(op->func_dict == NULL)) { op->func_dict = PyDict_New(); if (unlikely(op->func_dict == NULL)) return NULL; } Py_INCREF(op->func_dict); return op->func_dict; } static int __Pyx_CyFunction_set_dict(__pyx_CyFunctionObject *op, PyObject *value) { PyObject *tmp; if (unlikely(value == NULL)) { PyErr_SetString(PyExc_TypeError, "function's dictionary may not be deleted"); return -1; } if (unlikely(!PyDict_Check(value))) { PyErr_SetString(PyExc_TypeError, "setting function's dictionary to a non-dict"); return -1; } tmp = op->func_dict; Py_INCREF(value); op->func_dict = value; Py_XDECREF(tmp); return 0; } static PyObject * __Pyx_CyFunction_get_globals(__pyx_CyFunctionObject *op) { Py_INCREF(op->func_globals); return op->func_globals; } static PyObject * __Pyx_CyFunction_get_closure(CYTHON_UNUSED __pyx_CyFunctionObject *op) { Py_INCREF(Py_None); return Py_None; } static PyObject * __Pyx_CyFunction_get_code(__pyx_CyFunctionObject *op) { PyObject* result = (op->func_code) ? op->func_code : Py_None; Py_INCREF(result); return result; } static int __Pyx_CyFunction_init_defaults(__pyx_CyFunctionObject *op) { int result = 0; PyObject *res = op->defaults_getter((PyObject *) op); if (unlikely(!res)) return -1; #if CYTHON_COMPILING_IN_CPYTHON op->defaults_tuple = PyTuple_GET_ITEM(res, 0); Py_INCREF(op->defaults_tuple); op->defaults_kwdict = PyTuple_GET_ITEM(res, 1); Py_INCREF(op->defaults_kwdict); #else op->defaults_tuple = PySequence_ITEM(res, 0); if (unlikely(!op->defaults_tuple)) result = -1; else { op->defaults_kwdict = PySequence_ITEM(res, 1); if (unlikely(!op->defaults_kwdict)) result = -1; } #endif Py_DECREF(res); return result; } static int __Pyx_CyFunction_set_defaults(__pyx_CyFunctionObject *op, PyObject* value) { PyObject* tmp; if (!value) { value = Py_None; } else if (value != Py_None && !PyTuple_Check(value)) { PyErr_SetString(PyExc_TypeError, "__defaults__ must be set to a tuple object"); return -1; } Py_INCREF(value); tmp = op->defaults_tuple; op->defaults_tuple = value; Py_XDECREF(tmp); return 0; } static PyObject * __Pyx_CyFunction_get_defaults(__pyx_CyFunctionObject *op) { PyObject* result = op->defaults_tuple; if (unlikely(!result)) { if (op->defaults_getter) { if (__Pyx_CyFunction_init_defaults(op) < 0) return NULL; result = op->defaults_tuple; } else { result = Py_None; } } Py_INCREF(result); return result; } static int __Pyx_CyFunction_set_kwdefaults(__pyx_CyFunctionObject *op, PyObject* value) { PyObject* tmp; if (!value) { value = Py_None; } else if (value != Py_None && !PyDict_Check(value)) { PyErr_SetString(PyExc_TypeError, "__kwdefaults__ must be set to a dict object"); return -1; } Py_INCREF(value); tmp = op->defaults_kwdict; op->defaults_kwdict = value; Py_XDECREF(tmp); return 0; } static PyObject * __Pyx_CyFunction_get_kwdefaults(__pyx_CyFunctionObject *op) { PyObject* result = op->defaults_kwdict; if (unlikely(!result)) { if (op->defaults_getter) { if (__Pyx_CyFunction_init_defaults(op) < 0) return NULL; result = op->defaults_kwdict; } else { result = Py_None; } } Py_INCREF(result); return result; } static int __Pyx_CyFunction_set_annotations(__pyx_CyFunctionObject *op, PyObject* value) { PyObject* tmp; if (!value || value == Py_None) { value = NULL; } else if (!PyDict_Check(value)) { PyErr_SetString(PyExc_TypeError, "__annotations__ must be set to a dict object"); return -1; } Py_XINCREF(value); tmp = op->func_annotations; op->func_annotations = value; Py_XDECREF(tmp); return 0; } static PyObject * __Pyx_CyFunction_get_annotations(__pyx_CyFunctionObject *op) { PyObject* result = op->func_annotations; if (unlikely(!result)) { result = PyDict_New(); if (unlikely(!result)) return NULL; op->func_annotations = result; } Py_INCREF(result); return result; } static PyGetSetDef __pyx_CyFunction_getsets[] = { {(char *) "func_doc", (getter)__Pyx_CyFunction_get_doc, (setter)__Pyx_CyFunction_set_doc, 0, 0}, {(char *) "__doc__", (getter)__Pyx_CyFunction_get_doc, (setter)__Pyx_CyFunction_set_doc, 0, 0}, {(char *) "func_name", (getter)__Pyx_CyFunction_get_name, (setter)__Pyx_CyFunction_set_name, 0, 0}, {(char *) "__name__", (getter)__Pyx_CyFunction_get_name, (setter)__Pyx_CyFunction_set_name, 0, 0}, {(char *) "__qualname__", (getter)__Pyx_CyFunction_get_qualname, (setter)__Pyx_CyFunction_set_qualname, 0, 0}, {(char *) "__self__", (getter)__Pyx_CyFunction_get_self, 0, 0, 0}, {(char *) "func_dict", (getter)__Pyx_CyFunction_get_dict, (setter)__Pyx_CyFunction_set_dict, 0, 0}, {(char *) "__dict__", (getter)__Pyx_CyFunction_get_dict, (setter)__Pyx_CyFunction_set_dict, 0, 0}, {(char *) "func_globals", (getter)__Pyx_CyFunction_get_globals, 0, 0, 0}, {(char *) "__globals__", (getter)__Pyx_CyFunction_get_globals, 0, 0, 0}, {(char *) "func_closure", (getter)__Pyx_CyFunction_get_closure, 0, 0, 0}, {(char *) "__closure__", (getter)__Pyx_CyFunction_get_closure, 0, 0, 0}, {(char *) "func_code", (getter)__Pyx_CyFunction_get_code, 0, 0, 0}, {(char *) "__code__", (getter)__Pyx_CyFunction_get_code, 0, 0, 0}, {(char *) "func_defaults", (getter)__Pyx_CyFunction_get_defaults, (setter)__Pyx_CyFunction_set_defaults, 0, 0}, {(char *) "__defaults__", (getter)__Pyx_CyFunction_get_defaults, (setter)__Pyx_CyFunction_set_defaults, 0, 0}, {(char *) "__kwdefaults__", (getter)__Pyx_CyFunction_get_kwdefaults, (setter)__Pyx_CyFunction_set_kwdefaults, 0, 0}, {(char *) "__annotations__", (getter)__Pyx_CyFunction_get_annotations, (setter)__Pyx_CyFunction_set_annotations, 0, 0}, {0, 0, 0, 0, 0} }; static PyMemberDef __pyx_CyFunction_members[] = { {(char *) "__module__", T_OBJECT, offsetof(__pyx_CyFunctionObject, func.m_module), PY_WRITE_RESTRICTED, 0}, {0, 0, 0, 0, 0} }; static PyObject * __Pyx_CyFunction_reduce(__pyx_CyFunctionObject *m, CYTHON_UNUSED PyObject *args) { #if PY_MAJOR_VERSION >= 3 return PyUnicode_FromString(m->func.m_ml->ml_name); #else return PyString_FromString(m->func.m_ml->ml_name); #endif } static PyMethodDef __pyx_CyFunction_methods[] = { {"__reduce__", (PyCFunction)__Pyx_CyFunction_reduce, METH_VARARGS, 0}, {0, 0, 0, 0} }; #if PY_VERSION_HEX < 0x030500A0 #define __Pyx_CyFunction_weakreflist(cyfunc) ((cyfunc)->func_weakreflist) #else #define __Pyx_CyFunction_weakreflist(cyfunc) ((cyfunc)->func.m_weakreflist) #endif static PyObject *__Pyx_CyFunction_New(PyTypeObject *type, PyMethodDef *ml, int flags, PyObject* qualname, PyObject *closure, PyObject *module, PyObject* globals, PyObject* code) { __pyx_CyFunctionObject *op = PyObject_GC_New(__pyx_CyFunctionObject, type); if (op == NULL) return NULL; op->flags = flags; __Pyx_CyFunction_weakreflist(op) = NULL; op->func.m_ml = ml; op->func.m_self = (PyObject *) op; Py_XINCREF(closure); op->func_closure = closure; Py_XINCREF(module); op->func.m_module = module; op->func_dict = NULL; op->func_name = NULL; Py_INCREF(qualname); op->func_qualname = qualname; op->func_doc = NULL; op->func_classobj = NULL; op->func_globals = globals; Py_INCREF(op->func_globals); Py_XINCREF(code); op->func_code = code; op->defaults_pyobjects = 0; op->defaults = NULL; op->defaults_tuple = NULL; op->defaults_kwdict = NULL; op->defaults_getter = NULL; op->func_annotations = NULL; PyObject_GC_Track(op); return (PyObject *) op; } static int __Pyx_CyFunction_clear(__pyx_CyFunctionObject *m) { Py_CLEAR(m->func_closure); Py_CLEAR(m->func.m_module); Py_CLEAR(m->func_dict); Py_CLEAR(m->func_name); Py_CLEAR(m->func_qualname); Py_CLEAR(m->func_doc); Py_CLEAR(m->func_globals); Py_CLEAR(m->func_code); Py_CLEAR(m->func_classobj); Py_CLEAR(m->defaults_tuple); Py_CLEAR(m->defaults_kwdict); Py_CLEAR(m->func_annotations); if (m->defaults) { PyObject **pydefaults = __Pyx_CyFunction_Defaults(PyObject *, m); int i; for (i = 0; i < m->defaults_pyobjects; i++) Py_XDECREF(pydefaults[i]); PyObject_Free(m->defaults); m->defaults = NULL; } return 0; } static void __Pyx_CyFunction_dealloc(__pyx_CyFunctionObject *m) { PyObject_GC_UnTrack(m); if (__Pyx_CyFunction_weakreflist(m) != NULL) PyObject_ClearWeakRefs((PyObject *) m); __Pyx_CyFunction_clear(m); PyObject_GC_Del(m); } static int __Pyx_CyFunction_traverse(__pyx_CyFunctionObject *m, visitproc visit, void *arg) { Py_VISIT(m->func_closure); Py_VISIT(m->func.m_module); Py_VISIT(m->func_dict); Py_VISIT(m->func_name); Py_VISIT(m->func_qualname); Py_VISIT(m->func_doc); Py_VISIT(m->func_globals); Py_VISIT(m->func_code); Py_VISIT(m->func_classobj); Py_VISIT(m->defaults_tuple); Py_VISIT(m->defaults_kwdict); if (m->defaults) { PyObject **pydefaults = __Pyx_CyFunction_Defaults(PyObject *, m); int i; for (i = 0; i < m->defaults_pyobjects; i++) Py_VISIT(pydefaults[i]); } return 0; } static PyObject *__Pyx_CyFunction_descr_get(PyObject *func, PyObject *obj, PyObject *type) { __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func; if (m->flags & __Pyx_CYFUNCTION_STATICMETHOD) { Py_INCREF(func); return func; } if (m->flags & __Pyx_CYFUNCTION_CLASSMETHOD) { if (type == NULL) type = (PyObject *)(Py_TYPE(obj)); return __Pyx_PyMethod_New(func, type, (PyObject *)(Py_TYPE(type))); } if (obj == Py_None) obj = NULL; return __Pyx_PyMethod_New(func, obj, type); } static PyObject* __Pyx_CyFunction_repr(__pyx_CyFunctionObject *op) { #if PY_MAJOR_VERSION >= 3 return PyUnicode_FromFormat("", op->func_qualname, (void *)op); #else return PyString_FromFormat("", PyString_AsString(op->func_qualname), (void *)op); #endif } #if CYTHON_COMPILING_IN_PYPY static PyObject * __Pyx_CyFunction_Call(PyObject *func, PyObject *arg, PyObject *kw) { PyCFunctionObject* f = (PyCFunctionObject*)func; PyCFunction meth = f->m_ml->ml_meth; PyObject *self = f->m_self; Py_ssize_t size; switch (f->m_ml->ml_flags & (METH_VARARGS | METH_KEYWORDS | METH_NOARGS | METH_O)) { case METH_VARARGS: if (likely(kw == NULL || PyDict_Size(kw) == 0)) return (*meth)(self, arg); break; case METH_VARARGS | METH_KEYWORDS: return (*(PyCFunctionWithKeywords)meth)(self, arg, kw); case METH_NOARGS: if (likely(kw == NULL || PyDict_Size(kw) == 0)) { size = PyTuple_GET_SIZE(arg); if (likely(size == 0)) return (*meth)(self, NULL); PyErr_Format(PyExc_TypeError, "%.200s() takes no arguments (%" CYTHON_FORMAT_SSIZE_T "d given)", f->m_ml->ml_name, size); return NULL; } break; case METH_O: if (likely(kw == NULL || PyDict_Size(kw) == 0)) { size = PyTuple_GET_SIZE(arg); if (likely(size == 1)) { PyObject *result, *arg0 = PySequence_ITEM(arg, 0); if (unlikely(!arg0)) return NULL; result = (*meth)(self, arg0); Py_DECREF(arg0); return result; } PyErr_Format(PyExc_TypeError, "%.200s() takes exactly one argument (%" CYTHON_FORMAT_SSIZE_T "d given)", f->m_ml->ml_name, size); return NULL; } break; default: PyErr_SetString(PyExc_SystemError, "Bad call flags in " "__Pyx_CyFunction_Call. METH_OLDARGS is no " "longer supported!"); return NULL; } PyErr_Format(PyExc_TypeError, "%.200s() takes no keyword arguments", f->m_ml->ml_name); return NULL; } #else static PyObject * __Pyx_CyFunction_Call(PyObject *func, PyObject *arg, PyObject *kw) { return PyCFunction_Call(func, arg, kw); } #endif static PyTypeObject __pyx_CyFunctionType_type = { PyVarObject_HEAD_INIT(0, 0) "cython_function_or_method", sizeof(__pyx_CyFunctionObject), 0, (destructor) __Pyx_CyFunction_dealloc, 0, 0, 0, #if PY_MAJOR_VERSION < 3 0, #else 0, #endif (reprfunc) __Pyx_CyFunction_repr, 0, 0, 0, 0, __Pyx_CyFunction_Call, 0, 0, 0, 0, Py_TPFLAGS_DEFAULT | Py_TPFLAGS_HAVE_GC, 0, (traverseproc) __Pyx_CyFunction_traverse, (inquiry) __Pyx_CyFunction_clear, 0, #if PY_VERSION_HEX < 0x030500A0 offsetof(__pyx_CyFunctionObject, func_weakreflist), #else offsetof(PyCFunctionObject, m_weakreflist), #endif 0, 0, __pyx_CyFunction_methods, __pyx_CyFunction_members, __pyx_CyFunction_getsets, 0, 0, __Pyx_CyFunction_descr_get, 0, offsetof(__pyx_CyFunctionObject, func_dict), 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, #if PY_VERSION_HEX >= 0x030400a1 0, #endif }; static int __pyx_CyFunction_init(void) { #if !CYTHON_COMPILING_IN_PYPY __pyx_CyFunctionType_type.tp_call = PyCFunction_Call; #endif __pyx_CyFunctionType = __Pyx_FetchCommonType(&__pyx_CyFunctionType_type); if (__pyx_CyFunctionType == NULL) { return -1; } return 0; } static CYTHON_INLINE void *__Pyx_CyFunction_InitDefaults(PyObject *func, size_t size, int pyobjects) { __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func; m->defaults = PyObject_Malloc(size); if (!m->defaults) return PyErr_NoMemory(); memset(m->defaults, 0, size); m->defaults_pyobjects = pyobjects; return m->defaults; } static CYTHON_INLINE void __Pyx_CyFunction_SetDefaultsTuple(PyObject *func, PyObject *tuple) { __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func; m->defaults_tuple = tuple; Py_INCREF(tuple); } static CYTHON_INLINE void __Pyx_CyFunction_SetDefaultsKwDict(PyObject *func, PyObject *dict) { __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func; m->defaults_kwdict = dict; Py_INCREF(dict); } static CYTHON_INLINE void __Pyx_CyFunction_SetAnnotationsDict(PyObject *func, PyObject *dict) { __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func; m->func_annotations = dict; Py_INCREF(dict); } /* Py3ClassCreate */ static PyObject *__Pyx_Py3MetaclassPrepare(PyObject *metaclass, PyObject *bases, PyObject *name, PyObject *qualname, PyObject *mkw, PyObject *modname, PyObject *doc) { PyObject *ns; if (metaclass) { PyObject *prep = __Pyx_PyObject_GetAttrStr(metaclass, __pyx_n_s_prepare); if (prep) { PyObject *pargs = PyTuple_Pack(2, name, bases); if (unlikely(!pargs)) { Py_DECREF(prep); return NULL; } ns = PyObject_Call(prep, pargs, mkw); Py_DECREF(prep); Py_DECREF(pargs); } else { if (unlikely(!PyErr_ExceptionMatches(PyExc_AttributeError))) return NULL; PyErr_Clear(); ns = PyDict_New(); } } else { ns = PyDict_New(); } if (unlikely(!ns)) return NULL; if (unlikely(PyObject_SetItem(ns, __pyx_n_s_module, modname) < 0)) goto bad; if (unlikely(PyObject_SetItem(ns, __pyx_n_s_qualname, qualname) < 0)) goto bad; if (unlikely(doc && PyObject_SetItem(ns, __pyx_n_s_doc, doc) < 0)) goto bad; return ns; bad: Py_DECREF(ns); return NULL; } static PyObject *__Pyx_Py3ClassCreate(PyObject *metaclass, PyObject *name, PyObject *bases, PyObject *dict, PyObject *mkw, int calculate_metaclass, int allow_py2_metaclass) { PyObject *result, *margs; PyObject *owned_metaclass = NULL; if (allow_py2_metaclass) { owned_metaclass = PyObject_GetItem(dict, __pyx_n_s_metaclass); if (owned_metaclass) { metaclass = owned_metaclass; } else if (likely(PyErr_ExceptionMatches(PyExc_KeyError))) { PyErr_Clear(); } else { return NULL; } } if (calculate_metaclass && (!metaclass || PyType_Check(metaclass))) { metaclass = __Pyx_CalculateMetaclass((PyTypeObject*) metaclass, bases); Py_XDECREF(owned_metaclass); if (unlikely(!metaclass)) return NULL; owned_metaclass = metaclass; } margs = PyTuple_Pack(3, name, bases, dict); if (unlikely(!margs)) { result = NULL; } else { result = PyObject_Call(metaclass, margs, mkw); Py_DECREF(margs); } Py_XDECREF(owned_metaclass); return result; } /* CodeObjectCache */ static int __pyx_bisect_code_objects(__Pyx_CodeObjectCacheEntry* entries, int count, int code_line) { int start = 0, mid = 0, end = count - 1; if (end >= 0 && code_line > entries[end].code_line) { return count; } while (start < end) { mid = start + (end - start) / 2; if (code_line < entries[mid].code_line) { end = mid; } else if (code_line > entries[mid].code_line) { start = mid + 1; } else { return mid; } } if (code_line <= entries[mid].code_line) { return mid; } else { return mid + 1; } } static PyCodeObject *__pyx_find_code_object(int code_line) { PyCodeObject* code_object; int pos; if (unlikely(!code_line) || unlikely(!__pyx_code_cache.entries)) { return NULL; } pos = __pyx_bisect_code_objects(__pyx_code_cache.entries, __pyx_code_cache.count, code_line); if (unlikely(pos >= __pyx_code_cache.count) || unlikely(__pyx_code_cache.entries[pos].code_line != code_line)) { return NULL; } code_object = __pyx_code_cache.entries[pos].code_object; Py_INCREF(code_object); return code_object; } static void __pyx_insert_code_object(int code_line, PyCodeObject* code_object) { int pos, i; __Pyx_CodeObjectCacheEntry* entries = __pyx_code_cache.entries; if (unlikely(!code_line)) { return; } if (unlikely(!entries)) { entries = (__Pyx_CodeObjectCacheEntry*)PyMem_Malloc(64*sizeof(__Pyx_CodeObjectCacheEntry)); if (likely(entries)) { __pyx_code_cache.entries = entries; __pyx_code_cache.max_count = 64; __pyx_code_cache.count = 1; entries[0].code_line = code_line; entries[0].code_object = code_object; Py_INCREF(code_object); } return; } pos = __pyx_bisect_code_objects(__pyx_code_cache.entries, __pyx_code_cache.count, code_line); if ((pos < __pyx_code_cache.count) && unlikely(__pyx_code_cache.entries[pos].code_line == code_line)) { PyCodeObject* tmp = entries[pos].code_object; entries[pos].code_object = code_object; Py_DECREF(tmp); return; } if (__pyx_code_cache.count == __pyx_code_cache.max_count) { int new_max = __pyx_code_cache.max_count + 64; entries = (__Pyx_CodeObjectCacheEntry*)PyMem_Realloc( __pyx_code_cache.entries, (size_t)new_max*sizeof(__Pyx_CodeObjectCacheEntry)); if (unlikely(!entries)) { return; } __pyx_code_cache.entries = entries; __pyx_code_cache.max_count = new_max; } for (i=__pyx_code_cache.count; i>pos; i--) { entries[i] = entries[i-1]; } entries[pos].code_line = code_line; entries[pos].code_object = code_object; __pyx_code_cache.count++; Py_INCREF(code_object); } /* AddTraceback */ #include "compile.h" #include "frameobject.h" #include "traceback.h" static PyCodeObject* __Pyx_CreateCodeObjectForTraceback( const char *funcname, int c_line, int py_line, const char *filename) { PyCodeObject *py_code = 0; PyObject *py_srcfile = 0; PyObject *py_funcname = 0; #if PY_MAJOR_VERSION < 3 py_srcfile = PyString_FromString(filename); #else py_srcfile = PyUnicode_FromString(filename); #endif if (!py_srcfile) goto bad; if (c_line) { #if PY_MAJOR_VERSION < 3 py_funcname = PyString_FromFormat( "%s (%s:%d)", funcname, __pyx_cfilenm, c_line); #else py_funcname = PyUnicode_FromFormat( "%s (%s:%d)", funcname, __pyx_cfilenm, c_line); #endif } else { #if PY_MAJOR_VERSION < 3 py_funcname = PyString_FromString(funcname); #else py_funcname = PyUnicode_FromString(funcname); #endif } if (!py_funcname) goto bad; py_code = __Pyx_PyCode_New( 0, 0, 0, 0, 0, __pyx_empty_bytes, /*PyObject *code,*/ __pyx_empty_tuple, /*PyObject *consts,*/ __pyx_empty_tuple, /*PyObject *names,*/ __pyx_empty_tuple, /*PyObject *varnames,*/ __pyx_empty_tuple, /*PyObject *freevars,*/ __pyx_empty_tuple, /*PyObject *cellvars,*/ py_srcfile, /*PyObject *filename,*/ py_funcname, /*PyObject *name,*/ py_line, __pyx_empty_bytes /*PyObject *lnotab*/ ); Py_DECREF(py_srcfile); Py_DECREF(py_funcname); return py_code; bad: Py_XDECREF(py_srcfile); Py_XDECREF(py_funcname); return NULL; } static void __Pyx_AddTraceback(const char *funcname, int c_line, int py_line, const char *filename) { PyCodeObject *py_code = 0; PyFrameObject *py_frame = 0; py_code = __pyx_find_code_object(c_line ? c_line : py_line); if (!py_code) { py_code = __Pyx_CreateCodeObjectForTraceback( funcname, c_line, py_line, filename); if (!py_code) goto bad; __pyx_insert_code_object(c_line ? c_line : py_line, py_code); } py_frame = PyFrame_New( PyThreadState_GET(), /*PyThreadState *tstate,*/ py_code, /*PyCodeObject *code,*/ __pyx_d, /*PyObject *globals,*/ 0 /*PyObject *locals*/ ); if (!py_frame) goto bad; py_frame->f_lineno = py_line; PyTraceBack_Here(py_frame); bad: Py_XDECREF(py_code); Py_XDECREF(py_frame); } /* CIntToPy */ static CYTHON_INLINE PyObject* __Pyx_PyInt_From_long(long value) { const long neg_one = (long) -1, const_zero = (long) 0; const int is_unsigned = neg_one > const_zero; if (is_unsigned) { if (sizeof(long) < sizeof(long)) { return PyInt_FromLong((long) value); } else if (sizeof(long) <= sizeof(unsigned long)) { return PyLong_FromUnsignedLong((unsigned long) value); } else if (sizeof(long) <= sizeof(unsigned PY_LONG_LONG)) { return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value); } } else { if (sizeof(long) <= sizeof(long)) { return PyInt_FromLong((long) value); } else if (sizeof(long) <= sizeof(PY_LONG_LONG)) { return PyLong_FromLongLong((PY_LONG_LONG) value); } } { int one = 1; int little = (int)*(unsigned char *)&one; unsigned char *bytes = (unsigned char *)&value; return _PyLong_FromByteArray(bytes, sizeof(long), little, !is_unsigned); } } /* CIntToPy */ static CYTHON_INLINE PyObject* __Pyx_PyInt_From_SDL_EventType(SDL_EventType value) { const SDL_EventType neg_one = (SDL_EventType) -1, const_zero = (SDL_EventType) 0; const int is_unsigned = neg_one > const_zero; if (is_unsigned) { if (sizeof(SDL_EventType) < sizeof(long)) { return PyInt_FromLong((long) value); } else if (sizeof(SDL_EventType) <= sizeof(unsigned long)) { return PyLong_FromUnsignedLong((unsigned long) value); } else if (sizeof(SDL_EventType) <= sizeof(unsigned PY_LONG_LONG)) { return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value); } } else { if (sizeof(SDL_EventType) <= sizeof(long)) { return PyInt_FromLong((long) value); } else if (sizeof(SDL_EventType) <= sizeof(PY_LONG_LONG)) { return PyLong_FromLongLong((PY_LONG_LONG) value); } } { int one = 1; int little = (int)*(unsigned char *)&one; unsigned char *bytes = (unsigned char *)&value; return _PyLong_FromByteArray(bytes, sizeof(SDL_EventType), little, !is_unsigned); } } /* CIntToPy */ static CYTHON_INLINE PyObject* __Pyx_PyInt_From_SDL_Scancode(SDL_Scancode value) { const SDL_Scancode neg_one = (SDL_Scancode) -1, const_zero = (SDL_Scancode) 0; const int is_unsigned = neg_one > const_zero; if (is_unsigned) { if (sizeof(SDL_Scancode) < sizeof(long)) { return PyInt_FromLong((long) value); } else if (sizeof(SDL_Scancode) <= sizeof(unsigned long)) { return PyLong_FromUnsignedLong((unsigned long) value); } else if (sizeof(SDL_Scancode) <= sizeof(unsigned PY_LONG_LONG)) { return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value); } } else { if (sizeof(SDL_Scancode) <= sizeof(long)) { return PyInt_FromLong((long) value); } else if (sizeof(SDL_Scancode) <= sizeof(PY_LONG_LONG)) { return PyLong_FromLongLong((PY_LONG_LONG) value); } } { int one = 1; int little = (int)*(unsigned char *)&one; unsigned char *bytes = (unsigned char *)&value; return _PyLong_FromByteArray(bytes, sizeof(SDL_Scancode), little, !is_unsigned); } } /* CIntToPy */ static CYTHON_INLINE PyObject* __Pyx_PyInt_From_int32_t(int32_t value) { const int32_t neg_one = (int32_t) -1, const_zero = (int32_t) 0; const int is_unsigned = neg_one > const_zero; if (is_unsigned) { if (sizeof(int32_t) < sizeof(long)) { return PyInt_FromLong((long) value); } else if (sizeof(int32_t) <= sizeof(unsigned long)) { return PyLong_FromUnsignedLong((unsigned long) value); } else if (sizeof(int32_t) <= sizeof(unsigned PY_LONG_LONG)) { return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value); } } else { if (sizeof(int32_t) <= sizeof(long)) { return PyInt_FromLong((long) value); } else if (sizeof(int32_t) <= sizeof(PY_LONG_LONG)) { return PyLong_FromLongLong((PY_LONG_LONG) value); } } { int one = 1; int little = (int)*(unsigned char *)&one; unsigned char *bytes = (unsigned char *)&value; return _PyLong_FromByteArray(bytes, sizeof(int32_t), little, !is_unsigned); } } /* CIntToPy */ static CYTHON_INLINE PyObject* __Pyx_PyInt_From_uint16_t(uint16_t value) { const uint16_t neg_one = (uint16_t) -1, const_zero = (uint16_t) 0; const int is_unsigned = neg_one > const_zero; if (is_unsigned) { if (sizeof(uint16_t) < sizeof(long)) { return PyInt_FromLong((long) value); } else if (sizeof(uint16_t) <= sizeof(unsigned long)) { return PyLong_FromUnsignedLong((unsigned long) value); } else if (sizeof(uint16_t) <= sizeof(unsigned PY_LONG_LONG)) { return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value); } } else { if (sizeof(uint16_t) <= sizeof(long)) { return PyInt_FromLong((long) value); } else if (sizeof(uint16_t) <= sizeof(PY_LONG_LONG)) { return PyLong_FromLongLong((PY_LONG_LONG) value); } } { int one = 1; int little = (int)*(unsigned char *)&one; unsigned char *bytes = (unsigned char *)&value; return _PyLong_FromByteArray(bytes, sizeof(uint16_t), little, !is_unsigned); } } /* CIntToPy */ static CYTHON_INLINE PyObject* __Pyx_PyInt_From_uint8_t(uint8_t value) { const uint8_t neg_one = (uint8_t) -1, const_zero = (uint8_t) 0; const int is_unsigned = neg_one > const_zero; if (is_unsigned) { if (sizeof(uint8_t) < sizeof(long)) { return PyInt_FromLong((long) value); } else if (sizeof(uint8_t) <= sizeof(unsigned long)) { return PyLong_FromUnsignedLong((unsigned long) value); } else if (sizeof(uint8_t) <= sizeof(unsigned PY_LONG_LONG)) { return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value); } } else { if (sizeof(uint8_t) <= sizeof(long)) { return PyInt_FromLong((long) value); } else if (sizeof(uint8_t) <= sizeof(PY_LONG_LONG)) { return PyLong_FromLongLong((PY_LONG_LONG) value); } } { int one = 1; int little = (int)*(unsigned char *)&one; unsigned char *bytes = (unsigned char *)&value; return _PyLong_FromByteArray(bytes, sizeof(uint8_t), little, !is_unsigned); } } /* CIntToPy */ static CYTHON_INLINE PyObject* __Pyx_PyInt_From_uint32_t(uint32_t value) { const uint32_t neg_one = (uint32_t) -1, const_zero = (uint32_t) 0; const int is_unsigned = neg_one > const_zero; if (is_unsigned) { if (sizeof(uint32_t) < sizeof(long)) { return PyInt_FromLong((long) value); } else if (sizeof(uint32_t) <= sizeof(unsigned long)) { return PyLong_FromUnsignedLong((unsigned long) value); } else if (sizeof(uint32_t) <= sizeof(unsigned PY_LONG_LONG)) { return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value); } } else { if (sizeof(uint32_t) <= sizeof(long)) { return PyInt_FromLong((long) value); } else if (sizeof(uint32_t) <= sizeof(PY_LONG_LONG)) { return PyLong_FromLongLong((PY_LONG_LONG) value); } } { int one = 1; int little = (int)*(unsigned char *)&one; unsigned char *bytes = (unsigned char *)&value; return _PyLong_FromByteArray(bytes, sizeof(uint32_t), little, !is_unsigned); } } /* CIntToPy */ static CYTHON_INLINE PyObject* __Pyx_PyInt_From_int(int value) { const int neg_one = (int) -1, const_zero = (int) 0; const int is_unsigned = neg_one > const_zero; if (is_unsigned) { if (sizeof(int) < sizeof(long)) { return PyInt_FromLong((long) value); } else if (sizeof(int) <= sizeof(unsigned long)) { return PyLong_FromUnsignedLong((unsigned long) value); } else if (sizeof(int) <= sizeof(unsigned PY_LONG_LONG)) { return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value); } } else { if (sizeof(int) <= sizeof(long)) { return PyInt_FromLong((long) value); } else if (sizeof(int) <= sizeof(PY_LONG_LONG)) { return PyLong_FromLongLong((PY_LONG_LONG) value); } } { int one = 1; int little = (int)*(unsigned char *)&one; unsigned char *bytes = (unsigned char *)&value; return _PyLong_FromByteArray(bytes, sizeof(int), little, !is_unsigned); } } /* CIntToPy */ static CYTHON_INLINE PyObject* __Pyx_PyInt_From_int16_t(int16_t value) { const int16_t neg_one = (int16_t) -1, const_zero = (int16_t) 0; const int is_unsigned = neg_one > const_zero; if (is_unsigned) { if (sizeof(int16_t) < sizeof(long)) { return PyInt_FromLong((long) value); } else if (sizeof(int16_t) <= sizeof(unsigned long)) { return PyLong_FromUnsignedLong((unsigned long) value); } else if (sizeof(int16_t) <= sizeof(unsigned PY_LONG_LONG)) { return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value); } } else { if (sizeof(int16_t) <= sizeof(long)) { return PyInt_FromLong((long) value); } else if (sizeof(int16_t) <= sizeof(PY_LONG_LONG)) { return PyLong_FromLongLong((PY_LONG_LONG) value); } } { int one = 1; int little = (int)*(unsigned char *)&one; unsigned char *bytes = (unsigned char *)&value; return _PyLong_FromByteArray(bytes, sizeof(int16_t), little, !is_unsigned); } } /* CIntToPy */ static CYTHON_INLINE PyObject* __Pyx_PyInt_From_int64_t(int64_t value) { const int64_t neg_one = (int64_t) -1, const_zero = (int64_t) 0; const int is_unsigned = neg_one > const_zero; if (is_unsigned) { if (sizeof(int64_t) < sizeof(long)) { return PyInt_FromLong((long) value); } else if (sizeof(int64_t) <= sizeof(unsigned long)) { return PyLong_FromUnsignedLong((unsigned long) value); } else if (sizeof(int64_t) <= sizeof(unsigned PY_LONG_LONG)) { return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value); } } else { if (sizeof(int64_t) <= sizeof(long)) { return PyInt_FromLong((long) value); } else if (sizeof(int64_t) <= sizeof(PY_LONG_LONG)) { return PyLong_FromLongLong((PY_LONG_LONG) value); } } { int one = 1; int little = (int)*(unsigned char *)&one; unsigned char *bytes = (unsigned char *)&value; return _PyLong_FromByteArray(bytes, sizeof(int64_t), little, !is_unsigned); } } /* CIntFromPyVerify */ #define __PYX_VERIFY_RETURN_INT(target_type, func_type, func_value)\ __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, 0) #define __PYX_VERIFY_RETURN_INT_EXC(target_type, func_type, func_value)\ __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, 1) #define __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, exc)\ {\ func_type value = func_value;\ if (sizeof(target_type) < sizeof(func_type)) {\ if (unlikely(value != (func_type) (target_type) value)) {\ func_type zero = 0;\ if (exc && unlikely(value == (func_type)-1 && PyErr_Occurred()))\ return (target_type) -1;\ if (is_unsigned && unlikely(value < zero))\ goto raise_neg_overflow;\ else\ goto raise_overflow;\ }\ }\ return (target_type) value;\ } /* CIntToPy */ static CYTHON_INLINE PyObject* __Pyx_PyInt_From_SDL_bool(SDL_bool value) { const SDL_bool neg_one = (SDL_bool) -1, const_zero = (SDL_bool) 0; const int is_unsigned = neg_one > const_zero; if (is_unsigned) { if (sizeof(SDL_bool) < sizeof(long)) { return PyInt_FromLong((long) value); } else if (sizeof(SDL_bool) <= sizeof(unsigned long)) { return PyLong_FromUnsignedLong((unsigned long) value); } else if (sizeof(SDL_bool) <= sizeof(unsigned PY_LONG_LONG)) { return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value); } } else { if (sizeof(SDL_bool) <= sizeof(long)) { return PyInt_FromLong((long) value); } else if (sizeof(SDL_bool) <= sizeof(PY_LONG_LONG)) { return PyLong_FromLongLong((PY_LONG_LONG) value); } } { int one = 1; int little = (int)*(unsigned char *)&one; unsigned char *bytes = (unsigned char *)&value; return _PyLong_FromByteArray(bytes, sizeof(SDL_bool), little, !is_unsigned); } } /* CIntFromPy */ static CYTHON_INLINE uint32_t __Pyx_PyInt_As_uint32_t(PyObject *x) { const uint32_t neg_one = (uint32_t) -1, const_zero = (uint32_t) 0; const int is_unsigned = neg_one > const_zero; #if PY_MAJOR_VERSION < 3 if (likely(PyInt_Check(x))) { if (sizeof(uint32_t) < sizeof(long)) { __PYX_VERIFY_RETURN_INT(uint32_t, long, PyInt_AS_LONG(x)) } else { long val = PyInt_AS_LONG(x); if (is_unsigned && unlikely(val < 0)) { goto raise_neg_overflow; } return (uint32_t) val; } } else #endif if (likely(PyLong_Check(x))) { if (is_unsigned) { #if CYTHON_USE_PYLONG_INTERNALS const digit* digits = ((PyLongObject*)x)->ob_digit; switch (Py_SIZE(x)) { case 0: return (uint32_t) 0; case 1: __PYX_VERIFY_RETURN_INT(uint32_t, digit, digits[0]) case 2: if (8 * sizeof(uint32_t) > 1 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(uint32_t, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(uint32_t) >= 2 * PyLong_SHIFT) { return (uint32_t) (((((uint32_t)digits[1]) << PyLong_SHIFT) | (uint32_t)digits[0])); } } break; case 3: if (8 * sizeof(uint32_t) > 2 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(uint32_t, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(uint32_t) >= 3 * PyLong_SHIFT) { return (uint32_t) (((((((uint32_t)digits[2]) << PyLong_SHIFT) | (uint32_t)digits[1]) << PyLong_SHIFT) | (uint32_t)digits[0])); } } break; case 4: if (8 * sizeof(uint32_t) > 3 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(uint32_t, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(uint32_t) >= 4 * PyLong_SHIFT) { return (uint32_t) (((((((((uint32_t)digits[3]) << PyLong_SHIFT) | (uint32_t)digits[2]) << PyLong_SHIFT) | (uint32_t)digits[1]) << PyLong_SHIFT) | (uint32_t)digits[0])); } } break; } #endif #if CYTHON_COMPILING_IN_CPYTHON if (unlikely(Py_SIZE(x) < 0)) { goto raise_neg_overflow; } #else { int result = PyObject_RichCompareBool(x, Py_False, Py_LT); if (unlikely(result < 0)) return (uint32_t) -1; if (unlikely(result == 1)) goto raise_neg_overflow; } #endif if (sizeof(uint32_t) <= sizeof(unsigned long)) { __PYX_VERIFY_RETURN_INT_EXC(uint32_t, unsigned long, PyLong_AsUnsignedLong(x)) } else if (sizeof(uint32_t) <= sizeof(unsigned PY_LONG_LONG)) { __PYX_VERIFY_RETURN_INT_EXC(uint32_t, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x)) } } else { #if CYTHON_USE_PYLONG_INTERNALS const digit* digits = ((PyLongObject*)x)->ob_digit; switch (Py_SIZE(x)) { case 0: return (uint32_t) 0; case -1: __PYX_VERIFY_RETURN_INT(uint32_t, sdigit, (sdigit) (-(sdigit)digits[0])) case 1: __PYX_VERIFY_RETURN_INT(uint32_t, digit, +digits[0]) case -2: if (8 * sizeof(uint32_t) - 1 > 1 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(uint32_t, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(uint32_t) - 1 > 2 * PyLong_SHIFT) { return (uint32_t) (((uint32_t)-1)*(((((uint32_t)digits[1]) << PyLong_SHIFT) | (uint32_t)digits[0]))); } } break; case 2: if (8 * sizeof(uint32_t) > 1 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(uint32_t, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(uint32_t) - 1 > 2 * PyLong_SHIFT) { return (uint32_t) ((((((uint32_t)digits[1]) << PyLong_SHIFT) | (uint32_t)digits[0]))); } } break; case -3: if (8 * sizeof(uint32_t) - 1 > 2 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(uint32_t, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(uint32_t) - 1 > 3 * PyLong_SHIFT) { return (uint32_t) (((uint32_t)-1)*(((((((uint32_t)digits[2]) << PyLong_SHIFT) | (uint32_t)digits[1]) << PyLong_SHIFT) | (uint32_t)digits[0]))); } } break; case 3: if (8 * sizeof(uint32_t) > 2 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(uint32_t, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(uint32_t) - 1 > 3 * PyLong_SHIFT) { return (uint32_t) ((((((((uint32_t)digits[2]) << PyLong_SHIFT) | (uint32_t)digits[1]) << PyLong_SHIFT) | (uint32_t)digits[0]))); } } break; case -4: if (8 * sizeof(uint32_t) - 1 > 3 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(uint32_t, long, -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(uint32_t) - 1 > 4 * PyLong_SHIFT) { return (uint32_t) (((uint32_t)-1)*(((((((((uint32_t)digits[3]) << PyLong_SHIFT) | (uint32_t)digits[2]) << PyLong_SHIFT) | (uint32_t)digits[1]) << PyLong_SHIFT) | (uint32_t)digits[0]))); } } break; case 4: if (8 * sizeof(uint32_t) > 3 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(uint32_t, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(uint32_t) - 1 > 4 * PyLong_SHIFT) { return (uint32_t) ((((((((((uint32_t)digits[3]) << PyLong_SHIFT) | (uint32_t)digits[2]) << PyLong_SHIFT) | (uint32_t)digits[1]) << PyLong_SHIFT) | (uint32_t)digits[0]))); } } break; } #endif if (sizeof(uint32_t) <= sizeof(long)) { __PYX_VERIFY_RETURN_INT_EXC(uint32_t, long, PyLong_AsLong(x)) } else if (sizeof(uint32_t) <= sizeof(PY_LONG_LONG)) { __PYX_VERIFY_RETURN_INT_EXC(uint32_t, PY_LONG_LONG, PyLong_AsLongLong(x)) } } { #if CYTHON_COMPILING_IN_PYPY && !defined(_PyLong_AsByteArray) PyErr_SetString(PyExc_RuntimeError, "_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers"); #else uint32_t val; PyObject *v = __Pyx_PyNumber_IntOrLong(x); #if PY_MAJOR_VERSION < 3 if (likely(v) && !PyLong_Check(v)) { PyObject *tmp = v; v = PyNumber_Long(tmp); Py_DECREF(tmp); } #endif if (likely(v)) { int one = 1; int is_little = (int)*(unsigned char *)&one; unsigned char *bytes = (unsigned char *)&val; int ret = _PyLong_AsByteArray((PyLongObject *)v, bytes, sizeof(val), is_little, !is_unsigned); Py_DECREF(v); if (likely(!ret)) return val; } #endif return (uint32_t) -1; } } else { uint32_t val; PyObject *tmp = __Pyx_PyNumber_IntOrLong(x); if (!tmp) return (uint32_t) -1; val = __Pyx_PyInt_As_uint32_t(tmp); Py_DECREF(tmp); return val; } raise_overflow: PyErr_SetString(PyExc_OverflowError, "value too large to convert to uint32_t"); return (uint32_t) -1; raise_neg_overflow: PyErr_SetString(PyExc_OverflowError, "can't convert negative value to uint32_t"); return (uint32_t) -1; } /* CIntFromPy */ static CYTHON_INLINE SDL_bool __Pyx_PyInt_As_SDL_bool(PyObject *x) { const SDL_bool neg_one = (SDL_bool) -1, const_zero = (SDL_bool) 0; const int is_unsigned = neg_one > const_zero; #if PY_MAJOR_VERSION < 3 if (likely(PyInt_Check(x))) { if (sizeof(SDL_bool) < sizeof(long)) { __PYX_VERIFY_RETURN_INT(SDL_bool, long, PyInt_AS_LONG(x)) } else { long val = PyInt_AS_LONG(x); if (is_unsigned && unlikely(val < 0)) { goto raise_neg_overflow; } return (SDL_bool) val; } } else #endif if (likely(PyLong_Check(x))) { if (is_unsigned) { #if CYTHON_USE_PYLONG_INTERNALS const digit* digits = ((PyLongObject*)x)->ob_digit; switch (Py_SIZE(x)) { case 0: return (SDL_bool) 0; case 1: __PYX_VERIFY_RETURN_INT(SDL_bool, digit, digits[0]) case 2: if (8 * sizeof(SDL_bool) > 1 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(SDL_bool, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(SDL_bool) >= 2 * PyLong_SHIFT) { return (SDL_bool) (((((SDL_bool)digits[1]) << PyLong_SHIFT) | (SDL_bool)digits[0])); } } break; case 3: if (8 * sizeof(SDL_bool) > 2 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(SDL_bool, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(SDL_bool) >= 3 * PyLong_SHIFT) { return (SDL_bool) (((((((SDL_bool)digits[2]) << PyLong_SHIFT) | (SDL_bool)digits[1]) << PyLong_SHIFT) | (SDL_bool)digits[0])); } } break; case 4: if (8 * sizeof(SDL_bool) > 3 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(SDL_bool, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(SDL_bool) >= 4 * PyLong_SHIFT) { return (SDL_bool) (((((((((SDL_bool)digits[3]) << PyLong_SHIFT) | (SDL_bool)digits[2]) << PyLong_SHIFT) | (SDL_bool)digits[1]) << PyLong_SHIFT) | (SDL_bool)digits[0])); } } break; } #endif #if CYTHON_COMPILING_IN_CPYTHON if (unlikely(Py_SIZE(x) < 0)) { goto raise_neg_overflow; } #else { int result = PyObject_RichCompareBool(x, Py_False, Py_LT); if (unlikely(result < 0)) return (SDL_bool) -1; if (unlikely(result == 1)) goto raise_neg_overflow; } #endif if (sizeof(SDL_bool) <= sizeof(unsigned long)) { __PYX_VERIFY_RETURN_INT_EXC(SDL_bool, unsigned long, PyLong_AsUnsignedLong(x)) } else if (sizeof(SDL_bool) <= sizeof(unsigned PY_LONG_LONG)) { __PYX_VERIFY_RETURN_INT_EXC(SDL_bool, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x)) } } else { #if CYTHON_USE_PYLONG_INTERNALS const digit* digits = ((PyLongObject*)x)->ob_digit; switch (Py_SIZE(x)) { case 0: return (SDL_bool) 0; case -1: __PYX_VERIFY_RETURN_INT(SDL_bool, sdigit, (sdigit) (-(sdigit)digits[0])) case 1: __PYX_VERIFY_RETURN_INT(SDL_bool, digit, +digits[0]) case -2: if (8 * sizeof(SDL_bool) - 1 > 1 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(SDL_bool, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(SDL_bool) - 1 > 2 * PyLong_SHIFT) { return (SDL_bool) (((SDL_bool)-1)*(((((SDL_bool)digits[1]) << PyLong_SHIFT) | (SDL_bool)digits[0]))); } } break; case 2: if (8 * sizeof(SDL_bool) > 1 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(SDL_bool, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(SDL_bool) - 1 > 2 * PyLong_SHIFT) { return (SDL_bool) ((((((SDL_bool)digits[1]) << PyLong_SHIFT) | (SDL_bool)digits[0]))); } } break; case -3: if (8 * sizeof(SDL_bool) - 1 > 2 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(SDL_bool, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(SDL_bool) - 1 > 3 * PyLong_SHIFT) { return (SDL_bool) (((SDL_bool)-1)*(((((((SDL_bool)digits[2]) << PyLong_SHIFT) | (SDL_bool)digits[1]) << PyLong_SHIFT) | (SDL_bool)digits[0]))); } } break; case 3: if (8 * sizeof(SDL_bool) > 2 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(SDL_bool, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(SDL_bool) - 1 > 3 * PyLong_SHIFT) { return (SDL_bool) ((((((((SDL_bool)digits[2]) << PyLong_SHIFT) | (SDL_bool)digits[1]) << PyLong_SHIFT) | (SDL_bool)digits[0]))); } } break; case -4: if (8 * sizeof(SDL_bool) - 1 > 3 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(SDL_bool, long, -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(SDL_bool) - 1 > 4 * PyLong_SHIFT) { return (SDL_bool) (((SDL_bool)-1)*(((((((((SDL_bool)digits[3]) << PyLong_SHIFT) | (SDL_bool)digits[2]) << PyLong_SHIFT) | (SDL_bool)digits[1]) << PyLong_SHIFT) | (SDL_bool)digits[0]))); } } break; case 4: if (8 * sizeof(SDL_bool) > 3 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(SDL_bool, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(SDL_bool) - 1 > 4 * PyLong_SHIFT) { return (SDL_bool) ((((((((((SDL_bool)digits[3]) << PyLong_SHIFT) | (SDL_bool)digits[2]) << PyLong_SHIFT) | (SDL_bool)digits[1]) << PyLong_SHIFT) | (SDL_bool)digits[0]))); } } break; } #endif if (sizeof(SDL_bool) <= sizeof(long)) { __PYX_VERIFY_RETURN_INT_EXC(SDL_bool, long, PyLong_AsLong(x)) } else if (sizeof(SDL_bool) <= sizeof(PY_LONG_LONG)) { __PYX_VERIFY_RETURN_INT_EXC(SDL_bool, PY_LONG_LONG, PyLong_AsLongLong(x)) } } { #if CYTHON_COMPILING_IN_PYPY && !defined(_PyLong_AsByteArray) PyErr_SetString(PyExc_RuntimeError, "_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers"); #else SDL_bool val; PyObject *v = __Pyx_PyNumber_IntOrLong(x); #if PY_MAJOR_VERSION < 3 if (likely(v) && !PyLong_Check(v)) { PyObject *tmp = v; v = PyNumber_Long(tmp); Py_DECREF(tmp); } #endif if (likely(v)) { int one = 1; int is_little = (int)*(unsigned char *)&one; unsigned char *bytes = (unsigned char *)&val; int ret = _PyLong_AsByteArray((PyLongObject *)v, bytes, sizeof(val), is_little, !is_unsigned); Py_DECREF(v); if (likely(!ret)) return val; } #endif return (SDL_bool) -1; } } else { SDL_bool val; PyObject *tmp = __Pyx_PyNumber_IntOrLong(x); if (!tmp) return (SDL_bool) -1; val = __Pyx_PyInt_As_SDL_bool(tmp); Py_DECREF(tmp); return val; } raise_overflow: PyErr_SetString(PyExc_OverflowError, "value too large to convert to SDL_bool"); return (SDL_bool) -1; raise_neg_overflow: PyErr_SetString(PyExc_OverflowError, "can't convert negative value to SDL_bool"); return (SDL_bool) -1; } /* CIntFromPy */ static CYTHON_INLINE long __Pyx_PyInt_As_long(PyObject *x) { const long neg_one = (long) -1, const_zero = (long) 0; const int is_unsigned = neg_one > const_zero; #if PY_MAJOR_VERSION < 3 if (likely(PyInt_Check(x))) { if (sizeof(long) < sizeof(long)) { __PYX_VERIFY_RETURN_INT(long, long, PyInt_AS_LONG(x)) } else { long val = PyInt_AS_LONG(x); if (is_unsigned && unlikely(val < 0)) { goto raise_neg_overflow; } return (long) val; } } else #endif if (likely(PyLong_Check(x))) { if (is_unsigned) { #if CYTHON_USE_PYLONG_INTERNALS const digit* digits = ((PyLongObject*)x)->ob_digit; switch (Py_SIZE(x)) { case 0: return (long) 0; case 1: __PYX_VERIFY_RETURN_INT(long, digit, digits[0]) case 2: if (8 * sizeof(long) > 1 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(long) >= 2 * PyLong_SHIFT) { return (long) (((((long)digits[1]) << PyLong_SHIFT) | (long)digits[0])); } } break; case 3: if (8 * sizeof(long) > 2 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(long) >= 3 * PyLong_SHIFT) { return (long) (((((((long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0])); } } break; case 4: if (8 * sizeof(long) > 3 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(long) >= 4 * PyLong_SHIFT) { return (long) (((((((((long)digits[3]) << PyLong_SHIFT) | (long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0])); } } break; } #endif #if CYTHON_COMPILING_IN_CPYTHON if (unlikely(Py_SIZE(x) < 0)) { goto raise_neg_overflow; } #else { int result = PyObject_RichCompareBool(x, Py_False, Py_LT); if (unlikely(result < 0)) return (long) -1; if (unlikely(result == 1)) goto raise_neg_overflow; } #endif if (sizeof(long) <= sizeof(unsigned long)) { __PYX_VERIFY_RETURN_INT_EXC(long, unsigned long, PyLong_AsUnsignedLong(x)) } else if (sizeof(long) <= sizeof(unsigned PY_LONG_LONG)) { __PYX_VERIFY_RETURN_INT_EXC(long, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x)) } } else { #if CYTHON_USE_PYLONG_INTERNALS const digit* digits = ((PyLongObject*)x)->ob_digit; switch (Py_SIZE(x)) { case 0: return (long) 0; case -1: __PYX_VERIFY_RETURN_INT(long, sdigit, (sdigit) (-(sdigit)digits[0])) case 1: __PYX_VERIFY_RETURN_INT(long, digit, +digits[0]) case -2: if (8 * sizeof(long) - 1 > 1 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(long, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) { return (long) (((long)-1)*(((((long)digits[1]) << PyLong_SHIFT) | (long)digits[0]))); } } break; case 2: if (8 * sizeof(long) > 1 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) { return (long) ((((((long)digits[1]) << PyLong_SHIFT) | (long)digits[0]))); } } break; case -3: if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(long, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) { return (long) (((long)-1)*(((((((long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0]))); } } break; case 3: if (8 * sizeof(long) > 2 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) { return (long) ((((((((long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0]))); } } break; case -4: if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(long, long, -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(long) - 1 > 4 * PyLong_SHIFT) { return (long) (((long)-1)*(((((((((long)digits[3]) << PyLong_SHIFT) | (long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0]))); } } break; case 4: if (8 * sizeof(long) > 3 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(long) - 1 > 4 * PyLong_SHIFT) { return (long) ((((((((((long)digits[3]) << PyLong_SHIFT) | (long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0]))); } } break; } #endif if (sizeof(long) <= sizeof(long)) { __PYX_VERIFY_RETURN_INT_EXC(long, long, PyLong_AsLong(x)) } else if (sizeof(long) <= sizeof(PY_LONG_LONG)) { __PYX_VERIFY_RETURN_INT_EXC(long, PY_LONG_LONG, PyLong_AsLongLong(x)) } } { #if CYTHON_COMPILING_IN_PYPY && !defined(_PyLong_AsByteArray) PyErr_SetString(PyExc_RuntimeError, "_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers"); #else long val; PyObject *v = __Pyx_PyNumber_IntOrLong(x); #if PY_MAJOR_VERSION < 3 if (likely(v) && !PyLong_Check(v)) { PyObject *tmp = v; v = PyNumber_Long(tmp); Py_DECREF(tmp); } #endif if (likely(v)) { int one = 1; int is_little = (int)*(unsigned char *)&one; unsigned char *bytes = (unsigned char *)&val; int ret = _PyLong_AsByteArray((PyLongObject *)v, bytes, sizeof(val), is_little, !is_unsigned); Py_DECREF(v); if (likely(!ret)) return val; } #endif return (long) -1; } } else { long val; PyObject *tmp = __Pyx_PyNumber_IntOrLong(x); if (!tmp) return (long) -1; val = __Pyx_PyInt_As_long(tmp); Py_DECREF(tmp); return val; } raise_overflow: PyErr_SetString(PyExc_OverflowError, "value too large to convert to long"); return (long) -1; raise_neg_overflow: PyErr_SetString(PyExc_OverflowError, "can't convert negative value to long"); return (long) -1; } /* CIntFromPy */ static CYTHON_INLINE int __Pyx_PyInt_As_int(PyObject *x) { const int neg_one = (int) -1, const_zero = (int) 0; const int is_unsigned = neg_one > const_zero; #if PY_MAJOR_VERSION < 3 if (likely(PyInt_Check(x))) { if (sizeof(int) < sizeof(long)) { __PYX_VERIFY_RETURN_INT(int, long, PyInt_AS_LONG(x)) } else { long val = PyInt_AS_LONG(x); if (is_unsigned && unlikely(val < 0)) { goto raise_neg_overflow; } return (int) val; } } else #endif if (likely(PyLong_Check(x))) { if (is_unsigned) { #if CYTHON_USE_PYLONG_INTERNALS const digit* digits = ((PyLongObject*)x)->ob_digit; switch (Py_SIZE(x)) { case 0: return (int) 0; case 1: __PYX_VERIFY_RETURN_INT(int, digit, digits[0]) case 2: if (8 * sizeof(int) > 1 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(int) >= 2 * PyLong_SHIFT) { return (int) (((((int)digits[1]) << PyLong_SHIFT) | (int)digits[0])); } } break; case 3: if (8 * sizeof(int) > 2 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(int) >= 3 * PyLong_SHIFT) { return (int) (((((((int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0])); } } break; case 4: if (8 * sizeof(int) > 3 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(int) >= 4 * PyLong_SHIFT) { return (int) (((((((((int)digits[3]) << PyLong_SHIFT) | (int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0])); } } break; } #endif #if CYTHON_COMPILING_IN_CPYTHON if (unlikely(Py_SIZE(x) < 0)) { goto raise_neg_overflow; } #else { int result = PyObject_RichCompareBool(x, Py_False, Py_LT); if (unlikely(result < 0)) return (int) -1; if (unlikely(result == 1)) goto raise_neg_overflow; } #endif if (sizeof(int) <= sizeof(unsigned long)) { __PYX_VERIFY_RETURN_INT_EXC(int, unsigned long, PyLong_AsUnsignedLong(x)) } else if (sizeof(int) <= sizeof(unsigned PY_LONG_LONG)) { __PYX_VERIFY_RETURN_INT_EXC(int, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x)) } } else { #if CYTHON_USE_PYLONG_INTERNALS const digit* digits = ((PyLongObject*)x)->ob_digit; switch (Py_SIZE(x)) { case 0: return (int) 0; case -1: __PYX_VERIFY_RETURN_INT(int, sdigit, (sdigit) (-(sdigit)digits[0])) case 1: __PYX_VERIFY_RETURN_INT(int, digit, +digits[0]) case -2: if (8 * sizeof(int) - 1 > 1 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(int, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(int) - 1 > 2 * PyLong_SHIFT) { return (int) (((int)-1)*(((((int)digits[1]) << PyLong_SHIFT) | (int)digits[0]))); } } break; case 2: if (8 * sizeof(int) > 1 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(int) - 1 > 2 * PyLong_SHIFT) { return (int) ((((((int)digits[1]) << PyLong_SHIFT) | (int)digits[0]))); } } break; case -3: if (8 * sizeof(int) - 1 > 2 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(int, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(int) - 1 > 3 * PyLong_SHIFT) { return (int) (((int)-1)*(((((((int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0]))); } } break; case 3: if (8 * sizeof(int) > 2 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(int) - 1 > 3 * PyLong_SHIFT) { return (int) ((((((((int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0]))); } } break; case -4: if (8 * sizeof(int) - 1 > 3 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(int, long, -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(int) - 1 > 4 * PyLong_SHIFT) { return (int) (((int)-1)*(((((((((int)digits[3]) << PyLong_SHIFT) | (int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0]))); } } break; case 4: if (8 * sizeof(int) > 3 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(int) - 1 > 4 * PyLong_SHIFT) { return (int) ((((((((((int)digits[3]) << PyLong_SHIFT) | (int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0]))); } } break; } #endif if (sizeof(int) <= sizeof(long)) { __PYX_VERIFY_RETURN_INT_EXC(int, long, PyLong_AsLong(x)) } else if (sizeof(int) <= sizeof(PY_LONG_LONG)) { __PYX_VERIFY_RETURN_INT_EXC(int, PY_LONG_LONG, PyLong_AsLongLong(x)) } } { #if CYTHON_COMPILING_IN_PYPY && !defined(_PyLong_AsByteArray) PyErr_SetString(PyExc_RuntimeError, "_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers"); #else int val; PyObject *v = __Pyx_PyNumber_IntOrLong(x); #if PY_MAJOR_VERSION < 3 if (likely(v) && !PyLong_Check(v)) { PyObject *tmp = v; v = PyNumber_Long(tmp); Py_DECREF(tmp); } #endif if (likely(v)) { int one = 1; int is_little = (int)*(unsigned char *)&one; unsigned char *bytes = (unsigned char *)&val; int ret = _PyLong_AsByteArray((PyLongObject *)v, bytes, sizeof(val), is_little, !is_unsigned); Py_DECREF(v); if (likely(!ret)) return val; } #endif return (int) -1; } } else { int val; PyObject *tmp = __Pyx_PyNumber_IntOrLong(x); if (!tmp) return (int) -1; val = __Pyx_PyInt_As_int(tmp); Py_DECREF(tmp); return val; } raise_overflow: PyErr_SetString(PyExc_OverflowError, "value too large to convert to int"); return (int) -1; raise_neg_overflow: PyErr_SetString(PyExc_OverflowError, "can't convert negative value to int"); return (int) -1; } /* CheckBinaryVersion */ static int __Pyx_check_binary_version(void) { char ctversion[4], rtversion[4]; PyOS_snprintf(ctversion, 4, "%d.%d", PY_MAJOR_VERSION, PY_MINOR_VERSION); PyOS_snprintf(rtversion, 4, "%s", Py_GetVersion()); if (ctversion[0] != rtversion[0] || ctversion[2] != rtversion[2]) { char message[200]; PyOS_snprintf(message, sizeof(message), "compiletime version %s of module '%.100s' " "does not match runtime version %s", ctversion, __Pyx_MODULE_NAME, rtversion); return PyErr_WarnEx(NULL, message, 1); } return 0; } /* ModuleImport */ #ifndef __PYX_HAVE_RT_ImportModule #define __PYX_HAVE_RT_ImportModule static PyObject *__Pyx_ImportModule(const char *name) { PyObject *py_name = 0; PyObject *py_module = 0; py_name = __Pyx_PyIdentifier_FromString(name); if (!py_name) goto bad; py_module = PyImport_Import(py_name); Py_DECREF(py_name); return py_module; bad: Py_XDECREF(py_name); return 0; } #endif /* TypeImport */ #ifndef __PYX_HAVE_RT_ImportType #define __PYX_HAVE_RT_ImportType static PyTypeObject *__Pyx_ImportType(const char *module_name, const char *class_name, size_t size, int strict) { PyObject *py_module = 0; PyObject *result = 0; PyObject *py_name = 0; char warning[200]; Py_ssize_t basicsize; #ifdef Py_LIMITED_API PyObject *py_basicsize; #endif py_module = __Pyx_ImportModule(module_name); if (!py_module) goto bad; py_name = __Pyx_PyIdentifier_FromString(class_name); if (!py_name) goto bad; result = PyObject_GetAttr(py_module, py_name); Py_DECREF(py_name); py_name = 0; Py_DECREF(py_module); py_module = 0; if (!result) goto bad; if (!PyType_Check(result)) { PyErr_Format(PyExc_TypeError, "%.200s.%.200s is not a type object", module_name, class_name); goto bad; } #ifndef Py_LIMITED_API basicsize = ((PyTypeObject *)result)->tp_basicsize; #else py_basicsize = PyObject_GetAttrString(result, "__basicsize__"); if (!py_basicsize) goto bad; basicsize = PyLong_AsSsize_t(py_basicsize); Py_DECREF(py_basicsize); py_basicsize = 0; if (basicsize == (Py_ssize_t)-1 && PyErr_Occurred()) goto bad; #endif if (!strict && (size_t)basicsize > size) { PyOS_snprintf(warning, sizeof(warning), "%s.%s size changed, may indicate binary incompatibility. Expected %zd, got %zd", module_name, class_name, basicsize, size); if (PyErr_WarnEx(NULL, warning, 0) < 0) goto bad; } else if ((size_t)basicsize != size) { PyErr_Format(PyExc_ValueError, "%.200s.%.200s has the wrong size, try recompiling. Expected %zd, got %zd", module_name, class_name, basicsize, size); goto bad; } return (PyTypeObject *)result; bad: Py_XDECREF(py_module); Py_XDECREF(result); return NULL; } #endif /* VoidPtrImport */ #ifndef __PYX_HAVE_RT_ImportVoidPtr #define __PYX_HAVE_RT_ImportVoidPtr static int __Pyx_ImportVoidPtr(PyObject *module, const char *name, void **p, const char *sig) { PyObject *d = 0; PyObject *cobj = 0; d = PyObject_GetAttrString(module, (char *)"__pyx_capi__"); if (!d) goto bad; cobj = PyDict_GetItemString(d, name); if (!cobj) { PyErr_Format(PyExc_ImportError, "%.200s does not export expected C variable %.200s", PyModule_GetName(module), name); goto bad; } #if PY_VERSION_HEX >= 0x02070000 if (!PyCapsule_IsValid(cobj, sig)) { PyErr_Format(PyExc_TypeError, "C variable %.200s.%.200s has wrong signature (expected %.500s, got %.500s)", PyModule_GetName(module), name, sig, PyCapsule_GetName(cobj)); goto bad; } *p = PyCapsule_GetPointer(cobj, sig); #else {const char *desc, *s1, *s2; desc = (const char *)PyCObject_GetDesc(cobj); if (!desc) goto bad; s1 = desc; s2 = sig; while (*s1 != '\0' && *s1 == *s2) { s1++; s2++; } if (*s1 != *s2) { PyErr_Format(PyExc_TypeError, "C variable %.200s.%.200s has wrong signature (expected %.500s, got %.500s)", PyModule_GetName(module), name, sig, desc); goto bad; } *p = PyCObject_AsVoidPtr(cobj);} #endif if (!(*p)) goto bad; Py_DECREF(d); return 0; bad: Py_XDECREF(d); return -1; } #endif /* InitStrings */ static int __Pyx_InitStrings(__Pyx_StringTabEntry *t) { while (t->p) { #if PY_MAJOR_VERSION < 3 if (t->is_unicode) { *t->p = PyUnicode_DecodeUTF8(t->s, t->n - 1, NULL); } else if (t->intern) { *t->p = PyString_InternFromString(t->s); } else { *t->p = PyString_FromStringAndSize(t->s, t->n - 1); } #else if (t->is_unicode | t->is_str) { if (t->intern) { *t->p = PyUnicode_InternFromString(t->s); } else if (t->encoding) { *t->p = PyUnicode_Decode(t->s, t->n - 1, t->encoding, NULL); } else { *t->p = PyUnicode_FromStringAndSize(t->s, t->n - 1); } } else { *t->p = PyBytes_FromStringAndSize(t->s, t->n - 1); } #endif if (!*t->p) return -1; ++t; } return 0; } static CYTHON_INLINE PyObject* __Pyx_PyUnicode_FromString(const char* c_str) { return __Pyx_PyUnicode_FromStringAndSize(c_str, (Py_ssize_t)strlen(c_str)); } static CYTHON_INLINE char* __Pyx_PyObject_AsString(PyObject* o) { Py_ssize_t ignore; return __Pyx_PyObject_AsStringAndSize(o, &ignore); } static CYTHON_INLINE char* __Pyx_PyObject_AsStringAndSize(PyObject* o, Py_ssize_t *length) { #if CYTHON_COMPILING_IN_CPYTHON && (__PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT) if ( #if PY_MAJOR_VERSION < 3 && __PYX_DEFAULT_STRING_ENCODING_IS_ASCII __Pyx_sys_getdefaultencoding_not_ascii && #endif PyUnicode_Check(o)) { #if PY_VERSION_HEX < 0x03030000 char* defenc_c; PyObject* defenc = _PyUnicode_AsDefaultEncodedString(o, NULL); if (!defenc) return NULL; defenc_c = PyBytes_AS_STRING(defenc); #if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII { char* end = defenc_c + PyBytes_GET_SIZE(defenc); char* c; for (c = defenc_c; c < end; c++) { if ((unsigned char) (*c) >= 128) { PyUnicode_AsASCIIString(o); return NULL; } } } #endif *length = PyBytes_GET_SIZE(defenc); return defenc_c; #else if (__Pyx_PyUnicode_READY(o) == -1) return NULL; #if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII if (PyUnicode_IS_ASCII(o)) { *length = PyUnicode_GET_LENGTH(o); return PyUnicode_AsUTF8(o); } else { PyUnicode_AsASCIIString(o); return NULL; } #else return PyUnicode_AsUTF8AndSize(o, length); #endif #endif } else #endif #if (!CYTHON_COMPILING_IN_PYPY) || (defined(PyByteArray_AS_STRING) && defined(PyByteArray_GET_SIZE)) if (PyByteArray_Check(o)) { *length = PyByteArray_GET_SIZE(o); return PyByteArray_AS_STRING(o); } else #endif { char* result; int r = PyBytes_AsStringAndSize(o, &result, length); if (unlikely(r < 0)) { return NULL; } else { return result; } } } static CYTHON_INLINE int __Pyx_PyObject_IsTrue(PyObject* x) { int is_true = x == Py_True; if (is_true | (x == Py_False) | (x == Py_None)) return is_true; else return PyObject_IsTrue(x); } static CYTHON_INLINE PyObject* __Pyx_PyNumber_IntOrLong(PyObject* x) { PyNumberMethods *m; const char *name = NULL; PyObject *res = NULL; #if PY_MAJOR_VERSION < 3 if (PyInt_Check(x) || PyLong_Check(x)) #else if (PyLong_Check(x)) #endif return __Pyx_NewRef(x); m = Py_TYPE(x)->tp_as_number; #if PY_MAJOR_VERSION < 3 if (m && m->nb_int) { name = "int"; res = PyNumber_Int(x); } else if (m && m->nb_long) { name = "long"; res = PyNumber_Long(x); } #else if (m && m->nb_int) { name = "int"; res = PyNumber_Long(x); } #endif if (res) { #if PY_MAJOR_VERSION < 3 if (!PyInt_Check(res) && !PyLong_Check(res)) { #else if (!PyLong_Check(res)) { #endif PyErr_Format(PyExc_TypeError, "__%.4s__ returned non-%.4s (type %.200s)", name, name, Py_TYPE(res)->tp_name); Py_DECREF(res); return NULL; } } else if (!PyErr_Occurred()) { PyErr_SetString(PyExc_TypeError, "an integer is required"); } return res; } static CYTHON_INLINE Py_ssize_t __Pyx_PyIndex_AsSsize_t(PyObject* b) { Py_ssize_t ival; PyObject *x; #if PY_MAJOR_VERSION < 3 if (likely(PyInt_CheckExact(b))) { if (sizeof(Py_ssize_t) >= sizeof(long)) return PyInt_AS_LONG(b); else return PyInt_AsSsize_t(x); } #endif if (likely(PyLong_CheckExact(b))) { #if CYTHON_USE_PYLONG_INTERNALS const digit* digits = ((PyLongObject*)b)->ob_digit; const Py_ssize_t size = Py_SIZE(b); if (likely(__Pyx_sst_abs(size) <= 1)) { ival = likely(size) ? digits[0] : 0; if (size == -1) ival = -ival; return ival; } else { switch (size) { case 2: if (8 * sizeof(Py_ssize_t) > 2 * PyLong_SHIFT) { return (Py_ssize_t) (((((size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])); } break; case -2: if (8 * sizeof(Py_ssize_t) > 2 * PyLong_SHIFT) { return -(Py_ssize_t) (((((size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])); } break; case 3: if (8 * sizeof(Py_ssize_t) > 3 * PyLong_SHIFT) { return (Py_ssize_t) (((((((size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])); } break; case -3: if (8 * sizeof(Py_ssize_t) > 3 * PyLong_SHIFT) { return -(Py_ssize_t) (((((((size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])); } break; case 4: if (8 * sizeof(Py_ssize_t) > 4 * PyLong_SHIFT) { return (Py_ssize_t) (((((((((size_t)digits[3]) << PyLong_SHIFT) | (size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])); } break; case -4: if (8 * sizeof(Py_ssize_t) > 4 * PyLong_SHIFT) { return -(Py_ssize_t) (((((((((size_t)digits[3]) << PyLong_SHIFT) | (size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])); } break; } } #endif return PyLong_AsSsize_t(b); } x = PyNumber_Index(b); if (!x) return -1; ival = PyInt_AsSsize_t(x); Py_DECREF(x); return ival; } static CYTHON_INLINE PyObject * __Pyx_PyInt_FromSize_t(size_t ival) { return PyInt_FromSize_t(ival); } #endif /* Py_PYTHON_H */ pygame_sdl2-2.1.0-for-renpy-6.99.14.1/gen3/pygame_sdl2.mixer.c0000664000175000017500000145140713034353115022611 0ustar tomtom00000000000000/* Generated by Cython 0.23.5 */ #define PY_SSIZE_T_CLEAN #include "Python.h" #ifndef Py_PYTHON_H #error Python headers needed to compile C extensions, please install development version of Python. #elif PY_VERSION_HEX < 0x02060000 || (0x03000000 <= PY_VERSION_HEX && PY_VERSION_HEX < 0x03020000) #error Cython requires Python 2.6+ or Python 3.2+. #else #define CYTHON_ABI "0_23_5" #include #ifndef offsetof #define offsetof(type, member) ( (size_t) & ((type*)0) -> member ) #endif #if !defined(WIN32) && !defined(MS_WINDOWS) #ifndef __stdcall #define __stdcall #endif #ifndef __cdecl #define __cdecl #endif #ifndef __fastcall #define __fastcall #endif #endif #ifndef DL_IMPORT #define DL_IMPORT(t) t #endif #ifndef DL_EXPORT #define DL_EXPORT(t) t #endif #ifndef PY_LONG_LONG #define PY_LONG_LONG LONG_LONG #endif #ifndef Py_HUGE_VAL #define Py_HUGE_VAL HUGE_VAL #endif #ifdef PYPY_VERSION #define CYTHON_COMPILING_IN_PYPY 1 #define CYTHON_COMPILING_IN_CPYTHON 0 #else #define CYTHON_COMPILING_IN_PYPY 0 #define CYTHON_COMPILING_IN_CPYTHON 1 #endif #if !defined(CYTHON_USE_PYLONG_INTERNALS) && CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x02070000 #define CYTHON_USE_PYLONG_INTERNALS 1 #endif #if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX < 0x02070600 && !defined(Py_OptimizeFlag) #define Py_OptimizeFlag 0 #endif #define __PYX_BUILD_PY_SSIZE_T "n" #define CYTHON_FORMAT_SSIZE_T "z" #if PY_MAJOR_VERSION < 3 #define __Pyx_BUILTIN_MODULE_NAME "__builtin__" #define __Pyx_PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)\ PyCode_New(a+k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos) #define __Pyx_DefaultClassType PyClass_Type #else #define __Pyx_BUILTIN_MODULE_NAME "builtins" #define __Pyx_PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)\ PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos) #define __Pyx_DefaultClassType PyType_Type #endif #ifndef Py_TPFLAGS_CHECKTYPES #define Py_TPFLAGS_CHECKTYPES 0 #endif #ifndef Py_TPFLAGS_HAVE_INDEX #define Py_TPFLAGS_HAVE_INDEX 0 #endif #ifndef Py_TPFLAGS_HAVE_NEWBUFFER #define Py_TPFLAGS_HAVE_NEWBUFFER 0 #endif #ifndef Py_TPFLAGS_HAVE_FINALIZE #define Py_TPFLAGS_HAVE_FINALIZE 0 #endif #if PY_VERSION_HEX > 0x03030000 && defined(PyUnicode_KIND) #define CYTHON_PEP393_ENABLED 1 #define __Pyx_PyUnicode_READY(op) (likely(PyUnicode_IS_READY(op)) ?\ 0 : _PyUnicode_Ready((PyObject *)(op))) #define __Pyx_PyUnicode_GET_LENGTH(u) PyUnicode_GET_LENGTH(u) #define __Pyx_PyUnicode_READ_CHAR(u, i) PyUnicode_READ_CHAR(u, i) #define __Pyx_PyUnicode_KIND(u) PyUnicode_KIND(u) #define __Pyx_PyUnicode_DATA(u) PyUnicode_DATA(u) #define __Pyx_PyUnicode_READ(k, d, i) PyUnicode_READ(k, d, i) #else #define CYTHON_PEP393_ENABLED 0 #define __Pyx_PyUnicode_READY(op) (0) #define __Pyx_PyUnicode_GET_LENGTH(u) PyUnicode_GET_SIZE(u) #define __Pyx_PyUnicode_READ_CHAR(u, i) ((Py_UCS4)(PyUnicode_AS_UNICODE(u)[i])) #define __Pyx_PyUnicode_KIND(u) (sizeof(Py_UNICODE)) #define __Pyx_PyUnicode_DATA(u) ((void*)PyUnicode_AS_UNICODE(u)) #define __Pyx_PyUnicode_READ(k, d, i) ((void)(k), (Py_UCS4)(((Py_UNICODE*)d)[i])) #endif #if CYTHON_COMPILING_IN_PYPY #define __Pyx_PyUnicode_Concat(a, b) PyNumber_Add(a, b) #define __Pyx_PyUnicode_ConcatSafe(a, b) PyNumber_Add(a, b) #else #define __Pyx_PyUnicode_Concat(a, b) PyUnicode_Concat(a, b) #define __Pyx_PyUnicode_ConcatSafe(a, b) ((unlikely((a) == Py_None) || unlikely((b) == Py_None)) ?\ PyNumber_Add(a, b) : __Pyx_PyUnicode_Concat(a, b)) #endif #if CYTHON_COMPILING_IN_PYPY && !defined(PyUnicode_Contains) #define PyUnicode_Contains(u, s) PySequence_Contains(u, s) #endif #define __Pyx_PyString_FormatSafe(a, b) ((unlikely((a) == Py_None)) ? PyNumber_Remainder(a, b) : __Pyx_PyString_Format(a, b)) #define __Pyx_PyUnicode_FormatSafe(a, b) ((unlikely((a) == Py_None)) ? PyNumber_Remainder(a, b) : PyUnicode_Format(a, b)) #if PY_MAJOR_VERSION >= 3 #define __Pyx_PyString_Format(a, b) PyUnicode_Format(a, b) #else #define __Pyx_PyString_Format(a, b) PyString_Format(a, b) #endif #if PY_MAJOR_VERSION >= 3 #define PyBaseString_Type PyUnicode_Type #define PyStringObject PyUnicodeObject #define PyString_Type PyUnicode_Type #define PyString_Check PyUnicode_Check #define PyString_CheckExact PyUnicode_CheckExact #endif #if PY_MAJOR_VERSION >= 3 #define __Pyx_PyBaseString_Check(obj) PyUnicode_Check(obj) #define __Pyx_PyBaseString_CheckExact(obj) PyUnicode_CheckExact(obj) #else #define __Pyx_PyBaseString_Check(obj) (PyString_Check(obj) || PyUnicode_Check(obj)) #define __Pyx_PyBaseString_CheckExact(obj) (PyString_CheckExact(obj) || PyUnicode_CheckExact(obj)) #endif #ifndef PySet_CheckExact #define PySet_CheckExact(obj) (Py_TYPE(obj) == &PySet_Type) #endif #define __Pyx_TypeCheck(obj, type) PyObject_TypeCheck(obj, (PyTypeObject *)type) #if PY_MAJOR_VERSION >= 3 #define PyIntObject PyLongObject #define PyInt_Type PyLong_Type #define PyInt_Check(op) PyLong_Check(op) #define PyInt_CheckExact(op) PyLong_CheckExact(op) #define PyInt_FromString PyLong_FromString #define PyInt_FromUnicode PyLong_FromUnicode #define PyInt_FromLong PyLong_FromLong #define PyInt_FromSize_t PyLong_FromSize_t #define PyInt_FromSsize_t PyLong_FromSsize_t #define PyInt_AsLong PyLong_AsLong #define PyInt_AS_LONG PyLong_AS_LONG #define PyInt_AsSsize_t PyLong_AsSsize_t #define PyInt_AsUnsignedLongMask PyLong_AsUnsignedLongMask #define PyInt_AsUnsignedLongLongMask PyLong_AsUnsignedLongLongMask #define PyNumber_Int PyNumber_Long #endif #if PY_MAJOR_VERSION >= 3 #define PyBoolObject PyLongObject #endif #if PY_MAJOR_VERSION >= 3 && CYTHON_COMPILING_IN_PYPY #ifndef PyUnicode_InternFromString #define PyUnicode_InternFromString(s) PyUnicode_FromString(s) #endif #endif #if PY_VERSION_HEX < 0x030200A4 typedef long Py_hash_t; #define __Pyx_PyInt_FromHash_t PyInt_FromLong #define __Pyx_PyInt_AsHash_t PyInt_AsLong #else #define __Pyx_PyInt_FromHash_t PyInt_FromSsize_t #define __Pyx_PyInt_AsHash_t PyInt_AsSsize_t #endif #if PY_MAJOR_VERSION >= 3 #define __Pyx_PyMethod_New(func, self, klass) ((self) ? PyMethod_New(func, self) : PyInstanceMethod_New(func)) #else #define __Pyx_PyMethod_New(func, self, klass) PyMethod_New(func, self, klass) #endif #if PY_VERSION_HEX >= 0x030500B1 #define __Pyx_PyAsyncMethodsStruct PyAsyncMethods #define __Pyx_PyType_AsAsync(obj) (Py_TYPE(obj)->tp_as_async) #elif CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3 typedef struct { unaryfunc am_await; unaryfunc am_aiter; unaryfunc am_anext; } __Pyx_PyAsyncMethodsStruct; #define __Pyx_PyType_AsAsync(obj) ((__Pyx_PyAsyncMethodsStruct*) (Py_TYPE(obj)->tp_reserved)) #else #define __Pyx_PyType_AsAsync(obj) NULL #endif #ifndef CYTHON_RESTRICT #if defined(__GNUC__) #define CYTHON_RESTRICT __restrict__ #elif defined(_MSC_VER) && _MSC_VER >= 1400 #define CYTHON_RESTRICT __restrict #elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L #define CYTHON_RESTRICT restrict #else #define CYTHON_RESTRICT #endif #endif #define __Pyx_void_to_None(void_result) ((void)(void_result), Py_INCREF(Py_None), Py_None) #ifndef CYTHON_INLINE #if defined(__GNUC__) #define CYTHON_INLINE __inline__ #elif defined(_MSC_VER) #define CYTHON_INLINE __inline #elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L #define CYTHON_INLINE inline #else #define CYTHON_INLINE #endif #endif #if defined(WIN32) || defined(MS_WINDOWS) #define _USE_MATH_DEFINES #endif #include #ifdef NAN #define __PYX_NAN() ((float) NAN) #else static CYTHON_INLINE float __PYX_NAN() { float value; memset(&value, 0xFF, sizeof(value)); return value; } #endif #if PY_MAJOR_VERSION >= 3 #define __Pyx_PyNumber_Divide(x,y) PyNumber_TrueDivide(x,y) #define __Pyx_PyNumber_InPlaceDivide(x,y) PyNumber_InPlaceTrueDivide(x,y) #else #define __Pyx_PyNumber_Divide(x,y) PyNumber_TrueDivide(x,y) #define __Pyx_PyNumber_InPlaceDivide(x,y) PyNumber_InPlaceTrueDivide(x,y) #endif #ifndef __PYX_EXTERN_C #ifdef __cplusplus #define __PYX_EXTERN_C extern "C" #else #define __PYX_EXTERN_C extern #endif #endif #define __PYX_HAVE__pygame_sdl2__mixer #define __PYX_HAVE_API__pygame_sdl2__mixer #include "stdint.h" #include "string.h" #include "stdio.h" #include "stddef.h" #include "SDL.h" #include "SDL_mixer.h" #ifdef _OPENMP #include #endif /* _OPENMP */ #ifdef PYREX_WITHOUT_ASSERTIONS #define CYTHON_WITHOUT_ASSERTIONS #endif #ifndef CYTHON_UNUSED # if defined(__GNUC__) # if !(defined(__cplusplus)) || (__GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 4)) # define CYTHON_UNUSED __attribute__ ((__unused__)) # else # define CYTHON_UNUSED # endif # elif defined(__ICC) || (defined(__INTEL_COMPILER) && !defined(_MSC_VER)) # define CYTHON_UNUSED __attribute__ ((__unused__)) # else # define CYTHON_UNUSED # endif #endif #ifndef CYTHON_NCP_UNUSED # if CYTHON_COMPILING_IN_CPYTHON # define CYTHON_NCP_UNUSED # else # define CYTHON_NCP_UNUSED CYTHON_UNUSED # endif #endif typedef struct {PyObject **p; char *s; const Py_ssize_t n; const char* encoding; const char is_unicode; const char is_str; const char intern; } __Pyx_StringTabEntry; #define __PYX_DEFAULT_STRING_ENCODING_IS_ASCII 0 #define __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT 0 #define __PYX_DEFAULT_STRING_ENCODING "" #define __Pyx_PyObject_FromString __Pyx_PyBytes_FromString #define __Pyx_PyObject_FromStringAndSize __Pyx_PyBytes_FromStringAndSize #define __Pyx_uchar_cast(c) ((unsigned char)c) #define __Pyx_long_cast(x) ((long)x) #define __Pyx_fits_Py_ssize_t(v, type, is_signed) (\ (sizeof(type) < sizeof(Py_ssize_t)) ||\ (sizeof(type) > sizeof(Py_ssize_t) &&\ likely(v < (type)PY_SSIZE_T_MAX ||\ v == (type)PY_SSIZE_T_MAX) &&\ (!is_signed || likely(v > (type)PY_SSIZE_T_MIN ||\ v == (type)PY_SSIZE_T_MIN))) ||\ (sizeof(type) == sizeof(Py_ssize_t) &&\ (is_signed || likely(v < (type)PY_SSIZE_T_MAX ||\ v == (type)PY_SSIZE_T_MAX))) ) #if defined (__cplusplus) && __cplusplus >= 201103L #include #define __Pyx_sst_abs(value) std::abs(value) #elif SIZEOF_INT >= SIZEOF_SIZE_T #define __Pyx_sst_abs(value) abs(value) #elif SIZEOF_LONG >= SIZEOF_SIZE_T #define __Pyx_sst_abs(value) labs(value) #elif defined (_MSC_VER) && defined (_M_X64) #define __Pyx_sst_abs(value) _abs64(value) #elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L #define __Pyx_sst_abs(value) llabs(value) #elif defined (__GNUC__) #define __Pyx_sst_abs(value) __builtin_llabs(value) #else #define __Pyx_sst_abs(value) ((value<0) ? -value : value) #endif static CYTHON_INLINE char* __Pyx_PyObject_AsString(PyObject*); static CYTHON_INLINE char* __Pyx_PyObject_AsStringAndSize(PyObject*, Py_ssize_t* length); #define __Pyx_PyByteArray_FromString(s) PyByteArray_FromStringAndSize((const char*)s, strlen((const char*)s)) #define __Pyx_PyByteArray_FromStringAndSize(s, l) PyByteArray_FromStringAndSize((const char*)s, l) #define __Pyx_PyBytes_FromString PyBytes_FromString #define __Pyx_PyBytes_FromStringAndSize PyBytes_FromStringAndSize static CYTHON_INLINE PyObject* __Pyx_PyUnicode_FromString(const char*); #if PY_MAJOR_VERSION < 3 #define __Pyx_PyStr_FromString __Pyx_PyBytes_FromString #define __Pyx_PyStr_FromStringAndSize __Pyx_PyBytes_FromStringAndSize #else #define __Pyx_PyStr_FromString __Pyx_PyUnicode_FromString #define __Pyx_PyStr_FromStringAndSize __Pyx_PyUnicode_FromStringAndSize #endif #define __Pyx_PyObject_AsSString(s) ((signed char*) __Pyx_PyObject_AsString(s)) #define __Pyx_PyObject_AsUString(s) ((unsigned char*) __Pyx_PyObject_AsString(s)) #define __Pyx_PyObject_FromCString(s) __Pyx_PyObject_FromString((const char*)s) #define __Pyx_PyBytes_FromCString(s) __Pyx_PyBytes_FromString((const char*)s) #define __Pyx_PyByteArray_FromCString(s) __Pyx_PyByteArray_FromString((const char*)s) #define __Pyx_PyStr_FromCString(s) __Pyx_PyStr_FromString((const char*)s) #define __Pyx_PyUnicode_FromCString(s) __Pyx_PyUnicode_FromString((const char*)s) #if PY_MAJOR_VERSION < 3 static CYTHON_INLINE size_t __Pyx_Py_UNICODE_strlen(const Py_UNICODE *u) { const Py_UNICODE *u_end = u; while (*u_end++) ; return (size_t)(u_end - u - 1); } #else #define __Pyx_Py_UNICODE_strlen Py_UNICODE_strlen #endif #define __Pyx_PyUnicode_FromUnicode(u) PyUnicode_FromUnicode(u, __Pyx_Py_UNICODE_strlen(u)) #define __Pyx_PyUnicode_FromUnicodeAndLength PyUnicode_FromUnicode #define __Pyx_PyUnicode_AsUnicode PyUnicode_AsUnicode #define __Pyx_NewRef(obj) (Py_INCREF(obj), obj) #define __Pyx_Owned_Py_None(b) __Pyx_NewRef(Py_None) #define __Pyx_PyBool_FromLong(b) ((b) ? __Pyx_NewRef(Py_True) : __Pyx_NewRef(Py_False)) static CYTHON_INLINE int __Pyx_PyObject_IsTrue(PyObject*); static CYTHON_INLINE PyObject* __Pyx_PyNumber_Int(PyObject* x); static CYTHON_INLINE Py_ssize_t __Pyx_PyIndex_AsSsize_t(PyObject*); static CYTHON_INLINE PyObject * __Pyx_PyInt_FromSize_t(size_t); #if CYTHON_COMPILING_IN_CPYTHON #define __pyx_PyFloat_AsDouble(x) (PyFloat_CheckExact(x) ? PyFloat_AS_DOUBLE(x) : PyFloat_AsDouble(x)) #else #define __pyx_PyFloat_AsDouble(x) PyFloat_AsDouble(x) #endif #define __pyx_PyFloat_AsFloat(x) ((float) __pyx_PyFloat_AsDouble(x)) #if PY_MAJOR_VERSION < 3 && __PYX_DEFAULT_STRING_ENCODING_IS_ASCII static int __Pyx_sys_getdefaultencoding_not_ascii; static int __Pyx_init_sys_getdefaultencoding_params(void) { PyObject* sys; PyObject* default_encoding = NULL; PyObject* ascii_chars_u = NULL; PyObject* ascii_chars_b = NULL; const char* default_encoding_c; sys = PyImport_ImportModule("sys"); if (!sys) goto bad; default_encoding = PyObject_CallMethod(sys, (char*) "getdefaultencoding", NULL); Py_DECREF(sys); if (!default_encoding) goto bad; default_encoding_c = PyBytes_AsString(default_encoding); if (!default_encoding_c) goto bad; if (strcmp(default_encoding_c, "ascii") == 0) { __Pyx_sys_getdefaultencoding_not_ascii = 0; } else { char ascii_chars[128]; int c; for (c = 0; c < 128; c++) { ascii_chars[c] = c; } __Pyx_sys_getdefaultencoding_not_ascii = 1; ascii_chars_u = PyUnicode_DecodeASCII(ascii_chars, 128, NULL); if (!ascii_chars_u) goto bad; ascii_chars_b = PyUnicode_AsEncodedString(ascii_chars_u, default_encoding_c, NULL); if (!ascii_chars_b || !PyBytes_Check(ascii_chars_b) || memcmp(ascii_chars, PyBytes_AS_STRING(ascii_chars_b), 128) != 0) { PyErr_Format( PyExc_ValueError, "This module compiled with c_string_encoding=ascii, but default encoding '%.200s' is not a superset of ascii.", default_encoding_c); goto bad; } Py_DECREF(ascii_chars_u); Py_DECREF(ascii_chars_b); } Py_DECREF(default_encoding); return 0; bad: Py_XDECREF(default_encoding); Py_XDECREF(ascii_chars_u); Py_XDECREF(ascii_chars_b); return -1; } #endif #if __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT && PY_MAJOR_VERSION >= 3 #define __Pyx_PyUnicode_FromStringAndSize(c_str, size) PyUnicode_DecodeUTF8(c_str, size, NULL) #else #define __Pyx_PyUnicode_FromStringAndSize(c_str, size) PyUnicode_Decode(c_str, size, __PYX_DEFAULT_STRING_ENCODING, NULL) #if __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT static char* __PYX_DEFAULT_STRING_ENCODING; static int __Pyx_init_sys_getdefaultencoding_params(void) { PyObject* sys; PyObject* default_encoding = NULL; char* default_encoding_c; sys = PyImport_ImportModule("sys"); if (!sys) goto bad; default_encoding = PyObject_CallMethod(sys, (char*) (const char*) "getdefaultencoding", NULL); Py_DECREF(sys); if (!default_encoding) goto bad; default_encoding_c = PyBytes_AsString(default_encoding); if (!default_encoding_c) goto bad; __PYX_DEFAULT_STRING_ENCODING = (char*) malloc(strlen(default_encoding_c)); if (!__PYX_DEFAULT_STRING_ENCODING) goto bad; strcpy(__PYX_DEFAULT_STRING_ENCODING, default_encoding_c); Py_DECREF(default_encoding); return 0; bad: Py_XDECREF(default_encoding); return -1; } #endif #endif /* Test for GCC > 2.95 */ #if defined(__GNUC__) && (__GNUC__ > 2 || (__GNUC__ == 2 && (__GNUC_MINOR__ > 95))) #define likely(x) __builtin_expect(!!(x), 1) #define unlikely(x) __builtin_expect(!!(x), 0) #else /* !__GNUC__ or GCC < 2.95 */ #define likely(x) (x) #define unlikely(x) (x) #endif /* __GNUC__ */ static PyObject *__pyx_m; static PyObject *__pyx_d; static PyObject *__pyx_b; static PyObject *__pyx_empty_tuple; static PyObject *__pyx_empty_bytes; static int __pyx_lineno; static int __pyx_clineno = 0; static const char * __pyx_cfilenm= __FILE__; static const char *__pyx_filename; static const char *__pyx_f[] = { "src/pygame_sdl2/mixer.pyx", }; /*--- Type declarations ---*/ struct __pyx_obj_11pygame_sdl2_5mixer_Sound; struct __pyx_obj_11pygame_sdl2_5mixer_Channel; struct __pyx_opt_args_11pygame_sdl2_8rwobject_to_rwops; /* "pygame_sdl2/rwobject.pxd":21 * from sdl2 cimport SDL_RWops * * cdef SDL_RWops *to_rwops(filelike, mode=*) except NULL # <<<<<<<<<<<<<< * */ struct __pyx_opt_args_11pygame_sdl2_8rwobject_to_rwops { int __pyx_n; PyObject *mode; }; /* "pygame_sdl2/mixer.pyx":161 * * * cdef class Sound: # <<<<<<<<<<<<<< * cdef Mix_Chunk *chunk * */ struct __pyx_obj_11pygame_sdl2_5mixer_Sound { PyObject_HEAD Mix_Chunk *chunk; }; /* "pygame_sdl2/mixer.pyx":249 * * * cdef class Channel(object): # <<<<<<<<<<<<<< * cdef int cid * */ struct __pyx_obj_11pygame_sdl2_5mixer_Channel { PyObject_HEAD int cid; }; /* --- Runtime support code (head) --- */ #ifndef CYTHON_REFNANNY #define CYTHON_REFNANNY 0 #endif #if CYTHON_REFNANNY typedef struct { void (*INCREF)(void*, PyObject*, int); void (*DECREF)(void*, PyObject*, int); void (*GOTREF)(void*, PyObject*, int); void (*GIVEREF)(void*, PyObject*, int); void* (*SetupContext)(const char*, int, const char*); void (*FinishContext)(void**); } __Pyx_RefNannyAPIStruct; static __Pyx_RefNannyAPIStruct *__Pyx_RefNanny = NULL; static __Pyx_RefNannyAPIStruct *__Pyx_RefNannyImportAPI(const char *modname); #define __Pyx_RefNannyDeclarations void *__pyx_refnanny = NULL; #ifdef WITH_THREAD #define __Pyx_RefNannySetupContext(name, acquire_gil)\ if (acquire_gil) {\ PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure();\ __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), __LINE__, __FILE__);\ PyGILState_Release(__pyx_gilstate_save);\ } else {\ __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), __LINE__, __FILE__);\ } #else #define __Pyx_RefNannySetupContext(name, acquire_gil)\ __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), __LINE__, __FILE__) #endif #define __Pyx_RefNannyFinishContext()\ __Pyx_RefNanny->FinishContext(&__pyx_refnanny) #define __Pyx_INCREF(r) __Pyx_RefNanny->INCREF(__pyx_refnanny, (PyObject *)(r), __LINE__) #define __Pyx_DECREF(r) __Pyx_RefNanny->DECREF(__pyx_refnanny, (PyObject *)(r), __LINE__) #define __Pyx_GOTREF(r) __Pyx_RefNanny->GOTREF(__pyx_refnanny, (PyObject *)(r), __LINE__) #define __Pyx_GIVEREF(r) __Pyx_RefNanny->GIVEREF(__pyx_refnanny, (PyObject *)(r), __LINE__) #define __Pyx_XINCREF(r) do { if((r) != NULL) {__Pyx_INCREF(r); }} while(0) #define __Pyx_XDECREF(r) do { if((r) != NULL) {__Pyx_DECREF(r); }} while(0) #define __Pyx_XGOTREF(r) do { if((r) != NULL) {__Pyx_GOTREF(r); }} while(0) #define __Pyx_XGIVEREF(r) do { if((r) != NULL) {__Pyx_GIVEREF(r);}} while(0) #else #define __Pyx_RefNannyDeclarations #define __Pyx_RefNannySetupContext(name, acquire_gil) #define __Pyx_RefNannyFinishContext() #define __Pyx_INCREF(r) Py_INCREF(r) #define __Pyx_DECREF(r) Py_DECREF(r) #define __Pyx_GOTREF(r) #define __Pyx_GIVEREF(r) #define __Pyx_XINCREF(r) Py_XINCREF(r) #define __Pyx_XDECREF(r) Py_XDECREF(r) #define __Pyx_XGOTREF(r) #define __Pyx_XGIVEREF(r) #endif #define __Pyx_XDECREF_SET(r, v) do {\ PyObject *tmp = (PyObject *) r;\ r = v; __Pyx_XDECREF(tmp);\ } while (0) #define __Pyx_DECREF_SET(r, v) do {\ PyObject *tmp = (PyObject *) r;\ r = v; __Pyx_DECREF(tmp);\ } while (0) #define __Pyx_CLEAR(r) do { PyObject* tmp = ((PyObject*)(r)); r = NULL; __Pyx_DECREF(tmp);} while(0) #define __Pyx_XCLEAR(r) do { if((r) != NULL) {PyObject* tmp = ((PyObject*)(r)); r = NULL; __Pyx_DECREF(tmp);}} while(0) #if CYTHON_COMPILING_IN_CPYTHON static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStr(PyObject* obj, PyObject* attr_name) { PyTypeObject* tp = Py_TYPE(obj); if (likely(tp->tp_getattro)) return tp->tp_getattro(obj, attr_name); #if PY_MAJOR_VERSION < 3 if (likely(tp->tp_getattr)) return tp->tp_getattr(obj, PyString_AS_STRING(attr_name)); #endif return PyObject_GetAttr(obj, attr_name); } #else #define __Pyx_PyObject_GetAttrStr(o,n) PyObject_GetAttr(o,n) #endif static PyObject *__Pyx_GetBuiltinName(PyObject *name); static CYTHON_INLINE PyObject *__Pyx_GetModuleGlobalName(PyObject *name); #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x02070000 static CYTHON_INLINE PyObject* __Pyx_PyObject_LookupSpecial(PyObject* obj, PyObject* attr_name) { PyObject *res; PyTypeObject *tp = Py_TYPE(obj); #if PY_MAJOR_VERSION < 3 if (unlikely(PyInstance_Check(obj))) return __Pyx_PyObject_GetAttrStr(obj, attr_name); #endif res = _PyType_Lookup(tp, attr_name); if (likely(res)) { descrgetfunc f = Py_TYPE(res)->tp_descr_get; if (!f) { Py_INCREF(res); } else { res = f(res, obj, (PyObject *)tp); } } else { PyErr_SetObject(PyExc_AttributeError, attr_name); } return res; } #else #define __Pyx_PyObject_LookupSpecial(o,n) __Pyx_PyObject_GetAttrStr(o,n) #endif #if CYTHON_COMPILING_IN_CPYTHON static CYTHON_INLINE PyObject* __Pyx_PyObject_Call(PyObject *func, PyObject *arg, PyObject *kw); #else #define __Pyx_PyObject_Call(func, arg, kw) PyObject_Call(func, arg, kw) #endif #if CYTHON_COMPILING_IN_CPYTHON static CYTHON_INLINE PyObject* __Pyx_PyObject_CallMethO(PyObject *func, PyObject *arg); #endif static CYTHON_INLINE PyObject* __Pyx_PyObject_CallOneArg(PyObject *func, PyObject *arg); #if CYTHON_COMPILING_IN_CPYTHON static CYTHON_INLINE PyObject* __Pyx_PyObject_CallNoArg(PyObject *func); #else #define __Pyx_PyObject_CallNoArg(func) __Pyx_PyObject_Call(func, __pyx_empty_tuple, NULL) #endif #if PY_MAJOR_VERSION >= 3 && !CYTHON_COMPILING_IN_PYPY static PyObject *__Pyx_PyDict_GetItem(PyObject *d, PyObject* key) { PyObject *value; value = PyDict_GetItemWithError(d, key); if (unlikely(!value)) { if (!PyErr_Occurred()) { PyObject* args = PyTuple_Pack(1, key); if (likely(args)) PyErr_SetObject(PyExc_KeyError, args); Py_XDECREF(args); } return NULL; } Py_INCREF(value); return value; } #else #define __Pyx_PyDict_GetItem(d, key) PyObject_GetItem(d, key) #endif static CYTHON_INLINE int __Pyx_TypeTest(PyObject *obj, PyTypeObject *type); static CYTHON_INLINE void __Pyx_ExceptionSave(PyObject **type, PyObject **value, PyObject **tb); static void __Pyx_ExceptionReset(PyObject *type, PyObject *value, PyObject *tb); static int __Pyx_GetException(PyObject **type, PyObject **value, PyObject **tb); static CYTHON_INLINE void __Pyx_ErrRestore(PyObject *type, PyObject *value, PyObject *tb); static CYTHON_INLINE void __Pyx_ErrFetch(PyObject **type, PyObject **value, PyObject **tb); static CYTHON_INLINE void __Pyx_RaiseUnboundLocalError(const char *varname); #ifndef __PYX_FORCE_INIT_THREADS #define __PYX_FORCE_INIT_THREADS 0 #endif static PyObject* __Pyx_PyDict_GetItemDefault(PyObject* d, PyObject* key, PyObject* default_value); static void __Pyx_WriteUnraisable(const char *name, int clineno, int lineno, const char *filename, int full_traceback, int nogil); static void __Pyx_RaiseDoubleKeywordsError(const char* func_name, PyObject* kw_name); static int __Pyx_ParseOptionalKeywords(PyObject *kwds, PyObject **argnames[],\ PyObject *kwds2, PyObject *values[], Py_ssize_t num_pos_args,\ const char* function_name); static void __Pyx_RaiseArgtupleInvalid(const char* func_name, int exact, Py_ssize_t num_min, Py_ssize_t num_max, Py_ssize_t num_found); #if CYTHON_COMPILING_IN_CPYTHON static CYTHON_INLINE int __Pyx_PyList_Append(PyObject* list, PyObject* x) { PyListObject* L = (PyListObject*) list; Py_ssize_t len = Py_SIZE(list); if (likely(L->allocated > len) & likely(len > (L->allocated >> 1))) { Py_INCREF(x); PyList_SET_ITEM(list, len, x); Py_SIZE(list) = len+1; return 0; } return PyList_Append(list, x); } #else #define __Pyx_PyList_Append(L,x) PyList_Append(L,x) #endif static PyObject* __Pyx_PyObject_CallMethod1(PyObject* obj, PyObject* method_name, PyObject* arg); static CYTHON_INLINE int __Pyx_PyObject_Append(PyObject* L, PyObject* x); static CYTHON_INLINE void __Pyx_RaiseTooManyValuesError(Py_ssize_t expected); static CYTHON_INLINE void __Pyx_RaiseNeedMoreValuesError(Py_ssize_t index); static CYTHON_INLINE int __Pyx_IterFinish(void); static int __Pyx_IternextUnpackEndCheck(PyObject *retval, Py_ssize_t expected); static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, PyObject *cause); static CYTHON_INLINE int __Pyx_CheckKeywordStrings(PyObject *kwdict, const char* function_name, int kw_allowed); #if CYTHON_COMPILING_IN_CPYTHON static PyObject* __Pyx_PyInt_TrueDivideObjC(PyObject *op1, PyObject *op2, long intval, int inplace); #else #define __Pyx_PyInt_TrueDivideObjC(op1, op2, intval, inplace)\ (inplace ? PyNumber_InPlaceTrueDivide(op1, op2) : PyNumber_TrueDivide(op1, op2)) #endif #define __Pyx_GetItemInt(o, i, type, is_signed, to_py_func, is_list, wraparound, boundscheck)\ (__Pyx_fits_Py_ssize_t(i, type, is_signed) ?\ __Pyx_GetItemInt_Fast(o, (Py_ssize_t)i, is_list, wraparound, boundscheck) :\ (is_list ? (PyErr_SetString(PyExc_IndexError, "list index out of range"), (PyObject*)NULL) :\ __Pyx_GetItemInt_Generic(o, to_py_func(i)))) #define __Pyx_GetItemInt_List(o, i, type, is_signed, to_py_func, is_list, wraparound, boundscheck)\ (__Pyx_fits_Py_ssize_t(i, type, is_signed) ?\ __Pyx_GetItemInt_List_Fast(o, (Py_ssize_t)i, wraparound, boundscheck) :\ (PyErr_SetString(PyExc_IndexError, "list index out of range"), (PyObject*)NULL)) static CYTHON_INLINE PyObject *__Pyx_GetItemInt_List_Fast(PyObject *o, Py_ssize_t i, int wraparound, int boundscheck); #define __Pyx_GetItemInt_Tuple(o, i, type, is_signed, to_py_func, is_list, wraparound, boundscheck)\ (__Pyx_fits_Py_ssize_t(i, type, is_signed) ?\ __Pyx_GetItemInt_Tuple_Fast(o, (Py_ssize_t)i, wraparound, boundscheck) :\ (PyErr_SetString(PyExc_IndexError, "tuple index out of range"), (PyObject*)NULL)) static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Tuple_Fast(PyObject *o, Py_ssize_t i, int wraparound, int boundscheck); static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Generic(PyObject *o, PyObject* j); static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Fast(PyObject *o, Py_ssize_t i, int is_list, int wraparound, int boundscheck); static CYTHON_INLINE int __Pyx_ArgTypeTest(PyObject *obj, PyTypeObject *type, int none_allowed, const char *name, int exact); static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list, int level); static PyObject* __Pyx_ImportFrom(PyObject* module, PyObject* name); typedef struct { int code_line; PyCodeObject* code_object; } __Pyx_CodeObjectCacheEntry; struct __Pyx_CodeObjectCache { int count; int max_count; __Pyx_CodeObjectCacheEntry* entries; }; static struct __Pyx_CodeObjectCache __pyx_code_cache = {0,0,NULL}; static int __pyx_bisect_code_objects(__Pyx_CodeObjectCacheEntry* entries, int count, int code_line); static PyCodeObject *__pyx_find_code_object(int code_line); static void __pyx_insert_code_object(int code_line, PyCodeObject* code_object); static void __Pyx_AddTraceback(const char *funcname, int c_line, int py_line, const char *filename); static CYTHON_INLINE int __Pyx_PyInt_As_int(PyObject *); static CYTHON_INLINE PyObject* __Pyx_PyInt_From_int(int value); static CYTHON_INLINE PyObject* __Pyx_PyInt_From_MIX_InitFlags(MIX_InitFlags value); static CYTHON_INLINE uint16_t __Pyx_PyInt_As_uint16_t(PyObject *); static CYTHON_INLINE PyObject* __Pyx_PyInt_From_uint16_t(uint16_t value); static CYTHON_INLINE PyObject* __Pyx_PyInt_From_long(long value); static CYTHON_INLINE long __Pyx_PyInt_As_long(PyObject *); static int __Pyx_check_binary_version(void); #if !defined(__Pyx_PyIdentifier_FromString) #if PY_MAJOR_VERSION < 3 #define __Pyx_PyIdentifier_FromString(s) PyString_FromString(s) #else #define __Pyx_PyIdentifier_FromString(s) PyUnicode_FromString(s) #endif #endif static PyObject *__Pyx_ImportModule(const char *name); static int __Pyx_ImportFunction(PyObject *module, const char *funcname, void (**f)(void), const char *sig); static int __Pyx_InitStrings(__Pyx_StringTabEntry *t); /* Module declarations from 'libc.stdint' */ /* Module declarations from 'libc.string' */ /* Module declarations from 'libc.stdio' */ /* Module declarations from 'libc.stddef' */ /* Module declarations from 'sdl2' */ /* Module declarations from 'sdl2_mixer' */ /* Module declarations from 'pygame_sdl2.rwobject' */ static SDL_RWops *(*__pyx_f_11pygame_sdl2_8rwobject_to_rwops)(PyObject *, struct __pyx_opt_args_11pygame_sdl2_8rwobject_to_rwops *__pyx_optional_args); /*proto*/ /* Module declarations from 'pygame_sdl2.mixer' */ static PyTypeObject *__pyx_ptype_11pygame_sdl2_5mixer_Sound = 0; static PyTypeObject *__pyx_ptype_11pygame_sdl2_5mixer_Channel = 0; static PyObject *__pyx_v_11pygame_sdl2_5mixer_preinit_args = 0; static PyObject *__pyx_v_11pygame_sdl2_5mixer_output_spec = 0; static PyObject *__pyx_v_11pygame_sdl2_5mixer_channel_events = 0; static PyObject *__pyx_v_11pygame_sdl2_5mixer_channel_queued = 0; static PyObject *__pyx_v_11pygame_sdl2_5mixer_current_sounds = 0; static void __pyx_f_11pygame_sdl2_5mixer_channel_callback(int); /*proto*/ #define __Pyx_MODULE_NAME "pygame_sdl2.mixer" int __pyx_module_is_main_pygame_sdl2__mixer = 0; /* Implementation of 'pygame_sdl2.mixer' */ static char __pyx_k__4[] = "{}\n"; static char __pyx_k_fi[] = "fi"; static char __pyx_k_ms[] = "ms"; static char __pyx_k__13[] = "*"; static char __pyx_k_cid[] = "cid"; static char __pyx_k_get[] = "get"; static char __pyx_k_sys[] = "sys"; static char __pyx_k_Lock[] = "Lock"; static char __pyx_k_args[] = "args"; static char __pyx_k_chan[] = "chan"; static char __pyx_k_exit[] = "__exit__"; static char __pyx_k_flag[] = "flag"; static char __pyx_k_init[] = "init"; static char __pyx_k_lock[] = "_lock"; static char __pyx_k_main[] = "__main__"; static char __pyx_k_play[] = "play"; static char __pyx_k_quit[] = "quit"; static char __pyx_k_size[] = "size"; static char __pyx_k_stop[] = "stop"; static char __pyx_k_test[] = "__test__"; static char __pyx_k_time[] = "time"; static char __pyx_k_type[] = "type"; static char __pyx_k_count[] = "count"; static char __pyx_k_enter[] = "__enter__"; static char __pyx_k_error[] = "error"; static char __pyx_k_force[] = "force"; static char __pyx_k_loops[] = "loops"; static char __pyx_k_music[] = "music"; static char __pyx_k_pause[] = "pause"; static char __pyx_k_sound[] = "sound"; static char __pyx_k_start[] = "start"; static char __pyx_k_Thread[] = "Thread"; static char __pyx_k_append[] = "append"; static char __pyx_k_buffer[] = "buffer"; static char __pyx_k_errors[] = "errors"; static char __pyx_k_format[] = "format"; static char __pyx_k_import[] = "__import__"; static char __pyx_k_target[] = "target"; static char __pyx_k_channel[] = "channel"; static char __pyx_k_fade_ms[] = "fade_ms"; static char __pyx_k_fadeout[] = "fadeout"; static char __pyx_k_maxtime[] = "maxtime"; static char __pyx_k_unpause[] = "unpause"; static char __pyx_k_channels[] = "channels"; static char __pyx_k_get_busy[] = "get_busy"; static char __pyx_k_get_init[] = "get_init"; static char __pyx_k_pre_init[] = "pre_init"; static char __pyx_k_frequency[] = "frequency"; static char __pyx_k_threading[] = "threading"; static char __pyx_k_buffersize[] = "buffersize"; static char __pyx_k_next_sound[] = "next_sound"; static char __pyx_k_pygame_sdl2[] = "pygame_sdl2"; static char __pyx_k_find_channel[] = "find_channel"; static char __pyx_k_play_current[] = "_play_current"; static char __pyx_k_set_reserved[] = "set_reserved"; static char __pyx_k_register_init[] = "register_init"; static char __pyx_k_register_quit[] = "register_quit"; static char __pyx_k_Not_implemented[] = "Not implemented."; static char __pyx_k_get_num_channels[] = "get_num_channels"; static char __pyx_k_set_num_channels[] = "set_num_channels"; static char __pyx_k_pygame_sdl2_error[] = "pygame_sdl2.error"; static char __pyx_k_pygame_sdl2_mixer[] = "pygame_sdl2.mixer"; static char __pyx_k_pygame_sdl2_mixer_music[] = "pygame_sdl2.mixer_music"; static char __pyx_k_home_tom_ab_pygame_sdl2_src_pyg[] = "/home/tom/ab/pygame_sdl2/src/pygame_sdl2/mixer.pyx"; static PyObject *__pyx_n_s_Lock; static PyObject *__pyx_kp_u_Not_implemented; static PyObject *__pyx_n_s_Thread; static PyObject *__pyx_n_s__13; static PyObject *__pyx_kp_u__4; static PyObject *__pyx_n_s_append; static PyObject *__pyx_n_s_args; static PyObject *__pyx_n_s_buffer; static PyObject *__pyx_n_s_buffersize; static PyObject *__pyx_n_s_chan; static PyObject *__pyx_n_s_channel; static PyObject *__pyx_n_s_channels; static PyObject *__pyx_n_s_cid; static PyObject *__pyx_n_s_count; static PyObject *__pyx_n_s_enter; static PyObject *__pyx_n_s_error; static PyObject *__pyx_n_s_errors; static PyObject *__pyx_n_s_exit; static PyObject *__pyx_n_s_fade_ms; static PyObject *__pyx_n_s_fadeout; static PyObject *__pyx_n_s_fi; static PyObject *__pyx_n_s_find_channel; static PyObject *__pyx_n_s_flag; static PyObject *__pyx_n_s_force; static PyObject *__pyx_n_s_format; static PyObject *__pyx_n_s_frequency; static PyObject *__pyx_n_s_get; static PyObject *__pyx_n_s_get_busy; static PyObject *__pyx_n_s_get_init; static PyObject *__pyx_n_s_get_num_channels; static PyObject *__pyx_kp_s_home_tom_ab_pygame_sdl2_src_pyg; static PyObject *__pyx_n_s_import; static PyObject *__pyx_n_s_init; static PyObject *__pyx_n_s_lock; static PyObject *__pyx_n_s_loops; static PyObject *__pyx_n_s_main; static PyObject *__pyx_n_s_maxtime; static PyObject *__pyx_n_s_ms; static PyObject *__pyx_n_s_music; static PyObject *__pyx_n_s_next_sound; static PyObject *__pyx_n_s_pause; static PyObject *__pyx_n_s_play; static PyObject *__pyx_n_s_play_current; static PyObject *__pyx_n_s_pre_init; static PyObject *__pyx_n_s_pygame_sdl2; static PyObject *__pyx_n_s_pygame_sdl2_error; static PyObject *__pyx_n_s_pygame_sdl2_mixer; static PyObject *__pyx_n_s_pygame_sdl2_mixer_music; static PyObject *__pyx_n_s_quit; static PyObject *__pyx_n_s_register_init; static PyObject *__pyx_n_s_register_quit; static PyObject *__pyx_n_s_set_num_channels; static PyObject *__pyx_n_s_set_reserved; static PyObject *__pyx_n_s_size; static PyObject *__pyx_n_s_sound; static PyObject *__pyx_n_s_start; static PyObject *__pyx_n_s_stop; static PyObject *__pyx_n_s_sys; static PyObject *__pyx_n_s_target; static PyObject *__pyx_n_s_test; static PyObject *__pyx_n_s_threading; static PyObject *__pyx_n_s_time; static PyObject *__pyx_n_s_type; static PyObject *__pyx_n_s_unpause; static PyObject *__pyx_pf_11pygame_sdl2_5mixer__play_current(CYTHON_UNUSED PyObject *__pyx_self, int __pyx_v_channel); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_5mixer_2init(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_frequency, PyObject *__pyx_v_size, PyObject *__pyx_v_channels, PyObject *__pyx_v_buffer); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_5mixer_4pre_init(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_frequency, PyObject *__pyx_v_size, PyObject *__pyx_v_channels, PyObject *__pyx_v_buffersize); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_5mixer_6quit(CYTHON_UNUSED PyObject *__pyx_self); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_5mixer_8get_init(CYTHON_UNUSED PyObject *__pyx_self); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_5mixer_10stop(CYTHON_UNUSED PyObject *__pyx_self); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_5mixer_12pause(CYTHON_UNUSED PyObject *__pyx_self); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_5mixer_14unpause(CYTHON_UNUSED PyObject *__pyx_self); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_5mixer_16fadeout(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_time); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_5mixer_18set_num_channels(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_count); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_5mixer_20get_num_channels(CYTHON_UNUSED PyObject *__pyx_self); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_5mixer_22set_reserved(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_count); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_5mixer_24find_channel(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_force); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_5mixer_26get_busy(CYTHON_UNUSED PyObject *__pyx_self); /* proto */ static int __pyx_pf_11pygame_sdl2_5mixer_5Sound___cinit__(struct __pyx_obj_11pygame_sdl2_5mixer_Sound *__pyx_v_self); /* proto */ static void __pyx_pf_11pygame_sdl2_5mixer_5Sound_2__dealloc__(struct __pyx_obj_11pygame_sdl2_5mixer_Sound *__pyx_v_self); /* proto */ static int __pyx_pf_11pygame_sdl2_5mixer_5Sound_4__init__(struct __pyx_obj_11pygame_sdl2_5mixer_Sound *__pyx_v_self, PyObject *__pyx_v_fi); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_5mixer_5Sound_6play(struct __pyx_obj_11pygame_sdl2_5mixer_Sound *__pyx_v_self, PyObject *__pyx_v_loops, PyObject *__pyx_v_maxtime, PyObject *__pyx_v_fade_ms); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_5mixer_5Sound_8stop(struct __pyx_obj_11pygame_sdl2_5mixer_Sound *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_5mixer_5Sound_10pause(struct __pyx_obj_11pygame_sdl2_5mixer_Sound *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_5mixer_5Sound_12unpause(struct __pyx_obj_11pygame_sdl2_5mixer_Sound *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_5mixer_5Sound_14fadeout(struct __pyx_obj_11pygame_sdl2_5mixer_Sound *__pyx_v_self, PyObject *__pyx_v_time); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_5mixer_5Sound_16set_volume(struct __pyx_obj_11pygame_sdl2_5mixer_Sound *__pyx_v_self, PyObject *__pyx_v_value); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_5mixer_5Sound_18get_volume(struct __pyx_obj_11pygame_sdl2_5mixer_Sound *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_5mixer_5Sound_20get_num_channels(struct __pyx_obj_11pygame_sdl2_5mixer_Sound *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_5mixer_5Sound_22get_length(struct __pyx_obj_11pygame_sdl2_5mixer_Sound *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_5mixer_5Sound_24get_raw(CYTHON_UNUSED struct __pyx_obj_11pygame_sdl2_5mixer_Sound *__pyx_v_self); /* proto */ static int __pyx_pf_11pygame_sdl2_5mixer_7Channel___init__(struct __pyx_obj_11pygame_sdl2_5mixer_Channel *__pyx_v_self, PyObject *__pyx_v_cid); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_5mixer_7Channel_2play(struct __pyx_obj_11pygame_sdl2_5mixer_Channel *__pyx_v_self, struct __pyx_obj_11pygame_sdl2_5mixer_Sound *__pyx_v_sound, PyObject *__pyx_v_loops, PyObject *__pyx_v_maxtime, PyObject *__pyx_v_fade_ms); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_5mixer_7Channel_4stop(struct __pyx_obj_11pygame_sdl2_5mixer_Channel *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_5mixer_7Channel_6pause(struct __pyx_obj_11pygame_sdl2_5mixer_Channel *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_5mixer_7Channel_8unpause(struct __pyx_obj_11pygame_sdl2_5mixer_Channel *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_5mixer_7Channel_10fadeout(struct __pyx_obj_11pygame_sdl2_5mixer_Channel *__pyx_v_self, PyObject *__pyx_v_time); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_5mixer_7Channel_12set_volume(struct __pyx_obj_11pygame_sdl2_5mixer_Channel *__pyx_v_self, PyObject *__pyx_v_volume); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_5mixer_7Channel_14get_volume(struct __pyx_obj_11pygame_sdl2_5mixer_Channel *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_5mixer_7Channel_16get_busy(struct __pyx_obj_11pygame_sdl2_5mixer_Channel *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_5mixer_7Channel_18get_sound(struct __pyx_obj_11pygame_sdl2_5mixer_Channel *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_5mixer_7Channel_20queue(struct __pyx_obj_11pygame_sdl2_5mixer_Channel *__pyx_v_self, struct __pyx_obj_11pygame_sdl2_5mixer_Sound *__pyx_v_sound); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_5mixer_7Channel_22get_queue(struct __pyx_obj_11pygame_sdl2_5mixer_Channel *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_5mixer_7Channel_24set_endevent(struct __pyx_obj_11pygame_sdl2_5mixer_Channel *__pyx_v_self, PyObject *__pyx_v_type); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_5mixer_7Channel_26get_endevent(struct __pyx_obj_11pygame_sdl2_5mixer_Channel *__pyx_v_self); /* proto */ static PyObject *__pyx_tp_new_11pygame_sdl2_5mixer_Sound(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ static PyObject *__pyx_tp_new_11pygame_sdl2_5mixer_Channel(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ static PyObject *__pyx_int_0; static PyObject *__pyx_int_2; static PyObject *__pyx_int_4096; static PyObject *__pyx_int_22050; static PyObject *__pyx_int_neg_1; static PyObject *__pyx_k__3; static PyObject *__pyx_k__5; static PyObject *__pyx_tuple_; static PyObject *__pyx_tuple__2; static PyObject *__pyx_tuple__6; static PyObject *__pyx_tuple__7; static PyObject *__pyx_tuple__8; static PyObject *__pyx_tuple__9; static PyObject *__pyx_tuple__10; static PyObject *__pyx_tuple__11; static PyObject *__pyx_tuple__12; static PyObject *__pyx_tuple__14; static PyObject *__pyx_tuple__16; static PyObject *__pyx_tuple__18; static PyObject *__pyx_tuple__21; static PyObject *__pyx_tuple__26; static PyObject *__pyx_tuple__28; static PyObject *__pyx_tuple__31; static PyObject *__pyx_tuple__33; static PyObject *__pyx_codeobj__15; static PyObject *__pyx_codeobj__17; static PyObject *__pyx_codeobj__19; static PyObject *__pyx_codeobj__20; static PyObject *__pyx_codeobj__22; static PyObject *__pyx_codeobj__23; static PyObject *__pyx_codeobj__24; static PyObject *__pyx_codeobj__25; static PyObject *__pyx_codeobj__27; static PyObject *__pyx_codeobj__29; static PyObject *__pyx_codeobj__30; static PyObject *__pyx_codeobj__32; static PyObject *__pyx_codeobj__34; static PyObject *__pyx_codeobj__35; /* "pygame_sdl2/mixer.pyx":41 * _lock = threading.Lock() * * def _play_current(int channel): # <<<<<<<<<<<<<< * """ * Caled by channel_callback to play the next sound. This has to be called */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_5mixer_1_play_current(PyObject *__pyx_self, PyObject *__pyx_arg_channel); /*proto*/ static char __pyx_doc_11pygame_sdl2_5mixer__play_current[] = "\n Caled by channel_callback to play the next sound. This has to be called\n from a different thread, as the channel callback isn't allowed to call\n MIX functions.\n "; static PyMethodDef __pyx_mdef_11pygame_sdl2_5mixer_1_play_current = {"_play_current", (PyCFunction)__pyx_pw_11pygame_sdl2_5mixer_1_play_current, METH_O, __pyx_doc_11pygame_sdl2_5mixer__play_current}; static PyObject *__pyx_pw_11pygame_sdl2_5mixer_1_play_current(PyObject *__pyx_self, PyObject *__pyx_arg_channel) { int __pyx_v_channel; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("_play_current (wrapper)", 0); assert(__pyx_arg_channel); { __pyx_v_channel = __Pyx_PyInt_As_int(__pyx_arg_channel); if (unlikely((__pyx_v_channel == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 41; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; __Pyx_AddTraceback("pygame_sdl2.mixer._play_current", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_11pygame_sdl2_5mixer__play_current(__pyx_self, ((int)__pyx_v_channel)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_5mixer__play_current(CYTHON_UNUSED PyObject *__pyx_self, int __pyx_v_channel) { struct __pyx_obj_11pygame_sdl2_5mixer_Sound *__pyx_v_next_sound = 0; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; PyObject *__pyx_t_5 = NULL; PyObject *__pyx_t_6 = NULL; PyObject *__pyx_t_7 = NULL; PyObject *__pyx_t_8 = NULL; PyObject *__pyx_t_9 = NULL; int __pyx_t_10; int __pyx_t_11; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("_play_current", 0); /* "pygame_sdl2/mixer.pyx":50 * cdef Sound next_sound * * with _lock: # <<<<<<<<<<<<<< * next_sound = channel_queued[channel] * current_sounds[channel] = next_sound */ /*with:*/ { __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_lock); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 50; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = __Pyx_PyObject_LookupSpecial(__pyx_t_1, __pyx_n_s_exit); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 50; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __pyx_t_4 = __Pyx_PyObject_LookupSpecial(__pyx_t_1, __pyx_n_s_enter); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 50; __pyx_clineno = __LINE__; goto __pyx_L3_error;} __Pyx_GOTREF(__pyx_t_4); __pyx_t_5 = NULL; if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_4))) { __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4); if (likely(__pyx_t_5)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4); __Pyx_INCREF(__pyx_t_5); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_4, function); } } if (__pyx_t_5) { __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_5); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 50; __pyx_clineno = __LINE__; goto __pyx_L3_error;} __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; } else { __pyx_t_3 = __Pyx_PyObject_CallNoArg(__pyx_t_4); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 50; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /*try:*/ { { __Pyx_ExceptionSave(&__pyx_t_6, &__pyx_t_7, &__pyx_t_8); __Pyx_XGOTREF(__pyx_t_6); __Pyx_XGOTREF(__pyx_t_7); __Pyx_XGOTREF(__pyx_t_8); /*try:*/ { /* "pygame_sdl2/mixer.pyx":51 * * with _lock: * next_sound = channel_queued[channel] # <<<<<<<<<<<<<< * current_sounds[channel] = next_sound * channel_queued[channel] = None */ if (unlikely(__pyx_v_11pygame_sdl2_5mixer_channel_queued == Py_None)) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 51; __pyx_clineno = __LINE__; goto __pyx_L7_error;} } __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_channel); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 51; __pyx_clineno = __LINE__; goto __pyx_L7_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_t_3 = __Pyx_PyDict_GetItem(__pyx_v_11pygame_sdl2_5mixer_channel_queued, __pyx_t_1); if (unlikely(__pyx_t_3 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 51; __pyx_clineno = __LINE__; goto __pyx_L7_error;}; __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_ptype_11pygame_sdl2_5mixer_Sound))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 51; __pyx_clineno = __LINE__; goto __pyx_L7_error;} __pyx_v_next_sound = ((struct __pyx_obj_11pygame_sdl2_5mixer_Sound *)__pyx_t_3); __pyx_t_3 = 0; /* "pygame_sdl2/mixer.pyx":52 * with _lock: * next_sound = channel_queued[channel] * current_sounds[channel] = next_sound # <<<<<<<<<<<<<< * channel_queued[channel] = None * */ if (unlikely(__pyx_v_11pygame_sdl2_5mixer_current_sounds == Py_None)) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 52; __pyx_clineno = __LINE__; goto __pyx_L7_error;} } __pyx_t_3 = __Pyx_PyInt_From_int(__pyx_v_channel); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 52; __pyx_clineno = __LINE__; goto __pyx_L7_error;} __Pyx_GOTREF(__pyx_t_3); if (unlikely(PyDict_SetItem(__pyx_v_11pygame_sdl2_5mixer_current_sounds, __pyx_t_3, ((PyObject *)__pyx_v_next_sound)) < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 52; __pyx_clineno = __LINE__; goto __pyx_L7_error;} __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "pygame_sdl2/mixer.pyx":53 * next_sound = channel_queued[channel] * current_sounds[channel] = next_sound * channel_queued[channel] = None # <<<<<<<<<<<<<< * * if next_sound: */ if (unlikely(__pyx_v_11pygame_sdl2_5mixer_channel_queued == Py_None)) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 53; __pyx_clineno = __LINE__; goto __pyx_L7_error;} } __pyx_t_3 = __Pyx_PyInt_From_int(__pyx_v_channel); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 53; __pyx_clineno = __LINE__; goto __pyx_L7_error;} __Pyx_GOTREF(__pyx_t_3); if (unlikely(PyDict_SetItem(__pyx_v_11pygame_sdl2_5mixer_channel_queued, __pyx_t_3, Py_None) < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 53; __pyx_clineno = __LINE__; goto __pyx_L7_error;} __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "pygame_sdl2/mixer.pyx":50 * cdef Sound next_sound * * with _lock: # <<<<<<<<<<<<<< * next_sound = channel_queued[channel] * current_sounds[channel] = next_sound */ } __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0; goto __pyx_L14_try_end; __pyx_L7_error:; __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; /*except:*/ { __Pyx_AddTraceback("pygame_sdl2.mixer._play_current", __pyx_clineno, __pyx_lineno, __pyx_filename); if (__Pyx_GetException(&__pyx_t_3, &__pyx_t_1, &__pyx_t_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 50; __pyx_clineno = __LINE__; goto __pyx_L9_except_error;} __Pyx_GOTREF(__pyx_t_3); __Pyx_GOTREF(__pyx_t_1); __Pyx_GOTREF(__pyx_t_4); __pyx_t_5 = PyTuple_Pack(3, __pyx_t_3, __pyx_t_1, __pyx_t_4); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 50; __pyx_clineno = __LINE__; goto __pyx_L9_except_error;} __Pyx_GOTREF(__pyx_t_5); __pyx_t_9 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_5, NULL); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 50; __pyx_clineno = __LINE__; goto __pyx_L9_except_error;} __Pyx_GOTREF(__pyx_t_9); __pyx_t_10 = __Pyx_PyObject_IsTrue(__pyx_t_9); __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; if (__pyx_t_10 < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 50; __pyx_clineno = __LINE__; goto __pyx_L9_except_error;} __pyx_t_11 = ((!(__pyx_t_10 != 0)) != 0); if (__pyx_t_11) { __Pyx_GIVEREF(__pyx_t_3); __Pyx_GIVEREF(__pyx_t_1); __Pyx_XGIVEREF(__pyx_t_4); __Pyx_ErrRestore(__pyx_t_3, __pyx_t_1, __pyx_t_4); __pyx_t_3 = 0; __pyx_t_1 = 0; __pyx_t_4 = 0; {__pyx_filename = __pyx_f[0]; __pyx_lineno = 50; __pyx_clineno = __LINE__; goto __pyx_L9_except_error;} } __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; goto __pyx_L8_exception_handled; } __pyx_L9_except_error:; __Pyx_XGIVEREF(__pyx_t_6); __Pyx_XGIVEREF(__pyx_t_7); __Pyx_XGIVEREF(__pyx_t_8); __Pyx_ExceptionReset(__pyx_t_6, __pyx_t_7, __pyx_t_8); goto __pyx_L1_error; __pyx_L8_exception_handled:; __Pyx_XGIVEREF(__pyx_t_6); __Pyx_XGIVEREF(__pyx_t_7); __Pyx_XGIVEREF(__pyx_t_8); __Pyx_ExceptionReset(__pyx_t_6, __pyx_t_7, __pyx_t_8); __pyx_L14_try_end:; } } /*finally:*/ { /*normal exit:*/{ if (__pyx_t_2) { __pyx_t_8 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_tuple_, NULL); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 50; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_8); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; } goto __pyx_L6; } __pyx_L6:; } goto __pyx_L18; __pyx_L3_error:; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; goto __pyx_L1_error; __pyx_L18:; } /* "pygame_sdl2/mixer.pyx":55 * channel_queued[channel] = None * * if next_sound: # <<<<<<<<<<<<<< * with nogil: * Mix_PlayChannelTimed(channel, next_sound.chunk, 0, -1) */ if (unlikely(!__pyx_v_next_sound)) { __Pyx_RaiseUnboundLocalError("next_sound"); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 55; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } __pyx_t_11 = __Pyx_PyObject_IsTrue(((PyObject *)__pyx_v_next_sound)); if (unlikely(__pyx_t_11 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 55; __pyx_clineno = __LINE__; goto __pyx_L1_error;} if (__pyx_t_11) { /* "pygame_sdl2/mixer.pyx":56 * * if next_sound: * with nogil: # <<<<<<<<<<<<<< * Mix_PlayChannelTimed(channel, next_sound.chunk, 0, -1) * */ { #ifdef WITH_THREAD PyThreadState *_save; Py_UNBLOCK_THREADS #endif /*try:*/ { /* "pygame_sdl2/mixer.pyx":57 * if next_sound: * with nogil: * Mix_PlayChannelTimed(channel, next_sound.chunk, 0, -1) # <<<<<<<<<<<<<< * * */ if (unlikely(!__pyx_v_next_sound)) { __Pyx_RaiseUnboundLocalError("next_sound"); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 57; __pyx_clineno = __LINE__; goto __pyx_L21_error;} } Mix_PlayChannelTimed(__pyx_v_channel, __pyx_v_next_sound->chunk, 0, -1); } /* "pygame_sdl2/mixer.pyx":56 * * if next_sound: * with nogil: # <<<<<<<<<<<<<< * Mix_PlayChannelTimed(channel, next_sound.chunk, 0, -1) * */ /*finally:*/ { /*normal exit:*/{ #ifdef WITH_THREAD Py_BLOCK_THREADS #endif goto __pyx_L22; } __pyx_L21_error: { #ifdef WITH_THREAD Py_BLOCK_THREADS #endif goto __pyx_L1_error; } __pyx_L22:; } } /* "pygame_sdl2/mixer.pyx":55 * channel_queued[channel] = None * * if next_sound: # <<<<<<<<<<<<<< * with nogil: * Mix_PlayChannelTimed(channel, next_sound.chunk, 0, -1) */ } /* "pygame_sdl2/mixer.pyx":41 * _lock = threading.Lock() * * def _play_current(int channel): # <<<<<<<<<<<<<< * """ * Caled by channel_callback to play the next sound. This has to be called */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_5); __Pyx_AddTraceback("pygame_sdl2.mixer._play_current", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF((PyObject *)__pyx_v_next_sound); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/mixer.pyx":60 * * * cdef void channel_callback(int channel) with gil: # <<<<<<<<<<<<<< * * cdef int etype = 0 */ static void __pyx_f_11pygame_sdl2_5mixer_channel_callback(int __pyx_v_channel) { int __pyx_v_etype; SDL_Event __pyx_v_e; PyObject *__pyx_v_next_sound = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; int __pyx_t_3; int __pyx_t_4; PyObject *__pyx_t_5 = NULL; PyObject *__pyx_t_6 = NULL; PyObject *__pyx_t_7 = NULL; PyObject *__pyx_t_8 = NULL; PyObject *__pyx_t_9 = NULL; PyObject *__pyx_t_10 = NULL; PyObject *__pyx_t_11 = NULL; PyObject *__pyx_t_12 = NULL; int __pyx_t_13; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; #ifdef WITH_THREAD PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure(); #endif __Pyx_RefNannySetupContext("channel_callback", 0); /* "pygame_sdl2/mixer.pyx":62 * cdef void channel_callback(int channel) with gil: * * cdef int etype = 0 # <<<<<<<<<<<<<< * cdef SDL_Event e * */ __pyx_v_etype = 0; /* "pygame_sdl2/mixer.pyx":65 * cdef SDL_Event e * * etype = channel_events.get(channel, 0) # <<<<<<<<<<<<<< * if etype != 0: * memset(&e, 0, sizeof(SDL_Event)) */ if (unlikely(__pyx_v_11pygame_sdl2_5mixer_channel_events == Py_None)) { PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%s'", "get"); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 65; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_channel); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 65; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = __Pyx_PyDict_GetItemDefault(__pyx_v_11pygame_sdl2_5mixer_channel_events, __pyx_t_1, __pyx_int_0); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 65; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_3 = __Pyx_PyInt_As_int(__pyx_t_2); if (unlikely((__pyx_t_3 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 65; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_v_etype = __pyx_t_3; /* "pygame_sdl2/mixer.pyx":66 * * etype = channel_events.get(channel, 0) * if etype != 0: # <<<<<<<<<<<<<< * memset(&e, 0, sizeof(SDL_Event)) * e.type = etype */ __pyx_t_4 = ((__pyx_v_etype != 0) != 0); if (__pyx_t_4) { /* "pygame_sdl2/mixer.pyx":67 * etype = channel_events.get(channel, 0) * if etype != 0: * memset(&e, 0, sizeof(SDL_Event)) # <<<<<<<<<<<<<< * e.type = etype * SDL_PushEvent(&e) */ memset((&__pyx_v_e), 0, (sizeof(SDL_Event))); /* "pygame_sdl2/mixer.pyx":68 * if etype != 0: * memset(&e, 0, sizeof(SDL_Event)) * e.type = etype # <<<<<<<<<<<<<< * SDL_PushEvent(&e) * */ __pyx_v_e.type = __pyx_v_etype; /* "pygame_sdl2/mixer.pyx":69 * memset(&e, 0, sizeof(SDL_Event)) * e.type = etype * SDL_PushEvent(&e) # <<<<<<<<<<<<<< * * with _lock: */ SDL_PushEvent((&__pyx_v_e)); /* "pygame_sdl2/mixer.pyx":66 * * etype = channel_events.get(channel, 0) * if etype != 0: # <<<<<<<<<<<<<< * memset(&e, 0, sizeof(SDL_Event)) * e.type = etype */ } /* "pygame_sdl2/mixer.pyx":71 * SDL_PushEvent(&e) * * with _lock: # <<<<<<<<<<<<<< * next_sound = channel_queued.get(channel) * if next_sound: */ /*with:*/ { __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_lock); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 71; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __pyx_t_5 = __Pyx_PyObject_LookupSpecial(__pyx_t_2, __pyx_n_s_exit); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 71; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); __pyx_t_6 = __Pyx_PyObject_LookupSpecial(__pyx_t_2, __pyx_n_s_enter); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 71; __pyx_clineno = __LINE__; goto __pyx_L4_error;} __Pyx_GOTREF(__pyx_t_6); __pyx_t_7 = NULL; if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_6))) { __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_6); if (likely(__pyx_t_7)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6); __Pyx_INCREF(__pyx_t_7); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_6, function); } } if (__pyx_t_7) { __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_6, __pyx_t_7); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 71; __pyx_clineno = __LINE__; goto __pyx_L4_error;} __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; } else { __pyx_t_1 = __Pyx_PyObject_CallNoArg(__pyx_t_6); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 71; __pyx_clineno = __LINE__; goto __pyx_L4_error;} } __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /*try:*/ { { __Pyx_ExceptionSave(&__pyx_t_8, &__pyx_t_9, &__pyx_t_10); __Pyx_XGOTREF(__pyx_t_8); __Pyx_XGOTREF(__pyx_t_9); __Pyx_XGOTREF(__pyx_t_10); /*try:*/ { /* "pygame_sdl2/mixer.pyx":72 * * with _lock: * next_sound = channel_queued.get(channel) # <<<<<<<<<<<<<< * if next_sound: * threading.Thread(target=_play_current, args=(channel,)).start() */ if (unlikely(__pyx_v_11pygame_sdl2_5mixer_channel_queued == Py_None)) { PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%s'", "get"); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 72; __pyx_clineno = __LINE__; goto __pyx_L8_error;} } __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_v_channel); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 72; __pyx_clineno = __LINE__; goto __pyx_L8_error;} __Pyx_GOTREF(__pyx_t_2); __pyx_t_1 = __Pyx_PyDict_GetItemDefault(__pyx_v_11pygame_sdl2_5mixer_channel_queued, __pyx_t_2, Py_None); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 72; __pyx_clineno = __LINE__; goto __pyx_L8_error;} __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_v_next_sound = __pyx_t_1; __pyx_t_1 = 0; /* "pygame_sdl2/mixer.pyx":73 * with _lock: * next_sound = channel_queued.get(channel) * if next_sound: # <<<<<<<<<<<<<< * threading.Thread(target=_play_current, args=(channel,)).start() * */ __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_v_next_sound); if (unlikely(__pyx_t_4 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 73; __pyx_clineno = __LINE__; goto __pyx_L8_error;} if (__pyx_t_4) { /* "pygame_sdl2/mixer.pyx":74 * next_sound = channel_queued.get(channel) * if next_sound: * threading.Thread(target=_play_current, args=(channel,)).start() # <<<<<<<<<<<<<< * * # A list of errors that occured during mixer initialization. */ __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_threading); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 74; __pyx_clineno = __LINE__; goto __pyx_L8_error;} __Pyx_GOTREF(__pyx_t_2); __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_Thread); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 74; __pyx_clineno = __LINE__; goto __pyx_L8_error;} __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_2 = PyDict_New(); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 74; __pyx_clineno = __LINE__; goto __pyx_L8_error;} __Pyx_GOTREF(__pyx_t_2); __pyx_t_7 = __Pyx_GetModuleGlobalName(__pyx_n_s_play_current); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 74; __pyx_clineno = __LINE__; goto __pyx_L8_error;} __Pyx_GOTREF(__pyx_t_7); if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_target, __pyx_t_7) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 74; __pyx_clineno = __LINE__; goto __pyx_L8_error;} __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __pyx_t_7 = __Pyx_PyInt_From_int(__pyx_v_channel); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 74; __pyx_clineno = __LINE__; goto __pyx_L8_error;} __Pyx_GOTREF(__pyx_t_7); __pyx_t_11 = PyTuple_New(1); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 74; __pyx_clineno = __LINE__; goto __pyx_L8_error;} __Pyx_GOTREF(__pyx_t_11); __Pyx_GIVEREF(__pyx_t_7); PyTuple_SET_ITEM(__pyx_t_11, 0, __pyx_t_7); __pyx_t_7 = 0; if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_args, __pyx_t_11) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 74; __pyx_clineno = __LINE__; goto __pyx_L8_error;} __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; __pyx_t_11 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_empty_tuple, __pyx_t_2); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 74; __pyx_clineno = __LINE__; goto __pyx_L8_error;} __Pyx_GOTREF(__pyx_t_11); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_11, __pyx_n_s_start); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 74; __pyx_clineno = __LINE__; goto __pyx_L8_error;} __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; __pyx_t_11 = NULL; if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_2))) { __pyx_t_11 = PyMethod_GET_SELF(__pyx_t_2); if (likely(__pyx_t_11)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_11); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); } } if (__pyx_t_11) { __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_11); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 74; __pyx_clineno = __LINE__; goto __pyx_L8_error;} __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; } else { __pyx_t_1 = __Pyx_PyObject_CallNoArg(__pyx_t_2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 74; __pyx_clineno = __LINE__; goto __pyx_L8_error;} } __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "pygame_sdl2/mixer.pyx":73 * with _lock: * next_sound = channel_queued.get(channel) * if next_sound: # <<<<<<<<<<<<<< * threading.Thread(target=_play_current, args=(channel,)).start() * */ } /* "pygame_sdl2/mixer.pyx":71 * SDL_PushEvent(&e) * * with _lock: # <<<<<<<<<<<<<< * next_sound = channel_queued.get(channel) * if next_sound: */ } __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0; __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0; __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0; goto __pyx_L15_try_end; __pyx_L8_error:; __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0; __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; /*except:*/ { __Pyx_AddTraceback("pygame_sdl2.mixer.channel_callback", __pyx_clineno, __pyx_lineno, __pyx_filename); if (__Pyx_GetException(&__pyx_t_1, &__pyx_t_2, &__pyx_t_11) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 71; __pyx_clineno = __LINE__; goto __pyx_L10_except_error;} __Pyx_GOTREF(__pyx_t_1); __Pyx_GOTREF(__pyx_t_2); __Pyx_GOTREF(__pyx_t_11); __pyx_t_6 = PyTuple_Pack(3, __pyx_t_1, __pyx_t_2, __pyx_t_11); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 71; __pyx_clineno = __LINE__; goto __pyx_L10_except_error;} __Pyx_GOTREF(__pyx_t_6); __pyx_t_12 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_6, NULL); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 71; __pyx_clineno = __LINE__; goto __pyx_L10_except_error;} __Pyx_GOTREF(__pyx_t_12); __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_12); __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; if (__pyx_t_4 < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 71; __pyx_clineno = __LINE__; goto __pyx_L10_except_error;} __pyx_t_13 = ((!(__pyx_t_4 != 0)) != 0); if (__pyx_t_13) { __Pyx_GIVEREF(__pyx_t_1); __Pyx_GIVEREF(__pyx_t_2); __Pyx_XGIVEREF(__pyx_t_11); __Pyx_ErrRestore(__pyx_t_1, __pyx_t_2, __pyx_t_11); __pyx_t_1 = 0; __pyx_t_2 = 0; __pyx_t_11 = 0; {__pyx_filename = __pyx_f[0]; __pyx_lineno = 71; __pyx_clineno = __LINE__; goto __pyx_L10_except_error;} } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; goto __pyx_L9_exception_handled; } __pyx_L10_except_error:; __Pyx_XGIVEREF(__pyx_t_8); __Pyx_XGIVEREF(__pyx_t_9); __Pyx_XGIVEREF(__pyx_t_10); __Pyx_ExceptionReset(__pyx_t_8, __pyx_t_9, __pyx_t_10); goto __pyx_L1_error; __pyx_L9_exception_handled:; __Pyx_XGIVEREF(__pyx_t_8); __Pyx_XGIVEREF(__pyx_t_9); __Pyx_XGIVEREF(__pyx_t_10); __Pyx_ExceptionReset(__pyx_t_8, __pyx_t_9, __pyx_t_10); __pyx_L15_try_end:; } } /*finally:*/ { /*normal exit:*/{ if (__pyx_t_5) { __pyx_t_10 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_tuple__2, NULL); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 71; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_10); __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; } goto __pyx_L7; } __pyx_L7:; } goto __pyx_L20; __pyx_L4_error:; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; goto __pyx_L1_error; __pyx_L20:; } /* "pygame_sdl2/mixer.pyx":60 * * * cdef void channel_callback(int channel) with gil: # <<<<<<<<<<<<<< * * cdef int etype = 0 */ /* function exit code */ goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_6); __Pyx_XDECREF(__pyx_t_7); __Pyx_XDECREF(__pyx_t_11); __Pyx_WriteUnraisable("pygame_sdl2.mixer.channel_callback", __pyx_clineno, __pyx_lineno, __pyx_filename, 0, 0); __pyx_L0:; __Pyx_XDECREF(__pyx_v_next_sound); __Pyx_RefNannyFinishContext(); #ifdef WITH_THREAD PyGILState_Release(__pyx_gilstate_save); #endif } /* "pygame_sdl2/mixer.pyx":80 * * @pygame_sdl2.register_init * def init(frequency=22050, size=MIX_DEFAULT_FORMAT, channels=2, buffer=4096): # <<<<<<<<<<<<<< * if get_init() is not None: * return */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_5mixer_3init(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static PyMethodDef __pyx_mdef_11pygame_sdl2_5mixer_3init = {"init", (PyCFunction)__pyx_pw_11pygame_sdl2_5mixer_3init, METH_VARARGS|METH_KEYWORDS, 0}; static PyObject *__pyx_pw_11pygame_sdl2_5mixer_3init(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_frequency = 0; PyObject *__pyx_v_size = 0; PyObject *__pyx_v_channels = 0; PyObject *__pyx_v_buffer = 0; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("init (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_frequency,&__pyx_n_s_size,&__pyx_n_s_channels,&__pyx_n_s_buffer,0}; PyObject* values[4] = {0,0,0,0}; values[0] = ((PyObject *)__pyx_int_22050); values[1] = __pyx_k__3; values[2] = ((PyObject *)__pyx_int_2); values[3] = ((PyObject *)__pyx_int_4096); if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (kw_args > 0) { PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_frequency); if (value) { values[0] = value; kw_args--; } } case 1: if (kw_args > 0) { PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_size); if (value) { values[1] = value; kw_args--; } } case 2: if (kw_args > 0) { PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_channels); if (value) { values[2] = value; kw_args--; } } case 3: if (kw_args > 0) { PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_buffer); if (value) { values[3] = value; kw_args--; } } } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "init") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 80; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } } else { switch (PyTuple_GET_SIZE(__pyx_args)) { case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); case 0: break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_frequency = values[0]; __pyx_v_size = values[1]; __pyx_v_channels = values[2]; __pyx_v_buffer = values[3]; } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("init", 0, 0, 4, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 80; __pyx_clineno = __LINE__; goto __pyx_L3_error;} __pyx_L3_error:; __Pyx_AddTraceback("pygame_sdl2.mixer.init", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_11pygame_sdl2_5mixer_2init(__pyx_self, __pyx_v_frequency, __pyx_v_size, __pyx_v_channels, __pyx_v_buffer); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_5mixer_2init(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_frequency, PyObject *__pyx_v_size, PyObject *__pyx_v_channels, PyObject *__pyx_v_buffer) { PyObject *__pyx_v_flag = NULL; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; int __pyx_t_4; int __pyx_t_5; PyObject *__pyx_t_6 = NULL; PyObject *__pyx_t_7 = NULL; PyObject *__pyx_t_8 = NULL; PyObject *__pyx_t_9 = NULL; Py_ssize_t __pyx_t_10; int __pyx_t_11; int __pyx_t_12; PyObject *(*__pyx_t_13)(PyObject *); Uint16 __pyx_t_14; int __pyx_t_15; int __pyx_t_16; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("init", 0); __Pyx_INCREF(__pyx_v_frequency); __Pyx_INCREF(__pyx_v_size); __Pyx_INCREF(__pyx_v_channels); __Pyx_INCREF(__pyx_v_buffer); /* "pygame_sdl2/mixer.pyx":81 * @pygame_sdl2.register_init * def init(frequency=22050, size=MIX_DEFAULT_FORMAT, channels=2, buffer=4096): * if get_init() is not None: # <<<<<<<<<<<<<< * return * */ __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_get_init); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 81; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = NULL; if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_2))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); if (likely(__pyx_t_3)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); } } if (__pyx_t_3) { __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 81; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } else { __pyx_t_1 = __Pyx_PyObject_CallNoArg(__pyx_t_2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 81; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_4 = (__pyx_t_1 != Py_None); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_5 = (__pyx_t_4 != 0); if (__pyx_t_5) { /* "pygame_sdl2/mixer.pyx":82 * def init(frequency=22050, size=MIX_DEFAULT_FORMAT, channels=2, buffer=4096): * if get_init() is not None: * return # <<<<<<<<<<<<<< * * for flag in (MIX_INIT_FLAC, MIX_INIT_MOD, MIX_INIT_MODPLUG, */ __Pyx_XDECREF(__pyx_r); __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; /* "pygame_sdl2/mixer.pyx":81 * @pygame_sdl2.register_init * def init(frequency=22050, size=MIX_DEFAULT_FORMAT, channels=2, buffer=4096): * if get_init() is not None: # <<<<<<<<<<<<<< * return * */ } /* "pygame_sdl2/mixer.pyx":84 * return * * for flag in (MIX_INIT_FLAC, MIX_INIT_MOD, MIX_INIT_MODPLUG, # <<<<<<<<<<<<<< * MIX_INIT_MP3, MIX_INIT_OGG, MIX_INIT_FLUIDSYNTH): * */ __pyx_t_1 = __Pyx_PyInt_From_MIX_InitFlags(MIX_INIT_FLAC); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 84; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = __Pyx_PyInt_From_MIX_InitFlags(MIX_INIT_MOD); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 84; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = __Pyx_PyInt_From_MIX_InitFlags(MIX_INIT_MODPLUG); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 84; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); /* "pygame_sdl2/mixer.pyx":85 * * for flag in (MIX_INIT_FLAC, MIX_INIT_MOD, MIX_INIT_MODPLUG, * MIX_INIT_MP3, MIX_INIT_OGG, MIX_INIT_FLUIDSYNTH): # <<<<<<<<<<<<<< * * if Mix_Init(flag) != flag: */ __pyx_t_6 = __Pyx_PyInt_From_MIX_InitFlags(MIX_INIT_MP3); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 85; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_6); __pyx_t_7 = __Pyx_PyInt_From_MIX_InitFlags(MIX_INIT_OGG); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 85; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_7); __pyx_t_8 = __Pyx_PyInt_From_MIX_InitFlags(MIX_INIT_FLUIDSYNTH); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 85; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_8); /* "pygame_sdl2/mixer.pyx":84 * return * * for flag in (MIX_INIT_FLAC, MIX_INIT_MOD, MIX_INIT_MODPLUG, # <<<<<<<<<<<<<< * MIX_INIT_MP3, MIX_INIT_OGG, MIX_INIT_FLUIDSYNTH): * */ __pyx_t_9 = PyTuple_New(6); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 84; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_9); __Pyx_GIVEREF(__pyx_t_1); PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_t_1); __Pyx_GIVEREF(__pyx_t_2); PyTuple_SET_ITEM(__pyx_t_9, 1, __pyx_t_2); __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_9, 2, __pyx_t_3); __Pyx_GIVEREF(__pyx_t_6); PyTuple_SET_ITEM(__pyx_t_9, 3, __pyx_t_6); __Pyx_GIVEREF(__pyx_t_7); PyTuple_SET_ITEM(__pyx_t_9, 4, __pyx_t_7); __Pyx_GIVEREF(__pyx_t_8); PyTuple_SET_ITEM(__pyx_t_9, 5, __pyx_t_8); __pyx_t_1 = 0; __pyx_t_2 = 0; __pyx_t_3 = 0; __pyx_t_6 = 0; __pyx_t_7 = 0; __pyx_t_8 = 0; __pyx_t_8 = __pyx_t_9; __Pyx_INCREF(__pyx_t_8); __pyx_t_10 = 0; __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; for (;;) { if (__pyx_t_10 >= 6) break; #if CYTHON_COMPILING_IN_CPYTHON __pyx_t_9 = PyTuple_GET_ITEM(__pyx_t_8, __pyx_t_10); __Pyx_INCREF(__pyx_t_9); __pyx_t_10++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 84; __pyx_clineno = __LINE__; goto __pyx_L1_error;} #else __pyx_t_9 = PySequence_ITEM(__pyx_t_8, __pyx_t_10); __pyx_t_10++; if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 84; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_9); #endif __Pyx_XDECREF_SET(__pyx_v_flag, __pyx_t_9); __pyx_t_9 = 0; /* "pygame_sdl2/mixer.pyx":87 * MIX_INIT_MP3, MIX_INIT_OGG, MIX_INIT_FLUIDSYNTH): * * if Mix_Init(flag) != flag: # <<<<<<<<<<<<<< * errors.append("{}\n".format(SDL_GetError())) * */ __pyx_t_11 = __Pyx_PyInt_As_int(__pyx_v_flag); if (unlikely((__pyx_t_11 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 87; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_t_9 = __Pyx_PyInt_From_int(Mix_Init(__pyx_t_11)); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 87; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_9); __pyx_t_7 = PyObject_RichCompare(__pyx_t_9, __pyx_v_flag, Py_NE); __Pyx_XGOTREF(__pyx_t_7); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 87; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_7); if (unlikely(__pyx_t_5 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 87; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; if (__pyx_t_5) { /* "pygame_sdl2/mixer.pyx":88 * * if Mix_Init(flag) != flag: * errors.append("{}\n".format(SDL_GetError())) # <<<<<<<<<<<<<< * * if preinit_args: */ __pyx_t_7 = __Pyx_GetModuleGlobalName(__pyx_n_s_errors); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 88; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_7); __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_kp_u__4, __pyx_n_s_format); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 88; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_6); __pyx_t_3 = __Pyx_PyBytes_FromString(SDL_GetError()); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 88; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __pyx_t_2 = NULL; if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_6))) { __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_6); if (likely(__pyx_t_2)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6); __Pyx_INCREF(__pyx_t_2); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_6, function); } } if (!__pyx_t_2) { __pyx_t_9 = __Pyx_PyObject_CallOneArg(__pyx_t_6, __pyx_t_3); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 88; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_GOTREF(__pyx_t_9); } else { __pyx_t_1 = PyTuple_New(1+1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 88; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __Pyx_GIVEREF(__pyx_t_2); PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_2); __pyx_t_2 = NULL; __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_1, 0+1, __pyx_t_3); __pyx_t_3 = 0; __pyx_t_9 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_1, NULL); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 88; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_9); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; } __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __pyx_t_12 = __Pyx_PyObject_Append(__pyx_t_7, __pyx_t_9); if (unlikely(__pyx_t_12 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 88; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; /* "pygame_sdl2/mixer.pyx":87 * MIX_INIT_MP3, MIX_INIT_OGG, MIX_INIT_FLUIDSYNTH): * * if Mix_Init(flag) != flag: # <<<<<<<<<<<<<< * errors.append("{}\n".format(SDL_GetError())) * */ } /* "pygame_sdl2/mixer.pyx":84 * return * * for flag in (MIX_INIT_FLAC, MIX_INIT_MOD, MIX_INIT_MODPLUG, # <<<<<<<<<<<<<< * MIX_INIT_MP3, MIX_INIT_OGG, MIX_INIT_FLUIDSYNTH): * */ } __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; /* "pygame_sdl2/mixer.pyx":90 * errors.append("{}\n".format(SDL_GetError())) * * if preinit_args: # <<<<<<<<<<<<<< * frequency, size, channels, buffer = preinit_args * */ __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_v_11pygame_sdl2_5mixer_preinit_args); if (unlikely(__pyx_t_5 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 90; __pyx_clineno = __LINE__; goto __pyx_L1_error;} if (__pyx_t_5) { /* "pygame_sdl2/mixer.pyx":91 * * if preinit_args: * frequency, size, channels, buffer = preinit_args # <<<<<<<<<<<<<< * * if Mix_OpenAudio(frequency, size, channels, buffer) != 0: */ if ((likely(PyTuple_CheckExact(__pyx_v_11pygame_sdl2_5mixer_preinit_args))) || (PyList_CheckExact(__pyx_v_11pygame_sdl2_5mixer_preinit_args))) { PyObject* sequence = __pyx_v_11pygame_sdl2_5mixer_preinit_args; #if CYTHON_COMPILING_IN_CPYTHON Py_ssize_t size = Py_SIZE(sequence); #else Py_ssize_t size = PySequence_Size(sequence); #endif if (unlikely(size != 4)) { if (size > 4) __Pyx_RaiseTooManyValuesError(4); else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 91; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } #if CYTHON_COMPILING_IN_CPYTHON if (likely(PyTuple_CheckExact(sequence))) { __pyx_t_8 = PyTuple_GET_ITEM(sequence, 0); __pyx_t_9 = PyTuple_GET_ITEM(sequence, 1); __pyx_t_7 = PyTuple_GET_ITEM(sequence, 2); __pyx_t_6 = PyTuple_GET_ITEM(sequence, 3); } else { __pyx_t_8 = PyList_GET_ITEM(sequence, 0); __pyx_t_9 = PyList_GET_ITEM(sequence, 1); __pyx_t_7 = PyList_GET_ITEM(sequence, 2); __pyx_t_6 = PyList_GET_ITEM(sequence, 3); } __Pyx_INCREF(__pyx_t_8); __Pyx_INCREF(__pyx_t_9); __Pyx_INCREF(__pyx_t_7); __Pyx_INCREF(__pyx_t_6); #else { Py_ssize_t i; PyObject** temps[4] = {&__pyx_t_8,&__pyx_t_9,&__pyx_t_7,&__pyx_t_6}; for (i=0; i < 4; i++) { PyObject* item = PySequence_ITEM(sequence, i); if (unlikely(!item)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 91; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(item); *(temps[i]) = item; } } #endif } else { Py_ssize_t index = -1; PyObject** temps[4] = {&__pyx_t_8,&__pyx_t_9,&__pyx_t_7,&__pyx_t_6}; __pyx_t_1 = PyObject_GetIter(__pyx_v_11pygame_sdl2_5mixer_preinit_args); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 91; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_t_13 = Py_TYPE(__pyx_t_1)->tp_iternext; for (index=0; index < 4; index++) { PyObject* item = __pyx_t_13(__pyx_t_1); if (unlikely(!item)) goto __pyx_L8_unpacking_failed; __Pyx_GOTREF(item); *(temps[index]) = item; } if (__Pyx_IternextUnpackEndCheck(__pyx_t_13(__pyx_t_1), 4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 91; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_t_13 = NULL; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; goto __pyx_L9_unpacking_done; __pyx_L8_unpacking_failed:; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_13 = NULL; if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 91; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_L9_unpacking_done:; } __Pyx_DECREF_SET(__pyx_v_frequency, __pyx_t_8); __pyx_t_8 = 0; __Pyx_DECREF_SET(__pyx_v_size, __pyx_t_9); __pyx_t_9 = 0; __Pyx_DECREF_SET(__pyx_v_channels, __pyx_t_7); __pyx_t_7 = 0; __Pyx_DECREF_SET(__pyx_v_buffer, __pyx_t_6); __pyx_t_6 = 0; /* "pygame_sdl2/mixer.pyx":90 * errors.append("{}\n".format(SDL_GetError())) * * if preinit_args: # <<<<<<<<<<<<<< * frequency, size, channels, buffer = preinit_args * */ } /* "pygame_sdl2/mixer.pyx":93 * frequency, size, channels, buffer = preinit_args * * if Mix_OpenAudio(frequency, size, channels, buffer) != 0: # <<<<<<<<<<<<<< * raise error() * */ __pyx_t_11 = __Pyx_PyInt_As_int(__pyx_v_frequency); if (unlikely((__pyx_t_11 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 93; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_t_14 = __Pyx_PyInt_As_uint16_t(__pyx_v_size); if (unlikely((__pyx_t_14 == (Uint16)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 93; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_t_15 = __Pyx_PyInt_As_int(__pyx_v_channels); if (unlikely((__pyx_t_15 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 93; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_t_16 = __Pyx_PyInt_As_int(__pyx_v_buffer); if (unlikely((__pyx_t_16 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 93; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_t_5 = ((Mix_OpenAudio(__pyx_t_11, __pyx_t_14, __pyx_t_15, __pyx_t_16) != 0) != 0); if (__pyx_t_5) { /* "pygame_sdl2/mixer.pyx":94 * * if Mix_OpenAudio(frequency, size, channels, buffer) != 0: * raise error() # <<<<<<<<<<<<<< * * global output_spec */ __pyx_t_7 = __Pyx_GetModuleGlobalName(__pyx_n_s_error); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 94; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_7); __pyx_t_9 = NULL; if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_7))) { __pyx_t_9 = PyMethod_GET_SELF(__pyx_t_7); if (likely(__pyx_t_9)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_7); __Pyx_INCREF(__pyx_t_9); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_7, function); } } if (__pyx_t_9) { __pyx_t_6 = __Pyx_PyObject_CallOneArg(__pyx_t_7, __pyx_t_9); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 94; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; } else { __pyx_t_6 = __Pyx_PyObject_CallNoArg(__pyx_t_7); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 94; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_Raise(__pyx_t_6, 0, 0, 0); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; {__pyx_filename = __pyx_f[0]; __pyx_lineno = 94; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "pygame_sdl2/mixer.pyx":93 * frequency, size, channels, buffer = preinit_args * * if Mix_OpenAudio(frequency, size, channels, buffer) != 0: # <<<<<<<<<<<<<< * raise error() * */ } /* "pygame_sdl2/mixer.pyx":97 * * global output_spec * output_spec = get_init() # <<<<<<<<<<<<<< * * Mix_ChannelFinished(channel_callback) */ __pyx_t_7 = __Pyx_GetModuleGlobalName(__pyx_n_s_get_init); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 97; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_7); __pyx_t_9 = NULL; if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_7))) { __pyx_t_9 = PyMethod_GET_SELF(__pyx_t_7); if (likely(__pyx_t_9)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_7); __Pyx_INCREF(__pyx_t_9); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_7, function); } } if (__pyx_t_9) { __pyx_t_6 = __Pyx_PyObject_CallOneArg(__pyx_t_7, __pyx_t_9); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 97; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; } else { __pyx_t_6 = __Pyx_PyObject_CallNoArg(__pyx_t_7); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 97; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_XGOTREF(__pyx_v_11pygame_sdl2_5mixer_output_spec); __Pyx_DECREF_SET(__pyx_v_11pygame_sdl2_5mixer_output_spec, __pyx_t_6); __Pyx_GIVEREF(__pyx_t_6); __pyx_t_6 = 0; /* "pygame_sdl2/mixer.pyx":99 * output_spec = get_init() * * Mix_ChannelFinished(channel_callback) # <<<<<<<<<<<<<< * * def pre_init(frequency=22050, size=MIX_DEFAULT_FORMAT, channels=2, buffersize=4096): */ Mix_ChannelFinished(__pyx_f_11pygame_sdl2_5mixer_channel_callback); /* "pygame_sdl2/mixer.pyx":80 * * @pygame_sdl2.register_init * def init(frequency=22050, size=MIX_DEFAULT_FORMAT, channels=2, buffer=4096): # <<<<<<<<<<<<<< * if get_init() is not None: * return */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_6); __Pyx_XDECREF(__pyx_t_7); __Pyx_XDECREF(__pyx_t_8); __Pyx_XDECREF(__pyx_t_9); __Pyx_AddTraceback("pygame_sdl2.mixer.init", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF(__pyx_v_flag); __Pyx_XDECREF(__pyx_v_frequency); __Pyx_XDECREF(__pyx_v_size); __Pyx_XDECREF(__pyx_v_channels); __Pyx_XDECREF(__pyx_v_buffer); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/mixer.pyx":101 * Mix_ChannelFinished(channel_callback) * * def pre_init(frequency=22050, size=MIX_DEFAULT_FORMAT, channels=2, buffersize=4096): # <<<<<<<<<<<<<< * global preinit_args * preinit_args = (frequency, size, channels, buffersize) */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_5mixer_5pre_init(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static PyMethodDef __pyx_mdef_11pygame_sdl2_5mixer_5pre_init = {"pre_init", (PyCFunction)__pyx_pw_11pygame_sdl2_5mixer_5pre_init, METH_VARARGS|METH_KEYWORDS, 0}; static PyObject *__pyx_pw_11pygame_sdl2_5mixer_5pre_init(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_frequency = 0; PyObject *__pyx_v_size = 0; PyObject *__pyx_v_channels = 0; PyObject *__pyx_v_buffersize = 0; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("pre_init (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_frequency,&__pyx_n_s_size,&__pyx_n_s_channels,&__pyx_n_s_buffersize,0}; PyObject* values[4] = {0,0,0,0}; values[0] = ((PyObject *)__pyx_int_22050); values[1] = __pyx_k__5; values[2] = ((PyObject *)__pyx_int_2); values[3] = ((PyObject *)__pyx_int_4096); if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (kw_args > 0) { PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_frequency); if (value) { values[0] = value; kw_args--; } } case 1: if (kw_args > 0) { PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_size); if (value) { values[1] = value; kw_args--; } } case 2: if (kw_args > 0) { PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_channels); if (value) { values[2] = value; kw_args--; } } case 3: if (kw_args > 0) { PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_buffersize); if (value) { values[3] = value; kw_args--; } } } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "pre_init") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 101; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } } else { switch (PyTuple_GET_SIZE(__pyx_args)) { case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); case 0: break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_frequency = values[0]; __pyx_v_size = values[1]; __pyx_v_channels = values[2]; __pyx_v_buffersize = values[3]; } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("pre_init", 0, 0, 4, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 101; __pyx_clineno = __LINE__; goto __pyx_L3_error;} __pyx_L3_error:; __Pyx_AddTraceback("pygame_sdl2.mixer.pre_init", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_11pygame_sdl2_5mixer_4pre_init(__pyx_self, __pyx_v_frequency, __pyx_v_size, __pyx_v_channels, __pyx_v_buffersize); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_5mixer_4pre_init(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_frequency, PyObject *__pyx_v_size, PyObject *__pyx_v_channels, PyObject *__pyx_v_buffersize) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("pre_init", 0); /* "pygame_sdl2/mixer.pyx":103 * def pre_init(frequency=22050, size=MIX_DEFAULT_FORMAT, channels=2, buffersize=4096): * global preinit_args * preinit_args = (frequency, size, channels, buffersize) # <<<<<<<<<<<<<< * * @pygame_sdl2.register_quit */ __pyx_t_1 = PyTuple_New(4); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 103; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __Pyx_INCREF(__pyx_v_frequency); __Pyx_GIVEREF(__pyx_v_frequency); PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_frequency); __Pyx_INCREF(__pyx_v_size); __Pyx_GIVEREF(__pyx_v_size); PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_v_size); __Pyx_INCREF(__pyx_v_channels); __Pyx_GIVEREF(__pyx_v_channels); PyTuple_SET_ITEM(__pyx_t_1, 2, __pyx_v_channels); __Pyx_INCREF(__pyx_v_buffersize); __Pyx_GIVEREF(__pyx_v_buffersize); PyTuple_SET_ITEM(__pyx_t_1, 3, __pyx_v_buffersize); __Pyx_XGOTREF(__pyx_v_11pygame_sdl2_5mixer_preinit_args); __Pyx_DECREF_SET(__pyx_v_11pygame_sdl2_5mixer_preinit_args, __pyx_t_1); __Pyx_GIVEREF(__pyx_t_1); __pyx_t_1 = 0; /* "pygame_sdl2/mixer.pyx":101 * Mix_ChannelFinished(channel_callback) * * def pre_init(frequency=22050, size=MIX_DEFAULT_FORMAT, channels=2, buffersize=4096): # <<<<<<<<<<<<<< * global preinit_args * preinit_args = (frequency, size, channels, buffersize) */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("pygame_sdl2.mixer.pre_init", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/mixer.pyx":106 * * @pygame_sdl2.register_quit * def quit(): # @ReservedAssignment # <<<<<<<<<<<<<< * Mix_CloseAudio() * Mix_Quit() */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_5mixer_7quit(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused); /*proto*/ static PyMethodDef __pyx_mdef_11pygame_sdl2_5mixer_7quit = {"quit", (PyCFunction)__pyx_pw_11pygame_sdl2_5mixer_7quit, METH_NOARGS, 0}; static PyObject *__pyx_pw_11pygame_sdl2_5mixer_7quit(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("quit (wrapper)", 0); __pyx_r = __pyx_pf_11pygame_sdl2_5mixer_6quit(__pyx_self); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_5mixer_6quit(CYTHON_UNUSED PyObject *__pyx_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("quit", 0); /* "pygame_sdl2/mixer.pyx":107 * @pygame_sdl2.register_quit * def quit(): # @ReservedAssignment * Mix_CloseAudio() # <<<<<<<<<<<<<< * Mix_Quit() * */ Mix_CloseAudio(); /* "pygame_sdl2/mixer.pyx":108 * def quit(): # @ReservedAssignment * Mix_CloseAudio() * Mix_Quit() # <<<<<<<<<<<<<< * * def get_init(): */ Mix_Quit(); /* "pygame_sdl2/mixer.pyx":106 * * @pygame_sdl2.register_quit * def quit(): # @ReservedAssignment # <<<<<<<<<<<<<< * Mix_CloseAudio() * Mix_Quit() */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/mixer.pyx":110 * Mix_Quit() * * def get_init(): # <<<<<<<<<<<<<< * cdef int frequency * cdef Uint16 format */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_5mixer_9get_init(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused); /*proto*/ static PyMethodDef __pyx_mdef_11pygame_sdl2_5mixer_9get_init = {"get_init", (PyCFunction)__pyx_pw_11pygame_sdl2_5mixer_9get_init, METH_NOARGS, 0}; static PyObject *__pyx_pw_11pygame_sdl2_5mixer_9get_init(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("get_init (wrapper)", 0); __pyx_r = __pyx_pf_11pygame_sdl2_5mixer_8get_init(__pyx_self); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_5mixer_8get_init(CYTHON_UNUSED PyObject *__pyx_self) { int __pyx_v_frequency; Uint16 __pyx_v_format; int __pyx_v_channels; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; PyObject *__pyx_t_5 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("get_init", 0); /* "pygame_sdl2/mixer.pyx":115 * cdef int channels * * if Mix_QuerySpec(&frequency, &format, &channels) == 0: # <<<<<<<<<<<<<< * return None * else: */ __pyx_t_1 = ((Mix_QuerySpec((&__pyx_v_frequency), (&__pyx_v_format), (&__pyx_v_channels)) == 0) != 0); if (__pyx_t_1) { /* "pygame_sdl2/mixer.pyx":116 * * if Mix_QuerySpec(&frequency, &format, &channels) == 0: * return None # <<<<<<<<<<<<<< * else: * return frequency, format, channels */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(Py_None); __pyx_r = Py_None; goto __pyx_L0; /* "pygame_sdl2/mixer.pyx":115 * cdef int channels * * if Mix_QuerySpec(&frequency, &format, &channels) == 0: # <<<<<<<<<<<<<< * return None * else: */ } /* "pygame_sdl2/mixer.pyx":118 * return None * else: * return frequency, format, channels # <<<<<<<<<<<<<< * * def stop(): */ /*else*/ { __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_v_frequency); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 118; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = __Pyx_PyInt_From_uint16_t(__pyx_v_format); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 118; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = __Pyx_PyInt_From_int(__pyx_v_channels); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 118; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); __pyx_t_5 = PyTuple_New(3); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 118; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); __Pyx_GIVEREF(__pyx_t_2); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_2); __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_t_3); __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_5, 2, __pyx_t_4); __pyx_t_2 = 0; __pyx_t_3 = 0; __pyx_t_4 = 0; __pyx_r = __pyx_t_5; __pyx_t_5 = 0; goto __pyx_L0; } /* "pygame_sdl2/mixer.pyx":110 * Mix_Quit() * * def get_init(): # <<<<<<<<<<<<<< * cdef int frequency * cdef Uint16 format */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_5); __Pyx_AddTraceback("pygame_sdl2.mixer.get_init", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/mixer.pyx":120 * return frequency, format, channels * * def stop(): # <<<<<<<<<<<<<< * with nogil: * Mix_HaltChannel(-1) */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_5mixer_11stop(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused); /*proto*/ static PyMethodDef __pyx_mdef_11pygame_sdl2_5mixer_11stop = {"stop", (PyCFunction)__pyx_pw_11pygame_sdl2_5mixer_11stop, METH_NOARGS, 0}; static PyObject *__pyx_pw_11pygame_sdl2_5mixer_11stop(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("stop (wrapper)", 0); __pyx_r = __pyx_pf_11pygame_sdl2_5mixer_10stop(__pyx_self); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_5mixer_10stop(CYTHON_UNUSED PyObject *__pyx_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("stop", 0); /* "pygame_sdl2/mixer.pyx":121 * * def stop(): * with nogil: # <<<<<<<<<<<<<< * Mix_HaltChannel(-1) * */ { #ifdef WITH_THREAD PyThreadState *_save; Py_UNBLOCK_THREADS #endif /*try:*/ { /* "pygame_sdl2/mixer.pyx":122 * def stop(): * with nogil: * Mix_HaltChannel(-1) # <<<<<<<<<<<<<< * * def pause(): */ Mix_HaltChannel(-1); } /* "pygame_sdl2/mixer.pyx":121 * * def stop(): * with nogil: # <<<<<<<<<<<<<< * Mix_HaltChannel(-1) * */ /*finally:*/ { /*normal exit:*/{ #ifdef WITH_THREAD Py_BLOCK_THREADS #endif goto __pyx_L5; } __pyx_L5:; } } /* "pygame_sdl2/mixer.pyx":120 * return frequency, format, channels * * def stop(): # <<<<<<<<<<<<<< * with nogil: * Mix_HaltChannel(-1) */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/mixer.pyx":124 * Mix_HaltChannel(-1) * * def pause(): # <<<<<<<<<<<<<< * with nogil: * Mix_Pause(-1) */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_5mixer_13pause(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused); /*proto*/ static PyMethodDef __pyx_mdef_11pygame_sdl2_5mixer_13pause = {"pause", (PyCFunction)__pyx_pw_11pygame_sdl2_5mixer_13pause, METH_NOARGS, 0}; static PyObject *__pyx_pw_11pygame_sdl2_5mixer_13pause(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("pause (wrapper)", 0); __pyx_r = __pyx_pf_11pygame_sdl2_5mixer_12pause(__pyx_self); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_5mixer_12pause(CYTHON_UNUSED PyObject *__pyx_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("pause", 0); /* "pygame_sdl2/mixer.pyx":125 * * def pause(): * with nogil: # <<<<<<<<<<<<<< * Mix_Pause(-1) * */ { #ifdef WITH_THREAD PyThreadState *_save; Py_UNBLOCK_THREADS #endif /*try:*/ { /* "pygame_sdl2/mixer.pyx":126 * def pause(): * with nogil: * Mix_Pause(-1) # <<<<<<<<<<<<<< * * def unpause(): */ Mix_Pause(-1); } /* "pygame_sdl2/mixer.pyx":125 * * def pause(): * with nogil: # <<<<<<<<<<<<<< * Mix_Pause(-1) * */ /*finally:*/ { /*normal exit:*/{ #ifdef WITH_THREAD Py_BLOCK_THREADS #endif goto __pyx_L5; } __pyx_L5:; } } /* "pygame_sdl2/mixer.pyx":124 * Mix_HaltChannel(-1) * * def pause(): # <<<<<<<<<<<<<< * with nogil: * Mix_Pause(-1) */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/mixer.pyx":128 * Mix_Pause(-1) * * def unpause(): # <<<<<<<<<<<<<< * with nogil: * Mix_Resume(-1) */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_5mixer_15unpause(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused); /*proto*/ static PyMethodDef __pyx_mdef_11pygame_sdl2_5mixer_15unpause = {"unpause", (PyCFunction)__pyx_pw_11pygame_sdl2_5mixer_15unpause, METH_NOARGS, 0}; static PyObject *__pyx_pw_11pygame_sdl2_5mixer_15unpause(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("unpause (wrapper)", 0); __pyx_r = __pyx_pf_11pygame_sdl2_5mixer_14unpause(__pyx_self); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_5mixer_14unpause(CYTHON_UNUSED PyObject *__pyx_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("unpause", 0); /* "pygame_sdl2/mixer.pyx":129 * * def unpause(): * with nogil: # <<<<<<<<<<<<<< * Mix_Resume(-1) * */ { #ifdef WITH_THREAD PyThreadState *_save; Py_UNBLOCK_THREADS #endif /*try:*/ { /* "pygame_sdl2/mixer.pyx":130 * def unpause(): * with nogil: * Mix_Resume(-1) # <<<<<<<<<<<<<< * * def fadeout(time): */ Mix_Resume(-1); } /* "pygame_sdl2/mixer.pyx":129 * * def unpause(): * with nogil: # <<<<<<<<<<<<<< * Mix_Resume(-1) * */ /*finally:*/ { /*normal exit:*/{ #ifdef WITH_THREAD Py_BLOCK_THREADS #endif goto __pyx_L5; } __pyx_L5:; } } /* "pygame_sdl2/mixer.pyx":128 * Mix_Pause(-1) * * def unpause(): # <<<<<<<<<<<<<< * with nogil: * Mix_Resume(-1) */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/mixer.pyx":132 * Mix_Resume(-1) * * def fadeout(time): # <<<<<<<<<<<<<< * cdef int ms = time * with nogil: */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_5mixer_17fadeout(PyObject *__pyx_self, PyObject *__pyx_v_time); /*proto*/ static PyMethodDef __pyx_mdef_11pygame_sdl2_5mixer_17fadeout = {"fadeout", (PyCFunction)__pyx_pw_11pygame_sdl2_5mixer_17fadeout, METH_O, 0}; static PyObject *__pyx_pw_11pygame_sdl2_5mixer_17fadeout(PyObject *__pyx_self, PyObject *__pyx_v_time) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("fadeout (wrapper)", 0); __pyx_r = __pyx_pf_11pygame_sdl2_5mixer_16fadeout(__pyx_self, ((PyObject *)__pyx_v_time)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_5mixer_16fadeout(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_time) { int __pyx_v_ms; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("fadeout", 0); /* "pygame_sdl2/mixer.pyx":133 * * def fadeout(time): * cdef int ms = time # <<<<<<<<<<<<<< * with nogil: * Mix_FadeOutChannel(-1, ms) */ __pyx_t_1 = __Pyx_PyInt_As_int(__pyx_v_time); if (unlikely((__pyx_t_1 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 133; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_v_ms = __pyx_t_1; /* "pygame_sdl2/mixer.pyx":134 * def fadeout(time): * cdef int ms = time * with nogil: # <<<<<<<<<<<<<< * Mix_FadeOutChannel(-1, ms) * */ { #ifdef WITH_THREAD PyThreadState *_save; Py_UNBLOCK_THREADS #endif /*try:*/ { /* "pygame_sdl2/mixer.pyx":135 * cdef int ms = time * with nogil: * Mix_FadeOutChannel(-1, ms) # <<<<<<<<<<<<<< * * def set_num_channels(count): */ Mix_FadeOutChannel(-1, __pyx_v_ms); } /* "pygame_sdl2/mixer.pyx":134 * def fadeout(time): * cdef int ms = time * with nogil: # <<<<<<<<<<<<<< * Mix_FadeOutChannel(-1, ms) * */ /*finally:*/ { /*normal exit:*/{ #ifdef WITH_THREAD Py_BLOCK_THREADS #endif goto __pyx_L5; } __pyx_L5:; } } /* "pygame_sdl2/mixer.pyx":132 * Mix_Resume(-1) * * def fadeout(time): # <<<<<<<<<<<<<< * cdef int ms = time * with nogil: */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("pygame_sdl2.mixer.fadeout", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/mixer.pyx":137 * Mix_FadeOutChannel(-1, ms) * * def set_num_channels(count): # <<<<<<<<<<<<<< * Mix_AllocateChannels(count) * */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_5mixer_19set_num_channels(PyObject *__pyx_self, PyObject *__pyx_v_count); /*proto*/ static PyMethodDef __pyx_mdef_11pygame_sdl2_5mixer_19set_num_channels = {"set_num_channels", (PyCFunction)__pyx_pw_11pygame_sdl2_5mixer_19set_num_channels, METH_O, 0}; static PyObject *__pyx_pw_11pygame_sdl2_5mixer_19set_num_channels(PyObject *__pyx_self, PyObject *__pyx_v_count) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("set_num_channels (wrapper)", 0); __pyx_r = __pyx_pf_11pygame_sdl2_5mixer_18set_num_channels(__pyx_self, ((PyObject *)__pyx_v_count)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_5mixer_18set_num_channels(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_count) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("set_num_channels", 0); /* "pygame_sdl2/mixer.pyx":138 * * def set_num_channels(count): * Mix_AllocateChannels(count) # <<<<<<<<<<<<<< * * def get_num_channels(): */ __pyx_t_1 = __Pyx_PyInt_As_int(__pyx_v_count); if (unlikely((__pyx_t_1 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 138; __pyx_clineno = __LINE__; goto __pyx_L1_error;} Mix_AllocateChannels(__pyx_t_1); /* "pygame_sdl2/mixer.pyx":137 * Mix_FadeOutChannel(-1, ms) * * def set_num_channels(count): # <<<<<<<<<<<<<< * Mix_AllocateChannels(count) * */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("pygame_sdl2.mixer.set_num_channels", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/mixer.pyx":140 * Mix_AllocateChannels(count) * * def get_num_channels(): # <<<<<<<<<<<<<< * return Mix_AllocateChannels(-1) * */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_5mixer_21get_num_channels(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused); /*proto*/ static PyMethodDef __pyx_mdef_11pygame_sdl2_5mixer_21get_num_channels = {"get_num_channels", (PyCFunction)__pyx_pw_11pygame_sdl2_5mixer_21get_num_channels, METH_NOARGS, 0}; static PyObject *__pyx_pw_11pygame_sdl2_5mixer_21get_num_channels(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("get_num_channels (wrapper)", 0); __pyx_r = __pyx_pf_11pygame_sdl2_5mixer_20get_num_channels(__pyx_self); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_5mixer_20get_num_channels(CYTHON_UNUSED PyObject *__pyx_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("get_num_channels", 0); /* "pygame_sdl2/mixer.pyx":141 * * def get_num_channels(): * return Mix_AllocateChannels(-1) # <<<<<<<<<<<<<< * * def set_reserved(count): */ __Pyx_XDECREF(__pyx_r); __pyx_t_1 = __Pyx_PyInt_From_int(Mix_AllocateChannels(-1)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 141; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "pygame_sdl2/mixer.pyx":140 * Mix_AllocateChannels(count) * * def get_num_channels(): # <<<<<<<<<<<<<< * return Mix_AllocateChannels(-1) * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("pygame_sdl2.mixer.get_num_channels", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/mixer.pyx":143 * return Mix_AllocateChannels(-1) * * def set_reserved(count): # <<<<<<<<<<<<<< * Mix_ReserveChannels(count) * */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_5mixer_23set_reserved(PyObject *__pyx_self, PyObject *__pyx_v_count); /*proto*/ static PyMethodDef __pyx_mdef_11pygame_sdl2_5mixer_23set_reserved = {"set_reserved", (PyCFunction)__pyx_pw_11pygame_sdl2_5mixer_23set_reserved, METH_O, 0}; static PyObject *__pyx_pw_11pygame_sdl2_5mixer_23set_reserved(PyObject *__pyx_self, PyObject *__pyx_v_count) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("set_reserved (wrapper)", 0); __pyx_r = __pyx_pf_11pygame_sdl2_5mixer_22set_reserved(__pyx_self, ((PyObject *)__pyx_v_count)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_5mixer_22set_reserved(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_count) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("set_reserved", 0); /* "pygame_sdl2/mixer.pyx":144 * * def set_reserved(count): * Mix_ReserveChannels(count) # <<<<<<<<<<<<<< * * def find_channel(force=False): */ __pyx_t_1 = __Pyx_PyInt_As_int(__pyx_v_count); if (unlikely((__pyx_t_1 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 144; __pyx_clineno = __LINE__; goto __pyx_L1_error;} Mix_ReserveChannels(__pyx_t_1); /* "pygame_sdl2/mixer.pyx":143 * return Mix_AllocateChannels(-1) * * def set_reserved(count): # <<<<<<<<<<<<<< * Mix_ReserveChannels(count) * */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("pygame_sdl2.mixer.set_reserved", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/mixer.pyx":146 * Mix_ReserveChannels(count) * * def find_channel(force=False): # <<<<<<<<<<<<<< * cdef int chan * chan = Mix_GroupAvailable(-1) */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_5mixer_25find_channel(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static PyMethodDef __pyx_mdef_11pygame_sdl2_5mixer_25find_channel = {"find_channel", (PyCFunction)__pyx_pw_11pygame_sdl2_5mixer_25find_channel, METH_VARARGS|METH_KEYWORDS, 0}; static PyObject *__pyx_pw_11pygame_sdl2_5mixer_25find_channel(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_force = 0; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("find_channel (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_force,0}; PyObject* values[1] = {0}; values[0] = ((PyObject *)Py_False); if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (kw_args > 0) { PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_force); if (value) { values[0] = value; kw_args--; } } } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "find_channel") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 146; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } } else { switch (PyTuple_GET_SIZE(__pyx_args)) { case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); case 0: break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_force = values[0]; } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("find_channel", 0, 0, 1, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 146; __pyx_clineno = __LINE__; goto __pyx_L3_error;} __pyx_L3_error:; __Pyx_AddTraceback("pygame_sdl2.mixer.find_channel", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_11pygame_sdl2_5mixer_24find_channel(__pyx_self, __pyx_v_force); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_5mixer_24find_channel(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_force) { int __pyx_v_chan; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; int __pyx_t_2; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; PyObject *__pyx_t_5 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("find_channel", 0); /* "pygame_sdl2/mixer.pyx":148 * def find_channel(force=False): * cdef int chan * chan = Mix_GroupAvailable(-1) # <<<<<<<<<<<<<< * if chan == -1: * if not force: */ __pyx_v_chan = Mix_GroupAvailable(-1); /* "pygame_sdl2/mixer.pyx":149 * cdef int chan * chan = Mix_GroupAvailable(-1) * if chan == -1: # <<<<<<<<<<<<<< * if not force: * return None */ __pyx_t_1 = ((__pyx_v_chan == -1L) != 0); if (__pyx_t_1) { /* "pygame_sdl2/mixer.pyx":150 * chan = Mix_GroupAvailable(-1) * if chan == -1: * if not force: # <<<<<<<<<<<<<< * return None * chan = Mix_GroupOldest(-1) */ __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_force); if (unlikely(__pyx_t_1 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 150; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_t_2 = ((!__pyx_t_1) != 0); if (__pyx_t_2) { /* "pygame_sdl2/mixer.pyx":151 * if chan == -1: * if not force: * return None # <<<<<<<<<<<<<< * chan = Mix_GroupOldest(-1) * if chan == -1: */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(Py_None); __pyx_r = Py_None; goto __pyx_L0; /* "pygame_sdl2/mixer.pyx":150 * chan = Mix_GroupAvailable(-1) * if chan == -1: * if not force: # <<<<<<<<<<<<<< * return None * chan = Mix_GroupOldest(-1) */ } /* "pygame_sdl2/mixer.pyx":152 * if not force: * return None * chan = Mix_GroupOldest(-1) # <<<<<<<<<<<<<< * if chan == -1: * raise error() */ __pyx_v_chan = Mix_GroupOldest(-1); /* "pygame_sdl2/mixer.pyx":153 * return None * chan = Mix_GroupOldest(-1) * if chan == -1: # <<<<<<<<<<<<<< * raise error() * return Channel(chan) */ __pyx_t_2 = ((__pyx_v_chan == -1L) != 0); if (__pyx_t_2) { /* "pygame_sdl2/mixer.pyx":154 * chan = Mix_GroupOldest(-1) * if chan == -1: * raise error() # <<<<<<<<<<<<<< * return Channel(chan) * */ __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_error); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 154; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); __pyx_t_5 = NULL; if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_4))) { __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4); if (likely(__pyx_t_5)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4); __Pyx_INCREF(__pyx_t_5); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_4, function); } } if (__pyx_t_5) { __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_5); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 154; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; } else { __pyx_t_3 = __Pyx_PyObject_CallNoArg(__pyx_t_4); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 154; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_Raise(__pyx_t_3, 0, 0, 0); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; {__pyx_filename = __pyx_f[0]; __pyx_lineno = 154; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "pygame_sdl2/mixer.pyx":153 * return None * chan = Mix_GroupOldest(-1) * if chan == -1: # <<<<<<<<<<<<<< * raise error() * return Channel(chan) */ } /* "pygame_sdl2/mixer.pyx":149 * cdef int chan * chan = Mix_GroupAvailable(-1) * if chan == -1: # <<<<<<<<<<<<<< * if not force: * return None */ } /* "pygame_sdl2/mixer.pyx":155 * if chan == -1: * raise error() * return Channel(chan) # <<<<<<<<<<<<<< * * def get_busy(): */ __Pyx_XDECREF(__pyx_r); __pyx_t_3 = __Pyx_PyInt_From_int(__pyx_v_chan); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 155; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 155; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_3); __pyx_t_3 = 0; __pyx_t_3 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_11pygame_sdl2_5mixer_Channel), __pyx_t_4, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 155; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_r = __pyx_t_3; __pyx_t_3 = 0; goto __pyx_L0; /* "pygame_sdl2/mixer.pyx":146 * Mix_ReserveChannels(count) * * def find_channel(force=False): # <<<<<<<<<<<<<< * cdef int chan * chan = Mix_GroupAvailable(-1) */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_5); __Pyx_AddTraceback("pygame_sdl2.mixer.find_channel", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/mixer.pyx":157 * return Channel(chan) * * def get_busy(): # <<<<<<<<<<<<<< * return Mix_GroupNewer(-1) != -1 * */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_5mixer_27get_busy(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused); /*proto*/ static PyMethodDef __pyx_mdef_11pygame_sdl2_5mixer_27get_busy = {"get_busy", (PyCFunction)__pyx_pw_11pygame_sdl2_5mixer_27get_busy, METH_NOARGS, 0}; static PyObject *__pyx_pw_11pygame_sdl2_5mixer_27get_busy(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("get_busy (wrapper)", 0); __pyx_r = __pyx_pf_11pygame_sdl2_5mixer_26get_busy(__pyx_self); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_5mixer_26get_busy(CYTHON_UNUSED PyObject *__pyx_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("get_busy", 0); /* "pygame_sdl2/mixer.pyx":158 * * def get_busy(): * return Mix_GroupNewer(-1) != -1 # <<<<<<<<<<<<<< * * */ __Pyx_XDECREF(__pyx_r); __pyx_t_1 = __Pyx_PyBool_FromLong((Mix_GroupNewer(-1) != -1L)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 158; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "pygame_sdl2/mixer.pyx":157 * return Channel(chan) * * def get_busy(): # <<<<<<<<<<<<<< * return Mix_GroupNewer(-1) != -1 * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("pygame_sdl2.mixer.get_busy", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/mixer.pyx":164 * cdef Mix_Chunk *chunk * * def __cinit__(self): # <<<<<<<<<<<<<< * self.chunk = NULL * */ /* Python wrapper */ static int __pyx_pw_11pygame_sdl2_5mixer_5Sound_1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static int __pyx_pw_11pygame_sdl2_5mixer_5Sound_1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__cinit__ (wrapper)", 0); if (unlikely(PyTuple_GET_SIZE(__pyx_args) > 0)) { __Pyx_RaiseArgtupleInvalid("__cinit__", 1, 0, 0, PyTuple_GET_SIZE(__pyx_args)); return -1;} if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "__cinit__", 0))) return -1; __pyx_r = __pyx_pf_11pygame_sdl2_5mixer_5Sound___cinit__(((struct __pyx_obj_11pygame_sdl2_5mixer_Sound *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static int __pyx_pf_11pygame_sdl2_5mixer_5Sound___cinit__(struct __pyx_obj_11pygame_sdl2_5mixer_Sound *__pyx_v_self) { int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__cinit__", 0); /* "pygame_sdl2/mixer.pyx":165 * * def __cinit__(self): * self.chunk = NULL # <<<<<<<<<<<<<< * * def __dealloc__(self): */ __pyx_v_self->chunk = NULL; /* "pygame_sdl2/mixer.pyx":164 * cdef Mix_Chunk *chunk * * def __cinit__(self): # <<<<<<<<<<<<<< * self.chunk = NULL * */ /* function exit code */ __pyx_r = 0; __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/mixer.pyx":167 * self.chunk = NULL * * def __dealloc__(self): # <<<<<<<<<<<<<< * if self.chunk: * Mix_FreeChunk(self.chunk) */ /* Python wrapper */ static void __pyx_pw_11pygame_sdl2_5mixer_5Sound_3__dealloc__(PyObject *__pyx_v_self); /*proto*/ static void __pyx_pw_11pygame_sdl2_5mixer_5Sound_3__dealloc__(PyObject *__pyx_v_self) { __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__dealloc__ (wrapper)", 0); __pyx_pf_11pygame_sdl2_5mixer_5Sound_2__dealloc__(((struct __pyx_obj_11pygame_sdl2_5mixer_Sound *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); } static void __pyx_pf_11pygame_sdl2_5mixer_5Sound_2__dealloc__(struct __pyx_obj_11pygame_sdl2_5mixer_Sound *__pyx_v_self) { __Pyx_RefNannyDeclarations int __pyx_t_1; __Pyx_RefNannySetupContext("__dealloc__", 0); /* "pygame_sdl2/mixer.pyx":168 * * def __dealloc__(self): * if self.chunk: # <<<<<<<<<<<<<< * Mix_FreeChunk(self.chunk) * */ __pyx_t_1 = (__pyx_v_self->chunk != 0); if (__pyx_t_1) { /* "pygame_sdl2/mixer.pyx":169 * def __dealloc__(self): * if self.chunk: * Mix_FreeChunk(self.chunk) # <<<<<<<<<<<<<< * * def __init__(self, fi): */ Mix_FreeChunk(__pyx_v_self->chunk); /* "pygame_sdl2/mixer.pyx":168 * * def __dealloc__(self): * if self.chunk: # <<<<<<<<<<<<<< * Mix_FreeChunk(self.chunk) * */ } /* "pygame_sdl2/mixer.pyx":167 * self.chunk = NULL * * def __dealloc__(self): # <<<<<<<<<<<<<< * if self.chunk: * Mix_FreeChunk(self.chunk) */ /* function exit code */ __Pyx_RefNannyFinishContext(); } /* "pygame_sdl2/mixer.pyx":171 * Mix_FreeChunk(self.chunk) * * def __init__(self, fi): # <<<<<<<<<<<<<< * self.chunk = Mix_LoadWAV_RW(to_rwops(fi), 1) * if self.chunk == NULL: */ /* Python wrapper */ static int __pyx_pw_11pygame_sdl2_5mixer_5Sound_5__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static int __pyx_pw_11pygame_sdl2_5mixer_5Sound_5__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_fi = 0; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__init__ (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_fi,0}; PyObject* values[1] = {0}; if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_fi)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__init__") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 171; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } } else if (PyTuple_GET_SIZE(__pyx_args) != 1) { goto __pyx_L5_argtuple_error; } else { values[0] = PyTuple_GET_ITEM(__pyx_args, 0); } __pyx_v_fi = values[0]; } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("__init__", 1, 1, 1, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 171; __pyx_clineno = __LINE__; goto __pyx_L3_error;} __pyx_L3_error:; __Pyx_AddTraceback("pygame_sdl2.mixer.Sound.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return -1; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_11pygame_sdl2_5mixer_5Sound_4__init__(((struct __pyx_obj_11pygame_sdl2_5mixer_Sound *)__pyx_v_self), __pyx_v_fi); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static int __pyx_pf_11pygame_sdl2_5mixer_5Sound_4__init__(struct __pyx_obj_11pygame_sdl2_5mixer_Sound *__pyx_v_self, PyObject *__pyx_v_fi) { int __pyx_r; __Pyx_RefNannyDeclarations SDL_RWops *__pyx_t_1; int __pyx_t_2; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; PyObject *__pyx_t_5 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__init__", 0); /* "pygame_sdl2/mixer.pyx":172 * * def __init__(self, fi): * self.chunk = Mix_LoadWAV_RW(to_rwops(fi), 1) # <<<<<<<<<<<<<< * if self.chunk == NULL: * raise error() */ __pyx_t_1 = __pyx_f_11pygame_sdl2_8rwobject_to_rwops(__pyx_v_fi, NULL); if (unlikely(__pyx_t_1 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 172; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_v_self->chunk = Mix_LoadWAV_RW(__pyx_t_1, 1); /* "pygame_sdl2/mixer.pyx":173 * def __init__(self, fi): * self.chunk = Mix_LoadWAV_RW(to_rwops(fi), 1) * if self.chunk == NULL: # <<<<<<<<<<<<<< * raise error() * */ __pyx_t_2 = ((__pyx_v_self->chunk == NULL) != 0); if (__pyx_t_2) { /* "pygame_sdl2/mixer.pyx":174 * self.chunk = Mix_LoadWAV_RW(to_rwops(fi), 1) * if self.chunk == NULL: * raise error() # <<<<<<<<<<<<<< * * def play(self, loops=0, maxtime=-1, fade_ms=0): */ __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_error); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 174; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); __pyx_t_5 = NULL; if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_4))) { __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4); if (likely(__pyx_t_5)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4); __Pyx_INCREF(__pyx_t_5); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_4, function); } } if (__pyx_t_5) { __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_5); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 174; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; } else { __pyx_t_3 = __Pyx_PyObject_CallNoArg(__pyx_t_4); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 174; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_Raise(__pyx_t_3, 0, 0, 0); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; {__pyx_filename = __pyx_f[0]; __pyx_lineno = 174; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "pygame_sdl2/mixer.pyx":173 * def __init__(self, fi): * self.chunk = Mix_LoadWAV_RW(to_rwops(fi), 1) * if self.chunk == NULL: # <<<<<<<<<<<<<< * raise error() * */ } /* "pygame_sdl2/mixer.pyx":171 * Mix_FreeChunk(self.chunk) * * def __init__(self, fi): # <<<<<<<<<<<<<< * self.chunk = Mix_LoadWAV_RW(to_rwops(fi), 1) * if self.chunk == NULL: */ /* function exit code */ __pyx_r = 0; goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_5); __Pyx_AddTraceback("pygame_sdl2.mixer.Sound.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = -1; __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/mixer.pyx":176 * raise error() * * def play(self, loops=0, maxtime=-1, fade_ms=0): # <<<<<<<<<<<<<< * cdef int cid * cdef int _loops = loops */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_5mixer_5Sound_7play(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static PyObject *__pyx_pw_11pygame_sdl2_5mixer_5Sound_7play(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_loops = 0; PyObject *__pyx_v_maxtime = 0; PyObject *__pyx_v_fade_ms = 0; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("play (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_loops,&__pyx_n_s_maxtime,&__pyx_n_s_fade_ms,0}; PyObject* values[3] = {0,0,0}; values[0] = ((PyObject *)__pyx_int_0); values[1] = ((PyObject *)__pyx_int_neg_1); values[2] = ((PyObject *)__pyx_int_0); if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (kw_args > 0) { PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_loops); if (value) { values[0] = value; kw_args--; } } case 1: if (kw_args > 0) { PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_maxtime); if (value) { values[1] = value; kw_args--; } } case 2: if (kw_args > 0) { PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_fade_ms); if (value) { values[2] = value; kw_args--; } } } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "play") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 176; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } } else { switch (PyTuple_GET_SIZE(__pyx_args)) { case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); case 0: break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_loops = values[0]; __pyx_v_maxtime = values[1]; __pyx_v_fade_ms = values[2]; } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("play", 0, 0, 3, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 176; __pyx_clineno = __LINE__; goto __pyx_L3_error;} __pyx_L3_error:; __Pyx_AddTraceback("pygame_sdl2.mixer.Sound.play", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_11pygame_sdl2_5mixer_5Sound_6play(((struct __pyx_obj_11pygame_sdl2_5mixer_Sound *)__pyx_v_self), __pyx_v_loops, __pyx_v_maxtime, __pyx_v_fade_ms); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_5mixer_5Sound_6play(struct __pyx_obj_11pygame_sdl2_5mixer_Sound *__pyx_v_self, PyObject *__pyx_v_loops, PyObject *__pyx_v_maxtime, PyObject *__pyx_v_fade_ms) { int __pyx_v_cid; int __pyx_v__loops; int __pyx_v__maxtime; int __pyx_v__fade_ms; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; int __pyx_t_2; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; PyObject *__pyx_t_5 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("play", 0); /* "pygame_sdl2/mixer.pyx":178 * def play(self, loops=0, maxtime=-1, fade_ms=0): * cdef int cid * cdef int _loops = loops # <<<<<<<<<<<<<< * cdef int _maxtime = maxtime * cdef int _fade_ms = fade_ms */ __pyx_t_1 = __Pyx_PyInt_As_int(__pyx_v_loops); if (unlikely((__pyx_t_1 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 178; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_v__loops = __pyx_t_1; /* "pygame_sdl2/mixer.pyx":179 * cdef int cid * cdef int _loops = loops * cdef int _maxtime = maxtime # <<<<<<<<<<<<<< * cdef int _fade_ms = fade_ms * */ __pyx_t_1 = __Pyx_PyInt_As_int(__pyx_v_maxtime); if (unlikely((__pyx_t_1 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 179; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_v__maxtime = __pyx_t_1; /* "pygame_sdl2/mixer.pyx":180 * cdef int _loops = loops * cdef int _maxtime = maxtime * cdef int _fade_ms = fade_ms # <<<<<<<<<<<<<< * * with nogil: */ __pyx_t_1 = __Pyx_PyInt_As_int(__pyx_v_fade_ms); if (unlikely((__pyx_t_1 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 180; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_v__fade_ms = __pyx_t_1; /* "pygame_sdl2/mixer.pyx":182 * cdef int _fade_ms = fade_ms * * with nogil: # <<<<<<<<<<<<<< * if _fade_ms != 0: * cid = Mix_FadeInChannelTimed(-1, self.chunk, _loops, _fade_ms, _maxtime) */ { #ifdef WITH_THREAD PyThreadState *_save; Py_UNBLOCK_THREADS #endif /*try:*/ { /* "pygame_sdl2/mixer.pyx":183 * * with nogil: * if _fade_ms != 0: # <<<<<<<<<<<<<< * cid = Mix_FadeInChannelTimed(-1, self.chunk, _loops, _fade_ms, _maxtime) * else: */ __pyx_t_2 = ((__pyx_v__fade_ms != 0) != 0); if (__pyx_t_2) { /* "pygame_sdl2/mixer.pyx":184 * with nogil: * if _fade_ms != 0: * cid = Mix_FadeInChannelTimed(-1, self.chunk, _loops, _fade_ms, _maxtime) # <<<<<<<<<<<<<< * else: * cid = Mix_PlayChannelTimed(-1, self.chunk, _loops, _maxtime) */ __pyx_v_cid = Mix_FadeInChannelTimed(-1, __pyx_v_self->chunk, __pyx_v__loops, __pyx_v__fade_ms, __pyx_v__maxtime); /* "pygame_sdl2/mixer.pyx":183 * * with nogil: * if _fade_ms != 0: # <<<<<<<<<<<<<< * cid = Mix_FadeInChannelTimed(-1, self.chunk, _loops, _fade_ms, _maxtime) * else: */ goto __pyx_L6; } /* "pygame_sdl2/mixer.pyx":186 * cid = Mix_FadeInChannelTimed(-1, self.chunk, _loops, _fade_ms, _maxtime) * else: * cid = Mix_PlayChannelTimed(-1, self.chunk, _loops, _maxtime) # <<<<<<<<<<<<<< * * if cid == -1: */ /*else*/ { __pyx_v_cid = Mix_PlayChannelTimed(-1, __pyx_v_self->chunk, __pyx_v__loops, __pyx_v__maxtime); } __pyx_L6:; } /* "pygame_sdl2/mixer.pyx":182 * cdef int _fade_ms = fade_ms * * with nogil: # <<<<<<<<<<<<<< * if _fade_ms != 0: * cid = Mix_FadeInChannelTimed(-1, self.chunk, _loops, _fade_ms, _maxtime) */ /*finally:*/ { /*normal exit:*/{ #ifdef WITH_THREAD Py_BLOCK_THREADS #endif goto __pyx_L5; } __pyx_L5:; } } /* "pygame_sdl2/mixer.pyx":188 * cid = Mix_PlayChannelTimed(-1, self.chunk, _loops, _maxtime) * * if cid == -1: # <<<<<<<<<<<<<< * raise error() * return Channel(cid) */ __pyx_t_2 = ((__pyx_v_cid == -1L) != 0); if (__pyx_t_2) { /* "pygame_sdl2/mixer.pyx":189 * * if cid == -1: * raise error() # <<<<<<<<<<<<<< * return Channel(cid) * */ __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_error); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 189; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); __pyx_t_5 = NULL; if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_4))) { __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4); if (likely(__pyx_t_5)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4); __Pyx_INCREF(__pyx_t_5); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_4, function); } } if (__pyx_t_5) { __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_5); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 189; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; } else { __pyx_t_3 = __Pyx_PyObject_CallNoArg(__pyx_t_4); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 189; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_Raise(__pyx_t_3, 0, 0, 0); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; {__pyx_filename = __pyx_f[0]; __pyx_lineno = 189; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "pygame_sdl2/mixer.pyx":188 * cid = Mix_PlayChannelTimed(-1, self.chunk, _loops, _maxtime) * * if cid == -1: # <<<<<<<<<<<<<< * raise error() * return Channel(cid) */ } /* "pygame_sdl2/mixer.pyx":190 * if cid == -1: * raise error() * return Channel(cid) # <<<<<<<<<<<<<< * * def stop(self): */ __Pyx_XDECREF(__pyx_r); __pyx_t_3 = __Pyx_PyInt_From_int(__pyx_v_cid); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 190; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 190; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_3); __pyx_t_3 = 0; __pyx_t_3 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_11pygame_sdl2_5mixer_Channel), __pyx_t_4, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 190; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_r = __pyx_t_3; __pyx_t_3 = 0; goto __pyx_L0; /* "pygame_sdl2/mixer.pyx":176 * raise error() * * def play(self, loops=0, maxtime=-1, fade_ms=0): # <<<<<<<<<<<<<< * cdef int cid * cdef int _loops = loops */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_5); __Pyx_AddTraceback("pygame_sdl2.mixer.Sound.play", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/mixer.pyx":192 * return Channel(cid) * * def stop(self): # <<<<<<<<<<<<<< * cdef int i = 0 * while i < Mix_AllocateChannels(-1): */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_5mixer_5Sound_9stop(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/ static PyObject *__pyx_pw_11pygame_sdl2_5mixer_5Sound_9stop(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("stop (wrapper)", 0); __pyx_r = __pyx_pf_11pygame_sdl2_5mixer_5Sound_8stop(((struct __pyx_obj_11pygame_sdl2_5mixer_Sound *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_5mixer_5Sound_8stop(struct __pyx_obj_11pygame_sdl2_5mixer_Sound *__pyx_v_self) { int __pyx_v_i; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; __Pyx_RefNannySetupContext("stop", 0); /* "pygame_sdl2/mixer.pyx":193 * * def stop(self): * cdef int i = 0 # <<<<<<<<<<<<<< * while i < Mix_AllocateChannels(-1): * if Mix_GetChunk(i) == self.chunk: */ __pyx_v_i = 0; /* "pygame_sdl2/mixer.pyx":194 * def stop(self): * cdef int i = 0 * while i < Mix_AllocateChannels(-1): # <<<<<<<<<<<<<< * if Mix_GetChunk(i) == self.chunk: * with nogil: */ while (1) { __pyx_t_1 = ((__pyx_v_i < Mix_AllocateChannels(-1)) != 0); if (!__pyx_t_1) break; /* "pygame_sdl2/mixer.pyx":195 * cdef int i = 0 * while i < Mix_AllocateChannels(-1): * if Mix_GetChunk(i) == self.chunk: # <<<<<<<<<<<<<< * with nogil: * Mix_HaltChannel(i) */ __pyx_t_1 = ((Mix_GetChunk(__pyx_v_i) == __pyx_v_self->chunk) != 0); if (__pyx_t_1) { /* "pygame_sdl2/mixer.pyx":196 * while i < Mix_AllocateChannels(-1): * if Mix_GetChunk(i) == self.chunk: * with nogil: # <<<<<<<<<<<<<< * Mix_HaltChannel(i) * i += 1 */ { #ifdef WITH_THREAD PyThreadState *_save; Py_UNBLOCK_THREADS #endif /*try:*/ { /* "pygame_sdl2/mixer.pyx":197 * if Mix_GetChunk(i) == self.chunk: * with nogil: * Mix_HaltChannel(i) # <<<<<<<<<<<<<< * i += 1 * */ Mix_HaltChannel(__pyx_v_i); } /* "pygame_sdl2/mixer.pyx":196 * while i < Mix_AllocateChannels(-1): * if Mix_GetChunk(i) == self.chunk: * with nogil: # <<<<<<<<<<<<<< * Mix_HaltChannel(i) * i += 1 */ /*finally:*/ { /*normal exit:*/{ #ifdef WITH_THREAD Py_BLOCK_THREADS #endif goto __pyx_L10; } __pyx_L10:; } } /* "pygame_sdl2/mixer.pyx":195 * cdef int i = 0 * while i < Mix_AllocateChannels(-1): * if Mix_GetChunk(i) == self.chunk: # <<<<<<<<<<<<<< * with nogil: * Mix_HaltChannel(i) */ } /* "pygame_sdl2/mixer.pyx":198 * with nogil: * Mix_HaltChannel(i) * i += 1 # <<<<<<<<<<<<<< * * def pause(self): */ __pyx_v_i = (__pyx_v_i + 1); } /* "pygame_sdl2/mixer.pyx":192 * return Channel(cid) * * def stop(self): # <<<<<<<<<<<<<< * cdef int i = 0 * while i < Mix_AllocateChannels(-1): */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/mixer.pyx":200 * i += 1 * * def pause(self): # <<<<<<<<<<<<<< * cdef int i = 0 * while i < Mix_AllocateChannels(-1): */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_5mixer_5Sound_11pause(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/ static PyObject *__pyx_pw_11pygame_sdl2_5mixer_5Sound_11pause(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("pause (wrapper)", 0); __pyx_r = __pyx_pf_11pygame_sdl2_5mixer_5Sound_10pause(((struct __pyx_obj_11pygame_sdl2_5mixer_Sound *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_5mixer_5Sound_10pause(struct __pyx_obj_11pygame_sdl2_5mixer_Sound *__pyx_v_self) { int __pyx_v_i; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; __Pyx_RefNannySetupContext("pause", 0); /* "pygame_sdl2/mixer.pyx":201 * * def pause(self): * cdef int i = 0 # <<<<<<<<<<<<<< * while i < Mix_AllocateChannels(-1): * if Mix_GetChunk(i) == self.chunk: */ __pyx_v_i = 0; /* "pygame_sdl2/mixer.pyx":202 * def pause(self): * cdef int i = 0 * while i < Mix_AllocateChannels(-1): # <<<<<<<<<<<<<< * if Mix_GetChunk(i) == self.chunk: * with nogil: */ while (1) { __pyx_t_1 = ((__pyx_v_i < Mix_AllocateChannels(-1)) != 0); if (!__pyx_t_1) break; /* "pygame_sdl2/mixer.pyx":203 * cdef int i = 0 * while i < Mix_AllocateChannels(-1): * if Mix_GetChunk(i) == self.chunk: # <<<<<<<<<<<<<< * with nogil: * Mix_Pause(i) */ __pyx_t_1 = ((Mix_GetChunk(__pyx_v_i) == __pyx_v_self->chunk) != 0); if (__pyx_t_1) { /* "pygame_sdl2/mixer.pyx":204 * while i < Mix_AllocateChannels(-1): * if Mix_GetChunk(i) == self.chunk: * with nogil: # <<<<<<<<<<<<<< * Mix_Pause(i) * i += 1 */ { #ifdef WITH_THREAD PyThreadState *_save; Py_UNBLOCK_THREADS #endif /*try:*/ { /* "pygame_sdl2/mixer.pyx":205 * if Mix_GetChunk(i) == self.chunk: * with nogil: * Mix_Pause(i) # <<<<<<<<<<<<<< * i += 1 * */ Mix_Pause(__pyx_v_i); } /* "pygame_sdl2/mixer.pyx":204 * while i < Mix_AllocateChannels(-1): * if Mix_GetChunk(i) == self.chunk: * with nogil: # <<<<<<<<<<<<<< * Mix_Pause(i) * i += 1 */ /*finally:*/ { /*normal exit:*/{ #ifdef WITH_THREAD Py_BLOCK_THREADS #endif goto __pyx_L10; } __pyx_L10:; } } /* "pygame_sdl2/mixer.pyx":203 * cdef int i = 0 * while i < Mix_AllocateChannels(-1): * if Mix_GetChunk(i) == self.chunk: # <<<<<<<<<<<<<< * with nogil: * Mix_Pause(i) */ } /* "pygame_sdl2/mixer.pyx":206 * with nogil: * Mix_Pause(i) * i += 1 # <<<<<<<<<<<<<< * * def unpause(self): */ __pyx_v_i = (__pyx_v_i + 1); } /* "pygame_sdl2/mixer.pyx":200 * i += 1 * * def pause(self): # <<<<<<<<<<<<<< * cdef int i = 0 * while i < Mix_AllocateChannels(-1): */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/mixer.pyx":208 * i += 1 * * def unpause(self): # <<<<<<<<<<<<<< * cdef int i = 0 * while i < Mix_AllocateChannels(-1): */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_5mixer_5Sound_13unpause(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/ static PyObject *__pyx_pw_11pygame_sdl2_5mixer_5Sound_13unpause(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("unpause (wrapper)", 0); __pyx_r = __pyx_pf_11pygame_sdl2_5mixer_5Sound_12unpause(((struct __pyx_obj_11pygame_sdl2_5mixer_Sound *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_5mixer_5Sound_12unpause(struct __pyx_obj_11pygame_sdl2_5mixer_Sound *__pyx_v_self) { int __pyx_v_i; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; __Pyx_RefNannySetupContext("unpause", 0); /* "pygame_sdl2/mixer.pyx":209 * * def unpause(self): * cdef int i = 0 # <<<<<<<<<<<<<< * while i < Mix_AllocateChannels(-1): * if Mix_GetChunk(i) == self.chunk: */ __pyx_v_i = 0; /* "pygame_sdl2/mixer.pyx":210 * def unpause(self): * cdef int i = 0 * while i < Mix_AllocateChannels(-1): # <<<<<<<<<<<<<< * if Mix_GetChunk(i) == self.chunk: * with nogil: */ while (1) { __pyx_t_1 = ((__pyx_v_i < Mix_AllocateChannels(-1)) != 0); if (!__pyx_t_1) break; /* "pygame_sdl2/mixer.pyx":211 * cdef int i = 0 * while i < Mix_AllocateChannels(-1): * if Mix_GetChunk(i) == self.chunk: # <<<<<<<<<<<<<< * with nogil: * Mix_Resume(i) */ __pyx_t_1 = ((Mix_GetChunk(__pyx_v_i) == __pyx_v_self->chunk) != 0); if (__pyx_t_1) { /* "pygame_sdl2/mixer.pyx":212 * while i < Mix_AllocateChannels(-1): * if Mix_GetChunk(i) == self.chunk: * with nogil: # <<<<<<<<<<<<<< * Mix_Resume(i) * i += 1 */ { #ifdef WITH_THREAD PyThreadState *_save; Py_UNBLOCK_THREADS #endif /*try:*/ { /* "pygame_sdl2/mixer.pyx":213 * if Mix_GetChunk(i) == self.chunk: * with nogil: * Mix_Resume(i) # <<<<<<<<<<<<<< * i += 1 * */ Mix_Resume(__pyx_v_i); } /* "pygame_sdl2/mixer.pyx":212 * while i < Mix_AllocateChannels(-1): * if Mix_GetChunk(i) == self.chunk: * with nogil: # <<<<<<<<<<<<<< * Mix_Resume(i) * i += 1 */ /*finally:*/ { /*normal exit:*/{ #ifdef WITH_THREAD Py_BLOCK_THREADS #endif goto __pyx_L10; } __pyx_L10:; } } /* "pygame_sdl2/mixer.pyx":211 * cdef int i = 0 * while i < Mix_AllocateChannels(-1): * if Mix_GetChunk(i) == self.chunk: # <<<<<<<<<<<<<< * with nogil: * Mix_Resume(i) */ } /* "pygame_sdl2/mixer.pyx":214 * with nogil: * Mix_Resume(i) * i += 1 # <<<<<<<<<<<<<< * * def fadeout(self, time): */ __pyx_v_i = (__pyx_v_i + 1); } /* "pygame_sdl2/mixer.pyx":208 * i += 1 * * def unpause(self): # <<<<<<<<<<<<<< * cdef int i = 0 * while i < Mix_AllocateChannels(-1): */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/mixer.pyx":216 * i += 1 * * def fadeout(self, time): # <<<<<<<<<<<<<< * cdef int i = 0 * cdef int ms = time */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_5mixer_5Sound_15fadeout(PyObject *__pyx_v_self, PyObject *__pyx_v_time); /*proto*/ static PyObject *__pyx_pw_11pygame_sdl2_5mixer_5Sound_15fadeout(PyObject *__pyx_v_self, PyObject *__pyx_v_time) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("fadeout (wrapper)", 0); __pyx_r = __pyx_pf_11pygame_sdl2_5mixer_5Sound_14fadeout(((struct __pyx_obj_11pygame_sdl2_5mixer_Sound *)__pyx_v_self), ((PyObject *)__pyx_v_time)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_5mixer_5Sound_14fadeout(struct __pyx_obj_11pygame_sdl2_5mixer_Sound *__pyx_v_self, PyObject *__pyx_v_time) { int __pyx_v_i; int __pyx_v_ms; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; int __pyx_t_2; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("fadeout", 0); /* "pygame_sdl2/mixer.pyx":217 * * def fadeout(self, time): * cdef int i = 0 # <<<<<<<<<<<<<< * cdef int ms = time * while i < Mix_AllocateChannels(-1): */ __pyx_v_i = 0; /* "pygame_sdl2/mixer.pyx":218 * def fadeout(self, time): * cdef int i = 0 * cdef int ms = time # <<<<<<<<<<<<<< * while i < Mix_AllocateChannels(-1): * if Mix_GetChunk(i) == self.chunk: */ __pyx_t_1 = __Pyx_PyInt_As_int(__pyx_v_time); if (unlikely((__pyx_t_1 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 218; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_v_ms = __pyx_t_1; /* "pygame_sdl2/mixer.pyx":219 * cdef int i = 0 * cdef int ms = time * while i < Mix_AllocateChannels(-1): # <<<<<<<<<<<<<< * if Mix_GetChunk(i) == self.chunk: * with nogil: */ while (1) { __pyx_t_2 = ((__pyx_v_i < Mix_AllocateChannels(-1)) != 0); if (!__pyx_t_2) break; /* "pygame_sdl2/mixer.pyx":220 * cdef int ms = time * while i < Mix_AllocateChannels(-1): * if Mix_GetChunk(i) == self.chunk: # <<<<<<<<<<<<<< * with nogil: * Mix_FadeOutChannel(i, ms) */ __pyx_t_2 = ((Mix_GetChunk(__pyx_v_i) == __pyx_v_self->chunk) != 0); if (__pyx_t_2) { /* "pygame_sdl2/mixer.pyx":221 * while i < Mix_AllocateChannels(-1): * if Mix_GetChunk(i) == self.chunk: * with nogil: # <<<<<<<<<<<<<< * Mix_FadeOutChannel(i, ms) * i += 1 */ { #ifdef WITH_THREAD PyThreadState *_save; Py_UNBLOCK_THREADS #endif /*try:*/ { /* "pygame_sdl2/mixer.pyx":222 * if Mix_GetChunk(i) == self.chunk: * with nogil: * Mix_FadeOutChannel(i, ms) # <<<<<<<<<<<<<< * i += 1 * */ Mix_FadeOutChannel(__pyx_v_i, __pyx_v_ms); } /* "pygame_sdl2/mixer.pyx":221 * while i < Mix_AllocateChannels(-1): * if Mix_GetChunk(i) == self.chunk: * with nogil: # <<<<<<<<<<<<<< * Mix_FadeOutChannel(i, ms) * i += 1 */ /*finally:*/ { /*normal exit:*/{ #ifdef WITH_THREAD Py_BLOCK_THREADS #endif goto __pyx_L10; } __pyx_L10:; } } /* "pygame_sdl2/mixer.pyx":220 * cdef int ms = time * while i < Mix_AllocateChannels(-1): * if Mix_GetChunk(i) == self.chunk: # <<<<<<<<<<<<<< * with nogil: * Mix_FadeOutChannel(i, ms) */ } /* "pygame_sdl2/mixer.pyx":223 * with nogil: * Mix_FadeOutChannel(i, ms) * i += 1 # <<<<<<<<<<<<<< * * def set_volume(self, value): */ __pyx_v_i = (__pyx_v_i + 1); } /* "pygame_sdl2/mixer.pyx":216 * i += 1 * * def fadeout(self, time): # <<<<<<<<<<<<<< * cdef int i = 0 * cdef int ms = time */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("pygame_sdl2.mixer.Sound.fadeout", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/mixer.pyx":225 * i += 1 * * def set_volume(self, value): # <<<<<<<<<<<<<< * Mix_VolumeChunk(self.chunk, MIX_MAX_VOLUME * value) * */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_5mixer_5Sound_17set_volume(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/ static PyObject *__pyx_pw_11pygame_sdl2_5mixer_5Sound_17set_volume(PyObject *__pyx_v_self, PyObject *__pyx_v_value) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("set_volume (wrapper)", 0); __pyx_r = __pyx_pf_11pygame_sdl2_5mixer_5Sound_16set_volume(((struct __pyx_obj_11pygame_sdl2_5mixer_Sound *)__pyx_v_self), ((PyObject *)__pyx_v_value)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_5mixer_5Sound_16set_volume(struct __pyx_obj_11pygame_sdl2_5mixer_Sound *__pyx_v_self, PyObject *__pyx_v_value) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; int __pyx_t_3; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("set_volume", 0); /* "pygame_sdl2/mixer.pyx":226 * * def set_volume(self, value): * Mix_VolumeChunk(self.chunk, MIX_MAX_VOLUME * value) # <<<<<<<<<<<<<< * * def get_volume(self): */ __pyx_t_1 = __Pyx_PyInt_From_int(MIX_MAX_VOLUME); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 226; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = PyNumber_Multiply(__pyx_t_1, __pyx_v_value); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 226; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_3 = __Pyx_PyInt_As_int(__pyx_t_2); if (unlikely((__pyx_t_3 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 226; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; Mix_VolumeChunk(__pyx_v_self->chunk, __pyx_t_3); /* "pygame_sdl2/mixer.pyx":225 * i += 1 * * def set_volume(self, value): # <<<<<<<<<<<<<< * Mix_VolumeChunk(self.chunk, MIX_MAX_VOLUME * value) * */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_AddTraceback("pygame_sdl2.mixer.Sound.set_volume", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/mixer.pyx":228 * Mix_VolumeChunk(self.chunk, MIX_MAX_VOLUME * value) * * def get_volume(self): # <<<<<<<<<<<<<< * return Mix_VolumeChunk(self.chunk, -1) * */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_5mixer_5Sound_19get_volume(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/ static PyObject *__pyx_pw_11pygame_sdl2_5mixer_5Sound_19get_volume(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("get_volume (wrapper)", 0); __pyx_r = __pyx_pf_11pygame_sdl2_5mixer_5Sound_18get_volume(((struct __pyx_obj_11pygame_sdl2_5mixer_Sound *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_5mixer_5Sound_18get_volume(struct __pyx_obj_11pygame_sdl2_5mixer_Sound *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("get_volume", 0); /* "pygame_sdl2/mixer.pyx":229 * * def get_volume(self): * return Mix_VolumeChunk(self.chunk, -1) # <<<<<<<<<<<<<< * * def get_num_channels(self): */ __Pyx_XDECREF(__pyx_r); __pyx_t_1 = __Pyx_PyInt_From_int(Mix_VolumeChunk(__pyx_v_self->chunk, -1)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 229; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "pygame_sdl2/mixer.pyx":228 * Mix_VolumeChunk(self.chunk, MIX_MAX_VOLUME * value) * * def get_volume(self): # <<<<<<<<<<<<<< * return Mix_VolumeChunk(self.chunk, -1) * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("pygame_sdl2.mixer.Sound.get_volume", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/mixer.pyx":231 * return Mix_VolumeChunk(self.chunk, -1) * * def get_num_channels(self): # <<<<<<<<<<<<<< * cdef int i = 0 * cdef int n = 0 */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_5mixer_5Sound_21get_num_channels(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/ static PyObject *__pyx_pw_11pygame_sdl2_5mixer_5Sound_21get_num_channels(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("get_num_channels (wrapper)", 0); __pyx_r = __pyx_pf_11pygame_sdl2_5mixer_5Sound_20get_num_channels(((struct __pyx_obj_11pygame_sdl2_5mixer_Sound *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_5mixer_5Sound_20get_num_channels(struct __pyx_obj_11pygame_sdl2_5mixer_Sound *__pyx_v_self) { int __pyx_v_i; int __pyx_v_n; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; PyObject *__pyx_t_2 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("get_num_channels", 0); /* "pygame_sdl2/mixer.pyx":232 * * def get_num_channels(self): * cdef int i = 0 # <<<<<<<<<<<<<< * cdef int n = 0 * while i < Mix_AllocateChannels(-1): */ __pyx_v_i = 0; /* "pygame_sdl2/mixer.pyx":233 * def get_num_channels(self): * cdef int i = 0 * cdef int n = 0 # <<<<<<<<<<<<<< * while i < Mix_AllocateChannels(-1): * if Mix_GetChunk(i) == self.chunk: */ __pyx_v_n = 0; /* "pygame_sdl2/mixer.pyx":234 * cdef int i = 0 * cdef int n = 0 * while i < Mix_AllocateChannels(-1): # <<<<<<<<<<<<<< * if Mix_GetChunk(i) == self.chunk: * n += 1 */ while (1) { __pyx_t_1 = ((__pyx_v_i < Mix_AllocateChannels(-1)) != 0); if (!__pyx_t_1) break; /* "pygame_sdl2/mixer.pyx":235 * cdef int n = 0 * while i < Mix_AllocateChannels(-1): * if Mix_GetChunk(i) == self.chunk: # <<<<<<<<<<<<<< * n += 1 * i += 1 */ __pyx_t_1 = ((Mix_GetChunk(__pyx_v_i) == __pyx_v_self->chunk) != 0); if (__pyx_t_1) { /* "pygame_sdl2/mixer.pyx":236 * while i < Mix_AllocateChannels(-1): * if Mix_GetChunk(i) == self.chunk: * n += 1 # <<<<<<<<<<<<<< * i += 1 * return n */ __pyx_v_n = (__pyx_v_n + 1); /* "pygame_sdl2/mixer.pyx":235 * cdef int n = 0 * while i < Mix_AllocateChannels(-1): * if Mix_GetChunk(i) == self.chunk: # <<<<<<<<<<<<<< * n += 1 * i += 1 */ } /* "pygame_sdl2/mixer.pyx":237 * if Mix_GetChunk(i) == self.chunk: * n += 1 * i += 1 # <<<<<<<<<<<<<< * return n * */ __pyx_v_i = (__pyx_v_i + 1); } /* "pygame_sdl2/mixer.pyx":238 * n += 1 * i += 1 * return n # <<<<<<<<<<<<<< * * def get_length(self): */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_v_n); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 238; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; /* "pygame_sdl2/mixer.pyx":231 * return Mix_VolumeChunk(self.chunk, -1) * * def get_num_channels(self): # <<<<<<<<<<<<<< * cdef int i = 0 * cdef int n = 0 */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_AddTraceback("pygame_sdl2.mixer.Sound.get_num_channels", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/mixer.pyx":240 * return n * * def get_length(self): # <<<<<<<<<<<<<< * # TODO: Adjust for actual format, rather than assuming 16-bit. * return self.chunk.alen / output_spec[0] / 2 / output_spec[2] */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_5mixer_5Sound_23get_length(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/ static PyObject *__pyx_pw_11pygame_sdl2_5mixer_5Sound_23get_length(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("get_length (wrapper)", 0); __pyx_r = __pyx_pf_11pygame_sdl2_5mixer_5Sound_22get_length(((struct __pyx_obj_11pygame_sdl2_5mixer_Sound *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_5mixer_5Sound_22get_length(struct __pyx_obj_11pygame_sdl2_5mixer_Sound *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("get_length", 0); /* "pygame_sdl2/mixer.pyx":242 * def get_length(self): * # TODO: Adjust for actual format, rather than assuming 16-bit. * return self.chunk.alen / output_spec[0] / 2 / output_spec[2] # <<<<<<<<<<<<<< * * def get_raw(self): */ __Pyx_XDECREF(__pyx_r); __pyx_t_1 = PyFloat_FromDouble(((double)__pyx_v_self->chunk->alen)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 242; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = __Pyx_GetItemInt(__pyx_v_11pygame_sdl2_5mixer_output_spec, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(__pyx_t_2 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 242; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = __Pyx_PyNumber_Divide(__pyx_t_1, __pyx_t_2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 242; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_2 = __Pyx_PyInt_TrueDivideObjC(__pyx_t_3, __pyx_int_2, 2, 0); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 242; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_3 = __Pyx_GetItemInt(__pyx_v_11pygame_sdl2_5mixer_output_spec, 2, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(__pyx_t_3 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 242; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; __Pyx_GOTREF(__pyx_t_3); __pyx_t_1 = __Pyx_PyNumber_Divide(__pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 242; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "pygame_sdl2/mixer.pyx":240 * return n * * def get_length(self): # <<<<<<<<<<<<<< * # TODO: Adjust for actual format, rather than assuming 16-bit. * return self.chunk.alen / output_spec[0] / 2 / output_spec[2] */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("pygame_sdl2.mixer.Sound.get_length", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/mixer.pyx":244 * return self.chunk.alen / output_spec[0] / 2 / output_spec[2] * * def get_raw(self): # <<<<<<<<<<<<<< * # return self.chunk.abuf * raise error("Not implemented.") */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_5mixer_5Sound_25get_raw(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/ static PyObject *__pyx_pw_11pygame_sdl2_5mixer_5Sound_25get_raw(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("get_raw (wrapper)", 0); __pyx_r = __pyx_pf_11pygame_sdl2_5mixer_5Sound_24get_raw(((struct __pyx_obj_11pygame_sdl2_5mixer_Sound *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_5mixer_5Sound_24get_raw(CYTHON_UNUSED struct __pyx_obj_11pygame_sdl2_5mixer_Sound *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("get_raw", 0); /* "pygame_sdl2/mixer.pyx":246 * def get_raw(self): * # return self.chunk.abuf * raise error("Not implemented.") # <<<<<<<<<<<<<< * * */ __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_error); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 246; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_tuple__6, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 246; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_Raise(__pyx_t_2, 0, 0, 0); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; {__pyx_filename = __pyx_f[0]; __pyx_lineno = 246; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "pygame_sdl2/mixer.pyx":244 * return self.chunk.alen / output_spec[0] / 2 / output_spec[2] * * def get_raw(self): # <<<<<<<<<<<<<< * # return self.chunk.abuf * raise error("Not implemented.") */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_AddTraceback("pygame_sdl2.mixer.Sound.get_raw", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/mixer.pyx":252 * cdef int cid * * def __init__(self, cid): # <<<<<<<<<<<<<< * self.cid = cid * */ /* Python wrapper */ static int __pyx_pw_11pygame_sdl2_5mixer_7Channel_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static int __pyx_pw_11pygame_sdl2_5mixer_7Channel_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_cid = 0; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__init__ (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_cid,0}; PyObject* values[1] = {0}; if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_cid)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__init__") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 252; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } } else if (PyTuple_GET_SIZE(__pyx_args) != 1) { goto __pyx_L5_argtuple_error; } else { values[0] = PyTuple_GET_ITEM(__pyx_args, 0); } __pyx_v_cid = values[0]; } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("__init__", 1, 1, 1, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 252; __pyx_clineno = __LINE__; goto __pyx_L3_error;} __pyx_L3_error:; __Pyx_AddTraceback("pygame_sdl2.mixer.Channel.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return -1; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_11pygame_sdl2_5mixer_7Channel___init__(((struct __pyx_obj_11pygame_sdl2_5mixer_Channel *)__pyx_v_self), __pyx_v_cid); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static int __pyx_pf_11pygame_sdl2_5mixer_7Channel___init__(struct __pyx_obj_11pygame_sdl2_5mixer_Channel *__pyx_v_self, PyObject *__pyx_v_cid) { int __pyx_r; __Pyx_RefNannyDeclarations int __pyx_t_1; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__init__", 0); /* "pygame_sdl2/mixer.pyx":253 * * def __init__(self, cid): * self.cid = cid # <<<<<<<<<<<<<< * * def play(self, Sound sound not None, loops=0, maxtime=-1, fade_ms=0): */ __pyx_t_1 = __Pyx_PyInt_As_int(__pyx_v_cid); if (unlikely((__pyx_t_1 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 253; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_v_self->cid = __pyx_t_1; /* "pygame_sdl2/mixer.pyx":252 * cdef int cid * * def __init__(self, cid): # <<<<<<<<<<<<<< * self.cid = cid * */ /* function exit code */ __pyx_r = 0; goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("pygame_sdl2.mixer.Channel.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = -1; __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/mixer.pyx":255 * self.cid = cid * * def play(self, Sound sound not None, loops=0, maxtime=-1, fade_ms=0): # <<<<<<<<<<<<<< * cdef int _loops = loops * cdef int _maxtime = maxtime */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_5mixer_7Channel_3play(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static PyObject *__pyx_pw_11pygame_sdl2_5mixer_7Channel_3play(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { struct __pyx_obj_11pygame_sdl2_5mixer_Sound *__pyx_v_sound = 0; PyObject *__pyx_v_loops = 0; PyObject *__pyx_v_maxtime = 0; PyObject *__pyx_v_fade_ms = 0; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("play (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_sound,&__pyx_n_s_loops,&__pyx_n_s_maxtime,&__pyx_n_s_fade_ms,0}; PyObject* values[4] = {0,0,0,0}; values[1] = ((PyObject *)__pyx_int_0); values[2] = ((PyObject *)__pyx_int_neg_1); values[3] = ((PyObject *)__pyx_int_0); if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_sound)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; case 1: if (kw_args > 0) { PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_loops); if (value) { values[1] = value; kw_args--; } } case 2: if (kw_args > 0) { PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_maxtime); if (value) { values[2] = value; kw_args--; } } case 3: if (kw_args > 0) { PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_fade_ms); if (value) { values[3] = value; kw_args--; } } } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "play") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 255; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } } else { switch (PyTuple_GET_SIZE(__pyx_args)) { case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_sound = ((struct __pyx_obj_11pygame_sdl2_5mixer_Sound *)values[0]); __pyx_v_loops = values[1]; __pyx_v_maxtime = values[2]; __pyx_v_fade_ms = values[3]; } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("play", 0, 1, 4, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 255; __pyx_clineno = __LINE__; goto __pyx_L3_error;} __pyx_L3_error:; __Pyx_AddTraceback("pygame_sdl2.mixer.Channel.play", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_sound), __pyx_ptype_11pygame_sdl2_5mixer_Sound, 0, "sound", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 255; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_r = __pyx_pf_11pygame_sdl2_5mixer_7Channel_2play(((struct __pyx_obj_11pygame_sdl2_5mixer_Channel *)__pyx_v_self), __pyx_v_sound, __pyx_v_loops, __pyx_v_maxtime, __pyx_v_fade_ms); /* function exit code */ goto __pyx_L0; __pyx_L1_error:; __pyx_r = NULL; __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_5mixer_7Channel_2play(struct __pyx_obj_11pygame_sdl2_5mixer_Channel *__pyx_v_self, struct __pyx_obj_11pygame_sdl2_5mixer_Sound *__pyx_v_sound, PyObject *__pyx_v_loops, PyObject *__pyx_v_maxtime, PyObject *__pyx_v_fade_ms) { int __pyx_v__loops; int __pyx_v__maxtime; int __pyx_v__fade_ms; int __pyx_v_cid; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; int __pyx_t_2; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; PyObject *__pyx_t_5 = NULL; PyObject *__pyx_t_6 = NULL; PyObject *__pyx_t_7 = NULL; PyObject *__pyx_t_8 = NULL; PyObject *__pyx_t_9 = NULL; PyObject *__pyx_t_10 = NULL; PyObject *__pyx_t_11 = NULL; int __pyx_t_12; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("play", 0); /* "pygame_sdl2/mixer.pyx":256 * * def play(self, Sound sound not None, loops=0, maxtime=-1, fade_ms=0): * cdef int _loops = loops # <<<<<<<<<<<<<< * cdef int _maxtime = maxtime * cdef int _fade_ms = fade_ms */ __pyx_t_1 = __Pyx_PyInt_As_int(__pyx_v_loops); if (unlikely((__pyx_t_1 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 256; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_v__loops = __pyx_t_1; /* "pygame_sdl2/mixer.pyx":257 * def play(self, Sound sound not None, loops=0, maxtime=-1, fade_ms=0): * cdef int _loops = loops * cdef int _maxtime = maxtime # <<<<<<<<<<<<<< * cdef int _fade_ms = fade_ms * */ __pyx_t_1 = __Pyx_PyInt_As_int(__pyx_v_maxtime); if (unlikely((__pyx_t_1 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 257; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_v__maxtime = __pyx_t_1; /* "pygame_sdl2/mixer.pyx":258 * cdef int _loops = loops * cdef int _maxtime = maxtime * cdef int _fade_ms = fade_ms # <<<<<<<<<<<<<< * * with nogil: */ __pyx_t_1 = __Pyx_PyInt_As_int(__pyx_v_fade_ms); if (unlikely((__pyx_t_1 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 258; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_v__fade_ms = __pyx_t_1; /* "pygame_sdl2/mixer.pyx":260 * cdef int _fade_ms = fade_ms * * with nogil: # <<<<<<<<<<<<<< * if _fade_ms != 0: * cid = Mix_FadeInChannelTimed(self.cid, sound.chunk, _loops, _fade_ms, _maxtime) */ { #ifdef WITH_THREAD PyThreadState *_save; Py_UNBLOCK_THREADS #endif /*try:*/ { /* "pygame_sdl2/mixer.pyx":261 * * with nogil: * if _fade_ms != 0: # <<<<<<<<<<<<<< * cid = Mix_FadeInChannelTimed(self.cid, sound.chunk, _loops, _fade_ms, _maxtime) * else: */ __pyx_t_2 = ((__pyx_v__fade_ms != 0) != 0); if (__pyx_t_2) { /* "pygame_sdl2/mixer.pyx":262 * with nogil: * if _fade_ms != 0: * cid = Mix_FadeInChannelTimed(self.cid, sound.chunk, _loops, _fade_ms, _maxtime) # <<<<<<<<<<<<<< * else: * cid = Mix_PlayChannelTimed(self.cid, sound.chunk, _loops, _maxtime) */ __pyx_v_cid = Mix_FadeInChannelTimed(__pyx_v_self->cid, __pyx_v_sound->chunk, __pyx_v__loops, __pyx_v__fade_ms, __pyx_v__maxtime); /* "pygame_sdl2/mixer.pyx":261 * * with nogil: * if _fade_ms != 0: # <<<<<<<<<<<<<< * cid = Mix_FadeInChannelTimed(self.cid, sound.chunk, _loops, _fade_ms, _maxtime) * else: */ goto __pyx_L6; } /* "pygame_sdl2/mixer.pyx":264 * cid = Mix_FadeInChannelTimed(self.cid, sound.chunk, _loops, _fade_ms, _maxtime) * else: * cid = Mix_PlayChannelTimed(self.cid, sound.chunk, _loops, _maxtime) # <<<<<<<<<<<<<< * * if cid == -1: */ /*else*/ { __pyx_v_cid = Mix_PlayChannelTimed(__pyx_v_self->cid, __pyx_v_sound->chunk, __pyx_v__loops, __pyx_v__maxtime); } __pyx_L6:; } /* "pygame_sdl2/mixer.pyx":260 * cdef int _fade_ms = fade_ms * * with nogil: # <<<<<<<<<<<<<< * if _fade_ms != 0: * cid = Mix_FadeInChannelTimed(self.cid, sound.chunk, _loops, _fade_ms, _maxtime) */ /*finally:*/ { /*normal exit:*/{ #ifdef WITH_THREAD Py_BLOCK_THREADS #endif goto __pyx_L5; } __pyx_L5:; } } /* "pygame_sdl2/mixer.pyx":266 * cid = Mix_PlayChannelTimed(self.cid, sound.chunk, _loops, _maxtime) * * if cid == -1: # <<<<<<<<<<<<<< * raise error() * */ __pyx_t_2 = ((__pyx_v_cid == -1L) != 0); if (__pyx_t_2) { /* "pygame_sdl2/mixer.pyx":267 * * if cid == -1: * raise error() # <<<<<<<<<<<<<< * * with _lock: */ __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_error); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 267; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); __pyx_t_5 = NULL; if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_4))) { __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4); if (likely(__pyx_t_5)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4); __Pyx_INCREF(__pyx_t_5); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_4, function); } } if (__pyx_t_5) { __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_5); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 267; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; } else { __pyx_t_3 = __Pyx_PyObject_CallNoArg(__pyx_t_4); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 267; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_Raise(__pyx_t_3, 0, 0, 0); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; {__pyx_filename = __pyx_f[0]; __pyx_lineno = 267; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "pygame_sdl2/mixer.pyx":266 * cid = Mix_PlayChannelTimed(self.cid, sound.chunk, _loops, _maxtime) * * if cid == -1: # <<<<<<<<<<<<<< * raise error() * */ } /* "pygame_sdl2/mixer.pyx":269 * raise error() * * with _lock: # <<<<<<<<<<<<<< * current_sounds[self.cid] = sound * */ /*with:*/ { __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_lock); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 269; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __pyx_t_6 = __Pyx_PyObject_LookupSpecial(__pyx_t_3, __pyx_n_s_exit); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 269; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_6); __pyx_t_5 = __Pyx_PyObject_LookupSpecial(__pyx_t_3, __pyx_n_s_enter); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 269; __pyx_clineno = __LINE__; goto __pyx_L8_error;} __Pyx_GOTREF(__pyx_t_5); __pyx_t_7 = NULL; if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_5))) { __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_5); if (likely(__pyx_t_7)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5); __Pyx_INCREF(__pyx_t_7); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_5, function); } } if (__pyx_t_7) { __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_t_7); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 269; __pyx_clineno = __LINE__; goto __pyx_L8_error;} __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; } else { __pyx_t_4 = __Pyx_PyObject_CallNoArg(__pyx_t_5); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 269; __pyx_clineno = __LINE__; goto __pyx_L8_error;} } __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /*try:*/ { { __Pyx_ExceptionSave(&__pyx_t_8, &__pyx_t_9, &__pyx_t_10); __Pyx_XGOTREF(__pyx_t_8); __Pyx_XGOTREF(__pyx_t_9); __Pyx_XGOTREF(__pyx_t_10); /*try:*/ { /* "pygame_sdl2/mixer.pyx":270 * * with _lock: * current_sounds[self.cid] = sound # <<<<<<<<<<<<<< * * def stop(self): */ if (unlikely(__pyx_v_11pygame_sdl2_5mixer_current_sounds == Py_None)) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 270; __pyx_clineno = __LINE__; goto __pyx_L12_error;} } __pyx_t_3 = __Pyx_PyInt_From_int(__pyx_v_self->cid); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 270; __pyx_clineno = __LINE__; goto __pyx_L12_error;} __Pyx_GOTREF(__pyx_t_3); if (unlikely(PyDict_SetItem(__pyx_v_11pygame_sdl2_5mixer_current_sounds, __pyx_t_3, ((PyObject *)__pyx_v_sound)) < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 270; __pyx_clineno = __LINE__; goto __pyx_L12_error;} __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "pygame_sdl2/mixer.pyx":269 * raise error() * * with _lock: # <<<<<<<<<<<<<< * current_sounds[self.cid] = sound * */ } __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0; __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0; __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0; goto __pyx_L19_try_end; __pyx_L12_error:; __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; /*except:*/ { __Pyx_AddTraceback("pygame_sdl2.mixer.Channel.play", __pyx_clineno, __pyx_lineno, __pyx_filename); if (__Pyx_GetException(&__pyx_t_3, &__pyx_t_4, &__pyx_t_5) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 269; __pyx_clineno = __LINE__; goto __pyx_L14_except_error;} __Pyx_GOTREF(__pyx_t_3); __Pyx_GOTREF(__pyx_t_4); __Pyx_GOTREF(__pyx_t_5); __pyx_t_7 = PyTuple_Pack(3, __pyx_t_3, __pyx_t_4, __pyx_t_5); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 269; __pyx_clineno = __LINE__; goto __pyx_L14_except_error;} __Pyx_GOTREF(__pyx_t_7); __pyx_t_11 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_7, NULL); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 269; __pyx_clineno = __LINE__; goto __pyx_L14_except_error;} __Pyx_GOTREF(__pyx_t_11); __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_11); __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; if (__pyx_t_2 < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 269; __pyx_clineno = __LINE__; goto __pyx_L14_except_error;} __pyx_t_12 = ((!(__pyx_t_2 != 0)) != 0); if (__pyx_t_12) { __Pyx_GIVEREF(__pyx_t_3); __Pyx_GIVEREF(__pyx_t_4); __Pyx_XGIVEREF(__pyx_t_5); __Pyx_ErrRestore(__pyx_t_3, __pyx_t_4, __pyx_t_5); __pyx_t_3 = 0; __pyx_t_4 = 0; __pyx_t_5 = 0; {__pyx_filename = __pyx_f[0]; __pyx_lineno = 269; __pyx_clineno = __LINE__; goto __pyx_L14_except_error;} } __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; goto __pyx_L13_exception_handled; } __pyx_L14_except_error:; __Pyx_XGIVEREF(__pyx_t_8); __Pyx_XGIVEREF(__pyx_t_9); __Pyx_XGIVEREF(__pyx_t_10); __Pyx_ExceptionReset(__pyx_t_8, __pyx_t_9, __pyx_t_10); goto __pyx_L1_error; __pyx_L13_exception_handled:; __Pyx_XGIVEREF(__pyx_t_8); __Pyx_XGIVEREF(__pyx_t_9); __Pyx_XGIVEREF(__pyx_t_10); __Pyx_ExceptionReset(__pyx_t_8, __pyx_t_9, __pyx_t_10); __pyx_L19_try_end:; } } /*finally:*/ { /*normal exit:*/{ if (__pyx_t_6) { __pyx_t_10 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_tuple__7, NULL); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 269; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_10); __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; } goto __pyx_L11; } __pyx_L11:; } goto __pyx_L23; __pyx_L8_error:; __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; goto __pyx_L1_error; __pyx_L23:; } /* "pygame_sdl2/mixer.pyx":255 * self.cid = cid * * def play(self, Sound sound not None, loops=0, maxtime=-1, fade_ms=0): # <<<<<<<<<<<<<< * cdef int _loops = loops * cdef int _maxtime = maxtime */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_5); __Pyx_XDECREF(__pyx_t_7); __Pyx_AddTraceback("pygame_sdl2.mixer.Channel.play", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/mixer.pyx":272 * current_sounds[self.cid] = sound * * def stop(self): # <<<<<<<<<<<<<< * with nogil: * Mix_HaltChannel(self.cid) */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_5mixer_7Channel_5stop(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/ static PyObject *__pyx_pw_11pygame_sdl2_5mixer_7Channel_5stop(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("stop (wrapper)", 0); __pyx_r = __pyx_pf_11pygame_sdl2_5mixer_7Channel_4stop(((struct __pyx_obj_11pygame_sdl2_5mixer_Channel *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_5mixer_7Channel_4stop(struct __pyx_obj_11pygame_sdl2_5mixer_Channel *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("stop", 0); /* "pygame_sdl2/mixer.pyx":273 * * def stop(self): * with nogil: # <<<<<<<<<<<<<< * Mix_HaltChannel(self.cid) * */ { #ifdef WITH_THREAD PyThreadState *_save; Py_UNBLOCK_THREADS #endif /*try:*/ { /* "pygame_sdl2/mixer.pyx":274 * def stop(self): * with nogil: * Mix_HaltChannel(self.cid) # <<<<<<<<<<<<<< * * def pause(self): */ Mix_HaltChannel(__pyx_v_self->cid); } /* "pygame_sdl2/mixer.pyx":273 * * def stop(self): * with nogil: # <<<<<<<<<<<<<< * Mix_HaltChannel(self.cid) * */ /*finally:*/ { /*normal exit:*/{ #ifdef WITH_THREAD Py_BLOCK_THREADS #endif goto __pyx_L5; } __pyx_L5:; } } /* "pygame_sdl2/mixer.pyx":272 * current_sounds[self.cid] = sound * * def stop(self): # <<<<<<<<<<<<<< * with nogil: * Mix_HaltChannel(self.cid) */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/mixer.pyx":276 * Mix_HaltChannel(self.cid) * * def pause(self): # <<<<<<<<<<<<<< * with nogil: * Mix_Pause(self.cid) */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_5mixer_7Channel_7pause(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/ static PyObject *__pyx_pw_11pygame_sdl2_5mixer_7Channel_7pause(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("pause (wrapper)", 0); __pyx_r = __pyx_pf_11pygame_sdl2_5mixer_7Channel_6pause(((struct __pyx_obj_11pygame_sdl2_5mixer_Channel *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_5mixer_7Channel_6pause(struct __pyx_obj_11pygame_sdl2_5mixer_Channel *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("pause", 0); /* "pygame_sdl2/mixer.pyx":277 * * def pause(self): * with nogil: # <<<<<<<<<<<<<< * Mix_Pause(self.cid) * */ { #ifdef WITH_THREAD PyThreadState *_save; Py_UNBLOCK_THREADS #endif /*try:*/ { /* "pygame_sdl2/mixer.pyx":278 * def pause(self): * with nogil: * Mix_Pause(self.cid) # <<<<<<<<<<<<<< * * def unpause(self): */ Mix_Pause(__pyx_v_self->cid); } /* "pygame_sdl2/mixer.pyx":277 * * def pause(self): * with nogil: # <<<<<<<<<<<<<< * Mix_Pause(self.cid) * */ /*finally:*/ { /*normal exit:*/{ #ifdef WITH_THREAD Py_BLOCK_THREADS #endif goto __pyx_L5; } __pyx_L5:; } } /* "pygame_sdl2/mixer.pyx":276 * Mix_HaltChannel(self.cid) * * def pause(self): # <<<<<<<<<<<<<< * with nogil: * Mix_Pause(self.cid) */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/mixer.pyx":280 * Mix_Pause(self.cid) * * def unpause(self): # <<<<<<<<<<<<<< * with nogil: * Mix_Resume(self.cid) */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_5mixer_7Channel_9unpause(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/ static PyObject *__pyx_pw_11pygame_sdl2_5mixer_7Channel_9unpause(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("unpause (wrapper)", 0); __pyx_r = __pyx_pf_11pygame_sdl2_5mixer_7Channel_8unpause(((struct __pyx_obj_11pygame_sdl2_5mixer_Channel *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_5mixer_7Channel_8unpause(struct __pyx_obj_11pygame_sdl2_5mixer_Channel *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("unpause", 0); /* "pygame_sdl2/mixer.pyx":281 * * def unpause(self): * with nogil: # <<<<<<<<<<<<<< * Mix_Resume(self.cid) * */ { #ifdef WITH_THREAD PyThreadState *_save; Py_UNBLOCK_THREADS #endif /*try:*/ { /* "pygame_sdl2/mixer.pyx":282 * def unpause(self): * with nogil: * Mix_Resume(self.cid) # <<<<<<<<<<<<<< * * def fadeout(self, time): */ Mix_Resume(__pyx_v_self->cid); } /* "pygame_sdl2/mixer.pyx":281 * * def unpause(self): * with nogil: # <<<<<<<<<<<<<< * Mix_Resume(self.cid) * */ /*finally:*/ { /*normal exit:*/{ #ifdef WITH_THREAD Py_BLOCK_THREADS #endif goto __pyx_L5; } __pyx_L5:; } } /* "pygame_sdl2/mixer.pyx":280 * Mix_Pause(self.cid) * * def unpause(self): # <<<<<<<<<<<<<< * with nogil: * Mix_Resume(self.cid) */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/mixer.pyx":284 * Mix_Resume(self.cid) * * def fadeout(self, time): # <<<<<<<<<<<<<< * cdef int ms = time * with nogil: */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_5mixer_7Channel_11fadeout(PyObject *__pyx_v_self, PyObject *__pyx_v_time); /*proto*/ static PyObject *__pyx_pw_11pygame_sdl2_5mixer_7Channel_11fadeout(PyObject *__pyx_v_self, PyObject *__pyx_v_time) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("fadeout (wrapper)", 0); __pyx_r = __pyx_pf_11pygame_sdl2_5mixer_7Channel_10fadeout(((struct __pyx_obj_11pygame_sdl2_5mixer_Channel *)__pyx_v_self), ((PyObject *)__pyx_v_time)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_5mixer_7Channel_10fadeout(struct __pyx_obj_11pygame_sdl2_5mixer_Channel *__pyx_v_self, PyObject *__pyx_v_time) { int __pyx_v_ms; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("fadeout", 0); /* "pygame_sdl2/mixer.pyx":285 * * def fadeout(self, time): * cdef int ms = time # <<<<<<<<<<<<<< * with nogil: * Mix_FadeOutChannel(self.cid, ms) */ __pyx_t_1 = __Pyx_PyInt_As_int(__pyx_v_time); if (unlikely((__pyx_t_1 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 285; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_v_ms = __pyx_t_1; /* "pygame_sdl2/mixer.pyx":286 * def fadeout(self, time): * cdef int ms = time * with nogil: # <<<<<<<<<<<<<< * Mix_FadeOutChannel(self.cid, ms) * */ { #ifdef WITH_THREAD PyThreadState *_save; Py_UNBLOCK_THREADS #endif /*try:*/ { /* "pygame_sdl2/mixer.pyx":287 * cdef int ms = time * with nogil: * Mix_FadeOutChannel(self.cid, ms) # <<<<<<<<<<<<<< * * def set_volume(self, volume): */ Mix_FadeOutChannel(__pyx_v_self->cid, __pyx_v_ms); } /* "pygame_sdl2/mixer.pyx":286 * def fadeout(self, time): * cdef int ms = time * with nogil: # <<<<<<<<<<<<<< * Mix_FadeOutChannel(self.cid, ms) * */ /*finally:*/ { /*normal exit:*/{ #ifdef WITH_THREAD Py_BLOCK_THREADS #endif goto __pyx_L5; } __pyx_L5:; } } /* "pygame_sdl2/mixer.pyx":284 * Mix_Resume(self.cid) * * def fadeout(self, time): # <<<<<<<<<<<<<< * cdef int ms = time * with nogil: */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("pygame_sdl2.mixer.Channel.fadeout", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/mixer.pyx":289 * Mix_FadeOutChannel(self.cid, ms) * * def set_volume(self, volume): # <<<<<<<<<<<<<< * Mix_Volume(self.cid, int(MIX_MAX_VOLUME * volume)) * */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_5mixer_7Channel_13set_volume(PyObject *__pyx_v_self, PyObject *__pyx_v_volume); /*proto*/ static PyObject *__pyx_pw_11pygame_sdl2_5mixer_7Channel_13set_volume(PyObject *__pyx_v_self, PyObject *__pyx_v_volume) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("set_volume (wrapper)", 0); __pyx_r = __pyx_pf_11pygame_sdl2_5mixer_7Channel_12set_volume(((struct __pyx_obj_11pygame_sdl2_5mixer_Channel *)__pyx_v_self), ((PyObject *)__pyx_v_volume)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_5mixer_7Channel_12set_volume(struct __pyx_obj_11pygame_sdl2_5mixer_Channel *__pyx_v_self, PyObject *__pyx_v_volume) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; int __pyx_t_3; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("set_volume", 0); /* "pygame_sdl2/mixer.pyx":290 * * def set_volume(self, volume): * Mix_Volume(self.cid, int(MIX_MAX_VOLUME * volume)) # <<<<<<<<<<<<<< * * def get_volume(self): */ __pyx_t_1 = __Pyx_PyInt_From_int(MIX_MAX_VOLUME); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 290; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = PyNumber_Multiply(__pyx_t_1, __pyx_v_volume); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 290; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_1 = PyNumber_Int(__pyx_t_2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 290; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_3 = __Pyx_PyInt_As_int(__pyx_t_1); if (unlikely((__pyx_t_3 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 290; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; Mix_Volume(__pyx_v_self->cid, __pyx_t_3); /* "pygame_sdl2/mixer.pyx":289 * Mix_FadeOutChannel(self.cid, ms) * * def set_volume(self, volume): # <<<<<<<<<<<<<< * Mix_Volume(self.cid, int(MIX_MAX_VOLUME * volume)) * */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_AddTraceback("pygame_sdl2.mixer.Channel.set_volume", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/mixer.pyx":292 * Mix_Volume(self.cid, int(MIX_MAX_VOLUME * volume)) * * def get_volume(self): # <<<<<<<<<<<<<< * cdef int vol = Mix_Volume(self.cid, -1) * return vol / MIX_MAX_VOLUME */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_5mixer_7Channel_15get_volume(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/ static PyObject *__pyx_pw_11pygame_sdl2_5mixer_7Channel_15get_volume(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("get_volume (wrapper)", 0); __pyx_r = __pyx_pf_11pygame_sdl2_5mixer_7Channel_14get_volume(((struct __pyx_obj_11pygame_sdl2_5mixer_Channel *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_5mixer_7Channel_14get_volume(struct __pyx_obj_11pygame_sdl2_5mixer_Channel *__pyx_v_self) { int __pyx_v_vol; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("get_volume", 0); /* "pygame_sdl2/mixer.pyx":293 * * def get_volume(self): * cdef int vol = Mix_Volume(self.cid, -1) # <<<<<<<<<<<<<< * return vol / MIX_MAX_VOLUME * */ __pyx_v_vol = Mix_Volume(__pyx_v_self->cid, -1); /* "pygame_sdl2/mixer.pyx":294 * def get_volume(self): * cdef int vol = Mix_Volume(self.cid, -1) * return vol / MIX_MAX_VOLUME # <<<<<<<<<<<<<< * * def get_busy(self): */ __Pyx_XDECREF(__pyx_r); if (unlikely(((double)MIX_MAX_VOLUME) == 0)) { PyErr_SetString(PyExc_ZeroDivisionError, "float division"); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 294; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } __pyx_t_1 = PyFloat_FromDouble((((double)__pyx_v_vol) / ((double)MIX_MAX_VOLUME))); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 294; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "pygame_sdl2/mixer.pyx":292 * Mix_Volume(self.cid, int(MIX_MAX_VOLUME * volume)) * * def get_volume(self): # <<<<<<<<<<<<<< * cdef int vol = Mix_Volume(self.cid, -1) * return vol / MIX_MAX_VOLUME */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("pygame_sdl2.mixer.Channel.get_volume", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/mixer.pyx":296 * return vol / MIX_MAX_VOLUME * * def get_busy(self): # <<<<<<<<<<<<<< * return Mix_Playing(self.cid) != 0 * */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_5mixer_7Channel_17get_busy(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/ static PyObject *__pyx_pw_11pygame_sdl2_5mixer_7Channel_17get_busy(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("get_busy (wrapper)", 0); __pyx_r = __pyx_pf_11pygame_sdl2_5mixer_7Channel_16get_busy(((struct __pyx_obj_11pygame_sdl2_5mixer_Channel *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_5mixer_7Channel_16get_busy(struct __pyx_obj_11pygame_sdl2_5mixer_Channel *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("get_busy", 0); /* "pygame_sdl2/mixer.pyx":297 * * def get_busy(self): * return Mix_Playing(self.cid) != 0 # <<<<<<<<<<<<<< * * def get_sound(self): */ __Pyx_XDECREF(__pyx_r); __pyx_t_1 = __Pyx_PyBool_FromLong((Mix_Playing(__pyx_v_self->cid) != 0)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 297; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "pygame_sdl2/mixer.pyx":296 * return vol / MIX_MAX_VOLUME * * def get_busy(self): # <<<<<<<<<<<<<< * return Mix_Playing(self.cid) != 0 * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("pygame_sdl2.mixer.Channel.get_busy", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/mixer.pyx":299 * return Mix_Playing(self.cid) != 0 * * def get_sound(self): # <<<<<<<<<<<<<< * with _lock: * return current_sounds.get(self.cid) */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_5mixer_7Channel_19get_sound(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/ static PyObject *__pyx_pw_11pygame_sdl2_5mixer_7Channel_19get_sound(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("get_sound (wrapper)", 0); __pyx_r = __pyx_pf_11pygame_sdl2_5mixer_7Channel_18get_sound(((struct __pyx_obj_11pygame_sdl2_5mixer_Channel *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_5mixer_7Channel_18get_sound(struct __pyx_obj_11pygame_sdl2_5mixer_Channel *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; PyObject *__pyx_t_5 = NULL; PyObject *__pyx_t_6 = NULL; PyObject *__pyx_t_7 = NULL; PyObject *__pyx_t_8 = NULL; PyObject *__pyx_t_9 = NULL; int __pyx_t_10; int __pyx_t_11; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("get_sound", 0); /* "pygame_sdl2/mixer.pyx":300 * * def get_sound(self): * with _lock: # <<<<<<<<<<<<<< * return current_sounds.get(self.cid) * */ /*with:*/ { __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_lock); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 300; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = __Pyx_PyObject_LookupSpecial(__pyx_t_1, __pyx_n_s_exit); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 300; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __pyx_t_4 = __Pyx_PyObject_LookupSpecial(__pyx_t_1, __pyx_n_s_enter); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 300; __pyx_clineno = __LINE__; goto __pyx_L3_error;} __Pyx_GOTREF(__pyx_t_4); __pyx_t_5 = NULL; if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_4))) { __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4); if (likely(__pyx_t_5)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4); __Pyx_INCREF(__pyx_t_5); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_4, function); } } if (__pyx_t_5) { __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_5); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 300; __pyx_clineno = __LINE__; goto __pyx_L3_error;} __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; } else { __pyx_t_3 = __Pyx_PyObject_CallNoArg(__pyx_t_4); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 300; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /*try:*/ { { __Pyx_ExceptionSave(&__pyx_t_6, &__pyx_t_7, &__pyx_t_8); __Pyx_XGOTREF(__pyx_t_6); __Pyx_XGOTREF(__pyx_t_7); __Pyx_XGOTREF(__pyx_t_8); /*try:*/ { /* "pygame_sdl2/mixer.pyx":301 * def get_sound(self): * with _lock: * return current_sounds.get(self.cid) # <<<<<<<<<<<<<< * * def queue(self, Sound sound): */ __Pyx_XDECREF(__pyx_r); if (unlikely(__pyx_v_11pygame_sdl2_5mixer_current_sounds == Py_None)) { PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%s'", "get"); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 301; __pyx_clineno = __LINE__; goto __pyx_L7_error;} } __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_self->cid); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 301; __pyx_clineno = __LINE__; goto __pyx_L7_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_t_3 = __Pyx_PyDict_GetItemDefault(__pyx_v_11pygame_sdl2_5mixer_current_sounds, __pyx_t_1, Py_None); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 301; __pyx_clineno = __LINE__; goto __pyx_L7_error;} __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_r = __pyx_t_3; __pyx_t_3 = 0; goto __pyx_L11_try_return; /* "pygame_sdl2/mixer.pyx":300 * * def get_sound(self): * with _lock: # <<<<<<<<<<<<<< * return current_sounds.get(self.cid) * */ } __pyx_L7_error:; __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; /*except:*/ { __Pyx_AddTraceback("pygame_sdl2.mixer.Channel.get_sound", __pyx_clineno, __pyx_lineno, __pyx_filename); if (__Pyx_GetException(&__pyx_t_3, &__pyx_t_1, &__pyx_t_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 300; __pyx_clineno = __LINE__; goto __pyx_L9_except_error;} __Pyx_GOTREF(__pyx_t_3); __Pyx_GOTREF(__pyx_t_1); __Pyx_GOTREF(__pyx_t_4); __pyx_t_5 = PyTuple_Pack(3, __pyx_t_3, __pyx_t_1, __pyx_t_4); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 300; __pyx_clineno = __LINE__; goto __pyx_L9_except_error;} __Pyx_GOTREF(__pyx_t_5); __pyx_t_9 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_5, NULL); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 300; __pyx_clineno = __LINE__; goto __pyx_L9_except_error;} __Pyx_GOTREF(__pyx_t_9); __pyx_t_10 = __Pyx_PyObject_IsTrue(__pyx_t_9); __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; if (__pyx_t_10 < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 300; __pyx_clineno = __LINE__; goto __pyx_L9_except_error;} __pyx_t_11 = ((!(__pyx_t_10 != 0)) != 0); if (__pyx_t_11) { __Pyx_GIVEREF(__pyx_t_3); __Pyx_GIVEREF(__pyx_t_1); __Pyx_XGIVEREF(__pyx_t_4); __Pyx_ErrRestore(__pyx_t_3, __pyx_t_1, __pyx_t_4); __pyx_t_3 = 0; __pyx_t_1 = 0; __pyx_t_4 = 0; {__pyx_filename = __pyx_f[0]; __pyx_lineno = 300; __pyx_clineno = __LINE__; goto __pyx_L9_except_error;} } __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; goto __pyx_L8_exception_handled; } __pyx_L9_except_error:; __Pyx_XGIVEREF(__pyx_t_6); __Pyx_XGIVEREF(__pyx_t_7); __Pyx_XGIVEREF(__pyx_t_8); __Pyx_ExceptionReset(__pyx_t_6, __pyx_t_7, __pyx_t_8); goto __pyx_L1_error; __pyx_L11_try_return:; __Pyx_XGIVEREF(__pyx_t_6); __Pyx_XGIVEREF(__pyx_t_7); __Pyx_XGIVEREF(__pyx_t_8); __Pyx_ExceptionReset(__pyx_t_6, __pyx_t_7, __pyx_t_8); goto __pyx_L4_return; __pyx_L8_exception_handled:; __Pyx_XGIVEREF(__pyx_t_6); __Pyx_XGIVEREF(__pyx_t_7); __Pyx_XGIVEREF(__pyx_t_8); __Pyx_ExceptionReset(__pyx_t_6, __pyx_t_7, __pyx_t_8); } } /*finally:*/ { /*normal exit:*/{ if (__pyx_t_2) { __pyx_t_8 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_tuple__8, NULL); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 300; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_8); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; } goto __pyx_L6; } __pyx_L4_return: { __pyx_t_8 = __pyx_r; __pyx_r = 0; if (__pyx_t_2) { __pyx_t_7 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_tuple__9, NULL); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 300; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; } __pyx_r = __pyx_t_8; __pyx_t_8 = 0; goto __pyx_L0; } __pyx_L6:; } goto __pyx_L18; __pyx_L3_error:; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; goto __pyx_L1_error; __pyx_L18:; } /* "pygame_sdl2/mixer.pyx":299 * return Mix_Playing(self.cid) != 0 * * def get_sound(self): # <<<<<<<<<<<<<< * with _lock: * return current_sounds.get(self.cid) */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_5); __Pyx_AddTraceback("pygame_sdl2.mixer.Channel.get_sound", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/mixer.pyx":303 * return current_sounds.get(self.cid) * * def queue(self, Sound sound): # <<<<<<<<<<<<<< * if self.get_busy(): * with _lock: */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_5mixer_7Channel_21queue(PyObject *__pyx_v_self, PyObject *__pyx_v_sound); /*proto*/ static PyObject *__pyx_pw_11pygame_sdl2_5mixer_7Channel_21queue(PyObject *__pyx_v_self, PyObject *__pyx_v_sound) { CYTHON_UNUSED int __pyx_lineno = 0; CYTHON_UNUSED const char *__pyx_filename = NULL; CYTHON_UNUSED int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("queue (wrapper)", 0); if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_sound), __pyx_ptype_11pygame_sdl2_5mixer_Sound, 1, "sound", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 303; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_r = __pyx_pf_11pygame_sdl2_5mixer_7Channel_20queue(((struct __pyx_obj_11pygame_sdl2_5mixer_Channel *)__pyx_v_self), ((struct __pyx_obj_11pygame_sdl2_5mixer_Sound *)__pyx_v_sound)); /* function exit code */ goto __pyx_L0; __pyx_L1_error:; __pyx_r = NULL; __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_5mixer_7Channel_20queue(struct __pyx_obj_11pygame_sdl2_5mixer_Channel *__pyx_v_self, struct __pyx_obj_11pygame_sdl2_5mixer_Sound *__pyx_v_sound) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; int __pyx_t_4; PyObject *__pyx_t_5 = NULL; PyObject *__pyx_t_6 = NULL; PyObject *__pyx_t_7 = NULL; PyObject *__pyx_t_8 = NULL; PyObject *__pyx_t_9 = NULL; PyObject *__pyx_t_10 = NULL; int __pyx_t_11; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("queue", 0); /* "pygame_sdl2/mixer.pyx":304 * * def queue(self, Sound sound): * if self.get_busy(): # <<<<<<<<<<<<<< * with _lock: * channel_queued[self.cid] = sound */ __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_get_busy); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 304; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = NULL; if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_2))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); if (likely(__pyx_t_3)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); } } if (__pyx_t_3) { __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 304; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } else { __pyx_t_1 = __Pyx_PyObject_CallNoArg(__pyx_t_2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 304; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_4 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 304; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (__pyx_t_4) { /* "pygame_sdl2/mixer.pyx":305 * def queue(self, Sound sound): * if self.get_busy(): * with _lock: # <<<<<<<<<<<<<< * channel_queued[self.cid] = sound * else: */ /*with:*/ { __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_lock); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 305; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_t_5 = __Pyx_PyObject_LookupSpecial(__pyx_t_1, __pyx_n_s_exit); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 305; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); __pyx_t_3 = __Pyx_PyObject_LookupSpecial(__pyx_t_1, __pyx_n_s_enter); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 305; __pyx_clineno = __LINE__; goto __pyx_L4_error;} __Pyx_GOTREF(__pyx_t_3); __pyx_t_6 = NULL; if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_3))) { __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_3); if (likely(__pyx_t_6)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); __Pyx_INCREF(__pyx_t_6); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_3, function); } } if (__pyx_t_6) { __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_6); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 305; __pyx_clineno = __LINE__; goto __pyx_L4_error;} __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; } else { __pyx_t_2 = __Pyx_PyObject_CallNoArg(__pyx_t_3); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 305; __pyx_clineno = __LINE__; goto __pyx_L4_error;} } __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /*try:*/ { { __Pyx_ExceptionSave(&__pyx_t_7, &__pyx_t_8, &__pyx_t_9); __Pyx_XGOTREF(__pyx_t_7); __Pyx_XGOTREF(__pyx_t_8); __Pyx_XGOTREF(__pyx_t_9); /*try:*/ { /* "pygame_sdl2/mixer.pyx":306 * if self.get_busy(): * with _lock: * channel_queued[self.cid] = sound # <<<<<<<<<<<<<< * else: * self.play(sound) */ if (unlikely(__pyx_v_11pygame_sdl2_5mixer_channel_queued == Py_None)) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 306; __pyx_clineno = __LINE__; goto __pyx_L8_error;} } __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_self->cid); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 306; __pyx_clineno = __LINE__; goto __pyx_L8_error;} __Pyx_GOTREF(__pyx_t_1); if (unlikely(PyDict_SetItem(__pyx_v_11pygame_sdl2_5mixer_channel_queued, __pyx_t_1, ((PyObject *)__pyx_v_sound)) < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 306; __pyx_clineno = __LINE__; goto __pyx_L8_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "pygame_sdl2/mixer.pyx":305 * def queue(self, Sound sound): * if self.get_busy(): * with _lock: # <<<<<<<<<<<<<< * channel_queued[self.cid] = sound * else: */ } __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0; __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0; goto __pyx_L15_try_end; __pyx_L8_error:; __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; /*except:*/ { __Pyx_AddTraceback("pygame_sdl2.mixer.Channel.queue", __pyx_clineno, __pyx_lineno, __pyx_filename); if (__Pyx_GetException(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 305; __pyx_clineno = __LINE__; goto __pyx_L10_except_error;} __Pyx_GOTREF(__pyx_t_1); __Pyx_GOTREF(__pyx_t_2); __Pyx_GOTREF(__pyx_t_3); __pyx_t_6 = PyTuple_Pack(3, __pyx_t_1, __pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 305; __pyx_clineno = __LINE__; goto __pyx_L10_except_error;} __Pyx_GOTREF(__pyx_t_6); __pyx_t_10 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_6, NULL); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 305; __pyx_clineno = __LINE__; goto __pyx_L10_except_error;} __Pyx_GOTREF(__pyx_t_10); __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_10); __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; if (__pyx_t_4 < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 305; __pyx_clineno = __LINE__; goto __pyx_L10_except_error;} __pyx_t_11 = ((!(__pyx_t_4 != 0)) != 0); if (__pyx_t_11) { __Pyx_GIVEREF(__pyx_t_1); __Pyx_GIVEREF(__pyx_t_2); __Pyx_XGIVEREF(__pyx_t_3); __Pyx_ErrRestore(__pyx_t_1, __pyx_t_2, __pyx_t_3); __pyx_t_1 = 0; __pyx_t_2 = 0; __pyx_t_3 = 0; {__pyx_filename = __pyx_f[0]; __pyx_lineno = 305; __pyx_clineno = __LINE__; goto __pyx_L10_except_error;} } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; goto __pyx_L9_exception_handled; } __pyx_L10_except_error:; __Pyx_XGIVEREF(__pyx_t_7); __Pyx_XGIVEREF(__pyx_t_8); __Pyx_XGIVEREF(__pyx_t_9); __Pyx_ExceptionReset(__pyx_t_7, __pyx_t_8, __pyx_t_9); goto __pyx_L1_error; __pyx_L9_exception_handled:; __Pyx_XGIVEREF(__pyx_t_7); __Pyx_XGIVEREF(__pyx_t_8); __Pyx_XGIVEREF(__pyx_t_9); __Pyx_ExceptionReset(__pyx_t_7, __pyx_t_8, __pyx_t_9); __pyx_L15_try_end:; } } /*finally:*/ { /*normal exit:*/{ if (__pyx_t_5) { __pyx_t_9 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_tuple__10, NULL); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 305; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_9); __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; } goto __pyx_L7; } __pyx_L7:; } goto __pyx_L19; __pyx_L4_error:; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; goto __pyx_L1_error; __pyx_L19:; } /* "pygame_sdl2/mixer.pyx":304 * * def queue(self, Sound sound): * if self.get_busy(): # <<<<<<<<<<<<<< * with _lock: * channel_queued[self.cid] = sound */ goto __pyx_L3; } /* "pygame_sdl2/mixer.pyx":308 * channel_queued[self.cid] = sound * else: * self.play(sound) # <<<<<<<<<<<<<< * * def get_queue(self): */ /*else*/ { __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_play); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 308; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __pyx_t_1 = NULL; if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_2))) { __pyx_t_1 = PyMethod_GET_SELF(__pyx_t_2); if (likely(__pyx_t_1)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_1); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); } } if (!__pyx_t_1) { __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_t_2, ((PyObject *)__pyx_v_sound)); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 308; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); } else { __pyx_t_6 = PyTuple_New(1+1); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 308; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_6); __Pyx_GIVEREF(__pyx_t_1); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_1); __pyx_t_1 = NULL; __Pyx_INCREF(((PyObject *)__pyx_v_sound)); __Pyx_GIVEREF(((PyObject *)__pyx_v_sound)); PyTuple_SET_ITEM(__pyx_t_6, 0+1, ((PyObject *)__pyx_v_sound)); __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_6, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 308; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; } __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } __pyx_L3:; /* "pygame_sdl2/mixer.pyx":303 * return current_sounds.get(self.cid) * * def queue(self, Sound sound): # <<<<<<<<<<<<<< * if self.get_busy(): * with _lock: */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_6); __Pyx_AddTraceback("pygame_sdl2.mixer.Channel.queue", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/mixer.pyx":310 * self.play(sound) * * def get_queue(self): # <<<<<<<<<<<<<< * with _lock: * return channel_queued.get(self.cid) */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_5mixer_7Channel_23get_queue(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/ static PyObject *__pyx_pw_11pygame_sdl2_5mixer_7Channel_23get_queue(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("get_queue (wrapper)", 0); __pyx_r = __pyx_pf_11pygame_sdl2_5mixer_7Channel_22get_queue(((struct __pyx_obj_11pygame_sdl2_5mixer_Channel *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_5mixer_7Channel_22get_queue(struct __pyx_obj_11pygame_sdl2_5mixer_Channel *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; PyObject *__pyx_t_5 = NULL; PyObject *__pyx_t_6 = NULL; PyObject *__pyx_t_7 = NULL; PyObject *__pyx_t_8 = NULL; PyObject *__pyx_t_9 = NULL; int __pyx_t_10; int __pyx_t_11; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("get_queue", 0); /* "pygame_sdl2/mixer.pyx":311 * * def get_queue(self): * with _lock: # <<<<<<<<<<<<<< * return channel_queued.get(self.cid) * */ /*with:*/ { __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_lock); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 311; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = __Pyx_PyObject_LookupSpecial(__pyx_t_1, __pyx_n_s_exit); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 311; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __pyx_t_4 = __Pyx_PyObject_LookupSpecial(__pyx_t_1, __pyx_n_s_enter); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 311; __pyx_clineno = __LINE__; goto __pyx_L3_error;} __Pyx_GOTREF(__pyx_t_4); __pyx_t_5 = NULL; if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_4))) { __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4); if (likely(__pyx_t_5)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4); __Pyx_INCREF(__pyx_t_5); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_4, function); } } if (__pyx_t_5) { __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_5); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 311; __pyx_clineno = __LINE__; goto __pyx_L3_error;} __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; } else { __pyx_t_3 = __Pyx_PyObject_CallNoArg(__pyx_t_4); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 311; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /*try:*/ { { __Pyx_ExceptionSave(&__pyx_t_6, &__pyx_t_7, &__pyx_t_8); __Pyx_XGOTREF(__pyx_t_6); __Pyx_XGOTREF(__pyx_t_7); __Pyx_XGOTREF(__pyx_t_8); /*try:*/ { /* "pygame_sdl2/mixer.pyx":312 * def get_queue(self): * with _lock: * return channel_queued.get(self.cid) # <<<<<<<<<<<<<< * * def set_endevent(self, type=None): */ __Pyx_XDECREF(__pyx_r); if (unlikely(__pyx_v_11pygame_sdl2_5mixer_channel_queued == Py_None)) { PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%s'", "get"); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 312; __pyx_clineno = __LINE__; goto __pyx_L7_error;} } __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_self->cid); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 312; __pyx_clineno = __LINE__; goto __pyx_L7_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_t_3 = __Pyx_PyDict_GetItemDefault(__pyx_v_11pygame_sdl2_5mixer_channel_queued, __pyx_t_1, Py_None); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 312; __pyx_clineno = __LINE__; goto __pyx_L7_error;} __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_r = __pyx_t_3; __pyx_t_3 = 0; goto __pyx_L11_try_return; /* "pygame_sdl2/mixer.pyx":311 * * def get_queue(self): * with _lock: # <<<<<<<<<<<<<< * return channel_queued.get(self.cid) * */ } __pyx_L7_error:; __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; /*except:*/ { __Pyx_AddTraceback("pygame_sdl2.mixer.Channel.get_queue", __pyx_clineno, __pyx_lineno, __pyx_filename); if (__Pyx_GetException(&__pyx_t_3, &__pyx_t_1, &__pyx_t_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 311; __pyx_clineno = __LINE__; goto __pyx_L9_except_error;} __Pyx_GOTREF(__pyx_t_3); __Pyx_GOTREF(__pyx_t_1); __Pyx_GOTREF(__pyx_t_4); __pyx_t_5 = PyTuple_Pack(3, __pyx_t_3, __pyx_t_1, __pyx_t_4); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 311; __pyx_clineno = __LINE__; goto __pyx_L9_except_error;} __Pyx_GOTREF(__pyx_t_5); __pyx_t_9 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_5, NULL); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 311; __pyx_clineno = __LINE__; goto __pyx_L9_except_error;} __Pyx_GOTREF(__pyx_t_9); __pyx_t_10 = __Pyx_PyObject_IsTrue(__pyx_t_9); __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; if (__pyx_t_10 < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 311; __pyx_clineno = __LINE__; goto __pyx_L9_except_error;} __pyx_t_11 = ((!(__pyx_t_10 != 0)) != 0); if (__pyx_t_11) { __Pyx_GIVEREF(__pyx_t_3); __Pyx_GIVEREF(__pyx_t_1); __Pyx_XGIVEREF(__pyx_t_4); __Pyx_ErrRestore(__pyx_t_3, __pyx_t_1, __pyx_t_4); __pyx_t_3 = 0; __pyx_t_1 = 0; __pyx_t_4 = 0; {__pyx_filename = __pyx_f[0]; __pyx_lineno = 311; __pyx_clineno = __LINE__; goto __pyx_L9_except_error;} } __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; goto __pyx_L8_exception_handled; } __pyx_L9_except_error:; __Pyx_XGIVEREF(__pyx_t_6); __Pyx_XGIVEREF(__pyx_t_7); __Pyx_XGIVEREF(__pyx_t_8); __Pyx_ExceptionReset(__pyx_t_6, __pyx_t_7, __pyx_t_8); goto __pyx_L1_error; __pyx_L11_try_return:; __Pyx_XGIVEREF(__pyx_t_6); __Pyx_XGIVEREF(__pyx_t_7); __Pyx_XGIVEREF(__pyx_t_8); __Pyx_ExceptionReset(__pyx_t_6, __pyx_t_7, __pyx_t_8); goto __pyx_L4_return; __pyx_L8_exception_handled:; __Pyx_XGIVEREF(__pyx_t_6); __Pyx_XGIVEREF(__pyx_t_7); __Pyx_XGIVEREF(__pyx_t_8); __Pyx_ExceptionReset(__pyx_t_6, __pyx_t_7, __pyx_t_8); } } /*finally:*/ { /*normal exit:*/{ if (__pyx_t_2) { __pyx_t_8 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_tuple__11, NULL); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 311; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_8); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; } goto __pyx_L6; } __pyx_L4_return: { __pyx_t_8 = __pyx_r; __pyx_r = 0; if (__pyx_t_2) { __pyx_t_7 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_tuple__12, NULL); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 311; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; } __pyx_r = __pyx_t_8; __pyx_t_8 = 0; goto __pyx_L0; } __pyx_L6:; } goto __pyx_L18; __pyx_L3_error:; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; goto __pyx_L1_error; __pyx_L18:; } /* "pygame_sdl2/mixer.pyx":310 * self.play(sound) * * def get_queue(self): # <<<<<<<<<<<<<< * with _lock: * return channel_queued.get(self.cid) */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_5); __Pyx_AddTraceback("pygame_sdl2.mixer.Channel.get_queue", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/mixer.pyx":314 * return channel_queued.get(self.cid) * * def set_endevent(self, type=None): # <<<<<<<<<<<<<< * channel_events[self.cid] = type or 0 * */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_5mixer_7Channel_25set_endevent(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static PyObject *__pyx_pw_11pygame_sdl2_5mixer_7Channel_25set_endevent(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_type = 0; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("set_endevent (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_type,0}; PyObject* values[1] = {0}; values[0] = ((PyObject *)Py_None); if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (kw_args > 0) { PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_type); if (value) { values[0] = value; kw_args--; } } } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "set_endevent") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 314; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } } else { switch (PyTuple_GET_SIZE(__pyx_args)) { case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); case 0: break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_type = values[0]; } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("set_endevent", 0, 0, 1, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 314; __pyx_clineno = __LINE__; goto __pyx_L3_error;} __pyx_L3_error:; __Pyx_AddTraceback("pygame_sdl2.mixer.Channel.set_endevent", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_11pygame_sdl2_5mixer_7Channel_24set_endevent(((struct __pyx_obj_11pygame_sdl2_5mixer_Channel *)__pyx_v_self), __pyx_v_type); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_5mixer_7Channel_24set_endevent(struct __pyx_obj_11pygame_sdl2_5mixer_Channel *__pyx_v_self, PyObject *__pyx_v_type) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_t_2; PyObject *__pyx_t_3 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("set_endevent", 0); /* "pygame_sdl2/mixer.pyx":315 * * def set_endevent(self, type=None): * channel_events[self.cid] = type or 0 # <<<<<<<<<<<<<< * * def get_endevent(self): */ __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_v_type); if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 315; __pyx_clineno = __LINE__; goto __pyx_L1_error;} if (!__pyx_t_2) { } else { __Pyx_INCREF(__pyx_v_type); __pyx_t_1 = __pyx_v_type; goto __pyx_L3_bool_binop_done; } __pyx_t_3 = __Pyx_PyInt_From_long(0); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 315; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __pyx_t_1 = __pyx_t_3; __pyx_t_3 = 0; __pyx_L3_bool_binop_done:; if (unlikely(__pyx_v_11pygame_sdl2_5mixer_channel_events == Py_None)) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 315; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } __pyx_t_3 = __Pyx_PyInt_From_int(__pyx_v_self->cid); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 315; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); if (unlikely(PyDict_SetItem(__pyx_v_11pygame_sdl2_5mixer_channel_events, __pyx_t_3, __pyx_t_1) < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 315; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "pygame_sdl2/mixer.pyx":314 * return channel_queued.get(self.cid) * * def set_endevent(self, type=None): # <<<<<<<<<<<<<< * channel_events[self.cid] = type or 0 * */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("pygame_sdl2.mixer.Channel.set_endevent", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/mixer.pyx":317 * channel_events[self.cid] = type or 0 * * def get_endevent(self): # <<<<<<<<<<<<<< * return channel_events.get(self.cid, 0) */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_5mixer_7Channel_27get_endevent(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/ static PyObject *__pyx_pw_11pygame_sdl2_5mixer_7Channel_27get_endevent(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("get_endevent (wrapper)", 0); __pyx_r = __pyx_pf_11pygame_sdl2_5mixer_7Channel_26get_endevent(((struct __pyx_obj_11pygame_sdl2_5mixer_Channel *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_5mixer_7Channel_26get_endevent(struct __pyx_obj_11pygame_sdl2_5mixer_Channel *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("get_endevent", 0); /* "pygame_sdl2/mixer.pyx":318 * * def get_endevent(self): * return channel_events.get(self.cid, 0) # <<<<<<<<<<<<<< */ __Pyx_XDECREF(__pyx_r); if (unlikely(__pyx_v_11pygame_sdl2_5mixer_channel_events == Py_None)) { PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%s'", "get"); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 318; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_self->cid); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 318; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = __Pyx_PyDict_GetItemDefault(__pyx_v_11pygame_sdl2_5mixer_channel_events, __pyx_t_1, __pyx_int_0); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 318; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; /* "pygame_sdl2/mixer.pyx":317 * channel_events[self.cid] = type or 0 * * def get_endevent(self): # <<<<<<<<<<<<<< * return channel_events.get(self.cid, 0) */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_AddTraceback("pygame_sdl2.mixer.Channel.get_endevent", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_tp_new_11pygame_sdl2_5mixer_Sound(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) { PyObject *o; if (likely((t->tp_flags & Py_TPFLAGS_IS_ABSTRACT) == 0)) { o = (*t->tp_alloc)(t, 0); } else { o = (PyObject *) PyBaseObject_Type.tp_new(t, __pyx_empty_tuple, 0); } if (unlikely(!o)) return 0; if (unlikely(__pyx_pw_11pygame_sdl2_5mixer_5Sound_1__cinit__(o, __pyx_empty_tuple, NULL) < 0)) { Py_DECREF(o); o = 0; } return o; } static void __pyx_tp_dealloc_11pygame_sdl2_5mixer_Sound(PyObject *o) { #if PY_VERSION_HEX >= 0x030400a1 if (unlikely(Py_TYPE(o)->tp_finalize) && (!PyType_IS_GC(Py_TYPE(o)) || !_PyGC_FINALIZED(o))) { if (PyObject_CallFinalizerFromDealloc(o)) return; } #endif { PyObject *etype, *eval, *etb; PyErr_Fetch(&etype, &eval, &etb); ++Py_REFCNT(o); __pyx_pw_11pygame_sdl2_5mixer_5Sound_3__dealloc__(o); --Py_REFCNT(o); PyErr_Restore(etype, eval, etb); } (*Py_TYPE(o)->tp_free)(o); } static PyMethodDef __pyx_methods_11pygame_sdl2_5mixer_Sound[] = { {"play", (PyCFunction)__pyx_pw_11pygame_sdl2_5mixer_5Sound_7play, METH_VARARGS|METH_KEYWORDS, 0}, {"stop", (PyCFunction)__pyx_pw_11pygame_sdl2_5mixer_5Sound_9stop, METH_NOARGS, 0}, {"pause", (PyCFunction)__pyx_pw_11pygame_sdl2_5mixer_5Sound_11pause, METH_NOARGS, 0}, {"unpause", (PyCFunction)__pyx_pw_11pygame_sdl2_5mixer_5Sound_13unpause, METH_NOARGS, 0}, {"fadeout", (PyCFunction)__pyx_pw_11pygame_sdl2_5mixer_5Sound_15fadeout, METH_O, 0}, {"set_volume", (PyCFunction)__pyx_pw_11pygame_sdl2_5mixer_5Sound_17set_volume, METH_O, 0}, {"get_volume", (PyCFunction)__pyx_pw_11pygame_sdl2_5mixer_5Sound_19get_volume, METH_NOARGS, 0}, {"get_num_channels", (PyCFunction)__pyx_pw_11pygame_sdl2_5mixer_5Sound_21get_num_channels, METH_NOARGS, 0}, {"get_length", (PyCFunction)__pyx_pw_11pygame_sdl2_5mixer_5Sound_23get_length, METH_NOARGS, 0}, {"get_raw", (PyCFunction)__pyx_pw_11pygame_sdl2_5mixer_5Sound_25get_raw, METH_NOARGS, 0}, {0, 0, 0, 0} }; static PyTypeObject __pyx_type_11pygame_sdl2_5mixer_Sound = { PyVarObject_HEAD_INIT(0, 0) "pygame_sdl2.mixer.Sound", /*tp_name*/ sizeof(struct __pyx_obj_11pygame_sdl2_5mixer_Sound), /*tp_basicsize*/ 0, /*tp_itemsize*/ __pyx_tp_dealloc_11pygame_sdl2_5mixer_Sound, /*tp_dealloc*/ 0, /*tp_print*/ 0, /*tp_getattr*/ 0, /*tp_setattr*/ #if PY_MAJOR_VERSION < 3 0, /*tp_compare*/ #endif #if PY_MAJOR_VERSION >= 3 0, /*tp_as_async*/ #endif 0, /*tp_repr*/ 0, /*tp_as_number*/ 0, /*tp_as_sequence*/ 0, /*tp_as_mapping*/ 0, /*tp_hash*/ 0, /*tp_call*/ 0, /*tp_str*/ 0, /*tp_getattro*/ 0, /*tp_setattro*/ 0, /*tp_as_buffer*/ Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE, /*tp_flags*/ 0, /*tp_doc*/ 0, /*tp_traverse*/ 0, /*tp_clear*/ 0, /*tp_richcompare*/ 0, /*tp_weaklistoffset*/ 0, /*tp_iter*/ 0, /*tp_iternext*/ __pyx_methods_11pygame_sdl2_5mixer_Sound, /*tp_methods*/ 0, /*tp_members*/ 0, /*tp_getset*/ 0, /*tp_base*/ 0, /*tp_dict*/ 0, /*tp_descr_get*/ 0, /*tp_descr_set*/ 0, /*tp_dictoffset*/ __pyx_pw_11pygame_sdl2_5mixer_5Sound_5__init__, /*tp_init*/ 0, /*tp_alloc*/ __pyx_tp_new_11pygame_sdl2_5mixer_Sound, /*tp_new*/ 0, /*tp_free*/ 0, /*tp_is_gc*/ 0, /*tp_bases*/ 0, /*tp_mro*/ 0, /*tp_cache*/ 0, /*tp_subclasses*/ 0, /*tp_weaklist*/ 0, /*tp_del*/ 0, /*tp_version_tag*/ #if PY_VERSION_HEX >= 0x030400a1 0, /*tp_finalize*/ #endif }; static PyObject *__pyx_tp_new_11pygame_sdl2_5mixer_Channel(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) { PyObject *o; if (likely((t->tp_flags & Py_TPFLAGS_IS_ABSTRACT) == 0)) { o = (*t->tp_alloc)(t, 0); } else { o = (PyObject *) PyBaseObject_Type.tp_new(t, __pyx_empty_tuple, 0); } if (unlikely(!o)) return 0; return o; } static void __pyx_tp_dealloc_11pygame_sdl2_5mixer_Channel(PyObject *o) { #if PY_VERSION_HEX >= 0x030400a1 if (unlikely(Py_TYPE(o)->tp_finalize) && (!PyType_IS_GC(Py_TYPE(o)) || !_PyGC_FINALIZED(o))) { if (PyObject_CallFinalizerFromDealloc(o)) return; } #endif (*Py_TYPE(o)->tp_free)(o); } static PyMethodDef __pyx_methods_11pygame_sdl2_5mixer_Channel[] = { {"play", (PyCFunction)__pyx_pw_11pygame_sdl2_5mixer_7Channel_3play, METH_VARARGS|METH_KEYWORDS, 0}, {"stop", (PyCFunction)__pyx_pw_11pygame_sdl2_5mixer_7Channel_5stop, METH_NOARGS, 0}, {"pause", (PyCFunction)__pyx_pw_11pygame_sdl2_5mixer_7Channel_7pause, METH_NOARGS, 0}, {"unpause", (PyCFunction)__pyx_pw_11pygame_sdl2_5mixer_7Channel_9unpause, METH_NOARGS, 0}, {"fadeout", (PyCFunction)__pyx_pw_11pygame_sdl2_5mixer_7Channel_11fadeout, METH_O, 0}, {"set_volume", (PyCFunction)__pyx_pw_11pygame_sdl2_5mixer_7Channel_13set_volume, METH_O, 0}, {"get_volume", (PyCFunction)__pyx_pw_11pygame_sdl2_5mixer_7Channel_15get_volume, METH_NOARGS, 0}, {"get_busy", (PyCFunction)__pyx_pw_11pygame_sdl2_5mixer_7Channel_17get_busy, METH_NOARGS, 0}, {"get_sound", (PyCFunction)__pyx_pw_11pygame_sdl2_5mixer_7Channel_19get_sound, METH_NOARGS, 0}, {"queue", (PyCFunction)__pyx_pw_11pygame_sdl2_5mixer_7Channel_21queue, METH_O, 0}, {"get_queue", (PyCFunction)__pyx_pw_11pygame_sdl2_5mixer_7Channel_23get_queue, METH_NOARGS, 0}, {"set_endevent", (PyCFunction)__pyx_pw_11pygame_sdl2_5mixer_7Channel_25set_endevent, METH_VARARGS|METH_KEYWORDS, 0}, {"get_endevent", (PyCFunction)__pyx_pw_11pygame_sdl2_5mixer_7Channel_27get_endevent, METH_NOARGS, 0}, {0, 0, 0, 0} }; static PyTypeObject __pyx_type_11pygame_sdl2_5mixer_Channel = { PyVarObject_HEAD_INIT(0, 0) "pygame_sdl2.mixer.Channel", /*tp_name*/ sizeof(struct __pyx_obj_11pygame_sdl2_5mixer_Channel), /*tp_basicsize*/ 0, /*tp_itemsize*/ __pyx_tp_dealloc_11pygame_sdl2_5mixer_Channel, /*tp_dealloc*/ 0, /*tp_print*/ 0, /*tp_getattr*/ 0, /*tp_setattr*/ #if PY_MAJOR_VERSION < 3 0, /*tp_compare*/ #endif #if PY_MAJOR_VERSION >= 3 0, /*tp_as_async*/ #endif 0, /*tp_repr*/ 0, /*tp_as_number*/ 0, /*tp_as_sequence*/ 0, /*tp_as_mapping*/ 0, /*tp_hash*/ 0, /*tp_call*/ 0, /*tp_str*/ 0, /*tp_getattro*/ 0, /*tp_setattro*/ 0, /*tp_as_buffer*/ Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE, /*tp_flags*/ 0, /*tp_doc*/ 0, /*tp_traverse*/ 0, /*tp_clear*/ 0, /*tp_richcompare*/ 0, /*tp_weaklistoffset*/ 0, /*tp_iter*/ 0, /*tp_iternext*/ __pyx_methods_11pygame_sdl2_5mixer_Channel, /*tp_methods*/ 0, /*tp_members*/ 0, /*tp_getset*/ 0, /*tp_base*/ 0, /*tp_dict*/ 0, /*tp_descr_get*/ 0, /*tp_descr_set*/ 0, /*tp_dictoffset*/ __pyx_pw_11pygame_sdl2_5mixer_7Channel_1__init__, /*tp_init*/ 0, /*tp_alloc*/ __pyx_tp_new_11pygame_sdl2_5mixer_Channel, /*tp_new*/ 0, /*tp_free*/ 0, /*tp_is_gc*/ 0, /*tp_bases*/ 0, /*tp_mro*/ 0, /*tp_cache*/ 0, /*tp_subclasses*/ 0, /*tp_weaklist*/ 0, /*tp_del*/ 0, /*tp_version_tag*/ #if PY_VERSION_HEX >= 0x030400a1 0, /*tp_finalize*/ #endif }; static PyMethodDef __pyx_methods[] = { {0, 0, 0, 0} }; #if PY_MAJOR_VERSION >= 3 static struct PyModuleDef __pyx_moduledef = { #if PY_VERSION_HEX < 0x03020000 { PyObject_HEAD_INIT(NULL) NULL, 0, NULL }, #else PyModuleDef_HEAD_INIT, #endif "mixer", 0, /* m_doc */ -1, /* m_size */ __pyx_methods /* m_methods */, NULL, /* m_reload */ NULL, /* m_traverse */ NULL, /* m_clear */ NULL /* m_free */ }; #endif static __Pyx_StringTabEntry __pyx_string_tab[] = { {&__pyx_n_s_Lock, __pyx_k_Lock, sizeof(__pyx_k_Lock), 0, 0, 1, 1}, {&__pyx_kp_u_Not_implemented, __pyx_k_Not_implemented, sizeof(__pyx_k_Not_implemented), 0, 1, 0, 0}, {&__pyx_n_s_Thread, __pyx_k_Thread, sizeof(__pyx_k_Thread), 0, 0, 1, 1}, {&__pyx_n_s__13, __pyx_k__13, sizeof(__pyx_k__13), 0, 0, 1, 1}, {&__pyx_kp_u__4, __pyx_k__4, sizeof(__pyx_k__4), 0, 1, 0, 0}, {&__pyx_n_s_append, __pyx_k_append, sizeof(__pyx_k_append), 0, 0, 1, 1}, {&__pyx_n_s_args, __pyx_k_args, sizeof(__pyx_k_args), 0, 0, 1, 1}, {&__pyx_n_s_buffer, __pyx_k_buffer, sizeof(__pyx_k_buffer), 0, 0, 1, 1}, {&__pyx_n_s_buffersize, __pyx_k_buffersize, sizeof(__pyx_k_buffersize), 0, 0, 1, 1}, {&__pyx_n_s_chan, __pyx_k_chan, sizeof(__pyx_k_chan), 0, 0, 1, 1}, {&__pyx_n_s_channel, __pyx_k_channel, sizeof(__pyx_k_channel), 0, 0, 1, 1}, {&__pyx_n_s_channels, __pyx_k_channels, sizeof(__pyx_k_channels), 0, 0, 1, 1}, {&__pyx_n_s_cid, __pyx_k_cid, sizeof(__pyx_k_cid), 0, 0, 1, 1}, {&__pyx_n_s_count, __pyx_k_count, sizeof(__pyx_k_count), 0, 0, 1, 1}, {&__pyx_n_s_enter, __pyx_k_enter, sizeof(__pyx_k_enter), 0, 0, 1, 1}, {&__pyx_n_s_error, __pyx_k_error, sizeof(__pyx_k_error), 0, 0, 1, 1}, {&__pyx_n_s_errors, __pyx_k_errors, sizeof(__pyx_k_errors), 0, 0, 1, 1}, {&__pyx_n_s_exit, __pyx_k_exit, sizeof(__pyx_k_exit), 0, 0, 1, 1}, {&__pyx_n_s_fade_ms, __pyx_k_fade_ms, sizeof(__pyx_k_fade_ms), 0, 0, 1, 1}, {&__pyx_n_s_fadeout, __pyx_k_fadeout, sizeof(__pyx_k_fadeout), 0, 0, 1, 1}, {&__pyx_n_s_fi, __pyx_k_fi, sizeof(__pyx_k_fi), 0, 0, 1, 1}, {&__pyx_n_s_find_channel, __pyx_k_find_channel, sizeof(__pyx_k_find_channel), 0, 0, 1, 1}, {&__pyx_n_s_flag, __pyx_k_flag, sizeof(__pyx_k_flag), 0, 0, 1, 1}, {&__pyx_n_s_force, __pyx_k_force, sizeof(__pyx_k_force), 0, 0, 1, 1}, {&__pyx_n_s_format, __pyx_k_format, sizeof(__pyx_k_format), 0, 0, 1, 1}, {&__pyx_n_s_frequency, __pyx_k_frequency, sizeof(__pyx_k_frequency), 0, 0, 1, 1}, {&__pyx_n_s_get, __pyx_k_get, sizeof(__pyx_k_get), 0, 0, 1, 1}, {&__pyx_n_s_get_busy, __pyx_k_get_busy, sizeof(__pyx_k_get_busy), 0, 0, 1, 1}, {&__pyx_n_s_get_init, __pyx_k_get_init, sizeof(__pyx_k_get_init), 0, 0, 1, 1}, {&__pyx_n_s_get_num_channels, __pyx_k_get_num_channels, sizeof(__pyx_k_get_num_channels), 0, 0, 1, 1}, {&__pyx_kp_s_home_tom_ab_pygame_sdl2_src_pyg, __pyx_k_home_tom_ab_pygame_sdl2_src_pyg, sizeof(__pyx_k_home_tom_ab_pygame_sdl2_src_pyg), 0, 0, 1, 0}, {&__pyx_n_s_import, __pyx_k_import, sizeof(__pyx_k_import), 0, 0, 1, 1}, {&__pyx_n_s_init, __pyx_k_init, sizeof(__pyx_k_init), 0, 0, 1, 1}, {&__pyx_n_s_lock, __pyx_k_lock, sizeof(__pyx_k_lock), 0, 0, 1, 1}, {&__pyx_n_s_loops, __pyx_k_loops, sizeof(__pyx_k_loops), 0, 0, 1, 1}, {&__pyx_n_s_main, __pyx_k_main, sizeof(__pyx_k_main), 0, 0, 1, 1}, {&__pyx_n_s_maxtime, __pyx_k_maxtime, sizeof(__pyx_k_maxtime), 0, 0, 1, 1}, {&__pyx_n_s_ms, __pyx_k_ms, sizeof(__pyx_k_ms), 0, 0, 1, 1}, {&__pyx_n_s_music, __pyx_k_music, sizeof(__pyx_k_music), 0, 0, 1, 1}, {&__pyx_n_s_next_sound, __pyx_k_next_sound, sizeof(__pyx_k_next_sound), 0, 0, 1, 1}, {&__pyx_n_s_pause, __pyx_k_pause, sizeof(__pyx_k_pause), 0, 0, 1, 1}, {&__pyx_n_s_play, __pyx_k_play, sizeof(__pyx_k_play), 0, 0, 1, 1}, {&__pyx_n_s_play_current, __pyx_k_play_current, sizeof(__pyx_k_play_current), 0, 0, 1, 1}, {&__pyx_n_s_pre_init, __pyx_k_pre_init, sizeof(__pyx_k_pre_init), 0, 0, 1, 1}, {&__pyx_n_s_pygame_sdl2, __pyx_k_pygame_sdl2, sizeof(__pyx_k_pygame_sdl2), 0, 0, 1, 1}, {&__pyx_n_s_pygame_sdl2_error, __pyx_k_pygame_sdl2_error, sizeof(__pyx_k_pygame_sdl2_error), 0, 0, 1, 1}, {&__pyx_n_s_pygame_sdl2_mixer, __pyx_k_pygame_sdl2_mixer, sizeof(__pyx_k_pygame_sdl2_mixer), 0, 0, 1, 1}, {&__pyx_n_s_pygame_sdl2_mixer_music, __pyx_k_pygame_sdl2_mixer_music, sizeof(__pyx_k_pygame_sdl2_mixer_music), 0, 0, 1, 1}, {&__pyx_n_s_quit, __pyx_k_quit, sizeof(__pyx_k_quit), 0, 0, 1, 1}, {&__pyx_n_s_register_init, __pyx_k_register_init, sizeof(__pyx_k_register_init), 0, 0, 1, 1}, {&__pyx_n_s_register_quit, __pyx_k_register_quit, sizeof(__pyx_k_register_quit), 0, 0, 1, 1}, {&__pyx_n_s_set_num_channels, __pyx_k_set_num_channels, sizeof(__pyx_k_set_num_channels), 0, 0, 1, 1}, {&__pyx_n_s_set_reserved, __pyx_k_set_reserved, sizeof(__pyx_k_set_reserved), 0, 0, 1, 1}, {&__pyx_n_s_size, __pyx_k_size, sizeof(__pyx_k_size), 0, 0, 1, 1}, {&__pyx_n_s_sound, __pyx_k_sound, sizeof(__pyx_k_sound), 0, 0, 1, 1}, {&__pyx_n_s_start, __pyx_k_start, sizeof(__pyx_k_start), 0, 0, 1, 1}, {&__pyx_n_s_stop, __pyx_k_stop, sizeof(__pyx_k_stop), 0, 0, 1, 1}, {&__pyx_n_s_sys, __pyx_k_sys, sizeof(__pyx_k_sys), 0, 0, 1, 1}, {&__pyx_n_s_target, __pyx_k_target, sizeof(__pyx_k_target), 0, 0, 1, 1}, {&__pyx_n_s_test, __pyx_k_test, sizeof(__pyx_k_test), 0, 0, 1, 1}, {&__pyx_n_s_threading, __pyx_k_threading, sizeof(__pyx_k_threading), 0, 0, 1, 1}, {&__pyx_n_s_time, __pyx_k_time, sizeof(__pyx_k_time), 0, 0, 1, 1}, {&__pyx_n_s_type, __pyx_k_type, sizeof(__pyx_k_type), 0, 0, 1, 1}, {&__pyx_n_s_unpause, __pyx_k_unpause, sizeof(__pyx_k_unpause), 0, 0, 1, 1}, {0, 0, 0, 0, 0, 0, 0} }; static int __Pyx_InitCachedBuiltins(void) { return 0; } static int __Pyx_InitCachedConstants(void) { __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__Pyx_InitCachedConstants", 0); /* "pygame_sdl2/mixer.pyx":50 * cdef Sound next_sound * * with _lock: # <<<<<<<<<<<<<< * next_sound = channel_queued[channel] * current_sounds[channel] = next_sound */ __pyx_tuple_ = PyTuple_Pack(3, Py_None, Py_None, Py_None); if (unlikely(!__pyx_tuple_)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 50; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_tuple_); __Pyx_GIVEREF(__pyx_tuple_); /* "pygame_sdl2/mixer.pyx":71 * SDL_PushEvent(&e) * * with _lock: # <<<<<<<<<<<<<< * next_sound = channel_queued.get(channel) * if next_sound: */ __pyx_tuple__2 = PyTuple_Pack(3, Py_None, Py_None, Py_None); if (unlikely(!__pyx_tuple__2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 71; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_tuple__2); __Pyx_GIVEREF(__pyx_tuple__2); /* "pygame_sdl2/mixer.pyx":246 * def get_raw(self): * # return self.chunk.abuf * raise error("Not implemented.") # <<<<<<<<<<<<<< * * */ __pyx_tuple__6 = PyTuple_Pack(1, __pyx_kp_u_Not_implemented); if (unlikely(!__pyx_tuple__6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 246; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_tuple__6); __Pyx_GIVEREF(__pyx_tuple__6); /* "pygame_sdl2/mixer.pyx":269 * raise error() * * with _lock: # <<<<<<<<<<<<<< * current_sounds[self.cid] = sound * */ __pyx_tuple__7 = PyTuple_Pack(3, Py_None, Py_None, Py_None); if (unlikely(!__pyx_tuple__7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 269; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_tuple__7); __Pyx_GIVEREF(__pyx_tuple__7); /* "pygame_sdl2/mixer.pyx":300 * * def get_sound(self): * with _lock: # <<<<<<<<<<<<<< * return current_sounds.get(self.cid) * */ __pyx_tuple__8 = PyTuple_Pack(3, Py_None, Py_None, Py_None); if (unlikely(!__pyx_tuple__8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 300; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_tuple__8); __Pyx_GIVEREF(__pyx_tuple__8); __pyx_tuple__9 = PyTuple_Pack(3, Py_None, Py_None, Py_None); if (unlikely(!__pyx_tuple__9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 300; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_tuple__9); __Pyx_GIVEREF(__pyx_tuple__9); /* "pygame_sdl2/mixer.pyx":305 * def queue(self, Sound sound): * if self.get_busy(): * with _lock: # <<<<<<<<<<<<<< * channel_queued[self.cid] = sound * else: */ __pyx_tuple__10 = PyTuple_Pack(3, Py_None, Py_None, Py_None); if (unlikely(!__pyx_tuple__10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 305; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_tuple__10); __Pyx_GIVEREF(__pyx_tuple__10); /* "pygame_sdl2/mixer.pyx":311 * * def get_queue(self): * with _lock: # <<<<<<<<<<<<<< * return channel_queued.get(self.cid) * */ __pyx_tuple__11 = PyTuple_Pack(3, Py_None, Py_None, Py_None); if (unlikely(!__pyx_tuple__11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 311; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_tuple__11); __Pyx_GIVEREF(__pyx_tuple__11); __pyx_tuple__12 = PyTuple_Pack(3, Py_None, Py_None, Py_None); if (unlikely(!__pyx_tuple__12)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 311; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_tuple__12); __Pyx_GIVEREF(__pyx_tuple__12); /* "pygame_sdl2/mixer.pyx":41 * _lock = threading.Lock() * * def _play_current(int channel): # <<<<<<<<<<<<<< * """ * Caled by channel_callback to play the next sound. This has to be called */ __pyx_tuple__14 = PyTuple_Pack(3, __pyx_n_s_channel, __pyx_n_s_channel, __pyx_n_s_next_sound); if (unlikely(!__pyx_tuple__14)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 41; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_tuple__14); __Pyx_GIVEREF(__pyx_tuple__14); __pyx_codeobj__15 = (PyObject*)__Pyx_PyCode_New(1, 0, 3, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__14, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_tom_ab_pygame_sdl2_src_pyg, __pyx_n_s_play_current, 41, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__15)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 41; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "pygame_sdl2/mixer.pyx":80 * * @pygame_sdl2.register_init * def init(frequency=22050, size=MIX_DEFAULT_FORMAT, channels=2, buffer=4096): # <<<<<<<<<<<<<< * if get_init() is not None: * return */ __pyx_tuple__16 = PyTuple_Pack(5, __pyx_n_s_frequency, __pyx_n_s_size, __pyx_n_s_channels, __pyx_n_s_buffer, __pyx_n_s_flag); if (unlikely(!__pyx_tuple__16)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 80; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_tuple__16); __Pyx_GIVEREF(__pyx_tuple__16); __pyx_codeobj__17 = (PyObject*)__Pyx_PyCode_New(4, 0, 5, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__16, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_tom_ab_pygame_sdl2_src_pyg, __pyx_n_s_init, 80, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__17)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 80; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "pygame_sdl2/mixer.pyx":101 * Mix_ChannelFinished(channel_callback) * * def pre_init(frequency=22050, size=MIX_DEFAULT_FORMAT, channels=2, buffersize=4096): # <<<<<<<<<<<<<< * global preinit_args * preinit_args = (frequency, size, channels, buffersize) */ __pyx_tuple__18 = PyTuple_Pack(4, __pyx_n_s_frequency, __pyx_n_s_size, __pyx_n_s_channels, __pyx_n_s_buffersize); if (unlikely(!__pyx_tuple__18)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 101; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_tuple__18); __Pyx_GIVEREF(__pyx_tuple__18); __pyx_codeobj__19 = (PyObject*)__Pyx_PyCode_New(4, 0, 4, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__18, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_tom_ab_pygame_sdl2_src_pyg, __pyx_n_s_pre_init, 101, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__19)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 101; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "pygame_sdl2/mixer.pyx":106 * * @pygame_sdl2.register_quit * def quit(): # @ReservedAssignment # <<<<<<<<<<<<<< * Mix_CloseAudio() * Mix_Quit() */ __pyx_codeobj__20 = (PyObject*)__Pyx_PyCode_New(0, 0, 0, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_tom_ab_pygame_sdl2_src_pyg, __pyx_n_s_quit, 106, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__20)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 106; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "pygame_sdl2/mixer.pyx":110 * Mix_Quit() * * def get_init(): # <<<<<<<<<<<<<< * cdef int frequency * cdef Uint16 format */ __pyx_tuple__21 = PyTuple_Pack(3, __pyx_n_s_frequency, __pyx_n_s_format, __pyx_n_s_channels); if (unlikely(!__pyx_tuple__21)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 110; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_tuple__21); __Pyx_GIVEREF(__pyx_tuple__21); __pyx_codeobj__22 = (PyObject*)__Pyx_PyCode_New(0, 0, 3, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__21, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_tom_ab_pygame_sdl2_src_pyg, __pyx_n_s_get_init, 110, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__22)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 110; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "pygame_sdl2/mixer.pyx":120 * return frequency, format, channels * * def stop(): # <<<<<<<<<<<<<< * with nogil: * Mix_HaltChannel(-1) */ __pyx_codeobj__23 = (PyObject*)__Pyx_PyCode_New(0, 0, 0, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_tom_ab_pygame_sdl2_src_pyg, __pyx_n_s_stop, 120, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__23)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 120; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "pygame_sdl2/mixer.pyx":124 * Mix_HaltChannel(-1) * * def pause(): # <<<<<<<<<<<<<< * with nogil: * Mix_Pause(-1) */ __pyx_codeobj__24 = (PyObject*)__Pyx_PyCode_New(0, 0, 0, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_tom_ab_pygame_sdl2_src_pyg, __pyx_n_s_pause, 124, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__24)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 124; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "pygame_sdl2/mixer.pyx":128 * Mix_Pause(-1) * * def unpause(): # <<<<<<<<<<<<<< * with nogil: * Mix_Resume(-1) */ __pyx_codeobj__25 = (PyObject*)__Pyx_PyCode_New(0, 0, 0, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_tom_ab_pygame_sdl2_src_pyg, __pyx_n_s_unpause, 128, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__25)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 128; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "pygame_sdl2/mixer.pyx":132 * Mix_Resume(-1) * * def fadeout(time): # <<<<<<<<<<<<<< * cdef int ms = time * with nogil: */ __pyx_tuple__26 = PyTuple_Pack(2, __pyx_n_s_time, __pyx_n_s_ms); if (unlikely(!__pyx_tuple__26)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 132; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_tuple__26); __Pyx_GIVEREF(__pyx_tuple__26); __pyx_codeobj__27 = (PyObject*)__Pyx_PyCode_New(1, 0, 2, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__26, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_tom_ab_pygame_sdl2_src_pyg, __pyx_n_s_fadeout, 132, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__27)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 132; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "pygame_sdl2/mixer.pyx":137 * Mix_FadeOutChannel(-1, ms) * * def set_num_channels(count): # <<<<<<<<<<<<<< * Mix_AllocateChannels(count) * */ __pyx_tuple__28 = PyTuple_Pack(1, __pyx_n_s_count); if (unlikely(!__pyx_tuple__28)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 137; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_tuple__28); __Pyx_GIVEREF(__pyx_tuple__28); __pyx_codeobj__29 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__28, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_tom_ab_pygame_sdl2_src_pyg, __pyx_n_s_set_num_channels, 137, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__29)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 137; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "pygame_sdl2/mixer.pyx":140 * Mix_AllocateChannels(count) * * def get_num_channels(): # <<<<<<<<<<<<<< * return Mix_AllocateChannels(-1) * */ __pyx_codeobj__30 = (PyObject*)__Pyx_PyCode_New(0, 0, 0, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_tom_ab_pygame_sdl2_src_pyg, __pyx_n_s_get_num_channels, 140, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__30)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 140; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "pygame_sdl2/mixer.pyx":143 * return Mix_AllocateChannels(-1) * * def set_reserved(count): # <<<<<<<<<<<<<< * Mix_ReserveChannels(count) * */ __pyx_tuple__31 = PyTuple_Pack(1, __pyx_n_s_count); if (unlikely(!__pyx_tuple__31)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 143; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_tuple__31); __Pyx_GIVEREF(__pyx_tuple__31); __pyx_codeobj__32 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__31, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_tom_ab_pygame_sdl2_src_pyg, __pyx_n_s_set_reserved, 143, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__32)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 143; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "pygame_sdl2/mixer.pyx":146 * Mix_ReserveChannels(count) * * def find_channel(force=False): # <<<<<<<<<<<<<< * cdef int chan * chan = Mix_GroupAvailable(-1) */ __pyx_tuple__33 = PyTuple_Pack(2, __pyx_n_s_force, __pyx_n_s_chan); if (unlikely(!__pyx_tuple__33)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 146; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_tuple__33); __Pyx_GIVEREF(__pyx_tuple__33); __pyx_codeobj__34 = (PyObject*)__Pyx_PyCode_New(1, 0, 2, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__33, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_tom_ab_pygame_sdl2_src_pyg, __pyx_n_s_find_channel, 146, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__34)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 146; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "pygame_sdl2/mixer.pyx":157 * return Channel(chan) * * def get_busy(): # <<<<<<<<<<<<<< * return Mix_GroupNewer(-1) != -1 * */ __pyx_codeobj__35 = (PyObject*)__Pyx_PyCode_New(0, 0, 0, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_tom_ab_pygame_sdl2_src_pyg, __pyx_n_s_get_busy, 157, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__35)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 157; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_RefNannyFinishContext(); return 0; __pyx_L1_error:; __Pyx_RefNannyFinishContext(); return -1; } static int __Pyx_InitGlobals(void) { if (__Pyx_InitStrings(__pyx_string_tab) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; __pyx_int_0 = PyInt_FromLong(0); if (unlikely(!__pyx_int_0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_int_2 = PyInt_FromLong(2); if (unlikely(!__pyx_int_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_int_4096 = PyInt_FromLong(4096); if (unlikely(!__pyx_int_4096)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_int_22050 = PyInt_FromLong(22050L); if (unlikely(!__pyx_int_22050)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_int_neg_1 = PyInt_FromLong(-1); if (unlikely(!__pyx_int_neg_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} return 0; __pyx_L1_error:; return -1; } #if PY_MAJOR_VERSION < 3 PyMODINIT_FUNC initmixer(void); /*proto*/ PyMODINIT_FUNC initmixer(void) #else PyMODINIT_FUNC PyInit_mixer(void); /*proto*/ PyMODINIT_FUNC PyInit_mixer(void) #endif { PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; PyObject *__pyx_t_5 = NULL; PyObject *__pyx_t_6 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannyDeclarations #if CYTHON_REFNANNY __Pyx_RefNanny = __Pyx_RefNannyImportAPI("refnanny"); if (!__Pyx_RefNanny) { PyErr_Clear(); __Pyx_RefNanny = __Pyx_RefNannyImportAPI("Cython.Runtime.refnanny"); if (!__Pyx_RefNanny) Py_FatalError("failed to import 'refnanny' module"); } #endif __Pyx_RefNannySetupContext("PyMODINIT_FUNC PyInit_mixer(void)", 0); if (__Pyx_check_binary_version() < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_empty_tuple = PyTuple_New(0); if (unlikely(!__pyx_empty_tuple)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_empty_bytes = PyBytes_FromStringAndSize("", 0); if (unlikely(!__pyx_empty_bytes)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} #ifdef __Pyx_CyFunction_USED if (__pyx_CyFunction_init() < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} #endif #ifdef __Pyx_FusedFunction_USED if (__pyx_FusedFunction_init() < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} #endif #ifdef __Pyx_Coroutine_USED if (__pyx_Coroutine_init() < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} #endif #ifdef __Pyx_Generator_USED if (__pyx_Generator_init() < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} #endif #ifdef __Pyx_StopAsyncIteration_USED if (__pyx_StopAsyncIteration_init() < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} #endif /*--- Library function declarations ---*/ /*--- Threads initialization code ---*/ #if defined(__PYX_FORCE_INIT_THREADS) && __PYX_FORCE_INIT_THREADS #ifdef WITH_THREAD /* Python build with threading support? */ PyEval_InitThreads(); #endif #endif /*--- Module creation code ---*/ #if PY_MAJOR_VERSION < 3 __pyx_m = Py_InitModule4("mixer", __pyx_methods, 0, 0, PYTHON_API_VERSION); Py_XINCREF(__pyx_m); #else __pyx_m = PyModule_Create(&__pyx_moduledef); #endif if (unlikely(!__pyx_m)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_d = PyModule_GetDict(__pyx_m); if (unlikely(!__pyx_d)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} Py_INCREF(__pyx_d); __pyx_b = PyImport_AddModule(__Pyx_BUILTIN_MODULE_NAME); if (unlikely(!__pyx_b)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} #if CYTHON_COMPILING_IN_PYPY Py_INCREF(__pyx_b); #endif if (PyObject_SetAttrString(__pyx_m, "__builtins__", __pyx_b) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; /*--- Initialize various global constants etc. ---*/ if (__Pyx_InitGlobals() < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} #if PY_MAJOR_VERSION < 3 && (__PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT) if (__Pyx_init_sys_getdefaultencoding_params() < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} #endif if (__pyx_module_is_main_pygame_sdl2__mixer) { if (PyObject_SetAttrString(__pyx_m, "__name__", __pyx_n_s_main) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } #if PY_MAJOR_VERSION >= 3 { PyObject *modules = PyImport_GetModuleDict(); if (unlikely(!modules)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} if (!PyDict_GetItemString(modules, "pygame_sdl2.mixer")) { if (unlikely(PyDict_SetItemString(modules, "pygame_sdl2.mixer", __pyx_m) < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } } #endif /*--- Builtin init code ---*/ if (__Pyx_InitCachedBuiltins() < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /*--- Constants init code ---*/ if (__Pyx_InitCachedConstants() < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /*--- Global init code ---*/ __pyx_v_11pygame_sdl2_5mixer_preinit_args = Py_None; Py_INCREF(Py_None); __pyx_v_11pygame_sdl2_5mixer_output_spec = Py_None; Py_INCREF(Py_None); __pyx_v_11pygame_sdl2_5mixer_channel_events = ((PyObject*)Py_None); Py_INCREF(Py_None); __pyx_v_11pygame_sdl2_5mixer_channel_queued = ((PyObject*)Py_None); Py_INCREF(Py_None); __pyx_v_11pygame_sdl2_5mixer_current_sounds = ((PyObject*)Py_None); Py_INCREF(Py_None); /*--- Variable export code ---*/ /*--- Function export code ---*/ /*--- Type init code ---*/ if (PyType_Ready(&__pyx_type_11pygame_sdl2_5mixer_Sound) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 161; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_type_11pygame_sdl2_5mixer_Sound.tp_print = 0; if (PyObject_SetAttrString(__pyx_m, "Sound", (PyObject *)&__pyx_type_11pygame_sdl2_5mixer_Sound) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 161; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_ptype_11pygame_sdl2_5mixer_Sound = &__pyx_type_11pygame_sdl2_5mixer_Sound; if (PyType_Ready(&__pyx_type_11pygame_sdl2_5mixer_Channel) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 249; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_type_11pygame_sdl2_5mixer_Channel.tp_print = 0; if (PyObject_SetAttrString(__pyx_m, "Channel", (PyObject *)&__pyx_type_11pygame_sdl2_5mixer_Channel) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 249; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_ptype_11pygame_sdl2_5mixer_Channel = &__pyx_type_11pygame_sdl2_5mixer_Channel; /*--- Type import code ---*/ /*--- Variable import code ---*/ /*--- Function import code ---*/ __pyx_t_1 = __Pyx_ImportModule("pygame_sdl2.rwobject"); if (!__pyx_t_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} if (__Pyx_ImportFunction(__pyx_t_1, "to_rwops", (void (**)(void))&__pyx_f_11pygame_sdl2_8rwobject_to_rwops, "SDL_RWops *(PyObject *, struct __pyx_opt_args_11pygame_sdl2_8rwobject_to_rwops *__pyx_optional_args)") < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} Py_DECREF(__pyx_t_1); __pyx_t_1 = 0; /*--- Execution code ---*/ #if defined(__Pyx_Generator_USED) || defined(__Pyx_Coroutine_USED) if (__Pyx_patch_abc() < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} #endif /* "pygame_sdl2/mixer.pyx":24 * from libc.string cimport memset * * import sys # <<<<<<<<<<<<<< * import threading * from pygame_sdl2.error import error */ __pyx_t_2 = __Pyx_Import(__pyx_n_s_sys, 0, 0); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 24; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_sys, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 24; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "pygame_sdl2/mixer.pyx":25 * * import sys * import threading # <<<<<<<<<<<<<< * from pygame_sdl2.error import error * */ __pyx_t_2 = __Pyx_Import(__pyx_n_s_threading, 0, 0); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 25; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_threading, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 25; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "pygame_sdl2/mixer.pyx":26 * import sys * import threading * from pygame_sdl2.error import error # <<<<<<<<<<<<<< * * import pygame_sdl2.mixer_music as music */ __pyx_t_2 = PyList_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 26; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __Pyx_INCREF(__pyx_n_s_error); __Pyx_GIVEREF(__pyx_n_s_error); PyList_SET_ITEM(__pyx_t_2, 0, __pyx_n_s_error); __pyx_t_3 = __Pyx_Import(__pyx_n_s_pygame_sdl2_error, __pyx_t_2, 0); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 26; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_2 = __Pyx_ImportFrom(__pyx_t_3, __pyx_n_s_error); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 26; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_error, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 26; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "pygame_sdl2/mixer.pyx":28 * from pygame_sdl2.error import error * * import pygame_sdl2.mixer_music as music # <<<<<<<<<<<<<< * import pygame_sdl2 * */ __pyx_t_3 = PyList_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 28; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __Pyx_INCREF(__pyx_n_s__13); __Pyx_GIVEREF(__pyx_n_s__13); PyList_SET_ITEM(__pyx_t_3, 0, __pyx_n_s__13); __pyx_t_2 = __Pyx_Import(__pyx_n_s_pygame_sdl2_mixer_music, __pyx_t_3, 0); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 28; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; if (PyDict_SetItem(__pyx_d, __pyx_n_s_music, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 28; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "pygame_sdl2/mixer.pyx":29 * * import pygame_sdl2.mixer_music as music * import pygame_sdl2 # <<<<<<<<<<<<<< * * cdef object preinit_args = None */ __pyx_t_2 = __Pyx_Import(__pyx_n_s_pygame_sdl2, 0, 0); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 29; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_pygame_sdl2, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 29; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "pygame_sdl2/mixer.pyx":31 * import pygame_sdl2 * * cdef object preinit_args = None # <<<<<<<<<<<<<< * cdef object output_spec = None * */ __Pyx_INCREF(Py_None); __Pyx_XGOTREF(__pyx_v_11pygame_sdl2_5mixer_preinit_args); __Pyx_DECREF_SET(__pyx_v_11pygame_sdl2_5mixer_preinit_args, Py_None); __Pyx_GIVEREF(Py_None); /* "pygame_sdl2/mixer.pyx":32 * * cdef object preinit_args = None * cdef object output_spec = None # <<<<<<<<<<<<<< * * cdef dict channel_events = {} */ __Pyx_INCREF(Py_None); __Pyx_XGOTREF(__pyx_v_11pygame_sdl2_5mixer_output_spec); __Pyx_DECREF_SET(__pyx_v_11pygame_sdl2_5mixer_output_spec, Py_None); __Pyx_GIVEREF(Py_None); /* "pygame_sdl2/mixer.pyx":34 * cdef object output_spec = None * * cdef dict channel_events = {} # <<<<<<<<<<<<<< * cdef dict channel_queued = {} * cdef dict current_sounds = {} */ __pyx_t_2 = PyDict_New(); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 34; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __Pyx_XGOTREF(__pyx_v_11pygame_sdl2_5mixer_channel_events); __Pyx_DECREF_SET(__pyx_v_11pygame_sdl2_5mixer_channel_events, ((PyObject*)__pyx_t_2)); __Pyx_GIVEREF(__pyx_t_2); __pyx_t_2 = 0; /* "pygame_sdl2/mixer.pyx":35 * * cdef dict channel_events = {} * cdef dict channel_queued = {} # <<<<<<<<<<<<<< * cdef dict current_sounds = {} * */ __pyx_t_2 = PyDict_New(); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 35; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __Pyx_XGOTREF(__pyx_v_11pygame_sdl2_5mixer_channel_queued); __Pyx_DECREF_SET(__pyx_v_11pygame_sdl2_5mixer_channel_queued, ((PyObject*)__pyx_t_2)); __Pyx_GIVEREF(__pyx_t_2); __pyx_t_2 = 0; /* "pygame_sdl2/mixer.pyx":36 * cdef dict channel_events = {} * cdef dict channel_queued = {} * cdef dict current_sounds = {} # <<<<<<<<<<<<<< * * # The lock protects channel_queued and current_sounds. */ __pyx_t_2 = PyDict_New(); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 36; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __Pyx_XGOTREF(__pyx_v_11pygame_sdl2_5mixer_current_sounds); __Pyx_DECREF_SET(__pyx_v_11pygame_sdl2_5mixer_current_sounds, ((PyObject*)__pyx_t_2)); __Pyx_GIVEREF(__pyx_t_2); __pyx_t_2 = 0; /* "pygame_sdl2/mixer.pyx":39 * * # The lock protects channel_queued and current_sounds. * _lock = threading.Lock() # <<<<<<<<<<<<<< * * def _play_current(int channel): */ __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_threading); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 39; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_Lock); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 39; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_3 = NULL; if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_4))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_4); if (likely(__pyx_t_3)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_4, function); } } if (__pyx_t_3) { __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_3); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 39; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } else { __pyx_t_2 = __Pyx_PyObject_CallNoArg(__pyx_t_4); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 39; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; if (PyDict_SetItem(__pyx_d, __pyx_n_s_lock, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 39; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "pygame_sdl2/mixer.pyx":41 * _lock = threading.Lock() * * def _play_current(int channel): # <<<<<<<<<<<<<< * """ * Caled by channel_callback to play the next sound. This has to be called */ __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_11pygame_sdl2_5mixer_1_play_current, NULL, __pyx_n_s_pygame_sdl2_mixer); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 41; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_play_current, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 41; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "pygame_sdl2/mixer.pyx":77 * * # A list of errors that occured during mixer initialization. * errors = [ ] # <<<<<<<<<<<<<< * * @pygame_sdl2.register_init */ __pyx_t_2 = PyList_New(0); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 77; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_errors, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 77; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "pygame_sdl2/mixer.pyx":80 * * @pygame_sdl2.register_init * def init(frequency=22050, size=MIX_DEFAULT_FORMAT, channels=2, buffer=4096): # <<<<<<<<<<<<<< * if get_init() is not None: * return */ __pyx_t_2 = __Pyx_PyInt_From_int(MIX_DEFAULT_FORMAT); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 80; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __pyx_k__3 = __pyx_t_2; __Pyx_GIVEREF(__pyx_t_2); __pyx_t_2 = 0; /* "pygame_sdl2/mixer.pyx":79 * errors = [ ] * * @pygame_sdl2.register_init # <<<<<<<<<<<<<< * def init(frequency=22050, size=MIX_DEFAULT_FORMAT, channels=2, buffer=4096): * if get_init() is not None: */ __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_pygame_sdl2); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 79; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_register_init); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 79; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; /* "pygame_sdl2/mixer.pyx":80 * * @pygame_sdl2.register_init * def init(frequency=22050, size=MIX_DEFAULT_FORMAT, channels=2, buffer=4096): # <<<<<<<<<<<<<< * if get_init() is not None: * return */ __pyx_t_4 = PyCFunction_NewEx(&__pyx_mdef_11pygame_sdl2_5mixer_3init, NULL, __pyx_n_s_pygame_sdl2_mixer); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 80; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); __pyx_t_5 = NULL; if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_3))) { __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_3); if (likely(__pyx_t_5)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); __Pyx_INCREF(__pyx_t_5); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_3, function); } } if (!__pyx_t_5) { __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 79; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_GOTREF(__pyx_t_2); } else { __pyx_t_6 = PyTuple_New(1+1); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 79; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_6); __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_5); __pyx_t_5 = NULL; __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_6, 0+1, __pyx_t_4); __pyx_t_4 = 0; __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_6, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 79; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; } __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; if (PyDict_SetItem(__pyx_d, __pyx_n_s_init, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 80; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "pygame_sdl2/mixer.pyx":101 * Mix_ChannelFinished(channel_callback) * * def pre_init(frequency=22050, size=MIX_DEFAULT_FORMAT, channels=2, buffersize=4096): # <<<<<<<<<<<<<< * global preinit_args * preinit_args = (frequency, size, channels, buffersize) */ __pyx_t_2 = __Pyx_PyInt_From_int(MIX_DEFAULT_FORMAT); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 101; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __pyx_k__5 = __pyx_t_2; __Pyx_GIVEREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_11pygame_sdl2_5mixer_5pre_init, NULL, __pyx_n_s_pygame_sdl2_mixer); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 101; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_pre_init, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 101; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "pygame_sdl2/mixer.pyx":105 * preinit_args = (frequency, size, channels, buffersize) * * @pygame_sdl2.register_quit # <<<<<<<<<<<<<< * def quit(): # @ReservedAssignment * Mix_CloseAudio() */ __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_pygame_sdl2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 105; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_register_quit); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 105; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "pygame_sdl2/mixer.pyx":106 * * @pygame_sdl2.register_quit * def quit(): # @ReservedAssignment # <<<<<<<<<<<<<< * Mix_CloseAudio() * Mix_Quit() */ __pyx_t_3 = PyCFunction_NewEx(&__pyx_mdef_11pygame_sdl2_5mixer_7quit, NULL, __pyx_n_s_pygame_sdl2_mixer); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 106; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = NULL; if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_6))) { __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_6); if (likely(__pyx_t_4)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6); __Pyx_INCREF(__pyx_t_4); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_6, function); } } if (!__pyx_t_4) { __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_6, __pyx_t_3); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 105; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_GOTREF(__pyx_t_2); } else { __pyx_t_5 = PyTuple_New(1+1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 105; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_4); __pyx_t_4 = NULL; __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_5, 0+1, __pyx_t_3); __pyx_t_3 = 0; __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_5, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 105; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; } __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; if (PyDict_SetItem(__pyx_d, __pyx_n_s_quit, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 106; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "pygame_sdl2/mixer.pyx":110 * Mix_Quit() * * def get_init(): # <<<<<<<<<<<<<< * cdef int frequency * cdef Uint16 format */ __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_11pygame_sdl2_5mixer_9get_init, NULL, __pyx_n_s_pygame_sdl2_mixer); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 110; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_get_init, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 110; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "pygame_sdl2/mixer.pyx":120 * return frequency, format, channels * * def stop(): # <<<<<<<<<<<<<< * with nogil: * Mix_HaltChannel(-1) */ __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_11pygame_sdl2_5mixer_11stop, NULL, __pyx_n_s_pygame_sdl2_mixer); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 120; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_stop, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 120; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "pygame_sdl2/mixer.pyx":124 * Mix_HaltChannel(-1) * * def pause(): # <<<<<<<<<<<<<< * with nogil: * Mix_Pause(-1) */ __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_11pygame_sdl2_5mixer_13pause, NULL, __pyx_n_s_pygame_sdl2_mixer); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 124; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_pause, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 124; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "pygame_sdl2/mixer.pyx":128 * Mix_Pause(-1) * * def unpause(): # <<<<<<<<<<<<<< * with nogil: * Mix_Resume(-1) */ __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_11pygame_sdl2_5mixer_15unpause, NULL, __pyx_n_s_pygame_sdl2_mixer); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 128; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_unpause, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 128; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "pygame_sdl2/mixer.pyx":132 * Mix_Resume(-1) * * def fadeout(time): # <<<<<<<<<<<<<< * cdef int ms = time * with nogil: */ __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_11pygame_sdl2_5mixer_17fadeout, NULL, __pyx_n_s_pygame_sdl2_mixer); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 132; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_fadeout, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 132; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "pygame_sdl2/mixer.pyx":137 * Mix_FadeOutChannel(-1, ms) * * def set_num_channels(count): # <<<<<<<<<<<<<< * Mix_AllocateChannels(count) * */ __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_11pygame_sdl2_5mixer_19set_num_channels, NULL, __pyx_n_s_pygame_sdl2_mixer); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 137; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_set_num_channels, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 137; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "pygame_sdl2/mixer.pyx":140 * Mix_AllocateChannels(count) * * def get_num_channels(): # <<<<<<<<<<<<<< * return Mix_AllocateChannels(-1) * */ __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_11pygame_sdl2_5mixer_21get_num_channels, NULL, __pyx_n_s_pygame_sdl2_mixer); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 140; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_get_num_channels, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 140; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "pygame_sdl2/mixer.pyx":143 * return Mix_AllocateChannels(-1) * * def set_reserved(count): # <<<<<<<<<<<<<< * Mix_ReserveChannels(count) * */ __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_11pygame_sdl2_5mixer_23set_reserved, NULL, __pyx_n_s_pygame_sdl2_mixer); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 143; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_set_reserved, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 143; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "pygame_sdl2/mixer.pyx":146 * Mix_ReserveChannels(count) * * def find_channel(force=False): # <<<<<<<<<<<<<< * cdef int chan * chan = Mix_GroupAvailable(-1) */ __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_11pygame_sdl2_5mixer_25find_channel, NULL, __pyx_n_s_pygame_sdl2_mixer); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 146; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_find_channel, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 146; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "pygame_sdl2/mixer.pyx":157 * return Channel(chan) * * def get_busy(): # <<<<<<<<<<<<<< * return Mix_GroupNewer(-1) != -1 * */ __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_11pygame_sdl2_5mixer_27get_busy, NULL, __pyx_n_s_pygame_sdl2_mixer); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 157; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_get_busy, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 157; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "pygame_sdl2/mixer.pyx":1 * # Copyright 2014 Patrick Dawson # <<<<<<<<<<<<<< * # * # This software is provided 'as-is', without any express or implied */ __pyx_t_2 = PyDict_New(); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_test, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /*--- Wrapped vars code ---*/ goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_5); __Pyx_XDECREF(__pyx_t_6); if (__pyx_m) { if (__pyx_d) { __Pyx_AddTraceback("init pygame_sdl2.mixer", __pyx_clineno, __pyx_lineno, __pyx_filename); } Py_DECREF(__pyx_m); __pyx_m = 0; } else if (!PyErr_Occurred()) { PyErr_SetString(PyExc_ImportError, "init pygame_sdl2.mixer"); } __pyx_L0:; __Pyx_RefNannyFinishContext(); #if PY_MAJOR_VERSION < 3 return; #else return __pyx_m; #endif } /* --- Runtime support code --- */ #if CYTHON_REFNANNY static __Pyx_RefNannyAPIStruct *__Pyx_RefNannyImportAPI(const char *modname) { PyObject *m = NULL, *p = NULL; void *r = NULL; m = PyImport_ImportModule((char *)modname); if (!m) goto end; p = PyObject_GetAttrString(m, (char *)"RefNannyAPI"); if (!p) goto end; r = PyLong_AsVoidPtr(p); end: Py_XDECREF(p); Py_XDECREF(m); return (__Pyx_RefNannyAPIStruct *)r; } #endif static PyObject *__Pyx_GetBuiltinName(PyObject *name) { PyObject* result = __Pyx_PyObject_GetAttrStr(__pyx_b, name); if (unlikely(!result)) { PyErr_Format(PyExc_NameError, #if PY_MAJOR_VERSION >= 3 "name '%U' is not defined", name); #else "name '%.200s' is not defined", PyString_AS_STRING(name)); #endif } return result; } static CYTHON_INLINE PyObject *__Pyx_GetModuleGlobalName(PyObject *name) { PyObject *result; #if CYTHON_COMPILING_IN_CPYTHON result = PyDict_GetItem(__pyx_d, name); if (likely(result)) { Py_INCREF(result); } else { #else result = PyObject_GetItem(__pyx_d, name); if (!result) { PyErr_Clear(); #endif result = __Pyx_GetBuiltinName(name); } return result; } #if CYTHON_COMPILING_IN_CPYTHON static CYTHON_INLINE PyObject* __Pyx_PyObject_Call(PyObject *func, PyObject *arg, PyObject *kw) { PyObject *result; ternaryfunc call = func->ob_type->tp_call; if (unlikely(!call)) return PyObject_Call(func, arg, kw); if (unlikely(Py_EnterRecursiveCall((char*)" while calling a Python object"))) return NULL; result = (*call)(func, arg, kw); Py_LeaveRecursiveCall(); if (unlikely(!result) && unlikely(!PyErr_Occurred())) { PyErr_SetString( PyExc_SystemError, "NULL result without error in PyObject_Call"); } return result; } #endif #if CYTHON_COMPILING_IN_CPYTHON static CYTHON_INLINE PyObject* __Pyx_PyObject_CallMethO(PyObject *func, PyObject *arg) { PyObject *self, *result; PyCFunction cfunc; cfunc = PyCFunction_GET_FUNCTION(func); self = PyCFunction_GET_SELF(func); if (unlikely(Py_EnterRecursiveCall((char*)" while calling a Python object"))) return NULL; result = cfunc(self, arg); Py_LeaveRecursiveCall(); if (unlikely(!result) && unlikely(!PyErr_Occurred())) { PyErr_SetString( PyExc_SystemError, "NULL result without error in PyObject_Call"); } return result; } #endif #if CYTHON_COMPILING_IN_CPYTHON static PyObject* __Pyx__PyObject_CallOneArg(PyObject *func, PyObject *arg) { PyObject *result; PyObject *args = PyTuple_New(1); if (unlikely(!args)) return NULL; Py_INCREF(arg); PyTuple_SET_ITEM(args, 0, arg); result = __Pyx_PyObject_Call(func, args, NULL); Py_DECREF(args); return result; } static CYTHON_INLINE PyObject* __Pyx_PyObject_CallOneArg(PyObject *func, PyObject *arg) { #ifdef __Pyx_CyFunction_USED if (likely(PyCFunction_Check(func) || PyObject_TypeCheck(func, __pyx_CyFunctionType))) { #else if (likely(PyCFunction_Check(func))) { #endif if (likely(PyCFunction_GET_FLAGS(func) & METH_O)) { return __Pyx_PyObject_CallMethO(func, arg); } } return __Pyx__PyObject_CallOneArg(func, arg); } #else static CYTHON_INLINE PyObject* __Pyx_PyObject_CallOneArg(PyObject *func, PyObject *arg) { PyObject *result; PyObject *args = PyTuple_Pack(1, arg); if (unlikely(!args)) return NULL; result = __Pyx_PyObject_Call(func, args, NULL); Py_DECREF(args); return result; } #endif #if CYTHON_COMPILING_IN_CPYTHON static CYTHON_INLINE PyObject* __Pyx_PyObject_CallNoArg(PyObject *func) { #ifdef __Pyx_CyFunction_USED if (likely(PyCFunction_Check(func) || PyObject_TypeCheck(func, __pyx_CyFunctionType))) { #else if (likely(PyCFunction_Check(func))) { #endif if (likely(PyCFunction_GET_FLAGS(func) & METH_NOARGS)) { return __Pyx_PyObject_CallMethO(func, NULL); } } return __Pyx_PyObject_Call(func, __pyx_empty_tuple, NULL); } #endif static CYTHON_INLINE int __Pyx_TypeTest(PyObject *obj, PyTypeObject *type) { if (unlikely(!type)) { PyErr_SetString(PyExc_SystemError, "Missing type object"); return 0; } if (likely(PyObject_TypeCheck(obj, type))) return 1; PyErr_Format(PyExc_TypeError, "Cannot convert %.200s to %.200s", Py_TYPE(obj)->tp_name, type->tp_name); return 0; } static CYTHON_INLINE void __Pyx_ExceptionSave(PyObject **type, PyObject **value, PyObject **tb) { #if CYTHON_COMPILING_IN_CPYTHON PyThreadState *tstate = PyThreadState_GET(); *type = tstate->exc_type; *value = tstate->exc_value; *tb = tstate->exc_traceback; Py_XINCREF(*type); Py_XINCREF(*value); Py_XINCREF(*tb); #else PyErr_GetExcInfo(type, value, tb); #endif } static void __Pyx_ExceptionReset(PyObject *type, PyObject *value, PyObject *tb) { #if CYTHON_COMPILING_IN_CPYTHON PyObject *tmp_type, *tmp_value, *tmp_tb; PyThreadState *tstate = PyThreadState_GET(); tmp_type = tstate->exc_type; tmp_value = tstate->exc_value; tmp_tb = tstate->exc_traceback; tstate->exc_type = type; tstate->exc_value = value; tstate->exc_traceback = tb; Py_XDECREF(tmp_type); Py_XDECREF(tmp_value); Py_XDECREF(tmp_tb); #else PyErr_SetExcInfo(type, value, tb); #endif } static int __Pyx_GetException(PyObject **type, PyObject **value, PyObject **tb) { PyObject *local_type, *local_value, *local_tb; #if CYTHON_COMPILING_IN_CPYTHON PyObject *tmp_type, *tmp_value, *tmp_tb; PyThreadState *tstate = PyThreadState_GET(); local_type = tstate->curexc_type; local_value = tstate->curexc_value; local_tb = tstate->curexc_traceback; tstate->curexc_type = 0; tstate->curexc_value = 0; tstate->curexc_traceback = 0; #else PyErr_Fetch(&local_type, &local_value, &local_tb); #endif PyErr_NormalizeException(&local_type, &local_value, &local_tb); #if CYTHON_COMPILING_IN_CPYTHON if (unlikely(tstate->curexc_type)) #else if (unlikely(PyErr_Occurred())) #endif goto bad; #if PY_MAJOR_VERSION >= 3 if (local_tb) { if (unlikely(PyException_SetTraceback(local_value, local_tb) < 0)) goto bad; } #endif Py_XINCREF(local_tb); Py_XINCREF(local_type); Py_XINCREF(local_value); *type = local_type; *value = local_value; *tb = local_tb; #if CYTHON_COMPILING_IN_CPYTHON tmp_type = tstate->exc_type; tmp_value = tstate->exc_value; tmp_tb = tstate->exc_traceback; tstate->exc_type = local_type; tstate->exc_value = local_value; tstate->exc_traceback = local_tb; Py_XDECREF(tmp_type); Py_XDECREF(tmp_value); Py_XDECREF(tmp_tb); #else PyErr_SetExcInfo(local_type, local_value, local_tb); #endif return 0; bad: *type = 0; *value = 0; *tb = 0; Py_XDECREF(local_type); Py_XDECREF(local_value); Py_XDECREF(local_tb); return -1; } static CYTHON_INLINE void __Pyx_ErrRestore(PyObject *type, PyObject *value, PyObject *tb) { #if CYTHON_COMPILING_IN_CPYTHON PyObject *tmp_type, *tmp_value, *tmp_tb; PyThreadState *tstate = PyThreadState_GET(); tmp_type = tstate->curexc_type; tmp_value = tstate->curexc_value; tmp_tb = tstate->curexc_traceback; tstate->curexc_type = type; tstate->curexc_value = value; tstate->curexc_traceback = tb; Py_XDECREF(tmp_type); Py_XDECREF(tmp_value); Py_XDECREF(tmp_tb); #else PyErr_Restore(type, value, tb); #endif } static CYTHON_INLINE void __Pyx_ErrFetch(PyObject **type, PyObject **value, PyObject **tb) { #if CYTHON_COMPILING_IN_CPYTHON PyThreadState *tstate = PyThreadState_GET(); *type = tstate->curexc_type; *value = tstate->curexc_value; *tb = tstate->curexc_traceback; tstate->curexc_type = 0; tstate->curexc_value = 0; tstate->curexc_traceback = 0; #else PyErr_Fetch(type, value, tb); #endif } static CYTHON_INLINE void __Pyx_RaiseUnboundLocalError(const char *varname) { PyErr_Format(PyExc_UnboundLocalError, "local variable '%s' referenced before assignment", varname); } static PyObject* __Pyx_PyDict_GetItemDefault(PyObject* d, PyObject* key, PyObject* default_value) { PyObject* value; #if PY_MAJOR_VERSION >= 3 && !CYTHON_COMPILING_IN_PYPY value = PyDict_GetItemWithError(d, key); if (unlikely(!value)) { if (unlikely(PyErr_Occurred())) return NULL; value = default_value; } Py_INCREF(value); #else if (PyString_CheckExact(key) || PyUnicode_CheckExact(key) || PyInt_CheckExact(key)) { value = PyDict_GetItem(d, key); if (unlikely(!value)) { value = default_value; } Py_INCREF(value); } else { if (default_value == Py_None) default_value = NULL; value = PyObject_CallMethodObjArgs( d, __pyx_n_s_get, key, default_value, NULL); } #endif return value; } static void __Pyx_WriteUnraisable(const char *name, CYTHON_UNUSED int clineno, CYTHON_UNUSED int lineno, CYTHON_UNUSED const char *filename, int full_traceback, CYTHON_UNUSED int nogil) { PyObject *old_exc, *old_val, *old_tb; PyObject *ctx; #ifdef WITH_THREAD PyGILState_STATE state; if (nogil) state = PyGILState_Ensure(); #endif __Pyx_ErrFetch(&old_exc, &old_val, &old_tb); if (full_traceback) { Py_XINCREF(old_exc); Py_XINCREF(old_val); Py_XINCREF(old_tb); __Pyx_ErrRestore(old_exc, old_val, old_tb); PyErr_PrintEx(1); } #if PY_MAJOR_VERSION < 3 ctx = PyString_FromString(name); #else ctx = PyUnicode_FromString(name); #endif __Pyx_ErrRestore(old_exc, old_val, old_tb); if (!ctx) { PyErr_WriteUnraisable(Py_None); } else { PyErr_WriteUnraisable(ctx); Py_DECREF(ctx); } #ifdef WITH_THREAD if (nogil) PyGILState_Release(state); #endif } static void __Pyx_RaiseDoubleKeywordsError( const char* func_name, PyObject* kw_name) { PyErr_Format(PyExc_TypeError, #if PY_MAJOR_VERSION >= 3 "%s() got multiple values for keyword argument '%U'", func_name, kw_name); #else "%s() got multiple values for keyword argument '%s'", func_name, PyString_AsString(kw_name)); #endif } static int __Pyx_ParseOptionalKeywords( PyObject *kwds, PyObject **argnames[], PyObject *kwds2, PyObject *values[], Py_ssize_t num_pos_args, const char* function_name) { PyObject *key = 0, *value = 0; Py_ssize_t pos = 0; PyObject*** name; PyObject*** first_kw_arg = argnames + num_pos_args; while (PyDict_Next(kwds, &pos, &key, &value)) { name = first_kw_arg; while (*name && (**name != key)) name++; if (*name) { values[name-argnames] = value; continue; } name = first_kw_arg; #if PY_MAJOR_VERSION < 3 if (likely(PyString_CheckExact(key)) || likely(PyString_Check(key))) { while (*name) { if ((CYTHON_COMPILING_IN_PYPY || PyString_GET_SIZE(**name) == PyString_GET_SIZE(key)) && _PyString_Eq(**name, key)) { values[name-argnames] = value; break; } name++; } if (*name) continue; else { PyObject*** argname = argnames; while (argname != first_kw_arg) { if ((**argname == key) || ( (CYTHON_COMPILING_IN_PYPY || PyString_GET_SIZE(**argname) == PyString_GET_SIZE(key)) && _PyString_Eq(**argname, key))) { goto arg_passed_twice; } argname++; } } } else #endif if (likely(PyUnicode_Check(key))) { while (*name) { int cmp = (**name == key) ? 0 : #if !CYTHON_COMPILING_IN_PYPY && PY_MAJOR_VERSION >= 3 (PyUnicode_GET_SIZE(**name) != PyUnicode_GET_SIZE(key)) ? 1 : #endif PyUnicode_Compare(**name, key); if (cmp < 0 && unlikely(PyErr_Occurred())) goto bad; if (cmp == 0) { values[name-argnames] = value; break; } name++; } if (*name) continue; else { PyObject*** argname = argnames; while (argname != first_kw_arg) { int cmp = (**argname == key) ? 0 : #if !CYTHON_COMPILING_IN_PYPY && PY_MAJOR_VERSION >= 3 (PyUnicode_GET_SIZE(**argname) != PyUnicode_GET_SIZE(key)) ? 1 : #endif PyUnicode_Compare(**argname, key); if (cmp < 0 && unlikely(PyErr_Occurred())) goto bad; if (cmp == 0) goto arg_passed_twice; argname++; } } } else goto invalid_keyword_type; if (kwds2) { if (unlikely(PyDict_SetItem(kwds2, key, value))) goto bad; } else { goto invalid_keyword; } } return 0; arg_passed_twice: __Pyx_RaiseDoubleKeywordsError(function_name, key); goto bad; invalid_keyword_type: PyErr_Format(PyExc_TypeError, "%.200s() keywords must be strings", function_name); goto bad; invalid_keyword: PyErr_Format(PyExc_TypeError, #if PY_MAJOR_VERSION < 3 "%.200s() got an unexpected keyword argument '%.200s'", function_name, PyString_AsString(key)); #else "%s() got an unexpected keyword argument '%U'", function_name, key); #endif bad: return -1; } static void __Pyx_RaiseArgtupleInvalid( const char* func_name, int exact, Py_ssize_t num_min, Py_ssize_t num_max, Py_ssize_t num_found) { Py_ssize_t num_expected; const char *more_or_less; if (num_found < num_min) { num_expected = num_min; more_or_less = "at least"; } else { num_expected = num_max; more_or_less = "at most"; } if (exact) { more_or_less = "exactly"; } PyErr_Format(PyExc_TypeError, "%.200s() takes %.8s %" CYTHON_FORMAT_SSIZE_T "d positional argument%.1s (%" CYTHON_FORMAT_SSIZE_T "d given)", func_name, more_or_less, num_expected, (num_expected == 1) ? "" : "s", num_found); } static PyObject* __Pyx_PyObject_CallMethod1(PyObject* obj, PyObject* method_name, PyObject* arg) { PyObject *method, *result = NULL; method = __Pyx_PyObject_GetAttrStr(obj, method_name); if (unlikely(!method)) goto bad; #if CYTHON_COMPILING_IN_CPYTHON if (likely(PyMethod_Check(method))) { PyObject *self = PyMethod_GET_SELF(method); if (likely(self)) { PyObject *args; PyObject *function = PyMethod_GET_FUNCTION(method); args = PyTuple_New(2); if (unlikely(!args)) goto bad; Py_INCREF(self); PyTuple_SET_ITEM(args, 0, self); Py_INCREF(arg); PyTuple_SET_ITEM(args, 1, arg); Py_INCREF(function); Py_DECREF(method); method = NULL; result = __Pyx_PyObject_Call(function, args, NULL); Py_DECREF(args); Py_DECREF(function); return result; } } #endif result = __Pyx_PyObject_CallOneArg(method, arg); bad: Py_XDECREF(method); return result; } static CYTHON_INLINE int __Pyx_PyObject_Append(PyObject* L, PyObject* x) { if (likely(PyList_CheckExact(L))) { if (unlikely(__Pyx_PyList_Append(L, x) < 0)) return -1; } else { PyObject* retval = __Pyx_PyObject_CallMethod1(L, __pyx_n_s_append, x); if (unlikely(!retval)) return -1; Py_DECREF(retval); } return 0; } static CYTHON_INLINE void __Pyx_RaiseTooManyValuesError(Py_ssize_t expected) { PyErr_Format(PyExc_ValueError, "too many values to unpack (expected %" CYTHON_FORMAT_SSIZE_T "d)", expected); } static CYTHON_INLINE void __Pyx_RaiseNeedMoreValuesError(Py_ssize_t index) { PyErr_Format(PyExc_ValueError, "need more than %" CYTHON_FORMAT_SSIZE_T "d value%.1s to unpack", index, (index == 1) ? "" : "s"); } static CYTHON_INLINE int __Pyx_IterFinish(void) { #if CYTHON_COMPILING_IN_CPYTHON PyThreadState *tstate = PyThreadState_GET(); PyObject* exc_type = tstate->curexc_type; if (unlikely(exc_type)) { if (likely(exc_type == PyExc_StopIteration) || PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration)) { PyObject *exc_value, *exc_tb; exc_value = tstate->curexc_value; exc_tb = tstate->curexc_traceback; tstate->curexc_type = 0; tstate->curexc_value = 0; tstate->curexc_traceback = 0; Py_DECREF(exc_type); Py_XDECREF(exc_value); Py_XDECREF(exc_tb); return 0; } else { return -1; } } return 0; #else if (unlikely(PyErr_Occurred())) { if (likely(PyErr_ExceptionMatches(PyExc_StopIteration))) { PyErr_Clear(); return 0; } else { return -1; } } return 0; #endif } static int __Pyx_IternextUnpackEndCheck(PyObject *retval, Py_ssize_t expected) { if (unlikely(retval)) { Py_DECREF(retval); __Pyx_RaiseTooManyValuesError(expected); return -1; } else { return __Pyx_IterFinish(); } return 0; } #if PY_MAJOR_VERSION < 3 static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, CYTHON_UNUSED PyObject *cause) { Py_XINCREF(type); if (!value || value == Py_None) value = NULL; else Py_INCREF(value); if (!tb || tb == Py_None) tb = NULL; else { Py_INCREF(tb); if (!PyTraceBack_Check(tb)) { PyErr_SetString(PyExc_TypeError, "raise: arg 3 must be a traceback or None"); goto raise_error; } } if (PyType_Check(type)) { #if CYTHON_COMPILING_IN_PYPY if (!value) { Py_INCREF(Py_None); value = Py_None; } #endif PyErr_NormalizeException(&type, &value, &tb); } else { if (value) { PyErr_SetString(PyExc_TypeError, "instance exception may not have a separate value"); goto raise_error; } value = type; type = (PyObject*) Py_TYPE(type); Py_INCREF(type); if (!PyType_IsSubtype((PyTypeObject *)type, (PyTypeObject *)PyExc_BaseException)) { PyErr_SetString(PyExc_TypeError, "raise: exception class must be a subclass of BaseException"); goto raise_error; } } __Pyx_ErrRestore(type, value, tb); return; raise_error: Py_XDECREF(value); Py_XDECREF(type); Py_XDECREF(tb); return; } #else static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, PyObject *cause) { PyObject* owned_instance = NULL; if (tb == Py_None) { tb = 0; } else if (tb && !PyTraceBack_Check(tb)) { PyErr_SetString(PyExc_TypeError, "raise: arg 3 must be a traceback or None"); goto bad; } if (value == Py_None) value = 0; if (PyExceptionInstance_Check(type)) { if (value) { PyErr_SetString(PyExc_TypeError, "instance exception may not have a separate value"); goto bad; } value = type; type = (PyObject*) Py_TYPE(value); } else if (PyExceptionClass_Check(type)) { PyObject *instance_class = NULL; if (value && PyExceptionInstance_Check(value)) { instance_class = (PyObject*) Py_TYPE(value); if (instance_class != type) { int is_subclass = PyObject_IsSubclass(instance_class, type); if (!is_subclass) { instance_class = NULL; } else if (unlikely(is_subclass == -1)) { goto bad; } else { type = instance_class; } } } if (!instance_class) { PyObject *args; if (!value) args = PyTuple_New(0); else if (PyTuple_Check(value)) { Py_INCREF(value); args = value; } else args = PyTuple_Pack(1, value); if (!args) goto bad; owned_instance = PyObject_Call(type, args, NULL); Py_DECREF(args); if (!owned_instance) goto bad; value = owned_instance; if (!PyExceptionInstance_Check(value)) { PyErr_Format(PyExc_TypeError, "calling %R should have returned an instance of " "BaseException, not %R", type, Py_TYPE(value)); goto bad; } } } else { PyErr_SetString(PyExc_TypeError, "raise: exception class must be a subclass of BaseException"); goto bad; } #if PY_VERSION_HEX >= 0x03030000 if (cause) { #else if (cause && cause != Py_None) { #endif PyObject *fixed_cause; if (cause == Py_None) { fixed_cause = NULL; } else if (PyExceptionClass_Check(cause)) { fixed_cause = PyObject_CallObject(cause, NULL); if (fixed_cause == NULL) goto bad; } else if (PyExceptionInstance_Check(cause)) { fixed_cause = cause; Py_INCREF(fixed_cause); } else { PyErr_SetString(PyExc_TypeError, "exception causes must derive from " "BaseException"); goto bad; } PyException_SetCause(value, fixed_cause); } PyErr_SetObject(type, value); if (tb) { #if CYTHON_COMPILING_IN_PYPY PyObject *tmp_type, *tmp_value, *tmp_tb; PyErr_Fetch(&tmp_type, &tmp_value, &tmp_tb); Py_INCREF(tb); PyErr_Restore(tmp_type, tmp_value, tb); Py_XDECREF(tmp_tb); #else PyThreadState *tstate = PyThreadState_GET(); PyObject* tmp_tb = tstate->curexc_traceback; if (tb != tmp_tb) { Py_INCREF(tb); tstate->curexc_traceback = tb; Py_XDECREF(tmp_tb); } #endif } bad: Py_XDECREF(owned_instance); return; } #endif static CYTHON_INLINE int __Pyx_CheckKeywordStrings( PyObject *kwdict, const char* function_name, int kw_allowed) { PyObject* key = 0; Py_ssize_t pos = 0; #if CYTHON_COMPILING_IN_PYPY if (!kw_allowed && PyDict_Next(kwdict, &pos, &key, 0)) goto invalid_keyword; return 1; #else while (PyDict_Next(kwdict, &pos, &key, 0)) { #if PY_MAJOR_VERSION < 3 if (unlikely(!PyString_CheckExact(key)) && unlikely(!PyString_Check(key))) #endif if (unlikely(!PyUnicode_Check(key))) goto invalid_keyword_type; } if ((!kw_allowed) && unlikely(key)) goto invalid_keyword; return 1; invalid_keyword_type: PyErr_Format(PyExc_TypeError, "%.200s() keywords must be strings", function_name); return 0; #endif invalid_keyword: PyErr_Format(PyExc_TypeError, #if PY_MAJOR_VERSION < 3 "%.200s() got an unexpected keyword argument '%.200s'", function_name, PyString_AsString(key)); #else "%s() got an unexpected keyword argument '%U'", function_name, key); #endif return 0; } #if CYTHON_USE_PYLONG_INTERNALS #include "longintrepr.h" #endif #if CYTHON_COMPILING_IN_CPYTHON static PyObject* __Pyx_PyInt_TrueDivideObjC(PyObject *op1, PyObject *op2, CYTHON_UNUSED long intval, CYTHON_UNUSED int inplace) { #if PY_MAJOR_VERSION < 3 if (likely(PyInt_CheckExact(op1))) { const long b = intval; long a = PyInt_AS_LONG(op1); if (8 * sizeof(long) <= 53 || likely(labs(a) <= (1L << 53))) { return PyFloat_FromDouble((double)a / (double)b); } return PyInt_Type.tp_as_number->nb_true_divide(op1, op2); } #endif #if CYTHON_USE_PYLONG_INTERNALS && PY_MAJOR_VERSION >= 3 if (likely(PyLong_CheckExact(op1))) { const long b = intval; long a, x; const digit* digits = ((PyLongObject*)op1)->ob_digit; const Py_ssize_t size = Py_SIZE(op1); if (likely(__Pyx_sst_abs(size) <= 1)) { a = likely(size) ? digits[0] : 0; if (size == -1) a = -a; } else { switch (size) { case -2: if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT && 1 * PyLong_SHIFT < 53) { a = -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])); break; } case 2: if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT && 1 * PyLong_SHIFT < 53) { a = (long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])); break; } case -3: if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT && 2 * PyLong_SHIFT < 53) { a = -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])); break; } case 3: if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT && 2 * PyLong_SHIFT < 53) { a = (long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])); break; } case -4: if (8 * sizeof(long) - 1 > 4 * PyLong_SHIFT && 3 * PyLong_SHIFT < 53) { a = -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])); break; } case 4: if (8 * sizeof(long) - 1 > 4 * PyLong_SHIFT && 3 * PyLong_SHIFT < 53) { a = (long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])); break; } default: return PyLong_Type.tp_as_number->nb_true_divide(op1, op2); } } if ((8 * sizeof(long) <= 53 || likely(labs(a) <= (1L << 53))) || __Pyx_sst_abs(size) <= 52 / PyLong_SHIFT) { return PyFloat_FromDouble((double)a / (double)b); } return PyLong_Type.tp_as_number->nb_true_divide(op1, op2); return PyLong_FromLong(x); } #endif if (PyFloat_CheckExact(op1)) { const long b = intval; double a = PyFloat_AS_DOUBLE(op1); double result; PyFPE_START_PROTECT("divide", return NULL) result = ((double)a) / (double)b; PyFPE_END_PROTECT(result) return PyFloat_FromDouble(result); } return (inplace ? PyNumber_InPlaceTrueDivide : PyNumber_TrueDivide)(op1, op2); } #endif static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Generic(PyObject *o, PyObject* j) { PyObject *r; if (!j) return NULL; r = PyObject_GetItem(o, j); Py_DECREF(j); return r; } static CYTHON_INLINE PyObject *__Pyx_GetItemInt_List_Fast(PyObject *o, Py_ssize_t i, CYTHON_NCP_UNUSED int wraparound, CYTHON_NCP_UNUSED int boundscheck) { #if CYTHON_COMPILING_IN_CPYTHON if (wraparound & unlikely(i < 0)) i += PyList_GET_SIZE(o); if ((!boundscheck) || likely((0 <= i) & (i < PyList_GET_SIZE(o)))) { PyObject *r = PyList_GET_ITEM(o, i); Py_INCREF(r); return r; } return __Pyx_GetItemInt_Generic(o, PyInt_FromSsize_t(i)); #else return PySequence_GetItem(o, i); #endif } static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Tuple_Fast(PyObject *o, Py_ssize_t i, CYTHON_NCP_UNUSED int wraparound, CYTHON_NCP_UNUSED int boundscheck) { #if CYTHON_COMPILING_IN_CPYTHON if (wraparound & unlikely(i < 0)) i += PyTuple_GET_SIZE(o); if ((!boundscheck) || likely((0 <= i) & (i < PyTuple_GET_SIZE(o)))) { PyObject *r = PyTuple_GET_ITEM(o, i); Py_INCREF(r); return r; } return __Pyx_GetItemInt_Generic(o, PyInt_FromSsize_t(i)); #else return PySequence_GetItem(o, i); #endif } static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Fast(PyObject *o, Py_ssize_t i, int is_list, CYTHON_NCP_UNUSED int wraparound, CYTHON_NCP_UNUSED int boundscheck) { #if CYTHON_COMPILING_IN_CPYTHON if (is_list || PyList_CheckExact(o)) { Py_ssize_t n = ((!wraparound) | likely(i >= 0)) ? i : i + PyList_GET_SIZE(o); if ((!boundscheck) || (likely((n >= 0) & (n < PyList_GET_SIZE(o))))) { PyObject *r = PyList_GET_ITEM(o, n); Py_INCREF(r); return r; } } else if (PyTuple_CheckExact(o)) { Py_ssize_t n = ((!wraparound) | likely(i >= 0)) ? i : i + PyTuple_GET_SIZE(o); if ((!boundscheck) || likely((n >= 0) & (n < PyTuple_GET_SIZE(o)))) { PyObject *r = PyTuple_GET_ITEM(o, n); Py_INCREF(r); return r; } } else { PySequenceMethods *m = Py_TYPE(o)->tp_as_sequence; if (likely(m && m->sq_item)) { if (wraparound && unlikely(i < 0) && likely(m->sq_length)) { Py_ssize_t l = m->sq_length(o); if (likely(l >= 0)) { i += l; } else { if (PyErr_ExceptionMatches(PyExc_OverflowError)) PyErr_Clear(); else return NULL; } } return m->sq_item(o, i); } } #else if (is_list || PySequence_Check(o)) { return PySequence_GetItem(o, i); } #endif return __Pyx_GetItemInt_Generic(o, PyInt_FromSsize_t(i)); } static void __Pyx_RaiseArgumentTypeInvalid(const char* name, PyObject *obj, PyTypeObject *type) { PyErr_Format(PyExc_TypeError, "Argument '%.200s' has incorrect type (expected %.200s, got %.200s)", name, type->tp_name, Py_TYPE(obj)->tp_name); } static CYTHON_INLINE int __Pyx_ArgTypeTest(PyObject *obj, PyTypeObject *type, int none_allowed, const char *name, int exact) { if (unlikely(!type)) { PyErr_SetString(PyExc_SystemError, "Missing type object"); return 0; } if (none_allowed && obj == Py_None) return 1; else if (exact) { if (likely(Py_TYPE(obj) == type)) return 1; #if PY_MAJOR_VERSION == 2 else if ((type == &PyBaseString_Type) && likely(__Pyx_PyBaseString_CheckExact(obj))) return 1; #endif } else { if (likely(PyObject_TypeCheck(obj, type))) return 1; } __Pyx_RaiseArgumentTypeInvalid(name, obj, type); return 0; } static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list, int level) { PyObject *empty_list = 0; PyObject *module = 0; PyObject *global_dict = 0; PyObject *empty_dict = 0; PyObject *list; #if PY_VERSION_HEX < 0x03030000 PyObject *py_import; py_import = __Pyx_PyObject_GetAttrStr(__pyx_b, __pyx_n_s_import); if (!py_import) goto bad; #endif if (from_list) list = from_list; else { empty_list = PyList_New(0); if (!empty_list) goto bad; list = empty_list; } global_dict = PyModule_GetDict(__pyx_m); if (!global_dict) goto bad; empty_dict = PyDict_New(); if (!empty_dict) goto bad; { #if PY_MAJOR_VERSION >= 3 if (level == -1) { if (strchr(__Pyx_MODULE_NAME, '.')) { #if PY_VERSION_HEX < 0x03030000 PyObject *py_level = PyInt_FromLong(1); if (!py_level) goto bad; module = PyObject_CallFunctionObjArgs(py_import, name, global_dict, empty_dict, list, py_level, NULL); Py_DECREF(py_level); #else module = PyImport_ImportModuleLevelObject( name, global_dict, empty_dict, list, 1); #endif if (!module) { if (!PyErr_ExceptionMatches(PyExc_ImportError)) goto bad; PyErr_Clear(); } } level = 0; } #endif if (!module) { #if PY_VERSION_HEX < 0x03030000 PyObject *py_level = PyInt_FromLong(level); if (!py_level) goto bad; module = PyObject_CallFunctionObjArgs(py_import, name, global_dict, empty_dict, list, py_level, NULL); Py_DECREF(py_level); #else module = PyImport_ImportModuleLevelObject( name, global_dict, empty_dict, list, level); #endif } } bad: #if PY_VERSION_HEX < 0x03030000 Py_XDECREF(py_import); #endif Py_XDECREF(empty_list); Py_XDECREF(empty_dict); return module; } static PyObject* __Pyx_ImportFrom(PyObject* module, PyObject* name) { PyObject* value = __Pyx_PyObject_GetAttrStr(module, name); if (unlikely(!value) && PyErr_ExceptionMatches(PyExc_AttributeError)) { PyErr_Format(PyExc_ImportError, #if PY_MAJOR_VERSION < 3 "cannot import name %.230s", PyString_AS_STRING(name)); #else "cannot import name %S", name); #endif } return value; } static int __pyx_bisect_code_objects(__Pyx_CodeObjectCacheEntry* entries, int count, int code_line) { int start = 0, mid = 0, end = count - 1; if (end >= 0 && code_line > entries[end].code_line) { return count; } while (start < end) { mid = start + (end - start) / 2; if (code_line < entries[mid].code_line) { end = mid; } else if (code_line > entries[mid].code_line) { start = mid + 1; } else { return mid; } } if (code_line <= entries[mid].code_line) { return mid; } else { return mid + 1; } } static PyCodeObject *__pyx_find_code_object(int code_line) { PyCodeObject* code_object; int pos; if (unlikely(!code_line) || unlikely(!__pyx_code_cache.entries)) { return NULL; } pos = __pyx_bisect_code_objects(__pyx_code_cache.entries, __pyx_code_cache.count, code_line); if (unlikely(pos >= __pyx_code_cache.count) || unlikely(__pyx_code_cache.entries[pos].code_line != code_line)) { return NULL; } code_object = __pyx_code_cache.entries[pos].code_object; Py_INCREF(code_object); return code_object; } static void __pyx_insert_code_object(int code_line, PyCodeObject* code_object) { int pos, i; __Pyx_CodeObjectCacheEntry* entries = __pyx_code_cache.entries; if (unlikely(!code_line)) { return; } if (unlikely(!entries)) { entries = (__Pyx_CodeObjectCacheEntry*)PyMem_Malloc(64*sizeof(__Pyx_CodeObjectCacheEntry)); if (likely(entries)) { __pyx_code_cache.entries = entries; __pyx_code_cache.max_count = 64; __pyx_code_cache.count = 1; entries[0].code_line = code_line; entries[0].code_object = code_object; Py_INCREF(code_object); } return; } pos = __pyx_bisect_code_objects(__pyx_code_cache.entries, __pyx_code_cache.count, code_line); if ((pos < __pyx_code_cache.count) && unlikely(__pyx_code_cache.entries[pos].code_line == code_line)) { PyCodeObject* tmp = entries[pos].code_object; entries[pos].code_object = code_object; Py_DECREF(tmp); return; } if (__pyx_code_cache.count == __pyx_code_cache.max_count) { int new_max = __pyx_code_cache.max_count + 64; entries = (__Pyx_CodeObjectCacheEntry*)PyMem_Realloc( __pyx_code_cache.entries, (size_t)new_max*sizeof(__Pyx_CodeObjectCacheEntry)); if (unlikely(!entries)) { return; } __pyx_code_cache.entries = entries; __pyx_code_cache.max_count = new_max; } for (i=__pyx_code_cache.count; i>pos; i--) { entries[i] = entries[i-1]; } entries[pos].code_line = code_line; entries[pos].code_object = code_object; __pyx_code_cache.count++; Py_INCREF(code_object); } #include "compile.h" #include "frameobject.h" #include "traceback.h" static PyCodeObject* __Pyx_CreateCodeObjectForTraceback( const char *funcname, int c_line, int py_line, const char *filename) { PyCodeObject *py_code = 0; PyObject *py_srcfile = 0; PyObject *py_funcname = 0; #if PY_MAJOR_VERSION < 3 py_srcfile = PyString_FromString(filename); #else py_srcfile = PyUnicode_FromString(filename); #endif if (!py_srcfile) goto bad; if (c_line) { #if PY_MAJOR_VERSION < 3 py_funcname = PyString_FromFormat( "%s (%s:%d)", funcname, __pyx_cfilenm, c_line); #else py_funcname = PyUnicode_FromFormat( "%s (%s:%d)", funcname, __pyx_cfilenm, c_line); #endif } else { #if PY_MAJOR_VERSION < 3 py_funcname = PyString_FromString(funcname); #else py_funcname = PyUnicode_FromString(funcname); #endif } if (!py_funcname) goto bad; py_code = __Pyx_PyCode_New( 0, 0, 0, 0, 0, __pyx_empty_bytes, /*PyObject *code,*/ __pyx_empty_tuple, /*PyObject *consts,*/ __pyx_empty_tuple, /*PyObject *names,*/ __pyx_empty_tuple, /*PyObject *varnames,*/ __pyx_empty_tuple, /*PyObject *freevars,*/ __pyx_empty_tuple, /*PyObject *cellvars,*/ py_srcfile, /*PyObject *filename,*/ py_funcname, /*PyObject *name,*/ py_line, __pyx_empty_bytes /*PyObject *lnotab*/ ); Py_DECREF(py_srcfile); Py_DECREF(py_funcname); return py_code; bad: Py_XDECREF(py_srcfile); Py_XDECREF(py_funcname); return NULL; } static void __Pyx_AddTraceback(const char *funcname, int c_line, int py_line, const char *filename) { PyCodeObject *py_code = 0; PyFrameObject *py_frame = 0; py_code = __pyx_find_code_object(c_line ? c_line : py_line); if (!py_code) { py_code = __Pyx_CreateCodeObjectForTraceback( funcname, c_line, py_line, filename); if (!py_code) goto bad; __pyx_insert_code_object(c_line ? c_line : py_line, py_code); } py_frame = PyFrame_New( PyThreadState_GET(), /*PyThreadState *tstate,*/ py_code, /*PyCodeObject *code,*/ __pyx_d, /*PyObject *globals,*/ 0 /*PyObject *locals*/ ); if (!py_frame) goto bad; py_frame->f_lineno = py_line; PyTraceBack_Here(py_frame); bad: Py_XDECREF(py_code); Py_XDECREF(py_frame); } #define __PYX_VERIFY_RETURN_INT(target_type, func_type, func_value)\ __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, 0) #define __PYX_VERIFY_RETURN_INT_EXC(target_type, func_type, func_value)\ __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, 1) #define __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, exc)\ {\ func_type value = func_value;\ if (sizeof(target_type) < sizeof(func_type)) {\ if (unlikely(value != (func_type) (target_type) value)) {\ func_type zero = 0;\ if (exc && unlikely(value == (func_type)-1 && PyErr_Occurred()))\ return (target_type) -1;\ if (is_unsigned && unlikely(value < zero))\ goto raise_neg_overflow;\ else\ goto raise_overflow;\ }\ }\ return (target_type) value;\ } static CYTHON_INLINE int __Pyx_PyInt_As_int(PyObject *x) { const int neg_one = (int) -1, const_zero = (int) 0; const int is_unsigned = neg_one > const_zero; #if PY_MAJOR_VERSION < 3 if (likely(PyInt_Check(x))) { if (sizeof(int) < sizeof(long)) { __PYX_VERIFY_RETURN_INT(int, long, PyInt_AS_LONG(x)) } else { long val = PyInt_AS_LONG(x); if (is_unsigned && unlikely(val < 0)) { goto raise_neg_overflow; } return (int) val; } } else #endif if (likely(PyLong_Check(x))) { if (is_unsigned) { #if CYTHON_USE_PYLONG_INTERNALS const digit* digits = ((PyLongObject*)x)->ob_digit; switch (Py_SIZE(x)) { case 0: return (int) 0; case 1: __PYX_VERIFY_RETURN_INT(int, digit, digits[0]) case 2: if (8 * sizeof(int) > 1 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(int) >= 2 * PyLong_SHIFT) { return (int) (((((int)digits[1]) << PyLong_SHIFT) | (int)digits[0])); } } break; case 3: if (8 * sizeof(int) > 2 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(int) >= 3 * PyLong_SHIFT) { return (int) (((((((int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0])); } } break; case 4: if (8 * sizeof(int) > 3 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(int) >= 4 * PyLong_SHIFT) { return (int) (((((((((int)digits[3]) << PyLong_SHIFT) | (int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0])); } } break; } #endif #if CYTHON_COMPILING_IN_CPYTHON if (unlikely(Py_SIZE(x) < 0)) { goto raise_neg_overflow; } #else { int result = PyObject_RichCompareBool(x, Py_False, Py_LT); if (unlikely(result < 0)) return (int) -1; if (unlikely(result == 1)) goto raise_neg_overflow; } #endif if (sizeof(int) <= sizeof(unsigned long)) { __PYX_VERIFY_RETURN_INT_EXC(int, unsigned long, PyLong_AsUnsignedLong(x)) } else if (sizeof(int) <= sizeof(unsigned PY_LONG_LONG)) { __PYX_VERIFY_RETURN_INT_EXC(int, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x)) } } else { #if CYTHON_USE_PYLONG_INTERNALS const digit* digits = ((PyLongObject*)x)->ob_digit; switch (Py_SIZE(x)) { case 0: return (int) 0; case -1: __PYX_VERIFY_RETURN_INT(int, sdigit, (sdigit) (-(sdigit)digits[0])) case 1: __PYX_VERIFY_RETURN_INT(int, digit, +digits[0]) case -2: if (8 * sizeof(int) - 1 > 1 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(int, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(int) - 1 > 2 * PyLong_SHIFT) { return (int) (((int)-1)*(((((int)digits[1]) << PyLong_SHIFT) | (int)digits[0]))); } } break; case 2: if (8 * sizeof(int) > 1 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(int) - 1 > 2 * PyLong_SHIFT) { return (int) ((((((int)digits[1]) << PyLong_SHIFT) | (int)digits[0]))); } } break; case -3: if (8 * sizeof(int) - 1 > 2 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(int, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(int) - 1 > 3 * PyLong_SHIFT) { return (int) (((int)-1)*(((((((int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0]))); } } break; case 3: if (8 * sizeof(int) > 2 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(int) - 1 > 3 * PyLong_SHIFT) { return (int) ((((((((int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0]))); } } break; case -4: if (8 * sizeof(int) - 1 > 3 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(int, long, -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(int) - 1 > 4 * PyLong_SHIFT) { return (int) (((int)-1)*(((((((((int)digits[3]) << PyLong_SHIFT) | (int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0]))); } } break; case 4: if (8 * sizeof(int) > 3 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(int) - 1 > 4 * PyLong_SHIFT) { return (int) ((((((((((int)digits[3]) << PyLong_SHIFT) | (int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0]))); } } break; } #endif if (sizeof(int) <= sizeof(long)) { __PYX_VERIFY_RETURN_INT_EXC(int, long, PyLong_AsLong(x)) } else if (sizeof(int) <= sizeof(PY_LONG_LONG)) { __PYX_VERIFY_RETURN_INT_EXC(int, PY_LONG_LONG, PyLong_AsLongLong(x)) } } { #if CYTHON_COMPILING_IN_PYPY && !defined(_PyLong_AsByteArray) PyErr_SetString(PyExc_RuntimeError, "_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers"); #else int val; PyObject *v = __Pyx_PyNumber_Int(x); #if PY_MAJOR_VERSION < 3 if (likely(v) && !PyLong_Check(v)) { PyObject *tmp = v; v = PyNumber_Long(tmp); Py_DECREF(tmp); } #endif if (likely(v)) { int one = 1; int is_little = (int)*(unsigned char *)&one; unsigned char *bytes = (unsigned char *)&val; int ret = _PyLong_AsByteArray((PyLongObject *)v, bytes, sizeof(val), is_little, !is_unsigned); Py_DECREF(v); if (likely(!ret)) return val; } #endif return (int) -1; } } else { int val; PyObject *tmp = __Pyx_PyNumber_Int(x); if (!tmp) return (int) -1; val = __Pyx_PyInt_As_int(tmp); Py_DECREF(tmp); return val; } raise_overflow: PyErr_SetString(PyExc_OverflowError, "value too large to convert to int"); return (int) -1; raise_neg_overflow: PyErr_SetString(PyExc_OverflowError, "can't convert negative value to int"); return (int) -1; } static CYTHON_INLINE PyObject* __Pyx_PyInt_From_int(int value) { const int neg_one = (int) -1, const_zero = (int) 0; const int is_unsigned = neg_one > const_zero; if (is_unsigned) { if (sizeof(int) < sizeof(long)) { return PyInt_FromLong((long) value); } else if (sizeof(int) <= sizeof(unsigned long)) { return PyLong_FromUnsignedLong((unsigned long) value); } else if (sizeof(int) <= sizeof(unsigned PY_LONG_LONG)) { return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value); } } else { if (sizeof(int) <= sizeof(long)) { return PyInt_FromLong((long) value); } else if (sizeof(int) <= sizeof(PY_LONG_LONG)) { return PyLong_FromLongLong((PY_LONG_LONG) value); } } { int one = 1; int little = (int)*(unsigned char *)&one; unsigned char *bytes = (unsigned char *)&value; return _PyLong_FromByteArray(bytes, sizeof(int), little, !is_unsigned); } } static CYTHON_INLINE PyObject* __Pyx_PyInt_From_MIX_InitFlags(MIX_InitFlags value) { const MIX_InitFlags neg_one = (MIX_InitFlags) -1, const_zero = (MIX_InitFlags) 0; const int is_unsigned = neg_one > const_zero; if (is_unsigned) { if (sizeof(MIX_InitFlags) < sizeof(long)) { return PyInt_FromLong((long) value); } else if (sizeof(MIX_InitFlags) <= sizeof(unsigned long)) { return PyLong_FromUnsignedLong((unsigned long) value); } else if (sizeof(MIX_InitFlags) <= sizeof(unsigned PY_LONG_LONG)) { return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value); } } else { if (sizeof(MIX_InitFlags) <= sizeof(long)) { return PyInt_FromLong((long) value); } else if (sizeof(MIX_InitFlags) <= sizeof(PY_LONG_LONG)) { return PyLong_FromLongLong((PY_LONG_LONG) value); } } { int one = 1; int little = (int)*(unsigned char *)&one; unsigned char *bytes = (unsigned char *)&value; return _PyLong_FromByteArray(bytes, sizeof(MIX_InitFlags), little, !is_unsigned); } } static CYTHON_INLINE uint16_t __Pyx_PyInt_As_uint16_t(PyObject *x) { const uint16_t neg_one = (uint16_t) -1, const_zero = (uint16_t) 0; const int is_unsigned = neg_one > const_zero; #if PY_MAJOR_VERSION < 3 if (likely(PyInt_Check(x))) { if (sizeof(uint16_t) < sizeof(long)) { __PYX_VERIFY_RETURN_INT(uint16_t, long, PyInt_AS_LONG(x)) } else { long val = PyInt_AS_LONG(x); if (is_unsigned && unlikely(val < 0)) { goto raise_neg_overflow; } return (uint16_t) val; } } else #endif if (likely(PyLong_Check(x))) { if (is_unsigned) { #if CYTHON_USE_PYLONG_INTERNALS const digit* digits = ((PyLongObject*)x)->ob_digit; switch (Py_SIZE(x)) { case 0: return (uint16_t) 0; case 1: __PYX_VERIFY_RETURN_INT(uint16_t, digit, digits[0]) case 2: if (8 * sizeof(uint16_t) > 1 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(uint16_t, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(uint16_t) >= 2 * PyLong_SHIFT) { return (uint16_t) (((((uint16_t)digits[1]) << PyLong_SHIFT) | (uint16_t)digits[0])); } } break; case 3: if (8 * sizeof(uint16_t) > 2 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(uint16_t, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(uint16_t) >= 3 * PyLong_SHIFT) { return (uint16_t) (((((((uint16_t)digits[2]) << PyLong_SHIFT) | (uint16_t)digits[1]) << PyLong_SHIFT) | (uint16_t)digits[0])); } } break; case 4: if (8 * sizeof(uint16_t) > 3 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(uint16_t, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(uint16_t) >= 4 * PyLong_SHIFT) { return (uint16_t) (((((((((uint16_t)digits[3]) << PyLong_SHIFT) | (uint16_t)digits[2]) << PyLong_SHIFT) | (uint16_t)digits[1]) << PyLong_SHIFT) | (uint16_t)digits[0])); } } break; } #endif #if CYTHON_COMPILING_IN_CPYTHON if (unlikely(Py_SIZE(x) < 0)) { goto raise_neg_overflow; } #else { int result = PyObject_RichCompareBool(x, Py_False, Py_LT); if (unlikely(result < 0)) return (uint16_t) -1; if (unlikely(result == 1)) goto raise_neg_overflow; } #endif if (sizeof(uint16_t) <= sizeof(unsigned long)) { __PYX_VERIFY_RETURN_INT_EXC(uint16_t, unsigned long, PyLong_AsUnsignedLong(x)) } else if (sizeof(uint16_t) <= sizeof(unsigned PY_LONG_LONG)) { __PYX_VERIFY_RETURN_INT_EXC(uint16_t, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x)) } } else { #if CYTHON_USE_PYLONG_INTERNALS const digit* digits = ((PyLongObject*)x)->ob_digit; switch (Py_SIZE(x)) { case 0: return (uint16_t) 0; case -1: __PYX_VERIFY_RETURN_INT(uint16_t, sdigit, (sdigit) (-(sdigit)digits[0])) case 1: __PYX_VERIFY_RETURN_INT(uint16_t, digit, +digits[0]) case -2: if (8 * sizeof(uint16_t) - 1 > 1 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(uint16_t, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(uint16_t) - 1 > 2 * PyLong_SHIFT) { return (uint16_t) (((uint16_t)-1)*(((((uint16_t)digits[1]) << PyLong_SHIFT) | (uint16_t)digits[0]))); } } break; case 2: if (8 * sizeof(uint16_t) > 1 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(uint16_t, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(uint16_t) - 1 > 2 * PyLong_SHIFT) { return (uint16_t) ((((((uint16_t)digits[1]) << PyLong_SHIFT) | (uint16_t)digits[0]))); } } break; case -3: if (8 * sizeof(uint16_t) - 1 > 2 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(uint16_t, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(uint16_t) - 1 > 3 * PyLong_SHIFT) { return (uint16_t) (((uint16_t)-1)*(((((((uint16_t)digits[2]) << PyLong_SHIFT) | (uint16_t)digits[1]) << PyLong_SHIFT) | (uint16_t)digits[0]))); } } break; case 3: if (8 * sizeof(uint16_t) > 2 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(uint16_t, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(uint16_t) - 1 > 3 * PyLong_SHIFT) { return (uint16_t) ((((((((uint16_t)digits[2]) << PyLong_SHIFT) | (uint16_t)digits[1]) << PyLong_SHIFT) | (uint16_t)digits[0]))); } } break; case -4: if (8 * sizeof(uint16_t) - 1 > 3 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(uint16_t, long, -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(uint16_t) - 1 > 4 * PyLong_SHIFT) { return (uint16_t) (((uint16_t)-1)*(((((((((uint16_t)digits[3]) << PyLong_SHIFT) | (uint16_t)digits[2]) << PyLong_SHIFT) | (uint16_t)digits[1]) << PyLong_SHIFT) | (uint16_t)digits[0]))); } } break; case 4: if (8 * sizeof(uint16_t) > 3 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(uint16_t, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(uint16_t) - 1 > 4 * PyLong_SHIFT) { return (uint16_t) ((((((((((uint16_t)digits[3]) << PyLong_SHIFT) | (uint16_t)digits[2]) << PyLong_SHIFT) | (uint16_t)digits[1]) << PyLong_SHIFT) | (uint16_t)digits[0]))); } } break; } #endif if (sizeof(uint16_t) <= sizeof(long)) { __PYX_VERIFY_RETURN_INT_EXC(uint16_t, long, PyLong_AsLong(x)) } else if (sizeof(uint16_t) <= sizeof(PY_LONG_LONG)) { __PYX_VERIFY_RETURN_INT_EXC(uint16_t, PY_LONG_LONG, PyLong_AsLongLong(x)) } } { #if CYTHON_COMPILING_IN_PYPY && !defined(_PyLong_AsByteArray) PyErr_SetString(PyExc_RuntimeError, "_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers"); #else uint16_t val; PyObject *v = __Pyx_PyNumber_Int(x); #if PY_MAJOR_VERSION < 3 if (likely(v) && !PyLong_Check(v)) { PyObject *tmp = v; v = PyNumber_Long(tmp); Py_DECREF(tmp); } #endif if (likely(v)) { int one = 1; int is_little = (int)*(unsigned char *)&one; unsigned char *bytes = (unsigned char *)&val; int ret = _PyLong_AsByteArray((PyLongObject *)v, bytes, sizeof(val), is_little, !is_unsigned); Py_DECREF(v); if (likely(!ret)) return val; } #endif return (uint16_t) -1; } } else { uint16_t val; PyObject *tmp = __Pyx_PyNumber_Int(x); if (!tmp) return (uint16_t) -1; val = __Pyx_PyInt_As_uint16_t(tmp); Py_DECREF(tmp); return val; } raise_overflow: PyErr_SetString(PyExc_OverflowError, "value too large to convert to uint16_t"); return (uint16_t) -1; raise_neg_overflow: PyErr_SetString(PyExc_OverflowError, "can't convert negative value to uint16_t"); return (uint16_t) -1; } static CYTHON_INLINE PyObject* __Pyx_PyInt_From_uint16_t(uint16_t value) { const uint16_t neg_one = (uint16_t) -1, const_zero = (uint16_t) 0; const int is_unsigned = neg_one > const_zero; if (is_unsigned) { if (sizeof(uint16_t) < sizeof(long)) { return PyInt_FromLong((long) value); } else if (sizeof(uint16_t) <= sizeof(unsigned long)) { return PyLong_FromUnsignedLong((unsigned long) value); } else if (sizeof(uint16_t) <= sizeof(unsigned PY_LONG_LONG)) { return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value); } } else { if (sizeof(uint16_t) <= sizeof(long)) { return PyInt_FromLong((long) value); } else if (sizeof(uint16_t) <= sizeof(PY_LONG_LONG)) { return PyLong_FromLongLong((PY_LONG_LONG) value); } } { int one = 1; int little = (int)*(unsigned char *)&one; unsigned char *bytes = (unsigned char *)&value; return _PyLong_FromByteArray(bytes, sizeof(uint16_t), little, !is_unsigned); } } static CYTHON_INLINE PyObject* __Pyx_PyInt_From_long(long value) { const long neg_one = (long) -1, const_zero = (long) 0; const int is_unsigned = neg_one > const_zero; if (is_unsigned) { if (sizeof(long) < sizeof(long)) { return PyInt_FromLong((long) value); } else if (sizeof(long) <= sizeof(unsigned long)) { return PyLong_FromUnsignedLong((unsigned long) value); } else if (sizeof(long) <= sizeof(unsigned PY_LONG_LONG)) { return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value); } } else { if (sizeof(long) <= sizeof(long)) { return PyInt_FromLong((long) value); } else if (sizeof(long) <= sizeof(PY_LONG_LONG)) { return PyLong_FromLongLong((PY_LONG_LONG) value); } } { int one = 1; int little = (int)*(unsigned char *)&one; unsigned char *bytes = (unsigned char *)&value; return _PyLong_FromByteArray(bytes, sizeof(long), little, !is_unsigned); } } static CYTHON_INLINE long __Pyx_PyInt_As_long(PyObject *x) { const long neg_one = (long) -1, const_zero = (long) 0; const int is_unsigned = neg_one > const_zero; #if PY_MAJOR_VERSION < 3 if (likely(PyInt_Check(x))) { if (sizeof(long) < sizeof(long)) { __PYX_VERIFY_RETURN_INT(long, long, PyInt_AS_LONG(x)) } else { long val = PyInt_AS_LONG(x); if (is_unsigned && unlikely(val < 0)) { goto raise_neg_overflow; } return (long) val; } } else #endif if (likely(PyLong_Check(x))) { if (is_unsigned) { #if CYTHON_USE_PYLONG_INTERNALS const digit* digits = ((PyLongObject*)x)->ob_digit; switch (Py_SIZE(x)) { case 0: return (long) 0; case 1: __PYX_VERIFY_RETURN_INT(long, digit, digits[0]) case 2: if (8 * sizeof(long) > 1 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(long) >= 2 * PyLong_SHIFT) { return (long) (((((long)digits[1]) << PyLong_SHIFT) | (long)digits[0])); } } break; case 3: if (8 * sizeof(long) > 2 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(long) >= 3 * PyLong_SHIFT) { return (long) (((((((long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0])); } } break; case 4: if (8 * sizeof(long) > 3 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(long) >= 4 * PyLong_SHIFT) { return (long) (((((((((long)digits[3]) << PyLong_SHIFT) | (long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0])); } } break; } #endif #if CYTHON_COMPILING_IN_CPYTHON if (unlikely(Py_SIZE(x) < 0)) { goto raise_neg_overflow; } #else { int result = PyObject_RichCompareBool(x, Py_False, Py_LT); if (unlikely(result < 0)) return (long) -1; if (unlikely(result == 1)) goto raise_neg_overflow; } #endif if (sizeof(long) <= sizeof(unsigned long)) { __PYX_VERIFY_RETURN_INT_EXC(long, unsigned long, PyLong_AsUnsignedLong(x)) } else if (sizeof(long) <= sizeof(unsigned PY_LONG_LONG)) { __PYX_VERIFY_RETURN_INT_EXC(long, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x)) } } else { #if CYTHON_USE_PYLONG_INTERNALS const digit* digits = ((PyLongObject*)x)->ob_digit; switch (Py_SIZE(x)) { case 0: return (long) 0; case -1: __PYX_VERIFY_RETURN_INT(long, sdigit, (sdigit) (-(sdigit)digits[0])) case 1: __PYX_VERIFY_RETURN_INT(long, digit, +digits[0]) case -2: if (8 * sizeof(long) - 1 > 1 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(long, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) { return (long) (((long)-1)*(((((long)digits[1]) << PyLong_SHIFT) | (long)digits[0]))); } } break; case 2: if (8 * sizeof(long) > 1 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) { return (long) ((((((long)digits[1]) << PyLong_SHIFT) | (long)digits[0]))); } } break; case -3: if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(long, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) { return (long) (((long)-1)*(((((((long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0]))); } } break; case 3: if (8 * sizeof(long) > 2 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) { return (long) ((((((((long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0]))); } } break; case -4: if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(long, long, -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(long) - 1 > 4 * PyLong_SHIFT) { return (long) (((long)-1)*(((((((((long)digits[3]) << PyLong_SHIFT) | (long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0]))); } } break; case 4: if (8 * sizeof(long) > 3 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(long) - 1 > 4 * PyLong_SHIFT) { return (long) ((((((((((long)digits[3]) << PyLong_SHIFT) | (long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0]))); } } break; } #endif if (sizeof(long) <= sizeof(long)) { __PYX_VERIFY_RETURN_INT_EXC(long, long, PyLong_AsLong(x)) } else if (sizeof(long) <= sizeof(PY_LONG_LONG)) { __PYX_VERIFY_RETURN_INT_EXC(long, PY_LONG_LONG, PyLong_AsLongLong(x)) } } { #if CYTHON_COMPILING_IN_PYPY && !defined(_PyLong_AsByteArray) PyErr_SetString(PyExc_RuntimeError, "_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers"); #else long val; PyObject *v = __Pyx_PyNumber_Int(x); #if PY_MAJOR_VERSION < 3 if (likely(v) && !PyLong_Check(v)) { PyObject *tmp = v; v = PyNumber_Long(tmp); Py_DECREF(tmp); } #endif if (likely(v)) { int one = 1; int is_little = (int)*(unsigned char *)&one; unsigned char *bytes = (unsigned char *)&val; int ret = _PyLong_AsByteArray((PyLongObject *)v, bytes, sizeof(val), is_little, !is_unsigned); Py_DECREF(v); if (likely(!ret)) return val; } #endif return (long) -1; } } else { long val; PyObject *tmp = __Pyx_PyNumber_Int(x); if (!tmp) return (long) -1; val = __Pyx_PyInt_As_long(tmp); Py_DECREF(tmp); return val; } raise_overflow: PyErr_SetString(PyExc_OverflowError, "value too large to convert to long"); return (long) -1; raise_neg_overflow: PyErr_SetString(PyExc_OverflowError, "can't convert negative value to long"); return (long) -1; } static int __Pyx_check_binary_version(void) { char ctversion[4], rtversion[4]; PyOS_snprintf(ctversion, 4, "%d.%d", PY_MAJOR_VERSION, PY_MINOR_VERSION); PyOS_snprintf(rtversion, 4, "%s", Py_GetVersion()); if (ctversion[0] != rtversion[0] || ctversion[2] != rtversion[2]) { char message[200]; PyOS_snprintf(message, sizeof(message), "compiletime version %s of module '%.100s' " "does not match runtime version %s", ctversion, __Pyx_MODULE_NAME, rtversion); return PyErr_WarnEx(NULL, message, 1); } return 0; } #ifndef __PYX_HAVE_RT_ImportModule #define __PYX_HAVE_RT_ImportModule static PyObject *__Pyx_ImportModule(const char *name) { PyObject *py_name = 0; PyObject *py_module = 0; py_name = __Pyx_PyIdentifier_FromString(name); if (!py_name) goto bad; py_module = PyImport_Import(py_name); Py_DECREF(py_name); return py_module; bad: Py_XDECREF(py_name); return 0; } #endif #ifndef __PYX_HAVE_RT_ImportFunction #define __PYX_HAVE_RT_ImportFunction static int __Pyx_ImportFunction(PyObject *module, const char *funcname, void (**f)(void), const char *sig) { PyObject *d = 0; PyObject *cobj = 0; union { void (*fp)(void); void *p; } tmp; d = PyObject_GetAttrString(module, (char *)"__pyx_capi__"); if (!d) goto bad; cobj = PyDict_GetItemString(d, funcname); if (!cobj) { PyErr_Format(PyExc_ImportError, "%.200s does not export expected C function %.200s", PyModule_GetName(module), funcname); goto bad; } #if PY_VERSION_HEX >= 0x02070000 if (!PyCapsule_IsValid(cobj, sig)) { PyErr_Format(PyExc_TypeError, "C function %.200s.%.200s has wrong signature (expected %.500s, got %.500s)", PyModule_GetName(module), funcname, sig, PyCapsule_GetName(cobj)); goto bad; } tmp.p = PyCapsule_GetPointer(cobj, sig); #else {const char *desc, *s1, *s2; desc = (const char *)PyCObject_GetDesc(cobj); if (!desc) goto bad; s1 = desc; s2 = sig; while (*s1 != '\0' && *s1 == *s2) { s1++; s2++; } if (*s1 != *s2) { PyErr_Format(PyExc_TypeError, "C function %.200s.%.200s has wrong signature (expected %.500s, got %.500s)", PyModule_GetName(module), funcname, sig, desc); goto bad; } tmp.p = PyCObject_AsVoidPtr(cobj);} #endif *f = tmp.fp; if (!(*f)) goto bad; Py_DECREF(d); return 0; bad: Py_XDECREF(d); return -1; } #endif static int __Pyx_InitStrings(__Pyx_StringTabEntry *t) { while (t->p) { #if PY_MAJOR_VERSION < 3 if (t->is_unicode) { *t->p = PyUnicode_DecodeUTF8(t->s, t->n - 1, NULL); } else if (t->intern) { *t->p = PyString_InternFromString(t->s); } else { *t->p = PyString_FromStringAndSize(t->s, t->n - 1); } #else if (t->is_unicode | t->is_str) { if (t->intern) { *t->p = PyUnicode_InternFromString(t->s); } else if (t->encoding) { *t->p = PyUnicode_Decode(t->s, t->n - 1, t->encoding, NULL); } else { *t->p = PyUnicode_FromStringAndSize(t->s, t->n - 1); } } else { *t->p = PyBytes_FromStringAndSize(t->s, t->n - 1); } #endif if (!*t->p) return -1; ++t; } return 0; } static CYTHON_INLINE PyObject* __Pyx_PyUnicode_FromString(const char* c_str) { return __Pyx_PyUnicode_FromStringAndSize(c_str, (Py_ssize_t)strlen(c_str)); } static CYTHON_INLINE char* __Pyx_PyObject_AsString(PyObject* o) { Py_ssize_t ignore; return __Pyx_PyObject_AsStringAndSize(o, &ignore); } static CYTHON_INLINE char* __Pyx_PyObject_AsStringAndSize(PyObject* o, Py_ssize_t *length) { #if CYTHON_COMPILING_IN_CPYTHON && (__PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT) if ( #if PY_MAJOR_VERSION < 3 && __PYX_DEFAULT_STRING_ENCODING_IS_ASCII __Pyx_sys_getdefaultencoding_not_ascii && #endif PyUnicode_Check(o)) { #if PY_VERSION_HEX < 0x03030000 char* defenc_c; PyObject* defenc = _PyUnicode_AsDefaultEncodedString(o, NULL); if (!defenc) return NULL; defenc_c = PyBytes_AS_STRING(defenc); #if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII { char* end = defenc_c + PyBytes_GET_SIZE(defenc); char* c; for (c = defenc_c; c < end; c++) { if ((unsigned char) (*c) >= 128) { PyUnicode_AsASCIIString(o); return NULL; } } } #endif *length = PyBytes_GET_SIZE(defenc); return defenc_c; #else if (__Pyx_PyUnicode_READY(o) == -1) return NULL; #if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII if (PyUnicode_IS_ASCII(o)) { *length = PyUnicode_GET_LENGTH(o); return PyUnicode_AsUTF8(o); } else { PyUnicode_AsASCIIString(o); return NULL; } #else return PyUnicode_AsUTF8AndSize(o, length); #endif #endif } else #endif #if (!CYTHON_COMPILING_IN_PYPY) || (defined(PyByteArray_AS_STRING) && defined(PyByteArray_GET_SIZE)) if (PyByteArray_Check(o)) { *length = PyByteArray_GET_SIZE(o); return PyByteArray_AS_STRING(o); } else #endif { char* result; int r = PyBytes_AsStringAndSize(o, &result, length); if (unlikely(r < 0)) { return NULL; } else { return result; } } } static CYTHON_INLINE int __Pyx_PyObject_IsTrue(PyObject* x) { int is_true = x == Py_True; if (is_true | (x == Py_False) | (x == Py_None)) return is_true; else return PyObject_IsTrue(x); } static CYTHON_INLINE PyObject* __Pyx_PyNumber_Int(PyObject* x) { PyNumberMethods *m; const char *name = NULL; PyObject *res = NULL; #if PY_MAJOR_VERSION < 3 if (PyInt_Check(x) || PyLong_Check(x)) #else if (PyLong_Check(x)) #endif return __Pyx_NewRef(x); m = Py_TYPE(x)->tp_as_number; #if PY_MAJOR_VERSION < 3 if (m && m->nb_int) { name = "int"; res = PyNumber_Int(x); } else if (m && m->nb_long) { name = "long"; res = PyNumber_Long(x); } #else if (m && m->nb_int) { name = "int"; res = PyNumber_Long(x); } #endif if (res) { #if PY_MAJOR_VERSION < 3 if (!PyInt_Check(res) && !PyLong_Check(res)) { #else if (!PyLong_Check(res)) { #endif PyErr_Format(PyExc_TypeError, "__%.4s__ returned non-%.4s (type %.200s)", name, name, Py_TYPE(res)->tp_name); Py_DECREF(res); return NULL; } } else if (!PyErr_Occurred()) { PyErr_SetString(PyExc_TypeError, "an integer is required"); } return res; } static CYTHON_INLINE Py_ssize_t __Pyx_PyIndex_AsSsize_t(PyObject* b) { Py_ssize_t ival; PyObject *x; #if PY_MAJOR_VERSION < 3 if (likely(PyInt_CheckExact(b))) { if (sizeof(Py_ssize_t) >= sizeof(long)) return PyInt_AS_LONG(b); else return PyInt_AsSsize_t(x); } #endif if (likely(PyLong_CheckExact(b))) { #if CYTHON_USE_PYLONG_INTERNALS const digit* digits = ((PyLongObject*)b)->ob_digit; const Py_ssize_t size = Py_SIZE(b); if (likely(__Pyx_sst_abs(size) <= 1)) { ival = likely(size) ? digits[0] : 0; if (size == -1) ival = -ival; return ival; } else { switch (size) { case 2: if (8 * sizeof(Py_ssize_t) > 2 * PyLong_SHIFT) { return (Py_ssize_t) (((((size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])); } break; case -2: if (8 * sizeof(Py_ssize_t) > 2 * PyLong_SHIFT) { return -(Py_ssize_t) (((((size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])); } break; case 3: if (8 * sizeof(Py_ssize_t) > 3 * PyLong_SHIFT) { return (Py_ssize_t) (((((((size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])); } break; case -3: if (8 * sizeof(Py_ssize_t) > 3 * PyLong_SHIFT) { return -(Py_ssize_t) (((((((size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])); } break; case 4: if (8 * sizeof(Py_ssize_t) > 4 * PyLong_SHIFT) { return (Py_ssize_t) (((((((((size_t)digits[3]) << PyLong_SHIFT) | (size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])); } break; case -4: if (8 * sizeof(Py_ssize_t) > 4 * PyLong_SHIFT) { return -(Py_ssize_t) (((((((((size_t)digits[3]) << PyLong_SHIFT) | (size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])); } break; } } #endif return PyLong_AsSsize_t(b); } x = PyNumber_Index(b); if (!x) return -1; ival = PyInt_AsSsize_t(x); Py_DECREF(x); return ival; } static CYTHON_INLINE PyObject * __Pyx_PyInt_FromSize_t(size_t ival) { return PyInt_FromSize_t(ival); } #endif /* Py_PYTHON_H */ pygame_sdl2-2.1.0-for-renpy-6.99.14.1/gen3/pygame_sdl2.joystick.c0000664000175000017500000055641712665223542023343 0ustar tomtom00000000000000/* Generated by Cython 0.23.3 */ #define PY_SSIZE_T_CLEAN #include "Python.h" #ifndef Py_PYTHON_H #error Python headers needed to compile C extensions, please install development version of Python. #elif PY_VERSION_HEX < 0x02060000 || (0x03000000 <= PY_VERSION_HEX && PY_VERSION_HEX < 0x03020000) #error Cython requires Python 2.6+ or Python 3.2+. #else #define CYTHON_ABI "0_23_3" #include #ifndef offsetof #define offsetof(type, member) ( (size_t) & ((type*)0) -> member ) #endif #if !defined(WIN32) && !defined(MS_WINDOWS) #ifndef __stdcall #define __stdcall #endif #ifndef __cdecl #define __cdecl #endif #ifndef __fastcall #define __fastcall #endif #endif #ifndef DL_IMPORT #define DL_IMPORT(t) t #endif #ifndef DL_EXPORT #define DL_EXPORT(t) t #endif #ifndef PY_LONG_LONG #define PY_LONG_LONG LONG_LONG #endif #ifndef Py_HUGE_VAL #define Py_HUGE_VAL HUGE_VAL #endif #ifdef PYPY_VERSION #define CYTHON_COMPILING_IN_PYPY 1 #define CYTHON_COMPILING_IN_CPYTHON 0 #else #define CYTHON_COMPILING_IN_PYPY 0 #define CYTHON_COMPILING_IN_CPYTHON 1 #endif #if !defined(CYTHON_USE_PYLONG_INTERNALS) && CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x02070000 #define CYTHON_USE_PYLONG_INTERNALS 1 #endif #if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX < 0x02070600 && !defined(Py_OptimizeFlag) #define Py_OptimizeFlag 0 #endif #define __PYX_BUILD_PY_SSIZE_T "n" #define CYTHON_FORMAT_SSIZE_T "z" #if PY_MAJOR_VERSION < 3 #define __Pyx_BUILTIN_MODULE_NAME "__builtin__" #define __Pyx_PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)\ PyCode_New(a+k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos) #define __Pyx_DefaultClassType PyClass_Type #else #define __Pyx_BUILTIN_MODULE_NAME "builtins" #define __Pyx_PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)\ PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos) #define __Pyx_DefaultClassType PyType_Type #endif #ifndef Py_TPFLAGS_CHECKTYPES #define Py_TPFLAGS_CHECKTYPES 0 #endif #ifndef Py_TPFLAGS_HAVE_INDEX #define Py_TPFLAGS_HAVE_INDEX 0 #endif #ifndef Py_TPFLAGS_HAVE_NEWBUFFER #define Py_TPFLAGS_HAVE_NEWBUFFER 0 #endif #ifndef Py_TPFLAGS_HAVE_FINALIZE #define Py_TPFLAGS_HAVE_FINALIZE 0 #endif #if PY_VERSION_HEX > 0x03030000 && defined(PyUnicode_KIND) #define CYTHON_PEP393_ENABLED 1 #define __Pyx_PyUnicode_READY(op) (likely(PyUnicode_IS_READY(op)) ?\ 0 : _PyUnicode_Ready((PyObject *)(op))) #define __Pyx_PyUnicode_GET_LENGTH(u) PyUnicode_GET_LENGTH(u) #define __Pyx_PyUnicode_READ_CHAR(u, i) PyUnicode_READ_CHAR(u, i) #define __Pyx_PyUnicode_KIND(u) PyUnicode_KIND(u) #define __Pyx_PyUnicode_DATA(u) PyUnicode_DATA(u) #define __Pyx_PyUnicode_READ(k, d, i) PyUnicode_READ(k, d, i) #else #define CYTHON_PEP393_ENABLED 0 #define __Pyx_PyUnicode_READY(op) (0) #define __Pyx_PyUnicode_GET_LENGTH(u) PyUnicode_GET_SIZE(u) #define __Pyx_PyUnicode_READ_CHAR(u, i) ((Py_UCS4)(PyUnicode_AS_UNICODE(u)[i])) #define __Pyx_PyUnicode_KIND(u) (sizeof(Py_UNICODE)) #define __Pyx_PyUnicode_DATA(u) ((void*)PyUnicode_AS_UNICODE(u)) #define __Pyx_PyUnicode_READ(k, d, i) ((void)(k), (Py_UCS4)(((Py_UNICODE*)d)[i])) #endif #if CYTHON_COMPILING_IN_PYPY #define __Pyx_PyUnicode_Concat(a, b) PyNumber_Add(a, b) #define __Pyx_PyUnicode_ConcatSafe(a, b) PyNumber_Add(a, b) #else #define __Pyx_PyUnicode_Concat(a, b) PyUnicode_Concat(a, b) #define __Pyx_PyUnicode_ConcatSafe(a, b) ((unlikely((a) == Py_None) || unlikely((b) == Py_None)) ?\ PyNumber_Add(a, b) : __Pyx_PyUnicode_Concat(a, b)) #endif #if CYTHON_COMPILING_IN_PYPY && !defined(PyUnicode_Contains) #define PyUnicode_Contains(u, s) PySequence_Contains(u, s) #endif #define __Pyx_PyString_FormatSafe(a, b) ((unlikely((a) == Py_None)) ? PyNumber_Remainder(a, b) : __Pyx_PyString_Format(a, b)) #define __Pyx_PyUnicode_FormatSafe(a, b) ((unlikely((a) == Py_None)) ? PyNumber_Remainder(a, b) : PyUnicode_Format(a, b)) #if PY_MAJOR_VERSION >= 3 #define __Pyx_PyString_Format(a, b) PyUnicode_Format(a, b) #else #define __Pyx_PyString_Format(a, b) PyString_Format(a, b) #endif #if PY_MAJOR_VERSION >= 3 #define PyBaseString_Type PyUnicode_Type #define PyStringObject PyUnicodeObject #define PyString_Type PyUnicode_Type #define PyString_Check PyUnicode_Check #define PyString_CheckExact PyUnicode_CheckExact #endif #if PY_MAJOR_VERSION >= 3 #define __Pyx_PyBaseString_Check(obj) PyUnicode_Check(obj) #define __Pyx_PyBaseString_CheckExact(obj) PyUnicode_CheckExact(obj) #else #define __Pyx_PyBaseString_Check(obj) (PyString_Check(obj) || PyUnicode_Check(obj)) #define __Pyx_PyBaseString_CheckExact(obj) (PyString_CheckExact(obj) || PyUnicode_CheckExact(obj)) #endif #ifndef PySet_CheckExact #define PySet_CheckExact(obj) (Py_TYPE(obj) == &PySet_Type) #endif #define __Pyx_TypeCheck(obj, type) PyObject_TypeCheck(obj, (PyTypeObject *)type) #if PY_MAJOR_VERSION >= 3 #define PyIntObject PyLongObject #define PyInt_Type PyLong_Type #define PyInt_Check(op) PyLong_Check(op) #define PyInt_CheckExact(op) PyLong_CheckExact(op) #define PyInt_FromString PyLong_FromString #define PyInt_FromUnicode PyLong_FromUnicode #define PyInt_FromLong PyLong_FromLong #define PyInt_FromSize_t PyLong_FromSize_t #define PyInt_FromSsize_t PyLong_FromSsize_t #define PyInt_AsLong PyLong_AsLong #define PyInt_AS_LONG PyLong_AS_LONG #define PyInt_AsSsize_t PyLong_AsSsize_t #define PyInt_AsUnsignedLongMask PyLong_AsUnsignedLongMask #define PyInt_AsUnsignedLongLongMask PyLong_AsUnsignedLongLongMask #define PyNumber_Int PyNumber_Long #endif #if PY_MAJOR_VERSION >= 3 #define PyBoolObject PyLongObject #endif #if PY_MAJOR_VERSION >= 3 && CYTHON_COMPILING_IN_PYPY #ifndef PyUnicode_InternFromString #define PyUnicode_InternFromString(s) PyUnicode_FromString(s) #endif #endif #if PY_VERSION_HEX < 0x030200A4 typedef long Py_hash_t; #define __Pyx_PyInt_FromHash_t PyInt_FromLong #define __Pyx_PyInt_AsHash_t PyInt_AsLong #else #define __Pyx_PyInt_FromHash_t PyInt_FromSsize_t #define __Pyx_PyInt_AsHash_t PyInt_AsSsize_t #endif #if PY_MAJOR_VERSION >= 3 #define __Pyx_PyMethod_New(func, self, klass) ((self) ? PyMethod_New(func, self) : PyInstanceMethod_New(func)) #else #define __Pyx_PyMethod_New(func, self, klass) PyMethod_New(func, self, klass) #endif #if PY_VERSION_HEX >= 0x030500B1 #define __Pyx_PyAsyncMethodsStruct PyAsyncMethods #define __Pyx_PyType_AsAsync(obj) (Py_TYPE(obj)->tp_as_async) #elif CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3 typedef struct { unaryfunc am_await; unaryfunc am_aiter; unaryfunc am_anext; } __Pyx_PyAsyncMethodsStruct; #define __Pyx_PyType_AsAsync(obj) ((__Pyx_PyAsyncMethodsStruct*) (Py_TYPE(obj)->tp_reserved)) #else #define __Pyx_PyType_AsAsync(obj) NULL #endif #ifndef CYTHON_RESTRICT #if defined(__GNUC__) #define CYTHON_RESTRICT __restrict__ #elif defined(_MSC_VER) && _MSC_VER >= 1400 #define CYTHON_RESTRICT __restrict #elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L #define CYTHON_RESTRICT restrict #else #define CYTHON_RESTRICT #endif #endif #define __Pyx_void_to_None(void_result) (void_result, Py_INCREF(Py_None), Py_None) #ifndef CYTHON_INLINE #if defined(__GNUC__) #define CYTHON_INLINE __inline__ #elif defined(_MSC_VER) #define CYTHON_INLINE __inline #elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L #define CYTHON_INLINE inline #else #define CYTHON_INLINE #endif #endif #if defined(WIN32) || defined(MS_WINDOWS) #define _USE_MATH_DEFINES #endif #include #ifdef NAN #define __PYX_NAN() ((float) NAN) #else static CYTHON_INLINE float __PYX_NAN() { float value; memset(&value, 0xFF, sizeof(value)); return value; } #endif #if PY_MAJOR_VERSION >= 3 #define __Pyx_PyNumber_Divide(x,y) PyNumber_TrueDivide(x,y) #define __Pyx_PyNumber_InPlaceDivide(x,y) PyNumber_InPlaceTrueDivide(x,y) #else #define __Pyx_PyNumber_Divide(x,y) PyNumber_TrueDivide(x,y) #define __Pyx_PyNumber_InPlaceDivide(x,y) PyNumber_InPlaceTrueDivide(x,y) #endif #ifndef __PYX_EXTERN_C #ifdef __cplusplus #define __PYX_EXTERN_C extern "C" #else #define __PYX_EXTERN_C extern #endif #endif #define __PYX_HAVE__pygame_sdl2__joystick #define __PYX_HAVE_API__pygame_sdl2__joystick #include "stdint.h" #include "string.h" #include "stdio.h" #include "stddef.h" #include "SDL.h" #ifdef _OPENMP #include #endif /* _OPENMP */ #ifdef PYREX_WITHOUT_ASSERTIONS #define CYTHON_WITHOUT_ASSERTIONS #endif #ifndef CYTHON_UNUSED # if defined(__GNUC__) # if !(defined(__cplusplus)) || (__GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 4)) # define CYTHON_UNUSED __attribute__ ((__unused__)) # else # define CYTHON_UNUSED # endif # elif defined(__ICC) || (defined(__INTEL_COMPILER) && !defined(_MSC_VER)) # define CYTHON_UNUSED __attribute__ ((__unused__)) # else # define CYTHON_UNUSED # endif #endif #ifndef CYTHON_NCP_UNUSED # if CYTHON_COMPILING_IN_CPYTHON # define CYTHON_NCP_UNUSED # else # define CYTHON_NCP_UNUSED CYTHON_UNUSED # endif #endif typedef struct {PyObject **p; char *s; const Py_ssize_t n; const char* encoding; const char is_unicode; const char is_str; const char intern; } __Pyx_StringTabEntry; #define __PYX_DEFAULT_STRING_ENCODING_IS_ASCII 0 #define __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT 0 #define __PYX_DEFAULT_STRING_ENCODING "" #define __Pyx_PyObject_FromString __Pyx_PyBytes_FromString #define __Pyx_PyObject_FromStringAndSize __Pyx_PyBytes_FromStringAndSize #define __Pyx_uchar_cast(c) ((unsigned char)c) #define __Pyx_long_cast(x) ((long)x) #define __Pyx_fits_Py_ssize_t(v, type, is_signed) (\ (sizeof(type) < sizeof(Py_ssize_t)) ||\ (sizeof(type) > sizeof(Py_ssize_t) &&\ likely(v < (type)PY_SSIZE_T_MAX ||\ v == (type)PY_SSIZE_T_MAX) &&\ (!is_signed || likely(v > (type)PY_SSIZE_T_MIN ||\ v == (type)PY_SSIZE_T_MIN))) ||\ (sizeof(type) == sizeof(Py_ssize_t) &&\ (is_signed || likely(v < (type)PY_SSIZE_T_MAX ||\ v == (type)PY_SSIZE_T_MAX))) ) #if defined (__cplusplus) && __cplusplus >= 201103L #include #define __Pyx_sst_abs(value) std::abs(value) #elif SIZEOF_INT >= SIZEOF_SIZE_T #define __Pyx_sst_abs(value) abs(value) #elif SIZEOF_LONG >= SIZEOF_SIZE_T #define __Pyx_sst_abs(value) labs(value) #elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L #define __Pyx_sst_abs(value) llabs(value) #elif defined (_MSC_VER) && defined (_M_X64) #define __Pyx_sst_abs(value) _abs64(value) #elif defined (__GNUC__) #define __Pyx_sst_abs(value) __builtin_llabs(value) #else #define __Pyx_sst_abs(value) ((value<0) ? -value : value) #endif static CYTHON_INLINE char* __Pyx_PyObject_AsString(PyObject*); static CYTHON_INLINE char* __Pyx_PyObject_AsStringAndSize(PyObject*, Py_ssize_t* length); #define __Pyx_PyByteArray_FromString(s) PyByteArray_FromStringAndSize((const char*)s, strlen((const char*)s)) #define __Pyx_PyByteArray_FromStringAndSize(s, l) PyByteArray_FromStringAndSize((const char*)s, l) #define __Pyx_PyBytes_FromString PyBytes_FromString #define __Pyx_PyBytes_FromStringAndSize PyBytes_FromStringAndSize static CYTHON_INLINE PyObject* __Pyx_PyUnicode_FromString(const char*); #if PY_MAJOR_VERSION < 3 #define __Pyx_PyStr_FromString __Pyx_PyBytes_FromString #define __Pyx_PyStr_FromStringAndSize __Pyx_PyBytes_FromStringAndSize #else #define __Pyx_PyStr_FromString __Pyx_PyUnicode_FromString #define __Pyx_PyStr_FromStringAndSize __Pyx_PyUnicode_FromStringAndSize #endif #define __Pyx_PyObject_AsSString(s) ((signed char*) __Pyx_PyObject_AsString(s)) #define __Pyx_PyObject_AsUString(s) ((unsigned char*) __Pyx_PyObject_AsString(s)) #define __Pyx_PyObject_FromCString(s) __Pyx_PyObject_FromString((const char*)s) #define __Pyx_PyBytes_FromCString(s) __Pyx_PyBytes_FromString((const char*)s) #define __Pyx_PyByteArray_FromCString(s) __Pyx_PyByteArray_FromString((const char*)s) #define __Pyx_PyStr_FromCString(s) __Pyx_PyStr_FromString((const char*)s) #define __Pyx_PyUnicode_FromCString(s) __Pyx_PyUnicode_FromString((const char*)s) #if PY_MAJOR_VERSION < 3 static CYTHON_INLINE size_t __Pyx_Py_UNICODE_strlen(const Py_UNICODE *u) { const Py_UNICODE *u_end = u; while (*u_end++) ; return (size_t)(u_end - u - 1); } #else #define __Pyx_Py_UNICODE_strlen Py_UNICODE_strlen #endif #define __Pyx_PyUnicode_FromUnicode(u) PyUnicode_FromUnicode(u, __Pyx_Py_UNICODE_strlen(u)) #define __Pyx_PyUnicode_FromUnicodeAndLength PyUnicode_FromUnicode #define __Pyx_PyUnicode_AsUnicode PyUnicode_AsUnicode #define __Pyx_NewRef(obj) (Py_INCREF(obj), obj) #define __Pyx_Owned_Py_None(b) __Pyx_NewRef(Py_None) #define __Pyx_PyBool_FromLong(b) ((b) ? __Pyx_NewRef(Py_True) : __Pyx_NewRef(Py_False)) static CYTHON_INLINE int __Pyx_PyObject_IsTrue(PyObject*); static CYTHON_INLINE PyObject* __Pyx_PyNumber_Int(PyObject* x); static CYTHON_INLINE Py_ssize_t __Pyx_PyIndex_AsSsize_t(PyObject*); static CYTHON_INLINE PyObject * __Pyx_PyInt_FromSize_t(size_t); #if CYTHON_COMPILING_IN_CPYTHON #define __pyx_PyFloat_AsDouble(x) (PyFloat_CheckExact(x) ? PyFloat_AS_DOUBLE(x) : PyFloat_AsDouble(x)) #else #define __pyx_PyFloat_AsDouble(x) PyFloat_AsDouble(x) #endif #define __pyx_PyFloat_AsFloat(x) ((float) __pyx_PyFloat_AsDouble(x)) #if PY_MAJOR_VERSION < 3 && __PYX_DEFAULT_STRING_ENCODING_IS_ASCII static int __Pyx_sys_getdefaultencoding_not_ascii; static int __Pyx_init_sys_getdefaultencoding_params(void) { PyObject* sys; PyObject* default_encoding = NULL; PyObject* ascii_chars_u = NULL; PyObject* ascii_chars_b = NULL; const char* default_encoding_c; sys = PyImport_ImportModule("sys"); if (!sys) goto bad; default_encoding = PyObject_CallMethod(sys, (char*) "getdefaultencoding", NULL); Py_DECREF(sys); if (!default_encoding) goto bad; default_encoding_c = PyBytes_AsString(default_encoding); if (!default_encoding_c) goto bad; if (strcmp(default_encoding_c, "ascii") == 0) { __Pyx_sys_getdefaultencoding_not_ascii = 0; } else { char ascii_chars[128]; int c; for (c = 0; c < 128; c++) { ascii_chars[c] = c; } __Pyx_sys_getdefaultencoding_not_ascii = 1; ascii_chars_u = PyUnicode_DecodeASCII(ascii_chars, 128, NULL); if (!ascii_chars_u) goto bad; ascii_chars_b = PyUnicode_AsEncodedString(ascii_chars_u, default_encoding_c, NULL); if (!ascii_chars_b || !PyBytes_Check(ascii_chars_b) || memcmp(ascii_chars, PyBytes_AS_STRING(ascii_chars_b), 128) != 0) { PyErr_Format( PyExc_ValueError, "This module compiled with c_string_encoding=ascii, but default encoding '%.200s' is not a superset of ascii.", default_encoding_c); goto bad; } Py_DECREF(ascii_chars_u); Py_DECREF(ascii_chars_b); } Py_DECREF(default_encoding); return 0; bad: Py_XDECREF(default_encoding); Py_XDECREF(ascii_chars_u); Py_XDECREF(ascii_chars_b); return -1; } #endif #if __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT && PY_MAJOR_VERSION >= 3 #define __Pyx_PyUnicode_FromStringAndSize(c_str, size) PyUnicode_DecodeUTF8(c_str, size, NULL) #else #define __Pyx_PyUnicode_FromStringAndSize(c_str, size) PyUnicode_Decode(c_str, size, __PYX_DEFAULT_STRING_ENCODING, NULL) #if __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT static char* __PYX_DEFAULT_STRING_ENCODING; static int __Pyx_init_sys_getdefaultencoding_params(void) { PyObject* sys; PyObject* default_encoding = NULL; char* default_encoding_c; sys = PyImport_ImportModule("sys"); if (!sys) goto bad; default_encoding = PyObject_CallMethod(sys, (char*) (const char*) "getdefaultencoding", NULL); Py_DECREF(sys); if (!default_encoding) goto bad; default_encoding_c = PyBytes_AsString(default_encoding); if (!default_encoding_c) goto bad; __PYX_DEFAULT_STRING_ENCODING = (char*) malloc(strlen(default_encoding_c)); if (!__PYX_DEFAULT_STRING_ENCODING) goto bad; strcpy(__PYX_DEFAULT_STRING_ENCODING, default_encoding_c); Py_DECREF(default_encoding); return 0; bad: Py_XDECREF(default_encoding); return -1; } #endif #endif /* Test for GCC > 2.95 */ #if defined(__GNUC__) && (__GNUC__ > 2 || (__GNUC__ == 2 && (__GNUC_MINOR__ > 95))) #define likely(x) __builtin_expect(!!(x), 1) #define unlikely(x) __builtin_expect(!!(x), 0) #else /* !__GNUC__ or GCC < 2.95 */ #define likely(x) (x) #define unlikely(x) (x) #endif /* __GNUC__ */ static PyObject *__pyx_m; static PyObject *__pyx_d; static PyObject *__pyx_b; static PyObject *__pyx_empty_tuple; static PyObject *__pyx_empty_bytes; static int __pyx_lineno; static int __pyx_clineno = 0; static const char * __pyx_cfilenm= __FILE__; static const char *__pyx_filename; static const char *__pyx_f[] = { "src/pygame_sdl2/joystick.pyx", }; /*--- Type declarations ---*/ struct __pyx_obj_11pygame_sdl2_8joystick_Joystick; /* "pygame_sdl2/joystick.pyx":41 * * * cdef class Joystick: # <<<<<<<<<<<<<< * # Allow weak references. * cdef object __weakref__ */ struct __pyx_obj_11pygame_sdl2_8joystick_Joystick { PyObject_HEAD PyObject *__weakref__; SDL_Joystick *joystick; int joyid; }; /* --- Runtime support code (head) --- */ #ifndef CYTHON_REFNANNY #define CYTHON_REFNANNY 0 #endif #if CYTHON_REFNANNY typedef struct { void (*INCREF)(void*, PyObject*, int); void (*DECREF)(void*, PyObject*, int); void (*GOTREF)(void*, PyObject*, int); void (*GIVEREF)(void*, PyObject*, int); void* (*SetupContext)(const char*, int, const char*); void (*FinishContext)(void**); } __Pyx_RefNannyAPIStruct; static __Pyx_RefNannyAPIStruct *__Pyx_RefNanny = NULL; static __Pyx_RefNannyAPIStruct *__Pyx_RefNannyImportAPI(const char *modname); #define __Pyx_RefNannyDeclarations void *__pyx_refnanny = NULL; #ifdef WITH_THREAD #define __Pyx_RefNannySetupContext(name, acquire_gil)\ if (acquire_gil) {\ PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure();\ __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), __LINE__, __FILE__);\ PyGILState_Release(__pyx_gilstate_save);\ } else {\ __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), __LINE__, __FILE__);\ } #else #define __Pyx_RefNannySetupContext(name, acquire_gil)\ __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), __LINE__, __FILE__) #endif #define __Pyx_RefNannyFinishContext()\ __Pyx_RefNanny->FinishContext(&__pyx_refnanny) #define __Pyx_INCREF(r) __Pyx_RefNanny->INCREF(__pyx_refnanny, (PyObject *)(r), __LINE__) #define __Pyx_DECREF(r) __Pyx_RefNanny->DECREF(__pyx_refnanny, (PyObject *)(r), __LINE__) #define __Pyx_GOTREF(r) __Pyx_RefNanny->GOTREF(__pyx_refnanny, (PyObject *)(r), __LINE__) #define __Pyx_GIVEREF(r) __Pyx_RefNanny->GIVEREF(__pyx_refnanny, (PyObject *)(r), __LINE__) #define __Pyx_XINCREF(r) do { if((r) != NULL) {__Pyx_INCREF(r); }} while(0) #define __Pyx_XDECREF(r) do { if((r) != NULL) {__Pyx_DECREF(r); }} while(0) #define __Pyx_XGOTREF(r) do { if((r) != NULL) {__Pyx_GOTREF(r); }} while(0) #define __Pyx_XGIVEREF(r) do { if((r) != NULL) {__Pyx_GIVEREF(r);}} while(0) #else #define __Pyx_RefNannyDeclarations #define __Pyx_RefNannySetupContext(name, acquire_gil) #define __Pyx_RefNannyFinishContext() #define __Pyx_INCREF(r) Py_INCREF(r) #define __Pyx_DECREF(r) Py_DECREF(r) #define __Pyx_GOTREF(r) #define __Pyx_GIVEREF(r) #define __Pyx_XINCREF(r) Py_XINCREF(r) #define __Pyx_XDECREF(r) Py_XDECREF(r) #define __Pyx_XGOTREF(r) #define __Pyx_XGIVEREF(r) #endif #define __Pyx_XDECREF_SET(r, v) do {\ PyObject *tmp = (PyObject *) r;\ r = v; __Pyx_XDECREF(tmp);\ } while (0) #define __Pyx_DECREF_SET(r, v) do {\ PyObject *tmp = (PyObject *) r;\ r = v; __Pyx_DECREF(tmp);\ } while (0) #define __Pyx_CLEAR(r) do { PyObject* tmp = ((PyObject*)(r)); r = NULL; __Pyx_DECREF(tmp);} while(0) #define __Pyx_XCLEAR(r) do { if((r) != NULL) {PyObject* tmp = ((PyObject*)(r)); r = NULL; __Pyx_DECREF(tmp);}} while(0) #if CYTHON_COMPILING_IN_CPYTHON static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStr(PyObject* obj, PyObject* attr_name) { PyTypeObject* tp = Py_TYPE(obj); if (likely(tp->tp_getattro)) return tp->tp_getattro(obj, attr_name); #if PY_MAJOR_VERSION < 3 if (likely(tp->tp_getattr)) return tp->tp_getattr(obj, PyString_AS_STRING(attr_name)); #endif return PyObject_GetAttr(obj, attr_name); } #else #define __Pyx_PyObject_GetAttrStr(o,n) PyObject_GetAttr(o,n) #endif static PyObject *__Pyx_GetBuiltinName(PyObject *name); static CYTHON_INLINE PyObject *__Pyx_GetModuleGlobalName(PyObject *name); #if CYTHON_COMPILING_IN_CPYTHON static CYTHON_INLINE PyObject* __Pyx_PyObject_Call(PyObject *func, PyObject *arg, PyObject *kw); #else #define __Pyx_PyObject_Call(func, arg, kw) PyObject_Call(func, arg, kw) #endif #if CYTHON_COMPILING_IN_CPYTHON static CYTHON_INLINE PyObject* __Pyx_PyObject_CallMethO(PyObject *func, PyObject *arg); #endif static CYTHON_INLINE PyObject* __Pyx_PyObject_CallOneArg(PyObject *func, PyObject *arg); #if CYTHON_COMPILING_IN_CPYTHON static CYTHON_INLINE PyObject* __Pyx_PyObject_CallNoArg(PyObject *func); #else #define __Pyx_PyObject_CallNoArg(func) __Pyx_PyObject_Call(func, __pyx_empty_tuple, NULL) #endif static CYTHON_INLINE void __Pyx_ErrRestore(PyObject *type, PyObject *value, PyObject *tb); static CYTHON_INLINE void __Pyx_ErrFetch(PyObject **type, PyObject **value, PyObject **tb); static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, PyObject *cause); static void __Pyx_RaiseArgtupleInvalid(const char* func_name, int exact, Py_ssize_t num_min, Py_ssize_t num_max, Py_ssize_t num_found); static CYTHON_INLINE int __Pyx_CheckKeywordStrings(PyObject *kwdict, const char* function_name, int kw_allowed); static void __Pyx_RaiseDoubleKeywordsError(const char* func_name, PyObject* kw_name); static int __Pyx_ParseOptionalKeywords(PyObject *kwds, PyObject **argnames[],\ PyObject *kwds2, PyObject *values[], Py_ssize_t num_pos_args,\ const char* function_name); static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list, int level); static PyObject* __Pyx_ImportFrom(PyObject* module, PyObject* name); typedef struct { int code_line; PyCodeObject* code_object; } __Pyx_CodeObjectCacheEntry; struct __Pyx_CodeObjectCache { int count; int max_count; __Pyx_CodeObjectCacheEntry* entries; }; static struct __Pyx_CodeObjectCache __pyx_code_cache = {0,0,NULL}; static int __pyx_bisect_code_objects(__Pyx_CodeObjectCacheEntry* entries, int count, int code_line); static PyCodeObject *__pyx_find_code_object(int code_line); static void __pyx_insert_code_object(int code_line, PyCodeObject* code_object); static void __Pyx_AddTraceback(const char *funcname, int c_line, int py_line, const char *filename); static CYTHON_INLINE PyObject* __Pyx_PyInt_From_int(int value); static CYTHON_INLINE int __Pyx_PyInt_As_int(PyObject *); static CYTHON_INLINE PyObject* __Pyx_PyInt_From_int32_t(int32_t value); static CYTHON_INLINE PyObject* __Pyx_PyInt_From_long(long value); static CYTHON_INLINE long __Pyx_PyInt_As_long(PyObject *); static int __Pyx_check_binary_version(void); static int __Pyx_InitStrings(__Pyx_StringTabEntry *t); /* Module declarations from 'libc.stdint' */ /* Module declarations from 'libc.string' */ /* Module declarations from 'libc.stdio' */ /* Module declarations from 'libc.stddef' */ /* Module declarations from 'sdl2' */ /* Module declarations from 'pygame_sdl2.joystick' */ static PyTypeObject *__pyx_ptype_11pygame_sdl2_8joystick_Joystick = 0; #define __Pyx_MODULE_NAME "pygame_sdl2.joystick" int __pyx_module_is_main_pygame_sdl2__joystick = 0; /* Implementation of 'pygame_sdl2.joystick' */ static char __pyx_k_id[] = "id"; static char __pyx_k_init[] = "init"; static char __pyx_k_main[] = "__main__"; static char __pyx_k_quit[] = "quit"; static char __pyx_k_test[] = "__test__"; static char __pyx_k_error[] = "error"; static char __pyx_k_import[] = "__import__"; static char __pyx_k_display[] = "display"; static char __pyx_k_get_init[] = "get_init"; static char __pyx_k_get_count[] = "get_count"; static char __pyx_k_pygame_sdl2[] = "pygame_sdl2"; static char __pyx_k_register_init[] = "register_init"; static char __pyx_k_register_quit[] = "register_quit"; static char __pyx_k_sdl_main_init[] = "sdl_main_init"; static char __pyx_k_pygame_sdl2_error[] = "pygame_sdl2.error"; static char __pyx_k_pygame_sdl2_joystick[] = "pygame_sdl2.joystick"; static char __pyx_k_joystick_not_initialized[] = "joystick not initialized"; static char __pyx_k_home_tom_ab_pygame_sdl2_src_pyg[] = "/home/tom/ab/pygame_sdl2/src/pygame_sdl2/joystick.pyx"; static PyObject *__pyx_n_s_display; static PyObject *__pyx_n_s_error; static PyObject *__pyx_n_s_get_count; static PyObject *__pyx_n_s_get_init; static PyObject *__pyx_kp_s_home_tom_ab_pygame_sdl2_src_pyg; static PyObject *__pyx_n_s_id; static PyObject *__pyx_n_s_import; static PyObject *__pyx_n_s_init; static PyObject *__pyx_kp_u_joystick_not_initialized; static PyObject *__pyx_n_s_main; static PyObject *__pyx_n_s_pygame_sdl2; static PyObject *__pyx_n_s_pygame_sdl2_error; static PyObject *__pyx_n_s_pygame_sdl2_joystick; static PyObject *__pyx_n_s_quit; static PyObject *__pyx_n_s_register_init; static PyObject *__pyx_n_s_register_quit; static PyObject *__pyx_n_s_sdl_main_init; static PyObject *__pyx_n_s_test; static PyObject *__pyx_pf_11pygame_sdl2_8joystick_init(CYTHON_UNUSED PyObject *__pyx_self); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_8joystick_2quit(CYTHON_UNUSED PyObject *__pyx_self); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_8joystick_4get_init(CYTHON_UNUSED PyObject *__pyx_self); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_8joystick_6get_count(CYTHON_UNUSED PyObject *__pyx_self); /* proto */ static int __pyx_pf_11pygame_sdl2_8joystick_8Joystick___cinit__(struct __pyx_obj_11pygame_sdl2_8joystick_Joystick *__pyx_v_self); /* proto */ static int __pyx_pf_11pygame_sdl2_8joystick_8Joystick_2__init__(struct __pyx_obj_11pygame_sdl2_8joystick_Joystick *__pyx_v_self, PyObject *__pyx_v_id); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_8joystick_8Joystick_4init(struct __pyx_obj_11pygame_sdl2_8joystick_Joystick *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_8joystick_8Joystick_6quit(struct __pyx_obj_11pygame_sdl2_8joystick_Joystick *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_8joystick_8Joystick_8get_init(struct __pyx_obj_11pygame_sdl2_8joystick_Joystick *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_8joystick_8Joystick_10get_id(struct __pyx_obj_11pygame_sdl2_8joystick_Joystick *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_8joystick_8Joystick_12get_name(struct __pyx_obj_11pygame_sdl2_8joystick_Joystick *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_8joystick_8Joystick_14get_numaxes(struct __pyx_obj_11pygame_sdl2_8joystick_Joystick *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_8joystick_8Joystick_16get_numballs(struct __pyx_obj_11pygame_sdl2_8joystick_Joystick *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_8joystick_8Joystick_18get_numbuttons(struct __pyx_obj_11pygame_sdl2_8joystick_Joystick *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_8joystick_8Joystick_20get_numhats(struct __pyx_obj_11pygame_sdl2_8joystick_Joystick *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_8joystick_8Joystick_22get_axis(struct __pyx_obj_11pygame_sdl2_8joystick_Joystick *__pyx_v_self, PyObject *__pyx_v_axis_number); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_8joystick_8Joystick_24get_ball(struct __pyx_obj_11pygame_sdl2_8joystick_Joystick *__pyx_v_self, PyObject *__pyx_v_ball_number); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_8joystick_8Joystick_26get_button(struct __pyx_obj_11pygame_sdl2_8joystick_Joystick *__pyx_v_self, PyObject *__pyx_v_button); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_8joystick_8Joystick_28get_hat(struct __pyx_obj_11pygame_sdl2_8joystick_Joystick *__pyx_v_self, PyObject *__pyx_v_hat_number); /* proto */ static PyObject *__pyx_tp_new_11pygame_sdl2_8joystick_Joystick(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ static PyObject *__pyx_tuple_; static PyObject *__pyx_tuple__2; static PyObject *__pyx_tuple__3; static PyObject *__pyx_tuple__4; static PyObject *__pyx_tuple__5; static PyObject *__pyx_tuple__6; static PyObject *__pyx_tuple__7; static PyObject *__pyx_tuple__8; static PyObject *__pyx_tuple__9; static PyObject *__pyx_tuple__10; static PyObject *__pyx_codeobj__11; static PyObject *__pyx_codeobj__12; static PyObject *__pyx_codeobj__13; static PyObject *__pyx_codeobj__14; /* "pygame_sdl2/joystick.pyx":24 * * @pygame_sdl2.register_init * def init(): # <<<<<<<<<<<<<< * pygame_sdl2.display.sdl_main_init() * */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_8joystick_1init(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused); /*proto*/ static PyMethodDef __pyx_mdef_11pygame_sdl2_8joystick_1init = {"init", (PyCFunction)__pyx_pw_11pygame_sdl2_8joystick_1init, METH_NOARGS, 0}; static PyObject *__pyx_pw_11pygame_sdl2_8joystick_1init(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("init (wrapper)", 0); __pyx_r = __pyx_pf_11pygame_sdl2_8joystick_init(__pyx_self); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_8joystick_init(CYTHON_UNUSED PyObject *__pyx_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; int __pyx_t_4; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("init", 0); /* "pygame_sdl2/joystick.pyx":25 * @pygame_sdl2.register_init * def init(): * pygame_sdl2.display.sdl_main_init() # <<<<<<<<<<<<<< * * if SDL_InitSubSystem(SDL_INIT_JOYSTICK): */ __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_pygame_sdl2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 25; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_display); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 25; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_sdl_main_init); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 25; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_3 = NULL; if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_2))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); if (likely(__pyx_t_3)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); } } if (__pyx_t_3) { __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 25; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } else { __pyx_t_1 = __Pyx_PyObject_CallNoArg(__pyx_t_2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 25; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "pygame_sdl2/joystick.pyx":27 * pygame_sdl2.display.sdl_main_init() * * if SDL_InitSubSystem(SDL_INIT_JOYSTICK): # <<<<<<<<<<<<<< * raise error() * */ __pyx_t_4 = (SDL_InitSubSystem(SDL_INIT_JOYSTICK) != 0); if (__pyx_t_4) { /* "pygame_sdl2/joystick.pyx":28 * * if SDL_InitSubSystem(SDL_INIT_JOYSTICK): * raise error() # <<<<<<<<<<<<<< * * @pygame_sdl2.register_quit */ __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_error); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 28; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = NULL; if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_2))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); if (likely(__pyx_t_3)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); } } if (__pyx_t_3) { __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 28; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } else { __pyx_t_1 = __Pyx_PyObject_CallNoArg(__pyx_t_2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 28; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_Raise(__pyx_t_1, 0, 0, 0); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; {__pyx_filename = __pyx_f[0]; __pyx_lineno = 28; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "pygame_sdl2/joystick.pyx":27 * pygame_sdl2.display.sdl_main_init() * * if SDL_InitSubSystem(SDL_INIT_JOYSTICK): # <<<<<<<<<<<<<< * raise error() * */ } /* "pygame_sdl2/joystick.pyx":24 * * @pygame_sdl2.register_init * def init(): # <<<<<<<<<<<<<< * pygame_sdl2.display.sdl_main_init() * */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("pygame_sdl2.joystick.init", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/joystick.pyx":31 * * @pygame_sdl2.register_quit * def quit(): # @ReservedAssignment # <<<<<<<<<<<<<< * SDL_QuitSubSystem(SDL_INIT_JOYSTICK) * */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_8joystick_3quit(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused); /*proto*/ static PyMethodDef __pyx_mdef_11pygame_sdl2_8joystick_3quit = {"quit", (PyCFunction)__pyx_pw_11pygame_sdl2_8joystick_3quit, METH_NOARGS, 0}; static PyObject *__pyx_pw_11pygame_sdl2_8joystick_3quit(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("quit (wrapper)", 0); __pyx_r = __pyx_pf_11pygame_sdl2_8joystick_2quit(__pyx_self); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_8joystick_2quit(CYTHON_UNUSED PyObject *__pyx_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("quit", 0); /* "pygame_sdl2/joystick.pyx":32 * @pygame_sdl2.register_quit * def quit(): # @ReservedAssignment * SDL_QuitSubSystem(SDL_INIT_JOYSTICK) # <<<<<<<<<<<<<< * * def get_init(): */ SDL_QuitSubSystem(SDL_INIT_JOYSTICK); /* "pygame_sdl2/joystick.pyx":31 * * @pygame_sdl2.register_quit * def quit(): # @ReservedAssignment # <<<<<<<<<<<<<< * SDL_QuitSubSystem(SDL_INIT_JOYSTICK) * */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/joystick.pyx":34 * SDL_QuitSubSystem(SDL_INIT_JOYSTICK) * * def get_init(): # <<<<<<<<<<<<<< * return SDL_WasInit(SDL_INIT_JOYSTICK) != 0 * */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_8joystick_5get_init(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused); /*proto*/ static PyMethodDef __pyx_mdef_11pygame_sdl2_8joystick_5get_init = {"get_init", (PyCFunction)__pyx_pw_11pygame_sdl2_8joystick_5get_init, METH_NOARGS, 0}; static PyObject *__pyx_pw_11pygame_sdl2_8joystick_5get_init(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("get_init (wrapper)", 0); __pyx_r = __pyx_pf_11pygame_sdl2_8joystick_4get_init(__pyx_self); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_8joystick_4get_init(CYTHON_UNUSED PyObject *__pyx_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("get_init", 0); /* "pygame_sdl2/joystick.pyx":35 * * def get_init(): * return SDL_WasInit(SDL_INIT_JOYSTICK) != 0 # <<<<<<<<<<<<<< * * def get_count(): */ __Pyx_XDECREF(__pyx_r); __pyx_t_1 = __Pyx_PyBool_FromLong((SDL_WasInit(SDL_INIT_JOYSTICK) != 0)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 35; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "pygame_sdl2/joystick.pyx":34 * SDL_QuitSubSystem(SDL_INIT_JOYSTICK) * * def get_init(): # <<<<<<<<<<<<<< * return SDL_WasInit(SDL_INIT_JOYSTICK) != 0 * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("pygame_sdl2.joystick.get_init", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/joystick.pyx":37 * return SDL_WasInit(SDL_INIT_JOYSTICK) != 0 * * def get_count(): # <<<<<<<<<<<<<< * return SDL_NumJoysticks() * */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_8joystick_7get_count(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused); /*proto*/ static PyMethodDef __pyx_mdef_11pygame_sdl2_8joystick_7get_count = {"get_count", (PyCFunction)__pyx_pw_11pygame_sdl2_8joystick_7get_count, METH_NOARGS, 0}; static PyObject *__pyx_pw_11pygame_sdl2_8joystick_7get_count(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("get_count (wrapper)", 0); __pyx_r = __pyx_pf_11pygame_sdl2_8joystick_6get_count(__pyx_self); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_8joystick_6get_count(CYTHON_UNUSED PyObject *__pyx_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("get_count", 0); /* "pygame_sdl2/joystick.pyx":38 * * def get_count(): * return SDL_NumJoysticks() # <<<<<<<<<<<<<< * * */ __Pyx_XDECREF(__pyx_r); __pyx_t_1 = __Pyx_PyInt_From_int(SDL_NumJoysticks()); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 38; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "pygame_sdl2/joystick.pyx":37 * return SDL_WasInit(SDL_INIT_JOYSTICK) != 0 * * def get_count(): # <<<<<<<<<<<<<< * return SDL_NumJoysticks() * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("pygame_sdl2.joystick.get_count", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/joystick.pyx":48 * cdef int joyid * * def __cinit__(self): # <<<<<<<<<<<<<< * self.joystick = NULL * */ /* Python wrapper */ static int __pyx_pw_11pygame_sdl2_8joystick_8Joystick_1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static int __pyx_pw_11pygame_sdl2_8joystick_8Joystick_1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__cinit__ (wrapper)", 0); if (unlikely(PyTuple_GET_SIZE(__pyx_args) > 0)) { __Pyx_RaiseArgtupleInvalid("__cinit__", 1, 0, 0, PyTuple_GET_SIZE(__pyx_args)); return -1;} if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "__cinit__", 0))) return -1; __pyx_r = __pyx_pf_11pygame_sdl2_8joystick_8Joystick___cinit__(((struct __pyx_obj_11pygame_sdl2_8joystick_Joystick *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static int __pyx_pf_11pygame_sdl2_8joystick_8Joystick___cinit__(struct __pyx_obj_11pygame_sdl2_8joystick_Joystick *__pyx_v_self) { int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__cinit__", 0); /* "pygame_sdl2/joystick.pyx":49 * * def __cinit__(self): * self.joystick = NULL # <<<<<<<<<<<<<< * * def __init__(self, id): */ __pyx_v_self->joystick = NULL; /* "pygame_sdl2/joystick.pyx":48 * cdef int joyid * * def __cinit__(self): # <<<<<<<<<<<<<< * self.joystick = NULL * */ /* function exit code */ __pyx_r = 0; __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/joystick.pyx":51 * self.joystick = NULL * * def __init__(self, id): # <<<<<<<<<<<<<< * self.joyid = id * */ /* Python wrapper */ static int __pyx_pw_11pygame_sdl2_8joystick_8Joystick_3__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static int __pyx_pw_11pygame_sdl2_8joystick_8Joystick_3__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_id = 0; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__init__ (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_id,0}; PyObject* values[1] = {0}; if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_id)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__init__") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 51; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } } else if (PyTuple_GET_SIZE(__pyx_args) != 1) { goto __pyx_L5_argtuple_error; } else { values[0] = PyTuple_GET_ITEM(__pyx_args, 0); } __pyx_v_id = values[0]; } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("__init__", 1, 1, 1, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 51; __pyx_clineno = __LINE__; goto __pyx_L3_error;} __pyx_L3_error:; __Pyx_AddTraceback("pygame_sdl2.joystick.Joystick.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return -1; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_11pygame_sdl2_8joystick_8Joystick_2__init__(((struct __pyx_obj_11pygame_sdl2_8joystick_Joystick *)__pyx_v_self), __pyx_v_id); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static int __pyx_pf_11pygame_sdl2_8joystick_8Joystick_2__init__(struct __pyx_obj_11pygame_sdl2_8joystick_Joystick *__pyx_v_self, PyObject *__pyx_v_id) { int __pyx_r; __Pyx_RefNannyDeclarations int __pyx_t_1; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__init__", 0); /* "pygame_sdl2/joystick.pyx":52 * * def __init__(self, id): * self.joyid = id # <<<<<<<<<<<<<< * * def init(self): */ __pyx_t_1 = __Pyx_PyInt_As_int(__pyx_v_id); if (unlikely((__pyx_t_1 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 52; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_v_self->joyid = __pyx_t_1; /* "pygame_sdl2/joystick.pyx":51 * self.joystick = NULL * * def __init__(self, id): # <<<<<<<<<<<<<< * self.joyid = id * */ /* function exit code */ __pyx_r = 0; goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("pygame_sdl2.joystick.Joystick.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = -1; __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/joystick.pyx":54 * self.joyid = id * * def init(self): # <<<<<<<<<<<<<< * if self.joystick == NULL: * self.joystick = SDL_JoystickOpen(self.joyid) */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_8joystick_8Joystick_5init(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/ static PyObject *__pyx_pw_11pygame_sdl2_8joystick_8Joystick_5init(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("init (wrapper)", 0); __pyx_r = __pyx_pf_11pygame_sdl2_8joystick_8Joystick_4init(((struct __pyx_obj_11pygame_sdl2_8joystick_Joystick *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_8joystick_8Joystick_4init(struct __pyx_obj_11pygame_sdl2_8joystick_Joystick *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("init", 0); /* "pygame_sdl2/joystick.pyx":55 * * def init(self): * if self.joystick == NULL: # <<<<<<<<<<<<<< * self.joystick = SDL_JoystickOpen(self.joyid) * if self.joystick == NULL: */ __pyx_t_1 = ((__pyx_v_self->joystick == NULL) != 0); if (__pyx_t_1) { /* "pygame_sdl2/joystick.pyx":56 * def init(self): * if self.joystick == NULL: * self.joystick = SDL_JoystickOpen(self.joyid) # <<<<<<<<<<<<<< * if self.joystick == NULL: * raise error() */ __pyx_v_self->joystick = SDL_JoystickOpen(__pyx_v_self->joyid); /* "pygame_sdl2/joystick.pyx":57 * if self.joystick == NULL: * self.joystick = SDL_JoystickOpen(self.joyid) * if self.joystick == NULL: # <<<<<<<<<<<<<< * raise error() * */ __pyx_t_1 = ((__pyx_v_self->joystick == NULL) != 0); if (__pyx_t_1) { /* "pygame_sdl2/joystick.pyx":58 * self.joystick = SDL_JoystickOpen(self.joyid) * if self.joystick == NULL: * raise error() # <<<<<<<<<<<<<< * * def quit(self): # @ReservedAssignment */ __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_error); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 58; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = NULL; if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_3))) { __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3); if (likely(__pyx_t_4)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); __Pyx_INCREF(__pyx_t_4); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_3, function); } } if (__pyx_t_4) { __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 58; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; } else { __pyx_t_2 = __Pyx_PyObject_CallNoArg(__pyx_t_3); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 58; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_Raise(__pyx_t_2, 0, 0, 0); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; {__pyx_filename = __pyx_f[0]; __pyx_lineno = 58; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "pygame_sdl2/joystick.pyx":57 * if self.joystick == NULL: * self.joystick = SDL_JoystickOpen(self.joyid) * if self.joystick == NULL: # <<<<<<<<<<<<<< * raise error() * */ } /* "pygame_sdl2/joystick.pyx":55 * * def init(self): * if self.joystick == NULL: # <<<<<<<<<<<<<< * self.joystick = SDL_JoystickOpen(self.joyid) * if self.joystick == NULL: */ } /* "pygame_sdl2/joystick.pyx":54 * self.joyid = id * * def init(self): # <<<<<<<<<<<<<< * if self.joystick == NULL: * self.joystick = SDL_JoystickOpen(self.joyid) */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_AddTraceback("pygame_sdl2.joystick.Joystick.init", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/joystick.pyx":60 * raise error() * * def quit(self): # @ReservedAssignment # <<<<<<<<<<<<<< * if self.joystick != NULL: * SDL_JoystickClose(self.joystick) */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_8joystick_8Joystick_7quit(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/ static PyObject *__pyx_pw_11pygame_sdl2_8joystick_8Joystick_7quit(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("quit (wrapper)", 0); __pyx_r = __pyx_pf_11pygame_sdl2_8joystick_8Joystick_6quit(((struct __pyx_obj_11pygame_sdl2_8joystick_Joystick *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_8joystick_8Joystick_6quit(struct __pyx_obj_11pygame_sdl2_8joystick_Joystick *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; __Pyx_RefNannySetupContext("quit", 0); /* "pygame_sdl2/joystick.pyx":61 * * def quit(self): # @ReservedAssignment * if self.joystick != NULL: # <<<<<<<<<<<<<< * SDL_JoystickClose(self.joystick) * self.joystick = NULL */ __pyx_t_1 = ((__pyx_v_self->joystick != NULL) != 0); if (__pyx_t_1) { /* "pygame_sdl2/joystick.pyx":62 * def quit(self): # @ReservedAssignment * if self.joystick != NULL: * SDL_JoystickClose(self.joystick) # <<<<<<<<<<<<<< * self.joystick = NULL * */ SDL_JoystickClose(__pyx_v_self->joystick); /* "pygame_sdl2/joystick.pyx":63 * if self.joystick != NULL: * SDL_JoystickClose(self.joystick) * self.joystick = NULL # <<<<<<<<<<<<<< * * def get_init(self): */ __pyx_v_self->joystick = NULL; /* "pygame_sdl2/joystick.pyx":61 * * def quit(self): # @ReservedAssignment * if self.joystick != NULL: # <<<<<<<<<<<<<< * SDL_JoystickClose(self.joystick) * self.joystick = NULL */ } /* "pygame_sdl2/joystick.pyx":60 * raise error() * * def quit(self): # @ReservedAssignment # <<<<<<<<<<<<<< * if self.joystick != NULL: * SDL_JoystickClose(self.joystick) */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/joystick.pyx":65 * self.joystick = NULL * * def get_init(self): # <<<<<<<<<<<<<< * if self.joystick: * return True */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_8joystick_8Joystick_9get_init(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/ static PyObject *__pyx_pw_11pygame_sdl2_8joystick_8Joystick_9get_init(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("get_init (wrapper)", 0); __pyx_r = __pyx_pf_11pygame_sdl2_8joystick_8Joystick_8get_init(((struct __pyx_obj_11pygame_sdl2_8joystick_Joystick *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_8joystick_8Joystick_8get_init(struct __pyx_obj_11pygame_sdl2_8joystick_Joystick *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; __Pyx_RefNannySetupContext("get_init", 0); /* "pygame_sdl2/joystick.pyx":66 * * def get_init(self): * if self.joystick: # <<<<<<<<<<<<<< * return True * else: */ __pyx_t_1 = (__pyx_v_self->joystick != 0); if (__pyx_t_1) { /* "pygame_sdl2/joystick.pyx":67 * def get_init(self): * if self.joystick: * return True # <<<<<<<<<<<<<< * else: * return False */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(Py_True); __pyx_r = Py_True; goto __pyx_L0; /* "pygame_sdl2/joystick.pyx":66 * * def get_init(self): * if self.joystick: # <<<<<<<<<<<<<< * return True * else: */ } /* "pygame_sdl2/joystick.pyx":69 * return True * else: * return False # <<<<<<<<<<<<<< * * def get_id(self): */ /*else*/ { __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(Py_False); __pyx_r = Py_False; goto __pyx_L0; } /* "pygame_sdl2/joystick.pyx":65 * self.joystick = NULL * * def get_init(self): # <<<<<<<<<<<<<< * if self.joystick: * return True */ /* function exit code */ __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/joystick.pyx":71 * return False * * def get_id(self): # <<<<<<<<<<<<<< * if self.joystick == NULL: * raise error("joystick not initialized") */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_8joystick_8Joystick_11get_id(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/ static PyObject *__pyx_pw_11pygame_sdl2_8joystick_8Joystick_11get_id(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("get_id (wrapper)", 0); __pyx_r = __pyx_pf_11pygame_sdl2_8joystick_8Joystick_10get_id(((struct __pyx_obj_11pygame_sdl2_8joystick_Joystick *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_8joystick_8Joystick_10get_id(struct __pyx_obj_11pygame_sdl2_8joystick_Joystick *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("get_id", 0); /* "pygame_sdl2/joystick.pyx":72 * * def get_id(self): * if self.joystick == NULL: # <<<<<<<<<<<<<< * raise error("joystick not initialized") * */ __pyx_t_1 = ((__pyx_v_self->joystick == NULL) != 0); if (__pyx_t_1) { /* "pygame_sdl2/joystick.pyx":73 * def get_id(self): * if self.joystick == NULL: * raise error("joystick not initialized") # <<<<<<<<<<<<<< * * return SDL_JoystickInstanceID(self.joystick) */ __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_error); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 73; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_tuple_, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 73; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_Raise(__pyx_t_3, 0, 0, 0); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; {__pyx_filename = __pyx_f[0]; __pyx_lineno = 73; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "pygame_sdl2/joystick.pyx":72 * * def get_id(self): * if self.joystick == NULL: # <<<<<<<<<<<<<< * raise error("joystick not initialized") * */ } /* "pygame_sdl2/joystick.pyx":75 * raise error("joystick not initialized") * * return SDL_JoystickInstanceID(self.joystick) # <<<<<<<<<<<<<< * * def get_name(self): */ __Pyx_XDECREF(__pyx_r); __pyx_t_3 = __Pyx_PyInt_From_int32_t(SDL_JoystickInstanceID(__pyx_v_self->joystick)); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 75; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __pyx_r = __pyx_t_3; __pyx_t_3 = 0; goto __pyx_L0; /* "pygame_sdl2/joystick.pyx":71 * return False * * def get_id(self): # <<<<<<<<<<<<<< * if self.joystick == NULL: * raise error("joystick not initialized") */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("pygame_sdl2.joystick.Joystick.get_id", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/joystick.pyx":77 * return SDL_JoystickInstanceID(self.joystick) * * def get_name(self): # <<<<<<<<<<<<<< * cdef char *rv * */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_8joystick_8Joystick_13get_name(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/ static PyObject *__pyx_pw_11pygame_sdl2_8joystick_8Joystick_13get_name(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("get_name (wrapper)", 0); __pyx_r = __pyx_pf_11pygame_sdl2_8joystick_8Joystick_12get_name(((struct __pyx_obj_11pygame_sdl2_8joystick_Joystick *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_8joystick_8Joystick_12get_name(struct __pyx_obj_11pygame_sdl2_8joystick_Joystick *__pyx_v_self) { char *__pyx_v_rv; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("get_name", 0); /* "pygame_sdl2/joystick.pyx":80 * cdef char *rv * * if self.joystick == NULL: # <<<<<<<<<<<<<< * raise error("joystick not initialized") * */ __pyx_t_1 = ((__pyx_v_self->joystick == NULL) != 0); if (__pyx_t_1) { /* "pygame_sdl2/joystick.pyx":81 * * if self.joystick == NULL: * raise error("joystick not initialized") # <<<<<<<<<<<<<< * * rv = SDL_JoystickName(self.joystick) */ __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_error); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 81; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_tuple__2, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 81; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_Raise(__pyx_t_3, 0, 0, 0); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; {__pyx_filename = __pyx_f[0]; __pyx_lineno = 81; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "pygame_sdl2/joystick.pyx":80 * cdef char *rv * * if self.joystick == NULL: # <<<<<<<<<<<<<< * raise error("joystick not initialized") * */ } /* "pygame_sdl2/joystick.pyx":83 * raise error("joystick not initialized") * * rv = SDL_JoystickName(self.joystick) # <<<<<<<<<<<<<< * * if rv: */ __pyx_v_rv = SDL_JoystickName(__pyx_v_self->joystick); /* "pygame_sdl2/joystick.pyx":85 * rv = SDL_JoystickName(self.joystick) * * if rv: # <<<<<<<<<<<<<< * return rv * else: */ __pyx_t_1 = (__pyx_v_rv != 0); if (__pyx_t_1) { /* "pygame_sdl2/joystick.pyx":86 * * if rv: * return rv # <<<<<<<<<<<<<< * else: * return None */ __Pyx_XDECREF(__pyx_r); __pyx_t_3 = __Pyx_PyBytes_FromString(__pyx_v_rv); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 86; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __pyx_r = __pyx_t_3; __pyx_t_3 = 0; goto __pyx_L0; /* "pygame_sdl2/joystick.pyx":85 * rv = SDL_JoystickName(self.joystick) * * if rv: # <<<<<<<<<<<<<< * return rv * else: */ } /* "pygame_sdl2/joystick.pyx":88 * return rv * else: * return None # <<<<<<<<<<<<<< * * def get_numaxes(self): */ /*else*/ { __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(Py_None); __pyx_r = Py_None; goto __pyx_L0; } /* "pygame_sdl2/joystick.pyx":77 * return SDL_JoystickInstanceID(self.joystick) * * def get_name(self): # <<<<<<<<<<<<<< * cdef char *rv * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("pygame_sdl2.joystick.Joystick.get_name", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/joystick.pyx":90 * return None * * def get_numaxes(self): # <<<<<<<<<<<<<< * if self.joystick == NULL: * raise error("joystick not initialized") */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_8joystick_8Joystick_15get_numaxes(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/ static PyObject *__pyx_pw_11pygame_sdl2_8joystick_8Joystick_15get_numaxes(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("get_numaxes (wrapper)", 0); __pyx_r = __pyx_pf_11pygame_sdl2_8joystick_8Joystick_14get_numaxes(((struct __pyx_obj_11pygame_sdl2_8joystick_Joystick *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_8joystick_8Joystick_14get_numaxes(struct __pyx_obj_11pygame_sdl2_8joystick_Joystick *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("get_numaxes", 0); /* "pygame_sdl2/joystick.pyx":91 * * def get_numaxes(self): * if self.joystick == NULL: # <<<<<<<<<<<<<< * raise error("joystick not initialized") * */ __pyx_t_1 = ((__pyx_v_self->joystick == NULL) != 0); if (__pyx_t_1) { /* "pygame_sdl2/joystick.pyx":92 * def get_numaxes(self): * if self.joystick == NULL: * raise error("joystick not initialized") # <<<<<<<<<<<<<< * * return SDL_JoystickNumAxes(self.joystick) */ __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_error); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 92; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_tuple__3, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 92; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_Raise(__pyx_t_3, 0, 0, 0); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; {__pyx_filename = __pyx_f[0]; __pyx_lineno = 92; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "pygame_sdl2/joystick.pyx":91 * * def get_numaxes(self): * if self.joystick == NULL: # <<<<<<<<<<<<<< * raise error("joystick not initialized") * */ } /* "pygame_sdl2/joystick.pyx":94 * raise error("joystick not initialized") * * return SDL_JoystickNumAxes(self.joystick) # <<<<<<<<<<<<<< * * def get_numballs(self): */ __Pyx_XDECREF(__pyx_r); __pyx_t_3 = __Pyx_PyInt_From_int(SDL_JoystickNumAxes(__pyx_v_self->joystick)); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 94; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __pyx_r = __pyx_t_3; __pyx_t_3 = 0; goto __pyx_L0; /* "pygame_sdl2/joystick.pyx":90 * return None * * def get_numaxes(self): # <<<<<<<<<<<<<< * if self.joystick == NULL: * raise error("joystick not initialized") */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("pygame_sdl2.joystick.Joystick.get_numaxes", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/joystick.pyx":96 * return SDL_JoystickNumAxes(self.joystick) * * def get_numballs(self): # <<<<<<<<<<<<<< * if self.joystick == NULL: * raise error("joystick not initialized") */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_8joystick_8Joystick_17get_numballs(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/ static PyObject *__pyx_pw_11pygame_sdl2_8joystick_8Joystick_17get_numballs(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("get_numballs (wrapper)", 0); __pyx_r = __pyx_pf_11pygame_sdl2_8joystick_8Joystick_16get_numballs(((struct __pyx_obj_11pygame_sdl2_8joystick_Joystick *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_8joystick_8Joystick_16get_numballs(struct __pyx_obj_11pygame_sdl2_8joystick_Joystick *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("get_numballs", 0); /* "pygame_sdl2/joystick.pyx":97 * * def get_numballs(self): * if self.joystick == NULL: # <<<<<<<<<<<<<< * raise error("joystick not initialized") * */ __pyx_t_1 = ((__pyx_v_self->joystick == NULL) != 0); if (__pyx_t_1) { /* "pygame_sdl2/joystick.pyx":98 * def get_numballs(self): * if self.joystick == NULL: * raise error("joystick not initialized") # <<<<<<<<<<<<<< * * return SDL_JoystickNumBalls(self.joystick) */ __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_error); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 98; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_tuple__4, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 98; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_Raise(__pyx_t_3, 0, 0, 0); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; {__pyx_filename = __pyx_f[0]; __pyx_lineno = 98; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "pygame_sdl2/joystick.pyx":97 * * def get_numballs(self): * if self.joystick == NULL: # <<<<<<<<<<<<<< * raise error("joystick not initialized") * */ } /* "pygame_sdl2/joystick.pyx":100 * raise error("joystick not initialized") * * return SDL_JoystickNumBalls(self.joystick) # <<<<<<<<<<<<<< * * def get_numbuttons(self): */ __Pyx_XDECREF(__pyx_r); __pyx_t_3 = __Pyx_PyInt_From_int(SDL_JoystickNumBalls(__pyx_v_self->joystick)); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 100; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __pyx_r = __pyx_t_3; __pyx_t_3 = 0; goto __pyx_L0; /* "pygame_sdl2/joystick.pyx":96 * return SDL_JoystickNumAxes(self.joystick) * * def get_numballs(self): # <<<<<<<<<<<<<< * if self.joystick == NULL: * raise error("joystick not initialized") */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("pygame_sdl2.joystick.Joystick.get_numballs", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/joystick.pyx":102 * return SDL_JoystickNumBalls(self.joystick) * * def get_numbuttons(self): # <<<<<<<<<<<<<< * if self.joystick == NULL: * raise error("joystick not initialized") */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_8joystick_8Joystick_19get_numbuttons(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/ static PyObject *__pyx_pw_11pygame_sdl2_8joystick_8Joystick_19get_numbuttons(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("get_numbuttons (wrapper)", 0); __pyx_r = __pyx_pf_11pygame_sdl2_8joystick_8Joystick_18get_numbuttons(((struct __pyx_obj_11pygame_sdl2_8joystick_Joystick *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_8joystick_8Joystick_18get_numbuttons(struct __pyx_obj_11pygame_sdl2_8joystick_Joystick *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("get_numbuttons", 0); /* "pygame_sdl2/joystick.pyx":103 * * def get_numbuttons(self): * if self.joystick == NULL: # <<<<<<<<<<<<<< * raise error("joystick not initialized") * */ __pyx_t_1 = ((__pyx_v_self->joystick == NULL) != 0); if (__pyx_t_1) { /* "pygame_sdl2/joystick.pyx":104 * def get_numbuttons(self): * if self.joystick == NULL: * raise error("joystick not initialized") # <<<<<<<<<<<<<< * * return SDL_JoystickNumButtons(self.joystick) */ __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_error); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 104; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_tuple__5, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 104; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_Raise(__pyx_t_3, 0, 0, 0); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; {__pyx_filename = __pyx_f[0]; __pyx_lineno = 104; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "pygame_sdl2/joystick.pyx":103 * * def get_numbuttons(self): * if self.joystick == NULL: # <<<<<<<<<<<<<< * raise error("joystick not initialized") * */ } /* "pygame_sdl2/joystick.pyx":106 * raise error("joystick not initialized") * * return SDL_JoystickNumButtons(self.joystick) # <<<<<<<<<<<<<< * * def get_numhats(self): */ __Pyx_XDECREF(__pyx_r); __pyx_t_3 = __Pyx_PyInt_From_int(SDL_JoystickNumButtons(__pyx_v_self->joystick)); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 106; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __pyx_r = __pyx_t_3; __pyx_t_3 = 0; goto __pyx_L0; /* "pygame_sdl2/joystick.pyx":102 * return SDL_JoystickNumBalls(self.joystick) * * def get_numbuttons(self): # <<<<<<<<<<<<<< * if self.joystick == NULL: * raise error("joystick not initialized") */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("pygame_sdl2.joystick.Joystick.get_numbuttons", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/joystick.pyx":108 * return SDL_JoystickNumButtons(self.joystick) * * def get_numhats(self): # <<<<<<<<<<<<<< * if self.joystick == NULL: * raise error("joystick not initialized") */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_8joystick_8Joystick_21get_numhats(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/ static PyObject *__pyx_pw_11pygame_sdl2_8joystick_8Joystick_21get_numhats(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("get_numhats (wrapper)", 0); __pyx_r = __pyx_pf_11pygame_sdl2_8joystick_8Joystick_20get_numhats(((struct __pyx_obj_11pygame_sdl2_8joystick_Joystick *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_8joystick_8Joystick_20get_numhats(struct __pyx_obj_11pygame_sdl2_8joystick_Joystick *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("get_numhats", 0); /* "pygame_sdl2/joystick.pyx":109 * * def get_numhats(self): * if self.joystick == NULL: # <<<<<<<<<<<<<< * raise error("joystick not initialized") * */ __pyx_t_1 = ((__pyx_v_self->joystick == NULL) != 0); if (__pyx_t_1) { /* "pygame_sdl2/joystick.pyx":110 * def get_numhats(self): * if self.joystick == NULL: * raise error("joystick not initialized") # <<<<<<<<<<<<<< * * return SDL_JoystickNumHats(self.joystick) */ __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_error); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 110; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_tuple__6, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 110; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_Raise(__pyx_t_3, 0, 0, 0); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; {__pyx_filename = __pyx_f[0]; __pyx_lineno = 110; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "pygame_sdl2/joystick.pyx":109 * * def get_numhats(self): * if self.joystick == NULL: # <<<<<<<<<<<<<< * raise error("joystick not initialized") * */ } /* "pygame_sdl2/joystick.pyx":112 * raise error("joystick not initialized") * * return SDL_JoystickNumHats(self.joystick) # <<<<<<<<<<<<<< * * def get_axis(self, axis_number): */ __Pyx_XDECREF(__pyx_r); __pyx_t_3 = __Pyx_PyInt_From_int(SDL_JoystickNumHats(__pyx_v_self->joystick)); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 112; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __pyx_r = __pyx_t_3; __pyx_t_3 = 0; goto __pyx_L0; /* "pygame_sdl2/joystick.pyx":108 * return SDL_JoystickNumButtons(self.joystick) * * def get_numhats(self): # <<<<<<<<<<<<<< * if self.joystick == NULL: * raise error("joystick not initialized") */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("pygame_sdl2.joystick.Joystick.get_numhats", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/joystick.pyx":114 * return SDL_JoystickNumHats(self.joystick) * * def get_axis(self, axis_number): # <<<<<<<<<<<<<< * if self.joystick == NULL: * raise error("joystick not initialized") */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_8joystick_8Joystick_23get_axis(PyObject *__pyx_v_self, PyObject *__pyx_v_axis_number); /*proto*/ static PyObject *__pyx_pw_11pygame_sdl2_8joystick_8Joystick_23get_axis(PyObject *__pyx_v_self, PyObject *__pyx_v_axis_number) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("get_axis (wrapper)", 0); __pyx_r = __pyx_pf_11pygame_sdl2_8joystick_8Joystick_22get_axis(((struct __pyx_obj_11pygame_sdl2_8joystick_Joystick *)__pyx_v_self), ((PyObject *)__pyx_v_axis_number)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_8joystick_8Joystick_22get_axis(struct __pyx_obj_11pygame_sdl2_8joystick_Joystick *__pyx_v_self, PyObject *__pyx_v_axis_number) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; int __pyx_t_4; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("get_axis", 0); /* "pygame_sdl2/joystick.pyx":115 * * def get_axis(self, axis_number): * if self.joystick == NULL: # <<<<<<<<<<<<<< * raise error("joystick not initialized") * */ __pyx_t_1 = ((__pyx_v_self->joystick == NULL) != 0); if (__pyx_t_1) { /* "pygame_sdl2/joystick.pyx":116 * def get_axis(self, axis_number): * if self.joystick == NULL: * raise error("joystick not initialized") # <<<<<<<<<<<<<< * * return SDL_JoystickGetAxis(self.joystick, axis_number) / 32768.0 */ __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_error); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 116; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_tuple__7, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 116; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_Raise(__pyx_t_3, 0, 0, 0); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; {__pyx_filename = __pyx_f[0]; __pyx_lineno = 116; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "pygame_sdl2/joystick.pyx":115 * * def get_axis(self, axis_number): * if self.joystick == NULL: # <<<<<<<<<<<<<< * raise error("joystick not initialized") * */ } /* "pygame_sdl2/joystick.pyx":118 * raise error("joystick not initialized") * * return SDL_JoystickGetAxis(self.joystick, axis_number) / 32768.0 # <<<<<<<<<<<<<< * * def get_ball(self, ball_number): */ __Pyx_XDECREF(__pyx_r); __pyx_t_4 = __Pyx_PyInt_As_int(__pyx_v_axis_number); if (unlikely((__pyx_t_4 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 118; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_t_3 = PyFloat_FromDouble((((double)SDL_JoystickGetAxis(__pyx_v_self->joystick, __pyx_t_4)) / 32768.0)); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 118; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __pyx_r = __pyx_t_3; __pyx_t_3 = 0; goto __pyx_L0; /* "pygame_sdl2/joystick.pyx":114 * return SDL_JoystickNumHats(self.joystick) * * def get_axis(self, axis_number): # <<<<<<<<<<<<<< * if self.joystick == NULL: * raise error("joystick not initialized") */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("pygame_sdl2.joystick.Joystick.get_axis", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/joystick.pyx":120 * return SDL_JoystickGetAxis(self.joystick, axis_number) / 32768.0 * * def get_ball(self, ball_number): # <<<<<<<<<<<<<< * cdef int dx, dy * */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_8joystick_8Joystick_25get_ball(PyObject *__pyx_v_self, PyObject *__pyx_v_ball_number); /*proto*/ static PyObject *__pyx_pw_11pygame_sdl2_8joystick_8Joystick_25get_ball(PyObject *__pyx_v_self, PyObject *__pyx_v_ball_number) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("get_ball (wrapper)", 0); __pyx_r = __pyx_pf_11pygame_sdl2_8joystick_8Joystick_24get_ball(((struct __pyx_obj_11pygame_sdl2_8joystick_Joystick *)__pyx_v_self), ((PyObject *)__pyx_v_ball_number)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_8joystick_8Joystick_24get_ball(struct __pyx_obj_11pygame_sdl2_8joystick_Joystick *__pyx_v_self, PyObject *__pyx_v_ball_number) { int __pyx_v_dx; int __pyx_v_dy; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; int __pyx_t_4; PyObject *__pyx_t_5 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("get_ball", 0); /* "pygame_sdl2/joystick.pyx":123 * cdef int dx, dy * * if self.joystick == NULL: # <<<<<<<<<<<<<< * raise error("joystick not initialized") * */ __pyx_t_1 = ((__pyx_v_self->joystick == NULL) != 0); if (__pyx_t_1) { /* "pygame_sdl2/joystick.pyx":124 * * if self.joystick == NULL: * raise error("joystick not initialized") # <<<<<<<<<<<<<< * * if SDL_JoystickGetBall(self.joystick, ball_number, &dx, &dy) == 0: */ __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_error); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 124; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_tuple__8, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 124; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_Raise(__pyx_t_3, 0, 0, 0); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; {__pyx_filename = __pyx_f[0]; __pyx_lineno = 124; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "pygame_sdl2/joystick.pyx":123 * cdef int dx, dy * * if self.joystick == NULL: # <<<<<<<<<<<<<< * raise error("joystick not initialized") * */ } /* "pygame_sdl2/joystick.pyx":126 * raise error("joystick not initialized") * * if SDL_JoystickGetBall(self.joystick, ball_number, &dx, &dy) == 0: # <<<<<<<<<<<<<< * return (dx, dy) * else: */ __pyx_t_4 = __Pyx_PyInt_As_int(__pyx_v_ball_number); if (unlikely((__pyx_t_4 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 126; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_t_1 = ((SDL_JoystickGetBall(__pyx_v_self->joystick, __pyx_t_4, (&__pyx_v_dx), (&__pyx_v_dy)) == 0) != 0); if (__pyx_t_1) { /* "pygame_sdl2/joystick.pyx":127 * * if SDL_JoystickGetBall(self.joystick, ball_number, &dx, &dy) == 0: * return (dx, dy) # <<<<<<<<<<<<<< * else: * raise error() */ __Pyx_XDECREF(__pyx_r); __pyx_t_3 = __Pyx_PyInt_From_int(__pyx_v_dx); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 127; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_v_dy); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 127; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __pyx_t_5 = PyTuple_New(2); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 127; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_3); __Pyx_GIVEREF(__pyx_t_2); PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_t_2); __pyx_t_3 = 0; __pyx_t_2 = 0; __pyx_r = __pyx_t_5; __pyx_t_5 = 0; goto __pyx_L0; /* "pygame_sdl2/joystick.pyx":126 * raise error("joystick not initialized") * * if SDL_JoystickGetBall(self.joystick, ball_number, &dx, &dy) == 0: # <<<<<<<<<<<<<< * return (dx, dy) * else: */ } /* "pygame_sdl2/joystick.pyx":129 * return (dx, dy) * else: * raise error() # <<<<<<<<<<<<<< * * def get_button(self, button): */ /*else*/ { __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_error); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 129; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = NULL; if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_2))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); if (likely(__pyx_t_3)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); } } if (__pyx_t_3) { __pyx_t_5 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 129; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } else { __pyx_t_5 = __Pyx_PyObject_CallNoArg(__pyx_t_2); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 129; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_Raise(__pyx_t_5, 0, 0, 0); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; {__pyx_filename = __pyx_f[0]; __pyx_lineno = 129; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } /* "pygame_sdl2/joystick.pyx":120 * return SDL_JoystickGetAxis(self.joystick, axis_number) / 32768.0 * * def get_ball(self, ball_number): # <<<<<<<<<<<<<< * cdef int dx, dy * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_5); __Pyx_AddTraceback("pygame_sdl2.joystick.Joystick.get_ball", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/joystick.pyx":131 * raise error() * * def get_button(self, button): # <<<<<<<<<<<<<< * if self.joystick == NULL: * raise error("joystick not initialized") */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_8joystick_8Joystick_27get_button(PyObject *__pyx_v_self, PyObject *__pyx_v_button); /*proto*/ static PyObject *__pyx_pw_11pygame_sdl2_8joystick_8Joystick_27get_button(PyObject *__pyx_v_self, PyObject *__pyx_v_button) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("get_button (wrapper)", 0); __pyx_r = __pyx_pf_11pygame_sdl2_8joystick_8Joystick_26get_button(((struct __pyx_obj_11pygame_sdl2_8joystick_Joystick *)__pyx_v_self), ((PyObject *)__pyx_v_button)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_8joystick_8Joystick_26get_button(struct __pyx_obj_11pygame_sdl2_8joystick_Joystick *__pyx_v_self, PyObject *__pyx_v_button) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; int __pyx_t_4; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("get_button", 0); /* "pygame_sdl2/joystick.pyx":132 * * def get_button(self, button): * if self.joystick == NULL: # <<<<<<<<<<<<<< * raise error("joystick not initialized") * */ __pyx_t_1 = ((__pyx_v_self->joystick == NULL) != 0); if (__pyx_t_1) { /* "pygame_sdl2/joystick.pyx":133 * def get_button(self, button): * if self.joystick == NULL: * raise error("joystick not initialized") # <<<<<<<<<<<<<< * * return SDL_JoystickGetButton(self.joystick, button) == 1 */ __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_error); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 133; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_tuple__9, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 133; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_Raise(__pyx_t_3, 0, 0, 0); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; {__pyx_filename = __pyx_f[0]; __pyx_lineno = 133; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "pygame_sdl2/joystick.pyx":132 * * def get_button(self, button): * if self.joystick == NULL: # <<<<<<<<<<<<<< * raise error("joystick not initialized") * */ } /* "pygame_sdl2/joystick.pyx":135 * raise error("joystick not initialized") * * return SDL_JoystickGetButton(self.joystick, button) == 1 # <<<<<<<<<<<<<< * * def get_hat(self, hat_number): */ __Pyx_XDECREF(__pyx_r); __pyx_t_4 = __Pyx_PyInt_As_int(__pyx_v_button); if (unlikely((__pyx_t_4 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 135; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_t_3 = __Pyx_PyBool_FromLong((SDL_JoystickGetButton(__pyx_v_self->joystick, __pyx_t_4) == 1)); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 135; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __pyx_r = __pyx_t_3; __pyx_t_3 = 0; goto __pyx_L0; /* "pygame_sdl2/joystick.pyx":131 * raise error() * * def get_button(self, button): # <<<<<<<<<<<<<< * if self.joystick == NULL: * raise error("joystick not initialized") */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("pygame_sdl2.joystick.Joystick.get_button", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/joystick.pyx":137 * return SDL_JoystickGetButton(self.joystick, button) == 1 * * def get_hat(self, hat_number): # <<<<<<<<<<<<<< * if self.joystick == NULL: * raise error("joystick not initialized") */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_8joystick_8Joystick_29get_hat(PyObject *__pyx_v_self, PyObject *__pyx_v_hat_number); /*proto*/ static PyObject *__pyx_pw_11pygame_sdl2_8joystick_8Joystick_29get_hat(PyObject *__pyx_v_self, PyObject *__pyx_v_hat_number) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("get_hat (wrapper)", 0); __pyx_r = __pyx_pf_11pygame_sdl2_8joystick_8Joystick_28get_hat(((struct __pyx_obj_11pygame_sdl2_8joystick_Joystick *)__pyx_v_self), ((PyObject *)__pyx_v_hat_number)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_8joystick_8Joystick_28get_hat(struct __pyx_obj_11pygame_sdl2_8joystick_Joystick *__pyx_v_self, PyObject *__pyx_v_hat_number) { Uint8 __pyx_v_state; long __pyx_v_hx; long __pyx_v_hy; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; int __pyx_t_4; PyObject *__pyx_t_5 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("get_hat", 0); /* "pygame_sdl2/joystick.pyx":138 * * def get_hat(self, hat_number): * if self.joystick == NULL: # <<<<<<<<<<<<<< * raise error("joystick not initialized") * */ __pyx_t_1 = ((__pyx_v_self->joystick == NULL) != 0); if (__pyx_t_1) { /* "pygame_sdl2/joystick.pyx":139 * def get_hat(self, hat_number): * if self.joystick == NULL: * raise error("joystick not initialized") # <<<<<<<<<<<<<< * * state = SDL_JoystickGetHat(self.joystick, hat_number) */ __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_error); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 139; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_tuple__10, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 139; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_Raise(__pyx_t_3, 0, 0, 0); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; {__pyx_filename = __pyx_f[0]; __pyx_lineno = 139; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "pygame_sdl2/joystick.pyx":138 * * def get_hat(self, hat_number): * if self.joystick == NULL: # <<<<<<<<<<<<<< * raise error("joystick not initialized") * */ } /* "pygame_sdl2/joystick.pyx":141 * raise error("joystick not initialized") * * state = SDL_JoystickGetHat(self.joystick, hat_number) # <<<<<<<<<<<<<< * hx = hy = 0 * if state & SDL_HAT_LEFT: */ __pyx_t_4 = __Pyx_PyInt_As_int(__pyx_v_hat_number); if (unlikely((__pyx_t_4 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 141; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_v_state = SDL_JoystickGetHat(__pyx_v_self->joystick, __pyx_t_4); /* "pygame_sdl2/joystick.pyx":142 * * state = SDL_JoystickGetHat(self.joystick, hat_number) * hx = hy = 0 # <<<<<<<<<<<<<< * if state & SDL_HAT_LEFT: * hx = -1 */ __pyx_v_hx = 0; __pyx_v_hy = 0; /* "pygame_sdl2/joystick.pyx":143 * state = SDL_JoystickGetHat(self.joystick, hat_number) * hx = hy = 0 * if state & SDL_HAT_LEFT: # <<<<<<<<<<<<<< * hx = -1 * elif state & SDL_HAT_RIGHT: */ __pyx_t_1 = ((__pyx_v_state & SDL_HAT_LEFT) != 0); if (__pyx_t_1) { /* "pygame_sdl2/joystick.pyx":144 * hx = hy = 0 * if state & SDL_HAT_LEFT: * hx = -1 # <<<<<<<<<<<<<< * elif state & SDL_HAT_RIGHT: * hx = 1 */ __pyx_v_hx = -1L; /* "pygame_sdl2/joystick.pyx":143 * state = SDL_JoystickGetHat(self.joystick, hat_number) * hx = hy = 0 * if state & SDL_HAT_LEFT: # <<<<<<<<<<<<<< * hx = -1 * elif state & SDL_HAT_RIGHT: */ goto __pyx_L4; } /* "pygame_sdl2/joystick.pyx":145 * if state & SDL_HAT_LEFT: * hx = -1 * elif state & SDL_HAT_RIGHT: # <<<<<<<<<<<<<< * hx = 1 * */ __pyx_t_1 = ((__pyx_v_state & SDL_HAT_RIGHT) != 0); if (__pyx_t_1) { /* "pygame_sdl2/joystick.pyx":146 * hx = -1 * elif state & SDL_HAT_RIGHT: * hx = 1 # <<<<<<<<<<<<<< * * if state & SDL_HAT_UP: */ __pyx_v_hx = 1; /* "pygame_sdl2/joystick.pyx":145 * if state & SDL_HAT_LEFT: * hx = -1 * elif state & SDL_HAT_RIGHT: # <<<<<<<<<<<<<< * hx = 1 * */ } __pyx_L4:; /* "pygame_sdl2/joystick.pyx":148 * hx = 1 * * if state & SDL_HAT_UP: # <<<<<<<<<<<<<< * hy = 1 * elif state & SDL_HAT_DOWN: */ __pyx_t_1 = ((__pyx_v_state & SDL_HAT_UP) != 0); if (__pyx_t_1) { /* "pygame_sdl2/joystick.pyx":149 * * if state & SDL_HAT_UP: * hy = 1 # <<<<<<<<<<<<<< * elif state & SDL_HAT_DOWN: * hy = -1 */ __pyx_v_hy = 1; /* "pygame_sdl2/joystick.pyx":148 * hx = 1 * * if state & SDL_HAT_UP: # <<<<<<<<<<<<<< * hy = 1 * elif state & SDL_HAT_DOWN: */ goto __pyx_L5; } /* "pygame_sdl2/joystick.pyx":150 * if state & SDL_HAT_UP: * hy = 1 * elif state & SDL_HAT_DOWN: # <<<<<<<<<<<<<< * hy = -1 * */ __pyx_t_1 = ((__pyx_v_state & SDL_HAT_DOWN) != 0); if (__pyx_t_1) { /* "pygame_sdl2/joystick.pyx":151 * hy = 1 * elif state & SDL_HAT_DOWN: * hy = -1 # <<<<<<<<<<<<<< * * return (hx, hy) */ __pyx_v_hy = -1L; /* "pygame_sdl2/joystick.pyx":150 * if state & SDL_HAT_UP: * hy = 1 * elif state & SDL_HAT_DOWN: # <<<<<<<<<<<<<< * hy = -1 * */ } __pyx_L5:; /* "pygame_sdl2/joystick.pyx":153 * hy = -1 * * return (hx, hy) # <<<<<<<<<<<<<< */ __Pyx_XDECREF(__pyx_r); __pyx_t_3 = __Pyx_PyInt_From_long(__pyx_v_hx); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 153; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __pyx_t_2 = __Pyx_PyInt_From_long(__pyx_v_hy); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 153; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __pyx_t_5 = PyTuple_New(2); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 153; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_3); __Pyx_GIVEREF(__pyx_t_2); PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_t_2); __pyx_t_3 = 0; __pyx_t_2 = 0; __pyx_r = __pyx_t_5; __pyx_t_5 = 0; goto __pyx_L0; /* "pygame_sdl2/joystick.pyx":137 * return SDL_JoystickGetButton(self.joystick, button) == 1 * * def get_hat(self, hat_number): # <<<<<<<<<<<<<< * if self.joystick == NULL: * raise error("joystick not initialized") */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_5); __Pyx_AddTraceback("pygame_sdl2.joystick.Joystick.get_hat", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_tp_new_11pygame_sdl2_8joystick_Joystick(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) { PyObject *o; if (likely((t->tp_flags & Py_TPFLAGS_IS_ABSTRACT) == 0)) { o = (*t->tp_alloc)(t, 0); } else { o = (PyObject *) PyBaseObject_Type.tp_new(t, __pyx_empty_tuple, 0); } if (unlikely(!o)) return 0; if (unlikely(__pyx_pw_11pygame_sdl2_8joystick_8Joystick_1__cinit__(o, __pyx_empty_tuple, NULL) < 0)) { Py_DECREF(o); o = 0; } return o; } static void __pyx_tp_dealloc_11pygame_sdl2_8joystick_Joystick(PyObject *o) { struct __pyx_obj_11pygame_sdl2_8joystick_Joystick *p = (struct __pyx_obj_11pygame_sdl2_8joystick_Joystick *)o; #if PY_VERSION_HEX >= 0x030400a1 if (unlikely(Py_TYPE(o)->tp_finalize) && (!PyType_IS_GC(Py_TYPE(o)) || !_PyGC_FINALIZED(o))) { if (PyObject_CallFinalizerFromDealloc(o)) return; } #endif if (p->__weakref__) PyObject_ClearWeakRefs(o); (*Py_TYPE(o)->tp_free)(o); } static PyMethodDef __pyx_methods_11pygame_sdl2_8joystick_Joystick[] = { {"init", (PyCFunction)__pyx_pw_11pygame_sdl2_8joystick_8Joystick_5init, METH_NOARGS, 0}, {"quit", (PyCFunction)__pyx_pw_11pygame_sdl2_8joystick_8Joystick_7quit, METH_NOARGS, 0}, {"get_init", (PyCFunction)__pyx_pw_11pygame_sdl2_8joystick_8Joystick_9get_init, METH_NOARGS, 0}, {"get_id", (PyCFunction)__pyx_pw_11pygame_sdl2_8joystick_8Joystick_11get_id, METH_NOARGS, 0}, {"get_name", (PyCFunction)__pyx_pw_11pygame_sdl2_8joystick_8Joystick_13get_name, METH_NOARGS, 0}, {"get_numaxes", (PyCFunction)__pyx_pw_11pygame_sdl2_8joystick_8Joystick_15get_numaxes, METH_NOARGS, 0}, {"get_numballs", (PyCFunction)__pyx_pw_11pygame_sdl2_8joystick_8Joystick_17get_numballs, METH_NOARGS, 0}, {"get_numbuttons", (PyCFunction)__pyx_pw_11pygame_sdl2_8joystick_8Joystick_19get_numbuttons, METH_NOARGS, 0}, {"get_numhats", (PyCFunction)__pyx_pw_11pygame_sdl2_8joystick_8Joystick_21get_numhats, METH_NOARGS, 0}, {"get_axis", (PyCFunction)__pyx_pw_11pygame_sdl2_8joystick_8Joystick_23get_axis, METH_O, 0}, {"get_ball", (PyCFunction)__pyx_pw_11pygame_sdl2_8joystick_8Joystick_25get_ball, METH_O, 0}, {"get_button", (PyCFunction)__pyx_pw_11pygame_sdl2_8joystick_8Joystick_27get_button, METH_O, 0}, {"get_hat", (PyCFunction)__pyx_pw_11pygame_sdl2_8joystick_8Joystick_29get_hat, METH_O, 0}, {0, 0, 0, 0} }; static PyTypeObject __pyx_type_11pygame_sdl2_8joystick_Joystick = { PyVarObject_HEAD_INIT(0, 0) "pygame_sdl2.joystick.Joystick", /*tp_name*/ sizeof(struct __pyx_obj_11pygame_sdl2_8joystick_Joystick), /*tp_basicsize*/ 0, /*tp_itemsize*/ __pyx_tp_dealloc_11pygame_sdl2_8joystick_Joystick, /*tp_dealloc*/ 0, /*tp_print*/ 0, /*tp_getattr*/ 0, /*tp_setattr*/ #if PY_MAJOR_VERSION < 3 0, /*tp_compare*/ #endif #if PY_MAJOR_VERSION >= 3 0, /*tp_as_async*/ #endif 0, /*tp_repr*/ 0, /*tp_as_number*/ 0, /*tp_as_sequence*/ 0, /*tp_as_mapping*/ 0, /*tp_hash*/ 0, /*tp_call*/ 0, /*tp_str*/ 0, /*tp_getattro*/ 0, /*tp_setattro*/ 0, /*tp_as_buffer*/ Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE, /*tp_flags*/ 0, /*tp_doc*/ 0, /*tp_traverse*/ 0, /*tp_clear*/ 0, /*tp_richcompare*/ 0, /*tp_weaklistoffset*/ 0, /*tp_iter*/ 0, /*tp_iternext*/ __pyx_methods_11pygame_sdl2_8joystick_Joystick, /*tp_methods*/ 0, /*tp_members*/ 0, /*tp_getset*/ 0, /*tp_base*/ 0, /*tp_dict*/ 0, /*tp_descr_get*/ 0, /*tp_descr_set*/ 0, /*tp_dictoffset*/ __pyx_pw_11pygame_sdl2_8joystick_8Joystick_3__init__, /*tp_init*/ 0, /*tp_alloc*/ __pyx_tp_new_11pygame_sdl2_8joystick_Joystick, /*tp_new*/ 0, /*tp_free*/ 0, /*tp_is_gc*/ 0, /*tp_bases*/ 0, /*tp_mro*/ 0, /*tp_cache*/ 0, /*tp_subclasses*/ 0, /*tp_weaklist*/ 0, /*tp_del*/ 0, /*tp_version_tag*/ #if PY_VERSION_HEX >= 0x030400a1 0, /*tp_finalize*/ #endif }; static PyMethodDef __pyx_methods[] = { {0, 0, 0, 0} }; #if PY_MAJOR_VERSION >= 3 static struct PyModuleDef __pyx_moduledef = { #if PY_VERSION_HEX < 0x03020000 { PyObject_HEAD_INIT(NULL) NULL, 0, NULL }, #else PyModuleDef_HEAD_INIT, #endif "joystick", 0, /* m_doc */ -1, /* m_size */ __pyx_methods /* m_methods */, NULL, /* m_reload */ NULL, /* m_traverse */ NULL, /* m_clear */ NULL /* m_free */ }; #endif static __Pyx_StringTabEntry __pyx_string_tab[] = { {&__pyx_n_s_display, __pyx_k_display, sizeof(__pyx_k_display), 0, 0, 1, 1}, {&__pyx_n_s_error, __pyx_k_error, sizeof(__pyx_k_error), 0, 0, 1, 1}, {&__pyx_n_s_get_count, __pyx_k_get_count, sizeof(__pyx_k_get_count), 0, 0, 1, 1}, {&__pyx_n_s_get_init, __pyx_k_get_init, sizeof(__pyx_k_get_init), 0, 0, 1, 1}, {&__pyx_kp_s_home_tom_ab_pygame_sdl2_src_pyg, __pyx_k_home_tom_ab_pygame_sdl2_src_pyg, sizeof(__pyx_k_home_tom_ab_pygame_sdl2_src_pyg), 0, 0, 1, 0}, {&__pyx_n_s_id, __pyx_k_id, sizeof(__pyx_k_id), 0, 0, 1, 1}, {&__pyx_n_s_import, __pyx_k_import, sizeof(__pyx_k_import), 0, 0, 1, 1}, {&__pyx_n_s_init, __pyx_k_init, sizeof(__pyx_k_init), 0, 0, 1, 1}, {&__pyx_kp_u_joystick_not_initialized, __pyx_k_joystick_not_initialized, sizeof(__pyx_k_joystick_not_initialized), 0, 1, 0, 0}, {&__pyx_n_s_main, __pyx_k_main, sizeof(__pyx_k_main), 0, 0, 1, 1}, {&__pyx_n_s_pygame_sdl2, __pyx_k_pygame_sdl2, sizeof(__pyx_k_pygame_sdl2), 0, 0, 1, 1}, {&__pyx_n_s_pygame_sdl2_error, __pyx_k_pygame_sdl2_error, sizeof(__pyx_k_pygame_sdl2_error), 0, 0, 1, 1}, {&__pyx_n_s_pygame_sdl2_joystick, __pyx_k_pygame_sdl2_joystick, sizeof(__pyx_k_pygame_sdl2_joystick), 0, 0, 1, 1}, {&__pyx_n_s_quit, __pyx_k_quit, sizeof(__pyx_k_quit), 0, 0, 1, 1}, {&__pyx_n_s_register_init, __pyx_k_register_init, sizeof(__pyx_k_register_init), 0, 0, 1, 1}, {&__pyx_n_s_register_quit, __pyx_k_register_quit, sizeof(__pyx_k_register_quit), 0, 0, 1, 1}, {&__pyx_n_s_sdl_main_init, __pyx_k_sdl_main_init, sizeof(__pyx_k_sdl_main_init), 0, 0, 1, 1}, {&__pyx_n_s_test, __pyx_k_test, sizeof(__pyx_k_test), 0, 0, 1, 1}, {0, 0, 0, 0, 0, 0, 0} }; static int __Pyx_InitCachedBuiltins(void) { return 0; } static int __Pyx_InitCachedConstants(void) { __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__Pyx_InitCachedConstants", 0); /* "pygame_sdl2/joystick.pyx":73 * def get_id(self): * if self.joystick == NULL: * raise error("joystick not initialized") # <<<<<<<<<<<<<< * * return SDL_JoystickInstanceID(self.joystick) */ __pyx_tuple_ = PyTuple_Pack(1, __pyx_kp_u_joystick_not_initialized); if (unlikely(!__pyx_tuple_)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 73; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_tuple_); __Pyx_GIVEREF(__pyx_tuple_); /* "pygame_sdl2/joystick.pyx":81 * * if self.joystick == NULL: * raise error("joystick not initialized") # <<<<<<<<<<<<<< * * rv = SDL_JoystickName(self.joystick) */ __pyx_tuple__2 = PyTuple_Pack(1, __pyx_kp_u_joystick_not_initialized); if (unlikely(!__pyx_tuple__2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 81; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_tuple__2); __Pyx_GIVEREF(__pyx_tuple__2); /* "pygame_sdl2/joystick.pyx":92 * def get_numaxes(self): * if self.joystick == NULL: * raise error("joystick not initialized") # <<<<<<<<<<<<<< * * return SDL_JoystickNumAxes(self.joystick) */ __pyx_tuple__3 = PyTuple_Pack(1, __pyx_kp_u_joystick_not_initialized); if (unlikely(!__pyx_tuple__3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 92; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_tuple__3); __Pyx_GIVEREF(__pyx_tuple__3); /* "pygame_sdl2/joystick.pyx":98 * def get_numballs(self): * if self.joystick == NULL: * raise error("joystick not initialized") # <<<<<<<<<<<<<< * * return SDL_JoystickNumBalls(self.joystick) */ __pyx_tuple__4 = PyTuple_Pack(1, __pyx_kp_u_joystick_not_initialized); if (unlikely(!__pyx_tuple__4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 98; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_tuple__4); __Pyx_GIVEREF(__pyx_tuple__4); /* "pygame_sdl2/joystick.pyx":104 * def get_numbuttons(self): * if self.joystick == NULL: * raise error("joystick not initialized") # <<<<<<<<<<<<<< * * return SDL_JoystickNumButtons(self.joystick) */ __pyx_tuple__5 = PyTuple_Pack(1, __pyx_kp_u_joystick_not_initialized); if (unlikely(!__pyx_tuple__5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 104; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_tuple__5); __Pyx_GIVEREF(__pyx_tuple__5); /* "pygame_sdl2/joystick.pyx":110 * def get_numhats(self): * if self.joystick == NULL: * raise error("joystick not initialized") # <<<<<<<<<<<<<< * * return SDL_JoystickNumHats(self.joystick) */ __pyx_tuple__6 = PyTuple_Pack(1, __pyx_kp_u_joystick_not_initialized); if (unlikely(!__pyx_tuple__6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 110; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_tuple__6); __Pyx_GIVEREF(__pyx_tuple__6); /* "pygame_sdl2/joystick.pyx":116 * def get_axis(self, axis_number): * if self.joystick == NULL: * raise error("joystick not initialized") # <<<<<<<<<<<<<< * * return SDL_JoystickGetAxis(self.joystick, axis_number) / 32768.0 */ __pyx_tuple__7 = PyTuple_Pack(1, __pyx_kp_u_joystick_not_initialized); if (unlikely(!__pyx_tuple__7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 116; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_tuple__7); __Pyx_GIVEREF(__pyx_tuple__7); /* "pygame_sdl2/joystick.pyx":124 * * if self.joystick == NULL: * raise error("joystick not initialized") # <<<<<<<<<<<<<< * * if SDL_JoystickGetBall(self.joystick, ball_number, &dx, &dy) == 0: */ __pyx_tuple__8 = PyTuple_Pack(1, __pyx_kp_u_joystick_not_initialized); if (unlikely(!__pyx_tuple__8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 124; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_tuple__8); __Pyx_GIVEREF(__pyx_tuple__8); /* "pygame_sdl2/joystick.pyx":133 * def get_button(self, button): * if self.joystick == NULL: * raise error("joystick not initialized") # <<<<<<<<<<<<<< * * return SDL_JoystickGetButton(self.joystick, button) == 1 */ __pyx_tuple__9 = PyTuple_Pack(1, __pyx_kp_u_joystick_not_initialized); if (unlikely(!__pyx_tuple__9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 133; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_tuple__9); __Pyx_GIVEREF(__pyx_tuple__9); /* "pygame_sdl2/joystick.pyx":139 * def get_hat(self, hat_number): * if self.joystick == NULL: * raise error("joystick not initialized") # <<<<<<<<<<<<<< * * state = SDL_JoystickGetHat(self.joystick, hat_number) */ __pyx_tuple__10 = PyTuple_Pack(1, __pyx_kp_u_joystick_not_initialized); if (unlikely(!__pyx_tuple__10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 139; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_tuple__10); __Pyx_GIVEREF(__pyx_tuple__10); /* "pygame_sdl2/joystick.pyx":24 * * @pygame_sdl2.register_init * def init(): # <<<<<<<<<<<<<< * pygame_sdl2.display.sdl_main_init() * */ __pyx_codeobj__11 = (PyObject*)__Pyx_PyCode_New(0, 0, 0, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_tom_ab_pygame_sdl2_src_pyg, __pyx_n_s_init, 24, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 24; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "pygame_sdl2/joystick.pyx":31 * * @pygame_sdl2.register_quit * def quit(): # @ReservedAssignment # <<<<<<<<<<<<<< * SDL_QuitSubSystem(SDL_INIT_JOYSTICK) * */ __pyx_codeobj__12 = (PyObject*)__Pyx_PyCode_New(0, 0, 0, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_tom_ab_pygame_sdl2_src_pyg, __pyx_n_s_quit, 31, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__12)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 31; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "pygame_sdl2/joystick.pyx":34 * SDL_QuitSubSystem(SDL_INIT_JOYSTICK) * * def get_init(): # <<<<<<<<<<<<<< * return SDL_WasInit(SDL_INIT_JOYSTICK) != 0 * */ __pyx_codeobj__13 = (PyObject*)__Pyx_PyCode_New(0, 0, 0, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_tom_ab_pygame_sdl2_src_pyg, __pyx_n_s_get_init, 34, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__13)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 34; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "pygame_sdl2/joystick.pyx":37 * return SDL_WasInit(SDL_INIT_JOYSTICK) != 0 * * def get_count(): # <<<<<<<<<<<<<< * return SDL_NumJoysticks() * */ __pyx_codeobj__14 = (PyObject*)__Pyx_PyCode_New(0, 0, 0, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_tom_ab_pygame_sdl2_src_pyg, __pyx_n_s_get_count, 37, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__14)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 37; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_RefNannyFinishContext(); return 0; __pyx_L1_error:; __Pyx_RefNannyFinishContext(); return -1; } static int __Pyx_InitGlobals(void) { if (__Pyx_InitStrings(__pyx_string_tab) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; return 0; __pyx_L1_error:; return -1; } #if PY_MAJOR_VERSION < 3 PyMODINIT_FUNC initjoystick(void); /*proto*/ PyMODINIT_FUNC initjoystick(void) #else PyMODINIT_FUNC PyInit_joystick(void); /*proto*/ PyMODINIT_FUNC PyInit_joystick(void) #endif { PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; PyObject *__pyx_t_5 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannyDeclarations #if CYTHON_REFNANNY __Pyx_RefNanny = __Pyx_RefNannyImportAPI("refnanny"); if (!__Pyx_RefNanny) { PyErr_Clear(); __Pyx_RefNanny = __Pyx_RefNannyImportAPI("Cython.Runtime.refnanny"); if (!__Pyx_RefNanny) Py_FatalError("failed to import 'refnanny' module"); } #endif __Pyx_RefNannySetupContext("PyMODINIT_FUNC PyInit_joystick(void)", 0); if (__Pyx_check_binary_version() < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_empty_tuple = PyTuple_New(0); if (unlikely(!__pyx_empty_tuple)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_empty_bytes = PyBytes_FromStringAndSize("", 0); if (unlikely(!__pyx_empty_bytes)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} #ifdef __Pyx_CyFunction_USED if (__pyx_CyFunction_init() < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} #endif #ifdef __Pyx_FusedFunction_USED if (__pyx_FusedFunction_init() < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} #endif #ifdef __Pyx_Coroutine_USED if (__pyx_Coroutine_init() < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} #endif #ifdef __Pyx_Generator_USED if (__pyx_Generator_init() < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} #endif #ifdef __Pyx_StopAsyncIteration_USED if (__pyx_StopAsyncIteration_init() < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} #endif /*--- Library function declarations ---*/ /*--- Threads initialization code ---*/ #if defined(__PYX_FORCE_INIT_THREADS) && __PYX_FORCE_INIT_THREADS #ifdef WITH_THREAD /* Python build with threading support? */ PyEval_InitThreads(); #endif #endif /*--- Module creation code ---*/ #if PY_MAJOR_VERSION < 3 __pyx_m = Py_InitModule4("joystick", __pyx_methods, 0, 0, PYTHON_API_VERSION); Py_XINCREF(__pyx_m); #else __pyx_m = PyModule_Create(&__pyx_moduledef); #endif if (unlikely(!__pyx_m)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_d = PyModule_GetDict(__pyx_m); if (unlikely(!__pyx_d)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} Py_INCREF(__pyx_d); __pyx_b = PyImport_AddModule(__Pyx_BUILTIN_MODULE_NAME); if (unlikely(!__pyx_b)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} #if CYTHON_COMPILING_IN_PYPY Py_INCREF(__pyx_b); #endif if (PyObject_SetAttrString(__pyx_m, "__builtins__", __pyx_b) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; /*--- Initialize various global constants etc. ---*/ if (__Pyx_InitGlobals() < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} #if PY_MAJOR_VERSION < 3 && (__PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT) if (__Pyx_init_sys_getdefaultencoding_params() < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} #endif if (__pyx_module_is_main_pygame_sdl2__joystick) { if (PyObject_SetAttrString(__pyx_m, "__name__", __pyx_n_s_main) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } #if PY_MAJOR_VERSION >= 3 { PyObject *modules = PyImport_GetModuleDict(); if (unlikely(!modules)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} if (!PyDict_GetItemString(modules, "pygame_sdl2.joystick")) { if (unlikely(PyDict_SetItemString(modules, "pygame_sdl2.joystick", __pyx_m) < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } } #endif /*--- Builtin init code ---*/ if (__Pyx_InitCachedBuiltins() < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /*--- Constants init code ---*/ if (__Pyx_InitCachedConstants() < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /*--- Global init code ---*/ /*--- Variable export code ---*/ /*--- Function export code ---*/ /*--- Type init code ---*/ if (PyType_Ready(&__pyx_type_11pygame_sdl2_8joystick_Joystick) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 41; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_type_11pygame_sdl2_8joystick_Joystick.tp_print = 0; if (PyObject_SetAttrString(__pyx_m, "Joystick", (PyObject *)&__pyx_type_11pygame_sdl2_8joystick_Joystick) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 41; __pyx_clineno = __LINE__; goto __pyx_L1_error;} if (__pyx_type_11pygame_sdl2_8joystick_Joystick.tp_weaklistoffset == 0) __pyx_type_11pygame_sdl2_8joystick_Joystick.tp_weaklistoffset = offsetof(struct __pyx_obj_11pygame_sdl2_8joystick_Joystick, __weakref__); __pyx_ptype_11pygame_sdl2_8joystick_Joystick = &__pyx_type_11pygame_sdl2_8joystick_Joystick; /*--- Type import code ---*/ /*--- Variable import code ---*/ /*--- Function import code ---*/ /*--- Execution code ---*/ #if defined(__Pyx_Generator_USED) || defined(__Pyx_Coroutine_USED) if (__Pyx_patch_abc() < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} #endif /* "pygame_sdl2/joystick.pyx":20 * * from sdl2 cimport * * from pygame_sdl2.error import error # <<<<<<<<<<<<<< * import pygame_sdl2 * */ __pyx_t_1 = PyList_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 20; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __Pyx_INCREF(__pyx_n_s_error); __Pyx_GIVEREF(__pyx_n_s_error); PyList_SET_ITEM(__pyx_t_1, 0, __pyx_n_s_error); __pyx_t_2 = __Pyx_Import(__pyx_n_s_pygame_sdl2_error, __pyx_t_1, 0); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 20; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_1 = __Pyx_ImportFrom(__pyx_t_2, __pyx_n_s_error); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 20; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); if (PyDict_SetItem(__pyx_d, __pyx_n_s_error, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 20; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "pygame_sdl2/joystick.pyx":21 * from sdl2 cimport * * from pygame_sdl2.error import error * import pygame_sdl2 # <<<<<<<<<<<<<< * * @pygame_sdl2.register_init */ __pyx_t_2 = __Pyx_Import(__pyx_n_s_pygame_sdl2, 0, 0); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 21; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_pygame_sdl2, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 21; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "pygame_sdl2/joystick.pyx":23 * import pygame_sdl2 * * @pygame_sdl2.register_init # <<<<<<<<<<<<<< * def init(): * pygame_sdl2.display.sdl_main_init() */ __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_pygame_sdl2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 23; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_register_init); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 23; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "pygame_sdl2/joystick.pyx":24 * * @pygame_sdl2.register_init * def init(): # <<<<<<<<<<<<<< * pygame_sdl2.display.sdl_main_init() * */ __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_11pygame_sdl2_8joystick_1init, NULL, __pyx_n_s_pygame_sdl2_joystick); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 24; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_t_4 = NULL; if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_3))) { __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3); if (likely(__pyx_t_4)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); __Pyx_INCREF(__pyx_t_4); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_3, function); } } if (!__pyx_t_4) { __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 23; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_GOTREF(__pyx_t_2); } else { __pyx_t_5 = PyTuple_New(1+1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 23; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_4); __pyx_t_4 = NULL; __Pyx_GIVEREF(__pyx_t_1); PyTuple_SET_ITEM(__pyx_t_5, 0+1, __pyx_t_1); __pyx_t_1 = 0; __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_5, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 23; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; } __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; if (PyDict_SetItem(__pyx_d, __pyx_n_s_init, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 24; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "pygame_sdl2/joystick.pyx":30 * raise error() * * @pygame_sdl2.register_quit # <<<<<<<<<<<<<< * def quit(): # @ReservedAssignment * SDL_QuitSubSystem(SDL_INIT_JOYSTICK) */ __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_pygame_sdl2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 30; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_register_quit); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 30; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "pygame_sdl2/joystick.pyx":31 * * @pygame_sdl2.register_quit * def quit(): # @ReservedAssignment # <<<<<<<<<<<<<< * SDL_QuitSubSystem(SDL_INIT_JOYSTICK) * */ __pyx_t_3 = PyCFunction_NewEx(&__pyx_mdef_11pygame_sdl2_8joystick_3quit, NULL, __pyx_n_s_pygame_sdl2_joystick); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 31; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __pyx_t_1 = NULL; if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_5))) { __pyx_t_1 = PyMethod_GET_SELF(__pyx_t_5); if (likely(__pyx_t_1)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5); __Pyx_INCREF(__pyx_t_1); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_5, function); } } if (!__pyx_t_1) { __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_t_3); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 30; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_GOTREF(__pyx_t_2); } else { __pyx_t_4 = PyTuple_New(1+1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 30; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); __Pyx_GIVEREF(__pyx_t_1); PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_1); __pyx_t_1 = NULL; __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_4, 0+1, __pyx_t_3); __pyx_t_3 = 0; __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_4, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 30; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; } __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; if (PyDict_SetItem(__pyx_d, __pyx_n_s_quit, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 31; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "pygame_sdl2/joystick.pyx":34 * SDL_QuitSubSystem(SDL_INIT_JOYSTICK) * * def get_init(): # <<<<<<<<<<<<<< * return SDL_WasInit(SDL_INIT_JOYSTICK) != 0 * */ __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_11pygame_sdl2_8joystick_5get_init, NULL, __pyx_n_s_pygame_sdl2_joystick); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 34; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_get_init, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 34; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "pygame_sdl2/joystick.pyx":37 * return SDL_WasInit(SDL_INIT_JOYSTICK) != 0 * * def get_count(): # <<<<<<<<<<<<<< * return SDL_NumJoysticks() * */ __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_11pygame_sdl2_8joystick_7get_count, NULL, __pyx_n_s_pygame_sdl2_joystick); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 37; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_get_count, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 37; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "pygame_sdl2/joystick.pyx":1 * # Copyright 2014 Patrick Dawson # <<<<<<<<<<<<<< * # * # This software is provided 'as-is', without any express or implied */ __pyx_t_2 = PyDict_New(); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_test, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /*--- Wrapped vars code ---*/ goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_5); if (__pyx_m) { if (__pyx_d) { __Pyx_AddTraceback("init pygame_sdl2.joystick", __pyx_clineno, __pyx_lineno, __pyx_filename); } Py_DECREF(__pyx_m); __pyx_m = 0; } else if (!PyErr_Occurred()) { PyErr_SetString(PyExc_ImportError, "init pygame_sdl2.joystick"); } __pyx_L0:; __Pyx_RefNannyFinishContext(); #if PY_MAJOR_VERSION < 3 return; #else return __pyx_m; #endif } /* --- Runtime support code --- */ #if CYTHON_REFNANNY static __Pyx_RefNannyAPIStruct *__Pyx_RefNannyImportAPI(const char *modname) { PyObject *m = NULL, *p = NULL; void *r = NULL; m = PyImport_ImportModule((char *)modname); if (!m) goto end; p = PyObject_GetAttrString(m, (char *)"RefNannyAPI"); if (!p) goto end; r = PyLong_AsVoidPtr(p); end: Py_XDECREF(p); Py_XDECREF(m); return (__Pyx_RefNannyAPIStruct *)r; } #endif static PyObject *__Pyx_GetBuiltinName(PyObject *name) { PyObject* result = __Pyx_PyObject_GetAttrStr(__pyx_b, name); if (unlikely(!result)) { PyErr_Format(PyExc_NameError, #if PY_MAJOR_VERSION >= 3 "name '%U' is not defined", name); #else "name '%.200s' is not defined", PyString_AS_STRING(name)); #endif } return result; } static CYTHON_INLINE PyObject *__Pyx_GetModuleGlobalName(PyObject *name) { PyObject *result; #if CYTHON_COMPILING_IN_CPYTHON result = PyDict_GetItem(__pyx_d, name); if (likely(result)) { Py_INCREF(result); } else { #else result = PyObject_GetItem(__pyx_d, name); if (!result) { PyErr_Clear(); #endif result = __Pyx_GetBuiltinName(name); } return result; } #if CYTHON_COMPILING_IN_CPYTHON static CYTHON_INLINE PyObject* __Pyx_PyObject_Call(PyObject *func, PyObject *arg, PyObject *kw) { PyObject *result; ternaryfunc call = func->ob_type->tp_call; if (unlikely(!call)) return PyObject_Call(func, arg, kw); if (unlikely(Py_EnterRecursiveCall((char*)" while calling a Python object"))) return NULL; result = (*call)(func, arg, kw); Py_LeaveRecursiveCall(); if (unlikely(!result) && unlikely(!PyErr_Occurred())) { PyErr_SetString( PyExc_SystemError, "NULL result without error in PyObject_Call"); } return result; } #endif #if CYTHON_COMPILING_IN_CPYTHON static CYTHON_INLINE PyObject* __Pyx_PyObject_CallMethO(PyObject *func, PyObject *arg) { PyObject *self, *result; PyCFunction cfunc; cfunc = PyCFunction_GET_FUNCTION(func); self = PyCFunction_GET_SELF(func); if (unlikely(Py_EnterRecursiveCall((char*)" while calling a Python object"))) return NULL; result = cfunc(self, arg); Py_LeaveRecursiveCall(); if (unlikely(!result) && unlikely(!PyErr_Occurred())) { PyErr_SetString( PyExc_SystemError, "NULL result without error in PyObject_Call"); } return result; } #endif #if CYTHON_COMPILING_IN_CPYTHON static PyObject* __Pyx__PyObject_CallOneArg(PyObject *func, PyObject *arg) { PyObject *result; PyObject *args = PyTuple_New(1); if (unlikely(!args)) return NULL; Py_INCREF(arg); PyTuple_SET_ITEM(args, 0, arg); result = __Pyx_PyObject_Call(func, args, NULL); Py_DECREF(args); return result; } static CYTHON_INLINE PyObject* __Pyx_PyObject_CallOneArg(PyObject *func, PyObject *arg) { #ifdef __Pyx_CyFunction_USED if (likely(PyCFunction_Check(func) || PyObject_TypeCheck(func, __pyx_CyFunctionType))) { #else if (likely(PyCFunction_Check(func))) { #endif if (likely(PyCFunction_GET_FLAGS(func) & METH_O)) { return __Pyx_PyObject_CallMethO(func, arg); } } return __Pyx__PyObject_CallOneArg(func, arg); } #else static CYTHON_INLINE PyObject* __Pyx_PyObject_CallOneArg(PyObject *func, PyObject *arg) { PyObject* args = PyTuple_Pack(1, arg); return (likely(args)) ? __Pyx_PyObject_Call(func, args, NULL) : NULL; } #endif #if CYTHON_COMPILING_IN_CPYTHON static CYTHON_INLINE PyObject* __Pyx_PyObject_CallNoArg(PyObject *func) { #ifdef __Pyx_CyFunction_USED if (likely(PyCFunction_Check(func) || PyObject_TypeCheck(func, __pyx_CyFunctionType))) { #else if (likely(PyCFunction_Check(func))) { #endif if (likely(PyCFunction_GET_FLAGS(func) & METH_NOARGS)) { return __Pyx_PyObject_CallMethO(func, NULL); } } return __Pyx_PyObject_Call(func, __pyx_empty_tuple, NULL); } #endif static CYTHON_INLINE void __Pyx_ErrRestore(PyObject *type, PyObject *value, PyObject *tb) { #if CYTHON_COMPILING_IN_CPYTHON PyObject *tmp_type, *tmp_value, *tmp_tb; PyThreadState *tstate = PyThreadState_GET(); tmp_type = tstate->curexc_type; tmp_value = tstate->curexc_value; tmp_tb = tstate->curexc_traceback; tstate->curexc_type = type; tstate->curexc_value = value; tstate->curexc_traceback = tb; Py_XDECREF(tmp_type); Py_XDECREF(tmp_value); Py_XDECREF(tmp_tb); #else PyErr_Restore(type, value, tb); #endif } static CYTHON_INLINE void __Pyx_ErrFetch(PyObject **type, PyObject **value, PyObject **tb) { #if CYTHON_COMPILING_IN_CPYTHON PyThreadState *tstate = PyThreadState_GET(); *type = tstate->curexc_type; *value = tstate->curexc_value; *tb = tstate->curexc_traceback; tstate->curexc_type = 0; tstate->curexc_value = 0; tstate->curexc_traceback = 0; #else PyErr_Fetch(type, value, tb); #endif } #if PY_MAJOR_VERSION < 3 static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, CYTHON_UNUSED PyObject *cause) { Py_XINCREF(type); if (!value || value == Py_None) value = NULL; else Py_INCREF(value); if (!tb || tb == Py_None) tb = NULL; else { Py_INCREF(tb); if (!PyTraceBack_Check(tb)) { PyErr_SetString(PyExc_TypeError, "raise: arg 3 must be a traceback or None"); goto raise_error; } } if (PyType_Check(type)) { #if CYTHON_COMPILING_IN_PYPY if (!value) { Py_INCREF(Py_None); value = Py_None; } #endif PyErr_NormalizeException(&type, &value, &tb); } else { if (value) { PyErr_SetString(PyExc_TypeError, "instance exception may not have a separate value"); goto raise_error; } value = type; type = (PyObject*) Py_TYPE(type); Py_INCREF(type); if (!PyType_IsSubtype((PyTypeObject *)type, (PyTypeObject *)PyExc_BaseException)) { PyErr_SetString(PyExc_TypeError, "raise: exception class must be a subclass of BaseException"); goto raise_error; } } __Pyx_ErrRestore(type, value, tb); return; raise_error: Py_XDECREF(value); Py_XDECREF(type); Py_XDECREF(tb); return; } #else static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, PyObject *cause) { PyObject* owned_instance = NULL; if (tb == Py_None) { tb = 0; } else if (tb && !PyTraceBack_Check(tb)) { PyErr_SetString(PyExc_TypeError, "raise: arg 3 must be a traceback or None"); goto bad; } if (value == Py_None) value = 0; if (PyExceptionInstance_Check(type)) { if (value) { PyErr_SetString(PyExc_TypeError, "instance exception may not have a separate value"); goto bad; } value = type; type = (PyObject*) Py_TYPE(value); } else if (PyExceptionClass_Check(type)) { PyObject *instance_class = NULL; if (value && PyExceptionInstance_Check(value)) { instance_class = (PyObject*) Py_TYPE(value); if (instance_class != type) { int is_subclass = PyObject_IsSubclass(instance_class, type); if (!is_subclass) { instance_class = NULL; } else if (unlikely(is_subclass == -1)) { goto bad; } else { type = instance_class; } } } if (!instance_class) { PyObject *args; if (!value) args = PyTuple_New(0); else if (PyTuple_Check(value)) { Py_INCREF(value); args = value; } else args = PyTuple_Pack(1, value); if (!args) goto bad; owned_instance = PyObject_Call(type, args, NULL); Py_DECREF(args); if (!owned_instance) goto bad; value = owned_instance; if (!PyExceptionInstance_Check(value)) { PyErr_Format(PyExc_TypeError, "calling %R should have returned an instance of " "BaseException, not %R", type, Py_TYPE(value)); goto bad; } } } else { PyErr_SetString(PyExc_TypeError, "raise: exception class must be a subclass of BaseException"); goto bad; } #if PY_VERSION_HEX >= 0x03030000 if (cause) { #else if (cause && cause != Py_None) { #endif PyObject *fixed_cause; if (cause == Py_None) { fixed_cause = NULL; } else if (PyExceptionClass_Check(cause)) { fixed_cause = PyObject_CallObject(cause, NULL); if (fixed_cause == NULL) goto bad; } else if (PyExceptionInstance_Check(cause)) { fixed_cause = cause; Py_INCREF(fixed_cause); } else { PyErr_SetString(PyExc_TypeError, "exception causes must derive from " "BaseException"); goto bad; } PyException_SetCause(value, fixed_cause); } PyErr_SetObject(type, value); if (tb) { #if CYTHON_COMPILING_IN_PYPY PyObject *tmp_type, *tmp_value, *tmp_tb; PyErr_Fetch(&tmp_type, &tmp_value, &tmp_tb); Py_INCREF(tb); PyErr_Restore(tmp_type, tmp_value, tb); Py_XDECREF(tmp_tb); #else PyThreadState *tstate = PyThreadState_GET(); PyObject* tmp_tb = tstate->curexc_traceback; if (tb != tmp_tb) { Py_INCREF(tb); tstate->curexc_traceback = tb; Py_XDECREF(tmp_tb); } #endif } bad: Py_XDECREF(owned_instance); return; } #endif static void __Pyx_RaiseArgtupleInvalid( const char* func_name, int exact, Py_ssize_t num_min, Py_ssize_t num_max, Py_ssize_t num_found) { Py_ssize_t num_expected; const char *more_or_less; if (num_found < num_min) { num_expected = num_min; more_or_less = "at least"; } else { num_expected = num_max; more_or_less = "at most"; } if (exact) { more_or_less = "exactly"; } PyErr_Format(PyExc_TypeError, "%.200s() takes %.8s %" CYTHON_FORMAT_SSIZE_T "d positional argument%.1s (%" CYTHON_FORMAT_SSIZE_T "d given)", func_name, more_or_less, num_expected, (num_expected == 1) ? "" : "s", num_found); } static CYTHON_INLINE int __Pyx_CheckKeywordStrings( PyObject *kwdict, const char* function_name, int kw_allowed) { PyObject* key = 0; Py_ssize_t pos = 0; #if CYTHON_COMPILING_IN_PYPY if (!kw_allowed && PyDict_Next(kwdict, &pos, &key, 0)) goto invalid_keyword; return 1; #else while (PyDict_Next(kwdict, &pos, &key, 0)) { #if PY_MAJOR_VERSION < 3 if (unlikely(!PyString_CheckExact(key)) && unlikely(!PyString_Check(key))) #endif if (unlikely(!PyUnicode_Check(key))) goto invalid_keyword_type; } if ((!kw_allowed) && unlikely(key)) goto invalid_keyword; return 1; invalid_keyword_type: PyErr_Format(PyExc_TypeError, "%.200s() keywords must be strings", function_name); return 0; #endif invalid_keyword: PyErr_Format(PyExc_TypeError, #if PY_MAJOR_VERSION < 3 "%.200s() got an unexpected keyword argument '%.200s'", function_name, PyString_AsString(key)); #else "%s() got an unexpected keyword argument '%U'", function_name, key); #endif return 0; } static void __Pyx_RaiseDoubleKeywordsError( const char* func_name, PyObject* kw_name) { PyErr_Format(PyExc_TypeError, #if PY_MAJOR_VERSION >= 3 "%s() got multiple values for keyword argument '%U'", func_name, kw_name); #else "%s() got multiple values for keyword argument '%s'", func_name, PyString_AsString(kw_name)); #endif } static int __Pyx_ParseOptionalKeywords( PyObject *kwds, PyObject **argnames[], PyObject *kwds2, PyObject *values[], Py_ssize_t num_pos_args, const char* function_name) { PyObject *key = 0, *value = 0; Py_ssize_t pos = 0; PyObject*** name; PyObject*** first_kw_arg = argnames + num_pos_args; while (PyDict_Next(kwds, &pos, &key, &value)) { name = first_kw_arg; while (*name && (**name != key)) name++; if (*name) { values[name-argnames] = value; continue; } name = first_kw_arg; #if PY_MAJOR_VERSION < 3 if (likely(PyString_CheckExact(key)) || likely(PyString_Check(key))) { while (*name) { if ((CYTHON_COMPILING_IN_PYPY || PyString_GET_SIZE(**name) == PyString_GET_SIZE(key)) && _PyString_Eq(**name, key)) { values[name-argnames] = value; break; } name++; } if (*name) continue; else { PyObject*** argname = argnames; while (argname != first_kw_arg) { if ((**argname == key) || ( (CYTHON_COMPILING_IN_PYPY || PyString_GET_SIZE(**argname) == PyString_GET_SIZE(key)) && _PyString_Eq(**argname, key))) { goto arg_passed_twice; } argname++; } } } else #endif if (likely(PyUnicode_Check(key))) { while (*name) { int cmp = (**name == key) ? 0 : #if !CYTHON_COMPILING_IN_PYPY && PY_MAJOR_VERSION >= 3 (PyUnicode_GET_SIZE(**name) != PyUnicode_GET_SIZE(key)) ? 1 : #endif PyUnicode_Compare(**name, key); if (cmp < 0 && unlikely(PyErr_Occurred())) goto bad; if (cmp == 0) { values[name-argnames] = value; break; } name++; } if (*name) continue; else { PyObject*** argname = argnames; while (argname != first_kw_arg) { int cmp = (**argname == key) ? 0 : #if !CYTHON_COMPILING_IN_PYPY && PY_MAJOR_VERSION >= 3 (PyUnicode_GET_SIZE(**argname) != PyUnicode_GET_SIZE(key)) ? 1 : #endif PyUnicode_Compare(**argname, key); if (cmp < 0 && unlikely(PyErr_Occurred())) goto bad; if (cmp == 0) goto arg_passed_twice; argname++; } } } else goto invalid_keyword_type; if (kwds2) { if (unlikely(PyDict_SetItem(kwds2, key, value))) goto bad; } else { goto invalid_keyword; } } return 0; arg_passed_twice: __Pyx_RaiseDoubleKeywordsError(function_name, key); goto bad; invalid_keyword_type: PyErr_Format(PyExc_TypeError, "%.200s() keywords must be strings", function_name); goto bad; invalid_keyword: PyErr_Format(PyExc_TypeError, #if PY_MAJOR_VERSION < 3 "%.200s() got an unexpected keyword argument '%.200s'", function_name, PyString_AsString(key)); #else "%s() got an unexpected keyword argument '%U'", function_name, key); #endif bad: return -1; } static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list, int level) { PyObject *empty_list = 0; PyObject *module = 0; PyObject *global_dict = 0; PyObject *empty_dict = 0; PyObject *list; #if PY_VERSION_HEX < 0x03030000 PyObject *py_import; py_import = __Pyx_PyObject_GetAttrStr(__pyx_b, __pyx_n_s_import); if (!py_import) goto bad; #endif if (from_list) list = from_list; else { empty_list = PyList_New(0); if (!empty_list) goto bad; list = empty_list; } global_dict = PyModule_GetDict(__pyx_m); if (!global_dict) goto bad; empty_dict = PyDict_New(); if (!empty_dict) goto bad; { #if PY_MAJOR_VERSION >= 3 if (level == -1) { if (strchr(__Pyx_MODULE_NAME, '.')) { #if PY_VERSION_HEX < 0x03030000 PyObject *py_level = PyInt_FromLong(1); if (!py_level) goto bad; module = PyObject_CallFunctionObjArgs(py_import, name, global_dict, empty_dict, list, py_level, NULL); Py_DECREF(py_level); #else module = PyImport_ImportModuleLevelObject( name, global_dict, empty_dict, list, 1); #endif if (!module) { if (!PyErr_ExceptionMatches(PyExc_ImportError)) goto bad; PyErr_Clear(); } } level = 0; } #endif if (!module) { #if PY_VERSION_HEX < 0x03030000 PyObject *py_level = PyInt_FromLong(level); if (!py_level) goto bad; module = PyObject_CallFunctionObjArgs(py_import, name, global_dict, empty_dict, list, py_level, NULL); Py_DECREF(py_level); #else module = PyImport_ImportModuleLevelObject( name, global_dict, empty_dict, list, level); #endif } } bad: #if PY_VERSION_HEX < 0x03030000 Py_XDECREF(py_import); #endif Py_XDECREF(empty_list); Py_XDECREF(empty_dict); return module; } static PyObject* __Pyx_ImportFrom(PyObject* module, PyObject* name) { PyObject* value = __Pyx_PyObject_GetAttrStr(module, name); if (unlikely(!value) && PyErr_ExceptionMatches(PyExc_AttributeError)) { PyErr_Format(PyExc_ImportError, #if PY_MAJOR_VERSION < 3 "cannot import name %.230s", PyString_AS_STRING(name)); #else "cannot import name %S", name); #endif } return value; } static int __pyx_bisect_code_objects(__Pyx_CodeObjectCacheEntry* entries, int count, int code_line) { int start = 0, mid = 0, end = count - 1; if (end >= 0 && code_line > entries[end].code_line) { return count; } while (start < end) { mid = start + (end - start) / 2; if (code_line < entries[mid].code_line) { end = mid; } else if (code_line > entries[mid].code_line) { start = mid + 1; } else { return mid; } } if (code_line <= entries[mid].code_line) { return mid; } else { return mid + 1; } } static PyCodeObject *__pyx_find_code_object(int code_line) { PyCodeObject* code_object; int pos; if (unlikely(!code_line) || unlikely(!__pyx_code_cache.entries)) { return NULL; } pos = __pyx_bisect_code_objects(__pyx_code_cache.entries, __pyx_code_cache.count, code_line); if (unlikely(pos >= __pyx_code_cache.count) || unlikely(__pyx_code_cache.entries[pos].code_line != code_line)) { return NULL; } code_object = __pyx_code_cache.entries[pos].code_object; Py_INCREF(code_object); return code_object; } static void __pyx_insert_code_object(int code_line, PyCodeObject* code_object) { int pos, i; __Pyx_CodeObjectCacheEntry* entries = __pyx_code_cache.entries; if (unlikely(!code_line)) { return; } if (unlikely(!entries)) { entries = (__Pyx_CodeObjectCacheEntry*)PyMem_Malloc(64*sizeof(__Pyx_CodeObjectCacheEntry)); if (likely(entries)) { __pyx_code_cache.entries = entries; __pyx_code_cache.max_count = 64; __pyx_code_cache.count = 1; entries[0].code_line = code_line; entries[0].code_object = code_object; Py_INCREF(code_object); } return; } pos = __pyx_bisect_code_objects(__pyx_code_cache.entries, __pyx_code_cache.count, code_line); if ((pos < __pyx_code_cache.count) && unlikely(__pyx_code_cache.entries[pos].code_line == code_line)) { PyCodeObject* tmp = entries[pos].code_object; entries[pos].code_object = code_object; Py_DECREF(tmp); return; } if (__pyx_code_cache.count == __pyx_code_cache.max_count) { int new_max = __pyx_code_cache.max_count + 64; entries = (__Pyx_CodeObjectCacheEntry*)PyMem_Realloc( __pyx_code_cache.entries, (size_t)new_max*sizeof(__Pyx_CodeObjectCacheEntry)); if (unlikely(!entries)) { return; } __pyx_code_cache.entries = entries; __pyx_code_cache.max_count = new_max; } for (i=__pyx_code_cache.count; i>pos; i--) { entries[i] = entries[i-1]; } entries[pos].code_line = code_line; entries[pos].code_object = code_object; __pyx_code_cache.count++; Py_INCREF(code_object); } #include "compile.h" #include "frameobject.h" #include "traceback.h" static PyCodeObject* __Pyx_CreateCodeObjectForTraceback( const char *funcname, int c_line, int py_line, const char *filename) { PyCodeObject *py_code = 0; PyObject *py_srcfile = 0; PyObject *py_funcname = 0; #if PY_MAJOR_VERSION < 3 py_srcfile = PyString_FromString(filename); #else py_srcfile = PyUnicode_FromString(filename); #endif if (!py_srcfile) goto bad; if (c_line) { #if PY_MAJOR_VERSION < 3 py_funcname = PyString_FromFormat( "%s (%s:%d)", funcname, __pyx_cfilenm, c_line); #else py_funcname = PyUnicode_FromFormat( "%s (%s:%d)", funcname, __pyx_cfilenm, c_line); #endif } else { #if PY_MAJOR_VERSION < 3 py_funcname = PyString_FromString(funcname); #else py_funcname = PyUnicode_FromString(funcname); #endif } if (!py_funcname) goto bad; py_code = __Pyx_PyCode_New( 0, 0, 0, 0, 0, __pyx_empty_bytes, /*PyObject *code,*/ __pyx_empty_tuple, /*PyObject *consts,*/ __pyx_empty_tuple, /*PyObject *names,*/ __pyx_empty_tuple, /*PyObject *varnames,*/ __pyx_empty_tuple, /*PyObject *freevars,*/ __pyx_empty_tuple, /*PyObject *cellvars,*/ py_srcfile, /*PyObject *filename,*/ py_funcname, /*PyObject *name,*/ py_line, __pyx_empty_bytes /*PyObject *lnotab*/ ); Py_DECREF(py_srcfile); Py_DECREF(py_funcname); return py_code; bad: Py_XDECREF(py_srcfile); Py_XDECREF(py_funcname); return NULL; } static void __Pyx_AddTraceback(const char *funcname, int c_line, int py_line, const char *filename) { PyCodeObject *py_code = 0; PyFrameObject *py_frame = 0; py_code = __pyx_find_code_object(c_line ? c_line : py_line); if (!py_code) { py_code = __Pyx_CreateCodeObjectForTraceback( funcname, c_line, py_line, filename); if (!py_code) goto bad; __pyx_insert_code_object(c_line ? c_line : py_line, py_code); } py_frame = PyFrame_New( PyThreadState_GET(), /*PyThreadState *tstate,*/ py_code, /*PyCodeObject *code,*/ __pyx_d, /*PyObject *globals,*/ 0 /*PyObject *locals*/ ); if (!py_frame) goto bad; py_frame->f_lineno = py_line; PyTraceBack_Here(py_frame); bad: Py_XDECREF(py_code); Py_XDECREF(py_frame); } static CYTHON_INLINE PyObject* __Pyx_PyInt_From_int(int value) { const int neg_one = (int) -1, const_zero = (int) 0; const int is_unsigned = neg_one > const_zero; if (is_unsigned) { if (sizeof(int) < sizeof(long)) { return PyInt_FromLong((long) value); } else if (sizeof(int) <= sizeof(unsigned long)) { return PyLong_FromUnsignedLong((unsigned long) value); } else if (sizeof(int) <= sizeof(unsigned PY_LONG_LONG)) { return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value); } } else { if (sizeof(int) <= sizeof(long)) { return PyInt_FromLong((long) value); } else if (sizeof(int) <= sizeof(PY_LONG_LONG)) { return PyLong_FromLongLong((PY_LONG_LONG) value); } } { int one = 1; int little = (int)*(unsigned char *)&one; unsigned char *bytes = (unsigned char *)&value; return _PyLong_FromByteArray(bytes, sizeof(int), little, !is_unsigned); } } #define __PYX_VERIFY_RETURN_INT(target_type, func_type, func_value)\ __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, 0) #define __PYX_VERIFY_RETURN_INT_EXC(target_type, func_type, func_value)\ __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, 1) #define __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, exc)\ {\ func_type value = func_value;\ if (sizeof(target_type) < sizeof(func_type)) {\ if (unlikely(value != (func_type) (target_type) value)) {\ func_type zero = 0;\ if (exc && unlikely(value == (func_type)-1 && PyErr_Occurred()))\ return (target_type) -1;\ if (is_unsigned && unlikely(value < zero))\ goto raise_neg_overflow;\ else\ goto raise_overflow;\ }\ }\ return (target_type) value;\ } #if CYTHON_USE_PYLONG_INTERNALS #include "longintrepr.h" #endif static CYTHON_INLINE int __Pyx_PyInt_As_int(PyObject *x) { const int neg_one = (int) -1, const_zero = (int) 0; const int is_unsigned = neg_one > const_zero; #if PY_MAJOR_VERSION < 3 if (likely(PyInt_Check(x))) { if (sizeof(int) < sizeof(long)) { __PYX_VERIFY_RETURN_INT(int, long, PyInt_AS_LONG(x)) } else { long val = PyInt_AS_LONG(x); if (is_unsigned && unlikely(val < 0)) { goto raise_neg_overflow; } return (int) val; } } else #endif if (likely(PyLong_Check(x))) { if (is_unsigned) { #if CYTHON_USE_PYLONG_INTERNALS const digit* digits = ((PyLongObject*)x)->ob_digit; switch (Py_SIZE(x)) { case 0: return (int) 0; case 1: __PYX_VERIFY_RETURN_INT(int, digit, digits[0]) case 2: if (8 * sizeof(int) > 1 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(int) >= 2 * PyLong_SHIFT) { return (int) (((((int)digits[1]) << PyLong_SHIFT) | (int)digits[0])); } } break; case 3: if (8 * sizeof(int) > 2 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(int) >= 3 * PyLong_SHIFT) { return (int) (((((((int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0])); } } break; case 4: if (8 * sizeof(int) > 3 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(int) >= 4 * PyLong_SHIFT) { return (int) (((((((((int)digits[3]) << PyLong_SHIFT) | (int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0])); } } break; } #endif #if CYTHON_COMPILING_IN_CPYTHON if (unlikely(Py_SIZE(x) < 0)) { goto raise_neg_overflow; } #else { int result = PyObject_RichCompareBool(x, Py_False, Py_LT); if (unlikely(result < 0)) return (int) -1; if (unlikely(result == 1)) goto raise_neg_overflow; } #endif if (sizeof(int) <= sizeof(unsigned long)) { __PYX_VERIFY_RETURN_INT_EXC(int, unsigned long, PyLong_AsUnsignedLong(x)) } else if (sizeof(int) <= sizeof(unsigned PY_LONG_LONG)) { __PYX_VERIFY_RETURN_INT_EXC(int, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x)) } } else { #if CYTHON_USE_PYLONG_INTERNALS const digit* digits = ((PyLongObject*)x)->ob_digit; switch (Py_SIZE(x)) { case 0: return (int) 0; case -1: __PYX_VERIFY_RETURN_INT(int, sdigit, -(sdigit) digits[0]) case 1: __PYX_VERIFY_RETURN_INT(int, digit, +digits[0]) case -2: if (8 * sizeof(int) - 1 > 1 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(int, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(int) - 1 > 2 * PyLong_SHIFT) { return (int) (((int)-1)*(((((int)digits[1]) << PyLong_SHIFT) | (int)digits[0]))); } } break; case 2: if (8 * sizeof(int) > 1 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(int) - 1 > 2 * PyLong_SHIFT) { return (int) ((((((int)digits[1]) << PyLong_SHIFT) | (int)digits[0]))); } } break; case -3: if (8 * sizeof(int) - 1 > 2 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(int, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(int) - 1 > 3 * PyLong_SHIFT) { return (int) (((int)-1)*(((((((int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0]))); } } break; case 3: if (8 * sizeof(int) > 2 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(int) - 1 > 3 * PyLong_SHIFT) { return (int) ((((((((int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0]))); } } break; case -4: if (8 * sizeof(int) - 1 > 3 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(int, long, -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(int) - 1 > 4 * PyLong_SHIFT) { return (int) (((int)-1)*(((((((((int)digits[3]) << PyLong_SHIFT) | (int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0]))); } } break; case 4: if (8 * sizeof(int) > 3 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(int) - 1 > 4 * PyLong_SHIFT) { return (int) ((((((((((int)digits[3]) << PyLong_SHIFT) | (int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0]))); } } break; } #endif if (sizeof(int) <= sizeof(long)) { __PYX_VERIFY_RETURN_INT_EXC(int, long, PyLong_AsLong(x)) } else if (sizeof(int) <= sizeof(PY_LONG_LONG)) { __PYX_VERIFY_RETURN_INT_EXC(int, PY_LONG_LONG, PyLong_AsLongLong(x)) } } { #if CYTHON_COMPILING_IN_PYPY && !defined(_PyLong_AsByteArray) PyErr_SetString(PyExc_RuntimeError, "_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers"); #else int val; PyObject *v = __Pyx_PyNumber_Int(x); #if PY_MAJOR_VERSION < 3 if (likely(v) && !PyLong_Check(v)) { PyObject *tmp = v; v = PyNumber_Long(tmp); Py_DECREF(tmp); } #endif if (likely(v)) { int one = 1; int is_little = (int)*(unsigned char *)&one; unsigned char *bytes = (unsigned char *)&val; int ret = _PyLong_AsByteArray((PyLongObject *)v, bytes, sizeof(val), is_little, !is_unsigned); Py_DECREF(v); if (likely(!ret)) return val; } #endif return (int) -1; } } else { int val; PyObject *tmp = __Pyx_PyNumber_Int(x); if (!tmp) return (int) -1; val = __Pyx_PyInt_As_int(tmp); Py_DECREF(tmp); return val; } raise_overflow: PyErr_SetString(PyExc_OverflowError, "value too large to convert to int"); return (int) -1; raise_neg_overflow: PyErr_SetString(PyExc_OverflowError, "can't convert negative value to int"); return (int) -1; } static CYTHON_INLINE PyObject* __Pyx_PyInt_From_int32_t(int32_t value) { const int32_t neg_one = (int32_t) -1, const_zero = (int32_t) 0; const int is_unsigned = neg_one > const_zero; if (is_unsigned) { if (sizeof(int32_t) < sizeof(long)) { return PyInt_FromLong((long) value); } else if (sizeof(int32_t) <= sizeof(unsigned long)) { return PyLong_FromUnsignedLong((unsigned long) value); } else if (sizeof(int32_t) <= sizeof(unsigned PY_LONG_LONG)) { return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value); } } else { if (sizeof(int32_t) <= sizeof(long)) { return PyInt_FromLong((long) value); } else if (sizeof(int32_t) <= sizeof(PY_LONG_LONG)) { return PyLong_FromLongLong((PY_LONG_LONG) value); } } { int one = 1; int little = (int)*(unsigned char *)&one; unsigned char *bytes = (unsigned char *)&value; return _PyLong_FromByteArray(bytes, sizeof(int32_t), little, !is_unsigned); } } static CYTHON_INLINE PyObject* __Pyx_PyInt_From_long(long value) { const long neg_one = (long) -1, const_zero = (long) 0; const int is_unsigned = neg_one > const_zero; if (is_unsigned) { if (sizeof(long) < sizeof(long)) { return PyInt_FromLong((long) value); } else if (sizeof(long) <= sizeof(unsigned long)) { return PyLong_FromUnsignedLong((unsigned long) value); } else if (sizeof(long) <= sizeof(unsigned PY_LONG_LONG)) { return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value); } } else { if (sizeof(long) <= sizeof(long)) { return PyInt_FromLong((long) value); } else if (sizeof(long) <= sizeof(PY_LONG_LONG)) { return PyLong_FromLongLong((PY_LONG_LONG) value); } } { int one = 1; int little = (int)*(unsigned char *)&one; unsigned char *bytes = (unsigned char *)&value; return _PyLong_FromByteArray(bytes, sizeof(long), little, !is_unsigned); } } static CYTHON_INLINE long __Pyx_PyInt_As_long(PyObject *x) { const long neg_one = (long) -1, const_zero = (long) 0; const int is_unsigned = neg_one > const_zero; #if PY_MAJOR_VERSION < 3 if (likely(PyInt_Check(x))) { if (sizeof(long) < sizeof(long)) { __PYX_VERIFY_RETURN_INT(long, long, PyInt_AS_LONG(x)) } else { long val = PyInt_AS_LONG(x); if (is_unsigned && unlikely(val < 0)) { goto raise_neg_overflow; } return (long) val; } } else #endif if (likely(PyLong_Check(x))) { if (is_unsigned) { #if CYTHON_USE_PYLONG_INTERNALS const digit* digits = ((PyLongObject*)x)->ob_digit; switch (Py_SIZE(x)) { case 0: return (long) 0; case 1: __PYX_VERIFY_RETURN_INT(long, digit, digits[0]) case 2: if (8 * sizeof(long) > 1 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(long) >= 2 * PyLong_SHIFT) { return (long) (((((long)digits[1]) << PyLong_SHIFT) | (long)digits[0])); } } break; case 3: if (8 * sizeof(long) > 2 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(long) >= 3 * PyLong_SHIFT) { return (long) (((((((long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0])); } } break; case 4: if (8 * sizeof(long) > 3 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(long) >= 4 * PyLong_SHIFT) { return (long) (((((((((long)digits[3]) << PyLong_SHIFT) | (long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0])); } } break; } #endif #if CYTHON_COMPILING_IN_CPYTHON if (unlikely(Py_SIZE(x) < 0)) { goto raise_neg_overflow; } #else { int result = PyObject_RichCompareBool(x, Py_False, Py_LT); if (unlikely(result < 0)) return (long) -1; if (unlikely(result == 1)) goto raise_neg_overflow; } #endif if (sizeof(long) <= sizeof(unsigned long)) { __PYX_VERIFY_RETURN_INT_EXC(long, unsigned long, PyLong_AsUnsignedLong(x)) } else if (sizeof(long) <= sizeof(unsigned PY_LONG_LONG)) { __PYX_VERIFY_RETURN_INT_EXC(long, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x)) } } else { #if CYTHON_USE_PYLONG_INTERNALS const digit* digits = ((PyLongObject*)x)->ob_digit; switch (Py_SIZE(x)) { case 0: return (long) 0; case -1: __PYX_VERIFY_RETURN_INT(long, sdigit, -(sdigit) digits[0]) case 1: __PYX_VERIFY_RETURN_INT(long, digit, +digits[0]) case -2: if (8 * sizeof(long) - 1 > 1 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(long, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) { return (long) (((long)-1)*(((((long)digits[1]) << PyLong_SHIFT) | (long)digits[0]))); } } break; case 2: if (8 * sizeof(long) > 1 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) { return (long) ((((((long)digits[1]) << PyLong_SHIFT) | (long)digits[0]))); } } break; case -3: if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(long, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) { return (long) (((long)-1)*(((((((long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0]))); } } break; case 3: if (8 * sizeof(long) > 2 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) { return (long) ((((((((long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0]))); } } break; case -4: if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(long, long, -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(long) - 1 > 4 * PyLong_SHIFT) { return (long) (((long)-1)*(((((((((long)digits[3]) << PyLong_SHIFT) | (long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0]))); } } break; case 4: if (8 * sizeof(long) > 3 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(long) - 1 > 4 * PyLong_SHIFT) { return (long) ((((((((((long)digits[3]) << PyLong_SHIFT) | (long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0]))); } } break; } #endif if (sizeof(long) <= sizeof(long)) { __PYX_VERIFY_RETURN_INT_EXC(long, long, PyLong_AsLong(x)) } else if (sizeof(long) <= sizeof(PY_LONG_LONG)) { __PYX_VERIFY_RETURN_INT_EXC(long, PY_LONG_LONG, PyLong_AsLongLong(x)) } } { #if CYTHON_COMPILING_IN_PYPY && !defined(_PyLong_AsByteArray) PyErr_SetString(PyExc_RuntimeError, "_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers"); #else long val; PyObject *v = __Pyx_PyNumber_Int(x); #if PY_MAJOR_VERSION < 3 if (likely(v) && !PyLong_Check(v)) { PyObject *tmp = v; v = PyNumber_Long(tmp); Py_DECREF(tmp); } #endif if (likely(v)) { int one = 1; int is_little = (int)*(unsigned char *)&one; unsigned char *bytes = (unsigned char *)&val; int ret = _PyLong_AsByteArray((PyLongObject *)v, bytes, sizeof(val), is_little, !is_unsigned); Py_DECREF(v); if (likely(!ret)) return val; } #endif return (long) -1; } } else { long val; PyObject *tmp = __Pyx_PyNumber_Int(x); if (!tmp) return (long) -1; val = __Pyx_PyInt_As_long(tmp); Py_DECREF(tmp); return val; } raise_overflow: PyErr_SetString(PyExc_OverflowError, "value too large to convert to long"); return (long) -1; raise_neg_overflow: PyErr_SetString(PyExc_OverflowError, "can't convert negative value to long"); return (long) -1; } static int __Pyx_check_binary_version(void) { char ctversion[4], rtversion[4]; PyOS_snprintf(ctversion, 4, "%d.%d", PY_MAJOR_VERSION, PY_MINOR_VERSION); PyOS_snprintf(rtversion, 4, "%s", Py_GetVersion()); if (ctversion[0] != rtversion[0] || ctversion[2] != rtversion[2]) { char message[200]; PyOS_snprintf(message, sizeof(message), "compiletime version %s of module '%.100s' " "does not match runtime version %s", ctversion, __Pyx_MODULE_NAME, rtversion); return PyErr_WarnEx(NULL, message, 1); } return 0; } static int __Pyx_InitStrings(__Pyx_StringTabEntry *t) { while (t->p) { #if PY_MAJOR_VERSION < 3 if (t->is_unicode) { *t->p = PyUnicode_DecodeUTF8(t->s, t->n - 1, NULL); } else if (t->intern) { *t->p = PyString_InternFromString(t->s); } else { *t->p = PyString_FromStringAndSize(t->s, t->n - 1); } #else if (t->is_unicode | t->is_str) { if (t->intern) { *t->p = PyUnicode_InternFromString(t->s); } else if (t->encoding) { *t->p = PyUnicode_Decode(t->s, t->n - 1, t->encoding, NULL); } else { *t->p = PyUnicode_FromStringAndSize(t->s, t->n - 1); } } else { *t->p = PyBytes_FromStringAndSize(t->s, t->n - 1); } #endif if (!*t->p) return -1; ++t; } return 0; } static CYTHON_INLINE PyObject* __Pyx_PyUnicode_FromString(const char* c_str) { return __Pyx_PyUnicode_FromStringAndSize(c_str, (Py_ssize_t)strlen(c_str)); } static CYTHON_INLINE char* __Pyx_PyObject_AsString(PyObject* o) { Py_ssize_t ignore; return __Pyx_PyObject_AsStringAndSize(o, &ignore); } static CYTHON_INLINE char* __Pyx_PyObject_AsStringAndSize(PyObject* o, Py_ssize_t *length) { #if CYTHON_COMPILING_IN_CPYTHON && (__PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT) if ( #if PY_MAJOR_VERSION < 3 && __PYX_DEFAULT_STRING_ENCODING_IS_ASCII __Pyx_sys_getdefaultencoding_not_ascii && #endif PyUnicode_Check(o)) { #if PY_VERSION_HEX < 0x03030000 char* defenc_c; PyObject* defenc = _PyUnicode_AsDefaultEncodedString(o, NULL); if (!defenc) return NULL; defenc_c = PyBytes_AS_STRING(defenc); #if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII { char* end = defenc_c + PyBytes_GET_SIZE(defenc); char* c; for (c = defenc_c; c < end; c++) { if ((unsigned char) (*c) >= 128) { PyUnicode_AsASCIIString(o); return NULL; } } } #endif *length = PyBytes_GET_SIZE(defenc); return defenc_c; #else if (__Pyx_PyUnicode_READY(o) == -1) return NULL; #if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII if (PyUnicode_IS_ASCII(o)) { *length = PyUnicode_GET_LENGTH(o); return PyUnicode_AsUTF8(o); } else { PyUnicode_AsASCIIString(o); return NULL; } #else return PyUnicode_AsUTF8AndSize(o, length); #endif #endif } else #endif #if (!CYTHON_COMPILING_IN_PYPY) || (defined(PyByteArray_AS_STRING) && defined(PyByteArray_GET_SIZE)) if (PyByteArray_Check(o)) { *length = PyByteArray_GET_SIZE(o); return PyByteArray_AS_STRING(o); } else #endif { char* result; int r = PyBytes_AsStringAndSize(o, &result, length); if (unlikely(r < 0)) { return NULL; } else { return result; } } } static CYTHON_INLINE int __Pyx_PyObject_IsTrue(PyObject* x) { int is_true = x == Py_True; if (is_true | (x == Py_False) | (x == Py_None)) return is_true; else return PyObject_IsTrue(x); } static CYTHON_INLINE PyObject* __Pyx_PyNumber_Int(PyObject* x) { PyNumberMethods *m; const char *name = NULL; PyObject *res = NULL; #if PY_MAJOR_VERSION < 3 if (PyInt_Check(x) || PyLong_Check(x)) #else if (PyLong_Check(x)) #endif return __Pyx_NewRef(x); m = Py_TYPE(x)->tp_as_number; #if PY_MAJOR_VERSION < 3 if (m && m->nb_int) { name = "int"; res = PyNumber_Int(x); } else if (m && m->nb_long) { name = "long"; res = PyNumber_Long(x); } #else if (m && m->nb_int) { name = "int"; res = PyNumber_Long(x); } #endif if (res) { #if PY_MAJOR_VERSION < 3 if (!PyInt_Check(res) && !PyLong_Check(res)) { #else if (!PyLong_Check(res)) { #endif PyErr_Format(PyExc_TypeError, "__%.4s__ returned non-%.4s (type %.200s)", name, name, Py_TYPE(res)->tp_name); Py_DECREF(res); return NULL; } } else if (!PyErr_Occurred()) { PyErr_SetString(PyExc_TypeError, "an integer is required"); } return res; } static CYTHON_INLINE Py_ssize_t __Pyx_PyIndex_AsSsize_t(PyObject* b) { Py_ssize_t ival; PyObject *x; #if PY_MAJOR_VERSION < 3 if (likely(PyInt_CheckExact(b))) { if (sizeof(Py_ssize_t) >= sizeof(long)) return PyInt_AS_LONG(b); else return PyInt_AsSsize_t(x); } #endif if (likely(PyLong_CheckExact(b))) { #if CYTHON_USE_PYLONG_INTERNALS const digit* digits = ((PyLongObject*)b)->ob_digit; const Py_ssize_t size = Py_SIZE(b); if (likely(__Pyx_sst_abs(size) <= 1)) { ival = likely(size) ? digits[0] : 0; if (size == -1) ival = -ival; return ival; } else { switch (size) { case 2: if (8 * sizeof(Py_ssize_t) > 2 * PyLong_SHIFT) { return (Py_ssize_t) (((((size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])); } break; case -2: if (8 * sizeof(Py_ssize_t) > 2 * PyLong_SHIFT) { return -(Py_ssize_t) (((((size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])); } break; case 3: if (8 * sizeof(Py_ssize_t) > 3 * PyLong_SHIFT) { return (Py_ssize_t) (((((((size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])); } break; case -3: if (8 * sizeof(Py_ssize_t) > 3 * PyLong_SHIFT) { return -(Py_ssize_t) (((((((size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])); } break; case 4: if (8 * sizeof(Py_ssize_t) > 4 * PyLong_SHIFT) { return (Py_ssize_t) (((((((((size_t)digits[3]) << PyLong_SHIFT) | (size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])); } break; case -4: if (8 * sizeof(Py_ssize_t) > 4 * PyLong_SHIFT) { return -(Py_ssize_t) (((((((((size_t)digits[3]) << PyLong_SHIFT) | (size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])); } break; } } #endif return PyLong_AsSsize_t(b); } x = PyNumber_Index(b); if (!x) return -1; ival = PyInt_AsSsize_t(x); Py_DECREF(x); return ival; } static CYTHON_INLINE PyObject * __Pyx_PyInt_FromSize_t(size_t ival) { return PyInt_FromSize_t(ival); } #endif /* Py_PYTHON_H */ pygame_sdl2-2.1.0-for-renpy-6.99.14.1/gen3/pygame_sdl2.gfxdraw.c0000664000175000017500000172405713053466147023146 0ustar tomtom00000000000000/* Generated by Cython 0.23.5 */ #define PY_SSIZE_T_CLEAN #include "Python.h" #ifndef Py_PYTHON_H #error Python headers needed to compile C extensions, please install development version of Python. #elif PY_VERSION_HEX < 0x02060000 || (0x03000000 <= PY_VERSION_HEX && PY_VERSION_HEX < 0x03020000) #error Cython requires Python 2.6+ or Python 3.2+. #else #define CYTHON_ABI "0_23_5" #include #ifndef offsetof #define offsetof(type, member) ( (size_t) & ((type*)0) -> member ) #endif #if !defined(WIN32) && !defined(MS_WINDOWS) #ifndef __stdcall #define __stdcall #endif #ifndef __cdecl #define __cdecl #endif #ifndef __fastcall #define __fastcall #endif #endif #ifndef DL_IMPORT #define DL_IMPORT(t) t #endif #ifndef DL_EXPORT #define DL_EXPORT(t) t #endif #ifndef PY_LONG_LONG #define PY_LONG_LONG LONG_LONG #endif #ifndef Py_HUGE_VAL #define Py_HUGE_VAL HUGE_VAL #endif #ifdef PYPY_VERSION #define CYTHON_COMPILING_IN_PYPY 1 #define CYTHON_COMPILING_IN_CPYTHON 0 #else #define CYTHON_COMPILING_IN_PYPY 0 #define CYTHON_COMPILING_IN_CPYTHON 1 #endif #if !defined(CYTHON_USE_PYLONG_INTERNALS) && CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x02070000 #define CYTHON_USE_PYLONG_INTERNALS 1 #endif #if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX < 0x02070600 && !defined(Py_OptimizeFlag) #define Py_OptimizeFlag 0 #endif #define __PYX_BUILD_PY_SSIZE_T "n" #define CYTHON_FORMAT_SSIZE_T "z" #if PY_MAJOR_VERSION < 3 #define __Pyx_BUILTIN_MODULE_NAME "__builtin__" #define __Pyx_PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)\ PyCode_New(a+k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos) #define __Pyx_DefaultClassType PyClass_Type #else #define __Pyx_BUILTIN_MODULE_NAME "builtins" #define __Pyx_PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)\ PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos) #define __Pyx_DefaultClassType PyType_Type #endif #ifndef Py_TPFLAGS_CHECKTYPES #define Py_TPFLAGS_CHECKTYPES 0 #endif #ifndef Py_TPFLAGS_HAVE_INDEX #define Py_TPFLAGS_HAVE_INDEX 0 #endif #ifndef Py_TPFLAGS_HAVE_NEWBUFFER #define Py_TPFLAGS_HAVE_NEWBUFFER 0 #endif #ifndef Py_TPFLAGS_HAVE_FINALIZE #define Py_TPFLAGS_HAVE_FINALIZE 0 #endif #if PY_VERSION_HEX > 0x03030000 && defined(PyUnicode_KIND) #define CYTHON_PEP393_ENABLED 1 #define __Pyx_PyUnicode_READY(op) (likely(PyUnicode_IS_READY(op)) ?\ 0 : _PyUnicode_Ready((PyObject *)(op))) #define __Pyx_PyUnicode_GET_LENGTH(u) PyUnicode_GET_LENGTH(u) #define __Pyx_PyUnicode_READ_CHAR(u, i) PyUnicode_READ_CHAR(u, i) #define __Pyx_PyUnicode_KIND(u) PyUnicode_KIND(u) #define __Pyx_PyUnicode_DATA(u) PyUnicode_DATA(u) #define __Pyx_PyUnicode_READ(k, d, i) PyUnicode_READ(k, d, i) #else #define CYTHON_PEP393_ENABLED 0 #define __Pyx_PyUnicode_READY(op) (0) #define __Pyx_PyUnicode_GET_LENGTH(u) PyUnicode_GET_SIZE(u) #define __Pyx_PyUnicode_READ_CHAR(u, i) ((Py_UCS4)(PyUnicode_AS_UNICODE(u)[i])) #define __Pyx_PyUnicode_KIND(u) (sizeof(Py_UNICODE)) #define __Pyx_PyUnicode_DATA(u) ((void*)PyUnicode_AS_UNICODE(u)) #define __Pyx_PyUnicode_READ(k, d, i) ((void)(k), (Py_UCS4)(((Py_UNICODE*)d)[i])) #endif #if CYTHON_COMPILING_IN_PYPY #define __Pyx_PyUnicode_Concat(a, b) PyNumber_Add(a, b) #define __Pyx_PyUnicode_ConcatSafe(a, b) PyNumber_Add(a, b) #else #define __Pyx_PyUnicode_Concat(a, b) PyUnicode_Concat(a, b) #define __Pyx_PyUnicode_ConcatSafe(a, b) ((unlikely((a) == Py_None) || unlikely((b) == Py_None)) ?\ PyNumber_Add(a, b) : __Pyx_PyUnicode_Concat(a, b)) #endif #if CYTHON_COMPILING_IN_PYPY && !defined(PyUnicode_Contains) #define PyUnicode_Contains(u, s) PySequence_Contains(u, s) #endif #define __Pyx_PyString_FormatSafe(a, b) ((unlikely((a) == Py_None)) ? PyNumber_Remainder(a, b) : __Pyx_PyString_Format(a, b)) #define __Pyx_PyUnicode_FormatSafe(a, b) ((unlikely((a) == Py_None)) ? PyNumber_Remainder(a, b) : PyUnicode_Format(a, b)) #if PY_MAJOR_VERSION >= 3 #define __Pyx_PyString_Format(a, b) PyUnicode_Format(a, b) #else #define __Pyx_PyString_Format(a, b) PyString_Format(a, b) #endif #if PY_MAJOR_VERSION >= 3 #define PyBaseString_Type PyUnicode_Type #define PyStringObject PyUnicodeObject #define PyString_Type PyUnicode_Type #define PyString_Check PyUnicode_Check #define PyString_CheckExact PyUnicode_CheckExact #endif #if PY_MAJOR_VERSION >= 3 #define __Pyx_PyBaseString_Check(obj) PyUnicode_Check(obj) #define __Pyx_PyBaseString_CheckExact(obj) PyUnicode_CheckExact(obj) #else #define __Pyx_PyBaseString_Check(obj) (PyString_Check(obj) || PyUnicode_Check(obj)) #define __Pyx_PyBaseString_CheckExact(obj) (PyString_CheckExact(obj) || PyUnicode_CheckExact(obj)) #endif #ifndef PySet_CheckExact #define PySet_CheckExact(obj) (Py_TYPE(obj) == &PySet_Type) #endif #define __Pyx_TypeCheck(obj, type) PyObject_TypeCheck(obj, (PyTypeObject *)type) #if PY_MAJOR_VERSION >= 3 #define PyIntObject PyLongObject #define PyInt_Type PyLong_Type #define PyInt_Check(op) PyLong_Check(op) #define PyInt_CheckExact(op) PyLong_CheckExact(op) #define PyInt_FromString PyLong_FromString #define PyInt_FromUnicode PyLong_FromUnicode #define PyInt_FromLong PyLong_FromLong #define PyInt_FromSize_t PyLong_FromSize_t #define PyInt_FromSsize_t PyLong_FromSsize_t #define PyInt_AsLong PyLong_AsLong #define PyInt_AS_LONG PyLong_AS_LONG #define PyInt_AsSsize_t PyLong_AsSsize_t #define PyInt_AsUnsignedLongMask PyLong_AsUnsignedLongMask #define PyInt_AsUnsignedLongLongMask PyLong_AsUnsignedLongLongMask #define PyNumber_Int PyNumber_Long #endif #if PY_MAJOR_VERSION >= 3 #define PyBoolObject PyLongObject #endif #if PY_MAJOR_VERSION >= 3 && CYTHON_COMPILING_IN_PYPY #ifndef PyUnicode_InternFromString #define PyUnicode_InternFromString(s) PyUnicode_FromString(s) #endif #endif #if PY_VERSION_HEX < 0x030200A4 typedef long Py_hash_t; #define __Pyx_PyInt_FromHash_t PyInt_FromLong #define __Pyx_PyInt_AsHash_t PyInt_AsLong #else #define __Pyx_PyInt_FromHash_t PyInt_FromSsize_t #define __Pyx_PyInt_AsHash_t PyInt_AsSsize_t #endif #if PY_MAJOR_VERSION >= 3 #define __Pyx_PyMethod_New(func, self, klass) ((self) ? PyMethod_New(func, self) : PyInstanceMethod_New(func)) #else #define __Pyx_PyMethod_New(func, self, klass) PyMethod_New(func, self, klass) #endif #if PY_VERSION_HEX >= 0x030500B1 #define __Pyx_PyAsyncMethodsStruct PyAsyncMethods #define __Pyx_PyType_AsAsync(obj) (Py_TYPE(obj)->tp_as_async) #elif CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3 typedef struct { unaryfunc am_await; unaryfunc am_aiter; unaryfunc am_anext; } __Pyx_PyAsyncMethodsStruct; #define __Pyx_PyType_AsAsync(obj) ((__Pyx_PyAsyncMethodsStruct*) (Py_TYPE(obj)->tp_reserved)) #else #define __Pyx_PyType_AsAsync(obj) NULL #endif #ifndef CYTHON_RESTRICT #if defined(__GNUC__) #define CYTHON_RESTRICT __restrict__ #elif defined(_MSC_VER) && _MSC_VER >= 1400 #define CYTHON_RESTRICT __restrict #elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L #define CYTHON_RESTRICT restrict #else #define CYTHON_RESTRICT #endif #endif #define __Pyx_void_to_None(void_result) ((void)(void_result), Py_INCREF(Py_None), Py_None) #ifndef CYTHON_INLINE #if defined(__GNUC__) #define CYTHON_INLINE __inline__ #elif defined(_MSC_VER) #define CYTHON_INLINE __inline #elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L #define CYTHON_INLINE inline #else #define CYTHON_INLINE #endif #endif #if defined(WIN32) || defined(MS_WINDOWS) #define _USE_MATH_DEFINES #endif #include #ifdef NAN #define __PYX_NAN() ((float) NAN) #else static CYTHON_INLINE float __PYX_NAN() { float value; memset(&value, 0xFF, sizeof(value)); return value; } #endif #if PY_MAJOR_VERSION >= 3 #define __Pyx_PyNumber_Divide(x,y) PyNumber_TrueDivide(x,y) #define __Pyx_PyNumber_InPlaceDivide(x,y) PyNumber_InPlaceTrueDivide(x,y) #else #define __Pyx_PyNumber_Divide(x,y) PyNumber_TrueDivide(x,y) #define __Pyx_PyNumber_InPlaceDivide(x,y) PyNumber_InPlaceTrueDivide(x,y) #endif #ifndef __PYX_EXTERN_C #ifdef __cplusplus #define __PYX_EXTERN_C extern "C" #else #define __PYX_EXTERN_C extern #endif #endif #define __PYX_HAVE__pygame_sdl2__gfxdraw #define __PYX_HAVE_API__pygame_sdl2__gfxdraw #include "stdint.h" #include "string.h" #include "stdio.h" #include "stddef.h" #include "SDL.h" #include "SDL2_rotozoom.h" #include "SDL_gfxPrimitives.h" #include "stdlib.h" #ifdef _OPENMP #include #endif /* _OPENMP */ #ifdef PYREX_WITHOUT_ASSERTIONS #define CYTHON_WITHOUT_ASSERTIONS #endif #ifndef CYTHON_UNUSED # if defined(__GNUC__) # if !(defined(__cplusplus)) || (__GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 4)) # define CYTHON_UNUSED __attribute__ ((__unused__)) # else # define CYTHON_UNUSED # endif # elif defined(__ICC) || (defined(__INTEL_COMPILER) && !defined(_MSC_VER)) # define CYTHON_UNUSED __attribute__ ((__unused__)) # else # define CYTHON_UNUSED # endif #endif #ifndef CYTHON_NCP_UNUSED # if CYTHON_COMPILING_IN_CPYTHON # define CYTHON_NCP_UNUSED # else # define CYTHON_NCP_UNUSED CYTHON_UNUSED # endif #endif typedef struct {PyObject **p; char *s; const Py_ssize_t n; const char* encoding; const char is_unicode; const char is_str; const char intern; } __Pyx_StringTabEntry; #define __PYX_DEFAULT_STRING_ENCODING_IS_ASCII 0 #define __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT 0 #define __PYX_DEFAULT_STRING_ENCODING "" #define __Pyx_PyObject_FromString __Pyx_PyBytes_FromString #define __Pyx_PyObject_FromStringAndSize __Pyx_PyBytes_FromStringAndSize #define __Pyx_uchar_cast(c) ((unsigned char)c) #define __Pyx_long_cast(x) ((long)x) #define __Pyx_fits_Py_ssize_t(v, type, is_signed) (\ (sizeof(type) < sizeof(Py_ssize_t)) ||\ (sizeof(type) > sizeof(Py_ssize_t) &&\ likely(v < (type)PY_SSIZE_T_MAX ||\ v == (type)PY_SSIZE_T_MAX) &&\ (!is_signed || likely(v > (type)PY_SSIZE_T_MIN ||\ v == (type)PY_SSIZE_T_MIN))) ||\ (sizeof(type) == sizeof(Py_ssize_t) &&\ (is_signed || likely(v < (type)PY_SSIZE_T_MAX ||\ v == (type)PY_SSIZE_T_MAX))) ) #if defined (__cplusplus) && __cplusplus >= 201103L #include #define __Pyx_sst_abs(value) std::abs(value) #elif SIZEOF_INT >= SIZEOF_SIZE_T #define __Pyx_sst_abs(value) abs(value) #elif SIZEOF_LONG >= SIZEOF_SIZE_T #define __Pyx_sst_abs(value) labs(value) #elif defined (_MSC_VER) && defined (_M_X64) #define __Pyx_sst_abs(value) _abs64(value) #elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L #define __Pyx_sst_abs(value) llabs(value) #elif defined (__GNUC__) #define __Pyx_sst_abs(value) __builtin_llabs(value) #else #define __Pyx_sst_abs(value) ((value<0) ? -value : value) #endif static CYTHON_INLINE char* __Pyx_PyObject_AsString(PyObject*); static CYTHON_INLINE char* __Pyx_PyObject_AsStringAndSize(PyObject*, Py_ssize_t* length); #define __Pyx_PyByteArray_FromString(s) PyByteArray_FromStringAndSize((const char*)s, strlen((const char*)s)) #define __Pyx_PyByteArray_FromStringAndSize(s, l) PyByteArray_FromStringAndSize((const char*)s, l) #define __Pyx_PyBytes_FromString PyBytes_FromString #define __Pyx_PyBytes_FromStringAndSize PyBytes_FromStringAndSize static CYTHON_INLINE PyObject* __Pyx_PyUnicode_FromString(const char*); #if PY_MAJOR_VERSION < 3 #define __Pyx_PyStr_FromString __Pyx_PyBytes_FromString #define __Pyx_PyStr_FromStringAndSize __Pyx_PyBytes_FromStringAndSize #else #define __Pyx_PyStr_FromString __Pyx_PyUnicode_FromString #define __Pyx_PyStr_FromStringAndSize __Pyx_PyUnicode_FromStringAndSize #endif #define __Pyx_PyObject_AsSString(s) ((signed char*) __Pyx_PyObject_AsString(s)) #define __Pyx_PyObject_AsUString(s) ((unsigned char*) __Pyx_PyObject_AsString(s)) #define __Pyx_PyObject_FromCString(s) __Pyx_PyObject_FromString((const char*)s) #define __Pyx_PyBytes_FromCString(s) __Pyx_PyBytes_FromString((const char*)s) #define __Pyx_PyByteArray_FromCString(s) __Pyx_PyByteArray_FromString((const char*)s) #define __Pyx_PyStr_FromCString(s) __Pyx_PyStr_FromString((const char*)s) #define __Pyx_PyUnicode_FromCString(s) __Pyx_PyUnicode_FromString((const char*)s) #if PY_MAJOR_VERSION < 3 static CYTHON_INLINE size_t __Pyx_Py_UNICODE_strlen(const Py_UNICODE *u) { const Py_UNICODE *u_end = u; while (*u_end++) ; return (size_t)(u_end - u - 1); } #else #define __Pyx_Py_UNICODE_strlen Py_UNICODE_strlen #endif #define __Pyx_PyUnicode_FromUnicode(u) PyUnicode_FromUnicode(u, __Pyx_Py_UNICODE_strlen(u)) #define __Pyx_PyUnicode_FromUnicodeAndLength PyUnicode_FromUnicode #define __Pyx_PyUnicode_AsUnicode PyUnicode_AsUnicode #define __Pyx_NewRef(obj) (Py_INCREF(obj), obj) #define __Pyx_Owned_Py_None(b) __Pyx_NewRef(Py_None) #define __Pyx_PyBool_FromLong(b) ((b) ? __Pyx_NewRef(Py_True) : __Pyx_NewRef(Py_False)) static CYTHON_INLINE int __Pyx_PyObject_IsTrue(PyObject*); static CYTHON_INLINE PyObject* __Pyx_PyNumber_Int(PyObject* x); static CYTHON_INLINE Py_ssize_t __Pyx_PyIndex_AsSsize_t(PyObject*); static CYTHON_INLINE PyObject * __Pyx_PyInt_FromSize_t(size_t); #if CYTHON_COMPILING_IN_CPYTHON #define __pyx_PyFloat_AsDouble(x) (PyFloat_CheckExact(x) ? PyFloat_AS_DOUBLE(x) : PyFloat_AsDouble(x)) #else #define __pyx_PyFloat_AsDouble(x) PyFloat_AsDouble(x) #endif #define __pyx_PyFloat_AsFloat(x) ((float) __pyx_PyFloat_AsDouble(x)) #if PY_MAJOR_VERSION < 3 && __PYX_DEFAULT_STRING_ENCODING_IS_ASCII static int __Pyx_sys_getdefaultencoding_not_ascii; static int __Pyx_init_sys_getdefaultencoding_params(void) { PyObject* sys; PyObject* default_encoding = NULL; PyObject* ascii_chars_u = NULL; PyObject* ascii_chars_b = NULL; const char* default_encoding_c; sys = PyImport_ImportModule("sys"); if (!sys) goto bad; default_encoding = PyObject_CallMethod(sys, (char*) "getdefaultencoding", NULL); Py_DECREF(sys); if (!default_encoding) goto bad; default_encoding_c = PyBytes_AsString(default_encoding); if (!default_encoding_c) goto bad; if (strcmp(default_encoding_c, "ascii") == 0) { __Pyx_sys_getdefaultencoding_not_ascii = 0; } else { char ascii_chars[128]; int c; for (c = 0; c < 128; c++) { ascii_chars[c] = c; } __Pyx_sys_getdefaultencoding_not_ascii = 1; ascii_chars_u = PyUnicode_DecodeASCII(ascii_chars, 128, NULL); if (!ascii_chars_u) goto bad; ascii_chars_b = PyUnicode_AsEncodedString(ascii_chars_u, default_encoding_c, NULL); if (!ascii_chars_b || !PyBytes_Check(ascii_chars_b) || memcmp(ascii_chars, PyBytes_AS_STRING(ascii_chars_b), 128) != 0) { PyErr_Format( PyExc_ValueError, "This module compiled with c_string_encoding=ascii, but default encoding '%.200s' is not a superset of ascii.", default_encoding_c); goto bad; } Py_DECREF(ascii_chars_u); Py_DECREF(ascii_chars_b); } Py_DECREF(default_encoding); return 0; bad: Py_XDECREF(default_encoding); Py_XDECREF(ascii_chars_u); Py_XDECREF(ascii_chars_b); return -1; } #endif #if __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT && PY_MAJOR_VERSION >= 3 #define __Pyx_PyUnicode_FromStringAndSize(c_str, size) PyUnicode_DecodeUTF8(c_str, size, NULL) #else #define __Pyx_PyUnicode_FromStringAndSize(c_str, size) PyUnicode_Decode(c_str, size, __PYX_DEFAULT_STRING_ENCODING, NULL) #if __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT static char* __PYX_DEFAULT_STRING_ENCODING; static int __Pyx_init_sys_getdefaultencoding_params(void) { PyObject* sys; PyObject* default_encoding = NULL; char* default_encoding_c; sys = PyImport_ImportModule("sys"); if (!sys) goto bad; default_encoding = PyObject_CallMethod(sys, (char*) (const char*) "getdefaultencoding", NULL); Py_DECREF(sys); if (!default_encoding) goto bad; default_encoding_c = PyBytes_AsString(default_encoding); if (!default_encoding_c) goto bad; __PYX_DEFAULT_STRING_ENCODING = (char*) malloc(strlen(default_encoding_c)); if (!__PYX_DEFAULT_STRING_ENCODING) goto bad; strcpy(__PYX_DEFAULT_STRING_ENCODING, default_encoding_c); Py_DECREF(default_encoding); return 0; bad: Py_XDECREF(default_encoding); return -1; } #endif #endif /* Test for GCC > 2.95 */ #if defined(__GNUC__) && (__GNUC__ > 2 || (__GNUC__ == 2 && (__GNUC_MINOR__ > 95))) #define likely(x) __builtin_expect(!!(x), 1) #define unlikely(x) __builtin_expect(!!(x), 0) #else /* !__GNUC__ or GCC < 2.95 */ #define likely(x) (x) #define unlikely(x) (x) #endif /* __GNUC__ */ static PyObject *__pyx_m; static PyObject *__pyx_d; static PyObject *__pyx_b; static PyObject *__pyx_empty_tuple; static PyObject *__pyx_empty_bytes; static int __pyx_lineno; static int __pyx_clineno = 0; static const char * __pyx_cfilenm= __FILE__; static const char *__pyx_filename; static const char *__pyx_f[] = { "src/pygame_sdl2/gfxdraw.pyx", "src/pygame_sdl2/surface.pxd", "src/pygame_sdl2/color.pxd", }; /*--- Type declarations ---*/ struct __pyx_obj_11pygame_sdl2_7surface_Surface; struct __pyx_obj_11pygame_sdl2_5color_Color; /* "pygame_sdl2/surface.pxd":23 * from sdl2 cimport SDL_Surface * * cdef class Surface: # <<<<<<<<<<<<<< * # Allow weak references. * cdef object __weakref__ */ struct __pyx_obj_11pygame_sdl2_7surface_Surface { PyObject_HEAD struct __pyx_vtabstruct_11pygame_sdl2_7surface_Surface *__pyx_vtab; PyObject *__weakref__; SDL_Surface *surface; int owns_surface; int window_surface; PyObject *locklist; struct __pyx_obj_11pygame_sdl2_7surface_Surface *parent; struct __pyx_obj_11pygame_sdl2_7surface_Surface *root; int offset_x; int offset_y; PyObject *get_window_flags; int has_alpha; }; /* "pygame_sdl2/color.pxd":26 * cdef to_sdl_color(color, SDL_Color *out) * * cdef class Color: # <<<<<<<<<<<<<< * # Allow weak references. * cdef object __weakref__ */ struct __pyx_obj_11pygame_sdl2_5color_Color { PyObject_HEAD struct __pyx_vtabstruct_11pygame_sdl2_5color_Color *__pyx_vtab; PyObject *__weakref__; Uint8 r; Uint8 g; Uint8 b; Uint8 a; uint8_t length; }; /* "pygame_sdl2/surface.pxd":23 * from sdl2 cimport SDL_Surface * * cdef class Surface: # <<<<<<<<<<<<<< * # Allow weak references. * cdef object __weakref__ */ struct __pyx_vtabstruct_11pygame_sdl2_7surface_Surface { void (*take_surface)(struct __pyx_obj_11pygame_sdl2_7surface_Surface *, SDL_Surface *); }; static struct __pyx_vtabstruct_11pygame_sdl2_7surface_Surface *__pyx_vtabptr_11pygame_sdl2_7surface_Surface; /* "pygame_sdl2/color.pxd":26 * cdef to_sdl_color(color, SDL_Color *out) * * cdef class Color: # <<<<<<<<<<<<<< * # Allow weak references. * cdef object __weakref__ */ struct __pyx_vtabstruct_11pygame_sdl2_5color_Color { PyObject *(*from_rgba)(struct __pyx_obj_11pygame_sdl2_5color_Color *, Uint8, Uint8, Uint8, Uint8); PyObject *(*from_name)(struct __pyx_obj_11pygame_sdl2_5color_Color *, PyObject *); PyObject *(*from_hex)(struct __pyx_obj_11pygame_sdl2_5color_Color *, PyObject *); }; static struct __pyx_vtabstruct_11pygame_sdl2_5color_Color *__pyx_vtabptr_11pygame_sdl2_5color_Color; /* --- Runtime support code (head) --- */ #ifndef CYTHON_REFNANNY #define CYTHON_REFNANNY 0 #endif #if CYTHON_REFNANNY typedef struct { void (*INCREF)(void*, PyObject*, int); void (*DECREF)(void*, PyObject*, int); void (*GOTREF)(void*, PyObject*, int); void (*GIVEREF)(void*, PyObject*, int); void* (*SetupContext)(const char*, int, const char*); void (*FinishContext)(void**); } __Pyx_RefNannyAPIStruct; static __Pyx_RefNannyAPIStruct *__Pyx_RefNanny = NULL; static __Pyx_RefNannyAPIStruct *__Pyx_RefNannyImportAPI(const char *modname); #define __Pyx_RefNannyDeclarations void *__pyx_refnanny = NULL; #ifdef WITH_THREAD #define __Pyx_RefNannySetupContext(name, acquire_gil)\ if (acquire_gil) {\ PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure();\ __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), __LINE__, __FILE__);\ PyGILState_Release(__pyx_gilstate_save);\ } else {\ __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), __LINE__, __FILE__);\ } #else #define __Pyx_RefNannySetupContext(name, acquire_gil)\ __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), __LINE__, __FILE__) #endif #define __Pyx_RefNannyFinishContext()\ __Pyx_RefNanny->FinishContext(&__pyx_refnanny) #define __Pyx_INCREF(r) __Pyx_RefNanny->INCREF(__pyx_refnanny, (PyObject *)(r), __LINE__) #define __Pyx_DECREF(r) __Pyx_RefNanny->DECREF(__pyx_refnanny, (PyObject *)(r), __LINE__) #define __Pyx_GOTREF(r) __Pyx_RefNanny->GOTREF(__pyx_refnanny, (PyObject *)(r), __LINE__) #define __Pyx_GIVEREF(r) __Pyx_RefNanny->GIVEREF(__pyx_refnanny, (PyObject *)(r), __LINE__) #define __Pyx_XINCREF(r) do { if((r) != NULL) {__Pyx_INCREF(r); }} while(0) #define __Pyx_XDECREF(r) do { if((r) != NULL) {__Pyx_DECREF(r); }} while(0) #define __Pyx_XGOTREF(r) do { if((r) != NULL) {__Pyx_GOTREF(r); }} while(0) #define __Pyx_XGIVEREF(r) do { if((r) != NULL) {__Pyx_GIVEREF(r);}} while(0) #else #define __Pyx_RefNannyDeclarations #define __Pyx_RefNannySetupContext(name, acquire_gil) #define __Pyx_RefNannyFinishContext() #define __Pyx_INCREF(r) Py_INCREF(r) #define __Pyx_DECREF(r) Py_DECREF(r) #define __Pyx_GOTREF(r) #define __Pyx_GIVEREF(r) #define __Pyx_XINCREF(r) Py_XINCREF(r) #define __Pyx_XDECREF(r) Py_XDECREF(r) #define __Pyx_XGOTREF(r) #define __Pyx_XGIVEREF(r) #endif #define __Pyx_XDECREF_SET(r, v) do {\ PyObject *tmp = (PyObject *) r;\ r = v; __Pyx_XDECREF(tmp);\ } while (0) #define __Pyx_DECREF_SET(r, v) do {\ PyObject *tmp = (PyObject *) r;\ r = v; __Pyx_DECREF(tmp);\ } while (0) #define __Pyx_CLEAR(r) do { PyObject* tmp = ((PyObject*)(r)); r = NULL; __Pyx_DECREF(tmp);} while(0) #define __Pyx_XCLEAR(r) do { if((r) != NULL) {PyObject* tmp = ((PyObject*)(r)); r = NULL; __Pyx_DECREF(tmp);}} while(0) #if CYTHON_COMPILING_IN_CPYTHON static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStr(PyObject* obj, PyObject* attr_name) { PyTypeObject* tp = Py_TYPE(obj); if (likely(tp->tp_getattro)) return tp->tp_getattro(obj, attr_name); #if PY_MAJOR_VERSION < 3 if (likely(tp->tp_getattr)) return tp->tp_getattr(obj, PyString_AS_STRING(attr_name)); #endif return PyObject_GetAttr(obj, attr_name); } #else #define __Pyx_PyObject_GetAttrStr(o,n) PyObject_GetAttr(o,n) #endif static PyObject *__Pyx_GetBuiltinName(PyObject *name); static void __Pyx_RaiseArgtupleInvalid(const char* func_name, int exact, Py_ssize_t num_min, Py_ssize_t num_max, Py_ssize_t num_found); static void __Pyx_RaiseDoubleKeywordsError(const char* func_name, PyObject* kw_name); static int __Pyx_ParseOptionalKeywords(PyObject *kwds, PyObject **argnames[],\ PyObject *kwds2, PyObject *values[], Py_ssize_t num_pos_args,\ const char* function_name); static CYTHON_INLINE int __Pyx_ArgTypeTest(PyObject *obj, PyTypeObject *type, int none_allowed, const char *name, int exact); #if CYTHON_COMPILING_IN_CPYTHON static CYTHON_INLINE PyObject* __Pyx_PyObject_Call(PyObject *func, PyObject *arg, PyObject *kw); #else #define __Pyx_PyObject_Call(func, arg, kw) PyObject_Call(func, arg, kw) #endif static CYTHON_INLINE PyObject *__Pyx_GetModuleGlobalName(PyObject *name); #if CYTHON_COMPILING_IN_CPYTHON static CYTHON_INLINE PyObject* __Pyx_PyObject_CallMethO(PyObject *func, PyObject *arg); #endif static CYTHON_INLINE PyObject* __Pyx_PyObject_CallOneArg(PyObject *func, PyObject *arg); static CYTHON_INLINE void __Pyx_RaiseTooManyValuesError(Py_ssize_t expected); static CYTHON_INLINE void __Pyx_RaiseNeedMoreValuesError(Py_ssize_t index); static CYTHON_INLINE int __Pyx_IterFinish(void); static int __Pyx_IternextUnpackEndCheck(PyObject *retval, Py_ssize_t expected); static void* __Pyx_GetVtable(PyObject *dict); static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list, int level); static PyObject* __Pyx_ImportFrom(PyObject* module, PyObject* name); typedef struct { int code_line; PyCodeObject* code_object; } __Pyx_CodeObjectCacheEntry; struct __Pyx_CodeObjectCache { int count; int max_count; __Pyx_CodeObjectCacheEntry* entries; }; static struct __Pyx_CodeObjectCache __pyx_code_cache = {0,0,NULL}; static int __pyx_bisect_code_objects(__Pyx_CodeObjectCacheEntry* entries, int count, int code_line); static PyCodeObject *__pyx_find_code_object(int code_line); static void __pyx_insert_code_object(int code_line, PyCodeObject* code_object); static void __Pyx_AddTraceback(const char *funcname, int c_line, int py_line, const char *filename); static CYTHON_INLINE int16_t __Pyx_PyInt_As_int16_t(PyObject *); static CYTHON_INLINE int __Pyx_PyInt_As_int(PyObject *); static CYTHON_INLINE uint8_t __Pyx_PyInt_As_uint8_t(PyObject *); static CYTHON_INLINE PyObject* __Pyx_PyInt_From_long(long value); static CYTHON_INLINE long __Pyx_PyInt_As_long(PyObject *); static int __Pyx_check_binary_version(void); #if !defined(__Pyx_PyIdentifier_FromString) #if PY_MAJOR_VERSION < 3 #define __Pyx_PyIdentifier_FromString(s) PyString_FromString(s) #else #define __Pyx_PyIdentifier_FromString(s) PyUnicode_FromString(s) #endif #endif static PyObject *__Pyx_ImportModule(const char *name); static PyTypeObject *__Pyx_ImportType(const char *module_name, const char *class_name, size_t size, int strict); static int __Pyx_InitStrings(__Pyx_StringTabEntry *t); /* Module declarations from 'libc.stdint' */ /* Module declarations from 'libc.string' */ /* Module declarations from 'libc.stdio' */ /* Module declarations from 'libc.stddef' */ /* Module declarations from 'sdl2' */ /* Module declarations from 'sdl2_gfx' */ /* Module declarations from 'libc.stdlib' */ /* Module declarations from 'pygame_sdl2.surface' */ static PyTypeObject *__pyx_ptype_11pygame_sdl2_7surface_Surface = 0; /* Module declarations from 'pygame_sdl2.color' */ static PyTypeObject *__pyx_ptype_11pygame_sdl2_5color_Color = 0; /* Module declarations from 'pygame_sdl2.gfxdraw' */ #define __Pyx_MODULE_NAME "pygame_sdl2.gfxdraw" int __pyx_module_is_main_pygame_sdl2__gfxdraw = 0; /* Implementation of 'pygame_sdl2.gfxdraw' */ static PyObject *__pyx_builtin_zip; static PyObject *__pyx_builtin_range; static char __pyx_k_c[] = "c"; static char __pyx_k_h[] = "h"; static char __pyx_k_n[] = "n"; static char __pyx_k_r[] = "r"; static char __pyx_k_w[] = "w"; static char __pyx_k_x[] = "x"; static char __pyx_k_y[] = "y"; static char __pyx_k_pt[] = "pt"; static char __pyx_k_rx[] = "rx"; static char __pyx_k_ry[] = "ry"; static char __pyx_k_tx[] = "tx"; static char __pyx_k_ty[] = "ty"; static char __pyx_k_vx[] = "vx"; static char __pyx_k_vy[] = "vy"; static char __pyx_k_x1[] = "x1"; static char __pyx_k_x2[] = "x2"; static char __pyx_k_x3[] = "x3"; static char __pyx_k_y1[] = "y1"; static char __pyx_k_y2[] = "y2"; static char __pyx_k_y3[] = "y3"; static char __pyx_k_arc[] = "arc"; static char __pyx_k_box[] = "box"; static char __pyx_k_end[] = "end"; static char __pyx_k_pie[] = "pie"; static char __pyx_k_rad[] = "rad"; static char __pyx_k_zip[] = "zip"; static char __pyx_k_Rect[] = "Rect"; static char __pyx_k_line[] = "line"; static char __pyx_k_main[] = "__main__"; static char __pyx_k_rect[] = "rect"; static char __pyx_k_test[] = "__test__"; static char __pyx_k_color[] = "color"; static char __pyx_k_error[] = "error"; static char __pyx_k_hline[] = "hline"; static char __pyx_k_pixel[] = "pixel"; static char __pyx_k_range[] = "range"; static char __pyx_k_start[] = "start"; static char __pyx_k_steps[] = "steps"; static char __pyx_k_vline[] = "vline"; static char __pyx_k_width[] = "width"; static char __pyx_k_x1int[] = "x1int"; static char __pyx_k_x2int[] = "x2int"; static char __pyx_k_y1int[] = "y1int"; static char __pyx_k_y2int[] = "y2int"; static char __pyx_k_aaline[] = "aaline"; static char __pyx_k_bezier[] = "bezier"; static char __pyx_k_circle[] = "circle"; static char __pyx_k_import[] = "__import__"; static char __pyx_k_points[] = "points"; static char __pyx_k_trigon[] = "trigon"; static char __pyx_k_ellipse[] = "ellipse"; static char __pyx_k_polygon[] = "polygon"; static char __pyx_k_surface[] = "surface"; static char __pyx_k_texture[] = "texture"; static char __pyx_k_aacircle[] = "aacircle"; static char __pyx_k_aatrigon[] = "aatrigon"; static char __pyx_k_aaellipse[] = "aaellipse"; static char __pyx_k_aapolygon[] = "aapolygon"; static char __pyx_k_rectangle[] = "rectangle"; static char __pyx_k_filled_pie[] = "filled_pie"; static char __pyx_k_num_points[] = "num_points"; static char __pyx_k_pyx_vtable[] = "__pyx_vtable__"; static char __pyx_k_thick_line[] = "thick_line"; static char __pyx_k_rounded_box[] = "rounded_box"; static char __pyx_k_filled_circle[] = "filled_circle"; static char __pyx_k_filled_trigon[] = "filled_trigon"; static char __pyx_k_filled_ellipse[] = "filled_ellipse"; static char __pyx_k_filled_polygon[] = "filled_polygon"; static char __pyx_k_pygame_sdl2_rect[] = "pygame_sdl2.rect"; static char __pyx_k_textured_polygon[] = "textured_polygon"; static char __pyx_k_pygame_sdl2_error[] = "pygame_sdl2.error"; static char __pyx_k_rounded_rectangle[] = "rounded_rectangle"; static char __pyx_k_pygame_sdl2_gfxdraw[] = "pygame_sdl2.gfxdraw"; static char __pyx_k_home_tom_ab_pygame_sdl2_src_pyg[] = "/home/tom/ab/pygame_sdl2/src/pygame_sdl2/gfxdraw.pyx"; static PyObject *__pyx_n_s_Rect; static PyObject *__pyx_n_s_aacircle; static PyObject *__pyx_n_s_aaellipse; static PyObject *__pyx_n_s_aaline; static PyObject *__pyx_n_s_aapolygon; static PyObject *__pyx_n_s_aatrigon; static PyObject *__pyx_n_s_arc; static PyObject *__pyx_n_s_bezier; static PyObject *__pyx_n_s_box; static PyObject *__pyx_n_s_c; static PyObject *__pyx_n_s_circle; static PyObject *__pyx_n_s_color; static PyObject *__pyx_n_s_ellipse; static PyObject *__pyx_n_s_end; static PyObject *__pyx_n_s_error; static PyObject *__pyx_n_s_filled_circle; static PyObject *__pyx_n_s_filled_ellipse; static PyObject *__pyx_n_s_filled_pie; static PyObject *__pyx_n_s_filled_polygon; static PyObject *__pyx_n_s_filled_trigon; static PyObject *__pyx_n_s_h; static PyObject *__pyx_n_s_hline; static PyObject *__pyx_kp_s_home_tom_ab_pygame_sdl2_src_pyg; static PyObject *__pyx_n_s_import; static PyObject *__pyx_n_s_line; static PyObject *__pyx_n_s_main; static PyObject *__pyx_n_s_n; static PyObject *__pyx_n_s_num_points; static PyObject *__pyx_n_s_pie; static PyObject *__pyx_n_s_pixel; static PyObject *__pyx_n_s_points; static PyObject *__pyx_n_s_polygon; static PyObject *__pyx_n_s_pt; static PyObject *__pyx_n_s_pygame_sdl2_error; static PyObject *__pyx_n_s_pygame_sdl2_gfxdraw; static PyObject *__pyx_n_s_pygame_sdl2_rect; static PyObject *__pyx_n_s_pyx_vtable; static PyObject *__pyx_n_s_r; static PyObject *__pyx_n_s_rad; static PyObject *__pyx_n_s_range; static PyObject *__pyx_n_s_rect; static PyObject *__pyx_n_s_rectangle; static PyObject *__pyx_n_s_rounded_box; static PyObject *__pyx_n_s_rounded_rectangle; static PyObject *__pyx_n_s_rx; static PyObject *__pyx_n_s_ry; static PyObject *__pyx_n_s_start; static PyObject *__pyx_n_s_steps; static PyObject *__pyx_n_s_surface; static PyObject *__pyx_n_s_test; static PyObject *__pyx_n_s_texture; static PyObject *__pyx_n_s_textured_polygon; static PyObject *__pyx_n_s_thick_line; static PyObject *__pyx_n_s_trigon; static PyObject *__pyx_n_s_tx; static PyObject *__pyx_n_s_ty; static PyObject *__pyx_n_s_vline; static PyObject *__pyx_n_s_vx; static PyObject *__pyx_n_s_vy; static PyObject *__pyx_n_s_w; static PyObject *__pyx_n_s_width; static PyObject *__pyx_n_s_x; static PyObject *__pyx_n_s_x1; static PyObject *__pyx_n_s_x1int; static PyObject *__pyx_n_s_x2; static PyObject *__pyx_n_s_x2int; static PyObject *__pyx_n_s_x3; static PyObject *__pyx_n_s_y; static PyObject *__pyx_n_s_y1; static PyObject *__pyx_n_s_y1int; static PyObject *__pyx_n_s_y2; static PyObject *__pyx_n_s_y2int; static PyObject *__pyx_n_s_y3; static PyObject *__pyx_n_s_zip; static PyObject *__pyx_pf_11pygame_sdl2_7gfxdraw_pixel(CYTHON_UNUSED PyObject *__pyx_self, struct __pyx_obj_11pygame_sdl2_7surface_Surface *__pyx_v_surface, PyObject *__pyx_v_x, PyObject *__pyx_v_y, PyObject *__pyx_v_color); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_7gfxdraw_2hline(CYTHON_UNUSED PyObject *__pyx_self, struct __pyx_obj_11pygame_sdl2_7surface_Surface *__pyx_v_surface, PyObject *__pyx_v_x1, PyObject *__pyx_v_x2, PyObject *__pyx_v_y, PyObject *__pyx_v_color); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_7gfxdraw_4vline(CYTHON_UNUSED PyObject *__pyx_self, struct __pyx_obj_11pygame_sdl2_7surface_Surface *__pyx_v_surface, PyObject *__pyx_v_x, PyObject *__pyx_v_y1, PyObject *__pyx_v_y2, PyObject *__pyx_v_color); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_7gfxdraw_6rectangle(CYTHON_UNUSED PyObject *__pyx_self, struct __pyx_obj_11pygame_sdl2_7surface_Surface *__pyx_v_surface, PyObject *__pyx_v_rect, PyObject *__pyx_v_color); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_7gfxdraw_8rounded_rectangle(CYTHON_UNUSED PyObject *__pyx_self, struct __pyx_obj_11pygame_sdl2_7surface_Surface *__pyx_v_surface, PyObject *__pyx_v_rect, PyObject *__pyx_v_rad, PyObject *__pyx_v_color); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_7gfxdraw_10box(CYTHON_UNUSED PyObject *__pyx_self, struct __pyx_obj_11pygame_sdl2_7surface_Surface *__pyx_v_surface, PyObject *__pyx_v_rect, PyObject *__pyx_v_color); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_7gfxdraw_12rounded_box(CYTHON_UNUSED PyObject *__pyx_self, struct __pyx_obj_11pygame_sdl2_7surface_Surface *__pyx_v_surface, PyObject *__pyx_v_rect, PyObject *__pyx_v_rad, PyObject *__pyx_v_color); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_7gfxdraw_14line(CYTHON_UNUSED PyObject *__pyx_self, struct __pyx_obj_11pygame_sdl2_7surface_Surface *__pyx_v_surface, PyObject *__pyx_v_x1, PyObject *__pyx_v_y1, PyObject *__pyx_v_x2, PyObject *__pyx_v_y2, PyObject *__pyx_v_color); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_7gfxdraw_16aaline(CYTHON_UNUSED PyObject *__pyx_self, struct __pyx_obj_11pygame_sdl2_7surface_Surface *__pyx_v_surface, PyObject *__pyx_v_x1, PyObject *__pyx_v_y1, PyObject *__pyx_v_x2, PyObject *__pyx_v_y2, PyObject *__pyx_v_color); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_7gfxdraw_18thick_line(CYTHON_UNUSED PyObject *__pyx_self, struct __pyx_obj_11pygame_sdl2_7surface_Surface *__pyx_v_surface, PyObject *__pyx_v_x1, PyObject *__pyx_v_y1, PyObject *__pyx_v_x2, PyObject *__pyx_v_y2, PyObject *__pyx_v_width, PyObject *__pyx_v_color); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_7gfxdraw_20circle(CYTHON_UNUSED PyObject *__pyx_self, struct __pyx_obj_11pygame_sdl2_7surface_Surface *__pyx_v_surface, PyObject *__pyx_v_x, PyObject *__pyx_v_y, PyObject *__pyx_v_r, PyObject *__pyx_v_color); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_7gfxdraw_22arc(CYTHON_UNUSED PyObject *__pyx_self, struct __pyx_obj_11pygame_sdl2_7surface_Surface *__pyx_v_surface, PyObject *__pyx_v_x, PyObject *__pyx_v_y, PyObject *__pyx_v_r, PyObject *__pyx_v_start, PyObject *__pyx_v_end, PyObject *__pyx_v_color); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_7gfxdraw_24aacircle(CYTHON_UNUSED PyObject *__pyx_self, struct __pyx_obj_11pygame_sdl2_7surface_Surface *__pyx_v_surface, PyObject *__pyx_v_x, PyObject *__pyx_v_y, PyObject *__pyx_v_r, PyObject *__pyx_v_color); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_7gfxdraw_26filled_circle(CYTHON_UNUSED PyObject *__pyx_self, struct __pyx_obj_11pygame_sdl2_7surface_Surface *__pyx_v_surface, PyObject *__pyx_v_x, PyObject *__pyx_v_y, PyObject *__pyx_v_r, PyObject *__pyx_v_color); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_7gfxdraw_28ellipse(CYTHON_UNUSED PyObject *__pyx_self, struct __pyx_obj_11pygame_sdl2_7surface_Surface *__pyx_v_surface, PyObject *__pyx_v_x, PyObject *__pyx_v_y, PyObject *__pyx_v_rx, PyObject *__pyx_v_ry, PyObject *__pyx_v_color); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_7gfxdraw_30aaellipse(CYTHON_UNUSED PyObject *__pyx_self, struct __pyx_obj_11pygame_sdl2_7surface_Surface *__pyx_v_surface, PyObject *__pyx_v_x, PyObject *__pyx_v_y, PyObject *__pyx_v_rx, PyObject *__pyx_v_ry, PyObject *__pyx_v_color); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_7gfxdraw_32filled_ellipse(CYTHON_UNUSED PyObject *__pyx_self, struct __pyx_obj_11pygame_sdl2_7surface_Surface *__pyx_v_surface, PyObject *__pyx_v_x, PyObject *__pyx_v_y, PyObject *__pyx_v_rx, PyObject *__pyx_v_ry, PyObject *__pyx_v_color); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_7gfxdraw_34pie(CYTHON_UNUSED PyObject *__pyx_self, struct __pyx_obj_11pygame_sdl2_7surface_Surface *__pyx_v_surface, PyObject *__pyx_v_x, PyObject *__pyx_v_y, PyObject *__pyx_v_r, PyObject *__pyx_v_start, PyObject *__pyx_v_end, PyObject *__pyx_v_color); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_7gfxdraw_36filled_pie(CYTHON_UNUSED PyObject *__pyx_self, struct __pyx_obj_11pygame_sdl2_7surface_Surface *__pyx_v_surface, PyObject *__pyx_v_x, PyObject *__pyx_v_y, PyObject *__pyx_v_r, PyObject *__pyx_v_start, PyObject *__pyx_v_end, PyObject *__pyx_v_color); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_7gfxdraw_38trigon(CYTHON_UNUSED PyObject *__pyx_self, struct __pyx_obj_11pygame_sdl2_7surface_Surface *__pyx_v_surface, PyObject *__pyx_v_x1, PyObject *__pyx_v_y1, PyObject *__pyx_v_x2, PyObject *__pyx_v_y2, PyObject *__pyx_v_x3, PyObject *__pyx_v_y3, PyObject *__pyx_v_color); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_7gfxdraw_40aatrigon(CYTHON_UNUSED PyObject *__pyx_self, struct __pyx_obj_11pygame_sdl2_7surface_Surface *__pyx_v_surface, PyObject *__pyx_v_x1, PyObject *__pyx_v_y1, PyObject *__pyx_v_x2, PyObject *__pyx_v_y2, PyObject *__pyx_v_x3, PyObject *__pyx_v_y3, PyObject *__pyx_v_color); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_7gfxdraw_42filled_trigon(CYTHON_UNUSED PyObject *__pyx_self, struct __pyx_obj_11pygame_sdl2_7surface_Surface *__pyx_v_surface, PyObject *__pyx_v_x1, PyObject *__pyx_v_y1, PyObject *__pyx_v_x2, PyObject *__pyx_v_y2, PyObject *__pyx_v_x3, PyObject *__pyx_v_y3, PyObject *__pyx_v_color); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_7gfxdraw_44polygon(CYTHON_UNUSED PyObject *__pyx_self, struct __pyx_obj_11pygame_sdl2_7surface_Surface *__pyx_v_surface, PyObject *__pyx_v_points, PyObject *__pyx_v_color); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_7gfxdraw_46aapolygon(CYTHON_UNUSED PyObject *__pyx_self, struct __pyx_obj_11pygame_sdl2_7surface_Surface *__pyx_v_surface, PyObject *__pyx_v_points, PyObject *__pyx_v_color); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_7gfxdraw_48filled_polygon(CYTHON_UNUSED PyObject *__pyx_self, struct __pyx_obj_11pygame_sdl2_7surface_Surface *__pyx_v_surface, PyObject *__pyx_v_points, PyObject *__pyx_v_color); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_7gfxdraw_50textured_polygon(CYTHON_UNUSED PyObject *__pyx_self, struct __pyx_obj_11pygame_sdl2_7surface_Surface *__pyx_v_surface, PyObject *__pyx_v_points, struct __pyx_obj_11pygame_sdl2_7surface_Surface *__pyx_v_texture, PyObject *__pyx_v_tx, PyObject *__pyx_v_ty); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_7gfxdraw_52bezier(CYTHON_UNUSED PyObject *__pyx_self, struct __pyx_obj_11pygame_sdl2_7surface_Surface *__pyx_v_surface, PyObject *__pyx_v_points, PyObject *__pyx_v_steps, PyObject *__pyx_v_color); /* proto */ static PyObject *__pyx_tuple_; static PyObject *__pyx_tuple__3; static PyObject *__pyx_tuple__5; static PyObject *__pyx_tuple__7; static PyObject *__pyx_tuple__9; static PyObject *__pyx_tuple__11; static PyObject *__pyx_tuple__13; static PyObject *__pyx_tuple__15; static PyObject *__pyx_tuple__17; static PyObject *__pyx_tuple__19; static PyObject *__pyx_tuple__21; static PyObject *__pyx_tuple__23; static PyObject *__pyx_tuple__25; static PyObject *__pyx_tuple__27; static PyObject *__pyx_tuple__29; static PyObject *__pyx_tuple__31; static PyObject *__pyx_tuple__33; static PyObject *__pyx_tuple__35; static PyObject *__pyx_tuple__37; static PyObject *__pyx_tuple__39; static PyObject *__pyx_tuple__41; static PyObject *__pyx_tuple__43; static PyObject *__pyx_tuple__45; static PyObject *__pyx_tuple__47; static PyObject *__pyx_tuple__49; static PyObject *__pyx_tuple__51; static PyObject *__pyx_tuple__53; static PyObject *__pyx_codeobj__2; static PyObject *__pyx_codeobj__4; static PyObject *__pyx_codeobj__6; static PyObject *__pyx_codeobj__8; static PyObject *__pyx_codeobj__10; static PyObject *__pyx_codeobj__12; static PyObject *__pyx_codeobj__14; static PyObject *__pyx_codeobj__16; static PyObject *__pyx_codeobj__18; static PyObject *__pyx_codeobj__20; static PyObject *__pyx_codeobj__22; static PyObject *__pyx_codeobj__24; static PyObject *__pyx_codeobj__26; static PyObject *__pyx_codeobj__28; static PyObject *__pyx_codeobj__30; static PyObject *__pyx_codeobj__32; static PyObject *__pyx_codeobj__34; static PyObject *__pyx_codeobj__36; static PyObject *__pyx_codeobj__38; static PyObject *__pyx_codeobj__40; static PyObject *__pyx_codeobj__42; static PyObject *__pyx_codeobj__44; static PyObject *__pyx_codeobj__46; static PyObject *__pyx_codeobj__48; static PyObject *__pyx_codeobj__50; static PyObject *__pyx_codeobj__52; static PyObject *__pyx_codeobj__54; /* "pygame_sdl2/gfxdraw.pyx":29 * * * def pixel(Surface surface, x, y, color): # <<<<<<<<<<<<<< * cdef Color c = Color(color) * pixelRGBA(surface.surface, x, y, c.r, c.g, c.b, c.a) */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_7gfxdraw_1pixel(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static PyMethodDef __pyx_mdef_11pygame_sdl2_7gfxdraw_1pixel = {"pixel", (PyCFunction)__pyx_pw_11pygame_sdl2_7gfxdraw_1pixel, METH_VARARGS|METH_KEYWORDS, 0}; static PyObject *__pyx_pw_11pygame_sdl2_7gfxdraw_1pixel(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { struct __pyx_obj_11pygame_sdl2_7surface_Surface *__pyx_v_surface = 0; PyObject *__pyx_v_x = 0; PyObject *__pyx_v_y = 0; PyObject *__pyx_v_color = 0; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("pixel (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_surface,&__pyx_n_s_x,&__pyx_n_s_y,&__pyx_n_s_color,0}; PyObject* values[4] = {0,0,0,0}; if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_surface)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; case 1: if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_x)) != 0)) kw_args--; else { __Pyx_RaiseArgtupleInvalid("pixel", 1, 4, 4, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 29; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } case 2: if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_y)) != 0)) kw_args--; else { __Pyx_RaiseArgtupleInvalid("pixel", 1, 4, 4, 2); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 29; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } case 3: if (likely((values[3] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_color)) != 0)) kw_args--; else { __Pyx_RaiseArgtupleInvalid("pixel", 1, 4, 4, 3); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 29; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "pixel") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 29; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } } else if (PyTuple_GET_SIZE(__pyx_args) != 4) { goto __pyx_L5_argtuple_error; } else { values[0] = PyTuple_GET_ITEM(__pyx_args, 0); values[1] = PyTuple_GET_ITEM(__pyx_args, 1); values[2] = PyTuple_GET_ITEM(__pyx_args, 2); values[3] = PyTuple_GET_ITEM(__pyx_args, 3); } __pyx_v_surface = ((struct __pyx_obj_11pygame_sdl2_7surface_Surface *)values[0]); __pyx_v_x = values[1]; __pyx_v_y = values[2]; __pyx_v_color = values[3]; } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("pixel", 1, 4, 4, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 29; __pyx_clineno = __LINE__; goto __pyx_L3_error;} __pyx_L3_error:; __Pyx_AddTraceback("pygame_sdl2.gfxdraw.pixel", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_surface), __pyx_ptype_11pygame_sdl2_7surface_Surface, 1, "surface", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 29; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_r = __pyx_pf_11pygame_sdl2_7gfxdraw_pixel(__pyx_self, __pyx_v_surface, __pyx_v_x, __pyx_v_y, __pyx_v_color); /* function exit code */ goto __pyx_L0; __pyx_L1_error:; __pyx_r = NULL; __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_7gfxdraw_pixel(CYTHON_UNUSED PyObject *__pyx_self, struct __pyx_obj_11pygame_sdl2_7surface_Surface *__pyx_v_surface, PyObject *__pyx_v_x, PyObject *__pyx_v_y, PyObject *__pyx_v_color) { struct __pyx_obj_11pygame_sdl2_5color_Color *__pyx_v_c = 0; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; Sint16 __pyx_t_3; Sint16 __pyx_t_4; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("pixel", 0); /* "pygame_sdl2/gfxdraw.pyx":30 * * def pixel(Surface surface, x, y, color): * cdef Color c = Color(color) # <<<<<<<<<<<<<< * pixelRGBA(surface.surface, x, y, c.r, c.g, c.b, c.a) * */ __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 30; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __Pyx_INCREF(__pyx_v_color); __Pyx_GIVEREF(__pyx_v_color); PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_color); __pyx_t_2 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_11pygame_sdl2_5color_Color), __pyx_t_1, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 30; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_v_c = ((struct __pyx_obj_11pygame_sdl2_5color_Color *)__pyx_t_2); __pyx_t_2 = 0; /* "pygame_sdl2/gfxdraw.pyx":31 * def pixel(Surface surface, x, y, color): * cdef Color c = Color(color) * pixelRGBA(surface.surface, x, y, c.r, c.g, c.b, c.a) # <<<<<<<<<<<<<< * * def hline(Surface surface, x1, x2, y, color): */ __pyx_t_3 = __Pyx_PyInt_As_int16_t(__pyx_v_x); if (unlikely((__pyx_t_3 == (Sint16)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 31; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_t_4 = __Pyx_PyInt_As_int16_t(__pyx_v_y); if (unlikely((__pyx_t_4 == (Sint16)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 31; __pyx_clineno = __LINE__; goto __pyx_L1_error;} pixelRGBA(__pyx_v_surface->surface, __pyx_t_3, __pyx_t_4, __pyx_v_c->r, __pyx_v_c->g, __pyx_v_c->b, __pyx_v_c->a); /* "pygame_sdl2/gfxdraw.pyx":29 * * * def pixel(Surface surface, x, y, color): # <<<<<<<<<<<<<< * cdef Color c = Color(color) * pixelRGBA(surface.surface, x, y, c.r, c.g, c.b, c.a) */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_AddTraceback("pygame_sdl2.gfxdraw.pixel", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF((PyObject *)__pyx_v_c); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/gfxdraw.pyx":33 * pixelRGBA(surface.surface, x, y, c.r, c.g, c.b, c.a) * * def hline(Surface surface, x1, x2, y, color): # <<<<<<<<<<<<<< * cdef Color c = Color(color) * hlineRGBA(surface.surface, x1, x2, y, c.r, c.g, c.b, c.a) */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_7gfxdraw_3hline(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static PyMethodDef __pyx_mdef_11pygame_sdl2_7gfxdraw_3hline = {"hline", (PyCFunction)__pyx_pw_11pygame_sdl2_7gfxdraw_3hline, METH_VARARGS|METH_KEYWORDS, 0}; static PyObject *__pyx_pw_11pygame_sdl2_7gfxdraw_3hline(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { struct __pyx_obj_11pygame_sdl2_7surface_Surface *__pyx_v_surface = 0; PyObject *__pyx_v_x1 = 0; PyObject *__pyx_v_x2 = 0; PyObject *__pyx_v_y = 0; PyObject *__pyx_v_color = 0; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("hline (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_surface,&__pyx_n_s_x1,&__pyx_n_s_x2,&__pyx_n_s_y,&__pyx_n_s_color,0}; PyObject* values[5] = {0,0,0,0,0}; if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4); case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_surface)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; case 1: if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_x1)) != 0)) kw_args--; else { __Pyx_RaiseArgtupleInvalid("hline", 1, 5, 5, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 33; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } case 2: if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_x2)) != 0)) kw_args--; else { __Pyx_RaiseArgtupleInvalid("hline", 1, 5, 5, 2); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 33; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } case 3: if (likely((values[3] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_y)) != 0)) kw_args--; else { __Pyx_RaiseArgtupleInvalid("hline", 1, 5, 5, 3); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 33; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } case 4: if (likely((values[4] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_color)) != 0)) kw_args--; else { __Pyx_RaiseArgtupleInvalid("hline", 1, 5, 5, 4); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 33; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "hline") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 33; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } } else if (PyTuple_GET_SIZE(__pyx_args) != 5) { goto __pyx_L5_argtuple_error; } else { values[0] = PyTuple_GET_ITEM(__pyx_args, 0); values[1] = PyTuple_GET_ITEM(__pyx_args, 1); values[2] = PyTuple_GET_ITEM(__pyx_args, 2); values[3] = PyTuple_GET_ITEM(__pyx_args, 3); values[4] = PyTuple_GET_ITEM(__pyx_args, 4); } __pyx_v_surface = ((struct __pyx_obj_11pygame_sdl2_7surface_Surface *)values[0]); __pyx_v_x1 = values[1]; __pyx_v_x2 = values[2]; __pyx_v_y = values[3]; __pyx_v_color = values[4]; } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("hline", 1, 5, 5, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 33; __pyx_clineno = __LINE__; goto __pyx_L3_error;} __pyx_L3_error:; __Pyx_AddTraceback("pygame_sdl2.gfxdraw.hline", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_surface), __pyx_ptype_11pygame_sdl2_7surface_Surface, 1, "surface", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 33; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_r = __pyx_pf_11pygame_sdl2_7gfxdraw_2hline(__pyx_self, __pyx_v_surface, __pyx_v_x1, __pyx_v_x2, __pyx_v_y, __pyx_v_color); /* function exit code */ goto __pyx_L0; __pyx_L1_error:; __pyx_r = NULL; __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_7gfxdraw_2hline(CYTHON_UNUSED PyObject *__pyx_self, struct __pyx_obj_11pygame_sdl2_7surface_Surface *__pyx_v_surface, PyObject *__pyx_v_x1, PyObject *__pyx_v_x2, PyObject *__pyx_v_y, PyObject *__pyx_v_color) { struct __pyx_obj_11pygame_sdl2_5color_Color *__pyx_v_c = 0; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; Sint16 __pyx_t_3; Sint16 __pyx_t_4; Sint16 __pyx_t_5; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("hline", 0); /* "pygame_sdl2/gfxdraw.pyx":34 * * def hline(Surface surface, x1, x2, y, color): * cdef Color c = Color(color) # <<<<<<<<<<<<<< * hlineRGBA(surface.surface, x1, x2, y, c.r, c.g, c.b, c.a) * */ __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 34; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __Pyx_INCREF(__pyx_v_color); __Pyx_GIVEREF(__pyx_v_color); PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_color); __pyx_t_2 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_11pygame_sdl2_5color_Color), __pyx_t_1, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 34; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_v_c = ((struct __pyx_obj_11pygame_sdl2_5color_Color *)__pyx_t_2); __pyx_t_2 = 0; /* "pygame_sdl2/gfxdraw.pyx":35 * def hline(Surface surface, x1, x2, y, color): * cdef Color c = Color(color) * hlineRGBA(surface.surface, x1, x2, y, c.r, c.g, c.b, c.a) # <<<<<<<<<<<<<< * * def vline(Surface surface, x, y1, y2, color): */ __pyx_t_3 = __Pyx_PyInt_As_int16_t(__pyx_v_x1); if (unlikely((__pyx_t_3 == (Sint16)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 35; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_t_4 = __Pyx_PyInt_As_int16_t(__pyx_v_x2); if (unlikely((__pyx_t_4 == (Sint16)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 35; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_t_5 = __Pyx_PyInt_As_int16_t(__pyx_v_y); if (unlikely((__pyx_t_5 == (Sint16)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 35; __pyx_clineno = __LINE__; goto __pyx_L1_error;} hlineRGBA(__pyx_v_surface->surface, __pyx_t_3, __pyx_t_4, __pyx_t_5, __pyx_v_c->r, __pyx_v_c->g, __pyx_v_c->b, __pyx_v_c->a); /* "pygame_sdl2/gfxdraw.pyx":33 * pixelRGBA(surface.surface, x, y, c.r, c.g, c.b, c.a) * * def hline(Surface surface, x1, x2, y, color): # <<<<<<<<<<<<<< * cdef Color c = Color(color) * hlineRGBA(surface.surface, x1, x2, y, c.r, c.g, c.b, c.a) */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_AddTraceback("pygame_sdl2.gfxdraw.hline", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF((PyObject *)__pyx_v_c); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/gfxdraw.pyx":37 * hlineRGBA(surface.surface, x1, x2, y, c.r, c.g, c.b, c.a) * * def vline(Surface surface, x, y1, y2, color): # <<<<<<<<<<<<<< * cdef Color c = Color(color) * vlineRGBA(surface.surface, x, y1, y2, c.r, c.g, c.b, c.a) */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_7gfxdraw_5vline(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static PyMethodDef __pyx_mdef_11pygame_sdl2_7gfxdraw_5vline = {"vline", (PyCFunction)__pyx_pw_11pygame_sdl2_7gfxdraw_5vline, METH_VARARGS|METH_KEYWORDS, 0}; static PyObject *__pyx_pw_11pygame_sdl2_7gfxdraw_5vline(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { struct __pyx_obj_11pygame_sdl2_7surface_Surface *__pyx_v_surface = 0; PyObject *__pyx_v_x = 0; PyObject *__pyx_v_y1 = 0; PyObject *__pyx_v_y2 = 0; PyObject *__pyx_v_color = 0; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("vline (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_surface,&__pyx_n_s_x,&__pyx_n_s_y1,&__pyx_n_s_y2,&__pyx_n_s_color,0}; PyObject* values[5] = {0,0,0,0,0}; if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4); case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_surface)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; case 1: if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_x)) != 0)) kw_args--; else { __Pyx_RaiseArgtupleInvalid("vline", 1, 5, 5, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 37; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } case 2: if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_y1)) != 0)) kw_args--; else { __Pyx_RaiseArgtupleInvalid("vline", 1, 5, 5, 2); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 37; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } case 3: if (likely((values[3] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_y2)) != 0)) kw_args--; else { __Pyx_RaiseArgtupleInvalid("vline", 1, 5, 5, 3); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 37; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } case 4: if (likely((values[4] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_color)) != 0)) kw_args--; else { __Pyx_RaiseArgtupleInvalid("vline", 1, 5, 5, 4); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 37; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "vline") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 37; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } } else if (PyTuple_GET_SIZE(__pyx_args) != 5) { goto __pyx_L5_argtuple_error; } else { values[0] = PyTuple_GET_ITEM(__pyx_args, 0); values[1] = PyTuple_GET_ITEM(__pyx_args, 1); values[2] = PyTuple_GET_ITEM(__pyx_args, 2); values[3] = PyTuple_GET_ITEM(__pyx_args, 3); values[4] = PyTuple_GET_ITEM(__pyx_args, 4); } __pyx_v_surface = ((struct __pyx_obj_11pygame_sdl2_7surface_Surface *)values[0]); __pyx_v_x = values[1]; __pyx_v_y1 = values[2]; __pyx_v_y2 = values[3]; __pyx_v_color = values[4]; } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("vline", 1, 5, 5, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 37; __pyx_clineno = __LINE__; goto __pyx_L3_error;} __pyx_L3_error:; __Pyx_AddTraceback("pygame_sdl2.gfxdraw.vline", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_surface), __pyx_ptype_11pygame_sdl2_7surface_Surface, 1, "surface", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 37; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_r = __pyx_pf_11pygame_sdl2_7gfxdraw_4vline(__pyx_self, __pyx_v_surface, __pyx_v_x, __pyx_v_y1, __pyx_v_y2, __pyx_v_color); /* function exit code */ goto __pyx_L0; __pyx_L1_error:; __pyx_r = NULL; __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_7gfxdraw_4vline(CYTHON_UNUSED PyObject *__pyx_self, struct __pyx_obj_11pygame_sdl2_7surface_Surface *__pyx_v_surface, PyObject *__pyx_v_x, PyObject *__pyx_v_y1, PyObject *__pyx_v_y2, PyObject *__pyx_v_color) { struct __pyx_obj_11pygame_sdl2_5color_Color *__pyx_v_c = 0; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; Sint16 __pyx_t_3; Sint16 __pyx_t_4; Sint16 __pyx_t_5; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("vline", 0); /* "pygame_sdl2/gfxdraw.pyx":38 * * def vline(Surface surface, x, y1, y2, color): * cdef Color c = Color(color) # <<<<<<<<<<<<<< * vlineRGBA(surface.surface, x, y1, y2, c.r, c.g, c.b, c.a) * */ __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 38; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __Pyx_INCREF(__pyx_v_color); __Pyx_GIVEREF(__pyx_v_color); PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_color); __pyx_t_2 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_11pygame_sdl2_5color_Color), __pyx_t_1, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 38; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_v_c = ((struct __pyx_obj_11pygame_sdl2_5color_Color *)__pyx_t_2); __pyx_t_2 = 0; /* "pygame_sdl2/gfxdraw.pyx":39 * def vline(Surface surface, x, y1, y2, color): * cdef Color c = Color(color) * vlineRGBA(surface.surface, x, y1, y2, c.r, c.g, c.b, c.a) # <<<<<<<<<<<<<< * * def rectangle(Surface surface, rect, color): */ __pyx_t_3 = __Pyx_PyInt_As_int16_t(__pyx_v_x); if (unlikely((__pyx_t_3 == (Sint16)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 39; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_t_4 = __Pyx_PyInt_As_int16_t(__pyx_v_y1); if (unlikely((__pyx_t_4 == (Sint16)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 39; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_t_5 = __Pyx_PyInt_As_int16_t(__pyx_v_y2); if (unlikely((__pyx_t_5 == (Sint16)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 39; __pyx_clineno = __LINE__; goto __pyx_L1_error;} vlineRGBA(__pyx_v_surface->surface, __pyx_t_3, __pyx_t_4, __pyx_t_5, __pyx_v_c->r, __pyx_v_c->g, __pyx_v_c->b, __pyx_v_c->a); /* "pygame_sdl2/gfxdraw.pyx":37 * hlineRGBA(surface.surface, x1, x2, y, c.r, c.g, c.b, c.a) * * def vline(Surface surface, x, y1, y2, color): # <<<<<<<<<<<<<< * cdef Color c = Color(color) * vlineRGBA(surface.surface, x, y1, y2, c.r, c.g, c.b, c.a) */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_AddTraceback("pygame_sdl2.gfxdraw.vline", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF((PyObject *)__pyx_v_c); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/gfxdraw.pyx":41 * vlineRGBA(surface.surface, x, y1, y2, c.r, c.g, c.b, c.a) * * def rectangle(Surface surface, rect, color): # <<<<<<<<<<<<<< * cdef Color c = Color(color) * if not isinstance(rect, Rect): */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_7gfxdraw_7rectangle(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static PyMethodDef __pyx_mdef_11pygame_sdl2_7gfxdraw_7rectangle = {"rectangle", (PyCFunction)__pyx_pw_11pygame_sdl2_7gfxdraw_7rectangle, METH_VARARGS|METH_KEYWORDS, 0}; static PyObject *__pyx_pw_11pygame_sdl2_7gfxdraw_7rectangle(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { struct __pyx_obj_11pygame_sdl2_7surface_Surface *__pyx_v_surface = 0; PyObject *__pyx_v_rect = 0; PyObject *__pyx_v_color = 0; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("rectangle (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_surface,&__pyx_n_s_rect,&__pyx_n_s_color,0}; PyObject* values[3] = {0,0,0}; if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_surface)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; case 1: if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_rect)) != 0)) kw_args--; else { __Pyx_RaiseArgtupleInvalid("rectangle", 1, 3, 3, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 41; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } case 2: if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_color)) != 0)) kw_args--; else { __Pyx_RaiseArgtupleInvalid("rectangle", 1, 3, 3, 2); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 41; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "rectangle") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 41; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } } else if (PyTuple_GET_SIZE(__pyx_args) != 3) { goto __pyx_L5_argtuple_error; } else { values[0] = PyTuple_GET_ITEM(__pyx_args, 0); values[1] = PyTuple_GET_ITEM(__pyx_args, 1); values[2] = PyTuple_GET_ITEM(__pyx_args, 2); } __pyx_v_surface = ((struct __pyx_obj_11pygame_sdl2_7surface_Surface *)values[0]); __pyx_v_rect = values[1]; __pyx_v_color = values[2]; } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("rectangle", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 41; __pyx_clineno = __LINE__; goto __pyx_L3_error;} __pyx_L3_error:; __Pyx_AddTraceback("pygame_sdl2.gfxdraw.rectangle", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_surface), __pyx_ptype_11pygame_sdl2_7surface_Surface, 1, "surface", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 41; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_r = __pyx_pf_11pygame_sdl2_7gfxdraw_6rectangle(__pyx_self, __pyx_v_surface, __pyx_v_rect, __pyx_v_color); /* function exit code */ goto __pyx_L0; __pyx_L1_error:; __pyx_r = NULL; __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_7gfxdraw_6rectangle(CYTHON_UNUSED PyObject *__pyx_self, struct __pyx_obj_11pygame_sdl2_7surface_Surface *__pyx_v_surface, PyObject *__pyx_v_rect, PyObject *__pyx_v_color) { struct __pyx_obj_11pygame_sdl2_5color_Color *__pyx_v_c = 0; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; int __pyx_t_3; int __pyx_t_4; PyObject *__pyx_t_5 = NULL; PyObject *__pyx_t_6 = NULL; Sint16 __pyx_t_7; Sint16 __pyx_t_8; Sint16 __pyx_t_9; Sint16 __pyx_t_10; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("rectangle", 0); __Pyx_INCREF(__pyx_v_rect); /* "pygame_sdl2/gfxdraw.pyx":42 * * def rectangle(Surface surface, rect, color): * cdef Color c = Color(color) # <<<<<<<<<<<<<< * if not isinstance(rect, Rect): * rect = Rect(rect) */ __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 42; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __Pyx_INCREF(__pyx_v_color); __Pyx_GIVEREF(__pyx_v_color); PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_color); __pyx_t_2 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_11pygame_sdl2_5color_Color), __pyx_t_1, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 42; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_v_c = ((struct __pyx_obj_11pygame_sdl2_5color_Color *)__pyx_t_2); __pyx_t_2 = 0; /* "pygame_sdl2/gfxdraw.pyx":43 * def rectangle(Surface surface, rect, color): * cdef Color c = Color(color) * if not isinstance(rect, Rect): # <<<<<<<<<<<<<< * rect = Rect(rect) * rectangleRGBA(surface.surface, rect.x, rect.y, rect.x + rect.w, rect.y + rect.h, c.r, c.g, c.b, c.a) */ __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_Rect); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 43; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = PyObject_IsInstance(__pyx_v_rect, __pyx_t_2); if (unlikely(__pyx_t_3 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 43; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_4 = ((!(__pyx_t_3 != 0)) != 0); if (__pyx_t_4) { /* "pygame_sdl2/gfxdraw.pyx":44 * cdef Color c = Color(color) * if not isinstance(rect, Rect): * rect = Rect(rect) # <<<<<<<<<<<<<< * rectangleRGBA(surface.surface, rect.x, rect.y, rect.x + rect.w, rect.y + rect.h, c.r, c.g, c.b, c.a) * */ __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_Rect); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 44; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_t_5 = NULL; if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_1))) { __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_1); if (likely(__pyx_t_5)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1); __Pyx_INCREF(__pyx_t_5); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_1, function); } } if (!__pyx_t_5) { __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_1, __pyx_v_rect); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 44; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); } else { __pyx_t_6 = PyTuple_New(1+1); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 44; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_6); __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_5); __pyx_t_5 = NULL; __Pyx_INCREF(__pyx_v_rect); __Pyx_GIVEREF(__pyx_v_rect); PyTuple_SET_ITEM(__pyx_t_6, 0+1, __pyx_v_rect); __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_6, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 44; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF_SET(__pyx_v_rect, __pyx_t_2); __pyx_t_2 = 0; /* "pygame_sdl2/gfxdraw.pyx":43 * def rectangle(Surface surface, rect, color): * cdef Color c = Color(color) * if not isinstance(rect, Rect): # <<<<<<<<<<<<<< * rect = Rect(rect) * rectangleRGBA(surface.surface, rect.x, rect.y, rect.x + rect.w, rect.y + rect.h, c.r, c.g, c.b, c.a) */ } /* "pygame_sdl2/gfxdraw.pyx":45 * if not isinstance(rect, Rect): * rect = Rect(rect) * rectangleRGBA(surface.surface, rect.x, rect.y, rect.x + rect.w, rect.y + rect.h, c.r, c.g, c.b, c.a) # <<<<<<<<<<<<<< * * def rounded_rectangle(Surface surface, rect, rad, color): */ __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_rect, __pyx_n_s_x); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 45; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __pyx_t_7 = __Pyx_PyInt_As_int16_t(__pyx_t_2); if (unlikely((__pyx_t_7 == (Sint16)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 45; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_rect, __pyx_n_s_y); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 45; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __pyx_t_8 = __Pyx_PyInt_As_int16_t(__pyx_t_2); if (unlikely((__pyx_t_8 == (Sint16)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 45; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_rect, __pyx_n_s_x); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 45; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_rect, __pyx_n_s_w); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 45; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_t_6 = PyNumber_Add(__pyx_t_2, __pyx_t_1); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 45; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_9 = __Pyx_PyInt_As_int16_t(__pyx_t_6); if (unlikely((__pyx_t_9 == (Sint16)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 45; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_rect, __pyx_n_s_y); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 45; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_6); __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_rect, __pyx_n_s_h); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 45; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = PyNumber_Add(__pyx_t_6, __pyx_t_1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 45; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_10 = __Pyx_PyInt_As_int16_t(__pyx_t_2); if (unlikely((__pyx_t_10 == (Sint16)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 45; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; rectangleRGBA(__pyx_v_surface->surface, __pyx_t_7, __pyx_t_8, __pyx_t_9, __pyx_t_10, __pyx_v_c->r, __pyx_v_c->g, __pyx_v_c->b, __pyx_v_c->a); /* "pygame_sdl2/gfxdraw.pyx":41 * vlineRGBA(surface.surface, x, y1, y2, c.r, c.g, c.b, c.a) * * def rectangle(Surface surface, rect, color): # <<<<<<<<<<<<<< * cdef Color c = Color(color) * if not isinstance(rect, Rect): */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_5); __Pyx_XDECREF(__pyx_t_6); __Pyx_AddTraceback("pygame_sdl2.gfxdraw.rectangle", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF((PyObject *)__pyx_v_c); __Pyx_XDECREF(__pyx_v_rect); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/gfxdraw.pyx":47 * rectangleRGBA(surface.surface, rect.x, rect.y, rect.x + rect.w, rect.y + rect.h, c.r, c.g, c.b, c.a) * * def rounded_rectangle(Surface surface, rect, rad, color): # <<<<<<<<<<<<<< * cdef Color c = Color(color) * if not isinstance(rect, Rect): */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_7gfxdraw_9rounded_rectangle(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static PyMethodDef __pyx_mdef_11pygame_sdl2_7gfxdraw_9rounded_rectangle = {"rounded_rectangle", (PyCFunction)__pyx_pw_11pygame_sdl2_7gfxdraw_9rounded_rectangle, METH_VARARGS|METH_KEYWORDS, 0}; static PyObject *__pyx_pw_11pygame_sdl2_7gfxdraw_9rounded_rectangle(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { struct __pyx_obj_11pygame_sdl2_7surface_Surface *__pyx_v_surface = 0; PyObject *__pyx_v_rect = 0; PyObject *__pyx_v_rad = 0; PyObject *__pyx_v_color = 0; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("rounded_rectangle (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_surface,&__pyx_n_s_rect,&__pyx_n_s_rad,&__pyx_n_s_color,0}; PyObject* values[4] = {0,0,0,0}; if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_surface)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; case 1: if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_rect)) != 0)) kw_args--; else { __Pyx_RaiseArgtupleInvalid("rounded_rectangle", 1, 4, 4, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 47; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } case 2: if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_rad)) != 0)) kw_args--; else { __Pyx_RaiseArgtupleInvalid("rounded_rectangle", 1, 4, 4, 2); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 47; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } case 3: if (likely((values[3] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_color)) != 0)) kw_args--; else { __Pyx_RaiseArgtupleInvalid("rounded_rectangle", 1, 4, 4, 3); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 47; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "rounded_rectangle") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 47; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } } else if (PyTuple_GET_SIZE(__pyx_args) != 4) { goto __pyx_L5_argtuple_error; } else { values[0] = PyTuple_GET_ITEM(__pyx_args, 0); values[1] = PyTuple_GET_ITEM(__pyx_args, 1); values[2] = PyTuple_GET_ITEM(__pyx_args, 2); values[3] = PyTuple_GET_ITEM(__pyx_args, 3); } __pyx_v_surface = ((struct __pyx_obj_11pygame_sdl2_7surface_Surface *)values[0]); __pyx_v_rect = values[1]; __pyx_v_rad = values[2]; __pyx_v_color = values[3]; } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("rounded_rectangle", 1, 4, 4, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 47; __pyx_clineno = __LINE__; goto __pyx_L3_error;} __pyx_L3_error:; __Pyx_AddTraceback("pygame_sdl2.gfxdraw.rounded_rectangle", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_surface), __pyx_ptype_11pygame_sdl2_7surface_Surface, 1, "surface", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 47; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_r = __pyx_pf_11pygame_sdl2_7gfxdraw_8rounded_rectangle(__pyx_self, __pyx_v_surface, __pyx_v_rect, __pyx_v_rad, __pyx_v_color); /* function exit code */ goto __pyx_L0; __pyx_L1_error:; __pyx_r = NULL; __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_7gfxdraw_8rounded_rectangle(CYTHON_UNUSED PyObject *__pyx_self, struct __pyx_obj_11pygame_sdl2_7surface_Surface *__pyx_v_surface, PyObject *__pyx_v_rect, PyObject *__pyx_v_rad, PyObject *__pyx_v_color) { struct __pyx_obj_11pygame_sdl2_5color_Color *__pyx_v_c = 0; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; int __pyx_t_3; int __pyx_t_4; PyObject *__pyx_t_5 = NULL; PyObject *__pyx_t_6 = NULL; Sint16 __pyx_t_7; Sint16 __pyx_t_8; Sint16 __pyx_t_9; Sint16 __pyx_t_10; Sint16 __pyx_t_11; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("rounded_rectangle", 0); __Pyx_INCREF(__pyx_v_rect); /* "pygame_sdl2/gfxdraw.pyx":48 * * def rounded_rectangle(Surface surface, rect, rad, color): * cdef Color c = Color(color) # <<<<<<<<<<<<<< * if not isinstance(rect, Rect): * rect = Rect(rect) */ __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 48; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __Pyx_INCREF(__pyx_v_color); __Pyx_GIVEREF(__pyx_v_color); PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_color); __pyx_t_2 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_11pygame_sdl2_5color_Color), __pyx_t_1, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 48; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_v_c = ((struct __pyx_obj_11pygame_sdl2_5color_Color *)__pyx_t_2); __pyx_t_2 = 0; /* "pygame_sdl2/gfxdraw.pyx":49 * def rounded_rectangle(Surface surface, rect, rad, color): * cdef Color c = Color(color) * if not isinstance(rect, Rect): # <<<<<<<<<<<<<< * rect = Rect(rect) * roundedRectangleRGBA(surface.surface, rect.x, rect.y, rect.x + rect.w, rect.y + rect.h, rad, c.r, c.g, c.b, c.a) */ __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_Rect); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 49; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = PyObject_IsInstance(__pyx_v_rect, __pyx_t_2); if (unlikely(__pyx_t_3 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 49; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_4 = ((!(__pyx_t_3 != 0)) != 0); if (__pyx_t_4) { /* "pygame_sdl2/gfxdraw.pyx":50 * cdef Color c = Color(color) * if not isinstance(rect, Rect): * rect = Rect(rect) # <<<<<<<<<<<<<< * roundedRectangleRGBA(surface.surface, rect.x, rect.y, rect.x + rect.w, rect.y + rect.h, rad, c.r, c.g, c.b, c.a) * */ __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_Rect); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 50; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_t_5 = NULL; if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_1))) { __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_1); if (likely(__pyx_t_5)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1); __Pyx_INCREF(__pyx_t_5); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_1, function); } } if (!__pyx_t_5) { __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_1, __pyx_v_rect); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 50; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); } else { __pyx_t_6 = PyTuple_New(1+1); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 50; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_6); __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_5); __pyx_t_5 = NULL; __Pyx_INCREF(__pyx_v_rect); __Pyx_GIVEREF(__pyx_v_rect); PyTuple_SET_ITEM(__pyx_t_6, 0+1, __pyx_v_rect); __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_6, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 50; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF_SET(__pyx_v_rect, __pyx_t_2); __pyx_t_2 = 0; /* "pygame_sdl2/gfxdraw.pyx":49 * def rounded_rectangle(Surface surface, rect, rad, color): * cdef Color c = Color(color) * if not isinstance(rect, Rect): # <<<<<<<<<<<<<< * rect = Rect(rect) * roundedRectangleRGBA(surface.surface, rect.x, rect.y, rect.x + rect.w, rect.y + rect.h, rad, c.r, c.g, c.b, c.a) */ } /* "pygame_sdl2/gfxdraw.pyx":51 * if not isinstance(rect, Rect): * rect = Rect(rect) * roundedRectangleRGBA(surface.surface, rect.x, rect.y, rect.x + rect.w, rect.y + rect.h, rad, c.r, c.g, c.b, c.a) # <<<<<<<<<<<<<< * * def box(Surface surface, rect, color): */ __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_rect, __pyx_n_s_x); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 51; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __pyx_t_7 = __Pyx_PyInt_As_int16_t(__pyx_t_2); if (unlikely((__pyx_t_7 == (Sint16)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 51; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_rect, __pyx_n_s_y); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 51; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __pyx_t_8 = __Pyx_PyInt_As_int16_t(__pyx_t_2); if (unlikely((__pyx_t_8 == (Sint16)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 51; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_rect, __pyx_n_s_x); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 51; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_rect, __pyx_n_s_w); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 51; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_t_6 = PyNumber_Add(__pyx_t_2, __pyx_t_1); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 51; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_9 = __Pyx_PyInt_As_int16_t(__pyx_t_6); if (unlikely((__pyx_t_9 == (Sint16)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 51; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_rect, __pyx_n_s_y); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 51; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_6); __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_rect, __pyx_n_s_h); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 51; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = PyNumber_Add(__pyx_t_6, __pyx_t_1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 51; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_10 = __Pyx_PyInt_As_int16_t(__pyx_t_2); if (unlikely((__pyx_t_10 == (Sint16)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 51; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_11 = __Pyx_PyInt_As_int16_t(__pyx_v_rad); if (unlikely((__pyx_t_11 == (Sint16)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 51; __pyx_clineno = __LINE__; goto __pyx_L1_error;} roundedRectangleRGBA(__pyx_v_surface->surface, __pyx_t_7, __pyx_t_8, __pyx_t_9, __pyx_t_10, __pyx_t_11, __pyx_v_c->r, __pyx_v_c->g, __pyx_v_c->b, __pyx_v_c->a); /* "pygame_sdl2/gfxdraw.pyx":47 * rectangleRGBA(surface.surface, rect.x, rect.y, rect.x + rect.w, rect.y + rect.h, c.r, c.g, c.b, c.a) * * def rounded_rectangle(Surface surface, rect, rad, color): # <<<<<<<<<<<<<< * cdef Color c = Color(color) * if not isinstance(rect, Rect): */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_5); __Pyx_XDECREF(__pyx_t_6); __Pyx_AddTraceback("pygame_sdl2.gfxdraw.rounded_rectangle", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF((PyObject *)__pyx_v_c); __Pyx_XDECREF(__pyx_v_rect); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/gfxdraw.pyx":53 * roundedRectangleRGBA(surface.surface, rect.x, rect.y, rect.x + rect.w, rect.y + rect.h, rad, c.r, c.g, c.b, c.a) * * def box(Surface surface, rect, color): # <<<<<<<<<<<<<< * cdef Color c = Color(color) * if not isinstance(rect, Rect): */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_7gfxdraw_11box(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static PyMethodDef __pyx_mdef_11pygame_sdl2_7gfxdraw_11box = {"box", (PyCFunction)__pyx_pw_11pygame_sdl2_7gfxdraw_11box, METH_VARARGS|METH_KEYWORDS, 0}; static PyObject *__pyx_pw_11pygame_sdl2_7gfxdraw_11box(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { struct __pyx_obj_11pygame_sdl2_7surface_Surface *__pyx_v_surface = 0; PyObject *__pyx_v_rect = 0; PyObject *__pyx_v_color = 0; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("box (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_surface,&__pyx_n_s_rect,&__pyx_n_s_color,0}; PyObject* values[3] = {0,0,0}; if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_surface)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; case 1: if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_rect)) != 0)) kw_args--; else { __Pyx_RaiseArgtupleInvalid("box", 1, 3, 3, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 53; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } case 2: if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_color)) != 0)) kw_args--; else { __Pyx_RaiseArgtupleInvalid("box", 1, 3, 3, 2); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 53; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "box") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 53; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } } else if (PyTuple_GET_SIZE(__pyx_args) != 3) { goto __pyx_L5_argtuple_error; } else { values[0] = PyTuple_GET_ITEM(__pyx_args, 0); values[1] = PyTuple_GET_ITEM(__pyx_args, 1); values[2] = PyTuple_GET_ITEM(__pyx_args, 2); } __pyx_v_surface = ((struct __pyx_obj_11pygame_sdl2_7surface_Surface *)values[0]); __pyx_v_rect = values[1]; __pyx_v_color = values[2]; } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("box", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 53; __pyx_clineno = __LINE__; goto __pyx_L3_error;} __pyx_L3_error:; __Pyx_AddTraceback("pygame_sdl2.gfxdraw.box", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_surface), __pyx_ptype_11pygame_sdl2_7surface_Surface, 1, "surface", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 53; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_r = __pyx_pf_11pygame_sdl2_7gfxdraw_10box(__pyx_self, __pyx_v_surface, __pyx_v_rect, __pyx_v_color); /* function exit code */ goto __pyx_L0; __pyx_L1_error:; __pyx_r = NULL; __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_7gfxdraw_10box(CYTHON_UNUSED PyObject *__pyx_self, struct __pyx_obj_11pygame_sdl2_7surface_Surface *__pyx_v_surface, PyObject *__pyx_v_rect, PyObject *__pyx_v_color) { struct __pyx_obj_11pygame_sdl2_5color_Color *__pyx_v_c = 0; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; int __pyx_t_3; int __pyx_t_4; PyObject *__pyx_t_5 = NULL; PyObject *__pyx_t_6 = NULL; Sint16 __pyx_t_7; Sint16 __pyx_t_8; Sint16 __pyx_t_9; Sint16 __pyx_t_10; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("box", 0); __Pyx_INCREF(__pyx_v_rect); /* "pygame_sdl2/gfxdraw.pyx":54 * * def box(Surface surface, rect, color): * cdef Color c = Color(color) # <<<<<<<<<<<<<< * if not isinstance(rect, Rect): * rect = Rect(rect) */ __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 54; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __Pyx_INCREF(__pyx_v_color); __Pyx_GIVEREF(__pyx_v_color); PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_color); __pyx_t_2 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_11pygame_sdl2_5color_Color), __pyx_t_1, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 54; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_v_c = ((struct __pyx_obj_11pygame_sdl2_5color_Color *)__pyx_t_2); __pyx_t_2 = 0; /* "pygame_sdl2/gfxdraw.pyx":55 * def box(Surface surface, rect, color): * cdef Color c = Color(color) * if not isinstance(rect, Rect): # <<<<<<<<<<<<<< * rect = Rect(rect) * boxRGBA(surface.surface, rect.x, rect.y, rect.x + rect.w, rect.y + rect.h, c.r, c.g, c.b, c.a) */ __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_Rect); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 55; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = PyObject_IsInstance(__pyx_v_rect, __pyx_t_2); if (unlikely(__pyx_t_3 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 55; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_4 = ((!(__pyx_t_3 != 0)) != 0); if (__pyx_t_4) { /* "pygame_sdl2/gfxdraw.pyx":56 * cdef Color c = Color(color) * if not isinstance(rect, Rect): * rect = Rect(rect) # <<<<<<<<<<<<<< * boxRGBA(surface.surface, rect.x, rect.y, rect.x + rect.w, rect.y + rect.h, c.r, c.g, c.b, c.a) * */ __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_Rect); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 56; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_t_5 = NULL; if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_1))) { __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_1); if (likely(__pyx_t_5)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1); __Pyx_INCREF(__pyx_t_5); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_1, function); } } if (!__pyx_t_5) { __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_1, __pyx_v_rect); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 56; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); } else { __pyx_t_6 = PyTuple_New(1+1); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 56; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_6); __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_5); __pyx_t_5 = NULL; __Pyx_INCREF(__pyx_v_rect); __Pyx_GIVEREF(__pyx_v_rect); PyTuple_SET_ITEM(__pyx_t_6, 0+1, __pyx_v_rect); __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_6, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 56; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF_SET(__pyx_v_rect, __pyx_t_2); __pyx_t_2 = 0; /* "pygame_sdl2/gfxdraw.pyx":55 * def box(Surface surface, rect, color): * cdef Color c = Color(color) * if not isinstance(rect, Rect): # <<<<<<<<<<<<<< * rect = Rect(rect) * boxRGBA(surface.surface, rect.x, rect.y, rect.x + rect.w, rect.y + rect.h, c.r, c.g, c.b, c.a) */ } /* "pygame_sdl2/gfxdraw.pyx":57 * if not isinstance(rect, Rect): * rect = Rect(rect) * boxRGBA(surface.surface, rect.x, rect.y, rect.x + rect.w, rect.y + rect.h, c.r, c.g, c.b, c.a) # <<<<<<<<<<<<<< * * def rounded_box(Surface surface, rect, rad, color): */ __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_rect, __pyx_n_s_x); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 57; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __pyx_t_7 = __Pyx_PyInt_As_int16_t(__pyx_t_2); if (unlikely((__pyx_t_7 == (Sint16)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 57; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_rect, __pyx_n_s_y); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 57; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __pyx_t_8 = __Pyx_PyInt_As_int16_t(__pyx_t_2); if (unlikely((__pyx_t_8 == (Sint16)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 57; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_rect, __pyx_n_s_x); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 57; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_rect, __pyx_n_s_w); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 57; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_t_6 = PyNumber_Add(__pyx_t_2, __pyx_t_1); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 57; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_9 = __Pyx_PyInt_As_int16_t(__pyx_t_6); if (unlikely((__pyx_t_9 == (Sint16)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 57; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_rect, __pyx_n_s_y); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 57; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_6); __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_rect, __pyx_n_s_h); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 57; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = PyNumber_Add(__pyx_t_6, __pyx_t_1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 57; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_10 = __Pyx_PyInt_As_int16_t(__pyx_t_2); if (unlikely((__pyx_t_10 == (Sint16)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 57; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; boxRGBA(__pyx_v_surface->surface, __pyx_t_7, __pyx_t_8, __pyx_t_9, __pyx_t_10, __pyx_v_c->r, __pyx_v_c->g, __pyx_v_c->b, __pyx_v_c->a); /* "pygame_sdl2/gfxdraw.pyx":53 * roundedRectangleRGBA(surface.surface, rect.x, rect.y, rect.x + rect.w, rect.y + rect.h, rad, c.r, c.g, c.b, c.a) * * def box(Surface surface, rect, color): # <<<<<<<<<<<<<< * cdef Color c = Color(color) * if not isinstance(rect, Rect): */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_5); __Pyx_XDECREF(__pyx_t_6); __Pyx_AddTraceback("pygame_sdl2.gfxdraw.box", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF((PyObject *)__pyx_v_c); __Pyx_XDECREF(__pyx_v_rect); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/gfxdraw.pyx":59 * boxRGBA(surface.surface, rect.x, rect.y, rect.x + rect.w, rect.y + rect.h, c.r, c.g, c.b, c.a) * * def rounded_box(Surface surface, rect, rad, color): # <<<<<<<<<<<<<< * cdef Color c = Color(color) * if not isinstance(rect, Rect): */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_7gfxdraw_13rounded_box(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static PyMethodDef __pyx_mdef_11pygame_sdl2_7gfxdraw_13rounded_box = {"rounded_box", (PyCFunction)__pyx_pw_11pygame_sdl2_7gfxdraw_13rounded_box, METH_VARARGS|METH_KEYWORDS, 0}; static PyObject *__pyx_pw_11pygame_sdl2_7gfxdraw_13rounded_box(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { struct __pyx_obj_11pygame_sdl2_7surface_Surface *__pyx_v_surface = 0; PyObject *__pyx_v_rect = 0; PyObject *__pyx_v_rad = 0; PyObject *__pyx_v_color = 0; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("rounded_box (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_surface,&__pyx_n_s_rect,&__pyx_n_s_rad,&__pyx_n_s_color,0}; PyObject* values[4] = {0,0,0,0}; if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_surface)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; case 1: if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_rect)) != 0)) kw_args--; else { __Pyx_RaiseArgtupleInvalid("rounded_box", 1, 4, 4, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 59; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } case 2: if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_rad)) != 0)) kw_args--; else { __Pyx_RaiseArgtupleInvalid("rounded_box", 1, 4, 4, 2); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 59; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } case 3: if (likely((values[3] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_color)) != 0)) kw_args--; else { __Pyx_RaiseArgtupleInvalid("rounded_box", 1, 4, 4, 3); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 59; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "rounded_box") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 59; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } } else if (PyTuple_GET_SIZE(__pyx_args) != 4) { goto __pyx_L5_argtuple_error; } else { values[0] = PyTuple_GET_ITEM(__pyx_args, 0); values[1] = PyTuple_GET_ITEM(__pyx_args, 1); values[2] = PyTuple_GET_ITEM(__pyx_args, 2); values[3] = PyTuple_GET_ITEM(__pyx_args, 3); } __pyx_v_surface = ((struct __pyx_obj_11pygame_sdl2_7surface_Surface *)values[0]); __pyx_v_rect = values[1]; __pyx_v_rad = values[2]; __pyx_v_color = values[3]; } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("rounded_box", 1, 4, 4, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 59; __pyx_clineno = __LINE__; goto __pyx_L3_error;} __pyx_L3_error:; __Pyx_AddTraceback("pygame_sdl2.gfxdraw.rounded_box", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_surface), __pyx_ptype_11pygame_sdl2_7surface_Surface, 1, "surface", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 59; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_r = __pyx_pf_11pygame_sdl2_7gfxdraw_12rounded_box(__pyx_self, __pyx_v_surface, __pyx_v_rect, __pyx_v_rad, __pyx_v_color); /* function exit code */ goto __pyx_L0; __pyx_L1_error:; __pyx_r = NULL; __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_7gfxdraw_12rounded_box(CYTHON_UNUSED PyObject *__pyx_self, struct __pyx_obj_11pygame_sdl2_7surface_Surface *__pyx_v_surface, PyObject *__pyx_v_rect, PyObject *__pyx_v_rad, PyObject *__pyx_v_color) { struct __pyx_obj_11pygame_sdl2_5color_Color *__pyx_v_c = 0; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; int __pyx_t_3; int __pyx_t_4; PyObject *__pyx_t_5 = NULL; PyObject *__pyx_t_6 = NULL; Sint16 __pyx_t_7; Sint16 __pyx_t_8; Sint16 __pyx_t_9; Sint16 __pyx_t_10; Sint16 __pyx_t_11; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("rounded_box", 0); __Pyx_INCREF(__pyx_v_rect); /* "pygame_sdl2/gfxdraw.pyx":60 * * def rounded_box(Surface surface, rect, rad, color): * cdef Color c = Color(color) # <<<<<<<<<<<<<< * if not isinstance(rect, Rect): * rect = Rect(rect) */ __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 60; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __Pyx_INCREF(__pyx_v_color); __Pyx_GIVEREF(__pyx_v_color); PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_color); __pyx_t_2 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_11pygame_sdl2_5color_Color), __pyx_t_1, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 60; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_v_c = ((struct __pyx_obj_11pygame_sdl2_5color_Color *)__pyx_t_2); __pyx_t_2 = 0; /* "pygame_sdl2/gfxdraw.pyx":61 * def rounded_box(Surface surface, rect, rad, color): * cdef Color c = Color(color) * if not isinstance(rect, Rect): # <<<<<<<<<<<<<< * rect = Rect(rect) * roundedBoxRGBA(surface.surface, rect.x, rect.y, rect.x + rect.w, rect.y + rect.h, rad, c.r, c.g, c.b, c.a) */ __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_Rect); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 61; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = PyObject_IsInstance(__pyx_v_rect, __pyx_t_2); if (unlikely(__pyx_t_3 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 61; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_4 = ((!(__pyx_t_3 != 0)) != 0); if (__pyx_t_4) { /* "pygame_sdl2/gfxdraw.pyx":62 * cdef Color c = Color(color) * if not isinstance(rect, Rect): * rect = Rect(rect) # <<<<<<<<<<<<<< * roundedBoxRGBA(surface.surface, rect.x, rect.y, rect.x + rect.w, rect.y + rect.h, rad, c.r, c.g, c.b, c.a) * */ __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_Rect); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 62; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_t_5 = NULL; if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_1))) { __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_1); if (likely(__pyx_t_5)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1); __Pyx_INCREF(__pyx_t_5); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_1, function); } } if (!__pyx_t_5) { __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_1, __pyx_v_rect); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 62; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); } else { __pyx_t_6 = PyTuple_New(1+1); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 62; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_6); __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_5); __pyx_t_5 = NULL; __Pyx_INCREF(__pyx_v_rect); __Pyx_GIVEREF(__pyx_v_rect); PyTuple_SET_ITEM(__pyx_t_6, 0+1, __pyx_v_rect); __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_6, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 62; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF_SET(__pyx_v_rect, __pyx_t_2); __pyx_t_2 = 0; /* "pygame_sdl2/gfxdraw.pyx":61 * def rounded_box(Surface surface, rect, rad, color): * cdef Color c = Color(color) * if not isinstance(rect, Rect): # <<<<<<<<<<<<<< * rect = Rect(rect) * roundedBoxRGBA(surface.surface, rect.x, rect.y, rect.x + rect.w, rect.y + rect.h, rad, c.r, c.g, c.b, c.a) */ } /* "pygame_sdl2/gfxdraw.pyx":63 * if not isinstance(rect, Rect): * rect = Rect(rect) * roundedBoxRGBA(surface.surface, rect.x, rect.y, rect.x + rect.w, rect.y + rect.h, rad, c.r, c.g, c.b, c.a) # <<<<<<<<<<<<<< * * def line(Surface surface, x1, y1, x2, y2, color): */ __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_rect, __pyx_n_s_x); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 63; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __pyx_t_7 = __Pyx_PyInt_As_int16_t(__pyx_t_2); if (unlikely((__pyx_t_7 == (Sint16)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 63; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_rect, __pyx_n_s_y); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 63; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __pyx_t_8 = __Pyx_PyInt_As_int16_t(__pyx_t_2); if (unlikely((__pyx_t_8 == (Sint16)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 63; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_rect, __pyx_n_s_x); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 63; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_rect, __pyx_n_s_w); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 63; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_t_6 = PyNumber_Add(__pyx_t_2, __pyx_t_1); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 63; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_9 = __Pyx_PyInt_As_int16_t(__pyx_t_6); if (unlikely((__pyx_t_9 == (Sint16)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 63; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_rect, __pyx_n_s_y); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 63; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_6); __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_rect, __pyx_n_s_h); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 63; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = PyNumber_Add(__pyx_t_6, __pyx_t_1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 63; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_10 = __Pyx_PyInt_As_int16_t(__pyx_t_2); if (unlikely((__pyx_t_10 == (Sint16)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 63; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_11 = __Pyx_PyInt_As_int16_t(__pyx_v_rad); if (unlikely((__pyx_t_11 == (Sint16)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 63; __pyx_clineno = __LINE__; goto __pyx_L1_error;} roundedBoxRGBA(__pyx_v_surface->surface, __pyx_t_7, __pyx_t_8, __pyx_t_9, __pyx_t_10, __pyx_t_11, __pyx_v_c->r, __pyx_v_c->g, __pyx_v_c->b, __pyx_v_c->a); /* "pygame_sdl2/gfxdraw.pyx":59 * boxRGBA(surface.surface, rect.x, rect.y, rect.x + rect.w, rect.y + rect.h, c.r, c.g, c.b, c.a) * * def rounded_box(Surface surface, rect, rad, color): # <<<<<<<<<<<<<< * cdef Color c = Color(color) * if not isinstance(rect, Rect): */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_5); __Pyx_XDECREF(__pyx_t_6); __Pyx_AddTraceback("pygame_sdl2.gfxdraw.rounded_box", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF((PyObject *)__pyx_v_c); __Pyx_XDECREF(__pyx_v_rect); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/gfxdraw.pyx":65 * roundedBoxRGBA(surface.surface, rect.x, rect.y, rect.x + rect.w, rect.y + rect.h, rad, c.r, c.g, c.b, c.a) * * def line(Surface surface, x1, y1, x2, y2, color): # <<<<<<<<<<<<<< * cdef Color c = Color(color) * lineRGBA(surface.surface, x1, y1, x2, y2, c.r, c.g, c.b, c.a) */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_7gfxdraw_15line(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static PyMethodDef __pyx_mdef_11pygame_sdl2_7gfxdraw_15line = {"line", (PyCFunction)__pyx_pw_11pygame_sdl2_7gfxdraw_15line, METH_VARARGS|METH_KEYWORDS, 0}; static PyObject *__pyx_pw_11pygame_sdl2_7gfxdraw_15line(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { struct __pyx_obj_11pygame_sdl2_7surface_Surface *__pyx_v_surface = 0; PyObject *__pyx_v_x1 = 0; PyObject *__pyx_v_y1 = 0; PyObject *__pyx_v_x2 = 0; PyObject *__pyx_v_y2 = 0; PyObject *__pyx_v_color = 0; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("line (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_surface,&__pyx_n_s_x1,&__pyx_n_s_y1,&__pyx_n_s_x2,&__pyx_n_s_y2,&__pyx_n_s_color,0}; PyObject* values[6] = {0,0,0,0,0,0}; if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5); case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4); case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_surface)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; case 1: if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_x1)) != 0)) kw_args--; else { __Pyx_RaiseArgtupleInvalid("line", 1, 6, 6, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 65; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } case 2: if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_y1)) != 0)) kw_args--; else { __Pyx_RaiseArgtupleInvalid("line", 1, 6, 6, 2); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 65; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } case 3: if (likely((values[3] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_x2)) != 0)) kw_args--; else { __Pyx_RaiseArgtupleInvalid("line", 1, 6, 6, 3); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 65; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } case 4: if (likely((values[4] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_y2)) != 0)) kw_args--; else { __Pyx_RaiseArgtupleInvalid("line", 1, 6, 6, 4); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 65; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } case 5: if (likely((values[5] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_color)) != 0)) kw_args--; else { __Pyx_RaiseArgtupleInvalid("line", 1, 6, 6, 5); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 65; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "line") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 65; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } } else if (PyTuple_GET_SIZE(__pyx_args) != 6) { goto __pyx_L5_argtuple_error; } else { values[0] = PyTuple_GET_ITEM(__pyx_args, 0); values[1] = PyTuple_GET_ITEM(__pyx_args, 1); values[2] = PyTuple_GET_ITEM(__pyx_args, 2); values[3] = PyTuple_GET_ITEM(__pyx_args, 3); values[4] = PyTuple_GET_ITEM(__pyx_args, 4); values[5] = PyTuple_GET_ITEM(__pyx_args, 5); } __pyx_v_surface = ((struct __pyx_obj_11pygame_sdl2_7surface_Surface *)values[0]); __pyx_v_x1 = values[1]; __pyx_v_y1 = values[2]; __pyx_v_x2 = values[3]; __pyx_v_y2 = values[4]; __pyx_v_color = values[5]; } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("line", 1, 6, 6, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 65; __pyx_clineno = __LINE__; goto __pyx_L3_error;} __pyx_L3_error:; __Pyx_AddTraceback("pygame_sdl2.gfxdraw.line", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_surface), __pyx_ptype_11pygame_sdl2_7surface_Surface, 1, "surface", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 65; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_r = __pyx_pf_11pygame_sdl2_7gfxdraw_14line(__pyx_self, __pyx_v_surface, __pyx_v_x1, __pyx_v_y1, __pyx_v_x2, __pyx_v_y2, __pyx_v_color); /* function exit code */ goto __pyx_L0; __pyx_L1_error:; __pyx_r = NULL; __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_7gfxdraw_14line(CYTHON_UNUSED PyObject *__pyx_self, struct __pyx_obj_11pygame_sdl2_7surface_Surface *__pyx_v_surface, PyObject *__pyx_v_x1, PyObject *__pyx_v_y1, PyObject *__pyx_v_x2, PyObject *__pyx_v_y2, PyObject *__pyx_v_color) { struct __pyx_obj_11pygame_sdl2_5color_Color *__pyx_v_c = 0; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; Sint16 __pyx_t_3; Sint16 __pyx_t_4; Sint16 __pyx_t_5; Sint16 __pyx_t_6; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("line", 0); /* "pygame_sdl2/gfxdraw.pyx":66 * * def line(Surface surface, x1, y1, x2, y2, color): * cdef Color c = Color(color) # <<<<<<<<<<<<<< * lineRGBA(surface.surface, x1, y1, x2, y2, c.r, c.g, c.b, c.a) * */ __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 66; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __Pyx_INCREF(__pyx_v_color); __Pyx_GIVEREF(__pyx_v_color); PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_color); __pyx_t_2 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_11pygame_sdl2_5color_Color), __pyx_t_1, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 66; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_v_c = ((struct __pyx_obj_11pygame_sdl2_5color_Color *)__pyx_t_2); __pyx_t_2 = 0; /* "pygame_sdl2/gfxdraw.pyx":67 * def line(Surface surface, x1, y1, x2, y2, color): * cdef Color c = Color(color) * lineRGBA(surface.surface, x1, y1, x2, y2, c.r, c.g, c.b, c.a) # <<<<<<<<<<<<<< * * def aaline(Surface surface, x1, y1, x2, y2, color): */ __pyx_t_3 = __Pyx_PyInt_As_int16_t(__pyx_v_x1); if (unlikely((__pyx_t_3 == (Sint16)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 67; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_t_4 = __Pyx_PyInt_As_int16_t(__pyx_v_y1); if (unlikely((__pyx_t_4 == (Sint16)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 67; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_t_5 = __Pyx_PyInt_As_int16_t(__pyx_v_x2); if (unlikely((__pyx_t_5 == (Sint16)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 67; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_t_6 = __Pyx_PyInt_As_int16_t(__pyx_v_y2); if (unlikely((__pyx_t_6 == (Sint16)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 67; __pyx_clineno = __LINE__; goto __pyx_L1_error;} lineRGBA(__pyx_v_surface->surface, __pyx_t_3, __pyx_t_4, __pyx_t_5, __pyx_t_6, __pyx_v_c->r, __pyx_v_c->g, __pyx_v_c->b, __pyx_v_c->a); /* "pygame_sdl2/gfxdraw.pyx":65 * roundedBoxRGBA(surface.surface, rect.x, rect.y, rect.x + rect.w, rect.y + rect.h, rad, c.r, c.g, c.b, c.a) * * def line(Surface surface, x1, y1, x2, y2, color): # <<<<<<<<<<<<<< * cdef Color c = Color(color) * lineRGBA(surface.surface, x1, y1, x2, y2, c.r, c.g, c.b, c.a) */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_AddTraceback("pygame_sdl2.gfxdraw.line", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF((PyObject *)__pyx_v_c); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/gfxdraw.pyx":69 * lineRGBA(surface.surface, x1, y1, x2, y2, c.r, c.g, c.b, c.a) * * def aaline(Surface surface, x1, y1, x2, y2, color): # <<<<<<<<<<<<<< * cdef Color c = Color(color) * aalineRGBA(surface.surface, x1, y1, x2, y2, c.r, c.g, c.b, c.a) */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_7gfxdraw_17aaline(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static PyMethodDef __pyx_mdef_11pygame_sdl2_7gfxdraw_17aaline = {"aaline", (PyCFunction)__pyx_pw_11pygame_sdl2_7gfxdraw_17aaline, METH_VARARGS|METH_KEYWORDS, 0}; static PyObject *__pyx_pw_11pygame_sdl2_7gfxdraw_17aaline(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { struct __pyx_obj_11pygame_sdl2_7surface_Surface *__pyx_v_surface = 0; PyObject *__pyx_v_x1 = 0; PyObject *__pyx_v_y1 = 0; PyObject *__pyx_v_x2 = 0; PyObject *__pyx_v_y2 = 0; PyObject *__pyx_v_color = 0; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("aaline (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_surface,&__pyx_n_s_x1,&__pyx_n_s_y1,&__pyx_n_s_x2,&__pyx_n_s_y2,&__pyx_n_s_color,0}; PyObject* values[6] = {0,0,0,0,0,0}; if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5); case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4); case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_surface)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; case 1: if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_x1)) != 0)) kw_args--; else { __Pyx_RaiseArgtupleInvalid("aaline", 1, 6, 6, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 69; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } case 2: if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_y1)) != 0)) kw_args--; else { __Pyx_RaiseArgtupleInvalid("aaline", 1, 6, 6, 2); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 69; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } case 3: if (likely((values[3] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_x2)) != 0)) kw_args--; else { __Pyx_RaiseArgtupleInvalid("aaline", 1, 6, 6, 3); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 69; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } case 4: if (likely((values[4] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_y2)) != 0)) kw_args--; else { __Pyx_RaiseArgtupleInvalid("aaline", 1, 6, 6, 4); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 69; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } case 5: if (likely((values[5] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_color)) != 0)) kw_args--; else { __Pyx_RaiseArgtupleInvalid("aaline", 1, 6, 6, 5); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 69; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "aaline") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 69; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } } else if (PyTuple_GET_SIZE(__pyx_args) != 6) { goto __pyx_L5_argtuple_error; } else { values[0] = PyTuple_GET_ITEM(__pyx_args, 0); values[1] = PyTuple_GET_ITEM(__pyx_args, 1); values[2] = PyTuple_GET_ITEM(__pyx_args, 2); values[3] = PyTuple_GET_ITEM(__pyx_args, 3); values[4] = PyTuple_GET_ITEM(__pyx_args, 4); values[5] = PyTuple_GET_ITEM(__pyx_args, 5); } __pyx_v_surface = ((struct __pyx_obj_11pygame_sdl2_7surface_Surface *)values[0]); __pyx_v_x1 = values[1]; __pyx_v_y1 = values[2]; __pyx_v_x2 = values[3]; __pyx_v_y2 = values[4]; __pyx_v_color = values[5]; } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("aaline", 1, 6, 6, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 69; __pyx_clineno = __LINE__; goto __pyx_L3_error;} __pyx_L3_error:; __Pyx_AddTraceback("pygame_sdl2.gfxdraw.aaline", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_surface), __pyx_ptype_11pygame_sdl2_7surface_Surface, 1, "surface", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 69; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_r = __pyx_pf_11pygame_sdl2_7gfxdraw_16aaline(__pyx_self, __pyx_v_surface, __pyx_v_x1, __pyx_v_y1, __pyx_v_x2, __pyx_v_y2, __pyx_v_color); /* function exit code */ goto __pyx_L0; __pyx_L1_error:; __pyx_r = NULL; __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_7gfxdraw_16aaline(CYTHON_UNUSED PyObject *__pyx_self, struct __pyx_obj_11pygame_sdl2_7surface_Surface *__pyx_v_surface, PyObject *__pyx_v_x1, PyObject *__pyx_v_y1, PyObject *__pyx_v_x2, PyObject *__pyx_v_y2, PyObject *__pyx_v_color) { struct __pyx_obj_11pygame_sdl2_5color_Color *__pyx_v_c = 0; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; Sint16 __pyx_t_3; Sint16 __pyx_t_4; Sint16 __pyx_t_5; Sint16 __pyx_t_6; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("aaline", 0); /* "pygame_sdl2/gfxdraw.pyx":70 * * def aaline(Surface surface, x1, y1, x2, y2, color): * cdef Color c = Color(color) # <<<<<<<<<<<<<< * aalineRGBA(surface.surface, x1, y1, x2, y2, c.r, c.g, c.b, c.a) * */ __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 70; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __Pyx_INCREF(__pyx_v_color); __Pyx_GIVEREF(__pyx_v_color); PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_color); __pyx_t_2 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_11pygame_sdl2_5color_Color), __pyx_t_1, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 70; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_v_c = ((struct __pyx_obj_11pygame_sdl2_5color_Color *)__pyx_t_2); __pyx_t_2 = 0; /* "pygame_sdl2/gfxdraw.pyx":71 * def aaline(Surface surface, x1, y1, x2, y2, color): * cdef Color c = Color(color) * aalineRGBA(surface.surface, x1, y1, x2, y2, c.r, c.g, c.b, c.a) # <<<<<<<<<<<<<< * * def thick_line(Surface surface, x1, y1, x2, y2, width, color): */ __pyx_t_3 = __Pyx_PyInt_As_int16_t(__pyx_v_x1); if (unlikely((__pyx_t_3 == (Sint16)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 71; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_t_4 = __Pyx_PyInt_As_int16_t(__pyx_v_y1); if (unlikely((__pyx_t_4 == (Sint16)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 71; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_t_5 = __Pyx_PyInt_As_int16_t(__pyx_v_x2); if (unlikely((__pyx_t_5 == (Sint16)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 71; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_t_6 = __Pyx_PyInt_As_int16_t(__pyx_v_y2); if (unlikely((__pyx_t_6 == (Sint16)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 71; __pyx_clineno = __LINE__; goto __pyx_L1_error;} aalineRGBA(__pyx_v_surface->surface, __pyx_t_3, __pyx_t_4, __pyx_t_5, __pyx_t_6, __pyx_v_c->r, __pyx_v_c->g, __pyx_v_c->b, __pyx_v_c->a); /* "pygame_sdl2/gfxdraw.pyx":69 * lineRGBA(surface.surface, x1, y1, x2, y2, c.r, c.g, c.b, c.a) * * def aaline(Surface surface, x1, y1, x2, y2, color): # <<<<<<<<<<<<<< * cdef Color c = Color(color) * aalineRGBA(surface.surface, x1, y1, x2, y2, c.r, c.g, c.b, c.a) */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_AddTraceback("pygame_sdl2.gfxdraw.aaline", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF((PyObject *)__pyx_v_c); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/gfxdraw.pyx":73 * aalineRGBA(surface.surface, x1, y1, x2, y2, c.r, c.g, c.b, c.a) * * def thick_line(Surface surface, x1, y1, x2, y2, width, color): # <<<<<<<<<<<<<< * cdef Color c = Color(color) * */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_7gfxdraw_19thick_line(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static PyMethodDef __pyx_mdef_11pygame_sdl2_7gfxdraw_19thick_line = {"thick_line", (PyCFunction)__pyx_pw_11pygame_sdl2_7gfxdraw_19thick_line, METH_VARARGS|METH_KEYWORDS, 0}; static PyObject *__pyx_pw_11pygame_sdl2_7gfxdraw_19thick_line(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { struct __pyx_obj_11pygame_sdl2_7surface_Surface *__pyx_v_surface = 0; PyObject *__pyx_v_x1 = 0; PyObject *__pyx_v_y1 = 0; PyObject *__pyx_v_x2 = 0; PyObject *__pyx_v_y2 = 0; PyObject *__pyx_v_width = 0; PyObject *__pyx_v_color = 0; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("thick_line (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_surface,&__pyx_n_s_x1,&__pyx_n_s_y1,&__pyx_n_s_x2,&__pyx_n_s_y2,&__pyx_n_s_width,&__pyx_n_s_color,0}; PyObject* values[7] = {0,0,0,0,0,0,0}; if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 7: values[6] = PyTuple_GET_ITEM(__pyx_args, 6); case 6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5); case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4); case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_surface)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; case 1: if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_x1)) != 0)) kw_args--; else { __Pyx_RaiseArgtupleInvalid("thick_line", 1, 7, 7, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 73; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } case 2: if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_y1)) != 0)) kw_args--; else { __Pyx_RaiseArgtupleInvalid("thick_line", 1, 7, 7, 2); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 73; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } case 3: if (likely((values[3] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_x2)) != 0)) kw_args--; else { __Pyx_RaiseArgtupleInvalid("thick_line", 1, 7, 7, 3); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 73; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } case 4: if (likely((values[4] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_y2)) != 0)) kw_args--; else { __Pyx_RaiseArgtupleInvalid("thick_line", 1, 7, 7, 4); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 73; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } case 5: if (likely((values[5] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_width)) != 0)) kw_args--; else { __Pyx_RaiseArgtupleInvalid("thick_line", 1, 7, 7, 5); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 73; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } case 6: if (likely((values[6] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_color)) != 0)) kw_args--; else { __Pyx_RaiseArgtupleInvalid("thick_line", 1, 7, 7, 6); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 73; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "thick_line") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 73; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } } else if (PyTuple_GET_SIZE(__pyx_args) != 7) { goto __pyx_L5_argtuple_error; } else { values[0] = PyTuple_GET_ITEM(__pyx_args, 0); values[1] = PyTuple_GET_ITEM(__pyx_args, 1); values[2] = PyTuple_GET_ITEM(__pyx_args, 2); values[3] = PyTuple_GET_ITEM(__pyx_args, 3); values[4] = PyTuple_GET_ITEM(__pyx_args, 4); values[5] = PyTuple_GET_ITEM(__pyx_args, 5); values[6] = PyTuple_GET_ITEM(__pyx_args, 6); } __pyx_v_surface = ((struct __pyx_obj_11pygame_sdl2_7surface_Surface *)values[0]); __pyx_v_x1 = values[1]; __pyx_v_y1 = values[2]; __pyx_v_x2 = values[3]; __pyx_v_y2 = values[4]; __pyx_v_width = values[5]; __pyx_v_color = values[6]; } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("thick_line", 1, 7, 7, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 73; __pyx_clineno = __LINE__; goto __pyx_L3_error;} __pyx_L3_error:; __Pyx_AddTraceback("pygame_sdl2.gfxdraw.thick_line", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_surface), __pyx_ptype_11pygame_sdl2_7surface_Surface, 1, "surface", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 73; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_r = __pyx_pf_11pygame_sdl2_7gfxdraw_18thick_line(__pyx_self, __pyx_v_surface, __pyx_v_x1, __pyx_v_y1, __pyx_v_x2, __pyx_v_y2, __pyx_v_width, __pyx_v_color); /* function exit code */ goto __pyx_L0; __pyx_L1_error:; __pyx_r = NULL; __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_7gfxdraw_18thick_line(CYTHON_UNUSED PyObject *__pyx_self, struct __pyx_obj_11pygame_sdl2_7surface_Surface *__pyx_v_surface, PyObject *__pyx_v_x1, PyObject *__pyx_v_y1, PyObject *__pyx_v_x2, PyObject *__pyx_v_y2, PyObject *__pyx_v_width, PyObject *__pyx_v_color) { struct __pyx_obj_11pygame_sdl2_5color_Color *__pyx_v_c = 0; int __pyx_v_x1int; int __pyx_v_y1int; int __pyx_v_x2int; int __pyx_v_y2int; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; int __pyx_t_3; int __pyx_t_4; int __pyx_t_5; Uint8 __pyx_t_6; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("thick_line", 0); /* "pygame_sdl2/gfxdraw.pyx":74 * * def thick_line(Surface surface, x1, y1, x2, y2, width, color): * cdef Color c = Color(color) # <<<<<<<<<<<<<< * * # This locks up in c code when trying to draw a zero-length line. So make */ __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 74; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __Pyx_INCREF(__pyx_v_color); __Pyx_GIVEREF(__pyx_v_color); PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_color); __pyx_t_2 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_11pygame_sdl2_5color_Color), __pyx_t_1, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 74; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_v_c = ((struct __pyx_obj_11pygame_sdl2_5color_Color *)__pyx_t_2); __pyx_t_2 = 0; /* "pygame_sdl2/gfxdraw.pyx":79 * # sure that doesn't happen. * cdef int x1int, y1int, x2int, y2int * x1int = x1 # <<<<<<<<<<<<<< * y1int = y1 * x2int = x2 */ __pyx_t_3 = __Pyx_PyInt_As_int(__pyx_v_x1); if (unlikely((__pyx_t_3 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 79; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_v_x1int = __pyx_t_3; /* "pygame_sdl2/gfxdraw.pyx":80 * cdef int x1int, y1int, x2int, y2int * x1int = x1 * y1int = y1 # <<<<<<<<<<<<<< * x2int = x2 * y2int = y2 */ __pyx_t_3 = __Pyx_PyInt_As_int(__pyx_v_y1); if (unlikely((__pyx_t_3 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 80; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_v_y1int = __pyx_t_3; /* "pygame_sdl2/gfxdraw.pyx":81 * x1int = x1 * y1int = y1 * x2int = x2 # <<<<<<<<<<<<<< * y2int = y2 * */ __pyx_t_3 = __Pyx_PyInt_As_int(__pyx_v_x2); if (unlikely((__pyx_t_3 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 81; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_v_x2int = __pyx_t_3; /* "pygame_sdl2/gfxdraw.pyx":82 * y1int = y1 * x2int = x2 * y2int = y2 # <<<<<<<<<<<<<< * * */ __pyx_t_3 = __Pyx_PyInt_As_int(__pyx_v_y2); if (unlikely((__pyx_t_3 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 82; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_v_y2int = __pyx_t_3; /* "pygame_sdl2/gfxdraw.pyx":85 * * * if x1int == x2int and y1int == y2int: # <<<<<<<<<<<<<< * return * */ __pyx_t_5 = ((__pyx_v_x1int == __pyx_v_x2int) != 0); if (__pyx_t_5) { } else { __pyx_t_4 = __pyx_t_5; goto __pyx_L4_bool_binop_done; } __pyx_t_5 = ((__pyx_v_y1int == __pyx_v_y2int) != 0); __pyx_t_4 = __pyx_t_5; __pyx_L4_bool_binop_done:; if (__pyx_t_4) { /* "pygame_sdl2/gfxdraw.pyx":86 * * if x1int == x2int and y1int == y2int: * return # <<<<<<<<<<<<<< * * thickLineRGBA(surface.surface, x1int, y1int, x2int, y2int, width, c.r, c.g, c.b, c.a) */ __Pyx_XDECREF(__pyx_r); __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; /* "pygame_sdl2/gfxdraw.pyx":85 * * * if x1int == x2int and y1int == y2int: # <<<<<<<<<<<<<< * return * */ } /* "pygame_sdl2/gfxdraw.pyx":88 * return * * thickLineRGBA(surface.surface, x1int, y1int, x2int, y2int, width, c.r, c.g, c.b, c.a) # <<<<<<<<<<<<<< * * def circle(Surface surface, x, y, r, color): */ __pyx_t_6 = __Pyx_PyInt_As_uint8_t(__pyx_v_width); if (unlikely((__pyx_t_6 == (Uint8)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 88; __pyx_clineno = __LINE__; goto __pyx_L1_error;} thickLineRGBA(__pyx_v_surface->surface, __pyx_v_x1int, __pyx_v_y1int, __pyx_v_x2int, __pyx_v_y2int, __pyx_t_6, __pyx_v_c->r, __pyx_v_c->g, __pyx_v_c->b, __pyx_v_c->a); /* "pygame_sdl2/gfxdraw.pyx":73 * aalineRGBA(surface.surface, x1, y1, x2, y2, c.r, c.g, c.b, c.a) * * def thick_line(Surface surface, x1, y1, x2, y2, width, color): # <<<<<<<<<<<<<< * cdef Color c = Color(color) * */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_AddTraceback("pygame_sdl2.gfxdraw.thick_line", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF((PyObject *)__pyx_v_c); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/gfxdraw.pyx":90 * thickLineRGBA(surface.surface, x1int, y1int, x2int, y2int, width, c.r, c.g, c.b, c.a) * * def circle(Surface surface, x, y, r, color): # <<<<<<<<<<<<<< * cdef Color c = Color(color) * circleRGBA(surface.surface, x, y, r, c.r, c.g, c.b, c.a) */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_7gfxdraw_21circle(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static PyMethodDef __pyx_mdef_11pygame_sdl2_7gfxdraw_21circle = {"circle", (PyCFunction)__pyx_pw_11pygame_sdl2_7gfxdraw_21circle, METH_VARARGS|METH_KEYWORDS, 0}; static PyObject *__pyx_pw_11pygame_sdl2_7gfxdraw_21circle(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { struct __pyx_obj_11pygame_sdl2_7surface_Surface *__pyx_v_surface = 0; PyObject *__pyx_v_x = 0; PyObject *__pyx_v_y = 0; PyObject *__pyx_v_r = 0; PyObject *__pyx_v_color = 0; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("circle (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_surface,&__pyx_n_s_x,&__pyx_n_s_y,&__pyx_n_s_r,&__pyx_n_s_color,0}; PyObject* values[5] = {0,0,0,0,0}; if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4); case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_surface)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; case 1: if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_x)) != 0)) kw_args--; else { __Pyx_RaiseArgtupleInvalid("circle", 1, 5, 5, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 90; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } case 2: if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_y)) != 0)) kw_args--; else { __Pyx_RaiseArgtupleInvalid("circle", 1, 5, 5, 2); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 90; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } case 3: if (likely((values[3] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_r)) != 0)) kw_args--; else { __Pyx_RaiseArgtupleInvalid("circle", 1, 5, 5, 3); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 90; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } case 4: if (likely((values[4] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_color)) != 0)) kw_args--; else { __Pyx_RaiseArgtupleInvalid("circle", 1, 5, 5, 4); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 90; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "circle") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 90; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } } else if (PyTuple_GET_SIZE(__pyx_args) != 5) { goto __pyx_L5_argtuple_error; } else { values[0] = PyTuple_GET_ITEM(__pyx_args, 0); values[1] = PyTuple_GET_ITEM(__pyx_args, 1); values[2] = PyTuple_GET_ITEM(__pyx_args, 2); values[3] = PyTuple_GET_ITEM(__pyx_args, 3); values[4] = PyTuple_GET_ITEM(__pyx_args, 4); } __pyx_v_surface = ((struct __pyx_obj_11pygame_sdl2_7surface_Surface *)values[0]); __pyx_v_x = values[1]; __pyx_v_y = values[2]; __pyx_v_r = values[3]; __pyx_v_color = values[4]; } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("circle", 1, 5, 5, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 90; __pyx_clineno = __LINE__; goto __pyx_L3_error;} __pyx_L3_error:; __Pyx_AddTraceback("pygame_sdl2.gfxdraw.circle", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_surface), __pyx_ptype_11pygame_sdl2_7surface_Surface, 1, "surface", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 90; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_r = __pyx_pf_11pygame_sdl2_7gfxdraw_20circle(__pyx_self, __pyx_v_surface, __pyx_v_x, __pyx_v_y, __pyx_v_r, __pyx_v_color); /* function exit code */ goto __pyx_L0; __pyx_L1_error:; __pyx_r = NULL; __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_7gfxdraw_20circle(CYTHON_UNUSED PyObject *__pyx_self, struct __pyx_obj_11pygame_sdl2_7surface_Surface *__pyx_v_surface, PyObject *__pyx_v_x, PyObject *__pyx_v_y, PyObject *__pyx_v_r, PyObject *__pyx_v_color) { struct __pyx_obj_11pygame_sdl2_5color_Color *__pyx_v_c = 0; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; Sint16 __pyx_t_3; Sint16 __pyx_t_4; Sint16 __pyx_t_5; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("circle", 0); /* "pygame_sdl2/gfxdraw.pyx":91 * * def circle(Surface surface, x, y, r, color): * cdef Color c = Color(color) # <<<<<<<<<<<<<< * circleRGBA(surface.surface, x, y, r, c.r, c.g, c.b, c.a) * */ __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 91; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __Pyx_INCREF(__pyx_v_color); __Pyx_GIVEREF(__pyx_v_color); PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_color); __pyx_t_2 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_11pygame_sdl2_5color_Color), __pyx_t_1, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 91; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_v_c = ((struct __pyx_obj_11pygame_sdl2_5color_Color *)__pyx_t_2); __pyx_t_2 = 0; /* "pygame_sdl2/gfxdraw.pyx":92 * def circle(Surface surface, x, y, r, color): * cdef Color c = Color(color) * circleRGBA(surface.surface, x, y, r, c.r, c.g, c.b, c.a) # <<<<<<<<<<<<<< * * def arc(Surface surface, x, y, r, start, end, color): */ __pyx_t_3 = __Pyx_PyInt_As_int16_t(__pyx_v_x); if (unlikely((__pyx_t_3 == (Sint16)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 92; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_t_4 = __Pyx_PyInt_As_int16_t(__pyx_v_y); if (unlikely((__pyx_t_4 == (Sint16)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 92; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_t_5 = __Pyx_PyInt_As_int16_t(__pyx_v_r); if (unlikely((__pyx_t_5 == (Sint16)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 92; __pyx_clineno = __LINE__; goto __pyx_L1_error;} circleRGBA(__pyx_v_surface->surface, __pyx_t_3, __pyx_t_4, __pyx_t_5, __pyx_v_c->r, __pyx_v_c->g, __pyx_v_c->b, __pyx_v_c->a); /* "pygame_sdl2/gfxdraw.pyx":90 * thickLineRGBA(surface.surface, x1int, y1int, x2int, y2int, width, c.r, c.g, c.b, c.a) * * def circle(Surface surface, x, y, r, color): # <<<<<<<<<<<<<< * cdef Color c = Color(color) * circleRGBA(surface.surface, x, y, r, c.r, c.g, c.b, c.a) */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_AddTraceback("pygame_sdl2.gfxdraw.circle", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF((PyObject *)__pyx_v_c); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/gfxdraw.pyx":94 * circleRGBA(surface.surface, x, y, r, c.r, c.g, c.b, c.a) * * def arc(Surface surface, x, y, r, start, end, color): # <<<<<<<<<<<<<< * cdef Color c = Color(color) * arcRGBA(surface.surface, x, y, r, start, end, c.r, c.g, c.b, c.a) */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_7gfxdraw_23arc(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static PyMethodDef __pyx_mdef_11pygame_sdl2_7gfxdraw_23arc = {"arc", (PyCFunction)__pyx_pw_11pygame_sdl2_7gfxdraw_23arc, METH_VARARGS|METH_KEYWORDS, 0}; static PyObject *__pyx_pw_11pygame_sdl2_7gfxdraw_23arc(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { struct __pyx_obj_11pygame_sdl2_7surface_Surface *__pyx_v_surface = 0; PyObject *__pyx_v_x = 0; PyObject *__pyx_v_y = 0; PyObject *__pyx_v_r = 0; PyObject *__pyx_v_start = 0; PyObject *__pyx_v_end = 0; PyObject *__pyx_v_color = 0; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("arc (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_surface,&__pyx_n_s_x,&__pyx_n_s_y,&__pyx_n_s_r,&__pyx_n_s_start,&__pyx_n_s_end,&__pyx_n_s_color,0}; PyObject* values[7] = {0,0,0,0,0,0,0}; if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 7: values[6] = PyTuple_GET_ITEM(__pyx_args, 6); case 6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5); case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4); case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_surface)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; case 1: if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_x)) != 0)) kw_args--; else { __Pyx_RaiseArgtupleInvalid("arc", 1, 7, 7, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 94; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } case 2: if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_y)) != 0)) kw_args--; else { __Pyx_RaiseArgtupleInvalid("arc", 1, 7, 7, 2); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 94; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } case 3: if (likely((values[3] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_r)) != 0)) kw_args--; else { __Pyx_RaiseArgtupleInvalid("arc", 1, 7, 7, 3); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 94; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } case 4: if (likely((values[4] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_start)) != 0)) kw_args--; else { __Pyx_RaiseArgtupleInvalid("arc", 1, 7, 7, 4); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 94; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } case 5: if (likely((values[5] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_end)) != 0)) kw_args--; else { __Pyx_RaiseArgtupleInvalid("arc", 1, 7, 7, 5); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 94; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } case 6: if (likely((values[6] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_color)) != 0)) kw_args--; else { __Pyx_RaiseArgtupleInvalid("arc", 1, 7, 7, 6); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 94; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "arc") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 94; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } } else if (PyTuple_GET_SIZE(__pyx_args) != 7) { goto __pyx_L5_argtuple_error; } else { values[0] = PyTuple_GET_ITEM(__pyx_args, 0); values[1] = PyTuple_GET_ITEM(__pyx_args, 1); values[2] = PyTuple_GET_ITEM(__pyx_args, 2); values[3] = PyTuple_GET_ITEM(__pyx_args, 3); values[4] = PyTuple_GET_ITEM(__pyx_args, 4); values[5] = PyTuple_GET_ITEM(__pyx_args, 5); values[6] = PyTuple_GET_ITEM(__pyx_args, 6); } __pyx_v_surface = ((struct __pyx_obj_11pygame_sdl2_7surface_Surface *)values[0]); __pyx_v_x = values[1]; __pyx_v_y = values[2]; __pyx_v_r = values[3]; __pyx_v_start = values[4]; __pyx_v_end = values[5]; __pyx_v_color = values[6]; } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("arc", 1, 7, 7, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 94; __pyx_clineno = __LINE__; goto __pyx_L3_error;} __pyx_L3_error:; __Pyx_AddTraceback("pygame_sdl2.gfxdraw.arc", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_surface), __pyx_ptype_11pygame_sdl2_7surface_Surface, 1, "surface", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 94; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_r = __pyx_pf_11pygame_sdl2_7gfxdraw_22arc(__pyx_self, __pyx_v_surface, __pyx_v_x, __pyx_v_y, __pyx_v_r, __pyx_v_start, __pyx_v_end, __pyx_v_color); /* function exit code */ goto __pyx_L0; __pyx_L1_error:; __pyx_r = NULL; __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_7gfxdraw_22arc(CYTHON_UNUSED PyObject *__pyx_self, struct __pyx_obj_11pygame_sdl2_7surface_Surface *__pyx_v_surface, PyObject *__pyx_v_x, PyObject *__pyx_v_y, PyObject *__pyx_v_r, PyObject *__pyx_v_start, PyObject *__pyx_v_end, PyObject *__pyx_v_color) { struct __pyx_obj_11pygame_sdl2_5color_Color *__pyx_v_c = 0; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; Sint16 __pyx_t_3; Sint16 __pyx_t_4; Sint16 __pyx_t_5; Sint16 __pyx_t_6; Sint16 __pyx_t_7; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("arc", 0); /* "pygame_sdl2/gfxdraw.pyx":95 * * def arc(Surface surface, x, y, r, start, end, color): * cdef Color c = Color(color) # <<<<<<<<<<<<<< * arcRGBA(surface.surface, x, y, r, start, end, c.r, c.g, c.b, c.a) * */ __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 95; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __Pyx_INCREF(__pyx_v_color); __Pyx_GIVEREF(__pyx_v_color); PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_color); __pyx_t_2 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_11pygame_sdl2_5color_Color), __pyx_t_1, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 95; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_v_c = ((struct __pyx_obj_11pygame_sdl2_5color_Color *)__pyx_t_2); __pyx_t_2 = 0; /* "pygame_sdl2/gfxdraw.pyx":96 * def arc(Surface surface, x, y, r, start, end, color): * cdef Color c = Color(color) * arcRGBA(surface.surface, x, y, r, start, end, c.r, c.g, c.b, c.a) # <<<<<<<<<<<<<< * * def aacircle(Surface surface, x, y, r, color): */ __pyx_t_3 = __Pyx_PyInt_As_int16_t(__pyx_v_x); if (unlikely((__pyx_t_3 == (Sint16)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 96; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_t_4 = __Pyx_PyInt_As_int16_t(__pyx_v_y); if (unlikely((__pyx_t_4 == (Sint16)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 96; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_t_5 = __Pyx_PyInt_As_int16_t(__pyx_v_r); if (unlikely((__pyx_t_5 == (Sint16)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 96; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_t_6 = __Pyx_PyInt_As_int16_t(__pyx_v_start); if (unlikely((__pyx_t_6 == (Sint16)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 96; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_t_7 = __Pyx_PyInt_As_int16_t(__pyx_v_end); if (unlikely((__pyx_t_7 == (Sint16)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 96; __pyx_clineno = __LINE__; goto __pyx_L1_error;} arcRGBA(__pyx_v_surface->surface, __pyx_t_3, __pyx_t_4, __pyx_t_5, __pyx_t_6, __pyx_t_7, __pyx_v_c->r, __pyx_v_c->g, __pyx_v_c->b, __pyx_v_c->a); /* "pygame_sdl2/gfxdraw.pyx":94 * circleRGBA(surface.surface, x, y, r, c.r, c.g, c.b, c.a) * * def arc(Surface surface, x, y, r, start, end, color): # <<<<<<<<<<<<<< * cdef Color c = Color(color) * arcRGBA(surface.surface, x, y, r, start, end, c.r, c.g, c.b, c.a) */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_AddTraceback("pygame_sdl2.gfxdraw.arc", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF((PyObject *)__pyx_v_c); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/gfxdraw.pyx":98 * arcRGBA(surface.surface, x, y, r, start, end, c.r, c.g, c.b, c.a) * * def aacircle(Surface surface, x, y, r, color): # <<<<<<<<<<<<<< * cdef Color c = Color(color) * aacircleRGBA(surface.surface, x, y, r, c.r, c.g, c.b, c.a) */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_7gfxdraw_25aacircle(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static PyMethodDef __pyx_mdef_11pygame_sdl2_7gfxdraw_25aacircle = {"aacircle", (PyCFunction)__pyx_pw_11pygame_sdl2_7gfxdraw_25aacircle, METH_VARARGS|METH_KEYWORDS, 0}; static PyObject *__pyx_pw_11pygame_sdl2_7gfxdraw_25aacircle(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { struct __pyx_obj_11pygame_sdl2_7surface_Surface *__pyx_v_surface = 0; PyObject *__pyx_v_x = 0; PyObject *__pyx_v_y = 0; PyObject *__pyx_v_r = 0; PyObject *__pyx_v_color = 0; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("aacircle (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_surface,&__pyx_n_s_x,&__pyx_n_s_y,&__pyx_n_s_r,&__pyx_n_s_color,0}; PyObject* values[5] = {0,0,0,0,0}; if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4); case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_surface)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; case 1: if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_x)) != 0)) kw_args--; else { __Pyx_RaiseArgtupleInvalid("aacircle", 1, 5, 5, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 98; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } case 2: if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_y)) != 0)) kw_args--; else { __Pyx_RaiseArgtupleInvalid("aacircle", 1, 5, 5, 2); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 98; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } case 3: if (likely((values[3] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_r)) != 0)) kw_args--; else { __Pyx_RaiseArgtupleInvalid("aacircle", 1, 5, 5, 3); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 98; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } case 4: if (likely((values[4] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_color)) != 0)) kw_args--; else { __Pyx_RaiseArgtupleInvalid("aacircle", 1, 5, 5, 4); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 98; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "aacircle") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 98; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } } else if (PyTuple_GET_SIZE(__pyx_args) != 5) { goto __pyx_L5_argtuple_error; } else { values[0] = PyTuple_GET_ITEM(__pyx_args, 0); values[1] = PyTuple_GET_ITEM(__pyx_args, 1); values[2] = PyTuple_GET_ITEM(__pyx_args, 2); values[3] = PyTuple_GET_ITEM(__pyx_args, 3); values[4] = PyTuple_GET_ITEM(__pyx_args, 4); } __pyx_v_surface = ((struct __pyx_obj_11pygame_sdl2_7surface_Surface *)values[0]); __pyx_v_x = values[1]; __pyx_v_y = values[2]; __pyx_v_r = values[3]; __pyx_v_color = values[4]; } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("aacircle", 1, 5, 5, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 98; __pyx_clineno = __LINE__; goto __pyx_L3_error;} __pyx_L3_error:; __Pyx_AddTraceback("pygame_sdl2.gfxdraw.aacircle", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_surface), __pyx_ptype_11pygame_sdl2_7surface_Surface, 1, "surface", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 98; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_r = __pyx_pf_11pygame_sdl2_7gfxdraw_24aacircle(__pyx_self, __pyx_v_surface, __pyx_v_x, __pyx_v_y, __pyx_v_r, __pyx_v_color); /* function exit code */ goto __pyx_L0; __pyx_L1_error:; __pyx_r = NULL; __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_7gfxdraw_24aacircle(CYTHON_UNUSED PyObject *__pyx_self, struct __pyx_obj_11pygame_sdl2_7surface_Surface *__pyx_v_surface, PyObject *__pyx_v_x, PyObject *__pyx_v_y, PyObject *__pyx_v_r, PyObject *__pyx_v_color) { struct __pyx_obj_11pygame_sdl2_5color_Color *__pyx_v_c = 0; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; Sint16 __pyx_t_3; Sint16 __pyx_t_4; Sint16 __pyx_t_5; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("aacircle", 0); /* "pygame_sdl2/gfxdraw.pyx":99 * * def aacircle(Surface surface, x, y, r, color): * cdef Color c = Color(color) # <<<<<<<<<<<<<< * aacircleRGBA(surface.surface, x, y, r, c.r, c.g, c.b, c.a) * */ __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 99; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __Pyx_INCREF(__pyx_v_color); __Pyx_GIVEREF(__pyx_v_color); PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_color); __pyx_t_2 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_11pygame_sdl2_5color_Color), __pyx_t_1, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 99; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_v_c = ((struct __pyx_obj_11pygame_sdl2_5color_Color *)__pyx_t_2); __pyx_t_2 = 0; /* "pygame_sdl2/gfxdraw.pyx":100 * def aacircle(Surface surface, x, y, r, color): * cdef Color c = Color(color) * aacircleRGBA(surface.surface, x, y, r, c.r, c.g, c.b, c.a) # <<<<<<<<<<<<<< * * def filled_circle(Surface surface, x, y, r, color): */ __pyx_t_3 = __Pyx_PyInt_As_int16_t(__pyx_v_x); if (unlikely((__pyx_t_3 == (Sint16)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 100; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_t_4 = __Pyx_PyInt_As_int16_t(__pyx_v_y); if (unlikely((__pyx_t_4 == (Sint16)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 100; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_t_5 = __Pyx_PyInt_As_int16_t(__pyx_v_r); if (unlikely((__pyx_t_5 == (Sint16)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 100; __pyx_clineno = __LINE__; goto __pyx_L1_error;} aacircleRGBA(__pyx_v_surface->surface, __pyx_t_3, __pyx_t_4, __pyx_t_5, __pyx_v_c->r, __pyx_v_c->g, __pyx_v_c->b, __pyx_v_c->a); /* "pygame_sdl2/gfxdraw.pyx":98 * arcRGBA(surface.surface, x, y, r, start, end, c.r, c.g, c.b, c.a) * * def aacircle(Surface surface, x, y, r, color): # <<<<<<<<<<<<<< * cdef Color c = Color(color) * aacircleRGBA(surface.surface, x, y, r, c.r, c.g, c.b, c.a) */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_AddTraceback("pygame_sdl2.gfxdraw.aacircle", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF((PyObject *)__pyx_v_c); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/gfxdraw.pyx":102 * aacircleRGBA(surface.surface, x, y, r, c.r, c.g, c.b, c.a) * * def filled_circle(Surface surface, x, y, r, color): # <<<<<<<<<<<<<< * cdef Color c = Color(color) * filledCircleRGBA(surface.surface, x, y, r, c.r, c.g, c.b, c.a) */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_7gfxdraw_27filled_circle(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static PyMethodDef __pyx_mdef_11pygame_sdl2_7gfxdraw_27filled_circle = {"filled_circle", (PyCFunction)__pyx_pw_11pygame_sdl2_7gfxdraw_27filled_circle, METH_VARARGS|METH_KEYWORDS, 0}; static PyObject *__pyx_pw_11pygame_sdl2_7gfxdraw_27filled_circle(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { struct __pyx_obj_11pygame_sdl2_7surface_Surface *__pyx_v_surface = 0; PyObject *__pyx_v_x = 0; PyObject *__pyx_v_y = 0; PyObject *__pyx_v_r = 0; PyObject *__pyx_v_color = 0; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("filled_circle (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_surface,&__pyx_n_s_x,&__pyx_n_s_y,&__pyx_n_s_r,&__pyx_n_s_color,0}; PyObject* values[5] = {0,0,0,0,0}; if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4); case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_surface)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; case 1: if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_x)) != 0)) kw_args--; else { __Pyx_RaiseArgtupleInvalid("filled_circle", 1, 5, 5, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 102; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } case 2: if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_y)) != 0)) kw_args--; else { __Pyx_RaiseArgtupleInvalid("filled_circle", 1, 5, 5, 2); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 102; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } case 3: if (likely((values[3] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_r)) != 0)) kw_args--; else { __Pyx_RaiseArgtupleInvalid("filled_circle", 1, 5, 5, 3); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 102; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } case 4: if (likely((values[4] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_color)) != 0)) kw_args--; else { __Pyx_RaiseArgtupleInvalid("filled_circle", 1, 5, 5, 4); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 102; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "filled_circle") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 102; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } } else if (PyTuple_GET_SIZE(__pyx_args) != 5) { goto __pyx_L5_argtuple_error; } else { values[0] = PyTuple_GET_ITEM(__pyx_args, 0); values[1] = PyTuple_GET_ITEM(__pyx_args, 1); values[2] = PyTuple_GET_ITEM(__pyx_args, 2); values[3] = PyTuple_GET_ITEM(__pyx_args, 3); values[4] = PyTuple_GET_ITEM(__pyx_args, 4); } __pyx_v_surface = ((struct __pyx_obj_11pygame_sdl2_7surface_Surface *)values[0]); __pyx_v_x = values[1]; __pyx_v_y = values[2]; __pyx_v_r = values[3]; __pyx_v_color = values[4]; } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("filled_circle", 1, 5, 5, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 102; __pyx_clineno = __LINE__; goto __pyx_L3_error;} __pyx_L3_error:; __Pyx_AddTraceback("pygame_sdl2.gfxdraw.filled_circle", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_surface), __pyx_ptype_11pygame_sdl2_7surface_Surface, 1, "surface", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 102; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_r = __pyx_pf_11pygame_sdl2_7gfxdraw_26filled_circle(__pyx_self, __pyx_v_surface, __pyx_v_x, __pyx_v_y, __pyx_v_r, __pyx_v_color); /* function exit code */ goto __pyx_L0; __pyx_L1_error:; __pyx_r = NULL; __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_7gfxdraw_26filled_circle(CYTHON_UNUSED PyObject *__pyx_self, struct __pyx_obj_11pygame_sdl2_7surface_Surface *__pyx_v_surface, PyObject *__pyx_v_x, PyObject *__pyx_v_y, PyObject *__pyx_v_r, PyObject *__pyx_v_color) { struct __pyx_obj_11pygame_sdl2_5color_Color *__pyx_v_c = 0; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; Sint16 __pyx_t_3; Sint16 __pyx_t_4; Sint16 __pyx_t_5; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("filled_circle", 0); /* "pygame_sdl2/gfxdraw.pyx":103 * * def filled_circle(Surface surface, x, y, r, color): * cdef Color c = Color(color) # <<<<<<<<<<<<<< * filledCircleRGBA(surface.surface, x, y, r, c.r, c.g, c.b, c.a) * */ __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 103; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __Pyx_INCREF(__pyx_v_color); __Pyx_GIVEREF(__pyx_v_color); PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_color); __pyx_t_2 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_11pygame_sdl2_5color_Color), __pyx_t_1, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 103; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_v_c = ((struct __pyx_obj_11pygame_sdl2_5color_Color *)__pyx_t_2); __pyx_t_2 = 0; /* "pygame_sdl2/gfxdraw.pyx":104 * def filled_circle(Surface surface, x, y, r, color): * cdef Color c = Color(color) * filledCircleRGBA(surface.surface, x, y, r, c.r, c.g, c.b, c.a) # <<<<<<<<<<<<<< * * def ellipse(Surface surface, x, y, rx, ry, color): */ __pyx_t_3 = __Pyx_PyInt_As_int16_t(__pyx_v_x); if (unlikely((__pyx_t_3 == (Sint16)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 104; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_t_4 = __Pyx_PyInt_As_int16_t(__pyx_v_y); if (unlikely((__pyx_t_4 == (Sint16)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 104; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_t_5 = __Pyx_PyInt_As_int16_t(__pyx_v_r); if (unlikely((__pyx_t_5 == (Sint16)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 104; __pyx_clineno = __LINE__; goto __pyx_L1_error;} filledCircleRGBA(__pyx_v_surface->surface, __pyx_t_3, __pyx_t_4, __pyx_t_5, __pyx_v_c->r, __pyx_v_c->g, __pyx_v_c->b, __pyx_v_c->a); /* "pygame_sdl2/gfxdraw.pyx":102 * aacircleRGBA(surface.surface, x, y, r, c.r, c.g, c.b, c.a) * * def filled_circle(Surface surface, x, y, r, color): # <<<<<<<<<<<<<< * cdef Color c = Color(color) * filledCircleRGBA(surface.surface, x, y, r, c.r, c.g, c.b, c.a) */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_AddTraceback("pygame_sdl2.gfxdraw.filled_circle", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF((PyObject *)__pyx_v_c); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/gfxdraw.pyx":106 * filledCircleRGBA(surface.surface, x, y, r, c.r, c.g, c.b, c.a) * * def ellipse(Surface surface, x, y, rx, ry, color): # <<<<<<<<<<<<<< * cdef Color c = Color(color) * ellipseRGBA(surface.surface, x, y, rx, ry, c.r, c.g, c.b, c.a) */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_7gfxdraw_29ellipse(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static PyMethodDef __pyx_mdef_11pygame_sdl2_7gfxdraw_29ellipse = {"ellipse", (PyCFunction)__pyx_pw_11pygame_sdl2_7gfxdraw_29ellipse, METH_VARARGS|METH_KEYWORDS, 0}; static PyObject *__pyx_pw_11pygame_sdl2_7gfxdraw_29ellipse(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { struct __pyx_obj_11pygame_sdl2_7surface_Surface *__pyx_v_surface = 0; PyObject *__pyx_v_x = 0; PyObject *__pyx_v_y = 0; PyObject *__pyx_v_rx = 0; PyObject *__pyx_v_ry = 0; PyObject *__pyx_v_color = 0; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("ellipse (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_surface,&__pyx_n_s_x,&__pyx_n_s_y,&__pyx_n_s_rx,&__pyx_n_s_ry,&__pyx_n_s_color,0}; PyObject* values[6] = {0,0,0,0,0,0}; if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5); case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4); case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_surface)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; case 1: if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_x)) != 0)) kw_args--; else { __Pyx_RaiseArgtupleInvalid("ellipse", 1, 6, 6, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 106; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } case 2: if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_y)) != 0)) kw_args--; else { __Pyx_RaiseArgtupleInvalid("ellipse", 1, 6, 6, 2); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 106; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } case 3: if (likely((values[3] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_rx)) != 0)) kw_args--; else { __Pyx_RaiseArgtupleInvalid("ellipse", 1, 6, 6, 3); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 106; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } case 4: if (likely((values[4] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_ry)) != 0)) kw_args--; else { __Pyx_RaiseArgtupleInvalid("ellipse", 1, 6, 6, 4); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 106; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } case 5: if (likely((values[5] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_color)) != 0)) kw_args--; else { __Pyx_RaiseArgtupleInvalid("ellipse", 1, 6, 6, 5); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 106; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "ellipse") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 106; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } } else if (PyTuple_GET_SIZE(__pyx_args) != 6) { goto __pyx_L5_argtuple_error; } else { values[0] = PyTuple_GET_ITEM(__pyx_args, 0); values[1] = PyTuple_GET_ITEM(__pyx_args, 1); values[2] = PyTuple_GET_ITEM(__pyx_args, 2); values[3] = PyTuple_GET_ITEM(__pyx_args, 3); values[4] = PyTuple_GET_ITEM(__pyx_args, 4); values[5] = PyTuple_GET_ITEM(__pyx_args, 5); } __pyx_v_surface = ((struct __pyx_obj_11pygame_sdl2_7surface_Surface *)values[0]); __pyx_v_x = values[1]; __pyx_v_y = values[2]; __pyx_v_rx = values[3]; __pyx_v_ry = values[4]; __pyx_v_color = values[5]; } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("ellipse", 1, 6, 6, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 106; __pyx_clineno = __LINE__; goto __pyx_L3_error;} __pyx_L3_error:; __Pyx_AddTraceback("pygame_sdl2.gfxdraw.ellipse", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_surface), __pyx_ptype_11pygame_sdl2_7surface_Surface, 1, "surface", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 106; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_r = __pyx_pf_11pygame_sdl2_7gfxdraw_28ellipse(__pyx_self, __pyx_v_surface, __pyx_v_x, __pyx_v_y, __pyx_v_rx, __pyx_v_ry, __pyx_v_color); /* function exit code */ goto __pyx_L0; __pyx_L1_error:; __pyx_r = NULL; __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_7gfxdraw_28ellipse(CYTHON_UNUSED PyObject *__pyx_self, struct __pyx_obj_11pygame_sdl2_7surface_Surface *__pyx_v_surface, PyObject *__pyx_v_x, PyObject *__pyx_v_y, PyObject *__pyx_v_rx, PyObject *__pyx_v_ry, PyObject *__pyx_v_color) { struct __pyx_obj_11pygame_sdl2_5color_Color *__pyx_v_c = 0; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; Sint16 __pyx_t_3; Sint16 __pyx_t_4; Sint16 __pyx_t_5; Sint16 __pyx_t_6; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("ellipse", 0); /* "pygame_sdl2/gfxdraw.pyx":107 * * def ellipse(Surface surface, x, y, rx, ry, color): * cdef Color c = Color(color) # <<<<<<<<<<<<<< * ellipseRGBA(surface.surface, x, y, rx, ry, c.r, c.g, c.b, c.a) * */ __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 107; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __Pyx_INCREF(__pyx_v_color); __Pyx_GIVEREF(__pyx_v_color); PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_color); __pyx_t_2 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_11pygame_sdl2_5color_Color), __pyx_t_1, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 107; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_v_c = ((struct __pyx_obj_11pygame_sdl2_5color_Color *)__pyx_t_2); __pyx_t_2 = 0; /* "pygame_sdl2/gfxdraw.pyx":108 * def ellipse(Surface surface, x, y, rx, ry, color): * cdef Color c = Color(color) * ellipseRGBA(surface.surface, x, y, rx, ry, c.r, c.g, c.b, c.a) # <<<<<<<<<<<<<< * * def aaellipse(Surface surface, x, y, rx, ry, color): */ __pyx_t_3 = __Pyx_PyInt_As_int16_t(__pyx_v_x); if (unlikely((__pyx_t_3 == (Sint16)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 108; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_t_4 = __Pyx_PyInt_As_int16_t(__pyx_v_y); if (unlikely((__pyx_t_4 == (Sint16)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 108; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_t_5 = __Pyx_PyInt_As_int16_t(__pyx_v_rx); if (unlikely((__pyx_t_5 == (Sint16)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 108; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_t_6 = __Pyx_PyInt_As_int16_t(__pyx_v_ry); if (unlikely((__pyx_t_6 == (Sint16)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 108; __pyx_clineno = __LINE__; goto __pyx_L1_error;} ellipseRGBA(__pyx_v_surface->surface, __pyx_t_3, __pyx_t_4, __pyx_t_5, __pyx_t_6, __pyx_v_c->r, __pyx_v_c->g, __pyx_v_c->b, __pyx_v_c->a); /* "pygame_sdl2/gfxdraw.pyx":106 * filledCircleRGBA(surface.surface, x, y, r, c.r, c.g, c.b, c.a) * * def ellipse(Surface surface, x, y, rx, ry, color): # <<<<<<<<<<<<<< * cdef Color c = Color(color) * ellipseRGBA(surface.surface, x, y, rx, ry, c.r, c.g, c.b, c.a) */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_AddTraceback("pygame_sdl2.gfxdraw.ellipse", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF((PyObject *)__pyx_v_c); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/gfxdraw.pyx":110 * ellipseRGBA(surface.surface, x, y, rx, ry, c.r, c.g, c.b, c.a) * * def aaellipse(Surface surface, x, y, rx, ry, color): # <<<<<<<<<<<<<< * cdef Color c = Color(color) * aaellipseRGBA(surface.surface, x, y, rx, ry, c.r, c.g, c.b, c.a) */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_7gfxdraw_31aaellipse(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static PyMethodDef __pyx_mdef_11pygame_sdl2_7gfxdraw_31aaellipse = {"aaellipse", (PyCFunction)__pyx_pw_11pygame_sdl2_7gfxdraw_31aaellipse, METH_VARARGS|METH_KEYWORDS, 0}; static PyObject *__pyx_pw_11pygame_sdl2_7gfxdraw_31aaellipse(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { struct __pyx_obj_11pygame_sdl2_7surface_Surface *__pyx_v_surface = 0; PyObject *__pyx_v_x = 0; PyObject *__pyx_v_y = 0; PyObject *__pyx_v_rx = 0; PyObject *__pyx_v_ry = 0; PyObject *__pyx_v_color = 0; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("aaellipse (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_surface,&__pyx_n_s_x,&__pyx_n_s_y,&__pyx_n_s_rx,&__pyx_n_s_ry,&__pyx_n_s_color,0}; PyObject* values[6] = {0,0,0,0,0,0}; if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5); case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4); case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_surface)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; case 1: if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_x)) != 0)) kw_args--; else { __Pyx_RaiseArgtupleInvalid("aaellipse", 1, 6, 6, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 110; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } case 2: if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_y)) != 0)) kw_args--; else { __Pyx_RaiseArgtupleInvalid("aaellipse", 1, 6, 6, 2); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 110; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } case 3: if (likely((values[3] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_rx)) != 0)) kw_args--; else { __Pyx_RaiseArgtupleInvalid("aaellipse", 1, 6, 6, 3); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 110; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } case 4: if (likely((values[4] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_ry)) != 0)) kw_args--; else { __Pyx_RaiseArgtupleInvalid("aaellipse", 1, 6, 6, 4); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 110; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } case 5: if (likely((values[5] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_color)) != 0)) kw_args--; else { __Pyx_RaiseArgtupleInvalid("aaellipse", 1, 6, 6, 5); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 110; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "aaellipse") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 110; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } } else if (PyTuple_GET_SIZE(__pyx_args) != 6) { goto __pyx_L5_argtuple_error; } else { values[0] = PyTuple_GET_ITEM(__pyx_args, 0); values[1] = PyTuple_GET_ITEM(__pyx_args, 1); values[2] = PyTuple_GET_ITEM(__pyx_args, 2); values[3] = PyTuple_GET_ITEM(__pyx_args, 3); values[4] = PyTuple_GET_ITEM(__pyx_args, 4); values[5] = PyTuple_GET_ITEM(__pyx_args, 5); } __pyx_v_surface = ((struct __pyx_obj_11pygame_sdl2_7surface_Surface *)values[0]); __pyx_v_x = values[1]; __pyx_v_y = values[2]; __pyx_v_rx = values[3]; __pyx_v_ry = values[4]; __pyx_v_color = values[5]; } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("aaellipse", 1, 6, 6, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 110; __pyx_clineno = __LINE__; goto __pyx_L3_error;} __pyx_L3_error:; __Pyx_AddTraceback("pygame_sdl2.gfxdraw.aaellipse", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_surface), __pyx_ptype_11pygame_sdl2_7surface_Surface, 1, "surface", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 110; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_r = __pyx_pf_11pygame_sdl2_7gfxdraw_30aaellipse(__pyx_self, __pyx_v_surface, __pyx_v_x, __pyx_v_y, __pyx_v_rx, __pyx_v_ry, __pyx_v_color); /* function exit code */ goto __pyx_L0; __pyx_L1_error:; __pyx_r = NULL; __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_7gfxdraw_30aaellipse(CYTHON_UNUSED PyObject *__pyx_self, struct __pyx_obj_11pygame_sdl2_7surface_Surface *__pyx_v_surface, PyObject *__pyx_v_x, PyObject *__pyx_v_y, PyObject *__pyx_v_rx, PyObject *__pyx_v_ry, PyObject *__pyx_v_color) { struct __pyx_obj_11pygame_sdl2_5color_Color *__pyx_v_c = 0; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; Sint16 __pyx_t_3; Sint16 __pyx_t_4; Sint16 __pyx_t_5; Sint16 __pyx_t_6; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("aaellipse", 0); /* "pygame_sdl2/gfxdraw.pyx":111 * * def aaellipse(Surface surface, x, y, rx, ry, color): * cdef Color c = Color(color) # <<<<<<<<<<<<<< * aaellipseRGBA(surface.surface, x, y, rx, ry, c.r, c.g, c.b, c.a) * */ __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 111; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __Pyx_INCREF(__pyx_v_color); __Pyx_GIVEREF(__pyx_v_color); PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_color); __pyx_t_2 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_11pygame_sdl2_5color_Color), __pyx_t_1, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 111; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_v_c = ((struct __pyx_obj_11pygame_sdl2_5color_Color *)__pyx_t_2); __pyx_t_2 = 0; /* "pygame_sdl2/gfxdraw.pyx":112 * def aaellipse(Surface surface, x, y, rx, ry, color): * cdef Color c = Color(color) * aaellipseRGBA(surface.surface, x, y, rx, ry, c.r, c.g, c.b, c.a) # <<<<<<<<<<<<<< * * def filled_ellipse(Surface surface, x, y, rx, ry, color): */ __pyx_t_3 = __Pyx_PyInt_As_int16_t(__pyx_v_x); if (unlikely((__pyx_t_3 == (Sint16)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 112; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_t_4 = __Pyx_PyInt_As_int16_t(__pyx_v_y); if (unlikely((__pyx_t_4 == (Sint16)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 112; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_t_5 = __Pyx_PyInt_As_int16_t(__pyx_v_rx); if (unlikely((__pyx_t_5 == (Sint16)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 112; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_t_6 = __Pyx_PyInt_As_int16_t(__pyx_v_ry); if (unlikely((__pyx_t_6 == (Sint16)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 112; __pyx_clineno = __LINE__; goto __pyx_L1_error;} aaellipseRGBA(__pyx_v_surface->surface, __pyx_t_3, __pyx_t_4, __pyx_t_5, __pyx_t_6, __pyx_v_c->r, __pyx_v_c->g, __pyx_v_c->b, __pyx_v_c->a); /* "pygame_sdl2/gfxdraw.pyx":110 * ellipseRGBA(surface.surface, x, y, rx, ry, c.r, c.g, c.b, c.a) * * def aaellipse(Surface surface, x, y, rx, ry, color): # <<<<<<<<<<<<<< * cdef Color c = Color(color) * aaellipseRGBA(surface.surface, x, y, rx, ry, c.r, c.g, c.b, c.a) */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_AddTraceback("pygame_sdl2.gfxdraw.aaellipse", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF((PyObject *)__pyx_v_c); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/gfxdraw.pyx":114 * aaellipseRGBA(surface.surface, x, y, rx, ry, c.r, c.g, c.b, c.a) * * def filled_ellipse(Surface surface, x, y, rx, ry, color): # <<<<<<<<<<<<<< * cdef Color c = Color(color) * filledEllipseRGBA(surface.surface, x, y, rx, ry, c.r, c.g, c.b, c.a) */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_7gfxdraw_33filled_ellipse(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static PyMethodDef __pyx_mdef_11pygame_sdl2_7gfxdraw_33filled_ellipse = {"filled_ellipse", (PyCFunction)__pyx_pw_11pygame_sdl2_7gfxdraw_33filled_ellipse, METH_VARARGS|METH_KEYWORDS, 0}; static PyObject *__pyx_pw_11pygame_sdl2_7gfxdraw_33filled_ellipse(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { struct __pyx_obj_11pygame_sdl2_7surface_Surface *__pyx_v_surface = 0; PyObject *__pyx_v_x = 0; PyObject *__pyx_v_y = 0; PyObject *__pyx_v_rx = 0; PyObject *__pyx_v_ry = 0; PyObject *__pyx_v_color = 0; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("filled_ellipse (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_surface,&__pyx_n_s_x,&__pyx_n_s_y,&__pyx_n_s_rx,&__pyx_n_s_ry,&__pyx_n_s_color,0}; PyObject* values[6] = {0,0,0,0,0,0}; if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5); case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4); case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_surface)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; case 1: if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_x)) != 0)) kw_args--; else { __Pyx_RaiseArgtupleInvalid("filled_ellipse", 1, 6, 6, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 114; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } case 2: if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_y)) != 0)) kw_args--; else { __Pyx_RaiseArgtupleInvalid("filled_ellipse", 1, 6, 6, 2); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 114; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } case 3: if (likely((values[3] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_rx)) != 0)) kw_args--; else { __Pyx_RaiseArgtupleInvalid("filled_ellipse", 1, 6, 6, 3); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 114; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } case 4: if (likely((values[4] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_ry)) != 0)) kw_args--; else { __Pyx_RaiseArgtupleInvalid("filled_ellipse", 1, 6, 6, 4); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 114; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } case 5: if (likely((values[5] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_color)) != 0)) kw_args--; else { __Pyx_RaiseArgtupleInvalid("filled_ellipse", 1, 6, 6, 5); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 114; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "filled_ellipse") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 114; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } } else if (PyTuple_GET_SIZE(__pyx_args) != 6) { goto __pyx_L5_argtuple_error; } else { values[0] = PyTuple_GET_ITEM(__pyx_args, 0); values[1] = PyTuple_GET_ITEM(__pyx_args, 1); values[2] = PyTuple_GET_ITEM(__pyx_args, 2); values[3] = PyTuple_GET_ITEM(__pyx_args, 3); values[4] = PyTuple_GET_ITEM(__pyx_args, 4); values[5] = PyTuple_GET_ITEM(__pyx_args, 5); } __pyx_v_surface = ((struct __pyx_obj_11pygame_sdl2_7surface_Surface *)values[0]); __pyx_v_x = values[1]; __pyx_v_y = values[2]; __pyx_v_rx = values[3]; __pyx_v_ry = values[4]; __pyx_v_color = values[5]; } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("filled_ellipse", 1, 6, 6, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 114; __pyx_clineno = __LINE__; goto __pyx_L3_error;} __pyx_L3_error:; __Pyx_AddTraceback("pygame_sdl2.gfxdraw.filled_ellipse", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_surface), __pyx_ptype_11pygame_sdl2_7surface_Surface, 1, "surface", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 114; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_r = __pyx_pf_11pygame_sdl2_7gfxdraw_32filled_ellipse(__pyx_self, __pyx_v_surface, __pyx_v_x, __pyx_v_y, __pyx_v_rx, __pyx_v_ry, __pyx_v_color); /* function exit code */ goto __pyx_L0; __pyx_L1_error:; __pyx_r = NULL; __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_7gfxdraw_32filled_ellipse(CYTHON_UNUSED PyObject *__pyx_self, struct __pyx_obj_11pygame_sdl2_7surface_Surface *__pyx_v_surface, PyObject *__pyx_v_x, PyObject *__pyx_v_y, PyObject *__pyx_v_rx, PyObject *__pyx_v_ry, PyObject *__pyx_v_color) { struct __pyx_obj_11pygame_sdl2_5color_Color *__pyx_v_c = 0; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; Sint16 __pyx_t_3; Sint16 __pyx_t_4; Sint16 __pyx_t_5; Sint16 __pyx_t_6; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("filled_ellipse", 0); /* "pygame_sdl2/gfxdraw.pyx":115 * * def filled_ellipse(Surface surface, x, y, rx, ry, color): * cdef Color c = Color(color) # <<<<<<<<<<<<<< * filledEllipseRGBA(surface.surface, x, y, rx, ry, c.r, c.g, c.b, c.a) * */ __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 115; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __Pyx_INCREF(__pyx_v_color); __Pyx_GIVEREF(__pyx_v_color); PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_color); __pyx_t_2 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_11pygame_sdl2_5color_Color), __pyx_t_1, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 115; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_v_c = ((struct __pyx_obj_11pygame_sdl2_5color_Color *)__pyx_t_2); __pyx_t_2 = 0; /* "pygame_sdl2/gfxdraw.pyx":116 * def filled_ellipse(Surface surface, x, y, rx, ry, color): * cdef Color c = Color(color) * filledEllipseRGBA(surface.surface, x, y, rx, ry, c.r, c.g, c.b, c.a) # <<<<<<<<<<<<<< * * def pie(Surface surface, x, y, r, start, end, color): */ __pyx_t_3 = __Pyx_PyInt_As_int16_t(__pyx_v_x); if (unlikely((__pyx_t_3 == (Sint16)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 116; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_t_4 = __Pyx_PyInt_As_int16_t(__pyx_v_y); if (unlikely((__pyx_t_4 == (Sint16)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 116; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_t_5 = __Pyx_PyInt_As_int16_t(__pyx_v_rx); if (unlikely((__pyx_t_5 == (Sint16)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 116; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_t_6 = __Pyx_PyInt_As_int16_t(__pyx_v_ry); if (unlikely((__pyx_t_6 == (Sint16)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 116; __pyx_clineno = __LINE__; goto __pyx_L1_error;} filledEllipseRGBA(__pyx_v_surface->surface, __pyx_t_3, __pyx_t_4, __pyx_t_5, __pyx_t_6, __pyx_v_c->r, __pyx_v_c->g, __pyx_v_c->b, __pyx_v_c->a); /* "pygame_sdl2/gfxdraw.pyx":114 * aaellipseRGBA(surface.surface, x, y, rx, ry, c.r, c.g, c.b, c.a) * * def filled_ellipse(Surface surface, x, y, rx, ry, color): # <<<<<<<<<<<<<< * cdef Color c = Color(color) * filledEllipseRGBA(surface.surface, x, y, rx, ry, c.r, c.g, c.b, c.a) */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_AddTraceback("pygame_sdl2.gfxdraw.filled_ellipse", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF((PyObject *)__pyx_v_c); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/gfxdraw.pyx":118 * filledEllipseRGBA(surface.surface, x, y, rx, ry, c.r, c.g, c.b, c.a) * * def pie(Surface surface, x, y, r, start, end, color): # <<<<<<<<<<<<<< * cdef Color c = Color(color) * pieRGBA(surface.surface, x, y, r, start, end, c.r, c.g, c.b, c.a) */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_7gfxdraw_35pie(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static PyMethodDef __pyx_mdef_11pygame_sdl2_7gfxdraw_35pie = {"pie", (PyCFunction)__pyx_pw_11pygame_sdl2_7gfxdraw_35pie, METH_VARARGS|METH_KEYWORDS, 0}; static PyObject *__pyx_pw_11pygame_sdl2_7gfxdraw_35pie(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { struct __pyx_obj_11pygame_sdl2_7surface_Surface *__pyx_v_surface = 0; PyObject *__pyx_v_x = 0; PyObject *__pyx_v_y = 0; PyObject *__pyx_v_r = 0; PyObject *__pyx_v_start = 0; PyObject *__pyx_v_end = 0; PyObject *__pyx_v_color = 0; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("pie (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_surface,&__pyx_n_s_x,&__pyx_n_s_y,&__pyx_n_s_r,&__pyx_n_s_start,&__pyx_n_s_end,&__pyx_n_s_color,0}; PyObject* values[7] = {0,0,0,0,0,0,0}; if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 7: values[6] = PyTuple_GET_ITEM(__pyx_args, 6); case 6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5); case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4); case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_surface)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; case 1: if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_x)) != 0)) kw_args--; else { __Pyx_RaiseArgtupleInvalid("pie", 1, 7, 7, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 118; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } case 2: if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_y)) != 0)) kw_args--; else { __Pyx_RaiseArgtupleInvalid("pie", 1, 7, 7, 2); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 118; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } case 3: if (likely((values[3] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_r)) != 0)) kw_args--; else { __Pyx_RaiseArgtupleInvalid("pie", 1, 7, 7, 3); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 118; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } case 4: if (likely((values[4] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_start)) != 0)) kw_args--; else { __Pyx_RaiseArgtupleInvalid("pie", 1, 7, 7, 4); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 118; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } case 5: if (likely((values[5] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_end)) != 0)) kw_args--; else { __Pyx_RaiseArgtupleInvalid("pie", 1, 7, 7, 5); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 118; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } case 6: if (likely((values[6] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_color)) != 0)) kw_args--; else { __Pyx_RaiseArgtupleInvalid("pie", 1, 7, 7, 6); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 118; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "pie") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 118; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } } else if (PyTuple_GET_SIZE(__pyx_args) != 7) { goto __pyx_L5_argtuple_error; } else { values[0] = PyTuple_GET_ITEM(__pyx_args, 0); values[1] = PyTuple_GET_ITEM(__pyx_args, 1); values[2] = PyTuple_GET_ITEM(__pyx_args, 2); values[3] = PyTuple_GET_ITEM(__pyx_args, 3); values[4] = PyTuple_GET_ITEM(__pyx_args, 4); values[5] = PyTuple_GET_ITEM(__pyx_args, 5); values[6] = PyTuple_GET_ITEM(__pyx_args, 6); } __pyx_v_surface = ((struct __pyx_obj_11pygame_sdl2_7surface_Surface *)values[0]); __pyx_v_x = values[1]; __pyx_v_y = values[2]; __pyx_v_r = values[3]; __pyx_v_start = values[4]; __pyx_v_end = values[5]; __pyx_v_color = values[6]; } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("pie", 1, 7, 7, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 118; __pyx_clineno = __LINE__; goto __pyx_L3_error;} __pyx_L3_error:; __Pyx_AddTraceback("pygame_sdl2.gfxdraw.pie", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_surface), __pyx_ptype_11pygame_sdl2_7surface_Surface, 1, "surface", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 118; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_r = __pyx_pf_11pygame_sdl2_7gfxdraw_34pie(__pyx_self, __pyx_v_surface, __pyx_v_x, __pyx_v_y, __pyx_v_r, __pyx_v_start, __pyx_v_end, __pyx_v_color); /* function exit code */ goto __pyx_L0; __pyx_L1_error:; __pyx_r = NULL; __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_7gfxdraw_34pie(CYTHON_UNUSED PyObject *__pyx_self, struct __pyx_obj_11pygame_sdl2_7surface_Surface *__pyx_v_surface, PyObject *__pyx_v_x, PyObject *__pyx_v_y, PyObject *__pyx_v_r, PyObject *__pyx_v_start, PyObject *__pyx_v_end, PyObject *__pyx_v_color) { struct __pyx_obj_11pygame_sdl2_5color_Color *__pyx_v_c = 0; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; Sint16 __pyx_t_3; Sint16 __pyx_t_4; Sint16 __pyx_t_5; Sint16 __pyx_t_6; Sint16 __pyx_t_7; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("pie", 0); /* "pygame_sdl2/gfxdraw.pyx":119 * * def pie(Surface surface, x, y, r, start, end, color): * cdef Color c = Color(color) # <<<<<<<<<<<<<< * pieRGBA(surface.surface, x, y, r, start, end, c.r, c.g, c.b, c.a) * */ __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 119; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __Pyx_INCREF(__pyx_v_color); __Pyx_GIVEREF(__pyx_v_color); PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_color); __pyx_t_2 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_11pygame_sdl2_5color_Color), __pyx_t_1, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 119; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_v_c = ((struct __pyx_obj_11pygame_sdl2_5color_Color *)__pyx_t_2); __pyx_t_2 = 0; /* "pygame_sdl2/gfxdraw.pyx":120 * def pie(Surface surface, x, y, r, start, end, color): * cdef Color c = Color(color) * pieRGBA(surface.surface, x, y, r, start, end, c.r, c.g, c.b, c.a) # <<<<<<<<<<<<<< * * def filled_pie(Surface surface, x, y, r, start, end, color): */ __pyx_t_3 = __Pyx_PyInt_As_int16_t(__pyx_v_x); if (unlikely((__pyx_t_3 == (Sint16)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 120; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_t_4 = __Pyx_PyInt_As_int16_t(__pyx_v_y); if (unlikely((__pyx_t_4 == (Sint16)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 120; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_t_5 = __Pyx_PyInt_As_int16_t(__pyx_v_r); if (unlikely((__pyx_t_5 == (Sint16)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 120; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_t_6 = __Pyx_PyInt_As_int16_t(__pyx_v_start); if (unlikely((__pyx_t_6 == (Sint16)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 120; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_t_7 = __Pyx_PyInt_As_int16_t(__pyx_v_end); if (unlikely((__pyx_t_7 == (Sint16)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 120; __pyx_clineno = __LINE__; goto __pyx_L1_error;} pieRGBA(__pyx_v_surface->surface, __pyx_t_3, __pyx_t_4, __pyx_t_5, __pyx_t_6, __pyx_t_7, __pyx_v_c->r, __pyx_v_c->g, __pyx_v_c->b, __pyx_v_c->a); /* "pygame_sdl2/gfxdraw.pyx":118 * filledEllipseRGBA(surface.surface, x, y, rx, ry, c.r, c.g, c.b, c.a) * * def pie(Surface surface, x, y, r, start, end, color): # <<<<<<<<<<<<<< * cdef Color c = Color(color) * pieRGBA(surface.surface, x, y, r, start, end, c.r, c.g, c.b, c.a) */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_AddTraceback("pygame_sdl2.gfxdraw.pie", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF((PyObject *)__pyx_v_c); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/gfxdraw.pyx":122 * pieRGBA(surface.surface, x, y, r, start, end, c.r, c.g, c.b, c.a) * * def filled_pie(Surface surface, x, y, r, start, end, color): # <<<<<<<<<<<<<< * cdef Color c = Color(color) * filledPieRGBA(surface.surface, x, y, r, start, end, c.r, c.g, c.b, c.a) */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_7gfxdraw_37filled_pie(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static PyMethodDef __pyx_mdef_11pygame_sdl2_7gfxdraw_37filled_pie = {"filled_pie", (PyCFunction)__pyx_pw_11pygame_sdl2_7gfxdraw_37filled_pie, METH_VARARGS|METH_KEYWORDS, 0}; static PyObject *__pyx_pw_11pygame_sdl2_7gfxdraw_37filled_pie(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { struct __pyx_obj_11pygame_sdl2_7surface_Surface *__pyx_v_surface = 0; PyObject *__pyx_v_x = 0; PyObject *__pyx_v_y = 0; PyObject *__pyx_v_r = 0; PyObject *__pyx_v_start = 0; PyObject *__pyx_v_end = 0; PyObject *__pyx_v_color = 0; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("filled_pie (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_surface,&__pyx_n_s_x,&__pyx_n_s_y,&__pyx_n_s_r,&__pyx_n_s_start,&__pyx_n_s_end,&__pyx_n_s_color,0}; PyObject* values[7] = {0,0,0,0,0,0,0}; if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 7: values[6] = PyTuple_GET_ITEM(__pyx_args, 6); case 6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5); case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4); case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_surface)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; case 1: if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_x)) != 0)) kw_args--; else { __Pyx_RaiseArgtupleInvalid("filled_pie", 1, 7, 7, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 122; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } case 2: if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_y)) != 0)) kw_args--; else { __Pyx_RaiseArgtupleInvalid("filled_pie", 1, 7, 7, 2); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 122; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } case 3: if (likely((values[3] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_r)) != 0)) kw_args--; else { __Pyx_RaiseArgtupleInvalid("filled_pie", 1, 7, 7, 3); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 122; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } case 4: if (likely((values[4] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_start)) != 0)) kw_args--; else { __Pyx_RaiseArgtupleInvalid("filled_pie", 1, 7, 7, 4); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 122; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } case 5: if (likely((values[5] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_end)) != 0)) kw_args--; else { __Pyx_RaiseArgtupleInvalid("filled_pie", 1, 7, 7, 5); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 122; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } case 6: if (likely((values[6] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_color)) != 0)) kw_args--; else { __Pyx_RaiseArgtupleInvalid("filled_pie", 1, 7, 7, 6); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 122; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "filled_pie") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 122; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } } else if (PyTuple_GET_SIZE(__pyx_args) != 7) { goto __pyx_L5_argtuple_error; } else { values[0] = PyTuple_GET_ITEM(__pyx_args, 0); values[1] = PyTuple_GET_ITEM(__pyx_args, 1); values[2] = PyTuple_GET_ITEM(__pyx_args, 2); values[3] = PyTuple_GET_ITEM(__pyx_args, 3); values[4] = PyTuple_GET_ITEM(__pyx_args, 4); values[5] = PyTuple_GET_ITEM(__pyx_args, 5); values[6] = PyTuple_GET_ITEM(__pyx_args, 6); } __pyx_v_surface = ((struct __pyx_obj_11pygame_sdl2_7surface_Surface *)values[0]); __pyx_v_x = values[1]; __pyx_v_y = values[2]; __pyx_v_r = values[3]; __pyx_v_start = values[4]; __pyx_v_end = values[5]; __pyx_v_color = values[6]; } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("filled_pie", 1, 7, 7, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 122; __pyx_clineno = __LINE__; goto __pyx_L3_error;} __pyx_L3_error:; __Pyx_AddTraceback("pygame_sdl2.gfxdraw.filled_pie", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_surface), __pyx_ptype_11pygame_sdl2_7surface_Surface, 1, "surface", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 122; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_r = __pyx_pf_11pygame_sdl2_7gfxdraw_36filled_pie(__pyx_self, __pyx_v_surface, __pyx_v_x, __pyx_v_y, __pyx_v_r, __pyx_v_start, __pyx_v_end, __pyx_v_color); /* function exit code */ goto __pyx_L0; __pyx_L1_error:; __pyx_r = NULL; __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_7gfxdraw_36filled_pie(CYTHON_UNUSED PyObject *__pyx_self, struct __pyx_obj_11pygame_sdl2_7surface_Surface *__pyx_v_surface, PyObject *__pyx_v_x, PyObject *__pyx_v_y, PyObject *__pyx_v_r, PyObject *__pyx_v_start, PyObject *__pyx_v_end, PyObject *__pyx_v_color) { struct __pyx_obj_11pygame_sdl2_5color_Color *__pyx_v_c = 0; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; Sint16 __pyx_t_3; Sint16 __pyx_t_4; Sint16 __pyx_t_5; Sint16 __pyx_t_6; Sint16 __pyx_t_7; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("filled_pie", 0); /* "pygame_sdl2/gfxdraw.pyx":123 * * def filled_pie(Surface surface, x, y, r, start, end, color): * cdef Color c = Color(color) # <<<<<<<<<<<<<< * filledPieRGBA(surface.surface, x, y, r, start, end, c.r, c.g, c.b, c.a) * */ __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 123; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __Pyx_INCREF(__pyx_v_color); __Pyx_GIVEREF(__pyx_v_color); PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_color); __pyx_t_2 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_11pygame_sdl2_5color_Color), __pyx_t_1, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 123; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_v_c = ((struct __pyx_obj_11pygame_sdl2_5color_Color *)__pyx_t_2); __pyx_t_2 = 0; /* "pygame_sdl2/gfxdraw.pyx":124 * def filled_pie(Surface surface, x, y, r, start, end, color): * cdef Color c = Color(color) * filledPieRGBA(surface.surface, x, y, r, start, end, c.r, c.g, c.b, c.a) # <<<<<<<<<<<<<< * * def trigon(Surface surface, x1, y1, x2, y2, x3, y3, color): */ __pyx_t_3 = __Pyx_PyInt_As_int16_t(__pyx_v_x); if (unlikely((__pyx_t_3 == (Sint16)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 124; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_t_4 = __Pyx_PyInt_As_int16_t(__pyx_v_y); if (unlikely((__pyx_t_4 == (Sint16)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 124; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_t_5 = __Pyx_PyInt_As_int16_t(__pyx_v_r); if (unlikely((__pyx_t_5 == (Sint16)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 124; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_t_6 = __Pyx_PyInt_As_int16_t(__pyx_v_start); if (unlikely((__pyx_t_6 == (Sint16)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 124; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_t_7 = __Pyx_PyInt_As_int16_t(__pyx_v_end); if (unlikely((__pyx_t_7 == (Sint16)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 124; __pyx_clineno = __LINE__; goto __pyx_L1_error;} filledPieRGBA(__pyx_v_surface->surface, __pyx_t_3, __pyx_t_4, __pyx_t_5, __pyx_t_6, __pyx_t_7, __pyx_v_c->r, __pyx_v_c->g, __pyx_v_c->b, __pyx_v_c->a); /* "pygame_sdl2/gfxdraw.pyx":122 * pieRGBA(surface.surface, x, y, r, start, end, c.r, c.g, c.b, c.a) * * def filled_pie(Surface surface, x, y, r, start, end, color): # <<<<<<<<<<<<<< * cdef Color c = Color(color) * filledPieRGBA(surface.surface, x, y, r, start, end, c.r, c.g, c.b, c.a) */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_AddTraceback("pygame_sdl2.gfxdraw.filled_pie", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF((PyObject *)__pyx_v_c); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/gfxdraw.pyx":126 * filledPieRGBA(surface.surface, x, y, r, start, end, c.r, c.g, c.b, c.a) * * def trigon(Surface surface, x1, y1, x2, y2, x3, y3, color): # <<<<<<<<<<<<<< * cdef Color c = Color(color) * trigonRGBA(surface.surface, x1, y1, x2, y2, x3, y3, c.r, c.g, c.b, c.a) */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_7gfxdraw_39trigon(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static PyMethodDef __pyx_mdef_11pygame_sdl2_7gfxdraw_39trigon = {"trigon", (PyCFunction)__pyx_pw_11pygame_sdl2_7gfxdraw_39trigon, METH_VARARGS|METH_KEYWORDS, 0}; static PyObject *__pyx_pw_11pygame_sdl2_7gfxdraw_39trigon(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { struct __pyx_obj_11pygame_sdl2_7surface_Surface *__pyx_v_surface = 0; PyObject *__pyx_v_x1 = 0; PyObject *__pyx_v_y1 = 0; PyObject *__pyx_v_x2 = 0; PyObject *__pyx_v_y2 = 0; PyObject *__pyx_v_x3 = 0; PyObject *__pyx_v_y3 = 0; PyObject *__pyx_v_color = 0; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("trigon (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_surface,&__pyx_n_s_x1,&__pyx_n_s_y1,&__pyx_n_s_x2,&__pyx_n_s_y2,&__pyx_n_s_x3,&__pyx_n_s_y3,&__pyx_n_s_color,0}; PyObject* values[8] = {0,0,0,0,0,0,0,0}; if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 8: values[7] = PyTuple_GET_ITEM(__pyx_args, 7); case 7: values[6] = PyTuple_GET_ITEM(__pyx_args, 6); case 6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5); case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4); case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_surface)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; case 1: if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_x1)) != 0)) kw_args--; else { __Pyx_RaiseArgtupleInvalid("trigon", 1, 8, 8, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 126; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } case 2: if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_y1)) != 0)) kw_args--; else { __Pyx_RaiseArgtupleInvalid("trigon", 1, 8, 8, 2); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 126; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } case 3: if (likely((values[3] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_x2)) != 0)) kw_args--; else { __Pyx_RaiseArgtupleInvalid("trigon", 1, 8, 8, 3); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 126; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } case 4: if (likely((values[4] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_y2)) != 0)) kw_args--; else { __Pyx_RaiseArgtupleInvalid("trigon", 1, 8, 8, 4); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 126; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } case 5: if (likely((values[5] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_x3)) != 0)) kw_args--; else { __Pyx_RaiseArgtupleInvalid("trigon", 1, 8, 8, 5); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 126; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } case 6: if (likely((values[6] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_y3)) != 0)) kw_args--; else { __Pyx_RaiseArgtupleInvalid("trigon", 1, 8, 8, 6); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 126; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } case 7: if (likely((values[7] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_color)) != 0)) kw_args--; else { __Pyx_RaiseArgtupleInvalid("trigon", 1, 8, 8, 7); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 126; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "trigon") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 126; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } } else if (PyTuple_GET_SIZE(__pyx_args) != 8) { goto __pyx_L5_argtuple_error; } else { values[0] = PyTuple_GET_ITEM(__pyx_args, 0); values[1] = PyTuple_GET_ITEM(__pyx_args, 1); values[2] = PyTuple_GET_ITEM(__pyx_args, 2); values[3] = PyTuple_GET_ITEM(__pyx_args, 3); values[4] = PyTuple_GET_ITEM(__pyx_args, 4); values[5] = PyTuple_GET_ITEM(__pyx_args, 5); values[6] = PyTuple_GET_ITEM(__pyx_args, 6); values[7] = PyTuple_GET_ITEM(__pyx_args, 7); } __pyx_v_surface = ((struct __pyx_obj_11pygame_sdl2_7surface_Surface *)values[0]); __pyx_v_x1 = values[1]; __pyx_v_y1 = values[2]; __pyx_v_x2 = values[3]; __pyx_v_y2 = values[4]; __pyx_v_x3 = values[5]; __pyx_v_y3 = values[6]; __pyx_v_color = values[7]; } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("trigon", 1, 8, 8, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 126; __pyx_clineno = __LINE__; goto __pyx_L3_error;} __pyx_L3_error:; __Pyx_AddTraceback("pygame_sdl2.gfxdraw.trigon", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_surface), __pyx_ptype_11pygame_sdl2_7surface_Surface, 1, "surface", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 126; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_r = __pyx_pf_11pygame_sdl2_7gfxdraw_38trigon(__pyx_self, __pyx_v_surface, __pyx_v_x1, __pyx_v_y1, __pyx_v_x2, __pyx_v_y2, __pyx_v_x3, __pyx_v_y3, __pyx_v_color); /* function exit code */ goto __pyx_L0; __pyx_L1_error:; __pyx_r = NULL; __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_7gfxdraw_38trigon(CYTHON_UNUSED PyObject *__pyx_self, struct __pyx_obj_11pygame_sdl2_7surface_Surface *__pyx_v_surface, PyObject *__pyx_v_x1, PyObject *__pyx_v_y1, PyObject *__pyx_v_x2, PyObject *__pyx_v_y2, PyObject *__pyx_v_x3, PyObject *__pyx_v_y3, PyObject *__pyx_v_color) { struct __pyx_obj_11pygame_sdl2_5color_Color *__pyx_v_c = 0; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; Sint16 __pyx_t_3; Sint16 __pyx_t_4; Sint16 __pyx_t_5; Sint16 __pyx_t_6; Sint16 __pyx_t_7; Sint16 __pyx_t_8; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("trigon", 0); /* "pygame_sdl2/gfxdraw.pyx":127 * * def trigon(Surface surface, x1, y1, x2, y2, x3, y3, color): * cdef Color c = Color(color) # <<<<<<<<<<<<<< * trigonRGBA(surface.surface, x1, y1, x2, y2, x3, y3, c.r, c.g, c.b, c.a) * */ __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 127; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __Pyx_INCREF(__pyx_v_color); __Pyx_GIVEREF(__pyx_v_color); PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_color); __pyx_t_2 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_11pygame_sdl2_5color_Color), __pyx_t_1, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 127; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_v_c = ((struct __pyx_obj_11pygame_sdl2_5color_Color *)__pyx_t_2); __pyx_t_2 = 0; /* "pygame_sdl2/gfxdraw.pyx":128 * def trigon(Surface surface, x1, y1, x2, y2, x3, y3, color): * cdef Color c = Color(color) * trigonRGBA(surface.surface, x1, y1, x2, y2, x3, y3, c.r, c.g, c.b, c.a) # <<<<<<<<<<<<<< * * def aatrigon(Surface surface, x1, y1, x2, y2, x3, y3, color): */ __pyx_t_3 = __Pyx_PyInt_As_int16_t(__pyx_v_x1); if (unlikely((__pyx_t_3 == (Sint16)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 128; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_t_4 = __Pyx_PyInt_As_int16_t(__pyx_v_y1); if (unlikely((__pyx_t_4 == (Sint16)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 128; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_t_5 = __Pyx_PyInt_As_int16_t(__pyx_v_x2); if (unlikely((__pyx_t_5 == (Sint16)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 128; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_t_6 = __Pyx_PyInt_As_int16_t(__pyx_v_y2); if (unlikely((__pyx_t_6 == (Sint16)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 128; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_t_7 = __Pyx_PyInt_As_int16_t(__pyx_v_x3); if (unlikely((__pyx_t_7 == (Sint16)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 128; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_t_8 = __Pyx_PyInt_As_int16_t(__pyx_v_y3); if (unlikely((__pyx_t_8 == (Sint16)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 128; __pyx_clineno = __LINE__; goto __pyx_L1_error;} trigonRGBA(__pyx_v_surface->surface, __pyx_t_3, __pyx_t_4, __pyx_t_5, __pyx_t_6, __pyx_t_7, __pyx_t_8, __pyx_v_c->r, __pyx_v_c->g, __pyx_v_c->b, __pyx_v_c->a); /* "pygame_sdl2/gfxdraw.pyx":126 * filledPieRGBA(surface.surface, x, y, r, start, end, c.r, c.g, c.b, c.a) * * def trigon(Surface surface, x1, y1, x2, y2, x3, y3, color): # <<<<<<<<<<<<<< * cdef Color c = Color(color) * trigonRGBA(surface.surface, x1, y1, x2, y2, x3, y3, c.r, c.g, c.b, c.a) */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_AddTraceback("pygame_sdl2.gfxdraw.trigon", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF((PyObject *)__pyx_v_c); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/gfxdraw.pyx":130 * trigonRGBA(surface.surface, x1, y1, x2, y2, x3, y3, c.r, c.g, c.b, c.a) * * def aatrigon(Surface surface, x1, y1, x2, y2, x3, y3, color): # <<<<<<<<<<<<<< * cdef Color c = Color(color) * aatrigonRGBA(surface.surface, x1, y1, x2, y2, x3, y3, c.r, c.g, c.b, c.a) */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_7gfxdraw_41aatrigon(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static PyMethodDef __pyx_mdef_11pygame_sdl2_7gfxdraw_41aatrigon = {"aatrigon", (PyCFunction)__pyx_pw_11pygame_sdl2_7gfxdraw_41aatrigon, METH_VARARGS|METH_KEYWORDS, 0}; static PyObject *__pyx_pw_11pygame_sdl2_7gfxdraw_41aatrigon(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { struct __pyx_obj_11pygame_sdl2_7surface_Surface *__pyx_v_surface = 0; PyObject *__pyx_v_x1 = 0; PyObject *__pyx_v_y1 = 0; PyObject *__pyx_v_x2 = 0; PyObject *__pyx_v_y2 = 0; PyObject *__pyx_v_x3 = 0; PyObject *__pyx_v_y3 = 0; PyObject *__pyx_v_color = 0; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("aatrigon (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_surface,&__pyx_n_s_x1,&__pyx_n_s_y1,&__pyx_n_s_x2,&__pyx_n_s_y2,&__pyx_n_s_x3,&__pyx_n_s_y3,&__pyx_n_s_color,0}; PyObject* values[8] = {0,0,0,0,0,0,0,0}; if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 8: values[7] = PyTuple_GET_ITEM(__pyx_args, 7); case 7: values[6] = PyTuple_GET_ITEM(__pyx_args, 6); case 6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5); case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4); case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_surface)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; case 1: if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_x1)) != 0)) kw_args--; else { __Pyx_RaiseArgtupleInvalid("aatrigon", 1, 8, 8, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 130; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } case 2: if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_y1)) != 0)) kw_args--; else { __Pyx_RaiseArgtupleInvalid("aatrigon", 1, 8, 8, 2); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 130; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } case 3: if (likely((values[3] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_x2)) != 0)) kw_args--; else { __Pyx_RaiseArgtupleInvalid("aatrigon", 1, 8, 8, 3); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 130; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } case 4: if (likely((values[4] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_y2)) != 0)) kw_args--; else { __Pyx_RaiseArgtupleInvalid("aatrigon", 1, 8, 8, 4); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 130; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } case 5: if (likely((values[5] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_x3)) != 0)) kw_args--; else { __Pyx_RaiseArgtupleInvalid("aatrigon", 1, 8, 8, 5); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 130; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } case 6: if (likely((values[6] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_y3)) != 0)) kw_args--; else { __Pyx_RaiseArgtupleInvalid("aatrigon", 1, 8, 8, 6); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 130; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } case 7: if (likely((values[7] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_color)) != 0)) kw_args--; else { __Pyx_RaiseArgtupleInvalid("aatrigon", 1, 8, 8, 7); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 130; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "aatrigon") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 130; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } } else if (PyTuple_GET_SIZE(__pyx_args) != 8) { goto __pyx_L5_argtuple_error; } else { values[0] = PyTuple_GET_ITEM(__pyx_args, 0); values[1] = PyTuple_GET_ITEM(__pyx_args, 1); values[2] = PyTuple_GET_ITEM(__pyx_args, 2); values[3] = PyTuple_GET_ITEM(__pyx_args, 3); values[4] = PyTuple_GET_ITEM(__pyx_args, 4); values[5] = PyTuple_GET_ITEM(__pyx_args, 5); values[6] = PyTuple_GET_ITEM(__pyx_args, 6); values[7] = PyTuple_GET_ITEM(__pyx_args, 7); } __pyx_v_surface = ((struct __pyx_obj_11pygame_sdl2_7surface_Surface *)values[0]); __pyx_v_x1 = values[1]; __pyx_v_y1 = values[2]; __pyx_v_x2 = values[3]; __pyx_v_y2 = values[4]; __pyx_v_x3 = values[5]; __pyx_v_y3 = values[6]; __pyx_v_color = values[7]; } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("aatrigon", 1, 8, 8, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 130; __pyx_clineno = __LINE__; goto __pyx_L3_error;} __pyx_L3_error:; __Pyx_AddTraceback("pygame_sdl2.gfxdraw.aatrigon", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_surface), __pyx_ptype_11pygame_sdl2_7surface_Surface, 1, "surface", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 130; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_r = __pyx_pf_11pygame_sdl2_7gfxdraw_40aatrigon(__pyx_self, __pyx_v_surface, __pyx_v_x1, __pyx_v_y1, __pyx_v_x2, __pyx_v_y2, __pyx_v_x3, __pyx_v_y3, __pyx_v_color); /* function exit code */ goto __pyx_L0; __pyx_L1_error:; __pyx_r = NULL; __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_7gfxdraw_40aatrigon(CYTHON_UNUSED PyObject *__pyx_self, struct __pyx_obj_11pygame_sdl2_7surface_Surface *__pyx_v_surface, PyObject *__pyx_v_x1, PyObject *__pyx_v_y1, PyObject *__pyx_v_x2, PyObject *__pyx_v_y2, PyObject *__pyx_v_x3, PyObject *__pyx_v_y3, PyObject *__pyx_v_color) { struct __pyx_obj_11pygame_sdl2_5color_Color *__pyx_v_c = 0; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; Sint16 __pyx_t_3; Sint16 __pyx_t_4; Sint16 __pyx_t_5; Sint16 __pyx_t_6; Sint16 __pyx_t_7; Sint16 __pyx_t_8; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("aatrigon", 0); /* "pygame_sdl2/gfxdraw.pyx":131 * * def aatrigon(Surface surface, x1, y1, x2, y2, x3, y3, color): * cdef Color c = Color(color) # <<<<<<<<<<<<<< * aatrigonRGBA(surface.surface, x1, y1, x2, y2, x3, y3, c.r, c.g, c.b, c.a) * */ __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 131; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __Pyx_INCREF(__pyx_v_color); __Pyx_GIVEREF(__pyx_v_color); PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_color); __pyx_t_2 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_11pygame_sdl2_5color_Color), __pyx_t_1, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 131; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_v_c = ((struct __pyx_obj_11pygame_sdl2_5color_Color *)__pyx_t_2); __pyx_t_2 = 0; /* "pygame_sdl2/gfxdraw.pyx":132 * def aatrigon(Surface surface, x1, y1, x2, y2, x3, y3, color): * cdef Color c = Color(color) * aatrigonRGBA(surface.surface, x1, y1, x2, y2, x3, y3, c.r, c.g, c.b, c.a) # <<<<<<<<<<<<<< * * def filled_trigon(Surface surface, x1, y1, x2, y2, x3, y3, color): */ __pyx_t_3 = __Pyx_PyInt_As_int16_t(__pyx_v_x1); if (unlikely((__pyx_t_3 == (Sint16)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 132; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_t_4 = __Pyx_PyInt_As_int16_t(__pyx_v_y1); if (unlikely((__pyx_t_4 == (Sint16)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 132; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_t_5 = __Pyx_PyInt_As_int16_t(__pyx_v_x2); if (unlikely((__pyx_t_5 == (Sint16)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 132; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_t_6 = __Pyx_PyInt_As_int16_t(__pyx_v_y2); if (unlikely((__pyx_t_6 == (Sint16)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 132; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_t_7 = __Pyx_PyInt_As_int16_t(__pyx_v_x3); if (unlikely((__pyx_t_7 == (Sint16)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 132; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_t_8 = __Pyx_PyInt_As_int16_t(__pyx_v_y3); if (unlikely((__pyx_t_8 == (Sint16)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 132; __pyx_clineno = __LINE__; goto __pyx_L1_error;} aatrigonRGBA(__pyx_v_surface->surface, __pyx_t_3, __pyx_t_4, __pyx_t_5, __pyx_t_6, __pyx_t_7, __pyx_t_8, __pyx_v_c->r, __pyx_v_c->g, __pyx_v_c->b, __pyx_v_c->a); /* "pygame_sdl2/gfxdraw.pyx":130 * trigonRGBA(surface.surface, x1, y1, x2, y2, x3, y3, c.r, c.g, c.b, c.a) * * def aatrigon(Surface surface, x1, y1, x2, y2, x3, y3, color): # <<<<<<<<<<<<<< * cdef Color c = Color(color) * aatrigonRGBA(surface.surface, x1, y1, x2, y2, x3, y3, c.r, c.g, c.b, c.a) */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_AddTraceback("pygame_sdl2.gfxdraw.aatrigon", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF((PyObject *)__pyx_v_c); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/gfxdraw.pyx":134 * aatrigonRGBA(surface.surface, x1, y1, x2, y2, x3, y3, c.r, c.g, c.b, c.a) * * def filled_trigon(Surface surface, x1, y1, x2, y2, x3, y3, color): # <<<<<<<<<<<<<< * cdef Color c = Color(color) * filledTrigonRGBA(surface.surface, x1, y1, x2, y2, x3, y3, c.r, c.g, c.b, c.a) */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_7gfxdraw_43filled_trigon(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static PyMethodDef __pyx_mdef_11pygame_sdl2_7gfxdraw_43filled_trigon = {"filled_trigon", (PyCFunction)__pyx_pw_11pygame_sdl2_7gfxdraw_43filled_trigon, METH_VARARGS|METH_KEYWORDS, 0}; static PyObject *__pyx_pw_11pygame_sdl2_7gfxdraw_43filled_trigon(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { struct __pyx_obj_11pygame_sdl2_7surface_Surface *__pyx_v_surface = 0; PyObject *__pyx_v_x1 = 0; PyObject *__pyx_v_y1 = 0; PyObject *__pyx_v_x2 = 0; PyObject *__pyx_v_y2 = 0; PyObject *__pyx_v_x3 = 0; PyObject *__pyx_v_y3 = 0; PyObject *__pyx_v_color = 0; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("filled_trigon (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_surface,&__pyx_n_s_x1,&__pyx_n_s_y1,&__pyx_n_s_x2,&__pyx_n_s_y2,&__pyx_n_s_x3,&__pyx_n_s_y3,&__pyx_n_s_color,0}; PyObject* values[8] = {0,0,0,0,0,0,0,0}; if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 8: values[7] = PyTuple_GET_ITEM(__pyx_args, 7); case 7: values[6] = PyTuple_GET_ITEM(__pyx_args, 6); case 6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5); case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4); case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_surface)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; case 1: if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_x1)) != 0)) kw_args--; else { __Pyx_RaiseArgtupleInvalid("filled_trigon", 1, 8, 8, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 134; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } case 2: if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_y1)) != 0)) kw_args--; else { __Pyx_RaiseArgtupleInvalid("filled_trigon", 1, 8, 8, 2); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 134; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } case 3: if (likely((values[3] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_x2)) != 0)) kw_args--; else { __Pyx_RaiseArgtupleInvalid("filled_trigon", 1, 8, 8, 3); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 134; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } case 4: if (likely((values[4] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_y2)) != 0)) kw_args--; else { __Pyx_RaiseArgtupleInvalid("filled_trigon", 1, 8, 8, 4); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 134; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } case 5: if (likely((values[5] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_x3)) != 0)) kw_args--; else { __Pyx_RaiseArgtupleInvalid("filled_trigon", 1, 8, 8, 5); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 134; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } case 6: if (likely((values[6] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_y3)) != 0)) kw_args--; else { __Pyx_RaiseArgtupleInvalid("filled_trigon", 1, 8, 8, 6); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 134; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } case 7: if (likely((values[7] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_color)) != 0)) kw_args--; else { __Pyx_RaiseArgtupleInvalid("filled_trigon", 1, 8, 8, 7); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 134; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "filled_trigon") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 134; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } } else if (PyTuple_GET_SIZE(__pyx_args) != 8) { goto __pyx_L5_argtuple_error; } else { values[0] = PyTuple_GET_ITEM(__pyx_args, 0); values[1] = PyTuple_GET_ITEM(__pyx_args, 1); values[2] = PyTuple_GET_ITEM(__pyx_args, 2); values[3] = PyTuple_GET_ITEM(__pyx_args, 3); values[4] = PyTuple_GET_ITEM(__pyx_args, 4); values[5] = PyTuple_GET_ITEM(__pyx_args, 5); values[6] = PyTuple_GET_ITEM(__pyx_args, 6); values[7] = PyTuple_GET_ITEM(__pyx_args, 7); } __pyx_v_surface = ((struct __pyx_obj_11pygame_sdl2_7surface_Surface *)values[0]); __pyx_v_x1 = values[1]; __pyx_v_y1 = values[2]; __pyx_v_x2 = values[3]; __pyx_v_y2 = values[4]; __pyx_v_x3 = values[5]; __pyx_v_y3 = values[6]; __pyx_v_color = values[7]; } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("filled_trigon", 1, 8, 8, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 134; __pyx_clineno = __LINE__; goto __pyx_L3_error;} __pyx_L3_error:; __Pyx_AddTraceback("pygame_sdl2.gfxdraw.filled_trigon", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_surface), __pyx_ptype_11pygame_sdl2_7surface_Surface, 1, "surface", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 134; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_r = __pyx_pf_11pygame_sdl2_7gfxdraw_42filled_trigon(__pyx_self, __pyx_v_surface, __pyx_v_x1, __pyx_v_y1, __pyx_v_x2, __pyx_v_y2, __pyx_v_x3, __pyx_v_y3, __pyx_v_color); /* function exit code */ goto __pyx_L0; __pyx_L1_error:; __pyx_r = NULL; __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_7gfxdraw_42filled_trigon(CYTHON_UNUSED PyObject *__pyx_self, struct __pyx_obj_11pygame_sdl2_7surface_Surface *__pyx_v_surface, PyObject *__pyx_v_x1, PyObject *__pyx_v_y1, PyObject *__pyx_v_x2, PyObject *__pyx_v_y2, PyObject *__pyx_v_x3, PyObject *__pyx_v_y3, PyObject *__pyx_v_color) { struct __pyx_obj_11pygame_sdl2_5color_Color *__pyx_v_c = 0; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; Sint16 __pyx_t_3; Sint16 __pyx_t_4; Sint16 __pyx_t_5; Sint16 __pyx_t_6; Sint16 __pyx_t_7; Sint16 __pyx_t_8; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("filled_trigon", 0); /* "pygame_sdl2/gfxdraw.pyx":135 * * def filled_trigon(Surface surface, x1, y1, x2, y2, x3, y3, color): * cdef Color c = Color(color) # <<<<<<<<<<<<<< * filledTrigonRGBA(surface.surface, x1, y1, x2, y2, x3, y3, c.r, c.g, c.b, c.a) * */ __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 135; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __Pyx_INCREF(__pyx_v_color); __Pyx_GIVEREF(__pyx_v_color); PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_color); __pyx_t_2 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_11pygame_sdl2_5color_Color), __pyx_t_1, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 135; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_v_c = ((struct __pyx_obj_11pygame_sdl2_5color_Color *)__pyx_t_2); __pyx_t_2 = 0; /* "pygame_sdl2/gfxdraw.pyx":136 * def filled_trigon(Surface surface, x1, y1, x2, y2, x3, y3, color): * cdef Color c = Color(color) * filledTrigonRGBA(surface.surface, x1, y1, x2, y2, x3, y3, c.r, c.g, c.b, c.a) # <<<<<<<<<<<<<< * * def polygon(Surface surface, points, color): */ __pyx_t_3 = __Pyx_PyInt_As_int16_t(__pyx_v_x1); if (unlikely((__pyx_t_3 == (Sint16)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 136; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_t_4 = __Pyx_PyInt_As_int16_t(__pyx_v_y1); if (unlikely((__pyx_t_4 == (Sint16)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 136; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_t_5 = __Pyx_PyInt_As_int16_t(__pyx_v_x2); if (unlikely((__pyx_t_5 == (Sint16)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 136; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_t_6 = __Pyx_PyInt_As_int16_t(__pyx_v_y2); if (unlikely((__pyx_t_6 == (Sint16)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 136; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_t_7 = __Pyx_PyInt_As_int16_t(__pyx_v_x3); if (unlikely((__pyx_t_7 == (Sint16)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 136; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_t_8 = __Pyx_PyInt_As_int16_t(__pyx_v_y3); if (unlikely((__pyx_t_8 == (Sint16)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 136; __pyx_clineno = __LINE__; goto __pyx_L1_error;} filledTrigonRGBA(__pyx_v_surface->surface, __pyx_t_3, __pyx_t_4, __pyx_t_5, __pyx_t_6, __pyx_t_7, __pyx_t_8, __pyx_v_c->r, __pyx_v_c->g, __pyx_v_c->b, __pyx_v_c->a); /* "pygame_sdl2/gfxdraw.pyx":134 * aatrigonRGBA(surface.surface, x1, y1, x2, y2, x3, y3, c.r, c.g, c.b, c.a) * * def filled_trigon(Surface surface, x1, y1, x2, y2, x3, y3, color): # <<<<<<<<<<<<<< * cdef Color c = Color(color) * filledTrigonRGBA(surface.surface, x1, y1, x2, y2, x3, y3, c.r, c.g, c.b, c.a) */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_AddTraceback("pygame_sdl2.gfxdraw.filled_trigon", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF((PyObject *)__pyx_v_c); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/gfxdraw.pyx":138 * filledTrigonRGBA(surface.surface, x1, y1, x2, y2, x3, y3, c.r, c.g, c.b, c.a) * * def polygon(Surface surface, points, color): # <<<<<<<<<<<<<< * cdef Color c = Color(color) * cdef Sint16 *vx */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_7gfxdraw_45polygon(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static PyMethodDef __pyx_mdef_11pygame_sdl2_7gfxdraw_45polygon = {"polygon", (PyCFunction)__pyx_pw_11pygame_sdl2_7gfxdraw_45polygon, METH_VARARGS|METH_KEYWORDS, 0}; static PyObject *__pyx_pw_11pygame_sdl2_7gfxdraw_45polygon(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { struct __pyx_obj_11pygame_sdl2_7surface_Surface *__pyx_v_surface = 0; PyObject *__pyx_v_points = 0; PyObject *__pyx_v_color = 0; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("polygon (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_surface,&__pyx_n_s_points,&__pyx_n_s_color,0}; PyObject* values[3] = {0,0,0}; if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_surface)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; case 1: if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_points)) != 0)) kw_args--; else { __Pyx_RaiseArgtupleInvalid("polygon", 1, 3, 3, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 138; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } case 2: if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_color)) != 0)) kw_args--; else { __Pyx_RaiseArgtupleInvalid("polygon", 1, 3, 3, 2); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 138; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "polygon") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 138; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } } else if (PyTuple_GET_SIZE(__pyx_args) != 3) { goto __pyx_L5_argtuple_error; } else { values[0] = PyTuple_GET_ITEM(__pyx_args, 0); values[1] = PyTuple_GET_ITEM(__pyx_args, 1); values[2] = PyTuple_GET_ITEM(__pyx_args, 2); } __pyx_v_surface = ((struct __pyx_obj_11pygame_sdl2_7surface_Surface *)values[0]); __pyx_v_points = values[1]; __pyx_v_color = values[2]; } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("polygon", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 138; __pyx_clineno = __LINE__; goto __pyx_L3_error;} __pyx_L3_error:; __Pyx_AddTraceback("pygame_sdl2.gfxdraw.polygon", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_surface), __pyx_ptype_11pygame_sdl2_7surface_Surface, 1, "surface", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 138; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_r = __pyx_pf_11pygame_sdl2_7gfxdraw_44polygon(__pyx_self, __pyx_v_surface, __pyx_v_points, __pyx_v_color); /* function exit code */ goto __pyx_L0; __pyx_L1_error:; __pyx_r = NULL; __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_7gfxdraw_44polygon(CYTHON_UNUSED PyObject *__pyx_self, struct __pyx_obj_11pygame_sdl2_7surface_Surface *__pyx_v_surface, PyObject *__pyx_v_points, PyObject *__pyx_v_color) { struct __pyx_obj_11pygame_sdl2_5color_Color *__pyx_v_c = 0; Sint16 *__pyx_v_vx; Sint16 *__pyx_v_vy; size_t __pyx_v_num_points; PyObject *__pyx_v_n = NULL; CYTHON_UNUSED PyObject *__pyx_v_pt = NULL; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; Py_ssize_t __pyx_t_3; PyObject *(*__pyx_t_4)(PyObject *); PyObject *__pyx_t_5 = NULL; PyObject *__pyx_t_6 = NULL; PyObject *__pyx_t_7 = NULL; PyObject *(*__pyx_t_8)(PyObject *); Sint16 __pyx_t_9; Sint16 __pyx_t_10; Py_ssize_t __pyx_t_11; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("polygon", 0); /* "pygame_sdl2/gfxdraw.pyx":139 * * def polygon(Surface surface, points, color): * cdef Color c = Color(color) # <<<<<<<<<<<<<< * cdef Sint16 *vx * cdef Sint16 *vy */ __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 139; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __Pyx_INCREF(__pyx_v_color); __Pyx_GIVEREF(__pyx_v_color); PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_color); __pyx_t_2 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_11pygame_sdl2_5color_Color), __pyx_t_1, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 139; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_v_c = ((struct __pyx_obj_11pygame_sdl2_5color_Color *)__pyx_t_2); __pyx_t_2 = 0; /* "pygame_sdl2/gfxdraw.pyx":142 * cdef Sint16 *vx * cdef Sint16 *vy * cdef size_t num_points = len(points) # <<<<<<<<<<<<<< * vx = malloc(num_points * sizeof(Sint16)) * vy = malloc(num_points * sizeof(Sint16)) */ __pyx_t_3 = PyObject_Length(__pyx_v_points); if (unlikely(__pyx_t_3 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 142; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_v_num_points = __pyx_t_3; /* "pygame_sdl2/gfxdraw.pyx":143 * cdef Sint16 *vy * cdef size_t num_points = len(points) * vx = malloc(num_points * sizeof(Sint16)) # <<<<<<<<<<<<<< * vy = malloc(num_points * sizeof(Sint16)) * for n, pt in zip(range(num_points), points): */ __pyx_v_vx = ((Sint16 *)malloc((__pyx_v_num_points * (sizeof(Sint16))))); /* "pygame_sdl2/gfxdraw.pyx":144 * cdef size_t num_points = len(points) * vx = malloc(num_points * sizeof(Sint16)) * vy = malloc(num_points * sizeof(Sint16)) # <<<<<<<<<<<<<< * for n, pt in zip(range(num_points), points): * vx[n], vy[n] = points[n] */ __pyx_v_vy = ((Sint16 *)malloc((__pyx_v_num_points * (sizeof(Sint16))))); /* "pygame_sdl2/gfxdraw.pyx":145 * vx = malloc(num_points * sizeof(Sint16)) * vy = malloc(num_points * sizeof(Sint16)) * for n, pt in zip(range(num_points), points): # <<<<<<<<<<<<<< * vx[n], vy[n] = points[n] * polygonRGBA(surface.surface, vx, vy, num_points, c.r, c.g, c.b, c.a) */ __pyx_t_2 = __Pyx_PyInt_FromSize_t(__pyx_v_num_points); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 145; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 145; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __Pyx_GIVEREF(__pyx_t_2); PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_2); __pyx_t_2 = 0; __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_range, __pyx_t_1, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 145; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 145; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __Pyx_GIVEREF(__pyx_t_2); PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_2); __Pyx_INCREF(__pyx_v_points); __Pyx_GIVEREF(__pyx_v_points); PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_v_points); __pyx_t_2 = 0; __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_zip, __pyx_t_1, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 145; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (likely(PyList_CheckExact(__pyx_t_2)) || PyTuple_CheckExact(__pyx_t_2)) { __pyx_t_1 = __pyx_t_2; __Pyx_INCREF(__pyx_t_1); __pyx_t_3 = 0; __pyx_t_4 = NULL; } else { __pyx_t_3 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_t_2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 145; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_t_4 = Py_TYPE(__pyx_t_1)->tp_iternext; if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 145; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; for (;;) { if (likely(!__pyx_t_4)) { if (likely(PyList_CheckExact(__pyx_t_1))) { if (__pyx_t_3 >= PyList_GET_SIZE(__pyx_t_1)) break; #if CYTHON_COMPILING_IN_CPYTHON __pyx_t_2 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_3); __Pyx_INCREF(__pyx_t_2); __pyx_t_3++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 145; __pyx_clineno = __LINE__; goto __pyx_L1_error;} #else __pyx_t_2 = PySequence_ITEM(__pyx_t_1, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 145; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); #endif } else { if (__pyx_t_3 >= PyTuple_GET_SIZE(__pyx_t_1)) break; #if CYTHON_COMPILING_IN_CPYTHON __pyx_t_2 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_3); __Pyx_INCREF(__pyx_t_2); __pyx_t_3++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 145; __pyx_clineno = __LINE__; goto __pyx_L1_error;} #else __pyx_t_2 = PySequence_ITEM(__pyx_t_1, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 145; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); #endif } } else { __pyx_t_2 = __pyx_t_4(__pyx_t_1); if (unlikely(!__pyx_t_2)) { PyObject* exc_type = PyErr_Occurred(); if (exc_type) { if (likely(exc_type == PyExc_StopIteration || PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); else {__pyx_filename = __pyx_f[0]; __pyx_lineno = 145; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } break; } __Pyx_GOTREF(__pyx_t_2); } if ((likely(PyTuple_CheckExact(__pyx_t_2))) || (PyList_CheckExact(__pyx_t_2))) { PyObject* sequence = __pyx_t_2; #if CYTHON_COMPILING_IN_CPYTHON Py_ssize_t size = Py_SIZE(sequence); #else Py_ssize_t size = PySequence_Size(sequence); #endif if (unlikely(size != 2)) { if (size > 2) __Pyx_RaiseTooManyValuesError(2); else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 145; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } #if CYTHON_COMPILING_IN_CPYTHON if (likely(PyTuple_CheckExact(sequence))) { __pyx_t_5 = PyTuple_GET_ITEM(sequence, 0); __pyx_t_6 = PyTuple_GET_ITEM(sequence, 1); } else { __pyx_t_5 = PyList_GET_ITEM(sequence, 0); __pyx_t_6 = PyList_GET_ITEM(sequence, 1); } __Pyx_INCREF(__pyx_t_5); __Pyx_INCREF(__pyx_t_6); #else __pyx_t_5 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 145; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); __pyx_t_6 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 145; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_6); #endif __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } else { Py_ssize_t index = -1; __pyx_t_7 = PyObject_GetIter(__pyx_t_2); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 145; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_8 = Py_TYPE(__pyx_t_7)->tp_iternext; index = 0; __pyx_t_5 = __pyx_t_8(__pyx_t_7); if (unlikely(!__pyx_t_5)) goto __pyx_L5_unpacking_failed; __Pyx_GOTREF(__pyx_t_5); index = 1; __pyx_t_6 = __pyx_t_8(__pyx_t_7); if (unlikely(!__pyx_t_6)) goto __pyx_L5_unpacking_failed; __Pyx_GOTREF(__pyx_t_6); if (__Pyx_IternextUnpackEndCheck(__pyx_t_8(__pyx_t_7), 2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 145; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_t_8 = NULL; __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; goto __pyx_L6_unpacking_done; __pyx_L5_unpacking_failed:; __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __pyx_t_8 = NULL; if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 145; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_L6_unpacking_done:; } __Pyx_XDECREF_SET(__pyx_v_n, __pyx_t_5); __pyx_t_5 = 0; __Pyx_XDECREF_SET(__pyx_v_pt, __pyx_t_6); __pyx_t_6 = 0; /* "pygame_sdl2/gfxdraw.pyx":146 * vy = malloc(num_points * sizeof(Sint16)) * for n, pt in zip(range(num_points), points): * vx[n], vy[n] = points[n] # <<<<<<<<<<<<<< * polygonRGBA(surface.surface, vx, vy, num_points, c.r, c.g, c.b, c.a) * free(vx) */ __pyx_t_2 = PyObject_GetItem(__pyx_v_points, __pyx_v_n); if (unlikely(__pyx_t_2 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 146; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; __Pyx_GOTREF(__pyx_t_2); if ((likely(PyTuple_CheckExact(__pyx_t_2))) || (PyList_CheckExact(__pyx_t_2))) { PyObject* sequence = __pyx_t_2; #if CYTHON_COMPILING_IN_CPYTHON Py_ssize_t size = Py_SIZE(sequence); #else Py_ssize_t size = PySequence_Size(sequence); #endif if (unlikely(size != 2)) { if (size > 2) __Pyx_RaiseTooManyValuesError(2); else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 146; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } #if CYTHON_COMPILING_IN_CPYTHON if (likely(PyTuple_CheckExact(sequence))) { __pyx_t_6 = PyTuple_GET_ITEM(sequence, 0); __pyx_t_5 = PyTuple_GET_ITEM(sequence, 1); } else { __pyx_t_6 = PyList_GET_ITEM(sequence, 0); __pyx_t_5 = PyList_GET_ITEM(sequence, 1); } __Pyx_INCREF(__pyx_t_6); __Pyx_INCREF(__pyx_t_5); #else __pyx_t_6 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 146; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_6); __pyx_t_5 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 146; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); #endif __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } else { Py_ssize_t index = -1; __pyx_t_7 = PyObject_GetIter(__pyx_t_2); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 146; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_8 = Py_TYPE(__pyx_t_7)->tp_iternext; index = 0; __pyx_t_6 = __pyx_t_8(__pyx_t_7); if (unlikely(!__pyx_t_6)) goto __pyx_L7_unpacking_failed; __Pyx_GOTREF(__pyx_t_6); index = 1; __pyx_t_5 = __pyx_t_8(__pyx_t_7); if (unlikely(!__pyx_t_5)) goto __pyx_L7_unpacking_failed; __Pyx_GOTREF(__pyx_t_5); if (__Pyx_IternextUnpackEndCheck(__pyx_t_8(__pyx_t_7), 2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 146; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_t_8 = NULL; __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; goto __pyx_L8_unpacking_done; __pyx_L7_unpacking_failed:; __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __pyx_t_8 = NULL; if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 146; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_L8_unpacking_done:; } __pyx_t_9 = __Pyx_PyInt_As_int16_t(__pyx_t_6); if (unlikely((__pyx_t_9 == (Sint16)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 146; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __pyx_t_10 = __Pyx_PyInt_As_int16_t(__pyx_t_5); if (unlikely((__pyx_t_10 == (Sint16)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 146; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __pyx_t_11 = __Pyx_PyIndex_AsSsize_t(__pyx_v_n); if (unlikely((__pyx_t_11 == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 146; __pyx_clineno = __LINE__; goto __pyx_L1_error;} (__pyx_v_vx[__pyx_t_11]) = __pyx_t_9; __pyx_t_11 = __Pyx_PyIndex_AsSsize_t(__pyx_v_n); if (unlikely((__pyx_t_11 == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 146; __pyx_clineno = __LINE__; goto __pyx_L1_error;} (__pyx_v_vy[__pyx_t_11]) = __pyx_t_10; /* "pygame_sdl2/gfxdraw.pyx":145 * vx = malloc(num_points * sizeof(Sint16)) * vy = malloc(num_points * sizeof(Sint16)) * for n, pt in zip(range(num_points), points): # <<<<<<<<<<<<<< * vx[n], vy[n] = points[n] * polygonRGBA(surface.surface, vx, vy, num_points, c.r, c.g, c.b, c.a) */ } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "pygame_sdl2/gfxdraw.pyx":147 * for n, pt in zip(range(num_points), points): * vx[n], vy[n] = points[n] * polygonRGBA(surface.surface, vx, vy, num_points, c.r, c.g, c.b, c.a) # <<<<<<<<<<<<<< * free(vx) * free(vy) */ polygonRGBA(__pyx_v_surface->surface, __pyx_v_vx, __pyx_v_vy, __pyx_v_num_points, __pyx_v_c->r, __pyx_v_c->g, __pyx_v_c->b, __pyx_v_c->a); /* "pygame_sdl2/gfxdraw.pyx":148 * vx[n], vy[n] = points[n] * polygonRGBA(surface.surface, vx, vy, num_points, c.r, c.g, c.b, c.a) * free(vx) # <<<<<<<<<<<<<< * free(vy) * */ free(__pyx_v_vx); /* "pygame_sdl2/gfxdraw.pyx":149 * polygonRGBA(surface.surface, vx, vy, num_points, c.r, c.g, c.b, c.a) * free(vx) * free(vy) # <<<<<<<<<<<<<< * * def aapolygon(Surface surface, points, color): */ free(__pyx_v_vy); /* "pygame_sdl2/gfxdraw.pyx":138 * filledTrigonRGBA(surface.surface, x1, y1, x2, y2, x3, y3, c.r, c.g, c.b, c.a) * * def polygon(Surface surface, points, color): # <<<<<<<<<<<<<< * cdef Color c = Color(color) * cdef Sint16 *vx */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_5); __Pyx_XDECREF(__pyx_t_6); __Pyx_XDECREF(__pyx_t_7); __Pyx_AddTraceback("pygame_sdl2.gfxdraw.polygon", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF((PyObject *)__pyx_v_c); __Pyx_XDECREF(__pyx_v_n); __Pyx_XDECREF(__pyx_v_pt); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/gfxdraw.pyx":151 * free(vy) * * def aapolygon(Surface surface, points, color): # <<<<<<<<<<<<<< * cdef Color c = Color(color) * cdef Sint16 *vx */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_7gfxdraw_47aapolygon(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static PyMethodDef __pyx_mdef_11pygame_sdl2_7gfxdraw_47aapolygon = {"aapolygon", (PyCFunction)__pyx_pw_11pygame_sdl2_7gfxdraw_47aapolygon, METH_VARARGS|METH_KEYWORDS, 0}; static PyObject *__pyx_pw_11pygame_sdl2_7gfxdraw_47aapolygon(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { struct __pyx_obj_11pygame_sdl2_7surface_Surface *__pyx_v_surface = 0; PyObject *__pyx_v_points = 0; PyObject *__pyx_v_color = 0; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("aapolygon (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_surface,&__pyx_n_s_points,&__pyx_n_s_color,0}; PyObject* values[3] = {0,0,0}; if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_surface)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; case 1: if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_points)) != 0)) kw_args--; else { __Pyx_RaiseArgtupleInvalid("aapolygon", 1, 3, 3, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 151; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } case 2: if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_color)) != 0)) kw_args--; else { __Pyx_RaiseArgtupleInvalid("aapolygon", 1, 3, 3, 2); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 151; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "aapolygon") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 151; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } } else if (PyTuple_GET_SIZE(__pyx_args) != 3) { goto __pyx_L5_argtuple_error; } else { values[0] = PyTuple_GET_ITEM(__pyx_args, 0); values[1] = PyTuple_GET_ITEM(__pyx_args, 1); values[2] = PyTuple_GET_ITEM(__pyx_args, 2); } __pyx_v_surface = ((struct __pyx_obj_11pygame_sdl2_7surface_Surface *)values[0]); __pyx_v_points = values[1]; __pyx_v_color = values[2]; } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("aapolygon", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 151; __pyx_clineno = __LINE__; goto __pyx_L3_error;} __pyx_L3_error:; __Pyx_AddTraceback("pygame_sdl2.gfxdraw.aapolygon", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_surface), __pyx_ptype_11pygame_sdl2_7surface_Surface, 1, "surface", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 151; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_r = __pyx_pf_11pygame_sdl2_7gfxdraw_46aapolygon(__pyx_self, __pyx_v_surface, __pyx_v_points, __pyx_v_color); /* function exit code */ goto __pyx_L0; __pyx_L1_error:; __pyx_r = NULL; __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_7gfxdraw_46aapolygon(CYTHON_UNUSED PyObject *__pyx_self, struct __pyx_obj_11pygame_sdl2_7surface_Surface *__pyx_v_surface, PyObject *__pyx_v_points, PyObject *__pyx_v_color) { struct __pyx_obj_11pygame_sdl2_5color_Color *__pyx_v_c = 0; Sint16 *__pyx_v_vx; Sint16 *__pyx_v_vy; size_t __pyx_v_num_points; PyObject *__pyx_v_n = NULL; CYTHON_UNUSED PyObject *__pyx_v_pt = NULL; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; Py_ssize_t __pyx_t_3; PyObject *(*__pyx_t_4)(PyObject *); PyObject *__pyx_t_5 = NULL; PyObject *__pyx_t_6 = NULL; PyObject *__pyx_t_7 = NULL; PyObject *(*__pyx_t_8)(PyObject *); Sint16 __pyx_t_9; Sint16 __pyx_t_10; Py_ssize_t __pyx_t_11; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("aapolygon", 0); /* "pygame_sdl2/gfxdraw.pyx":152 * * def aapolygon(Surface surface, points, color): * cdef Color c = Color(color) # <<<<<<<<<<<<<< * cdef Sint16 *vx * cdef Sint16 *vy */ __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 152; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __Pyx_INCREF(__pyx_v_color); __Pyx_GIVEREF(__pyx_v_color); PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_color); __pyx_t_2 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_11pygame_sdl2_5color_Color), __pyx_t_1, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 152; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_v_c = ((struct __pyx_obj_11pygame_sdl2_5color_Color *)__pyx_t_2); __pyx_t_2 = 0; /* "pygame_sdl2/gfxdraw.pyx":155 * cdef Sint16 *vx * cdef Sint16 *vy * cdef size_t num_points = len(points) # <<<<<<<<<<<<<< * vx = malloc(num_points * sizeof(Sint16)) * vy = malloc(num_points * sizeof(Sint16)) */ __pyx_t_3 = PyObject_Length(__pyx_v_points); if (unlikely(__pyx_t_3 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 155; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_v_num_points = __pyx_t_3; /* "pygame_sdl2/gfxdraw.pyx":156 * cdef Sint16 *vy * cdef size_t num_points = len(points) * vx = malloc(num_points * sizeof(Sint16)) # <<<<<<<<<<<<<< * vy = malloc(num_points * sizeof(Sint16)) * for n, pt in zip(range(num_points), points): */ __pyx_v_vx = ((Sint16 *)malloc((__pyx_v_num_points * (sizeof(Sint16))))); /* "pygame_sdl2/gfxdraw.pyx":157 * cdef size_t num_points = len(points) * vx = malloc(num_points * sizeof(Sint16)) * vy = malloc(num_points * sizeof(Sint16)) # <<<<<<<<<<<<<< * for n, pt in zip(range(num_points), points): * vx[n], vy[n] = points[n] */ __pyx_v_vy = ((Sint16 *)malloc((__pyx_v_num_points * (sizeof(Sint16))))); /* "pygame_sdl2/gfxdraw.pyx":158 * vx = malloc(num_points * sizeof(Sint16)) * vy = malloc(num_points * sizeof(Sint16)) * for n, pt in zip(range(num_points), points): # <<<<<<<<<<<<<< * vx[n], vy[n] = points[n] * aapolygonRGBA(surface.surface, vx, vy, num_points, c.r, c.g, c.b, c.a) */ __pyx_t_2 = __Pyx_PyInt_FromSize_t(__pyx_v_num_points); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 158; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 158; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __Pyx_GIVEREF(__pyx_t_2); PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_2); __pyx_t_2 = 0; __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_range, __pyx_t_1, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 158; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 158; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __Pyx_GIVEREF(__pyx_t_2); PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_2); __Pyx_INCREF(__pyx_v_points); __Pyx_GIVEREF(__pyx_v_points); PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_v_points); __pyx_t_2 = 0; __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_zip, __pyx_t_1, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 158; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (likely(PyList_CheckExact(__pyx_t_2)) || PyTuple_CheckExact(__pyx_t_2)) { __pyx_t_1 = __pyx_t_2; __Pyx_INCREF(__pyx_t_1); __pyx_t_3 = 0; __pyx_t_4 = NULL; } else { __pyx_t_3 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_t_2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 158; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_t_4 = Py_TYPE(__pyx_t_1)->tp_iternext; if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 158; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; for (;;) { if (likely(!__pyx_t_4)) { if (likely(PyList_CheckExact(__pyx_t_1))) { if (__pyx_t_3 >= PyList_GET_SIZE(__pyx_t_1)) break; #if CYTHON_COMPILING_IN_CPYTHON __pyx_t_2 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_3); __Pyx_INCREF(__pyx_t_2); __pyx_t_3++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 158; __pyx_clineno = __LINE__; goto __pyx_L1_error;} #else __pyx_t_2 = PySequence_ITEM(__pyx_t_1, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 158; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); #endif } else { if (__pyx_t_3 >= PyTuple_GET_SIZE(__pyx_t_1)) break; #if CYTHON_COMPILING_IN_CPYTHON __pyx_t_2 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_3); __Pyx_INCREF(__pyx_t_2); __pyx_t_3++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 158; __pyx_clineno = __LINE__; goto __pyx_L1_error;} #else __pyx_t_2 = PySequence_ITEM(__pyx_t_1, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 158; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); #endif } } else { __pyx_t_2 = __pyx_t_4(__pyx_t_1); if (unlikely(!__pyx_t_2)) { PyObject* exc_type = PyErr_Occurred(); if (exc_type) { if (likely(exc_type == PyExc_StopIteration || PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); else {__pyx_filename = __pyx_f[0]; __pyx_lineno = 158; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } break; } __Pyx_GOTREF(__pyx_t_2); } if ((likely(PyTuple_CheckExact(__pyx_t_2))) || (PyList_CheckExact(__pyx_t_2))) { PyObject* sequence = __pyx_t_2; #if CYTHON_COMPILING_IN_CPYTHON Py_ssize_t size = Py_SIZE(sequence); #else Py_ssize_t size = PySequence_Size(sequence); #endif if (unlikely(size != 2)) { if (size > 2) __Pyx_RaiseTooManyValuesError(2); else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 158; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } #if CYTHON_COMPILING_IN_CPYTHON if (likely(PyTuple_CheckExact(sequence))) { __pyx_t_5 = PyTuple_GET_ITEM(sequence, 0); __pyx_t_6 = PyTuple_GET_ITEM(sequence, 1); } else { __pyx_t_5 = PyList_GET_ITEM(sequence, 0); __pyx_t_6 = PyList_GET_ITEM(sequence, 1); } __Pyx_INCREF(__pyx_t_5); __Pyx_INCREF(__pyx_t_6); #else __pyx_t_5 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 158; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); __pyx_t_6 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 158; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_6); #endif __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } else { Py_ssize_t index = -1; __pyx_t_7 = PyObject_GetIter(__pyx_t_2); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 158; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_8 = Py_TYPE(__pyx_t_7)->tp_iternext; index = 0; __pyx_t_5 = __pyx_t_8(__pyx_t_7); if (unlikely(!__pyx_t_5)) goto __pyx_L5_unpacking_failed; __Pyx_GOTREF(__pyx_t_5); index = 1; __pyx_t_6 = __pyx_t_8(__pyx_t_7); if (unlikely(!__pyx_t_6)) goto __pyx_L5_unpacking_failed; __Pyx_GOTREF(__pyx_t_6); if (__Pyx_IternextUnpackEndCheck(__pyx_t_8(__pyx_t_7), 2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 158; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_t_8 = NULL; __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; goto __pyx_L6_unpacking_done; __pyx_L5_unpacking_failed:; __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __pyx_t_8 = NULL; if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 158; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_L6_unpacking_done:; } __Pyx_XDECREF_SET(__pyx_v_n, __pyx_t_5); __pyx_t_5 = 0; __Pyx_XDECREF_SET(__pyx_v_pt, __pyx_t_6); __pyx_t_6 = 0; /* "pygame_sdl2/gfxdraw.pyx":159 * vy = malloc(num_points * sizeof(Sint16)) * for n, pt in zip(range(num_points), points): * vx[n], vy[n] = points[n] # <<<<<<<<<<<<<< * aapolygonRGBA(surface.surface, vx, vy, num_points, c.r, c.g, c.b, c.a) * free(vx) */ __pyx_t_2 = PyObject_GetItem(__pyx_v_points, __pyx_v_n); if (unlikely(__pyx_t_2 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 159; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; __Pyx_GOTREF(__pyx_t_2); if ((likely(PyTuple_CheckExact(__pyx_t_2))) || (PyList_CheckExact(__pyx_t_2))) { PyObject* sequence = __pyx_t_2; #if CYTHON_COMPILING_IN_CPYTHON Py_ssize_t size = Py_SIZE(sequence); #else Py_ssize_t size = PySequence_Size(sequence); #endif if (unlikely(size != 2)) { if (size > 2) __Pyx_RaiseTooManyValuesError(2); else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 159; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } #if CYTHON_COMPILING_IN_CPYTHON if (likely(PyTuple_CheckExact(sequence))) { __pyx_t_6 = PyTuple_GET_ITEM(sequence, 0); __pyx_t_5 = PyTuple_GET_ITEM(sequence, 1); } else { __pyx_t_6 = PyList_GET_ITEM(sequence, 0); __pyx_t_5 = PyList_GET_ITEM(sequence, 1); } __Pyx_INCREF(__pyx_t_6); __Pyx_INCREF(__pyx_t_5); #else __pyx_t_6 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 159; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_6); __pyx_t_5 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 159; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); #endif __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } else { Py_ssize_t index = -1; __pyx_t_7 = PyObject_GetIter(__pyx_t_2); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 159; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_8 = Py_TYPE(__pyx_t_7)->tp_iternext; index = 0; __pyx_t_6 = __pyx_t_8(__pyx_t_7); if (unlikely(!__pyx_t_6)) goto __pyx_L7_unpacking_failed; __Pyx_GOTREF(__pyx_t_6); index = 1; __pyx_t_5 = __pyx_t_8(__pyx_t_7); if (unlikely(!__pyx_t_5)) goto __pyx_L7_unpacking_failed; __Pyx_GOTREF(__pyx_t_5); if (__Pyx_IternextUnpackEndCheck(__pyx_t_8(__pyx_t_7), 2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 159; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_t_8 = NULL; __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; goto __pyx_L8_unpacking_done; __pyx_L7_unpacking_failed:; __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __pyx_t_8 = NULL; if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 159; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_L8_unpacking_done:; } __pyx_t_9 = __Pyx_PyInt_As_int16_t(__pyx_t_6); if (unlikely((__pyx_t_9 == (Sint16)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 159; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __pyx_t_10 = __Pyx_PyInt_As_int16_t(__pyx_t_5); if (unlikely((__pyx_t_10 == (Sint16)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 159; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __pyx_t_11 = __Pyx_PyIndex_AsSsize_t(__pyx_v_n); if (unlikely((__pyx_t_11 == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 159; __pyx_clineno = __LINE__; goto __pyx_L1_error;} (__pyx_v_vx[__pyx_t_11]) = __pyx_t_9; __pyx_t_11 = __Pyx_PyIndex_AsSsize_t(__pyx_v_n); if (unlikely((__pyx_t_11 == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 159; __pyx_clineno = __LINE__; goto __pyx_L1_error;} (__pyx_v_vy[__pyx_t_11]) = __pyx_t_10; /* "pygame_sdl2/gfxdraw.pyx":158 * vx = malloc(num_points * sizeof(Sint16)) * vy = malloc(num_points * sizeof(Sint16)) * for n, pt in zip(range(num_points), points): # <<<<<<<<<<<<<< * vx[n], vy[n] = points[n] * aapolygonRGBA(surface.surface, vx, vy, num_points, c.r, c.g, c.b, c.a) */ } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "pygame_sdl2/gfxdraw.pyx":160 * for n, pt in zip(range(num_points), points): * vx[n], vy[n] = points[n] * aapolygonRGBA(surface.surface, vx, vy, num_points, c.r, c.g, c.b, c.a) # <<<<<<<<<<<<<< * free(vx) * free(vy) */ aapolygonRGBA(__pyx_v_surface->surface, __pyx_v_vx, __pyx_v_vy, __pyx_v_num_points, __pyx_v_c->r, __pyx_v_c->g, __pyx_v_c->b, __pyx_v_c->a); /* "pygame_sdl2/gfxdraw.pyx":161 * vx[n], vy[n] = points[n] * aapolygonRGBA(surface.surface, vx, vy, num_points, c.r, c.g, c.b, c.a) * free(vx) # <<<<<<<<<<<<<< * free(vy) * */ free(__pyx_v_vx); /* "pygame_sdl2/gfxdraw.pyx":162 * aapolygonRGBA(surface.surface, vx, vy, num_points, c.r, c.g, c.b, c.a) * free(vx) * free(vy) # <<<<<<<<<<<<<< * * def filled_polygon(Surface surface, points, color): */ free(__pyx_v_vy); /* "pygame_sdl2/gfxdraw.pyx":151 * free(vy) * * def aapolygon(Surface surface, points, color): # <<<<<<<<<<<<<< * cdef Color c = Color(color) * cdef Sint16 *vx */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_5); __Pyx_XDECREF(__pyx_t_6); __Pyx_XDECREF(__pyx_t_7); __Pyx_AddTraceback("pygame_sdl2.gfxdraw.aapolygon", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF((PyObject *)__pyx_v_c); __Pyx_XDECREF(__pyx_v_n); __Pyx_XDECREF(__pyx_v_pt); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/gfxdraw.pyx":164 * free(vy) * * def filled_polygon(Surface surface, points, color): # <<<<<<<<<<<<<< * cdef Color c = Color(color) * cdef Sint16 *vx */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_7gfxdraw_49filled_polygon(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static PyMethodDef __pyx_mdef_11pygame_sdl2_7gfxdraw_49filled_polygon = {"filled_polygon", (PyCFunction)__pyx_pw_11pygame_sdl2_7gfxdraw_49filled_polygon, METH_VARARGS|METH_KEYWORDS, 0}; static PyObject *__pyx_pw_11pygame_sdl2_7gfxdraw_49filled_polygon(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { struct __pyx_obj_11pygame_sdl2_7surface_Surface *__pyx_v_surface = 0; PyObject *__pyx_v_points = 0; PyObject *__pyx_v_color = 0; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("filled_polygon (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_surface,&__pyx_n_s_points,&__pyx_n_s_color,0}; PyObject* values[3] = {0,0,0}; if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_surface)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; case 1: if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_points)) != 0)) kw_args--; else { __Pyx_RaiseArgtupleInvalid("filled_polygon", 1, 3, 3, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 164; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } case 2: if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_color)) != 0)) kw_args--; else { __Pyx_RaiseArgtupleInvalid("filled_polygon", 1, 3, 3, 2); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 164; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "filled_polygon") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 164; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } } else if (PyTuple_GET_SIZE(__pyx_args) != 3) { goto __pyx_L5_argtuple_error; } else { values[0] = PyTuple_GET_ITEM(__pyx_args, 0); values[1] = PyTuple_GET_ITEM(__pyx_args, 1); values[2] = PyTuple_GET_ITEM(__pyx_args, 2); } __pyx_v_surface = ((struct __pyx_obj_11pygame_sdl2_7surface_Surface *)values[0]); __pyx_v_points = values[1]; __pyx_v_color = values[2]; } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("filled_polygon", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 164; __pyx_clineno = __LINE__; goto __pyx_L3_error;} __pyx_L3_error:; __Pyx_AddTraceback("pygame_sdl2.gfxdraw.filled_polygon", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_surface), __pyx_ptype_11pygame_sdl2_7surface_Surface, 1, "surface", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 164; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_r = __pyx_pf_11pygame_sdl2_7gfxdraw_48filled_polygon(__pyx_self, __pyx_v_surface, __pyx_v_points, __pyx_v_color); /* function exit code */ goto __pyx_L0; __pyx_L1_error:; __pyx_r = NULL; __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_7gfxdraw_48filled_polygon(CYTHON_UNUSED PyObject *__pyx_self, struct __pyx_obj_11pygame_sdl2_7surface_Surface *__pyx_v_surface, PyObject *__pyx_v_points, PyObject *__pyx_v_color) { struct __pyx_obj_11pygame_sdl2_5color_Color *__pyx_v_c = 0; Sint16 *__pyx_v_vx; Sint16 *__pyx_v_vy; size_t __pyx_v_num_points; PyObject *__pyx_v_n = NULL; CYTHON_UNUSED PyObject *__pyx_v_pt = NULL; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; Py_ssize_t __pyx_t_3; PyObject *(*__pyx_t_4)(PyObject *); PyObject *__pyx_t_5 = NULL; PyObject *__pyx_t_6 = NULL; PyObject *__pyx_t_7 = NULL; PyObject *(*__pyx_t_8)(PyObject *); Sint16 __pyx_t_9; Sint16 __pyx_t_10; Py_ssize_t __pyx_t_11; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("filled_polygon", 0); /* "pygame_sdl2/gfxdraw.pyx":165 * * def filled_polygon(Surface surface, points, color): * cdef Color c = Color(color) # <<<<<<<<<<<<<< * cdef Sint16 *vx * cdef Sint16 *vy */ __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 165; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __Pyx_INCREF(__pyx_v_color); __Pyx_GIVEREF(__pyx_v_color); PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_color); __pyx_t_2 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_11pygame_sdl2_5color_Color), __pyx_t_1, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 165; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_v_c = ((struct __pyx_obj_11pygame_sdl2_5color_Color *)__pyx_t_2); __pyx_t_2 = 0; /* "pygame_sdl2/gfxdraw.pyx":168 * cdef Sint16 *vx * cdef Sint16 *vy * cdef size_t num_points = len(points) # <<<<<<<<<<<<<< * vx = malloc(num_points * sizeof(Sint16)) * vy = malloc(num_points * sizeof(Sint16)) */ __pyx_t_3 = PyObject_Length(__pyx_v_points); if (unlikely(__pyx_t_3 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 168; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_v_num_points = __pyx_t_3; /* "pygame_sdl2/gfxdraw.pyx":169 * cdef Sint16 *vy * cdef size_t num_points = len(points) * vx = malloc(num_points * sizeof(Sint16)) # <<<<<<<<<<<<<< * vy = malloc(num_points * sizeof(Sint16)) * for n, pt in zip(range(num_points), points): */ __pyx_v_vx = ((Sint16 *)malloc((__pyx_v_num_points * (sizeof(Sint16))))); /* "pygame_sdl2/gfxdraw.pyx":170 * cdef size_t num_points = len(points) * vx = malloc(num_points * sizeof(Sint16)) * vy = malloc(num_points * sizeof(Sint16)) # <<<<<<<<<<<<<< * for n, pt in zip(range(num_points), points): * vx[n], vy[n] = points[n] */ __pyx_v_vy = ((Sint16 *)malloc((__pyx_v_num_points * (sizeof(Sint16))))); /* "pygame_sdl2/gfxdraw.pyx":171 * vx = malloc(num_points * sizeof(Sint16)) * vy = malloc(num_points * sizeof(Sint16)) * for n, pt in zip(range(num_points), points): # <<<<<<<<<<<<<< * vx[n], vy[n] = points[n] * filledPolygonRGBA(surface.surface, vx, vy, num_points, c.r, c.g, c.b, c.a) */ __pyx_t_2 = __Pyx_PyInt_FromSize_t(__pyx_v_num_points); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 171; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 171; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __Pyx_GIVEREF(__pyx_t_2); PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_2); __pyx_t_2 = 0; __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_range, __pyx_t_1, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 171; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 171; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __Pyx_GIVEREF(__pyx_t_2); PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_2); __Pyx_INCREF(__pyx_v_points); __Pyx_GIVEREF(__pyx_v_points); PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_v_points); __pyx_t_2 = 0; __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_zip, __pyx_t_1, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 171; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (likely(PyList_CheckExact(__pyx_t_2)) || PyTuple_CheckExact(__pyx_t_2)) { __pyx_t_1 = __pyx_t_2; __Pyx_INCREF(__pyx_t_1); __pyx_t_3 = 0; __pyx_t_4 = NULL; } else { __pyx_t_3 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_t_2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 171; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_t_4 = Py_TYPE(__pyx_t_1)->tp_iternext; if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 171; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; for (;;) { if (likely(!__pyx_t_4)) { if (likely(PyList_CheckExact(__pyx_t_1))) { if (__pyx_t_3 >= PyList_GET_SIZE(__pyx_t_1)) break; #if CYTHON_COMPILING_IN_CPYTHON __pyx_t_2 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_3); __Pyx_INCREF(__pyx_t_2); __pyx_t_3++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 171; __pyx_clineno = __LINE__; goto __pyx_L1_error;} #else __pyx_t_2 = PySequence_ITEM(__pyx_t_1, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 171; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); #endif } else { if (__pyx_t_3 >= PyTuple_GET_SIZE(__pyx_t_1)) break; #if CYTHON_COMPILING_IN_CPYTHON __pyx_t_2 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_3); __Pyx_INCREF(__pyx_t_2); __pyx_t_3++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 171; __pyx_clineno = __LINE__; goto __pyx_L1_error;} #else __pyx_t_2 = PySequence_ITEM(__pyx_t_1, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 171; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); #endif } } else { __pyx_t_2 = __pyx_t_4(__pyx_t_1); if (unlikely(!__pyx_t_2)) { PyObject* exc_type = PyErr_Occurred(); if (exc_type) { if (likely(exc_type == PyExc_StopIteration || PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); else {__pyx_filename = __pyx_f[0]; __pyx_lineno = 171; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } break; } __Pyx_GOTREF(__pyx_t_2); } if ((likely(PyTuple_CheckExact(__pyx_t_2))) || (PyList_CheckExact(__pyx_t_2))) { PyObject* sequence = __pyx_t_2; #if CYTHON_COMPILING_IN_CPYTHON Py_ssize_t size = Py_SIZE(sequence); #else Py_ssize_t size = PySequence_Size(sequence); #endif if (unlikely(size != 2)) { if (size > 2) __Pyx_RaiseTooManyValuesError(2); else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 171; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } #if CYTHON_COMPILING_IN_CPYTHON if (likely(PyTuple_CheckExact(sequence))) { __pyx_t_5 = PyTuple_GET_ITEM(sequence, 0); __pyx_t_6 = PyTuple_GET_ITEM(sequence, 1); } else { __pyx_t_5 = PyList_GET_ITEM(sequence, 0); __pyx_t_6 = PyList_GET_ITEM(sequence, 1); } __Pyx_INCREF(__pyx_t_5); __Pyx_INCREF(__pyx_t_6); #else __pyx_t_5 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 171; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); __pyx_t_6 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 171; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_6); #endif __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } else { Py_ssize_t index = -1; __pyx_t_7 = PyObject_GetIter(__pyx_t_2); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 171; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_8 = Py_TYPE(__pyx_t_7)->tp_iternext; index = 0; __pyx_t_5 = __pyx_t_8(__pyx_t_7); if (unlikely(!__pyx_t_5)) goto __pyx_L5_unpacking_failed; __Pyx_GOTREF(__pyx_t_5); index = 1; __pyx_t_6 = __pyx_t_8(__pyx_t_7); if (unlikely(!__pyx_t_6)) goto __pyx_L5_unpacking_failed; __Pyx_GOTREF(__pyx_t_6); if (__Pyx_IternextUnpackEndCheck(__pyx_t_8(__pyx_t_7), 2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 171; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_t_8 = NULL; __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; goto __pyx_L6_unpacking_done; __pyx_L5_unpacking_failed:; __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __pyx_t_8 = NULL; if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 171; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_L6_unpacking_done:; } __Pyx_XDECREF_SET(__pyx_v_n, __pyx_t_5); __pyx_t_5 = 0; __Pyx_XDECREF_SET(__pyx_v_pt, __pyx_t_6); __pyx_t_6 = 0; /* "pygame_sdl2/gfxdraw.pyx":172 * vy = malloc(num_points * sizeof(Sint16)) * for n, pt in zip(range(num_points), points): * vx[n], vy[n] = points[n] # <<<<<<<<<<<<<< * filledPolygonRGBA(surface.surface, vx, vy, num_points, c.r, c.g, c.b, c.a) * free(vx) */ __pyx_t_2 = PyObject_GetItem(__pyx_v_points, __pyx_v_n); if (unlikely(__pyx_t_2 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 172; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; __Pyx_GOTREF(__pyx_t_2); if ((likely(PyTuple_CheckExact(__pyx_t_2))) || (PyList_CheckExact(__pyx_t_2))) { PyObject* sequence = __pyx_t_2; #if CYTHON_COMPILING_IN_CPYTHON Py_ssize_t size = Py_SIZE(sequence); #else Py_ssize_t size = PySequence_Size(sequence); #endif if (unlikely(size != 2)) { if (size > 2) __Pyx_RaiseTooManyValuesError(2); else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 172; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } #if CYTHON_COMPILING_IN_CPYTHON if (likely(PyTuple_CheckExact(sequence))) { __pyx_t_6 = PyTuple_GET_ITEM(sequence, 0); __pyx_t_5 = PyTuple_GET_ITEM(sequence, 1); } else { __pyx_t_6 = PyList_GET_ITEM(sequence, 0); __pyx_t_5 = PyList_GET_ITEM(sequence, 1); } __Pyx_INCREF(__pyx_t_6); __Pyx_INCREF(__pyx_t_5); #else __pyx_t_6 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 172; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_6); __pyx_t_5 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 172; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); #endif __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } else { Py_ssize_t index = -1; __pyx_t_7 = PyObject_GetIter(__pyx_t_2); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 172; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_8 = Py_TYPE(__pyx_t_7)->tp_iternext; index = 0; __pyx_t_6 = __pyx_t_8(__pyx_t_7); if (unlikely(!__pyx_t_6)) goto __pyx_L7_unpacking_failed; __Pyx_GOTREF(__pyx_t_6); index = 1; __pyx_t_5 = __pyx_t_8(__pyx_t_7); if (unlikely(!__pyx_t_5)) goto __pyx_L7_unpacking_failed; __Pyx_GOTREF(__pyx_t_5); if (__Pyx_IternextUnpackEndCheck(__pyx_t_8(__pyx_t_7), 2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 172; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_t_8 = NULL; __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; goto __pyx_L8_unpacking_done; __pyx_L7_unpacking_failed:; __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __pyx_t_8 = NULL; if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 172; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_L8_unpacking_done:; } __pyx_t_9 = __Pyx_PyInt_As_int16_t(__pyx_t_6); if (unlikely((__pyx_t_9 == (Sint16)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 172; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __pyx_t_10 = __Pyx_PyInt_As_int16_t(__pyx_t_5); if (unlikely((__pyx_t_10 == (Sint16)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 172; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __pyx_t_11 = __Pyx_PyIndex_AsSsize_t(__pyx_v_n); if (unlikely((__pyx_t_11 == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 172; __pyx_clineno = __LINE__; goto __pyx_L1_error;} (__pyx_v_vx[__pyx_t_11]) = __pyx_t_9; __pyx_t_11 = __Pyx_PyIndex_AsSsize_t(__pyx_v_n); if (unlikely((__pyx_t_11 == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 172; __pyx_clineno = __LINE__; goto __pyx_L1_error;} (__pyx_v_vy[__pyx_t_11]) = __pyx_t_10; /* "pygame_sdl2/gfxdraw.pyx":171 * vx = malloc(num_points * sizeof(Sint16)) * vy = malloc(num_points * sizeof(Sint16)) * for n, pt in zip(range(num_points), points): # <<<<<<<<<<<<<< * vx[n], vy[n] = points[n] * filledPolygonRGBA(surface.surface, vx, vy, num_points, c.r, c.g, c.b, c.a) */ } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "pygame_sdl2/gfxdraw.pyx":173 * for n, pt in zip(range(num_points), points): * vx[n], vy[n] = points[n] * filledPolygonRGBA(surface.surface, vx, vy, num_points, c.r, c.g, c.b, c.a) # <<<<<<<<<<<<<< * free(vx) * free(vy) */ filledPolygonRGBA(__pyx_v_surface->surface, __pyx_v_vx, __pyx_v_vy, __pyx_v_num_points, __pyx_v_c->r, __pyx_v_c->g, __pyx_v_c->b, __pyx_v_c->a); /* "pygame_sdl2/gfxdraw.pyx":174 * vx[n], vy[n] = points[n] * filledPolygonRGBA(surface.surface, vx, vy, num_points, c.r, c.g, c.b, c.a) * free(vx) # <<<<<<<<<<<<<< * free(vy) * */ free(__pyx_v_vx); /* "pygame_sdl2/gfxdraw.pyx":175 * filledPolygonRGBA(surface.surface, vx, vy, num_points, c.r, c.g, c.b, c.a) * free(vx) * free(vy) # <<<<<<<<<<<<<< * * def textured_polygon(Surface surface, points, Surface texture not None, tx, ty): */ free(__pyx_v_vy); /* "pygame_sdl2/gfxdraw.pyx":164 * free(vy) * * def filled_polygon(Surface surface, points, color): # <<<<<<<<<<<<<< * cdef Color c = Color(color) * cdef Sint16 *vx */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_5); __Pyx_XDECREF(__pyx_t_6); __Pyx_XDECREF(__pyx_t_7); __Pyx_AddTraceback("pygame_sdl2.gfxdraw.filled_polygon", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF((PyObject *)__pyx_v_c); __Pyx_XDECREF(__pyx_v_n); __Pyx_XDECREF(__pyx_v_pt); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/gfxdraw.pyx":177 * free(vy) * * def textured_polygon(Surface surface, points, Surface texture not None, tx, ty): # <<<<<<<<<<<<<< * cdef Sint16 *vx * cdef Sint16 *vy */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_7gfxdraw_51textured_polygon(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static PyMethodDef __pyx_mdef_11pygame_sdl2_7gfxdraw_51textured_polygon = {"textured_polygon", (PyCFunction)__pyx_pw_11pygame_sdl2_7gfxdraw_51textured_polygon, METH_VARARGS|METH_KEYWORDS, 0}; static PyObject *__pyx_pw_11pygame_sdl2_7gfxdraw_51textured_polygon(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { struct __pyx_obj_11pygame_sdl2_7surface_Surface *__pyx_v_surface = 0; PyObject *__pyx_v_points = 0; struct __pyx_obj_11pygame_sdl2_7surface_Surface *__pyx_v_texture = 0; PyObject *__pyx_v_tx = 0; PyObject *__pyx_v_ty = 0; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("textured_polygon (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_surface,&__pyx_n_s_points,&__pyx_n_s_texture,&__pyx_n_s_tx,&__pyx_n_s_ty,0}; PyObject* values[5] = {0,0,0,0,0}; if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4); case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_surface)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; case 1: if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_points)) != 0)) kw_args--; else { __Pyx_RaiseArgtupleInvalid("textured_polygon", 1, 5, 5, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 177; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } case 2: if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_texture)) != 0)) kw_args--; else { __Pyx_RaiseArgtupleInvalid("textured_polygon", 1, 5, 5, 2); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 177; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } case 3: if (likely((values[3] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_tx)) != 0)) kw_args--; else { __Pyx_RaiseArgtupleInvalid("textured_polygon", 1, 5, 5, 3); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 177; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } case 4: if (likely((values[4] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_ty)) != 0)) kw_args--; else { __Pyx_RaiseArgtupleInvalid("textured_polygon", 1, 5, 5, 4); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 177; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "textured_polygon") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 177; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } } else if (PyTuple_GET_SIZE(__pyx_args) != 5) { goto __pyx_L5_argtuple_error; } else { values[0] = PyTuple_GET_ITEM(__pyx_args, 0); values[1] = PyTuple_GET_ITEM(__pyx_args, 1); values[2] = PyTuple_GET_ITEM(__pyx_args, 2); values[3] = PyTuple_GET_ITEM(__pyx_args, 3); values[4] = PyTuple_GET_ITEM(__pyx_args, 4); } __pyx_v_surface = ((struct __pyx_obj_11pygame_sdl2_7surface_Surface *)values[0]); __pyx_v_points = values[1]; __pyx_v_texture = ((struct __pyx_obj_11pygame_sdl2_7surface_Surface *)values[2]); __pyx_v_tx = values[3]; __pyx_v_ty = values[4]; } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("textured_polygon", 1, 5, 5, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 177; __pyx_clineno = __LINE__; goto __pyx_L3_error;} __pyx_L3_error:; __Pyx_AddTraceback("pygame_sdl2.gfxdraw.textured_polygon", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_surface), __pyx_ptype_11pygame_sdl2_7surface_Surface, 1, "surface", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 177; __pyx_clineno = __LINE__; goto __pyx_L1_error;} if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_texture), __pyx_ptype_11pygame_sdl2_7surface_Surface, 0, "texture", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 177; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_r = __pyx_pf_11pygame_sdl2_7gfxdraw_50textured_polygon(__pyx_self, __pyx_v_surface, __pyx_v_points, __pyx_v_texture, __pyx_v_tx, __pyx_v_ty); /* function exit code */ goto __pyx_L0; __pyx_L1_error:; __pyx_r = NULL; __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_7gfxdraw_50textured_polygon(CYTHON_UNUSED PyObject *__pyx_self, struct __pyx_obj_11pygame_sdl2_7surface_Surface *__pyx_v_surface, PyObject *__pyx_v_points, struct __pyx_obj_11pygame_sdl2_7surface_Surface *__pyx_v_texture, PyObject *__pyx_v_tx, PyObject *__pyx_v_ty) { Sint16 *__pyx_v_vx; Sint16 *__pyx_v_vy; size_t __pyx_v_num_points; PyObject *__pyx_v_n = NULL; CYTHON_UNUSED PyObject *__pyx_v_pt = NULL; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations Py_ssize_t __pyx_t_1; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; PyObject *(*__pyx_t_4)(PyObject *); PyObject *__pyx_t_5 = NULL; PyObject *__pyx_t_6 = NULL; PyObject *__pyx_t_7 = NULL; PyObject *(*__pyx_t_8)(PyObject *); Sint16 __pyx_t_9; Sint16 __pyx_t_10; Py_ssize_t __pyx_t_11; int __pyx_t_12; int __pyx_t_13; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("textured_polygon", 0); /* "pygame_sdl2/gfxdraw.pyx":180 * cdef Sint16 *vx * cdef Sint16 *vy * cdef size_t num_points = len(points) # <<<<<<<<<<<<<< * vx = malloc(num_points * sizeof(Sint16)) * vy = malloc(num_points * sizeof(Sint16)) */ __pyx_t_1 = PyObject_Length(__pyx_v_points); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 180; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_v_num_points = __pyx_t_1; /* "pygame_sdl2/gfxdraw.pyx":181 * cdef Sint16 *vy * cdef size_t num_points = len(points) * vx = malloc(num_points * sizeof(Sint16)) # <<<<<<<<<<<<<< * vy = malloc(num_points * sizeof(Sint16)) * for n, pt in zip(range(num_points), points): */ __pyx_v_vx = ((Sint16 *)malloc((__pyx_v_num_points * (sizeof(Sint16))))); /* "pygame_sdl2/gfxdraw.pyx":182 * cdef size_t num_points = len(points) * vx = malloc(num_points * sizeof(Sint16)) * vy = malloc(num_points * sizeof(Sint16)) # <<<<<<<<<<<<<< * for n, pt in zip(range(num_points), points): * vx[n], vy[n] = points[n] */ __pyx_v_vy = ((Sint16 *)malloc((__pyx_v_num_points * (sizeof(Sint16))))); /* "pygame_sdl2/gfxdraw.pyx":183 * vx = malloc(num_points * sizeof(Sint16)) * vy = malloc(num_points * sizeof(Sint16)) * for n, pt in zip(range(num_points), points): # <<<<<<<<<<<<<< * vx[n], vy[n] = points[n] * texturedPolygon(surface.surface, vx, vy, num_points, texture.surface, tx, ty) */ __pyx_t_2 = __Pyx_PyInt_FromSize_t(__pyx_v_num_points); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 183; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 183; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __Pyx_GIVEREF(__pyx_t_2); PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_2); __pyx_t_2 = 0; __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_range, __pyx_t_3, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 183; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 183; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __Pyx_GIVEREF(__pyx_t_2); PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_2); __Pyx_INCREF(__pyx_v_points); __Pyx_GIVEREF(__pyx_v_points); PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_v_points); __pyx_t_2 = 0; __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_zip, __pyx_t_3, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 183; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; if (likely(PyList_CheckExact(__pyx_t_2)) || PyTuple_CheckExact(__pyx_t_2)) { __pyx_t_3 = __pyx_t_2; __Pyx_INCREF(__pyx_t_3); __pyx_t_1 = 0; __pyx_t_4 = NULL; } else { __pyx_t_1 = -1; __pyx_t_3 = PyObject_GetIter(__pyx_t_2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 183; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = Py_TYPE(__pyx_t_3)->tp_iternext; if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 183; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; for (;;) { if (likely(!__pyx_t_4)) { if (likely(PyList_CheckExact(__pyx_t_3))) { if (__pyx_t_1 >= PyList_GET_SIZE(__pyx_t_3)) break; #if CYTHON_COMPILING_IN_CPYTHON __pyx_t_2 = PyList_GET_ITEM(__pyx_t_3, __pyx_t_1); __Pyx_INCREF(__pyx_t_2); __pyx_t_1++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 183; __pyx_clineno = __LINE__; goto __pyx_L1_error;} #else __pyx_t_2 = PySequence_ITEM(__pyx_t_3, __pyx_t_1); __pyx_t_1++; if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 183; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); #endif } else { if (__pyx_t_1 >= PyTuple_GET_SIZE(__pyx_t_3)) break; #if CYTHON_COMPILING_IN_CPYTHON __pyx_t_2 = PyTuple_GET_ITEM(__pyx_t_3, __pyx_t_1); __Pyx_INCREF(__pyx_t_2); __pyx_t_1++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 183; __pyx_clineno = __LINE__; goto __pyx_L1_error;} #else __pyx_t_2 = PySequence_ITEM(__pyx_t_3, __pyx_t_1); __pyx_t_1++; if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 183; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); #endif } } else { __pyx_t_2 = __pyx_t_4(__pyx_t_3); if (unlikely(!__pyx_t_2)) { PyObject* exc_type = PyErr_Occurred(); if (exc_type) { if (likely(exc_type == PyExc_StopIteration || PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); else {__pyx_filename = __pyx_f[0]; __pyx_lineno = 183; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } break; } __Pyx_GOTREF(__pyx_t_2); } if ((likely(PyTuple_CheckExact(__pyx_t_2))) || (PyList_CheckExact(__pyx_t_2))) { PyObject* sequence = __pyx_t_2; #if CYTHON_COMPILING_IN_CPYTHON Py_ssize_t size = Py_SIZE(sequence); #else Py_ssize_t size = PySequence_Size(sequence); #endif if (unlikely(size != 2)) { if (size > 2) __Pyx_RaiseTooManyValuesError(2); else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 183; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } #if CYTHON_COMPILING_IN_CPYTHON if (likely(PyTuple_CheckExact(sequence))) { __pyx_t_5 = PyTuple_GET_ITEM(sequence, 0); __pyx_t_6 = PyTuple_GET_ITEM(sequence, 1); } else { __pyx_t_5 = PyList_GET_ITEM(sequence, 0); __pyx_t_6 = PyList_GET_ITEM(sequence, 1); } __Pyx_INCREF(__pyx_t_5); __Pyx_INCREF(__pyx_t_6); #else __pyx_t_5 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 183; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); __pyx_t_6 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 183; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_6); #endif __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } else { Py_ssize_t index = -1; __pyx_t_7 = PyObject_GetIter(__pyx_t_2); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 183; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_8 = Py_TYPE(__pyx_t_7)->tp_iternext; index = 0; __pyx_t_5 = __pyx_t_8(__pyx_t_7); if (unlikely(!__pyx_t_5)) goto __pyx_L5_unpacking_failed; __Pyx_GOTREF(__pyx_t_5); index = 1; __pyx_t_6 = __pyx_t_8(__pyx_t_7); if (unlikely(!__pyx_t_6)) goto __pyx_L5_unpacking_failed; __Pyx_GOTREF(__pyx_t_6); if (__Pyx_IternextUnpackEndCheck(__pyx_t_8(__pyx_t_7), 2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 183; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_t_8 = NULL; __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; goto __pyx_L6_unpacking_done; __pyx_L5_unpacking_failed:; __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __pyx_t_8 = NULL; if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 183; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_L6_unpacking_done:; } __Pyx_XDECREF_SET(__pyx_v_n, __pyx_t_5); __pyx_t_5 = 0; __Pyx_XDECREF_SET(__pyx_v_pt, __pyx_t_6); __pyx_t_6 = 0; /* "pygame_sdl2/gfxdraw.pyx":184 * vy = malloc(num_points * sizeof(Sint16)) * for n, pt in zip(range(num_points), points): * vx[n], vy[n] = points[n] # <<<<<<<<<<<<<< * texturedPolygon(surface.surface, vx, vy, num_points, texture.surface, tx, ty) * free(vx) */ __pyx_t_2 = PyObject_GetItem(__pyx_v_points, __pyx_v_n); if (unlikely(__pyx_t_2 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 184; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; __Pyx_GOTREF(__pyx_t_2); if ((likely(PyTuple_CheckExact(__pyx_t_2))) || (PyList_CheckExact(__pyx_t_2))) { PyObject* sequence = __pyx_t_2; #if CYTHON_COMPILING_IN_CPYTHON Py_ssize_t size = Py_SIZE(sequence); #else Py_ssize_t size = PySequence_Size(sequence); #endif if (unlikely(size != 2)) { if (size > 2) __Pyx_RaiseTooManyValuesError(2); else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 184; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } #if CYTHON_COMPILING_IN_CPYTHON if (likely(PyTuple_CheckExact(sequence))) { __pyx_t_6 = PyTuple_GET_ITEM(sequence, 0); __pyx_t_5 = PyTuple_GET_ITEM(sequence, 1); } else { __pyx_t_6 = PyList_GET_ITEM(sequence, 0); __pyx_t_5 = PyList_GET_ITEM(sequence, 1); } __Pyx_INCREF(__pyx_t_6); __Pyx_INCREF(__pyx_t_5); #else __pyx_t_6 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 184; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_6); __pyx_t_5 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 184; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); #endif __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } else { Py_ssize_t index = -1; __pyx_t_7 = PyObject_GetIter(__pyx_t_2); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 184; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_8 = Py_TYPE(__pyx_t_7)->tp_iternext; index = 0; __pyx_t_6 = __pyx_t_8(__pyx_t_7); if (unlikely(!__pyx_t_6)) goto __pyx_L7_unpacking_failed; __Pyx_GOTREF(__pyx_t_6); index = 1; __pyx_t_5 = __pyx_t_8(__pyx_t_7); if (unlikely(!__pyx_t_5)) goto __pyx_L7_unpacking_failed; __Pyx_GOTREF(__pyx_t_5); if (__Pyx_IternextUnpackEndCheck(__pyx_t_8(__pyx_t_7), 2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 184; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_t_8 = NULL; __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; goto __pyx_L8_unpacking_done; __pyx_L7_unpacking_failed:; __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __pyx_t_8 = NULL; if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 184; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_L8_unpacking_done:; } __pyx_t_9 = __Pyx_PyInt_As_int16_t(__pyx_t_6); if (unlikely((__pyx_t_9 == (Sint16)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 184; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __pyx_t_10 = __Pyx_PyInt_As_int16_t(__pyx_t_5); if (unlikely((__pyx_t_10 == (Sint16)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 184; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __pyx_t_11 = __Pyx_PyIndex_AsSsize_t(__pyx_v_n); if (unlikely((__pyx_t_11 == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 184; __pyx_clineno = __LINE__; goto __pyx_L1_error;} (__pyx_v_vx[__pyx_t_11]) = __pyx_t_9; __pyx_t_11 = __Pyx_PyIndex_AsSsize_t(__pyx_v_n); if (unlikely((__pyx_t_11 == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 184; __pyx_clineno = __LINE__; goto __pyx_L1_error;} (__pyx_v_vy[__pyx_t_11]) = __pyx_t_10; /* "pygame_sdl2/gfxdraw.pyx":183 * vx = malloc(num_points * sizeof(Sint16)) * vy = malloc(num_points * sizeof(Sint16)) * for n, pt in zip(range(num_points), points): # <<<<<<<<<<<<<< * vx[n], vy[n] = points[n] * texturedPolygon(surface.surface, vx, vy, num_points, texture.surface, tx, ty) */ } __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "pygame_sdl2/gfxdraw.pyx":185 * for n, pt in zip(range(num_points), points): * vx[n], vy[n] = points[n] * texturedPolygon(surface.surface, vx, vy, num_points, texture.surface, tx, ty) # <<<<<<<<<<<<<< * free(vx) * free(vy) */ __pyx_t_12 = __Pyx_PyInt_As_int(__pyx_v_tx); if (unlikely((__pyx_t_12 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 185; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_t_13 = __Pyx_PyInt_As_int(__pyx_v_ty); if (unlikely((__pyx_t_13 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 185; __pyx_clineno = __LINE__; goto __pyx_L1_error;} texturedPolygon(__pyx_v_surface->surface, __pyx_v_vx, __pyx_v_vy, __pyx_v_num_points, __pyx_v_texture->surface, __pyx_t_12, __pyx_t_13); /* "pygame_sdl2/gfxdraw.pyx":186 * vx[n], vy[n] = points[n] * texturedPolygon(surface.surface, vx, vy, num_points, texture.surface, tx, ty) * free(vx) # <<<<<<<<<<<<<< * free(vy) * */ free(__pyx_v_vx); /* "pygame_sdl2/gfxdraw.pyx":187 * texturedPolygon(surface.surface, vx, vy, num_points, texture.surface, tx, ty) * free(vx) * free(vy) # <<<<<<<<<<<<<< * * def bezier(Surface surface, points, steps, color): */ free(__pyx_v_vy); /* "pygame_sdl2/gfxdraw.pyx":177 * free(vy) * * def textured_polygon(Surface surface, points, Surface texture not None, tx, ty): # <<<<<<<<<<<<<< * cdef Sint16 *vx * cdef Sint16 *vy */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_5); __Pyx_XDECREF(__pyx_t_6); __Pyx_XDECREF(__pyx_t_7); __Pyx_AddTraceback("pygame_sdl2.gfxdraw.textured_polygon", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF(__pyx_v_n); __Pyx_XDECREF(__pyx_v_pt); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/gfxdraw.pyx":189 * free(vy) * * def bezier(Surface surface, points, steps, color): # <<<<<<<<<<<<<< * cdef Color c = Color(color) * cdef Sint16 *vx */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_7gfxdraw_53bezier(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static PyMethodDef __pyx_mdef_11pygame_sdl2_7gfxdraw_53bezier = {"bezier", (PyCFunction)__pyx_pw_11pygame_sdl2_7gfxdraw_53bezier, METH_VARARGS|METH_KEYWORDS, 0}; static PyObject *__pyx_pw_11pygame_sdl2_7gfxdraw_53bezier(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { struct __pyx_obj_11pygame_sdl2_7surface_Surface *__pyx_v_surface = 0; PyObject *__pyx_v_points = 0; PyObject *__pyx_v_steps = 0; PyObject *__pyx_v_color = 0; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("bezier (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_surface,&__pyx_n_s_points,&__pyx_n_s_steps,&__pyx_n_s_color,0}; PyObject* values[4] = {0,0,0,0}; if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_surface)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; case 1: if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_points)) != 0)) kw_args--; else { __Pyx_RaiseArgtupleInvalid("bezier", 1, 4, 4, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 189; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } case 2: if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_steps)) != 0)) kw_args--; else { __Pyx_RaiseArgtupleInvalid("bezier", 1, 4, 4, 2); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 189; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } case 3: if (likely((values[3] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_color)) != 0)) kw_args--; else { __Pyx_RaiseArgtupleInvalid("bezier", 1, 4, 4, 3); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 189; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "bezier") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 189; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } } else if (PyTuple_GET_SIZE(__pyx_args) != 4) { goto __pyx_L5_argtuple_error; } else { values[0] = PyTuple_GET_ITEM(__pyx_args, 0); values[1] = PyTuple_GET_ITEM(__pyx_args, 1); values[2] = PyTuple_GET_ITEM(__pyx_args, 2); values[3] = PyTuple_GET_ITEM(__pyx_args, 3); } __pyx_v_surface = ((struct __pyx_obj_11pygame_sdl2_7surface_Surface *)values[0]); __pyx_v_points = values[1]; __pyx_v_steps = values[2]; __pyx_v_color = values[3]; } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("bezier", 1, 4, 4, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 189; __pyx_clineno = __LINE__; goto __pyx_L3_error;} __pyx_L3_error:; __Pyx_AddTraceback("pygame_sdl2.gfxdraw.bezier", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_surface), __pyx_ptype_11pygame_sdl2_7surface_Surface, 1, "surface", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 189; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_r = __pyx_pf_11pygame_sdl2_7gfxdraw_52bezier(__pyx_self, __pyx_v_surface, __pyx_v_points, __pyx_v_steps, __pyx_v_color); /* function exit code */ goto __pyx_L0; __pyx_L1_error:; __pyx_r = NULL; __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_7gfxdraw_52bezier(CYTHON_UNUSED PyObject *__pyx_self, struct __pyx_obj_11pygame_sdl2_7surface_Surface *__pyx_v_surface, PyObject *__pyx_v_points, PyObject *__pyx_v_steps, PyObject *__pyx_v_color) { struct __pyx_obj_11pygame_sdl2_5color_Color *__pyx_v_c = 0; Sint16 *__pyx_v_vx; Sint16 *__pyx_v_vy; size_t __pyx_v_num_points; PyObject *__pyx_v_n = NULL; CYTHON_UNUSED PyObject *__pyx_v_pt = NULL; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; Py_ssize_t __pyx_t_3; PyObject *(*__pyx_t_4)(PyObject *); PyObject *__pyx_t_5 = NULL; PyObject *__pyx_t_6 = NULL; PyObject *__pyx_t_7 = NULL; PyObject *(*__pyx_t_8)(PyObject *); Sint16 __pyx_t_9; Sint16 __pyx_t_10; Py_ssize_t __pyx_t_11; int __pyx_t_12; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("bezier", 0); /* "pygame_sdl2/gfxdraw.pyx":190 * * def bezier(Surface surface, points, steps, color): * cdef Color c = Color(color) # <<<<<<<<<<<<<< * cdef Sint16 *vx * cdef Sint16 *vy */ __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 190; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __Pyx_INCREF(__pyx_v_color); __Pyx_GIVEREF(__pyx_v_color); PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_color); __pyx_t_2 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_11pygame_sdl2_5color_Color), __pyx_t_1, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 190; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_v_c = ((struct __pyx_obj_11pygame_sdl2_5color_Color *)__pyx_t_2); __pyx_t_2 = 0; /* "pygame_sdl2/gfxdraw.pyx":193 * cdef Sint16 *vx * cdef Sint16 *vy * cdef size_t num_points = len(points) # <<<<<<<<<<<<<< * vx = malloc(num_points * sizeof(Sint16)) * vy = malloc(num_points * sizeof(Sint16)) */ __pyx_t_3 = PyObject_Length(__pyx_v_points); if (unlikely(__pyx_t_3 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 193; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_v_num_points = __pyx_t_3; /* "pygame_sdl2/gfxdraw.pyx":194 * cdef Sint16 *vy * cdef size_t num_points = len(points) * vx = malloc(num_points * sizeof(Sint16)) # <<<<<<<<<<<<<< * vy = malloc(num_points * sizeof(Sint16)) * for n, pt in zip(range(num_points), points): */ __pyx_v_vx = ((Sint16 *)malloc((__pyx_v_num_points * (sizeof(Sint16))))); /* "pygame_sdl2/gfxdraw.pyx":195 * cdef size_t num_points = len(points) * vx = malloc(num_points * sizeof(Sint16)) * vy = malloc(num_points * sizeof(Sint16)) # <<<<<<<<<<<<<< * for n, pt in zip(range(num_points), points): * vx[n], vy[n] = points[n] */ __pyx_v_vy = ((Sint16 *)malloc((__pyx_v_num_points * (sizeof(Sint16))))); /* "pygame_sdl2/gfxdraw.pyx":196 * vx = malloc(num_points * sizeof(Sint16)) * vy = malloc(num_points * sizeof(Sint16)) * for n, pt in zip(range(num_points), points): # <<<<<<<<<<<<<< * vx[n], vy[n] = points[n] * bezierRGBA(surface.surface, vx, vy, num_points, steps, c.r, c.g, c.b, c.a) */ __pyx_t_2 = __Pyx_PyInt_FromSize_t(__pyx_v_num_points); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 196; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 196; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __Pyx_GIVEREF(__pyx_t_2); PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_2); __pyx_t_2 = 0; __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_range, __pyx_t_1, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 196; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 196; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __Pyx_GIVEREF(__pyx_t_2); PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_2); __Pyx_INCREF(__pyx_v_points); __Pyx_GIVEREF(__pyx_v_points); PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_v_points); __pyx_t_2 = 0; __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_zip, __pyx_t_1, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 196; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (likely(PyList_CheckExact(__pyx_t_2)) || PyTuple_CheckExact(__pyx_t_2)) { __pyx_t_1 = __pyx_t_2; __Pyx_INCREF(__pyx_t_1); __pyx_t_3 = 0; __pyx_t_4 = NULL; } else { __pyx_t_3 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_t_2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 196; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_t_4 = Py_TYPE(__pyx_t_1)->tp_iternext; if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 196; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; for (;;) { if (likely(!__pyx_t_4)) { if (likely(PyList_CheckExact(__pyx_t_1))) { if (__pyx_t_3 >= PyList_GET_SIZE(__pyx_t_1)) break; #if CYTHON_COMPILING_IN_CPYTHON __pyx_t_2 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_3); __Pyx_INCREF(__pyx_t_2); __pyx_t_3++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 196; __pyx_clineno = __LINE__; goto __pyx_L1_error;} #else __pyx_t_2 = PySequence_ITEM(__pyx_t_1, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 196; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); #endif } else { if (__pyx_t_3 >= PyTuple_GET_SIZE(__pyx_t_1)) break; #if CYTHON_COMPILING_IN_CPYTHON __pyx_t_2 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_3); __Pyx_INCREF(__pyx_t_2); __pyx_t_3++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 196; __pyx_clineno = __LINE__; goto __pyx_L1_error;} #else __pyx_t_2 = PySequence_ITEM(__pyx_t_1, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 196; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); #endif } } else { __pyx_t_2 = __pyx_t_4(__pyx_t_1); if (unlikely(!__pyx_t_2)) { PyObject* exc_type = PyErr_Occurred(); if (exc_type) { if (likely(exc_type == PyExc_StopIteration || PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); else {__pyx_filename = __pyx_f[0]; __pyx_lineno = 196; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } break; } __Pyx_GOTREF(__pyx_t_2); } if ((likely(PyTuple_CheckExact(__pyx_t_2))) || (PyList_CheckExact(__pyx_t_2))) { PyObject* sequence = __pyx_t_2; #if CYTHON_COMPILING_IN_CPYTHON Py_ssize_t size = Py_SIZE(sequence); #else Py_ssize_t size = PySequence_Size(sequence); #endif if (unlikely(size != 2)) { if (size > 2) __Pyx_RaiseTooManyValuesError(2); else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 196; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } #if CYTHON_COMPILING_IN_CPYTHON if (likely(PyTuple_CheckExact(sequence))) { __pyx_t_5 = PyTuple_GET_ITEM(sequence, 0); __pyx_t_6 = PyTuple_GET_ITEM(sequence, 1); } else { __pyx_t_5 = PyList_GET_ITEM(sequence, 0); __pyx_t_6 = PyList_GET_ITEM(sequence, 1); } __Pyx_INCREF(__pyx_t_5); __Pyx_INCREF(__pyx_t_6); #else __pyx_t_5 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 196; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); __pyx_t_6 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 196; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_6); #endif __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } else { Py_ssize_t index = -1; __pyx_t_7 = PyObject_GetIter(__pyx_t_2); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 196; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_8 = Py_TYPE(__pyx_t_7)->tp_iternext; index = 0; __pyx_t_5 = __pyx_t_8(__pyx_t_7); if (unlikely(!__pyx_t_5)) goto __pyx_L5_unpacking_failed; __Pyx_GOTREF(__pyx_t_5); index = 1; __pyx_t_6 = __pyx_t_8(__pyx_t_7); if (unlikely(!__pyx_t_6)) goto __pyx_L5_unpacking_failed; __Pyx_GOTREF(__pyx_t_6); if (__Pyx_IternextUnpackEndCheck(__pyx_t_8(__pyx_t_7), 2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 196; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_t_8 = NULL; __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; goto __pyx_L6_unpacking_done; __pyx_L5_unpacking_failed:; __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __pyx_t_8 = NULL; if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 196; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_L6_unpacking_done:; } __Pyx_XDECREF_SET(__pyx_v_n, __pyx_t_5); __pyx_t_5 = 0; __Pyx_XDECREF_SET(__pyx_v_pt, __pyx_t_6); __pyx_t_6 = 0; /* "pygame_sdl2/gfxdraw.pyx":197 * vy = malloc(num_points * sizeof(Sint16)) * for n, pt in zip(range(num_points), points): * vx[n], vy[n] = points[n] # <<<<<<<<<<<<<< * bezierRGBA(surface.surface, vx, vy, num_points, steps, c.r, c.g, c.b, c.a) * free(vx) */ __pyx_t_2 = PyObject_GetItem(__pyx_v_points, __pyx_v_n); if (unlikely(__pyx_t_2 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 197; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; __Pyx_GOTREF(__pyx_t_2); if ((likely(PyTuple_CheckExact(__pyx_t_2))) || (PyList_CheckExact(__pyx_t_2))) { PyObject* sequence = __pyx_t_2; #if CYTHON_COMPILING_IN_CPYTHON Py_ssize_t size = Py_SIZE(sequence); #else Py_ssize_t size = PySequence_Size(sequence); #endif if (unlikely(size != 2)) { if (size > 2) __Pyx_RaiseTooManyValuesError(2); else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 197; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } #if CYTHON_COMPILING_IN_CPYTHON if (likely(PyTuple_CheckExact(sequence))) { __pyx_t_6 = PyTuple_GET_ITEM(sequence, 0); __pyx_t_5 = PyTuple_GET_ITEM(sequence, 1); } else { __pyx_t_6 = PyList_GET_ITEM(sequence, 0); __pyx_t_5 = PyList_GET_ITEM(sequence, 1); } __Pyx_INCREF(__pyx_t_6); __Pyx_INCREF(__pyx_t_5); #else __pyx_t_6 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 197; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_6); __pyx_t_5 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 197; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); #endif __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } else { Py_ssize_t index = -1; __pyx_t_7 = PyObject_GetIter(__pyx_t_2); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 197; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_8 = Py_TYPE(__pyx_t_7)->tp_iternext; index = 0; __pyx_t_6 = __pyx_t_8(__pyx_t_7); if (unlikely(!__pyx_t_6)) goto __pyx_L7_unpacking_failed; __Pyx_GOTREF(__pyx_t_6); index = 1; __pyx_t_5 = __pyx_t_8(__pyx_t_7); if (unlikely(!__pyx_t_5)) goto __pyx_L7_unpacking_failed; __Pyx_GOTREF(__pyx_t_5); if (__Pyx_IternextUnpackEndCheck(__pyx_t_8(__pyx_t_7), 2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 197; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_t_8 = NULL; __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; goto __pyx_L8_unpacking_done; __pyx_L7_unpacking_failed:; __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __pyx_t_8 = NULL; if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 197; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_L8_unpacking_done:; } __pyx_t_9 = __Pyx_PyInt_As_int16_t(__pyx_t_6); if (unlikely((__pyx_t_9 == (Sint16)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 197; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __pyx_t_10 = __Pyx_PyInt_As_int16_t(__pyx_t_5); if (unlikely((__pyx_t_10 == (Sint16)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 197; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __pyx_t_11 = __Pyx_PyIndex_AsSsize_t(__pyx_v_n); if (unlikely((__pyx_t_11 == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 197; __pyx_clineno = __LINE__; goto __pyx_L1_error;} (__pyx_v_vx[__pyx_t_11]) = __pyx_t_9; __pyx_t_11 = __Pyx_PyIndex_AsSsize_t(__pyx_v_n); if (unlikely((__pyx_t_11 == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 197; __pyx_clineno = __LINE__; goto __pyx_L1_error;} (__pyx_v_vy[__pyx_t_11]) = __pyx_t_10; /* "pygame_sdl2/gfxdraw.pyx":196 * vx = malloc(num_points * sizeof(Sint16)) * vy = malloc(num_points * sizeof(Sint16)) * for n, pt in zip(range(num_points), points): # <<<<<<<<<<<<<< * vx[n], vy[n] = points[n] * bezierRGBA(surface.surface, vx, vy, num_points, steps, c.r, c.g, c.b, c.a) */ } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "pygame_sdl2/gfxdraw.pyx":198 * for n, pt in zip(range(num_points), points): * vx[n], vy[n] = points[n] * bezierRGBA(surface.surface, vx, vy, num_points, steps, c.r, c.g, c.b, c.a) # <<<<<<<<<<<<<< * free(vx) * free(vy) */ __pyx_t_12 = __Pyx_PyInt_As_int(__pyx_v_steps); if (unlikely((__pyx_t_12 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 198; __pyx_clineno = __LINE__; goto __pyx_L1_error;} bezierRGBA(__pyx_v_surface->surface, __pyx_v_vx, __pyx_v_vy, __pyx_v_num_points, __pyx_t_12, __pyx_v_c->r, __pyx_v_c->g, __pyx_v_c->b, __pyx_v_c->a); /* "pygame_sdl2/gfxdraw.pyx":199 * vx[n], vy[n] = points[n] * bezierRGBA(surface.surface, vx, vy, num_points, steps, c.r, c.g, c.b, c.a) * free(vx) # <<<<<<<<<<<<<< * free(vy) */ free(__pyx_v_vx); /* "pygame_sdl2/gfxdraw.pyx":200 * bezierRGBA(surface.surface, vx, vy, num_points, steps, c.r, c.g, c.b, c.a) * free(vx) * free(vy) # <<<<<<<<<<<<<< */ free(__pyx_v_vy); /* "pygame_sdl2/gfxdraw.pyx":189 * free(vy) * * def bezier(Surface surface, points, steps, color): # <<<<<<<<<<<<<< * cdef Color c = Color(color) * cdef Sint16 *vx */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_5); __Pyx_XDECREF(__pyx_t_6); __Pyx_XDECREF(__pyx_t_7); __Pyx_AddTraceback("pygame_sdl2.gfxdraw.bezier", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF((PyObject *)__pyx_v_c); __Pyx_XDECREF(__pyx_v_n); __Pyx_XDECREF(__pyx_v_pt); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyMethodDef __pyx_methods[] = { {0, 0, 0, 0} }; #if PY_MAJOR_VERSION >= 3 static struct PyModuleDef __pyx_moduledef = { #if PY_VERSION_HEX < 0x03020000 { PyObject_HEAD_INIT(NULL) NULL, 0, NULL }, #else PyModuleDef_HEAD_INIT, #endif "gfxdraw", 0, /* m_doc */ -1, /* m_size */ __pyx_methods /* m_methods */, NULL, /* m_reload */ NULL, /* m_traverse */ NULL, /* m_clear */ NULL /* m_free */ }; #endif static __Pyx_StringTabEntry __pyx_string_tab[] = { {&__pyx_n_s_Rect, __pyx_k_Rect, sizeof(__pyx_k_Rect), 0, 0, 1, 1}, {&__pyx_n_s_aacircle, __pyx_k_aacircle, sizeof(__pyx_k_aacircle), 0, 0, 1, 1}, {&__pyx_n_s_aaellipse, __pyx_k_aaellipse, sizeof(__pyx_k_aaellipse), 0, 0, 1, 1}, {&__pyx_n_s_aaline, __pyx_k_aaline, sizeof(__pyx_k_aaline), 0, 0, 1, 1}, {&__pyx_n_s_aapolygon, __pyx_k_aapolygon, sizeof(__pyx_k_aapolygon), 0, 0, 1, 1}, {&__pyx_n_s_aatrigon, __pyx_k_aatrigon, sizeof(__pyx_k_aatrigon), 0, 0, 1, 1}, {&__pyx_n_s_arc, __pyx_k_arc, sizeof(__pyx_k_arc), 0, 0, 1, 1}, {&__pyx_n_s_bezier, __pyx_k_bezier, sizeof(__pyx_k_bezier), 0, 0, 1, 1}, {&__pyx_n_s_box, __pyx_k_box, sizeof(__pyx_k_box), 0, 0, 1, 1}, {&__pyx_n_s_c, __pyx_k_c, sizeof(__pyx_k_c), 0, 0, 1, 1}, {&__pyx_n_s_circle, __pyx_k_circle, sizeof(__pyx_k_circle), 0, 0, 1, 1}, {&__pyx_n_s_color, __pyx_k_color, sizeof(__pyx_k_color), 0, 0, 1, 1}, {&__pyx_n_s_ellipse, __pyx_k_ellipse, sizeof(__pyx_k_ellipse), 0, 0, 1, 1}, {&__pyx_n_s_end, __pyx_k_end, sizeof(__pyx_k_end), 0, 0, 1, 1}, {&__pyx_n_s_error, __pyx_k_error, sizeof(__pyx_k_error), 0, 0, 1, 1}, {&__pyx_n_s_filled_circle, __pyx_k_filled_circle, sizeof(__pyx_k_filled_circle), 0, 0, 1, 1}, {&__pyx_n_s_filled_ellipse, __pyx_k_filled_ellipse, sizeof(__pyx_k_filled_ellipse), 0, 0, 1, 1}, {&__pyx_n_s_filled_pie, __pyx_k_filled_pie, sizeof(__pyx_k_filled_pie), 0, 0, 1, 1}, {&__pyx_n_s_filled_polygon, __pyx_k_filled_polygon, sizeof(__pyx_k_filled_polygon), 0, 0, 1, 1}, {&__pyx_n_s_filled_trigon, __pyx_k_filled_trigon, sizeof(__pyx_k_filled_trigon), 0, 0, 1, 1}, {&__pyx_n_s_h, __pyx_k_h, sizeof(__pyx_k_h), 0, 0, 1, 1}, {&__pyx_n_s_hline, __pyx_k_hline, sizeof(__pyx_k_hline), 0, 0, 1, 1}, {&__pyx_kp_s_home_tom_ab_pygame_sdl2_src_pyg, __pyx_k_home_tom_ab_pygame_sdl2_src_pyg, sizeof(__pyx_k_home_tom_ab_pygame_sdl2_src_pyg), 0, 0, 1, 0}, {&__pyx_n_s_import, __pyx_k_import, sizeof(__pyx_k_import), 0, 0, 1, 1}, {&__pyx_n_s_line, __pyx_k_line, sizeof(__pyx_k_line), 0, 0, 1, 1}, {&__pyx_n_s_main, __pyx_k_main, sizeof(__pyx_k_main), 0, 0, 1, 1}, {&__pyx_n_s_n, __pyx_k_n, sizeof(__pyx_k_n), 0, 0, 1, 1}, {&__pyx_n_s_num_points, __pyx_k_num_points, sizeof(__pyx_k_num_points), 0, 0, 1, 1}, {&__pyx_n_s_pie, __pyx_k_pie, sizeof(__pyx_k_pie), 0, 0, 1, 1}, {&__pyx_n_s_pixel, __pyx_k_pixel, sizeof(__pyx_k_pixel), 0, 0, 1, 1}, {&__pyx_n_s_points, __pyx_k_points, sizeof(__pyx_k_points), 0, 0, 1, 1}, {&__pyx_n_s_polygon, __pyx_k_polygon, sizeof(__pyx_k_polygon), 0, 0, 1, 1}, {&__pyx_n_s_pt, __pyx_k_pt, sizeof(__pyx_k_pt), 0, 0, 1, 1}, {&__pyx_n_s_pygame_sdl2_error, __pyx_k_pygame_sdl2_error, sizeof(__pyx_k_pygame_sdl2_error), 0, 0, 1, 1}, {&__pyx_n_s_pygame_sdl2_gfxdraw, __pyx_k_pygame_sdl2_gfxdraw, sizeof(__pyx_k_pygame_sdl2_gfxdraw), 0, 0, 1, 1}, {&__pyx_n_s_pygame_sdl2_rect, __pyx_k_pygame_sdl2_rect, sizeof(__pyx_k_pygame_sdl2_rect), 0, 0, 1, 1}, {&__pyx_n_s_pyx_vtable, __pyx_k_pyx_vtable, sizeof(__pyx_k_pyx_vtable), 0, 0, 1, 1}, {&__pyx_n_s_r, __pyx_k_r, sizeof(__pyx_k_r), 0, 0, 1, 1}, {&__pyx_n_s_rad, __pyx_k_rad, sizeof(__pyx_k_rad), 0, 0, 1, 1}, {&__pyx_n_s_range, __pyx_k_range, sizeof(__pyx_k_range), 0, 0, 1, 1}, {&__pyx_n_s_rect, __pyx_k_rect, sizeof(__pyx_k_rect), 0, 0, 1, 1}, {&__pyx_n_s_rectangle, __pyx_k_rectangle, sizeof(__pyx_k_rectangle), 0, 0, 1, 1}, {&__pyx_n_s_rounded_box, __pyx_k_rounded_box, sizeof(__pyx_k_rounded_box), 0, 0, 1, 1}, {&__pyx_n_s_rounded_rectangle, __pyx_k_rounded_rectangle, sizeof(__pyx_k_rounded_rectangle), 0, 0, 1, 1}, {&__pyx_n_s_rx, __pyx_k_rx, sizeof(__pyx_k_rx), 0, 0, 1, 1}, {&__pyx_n_s_ry, __pyx_k_ry, sizeof(__pyx_k_ry), 0, 0, 1, 1}, {&__pyx_n_s_start, __pyx_k_start, sizeof(__pyx_k_start), 0, 0, 1, 1}, {&__pyx_n_s_steps, __pyx_k_steps, sizeof(__pyx_k_steps), 0, 0, 1, 1}, {&__pyx_n_s_surface, __pyx_k_surface, sizeof(__pyx_k_surface), 0, 0, 1, 1}, {&__pyx_n_s_test, __pyx_k_test, sizeof(__pyx_k_test), 0, 0, 1, 1}, {&__pyx_n_s_texture, __pyx_k_texture, sizeof(__pyx_k_texture), 0, 0, 1, 1}, {&__pyx_n_s_textured_polygon, __pyx_k_textured_polygon, sizeof(__pyx_k_textured_polygon), 0, 0, 1, 1}, {&__pyx_n_s_thick_line, __pyx_k_thick_line, sizeof(__pyx_k_thick_line), 0, 0, 1, 1}, {&__pyx_n_s_trigon, __pyx_k_trigon, sizeof(__pyx_k_trigon), 0, 0, 1, 1}, {&__pyx_n_s_tx, __pyx_k_tx, sizeof(__pyx_k_tx), 0, 0, 1, 1}, {&__pyx_n_s_ty, __pyx_k_ty, sizeof(__pyx_k_ty), 0, 0, 1, 1}, {&__pyx_n_s_vline, __pyx_k_vline, sizeof(__pyx_k_vline), 0, 0, 1, 1}, {&__pyx_n_s_vx, __pyx_k_vx, sizeof(__pyx_k_vx), 0, 0, 1, 1}, {&__pyx_n_s_vy, __pyx_k_vy, sizeof(__pyx_k_vy), 0, 0, 1, 1}, {&__pyx_n_s_w, __pyx_k_w, sizeof(__pyx_k_w), 0, 0, 1, 1}, {&__pyx_n_s_width, __pyx_k_width, sizeof(__pyx_k_width), 0, 0, 1, 1}, {&__pyx_n_s_x, __pyx_k_x, sizeof(__pyx_k_x), 0, 0, 1, 1}, {&__pyx_n_s_x1, __pyx_k_x1, sizeof(__pyx_k_x1), 0, 0, 1, 1}, {&__pyx_n_s_x1int, __pyx_k_x1int, sizeof(__pyx_k_x1int), 0, 0, 1, 1}, {&__pyx_n_s_x2, __pyx_k_x2, sizeof(__pyx_k_x2), 0, 0, 1, 1}, {&__pyx_n_s_x2int, __pyx_k_x2int, sizeof(__pyx_k_x2int), 0, 0, 1, 1}, {&__pyx_n_s_x3, __pyx_k_x3, sizeof(__pyx_k_x3), 0, 0, 1, 1}, {&__pyx_n_s_y, __pyx_k_y, sizeof(__pyx_k_y), 0, 0, 1, 1}, {&__pyx_n_s_y1, __pyx_k_y1, sizeof(__pyx_k_y1), 0, 0, 1, 1}, {&__pyx_n_s_y1int, __pyx_k_y1int, sizeof(__pyx_k_y1int), 0, 0, 1, 1}, {&__pyx_n_s_y2, __pyx_k_y2, sizeof(__pyx_k_y2), 0, 0, 1, 1}, {&__pyx_n_s_y2int, __pyx_k_y2int, sizeof(__pyx_k_y2int), 0, 0, 1, 1}, {&__pyx_n_s_y3, __pyx_k_y3, sizeof(__pyx_k_y3), 0, 0, 1, 1}, {&__pyx_n_s_zip, __pyx_k_zip, sizeof(__pyx_k_zip), 0, 0, 1, 1}, {0, 0, 0, 0, 0, 0, 0} }; static int __Pyx_InitCachedBuiltins(void) { __pyx_builtin_zip = __Pyx_GetBuiltinName(__pyx_n_s_zip); if (!__pyx_builtin_zip) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 145; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_builtin_range = __Pyx_GetBuiltinName(__pyx_n_s_range); if (!__pyx_builtin_range) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 145; __pyx_clineno = __LINE__; goto __pyx_L1_error;} return 0; __pyx_L1_error:; return -1; } static int __Pyx_InitCachedConstants(void) { __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__Pyx_InitCachedConstants", 0); /* "pygame_sdl2/gfxdraw.pyx":29 * * * def pixel(Surface surface, x, y, color): # <<<<<<<<<<<<<< * cdef Color c = Color(color) * pixelRGBA(surface.surface, x, y, c.r, c.g, c.b, c.a) */ __pyx_tuple_ = PyTuple_Pack(5, __pyx_n_s_surface, __pyx_n_s_x, __pyx_n_s_y, __pyx_n_s_color, __pyx_n_s_c); if (unlikely(!__pyx_tuple_)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 29; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_tuple_); __Pyx_GIVEREF(__pyx_tuple_); __pyx_codeobj__2 = (PyObject*)__Pyx_PyCode_New(4, 0, 5, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple_, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_tom_ab_pygame_sdl2_src_pyg, __pyx_n_s_pixel, 29, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 29; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "pygame_sdl2/gfxdraw.pyx":33 * pixelRGBA(surface.surface, x, y, c.r, c.g, c.b, c.a) * * def hline(Surface surface, x1, x2, y, color): # <<<<<<<<<<<<<< * cdef Color c = Color(color) * hlineRGBA(surface.surface, x1, x2, y, c.r, c.g, c.b, c.a) */ __pyx_tuple__3 = PyTuple_Pack(6, __pyx_n_s_surface, __pyx_n_s_x1, __pyx_n_s_x2, __pyx_n_s_y, __pyx_n_s_color, __pyx_n_s_c); if (unlikely(!__pyx_tuple__3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 33; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_tuple__3); __Pyx_GIVEREF(__pyx_tuple__3); __pyx_codeobj__4 = (PyObject*)__Pyx_PyCode_New(5, 0, 6, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__3, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_tom_ab_pygame_sdl2_src_pyg, __pyx_n_s_hline, 33, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 33; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "pygame_sdl2/gfxdraw.pyx":37 * hlineRGBA(surface.surface, x1, x2, y, c.r, c.g, c.b, c.a) * * def vline(Surface surface, x, y1, y2, color): # <<<<<<<<<<<<<< * cdef Color c = Color(color) * vlineRGBA(surface.surface, x, y1, y2, c.r, c.g, c.b, c.a) */ __pyx_tuple__5 = PyTuple_Pack(6, __pyx_n_s_surface, __pyx_n_s_x, __pyx_n_s_y1, __pyx_n_s_y2, __pyx_n_s_color, __pyx_n_s_c); if (unlikely(!__pyx_tuple__5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 37; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_tuple__5); __Pyx_GIVEREF(__pyx_tuple__5); __pyx_codeobj__6 = (PyObject*)__Pyx_PyCode_New(5, 0, 6, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__5, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_tom_ab_pygame_sdl2_src_pyg, __pyx_n_s_vline, 37, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 37; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "pygame_sdl2/gfxdraw.pyx":41 * vlineRGBA(surface.surface, x, y1, y2, c.r, c.g, c.b, c.a) * * def rectangle(Surface surface, rect, color): # <<<<<<<<<<<<<< * cdef Color c = Color(color) * if not isinstance(rect, Rect): */ __pyx_tuple__7 = PyTuple_Pack(4, __pyx_n_s_surface, __pyx_n_s_rect, __pyx_n_s_color, __pyx_n_s_c); if (unlikely(!__pyx_tuple__7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 41; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_tuple__7); __Pyx_GIVEREF(__pyx_tuple__7); __pyx_codeobj__8 = (PyObject*)__Pyx_PyCode_New(3, 0, 4, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__7, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_tom_ab_pygame_sdl2_src_pyg, __pyx_n_s_rectangle, 41, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 41; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "pygame_sdl2/gfxdraw.pyx":47 * rectangleRGBA(surface.surface, rect.x, rect.y, rect.x + rect.w, rect.y + rect.h, c.r, c.g, c.b, c.a) * * def rounded_rectangle(Surface surface, rect, rad, color): # <<<<<<<<<<<<<< * cdef Color c = Color(color) * if not isinstance(rect, Rect): */ __pyx_tuple__9 = PyTuple_Pack(5, __pyx_n_s_surface, __pyx_n_s_rect, __pyx_n_s_rad, __pyx_n_s_color, __pyx_n_s_c); if (unlikely(!__pyx_tuple__9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 47; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_tuple__9); __Pyx_GIVEREF(__pyx_tuple__9); __pyx_codeobj__10 = (PyObject*)__Pyx_PyCode_New(4, 0, 5, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__9, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_tom_ab_pygame_sdl2_src_pyg, __pyx_n_s_rounded_rectangle, 47, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 47; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "pygame_sdl2/gfxdraw.pyx":53 * roundedRectangleRGBA(surface.surface, rect.x, rect.y, rect.x + rect.w, rect.y + rect.h, rad, c.r, c.g, c.b, c.a) * * def box(Surface surface, rect, color): # <<<<<<<<<<<<<< * cdef Color c = Color(color) * if not isinstance(rect, Rect): */ __pyx_tuple__11 = PyTuple_Pack(4, __pyx_n_s_surface, __pyx_n_s_rect, __pyx_n_s_color, __pyx_n_s_c); if (unlikely(!__pyx_tuple__11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 53; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_tuple__11); __Pyx_GIVEREF(__pyx_tuple__11); __pyx_codeobj__12 = (PyObject*)__Pyx_PyCode_New(3, 0, 4, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__11, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_tom_ab_pygame_sdl2_src_pyg, __pyx_n_s_box, 53, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__12)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 53; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "pygame_sdl2/gfxdraw.pyx":59 * boxRGBA(surface.surface, rect.x, rect.y, rect.x + rect.w, rect.y + rect.h, c.r, c.g, c.b, c.a) * * def rounded_box(Surface surface, rect, rad, color): # <<<<<<<<<<<<<< * cdef Color c = Color(color) * if not isinstance(rect, Rect): */ __pyx_tuple__13 = PyTuple_Pack(5, __pyx_n_s_surface, __pyx_n_s_rect, __pyx_n_s_rad, __pyx_n_s_color, __pyx_n_s_c); if (unlikely(!__pyx_tuple__13)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 59; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_tuple__13); __Pyx_GIVEREF(__pyx_tuple__13); __pyx_codeobj__14 = (PyObject*)__Pyx_PyCode_New(4, 0, 5, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__13, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_tom_ab_pygame_sdl2_src_pyg, __pyx_n_s_rounded_box, 59, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__14)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 59; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "pygame_sdl2/gfxdraw.pyx":65 * roundedBoxRGBA(surface.surface, rect.x, rect.y, rect.x + rect.w, rect.y + rect.h, rad, c.r, c.g, c.b, c.a) * * def line(Surface surface, x1, y1, x2, y2, color): # <<<<<<<<<<<<<< * cdef Color c = Color(color) * lineRGBA(surface.surface, x1, y1, x2, y2, c.r, c.g, c.b, c.a) */ __pyx_tuple__15 = PyTuple_Pack(7, __pyx_n_s_surface, __pyx_n_s_x1, __pyx_n_s_y1, __pyx_n_s_x2, __pyx_n_s_y2, __pyx_n_s_color, __pyx_n_s_c); if (unlikely(!__pyx_tuple__15)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 65; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_tuple__15); __Pyx_GIVEREF(__pyx_tuple__15); __pyx_codeobj__16 = (PyObject*)__Pyx_PyCode_New(6, 0, 7, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__15, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_tom_ab_pygame_sdl2_src_pyg, __pyx_n_s_line, 65, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__16)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 65; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "pygame_sdl2/gfxdraw.pyx":69 * lineRGBA(surface.surface, x1, y1, x2, y2, c.r, c.g, c.b, c.a) * * def aaline(Surface surface, x1, y1, x2, y2, color): # <<<<<<<<<<<<<< * cdef Color c = Color(color) * aalineRGBA(surface.surface, x1, y1, x2, y2, c.r, c.g, c.b, c.a) */ __pyx_tuple__17 = PyTuple_Pack(7, __pyx_n_s_surface, __pyx_n_s_x1, __pyx_n_s_y1, __pyx_n_s_x2, __pyx_n_s_y2, __pyx_n_s_color, __pyx_n_s_c); if (unlikely(!__pyx_tuple__17)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 69; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_tuple__17); __Pyx_GIVEREF(__pyx_tuple__17); __pyx_codeobj__18 = (PyObject*)__Pyx_PyCode_New(6, 0, 7, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__17, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_tom_ab_pygame_sdl2_src_pyg, __pyx_n_s_aaline, 69, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__18)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 69; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "pygame_sdl2/gfxdraw.pyx":73 * aalineRGBA(surface.surface, x1, y1, x2, y2, c.r, c.g, c.b, c.a) * * def thick_line(Surface surface, x1, y1, x2, y2, width, color): # <<<<<<<<<<<<<< * cdef Color c = Color(color) * */ __pyx_tuple__19 = PyTuple_Pack(12, __pyx_n_s_surface, __pyx_n_s_x1, __pyx_n_s_y1, __pyx_n_s_x2, __pyx_n_s_y2, __pyx_n_s_width, __pyx_n_s_color, __pyx_n_s_c, __pyx_n_s_x1int, __pyx_n_s_y1int, __pyx_n_s_x2int, __pyx_n_s_y2int); if (unlikely(!__pyx_tuple__19)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 73; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_tuple__19); __Pyx_GIVEREF(__pyx_tuple__19); __pyx_codeobj__20 = (PyObject*)__Pyx_PyCode_New(7, 0, 12, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__19, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_tom_ab_pygame_sdl2_src_pyg, __pyx_n_s_thick_line, 73, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__20)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 73; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "pygame_sdl2/gfxdraw.pyx":90 * thickLineRGBA(surface.surface, x1int, y1int, x2int, y2int, width, c.r, c.g, c.b, c.a) * * def circle(Surface surface, x, y, r, color): # <<<<<<<<<<<<<< * cdef Color c = Color(color) * circleRGBA(surface.surface, x, y, r, c.r, c.g, c.b, c.a) */ __pyx_tuple__21 = PyTuple_Pack(6, __pyx_n_s_surface, __pyx_n_s_x, __pyx_n_s_y, __pyx_n_s_r, __pyx_n_s_color, __pyx_n_s_c); if (unlikely(!__pyx_tuple__21)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 90; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_tuple__21); __Pyx_GIVEREF(__pyx_tuple__21); __pyx_codeobj__22 = (PyObject*)__Pyx_PyCode_New(5, 0, 6, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__21, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_tom_ab_pygame_sdl2_src_pyg, __pyx_n_s_circle, 90, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__22)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 90; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "pygame_sdl2/gfxdraw.pyx":94 * circleRGBA(surface.surface, x, y, r, c.r, c.g, c.b, c.a) * * def arc(Surface surface, x, y, r, start, end, color): # <<<<<<<<<<<<<< * cdef Color c = Color(color) * arcRGBA(surface.surface, x, y, r, start, end, c.r, c.g, c.b, c.a) */ __pyx_tuple__23 = PyTuple_Pack(8, __pyx_n_s_surface, __pyx_n_s_x, __pyx_n_s_y, __pyx_n_s_r, __pyx_n_s_start, __pyx_n_s_end, __pyx_n_s_color, __pyx_n_s_c); if (unlikely(!__pyx_tuple__23)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 94; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_tuple__23); __Pyx_GIVEREF(__pyx_tuple__23); __pyx_codeobj__24 = (PyObject*)__Pyx_PyCode_New(7, 0, 8, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__23, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_tom_ab_pygame_sdl2_src_pyg, __pyx_n_s_arc, 94, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__24)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 94; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "pygame_sdl2/gfxdraw.pyx":98 * arcRGBA(surface.surface, x, y, r, start, end, c.r, c.g, c.b, c.a) * * def aacircle(Surface surface, x, y, r, color): # <<<<<<<<<<<<<< * cdef Color c = Color(color) * aacircleRGBA(surface.surface, x, y, r, c.r, c.g, c.b, c.a) */ __pyx_tuple__25 = PyTuple_Pack(6, __pyx_n_s_surface, __pyx_n_s_x, __pyx_n_s_y, __pyx_n_s_r, __pyx_n_s_color, __pyx_n_s_c); if (unlikely(!__pyx_tuple__25)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 98; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_tuple__25); __Pyx_GIVEREF(__pyx_tuple__25); __pyx_codeobj__26 = (PyObject*)__Pyx_PyCode_New(5, 0, 6, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__25, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_tom_ab_pygame_sdl2_src_pyg, __pyx_n_s_aacircle, 98, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__26)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 98; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "pygame_sdl2/gfxdraw.pyx":102 * aacircleRGBA(surface.surface, x, y, r, c.r, c.g, c.b, c.a) * * def filled_circle(Surface surface, x, y, r, color): # <<<<<<<<<<<<<< * cdef Color c = Color(color) * filledCircleRGBA(surface.surface, x, y, r, c.r, c.g, c.b, c.a) */ __pyx_tuple__27 = PyTuple_Pack(6, __pyx_n_s_surface, __pyx_n_s_x, __pyx_n_s_y, __pyx_n_s_r, __pyx_n_s_color, __pyx_n_s_c); if (unlikely(!__pyx_tuple__27)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 102; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_tuple__27); __Pyx_GIVEREF(__pyx_tuple__27); __pyx_codeobj__28 = (PyObject*)__Pyx_PyCode_New(5, 0, 6, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__27, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_tom_ab_pygame_sdl2_src_pyg, __pyx_n_s_filled_circle, 102, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__28)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 102; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "pygame_sdl2/gfxdraw.pyx":106 * filledCircleRGBA(surface.surface, x, y, r, c.r, c.g, c.b, c.a) * * def ellipse(Surface surface, x, y, rx, ry, color): # <<<<<<<<<<<<<< * cdef Color c = Color(color) * ellipseRGBA(surface.surface, x, y, rx, ry, c.r, c.g, c.b, c.a) */ __pyx_tuple__29 = PyTuple_Pack(7, __pyx_n_s_surface, __pyx_n_s_x, __pyx_n_s_y, __pyx_n_s_rx, __pyx_n_s_ry, __pyx_n_s_color, __pyx_n_s_c); if (unlikely(!__pyx_tuple__29)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 106; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_tuple__29); __Pyx_GIVEREF(__pyx_tuple__29); __pyx_codeobj__30 = (PyObject*)__Pyx_PyCode_New(6, 0, 7, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__29, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_tom_ab_pygame_sdl2_src_pyg, __pyx_n_s_ellipse, 106, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__30)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 106; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "pygame_sdl2/gfxdraw.pyx":110 * ellipseRGBA(surface.surface, x, y, rx, ry, c.r, c.g, c.b, c.a) * * def aaellipse(Surface surface, x, y, rx, ry, color): # <<<<<<<<<<<<<< * cdef Color c = Color(color) * aaellipseRGBA(surface.surface, x, y, rx, ry, c.r, c.g, c.b, c.a) */ __pyx_tuple__31 = PyTuple_Pack(7, __pyx_n_s_surface, __pyx_n_s_x, __pyx_n_s_y, __pyx_n_s_rx, __pyx_n_s_ry, __pyx_n_s_color, __pyx_n_s_c); if (unlikely(!__pyx_tuple__31)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 110; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_tuple__31); __Pyx_GIVEREF(__pyx_tuple__31); __pyx_codeobj__32 = (PyObject*)__Pyx_PyCode_New(6, 0, 7, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__31, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_tom_ab_pygame_sdl2_src_pyg, __pyx_n_s_aaellipse, 110, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__32)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 110; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "pygame_sdl2/gfxdraw.pyx":114 * aaellipseRGBA(surface.surface, x, y, rx, ry, c.r, c.g, c.b, c.a) * * def filled_ellipse(Surface surface, x, y, rx, ry, color): # <<<<<<<<<<<<<< * cdef Color c = Color(color) * filledEllipseRGBA(surface.surface, x, y, rx, ry, c.r, c.g, c.b, c.a) */ __pyx_tuple__33 = PyTuple_Pack(7, __pyx_n_s_surface, __pyx_n_s_x, __pyx_n_s_y, __pyx_n_s_rx, __pyx_n_s_ry, __pyx_n_s_color, __pyx_n_s_c); if (unlikely(!__pyx_tuple__33)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 114; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_tuple__33); __Pyx_GIVEREF(__pyx_tuple__33); __pyx_codeobj__34 = (PyObject*)__Pyx_PyCode_New(6, 0, 7, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__33, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_tom_ab_pygame_sdl2_src_pyg, __pyx_n_s_filled_ellipse, 114, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__34)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 114; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "pygame_sdl2/gfxdraw.pyx":118 * filledEllipseRGBA(surface.surface, x, y, rx, ry, c.r, c.g, c.b, c.a) * * def pie(Surface surface, x, y, r, start, end, color): # <<<<<<<<<<<<<< * cdef Color c = Color(color) * pieRGBA(surface.surface, x, y, r, start, end, c.r, c.g, c.b, c.a) */ __pyx_tuple__35 = PyTuple_Pack(8, __pyx_n_s_surface, __pyx_n_s_x, __pyx_n_s_y, __pyx_n_s_r, __pyx_n_s_start, __pyx_n_s_end, __pyx_n_s_color, __pyx_n_s_c); if (unlikely(!__pyx_tuple__35)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 118; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_tuple__35); __Pyx_GIVEREF(__pyx_tuple__35); __pyx_codeobj__36 = (PyObject*)__Pyx_PyCode_New(7, 0, 8, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__35, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_tom_ab_pygame_sdl2_src_pyg, __pyx_n_s_pie, 118, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__36)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 118; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "pygame_sdl2/gfxdraw.pyx":122 * pieRGBA(surface.surface, x, y, r, start, end, c.r, c.g, c.b, c.a) * * def filled_pie(Surface surface, x, y, r, start, end, color): # <<<<<<<<<<<<<< * cdef Color c = Color(color) * filledPieRGBA(surface.surface, x, y, r, start, end, c.r, c.g, c.b, c.a) */ __pyx_tuple__37 = PyTuple_Pack(8, __pyx_n_s_surface, __pyx_n_s_x, __pyx_n_s_y, __pyx_n_s_r, __pyx_n_s_start, __pyx_n_s_end, __pyx_n_s_color, __pyx_n_s_c); if (unlikely(!__pyx_tuple__37)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 122; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_tuple__37); __Pyx_GIVEREF(__pyx_tuple__37); __pyx_codeobj__38 = (PyObject*)__Pyx_PyCode_New(7, 0, 8, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__37, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_tom_ab_pygame_sdl2_src_pyg, __pyx_n_s_filled_pie, 122, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__38)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 122; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "pygame_sdl2/gfxdraw.pyx":126 * filledPieRGBA(surface.surface, x, y, r, start, end, c.r, c.g, c.b, c.a) * * def trigon(Surface surface, x1, y1, x2, y2, x3, y3, color): # <<<<<<<<<<<<<< * cdef Color c = Color(color) * trigonRGBA(surface.surface, x1, y1, x2, y2, x3, y3, c.r, c.g, c.b, c.a) */ __pyx_tuple__39 = PyTuple_Pack(9, __pyx_n_s_surface, __pyx_n_s_x1, __pyx_n_s_y1, __pyx_n_s_x2, __pyx_n_s_y2, __pyx_n_s_x3, __pyx_n_s_y3, __pyx_n_s_color, __pyx_n_s_c); if (unlikely(!__pyx_tuple__39)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 126; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_tuple__39); __Pyx_GIVEREF(__pyx_tuple__39); __pyx_codeobj__40 = (PyObject*)__Pyx_PyCode_New(8, 0, 9, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__39, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_tom_ab_pygame_sdl2_src_pyg, __pyx_n_s_trigon, 126, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__40)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 126; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "pygame_sdl2/gfxdraw.pyx":130 * trigonRGBA(surface.surface, x1, y1, x2, y2, x3, y3, c.r, c.g, c.b, c.a) * * def aatrigon(Surface surface, x1, y1, x2, y2, x3, y3, color): # <<<<<<<<<<<<<< * cdef Color c = Color(color) * aatrigonRGBA(surface.surface, x1, y1, x2, y2, x3, y3, c.r, c.g, c.b, c.a) */ __pyx_tuple__41 = PyTuple_Pack(9, __pyx_n_s_surface, __pyx_n_s_x1, __pyx_n_s_y1, __pyx_n_s_x2, __pyx_n_s_y2, __pyx_n_s_x3, __pyx_n_s_y3, __pyx_n_s_color, __pyx_n_s_c); if (unlikely(!__pyx_tuple__41)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 130; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_tuple__41); __Pyx_GIVEREF(__pyx_tuple__41); __pyx_codeobj__42 = (PyObject*)__Pyx_PyCode_New(8, 0, 9, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__41, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_tom_ab_pygame_sdl2_src_pyg, __pyx_n_s_aatrigon, 130, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__42)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 130; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "pygame_sdl2/gfxdraw.pyx":134 * aatrigonRGBA(surface.surface, x1, y1, x2, y2, x3, y3, c.r, c.g, c.b, c.a) * * def filled_trigon(Surface surface, x1, y1, x2, y2, x3, y3, color): # <<<<<<<<<<<<<< * cdef Color c = Color(color) * filledTrigonRGBA(surface.surface, x1, y1, x2, y2, x3, y3, c.r, c.g, c.b, c.a) */ __pyx_tuple__43 = PyTuple_Pack(9, __pyx_n_s_surface, __pyx_n_s_x1, __pyx_n_s_y1, __pyx_n_s_x2, __pyx_n_s_y2, __pyx_n_s_x3, __pyx_n_s_y3, __pyx_n_s_color, __pyx_n_s_c); if (unlikely(!__pyx_tuple__43)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 134; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_tuple__43); __Pyx_GIVEREF(__pyx_tuple__43); __pyx_codeobj__44 = (PyObject*)__Pyx_PyCode_New(8, 0, 9, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__43, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_tom_ab_pygame_sdl2_src_pyg, __pyx_n_s_filled_trigon, 134, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__44)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 134; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "pygame_sdl2/gfxdraw.pyx":138 * filledTrigonRGBA(surface.surface, x1, y1, x2, y2, x3, y3, c.r, c.g, c.b, c.a) * * def polygon(Surface surface, points, color): # <<<<<<<<<<<<<< * cdef Color c = Color(color) * cdef Sint16 *vx */ __pyx_tuple__45 = PyTuple_Pack(9, __pyx_n_s_surface, __pyx_n_s_points, __pyx_n_s_color, __pyx_n_s_c, __pyx_n_s_vx, __pyx_n_s_vy, __pyx_n_s_num_points, __pyx_n_s_n, __pyx_n_s_pt); if (unlikely(!__pyx_tuple__45)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 138; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_tuple__45); __Pyx_GIVEREF(__pyx_tuple__45); __pyx_codeobj__46 = (PyObject*)__Pyx_PyCode_New(3, 0, 9, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__45, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_tom_ab_pygame_sdl2_src_pyg, __pyx_n_s_polygon, 138, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__46)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 138; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "pygame_sdl2/gfxdraw.pyx":151 * free(vy) * * def aapolygon(Surface surface, points, color): # <<<<<<<<<<<<<< * cdef Color c = Color(color) * cdef Sint16 *vx */ __pyx_tuple__47 = PyTuple_Pack(9, __pyx_n_s_surface, __pyx_n_s_points, __pyx_n_s_color, __pyx_n_s_c, __pyx_n_s_vx, __pyx_n_s_vy, __pyx_n_s_num_points, __pyx_n_s_n, __pyx_n_s_pt); if (unlikely(!__pyx_tuple__47)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 151; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_tuple__47); __Pyx_GIVEREF(__pyx_tuple__47); __pyx_codeobj__48 = (PyObject*)__Pyx_PyCode_New(3, 0, 9, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__47, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_tom_ab_pygame_sdl2_src_pyg, __pyx_n_s_aapolygon, 151, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__48)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 151; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "pygame_sdl2/gfxdraw.pyx":164 * free(vy) * * def filled_polygon(Surface surface, points, color): # <<<<<<<<<<<<<< * cdef Color c = Color(color) * cdef Sint16 *vx */ __pyx_tuple__49 = PyTuple_Pack(9, __pyx_n_s_surface, __pyx_n_s_points, __pyx_n_s_color, __pyx_n_s_c, __pyx_n_s_vx, __pyx_n_s_vy, __pyx_n_s_num_points, __pyx_n_s_n, __pyx_n_s_pt); if (unlikely(!__pyx_tuple__49)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 164; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_tuple__49); __Pyx_GIVEREF(__pyx_tuple__49); __pyx_codeobj__50 = (PyObject*)__Pyx_PyCode_New(3, 0, 9, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__49, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_tom_ab_pygame_sdl2_src_pyg, __pyx_n_s_filled_polygon, 164, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__50)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 164; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "pygame_sdl2/gfxdraw.pyx":177 * free(vy) * * def textured_polygon(Surface surface, points, Surface texture not None, tx, ty): # <<<<<<<<<<<<<< * cdef Sint16 *vx * cdef Sint16 *vy */ __pyx_tuple__51 = PyTuple_Pack(10, __pyx_n_s_surface, __pyx_n_s_points, __pyx_n_s_texture, __pyx_n_s_tx, __pyx_n_s_ty, __pyx_n_s_vx, __pyx_n_s_vy, __pyx_n_s_num_points, __pyx_n_s_n, __pyx_n_s_pt); if (unlikely(!__pyx_tuple__51)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 177; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_tuple__51); __Pyx_GIVEREF(__pyx_tuple__51); __pyx_codeobj__52 = (PyObject*)__Pyx_PyCode_New(5, 0, 10, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__51, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_tom_ab_pygame_sdl2_src_pyg, __pyx_n_s_textured_polygon, 177, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__52)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 177; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "pygame_sdl2/gfxdraw.pyx":189 * free(vy) * * def bezier(Surface surface, points, steps, color): # <<<<<<<<<<<<<< * cdef Color c = Color(color) * cdef Sint16 *vx */ __pyx_tuple__53 = PyTuple_Pack(10, __pyx_n_s_surface, __pyx_n_s_points, __pyx_n_s_steps, __pyx_n_s_color, __pyx_n_s_c, __pyx_n_s_vx, __pyx_n_s_vy, __pyx_n_s_num_points, __pyx_n_s_n, __pyx_n_s_pt); if (unlikely(!__pyx_tuple__53)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 189; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_tuple__53); __Pyx_GIVEREF(__pyx_tuple__53); __pyx_codeobj__54 = (PyObject*)__Pyx_PyCode_New(4, 0, 10, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__53, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_tom_ab_pygame_sdl2_src_pyg, __pyx_n_s_bezier, 189, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__54)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 189; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_RefNannyFinishContext(); return 0; __pyx_L1_error:; __Pyx_RefNannyFinishContext(); return -1; } static int __Pyx_InitGlobals(void) { if (__Pyx_InitStrings(__pyx_string_tab) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; return 0; __pyx_L1_error:; return -1; } #if PY_MAJOR_VERSION < 3 PyMODINIT_FUNC initgfxdraw(void); /*proto*/ PyMODINIT_FUNC initgfxdraw(void) #else PyMODINIT_FUNC PyInit_gfxdraw(void); /*proto*/ PyMODINIT_FUNC PyInit_gfxdraw(void) #endif { PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannyDeclarations #if CYTHON_REFNANNY __Pyx_RefNanny = __Pyx_RefNannyImportAPI("refnanny"); if (!__Pyx_RefNanny) { PyErr_Clear(); __Pyx_RefNanny = __Pyx_RefNannyImportAPI("Cython.Runtime.refnanny"); if (!__Pyx_RefNanny) Py_FatalError("failed to import 'refnanny' module"); } #endif __Pyx_RefNannySetupContext("PyMODINIT_FUNC PyInit_gfxdraw(void)", 0); if (__Pyx_check_binary_version() < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_empty_tuple = PyTuple_New(0); if (unlikely(!__pyx_empty_tuple)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_empty_bytes = PyBytes_FromStringAndSize("", 0); if (unlikely(!__pyx_empty_bytes)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} #ifdef __Pyx_CyFunction_USED if (__pyx_CyFunction_init() < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} #endif #ifdef __Pyx_FusedFunction_USED if (__pyx_FusedFunction_init() < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} #endif #ifdef __Pyx_Coroutine_USED if (__pyx_Coroutine_init() < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} #endif #ifdef __Pyx_Generator_USED if (__pyx_Generator_init() < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} #endif #ifdef __Pyx_StopAsyncIteration_USED if (__pyx_StopAsyncIteration_init() < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} #endif /*--- Library function declarations ---*/ /*--- Threads initialization code ---*/ #if defined(__PYX_FORCE_INIT_THREADS) && __PYX_FORCE_INIT_THREADS #ifdef WITH_THREAD /* Python build with threading support? */ PyEval_InitThreads(); #endif #endif /*--- Module creation code ---*/ #if PY_MAJOR_VERSION < 3 __pyx_m = Py_InitModule4("gfxdraw", __pyx_methods, 0, 0, PYTHON_API_VERSION); Py_XINCREF(__pyx_m); #else __pyx_m = PyModule_Create(&__pyx_moduledef); #endif if (unlikely(!__pyx_m)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_d = PyModule_GetDict(__pyx_m); if (unlikely(!__pyx_d)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} Py_INCREF(__pyx_d); __pyx_b = PyImport_AddModule(__Pyx_BUILTIN_MODULE_NAME); if (unlikely(!__pyx_b)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} #if CYTHON_COMPILING_IN_PYPY Py_INCREF(__pyx_b); #endif if (PyObject_SetAttrString(__pyx_m, "__builtins__", __pyx_b) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; /*--- Initialize various global constants etc. ---*/ if (__Pyx_InitGlobals() < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} #if PY_MAJOR_VERSION < 3 && (__PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT) if (__Pyx_init_sys_getdefaultencoding_params() < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} #endif if (__pyx_module_is_main_pygame_sdl2__gfxdraw) { if (PyObject_SetAttrString(__pyx_m, "__name__", __pyx_n_s_main) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } #if PY_MAJOR_VERSION >= 3 { PyObject *modules = PyImport_GetModuleDict(); if (unlikely(!modules)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} if (!PyDict_GetItemString(modules, "pygame_sdl2.gfxdraw")) { if (unlikely(PyDict_SetItemString(modules, "pygame_sdl2.gfxdraw", __pyx_m) < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } } #endif /*--- Builtin init code ---*/ if (__Pyx_InitCachedBuiltins() < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /*--- Constants init code ---*/ if (__Pyx_InitCachedConstants() < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /*--- Global init code ---*/ /*--- Variable export code ---*/ /*--- Function export code ---*/ /*--- Type init code ---*/ /*--- Type import code ---*/ __pyx_ptype_11pygame_sdl2_7surface_Surface = __Pyx_ImportType("pygame_sdl2.surface", "Surface", sizeof(struct __pyx_obj_11pygame_sdl2_7surface_Surface), 1); if (unlikely(!__pyx_ptype_11pygame_sdl2_7surface_Surface)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 23; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_vtabptr_11pygame_sdl2_7surface_Surface = (struct __pyx_vtabstruct_11pygame_sdl2_7surface_Surface*)__Pyx_GetVtable(__pyx_ptype_11pygame_sdl2_7surface_Surface->tp_dict); if (unlikely(!__pyx_vtabptr_11pygame_sdl2_7surface_Surface)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 23; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_ptype_11pygame_sdl2_5color_Color = __Pyx_ImportType("pygame_sdl2.color", "Color", sizeof(struct __pyx_obj_11pygame_sdl2_5color_Color), 1); if (unlikely(!__pyx_ptype_11pygame_sdl2_5color_Color)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 26; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_vtabptr_11pygame_sdl2_5color_Color = (struct __pyx_vtabstruct_11pygame_sdl2_5color_Color*)__Pyx_GetVtable(__pyx_ptype_11pygame_sdl2_5color_Color->tp_dict); if (unlikely(!__pyx_vtabptr_11pygame_sdl2_5color_Color)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 26; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /*--- Variable import code ---*/ /*--- Function import code ---*/ /*--- Execution code ---*/ #if defined(__Pyx_Generator_USED) || defined(__Pyx_Coroutine_USED) if (__Pyx_patch_abc() < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} #endif /* "pygame_sdl2/gfxdraw.pyx":25 * from pygame_sdl2.color cimport Color * * from pygame_sdl2.error import error # <<<<<<<<<<<<<< * from pygame_sdl2.rect import Rect * */ __pyx_t_1 = PyList_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 25; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __Pyx_INCREF(__pyx_n_s_error); __Pyx_GIVEREF(__pyx_n_s_error); PyList_SET_ITEM(__pyx_t_1, 0, __pyx_n_s_error); __pyx_t_2 = __Pyx_Import(__pyx_n_s_pygame_sdl2_error, __pyx_t_1, 0); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 25; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_1 = __Pyx_ImportFrom(__pyx_t_2, __pyx_n_s_error); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 25; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); if (PyDict_SetItem(__pyx_d, __pyx_n_s_error, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 25; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "pygame_sdl2/gfxdraw.pyx":26 * * from pygame_sdl2.error import error * from pygame_sdl2.rect import Rect # <<<<<<<<<<<<<< * * */ __pyx_t_2 = PyList_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 26; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __Pyx_INCREF(__pyx_n_s_Rect); __Pyx_GIVEREF(__pyx_n_s_Rect); PyList_SET_ITEM(__pyx_t_2, 0, __pyx_n_s_Rect); __pyx_t_1 = __Pyx_Import(__pyx_n_s_pygame_sdl2_rect, __pyx_t_2, 0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 26; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_2 = __Pyx_ImportFrom(__pyx_t_1, __pyx_n_s_Rect); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 26; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_Rect, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 26; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "pygame_sdl2/gfxdraw.pyx":29 * * * def pixel(Surface surface, x, y, color): # <<<<<<<<<<<<<< * cdef Color c = Color(color) * pixelRGBA(surface.surface, x, y, c.r, c.g, c.b, c.a) */ __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_11pygame_sdl2_7gfxdraw_1pixel, NULL, __pyx_n_s_pygame_sdl2_gfxdraw); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 29; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); if (PyDict_SetItem(__pyx_d, __pyx_n_s_pixel, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 29; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "pygame_sdl2/gfxdraw.pyx":33 * pixelRGBA(surface.surface, x, y, c.r, c.g, c.b, c.a) * * def hline(Surface surface, x1, x2, y, color): # <<<<<<<<<<<<<< * cdef Color c = Color(color) * hlineRGBA(surface.surface, x1, x2, y, c.r, c.g, c.b, c.a) */ __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_11pygame_sdl2_7gfxdraw_3hline, NULL, __pyx_n_s_pygame_sdl2_gfxdraw); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 33; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); if (PyDict_SetItem(__pyx_d, __pyx_n_s_hline, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 33; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "pygame_sdl2/gfxdraw.pyx":37 * hlineRGBA(surface.surface, x1, x2, y, c.r, c.g, c.b, c.a) * * def vline(Surface surface, x, y1, y2, color): # <<<<<<<<<<<<<< * cdef Color c = Color(color) * vlineRGBA(surface.surface, x, y1, y2, c.r, c.g, c.b, c.a) */ __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_11pygame_sdl2_7gfxdraw_5vline, NULL, __pyx_n_s_pygame_sdl2_gfxdraw); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 37; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); if (PyDict_SetItem(__pyx_d, __pyx_n_s_vline, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 37; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "pygame_sdl2/gfxdraw.pyx":41 * vlineRGBA(surface.surface, x, y1, y2, c.r, c.g, c.b, c.a) * * def rectangle(Surface surface, rect, color): # <<<<<<<<<<<<<< * cdef Color c = Color(color) * if not isinstance(rect, Rect): */ __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_11pygame_sdl2_7gfxdraw_7rectangle, NULL, __pyx_n_s_pygame_sdl2_gfxdraw); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 41; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); if (PyDict_SetItem(__pyx_d, __pyx_n_s_rectangle, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 41; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "pygame_sdl2/gfxdraw.pyx":47 * rectangleRGBA(surface.surface, rect.x, rect.y, rect.x + rect.w, rect.y + rect.h, c.r, c.g, c.b, c.a) * * def rounded_rectangle(Surface surface, rect, rad, color): # <<<<<<<<<<<<<< * cdef Color c = Color(color) * if not isinstance(rect, Rect): */ __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_11pygame_sdl2_7gfxdraw_9rounded_rectangle, NULL, __pyx_n_s_pygame_sdl2_gfxdraw); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 47; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); if (PyDict_SetItem(__pyx_d, __pyx_n_s_rounded_rectangle, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 47; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "pygame_sdl2/gfxdraw.pyx":53 * roundedRectangleRGBA(surface.surface, rect.x, rect.y, rect.x + rect.w, rect.y + rect.h, rad, c.r, c.g, c.b, c.a) * * def box(Surface surface, rect, color): # <<<<<<<<<<<<<< * cdef Color c = Color(color) * if not isinstance(rect, Rect): */ __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_11pygame_sdl2_7gfxdraw_11box, NULL, __pyx_n_s_pygame_sdl2_gfxdraw); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 53; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); if (PyDict_SetItem(__pyx_d, __pyx_n_s_box, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 53; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "pygame_sdl2/gfxdraw.pyx":59 * boxRGBA(surface.surface, rect.x, rect.y, rect.x + rect.w, rect.y + rect.h, c.r, c.g, c.b, c.a) * * def rounded_box(Surface surface, rect, rad, color): # <<<<<<<<<<<<<< * cdef Color c = Color(color) * if not isinstance(rect, Rect): */ __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_11pygame_sdl2_7gfxdraw_13rounded_box, NULL, __pyx_n_s_pygame_sdl2_gfxdraw); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 59; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); if (PyDict_SetItem(__pyx_d, __pyx_n_s_rounded_box, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 59; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "pygame_sdl2/gfxdraw.pyx":65 * roundedBoxRGBA(surface.surface, rect.x, rect.y, rect.x + rect.w, rect.y + rect.h, rad, c.r, c.g, c.b, c.a) * * def line(Surface surface, x1, y1, x2, y2, color): # <<<<<<<<<<<<<< * cdef Color c = Color(color) * lineRGBA(surface.surface, x1, y1, x2, y2, c.r, c.g, c.b, c.a) */ __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_11pygame_sdl2_7gfxdraw_15line, NULL, __pyx_n_s_pygame_sdl2_gfxdraw); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 65; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); if (PyDict_SetItem(__pyx_d, __pyx_n_s_line, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 65; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "pygame_sdl2/gfxdraw.pyx":69 * lineRGBA(surface.surface, x1, y1, x2, y2, c.r, c.g, c.b, c.a) * * def aaline(Surface surface, x1, y1, x2, y2, color): # <<<<<<<<<<<<<< * cdef Color c = Color(color) * aalineRGBA(surface.surface, x1, y1, x2, y2, c.r, c.g, c.b, c.a) */ __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_11pygame_sdl2_7gfxdraw_17aaline, NULL, __pyx_n_s_pygame_sdl2_gfxdraw); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 69; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); if (PyDict_SetItem(__pyx_d, __pyx_n_s_aaline, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 69; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "pygame_sdl2/gfxdraw.pyx":73 * aalineRGBA(surface.surface, x1, y1, x2, y2, c.r, c.g, c.b, c.a) * * def thick_line(Surface surface, x1, y1, x2, y2, width, color): # <<<<<<<<<<<<<< * cdef Color c = Color(color) * */ __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_11pygame_sdl2_7gfxdraw_19thick_line, NULL, __pyx_n_s_pygame_sdl2_gfxdraw); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 73; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); if (PyDict_SetItem(__pyx_d, __pyx_n_s_thick_line, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 73; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "pygame_sdl2/gfxdraw.pyx":90 * thickLineRGBA(surface.surface, x1int, y1int, x2int, y2int, width, c.r, c.g, c.b, c.a) * * def circle(Surface surface, x, y, r, color): # <<<<<<<<<<<<<< * cdef Color c = Color(color) * circleRGBA(surface.surface, x, y, r, c.r, c.g, c.b, c.a) */ __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_11pygame_sdl2_7gfxdraw_21circle, NULL, __pyx_n_s_pygame_sdl2_gfxdraw); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 90; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); if (PyDict_SetItem(__pyx_d, __pyx_n_s_circle, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 90; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "pygame_sdl2/gfxdraw.pyx":94 * circleRGBA(surface.surface, x, y, r, c.r, c.g, c.b, c.a) * * def arc(Surface surface, x, y, r, start, end, color): # <<<<<<<<<<<<<< * cdef Color c = Color(color) * arcRGBA(surface.surface, x, y, r, start, end, c.r, c.g, c.b, c.a) */ __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_11pygame_sdl2_7gfxdraw_23arc, NULL, __pyx_n_s_pygame_sdl2_gfxdraw); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 94; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); if (PyDict_SetItem(__pyx_d, __pyx_n_s_arc, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 94; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "pygame_sdl2/gfxdraw.pyx":98 * arcRGBA(surface.surface, x, y, r, start, end, c.r, c.g, c.b, c.a) * * def aacircle(Surface surface, x, y, r, color): # <<<<<<<<<<<<<< * cdef Color c = Color(color) * aacircleRGBA(surface.surface, x, y, r, c.r, c.g, c.b, c.a) */ __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_11pygame_sdl2_7gfxdraw_25aacircle, NULL, __pyx_n_s_pygame_sdl2_gfxdraw); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 98; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); if (PyDict_SetItem(__pyx_d, __pyx_n_s_aacircle, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 98; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "pygame_sdl2/gfxdraw.pyx":102 * aacircleRGBA(surface.surface, x, y, r, c.r, c.g, c.b, c.a) * * def filled_circle(Surface surface, x, y, r, color): # <<<<<<<<<<<<<< * cdef Color c = Color(color) * filledCircleRGBA(surface.surface, x, y, r, c.r, c.g, c.b, c.a) */ __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_11pygame_sdl2_7gfxdraw_27filled_circle, NULL, __pyx_n_s_pygame_sdl2_gfxdraw); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 102; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); if (PyDict_SetItem(__pyx_d, __pyx_n_s_filled_circle, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 102; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "pygame_sdl2/gfxdraw.pyx":106 * filledCircleRGBA(surface.surface, x, y, r, c.r, c.g, c.b, c.a) * * def ellipse(Surface surface, x, y, rx, ry, color): # <<<<<<<<<<<<<< * cdef Color c = Color(color) * ellipseRGBA(surface.surface, x, y, rx, ry, c.r, c.g, c.b, c.a) */ __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_11pygame_sdl2_7gfxdraw_29ellipse, NULL, __pyx_n_s_pygame_sdl2_gfxdraw); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 106; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); if (PyDict_SetItem(__pyx_d, __pyx_n_s_ellipse, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 106; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "pygame_sdl2/gfxdraw.pyx":110 * ellipseRGBA(surface.surface, x, y, rx, ry, c.r, c.g, c.b, c.a) * * def aaellipse(Surface surface, x, y, rx, ry, color): # <<<<<<<<<<<<<< * cdef Color c = Color(color) * aaellipseRGBA(surface.surface, x, y, rx, ry, c.r, c.g, c.b, c.a) */ __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_11pygame_sdl2_7gfxdraw_31aaellipse, NULL, __pyx_n_s_pygame_sdl2_gfxdraw); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 110; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); if (PyDict_SetItem(__pyx_d, __pyx_n_s_aaellipse, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 110; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "pygame_sdl2/gfxdraw.pyx":114 * aaellipseRGBA(surface.surface, x, y, rx, ry, c.r, c.g, c.b, c.a) * * def filled_ellipse(Surface surface, x, y, rx, ry, color): # <<<<<<<<<<<<<< * cdef Color c = Color(color) * filledEllipseRGBA(surface.surface, x, y, rx, ry, c.r, c.g, c.b, c.a) */ __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_11pygame_sdl2_7gfxdraw_33filled_ellipse, NULL, __pyx_n_s_pygame_sdl2_gfxdraw); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 114; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); if (PyDict_SetItem(__pyx_d, __pyx_n_s_filled_ellipse, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 114; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "pygame_sdl2/gfxdraw.pyx":118 * filledEllipseRGBA(surface.surface, x, y, rx, ry, c.r, c.g, c.b, c.a) * * def pie(Surface surface, x, y, r, start, end, color): # <<<<<<<<<<<<<< * cdef Color c = Color(color) * pieRGBA(surface.surface, x, y, r, start, end, c.r, c.g, c.b, c.a) */ __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_11pygame_sdl2_7gfxdraw_35pie, NULL, __pyx_n_s_pygame_sdl2_gfxdraw); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 118; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); if (PyDict_SetItem(__pyx_d, __pyx_n_s_pie, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 118; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "pygame_sdl2/gfxdraw.pyx":122 * pieRGBA(surface.surface, x, y, r, start, end, c.r, c.g, c.b, c.a) * * def filled_pie(Surface surface, x, y, r, start, end, color): # <<<<<<<<<<<<<< * cdef Color c = Color(color) * filledPieRGBA(surface.surface, x, y, r, start, end, c.r, c.g, c.b, c.a) */ __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_11pygame_sdl2_7gfxdraw_37filled_pie, NULL, __pyx_n_s_pygame_sdl2_gfxdraw); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 122; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); if (PyDict_SetItem(__pyx_d, __pyx_n_s_filled_pie, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 122; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "pygame_sdl2/gfxdraw.pyx":126 * filledPieRGBA(surface.surface, x, y, r, start, end, c.r, c.g, c.b, c.a) * * def trigon(Surface surface, x1, y1, x2, y2, x3, y3, color): # <<<<<<<<<<<<<< * cdef Color c = Color(color) * trigonRGBA(surface.surface, x1, y1, x2, y2, x3, y3, c.r, c.g, c.b, c.a) */ __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_11pygame_sdl2_7gfxdraw_39trigon, NULL, __pyx_n_s_pygame_sdl2_gfxdraw); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 126; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); if (PyDict_SetItem(__pyx_d, __pyx_n_s_trigon, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 126; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "pygame_sdl2/gfxdraw.pyx":130 * trigonRGBA(surface.surface, x1, y1, x2, y2, x3, y3, c.r, c.g, c.b, c.a) * * def aatrigon(Surface surface, x1, y1, x2, y2, x3, y3, color): # <<<<<<<<<<<<<< * cdef Color c = Color(color) * aatrigonRGBA(surface.surface, x1, y1, x2, y2, x3, y3, c.r, c.g, c.b, c.a) */ __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_11pygame_sdl2_7gfxdraw_41aatrigon, NULL, __pyx_n_s_pygame_sdl2_gfxdraw); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 130; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); if (PyDict_SetItem(__pyx_d, __pyx_n_s_aatrigon, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 130; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "pygame_sdl2/gfxdraw.pyx":134 * aatrigonRGBA(surface.surface, x1, y1, x2, y2, x3, y3, c.r, c.g, c.b, c.a) * * def filled_trigon(Surface surface, x1, y1, x2, y2, x3, y3, color): # <<<<<<<<<<<<<< * cdef Color c = Color(color) * filledTrigonRGBA(surface.surface, x1, y1, x2, y2, x3, y3, c.r, c.g, c.b, c.a) */ __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_11pygame_sdl2_7gfxdraw_43filled_trigon, NULL, __pyx_n_s_pygame_sdl2_gfxdraw); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 134; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); if (PyDict_SetItem(__pyx_d, __pyx_n_s_filled_trigon, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 134; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "pygame_sdl2/gfxdraw.pyx":138 * filledTrigonRGBA(surface.surface, x1, y1, x2, y2, x3, y3, c.r, c.g, c.b, c.a) * * def polygon(Surface surface, points, color): # <<<<<<<<<<<<<< * cdef Color c = Color(color) * cdef Sint16 *vx */ __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_11pygame_sdl2_7gfxdraw_45polygon, NULL, __pyx_n_s_pygame_sdl2_gfxdraw); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 138; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); if (PyDict_SetItem(__pyx_d, __pyx_n_s_polygon, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 138; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "pygame_sdl2/gfxdraw.pyx":151 * free(vy) * * def aapolygon(Surface surface, points, color): # <<<<<<<<<<<<<< * cdef Color c = Color(color) * cdef Sint16 *vx */ __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_11pygame_sdl2_7gfxdraw_47aapolygon, NULL, __pyx_n_s_pygame_sdl2_gfxdraw); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 151; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); if (PyDict_SetItem(__pyx_d, __pyx_n_s_aapolygon, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 151; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "pygame_sdl2/gfxdraw.pyx":164 * free(vy) * * def filled_polygon(Surface surface, points, color): # <<<<<<<<<<<<<< * cdef Color c = Color(color) * cdef Sint16 *vx */ __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_11pygame_sdl2_7gfxdraw_49filled_polygon, NULL, __pyx_n_s_pygame_sdl2_gfxdraw); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 164; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); if (PyDict_SetItem(__pyx_d, __pyx_n_s_filled_polygon, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 164; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "pygame_sdl2/gfxdraw.pyx":177 * free(vy) * * def textured_polygon(Surface surface, points, Surface texture not None, tx, ty): # <<<<<<<<<<<<<< * cdef Sint16 *vx * cdef Sint16 *vy */ __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_11pygame_sdl2_7gfxdraw_51textured_polygon, NULL, __pyx_n_s_pygame_sdl2_gfxdraw); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 177; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); if (PyDict_SetItem(__pyx_d, __pyx_n_s_textured_polygon, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 177; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "pygame_sdl2/gfxdraw.pyx":189 * free(vy) * * def bezier(Surface surface, points, steps, color): # <<<<<<<<<<<<<< * cdef Color c = Color(color) * cdef Sint16 *vx */ __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_11pygame_sdl2_7gfxdraw_53bezier, NULL, __pyx_n_s_pygame_sdl2_gfxdraw); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 189; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); if (PyDict_SetItem(__pyx_d, __pyx_n_s_bezier, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 189; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "pygame_sdl2/gfxdraw.pyx":1 * # Copyright 2014 Patrick Dawson # <<<<<<<<<<<<<< * # * # This software is provided 'as-is', without any express or implied */ __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); if (PyDict_SetItem(__pyx_d, __pyx_n_s_test, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /*--- Wrapped vars code ---*/ goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); if (__pyx_m) { if (__pyx_d) { __Pyx_AddTraceback("init pygame_sdl2.gfxdraw", __pyx_clineno, __pyx_lineno, __pyx_filename); } Py_DECREF(__pyx_m); __pyx_m = 0; } else if (!PyErr_Occurred()) { PyErr_SetString(PyExc_ImportError, "init pygame_sdl2.gfxdraw"); } __pyx_L0:; __Pyx_RefNannyFinishContext(); #if PY_MAJOR_VERSION < 3 return; #else return __pyx_m; #endif } /* --- Runtime support code --- */ #if CYTHON_REFNANNY static __Pyx_RefNannyAPIStruct *__Pyx_RefNannyImportAPI(const char *modname) { PyObject *m = NULL, *p = NULL; void *r = NULL; m = PyImport_ImportModule((char *)modname); if (!m) goto end; p = PyObject_GetAttrString(m, (char *)"RefNannyAPI"); if (!p) goto end; r = PyLong_AsVoidPtr(p); end: Py_XDECREF(p); Py_XDECREF(m); return (__Pyx_RefNannyAPIStruct *)r; } #endif static PyObject *__Pyx_GetBuiltinName(PyObject *name) { PyObject* result = __Pyx_PyObject_GetAttrStr(__pyx_b, name); if (unlikely(!result)) { PyErr_Format(PyExc_NameError, #if PY_MAJOR_VERSION >= 3 "name '%U' is not defined", name); #else "name '%.200s' is not defined", PyString_AS_STRING(name)); #endif } return result; } static void __Pyx_RaiseArgtupleInvalid( const char* func_name, int exact, Py_ssize_t num_min, Py_ssize_t num_max, Py_ssize_t num_found) { Py_ssize_t num_expected; const char *more_or_less; if (num_found < num_min) { num_expected = num_min; more_or_less = "at least"; } else { num_expected = num_max; more_or_less = "at most"; } if (exact) { more_or_less = "exactly"; } PyErr_Format(PyExc_TypeError, "%.200s() takes %.8s %" CYTHON_FORMAT_SSIZE_T "d positional argument%.1s (%" CYTHON_FORMAT_SSIZE_T "d given)", func_name, more_or_less, num_expected, (num_expected == 1) ? "" : "s", num_found); } static void __Pyx_RaiseDoubleKeywordsError( const char* func_name, PyObject* kw_name) { PyErr_Format(PyExc_TypeError, #if PY_MAJOR_VERSION >= 3 "%s() got multiple values for keyword argument '%U'", func_name, kw_name); #else "%s() got multiple values for keyword argument '%s'", func_name, PyString_AsString(kw_name)); #endif } static int __Pyx_ParseOptionalKeywords( PyObject *kwds, PyObject **argnames[], PyObject *kwds2, PyObject *values[], Py_ssize_t num_pos_args, const char* function_name) { PyObject *key = 0, *value = 0; Py_ssize_t pos = 0; PyObject*** name; PyObject*** first_kw_arg = argnames + num_pos_args; while (PyDict_Next(kwds, &pos, &key, &value)) { name = first_kw_arg; while (*name && (**name != key)) name++; if (*name) { values[name-argnames] = value; continue; } name = first_kw_arg; #if PY_MAJOR_VERSION < 3 if (likely(PyString_CheckExact(key)) || likely(PyString_Check(key))) { while (*name) { if ((CYTHON_COMPILING_IN_PYPY || PyString_GET_SIZE(**name) == PyString_GET_SIZE(key)) && _PyString_Eq(**name, key)) { values[name-argnames] = value; break; } name++; } if (*name) continue; else { PyObject*** argname = argnames; while (argname != first_kw_arg) { if ((**argname == key) || ( (CYTHON_COMPILING_IN_PYPY || PyString_GET_SIZE(**argname) == PyString_GET_SIZE(key)) && _PyString_Eq(**argname, key))) { goto arg_passed_twice; } argname++; } } } else #endif if (likely(PyUnicode_Check(key))) { while (*name) { int cmp = (**name == key) ? 0 : #if !CYTHON_COMPILING_IN_PYPY && PY_MAJOR_VERSION >= 3 (PyUnicode_GET_SIZE(**name) != PyUnicode_GET_SIZE(key)) ? 1 : #endif PyUnicode_Compare(**name, key); if (cmp < 0 && unlikely(PyErr_Occurred())) goto bad; if (cmp == 0) { values[name-argnames] = value; break; } name++; } if (*name) continue; else { PyObject*** argname = argnames; while (argname != first_kw_arg) { int cmp = (**argname == key) ? 0 : #if !CYTHON_COMPILING_IN_PYPY && PY_MAJOR_VERSION >= 3 (PyUnicode_GET_SIZE(**argname) != PyUnicode_GET_SIZE(key)) ? 1 : #endif PyUnicode_Compare(**argname, key); if (cmp < 0 && unlikely(PyErr_Occurred())) goto bad; if (cmp == 0) goto arg_passed_twice; argname++; } } } else goto invalid_keyword_type; if (kwds2) { if (unlikely(PyDict_SetItem(kwds2, key, value))) goto bad; } else { goto invalid_keyword; } } return 0; arg_passed_twice: __Pyx_RaiseDoubleKeywordsError(function_name, key); goto bad; invalid_keyword_type: PyErr_Format(PyExc_TypeError, "%.200s() keywords must be strings", function_name); goto bad; invalid_keyword: PyErr_Format(PyExc_TypeError, #if PY_MAJOR_VERSION < 3 "%.200s() got an unexpected keyword argument '%.200s'", function_name, PyString_AsString(key)); #else "%s() got an unexpected keyword argument '%U'", function_name, key); #endif bad: return -1; } static void __Pyx_RaiseArgumentTypeInvalid(const char* name, PyObject *obj, PyTypeObject *type) { PyErr_Format(PyExc_TypeError, "Argument '%.200s' has incorrect type (expected %.200s, got %.200s)", name, type->tp_name, Py_TYPE(obj)->tp_name); } static CYTHON_INLINE int __Pyx_ArgTypeTest(PyObject *obj, PyTypeObject *type, int none_allowed, const char *name, int exact) { if (unlikely(!type)) { PyErr_SetString(PyExc_SystemError, "Missing type object"); return 0; } if (none_allowed && obj == Py_None) return 1; else if (exact) { if (likely(Py_TYPE(obj) == type)) return 1; #if PY_MAJOR_VERSION == 2 else if ((type == &PyBaseString_Type) && likely(__Pyx_PyBaseString_CheckExact(obj))) return 1; #endif } else { if (likely(PyObject_TypeCheck(obj, type))) return 1; } __Pyx_RaiseArgumentTypeInvalid(name, obj, type); return 0; } #if CYTHON_COMPILING_IN_CPYTHON static CYTHON_INLINE PyObject* __Pyx_PyObject_Call(PyObject *func, PyObject *arg, PyObject *kw) { PyObject *result; ternaryfunc call = func->ob_type->tp_call; if (unlikely(!call)) return PyObject_Call(func, arg, kw); if (unlikely(Py_EnterRecursiveCall((char*)" while calling a Python object"))) return NULL; result = (*call)(func, arg, kw); Py_LeaveRecursiveCall(); if (unlikely(!result) && unlikely(!PyErr_Occurred())) { PyErr_SetString( PyExc_SystemError, "NULL result without error in PyObject_Call"); } return result; } #endif static CYTHON_INLINE PyObject *__Pyx_GetModuleGlobalName(PyObject *name) { PyObject *result; #if CYTHON_COMPILING_IN_CPYTHON result = PyDict_GetItem(__pyx_d, name); if (likely(result)) { Py_INCREF(result); } else { #else result = PyObject_GetItem(__pyx_d, name); if (!result) { PyErr_Clear(); #endif result = __Pyx_GetBuiltinName(name); } return result; } #if CYTHON_COMPILING_IN_CPYTHON static CYTHON_INLINE PyObject* __Pyx_PyObject_CallMethO(PyObject *func, PyObject *arg) { PyObject *self, *result; PyCFunction cfunc; cfunc = PyCFunction_GET_FUNCTION(func); self = PyCFunction_GET_SELF(func); if (unlikely(Py_EnterRecursiveCall((char*)" while calling a Python object"))) return NULL; result = cfunc(self, arg); Py_LeaveRecursiveCall(); if (unlikely(!result) && unlikely(!PyErr_Occurred())) { PyErr_SetString( PyExc_SystemError, "NULL result without error in PyObject_Call"); } return result; } #endif #if CYTHON_COMPILING_IN_CPYTHON static PyObject* __Pyx__PyObject_CallOneArg(PyObject *func, PyObject *arg) { PyObject *result; PyObject *args = PyTuple_New(1); if (unlikely(!args)) return NULL; Py_INCREF(arg); PyTuple_SET_ITEM(args, 0, arg); result = __Pyx_PyObject_Call(func, args, NULL); Py_DECREF(args); return result; } static CYTHON_INLINE PyObject* __Pyx_PyObject_CallOneArg(PyObject *func, PyObject *arg) { #ifdef __Pyx_CyFunction_USED if (likely(PyCFunction_Check(func) || PyObject_TypeCheck(func, __pyx_CyFunctionType))) { #else if (likely(PyCFunction_Check(func))) { #endif if (likely(PyCFunction_GET_FLAGS(func) & METH_O)) { return __Pyx_PyObject_CallMethO(func, arg); } } return __Pyx__PyObject_CallOneArg(func, arg); } #else static CYTHON_INLINE PyObject* __Pyx_PyObject_CallOneArg(PyObject *func, PyObject *arg) { PyObject *result; PyObject *args = PyTuple_Pack(1, arg); if (unlikely(!args)) return NULL; result = __Pyx_PyObject_Call(func, args, NULL); Py_DECREF(args); return result; } #endif static CYTHON_INLINE void __Pyx_RaiseTooManyValuesError(Py_ssize_t expected) { PyErr_Format(PyExc_ValueError, "too many values to unpack (expected %" CYTHON_FORMAT_SSIZE_T "d)", expected); } static CYTHON_INLINE void __Pyx_RaiseNeedMoreValuesError(Py_ssize_t index) { PyErr_Format(PyExc_ValueError, "need more than %" CYTHON_FORMAT_SSIZE_T "d value%.1s to unpack", index, (index == 1) ? "" : "s"); } static CYTHON_INLINE int __Pyx_IterFinish(void) { #if CYTHON_COMPILING_IN_CPYTHON PyThreadState *tstate = PyThreadState_GET(); PyObject* exc_type = tstate->curexc_type; if (unlikely(exc_type)) { if (likely(exc_type == PyExc_StopIteration) || PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration)) { PyObject *exc_value, *exc_tb; exc_value = tstate->curexc_value; exc_tb = tstate->curexc_traceback; tstate->curexc_type = 0; tstate->curexc_value = 0; tstate->curexc_traceback = 0; Py_DECREF(exc_type); Py_XDECREF(exc_value); Py_XDECREF(exc_tb); return 0; } else { return -1; } } return 0; #else if (unlikely(PyErr_Occurred())) { if (likely(PyErr_ExceptionMatches(PyExc_StopIteration))) { PyErr_Clear(); return 0; } else { return -1; } } return 0; #endif } static int __Pyx_IternextUnpackEndCheck(PyObject *retval, Py_ssize_t expected) { if (unlikely(retval)) { Py_DECREF(retval); __Pyx_RaiseTooManyValuesError(expected); return -1; } else { return __Pyx_IterFinish(); } return 0; } static void* __Pyx_GetVtable(PyObject *dict) { void* ptr; PyObject *ob = PyObject_GetItem(dict, __pyx_n_s_pyx_vtable); if (!ob) goto bad; #if PY_VERSION_HEX >= 0x02070000 ptr = PyCapsule_GetPointer(ob, 0); #else ptr = PyCObject_AsVoidPtr(ob); #endif if (!ptr && !PyErr_Occurred()) PyErr_SetString(PyExc_RuntimeError, "invalid vtable found for imported type"); Py_DECREF(ob); return ptr; bad: Py_XDECREF(ob); return NULL; } static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list, int level) { PyObject *empty_list = 0; PyObject *module = 0; PyObject *global_dict = 0; PyObject *empty_dict = 0; PyObject *list; #if PY_VERSION_HEX < 0x03030000 PyObject *py_import; py_import = __Pyx_PyObject_GetAttrStr(__pyx_b, __pyx_n_s_import); if (!py_import) goto bad; #endif if (from_list) list = from_list; else { empty_list = PyList_New(0); if (!empty_list) goto bad; list = empty_list; } global_dict = PyModule_GetDict(__pyx_m); if (!global_dict) goto bad; empty_dict = PyDict_New(); if (!empty_dict) goto bad; { #if PY_MAJOR_VERSION >= 3 if (level == -1) { if (strchr(__Pyx_MODULE_NAME, '.')) { #if PY_VERSION_HEX < 0x03030000 PyObject *py_level = PyInt_FromLong(1); if (!py_level) goto bad; module = PyObject_CallFunctionObjArgs(py_import, name, global_dict, empty_dict, list, py_level, NULL); Py_DECREF(py_level); #else module = PyImport_ImportModuleLevelObject( name, global_dict, empty_dict, list, 1); #endif if (!module) { if (!PyErr_ExceptionMatches(PyExc_ImportError)) goto bad; PyErr_Clear(); } } level = 0; } #endif if (!module) { #if PY_VERSION_HEX < 0x03030000 PyObject *py_level = PyInt_FromLong(level); if (!py_level) goto bad; module = PyObject_CallFunctionObjArgs(py_import, name, global_dict, empty_dict, list, py_level, NULL); Py_DECREF(py_level); #else module = PyImport_ImportModuleLevelObject( name, global_dict, empty_dict, list, level); #endif } } bad: #if PY_VERSION_HEX < 0x03030000 Py_XDECREF(py_import); #endif Py_XDECREF(empty_list); Py_XDECREF(empty_dict); return module; } static PyObject* __Pyx_ImportFrom(PyObject* module, PyObject* name) { PyObject* value = __Pyx_PyObject_GetAttrStr(module, name); if (unlikely(!value) && PyErr_ExceptionMatches(PyExc_AttributeError)) { PyErr_Format(PyExc_ImportError, #if PY_MAJOR_VERSION < 3 "cannot import name %.230s", PyString_AS_STRING(name)); #else "cannot import name %S", name); #endif } return value; } static int __pyx_bisect_code_objects(__Pyx_CodeObjectCacheEntry* entries, int count, int code_line) { int start = 0, mid = 0, end = count - 1; if (end >= 0 && code_line > entries[end].code_line) { return count; } while (start < end) { mid = start + (end - start) / 2; if (code_line < entries[mid].code_line) { end = mid; } else if (code_line > entries[mid].code_line) { start = mid + 1; } else { return mid; } } if (code_line <= entries[mid].code_line) { return mid; } else { return mid + 1; } } static PyCodeObject *__pyx_find_code_object(int code_line) { PyCodeObject* code_object; int pos; if (unlikely(!code_line) || unlikely(!__pyx_code_cache.entries)) { return NULL; } pos = __pyx_bisect_code_objects(__pyx_code_cache.entries, __pyx_code_cache.count, code_line); if (unlikely(pos >= __pyx_code_cache.count) || unlikely(__pyx_code_cache.entries[pos].code_line != code_line)) { return NULL; } code_object = __pyx_code_cache.entries[pos].code_object; Py_INCREF(code_object); return code_object; } static void __pyx_insert_code_object(int code_line, PyCodeObject* code_object) { int pos, i; __Pyx_CodeObjectCacheEntry* entries = __pyx_code_cache.entries; if (unlikely(!code_line)) { return; } if (unlikely(!entries)) { entries = (__Pyx_CodeObjectCacheEntry*)PyMem_Malloc(64*sizeof(__Pyx_CodeObjectCacheEntry)); if (likely(entries)) { __pyx_code_cache.entries = entries; __pyx_code_cache.max_count = 64; __pyx_code_cache.count = 1; entries[0].code_line = code_line; entries[0].code_object = code_object; Py_INCREF(code_object); } return; } pos = __pyx_bisect_code_objects(__pyx_code_cache.entries, __pyx_code_cache.count, code_line); if ((pos < __pyx_code_cache.count) && unlikely(__pyx_code_cache.entries[pos].code_line == code_line)) { PyCodeObject* tmp = entries[pos].code_object; entries[pos].code_object = code_object; Py_DECREF(tmp); return; } if (__pyx_code_cache.count == __pyx_code_cache.max_count) { int new_max = __pyx_code_cache.max_count + 64; entries = (__Pyx_CodeObjectCacheEntry*)PyMem_Realloc( __pyx_code_cache.entries, (size_t)new_max*sizeof(__Pyx_CodeObjectCacheEntry)); if (unlikely(!entries)) { return; } __pyx_code_cache.entries = entries; __pyx_code_cache.max_count = new_max; } for (i=__pyx_code_cache.count; i>pos; i--) { entries[i] = entries[i-1]; } entries[pos].code_line = code_line; entries[pos].code_object = code_object; __pyx_code_cache.count++; Py_INCREF(code_object); } #include "compile.h" #include "frameobject.h" #include "traceback.h" static PyCodeObject* __Pyx_CreateCodeObjectForTraceback( const char *funcname, int c_line, int py_line, const char *filename) { PyCodeObject *py_code = 0; PyObject *py_srcfile = 0; PyObject *py_funcname = 0; #if PY_MAJOR_VERSION < 3 py_srcfile = PyString_FromString(filename); #else py_srcfile = PyUnicode_FromString(filename); #endif if (!py_srcfile) goto bad; if (c_line) { #if PY_MAJOR_VERSION < 3 py_funcname = PyString_FromFormat( "%s (%s:%d)", funcname, __pyx_cfilenm, c_line); #else py_funcname = PyUnicode_FromFormat( "%s (%s:%d)", funcname, __pyx_cfilenm, c_line); #endif } else { #if PY_MAJOR_VERSION < 3 py_funcname = PyString_FromString(funcname); #else py_funcname = PyUnicode_FromString(funcname); #endif } if (!py_funcname) goto bad; py_code = __Pyx_PyCode_New( 0, 0, 0, 0, 0, __pyx_empty_bytes, /*PyObject *code,*/ __pyx_empty_tuple, /*PyObject *consts,*/ __pyx_empty_tuple, /*PyObject *names,*/ __pyx_empty_tuple, /*PyObject *varnames,*/ __pyx_empty_tuple, /*PyObject *freevars,*/ __pyx_empty_tuple, /*PyObject *cellvars,*/ py_srcfile, /*PyObject *filename,*/ py_funcname, /*PyObject *name,*/ py_line, __pyx_empty_bytes /*PyObject *lnotab*/ ); Py_DECREF(py_srcfile); Py_DECREF(py_funcname); return py_code; bad: Py_XDECREF(py_srcfile); Py_XDECREF(py_funcname); return NULL; } static void __Pyx_AddTraceback(const char *funcname, int c_line, int py_line, const char *filename) { PyCodeObject *py_code = 0; PyFrameObject *py_frame = 0; py_code = __pyx_find_code_object(c_line ? c_line : py_line); if (!py_code) { py_code = __Pyx_CreateCodeObjectForTraceback( funcname, c_line, py_line, filename); if (!py_code) goto bad; __pyx_insert_code_object(c_line ? c_line : py_line, py_code); } py_frame = PyFrame_New( PyThreadState_GET(), /*PyThreadState *tstate,*/ py_code, /*PyCodeObject *code,*/ __pyx_d, /*PyObject *globals,*/ 0 /*PyObject *locals*/ ); if (!py_frame) goto bad; py_frame->f_lineno = py_line; PyTraceBack_Here(py_frame); bad: Py_XDECREF(py_code); Py_XDECREF(py_frame); } #define __PYX_VERIFY_RETURN_INT(target_type, func_type, func_value)\ __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, 0) #define __PYX_VERIFY_RETURN_INT_EXC(target_type, func_type, func_value)\ __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, 1) #define __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, exc)\ {\ func_type value = func_value;\ if (sizeof(target_type) < sizeof(func_type)) {\ if (unlikely(value != (func_type) (target_type) value)) {\ func_type zero = 0;\ if (exc && unlikely(value == (func_type)-1 && PyErr_Occurred()))\ return (target_type) -1;\ if (is_unsigned && unlikely(value < zero))\ goto raise_neg_overflow;\ else\ goto raise_overflow;\ }\ }\ return (target_type) value;\ } #if CYTHON_USE_PYLONG_INTERNALS #include "longintrepr.h" #endif static CYTHON_INLINE int16_t __Pyx_PyInt_As_int16_t(PyObject *x) { const int16_t neg_one = (int16_t) -1, const_zero = (int16_t) 0; const int is_unsigned = neg_one > const_zero; #if PY_MAJOR_VERSION < 3 if (likely(PyInt_Check(x))) { if (sizeof(int16_t) < sizeof(long)) { __PYX_VERIFY_RETURN_INT(int16_t, long, PyInt_AS_LONG(x)) } else { long val = PyInt_AS_LONG(x); if (is_unsigned && unlikely(val < 0)) { goto raise_neg_overflow; } return (int16_t) val; } } else #endif if (likely(PyLong_Check(x))) { if (is_unsigned) { #if CYTHON_USE_PYLONG_INTERNALS const digit* digits = ((PyLongObject*)x)->ob_digit; switch (Py_SIZE(x)) { case 0: return (int16_t) 0; case 1: __PYX_VERIFY_RETURN_INT(int16_t, digit, digits[0]) case 2: if (8 * sizeof(int16_t) > 1 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(int16_t, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(int16_t) >= 2 * PyLong_SHIFT) { return (int16_t) (((((int16_t)digits[1]) << PyLong_SHIFT) | (int16_t)digits[0])); } } break; case 3: if (8 * sizeof(int16_t) > 2 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(int16_t, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(int16_t) >= 3 * PyLong_SHIFT) { return (int16_t) (((((((int16_t)digits[2]) << PyLong_SHIFT) | (int16_t)digits[1]) << PyLong_SHIFT) | (int16_t)digits[0])); } } break; case 4: if (8 * sizeof(int16_t) > 3 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(int16_t, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(int16_t) >= 4 * PyLong_SHIFT) { return (int16_t) (((((((((int16_t)digits[3]) << PyLong_SHIFT) | (int16_t)digits[2]) << PyLong_SHIFT) | (int16_t)digits[1]) << PyLong_SHIFT) | (int16_t)digits[0])); } } break; } #endif #if CYTHON_COMPILING_IN_CPYTHON if (unlikely(Py_SIZE(x) < 0)) { goto raise_neg_overflow; } #else { int result = PyObject_RichCompareBool(x, Py_False, Py_LT); if (unlikely(result < 0)) return (int16_t) -1; if (unlikely(result == 1)) goto raise_neg_overflow; } #endif if (sizeof(int16_t) <= sizeof(unsigned long)) { __PYX_VERIFY_RETURN_INT_EXC(int16_t, unsigned long, PyLong_AsUnsignedLong(x)) } else if (sizeof(int16_t) <= sizeof(unsigned PY_LONG_LONG)) { __PYX_VERIFY_RETURN_INT_EXC(int16_t, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x)) } } else { #if CYTHON_USE_PYLONG_INTERNALS const digit* digits = ((PyLongObject*)x)->ob_digit; switch (Py_SIZE(x)) { case 0: return (int16_t) 0; case -1: __PYX_VERIFY_RETURN_INT(int16_t, sdigit, (sdigit) (-(sdigit)digits[0])) case 1: __PYX_VERIFY_RETURN_INT(int16_t, digit, +digits[0]) case -2: if (8 * sizeof(int16_t) - 1 > 1 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(int16_t, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(int16_t) - 1 > 2 * PyLong_SHIFT) { return (int16_t) (((int16_t)-1)*(((((int16_t)digits[1]) << PyLong_SHIFT) | (int16_t)digits[0]))); } } break; case 2: if (8 * sizeof(int16_t) > 1 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(int16_t, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(int16_t) - 1 > 2 * PyLong_SHIFT) { return (int16_t) ((((((int16_t)digits[1]) << PyLong_SHIFT) | (int16_t)digits[0]))); } } break; case -3: if (8 * sizeof(int16_t) - 1 > 2 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(int16_t, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(int16_t) - 1 > 3 * PyLong_SHIFT) { return (int16_t) (((int16_t)-1)*(((((((int16_t)digits[2]) << PyLong_SHIFT) | (int16_t)digits[1]) << PyLong_SHIFT) | (int16_t)digits[0]))); } } break; case 3: if (8 * sizeof(int16_t) > 2 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(int16_t, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(int16_t) - 1 > 3 * PyLong_SHIFT) { return (int16_t) ((((((((int16_t)digits[2]) << PyLong_SHIFT) | (int16_t)digits[1]) << PyLong_SHIFT) | (int16_t)digits[0]))); } } break; case -4: if (8 * sizeof(int16_t) - 1 > 3 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(int16_t, long, -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(int16_t) - 1 > 4 * PyLong_SHIFT) { return (int16_t) (((int16_t)-1)*(((((((((int16_t)digits[3]) << PyLong_SHIFT) | (int16_t)digits[2]) << PyLong_SHIFT) | (int16_t)digits[1]) << PyLong_SHIFT) | (int16_t)digits[0]))); } } break; case 4: if (8 * sizeof(int16_t) > 3 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(int16_t, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(int16_t) - 1 > 4 * PyLong_SHIFT) { return (int16_t) ((((((((((int16_t)digits[3]) << PyLong_SHIFT) | (int16_t)digits[2]) << PyLong_SHIFT) | (int16_t)digits[1]) << PyLong_SHIFT) | (int16_t)digits[0]))); } } break; } #endif if (sizeof(int16_t) <= sizeof(long)) { __PYX_VERIFY_RETURN_INT_EXC(int16_t, long, PyLong_AsLong(x)) } else if (sizeof(int16_t) <= sizeof(PY_LONG_LONG)) { __PYX_VERIFY_RETURN_INT_EXC(int16_t, PY_LONG_LONG, PyLong_AsLongLong(x)) } } { #if CYTHON_COMPILING_IN_PYPY && !defined(_PyLong_AsByteArray) PyErr_SetString(PyExc_RuntimeError, "_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers"); #else int16_t val; PyObject *v = __Pyx_PyNumber_Int(x); #if PY_MAJOR_VERSION < 3 if (likely(v) && !PyLong_Check(v)) { PyObject *tmp = v; v = PyNumber_Long(tmp); Py_DECREF(tmp); } #endif if (likely(v)) { int one = 1; int is_little = (int)*(unsigned char *)&one; unsigned char *bytes = (unsigned char *)&val; int ret = _PyLong_AsByteArray((PyLongObject *)v, bytes, sizeof(val), is_little, !is_unsigned); Py_DECREF(v); if (likely(!ret)) return val; } #endif return (int16_t) -1; } } else { int16_t val; PyObject *tmp = __Pyx_PyNumber_Int(x); if (!tmp) return (int16_t) -1; val = __Pyx_PyInt_As_int16_t(tmp); Py_DECREF(tmp); return val; } raise_overflow: PyErr_SetString(PyExc_OverflowError, "value too large to convert to int16_t"); return (int16_t) -1; raise_neg_overflow: PyErr_SetString(PyExc_OverflowError, "can't convert negative value to int16_t"); return (int16_t) -1; } static CYTHON_INLINE int __Pyx_PyInt_As_int(PyObject *x) { const int neg_one = (int) -1, const_zero = (int) 0; const int is_unsigned = neg_one > const_zero; #if PY_MAJOR_VERSION < 3 if (likely(PyInt_Check(x))) { if (sizeof(int) < sizeof(long)) { __PYX_VERIFY_RETURN_INT(int, long, PyInt_AS_LONG(x)) } else { long val = PyInt_AS_LONG(x); if (is_unsigned && unlikely(val < 0)) { goto raise_neg_overflow; } return (int) val; } } else #endif if (likely(PyLong_Check(x))) { if (is_unsigned) { #if CYTHON_USE_PYLONG_INTERNALS const digit* digits = ((PyLongObject*)x)->ob_digit; switch (Py_SIZE(x)) { case 0: return (int) 0; case 1: __PYX_VERIFY_RETURN_INT(int, digit, digits[0]) case 2: if (8 * sizeof(int) > 1 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(int) >= 2 * PyLong_SHIFT) { return (int) (((((int)digits[1]) << PyLong_SHIFT) | (int)digits[0])); } } break; case 3: if (8 * sizeof(int) > 2 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(int) >= 3 * PyLong_SHIFT) { return (int) (((((((int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0])); } } break; case 4: if (8 * sizeof(int) > 3 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(int) >= 4 * PyLong_SHIFT) { return (int) (((((((((int)digits[3]) << PyLong_SHIFT) | (int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0])); } } break; } #endif #if CYTHON_COMPILING_IN_CPYTHON if (unlikely(Py_SIZE(x) < 0)) { goto raise_neg_overflow; } #else { int result = PyObject_RichCompareBool(x, Py_False, Py_LT); if (unlikely(result < 0)) return (int) -1; if (unlikely(result == 1)) goto raise_neg_overflow; } #endif if (sizeof(int) <= sizeof(unsigned long)) { __PYX_VERIFY_RETURN_INT_EXC(int, unsigned long, PyLong_AsUnsignedLong(x)) } else if (sizeof(int) <= sizeof(unsigned PY_LONG_LONG)) { __PYX_VERIFY_RETURN_INT_EXC(int, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x)) } } else { #if CYTHON_USE_PYLONG_INTERNALS const digit* digits = ((PyLongObject*)x)->ob_digit; switch (Py_SIZE(x)) { case 0: return (int) 0; case -1: __PYX_VERIFY_RETURN_INT(int, sdigit, (sdigit) (-(sdigit)digits[0])) case 1: __PYX_VERIFY_RETURN_INT(int, digit, +digits[0]) case -2: if (8 * sizeof(int) - 1 > 1 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(int, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(int) - 1 > 2 * PyLong_SHIFT) { return (int) (((int)-1)*(((((int)digits[1]) << PyLong_SHIFT) | (int)digits[0]))); } } break; case 2: if (8 * sizeof(int) > 1 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(int) - 1 > 2 * PyLong_SHIFT) { return (int) ((((((int)digits[1]) << PyLong_SHIFT) | (int)digits[0]))); } } break; case -3: if (8 * sizeof(int) - 1 > 2 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(int, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(int) - 1 > 3 * PyLong_SHIFT) { return (int) (((int)-1)*(((((((int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0]))); } } break; case 3: if (8 * sizeof(int) > 2 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(int) - 1 > 3 * PyLong_SHIFT) { return (int) ((((((((int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0]))); } } break; case -4: if (8 * sizeof(int) - 1 > 3 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(int, long, -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(int) - 1 > 4 * PyLong_SHIFT) { return (int) (((int)-1)*(((((((((int)digits[3]) << PyLong_SHIFT) | (int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0]))); } } break; case 4: if (8 * sizeof(int) > 3 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(int) - 1 > 4 * PyLong_SHIFT) { return (int) ((((((((((int)digits[3]) << PyLong_SHIFT) | (int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0]))); } } break; } #endif if (sizeof(int) <= sizeof(long)) { __PYX_VERIFY_RETURN_INT_EXC(int, long, PyLong_AsLong(x)) } else if (sizeof(int) <= sizeof(PY_LONG_LONG)) { __PYX_VERIFY_RETURN_INT_EXC(int, PY_LONG_LONG, PyLong_AsLongLong(x)) } } { #if CYTHON_COMPILING_IN_PYPY && !defined(_PyLong_AsByteArray) PyErr_SetString(PyExc_RuntimeError, "_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers"); #else int val; PyObject *v = __Pyx_PyNumber_Int(x); #if PY_MAJOR_VERSION < 3 if (likely(v) && !PyLong_Check(v)) { PyObject *tmp = v; v = PyNumber_Long(tmp); Py_DECREF(tmp); } #endif if (likely(v)) { int one = 1; int is_little = (int)*(unsigned char *)&one; unsigned char *bytes = (unsigned char *)&val; int ret = _PyLong_AsByteArray((PyLongObject *)v, bytes, sizeof(val), is_little, !is_unsigned); Py_DECREF(v); if (likely(!ret)) return val; } #endif return (int) -1; } } else { int val; PyObject *tmp = __Pyx_PyNumber_Int(x); if (!tmp) return (int) -1; val = __Pyx_PyInt_As_int(tmp); Py_DECREF(tmp); return val; } raise_overflow: PyErr_SetString(PyExc_OverflowError, "value too large to convert to int"); return (int) -1; raise_neg_overflow: PyErr_SetString(PyExc_OverflowError, "can't convert negative value to int"); return (int) -1; } static CYTHON_INLINE uint8_t __Pyx_PyInt_As_uint8_t(PyObject *x) { const uint8_t neg_one = (uint8_t) -1, const_zero = (uint8_t) 0; const int is_unsigned = neg_one > const_zero; #if PY_MAJOR_VERSION < 3 if (likely(PyInt_Check(x))) { if (sizeof(uint8_t) < sizeof(long)) { __PYX_VERIFY_RETURN_INT(uint8_t, long, PyInt_AS_LONG(x)) } else { long val = PyInt_AS_LONG(x); if (is_unsigned && unlikely(val < 0)) { goto raise_neg_overflow; } return (uint8_t) val; } } else #endif if (likely(PyLong_Check(x))) { if (is_unsigned) { #if CYTHON_USE_PYLONG_INTERNALS const digit* digits = ((PyLongObject*)x)->ob_digit; switch (Py_SIZE(x)) { case 0: return (uint8_t) 0; case 1: __PYX_VERIFY_RETURN_INT(uint8_t, digit, digits[0]) case 2: if (8 * sizeof(uint8_t) > 1 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(uint8_t, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(uint8_t) >= 2 * PyLong_SHIFT) { return (uint8_t) (((((uint8_t)digits[1]) << PyLong_SHIFT) | (uint8_t)digits[0])); } } break; case 3: if (8 * sizeof(uint8_t) > 2 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(uint8_t, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(uint8_t) >= 3 * PyLong_SHIFT) { return (uint8_t) (((((((uint8_t)digits[2]) << PyLong_SHIFT) | (uint8_t)digits[1]) << PyLong_SHIFT) | (uint8_t)digits[0])); } } break; case 4: if (8 * sizeof(uint8_t) > 3 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(uint8_t, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(uint8_t) >= 4 * PyLong_SHIFT) { return (uint8_t) (((((((((uint8_t)digits[3]) << PyLong_SHIFT) | (uint8_t)digits[2]) << PyLong_SHIFT) | (uint8_t)digits[1]) << PyLong_SHIFT) | (uint8_t)digits[0])); } } break; } #endif #if CYTHON_COMPILING_IN_CPYTHON if (unlikely(Py_SIZE(x) < 0)) { goto raise_neg_overflow; } #else { int result = PyObject_RichCompareBool(x, Py_False, Py_LT); if (unlikely(result < 0)) return (uint8_t) -1; if (unlikely(result == 1)) goto raise_neg_overflow; } #endif if (sizeof(uint8_t) <= sizeof(unsigned long)) { __PYX_VERIFY_RETURN_INT_EXC(uint8_t, unsigned long, PyLong_AsUnsignedLong(x)) } else if (sizeof(uint8_t) <= sizeof(unsigned PY_LONG_LONG)) { __PYX_VERIFY_RETURN_INT_EXC(uint8_t, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x)) } } else { #if CYTHON_USE_PYLONG_INTERNALS const digit* digits = ((PyLongObject*)x)->ob_digit; switch (Py_SIZE(x)) { case 0: return (uint8_t) 0; case -1: __PYX_VERIFY_RETURN_INT(uint8_t, sdigit, (sdigit) (-(sdigit)digits[0])) case 1: __PYX_VERIFY_RETURN_INT(uint8_t, digit, +digits[0]) case -2: if (8 * sizeof(uint8_t) - 1 > 1 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(uint8_t, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(uint8_t) - 1 > 2 * PyLong_SHIFT) { return (uint8_t) (((uint8_t)-1)*(((((uint8_t)digits[1]) << PyLong_SHIFT) | (uint8_t)digits[0]))); } } break; case 2: if (8 * sizeof(uint8_t) > 1 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(uint8_t, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(uint8_t) - 1 > 2 * PyLong_SHIFT) { return (uint8_t) ((((((uint8_t)digits[1]) << PyLong_SHIFT) | (uint8_t)digits[0]))); } } break; case -3: if (8 * sizeof(uint8_t) - 1 > 2 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(uint8_t, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(uint8_t) - 1 > 3 * PyLong_SHIFT) { return (uint8_t) (((uint8_t)-1)*(((((((uint8_t)digits[2]) << PyLong_SHIFT) | (uint8_t)digits[1]) << PyLong_SHIFT) | (uint8_t)digits[0]))); } } break; case 3: if (8 * sizeof(uint8_t) > 2 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(uint8_t, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(uint8_t) - 1 > 3 * PyLong_SHIFT) { return (uint8_t) ((((((((uint8_t)digits[2]) << PyLong_SHIFT) | (uint8_t)digits[1]) << PyLong_SHIFT) | (uint8_t)digits[0]))); } } break; case -4: if (8 * sizeof(uint8_t) - 1 > 3 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(uint8_t, long, -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(uint8_t) - 1 > 4 * PyLong_SHIFT) { return (uint8_t) (((uint8_t)-1)*(((((((((uint8_t)digits[3]) << PyLong_SHIFT) | (uint8_t)digits[2]) << PyLong_SHIFT) | (uint8_t)digits[1]) << PyLong_SHIFT) | (uint8_t)digits[0]))); } } break; case 4: if (8 * sizeof(uint8_t) > 3 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(uint8_t, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(uint8_t) - 1 > 4 * PyLong_SHIFT) { return (uint8_t) ((((((((((uint8_t)digits[3]) << PyLong_SHIFT) | (uint8_t)digits[2]) << PyLong_SHIFT) | (uint8_t)digits[1]) << PyLong_SHIFT) | (uint8_t)digits[0]))); } } break; } #endif if (sizeof(uint8_t) <= sizeof(long)) { __PYX_VERIFY_RETURN_INT_EXC(uint8_t, long, PyLong_AsLong(x)) } else if (sizeof(uint8_t) <= sizeof(PY_LONG_LONG)) { __PYX_VERIFY_RETURN_INT_EXC(uint8_t, PY_LONG_LONG, PyLong_AsLongLong(x)) } } { #if CYTHON_COMPILING_IN_PYPY && !defined(_PyLong_AsByteArray) PyErr_SetString(PyExc_RuntimeError, "_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers"); #else uint8_t val; PyObject *v = __Pyx_PyNumber_Int(x); #if PY_MAJOR_VERSION < 3 if (likely(v) && !PyLong_Check(v)) { PyObject *tmp = v; v = PyNumber_Long(tmp); Py_DECREF(tmp); } #endif if (likely(v)) { int one = 1; int is_little = (int)*(unsigned char *)&one; unsigned char *bytes = (unsigned char *)&val; int ret = _PyLong_AsByteArray((PyLongObject *)v, bytes, sizeof(val), is_little, !is_unsigned); Py_DECREF(v); if (likely(!ret)) return val; } #endif return (uint8_t) -1; } } else { uint8_t val; PyObject *tmp = __Pyx_PyNumber_Int(x); if (!tmp) return (uint8_t) -1; val = __Pyx_PyInt_As_uint8_t(tmp); Py_DECREF(tmp); return val; } raise_overflow: PyErr_SetString(PyExc_OverflowError, "value too large to convert to uint8_t"); return (uint8_t) -1; raise_neg_overflow: PyErr_SetString(PyExc_OverflowError, "can't convert negative value to uint8_t"); return (uint8_t) -1; } static CYTHON_INLINE PyObject* __Pyx_PyInt_From_long(long value) { const long neg_one = (long) -1, const_zero = (long) 0; const int is_unsigned = neg_one > const_zero; if (is_unsigned) { if (sizeof(long) < sizeof(long)) { return PyInt_FromLong((long) value); } else if (sizeof(long) <= sizeof(unsigned long)) { return PyLong_FromUnsignedLong((unsigned long) value); } else if (sizeof(long) <= sizeof(unsigned PY_LONG_LONG)) { return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value); } } else { if (sizeof(long) <= sizeof(long)) { return PyInt_FromLong((long) value); } else if (sizeof(long) <= sizeof(PY_LONG_LONG)) { return PyLong_FromLongLong((PY_LONG_LONG) value); } } { int one = 1; int little = (int)*(unsigned char *)&one; unsigned char *bytes = (unsigned char *)&value; return _PyLong_FromByteArray(bytes, sizeof(long), little, !is_unsigned); } } static CYTHON_INLINE long __Pyx_PyInt_As_long(PyObject *x) { const long neg_one = (long) -1, const_zero = (long) 0; const int is_unsigned = neg_one > const_zero; #if PY_MAJOR_VERSION < 3 if (likely(PyInt_Check(x))) { if (sizeof(long) < sizeof(long)) { __PYX_VERIFY_RETURN_INT(long, long, PyInt_AS_LONG(x)) } else { long val = PyInt_AS_LONG(x); if (is_unsigned && unlikely(val < 0)) { goto raise_neg_overflow; } return (long) val; } } else #endif if (likely(PyLong_Check(x))) { if (is_unsigned) { #if CYTHON_USE_PYLONG_INTERNALS const digit* digits = ((PyLongObject*)x)->ob_digit; switch (Py_SIZE(x)) { case 0: return (long) 0; case 1: __PYX_VERIFY_RETURN_INT(long, digit, digits[0]) case 2: if (8 * sizeof(long) > 1 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(long) >= 2 * PyLong_SHIFT) { return (long) (((((long)digits[1]) << PyLong_SHIFT) | (long)digits[0])); } } break; case 3: if (8 * sizeof(long) > 2 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(long) >= 3 * PyLong_SHIFT) { return (long) (((((((long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0])); } } break; case 4: if (8 * sizeof(long) > 3 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(long) >= 4 * PyLong_SHIFT) { return (long) (((((((((long)digits[3]) << PyLong_SHIFT) | (long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0])); } } break; } #endif #if CYTHON_COMPILING_IN_CPYTHON if (unlikely(Py_SIZE(x) < 0)) { goto raise_neg_overflow; } #else { int result = PyObject_RichCompareBool(x, Py_False, Py_LT); if (unlikely(result < 0)) return (long) -1; if (unlikely(result == 1)) goto raise_neg_overflow; } #endif if (sizeof(long) <= sizeof(unsigned long)) { __PYX_VERIFY_RETURN_INT_EXC(long, unsigned long, PyLong_AsUnsignedLong(x)) } else if (sizeof(long) <= sizeof(unsigned PY_LONG_LONG)) { __PYX_VERIFY_RETURN_INT_EXC(long, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x)) } } else { #if CYTHON_USE_PYLONG_INTERNALS const digit* digits = ((PyLongObject*)x)->ob_digit; switch (Py_SIZE(x)) { case 0: return (long) 0; case -1: __PYX_VERIFY_RETURN_INT(long, sdigit, (sdigit) (-(sdigit)digits[0])) case 1: __PYX_VERIFY_RETURN_INT(long, digit, +digits[0]) case -2: if (8 * sizeof(long) - 1 > 1 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(long, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) { return (long) (((long)-1)*(((((long)digits[1]) << PyLong_SHIFT) | (long)digits[0]))); } } break; case 2: if (8 * sizeof(long) > 1 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) { return (long) ((((((long)digits[1]) << PyLong_SHIFT) | (long)digits[0]))); } } break; case -3: if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(long, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) { return (long) (((long)-1)*(((((((long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0]))); } } break; case 3: if (8 * sizeof(long) > 2 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) { return (long) ((((((((long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0]))); } } break; case -4: if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(long, long, -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(long) - 1 > 4 * PyLong_SHIFT) { return (long) (((long)-1)*(((((((((long)digits[3]) << PyLong_SHIFT) | (long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0]))); } } break; case 4: if (8 * sizeof(long) > 3 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(long) - 1 > 4 * PyLong_SHIFT) { return (long) ((((((((((long)digits[3]) << PyLong_SHIFT) | (long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0]))); } } break; } #endif if (sizeof(long) <= sizeof(long)) { __PYX_VERIFY_RETURN_INT_EXC(long, long, PyLong_AsLong(x)) } else if (sizeof(long) <= sizeof(PY_LONG_LONG)) { __PYX_VERIFY_RETURN_INT_EXC(long, PY_LONG_LONG, PyLong_AsLongLong(x)) } } { #if CYTHON_COMPILING_IN_PYPY && !defined(_PyLong_AsByteArray) PyErr_SetString(PyExc_RuntimeError, "_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers"); #else long val; PyObject *v = __Pyx_PyNumber_Int(x); #if PY_MAJOR_VERSION < 3 if (likely(v) && !PyLong_Check(v)) { PyObject *tmp = v; v = PyNumber_Long(tmp); Py_DECREF(tmp); } #endif if (likely(v)) { int one = 1; int is_little = (int)*(unsigned char *)&one; unsigned char *bytes = (unsigned char *)&val; int ret = _PyLong_AsByteArray((PyLongObject *)v, bytes, sizeof(val), is_little, !is_unsigned); Py_DECREF(v); if (likely(!ret)) return val; } #endif return (long) -1; } } else { long val; PyObject *tmp = __Pyx_PyNumber_Int(x); if (!tmp) return (long) -1; val = __Pyx_PyInt_As_long(tmp); Py_DECREF(tmp); return val; } raise_overflow: PyErr_SetString(PyExc_OverflowError, "value too large to convert to long"); return (long) -1; raise_neg_overflow: PyErr_SetString(PyExc_OverflowError, "can't convert negative value to long"); return (long) -1; } static int __Pyx_check_binary_version(void) { char ctversion[4], rtversion[4]; PyOS_snprintf(ctversion, 4, "%d.%d", PY_MAJOR_VERSION, PY_MINOR_VERSION); PyOS_snprintf(rtversion, 4, "%s", Py_GetVersion()); if (ctversion[0] != rtversion[0] || ctversion[2] != rtversion[2]) { char message[200]; PyOS_snprintf(message, sizeof(message), "compiletime version %s of module '%.100s' " "does not match runtime version %s", ctversion, __Pyx_MODULE_NAME, rtversion); return PyErr_WarnEx(NULL, message, 1); } return 0; } #ifndef __PYX_HAVE_RT_ImportModule #define __PYX_HAVE_RT_ImportModule static PyObject *__Pyx_ImportModule(const char *name) { PyObject *py_name = 0; PyObject *py_module = 0; py_name = __Pyx_PyIdentifier_FromString(name); if (!py_name) goto bad; py_module = PyImport_Import(py_name); Py_DECREF(py_name); return py_module; bad: Py_XDECREF(py_name); return 0; } #endif #ifndef __PYX_HAVE_RT_ImportType #define __PYX_HAVE_RT_ImportType static PyTypeObject *__Pyx_ImportType(const char *module_name, const char *class_name, size_t size, int strict) { PyObject *py_module = 0; PyObject *result = 0; PyObject *py_name = 0; char warning[200]; Py_ssize_t basicsize; #ifdef Py_LIMITED_API PyObject *py_basicsize; #endif py_module = __Pyx_ImportModule(module_name); if (!py_module) goto bad; py_name = __Pyx_PyIdentifier_FromString(class_name); if (!py_name) goto bad; result = PyObject_GetAttr(py_module, py_name); Py_DECREF(py_name); py_name = 0; Py_DECREF(py_module); py_module = 0; if (!result) goto bad; if (!PyType_Check(result)) { PyErr_Format(PyExc_TypeError, "%.200s.%.200s is not a type object", module_name, class_name); goto bad; } #ifndef Py_LIMITED_API basicsize = ((PyTypeObject *)result)->tp_basicsize; #else py_basicsize = PyObject_GetAttrString(result, "__basicsize__"); if (!py_basicsize) goto bad; basicsize = PyLong_AsSsize_t(py_basicsize); Py_DECREF(py_basicsize); py_basicsize = 0; if (basicsize == (Py_ssize_t)-1 && PyErr_Occurred()) goto bad; #endif if (!strict && (size_t)basicsize > size) { PyOS_snprintf(warning, sizeof(warning), "%s.%s size changed, may indicate binary incompatibility", module_name, class_name); if (PyErr_WarnEx(NULL, warning, 0) < 0) goto bad; } else if ((size_t)basicsize != size) { PyErr_Format(PyExc_ValueError, "%.200s.%.200s has the wrong size, try recompiling", module_name, class_name); goto bad; } return (PyTypeObject *)result; bad: Py_XDECREF(py_module); Py_XDECREF(result); return NULL; } #endif static int __Pyx_InitStrings(__Pyx_StringTabEntry *t) { while (t->p) { #if PY_MAJOR_VERSION < 3 if (t->is_unicode) { *t->p = PyUnicode_DecodeUTF8(t->s, t->n - 1, NULL); } else if (t->intern) { *t->p = PyString_InternFromString(t->s); } else { *t->p = PyString_FromStringAndSize(t->s, t->n - 1); } #else if (t->is_unicode | t->is_str) { if (t->intern) { *t->p = PyUnicode_InternFromString(t->s); } else if (t->encoding) { *t->p = PyUnicode_Decode(t->s, t->n - 1, t->encoding, NULL); } else { *t->p = PyUnicode_FromStringAndSize(t->s, t->n - 1); } } else { *t->p = PyBytes_FromStringAndSize(t->s, t->n - 1); } #endif if (!*t->p) return -1; ++t; } return 0; } static CYTHON_INLINE PyObject* __Pyx_PyUnicode_FromString(const char* c_str) { return __Pyx_PyUnicode_FromStringAndSize(c_str, (Py_ssize_t)strlen(c_str)); } static CYTHON_INLINE char* __Pyx_PyObject_AsString(PyObject* o) { Py_ssize_t ignore; return __Pyx_PyObject_AsStringAndSize(o, &ignore); } static CYTHON_INLINE char* __Pyx_PyObject_AsStringAndSize(PyObject* o, Py_ssize_t *length) { #if CYTHON_COMPILING_IN_CPYTHON && (__PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT) if ( #if PY_MAJOR_VERSION < 3 && __PYX_DEFAULT_STRING_ENCODING_IS_ASCII __Pyx_sys_getdefaultencoding_not_ascii && #endif PyUnicode_Check(o)) { #if PY_VERSION_HEX < 0x03030000 char* defenc_c; PyObject* defenc = _PyUnicode_AsDefaultEncodedString(o, NULL); if (!defenc) return NULL; defenc_c = PyBytes_AS_STRING(defenc); #if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII { char* end = defenc_c + PyBytes_GET_SIZE(defenc); char* c; for (c = defenc_c; c < end; c++) { if ((unsigned char) (*c) >= 128) { PyUnicode_AsASCIIString(o); return NULL; } } } #endif *length = PyBytes_GET_SIZE(defenc); return defenc_c; #else if (__Pyx_PyUnicode_READY(o) == -1) return NULL; #if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII if (PyUnicode_IS_ASCII(o)) { *length = PyUnicode_GET_LENGTH(o); return PyUnicode_AsUTF8(o); } else { PyUnicode_AsASCIIString(o); return NULL; } #else return PyUnicode_AsUTF8AndSize(o, length); #endif #endif } else #endif #if (!CYTHON_COMPILING_IN_PYPY) || (defined(PyByteArray_AS_STRING) && defined(PyByteArray_GET_SIZE)) if (PyByteArray_Check(o)) { *length = PyByteArray_GET_SIZE(o); return PyByteArray_AS_STRING(o); } else #endif { char* result; int r = PyBytes_AsStringAndSize(o, &result, length); if (unlikely(r < 0)) { return NULL; } else { return result; } } } static CYTHON_INLINE int __Pyx_PyObject_IsTrue(PyObject* x) { int is_true = x == Py_True; if (is_true | (x == Py_False) | (x == Py_None)) return is_true; else return PyObject_IsTrue(x); } static CYTHON_INLINE PyObject* __Pyx_PyNumber_Int(PyObject* x) { PyNumberMethods *m; const char *name = NULL; PyObject *res = NULL; #if PY_MAJOR_VERSION < 3 if (PyInt_Check(x) || PyLong_Check(x)) #else if (PyLong_Check(x)) #endif return __Pyx_NewRef(x); m = Py_TYPE(x)->tp_as_number; #if PY_MAJOR_VERSION < 3 if (m && m->nb_int) { name = "int"; res = PyNumber_Int(x); } else if (m && m->nb_long) { name = "long"; res = PyNumber_Long(x); } #else if (m && m->nb_int) { name = "int"; res = PyNumber_Long(x); } #endif if (res) { #if PY_MAJOR_VERSION < 3 if (!PyInt_Check(res) && !PyLong_Check(res)) { #else if (!PyLong_Check(res)) { #endif PyErr_Format(PyExc_TypeError, "__%.4s__ returned non-%.4s (type %.200s)", name, name, Py_TYPE(res)->tp_name); Py_DECREF(res); return NULL; } } else if (!PyErr_Occurred()) { PyErr_SetString(PyExc_TypeError, "an integer is required"); } return res; } static CYTHON_INLINE Py_ssize_t __Pyx_PyIndex_AsSsize_t(PyObject* b) { Py_ssize_t ival; PyObject *x; #if PY_MAJOR_VERSION < 3 if (likely(PyInt_CheckExact(b))) { if (sizeof(Py_ssize_t) >= sizeof(long)) return PyInt_AS_LONG(b); else return PyInt_AsSsize_t(x); } #endif if (likely(PyLong_CheckExact(b))) { #if CYTHON_USE_PYLONG_INTERNALS const digit* digits = ((PyLongObject*)b)->ob_digit; const Py_ssize_t size = Py_SIZE(b); if (likely(__Pyx_sst_abs(size) <= 1)) { ival = likely(size) ? digits[0] : 0; if (size == -1) ival = -ival; return ival; } else { switch (size) { case 2: if (8 * sizeof(Py_ssize_t) > 2 * PyLong_SHIFT) { return (Py_ssize_t) (((((size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])); } break; case -2: if (8 * sizeof(Py_ssize_t) > 2 * PyLong_SHIFT) { return -(Py_ssize_t) (((((size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])); } break; case 3: if (8 * sizeof(Py_ssize_t) > 3 * PyLong_SHIFT) { return (Py_ssize_t) (((((((size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])); } break; case -3: if (8 * sizeof(Py_ssize_t) > 3 * PyLong_SHIFT) { return -(Py_ssize_t) (((((((size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])); } break; case 4: if (8 * sizeof(Py_ssize_t) > 4 * PyLong_SHIFT) { return (Py_ssize_t) (((((((((size_t)digits[3]) << PyLong_SHIFT) | (size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])); } break; case -4: if (8 * sizeof(Py_ssize_t) > 4 * PyLong_SHIFT) { return -(Py_ssize_t) (((((((((size_t)digits[3]) << PyLong_SHIFT) | (size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])); } break; } } #endif return PyLong_AsSsize_t(b); } x = PyNumber_Index(b); if (!x) return -1; ival = PyInt_AsSsize_t(x); Py_DECREF(x); return ival; } static CYTHON_INLINE PyObject * __Pyx_PyInt_FromSize_t(size_t ival) { return PyInt_FromSize_t(ival); } #endif /* Py_PYTHON_H */ pygame_sdl2-2.1.0-for-renpy-6.99.14.1/gen3/pygame_sdl2.rwobject.c0000664000175000017500000066764012765670307023332 0ustar tomtom00000000000000/* Generated by Cython 0.24 */ #define PY_SSIZE_T_CLEAN #include "Python.h" #ifndef Py_PYTHON_H #error Python headers needed to compile C extensions, please install development version of Python. #elif PY_VERSION_HEX < 0x02060000 || (0x03000000 <= PY_VERSION_HEX && PY_VERSION_HEX < 0x03020000) #error Cython requires Python 2.6+ or Python 3.2+. #else #define CYTHON_ABI "0_24" #include #ifndef offsetof #define offsetof(type, member) ( (size_t) & ((type*)0) -> member ) #endif #if !defined(WIN32) && !defined(MS_WINDOWS) #ifndef __stdcall #define __stdcall #endif #ifndef __cdecl #define __cdecl #endif #ifndef __fastcall #define __fastcall #endif #endif #ifndef DL_IMPORT #define DL_IMPORT(t) t #endif #ifndef DL_EXPORT #define DL_EXPORT(t) t #endif #ifndef PY_LONG_LONG #define PY_LONG_LONG LONG_LONG #endif #ifndef Py_HUGE_VAL #define Py_HUGE_VAL HUGE_VAL #endif #ifdef PYPY_VERSION #define CYTHON_COMPILING_IN_PYPY 1 #define CYTHON_COMPILING_IN_CPYTHON 0 #else #define CYTHON_COMPILING_IN_PYPY 0 #define CYTHON_COMPILING_IN_CPYTHON 1 #endif #if !defined(CYTHON_USE_PYLONG_INTERNALS) && CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x02070000 #define CYTHON_USE_PYLONG_INTERNALS 1 #endif #if CYTHON_USE_PYLONG_INTERNALS #include "longintrepr.h" #undef SHIFT #undef BASE #undef MASK #endif #if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX < 0x02070600 && !defined(Py_OptimizeFlag) #define Py_OptimizeFlag 0 #endif #define __PYX_BUILD_PY_SSIZE_T "n" #define CYTHON_FORMAT_SSIZE_T "z" #if PY_MAJOR_VERSION < 3 #define __Pyx_BUILTIN_MODULE_NAME "__builtin__" #define __Pyx_PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)\ PyCode_New(a+k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos) #define __Pyx_DefaultClassType PyClass_Type #else #define __Pyx_BUILTIN_MODULE_NAME "builtins" #define __Pyx_PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)\ PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos) #define __Pyx_DefaultClassType PyType_Type #endif #ifndef Py_TPFLAGS_CHECKTYPES #define Py_TPFLAGS_CHECKTYPES 0 #endif #ifndef Py_TPFLAGS_HAVE_INDEX #define Py_TPFLAGS_HAVE_INDEX 0 #endif #ifndef Py_TPFLAGS_HAVE_NEWBUFFER #define Py_TPFLAGS_HAVE_NEWBUFFER 0 #endif #ifndef Py_TPFLAGS_HAVE_FINALIZE #define Py_TPFLAGS_HAVE_FINALIZE 0 #endif #if PY_VERSION_HEX > 0x03030000 && defined(PyUnicode_KIND) #define CYTHON_PEP393_ENABLED 1 #define __Pyx_PyUnicode_READY(op) (likely(PyUnicode_IS_READY(op)) ?\ 0 : _PyUnicode_Ready((PyObject *)(op))) #define __Pyx_PyUnicode_GET_LENGTH(u) PyUnicode_GET_LENGTH(u) #define __Pyx_PyUnicode_READ_CHAR(u, i) PyUnicode_READ_CHAR(u, i) #define __Pyx_PyUnicode_KIND(u) PyUnicode_KIND(u) #define __Pyx_PyUnicode_DATA(u) PyUnicode_DATA(u) #define __Pyx_PyUnicode_READ(k, d, i) PyUnicode_READ(k, d, i) #define __Pyx_PyUnicode_IS_TRUE(u) (0 != (likely(PyUnicode_IS_READY(u)) ? PyUnicode_GET_LENGTH(u) : PyUnicode_GET_SIZE(u))) #else #define CYTHON_PEP393_ENABLED 0 #define __Pyx_PyUnicode_READY(op) (0) #define __Pyx_PyUnicode_GET_LENGTH(u) PyUnicode_GET_SIZE(u) #define __Pyx_PyUnicode_READ_CHAR(u, i) ((Py_UCS4)(PyUnicode_AS_UNICODE(u)[i])) #define __Pyx_PyUnicode_KIND(u) (sizeof(Py_UNICODE)) #define __Pyx_PyUnicode_DATA(u) ((void*)PyUnicode_AS_UNICODE(u)) #define __Pyx_PyUnicode_READ(k, d, i) ((void)(k), (Py_UCS4)(((Py_UNICODE*)d)[i])) #define __Pyx_PyUnicode_IS_TRUE(u) (0 != PyUnicode_GET_SIZE(u)) #endif #if CYTHON_COMPILING_IN_PYPY #define __Pyx_PyUnicode_Concat(a, b) PyNumber_Add(a, b) #define __Pyx_PyUnicode_ConcatSafe(a, b) PyNumber_Add(a, b) #else #define __Pyx_PyUnicode_Concat(a, b) PyUnicode_Concat(a, b) #define __Pyx_PyUnicode_ConcatSafe(a, b) ((unlikely((a) == Py_None) || unlikely((b) == Py_None)) ?\ PyNumber_Add(a, b) : __Pyx_PyUnicode_Concat(a, b)) #endif #if CYTHON_COMPILING_IN_PYPY && !defined(PyUnicode_Contains) #define PyUnicode_Contains(u, s) PySequence_Contains(u, s) #endif #if CYTHON_COMPILING_IN_PYPY && !defined(PyObject_Format) #define PyObject_Format(obj, fmt) PyObject_CallMethod(obj, "__format__", "O", fmt) #endif #if CYTHON_COMPILING_IN_PYPY && !defined(PyObject_Malloc) #define PyObject_Malloc(s) PyMem_Malloc(s) #define PyObject_Free(p) PyMem_Free(p) #define PyObject_Realloc(p) PyMem_Realloc(p) #endif #define __Pyx_PyString_FormatSafe(a, b) ((unlikely((a) == Py_None)) ? PyNumber_Remainder(a, b) : __Pyx_PyString_Format(a, b)) #define __Pyx_PyUnicode_FormatSafe(a, b) ((unlikely((a) == Py_None)) ? PyNumber_Remainder(a, b) : PyUnicode_Format(a, b)) #if PY_MAJOR_VERSION >= 3 #define __Pyx_PyString_Format(a, b) PyUnicode_Format(a, b) #else #define __Pyx_PyString_Format(a, b) PyString_Format(a, b) #endif #if PY_MAJOR_VERSION < 3 && !defined(PyObject_ASCII) #define PyObject_ASCII(o) PyObject_Repr(o) #endif #if PY_MAJOR_VERSION >= 3 #define PyBaseString_Type PyUnicode_Type #define PyStringObject PyUnicodeObject #define PyString_Type PyUnicode_Type #define PyString_Check PyUnicode_Check #define PyString_CheckExact PyUnicode_CheckExact #endif #if PY_MAJOR_VERSION >= 3 #define __Pyx_PyBaseString_Check(obj) PyUnicode_Check(obj) #define __Pyx_PyBaseString_CheckExact(obj) PyUnicode_CheckExact(obj) #else #define __Pyx_PyBaseString_Check(obj) (PyString_Check(obj) || PyUnicode_Check(obj)) #define __Pyx_PyBaseString_CheckExact(obj) (PyString_CheckExact(obj) || PyUnicode_CheckExact(obj)) #endif #ifndef PySet_CheckExact #define PySet_CheckExact(obj) (Py_TYPE(obj) == &PySet_Type) #endif #define __Pyx_TypeCheck(obj, type) PyObject_TypeCheck(obj, (PyTypeObject *)type) #if PY_MAJOR_VERSION >= 3 #define PyIntObject PyLongObject #define PyInt_Type PyLong_Type #define PyInt_Check(op) PyLong_Check(op) #define PyInt_CheckExact(op) PyLong_CheckExact(op) #define PyInt_FromString PyLong_FromString #define PyInt_FromUnicode PyLong_FromUnicode #define PyInt_FromLong PyLong_FromLong #define PyInt_FromSize_t PyLong_FromSize_t #define PyInt_FromSsize_t PyLong_FromSsize_t #define PyInt_AsLong PyLong_AsLong #define PyInt_AS_LONG PyLong_AS_LONG #define PyInt_AsSsize_t PyLong_AsSsize_t #define PyInt_AsUnsignedLongMask PyLong_AsUnsignedLongMask #define PyInt_AsUnsignedLongLongMask PyLong_AsUnsignedLongLongMask #define PyNumber_Int PyNumber_Long #endif #if PY_MAJOR_VERSION >= 3 #define PyBoolObject PyLongObject #endif #if PY_MAJOR_VERSION >= 3 && CYTHON_COMPILING_IN_PYPY #ifndef PyUnicode_InternFromString #define PyUnicode_InternFromString(s) PyUnicode_FromString(s) #endif #endif #if PY_VERSION_HEX < 0x030200A4 typedef long Py_hash_t; #define __Pyx_PyInt_FromHash_t PyInt_FromLong #define __Pyx_PyInt_AsHash_t PyInt_AsLong #else #define __Pyx_PyInt_FromHash_t PyInt_FromSsize_t #define __Pyx_PyInt_AsHash_t PyInt_AsSsize_t #endif #if PY_MAJOR_VERSION >= 3 #define __Pyx_PyMethod_New(func, self, klass) ((self) ? PyMethod_New(func, self) : PyInstanceMethod_New(func)) #else #define __Pyx_PyMethod_New(func, self, klass) PyMethod_New(func, self, klass) #endif #if PY_VERSION_HEX >= 0x030500B1 #define __Pyx_PyAsyncMethodsStruct PyAsyncMethods #define __Pyx_PyType_AsAsync(obj) (Py_TYPE(obj)->tp_as_async) #elif CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3 typedef struct { unaryfunc am_await; unaryfunc am_aiter; unaryfunc am_anext; } __Pyx_PyAsyncMethodsStruct; #define __Pyx_PyType_AsAsync(obj) ((__Pyx_PyAsyncMethodsStruct*) (Py_TYPE(obj)->tp_reserved)) #else #define __Pyx_PyType_AsAsync(obj) NULL #endif #ifndef CYTHON_RESTRICT #if defined(__GNUC__) #define CYTHON_RESTRICT __restrict__ #elif defined(_MSC_VER) && _MSC_VER >= 1400 #define CYTHON_RESTRICT __restrict #elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L #define CYTHON_RESTRICT restrict #else #define CYTHON_RESTRICT #endif #endif #define __Pyx_void_to_None(void_result) ((void)(void_result), Py_INCREF(Py_None), Py_None) #ifndef CYTHON_INLINE #if defined(__GNUC__) #define CYTHON_INLINE __inline__ #elif defined(_MSC_VER) #define CYTHON_INLINE __inline #elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L #define CYTHON_INLINE inline #else #define CYTHON_INLINE #endif #endif #if defined(WIN32) || defined(MS_WINDOWS) #define _USE_MATH_DEFINES #endif #include #ifdef NAN #define __PYX_NAN() ((float) NAN) #else static CYTHON_INLINE float __PYX_NAN() { float value; memset(&value, 0xFF, sizeof(value)); return value; } #endif #define __PYX_ERR(f_index, lineno, Ln_error) \ { \ __pyx_filename = __pyx_f[f_index]; __pyx_lineno = lineno; __pyx_clineno = __LINE__; goto Ln_error; \ } #if PY_MAJOR_VERSION >= 3 #define __Pyx_PyNumber_Divide(x,y) PyNumber_TrueDivide(x,y) #define __Pyx_PyNumber_InPlaceDivide(x,y) PyNumber_InPlaceTrueDivide(x,y) #else #define __Pyx_PyNumber_Divide(x,y) PyNumber_TrueDivide(x,y) #define __Pyx_PyNumber_InPlaceDivide(x,y) PyNumber_InPlaceTrueDivide(x,y) #endif #ifndef __PYX_EXTERN_C #ifdef __cplusplus #define __PYX_EXTERN_C extern "C" #else #define __PYX_EXTERN_C extern #endif #endif #define __PYX_HAVE__pygame_sdl2__rwobject #define __PYX_HAVE_API__pygame_sdl2__rwobject #include "stdint.h" #include "string.h" #include "stdio.h" #include "stddef.h" #include "SDL.h" #include "stdlib.h" #ifdef _OPENMP #include #endif /* _OPENMP */ #ifdef PYREX_WITHOUT_ASSERTIONS #define CYTHON_WITHOUT_ASSERTIONS #endif #ifndef CYTHON_UNUSED # if defined(__GNUC__) # if !(defined(__cplusplus)) || (__GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 4)) # define CYTHON_UNUSED __attribute__ ((__unused__)) # else # define CYTHON_UNUSED # endif # elif defined(__ICC) || (defined(__INTEL_COMPILER) && !defined(_MSC_VER)) # define CYTHON_UNUSED __attribute__ ((__unused__)) # else # define CYTHON_UNUSED # endif #endif #ifndef CYTHON_NCP_UNUSED # if CYTHON_COMPILING_IN_CPYTHON # define CYTHON_NCP_UNUSED # else # define CYTHON_NCP_UNUSED CYTHON_UNUSED # endif #endif typedef struct {PyObject **p; const char *s; const Py_ssize_t n; const char* encoding; const char is_unicode; const char is_str; const char intern; } __Pyx_StringTabEntry; #define __PYX_DEFAULT_STRING_ENCODING_IS_ASCII 0 #define __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT 0 #define __PYX_DEFAULT_STRING_ENCODING "" #define __Pyx_PyObject_FromString __Pyx_PyBytes_FromString #define __Pyx_PyObject_FromStringAndSize __Pyx_PyBytes_FromStringAndSize #define __Pyx_uchar_cast(c) ((unsigned char)c) #define __Pyx_long_cast(x) ((long)x) #define __Pyx_fits_Py_ssize_t(v, type, is_signed) (\ (sizeof(type) < sizeof(Py_ssize_t)) ||\ (sizeof(type) > sizeof(Py_ssize_t) &&\ likely(v < (type)PY_SSIZE_T_MAX ||\ v == (type)PY_SSIZE_T_MAX) &&\ (!is_signed || likely(v > (type)PY_SSIZE_T_MIN ||\ v == (type)PY_SSIZE_T_MIN))) ||\ (sizeof(type) == sizeof(Py_ssize_t) &&\ (is_signed || likely(v < (type)PY_SSIZE_T_MAX ||\ v == (type)PY_SSIZE_T_MAX))) ) #if defined (__cplusplus) && __cplusplus >= 201103L #include #define __Pyx_sst_abs(value) std::abs(value) #elif SIZEOF_INT >= SIZEOF_SIZE_T #define __Pyx_sst_abs(value) abs(value) #elif SIZEOF_LONG >= SIZEOF_SIZE_T #define __Pyx_sst_abs(value) labs(value) #elif defined (_MSC_VER) && defined (_M_X64) #define __Pyx_sst_abs(value) _abs64(value) #elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L #define __Pyx_sst_abs(value) llabs(value) #elif defined (__GNUC__) #define __Pyx_sst_abs(value) __builtin_llabs(value) #else #define __Pyx_sst_abs(value) ((value<0) ? -value : value) #endif static CYTHON_INLINE char* __Pyx_PyObject_AsString(PyObject*); static CYTHON_INLINE char* __Pyx_PyObject_AsStringAndSize(PyObject*, Py_ssize_t* length); #define __Pyx_PyByteArray_FromString(s) PyByteArray_FromStringAndSize((const char*)s, strlen((const char*)s)) #define __Pyx_PyByteArray_FromStringAndSize(s, l) PyByteArray_FromStringAndSize((const char*)s, l) #define __Pyx_PyBytes_FromString PyBytes_FromString #define __Pyx_PyBytes_FromStringAndSize PyBytes_FromStringAndSize static CYTHON_INLINE PyObject* __Pyx_PyUnicode_FromString(const char*); #if PY_MAJOR_VERSION < 3 #define __Pyx_PyStr_FromString __Pyx_PyBytes_FromString #define __Pyx_PyStr_FromStringAndSize __Pyx_PyBytes_FromStringAndSize #else #define __Pyx_PyStr_FromString __Pyx_PyUnicode_FromString #define __Pyx_PyStr_FromStringAndSize __Pyx_PyUnicode_FromStringAndSize #endif #define __Pyx_PyObject_AsSString(s) ((signed char*) __Pyx_PyObject_AsString(s)) #define __Pyx_PyObject_AsUString(s) ((unsigned char*) __Pyx_PyObject_AsString(s)) #define __Pyx_PyObject_FromCString(s) __Pyx_PyObject_FromString((const char*)s) #define __Pyx_PyBytes_FromCString(s) __Pyx_PyBytes_FromString((const char*)s) #define __Pyx_PyByteArray_FromCString(s) __Pyx_PyByteArray_FromString((const char*)s) #define __Pyx_PyStr_FromCString(s) __Pyx_PyStr_FromString((const char*)s) #define __Pyx_PyUnicode_FromCString(s) __Pyx_PyUnicode_FromString((const char*)s) #if PY_MAJOR_VERSION < 3 static CYTHON_INLINE size_t __Pyx_Py_UNICODE_strlen(const Py_UNICODE *u) { const Py_UNICODE *u_end = u; while (*u_end++) ; return (size_t)(u_end - u - 1); } #else #define __Pyx_Py_UNICODE_strlen Py_UNICODE_strlen #endif #define __Pyx_PyUnicode_FromUnicode(u) PyUnicode_FromUnicode(u, __Pyx_Py_UNICODE_strlen(u)) #define __Pyx_PyUnicode_FromUnicodeAndLength PyUnicode_FromUnicode #define __Pyx_PyUnicode_AsUnicode PyUnicode_AsUnicode #define __Pyx_NewRef(obj) (Py_INCREF(obj), obj) #define __Pyx_Owned_Py_None(b) __Pyx_NewRef(Py_None) #define __Pyx_PyBool_FromLong(b) ((b) ? __Pyx_NewRef(Py_True) : __Pyx_NewRef(Py_False)) static CYTHON_INLINE int __Pyx_PyObject_IsTrue(PyObject*); static CYTHON_INLINE PyObject* __Pyx_PyNumber_IntOrLong(PyObject* x); static CYTHON_INLINE Py_ssize_t __Pyx_PyIndex_AsSsize_t(PyObject*); static CYTHON_INLINE PyObject * __Pyx_PyInt_FromSize_t(size_t); #if CYTHON_COMPILING_IN_CPYTHON #define __pyx_PyFloat_AsDouble(x) (PyFloat_CheckExact(x) ? PyFloat_AS_DOUBLE(x) : PyFloat_AsDouble(x)) #else #define __pyx_PyFloat_AsDouble(x) PyFloat_AsDouble(x) #endif #define __pyx_PyFloat_AsFloat(x) ((float) __pyx_PyFloat_AsDouble(x)) #if PY_MAJOR_VERSION >= 3 #define __Pyx_PyNumber_Int(x) (PyLong_CheckExact(x) ? __Pyx_NewRef(x) : PyNumber_Long(x)) #else #define __Pyx_PyNumber_Int(x) (PyInt_CheckExact(x) ? __Pyx_NewRef(x) : PyNumber_Int(x)) #endif #define __Pyx_PyNumber_Float(x) (PyFloat_CheckExact(x) ? __Pyx_NewRef(x) : PyNumber_Float(x)) #if PY_MAJOR_VERSION < 3 && __PYX_DEFAULT_STRING_ENCODING_IS_ASCII static int __Pyx_sys_getdefaultencoding_not_ascii; static int __Pyx_init_sys_getdefaultencoding_params(void) { PyObject* sys; PyObject* default_encoding = NULL; PyObject* ascii_chars_u = NULL; PyObject* ascii_chars_b = NULL; const char* default_encoding_c; sys = PyImport_ImportModule("sys"); if (!sys) goto bad; default_encoding = PyObject_CallMethod(sys, (char*) "getdefaultencoding", NULL); Py_DECREF(sys); if (!default_encoding) goto bad; default_encoding_c = PyBytes_AsString(default_encoding); if (!default_encoding_c) goto bad; if (strcmp(default_encoding_c, "ascii") == 0) { __Pyx_sys_getdefaultencoding_not_ascii = 0; } else { char ascii_chars[128]; int c; for (c = 0; c < 128; c++) { ascii_chars[c] = c; } __Pyx_sys_getdefaultencoding_not_ascii = 1; ascii_chars_u = PyUnicode_DecodeASCII(ascii_chars, 128, NULL); if (!ascii_chars_u) goto bad; ascii_chars_b = PyUnicode_AsEncodedString(ascii_chars_u, default_encoding_c, NULL); if (!ascii_chars_b || !PyBytes_Check(ascii_chars_b) || memcmp(ascii_chars, PyBytes_AS_STRING(ascii_chars_b), 128) != 0) { PyErr_Format( PyExc_ValueError, "This module compiled with c_string_encoding=ascii, but default encoding '%.200s' is not a superset of ascii.", default_encoding_c); goto bad; } Py_DECREF(ascii_chars_u); Py_DECREF(ascii_chars_b); } Py_DECREF(default_encoding); return 0; bad: Py_XDECREF(default_encoding); Py_XDECREF(ascii_chars_u); Py_XDECREF(ascii_chars_b); return -1; } #endif #if __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT && PY_MAJOR_VERSION >= 3 #define __Pyx_PyUnicode_FromStringAndSize(c_str, size) PyUnicode_DecodeUTF8(c_str, size, NULL) #else #define __Pyx_PyUnicode_FromStringAndSize(c_str, size) PyUnicode_Decode(c_str, size, __PYX_DEFAULT_STRING_ENCODING, NULL) #if __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT static char* __PYX_DEFAULT_STRING_ENCODING; static int __Pyx_init_sys_getdefaultencoding_params(void) { PyObject* sys; PyObject* default_encoding = NULL; char* default_encoding_c; sys = PyImport_ImportModule("sys"); if (!sys) goto bad; default_encoding = PyObject_CallMethod(sys, (char*) (const char*) "getdefaultencoding", NULL); Py_DECREF(sys); if (!default_encoding) goto bad; default_encoding_c = PyBytes_AsString(default_encoding); if (!default_encoding_c) goto bad; __PYX_DEFAULT_STRING_ENCODING = (char*) malloc(strlen(default_encoding_c)); if (!__PYX_DEFAULT_STRING_ENCODING) goto bad; strcpy(__PYX_DEFAULT_STRING_ENCODING, default_encoding_c); Py_DECREF(default_encoding); return 0; bad: Py_XDECREF(default_encoding); return -1; } #endif #endif /* Test for GCC > 2.95 */ #if defined(__GNUC__) && (__GNUC__ > 2 || (__GNUC__ == 2 && (__GNUC_MINOR__ > 95))) #define likely(x) __builtin_expect(!!(x), 1) #define unlikely(x) __builtin_expect(!!(x), 0) #else /* !__GNUC__ or GCC < 2.95 */ #define likely(x) (x) #define unlikely(x) (x) #endif /* __GNUC__ */ static PyObject *__pyx_m; static PyObject *__pyx_d; static PyObject *__pyx_b; static PyObject *__pyx_empty_tuple; static PyObject *__pyx_empty_bytes; static PyObject *__pyx_empty_unicode; static int __pyx_lineno; static int __pyx_clineno = 0; static const char * __pyx_cfilenm= __FILE__; static const char *__pyx_filename; static const char *__pyx_f[] = { "src/pygame_sdl2/rwobject.pyx", "type.pxd", }; /*--- Type declarations ---*/ struct __pyx_opt_args_11pygame_sdl2_8rwobject_to_rwops; struct __pyx_t_11pygame_sdl2_8rwobject_SubFile; /* "pygame_sdl2/rwobject.pxd":21 * from sdl2 cimport SDL_RWops * * cdef SDL_RWops *to_rwops(filelike, mode=*) except NULL # <<<<<<<<<<<<<< * */ struct __pyx_opt_args_11pygame_sdl2_8rwobject_to_rwops { int __pyx_n; PyObject *mode; }; /* "pygame_sdl2/rwobject.pyx":124 * return 0 * * cdef struct SubFile: # <<<<<<<<<<<<<< * SDL_RWops *rw * Sint64 base */ struct __pyx_t_11pygame_sdl2_8rwobject_SubFile { SDL_RWops *rw; Sint64 base; Sint64 length; Sint64 tell; }; /* --- Runtime support code (head) --- */ /* Refnanny.proto */ #ifndef CYTHON_REFNANNY #define CYTHON_REFNANNY 0 #endif #if CYTHON_REFNANNY typedef struct { void (*INCREF)(void*, PyObject*, int); void (*DECREF)(void*, PyObject*, int); void (*GOTREF)(void*, PyObject*, int); void (*GIVEREF)(void*, PyObject*, int); void* (*SetupContext)(const char*, int, const char*); void (*FinishContext)(void**); } __Pyx_RefNannyAPIStruct; static __Pyx_RefNannyAPIStruct *__Pyx_RefNanny = NULL; static __Pyx_RefNannyAPIStruct *__Pyx_RefNannyImportAPI(const char *modname); #define __Pyx_RefNannyDeclarations void *__pyx_refnanny = NULL; #ifdef WITH_THREAD #define __Pyx_RefNannySetupContext(name, acquire_gil)\ if (acquire_gil) {\ PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure();\ __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), __LINE__, __FILE__);\ PyGILState_Release(__pyx_gilstate_save);\ } else {\ __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), __LINE__, __FILE__);\ } #else #define __Pyx_RefNannySetupContext(name, acquire_gil)\ __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), __LINE__, __FILE__) #endif #define __Pyx_RefNannyFinishContext()\ __Pyx_RefNanny->FinishContext(&__pyx_refnanny) #define __Pyx_INCREF(r) __Pyx_RefNanny->INCREF(__pyx_refnanny, (PyObject *)(r), __LINE__) #define __Pyx_DECREF(r) __Pyx_RefNanny->DECREF(__pyx_refnanny, (PyObject *)(r), __LINE__) #define __Pyx_GOTREF(r) __Pyx_RefNanny->GOTREF(__pyx_refnanny, (PyObject *)(r), __LINE__) #define __Pyx_GIVEREF(r) __Pyx_RefNanny->GIVEREF(__pyx_refnanny, (PyObject *)(r), __LINE__) #define __Pyx_XINCREF(r) do { if((r) != NULL) {__Pyx_INCREF(r); }} while(0) #define __Pyx_XDECREF(r) do { if((r) != NULL) {__Pyx_DECREF(r); }} while(0) #define __Pyx_XGOTREF(r) do { if((r) != NULL) {__Pyx_GOTREF(r); }} while(0) #define __Pyx_XGIVEREF(r) do { if((r) != NULL) {__Pyx_GIVEREF(r);}} while(0) #else #define __Pyx_RefNannyDeclarations #define __Pyx_RefNannySetupContext(name, acquire_gil) #define __Pyx_RefNannyFinishContext() #define __Pyx_INCREF(r) Py_INCREF(r) #define __Pyx_DECREF(r) Py_DECREF(r) #define __Pyx_GOTREF(r) #define __Pyx_GIVEREF(r) #define __Pyx_XINCREF(r) Py_XINCREF(r) #define __Pyx_XDECREF(r) Py_XDECREF(r) #define __Pyx_XGOTREF(r) #define __Pyx_XGIVEREF(r) #endif #define __Pyx_XDECREF_SET(r, v) do {\ PyObject *tmp = (PyObject *) r;\ r = v; __Pyx_XDECREF(tmp);\ } while (0) #define __Pyx_DECREF_SET(r, v) do {\ PyObject *tmp = (PyObject *) r;\ r = v; __Pyx_DECREF(tmp);\ } while (0) #define __Pyx_CLEAR(r) do { PyObject* tmp = ((PyObject*)(r)); r = NULL; __Pyx_DECREF(tmp);} while(0) #define __Pyx_XCLEAR(r) do { if((r) != NULL) {PyObject* tmp = ((PyObject*)(r)); r = NULL; __Pyx_DECREF(tmp);}} while(0) /* PyObjectGetAttrStr.proto */ #if CYTHON_COMPILING_IN_CPYTHON static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStr(PyObject* obj, PyObject* attr_name) { PyTypeObject* tp = Py_TYPE(obj); if (likely(tp->tp_getattro)) return tp->tp_getattro(obj, attr_name); #if PY_MAJOR_VERSION < 3 if (likely(tp->tp_getattr)) return tp->tp_getattr(obj, PyString_AS_STRING(attr_name)); #endif return PyObject_GetAttr(obj, attr_name); } #else #define __Pyx_PyObject_GetAttrStr(o,n) PyObject_GetAttr(o,n) #endif /* GetBuiltinName.proto */ static PyObject *__Pyx_GetBuiltinName(PyObject *name); /* PyObjectCall.proto */ #if CYTHON_COMPILING_IN_CPYTHON static CYTHON_INLINE PyObject* __Pyx_PyObject_Call(PyObject *func, PyObject *arg, PyObject *kw); #else #define __Pyx_PyObject_Call(func, arg, kw) PyObject_Call(func, arg, kw) #endif /* ForceInitThreads.proto */ #ifndef __PYX_FORCE_INIT_THREADS #define __PYX_FORCE_INIT_THREADS 0 #endif /* PyObjectCallMethO.proto */ #if CYTHON_COMPILING_IN_CPYTHON static CYTHON_INLINE PyObject* __Pyx_PyObject_CallMethO(PyObject *func, PyObject *arg); #endif /* PyObjectCallOneArg.proto */ static CYTHON_INLINE PyObject* __Pyx_PyObject_CallOneArg(PyObject *func, PyObject *arg); /* PyObjectCallNoArg.proto */ #if CYTHON_COMPILING_IN_CPYTHON static CYTHON_INLINE PyObject* __Pyx_PyObject_CallNoArg(PyObject *func); #else #define __Pyx_PyObject_CallNoArg(func) __Pyx_PyObject_Call(func, __pyx_empty_tuple, NULL) #endif /* PyThreadStateGet.proto */ #if CYTHON_COMPILING_IN_CPYTHON #define __Pyx_PyThreadState_declare PyThreadState *__pyx_tstate; #define __Pyx_PyThreadState_assign __pyx_tstate = PyThreadState_GET(); #else #define __Pyx_PyThreadState_declare #define __Pyx_PyThreadState_assign #endif /* SaveResetException.proto */ #if CYTHON_COMPILING_IN_CPYTHON #define __Pyx_ExceptionSave(type, value, tb) __Pyx__ExceptionSave(__pyx_tstate, type, value, tb) static CYTHON_INLINE void __Pyx__ExceptionSave(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb); #define __Pyx_ExceptionReset(type, value, tb) __Pyx__ExceptionReset(__pyx_tstate, type, value, tb) static CYTHON_INLINE void __Pyx__ExceptionReset(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb); #else #define __Pyx_ExceptionSave(type, value, tb) PyErr_GetExcInfo(type, value, tb) #define __Pyx_ExceptionReset(type, value, tb) PyErr_SetExcInfo(type, value, tb) #endif /* GetException.proto */ #if CYTHON_COMPILING_IN_CPYTHON #define __Pyx_GetException(type, value, tb) __Pyx__GetException(__pyx_tstate, type, value, tb) static int __Pyx__GetException(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb); #else static int __Pyx_GetException(PyObject **type, PyObject **value, PyObject **tb); #endif /* PyErrFetchRestore.proto */ #if CYTHON_COMPILING_IN_CPYTHON #define __Pyx_ErrRestoreWithState(type, value, tb) __Pyx_ErrRestoreInState(PyThreadState_GET(), type, value, tb) #define __Pyx_ErrFetchWithState(type, value, tb) __Pyx_ErrFetchInState(PyThreadState_GET(), type, value, tb) #define __Pyx_ErrRestore(type, value, tb) __Pyx_ErrRestoreInState(__pyx_tstate, type, value, tb) #define __Pyx_ErrFetch(type, value, tb) __Pyx_ErrFetchInState(__pyx_tstate, type, value, tb) static CYTHON_INLINE void __Pyx_ErrRestoreInState(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb); static CYTHON_INLINE void __Pyx_ErrFetchInState(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb); #else #define __Pyx_ErrRestoreWithState(type, value, tb) PyErr_Restore(type, value, tb) #define __Pyx_ErrFetchWithState(type, value, tb) PyErr_Fetch(type, value, tb) #define __Pyx_ErrRestore(type, value, tb) PyErr_Restore(type, value, tb) #define __Pyx_ErrFetch(type, value, tb) PyErr_Fetch(type, value, tb) #endif /* WriteUnraisableException.proto */ static void __Pyx_WriteUnraisable(const char *name, int clineno, int lineno, const char *filename, int full_traceback, int nogil); /* PyErrExceptionMatches.proto */ #if CYTHON_COMPILING_IN_CPYTHON #define __Pyx_PyErr_ExceptionMatches(err) __Pyx_PyErr_ExceptionMatchesInState(__pyx_tstate, err) static CYTHON_INLINE int __Pyx_PyErr_ExceptionMatchesInState(PyThreadState* tstate, PyObject* err); #else #define __Pyx_PyErr_ExceptionMatches(err) PyErr_ExceptionMatches(err) #endif /* SwapException.proto */ #if CYTHON_COMPILING_IN_CPYTHON #define __Pyx_ExceptionSwap(type, value, tb) __Pyx__ExceptionSwap(__pyx_tstate, type, value, tb) static CYTHON_INLINE void __Pyx__ExceptionSwap(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb); #else static CYTHON_INLINE void __Pyx_ExceptionSwap(PyObject **type, PyObject **value, PyObject **tb); #endif /* GetModuleGlobalName.proto */ static CYTHON_INLINE PyObject *__Pyx_GetModuleGlobalName(PyObject *name); /* IncludeStringH.proto */ #include /* BytesEquals.proto */ static CYTHON_INLINE int __Pyx_PyBytes_Equals(PyObject* s1, PyObject* s2, int equals); /* RaiseException.proto */ static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, PyObject *cause); /* Import.proto */ static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list, int level); /* ImportFrom.proto */ static PyObject* __Pyx_ImportFrom(PyObject* module, PyObject* name); /* CodeObjectCache.proto */ typedef struct { PyCodeObject* code_object; int code_line; } __Pyx_CodeObjectCacheEntry; struct __Pyx_CodeObjectCache { int count; int max_count; __Pyx_CodeObjectCacheEntry* entries; }; static struct __Pyx_CodeObjectCache __pyx_code_cache = {0,0,NULL}; static int __pyx_bisect_code_objects(__Pyx_CodeObjectCacheEntry* entries, int count, int code_line); static PyCodeObject *__pyx_find_code_object(int code_line); static void __pyx_insert_code_object(int code_line, PyCodeObject* code_object); /* AddTraceback.proto */ static void __Pyx_AddTraceback(const char *funcname, int c_line, int py_line, const char *filename); /* CIntToPy.proto */ static CYTHON_INLINE PyObject* __Pyx_PyInt_From_int64_t(int64_t value); /* CIntToPy.proto */ static CYTHON_INLINE PyObject* __Pyx_PyInt_From_int(int value); /* CIntFromPy.proto */ static CYTHON_INLINE int64_t __Pyx_PyInt_As_int64_t(PyObject *); /* CIntToPy.proto */ static CYTHON_INLINE PyObject* __Pyx_PyInt_From_long(long value); /* CIntFromPy.proto */ static CYTHON_INLINE long __Pyx_PyInt_As_long(PyObject *); /* CIntFromPy.proto */ static CYTHON_INLINE int __Pyx_PyInt_As_int(PyObject *); /* CheckBinaryVersion.proto */ static int __Pyx_check_binary_version(void); /* FunctionExport.proto */ static int __Pyx_ExportFunction(const char *name, void (*f)(void), const char *sig); /* PyIdentifierFromString.proto */ #if !defined(__Pyx_PyIdentifier_FromString) #if PY_MAJOR_VERSION < 3 #define __Pyx_PyIdentifier_FromString(s) PyString_FromString(s) #else #define __Pyx_PyIdentifier_FromString(s) PyUnicode_FromString(s) #endif #endif /* ModuleImport.proto */ static PyObject *__Pyx_ImportModule(const char *name); /* TypeImport.proto */ static PyTypeObject *__Pyx_ImportType(const char *module_name, const char *class_name, size_t size, int strict); /* InitStrings.proto */ static int __Pyx_InitStrings(__Pyx_StringTabEntry *t); /* Module declarations from 'libc.stdint' */ /* Module declarations from 'libc.string' */ /* Module declarations from 'libc.stdio' */ /* Module declarations from 'libc.stddef' */ /* Module declarations from 'sdl2' */ /* Module declarations from '__builtin__' */ /* Module declarations from 'cpython.type' */ static PyTypeObject *__pyx_ptype_7cpython_4type_type = 0; /* Module declarations from 'cpython' */ /* Module declarations from 'cpython.object' */ /* Module declarations from 'cpython.ref' */ /* Module declarations from 'libc.stdlib' */ /* Module declarations from 'pygame_sdl2.rwobject' */ static SDL_RWops *__pyx_f_11pygame_sdl2_8rwobject_to_rwops(PyObject *, struct __pyx_opt_args_11pygame_sdl2_8rwobject_to_rwops *__pyx_optional_args); /*proto*/ static PyObject *__pyx_f_11pygame_sdl2_8rwobject_set_error(PyObject *); /*proto*/ static Sint64 __pyx_f_11pygame_sdl2_8rwobject_python_size(SDL_RWops *); /*proto*/ static Sint64 __pyx_f_11pygame_sdl2_8rwobject_python_seek(SDL_RWops *, Sint64, int); /*proto*/ static size_t __pyx_f_11pygame_sdl2_8rwobject_python_read(SDL_RWops *, void *, size_t, size_t); /*proto*/ static size_t __pyx_f_11pygame_sdl2_8rwobject_python_write(SDL_RWops *, void const *, size_t, size_t); /*proto*/ static int __pyx_f_11pygame_sdl2_8rwobject_python_close(SDL_RWops *); /*proto*/ static Sint64 __pyx_f_11pygame_sdl2_8rwobject_subfile_size(SDL_RWops *); /*proto*/ static Sint64 __pyx_f_11pygame_sdl2_8rwobject_subfile_seek(SDL_RWops *, Sint64, int); /*proto*/ static size_t __pyx_f_11pygame_sdl2_8rwobject_subfile_read(SDL_RWops *, void *, size_t, size_t); /*proto*/ static int __pyx_f_11pygame_sdl2_8rwobject_subfile_close(SDL_RWops *); /*proto*/ static SDL_RWops *__pyx_f_11pygame_sdl2_8rwobject_RWopsFromPython(PyObject *); /*proto*/ #define __Pyx_MODULE_NAME "pygame_sdl2.rwobject" int __pyx_module_is_main_pygame_sdl2__rwobject = 0; /* Implementation of 'pygame_sdl2.rwobject' */ static PyObject *__pyx_builtin_Exception; static PyObject *__pyx_builtin_IOError; static PyObject *__pyx_builtin_AttributeError; static const char __pyx_k_rb[] = "rb"; static const char __pyx_k_sys[] = "sys"; static const char __pyx_k_base[] = "base"; static const char __pyx_k_main[] = "__main__"; static const char __pyx_k_name[] = "name"; static const char __pyx_k_read[] = "read"; static const char __pyx_k_seek[] = "seek"; static const char __pyx_k_tell[] = "tell"; static const char __pyx_k_test[] = "__test__"; static const char __pyx_k_ascii[] = "ascii"; static const char __pyx_k_bytes[] = "bytes_"; static const char __pyx_k_close[] = "close"; static const char __pyx_k_utf_8[] = "utf-8"; static const char __pyx_k_write[] = "write"; static const char __pyx_k_decode[] = "decode"; static const char __pyx_k_encode[] = "encode"; static const char __pyx_k_format[] = "format"; static const char __pyx_k_import[] = "__import__"; static const char __pyx_k_length[] = "length"; static const char __pyx_k_IOError[] = "IOError"; static const char __pyx_k_unicode[] = "unicode_"; static const char __pyx_k_Exception[] = "Exception"; static const char __pyx_k_file_type[] = "file_type"; static const char __pyx_k_fsencoding[] = "fsencoding"; static const char __pyx_k_AttributeError[] = "AttributeError"; static const char __pyx_k_Could_not_open_r[] = "Could not open {!r}: {}"; static const char __pyx_k_Could_not_open_r_2[] = "Could not open {!r}."; static const char __pyx_k_pygame_sdl2_compat[] = "pygame_sdl2.compat"; static const char __pyx_k_getfilesystemencoding[] = "getfilesystemencoding"; static const char __pyx_k_r_is_not_a_filename_or_file_lik[] = "{!r} is not a filename or file-like object."; static PyObject *__pyx_n_s_AttributeError; static PyObject *__pyx_kp_u_Could_not_open_r; static PyObject *__pyx_kp_u_Could_not_open_r_2; static PyObject *__pyx_n_s_Exception; static PyObject *__pyx_n_s_IOError; static PyObject *__pyx_n_u_ascii; static PyObject *__pyx_n_s_base; static PyObject *__pyx_n_s_bytes; static PyObject *__pyx_n_s_close; static PyObject *__pyx_n_s_decode; static PyObject *__pyx_n_s_encode; static PyObject *__pyx_n_s_file_type; static PyObject *__pyx_n_s_format; static PyObject *__pyx_n_s_fsencoding; static PyObject *__pyx_n_s_getfilesystemencoding; static PyObject *__pyx_n_s_import; static PyObject *__pyx_n_s_length; static PyObject *__pyx_n_s_main; static PyObject *__pyx_n_s_name; static PyObject *__pyx_n_s_pygame_sdl2_compat; static PyObject *__pyx_kp_u_r_is_not_a_filename_or_file_lik; static PyObject *__pyx_n_b_rb; static PyObject *__pyx_n_u_rb; static PyObject *__pyx_n_s_read; static PyObject *__pyx_n_u_read; static PyObject *__pyx_n_s_seek; static PyObject *__pyx_n_s_sys; static PyObject *__pyx_n_s_tell; static PyObject *__pyx_n_s_test; static PyObject *__pyx_n_s_unicode; static PyObject *__pyx_kp_u_utf_8; static PyObject *__pyx_n_s_write; static PyObject *__pyx_n_u_write; static PyObject *__pyx_int_0; static PyObject *__pyx_int_2; static PyObject *__pyx_tuple_; static PyObject *__pyx_tuple__2; static PyObject *__pyx_tuple__3; static PyObject *__pyx_tuple__4; /* "pygame_sdl2/rwobject.pyx":56 * * * cdef set_error(e): # <<<<<<<<<<<<<< * cdef char *msg * e = str(e) */ static PyObject *__pyx_f_11pygame_sdl2_8rwobject_set_error(PyObject *__pyx_v_e) { char *__pyx_v_msg; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; char *__pyx_t_3; __Pyx_RefNannySetupContext("set_error", 0); __Pyx_INCREF(__pyx_v_e); /* "pygame_sdl2/rwobject.pyx":58 * cdef set_error(e): * cdef char *msg * e = str(e) # <<<<<<<<<<<<<< * msg = e * SDL_SetError("%s", msg) */ __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 58, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_INCREF(__pyx_v_e); __Pyx_GIVEREF(__pyx_v_e); PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_e); __pyx_t_2 = __Pyx_PyObject_Call(((PyObject *)(&PyUnicode_Type)), __pyx_t_1, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 58, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF_SET(__pyx_v_e, __pyx_t_2); __pyx_t_2 = 0; /* "pygame_sdl2/rwobject.pyx":59 * cdef char *msg * e = str(e) * msg = e # <<<<<<<<<<<<<< * SDL_SetError("%s", msg) * */ __pyx_t_3 = __Pyx_PyObject_AsString(__pyx_v_e); if (unlikely((!__pyx_t_3) && PyErr_Occurred())) __PYX_ERR(0, 59, __pyx_L1_error) __pyx_v_msg = ((char *)__pyx_t_3); /* "pygame_sdl2/rwobject.pyx":60 * e = str(e) * msg = e * SDL_SetError("%s", msg) # <<<<<<<<<<<<<< * * cdef Sint64 python_size(SDL_RWops *context) with gil: */ SDL_SetError(((char const *)"%s"), __pyx_v_msg); /* "pygame_sdl2/rwobject.pyx":56 * * * cdef set_error(e): # <<<<<<<<<<<<<< * cdef char *msg * e = str(e) */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_AddTraceback("pygame_sdl2.rwobject.set_error", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XDECREF(__pyx_v_e); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/rwobject.pyx":62 * SDL_SetError("%s", msg) * * cdef Sint64 python_size(SDL_RWops *context) with gil: # <<<<<<<<<<<<<< * f = context.hidden.unknown.data1 * */ static Sint64 __pyx_f_11pygame_sdl2_8rwobject_python_size(SDL_RWops *__pyx_v_context) { PyObject *__pyx_v_f = NULL; PyObject *__pyx_v_cur = NULL; PyObject *__pyx_v_rv = NULL; Sint64 __pyx_r; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; PyObject *__pyx_t_5 = NULL; PyObject *__pyx_t_6 = NULL; Py_ssize_t __pyx_t_7; PyObject *__pyx_t_8 = NULL; Sint64 __pyx_t_9; #ifdef WITH_THREAD PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure(); #endif __Pyx_RefNannySetupContext("python_size", 0); /* "pygame_sdl2/rwobject.pyx":63 * * cdef Sint64 python_size(SDL_RWops *context) with gil: * f = context.hidden.unknown.data1 # <<<<<<<<<<<<<< * * try: */ __pyx_t_1 = ((PyObject *)__pyx_v_context->hidden.unknown.data1); __Pyx_INCREF(__pyx_t_1); __pyx_v_f = __pyx_t_1; __pyx_t_1 = 0; /* "pygame_sdl2/rwobject.pyx":65 * f = context.hidden.unknown.data1 * * try: # <<<<<<<<<<<<<< * cur = f.tell() * f.seek(0, 2) */ { __Pyx_PyThreadState_declare __Pyx_PyThreadState_assign __Pyx_ExceptionSave(&__pyx_t_2, &__pyx_t_3, &__pyx_t_4); __Pyx_XGOTREF(__pyx_t_2); __Pyx_XGOTREF(__pyx_t_3); __Pyx_XGOTREF(__pyx_t_4); /*try:*/ { /* "pygame_sdl2/rwobject.pyx":66 * * try: * cur = f.tell() # <<<<<<<<<<<<<< * f.seek(0, 2) * rv = f.tell() */ __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_f, __pyx_n_s_tell); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 66, __pyx_L3_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_6 = NULL; if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_5))) { __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_5); if (likely(__pyx_t_6)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5); __Pyx_INCREF(__pyx_t_6); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_5, function); } } if (__pyx_t_6) { __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_t_6); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 66, __pyx_L3_error) __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; } else { __pyx_t_1 = __Pyx_PyObject_CallNoArg(__pyx_t_5); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 66, __pyx_L3_error) } __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __pyx_v_cur = __pyx_t_1; __pyx_t_1 = 0; /* "pygame_sdl2/rwobject.pyx":67 * try: * cur = f.tell() * f.seek(0, 2) # <<<<<<<<<<<<<< * rv = f.tell() * f.seek(cur, 0) */ __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_f, __pyx_n_s_seek); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 67, __pyx_L3_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_tuple_, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 67, __pyx_L3_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; /* "pygame_sdl2/rwobject.pyx":68 * cur = f.tell() * f.seek(0, 2) * rv = f.tell() # <<<<<<<<<<<<<< * f.seek(cur, 0) * except: */ __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_f, __pyx_n_s_tell); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 68, __pyx_L3_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_6 = NULL; if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_1))) { __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_1); if (likely(__pyx_t_6)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1); __Pyx_INCREF(__pyx_t_6); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_1, function); } } if (__pyx_t_6) { __pyx_t_5 = __Pyx_PyObject_CallOneArg(__pyx_t_1, __pyx_t_6); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 68, __pyx_L3_error) __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; } else { __pyx_t_5 = __Pyx_PyObject_CallNoArg(__pyx_t_1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 68, __pyx_L3_error) } __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_v_rv = __pyx_t_5; __pyx_t_5 = 0; /* "pygame_sdl2/rwobject.pyx":69 * f.seek(0, 2) * rv = f.tell() * f.seek(cur, 0) # <<<<<<<<<<<<<< * except: * return -1 */ __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_f, __pyx_n_s_seek); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 69, __pyx_L3_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_6 = NULL; __pyx_t_7 = 0; if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_1))) { __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_1); if (likely(__pyx_t_6)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1); __Pyx_INCREF(__pyx_t_6); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_1, function); __pyx_t_7 = 1; } } __pyx_t_8 = PyTuple_New(2+__pyx_t_7); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 69, __pyx_L3_error) __Pyx_GOTREF(__pyx_t_8); if (__pyx_t_6) { __Pyx_GIVEREF(__pyx_t_6); PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_6); __pyx_t_6 = NULL; } __Pyx_INCREF(__pyx_v_cur); __Pyx_GIVEREF(__pyx_v_cur); PyTuple_SET_ITEM(__pyx_t_8, 0+__pyx_t_7, __pyx_v_cur); __Pyx_INCREF(__pyx_int_0); __Pyx_GIVEREF(__pyx_int_0); PyTuple_SET_ITEM(__pyx_t_8, 1+__pyx_t_7, __pyx_int_0); __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_8, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 69, __pyx_L3_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; /* "pygame_sdl2/rwobject.pyx":65 * f = context.hidden.unknown.data1 * * try: # <<<<<<<<<<<<<< * cur = f.tell() * f.seek(0, 2) */ } __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; goto __pyx_L10_try_end; __pyx_L3_error:; __Pyx_PyThreadState_assign __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0; __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; /* "pygame_sdl2/rwobject.pyx":70 * rv = f.tell() * f.seek(cur, 0) * except: # <<<<<<<<<<<<<< * return -1 * */ /*except:*/ { __Pyx_AddTraceback("pygame_sdl2.rwobject.python_size", __pyx_clineno, __pyx_lineno, __pyx_filename); if (__Pyx_GetException(&__pyx_t_5, &__pyx_t_1, &__pyx_t_8) < 0) __PYX_ERR(0, 70, __pyx_L5_except_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_GOTREF(__pyx_t_1); __Pyx_GOTREF(__pyx_t_8); /* "pygame_sdl2/rwobject.pyx":71 * f.seek(cur, 0) * except: * return -1 # <<<<<<<<<<<<<< * * return rv */ __pyx_r = -1L; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; goto __pyx_L6_except_return; } __pyx_L5_except_error:; /* "pygame_sdl2/rwobject.pyx":65 * f = context.hidden.unknown.data1 * * try: # <<<<<<<<<<<<<< * cur = f.tell() * f.seek(0, 2) */ __Pyx_PyThreadState_assign __Pyx_XGIVEREF(__pyx_t_2); __Pyx_XGIVEREF(__pyx_t_3); __Pyx_XGIVEREF(__pyx_t_4); __Pyx_ExceptionReset(__pyx_t_2, __pyx_t_3, __pyx_t_4); goto __pyx_L1_error; __pyx_L6_except_return:; __Pyx_PyThreadState_assign __Pyx_XGIVEREF(__pyx_t_2); __Pyx_XGIVEREF(__pyx_t_3); __Pyx_XGIVEREF(__pyx_t_4); __Pyx_ExceptionReset(__pyx_t_2, __pyx_t_3, __pyx_t_4); goto __pyx_L0; __pyx_L10_try_end:; } /* "pygame_sdl2/rwobject.pyx":73 * return -1 * * return rv # <<<<<<<<<<<<<< * * cdef Sint64 python_seek(SDL_RWops *context, Sint64 seek, int whence) with gil: */ __pyx_t_9 = __Pyx_PyInt_As_int64_t(__pyx_v_rv); if (unlikely((__pyx_t_9 == (Sint64)-1) && PyErr_Occurred())) __PYX_ERR(0, 73, __pyx_L1_error) __pyx_r = __pyx_t_9; goto __pyx_L0; /* "pygame_sdl2/rwobject.pyx":62 * SDL_SetError("%s", msg) * * cdef Sint64 python_size(SDL_RWops *context) with gil: # <<<<<<<<<<<<<< * f = context.hidden.unknown.data1 * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_5); __Pyx_XDECREF(__pyx_t_6); __Pyx_XDECREF(__pyx_t_8); __Pyx_WriteUnraisable("pygame_sdl2.rwobject.python_size", __pyx_clineno, __pyx_lineno, __pyx_filename, 0, 0); __pyx_r = 0; __pyx_L0:; __Pyx_XDECREF(__pyx_v_f); __Pyx_XDECREF(__pyx_v_cur); __Pyx_XDECREF(__pyx_v_rv); __Pyx_RefNannyFinishContext(); #ifdef WITH_THREAD PyGILState_Release(__pyx_gilstate_save); #endif return __pyx_r; } /* "pygame_sdl2/rwobject.pyx":75 * return rv * * cdef Sint64 python_seek(SDL_RWops *context, Sint64 seek, int whence) with gil: # <<<<<<<<<<<<<< * f = context.hidden.unknown.data1 * */ static Sint64 __pyx_f_11pygame_sdl2_8rwobject_python_seek(SDL_RWops *__pyx_v_context, Sint64 __pyx_v_seek, int __pyx_v_whence) { PyObject *__pyx_v_f = NULL; PyObject *__pyx_v_rv = NULL; PyObject *__pyx_v_e = NULL; Sint64 __pyx_r; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; PyObject *__pyx_t_5 = NULL; PyObject *__pyx_t_6 = NULL; PyObject *__pyx_t_7 = NULL; PyObject *__pyx_t_8 = NULL; Py_ssize_t __pyx_t_9; PyObject *__pyx_t_10 = NULL; int __pyx_t_11; int __pyx_t_12; char const *__pyx_t_13; PyObject *__pyx_t_14 = NULL; PyObject *__pyx_t_15 = NULL; PyObject *__pyx_t_16 = NULL; PyObject *__pyx_t_17 = NULL; PyObject *__pyx_t_18 = NULL; PyObject *__pyx_t_19 = NULL; Sint64 __pyx_t_20; #ifdef WITH_THREAD PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure(); #endif __Pyx_RefNannySetupContext("python_seek", 0); /* "pygame_sdl2/rwobject.pyx":76 * * cdef Sint64 python_seek(SDL_RWops *context, Sint64 seek, int whence) with gil: * f = context.hidden.unknown.data1 # <<<<<<<<<<<<<< * * try: */ __pyx_t_1 = ((PyObject *)__pyx_v_context->hidden.unknown.data1); __Pyx_INCREF(__pyx_t_1); __pyx_v_f = __pyx_t_1; __pyx_t_1 = 0; /* "pygame_sdl2/rwobject.pyx":78 * f = context.hidden.unknown.data1 * * try: # <<<<<<<<<<<<<< * f.seek(seek, whence) * rv = f.tell() */ { __Pyx_PyThreadState_declare __Pyx_PyThreadState_assign __Pyx_ExceptionSave(&__pyx_t_2, &__pyx_t_3, &__pyx_t_4); __Pyx_XGOTREF(__pyx_t_2); __Pyx_XGOTREF(__pyx_t_3); __Pyx_XGOTREF(__pyx_t_4); /*try:*/ { /* "pygame_sdl2/rwobject.pyx":79 * * try: * f.seek(seek, whence) # <<<<<<<<<<<<<< * rv = f.tell() * except Exception as e: */ __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_f, __pyx_n_s_seek); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 79, __pyx_L3_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_6 = __Pyx_PyInt_From_int64_t(__pyx_v_seek); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 79, __pyx_L3_error) __Pyx_GOTREF(__pyx_t_6); __pyx_t_7 = __Pyx_PyInt_From_int(__pyx_v_whence); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 79, __pyx_L3_error) __Pyx_GOTREF(__pyx_t_7); __pyx_t_8 = NULL; __pyx_t_9 = 0; if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_5))) { __pyx_t_8 = PyMethod_GET_SELF(__pyx_t_5); if (likely(__pyx_t_8)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5); __Pyx_INCREF(__pyx_t_8); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_5, function); __pyx_t_9 = 1; } } __pyx_t_10 = PyTuple_New(2+__pyx_t_9); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 79, __pyx_L3_error) __Pyx_GOTREF(__pyx_t_10); if (__pyx_t_8) { __Pyx_GIVEREF(__pyx_t_8); PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_t_8); __pyx_t_8 = NULL; } __Pyx_GIVEREF(__pyx_t_6); PyTuple_SET_ITEM(__pyx_t_10, 0+__pyx_t_9, __pyx_t_6); __Pyx_GIVEREF(__pyx_t_7); PyTuple_SET_ITEM(__pyx_t_10, 1+__pyx_t_9, __pyx_t_7); __pyx_t_6 = 0; __pyx_t_7 = 0; __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_10, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 79, __pyx_L3_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "pygame_sdl2/rwobject.pyx":80 * try: * f.seek(seek, whence) * rv = f.tell() # <<<<<<<<<<<<<< * except Exception as e: * set_error(e) */ __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_f, __pyx_n_s_tell); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 80, __pyx_L3_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_10 = NULL; if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_5))) { __pyx_t_10 = PyMethod_GET_SELF(__pyx_t_5); if (likely(__pyx_t_10)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5); __Pyx_INCREF(__pyx_t_10); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_5, function); } } if (__pyx_t_10) { __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_t_10); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 80, __pyx_L3_error) __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; } else { __pyx_t_1 = __Pyx_PyObject_CallNoArg(__pyx_t_5); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 80, __pyx_L3_error) } __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __pyx_v_rv = __pyx_t_1; __pyx_t_1 = 0; /* "pygame_sdl2/rwobject.pyx":78 * f = context.hidden.unknown.data1 * * try: # <<<<<<<<<<<<<< * f.seek(seek, whence) * rv = f.tell() */ } __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; goto __pyx_L10_try_end; __pyx_L3_error:; __Pyx_PyThreadState_assign __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0; __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0; __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; /* "pygame_sdl2/rwobject.pyx":81 * f.seek(seek, whence) * rv = f.tell() * except Exception as e: # <<<<<<<<<<<<<< * set_error(e) * return -1 */ __pyx_t_11 = __Pyx_PyErr_ExceptionMatches(__pyx_builtin_Exception); if (__pyx_t_11) { __Pyx_AddTraceback("pygame_sdl2.rwobject.python_seek", __pyx_clineno, __pyx_lineno, __pyx_filename); if (__Pyx_GetException(&__pyx_t_1, &__pyx_t_5, &__pyx_t_10) < 0) __PYX_ERR(0, 81, __pyx_L5_except_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_GOTREF(__pyx_t_5); __Pyx_GOTREF(__pyx_t_10); __Pyx_INCREF(__pyx_t_5); __pyx_v_e = __pyx_t_5; /*try:*/ { /* "pygame_sdl2/rwobject.pyx":82 * rv = f.tell() * except Exception as e: * set_error(e) # <<<<<<<<<<<<<< * return -1 * */ __pyx_t_7 = __pyx_f_11pygame_sdl2_8rwobject_set_error(__pyx_v_e); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 82, __pyx_L16_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; /* "pygame_sdl2/rwobject.pyx":83 * except Exception as e: * set_error(e) * return -1 # <<<<<<<<<<<<<< * * return rv */ __pyx_r = -1L; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; goto __pyx_L15_return; } /* "pygame_sdl2/rwobject.pyx":81 * f.seek(seek, whence) * rv = f.tell() * except Exception as e: # <<<<<<<<<<<<<< * set_error(e) * return -1 */ /*finally:*/ { /*exception exit:*/{ __Pyx_PyThreadState_declare __pyx_L16_error:; __pyx_t_14 = 0; __pyx_t_15 = 0; __pyx_t_16 = 0; __pyx_t_17 = 0; __pyx_t_18 = 0; __pyx_t_19 = 0; __Pyx_PyThreadState_assign __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0; __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; if (PY_MAJOR_VERSION >= 3) __Pyx_ExceptionSwap(&__pyx_t_17, &__pyx_t_18, &__pyx_t_19); if ((PY_MAJOR_VERSION < 3) || unlikely(__Pyx_GetException(&__pyx_t_14, &__pyx_t_15, &__pyx_t_16) < 0)) __Pyx_ErrFetch(&__pyx_t_14, &__pyx_t_15, &__pyx_t_16); __Pyx_XGOTREF(__pyx_t_14); __Pyx_XGOTREF(__pyx_t_15); __Pyx_XGOTREF(__pyx_t_16); __Pyx_XGOTREF(__pyx_t_17); __Pyx_XGOTREF(__pyx_t_18); __Pyx_XGOTREF(__pyx_t_19); __pyx_t_11 = __pyx_lineno; __pyx_t_12 = __pyx_clineno; __pyx_t_13 = __pyx_filename; { __Pyx_DECREF(__pyx_v_e); __pyx_v_e = NULL; } __Pyx_PyThreadState_assign if (PY_MAJOR_VERSION >= 3) { __Pyx_XGIVEREF(__pyx_t_17); __Pyx_XGIVEREF(__pyx_t_18); __Pyx_XGIVEREF(__pyx_t_19); __Pyx_ExceptionReset(__pyx_t_17, __pyx_t_18, __pyx_t_19); } __Pyx_XGIVEREF(__pyx_t_14); __Pyx_XGIVEREF(__pyx_t_15); __Pyx_XGIVEREF(__pyx_t_16); __Pyx_ErrRestore(__pyx_t_14, __pyx_t_15, __pyx_t_16); __pyx_t_14 = 0; __pyx_t_15 = 0; __pyx_t_16 = 0; __pyx_t_17 = 0; __pyx_t_18 = 0; __pyx_t_19 = 0; __pyx_lineno = __pyx_t_11; __pyx_clineno = __pyx_t_12; __pyx_filename = __pyx_t_13; goto __pyx_L5_except_error; } __pyx_L15_return: { __pyx_t_20 = __pyx_r; __Pyx_DECREF(__pyx_v_e); __pyx_v_e = NULL; __pyx_r = __pyx_t_20; goto __pyx_L6_except_return; } } } goto __pyx_L5_except_error; __pyx_L5_except_error:; /* "pygame_sdl2/rwobject.pyx":78 * f = context.hidden.unknown.data1 * * try: # <<<<<<<<<<<<<< * f.seek(seek, whence) * rv = f.tell() */ __Pyx_PyThreadState_assign __Pyx_XGIVEREF(__pyx_t_2); __Pyx_XGIVEREF(__pyx_t_3); __Pyx_XGIVEREF(__pyx_t_4); __Pyx_ExceptionReset(__pyx_t_2, __pyx_t_3, __pyx_t_4); goto __pyx_L1_error; __pyx_L6_except_return:; __Pyx_PyThreadState_assign __Pyx_XGIVEREF(__pyx_t_2); __Pyx_XGIVEREF(__pyx_t_3); __Pyx_XGIVEREF(__pyx_t_4); __Pyx_ExceptionReset(__pyx_t_2, __pyx_t_3, __pyx_t_4); goto __pyx_L0; __pyx_L10_try_end:; } /* "pygame_sdl2/rwobject.pyx":85 * return -1 * * return rv # <<<<<<<<<<<<<< * * cdef size_t python_read(SDL_RWops *context, void *ptr, size_t size, size_t maxnum) with gil: */ __pyx_t_20 = __Pyx_PyInt_As_int64_t(__pyx_v_rv); if (unlikely((__pyx_t_20 == (Sint64)-1) && PyErr_Occurred())) __PYX_ERR(0, 85, __pyx_L1_error) __pyx_r = __pyx_t_20; goto __pyx_L0; /* "pygame_sdl2/rwobject.pyx":75 * return rv * * cdef Sint64 python_seek(SDL_RWops *context, Sint64 seek, int whence) with gil: # <<<<<<<<<<<<<< * f = context.hidden.unknown.data1 * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_5); __Pyx_XDECREF(__pyx_t_6); __Pyx_XDECREF(__pyx_t_7); __Pyx_XDECREF(__pyx_t_8); __Pyx_XDECREF(__pyx_t_10); __Pyx_WriteUnraisable("pygame_sdl2.rwobject.python_seek", __pyx_clineno, __pyx_lineno, __pyx_filename, 0, 0); __pyx_r = 0; __pyx_L0:; __Pyx_XDECREF(__pyx_v_f); __Pyx_XDECREF(__pyx_v_rv); __Pyx_XDECREF(__pyx_v_e); __Pyx_RefNannyFinishContext(); #ifdef WITH_THREAD PyGILState_Release(__pyx_gilstate_save); #endif return __pyx_r; } /* "pygame_sdl2/rwobject.pyx":87 * return rv * * cdef size_t python_read(SDL_RWops *context, void *ptr, size_t size, size_t maxnum) with gil: # <<<<<<<<<<<<<< * f = context.hidden.unknown.data1 * */ static size_t __pyx_f_11pygame_sdl2_8rwobject_python_read(SDL_RWops *__pyx_v_context, void *__pyx_v_ptr, size_t __pyx_v_size, size_t __pyx_v_maxnum) { PyObject *__pyx_v_f = NULL; PyObject *__pyx_v_data = NULL; PyObject *__pyx_v_e = NULL; size_t __pyx_r; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; PyObject *__pyx_t_5 = NULL; PyObject *__pyx_t_6 = NULL; PyObject *__pyx_t_7 = NULL; PyObject *__pyx_t_8 = NULL; int __pyx_t_9; int __pyx_t_10; char const *__pyx_t_11; PyObject *__pyx_t_12 = NULL; PyObject *__pyx_t_13 = NULL; PyObject *__pyx_t_14 = NULL; PyObject *__pyx_t_15 = NULL; PyObject *__pyx_t_16 = NULL; PyObject *__pyx_t_17 = NULL; size_t __pyx_t_18; char *__pyx_t_19; Py_ssize_t __pyx_t_20; #ifdef WITH_THREAD PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure(); #endif __Pyx_RefNannySetupContext("python_read", 0); /* "pygame_sdl2/rwobject.pyx":88 * * cdef size_t python_read(SDL_RWops *context, void *ptr, size_t size, size_t maxnum) with gil: * f = context.hidden.unknown.data1 # <<<<<<<<<<<<<< * * try: */ __pyx_t_1 = ((PyObject *)__pyx_v_context->hidden.unknown.data1); __Pyx_INCREF(__pyx_t_1); __pyx_v_f = __pyx_t_1; __pyx_t_1 = 0; /* "pygame_sdl2/rwobject.pyx":90 * f = context.hidden.unknown.data1 * * try: # <<<<<<<<<<<<<< * data = f.read(size * maxnum) * except Exception as e: */ { __Pyx_PyThreadState_declare __Pyx_PyThreadState_assign __Pyx_ExceptionSave(&__pyx_t_2, &__pyx_t_3, &__pyx_t_4); __Pyx_XGOTREF(__pyx_t_2); __Pyx_XGOTREF(__pyx_t_3); __Pyx_XGOTREF(__pyx_t_4); /*try:*/ { /* "pygame_sdl2/rwobject.pyx":91 * * try: * data = f.read(size * maxnum) # <<<<<<<<<<<<<< * except Exception as e: * set_error(e) */ __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_f, __pyx_n_s_read); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 91, __pyx_L3_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_6 = __Pyx_PyInt_FromSize_t((__pyx_v_size * __pyx_v_maxnum)); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 91, __pyx_L3_error) __Pyx_GOTREF(__pyx_t_6); __pyx_t_7 = NULL; if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_5))) { __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_5); if (likely(__pyx_t_7)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5); __Pyx_INCREF(__pyx_t_7); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_5, function); } } if (!__pyx_t_7) { __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_t_6); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 91, __pyx_L3_error) __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_GOTREF(__pyx_t_1); } else { __pyx_t_8 = PyTuple_New(1+1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 91, __pyx_L3_error) __Pyx_GOTREF(__pyx_t_8); __Pyx_GIVEREF(__pyx_t_7); PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_7); __pyx_t_7 = NULL; __Pyx_GIVEREF(__pyx_t_6); PyTuple_SET_ITEM(__pyx_t_8, 0+1, __pyx_t_6); __pyx_t_6 = 0; __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_8, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 91, __pyx_L3_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; } __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __pyx_v_data = __pyx_t_1; __pyx_t_1 = 0; /* "pygame_sdl2/rwobject.pyx":90 * f = context.hidden.unknown.data1 * * try: # <<<<<<<<<<<<<< * data = f.read(size * maxnum) * except Exception as e: */ } __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; goto __pyx_L10_try_end; __pyx_L3_error:; __Pyx_PyThreadState_assign __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0; __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; /* "pygame_sdl2/rwobject.pyx":92 * try: * data = f.read(size * maxnum) * except Exception as e: # <<<<<<<<<<<<<< * set_error(e) * return -1 */ __pyx_t_9 = __Pyx_PyErr_ExceptionMatches(__pyx_builtin_Exception); if (__pyx_t_9) { __Pyx_AddTraceback("pygame_sdl2.rwobject.python_read", __pyx_clineno, __pyx_lineno, __pyx_filename); if (__Pyx_GetException(&__pyx_t_1, &__pyx_t_5, &__pyx_t_8) < 0) __PYX_ERR(0, 92, __pyx_L5_except_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_GOTREF(__pyx_t_5); __Pyx_GOTREF(__pyx_t_8); __Pyx_INCREF(__pyx_t_5); __pyx_v_e = __pyx_t_5; /*try:*/ { /* "pygame_sdl2/rwobject.pyx":93 * data = f.read(size * maxnum) * except Exception as e: * set_error(e) # <<<<<<<<<<<<<< * return -1 * */ __pyx_t_6 = __pyx_f_11pygame_sdl2_8rwobject_set_error(__pyx_v_e); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 93, __pyx_L16_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; /* "pygame_sdl2/rwobject.pyx":94 * except Exception as e: * set_error(e) * return -1 # <<<<<<<<<<<<<< * * memcpy(ptr, data, len(data)) */ __pyx_r = -1L; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; goto __pyx_L15_return; } /* "pygame_sdl2/rwobject.pyx":92 * try: * data = f.read(size * maxnum) * except Exception as e: # <<<<<<<<<<<<<< * set_error(e) * return -1 */ /*finally:*/ { /*exception exit:*/{ __Pyx_PyThreadState_declare __pyx_L16_error:; __pyx_t_12 = 0; __pyx_t_13 = 0; __pyx_t_14 = 0; __pyx_t_15 = 0; __pyx_t_16 = 0; __pyx_t_17 = 0; __Pyx_PyThreadState_assign __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; if (PY_MAJOR_VERSION >= 3) __Pyx_ExceptionSwap(&__pyx_t_15, &__pyx_t_16, &__pyx_t_17); if ((PY_MAJOR_VERSION < 3) || unlikely(__Pyx_GetException(&__pyx_t_12, &__pyx_t_13, &__pyx_t_14) < 0)) __Pyx_ErrFetch(&__pyx_t_12, &__pyx_t_13, &__pyx_t_14); __Pyx_XGOTREF(__pyx_t_12); __Pyx_XGOTREF(__pyx_t_13); __Pyx_XGOTREF(__pyx_t_14); __Pyx_XGOTREF(__pyx_t_15); __Pyx_XGOTREF(__pyx_t_16); __Pyx_XGOTREF(__pyx_t_17); __pyx_t_9 = __pyx_lineno; __pyx_t_10 = __pyx_clineno; __pyx_t_11 = __pyx_filename; { __Pyx_DECREF(__pyx_v_e); __pyx_v_e = NULL; } __Pyx_PyThreadState_assign if (PY_MAJOR_VERSION >= 3) { __Pyx_XGIVEREF(__pyx_t_15); __Pyx_XGIVEREF(__pyx_t_16); __Pyx_XGIVEREF(__pyx_t_17); __Pyx_ExceptionReset(__pyx_t_15, __pyx_t_16, __pyx_t_17); } __Pyx_XGIVEREF(__pyx_t_12); __Pyx_XGIVEREF(__pyx_t_13); __Pyx_XGIVEREF(__pyx_t_14); __Pyx_ErrRestore(__pyx_t_12, __pyx_t_13, __pyx_t_14); __pyx_t_12 = 0; __pyx_t_13 = 0; __pyx_t_14 = 0; __pyx_t_15 = 0; __pyx_t_16 = 0; __pyx_t_17 = 0; __pyx_lineno = __pyx_t_9; __pyx_clineno = __pyx_t_10; __pyx_filename = __pyx_t_11; goto __pyx_L5_except_error; } __pyx_L15_return: { __pyx_t_18 = __pyx_r; __Pyx_DECREF(__pyx_v_e); __pyx_v_e = NULL; __pyx_r = __pyx_t_18; goto __pyx_L6_except_return; } } } goto __pyx_L5_except_error; __pyx_L5_except_error:; /* "pygame_sdl2/rwobject.pyx":90 * f = context.hidden.unknown.data1 * * try: # <<<<<<<<<<<<<< * data = f.read(size * maxnum) * except Exception as e: */ __Pyx_PyThreadState_assign __Pyx_XGIVEREF(__pyx_t_2); __Pyx_XGIVEREF(__pyx_t_3); __Pyx_XGIVEREF(__pyx_t_4); __Pyx_ExceptionReset(__pyx_t_2, __pyx_t_3, __pyx_t_4); goto __pyx_L1_error; __pyx_L6_except_return:; __Pyx_PyThreadState_assign __Pyx_XGIVEREF(__pyx_t_2); __Pyx_XGIVEREF(__pyx_t_3); __Pyx_XGIVEREF(__pyx_t_4); __Pyx_ExceptionReset(__pyx_t_2, __pyx_t_3, __pyx_t_4); goto __pyx_L0; __pyx_L10_try_end:; } /* "pygame_sdl2/rwobject.pyx":96 * return -1 * * memcpy(ptr, data, len(data)) # <<<<<<<<<<<<<< * return len(data) * */ __pyx_t_19 = __Pyx_PyObject_AsString(__pyx_v_data); if (unlikely((!__pyx_t_19) && PyErr_Occurred())) __PYX_ERR(0, 96, __pyx_L1_error) __pyx_t_20 = PyObject_Length(__pyx_v_data); if (unlikely(__pyx_t_20 == -1)) __PYX_ERR(0, 96, __pyx_L1_error) memcpy(__pyx_v_ptr, ((void *)((char *)__pyx_t_19)), __pyx_t_20); /* "pygame_sdl2/rwobject.pyx":97 * * memcpy(ptr, data, len(data)) * return len(data) # <<<<<<<<<<<<<< * * cdef size_t python_write(SDL_RWops *context, const void *ptr, size_t size, size_t maxnum) with gil: */ __pyx_t_20 = PyObject_Length(__pyx_v_data); if (unlikely(__pyx_t_20 == -1)) __PYX_ERR(0, 97, __pyx_L1_error) __pyx_r = __pyx_t_20; goto __pyx_L0; /* "pygame_sdl2/rwobject.pyx":87 * return rv * * cdef size_t python_read(SDL_RWops *context, void *ptr, size_t size, size_t maxnum) with gil: # <<<<<<<<<<<<<< * f = context.hidden.unknown.data1 * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_5); __Pyx_XDECREF(__pyx_t_6); __Pyx_XDECREF(__pyx_t_7); __Pyx_XDECREF(__pyx_t_8); __Pyx_WriteUnraisable("pygame_sdl2.rwobject.python_read", __pyx_clineno, __pyx_lineno, __pyx_filename, 0, 0); __pyx_r = 0; __pyx_L0:; __Pyx_XDECREF(__pyx_v_f); __Pyx_XDECREF(__pyx_v_data); __Pyx_XDECREF(__pyx_v_e); __Pyx_RefNannyFinishContext(); #ifdef WITH_THREAD PyGILState_Release(__pyx_gilstate_save); #endif return __pyx_r; } /* "pygame_sdl2/rwobject.pyx":99 * return len(data) * * cdef size_t python_write(SDL_RWops *context, const void *ptr, size_t size, size_t maxnum) with gil: # <<<<<<<<<<<<<< * f = context.hidden.unknown.data1 * data = ( ptr)[:size * maxnum] */ static size_t __pyx_f_11pygame_sdl2_8rwobject_python_write(SDL_RWops *__pyx_v_context, void const *__pyx_v_ptr, size_t __pyx_v_size, size_t __pyx_v_maxnum) { PyObject *__pyx_v_f = NULL; PyObject *__pyx_v_data = NULL; PyObject *__pyx_v_e = NULL; size_t __pyx_r; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; PyObject *__pyx_t_5 = NULL; PyObject *__pyx_t_6 = NULL; PyObject *__pyx_t_7 = NULL; int __pyx_t_8; int __pyx_t_9; char const *__pyx_t_10; PyObject *__pyx_t_11 = NULL; PyObject *__pyx_t_12 = NULL; PyObject *__pyx_t_13 = NULL; PyObject *__pyx_t_14 = NULL; PyObject *__pyx_t_15 = NULL; PyObject *__pyx_t_16 = NULL; size_t __pyx_t_17; Py_ssize_t __pyx_t_18; #ifdef WITH_THREAD PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure(); #endif __Pyx_RefNannySetupContext("python_write", 0); /* "pygame_sdl2/rwobject.pyx":100 * * cdef size_t python_write(SDL_RWops *context, const void *ptr, size_t size, size_t maxnum) with gil: * f = context.hidden.unknown.data1 # <<<<<<<<<<<<<< * data = ( ptr)[:size * maxnum] * */ __pyx_t_1 = ((PyObject *)__pyx_v_context->hidden.unknown.data1); __Pyx_INCREF(__pyx_t_1); __pyx_v_f = __pyx_t_1; __pyx_t_1 = 0; /* "pygame_sdl2/rwobject.pyx":101 * cdef size_t python_write(SDL_RWops *context, const void *ptr, size_t size, size_t maxnum) with gil: * f = context.hidden.unknown.data1 * data = ( ptr)[:size * maxnum] # <<<<<<<<<<<<<< * * try: */ __pyx_t_1 = __Pyx_PyBytes_FromStringAndSize(((char *)__pyx_v_ptr) + 0, (__pyx_v_size * __pyx_v_maxnum) - 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 101, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_data = ((PyObject*)__pyx_t_1); __pyx_t_1 = 0; /* "pygame_sdl2/rwobject.pyx":103 * data = ( ptr)[:size * maxnum] * * try: # <<<<<<<<<<<<<< * f.write(data) * except Exception as e: */ { __Pyx_PyThreadState_declare __Pyx_PyThreadState_assign __Pyx_ExceptionSave(&__pyx_t_2, &__pyx_t_3, &__pyx_t_4); __Pyx_XGOTREF(__pyx_t_2); __Pyx_XGOTREF(__pyx_t_3); __Pyx_XGOTREF(__pyx_t_4); /*try:*/ { /* "pygame_sdl2/rwobject.pyx":104 * * try: * f.write(data) # <<<<<<<<<<<<<< * except Exception as e: * set_error(e) */ __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_f, __pyx_n_s_write); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 104, __pyx_L3_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_6 = NULL; if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_5))) { __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_5); if (likely(__pyx_t_6)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5); __Pyx_INCREF(__pyx_t_6); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_5, function); } } if (!__pyx_t_6) { __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_v_data); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 104, __pyx_L3_error) __Pyx_GOTREF(__pyx_t_1); } else { __pyx_t_7 = PyTuple_New(1+1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 104, __pyx_L3_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_GIVEREF(__pyx_t_6); PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_6); __pyx_t_6 = NULL; __Pyx_INCREF(__pyx_v_data); __Pyx_GIVEREF(__pyx_v_data); PyTuple_SET_ITEM(__pyx_t_7, 0+1, __pyx_v_data); __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_7, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 104, __pyx_L3_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; } __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "pygame_sdl2/rwobject.pyx":103 * data = ( ptr)[:size * maxnum] * * try: # <<<<<<<<<<<<<< * f.write(data) * except Exception as e: */ } __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; goto __pyx_L10_try_end; __pyx_L3_error:; __Pyx_PyThreadState_assign __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; /* "pygame_sdl2/rwobject.pyx":105 * try: * f.write(data) * except Exception as e: # <<<<<<<<<<<<<< * set_error(e) * return -1 */ __pyx_t_8 = __Pyx_PyErr_ExceptionMatches(__pyx_builtin_Exception); if (__pyx_t_8) { __Pyx_AddTraceback("pygame_sdl2.rwobject.python_write", __pyx_clineno, __pyx_lineno, __pyx_filename); if (__Pyx_GetException(&__pyx_t_1, &__pyx_t_5, &__pyx_t_7) < 0) __PYX_ERR(0, 105, __pyx_L5_except_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_GOTREF(__pyx_t_5); __Pyx_GOTREF(__pyx_t_7); __Pyx_INCREF(__pyx_t_5); __pyx_v_e = __pyx_t_5; /*try:*/ { /* "pygame_sdl2/rwobject.pyx":106 * f.write(data) * except Exception as e: * set_error(e) # <<<<<<<<<<<<<< * return -1 * */ __pyx_t_6 = __pyx_f_11pygame_sdl2_8rwobject_set_error(__pyx_v_e); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 106, __pyx_L16_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; /* "pygame_sdl2/rwobject.pyx":107 * except Exception as e: * set_error(e) * return -1 # <<<<<<<<<<<<<< * * return len(data) */ __pyx_r = -1L; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; goto __pyx_L15_return; } /* "pygame_sdl2/rwobject.pyx":105 * try: * f.write(data) * except Exception as e: # <<<<<<<<<<<<<< * set_error(e) * return -1 */ /*finally:*/ { /*exception exit:*/{ __Pyx_PyThreadState_declare __pyx_L16_error:; __pyx_t_11 = 0; __pyx_t_12 = 0; __pyx_t_13 = 0; __pyx_t_14 = 0; __pyx_t_15 = 0; __pyx_t_16 = 0; __Pyx_PyThreadState_assign __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; if (PY_MAJOR_VERSION >= 3) __Pyx_ExceptionSwap(&__pyx_t_14, &__pyx_t_15, &__pyx_t_16); if ((PY_MAJOR_VERSION < 3) || unlikely(__Pyx_GetException(&__pyx_t_11, &__pyx_t_12, &__pyx_t_13) < 0)) __Pyx_ErrFetch(&__pyx_t_11, &__pyx_t_12, &__pyx_t_13); __Pyx_XGOTREF(__pyx_t_11); __Pyx_XGOTREF(__pyx_t_12); __Pyx_XGOTREF(__pyx_t_13); __Pyx_XGOTREF(__pyx_t_14); __Pyx_XGOTREF(__pyx_t_15); __Pyx_XGOTREF(__pyx_t_16); __pyx_t_8 = __pyx_lineno; __pyx_t_9 = __pyx_clineno; __pyx_t_10 = __pyx_filename; { __Pyx_DECREF(__pyx_v_e); __pyx_v_e = NULL; } __Pyx_PyThreadState_assign if (PY_MAJOR_VERSION >= 3) { __Pyx_XGIVEREF(__pyx_t_14); __Pyx_XGIVEREF(__pyx_t_15); __Pyx_XGIVEREF(__pyx_t_16); __Pyx_ExceptionReset(__pyx_t_14, __pyx_t_15, __pyx_t_16); } __Pyx_XGIVEREF(__pyx_t_11); __Pyx_XGIVEREF(__pyx_t_12); __Pyx_XGIVEREF(__pyx_t_13); __Pyx_ErrRestore(__pyx_t_11, __pyx_t_12, __pyx_t_13); __pyx_t_11 = 0; __pyx_t_12 = 0; __pyx_t_13 = 0; __pyx_t_14 = 0; __pyx_t_15 = 0; __pyx_t_16 = 0; __pyx_lineno = __pyx_t_8; __pyx_clineno = __pyx_t_9; __pyx_filename = __pyx_t_10; goto __pyx_L5_except_error; } __pyx_L15_return: { __pyx_t_17 = __pyx_r; __Pyx_DECREF(__pyx_v_e); __pyx_v_e = NULL; __pyx_r = __pyx_t_17; goto __pyx_L6_except_return; } } } goto __pyx_L5_except_error; __pyx_L5_except_error:; /* "pygame_sdl2/rwobject.pyx":103 * data = ( ptr)[:size * maxnum] * * try: # <<<<<<<<<<<<<< * f.write(data) * except Exception as e: */ __Pyx_PyThreadState_assign __Pyx_XGIVEREF(__pyx_t_2); __Pyx_XGIVEREF(__pyx_t_3); __Pyx_XGIVEREF(__pyx_t_4); __Pyx_ExceptionReset(__pyx_t_2, __pyx_t_3, __pyx_t_4); goto __pyx_L1_error; __pyx_L6_except_return:; __Pyx_PyThreadState_assign __Pyx_XGIVEREF(__pyx_t_2); __Pyx_XGIVEREF(__pyx_t_3); __Pyx_XGIVEREF(__pyx_t_4); __Pyx_ExceptionReset(__pyx_t_2, __pyx_t_3, __pyx_t_4); goto __pyx_L0; __pyx_L10_try_end:; } /* "pygame_sdl2/rwobject.pyx":109 * return -1 * * return len(data) # <<<<<<<<<<<<<< * * cdef int python_close(SDL_RWops *context) with gil: */ __pyx_t_18 = PyBytes_GET_SIZE(__pyx_v_data); if (unlikely(__pyx_t_18 == -1)) __PYX_ERR(0, 109, __pyx_L1_error) __pyx_r = __pyx_t_18; goto __pyx_L0; /* "pygame_sdl2/rwobject.pyx":99 * return len(data) * * cdef size_t python_write(SDL_RWops *context, const void *ptr, size_t size, size_t maxnum) with gil: # <<<<<<<<<<<<<< * f = context.hidden.unknown.data1 * data = ( ptr)[:size * maxnum] */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_5); __Pyx_XDECREF(__pyx_t_6); __Pyx_XDECREF(__pyx_t_7); __Pyx_WriteUnraisable("pygame_sdl2.rwobject.python_write", __pyx_clineno, __pyx_lineno, __pyx_filename, 0, 0); __pyx_r = 0; __pyx_L0:; __Pyx_XDECREF(__pyx_v_f); __Pyx_XDECREF(__pyx_v_data); __Pyx_XDECREF(__pyx_v_e); __Pyx_RefNannyFinishContext(); #ifdef WITH_THREAD PyGILState_Release(__pyx_gilstate_save); #endif return __pyx_r; } /* "pygame_sdl2/rwobject.pyx":111 * return len(data) * * cdef int python_close(SDL_RWops *context) with gil: # <<<<<<<<<<<<<< * f = context.hidden.unknown.data1 * */ static int __pyx_f_11pygame_sdl2_8rwobject_python_close(SDL_RWops *__pyx_v_context) { PyObject *__pyx_v_f = NULL; PyObject *__pyx_v_e = NULL; int __pyx_r; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; PyObject *__pyx_t_5 = NULL; PyObject *__pyx_t_6 = NULL; int __pyx_t_7; PyObject *__pyx_t_8 = NULL; int __pyx_t_9; char const *__pyx_t_10; PyObject *__pyx_t_11 = NULL; PyObject *__pyx_t_12 = NULL; PyObject *__pyx_t_13 = NULL; PyObject *__pyx_t_14 = NULL; PyObject *__pyx_t_15 = NULL; PyObject *__pyx_t_16 = NULL; #ifdef WITH_THREAD PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure(); #endif __Pyx_RefNannySetupContext("python_close", 0); /* "pygame_sdl2/rwobject.pyx":112 * * cdef int python_close(SDL_RWops *context) with gil: * f = context.hidden.unknown.data1 # <<<<<<<<<<<<<< * * try: */ __pyx_t_1 = ((PyObject *)__pyx_v_context->hidden.unknown.data1); __Pyx_INCREF(__pyx_t_1); __pyx_v_f = __pyx_t_1; __pyx_t_1 = 0; /* "pygame_sdl2/rwobject.pyx":114 * f = context.hidden.unknown.data1 * * try: # <<<<<<<<<<<<<< * f.close() * except Exception as e: */ { __Pyx_PyThreadState_declare __Pyx_PyThreadState_assign __Pyx_ExceptionSave(&__pyx_t_2, &__pyx_t_3, &__pyx_t_4); __Pyx_XGOTREF(__pyx_t_2); __Pyx_XGOTREF(__pyx_t_3); __Pyx_XGOTREF(__pyx_t_4); /*try:*/ { /* "pygame_sdl2/rwobject.pyx":115 * * try: * f.close() # <<<<<<<<<<<<<< * except Exception as e: * set_error(e) */ __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_f, __pyx_n_s_close); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 115, __pyx_L3_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_6 = NULL; if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_5))) { __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_5); if (likely(__pyx_t_6)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5); __Pyx_INCREF(__pyx_t_6); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_5, function); } } if (__pyx_t_6) { __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_t_6); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 115, __pyx_L3_error) __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; } else { __pyx_t_1 = __Pyx_PyObject_CallNoArg(__pyx_t_5); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 115, __pyx_L3_error) } __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "pygame_sdl2/rwobject.pyx":114 * f = context.hidden.unknown.data1 * * try: # <<<<<<<<<<<<<< * f.close() * except Exception as e: */ } __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; goto __pyx_L10_try_end; __pyx_L3_error:; __Pyx_PyThreadState_assign __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; /* "pygame_sdl2/rwobject.pyx":116 * try: * f.close() * except Exception as e: # <<<<<<<<<<<<<< * set_error(e) * return -1 */ __pyx_t_7 = __Pyx_PyErr_ExceptionMatches(__pyx_builtin_Exception); if (__pyx_t_7) { __Pyx_AddTraceback("pygame_sdl2.rwobject.python_close", __pyx_clineno, __pyx_lineno, __pyx_filename); if (__Pyx_GetException(&__pyx_t_1, &__pyx_t_5, &__pyx_t_6) < 0) __PYX_ERR(0, 116, __pyx_L5_except_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_GOTREF(__pyx_t_5); __Pyx_GOTREF(__pyx_t_6); __Pyx_INCREF(__pyx_t_5); __pyx_v_e = __pyx_t_5; /*try:*/ { /* "pygame_sdl2/rwobject.pyx":117 * f.close() * except Exception as e: * set_error(e) # <<<<<<<<<<<<<< * return -1 * */ __pyx_t_8 = __pyx_f_11pygame_sdl2_8rwobject_set_error(__pyx_v_e); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 117, __pyx_L16_error) __Pyx_GOTREF(__pyx_t_8); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; /* "pygame_sdl2/rwobject.pyx":118 * except Exception as e: * set_error(e) * return -1 # <<<<<<<<<<<<<< * * Py_DECREF(f) */ __pyx_r = -1; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; goto __pyx_L15_return; } /* "pygame_sdl2/rwobject.pyx":116 * try: * f.close() * except Exception as e: # <<<<<<<<<<<<<< * set_error(e) * return -1 */ /*finally:*/ { /*exception exit:*/{ __Pyx_PyThreadState_declare __pyx_L16_error:; __pyx_t_11 = 0; __pyx_t_12 = 0; __pyx_t_13 = 0; __pyx_t_14 = 0; __pyx_t_15 = 0; __pyx_t_16 = 0; __Pyx_PyThreadState_assign __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0; if (PY_MAJOR_VERSION >= 3) __Pyx_ExceptionSwap(&__pyx_t_14, &__pyx_t_15, &__pyx_t_16); if ((PY_MAJOR_VERSION < 3) || unlikely(__Pyx_GetException(&__pyx_t_11, &__pyx_t_12, &__pyx_t_13) < 0)) __Pyx_ErrFetch(&__pyx_t_11, &__pyx_t_12, &__pyx_t_13); __Pyx_XGOTREF(__pyx_t_11); __Pyx_XGOTREF(__pyx_t_12); __Pyx_XGOTREF(__pyx_t_13); __Pyx_XGOTREF(__pyx_t_14); __Pyx_XGOTREF(__pyx_t_15); __Pyx_XGOTREF(__pyx_t_16); __pyx_t_7 = __pyx_lineno; __pyx_t_9 = __pyx_clineno; __pyx_t_10 = __pyx_filename; { __Pyx_DECREF(__pyx_v_e); __pyx_v_e = NULL; } __Pyx_PyThreadState_assign if (PY_MAJOR_VERSION >= 3) { __Pyx_XGIVEREF(__pyx_t_14); __Pyx_XGIVEREF(__pyx_t_15); __Pyx_XGIVEREF(__pyx_t_16); __Pyx_ExceptionReset(__pyx_t_14, __pyx_t_15, __pyx_t_16); } __Pyx_XGIVEREF(__pyx_t_11); __Pyx_XGIVEREF(__pyx_t_12); __Pyx_XGIVEREF(__pyx_t_13); __Pyx_ErrRestore(__pyx_t_11, __pyx_t_12, __pyx_t_13); __pyx_t_11 = 0; __pyx_t_12 = 0; __pyx_t_13 = 0; __pyx_t_14 = 0; __pyx_t_15 = 0; __pyx_t_16 = 0; __pyx_lineno = __pyx_t_7; __pyx_clineno = __pyx_t_9; __pyx_filename = __pyx_t_10; goto __pyx_L5_except_error; } __pyx_L15_return: { __pyx_t_9 = __pyx_r; __Pyx_DECREF(__pyx_v_e); __pyx_v_e = NULL; __pyx_r = __pyx_t_9; goto __pyx_L6_except_return; } } } goto __pyx_L5_except_error; __pyx_L5_except_error:; /* "pygame_sdl2/rwobject.pyx":114 * f = context.hidden.unknown.data1 * * try: # <<<<<<<<<<<<<< * f.close() * except Exception as e: */ __Pyx_PyThreadState_assign __Pyx_XGIVEREF(__pyx_t_2); __Pyx_XGIVEREF(__pyx_t_3); __Pyx_XGIVEREF(__pyx_t_4); __Pyx_ExceptionReset(__pyx_t_2, __pyx_t_3, __pyx_t_4); goto __pyx_L1_error; __pyx_L6_except_return:; __Pyx_PyThreadState_assign __Pyx_XGIVEREF(__pyx_t_2); __Pyx_XGIVEREF(__pyx_t_3); __Pyx_XGIVEREF(__pyx_t_4); __Pyx_ExceptionReset(__pyx_t_2, __pyx_t_3, __pyx_t_4); goto __pyx_L0; __pyx_L10_try_end:; } /* "pygame_sdl2/rwobject.pyx":120 * return -1 * * Py_DECREF(f) # <<<<<<<<<<<<<< * SDL_FreeRW(context) * return 0 */ Py_DECREF(__pyx_v_f); /* "pygame_sdl2/rwobject.pyx":121 * * Py_DECREF(f) * SDL_FreeRW(context) # <<<<<<<<<<<<<< * return 0 * */ SDL_FreeRW(__pyx_v_context); /* "pygame_sdl2/rwobject.pyx":122 * Py_DECREF(f) * SDL_FreeRW(context) * return 0 # <<<<<<<<<<<<<< * * cdef struct SubFile: */ __pyx_r = 0; goto __pyx_L0; /* "pygame_sdl2/rwobject.pyx":111 * return len(data) * * cdef int python_close(SDL_RWops *context) with gil: # <<<<<<<<<<<<<< * f = context.hidden.unknown.data1 * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_5); __Pyx_XDECREF(__pyx_t_6); __Pyx_XDECREF(__pyx_t_8); __Pyx_WriteUnraisable("pygame_sdl2.rwobject.python_close", __pyx_clineno, __pyx_lineno, __pyx_filename, 0, 0); __pyx_r = 0; __pyx_L0:; __Pyx_XDECREF(__pyx_v_f); __Pyx_XDECREF(__pyx_v_e); __Pyx_RefNannyFinishContext(); #ifdef WITH_THREAD PyGILState_Release(__pyx_gilstate_save); #endif return __pyx_r; } /* "pygame_sdl2/rwobject.pyx":130 * Sint64 tell * * cdef Sint64 subfile_size(SDL_RWops *context) nogil: # <<<<<<<<<<<<<< * cdef SubFile *sf = context.hidden.unknown.data1 * return sf.length */ static Sint64 __pyx_f_11pygame_sdl2_8rwobject_subfile_size(SDL_RWops *__pyx_v_context) { struct __pyx_t_11pygame_sdl2_8rwobject_SubFile *__pyx_v_sf; Sint64 __pyx_r; /* "pygame_sdl2/rwobject.pyx":131 * * cdef Sint64 subfile_size(SDL_RWops *context) nogil: * cdef SubFile *sf = context.hidden.unknown.data1 # <<<<<<<<<<<<<< * return sf.length * */ __pyx_v_sf = ((struct __pyx_t_11pygame_sdl2_8rwobject_SubFile *)__pyx_v_context->hidden.unknown.data1); /* "pygame_sdl2/rwobject.pyx":132 * cdef Sint64 subfile_size(SDL_RWops *context) nogil: * cdef SubFile *sf = context.hidden.unknown.data1 * return sf.length # <<<<<<<<<<<<<< * * cdef Sint64 subfile_seek(SDL_RWops *context, Sint64 seek, int whence) nogil: */ __pyx_r = __pyx_v_sf->length; goto __pyx_L0; /* "pygame_sdl2/rwobject.pyx":130 * Sint64 tell * * cdef Sint64 subfile_size(SDL_RWops *context) nogil: # <<<<<<<<<<<<<< * cdef SubFile *sf = context.hidden.unknown.data1 * return sf.length */ /* function exit code */ __pyx_L0:; return __pyx_r; } /* "pygame_sdl2/rwobject.pyx":134 * return sf.length * * cdef Sint64 subfile_seek(SDL_RWops *context, Sint64 seek, int whence) nogil: # <<<<<<<<<<<<<< * cdef SubFile *sf = context.hidden.unknown.data1 * */ static Sint64 __pyx_f_11pygame_sdl2_8rwobject_subfile_seek(SDL_RWops *__pyx_v_context, Sint64 __pyx_v_seek, int __pyx_v_whence) { struct __pyx_t_11pygame_sdl2_8rwobject_SubFile *__pyx_v_sf; Sint64 __pyx_r; /* "pygame_sdl2/rwobject.pyx":135 * * cdef Sint64 subfile_seek(SDL_RWops *context, Sint64 seek, int whence) nogil: * cdef SubFile *sf = context.hidden.unknown.data1 # <<<<<<<<<<<<<< * * if whence == RW_SEEK_SET: */ __pyx_v_sf = ((struct __pyx_t_11pygame_sdl2_8rwobject_SubFile *)__pyx_v_context->hidden.unknown.data1); /* "pygame_sdl2/rwobject.pyx":137 * cdef SubFile *sf = context.hidden.unknown.data1 * * if whence == RW_SEEK_SET: # <<<<<<<<<<<<<< * sf.tell = SDL_RWseek(sf.rw, seek + sf.base, RW_SEEK_SET) - sf.base * elif whence == RW_SEEK_CUR: */ switch (__pyx_v_whence) { case RW_SEEK_SET: /* "pygame_sdl2/rwobject.pyx":138 * * if whence == RW_SEEK_SET: * sf.tell = SDL_RWseek(sf.rw, seek + sf.base, RW_SEEK_SET) - sf.base # <<<<<<<<<<<<<< * elif whence == RW_SEEK_CUR: * sf.tell = SDL_RWseek(sf.rw, seek, RW_SEEK_CUR) - sf.base */ __pyx_v_sf->tell = (SDL_RWseek(__pyx_v_sf->rw, (__pyx_v_seek + __pyx_v_sf->base), RW_SEEK_SET) - __pyx_v_sf->base); /* "pygame_sdl2/rwobject.pyx":137 * cdef SubFile *sf = context.hidden.unknown.data1 * * if whence == RW_SEEK_SET: # <<<<<<<<<<<<<< * sf.tell = SDL_RWseek(sf.rw, seek + sf.base, RW_SEEK_SET) - sf.base * elif whence == RW_SEEK_CUR: */ break; /* "pygame_sdl2/rwobject.pyx":139 * if whence == RW_SEEK_SET: * sf.tell = SDL_RWseek(sf.rw, seek + sf.base, RW_SEEK_SET) - sf.base * elif whence == RW_SEEK_CUR: # <<<<<<<<<<<<<< * sf.tell = SDL_RWseek(sf.rw, seek, RW_SEEK_CUR) - sf.base * elif whence == RW_SEEK_END: */ case RW_SEEK_CUR: /* "pygame_sdl2/rwobject.pyx":140 * sf.tell = SDL_RWseek(sf.rw, seek + sf.base, RW_SEEK_SET) - sf.base * elif whence == RW_SEEK_CUR: * sf.tell = SDL_RWseek(sf.rw, seek, RW_SEEK_CUR) - sf.base # <<<<<<<<<<<<<< * elif whence == RW_SEEK_END: * sf.tell = SDL_RWseek(sf.rw, sf.base + sf.length + seek, RW_SEEK_SET) - sf.base */ __pyx_v_sf->tell = (SDL_RWseek(__pyx_v_sf->rw, __pyx_v_seek, RW_SEEK_CUR) - __pyx_v_sf->base); /* "pygame_sdl2/rwobject.pyx":139 * if whence == RW_SEEK_SET: * sf.tell = SDL_RWseek(sf.rw, seek + sf.base, RW_SEEK_SET) - sf.base * elif whence == RW_SEEK_CUR: # <<<<<<<<<<<<<< * sf.tell = SDL_RWseek(sf.rw, seek, RW_SEEK_CUR) - sf.base * elif whence == RW_SEEK_END: */ break; /* "pygame_sdl2/rwobject.pyx":141 * elif whence == RW_SEEK_CUR: * sf.tell = SDL_RWseek(sf.rw, seek, RW_SEEK_CUR) - sf.base * elif whence == RW_SEEK_END: # <<<<<<<<<<<<<< * sf.tell = SDL_RWseek(sf.rw, sf.base + sf.length + seek, RW_SEEK_SET) - sf.base * */ case RW_SEEK_END: /* "pygame_sdl2/rwobject.pyx":142 * sf.tell = SDL_RWseek(sf.rw, seek, RW_SEEK_CUR) - sf.base * elif whence == RW_SEEK_END: * sf.tell = SDL_RWseek(sf.rw, sf.base + sf.length + seek, RW_SEEK_SET) - sf.base # <<<<<<<<<<<<<< * * return sf.tell */ __pyx_v_sf->tell = (SDL_RWseek(__pyx_v_sf->rw, ((__pyx_v_sf->base + __pyx_v_sf->length) + __pyx_v_seek), RW_SEEK_SET) - __pyx_v_sf->base); /* "pygame_sdl2/rwobject.pyx":141 * elif whence == RW_SEEK_CUR: * sf.tell = SDL_RWseek(sf.rw, seek, RW_SEEK_CUR) - sf.base * elif whence == RW_SEEK_END: # <<<<<<<<<<<<<< * sf.tell = SDL_RWseek(sf.rw, sf.base + sf.length + seek, RW_SEEK_SET) - sf.base * */ break; default: break; } /* "pygame_sdl2/rwobject.pyx":144 * sf.tell = SDL_RWseek(sf.rw, sf.base + sf.length + seek, RW_SEEK_SET) - sf.base * * return sf.tell # <<<<<<<<<<<<<< * * cdef size_t subfile_read(SDL_RWops *context, void *ptr, size_t size, size_t maxnum) nogil: */ __pyx_r = __pyx_v_sf->tell; goto __pyx_L0; /* "pygame_sdl2/rwobject.pyx":134 * return sf.length * * cdef Sint64 subfile_seek(SDL_RWops *context, Sint64 seek, int whence) nogil: # <<<<<<<<<<<<<< * cdef SubFile *sf = context.hidden.unknown.data1 * */ /* function exit code */ __pyx_L0:; return __pyx_r; } /* "pygame_sdl2/rwobject.pyx":146 * return sf.tell * * cdef size_t subfile_read(SDL_RWops *context, void *ptr, size_t size, size_t maxnum) nogil: # <<<<<<<<<<<<<< * cdef SubFile *sf = context.hidden.unknown.data1 * */ static size_t __pyx_f_11pygame_sdl2_8rwobject_subfile_read(SDL_RWops *__pyx_v_context, void *__pyx_v_ptr, size_t __pyx_v_size, size_t __pyx_v_maxnum) { struct __pyx_t_11pygame_sdl2_8rwobject_SubFile *__pyx_v_sf; Sint64 __pyx_v_left; size_t __pyx_v_rv; size_t __pyx_r; int __pyx_t_1; /* "pygame_sdl2/rwobject.pyx":147 * * cdef size_t subfile_read(SDL_RWops *context, void *ptr, size_t size, size_t maxnum) nogil: * cdef SubFile *sf = context.hidden.unknown.data1 # <<<<<<<<<<<<<< * * cdef Sint64 left = sf.length - sf.tell */ __pyx_v_sf = ((struct __pyx_t_11pygame_sdl2_8rwobject_SubFile *)__pyx_v_context->hidden.unknown.data1); /* "pygame_sdl2/rwobject.pyx":149 * cdef SubFile *sf = context.hidden.unknown.data1 * * cdef Sint64 left = sf.length - sf.tell # <<<<<<<<<<<<<< * cdef size_t rv; * */ __pyx_v_left = (__pyx_v_sf->length - __pyx_v_sf->tell); /* "pygame_sdl2/rwobject.pyx":152 * cdef size_t rv; * * if size * maxnum > left: # <<<<<<<<<<<<<< * maxnum = left // size * */ __pyx_t_1 = (((__pyx_v_size * __pyx_v_maxnum) > __pyx_v_left) != 0); if (__pyx_t_1) { /* "pygame_sdl2/rwobject.pyx":153 * * if size * maxnum > left: * maxnum = left // size # <<<<<<<<<<<<<< * * if maxnum == 0: */ if (unlikely(__pyx_v_size == 0)) { #ifdef WITH_THREAD PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure(); #endif PyErr_SetString(PyExc_ZeroDivisionError, "integer division or modulo by zero"); #ifdef WITH_THREAD PyGILState_Release(__pyx_gilstate_save); #endif __PYX_ERR(0, 153, __pyx_L1_error) } __pyx_v_maxnum = (__pyx_v_left / __pyx_v_size); /* "pygame_sdl2/rwobject.pyx":152 * cdef size_t rv; * * if size * maxnum > left: # <<<<<<<<<<<<<< * maxnum = left // size * */ } /* "pygame_sdl2/rwobject.pyx":155 * maxnum = left // size * * if maxnum == 0: # <<<<<<<<<<<<<< * return 0 * */ __pyx_t_1 = ((__pyx_v_maxnum == 0) != 0); if (__pyx_t_1) { /* "pygame_sdl2/rwobject.pyx":156 * * if maxnum == 0: * return 0 # <<<<<<<<<<<<<< * * rv = SDL_RWread(sf.rw, ptr, size, maxnum) */ __pyx_r = 0; goto __pyx_L0; /* "pygame_sdl2/rwobject.pyx":155 * maxnum = left // size * * if maxnum == 0: # <<<<<<<<<<<<<< * return 0 * */ } /* "pygame_sdl2/rwobject.pyx":158 * return 0 * * rv = SDL_RWread(sf.rw, ptr, size, maxnum) # <<<<<<<<<<<<<< * * if rv > 0: */ __pyx_v_rv = SDL_RWread(__pyx_v_sf->rw, __pyx_v_ptr, __pyx_v_size, __pyx_v_maxnum); /* "pygame_sdl2/rwobject.pyx":160 * rv = SDL_RWread(sf.rw, ptr, size, maxnum) * * if rv > 0: # <<<<<<<<<<<<<< * sf.tell += size * rv * */ __pyx_t_1 = ((__pyx_v_rv > 0) != 0); if (__pyx_t_1) { /* "pygame_sdl2/rwobject.pyx":161 * * if rv > 0: * sf.tell += size * rv # <<<<<<<<<<<<<< * * return rv */ __pyx_v_sf->tell = (__pyx_v_sf->tell + (__pyx_v_size * __pyx_v_rv)); /* "pygame_sdl2/rwobject.pyx":160 * rv = SDL_RWread(sf.rw, ptr, size, maxnum) * * if rv > 0: # <<<<<<<<<<<<<< * sf.tell += size * rv * */ } /* "pygame_sdl2/rwobject.pyx":163 * sf.tell += size * rv * * return rv # <<<<<<<<<<<<<< * * cdef int subfile_close(SDL_RWops *context) nogil: */ __pyx_r = __pyx_v_rv; goto __pyx_L0; /* "pygame_sdl2/rwobject.pyx":146 * return sf.tell * * cdef size_t subfile_read(SDL_RWops *context, void *ptr, size_t size, size_t maxnum) nogil: # <<<<<<<<<<<<<< * cdef SubFile *sf = context.hidden.unknown.data1 * */ /* function exit code */ __pyx_L1_error:; __Pyx_WriteUnraisable("pygame_sdl2.rwobject.subfile_read", __pyx_clineno, __pyx_lineno, __pyx_filename, 0, 1); __pyx_r = 0; __pyx_L0:; return __pyx_r; } /* "pygame_sdl2/rwobject.pyx":165 * return rv * * cdef int subfile_close(SDL_RWops *context) nogil: # <<<<<<<<<<<<<< * cdef SubFile *sf = context.hidden.unknown.data1 * */ static int __pyx_f_11pygame_sdl2_8rwobject_subfile_close(SDL_RWops *__pyx_v_context) { struct __pyx_t_11pygame_sdl2_8rwobject_SubFile *__pyx_v_sf; int __pyx_r; /* "pygame_sdl2/rwobject.pyx":166 * * cdef int subfile_close(SDL_RWops *context) nogil: * cdef SubFile *sf = context.hidden.unknown.data1 # <<<<<<<<<<<<<< * * SDL_RWclose(sf.rw) */ __pyx_v_sf = ((struct __pyx_t_11pygame_sdl2_8rwobject_SubFile *)__pyx_v_context->hidden.unknown.data1); /* "pygame_sdl2/rwobject.pyx":168 * cdef SubFile *sf = context.hidden.unknown.data1 * * SDL_RWclose(sf.rw) # <<<<<<<<<<<<<< * free(sf) * SDL_FreeRW(context) */ SDL_RWclose(__pyx_v_sf->rw); /* "pygame_sdl2/rwobject.pyx":169 * * SDL_RWclose(sf.rw) * free(sf) # <<<<<<<<<<<<<< * SDL_FreeRW(context) * */ free(__pyx_v_sf); /* "pygame_sdl2/rwobject.pyx":170 * SDL_RWclose(sf.rw) * free(sf) * SDL_FreeRW(context) # <<<<<<<<<<<<<< * * */ SDL_FreeRW(__pyx_v_context); /* "pygame_sdl2/rwobject.pyx":165 * return rv * * cdef int subfile_close(SDL_RWops *context) nogil: # <<<<<<<<<<<<<< * cdef SubFile *sf = context.hidden.unknown.data1 * */ /* function exit code */ __pyx_r = 0; return __pyx_r; } /* "pygame_sdl2/rwobject.pyx":173 * * * cdef SDL_RWops *to_rwops(filelike, mode="rb") except NULL: # <<<<<<<<<<<<<< * * cdef FILE *f */ static SDL_RWops *__pyx_f_11pygame_sdl2_8rwobject_to_rwops(PyObject *__pyx_v_filelike, struct __pyx_opt_args_11pygame_sdl2_8rwobject_to_rwops *__pyx_optional_args) { PyObject *__pyx_v_mode = ((PyObject *)__pyx_n_u_rb); struct __pyx_t_11pygame_sdl2_8rwobject_SubFile *__pyx_v_sf; SDL_RWops *__pyx_v_rv; SDL_RWops *__pyx_v_rw; char *__pyx_v_cname; char *__pyx_v_cmode; PyObject *__pyx_v_name = NULL; PyObject *__pyx_v_dname = NULL; PyObject *__pyx_v_base = NULL; PyObject *__pyx_v_length = NULL; SDL_RWops *__pyx_r; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_t_2; int __pyx_t_3; PyObject *__pyx_t_4 = NULL; int __pyx_t_5; PyObject *__pyx_t_6 = NULL; PyObject *__pyx_t_7 = NULL; PyObject *__pyx_t_8 = NULL; char *__pyx_t_9; Py_ssize_t __pyx_t_10; PyObject *__pyx_t_11 = NULL; PyObject *__pyx_t_12 = NULL; PyObject *__pyx_t_13 = NULL; Sint64 __pyx_t_14; int __pyx_t_15; __Pyx_RefNannySetupContext("to_rwops", 0); if (__pyx_optional_args) { if (__pyx_optional_args->__pyx_n > 0) { __pyx_v_mode = __pyx_optional_args->mode; } } __Pyx_INCREF(__pyx_v_filelike); __Pyx_INCREF(__pyx_v_mode); /* "pygame_sdl2/rwobject.pyx":182 * cdef char *cmode * * if not isinstance(mode, bytes_): # <<<<<<<<<<<<<< * mode = mode.encode("ascii") * */ __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_bytes); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 182, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = PyObject_IsInstance(__pyx_v_mode, __pyx_t_1); if (unlikely(__pyx_t_2 == -1)) __PYX_ERR(0, 182, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_3 = ((!(__pyx_t_2 != 0)) != 0); if (__pyx_t_3) { /* "pygame_sdl2/rwobject.pyx":183 * * if not isinstance(mode, bytes_): * mode = mode.encode("ascii") # <<<<<<<<<<<<<< * * if isinstance(filelike, file_type) and mode == b"rb": */ __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_mode, __pyx_n_s_encode); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 183, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_tuple__2, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 183, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF_SET(__pyx_v_mode, __pyx_t_4); __pyx_t_4 = 0; /* "pygame_sdl2/rwobject.pyx":182 * cdef char *cmode * * if not isinstance(mode, bytes_): # <<<<<<<<<<<<<< * mode = mode.encode("ascii") * */ } /* "pygame_sdl2/rwobject.pyx":185 * mode = mode.encode("ascii") * * if isinstance(filelike, file_type) and mode == b"rb": # <<<<<<<<<<<<<< * filelike = filelike.name * */ __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_file_type); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 185, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_2 = PyObject_IsInstance(__pyx_v_filelike, __pyx_t_4); if (unlikely(__pyx_t_2 == -1)) __PYX_ERR(0, 185, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_t_5 = (__pyx_t_2 != 0); if (__pyx_t_5) { } else { __pyx_t_3 = __pyx_t_5; goto __pyx_L5_bool_binop_done; } __pyx_t_5 = (__Pyx_PyBytes_Equals(__pyx_v_mode, __pyx_n_b_rb, Py_EQ)); if (unlikely(__pyx_t_5 < 0)) __PYX_ERR(0, 185, __pyx_L1_error) __pyx_t_3 = __pyx_t_5; __pyx_L5_bool_binop_done:; if (__pyx_t_3) { /* "pygame_sdl2/rwobject.pyx":186 * * if isinstance(filelike, file_type) and mode == b"rb": * filelike = filelike.name # <<<<<<<<<<<<<< * * # Try to open as a file. */ __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_filelike, __pyx_n_s_name); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 186, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF_SET(__pyx_v_filelike, __pyx_t_4); __pyx_t_4 = 0; /* "pygame_sdl2/rwobject.pyx":185 * mode = mode.encode("ascii") * * if isinstance(filelike, file_type) and mode == b"rb": # <<<<<<<<<<<<<< * filelike = filelike.name * */ } /* "pygame_sdl2/rwobject.pyx":189 * * # Try to open as a file. * if isinstance(filelike, bytes_): # <<<<<<<<<<<<<< * name = filelike.decode(fsencoding) * elif isinstance(filelike, unicode_): */ __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_bytes); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 189, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_3 = PyObject_IsInstance(__pyx_v_filelike, __pyx_t_4); if (unlikely(__pyx_t_3 == -1)) __PYX_ERR(0, 189, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_t_5 = (__pyx_t_3 != 0); if (__pyx_t_5) { /* "pygame_sdl2/rwobject.pyx":190 * # Try to open as a file. * if isinstance(filelike, bytes_): * name = filelike.decode(fsencoding) # <<<<<<<<<<<<<< * elif isinstance(filelike, unicode_): * name = filelike */ __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_filelike, __pyx_n_s_decode); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 190, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_6 = __Pyx_GetModuleGlobalName(__pyx_n_s_fsencoding); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 190, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __pyx_t_7 = NULL; if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_1))) { __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_1); if (likely(__pyx_t_7)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1); __Pyx_INCREF(__pyx_t_7); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_1, function); } } if (!__pyx_t_7) { __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_t_1, __pyx_t_6); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 190, __pyx_L1_error) __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_GOTREF(__pyx_t_4); } else { __pyx_t_8 = PyTuple_New(1+1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 190, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __Pyx_GIVEREF(__pyx_t_7); PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_7); __pyx_t_7 = NULL; __Pyx_GIVEREF(__pyx_t_6); PyTuple_SET_ITEM(__pyx_t_8, 0+1, __pyx_t_6); __pyx_t_6 = 0; __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_8, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 190, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_v_name = __pyx_t_4; __pyx_t_4 = 0; /* "pygame_sdl2/rwobject.pyx":189 * * # Try to open as a file. * if isinstance(filelike, bytes_): # <<<<<<<<<<<<<< * name = filelike.decode(fsencoding) * elif isinstance(filelike, unicode_): */ goto __pyx_L7; } /* "pygame_sdl2/rwobject.pyx":191 * if isinstance(filelike, bytes_): * name = filelike.decode(fsencoding) * elif isinstance(filelike, unicode_): # <<<<<<<<<<<<<< * name = filelike * else: */ __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_unicode); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 191, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_5 = PyObject_IsInstance(__pyx_v_filelike, __pyx_t_4); if (unlikely(__pyx_t_5 == -1)) __PYX_ERR(0, 191, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_t_3 = (__pyx_t_5 != 0); if (__pyx_t_3) { /* "pygame_sdl2/rwobject.pyx":192 * name = filelike.decode(fsencoding) * elif isinstance(filelike, unicode_): * name = filelike # <<<<<<<<<<<<<< * else: * name = None */ __Pyx_INCREF(__pyx_v_filelike); __pyx_v_name = __pyx_v_filelike; /* "pygame_sdl2/rwobject.pyx":191 * if isinstance(filelike, bytes_): * name = filelike.decode(fsencoding) * elif isinstance(filelike, unicode_): # <<<<<<<<<<<<<< * name = filelike * else: */ goto __pyx_L7; } /* "pygame_sdl2/rwobject.pyx":194 * name = filelike * else: * name = None # <<<<<<<<<<<<<< * * if name: */ /*else*/ { __Pyx_INCREF(Py_None); __pyx_v_name = Py_None; } __pyx_L7:; /* "pygame_sdl2/rwobject.pyx":196 * name = None * * if name: # <<<<<<<<<<<<<< * * dname = name.encode("utf-8") */ __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_v_name); if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(0, 196, __pyx_L1_error) if (__pyx_t_3) { /* "pygame_sdl2/rwobject.pyx":198 * if name: * * dname = name.encode("utf-8") # <<<<<<<<<<<<<< * cname = dname * cmode = mode */ __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_name, __pyx_n_s_encode); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 198, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_tuple__3, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 198, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_v_dname = __pyx_t_1; __pyx_t_1 = 0; /* "pygame_sdl2/rwobject.pyx":199 * * dname = name.encode("utf-8") * cname = dname # <<<<<<<<<<<<<< * cmode = mode * */ __pyx_t_9 = __Pyx_PyObject_AsString(__pyx_v_dname); if (unlikely((!__pyx_t_9) && PyErr_Occurred())) __PYX_ERR(0, 199, __pyx_L1_error) __pyx_v_cname = __pyx_t_9; /* "pygame_sdl2/rwobject.pyx":200 * dname = name.encode("utf-8") * cname = dname * cmode = mode # <<<<<<<<<<<<<< * * with nogil: */ __pyx_t_9 = __Pyx_PyObject_AsString(__pyx_v_mode); if (unlikely((!__pyx_t_9) && PyErr_Occurred())) __PYX_ERR(0, 200, __pyx_L1_error) __pyx_v_cmode = __pyx_t_9; /* "pygame_sdl2/rwobject.pyx":202 * cmode = mode * * with nogil: # <<<<<<<<<<<<<< * rv = SDL_RWFromFile(cname, cmode) * */ { #ifdef WITH_THREAD PyThreadState *_save; Py_UNBLOCK_THREADS #endif /*try:*/ { /* "pygame_sdl2/rwobject.pyx":203 * * with nogil: * rv = SDL_RWFromFile(cname, cmode) # <<<<<<<<<<<<<< * * if rv == NULL: */ __pyx_v_rv = SDL_RWFromFile(__pyx_v_cname, __pyx_v_cmode); } /* "pygame_sdl2/rwobject.pyx":202 * cmode = mode * * with nogil: # <<<<<<<<<<<<<< * rv = SDL_RWFromFile(cname, cmode) * */ /*finally:*/ { /*normal exit:*/{ #ifdef WITH_THREAD Py_BLOCK_THREADS #endif goto __pyx_L11; } __pyx_L11:; } } /* "pygame_sdl2/rwobject.pyx":205 * rv = SDL_RWFromFile(cname, cmode) * * if rv == NULL: # <<<<<<<<<<<<<< * raise IOError("Could not open {!r}: {}".format(filelike, SDL_GetError())) * */ __pyx_t_3 = ((__pyx_v_rv == NULL) != 0); if (__pyx_t_3) { /* "pygame_sdl2/rwobject.pyx":206 * * if rv == NULL: * raise IOError("Could not open {!r}: {}".format(filelike, SDL_GetError())) # <<<<<<<<<<<<<< * * return rv */ __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_kp_u_Could_not_open_r, __pyx_n_s_format); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 206, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_8 = __Pyx_PyBytes_FromString(SDL_GetError()); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 206, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __pyx_t_6 = NULL; __pyx_t_10 = 0; if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_4))) { __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_4); if (likely(__pyx_t_6)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4); __Pyx_INCREF(__pyx_t_6); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_4, function); __pyx_t_10 = 1; } } __pyx_t_7 = PyTuple_New(2+__pyx_t_10); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 206, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); if (__pyx_t_6) { __Pyx_GIVEREF(__pyx_t_6); PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_6); __pyx_t_6 = NULL; } __Pyx_INCREF(__pyx_v_filelike); __Pyx_GIVEREF(__pyx_v_filelike); PyTuple_SET_ITEM(__pyx_t_7, 0+__pyx_t_10, __pyx_v_filelike); __Pyx_GIVEREF(__pyx_t_8); PyTuple_SET_ITEM(__pyx_t_7, 1+__pyx_t_10, __pyx_t_8); __pyx_t_8 = 0; __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_7, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 206, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 206, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_GIVEREF(__pyx_t_1); PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_1); __pyx_t_1 = 0; __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_IOError, __pyx_t_4, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 206, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_Raise(__pyx_t_1, 0, 0, 0); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __PYX_ERR(0, 206, __pyx_L1_error) /* "pygame_sdl2/rwobject.pyx":205 * rv = SDL_RWFromFile(cname, cmode) * * if rv == NULL: # <<<<<<<<<<<<<< * raise IOError("Could not open {!r}: {}".format(filelike, SDL_GetError())) * */ } /* "pygame_sdl2/rwobject.pyx":208 * raise IOError("Could not open {!r}: {}".format(filelike, SDL_GetError())) * * return rv # <<<<<<<<<<<<<< * * if mode == b"rb": */ __pyx_r = __pyx_v_rv; goto __pyx_L0; /* "pygame_sdl2/rwobject.pyx":196 * name = None * * if name: # <<<<<<<<<<<<<< * * dname = name.encode("utf-8") */ } /* "pygame_sdl2/rwobject.pyx":210 * return rv * * if mode == b"rb": # <<<<<<<<<<<<<< * try: * */ __pyx_t_3 = (__Pyx_PyBytes_Equals(__pyx_v_mode, __pyx_n_b_rb, Py_EQ)); if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(0, 210, __pyx_L1_error) if (__pyx_t_3) { /* "pygame_sdl2/rwobject.pyx":211 * * if mode == b"rb": * try: # <<<<<<<<<<<<<< * * # If we have these properties, we're either an APK asset or a Ren'Py-style */ { __Pyx_PyThreadState_declare __Pyx_PyThreadState_assign __Pyx_ExceptionSave(&__pyx_t_11, &__pyx_t_12, &__pyx_t_13); __Pyx_XGOTREF(__pyx_t_11); __Pyx_XGOTREF(__pyx_t_12); __Pyx_XGOTREF(__pyx_t_13); /*try:*/ { /* "pygame_sdl2/rwobject.pyx":215 * # If we have these properties, we're either an APK asset or a Ren'Py-style * # subfile, so use an optimized path. * name = filelike.name # <<<<<<<<<<<<<< * base = filelike.base * length = filelike.length */ __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_filelike, __pyx_n_s_name); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 215, __pyx_L14_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF_SET(__pyx_v_name, __pyx_t_1); __pyx_t_1 = 0; /* "pygame_sdl2/rwobject.pyx":216 * # subfile, so use an optimized path. * name = filelike.name * base = filelike.base # <<<<<<<<<<<<<< * length = filelike.length * */ __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_filelike, __pyx_n_s_base); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 216, __pyx_L14_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_base = __pyx_t_1; __pyx_t_1 = 0; /* "pygame_sdl2/rwobject.pyx":217 * name = filelike.name * base = filelike.base * length = filelike.length # <<<<<<<<<<<<<< * * if name is not None: */ __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_filelike, __pyx_n_s_length); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 217, __pyx_L14_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_length = __pyx_t_1; __pyx_t_1 = 0; /* "pygame_sdl2/rwobject.pyx":219 * length = filelike.length * * if name is not None: # <<<<<<<<<<<<<< * * if not isinstance(name, unicode_): */ __pyx_t_3 = (__pyx_v_name != Py_None); __pyx_t_5 = (__pyx_t_3 != 0); if (__pyx_t_5) { /* "pygame_sdl2/rwobject.pyx":221 * if name is not None: * * if not isinstance(name, unicode_): # <<<<<<<<<<<<<< * name = name.decode(fsencoding) * */ __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_unicode); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 221, __pyx_L14_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_5 = PyObject_IsInstance(__pyx_v_name, __pyx_t_1); if (unlikely(__pyx_t_5 == -1)) __PYX_ERR(0, 221, __pyx_L14_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_3 = ((!(__pyx_t_5 != 0)) != 0); if (__pyx_t_3) { /* "pygame_sdl2/rwobject.pyx":222 * * if not isinstance(name, unicode_): * name = name.decode(fsencoding) # <<<<<<<<<<<<<< * * dname = name.encode("utf-8") */ __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_name, __pyx_n_s_decode); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 222, __pyx_L14_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_7 = __Pyx_GetModuleGlobalName(__pyx_n_s_fsencoding); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 222, __pyx_L14_error) __Pyx_GOTREF(__pyx_t_7); __pyx_t_8 = NULL; if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_4))) { __pyx_t_8 = PyMethod_GET_SELF(__pyx_t_4); if (likely(__pyx_t_8)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4); __Pyx_INCREF(__pyx_t_8); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_4, function); } } if (!__pyx_t_8) { __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_7); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 222, __pyx_L14_error) __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_GOTREF(__pyx_t_1); } else { __pyx_t_6 = PyTuple_New(1+1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 222, __pyx_L14_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_GIVEREF(__pyx_t_8); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_8); __pyx_t_8 = NULL; __Pyx_GIVEREF(__pyx_t_7); PyTuple_SET_ITEM(__pyx_t_6, 0+1, __pyx_t_7); __pyx_t_7 = 0; __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_6, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 222, __pyx_L14_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; } __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF_SET(__pyx_v_name, __pyx_t_1); __pyx_t_1 = 0; /* "pygame_sdl2/rwobject.pyx":221 * if name is not None: * * if not isinstance(name, unicode_): # <<<<<<<<<<<<<< * name = name.decode(fsencoding) * */ } /* "pygame_sdl2/rwobject.pyx":224 * name = name.decode(fsencoding) * * dname = name.encode("utf-8") # <<<<<<<<<<<<<< * cname = dname * */ __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_name, __pyx_n_s_encode); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 224, __pyx_L14_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_tuple__4, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 224, __pyx_L14_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_v_dname = __pyx_t_4; __pyx_t_4 = 0; /* "pygame_sdl2/rwobject.pyx":225 * * dname = name.encode("utf-8") * cname = dname # <<<<<<<<<<<<<< * * with nogil: */ __pyx_t_9 = __Pyx_PyObject_AsString(__pyx_v_dname); if (unlikely((!__pyx_t_9) && PyErr_Occurred())) __PYX_ERR(0, 225, __pyx_L14_error) __pyx_v_cname = __pyx_t_9; /* "pygame_sdl2/rwobject.pyx":227 * cname = dname * * with nogil: # <<<<<<<<<<<<<< * rw = SDL_RWFromFile(cname, b"rb") * */ { #ifdef WITH_THREAD PyThreadState *_save; Py_UNBLOCK_THREADS #endif /*try:*/ { /* "pygame_sdl2/rwobject.pyx":228 * * with nogil: * rw = SDL_RWFromFile(cname, b"rb") # <<<<<<<<<<<<<< * * if not rw: */ __pyx_v_rw = SDL_RWFromFile(__pyx_v_cname, ((char const *)"rb")); } /* "pygame_sdl2/rwobject.pyx":227 * cname = dname * * with nogil: # <<<<<<<<<<<<<< * rw = SDL_RWFromFile(cname, b"rb") * */ /*finally:*/ { /*normal exit:*/{ #ifdef WITH_THREAD Py_BLOCK_THREADS #endif goto __pyx_L28; } __pyx_L28:; } } /* "pygame_sdl2/rwobject.pyx":230 * rw = SDL_RWFromFile(cname, b"rb") * * if not rw: # <<<<<<<<<<<<<< * raise IOError("Could not open {!r}.".format(name)) * */ __pyx_t_3 = ((!(__pyx_v_rw != 0)) != 0); if (__pyx_t_3) { /* "pygame_sdl2/rwobject.pyx":231 * * if not rw: * raise IOError("Could not open {!r}.".format(name)) # <<<<<<<<<<<<<< * * SDL_RWseek(rw, base, RW_SEEK_SET); */ __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_kp_u_Could_not_open_r_2, __pyx_n_s_format); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 231, __pyx_L14_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_6 = NULL; if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_1))) { __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_1); if (likely(__pyx_t_6)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1); __Pyx_INCREF(__pyx_t_6); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_1, function); } } if (!__pyx_t_6) { __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_t_1, __pyx_v_name); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 231, __pyx_L14_error) __Pyx_GOTREF(__pyx_t_4); } else { __pyx_t_7 = PyTuple_New(1+1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 231, __pyx_L14_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_GIVEREF(__pyx_t_6); PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_6); __pyx_t_6 = NULL; __Pyx_INCREF(__pyx_v_name); __Pyx_GIVEREF(__pyx_v_name); PyTuple_SET_ITEM(__pyx_t_7, 0+1, __pyx_v_name); __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_7, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 231, __pyx_L14_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 231, __pyx_L14_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_4); __pyx_t_4 = 0; __pyx_t_4 = __Pyx_PyObject_Call(__pyx_builtin_IOError, __pyx_t_1, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 231, __pyx_L14_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_Raise(__pyx_t_4, 0, 0, 0); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __PYX_ERR(0, 231, __pyx_L14_error) /* "pygame_sdl2/rwobject.pyx":230 * rw = SDL_RWFromFile(cname, b"rb") * * if not rw: # <<<<<<<<<<<<<< * raise IOError("Could not open {!r}.".format(name)) * */ } /* "pygame_sdl2/rwobject.pyx":233 * raise IOError("Could not open {!r}.".format(name)) * * SDL_RWseek(rw, base, RW_SEEK_SET); # <<<<<<<<<<<<<< * * sf = calloc(sizeof(SubFile), 1) */ __pyx_t_14 = __Pyx_PyInt_As_int64_t(__pyx_v_base); if (unlikely((__pyx_t_14 == (Sint64)-1) && PyErr_Occurred())) __PYX_ERR(0, 233, __pyx_L14_error) SDL_RWseek(__pyx_v_rw, __pyx_t_14, RW_SEEK_SET); /* "pygame_sdl2/rwobject.pyx":235 * SDL_RWseek(rw, base, RW_SEEK_SET); * * sf = calloc(sizeof(SubFile), 1) # <<<<<<<<<<<<<< * sf.rw = rw * sf.base = base */ __pyx_v_sf = ((struct __pyx_t_11pygame_sdl2_8rwobject_SubFile *)calloc((sizeof(struct __pyx_t_11pygame_sdl2_8rwobject_SubFile)), 1)); /* "pygame_sdl2/rwobject.pyx":236 * * sf = calloc(sizeof(SubFile), 1) * sf.rw = rw # <<<<<<<<<<<<<< * sf.base = base * sf.length = length */ __pyx_v_sf->rw = __pyx_v_rw; /* "pygame_sdl2/rwobject.pyx":237 * sf = calloc(sizeof(SubFile), 1) * sf.rw = rw * sf.base = base # <<<<<<<<<<<<<< * sf.length = length * sf.tell = 0; */ __pyx_t_14 = __Pyx_PyInt_As_int64_t(__pyx_v_base); if (unlikely((__pyx_t_14 == (Sint64)-1) && PyErr_Occurred())) __PYX_ERR(0, 237, __pyx_L14_error) __pyx_v_sf->base = __pyx_t_14; /* "pygame_sdl2/rwobject.pyx":238 * sf.rw = rw * sf.base = base * sf.length = length # <<<<<<<<<<<<<< * sf.tell = 0; * */ __pyx_t_14 = __Pyx_PyInt_As_int64_t(__pyx_v_length); if (unlikely((__pyx_t_14 == (Sint64)-1) && PyErr_Occurred())) __PYX_ERR(0, 238, __pyx_L14_error) __pyx_v_sf->length = __pyx_t_14; /* "pygame_sdl2/rwobject.pyx":239 * sf.base = base * sf.length = length * sf.tell = 0; # <<<<<<<<<<<<<< * * rv = SDL_AllocRW() */ __pyx_v_sf->tell = 0; /* "pygame_sdl2/rwobject.pyx":241 * sf.tell = 0; * * rv = SDL_AllocRW() # <<<<<<<<<<<<<< * rv.size = subfile_size * rv.seek = subfile_seek */ __pyx_v_rv = SDL_AllocRW(); /* "pygame_sdl2/rwobject.pyx":242 * * rv = SDL_AllocRW() * rv.size = subfile_size # <<<<<<<<<<<<<< * rv.seek = subfile_seek * rv.read = subfile_read */ __pyx_v_rv->size = __pyx_f_11pygame_sdl2_8rwobject_subfile_size; /* "pygame_sdl2/rwobject.pyx":243 * rv = SDL_AllocRW() * rv.size = subfile_size * rv.seek = subfile_seek # <<<<<<<<<<<<<< * rv.read = subfile_read * rv.write = NULL */ __pyx_v_rv->seek = __pyx_f_11pygame_sdl2_8rwobject_subfile_seek; /* "pygame_sdl2/rwobject.pyx":244 * rv.size = subfile_size * rv.seek = subfile_seek * rv.read = subfile_read # <<<<<<<<<<<<<< * rv.write = NULL * rv.close = subfile_close */ __pyx_v_rv->read = __pyx_f_11pygame_sdl2_8rwobject_subfile_read; /* "pygame_sdl2/rwobject.pyx":245 * rv.seek = subfile_seek * rv.read = subfile_read * rv.write = NULL # <<<<<<<<<<<<<< * rv.close = subfile_close * rv.type = 0 */ __pyx_v_rv->write = NULL; /* "pygame_sdl2/rwobject.pyx":246 * rv.read = subfile_read * rv.write = NULL * rv.close = subfile_close # <<<<<<<<<<<<<< * rv.type = 0 * rv.hidden.unknown.data1 = sf */ __pyx_v_rv->close = __pyx_f_11pygame_sdl2_8rwobject_subfile_close; /* "pygame_sdl2/rwobject.pyx":247 * rv.write = NULL * rv.close = subfile_close * rv.type = 0 # <<<<<<<<<<<<<< * rv.hidden.unknown.data1 = sf * */ __pyx_v_rv->type = 0; /* "pygame_sdl2/rwobject.pyx":248 * rv.close = subfile_close * rv.type = 0 * rv.hidden.unknown.data1 = sf # <<<<<<<<<<<<<< * * return rv */ __pyx_v_rv->hidden.unknown.data1 = ((void *)__pyx_v_sf); /* "pygame_sdl2/rwobject.pyx":250 * rv.hidden.unknown.data1 = sf * * return rv # <<<<<<<<<<<<<< * * except AttributeError: */ __pyx_r = __pyx_v_rv; goto __pyx_L18_try_return; /* "pygame_sdl2/rwobject.pyx":219 * length = filelike.length * * if name is not None: # <<<<<<<<<<<<<< * * if not isinstance(name, unicode_): */ } /* "pygame_sdl2/rwobject.pyx":211 * * if mode == b"rb": * try: # <<<<<<<<<<<<<< * * # If we have these properties, we're either an APK asset or a Ren'Py-style */ } __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0; __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0; __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0; goto __pyx_L21_try_end; __pyx_L14_error:; __Pyx_PyThreadState_assign __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0; __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; /* "pygame_sdl2/rwobject.pyx":252 * return rv * * except AttributeError: # <<<<<<<<<<<<<< * pass * */ __pyx_t_15 = __Pyx_PyErr_ExceptionMatches(__pyx_builtin_AttributeError); if (__pyx_t_15) { __Pyx_ErrRestore(0,0,0); goto __pyx_L15_exception_handled; } goto __pyx_L16_except_error; __pyx_L16_except_error:; /* "pygame_sdl2/rwobject.pyx":211 * * if mode == b"rb": * try: # <<<<<<<<<<<<<< * * # If we have these properties, we're either an APK asset or a Ren'Py-style */ __Pyx_PyThreadState_assign __Pyx_XGIVEREF(__pyx_t_11); __Pyx_XGIVEREF(__pyx_t_12); __Pyx_XGIVEREF(__pyx_t_13); __Pyx_ExceptionReset(__pyx_t_11, __pyx_t_12, __pyx_t_13); goto __pyx_L1_error; __pyx_L18_try_return:; __Pyx_PyThreadState_assign __Pyx_XGIVEREF(__pyx_t_11); __Pyx_XGIVEREF(__pyx_t_12); __Pyx_XGIVEREF(__pyx_t_13); __Pyx_ExceptionReset(__pyx_t_11, __pyx_t_12, __pyx_t_13); goto __pyx_L0; __pyx_L15_exception_handled:; __Pyx_PyThreadState_assign __Pyx_XGIVEREF(__pyx_t_11); __Pyx_XGIVEREF(__pyx_t_12); __Pyx_XGIVEREF(__pyx_t_13); __Pyx_ExceptionReset(__pyx_t_11, __pyx_t_12, __pyx_t_13); __pyx_L21_try_end:; } /* "pygame_sdl2/rwobject.pyx":210 * return rv * * if mode == b"rb": # <<<<<<<<<<<<<< * try: * */ } /* "pygame_sdl2/rwobject.pyx":256 * * * if not (hasattr(filelike, "read") or hasattr(filelike, "write")): # <<<<<<<<<<<<<< * raise IOError("{!r} is not a filename or file-like object.".format(filelike)) * */ __pyx_t_5 = PyObject_HasAttr(__pyx_v_filelike, __pyx_n_u_read); if (unlikely(__pyx_t_5 == -1)) __PYX_ERR(0, 256, __pyx_L1_error) __pyx_t_2 = (__pyx_t_5 != 0); if (!__pyx_t_2) { } else { __pyx_t_3 = __pyx_t_2; goto __pyx_L31_bool_binop_done; } __pyx_t_2 = PyObject_HasAttr(__pyx_v_filelike, __pyx_n_u_write); if (unlikely(__pyx_t_2 == -1)) __PYX_ERR(0, 256, __pyx_L1_error) __pyx_t_5 = (__pyx_t_2 != 0); __pyx_t_3 = __pyx_t_5; __pyx_L31_bool_binop_done:; __pyx_t_5 = ((!__pyx_t_3) != 0); if (__pyx_t_5) { /* "pygame_sdl2/rwobject.pyx":257 * * if not (hasattr(filelike, "read") or hasattr(filelike, "write")): * raise IOError("{!r} is not a filename or file-like object.".format(filelike)) # <<<<<<<<<<<<<< * * Py_INCREF(filelike) */ __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_kp_u_r_is_not_a_filename_or_file_lik, __pyx_n_s_format); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 257, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_7 = NULL; if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_1))) { __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_1); if (likely(__pyx_t_7)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1); __Pyx_INCREF(__pyx_t_7); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_1, function); } } if (!__pyx_t_7) { __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_t_1, __pyx_v_filelike); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 257, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); } else { __pyx_t_6 = PyTuple_New(1+1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 257, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_GIVEREF(__pyx_t_7); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_7); __pyx_t_7 = NULL; __Pyx_INCREF(__pyx_v_filelike); __Pyx_GIVEREF(__pyx_v_filelike); PyTuple_SET_ITEM(__pyx_t_6, 0+1, __pyx_v_filelike); __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_6, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 257, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 257, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_4); __pyx_t_4 = 0; __pyx_t_4 = __Pyx_PyObject_Call(__pyx_builtin_IOError, __pyx_t_1, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 257, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_Raise(__pyx_t_4, 0, 0, 0); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __PYX_ERR(0, 257, __pyx_L1_error) /* "pygame_sdl2/rwobject.pyx":256 * * * if not (hasattr(filelike, "read") or hasattr(filelike, "write")): # <<<<<<<<<<<<<< * raise IOError("{!r} is not a filename or file-like object.".format(filelike)) * */ } /* "pygame_sdl2/rwobject.pyx":259 * raise IOError("{!r} is not a filename or file-like object.".format(filelike)) * * Py_INCREF(filelike) # <<<<<<<<<<<<<< * * rv = SDL_AllocRW() */ Py_INCREF(__pyx_v_filelike); /* "pygame_sdl2/rwobject.pyx":261 * Py_INCREF(filelike) * * rv = SDL_AllocRW() # <<<<<<<<<<<<<< * rv.size = python_size * rv.seek = python_seek */ __pyx_v_rv = SDL_AllocRW(); /* "pygame_sdl2/rwobject.pyx":262 * * rv = SDL_AllocRW() * rv.size = python_size # <<<<<<<<<<<<<< * rv.seek = python_seek * rv.read = python_read */ __pyx_v_rv->size = __pyx_f_11pygame_sdl2_8rwobject_python_size; /* "pygame_sdl2/rwobject.pyx":263 * rv = SDL_AllocRW() * rv.size = python_size * rv.seek = python_seek # <<<<<<<<<<<<<< * rv.read = python_read * rv.write = python_write */ __pyx_v_rv->seek = __pyx_f_11pygame_sdl2_8rwobject_python_seek; /* "pygame_sdl2/rwobject.pyx":264 * rv.size = python_size * rv.seek = python_seek * rv.read = python_read # <<<<<<<<<<<<<< * rv.write = python_write * rv.close = python_close */ __pyx_v_rv->read = __pyx_f_11pygame_sdl2_8rwobject_python_read; /* "pygame_sdl2/rwobject.pyx":265 * rv.seek = python_seek * rv.read = python_read * rv.write = python_write # <<<<<<<<<<<<<< * rv.close = python_close * rv.type = 0 */ __pyx_v_rv->write = __pyx_f_11pygame_sdl2_8rwobject_python_write; /* "pygame_sdl2/rwobject.pyx":266 * rv.read = python_read * rv.write = python_write * rv.close = python_close # <<<<<<<<<<<<<< * rv.type = 0 * rv.hidden.unknown.data1 = filelike */ __pyx_v_rv->close = __pyx_f_11pygame_sdl2_8rwobject_python_close; /* "pygame_sdl2/rwobject.pyx":267 * rv.write = python_write * rv.close = python_close * rv.type = 0 # <<<<<<<<<<<<<< * rv.hidden.unknown.data1 = filelike * */ __pyx_v_rv->type = 0; /* "pygame_sdl2/rwobject.pyx":268 * rv.close = python_close * rv.type = 0 * rv.hidden.unknown.data1 = filelike # <<<<<<<<<<<<<< * * return rv */ __pyx_v_rv->hidden.unknown.data1 = ((void *)__pyx_v_filelike); /* "pygame_sdl2/rwobject.pyx":270 * rv.hidden.unknown.data1 = filelike * * return rv # <<<<<<<<<<<<<< * * */ __pyx_r = __pyx_v_rv; goto __pyx_L0; /* "pygame_sdl2/rwobject.pyx":173 * * * cdef SDL_RWops *to_rwops(filelike, mode="rb") except NULL: # <<<<<<<<<<<<<< * * cdef FILE *f */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_6); __Pyx_XDECREF(__pyx_t_7); __Pyx_XDECREF(__pyx_t_8); __Pyx_AddTraceback("pygame_sdl2.rwobject.to_rwops", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF(__pyx_v_name); __Pyx_XDECREF(__pyx_v_dname); __Pyx_XDECREF(__pyx_v_base); __Pyx_XDECREF(__pyx_v_length); __Pyx_XDECREF(__pyx_v_filelike); __Pyx_XDECREF(__pyx_v_mode); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/rwobject.pyx":273 * * * cdef api SDL_RWops *RWopsFromPython(filelike) except NULL: # <<<<<<<<<<<<<< * return to_rwops(filelike) * */ static SDL_RWops *__pyx_f_11pygame_sdl2_8rwobject_RWopsFromPython(PyObject *__pyx_v_filelike) { SDL_RWops *__pyx_r; __Pyx_RefNannyDeclarations SDL_RWops *__pyx_t_1; __Pyx_RefNannySetupContext("RWopsFromPython", 0); /* "pygame_sdl2/rwobject.pyx":274 * * cdef api SDL_RWops *RWopsFromPython(filelike) except NULL: * return to_rwops(filelike) # <<<<<<<<<<<<<< * * PyEval_InitThreads() */ __pyx_t_1 = __pyx_f_11pygame_sdl2_8rwobject_to_rwops(__pyx_v_filelike, NULL); if (unlikely(__pyx_t_1 == NULL)) __PYX_ERR(0, 274, __pyx_L1_error) __pyx_r = __pyx_t_1; goto __pyx_L0; /* "pygame_sdl2/rwobject.pyx":273 * * * cdef api SDL_RWops *RWopsFromPython(filelike) except NULL: # <<<<<<<<<<<<<< * return to_rwops(filelike) * */ /* function exit code */ __pyx_L1_error:; __Pyx_AddTraceback("pygame_sdl2.rwobject.RWopsFromPython", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyMethodDef __pyx_methods[] = { {0, 0, 0, 0} }; #if PY_MAJOR_VERSION >= 3 static struct PyModuleDef __pyx_moduledef = { #if PY_VERSION_HEX < 0x03020000 { PyObject_HEAD_INIT(NULL) NULL, 0, NULL }, #else PyModuleDef_HEAD_INIT, #endif "rwobject", 0, /* m_doc */ -1, /* m_size */ __pyx_methods /* m_methods */, NULL, /* m_reload */ NULL, /* m_traverse */ NULL, /* m_clear */ NULL /* m_free */ }; #endif static __Pyx_StringTabEntry __pyx_string_tab[] = { {&__pyx_n_s_AttributeError, __pyx_k_AttributeError, sizeof(__pyx_k_AttributeError), 0, 0, 1, 1}, {&__pyx_kp_u_Could_not_open_r, __pyx_k_Could_not_open_r, sizeof(__pyx_k_Could_not_open_r), 0, 1, 0, 0}, {&__pyx_kp_u_Could_not_open_r_2, __pyx_k_Could_not_open_r_2, sizeof(__pyx_k_Could_not_open_r_2), 0, 1, 0, 0}, {&__pyx_n_s_Exception, __pyx_k_Exception, sizeof(__pyx_k_Exception), 0, 0, 1, 1}, {&__pyx_n_s_IOError, __pyx_k_IOError, sizeof(__pyx_k_IOError), 0, 0, 1, 1}, {&__pyx_n_u_ascii, __pyx_k_ascii, sizeof(__pyx_k_ascii), 0, 1, 0, 1}, {&__pyx_n_s_base, __pyx_k_base, sizeof(__pyx_k_base), 0, 0, 1, 1}, {&__pyx_n_s_bytes, __pyx_k_bytes, sizeof(__pyx_k_bytes), 0, 0, 1, 1}, {&__pyx_n_s_close, __pyx_k_close, sizeof(__pyx_k_close), 0, 0, 1, 1}, {&__pyx_n_s_decode, __pyx_k_decode, sizeof(__pyx_k_decode), 0, 0, 1, 1}, {&__pyx_n_s_encode, __pyx_k_encode, sizeof(__pyx_k_encode), 0, 0, 1, 1}, {&__pyx_n_s_file_type, __pyx_k_file_type, sizeof(__pyx_k_file_type), 0, 0, 1, 1}, {&__pyx_n_s_format, __pyx_k_format, sizeof(__pyx_k_format), 0, 0, 1, 1}, {&__pyx_n_s_fsencoding, __pyx_k_fsencoding, sizeof(__pyx_k_fsencoding), 0, 0, 1, 1}, {&__pyx_n_s_getfilesystemencoding, __pyx_k_getfilesystemencoding, sizeof(__pyx_k_getfilesystemencoding), 0, 0, 1, 1}, {&__pyx_n_s_import, __pyx_k_import, sizeof(__pyx_k_import), 0, 0, 1, 1}, {&__pyx_n_s_length, __pyx_k_length, sizeof(__pyx_k_length), 0, 0, 1, 1}, {&__pyx_n_s_main, __pyx_k_main, sizeof(__pyx_k_main), 0, 0, 1, 1}, {&__pyx_n_s_name, __pyx_k_name, sizeof(__pyx_k_name), 0, 0, 1, 1}, {&__pyx_n_s_pygame_sdl2_compat, __pyx_k_pygame_sdl2_compat, sizeof(__pyx_k_pygame_sdl2_compat), 0, 0, 1, 1}, {&__pyx_kp_u_r_is_not_a_filename_or_file_lik, __pyx_k_r_is_not_a_filename_or_file_lik, sizeof(__pyx_k_r_is_not_a_filename_or_file_lik), 0, 1, 0, 0}, {&__pyx_n_b_rb, __pyx_k_rb, sizeof(__pyx_k_rb), 0, 0, 0, 1}, {&__pyx_n_u_rb, __pyx_k_rb, sizeof(__pyx_k_rb), 0, 1, 0, 1}, {&__pyx_n_s_read, __pyx_k_read, sizeof(__pyx_k_read), 0, 0, 1, 1}, {&__pyx_n_u_read, __pyx_k_read, sizeof(__pyx_k_read), 0, 1, 0, 1}, {&__pyx_n_s_seek, __pyx_k_seek, sizeof(__pyx_k_seek), 0, 0, 1, 1}, {&__pyx_n_s_sys, __pyx_k_sys, sizeof(__pyx_k_sys), 0, 0, 1, 1}, {&__pyx_n_s_tell, __pyx_k_tell, sizeof(__pyx_k_tell), 0, 0, 1, 1}, {&__pyx_n_s_test, __pyx_k_test, sizeof(__pyx_k_test), 0, 0, 1, 1}, {&__pyx_n_s_unicode, __pyx_k_unicode, sizeof(__pyx_k_unicode), 0, 0, 1, 1}, {&__pyx_kp_u_utf_8, __pyx_k_utf_8, sizeof(__pyx_k_utf_8), 0, 1, 0, 0}, {&__pyx_n_s_write, __pyx_k_write, sizeof(__pyx_k_write), 0, 0, 1, 1}, {&__pyx_n_u_write, __pyx_k_write, sizeof(__pyx_k_write), 0, 1, 0, 1}, {0, 0, 0, 0, 0, 0, 0} }; static int __Pyx_InitCachedBuiltins(void) { __pyx_builtin_Exception = __Pyx_GetBuiltinName(__pyx_n_s_Exception); if (!__pyx_builtin_Exception) __PYX_ERR(0, 81, __pyx_L1_error) __pyx_builtin_IOError = __Pyx_GetBuiltinName(__pyx_n_s_IOError); if (!__pyx_builtin_IOError) __PYX_ERR(0, 206, __pyx_L1_error) __pyx_builtin_AttributeError = __Pyx_GetBuiltinName(__pyx_n_s_AttributeError); if (!__pyx_builtin_AttributeError) __PYX_ERR(0, 252, __pyx_L1_error) return 0; __pyx_L1_error:; return -1; } static int __Pyx_InitCachedConstants(void) { __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__Pyx_InitCachedConstants", 0); /* "pygame_sdl2/rwobject.pyx":67 * try: * cur = f.tell() * f.seek(0, 2) # <<<<<<<<<<<<<< * rv = f.tell() * f.seek(cur, 0) */ __pyx_tuple_ = PyTuple_Pack(2, __pyx_int_0, __pyx_int_2); if (unlikely(!__pyx_tuple_)) __PYX_ERR(0, 67, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple_); __Pyx_GIVEREF(__pyx_tuple_); /* "pygame_sdl2/rwobject.pyx":183 * * if not isinstance(mode, bytes_): * mode = mode.encode("ascii") # <<<<<<<<<<<<<< * * if isinstance(filelike, file_type) and mode == b"rb": */ __pyx_tuple__2 = PyTuple_Pack(1, __pyx_n_u_ascii); if (unlikely(!__pyx_tuple__2)) __PYX_ERR(0, 183, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__2); __Pyx_GIVEREF(__pyx_tuple__2); /* "pygame_sdl2/rwobject.pyx":198 * if name: * * dname = name.encode("utf-8") # <<<<<<<<<<<<<< * cname = dname * cmode = mode */ __pyx_tuple__3 = PyTuple_Pack(1, __pyx_kp_u_utf_8); if (unlikely(!__pyx_tuple__3)) __PYX_ERR(0, 198, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__3); __Pyx_GIVEREF(__pyx_tuple__3); /* "pygame_sdl2/rwobject.pyx":224 * name = name.decode(fsencoding) * * dname = name.encode("utf-8") # <<<<<<<<<<<<<< * cname = dname * */ __pyx_tuple__4 = PyTuple_Pack(1, __pyx_kp_u_utf_8); if (unlikely(!__pyx_tuple__4)) __PYX_ERR(0, 224, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__4); __Pyx_GIVEREF(__pyx_tuple__4); __Pyx_RefNannyFinishContext(); return 0; __pyx_L1_error:; __Pyx_RefNannyFinishContext(); return -1; } static int __Pyx_InitGlobals(void) { if (__Pyx_InitStrings(__pyx_string_tab) < 0) __PYX_ERR(0, 1, __pyx_L1_error); __pyx_int_0 = PyInt_FromLong(0); if (unlikely(!__pyx_int_0)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_int_2 = PyInt_FromLong(2); if (unlikely(!__pyx_int_2)) __PYX_ERR(0, 1, __pyx_L1_error) return 0; __pyx_L1_error:; return -1; } #if PY_MAJOR_VERSION < 3 PyMODINIT_FUNC initrwobject(void); /*proto*/ PyMODINIT_FUNC initrwobject(void) #else PyMODINIT_FUNC PyInit_rwobject(void); /*proto*/ PyMODINIT_FUNC PyInit_rwobject(void) #endif { PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; int __pyx_t_5; __Pyx_RefNannyDeclarations #if CYTHON_REFNANNY __Pyx_RefNanny = __Pyx_RefNannyImportAPI("refnanny"); if (!__Pyx_RefNanny) { PyErr_Clear(); __Pyx_RefNanny = __Pyx_RefNannyImportAPI("Cython.Runtime.refnanny"); if (!__Pyx_RefNanny) Py_FatalError("failed to import 'refnanny' module"); } #endif __Pyx_RefNannySetupContext("PyMODINIT_FUNC PyInit_rwobject(void)", 0); if (__Pyx_check_binary_version() < 0) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_empty_tuple = PyTuple_New(0); if (unlikely(!__pyx_empty_tuple)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_empty_bytes = PyBytes_FromStringAndSize("", 0); if (unlikely(!__pyx_empty_bytes)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_empty_unicode = PyUnicode_FromStringAndSize("", 0); if (unlikely(!__pyx_empty_unicode)) __PYX_ERR(0, 1, __pyx_L1_error) #ifdef __Pyx_CyFunction_USED if (__pyx_CyFunction_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error) #endif #ifdef __Pyx_FusedFunction_USED if (__pyx_FusedFunction_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error) #endif #ifdef __Pyx_Coroutine_USED if (__pyx_Coroutine_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error) #endif #ifdef __Pyx_Generator_USED if (__pyx_Generator_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error) #endif #ifdef __Pyx_StopAsyncIteration_USED if (__pyx_StopAsyncIteration_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error) #endif /*--- Library function declarations ---*/ /*--- Threads initialization code ---*/ #if defined(__PYX_FORCE_INIT_THREADS) && __PYX_FORCE_INIT_THREADS #ifdef WITH_THREAD /* Python build with threading support? */ PyEval_InitThreads(); #endif #endif /*--- Module creation code ---*/ #if PY_MAJOR_VERSION < 3 __pyx_m = Py_InitModule4("rwobject", __pyx_methods, 0, 0, PYTHON_API_VERSION); Py_XINCREF(__pyx_m); #else __pyx_m = PyModule_Create(&__pyx_moduledef); #endif if (unlikely(!__pyx_m)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_d = PyModule_GetDict(__pyx_m); if (unlikely(!__pyx_d)) __PYX_ERR(0, 1, __pyx_L1_error) Py_INCREF(__pyx_d); __pyx_b = PyImport_AddModule(__Pyx_BUILTIN_MODULE_NAME); if (unlikely(!__pyx_b)) __PYX_ERR(0, 1, __pyx_L1_error) #if CYTHON_COMPILING_IN_PYPY Py_INCREF(__pyx_b); #endif if (PyObject_SetAttrString(__pyx_m, "__builtins__", __pyx_b) < 0) __PYX_ERR(0, 1, __pyx_L1_error); /*--- Initialize various global constants etc. ---*/ if (__Pyx_InitGlobals() < 0) __PYX_ERR(0, 1, __pyx_L1_error) #if PY_MAJOR_VERSION < 3 && (__PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT) if (__Pyx_init_sys_getdefaultencoding_params() < 0) __PYX_ERR(0, 1, __pyx_L1_error) #endif if (__pyx_module_is_main_pygame_sdl2__rwobject) { if (PyObject_SetAttrString(__pyx_m, "__name__", __pyx_n_s_main) < 0) __PYX_ERR(0, 1, __pyx_L1_error) } #if PY_MAJOR_VERSION >= 3 { PyObject *modules = PyImport_GetModuleDict(); if (unlikely(!modules)) __PYX_ERR(0, 1, __pyx_L1_error) if (!PyDict_GetItemString(modules, "pygame_sdl2.rwobject")) { if (unlikely(PyDict_SetItemString(modules, "pygame_sdl2.rwobject", __pyx_m) < 0)) __PYX_ERR(0, 1, __pyx_L1_error) } } #endif /*--- Builtin init code ---*/ if (__Pyx_InitCachedBuiltins() < 0) __PYX_ERR(0, 1, __pyx_L1_error) /*--- Constants init code ---*/ if (__Pyx_InitCachedConstants() < 0) __PYX_ERR(0, 1, __pyx_L1_error) /*--- Global init code ---*/ /*--- Variable export code ---*/ /*--- Function export code ---*/ if (__Pyx_ExportFunction("to_rwops", (void (*)(void))__pyx_f_11pygame_sdl2_8rwobject_to_rwops, "SDL_RWops *(PyObject *, struct __pyx_opt_args_11pygame_sdl2_8rwobject_to_rwops *__pyx_optional_args)") < 0) __PYX_ERR(0, 1, __pyx_L1_error) if (__Pyx_ExportFunction("RWopsFromPython", (void (*)(void))__pyx_f_11pygame_sdl2_8rwobject_RWopsFromPython, "SDL_RWops *(PyObject *)") < 0) __PYX_ERR(0, 1, __pyx_L1_error) /*--- Type init code ---*/ /*--- Type import code ---*/ __pyx_ptype_7cpython_4type_type = __Pyx_ImportType(__Pyx_BUILTIN_MODULE_NAME, "type", #if CYTHON_COMPILING_IN_PYPY sizeof(PyTypeObject), #else sizeof(PyHeapTypeObject), #endif 0); if (unlikely(!__pyx_ptype_7cpython_4type_type)) __PYX_ERR(1, 9, __pyx_L1_error) /*--- Variable import code ---*/ /*--- Function import code ---*/ /*--- Execution code ---*/ #if defined(__Pyx_Generator_USED) || defined(__Pyx_Coroutine_USED) if (__Pyx_patch_abc() < 0) __PYX_ERR(0, 1, __pyx_L1_error) #endif /* "pygame_sdl2/rwobject.pyx":25 * from libc.stdlib cimport calloc, free * * from pygame_sdl2.compat import file_type, bytes_, unicode_ # <<<<<<<<<<<<<< * * import sys */ __pyx_t_1 = PyList_New(3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 25, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_INCREF(__pyx_n_s_file_type); __Pyx_GIVEREF(__pyx_n_s_file_type); PyList_SET_ITEM(__pyx_t_1, 0, __pyx_n_s_file_type); __Pyx_INCREF(__pyx_n_s_bytes); __Pyx_GIVEREF(__pyx_n_s_bytes); PyList_SET_ITEM(__pyx_t_1, 1, __pyx_n_s_bytes); __Pyx_INCREF(__pyx_n_s_unicode); __Pyx_GIVEREF(__pyx_n_s_unicode); PyList_SET_ITEM(__pyx_t_1, 2, __pyx_n_s_unicode); __pyx_t_2 = __Pyx_Import(__pyx_n_s_pygame_sdl2_compat, __pyx_t_1, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 25, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_1 = __Pyx_ImportFrom(__pyx_t_2, __pyx_n_s_file_type); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 25, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (PyDict_SetItem(__pyx_d, __pyx_n_s_file_type, __pyx_t_1) < 0) __PYX_ERR(0, 25, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_1 = __Pyx_ImportFrom(__pyx_t_2, __pyx_n_s_bytes); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 25, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (PyDict_SetItem(__pyx_d, __pyx_n_s_bytes, __pyx_t_1) < 0) __PYX_ERR(0, 25, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_1 = __Pyx_ImportFrom(__pyx_t_2, __pyx_n_s_unicode); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 25, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (PyDict_SetItem(__pyx_d, __pyx_n_s_unicode, __pyx_t_1) < 0) __PYX_ERR(0, 25, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "pygame_sdl2/rwobject.pyx":27 * from pygame_sdl2.compat import file_type, bytes_, unicode_ * * import sys # <<<<<<<<<<<<<< * * # The fsencoding. */ __pyx_t_2 = __Pyx_Import(__pyx_n_s_sys, 0, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 27, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_sys, __pyx_t_2) < 0) __PYX_ERR(0, 27, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "pygame_sdl2/rwobject.pyx":30 * * # The fsencoding. * fsencoding = sys.getfilesystemencoding() or "utf-8" # <<<<<<<<<<<<<< * * cdef extern from "SDL.h" nogil: */ __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_sys); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 30, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_getfilesystemencoding); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 30, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_3 = NULL; if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_4))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_4); if (likely(__pyx_t_3)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_4, function); } } if (__pyx_t_3) { __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 30, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } else { __pyx_t_1 = __Pyx_PyObject_CallNoArg(__pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 30, __pyx_L1_error) } __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_5 < 0)) __PYX_ERR(0, 30, __pyx_L1_error) if (!__pyx_t_5) { __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; } else { __Pyx_INCREF(__pyx_t_1); __pyx_t_2 = __pyx_t_1; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; goto __pyx_L2_bool_binop_done; } __Pyx_INCREF(__pyx_kp_u_utf_8); __pyx_t_2 = __pyx_kp_u_utf_8; __pyx_L2_bool_binop_done:; if (PyDict_SetItem(__pyx_d, __pyx_n_s_fsencoding, __pyx_t_2) < 0) __PYX_ERR(0, 30, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "pygame_sdl2/rwobject.pyx":276 * return to_rwops(filelike) * * PyEval_InitThreads() # <<<<<<<<<<<<<< */ PyEval_InitThreads(); /* "pygame_sdl2/rwobject.pyx":1 * # Copyright 2014 Tom Rothamel # <<<<<<<<<<<<<< * # * # This software is provided 'as-is', without any express or implied */ __pyx_t_2 = PyDict_New(); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_test, __pyx_t_2) < 0) __PYX_ERR(0, 1, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /*--- Wrapped vars code ---*/ goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); if (__pyx_m) { if (__pyx_d) { __Pyx_AddTraceback("init pygame_sdl2.rwobject", __pyx_clineno, __pyx_lineno, __pyx_filename); } Py_DECREF(__pyx_m); __pyx_m = 0; } else if (!PyErr_Occurred()) { PyErr_SetString(PyExc_ImportError, "init pygame_sdl2.rwobject"); } __pyx_L0:; __Pyx_RefNannyFinishContext(); #if PY_MAJOR_VERSION < 3 return; #else return __pyx_m; #endif } /* --- Runtime support code --- */ /* Refnanny */ #if CYTHON_REFNANNY static __Pyx_RefNannyAPIStruct *__Pyx_RefNannyImportAPI(const char *modname) { PyObject *m = NULL, *p = NULL; void *r = NULL; m = PyImport_ImportModule((char *)modname); if (!m) goto end; p = PyObject_GetAttrString(m, (char *)"RefNannyAPI"); if (!p) goto end; r = PyLong_AsVoidPtr(p); end: Py_XDECREF(p); Py_XDECREF(m); return (__Pyx_RefNannyAPIStruct *)r; } #endif /* GetBuiltinName */ static PyObject *__Pyx_GetBuiltinName(PyObject *name) { PyObject* result = __Pyx_PyObject_GetAttrStr(__pyx_b, name); if (unlikely(!result)) { PyErr_Format(PyExc_NameError, #if PY_MAJOR_VERSION >= 3 "name '%U' is not defined", name); #else "name '%.200s' is not defined", PyString_AS_STRING(name)); #endif } return result; } /* PyObjectCall */ #if CYTHON_COMPILING_IN_CPYTHON static CYTHON_INLINE PyObject* __Pyx_PyObject_Call(PyObject *func, PyObject *arg, PyObject *kw) { PyObject *result; ternaryfunc call = func->ob_type->tp_call; if (unlikely(!call)) return PyObject_Call(func, arg, kw); if (unlikely(Py_EnterRecursiveCall((char*)" while calling a Python object"))) return NULL; result = (*call)(func, arg, kw); Py_LeaveRecursiveCall(); if (unlikely(!result) && unlikely(!PyErr_Occurred())) { PyErr_SetString( PyExc_SystemError, "NULL result without error in PyObject_Call"); } return result; } #endif /* PyObjectCallMethO */ #if CYTHON_COMPILING_IN_CPYTHON static CYTHON_INLINE PyObject* __Pyx_PyObject_CallMethO(PyObject *func, PyObject *arg) { PyObject *self, *result; PyCFunction cfunc; cfunc = PyCFunction_GET_FUNCTION(func); self = PyCFunction_GET_SELF(func); if (unlikely(Py_EnterRecursiveCall((char*)" while calling a Python object"))) return NULL; result = cfunc(self, arg); Py_LeaveRecursiveCall(); if (unlikely(!result) && unlikely(!PyErr_Occurred())) { PyErr_SetString( PyExc_SystemError, "NULL result without error in PyObject_Call"); } return result; } #endif /* PyObjectCallOneArg */ #if CYTHON_COMPILING_IN_CPYTHON static PyObject* __Pyx__PyObject_CallOneArg(PyObject *func, PyObject *arg) { PyObject *result; PyObject *args = PyTuple_New(1); if (unlikely(!args)) return NULL; Py_INCREF(arg); PyTuple_SET_ITEM(args, 0, arg); result = __Pyx_PyObject_Call(func, args, NULL); Py_DECREF(args); return result; } static CYTHON_INLINE PyObject* __Pyx_PyObject_CallOneArg(PyObject *func, PyObject *arg) { #ifdef __Pyx_CyFunction_USED if (likely(PyCFunction_Check(func) || PyObject_TypeCheck(func, __pyx_CyFunctionType))) { #else if (likely(PyCFunction_Check(func))) { #endif if (likely(PyCFunction_GET_FLAGS(func) & METH_O)) { return __Pyx_PyObject_CallMethO(func, arg); } } return __Pyx__PyObject_CallOneArg(func, arg); } #else static CYTHON_INLINE PyObject* __Pyx_PyObject_CallOneArg(PyObject *func, PyObject *arg) { PyObject *result; PyObject *args = PyTuple_Pack(1, arg); if (unlikely(!args)) return NULL; result = __Pyx_PyObject_Call(func, args, NULL); Py_DECREF(args); return result; } #endif /* PyObjectCallNoArg */ #if CYTHON_COMPILING_IN_CPYTHON static CYTHON_INLINE PyObject* __Pyx_PyObject_CallNoArg(PyObject *func) { #ifdef __Pyx_CyFunction_USED if (likely(PyCFunction_Check(func) || PyObject_TypeCheck(func, __pyx_CyFunctionType))) { #else if (likely(PyCFunction_Check(func))) { #endif if (likely(PyCFunction_GET_FLAGS(func) & METH_NOARGS)) { return __Pyx_PyObject_CallMethO(func, NULL); } } return __Pyx_PyObject_Call(func, __pyx_empty_tuple, NULL); } #endif /* SaveResetException */ #if CYTHON_COMPILING_IN_CPYTHON static CYTHON_INLINE void __Pyx__ExceptionSave(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb) { *type = tstate->exc_type; *value = tstate->exc_value; *tb = tstate->exc_traceback; Py_XINCREF(*type); Py_XINCREF(*value); Py_XINCREF(*tb); } static CYTHON_INLINE void __Pyx__ExceptionReset(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb) { PyObject *tmp_type, *tmp_value, *tmp_tb; tmp_type = tstate->exc_type; tmp_value = tstate->exc_value; tmp_tb = tstate->exc_traceback; tstate->exc_type = type; tstate->exc_value = value; tstate->exc_traceback = tb; Py_XDECREF(tmp_type); Py_XDECREF(tmp_value); Py_XDECREF(tmp_tb); } #endif /* GetException */ #if CYTHON_COMPILING_IN_CPYTHON static int __Pyx__GetException(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb) { #else static int __Pyx_GetException(PyObject **type, PyObject **value, PyObject **tb) { #endif PyObject *local_type, *local_value, *local_tb; #if CYTHON_COMPILING_IN_CPYTHON PyObject *tmp_type, *tmp_value, *tmp_tb; local_type = tstate->curexc_type; local_value = tstate->curexc_value; local_tb = tstate->curexc_traceback; tstate->curexc_type = 0; tstate->curexc_value = 0; tstate->curexc_traceback = 0; #else PyErr_Fetch(&local_type, &local_value, &local_tb); #endif PyErr_NormalizeException(&local_type, &local_value, &local_tb); #if CYTHON_COMPILING_IN_CPYTHON if (unlikely(tstate->curexc_type)) #else if (unlikely(PyErr_Occurred())) #endif goto bad; #if PY_MAJOR_VERSION >= 3 if (local_tb) { if (unlikely(PyException_SetTraceback(local_value, local_tb) < 0)) goto bad; } #endif Py_XINCREF(local_tb); Py_XINCREF(local_type); Py_XINCREF(local_value); *type = local_type; *value = local_value; *tb = local_tb; #if CYTHON_COMPILING_IN_CPYTHON tmp_type = tstate->exc_type; tmp_value = tstate->exc_value; tmp_tb = tstate->exc_traceback; tstate->exc_type = local_type; tstate->exc_value = local_value; tstate->exc_traceback = local_tb; Py_XDECREF(tmp_type); Py_XDECREF(tmp_value); Py_XDECREF(tmp_tb); #else PyErr_SetExcInfo(local_type, local_value, local_tb); #endif return 0; bad: *type = 0; *value = 0; *tb = 0; Py_XDECREF(local_type); Py_XDECREF(local_value); Py_XDECREF(local_tb); return -1; } /* PyErrFetchRestore */ #if CYTHON_COMPILING_IN_CPYTHON static CYTHON_INLINE void __Pyx_ErrRestoreInState(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb) { PyObject *tmp_type, *tmp_value, *tmp_tb; tmp_type = tstate->curexc_type; tmp_value = tstate->curexc_value; tmp_tb = tstate->curexc_traceback; tstate->curexc_type = type; tstate->curexc_value = value; tstate->curexc_traceback = tb; Py_XDECREF(tmp_type); Py_XDECREF(tmp_value); Py_XDECREF(tmp_tb); } static CYTHON_INLINE void __Pyx_ErrFetchInState(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb) { *type = tstate->curexc_type; *value = tstate->curexc_value; *tb = tstate->curexc_traceback; tstate->curexc_type = 0; tstate->curexc_value = 0; tstate->curexc_traceback = 0; } #endif /* WriteUnraisableException */ static void __Pyx_WriteUnraisable(const char *name, CYTHON_UNUSED int clineno, CYTHON_UNUSED int lineno, CYTHON_UNUSED const char *filename, int full_traceback, CYTHON_UNUSED int nogil) { PyObject *old_exc, *old_val, *old_tb; PyObject *ctx; __Pyx_PyThreadState_declare #ifdef WITH_THREAD PyGILState_STATE state; if (nogil) state = PyGILState_Ensure(); #ifdef _MSC_VER else state = (PyGILState_STATE)-1; #endif #endif __Pyx_PyThreadState_assign __Pyx_ErrFetch(&old_exc, &old_val, &old_tb); if (full_traceback) { Py_XINCREF(old_exc); Py_XINCREF(old_val); Py_XINCREF(old_tb); __Pyx_ErrRestore(old_exc, old_val, old_tb); PyErr_PrintEx(1); } #if PY_MAJOR_VERSION < 3 ctx = PyString_FromString(name); #else ctx = PyUnicode_FromString(name); #endif __Pyx_ErrRestore(old_exc, old_val, old_tb); if (!ctx) { PyErr_WriteUnraisable(Py_None); } else { PyErr_WriteUnraisable(ctx); Py_DECREF(ctx); } #ifdef WITH_THREAD if (nogil) PyGILState_Release(state); #endif } /* PyErrExceptionMatches */ #if CYTHON_COMPILING_IN_CPYTHON static CYTHON_INLINE int __Pyx_PyErr_ExceptionMatchesInState(PyThreadState* tstate, PyObject* err) { PyObject *exc_type = tstate->curexc_type; if (exc_type == err) return 1; if (unlikely(!exc_type)) return 0; return PyErr_GivenExceptionMatches(exc_type, err); } #endif /* SwapException */ #if CYTHON_COMPILING_IN_CPYTHON static CYTHON_INLINE void __Pyx__ExceptionSwap(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb) { PyObject *tmp_type, *tmp_value, *tmp_tb; tmp_type = tstate->exc_type; tmp_value = tstate->exc_value; tmp_tb = tstate->exc_traceback; tstate->exc_type = *type; tstate->exc_value = *value; tstate->exc_traceback = *tb; *type = tmp_type; *value = tmp_value; *tb = tmp_tb; } #else static CYTHON_INLINE void __Pyx_ExceptionSwap(PyObject **type, PyObject **value, PyObject **tb) { PyObject *tmp_type, *tmp_value, *tmp_tb; PyErr_GetExcInfo(&tmp_type, &tmp_value, &tmp_tb); PyErr_SetExcInfo(*type, *value, *tb); *type = tmp_type; *value = tmp_value; *tb = tmp_tb; } #endif /* GetModuleGlobalName */ static CYTHON_INLINE PyObject *__Pyx_GetModuleGlobalName(PyObject *name) { PyObject *result; #if CYTHON_COMPILING_IN_CPYTHON result = PyDict_GetItem(__pyx_d, name); if (likely(result)) { Py_INCREF(result); } else { #else result = PyObject_GetItem(__pyx_d, name); if (!result) { PyErr_Clear(); #endif result = __Pyx_GetBuiltinName(name); } return result; } /* BytesEquals */ static CYTHON_INLINE int __Pyx_PyBytes_Equals(PyObject* s1, PyObject* s2, int equals) { #if CYTHON_COMPILING_IN_PYPY return PyObject_RichCompareBool(s1, s2, equals); #else if (s1 == s2) { return (equals == Py_EQ); } else if (PyBytes_CheckExact(s1) & PyBytes_CheckExact(s2)) { const char *ps1, *ps2; Py_ssize_t length = PyBytes_GET_SIZE(s1); if (length != PyBytes_GET_SIZE(s2)) return (equals == Py_NE); ps1 = PyBytes_AS_STRING(s1); ps2 = PyBytes_AS_STRING(s2); if (ps1[0] != ps2[0]) { return (equals == Py_NE); } else if (length == 1) { return (equals == Py_EQ); } else { int result = memcmp(ps1, ps2, (size_t)length); return (equals == Py_EQ) ? (result == 0) : (result != 0); } } else if ((s1 == Py_None) & PyBytes_CheckExact(s2)) { return (equals == Py_NE); } else if ((s2 == Py_None) & PyBytes_CheckExact(s1)) { return (equals == Py_NE); } else { int result; PyObject* py_result = PyObject_RichCompare(s1, s2, equals); if (!py_result) return -1; result = __Pyx_PyObject_IsTrue(py_result); Py_DECREF(py_result); return result; } #endif } /* RaiseException */ #if PY_MAJOR_VERSION < 3 static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, CYTHON_UNUSED PyObject *cause) { __Pyx_PyThreadState_declare Py_XINCREF(type); if (!value || value == Py_None) value = NULL; else Py_INCREF(value); if (!tb || tb == Py_None) tb = NULL; else { Py_INCREF(tb); if (!PyTraceBack_Check(tb)) { PyErr_SetString(PyExc_TypeError, "raise: arg 3 must be a traceback or None"); goto raise_error; } } if (PyType_Check(type)) { #if CYTHON_COMPILING_IN_PYPY if (!value) { Py_INCREF(Py_None); value = Py_None; } #endif PyErr_NormalizeException(&type, &value, &tb); } else { if (value) { PyErr_SetString(PyExc_TypeError, "instance exception may not have a separate value"); goto raise_error; } value = type; type = (PyObject*) Py_TYPE(type); Py_INCREF(type); if (!PyType_IsSubtype((PyTypeObject *)type, (PyTypeObject *)PyExc_BaseException)) { PyErr_SetString(PyExc_TypeError, "raise: exception class must be a subclass of BaseException"); goto raise_error; } } __Pyx_PyThreadState_assign __Pyx_ErrRestore(type, value, tb); return; raise_error: Py_XDECREF(value); Py_XDECREF(type); Py_XDECREF(tb); return; } #else static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, PyObject *cause) { PyObject* owned_instance = NULL; if (tb == Py_None) { tb = 0; } else if (tb && !PyTraceBack_Check(tb)) { PyErr_SetString(PyExc_TypeError, "raise: arg 3 must be a traceback or None"); goto bad; } if (value == Py_None) value = 0; if (PyExceptionInstance_Check(type)) { if (value) { PyErr_SetString(PyExc_TypeError, "instance exception may not have a separate value"); goto bad; } value = type; type = (PyObject*) Py_TYPE(value); } else if (PyExceptionClass_Check(type)) { PyObject *instance_class = NULL; if (value && PyExceptionInstance_Check(value)) { instance_class = (PyObject*) Py_TYPE(value); if (instance_class != type) { int is_subclass = PyObject_IsSubclass(instance_class, type); if (!is_subclass) { instance_class = NULL; } else if (unlikely(is_subclass == -1)) { goto bad; } else { type = instance_class; } } } if (!instance_class) { PyObject *args; if (!value) args = PyTuple_New(0); else if (PyTuple_Check(value)) { Py_INCREF(value); args = value; } else args = PyTuple_Pack(1, value); if (!args) goto bad; owned_instance = PyObject_Call(type, args, NULL); Py_DECREF(args); if (!owned_instance) goto bad; value = owned_instance; if (!PyExceptionInstance_Check(value)) { PyErr_Format(PyExc_TypeError, "calling %R should have returned an instance of " "BaseException, not %R", type, Py_TYPE(value)); goto bad; } } } else { PyErr_SetString(PyExc_TypeError, "raise: exception class must be a subclass of BaseException"); goto bad; } #if PY_VERSION_HEX >= 0x03030000 if (cause) { #else if (cause && cause != Py_None) { #endif PyObject *fixed_cause; if (cause == Py_None) { fixed_cause = NULL; } else if (PyExceptionClass_Check(cause)) { fixed_cause = PyObject_CallObject(cause, NULL); if (fixed_cause == NULL) goto bad; } else if (PyExceptionInstance_Check(cause)) { fixed_cause = cause; Py_INCREF(fixed_cause); } else { PyErr_SetString(PyExc_TypeError, "exception causes must derive from " "BaseException"); goto bad; } PyException_SetCause(value, fixed_cause); } PyErr_SetObject(type, value); if (tb) { #if CYTHON_COMPILING_IN_PYPY PyObject *tmp_type, *tmp_value, *tmp_tb; PyErr_Fetch(&tmp_type, &tmp_value, &tmp_tb); Py_INCREF(tb); PyErr_Restore(tmp_type, tmp_value, tb); Py_XDECREF(tmp_tb); #else PyThreadState *tstate = PyThreadState_GET(); PyObject* tmp_tb = tstate->curexc_traceback; if (tb != tmp_tb) { Py_INCREF(tb); tstate->curexc_traceback = tb; Py_XDECREF(tmp_tb); } #endif } bad: Py_XDECREF(owned_instance); return; } #endif /* Import */ static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list, int level) { PyObject *empty_list = 0; PyObject *module = 0; PyObject *global_dict = 0; PyObject *empty_dict = 0; PyObject *list; #if PY_VERSION_HEX < 0x03030000 PyObject *py_import; py_import = __Pyx_PyObject_GetAttrStr(__pyx_b, __pyx_n_s_import); if (!py_import) goto bad; #endif if (from_list) list = from_list; else { empty_list = PyList_New(0); if (!empty_list) goto bad; list = empty_list; } global_dict = PyModule_GetDict(__pyx_m); if (!global_dict) goto bad; empty_dict = PyDict_New(); if (!empty_dict) goto bad; { #if PY_MAJOR_VERSION >= 3 if (level == -1) { if (strchr(__Pyx_MODULE_NAME, '.')) { #if PY_VERSION_HEX < 0x03030000 PyObject *py_level = PyInt_FromLong(1); if (!py_level) goto bad; module = PyObject_CallFunctionObjArgs(py_import, name, global_dict, empty_dict, list, py_level, NULL); Py_DECREF(py_level); #else module = PyImport_ImportModuleLevelObject( name, global_dict, empty_dict, list, 1); #endif if (!module) { if (!PyErr_ExceptionMatches(PyExc_ImportError)) goto bad; PyErr_Clear(); } } level = 0; } #endif if (!module) { #if PY_VERSION_HEX < 0x03030000 PyObject *py_level = PyInt_FromLong(level); if (!py_level) goto bad; module = PyObject_CallFunctionObjArgs(py_import, name, global_dict, empty_dict, list, py_level, NULL); Py_DECREF(py_level); #else module = PyImport_ImportModuleLevelObject( name, global_dict, empty_dict, list, level); #endif } } bad: #if PY_VERSION_HEX < 0x03030000 Py_XDECREF(py_import); #endif Py_XDECREF(empty_list); Py_XDECREF(empty_dict); return module; } /* ImportFrom */ static PyObject* __Pyx_ImportFrom(PyObject* module, PyObject* name) { PyObject* value = __Pyx_PyObject_GetAttrStr(module, name); if (unlikely(!value) && PyErr_ExceptionMatches(PyExc_AttributeError)) { PyErr_Format(PyExc_ImportError, #if PY_MAJOR_VERSION < 3 "cannot import name %.230s", PyString_AS_STRING(name)); #else "cannot import name %S", name); #endif } return value; } /* CodeObjectCache */ static int __pyx_bisect_code_objects(__Pyx_CodeObjectCacheEntry* entries, int count, int code_line) { int start = 0, mid = 0, end = count - 1; if (end >= 0 && code_line > entries[end].code_line) { return count; } while (start < end) { mid = start + (end - start) / 2; if (code_line < entries[mid].code_line) { end = mid; } else if (code_line > entries[mid].code_line) { start = mid + 1; } else { return mid; } } if (code_line <= entries[mid].code_line) { return mid; } else { return mid + 1; } } static PyCodeObject *__pyx_find_code_object(int code_line) { PyCodeObject* code_object; int pos; if (unlikely(!code_line) || unlikely(!__pyx_code_cache.entries)) { return NULL; } pos = __pyx_bisect_code_objects(__pyx_code_cache.entries, __pyx_code_cache.count, code_line); if (unlikely(pos >= __pyx_code_cache.count) || unlikely(__pyx_code_cache.entries[pos].code_line != code_line)) { return NULL; } code_object = __pyx_code_cache.entries[pos].code_object; Py_INCREF(code_object); return code_object; } static void __pyx_insert_code_object(int code_line, PyCodeObject* code_object) { int pos, i; __Pyx_CodeObjectCacheEntry* entries = __pyx_code_cache.entries; if (unlikely(!code_line)) { return; } if (unlikely(!entries)) { entries = (__Pyx_CodeObjectCacheEntry*)PyMem_Malloc(64*sizeof(__Pyx_CodeObjectCacheEntry)); if (likely(entries)) { __pyx_code_cache.entries = entries; __pyx_code_cache.max_count = 64; __pyx_code_cache.count = 1; entries[0].code_line = code_line; entries[0].code_object = code_object; Py_INCREF(code_object); } return; } pos = __pyx_bisect_code_objects(__pyx_code_cache.entries, __pyx_code_cache.count, code_line); if ((pos < __pyx_code_cache.count) && unlikely(__pyx_code_cache.entries[pos].code_line == code_line)) { PyCodeObject* tmp = entries[pos].code_object; entries[pos].code_object = code_object; Py_DECREF(tmp); return; } if (__pyx_code_cache.count == __pyx_code_cache.max_count) { int new_max = __pyx_code_cache.max_count + 64; entries = (__Pyx_CodeObjectCacheEntry*)PyMem_Realloc( __pyx_code_cache.entries, (size_t)new_max*sizeof(__Pyx_CodeObjectCacheEntry)); if (unlikely(!entries)) { return; } __pyx_code_cache.entries = entries; __pyx_code_cache.max_count = new_max; } for (i=__pyx_code_cache.count; i>pos; i--) { entries[i] = entries[i-1]; } entries[pos].code_line = code_line; entries[pos].code_object = code_object; __pyx_code_cache.count++; Py_INCREF(code_object); } /* AddTraceback */ #include "compile.h" #include "frameobject.h" #include "traceback.h" static PyCodeObject* __Pyx_CreateCodeObjectForTraceback( const char *funcname, int c_line, int py_line, const char *filename) { PyCodeObject *py_code = 0; PyObject *py_srcfile = 0; PyObject *py_funcname = 0; #if PY_MAJOR_VERSION < 3 py_srcfile = PyString_FromString(filename); #else py_srcfile = PyUnicode_FromString(filename); #endif if (!py_srcfile) goto bad; if (c_line) { #if PY_MAJOR_VERSION < 3 py_funcname = PyString_FromFormat( "%s (%s:%d)", funcname, __pyx_cfilenm, c_line); #else py_funcname = PyUnicode_FromFormat( "%s (%s:%d)", funcname, __pyx_cfilenm, c_line); #endif } else { #if PY_MAJOR_VERSION < 3 py_funcname = PyString_FromString(funcname); #else py_funcname = PyUnicode_FromString(funcname); #endif } if (!py_funcname) goto bad; py_code = __Pyx_PyCode_New( 0, 0, 0, 0, 0, __pyx_empty_bytes, /*PyObject *code,*/ __pyx_empty_tuple, /*PyObject *consts,*/ __pyx_empty_tuple, /*PyObject *names,*/ __pyx_empty_tuple, /*PyObject *varnames,*/ __pyx_empty_tuple, /*PyObject *freevars,*/ __pyx_empty_tuple, /*PyObject *cellvars,*/ py_srcfile, /*PyObject *filename,*/ py_funcname, /*PyObject *name,*/ py_line, __pyx_empty_bytes /*PyObject *lnotab*/ ); Py_DECREF(py_srcfile); Py_DECREF(py_funcname); return py_code; bad: Py_XDECREF(py_srcfile); Py_XDECREF(py_funcname); return NULL; } static void __Pyx_AddTraceback(const char *funcname, int c_line, int py_line, const char *filename) { PyCodeObject *py_code = 0; PyFrameObject *py_frame = 0; py_code = __pyx_find_code_object(c_line ? c_line : py_line); if (!py_code) { py_code = __Pyx_CreateCodeObjectForTraceback( funcname, c_line, py_line, filename); if (!py_code) goto bad; __pyx_insert_code_object(c_line ? c_line : py_line, py_code); } py_frame = PyFrame_New( PyThreadState_GET(), /*PyThreadState *tstate,*/ py_code, /*PyCodeObject *code,*/ __pyx_d, /*PyObject *globals,*/ 0 /*PyObject *locals*/ ); if (!py_frame) goto bad; py_frame->f_lineno = py_line; PyTraceBack_Here(py_frame); bad: Py_XDECREF(py_code); Py_XDECREF(py_frame); } /* CIntFromPyVerify */ #define __PYX_VERIFY_RETURN_INT(target_type, func_type, func_value)\ __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, 0) #define __PYX_VERIFY_RETURN_INT_EXC(target_type, func_type, func_value)\ __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, 1) #define __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, exc)\ {\ func_type value = func_value;\ if (sizeof(target_type) < sizeof(func_type)) {\ if (unlikely(value != (func_type) (target_type) value)) {\ func_type zero = 0;\ if (exc && unlikely(value == (func_type)-1 && PyErr_Occurred()))\ return (target_type) -1;\ if (is_unsigned && unlikely(value < zero))\ goto raise_neg_overflow;\ else\ goto raise_overflow;\ }\ }\ return (target_type) value;\ } /* CIntToPy */ static CYTHON_INLINE PyObject* __Pyx_PyInt_From_int64_t(int64_t value) { const int64_t neg_one = (int64_t) -1, const_zero = (int64_t) 0; const int is_unsigned = neg_one > const_zero; if (is_unsigned) { if (sizeof(int64_t) < sizeof(long)) { return PyInt_FromLong((long) value); } else if (sizeof(int64_t) <= sizeof(unsigned long)) { return PyLong_FromUnsignedLong((unsigned long) value); } else if (sizeof(int64_t) <= sizeof(unsigned PY_LONG_LONG)) { return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value); } } else { if (sizeof(int64_t) <= sizeof(long)) { return PyInt_FromLong((long) value); } else if (sizeof(int64_t) <= sizeof(PY_LONG_LONG)) { return PyLong_FromLongLong((PY_LONG_LONG) value); } } { int one = 1; int little = (int)*(unsigned char *)&one; unsigned char *bytes = (unsigned char *)&value; return _PyLong_FromByteArray(bytes, sizeof(int64_t), little, !is_unsigned); } } /* CIntToPy */ static CYTHON_INLINE PyObject* __Pyx_PyInt_From_int(int value) { const int neg_one = (int) -1, const_zero = (int) 0; const int is_unsigned = neg_one > const_zero; if (is_unsigned) { if (sizeof(int) < sizeof(long)) { return PyInt_FromLong((long) value); } else if (sizeof(int) <= sizeof(unsigned long)) { return PyLong_FromUnsignedLong((unsigned long) value); } else if (sizeof(int) <= sizeof(unsigned PY_LONG_LONG)) { return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value); } } else { if (sizeof(int) <= sizeof(long)) { return PyInt_FromLong((long) value); } else if (sizeof(int) <= sizeof(PY_LONG_LONG)) { return PyLong_FromLongLong((PY_LONG_LONG) value); } } { int one = 1; int little = (int)*(unsigned char *)&one; unsigned char *bytes = (unsigned char *)&value; return _PyLong_FromByteArray(bytes, sizeof(int), little, !is_unsigned); } } /* CIntFromPy */ static CYTHON_INLINE int64_t __Pyx_PyInt_As_int64_t(PyObject *x) { const int64_t neg_one = (int64_t) -1, const_zero = (int64_t) 0; const int is_unsigned = neg_one > const_zero; #if PY_MAJOR_VERSION < 3 if (likely(PyInt_Check(x))) { if (sizeof(int64_t) < sizeof(long)) { __PYX_VERIFY_RETURN_INT(int64_t, long, PyInt_AS_LONG(x)) } else { long val = PyInt_AS_LONG(x); if (is_unsigned && unlikely(val < 0)) { goto raise_neg_overflow; } return (int64_t) val; } } else #endif if (likely(PyLong_Check(x))) { if (is_unsigned) { #if CYTHON_USE_PYLONG_INTERNALS const digit* digits = ((PyLongObject*)x)->ob_digit; switch (Py_SIZE(x)) { case 0: return (int64_t) 0; case 1: __PYX_VERIFY_RETURN_INT(int64_t, digit, digits[0]) case 2: if (8 * sizeof(int64_t) > 1 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(int64_t, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(int64_t) >= 2 * PyLong_SHIFT) { return (int64_t) (((((int64_t)digits[1]) << PyLong_SHIFT) | (int64_t)digits[0])); } } break; case 3: if (8 * sizeof(int64_t) > 2 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(int64_t, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(int64_t) >= 3 * PyLong_SHIFT) { return (int64_t) (((((((int64_t)digits[2]) << PyLong_SHIFT) | (int64_t)digits[1]) << PyLong_SHIFT) | (int64_t)digits[0])); } } break; case 4: if (8 * sizeof(int64_t) > 3 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(int64_t, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(int64_t) >= 4 * PyLong_SHIFT) { return (int64_t) (((((((((int64_t)digits[3]) << PyLong_SHIFT) | (int64_t)digits[2]) << PyLong_SHIFT) | (int64_t)digits[1]) << PyLong_SHIFT) | (int64_t)digits[0])); } } break; } #endif #if CYTHON_COMPILING_IN_CPYTHON if (unlikely(Py_SIZE(x) < 0)) { goto raise_neg_overflow; } #else { int result = PyObject_RichCompareBool(x, Py_False, Py_LT); if (unlikely(result < 0)) return (int64_t) -1; if (unlikely(result == 1)) goto raise_neg_overflow; } #endif if (sizeof(int64_t) <= sizeof(unsigned long)) { __PYX_VERIFY_RETURN_INT_EXC(int64_t, unsigned long, PyLong_AsUnsignedLong(x)) } else if (sizeof(int64_t) <= sizeof(unsigned PY_LONG_LONG)) { __PYX_VERIFY_RETURN_INT_EXC(int64_t, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x)) } } else { #if CYTHON_USE_PYLONG_INTERNALS const digit* digits = ((PyLongObject*)x)->ob_digit; switch (Py_SIZE(x)) { case 0: return (int64_t) 0; case -1: __PYX_VERIFY_RETURN_INT(int64_t, sdigit, (sdigit) (-(sdigit)digits[0])) case 1: __PYX_VERIFY_RETURN_INT(int64_t, digit, +digits[0]) case -2: if (8 * sizeof(int64_t) - 1 > 1 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(int64_t, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(int64_t) - 1 > 2 * PyLong_SHIFT) { return (int64_t) (((int64_t)-1)*(((((int64_t)digits[1]) << PyLong_SHIFT) | (int64_t)digits[0]))); } } break; case 2: if (8 * sizeof(int64_t) > 1 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(int64_t, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(int64_t) - 1 > 2 * PyLong_SHIFT) { return (int64_t) ((((((int64_t)digits[1]) << PyLong_SHIFT) | (int64_t)digits[0]))); } } break; case -3: if (8 * sizeof(int64_t) - 1 > 2 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(int64_t, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(int64_t) - 1 > 3 * PyLong_SHIFT) { return (int64_t) (((int64_t)-1)*(((((((int64_t)digits[2]) << PyLong_SHIFT) | (int64_t)digits[1]) << PyLong_SHIFT) | (int64_t)digits[0]))); } } break; case 3: if (8 * sizeof(int64_t) > 2 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(int64_t, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(int64_t) - 1 > 3 * PyLong_SHIFT) { return (int64_t) ((((((((int64_t)digits[2]) << PyLong_SHIFT) | (int64_t)digits[1]) << PyLong_SHIFT) | (int64_t)digits[0]))); } } break; case -4: if (8 * sizeof(int64_t) - 1 > 3 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(int64_t, long, -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(int64_t) - 1 > 4 * PyLong_SHIFT) { return (int64_t) (((int64_t)-1)*(((((((((int64_t)digits[3]) << PyLong_SHIFT) | (int64_t)digits[2]) << PyLong_SHIFT) | (int64_t)digits[1]) << PyLong_SHIFT) | (int64_t)digits[0]))); } } break; case 4: if (8 * sizeof(int64_t) > 3 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(int64_t, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(int64_t) - 1 > 4 * PyLong_SHIFT) { return (int64_t) ((((((((((int64_t)digits[3]) << PyLong_SHIFT) | (int64_t)digits[2]) << PyLong_SHIFT) | (int64_t)digits[1]) << PyLong_SHIFT) | (int64_t)digits[0]))); } } break; } #endif if (sizeof(int64_t) <= sizeof(long)) { __PYX_VERIFY_RETURN_INT_EXC(int64_t, long, PyLong_AsLong(x)) } else if (sizeof(int64_t) <= sizeof(PY_LONG_LONG)) { __PYX_VERIFY_RETURN_INT_EXC(int64_t, PY_LONG_LONG, PyLong_AsLongLong(x)) } } { #if CYTHON_COMPILING_IN_PYPY && !defined(_PyLong_AsByteArray) PyErr_SetString(PyExc_RuntimeError, "_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers"); #else int64_t val; PyObject *v = __Pyx_PyNumber_IntOrLong(x); #if PY_MAJOR_VERSION < 3 if (likely(v) && !PyLong_Check(v)) { PyObject *tmp = v; v = PyNumber_Long(tmp); Py_DECREF(tmp); } #endif if (likely(v)) { int one = 1; int is_little = (int)*(unsigned char *)&one; unsigned char *bytes = (unsigned char *)&val; int ret = _PyLong_AsByteArray((PyLongObject *)v, bytes, sizeof(val), is_little, !is_unsigned); Py_DECREF(v); if (likely(!ret)) return val; } #endif return (int64_t) -1; } } else { int64_t val; PyObject *tmp = __Pyx_PyNumber_IntOrLong(x); if (!tmp) return (int64_t) -1; val = __Pyx_PyInt_As_int64_t(tmp); Py_DECREF(tmp); return val; } raise_overflow: PyErr_SetString(PyExc_OverflowError, "value too large to convert to int64_t"); return (int64_t) -1; raise_neg_overflow: PyErr_SetString(PyExc_OverflowError, "can't convert negative value to int64_t"); return (int64_t) -1; } /* CIntToPy */ static CYTHON_INLINE PyObject* __Pyx_PyInt_From_long(long value) { const long neg_one = (long) -1, const_zero = (long) 0; const int is_unsigned = neg_one > const_zero; if (is_unsigned) { if (sizeof(long) < sizeof(long)) { return PyInt_FromLong((long) value); } else if (sizeof(long) <= sizeof(unsigned long)) { return PyLong_FromUnsignedLong((unsigned long) value); } else if (sizeof(long) <= sizeof(unsigned PY_LONG_LONG)) { return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value); } } else { if (sizeof(long) <= sizeof(long)) { return PyInt_FromLong((long) value); } else if (sizeof(long) <= sizeof(PY_LONG_LONG)) { return PyLong_FromLongLong((PY_LONG_LONG) value); } } { int one = 1; int little = (int)*(unsigned char *)&one; unsigned char *bytes = (unsigned char *)&value; return _PyLong_FromByteArray(bytes, sizeof(long), little, !is_unsigned); } } /* CIntFromPy */ static CYTHON_INLINE long __Pyx_PyInt_As_long(PyObject *x) { const long neg_one = (long) -1, const_zero = (long) 0; const int is_unsigned = neg_one > const_zero; #if PY_MAJOR_VERSION < 3 if (likely(PyInt_Check(x))) { if (sizeof(long) < sizeof(long)) { __PYX_VERIFY_RETURN_INT(long, long, PyInt_AS_LONG(x)) } else { long val = PyInt_AS_LONG(x); if (is_unsigned && unlikely(val < 0)) { goto raise_neg_overflow; } return (long) val; } } else #endif if (likely(PyLong_Check(x))) { if (is_unsigned) { #if CYTHON_USE_PYLONG_INTERNALS const digit* digits = ((PyLongObject*)x)->ob_digit; switch (Py_SIZE(x)) { case 0: return (long) 0; case 1: __PYX_VERIFY_RETURN_INT(long, digit, digits[0]) case 2: if (8 * sizeof(long) > 1 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(long) >= 2 * PyLong_SHIFT) { return (long) (((((long)digits[1]) << PyLong_SHIFT) | (long)digits[0])); } } break; case 3: if (8 * sizeof(long) > 2 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(long) >= 3 * PyLong_SHIFT) { return (long) (((((((long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0])); } } break; case 4: if (8 * sizeof(long) > 3 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(long) >= 4 * PyLong_SHIFT) { return (long) (((((((((long)digits[3]) << PyLong_SHIFT) | (long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0])); } } break; } #endif #if CYTHON_COMPILING_IN_CPYTHON if (unlikely(Py_SIZE(x) < 0)) { goto raise_neg_overflow; } #else { int result = PyObject_RichCompareBool(x, Py_False, Py_LT); if (unlikely(result < 0)) return (long) -1; if (unlikely(result == 1)) goto raise_neg_overflow; } #endif if (sizeof(long) <= sizeof(unsigned long)) { __PYX_VERIFY_RETURN_INT_EXC(long, unsigned long, PyLong_AsUnsignedLong(x)) } else if (sizeof(long) <= sizeof(unsigned PY_LONG_LONG)) { __PYX_VERIFY_RETURN_INT_EXC(long, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x)) } } else { #if CYTHON_USE_PYLONG_INTERNALS const digit* digits = ((PyLongObject*)x)->ob_digit; switch (Py_SIZE(x)) { case 0: return (long) 0; case -1: __PYX_VERIFY_RETURN_INT(long, sdigit, (sdigit) (-(sdigit)digits[0])) case 1: __PYX_VERIFY_RETURN_INT(long, digit, +digits[0]) case -2: if (8 * sizeof(long) - 1 > 1 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(long, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) { return (long) (((long)-1)*(((((long)digits[1]) << PyLong_SHIFT) | (long)digits[0]))); } } break; case 2: if (8 * sizeof(long) > 1 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) { return (long) ((((((long)digits[1]) << PyLong_SHIFT) | (long)digits[0]))); } } break; case -3: if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(long, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) { return (long) (((long)-1)*(((((((long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0]))); } } break; case 3: if (8 * sizeof(long) > 2 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) { return (long) ((((((((long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0]))); } } break; case -4: if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(long, long, -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(long) - 1 > 4 * PyLong_SHIFT) { return (long) (((long)-1)*(((((((((long)digits[3]) << PyLong_SHIFT) | (long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0]))); } } break; case 4: if (8 * sizeof(long) > 3 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(long) - 1 > 4 * PyLong_SHIFT) { return (long) ((((((((((long)digits[3]) << PyLong_SHIFT) | (long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0]))); } } break; } #endif if (sizeof(long) <= sizeof(long)) { __PYX_VERIFY_RETURN_INT_EXC(long, long, PyLong_AsLong(x)) } else if (sizeof(long) <= sizeof(PY_LONG_LONG)) { __PYX_VERIFY_RETURN_INT_EXC(long, PY_LONG_LONG, PyLong_AsLongLong(x)) } } { #if CYTHON_COMPILING_IN_PYPY && !defined(_PyLong_AsByteArray) PyErr_SetString(PyExc_RuntimeError, "_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers"); #else long val; PyObject *v = __Pyx_PyNumber_IntOrLong(x); #if PY_MAJOR_VERSION < 3 if (likely(v) && !PyLong_Check(v)) { PyObject *tmp = v; v = PyNumber_Long(tmp); Py_DECREF(tmp); } #endif if (likely(v)) { int one = 1; int is_little = (int)*(unsigned char *)&one; unsigned char *bytes = (unsigned char *)&val; int ret = _PyLong_AsByteArray((PyLongObject *)v, bytes, sizeof(val), is_little, !is_unsigned); Py_DECREF(v); if (likely(!ret)) return val; } #endif return (long) -1; } } else { long val; PyObject *tmp = __Pyx_PyNumber_IntOrLong(x); if (!tmp) return (long) -1; val = __Pyx_PyInt_As_long(tmp); Py_DECREF(tmp); return val; } raise_overflow: PyErr_SetString(PyExc_OverflowError, "value too large to convert to long"); return (long) -1; raise_neg_overflow: PyErr_SetString(PyExc_OverflowError, "can't convert negative value to long"); return (long) -1; } /* CIntFromPy */ static CYTHON_INLINE int __Pyx_PyInt_As_int(PyObject *x) { const int neg_one = (int) -1, const_zero = (int) 0; const int is_unsigned = neg_one > const_zero; #if PY_MAJOR_VERSION < 3 if (likely(PyInt_Check(x))) { if (sizeof(int) < sizeof(long)) { __PYX_VERIFY_RETURN_INT(int, long, PyInt_AS_LONG(x)) } else { long val = PyInt_AS_LONG(x); if (is_unsigned && unlikely(val < 0)) { goto raise_neg_overflow; } return (int) val; } } else #endif if (likely(PyLong_Check(x))) { if (is_unsigned) { #if CYTHON_USE_PYLONG_INTERNALS const digit* digits = ((PyLongObject*)x)->ob_digit; switch (Py_SIZE(x)) { case 0: return (int) 0; case 1: __PYX_VERIFY_RETURN_INT(int, digit, digits[0]) case 2: if (8 * sizeof(int) > 1 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(int) >= 2 * PyLong_SHIFT) { return (int) (((((int)digits[1]) << PyLong_SHIFT) | (int)digits[0])); } } break; case 3: if (8 * sizeof(int) > 2 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(int) >= 3 * PyLong_SHIFT) { return (int) (((((((int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0])); } } break; case 4: if (8 * sizeof(int) > 3 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(int) >= 4 * PyLong_SHIFT) { return (int) (((((((((int)digits[3]) << PyLong_SHIFT) | (int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0])); } } break; } #endif #if CYTHON_COMPILING_IN_CPYTHON if (unlikely(Py_SIZE(x) < 0)) { goto raise_neg_overflow; } #else { int result = PyObject_RichCompareBool(x, Py_False, Py_LT); if (unlikely(result < 0)) return (int) -1; if (unlikely(result == 1)) goto raise_neg_overflow; } #endif if (sizeof(int) <= sizeof(unsigned long)) { __PYX_VERIFY_RETURN_INT_EXC(int, unsigned long, PyLong_AsUnsignedLong(x)) } else if (sizeof(int) <= sizeof(unsigned PY_LONG_LONG)) { __PYX_VERIFY_RETURN_INT_EXC(int, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x)) } } else { #if CYTHON_USE_PYLONG_INTERNALS const digit* digits = ((PyLongObject*)x)->ob_digit; switch (Py_SIZE(x)) { case 0: return (int) 0; case -1: __PYX_VERIFY_RETURN_INT(int, sdigit, (sdigit) (-(sdigit)digits[0])) case 1: __PYX_VERIFY_RETURN_INT(int, digit, +digits[0]) case -2: if (8 * sizeof(int) - 1 > 1 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(int, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(int) - 1 > 2 * PyLong_SHIFT) { return (int) (((int)-1)*(((((int)digits[1]) << PyLong_SHIFT) | (int)digits[0]))); } } break; case 2: if (8 * sizeof(int) > 1 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(int) - 1 > 2 * PyLong_SHIFT) { return (int) ((((((int)digits[1]) << PyLong_SHIFT) | (int)digits[0]))); } } break; case -3: if (8 * sizeof(int) - 1 > 2 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(int, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(int) - 1 > 3 * PyLong_SHIFT) { return (int) (((int)-1)*(((((((int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0]))); } } break; case 3: if (8 * sizeof(int) > 2 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(int) - 1 > 3 * PyLong_SHIFT) { return (int) ((((((((int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0]))); } } break; case -4: if (8 * sizeof(int) - 1 > 3 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(int, long, -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(int) - 1 > 4 * PyLong_SHIFT) { return (int) (((int)-1)*(((((((((int)digits[3]) << PyLong_SHIFT) | (int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0]))); } } break; case 4: if (8 * sizeof(int) > 3 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(int) - 1 > 4 * PyLong_SHIFT) { return (int) ((((((((((int)digits[3]) << PyLong_SHIFT) | (int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0]))); } } break; } #endif if (sizeof(int) <= sizeof(long)) { __PYX_VERIFY_RETURN_INT_EXC(int, long, PyLong_AsLong(x)) } else if (sizeof(int) <= sizeof(PY_LONG_LONG)) { __PYX_VERIFY_RETURN_INT_EXC(int, PY_LONG_LONG, PyLong_AsLongLong(x)) } } { #if CYTHON_COMPILING_IN_PYPY && !defined(_PyLong_AsByteArray) PyErr_SetString(PyExc_RuntimeError, "_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers"); #else int val; PyObject *v = __Pyx_PyNumber_IntOrLong(x); #if PY_MAJOR_VERSION < 3 if (likely(v) && !PyLong_Check(v)) { PyObject *tmp = v; v = PyNumber_Long(tmp); Py_DECREF(tmp); } #endif if (likely(v)) { int one = 1; int is_little = (int)*(unsigned char *)&one; unsigned char *bytes = (unsigned char *)&val; int ret = _PyLong_AsByteArray((PyLongObject *)v, bytes, sizeof(val), is_little, !is_unsigned); Py_DECREF(v); if (likely(!ret)) return val; } #endif return (int) -1; } } else { int val; PyObject *tmp = __Pyx_PyNumber_IntOrLong(x); if (!tmp) return (int) -1; val = __Pyx_PyInt_As_int(tmp); Py_DECREF(tmp); return val; } raise_overflow: PyErr_SetString(PyExc_OverflowError, "value too large to convert to int"); return (int) -1; raise_neg_overflow: PyErr_SetString(PyExc_OverflowError, "can't convert negative value to int"); return (int) -1; } /* CheckBinaryVersion */ static int __Pyx_check_binary_version(void) { char ctversion[4], rtversion[4]; PyOS_snprintf(ctversion, 4, "%d.%d", PY_MAJOR_VERSION, PY_MINOR_VERSION); PyOS_snprintf(rtversion, 4, "%s", Py_GetVersion()); if (ctversion[0] != rtversion[0] || ctversion[2] != rtversion[2]) { char message[200]; PyOS_snprintf(message, sizeof(message), "compiletime version %s of module '%.100s' " "does not match runtime version %s", ctversion, __Pyx_MODULE_NAME, rtversion); return PyErr_WarnEx(NULL, message, 1); } return 0; } /* FunctionExport */ static int __Pyx_ExportFunction(const char *name, void (*f)(void), const char *sig) { PyObject *d = 0; PyObject *cobj = 0; union { void (*fp)(void); void *p; } tmp; d = PyObject_GetAttrString(__pyx_m, (char *)"__pyx_capi__"); if (!d) { PyErr_Clear(); d = PyDict_New(); if (!d) goto bad; Py_INCREF(d); if (PyModule_AddObject(__pyx_m, (char *)"__pyx_capi__", d) < 0) goto bad; } tmp.fp = f; #if PY_VERSION_HEX >= 0x02070000 cobj = PyCapsule_New(tmp.p, sig, 0); #else cobj = PyCObject_FromVoidPtrAndDesc(tmp.p, (void *)sig, 0); #endif if (!cobj) goto bad; if (PyDict_SetItemString(d, name, cobj) < 0) goto bad; Py_DECREF(cobj); Py_DECREF(d); return 0; bad: Py_XDECREF(cobj); Py_XDECREF(d); return -1; } /* ModuleImport */ #ifndef __PYX_HAVE_RT_ImportModule #define __PYX_HAVE_RT_ImportModule static PyObject *__Pyx_ImportModule(const char *name) { PyObject *py_name = 0; PyObject *py_module = 0; py_name = __Pyx_PyIdentifier_FromString(name); if (!py_name) goto bad; py_module = PyImport_Import(py_name); Py_DECREF(py_name); return py_module; bad: Py_XDECREF(py_name); return 0; } #endif /* TypeImport */ #ifndef __PYX_HAVE_RT_ImportType #define __PYX_HAVE_RT_ImportType static PyTypeObject *__Pyx_ImportType(const char *module_name, const char *class_name, size_t size, int strict) { PyObject *py_module = 0; PyObject *result = 0; PyObject *py_name = 0; char warning[200]; Py_ssize_t basicsize; #ifdef Py_LIMITED_API PyObject *py_basicsize; #endif py_module = __Pyx_ImportModule(module_name); if (!py_module) goto bad; py_name = __Pyx_PyIdentifier_FromString(class_name); if (!py_name) goto bad; result = PyObject_GetAttr(py_module, py_name); Py_DECREF(py_name); py_name = 0; Py_DECREF(py_module); py_module = 0; if (!result) goto bad; if (!PyType_Check(result)) { PyErr_Format(PyExc_TypeError, "%.200s.%.200s is not a type object", module_name, class_name); goto bad; } #ifndef Py_LIMITED_API basicsize = ((PyTypeObject *)result)->tp_basicsize; #else py_basicsize = PyObject_GetAttrString(result, "__basicsize__"); if (!py_basicsize) goto bad; basicsize = PyLong_AsSsize_t(py_basicsize); Py_DECREF(py_basicsize); py_basicsize = 0; if (basicsize == (Py_ssize_t)-1 && PyErr_Occurred()) goto bad; #endif if (!strict && (size_t)basicsize > size) { PyOS_snprintf(warning, sizeof(warning), "%s.%s size changed, may indicate binary incompatibility. Expected %zd, got %zd", module_name, class_name, basicsize, size); if (PyErr_WarnEx(NULL, warning, 0) < 0) goto bad; } else if ((size_t)basicsize != size) { PyErr_Format(PyExc_ValueError, "%.200s.%.200s has the wrong size, try recompiling. Expected %zd, got %zd", module_name, class_name, basicsize, size); goto bad; } return (PyTypeObject *)result; bad: Py_XDECREF(py_module); Py_XDECREF(result); return NULL; } #endif /* InitStrings */ static int __Pyx_InitStrings(__Pyx_StringTabEntry *t) { while (t->p) { #if PY_MAJOR_VERSION < 3 if (t->is_unicode) { *t->p = PyUnicode_DecodeUTF8(t->s, t->n - 1, NULL); } else if (t->intern) { *t->p = PyString_InternFromString(t->s); } else { *t->p = PyString_FromStringAndSize(t->s, t->n - 1); } #else if (t->is_unicode | t->is_str) { if (t->intern) { *t->p = PyUnicode_InternFromString(t->s); } else if (t->encoding) { *t->p = PyUnicode_Decode(t->s, t->n - 1, t->encoding, NULL); } else { *t->p = PyUnicode_FromStringAndSize(t->s, t->n - 1); } } else { *t->p = PyBytes_FromStringAndSize(t->s, t->n - 1); } #endif if (!*t->p) return -1; ++t; } return 0; } static CYTHON_INLINE PyObject* __Pyx_PyUnicode_FromString(const char* c_str) { return __Pyx_PyUnicode_FromStringAndSize(c_str, (Py_ssize_t)strlen(c_str)); } static CYTHON_INLINE char* __Pyx_PyObject_AsString(PyObject* o) { Py_ssize_t ignore; return __Pyx_PyObject_AsStringAndSize(o, &ignore); } static CYTHON_INLINE char* __Pyx_PyObject_AsStringAndSize(PyObject* o, Py_ssize_t *length) { #if CYTHON_COMPILING_IN_CPYTHON && (__PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT) if ( #if PY_MAJOR_VERSION < 3 && __PYX_DEFAULT_STRING_ENCODING_IS_ASCII __Pyx_sys_getdefaultencoding_not_ascii && #endif PyUnicode_Check(o)) { #if PY_VERSION_HEX < 0x03030000 char* defenc_c; PyObject* defenc = _PyUnicode_AsDefaultEncodedString(o, NULL); if (!defenc) return NULL; defenc_c = PyBytes_AS_STRING(defenc); #if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII { char* end = defenc_c + PyBytes_GET_SIZE(defenc); char* c; for (c = defenc_c; c < end; c++) { if ((unsigned char) (*c) >= 128) { PyUnicode_AsASCIIString(o); return NULL; } } } #endif *length = PyBytes_GET_SIZE(defenc); return defenc_c; #else if (__Pyx_PyUnicode_READY(o) == -1) return NULL; #if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII if (PyUnicode_IS_ASCII(o)) { *length = PyUnicode_GET_LENGTH(o); return PyUnicode_AsUTF8(o); } else { PyUnicode_AsASCIIString(o); return NULL; } #else return PyUnicode_AsUTF8AndSize(o, length); #endif #endif } else #endif #if (!CYTHON_COMPILING_IN_PYPY) || (defined(PyByteArray_AS_STRING) && defined(PyByteArray_GET_SIZE)) if (PyByteArray_Check(o)) { *length = PyByteArray_GET_SIZE(o); return PyByteArray_AS_STRING(o); } else #endif { char* result; int r = PyBytes_AsStringAndSize(o, &result, length); if (unlikely(r < 0)) { return NULL; } else { return result; } } } static CYTHON_INLINE int __Pyx_PyObject_IsTrue(PyObject* x) { int is_true = x == Py_True; if (is_true | (x == Py_False) | (x == Py_None)) return is_true; else return PyObject_IsTrue(x); } static CYTHON_INLINE PyObject* __Pyx_PyNumber_IntOrLong(PyObject* x) { PyNumberMethods *m; const char *name = NULL; PyObject *res = NULL; #if PY_MAJOR_VERSION < 3 if (PyInt_Check(x) || PyLong_Check(x)) #else if (PyLong_Check(x)) #endif return __Pyx_NewRef(x); m = Py_TYPE(x)->tp_as_number; #if PY_MAJOR_VERSION < 3 if (m && m->nb_int) { name = "int"; res = PyNumber_Int(x); } else if (m && m->nb_long) { name = "long"; res = PyNumber_Long(x); } #else if (m && m->nb_int) { name = "int"; res = PyNumber_Long(x); } #endif if (res) { #if PY_MAJOR_VERSION < 3 if (!PyInt_Check(res) && !PyLong_Check(res)) { #else if (!PyLong_Check(res)) { #endif PyErr_Format(PyExc_TypeError, "__%.4s__ returned non-%.4s (type %.200s)", name, name, Py_TYPE(res)->tp_name); Py_DECREF(res); return NULL; } } else if (!PyErr_Occurred()) { PyErr_SetString(PyExc_TypeError, "an integer is required"); } return res; } static CYTHON_INLINE Py_ssize_t __Pyx_PyIndex_AsSsize_t(PyObject* b) { Py_ssize_t ival; PyObject *x; #if PY_MAJOR_VERSION < 3 if (likely(PyInt_CheckExact(b))) { if (sizeof(Py_ssize_t) >= sizeof(long)) return PyInt_AS_LONG(b); else return PyInt_AsSsize_t(x); } #endif if (likely(PyLong_CheckExact(b))) { #if CYTHON_USE_PYLONG_INTERNALS const digit* digits = ((PyLongObject*)b)->ob_digit; const Py_ssize_t size = Py_SIZE(b); if (likely(__Pyx_sst_abs(size) <= 1)) { ival = likely(size) ? digits[0] : 0; if (size == -1) ival = -ival; return ival; } else { switch (size) { case 2: if (8 * sizeof(Py_ssize_t) > 2 * PyLong_SHIFT) { return (Py_ssize_t) (((((size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])); } break; case -2: if (8 * sizeof(Py_ssize_t) > 2 * PyLong_SHIFT) { return -(Py_ssize_t) (((((size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])); } break; case 3: if (8 * sizeof(Py_ssize_t) > 3 * PyLong_SHIFT) { return (Py_ssize_t) (((((((size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])); } break; case -3: if (8 * sizeof(Py_ssize_t) > 3 * PyLong_SHIFT) { return -(Py_ssize_t) (((((((size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])); } break; case 4: if (8 * sizeof(Py_ssize_t) > 4 * PyLong_SHIFT) { return (Py_ssize_t) (((((((((size_t)digits[3]) << PyLong_SHIFT) | (size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])); } break; case -4: if (8 * sizeof(Py_ssize_t) > 4 * PyLong_SHIFT) { return -(Py_ssize_t) (((((((((size_t)digits[3]) << PyLong_SHIFT) | (size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])); } break; } } #endif return PyLong_AsSsize_t(b); } x = PyNumber_Index(b); if (!x) return -1; ival = PyInt_AsSsize_t(x); Py_DECREF(x); return ival; } static CYTHON_INLINE PyObject * __Pyx_PyInt_FromSize_t(size_t ival) { return PyInt_FromSize_t(ival); } #endif /* Py_PYTHON_H */ pygame_sdl2-2.1.0-for-renpy-6.99.14.1/gen3/pygame_sdl2.mouse.c0000664000175000017500000035267712665223541022635 0ustar tomtom00000000000000/* Generated by Cython 0.23.3 */ #define PY_SSIZE_T_CLEAN #include "Python.h" #ifndef Py_PYTHON_H #error Python headers needed to compile C extensions, please install development version of Python. #elif PY_VERSION_HEX < 0x02060000 || (0x03000000 <= PY_VERSION_HEX && PY_VERSION_HEX < 0x03020000) #error Cython requires Python 2.6+ or Python 3.2+. #else #define CYTHON_ABI "0_23_3" #include #ifndef offsetof #define offsetof(type, member) ( (size_t) & ((type*)0) -> member ) #endif #if !defined(WIN32) && !defined(MS_WINDOWS) #ifndef __stdcall #define __stdcall #endif #ifndef __cdecl #define __cdecl #endif #ifndef __fastcall #define __fastcall #endif #endif #ifndef DL_IMPORT #define DL_IMPORT(t) t #endif #ifndef DL_EXPORT #define DL_EXPORT(t) t #endif #ifndef PY_LONG_LONG #define PY_LONG_LONG LONG_LONG #endif #ifndef Py_HUGE_VAL #define Py_HUGE_VAL HUGE_VAL #endif #ifdef PYPY_VERSION #define CYTHON_COMPILING_IN_PYPY 1 #define CYTHON_COMPILING_IN_CPYTHON 0 #else #define CYTHON_COMPILING_IN_PYPY 0 #define CYTHON_COMPILING_IN_CPYTHON 1 #endif #if !defined(CYTHON_USE_PYLONG_INTERNALS) && CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x02070000 #define CYTHON_USE_PYLONG_INTERNALS 1 #endif #if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX < 0x02070600 && !defined(Py_OptimizeFlag) #define Py_OptimizeFlag 0 #endif #define __PYX_BUILD_PY_SSIZE_T "n" #define CYTHON_FORMAT_SSIZE_T "z" #if PY_MAJOR_VERSION < 3 #define __Pyx_BUILTIN_MODULE_NAME "__builtin__" #define __Pyx_PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)\ PyCode_New(a+k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos) #define __Pyx_DefaultClassType PyClass_Type #else #define __Pyx_BUILTIN_MODULE_NAME "builtins" #define __Pyx_PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)\ PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos) #define __Pyx_DefaultClassType PyType_Type #endif #ifndef Py_TPFLAGS_CHECKTYPES #define Py_TPFLAGS_CHECKTYPES 0 #endif #ifndef Py_TPFLAGS_HAVE_INDEX #define Py_TPFLAGS_HAVE_INDEX 0 #endif #ifndef Py_TPFLAGS_HAVE_NEWBUFFER #define Py_TPFLAGS_HAVE_NEWBUFFER 0 #endif #ifndef Py_TPFLAGS_HAVE_FINALIZE #define Py_TPFLAGS_HAVE_FINALIZE 0 #endif #if PY_VERSION_HEX > 0x03030000 && defined(PyUnicode_KIND) #define CYTHON_PEP393_ENABLED 1 #define __Pyx_PyUnicode_READY(op) (likely(PyUnicode_IS_READY(op)) ?\ 0 : _PyUnicode_Ready((PyObject *)(op))) #define __Pyx_PyUnicode_GET_LENGTH(u) PyUnicode_GET_LENGTH(u) #define __Pyx_PyUnicode_READ_CHAR(u, i) PyUnicode_READ_CHAR(u, i) #define __Pyx_PyUnicode_KIND(u) PyUnicode_KIND(u) #define __Pyx_PyUnicode_DATA(u) PyUnicode_DATA(u) #define __Pyx_PyUnicode_READ(k, d, i) PyUnicode_READ(k, d, i) #else #define CYTHON_PEP393_ENABLED 0 #define __Pyx_PyUnicode_READY(op) (0) #define __Pyx_PyUnicode_GET_LENGTH(u) PyUnicode_GET_SIZE(u) #define __Pyx_PyUnicode_READ_CHAR(u, i) ((Py_UCS4)(PyUnicode_AS_UNICODE(u)[i])) #define __Pyx_PyUnicode_KIND(u) (sizeof(Py_UNICODE)) #define __Pyx_PyUnicode_DATA(u) ((void*)PyUnicode_AS_UNICODE(u)) #define __Pyx_PyUnicode_READ(k, d, i) ((void)(k), (Py_UCS4)(((Py_UNICODE*)d)[i])) #endif #if CYTHON_COMPILING_IN_PYPY #define __Pyx_PyUnicode_Concat(a, b) PyNumber_Add(a, b) #define __Pyx_PyUnicode_ConcatSafe(a, b) PyNumber_Add(a, b) #else #define __Pyx_PyUnicode_Concat(a, b) PyUnicode_Concat(a, b) #define __Pyx_PyUnicode_ConcatSafe(a, b) ((unlikely((a) == Py_None) || unlikely((b) == Py_None)) ?\ PyNumber_Add(a, b) : __Pyx_PyUnicode_Concat(a, b)) #endif #if CYTHON_COMPILING_IN_PYPY && !defined(PyUnicode_Contains) #define PyUnicode_Contains(u, s) PySequence_Contains(u, s) #endif #define __Pyx_PyString_FormatSafe(a, b) ((unlikely((a) == Py_None)) ? PyNumber_Remainder(a, b) : __Pyx_PyString_Format(a, b)) #define __Pyx_PyUnicode_FormatSafe(a, b) ((unlikely((a) == Py_None)) ? PyNumber_Remainder(a, b) : PyUnicode_Format(a, b)) #if PY_MAJOR_VERSION >= 3 #define __Pyx_PyString_Format(a, b) PyUnicode_Format(a, b) #else #define __Pyx_PyString_Format(a, b) PyString_Format(a, b) #endif #if PY_MAJOR_VERSION >= 3 #define PyBaseString_Type PyUnicode_Type #define PyStringObject PyUnicodeObject #define PyString_Type PyUnicode_Type #define PyString_Check PyUnicode_Check #define PyString_CheckExact PyUnicode_CheckExact #endif #if PY_MAJOR_VERSION >= 3 #define __Pyx_PyBaseString_Check(obj) PyUnicode_Check(obj) #define __Pyx_PyBaseString_CheckExact(obj) PyUnicode_CheckExact(obj) #else #define __Pyx_PyBaseString_Check(obj) (PyString_Check(obj) || PyUnicode_Check(obj)) #define __Pyx_PyBaseString_CheckExact(obj) (PyString_CheckExact(obj) || PyUnicode_CheckExact(obj)) #endif #ifndef PySet_CheckExact #define PySet_CheckExact(obj) (Py_TYPE(obj) == &PySet_Type) #endif #define __Pyx_TypeCheck(obj, type) PyObject_TypeCheck(obj, (PyTypeObject *)type) #if PY_MAJOR_VERSION >= 3 #define PyIntObject PyLongObject #define PyInt_Type PyLong_Type #define PyInt_Check(op) PyLong_Check(op) #define PyInt_CheckExact(op) PyLong_CheckExact(op) #define PyInt_FromString PyLong_FromString #define PyInt_FromUnicode PyLong_FromUnicode #define PyInt_FromLong PyLong_FromLong #define PyInt_FromSize_t PyLong_FromSize_t #define PyInt_FromSsize_t PyLong_FromSsize_t #define PyInt_AsLong PyLong_AsLong #define PyInt_AS_LONG PyLong_AS_LONG #define PyInt_AsSsize_t PyLong_AsSsize_t #define PyInt_AsUnsignedLongMask PyLong_AsUnsignedLongMask #define PyInt_AsUnsignedLongLongMask PyLong_AsUnsignedLongLongMask #define PyNumber_Int PyNumber_Long #endif #if PY_MAJOR_VERSION >= 3 #define PyBoolObject PyLongObject #endif #if PY_MAJOR_VERSION >= 3 && CYTHON_COMPILING_IN_PYPY #ifndef PyUnicode_InternFromString #define PyUnicode_InternFromString(s) PyUnicode_FromString(s) #endif #endif #if PY_VERSION_HEX < 0x030200A4 typedef long Py_hash_t; #define __Pyx_PyInt_FromHash_t PyInt_FromLong #define __Pyx_PyInt_AsHash_t PyInt_AsLong #else #define __Pyx_PyInt_FromHash_t PyInt_FromSsize_t #define __Pyx_PyInt_AsHash_t PyInt_AsSsize_t #endif #if PY_MAJOR_VERSION >= 3 #define __Pyx_PyMethod_New(func, self, klass) ((self) ? PyMethod_New(func, self) : PyInstanceMethod_New(func)) #else #define __Pyx_PyMethod_New(func, self, klass) PyMethod_New(func, self, klass) #endif #if PY_VERSION_HEX >= 0x030500B1 #define __Pyx_PyAsyncMethodsStruct PyAsyncMethods #define __Pyx_PyType_AsAsync(obj) (Py_TYPE(obj)->tp_as_async) #elif CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3 typedef struct { unaryfunc am_await; unaryfunc am_aiter; unaryfunc am_anext; } __Pyx_PyAsyncMethodsStruct; #define __Pyx_PyType_AsAsync(obj) ((__Pyx_PyAsyncMethodsStruct*) (Py_TYPE(obj)->tp_reserved)) #else #define __Pyx_PyType_AsAsync(obj) NULL #endif #ifndef CYTHON_RESTRICT #if defined(__GNUC__) #define CYTHON_RESTRICT __restrict__ #elif defined(_MSC_VER) && _MSC_VER >= 1400 #define CYTHON_RESTRICT __restrict #elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L #define CYTHON_RESTRICT restrict #else #define CYTHON_RESTRICT #endif #endif #define __Pyx_void_to_None(void_result) (void_result, Py_INCREF(Py_None), Py_None) #ifndef CYTHON_INLINE #if defined(__GNUC__) #define CYTHON_INLINE __inline__ #elif defined(_MSC_VER) #define CYTHON_INLINE __inline #elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L #define CYTHON_INLINE inline #else #define CYTHON_INLINE #endif #endif #if defined(WIN32) || defined(MS_WINDOWS) #define _USE_MATH_DEFINES #endif #include #ifdef NAN #define __PYX_NAN() ((float) NAN) #else static CYTHON_INLINE float __PYX_NAN() { float value; memset(&value, 0xFF, sizeof(value)); return value; } #endif #if PY_MAJOR_VERSION >= 3 #define __Pyx_PyNumber_Divide(x,y) PyNumber_TrueDivide(x,y) #define __Pyx_PyNumber_InPlaceDivide(x,y) PyNumber_InPlaceTrueDivide(x,y) #else #define __Pyx_PyNumber_Divide(x,y) PyNumber_TrueDivide(x,y) #define __Pyx_PyNumber_InPlaceDivide(x,y) PyNumber_InPlaceTrueDivide(x,y) #endif #ifndef __PYX_EXTERN_C #ifdef __cplusplus #define __PYX_EXTERN_C extern "C" #else #define __PYX_EXTERN_C extern #endif #endif #define __PYX_HAVE__pygame_sdl2__mouse #define __PYX_HAVE_API__pygame_sdl2__mouse #include "stdint.h" #include "string.h" #include "stdio.h" #include "stddef.h" #include "SDL.h" #ifdef _OPENMP #include #endif /* _OPENMP */ #ifdef PYREX_WITHOUT_ASSERTIONS #define CYTHON_WITHOUT_ASSERTIONS #endif #ifndef CYTHON_UNUSED # if defined(__GNUC__) # if !(defined(__cplusplus)) || (__GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 4)) # define CYTHON_UNUSED __attribute__ ((__unused__)) # else # define CYTHON_UNUSED # endif # elif defined(__ICC) || (defined(__INTEL_COMPILER) && !defined(_MSC_VER)) # define CYTHON_UNUSED __attribute__ ((__unused__)) # else # define CYTHON_UNUSED # endif #endif #ifndef CYTHON_NCP_UNUSED # if CYTHON_COMPILING_IN_CPYTHON # define CYTHON_NCP_UNUSED # else # define CYTHON_NCP_UNUSED CYTHON_UNUSED # endif #endif typedef struct {PyObject **p; char *s; const Py_ssize_t n; const char* encoding; const char is_unicode; const char is_str; const char intern; } __Pyx_StringTabEntry; #define __PYX_DEFAULT_STRING_ENCODING_IS_ASCII 0 #define __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT 0 #define __PYX_DEFAULT_STRING_ENCODING "" #define __Pyx_PyObject_FromString __Pyx_PyBytes_FromString #define __Pyx_PyObject_FromStringAndSize __Pyx_PyBytes_FromStringAndSize #define __Pyx_uchar_cast(c) ((unsigned char)c) #define __Pyx_long_cast(x) ((long)x) #define __Pyx_fits_Py_ssize_t(v, type, is_signed) (\ (sizeof(type) < sizeof(Py_ssize_t)) ||\ (sizeof(type) > sizeof(Py_ssize_t) &&\ likely(v < (type)PY_SSIZE_T_MAX ||\ v == (type)PY_SSIZE_T_MAX) &&\ (!is_signed || likely(v > (type)PY_SSIZE_T_MIN ||\ v == (type)PY_SSIZE_T_MIN))) ||\ (sizeof(type) == sizeof(Py_ssize_t) &&\ (is_signed || likely(v < (type)PY_SSIZE_T_MAX ||\ v == (type)PY_SSIZE_T_MAX))) ) #if defined (__cplusplus) && __cplusplus >= 201103L #include #define __Pyx_sst_abs(value) std::abs(value) #elif SIZEOF_INT >= SIZEOF_SIZE_T #define __Pyx_sst_abs(value) abs(value) #elif SIZEOF_LONG >= SIZEOF_SIZE_T #define __Pyx_sst_abs(value) labs(value) #elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L #define __Pyx_sst_abs(value) llabs(value) #elif defined (_MSC_VER) && defined (_M_X64) #define __Pyx_sst_abs(value) _abs64(value) #elif defined (__GNUC__) #define __Pyx_sst_abs(value) __builtin_llabs(value) #else #define __Pyx_sst_abs(value) ((value<0) ? -value : value) #endif static CYTHON_INLINE char* __Pyx_PyObject_AsString(PyObject*); static CYTHON_INLINE char* __Pyx_PyObject_AsStringAndSize(PyObject*, Py_ssize_t* length); #define __Pyx_PyByteArray_FromString(s) PyByteArray_FromStringAndSize((const char*)s, strlen((const char*)s)) #define __Pyx_PyByteArray_FromStringAndSize(s, l) PyByteArray_FromStringAndSize((const char*)s, l) #define __Pyx_PyBytes_FromString PyBytes_FromString #define __Pyx_PyBytes_FromStringAndSize PyBytes_FromStringAndSize static CYTHON_INLINE PyObject* __Pyx_PyUnicode_FromString(const char*); #if PY_MAJOR_VERSION < 3 #define __Pyx_PyStr_FromString __Pyx_PyBytes_FromString #define __Pyx_PyStr_FromStringAndSize __Pyx_PyBytes_FromStringAndSize #else #define __Pyx_PyStr_FromString __Pyx_PyUnicode_FromString #define __Pyx_PyStr_FromStringAndSize __Pyx_PyUnicode_FromStringAndSize #endif #define __Pyx_PyObject_AsSString(s) ((signed char*) __Pyx_PyObject_AsString(s)) #define __Pyx_PyObject_AsUString(s) ((unsigned char*) __Pyx_PyObject_AsString(s)) #define __Pyx_PyObject_FromCString(s) __Pyx_PyObject_FromString((const char*)s) #define __Pyx_PyBytes_FromCString(s) __Pyx_PyBytes_FromString((const char*)s) #define __Pyx_PyByteArray_FromCString(s) __Pyx_PyByteArray_FromString((const char*)s) #define __Pyx_PyStr_FromCString(s) __Pyx_PyStr_FromString((const char*)s) #define __Pyx_PyUnicode_FromCString(s) __Pyx_PyUnicode_FromString((const char*)s) #if PY_MAJOR_VERSION < 3 static CYTHON_INLINE size_t __Pyx_Py_UNICODE_strlen(const Py_UNICODE *u) { const Py_UNICODE *u_end = u; while (*u_end++) ; return (size_t)(u_end - u - 1); } #else #define __Pyx_Py_UNICODE_strlen Py_UNICODE_strlen #endif #define __Pyx_PyUnicode_FromUnicode(u) PyUnicode_FromUnicode(u, __Pyx_Py_UNICODE_strlen(u)) #define __Pyx_PyUnicode_FromUnicodeAndLength PyUnicode_FromUnicode #define __Pyx_PyUnicode_AsUnicode PyUnicode_AsUnicode #define __Pyx_NewRef(obj) (Py_INCREF(obj), obj) #define __Pyx_Owned_Py_None(b) __Pyx_NewRef(Py_None) #define __Pyx_PyBool_FromLong(b) ((b) ? __Pyx_NewRef(Py_True) : __Pyx_NewRef(Py_False)) static CYTHON_INLINE int __Pyx_PyObject_IsTrue(PyObject*); static CYTHON_INLINE PyObject* __Pyx_PyNumber_Int(PyObject* x); static CYTHON_INLINE Py_ssize_t __Pyx_PyIndex_AsSsize_t(PyObject*); static CYTHON_INLINE PyObject * __Pyx_PyInt_FromSize_t(size_t); #if CYTHON_COMPILING_IN_CPYTHON #define __pyx_PyFloat_AsDouble(x) (PyFloat_CheckExact(x) ? PyFloat_AS_DOUBLE(x) : PyFloat_AsDouble(x)) #else #define __pyx_PyFloat_AsDouble(x) PyFloat_AsDouble(x) #endif #define __pyx_PyFloat_AsFloat(x) ((float) __pyx_PyFloat_AsDouble(x)) #if PY_MAJOR_VERSION < 3 && __PYX_DEFAULT_STRING_ENCODING_IS_ASCII static int __Pyx_sys_getdefaultencoding_not_ascii; static int __Pyx_init_sys_getdefaultencoding_params(void) { PyObject* sys; PyObject* default_encoding = NULL; PyObject* ascii_chars_u = NULL; PyObject* ascii_chars_b = NULL; const char* default_encoding_c; sys = PyImport_ImportModule("sys"); if (!sys) goto bad; default_encoding = PyObject_CallMethod(sys, (char*) "getdefaultencoding", NULL); Py_DECREF(sys); if (!default_encoding) goto bad; default_encoding_c = PyBytes_AsString(default_encoding); if (!default_encoding_c) goto bad; if (strcmp(default_encoding_c, "ascii") == 0) { __Pyx_sys_getdefaultencoding_not_ascii = 0; } else { char ascii_chars[128]; int c; for (c = 0; c < 128; c++) { ascii_chars[c] = c; } __Pyx_sys_getdefaultencoding_not_ascii = 1; ascii_chars_u = PyUnicode_DecodeASCII(ascii_chars, 128, NULL); if (!ascii_chars_u) goto bad; ascii_chars_b = PyUnicode_AsEncodedString(ascii_chars_u, default_encoding_c, NULL); if (!ascii_chars_b || !PyBytes_Check(ascii_chars_b) || memcmp(ascii_chars, PyBytes_AS_STRING(ascii_chars_b), 128) != 0) { PyErr_Format( PyExc_ValueError, "This module compiled with c_string_encoding=ascii, but default encoding '%.200s' is not a superset of ascii.", default_encoding_c); goto bad; } Py_DECREF(ascii_chars_u); Py_DECREF(ascii_chars_b); } Py_DECREF(default_encoding); return 0; bad: Py_XDECREF(default_encoding); Py_XDECREF(ascii_chars_u); Py_XDECREF(ascii_chars_b); return -1; } #endif #if __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT && PY_MAJOR_VERSION >= 3 #define __Pyx_PyUnicode_FromStringAndSize(c_str, size) PyUnicode_DecodeUTF8(c_str, size, NULL) #else #define __Pyx_PyUnicode_FromStringAndSize(c_str, size) PyUnicode_Decode(c_str, size, __PYX_DEFAULT_STRING_ENCODING, NULL) #if __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT static char* __PYX_DEFAULT_STRING_ENCODING; static int __Pyx_init_sys_getdefaultencoding_params(void) { PyObject* sys; PyObject* default_encoding = NULL; char* default_encoding_c; sys = PyImport_ImportModule("sys"); if (!sys) goto bad; default_encoding = PyObject_CallMethod(sys, (char*) (const char*) "getdefaultencoding", NULL); Py_DECREF(sys); if (!default_encoding) goto bad; default_encoding_c = PyBytes_AsString(default_encoding); if (!default_encoding_c) goto bad; __PYX_DEFAULT_STRING_ENCODING = (char*) malloc(strlen(default_encoding_c)); if (!__PYX_DEFAULT_STRING_ENCODING) goto bad; strcpy(__PYX_DEFAULT_STRING_ENCODING, default_encoding_c); Py_DECREF(default_encoding); return 0; bad: Py_XDECREF(default_encoding); return -1; } #endif #endif /* Test for GCC > 2.95 */ #if defined(__GNUC__) && (__GNUC__ > 2 || (__GNUC__ == 2 && (__GNUC_MINOR__ > 95))) #define likely(x) __builtin_expect(!!(x), 1) #define unlikely(x) __builtin_expect(!!(x), 0) #else /* !__GNUC__ or GCC < 2.95 */ #define likely(x) (x) #define unlikely(x) (x) #endif /* __GNUC__ */ static PyObject *__pyx_m; static PyObject *__pyx_d; static PyObject *__pyx_b; static PyObject *__pyx_empty_tuple; static PyObject *__pyx_empty_bytes; static int __pyx_lineno; static int __pyx_clineno = 0; static const char * __pyx_cfilenm= __FILE__; static const char *__pyx_filename; static const char *__pyx_f[] = { "src/pygame_sdl2/mouse.pyx", }; /*--- Type declarations ---*/ /* --- Runtime support code (head) --- */ #ifndef CYTHON_REFNANNY #define CYTHON_REFNANNY 0 #endif #if CYTHON_REFNANNY typedef struct { void (*INCREF)(void*, PyObject*, int); void (*DECREF)(void*, PyObject*, int); void (*GOTREF)(void*, PyObject*, int); void (*GIVEREF)(void*, PyObject*, int); void* (*SetupContext)(const char*, int, const char*); void (*FinishContext)(void**); } __Pyx_RefNannyAPIStruct; static __Pyx_RefNannyAPIStruct *__Pyx_RefNanny = NULL; static __Pyx_RefNannyAPIStruct *__Pyx_RefNannyImportAPI(const char *modname); #define __Pyx_RefNannyDeclarations void *__pyx_refnanny = NULL; #ifdef WITH_THREAD #define __Pyx_RefNannySetupContext(name, acquire_gil)\ if (acquire_gil) {\ PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure();\ __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), __LINE__, __FILE__);\ PyGILState_Release(__pyx_gilstate_save);\ } else {\ __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), __LINE__, __FILE__);\ } #else #define __Pyx_RefNannySetupContext(name, acquire_gil)\ __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), __LINE__, __FILE__) #endif #define __Pyx_RefNannyFinishContext()\ __Pyx_RefNanny->FinishContext(&__pyx_refnanny) #define __Pyx_INCREF(r) __Pyx_RefNanny->INCREF(__pyx_refnanny, (PyObject *)(r), __LINE__) #define __Pyx_DECREF(r) __Pyx_RefNanny->DECREF(__pyx_refnanny, (PyObject *)(r), __LINE__) #define __Pyx_GOTREF(r) __Pyx_RefNanny->GOTREF(__pyx_refnanny, (PyObject *)(r), __LINE__) #define __Pyx_GIVEREF(r) __Pyx_RefNanny->GIVEREF(__pyx_refnanny, (PyObject *)(r), __LINE__) #define __Pyx_XINCREF(r) do { if((r) != NULL) {__Pyx_INCREF(r); }} while(0) #define __Pyx_XDECREF(r) do { if((r) != NULL) {__Pyx_DECREF(r); }} while(0) #define __Pyx_XGOTREF(r) do { if((r) != NULL) {__Pyx_GOTREF(r); }} while(0) #define __Pyx_XGIVEREF(r) do { if((r) != NULL) {__Pyx_GIVEREF(r);}} while(0) #else #define __Pyx_RefNannyDeclarations #define __Pyx_RefNannySetupContext(name, acquire_gil) #define __Pyx_RefNannyFinishContext() #define __Pyx_INCREF(r) Py_INCREF(r) #define __Pyx_DECREF(r) Py_DECREF(r) #define __Pyx_GOTREF(r) #define __Pyx_GIVEREF(r) #define __Pyx_XINCREF(r) Py_XINCREF(r) #define __Pyx_XDECREF(r) Py_XDECREF(r) #define __Pyx_XGOTREF(r) #define __Pyx_XGIVEREF(r) #endif #define __Pyx_XDECREF_SET(r, v) do {\ PyObject *tmp = (PyObject *) r;\ r = v; __Pyx_XDECREF(tmp);\ } while (0) #define __Pyx_DECREF_SET(r, v) do {\ PyObject *tmp = (PyObject *) r;\ r = v; __Pyx_DECREF(tmp);\ } while (0) #define __Pyx_CLEAR(r) do { PyObject* tmp = ((PyObject*)(r)); r = NULL; __Pyx_DECREF(tmp);} while(0) #define __Pyx_XCLEAR(r) do { if((r) != NULL) {PyObject* tmp = ((PyObject*)(r)); r = NULL; __Pyx_DECREF(tmp);}} while(0) static CYTHON_INLINE void __Pyx_RaiseTooManyValuesError(Py_ssize_t expected); static CYTHON_INLINE void __Pyx_RaiseNeedMoreValuesError(Py_ssize_t index); static CYTHON_INLINE int __Pyx_IterFinish(void); static int __Pyx_IternextUnpackEndCheck(PyObject *retval, Py_ssize_t expected); static void __Pyx_RaiseArgtupleInvalid(const char* func_name, int exact, Py_ssize_t num_min, Py_ssize_t num_max, Py_ssize_t num_found); static void __Pyx_RaiseDoubleKeywordsError(const char* func_name, PyObject* kw_name); static int __Pyx_ParseOptionalKeywords(PyObject *kwds, PyObject **argnames[],\ PyObject *kwds2, PyObject *values[], Py_ssize_t num_pos_args,\ const char* function_name); typedef struct { int code_line; PyCodeObject* code_object; } __Pyx_CodeObjectCacheEntry; struct __Pyx_CodeObjectCache { int count; int max_count; __Pyx_CodeObjectCacheEntry* entries; }; static struct __Pyx_CodeObjectCache __pyx_code_cache = {0,0,NULL}; static int __pyx_bisect_code_objects(__Pyx_CodeObjectCacheEntry* entries, int count, int code_line); static PyCodeObject *__pyx_find_code_object(int code_line); static void __pyx_insert_code_object(int code_line, PyCodeObject* code_object); static void __Pyx_AddTraceback(const char *funcname, int c_line, int py_line, const char *filename); static CYTHON_INLINE PyObject* __Pyx_PyInt_From_int(int value); static CYTHON_INLINE int __Pyx_PyInt_As_int(PyObject *); static CYTHON_INLINE PyObject* __Pyx_PyInt_From_long(long value); static CYTHON_INLINE long __Pyx_PyInt_As_long(PyObject *); static int __Pyx_check_binary_version(void); static int __Pyx_InitStrings(__Pyx_StringTabEntry *t); /* Module declarations from 'libc.stdint' */ /* Module declarations from 'libc.string' */ /* Module declarations from 'libc.stdio' */ /* Module declarations from 'libc.stddef' */ /* Module declarations from 'sdl2' */ /* Module declarations from 'pygame_sdl2.mouse' */ #define __Pyx_MODULE_NAME "pygame_sdl2.mouse" int __pyx_module_is_main_pygame_sdl2__mouse = 0; /* Implementation of 'pygame_sdl2.mouse' */ static char __pyx_k_x[] = "x"; static char __pyx_k_y[] = "y"; static char __pyx_k_pos[] = "pos"; static char __pyx_k_init[] = "init"; static char __pyx_k_main[] = "__main__"; static char __pyx_k_quit[] = "quit"; static char __pyx_k_size[] = "size"; static char __pyx_k_test[] = "__test__"; static char __pyx_k_state[] = "state"; static char __pyx_k_get_pos[] = "get_pos"; static char __pyx_k_get_rel[] = "get_rel"; static char __pyx_k_hotspot[] = "hotspot"; static char __pyx_k_set_pos[] = "set_pos"; static char __pyx_k_visible[] = "visible"; static char __pyx_k_andmasks[] = "andmasks"; static char __pyx_k_xormasks[] = "xormasks"; static char __pyx_k_get_cursor[] = "get_cursor"; static char __pyx_k_set_cursor[] = "set_cursor"; static char __pyx_k_get_focused[] = "get_focused"; static char __pyx_k_get_pressed[] = "get_pressed"; static char __pyx_k_set_visible[] = "set_visible"; static char __pyx_k_pygame_sdl2_mouse[] = "pygame_sdl2.mouse"; static char __pyx_k_home_tom_ab_pygame_sdl2_src_pyg[] = "/home/tom/ab/pygame_sdl2/src/pygame_sdl2/mouse.pyx"; static PyObject *__pyx_n_s_andmasks; static PyObject *__pyx_n_s_get_cursor; static PyObject *__pyx_n_s_get_focused; static PyObject *__pyx_n_s_get_pos; static PyObject *__pyx_n_s_get_pressed; static PyObject *__pyx_n_s_get_rel; static PyObject *__pyx_kp_s_home_tom_ab_pygame_sdl2_src_pyg; static PyObject *__pyx_n_s_hotspot; static PyObject *__pyx_n_s_init; static PyObject *__pyx_n_s_main; static PyObject *__pyx_n_s_pos; static PyObject *__pyx_n_s_pygame_sdl2_mouse; static PyObject *__pyx_n_s_quit; static PyObject *__pyx_n_s_set_cursor; static PyObject *__pyx_n_s_set_pos; static PyObject *__pyx_n_s_set_visible; static PyObject *__pyx_n_s_size; static PyObject *__pyx_n_s_state; static PyObject *__pyx_n_s_test; static PyObject *__pyx_n_s_visible; static PyObject *__pyx_n_s_x; static PyObject *__pyx_n_s_xormasks; static PyObject *__pyx_n_s_y; static PyObject *__pyx_pf_11pygame_sdl2_5mouse_init(CYTHON_UNUSED PyObject *__pyx_self); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_5mouse_2quit(CYTHON_UNUSED PyObject *__pyx_self); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_5mouse_4get_pressed(CYTHON_UNUSED PyObject *__pyx_self); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_5mouse_6get_pos(CYTHON_UNUSED PyObject *__pyx_self); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_5mouse_8get_rel(CYTHON_UNUSED PyObject *__pyx_self); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_5mouse_10set_pos(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_pos); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_5mouse_12set_visible(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_visible); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_5mouse_14get_focused(CYTHON_UNUSED PyObject *__pyx_self); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_5mouse_16set_cursor(CYTHON_UNUSED PyObject *__pyx_self, CYTHON_UNUSED PyObject *__pyx_v_size, CYTHON_UNUSED PyObject *__pyx_v_hotspot, CYTHON_UNUSED PyObject *__pyx_v_xormasks, CYTHON_UNUSED PyObject *__pyx_v_andmasks); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_5mouse_18get_cursor(CYTHON_UNUSED PyObject *__pyx_self); /* proto */ static PyObject *__pyx_int_0; static PyObject *__pyx_int_1; static PyObject *__pyx_codeobj_; static PyObject *__pyx_tuple__3; static PyObject *__pyx_tuple__5; static PyObject *__pyx_tuple__7; static PyObject *__pyx_tuple__9; static PyObject *__pyx_tuple__11; static PyObject *__pyx_tuple__14; static PyObject *__pyx_codeobj__2; static PyObject *__pyx_codeobj__4; static PyObject *__pyx_codeobj__6; static PyObject *__pyx_codeobj__8; static PyObject *__pyx_codeobj__10; static PyObject *__pyx_codeobj__12; static PyObject *__pyx_codeobj__13; static PyObject *__pyx_codeobj__15; static PyObject *__pyx_codeobj__16; /* "pygame_sdl2/mouse.pyx":21 * from sdl2 cimport * * * def init(): # <<<<<<<<<<<<<< * pass * */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_5mouse_1init(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused); /*proto*/ static PyMethodDef __pyx_mdef_11pygame_sdl2_5mouse_1init = {"init", (PyCFunction)__pyx_pw_11pygame_sdl2_5mouse_1init, METH_NOARGS, 0}; static PyObject *__pyx_pw_11pygame_sdl2_5mouse_1init(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("init (wrapper)", 0); __pyx_r = __pyx_pf_11pygame_sdl2_5mouse_init(__pyx_self); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_5mouse_init(CYTHON_UNUSED PyObject *__pyx_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("init", 0); /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/mouse.pyx":24 * pass * * def quit(): # <<<<<<<<<<<<<< * pass * */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_5mouse_3quit(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused); /*proto*/ static PyMethodDef __pyx_mdef_11pygame_sdl2_5mouse_3quit = {"quit", (PyCFunction)__pyx_pw_11pygame_sdl2_5mouse_3quit, METH_NOARGS, 0}; static PyObject *__pyx_pw_11pygame_sdl2_5mouse_3quit(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("quit (wrapper)", 0); __pyx_r = __pyx_pf_11pygame_sdl2_5mouse_2quit(__pyx_self); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_5mouse_2quit(CYTHON_UNUSED PyObject *__pyx_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("quit", 0); /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/mouse.pyx":27 * pass * * def get_pressed(): # <<<<<<<<<<<<<< * cdef Uint32 state = SDL_GetMouseState(NULL, NULL) * return (1 if state & SDL_BUTTON_LMASK else 0, */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_5mouse_5get_pressed(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused); /*proto*/ static PyMethodDef __pyx_mdef_11pygame_sdl2_5mouse_5get_pressed = {"get_pressed", (PyCFunction)__pyx_pw_11pygame_sdl2_5mouse_5get_pressed, METH_NOARGS, 0}; static PyObject *__pyx_pw_11pygame_sdl2_5mouse_5get_pressed(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("get_pressed (wrapper)", 0); __pyx_r = __pyx_pf_11pygame_sdl2_5mouse_4get_pressed(__pyx_self); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_5mouse_4get_pressed(CYTHON_UNUSED PyObject *__pyx_self) { Uint32 __pyx_v_state; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("get_pressed", 0); /* "pygame_sdl2/mouse.pyx":28 * * def get_pressed(): * cdef Uint32 state = SDL_GetMouseState(NULL, NULL) # <<<<<<<<<<<<<< * return (1 if state & SDL_BUTTON_LMASK else 0, * 1 if state & SDL_BUTTON_MMASK else 0, */ __pyx_v_state = SDL_GetMouseState(NULL, NULL); /* "pygame_sdl2/mouse.pyx":29 * def get_pressed(): * cdef Uint32 state = SDL_GetMouseState(NULL, NULL) * return (1 if state & SDL_BUTTON_LMASK else 0, # <<<<<<<<<<<<<< * 1 if state & SDL_BUTTON_MMASK else 0, * 1 if state & SDL_BUTTON_RMASK else 0) */ __Pyx_XDECREF(__pyx_r); if (((__pyx_v_state & SDL_BUTTON_LMASK) != 0)) { __Pyx_INCREF(__pyx_int_1); __pyx_t_1 = __pyx_int_1; } else { __Pyx_INCREF(__pyx_int_0); __pyx_t_1 = __pyx_int_0; } /* "pygame_sdl2/mouse.pyx":30 * cdef Uint32 state = SDL_GetMouseState(NULL, NULL) * return (1 if state & SDL_BUTTON_LMASK else 0, * 1 if state & SDL_BUTTON_MMASK else 0, # <<<<<<<<<<<<<< * 1 if state & SDL_BUTTON_RMASK else 0) * */ if (((__pyx_v_state & SDL_BUTTON_MMASK) != 0)) { __Pyx_INCREF(__pyx_int_1); __pyx_t_2 = __pyx_int_1; } else { __Pyx_INCREF(__pyx_int_0); __pyx_t_2 = __pyx_int_0; } /* "pygame_sdl2/mouse.pyx":31 * return (1 if state & SDL_BUTTON_LMASK else 0, * 1 if state & SDL_BUTTON_MMASK else 0, * 1 if state & SDL_BUTTON_RMASK else 0) # <<<<<<<<<<<<<< * * def get_pos(): */ if (((__pyx_v_state & SDL_BUTTON_RMASK) != 0)) { __Pyx_INCREF(__pyx_int_1); __pyx_t_3 = __pyx_int_1; } else { __Pyx_INCREF(__pyx_int_0); __pyx_t_3 = __pyx_int_0; } /* "pygame_sdl2/mouse.pyx":29 * def get_pressed(): * cdef Uint32 state = SDL_GetMouseState(NULL, NULL) * return (1 if state & SDL_BUTTON_LMASK else 0, # <<<<<<<<<<<<<< * 1 if state & SDL_BUTTON_MMASK else 0, * 1 if state & SDL_BUTTON_RMASK else 0) */ __pyx_t_4 = PyTuple_New(3); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 29; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); __Pyx_GIVEREF(__pyx_t_1); PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_1); __Pyx_GIVEREF(__pyx_t_2); PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_2); __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_4, 2, __pyx_t_3); __pyx_t_1 = 0; __pyx_t_2 = 0; __pyx_t_3 = 0; __pyx_r = __pyx_t_4; __pyx_t_4 = 0; goto __pyx_L0; /* "pygame_sdl2/mouse.pyx":27 * pass * * def get_pressed(): # <<<<<<<<<<<<<< * cdef Uint32 state = SDL_GetMouseState(NULL, NULL) * return (1 if state & SDL_BUTTON_LMASK else 0, */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_AddTraceback("pygame_sdl2.mouse.get_pressed", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/mouse.pyx":33 * 1 if state & SDL_BUTTON_RMASK else 0) * * def get_pos(): # <<<<<<<<<<<<<< * cdef int x, y * SDL_GetMouseState(&x, &y) */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_5mouse_7get_pos(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused); /*proto*/ static PyMethodDef __pyx_mdef_11pygame_sdl2_5mouse_7get_pos = {"get_pos", (PyCFunction)__pyx_pw_11pygame_sdl2_5mouse_7get_pos, METH_NOARGS, 0}; static PyObject *__pyx_pw_11pygame_sdl2_5mouse_7get_pos(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("get_pos (wrapper)", 0); __pyx_r = __pyx_pf_11pygame_sdl2_5mouse_6get_pos(__pyx_self); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_5mouse_6get_pos(CYTHON_UNUSED PyObject *__pyx_self) { int __pyx_v_x; int __pyx_v_y; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("get_pos", 0); /* "pygame_sdl2/mouse.pyx":35 * def get_pos(): * cdef int x, y * SDL_GetMouseState(&x, &y) # <<<<<<<<<<<<<< * return (x, y) * */ SDL_GetMouseState((&__pyx_v_x), (&__pyx_v_y)); /* "pygame_sdl2/mouse.pyx":36 * cdef int x, y * SDL_GetMouseState(&x, &y) * return (x, y) # <<<<<<<<<<<<<< * * def get_rel(): */ __Pyx_XDECREF(__pyx_r); __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_x); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 36; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_v_y); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 36; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 36; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __Pyx_GIVEREF(__pyx_t_1); PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_1); __Pyx_GIVEREF(__pyx_t_2); PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_2); __pyx_t_1 = 0; __pyx_t_2 = 0; __pyx_r = __pyx_t_3; __pyx_t_3 = 0; goto __pyx_L0; /* "pygame_sdl2/mouse.pyx":33 * 1 if state & SDL_BUTTON_RMASK else 0) * * def get_pos(): # <<<<<<<<<<<<<< * cdef int x, y * SDL_GetMouseState(&x, &y) */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("pygame_sdl2.mouse.get_pos", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/mouse.pyx":38 * return (x, y) * * def get_rel(): # <<<<<<<<<<<<<< * cdef int x,y * SDL_GetRelativeMouseState(&x, &y) */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_5mouse_9get_rel(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused); /*proto*/ static PyMethodDef __pyx_mdef_11pygame_sdl2_5mouse_9get_rel = {"get_rel", (PyCFunction)__pyx_pw_11pygame_sdl2_5mouse_9get_rel, METH_NOARGS, 0}; static PyObject *__pyx_pw_11pygame_sdl2_5mouse_9get_rel(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("get_rel (wrapper)", 0); __pyx_r = __pyx_pf_11pygame_sdl2_5mouse_8get_rel(__pyx_self); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_5mouse_8get_rel(CYTHON_UNUSED PyObject *__pyx_self) { int __pyx_v_x; int __pyx_v_y; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("get_rel", 0); /* "pygame_sdl2/mouse.pyx":40 * def get_rel(): * cdef int x,y * SDL_GetRelativeMouseState(&x, &y) # <<<<<<<<<<<<<< * return (x, y) * */ SDL_GetRelativeMouseState((&__pyx_v_x), (&__pyx_v_y)); /* "pygame_sdl2/mouse.pyx":41 * cdef int x,y * SDL_GetRelativeMouseState(&x, &y) * return (x, y) # <<<<<<<<<<<<<< * * def set_pos(pos): */ __Pyx_XDECREF(__pyx_r); __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_x); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 41; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_v_y); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 41; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 41; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __Pyx_GIVEREF(__pyx_t_1); PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_1); __Pyx_GIVEREF(__pyx_t_2); PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_2); __pyx_t_1 = 0; __pyx_t_2 = 0; __pyx_r = __pyx_t_3; __pyx_t_3 = 0; goto __pyx_L0; /* "pygame_sdl2/mouse.pyx":38 * return (x, y) * * def get_rel(): # <<<<<<<<<<<<<< * cdef int x,y * SDL_GetRelativeMouseState(&x, &y) */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("pygame_sdl2.mouse.get_rel", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/mouse.pyx":43 * return (x, y) * * def set_pos(pos): # <<<<<<<<<<<<<< * (x, y) = pos * SDL_WarpMouseInWindow(NULL, x, y) */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_5mouse_11set_pos(PyObject *__pyx_self, PyObject *__pyx_v_pos); /*proto*/ static PyMethodDef __pyx_mdef_11pygame_sdl2_5mouse_11set_pos = {"set_pos", (PyCFunction)__pyx_pw_11pygame_sdl2_5mouse_11set_pos, METH_O, 0}; static PyObject *__pyx_pw_11pygame_sdl2_5mouse_11set_pos(PyObject *__pyx_self, PyObject *__pyx_v_pos) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("set_pos (wrapper)", 0); __pyx_r = __pyx_pf_11pygame_sdl2_5mouse_10set_pos(__pyx_self, ((PyObject *)__pyx_v_pos)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_5mouse_10set_pos(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_pos) { PyObject *__pyx_v_x = NULL; PyObject *__pyx_v_y = NULL; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; PyObject *(*__pyx_t_4)(PyObject *); int __pyx_t_5; int __pyx_t_6; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("set_pos", 0); /* "pygame_sdl2/mouse.pyx":44 * * def set_pos(pos): * (x, y) = pos # <<<<<<<<<<<<<< * SDL_WarpMouseInWindow(NULL, x, y) * */ if ((likely(PyTuple_CheckExact(__pyx_v_pos))) || (PyList_CheckExact(__pyx_v_pos))) { PyObject* sequence = __pyx_v_pos; #if CYTHON_COMPILING_IN_CPYTHON Py_ssize_t size = Py_SIZE(sequence); #else Py_ssize_t size = PySequence_Size(sequence); #endif if (unlikely(size != 2)) { if (size > 2) __Pyx_RaiseTooManyValuesError(2); else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 44; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } #if CYTHON_COMPILING_IN_CPYTHON if (likely(PyTuple_CheckExact(sequence))) { __pyx_t_1 = PyTuple_GET_ITEM(sequence, 0); __pyx_t_2 = PyTuple_GET_ITEM(sequence, 1); } else { __pyx_t_1 = PyList_GET_ITEM(sequence, 0); __pyx_t_2 = PyList_GET_ITEM(sequence, 1); } __Pyx_INCREF(__pyx_t_1); __Pyx_INCREF(__pyx_t_2); #else __pyx_t_1 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 44; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 44; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); #endif } else { Py_ssize_t index = -1; __pyx_t_3 = PyObject_GetIter(__pyx_v_pos); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 44; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = Py_TYPE(__pyx_t_3)->tp_iternext; index = 0; __pyx_t_1 = __pyx_t_4(__pyx_t_3); if (unlikely(!__pyx_t_1)) goto __pyx_L3_unpacking_failed; __Pyx_GOTREF(__pyx_t_1); index = 1; __pyx_t_2 = __pyx_t_4(__pyx_t_3); if (unlikely(!__pyx_t_2)) goto __pyx_L3_unpacking_failed; __Pyx_GOTREF(__pyx_t_2); if (__Pyx_IternextUnpackEndCheck(__pyx_t_4(__pyx_t_3), 2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 44; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_t_4 = NULL; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; goto __pyx_L4_unpacking_done; __pyx_L3_unpacking_failed:; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_4 = NULL; if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 44; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_L4_unpacking_done:; } __pyx_v_x = __pyx_t_1; __pyx_t_1 = 0; __pyx_v_y = __pyx_t_2; __pyx_t_2 = 0; /* "pygame_sdl2/mouse.pyx":45 * def set_pos(pos): * (x, y) = pos * SDL_WarpMouseInWindow(NULL, x, y) # <<<<<<<<<<<<<< * * def set_visible(visible): */ __pyx_t_5 = __Pyx_PyInt_As_int(__pyx_v_x); if (unlikely((__pyx_t_5 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 45; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_t_6 = __Pyx_PyInt_As_int(__pyx_v_y); if (unlikely((__pyx_t_6 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 45; __pyx_clineno = __LINE__; goto __pyx_L1_error;} SDL_WarpMouseInWindow(NULL, __pyx_t_5, __pyx_t_6); /* "pygame_sdl2/mouse.pyx":43 * return (x, y) * * def set_pos(pos): # <<<<<<<<<<<<<< * (x, y) = pos * SDL_WarpMouseInWindow(NULL, x, y) */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("pygame_sdl2.mouse.set_pos", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF(__pyx_v_x); __Pyx_XDECREF(__pyx_v_y); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/mouse.pyx":47 * SDL_WarpMouseInWindow(NULL, x, y) * * def set_visible(visible): # <<<<<<<<<<<<<< * SDL_ShowCursor(1 if visible else 0) * */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_5mouse_13set_visible(PyObject *__pyx_self, PyObject *__pyx_v_visible); /*proto*/ static PyMethodDef __pyx_mdef_11pygame_sdl2_5mouse_13set_visible = {"set_visible", (PyCFunction)__pyx_pw_11pygame_sdl2_5mouse_13set_visible, METH_O, 0}; static PyObject *__pyx_pw_11pygame_sdl2_5mouse_13set_visible(PyObject *__pyx_self, PyObject *__pyx_v_visible) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("set_visible (wrapper)", 0); __pyx_r = __pyx_pf_11pygame_sdl2_5mouse_12set_visible(__pyx_self, ((PyObject *)__pyx_v_visible)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_5mouse_12set_visible(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_visible) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; int __pyx_t_2; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("set_visible", 0); /* "pygame_sdl2/mouse.pyx":48 * * def set_visible(visible): * SDL_ShowCursor(1 if visible else 0) # <<<<<<<<<<<<<< * * def get_focused(): */ __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_v_visible); if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 48; __pyx_clineno = __LINE__; goto __pyx_L1_error;} if (__pyx_t_2) { __pyx_t_1 = 1; } else { __pyx_t_1 = 0; } SDL_ShowCursor(__pyx_t_1); /* "pygame_sdl2/mouse.pyx":47 * SDL_WarpMouseInWindow(NULL, x, y) * * def set_visible(visible): # <<<<<<<<<<<<<< * SDL_ShowCursor(1 if visible else 0) * */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("pygame_sdl2.mouse.set_visible", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/mouse.pyx":50 * SDL_ShowCursor(1 if visible else 0) * * def get_focused(): # <<<<<<<<<<<<<< * return SDL_GetMouseFocus() != NULL * */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_5mouse_15get_focused(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused); /*proto*/ static PyMethodDef __pyx_mdef_11pygame_sdl2_5mouse_15get_focused = {"get_focused", (PyCFunction)__pyx_pw_11pygame_sdl2_5mouse_15get_focused, METH_NOARGS, 0}; static PyObject *__pyx_pw_11pygame_sdl2_5mouse_15get_focused(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("get_focused (wrapper)", 0); __pyx_r = __pyx_pf_11pygame_sdl2_5mouse_14get_focused(__pyx_self); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_5mouse_14get_focused(CYTHON_UNUSED PyObject *__pyx_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("get_focused", 0); /* "pygame_sdl2/mouse.pyx":51 * * def get_focused(): * return SDL_GetMouseFocus() != NULL # <<<<<<<<<<<<<< * * def set_cursor(size, hotspot, xormasks, andmasks): */ __Pyx_XDECREF(__pyx_r); __pyx_t_1 = __Pyx_PyBool_FromLong((SDL_GetMouseFocus() != NULL)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 51; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "pygame_sdl2/mouse.pyx":50 * SDL_ShowCursor(1 if visible else 0) * * def get_focused(): # <<<<<<<<<<<<<< * return SDL_GetMouseFocus() != NULL * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("pygame_sdl2.mouse.get_focused", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/mouse.pyx":53 * return SDL_GetMouseFocus() != NULL * * def set_cursor(size, hotspot, xormasks, andmasks): # <<<<<<<<<<<<<< * # Does anyone use this? SDL2 has much improved custom cursor support. * pass */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_5mouse_17set_cursor(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static PyMethodDef __pyx_mdef_11pygame_sdl2_5mouse_17set_cursor = {"set_cursor", (PyCFunction)__pyx_pw_11pygame_sdl2_5mouse_17set_cursor, METH_VARARGS|METH_KEYWORDS, 0}; static PyObject *__pyx_pw_11pygame_sdl2_5mouse_17set_cursor(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { CYTHON_UNUSED PyObject *__pyx_v_size = 0; CYTHON_UNUSED PyObject *__pyx_v_hotspot = 0; CYTHON_UNUSED PyObject *__pyx_v_xormasks = 0; CYTHON_UNUSED PyObject *__pyx_v_andmasks = 0; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("set_cursor (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_size,&__pyx_n_s_hotspot,&__pyx_n_s_xormasks,&__pyx_n_s_andmasks,0}; PyObject* values[4] = {0,0,0,0}; if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_size)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; case 1: if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_hotspot)) != 0)) kw_args--; else { __Pyx_RaiseArgtupleInvalid("set_cursor", 1, 4, 4, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 53; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } case 2: if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_xormasks)) != 0)) kw_args--; else { __Pyx_RaiseArgtupleInvalid("set_cursor", 1, 4, 4, 2); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 53; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } case 3: if (likely((values[3] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_andmasks)) != 0)) kw_args--; else { __Pyx_RaiseArgtupleInvalid("set_cursor", 1, 4, 4, 3); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 53; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "set_cursor") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 53; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } } else if (PyTuple_GET_SIZE(__pyx_args) != 4) { goto __pyx_L5_argtuple_error; } else { values[0] = PyTuple_GET_ITEM(__pyx_args, 0); values[1] = PyTuple_GET_ITEM(__pyx_args, 1); values[2] = PyTuple_GET_ITEM(__pyx_args, 2); values[3] = PyTuple_GET_ITEM(__pyx_args, 3); } __pyx_v_size = values[0]; __pyx_v_hotspot = values[1]; __pyx_v_xormasks = values[2]; __pyx_v_andmasks = values[3]; } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("set_cursor", 1, 4, 4, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 53; __pyx_clineno = __LINE__; goto __pyx_L3_error;} __pyx_L3_error:; __Pyx_AddTraceback("pygame_sdl2.mouse.set_cursor", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_11pygame_sdl2_5mouse_16set_cursor(__pyx_self, __pyx_v_size, __pyx_v_hotspot, __pyx_v_xormasks, __pyx_v_andmasks); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_5mouse_16set_cursor(CYTHON_UNUSED PyObject *__pyx_self, CYTHON_UNUSED PyObject *__pyx_v_size, CYTHON_UNUSED PyObject *__pyx_v_hotspot, CYTHON_UNUSED PyObject *__pyx_v_xormasks, CYTHON_UNUSED PyObject *__pyx_v_andmasks) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("set_cursor", 0); /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/mouse.pyx":57 * pass * * def get_cursor(): # <<<<<<<<<<<<<< * return None */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_5mouse_19get_cursor(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused); /*proto*/ static PyMethodDef __pyx_mdef_11pygame_sdl2_5mouse_19get_cursor = {"get_cursor", (PyCFunction)__pyx_pw_11pygame_sdl2_5mouse_19get_cursor, METH_NOARGS, 0}; static PyObject *__pyx_pw_11pygame_sdl2_5mouse_19get_cursor(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("get_cursor (wrapper)", 0); __pyx_r = __pyx_pf_11pygame_sdl2_5mouse_18get_cursor(__pyx_self); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_5mouse_18get_cursor(CYTHON_UNUSED PyObject *__pyx_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("get_cursor", 0); /* "pygame_sdl2/mouse.pyx":58 * * def get_cursor(): * return None # <<<<<<<<<<<<<< */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(Py_None); __pyx_r = Py_None; goto __pyx_L0; /* "pygame_sdl2/mouse.pyx":57 * pass * * def get_cursor(): # <<<<<<<<<<<<<< * return None */ /* function exit code */ __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyMethodDef __pyx_methods[] = { {0, 0, 0, 0} }; #if PY_MAJOR_VERSION >= 3 static struct PyModuleDef __pyx_moduledef = { #if PY_VERSION_HEX < 0x03020000 { PyObject_HEAD_INIT(NULL) NULL, 0, NULL }, #else PyModuleDef_HEAD_INIT, #endif "mouse", 0, /* m_doc */ -1, /* m_size */ __pyx_methods /* m_methods */, NULL, /* m_reload */ NULL, /* m_traverse */ NULL, /* m_clear */ NULL /* m_free */ }; #endif static __Pyx_StringTabEntry __pyx_string_tab[] = { {&__pyx_n_s_andmasks, __pyx_k_andmasks, sizeof(__pyx_k_andmasks), 0, 0, 1, 1}, {&__pyx_n_s_get_cursor, __pyx_k_get_cursor, sizeof(__pyx_k_get_cursor), 0, 0, 1, 1}, {&__pyx_n_s_get_focused, __pyx_k_get_focused, sizeof(__pyx_k_get_focused), 0, 0, 1, 1}, {&__pyx_n_s_get_pos, __pyx_k_get_pos, sizeof(__pyx_k_get_pos), 0, 0, 1, 1}, {&__pyx_n_s_get_pressed, __pyx_k_get_pressed, sizeof(__pyx_k_get_pressed), 0, 0, 1, 1}, {&__pyx_n_s_get_rel, __pyx_k_get_rel, sizeof(__pyx_k_get_rel), 0, 0, 1, 1}, {&__pyx_kp_s_home_tom_ab_pygame_sdl2_src_pyg, __pyx_k_home_tom_ab_pygame_sdl2_src_pyg, sizeof(__pyx_k_home_tom_ab_pygame_sdl2_src_pyg), 0, 0, 1, 0}, {&__pyx_n_s_hotspot, __pyx_k_hotspot, sizeof(__pyx_k_hotspot), 0, 0, 1, 1}, {&__pyx_n_s_init, __pyx_k_init, sizeof(__pyx_k_init), 0, 0, 1, 1}, {&__pyx_n_s_main, __pyx_k_main, sizeof(__pyx_k_main), 0, 0, 1, 1}, {&__pyx_n_s_pos, __pyx_k_pos, sizeof(__pyx_k_pos), 0, 0, 1, 1}, {&__pyx_n_s_pygame_sdl2_mouse, __pyx_k_pygame_sdl2_mouse, sizeof(__pyx_k_pygame_sdl2_mouse), 0, 0, 1, 1}, {&__pyx_n_s_quit, __pyx_k_quit, sizeof(__pyx_k_quit), 0, 0, 1, 1}, {&__pyx_n_s_set_cursor, __pyx_k_set_cursor, sizeof(__pyx_k_set_cursor), 0, 0, 1, 1}, {&__pyx_n_s_set_pos, __pyx_k_set_pos, sizeof(__pyx_k_set_pos), 0, 0, 1, 1}, {&__pyx_n_s_set_visible, __pyx_k_set_visible, sizeof(__pyx_k_set_visible), 0, 0, 1, 1}, {&__pyx_n_s_size, __pyx_k_size, sizeof(__pyx_k_size), 0, 0, 1, 1}, {&__pyx_n_s_state, __pyx_k_state, sizeof(__pyx_k_state), 0, 0, 1, 1}, {&__pyx_n_s_test, __pyx_k_test, sizeof(__pyx_k_test), 0, 0, 1, 1}, {&__pyx_n_s_visible, __pyx_k_visible, sizeof(__pyx_k_visible), 0, 0, 1, 1}, {&__pyx_n_s_x, __pyx_k_x, sizeof(__pyx_k_x), 0, 0, 1, 1}, {&__pyx_n_s_xormasks, __pyx_k_xormasks, sizeof(__pyx_k_xormasks), 0, 0, 1, 1}, {&__pyx_n_s_y, __pyx_k_y, sizeof(__pyx_k_y), 0, 0, 1, 1}, {0, 0, 0, 0, 0, 0, 0} }; static int __Pyx_InitCachedBuiltins(void) { return 0; } static int __Pyx_InitCachedConstants(void) { __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__Pyx_InitCachedConstants", 0); /* "pygame_sdl2/mouse.pyx":21 * from sdl2 cimport * * * def init(): # <<<<<<<<<<<<<< * pass * */ __pyx_codeobj_ = (PyObject*)__Pyx_PyCode_New(0, 0, 0, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_tom_ab_pygame_sdl2_src_pyg, __pyx_n_s_init, 21, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj_)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 21; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "pygame_sdl2/mouse.pyx":24 * pass * * def quit(): # <<<<<<<<<<<<<< * pass * */ __pyx_codeobj__2 = (PyObject*)__Pyx_PyCode_New(0, 0, 0, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_tom_ab_pygame_sdl2_src_pyg, __pyx_n_s_quit, 24, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 24; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "pygame_sdl2/mouse.pyx":27 * pass * * def get_pressed(): # <<<<<<<<<<<<<< * cdef Uint32 state = SDL_GetMouseState(NULL, NULL) * return (1 if state & SDL_BUTTON_LMASK else 0, */ __pyx_tuple__3 = PyTuple_Pack(1, __pyx_n_s_state); if (unlikely(!__pyx_tuple__3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 27; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_tuple__3); __Pyx_GIVEREF(__pyx_tuple__3); __pyx_codeobj__4 = (PyObject*)__Pyx_PyCode_New(0, 0, 1, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__3, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_tom_ab_pygame_sdl2_src_pyg, __pyx_n_s_get_pressed, 27, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 27; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "pygame_sdl2/mouse.pyx":33 * 1 if state & SDL_BUTTON_RMASK else 0) * * def get_pos(): # <<<<<<<<<<<<<< * cdef int x, y * SDL_GetMouseState(&x, &y) */ __pyx_tuple__5 = PyTuple_Pack(2, __pyx_n_s_x, __pyx_n_s_y); if (unlikely(!__pyx_tuple__5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 33; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_tuple__5); __Pyx_GIVEREF(__pyx_tuple__5); __pyx_codeobj__6 = (PyObject*)__Pyx_PyCode_New(0, 0, 2, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__5, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_tom_ab_pygame_sdl2_src_pyg, __pyx_n_s_get_pos, 33, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 33; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "pygame_sdl2/mouse.pyx":38 * return (x, y) * * def get_rel(): # <<<<<<<<<<<<<< * cdef int x,y * SDL_GetRelativeMouseState(&x, &y) */ __pyx_tuple__7 = PyTuple_Pack(2, __pyx_n_s_x, __pyx_n_s_y); if (unlikely(!__pyx_tuple__7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 38; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_tuple__7); __Pyx_GIVEREF(__pyx_tuple__7); __pyx_codeobj__8 = (PyObject*)__Pyx_PyCode_New(0, 0, 2, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__7, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_tom_ab_pygame_sdl2_src_pyg, __pyx_n_s_get_rel, 38, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 38; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "pygame_sdl2/mouse.pyx":43 * return (x, y) * * def set_pos(pos): # <<<<<<<<<<<<<< * (x, y) = pos * SDL_WarpMouseInWindow(NULL, x, y) */ __pyx_tuple__9 = PyTuple_Pack(3, __pyx_n_s_pos, __pyx_n_s_x, __pyx_n_s_y); if (unlikely(!__pyx_tuple__9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 43; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_tuple__9); __Pyx_GIVEREF(__pyx_tuple__9); __pyx_codeobj__10 = (PyObject*)__Pyx_PyCode_New(1, 0, 3, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__9, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_tom_ab_pygame_sdl2_src_pyg, __pyx_n_s_set_pos, 43, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 43; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "pygame_sdl2/mouse.pyx":47 * SDL_WarpMouseInWindow(NULL, x, y) * * def set_visible(visible): # <<<<<<<<<<<<<< * SDL_ShowCursor(1 if visible else 0) * */ __pyx_tuple__11 = PyTuple_Pack(1, __pyx_n_s_visible); if (unlikely(!__pyx_tuple__11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 47; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_tuple__11); __Pyx_GIVEREF(__pyx_tuple__11); __pyx_codeobj__12 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__11, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_tom_ab_pygame_sdl2_src_pyg, __pyx_n_s_set_visible, 47, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__12)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 47; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "pygame_sdl2/mouse.pyx":50 * SDL_ShowCursor(1 if visible else 0) * * def get_focused(): # <<<<<<<<<<<<<< * return SDL_GetMouseFocus() != NULL * */ __pyx_codeobj__13 = (PyObject*)__Pyx_PyCode_New(0, 0, 0, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_tom_ab_pygame_sdl2_src_pyg, __pyx_n_s_get_focused, 50, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__13)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 50; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "pygame_sdl2/mouse.pyx":53 * return SDL_GetMouseFocus() != NULL * * def set_cursor(size, hotspot, xormasks, andmasks): # <<<<<<<<<<<<<< * # Does anyone use this? SDL2 has much improved custom cursor support. * pass */ __pyx_tuple__14 = PyTuple_Pack(4, __pyx_n_s_size, __pyx_n_s_hotspot, __pyx_n_s_xormasks, __pyx_n_s_andmasks); if (unlikely(!__pyx_tuple__14)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 53; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_tuple__14); __Pyx_GIVEREF(__pyx_tuple__14); __pyx_codeobj__15 = (PyObject*)__Pyx_PyCode_New(4, 0, 4, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__14, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_tom_ab_pygame_sdl2_src_pyg, __pyx_n_s_set_cursor, 53, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__15)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 53; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "pygame_sdl2/mouse.pyx":57 * pass * * def get_cursor(): # <<<<<<<<<<<<<< * return None */ __pyx_codeobj__16 = (PyObject*)__Pyx_PyCode_New(0, 0, 0, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_tom_ab_pygame_sdl2_src_pyg, __pyx_n_s_get_cursor, 57, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__16)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 57; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_RefNannyFinishContext(); return 0; __pyx_L1_error:; __Pyx_RefNannyFinishContext(); return -1; } static int __Pyx_InitGlobals(void) { if (__Pyx_InitStrings(__pyx_string_tab) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; __pyx_int_0 = PyInt_FromLong(0); if (unlikely(!__pyx_int_0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_int_1 = PyInt_FromLong(1); if (unlikely(!__pyx_int_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} return 0; __pyx_L1_error:; return -1; } #if PY_MAJOR_VERSION < 3 PyMODINIT_FUNC initmouse(void); /*proto*/ PyMODINIT_FUNC initmouse(void) #else PyMODINIT_FUNC PyInit_mouse(void); /*proto*/ PyMODINIT_FUNC PyInit_mouse(void) #endif { PyObject *__pyx_t_1 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannyDeclarations #if CYTHON_REFNANNY __Pyx_RefNanny = __Pyx_RefNannyImportAPI("refnanny"); if (!__Pyx_RefNanny) { PyErr_Clear(); __Pyx_RefNanny = __Pyx_RefNannyImportAPI("Cython.Runtime.refnanny"); if (!__Pyx_RefNanny) Py_FatalError("failed to import 'refnanny' module"); } #endif __Pyx_RefNannySetupContext("PyMODINIT_FUNC PyInit_mouse(void)", 0); if (__Pyx_check_binary_version() < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_empty_tuple = PyTuple_New(0); if (unlikely(!__pyx_empty_tuple)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_empty_bytes = PyBytes_FromStringAndSize("", 0); if (unlikely(!__pyx_empty_bytes)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} #ifdef __Pyx_CyFunction_USED if (__pyx_CyFunction_init() < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} #endif #ifdef __Pyx_FusedFunction_USED if (__pyx_FusedFunction_init() < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} #endif #ifdef __Pyx_Coroutine_USED if (__pyx_Coroutine_init() < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} #endif #ifdef __Pyx_Generator_USED if (__pyx_Generator_init() < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} #endif #ifdef __Pyx_StopAsyncIteration_USED if (__pyx_StopAsyncIteration_init() < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} #endif /*--- Library function declarations ---*/ /*--- Threads initialization code ---*/ #if defined(__PYX_FORCE_INIT_THREADS) && __PYX_FORCE_INIT_THREADS #ifdef WITH_THREAD /* Python build with threading support? */ PyEval_InitThreads(); #endif #endif /*--- Module creation code ---*/ #if PY_MAJOR_VERSION < 3 __pyx_m = Py_InitModule4("mouse", __pyx_methods, 0, 0, PYTHON_API_VERSION); Py_XINCREF(__pyx_m); #else __pyx_m = PyModule_Create(&__pyx_moduledef); #endif if (unlikely(!__pyx_m)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_d = PyModule_GetDict(__pyx_m); if (unlikely(!__pyx_d)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} Py_INCREF(__pyx_d); __pyx_b = PyImport_AddModule(__Pyx_BUILTIN_MODULE_NAME); if (unlikely(!__pyx_b)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} #if CYTHON_COMPILING_IN_PYPY Py_INCREF(__pyx_b); #endif if (PyObject_SetAttrString(__pyx_m, "__builtins__", __pyx_b) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; /*--- Initialize various global constants etc. ---*/ if (__Pyx_InitGlobals() < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} #if PY_MAJOR_VERSION < 3 && (__PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT) if (__Pyx_init_sys_getdefaultencoding_params() < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} #endif if (__pyx_module_is_main_pygame_sdl2__mouse) { if (PyObject_SetAttrString(__pyx_m, "__name__", __pyx_n_s_main) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } #if PY_MAJOR_VERSION >= 3 { PyObject *modules = PyImport_GetModuleDict(); if (unlikely(!modules)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} if (!PyDict_GetItemString(modules, "pygame_sdl2.mouse")) { if (unlikely(PyDict_SetItemString(modules, "pygame_sdl2.mouse", __pyx_m) < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } } #endif /*--- Builtin init code ---*/ if (__Pyx_InitCachedBuiltins() < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /*--- Constants init code ---*/ if (__Pyx_InitCachedConstants() < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /*--- Global init code ---*/ /*--- Variable export code ---*/ /*--- Function export code ---*/ /*--- Type init code ---*/ /*--- Type import code ---*/ /*--- Variable import code ---*/ /*--- Function import code ---*/ /*--- Execution code ---*/ #if defined(__Pyx_Generator_USED) || defined(__Pyx_Coroutine_USED) if (__Pyx_patch_abc() < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} #endif /* "pygame_sdl2/mouse.pyx":21 * from sdl2 cimport * * * def init(): # <<<<<<<<<<<<<< * pass * */ __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_11pygame_sdl2_5mouse_1init, NULL, __pyx_n_s_pygame_sdl2_mouse); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 21; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); if (PyDict_SetItem(__pyx_d, __pyx_n_s_init, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 21; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "pygame_sdl2/mouse.pyx":24 * pass * * def quit(): # <<<<<<<<<<<<<< * pass * */ __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_11pygame_sdl2_5mouse_3quit, NULL, __pyx_n_s_pygame_sdl2_mouse); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 24; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); if (PyDict_SetItem(__pyx_d, __pyx_n_s_quit, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 24; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "pygame_sdl2/mouse.pyx":27 * pass * * def get_pressed(): # <<<<<<<<<<<<<< * cdef Uint32 state = SDL_GetMouseState(NULL, NULL) * return (1 if state & SDL_BUTTON_LMASK else 0, */ __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_11pygame_sdl2_5mouse_5get_pressed, NULL, __pyx_n_s_pygame_sdl2_mouse); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 27; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); if (PyDict_SetItem(__pyx_d, __pyx_n_s_get_pressed, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 27; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "pygame_sdl2/mouse.pyx":33 * 1 if state & SDL_BUTTON_RMASK else 0) * * def get_pos(): # <<<<<<<<<<<<<< * cdef int x, y * SDL_GetMouseState(&x, &y) */ __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_11pygame_sdl2_5mouse_7get_pos, NULL, __pyx_n_s_pygame_sdl2_mouse); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 33; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); if (PyDict_SetItem(__pyx_d, __pyx_n_s_get_pos, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 33; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "pygame_sdl2/mouse.pyx":38 * return (x, y) * * def get_rel(): # <<<<<<<<<<<<<< * cdef int x,y * SDL_GetRelativeMouseState(&x, &y) */ __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_11pygame_sdl2_5mouse_9get_rel, NULL, __pyx_n_s_pygame_sdl2_mouse); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 38; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); if (PyDict_SetItem(__pyx_d, __pyx_n_s_get_rel, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 38; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "pygame_sdl2/mouse.pyx":43 * return (x, y) * * def set_pos(pos): # <<<<<<<<<<<<<< * (x, y) = pos * SDL_WarpMouseInWindow(NULL, x, y) */ __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_11pygame_sdl2_5mouse_11set_pos, NULL, __pyx_n_s_pygame_sdl2_mouse); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 43; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); if (PyDict_SetItem(__pyx_d, __pyx_n_s_set_pos, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 43; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "pygame_sdl2/mouse.pyx":47 * SDL_WarpMouseInWindow(NULL, x, y) * * def set_visible(visible): # <<<<<<<<<<<<<< * SDL_ShowCursor(1 if visible else 0) * */ __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_11pygame_sdl2_5mouse_13set_visible, NULL, __pyx_n_s_pygame_sdl2_mouse); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 47; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); if (PyDict_SetItem(__pyx_d, __pyx_n_s_set_visible, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 47; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "pygame_sdl2/mouse.pyx":50 * SDL_ShowCursor(1 if visible else 0) * * def get_focused(): # <<<<<<<<<<<<<< * return SDL_GetMouseFocus() != NULL * */ __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_11pygame_sdl2_5mouse_15get_focused, NULL, __pyx_n_s_pygame_sdl2_mouse); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 50; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); if (PyDict_SetItem(__pyx_d, __pyx_n_s_get_focused, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 50; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "pygame_sdl2/mouse.pyx":53 * return SDL_GetMouseFocus() != NULL * * def set_cursor(size, hotspot, xormasks, andmasks): # <<<<<<<<<<<<<< * # Does anyone use this? SDL2 has much improved custom cursor support. * pass */ __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_11pygame_sdl2_5mouse_17set_cursor, NULL, __pyx_n_s_pygame_sdl2_mouse); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 53; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); if (PyDict_SetItem(__pyx_d, __pyx_n_s_set_cursor, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 53; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "pygame_sdl2/mouse.pyx":57 * pass * * def get_cursor(): # <<<<<<<<<<<<<< * return None */ __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_11pygame_sdl2_5mouse_19get_cursor, NULL, __pyx_n_s_pygame_sdl2_mouse); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 57; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); if (PyDict_SetItem(__pyx_d, __pyx_n_s_get_cursor, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 57; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "pygame_sdl2/mouse.pyx":1 * # Copyright 2014 Patrick Dawson # <<<<<<<<<<<<<< * # * # This software is provided 'as-is', without any express or implied */ __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); if (PyDict_SetItem(__pyx_d, __pyx_n_s_test, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /*--- Wrapped vars code ---*/ goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); if (__pyx_m) { if (__pyx_d) { __Pyx_AddTraceback("init pygame_sdl2.mouse", __pyx_clineno, __pyx_lineno, __pyx_filename); } Py_DECREF(__pyx_m); __pyx_m = 0; } else if (!PyErr_Occurred()) { PyErr_SetString(PyExc_ImportError, "init pygame_sdl2.mouse"); } __pyx_L0:; __Pyx_RefNannyFinishContext(); #if PY_MAJOR_VERSION < 3 return; #else return __pyx_m; #endif } /* --- Runtime support code --- */ #if CYTHON_REFNANNY static __Pyx_RefNannyAPIStruct *__Pyx_RefNannyImportAPI(const char *modname) { PyObject *m = NULL, *p = NULL; void *r = NULL; m = PyImport_ImportModule((char *)modname); if (!m) goto end; p = PyObject_GetAttrString(m, (char *)"RefNannyAPI"); if (!p) goto end; r = PyLong_AsVoidPtr(p); end: Py_XDECREF(p); Py_XDECREF(m); return (__Pyx_RefNannyAPIStruct *)r; } #endif static CYTHON_INLINE void __Pyx_RaiseTooManyValuesError(Py_ssize_t expected) { PyErr_Format(PyExc_ValueError, "too many values to unpack (expected %" CYTHON_FORMAT_SSIZE_T "d)", expected); } static CYTHON_INLINE void __Pyx_RaiseNeedMoreValuesError(Py_ssize_t index) { PyErr_Format(PyExc_ValueError, "need more than %" CYTHON_FORMAT_SSIZE_T "d value%.1s to unpack", index, (index == 1) ? "" : "s"); } static CYTHON_INLINE int __Pyx_IterFinish(void) { #if CYTHON_COMPILING_IN_CPYTHON PyThreadState *tstate = PyThreadState_GET(); PyObject* exc_type = tstate->curexc_type; if (unlikely(exc_type)) { if (likely(exc_type == PyExc_StopIteration) || PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration)) { PyObject *exc_value, *exc_tb; exc_value = tstate->curexc_value; exc_tb = tstate->curexc_traceback; tstate->curexc_type = 0; tstate->curexc_value = 0; tstate->curexc_traceback = 0; Py_DECREF(exc_type); Py_XDECREF(exc_value); Py_XDECREF(exc_tb); return 0; } else { return -1; } } return 0; #else if (unlikely(PyErr_Occurred())) { if (likely(PyErr_ExceptionMatches(PyExc_StopIteration))) { PyErr_Clear(); return 0; } else { return -1; } } return 0; #endif } static int __Pyx_IternextUnpackEndCheck(PyObject *retval, Py_ssize_t expected) { if (unlikely(retval)) { Py_DECREF(retval); __Pyx_RaiseTooManyValuesError(expected); return -1; } else { return __Pyx_IterFinish(); } return 0; } static void __Pyx_RaiseArgtupleInvalid( const char* func_name, int exact, Py_ssize_t num_min, Py_ssize_t num_max, Py_ssize_t num_found) { Py_ssize_t num_expected; const char *more_or_less; if (num_found < num_min) { num_expected = num_min; more_or_less = "at least"; } else { num_expected = num_max; more_or_less = "at most"; } if (exact) { more_or_less = "exactly"; } PyErr_Format(PyExc_TypeError, "%.200s() takes %.8s %" CYTHON_FORMAT_SSIZE_T "d positional argument%.1s (%" CYTHON_FORMAT_SSIZE_T "d given)", func_name, more_or_less, num_expected, (num_expected == 1) ? "" : "s", num_found); } static void __Pyx_RaiseDoubleKeywordsError( const char* func_name, PyObject* kw_name) { PyErr_Format(PyExc_TypeError, #if PY_MAJOR_VERSION >= 3 "%s() got multiple values for keyword argument '%U'", func_name, kw_name); #else "%s() got multiple values for keyword argument '%s'", func_name, PyString_AsString(kw_name)); #endif } static int __Pyx_ParseOptionalKeywords( PyObject *kwds, PyObject **argnames[], PyObject *kwds2, PyObject *values[], Py_ssize_t num_pos_args, const char* function_name) { PyObject *key = 0, *value = 0; Py_ssize_t pos = 0; PyObject*** name; PyObject*** first_kw_arg = argnames + num_pos_args; while (PyDict_Next(kwds, &pos, &key, &value)) { name = first_kw_arg; while (*name && (**name != key)) name++; if (*name) { values[name-argnames] = value; continue; } name = first_kw_arg; #if PY_MAJOR_VERSION < 3 if (likely(PyString_CheckExact(key)) || likely(PyString_Check(key))) { while (*name) { if ((CYTHON_COMPILING_IN_PYPY || PyString_GET_SIZE(**name) == PyString_GET_SIZE(key)) && _PyString_Eq(**name, key)) { values[name-argnames] = value; break; } name++; } if (*name) continue; else { PyObject*** argname = argnames; while (argname != first_kw_arg) { if ((**argname == key) || ( (CYTHON_COMPILING_IN_PYPY || PyString_GET_SIZE(**argname) == PyString_GET_SIZE(key)) && _PyString_Eq(**argname, key))) { goto arg_passed_twice; } argname++; } } } else #endif if (likely(PyUnicode_Check(key))) { while (*name) { int cmp = (**name == key) ? 0 : #if !CYTHON_COMPILING_IN_PYPY && PY_MAJOR_VERSION >= 3 (PyUnicode_GET_SIZE(**name) != PyUnicode_GET_SIZE(key)) ? 1 : #endif PyUnicode_Compare(**name, key); if (cmp < 0 && unlikely(PyErr_Occurred())) goto bad; if (cmp == 0) { values[name-argnames] = value; break; } name++; } if (*name) continue; else { PyObject*** argname = argnames; while (argname != first_kw_arg) { int cmp = (**argname == key) ? 0 : #if !CYTHON_COMPILING_IN_PYPY && PY_MAJOR_VERSION >= 3 (PyUnicode_GET_SIZE(**argname) != PyUnicode_GET_SIZE(key)) ? 1 : #endif PyUnicode_Compare(**argname, key); if (cmp < 0 && unlikely(PyErr_Occurred())) goto bad; if (cmp == 0) goto arg_passed_twice; argname++; } } } else goto invalid_keyword_type; if (kwds2) { if (unlikely(PyDict_SetItem(kwds2, key, value))) goto bad; } else { goto invalid_keyword; } } return 0; arg_passed_twice: __Pyx_RaiseDoubleKeywordsError(function_name, key); goto bad; invalid_keyword_type: PyErr_Format(PyExc_TypeError, "%.200s() keywords must be strings", function_name); goto bad; invalid_keyword: PyErr_Format(PyExc_TypeError, #if PY_MAJOR_VERSION < 3 "%.200s() got an unexpected keyword argument '%.200s'", function_name, PyString_AsString(key)); #else "%s() got an unexpected keyword argument '%U'", function_name, key); #endif bad: return -1; } static int __pyx_bisect_code_objects(__Pyx_CodeObjectCacheEntry* entries, int count, int code_line) { int start = 0, mid = 0, end = count - 1; if (end >= 0 && code_line > entries[end].code_line) { return count; } while (start < end) { mid = start + (end - start) / 2; if (code_line < entries[mid].code_line) { end = mid; } else if (code_line > entries[mid].code_line) { start = mid + 1; } else { return mid; } } if (code_line <= entries[mid].code_line) { return mid; } else { return mid + 1; } } static PyCodeObject *__pyx_find_code_object(int code_line) { PyCodeObject* code_object; int pos; if (unlikely(!code_line) || unlikely(!__pyx_code_cache.entries)) { return NULL; } pos = __pyx_bisect_code_objects(__pyx_code_cache.entries, __pyx_code_cache.count, code_line); if (unlikely(pos >= __pyx_code_cache.count) || unlikely(__pyx_code_cache.entries[pos].code_line != code_line)) { return NULL; } code_object = __pyx_code_cache.entries[pos].code_object; Py_INCREF(code_object); return code_object; } static void __pyx_insert_code_object(int code_line, PyCodeObject* code_object) { int pos, i; __Pyx_CodeObjectCacheEntry* entries = __pyx_code_cache.entries; if (unlikely(!code_line)) { return; } if (unlikely(!entries)) { entries = (__Pyx_CodeObjectCacheEntry*)PyMem_Malloc(64*sizeof(__Pyx_CodeObjectCacheEntry)); if (likely(entries)) { __pyx_code_cache.entries = entries; __pyx_code_cache.max_count = 64; __pyx_code_cache.count = 1; entries[0].code_line = code_line; entries[0].code_object = code_object; Py_INCREF(code_object); } return; } pos = __pyx_bisect_code_objects(__pyx_code_cache.entries, __pyx_code_cache.count, code_line); if ((pos < __pyx_code_cache.count) && unlikely(__pyx_code_cache.entries[pos].code_line == code_line)) { PyCodeObject* tmp = entries[pos].code_object; entries[pos].code_object = code_object; Py_DECREF(tmp); return; } if (__pyx_code_cache.count == __pyx_code_cache.max_count) { int new_max = __pyx_code_cache.max_count + 64; entries = (__Pyx_CodeObjectCacheEntry*)PyMem_Realloc( __pyx_code_cache.entries, (size_t)new_max*sizeof(__Pyx_CodeObjectCacheEntry)); if (unlikely(!entries)) { return; } __pyx_code_cache.entries = entries; __pyx_code_cache.max_count = new_max; } for (i=__pyx_code_cache.count; i>pos; i--) { entries[i] = entries[i-1]; } entries[pos].code_line = code_line; entries[pos].code_object = code_object; __pyx_code_cache.count++; Py_INCREF(code_object); } #include "compile.h" #include "frameobject.h" #include "traceback.h" static PyCodeObject* __Pyx_CreateCodeObjectForTraceback( const char *funcname, int c_line, int py_line, const char *filename) { PyCodeObject *py_code = 0; PyObject *py_srcfile = 0; PyObject *py_funcname = 0; #if PY_MAJOR_VERSION < 3 py_srcfile = PyString_FromString(filename); #else py_srcfile = PyUnicode_FromString(filename); #endif if (!py_srcfile) goto bad; if (c_line) { #if PY_MAJOR_VERSION < 3 py_funcname = PyString_FromFormat( "%s (%s:%d)", funcname, __pyx_cfilenm, c_line); #else py_funcname = PyUnicode_FromFormat( "%s (%s:%d)", funcname, __pyx_cfilenm, c_line); #endif } else { #if PY_MAJOR_VERSION < 3 py_funcname = PyString_FromString(funcname); #else py_funcname = PyUnicode_FromString(funcname); #endif } if (!py_funcname) goto bad; py_code = __Pyx_PyCode_New( 0, 0, 0, 0, 0, __pyx_empty_bytes, /*PyObject *code,*/ __pyx_empty_tuple, /*PyObject *consts,*/ __pyx_empty_tuple, /*PyObject *names,*/ __pyx_empty_tuple, /*PyObject *varnames,*/ __pyx_empty_tuple, /*PyObject *freevars,*/ __pyx_empty_tuple, /*PyObject *cellvars,*/ py_srcfile, /*PyObject *filename,*/ py_funcname, /*PyObject *name,*/ py_line, __pyx_empty_bytes /*PyObject *lnotab*/ ); Py_DECREF(py_srcfile); Py_DECREF(py_funcname); return py_code; bad: Py_XDECREF(py_srcfile); Py_XDECREF(py_funcname); return NULL; } static void __Pyx_AddTraceback(const char *funcname, int c_line, int py_line, const char *filename) { PyCodeObject *py_code = 0; PyFrameObject *py_frame = 0; py_code = __pyx_find_code_object(c_line ? c_line : py_line); if (!py_code) { py_code = __Pyx_CreateCodeObjectForTraceback( funcname, c_line, py_line, filename); if (!py_code) goto bad; __pyx_insert_code_object(c_line ? c_line : py_line, py_code); } py_frame = PyFrame_New( PyThreadState_GET(), /*PyThreadState *tstate,*/ py_code, /*PyCodeObject *code,*/ __pyx_d, /*PyObject *globals,*/ 0 /*PyObject *locals*/ ); if (!py_frame) goto bad; py_frame->f_lineno = py_line; PyTraceBack_Here(py_frame); bad: Py_XDECREF(py_code); Py_XDECREF(py_frame); } static CYTHON_INLINE PyObject* __Pyx_PyInt_From_int(int value) { const int neg_one = (int) -1, const_zero = (int) 0; const int is_unsigned = neg_one > const_zero; if (is_unsigned) { if (sizeof(int) < sizeof(long)) { return PyInt_FromLong((long) value); } else if (sizeof(int) <= sizeof(unsigned long)) { return PyLong_FromUnsignedLong((unsigned long) value); } else if (sizeof(int) <= sizeof(unsigned PY_LONG_LONG)) { return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value); } } else { if (sizeof(int) <= sizeof(long)) { return PyInt_FromLong((long) value); } else if (sizeof(int) <= sizeof(PY_LONG_LONG)) { return PyLong_FromLongLong((PY_LONG_LONG) value); } } { int one = 1; int little = (int)*(unsigned char *)&one; unsigned char *bytes = (unsigned char *)&value; return _PyLong_FromByteArray(bytes, sizeof(int), little, !is_unsigned); } } #define __PYX_VERIFY_RETURN_INT(target_type, func_type, func_value)\ __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, 0) #define __PYX_VERIFY_RETURN_INT_EXC(target_type, func_type, func_value)\ __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, 1) #define __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, exc)\ {\ func_type value = func_value;\ if (sizeof(target_type) < sizeof(func_type)) {\ if (unlikely(value != (func_type) (target_type) value)) {\ func_type zero = 0;\ if (exc && unlikely(value == (func_type)-1 && PyErr_Occurred()))\ return (target_type) -1;\ if (is_unsigned && unlikely(value < zero))\ goto raise_neg_overflow;\ else\ goto raise_overflow;\ }\ }\ return (target_type) value;\ } #if CYTHON_USE_PYLONG_INTERNALS #include "longintrepr.h" #endif static CYTHON_INLINE int __Pyx_PyInt_As_int(PyObject *x) { const int neg_one = (int) -1, const_zero = (int) 0; const int is_unsigned = neg_one > const_zero; #if PY_MAJOR_VERSION < 3 if (likely(PyInt_Check(x))) { if (sizeof(int) < sizeof(long)) { __PYX_VERIFY_RETURN_INT(int, long, PyInt_AS_LONG(x)) } else { long val = PyInt_AS_LONG(x); if (is_unsigned && unlikely(val < 0)) { goto raise_neg_overflow; } return (int) val; } } else #endif if (likely(PyLong_Check(x))) { if (is_unsigned) { #if CYTHON_USE_PYLONG_INTERNALS const digit* digits = ((PyLongObject*)x)->ob_digit; switch (Py_SIZE(x)) { case 0: return (int) 0; case 1: __PYX_VERIFY_RETURN_INT(int, digit, digits[0]) case 2: if (8 * sizeof(int) > 1 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(int) >= 2 * PyLong_SHIFT) { return (int) (((((int)digits[1]) << PyLong_SHIFT) | (int)digits[0])); } } break; case 3: if (8 * sizeof(int) > 2 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(int) >= 3 * PyLong_SHIFT) { return (int) (((((((int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0])); } } break; case 4: if (8 * sizeof(int) > 3 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(int) >= 4 * PyLong_SHIFT) { return (int) (((((((((int)digits[3]) << PyLong_SHIFT) | (int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0])); } } break; } #endif #if CYTHON_COMPILING_IN_CPYTHON if (unlikely(Py_SIZE(x) < 0)) { goto raise_neg_overflow; } #else { int result = PyObject_RichCompareBool(x, Py_False, Py_LT); if (unlikely(result < 0)) return (int) -1; if (unlikely(result == 1)) goto raise_neg_overflow; } #endif if (sizeof(int) <= sizeof(unsigned long)) { __PYX_VERIFY_RETURN_INT_EXC(int, unsigned long, PyLong_AsUnsignedLong(x)) } else if (sizeof(int) <= sizeof(unsigned PY_LONG_LONG)) { __PYX_VERIFY_RETURN_INT_EXC(int, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x)) } } else { #if CYTHON_USE_PYLONG_INTERNALS const digit* digits = ((PyLongObject*)x)->ob_digit; switch (Py_SIZE(x)) { case 0: return (int) 0; case -1: __PYX_VERIFY_RETURN_INT(int, sdigit, -(sdigit) digits[0]) case 1: __PYX_VERIFY_RETURN_INT(int, digit, +digits[0]) case -2: if (8 * sizeof(int) - 1 > 1 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(int, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(int) - 1 > 2 * PyLong_SHIFT) { return (int) (((int)-1)*(((((int)digits[1]) << PyLong_SHIFT) | (int)digits[0]))); } } break; case 2: if (8 * sizeof(int) > 1 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(int) - 1 > 2 * PyLong_SHIFT) { return (int) ((((((int)digits[1]) << PyLong_SHIFT) | (int)digits[0]))); } } break; case -3: if (8 * sizeof(int) - 1 > 2 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(int, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(int) - 1 > 3 * PyLong_SHIFT) { return (int) (((int)-1)*(((((((int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0]))); } } break; case 3: if (8 * sizeof(int) > 2 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(int) - 1 > 3 * PyLong_SHIFT) { return (int) ((((((((int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0]))); } } break; case -4: if (8 * sizeof(int) - 1 > 3 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(int, long, -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(int) - 1 > 4 * PyLong_SHIFT) { return (int) (((int)-1)*(((((((((int)digits[3]) << PyLong_SHIFT) | (int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0]))); } } break; case 4: if (8 * sizeof(int) > 3 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(int) - 1 > 4 * PyLong_SHIFT) { return (int) ((((((((((int)digits[3]) << PyLong_SHIFT) | (int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0]))); } } break; } #endif if (sizeof(int) <= sizeof(long)) { __PYX_VERIFY_RETURN_INT_EXC(int, long, PyLong_AsLong(x)) } else if (sizeof(int) <= sizeof(PY_LONG_LONG)) { __PYX_VERIFY_RETURN_INT_EXC(int, PY_LONG_LONG, PyLong_AsLongLong(x)) } } { #if CYTHON_COMPILING_IN_PYPY && !defined(_PyLong_AsByteArray) PyErr_SetString(PyExc_RuntimeError, "_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers"); #else int val; PyObject *v = __Pyx_PyNumber_Int(x); #if PY_MAJOR_VERSION < 3 if (likely(v) && !PyLong_Check(v)) { PyObject *tmp = v; v = PyNumber_Long(tmp); Py_DECREF(tmp); } #endif if (likely(v)) { int one = 1; int is_little = (int)*(unsigned char *)&one; unsigned char *bytes = (unsigned char *)&val; int ret = _PyLong_AsByteArray((PyLongObject *)v, bytes, sizeof(val), is_little, !is_unsigned); Py_DECREF(v); if (likely(!ret)) return val; } #endif return (int) -1; } } else { int val; PyObject *tmp = __Pyx_PyNumber_Int(x); if (!tmp) return (int) -1; val = __Pyx_PyInt_As_int(tmp); Py_DECREF(tmp); return val; } raise_overflow: PyErr_SetString(PyExc_OverflowError, "value too large to convert to int"); return (int) -1; raise_neg_overflow: PyErr_SetString(PyExc_OverflowError, "can't convert negative value to int"); return (int) -1; } static CYTHON_INLINE PyObject* __Pyx_PyInt_From_long(long value) { const long neg_one = (long) -1, const_zero = (long) 0; const int is_unsigned = neg_one > const_zero; if (is_unsigned) { if (sizeof(long) < sizeof(long)) { return PyInt_FromLong((long) value); } else if (sizeof(long) <= sizeof(unsigned long)) { return PyLong_FromUnsignedLong((unsigned long) value); } else if (sizeof(long) <= sizeof(unsigned PY_LONG_LONG)) { return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value); } } else { if (sizeof(long) <= sizeof(long)) { return PyInt_FromLong((long) value); } else if (sizeof(long) <= sizeof(PY_LONG_LONG)) { return PyLong_FromLongLong((PY_LONG_LONG) value); } } { int one = 1; int little = (int)*(unsigned char *)&one; unsigned char *bytes = (unsigned char *)&value; return _PyLong_FromByteArray(bytes, sizeof(long), little, !is_unsigned); } } static CYTHON_INLINE long __Pyx_PyInt_As_long(PyObject *x) { const long neg_one = (long) -1, const_zero = (long) 0; const int is_unsigned = neg_one > const_zero; #if PY_MAJOR_VERSION < 3 if (likely(PyInt_Check(x))) { if (sizeof(long) < sizeof(long)) { __PYX_VERIFY_RETURN_INT(long, long, PyInt_AS_LONG(x)) } else { long val = PyInt_AS_LONG(x); if (is_unsigned && unlikely(val < 0)) { goto raise_neg_overflow; } return (long) val; } } else #endif if (likely(PyLong_Check(x))) { if (is_unsigned) { #if CYTHON_USE_PYLONG_INTERNALS const digit* digits = ((PyLongObject*)x)->ob_digit; switch (Py_SIZE(x)) { case 0: return (long) 0; case 1: __PYX_VERIFY_RETURN_INT(long, digit, digits[0]) case 2: if (8 * sizeof(long) > 1 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(long) >= 2 * PyLong_SHIFT) { return (long) (((((long)digits[1]) << PyLong_SHIFT) | (long)digits[0])); } } break; case 3: if (8 * sizeof(long) > 2 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(long) >= 3 * PyLong_SHIFT) { return (long) (((((((long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0])); } } break; case 4: if (8 * sizeof(long) > 3 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(long) >= 4 * PyLong_SHIFT) { return (long) (((((((((long)digits[3]) << PyLong_SHIFT) | (long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0])); } } break; } #endif #if CYTHON_COMPILING_IN_CPYTHON if (unlikely(Py_SIZE(x) < 0)) { goto raise_neg_overflow; } #else { int result = PyObject_RichCompareBool(x, Py_False, Py_LT); if (unlikely(result < 0)) return (long) -1; if (unlikely(result == 1)) goto raise_neg_overflow; } #endif if (sizeof(long) <= sizeof(unsigned long)) { __PYX_VERIFY_RETURN_INT_EXC(long, unsigned long, PyLong_AsUnsignedLong(x)) } else if (sizeof(long) <= sizeof(unsigned PY_LONG_LONG)) { __PYX_VERIFY_RETURN_INT_EXC(long, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x)) } } else { #if CYTHON_USE_PYLONG_INTERNALS const digit* digits = ((PyLongObject*)x)->ob_digit; switch (Py_SIZE(x)) { case 0: return (long) 0; case -1: __PYX_VERIFY_RETURN_INT(long, sdigit, -(sdigit) digits[0]) case 1: __PYX_VERIFY_RETURN_INT(long, digit, +digits[0]) case -2: if (8 * sizeof(long) - 1 > 1 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(long, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) { return (long) (((long)-1)*(((((long)digits[1]) << PyLong_SHIFT) | (long)digits[0]))); } } break; case 2: if (8 * sizeof(long) > 1 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) { return (long) ((((((long)digits[1]) << PyLong_SHIFT) | (long)digits[0]))); } } break; case -3: if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(long, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) { return (long) (((long)-1)*(((((((long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0]))); } } break; case 3: if (8 * sizeof(long) > 2 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) { return (long) ((((((((long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0]))); } } break; case -4: if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(long, long, -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(long) - 1 > 4 * PyLong_SHIFT) { return (long) (((long)-1)*(((((((((long)digits[3]) << PyLong_SHIFT) | (long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0]))); } } break; case 4: if (8 * sizeof(long) > 3 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(long) - 1 > 4 * PyLong_SHIFT) { return (long) ((((((((((long)digits[3]) << PyLong_SHIFT) | (long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0]))); } } break; } #endif if (sizeof(long) <= sizeof(long)) { __PYX_VERIFY_RETURN_INT_EXC(long, long, PyLong_AsLong(x)) } else if (sizeof(long) <= sizeof(PY_LONG_LONG)) { __PYX_VERIFY_RETURN_INT_EXC(long, PY_LONG_LONG, PyLong_AsLongLong(x)) } } { #if CYTHON_COMPILING_IN_PYPY && !defined(_PyLong_AsByteArray) PyErr_SetString(PyExc_RuntimeError, "_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers"); #else long val; PyObject *v = __Pyx_PyNumber_Int(x); #if PY_MAJOR_VERSION < 3 if (likely(v) && !PyLong_Check(v)) { PyObject *tmp = v; v = PyNumber_Long(tmp); Py_DECREF(tmp); } #endif if (likely(v)) { int one = 1; int is_little = (int)*(unsigned char *)&one; unsigned char *bytes = (unsigned char *)&val; int ret = _PyLong_AsByteArray((PyLongObject *)v, bytes, sizeof(val), is_little, !is_unsigned); Py_DECREF(v); if (likely(!ret)) return val; } #endif return (long) -1; } } else { long val; PyObject *tmp = __Pyx_PyNumber_Int(x); if (!tmp) return (long) -1; val = __Pyx_PyInt_As_long(tmp); Py_DECREF(tmp); return val; } raise_overflow: PyErr_SetString(PyExc_OverflowError, "value too large to convert to long"); return (long) -1; raise_neg_overflow: PyErr_SetString(PyExc_OverflowError, "can't convert negative value to long"); return (long) -1; } static int __Pyx_check_binary_version(void) { char ctversion[4], rtversion[4]; PyOS_snprintf(ctversion, 4, "%d.%d", PY_MAJOR_VERSION, PY_MINOR_VERSION); PyOS_snprintf(rtversion, 4, "%s", Py_GetVersion()); if (ctversion[0] != rtversion[0] || ctversion[2] != rtversion[2]) { char message[200]; PyOS_snprintf(message, sizeof(message), "compiletime version %s of module '%.100s' " "does not match runtime version %s", ctversion, __Pyx_MODULE_NAME, rtversion); return PyErr_WarnEx(NULL, message, 1); } return 0; } static int __Pyx_InitStrings(__Pyx_StringTabEntry *t) { while (t->p) { #if PY_MAJOR_VERSION < 3 if (t->is_unicode) { *t->p = PyUnicode_DecodeUTF8(t->s, t->n - 1, NULL); } else if (t->intern) { *t->p = PyString_InternFromString(t->s); } else { *t->p = PyString_FromStringAndSize(t->s, t->n - 1); } #else if (t->is_unicode | t->is_str) { if (t->intern) { *t->p = PyUnicode_InternFromString(t->s); } else if (t->encoding) { *t->p = PyUnicode_Decode(t->s, t->n - 1, t->encoding, NULL); } else { *t->p = PyUnicode_FromStringAndSize(t->s, t->n - 1); } } else { *t->p = PyBytes_FromStringAndSize(t->s, t->n - 1); } #endif if (!*t->p) return -1; ++t; } return 0; } static CYTHON_INLINE PyObject* __Pyx_PyUnicode_FromString(const char* c_str) { return __Pyx_PyUnicode_FromStringAndSize(c_str, (Py_ssize_t)strlen(c_str)); } static CYTHON_INLINE char* __Pyx_PyObject_AsString(PyObject* o) { Py_ssize_t ignore; return __Pyx_PyObject_AsStringAndSize(o, &ignore); } static CYTHON_INLINE char* __Pyx_PyObject_AsStringAndSize(PyObject* o, Py_ssize_t *length) { #if CYTHON_COMPILING_IN_CPYTHON && (__PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT) if ( #if PY_MAJOR_VERSION < 3 && __PYX_DEFAULT_STRING_ENCODING_IS_ASCII __Pyx_sys_getdefaultencoding_not_ascii && #endif PyUnicode_Check(o)) { #if PY_VERSION_HEX < 0x03030000 char* defenc_c; PyObject* defenc = _PyUnicode_AsDefaultEncodedString(o, NULL); if (!defenc) return NULL; defenc_c = PyBytes_AS_STRING(defenc); #if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII { char* end = defenc_c + PyBytes_GET_SIZE(defenc); char* c; for (c = defenc_c; c < end; c++) { if ((unsigned char) (*c) >= 128) { PyUnicode_AsASCIIString(o); return NULL; } } } #endif *length = PyBytes_GET_SIZE(defenc); return defenc_c; #else if (__Pyx_PyUnicode_READY(o) == -1) return NULL; #if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII if (PyUnicode_IS_ASCII(o)) { *length = PyUnicode_GET_LENGTH(o); return PyUnicode_AsUTF8(o); } else { PyUnicode_AsASCIIString(o); return NULL; } #else return PyUnicode_AsUTF8AndSize(o, length); #endif #endif } else #endif #if (!CYTHON_COMPILING_IN_PYPY) || (defined(PyByteArray_AS_STRING) && defined(PyByteArray_GET_SIZE)) if (PyByteArray_Check(o)) { *length = PyByteArray_GET_SIZE(o); return PyByteArray_AS_STRING(o); } else #endif { char* result; int r = PyBytes_AsStringAndSize(o, &result, length); if (unlikely(r < 0)) { return NULL; } else { return result; } } } static CYTHON_INLINE int __Pyx_PyObject_IsTrue(PyObject* x) { int is_true = x == Py_True; if (is_true | (x == Py_False) | (x == Py_None)) return is_true; else return PyObject_IsTrue(x); } static CYTHON_INLINE PyObject* __Pyx_PyNumber_Int(PyObject* x) { PyNumberMethods *m; const char *name = NULL; PyObject *res = NULL; #if PY_MAJOR_VERSION < 3 if (PyInt_Check(x) || PyLong_Check(x)) #else if (PyLong_Check(x)) #endif return __Pyx_NewRef(x); m = Py_TYPE(x)->tp_as_number; #if PY_MAJOR_VERSION < 3 if (m && m->nb_int) { name = "int"; res = PyNumber_Int(x); } else if (m && m->nb_long) { name = "long"; res = PyNumber_Long(x); } #else if (m && m->nb_int) { name = "int"; res = PyNumber_Long(x); } #endif if (res) { #if PY_MAJOR_VERSION < 3 if (!PyInt_Check(res) && !PyLong_Check(res)) { #else if (!PyLong_Check(res)) { #endif PyErr_Format(PyExc_TypeError, "__%.4s__ returned non-%.4s (type %.200s)", name, name, Py_TYPE(res)->tp_name); Py_DECREF(res); return NULL; } } else if (!PyErr_Occurred()) { PyErr_SetString(PyExc_TypeError, "an integer is required"); } return res; } static CYTHON_INLINE Py_ssize_t __Pyx_PyIndex_AsSsize_t(PyObject* b) { Py_ssize_t ival; PyObject *x; #if PY_MAJOR_VERSION < 3 if (likely(PyInt_CheckExact(b))) { if (sizeof(Py_ssize_t) >= sizeof(long)) return PyInt_AS_LONG(b); else return PyInt_AsSsize_t(x); } #endif if (likely(PyLong_CheckExact(b))) { #if CYTHON_USE_PYLONG_INTERNALS const digit* digits = ((PyLongObject*)b)->ob_digit; const Py_ssize_t size = Py_SIZE(b); if (likely(__Pyx_sst_abs(size) <= 1)) { ival = likely(size) ? digits[0] : 0; if (size == -1) ival = -ival; return ival; } else { switch (size) { case 2: if (8 * sizeof(Py_ssize_t) > 2 * PyLong_SHIFT) { return (Py_ssize_t) (((((size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])); } break; case -2: if (8 * sizeof(Py_ssize_t) > 2 * PyLong_SHIFT) { return -(Py_ssize_t) (((((size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])); } break; case 3: if (8 * sizeof(Py_ssize_t) > 3 * PyLong_SHIFT) { return (Py_ssize_t) (((((((size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])); } break; case -3: if (8 * sizeof(Py_ssize_t) > 3 * PyLong_SHIFT) { return -(Py_ssize_t) (((((((size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])); } break; case 4: if (8 * sizeof(Py_ssize_t) > 4 * PyLong_SHIFT) { return (Py_ssize_t) (((((((((size_t)digits[3]) << PyLong_SHIFT) | (size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])); } break; case -4: if (8 * sizeof(Py_ssize_t) > 4 * PyLong_SHIFT) { return -(Py_ssize_t) (((((((((size_t)digits[3]) << PyLong_SHIFT) | (size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])); } break; } } #endif return PyLong_AsSsize_t(b); } x = PyNumber_Index(b); if (!x) return -1; ival = PyInt_AsSsize_t(x); Py_DECREF(x); return ival; } static CYTHON_INLINE PyObject * __Pyx_PyInt_FromSize_t(size_t ival) { return PyInt_FromSize_t(ival); } #endif /* Py_PYTHON_H */ pygame_sdl2-2.1.0-for-renpy-6.99.14.1/gen3/pygame_sdl2.transform.c0000664000175000017500000067354312665223543023520 0ustar tomtom00000000000000/* Generated by Cython 0.23.3 */ #define PY_SSIZE_T_CLEAN #include "Python.h" #ifndef Py_PYTHON_H #error Python headers needed to compile C extensions, please install development version of Python. #elif PY_VERSION_HEX < 0x02060000 || (0x03000000 <= PY_VERSION_HEX && PY_VERSION_HEX < 0x03020000) #error Cython requires Python 2.6+ or Python 3.2+. #else #define CYTHON_ABI "0_23_3" #include #ifndef offsetof #define offsetof(type, member) ( (size_t) & ((type*)0) -> member ) #endif #if !defined(WIN32) && !defined(MS_WINDOWS) #ifndef __stdcall #define __stdcall #endif #ifndef __cdecl #define __cdecl #endif #ifndef __fastcall #define __fastcall #endif #endif #ifndef DL_IMPORT #define DL_IMPORT(t) t #endif #ifndef DL_EXPORT #define DL_EXPORT(t) t #endif #ifndef PY_LONG_LONG #define PY_LONG_LONG LONG_LONG #endif #ifndef Py_HUGE_VAL #define Py_HUGE_VAL HUGE_VAL #endif #ifdef PYPY_VERSION #define CYTHON_COMPILING_IN_PYPY 1 #define CYTHON_COMPILING_IN_CPYTHON 0 #else #define CYTHON_COMPILING_IN_PYPY 0 #define CYTHON_COMPILING_IN_CPYTHON 1 #endif #if !defined(CYTHON_USE_PYLONG_INTERNALS) && CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x02070000 #define CYTHON_USE_PYLONG_INTERNALS 1 #endif #if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX < 0x02070600 && !defined(Py_OptimizeFlag) #define Py_OptimizeFlag 0 #endif #define __PYX_BUILD_PY_SSIZE_T "n" #define CYTHON_FORMAT_SSIZE_T "z" #if PY_MAJOR_VERSION < 3 #define __Pyx_BUILTIN_MODULE_NAME "__builtin__" #define __Pyx_PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)\ PyCode_New(a+k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos) #define __Pyx_DefaultClassType PyClass_Type #else #define __Pyx_BUILTIN_MODULE_NAME "builtins" #define __Pyx_PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)\ PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos) #define __Pyx_DefaultClassType PyType_Type #endif #ifndef Py_TPFLAGS_CHECKTYPES #define Py_TPFLAGS_CHECKTYPES 0 #endif #ifndef Py_TPFLAGS_HAVE_INDEX #define Py_TPFLAGS_HAVE_INDEX 0 #endif #ifndef Py_TPFLAGS_HAVE_NEWBUFFER #define Py_TPFLAGS_HAVE_NEWBUFFER 0 #endif #ifndef Py_TPFLAGS_HAVE_FINALIZE #define Py_TPFLAGS_HAVE_FINALIZE 0 #endif #if PY_VERSION_HEX > 0x03030000 && defined(PyUnicode_KIND) #define CYTHON_PEP393_ENABLED 1 #define __Pyx_PyUnicode_READY(op) (likely(PyUnicode_IS_READY(op)) ?\ 0 : _PyUnicode_Ready((PyObject *)(op))) #define __Pyx_PyUnicode_GET_LENGTH(u) PyUnicode_GET_LENGTH(u) #define __Pyx_PyUnicode_READ_CHAR(u, i) PyUnicode_READ_CHAR(u, i) #define __Pyx_PyUnicode_KIND(u) PyUnicode_KIND(u) #define __Pyx_PyUnicode_DATA(u) PyUnicode_DATA(u) #define __Pyx_PyUnicode_READ(k, d, i) PyUnicode_READ(k, d, i) #else #define CYTHON_PEP393_ENABLED 0 #define __Pyx_PyUnicode_READY(op) (0) #define __Pyx_PyUnicode_GET_LENGTH(u) PyUnicode_GET_SIZE(u) #define __Pyx_PyUnicode_READ_CHAR(u, i) ((Py_UCS4)(PyUnicode_AS_UNICODE(u)[i])) #define __Pyx_PyUnicode_KIND(u) (sizeof(Py_UNICODE)) #define __Pyx_PyUnicode_DATA(u) ((void*)PyUnicode_AS_UNICODE(u)) #define __Pyx_PyUnicode_READ(k, d, i) ((void)(k), (Py_UCS4)(((Py_UNICODE*)d)[i])) #endif #if CYTHON_COMPILING_IN_PYPY #define __Pyx_PyUnicode_Concat(a, b) PyNumber_Add(a, b) #define __Pyx_PyUnicode_ConcatSafe(a, b) PyNumber_Add(a, b) #else #define __Pyx_PyUnicode_Concat(a, b) PyUnicode_Concat(a, b) #define __Pyx_PyUnicode_ConcatSafe(a, b) ((unlikely((a) == Py_None) || unlikely((b) == Py_None)) ?\ PyNumber_Add(a, b) : __Pyx_PyUnicode_Concat(a, b)) #endif #if CYTHON_COMPILING_IN_PYPY && !defined(PyUnicode_Contains) #define PyUnicode_Contains(u, s) PySequence_Contains(u, s) #endif #define __Pyx_PyString_FormatSafe(a, b) ((unlikely((a) == Py_None)) ? PyNumber_Remainder(a, b) : __Pyx_PyString_Format(a, b)) #define __Pyx_PyUnicode_FormatSafe(a, b) ((unlikely((a) == Py_None)) ? PyNumber_Remainder(a, b) : PyUnicode_Format(a, b)) #if PY_MAJOR_VERSION >= 3 #define __Pyx_PyString_Format(a, b) PyUnicode_Format(a, b) #else #define __Pyx_PyString_Format(a, b) PyString_Format(a, b) #endif #if PY_MAJOR_VERSION >= 3 #define PyBaseString_Type PyUnicode_Type #define PyStringObject PyUnicodeObject #define PyString_Type PyUnicode_Type #define PyString_Check PyUnicode_Check #define PyString_CheckExact PyUnicode_CheckExact #endif #if PY_MAJOR_VERSION >= 3 #define __Pyx_PyBaseString_Check(obj) PyUnicode_Check(obj) #define __Pyx_PyBaseString_CheckExact(obj) PyUnicode_CheckExact(obj) #else #define __Pyx_PyBaseString_Check(obj) (PyString_Check(obj) || PyUnicode_Check(obj)) #define __Pyx_PyBaseString_CheckExact(obj) (PyString_CheckExact(obj) || PyUnicode_CheckExact(obj)) #endif #ifndef PySet_CheckExact #define PySet_CheckExact(obj) (Py_TYPE(obj) == &PySet_Type) #endif #define __Pyx_TypeCheck(obj, type) PyObject_TypeCheck(obj, (PyTypeObject *)type) #if PY_MAJOR_VERSION >= 3 #define PyIntObject PyLongObject #define PyInt_Type PyLong_Type #define PyInt_Check(op) PyLong_Check(op) #define PyInt_CheckExact(op) PyLong_CheckExact(op) #define PyInt_FromString PyLong_FromString #define PyInt_FromUnicode PyLong_FromUnicode #define PyInt_FromLong PyLong_FromLong #define PyInt_FromSize_t PyLong_FromSize_t #define PyInt_FromSsize_t PyLong_FromSsize_t #define PyInt_AsLong PyLong_AsLong #define PyInt_AS_LONG PyLong_AS_LONG #define PyInt_AsSsize_t PyLong_AsSsize_t #define PyInt_AsUnsignedLongMask PyLong_AsUnsignedLongMask #define PyInt_AsUnsignedLongLongMask PyLong_AsUnsignedLongLongMask #define PyNumber_Int PyNumber_Long #endif #if PY_MAJOR_VERSION >= 3 #define PyBoolObject PyLongObject #endif #if PY_MAJOR_VERSION >= 3 && CYTHON_COMPILING_IN_PYPY #ifndef PyUnicode_InternFromString #define PyUnicode_InternFromString(s) PyUnicode_FromString(s) #endif #endif #if PY_VERSION_HEX < 0x030200A4 typedef long Py_hash_t; #define __Pyx_PyInt_FromHash_t PyInt_FromLong #define __Pyx_PyInt_AsHash_t PyInt_AsLong #else #define __Pyx_PyInt_FromHash_t PyInt_FromSsize_t #define __Pyx_PyInt_AsHash_t PyInt_AsSsize_t #endif #if PY_MAJOR_VERSION >= 3 #define __Pyx_PyMethod_New(func, self, klass) ((self) ? PyMethod_New(func, self) : PyInstanceMethod_New(func)) #else #define __Pyx_PyMethod_New(func, self, klass) PyMethod_New(func, self, klass) #endif #if PY_VERSION_HEX >= 0x030500B1 #define __Pyx_PyAsyncMethodsStruct PyAsyncMethods #define __Pyx_PyType_AsAsync(obj) (Py_TYPE(obj)->tp_as_async) #elif CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3 typedef struct { unaryfunc am_await; unaryfunc am_aiter; unaryfunc am_anext; } __Pyx_PyAsyncMethodsStruct; #define __Pyx_PyType_AsAsync(obj) ((__Pyx_PyAsyncMethodsStruct*) (Py_TYPE(obj)->tp_reserved)) #else #define __Pyx_PyType_AsAsync(obj) NULL #endif #ifndef CYTHON_RESTRICT #if defined(__GNUC__) #define CYTHON_RESTRICT __restrict__ #elif defined(_MSC_VER) && _MSC_VER >= 1400 #define CYTHON_RESTRICT __restrict #elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L #define CYTHON_RESTRICT restrict #else #define CYTHON_RESTRICT #endif #endif #define __Pyx_void_to_None(void_result) (void_result, Py_INCREF(Py_None), Py_None) #ifndef CYTHON_INLINE #if defined(__GNUC__) #define CYTHON_INLINE __inline__ #elif defined(_MSC_VER) #define CYTHON_INLINE __inline #elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L #define CYTHON_INLINE inline #else #define CYTHON_INLINE #endif #endif #if defined(WIN32) || defined(MS_WINDOWS) #define _USE_MATH_DEFINES #endif #include #ifdef NAN #define __PYX_NAN() ((float) NAN) #else static CYTHON_INLINE float __PYX_NAN() { float value; memset(&value, 0xFF, sizeof(value)); return value; } #endif #if PY_MAJOR_VERSION >= 3 #define __Pyx_PyNumber_Divide(x,y) PyNumber_TrueDivide(x,y) #define __Pyx_PyNumber_InPlaceDivide(x,y) PyNumber_InPlaceTrueDivide(x,y) #else #define __Pyx_PyNumber_Divide(x,y) PyNumber_TrueDivide(x,y) #define __Pyx_PyNumber_InPlaceDivide(x,y) PyNumber_InPlaceTrueDivide(x,y) #endif #ifndef __PYX_EXTERN_C #ifdef __cplusplus #define __PYX_EXTERN_C extern "C" #else #define __PYX_EXTERN_C extern #endif #endif #define __PYX_HAVE__pygame_sdl2__transform #define __PYX_HAVE_API__pygame_sdl2__transform #include "stdint.h" #include "string.h" #include "stdio.h" #include "stddef.h" #include "SDL.h" #include "SDL2_rotozoom.h" #include "SDL_gfxPrimitives.h" #ifdef _OPENMP #include #endif /* _OPENMP */ #ifdef PYREX_WITHOUT_ASSERTIONS #define CYTHON_WITHOUT_ASSERTIONS #endif #ifndef CYTHON_UNUSED # if defined(__GNUC__) # if !(defined(__cplusplus)) || (__GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 4)) # define CYTHON_UNUSED __attribute__ ((__unused__)) # else # define CYTHON_UNUSED # endif # elif defined(__ICC) || (defined(__INTEL_COMPILER) && !defined(_MSC_VER)) # define CYTHON_UNUSED __attribute__ ((__unused__)) # else # define CYTHON_UNUSED # endif #endif #ifndef CYTHON_NCP_UNUSED # if CYTHON_COMPILING_IN_CPYTHON # define CYTHON_NCP_UNUSED # else # define CYTHON_NCP_UNUSED CYTHON_UNUSED # endif #endif typedef struct {PyObject **p; char *s; const Py_ssize_t n; const char* encoding; const char is_unicode; const char is_str; const char intern; } __Pyx_StringTabEntry; #define __PYX_DEFAULT_STRING_ENCODING_IS_ASCII 0 #define __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT 0 #define __PYX_DEFAULT_STRING_ENCODING "" #define __Pyx_PyObject_FromString __Pyx_PyBytes_FromString #define __Pyx_PyObject_FromStringAndSize __Pyx_PyBytes_FromStringAndSize #define __Pyx_uchar_cast(c) ((unsigned char)c) #define __Pyx_long_cast(x) ((long)x) #define __Pyx_fits_Py_ssize_t(v, type, is_signed) (\ (sizeof(type) < sizeof(Py_ssize_t)) ||\ (sizeof(type) > sizeof(Py_ssize_t) &&\ likely(v < (type)PY_SSIZE_T_MAX ||\ v == (type)PY_SSIZE_T_MAX) &&\ (!is_signed || likely(v > (type)PY_SSIZE_T_MIN ||\ v == (type)PY_SSIZE_T_MIN))) ||\ (sizeof(type) == sizeof(Py_ssize_t) &&\ (is_signed || likely(v < (type)PY_SSIZE_T_MAX ||\ v == (type)PY_SSIZE_T_MAX))) ) #if defined (__cplusplus) && __cplusplus >= 201103L #include #define __Pyx_sst_abs(value) std::abs(value) #elif SIZEOF_INT >= SIZEOF_SIZE_T #define __Pyx_sst_abs(value) abs(value) #elif SIZEOF_LONG >= SIZEOF_SIZE_T #define __Pyx_sst_abs(value) labs(value) #elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L #define __Pyx_sst_abs(value) llabs(value) #elif defined (_MSC_VER) && defined (_M_X64) #define __Pyx_sst_abs(value) _abs64(value) #elif defined (__GNUC__) #define __Pyx_sst_abs(value) __builtin_llabs(value) #else #define __Pyx_sst_abs(value) ((value<0) ? -value : value) #endif static CYTHON_INLINE char* __Pyx_PyObject_AsString(PyObject*); static CYTHON_INLINE char* __Pyx_PyObject_AsStringAndSize(PyObject*, Py_ssize_t* length); #define __Pyx_PyByteArray_FromString(s) PyByteArray_FromStringAndSize((const char*)s, strlen((const char*)s)) #define __Pyx_PyByteArray_FromStringAndSize(s, l) PyByteArray_FromStringAndSize((const char*)s, l) #define __Pyx_PyBytes_FromString PyBytes_FromString #define __Pyx_PyBytes_FromStringAndSize PyBytes_FromStringAndSize static CYTHON_INLINE PyObject* __Pyx_PyUnicode_FromString(const char*); #if PY_MAJOR_VERSION < 3 #define __Pyx_PyStr_FromString __Pyx_PyBytes_FromString #define __Pyx_PyStr_FromStringAndSize __Pyx_PyBytes_FromStringAndSize #else #define __Pyx_PyStr_FromString __Pyx_PyUnicode_FromString #define __Pyx_PyStr_FromStringAndSize __Pyx_PyUnicode_FromStringAndSize #endif #define __Pyx_PyObject_AsSString(s) ((signed char*) __Pyx_PyObject_AsString(s)) #define __Pyx_PyObject_AsUString(s) ((unsigned char*) __Pyx_PyObject_AsString(s)) #define __Pyx_PyObject_FromCString(s) __Pyx_PyObject_FromString((const char*)s) #define __Pyx_PyBytes_FromCString(s) __Pyx_PyBytes_FromString((const char*)s) #define __Pyx_PyByteArray_FromCString(s) __Pyx_PyByteArray_FromString((const char*)s) #define __Pyx_PyStr_FromCString(s) __Pyx_PyStr_FromString((const char*)s) #define __Pyx_PyUnicode_FromCString(s) __Pyx_PyUnicode_FromString((const char*)s) #if PY_MAJOR_VERSION < 3 static CYTHON_INLINE size_t __Pyx_Py_UNICODE_strlen(const Py_UNICODE *u) { const Py_UNICODE *u_end = u; while (*u_end++) ; return (size_t)(u_end - u - 1); } #else #define __Pyx_Py_UNICODE_strlen Py_UNICODE_strlen #endif #define __Pyx_PyUnicode_FromUnicode(u) PyUnicode_FromUnicode(u, __Pyx_Py_UNICODE_strlen(u)) #define __Pyx_PyUnicode_FromUnicodeAndLength PyUnicode_FromUnicode #define __Pyx_PyUnicode_AsUnicode PyUnicode_AsUnicode #define __Pyx_NewRef(obj) (Py_INCREF(obj), obj) #define __Pyx_Owned_Py_None(b) __Pyx_NewRef(Py_None) #define __Pyx_PyBool_FromLong(b) ((b) ? __Pyx_NewRef(Py_True) : __Pyx_NewRef(Py_False)) static CYTHON_INLINE int __Pyx_PyObject_IsTrue(PyObject*); static CYTHON_INLINE PyObject* __Pyx_PyNumber_Int(PyObject* x); static CYTHON_INLINE Py_ssize_t __Pyx_PyIndex_AsSsize_t(PyObject*); static CYTHON_INLINE PyObject * __Pyx_PyInt_FromSize_t(size_t); #if CYTHON_COMPILING_IN_CPYTHON #define __pyx_PyFloat_AsDouble(x) (PyFloat_CheckExact(x) ? PyFloat_AS_DOUBLE(x) : PyFloat_AsDouble(x)) #else #define __pyx_PyFloat_AsDouble(x) PyFloat_AsDouble(x) #endif #define __pyx_PyFloat_AsFloat(x) ((float) __pyx_PyFloat_AsDouble(x)) #if PY_MAJOR_VERSION < 3 && __PYX_DEFAULT_STRING_ENCODING_IS_ASCII static int __Pyx_sys_getdefaultencoding_not_ascii; static int __Pyx_init_sys_getdefaultencoding_params(void) { PyObject* sys; PyObject* default_encoding = NULL; PyObject* ascii_chars_u = NULL; PyObject* ascii_chars_b = NULL; const char* default_encoding_c; sys = PyImport_ImportModule("sys"); if (!sys) goto bad; default_encoding = PyObject_CallMethod(sys, (char*) "getdefaultencoding", NULL); Py_DECREF(sys); if (!default_encoding) goto bad; default_encoding_c = PyBytes_AsString(default_encoding); if (!default_encoding_c) goto bad; if (strcmp(default_encoding_c, "ascii") == 0) { __Pyx_sys_getdefaultencoding_not_ascii = 0; } else { char ascii_chars[128]; int c; for (c = 0; c < 128; c++) { ascii_chars[c] = c; } __Pyx_sys_getdefaultencoding_not_ascii = 1; ascii_chars_u = PyUnicode_DecodeASCII(ascii_chars, 128, NULL); if (!ascii_chars_u) goto bad; ascii_chars_b = PyUnicode_AsEncodedString(ascii_chars_u, default_encoding_c, NULL); if (!ascii_chars_b || !PyBytes_Check(ascii_chars_b) || memcmp(ascii_chars, PyBytes_AS_STRING(ascii_chars_b), 128) != 0) { PyErr_Format( PyExc_ValueError, "This module compiled with c_string_encoding=ascii, but default encoding '%.200s' is not a superset of ascii.", default_encoding_c); goto bad; } Py_DECREF(ascii_chars_u); Py_DECREF(ascii_chars_b); } Py_DECREF(default_encoding); return 0; bad: Py_XDECREF(default_encoding); Py_XDECREF(ascii_chars_u); Py_XDECREF(ascii_chars_b); return -1; } #endif #if __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT && PY_MAJOR_VERSION >= 3 #define __Pyx_PyUnicode_FromStringAndSize(c_str, size) PyUnicode_DecodeUTF8(c_str, size, NULL) #else #define __Pyx_PyUnicode_FromStringAndSize(c_str, size) PyUnicode_Decode(c_str, size, __PYX_DEFAULT_STRING_ENCODING, NULL) #if __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT static char* __PYX_DEFAULT_STRING_ENCODING; static int __Pyx_init_sys_getdefaultencoding_params(void) { PyObject* sys; PyObject* default_encoding = NULL; char* default_encoding_c; sys = PyImport_ImportModule("sys"); if (!sys) goto bad; default_encoding = PyObject_CallMethod(sys, (char*) (const char*) "getdefaultencoding", NULL); Py_DECREF(sys); if (!default_encoding) goto bad; default_encoding_c = PyBytes_AsString(default_encoding); if (!default_encoding_c) goto bad; __PYX_DEFAULT_STRING_ENCODING = (char*) malloc(strlen(default_encoding_c)); if (!__PYX_DEFAULT_STRING_ENCODING) goto bad; strcpy(__PYX_DEFAULT_STRING_ENCODING, default_encoding_c); Py_DECREF(default_encoding); return 0; bad: Py_XDECREF(default_encoding); return -1; } #endif #endif /* Test for GCC > 2.95 */ #if defined(__GNUC__) && (__GNUC__ > 2 || (__GNUC__ == 2 && (__GNUC_MINOR__ > 95))) #define likely(x) __builtin_expect(!!(x), 1) #define unlikely(x) __builtin_expect(!!(x), 0) #else /* !__GNUC__ or GCC < 2.95 */ #define likely(x) (x) #define unlikely(x) (x) #endif /* __GNUC__ */ static PyObject *__pyx_m; static PyObject *__pyx_d; static PyObject *__pyx_b; static PyObject *__pyx_empty_tuple; static PyObject *__pyx_empty_bytes; static int __pyx_lineno; static int __pyx_clineno = 0; static const char * __pyx_cfilenm= __FILE__; static const char *__pyx_filename; static const char *__pyx_f[] = { "src/pygame_sdl2/transform.pyx", "src/pygame_sdl2/surface.pxd", }; /*--- Type declarations ---*/ struct __pyx_obj_11pygame_sdl2_7surface_Surface; /* "pygame_sdl2/surface.pxd":23 * from sdl2 cimport SDL_Surface * * cdef class Surface: # <<<<<<<<<<<<<< * # Allow weak references. * cdef object __weakref__ */ struct __pyx_obj_11pygame_sdl2_7surface_Surface { PyObject_HEAD struct __pyx_vtabstruct_11pygame_sdl2_7surface_Surface *__pyx_vtab; PyObject *__weakref__; SDL_Surface *surface; int owns_surface; int window_surface; PyObject *locklist; struct __pyx_obj_11pygame_sdl2_7surface_Surface *parent; struct __pyx_obj_11pygame_sdl2_7surface_Surface *root; int offset_x; int offset_y; PyObject *get_window_flags; int has_alpha; }; struct __pyx_vtabstruct_11pygame_sdl2_7surface_Surface { void (*take_surface)(struct __pyx_obj_11pygame_sdl2_7surface_Surface *, SDL_Surface *); }; static struct __pyx_vtabstruct_11pygame_sdl2_7surface_Surface *__pyx_vtabptr_11pygame_sdl2_7surface_Surface; /* --- Runtime support code (head) --- */ #ifndef CYTHON_REFNANNY #define CYTHON_REFNANNY 0 #endif #if CYTHON_REFNANNY typedef struct { void (*INCREF)(void*, PyObject*, int); void (*DECREF)(void*, PyObject*, int); void (*GOTREF)(void*, PyObject*, int); void (*GIVEREF)(void*, PyObject*, int); void* (*SetupContext)(const char*, int, const char*); void (*FinishContext)(void**); } __Pyx_RefNannyAPIStruct; static __Pyx_RefNannyAPIStruct *__Pyx_RefNanny = NULL; static __Pyx_RefNannyAPIStruct *__Pyx_RefNannyImportAPI(const char *modname); #define __Pyx_RefNannyDeclarations void *__pyx_refnanny = NULL; #ifdef WITH_THREAD #define __Pyx_RefNannySetupContext(name, acquire_gil)\ if (acquire_gil) {\ PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure();\ __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), __LINE__, __FILE__);\ PyGILState_Release(__pyx_gilstate_save);\ } else {\ __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), __LINE__, __FILE__);\ } #else #define __Pyx_RefNannySetupContext(name, acquire_gil)\ __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), __LINE__, __FILE__) #endif #define __Pyx_RefNannyFinishContext()\ __Pyx_RefNanny->FinishContext(&__pyx_refnanny) #define __Pyx_INCREF(r) __Pyx_RefNanny->INCREF(__pyx_refnanny, (PyObject *)(r), __LINE__) #define __Pyx_DECREF(r) __Pyx_RefNanny->DECREF(__pyx_refnanny, (PyObject *)(r), __LINE__) #define __Pyx_GOTREF(r) __Pyx_RefNanny->GOTREF(__pyx_refnanny, (PyObject *)(r), __LINE__) #define __Pyx_GIVEREF(r) __Pyx_RefNanny->GIVEREF(__pyx_refnanny, (PyObject *)(r), __LINE__) #define __Pyx_XINCREF(r) do { if((r) != NULL) {__Pyx_INCREF(r); }} while(0) #define __Pyx_XDECREF(r) do { if((r) != NULL) {__Pyx_DECREF(r); }} while(0) #define __Pyx_XGOTREF(r) do { if((r) != NULL) {__Pyx_GOTREF(r); }} while(0) #define __Pyx_XGIVEREF(r) do { if((r) != NULL) {__Pyx_GIVEREF(r);}} while(0) #else #define __Pyx_RefNannyDeclarations #define __Pyx_RefNannySetupContext(name, acquire_gil) #define __Pyx_RefNannyFinishContext() #define __Pyx_INCREF(r) Py_INCREF(r) #define __Pyx_DECREF(r) Py_DECREF(r) #define __Pyx_GOTREF(r) #define __Pyx_GIVEREF(r) #define __Pyx_XINCREF(r) Py_XINCREF(r) #define __Pyx_XDECREF(r) Py_XDECREF(r) #define __Pyx_XGOTREF(r) #define __Pyx_XGIVEREF(r) #endif #define __Pyx_XDECREF_SET(r, v) do {\ PyObject *tmp = (PyObject *) r;\ r = v; __Pyx_XDECREF(tmp);\ } while (0) #define __Pyx_DECREF_SET(r, v) do {\ PyObject *tmp = (PyObject *) r;\ r = v; __Pyx_DECREF(tmp);\ } while (0) #define __Pyx_CLEAR(r) do { PyObject* tmp = ((PyObject*)(r)); r = NULL; __Pyx_DECREF(tmp);} while(0) #define __Pyx_XCLEAR(r) do { if((r) != NULL) {PyObject* tmp = ((PyObject*)(r)); r = NULL; __Pyx_DECREF(tmp);}} while(0) #if CYTHON_COMPILING_IN_CPYTHON static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStr(PyObject* obj, PyObject* attr_name) { PyTypeObject* tp = Py_TYPE(obj); if (likely(tp->tp_getattro)) return tp->tp_getattro(obj, attr_name); #if PY_MAJOR_VERSION < 3 if (likely(tp->tp_getattr)) return tp->tp_getattr(obj, PyString_AS_STRING(attr_name)); #endif return PyObject_GetAttr(obj, attr_name); } #else #define __Pyx_PyObject_GetAttrStr(o,n) PyObject_GetAttr(o,n) #endif static PyObject *__Pyx_GetBuiltinName(PyObject *name); static void __Pyx_RaiseArgtupleInvalid(const char* func_name, int exact, Py_ssize_t num_min, Py_ssize_t num_max, Py_ssize_t num_found); static void __Pyx_RaiseDoubleKeywordsError(const char* func_name, PyObject* kw_name); static int __Pyx_ParseOptionalKeywords(PyObject *kwds, PyObject **argnames[],\ PyObject *kwds2, PyObject *values[], Py_ssize_t num_pos_args,\ const char* function_name); static CYTHON_INLINE int __Pyx_ArgTypeTest(PyObject *obj, PyTypeObject *type, int none_allowed, const char *name, int exact); #if CYTHON_COMPILING_IN_CPYTHON static CYTHON_INLINE PyObject* __Pyx_PyObject_Call(PyObject *func, PyObject *arg, PyObject *kw); #else #define __Pyx_PyObject_Call(func, arg, kw) PyObject_Call(func, arg, kw) #endif #if CYTHON_COMPILING_IN_CPYTHON static CYTHON_INLINE PyObject* __Pyx_PyObject_CallMethO(PyObject *func, PyObject *arg); #endif static CYTHON_INLINE PyObject* __Pyx_PyObject_CallOneArg(PyObject *func, PyObject *arg); #if CYTHON_COMPILING_IN_CPYTHON static CYTHON_INLINE PyObject* __Pyx_PyObject_CallNoArg(PyObject *func); #else #define __Pyx_PyObject_CallNoArg(func) __Pyx_PyObject_Call(func, __pyx_empty_tuple, NULL) #endif static CYTHON_INLINE PyObject *__Pyx_GetModuleGlobalName(PyObject *name); static CYTHON_INLINE void __Pyx_ErrRestore(PyObject *type, PyObject *value, PyObject *tb); static CYTHON_INLINE void __Pyx_ErrFetch(PyObject **type, PyObject **value, PyObject **tb); static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, PyObject *cause); #ifndef __PYX_FORCE_INIT_THREADS #define __PYX_FORCE_INIT_THREADS 0 #endif static void __Pyx_WriteUnraisable(const char *name, int clineno, int lineno, const char *filename, int full_traceback, int nogil); static CYTHON_INLINE void __Pyx_RaiseTooManyValuesError(Py_ssize_t expected); static CYTHON_INLINE void __Pyx_RaiseNeedMoreValuesError(Py_ssize_t index); static CYTHON_INLINE int __Pyx_IterFinish(void); static int __Pyx_IternextUnpackEndCheck(PyObject *retval, Py_ssize_t expected); #define __Pyx_GetItemInt(o, i, type, is_signed, to_py_func, is_list, wraparound, boundscheck)\ (__Pyx_fits_Py_ssize_t(i, type, is_signed) ?\ __Pyx_GetItemInt_Fast(o, (Py_ssize_t)i, is_list, wraparound, boundscheck) :\ (is_list ? (PyErr_SetString(PyExc_IndexError, "list index out of range"), (PyObject*)NULL) :\ __Pyx_GetItemInt_Generic(o, to_py_func(i)))) #define __Pyx_GetItemInt_List(o, i, type, is_signed, to_py_func, is_list, wraparound, boundscheck)\ (__Pyx_fits_Py_ssize_t(i, type, is_signed) ?\ __Pyx_GetItemInt_List_Fast(o, (Py_ssize_t)i, wraparound, boundscheck) :\ (PyErr_SetString(PyExc_IndexError, "list index out of range"), (PyObject*)NULL)) static CYTHON_INLINE PyObject *__Pyx_GetItemInt_List_Fast(PyObject *o, Py_ssize_t i, int wraparound, int boundscheck); #define __Pyx_GetItemInt_Tuple(o, i, type, is_signed, to_py_func, is_list, wraparound, boundscheck)\ (__Pyx_fits_Py_ssize_t(i, type, is_signed) ?\ __Pyx_GetItemInt_Tuple_Fast(o, (Py_ssize_t)i, wraparound, boundscheck) :\ (PyErr_SetString(PyExc_IndexError, "tuple index out of range"), (PyObject*)NULL)) static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Tuple_Fast(PyObject *o, Py_ssize_t i, int wraparound, int boundscheck); static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Generic(PyObject *o, PyObject* j); static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Fast(PyObject *o, Py_ssize_t i, int is_list, int wraparound, int boundscheck); static void* __Pyx_GetVtable(PyObject *dict); static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list, int level); static PyObject* __Pyx_ImportFrom(PyObject* module, PyObject* name); typedef struct { int code_line; PyCodeObject* code_object; } __Pyx_CodeObjectCacheEntry; struct __Pyx_CodeObjectCache { int count; int max_count; __Pyx_CodeObjectCacheEntry* entries; }; static struct __Pyx_CodeObjectCache __pyx_code_cache = {0,0,NULL}; static int __pyx_bisect_code_objects(__Pyx_CodeObjectCacheEntry* entries, int count, int code_line); static PyCodeObject *__pyx_find_code_object(int code_line); static void __pyx_insert_code_object(int code_line, PyCodeObject* code_object); static void __Pyx_AddTraceback(const char *funcname, int c_line, int py_line, const char *filename); static CYTHON_INLINE int __Pyx_PyInt_As_int(PyObject *); static CYTHON_INLINE PyObject* __Pyx_PyInt_From_int(int value); static CYTHON_INLINE PyObject* __Pyx_PyInt_From_long(long value); static CYTHON_INLINE long __Pyx_PyInt_As_long(PyObject *); static int __Pyx_check_binary_version(void); #if !defined(__Pyx_PyIdentifier_FromString) #if PY_MAJOR_VERSION < 3 #define __Pyx_PyIdentifier_FromString(s) PyString_FromString(s) #else #define __Pyx_PyIdentifier_FromString(s) PyUnicode_FromString(s) #endif #endif static PyObject *__Pyx_ImportModule(const char *name); static PyTypeObject *__Pyx_ImportType(const char *module_name, const char *class_name, size_t size, int strict); static int __Pyx_InitStrings(__Pyx_StringTabEntry *t); /* Module declarations from 'libc.stdint' */ /* Module declarations from 'libc.string' */ /* Module declarations from 'libc.stdio' */ /* Module declarations from 'libc.stddef' */ /* Module declarations from 'sdl2' */ /* Module declarations from 'sdl2_gfx' */ /* Module declarations from 'pygame_sdl2.surface' */ static PyTypeObject *__pyx_ptype_11pygame_sdl2_7surface_Surface = 0; /* Module declarations from 'pygame_sdl2.transform' */ static uint32_t __pyx_f_11pygame_sdl2_9transform_get_at(SDL_Surface *, int, int); /*proto*/ static void __pyx_f_11pygame_sdl2_9transform_set_at(SDL_Surface *, int, int, uint32_t); /*proto*/ #define __Pyx_MODULE_NAME "pygame_sdl2.transform" int __pyx_module_is_main_pygame_sdl2__transform = 0; /* Implementation of 'pygame_sdl2.transform' */ static PyObject *__pyx_builtin_range; static char __pyx_k_a[] = "a"; static char __pyx_k_b[] = "b"; static char __pyx_k_c[] = "c"; static char __pyx_k_d[] = "d"; static char __pyx_k_e[] = "e"; static char __pyx_k_f[] = "f"; static char __pyx_k_g[] = "g"; static char __pyx_k_h[] = "h"; static char __pyx_k_i[] = "i"; static char __pyx_k_x[] = "x"; static char __pyx_k_y[] = "y"; static char __pyx_k_e0[] = "e0"; static char __pyx_k_e1[] = "e1"; static char __pyx_k_e2[] = "e2"; static char __pyx_k_e3[] = "e3"; static char __pyx_k_rv[] = "rv"; static char __pyx_k_err[] = "err"; static char __pyx_k_src[] = "src"; static char __pyx_k_dest[] = "dest"; static char __pyx_k_flip[] = "flip"; static char __pyx_k_lock[] = "lock"; static char __pyx_k_main[] = "__main__"; static char __pyx_k_size[] = "size"; static char __pyx_k_test[] = "__test__"; static char __pyx_k_angle[] = "angle"; static char __pyx_k_error[] = "error"; static char __pyx_k_range[] = "range"; static char __pyx_k_rsurf[] = "rsurf"; static char __pyx_k_scale[] = "scale"; static char __pyx_k_width[] = "width"; static char __pyx_k_xbool[] = "xbool"; static char __pyx_k_ybool[] = "ybool"; static char __pyx_k_height[] = "height"; static char __pyx_k_import[] = "__import__"; static char __pyx_k_rotate[] = "rotate"; static char __pyx_k_smooth[] = "smooth"; static char __pyx_k_unlock[] = "unlock"; static char __pyx_k_scale2x[] = "scale2x"; static char __pyx_k_scale_x[] = "scale_x"; static char __pyx_k_scale_y[] = "scale_y"; static char __pyx_k_src_end[] = "src_end"; static char __pyx_k_surface[] = "surface"; static char __pyx_k_get_size[] = "get_size"; static char __pyx_k_rotozoom[] = "rotozoom"; static char __pyx_k_surf_out[] = "surf_out"; static char __pyx_k_get_flags[] = "get_flags"; static char __pyx_k_get_width[] = "get_width"; static char __pyx_k_src_pixel[] = "src_pixel"; static char __pyx_k_dest_delta[] = "dest_delta"; static char __pyx_k_dest_pixel[] = "dest_pixel"; static char __pyx_k_get_height[] = "get_height"; static char __pyx_k_pyx_vtable[] = "__pyx_vtable__"; static char __pyx_k_DestSurface[] = "DestSurface"; static char __pyx_k_smoothscale[] = "smoothscale"; static char __pyx_k_get_bytesize[] = "get_bytesize"; static char __pyx_k_pygame_sdl2_error[] = "pygame_sdl2.error"; static char __pyx_k_pygame_sdl2_transform[] = "pygame_sdl2.transform"; static char __pyx_k_home_tom_ab_pygame_sdl2_src_pyg[] = "/home/tom/ab/pygame_sdl2/src/pygame_sdl2/transform.pyx"; static char __pyx_k_Surface_has_unsupported_bytesize[] = "Surface has unsupported bytesize."; static PyObject *__pyx_n_s_DestSurface; static PyObject *__pyx_kp_u_Surface_has_unsupported_bytesize; static PyObject *__pyx_n_s_a; static PyObject *__pyx_n_s_angle; static PyObject *__pyx_n_s_b; static PyObject *__pyx_n_s_c; static PyObject *__pyx_n_s_d; static PyObject *__pyx_n_s_dest; static PyObject *__pyx_n_s_dest_delta; static PyObject *__pyx_n_s_dest_pixel; static PyObject *__pyx_n_s_e; static PyObject *__pyx_n_s_e0; static PyObject *__pyx_n_s_e1; static PyObject *__pyx_n_s_e2; static PyObject *__pyx_n_s_e3; static PyObject *__pyx_n_s_err; static PyObject *__pyx_n_s_error; static PyObject *__pyx_n_s_f; static PyObject *__pyx_n_s_flip; static PyObject *__pyx_n_s_g; static PyObject *__pyx_n_s_get_bytesize; static PyObject *__pyx_n_s_get_flags; static PyObject *__pyx_n_s_get_height; static PyObject *__pyx_n_s_get_size; static PyObject *__pyx_n_s_get_width; static PyObject *__pyx_n_s_h; static PyObject *__pyx_n_s_height; static PyObject *__pyx_kp_s_home_tom_ab_pygame_sdl2_src_pyg; static PyObject *__pyx_n_s_i; static PyObject *__pyx_n_s_import; static PyObject *__pyx_n_s_lock; static PyObject *__pyx_n_s_main; static PyObject *__pyx_n_s_pygame_sdl2_error; static PyObject *__pyx_n_s_pygame_sdl2_transform; static PyObject *__pyx_n_s_pyx_vtable; static PyObject *__pyx_n_s_range; static PyObject *__pyx_n_s_rotate; static PyObject *__pyx_n_s_rotozoom; static PyObject *__pyx_n_s_rsurf; static PyObject *__pyx_n_s_rv; static PyObject *__pyx_n_s_scale; static PyObject *__pyx_n_s_scale2x; static PyObject *__pyx_n_s_scale_x; static PyObject *__pyx_n_s_scale_y; static PyObject *__pyx_n_s_size; static PyObject *__pyx_n_s_smooth; static PyObject *__pyx_n_s_smoothscale; static PyObject *__pyx_n_s_src; static PyObject *__pyx_n_s_src_end; static PyObject *__pyx_n_s_src_pixel; static PyObject *__pyx_n_s_surf_out; static PyObject *__pyx_n_s_surface; static PyObject *__pyx_n_s_test; static PyObject *__pyx_n_s_unlock; static PyObject *__pyx_n_s_width; static PyObject *__pyx_n_s_x; static PyObject *__pyx_n_s_xbool; static PyObject *__pyx_n_s_y; static PyObject *__pyx_n_s_ybool; static PyObject *__pyx_pf_11pygame_sdl2_9transform_flip(CYTHON_UNUSED PyObject *__pyx_self, struct __pyx_obj_11pygame_sdl2_7surface_Surface *__pyx_v_surface, int __pyx_v_xbool, int __pyx_v_ybool); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_9transform_2scale(CYTHON_UNUSED PyObject *__pyx_self, struct __pyx_obj_11pygame_sdl2_7surface_Surface *__pyx_v_surface, PyObject *__pyx_v_size, struct __pyx_obj_11pygame_sdl2_7surface_Surface *__pyx_v_DestSurface); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_9transform_4rotate(CYTHON_UNUSED PyObject *__pyx_self, struct __pyx_obj_11pygame_sdl2_7surface_Surface *__pyx_v_surface, PyObject *__pyx_v_angle); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_9transform_6rotozoom(CYTHON_UNUSED PyObject *__pyx_self, struct __pyx_obj_11pygame_sdl2_7surface_Surface *__pyx_v_surface, double __pyx_v_angle, double __pyx_v_scale, int __pyx_v_smooth); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_9transform_8scale2x(CYTHON_UNUSED PyObject *__pyx_self, struct __pyx_obj_11pygame_sdl2_7surface_Surface *__pyx_v_surface, struct __pyx_obj_11pygame_sdl2_7surface_Surface *__pyx_v_DestSurface); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_9transform_10smoothscale(CYTHON_UNUSED PyObject *__pyx_self, struct __pyx_obj_11pygame_sdl2_7surface_Surface *__pyx_v_surface, PyObject *__pyx_v_size, struct __pyx_obj_11pygame_sdl2_7surface_Surface *__pyx_v_DestSurface); /* proto */ static PyObject *__pyx_float_1_0; static PyObject *__pyx_int_0; static PyObject *__pyx_int_2; static PyObject *__pyx_int_4; static PyObject *__pyx_tuple_; static PyObject *__pyx_tuple__2; static PyObject *__pyx_tuple__3; static PyObject *__pyx_tuple__4; static PyObject *__pyx_tuple__6; static PyObject *__pyx_tuple__8; static PyObject *__pyx_tuple__10; static PyObject *__pyx_tuple__12; static PyObject *__pyx_tuple__14; static PyObject *__pyx_codeobj__5; static PyObject *__pyx_codeobj__7; static PyObject *__pyx_codeobj__9; static PyObject *__pyx_codeobj__11; static PyObject *__pyx_codeobj__13; static PyObject *__pyx_codeobj__15; /* "pygame_sdl2/transform.pyx":26 * * * def flip(Surface surface, bint xbool, bint ybool): # <<<<<<<<<<<<<< * * cdef Surface rv = Surface(surface.get_size(), surface.get_flags(), surface) */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_9transform_1flip(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static PyMethodDef __pyx_mdef_11pygame_sdl2_9transform_1flip = {"flip", (PyCFunction)__pyx_pw_11pygame_sdl2_9transform_1flip, METH_VARARGS|METH_KEYWORDS, 0}; static PyObject *__pyx_pw_11pygame_sdl2_9transform_1flip(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { struct __pyx_obj_11pygame_sdl2_7surface_Surface *__pyx_v_surface = 0; int __pyx_v_xbool; int __pyx_v_ybool; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("flip (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_surface,&__pyx_n_s_xbool,&__pyx_n_s_ybool,0}; PyObject* values[3] = {0,0,0}; if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_surface)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; case 1: if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_xbool)) != 0)) kw_args--; else { __Pyx_RaiseArgtupleInvalid("flip", 1, 3, 3, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 26; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } case 2: if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_ybool)) != 0)) kw_args--; else { __Pyx_RaiseArgtupleInvalid("flip", 1, 3, 3, 2); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 26; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "flip") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 26; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } } else if (PyTuple_GET_SIZE(__pyx_args) != 3) { goto __pyx_L5_argtuple_error; } else { values[0] = PyTuple_GET_ITEM(__pyx_args, 0); values[1] = PyTuple_GET_ITEM(__pyx_args, 1); values[2] = PyTuple_GET_ITEM(__pyx_args, 2); } __pyx_v_surface = ((struct __pyx_obj_11pygame_sdl2_7surface_Surface *)values[0]); __pyx_v_xbool = __Pyx_PyObject_IsTrue(values[1]); if (unlikely((__pyx_v_xbool == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 26; __pyx_clineno = __LINE__; goto __pyx_L3_error;} __pyx_v_ybool = __Pyx_PyObject_IsTrue(values[2]); if (unlikely((__pyx_v_ybool == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 26; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("flip", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 26; __pyx_clineno = __LINE__; goto __pyx_L3_error;} __pyx_L3_error:; __Pyx_AddTraceback("pygame_sdl2.transform.flip", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_surface), __pyx_ptype_11pygame_sdl2_7surface_Surface, 1, "surface", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 26; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_r = __pyx_pf_11pygame_sdl2_9transform_flip(__pyx_self, __pyx_v_surface, __pyx_v_xbool, __pyx_v_ybool); /* function exit code */ goto __pyx_L0; __pyx_L1_error:; __pyx_r = NULL; __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_9transform_flip(CYTHON_UNUSED PyObject *__pyx_self, struct __pyx_obj_11pygame_sdl2_7surface_Surface *__pyx_v_surface, int __pyx_v_xbool, int __pyx_v_ybool) { struct __pyx_obj_11pygame_sdl2_7surface_Surface *__pyx_v_rv = 0; SDL_Surface *__pyx_v_src; SDL_Surface *__pyx_v_dest; Uint32 *__pyx_v_src_pixel; Uint32 *__pyx_v_src_end; Uint32 *__pyx_v_dest_pixel; int __pyx_v_dest_delta; int __pyx_v_y; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; SDL_Surface *__pyx_t_5; int __pyx_t_6; int __pyx_t_7; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("flip", 0); /* "pygame_sdl2/transform.pyx":28 * def flip(Surface surface, bint xbool, bint ybool): * * cdef Surface rv = Surface(surface.get_size(), surface.get_flags(), surface) # <<<<<<<<<<<<<< * cdef SDL_Surface *src = surface.surface * cdef SDL_Surface *dest = rv.surface */ __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_surface), __pyx_n_s_get_size); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 28; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = NULL; if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_2))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); if (likely(__pyx_t_3)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); } } if (__pyx_t_3) { __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 28; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } else { __pyx_t_1 = __Pyx_PyObject_CallNoArg(__pyx_t_2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 28; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_surface), __pyx_n_s_get_flags); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 28; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = NULL; if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_3))) { __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3); if (likely(__pyx_t_4)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); __Pyx_INCREF(__pyx_t_4); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_3, function); } } if (__pyx_t_4) { __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 28; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; } else { __pyx_t_2 = __Pyx_PyObject_CallNoArg(__pyx_t_3); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 28; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_3 = PyTuple_New(3); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 28; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __Pyx_GIVEREF(__pyx_t_1); PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_1); __Pyx_GIVEREF(__pyx_t_2); PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_2); __Pyx_INCREF(((PyObject *)__pyx_v_surface)); __Pyx_GIVEREF(((PyObject *)__pyx_v_surface)); PyTuple_SET_ITEM(__pyx_t_3, 2, ((PyObject *)__pyx_v_surface)); __pyx_t_1 = 0; __pyx_t_2 = 0; __pyx_t_2 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_11pygame_sdl2_7surface_Surface), __pyx_t_3, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 28; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_v_rv = ((struct __pyx_obj_11pygame_sdl2_7surface_Surface *)__pyx_t_2); __pyx_t_2 = 0; /* "pygame_sdl2/transform.pyx":29 * * cdef Surface rv = Surface(surface.get_size(), surface.get_flags(), surface) * cdef SDL_Surface *src = surface.surface # <<<<<<<<<<<<<< * cdef SDL_Surface *dest = rv.surface * */ __pyx_t_5 = __pyx_v_surface->surface; __pyx_v_src = __pyx_t_5; /* "pygame_sdl2/transform.pyx":30 * cdef Surface rv = Surface(surface.get_size(), surface.get_flags(), surface) * cdef SDL_Surface *src = surface.surface * cdef SDL_Surface *dest = rv.surface # <<<<<<<<<<<<<< * * cdef Uint32 *src_pixel */ __pyx_t_5 = __pyx_v_rv->surface; __pyx_v_dest = __pyx_t_5; /* "pygame_sdl2/transform.pyx":40 * cdef int y * * with nogil: # <<<<<<<<<<<<<< * for 0 <= y < src.h: * */ { #ifdef WITH_THREAD PyThreadState *_save; Py_UNBLOCK_THREADS #endif /*try:*/ { /* "pygame_sdl2/transform.pyx":41 * * with nogil: * for 0 <= y < src.h: # <<<<<<<<<<<<<< * * src_pixel = (( src.pixels) + y * src.pitch) */ __pyx_t_6 = __pyx_v_src->h; for (__pyx_v_y = 0; __pyx_v_y < __pyx_t_6; __pyx_v_y++) { /* "pygame_sdl2/transform.pyx":43 * for 0 <= y < src.h: * * src_pixel = (( src.pixels) + y * src.pitch) # <<<<<<<<<<<<<< * src_end = src_pixel + src.w * */ __pyx_v_src_pixel = ((Uint32 *)(((Uint8 *)__pyx_v_src->pixels) + (__pyx_v_y * __pyx_v_src->pitch))); /* "pygame_sdl2/transform.pyx":44 * * src_pixel = (( src.pixels) + y * src.pitch) * src_end = src_pixel + src.w # <<<<<<<<<<<<<< * * if ybool: */ __pyx_v_src_end = (__pyx_v_src_pixel + __pyx_v_src->w); /* "pygame_sdl2/transform.pyx":46 * src_end = src_pixel + src.w * * if ybool: # <<<<<<<<<<<<<< * dest_pixel = (( dest.pixels) + (dest.h - y - 1) * dest.pitch) * else: */ __pyx_t_7 = (__pyx_v_ybool != 0); if (__pyx_t_7) { /* "pygame_sdl2/transform.pyx":47 * * if ybool: * dest_pixel = (( dest.pixels) + (dest.h - y - 1) * dest.pitch) # <<<<<<<<<<<<<< * else: * dest_pixel = (( dest.pixels) + y * dest.pitch) */ __pyx_v_dest_pixel = ((Uint32 *)(((Uint8 *)__pyx_v_dest->pixels) + (((__pyx_v_dest->h - __pyx_v_y) - 1) * __pyx_v_dest->pitch))); /* "pygame_sdl2/transform.pyx":46 * src_end = src_pixel + src.w * * if ybool: # <<<<<<<<<<<<<< * dest_pixel = (( dest.pixels) + (dest.h - y - 1) * dest.pitch) * else: */ goto __pyx_L8; } /* "pygame_sdl2/transform.pyx":49 * dest_pixel = (( dest.pixels) + (dest.h - y - 1) * dest.pitch) * else: * dest_pixel = (( dest.pixels) + y * dest.pitch) # <<<<<<<<<<<<<< * * if xbool: */ /*else*/ { __pyx_v_dest_pixel = ((Uint32 *)(((Uint8 *)__pyx_v_dest->pixels) + (__pyx_v_y * __pyx_v_dest->pitch))); } __pyx_L8:; /* "pygame_sdl2/transform.pyx":51 * dest_pixel = (( dest.pixels) + y * dest.pitch) * * if xbool: # <<<<<<<<<<<<<< * dest_pixel += (src.w - 1) * dest_delta = -1 */ __pyx_t_7 = (__pyx_v_xbool != 0); if (__pyx_t_7) { /* "pygame_sdl2/transform.pyx":52 * * if xbool: * dest_pixel += (src.w - 1) # <<<<<<<<<<<<<< * dest_delta = -1 * else: */ __pyx_v_dest_pixel = (__pyx_v_dest_pixel + (__pyx_v_src->w - 1)); /* "pygame_sdl2/transform.pyx":53 * if xbool: * dest_pixel += (src.w - 1) * dest_delta = -1 # <<<<<<<<<<<<<< * else: * dest_delta = 1 */ __pyx_v_dest_delta = -1; /* "pygame_sdl2/transform.pyx":51 * dest_pixel = (( dest.pixels) + y * dest.pitch) * * if xbool: # <<<<<<<<<<<<<< * dest_pixel += (src.w - 1) * dest_delta = -1 */ goto __pyx_L9; } /* "pygame_sdl2/transform.pyx":55 * dest_delta = -1 * else: * dest_delta = 1 # <<<<<<<<<<<<<< * * while src_pixel < src_end: */ /*else*/ { __pyx_v_dest_delta = 1; } __pyx_L9:; /* "pygame_sdl2/transform.pyx":57 * dest_delta = 1 * * while src_pixel < src_end: # <<<<<<<<<<<<<< * dest_pixel[0] = src_pixel[0] * src_pixel += 1 */ while (1) { __pyx_t_7 = ((__pyx_v_src_pixel < __pyx_v_src_end) != 0); if (!__pyx_t_7) break; /* "pygame_sdl2/transform.pyx":58 * * while src_pixel < src_end: * dest_pixel[0] = src_pixel[0] # <<<<<<<<<<<<<< * src_pixel += 1 * dest_pixel += dest_delta */ (__pyx_v_dest_pixel[0]) = (__pyx_v_src_pixel[0]); /* "pygame_sdl2/transform.pyx":59 * while src_pixel < src_end: * dest_pixel[0] = src_pixel[0] * src_pixel += 1 # <<<<<<<<<<<<<< * dest_pixel += dest_delta * */ __pyx_v_src_pixel = (__pyx_v_src_pixel + 1); /* "pygame_sdl2/transform.pyx":60 * dest_pixel[0] = src_pixel[0] * src_pixel += 1 * dest_pixel += dest_delta # <<<<<<<<<<<<<< * * return rv */ __pyx_v_dest_pixel = (__pyx_v_dest_pixel + __pyx_v_dest_delta); } } } /* "pygame_sdl2/transform.pyx":40 * cdef int y * * with nogil: # <<<<<<<<<<<<<< * for 0 <= y < src.h: * */ /*finally:*/ { /*normal exit:*/{ #ifdef WITH_THREAD Py_BLOCK_THREADS #endif goto __pyx_L5; } __pyx_L5:; } } /* "pygame_sdl2/transform.pyx":62 * dest_pixel += dest_delta * * return rv # <<<<<<<<<<<<<< * * */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(((PyObject *)__pyx_v_rv)); __pyx_r = ((PyObject *)__pyx_v_rv); goto __pyx_L0; /* "pygame_sdl2/transform.pyx":26 * * * def flip(Surface surface, bint xbool, bint ybool): # <<<<<<<<<<<<<< * * cdef Surface rv = Surface(surface.get_size(), surface.get_flags(), surface) */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_AddTraceback("pygame_sdl2.transform.flip", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF((PyObject *)__pyx_v_rv); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/transform.pyx":65 * * * def scale(Surface surface, size, Surface DestSurface=None): # <<<<<<<<<<<<<< * cdef Surface surf_out * cdef int err = -1 */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_9transform_3scale(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static PyMethodDef __pyx_mdef_11pygame_sdl2_9transform_3scale = {"scale", (PyCFunction)__pyx_pw_11pygame_sdl2_9transform_3scale, METH_VARARGS|METH_KEYWORDS, 0}; static PyObject *__pyx_pw_11pygame_sdl2_9transform_3scale(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { struct __pyx_obj_11pygame_sdl2_7surface_Surface *__pyx_v_surface = 0; PyObject *__pyx_v_size = 0; struct __pyx_obj_11pygame_sdl2_7surface_Surface *__pyx_v_DestSurface = 0; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("scale (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_surface,&__pyx_n_s_size,&__pyx_n_s_DestSurface,0}; PyObject* values[3] = {0,0,0}; values[2] = (PyObject *)((struct __pyx_obj_11pygame_sdl2_7surface_Surface *)Py_None); if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_surface)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; case 1: if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_size)) != 0)) kw_args--; else { __Pyx_RaiseArgtupleInvalid("scale", 0, 2, 3, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 65; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } case 2: if (kw_args > 0) { PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_DestSurface); if (value) { values[2] = value; kw_args--; } } } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "scale") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 65; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } } else { switch (PyTuple_GET_SIZE(__pyx_args)) { case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); values[0] = PyTuple_GET_ITEM(__pyx_args, 0); break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_surface = ((struct __pyx_obj_11pygame_sdl2_7surface_Surface *)values[0]); __pyx_v_size = values[1]; __pyx_v_DestSurface = ((struct __pyx_obj_11pygame_sdl2_7surface_Surface *)values[2]); } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("scale", 0, 2, 3, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 65; __pyx_clineno = __LINE__; goto __pyx_L3_error;} __pyx_L3_error:; __Pyx_AddTraceback("pygame_sdl2.transform.scale", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_surface), __pyx_ptype_11pygame_sdl2_7surface_Surface, 1, "surface", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 65; __pyx_clineno = __LINE__; goto __pyx_L1_error;} if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_DestSurface), __pyx_ptype_11pygame_sdl2_7surface_Surface, 1, "DestSurface", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 65; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_r = __pyx_pf_11pygame_sdl2_9transform_2scale(__pyx_self, __pyx_v_surface, __pyx_v_size, __pyx_v_DestSurface); /* function exit code */ goto __pyx_L0; __pyx_L1_error:; __pyx_r = NULL; __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_9transform_2scale(CYTHON_UNUSED PyObject *__pyx_self, struct __pyx_obj_11pygame_sdl2_7surface_Surface *__pyx_v_surface, PyObject *__pyx_v_size, struct __pyx_obj_11pygame_sdl2_7surface_Surface *__pyx_v_DestSurface) { struct __pyx_obj_11pygame_sdl2_7surface_Surface *__pyx_v_surf_out = 0; int __pyx_v_err; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_t_2; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("scale", 0); /* "pygame_sdl2/transform.pyx":67 * def scale(Surface surface, size, Surface DestSurface=None): * cdef Surface surf_out * cdef int err = -1 # <<<<<<<<<<<<<< * * if DestSurface == None: */ __pyx_v_err = -1; /* "pygame_sdl2/transform.pyx":69 * cdef int err = -1 * * if DestSurface == None: # <<<<<<<<<<<<<< * surf_out = Surface(size, 0, surface) * else: */ __pyx_t_1 = PyObject_RichCompare(((PyObject *)__pyx_v_DestSurface), Py_None, Py_EQ); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 69; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 69; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (__pyx_t_2) { /* "pygame_sdl2/transform.pyx":70 * * if DestSurface == None: * surf_out = Surface(size, 0, surface) # <<<<<<<<<<<<<< * else: * surf_out = DestSurface */ __pyx_t_1 = PyTuple_New(3); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 70; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __Pyx_INCREF(__pyx_v_size); __Pyx_GIVEREF(__pyx_v_size); PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_size); __Pyx_INCREF(__pyx_int_0); __Pyx_GIVEREF(__pyx_int_0); PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_int_0); __Pyx_INCREF(((PyObject *)__pyx_v_surface)); __Pyx_GIVEREF(((PyObject *)__pyx_v_surface)); PyTuple_SET_ITEM(__pyx_t_1, 2, ((PyObject *)__pyx_v_surface)); __pyx_t_3 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_11pygame_sdl2_7surface_Surface), __pyx_t_1, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 70; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_v_surf_out = ((struct __pyx_obj_11pygame_sdl2_7surface_Surface *)__pyx_t_3); __pyx_t_3 = 0; /* "pygame_sdl2/transform.pyx":69 * cdef int err = -1 * * if DestSurface == None: # <<<<<<<<<<<<<< * surf_out = Surface(size, 0, surface) * else: */ goto __pyx_L3; } /* "pygame_sdl2/transform.pyx":72 * surf_out = Surface(size, 0, surface) * else: * surf_out = DestSurface # <<<<<<<<<<<<<< * * with nogil: */ /*else*/ { __Pyx_INCREF(((PyObject *)__pyx_v_DestSurface)); __pyx_v_surf_out = __pyx_v_DestSurface; } __pyx_L3:; /* "pygame_sdl2/transform.pyx":74 * surf_out = DestSurface * * with nogil: # <<<<<<<<<<<<<< * SDL_SetSurfaceBlendMode(surface.surface, SDL_BLENDMODE_NONE) * err = SDL_UpperBlitScaled(surface.surface, NULL, surf_out.surface, NULL) */ { #ifdef WITH_THREAD PyThreadState *_save; Py_UNBLOCK_THREADS #endif /*try:*/ { /* "pygame_sdl2/transform.pyx":75 * * with nogil: * SDL_SetSurfaceBlendMode(surface.surface, SDL_BLENDMODE_NONE) # <<<<<<<<<<<<<< * err = SDL_UpperBlitScaled(surface.surface, NULL, surf_out.surface, NULL) * */ SDL_SetSurfaceBlendMode(__pyx_v_surface->surface, SDL_BLENDMODE_NONE); /* "pygame_sdl2/transform.pyx":76 * with nogil: * SDL_SetSurfaceBlendMode(surface.surface, SDL_BLENDMODE_NONE) * err = SDL_UpperBlitScaled(surface.surface, NULL, surf_out.surface, NULL) # <<<<<<<<<<<<<< * * if err != 0: */ __pyx_v_err = SDL_UpperBlitScaled(__pyx_v_surface->surface, NULL, __pyx_v_surf_out->surface, NULL); } /* "pygame_sdl2/transform.pyx":74 * surf_out = DestSurface * * with nogil: # <<<<<<<<<<<<<< * SDL_SetSurfaceBlendMode(surface.surface, SDL_BLENDMODE_NONE) * err = SDL_UpperBlitScaled(surface.surface, NULL, surf_out.surface, NULL) */ /*finally:*/ { /*normal exit:*/{ #ifdef WITH_THREAD Py_BLOCK_THREADS #endif goto __pyx_L6; } __pyx_L6:; } } /* "pygame_sdl2/transform.pyx":78 * err = SDL_UpperBlitScaled(surface.surface, NULL, surf_out.surface, NULL) * * if err != 0: # <<<<<<<<<<<<<< * raise error() * */ __pyx_t_2 = ((__pyx_v_err != 0) != 0); if (__pyx_t_2) { /* "pygame_sdl2/transform.pyx":79 * * if err != 0: * raise error() # <<<<<<<<<<<<<< * * return surf_out */ __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_error); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 79; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_t_4 = NULL; if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_1))) { __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_1); if (likely(__pyx_t_4)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1); __Pyx_INCREF(__pyx_t_4); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_1, function); } } if (__pyx_t_4) { __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_t_1, __pyx_t_4); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 79; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; } else { __pyx_t_3 = __Pyx_PyObject_CallNoArg(__pyx_t_1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 79; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_Raise(__pyx_t_3, 0, 0, 0); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; {__pyx_filename = __pyx_f[0]; __pyx_lineno = 79; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "pygame_sdl2/transform.pyx":78 * err = SDL_UpperBlitScaled(surface.surface, NULL, surf_out.surface, NULL) * * if err != 0: # <<<<<<<<<<<<<< * raise error() * */ } /* "pygame_sdl2/transform.pyx":81 * raise error() * * return surf_out # <<<<<<<<<<<<<< * * def rotate(Surface surface, angle): */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(((PyObject *)__pyx_v_surf_out)); __pyx_r = ((PyObject *)__pyx_v_surf_out); goto __pyx_L0; /* "pygame_sdl2/transform.pyx":65 * * * def scale(Surface surface, size, Surface DestSurface=None): # <<<<<<<<<<<<<< * cdef Surface surf_out * cdef int err = -1 */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_AddTraceback("pygame_sdl2.transform.scale", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF((PyObject *)__pyx_v_surf_out); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/transform.pyx":83 * return surf_out * * def rotate(Surface surface, angle): # <<<<<<<<<<<<<< * # rotateSurface90Degrees always returns NULL without setting an error?? * # cdef SDL_Surface *rsurf */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_9transform_5rotate(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static PyMethodDef __pyx_mdef_11pygame_sdl2_9transform_5rotate = {"rotate", (PyCFunction)__pyx_pw_11pygame_sdl2_9transform_5rotate, METH_VARARGS|METH_KEYWORDS, 0}; static PyObject *__pyx_pw_11pygame_sdl2_9transform_5rotate(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { struct __pyx_obj_11pygame_sdl2_7surface_Surface *__pyx_v_surface = 0; PyObject *__pyx_v_angle = 0; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("rotate (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_surface,&__pyx_n_s_angle,0}; PyObject* values[2] = {0,0}; if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_surface)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; case 1: if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_angle)) != 0)) kw_args--; else { __Pyx_RaiseArgtupleInvalid("rotate", 1, 2, 2, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 83; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "rotate") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 83; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } } else if (PyTuple_GET_SIZE(__pyx_args) != 2) { goto __pyx_L5_argtuple_error; } else { values[0] = PyTuple_GET_ITEM(__pyx_args, 0); values[1] = PyTuple_GET_ITEM(__pyx_args, 1); } __pyx_v_surface = ((struct __pyx_obj_11pygame_sdl2_7surface_Surface *)values[0]); __pyx_v_angle = values[1]; } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("rotate", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 83; __pyx_clineno = __LINE__; goto __pyx_L3_error;} __pyx_L3_error:; __Pyx_AddTraceback("pygame_sdl2.transform.rotate", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_surface), __pyx_ptype_11pygame_sdl2_7surface_Surface, 1, "surface", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 83; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_r = __pyx_pf_11pygame_sdl2_9transform_4rotate(__pyx_self, __pyx_v_surface, __pyx_v_angle); /* function exit code */ goto __pyx_L0; __pyx_L1_error:; __pyx_r = NULL; __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_9transform_4rotate(CYTHON_UNUSED PyObject *__pyx_self, struct __pyx_obj_11pygame_sdl2_7surface_Surface *__pyx_v_surface, PyObject *__pyx_v_angle) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; Py_ssize_t __pyx_t_5; PyObject *__pyx_t_6 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("rotate", 0); /* "pygame_sdl2/transform.pyx":90 * # if rsurf == NULL: * # raise error() * return rotozoom(surface, angle, 1.0, SMOOTHING_OFF) # <<<<<<<<<<<<<< * * def rotozoom(Surface surface, double angle, double scale, int smooth=1): */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_rotozoom); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 90; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = __Pyx_PyInt_From_int(SMOOTHING_OFF); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 90; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = NULL; __pyx_t_5 = 0; if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_2))) { __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_2); if (likely(__pyx_t_4)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_4); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); __pyx_t_5 = 1; } } __pyx_t_6 = PyTuple_New(4+__pyx_t_5); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 90; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_6); if (__pyx_t_4) { __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_4); __pyx_t_4 = NULL; } __Pyx_INCREF(((PyObject *)__pyx_v_surface)); __Pyx_GIVEREF(((PyObject *)__pyx_v_surface)); PyTuple_SET_ITEM(__pyx_t_6, 0+__pyx_t_5, ((PyObject *)__pyx_v_surface)); __Pyx_INCREF(__pyx_v_angle); __Pyx_GIVEREF(__pyx_v_angle); PyTuple_SET_ITEM(__pyx_t_6, 1+__pyx_t_5, __pyx_v_angle); __Pyx_INCREF(__pyx_float_1_0); __Pyx_GIVEREF(__pyx_float_1_0); PyTuple_SET_ITEM(__pyx_t_6, 2+__pyx_t_5, __pyx_float_1_0); __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_6, 3+__pyx_t_5, __pyx_t_3); __pyx_t_3 = 0; __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_6, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 90; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "pygame_sdl2/transform.pyx":83 * return surf_out * * def rotate(Surface surface, angle): # <<<<<<<<<<<<<< * # rotateSurface90Degrees always returns NULL without setting an error?? * # cdef SDL_Surface *rsurf */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_6); __Pyx_AddTraceback("pygame_sdl2.transform.rotate", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/transform.pyx":92 * return rotozoom(surface, angle, 1.0, SMOOTHING_OFF) * * def rotozoom(Surface surface, double angle, double scale, int smooth=1): # <<<<<<<<<<<<<< * cdef SDL_Surface *rsurf = NULL * cdef Surface rv */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_9transform_7rotozoom(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static PyMethodDef __pyx_mdef_11pygame_sdl2_9transform_7rotozoom = {"rotozoom", (PyCFunction)__pyx_pw_11pygame_sdl2_9transform_7rotozoom, METH_VARARGS|METH_KEYWORDS, 0}; static PyObject *__pyx_pw_11pygame_sdl2_9transform_7rotozoom(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { struct __pyx_obj_11pygame_sdl2_7surface_Surface *__pyx_v_surface = 0; double __pyx_v_angle; double __pyx_v_scale; int __pyx_v_smooth; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("rotozoom (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_surface,&__pyx_n_s_angle,&__pyx_n_s_scale,&__pyx_n_s_smooth,0}; PyObject* values[4] = {0,0,0,0}; if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_surface)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; case 1: if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_angle)) != 0)) kw_args--; else { __Pyx_RaiseArgtupleInvalid("rotozoom", 0, 3, 4, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 92; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } case 2: if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_scale)) != 0)) kw_args--; else { __Pyx_RaiseArgtupleInvalid("rotozoom", 0, 3, 4, 2); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 92; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } case 3: if (kw_args > 0) { PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_smooth); if (value) { values[3] = value; kw_args--; } } } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "rotozoom") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 92; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } } else { switch (PyTuple_GET_SIZE(__pyx_args)) { case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); values[1] = PyTuple_GET_ITEM(__pyx_args, 1); values[0] = PyTuple_GET_ITEM(__pyx_args, 0); break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_surface = ((struct __pyx_obj_11pygame_sdl2_7surface_Surface *)values[0]); __pyx_v_angle = __pyx_PyFloat_AsDouble(values[1]); if (unlikely((__pyx_v_angle == (double)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 92; __pyx_clineno = __LINE__; goto __pyx_L3_error;} __pyx_v_scale = __pyx_PyFloat_AsDouble(values[2]); if (unlikely((__pyx_v_scale == (double)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 92; __pyx_clineno = __LINE__; goto __pyx_L3_error;} if (values[3]) { __pyx_v_smooth = __Pyx_PyInt_As_int(values[3]); if (unlikely((__pyx_v_smooth == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 92; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } else { __pyx_v_smooth = ((int)1); } } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("rotozoom", 0, 3, 4, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 92; __pyx_clineno = __LINE__; goto __pyx_L3_error;} __pyx_L3_error:; __Pyx_AddTraceback("pygame_sdl2.transform.rotozoom", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_surface), __pyx_ptype_11pygame_sdl2_7surface_Surface, 1, "surface", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 92; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_r = __pyx_pf_11pygame_sdl2_9transform_6rotozoom(__pyx_self, __pyx_v_surface, __pyx_v_angle, __pyx_v_scale, __pyx_v_smooth); /* function exit code */ goto __pyx_L0; __pyx_L1_error:; __pyx_r = NULL; __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_9transform_6rotozoom(CYTHON_UNUSED PyObject *__pyx_self, struct __pyx_obj_11pygame_sdl2_7surface_Surface *__pyx_v_surface, double __pyx_v_angle, double __pyx_v_scale, int __pyx_v_smooth) { SDL_Surface *__pyx_v_rsurf; struct __pyx_obj_11pygame_sdl2_7surface_Surface *__pyx_v_rv = 0; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("rotozoom", 0); /* "pygame_sdl2/transform.pyx":93 * * def rotozoom(Surface surface, double angle, double scale, int smooth=1): * cdef SDL_Surface *rsurf = NULL # <<<<<<<<<<<<<< * cdef Surface rv * */ __pyx_v_rsurf = NULL; /* "pygame_sdl2/transform.pyx":96 * cdef Surface rv * * with nogil: # <<<<<<<<<<<<<< * rsurf = rotozoomSurface(surface.surface, angle, scale, smooth) * */ { #ifdef WITH_THREAD PyThreadState *_save; Py_UNBLOCK_THREADS #endif /*try:*/ { /* "pygame_sdl2/transform.pyx":97 * * with nogil: * rsurf = rotozoomSurface(surface.surface, angle, scale, smooth) # <<<<<<<<<<<<<< * * if rsurf == NULL: */ __pyx_v_rsurf = rotozoomSurface(__pyx_v_surface->surface, __pyx_v_angle, __pyx_v_scale, __pyx_v_smooth); } /* "pygame_sdl2/transform.pyx":96 * cdef Surface rv * * with nogil: # <<<<<<<<<<<<<< * rsurf = rotozoomSurface(surface.surface, angle, scale, smooth) * */ /*finally:*/ { /*normal exit:*/{ #ifdef WITH_THREAD Py_BLOCK_THREADS #endif goto __pyx_L5; } __pyx_L5:; } } /* "pygame_sdl2/transform.pyx":99 * rsurf = rotozoomSurface(surface.surface, angle, scale, smooth) * * if rsurf == NULL: # <<<<<<<<<<<<<< * raise error() * */ __pyx_t_1 = ((__pyx_v_rsurf == NULL) != 0); if (__pyx_t_1) { /* "pygame_sdl2/transform.pyx":100 * * if rsurf == NULL: * raise error() # <<<<<<<<<<<<<< * * rv = Surface(()) */ __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_error); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 100; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = NULL; if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_3))) { __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3); if (likely(__pyx_t_4)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); __Pyx_INCREF(__pyx_t_4); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_3, function); } } if (__pyx_t_4) { __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 100; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; } else { __pyx_t_2 = __Pyx_PyObject_CallNoArg(__pyx_t_3); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 100; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_Raise(__pyx_t_2, 0, 0, 0); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; {__pyx_filename = __pyx_f[0]; __pyx_lineno = 100; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "pygame_sdl2/transform.pyx":99 * rsurf = rotozoomSurface(surface.surface, angle, scale, smooth) * * if rsurf == NULL: # <<<<<<<<<<<<<< * raise error() * */ } /* "pygame_sdl2/transform.pyx":102 * raise error() * * rv = Surface(()) # <<<<<<<<<<<<<< * rv.take_surface(rsurf) * */ __pyx_t_2 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_11pygame_sdl2_7surface_Surface), __pyx_tuple_, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 102; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __pyx_v_rv = ((struct __pyx_obj_11pygame_sdl2_7surface_Surface *)__pyx_t_2); __pyx_t_2 = 0; /* "pygame_sdl2/transform.pyx":103 * * rv = Surface(()) * rv.take_surface(rsurf) # <<<<<<<<<<<<<< * * return rv */ ((struct __pyx_vtabstruct_11pygame_sdl2_7surface_Surface *)__pyx_v_rv->__pyx_vtab)->take_surface(__pyx_v_rv, __pyx_v_rsurf); /* "pygame_sdl2/transform.pyx":105 * rv.take_surface(rsurf) * * return rv # <<<<<<<<<<<<<< * * cdef uint32_t get_at(SDL_Surface *surf, int x, int y) nogil: */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(((PyObject *)__pyx_v_rv)); __pyx_r = ((PyObject *)__pyx_v_rv); goto __pyx_L0; /* "pygame_sdl2/transform.pyx":92 * return rotozoom(surface, angle, 1.0, SMOOTHING_OFF) * * def rotozoom(Surface surface, double angle, double scale, int smooth=1): # <<<<<<<<<<<<<< * cdef SDL_Surface *rsurf = NULL * cdef Surface rv */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_AddTraceback("pygame_sdl2.transform.rotozoom", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF((PyObject *)__pyx_v_rv); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/transform.pyx":107 * return rv * * cdef uint32_t get_at(SDL_Surface *surf, int x, int y) nogil: # <<<<<<<<<<<<<< * if x < 0: * x = 0 */ static uint32_t __pyx_f_11pygame_sdl2_9transform_get_at(SDL_Surface *__pyx_v_surf, int __pyx_v_x, int __pyx_v_y) { uint32_t *__pyx_v_p; uint32_t __pyx_r; int __pyx_t_1; size_t __pyx_t_2; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; /* "pygame_sdl2/transform.pyx":108 * * cdef uint32_t get_at(SDL_Surface *surf, int x, int y) nogil: * if x < 0: # <<<<<<<<<<<<<< * x = 0 * elif x >= surf.w: */ __pyx_t_1 = ((__pyx_v_x < 0) != 0); if (__pyx_t_1) { /* "pygame_sdl2/transform.pyx":109 * cdef uint32_t get_at(SDL_Surface *surf, int x, int y) nogil: * if x < 0: * x = 0 # <<<<<<<<<<<<<< * elif x >= surf.w: * x = surf.w - 1 */ __pyx_v_x = 0; /* "pygame_sdl2/transform.pyx":108 * * cdef uint32_t get_at(SDL_Surface *surf, int x, int y) nogil: * if x < 0: # <<<<<<<<<<<<<< * x = 0 * elif x >= surf.w: */ goto __pyx_L3; } /* "pygame_sdl2/transform.pyx":110 * if x < 0: * x = 0 * elif x >= surf.w: # <<<<<<<<<<<<<< * x = surf.w - 1 * if y < 0: */ __pyx_t_1 = ((__pyx_v_x >= __pyx_v_surf->w) != 0); if (__pyx_t_1) { /* "pygame_sdl2/transform.pyx":111 * x = 0 * elif x >= surf.w: * x = surf.w - 1 # <<<<<<<<<<<<<< * if y < 0: * y = 0 */ __pyx_v_x = (__pyx_v_surf->w - 1); /* "pygame_sdl2/transform.pyx":110 * if x < 0: * x = 0 * elif x >= surf.w: # <<<<<<<<<<<<<< * x = surf.w - 1 * if y < 0: */ } __pyx_L3:; /* "pygame_sdl2/transform.pyx":112 * elif x >= surf.w: * x = surf.w - 1 * if y < 0: # <<<<<<<<<<<<<< * y = 0 * elif y >= surf.h: */ __pyx_t_1 = ((__pyx_v_y < 0) != 0); if (__pyx_t_1) { /* "pygame_sdl2/transform.pyx":113 * x = surf.w - 1 * if y < 0: * y = 0 # <<<<<<<<<<<<<< * elif y >= surf.h: * y = surf.h - 1 */ __pyx_v_y = 0; /* "pygame_sdl2/transform.pyx":112 * elif x >= surf.w: * x = surf.w - 1 * if y < 0: # <<<<<<<<<<<<<< * y = 0 * elif y >= surf.h: */ goto __pyx_L4; } /* "pygame_sdl2/transform.pyx":114 * if y < 0: * y = 0 * elif y >= surf.h: # <<<<<<<<<<<<<< * y = surf.h - 1 * */ __pyx_t_1 = ((__pyx_v_y >= __pyx_v_surf->h) != 0); if (__pyx_t_1) { /* "pygame_sdl2/transform.pyx":115 * y = 0 * elif y >= surf.h: * y = surf.h - 1 # <<<<<<<<<<<<<< * * cdef uint32_t *p = surf.pixels */ __pyx_v_y = (__pyx_v_surf->h - 1); /* "pygame_sdl2/transform.pyx":114 * if y < 0: * y = 0 * elif y >= surf.h: # <<<<<<<<<<<<<< * y = surf.h - 1 * */ } __pyx_L4:; /* "pygame_sdl2/transform.pyx":117 * y = surf.h - 1 * * cdef uint32_t *p = surf.pixels # <<<<<<<<<<<<<< * p += y * (surf.pitch // sizeof(uint32_t)) * p += x */ __pyx_v_p = ((uint32_t *)__pyx_v_surf->pixels); /* "pygame_sdl2/transform.pyx":118 * * cdef uint32_t *p = surf.pixels * p += y * (surf.pitch // sizeof(uint32_t)) # <<<<<<<<<<<<<< * p += x * return p[0] */ __pyx_t_2 = (sizeof(uint32_t)); if (unlikely(__pyx_t_2 == 0)) { #ifdef WITH_THREAD PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure(); #endif PyErr_SetString(PyExc_ZeroDivisionError, "integer division or modulo by zero"); #ifdef WITH_THREAD PyGILState_Release(__pyx_gilstate_save); #endif {__pyx_filename = __pyx_f[0]; __pyx_lineno = 118; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } __pyx_v_p = (__pyx_v_p + (__pyx_v_y * (__pyx_v_surf->pitch / __pyx_t_2))); /* "pygame_sdl2/transform.pyx":119 * cdef uint32_t *p = surf.pixels * p += y * (surf.pitch // sizeof(uint32_t)) * p += x # <<<<<<<<<<<<<< * return p[0] * */ __pyx_v_p = (__pyx_v_p + __pyx_v_x); /* "pygame_sdl2/transform.pyx":120 * p += y * (surf.pitch // sizeof(uint32_t)) * p += x * return p[0] # <<<<<<<<<<<<<< * * cdef void set_at(SDL_Surface *surf, int x, int y, uint32_t color) nogil: */ __pyx_r = (__pyx_v_p[0]); goto __pyx_L0; /* "pygame_sdl2/transform.pyx":107 * return rv * * cdef uint32_t get_at(SDL_Surface *surf, int x, int y) nogil: # <<<<<<<<<<<<<< * if x < 0: * x = 0 */ /* function exit code */ __pyx_L1_error:; __Pyx_WriteUnraisable("pygame_sdl2.transform.get_at", __pyx_clineno, __pyx_lineno, __pyx_filename, 0, 1); __pyx_r = 0; __pyx_L0:; return __pyx_r; } /* "pygame_sdl2/transform.pyx":122 * return p[0] * * cdef void set_at(SDL_Surface *surf, int x, int y, uint32_t color) nogil: # <<<<<<<<<<<<<< * cdef uint32_t *p = surf.pixels * p += y * (surf.pitch // sizeof(uint32_t)) */ static void __pyx_f_11pygame_sdl2_9transform_set_at(SDL_Surface *__pyx_v_surf, int __pyx_v_x, int __pyx_v_y, uint32_t __pyx_v_color) { uint32_t *__pyx_v_p; size_t __pyx_t_1; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; /* "pygame_sdl2/transform.pyx":123 * * cdef void set_at(SDL_Surface *surf, int x, int y, uint32_t color) nogil: * cdef uint32_t *p = surf.pixels # <<<<<<<<<<<<<< * p += y * (surf.pitch // sizeof(uint32_t)) * p += x */ __pyx_v_p = ((uint32_t *)__pyx_v_surf->pixels); /* "pygame_sdl2/transform.pyx":124 * cdef void set_at(SDL_Surface *surf, int x, int y, uint32_t color) nogil: * cdef uint32_t *p = surf.pixels * p += y * (surf.pitch // sizeof(uint32_t)) # <<<<<<<<<<<<<< * p += x * p[0] = color */ __pyx_t_1 = (sizeof(uint32_t)); if (unlikely(__pyx_t_1 == 0)) { #ifdef WITH_THREAD PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure(); #endif PyErr_SetString(PyExc_ZeroDivisionError, "integer division or modulo by zero"); #ifdef WITH_THREAD PyGILState_Release(__pyx_gilstate_save); #endif {__pyx_filename = __pyx_f[0]; __pyx_lineno = 124; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } __pyx_v_p = (__pyx_v_p + (__pyx_v_y * (__pyx_v_surf->pitch / __pyx_t_1))); /* "pygame_sdl2/transform.pyx":125 * cdef uint32_t *p = surf.pixels * p += y * (surf.pitch // sizeof(uint32_t)) * p += x # <<<<<<<<<<<<<< * p[0] = color * */ __pyx_v_p = (__pyx_v_p + __pyx_v_x); /* "pygame_sdl2/transform.pyx":126 * p += y * (surf.pitch // sizeof(uint32_t)) * p += x * p[0] = color # <<<<<<<<<<<<<< * * def scale2x(Surface surface, Surface DestSurface=None): */ (__pyx_v_p[0]) = __pyx_v_color; /* "pygame_sdl2/transform.pyx":122 * return p[0] * * cdef void set_at(SDL_Surface *surf, int x, int y, uint32_t color) nogil: # <<<<<<<<<<<<<< * cdef uint32_t *p = surf.pixels * p += y * (surf.pitch // sizeof(uint32_t)) */ /* function exit code */ goto __pyx_L0; __pyx_L1_error:; __Pyx_WriteUnraisable("pygame_sdl2.transform.set_at", __pyx_clineno, __pyx_lineno, __pyx_filename, 0, 1); __pyx_L0:; } /* "pygame_sdl2/transform.pyx":128 * p[0] = color * * def scale2x(Surface surface, Surface DestSurface=None): # <<<<<<<<<<<<<< * cdef int x, y * */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_9transform_9scale2x(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static PyMethodDef __pyx_mdef_11pygame_sdl2_9transform_9scale2x = {"scale2x", (PyCFunction)__pyx_pw_11pygame_sdl2_9transform_9scale2x, METH_VARARGS|METH_KEYWORDS, 0}; static PyObject *__pyx_pw_11pygame_sdl2_9transform_9scale2x(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { struct __pyx_obj_11pygame_sdl2_7surface_Surface *__pyx_v_surface = 0; struct __pyx_obj_11pygame_sdl2_7surface_Surface *__pyx_v_DestSurface = 0; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("scale2x (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_surface,&__pyx_n_s_DestSurface,0}; PyObject* values[2] = {0,0}; values[1] = (PyObject *)((struct __pyx_obj_11pygame_sdl2_7surface_Surface *)Py_None); if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_surface)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; case 1: if (kw_args > 0) { PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_DestSurface); if (value) { values[1] = value; kw_args--; } } } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "scale2x") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 128; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } } else { switch (PyTuple_GET_SIZE(__pyx_args)) { case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_surface = ((struct __pyx_obj_11pygame_sdl2_7surface_Surface *)values[0]); __pyx_v_DestSurface = ((struct __pyx_obj_11pygame_sdl2_7surface_Surface *)values[1]); } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("scale2x", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 128; __pyx_clineno = __LINE__; goto __pyx_L3_error;} __pyx_L3_error:; __Pyx_AddTraceback("pygame_sdl2.transform.scale2x", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_surface), __pyx_ptype_11pygame_sdl2_7surface_Surface, 1, "surface", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 128; __pyx_clineno = __LINE__; goto __pyx_L1_error;} if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_DestSurface), __pyx_ptype_11pygame_sdl2_7surface_Surface, 1, "DestSurface", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 128; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_r = __pyx_pf_11pygame_sdl2_9transform_8scale2x(__pyx_self, __pyx_v_surface, __pyx_v_DestSurface); /* function exit code */ goto __pyx_L0; __pyx_L1_error:; __pyx_r = NULL; __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_9transform_8scale2x(CYTHON_UNUSED PyObject *__pyx_self, struct __pyx_obj_11pygame_sdl2_7surface_Surface *__pyx_v_surface, struct __pyx_obj_11pygame_sdl2_7surface_Surface *__pyx_v_DestSurface) { int __pyx_v_x; int __pyx_v_y; CYTHON_UNUSED uint32_t __pyx_v_a; uint32_t __pyx_v_b; CYTHON_UNUSED uint32_t __pyx_v_c; uint32_t __pyx_v_d; uint32_t __pyx_v_e; uint32_t __pyx_v_f; CYTHON_UNUSED uint32_t __pyx_v_g; uint32_t __pyx_v_h; CYTHON_UNUSED uint32_t __pyx_v_i; uint32_t __pyx_v_e0; uint32_t __pyx_v_e1; uint32_t __pyx_v_e2; uint32_t __pyx_v_e3; struct __pyx_obj_11pygame_sdl2_7surface_Surface *__pyx_v_surf_out = 0; int __pyx_v_width; int __pyx_v_height; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; int __pyx_t_4; PyObject *__pyx_t_5 = NULL; PyObject *(*__pyx_t_6)(PyObject *); int __pyx_t_7; int __pyx_t_8; int __pyx_t_9; int __pyx_t_10; int __pyx_t_11; uint32_t __pyx_t_12; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("scale2x", 0); /* "pygame_sdl2/transform.pyx":134 * cdef uint32_t e0, e1, e2, e3 * * if surface.get_bytesize() != 4: # <<<<<<<<<<<<<< * raise error("Surface has unsupported bytesize.") * */ __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_surface), __pyx_n_s_get_bytesize); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 134; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = NULL; if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_2))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); if (likely(__pyx_t_3)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); } } if (__pyx_t_3) { __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 134; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } else { __pyx_t_1 = __Pyx_PyObject_CallNoArg(__pyx_t_2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 134; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_2 = PyObject_RichCompare(__pyx_t_1, __pyx_int_4, Py_NE); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 134; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_4 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 134; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; if (__pyx_t_4) { /* "pygame_sdl2/transform.pyx":135 * * if surface.get_bytesize() != 4: * raise error("Surface has unsupported bytesize.") # <<<<<<<<<<<<<< * * cdef Surface surf_out = DestSurface */ __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_error); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 135; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_tuple__2, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 135; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_Raise(__pyx_t_1, 0, 0, 0); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; {__pyx_filename = __pyx_f[0]; __pyx_lineno = 135; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "pygame_sdl2/transform.pyx":134 * cdef uint32_t e0, e1, e2, e3 * * if surface.get_bytesize() != 4: # <<<<<<<<<<<<<< * raise error("Surface has unsupported bytesize.") * */ } /* "pygame_sdl2/transform.pyx":137 * raise error("Surface has unsupported bytesize.") * * cdef Surface surf_out = DestSurface # <<<<<<<<<<<<<< * if surf_out == None: * surf_out = Surface((surface.get_width()*2, surface.get_height()*2), 0, surface) */ __Pyx_INCREF(((PyObject *)__pyx_v_DestSurface)); __pyx_v_surf_out = __pyx_v_DestSurface; /* "pygame_sdl2/transform.pyx":138 * * cdef Surface surf_out = DestSurface * if surf_out == None: # <<<<<<<<<<<<<< * surf_out = Surface((surface.get_width()*2, surface.get_height()*2), 0, surface) * */ __pyx_t_1 = PyObject_RichCompare(((PyObject *)__pyx_v_surf_out), Py_None, Py_EQ); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 138; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_4 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 138; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (__pyx_t_4) { /* "pygame_sdl2/transform.pyx":139 * cdef Surface surf_out = DestSurface * if surf_out == None: * surf_out = Surface((surface.get_width()*2, surface.get_height()*2), 0, surface) # <<<<<<<<<<<<<< * * surface.lock() */ __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_surface), __pyx_n_s_get_width); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 139; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = NULL; if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_2))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); if (likely(__pyx_t_3)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); } } if (__pyx_t_3) { __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 139; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } else { __pyx_t_1 = __Pyx_PyObject_CallNoArg(__pyx_t_2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 139; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_2 = PyNumber_Multiply(__pyx_t_1, __pyx_int_2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 139; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_surface), __pyx_n_s_get_height); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 139; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __pyx_t_5 = NULL; if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_3))) { __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_3); if (likely(__pyx_t_5)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); __Pyx_INCREF(__pyx_t_5); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_3, function); } } if (__pyx_t_5) { __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_5); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 139; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; } else { __pyx_t_1 = __Pyx_PyObject_CallNoArg(__pyx_t_3); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 139; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_3 = PyNumber_Multiply(__pyx_t_1, __pyx_int_2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 139; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 139; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __Pyx_GIVEREF(__pyx_t_2); PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_2); __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_t_3); __pyx_t_2 = 0; __pyx_t_3 = 0; __pyx_t_3 = PyTuple_New(3); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 139; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __Pyx_GIVEREF(__pyx_t_1); PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_1); __Pyx_INCREF(__pyx_int_0); __Pyx_GIVEREF(__pyx_int_0); PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_int_0); __Pyx_INCREF(((PyObject *)__pyx_v_surface)); __Pyx_GIVEREF(((PyObject *)__pyx_v_surface)); PyTuple_SET_ITEM(__pyx_t_3, 2, ((PyObject *)__pyx_v_surface)); __pyx_t_1 = 0; __pyx_t_1 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_11pygame_sdl2_7surface_Surface), __pyx_t_3, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 139; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF_SET(__pyx_v_surf_out, ((struct __pyx_obj_11pygame_sdl2_7surface_Surface *)__pyx_t_1)); __pyx_t_1 = 0; /* "pygame_sdl2/transform.pyx":138 * * cdef Surface surf_out = DestSurface * if surf_out == None: # <<<<<<<<<<<<<< * surf_out = Surface((surface.get_width()*2, surface.get_height()*2), 0, surface) * */ } /* "pygame_sdl2/transform.pyx":141 * surf_out = Surface((surface.get_width()*2, surface.get_height()*2), 0, surface) * * surface.lock() # <<<<<<<<<<<<<< * surf_out.lock() * */ __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_surface), __pyx_n_s_lock); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 141; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __pyx_t_2 = NULL; if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_3))) { __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_3); if (likely(__pyx_t_2)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); __Pyx_INCREF(__pyx_t_2); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_3, function); } } if (__pyx_t_2) { __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 141; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } else { __pyx_t_1 = __Pyx_PyObject_CallNoArg(__pyx_t_3); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 141; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "pygame_sdl2/transform.pyx":142 * * surface.lock() * surf_out.lock() # <<<<<<<<<<<<<< * * cdef int width, height */ __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_surf_out), __pyx_n_s_lock); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 142; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __pyx_t_2 = NULL; if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_3))) { __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_3); if (likely(__pyx_t_2)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); __Pyx_INCREF(__pyx_t_2); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_3, function); } } if (__pyx_t_2) { __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 142; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } else { __pyx_t_1 = __Pyx_PyObject_CallNoArg(__pyx_t_3); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 142; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "pygame_sdl2/transform.pyx":145 * * cdef int width, height * width, height = surface.get_size() # <<<<<<<<<<<<<< * * with nogil: */ __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_surface), __pyx_n_s_get_size); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 145; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __pyx_t_2 = NULL; if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_3))) { __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_3); if (likely(__pyx_t_2)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); __Pyx_INCREF(__pyx_t_2); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_3, function); } } if (__pyx_t_2) { __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 145; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } else { __pyx_t_1 = __Pyx_PyObject_CallNoArg(__pyx_t_3); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 145; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; if ((likely(PyTuple_CheckExact(__pyx_t_1))) || (PyList_CheckExact(__pyx_t_1))) { PyObject* sequence = __pyx_t_1; #if CYTHON_COMPILING_IN_CPYTHON Py_ssize_t size = Py_SIZE(sequence); #else Py_ssize_t size = PySequence_Size(sequence); #endif if (unlikely(size != 2)) { if (size > 2) __Pyx_RaiseTooManyValuesError(2); else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 145; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } #if CYTHON_COMPILING_IN_CPYTHON if (likely(PyTuple_CheckExact(sequence))) { __pyx_t_3 = PyTuple_GET_ITEM(sequence, 0); __pyx_t_2 = PyTuple_GET_ITEM(sequence, 1); } else { __pyx_t_3 = PyList_GET_ITEM(sequence, 0); __pyx_t_2 = PyList_GET_ITEM(sequence, 1); } __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(__pyx_t_2); #else __pyx_t_3 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 145; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __pyx_t_2 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 145; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); #endif __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; } else { Py_ssize_t index = -1; __pyx_t_5 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 145; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_6 = Py_TYPE(__pyx_t_5)->tp_iternext; index = 0; __pyx_t_3 = __pyx_t_6(__pyx_t_5); if (unlikely(!__pyx_t_3)) goto __pyx_L5_unpacking_failed; __Pyx_GOTREF(__pyx_t_3); index = 1; __pyx_t_2 = __pyx_t_6(__pyx_t_5); if (unlikely(!__pyx_t_2)) goto __pyx_L5_unpacking_failed; __Pyx_GOTREF(__pyx_t_2); if (__Pyx_IternextUnpackEndCheck(__pyx_t_6(__pyx_t_5), 2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 145; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_t_6 = NULL; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; goto __pyx_L6_unpacking_done; __pyx_L5_unpacking_failed:; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __pyx_t_6 = NULL; if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 145; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_L6_unpacking_done:; } __pyx_t_7 = __Pyx_PyInt_As_int(__pyx_t_3); if (unlikely((__pyx_t_7 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 145; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_8 = __Pyx_PyInt_As_int(__pyx_t_2); if (unlikely((__pyx_t_8 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 145; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_v_width = __pyx_t_7; __pyx_v_height = __pyx_t_8; /* "pygame_sdl2/transform.pyx":147 * width, height = surface.get_size() * * with nogil: # <<<<<<<<<<<<<< * for x in range(width): * for y in range(height): */ { #ifdef WITH_THREAD PyThreadState *_save; Py_UNBLOCK_THREADS #endif /*try:*/ { /* "pygame_sdl2/transform.pyx":148 * * with nogil: * for x in range(width): # <<<<<<<<<<<<<< * for y in range(height): * # Get the surrounding 9 pixels. */ __pyx_t_8 = __pyx_v_width; for (__pyx_t_7 = 0; __pyx_t_7 < __pyx_t_8; __pyx_t_7+=1) { __pyx_v_x = __pyx_t_7; /* "pygame_sdl2/transform.pyx":149 * with nogil: * for x in range(width): * for y in range(height): # <<<<<<<<<<<<<< * # Get the surrounding 9 pixels. * a = get_at(surface.surface, x - 1, y - 1) */ __pyx_t_9 = __pyx_v_height; for (__pyx_t_10 = 0; __pyx_t_10 < __pyx_t_9; __pyx_t_10+=1) { __pyx_v_y = __pyx_t_10; /* "pygame_sdl2/transform.pyx":151 * for y in range(height): * # Get the surrounding 9 pixels. * a = get_at(surface.surface, x - 1, y - 1) # <<<<<<<<<<<<<< * b = get_at(surface.surface, x, y - 1) * c = get_at(surface.surface, x + 1, y - 1) */ __pyx_v_a = __pyx_f_11pygame_sdl2_9transform_get_at(__pyx_v_surface->surface, (__pyx_v_x - 1), (__pyx_v_y - 1)); /* "pygame_sdl2/transform.pyx":152 * # Get the surrounding 9 pixels. * a = get_at(surface.surface, x - 1, y - 1) * b = get_at(surface.surface, x, y - 1) # <<<<<<<<<<<<<< * c = get_at(surface.surface, x + 1, y - 1) * */ __pyx_v_b = __pyx_f_11pygame_sdl2_9transform_get_at(__pyx_v_surface->surface, __pyx_v_x, (__pyx_v_y - 1)); /* "pygame_sdl2/transform.pyx":153 * a = get_at(surface.surface, x - 1, y - 1) * b = get_at(surface.surface, x, y - 1) * c = get_at(surface.surface, x + 1, y - 1) # <<<<<<<<<<<<<< * * d = get_at(surface.surface, x - 1, y) */ __pyx_v_c = __pyx_f_11pygame_sdl2_9transform_get_at(__pyx_v_surface->surface, (__pyx_v_x + 1), (__pyx_v_y - 1)); /* "pygame_sdl2/transform.pyx":155 * c = get_at(surface.surface, x + 1, y - 1) * * d = get_at(surface.surface, x - 1, y) # <<<<<<<<<<<<<< * e = get_at(surface.surface, x, y) * f = get_at(surface.surface, x + 1, y) */ __pyx_v_d = __pyx_f_11pygame_sdl2_9transform_get_at(__pyx_v_surface->surface, (__pyx_v_x - 1), __pyx_v_y); /* "pygame_sdl2/transform.pyx":156 * * d = get_at(surface.surface, x - 1, y) * e = get_at(surface.surface, x, y) # <<<<<<<<<<<<<< * f = get_at(surface.surface, x + 1, y) * */ __pyx_v_e = __pyx_f_11pygame_sdl2_9transform_get_at(__pyx_v_surface->surface, __pyx_v_x, __pyx_v_y); /* "pygame_sdl2/transform.pyx":157 * d = get_at(surface.surface, x - 1, y) * e = get_at(surface.surface, x, y) * f = get_at(surface.surface, x + 1, y) # <<<<<<<<<<<<<< * * g = get_at(surface.surface, x - 1, y + 1) */ __pyx_v_f = __pyx_f_11pygame_sdl2_9transform_get_at(__pyx_v_surface->surface, (__pyx_v_x + 1), __pyx_v_y); /* "pygame_sdl2/transform.pyx":159 * f = get_at(surface.surface, x + 1, y) * * g = get_at(surface.surface, x - 1, y + 1) # <<<<<<<<<<<<<< * h = get_at(surface.surface, x, y + 1) * i = get_at(surface.surface, x + 1, y + 1) */ __pyx_v_g = __pyx_f_11pygame_sdl2_9transform_get_at(__pyx_v_surface->surface, (__pyx_v_x - 1), (__pyx_v_y + 1)); /* "pygame_sdl2/transform.pyx":160 * * g = get_at(surface.surface, x - 1, y + 1) * h = get_at(surface.surface, x, y + 1) # <<<<<<<<<<<<<< * i = get_at(surface.surface, x + 1, y + 1) * */ __pyx_v_h = __pyx_f_11pygame_sdl2_9transform_get_at(__pyx_v_surface->surface, __pyx_v_x, (__pyx_v_y + 1)); /* "pygame_sdl2/transform.pyx":161 * g = get_at(surface.surface, x - 1, y + 1) * h = get_at(surface.surface, x, y + 1) * i = get_at(surface.surface, x + 1, y + 1) # <<<<<<<<<<<<<< * * # Expand the center pixel. */ __pyx_v_i = __pyx_f_11pygame_sdl2_9transform_get_at(__pyx_v_surface->surface, (__pyx_v_x + 1), (__pyx_v_y + 1)); /* "pygame_sdl2/transform.pyx":164 * * # Expand the center pixel. * if b != h and d != f: # <<<<<<<<<<<<<< * e0 = d if d == b else e * e1 = f if b == f else e */ __pyx_t_11 = ((__pyx_v_b != __pyx_v_h) != 0); if (__pyx_t_11) { } else { __pyx_t_4 = __pyx_t_11; goto __pyx_L15_bool_binop_done; } __pyx_t_11 = ((__pyx_v_d != __pyx_v_f) != 0); __pyx_t_4 = __pyx_t_11; __pyx_L15_bool_binop_done:; if (__pyx_t_4) { /* "pygame_sdl2/transform.pyx":165 * # Expand the center pixel. * if b != h and d != f: * e0 = d if d == b else e # <<<<<<<<<<<<<< * e1 = f if b == f else e * e2 = d if d == h else e */ if (((__pyx_v_d == __pyx_v_b) != 0)) { __pyx_t_12 = __pyx_v_d; } else { __pyx_t_12 = __pyx_v_e; } __pyx_v_e0 = __pyx_t_12; /* "pygame_sdl2/transform.pyx":166 * if b != h and d != f: * e0 = d if d == b else e * e1 = f if b == f else e # <<<<<<<<<<<<<< * e2 = d if d == h else e * e3 = f if h == f else e */ if (((__pyx_v_b == __pyx_v_f) != 0)) { __pyx_t_12 = __pyx_v_f; } else { __pyx_t_12 = __pyx_v_e; } __pyx_v_e1 = __pyx_t_12; /* "pygame_sdl2/transform.pyx":167 * e0 = d if d == b else e * e1 = f if b == f else e * e2 = d if d == h else e # <<<<<<<<<<<<<< * e3 = f if h == f else e * else: */ if (((__pyx_v_d == __pyx_v_h) != 0)) { __pyx_t_12 = __pyx_v_d; } else { __pyx_t_12 = __pyx_v_e; } __pyx_v_e2 = __pyx_t_12; /* "pygame_sdl2/transform.pyx":168 * e1 = f if b == f else e * e2 = d if d == h else e * e3 = f if h == f else e # <<<<<<<<<<<<<< * else: * e0 = e1 = e2 = e3 = e */ if (((__pyx_v_h == __pyx_v_f) != 0)) { __pyx_t_12 = __pyx_v_f; } else { __pyx_t_12 = __pyx_v_e; } __pyx_v_e3 = __pyx_t_12; /* "pygame_sdl2/transform.pyx":164 * * # Expand the center pixel. * if b != h and d != f: # <<<<<<<<<<<<<< * e0 = d if d == b else e * e1 = f if b == f else e */ goto __pyx_L14; } /* "pygame_sdl2/transform.pyx":170 * e3 = f if h == f else e * else: * e0 = e1 = e2 = e3 = e # <<<<<<<<<<<<<< * * set_at(surf_out.surface, x*2, y*2, e0) */ /*else*/ { __pyx_v_e0 = __pyx_v_e; __pyx_v_e1 = __pyx_v_e; __pyx_v_e2 = __pyx_v_e; __pyx_v_e3 = __pyx_v_e; } __pyx_L14:; /* "pygame_sdl2/transform.pyx":172 * e0 = e1 = e2 = e3 = e * * set_at(surf_out.surface, x*2, y*2, e0) # <<<<<<<<<<<<<< * set_at(surf_out.surface, (x*2)+1, y*2, e1) * set_at(surf_out.surface, x*2, (y*2)+1, e2) */ __pyx_f_11pygame_sdl2_9transform_set_at(__pyx_v_surf_out->surface, (__pyx_v_x * 2), (__pyx_v_y * 2), __pyx_v_e0); /* "pygame_sdl2/transform.pyx":173 * * set_at(surf_out.surface, x*2, y*2, e0) * set_at(surf_out.surface, (x*2)+1, y*2, e1) # <<<<<<<<<<<<<< * set_at(surf_out.surface, x*2, (y*2)+1, e2) * set_at(surf_out.surface, (x*2)+1, (y*2)+1, e3) */ __pyx_f_11pygame_sdl2_9transform_set_at(__pyx_v_surf_out->surface, ((__pyx_v_x * 2) + 1), (__pyx_v_y * 2), __pyx_v_e1); /* "pygame_sdl2/transform.pyx":174 * set_at(surf_out.surface, x*2, y*2, e0) * set_at(surf_out.surface, (x*2)+1, y*2, e1) * set_at(surf_out.surface, x*2, (y*2)+1, e2) # <<<<<<<<<<<<<< * set_at(surf_out.surface, (x*2)+1, (y*2)+1, e3) * */ __pyx_f_11pygame_sdl2_9transform_set_at(__pyx_v_surf_out->surface, (__pyx_v_x * 2), ((__pyx_v_y * 2) + 1), __pyx_v_e2); /* "pygame_sdl2/transform.pyx":175 * set_at(surf_out.surface, (x*2)+1, y*2, e1) * set_at(surf_out.surface, x*2, (y*2)+1, e2) * set_at(surf_out.surface, (x*2)+1, (y*2)+1, e3) # <<<<<<<<<<<<<< * * surf_out.unlock() */ __pyx_f_11pygame_sdl2_9transform_set_at(__pyx_v_surf_out->surface, ((__pyx_v_x * 2) + 1), ((__pyx_v_y * 2) + 1), __pyx_v_e3); } } } /* "pygame_sdl2/transform.pyx":147 * width, height = surface.get_size() * * with nogil: # <<<<<<<<<<<<<< * for x in range(width): * for y in range(height): */ /*finally:*/ { /*normal exit:*/{ #ifdef WITH_THREAD Py_BLOCK_THREADS #endif goto __pyx_L9; } __pyx_L9:; } } /* "pygame_sdl2/transform.pyx":177 * set_at(surf_out.surface, (x*2)+1, (y*2)+1, e3) * * surf_out.unlock() # <<<<<<<<<<<<<< * surface.unlock() * */ __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_surf_out), __pyx_n_s_unlock); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 177; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = NULL; if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_2))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); if (likely(__pyx_t_3)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); } } if (__pyx_t_3) { __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 177; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } else { __pyx_t_1 = __Pyx_PyObject_CallNoArg(__pyx_t_2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 177; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "pygame_sdl2/transform.pyx":178 * * surf_out.unlock() * surface.unlock() # <<<<<<<<<<<<<< * * return surf_out */ __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_surface), __pyx_n_s_unlock); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 178; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = NULL; if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_2))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); if (likely(__pyx_t_3)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); } } if (__pyx_t_3) { __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 178; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } else { __pyx_t_1 = __Pyx_PyObject_CallNoArg(__pyx_t_2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 178; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "pygame_sdl2/transform.pyx":180 * surface.unlock() * * return surf_out # <<<<<<<<<<<<<< * * def smoothscale(Surface surface, size, Surface DestSurface=None): */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(((PyObject *)__pyx_v_surf_out)); __pyx_r = ((PyObject *)__pyx_v_surf_out); goto __pyx_L0; /* "pygame_sdl2/transform.pyx":128 * p[0] = color * * def scale2x(Surface surface, Surface DestSurface=None): # <<<<<<<<<<<<<< * cdef int x, y * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_5); __Pyx_AddTraceback("pygame_sdl2.transform.scale2x", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF((PyObject *)__pyx_v_surf_out); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/transform.pyx":182 * return surf_out * * def smoothscale(Surface surface, size, Surface DestSurface=None): # <<<<<<<<<<<<<< * cdef double scale_x = size[0] / surface.surface.w * cdef double scale_y = size[1] / surface.surface.h */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_9transform_11smoothscale(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static PyMethodDef __pyx_mdef_11pygame_sdl2_9transform_11smoothscale = {"smoothscale", (PyCFunction)__pyx_pw_11pygame_sdl2_9transform_11smoothscale, METH_VARARGS|METH_KEYWORDS, 0}; static PyObject *__pyx_pw_11pygame_sdl2_9transform_11smoothscale(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { struct __pyx_obj_11pygame_sdl2_7surface_Surface *__pyx_v_surface = 0; PyObject *__pyx_v_size = 0; struct __pyx_obj_11pygame_sdl2_7surface_Surface *__pyx_v_DestSurface = 0; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("smoothscale (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_surface,&__pyx_n_s_size,&__pyx_n_s_DestSurface,0}; PyObject* values[3] = {0,0,0}; values[2] = (PyObject *)((struct __pyx_obj_11pygame_sdl2_7surface_Surface *)Py_None); if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_surface)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; case 1: if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_size)) != 0)) kw_args--; else { __Pyx_RaiseArgtupleInvalid("smoothscale", 0, 2, 3, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 182; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } case 2: if (kw_args > 0) { PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_DestSurface); if (value) { values[2] = value; kw_args--; } } } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "smoothscale") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 182; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } } else { switch (PyTuple_GET_SIZE(__pyx_args)) { case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); values[0] = PyTuple_GET_ITEM(__pyx_args, 0); break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_surface = ((struct __pyx_obj_11pygame_sdl2_7surface_Surface *)values[0]); __pyx_v_size = values[1]; __pyx_v_DestSurface = ((struct __pyx_obj_11pygame_sdl2_7surface_Surface *)values[2]); } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("smoothscale", 0, 2, 3, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 182; __pyx_clineno = __LINE__; goto __pyx_L3_error;} __pyx_L3_error:; __Pyx_AddTraceback("pygame_sdl2.transform.smoothscale", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_surface), __pyx_ptype_11pygame_sdl2_7surface_Surface, 1, "surface", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 182; __pyx_clineno = __LINE__; goto __pyx_L1_error;} if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_DestSurface), __pyx_ptype_11pygame_sdl2_7surface_Surface, 1, "DestSurface", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 182; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_r = __pyx_pf_11pygame_sdl2_9transform_10smoothscale(__pyx_self, __pyx_v_surface, __pyx_v_size, __pyx_v_DestSurface); /* function exit code */ goto __pyx_L0; __pyx_L1_error:; __pyx_r = NULL; __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_9transform_10smoothscale(CYTHON_UNUSED PyObject *__pyx_self, struct __pyx_obj_11pygame_sdl2_7surface_Surface *__pyx_v_surface, PyObject *__pyx_v_size, struct __pyx_obj_11pygame_sdl2_7surface_Surface *__pyx_v_DestSurface) { double __pyx_v_scale_x; double __pyx_v_scale_y; SDL_Surface *__pyx_v_rsurf; struct __pyx_obj_11pygame_sdl2_7surface_Surface *__pyx_v_rv = 0; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; double __pyx_t_4; int __pyx_t_5; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("smoothscale", 0); /* "pygame_sdl2/transform.pyx":183 * * def smoothscale(Surface surface, size, Surface DestSurface=None): * cdef double scale_x = size[0] / surface.surface.w # <<<<<<<<<<<<<< * cdef double scale_y = size[1] / surface.surface.h * */ __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_size, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(__pyx_t_1 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 183; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = PyFloat_FromDouble(((double)__pyx_v_surface->surface->w)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 183; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = __Pyx_PyNumber_Divide(__pyx_t_1, __pyx_t_2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 183; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_4 = __pyx_PyFloat_AsDouble(__pyx_t_3); if (unlikely((__pyx_t_4 == (double)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 183; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_v_scale_x = __pyx_t_4; /* "pygame_sdl2/transform.pyx":184 * def smoothscale(Surface surface, size, Surface DestSurface=None): * cdef double scale_x = size[0] / surface.surface.w * cdef double scale_y = size[1] / surface.surface.h # <<<<<<<<<<<<<< * * cdef SDL_Surface *rsurf = NULL */ __pyx_t_3 = __Pyx_GetItemInt(__pyx_v_size, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(__pyx_t_3 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 184; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; __Pyx_GOTREF(__pyx_t_3); __pyx_t_2 = PyFloat_FromDouble(((double)__pyx_v_surface->surface->h)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 184; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __pyx_t_1 = __Pyx_PyNumber_Divide(__pyx_t_3, __pyx_t_2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 184; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_4 = __pyx_PyFloat_AsDouble(__pyx_t_1); if (unlikely((__pyx_t_4 == (double)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 184; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_v_scale_y = __pyx_t_4; /* "pygame_sdl2/transform.pyx":186 * cdef double scale_y = size[1] / surface.surface.h * * cdef SDL_Surface *rsurf = NULL # <<<<<<<<<<<<<< * cdef Surface rv * */ __pyx_v_rsurf = NULL; /* "pygame_sdl2/transform.pyx":189 * cdef Surface rv * * with nogil: # <<<<<<<<<<<<<< * rsurf = rotozoomSurfaceXY(surface.surface, 0.0, scale_x, scale_y, SMOOTHING_ON) * */ { #ifdef WITH_THREAD PyThreadState *_save; Py_UNBLOCK_THREADS #endif /*try:*/ { /* "pygame_sdl2/transform.pyx":190 * * with nogil: * rsurf = rotozoomSurfaceXY(surface.surface, 0.0, scale_x, scale_y, SMOOTHING_ON) # <<<<<<<<<<<<<< * * if rsurf == NULL: */ __pyx_v_rsurf = rotozoomSurfaceXY(__pyx_v_surface->surface, 0.0, __pyx_v_scale_x, __pyx_v_scale_y, SMOOTHING_ON); } /* "pygame_sdl2/transform.pyx":189 * cdef Surface rv * * with nogil: # <<<<<<<<<<<<<< * rsurf = rotozoomSurfaceXY(surface.surface, 0.0, scale_x, scale_y, SMOOTHING_ON) * */ /*finally:*/ { /*normal exit:*/{ #ifdef WITH_THREAD Py_BLOCK_THREADS #endif goto __pyx_L5; } __pyx_L5:; } } /* "pygame_sdl2/transform.pyx":192 * rsurf = rotozoomSurfaceXY(surface.surface, 0.0, scale_x, scale_y, SMOOTHING_ON) * * if rsurf == NULL: # <<<<<<<<<<<<<< * raise error() * */ __pyx_t_5 = ((__pyx_v_rsurf == NULL) != 0); if (__pyx_t_5) { /* "pygame_sdl2/transform.pyx":193 * * if rsurf == NULL: * raise error() # <<<<<<<<<<<<<< * * rv = Surface(()) */ __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_error); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 193; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = NULL; if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_2))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); if (likely(__pyx_t_3)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); } } if (__pyx_t_3) { __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 193; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } else { __pyx_t_1 = __Pyx_PyObject_CallNoArg(__pyx_t_2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 193; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_Raise(__pyx_t_1, 0, 0, 0); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; {__pyx_filename = __pyx_f[0]; __pyx_lineno = 193; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "pygame_sdl2/transform.pyx":192 * rsurf = rotozoomSurfaceXY(surface.surface, 0.0, scale_x, scale_y, SMOOTHING_ON) * * if rsurf == NULL: # <<<<<<<<<<<<<< * raise error() * */ } /* "pygame_sdl2/transform.pyx":195 * raise error() * * rv = Surface(()) # <<<<<<<<<<<<<< * rv.take_surface(rsurf) * */ __pyx_t_1 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_11pygame_sdl2_7surface_Surface), __pyx_tuple__3, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 195; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_v_rv = ((struct __pyx_obj_11pygame_sdl2_7surface_Surface *)__pyx_t_1); __pyx_t_1 = 0; /* "pygame_sdl2/transform.pyx":196 * * rv = Surface(()) * rv.take_surface(rsurf) # <<<<<<<<<<<<<< * * # This is inefficient. */ ((struct __pyx_vtabstruct_11pygame_sdl2_7surface_Surface *)__pyx_v_rv->__pyx_vtab)->take_surface(__pyx_v_rv, __pyx_v_rsurf); /* "pygame_sdl2/transform.pyx":199 * * # This is inefficient. * if DestSurface: # <<<<<<<<<<<<<< * with nogil: * SDL_SetSurfaceBlendMode(rv.surface, SDL_BLENDMODE_NONE) */ __pyx_t_5 = __Pyx_PyObject_IsTrue(((PyObject *)__pyx_v_DestSurface)); if (unlikely(__pyx_t_5 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 199; __pyx_clineno = __LINE__; goto __pyx_L1_error;} if (__pyx_t_5) { /* "pygame_sdl2/transform.pyx":200 * # This is inefficient. * if DestSurface: * with nogil: # <<<<<<<<<<<<<< * SDL_SetSurfaceBlendMode(rv.surface, SDL_BLENDMODE_NONE) * SDL_UpperBlit(rv.surface, NULL, DestSurface.surface, NULL) */ { #ifdef WITH_THREAD PyThreadState *_save; Py_UNBLOCK_THREADS #endif /*try:*/ { /* "pygame_sdl2/transform.pyx":201 * if DestSurface: * with nogil: * SDL_SetSurfaceBlendMode(rv.surface, SDL_BLENDMODE_NONE) # <<<<<<<<<<<<<< * SDL_UpperBlit(rv.surface, NULL, DestSurface.surface, NULL) * */ SDL_SetSurfaceBlendMode(__pyx_v_rv->surface, SDL_BLENDMODE_NONE); /* "pygame_sdl2/transform.pyx":202 * with nogil: * SDL_SetSurfaceBlendMode(rv.surface, SDL_BLENDMODE_NONE) * SDL_UpperBlit(rv.surface, NULL, DestSurface.surface, NULL) # <<<<<<<<<<<<<< * * return rv */ SDL_UpperBlit(__pyx_v_rv->surface, NULL, __pyx_v_DestSurface->surface, NULL); } /* "pygame_sdl2/transform.pyx":200 * # This is inefficient. * if DestSurface: * with nogil: # <<<<<<<<<<<<<< * SDL_SetSurfaceBlendMode(rv.surface, SDL_BLENDMODE_NONE) * SDL_UpperBlit(rv.surface, NULL, DestSurface.surface, NULL) */ /*finally:*/ { /*normal exit:*/{ #ifdef WITH_THREAD Py_BLOCK_THREADS #endif goto __pyx_L10; } __pyx_L10:; } } /* "pygame_sdl2/transform.pyx":199 * * # This is inefficient. * if DestSurface: # <<<<<<<<<<<<<< * with nogil: * SDL_SetSurfaceBlendMode(rv.surface, SDL_BLENDMODE_NONE) */ } /* "pygame_sdl2/transform.pyx":204 * SDL_UpperBlit(rv.surface, NULL, DestSurface.surface, NULL) * * return rv # <<<<<<<<<<<<<< */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(((PyObject *)__pyx_v_rv)); __pyx_r = ((PyObject *)__pyx_v_rv); goto __pyx_L0; /* "pygame_sdl2/transform.pyx":182 * return surf_out * * def smoothscale(Surface surface, size, Surface DestSurface=None): # <<<<<<<<<<<<<< * cdef double scale_x = size[0] / surface.surface.w * cdef double scale_y = size[1] / surface.surface.h */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("pygame_sdl2.transform.smoothscale", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF((PyObject *)__pyx_v_rv); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyMethodDef __pyx_methods[] = { {0, 0, 0, 0} }; #if PY_MAJOR_VERSION >= 3 static struct PyModuleDef __pyx_moduledef = { #if PY_VERSION_HEX < 0x03020000 { PyObject_HEAD_INIT(NULL) NULL, 0, NULL }, #else PyModuleDef_HEAD_INIT, #endif "transform", 0, /* m_doc */ -1, /* m_size */ __pyx_methods /* m_methods */, NULL, /* m_reload */ NULL, /* m_traverse */ NULL, /* m_clear */ NULL /* m_free */ }; #endif static __Pyx_StringTabEntry __pyx_string_tab[] = { {&__pyx_n_s_DestSurface, __pyx_k_DestSurface, sizeof(__pyx_k_DestSurface), 0, 0, 1, 1}, {&__pyx_kp_u_Surface_has_unsupported_bytesize, __pyx_k_Surface_has_unsupported_bytesize, sizeof(__pyx_k_Surface_has_unsupported_bytesize), 0, 1, 0, 0}, {&__pyx_n_s_a, __pyx_k_a, sizeof(__pyx_k_a), 0, 0, 1, 1}, {&__pyx_n_s_angle, __pyx_k_angle, sizeof(__pyx_k_angle), 0, 0, 1, 1}, {&__pyx_n_s_b, __pyx_k_b, sizeof(__pyx_k_b), 0, 0, 1, 1}, {&__pyx_n_s_c, __pyx_k_c, sizeof(__pyx_k_c), 0, 0, 1, 1}, {&__pyx_n_s_d, __pyx_k_d, sizeof(__pyx_k_d), 0, 0, 1, 1}, {&__pyx_n_s_dest, __pyx_k_dest, sizeof(__pyx_k_dest), 0, 0, 1, 1}, {&__pyx_n_s_dest_delta, __pyx_k_dest_delta, sizeof(__pyx_k_dest_delta), 0, 0, 1, 1}, {&__pyx_n_s_dest_pixel, __pyx_k_dest_pixel, sizeof(__pyx_k_dest_pixel), 0, 0, 1, 1}, {&__pyx_n_s_e, __pyx_k_e, sizeof(__pyx_k_e), 0, 0, 1, 1}, {&__pyx_n_s_e0, __pyx_k_e0, sizeof(__pyx_k_e0), 0, 0, 1, 1}, {&__pyx_n_s_e1, __pyx_k_e1, sizeof(__pyx_k_e1), 0, 0, 1, 1}, {&__pyx_n_s_e2, __pyx_k_e2, sizeof(__pyx_k_e2), 0, 0, 1, 1}, {&__pyx_n_s_e3, __pyx_k_e3, sizeof(__pyx_k_e3), 0, 0, 1, 1}, {&__pyx_n_s_err, __pyx_k_err, sizeof(__pyx_k_err), 0, 0, 1, 1}, {&__pyx_n_s_error, __pyx_k_error, sizeof(__pyx_k_error), 0, 0, 1, 1}, {&__pyx_n_s_f, __pyx_k_f, sizeof(__pyx_k_f), 0, 0, 1, 1}, {&__pyx_n_s_flip, __pyx_k_flip, sizeof(__pyx_k_flip), 0, 0, 1, 1}, {&__pyx_n_s_g, __pyx_k_g, sizeof(__pyx_k_g), 0, 0, 1, 1}, {&__pyx_n_s_get_bytesize, __pyx_k_get_bytesize, sizeof(__pyx_k_get_bytesize), 0, 0, 1, 1}, {&__pyx_n_s_get_flags, __pyx_k_get_flags, sizeof(__pyx_k_get_flags), 0, 0, 1, 1}, {&__pyx_n_s_get_height, __pyx_k_get_height, sizeof(__pyx_k_get_height), 0, 0, 1, 1}, {&__pyx_n_s_get_size, __pyx_k_get_size, sizeof(__pyx_k_get_size), 0, 0, 1, 1}, {&__pyx_n_s_get_width, __pyx_k_get_width, sizeof(__pyx_k_get_width), 0, 0, 1, 1}, {&__pyx_n_s_h, __pyx_k_h, sizeof(__pyx_k_h), 0, 0, 1, 1}, {&__pyx_n_s_height, __pyx_k_height, sizeof(__pyx_k_height), 0, 0, 1, 1}, {&__pyx_kp_s_home_tom_ab_pygame_sdl2_src_pyg, __pyx_k_home_tom_ab_pygame_sdl2_src_pyg, sizeof(__pyx_k_home_tom_ab_pygame_sdl2_src_pyg), 0, 0, 1, 0}, {&__pyx_n_s_i, __pyx_k_i, sizeof(__pyx_k_i), 0, 0, 1, 1}, {&__pyx_n_s_import, __pyx_k_import, sizeof(__pyx_k_import), 0, 0, 1, 1}, {&__pyx_n_s_lock, __pyx_k_lock, sizeof(__pyx_k_lock), 0, 0, 1, 1}, {&__pyx_n_s_main, __pyx_k_main, sizeof(__pyx_k_main), 0, 0, 1, 1}, {&__pyx_n_s_pygame_sdl2_error, __pyx_k_pygame_sdl2_error, sizeof(__pyx_k_pygame_sdl2_error), 0, 0, 1, 1}, {&__pyx_n_s_pygame_sdl2_transform, __pyx_k_pygame_sdl2_transform, sizeof(__pyx_k_pygame_sdl2_transform), 0, 0, 1, 1}, {&__pyx_n_s_pyx_vtable, __pyx_k_pyx_vtable, sizeof(__pyx_k_pyx_vtable), 0, 0, 1, 1}, {&__pyx_n_s_range, __pyx_k_range, sizeof(__pyx_k_range), 0, 0, 1, 1}, {&__pyx_n_s_rotate, __pyx_k_rotate, sizeof(__pyx_k_rotate), 0, 0, 1, 1}, {&__pyx_n_s_rotozoom, __pyx_k_rotozoom, sizeof(__pyx_k_rotozoom), 0, 0, 1, 1}, {&__pyx_n_s_rsurf, __pyx_k_rsurf, sizeof(__pyx_k_rsurf), 0, 0, 1, 1}, {&__pyx_n_s_rv, __pyx_k_rv, sizeof(__pyx_k_rv), 0, 0, 1, 1}, {&__pyx_n_s_scale, __pyx_k_scale, sizeof(__pyx_k_scale), 0, 0, 1, 1}, {&__pyx_n_s_scale2x, __pyx_k_scale2x, sizeof(__pyx_k_scale2x), 0, 0, 1, 1}, {&__pyx_n_s_scale_x, __pyx_k_scale_x, sizeof(__pyx_k_scale_x), 0, 0, 1, 1}, {&__pyx_n_s_scale_y, __pyx_k_scale_y, sizeof(__pyx_k_scale_y), 0, 0, 1, 1}, {&__pyx_n_s_size, __pyx_k_size, sizeof(__pyx_k_size), 0, 0, 1, 1}, {&__pyx_n_s_smooth, __pyx_k_smooth, sizeof(__pyx_k_smooth), 0, 0, 1, 1}, {&__pyx_n_s_smoothscale, __pyx_k_smoothscale, sizeof(__pyx_k_smoothscale), 0, 0, 1, 1}, {&__pyx_n_s_src, __pyx_k_src, sizeof(__pyx_k_src), 0, 0, 1, 1}, {&__pyx_n_s_src_end, __pyx_k_src_end, sizeof(__pyx_k_src_end), 0, 0, 1, 1}, {&__pyx_n_s_src_pixel, __pyx_k_src_pixel, sizeof(__pyx_k_src_pixel), 0, 0, 1, 1}, {&__pyx_n_s_surf_out, __pyx_k_surf_out, sizeof(__pyx_k_surf_out), 0, 0, 1, 1}, {&__pyx_n_s_surface, __pyx_k_surface, sizeof(__pyx_k_surface), 0, 0, 1, 1}, {&__pyx_n_s_test, __pyx_k_test, sizeof(__pyx_k_test), 0, 0, 1, 1}, {&__pyx_n_s_unlock, __pyx_k_unlock, sizeof(__pyx_k_unlock), 0, 0, 1, 1}, {&__pyx_n_s_width, __pyx_k_width, sizeof(__pyx_k_width), 0, 0, 1, 1}, {&__pyx_n_s_x, __pyx_k_x, sizeof(__pyx_k_x), 0, 0, 1, 1}, {&__pyx_n_s_xbool, __pyx_k_xbool, sizeof(__pyx_k_xbool), 0, 0, 1, 1}, {&__pyx_n_s_y, __pyx_k_y, sizeof(__pyx_k_y), 0, 0, 1, 1}, {&__pyx_n_s_ybool, __pyx_k_ybool, sizeof(__pyx_k_ybool), 0, 0, 1, 1}, {0, 0, 0, 0, 0, 0, 0} }; static int __Pyx_InitCachedBuiltins(void) { __pyx_builtin_range = __Pyx_GetBuiltinName(__pyx_n_s_range); if (!__pyx_builtin_range) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 148; __pyx_clineno = __LINE__; goto __pyx_L1_error;} return 0; __pyx_L1_error:; return -1; } static int __Pyx_InitCachedConstants(void) { __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__Pyx_InitCachedConstants", 0); /* "pygame_sdl2/transform.pyx":102 * raise error() * * rv = Surface(()) # <<<<<<<<<<<<<< * rv.take_surface(rsurf) * */ __pyx_tuple_ = PyTuple_Pack(1, __pyx_empty_tuple); if (unlikely(!__pyx_tuple_)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 102; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_tuple_); __Pyx_GIVEREF(__pyx_tuple_); /* "pygame_sdl2/transform.pyx":135 * * if surface.get_bytesize() != 4: * raise error("Surface has unsupported bytesize.") # <<<<<<<<<<<<<< * * cdef Surface surf_out = DestSurface */ __pyx_tuple__2 = PyTuple_Pack(1, __pyx_kp_u_Surface_has_unsupported_bytesize); if (unlikely(!__pyx_tuple__2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 135; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_tuple__2); __Pyx_GIVEREF(__pyx_tuple__2); /* "pygame_sdl2/transform.pyx":195 * raise error() * * rv = Surface(()) # <<<<<<<<<<<<<< * rv.take_surface(rsurf) * */ __pyx_tuple__3 = PyTuple_Pack(1, __pyx_empty_tuple); if (unlikely(!__pyx_tuple__3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 195; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_tuple__3); __Pyx_GIVEREF(__pyx_tuple__3); /* "pygame_sdl2/transform.pyx":26 * * * def flip(Surface surface, bint xbool, bint ybool): # <<<<<<<<<<<<<< * * cdef Surface rv = Surface(surface.get_size(), surface.get_flags(), surface) */ __pyx_tuple__4 = PyTuple_Pack(11, __pyx_n_s_surface, __pyx_n_s_xbool, __pyx_n_s_ybool, __pyx_n_s_rv, __pyx_n_s_src, __pyx_n_s_dest, __pyx_n_s_src_pixel, __pyx_n_s_src_end, __pyx_n_s_dest_pixel, __pyx_n_s_dest_delta, __pyx_n_s_y); if (unlikely(!__pyx_tuple__4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 26; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_tuple__4); __Pyx_GIVEREF(__pyx_tuple__4); __pyx_codeobj__5 = (PyObject*)__Pyx_PyCode_New(3, 0, 11, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__4, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_tom_ab_pygame_sdl2_src_pyg, __pyx_n_s_flip, 26, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 26; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "pygame_sdl2/transform.pyx":65 * * * def scale(Surface surface, size, Surface DestSurface=None): # <<<<<<<<<<<<<< * cdef Surface surf_out * cdef int err = -1 */ __pyx_tuple__6 = PyTuple_Pack(5, __pyx_n_s_surface, __pyx_n_s_size, __pyx_n_s_DestSurface, __pyx_n_s_surf_out, __pyx_n_s_err); if (unlikely(!__pyx_tuple__6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 65; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_tuple__6); __Pyx_GIVEREF(__pyx_tuple__6); __pyx_codeobj__7 = (PyObject*)__Pyx_PyCode_New(3, 0, 5, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__6, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_tom_ab_pygame_sdl2_src_pyg, __pyx_n_s_scale, 65, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 65; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "pygame_sdl2/transform.pyx":83 * return surf_out * * def rotate(Surface surface, angle): # <<<<<<<<<<<<<< * # rotateSurface90Degrees always returns NULL without setting an error?? * # cdef SDL_Surface *rsurf */ __pyx_tuple__8 = PyTuple_Pack(2, __pyx_n_s_surface, __pyx_n_s_angle); if (unlikely(!__pyx_tuple__8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 83; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_tuple__8); __Pyx_GIVEREF(__pyx_tuple__8); __pyx_codeobj__9 = (PyObject*)__Pyx_PyCode_New(2, 0, 2, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__8, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_tom_ab_pygame_sdl2_src_pyg, __pyx_n_s_rotate, 83, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 83; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "pygame_sdl2/transform.pyx":92 * return rotozoom(surface, angle, 1.0, SMOOTHING_OFF) * * def rotozoom(Surface surface, double angle, double scale, int smooth=1): # <<<<<<<<<<<<<< * cdef SDL_Surface *rsurf = NULL * cdef Surface rv */ __pyx_tuple__10 = PyTuple_Pack(6, __pyx_n_s_surface, __pyx_n_s_angle, __pyx_n_s_scale, __pyx_n_s_smooth, __pyx_n_s_rsurf, __pyx_n_s_rv); if (unlikely(!__pyx_tuple__10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 92; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_tuple__10); __Pyx_GIVEREF(__pyx_tuple__10); __pyx_codeobj__11 = (PyObject*)__Pyx_PyCode_New(4, 0, 6, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__10, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_tom_ab_pygame_sdl2_src_pyg, __pyx_n_s_rotozoom, 92, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 92; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "pygame_sdl2/transform.pyx":128 * p[0] = color * * def scale2x(Surface surface, Surface DestSurface=None): # <<<<<<<<<<<<<< * cdef int x, y * */ __pyx_tuple__12 = PyTuple_Pack(20, __pyx_n_s_surface, __pyx_n_s_DestSurface, __pyx_n_s_x, __pyx_n_s_y, __pyx_n_s_a, __pyx_n_s_b, __pyx_n_s_c, __pyx_n_s_d, __pyx_n_s_e, __pyx_n_s_f, __pyx_n_s_g, __pyx_n_s_h, __pyx_n_s_i, __pyx_n_s_e0, __pyx_n_s_e1, __pyx_n_s_e2, __pyx_n_s_e3, __pyx_n_s_surf_out, __pyx_n_s_width, __pyx_n_s_height); if (unlikely(!__pyx_tuple__12)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 128; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_tuple__12); __Pyx_GIVEREF(__pyx_tuple__12); __pyx_codeobj__13 = (PyObject*)__Pyx_PyCode_New(2, 0, 20, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__12, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_tom_ab_pygame_sdl2_src_pyg, __pyx_n_s_scale2x, 128, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__13)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 128; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "pygame_sdl2/transform.pyx":182 * return surf_out * * def smoothscale(Surface surface, size, Surface DestSurface=None): # <<<<<<<<<<<<<< * cdef double scale_x = size[0] / surface.surface.w * cdef double scale_y = size[1] / surface.surface.h */ __pyx_tuple__14 = PyTuple_Pack(7, __pyx_n_s_surface, __pyx_n_s_size, __pyx_n_s_DestSurface, __pyx_n_s_scale_x, __pyx_n_s_scale_y, __pyx_n_s_rsurf, __pyx_n_s_rv); if (unlikely(!__pyx_tuple__14)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 182; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_tuple__14); __Pyx_GIVEREF(__pyx_tuple__14); __pyx_codeobj__15 = (PyObject*)__Pyx_PyCode_New(3, 0, 7, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__14, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_tom_ab_pygame_sdl2_src_pyg, __pyx_n_s_smoothscale, 182, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__15)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 182; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_RefNannyFinishContext(); return 0; __pyx_L1_error:; __Pyx_RefNannyFinishContext(); return -1; } static int __Pyx_InitGlobals(void) { if (__Pyx_InitStrings(__pyx_string_tab) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; __pyx_float_1_0 = PyFloat_FromDouble(1.0); if (unlikely(!__pyx_float_1_0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_int_0 = PyInt_FromLong(0); if (unlikely(!__pyx_int_0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_int_2 = PyInt_FromLong(2); if (unlikely(!__pyx_int_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_int_4 = PyInt_FromLong(4); if (unlikely(!__pyx_int_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} return 0; __pyx_L1_error:; return -1; } #if PY_MAJOR_VERSION < 3 PyMODINIT_FUNC inittransform(void); /*proto*/ PyMODINIT_FUNC inittransform(void) #else PyMODINIT_FUNC PyInit_transform(void); /*proto*/ PyMODINIT_FUNC PyInit_transform(void) #endif { PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannyDeclarations #if CYTHON_REFNANNY __Pyx_RefNanny = __Pyx_RefNannyImportAPI("refnanny"); if (!__Pyx_RefNanny) { PyErr_Clear(); __Pyx_RefNanny = __Pyx_RefNannyImportAPI("Cython.Runtime.refnanny"); if (!__Pyx_RefNanny) Py_FatalError("failed to import 'refnanny' module"); } #endif __Pyx_RefNannySetupContext("PyMODINIT_FUNC PyInit_transform(void)", 0); if (__Pyx_check_binary_version() < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_empty_tuple = PyTuple_New(0); if (unlikely(!__pyx_empty_tuple)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_empty_bytes = PyBytes_FromStringAndSize("", 0); if (unlikely(!__pyx_empty_bytes)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} #ifdef __Pyx_CyFunction_USED if (__pyx_CyFunction_init() < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} #endif #ifdef __Pyx_FusedFunction_USED if (__pyx_FusedFunction_init() < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} #endif #ifdef __Pyx_Coroutine_USED if (__pyx_Coroutine_init() < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} #endif #ifdef __Pyx_Generator_USED if (__pyx_Generator_init() < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} #endif #ifdef __Pyx_StopAsyncIteration_USED if (__pyx_StopAsyncIteration_init() < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} #endif /*--- Library function declarations ---*/ /*--- Threads initialization code ---*/ #if defined(__PYX_FORCE_INIT_THREADS) && __PYX_FORCE_INIT_THREADS #ifdef WITH_THREAD /* Python build with threading support? */ PyEval_InitThreads(); #endif #endif /*--- Module creation code ---*/ #if PY_MAJOR_VERSION < 3 __pyx_m = Py_InitModule4("transform", __pyx_methods, 0, 0, PYTHON_API_VERSION); Py_XINCREF(__pyx_m); #else __pyx_m = PyModule_Create(&__pyx_moduledef); #endif if (unlikely(!__pyx_m)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_d = PyModule_GetDict(__pyx_m); if (unlikely(!__pyx_d)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} Py_INCREF(__pyx_d); __pyx_b = PyImport_AddModule(__Pyx_BUILTIN_MODULE_NAME); if (unlikely(!__pyx_b)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} #if CYTHON_COMPILING_IN_PYPY Py_INCREF(__pyx_b); #endif if (PyObject_SetAttrString(__pyx_m, "__builtins__", __pyx_b) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; /*--- Initialize various global constants etc. ---*/ if (__Pyx_InitGlobals() < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} #if PY_MAJOR_VERSION < 3 && (__PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT) if (__Pyx_init_sys_getdefaultencoding_params() < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} #endif if (__pyx_module_is_main_pygame_sdl2__transform) { if (PyObject_SetAttrString(__pyx_m, "__name__", __pyx_n_s_main) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } #if PY_MAJOR_VERSION >= 3 { PyObject *modules = PyImport_GetModuleDict(); if (unlikely(!modules)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} if (!PyDict_GetItemString(modules, "pygame_sdl2.transform")) { if (unlikely(PyDict_SetItemString(modules, "pygame_sdl2.transform", __pyx_m) < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } } #endif /*--- Builtin init code ---*/ if (__Pyx_InitCachedBuiltins() < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /*--- Constants init code ---*/ if (__Pyx_InitCachedConstants() < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /*--- Global init code ---*/ /*--- Variable export code ---*/ /*--- Function export code ---*/ /*--- Type init code ---*/ /*--- Type import code ---*/ __pyx_ptype_11pygame_sdl2_7surface_Surface = __Pyx_ImportType("pygame_sdl2.surface", "Surface", sizeof(struct __pyx_obj_11pygame_sdl2_7surface_Surface), 1); if (unlikely(!__pyx_ptype_11pygame_sdl2_7surface_Surface)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 23; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_vtabptr_11pygame_sdl2_7surface_Surface = (struct __pyx_vtabstruct_11pygame_sdl2_7surface_Surface*)__Pyx_GetVtable(__pyx_ptype_11pygame_sdl2_7surface_Surface->tp_dict); if (unlikely(!__pyx_vtabptr_11pygame_sdl2_7surface_Surface)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 23; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /*--- Variable import code ---*/ /*--- Function import code ---*/ /*--- Execution code ---*/ #if defined(__Pyx_Generator_USED) || defined(__Pyx_Coroutine_USED) if (__Pyx_patch_abc() < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} #endif /* "pygame_sdl2/transform.pyx":23 * from sdl2_gfx cimport * * from pygame_sdl2.surface cimport * * from pygame_sdl2.error import error # <<<<<<<<<<<<<< * * */ __pyx_t_1 = PyList_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 23; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __Pyx_INCREF(__pyx_n_s_error); __Pyx_GIVEREF(__pyx_n_s_error); PyList_SET_ITEM(__pyx_t_1, 0, __pyx_n_s_error); __pyx_t_2 = __Pyx_Import(__pyx_n_s_pygame_sdl2_error, __pyx_t_1, 0); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 23; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_1 = __Pyx_ImportFrom(__pyx_t_2, __pyx_n_s_error); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 23; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); if (PyDict_SetItem(__pyx_d, __pyx_n_s_error, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 23; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "pygame_sdl2/transform.pyx":26 * * * def flip(Surface surface, bint xbool, bint ybool): # <<<<<<<<<<<<<< * * cdef Surface rv = Surface(surface.get_size(), surface.get_flags(), surface) */ __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_11pygame_sdl2_9transform_1flip, NULL, __pyx_n_s_pygame_sdl2_transform); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 26; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_flip, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 26; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "pygame_sdl2/transform.pyx":65 * * * def scale(Surface surface, size, Surface DestSurface=None): # <<<<<<<<<<<<<< * cdef Surface surf_out * cdef int err = -1 */ __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_11pygame_sdl2_9transform_3scale, NULL, __pyx_n_s_pygame_sdl2_transform); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 65; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_scale, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 65; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "pygame_sdl2/transform.pyx":83 * return surf_out * * def rotate(Surface surface, angle): # <<<<<<<<<<<<<< * # rotateSurface90Degrees always returns NULL without setting an error?? * # cdef SDL_Surface *rsurf */ __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_11pygame_sdl2_9transform_5rotate, NULL, __pyx_n_s_pygame_sdl2_transform); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 83; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_rotate, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 83; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "pygame_sdl2/transform.pyx":92 * return rotozoom(surface, angle, 1.0, SMOOTHING_OFF) * * def rotozoom(Surface surface, double angle, double scale, int smooth=1): # <<<<<<<<<<<<<< * cdef SDL_Surface *rsurf = NULL * cdef Surface rv */ __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_11pygame_sdl2_9transform_7rotozoom, NULL, __pyx_n_s_pygame_sdl2_transform); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 92; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_rotozoom, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 92; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "pygame_sdl2/transform.pyx":128 * p[0] = color * * def scale2x(Surface surface, Surface DestSurface=None): # <<<<<<<<<<<<<< * cdef int x, y * */ __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_11pygame_sdl2_9transform_9scale2x, NULL, __pyx_n_s_pygame_sdl2_transform); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 128; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_scale2x, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 128; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "pygame_sdl2/transform.pyx":182 * return surf_out * * def smoothscale(Surface surface, size, Surface DestSurface=None): # <<<<<<<<<<<<<< * cdef double scale_x = size[0] / surface.surface.w * cdef double scale_y = size[1] / surface.surface.h */ __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_11pygame_sdl2_9transform_11smoothscale, NULL, __pyx_n_s_pygame_sdl2_transform); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 182; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_smoothscale, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 182; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "pygame_sdl2/transform.pyx":1 * # Copyright 2014 Patrick Dawson # <<<<<<<<<<<<<< * # Tom Rothamel * # */ __pyx_t_2 = PyDict_New(); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_test, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /*--- Wrapped vars code ---*/ goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); if (__pyx_m) { if (__pyx_d) { __Pyx_AddTraceback("init pygame_sdl2.transform", __pyx_clineno, __pyx_lineno, __pyx_filename); } Py_DECREF(__pyx_m); __pyx_m = 0; } else if (!PyErr_Occurred()) { PyErr_SetString(PyExc_ImportError, "init pygame_sdl2.transform"); } __pyx_L0:; __Pyx_RefNannyFinishContext(); #if PY_MAJOR_VERSION < 3 return; #else return __pyx_m; #endif } /* --- Runtime support code --- */ #if CYTHON_REFNANNY static __Pyx_RefNannyAPIStruct *__Pyx_RefNannyImportAPI(const char *modname) { PyObject *m = NULL, *p = NULL; void *r = NULL; m = PyImport_ImportModule((char *)modname); if (!m) goto end; p = PyObject_GetAttrString(m, (char *)"RefNannyAPI"); if (!p) goto end; r = PyLong_AsVoidPtr(p); end: Py_XDECREF(p); Py_XDECREF(m); return (__Pyx_RefNannyAPIStruct *)r; } #endif static PyObject *__Pyx_GetBuiltinName(PyObject *name) { PyObject* result = __Pyx_PyObject_GetAttrStr(__pyx_b, name); if (unlikely(!result)) { PyErr_Format(PyExc_NameError, #if PY_MAJOR_VERSION >= 3 "name '%U' is not defined", name); #else "name '%.200s' is not defined", PyString_AS_STRING(name)); #endif } return result; } static void __Pyx_RaiseArgtupleInvalid( const char* func_name, int exact, Py_ssize_t num_min, Py_ssize_t num_max, Py_ssize_t num_found) { Py_ssize_t num_expected; const char *more_or_less; if (num_found < num_min) { num_expected = num_min; more_or_less = "at least"; } else { num_expected = num_max; more_or_less = "at most"; } if (exact) { more_or_less = "exactly"; } PyErr_Format(PyExc_TypeError, "%.200s() takes %.8s %" CYTHON_FORMAT_SSIZE_T "d positional argument%.1s (%" CYTHON_FORMAT_SSIZE_T "d given)", func_name, more_or_less, num_expected, (num_expected == 1) ? "" : "s", num_found); } static void __Pyx_RaiseDoubleKeywordsError( const char* func_name, PyObject* kw_name) { PyErr_Format(PyExc_TypeError, #if PY_MAJOR_VERSION >= 3 "%s() got multiple values for keyword argument '%U'", func_name, kw_name); #else "%s() got multiple values for keyword argument '%s'", func_name, PyString_AsString(kw_name)); #endif } static int __Pyx_ParseOptionalKeywords( PyObject *kwds, PyObject **argnames[], PyObject *kwds2, PyObject *values[], Py_ssize_t num_pos_args, const char* function_name) { PyObject *key = 0, *value = 0; Py_ssize_t pos = 0; PyObject*** name; PyObject*** first_kw_arg = argnames + num_pos_args; while (PyDict_Next(kwds, &pos, &key, &value)) { name = first_kw_arg; while (*name && (**name != key)) name++; if (*name) { values[name-argnames] = value; continue; } name = first_kw_arg; #if PY_MAJOR_VERSION < 3 if (likely(PyString_CheckExact(key)) || likely(PyString_Check(key))) { while (*name) { if ((CYTHON_COMPILING_IN_PYPY || PyString_GET_SIZE(**name) == PyString_GET_SIZE(key)) && _PyString_Eq(**name, key)) { values[name-argnames] = value; break; } name++; } if (*name) continue; else { PyObject*** argname = argnames; while (argname != first_kw_arg) { if ((**argname == key) || ( (CYTHON_COMPILING_IN_PYPY || PyString_GET_SIZE(**argname) == PyString_GET_SIZE(key)) && _PyString_Eq(**argname, key))) { goto arg_passed_twice; } argname++; } } } else #endif if (likely(PyUnicode_Check(key))) { while (*name) { int cmp = (**name == key) ? 0 : #if !CYTHON_COMPILING_IN_PYPY && PY_MAJOR_VERSION >= 3 (PyUnicode_GET_SIZE(**name) != PyUnicode_GET_SIZE(key)) ? 1 : #endif PyUnicode_Compare(**name, key); if (cmp < 0 && unlikely(PyErr_Occurred())) goto bad; if (cmp == 0) { values[name-argnames] = value; break; } name++; } if (*name) continue; else { PyObject*** argname = argnames; while (argname != first_kw_arg) { int cmp = (**argname == key) ? 0 : #if !CYTHON_COMPILING_IN_PYPY && PY_MAJOR_VERSION >= 3 (PyUnicode_GET_SIZE(**argname) != PyUnicode_GET_SIZE(key)) ? 1 : #endif PyUnicode_Compare(**argname, key); if (cmp < 0 && unlikely(PyErr_Occurred())) goto bad; if (cmp == 0) goto arg_passed_twice; argname++; } } } else goto invalid_keyword_type; if (kwds2) { if (unlikely(PyDict_SetItem(kwds2, key, value))) goto bad; } else { goto invalid_keyword; } } return 0; arg_passed_twice: __Pyx_RaiseDoubleKeywordsError(function_name, key); goto bad; invalid_keyword_type: PyErr_Format(PyExc_TypeError, "%.200s() keywords must be strings", function_name); goto bad; invalid_keyword: PyErr_Format(PyExc_TypeError, #if PY_MAJOR_VERSION < 3 "%.200s() got an unexpected keyword argument '%.200s'", function_name, PyString_AsString(key)); #else "%s() got an unexpected keyword argument '%U'", function_name, key); #endif bad: return -1; } static void __Pyx_RaiseArgumentTypeInvalid(const char* name, PyObject *obj, PyTypeObject *type) { PyErr_Format(PyExc_TypeError, "Argument '%.200s' has incorrect type (expected %.200s, got %.200s)", name, type->tp_name, Py_TYPE(obj)->tp_name); } static CYTHON_INLINE int __Pyx_ArgTypeTest(PyObject *obj, PyTypeObject *type, int none_allowed, const char *name, int exact) { if (unlikely(!type)) { PyErr_SetString(PyExc_SystemError, "Missing type object"); return 0; } if (none_allowed && obj == Py_None) return 1; else if (exact) { if (likely(Py_TYPE(obj) == type)) return 1; #if PY_MAJOR_VERSION == 2 else if ((type == &PyBaseString_Type) && likely(__Pyx_PyBaseString_CheckExact(obj))) return 1; #endif } else { if (likely(PyObject_TypeCheck(obj, type))) return 1; } __Pyx_RaiseArgumentTypeInvalid(name, obj, type); return 0; } #if CYTHON_COMPILING_IN_CPYTHON static CYTHON_INLINE PyObject* __Pyx_PyObject_Call(PyObject *func, PyObject *arg, PyObject *kw) { PyObject *result; ternaryfunc call = func->ob_type->tp_call; if (unlikely(!call)) return PyObject_Call(func, arg, kw); if (unlikely(Py_EnterRecursiveCall((char*)" while calling a Python object"))) return NULL; result = (*call)(func, arg, kw); Py_LeaveRecursiveCall(); if (unlikely(!result) && unlikely(!PyErr_Occurred())) { PyErr_SetString( PyExc_SystemError, "NULL result without error in PyObject_Call"); } return result; } #endif #if CYTHON_COMPILING_IN_CPYTHON static CYTHON_INLINE PyObject* __Pyx_PyObject_CallMethO(PyObject *func, PyObject *arg) { PyObject *self, *result; PyCFunction cfunc; cfunc = PyCFunction_GET_FUNCTION(func); self = PyCFunction_GET_SELF(func); if (unlikely(Py_EnterRecursiveCall((char*)" while calling a Python object"))) return NULL; result = cfunc(self, arg); Py_LeaveRecursiveCall(); if (unlikely(!result) && unlikely(!PyErr_Occurred())) { PyErr_SetString( PyExc_SystemError, "NULL result without error in PyObject_Call"); } return result; } #endif #if CYTHON_COMPILING_IN_CPYTHON static PyObject* __Pyx__PyObject_CallOneArg(PyObject *func, PyObject *arg) { PyObject *result; PyObject *args = PyTuple_New(1); if (unlikely(!args)) return NULL; Py_INCREF(arg); PyTuple_SET_ITEM(args, 0, arg); result = __Pyx_PyObject_Call(func, args, NULL); Py_DECREF(args); return result; } static CYTHON_INLINE PyObject* __Pyx_PyObject_CallOneArg(PyObject *func, PyObject *arg) { #ifdef __Pyx_CyFunction_USED if (likely(PyCFunction_Check(func) || PyObject_TypeCheck(func, __pyx_CyFunctionType))) { #else if (likely(PyCFunction_Check(func))) { #endif if (likely(PyCFunction_GET_FLAGS(func) & METH_O)) { return __Pyx_PyObject_CallMethO(func, arg); } } return __Pyx__PyObject_CallOneArg(func, arg); } #else static CYTHON_INLINE PyObject* __Pyx_PyObject_CallOneArg(PyObject *func, PyObject *arg) { PyObject* args = PyTuple_Pack(1, arg); return (likely(args)) ? __Pyx_PyObject_Call(func, args, NULL) : NULL; } #endif #if CYTHON_COMPILING_IN_CPYTHON static CYTHON_INLINE PyObject* __Pyx_PyObject_CallNoArg(PyObject *func) { #ifdef __Pyx_CyFunction_USED if (likely(PyCFunction_Check(func) || PyObject_TypeCheck(func, __pyx_CyFunctionType))) { #else if (likely(PyCFunction_Check(func))) { #endif if (likely(PyCFunction_GET_FLAGS(func) & METH_NOARGS)) { return __Pyx_PyObject_CallMethO(func, NULL); } } return __Pyx_PyObject_Call(func, __pyx_empty_tuple, NULL); } #endif static CYTHON_INLINE PyObject *__Pyx_GetModuleGlobalName(PyObject *name) { PyObject *result; #if CYTHON_COMPILING_IN_CPYTHON result = PyDict_GetItem(__pyx_d, name); if (likely(result)) { Py_INCREF(result); } else { #else result = PyObject_GetItem(__pyx_d, name); if (!result) { PyErr_Clear(); #endif result = __Pyx_GetBuiltinName(name); } return result; } static CYTHON_INLINE void __Pyx_ErrRestore(PyObject *type, PyObject *value, PyObject *tb) { #if CYTHON_COMPILING_IN_CPYTHON PyObject *tmp_type, *tmp_value, *tmp_tb; PyThreadState *tstate = PyThreadState_GET(); tmp_type = tstate->curexc_type; tmp_value = tstate->curexc_value; tmp_tb = tstate->curexc_traceback; tstate->curexc_type = type; tstate->curexc_value = value; tstate->curexc_traceback = tb; Py_XDECREF(tmp_type); Py_XDECREF(tmp_value); Py_XDECREF(tmp_tb); #else PyErr_Restore(type, value, tb); #endif } static CYTHON_INLINE void __Pyx_ErrFetch(PyObject **type, PyObject **value, PyObject **tb) { #if CYTHON_COMPILING_IN_CPYTHON PyThreadState *tstate = PyThreadState_GET(); *type = tstate->curexc_type; *value = tstate->curexc_value; *tb = tstate->curexc_traceback; tstate->curexc_type = 0; tstate->curexc_value = 0; tstate->curexc_traceback = 0; #else PyErr_Fetch(type, value, tb); #endif } #if PY_MAJOR_VERSION < 3 static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, CYTHON_UNUSED PyObject *cause) { Py_XINCREF(type); if (!value || value == Py_None) value = NULL; else Py_INCREF(value); if (!tb || tb == Py_None) tb = NULL; else { Py_INCREF(tb); if (!PyTraceBack_Check(tb)) { PyErr_SetString(PyExc_TypeError, "raise: arg 3 must be a traceback or None"); goto raise_error; } } if (PyType_Check(type)) { #if CYTHON_COMPILING_IN_PYPY if (!value) { Py_INCREF(Py_None); value = Py_None; } #endif PyErr_NormalizeException(&type, &value, &tb); } else { if (value) { PyErr_SetString(PyExc_TypeError, "instance exception may not have a separate value"); goto raise_error; } value = type; type = (PyObject*) Py_TYPE(type); Py_INCREF(type); if (!PyType_IsSubtype((PyTypeObject *)type, (PyTypeObject *)PyExc_BaseException)) { PyErr_SetString(PyExc_TypeError, "raise: exception class must be a subclass of BaseException"); goto raise_error; } } __Pyx_ErrRestore(type, value, tb); return; raise_error: Py_XDECREF(value); Py_XDECREF(type); Py_XDECREF(tb); return; } #else static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, PyObject *cause) { PyObject* owned_instance = NULL; if (tb == Py_None) { tb = 0; } else if (tb && !PyTraceBack_Check(tb)) { PyErr_SetString(PyExc_TypeError, "raise: arg 3 must be a traceback or None"); goto bad; } if (value == Py_None) value = 0; if (PyExceptionInstance_Check(type)) { if (value) { PyErr_SetString(PyExc_TypeError, "instance exception may not have a separate value"); goto bad; } value = type; type = (PyObject*) Py_TYPE(value); } else if (PyExceptionClass_Check(type)) { PyObject *instance_class = NULL; if (value && PyExceptionInstance_Check(value)) { instance_class = (PyObject*) Py_TYPE(value); if (instance_class != type) { int is_subclass = PyObject_IsSubclass(instance_class, type); if (!is_subclass) { instance_class = NULL; } else if (unlikely(is_subclass == -1)) { goto bad; } else { type = instance_class; } } } if (!instance_class) { PyObject *args; if (!value) args = PyTuple_New(0); else if (PyTuple_Check(value)) { Py_INCREF(value); args = value; } else args = PyTuple_Pack(1, value); if (!args) goto bad; owned_instance = PyObject_Call(type, args, NULL); Py_DECREF(args); if (!owned_instance) goto bad; value = owned_instance; if (!PyExceptionInstance_Check(value)) { PyErr_Format(PyExc_TypeError, "calling %R should have returned an instance of " "BaseException, not %R", type, Py_TYPE(value)); goto bad; } } } else { PyErr_SetString(PyExc_TypeError, "raise: exception class must be a subclass of BaseException"); goto bad; } #if PY_VERSION_HEX >= 0x03030000 if (cause) { #else if (cause && cause != Py_None) { #endif PyObject *fixed_cause; if (cause == Py_None) { fixed_cause = NULL; } else if (PyExceptionClass_Check(cause)) { fixed_cause = PyObject_CallObject(cause, NULL); if (fixed_cause == NULL) goto bad; } else if (PyExceptionInstance_Check(cause)) { fixed_cause = cause; Py_INCREF(fixed_cause); } else { PyErr_SetString(PyExc_TypeError, "exception causes must derive from " "BaseException"); goto bad; } PyException_SetCause(value, fixed_cause); } PyErr_SetObject(type, value); if (tb) { #if CYTHON_COMPILING_IN_PYPY PyObject *tmp_type, *tmp_value, *tmp_tb; PyErr_Fetch(&tmp_type, &tmp_value, &tmp_tb); Py_INCREF(tb); PyErr_Restore(tmp_type, tmp_value, tb); Py_XDECREF(tmp_tb); #else PyThreadState *tstate = PyThreadState_GET(); PyObject* tmp_tb = tstate->curexc_traceback; if (tb != tmp_tb) { Py_INCREF(tb); tstate->curexc_traceback = tb; Py_XDECREF(tmp_tb); } #endif } bad: Py_XDECREF(owned_instance); return; } #endif static void __Pyx_WriteUnraisable(const char *name, CYTHON_UNUSED int clineno, CYTHON_UNUSED int lineno, CYTHON_UNUSED const char *filename, int full_traceback, CYTHON_UNUSED int nogil) { PyObject *old_exc, *old_val, *old_tb; PyObject *ctx; #ifdef WITH_THREAD PyGILState_STATE state; if (nogil) state = PyGILState_Ensure(); #endif __Pyx_ErrFetch(&old_exc, &old_val, &old_tb); if (full_traceback) { Py_XINCREF(old_exc); Py_XINCREF(old_val); Py_XINCREF(old_tb); __Pyx_ErrRestore(old_exc, old_val, old_tb); PyErr_PrintEx(1); } #if PY_MAJOR_VERSION < 3 ctx = PyString_FromString(name); #else ctx = PyUnicode_FromString(name); #endif __Pyx_ErrRestore(old_exc, old_val, old_tb); if (!ctx) { PyErr_WriteUnraisable(Py_None); } else { PyErr_WriteUnraisable(ctx); Py_DECREF(ctx); } #ifdef WITH_THREAD if (nogil) PyGILState_Release(state); #endif } static CYTHON_INLINE void __Pyx_RaiseTooManyValuesError(Py_ssize_t expected) { PyErr_Format(PyExc_ValueError, "too many values to unpack (expected %" CYTHON_FORMAT_SSIZE_T "d)", expected); } static CYTHON_INLINE void __Pyx_RaiseNeedMoreValuesError(Py_ssize_t index) { PyErr_Format(PyExc_ValueError, "need more than %" CYTHON_FORMAT_SSIZE_T "d value%.1s to unpack", index, (index == 1) ? "" : "s"); } static CYTHON_INLINE int __Pyx_IterFinish(void) { #if CYTHON_COMPILING_IN_CPYTHON PyThreadState *tstate = PyThreadState_GET(); PyObject* exc_type = tstate->curexc_type; if (unlikely(exc_type)) { if (likely(exc_type == PyExc_StopIteration) || PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration)) { PyObject *exc_value, *exc_tb; exc_value = tstate->curexc_value; exc_tb = tstate->curexc_traceback; tstate->curexc_type = 0; tstate->curexc_value = 0; tstate->curexc_traceback = 0; Py_DECREF(exc_type); Py_XDECREF(exc_value); Py_XDECREF(exc_tb); return 0; } else { return -1; } } return 0; #else if (unlikely(PyErr_Occurred())) { if (likely(PyErr_ExceptionMatches(PyExc_StopIteration))) { PyErr_Clear(); return 0; } else { return -1; } } return 0; #endif } static int __Pyx_IternextUnpackEndCheck(PyObject *retval, Py_ssize_t expected) { if (unlikely(retval)) { Py_DECREF(retval); __Pyx_RaiseTooManyValuesError(expected); return -1; } else { return __Pyx_IterFinish(); } return 0; } static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Generic(PyObject *o, PyObject* j) { PyObject *r; if (!j) return NULL; r = PyObject_GetItem(o, j); Py_DECREF(j); return r; } static CYTHON_INLINE PyObject *__Pyx_GetItemInt_List_Fast(PyObject *o, Py_ssize_t i, CYTHON_NCP_UNUSED int wraparound, CYTHON_NCP_UNUSED int boundscheck) { #if CYTHON_COMPILING_IN_CPYTHON if (wraparound & unlikely(i < 0)) i += PyList_GET_SIZE(o); if ((!boundscheck) || likely((0 <= i) & (i < PyList_GET_SIZE(o)))) { PyObject *r = PyList_GET_ITEM(o, i); Py_INCREF(r); return r; } return __Pyx_GetItemInt_Generic(o, PyInt_FromSsize_t(i)); #else return PySequence_GetItem(o, i); #endif } static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Tuple_Fast(PyObject *o, Py_ssize_t i, CYTHON_NCP_UNUSED int wraparound, CYTHON_NCP_UNUSED int boundscheck) { #if CYTHON_COMPILING_IN_CPYTHON if (wraparound & unlikely(i < 0)) i += PyTuple_GET_SIZE(o); if ((!boundscheck) || likely((0 <= i) & (i < PyTuple_GET_SIZE(o)))) { PyObject *r = PyTuple_GET_ITEM(o, i); Py_INCREF(r); return r; } return __Pyx_GetItemInt_Generic(o, PyInt_FromSsize_t(i)); #else return PySequence_GetItem(o, i); #endif } static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Fast(PyObject *o, Py_ssize_t i, int is_list, CYTHON_NCP_UNUSED int wraparound, CYTHON_NCP_UNUSED int boundscheck) { #if CYTHON_COMPILING_IN_CPYTHON if (is_list || PyList_CheckExact(o)) { Py_ssize_t n = ((!wraparound) | likely(i >= 0)) ? i : i + PyList_GET_SIZE(o); if ((!boundscheck) || (likely((n >= 0) & (n < PyList_GET_SIZE(o))))) { PyObject *r = PyList_GET_ITEM(o, n); Py_INCREF(r); return r; } } else if (PyTuple_CheckExact(o)) { Py_ssize_t n = ((!wraparound) | likely(i >= 0)) ? i : i + PyTuple_GET_SIZE(o); if ((!boundscheck) || likely((n >= 0) & (n < PyTuple_GET_SIZE(o)))) { PyObject *r = PyTuple_GET_ITEM(o, n); Py_INCREF(r); return r; } } else { PySequenceMethods *m = Py_TYPE(o)->tp_as_sequence; if (likely(m && m->sq_item)) { if (wraparound && unlikely(i < 0) && likely(m->sq_length)) { Py_ssize_t l = m->sq_length(o); if (likely(l >= 0)) { i += l; } else { if (PyErr_ExceptionMatches(PyExc_OverflowError)) PyErr_Clear(); else return NULL; } } return m->sq_item(o, i); } } #else if (is_list || PySequence_Check(o)) { return PySequence_GetItem(o, i); } #endif return __Pyx_GetItemInt_Generic(o, PyInt_FromSsize_t(i)); } static void* __Pyx_GetVtable(PyObject *dict) { void* ptr; PyObject *ob = PyObject_GetItem(dict, __pyx_n_s_pyx_vtable); if (!ob) goto bad; #if PY_VERSION_HEX >= 0x02070000 ptr = PyCapsule_GetPointer(ob, 0); #else ptr = PyCObject_AsVoidPtr(ob); #endif if (!ptr && !PyErr_Occurred()) PyErr_SetString(PyExc_RuntimeError, "invalid vtable found for imported type"); Py_DECREF(ob); return ptr; bad: Py_XDECREF(ob); return NULL; } static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list, int level) { PyObject *empty_list = 0; PyObject *module = 0; PyObject *global_dict = 0; PyObject *empty_dict = 0; PyObject *list; #if PY_VERSION_HEX < 0x03030000 PyObject *py_import; py_import = __Pyx_PyObject_GetAttrStr(__pyx_b, __pyx_n_s_import); if (!py_import) goto bad; #endif if (from_list) list = from_list; else { empty_list = PyList_New(0); if (!empty_list) goto bad; list = empty_list; } global_dict = PyModule_GetDict(__pyx_m); if (!global_dict) goto bad; empty_dict = PyDict_New(); if (!empty_dict) goto bad; { #if PY_MAJOR_VERSION >= 3 if (level == -1) { if (strchr(__Pyx_MODULE_NAME, '.')) { #if PY_VERSION_HEX < 0x03030000 PyObject *py_level = PyInt_FromLong(1); if (!py_level) goto bad; module = PyObject_CallFunctionObjArgs(py_import, name, global_dict, empty_dict, list, py_level, NULL); Py_DECREF(py_level); #else module = PyImport_ImportModuleLevelObject( name, global_dict, empty_dict, list, 1); #endif if (!module) { if (!PyErr_ExceptionMatches(PyExc_ImportError)) goto bad; PyErr_Clear(); } } level = 0; } #endif if (!module) { #if PY_VERSION_HEX < 0x03030000 PyObject *py_level = PyInt_FromLong(level); if (!py_level) goto bad; module = PyObject_CallFunctionObjArgs(py_import, name, global_dict, empty_dict, list, py_level, NULL); Py_DECREF(py_level); #else module = PyImport_ImportModuleLevelObject( name, global_dict, empty_dict, list, level); #endif } } bad: #if PY_VERSION_HEX < 0x03030000 Py_XDECREF(py_import); #endif Py_XDECREF(empty_list); Py_XDECREF(empty_dict); return module; } static PyObject* __Pyx_ImportFrom(PyObject* module, PyObject* name) { PyObject* value = __Pyx_PyObject_GetAttrStr(module, name); if (unlikely(!value) && PyErr_ExceptionMatches(PyExc_AttributeError)) { PyErr_Format(PyExc_ImportError, #if PY_MAJOR_VERSION < 3 "cannot import name %.230s", PyString_AS_STRING(name)); #else "cannot import name %S", name); #endif } return value; } static int __pyx_bisect_code_objects(__Pyx_CodeObjectCacheEntry* entries, int count, int code_line) { int start = 0, mid = 0, end = count - 1; if (end >= 0 && code_line > entries[end].code_line) { return count; } while (start < end) { mid = start + (end - start) / 2; if (code_line < entries[mid].code_line) { end = mid; } else if (code_line > entries[mid].code_line) { start = mid + 1; } else { return mid; } } if (code_line <= entries[mid].code_line) { return mid; } else { return mid + 1; } } static PyCodeObject *__pyx_find_code_object(int code_line) { PyCodeObject* code_object; int pos; if (unlikely(!code_line) || unlikely(!__pyx_code_cache.entries)) { return NULL; } pos = __pyx_bisect_code_objects(__pyx_code_cache.entries, __pyx_code_cache.count, code_line); if (unlikely(pos >= __pyx_code_cache.count) || unlikely(__pyx_code_cache.entries[pos].code_line != code_line)) { return NULL; } code_object = __pyx_code_cache.entries[pos].code_object; Py_INCREF(code_object); return code_object; } static void __pyx_insert_code_object(int code_line, PyCodeObject* code_object) { int pos, i; __Pyx_CodeObjectCacheEntry* entries = __pyx_code_cache.entries; if (unlikely(!code_line)) { return; } if (unlikely(!entries)) { entries = (__Pyx_CodeObjectCacheEntry*)PyMem_Malloc(64*sizeof(__Pyx_CodeObjectCacheEntry)); if (likely(entries)) { __pyx_code_cache.entries = entries; __pyx_code_cache.max_count = 64; __pyx_code_cache.count = 1; entries[0].code_line = code_line; entries[0].code_object = code_object; Py_INCREF(code_object); } return; } pos = __pyx_bisect_code_objects(__pyx_code_cache.entries, __pyx_code_cache.count, code_line); if ((pos < __pyx_code_cache.count) && unlikely(__pyx_code_cache.entries[pos].code_line == code_line)) { PyCodeObject* tmp = entries[pos].code_object; entries[pos].code_object = code_object; Py_DECREF(tmp); return; } if (__pyx_code_cache.count == __pyx_code_cache.max_count) { int new_max = __pyx_code_cache.max_count + 64; entries = (__Pyx_CodeObjectCacheEntry*)PyMem_Realloc( __pyx_code_cache.entries, (size_t)new_max*sizeof(__Pyx_CodeObjectCacheEntry)); if (unlikely(!entries)) { return; } __pyx_code_cache.entries = entries; __pyx_code_cache.max_count = new_max; } for (i=__pyx_code_cache.count; i>pos; i--) { entries[i] = entries[i-1]; } entries[pos].code_line = code_line; entries[pos].code_object = code_object; __pyx_code_cache.count++; Py_INCREF(code_object); } #include "compile.h" #include "frameobject.h" #include "traceback.h" static PyCodeObject* __Pyx_CreateCodeObjectForTraceback( const char *funcname, int c_line, int py_line, const char *filename) { PyCodeObject *py_code = 0; PyObject *py_srcfile = 0; PyObject *py_funcname = 0; #if PY_MAJOR_VERSION < 3 py_srcfile = PyString_FromString(filename); #else py_srcfile = PyUnicode_FromString(filename); #endif if (!py_srcfile) goto bad; if (c_line) { #if PY_MAJOR_VERSION < 3 py_funcname = PyString_FromFormat( "%s (%s:%d)", funcname, __pyx_cfilenm, c_line); #else py_funcname = PyUnicode_FromFormat( "%s (%s:%d)", funcname, __pyx_cfilenm, c_line); #endif } else { #if PY_MAJOR_VERSION < 3 py_funcname = PyString_FromString(funcname); #else py_funcname = PyUnicode_FromString(funcname); #endif } if (!py_funcname) goto bad; py_code = __Pyx_PyCode_New( 0, 0, 0, 0, 0, __pyx_empty_bytes, /*PyObject *code,*/ __pyx_empty_tuple, /*PyObject *consts,*/ __pyx_empty_tuple, /*PyObject *names,*/ __pyx_empty_tuple, /*PyObject *varnames,*/ __pyx_empty_tuple, /*PyObject *freevars,*/ __pyx_empty_tuple, /*PyObject *cellvars,*/ py_srcfile, /*PyObject *filename,*/ py_funcname, /*PyObject *name,*/ py_line, __pyx_empty_bytes /*PyObject *lnotab*/ ); Py_DECREF(py_srcfile); Py_DECREF(py_funcname); return py_code; bad: Py_XDECREF(py_srcfile); Py_XDECREF(py_funcname); return NULL; } static void __Pyx_AddTraceback(const char *funcname, int c_line, int py_line, const char *filename) { PyCodeObject *py_code = 0; PyFrameObject *py_frame = 0; py_code = __pyx_find_code_object(c_line ? c_line : py_line); if (!py_code) { py_code = __Pyx_CreateCodeObjectForTraceback( funcname, c_line, py_line, filename); if (!py_code) goto bad; __pyx_insert_code_object(c_line ? c_line : py_line, py_code); } py_frame = PyFrame_New( PyThreadState_GET(), /*PyThreadState *tstate,*/ py_code, /*PyCodeObject *code,*/ __pyx_d, /*PyObject *globals,*/ 0 /*PyObject *locals*/ ); if (!py_frame) goto bad; py_frame->f_lineno = py_line; PyTraceBack_Here(py_frame); bad: Py_XDECREF(py_code); Py_XDECREF(py_frame); } #define __PYX_VERIFY_RETURN_INT(target_type, func_type, func_value)\ __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, 0) #define __PYX_VERIFY_RETURN_INT_EXC(target_type, func_type, func_value)\ __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, 1) #define __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, exc)\ {\ func_type value = func_value;\ if (sizeof(target_type) < sizeof(func_type)) {\ if (unlikely(value != (func_type) (target_type) value)) {\ func_type zero = 0;\ if (exc && unlikely(value == (func_type)-1 && PyErr_Occurred()))\ return (target_type) -1;\ if (is_unsigned && unlikely(value < zero))\ goto raise_neg_overflow;\ else\ goto raise_overflow;\ }\ }\ return (target_type) value;\ } #if CYTHON_USE_PYLONG_INTERNALS #include "longintrepr.h" #endif static CYTHON_INLINE int __Pyx_PyInt_As_int(PyObject *x) { const int neg_one = (int) -1, const_zero = (int) 0; const int is_unsigned = neg_one > const_zero; #if PY_MAJOR_VERSION < 3 if (likely(PyInt_Check(x))) { if (sizeof(int) < sizeof(long)) { __PYX_VERIFY_RETURN_INT(int, long, PyInt_AS_LONG(x)) } else { long val = PyInt_AS_LONG(x); if (is_unsigned && unlikely(val < 0)) { goto raise_neg_overflow; } return (int) val; } } else #endif if (likely(PyLong_Check(x))) { if (is_unsigned) { #if CYTHON_USE_PYLONG_INTERNALS const digit* digits = ((PyLongObject*)x)->ob_digit; switch (Py_SIZE(x)) { case 0: return (int) 0; case 1: __PYX_VERIFY_RETURN_INT(int, digit, digits[0]) case 2: if (8 * sizeof(int) > 1 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(int) >= 2 * PyLong_SHIFT) { return (int) (((((int)digits[1]) << PyLong_SHIFT) | (int)digits[0])); } } break; case 3: if (8 * sizeof(int) > 2 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(int) >= 3 * PyLong_SHIFT) { return (int) (((((((int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0])); } } break; case 4: if (8 * sizeof(int) > 3 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(int) >= 4 * PyLong_SHIFT) { return (int) (((((((((int)digits[3]) << PyLong_SHIFT) | (int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0])); } } break; } #endif #if CYTHON_COMPILING_IN_CPYTHON if (unlikely(Py_SIZE(x) < 0)) { goto raise_neg_overflow; } #else { int result = PyObject_RichCompareBool(x, Py_False, Py_LT); if (unlikely(result < 0)) return (int) -1; if (unlikely(result == 1)) goto raise_neg_overflow; } #endif if (sizeof(int) <= sizeof(unsigned long)) { __PYX_VERIFY_RETURN_INT_EXC(int, unsigned long, PyLong_AsUnsignedLong(x)) } else if (sizeof(int) <= sizeof(unsigned PY_LONG_LONG)) { __PYX_VERIFY_RETURN_INT_EXC(int, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x)) } } else { #if CYTHON_USE_PYLONG_INTERNALS const digit* digits = ((PyLongObject*)x)->ob_digit; switch (Py_SIZE(x)) { case 0: return (int) 0; case -1: __PYX_VERIFY_RETURN_INT(int, sdigit, -(sdigit) digits[0]) case 1: __PYX_VERIFY_RETURN_INT(int, digit, +digits[0]) case -2: if (8 * sizeof(int) - 1 > 1 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(int, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(int) - 1 > 2 * PyLong_SHIFT) { return (int) (((int)-1)*(((((int)digits[1]) << PyLong_SHIFT) | (int)digits[0]))); } } break; case 2: if (8 * sizeof(int) > 1 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(int) - 1 > 2 * PyLong_SHIFT) { return (int) ((((((int)digits[1]) << PyLong_SHIFT) | (int)digits[0]))); } } break; case -3: if (8 * sizeof(int) - 1 > 2 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(int, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(int) - 1 > 3 * PyLong_SHIFT) { return (int) (((int)-1)*(((((((int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0]))); } } break; case 3: if (8 * sizeof(int) > 2 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(int) - 1 > 3 * PyLong_SHIFT) { return (int) ((((((((int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0]))); } } break; case -4: if (8 * sizeof(int) - 1 > 3 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(int, long, -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(int) - 1 > 4 * PyLong_SHIFT) { return (int) (((int)-1)*(((((((((int)digits[3]) << PyLong_SHIFT) | (int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0]))); } } break; case 4: if (8 * sizeof(int) > 3 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(int) - 1 > 4 * PyLong_SHIFT) { return (int) ((((((((((int)digits[3]) << PyLong_SHIFT) | (int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0]))); } } break; } #endif if (sizeof(int) <= sizeof(long)) { __PYX_VERIFY_RETURN_INT_EXC(int, long, PyLong_AsLong(x)) } else if (sizeof(int) <= sizeof(PY_LONG_LONG)) { __PYX_VERIFY_RETURN_INT_EXC(int, PY_LONG_LONG, PyLong_AsLongLong(x)) } } { #if CYTHON_COMPILING_IN_PYPY && !defined(_PyLong_AsByteArray) PyErr_SetString(PyExc_RuntimeError, "_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers"); #else int val; PyObject *v = __Pyx_PyNumber_Int(x); #if PY_MAJOR_VERSION < 3 if (likely(v) && !PyLong_Check(v)) { PyObject *tmp = v; v = PyNumber_Long(tmp); Py_DECREF(tmp); } #endif if (likely(v)) { int one = 1; int is_little = (int)*(unsigned char *)&one; unsigned char *bytes = (unsigned char *)&val; int ret = _PyLong_AsByteArray((PyLongObject *)v, bytes, sizeof(val), is_little, !is_unsigned); Py_DECREF(v); if (likely(!ret)) return val; } #endif return (int) -1; } } else { int val; PyObject *tmp = __Pyx_PyNumber_Int(x); if (!tmp) return (int) -1; val = __Pyx_PyInt_As_int(tmp); Py_DECREF(tmp); return val; } raise_overflow: PyErr_SetString(PyExc_OverflowError, "value too large to convert to int"); return (int) -1; raise_neg_overflow: PyErr_SetString(PyExc_OverflowError, "can't convert negative value to int"); return (int) -1; } static CYTHON_INLINE PyObject* __Pyx_PyInt_From_int(int value) { const int neg_one = (int) -1, const_zero = (int) 0; const int is_unsigned = neg_one > const_zero; if (is_unsigned) { if (sizeof(int) < sizeof(long)) { return PyInt_FromLong((long) value); } else if (sizeof(int) <= sizeof(unsigned long)) { return PyLong_FromUnsignedLong((unsigned long) value); } else if (sizeof(int) <= sizeof(unsigned PY_LONG_LONG)) { return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value); } } else { if (sizeof(int) <= sizeof(long)) { return PyInt_FromLong((long) value); } else if (sizeof(int) <= sizeof(PY_LONG_LONG)) { return PyLong_FromLongLong((PY_LONG_LONG) value); } } { int one = 1; int little = (int)*(unsigned char *)&one; unsigned char *bytes = (unsigned char *)&value; return _PyLong_FromByteArray(bytes, sizeof(int), little, !is_unsigned); } } static CYTHON_INLINE PyObject* __Pyx_PyInt_From_long(long value) { const long neg_one = (long) -1, const_zero = (long) 0; const int is_unsigned = neg_one > const_zero; if (is_unsigned) { if (sizeof(long) < sizeof(long)) { return PyInt_FromLong((long) value); } else if (sizeof(long) <= sizeof(unsigned long)) { return PyLong_FromUnsignedLong((unsigned long) value); } else if (sizeof(long) <= sizeof(unsigned PY_LONG_LONG)) { return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value); } } else { if (sizeof(long) <= sizeof(long)) { return PyInt_FromLong((long) value); } else if (sizeof(long) <= sizeof(PY_LONG_LONG)) { return PyLong_FromLongLong((PY_LONG_LONG) value); } } { int one = 1; int little = (int)*(unsigned char *)&one; unsigned char *bytes = (unsigned char *)&value; return _PyLong_FromByteArray(bytes, sizeof(long), little, !is_unsigned); } } static CYTHON_INLINE long __Pyx_PyInt_As_long(PyObject *x) { const long neg_one = (long) -1, const_zero = (long) 0; const int is_unsigned = neg_one > const_zero; #if PY_MAJOR_VERSION < 3 if (likely(PyInt_Check(x))) { if (sizeof(long) < sizeof(long)) { __PYX_VERIFY_RETURN_INT(long, long, PyInt_AS_LONG(x)) } else { long val = PyInt_AS_LONG(x); if (is_unsigned && unlikely(val < 0)) { goto raise_neg_overflow; } return (long) val; } } else #endif if (likely(PyLong_Check(x))) { if (is_unsigned) { #if CYTHON_USE_PYLONG_INTERNALS const digit* digits = ((PyLongObject*)x)->ob_digit; switch (Py_SIZE(x)) { case 0: return (long) 0; case 1: __PYX_VERIFY_RETURN_INT(long, digit, digits[0]) case 2: if (8 * sizeof(long) > 1 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(long) >= 2 * PyLong_SHIFT) { return (long) (((((long)digits[1]) << PyLong_SHIFT) | (long)digits[0])); } } break; case 3: if (8 * sizeof(long) > 2 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(long) >= 3 * PyLong_SHIFT) { return (long) (((((((long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0])); } } break; case 4: if (8 * sizeof(long) > 3 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(long) >= 4 * PyLong_SHIFT) { return (long) (((((((((long)digits[3]) << PyLong_SHIFT) | (long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0])); } } break; } #endif #if CYTHON_COMPILING_IN_CPYTHON if (unlikely(Py_SIZE(x) < 0)) { goto raise_neg_overflow; } #else { int result = PyObject_RichCompareBool(x, Py_False, Py_LT); if (unlikely(result < 0)) return (long) -1; if (unlikely(result == 1)) goto raise_neg_overflow; } #endif if (sizeof(long) <= sizeof(unsigned long)) { __PYX_VERIFY_RETURN_INT_EXC(long, unsigned long, PyLong_AsUnsignedLong(x)) } else if (sizeof(long) <= sizeof(unsigned PY_LONG_LONG)) { __PYX_VERIFY_RETURN_INT_EXC(long, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x)) } } else { #if CYTHON_USE_PYLONG_INTERNALS const digit* digits = ((PyLongObject*)x)->ob_digit; switch (Py_SIZE(x)) { case 0: return (long) 0; case -1: __PYX_VERIFY_RETURN_INT(long, sdigit, -(sdigit) digits[0]) case 1: __PYX_VERIFY_RETURN_INT(long, digit, +digits[0]) case -2: if (8 * sizeof(long) - 1 > 1 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(long, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) { return (long) (((long)-1)*(((((long)digits[1]) << PyLong_SHIFT) | (long)digits[0]))); } } break; case 2: if (8 * sizeof(long) > 1 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) { return (long) ((((((long)digits[1]) << PyLong_SHIFT) | (long)digits[0]))); } } break; case -3: if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(long, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) { return (long) (((long)-1)*(((((((long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0]))); } } break; case 3: if (8 * sizeof(long) > 2 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) { return (long) ((((((((long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0]))); } } break; case -4: if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(long, long, -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(long) - 1 > 4 * PyLong_SHIFT) { return (long) (((long)-1)*(((((((((long)digits[3]) << PyLong_SHIFT) | (long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0]))); } } break; case 4: if (8 * sizeof(long) > 3 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(long) - 1 > 4 * PyLong_SHIFT) { return (long) ((((((((((long)digits[3]) << PyLong_SHIFT) | (long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0]))); } } break; } #endif if (sizeof(long) <= sizeof(long)) { __PYX_VERIFY_RETURN_INT_EXC(long, long, PyLong_AsLong(x)) } else if (sizeof(long) <= sizeof(PY_LONG_LONG)) { __PYX_VERIFY_RETURN_INT_EXC(long, PY_LONG_LONG, PyLong_AsLongLong(x)) } } { #if CYTHON_COMPILING_IN_PYPY && !defined(_PyLong_AsByteArray) PyErr_SetString(PyExc_RuntimeError, "_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers"); #else long val; PyObject *v = __Pyx_PyNumber_Int(x); #if PY_MAJOR_VERSION < 3 if (likely(v) && !PyLong_Check(v)) { PyObject *tmp = v; v = PyNumber_Long(tmp); Py_DECREF(tmp); } #endif if (likely(v)) { int one = 1; int is_little = (int)*(unsigned char *)&one; unsigned char *bytes = (unsigned char *)&val; int ret = _PyLong_AsByteArray((PyLongObject *)v, bytes, sizeof(val), is_little, !is_unsigned); Py_DECREF(v); if (likely(!ret)) return val; } #endif return (long) -1; } } else { long val; PyObject *tmp = __Pyx_PyNumber_Int(x); if (!tmp) return (long) -1; val = __Pyx_PyInt_As_long(tmp); Py_DECREF(tmp); return val; } raise_overflow: PyErr_SetString(PyExc_OverflowError, "value too large to convert to long"); return (long) -1; raise_neg_overflow: PyErr_SetString(PyExc_OverflowError, "can't convert negative value to long"); return (long) -1; } static int __Pyx_check_binary_version(void) { char ctversion[4], rtversion[4]; PyOS_snprintf(ctversion, 4, "%d.%d", PY_MAJOR_VERSION, PY_MINOR_VERSION); PyOS_snprintf(rtversion, 4, "%s", Py_GetVersion()); if (ctversion[0] != rtversion[0] || ctversion[2] != rtversion[2]) { char message[200]; PyOS_snprintf(message, sizeof(message), "compiletime version %s of module '%.100s' " "does not match runtime version %s", ctversion, __Pyx_MODULE_NAME, rtversion); return PyErr_WarnEx(NULL, message, 1); } return 0; } #ifndef __PYX_HAVE_RT_ImportModule #define __PYX_HAVE_RT_ImportModule static PyObject *__Pyx_ImportModule(const char *name) { PyObject *py_name = 0; PyObject *py_module = 0; py_name = __Pyx_PyIdentifier_FromString(name); if (!py_name) goto bad; py_module = PyImport_Import(py_name); Py_DECREF(py_name); return py_module; bad: Py_XDECREF(py_name); return 0; } #endif #ifndef __PYX_HAVE_RT_ImportType #define __PYX_HAVE_RT_ImportType static PyTypeObject *__Pyx_ImportType(const char *module_name, const char *class_name, size_t size, int strict) { PyObject *py_module = 0; PyObject *result = 0; PyObject *py_name = 0; char warning[200]; Py_ssize_t basicsize; #ifdef Py_LIMITED_API PyObject *py_basicsize; #endif py_module = __Pyx_ImportModule(module_name); if (!py_module) goto bad; py_name = __Pyx_PyIdentifier_FromString(class_name); if (!py_name) goto bad; result = PyObject_GetAttr(py_module, py_name); Py_DECREF(py_name); py_name = 0; Py_DECREF(py_module); py_module = 0; if (!result) goto bad; if (!PyType_Check(result)) { PyErr_Format(PyExc_TypeError, "%.200s.%.200s is not a type object", module_name, class_name); goto bad; } #ifndef Py_LIMITED_API basicsize = ((PyTypeObject *)result)->tp_basicsize; #else py_basicsize = PyObject_GetAttrString(result, "__basicsize__"); if (!py_basicsize) goto bad; basicsize = PyLong_AsSsize_t(py_basicsize); Py_DECREF(py_basicsize); py_basicsize = 0; if (basicsize == (Py_ssize_t)-1 && PyErr_Occurred()) goto bad; #endif if (!strict && (size_t)basicsize > size) { PyOS_snprintf(warning, sizeof(warning), "%s.%s size changed, may indicate binary incompatibility", module_name, class_name); if (PyErr_WarnEx(NULL, warning, 0) < 0) goto bad; } else if ((size_t)basicsize != size) { PyErr_Format(PyExc_ValueError, "%.200s.%.200s has the wrong size, try recompiling", module_name, class_name); goto bad; } return (PyTypeObject *)result; bad: Py_XDECREF(py_module); Py_XDECREF(result); return NULL; } #endif static int __Pyx_InitStrings(__Pyx_StringTabEntry *t) { while (t->p) { #if PY_MAJOR_VERSION < 3 if (t->is_unicode) { *t->p = PyUnicode_DecodeUTF8(t->s, t->n - 1, NULL); } else if (t->intern) { *t->p = PyString_InternFromString(t->s); } else { *t->p = PyString_FromStringAndSize(t->s, t->n - 1); } #else if (t->is_unicode | t->is_str) { if (t->intern) { *t->p = PyUnicode_InternFromString(t->s); } else if (t->encoding) { *t->p = PyUnicode_Decode(t->s, t->n - 1, t->encoding, NULL); } else { *t->p = PyUnicode_FromStringAndSize(t->s, t->n - 1); } } else { *t->p = PyBytes_FromStringAndSize(t->s, t->n - 1); } #endif if (!*t->p) return -1; ++t; } return 0; } static CYTHON_INLINE PyObject* __Pyx_PyUnicode_FromString(const char* c_str) { return __Pyx_PyUnicode_FromStringAndSize(c_str, (Py_ssize_t)strlen(c_str)); } static CYTHON_INLINE char* __Pyx_PyObject_AsString(PyObject* o) { Py_ssize_t ignore; return __Pyx_PyObject_AsStringAndSize(o, &ignore); } static CYTHON_INLINE char* __Pyx_PyObject_AsStringAndSize(PyObject* o, Py_ssize_t *length) { #if CYTHON_COMPILING_IN_CPYTHON && (__PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT) if ( #if PY_MAJOR_VERSION < 3 && __PYX_DEFAULT_STRING_ENCODING_IS_ASCII __Pyx_sys_getdefaultencoding_not_ascii && #endif PyUnicode_Check(o)) { #if PY_VERSION_HEX < 0x03030000 char* defenc_c; PyObject* defenc = _PyUnicode_AsDefaultEncodedString(o, NULL); if (!defenc) return NULL; defenc_c = PyBytes_AS_STRING(defenc); #if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII { char* end = defenc_c + PyBytes_GET_SIZE(defenc); char* c; for (c = defenc_c; c < end; c++) { if ((unsigned char) (*c) >= 128) { PyUnicode_AsASCIIString(o); return NULL; } } } #endif *length = PyBytes_GET_SIZE(defenc); return defenc_c; #else if (__Pyx_PyUnicode_READY(o) == -1) return NULL; #if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII if (PyUnicode_IS_ASCII(o)) { *length = PyUnicode_GET_LENGTH(o); return PyUnicode_AsUTF8(o); } else { PyUnicode_AsASCIIString(o); return NULL; } #else return PyUnicode_AsUTF8AndSize(o, length); #endif #endif } else #endif #if (!CYTHON_COMPILING_IN_PYPY) || (defined(PyByteArray_AS_STRING) && defined(PyByteArray_GET_SIZE)) if (PyByteArray_Check(o)) { *length = PyByteArray_GET_SIZE(o); return PyByteArray_AS_STRING(o); } else #endif { char* result; int r = PyBytes_AsStringAndSize(o, &result, length); if (unlikely(r < 0)) { return NULL; } else { return result; } } } static CYTHON_INLINE int __Pyx_PyObject_IsTrue(PyObject* x) { int is_true = x == Py_True; if (is_true | (x == Py_False) | (x == Py_None)) return is_true; else return PyObject_IsTrue(x); } static CYTHON_INLINE PyObject* __Pyx_PyNumber_Int(PyObject* x) { PyNumberMethods *m; const char *name = NULL; PyObject *res = NULL; #if PY_MAJOR_VERSION < 3 if (PyInt_Check(x) || PyLong_Check(x)) #else if (PyLong_Check(x)) #endif return __Pyx_NewRef(x); m = Py_TYPE(x)->tp_as_number; #if PY_MAJOR_VERSION < 3 if (m && m->nb_int) { name = "int"; res = PyNumber_Int(x); } else if (m && m->nb_long) { name = "long"; res = PyNumber_Long(x); } #else if (m && m->nb_int) { name = "int"; res = PyNumber_Long(x); } #endif if (res) { #if PY_MAJOR_VERSION < 3 if (!PyInt_Check(res) && !PyLong_Check(res)) { #else if (!PyLong_Check(res)) { #endif PyErr_Format(PyExc_TypeError, "__%.4s__ returned non-%.4s (type %.200s)", name, name, Py_TYPE(res)->tp_name); Py_DECREF(res); return NULL; } } else if (!PyErr_Occurred()) { PyErr_SetString(PyExc_TypeError, "an integer is required"); } return res; } static CYTHON_INLINE Py_ssize_t __Pyx_PyIndex_AsSsize_t(PyObject* b) { Py_ssize_t ival; PyObject *x; #if PY_MAJOR_VERSION < 3 if (likely(PyInt_CheckExact(b))) { if (sizeof(Py_ssize_t) >= sizeof(long)) return PyInt_AS_LONG(b); else return PyInt_AsSsize_t(x); } #endif if (likely(PyLong_CheckExact(b))) { #if CYTHON_USE_PYLONG_INTERNALS const digit* digits = ((PyLongObject*)b)->ob_digit; const Py_ssize_t size = Py_SIZE(b); if (likely(__Pyx_sst_abs(size) <= 1)) { ival = likely(size) ? digits[0] : 0; if (size == -1) ival = -ival; return ival; } else { switch (size) { case 2: if (8 * sizeof(Py_ssize_t) > 2 * PyLong_SHIFT) { return (Py_ssize_t) (((((size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])); } break; case -2: if (8 * sizeof(Py_ssize_t) > 2 * PyLong_SHIFT) { return -(Py_ssize_t) (((((size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])); } break; case 3: if (8 * sizeof(Py_ssize_t) > 3 * PyLong_SHIFT) { return (Py_ssize_t) (((((((size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])); } break; case -3: if (8 * sizeof(Py_ssize_t) > 3 * PyLong_SHIFT) { return -(Py_ssize_t) (((((((size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])); } break; case 4: if (8 * sizeof(Py_ssize_t) > 4 * PyLong_SHIFT) { return (Py_ssize_t) (((((((((size_t)digits[3]) << PyLong_SHIFT) | (size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])); } break; case -4: if (8 * sizeof(Py_ssize_t) > 4 * PyLong_SHIFT) { return -(Py_ssize_t) (((((((((size_t)digits[3]) << PyLong_SHIFT) | (size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])); } break; } } #endif return PyLong_AsSsize_t(b); } x = PyNumber_Index(b); if (!x) return -1; ival = PyInt_AsSsize_t(x); Py_DECREF(x); return ival; } static CYTHON_INLINE PyObject * __Pyx_PyInt_FromSize_t(size_t ival) { return PyInt_FromSize_t(ival); } #endif /* Py_PYTHON_H */ pygame_sdl2-2.1.0-for-renpy-6.99.14.1/gen3/pygame_sdl2.scrap.c0000664000175000017500000037722212665223546022613 0ustar tomtom00000000000000/* Generated by Cython 0.23.3 */ #define PY_SSIZE_T_CLEAN #include "Python.h" #ifndef Py_PYTHON_H #error Python headers needed to compile C extensions, please install development version of Python. #elif PY_VERSION_HEX < 0x02060000 || (0x03000000 <= PY_VERSION_HEX && PY_VERSION_HEX < 0x03020000) #error Cython requires Python 2.6+ or Python 3.2+. #else #define CYTHON_ABI "0_23_3" #include #ifndef offsetof #define offsetof(type, member) ( (size_t) & ((type*)0) -> member ) #endif #if !defined(WIN32) && !defined(MS_WINDOWS) #ifndef __stdcall #define __stdcall #endif #ifndef __cdecl #define __cdecl #endif #ifndef __fastcall #define __fastcall #endif #endif #ifndef DL_IMPORT #define DL_IMPORT(t) t #endif #ifndef DL_EXPORT #define DL_EXPORT(t) t #endif #ifndef PY_LONG_LONG #define PY_LONG_LONG LONG_LONG #endif #ifndef Py_HUGE_VAL #define Py_HUGE_VAL HUGE_VAL #endif #ifdef PYPY_VERSION #define CYTHON_COMPILING_IN_PYPY 1 #define CYTHON_COMPILING_IN_CPYTHON 0 #else #define CYTHON_COMPILING_IN_PYPY 0 #define CYTHON_COMPILING_IN_CPYTHON 1 #endif #if !defined(CYTHON_USE_PYLONG_INTERNALS) && CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x02070000 #define CYTHON_USE_PYLONG_INTERNALS 1 #endif #if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX < 0x02070600 && !defined(Py_OptimizeFlag) #define Py_OptimizeFlag 0 #endif #define __PYX_BUILD_PY_SSIZE_T "n" #define CYTHON_FORMAT_SSIZE_T "z" #if PY_MAJOR_VERSION < 3 #define __Pyx_BUILTIN_MODULE_NAME "__builtin__" #define __Pyx_PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)\ PyCode_New(a+k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos) #define __Pyx_DefaultClassType PyClass_Type #else #define __Pyx_BUILTIN_MODULE_NAME "builtins" #define __Pyx_PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)\ PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos) #define __Pyx_DefaultClassType PyType_Type #endif #ifndef Py_TPFLAGS_CHECKTYPES #define Py_TPFLAGS_CHECKTYPES 0 #endif #ifndef Py_TPFLAGS_HAVE_INDEX #define Py_TPFLAGS_HAVE_INDEX 0 #endif #ifndef Py_TPFLAGS_HAVE_NEWBUFFER #define Py_TPFLAGS_HAVE_NEWBUFFER 0 #endif #ifndef Py_TPFLAGS_HAVE_FINALIZE #define Py_TPFLAGS_HAVE_FINALIZE 0 #endif #if PY_VERSION_HEX > 0x03030000 && defined(PyUnicode_KIND) #define CYTHON_PEP393_ENABLED 1 #define __Pyx_PyUnicode_READY(op) (likely(PyUnicode_IS_READY(op)) ?\ 0 : _PyUnicode_Ready((PyObject *)(op))) #define __Pyx_PyUnicode_GET_LENGTH(u) PyUnicode_GET_LENGTH(u) #define __Pyx_PyUnicode_READ_CHAR(u, i) PyUnicode_READ_CHAR(u, i) #define __Pyx_PyUnicode_KIND(u) PyUnicode_KIND(u) #define __Pyx_PyUnicode_DATA(u) PyUnicode_DATA(u) #define __Pyx_PyUnicode_READ(k, d, i) PyUnicode_READ(k, d, i) #else #define CYTHON_PEP393_ENABLED 0 #define __Pyx_PyUnicode_READY(op) (0) #define __Pyx_PyUnicode_GET_LENGTH(u) PyUnicode_GET_SIZE(u) #define __Pyx_PyUnicode_READ_CHAR(u, i) ((Py_UCS4)(PyUnicode_AS_UNICODE(u)[i])) #define __Pyx_PyUnicode_KIND(u) (sizeof(Py_UNICODE)) #define __Pyx_PyUnicode_DATA(u) ((void*)PyUnicode_AS_UNICODE(u)) #define __Pyx_PyUnicode_READ(k, d, i) ((void)(k), (Py_UCS4)(((Py_UNICODE*)d)[i])) #endif #if CYTHON_COMPILING_IN_PYPY #define __Pyx_PyUnicode_Concat(a, b) PyNumber_Add(a, b) #define __Pyx_PyUnicode_ConcatSafe(a, b) PyNumber_Add(a, b) #else #define __Pyx_PyUnicode_Concat(a, b) PyUnicode_Concat(a, b) #define __Pyx_PyUnicode_ConcatSafe(a, b) ((unlikely((a) == Py_None) || unlikely((b) == Py_None)) ?\ PyNumber_Add(a, b) : __Pyx_PyUnicode_Concat(a, b)) #endif #if CYTHON_COMPILING_IN_PYPY && !defined(PyUnicode_Contains) #define PyUnicode_Contains(u, s) PySequence_Contains(u, s) #endif #define __Pyx_PyString_FormatSafe(a, b) ((unlikely((a) == Py_None)) ? PyNumber_Remainder(a, b) : __Pyx_PyString_Format(a, b)) #define __Pyx_PyUnicode_FormatSafe(a, b) ((unlikely((a) == Py_None)) ? PyNumber_Remainder(a, b) : PyUnicode_Format(a, b)) #if PY_MAJOR_VERSION >= 3 #define __Pyx_PyString_Format(a, b) PyUnicode_Format(a, b) #else #define __Pyx_PyString_Format(a, b) PyString_Format(a, b) #endif #if PY_MAJOR_VERSION >= 3 #define PyBaseString_Type PyUnicode_Type #define PyStringObject PyUnicodeObject #define PyString_Type PyUnicode_Type #define PyString_Check PyUnicode_Check #define PyString_CheckExact PyUnicode_CheckExact #endif #if PY_MAJOR_VERSION >= 3 #define __Pyx_PyBaseString_Check(obj) PyUnicode_Check(obj) #define __Pyx_PyBaseString_CheckExact(obj) PyUnicode_CheckExact(obj) #else #define __Pyx_PyBaseString_Check(obj) (PyString_Check(obj) || PyUnicode_Check(obj)) #define __Pyx_PyBaseString_CheckExact(obj) (PyString_CheckExact(obj) || PyUnicode_CheckExact(obj)) #endif #ifndef PySet_CheckExact #define PySet_CheckExact(obj) (Py_TYPE(obj) == &PySet_Type) #endif #define __Pyx_TypeCheck(obj, type) PyObject_TypeCheck(obj, (PyTypeObject *)type) #if PY_MAJOR_VERSION >= 3 #define PyIntObject PyLongObject #define PyInt_Type PyLong_Type #define PyInt_Check(op) PyLong_Check(op) #define PyInt_CheckExact(op) PyLong_CheckExact(op) #define PyInt_FromString PyLong_FromString #define PyInt_FromUnicode PyLong_FromUnicode #define PyInt_FromLong PyLong_FromLong #define PyInt_FromSize_t PyLong_FromSize_t #define PyInt_FromSsize_t PyLong_FromSsize_t #define PyInt_AsLong PyLong_AsLong #define PyInt_AS_LONG PyLong_AS_LONG #define PyInt_AsSsize_t PyLong_AsSsize_t #define PyInt_AsUnsignedLongMask PyLong_AsUnsignedLongMask #define PyInt_AsUnsignedLongLongMask PyLong_AsUnsignedLongLongMask #define PyNumber_Int PyNumber_Long #endif #if PY_MAJOR_VERSION >= 3 #define PyBoolObject PyLongObject #endif #if PY_MAJOR_VERSION >= 3 && CYTHON_COMPILING_IN_PYPY #ifndef PyUnicode_InternFromString #define PyUnicode_InternFromString(s) PyUnicode_FromString(s) #endif #endif #if PY_VERSION_HEX < 0x030200A4 typedef long Py_hash_t; #define __Pyx_PyInt_FromHash_t PyInt_FromLong #define __Pyx_PyInt_AsHash_t PyInt_AsLong #else #define __Pyx_PyInt_FromHash_t PyInt_FromSsize_t #define __Pyx_PyInt_AsHash_t PyInt_AsSsize_t #endif #if PY_MAJOR_VERSION >= 3 #define __Pyx_PyMethod_New(func, self, klass) ((self) ? PyMethod_New(func, self) : PyInstanceMethod_New(func)) #else #define __Pyx_PyMethod_New(func, self, klass) PyMethod_New(func, self, klass) #endif #if PY_VERSION_HEX >= 0x030500B1 #define __Pyx_PyAsyncMethodsStruct PyAsyncMethods #define __Pyx_PyType_AsAsync(obj) (Py_TYPE(obj)->tp_as_async) #elif CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3 typedef struct { unaryfunc am_await; unaryfunc am_aiter; unaryfunc am_anext; } __Pyx_PyAsyncMethodsStruct; #define __Pyx_PyType_AsAsync(obj) ((__Pyx_PyAsyncMethodsStruct*) (Py_TYPE(obj)->tp_reserved)) #else #define __Pyx_PyType_AsAsync(obj) NULL #endif #ifndef CYTHON_RESTRICT #if defined(__GNUC__) #define CYTHON_RESTRICT __restrict__ #elif defined(_MSC_VER) && _MSC_VER >= 1400 #define CYTHON_RESTRICT __restrict #elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L #define CYTHON_RESTRICT restrict #else #define CYTHON_RESTRICT #endif #endif #define __Pyx_void_to_None(void_result) (void_result, Py_INCREF(Py_None), Py_None) #ifndef CYTHON_INLINE #if defined(__GNUC__) #define CYTHON_INLINE __inline__ #elif defined(_MSC_VER) #define CYTHON_INLINE __inline #elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L #define CYTHON_INLINE inline #else #define CYTHON_INLINE #endif #endif #if defined(WIN32) || defined(MS_WINDOWS) #define _USE_MATH_DEFINES #endif #include #ifdef NAN #define __PYX_NAN() ((float) NAN) #else static CYTHON_INLINE float __PYX_NAN() { float value; memset(&value, 0xFF, sizeof(value)); return value; } #endif #if PY_MAJOR_VERSION >= 3 #define __Pyx_PyNumber_Divide(x,y) PyNumber_TrueDivide(x,y) #define __Pyx_PyNumber_InPlaceDivide(x,y) PyNumber_InPlaceTrueDivide(x,y) #else #define __Pyx_PyNumber_Divide(x,y) PyNumber_TrueDivide(x,y) #define __Pyx_PyNumber_InPlaceDivide(x,y) PyNumber_InPlaceTrueDivide(x,y) #endif #ifndef __PYX_EXTERN_C #ifdef __cplusplus #define __PYX_EXTERN_C extern "C" #else #define __PYX_EXTERN_C extern #endif #endif #define __PYX_HAVE__pygame_sdl2__scrap #define __PYX_HAVE_API__pygame_sdl2__scrap #include "stdint.h" #include "string.h" #include "stdio.h" #include "stddef.h" #include "SDL.h" #ifdef _OPENMP #include #endif /* _OPENMP */ #ifdef PYREX_WITHOUT_ASSERTIONS #define CYTHON_WITHOUT_ASSERTIONS #endif #ifndef CYTHON_UNUSED # if defined(__GNUC__) # if !(defined(__cplusplus)) || (__GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 4)) # define CYTHON_UNUSED __attribute__ ((__unused__)) # else # define CYTHON_UNUSED # endif # elif defined(__ICC) || (defined(__INTEL_COMPILER) && !defined(_MSC_VER)) # define CYTHON_UNUSED __attribute__ ((__unused__)) # else # define CYTHON_UNUSED # endif #endif #ifndef CYTHON_NCP_UNUSED # if CYTHON_COMPILING_IN_CPYTHON # define CYTHON_NCP_UNUSED # else # define CYTHON_NCP_UNUSED CYTHON_UNUSED # endif #endif typedef struct {PyObject **p; char *s; const Py_ssize_t n; const char* encoding; const char is_unicode; const char is_str; const char intern; } __Pyx_StringTabEntry; #define __PYX_DEFAULT_STRING_ENCODING_IS_ASCII 0 #define __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT 0 #define __PYX_DEFAULT_STRING_ENCODING "" #define __Pyx_PyObject_FromString __Pyx_PyBytes_FromString #define __Pyx_PyObject_FromStringAndSize __Pyx_PyBytes_FromStringAndSize #define __Pyx_uchar_cast(c) ((unsigned char)c) #define __Pyx_long_cast(x) ((long)x) #define __Pyx_fits_Py_ssize_t(v, type, is_signed) (\ (sizeof(type) < sizeof(Py_ssize_t)) ||\ (sizeof(type) > sizeof(Py_ssize_t) &&\ likely(v < (type)PY_SSIZE_T_MAX ||\ v == (type)PY_SSIZE_T_MAX) &&\ (!is_signed || likely(v > (type)PY_SSIZE_T_MIN ||\ v == (type)PY_SSIZE_T_MIN))) ||\ (sizeof(type) == sizeof(Py_ssize_t) &&\ (is_signed || likely(v < (type)PY_SSIZE_T_MAX ||\ v == (type)PY_SSIZE_T_MAX))) ) #if defined (__cplusplus) && __cplusplus >= 201103L #include #define __Pyx_sst_abs(value) std::abs(value) #elif SIZEOF_INT >= SIZEOF_SIZE_T #define __Pyx_sst_abs(value) abs(value) #elif SIZEOF_LONG >= SIZEOF_SIZE_T #define __Pyx_sst_abs(value) labs(value) #elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L #define __Pyx_sst_abs(value) llabs(value) #elif defined (_MSC_VER) && defined (_M_X64) #define __Pyx_sst_abs(value) _abs64(value) #elif defined (__GNUC__) #define __Pyx_sst_abs(value) __builtin_llabs(value) #else #define __Pyx_sst_abs(value) ((value<0) ? -value : value) #endif static CYTHON_INLINE char* __Pyx_PyObject_AsString(PyObject*); static CYTHON_INLINE char* __Pyx_PyObject_AsStringAndSize(PyObject*, Py_ssize_t* length); #define __Pyx_PyByteArray_FromString(s) PyByteArray_FromStringAndSize((const char*)s, strlen((const char*)s)) #define __Pyx_PyByteArray_FromStringAndSize(s, l) PyByteArray_FromStringAndSize((const char*)s, l) #define __Pyx_PyBytes_FromString PyBytes_FromString #define __Pyx_PyBytes_FromStringAndSize PyBytes_FromStringAndSize static CYTHON_INLINE PyObject* __Pyx_PyUnicode_FromString(const char*); #if PY_MAJOR_VERSION < 3 #define __Pyx_PyStr_FromString __Pyx_PyBytes_FromString #define __Pyx_PyStr_FromStringAndSize __Pyx_PyBytes_FromStringAndSize #else #define __Pyx_PyStr_FromString __Pyx_PyUnicode_FromString #define __Pyx_PyStr_FromStringAndSize __Pyx_PyUnicode_FromStringAndSize #endif #define __Pyx_PyObject_AsSString(s) ((signed char*) __Pyx_PyObject_AsString(s)) #define __Pyx_PyObject_AsUString(s) ((unsigned char*) __Pyx_PyObject_AsString(s)) #define __Pyx_PyObject_FromCString(s) __Pyx_PyObject_FromString((const char*)s) #define __Pyx_PyBytes_FromCString(s) __Pyx_PyBytes_FromString((const char*)s) #define __Pyx_PyByteArray_FromCString(s) __Pyx_PyByteArray_FromString((const char*)s) #define __Pyx_PyStr_FromCString(s) __Pyx_PyStr_FromString((const char*)s) #define __Pyx_PyUnicode_FromCString(s) __Pyx_PyUnicode_FromString((const char*)s) #if PY_MAJOR_VERSION < 3 static CYTHON_INLINE size_t __Pyx_Py_UNICODE_strlen(const Py_UNICODE *u) { const Py_UNICODE *u_end = u; while (*u_end++) ; return (size_t)(u_end - u - 1); } #else #define __Pyx_Py_UNICODE_strlen Py_UNICODE_strlen #endif #define __Pyx_PyUnicode_FromUnicode(u) PyUnicode_FromUnicode(u, __Pyx_Py_UNICODE_strlen(u)) #define __Pyx_PyUnicode_FromUnicodeAndLength PyUnicode_FromUnicode #define __Pyx_PyUnicode_AsUnicode PyUnicode_AsUnicode #define __Pyx_NewRef(obj) (Py_INCREF(obj), obj) #define __Pyx_Owned_Py_None(b) __Pyx_NewRef(Py_None) #define __Pyx_PyBool_FromLong(b) ((b) ? __Pyx_NewRef(Py_True) : __Pyx_NewRef(Py_False)) static CYTHON_INLINE int __Pyx_PyObject_IsTrue(PyObject*); static CYTHON_INLINE PyObject* __Pyx_PyNumber_Int(PyObject* x); static CYTHON_INLINE Py_ssize_t __Pyx_PyIndex_AsSsize_t(PyObject*); static CYTHON_INLINE PyObject * __Pyx_PyInt_FromSize_t(size_t); #if CYTHON_COMPILING_IN_CPYTHON #define __pyx_PyFloat_AsDouble(x) (PyFloat_CheckExact(x) ? PyFloat_AS_DOUBLE(x) : PyFloat_AsDouble(x)) #else #define __pyx_PyFloat_AsDouble(x) PyFloat_AsDouble(x) #endif #define __pyx_PyFloat_AsFloat(x) ((float) __pyx_PyFloat_AsDouble(x)) #if PY_MAJOR_VERSION < 3 && __PYX_DEFAULT_STRING_ENCODING_IS_ASCII static int __Pyx_sys_getdefaultencoding_not_ascii; static int __Pyx_init_sys_getdefaultencoding_params(void) { PyObject* sys; PyObject* default_encoding = NULL; PyObject* ascii_chars_u = NULL; PyObject* ascii_chars_b = NULL; const char* default_encoding_c; sys = PyImport_ImportModule("sys"); if (!sys) goto bad; default_encoding = PyObject_CallMethod(sys, (char*) "getdefaultencoding", NULL); Py_DECREF(sys); if (!default_encoding) goto bad; default_encoding_c = PyBytes_AsString(default_encoding); if (!default_encoding_c) goto bad; if (strcmp(default_encoding_c, "ascii") == 0) { __Pyx_sys_getdefaultencoding_not_ascii = 0; } else { char ascii_chars[128]; int c; for (c = 0; c < 128; c++) { ascii_chars[c] = c; } __Pyx_sys_getdefaultencoding_not_ascii = 1; ascii_chars_u = PyUnicode_DecodeASCII(ascii_chars, 128, NULL); if (!ascii_chars_u) goto bad; ascii_chars_b = PyUnicode_AsEncodedString(ascii_chars_u, default_encoding_c, NULL); if (!ascii_chars_b || !PyBytes_Check(ascii_chars_b) || memcmp(ascii_chars, PyBytes_AS_STRING(ascii_chars_b), 128) != 0) { PyErr_Format( PyExc_ValueError, "This module compiled with c_string_encoding=ascii, but default encoding '%.200s' is not a superset of ascii.", default_encoding_c); goto bad; } Py_DECREF(ascii_chars_u); Py_DECREF(ascii_chars_b); } Py_DECREF(default_encoding); return 0; bad: Py_XDECREF(default_encoding); Py_XDECREF(ascii_chars_u); Py_XDECREF(ascii_chars_b); return -1; } #endif #if __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT && PY_MAJOR_VERSION >= 3 #define __Pyx_PyUnicode_FromStringAndSize(c_str, size) PyUnicode_DecodeUTF8(c_str, size, NULL) #else #define __Pyx_PyUnicode_FromStringAndSize(c_str, size) PyUnicode_Decode(c_str, size, __PYX_DEFAULT_STRING_ENCODING, NULL) #if __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT static char* __PYX_DEFAULT_STRING_ENCODING; static int __Pyx_init_sys_getdefaultencoding_params(void) { PyObject* sys; PyObject* default_encoding = NULL; char* default_encoding_c; sys = PyImport_ImportModule("sys"); if (!sys) goto bad; default_encoding = PyObject_CallMethod(sys, (char*) (const char*) "getdefaultencoding", NULL); Py_DECREF(sys); if (!default_encoding) goto bad; default_encoding_c = PyBytes_AsString(default_encoding); if (!default_encoding_c) goto bad; __PYX_DEFAULT_STRING_ENCODING = (char*) malloc(strlen(default_encoding_c)); if (!__PYX_DEFAULT_STRING_ENCODING) goto bad; strcpy(__PYX_DEFAULT_STRING_ENCODING, default_encoding_c); Py_DECREF(default_encoding); return 0; bad: Py_XDECREF(default_encoding); return -1; } #endif #endif /* Test for GCC > 2.95 */ #if defined(__GNUC__) && (__GNUC__ > 2 || (__GNUC__ == 2 && (__GNUC_MINOR__ > 95))) #define likely(x) __builtin_expect(!!(x), 1) #define unlikely(x) __builtin_expect(!!(x), 0) #else /* !__GNUC__ or GCC < 2.95 */ #define likely(x) (x) #define unlikely(x) (x) #endif /* __GNUC__ */ static PyObject *__pyx_m; static PyObject *__pyx_d; static PyObject *__pyx_b; static PyObject *__pyx_empty_tuple; static PyObject *__pyx_empty_bytes; static int __pyx_lineno; static int __pyx_clineno = 0; static const char * __pyx_cfilenm= __FILE__; static const char *__pyx_filename; static const char *__pyx_f[] = { "src/pygame_sdl2/scrap.pyx", }; /*--- Type declarations ---*/ /* --- Runtime support code (head) --- */ #ifndef CYTHON_REFNANNY #define CYTHON_REFNANNY 0 #endif #if CYTHON_REFNANNY typedef struct { void (*INCREF)(void*, PyObject*, int); void (*DECREF)(void*, PyObject*, int); void (*GOTREF)(void*, PyObject*, int); void (*GIVEREF)(void*, PyObject*, int); void* (*SetupContext)(const char*, int, const char*); void (*FinishContext)(void**); } __Pyx_RefNannyAPIStruct; static __Pyx_RefNannyAPIStruct *__Pyx_RefNanny = NULL; static __Pyx_RefNannyAPIStruct *__Pyx_RefNannyImportAPI(const char *modname); #define __Pyx_RefNannyDeclarations void *__pyx_refnanny = NULL; #ifdef WITH_THREAD #define __Pyx_RefNannySetupContext(name, acquire_gil)\ if (acquire_gil) {\ PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure();\ __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), __LINE__, __FILE__);\ PyGILState_Release(__pyx_gilstate_save);\ } else {\ __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), __LINE__, __FILE__);\ } #else #define __Pyx_RefNannySetupContext(name, acquire_gil)\ __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), __LINE__, __FILE__) #endif #define __Pyx_RefNannyFinishContext()\ __Pyx_RefNanny->FinishContext(&__pyx_refnanny) #define __Pyx_INCREF(r) __Pyx_RefNanny->INCREF(__pyx_refnanny, (PyObject *)(r), __LINE__) #define __Pyx_DECREF(r) __Pyx_RefNanny->DECREF(__pyx_refnanny, (PyObject *)(r), __LINE__) #define __Pyx_GOTREF(r) __Pyx_RefNanny->GOTREF(__pyx_refnanny, (PyObject *)(r), __LINE__) #define __Pyx_GIVEREF(r) __Pyx_RefNanny->GIVEREF(__pyx_refnanny, (PyObject *)(r), __LINE__) #define __Pyx_XINCREF(r) do { if((r) != NULL) {__Pyx_INCREF(r); }} while(0) #define __Pyx_XDECREF(r) do { if((r) != NULL) {__Pyx_DECREF(r); }} while(0) #define __Pyx_XGOTREF(r) do { if((r) != NULL) {__Pyx_GOTREF(r); }} while(0) #define __Pyx_XGIVEREF(r) do { if((r) != NULL) {__Pyx_GIVEREF(r);}} while(0) #else #define __Pyx_RefNannyDeclarations #define __Pyx_RefNannySetupContext(name, acquire_gil) #define __Pyx_RefNannyFinishContext() #define __Pyx_INCREF(r) Py_INCREF(r) #define __Pyx_DECREF(r) Py_DECREF(r) #define __Pyx_GOTREF(r) #define __Pyx_GIVEREF(r) #define __Pyx_XINCREF(r) Py_XINCREF(r) #define __Pyx_XDECREF(r) Py_XDECREF(r) #define __Pyx_XGOTREF(r) #define __Pyx_XGIVEREF(r) #endif #define __Pyx_XDECREF_SET(r, v) do {\ PyObject *tmp = (PyObject *) r;\ r = v; __Pyx_XDECREF(tmp);\ } while (0) #define __Pyx_DECREF_SET(r, v) do {\ PyObject *tmp = (PyObject *) r;\ r = v; __Pyx_DECREF(tmp);\ } while (0) #define __Pyx_CLEAR(r) do { PyObject* tmp = ((PyObject*)(r)); r = NULL; __Pyx_DECREF(tmp);} while(0) #define __Pyx_XCLEAR(r) do { if((r) != NULL) {PyObject* tmp = ((PyObject*)(r)); r = NULL; __Pyx_DECREF(tmp);}} while(0) #if CYTHON_COMPILING_IN_CPYTHON static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStr(PyObject* obj, PyObject* attr_name) { PyTypeObject* tp = Py_TYPE(obj); if (likely(tp->tp_getattro)) return tp->tp_getattro(obj, attr_name); #if PY_MAJOR_VERSION < 3 if (likely(tp->tp_getattr)) return tp->tp_getattr(obj, PyString_AS_STRING(attr_name)); #endif return PyObject_GetAttr(obj, attr_name); } #else #define __Pyx_PyObject_GetAttrStr(o,n) PyObject_GetAttr(o,n) #endif static PyObject *__Pyx_GetBuiltinName(PyObject *name); static CYTHON_INLINE PyObject *__Pyx_GetModuleGlobalName(PyObject *name); #if CYTHON_COMPILING_IN_CPYTHON static CYTHON_INLINE PyObject* __Pyx_PyObject_Call(PyObject *func, PyObject *arg, PyObject *kw); #else #define __Pyx_PyObject_Call(func, arg, kw) PyObject_Call(func, arg, kw) #endif #if CYTHON_COMPILING_IN_CPYTHON static CYTHON_INLINE PyObject* __Pyx_PyObject_CallMethO(PyObject *func, PyObject *arg); #endif static CYTHON_INLINE PyObject* __Pyx_PyObject_CallOneArg(PyObject *func, PyObject *arg); #if CYTHON_COMPILING_IN_CPYTHON static CYTHON_INLINE PyObject* __Pyx_PyObject_CallNoArg(PyObject *func); #else #define __Pyx_PyObject_CallNoArg(func) __Pyx_PyObject_Call(func, __pyx_empty_tuple, NULL) #endif static CYTHON_INLINE void __Pyx_ErrRestore(PyObject *type, PyObject *value, PyObject *tb); static CYTHON_INLINE void __Pyx_ErrFetch(PyObject **type, PyObject **value, PyObject **tb); static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, PyObject *cause); static void __Pyx_RaiseArgtupleInvalid(const char* func_name, int exact, Py_ssize_t num_min, Py_ssize_t num_max, Py_ssize_t num_found); static void __Pyx_RaiseDoubleKeywordsError(const char* func_name, PyObject* kw_name); static int __Pyx_ParseOptionalKeywords(PyObject *kwds, PyObject **argnames[],\ PyObject *kwds2, PyObject *values[], Py_ssize_t num_pos_args,\ const char* function_name); static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list, int level); static PyObject* __Pyx_ImportFrom(PyObject* module, PyObject* name); typedef struct { int code_line; PyCodeObject* code_object; } __Pyx_CodeObjectCacheEntry; struct __Pyx_CodeObjectCache { int count; int max_count; __Pyx_CodeObjectCacheEntry* entries; }; static struct __Pyx_CodeObjectCache __pyx_code_cache = {0,0,NULL}; static int __pyx_bisect_code_objects(__Pyx_CodeObjectCacheEntry* entries, int count, int code_line); static PyCodeObject *__pyx_find_code_object(int code_line); static void __pyx_insert_code_object(int code_line, PyCodeObject* code_object); static void __Pyx_AddTraceback(const char *funcname, int c_line, int py_line, const char *filename); static CYTHON_INLINE PyObject* __Pyx_PyInt_From_long(long value); static CYTHON_INLINE long __Pyx_PyInt_As_long(PyObject *); static CYTHON_INLINE int __Pyx_PyInt_As_int(PyObject *); static int __Pyx_check_binary_version(void); static int __Pyx_InitStrings(__Pyx_StringTabEntry *t); /* Module declarations from 'libc.stdint' */ /* Module declarations from 'libc.string' */ /* Module declarations from 'libc.stdio' */ /* Module declarations from 'libc.stddef' */ /* Module declarations from 'sdl2' */ /* Module declarations from 'pygame_sdl2.scrap' */ #define __Pyx_MODULE_NAME "pygame_sdl2.scrap" int __pyx_module_is_main_pygame_sdl2__scrap = 0; /* Implementation of 'pygame_sdl2.scrap' */ static char __pyx_k_rv[] = "rv"; static char __pyx_k_get[] = "get"; static char __pyx_k_put[] = "put"; static char __pyx_k_data[] = "data"; static char __pyx_k_init[] = "init"; static char __pyx_k_lost[] = "lost"; static char __pyx_k_main[] = "__main__"; static char __pyx_k_mode[] = "mode"; static char __pyx_k_test[] = "__test__"; static char __pyx_k_text[] = "text"; static char __pyx_k_type[] = "type"; static char __pyx_k_bytes[] = "bytes_"; static char __pyx_k_error[] = "error"; static char __pyx_k_import[] = "__import__"; static char __pyx_k_contains[] = "contains"; static char __pyx_k_set_mode[] = "set_mode"; static char __pyx_k_get_types[] = "get_types"; static char __pyx_k_SCRAP_TEXT[] = "SCRAP_TEXT"; static char __pyx_k_Not_implemented[] = "Not implemented."; static char __pyx_k_pygame_sdl2_error[] = "pygame_sdl2.error"; static char __pyx_k_pygame_sdl2_scrap[] = "pygame_sdl2.scrap"; static char __pyx_k_pygame_sdl2_compat[] = "pygame_sdl2.compat"; static char __pyx_k_pygame_sdl2_locals[] = "pygame_sdl2.locals"; static char __pyx_k_home_tom_ab_pygame_sdl2_src_pyg[] = "/home/tom/ab/pygame_sdl2/src/pygame_sdl2/scrap.pyx"; static PyObject *__pyx_kp_u_Not_implemented; static PyObject *__pyx_n_s_SCRAP_TEXT; static PyObject *__pyx_n_s_bytes; static PyObject *__pyx_n_s_contains; static PyObject *__pyx_n_s_data; static PyObject *__pyx_n_s_error; static PyObject *__pyx_n_s_get; static PyObject *__pyx_n_s_get_types; static PyObject *__pyx_kp_s_home_tom_ab_pygame_sdl2_src_pyg; static PyObject *__pyx_n_s_import; static PyObject *__pyx_n_s_init; static PyObject *__pyx_n_s_lost; static PyObject *__pyx_n_s_main; static PyObject *__pyx_n_s_mode; static PyObject *__pyx_n_s_put; static PyObject *__pyx_n_s_pygame_sdl2_compat; static PyObject *__pyx_n_s_pygame_sdl2_error; static PyObject *__pyx_n_s_pygame_sdl2_locals; static PyObject *__pyx_n_s_pygame_sdl2_scrap; static PyObject *__pyx_n_s_rv; static PyObject *__pyx_n_s_set_mode; static PyObject *__pyx_n_s_test; static PyObject *__pyx_n_s_text; static PyObject *__pyx_n_s_type; static PyObject *__pyx_pf_11pygame_sdl2_5scrap_init(CYTHON_UNUSED PyObject *__pyx_self); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_5scrap_2get(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_type); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_5scrap_4get_types(CYTHON_UNUSED PyObject *__pyx_self); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_5scrap_6put(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_type, PyObject *__pyx_v_data); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_5scrap_8contains(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_type); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_5scrap_10lost(CYTHON_UNUSED PyObject *__pyx_self); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_5scrap_12set_mode(CYTHON_UNUSED PyObject *__pyx_self, CYTHON_UNUSED PyObject *__pyx_v_mode); /* proto */ static PyObject *__pyx_tuple_; static PyObject *__pyx_tuple__2; static PyObject *__pyx_tuple__4; static PyObject *__pyx_tuple__7; static PyObject *__pyx_tuple__9; static PyObject *__pyx_tuple__12; static PyObject *__pyx_codeobj__3; static PyObject *__pyx_codeobj__5; static PyObject *__pyx_codeobj__6; static PyObject *__pyx_codeobj__8; static PyObject *__pyx_codeobj__10; static PyObject *__pyx_codeobj__11; static PyObject *__pyx_codeobj__13; /* "pygame_sdl2/scrap.pyx":26 * from pygame_sdl2.compat import bytes_ * * def init(): # <<<<<<<<<<<<<< * pass * */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_5scrap_1init(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused); /*proto*/ static PyMethodDef __pyx_mdef_11pygame_sdl2_5scrap_1init = {"init", (PyCFunction)__pyx_pw_11pygame_sdl2_5scrap_1init, METH_NOARGS, 0}; static PyObject *__pyx_pw_11pygame_sdl2_5scrap_1init(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("init (wrapper)", 0); __pyx_r = __pyx_pf_11pygame_sdl2_5scrap_init(__pyx_self); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_5scrap_init(CYTHON_UNUSED PyObject *__pyx_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("init", 0); /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/scrap.pyx":29 * pass * * def get(type): # <<<<<<<<<<<<<< * cdef char *text = NULL * if type == SCRAP_TEXT: */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_5scrap_3get(PyObject *__pyx_self, PyObject *__pyx_v_type); /*proto*/ static PyMethodDef __pyx_mdef_11pygame_sdl2_5scrap_3get = {"get", (PyCFunction)__pyx_pw_11pygame_sdl2_5scrap_3get, METH_O, 0}; static PyObject *__pyx_pw_11pygame_sdl2_5scrap_3get(PyObject *__pyx_self, PyObject *__pyx_v_type) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("get (wrapper)", 0); __pyx_r = __pyx_pf_11pygame_sdl2_5scrap_2get(__pyx_self, ((PyObject *)__pyx_v_type)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_5scrap_2get(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_type) { char *__pyx_v_text; PyObject *__pyx_v_rv = NULL; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; int __pyx_t_3; PyObject *__pyx_t_4 = NULL; PyObject *__pyx_t_5 = NULL; PyObject *__pyx_t_6 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("get", 0); /* "pygame_sdl2/scrap.pyx":30 * * def get(type): * cdef char *text = NULL # <<<<<<<<<<<<<< * if type == SCRAP_TEXT: * text = SDL_GetClipboardText() */ __pyx_v_text = NULL; /* "pygame_sdl2/scrap.pyx":31 * def get(type): * cdef char *text = NULL * if type == SCRAP_TEXT: # <<<<<<<<<<<<<< * text = SDL_GetClipboardText() * if text == NULL: */ __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_SCRAP_TEXT); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 31; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = PyObject_RichCompare(__pyx_v_type, __pyx_t_1, Py_EQ); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 31; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 31; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; if (__pyx_t_3) { /* "pygame_sdl2/scrap.pyx":32 * cdef char *text = NULL * if type == SCRAP_TEXT: * text = SDL_GetClipboardText() # <<<<<<<<<<<<<< * if text == NULL: * raise error() */ __pyx_v_text = SDL_GetClipboardText(); /* "pygame_sdl2/scrap.pyx":33 * if type == SCRAP_TEXT: * text = SDL_GetClipboardText() * if text == NULL: # <<<<<<<<<<<<<< * raise error() * rv = bytes_(text) */ __pyx_t_3 = ((__pyx_v_text == NULL) != 0); if (__pyx_t_3) { /* "pygame_sdl2/scrap.pyx":34 * text = SDL_GetClipboardText() * if text == NULL: * raise error() # <<<<<<<<<<<<<< * rv = bytes_(text) * SDL_free(text) */ __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_error); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 34; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_t_4 = NULL; if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_1))) { __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_1); if (likely(__pyx_t_4)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1); __Pyx_INCREF(__pyx_t_4); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_1, function); } } if (__pyx_t_4) { __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_1, __pyx_t_4); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 34; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; } else { __pyx_t_2 = __Pyx_PyObject_CallNoArg(__pyx_t_1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 34; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_Raise(__pyx_t_2, 0, 0, 0); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; {__pyx_filename = __pyx_f[0]; __pyx_lineno = 34; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "pygame_sdl2/scrap.pyx":33 * if type == SCRAP_TEXT: * text = SDL_GetClipboardText() * if text == NULL: # <<<<<<<<<<<<<< * raise error() * rv = bytes_(text) */ } /* "pygame_sdl2/scrap.pyx":35 * if text == NULL: * raise error() * rv = bytes_(text) # <<<<<<<<<<<<<< * SDL_free(text) * return rv */ __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_bytes); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 35; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_t_4 = __Pyx_PyBytes_FromString(__pyx_v_text); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 35; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); __pyx_t_5 = NULL; if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_1))) { __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_1); if (likely(__pyx_t_5)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1); __Pyx_INCREF(__pyx_t_5); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_1, function); } } if (!__pyx_t_5) { __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_1, __pyx_t_4); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 35; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_GOTREF(__pyx_t_2); } else { __pyx_t_6 = PyTuple_New(1+1); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 35; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_6); __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_5); __pyx_t_5 = NULL; __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_6, 0+1, __pyx_t_4); __pyx_t_4 = 0; __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_6, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 35; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_v_rv = __pyx_t_2; __pyx_t_2 = 0; /* "pygame_sdl2/scrap.pyx":36 * raise error() * rv = bytes_(text) * SDL_free(text) # <<<<<<<<<<<<<< * return rv * else: */ SDL_free(__pyx_v_text); /* "pygame_sdl2/scrap.pyx":37 * rv = bytes_(text) * SDL_free(text) * return rv # <<<<<<<<<<<<<< * else: * raise error("Not implemented.") */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(__pyx_v_rv); __pyx_r = __pyx_v_rv; goto __pyx_L0; /* "pygame_sdl2/scrap.pyx":31 * def get(type): * cdef char *text = NULL * if type == SCRAP_TEXT: # <<<<<<<<<<<<<< * text = SDL_GetClipboardText() * if text == NULL: */ } /* "pygame_sdl2/scrap.pyx":39 * return rv * else: * raise error("Not implemented.") # <<<<<<<<<<<<<< * * def get_types(): */ /*else*/ { __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_error); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 39; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_tuple_, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 39; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_Raise(__pyx_t_1, 0, 0, 0); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; {__pyx_filename = __pyx_f[0]; __pyx_lineno = 39; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } /* "pygame_sdl2/scrap.pyx":29 * pass * * def get(type): # <<<<<<<<<<<<<< * cdef char *text = NULL * if type == SCRAP_TEXT: */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_5); __Pyx_XDECREF(__pyx_t_6); __Pyx_AddTraceback("pygame_sdl2.scrap.get", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF(__pyx_v_rv); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/scrap.pyx":41 * raise error("Not implemented.") * * def get_types(): # <<<<<<<<<<<<<< * return [SCRAP_TEXT] * */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_5scrap_5get_types(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused); /*proto*/ static PyMethodDef __pyx_mdef_11pygame_sdl2_5scrap_5get_types = {"get_types", (PyCFunction)__pyx_pw_11pygame_sdl2_5scrap_5get_types, METH_NOARGS, 0}; static PyObject *__pyx_pw_11pygame_sdl2_5scrap_5get_types(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("get_types (wrapper)", 0); __pyx_r = __pyx_pf_11pygame_sdl2_5scrap_4get_types(__pyx_self); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_5scrap_4get_types(CYTHON_UNUSED PyObject *__pyx_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("get_types", 0); /* "pygame_sdl2/scrap.pyx":42 * * def get_types(): * return [SCRAP_TEXT] # <<<<<<<<<<<<<< * * def put(type, data): */ __Pyx_XDECREF(__pyx_r); __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_SCRAP_TEXT); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 42; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = PyList_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 42; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __Pyx_GIVEREF(__pyx_t_1); PyList_SET_ITEM(__pyx_t_2, 0, __pyx_t_1); __pyx_t_1 = 0; __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; /* "pygame_sdl2/scrap.pyx":41 * raise error("Not implemented.") * * def get_types(): # <<<<<<<<<<<<<< * return [SCRAP_TEXT] * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_AddTraceback("pygame_sdl2.scrap.get_types", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/scrap.pyx":44 * return [SCRAP_TEXT] * * def put(type, data): # <<<<<<<<<<<<<< * if type != SCRAP_TEXT: * raise error("Not implemented.") */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_5scrap_7put(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static PyMethodDef __pyx_mdef_11pygame_sdl2_5scrap_7put = {"put", (PyCFunction)__pyx_pw_11pygame_sdl2_5scrap_7put, METH_VARARGS|METH_KEYWORDS, 0}; static PyObject *__pyx_pw_11pygame_sdl2_5scrap_7put(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_type = 0; PyObject *__pyx_v_data = 0; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("put (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_type,&__pyx_n_s_data,0}; PyObject* values[2] = {0,0}; if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_type)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; case 1: if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_data)) != 0)) kw_args--; else { __Pyx_RaiseArgtupleInvalid("put", 1, 2, 2, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 44; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "put") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 44; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } } else if (PyTuple_GET_SIZE(__pyx_args) != 2) { goto __pyx_L5_argtuple_error; } else { values[0] = PyTuple_GET_ITEM(__pyx_args, 0); values[1] = PyTuple_GET_ITEM(__pyx_args, 1); } __pyx_v_type = values[0]; __pyx_v_data = values[1]; } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("put", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 44; __pyx_clineno = __LINE__; goto __pyx_L3_error;} __pyx_L3_error:; __Pyx_AddTraceback("pygame_sdl2.scrap.put", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_11pygame_sdl2_5scrap_6put(__pyx_self, __pyx_v_type, __pyx_v_data); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_5scrap_6put(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_type, PyObject *__pyx_v_data) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; int __pyx_t_3; PyObject *__pyx_t_4 = NULL; PyObject *__pyx_t_5 = NULL; char const *__pyx_t_6; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("put", 0); __Pyx_INCREF(__pyx_v_data); /* "pygame_sdl2/scrap.pyx":45 * * def put(type, data): * if type != SCRAP_TEXT: # <<<<<<<<<<<<<< * raise error("Not implemented.") * */ __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_SCRAP_TEXT); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 45; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = PyObject_RichCompare(__pyx_v_type, __pyx_t_1, Py_NE); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 45; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 45; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; if (__pyx_t_3) { /* "pygame_sdl2/scrap.pyx":46 * def put(type, data): * if type != SCRAP_TEXT: * raise error("Not implemented.") # <<<<<<<<<<<<<< * * data = bytes_(data) */ __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_error); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 46; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_tuple__2, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 46; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_Raise(__pyx_t_1, 0, 0, 0); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; {__pyx_filename = __pyx_f[0]; __pyx_lineno = 46; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "pygame_sdl2/scrap.pyx":45 * * def put(type, data): * if type != SCRAP_TEXT: # <<<<<<<<<<<<<< * raise error("Not implemented.") * */ } /* "pygame_sdl2/scrap.pyx":48 * raise error("Not implemented.") * * data = bytes_(data) # <<<<<<<<<<<<<< * * if SDL_SetClipboardText(data) != 0: */ __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_bytes); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 48; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __pyx_t_4 = NULL; if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_2))) { __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_2); if (likely(__pyx_t_4)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_4); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); } } if (!__pyx_t_4) { __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_v_data); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 48; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); } else { __pyx_t_5 = PyTuple_New(1+1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 48; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_4); __pyx_t_4 = NULL; __Pyx_INCREF(__pyx_v_data); __Pyx_GIVEREF(__pyx_v_data); PyTuple_SET_ITEM(__pyx_t_5, 0+1, __pyx_v_data); __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_5, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 48; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; } __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF_SET(__pyx_v_data, __pyx_t_1); __pyx_t_1 = 0; /* "pygame_sdl2/scrap.pyx":50 * data = bytes_(data) * * if SDL_SetClipboardText(data) != 0: # <<<<<<<<<<<<<< * raise error() * */ __pyx_t_6 = __Pyx_PyObject_AsString(__pyx_v_data); if (unlikely((!__pyx_t_6) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 50; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_t_3 = ((SDL_SetClipboardText(__pyx_t_6) != 0) != 0); if (__pyx_t_3) { /* "pygame_sdl2/scrap.pyx":51 * * if SDL_SetClipboardText(data) != 0: * raise error() # <<<<<<<<<<<<<< * * def contains(type): */ __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_error); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 51; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __pyx_t_5 = NULL; if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_2))) { __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_2); if (likely(__pyx_t_5)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_5); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); } } if (__pyx_t_5) { __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_5); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 51; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; } else { __pyx_t_1 = __Pyx_PyObject_CallNoArg(__pyx_t_2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 51; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_Raise(__pyx_t_1, 0, 0, 0); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; {__pyx_filename = __pyx_f[0]; __pyx_lineno = 51; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "pygame_sdl2/scrap.pyx":50 * data = bytes_(data) * * if SDL_SetClipboardText(data) != 0: # <<<<<<<<<<<<<< * raise error() * */ } /* "pygame_sdl2/scrap.pyx":44 * return [SCRAP_TEXT] * * def put(type, data): # <<<<<<<<<<<<<< * if type != SCRAP_TEXT: * raise error("Not implemented.") */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_5); __Pyx_AddTraceback("pygame_sdl2.scrap.put", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF(__pyx_v_data); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/scrap.pyx":53 * raise error() * * def contains(type): # <<<<<<<<<<<<<< * if type != SCRAP_TEXT: * return False */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_5scrap_9contains(PyObject *__pyx_self, PyObject *__pyx_v_type); /*proto*/ static PyMethodDef __pyx_mdef_11pygame_sdl2_5scrap_9contains = {"contains", (PyCFunction)__pyx_pw_11pygame_sdl2_5scrap_9contains, METH_O, 0}; static PyObject *__pyx_pw_11pygame_sdl2_5scrap_9contains(PyObject *__pyx_self, PyObject *__pyx_v_type) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("contains (wrapper)", 0); __pyx_r = __pyx_pf_11pygame_sdl2_5scrap_8contains(__pyx_self, ((PyObject *)__pyx_v_type)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_5scrap_8contains(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_type) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; int __pyx_t_3; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("contains", 0); /* "pygame_sdl2/scrap.pyx":54 * * def contains(type): * if type != SCRAP_TEXT: # <<<<<<<<<<<<<< * return False * */ __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_SCRAP_TEXT); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 54; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = PyObject_RichCompare(__pyx_v_type, __pyx_t_1, Py_NE); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 54; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 54; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; if (__pyx_t_3) { /* "pygame_sdl2/scrap.pyx":55 * def contains(type): * if type != SCRAP_TEXT: * return False # <<<<<<<<<<<<<< * * return SDL_HasClipboardText() == SDL_TRUE */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(Py_False); __pyx_r = Py_False; goto __pyx_L0; /* "pygame_sdl2/scrap.pyx":54 * * def contains(type): * if type != SCRAP_TEXT: # <<<<<<<<<<<<<< * return False * */ } /* "pygame_sdl2/scrap.pyx":57 * return False * * return SDL_HasClipboardText() == SDL_TRUE # <<<<<<<<<<<<<< * * def lost(): */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __Pyx_PyBool_FromLong((SDL_HasClipboardText() == SDL_TRUE)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 57; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; /* "pygame_sdl2/scrap.pyx":53 * raise error() * * def contains(type): # <<<<<<<<<<<<<< * if type != SCRAP_TEXT: * return False */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_AddTraceback("pygame_sdl2.scrap.contains", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/scrap.pyx":59 * return SDL_HasClipboardText() == SDL_TRUE * * def lost(): # <<<<<<<<<<<<<< * return False * */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_5scrap_11lost(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused); /*proto*/ static PyMethodDef __pyx_mdef_11pygame_sdl2_5scrap_11lost = {"lost", (PyCFunction)__pyx_pw_11pygame_sdl2_5scrap_11lost, METH_NOARGS, 0}; static PyObject *__pyx_pw_11pygame_sdl2_5scrap_11lost(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("lost (wrapper)", 0); __pyx_r = __pyx_pf_11pygame_sdl2_5scrap_10lost(__pyx_self); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_5scrap_10lost(CYTHON_UNUSED PyObject *__pyx_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("lost", 0); /* "pygame_sdl2/scrap.pyx":60 * * def lost(): * return False # <<<<<<<<<<<<<< * * def set_mode(mode): */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(Py_False); __pyx_r = Py_False; goto __pyx_L0; /* "pygame_sdl2/scrap.pyx":59 * return SDL_HasClipboardText() == SDL_TRUE * * def lost(): # <<<<<<<<<<<<<< * return False * */ /* function exit code */ __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/scrap.pyx":62 * return False * * def set_mode(mode): # <<<<<<<<<<<<<< * pass */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_5scrap_13set_mode(PyObject *__pyx_self, PyObject *__pyx_v_mode); /*proto*/ static PyMethodDef __pyx_mdef_11pygame_sdl2_5scrap_13set_mode = {"set_mode", (PyCFunction)__pyx_pw_11pygame_sdl2_5scrap_13set_mode, METH_O, 0}; static PyObject *__pyx_pw_11pygame_sdl2_5scrap_13set_mode(PyObject *__pyx_self, PyObject *__pyx_v_mode) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("set_mode (wrapper)", 0); __pyx_r = __pyx_pf_11pygame_sdl2_5scrap_12set_mode(__pyx_self, ((PyObject *)__pyx_v_mode)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_5scrap_12set_mode(CYTHON_UNUSED PyObject *__pyx_self, CYTHON_UNUSED PyObject *__pyx_v_mode) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("set_mode", 0); /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyMethodDef __pyx_methods[] = { {0, 0, 0, 0} }; #if PY_MAJOR_VERSION >= 3 static struct PyModuleDef __pyx_moduledef = { #if PY_VERSION_HEX < 0x03020000 { PyObject_HEAD_INIT(NULL) NULL, 0, NULL }, #else PyModuleDef_HEAD_INIT, #endif "scrap", 0, /* m_doc */ -1, /* m_size */ __pyx_methods /* m_methods */, NULL, /* m_reload */ NULL, /* m_traverse */ NULL, /* m_clear */ NULL /* m_free */ }; #endif static __Pyx_StringTabEntry __pyx_string_tab[] = { {&__pyx_kp_u_Not_implemented, __pyx_k_Not_implemented, sizeof(__pyx_k_Not_implemented), 0, 1, 0, 0}, {&__pyx_n_s_SCRAP_TEXT, __pyx_k_SCRAP_TEXT, sizeof(__pyx_k_SCRAP_TEXT), 0, 0, 1, 1}, {&__pyx_n_s_bytes, __pyx_k_bytes, sizeof(__pyx_k_bytes), 0, 0, 1, 1}, {&__pyx_n_s_contains, __pyx_k_contains, sizeof(__pyx_k_contains), 0, 0, 1, 1}, {&__pyx_n_s_data, __pyx_k_data, sizeof(__pyx_k_data), 0, 0, 1, 1}, {&__pyx_n_s_error, __pyx_k_error, sizeof(__pyx_k_error), 0, 0, 1, 1}, {&__pyx_n_s_get, __pyx_k_get, sizeof(__pyx_k_get), 0, 0, 1, 1}, {&__pyx_n_s_get_types, __pyx_k_get_types, sizeof(__pyx_k_get_types), 0, 0, 1, 1}, {&__pyx_kp_s_home_tom_ab_pygame_sdl2_src_pyg, __pyx_k_home_tom_ab_pygame_sdl2_src_pyg, sizeof(__pyx_k_home_tom_ab_pygame_sdl2_src_pyg), 0, 0, 1, 0}, {&__pyx_n_s_import, __pyx_k_import, sizeof(__pyx_k_import), 0, 0, 1, 1}, {&__pyx_n_s_init, __pyx_k_init, sizeof(__pyx_k_init), 0, 0, 1, 1}, {&__pyx_n_s_lost, __pyx_k_lost, sizeof(__pyx_k_lost), 0, 0, 1, 1}, {&__pyx_n_s_main, __pyx_k_main, sizeof(__pyx_k_main), 0, 0, 1, 1}, {&__pyx_n_s_mode, __pyx_k_mode, sizeof(__pyx_k_mode), 0, 0, 1, 1}, {&__pyx_n_s_put, __pyx_k_put, sizeof(__pyx_k_put), 0, 0, 1, 1}, {&__pyx_n_s_pygame_sdl2_compat, __pyx_k_pygame_sdl2_compat, sizeof(__pyx_k_pygame_sdl2_compat), 0, 0, 1, 1}, {&__pyx_n_s_pygame_sdl2_error, __pyx_k_pygame_sdl2_error, sizeof(__pyx_k_pygame_sdl2_error), 0, 0, 1, 1}, {&__pyx_n_s_pygame_sdl2_locals, __pyx_k_pygame_sdl2_locals, sizeof(__pyx_k_pygame_sdl2_locals), 0, 0, 1, 1}, {&__pyx_n_s_pygame_sdl2_scrap, __pyx_k_pygame_sdl2_scrap, sizeof(__pyx_k_pygame_sdl2_scrap), 0, 0, 1, 1}, {&__pyx_n_s_rv, __pyx_k_rv, sizeof(__pyx_k_rv), 0, 0, 1, 1}, {&__pyx_n_s_set_mode, __pyx_k_set_mode, sizeof(__pyx_k_set_mode), 0, 0, 1, 1}, {&__pyx_n_s_test, __pyx_k_test, sizeof(__pyx_k_test), 0, 0, 1, 1}, {&__pyx_n_s_text, __pyx_k_text, sizeof(__pyx_k_text), 0, 0, 1, 1}, {&__pyx_n_s_type, __pyx_k_type, sizeof(__pyx_k_type), 0, 0, 1, 1}, {0, 0, 0, 0, 0, 0, 0} }; static int __Pyx_InitCachedBuiltins(void) { return 0; } static int __Pyx_InitCachedConstants(void) { __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__Pyx_InitCachedConstants", 0); /* "pygame_sdl2/scrap.pyx":39 * return rv * else: * raise error("Not implemented.") # <<<<<<<<<<<<<< * * def get_types(): */ __pyx_tuple_ = PyTuple_Pack(1, __pyx_kp_u_Not_implemented); if (unlikely(!__pyx_tuple_)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 39; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_tuple_); __Pyx_GIVEREF(__pyx_tuple_); /* "pygame_sdl2/scrap.pyx":46 * def put(type, data): * if type != SCRAP_TEXT: * raise error("Not implemented.") # <<<<<<<<<<<<<< * * data = bytes_(data) */ __pyx_tuple__2 = PyTuple_Pack(1, __pyx_kp_u_Not_implemented); if (unlikely(!__pyx_tuple__2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 46; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_tuple__2); __Pyx_GIVEREF(__pyx_tuple__2); /* "pygame_sdl2/scrap.pyx":26 * from pygame_sdl2.compat import bytes_ * * def init(): # <<<<<<<<<<<<<< * pass * */ __pyx_codeobj__3 = (PyObject*)__Pyx_PyCode_New(0, 0, 0, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_tom_ab_pygame_sdl2_src_pyg, __pyx_n_s_init, 26, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 26; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "pygame_sdl2/scrap.pyx":29 * pass * * def get(type): # <<<<<<<<<<<<<< * cdef char *text = NULL * if type == SCRAP_TEXT: */ __pyx_tuple__4 = PyTuple_Pack(3, __pyx_n_s_type, __pyx_n_s_text, __pyx_n_s_rv); if (unlikely(!__pyx_tuple__4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 29; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_tuple__4); __Pyx_GIVEREF(__pyx_tuple__4); __pyx_codeobj__5 = (PyObject*)__Pyx_PyCode_New(1, 0, 3, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__4, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_tom_ab_pygame_sdl2_src_pyg, __pyx_n_s_get, 29, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 29; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "pygame_sdl2/scrap.pyx":41 * raise error("Not implemented.") * * def get_types(): # <<<<<<<<<<<<<< * return [SCRAP_TEXT] * */ __pyx_codeobj__6 = (PyObject*)__Pyx_PyCode_New(0, 0, 0, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_tom_ab_pygame_sdl2_src_pyg, __pyx_n_s_get_types, 41, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 41; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "pygame_sdl2/scrap.pyx":44 * return [SCRAP_TEXT] * * def put(type, data): # <<<<<<<<<<<<<< * if type != SCRAP_TEXT: * raise error("Not implemented.") */ __pyx_tuple__7 = PyTuple_Pack(2, __pyx_n_s_type, __pyx_n_s_data); if (unlikely(!__pyx_tuple__7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 44; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_tuple__7); __Pyx_GIVEREF(__pyx_tuple__7); __pyx_codeobj__8 = (PyObject*)__Pyx_PyCode_New(2, 0, 2, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__7, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_tom_ab_pygame_sdl2_src_pyg, __pyx_n_s_put, 44, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 44; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "pygame_sdl2/scrap.pyx":53 * raise error() * * def contains(type): # <<<<<<<<<<<<<< * if type != SCRAP_TEXT: * return False */ __pyx_tuple__9 = PyTuple_Pack(1, __pyx_n_s_type); if (unlikely(!__pyx_tuple__9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 53; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_tuple__9); __Pyx_GIVEREF(__pyx_tuple__9); __pyx_codeobj__10 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__9, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_tom_ab_pygame_sdl2_src_pyg, __pyx_n_s_contains, 53, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 53; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "pygame_sdl2/scrap.pyx":59 * return SDL_HasClipboardText() == SDL_TRUE * * def lost(): # <<<<<<<<<<<<<< * return False * */ __pyx_codeobj__11 = (PyObject*)__Pyx_PyCode_New(0, 0, 0, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_tom_ab_pygame_sdl2_src_pyg, __pyx_n_s_lost, 59, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 59; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "pygame_sdl2/scrap.pyx":62 * return False * * def set_mode(mode): # <<<<<<<<<<<<<< * pass */ __pyx_tuple__12 = PyTuple_Pack(1, __pyx_n_s_mode); if (unlikely(!__pyx_tuple__12)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 62; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_tuple__12); __Pyx_GIVEREF(__pyx_tuple__12); __pyx_codeobj__13 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__12, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_tom_ab_pygame_sdl2_src_pyg, __pyx_n_s_set_mode, 62, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__13)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 62; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_RefNannyFinishContext(); return 0; __pyx_L1_error:; __Pyx_RefNannyFinishContext(); return -1; } static int __Pyx_InitGlobals(void) { if (__Pyx_InitStrings(__pyx_string_tab) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; return 0; __pyx_L1_error:; return -1; } #if PY_MAJOR_VERSION < 3 PyMODINIT_FUNC initscrap(void); /*proto*/ PyMODINIT_FUNC initscrap(void) #else PyMODINIT_FUNC PyInit_scrap(void); /*proto*/ PyMODINIT_FUNC PyInit_scrap(void) #endif { PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannyDeclarations #if CYTHON_REFNANNY __Pyx_RefNanny = __Pyx_RefNannyImportAPI("refnanny"); if (!__Pyx_RefNanny) { PyErr_Clear(); __Pyx_RefNanny = __Pyx_RefNannyImportAPI("Cython.Runtime.refnanny"); if (!__Pyx_RefNanny) Py_FatalError("failed to import 'refnanny' module"); } #endif __Pyx_RefNannySetupContext("PyMODINIT_FUNC PyInit_scrap(void)", 0); if (__Pyx_check_binary_version() < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_empty_tuple = PyTuple_New(0); if (unlikely(!__pyx_empty_tuple)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_empty_bytes = PyBytes_FromStringAndSize("", 0); if (unlikely(!__pyx_empty_bytes)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} #ifdef __Pyx_CyFunction_USED if (__pyx_CyFunction_init() < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} #endif #ifdef __Pyx_FusedFunction_USED if (__pyx_FusedFunction_init() < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} #endif #ifdef __Pyx_Coroutine_USED if (__pyx_Coroutine_init() < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} #endif #ifdef __Pyx_Generator_USED if (__pyx_Generator_init() < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} #endif #ifdef __Pyx_StopAsyncIteration_USED if (__pyx_StopAsyncIteration_init() < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} #endif /*--- Library function declarations ---*/ /*--- Threads initialization code ---*/ #if defined(__PYX_FORCE_INIT_THREADS) && __PYX_FORCE_INIT_THREADS #ifdef WITH_THREAD /* Python build with threading support? */ PyEval_InitThreads(); #endif #endif /*--- Module creation code ---*/ #if PY_MAJOR_VERSION < 3 __pyx_m = Py_InitModule4("scrap", __pyx_methods, 0, 0, PYTHON_API_VERSION); Py_XINCREF(__pyx_m); #else __pyx_m = PyModule_Create(&__pyx_moduledef); #endif if (unlikely(!__pyx_m)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_d = PyModule_GetDict(__pyx_m); if (unlikely(!__pyx_d)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} Py_INCREF(__pyx_d); __pyx_b = PyImport_AddModule(__Pyx_BUILTIN_MODULE_NAME); if (unlikely(!__pyx_b)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} #if CYTHON_COMPILING_IN_PYPY Py_INCREF(__pyx_b); #endif if (PyObject_SetAttrString(__pyx_m, "__builtins__", __pyx_b) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; /*--- Initialize various global constants etc. ---*/ if (__Pyx_InitGlobals() < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} #if PY_MAJOR_VERSION < 3 && (__PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT) if (__Pyx_init_sys_getdefaultencoding_params() < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} #endif if (__pyx_module_is_main_pygame_sdl2__scrap) { if (PyObject_SetAttrString(__pyx_m, "__name__", __pyx_n_s_main) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } #if PY_MAJOR_VERSION >= 3 { PyObject *modules = PyImport_GetModuleDict(); if (unlikely(!modules)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} if (!PyDict_GetItemString(modules, "pygame_sdl2.scrap")) { if (unlikely(PyDict_SetItemString(modules, "pygame_sdl2.scrap", __pyx_m) < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } } #endif /*--- Builtin init code ---*/ if (__Pyx_InitCachedBuiltins() < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /*--- Constants init code ---*/ if (__Pyx_InitCachedConstants() < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /*--- Global init code ---*/ /*--- Variable export code ---*/ /*--- Function export code ---*/ /*--- Type init code ---*/ /*--- Type import code ---*/ /*--- Variable import code ---*/ /*--- Function import code ---*/ /*--- Execution code ---*/ #if defined(__Pyx_Generator_USED) || defined(__Pyx_Coroutine_USED) if (__Pyx_patch_abc() < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} #endif /* "pygame_sdl2/scrap.pyx":21 * from sdl2 cimport * * * from pygame_sdl2.error import error # <<<<<<<<<<<<<< * from pygame_sdl2.locals import SCRAP_TEXT * */ __pyx_t_1 = PyList_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 21; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __Pyx_INCREF(__pyx_n_s_error); __Pyx_GIVEREF(__pyx_n_s_error); PyList_SET_ITEM(__pyx_t_1, 0, __pyx_n_s_error); __pyx_t_2 = __Pyx_Import(__pyx_n_s_pygame_sdl2_error, __pyx_t_1, 0); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 21; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_1 = __Pyx_ImportFrom(__pyx_t_2, __pyx_n_s_error); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 21; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); if (PyDict_SetItem(__pyx_d, __pyx_n_s_error, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 21; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "pygame_sdl2/scrap.pyx":22 * * from pygame_sdl2.error import error * from pygame_sdl2.locals import SCRAP_TEXT # <<<<<<<<<<<<<< * * from pygame_sdl2.compat import bytes_ */ __pyx_t_2 = PyList_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 22; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __Pyx_INCREF(__pyx_n_s_SCRAP_TEXT); __Pyx_GIVEREF(__pyx_n_s_SCRAP_TEXT); PyList_SET_ITEM(__pyx_t_2, 0, __pyx_n_s_SCRAP_TEXT); __pyx_t_1 = __Pyx_Import(__pyx_n_s_pygame_sdl2_locals, __pyx_t_2, 0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 22; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_2 = __Pyx_ImportFrom(__pyx_t_1, __pyx_n_s_SCRAP_TEXT); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 22; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_SCRAP_TEXT, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 22; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "pygame_sdl2/scrap.pyx":24 * from pygame_sdl2.locals import SCRAP_TEXT * * from pygame_sdl2.compat import bytes_ # <<<<<<<<<<<<<< * * def init(): */ __pyx_t_1 = PyList_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 24; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __Pyx_INCREF(__pyx_n_s_bytes); __Pyx_GIVEREF(__pyx_n_s_bytes); PyList_SET_ITEM(__pyx_t_1, 0, __pyx_n_s_bytes); __pyx_t_2 = __Pyx_Import(__pyx_n_s_pygame_sdl2_compat, __pyx_t_1, 0); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 24; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_1 = __Pyx_ImportFrom(__pyx_t_2, __pyx_n_s_bytes); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 24; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); if (PyDict_SetItem(__pyx_d, __pyx_n_s_bytes, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 24; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "pygame_sdl2/scrap.pyx":26 * from pygame_sdl2.compat import bytes_ * * def init(): # <<<<<<<<<<<<<< * pass * */ __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_11pygame_sdl2_5scrap_1init, NULL, __pyx_n_s_pygame_sdl2_scrap); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 26; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_init, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 26; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "pygame_sdl2/scrap.pyx":29 * pass * * def get(type): # <<<<<<<<<<<<<< * cdef char *text = NULL * if type == SCRAP_TEXT: */ __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_11pygame_sdl2_5scrap_3get, NULL, __pyx_n_s_pygame_sdl2_scrap); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 29; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_get, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 29; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "pygame_sdl2/scrap.pyx":41 * raise error("Not implemented.") * * def get_types(): # <<<<<<<<<<<<<< * return [SCRAP_TEXT] * */ __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_11pygame_sdl2_5scrap_5get_types, NULL, __pyx_n_s_pygame_sdl2_scrap); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 41; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_get_types, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 41; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "pygame_sdl2/scrap.pyx":44 * return [SCRAP_TEXT] * * def put(type, data): # <<<<<<<<<<<<<< * if type != SCRAP_TEXT: * raise error("Not implemented.") */ __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_11pygame_sdl2_5scrap_7put, NULL, __pyx_n_s_pygame_sdl2_scrap); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 44; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_put, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 44; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "pygame_sdl2/scrap.pyx":53 * raise error() * * def contains(type): # <<<<<<<<<<<<<< * if type != SCRAP_TEXT: * return False */ __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_11pygame_sdl2_5scrap_9contains, NULL, __pyx_n_s_pygame_sdl2_scrap); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 53; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_contains, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 53; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "pygame_sdl2/scrap.pyx":59 * return SDL_HasClipboardText() == SDL_TRUE * * def lost(): # <<<<<<<<<<<<<< * return False * */ __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_11pygame_sdl2_5scrap_11lost, NULL, __pyx_n_s_pygame_sdl2_scrap); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 59; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_lost, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 59; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "pygame_sdl2/scrap.pyx":62 * return False * * def set_mode(mode): # <<<<<<<<<<<<<< * pass */ __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_11pygame_sdl2_5scrap_13set_mode, NULL, __pyx_n_s_pygame_sdl2_scrap); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 62; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_set_mode, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 62; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "pygame_sdl2/scrap.pyx":1 * # Copyright 2014 Patrick Dawson # <<<<<<<<<<<<<< * # * # This software is provided 'as-is', without any express or implied */ __pyx_t_2 = PyDict_New(); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_test, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /*--- Wrapped vars code ---*/ goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); if (__pyx_m) { if (__pyx_d) { __Pyx_AddTraceback("init pygame_sdl2.scrap", __pyx_clineno, __pyx_lineno, __pyx_filename); } Py_DECREF(__pyx_m); __pyx_m = 0; } else if (!PyErr_Occurred()) { PyErr_SetString(PyExc_ImportError, "init pygame_sdl2.scrap"); } __pyx_L0:; __Pyx_RefNannyFinishContext(); #if PY_MAJOR_VERSION < 3 return; #else return __pyx_m; #endif } /* --- Runtime support code --- */ #if CYTHON_REFNANNY static __Pyx_RefNannyAPIStruct *__Pyx_RefNannyImportAPI(const char *modname) { PyObject *m = NULL, *p = NULL; void *r = NULL; m = PyImport_ImportModule((char *)modname); if (!m) goto end; p = PyObject_GetAttrString(m, (char *)"RefNannyAPI"); if (!p) goto end; r = PyLong_AsVoidPtr(p); end: Py_XDECREF(p); Py_XDECREF(m); return (__Pyx_RefNannyAPIStruct *)r; } #endif static PyObject *__Pyx_GetBuiltinName(PyObject *name) { PyObject* result = __Pyx_PyObject_GetAttrStr(__pyx_b, name); if (unlikely(!result)) { PyErr_Format(PyExc_NameError, #if PY_MAJOR_VERSION >= 3 "name '%U' is not defined", name); #else "name '%.200s' is not defined", PyString_AS_STRING(name)); #endif } return result; } static CYTHON_INLINE PyObject *__Pyx_GetModuleGlobalName(PyObject *name) { PyObject *result; #if CYTHON_COMPILING_IN_CPYTHON result = PyDict_GetItem(__pyx_d, name); if (likely(result)) { Py_INCREF(result); } else { #else result = PyObject_GetItem(__pyx_d, name); if (!result) { PyErr_Clear(); #endif result = __Pyx_GetBuiltinName(name); } return result; } #if CYTHON_COMPILING_IN_CPYTHON static CYTHON_INLINE PyObject* __Pyx_PyObject_Call(PyObject *func, PyObject *arg, PyObject *kw) { PyObject *result; ternaryfunc call = func->ob_type->tp_call; if (unlikely(!call)) return PyObject_Call(func, arg, kw); if (unlikely(Py_EnterRecursiveCall((char*)" while calling a Python object"))) return NULL; result = (*call)(func, arg, kw); Py_LeaveRecursiveCall(); if (unlikely(!result) && unlikely(!PyErr_Occurred())) { PyErr_SetString( PyExc_SystemError, "NULL result without error in PyObject_Call"); } return result; } #endif #if CYTHON_COMPILING_IN_CPYTHON static CYTHON_INLINE PyObject* __Pyx_PyObject_CallMethO(PyObject *func, PyObject *arg) { PyObject *self, *result; PyCFunction cfunc; cfunc = PyCFunction_GET_FUNCTION(func); self = PyCFunction_GET_SELF(func); if (unlikely(Py_EnterRecursiveCall((char*)" while calling a Python object"))) return NULL; result = cfunc(self, arg); Py_LeaveRecursiveCall(); if (unlikely(!result) && unlikely(!PyErr_Occurred())) { PyErr_SetString( PyExc_SystemError, "NULL result without error in PyObject_Call"); } return result; } #endif #if CYTHON_COMPILING_IN_CPYTHON static PyObject* __Pyx__PyObject_CallOneArg(PyObject *func, PyObject *arg) { PyObject *result; PyObject *args = PyTuple_New(1); if (unlikely(!args)) return NULL; Py_INCREF(arg); PyTuple_SET_ITEM(args, 0, arg); result = __Pyx_PyObject_Call(func, args, NULL); Py_DECREF(args); return result; } static CYTHON_INLINE PyObject* __Pyx_PyObject_CallOneArg(PyObject *func, PyObject *arg) { #ifdef __Pyx_CyFunction_USED if (likely(PyCFunction_Check(func) || PyObject_TypeCheck(func, __pyx_CyFunctionType))) { #else if (likely(PyCFunction_Check(func))) { #endif if (likely(PyCFunction_GET_FLAGS(func) & METH_O)) { return __Pyx_PyObject_CallMethO(func, arg); } } return __Pyx__PyObject_CallOneArg(func, arg); } #else static CYTHON_INLINE PyObject* __Pyx_PyObject_CallOneArg(PyObject *func, PyObject *arg) { PyObject* args = PyTuple_Pack(1, arg); return (likely(args)) ? __Pyx_PyObject_Call(func, args, NULL) : NULL; } #endif #if CYTHON_COMPILING_IN_CPYTHON static CYTHON_INLINE PyObject* __Pyx_PyObject_CallNoArg(PyObject *func) { #ifdef __Pyx_CyFunction_USED if (likely(PyCFunction_Check(func) || PyObject_TypeCheck(func, __pyx_CyFunctionType))) { #else if (likely(PyCFunction_Check(func))) { #endif if (likely(PyCFunction_GET_FLAGS(func) & METH_NOARGS)) { return __Pyx_PyObject_CallMethO(func, NULL); } } return __Pyx_PyObject_Call(func, __pyx_empty_tuple, NULL); } #endif static CYTHON_INLINE void __Pyx_ErrRestore(PyObject *type, PyObject *value, PyObject *tb) { #if CYTHON_COMPILING_IN_CPYTHON PyObject *tmp_type, *tmp_value, *tmp_tb; PyThreadState *tstate = PyThreadState_GET(); tmp_type = tstate->curexc_type; tmp_value = tstate->curexc_value; tmp_tb = tstate->curexc_traceback; tstate->curexc_type = type; tstate->curexc_value = value; tstate->curexc_traceback = tb; Py_XDECREF(tmp_type); Py_XDECREF(tmp_value); Py_XDECREF(tmp_tb); #else PyErr_Restore(type, value, tb); #endif } static CYTHON_INLINE void __Pyx_ErrFetch(PyObject **type, PyObject **value, PyObject **tb) { #if CYTHON_COMPILING_IN_CPYTHON PyThreadState *tstate = PyThreadState_GET(); *type = tstate->curexc_type; *value = tstate->curexc_value; *tb = tstate->curexc_traceback; tstate->curexc_type = 0; tstate->curexc_value = 0; tstate->curexc_traceback = 0; #else PyErr_Fetch(type, value, tb); #endif } #if PY_MAJOR_VERSION < 3 static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, CYTHON_UNUSED PyObject *cause) { Py_XINCREF(type); if (!value || value == Py_None) value = NULL; else Py_INCREF(value); if (!tb || tb == Py_None) tb = NULL; else { Py_INCREF(tb); if (!PyTraceBack_Check(tb)) { PyErr_SetString(PyExc_TypeError, "raise: arg 3 must be a traceback or None"); goto raise_error; } } if (PyType_Check(type)) { #if CYTHON_COMPILING_IN_PYPY if (!value) { Py_INCREF(Py_None); value = Py_None; } #endif PyErr_NormalizeException(&type, &value, &tb); } else { if (value) { PyErr_SetString(PyExc_TypeError, "instance exception may not have a separate value"); goto raise_error; } value = type; type = (PyObject*) Py_TYPE(type); Py_INCREF(type); if (!PyType_IsSubtype((PyTypeObject *)type, (PyTypeObject *)PyExc_BaseException)) { PyErr_SetString(PyExc_TypeError, "raise: exception class must be a subclass of BaseException"); goto raise_error; } } __Pyx_ErrRestore(type, value, tb); return; raise_error: Py_XDECREF(value); Py_XDECREF(type); Py_XDECREF(tb); return; } #else static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, PyObject *cause) { PyObject* owned_instance = NULL; if (tb == Py_None) { tb = 0; } else if (tb && !PyTraceBack_Check(tb)) { PyErr_SetString(PyExc_TypeError, "raise: arg 3 must be a traceback or None"); goto bad; } if (value == Py_None) value = 0; if (PyExceptionInstance_Check(type)) { if (value) { PyErr_SetString(PyExc_TypeError, "instance exception may not have a separate value"); goto bad; } value = type; type = (PyObject*) Py_TYPE(value); } else if (PyExceptionClass_Check(type)) { PyObject *instance_class = NULL; if (value && PyExceptionInstance_Check(value)) { instance_class = (PyObject*) Py_TYPE(value); if (instance_class != type) { int is_subclass = PyObject_IsSubclass(instance_class, type); if (!is_subclass) { instance_class = NULL; } else if (unlikely(is_subclass == -1)) { goto bad; } else { type = instance_class; } } } if (!instance_class) { PyObject *args; if (!value) args = PyTuple_New(0); else if (PyTuple_Check(value)) { Py_INCREF(value); args = value; } else args = PyTuple_Pack(1, value); if (!args) goto bad; owned_instance = PyObject_Call(type, args, NULL); Py_DECREF(args); if (!owned_instance) goto bad; value = owned_instance; if (!PyExceptionInstance_Check(value)) { PyErr_Format(PyExc_TypeError, "calling %R should have returned an instance of " "BaseException, not %R", type, Py_TYPE(value)); goto bad; } } } else { PyErr_SetString(PyExc_TypeError, "raise: exception class must be a subclass of BaseException"); goto bad; } #if PY_VERSION_HEX >= 0x03030000 if (cause) { #else if (cause && cause != Py_None) { #endif PyObject *fixed_cause; if (cause == Py_None) { fixed_cause = NULL; } else if (PyExceptionClass_Check(cause)) { fixed_cause = PyObject_CallObject(cause, NULL); if (fixed_cause == NULL) goto bad; } else if (PyExceptionInstance_Check(cause)) { fixed_cause = cause; Py_INCREF(fixed_cause); } else { PyErr_SetString(PyExc_TypeError, "exception causes must derive from " "BaseException"); goto bad; } PyException_SetCause(value, fixed_cause); } PyErr_SetObject(type, value); if (tb) { #if CYTHON_COMPILING_IN_PYPY PyObject *tmp_type, *tmp_value, *tmp_tb; PyErr_Fetch(&tmp_type, &tmp_value, &tmp_tb); Py_INCREF(tb); PyErr_Restore(tmp_type, tmp_value, tb); Py_XDECREF(tmp_tb); #else PyThreadState *tstate = PyThreadState_GET(); PyObject* tmp_tb = tstate->curexc_traceback; if (tb != tmp_tb) { Py_INCREF(tb); tstate->curexc_traceback = tb; Py_XDECREF(tmp_tb); } #endif } bad: Py_XDECREF(owned_instance); return; } #endif static void __Pyx_RaiseArgtupleInvalid( const char* func_name, int exact, Py_ssize_t num_min, Py_ssize_t num_max, Py_ssize_t num_found) { Py_ssize_t num_expected; const char *more_or_less; if (num_found < num_min) { num_expected = num_min; more_or_less = "at least"; } else { num_expected = num_max; more_or_less = "at most"; } if (exact) { more_or_less = "exactly"; } PyErr_Format(PyExc_TypeError, "%.200s() takes %.8s %" CYTHON_FORMAT_SSIZE_T "d positional argument%.1s (%" CYTHON_FORMAT_SSIZE_T "d given)", func_name, more_or_less, num_expected, (num_expected == 1) ? "" : "s", num_found); } static void __Pyx_RaiseDoubleKeywordsError( const char* func_name, PyObject* kw_name) { PyErr_Format(PyExc_TypeError, #if PY_MAJOR_VERSION >= 3 "%s() got multiple values for keyword argument '%U'", func_name, kw_name); #else "%s() got multiple values for keyword argument '%s'", func_name, PyString_AsString(kw_name)); #endif } static int __Pyx_ParseOptionalKeywords( PyObject *kwds, PyObject **argnames[], PyObject *kwds2, PyObject *values[], Py_ssize_t num_pos_args, const char* function_name) { PyObject *key = 0, *value = 0; Py_ssize_t pos = 0; PyObject*** name; PyObject*** first_kw_arg = argnames + num_pos_args; while (PyDict_Next(kwds, &pos, &key, &value)) { name = first_kw_arg; while (*name && (**name != key)) name++; if (*name) { values[name-argnames] = value; continue; } name = first_kw_arg; #if PY_MAJOR_VERSION < 3 if (likely(PyString_CheckExact(key)) || likely(PyString_Check(key))) { while (*name) { if ((CYTHON_COMPILING_IN_PYPY || PyString_GET_SIZE(**name) == PyString_GET_SIZE(key)) && _PyString_Eq(**name, key)) { values[name-argnames] = value; break; } name++; } if (*name) continue; else { PyObject*** argname = argnames; while (argname != first_kw_arg) { if ((**argname == key) || ( (CYTHON_COMPILING_IN_PYPY || PyString_GET_SIZE(**argname) == PyString_GET_SIZE(key)) && _PyString_Eq(**argname, key))) { goto arg_passed_twice; } argname++; } } } else #endif if (likely(PyUnicode_Check(key))) { while (*name) { int cmp = (**name == key) ? 0 : #if !CYTHON_COMPILING_IN_PYPY && PY_MAJOR_VERSION >= 3 (PyUnicode_GET_SIZE(**name) != PyUnicode_GET_SIZE(key)) ? 1 : #endif PyUnicode_Compare(**name, key); if (cmp < 0 && unlikely(PyErr_Occurred())) goto bad; if (cmp == 0) { values[name-argnames] = value; break; } name++; } if (*name) continue; else { PyObject*** argname = argnames; while (argname != first_kw_arg) { int cmp = (**argname == key) ? 0 : #if !CYTHON_COMPILING_IN_PYPY && PY_MAJOR_VERSION >= 3 (PyUnicode_GET_SIZE(**argname) != PyUnicode_GET_SIZE(key)) ? 1 : #endif PyUnicode_Compare(**argname, key); if (cmp < 0 && unlikely(PyErr_Occurred())) goto bad; if (cmp == 0) goto arg_passed_twice; argname++; } } } else goto invalid_keyword_type; if (kwds2) { if (unlikely(PyDict_SetItem(kwds2, key, value))) goto bad; } else { goto invalid_keyword; } } return 0; arg_passed_twice: __Pyx_RaiseDoubleKeywordsError(function_name, key); goto bad; invalid_keyword_type: PyErr_Format(PyExc_TypeError, "%.200s() keywords must be strings", function_name); goto bad; invalid_keyword: PyErr_Format(PyExc_TypeError, #if PY_MAJOR_VERSION < 3 "%.200s() got an unexpected keyword argument '%.200s'", function_name, PyString_AsString(key)); #else "%s() got an unexpected keyword argument '%U'", function_name, key); #endif bad: return -1; } static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list, int level) { PyObject *empty_list = 0; PyObject *module = 0; PyObject *global_dict = 0; PyObject *empty_dict = 0; PyObject *list; #if PY_VERSION_HEX < 0x03030000 PyObject *py_import; py_import = __Pyx_PyObject_GetAttrStr(__pyx_b, __pyx_n_s_import); if (!py_import) goto bad; #endif if (from_list) list = from_list; else { empty_list = PyList_New(0); if (!empty_list) goto bad; list = empty_list; } global_dict = PyModule_GetDict(__pyx_m); if (!global_dict) goto bad; empty_dict = PyDict_New(); if (!empty_dict) goto bad; { #if PY_MAJOR_VERSION >= 3 if (level == -1) { if (strchr(__Pyx_MODULE_NAME, '.')) { #if PY_VERSION_HEX < 0x03030000 PyObject *py_level = PyInt_FromLong(1); if (!py_level) goto bad; module = PyObject_CallFunctionObjArgs(py_import, name, global_dict, empty_dict, list, py_level, NULL); Py_DECREF(py_level); #else module = PyImport_ImportModuleLevelObject( name, global_dict, empty_dict, list, 1); #endif if (!module) { if (!PyErr_ExceptionMatches(PyExc_ImportError)) goto bad; PyErr_Clear(); } } level = 0; } #endif if (!module) { #if PY_VERSION_HEX < 0x03030000 PyObject *py_level = PyInt_FromLong(level); if (!py_level) goto bad; module = PyObject_CallFunctionObjArgs(py_import, name, global_dict, empty_dict, list, py_level, NULL); Py_DECREF(py_level); #else module = PyImport_ImportModuleLevelObject( name, global_dict, empty_dict, list, level); #endif } } bad: #if PY_VERSION_HEX < 0x03030000 Py_XDECREF(py_import); #endif Py_XDECREF(empty_list); Py_XDECREF(empty_dict); return module; } static PyObject* __Pyx_ImportFrom(PyObject* module, PyObject* name) { PyObject* value = __Pyx_PyObject_GetAttrStr(module, name); if (unlikely(!value) && PyErr_ExceptionMatches(PyExc_AttributeError)) { PyErr_Format(PyExc_ImportError, #if PY_MAJOR_VERSION < 3 "cannot import name %.230s", PyString_AS_STRING(name)); #else "cannot import name %S", name); #endif } return value; } static int __pyx_bisect_code_objects(__Pyx_CodeObjectCacheEntry* entries, int count, int code_line) { int start = 0, mid = 0, end = count - 1; if (end >= 0 && code_line > entries[end].code_line) { return count; } while (start < end) { mid = start + (end - start) / 2; if (code_line < entries[mid].code_line) { end = mid; } else if (code_line > entries[mid].code_line) { start = mid + 1; } else { return mid; } } if (code_line <= entries[mid].code_line) { return mid; } else { return mid + 1; } } static PyCodeObject *__pyx_find_code_object(int code_line) { PyCodeObject* code_object; int pos; if (unlikely(!code_line) || unlikely(!__pyx_code_cache.entries)) { return NULL; } pos = __pyx_bisect_code_objects(__pyx_code_cache.entries, __pyx_code_cache.count, code_line); if (unlikely(pos >= __pyx_code_cache.count) || unlikely(__pyx_code_cache.entries[pos].code_line != code_line)) { return NULL; } code_object = __pyx_code_cache.entries[pos].code_object; Py_INCREF(code_object); return code_object; } static void __pyx_insert_code_object(int code_line, PyCodeObject* code_object) { int pos, i; __Pyx_CodeObjectCacheEntry* entries = __pyx_code_cache.entries; if (unlikely(!code_line)) { return; } if (unlikely(!entries)) { entries = (__Pyx_CodeObjectCacheEntry*)PyMem_Malloc(64*sizeof(__Pyx_CodeObjectCacheEntry)); if (likely(entries)) { __pyx_code_cache.entries = entries; __pyx_code_cache.max_count = 64; __pyx_code_cache.count = 1; entries[0].code_line = code_line; entries[0].code_object = code_object; Py_INCREF(code_object); } return; } pos = __pyx_bisect_code_objects(__pyx_code_cache.entries, __pyx_code_cache.count, code_line); if ((pos < __pyx_code_cache.count) && unlikely(__pyx_code_cache.entries[pos].code_line == code_line)) { PyCodeObject* tmp = entries[pos].code_object; entries[pos].code_object = code_object; Py_DECREF(tmp); return; } if (__pyx_code_cache.count == __pyx_code_cache.max_count) { int new_max = __pyx_code_cache.max_count + 64; entries = (__Pyx_CodeObjectCacheEntry*)PyMem_Realloc( __pyx_code_cache.entries, (size_t)new_max*sizeof(__Pyx_CodeObjectCacheEntry)); if (unlikely(!entries)) { return; } __pyx_code_cache.entries = entries; __pyx_code_cache.max_count = new_max; } for (i=__pyx_code_cache.count; i>pos; i--) { entries[i] = entries[i-1]; } entries[pos].code_line = code_line; entries[pos].code_object = code_object; __pyx_code_cache.count++; Py_INCREF(code_object); } #include "compile.h" #include "frameobject.h" #include "traceback.h" static PyCodeObject* __Pyx_CreateCodeObjectForTraceback( const char *funcname, int c_line, int py_line, const char *filename) { PyCodeObject *py_code = 0; PyObject *py_srcfile = 0; PyObject *py_funcname = 0; #if PY_MAJOR_VERSION < 3 py_srcfile = PyString_FromString(filename); #else py_srcfile = PyUnicode_FromString(filename); #endif if (!py_srcfile) goto bad; if (c_line) { #if PY_MAJOR_VERSION < 3 py_funcname = PyString_FromFormat( "%s (%s:%d)", funcname, __pyx_cfilenm, c_line); #else py_funcname = PyUnicode_FromFormat( "%s (%s:%d)", funcname, __pyx_cfilenm, c_line); #endif } else { #if PY_MAJOR_VERSION < 3 py_funcname = PyString_FromString(funcname); #else py_funcname = PyUnicode_FromString(funcname); #endif } if (!py_funcname) goto bad; py_code = __Pyx_PyCode_New( 0, 0, 0, 0, 0, __pyx_empty_bytes, /*PyObject *code,*/ __pyx_empty_tuple, /*PyObject *consts,*/ __pyx_empty_tuple, /*PyObject *names,*/ __pyx_empty_tuple, /*PyObject *varnames,*/ __pyx_empty_tuple, /*PyObject *freevars,*/ __pyx_empty_tuple, /*PyObject *cellvars,*/ py_srcfile, /*PyObject *filename,*/ py_funcname, /*PyObject *name,*/ py_line, __pyx_empty_bytes /*PyObject *lnotab*/ ); Py_DECREF(py_srcfile); Py_DECREF(py_funcname); return py_code; bad: Py_XDECREF(py_srcfile); Py_XDECREF(py_funcname); return NULL; } static void __Pyx_AddTraceback(const char *funcname, int c_line, int py_line, const char *filename) { PyCodeObject *py_code = 0; PyFrameObject *py_frame = 0; py_code = __pyx_find_code_object(c_line ? c_line : py_line); if (!py_code) { py_code = __Pyx_CreateCodeObjectForTraceback( funcname, c_line, py_line, filename); if (!py_code) goto bad; __pyx_insert_code_object(c_line ? c_line : py_line, py_code); } py_frame = PyFrame_New( PyThreadState_GET(), /*PyThreadState *tstate,*/ py_code, /*PyCodeObject *code,*/ __pyx_d, /*PyObject *globals,*/ 0 /*PyObject *locals*/ ); if (!py_frame) goto bad; py_frame->f_lineno = py_line; PyTraceBack_Here(py_frame); bad: Py_XDECREF(py_code); Py_XDECREF(py_frame); } static CYTHON_INLINE PyObject* __Pyx_PyInt_From_long(long value) { const long neg_one = (long) -1, const_zero = (long) 0; const int is_unsigned = neg_one > const_zero; if (is_unsigned) { if (sizeof(long) < sizeof(long)) { return PyInt_FromLong((long) value); } else if (sizeof(long) <= sizeof(unsigned long)) { return PyLong_FromUnsignedLong((unsigned long) value); } else if (sizeof(long) <= sizeof(unsigned PY_LONG_LONG)) { return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value); } } else { if (sizeof(long) <= sizeof(long)) { return PyInt_FromLong((long) value); } else if (sizeof(long) <= sizeof(PY_LONG_LONG)) { return PyLong_FromLongLong((PY_LONG_LONG) value); } } { int one = 1; int little = (int)*(unsigned char *)&one; unsigned char *bytes = (unsigned char *)&value; return _PyLong_FromByteArray(bytes, sizeof(long), little, !is_unsigned); } } #define __PYX_VERIFY_RETURN_INT(target_type, func_type, func_value)\ __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, 0) #define __PYX_VERIFY_RETURN_INT_EXC(target_type, func_type, func_value)\ __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, 1) #define __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, exc)\ {\ func_type value = func_value;\ if (sizeof(target_type) < sizeof(func_type)) {\ if (unlikely(value != (func_type) (target_type) value)) {\ func_type zero = 0;\ if (exc && unlikely(value == (func_type)-1 && PyErr_Occurred()))\ return (target_type) -1;\ if (is_unsigned && unlikely(value < zero))\ goto raise_neg_overflow;\ else\ goto raise_overflow;\ }\ }\ return (target_type) value;\ } #if CYTHON_USE_PYLONG_INTERNALS #include "longintrepr.h" #endif static CYTHON_INLINE long __Pyx_PyInt_As_long(PyObject *x) { const long neg_one = (long) -1, const_zero = (long) 0; const int is_unsigned = neg_one > const_zero; #if PY_MAJOR_VERSION < 3 if (likely(PyInt_Check(x))) { if (sizeof(long) < sizeof(long)) { __PYX_VERIFY_RETURN_INT(long, long, PyInt_AS_LONG(x)) } else { long val = PyInt_AS_LONG(x); if (is_unsigned && unlikely(val < 0)) { goto raise_neg_overflow; } return (long) val; } } else #endif if (likely(PyLong_Check(x))) { if (is_unsigned) { #if CYTHON_USE_PYLONG_INTERNALS const digit* digits = ((PyLongObject*)x)->ob_digit; switch (Py_SIZE(x)) { case 0: return (long) 0; case 1: __PYX_VERIFY_RETURN_INT(long, digit, digits[0]) case 2: if (8 * sizeof(long) > 1 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(long) >= 2 * PyLong_SHIFT) { return (long) (((((long)digits[1]) << PyLong_SHIFT) | (long)digits[0])); } } break; case 3: if (8 * sizeof(long) > 2 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(long) >= 3 * PyLong_SHIFT) { return (long) (((((((long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0])); } } break; case 4: if (8 * sizeof(long) > 3 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(long) >= 4 * PyLong_SHIFT) { return (long) (((((((((long)digits[3]) << PyLong_SHIFT) | (long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0])); } } break; } #endif #if CYTHON_COMPILING_IN_CPYTHON if (unlikely(Py_SIZE(x) < 0)) { goto raise_neg_overflow; } #else { int result = PyObject_RichCompareBool(x, Py_False, Py_LT); if (unlikely(result < 0)) return (long) -1; if (unlikely(result == 1)) goto raise_neg_overflow; } #endif if (sizeof(long) <= sizeof(unsigned long)) { __PYX_VERIFY_RETURN_INT_EXC(long, unsigned long, PyLong_AsUnsignedLong(x)) } else if (sizeof(long) <= sizeof(unsigned PY_LONG_LONG)) { __PYX_VERIFY_RETURN_INT_EXC(long, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x)) } } else { #if CYTHON_USE_PYLONG_INTERNALS const digit* digits = ((PyLongObject*)x)->ob_digit; switch (Py_SIZE(x)) { case 0: return (long) 0; case -1: __PYX_VERIFY_RETURN_INT(long, sdigit, -(sdigit) digits[0]) case 1: __PYX_VERIFY_RETURN_INT(long, digit, +digits[0]) case -2: if (8 * sizeof(long) - 1 > 1 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(long, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) { return (long) (((long)-1)*(((((long)digits[1]) << PyLong_SHIFT) | (long)digits[0]))); } } break; case 2: if (8 * sizeof(long) > 1 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) { return (long) ((((((long)digits[1]) << PyLong_SHIFT) | (long)digits[0]))); } } break; case -3: if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(long, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) { return (long) (((long)-1)*(((((((long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0]))); } } break; case 3: if (8 * sizeof(long) > 2 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) { return (long) ((((((((long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0]))); } } break; case -4: if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(long, long, -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(long) - 1 > 4 * PyLong_SHIFT) { return (long) (((long)-1)*(((((((((long)digits[3]) << PyLong_SHIFT) | (long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0]))); } } break; case 4: if (8 * sizeof(long) > 3 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(long) - 1 > 4 * PyLong_SHIFT) { return (long) ((((((((((long)digits[3]) << PyLong_SHIFT) | (long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0]))); } } break; } #endif if (sizeof(long) <= sizeof(long)) { __PYX_VERIFY_RETURN_INT_EXC(long, long, PyLong_AsLong(x)) } else if (sizeof(long) <= sizeof(PY_LONG_LONG)) { __PYX_VERIFY_RETURN_INT_EXC(long, PY_LONG_LONG, PyLong_AsLongLong(x)) } } { #if CYTHON_COMPILING_IN_PYPY && !defined(_PyLong_AsByteArray) PyErr_SetString(PyExc_RuntimeError, "_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers"); #else long val; PyObject *v = __Pyx_PyNumber_Int(x); #if PY_MAJOR_VERSION < 3 if (likely(v) && !PyLong_Check(v)) { PyObject *tmp = v; v = PyNumber_Long(tmp); Py_DECREF(tmp); } #endif if (likely(v)) { int one = 1; int is_little = (int)*(unsigned char *)&one; unsigned char *bytes = (unsigned char *)&val; int ret = _PyLong_AsByteArray((PyLongObject *)v, bytes, sizeof(val), is_little, !is_unsigned); Py_DECREF(v); if (likely(!ret)) return val; } #endif return (long) -1; } } else { long val; PyObject *tmp = __Pyx_PyNumber_Int(x); if (!tmp) return (long) -1; val = __Pyx_PyInt_As_long(tmp); Py_DECREF(tmp); return val; } raise_overflow: PyErr_SetString(PyExc_OverflowError, "value too large to convert to long"); return (long) -1; raise_neg_overflow: PyErr_SetString(PyExc_OverflowError, "can't convert negative value to long"); return (long) -1; } static CYTHON_INLINE int __Pyx_PyInt_As_int(PyObject *x) { const int neg_one = (int) -1, const_zero = (int) 0; const int is_unsigned = neg_one > const_zero; #if PY_MAJOR_VERSION < 3 if (likely(PyInt_Check(x))) { if (sizeof(int) < sizeof(long)) { __PYX_VERIFY_RETURN_INT(int, long, PyInt_AS_LONG(x)) } else { long val = PyInt_AS_LONG(x); if (is_unsigned && unlikely(val < 0)) { goto raise_neg_overflow; } return (int) val; } } else #endif if (likely(PyLong_Check(x))) { if (is_unsigned) { #if CYTHON_USE_PYLONG_INTERNALS const digit* digits = ((PyLongObject*)x)->ob_digit; switch (Py_SIZE(x)) { case 0: return (int) 0; case 1: __PYX_VERIFY_RETURN_INT(int, digit, digits[0]) case 2: if (8 * sizeof(int) > 1 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(int) >= 2 * PyLong_SHIFT) { return (int) (((((int)digits[1]) << PyLong_SHIFT) | (int)digits[0])); } } break; case 3: if (8 * sizeof(int) > 2 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(int) >= 3 * PyLong_SHIFT) { return (int) (((((((int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0])); } } break; case 4: if (8 * sizeof(int) > 3 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(int) >= 4 * PyLong_SHIFT) { return (int) (((((((((int)digits[3]) << PyLong_SHIFT) | (int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0])); } } break; } #endif #if CYTHON_COMPILING_IN_CPYTHON if (unlikely(Py_SIZE(x) < 0)) { goto raise_neg_overflow; } #else { int result = PyObject_RichCompareBool(x, Py_False, Py_LT); if (unlikely(result < 0)) return (int) -1; if (unlikely(result == 1)) goto raise_neg_overflow; } #endif if (sizeof(int) <= sizeof(unsigned long)) { __PYX_VERIFY_RETURN_INT_EXC(int, unsigned long, PyLong_AsUnsignedLong(x)) } else if (sizeof(int) <= sizeof(unsigned PY_LONG_LONG)) { __PYX_VERIFY_RETURN_INT_EXC(int, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x)) } } else { #if CYTHON_USE_PYLONG_INTERNALS const digit* digits = ((PyLongObject*)x)->ob_digit; switch (Py_SIZE(x)) { case 0: return (int) 0; case -1: __PYX_VERIFY_RETURN_INT(int, sdigit, -(sdigit) digits[0]) case 1: __PYX_VERIFY_RETURN_INT(int, digit, +digits[0]) case -2: if (8 * sizeof(int) - 1 > 1 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(int, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(int) - 1 > 2 * PyLong_SHIFT) { return (int) (((int)-1)*(((((int)digits[1]) << PyLong_SHIFT) | (int)digits[0]))); } } break; case 2: if (8 * sizeof(int) > 1 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(int) - 1 > 2 * PyLong_SHIFT) { return (int) ((((((int)digits[1]) << PyLong_SHIFT) | (int)digits[0]))); } } break; case -3: if (8 * sizeof(int) - 1 > 2 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(int, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(int) - 1 > 3 * PyLong_SHIFT) { return (int) (((int)-1)*(((((((int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0]))); } } break; case 3: if (8 * sizeof(int) > 2 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(int) - 1 > 3 * PyLong_SHIFT) { return (int) ((((((((int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0]))); } } break; case -4: if (8 * sizeof(int) - 1 > 3 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(int, long, -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(int) - 1 > 4 * PyLong_SHIFT) { return (int) (((int)-1)*(((((((((int)digits[3]) << PyLong_SHIFT) | (int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0]))); } } break; case 4: if (8 * sizeof(int) > 3 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(int) - 1 > 4 * PyLong_SHIFT) { return (int) ((((((((((int)digits[3]) << PyLong_SHIFT) | (int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0]))); } } break; } #endif if (sizeof(int) <= sizeof(long)) { __PYX_VERIFY_RETURN_INT_EXC(int, long, PyLong_AsLong(x)) } else if (sizeof(int) <= sizeof(PY_LONG_LONG)) { __PYX_VERIFY_RETURN_INT_EXC(int, PY_LONG_LONG, PyLong_AsLongLong(x)) } } { #if CYTHON_COMPILING_IN_PYPY && !defined(_PyLong_AsByteArray) PyErr_SetString(PyExc_RuntimeError, "_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers"); #else int val; PyObject *v = __Pyx_PyNumber_Int(x); #if PY_MAJOR_VERSION < 3 if (likely(v) && !PyLong_Check(v)) { PyObject *tmp = v; v = PyNumber_Long(tmp); Py_DECREF(tmp); } #endif if (likely(v)) { int one = 1; int is_little = (int)*(unsigned char *)&one; unsigned char *bytes = (unsigned char *)&val; int ret = _PyLong_AsByteArray((PyLongObject *)v, bytes, sizeof(val), is_little, !is_unsigned); Py_DECREF(v); if (likely(!ret)) return val; } #endif return (int) -1; } } else { int val; PyObject *tmp = __Pyx_PyNumber_Int(x); if (!tmp) return (int) -1; val = __Pyx_PyInt_As_int(tmp); Py_DECREF(tmp); return val; } raise_overflow: PyErr_SetString(PyExc_OverflowError, "value too large to convert to int"); return (int) -1; raise_neg_overflow: PyErr_SetString(PyExc_OverflowError, "can't convert negative value to int"); return (int) -1; } static int __Pyx_check_binary_version(void) { char ctversion[4], rtversion[4]; PyOS_snprintf(ctversion, 4, "%d.%d", PY_MAJOR_VERSION, PY_MINOR_VERSION); PyOS_snprintf(rtversion, 4, "%s", Py_GetVersion()); if (ctversion[0] != rtversion[0] || ctversion[2] != rtversion[2]) { char message[200]; PyOS_snprintf(message, sizeof(message), "compiletime version %s of module '%.100s' " "does not match runtime version %s", ctversion, __Pyx_MODULE_NAME, rtversion); return PyErr_WarnEx(NULL, message, 1); } return 0; } static int __Pyx_InitStrings(__Pyx_StringTabEntry *t) { while (t->p) { #if PY_MAJOR_VERSION < 3 if (t->is_unicode) { *t->p = PyUnicode_DecodeUTF8(t->s, t->n - 1, NULL); } else if (t->intern) { *t->p = PyString_InternFromString(t->s); } else { *t->p = PyString_FromStringAndSize(t->s, t->n - 1); } #else if (t->is_unicode | t->is_str) { if (t->intern) { *t->p = PyUnicode_InternFromString(t->s); } else if (t->encoding) { *t->p = PyUnicode_Decode(t->s, t->n - 1, t->encoding, NULL); } else { *t->p = PyUnicode_FromStringAndSize(t->s, t->n - 1); } } else { *t->p = PyBytes_FromStringAndSize(t->s, t->n - 1); } #endif if (!*t->p) return -1; ++t; } return 0; } static CYTHON_INLINE PyObject* __Pyx_PyUnicode_FromString(const char* c_str) { return __Pyx_PyUnicode_FromStringAndSize(c_str, (Py_ssize_t)strlen(c_str)); } static CYTHON_INLINE char* __Pyx_PyObject_AsString(PyObject* o) { Py_ssize_t ignore; return __Pyx_PyObject_AsStringAndSize(o, &ignore); } static CYTHON_INLINE char* __Pyx_PyObject_AsStringAndSize(PyObject* o, Py_ssize_t *length) { #if CYTHON_COMPILING_IN_CPYTHON && (__PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT) if ( #if PY_MAJOR_VERSION < 3 && __PYX_DEFAULT_STRING_ENCODING_IS_ASCII __Pyx_sys_getdefaultencoding_not_ascii && #endif PyUnicode_Check(o)) { #if PY_VERSION_HEX < 0x03030000 char* defenc_c; PyObject* defenc = _PyUnicode_AsDefaultEncodedString(o, NULL); if (!defenc) return NULL; defenc_c = PyBytes_AS_STRING(defenc); #if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII { char* end = defenc_c + PyBytes_GET_SIZE(defenc); char* c; for (c = defenc_c; c < end; c++) { if ((unsigned char) (*c) >= 128) { PyUnicode_AsASCIIString(o); return NULL; } } } #endif *length = PyBytes_GET_SIZE(defenc); return defenc_c; #else if (__Pyx_PyUnicode_READY(o) == -1) return NULL; #if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII if (PyUnicode_IS_ASCII(o)) { *length = PyUnicode_GET_LENGTH(o); return PyUnicode_AsUTF8(o); } else { PyUnicode_AsASCIIString(o); return NULL; } #else return PyUnicode_AsUTF8AndSize(o, length); #endif #endif } else #endif #if (!CYTHON_COMPILING_IN_PYPY) || (defined(PyByteArray_AS_STRING) && defined(PyByteArray_GET_SIZE)) if (PyByteArray_Check(o)) { *length = PyByteArray_GET_SIZE(o); return PyByteArray_AS_STRING(o); } else #endif { char* result; int r = PyBytes_AsStringAndSize(o, &result, length); if (unlikely(r < 0)) { return NULL; } else { return result; } } } static CYTHON_INLINE int __Pyx_PyObject_IsTrue(PyObject* x) { int is_true = x == Py_True; if (is_true | (x == Py_False) | (x == Py_None)) return is_true; else return PyObject_IsTrue(x); } static CYTHON_INLINE PyObject* __Pyx_PyNumber_Int(PyObject* x) { PyNumberMethods *m; const char *name = NULL; PyObject *res = NULL; #if PY_MAJOR_VERSION < 3 if (PyInt_Check(x) || PyLong_Check(x)) #else if (PyLong_Check(x)) #endif return __Pyx_NewRef(x); m = Py_TYPE(x)->tp_as_number; #if PY_MAJOR_VERSION < 3 if (m && m->nb_int) { name = "int"; res = PyNumber_Int(x); } else if (m && m->nb_long) { name = "long"; res = PyNumber_Long(x); } #else if (m && m->nb_int) { name = "int"; res = PyNumber_Long(x); } #endif if (res) { #if PY_MAJOR_VERSION < 3 if (!PyInt_Check(res) && !PyLong_Check(res)) { #else if (!PyLong_Check(res)) { #endif PyErr_Format(PyExc_TypeError, "__%.4s__ returned non-%.4s (type %.200s)", name, name, Py_TYPE(res)->tp_name); Py_DECREF(res); return NULL; } } else if (!PyErr_Occurred()) { PyErr_SetString(PyExc_TypeError, "an integer is required"); } return res; } static CYTHON_INLINE Py_ssize_t __Pyx_PyIndex_AsSsize_t(PyObject* b) { Py_ssize_t ival; PyObject *x; #if PY_MAJOR_VERSION < 3 if (likely(PyInt_CheckExact(b))) { if (sizeof(Py_ssize_t) >= sizeof(long)) return PyInt_AS_LONG(b); else return PyInt_AsSsize_t(x); } #endif if (likely(PyLong_CheckExact(b))) { #if CYTHON_USE_PYLONG_INTERNALS const digit* digits = ((PyLongObject*)b)->ob_digit; const Py_ssize_t size = Py_SIZE(b); if (likely(__Pyx_sst_abs(size) <= 1)) { ival = likely(size) ? digits[0] : 0; if (size == -1) ival = -ival; return ival; } else { switch (size) { case 2: if (8 * sizeof(Py_ssize_t) > 2 * PyLong_SHIFT) { return (Py_ssize_t) (((((size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])); } break; case -2: if (8 * sizeof(Py_ssize_t) > 2 * PyLong_SHIFT) { return -(Py_ssize_t) (((((size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])); } break; case 3: if (8 * sizeof(Py_ssize_t) > 3 * PyLong_SHIFT) { return (Py_ssize_t) (((((((size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])); } break; case -3: if (8 * sizeof(Py_ssize_t) > 3 * PyLong_SHIFT) { return -(Py_ssize_t) (((((((size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])); } break; case 4: if (8 * sizeof(Py_ssize_t) > 4 * PyLong_SHIFT) { return (Py_ssize_t) (((((((((size_t)digits[3]) << PyLong_SHIFT) | (size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])); } break; case -4: if (8 * sizeof(Py_ssize_t) > 4 * PyLong_SHIFT) { return -(Py_ssize_t) (((((((((size_t)digits[3]) << PyLong_SHIFT) | (size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])); } break; } } #endif return PyLong_AsSsize_t(b); } x = PyNumber_Index(b); if (!x) return -1; ival = PyInt_AsSsize_t(x); Py_DECREF(x); return ival; } static CYTHON_INLINE PyObject * __Pyx_PyInt_FromSize_t(size_t ival) { return PyInt_FromSize_t(ival); } #endif /* Py_PYTHON_H */ pygame_sdl2-2.1.0-for-renpy-6.99.14.1/gen3/pygame_sdl2.controller.c0000664000175000017500000067245012665223535023665 0ustar tomtom00000000000000/* Generated by Cython 0.23.3 */ #define PY_SSIZE_T_CLEAN #include "Python.h" #ifndef Py_PYTHON_H #error Python headers needed to compile C extensions, please install development version of Python. #elif PY_VERSION_HEX < 0x02060000 || (0x03000000 <= PY_VERSION_HEX && PY_VERSION_HEX < 0x03020000) #error Cython requires Python 2.6+ or Python 3.2+. #else #define CYTHON_ABI "0_23_3" #include #ifndef offsetof #define offsetof(type, member) ( (size_t) & ((type*)0) -> member ) #endif #if !defined(WIN32) && !defined(MS_WINDOWS) #ifndef __stdcall #define __stdcall #endif #ifndef __cdecl #define __cdecl #endif #ifndef __fastcall #define __fastcall #endif #endif #ifndef DL_IMPORT #define DL_IMPORT(t) t #endif #ifndef DL_EXPORT #define DL_EXPORT(t) t #endif #ifndef PY_LONG_LONG #define PY_LONG_LONG LONG_LONG #endif #ifndef Py_HUGE_VAL #define Py_HUGE_VAL HUGE_VAL #endif #ifdef PYPY_VERSION #define CYTHON_COMPILING_IN_PYPY 1 #define CYTHON_COMPILING_IN_CPYTHON 0 #else #define CYTHON_COMPILING_IN_PYPY 0 #define CYTHON_COMPILING_IN_CPYTHON 1 #endif #if !defined(CYTHON_USE_PYLONG_INTERNALS) && CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x02070000 #define CYTHON_USE_PYLONG_INTERNALS 1 #endif #if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX < 0x02070600 && !defined(Py_OptimizeFlag) #define Py_OptimizeFlag 0 #endif #define __PYX_BUILD_PY_SSIZE_T "n" #define CYTHON_FORMAT_SSIZE_T "z" #if PY_MAJOR_VERSION < 3 #define __Pyx_BUILTIN_MODULE_NAME "__builtin__" #define __Pyx_PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)\ PyCode_New(a+k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos) #define __Pyx_DefaultClassType PyClass_Type #else #define __Pyx_BUILTIN_MODULE_NAME "builtins" #define __Pyx_PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)\ PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos) #define __Pyx_DefaultClassType PyType_Type #endif #ifndef Py_TPFLAGS_CHECKTYPES #define Py_TPFLAGS_CHECKTYPES 0 #endif #ifndef Py_TPFLAGS_HAVE_INDEX #define Py_TPFLAGS_HAVE_INDEX 0 #endif #ifndef Py_TPFLAGS_HAVE_NEWBUFFER #define Py_TPFLAGS_HAVE_NEWBUFFER 0 #endif #ifndef Py_TPFLAGS_HAVE_FINALIZE #define Py_TPFLAGS_HAVE_FINALIZE 0 #endif #if PY_VERSION_HEX > 0x03030000 && defined(PyUnicode_KIND) #define CYTHON_PEP393_ENABLED 1 #define __Pyx_PyUnicode_READY(op) (likely(PyUnicode_IS_READY(op)) ?\ 0 : _PyUnicode_Ready((PyObject *)(op))) #define __Pyx_PyUnicode_GET_LENGTH(u) PyUnicode_GET_LENGTH(u) #define __Pyx_PyUnicode_READ_CHAR(u, i) PyUnicode_READ_CHAR(u, i) #define __Pyx_PyUnicode_KIND(u) PyUnicode_KIND(u) #define __Pyx_PyUnicode_DATA(u) PyUnicode_DATA(u) #define __Pyx_PyUnicode_READ(k, d, i) PyUnicode_READ(k, d, i) #else #define CYTHON_PEP393_ENABLED 0 #define __Pyx_PyUnicode_READY(op) (0) #define __Pyx_PyUnicode_GET_LENGTH(u) PyUnicode_GET_SIZE(u) #define __Pyx_PyUnicode_READ_CHAR(u, i) ((Py_UCS4)(PyUnicode_AS_UNICODE(u)[i])) #define __Pyx_PyUnicode_KIND(u) (sizeof(Py_UNICODE)) #define __Pyx_PyUnicode_DATA(u) ((void*)PyUnicode_AS_UNICODE(u)) #define __Pyx_PyUnicode_READ(k, d, i) ((void)(k), (Py_UCS4)(((Py_UNICODE*)d)[i])) #endif #if CYTHON_COMPILING_IN_PYPY #define __Pyx_PyUnicode_Concat(a, b) PyNumber_Add(a, b) #define __Pyx_PyUnicode_ConcatSafe(a, b) PyNumber_Add(a, b) #else #define __Pyx_PyUnicode_Concat(a, b) PyUnicode_Concat(a, b) #define __Pyx_PyUnicode_ConcatSafe(a, b) ((unlikely((a) == Py_None) || unlikely((b) == Py_None)) ?\ PyNumber_Add(a, b) : __Pyx_PyUnicode_Concat(a, b)) #endif #if CYTHON_COMPILING_IN_PYPY && !defined(PyUnicode_Contains) #define PyUnicode_Contains(u, s) PySequence_Contains(u, s) #endif #define __Pyx_PyString_FormatSafe(a, b) ((unlikely((a) == Py_None)) ? PyNumber_Remainder(a, b) : __Pyx_PyString_Format(a, b)) #define __Pyx_PyUnicode_FormatSafe(a, b) ((unlikely((a) == Py_None)) ? PyNumber_Remainder(a, b) : PyUnicode_Format(a, b)) #if PY_MAJOR_VERSION >= 3 #define __Pyx_PyString_Format(a, b) PyUnicode_Format(a, b) #else #define __Pyx_PyString_Format(a, b) PyString_Format(a, b) #endif #if PY_MAJOR_VERSION >= 3 #define PyBaseString_Type PyUnicode_Type #define PyStringObject PyUnicodeObject #define PyString_Type PyUnicode_Type #define PyString_Check PyUnicode_Check #define PyString_CheckExact PyUnicode_CheckExact #endif #if PY_MAJOR_VERSION >= 3 #define __Pyx_PyBaseString_Check(obj) PyUnicode_Check(obj) #define __Pyx_PyBaseString_CheckExact(obj) PyUnicode_CheckExact(obj) #else #define __Pyx_PyBaseString_Check(obj) (PyString_Check(obj) || PyUnicode_Check(obj)) #define __Pyx_PyBaseString_CheckExact(obj) (PyString_CheckExact(obj) || PyUnicode_CheckExact(obj)) #endif #ifndef PySet_CheckExact #define PySet_CheckExact(obj) (Py_TYPE(obj) == &PySet_Type) #endif #define __Pyx_TypeCheck(obj, type) PyObject_TypeCheck(obj, (PyTypeObject *)type) #if PY_MAJOR_VERSION >= 3 #define PyIntObject PyLongObject #define PyInt_Type PyLong_Type #define PyInt_Check(op) PyLong_Check(op) #define PyInt_CheckExact(op) PyLong_CheckExact(op) #define PyInt_FromString PyLong_FromString #define PyInt_FromUnicode PyLong_FromUnicode #define PyInt_FromLong PyLong_FromLong #define PyInt_FromSize_t PyLong_FromSize_t #define PyInt_FromSsize_t PyLong_FromSsize_t #define PyInt_AsLong PyLong_AsLong #define PyInt_AS_LONG PyLong_AS_LONG #define PyInt_AsSsize_t PyLong_AsSsize_t #define PyInt_AsUnsignedLongMask PyLong_AsUnsignedLongMask #define PyInt_AsUnsignedLongLongMask PyLong_AsUnsignedLongLongMask #define PyNumber_Int PyNumber_Long #endif #if PY_MAJOR_VERSION >= 3 #define PyBoolObject PyLongObject #endif #if PY_MAJOR_VERSION >= 3 && CYTHON_COMPILING_IN_PYPY #ifndef PyUnicode_InternFromString #define PyUnicode_InternFromString(s) PyUnicode_FromString(s) #endif #endif #if PY_VERSION_HEX < 0x030200A4 typedef long Py_hash_t; #define __Pyx_PyInt_FromHash_t PyInt_FromLong #define __Pyx_PyInt_AsHash_t PyInt_AsLong #else #define __Pyx_PyInt_FromHash_t PyInt_FromSsize_t #define __Pyx_PyInt_AsHash_t PyInt_AsSsize_t #endif #if PY_MAJOR_VERSION >= 3 #define __Pyx_PyMethod_New(func, self, klass) ((self) ? PyMethod_New(func, self) : PyInstanceMethod_New(func)) #else #define __Pyx_PyMethod_New(func, self, klass) PyMethod_New(func, self, klass) #endif #if PY_VERSION_HEX >= 0x030500B1 #define __Pyx_PyAsyncMethodsStruct PyAsyncMethods #define __Pyx_PyType_AsAsync(obj) (Py_TYPE(obj)->tp_as_async) #elif CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3 typedef struct { unaryfunc am_await; unaryfunc am_aiter; unaryfunc am_anext; } __Pyx_PyAsyncMethodsStruct; #define __Pyx_PyType_AsAsync(obj) ((__Pyx_PyAsyncMethodsStruct*) (Py_TYPE(obj)->tp_reserved)) #else #define __Pyx_PyType_AsAsync(obj) NULL #endif #ifndef CYTHON_RESTRICT #if defined(__GNUC__) #define CYTHON_RESTRICT __restrict__ #elif defined(_MSC_VER) && _MSC_VER >= 1400 #define CYTHON_RESTRICT __restrict #elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L #define CYTHON_RESTRICT restrict #else #define CYTHON_RESTRICT #endif #endif #define __Pyx_void_to_None(void_result) (void_result, Py_INCREF(Py_None), Py_None) #ifndef CYTHON_INLINE #if defined(__GNUC__) #define CYTHON_INLINE __inline__ #elif defined(_MSC_VER) #define CYTHON_INLINE __inline #elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L #define CYTHON_INLINE inline #else #define CYTHON_INLINE #endif #endif #if defined(WIN32) || defined(MS_WINDOWS) #define _USE_MATH_DEFINES #endif #include #ifdef NAN #define __PYX_NAN() ((float) NAN) #else static CYTHON_INLINE float __PYX_NAN() { float value; memset(&value, 0xFF, sizeof(value)); return value; } #endif #if PY_MAJOR_VERSION >= 3 #define __Pyx_PyNumber_Divide(x,y) PyNumber_TrueDivide(x,y) #define __Pyx_PyNumber_InPlaceDivide(x,y) PyNumber_InPlaceTrueDivide(x,y) #else #define __Pyx_PyNumber_Divide(x,y) PyNumber_TrueDivide(x,y) #define __Pyx_PyNumber_InPlaceDivide(x,y) PyNumber_InPlaceTrueDivide(x,y) #endif #ifndef __PYX_EXTERN_C #ifdef __cplusplus #define __PYX_EXTERN_C extern "C" #else #define __PYX_EXTERN_C extern #endif #endif #define __PYX_HAVE__pygame_sdl2__controller #define __PYX_HAVE_API__pygame_sdl2__controller #include "stdint.h" #include "string.h" #include "stdio.h" #include "stddef.h" #include "SDL.h" #ifdef _OPENMP #include #endif /* _OPENMP */ #ifdef PYREX_WITHOUT_ASSERTIONS #define CYTHON_WITHOUT_ASSERTIONS #endif #ifndef CYTHON_UNUSED # if defined(__GNUC__) # if !(defined(__cplusplus)) || (__GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 4)) # define CYTHON_UNUSED __attribute__ ((__unused__)) # else # define CYTHON_UNUSED # endif # elif defined(__ICC) || (defined(__INTEL_COMPILER) && !defined(_MSC_VER)) # define CYTHON_UNUSED __attribute__ ((__unused__)) # else # define CYTHON_UNUSED # endif #endif #ifndef CYTHON_NCP_UNUSED # if CYTHON_COMPILING_IN_CPYTHON # define CYTHON_NCP_UNUSED # else # define CYTHON_NCP_UNUSED CYTHON_UNUSED # endif #endif typedef struct {PyObject **p; char *s; const Py_ssize_t n; const char* encoding; const char is_unicode; const char is_str; const char intern; } __Pyx_StringTabEntry; #define __PYX_DEFAULT_STRING_ENCODING_IS_ASCII 0 #define __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT 0 #define __PYX_DEFAULT_STRING_ENCODING "" #define __Pyx_PyObject_FromString __Pyx_PyBytes_FromString #define __Pyx_PyObject_FromStringAndSize __Pyx_PyBytes_FromStringAndSize #define __Pyx_uchar_cast(c) ((unsigned char)c) #define __Pyx_long_cast(x) ((long)x) #define __Pyx_fits_Py_ssize_t(v, type, is_signed) (\ (sizeof(type) < sizeof(Py_ssize_t)) ||\ (sizeof(type) > sizeof(Py_ssize_t) &&\ likely(v < (type)PY_SSIZE_T_MAX ||\ v == (type)PY_SSIZE_T_MAX) &&\ (!is_signed || likely(v > (type)PY_SSIZE_T_MIN ||\ v == (type)PY_SSIZE_T_MIN))) ||\ (sizeof(type) == sizeof(Py_ssize_t) &&\ (is_signed || likely(v < (type)PY_SSIZE_T_MAX ||\ v == (type)PY_SSIZE_T_MAX))) ) #if defined (__cplusplus) && __cplusplus >= 201103L #include #define __Pyx_sst_abs(value) std::abs(value) #elif SIZEOF_INT >= SIZEOF_SIZE_T #define __Pyx_sst_abs(value) abs(value) #elif SIZEOF_LONG >= SIZEOF_SIZE_T #define __Pyx_sst_abs(value) labs(value) #elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L #define __Pyx_sst_abs(value) llabs(value) #elif defined (_MSC_VER) && defined (_M_X64) #define __Pyx_sst_abs(value) _abs64(value) #elif defined (__GNUC__) #define __Pyx_sst_abs(value) __builtin_llabs(value) #else #define __Pyx_sst_abs(value) ((value<0) ? -value : value) #endif static CYTHON_INLINE char* __Pyx_PyObject_AsString(PyObject*); static CYTHON_INLINE char* __Pyx_PyObject_AsStringAndSize(PyObject*, Py_ssize_t* length); #define __Pyx_PyByteArray_FromString(s) PyByteArray_FromStringAndSize((const char*)s, strlen((const char*)s)) #define __Pyx_PyByteArray_FromStringAndSize(s, l) PyByteArray_FromStringAndSize((const char*)s, l) #define __Pyx_PyBytes_FromString PyBytes_FromString #define __Pyx_PyBytes_FromStringAndSize PyBytes_FromStringAndSize static CYTHON_INLINE PyObject* __Pyx_PyUnicode_FromString(const char*); #if PY_MAJOR_VERSION < 3 #define __Pyx_PyStr_FromString __Pyx_PyBytes_FromString #define __Pyx_PyStr_FromStringAndSize __Pyx_PyBytes_FromStringAndSize #else #define __Pyx_PyStr_FromString __Pyx_PyUnicode_FromString #define __Pyx_PyStr_FromStringAndSize __Pyx_PyUnicode_FromStringAndSize #endif #define __Pyx_PyObject_AsSString(s) ((signed char*) __Pyx_PyObject_AsString(s)) #define __Pyx_PyObject_AsUString(s) ((unsigned char*) __Pyx_PyObject_AsString(s)) #define __Pyx_PyObject_FromCString(s) __Pyx_PyObject_FromString((const char*)s) #define __Pyx_PyBytes_FromCString(s) __Pyx_PyBytes_FromString((const char*)s) #define __Pyx_PyByteArray_FromCString(s) __Pyx_PyByteArray_FromString((const char*)s) #define __Pyx_PyStr_FromCString(s) __Pyx_PyStr_FromString((const char*)s) #define __Pyx_PyUnicode_FromCString(s) __Pyx_PyUnicode_FromString((const char*)s) #if PY_MAJOR_VERSION < 3 static CYTHON_INLINE size_t __Pyx_Py_UNICODE_strlen(const Py_UNICODE *u) { const Py_UNICODE *u_end = u; while (*u_end++) ; return (size_t)(u_end - u - 1); } #else #define __Pyx_Py_UNICODE_strlen Py_UNICODE_strlen #endif #define __Pyx_PyUnicode_FromUnicode(u) PyUnicode_FromUnicode(u, __Pyx_Py_UNICODE_strlen(u)) #define __Pyx_PyUnicode_FromUnicodeAndLength PyUnicode_FromUnicode #define __Pyx_PyUnicode_AsUnicode PyUnicode_AsUnicode #define __Pyx_NewRef(obj) (Py_INCREF(obj), obj) #define __Pyx_Owned_Py_None(b) __Pyx_NewRef(Py_None) #define __Pyx_PyBool_FromLong(b) ((b) ? __Pyx_NewRef(Py_True) : __Pyx_NewRef(Py_False)) static CYTHON_INLINE int __Pyx_PyObject_IsTrue(PyObject*); static CYTHON_INLINE PyObject* __Pyx_PyNumber_Int(PyObject* x); static CYTHON_INLINE Py_ssize_t __Pyx_PyIndex_AsSsize_t(PyObject*); static CYTHON_INLINE PyObject * __Pyx_PyInt_FromSize_t(size_t); #if CYTHON_COMPILING_IN_CPYTHON #define __pyx_PyFloat_AsDouble(x) (PyFloat_CheckExact(x) ? PyFloat_AS_DOUBLE(x) : PyFloat_AsDouble(x)) #else #define __pyx_PyFloat_AsDouble(x) PyFloat_AsDouble(x) #endif #define __pyx_PyFloat_AsFloat(x) ((float) __pyx_PyFloat_AsDouble(x)) #if PY_MAJOR_VERSION < 3 && __PYX_DEFAULT_STRING_ENCODING_IS_ASCII static int __Pyx_sys_getdefaultencoding_not_ascii; static int __Pyx_init_sys_getdefaultencoding_params(void) { PyObject* sys; PyObject* default_encoding = NULL; PyObject* ascii_chars_u = NULL; PyObject* ascii_chars_b = NULL; const char* default_encoding_c; sys = PyImport_ImportModule("sys"); if (!sys) goto bad; default_encoding = PyObject_CallMethod(sys, (char*) "getdefaultencoding", NULL); Py_DECREF(sys); if (!default_encoding) goto bad; default_encoding_c = PyBytes_AsString(default_encoding); if (!default_encoding_c) goto bad; if (strcmp(default_encoding_c, "ascii") == 0) { __Pyx_sys_getdefaultencoding_not_ascii = 0; } else { char ascii_chars[128]; int c; for (c = 0; c < 128; c++) { ascii_chars[c] = c; } __Pyx_sys_getdefaultencoding_not_ascii = 1; ascii_chars_u = PyUnicode_DecodeASCII(ascii_chars, 128, NULL); if (!ascii_chars_u) goto bad; ascii_chars_b = PyUnicode_AsEncodedString(ascii_chars_u, default_encoding_c, NULL); if (!ascii_chars_b || !PyBytes_Check(ascii_chars_b) || memcmp(ascii_chars, PyBytes_AS_STRING(ascii_chars_b), 128) != 0) { PyErr_Format( PyExc_ValueError, "This module compiled with c_string_encoding=ascii, but default encoding '%.200s' is not a superset of ascii.", default_encoding_c); goto bad; } Py_DECREF(ascii_chars_u); Py_DECREF(ascii_chars_b); } Py_DECREF(default_encoding); return 0; bad: Py_XDECREF(default_encoding); Py_XDECREF(ascii_chars_u); Py_XDECREF(ascii_chars_b); return -1; } #endif #if __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT && PY_MAJOR_VERSION >= 3 #define __Pyx_PyUnicode_FromStringAndSize(c_str, size) PyUnicode_DecodeUTF8(c_str, size, NULL) #else #define __Pyx_PyUnicode_FromStringAndSize(c_str, size) PyUnicode_Decode(c_str, size, __PYX_DEFAULT_STRING_ENCODING, NULL) #if __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT static char* __PYX_DEFAULT_STRING_ENCODING; static int __Pyx_init_sys_getdefaultencoding_params(void) { PyObject* sys; PyObject* default_encoding = NULL; char* default_encoding_c; sys = PyImport_ImportModule("sys"); if (!sys) goto bad; default_encoding = PyObject_CallMethod(sys, (char*) (const char*) "getdefaultencoding", NULL); Py_DECREF(sys); if (!default_encoding) goto bad; default_encoding_c = PyBytes_AsString(default_encoding); if (!default_encoding_c) goto bad; __PYX_DEFAULT_STRING_ENCODING = (char*) malloc(strlen(default_encoding_c)); if (!__PYX_DEFAULT_STRING_ENCODING) goto bad; strcpy(__PYX_DEFAULT_STRING_ENCODING, default_encoding_c); Py_DECREF(default_encoding); return 0; bad: Py_XDECREF(default_encoding); return -1; } #endif #endif /* Test for GCC > 2.95 */ #if defined(__GNUC__) && (__GNUC__ > 2 || (__GNUC__ == 2 && (__GNUC_MINOR__ > 95))) #define likely(x) __builtin_expect(!!(x), 1) #define unlikely(x) __builtin_expect(!!(x), 0) #else /* !__GNUC__ or GCC < 2.95 */ #define likely(x) (x) #define unlikely(x) (x) #endif /* __GNUC__ */ static PyObject *__pyx_m; static PyObject *__pyx_d; static PyObject *__pyx_b; static PyObject *__pyx_empty_tuple; static PyObject *__pyx_empty_bytes; static int __pyx_lineno; static int __pyx_clineno = 0; static const char * __pyx_cfilenm= __FILE__; static const char *__pyx_filename; static const char *__pyx_f[] = { "src/pygame_sdl2/controller.pyx", }; /*--- Type declarations ---*/ struct __pyx_obj_11pygame_sdl2_10controller_Controller; struct __pyx_opt_args_11pygame_sdl2_8rwobject_to_rwops; /* "pygame_sdl2/rwobject.pxd":21 * from sdl2 cimport SDL_RWops * * cdef SDL_RWops *to_rwops(filelike, mode=*) except NULL # <<<<<<<<<<<<<< * */ struct __pyx_opt_args_11pygame_sdl2_8rwobject_to_rwops { int __pyx_n; PyObject *mode; }; /* "pygame_sdl2/controller.pyx":134 * * * cdef class Controller: # <<<<<<<<<<<<<< * # Allow weak references. * cdef object __weakref__ */ struct __pyx_obj_11pygame_sdl2_10controller_Controller { PyObject_HEAD PyObject *__weakref__; SDL_GameController *controller; int index; }; /* --- Runtime support code (head) --- */ #ifndef CYTHON_REFNANNY #define CYTHON_REFNANNY 0 #endif #if CYTHON_REFNANNY typedef struct { void (*INCREF)(void*, PyObject*, int); void (*DECREF)(void*, PyObject*, int); void (*GOTREF)(void*, PyObject*, int); void (*GIVEREF)(void*, PyObject*, int); void* (*SetupContext)(const char*, int, const char*); void (*FinishContext)(void**); } __Pyx_RefNannyAPIStruct; static __Pyx_RefNannyAPIStruct *__Pyx_RefNanny = NULL; static __Pyx_RefNannyAPIStruct *__Pyx_RefNannyImportAPI(const char *modname); #define __Pyx_RefNannyDeclarations void *__pyx_refnanny = NULL; #ifdef WITH_THREAD #define __Pyx_RefNannySetupContext(name, acquire_gil)\ if (acquire_gil) {\ PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure();\ __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), __LINE__, __FILE__);\ PyGILState_Release(__pyx_gilstate_save);\ } else {\ __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), __LINE__, __FILE__);\ } #else #define __Pyx_RefNannySetupContext(name, acquire_gil)\ __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), __LINE__, __FILE__) #endif #define __Pyx_RefNannyFinishContext()\ __Pyx_RefNanny->FinishContext(&__pyx_refnanny) #define __Pyx_INCREF(r) __Pyx_RefNanny->INCREF(__pyx_refnanny, (PyObject *)(r), __LINE__) #define __Pyx_DECREF(r) __Pyx_RefNanny->DECREF(__pyx_refnanny, (PyObject *)(r), __LINE__) #define __Pyx_GOTREF(r) __Pyx_RefNanny->GOTREF(__pyx_refnanny, (PyObject *)(r), __LINE__) #define __Pyx_GIVEREF(r) __Pyx_RefNanny->GIVEREF(__pyx_refnanny, (PyObject *)(r), __LINE__) #define __Pyx_XINCREF(r) do { if((r) != NULL) {__Pyx_INCREF(r); }} while(0) #define __Pyx_XDECREF(r) do { if((r) != NULL) {__Pyx_DECREF(r); }} while(0) #define __Pyx_XGOTREF(r) do { if((r) != NULL) {__Pyx_GOTREF(r); }} while(0) #define __Pyx_XGIVEREF(r) do { if((r) != NULL) {__Pyx_GIVEREF(r);}} while(0) #else #define __Pyx_RefNannyDeclarations #define __Pyx_RefNannySetupContext(name, acquire_gil) #define __Pyx_RefNannyFinishContext() #define __Pyx_INCREF(r) Py_INCREF(r) #define __Pyx_DECREF(r) Py_DECREF(r) #define __Pyx_GOTREF(r) #define __Pyx_GIVEREF(r) #define __Pyx_XINCREF(r) Py_XINCREF(r) #define __Pyx_XDECREF(r) Py_XDECREF(r) #define __Pyx_XGOTREF(r) #define __Pyx_XGIVEREF(r) #endif #define __Pyx_XDECREF_SET(r, v) do {\ PyObject *tmp = (PyObject *) r;\ r = v; __Pyx_XDECREF(tmp);\ } while (0) #define __Pyx_DECREF_SET(r, v) do {\ PyObject *tmp = (PyObject *) r;\ r = v; __Pyx_DECREF(tmp);\ } while (0) #define __Pyx_CLEAR(r) do { PyObject* tmp = ((PyObject*)(r)); r = NULL; __Pyx_DECREF(tmp);} while(0) #define __Pyx_XCLEAR(r) do { if((r) != NULL) {PyObject* tmp = ((PyObject*)(r)); r = NULL; __Pyx_DECREF(tmp);}} while(0) #if CYTHON_COMPILING_IN_CPYTHON static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStr(PyObject* obj, PyObject* attr_name) { PyTypeObject* tp = Py_TYPE(obj); if (likely(tp->tp_getattro)) return tp->tp_getattro(obj, attr_name); #if PY_MAJOR_VERSION < 3 if (likely(tp->tp_getattr)) return tp->tp_getattr(obj, PyString_AS_STRING(attr_name)); #endif return PyObject_GetAttr(obj, attr_name); } #else #define __Pyx_PyObject_GetAttrStr(o,n) PyObject_GetAttr(o,n) #endif static PyObject *__Pyx_GetBuiltinName(PyObject *name); static CYTHON_INLINE PyObject *__Pyx_GetModuleGlobalName(PyObject *name); #if CYTHON_COMPILING_IN_CPYTHON static CYTHON_INLINE PyObject* __Pyx_PyObject_Call(PyObject *func, PyObject *arg, PyObject *kw); #else #define __Pyx_PyObject_Call(func, arg, kw) PyObject_Call(func, arg, kw) #endif #if CYTHON_COMPILING_IN_CPYTHON static CYTHON_INLINE PyObject* __Pyx_PyObject_CallMethO(PyObject *func, PyObject *arg); #endif static CYTHON_INLINE PyObject* __Pyx_PyObject_CallOneArg(PyObject *func, PyObject *arg); #if CYTHON_COMPILING_IN_CPYTHON static CYTHON_INLINE PyObject* __Pyx_PyObject_CallNoArg(PyObject *func); #else #define __Pyx_PyObject_CallNoArg(func) __Pyx_PyObject_Call(func, __pyx_empty_tuple, NULL) #endif static CYTHON_INLINE void __Pyx_ErrRestore(PyObject *type, PyObject *value, PyObject *tb); static CYTHON_INLINE void __Pyx_ErrFetch(PyObject **type, PyObject **value, PyObject **tb); static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, PyObject *cause); static void __Pyx_RaiseArgtupleInvalid(const char* func_name, int exact, Py_ssize_t num_min, Py_ssize_t num_max, Py_ssize_t num_found); static CYTHON_INLINE int __Pyx_CheckKeywordStrings(PyObject *kwdict, const char* function_name, int kw_allowed); static void __Pyx_RaiseDoubleKeywordsError(const char* func_name, PyObject* kw_name); static int __Pyx_ParseOptionalKeywords(PyObject *kwds, PyObject **argnames[],\ PyObject *kwds2, PyObject *values[], Py_ssize_t num_pos_args,\ const char* function_name); static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list, int level); static PyObject* __Pyx_ImportFrom(PyObject* module, PyObject* name); typedef struct { int code_line; PyCodeObject* code_object; } __Pyx_CodeObjectCacheEntry; struct __Pyx_CodeObjectCache { int count; int max_count; __Pyx_CodeObjectCacheEntry* entries; }; static struct __Pyx_CodeObjectCache __pyx_code_cache = {0,0,NULL}; static int __pyx_bisect_code_objects(__Pyx_CodeObjectCacheEntry* entries, int count, int code_line); static PyCodeObject *__pyx_find_code_object(int code_line); static void __pyx_insert_code_object(int code_line, PyCodeObject* code_object); static void __Pyx_AddTraceback(const char *funcname, int c_line, int py_line, const char *filename); static CYTHON_INLINE PyObject* __Pyx_PyInt_From_int(int value); static CYTHON_INLINE PyObject* __Pyx_PyInt_From_SDL_GameControllerAxis(SDL_GameControllerAxis value); static CYTHON_INLINE PyObject* __Pyx_PyInt_From_SDL_GameControllerButton(SDL_GameControllerButton value); static CYTHON_INLINE SDL_GameControllerAxis __Pyx_PyInt_As_SDL_GameControllerAxis(PyObject *); static CYTHON_INLINE SDL_GameControllerButton __Pyx_PyInt_As_SDL_GameControllerButton(PyObject *); static CYTHON_INLINE int __Pyx_PyInt_As_int(PyObject *); static CYTHON_INLINE PyObject* __Pyx_PyInt_From_int16_t(int16_t value); static CYTHON_INLINE PyObject* __Pyx_PyInt_From_uint8_t(uint8_t value); static CYTHON_INLINE PyObject* __Pyx_PyInt_From_SDL_bool(SDL_bool value); static CYTHON_INLINE PyObject* __Pyx_PyInt_From_long(long value); static CYTHON_INLINE long __Pyx_PyInt_As_long(PyObject *); static int __Pyx_check_binary_version(void); #if !defined(__Pyx_PyIdentifier_FromString) #if PY_MAJOR_VERSION < 3 #define __Pyx_PyIdentifier_FromString(s) PyString_FromString(s) #else #define __Pyx_PyIdentifier_FromString(s) PyUnicode_FromString(s) #endif #endif static PyObject *__Pyx_ImportModule(const char *name); static int __Pyx_ImportFunction(PyObject *module, const char *funcname, void (**f)(void), const char *sig); static int __Pyx_InitStrings(__Pyx_StringTabEntry *t); /* Module declarations from 'libc.stdint' */ /* Module declarations from 'libc.string' */ /* Module declarations from 'libc.stdio' */ /* Module declarations from 'libc.stddef' */ /* Module declarations from 'sdl2' */ /* Module declarations from 'pygame_sdl2.rwobject' */ static SDL_RWops *(*__pyx_f_11pygame_sdl2_8rwobject_to_rwops)(PyObject *, struct __pyx_opt_args_11pygame_sdl2_8rwobject_to_rwops *__pyx_optional_args); /*proto*/ /* Module declarations from 'pygame_sdl2.controller' */ static PyTypeObject *__pyx_ptype_11pygame_sdl2_10controller_Controller = 0; #define __Pyx_MODULE_NAME "pygame_sdl2.controller" int __pyx_module_is_main_pygame_sdl2__controller = 0; /* Implementation of 'pygame_sdl2.controller' */ static char __pyx_k_rv[] = "rv"; static char __pyx_k_axis[] = "axis"; static char __pyx_k_init[] = "init"; static char __pyx_k_main[] = "__main__"; static char __pyx_k_name[] = "name"; static char __pyx_k_quit[] = "quit"; static char __pyx_k_test[] = "__test__"; static char __pyx_k_error[] = "error"; static char __pyx_k_index[] = "index"; static char __pyx_k_rwops[] = "rwops"; static char __pyx_k_button[] = "button"; static char __pyx_k_import[] = "__import__"; static char __pyx_k_display[] = "display"; static char __pyx_k_mapping[] = "mapping"; static char __pyx_k_get_init[] = "get_init"; static char __pyx_k_get_count[] = "get_count"; static char __pyx_k_add_mapping[] = "add_mapping"; static char __pyx_k_pygame_sdl2[] = "pygame_sdl2"; static char __pyx_k_add_mappings[] = "add_mappings"; static char __pyx_k_mapping_file[] = "mapping_file"; static char __pyx_k_register_init[] = "register_init"; static char __pyx_k_register_quit[] = "register_quit"; static char __pyx_k_sdl_main_init[] = "sdl_main_init"; static char __pyx_k_pygame_sdl2_error[] = "pygame_sdl2.error"; static char __pyx_k_get_string_for_axis[] = "get_string_for_axis"; static char __pyx_k_get_axis_from_string[] = "get_axis_from_string"; static char __pyx_k_get_string_for_button[] = "get_string_for_button"; static char __pyx_k_get_button_from_string[] = "get_button_from_string"; static char __pyx_k_pygame_sdl2_controller[] = "pygame_sdl2.controller"; static char __pyx_k_controller_not_initialized[] = "controller not initialized."; static char __pyx_k_home_tom_ab_pygame_sdl2_src_pyg[] = "/home/tom/ab/pygame_sdl2/src/pygame_sdl2/controller.pyx"; static PyObject *__pyx_n_s_add_mapping; static PyObject *__pyx_n_s_add_mappings; static PyObject *__pyx_n_s_axis; static PyObject *__pyx_n_s_button; static PyObject *__pyx_kp_u_controller_not_initialized; static PyObject *__pyx_n_s_display; static PyObject *__pyx_n_s_error; static PyObject *__pyx_n_s_get_axis_from_string; static PyObject *__pyx_n_s_get_button_from_string; static PyObject *__pyx_n_s_get_count; static PyObject *__pyx_n_s_get_init; static PyObject *__pyx_n_s_get_string_for_axis; static PyObject *__pyx_n_s_get_string_for_button; static PyObject *__pyx_kp_s_home_tom_ab_pygame_sdl2_src_pyg; static PyObject *__pyx_n_s_import; static PyObject *__pyx_n_s_index; static PyObject *__pyx_n_s_init; static PyObject *__pyx_n_s_main; static PyObject *__pyx_n_s_mapping; static PyObject *__pyx_n_s_mapping_file; static PyObject *__pyx_n_s_name; static PyObject *__pyx_n_s_pygame_sdl2; static PyObject *__pyx_n_s_pygame_sdl2_controller; static PyObject *__pyx_n_s_pygame_sdl2_error; static PyObject *__pyx_n_s_quit; static PyObject *__pyx_n_s_register_init; static PyObject *__pyx_n_s_register_quit; static PyObject *__pyx_n_s_rv; static PyObject *__pyx_n_s_rwops; static PyObject *__pyx_n_s_sdl_main_init; static PyObject *__pyx_n_s_test; static PyObject *__pyx_pf_11pygame_sdl2_10controller_init(CYTHON_UNUSED PyObject *__pyx_self); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_10controller_2quit(CYTHON_UNUSED PyObject *__pyx_self); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_10controller_4get_init(CYTHON_UNUSED PyObject *__pyx_self); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_10controller_6get_count(CYTHON_UNUSED PyObject *__pyx_self); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_10controller_8add_mapping(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_mapping); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_10controller_10add_mappings(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_mapping_file); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_10controller_12get_axis_from_string(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_name); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_10controller_14get_button_from_string(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_name); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_10controller_16get_string_for_axis(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_axis); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_10controller_18get_string_for_button(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_button); /* proto */ static int __pyx_pf_11pygame_sdl2_10controller_10Controller___cinit__(struct __pyx_obj_11pygame_sdl2_10controller_Controller *__pyx_v_self); /* proto */ static int __pyx_pf_11pygame_sdl2_10controller_10Controller_2__init__(struct __pyx_obj_11pygame_sdl2_10controller_Controller *__pyx_v_self, PyObject *__pyx_v_index); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_10controller_10Controller_4init(struct __pyx_obj_11pygame_sdl2_10controller_Controller *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_10controller_10Controller_6quit(struct __pyx_obj_11pygame_sdl2_10controller_Controller *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_10controller_10Controller_8get_init(struct __pyx_obj_11pygame_sdl2_10controller_Controller *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_10controller_10Controller_10get_axis(struct __pyx_obj_11pygame_sdl2_10controller_Controller *__pyx_v_self, PyObject *__pyx_v_axis); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_10controller_10Controller_12get_button(struct __pyx_obj_11pygame_sdl2_10controller_Controller *__pyx_v_self, PyObject *__pyx_v_button); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_10controller_10Controller_14get_name(struct __pyx_obj_11pygame_sdl2_10controller_Controller *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_10controller_10Controller_16is_controller(struct __pyx_obj_11pygame_sdl2_10controller_Controller *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_10controller_10Controller_18get_guid_string(struct __pyx_obj_11pygame_sdl2_10controller_Controller *__pyx_v_self); /* proto */ static PyObject *__pyx_tp_new_11pygame_sdl2_10controller_Controller(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ static PyObject *__pyx_tuple_; static PyObject *__pyx_tuple__2; static PyObject *__pyx_tuple__7; static PyObject *__pyx_tuple__9; static PyObject *__pyx_tuple__11; static PyObject *__pyx_tuple__13; static PyObject *__pyx_tuple__15; static PyObject *__pyx_tuple__17; static PyObject *__pyx_codeobj__3; static PyObject *__pyx_codeobj__4; static PyObject *__pyx_codeobj__5; static PyObject *__pyx_codeobj__6; static PyObject *__pyx_codeobj__8; static PyObject *__pyx_codeobj__10; static PyObject *__pyx_codeobj__12; static PyObject *__pyx_codeobj__14; static PyObject *__pyx_codeobj__16; static PyObject *__pyx_codeobj__18; /* "pygame_sdl2/controller.pyx":26 * * @pygame_sdl2.register_init * def init(): # <<<<<<<<<<<<<< * """ * Initializes game controller support. */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_10controller_1init(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused); /*proto*/ static char __pyx_doc_11pygame_sdl2_10controller_init[] = "\n Initializes game controller support.\n "; static PyMethodDef __pyx_mdef_11pygame_sdl2_10controller_1init = {"init", (PyCFunction)__pyx_pw_11pygame_sdl2_10controller_1init, METH_NOARGS, __pyx_doc_11pygame_sdl2_10controller_init}; static PyObject *__pyx_pw_11pygame_sdl2_10controller_1init(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("init (wrapper)", 0); __pyx_r = __pyx_pf_11pygame_sdl2_10controller_init(__pyx_self); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_10controller_init(CYTHON_UNUSED PyObject *__pyx_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; int __pyx_t_4; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("init", 0); /* "pygame_sdl2/controller.pyx":31 * """ * * pygame_sdl2.display.sdl_main_init() # <<<<<<<<<<<<<< * * if SDL_InitSubSystem(SDL_INIT_GAMECONTROLLER): */ __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_pygame_sdl2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 31; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_display); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 31; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_sdl_main_init); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 31; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_3 = NULL; if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_2))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); if (likely(__pyx_t_3)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); } } if (__pyx_t_3) { __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 31; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } else { __pyx_t_1 = __Pyx_PyObject_CallNoArg(__pyx_t_2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 31; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "pygame_sdl2/controller.pyx":33 * pygame_sdl2.display.sdl_main_init() * * if SDL_InitSubSystem(SDL_INIT_GAMECONTROLLER): # <<<<<<<<<<<<<< * raise error() * */ __pyx_t_4 = (SDL_InitSubSystem(SDL_INIT_GAMECONTROLLER) != 0); if (__pyx_t_4) { /* "pygame_sdl2/controller.pyx":34 * * if SDL_InitSubSystem(SDL_INIT_GAMECONTROLLER): * raise error() # <<<<<<<<<<<<<< * * @pygame_sdl2.register_quit */ __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_error); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 34; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = NULL; if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_2))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); if (likely(__pyx_t_3)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); } } if (__pyx_t_3) { __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 34; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } else { __pyx_t_1 = __Pyx_PyObject_CallNoArg(__pyx_t_2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 34; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_Raise(__pyx_t_1, 0, 0, 0); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; {__pyx_filename = __pyx_f[0]; __pyx_lineno = 34; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "pygame_sdl2/controller.pyx":33 * pygame_sdl2.display.sdl_main_init() * * if SDL_InitSubSystem(SDL_INIT_GAMECONTROLLER): # <<<<<<<<<<<<<< * raise error() * */ } /* "pygame_sdl2/controller.pyx":26 * * @pygame_sdl2.register_init * def init(): # <<<<<<<<<<<<<< * """ * Initializes game controller support. */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("pygame_sdl2.controller.init", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/controller.pyx":37 * * @pygame_sdl2.register_quit * def quit(): # @ReservedAssignment # <<<<<<<<<<<<<< * """ * Shuts down game controller support. */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_10controller_3quit(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused); /*proto*/ static char __pyx_doc_11pygame_sdl2_10controller_2quit[] = "\n Shuts down game controller support.\n "; static PyMethodDef __pyx_mdef_11pygame_sdl2_10controller_3quit = {"quit", (PyCFunction)__pyx_pw_11pygame_sdl2_10controller_3quit, METH_NOARGS, __pyx_doc_11pygame_sdl2_10controller_2quit}; static PyObject *__pyx_pw_11pygame_sdl2_10controller_3quit(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("quit (wrapper)", 0); __pyx_r = __pyx_pf_11pygame_sdl2_10controller_2quit(__pyx_self); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_10controller_2quit(CYTHON_UNUSED PyObject *__pyx_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("quit", 0); /* "pygame_sdl2/controller.pyx":42 * """ * * SDL_QuitSubSystem(SDL_INIT_GAMECONTROLLER) # <<<<<<<<<<<<<< * * def get_init(): */ SDL_QuitSubSystem(SDL_INIT_GAMECONTROLLER); /* "pygame_sdl2/controller.pyx":37 * * @pygame_sdl2.register_quit * def quit(): # @ReservedAssignment # <<<<<<<<<<<<<< * """ * Shuts down game controller support. */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/controller.pyx":44 * SDL_QuitSubSystem(SDL_INIT_GAMECONTROLLER) * * def get_init(): # <<<<<<<<<<<<<< * """ * Returns true if game controller support has been initialized. */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_10controller_5get_init(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused); /*proto*/ static char __pyx_doc_11pygame_sdl2_10controller_4get_init[] = "\n Returns true if game controller support has been initialized.\n "; static PyMethodDef __pyx_mdef_11pygame_sdl2_10controller_5get_init = {"get_init", (PyCFunction)__pyx_pw_11pygame_sdl2_10controller_5get_init, METH_NOARGS, __pyx_doc_11pygame_sdl2_10controller_4get_init}; static PyObject *__pyx_pw_11pygame_sdl2_10controller_5get_init(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("get_init (wrapper)", 0); __pyx_r = __pyx_pf_11pygame_sdl2_10controller_4get_init(__pyx_self); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_10controller_4get_init(CYTHON_UNUSED PyObject *__pyx_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("get_init", 0); /* "pygame_sdl2/controller.pyx":49 * """ * * return SDL_WasInit(SDL_INIT_GAMECONTROLLER) != 0 # <<<<<<<<<<<<<< * * def get_count(): */ __Pyx_XDECREF(__pyx_r); __pyx_t_1 = __Pyx_PyBool_FromLong((SDL_WasInit(SDL_INIT_GAMECONTROLLER) != 0)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 49; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "pygame_sdl2/controller.pyx":44 * SDL_QuitSubSystem(SDL_INIT_GAMECONTROLLER) * * def get_init(): # <<<<<<<<<<<<<< * """ * Returns true if game controller support has been initialized. */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("pygame_sdl2.controller.get_init", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/controller.pyx":51 * return SDL_WasInit(SDL_INIT_GAMECONTROLLER) != 0 * * def get_count(): # <<<<<<<<<<<<<< * """ * Returns the number of joysticks and game controllers connected to the */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_10controller_7get_count(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused); /*proto*/ static char __pyx_doc_11pygame_sdl2_10controller_6get_count[] = "\n Returns the number of joysticks and game controllers connected to the\n system. This is one more than the maximum index that can be passed to\n Controller. While every game controller is a joystick, not every joystick\n is a game controller. To check that index `i` corresponds to a game\n controller, use code such as::\n\n if pygame_sdl2.controller.Controller(i).is_controller():\n ...\n "; static PyMethodDef __pyx_mdef_11pygame_sdl2_10controller_7get_count = {"get_count", (PyCFunction)__pyx_pw_11pygame_sdl2_10controller_7get_count, METH_NOARGS, __pyx_doc_11pygame_sdl2_10controller_6get_count}; static PyObject *__pyx_pw_11pygame_sdl2_10controller_7get_count(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("get_count (wrapper)", 0); __pyx_r = __pyx_pf_11pygame_sdl2_10controller_6get_count(__pyx_self); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_10controller_6get_count(CYTHON_UNUSED PyObject *__pyx_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("get_count", 0); /* "pygame_sdl2/controller.pyx":63 * """ * * return SDL_NumJoysticks() # <<<<<<<<<<<<<< * * */ __Pyx_XDECREF(__pyx_r); __pyx_t_1 = __Pyx_PyInt_From_int(SDL_NumJoysticks()); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 63; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "pygame_sdl2/controller.pyx":51 * return SDL_WasInit(SDL_INIT_GAMECONTROLLER) != 0 * * def get_count(): # <<<<<<<<<<<<<< * """ * Returns the number of joysticks and game controllers connected to the */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("pygame_sdl2.controller.get_count", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/controller.pyx":66 * * * def add_mapping(mapping): # <<<<<<<<<<<<<< * """ * Adds a game controller mapping from the string in `mapping`. */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_10controller_9add_mapping(PyObject *__pyx_self, PyObject *__pyx_v_mapping); /*proto*/ static char __pyx_doc_11pygame_sdl2_10controller_8add_mapping[] = "\n Adds a game controller mapping from the string in `mapping`.\n "; static PyMethodDef __pyx_mdef_11pygame_sdl2_10controller_9add_mapping = {"add_mapping", (PyCFunction)__pyx_pw_11pygame_sdl2_10controller_9add_mapping, METH_O, __pyx_doc_11pygame_sdl2_10controller_8add_mapping}; static PyObject *__pyx_pw_11pygame_sdl2_10controller_9add_mapping(PyObject *__pyx_self, PyObject *__pyx_v_mapping) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("add_mapping (wrapper)", 0); __pyx_r = __pyx_pf_11pygame_sdl2_10controller_8add_mapping(__pyx_self, ((PyObject *)__pyx_v_mapping)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_10controller_8add_mapping(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_mapping) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations char const *__pyx_t_1; int __pyx_t_2; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; PyObject *__pyx_t_5 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("add_mapping", 0); /* "pygame_sdl2/controller.pyx":71 * """ * * if SDL_GameControllerAddMapping(mapping) == -1: # <<<<<<<<<<<<<< * raise error() * */ __pyx_t_1 = __Pyx_PyObject_AsString(__pyx_v_mapping); if (unlikely((!__pyx_t_1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 71; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_t_2 = ((SDL_GameControllerAddMapping(__pyx_t_1) == -1L) != 0); if (__pyx_t_2) { /* "pygame_sdl2/controller.pyx":72 * * if SDL_GameControllerAddMapping(mapping) == -1: * raise error() # <<<<<<<<<<<<<< * * def add_mappings(mapping_file): */ __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_error); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 72; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); __pyx_t_5 = NULL; if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_4))) { __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4); if (likely(__pyx_t_5)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4); __Pyx_INCREF(__pyx_t_5); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_4, function); } } if (__pyx_t_5) { __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_5); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 72; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; } else { __pyx_t_3 = __Pyx_PyObject_CallNoArg(__pyx_t_4); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 72; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_Raise(__pyx_t_3, 0, 0, 0); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; {__pyx_filename = __pyx_f[0]; __pyx_lineno = 72; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "pygame_sdl2/controller.pyx":71 * """ * * if SDL_GameControllerAddMapping(mapping) == -1: # <<<<<<<<<<<<<< * raise error() * */ } /* "pygame_sdl2/controller.pyx":66 * * * def add_mapping(mapping): # <<<<<<<<<<<<<< * """ * Adds a game controller mapping from the string in `mapping`. */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_5); __Pyx_AddTraceback("pygame_sdl2.controller.add_mapping", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/controller.pyx":74 * raise error() * * def add_mappings(mapping_file): # <<<<<<<<<<<<<< * """ * Adds game controller mappings from `mapping_file`, which can be a string */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_10controller_11add_mappings(PyObject *__pyx_self, PyObject *__pyx_v_mapping_file); /*proto*/ static char __pyx_doc_11pygame_sdl2_10controller_10add_mappings[] = "\n Adds game controller mappings from `mapping_file`, which can be a string\n filename or a file-like object. This file should be gamecontrollerdb.txt,\n downloaded from:\n\n https://raw.githubusercontent.com/gabomdq/SDL_GameControllerDB/master/gamecontrollerdb.txt\n\n This should be called before creating a Controller object. It can be called\n multiple times to add multiple database files.\n "; static PyMethodDef __pyx_mdef_11pygame_sdl2_10controller_11add_mappings = {"add_mappings", (PyCFunction)__pyx_pw_11pygame_sdl2_10controller_11add_mappings, METH_O, __pyx_doc_11pygame_sdl2_10controller_10add_mappings}; static PyObject *__pyx_pw_11pygame_sdl2_10controller_11add_mappings(PyObject *__pyx_self, PyObject *__pyx_v_mapping_file) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("add_mappings (wrapper)", 0); __pyx_r = __pyx_pf_11pygame_sdl2_10controller_10add_mappings(__pyx_self, ((PyObject *)__pyx_v_mapping_file)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_10controller_10add_mappings(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_mapping_file) { SDL_RWops *__pyx_v_rwops; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations SDL_RWops *__pyx_t_1; int __pyx_t_2; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; PyObject *__pyx_t_5 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("add_mappings", 0); /* "pygame_sdl2/controller.pyx":86 * """ * * cdef SDL_RWops *rwops = to_rwops(mapping_file) # <<<<<<<<<<<<<< * * if SDL_GameControllerAddMappingsFromRW(rwops, 1) == -1: */ __pyx_t_1 = __pyx_f_11pygame_sdl2_8rwobject_to_rwops(__pyx_v_mapping_file, NULL); if (unlikely(__pyx_t_1 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 86; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_v_rwops = __pyx_t_1; /* "pygame_sdl2/controller.pyx":88 * cdef SDL_RWops *rwops = to_rwops(mapping_file) * * if SDL_GameControllerAddMappingsFromRW(rwops, 1) == -1: # <<<<<<<<<<<<<< * raise error() * */ __pyx_t_2 = ((SDL_GameControllerAddMappingsFromRW(__pyx_v_rwops, 1) == -1L) != 0); if (__pyx_t_2) { /* "pygame_sdl2/controller.pyx":89 * * if SDL_GameControllerAddMappingsFromRW(rwops, 1) == -1: * raise error() # <<<<<<<<<<<<<< * * def get_axis_from_string(name): */ __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_error); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 89; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); __pyx_t_5 = NULL; if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_4))) { __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4); if (likely(__pyx_t_5)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4); __Pyx_INCREF(__pyx_t_5); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_4, function); } } if (__pyx_t_5) { __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_5); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 89; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; } else { __pyx_t_3 = __Pyx_PyObject_CallNoArg(__pyx_t_4); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 89; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_Raise(__pyx_t_3, 0, 0, 0); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; {__pyx_filename = __pyx_f[0]; __pyx_lineno = 89; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "pygame_sdl2/controller.pyx":88 * cdef SDL_RWops *rwops = to_rwops(mapping_file) * * if SDL_GameControllerAddMappingsFromRW(rwops, 1) == -1: # <<<<<<<<<<<<<< * raise error() * */ } /* "pygame_sdl2/controller.pyx":74 * raise error() * * def add_mappings(mapping_file): # <<<<<<<<<<<<<< * """ * Adds game controller mappings from `mapping_file`, which can be a string */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_5); __Pyx_AddTraceback("pygame_sdl2.controller.add_mappings", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/controller.pyx":91 * raise error() * * def get_axis_from_string(name): # <<<<<<<<<<<<<< * """ * Returns the axis number of the controller axis with `name`, or */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_10controller_13get_axis_from_string(PyObject *__pyx_self, PyObject *__pyx_v_name); /*proto*/ static char __pyx_doc_11pygame_sdl2_10controller_12get_axis_from_string[] = "\n Returns the axis number of the controller axis with `name`, or\n pygame.CONTROLLER_AXIS_INVALID if `name` is not known.\n "; static PyMethodDef __pyx_mdef_11pygame_sdl2_10controller_13get_axis_from_string = {"get_axis_from_string", (PyCFunction)__pyx_pw_11pygame_sdl2_10controller_13get_axis_from_string, METH_O, __pyx_doc_11pygame_sdl2_10controller_12get_axis_from_string}; static PyObject *__pyx_pw_11pygame_sdl2_10controller_13get_axis_from_string(PyObject *__pyx_self, PyObject *__pyx_v_name) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("get_axis_from_string (wrapper)", 0); __pyx_r = __pyx_pf_11pygame_sdl2_10controller_12get_axis_from_string(__pyx_self, ((PyObject *)__pyx_v_name)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_10controller_12get_axis_from_string(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_name) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations char const *__pyx_t_1; PyObject *__pyx_t_2 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("get_axis_from_string", 0); /* "pygame_sdl2/controller.pyx":97 * """ * * return SDL_GameControllerGetAxisFromString(name) # <<<<<<<<<<<<<< * * def get_button_from_string(name): */ __Pyx_XDECREF(__pyx_r); __pyx_t_1 = __Pyx_PyObject_AsString(__pyx_v_name); if (unlikely((!__pyx_t_1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 97; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_t_2 = __Pyx_PyInt_From_SDL_GameControllerAxis(SDL_GameControllerGetAxisFromString(__pyx_t_1)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 97; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; /* "pygame_sdl2/controller.pyx":91 * raise error() * * def get_axis_from_string(name): # <<<<<<<<<<<<<< * """ * Returns the axis number of the controller axis with `name`, or */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_AddTraceback("pygame_sdl2.controller.get_axis_from_string", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/controller.pyx":99 * return SDL_GameControllerGetAxisFromString(name) * * def get_button_from_string(name): # <<<<<<<<<<<<<< * """ * Returns the button number of the controller button with `name`, or */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_10controller_15get_button_from_string(PyObject *__pyx_self, PyObject *__pyx_v_name); /*proto*/ static char __pyx_doc_11pygame_sdl2_10controller_14get_button_from_string[] = "\n Returns the button number of the controller button with `name`, or\n pygame.CONTROLLER_BUTTON_INVALID if `name` is not known.\n "; static PyMethodDef __pyx_mdef_11pygame_sdl2_10controller_15get_button_from_string = {"get_button_from_string", (PyCFunction)__pyx_pw_11pygame_sdl2_10controller_15get_button_from_string, METH_O, __pyx_doc_11pygame_sdl2_10controller_14get_button_from_string}; static PyObject *__pyx_pw_11pygame_sdl2_10controller_15get_button_from_string(PyObject *__pyx_self, PyObject *__pyx_v_name) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("get_button_from_string (wrapper)", 0); __pyx_r = __pyx_pf_11pygame_sdl2_10controller_14get_button_from_string(__pyx_self, ((PyObject *)__pyx_v_name)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_10controller_14get_button_from_string(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_name) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations char const *__pyx_t_1; PyObject *__pyx_t_2 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("get_button_from_string", 0); /* "pygame_sdl2/controller.pyx":105 * """ * * return SDL_GameControllerGetButtonFromString(name) # <<<<<<<<<<<<<< * * def get_string_for_axis(axis): */ __Pyx_XDECREF(__pyx_r); __pyx_t_1 = __Pyx_PyObject_AsString(__pyx_v_name); if (unlikely((!__pyx_t_1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 105; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_t_2 = __Pyx_PyInt_From_SDL_GameControllerButton(SDL_GameControllerGetButtonFromString(__pyx_t_1)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 105; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; /* "pygame_sdl2/controller.pyx":99 * return SDL_GameControllerGetAxisFromString(name) * * def get_button_from_string(name): # <<<<<<<<<<<<<< * """ * Returns the button number of the controller button with `name`, or */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_AddTraceback("pygame_sdl2.controller.get_button_from_string", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/controller.pyx":107 * return SDL_GameControllerGetButtonFromString(name) * * def get_string_for_axis(axis): # <<<<<<<<<<<<<< * """ * Returns a string describing the controller axis `axis`, which must be */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_10controller_17get_string_for_axis(PyObject *__pyx_self, PyObject *__pyx_v_axis); /*proto*/ static char __pyx_doc_11pygame_sdl2_10controller_16get_string_for_axis[] = "\n Returns a string describing the controller axis `axis`, which must be\n an integer. Returns None if the axis is not known.\n "; static PyMethodDef __pyx_mdef_11pygame_sdl2_10controller_17get_string_for_axis = {"get_string_for_axis", (PyCFunction)__pyx_pw_11pygame_sdl2_10controller_17get_string_for_axis, METH_O, __pyx_doc_11pygame_sdl2_10controller_16get_string_for_axis}; static PyObject *__pyx_pw_11pygame_sdl2_10controller_17get_string_for_axis(PyObject *__pyx_self, PyObject *__pyx_v_axis) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("get_string_for_axis (wrapper)", 0); __pyx_r = __pyx_pf_11pygame_sdl2_10controller_16get_string_for_axis(__pyx_self, ((PyObject *)__pyx_v_axis)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_10controller_16get_string_for_axis(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_axis) { char const *__pyx_v_rv; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations SDL_GameControllerAxis __pyx_t_1; int __pyx_t_2; PyObject *__pyx_t_3 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("get_string_for_axis", 0); /* "pygame_sdl2/controller.pyx":113 * """ * * cdef const char *rv = SDL_GameControllerGetStringForAxis(axis) # <<<<<<<<<<<<<< * * if rv != NULL: */ __pyx_t_1 = ((SDL_GameControllerAxis)__Pyx_PyInt_As_SDL_GameControllerAxis(__pyx_v_axis)); if (unlikely(PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 113; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_v_rv = SDL_GameControllerGetStringForAxis(__pyx_t_1); /* "pygame_sdl2/controller.pyx":115 * cdef const char *rv = SDL_GameControllerGetStringForAxis(axis) * * if rv != NULL: # <<<<<<<<<<<<<< * return rv * else: */ __pyx_t_2 = ((__pyx_v_rv != NULL) != 0); if (__pyx_t_2) { /* "pygame_sdl2/controller.pyx":116 * * if rv != NULL: * return rv # <<<<<<<<<<<<<< * else: * return None */ __Pyx_XDECREF(__pyx_r); __pyx_t_3 = __Pyx_PyBytes_FromString(__pyx_v_rv); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 116; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __pyx_r = __pyx_t_3; __pyx_t_3 = 0; goto __pyx_L0; /* "pygame_sdl2/controller.pyx":115 * cdef const char *rv = SDL_GameControllerGetStringForAxis(axis) * * if rv != NULL: # <<<<<<<<<<<<<< * return rv * else: */ } /* "pygame_sdl2/controller.pyx":118 * return rv * else: * return None # <<<<<<<<<<<<<< * * def get_string_for_button(button): */ /*else*/ { __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(Py_None); __pyx_r = Py_None; goto __pyx_L0; } /* "pygame_sdl2/controller.pyx":107 * return SDL_GameControllerGetButtonFromString(name) * * def get_string_for_axis(axis): # <<<<<<<<<<<<<< * """ * Returns a string describing the controller axis `axis`, which must be */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("pygame_sdl2.controller.get_string_for_axis", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/controller.pyx":120 * return None * * def get_string_for_button(button): # <<<<<<<<<<<<<< * """ * Returns a string describing the controller button `button`, which must be */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_10controller_19get_string_for_button(PyObject *__pyx_self, PyObject *__pyx_v_button); /*proto*/ static char __pyx_doc_11pygame_sdl2_10controller_18get_string_for_button[] = "\n Returns a string describing the controller button `button`, which must be\n an integer. Returns None if the button is not known.\n "; static PyMethodDef __pyx_mdef_11pygame_sdl2_10controller_19get_string_for_button = {"get_string_for_button", (PyCFunction)__pyx_pw_11pygame_sdl2_10controller_19get_string_for_button, METH_O, __pyx_doc_11pygame_sdl2_10controller_18get_string_for_button}; static PyObject *__pyx_pw_11pygame_sdl2_10controller_19get_string_for_button(PyObject *__pyx_self, PyObject *__pyx_v_button) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("get_string_for_button (wrapper)", 0); __pyx_r = __pyx_pf_11pygame_sdl2_10controller_18get_string_for_button(__pyx_self, ((PyObject *)__pyx_v_button)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_10controller_18get_string_for_button(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_button) { char const *__pyx_v_rv; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations SDL_GameControllerButton __pyx_t_1; int __pyx_t_2; PyObject *__pyx_t_3 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("get_string_for_button", 0); /* "pygame_sdl2/controller.pyx":126 * """ * * cdef const char *rv = SDL_GameControllerGetStringForButton(button) # <<<<<<<<<<<<<< * * if rv != NULL: */ __pyx_t_1 = ((SDL_GameControllerButton)__Pyx_PyInt_As_SDL_GameControllerButton(__pyx_v_button)); if (unlikely(PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 126; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_v_rv = SDL_GameControllerGetStringForButton(__pyx_t_1); /* "pygame_sdl2/controller.pyx":128 * cdef const char *rv = SDL_GameControllerGetStringForButton(button) * * if rv != NULL: # <<<<<<<<<<<<<< * return rv * else: */ __pyx_t_2 = ((__pyx_v_rv != NULL) != 0); if (__pyx_t_2) { /* "pygame_sdl2/controller.pyx":129 * * if rv != NULL: * return rv # <<<<<<<<<<<<<< * else: * return None */ __Pyx_XDECREF(__pyx_r); __pyx_t_3 = __Pyx_PyBytes_FromString(__pyx_v_rv); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 129; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __pyx_r = __pyx_t_3; __pyx_t_3 = 0; goto __pyx_L0; /* "pygame_sdl2/controller.pyx":128 * cdef const char *rv = SDL_GameControllerGetStringForButton(button) * * if rv != NULL: # <<<<<<<<<<<<<< * return rv * else: */ } /* "pygame_sdl2/controller.pyx":131 * return rv * else: * return None # <<<<<<<<<<<<<< * * */ /*else*/ { __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(Py_None); __pyx_r = Py_None; goto __pyx_L0; } /* "pygame_sdl2/controller.pyx":120 * return None * * def get_string_for_button(button): # <<<<<<<<<<<<<< * """ * Returns a string describing the controller button `button`, which must be */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("pygame_sdl2.controller.get_string_for_button", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/controller.pyx":141 * cdef int index * * def __cinit__(self): # <<<<<<<<<<<<<< * self.controller = NULL * */ /* Python wrapper */ static int __pyx_pw_11pygame_sdl2_10controller_10Controller_1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static int __pyx_pw_11pygame_sdl2_10controller_10Controller_1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__cinit__ (wrapper)", 0); if (unlikely(PyTuple_GET_SIZE(__pyx_args) > 0)) { __Pyx_RaiseArgtupleInvalid("__cinit__", 1, 0, 0, PyTuple_GET_SIZE(__pyx_args)); return -1;} if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "__cinit__", 0))) return -1; __pyx_r = __pyx_pf_11pygame_sdl2_10controller_10Controller___cinit__(((struct __pyx_obj_11pygame_sdl2_10controller_Controller *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static int __pyx_pf_11pygame_sdl2_10controller_10Controller___cinit__(struct __pyx_obj_11pygame_sdl2_10controller_Controller *__pyx_v_self) { int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__cinit__", 0); /* "pygame_sdl2/controller.pyx":142 * * def __cinit__(self): * self.controller = NULL # <<<<<<<<<<<<<< * * def __init__(self, index): */ __pyx_v_self->controller = NULL; /* "pygame_sdl2/controller.pyx":141 * cdef int index * * def __cinit__(self): # <<<<<<<<<<<<<< * self.controller = NULL * */ /* function exit code */ __pyx_r = 0; __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/controller.pyx":144 * self.controller = NULL * * def __init__(self, index): # <<<<<<<<<<<<<< * """ * Represents a game controller object corresponding to the joystick */ /* Python wrapper */ static int __pyx_pw_11pygame_sdl2_10controller_10Controller_3__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_11pygame_sdl2_10controller_10Controller_2__init__[] = "\n Represents a game controller object corresponding to the joystick\n with `index`.\n "; #if CYTHON_COMPILING_IN_CPYTHON struct wrapperbase __pyx_wrapperbase_11pygame_sdl2_10controller_10Controller_2__init__; #endif static int __pyx_pw_11pygame_sdl2_10controller_10Controller_3__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_index = 0; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__init__ (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_index,0}; PyObject* values[1] = {0}; if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_index)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__init__") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 144; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } } else if (PyTuple_GET_SIZE(__pyx_args) != 1) { goto __pyx_L5_argtuple_error; } else { values[0] = PyTuple_GET_ITEM(__pyx_args, 0); } __pyx_v_index = values[0]; } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("__init__", 1, 1, 1, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 144; __pyx_clineno = __LINE__; goto __pyx_L3_error;} __pyx_L3_error:; __Pyx_AddTraceback("pygame_sdl2.controller.Controller.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return -1; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_11pygame_sdl2_10controller_10Controller_2__init__(((struct __pyx_obj_11pygame_sdl2_10controller_Controller *)__pyx_v_self), __pyx_v_index); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static int __pyx_pf_11pygame_sdl2_10controller_10Controller_2__init__(struct __pyx_obj_11pygame_sdl2_10controller_Controller *__pyx_v_self, PyObject *__pyx_v_index) { int __pyx_r; __Pyx_RefNannyDeclarations int __pyx_t_1; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__init__", 0); /* "pygame_sdl2/controller.pyx":150 * """ * * self.index = index # <<<<<<<<<<<<<< * * def init(self): */ __pyx_t_1 = __Pyx_PyInt_As_int(__pyx_v_index); if (unlikely((__pyx_t_1 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 150; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_v_self->index = __pyx_t_1; /* "pygame_sdl2/controller.pyx":144 * self.controller = NULL * * def __init__(self, index): # <<<<<<<<<<<<<< * """ * Represents a game controller object corresponding to the joystick */ /* function exit code */ __pyx_r = 0; goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("pygame_sdl2.controller.Controller.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = -1; __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/controller.pyx":152 * self.index = index * * def init(self): # <<<<<<<<<<<<<< * """ * Opens the game controller, causing it to begin sending events. */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_10controller_10Controller_5init(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/ static char __pyx_doc_11pygame_sdl2_10controller_10Controller_4init[] = "\n Opens the game controller, causing it to begin sending events.\n "; static PyObject *__pyx_pw_11pygame_sdl2_10controller_10Controller_5init(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("init (wrapper)", 0); __pyx_r = __pyx_pf_11pygame_sdl2_10controller_10Controller_4init(((struct __pyx_obj_11pygame_sdl2_10controller_Controller *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_10controller_10Controller_4init(struct __pyx_obj_11pygame_sdl2_10controller_Controller *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("init", 0); /* "pygame_sdl2/controller.pyx":157 * """ * * if self.controller == NULL: # <<<<<<<<<<<<<< * self.controller = SDL_GameControllerOpen(self.index) * if self.controller == NULL: */ __pyx_t_1 = ((__pyx_v_self->controller == NULL) != 0); if (__pyx_t_1) { /* "pygame_sdl2/controller.pyx":158 * * if self.controller == NULL: * self.controller = SDL_GameControllerOpen(self.index) # <<<<<<<<<<<<<< * if self.controller == NULL: * raise error() */ __pyx_v_self->controller = SDL_GameControllerOpen(__pyx_v_self->index); /* "pygame_sdl2/controller.pyx":159 * if self.controller == NULL: * self.controller = SDL_GameControllerOpen(self.index) * if self.controller == NULL: # <<<<<<<<<<<<<< * raise error() * */ __pyx_t_1 = ((__pyx_v_self->controller == NULL) != 0); if (__pyx_t_1) { /* "pygame_sdl2/controller.pyx":160 * self.controller = SDL_GameControllerOpen(self.index) * if self.controller == NULL: * raise error() # <<<<<<<<<<<<<< * * def quit(self): # @ReservedAssignment */ __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_error); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 160; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = NULL; if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_3))) { __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3); if (likely(__pyx_t_4)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); __Pyx_INCREF(__pyx_t_4); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_3, function); } } if (__pyx_t_4) { __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 160; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; } else { __pyx_t_2 = __Pyx_PyObject_CallNoArg(__pyx_t_3); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 160; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_Raise(__pyx_t_2, 0, 0, 0); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; {__pyx_filename = __pyx_f[0]; __pyx_lineno = 160; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "pygame_sdl2/controller.pyx":159 * if self.controller == NULL: * self.controller = SDL_GameControllerOpen(self.index) * if self.controller == NULL: # <<<<<<<<<<<<<< * raise error() * */ } /* "pygame_sdl2/controller.pyx":157 * """ * * if self.controller == NULL: # <<<<<<<<<<<<<< * self.controller = SDL_GameControllerOpen(self.index) * if self.controller == NULL: */ } /* "pygame_sdl2/controller.pyx":152 * self.index = index * * def init(self): # <<<<<<<<<<<<<< * """ * Opens the game controller, causing it to begin sending events. */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_AddTraceback("pygame_sdl2.controller.Controller.init", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/controller.pyx":162 * raise error() * * def quit(self): # @ReservedAssignment # <<<<<<<<<<<<<< * """ * Closes the game controller, preventing it from sending events. */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_10controller_10Controller_7quit(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/ static char __pyx_doc_11pygame_sdl2_10controller_10Controller_6quit[] = "\n Closes the game controller, preventing it from sending events.\n "; static PyObject *__pyx_pw_11pygame_sdl2_10controller_10Controller_7quit(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("quit (wrapper)", 0); __pyx_r = __pyx_pf_11pygame_sdl2_10controller_10Controller_6quit(((struct __pyx_obj_11pygame_sdl2_10controller_Controller *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_10controller_10Controller_6quit(struct __pyx_obj_11pygame_sdl2_10controller_Controller *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; int __pyx_t_2; SDL_bool __pyx_t_3; __Pyx_RefNannySetupContext("quit", 0); /* "pygame_sdl2/controller.pyx":167 * """ * * if self.controller and SDL_GameControllerGetAttached(self.controller): # <<<<<<<<<<<<<< * SDL_GameControllerClose(self.controller) * self.controller = NULL */ __pyx_t_2 = (__pyx_v_self->controller != 0); if (__pyx_t_2) { } else { __pyx_t_1 = __pyx_t_2; goto __pyx_L4_bool_binop_done; } __pyx_t_3 = SDL_GameControllerGetAttached(__pyx_v_self->controller); __pyx_t_1 = __pyx_t_3; __pyx_L4_bool_binop_done:; if (__pyx_t_1) { /* "pygame_sdl2/controller.pyx":168 * * if self.controller and SDL_GameControllerGetAttached(self.controller): * SDL_GameControllerClose(self.controller) # <<<<<<<<<<<<<< * self.controller = NULL * */ SDL_GameControllerClose(__pyx_v_self->controller); /* "pygame_sdl2/controller.pyx":169 * if self.controller and SDL_GameControllerGetAttached(self.controller): * SDL_GameControllerClose(self.controller) * self.controller = NULL # <<<<<<<<<<<<<< * * def get_init(self): */ __pyx_v_self->controller = NULL; /* "pygame_sdl2/controller.pyx":167 * """ * * if self.controller and SDL_GameControllerGetAttached(self.controller): # <<<<<<<<<<<<<< * SDL_GameControllerClose(self.controller) * self.controller = NULL */ } /* "pygame_sdl2/controller.pyx":162 * raise error() * * def quit(self): # @ReservedAssignment # <<<<<<<<<<<<<< * """ * Closes the game controller, preventing it from sending events. */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/controller.pyx":171 * self.controller = NULL * * def get_init(self): # <<<<<<<<<<<<<< * """ * Returns true if the controller has been initialized, false otherwise. */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_10controller_10Controller_9get_init(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/ static char __pyx_doc_11pygame_sdl2_10controller_10Controller_8get_init[] = "\n Returns true if the controller has been initialized, false otherwise.\n "; static PyObject *__pyx_pw_11pygame_sdl2_10controller_10Controller_9get_init(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("get_init (wrapper)", 0); __pyx_r = __pyx_pf_11pygame_sdl2_10controller_10Controller_8get_init(((struct __pyx_obj_11pygame_sdl2_10controller_Controller *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_10controller_10Controller_8get_init(struct __pyx_obj_11pygame_sdl2_10controller_Controller *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; __Pyx_RefNannySetupContext("get_init", 0); /* "pygame_sdl2/controller.pyx":176 * """ * * if self.controller: # <<<<<<<<<<<<<< * return True * else: */ __pyx_t_1 = (__pyx_v_self->controller != 0); if (__pyx_t_1) { /* "pygame_sdl2/controller.pyx":177 * * if self.controller: * return True # <<<<<<<<<<<<<< * else: * return False */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(Py_True); __pyx_r = Py_True; goto __pyx_L0; /* "pygame_sdl2/controller.pyx":176 * """ * * if self.controller: # <<<<<<<<<<<<<< * return True * else: */ } /* "pygame_sdl2/controller.pyx":179 * return True * else: * return False # <<<<<<<<<<<<<< * * def get_axis(self, axis): */ /*else*/ { __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(Py_False); __pyx_r = Py_False; goto __pyx_L0; } /* "pygame_sdl2/controller.pyx":171 * self.controller = NULL * * def get_init(self): # <<<<<<<<<<<<<< * """ * Returns true if the controller has been initialized, false otherwise. */ /* function exit code */ __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/controller.pyx":181 * return False * * def get_axis(self, axis): # <<<<<<<<<<<<<< * """ * Returns the value of `axis`, which is one of the pygame.CONTROLLER_AXIS */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_10controller_10Controller_11get_axis(PyObject *__pyx_v_self, PyObject *__pyx_v_axis); /*proto*/ static char __pyx_doc_11pygame_sdl2_10controller_10Controller_10get_axis[] = "\n Returns the value of `axis`, which is one of the pygame.CONTROLLER_AXIS\n constants.\n\n Axes return values from -32768 to 32678, triggers return 0 to 32768. 0 is\n returned on failure.\n "; static PyObject *__pyx_pw_11pygame_sdl2_10controller_10Controller_11get_axis(PyObject *__pyx_v_self, PyObject *__pyx_v_axis) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("get_axis (wrapper)", 0); __pyx_r = __pyx_pf_11pygame_sdl2_10controller_10Controller_10get_axis(((struct __pyx_obj_11pygame_sdl2_10controller_Controller *)__pyx_v_self), ((PyObject *)__pyx_v_axis)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_10controller_10Controller_10get_axis(struct __pyx_obj_11pygame_sdl2_10controller_Controller *__pyx_v_self, PyObject *__pyx_v_axis) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; SDL_GameControllerAxis __pyx_t_4; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("get_axis", 0); /* "pygame_sdl2/controller.pyx":190 * """ * * if self.controller == NULL: # <<<<<<<<<<<<<< * raise error("controller not initialized.") * */ __pyx_t_1 = ((__pyx_v_self->controller == NULL) != 0); if (__pyx_t_1) { /* "pygame_sdl2/controller.pyx":191 * * if self.controller == NULL: * raise error("controller not initialized.") # <<<<<<<<<<<<<< * * return SDL_GameControllerGetAxis(self.controller, axis) */ __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_error); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 191; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_tuple_, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 191; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_Raise(__pyx_t_3, 0, 0, 0); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; {__pyx_filename = __pyx_f[0]; __pyx_lineno = 191; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "pygame_sdl2/controller.pyx":190 * """ * * if self.controller == NULL: # <<<<<<<<<<<<<< * raise error("controller not initialized.") * */ } /* "pygame_sdl2/controller.pyx":193 * raise error("controller not initialized.") * * return SDL_GameControllerGetAxis(self.controller, axis) # <<<<<<<<<<<<<< * * */ __Pyx_XDECREF(__pyx_r); __pyx_t_4 = ((SDL_GameControllerAxis)__Pyx_PyInt_As_SDL_GameControllerAxis(__pyx_v_axis)); if (unlikely(PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 193; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_t_3 = __Pyx_PyInt_From_int16_t(SDL_GameControllerGetAxis(__pyx_v_self->controller, __pyx_t_4)); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 193; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __pyx_r = __pyx_t_3; __pyx_t_3 = 0; goto __pyx_L0; /* "pygame_sdl2/controller.pyx":181 * return False * * def get_axis(self, axis): # <<<<<<<<<<<<<< * """ * Returns the value of `axis`, which is one of the pygame.CONTROLLER_AXIS */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("pygame_sdl2.controller.Controller.get_axis", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/controller.pyx":196 * * * def get_button(self, button): # <<<<<<<<<<<<<< * """ * Returns the value of `button`, which must be one of the pygame.CONTROLLER_BUTTON */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_10controller_10Controller_13get_button(PyObject *__pyx_v_self, PyObject *__pyx_v_button); /*proto*/ static char __pyx_doc_11pygame_sdl2_10controller_10Controller_12get_button[] = "\n Returns the value of `button`, which must be one of the pygame.CONTROLLER_BUTTON\n constants.\n\n Returns 1 if the button is pressed, 0 if not or the button does not exist.\n "; static PyObject *__pyx_pw_11pygame_sdl2_10controller_10Controller_13get_button(PyObject *__pyx_v_self, PyObject *__pyx_v_button) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("get_button (wrapper)", 0); __pyx_r = __pyx_pf_11pygame_sdl2_10controller_10Controller_12get_button(((struct __pyx_obj_11pygame_sdl2_10controller_Controller *)__pyx_v_self), ((PyObject *)__pyx_v_button)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_10controller_10Controller_12get_button(struct __pyx_obj_11pygame_sdl2_10controller_Controller *__pyx_v_self, PyObject *__pyx_v_button) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; SDL_GameControllerButton __pyx_t_4; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("get_button", 0); /* "pygame_sdl2/controller.pyx":204 * """ * * if self.controller == NULL: # <<<<<<<<<<<<<< * raise error("controller not initialized.") * */ __pyx_t_1 = ((__pyx_v_self->controller == NULL) != 0); if (__pyx_t_1) { /* "pygame_sdl2/controller.pyx":205 * * if self.controller == NULL: * raise error("controller not initialized.") # <<<<<<<<<<<<<< * * return SDL_GameControllerGetButton(self.controller, button) */ __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_error); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 205; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_tuple__2, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 205; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_Raise(__pyx_t_3, 0, 0, 0); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; {__pyx_filename = __pyx_f[0]; __pyx_lineno = 205; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "pygame_sdl2/controller.pyx":204 * """ * * if self.controller == NULL: # <<<<<<<<<<<<<< * raise error("controller not initialized.") * */ } /* "pygame_sdl2/controller.pyx":207 * raise error("controller not initialized.") * * return SDL_GameControllerGetButton(self.controller, button) # <<<<<<<<<<<<<< * * def get_name(self): */ __Pyx_XDECREF(__pyx_r); __pyx_t_4 = ((SDL_GameControllerButton)__Pyx_PyInt_As_SDL_GameControllerButton(__pyx_v_button)); if (unlikely(PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 207; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_t_3 = __Pyx_PyInt_From_uint8_t(SDL_GameControllerGetButton(__pyx_v_self->controller, __pyx_t_4)); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 207; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __pyx_r = __pyx_t_3; __pyx_t_3 = 0; goto __pyx_L0; /* "pygame_sdl2/controller.pyx":196 * * * def get_button(self, button): # <<<<<<<<<<<<<< * """ * Returns the value of `button`, which must be one of the pygame.CONTROLLER_BUTTON */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("pygame_sdl2.controller.Controller.get_button", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/controller.pyx":209 * return SDL_GameControllerGetButton(self.controller, button) * * def get_name(self): # <<<<<<<<<<<<<< * """ * Returns an implementation-dependent name for this game controller, */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_10controller_10Controller_15get_name(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/ static char __pyx_doc_11pygame_sdl2_10controller_10Controller_14get_name[] = "\n Returns an implementation-dependent name for this game controller,\n or None if no name could be found.\n "; static PyObject *__pyx_pw_11pygame_sdl2_10controller_10Controller_15get_name(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("get_name (wrapper)", 0); __pyx_r = __pyx_pf_11pygame_sdl2_10controller_10Controller_14get_name(((struct __pyx_obj_11pygame_sdl2_10controller_Controller *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_10controller_10Controller_14get_name(struct __pyx_obj_11pygame_sdl2_10controller_Controller *__pyx_v_self) { char const *__pyx_v_rv; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; PyObject *__pyx_t_2 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("get_name", 0); /* "pygame_sdl2/controller.pyx":215 * """ * * cdef const char *rv = SDL_GameControllerNameForIndex(self.index) # <<<<<<<<<<<<<< * * if rv == NULL: */ __pyx_v_rv = SDL_GameControllerNameForIndex(__pyx_v_self->index); /* "pygame_sdl2/controller.pyx":217 * cdef const char *rv = SDL_GameControllerNameForIndex(self.index) * * if rv == NULL: # <<<<<<<<<<<<<< * return None * */ __pyx_t_1 = ((__pyx_v_rv == NULL) != 0); if (__pyx_t_1) { /* "pygame_sdl2/controller.pyx":218 * * if rv == NULL: * return None # <<<<<<<<<<<<<< * * return rv */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(Py_None); __pyx_r = Py_None; goto __pyx_L0; /* "pygame_sdl2/controller.pyx":217 * cdef const char *rv = SDL_GameControllerNameForIndex(self.index) * * if rv == NULL: # <<<<<<<<<<<<<< * return None * */ } /* "pygame_sdl2/controller.pyx":220 * return None * * return rv # <<<<<<<<<<<<<< * * def is_controller(self): */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __Pyx_PyBytes_FromString(__pyx_v_rv); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 220; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; /* "pygame_sdl2/controller.pyx":209 * return SDL_GameControllerGetButton(self.controller, button) * * def get_name(self): # <<<<<<<<<<<<<< * """ * Returns an implementation-dependent name for this game controller, */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_AddTraceback("pygame_sdl2.controller.Controller.get_name", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/controller.pyx":222 * return rv * * def is_controller(self): # <<<<<<<<<<<<<< * """ * Returns true if this Controller object corresponds to a supported */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_10controller_10Controller_17is_controller(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/ static char __pyx_doc_11pygame_sdl2_10controller_10Controller_16is_controller[] = "\n Returns true if this Controller object corresponds to a supported\n game controller, or False otherwise.\n "; static PyObject *__pyx_pw_11pygame_sdl2_10controller_10Controller_17is_controller(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("is_controller (wrapper)", 0); __pyx_r = __pyx_pf_11pygame_sdl2_10controller_10Controller_16is_controller(((struct __pyx_obj_11pygame_sdl2_10controller_Controller *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_10controller_10Controller_16is_controller(struct __pyx_obj_11pygame_sdl2_10controller_Controller *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("is_controller", 0); /* "pygame_sdl2/controller.pyx":228 * """ * * return SDL_IsGameController(self.index) # <<<<<<<<<<<<<< * * def get_guid_string(self): */ __Pyx_XDECREF(__pyx_r); __pyx_t_1 = __Pyx_PyInt_From_SDL_bool(SDL_IsGameController(__pyx_v_self->index)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 228; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "pygame_sdl2/controller.pyx":222 * return rv * * def is_controller(self): # <<<<<<<<<<<<<< * """ * Returns true if this Controller object corresponds to a supported */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("pygame_sdl2.controller.Controller.is_controller", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/controller.pyx":230 * return SDL_IsGameController(self.index) * * def get_guid_string(self): # <<<<<<<<<<<<<< * """ * Returns the guid string corresponding to this controller. */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_10controller_10Controller_19get_guid_string(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/ static char __pyx_doc_11pygame_sdl2_10controller_10Controller_18get_guid_string[] = "\n Returns the guid string corresponding to this controller.\n "; static PyObject *__pyx_pw_11pygame_sdl2_10controller_10Controller_19get_guid_string(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("get_guid_string (wrapper)", 0); __pyx_r = __pyx_pf_11pygame_sdl2_10controller_10Controller_18get_guid_string(((struct __pyx_obj_11pygame_sdl2_10controller_Controller *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_10controller_10Controller_18get_guid_string(struct __pyx_obj_11pygame_sdl2_10controller_Controller *__pyx_v_self) { SDL_JoystickGUID __pyx_v_guid; char __pyx_v_s[33]; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("get_guid_string", 0); /* "pygame_sdl2/controller.pyx":238 * cdef char s[33] * * guid = SDL_JoystickGetDeviceGUID(self.index) # <<<<<<<<<<<<<< * SDL_JoystickGetGUIDString(guid, s, 33) * */ __pyx_v_guid = SDL_JoystickGetDeviceGUID(__pyx_v_self->index); /* "pygame_sdl2/controller.pyx":239 * * guid = SDL_JoystickGetDeviceGUID(self.index) * SDL_JoystickGetGUIDString(guid, s, 33) # <<<<<<<<<<<<<< * * return s */ SDL_JoystickGetGUIDString(__pyx_v_guid, __pyx_v_s, 33); /* "pygame_sdl2/controller.pyx":241 * SDL_JoystickGetGUIDString(guid, s, 33) * * return s # <<<<<<<<<<<<<< * */ __Pyx_XDECREF(__pyx_r); __pyx_t_1 = __Pyx_PyObject_FromString(__pyx_v_s); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 241; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "pygame_sdl2/controller.pyx":230 * return SDL_IsGameController(self.index) * * def get_guid_string(self): # <<<<<<<<<<<<<< * """ * Returns the guid string corresponding to this controller. */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("pygame_sdl2.controller.Controller.get_guid_string", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_tp_new_11pygame_sdl2_10controller_Controller(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) { PyObject *o; if (likely((t->tp_flags & Py_TPFLAGS_IS_ABSTRACT) == 0)) { o = (*t->tp_alloc)(t, 0); } else { o = (PyObject *) PyBaseObject_Type.tp_new(t, __pyx_empty_tuple, 0); } if (unlikely(!o)) return 0; if (unlikely(__pyx_pw_11pygame_sdl2_10controller_10Controller_1__cinit__(o, __pyx_empty_tuple, NULL) < 0)) { Py_DECREF(o); o = 0; } return o; } static void __pyx_tp_dealloc_11pygame_sdl2_10controller_Controller(PyObject *o) { struct __pyx_obj_11pygame_sdl2_10controller_Controller *p = (struct __pyx_obj_11pygame_sdl2_10controller_Controller *)o; #if PY_VERSION_HEX >= 0x030400a1 if (unlikely(Py_TYPE(o)->tp_finalize) && (!PyType_IS_GC(Py_TYPE(o)) || !_PyGC_FINALIZED(o))) { if (PyObject_CallFinalizerFromDealloc(o)) return; } #endif if (p->__weakref__) PyObject_ClearWeakRefs(o); (*Py_TYPE(o)->tp_free)(o); } static PyMethodDef __pyx_methods_11pygame_sdl2_10controller_Controller[] = { {"init", (PyCFunction)__pyx_pw_11pygame_sdl2_10controller_10Controller_5init, METH_NOARGS, __pyx_doc_11pygame_sdl2_10controller_10Controller_4init}, {"quit", (PyCFunction)__pyx_pw_11pygame_sdl2_10controller_10Controller_7quit, METH_NOARGS, __pyx_doc_11pygame_sdl2_10controller_10Controller_6quit}, {"get_init", (PyCFunction)__pyx_pw_11pygame_sdl2_10controller_10Controller_9get_init, METH_NOARGS, __pyx_doc_11pygame_sdl2_10controller_10Controller_8get_init}, {"get_axis", (PyCFunction)__pyx_pw_11pygame_sdl2_10controller_10Controller_11get_axis, METH_O, __pyx_doc_11pygame_sdl2_10controller_10Controller_10get_axis}, {"get_button", (PyCFunction)__pyx_pw_11pygame_sdl2_10controller_10Controller_13get_button, METH_O, __pyx_doc_11pygame_sdl2_10controller_10Controller_12get_button}, {"get_name", (PyCFunction)__pyx_pw_11pygame_sdl2_10controller_10Controller_15get_name, METH_NOARGS, __pyx_doc_11pygame_sdl2_10controller_10Controller_14get_name}, {"is_controller", (PyCFunction)__pyx_pw_11pygame_sdl2_10controller_10Controller_17is_controller, METH_NOARGS, __pyx_doc_11pygame_sdl2_10controller_10Controller_16is_controller}, {"get_guid_string", (PyCFunction)__pyx_pw_11pygame_sdl2_10controller_10Controller_19get_guid_string, METH_NOARGS, __pyx_doc_11pygame_sdl2_10controller_10Controller_18get_guid_string}, {0, 0, 0, 0} }; static PyTypeObject __pyx_type_11pygame_sdl2_10controller_Controller = { PyVarObject_HEAD_INIT(0, 0) "pygame_sdl2.controller.Controller", /*tp_name*/ sizeof(struct __pyx_obj_11pygame_sdl2_10controller_Controller), /*tp_basicsize*/ 0, /*tp_itemsize*/ __pyx_tp_dealloc_11pygame_sdl2_10controller_Controller, /*tp_dealloc*/ 0, /*tp_print*/ 0, /*tp_getattr*/ 0, /*tp_setattr*/ #if PY_MAJOR_VERSION < 3 0, /*tp_compare*/ #endif #if PY_MAJOR_VERSION >= 3 0, /*tp_as_async*/ #endif 0, /*tp_repr*/ 0, /*tp_as_number*/ 0, /*tp_as_sequence*/ 0, /*tp_as_mapping*/ 0, /*tp_hash*/ 0, /*tp_call*/ 0, /*tp_str*/ 0, /*tp_getattro*/ 0, /*tp_setattro*/ 0, /*tp_as_buffer*/ Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE, /*tp_flags*/ 0, /*tp_doc*/ 0, /*tp_traverse*/ 0, /*tp_clear*/ 0, /*tp_richcompare*/ 0, /*tp_weaklistoffset*/ 0, /*tp_iter*/ 0, /*tp_iternext*/ __pyx_methods_11pygame_sdl2_10controller_Controller, /*tp_methods*/ 0, /*tp_members*/ 0, /*tp_getset*/ 0, /*tp_base*/ 0, /*tp_dict*/ 0, /*tp_descr_get*/ 0, /*tp_descr_set*/ 0, /*tp_dictoffset*/ __pyx_pw_11pygame_sdl2_10controller_10Controller_3__init__, /*tp_init*/ 0, /*tp_alloc*/ __pyx_tp_new_11pygame_sdl2_10controller_Controller, /*tp_new*/ 0, /*tp_free*/ 0, /*tp_is_gc*/ 0, /*tp_bases*/ 0, /*tp_mro*/ 0, /*tp_cache*/ 0, /*tp_subclasses*/ 0, /*tp_weaklist*/ 0, /*tp_del*/ 0, /*tp_version_tag*/ #if PY_VERSION_HEX >= 0x030400a1 0, /*tp_finalize*/ #endif }; static PyMethodDef __pyx_methods[] = { {0, 0, 0, 0} }; #if PY_MAJOR_VERSION >= 3 static struct PyModuleDef __pyx_moduledef = { #if PY_VERSION_HEX < 0x03020000 { PyObject_HEAD_INIT(NULL) NULL, 0, NULL }, #else PyModuleDef_HEAD_INIT, #endif "controller", 0, /* m_doc */ -1, /* m_size */ __pyx_methods /* m_methods */, NULL, /* m_reload */ NULL, /* m_traverse */ NULL, /* m_clear */ NULL /* m_free */ }; #endif static __Pyx_StringTabEntry __pyx_string_tab[] = { {&__pyx_n_s_add_mapping, __pyx_k_add_mapping, sizeof(__pyx_k_add_mapping), 0, 0, 1, 1}, {&__pyx_n_s_add_mappings, __pyx_k_add_mappings, sizeof(__pyx_k_add_mappings), 0, 0, 1, 1}, {&__pyx_n_s_axis, __pyx_k_axis, sizeof(__pyx_k_axis), 0, 0, 1, 1}, {&__pyx_n_s_button, __pyx_k_button, sizeof(__pyx_k_button), 0, 0, 1, 1}, {&__pyx_kp_u_controller_not_initialized, __pyx_k_controller_not_initialized, sizeof(__pyx_k_controller_not_initialized), 0, 1, 0, 0}, {&__pyx_n_s_display, __pyx_k_display, sizeof(__pyx_k_display), 0, 0, 1, 1}, {&__pyx_n_s_error, __pyx_k_error, sizeof(__pyx_k_error), 0, 0, 1, 1}, {&__pyx_n_s_get_axis_from_string, __pyx_k_get_axis_from_string, sizeof(__pyx_k_get_axis_from_string), 0, 0, 1, 1}, {&__pyx_n_s_get_button_from_string, __pyx_k_get_button_from_string, sizeof(__pyx_k_get_button_from_string), 0, 0, 1, 1}, {&__pyx_n_s_get_count, __pyx_k_get_count, sizeof(__pyx_k_get_count), 0, 0, 1, 1}, {&__pyx_n_s_get_init, __pyx_k_get_init, sizeof(__pyx_k_get_init), 0, 0, 1, 1}, {&__pyx_n_s_get_string_for_axis, __pyx_k_get_string_for_axis, sizeof(__pyx_k_get_string_for_axis), 0, 0, 1, 1}, {&__pyx_n_s_get_string_for_button, __pyx_k_get_string_for_button, sizeof(__pyx_k_get_string_for_button), 0, 0, 1, 1}, {&__pyx_kp_s_home_tom_ab_pygame_sdl2_src_pyg, __pyx_k_home_tom_ab_pygame_sdl2_src_pyg, sizeof(__pyx_k_home_tom_ab_pygame_sdl2_src_pyg), 0, 0, 1, 0}, {&__pyx_n_s_import, __pyx_k_import, sizeof(__pyx_k_import), 0, 0, 1, 1}, {&__pyx_n_s_index, __pyx_k_index, sizeof(__pyx_k_index), 0, 0, 1, 1}, {&__pyx_n_s_init, __pyx_k_init, sizeof(__pyx_k_init), 0, 0, 1, 1}, {&__pyx_n_s_main, __pyx_k_main, sizeof(__pyx_k_main), 0, 0, 1, 1}, {&__pyx_n_s_mapping, __pyx_k_mapping, sizeof(__pyx_k_mapping), 0, 0, 1, 1}, {&__pyx_n_s_mapping_file, __pyx_k_mapping_file, sizeof(__pyx_k_mapping_file), 0, 0, 1, 1}, {&__pyx_n_s_name, __pyx_k_name, sizeof(__pyx_k_name), 0, 0, 1, 1}, {&__pyx_n_s_pygame_sdl2, __pyx_k_pygame_sdl2, sizeof(__pyx_k_pygame_sdl2), 0, 0, 1, 1}, {&__pyx_n_s_pygame_sdl2_controller, __pyx_k_pygame_sdl2_controller, sizeof(__pyx_k_pygame_sdl2_controller), 0, 0, 1, 1}, {&__pyx_n_s_pygame_sdl2_error, __pyx_k_pygame_sdl2_error, sizeof(__pyx_k_pygame_sdl2_error), 0, 0, 1, 1}, {&__pyx_n_s_quit, __pyx_k_quit, sizeof(__pyx_k_quit), 0, 0, 1, 1}, {&__pyx_n_s_register_init, __pyx_k_register_init, sizeof(__pyx_k_register_init), 0, 0, 1, 1}, {&__pyx_n_s_register_quit, __pyx_k_register_quit, sizeof(__pyx_k_register_quit), 0, 0, 1, 1}, {&__pyx_n_s_rv, __pyx_k_rv, sizeof(__pyx_k_rv), 0, 0, 1, 1}, {&__pyx_n_s_rwops, __pyx_k_rwops, sizeof(__pyx_k_rwops), 0, 0, 1, 1}, {&__pyx_n_s_sdl_main_init, __pyx_k_sdl_main_init, sizeof(__pyx_k_sdl_main_init), 0, 0, 1, 1}, {&__pyx_n_s_test, __pyx_k_test, sizeof(__pyx_k_test), 0, 0, 1, 1}, {0, 0, 0, 0, 0, 0, 0} }; static int __Pyx_InitCachedBuiltins(void) { return 0; } static int __Pyx_InitCachedConstants(void) { __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__Pyx_InitCachedConstants", 0); /* "pygame_sdl2/controller.pyx":191 * * if self.controller == NULL: * raise error("controller not initialized.") # <<<<<<<<<<<<<< * * return SDL_GameControllerGetAxis(self.controller, axis) */ __pyx_tuple_ = PyTuple_Pack(1, __pyx_kp_u_controller_not_initialized); if (unlikely(!__pyx_tuple_)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 191; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_tuple_); __Pyx_GIVEREF(__pyx_tuple_); /* "pygame_sdl2/controller.pyx":205 * * if self.controller == NULL: * raise error("controller not initialized.") # <<<<<<<<<<<<<< * * return SDL_GameControllerGetButton(self.controller, button) */ __pyx_tuple__2 = PyTuple_Pack(1, __pyx_kp_u_controller_not_initialized); if (unlikely(!__pyx_tuple__2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 205; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_tuple__2); __Pyx_GIVEREF(__pyx_tuple__2); /* "pygame_sdl2/controller.pyx":26 * * @pygame_sdl2.register_init * def init(): # <<<<<<<<<<<<<< * """ * Initializes game controller support. */ __pyx_codeobj__3 = (PyObject*)__Pyx_PyCode_New(0, 0, 0, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_tom_ab_pygame_sdl2_src_pyg, __pyx_n_s_init, 26, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 26; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "pygame_sdl2/controller.pyx":37 * * @pygame_sdl2.register_quit * def quit(): # @ReservedAssignment # <<<<<<<<<<<<<< * """ * Shuts down game controller support. */ __pyx_codeobj__4 = (PyObject*)__Pyx_PyCode_New(0, 0, 0, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_tom_ab_pygame_sdl2_src_pyg, __pyx_n_s_quit, 37, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 37; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "pygame_sdl2/controller.pyx":44 * SDL_QuitSubSystem(SDL_INIT_GAMECONTROLLER) * * def get_init(): # <<<<<<<<<<<<<< * """ * Returns true if game controller support has been initialized. */ __pyx_codeobj__5 = (PyObject*)__Pyx_PyCode_New(0, 0, 0, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_tom_ab_pygame_sdl2_src_pyg, __pyx_n_s_get_init, 44, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 44; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "pygame_sdl2/controller.pyx":51 * return SDL_WasInit(SDL_INIT_GAMECONTROLLER) != 0 * * def get_count(): # <<<<<<<<<<<<<< * """ * Returns the number of joysticks and game controllers connected to the */ __pyx_codeobj__6 = (PyObject*)__Pyx_PyCode_New(0, 0, 0, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_tom_ab_pygame_sdl2_src_pyg, __pyx_n_s_get_count, 51, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 51; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "pygame_sdl2/controller.pyx":66 * * * def add_mapping(mapping): # <<<<<<<<<<<<<< * """ * Adds a game controller mapping from the string in `mapping`. */ __pyx_tuple__7 = PyTuple_Pack(1, __pyx_n_s_mapping); if (unlikely(!__pyx_tuple__7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 66; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_tuple__7); __Pyx_GIVEREF(__pyx_tuple__7); __pyx_codeobj__8 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__7, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_tom_ab_pygame_sdl2_src_pyg, __pyx_n_s_add_mapping, 66, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 66; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "pygame_sdl2/controller.pyx":74 * raise error() * * def add_mappings(mapping_file): # <<<<<<<<<<<<<< * """ * Adds game controller mappings from `mapping_file`, which can be a string */ __pyx_tuple__9 = PyTuple_Pack(2, __pyx_n_s_mapping_file, __pyx_n_s_rwops); if (unlikely(!__pyx_tuple__9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 74; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_tuple__9); __Pyx_GIVEREF(__pyx_tuple__9); __pyx_codeobj__10 = (PyObject*)__Pyx_PyCode_New(1, 0, 2, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__9, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_tom_ab_pygame_sdl2_src_pyg, __pyx_n_s_add_mappings, 74, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 74; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "pygame_sdl2/controller.pyx":91 * raise error() * * def get_axis_from_string(name): # <<<<<<<<<<<<<< * """ * Returns the axis number of the controller axis with `name`, or */ __pyx_tuple__11 = PyTuple_Pack(1, __pyx_n_s_name); if (unlikely(!__pyx_tuple__11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 91; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_tuple__11); __Pyx_GIVEREF(__pyx_tuple__11); __pyx_codeobj__12 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__11, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_tom_ab_pygame_sdl2_src_pyg, __pyx_n_s_get_axis_from_string, 91, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__12)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 91; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "pygame_sdl2/controller.pyx":99 * return SDL_GameControllerGetAxisFromString(name) * * def get_button_from_string(name): # <<<<<<<<<<<<<< * """ * Returns the button number of the controller button with `name`, or */ __pyx_tuple__13 = PyTuple_Pack(1, __pyx_n_s_name); if (unlikely(!__pyx_tuple__13)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 99; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_tuple__13); __Pyx_GIVEREF(__pyx_tuple__13); __pyx_codeobj__14 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__13, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_tom_ab_pygame_sdl2_src_pyg, __pyx_n_s_get_button_from_string, 99, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__14)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 99; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "pygame_sdl2/controller.pyx":107 * return SDL_GameControllerGetButtonFromString(name) * * def get_string_for_axis(axis): # <<<<<<<<<<<<<< * """ * Returns a string describing the controller axis `axis`, which must be */ __pyx_tuple__15 = PyTuple_Pack(2, __pyx_n_s_axis, __pyx_n_s_rv); if (unlikely(!__pyx_tuple__15)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 107; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_tuple__15); __Pyx_GIVEREF(__pyx_tuple__15); __pyx_codeobj__16 = (PyObject*)__Pyx_PyCode_New(1, 0, 2, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__15, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_tom_ab_pygame_sdl2_src_pyg, __pyx_n_s_get_string_for_axis, 107, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__16)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 107; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "pygame_sdl2/controller.pyx":120 * return None * * def get_string_for_button(button): # <<<<<<<<<<<<<< * """ * Returns a string describing the controller button `button`, which must be */ __pyx_tuple__17 = PyTuple_Pack(2, __pyx_n_s_button, __pyx_n_s_rv); if (unlikely(!__pyx_tuple__17)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 120; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_tuple__17); __Pyx_GIVEREF(__pyx_tuple__17); __pyx_codeobj__18 = (PyObject*)__Pyx_PyCode_New(1, 0, 2, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__17, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_tom_ab_pygame_sdl2_src_pyg, __pyx_n_s_get_string_for_button, 120, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__18)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 120; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_RefNannyFinishContext(); return 0; __pyx_L1_error:; __Pyx_RefNannyFinishContext(); return -1; } static int __Pyx_InitGlobals(void) { if (__Pyx_InitStrings(__pyx_string_tab) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; return 0; __pyx_L1_error:; return -1; } #if PY_MAJOR_VERSION < 3 PyMODINIT_FUNC initcontroller(void); /*proto*/ PyMODINIT_FUNC initcontroller(void) #else PyMODINIT_FUNC PyInit_controller(void); /*proto*/ PyMODINIT_FUNC PyInit_controller(void) #endif { PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; PyObject *__pyx_t_5 = NULL; PyObject *__pyx_t_6 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannyDeclarations #if CYTHON_REFNANNY __Pyx_RefNanny = __Pyx_RefNannyImportAPI("refnanny"); if (!__Pyx_RefNanny) { PyErr_Clear(); __Pyx_RefNanny = __Pyx_RefNannyImportAPI("Cython.Runtime.refnanny"); if (!__Pyx_RefNanny) Py_FatalError("failed to import 'refnanny' module"); } #endif __Pyx_RefNannySetupContext("PyMODINIT_FUNC PyInit_controller(void)", 0); if (__Pyx_check_binary_version() < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_empty_tuple = PyTuple_New(0); if (unlikely(!__pyx_empty_tuple)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_empty_bytes = PyBytes_FromStringAndSize("", 0); if (unlikely(!__pyx_empty_bytes)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} #ifdef __Pyx_CyFunction_USED if (__pyx_CyFunction_init() < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} #endif #ifdef __Pyx_FusedFunction_USED if (__pyx_FusedFunction_init() < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} #endif #ifdef __Pyx_Coroutine_USED if (__pyx_Coroutine_init() < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} #endif #ifdef __Pyx_Generator_USED if (__pyx_Generator_init() < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} #endif #ifdef __Pyx_StopAsyncIteration_USED if (__pyx_StopAsyncIteration_init() < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} #endif /*--- Library function declarations ---*/ /*--- Threads initialization code ---*/ #if defined(__PYX_FORCE_INIT_THREADS) && __PYX_FORCE_INIT_THREADS #ifdef WITH_THREAD /* Python build with threading support? */ PyEval_InitThreads(); #endif #endif /*--- Module creation code ---*/ #if PY_MAJOR_VERSION < 3 __pyx_m = Py_InitModule4("controller", __pyx_methods, 0, 0, PYTHON_API_VERSION); Py_XINCREF(__pyx_m); #else __pyx_m = PyModule_Create(&__pyx_moduledef); #endif if (unlikely(!__pyx_m)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_d = PyModule_GetDict(__pyx_m); if (unlikely(!__pyx_d)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} Py_INCREF(__pyx_d); __pyx_b = PyImport_AddModule(__Pyx_BUILTIN_MODULE_NAME); if (unlikely(!__pyx_b)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} #if CYTHON_COMPILING_IN_PYPY Py_INCREF(__pyx_b); #endif if (PyObject_SetAttrString(__pyx_m, "__builtins__", __pyx_b) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; /*--- Initialize various global constants etc. ---*/ if (__Pyx_InitGlobals() < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} #if PY_MAJOR_VERSION < 3 && (__PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT) if (__Pyx_init_sys_getdefaultencoding_params() < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} #endif if (__pyx_module_is_main_pygame_sdl2__controller) { if (PyObject_SetAttrString(__pyx_m, "__name__", __pyx_n_s_main) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } #if PY_MAJOR_VERSION >= 3 { PyObject *modules = PyImport_GetModuleDict(); if (unlikely(!modules)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} if (!PyDict_GetItemString(modules, "pygame_sdl2.controller")) { if (unlikely(PyDict_SetItemString(modules, "pygame_sdl2.controller", __pyx_m) < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } } #endif /*--- Builtin init code ---*/ if (__Pyx_InitCachedBuiltins() < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /*--- Constants init code ---*/ if (__Pyx_InitCachedConstants() < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /*--- Global init code ---*/ /*--- Variable export code ---*/ /*--- Function export code ---*/ /*--- Type init code ---*/ if (PyType_Ready(&__pyx_type_11pygame_sdl2_10controller_Controller) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 134; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_type_11pygame_sdl2_10controller_Controller.tp_print = 0; #if CYTHON_COMPILING_IN_CPYTHON { PyObject *wrapper = PyObject_GetAttrString((PyObject *)&__pyx_type_11pygame_sdl2_10controller_Controller, "__init__"); if (unlikely(!wrapper)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 134; __pyx_clineno = __LINE__; goto __pyx_L1_error;} if (Py_TYPE(wrapper) == &PyWrapperDescr_Type) { __pyx_wrapperbase_11pygame_sdl2_10controller_10Controller_2__init__ = *((PyWrapperDescrObject *)wrapper)->d_base; __pyx_wrapperbase_11pygame_sdl2_10controller_10Controller_2__init__.doc = __pyx_doc_11pygame_sdl2_10controller_10Controller_2__init__; ((PyWrapperDescrObject *)wrapper)->d_base = &__pyx_wrapperbase_11pygame_sdl2_10controller_10Controller_2__init__; } } #endif if (PyObject_SetAttrString(__pyx_m, "Controller", (PyObject *)&__pyx_type_11pygame_sdl2_10controller_Controller) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 134; __pyx_clineno = __LINE__; goto __pyx_L1_error;} if (__pyx_type_11pygame_sdl2_10controller_Controller.tp_weaklistoffset == 0) __pyx_type_11pygame_sdl2_10controller_Controller.tp_weaklistoffset = offsetof(struct __pyx_obj_11pygame_sdl2_10controller_Controller, __weakref__); __pyx_ptype_11pygame_sdl2_10controller_Controller = &__pyx_type_11pygame_sdl2_10controller_Controller; /*--- Type import code ---*/ /*--- Variable import code ---*/ /*--- Function import code ---*/ __pyx_t_1 = __Pyx_ImportModule("pygame_sdl2.rwobject"); if (!__pyx_t_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} if (__Pyx_ImportFunction(__pyx_t_1, "to_rwops", (void (**)(void))&__pyx_f_11pygame_sdl2_8rwobject_to_rwops, "SDL_RWops *(PyObject *, struct __pyx_opt_args_11pygame_sdl2_8rwobject_to_rwops *__pyx_optional_args)") < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} Py_DECREF(__pyx_t_1); __pyx_t_1 = 0; /*--- Execution code ---*/ #if defined(__Pyx_Generator_USED) || defined(__Pyx_Coroutine_USED) if (__Pyx_patch_abc() < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} #endif /* "pygame_sdl2/controller.pyx":20 * * from sdl2 cimport * * from pygame_sdl2.error import error # <<<<<<<<<<<<<< * import pygame_sdl2 * */ __pyx_t_2 = PyList_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 20; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __Pyx_INCREF(__pyx_n_s_error); __Pyx_GIVEREF(__pyx_n_s_error); PyList_SET_ITEM(__pyx_t_2, 0, __pyx_n_s_error); __pyx_t_3 = __Pyx_Import(__pyx_n_s_pygame_sdl2_error, __pyx_t_2, 0); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 20; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_2 = __Pyx_ImportFrom(__pyx_t_3, __pyx_n_s_error); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 20; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_error, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 20; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "pygame_sdl2/controller.pyx":21 * from sdl2 cimport * * from pygame_sdl2.error import error * import pygame_sdl2 # <<<<<<<<<<<<<< * * from pygame_sdl2.rwobject cimport to_rwops */ __pyx_t_3 = __Pyx_Import(__pyx_n_s_pygame_sdl2, 0, 0); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 21; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); if (PyDict_SetItem(__pyx_d, __pyx_n_s_pygame_sdl2, __pyx_t_3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 21; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "pygame_sdl2/controller.pyx":25 * from pygame_sdl2.rwobject cimport to_rwops * * @pygame_sdl2.register_init # <<<<<<<<<<<<<< * def init(): * """ */ __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_pygame_sdl2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 25; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_register_init); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 25; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "pygame_sdl2/controller.pyx":26 * * @pygame_sdl2.register_init * def init(): # <<<<<<<<<<<<<< * """ * Initializes game controller support. */ __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_11pygame_sdl2_10controller_1init, NULL, __pyx_n_s_pygame_sdl2_controller); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 26; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __pyx_t_5 = NULL; if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_4))) { __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4); if (likely(__pyx_t_5)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4); __Pyx_INCREF(__pyx_t_5); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_4, function); } } if (!__pyx_t_5) { __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 25; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_GOTREF(__pyx_t_3); } else { __pyx_t_6 = PyTuple_New(1+1); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 25; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_6); __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_5); __pyx_t_5 = NULL; __Pyx_GIVEREF(__pyx_t_2); PyTuple_SET_ITEM(__pyx_t_6, 0+1, __pyx_t_2); __pyx_t_2 = 0; __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_6, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 25; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; } __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; if (PyDict_SetItem(__pyx_d, __pyx_n_s_init, __pyx_t_3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 26; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "pygame_sdl2/controller.pyx":36 * raise error() * * @pygame_sdl2.register_quit # <<<<<<<<<<<<<< * def quit(): # @ReservedAssignment * """ */ __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_pygame_sdl2); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 36; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_register_quit); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 36; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; /* "pygame_sdl2/controller.pyx":37 * * @pygame_sdl2.register_quit * def quit(): # @ReservedAssignment # <<<<<<<<<<<<<< * """ * Shuts down game controller support. */ __pyx_t_4 = PyCFunction_NewEx(&__pyx_mdef_11pygame_sdl2_10controller_3quit, NULL, __pyx_n_s_pygame_sdl2_controller); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 37; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); __pyx_t_2 = NULL; if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_6))) { __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_6); if (likely(__pyx_t_2)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6); __Pyx_INCREF(__pyx_t_2); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_6, function); } } if (!__pyx_t_2) { __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_t_6, __pyx_t_4); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 36; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_GOTREF(__pyx_t_3); } else { __pyx_t_5 = PyTuple_New(1+1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 36; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); __Pyx_GIVEREF(__pyx_t_2); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_2); __pyx_t_2 = NULL; __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_5, 0+1, __pyx_t_4); __pyx_t_4 = 0; __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_5, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 36; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; } __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; if (PyDict_SetItem(__pyx_d, __pyx_n_s_quit, __pyx_t_3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 37; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "pygame_sdl2/controller.pyx":44 * SDL_QuitSubSystem(SDL_INIT_GAMECONTROLLER) * * def get_init(): # <<<<<<<<<<<<<< * """ * Returns true if game controller support has been initialized. */ __pyx_t_3 = PyCFunction_NewEx(&__pyx_mdef_11pygame_sdl2_10controller_5get_init, NULL, __pyx_n_s_pygame_sdl2_controller); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 44; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); if (PyDict_SetItem(__pyx_d, __pyx_n_s_get_init, __pyx_t_3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 44; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "pygame_sdl2/controller.pyx":51 * return SDL_WasInit(SDL_INIT_GAMECONTROLLER) != 0 * * def get_count(): # <<<<<<<<<<<<<< * """ * Returns the number of joysticks and game controllers connected to the */ __pyx_t_3 = PyCFunction_NewEx(&__pyx_mdef_11pygame_sdl2_10controller_7get_count, NULL, __pyx_n_s_pygame_sdl2_controller); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 51; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); if (PyDict_SetItem(__pyx_d, __pyx_n_s_get_count, __pyx_t_3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 51; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "pygame_sdl2/controller.pyx":66 * * * def add_mapping(mapping): # <<<<<<<<<<<<<< * """ * Adds a game controller mapping from the string in `mapping`. */ __pyx_t_3 = PyCFunction_NewEx(&__pyx_mdef_11pygame_sdl2_10controller_9add_mapping, NULL, __pyx_n_s_pygame_sdl2_controller); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 66; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); if (PyDict_SetItem(__pyx_d, __pyx_n_s_add_mapping, __pyx_t_3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 66; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "pygame_sdl2/controller.pyx":74 * raise error() * * def add_mappings(mapping_file): # <<<<<<<<<<<<<< * """ * Adds game controller mappings from `mapping_file`, which can be a string */ __pyx_t_3 = PyCFunction_NewEx(&__pyx_mdef_11pygame_sdl2_10controller_11add_mappings, NULL, __pyx_n_s_pygame_sdl2_controller); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 74; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); if (PyDict_SetItem(__pyx_d, __pyx_n_s_add_mappings, __pyx_t_3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 74; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "pygame_sdl2/controller.pyx":91 * raise error() * * def get_axis_from_string(name): # <<<<<<<<<<<<<< * """ * Returns the axis number of the controller axis with `name`, or */ __pyx_t_3 = PyCFunction_NewEx(&__pyx_mdef_11pygame_sdl2_10controller_13get_axis_from_string, NULL, __pyx_n_s_pygame_sdl2_controller); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 91; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); if (PyDict_SetItem(__pyx_d, __pyx_n_s_get_axis_from_string, __pyx_t_3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 91; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "pygame_sdl2/controller.pyx":99 * return SDL_GameControllerGetAxisFromString(name) * * def get_button_from_string(name): # <<<<<<<<<<<<<< * """ * Returns the button number of the controller button with `name`, or */ __pyx_t_3 = PyCFunction_NewEx(&__pyx_mdef_11pygame_sdl2_10controller_15get_button_from_string, NULL, __pyx_n_s_pygame_sdl2_controller); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 99; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); if (PyDict_SetItem(__pyx_d, __pyx_n_s_get_button_from_string, __pyx_t_3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 99; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "pygame_sdl2/controller.pyx":107 * return SDL_GameControllerGetButtonFromString(name) * * def get_string_for_axis(axis): # <<<<<<<<<<<<<< * """ * Returns a string describing the controller axis `axis`, which must be */ __pyx_t_3 = PyCFunction_NewEx(&__pyx_mdef_11pygame_sdl2_10controller_17get_string_for_axis, NULL, __pyx_n_s_pygame_sdl2_controller); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 107; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); if (PyDict_SetItem(__pyx_d, __pyx_n_s_get_string_for_axis, __pyx_t_3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 107; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "pygame_sdl2/controller.pyx":120 * return None * * def get_string_for_button(button): # <<<<<<<<<<<<<< * """ * Returns a string describing the controller button `button`, which must be */ __pyx_t_3 = PyCFunction_NewEx(&__pyx_mdef_11pygame_sdl2_10controller_19get_string_for_button, NULL, __pyx_n_s_pygame_sdl2_controller); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 120; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); if (PyDict_SetItem(__pyx_d, __pyx_n_s_get_string_for_button, __pyx_t_3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 120; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "pygame_sdl2/controller.pyx":1 * # Copyright 2015 Tom Rothamel # <<<<<<<<<<<<<< * # * # This software is provided 'as-is', without any express or implied */ __pyx_t_3 = PyDict_New(); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); if (PyDict_SetItem(__pyx_d, __pyx_n_s_test, __pyx_t_3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /*--- Wrapped vars code ---*/ goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_5); __Pyx_XDECREF(__pyx_t_6); if (__pyx_m) { if (__pyx_d) { __Pyx_AddTraceback("init pygame_sdl2.controller", __pyx_clineno, __pyx_lineno, __pyx_filename); } Py_DECREF(__pyx_m); __pyx_m = 0; } else if (!PyErr_Occurred()) { PyErr_SetString(PyExc_ImportError, "init pygame_sdl2.controller"); } __pyx_L0:; __Pyx_RefNannyFinishContext(); #if PY_MAJOR_VERSION < 3 return; #else return __pyx_m; #endif } /* --- Runtime support code --- */ #if CYTHON_REFNANNY static __Pyx_RefNannyAPIStruct *__Pyx_RefNannyImportAPI(const char *modname) { PyObject *m = NULL, *p = NULL; void *r = NULL; m = PyImport_ImportModule((char *)modname); if (!m) goto end; p = PyObject_GetAttrString(m, (char *)"RefNannyAPI"); if (!p) goto end; r = PyLong_AsVoidPtr(p); end: Py_XDECREF(p); Py_XDECREF(m); return (__Pyx_RefNannyAPIStruct *)r; } #endif static PyObject *__Pyx_GetBuiltinName(PyObject *name) { PyObject* result = __Pyx_PyObject_GetAttrStr(__pyx_b, name); if (unlikely(!result)) { PyErr_Format(PyExc_NameError, #if PY_MAJOR_VERSION >= 3 "name '%U' is not defined", name); #else "name '%.200s' is not defined", PyString_AS_STRING(name)); #endif } return result; } static CYTHON_INLINE PyObject *__Pyx_GetModuleGlobalName(PyObject *name) { PyObject *result; #if CYTHON_COMPILING_IN_CPYTHON result = PyDict_GetItem(__pyx_d, name); if (likely(result)) { Py_INCREF(result); } else { #else result = PyObject_GetItem(__pyx_d, name); if (!result) { PyErr_Clear(); #endif result = __Pyx_GetBuiltinName(name); } return result; } #if CYTHON_COMPILING_IN_CPYTHON static CYTHON_INLINE PyObject* __Pyx_PyObject_Call(PyObject *func, PyObject *arg, PyObject *kw) { PyObject *result; ternaryfunc call = func->ob_type->tp_call; if (unlikely(!call)) return PyObject_Call(func, arg, kw); if (unlikely(Py_EnterRecursiveCall((char*)" while calling a Python object"))) return NULL; result = (*call)(func, arg, kw); Py_LeaveRecursiveCall(); if (unlikely(!result) && unlikely(!PyErr_Occurred())) { PyErr_SetString( PyExc_SystemError, "NULL result without error in PyObject_Call"); } return result; } #endif #if CYTHON_COMPILING_IN_CPYTHON static CYTHON_INLINE PyObject* __Pyx_PyObject_CallMethO(PyObject *func, PyObject *arg) { PyObject *self, *result; PyCFunction cfunc; cfunc = PyCFunction_GET_FUNCTION(func); self = PyCFunction_GET_SELF(func); if (unlikely(Py_EnterRecursiveCall((char*)" while calling a Python object"))) return NULL; result = cfunc(self, arg); Py_LeaveRecursiveCall(); if (unlikely(!result) && unlikely(!PyErr_Occurred())) { PyErr_SetString( PyExc_SystemError, "NULL result without error in PyObject_Call"); } return result; } #endif #if CYTHON_COMPILING_IN_CPYTHON static PyObject* __Pyx__PyObject_CallOneArg(PyObject *func, PyObject *arg) { PyObject *result; PyObject *args = PyTuple_New(1); if (unlikely(!args)) return NULL; Py_INCREF(arg); PyTuple_SET_ITEM(args, 0, arg); result = __Pyx_PyObject_Call(func, args, NULL); Py_DECREF(args); return result; } static CYTHON_INLINE PyObject* __Pyx_PyObject_CallOneArg(PyObject *func, PyObject *arg) { #ifdef __Pyx_CyFunction_USED if (likely(PyCFunction_Check(func) || PyObject_TypeCheck(func, __pyx_CyFunctionType))) { #else if (likely(PyCFunction_Check(func))) { #endif if (likely(PyCFunction_GET_FLAGS(func) & METH_O)) { return __Pyx_PyObject_CallMethO(func, arg); } } return __Pyx__PyObject_CallOneArg(func, arg); } #else static CYTHON_INLINE PyObject* __Pyx_PyObject_CallOneArg(PyObject *func, PyObject *arg) { PyObject* args = PyTuple_Pack(1, arg); return (likely(args)) ? __Pyx_PyObject_Call(func, args, NULL) : NULL; } #endif #if CYTHON_COMPILING_IN_CPYTHON static CYTHON_INLINE PyObject* __Pyx_PyObject_CallNoArg(PyObject *func) { #ifdef __Pyx_CyFunction_USED if (likely(PyCFunction_Check(func) || PyObject_TypeCheck(func, __pyx_CyFunctionType))) { #else if (likely(PyCFunction_Check(func))) { #endif if (likely(PyCFunction_GET_FLAGS(func) & METH_NOARGS)) { return __Pyx_PyObject_CallMethO(func, NULL); } } return __Pyx_PyObject_Call(func, __pyx_empty_tuple, NULL); } #endif static CYTHON_INLINE void __Pyx_ErrRestore(PyObject *type, PyObject *value, PyObject *tb) { #if CYTHON_COMPILING_IN_CPYTHON PyObject *tmp_type, *tmp_value, *tmp_tb; PyThreadState *tstate = PyThreadState_GET(); tmp_type = tstate->curexc_type; tmp_value = tstate->curexc_value; tmp_tb = tstate->curexc_traceback; tstate->curexc_type = type; tstate->curexc_value = value; tstate->curexc_traceback = tb; Py_XDECREF(tmp_type); Py_XDECREF(tmp_value); Py_XDECREF(tmp_tb); #else PyErr_Restore(type, value, tb); #endif } static CYTHON_INLINE void __Pyx_ErrFetch(PyObject **type, PyObject **value, PyObject **tb) { #if CYTHON_COMPILING_IN_CPYTHON PyThreadState *tstate = PyThreadState_GET(); *type = tstate->curexc_type; *value = tstate->curexc_value; *tb = tstate->curexc_traceback; tstate->curexc_type = 0; tstate->curexc_value = 0; tstate->curexc_traceback = 0; #else PyErr_Fetch(type, value, tb); #endif } #if PY_MAJOR_VERSION < 3 static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, CYTHON_UNUSED PyObject *cause) { Py_XINCREF(type); if (!value || value == Py_None) value = NULL; else Py_INCREF(value); if (!tb || tb == Py_None) tb = NULL; else { Py_INCREF(tb); if (!PyTraceBack_Check(tb)) { PyErr_SetString(PyExc_TypeError, "raise: arg 3 must be a traceback or None"); goto raise_error; } } if (PyType_Check(type)) { #if CYTHON_COMPILING_IN_PYPY if (!value) { Py_INCREF(Py_None); value = Py_None; } #endif PyErr_NormalizeException(&type, &value, &tb); } else { if (value) { PyErr_SetString(PyExc_TypeError, "instance exception may not have a separate value"); goto raise_error; } value = type; type = (PyObject*) Py_TYPE(type); Py_INCREF(type); if (!PyType_IsSubtype((PyTypeObject *)type, (PyTypeObject *)PyExc_BaseException)) { PyErr_SetString(PyExc_TypeError, "raise: exception class must be a subclass of BaseException"); goto raise_error; } } __Pyx_ErrRestore(type, value, tb); return; raise_error: Py_XDECREF(value); Py_XDECREF(type); Py_XDECREF(tb); return; } #else static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, PyObject *cause) { PyObject* owned_instance = NULL; if (tb == Py_None) { tb = 0; } else if (tb && !PyTraceBack_Check(tb)) { PyErr_SetString(PyExc_TypeError, "raise: arg 3 must be a traceback or None"); goto bad; } if (value == Py_None) value = 0; if (PyExceptionInstance_Check(type)) { if (value) { PyErr_SetString(PyExc_TypeError, "instance exception may not have a separate value"); goto bad; } value = type; type = (PyObject*) Py_TYPE(value); } else if (PyExceptionClass_Check(type)) { PyObject *instance_class = NULL; if (value && PyExceptionInstance_Check(value)) { instance_class = (PyObject*) Py_TYPE(value); if (instance_class != type) { int is_subclass = PyObject_IsSubclass(instance_class, type); if (!is_subclass) { instance_class = NULL; } else if (unlikely(is_subclass == -1)) { goto bad; } else { type = instance_class; } } } if (!instance_class) { PyObject *args; if (!value) args = PyTuple_New(0); else if (PyTuple_Check(value)) { Py_INCREF(value); args = value; } else args = PyTuple_Pack(1, value); if (!args) goto bad; owned_instance = PyObject_Call(type, args, NULL); Py_DECREF(args); if (!owned_instance) goto bad; value = owned_instance; if (!PyExceptionInstance_Check(value)) { PyErr_Format(PyExc_TypeError, "calling %R should have returned an instance of " "BaseException, not %R", type, Py_TYPE(value)); goto bad; } } } else { PyErr_SetString(PyExc_TypeError, "raise: exception class must be a subclass of BaseException"); goto bad; } #if PY_VERSION_HEX >= 0x03030000 if (cause) { #else if (cause && cause != Py_None) { #endif PyObject *fixed_cause; if (cause == Py_None) { fixed_cause = NULL; } else if (PyExceptionClass_Check(cause)) { fixed_cause = PyObject_CallObject(cause, NULL); if (fixed_cause == NULL) goto bad; } else if (PyExceptionInstance_Check(cause)) { fixed_cause = cause; Py_INCREF(fixed_cause); } else { PyErr_SetString(PyExc_TypeError, "exception causes must derive from " "BaseException"); goto bad; } PyException_SetCause(value, fixed_cause); } PyErr_SetObject(type, value); if (tb) { #if CYTHON_COMPILING_IN_PYPY PyObject *tmp_type, *tmp_value, *tmp_tb; PyErr_Fetch(&tmp_type, &tmp_value, &tmp_tb); Py_INCREF(tb); PyErr_Restore(tmp_type, tmp_value, tb); Py_XDECREF(tmp_tb); #else PyThreadState *tstate = PyThreadState_GET(); PyObject* tmp_tb = tstate->curexc_traceback; if (tb != tmp_tb) { Py_INCREF(tb); tstate->curexc_traceback = tb; Py_XDECREF(tmp_tb); } #endif } bad: Py_XDECREF(owned_instance); return; } #endif static void __Pyx_RaiseArgtupleInvalid( const char* func_name, int exact, Py_ssize_t num_min, Py_ssize_t num_max, Py_ssize_t num_found) { Py_ssize_t num_expected; const char *more_or_less; if (num_found < num_min) { num_expected = num_min; more_or_less = "at least"; } else { num_expected = num_max; more_or_less = "at most"; } if (exact) { more_or_less = "exactly"; } PyErr_Format(PyExc_TypeError, "%.200s() takes %.8s %" CYTHON_FORMAT_SSIZE_T "d positional argument%.1s (%" CYTHON_FORMAT_SSIZE_T "d given)", func_name, more_or_less, num_expected, (num_expected == 1) ? "" : "s", num_found); } static CYTHON_INLINE int __Pyx_CheckKeywordStrings( PyObject *kwdict, const char* function_name, int kw_allowed) { PyObject* key = 0; Py_ssize_t pos = 0; #if CYTHON_COMPILING_IN_PYPY if (!kw_allowed && PyDict_Next(kwdict, &pos, &key, 0)) goto invalid_keyword; return 1; #else while (PyDict_Next(kwdict, &pos, &key, 0)) { #if PY_MAJOR_VERSION < 3 if (unlikely(!PyString_CheckExact(key)) && unlikely(!PyString_Check(key))) #endif if (unlikely(!PyUnicode_Check(key))) goto invalid_keyword_type; } if ((!kw_allowed) && unlikely(key)) goto invalid_keyword; return 1; invalid_keyword_type: PyErr_Format(PyExc_TypeError, "%.200s() keywords must be strings", function_name); return 0; #endif invalid_keyword: PyErr_Format(PyExc_TypeError, #if PY_MAJOR_VERSION < 3 "%.200s() got an unexpected keyword argument '%.200s'", function_name, PyString_AsString(key)); #else "%s() got an unexpected keyword argument '%U'", function_name, key); #endif return 0; } static void __Pyx_RaiseDoubleKeywordsError( const char* func_name, PyObject* kw_name) { PyErr_Format(PyExc_TypeError, #if PY_MAJOR_VERSION >= 3 "%s() got multiple values for keyword argument '%U'", func_name, kw_name); #else "%s() got multiple values for keyword argument '%s'", func_name, PyString_AsString(kw_name)); #endif } static int __Pyx_ParseOptionalKeywords( PyObject *kwds, PyObject **argnames[], PyObject *kwds2, PyObject *values[], Py_ssize_t num_pos_args, const char* function_name) { PyObject *key = 0, *value = 0; Py_ssize_t pos = 0; PyObject*** name; PyObject*** first_kw_arg = argnames + num_pos_args; while (PyDict_Next(kwds, &pos, &key, &value)) { name = first_kw_arg; while (*name && (**name != key)) name++; if (*name) { values[name-argnames] = value; continue; } name = first_kw_arg; #if PY_MAJOR_VERSION < 3 if (likely(PyString_CheckExact(key)) || likely(PyString_Check(key))) { while (*name) { if ((CYTHON_COMPILING_IN_PYPY || PyString_GET_SIZE(**name) == PyString_GET_SIZE(key)) && _PyString_Eq(**name, key)) { values[name-argnames] = value; break; } name++; } if (*name) continue; else { PyObject*** argname = argnames; while (argname != first_kw_arg) { if ((**argname == key) || ( (CYTHON_COMPILING_IN_PYPY || PyString_GET_SIZE(**argname) == PyString_GET_SIZE(key)) && _PyString_Eq(**argname, key))) { goto arg_passed_twice; } argname++; } } } else #endif if (likely(PyUnicode_Check(key))) { while (*name) { int cmp = (**name == key) ? 0 : #if !CYTHON_COMPILING_IN_PYPY && PY_MAJOR_VERSION >= 3 (PyUnicode_GET_SIZE(**name) != PyUnicode_GET_SIZE(key)) ? 1 : #endif PyUnicode_Compare(**name, key); if (cmp < 0 && unlikely(PyErr_Occurred())) goto bad; if (cmp == 0) { values[name-argnames] = value; break; } name++; } if (*name) continue; else { PyObject*** argname = argnames; while (argname != first_kw_arg) { int cmp = (**argname == key) ? 0 : #if !CYTHON_COMPILING_IN_PYPY && PY_MAJOR_VERSION >= 3 (PyUnicode_GET_SIZE(**argname) != PyUnicode_GET_SIZE(key)) ? 1 : #endif PyUnicode_Compare(**argname, key); if (cmp < 0 && unlikely(PyErr_Occurred())) goto bad; if (cmp == 0) goto arg_passed_twice; argname++; } } } else goto invalid_keyword_type; if (kwds2) { if (unlikely(PyDict_SetItem(kwds2, key, value))) goto bad; } else { goto invalid_keyword; } } return 0; arg_passed_twice: __Pyx_RaiseDoubleKeywordsError(function_name, key); goto bad; invalid_keyword_type: PyErr_Format(PyExc_TypeError, "%.200s() keywords must be strings", function_name); goto bad; invalid_keyword: PyErr_Format(PyExc_TypeError, #if PY_MAJOR_VERSION < 3 "%.200s() got an unexpected keyword argument '%.200s'", function_name, PyString_AsString(key)); #else "%s() got an unexpected keyword argument '%U'", function_name, key); #endif bad: return -1; } static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list, int level) { PyObject *empty_list = 0; PyObject *module = 0; PyObject *global_dict = 0; PyObject *empty_dict = 0; PyObject *list; #if PY_VERSION_HEX < 0x03030000 PyObject *py_import; py_import = __Pyx_PyObject_GetAttrStr(__pyx_b, __pyx_n_s_import); if (!py_import) goto bad; #endif if (from_list) list = from_list; else { empty_list = PyList_New(0); if (!empty_list) goto bad; list = empty_list; } global_dict = PyModule_GetDict(__pyx_m); if (!global_dict) goto bad; empty_dict = PyDict_New(); if (!empty_dict) goto bad; { #if PY_MAJOR_VERSION >= 3 if (level == -1) { if (strchr(__Pyx_MODULE_NAME, '.')) { #if PY_VERSION_HEX < 0x03030000 PyObject *py_level = PyInt_FromLong(1); if (!py_level) goto bad; module = PyObject_CallFunctionObjArgs(py_import, name, global_dict, empty_dict, list, py_level, NULL); Py_DECREF(py_level); #else module = PyImport_ImportModuleLevelObject( name, global_dict, empty_dict, list, 1); #endif if (!module) { if (!PyErr_ExceptionMatches(PyExc_ImportError)) goto bad; PyErr_Clear(); } } level = 0; } #endif if (!module) { #if PY_VERSION_HEX < 0x03030000 PyObject *py_level = PyInt_FromLong(level); if (!py_level) goto bad; module = PyObject_CallFunctionObjArgs(py_import, name, global_dict, empty_dict, list, py_level, NULL); Py_DECREF(py_level); #else module = PyImport_ImportModuleLevelObject( name, global_dict, empty_dict, list, level); #endif } } bad: #if PY_VERSION_HEX < 0x03030000 Py_XDECREF(py_import); #endif Py_XDECREF(empty_list); Py_XDECREF(empty_dict); return module; } static PyObject* __Pyx_ImportFrom(PyObject* module, PyObject* name) { PyObject* value = __Pyx_PyObject_GetAttrStr(module, name); if (unlikely(!value) && PyErr_ExceptionMatches(PyExc_AttributeError)) { PyErr_Format(PyExc_ImportError, #if PY_MAJOR_VERSION < 3 "cannot import name %.230s", PyString_AS_STRING(name)); #else "cannot import name %S", name); #endif } return value; } static int __pyx_bisect_code_objects(__Pyx_CodeObjectCacheEntry* entries, int count, int code_line) { int start = 0, mid = 0, end = count - 1; if (end >= 0 && code_line > entries[end].code_line) { return count; } while (start < end) { mid = start + (end - start) / 2; if (code_line < entries[mid].code_line) { end = mid; } else if (code_line > entries[mid].code_line) { start = mid + 1; } else { return mid; } } if (code_line <= entries[mid].code_line) { return mid; } else { return mid + 1; } } static PyCodeObject *__pyx_find_code_object(int code_line) { PyCodeObject* code_object; int pos; if (unlikely(!code_line) || unlikely(!__pyx_code_cache.entries)) { return NULL; } pos = __pyx_bisect_code_objects(__pyx_code_cache.entries, __pyx_code_cache.count, code_line); if (unlikely(pos >= __pyx_code_cache.count) || unlikely(__pyx_code_cache.entries[pos].code_line != code_line)) { return NULL; } code_object = __pyx_code_cache.entries[pos].code_object; Py_INCREF(code_object); return code_object; } static void __pyx_insert_code_object(int code_line, PyCodeObject* code_object) { int pos, i; __Pyx_CodeObjectCacheEntry* entries = __pyx_code_cache.entries; if (unlikely(!code_line)) { return; } if (unlikely(!entries)) { entries = (__Pyx_CodeObjectCacheEntry*)PyMem_Malloc(64*sizeof(__Pyx_CodeObjectCacheEntry)); if (likely(entries)) { __pyx_code_cache.entries = entries; __pyx_code_cache.max_count = 64; __pyx_code_cache.count = 1; entries[0].code_line = code_line; entries[0].code_object = code_object; Py_INCREF(code_object); } return; } pos = __pyx_bisect_code_objects(__pyx_code_cache.entries, __pyx_code_cache.count, code_line); if ((pos < __pyx_code_cache.count) && unlikely(__pyx_code_cache.entries[pos].code_line == code_line)) { PyCodeObject* tmp = entries[pos].code_object; entries[pos].code_object = code_object; Py_DECREF(tmp); return; } if (__pyx_code_cache.count == __pyx_code_cache.max_count) { int new_max = __pyx_code_cache.max_count + 64; entries = (__Pyx_CodeObjectCacheEntry*)PyMem_Realloc( __pyx_code_cache.entries, (size_t)new_max*sizeof(__Pyx_CodeObjectCacheEntry)); if (unlikely(!entries)) { return; } __pyx_code_cache.entries = entries; __pyx_code_cache.max_count = new_max; } for (i=__pyx_code_cache.count; i>pos; i--) { entries[i] = entries[i-1]; } entries[pos].code_line = code_line; entries[pos].code_object = code_object; __pyx_code_cache.count++; Py_INCREF(code_object); } #include "compile.h" #include "frameobject.h" #include "traceback.h" static PyCodeObject* __Pyx_CreateCodeObjectForTraceback( const char *funcname, int c_line, int py_line, const char *filename) { PyCodeObject *py_code = 0; PyObject *py_srcfile = 0; PyObject *py_funcname = 0; #if PY_MAJOR_VERSION < 3 py_srcfile = PyString_FromString(filename); #else py_srcfile = PyUnicode_FromString(filename); #endif if (!py_srcfile) goto bad; if (c_line) { #if PY_MAJOR_VERSION < 3 py_funcname = PyString_FromFormat( "%s (%s:%d)", funcname, __pyx_cfilenm, c_line); #else py_funcname = PyUnicode_FromFormat( "%s (%s:%d)", funcname, __pyx_cfilenm, c_line); #endif } else { #if PY_MAJOR_VERSION < 3 py_funcname = PyString_FromString(funcname); #else py_funcname = PyUnicode_FromString(funcname); #endif } if (!py_funcname) goto bad; py_code = __Pyx_PyCode_New( 0, 0, 0, 0, 0, __pyx_empty_bytes, /*PyObject *code,*/ __pyx_empty_tuple, /*PyObject *consts,*/ __pyx_empty_tuple, /*PyObject *names,*/ __pyx_empty_tuple, /*PyObject *varnames,*/ __pyx_empty_tuple, /*PyObject *freevars,*/ __pyx_empty_tuple, /*PyObject *cellvars,*/ py_srcfile, /*PyObject *filename,*/ py_funcname, /*PyObject *name,*/ py_line, __pyx_empty_bytes /*PyObject *lnotab*/ ); Py_DECREF(py_srcfile); Py_DECREF(py_funcname); return py_code; bad: Py_XDECREF(py_srcfile); Py_XDECREF(py_funcname); return NULL; } static void __Pyx_AddTraceback(const char *funcname, int c_line, int py_line, const char *filename) { PyCodeObject *py_code = 0; PyFrameObject *py_frame = 0; py_code = __pyx_find_code_object(c_line ? c_line : py_line); if (!py_code) { py_code = __Pyx_CreateCodeObjectForTraceback( funcname, c_line, py_line, filename); if (!py_code) goto bad; __pyx_insert_code_object(c_line ? c_line : py_line, py_code); } py_frame = PyFrame_New( PyThreadState_GET(), /*PyThreadState *tstate,*/ py_code, /*PyCodeObject *code,*/ __pyx_d, /*PyObject *globals,*/ 0 /*PyObject *locals*/ ); if (!py_frame) goto bad; py_frame->f_lineno = py_line; PyTraceBack_Here(py_frame); bad: Py_XDECREF(py_code); Py_XDECREF(py_frame); } static CYTHON_INLINE PyObject* __Pyx_PyInt_From_int(int value) { const int neg_one = (int) -1, const_zero = (int) 0; const int is_unsigned = neg_one > const_zero; if (is_unsigned) { if (sizeof(int) < sizeof(long)) { return PyInt_FromLong((long) value); } else if (sizeof(int) <= sizeof(unsigned long)) { return PyLong_FromUnsignedLong((unsigned long) value); } else if (sizeof(int) <= sizeof(unsigned PY_LONG_LONG)) { return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value); } } else { if (sizeof(int) <= sizeof(long)) { return PyInt_FromLong((long) value); } else if (sizeof(int) <= sizeof(PY_LONG_LONG)) { return PyLong_FromLongLong((PY_LONG_LONG) value); } } { int one = 1; int little = (int)*(unsigned char *)&one; unsigned char *bytes = (unsigned char *)&value; return _PyLong_FromByteArray(bytes, sizeof(int), little, !is_unsigned); } } static CYTHON_INLINE PyObject* __Pyx_PyInt_From_SDL_GameControllerAxis(SDL_GameControllerAxis value) { const SDL_GameControllerAxis neg_one = (SDL_GameControllerAxis) -1, const_zero = (SDL_GameControllerAxis) 0; const int is_unsigned = neg_one > const_zero; if (is_unsigned) { if (sizeof(SDL_GameControllerAxis) < sizeof(long)) { return PyInt_FromLong((long) value); } else if (sizeof(SDL_GameControllerAxis) <= sizeof(unsigned long)) { return PyLong_FromUnsignedLong((unsigned long) value); } else if (sizeof(SDL_GameControllerAxis) <= sizeof(unsigned PY_LONG_LONG)) { return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value); } } else { if (sizeof(SDL_GameControllerAxis) <= sizeof(long)) { return PyInt_FromLong((long) value); } else if (sizeof(SDL_GameControllerAxis) <= sizeof(PY_LONG_LONG)) { return PyLong_FromLongLong((PY_LONG_LONG) value); } } { int one = 1; int little = (int)*(unsigned char *)&one; unsigned char *bytes = (unsigned char *)&value; return _PyLong_FromByteArray(bytes, sizeof(SDL_GameControllerAxis), little, !is_unsigned); } } static CYTHON_INLINE PyObject* __Pyx_PyInt_From_SDL_GameControllerButton(SDL_GameControllerButton value) { const SDL_GameControllerButton neg_one = (SDL_GameControllerButton) -1, const_zero = (SDL_GameControllerButton) 0; const int is_unsigned = neg_one > const_zero; if (is_unsigned) { if (sizeof(SDL_GameControllerButton) < sizeof(long)) { return PyInt_FromLong((long) value); } else if (sizeof(SDL_GameControllerButton) <= sizeof(unsigned long)) { return PyLong_FromUnsignedLong((unsigned long) value); } else if (sizeof(SDL_GameControllerButton) <= sizeof(unsigned PY_LONG_LONG)) { return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value); } } else { if (sizeof(SDL_GameControllerButton) <= sizeof(long)) { return PyInt_FromLong((long) value); } else if (sizeof(SDL_GameControllerButton) <= sizeof(PY_LONG_LONG)) { return PyLong_FromLongLong((PY_LONG_LONG) value); } } { int one = 1; int little = (int)*(unsigned char *)&one; unsigned char *bytes = (unsigned char *)&value; return _PyLong_FromByteArray(bytes, sizeof(SDL_GameControllerButton), little, !is_unsigned); } } #define __PYX_VERIFY_RETURN_INT(target_type, func_type, func_value)\ __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, 0) #define __PYX_VERIFY_RETURN_INT_EXC(target_type, func_type, func_value)\ __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, 1) #define __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, exc)\ {\ func_type value = func_value;\ if (sizeof(target_type) < sizeof(func_type)) {\ if (unlikely(value != (func_type) (target_type) value)) {\ func_type zero = 0;\ if (exc && unlikely(value == (func_type)-1 && PyErr_Occurred()))\ return (target_type) -1;\ if (is_unsigned && unlikely(value < zero))\ goto raise_neg_overflow;\ else\ goto raise_overflow;\ }\ }\ return (target_type) value;\ } #if CYTHON_USE_PYLONG_INTERNALS #include "longintrepr.h" #endif static CYTHON_INLINE SDL_GameControllerAxis __Pyx_PyInt_As_SDL_GameControllerAxis(PyObject *x) { const SDL_GameControllerAxis neg_one = (SDL_GameControllerAxis) -1, const_zero = (SDL_GameControllerAxis) 0; const int is_unsigned = neg_one > const_zero; #if PY_MAJOR_VERSION < 3 if (likely(PyInt_Check(x))) { if (sizeof(SDL_GameControllerAxis) < sizeof(long)) { __PYX_VERIFY_RETURN_INT(SDL_GameControllerAxis, long, PyInt_AS_LONG(x)) } else { long val = PyInt_AS_LONG(x); if (is_unsigned && unlikely(val < 0)) { goto raise_neg_overflow; } return (SDL_GameControllerAxis) val; } } else #endif if (likely(PyLong_Check(x))) { if (is_unsigned) { #if CYTHON_USE_PYLONG_INTERNALS const digit* digits = ((PyLongObject*)x)->ob_digit; switch (Py_SIZE(x)) { case 0: return (SDL_GameControllerAxis) 0; case 1: __PYX_VERIFY_RETURN_INT(SDL_GameControllerAxis, digit, digits[0]) case 2: if (8 * sizeof(SDL_GameControllerAxis) > 1 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(SDL_GameControllerAxis, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(SDL_GameControllerAxis) >= 2 * PyLong_SHIFT) { return (SDL_GameControllerAxis) (((((SDL_GameControllerAxis)digits[1]) << PyLong_SHIFT) | (SDL_GameControllerAxis)digits[0])); } } break; case 3: if (8 * sizeof(SDL_GameControllerAxis) > 2 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(SDL_GameControllerAxis, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(SDL_GameControllerAxis) >= 3 * PyLong_SHIFT) { return (SDL_GameControllerAxis) (((((((SDL_GameControllerAxis)digits[2]) << PyLong_SHIFT) | (SDL_GameControllerAxis)digits[1]) << PyLong_SHIFT) | (SDL_GameControllerAxis)digits[0])); } } break; case 4: if (8 * sizeof(SDL_GameControllerAxis) > 3 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(SDL_GameControllerAxis, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(SDL_GameControllerAxis) >= 4 * PyLong_SHIFT) { return (SDL_GameControllerAxis) (((((((((SDL_GameControllerAxis)digits[3]) << PyLong_SHIFT) | (SDL_GameControllerAxis)digits[2]) << PyLong_SHIFT) | (SDL_GameControllerAxis)digits[1]) << PyLong_SHIFT) | (SDL_GameControllerAxis)digits[0])); } } break; } #endif #if CYTHON_COMPILING_IN_CPYTHON if (unlikely(Py_SIZE(x) < 0)) { goto raise_neg_overflow; } #else { int result = PyObject_RichCompareBool(x, Py_False, Py_LT); if (unlikely(result < 0)) return (SDL_GameControllerAxis) -1; if (unlikely(result == 1)) goto raise_neg_overflow; } #endif if (sizeof(SDL_GameControllerAxis) <= sizeof(unsigned long)) { __PYX_VERIFY_RETURN_INT_EXC(SDL_GameControllerAxis, unsigned long, PyLong_AsUnsignedLong(x)) } else if (sizeof(SDL_GameControllerAxis) <= sizeof(unsigned PY_LONG_LONG)) { __PYX_VERIFY_RETURN_INT_EXC(SDL_GameControllerAxis, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x)) } } else { #if CYTHON_USE_PYLONG_INTERNALS const digit* digits = ((PyLongObject*)x)->ob_digit; switch (Py_SIZE(x)) { case 0: return (SDL_GameControllerAxis) 0; case -1: __PYX_VERIFY_RETURN_INT(SDL_GameControllerAxis, sdigit, -(sdigit) digits[0]) case 1: __PYX_VERIFY_RETURN_INT(SDL_GameControllerAxis, digit, +digits[0]) case -2: if (8 * sizeof(SDL_GameControllerAxis) - 1 > 1 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(SDL_GameControllerAxis, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(SDL_GameControllerAxis) - 1 > 2 * PyLong_SHIFT) { return (SDL_GameControllerAxis) (((SDL_GameControllerAxis)-1)*(((((SDL_GameControllerAxis)digits[1]) << PyLong_SHIFT) | (SDL_GameControllerAxis)digits[0]))); } } break; case 2: if (8 * sizeof(SDL_GameControllerAxis) > 1 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(SDL_GameControllerAxis, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(SDL_GameControllerAxis) - 1 > 2 * PyLong_SHIFT) { return (SDL_GameControllerAxis) ((((((SDL_GameControllerAxis)digits[1]) << PyLong_SHIFT) | (SDL_GameControllerAxis)digits[0]))); } } break; case -3: if (8 * sizeof(SDL_GameControllerAxis) - 1 > 2 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(SDL_GameControllerAxis, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(SDL_GameControllerAxis) - 1 > 3 * PyLong_SHIFT) { return (SDL_GameControllerAxis) (((SDL_GameControllerAxis)-1)*(((((((SDL_GameControllerAxis)digits[2]) << PyLong_SHIFT) | (SDL_GameControllerAxis)digits[1]) << PyLong_SHIFT) | (SDL_GameControllerAxis)digits[0]))); } } break; case 3: if (8 * sizeof(SDL_GameControllerAxis) > 2 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(SDL_GameControllerAxis, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(SDL_GameControllerAxis) - 1 > 3 * PyLong_SHIFT) { return (SDL_GameControllerAxis) ((((((((SDL_GameControllerAxis)digits[2]) << PyLong_SHIFT) | (SDL_GameControllerAxis)digits[1]) << PyLong_SHIFT) | (SDL_GameControllerAxis)digits[0]))); } } break; case -4: if (8 * sizeof(SDL_GameControllerAxis) - 1 > 3 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(SDL_GameControllerAxis, long, -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(SDL_GameControllerAxis) - 1 > 4 * PyLong_SHIFT) { return (SDL_GameControllerAxis) (((SDL_GameControllerAxis)-1)*(((((((((SDL_GameControllerAxis)digits[3]) << PyLong_SHIFT) | (SDL_GameControllerAxis)digits[2]) << PyLong_SHIFT) | (SDL_GameControllerAxis)digits[1]) << PyLong_SHIFT) | (SDL_GameControllerAxis)digits[0]))); } } break; case 4: if (8 * sizeof(SDL_GameControllerAxis) > 3 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(SDL_GameControllerAxis, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(SDL_GameControllerAxis) - 1 > 4 * PyLong_SHIFT) { return (SDL_GameControllerAxis) ((((((((((SDL_GameControllerAxis)digits[3]) << PyLong_SHIFT) | (SDL_GameControllerAxis)digits[2]) << PyLong_SHIFT) | (SDL_GameControllerAxis)digits[1]) << PyLong_SHIFT) | (SDL_GameControllerAxis)digits[0]))); } } break; } #endif if (sizeof(SDL_GameControllerAxis) <= sizeof(long)) { __PYX_VERIFY_RETURN_INT_EXC(SDL_GameControllerAxis, long, PyLong_AsLong(x)) } else if (sizeof(SDL_GameControllerAxis) <= sizeof(PY_LONG_LONG)) { __PYX_VERIFY_RETURN_INT_EXC(SDL_GameControllerAxis, PY_LONG_LONG, PyLong_AsLongLong(x)) } } { #if CYTHON_COMPILING_IN_PYPY && !defined(_PyLong_AsByteArray) PyErr_SetString(PyExc_RuntimeError, "_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers"); #else SDL_GameControllerAxis val; PyObject *v = __Pyx_PyNumber_Int(x); #if PY_MAJOR_VERSION < 3 if (likely(v) && !PyLong_Check(v)) { PyObject *tmp = v; v = PyNumber_Long(tmp); Py_DECREF(tmp); } #endif if (likely(v)) { int one = 1; int is_little = (int)*(unsigned char *)&one; unsigned char *bytes = (unsigned char *)&val; int ret = _PyLong_AsByteArray((PyLongObject *)v, bytes, sizeof(val), is_little, !is_unsigned); Py_DECREF(v); if (likely(!ret)) return val; } #endif return (SDL_GameControllerAxis) -1; } } else { SDL_GameControllerAxis val; PyObject *tmp = __Pyx_PyNumber_Int(x); if (!tmp) return (SDL_GameControllerAxis) -1; val = __Pyx_PyInt_As_SDL_GameControllerAxis(tmp); Py_DECREF(tmp); return val; } raise_overflow: PyErr_SetString(PyExc_OverflowError, "value too large to convert to SDL_GameControllerAxis"); return (SDL_GameControllerAxis) -1; raise_neg_overflow: PyErr_SetString(PyExc_OverflowError, "can't convert negative value to SDL_GameControllerAxis"); return (SDL_GameControllerAxis) -1; } static CYTHON_INLINE SDL_GameControllerButton __Pyx_PyInt_As_SDL_GameControllerButton(PyObject *x) { const SDL_GameControllerButton neg_one = (SDL_GameControllerButton) -1, const_zero = (SDL_GameControllerButton) 0; const int is_unsigned = neg_one > const_zero; #if PY_MAJOR_VERSION < 3 if (likely(PyInt_Check(x))) { if (sizeof(SDL_GameControllerButton) < sizeof(long)) { __PYX_VERIFY_RETURN_INT(SDL_GameControllerButton, long, PyInt_AS_LONG(x)) } else { long val = PyInt_AS_LONG(x); if (is_unsigned && unlikely(val < 0)) { goto raise_neg_overflow; } return (SDL_GameControllerButton) val; } } else #endif if (likely(PyLong_Check(x))) { if (is_unsigned) { #if CYTHON_USE_PYLONG_INTERNALS const digit* digits = ((PyLongObject*)x)->ob_digit; switch (Py_SIZE(x)) { case 0: return (SDL_GameControllerButton) 0; case 1: __PYX_VERIFY_RETURN_INT(SDL_GameControllerButton, digit, digits[0]) case 2: if (8 * sizeof(SDL_GameControllerButton) > 1 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(SDL_GameControllerButton, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(SDL_GameControllerButton) >= 2 * PyLong_SHIFT) { return (SDL_GameControllerButton) (((((SDL_GameControllerButton)digits[1]) << PyLong_SHIFT) | (SDL_GameControllerButton)digits[0])); } } break; case 3: if (8 * sizeof(SDL_GameControllerButton) > 2 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(SDL_GameControllerButton, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(SDL_GameControllerButton) >= 3 * PyLong_SHIFT) { return (SDL_GameControllerButton) (((((((SDL_GameControllerButton)digits[2]) << PyLong_SHIFT) | (SDL_GameControllerButton)digits[1]) << PyLong_SHIFT) | (SDL_GameControllerButton)digits[0])); } } break; case 4: if (8 * sizeof(SDL_GameControllerButton) > 3 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(SDL_GameControllerButton, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(SDL_GameControllerButton) >= 4 * PyLong_SHIFT) { return (SDL_GameControllerButton) (((((((((SDL_GameControllerButton)digits[3]) << PyLong_SHIFT) | (SDL_GameControllerButton)digits[2]) << PyLong_SHIFT) | (SDL_GameControllerButton)digits[1]) << PyLong_SHIFT) | (SDL_GameControllerButton)digits[0])); } } break; } #endif #if CYTHON_COMPILING_IN_CPYTHON if (unlikely(Py_SIZE(x) < 0)) { goto raise_neg_overflow; } #else { int result = PyObject_RichCompareBool(x, Py_False, Py_LT); if (unlikely(result < 0)) return (SDL_GameControllerButton) -1; if (unlikely(result == 1)) goto raise_neg_overflow; } #endif if (sizeof(SDL_GameControllerButton) <= sizeof(unsigned long)) { __PYX_VERIFY_RETURN_INT_EXC(SDL_GameControllerButton, unsigned long, PyLong_AsUnsignedLong(x)) } else if (sizeof(SDL_GameControllerButton) <= sizeof(unsigned PY_LONG_LONG)) { __PYX_VERIFY_RETURN_INT_EXC(SDL_GameControllerButton, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x)) } } else { #if CYTHON_USE_PYLONG_INTERNALS const digit* digits = ((PyLongObject*)x)->ob_digit; switch (Py_SIZE(x)) { case 0: return (SDL_GameControllerButton) 0; case -1: __PYX_VERIFY_RETURN_INT(SDL_GameControllerButton, sdigit, -(sdigit) digits[0]) case 1: __PYX_VERIFY_RETURN_INT(SDL_GameControllerButton, digit, +digits[0]) case -2: if (8 * sizeof(SDL_GameControllerButton) - 1 > 1 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(SDL_GameControllerButton, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(SDL_GameControllerButton) - 1 > 2 * PyLong_SHIFT) { return (SDL_GameControllerButton) (((SDL_GameControllerButton)-1)*(((((SDL_GameControllerButton)digits[1]) << PyLong_SHIFT) | (SDL_GameControllerButton)digits[0]))); } } break; case 2: if (8 * sizeof(SDL_GameControllerButton) > 1 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(SDL_GameControllerButton, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(SDL_GameControllerButton) - 1 > 2 * PyLong_SHIFT) { return (SDL_GameControllerButton) ((((((SDL_GameControllerButton)digits[1]) << PyLong_SHIFT) | (SDL_GameControllerButton)digits[0]))); } } break; case -3: if (8 * sizeof(SDL_GameControllerButton) - 1 > 2 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(SDL_GameControllerButton, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(SDL_GameControllerButton) - 1 > 3 * PyLong_SHIFT) { return (SDL_GameControllerButton) (((SDL_GameControllerButton)-1)*(((((((SDL_GameControllerButton)digits[2]) << PyLong_SHIFT) | (SDL_GameControllerButton)digits[1]) << PyLong_SHIFT) | (SDL_GameControllerButton)digits[0]))); } } break; case 3: if (8 * sizeof(SDL_GameControllerButton) > 2 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(SDL_GameControllerButton, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(SDL_GameControllerButton) - 1 > 3 * PyLong_SHIFT) { return (SDL_GameControllerButton) ((((((((SDL_GameControllerButton)digits[2]) << PyLong_SHIFT) | (SDL_GameControllerButton)digits[1]) << PyLong_SHIFT) | (SDL_GameControllerButton)digits[0]))); } } break; case -4: if (8 * sizeof(SDL_GameControllerButton) - 1 > 3 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(SDL_GameControllerButton, long, -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(SDL_GameControllerButton) - 1 > 4 * PyLong_SHIFT) { return (SDL_GameControllerButton) (((SDL_GameControllerButton)-1)*(((((((((SDL_GameControllerButton)digits[3]) << PyLong_SHIFT) | (SDL_GameControllerButton)digits[2]) << PyLong_SHIFT) | (SDL_GameControllerButton)digits[1]) << PyLong_SHIFT) | (SDL_GameControllerButton)digits[0]))); } } break; case 4: if (8 * sizeof(SDL_GameControllerButton) > 3 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(SDL_GameControllerButton, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(SDL_GameControllerButton) - 1 > 4 * PyLong_SHIFT) { return (SDL_GameControllerButton) ((((((((((SDL_GameControllerButton)digits[3]) << PyLong_SHIFT) | (SDL_GameControllerButton)digits[2]) << PyLong_SHIFT) | (SDL_GameControllerButton)digits[1]) << PyLong_SHIFT) | (SDL_GameControllerButton)digits[0]))); } } break; } #endif if (sizeof(SDL_GameControllerButton) <= sizeof(long)) { __PYX_VERIFY_RETURN_INT_EXC(SDL_GameControllerButton, long, PyLong_AsLong(x)) } else if (sizeof(SDL_GameControllerButton) <= sizeof(PY_LONG_LONG)) { __PYX_VERIFY_RETURN_INT_EXC(SDL_GameControllerButton, PY_LONG_LONG, PyLong_AsLongLong(x)) } } { #if CYTHON_COMPILING_IN_PYPY && !defined(_PyLong_AsByteArray) PyErr_SetString(PyExc_RuntimeError, "_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers"); #else SDL_GameControllerButton val; PyObject *v = __Pyx_PyNumber_Int(x); #if PY_MAJOR_VERSION < 3 if (likely(v) && !PyLong_Check(v)) { PyObject *tmp = v; v = PyNumber_Long(tmp); Py_DECREF(tmp); } #endif if (likely(v)) { int one = 1; int is_little = (int)*(unsigned char *)&one; unsigned char *bytes = (unsigned char *)&val; int ret = _PyLong_AsByteArray((PyLongObject *)v, bytes, sizeof(val), is_little, !is_unsigned); Py_DECREF(v); if (likely(!ret)) return val; } #endif return (SDL_GameControllerButton) -1; } } else { SDL_GameControllerButton val; PyObject *tmp = __Pyx_PyNumber_Int(x); if (!tmp) return (SDL_GameControllerButton) -1; val = __Pyx_PyInt_As_SDL_GameControllerButton(tmp); Py_DECREF(tmp); return val; } raise_overflow: PyErr_SetString(PyExc_OverflowError, "value too large to convert to SDL_GameControllerButton"); return (SDL_GameControllerButton) -1; raise_neg_overflow: PyErr_SetString(PyExc_OverflowError, "can't convert negative value to SDL_GameControllerButton"); return (SDL_GameControllerButton) -1; } static CYTHON_INLINE int __Pyx_PyInt_As_int(PyObject *x) { const int neg_one = (int) -1, const_zero = (int) 0; const int is_unsigned = neg_one > const_zero; #if PY_MAJOR_VERSION < 3 if (likely(PyInt_Check(x))) { if (sizeof(int) < sizeof(long)) { __PYX_VERIFY_RETURN_INT(int, long, PyInt_AS_LONG(x)) } else { long val = PyInt_AS_LONG(x); if (is_unsigned && unlikely(val < 0)) { goto raise_neg_overflow; } return (int) val; } } else #endif if (likely(PyLong_Check(x))) { if (is_unsigned) { #if CYTHON_USE_PYLONG_INTERNALS const digit* digits = ((PyLongObject*)x)->ob_digit; switch (Py_SIZE(x)) { case 0: return (int) 0; case 1: __PYX_VERIFY_RETURN_INT(int, digit, digits[0]) case 2: if (8 * sizeof(int) > 1 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(int) >= 2 * PyLong_SHIFT) { return (int) (((((int)digits[1]) << PyLong_SHIFT) | (int)digits[0])); } } break; case 3: if (8 * sizeof(int) > 2 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(int) >= 3 * PyLong_SHIFT) { return (int) (((((((int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0])); } } break; case 4: if (8 * sizeof(int) > 3 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(int) >= 4 * PyLong_SHIFT) { return (int) (((((((((int)digits[3]) << PyLong_SHIFT) | (int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0])); } } break; } #endif #if CYTHON_COMPILING_IN_CPYTHON if (unlikely(Py_SIZE(x) < 0)) { goto raise_neg_overflow; } #else { int result = PyObject_RichCompareBool(x, Py_False, Py_LT); if (unlikely(result < 0)) return (int) -1; if (unlikely(result == 1)) goto raise_neg_overflow; } #endif if (sizeof(int) <= sizeof(unsigned long)) { __PYX_VERIFY_RETURN_INT_EXC(int, unsigned long, PyLong_AsUnsignedLong(x)) } else if (sizeof(int) <= sizeof(unsigned PY_LONG_LONG)) { __PYX_VERIFY_RETURN_INT_EXC(int, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x)) } } else { #if CYTHON_USE_PYLONG_INTERNALS const digit* digits = ((PyLongObject*)x)->ob_digit; switch (Py_SIZE(x)) { case 0: return (int) 0; case -1: __PYX_VERIFY_RETURN_INT(int, sdigit, -(sdigit) digits[0]) case 1: __PYX_VERIFY_RETURN_INT(int, digit, +digits[0]) case -2: if (8 * sizeof(int) - 1 > 1 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(int, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(int) - 1 > 2 * PyLong_SHIFT) { return (int) (((int)-1)*(((((int)digits[1]) << PyLong_SHIFT) | (int)digits[0]))); } } break; case 2: if (8 * sizeof(int) > 1 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(int) - 1 > 2 * PyLong_SHIFT) { return (int) ((((((int)digits[1]) << PyLong_SHIFT) | (int)digits[0]))); } } break; case -3: if (8 * sizeof(int) - 1 > 2 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(int, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(int) - 1 > 3 * PyLong_SHIFT) { return (int) (((int)-1)*(((((((int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0]))); } } break; case 3: if (8 * sizeof(int) > 2 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(int) - 1 > 3 * PyLong_SHIFT) { return (int) ((((((((int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0]))); } } break; case -4: if (8 * sizeof(int) - 1 > 3 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(int, long, -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(int) - 1 > 4 * PyLong_SHIFT) { return (int) (((int)-1)*(((((((((int)digits[3]) << PyLong_SHIFT) | (int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0]))); } } break; case 4: if (8 * sizeof(int) > 3 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(int) - 1 > 4 * PyLong_SHIFT) { return (int) ((((((((((int)digits[3]) << PyLong_SHIFT) | (int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0]))); } } break; } #endif if (sizeof(int) <= sizeof(long)) { __PYX_VERIFY_RETURN_INT_EXC(int, long, PyLong_AsLong(x)) } else if (sizeof(int) <= sizeof(PY_LONG_LONG)) { __PYX_VERIFY_RETURN_INT_EXC(int, PY_LONG_LONG, PyLong_AsLongLong(x)) } } { #if CYTHON_COMPILING_IN_PYPY && !defined(_PyLong_AsByteArray) PyErr_SetString(PyExc_RuntimeError, "_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers"); #else int val; PyObject *v = __Pyx_PyNumber_Int(x); #if PY_MAJOR_VERSION < 3 if (likely(v) && !PyLong_Check(v)) { PyObject *tmp = v; v = PyNumber_Long(tmp); Py_DECREF(tmp); } #endif if (likely(v)) { int one = 1; int is_little = (int)*(unsigned char *)&one; unsigned char *bytes = (unsigned char *)&val; int ret = _PyLong_AsByteArray((PyLongObject *)v, bytes, sizeof(val), is_little, !is_unsigned); Py_DECREF(v); if (likely(!ret)) return val; } #endif return (int) -1; } } else { int val; PyObject *tmp = __Pyx_PyNumber_Int(x); if (!tmp) return (int) -1; val = __Pyx_PyInt_As_int(tmp); Py_DECREF(tmp); return val; } raise_overflow: PyErr_SetString(PyExc_OverflowError, "value too large to convert to int"); return (int) -1; raise_neg_overflow: PyErr_SetString(PyExc_OverflowError, "can't convert negative value to int"); return (int) -1; } static CYTHON_INLINE PyObject* __Pyx_PyInt_From_int16_t(int16_t value) { const int16_t neg_one = (int16_t) -1, const_zero = (int16_t) 0; const int is_unsigned = neg_one > const_zero; if (is_unsigned) { if (sizeof(int16_t) < sizeof(long)) { return PyInt_FromLong((long) value); } else if (sizeof(int16_t) <= sizeof(unsigned long)) { return PyLong_FromUnsignedLong((unsigned long) value); } else if (sizeof(int16_t) <= sizeof(unsigned PY_LONG_LONG)) { return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value); } } else { if (sizeof(int16_t) <= sizeof(long)) { return PyInt_FromLong((long) value); } else if (sizeof(int16_t) <= sizeof(PY_LONG_LONG)) { return PyLong_FromLongLong((PY_LONG_LONG) value); } } { int one = 1; int little = (int)*(unsigned char *)&one; unsigned char *bytes = (unsigned char *)&value; return _PyLong_FromByteArray(bytes, sizeof(int16_t), little, !is_unsigned); } } static CYTHON_INLINE PyObject* __Pyx_PyInt_From_uint8_t(uint8_t value) { const uint8_t neg_one = (uint8_t) -1, const_zero = (uint8_t) 0; const int is_unsigned = neg_one > const_zero; if (is_unsigned) { if (sizeof(uint8_t) < sizeof(long)) { return PyInt_FromLong((long) value); } else if (sizeof(uint8_t) <= sizeof(unsigned long)) { return PyLong_FromUnsignedLong((unsigned long) value); } else if (sizeof(uint8_t) <= sizeof(unsigned PY_LONG_LONG)) { return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value); } } else { if (sizeof(uint8_t) <= sizeof(long)) { return PyInt_FromLong((long) value); } else if (sizeof(uint8_t) <= sizeof(PY_LONG_LONG)) { return PyLong_FromLongLong((PY_LONG_LONG) value); } } { int one = 1; int little = (int)*(unsigned char *)&one; unsigned char *bytes = (unsigned char *)&value; return _PyLong_FromByteArray(bytes, sizeof(uint8_t), little, !is_unsigned); } } static CYTHON_INLINE PyObject* __Pyx_PyInt_From_SDL_bool(SDL_bool value) { const SDL_bool neg_one = (SDL_bool) -1, const_zero = (SDL_bool) 0; const int is_unsigned = neg_one > const_zero; if (is_unsigned) { if (sizeof(SDL_bool) < sizeof(long)) { return PyInt_FromLong((long) value); } else if (sizeof(SDL_bool) <= sizeof(unsigned long)) { return PyLong_FromUnsignedLong((unsigned long) value); } else if (sizeof(SDL_bool) <= sizeof(unsigned PY_LONG_LONG)) { return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value); } } else { if (sizeof(SDL_bool) <= sizeof(long)) { return PyInt_FromLong((long) value); } else if (sizeof(SDL_bool) <= sizeof(PY_LONG_LONG)) { return PyLong_FromLongLong((PY_LONG_LONG) value); } } { int one = 1; int little = (int)*(unsigned char *)&one; unsigned char *bytes = (unsigned char *)&value; return _PyLong_FromByteArray(bytes, sizeof(SDL_bool), little, !is_unsigned); } } static CYTHON_INLINE PyObject* __Pyx_PyInt_From_long(long value) { const long neg_one = (long) -1, const_zero = (long) 0; const int is_unsigned = neg_one > const_zero; if (is_unsigned) { if (sizeof(long) < sizeof(long)) { return PyInt_FromLong((long) value); } else if (sizeof(long) <= sizeof(unsigned long)) { return PyLong_FromUnsignedLong((unsigned long) value); } else if (sizeof(long) <= sizeof(unsigned PY_LONG_LONG)) { return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value); } } else { if (sizeof(long) <= sizeof(long)) { return PyInt_FromLong((long) value); } else if (sizeof(long) <= sizeof(PY_LONG_LONG)) { return PyLong_FromLongLong((PY_LONG_LONG) value); } } { int one = 1; int little = (int)*(unsigned char *)&one; unsigned char *bytes = (unsigned char *)&value; return _PyLong_FromByteArray(bytes, sizeof(long), little, !is_unsigned); } } static CYTHON_INLINE long __Pyx_PyInt_As_long(PyObject *x) { const long neg_one = (long) -1, const_zero = (long) 0; const int is_unsigned = neg_one > const_zero; #if PY_MAJOR_VERSION < 3 if (likely(PyInt_Check(x))) { if (sizeof(long) < sizeof(long)) { __PYX_VERIFY_RETURN_INT(long, long, PyInt_AS_LONG(x)) } else { long val = PyInt_AS_LONG(x); if (is_unsigned && unlikely(val < 0)) { goto raise_neg_overflow; } return (long) val; } } else #endif if (likely(PyLong_Check(x))) { if (is_unsigned) { #if CYTHON_USE_PYLONG_INTERNALS const digit* digits = ((PyLongObject*)x)->ob_digit; switch (Py_SIZE(x)) { case 0: return (long) 0; case 1: __PYX_VERIFY_RETURN_INT(long, digit, digits[0]) case 2: if (8 * sizeof(long) > 1 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(long) >= 2 * PyLong_SHIFT) { return (long) (((((long)digits[1]) << PyLong_SHIFT) | (long)digits[0])); } } break; case 3: if (8 * sizeof(long) > 2 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(long) >= 3 * PyLong_SHIFT) { return (long) (((((((long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0])); } } break; case 4: if (8 * sizeof(long) > 3 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(long) >= 4 * PyLong_SHIFT) { return (long) (((((((((long)digits[3]) << PyLong_SHIFT) | (long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0])); } } break; } #endif #if CYTHON_COMPILING_IN_CPYTHON if (unlikely(Py_SIZE(x) < 0)) { goto raise_neg_overflow; } #else { int result = PyObject_RichCompareBool(x, Py_False, Py_LT); if (unlikely(result < 0)) return (long) -1; if (unlikely(result == 1)) goto raise_neg_overflow; } #endif if (sizeof(long) <= sizeof(unsigned long)) { __PYX_VERIFY_RETURN_INT_EXC(long, unsigned long, PyLong_AsUnsignedLong(x)) } else if (sizeof(long) <= sizeof(unsigned PY_LONG_LONG)) { __PYX_VERIFY_RETURN_INT_EXC(long, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x)) } } else { #if CYTHON_USE_PYLONG_INTERNALS const digit* digits = ((PyLongObject*)x)->ob_digit; switch (Py_SIZE(x)) { case 0: return (long) 0; case -1: __PYX_VERIFY_RETURN_INT(long, sdigit, -(sdigit) digits[0]) case 1: __PYX_VERIFY_RETURN_INT(long, digit, +digits[0]) case -2: if (8 * sizeof(long) - 1 > 1 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(long, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) { return (long) (((long)-1)*(((((long)digits[1]) << PyLong_SHIFT) | (long)digits[0]))); } } break; case 2: if (8 * sizeof(long) > 1 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) { return (long) ((((((long)digits[1]) << PyLong_SHIFT) | (long)digits[0]))); } } break; case -3: if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(long, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) { return (long) (((long)-1)*(((((((long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0]))); } } break; case 3: if (8 * sizeof(long) > 2 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) { return (long) ((((((((long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0]))); } } break; case -4: if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(long, long, -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(long) - 1 > 4 * PyLong_SHIFT) { return (long) (((long)-1)*(((((((((long)digits[3]) << PyLong_SHIFT) | (long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0]))); } } break; case 4: if (8 * sizeof(long) > 3 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(long) - 1 > 4 * PyLong_SHIFT) { return (long) ((((((((((long)digits[3]) << PyLong_SHIFT) | (long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0]))); } } break; } #endif if (sizeof(long) <= sizeof(long)) { __PYX_VERIFY_RETURN_INT_EXC(long, long, PyLong_AsLong(x)) } else if (sizeof(long) <= sizeof(PY_LONG_LONG)) { __PYX_VERIFY_RETURN_INT_EXC(long, PY_LONG_LONG, PyLong_AsLongLong(x)) } } { #if CYTHON_COMPILING_IN_PYPY && !defined(_PyLong_AsByteArray) PyErr_SetString(PyExc_RuntimeError, "_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers"); #else long val; PyObject *v = __Pyx_PyNumber_Int(x); #if PY_MAJOR_VERSION < 3 if (likely(v) && !PyLong_Check(v)) { PyObject *tmp = v; v = PyNumber_Long(tmp); Py_DECREF(tmp); } #endif if (likely(v)) { int one = 1; int is_little = (int)*(unsigned char *)&one; unsigned char *bytes = (unsigned char *)&val; int ret = _PyLong_AsByteArray((PyLongObject *)v, bytes, sizeof(val), is_little, !is_unsigned); Py_DECREF(v); if (likely(!ret)) return val; } #endif return (long) -1; } } else { long val; PyObject *tmp = __Pyx_PyNumber_Int(x); if (!tmp) return (long) -1; val = __Pyx_PyInt_As_long(tmp); Py_DECREF(tmp); return val; } raise_overflow: PyErr_SetString(PyExc_OverflowError, "value too large to convert to long"); return (long) -1; raise_neg_overflow: PyErr_SetString(PyExc_OverflowError, "can't convert negative value to long"); return (long) -1; } static int __Pyx_check_binary_version(void) { char ctversion[4], rtversion[4]; PyOS_snprintf(ctversion, 4, "%d.%d", PY_MAJOR_VERSION, PY_MINOR_VERSION); PyOS_snprintf(rtversion, 4, "%s", Py_GetVersion()); if (ctversion[0] != rtversion[0] || ctversion[2] != rtversion[2]) { char message[200]; PyOS_snprintf(message, sizeof(message), "compiletime version %s of module '%.100s' " "does not match runtime version %s", ctversion, __Pyx_MODULE_NAME, rtversion); return PyErr_WarnEx(NULL, message, 1); } return 0; } #ifndef __PYX_HAVE_RT_ImportModule #define __PYX_HAVE_RT_ImportModule static PyObject *__Pyx_ImportModule(const char *name) { PyObject *py_name = 0; PyObject *py_module = 0; py_name = __Pyx_PyIdentifier_FromString(name); if (!py_name) goto bad; py_module = PyImport_Import(py_name); Py_DECREF(py_name); return py_module; bad: Py_XDECREF(py_name); return 0; } #endif #ifndef __PYX_HAVE_RT_ImportFunction #define __PYX_HAVE_RT_ImportFunction static int __Pyx_ImportFunction(PyObject *module, const char *funcname, void (**f)(void), const char *sig) { PyObject *d = 0; PyObject *cobj = 0; union { void (*fp)(void); void *p; } tmp; d = PyObject_GetAttrString(module, (char *)"__pyx_capi__"); if (!d) goto bad; cobj = PyDict_GetItemString(d, funcname); if (!cobj) { PyErr_Format(PyExc_ImportError, "%.200s does not export expected C function %.200s", PyModule_GetName(module), funcname); goto bad; } #if PY_VERSION_HEX >= 0x02070000 if (!PyCapsule_IsValid(cobj, sig)) { PyErr_Format(PyExc_TypeError, "C function %.200s.%.200s has wrong signature (expected %.500s, got %.500s)", PyModule_GetName(module), funcname, sig, PyCapsule_GetName(cobj)); goto bad; } tmp.p = PyCapsule_GetPointer(cobj, sig); #else {const char *desc, *s1, *s2; desc = (const char *)PyCObject_GetDesc(cobj); if (!desc) goto bad; s1 = desc; s2 = sig; while (*s1 != '\0' && *s1 == *s2) { s1++; s2++; } if (*s1 != *s2) { PyErr_Format(PyExc_TypeError, "C function %.200s.%.200s has wrong signature (expected %.500s, got %.500s)", PyModule_GetName(module), funcname, sig, desc); goto bad; } tmp.p = PyCObject_AsVoidPtr(cobj);} #endif *f = tmp.fp; if (!(*f)) goto bad; Py_DECREF(d); return 0; bad: Py_XDECREF(d); return -1; } #endif static int __Pyx_InitStrings(__Pyx_StringTabEntry *t) { while (t->p) { #if PY_MAJOR_VERSION < 3 if (t->is_unicode) { *t->p = PyUnicode_DecodeUTF8(t->s, t->n - 1, NULL); } else if (t->intern) { *t->p = PyString_InternFromString(t->s); } else { *t->p = PyString_FromStringAndSize(t->s, t->n - 1); } #else if (t->is_unicode | t->is_str) { if (t->intern) { *t->p = PyUnicode_InternFromString(t->s); } else if (t->encoding) { *t->p = PyUnicode_Decode(t->s, t->n - 1, t->encoding, NULL); } else { *t->p = PyUnicode_FromStringAndSize(t->s, t->n - 1); } } else { *t->p = PyBytes_FromStringAndSize(t->s, t->n - 1); } #endif if (!*t->p) return -1; ++t; } return 0; } static CYTHON_INLINE PyObject* __Pyx_PyUnicode_FromString(const char* c_str) { return __Pyx_PyUnicode_FromStringAndSize(c_str, (Py_ssize_t)strlen(c_str)); } static CYTHON_INLINE char* __Pyx_PyObject_AsString(PyObject* o) { Py_ssize_t ignore; return __Pyx_PyObject_AsStringAndSize(o, &ignore); } static CYTHON_INLINE char* __Pyx_PyObject_AsStringAndSize(PyObject* o, Py_ssize_t *length) { #if CYTHON_COMPILING_IN_CPYTHON && (__PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT) if ( #if PY_MAJOR_VERSION < 3 && __PYX_DEFAULT_STRING_ENCODING_IS_ASCII __Pyx_sys_getdefaultencoding_not_ascii && #endif PyUnicode_Check(o)) { #if PY_VERSION_HEX < 0x03030000 char* defenc_c; PyObject* defenc = _PyUnicode_AsDefaultEncodedString(o, NULL); if (!defenc) return NULL; defenc_c = PyBytes_AS_STRING(defenc); #if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII { char* end = defenc_c + PyBytes_GET_SIZE(defenc); char* c; for (c = defenc_c; c < end; c++) { if ((unsigned char) (*c) >= 128) { PyUnicode_AsASCIIString(o); return NULL; } } } #endif *length = PyBytes_GET_SIZE(defenc); return defenc_c; #else if (__Pyx_PyUnicode_READY(o) == -1) return NULL; #if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII if (PyUnicode_IS_ASCII(o)) { *length = PyUnicode_GET_LENGTH(o); return PyUnicode_AsUTF8(o); } else { PyUnicode_AsASCIIString(o); return NULL; } #else return PyUnicode_AsUTF8AndSize(o, length); #endif #endif } else #endif #if (!CYTHON_COMPILING_IN_PYPY) || (defined(PyByteArray_AS_STRING) && defined(PyByteArray_GET_SIZE)) if (PyByteArray_Check(o)) { *length = PyByteArray_GET_SIZE(o); return PyByteArray_AS_STRING(o); } else #endif { char* result; int r = PyBytes_AsStringAndSize(o, &result, length); if (unlikely(r < 0)) { return NULL; } else { return result; } } } static CYTHON_INLINE int __Pyx_PyObject_IsTrue(PyObject* x) { int is_true = x == Py_True; if (is_true | (x == Py_False) | (x == Py_None)) return is_true; else return PyObject_IsTrue(x); } static CYTHON_INLINE PyObject* __Pyx_PyNumber_Int(PyObject* x) { PyNumberMethods *m; const char *name = NULL; PyObject *res = NULL; #if PY_MAJOR_VERSION < 3 if (PyInt_Check(x) || PyLong_Check(x)) #else if (PyLong_Check(x)) #endif return __Pyx_NewRef(x); m = Py_TYPE(x)->tp_as_number; #if PY_MAJOR_VERSION < 3 if (m && m->nb_int) { name = "int"; res = PyNumber_Int(x); } else if (m && m->nb_long) { name = "long"; res = PyNumber_Long(x); } #else if (m && m->nb_int) { name = "int"; res = PyNumber_Long(x); } #endif if (res) { #if PY_MAJOR_VERSION < 3 if (!PyInt_Check(res) && !PyLong_Check(res)) { #else if (!PyLong_Check(res)) { #endif PyErr_Format(PyExc_TypeError, "__%.4s__ returned non-%.4s (type %.200s)", name, name, Py_TYPE(res)->tp_name); Py_DECREF(res); return NULL; } } else if (!PyErr_Occurred()) { PyErr_SetString(PyExc_TypeError, "an integer is required"); } return res; } static CYTHON_INLINE Py_ssize_t __Pyx_PyIndex_AsSsize_t(PyObject* b) { Py_ssize_t ival; PyObject *x; #if PY_MAJOR_VERSION < 3 if (likely(PyInt_CheckExact(b))) { if (sizeof(Py_ssize_t) >= sizeof(long)) return PyInt_AS_LONG(b); else return PyInt_AsSsize_t(x); } #endif if (likely(PyLong_CheckExact(b))) { #if CYTHON_USE_PYLONG_INTERNALS const digit* digits = ((PyLongObject*)b)->ob_digit; const Py_ssize_t size = Py_SIZE(b); if (likely(__Pyx_sst_abs(size) <= 1)) { ival = likely(size) ? digits[0] : 0; if (size == -1) ival = -ival; return ival; } else { switch (size) { case 2: if (8 * sizeof(Py_ssize_t) > 2 * PyLong_SHIFT) { return (Py_ssize_t) (((((size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])); } break; case -2: if (8 * sizeof(Py_ssize_t) > 2 * PyLong_SHIFT) { return -(Py_ssize_t) (((((size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])); } break; case 3: if (8 * sizeof(Py_ssize_t) > 3 * PyLong_SHIFT) { return (Py_ssize_t) (((((((size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])); } break; case -3: if (8 * sizeof(Py_ssize_t) > 3 * PyLong_SHIFT) { return -(Py_ssize_t) (((((((size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])); } break; case 4: if (8 * sizeof(Py_ssize_t) > 4 * PyLong_SHIFT) { return (Py_ssize_t) (((((((((size_t)digits[3]) << PyLong_SHIFT) | (size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])); } break; case -4: if (8 * sizeof(Py_ssize_t) > 4 * PyLong_SHIFT) { return -(Py_ssize_t) (((((((((size_t)digits[3]) << PyLong_SHIFT) | (size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])); } break; } } #endif return PyLong_AsSsize_t(b); } x = PyNumber_Index(b); if (!x) return -1; ival = PyInt_AsSsize_t(x); Py_DECREF(x); return ival; } static CYTHON_INLINE PyObject * __Pyx_PyInt_FromSize_t(size_t ival) { return PyInt_FromSize_t(ival); } #endif /* Py_PYTHON_H */ pygame_sdl2-2.1.0-for-renpy-6.99.14.1/gen3/pygame_sdl2.key.c0000664000175000017500000061065112665223541022262 0ustar tomtom00000000000000/* Generated by Cython 0.23.3 */ #define PY_SSIZE_T_CLEAN #include "Python.h" #ifndef Py_PYTHON_H #error Python headers needed to compile C extensions, please install development version of Python. #elif PY_VERSION_HEX < 0x02060000 || (0x03000000 <= PY_VERSION_HEX && PY_VERSION_HEX < 0x03020000) #error Cython requires Python 2.6+ or Python 3.2+. #else #define CYTHON_ABI "0_23_3" #include #ifndef offsetof #define offsetof(type, member) ( (size_t) & ((type*)0) -> member ) #endif #if !defined(WIN32) && !defined(MS_WINDOWS) #ifndef __stdcall #define __stdcall #endif #ifndef __cdecl #define __cdecl #endif #ifndef __fastcall #define __fastcall #endif #endif #ifndef DL_IMPORT #define DL_IMPORT(t) t #endif #ifndef DL_EXPORT #define DL_EXPORT(t) t #endif #ifndef PY_LONG_LONG #define PY_LONG_LONG LONG_LONG #endif #ifndef Py_HUGE_VAL #define Py_HUGE_VAL HUGE_VAL #endif #ifdef PYPY_VERSION #define CYTHON_COMPILING_IN_PYPY 1 #define CYTHON_COMPILING_IN_CPYTHON 0 #else #define CYTHON_COMPILING_IN_PYPY 0 #define CYTHON_COMPILING_IN_CPYTHON 1 #endif #if !defined(CYTHON_USE_PYLONG_INTERNALS) && CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x02070000 #define CYTHON_USE_PYLONG_INTERNALS 1 #endif #if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX < 0x02070600 && !defined(Py_OptimizeFlag) #define Py_OptimizeFlag 0 #endif #define __PYX_BUILD_PY_SSIZE_T "n" #define CYTHON_FORMAT_SSIZE_T "z" #if PY_MAJOR_VERSION < 3 #define __Pyx_BUILTIN_MODULE_NAME "__builtin__" #define __Pyx_PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)\ PyCode_New(a+k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos) #define __Pyx_DefaultClassType PyClass_Type #else #define __Pyx_BUILTIN_MODULE_NAME "builtins" #define __Pyx_PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)\ PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos) #define __Pyx_DefaultClassType PyType_Type #endif #ifndef Py_TPFLAGS_CHECKTYPES #define Py_TPFLAGS_CHECKTYPES 0 #endif #ifndef Py_TPFLAGS_HAVE_INDEX #define Py_TPFLAGS_HAVE_INDEX 0 #endif #ifndef Py_TPFLAGS_HAVE_NEWBUFFER #define Py_TPFLAGS_HAVE_NEWBUFFER 0 #endif #ifndef Py_TPFLAGS_HAVE_FINALIZE #define Py_TPFLAGS_HAVE_FINALIZE 0 #endif #if PY_VERSION_HEX > 0x03030000 && defined(PyUnicode_KIND) #define CYTHON_PEP393_ENABLED 1 #define __Pyx_PyUnicode_READY(op) (likely(PyUnicode_IS_READY(op)) ?\ 0 : _PyUnicode_Ready((PyObject *)(op))) #define __Pyx_PyUnicode_GET_LENGTH(u) PyUnicode_GET_LENGTH(u) #define __Pyx_PyUnicode_READ_CHAR(u, i) PyUnicode_READ_CHAR(u, i) #define __Pyx_PyUnicode_KIND(u) PyUnicode_KIND(u) #define __Pyx_PyUnicode_DATA(u) PyUnicode_DATA(u) #define __Pyx_PyUnicode_READ(k, d, i) PyUnicode_READ(k, d, i) #else #define CYTHON_PEP393_ENABLED 0 #define __Pyx_PyUnicode_READY(op) (0) #define __Pyx_PyUnicode_GET_LENGTH(u) PyUnicode_GET_SIZE(u) #define __Pyx_PyUnicode_READ_CHAR(u, i) ((Py_UCS4)(PyUnicode_AS_UNICODE(u)[i])) #define __Pyx_PyUnicode_KIND(u) (sizeof(Py_UNICODE)) #define __Pyx_PyUnicode_DATA(u) ((void*)PyUnicode_AS_UNICODE(u)) #define __Pyx_PyUnicode_READ(k, d, i) ((void)(k), (Py_UCS4)(((Py_UNICODE*)d)[i])) #endif #if CYTHON_COMPILING_IN_PYPY #define __Pyx_PyUnicode_Concat(a, b) PyNumber_Add(a, b) #define __Pyx_PyUnicode_ConcatSafe(a, b) PyNumber_Add(a, b) #else #define __Pyx_PyUnicode_Concat(a, b) PyUnicode_Concat(a, b) #define __Pyx_PyUnicode_ConcatSafe(a, b) ((unlikely((a) == Py_None) || unlikely((b) == Py_None)) ?\ PyNumber_Add(a, b) : __Pyx_PyUnicode_Concat(a, b)) #endif #if CYTHON_COMPILING_IN_PYPY && !defined(PyUnicode_Contains) #define PyUnicode_Contains(u, s) PySequence_Contains(u, s) #endif #define __Pyx_PyString_FormatSafe(a, b) ((unlikely((a) == Py_None)) ? PyNumber_Remainder(a, b) : __Pyx_PyString_Format(a, b)) #define __Pyx_PyUnicode_FormatSafe(a, b) ((unlikely((a) == Py_None)) ? PyNumber_Remainder(a, b) : PyUnicode_Format(a, b)) #if PY_MAJOR_VERSION >= 3 #define __Pyx_PyString_Format(a, b) PyUnicode_Format(a, b) #else #define __Pyx_PyString_Format(a, b) PyString_Format(a, b) #endif #if PY_MAJOR_VERSION >= 3 #define PyBaseString_Type PyUnicode_Type #define PyStringObject PyUnicodeObject #define PyString_Type PyUnicode_Type #define PyString_Check PyUnicode_Check #define PyString_CheckExact PyUnicode_CheckExact #endif #if PY_MAJOR_VERSION >= 3 #define __Pyx_PyBaseString_Check(obj) PyUnicode_Check(obj) #define __Pyx_PyBaseString_CheckExact(obj) PyUnicode_CheckExact(obj) #else #define __Pyx_PyBaseString_Check(obj) (PyString_Check(obj) || PyUnicode_Check(obj)) #define __Pyx_PyBaseString_CheckExact(obj) (PyString_CheckExact(obj) || PyUnicode_CheckExact(obj)) #endif #ifndef PySet_CheckExact #define PySet_CheckExact(obj) (Py_TYPE(obj) == &PySet_Type) #endif #define __Pyx_TypeCheck(obj, type) PyObject_TypeCheck(obj, (PyTypeObject *)type) #if PY_MAJOR_VERSION >= 3 #define PyIntObject PyLongObject #define PyInt_Type PyLong_Type #define PyInt_Check(op) PyLong_Check(op) #define PyInt_CheckExact(op) PyLong_CheckExact(op) #define PyInt_FromString PyLong_FromString #define PyInt_FromUnicode PyLong_FromUnicode #define PyInt_FromLong PyLong_FromLong #define PyInt_FromSize_t PyLong_FromSize_t #define PyInt_FromSsize_t PyLong_FromSsize_t #define PyInt_AsLong PyLong_AsLong #define PyInt_AS_LONG PyLong_AS_LONG #define PyInt_AsSsize_t PyLong_AsSsize_t #define PyInt_AsUnsignedLongMask PyLong_AsUnsignedLongMask #define PyInt_AsUnsignedLongLongMask PyLong_AsUnsignedLongLongMask #define PyNumber_Int PyNumber_Long #endif #if PY_MAJOR_VERSION >= 3 #define PyBoolObject PyLongObject #endif #if PY_MAJOR_VERSION >= 3 && CYTHON_COMPILING_IN_PYPY #ifndef PyUnicode_InternFromString #define PyUnicode_InternFromString(s) PyUnicode_FromString(s) #endif #endif #if PY_VERSION_HEX < 0x030200A4 typedef long Py_hash_t; #define __Pyx_PyInt_FromHash_t PyInt_FromLong #define __Pyx_PyInt_AsHash_t PyInt_AsLong #else #define __Pyx_PyInt_FromHash_t PyInt_FromSsize_t #define __Pyx_PyInt_AsHash_t PyInt_AsSsize_t #endif #if PY_MAJOR_VERSION >= 3 #define __Pyx_PyMethod_New(func, self, klass) ((self) ? PyMethod_New(func, self) : PyInstanceMethod_New(func)) #else #define __Pyx_PyMethod_New(func, self, klass) PyMethod_New(func, self, klass) #endif #if PY_VERSION_HEX >= 0x030500B1 #define __Pyx_PyAsyncMethodsStruct PyAsyncMethods #define __Pyx_PyType_AsAsync(obj) (Py_TYPE(obj)->tp_as_async) #elif CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3 typedef struct { unaryfunc am_await; unaryfunc am_aiter; unaryfunc am_anext; } __Pyx_PyAsyncMethodsStruct; #define __Pyx_PyType_AsAsync(obj) ((__Pyx_PyAsyncMethodsStruct*) (Py_TYPE(obj)->tp_reserved)) #else #define __Pyx_PyType_AsAsync(obj) NULL #endif #ifndef CYTHON_RESTRICT #if defined(__GNUC__) #define CYTHON_RESTRICT __restrict__ #elif defined(_MSC_VER) && _MSC_VER >= 1400 #define CYTHON_RESTRICT __restrict #elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L #define CYTHON_RESTRICT restrict #else #define CYTHON_RESTRICT #endif #endif #define __Pyx_void_to_None(void_result) (void_result, Py_INCREF(Py_None), Py_None) #ifndef CYTHON_INLINE #if defined(__GNUC__) #define CYTHON_INLINE __inline__ #elif defined(_MSC_VER) #define CYTHON_INLINE __inline #elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L #define CYTHON_INLINE inline #else #define CYTHON_INLINE #endif #endif #if defined(WIN32) || defined(MS_WINDOWS) #define _USE_MATH_DEFINES #endif #include #ifdef NAN #define __PYX_NAN() ((float) NAN) #else static CYTHON_INLINE float __PYX_NAN() { float value; memset(&value, 0xFF, sizeof(value)); return value; } #endif #if PY_MAJOR_VERSION >= 3 #define __Pyx_PyNumber_Divide(x,y) PyNumber_TrueDivide(x,y) #define __Pyx_PyNumber_InPlaceDivide(x,y) PyNumber_InPlaceTrueDivide(x,y) #else #define __Pyx_PyNumber_Divide(x,y) PyNumber_TrueDivide(x,y) #define __Pyx_PyNumber_InPlaceDivide(x,y) PyNumber_InPlaceTrueDivide(x,y) #endif #ifndef __PYX_EXTERN_C #ifdef __cplusplus #define __PYX_EXTERN_C extern "C" #else #define __PYX_EXTERN_C extern #endif #endif #define __PYX_HAVE__pygame_sdl2__key #define __PYX_HAVE_API__pygame_sdl2__key #include "stdint.h" #include "string.h" #include "stdio.h" #include "stddef.h" #include "SDL.h" #include "stdlib.h" #ifdef _OPENMP #include #endif /* _OPENMP */ #ifdef PYREX_WITHOUT_ASSERTIONS #define CYTHON_WITHOUT_ASSERTIONS #endif #ifndef CYTHON_UNUSED # if defined(__GNUC__) # if !(defined(__cplusplus)) || (__GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 4)) # define CYTHON_UNUSED __attribute__ ((__unused__)) # else # define CYTHON_UNUSED # endif # elif defined(__ICC) || (defined(__INTEL_COMPILER) && !defined(_MSC_VER)) # define CYTHON_UNUSED __attribute__ ((__unused__)) # else # define CYTHON_UNUSED # endif #endif #ifndef CYTHON_NCP_UNUSED # if CYTHON_COMPILING_IN_CPYTHON # define CYTHON_NCP_UNUSED # else # define CYTHON_NCP_UNUSED CYTHON_UNUSED # endif #endif typedef struct {PyObject **p; char *s; const Py_ssize_t n; const char* encoding; const char is_unicode; const char is_str; const char intern; } __Pyx_StringTabEntry; #define __PYX_DEFAULT_STRING_ENCODING_IS_ASCII 0 #define __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT 0 #define __PYX_DEFAULT_STRING_ENCODING "" #define __Pyx_PyObject_FromString __Pyx_PyBytes_FromString #define __Pyx_PyObject_FromStringAndSize __Pyx_PyBytes_FromStringAndSize #define __Pyx_uchar_cast(c) ((unsigned char)c) #define __Pyx_long_cast(x) ((long)x) #define __Pyx_fits_Py_ssize_t(v, type, is_signed) (\ (sizeof(type) < sizeof(Py_ssize_t)) ||\ (sizeof(type) > sizeof(Py_ssize_t) &&\ likely(v < (type)PY_SSIZE_T_MAX ||\ v == (type)PY_SSIZE_T_MAX) &&\ (!is_signed || likely(v > (type)PY_SSIZE_T_MIN ||\ v == (type)PY_SSIZE_T_MIN))) ||\ (sizeof(type) == sizeof(Py_ssize_t) &&\ (is_signed || likely(v < (type)PY_SSIZE_T_MAX ||\ v == (type)PY_SSIZE_T_MAX))) ) #if defined (__cplusplus) && __cplusplus >= 201103L #include #define __Pyx_sst_abs(value) std::abs(value) #elif SIZEOF_INT >= SIZEOF_SIZE_T #define __Pyx_sst_abs(value) abs(value) #elif SIZEOF_LONG >= SIZEOF_SIZE_T #define __Pyx_sst_abs(value) labs(value) #elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L #define __Pyx_sst_abs(value) llabs(value) #elif defined (_MSC_VER) && defined (_M_X64) #define __Pyx_sst_abs(value) _abs64(value) #elif defined (__GNUC__) #define __Pyx_sst_abs(value) __builtin_llabs(value) #else #define __Pyx_sst_abs(value) ((value<0) ? -value : value) #endif static CYTHON_INLINE char* __Pyx_PyObject_AsString(PyObject*); static CYTHON_INLINE char* __Pyx_PyObject_AsStringAndSize(PyObject*, Py_ssize_t* length); #define __Pyx_PyByteArray_FromString(s) PyByteArray_FromStringAndSize((const char*)s, strlen((const char*)s)) #define __Pyx_PyByteArray_FromStringAndSize(s, l) PyByteArray_FromStringAndSize((const char*)s, l) #define __Pyx_PyBytes_FromString PyBytes_FromString #define __Pyx_PyBytes_FromStringAndSize PyBytes_FromStringAndSize static CYTHON_INLINE PyObject* __Pyx_PyUnicode_FromString(const char*); #if PY_MAJOR_VERSION < 3 #define __Pyx_PyStr_FromString __Pyx_PyBytes_FromString #define __Pyx_PyStr_FromStringAndSize __Pyx_PyBytes_FromStringAndSize #else #define __Pyx_PyStr_FromString __Pyx_PyUnicode_FromString #define __Pyx_PyStr_FromStringAndSize __Pyx_PyUnicode_FromStringAndSize #endif #define __Pyx_PyObject_AsSString(s) ((signed char*) __Pyx_PyObject_AsString(s)) #define __Pyx_PyObject_AsUString(s) ((unsigned char*) __Pyx_PyObject_AsString(s)) #define __Pyx_PyObject_FromCString(s) __Pyx_PyObject_FromString((const char*)s) #define __Pyx_PyBytes_FromCString(s) __Pyx_PyBytes_FromString((const char*)s) #define __Pyx_PyByteArray_FromCString(s) __Pyx_PyByteArray_FromString((const char*)s) #define __Pyx_PyStr_FromCString(s) __Pyx_PyStr_FromString((const char*)s) #define __Pyx_PyUnicode_FromCString(s) __Pyx_PyUnicode_FromString((const char*)s) #if PY_MAJOR_VERSION < 3 static CYTHON_INLINE size_t __Pyx_Py_UNICODE_strlen(const Py_UNICODE *u) { const Py_UNICODE *u_end = u; while (*u_end++) ; return (size_t)(u_end - u - 1); } #else #define __Pyx_Py_UNICODE_strlen Py_UNICODE_strlen #endif #define __Pyx_PyUnicode_FromUnicode(u) PyUnicode_FromUnicode(u, __Pyx_Py_UNICODE_strlen(u)) #define __Pyx_PyUnicode_FromUnicodeAndLength PyUnicode_FromUnicode #define __Pyx_PyUnicode_AsUnicode PyUnicode_AsUnicode #define __Pyx_NewRef(obj) (Py_INCREF(obj), obj) #define __Pyx_Owned_Py_None(b) __Pyx_NewRef(Py_None) #define __Pyx_PyBool_FromLong(b) ((b) ? __Pyx_NewRef(Py_True) : __Pyx_NewRef(Py_False)) static CYTHON_INLINE int __Pyx_PyObject_IsTrue(PyObject*); static CYTHON_INLINE PyObject* __Pyx_PyNumber_Int(PyObject* x); static CYTHON_INLINE Py_ssize_t __Pyx_PyIndex_AsSsize_t(PyObject*); static CYTHON_INLINE PyObject * __Pyx_PyInt_FromSize_t(size_t); #if CYTHON_COMPILING_IN_CPYTHON #define __pyx_PyFloat_AsDouble(x) (PyFloat_CheckExact(x) ? PyFloat_AS_DOUBLE(x) : PyFloat_AsDouble(x)) #else #define __pyx_PyFloat_AsDouble(x) PyFloat_AsDouble(x) #endif #define __pyx_PyFloat_AsFloat(x) ((float) __pyx_PyFloat_AsDouble(x)) #if PY_MAJOR_VERSION < 3 && __PYX_DEFAULT_STRING_ENCODING_IS_ASCII static int __Pyx_sys_getdefaultencoding_not_ascii; static int __Pyx_init_sys_getdefaultencoding_params(void) { PyObject* sys; PyObject* default_encoding = NULL; PyObject* ascii_chars_u = NULL; PyObject* ascii_chars_b = NULL; const char* default_encoding_c; sys = PyImport_ImportModule("sys"); if (!sys) goto bad; default_encoding = PyObject_CallMethod(sys, (char*) "getdefaultencoding", NULL); Py_DECREF(sys); if (!default_encoding) goto bad; default_encoding_c = PyBytes_AsString(default_encoding); if (!default_encoding_c) goto bad; if (strcmp(default_encoding_c, "ascii") == 0) { __Pyx_sys_getdefaultencoding_not_ascii = 0; } else { char ascii_chars[128]; int c; for (c = 0; c < 128; c++) { ascii_chars[c] = c; } __Pyx_sys_getdefaultencoding_not_ascii = 1; ascii_chars_u = PyUnicode_DecodeASCII(ascii_chars, 128, NULL); if (!ascii_chars_u) goto bad; ascii_chars_b = PyUnicode_AsEncodedString(ascii_chars_u, default_encoding_c, NULL); if (!ascii_chars_b || !PyBytes_Check(ascii_chars_b) || memcmp(ascii_chars, PyBytes_AS_STRING(ascii_chars_b), 128) != 0) { PyErr_Format( PyExc_ValueError, "This module compiled with c_string_encoding=ascii, but default encoding '%.200s' is not a superset of ascii.", default_encoding_c); goto bad; } Py_DECREF(ascii_chars_u); Py_DECREF(ascii_chars_b); } Py_DECREF(default_encoding); return 0; bad: Py_XDECREF(default_encoding); Py_XDECREF(ascii_chars_u); Py_XDECREF(ascii_chars_b); return -1; } #endif #if __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT && PY_MAJOR_VERSION >= 3 #define __Pyx_PyUnicode_FromStringAndSize(c_str, size) PyUnicode_DecodeUTF8(c_str, size, NULL) #else #define __Pyx_PyUnicode_FromStringAndSize(c_str, size) PyUnicode_Decode(c_str, size, __PYX_DEFAULT_STRING_ENCODING, NULL) #if __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT static char* __PYX_DEFAULT_STRING_ENCODING; static int __Pyx_init_sys_getdefaultencoding_params(void) { PyObject* sys; PyObject* default_encoding = NULL; char* default_encoding_c; sys = PyImport_ImportModule("sys"); if (!sys) goto bad; default_encoding = PyObject_CallMethod(sys, (char*) (const char*) "getdefaultencoding", NULL); Py_DECREF(sys); if (!default_encoding) goto bad; default_encoding_c = PyBytes_AsString(default_encoding); if (!default_encoding_c) goto bad; __PYX_DEFAULT_STRING_ENCODING = (char*) malloc(strlen(default_encoding_c)); if (!__PYX_DEFAULT_STRING_ENCODING) goto bad; strcpy(__PYX_DEFAULT_STRING_ENCODING, default_encoding_c); Py_DECREF(default_encoding); return 0; bad: Py_XDECREF(default_encoding); return -1; } #endif #endif /* Test for GCC > 2.95 */ #if defined(__GNUC__) && (__GNUC__ > 2 || (__GNUC__ == 2 && (__GNUC_MINOR__ > 95))) #define likely(x) __builtin_expect(!!(x), 1) #define unlikely(x) __builtin_expect(!!(x), 0) #else /* !__GNUC__ or GCC < 2.95 */ #define likely(x) (x) #define unlikely(x) (x) #endif /* __GNUC__ */ static PyObject *__pyx_m; static PyObject *__pyx_d; static PyObject *__pyx_b; static PyObject *__pyx_empty_tuple; static PyObject *__pyx_empty_bytes; static int __pyx_lineno; static int __pyx_clineno = 0; static const char * __pyx_cfilenm= __FILE__; static const char *__pyx_filename; static const char *__pyx_f[] = { "src/pygame_sdl2/key.pyx", "src/pygame_sdl2/surface.pxd", "src/pygame_sdl2/display.pxd", "src/pygame_sdl2/rect.pxd", }; /*--- Type declarations ---*/ struct __pyx_obj_11pygame_sdl2_7surface_Surface; struct __pyx_obj_11pygame_sdl2_7display_Window; struct __pyx_obj_11pygame_sdl2_4rect_Rect; struct __pyx_obj_11pygame_sdl2_3key_KeyboardState; struct __pyx_opt_args_11pygame_sdl2_4rect_to_sdl_rect; /* "pygame_sdl2/rect.pxd":31 * * * cdef int to_sdl_rect(rectlike, SDL_Rect *rect, argname=*) except -1 # <<<<<<<<<<<<<< */ struct __pyx_opt_args_11pygame_sdl2_4rect_to_sdl_rect { int __pyx_n; PyObject *argname; }; /* "pygame_sdl2/surface.pxd":23 * from sdl2 cimport SDL_Surface * * cdef class Surface: # <<<<<<<<<<<<<< * # Allow weak references. * cdef object __weakref__ */ struct __pyx_obj_11pygame_sdl2_7surface_Surface { PyObject_HEAD struct __pyx_vtabstruct_11pygame_sdl2_7surface_Surface *__pyx_vtab; PyObject *__weakref__; SDL_Surface *surface; int owns_surface; int window_surface; PyObject *locklist; struct __pyx_obj_11pygame_sdl2_7surface_Surface *parent; struct __pyx_obj_11pygame_sdl2_7surface_Surface *root; int offset_x; int offset_y; PyObject *get_window_flags; int has_alpha; }; /* "pygame_sdl2/display.pxd":23 * from pygame_sdl2.surface cimport Surface * * cdef class Window: # <<<<<<<<<<<<<< * # Allow weak references. * cdef object __weakref__ */ struct __pyx_obj_11pygame_sdl2_7display_Window { PyObject_HEAD PyObject *__weakref__; SDL_Window *window; SDL_Surface *window_surface; struct __pyx_obj_11pygame_sdl2_7surface_Surface *surface; SDL_GLContext gl_context; Uint32 create_flags; }; /* "pygame_sdl2/rect.pxd":21 * from sdl2 cimport * * * cdef class Rect: # <<<<<<<<<<<<<< * # Allow weak references. * cdef object __weakref__ */ struct __pyx_obj_11pygame_sdl2_4rect_Rect { PyObject_HEAD PyObject *__weakref__; int x; int y; int w; int h; }; /* "pygame_sdl2/key.pyx":28 * * * cdef class KeyboardState: # <<<<<<<<<<<<<< * # Allow weak references. * cdef object __weakref__ */ struct __pyx_obj_11pygame_sdl2_3key_KeyboardState { PyObject_HEAD PyObject *__weakref__; uint8_t *data; int numkeys; }; /* "pygame_sdl2/surface.pxd":23 * from sdl2 cimport SDL_Surface * * cdef class Surface: # <<<<<<<<<<<<<< * # Allow weak references. * cdef object __weakref__ */ struct __pyx_vtabstruct_11pygame_sdl2_7surface_Surface { void (*take_surface)(struct __pyx_obj_11pygame_sdl2_7surface_Surface *, SDL_Surface *); }; static struct __pyx_vtabstruct_11pygame_sdl2_7surface_Surface *__pyx_vtabptr_11pygame_sdl2_7surface_Surface; /* --- Runtime support code (head) --- */ #ifndef CYTHON_REFNANNY #define CYTHON_REFNANNY 0 #endif #if CYTHON_REFNANNY typedef struct { void (*INCREF)(void*, PyObject*, int); void (*DECREF)(void*, PyObject*, int); void (*GOTREF)(void*, PyObject*, int); void (*GIVEREF)(void*, PyObject*, int); void* (*SetupContext)(const char*, int, const char*); void (*FinishContext)(void**); } __Pyx_RefNannyAPIStruct; static __Pyx_RefNannyAPIStruct *__Pyx_RefNanny = NULL; static __Pyx_RefNannyAPIStruct *__Pyx_RefNannyImportAPI(const char *modname); #define __Pyx_RefNannyDeclarations void *__pyx_refnanny = NULL; #ifdef WITH_THREAD #define __Pyx_RefNannySetupContext(name, acquire_gil)\ if (acquire_gil) {\ PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure();\ __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), __LINE__, __FILE__);\ PyGILState_Release(__pyx_gilstate_save);\ } else {\ __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), __LINE__, __FILE__);\ } #else #define __Pyx_RefNannySetupContext(name, acquire_gil)\ __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), __LINE__, __FILE__) #endif #define __Pyx_RefNannyFinishContext()\ __Pyx_RefNanny->FinishContext(&__pyx_refnanny) #define __Pyx_INCREF(r) __Pyx_RefNanny->INCREF(__pyx_refnanny, (PyObject *)(r), __LINE__) #define __Pyx_DECREF(r) __Pyx_RefNanny->DECREF(__pyx_refnanny, (PyObject *)(r), __LINE__) #define __Pyx_GOTREF(r) __Pyx_RefNanny->GOTREF(__pyx_refnanny, (PyObject *)(r), __LINE__) #define __Pyx_GIVEREF(r) __Pyx_RefNanny->GIVEREF(__pyx_refnanny, (PyObject *)(r), __LINE__) #define __Pyx_XINCREF(r) do { if((r) != NULL) {__Pyx_INCREF(r); }} while(0) #define __Pyx_XDECREF(r) do { if((r) != NULL) {__Pyx_DECREF(r); }} while(0) #define __Pyx_XGOTREF(r) do { if((r) != NULL) {__Pyx_GOTREF(r); }} while(0) #define __Pyx_XGIVEREF(r) do { if((r) != NULL) {__Pyx_GIVEREF(r);}} while(0) #else #define __Pyx_RefNannyDeclarations #define __Pyx_RefNannySetupContext(name, acquire_gil) #define __Pyx_RefNannyFinishContext() #define __Pyx_INCREF(r) Py_INCREF(r) #define __Pyx_DECREF(r) Py_DECREF(r) #define __Pyx_GOTREF(r) #define __Pyx_GIVEREF(r) #define __Pyx_XINCREF(r) Py_XINCREF(r) #define __Pyx_XDECREF(r) Py_XDECREF(r) #define __Pyx_XGOTREF(r) #define __Pyx_XGIVEREF(r) #endif #define __Pyx_XDECREF_SET(r, v) do {\ PyObject *tmp = (PyObject *) r;\ r = v; __Pyx_XDECREF(tmp);\ } while (0) #define __Pyx_DECREF_SET(r, v) do {\ PyObject *tmp = (PyObject *) r;\ r = v; __Pyx_DECREF(tmp);\ } while (0) #define __Pyx_CLEAR(r) do { PyObject* tmp = ((PyObject*)(r)); r = NULL; __Pyx_DECREF(tmp);} while(0) #define __Pyx_XCLEAR(r) do { if((r) != NULL) {PyObject* tmp = ((PyObject*)(r)); r = NULL; __Pyx_DECREF(tmp);}} while(0) #if CYTHON_COMPILING_IN_CPYTHON static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStr(PyObject* obj, PyObject* attr_name) { PyTypeObject* tp = Py_TYPE(obj); if (likely(tp->tp_getattro)) return tp->tp_getattro(obj, attr_name); #if PY_MAJOR_VERSION < 3 if (likely(tp->tp_getattr)) return tp->tp_getattr(obj, PyString_AS_STRING(attr_name)); #endif return PyObject_GetAttr(obj, attr_name); } #else #define __Pyx_PyObject_GetAttrStr(o,n) PyObject_GetAttr(o,n) #endif static PyObject *__Pyx_GetBuiltinName(PyObject *name); static void __Pyx_RaiseArgtupleInvalid(const char* func_name, int exact, Py_ssize_t num_min, Py_ssize_t num_max, Py_ssize_t num_found); static CYTHON_INLINE int __Pyx_CheckKeywordStrings(PyObject *kwdict, const char* function_name, int kw_allowed); static CYTHON_INLINE PyObject *__Pyx_GetModuleGlobalName(PyObject *name); #if CYTHON_COMPILING_IN_CPYTHON static CYTHON_INLINE PyObject* __Pyx_PyObject_Call(PyObject *func, PyObject *arg, PyObject *kw); #else #define __Pyx_PyObject_Call(func, arg, kw) PyObject_Call(func, arg, kw) #endif #if CYTHON_COMPILING_IN_CPYTHON static CYTHON_INLINE PyObject* __Pyx_PyObject_CallMethO(PyObject *func, PyObject *arg); #endif static CYTHON_INLINE PyObject* __Pyx_PyObject_CallOneArg(PyObject *func, PyObject *arg); #if CYTHON_COMPILING_IN_CPYTHON static CYTHON_INLINE PyObject* __Pyx_PyObject_CallNoArg(PyObject *func); #else #define __Pyx_PyObject_CallNoArg(func) __Pyx_PyObject_Call(func, __pyx_empty_tuple, NULL) #endif static CYTHON_INLINE void __Pyx_ErrRestore(PyObject *type, PyObject *value, PyObject *tb); static CYTHON_INLINE void __Pyx_ErrFetch(PyObject **type, PyObject **value, PyObject **tb); static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, PyObject *cause); static void __Pyx_RaiseDoubleKeywordsError(const char* func_name, PyObject* kw_name); static int __Pyx_ParseOptionalKeywords(PyObject *kwds, PyObject **argnames[],\ PyObject *kwds2, PyObject *values[], Py_ssize_t num_pos_args,\ const char* function_name); static CYTHON_INLINE int __Pyx_ArgTypeTest(PyObject *obj, PyTypeObject *type, int none_allowed, const char *name, int exact); static void* __Pyx_GetVtable(PyObject *dict); static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list, int level); static PyObject* __Pyx_ImportFrom(PyObject* module, PyObject* name); typedef struct { int code_line; PyCodeObject* code_object; } __Pyx_CodeObjectCacheEntry; struct __Pyx_CodeObjectCache { int count; int max_count; __Pyx_CodeObjectCacheEntry* entries; }; static struct __Pyx_CodeObjectCache __pyx_code_cache = {0,0,NULL}; static int __pyx_bisect_code_objects(__Pyx_CodeObjectCacheEntry* entries, int count, int code_line); static PyCodeObject *__pyx_find_code_object(int code_line); static void __pyx_insert_code_object(int code_line, PyCodeObject* code_object); static void __Pyx_AddTraceback(const char *funcname, int c_line, int py_line, const char *filename); static CYTHON_INLINE int __Pyx_PyInt_As_int(PyObject *); static CYTHON_INLINE PyObject* __Pyx_PyInt_From_uint8_t(uint8_t value); static CYTHON_INLINE PyObject* __Pyx_PyInt_From_SDL_Keymod(SDL_Keymod value); static CYTHON_INLINE SDL_Keymod __Pyx_PyInt_As_SDL_Keymod(PyObject *); static CYTHON_INLINE int32_t __Pyx_PyInt_As_int32_t(PyObject *); static CYTHON_INLINE PyObject* __Pyx_PyInt_From_SDL_bool(SDL_bool value); static CYTHON_INLINE PyObject* __Pyx_PyInt_From_long(long value); static CYTHON_INLINE long __Pyx_PyInt_As_long(PyObject *); static int __Pyx_check_binary_version(void); #if !defined(__Pyx_PyIdentifier_FromString) #if PY_MAJOR_VERSION < 3 #define __Pyx_PyIdentifier_FromString(s) PyString_FromString(s) #else #define __Pyx_PyIdentifier_FromString(s) PyUnicode_FromString(s) #endif #endif static PyObject *__Pyx_ImportModule(const char *name); static PyTypeObject *__Pyx_ImportType(const char *module_name, const char *class_name, size_t size, int strict); static int __Pyx_ImportVoidPtr(PyObject *module, const char *name, void **p, const char *sig); static int __Pyx_ImportFunction(PyObject *module, const char *funcname, void (**f)(void), const char *sig); static int __Pyx_InitStrings(__Pyx_StringTabEntry *t); /* Module declarations from 'libc.stdint' */ /* Module declarations from 'libc.string' */ /* Module declarations from 'libc.stdio' */ /* Module declarations from 'libc.stddef' */ /* Module declarations from 'sdl2' */ /* Module declarations from 'libc.stdlib' */ /* Module declarations from 'pygame_sdl2.surface' */ static PyTypeObject *__pyx_ptype_11pygame_sdl2_7surface_Surface = 0; /* Module declarations from 'pygame_sdl2.display' */ static PyTypeObject *__pyx_ptype_11pygame_sdl2_7display_Window = 0; static struct __pyx_obj_11pygame_sdl2_7display_Window **__pyx_vp_11pygame_sdl2_7display_main_window = 0; #define __pyx_v_11pygame_sdl2_7display_main_window (*__pyx_vp_11pygame_sdl2_7display_main_window) /* Module declarations from 'pygame_sdl2.rect' */ static PyTypeObject *__pyx_ptype_11pygame_sdl2_4rect_Rect = 0; static int (*__pyx_f_11pygame_sdl2_4rect_to_sdl_rect)(PyObject *, SDL_Rect *, struct __pyx_opt_args_11pygame_sdl2_4rect_to_sdl_rect *__pyx_optional_args); /*proto*/ /* Module declarations from 'pygame_sdl2.key' */ static PyTypeObject *__pyx_ptype_11pygame_sdl2_3key_KeyboardState = 0; #define __Pyx_MODULE_NAME "pygame_sdl2.key" int __pyx_module_is_main_pygame_sdl2__key = 0; /* Implementation of 'pygame_sdl2.key' */ static PyObject *__pyx_builtin_IndexError; static char __pyx_k_key[] = "key"; static char __pyx_k_main[] = "__main__"; static char __pyx_k_name[] = "name"; static char __pyx_k_rect[] = "rect"; static char __pyx_k_test[] = "__test__"; static char __pyx_k_delay[] = "delay"; static char __pyx_k_error[] = "error"; static char __pyx_k_state[] = "state"; static char __pyx_k_import[] = "__import__"; static char __pyx_k_window[] = "window"; static char __pyx_k_get_mods[] = "get_mods"; static char __pyx_k_interval[] = "interval"; static char __pyx_k_sdl_rect[] = "sdl_rect"; static char __pyx_k_set_mods[] = "set_mods"; static char __pyx_k_IndexError[] = "IndexError"; static char __pyx_k_get_repeat[] = "get_repeat"; static char __pyx_k_pyx_vtable[] = "__pyx_vtable__"; static char __pyx_k_set_repeat[] = "set_repeat"; static char __pyx_k_text_input[] = "text_input"; static char __pyx_k_get_focused[] = "get_focused"; static char __pyx_k_get_pressed[] = "get_pressed"; static char __pyx_k_Out_of_range[] = "Out of range."; static char __pyx_k_pygame_sdl2_key[] = "pygame_sdl2.key"; static char __pyx_k_stop_text_input[] = "stop_text_input"; static char __pyx_k_start_text_input[] = "start_text_input"; static char __pyx_k_pygame_sdl2_error[] = "pygame_sdl2.error"; static char __pyx_k_set_text_input_rect[] = "set_text_input_rect"; static char __pyx_k_is_screen_keyboard_shown[] = "is_screen_keyboard_shown"; static char __pyx_k_has_screen_keyboard_support[] = "has_screen_keyboard_support"; static char __pyx_k_home_tom_ab_pygame_sdl2_src_pyg[] = "/home/tom/ab/pygame_sdl2/src/pygame_sdl2/key.pyx"; static PyObject *__pyx_n_s_IndexError; static PyObject *__pyx_kp_u_Out_of_range; static PyObject *__pyx_n_s_delay; static PyObject *__pyx_n_s_error; static PyObject *__pyx_n_s_get_focused; static PyObject *__pyx_n_s_get_mods; static PyObject *__pyx_n_s_get_pressed; static PyObject *__pyx_n_s_get_repeat; static PyObject *__pyx_n_s_has_screen_keyboard_support; static PyObject *__pyx_kp_s_home_tom_ab_pygame_sdl2_src_pyg; static PyObject *__pyx_n_s_import; static PyObject *__pyx_n_s_interval; static PyObject *__pyx_n_s_is_screen_keyboard_shown; static PyObject *__pyx_n_s_key; static PyObject *__pyx_n_s_main; static PyObject *__pyx_n_s_name; static PyObject *__pyx_n_s_pygame_sdl2_error; static PyObject *__pyx_n_s_pygame_sdl2_key; static PyObject *__pyx_n_s_pyx_vtable; static PyObject *__pyx_n_s_rect; static PyObject *__pyx_n_s_sdl_rect; static PyObject *__pyx_n_s_set_mods; static PyObject *__pyx_n_s_set_repeat; static PyObject *__pyx_n_s_set_text_input_rect; static PyObject *__pyx_n_s_start_text_input; static PyObject *__pyx_n_s_state; static PyObject *__pyx_n_s_stop_text_input; static PyObject *__pyx_n_s_test; static PyObject *__pyx_n_s_text_input; static PyObject *__pyx_n_s_window; static int __pyx_pf_11pygame_sdl2_3key_13KeyboardState___cinit__(struct __pyx_obj_11pygame_sdl2_3key_KeyboardState *__pyx_v_self); /* proto */ static void __pyx_pf_11pygame_sdl2_3key_13KeyboardState_2__dealloc__(struct __pyx_obj_11pygame_sdl2_3key_KeyboardState *__pyx_v_self); /* proto */ static int __pyx_pf_11pygame_sdl2_3key_13KeyboardState_4__init__(struct __pyx_obj_11pygame_sdl2_3key_KeyboardState *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_3key_13KeyboardState_6__getitem__(struct __pyx_obj_11pygame_sdl2_3key_KeyboardState *__pyx_v_self, int __pyx_v_key); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_3key_get_focused(CYTHON_UNUSED PyObject *__pyx_self); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_3key_2get_pressed(CYTHON_UNUSED PyObject *__pyx_self); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_3key_4get_mods(CYTHON_UNUSED PyObject *__pyx_self); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_3key_6set_mods(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_state); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_3key_8set_repeat(CYTHON_UNUSED PyObject *__pyx_self, CYTHON_UNUSED PyObject *__pyx_v_delay, CYTHON_UNUSED PyObject *__pyx_v_interval); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_3key_10get_repeat(CYTHON_UNUSED PyObject *__pyx_self); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_3key_12name(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_key); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_3key_14start_text_input(CYTHON_UNUSED PyObject *__pyx_self); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_3key_16stop_text_input(CYTHON_UNUSED PyObject *__pyx_self); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_3key_18set_text_input_rect(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_rect); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_3key_20has_screen_keyboard_support(CYTHON_UNUSED PyObject *__pyx_self); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_3key_22is_screen_keyboard_shown(CYTHON_UNUSED PyObject *__pyx_self, struct __pyx_obj_11pygame_sdl2_7display_Window *__pyx_v_window); /* proto */ static PyObject *__pyx_tp_new_11pygame_sdl2_3key_KeyboardState(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ static PyObject *__pyx_int_0; static PyObject *__pyx_tuple_; static PyObject *__pyx_tuple__2; static PyObject *__pyx_tuple__3; static PyObject *__pyx_tuple__7; static PyObject *__pyx_tuple__9; static PyObject *__pyx_tuple__12; static PyObject *__pyx_tuple__16; static PyObject *__pyx_tuple__19; static PyObject *__pyx_codeobj__4; static PyObject *__pyx_codeobj__5; static PyObject *__pyx_codeobj__6; static PyObject *__pyx_codeobj__8; static PyObject *__pyx_codeobj__10; static PyObject *__pyx_codeobj__11; static PyObject *__pyx_codeobj__13; static PyObject *__pyx_codeobj__14; static PyObject *__pyx_codeobj__15; static PyObject *__pyx_codeobj__17; static PyObject *__pyx_codeobj__18; static PyObject *__pyx_codeobj__20; /* "pygame_sdl2/key.pyx":35 * cdef int numkeys * * def __cinit__(self): # <<<<<<<<<<<<<< * self.data = NULL * */ /* Python wrapper */ static int __pyx_pw_11pygame_sdl2_3key_13KeyboardState_1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static int __pyx_pw_11pygame_sdl2_3key_13KeyboardState_1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__cinit__ (wrapper)", 0); if (unlikely(PyTuple_GET_SIZE(__pyx_args) > 0)) { __Pyx_RaiseArgtupleInvalid("__cinit__", 1, 0, 0, PyTuple_GET_SIZE(__pyx_args)); return -1;} if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "__cinit__", 0))) return -1; __pyx_r = __pyx_pf_11pygame_sdl2_3key_13KeyboardState___cinit__(((struct __pyx_obj_11pygame_sdl2_3key_KeyboardState *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static int __pyx_pf_11pygame_sdl2_3key_13KeyboardState___cinit__(struct __pyx_obj_11pygame_sdl2_3key_KeyboardState *__pyx_v_self) { int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__cinit__", 0); /* "pygame_sdl2/key.pyx":36 * * def __cinit__(self): * self.data = NULL # <<<<<<<<<<<<<< * * def __dealloc__(self): */ __pyx_v_self->data = NULL; /* "pygame_sdl2/key.pyx":35 * cdef int numkeys * * def __cinit__(self): # <<<<<<<<<<<<<< * self.data = NULL * */ /* function exit code */ __pyx_r = 0; __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/key.pyx":38 * self.data = NULL * * def __dealloc__(self): # <<<<<<<<<<<<<< * if self.data != NULL: * free(self.data) */ /* Python wrapper */ static void __pyx_pw_11pygame_sdl2_3key_13KeyboardState_3__dealloc__(PyObject *__pyx_v_self); /*proto*/ static void __pyx_pw_11pygame_sdl2_3key_13KeyboardState_3__dealloc__(PyObject *__pyx_v_self) { __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__dealloc__ (wrapper)", 0); __pyx_pf_11pygame_sdl2_3key_13KeyboardState_2__dealloc__(((struct __pyx_obj_11pygame_sdl2_3key_KeyboardState *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); } static void __pyx_pf_11pygame_sdl2_3key_13KeyboardState_2__dealloc__(struct __pyx_obj_11pygame_sdl2_3key_KeyboardState *__pyx_v_self) { __Pyx_RefNannyDeclarations int __pyx_t_1; __Pyx_RefNannySetupContext("__dealloc__", 0); /* "pygame_sdl2/key.pyx":39 * * def __dealloc__(self): * if self.data != NULL: # <<<<<<<<<<<<<< * free(self.data) * */ __pyx_t_1 = ((__pyx_v_self->data != NULL) != 0); if (__pyx_t_1) { /* "pygame_sdl2/key.pyx":40 * def __dealloc__(self): * if self.data != NULL: * free(self.data) # <<<<<<<<<<<<<< * * def __init__(self): */ free(__pyx_v_self->data); /* "pygame_sdl2/key.pyx":39 * * def __dealloc__(self): * if self.data != NULL: # <<<<<<<<<<<<<< * free(self.data) * */ } /* "pygame_sdl2/key.pyx":38 * self.data = NULL * * def __dealloc__(self): # <<<<<<<<<<<<<< * if self.data != NULL: * free(self.data) */ /* function exit code */ __Pyx_RefNannyFinishContext(); } /* "pygame_sdl2/key.pyx":42 * free(self.data) * * def __init__(self): # <<<<<<<<<<<<<< * cdef uint8_t *state = SDL_GetKeyboardState(&self.numkeys) * if state == NULL: */ /* Python wrapper */ static int __pyx_pw_11pygame_sdl2_3key_13KeyboardState_5__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static int __pyx_pw_11pygame_sdl2_3key_13KeyboardState_5__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__init__ (wrapper)", 0); if (unlikely(PyTuple_GET_SIZE(__pyx_args) > 0)) { __Pyx_RaiseArgtupleInvalid("__init__", 1, 0, 0, PyTuple_GET_SIZE(__pyx_args)); return -1;} if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "__init__", 0))) return -1; __pyx_r = __pyx_pf_11pygame_sdl2_3key_13KeyboardState_4__init__(((struct __pyx_obj_11pygame_sdl2_3key_KeyboardState *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static int __pyx_pf_11pygame_sdl2_3key_13KeyboardState_4__init__(struct __pyx_obj_11pygame_sdl2_3key_KeyboardState *__pyx_v_self) { uint8_t *__pyx_v_state; int __pyx_r; __Pyx_RefNannyDeclarations int __pyx_t_1; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__init__", 0); /* "pygame_sdl2/key.pyx":43 * * def __init__(self): * cdef uint8_t *state = SDL_GetKeyboardState(&self.numkeys) # <<<<<<<<<<<<<< * if state == NULL: * raise error() */ __pyx_v_state = SDL_GetKeyboardState((&__pyx_v_self->numkeys)); /* "pygame_sdl2/key.pyx":44 * def __init__(self): * cdef uint8_t *state = SDL_GetKeyboardState(&self.numkeys) * if state == NULL: # <<<<<<<<<<<<<< * raise error() * */ __pyx_t_1 = ((__pyx_v_state == NULL) != 0); if (__pyx_t_1) { /* "pygame_sdl2/key.pyx":45 * cdef uint8_t *state = SDL_GetKeyboardState(&self.numkeys) * if state == NULL: * raise error() # <<<<<<<<<<<<<< * * # Take a snapshot of the current state, rather than saving the pointer. */ __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_error); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 45; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = NULL; if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_3))) { __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3); if (likely(__pyx_t_4)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); __Pyx_INCREF(__pyx_t_4); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_3, function); } } if (__pyx_t_4) { __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 45; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; } else { __pyx_t_2 = __Pyx_PyObject_CallNoArg(__pyx_t_3); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 45; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_Raise(__pyx_t_2, 0, 0, 0); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; {__pyx_filename = __pyx_f[0]; __pyx_lineno = 45; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "pygame_sdl2/key.pyx":44 * def __init__(self): * cdef uint8_t *state = SDL_GetKeyboardState(&self.numkeys) * if state == NULL: # <<<<<<<<<<<<<< * raise error() * */ } /* "pygame_sdl2/key.pyx":48 * * # Take a snapshot of the current state, rather than saving the pointer. * self.data = malloc(self.numkeys) # <<<<<<<<<<<<<< * memcpy(self.data, state, self.numkeys) * */ __pyx_v_self->data = ((uint8_t *)malloc(__pyx_v_self->numkeys)); /* "pygame_sdl2/key.pyx":49 * # Take a snapshot of the current state, rather than saving the pointer. * self.data = malloc(self.numkeys) * memcpy(self.data, state, self.numkeys) # <<<<<<<<<<<<<< * * def __getitem__(self, int key): */ memcpy(__pyx_v_self->data, __pyx_v_state, __pyx_v_self->numkeys); /* "pygame_sdl2/key.pyx":42 * free(self.data) * * def __init__(self): # <<<<<<<<<<<<<< * cdef uint8_t *state = SDL_GetKeyboardState(&self.numkeys) * if state == NULL: */ /* function exit code */ __pyx_r = 0; goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_AddTraceback("pygame_sdl2.key.KeyboardState.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = -1; __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/key.pyx":51 * memcpy(self.data, state, self.numkeys) * * def __getitem__(self, int key): # <<<<<<<<<<<<<< * if SDLK_DELETE < key < SDLK_CAPSLOCK: * raise IndexError("Out of range.") */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_3key_13KeyboardState_7__getitem__(PyObject *__pyx_v_self, PyObject *__pyx_arg_key); /*proto*/ static PyObject *__pyx_pw_11pygame_sdl2_3key_13KeyboardState_7__getitem__(PyObject *__pyx_v_self, PyObject *__pyx_arg_key) { int __pyx_v_key; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__getitem__ (wrapper)", 0); assert(__pyx_arg_key); { __pyx_v_key = __Pyx_PyInt_As_int(__pyx_arg_key); if (unlikely((__pyx_v_key == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 51; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; __Pyx_AddTraceback("pygame_sdl2.key.KeyboardState.__getitem__", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_11pygame_sdl2_3key_13KeyboardState_6__getitem__(((struct __pyx_obj_11pygame_sdl2_3key_KeyboardState *)__pyx_v_self), ((int)__pyx_v_key)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_3key_13KeyboardState_6__getitem__(struct __pyx_obj_11pygame_sdl2_3key_KeyboardState *__pyx_v_self, int __pyx_v_key) { int __pyx_v_sc; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; int __pyx_t_2; PyObject *__pyx_t_3 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__getitem__", 0); /* "pygame_sdl2/key.pyx":52 * * def __getitem__(self, int key): * if SDLK_DELETE < key < SDLK_CAPSLOCK: # <<<<<<<<<<<<<< * raise IndexError("Out of range.") * */ __pyx_t_1 = (SDLK_DELETE < __pyx_v_key); if (__pyx_t_1) { __pyx_t_1 = (__pyx_v_key < SDLK_CAPSLOCK); } __pyx_t_2 = (__pyx_t_1 != 0); if (__pyx_t_2) { /* "pygame_sdl2/key.pyx":53 * def __getitem__(self, int key): * if SDLK_DELETE < key < SDLK_CAPSLOCK: * raise IndexError("Out of range.") # <<<<<<<<<<<<<< * * cdef int sc = SDL_GetScancodeFromKey(key) */ __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_IndexError, __pyx_tuple_, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 53; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __Pyx_Raise(__pyx_t_3, 0, 0, 0); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; {__pyx_filename = __pyx_f[0]; __pyx_lineno = 53; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "pygame_sdl2/key.pyx":52 * * def __getitem__(self, int key): * if SDLK_DELETE < key < SDLK_CAPSLOCK: # <<<<<<<<<<<<<< * raise IndexError("Out of range.") * */ } /* "pygame_sdl2/key.pyx":55 * raise IndexError("Out of range.") * * cdef int sc = SDL_GetScancodeFromKey(key) # <<<<<<<<<<<<<< * if sc > self.numkeys: * raise IndexError("Out of range.") */ __pyx_v_sc = ((int)SDL_GetScancodeFromKey(__pyx_v_key)); /* "pygame_sdl2/key.pyx":56 * * cdef int sc = SDL_GetScancodeFromKey(key) * if sc > self.numkeys: # <<<<<<<<<<<<<< * raise IndexError("Out of range.") * */ __pyx_t_2 = ((__pyx_v_sc > __pyx_v_self->numkeys) != 0); if (__pyx_t_2) { /* "pygame_sdl2/key.pyx":57 * cdef int sc = SDL_GetScancodeFromKey(key) * if sc > self.numkeys: * raise IndexError("Out of range.") # <<<<<<<<<<<<<< * * return self.data[sc] */ __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_IndexError, __pyx_tuple__2, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 57; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __Pyx_Raise(__pyx_t_3, 0, 0, 0); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; {__pyx_filename = __pyx_f[0]; __pyx_lineno = 57; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "pygame_sdl2/key.pyx":56 * * cdef int sc = SDL_GetScancodeFromKey(key) * if sc > self.numkeys: # <<<<<<<<<<<<<< * raise IndexError("Out of range.") * */ } /* "pygame_sdl2/key.pyx":59 * raise IndexError("Out of range.") * * return self.data[sc] # <<<<<<<<<<<<<< * * */ __Pyx_XDECREF(__pyx_r); __pyx_t_3 = __Pyx_PyInt_From_uint8_t((__pyx_v_self->data[__pyx_v_sc])); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 59; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __pyx_r = __pyx_t_3; __pyx_t_3 = 0; goto __pyx_L0; /* "pygame_sdl2/key.pyx":51 * memcpy(self.data, state, self.numkeys) * * def __getitem__(self, int key): # <<<<<<<<<<<<<< * if SDLK_DELETE < key < SDLK_CAPSLOCK: * raise IndexError("Out of range.") */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("pygame_sdl2.key.KeyboardState.__getitem__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/key.pyx":62 * * * def get_focused(): # <<<<<<<<<<<<<< * return SDL_GetKeyboardFocus() != NULL * */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_3key_1get_focused(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused); /*proto*/ static PyMethodDef __pyx_mdef_11pygame_sdl2_3key_1get_focused = {"get_focused", (PyCFunction)__pyx_pw_11pygame_sdl2_3key_1get_focused, METH_NOARGS, 0}; static PyObject *__pyx_pw_11pygame_sdl2_3key_1get_focused(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("get_focused (wrapper)", 0); __pyx_r = __pyx_pf_11pygame_sdl2_3key_get_focused(__pyx_self); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_3key_get_focused(CYTHON_UNUSED PyObject *__pyx_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("get_focused", 0); /* "pygame_sdl2/key.pyx":63 * * def get_focused(): * return SDL_GetKeyboardFocus() != NULL # <<<<<<<<<<<<<< * * def get_pressed(): */ __Pyx_XDECREF(__pyx_r); __pyx_t_1 = __Pyx_PyBool_FromLong((SDL_GetKeyboardFocus() != NULL)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 63; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "pygame_sdl2/key.pyx":62 * * * def get_focused(): # <<<<<<<<<<<<<< * return SDL_GetKeyboardFocus() != NULL * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("pygame_sdl2.key.get_focused", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/key.pyx":65 * return SDL_GetKeyboardFocus() != NULL * * def get_pressed(): # <<<<<<<<<<<<<< * """ No longer returns a tuple. Use the returned object to check for * individual keys, but don't loop through it. """ */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_3key_3get_pressed(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused); /*proto*/ static char __pyx_doc_11pygame_sdl2_3key_2get_pressed[] = " No longer returns a tuple. Use the returned object to check for\n individual keys, but don't loop through it. "; static PyMethodDef __pyx_mdef_11pygame_sdl2_3key_3get_pressed = {"get_pressed", (PyCFunction)__pyx_pw_11pygame_sdl2_3key_3get_pressed, METH_NOARGS, __pyx_doc_11pygame_sdl2_3key_2get_pressed}; static PyObject *__pyx_pw_11pygame_sdl2_3key_3get_pressed(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("get_pressed (wrapper)", 0); __pyx_r = __pyx_pf_11pygame_sdl2_3key_2get_pressed(__pyx_self); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_3key_2get_pressed(CYTHON_UNUSED PyObject *__pyx_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("get_pressed", 0); /* "pygame_sdl2/key.pyx":69 * individual keys, but don't loop through it. """ * * return KeyboardState() # <<<<<<<<<<<<<< * * def get_mods(): */ __Pyx_XDECREF(__pyx_r); __pyx_t_1 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_11pygame_sdl2_3key_KeyboardState), __pyx_empty_tuple, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 69; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "pygame_sdl2/key.pyx":65 * return SDL_GetKeyboardFocus() != NULL * * def get_pressed(): # <<<<<<<<<<<<<< * """ No longer returns a tuple. Use the returned object to check for * individual keys, but don't loop through it. """ */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("pygame_sdl2.key.get_pressed", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/key.pyx":71 * return KeyboardState() * * def get_mods(): # <<<<<<<<<<<<<< * return SDL_GetModState() * */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_3key_5get_mods(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused); /*proto*/ static PyMethodDef __pyx_mdef_11pygame_sdl2_3key_5get_mods = {"get_mods", (PyCFunction)__pyx_pw_11pygame_sdl2_3key_5get_mods, METH_NOARGS, 0}; static PyObject *__pyx_pw_11pygame_sdl2_3key_5get_mods(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("get_mods (wrapper)", 0); __pyx_r = __pyx_pf_11pygame_sdl2_3key_4get_mods(__pyx_self); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_3key_4get_mods(CYTHON_UNUSED PyObject *__pyx_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("get_mods", 0); /* "pygame_sdl2/key.pyx":72 * * def get_mods(): * return SDL_GetModState() # <<<<<<<<<<<<<< * * def set_mods(state): */ __Pyx_XDECREF(__pyx_r); __pyx_t_1 = __Pyx_PyInt_From_SDL_Keymod(SDL_GetModState()); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 72; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "pygame_sdl2/key.pyx":71 * return KeyboardState() * * def get_mods(): # <<<<<<<<<<<<<< * return SDL_GetModState() * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("pygame_sdl2.key.get_mods", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/key.pyx":74 * return SDL_GetModState() * * def set_mods(state): # <<<<<<<<<<<<<< * SDL_SetModState(state) * */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_3key_7set_mods(PyObject *__pyx_self, PyObject *__pyx_v_state); /*proto*/ static PyMethodDef __pyx_mdef_11pygame_sdl2_3key_7set_mods = {"set_mods", (PyCFunction)__pyx_pw_11pygame_sdl2_3key_7set_mods, METH_O, 0}; static PyObject *__pyx_pw_11pygame_sdl2_3key_7set_mods(PyObject *__pyx_self, PyObject *__pyx_v_state) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("set_mods (wrapper)", 0); __pyx_r = __pyx_pf_11pygame_sdl2_3key_6set_mods(__pyx_self, ((PyObject *)__pyx_v_state)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_3key_6set_mods(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_state) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations SDL_Keymod __pyx_t_1; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("set_mods", 0); /* "pygame_sdl2/key.pyx":75 * * def set_mods(state): * SDL_SetModState(state) # <<<<<<<<<<<<<< * * def set_repeat(delay=0, interval=0): */ __pyx_t_1 = ((SDL_Keymod)__Pyx_PyInt_As_SDL_Keymod(__pyx_v_state)); if (unlikely(PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 75; __pyx_clineno = __LINE__; goto __pyx_L1_error;} SDL_SetModState(__pyx_t_1); /* "pygame_sdl2/key.pyx":74 * return SDL_GetModState() * * def set_mods(state): # <<<<<<<<<<<<<< * SDL_SetModState(state) * */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("pygame_sdl2.key.set_mods", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/key.pyx":77 * SDL_SetModState(state) * * def set_repeat(delay=0, interval=0): # <<<<<<<<<<<<<< * # Not possible with SDL2. * pass */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_3key_9set_repeat(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static PyMethodDef __pyx_mdef_11pygame_sdl2_3key_9set_repeat = {"set_repeat", (PyCFunction)__pyx_pw_11pygame_sdl2_3key_9set_repeat, METH_VARARGS|METH_KEYWORDS, 0}; static PyObject *__pyx_pw_11pygame_sdl2_3key_9set_repeat(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { CYTHON_UNUSED PyObject *__pyx_v_delay = 0; CYTHON_UNUSED PyObject *__pyx_v_interval = 0; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("set_repeat (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_delay,&__pyx_n_s_interval,0}; PyObject* values[2] = {0,0}; values[0] = ((PyObject *)__pyx_int_0); values[1] = ((PyObject *)__pyx_int_0); if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (kw_args > 0) { PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_delay); if (value) { values[0] = value; kw_args--; } } case 1: if (kw_args > 0) { PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_interval); if (value) { values[1] = value; kw_args--; } } } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "set_repeat") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 77; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } } else { switch (PyTuple_GET_SIZE(__pyx_args)) { case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); case 0: break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_delay = values[0]; __pyx_v_interval = values[1]; } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("set_repeat", 0, 0, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 77; __pyx_clineno = __LINE__; goto __pyx_L3_error;} __pyx_L3_error:; __Pyx_AddTraceback("pygame_sdl2.key.set_repeat", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_11pygame_sdl2_3key_8set_repeat(__pyx_self, __pyx_v_delay, __pyx_v_interval); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_3key_8set_repeat(CYTHON_UNUSED PyObject *__pyx_self, CYTHON_UNUSED PyObject *__pyx_v_delay, CYTHON_UNUSED PyObject *__pyx_v_interval) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("set_repeat", 0); /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/key.pyx":81 * pass * * def get_repeat(): # <<<<<<<<<<<<<< * # Not possible with SDL2. * return (0,0) */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_3key_11get_repeat(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused); /*proto*/ static PyMethodDef __pyx_mdef_11pygame_sdl2_3key_11get_repeat = {"get_repeat", (PyCFunction)__pyx_pw_11pygame_sdl2_3key_11get_repeat, METH_NOARGS, 0}; static PyObject *__pyx_pw_11pygame_sdl2_3key_11get_repeat(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("get_repeat (wrapper)", 0); __pyx_r = __pyx_pf_11pygame_sdl2_3key_10get_repeat(__pyx_self); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_3key_10get_repeat(CYTHON_UNUSED PyObject *__pyx_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("get_repeat", 0); /* "pygame_sdl2/key.pyx":83 * def get_repeat(): * # Not possible with SDL2. * return (0,0) # <<<<<<<<<<<<<< * * def name(key): */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(__pyx_tuple__3); __pyx_r = __pyx_tuple__3; goto __pyx_L0; /* "pygame_sdl2/key.pyx":81 * pass * * def get_repeat(): # <<<<<<<<<<<<<< * # Not possible with SDL2. * return (0,0) */ /* function exit code */ __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/key.pyx":85 * return (0,0) * * def name(key): # <<<<<<<<<<<<<< * return SDL_GetKeyName(key) * */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_3key_13name(PyObject *__pyx_self, PyObject *__pyx_v_key); /*proto*/ static PyMethodDef __pyx_mdef_11pygame_sdl2_3key_13name = {"name", (PyCFunction)__pyx_pw_11pygame_sdl2_3key_13name, METH_O, 0}; static PyObject *__pyx_pw_11pygame_sdl2_3key_13name(PyObject *__pyx_self, PyObject *__pyx_v_key) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("name (wrapper)", 0); __pyx_r = __pyx_pf_11pygame_sdl2_3key_12name(__pyx_self, ((PyObject *)__pyx_v_key)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_3key_12name(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_key) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations SDL_Keycode __pyx_t_1; PyObject *__pyx_t_2 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("name", 0); /* "pygame_sdl2/key.pyx":86 * * def name(key): * return SDL_GetKeyName(key) # <<<<<<<<<<<<<< * * text_input = False */ __Pyx_XDECREF(__pyx_r); __pyx_t_1 = __Pyx_PyInt_As_int32_t(__pyx_v_key); if (unlikely((__pyx_t_1 == (SDL_Keycode)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 86; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_t_2 = __Pyx_PyBytes_FromString(SDL_GetKeyName(__pyx_t_1)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 86; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; /* "pygame_sdl2/key.pyx":85 * return (0,0) * * def name(key): # <<<<<<<<<<<<<< * return SDL_GetKeyName(key) * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_AddTraceback("pygame_sdl2.key.name", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/key.pyx":90 * text_input = False * * def start_text_input(): # <<<<<<<<<<<<<< * global text_input * text_input = True */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_3key_15start_text_input(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused); /*proto*/ static PyMethodDef __pyx_mdef_11pygame_sdl2_3key_15start_text_input = {"start_text_input", (PyCFunction)__pyx_pw_11pygame_sdl2_3key_15start_text_input, METH_NOARGS, 0}; static PyObject *__pyx_pw_11pygame_sdl2_3key_15start_text_input(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("start_text_input (wrapper)", 0); __pyx_r = __pyx_pf_11pygame_sdl2_3key_14start_text_input(__pyx_self); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_3key_14start_text_input(CYTHON_UNUSED PyObject *__pyx_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations SDL_bool __pyx_t_1; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("start_text_input", 0); /* "pygame_sdl2/key.pyx":92 * def start_text_input(): * global text_input * text_input = True # <<<<<<<<<<<<<< * * if SDL_HasScreenKeyboardSupport(): */ if (PyDict_SetItem(__pyx_d, __pyx_n_s_text_input, Py_True) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 92; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "pygame_sdl2/key.pyx":94 * text_input = True * * if SDL_HasScreenKeyboardSupport(): # <<<<<<<<<<<<<< * SDL_StartTextInput() * */ __pyx_t_1 = SDL_HasScreenKeyboardSupport(); if (__pyx_t_1) { /* "pygame_sdl2/key.pyx":95 * * if SDL_HasScreenKeyboardSupport(): * SDL_StartTextInput() # <<<<<<<<<<<<<< * * def stop_text_input(): */ SDL_StartTextInput(); /* "pygame_sdl2/key.pyx":94 * text_input = True * * if SDL_HasScreenKeyboardSupport(): # <<<<<<<<<<<<<< * SDL_StartTextInput() * */ } /* "pygame_sdl2/key.pyx":90 * text_input = False * * def start_text_input(): # <<<<<<<<<<<<<< * global text_input * text_input = True */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("pygame_sdl2.key.start_text_input", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/key.pyx":97 * SDL_StartTextInput() * * def stop_text_input(): # <<<<<<<<<<<<<< * global text_input * text_input = False */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_3key_17stop_text_input(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused); /*proto*/ static PyMethodDef __pyx_mdef_11pygame_sdl2_3key_17stop_text_input = {"stop_text_input", (PyCFunction)__pyx_pw_11pygame_sdl2_3key_17stop_text_input, METH_NOARGS, 0}; static PyObject *__pyx_pw_11pygame_sdl2_3key_17stop_text_input(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("stop_text_input (wrapper)", 0); __pyx_r = __pyx_pf_11pygame_sdl2_3key_16stop_text_input(__pyx_self); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_3key_16stop_text_input(CYTHON_UNUSED PyObject *__pyx_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations SDL_bool __pyx_t_1; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("stop_text_input", 0); /* "pygame_sdl2/key.pyx":99 * def stop_text_input(): * global text_input * text_input = False # <<<<<<<<<<<<<< * * if SDL_HasScreenKeyboardSupport(): */ if (PyDict_SetItem(__pyx_d, __pyx_n_s_text_input, Py_False) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 99; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "pygame_sdl2/key.pyx":101 * text_input = False * * if SDL_HasScreenKeyboardSupport(): # <<<<<<<<<<<<<< * SDL_StopTextInput() * */ __pyx_t_1 = SDL_HasScreenKeyboardSupport(); if (__pyx_t_1) { /* "pygame_sdl2/key.pyx":102 * * if SDL_HasScreenKeyboardSupport(): * SDL_StopTextInput() # <<<<<<<<<<<<<< * * def set_text_input_rect(rect): */ SDL_StopTextInput(); /* "pygame_sdl2/key.pyx":101 * text_input = False * * if SDL_HasScreenKeyboardSupport(): # <<<<<<<<<<<<<< * SDL_StopTextInput() * */ } /* "pygame_sdl2/key.pyx":97 * SDL_StartTextInput() * * def stop_text_input(): # <<<<<<<<<<<<<< * global text_input * text_input = False */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("pygame_sdl2.key.stop_text_input", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/key.pyx":104 * SDL_StopTextInput() * * def set_text_input_rect(rect): # <<<<<<<<<<<<<< * cdef SDL_Rect sdl_rect; * */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_3key_19set_text_input_rect(PyObject *__pyx_self, PyObject *__pyx_v_rect); /*proto*/ static PyMethodDef __pyx_mdef_11pygame_sdl2_3key_19set_text_input_rect = {"set_text_input_rect", (PyCFunction)__pyx_pw_11pygame_sdl2_3key_19set_text_input_rect, METH_O, 0}; static PyObject *__pyx_pw_11pygame_sdl2_3key_19set_text_input_rect(PyObject *__pyx_self, PyObject *__pyx_v_rect) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("set_text_input_rect (wrapper)", 0); __pyx_r = __pyx_pf_11pygame_sdl2_3key_18set_text_input_rect(__pyx_self, ((PyObject *)__pyx_v_rect)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_3key_18set_text_input_rect(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_rect) { SDL_Rect __pyx_v_sdl_rect; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; int __pyx_t_2; int __pyx_t_3; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("set_text_input_rect", 0); /* "pygame_sdl2/key.pyx":107 * cdef SDL_Rect sdl_rect; * * if rect is not None: # <<<<<<<<<<<<<< * to_sdl_rect(rect, &sdl_rect) * SDL_SetTextInputRect(&sdl_rect) */ __pyx_t_1 = (__pyx_v_rect != Py_None); __pyx_t_2 = (__pyx_t_1 != 0); if (__pyx_t_2) { /* "pygame_sdl2/key.pyx":108 * * if rect is not None: * to_sdl_rect(rect, &sdl_rect) # <<<<<<<<<<<<<< * SDL_SetTextInputRect(&sdl_rect) * else: */ __pyx_t_3 = __pyx_f_11pygame_sdl2_4rect_to_sdl_rect(__pyx_v_rect, (&__pyx_v_sdl_rect), NULL); if (unlikely(__pyx_t_3 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 108; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "pygame_sdl2/key.pyx":109 * if rect is not None: * to_sdl_rect(rect, &sdl_rect) * SDL_SetTextInputRect(&sdl_rect) # <<<<<<<<<<<<<< * else: * SDL_SetTextInputRect(NULL) */ SDL_SetTextInputRect((&__pyx_v_sdl_rect)); /* "pygame_sdl2/key.pyx":107 * cdef SDL_Rect sdl_rect; * * if rect is not None: # <<<<<<<<<<<<<< * to_sdl_rect(rect, &sdl_rect) * SDL_SetTextInputRect(&sdl_rect) */ goto __pyx_L3; } /* "pygame_sdl2/key.pyx":111 * SDL_SetTextInputRect(&sdl_rect) * else: * SDL_SetTextInputRect(NULL) # <<<<<<<<<<<<<< * * def has_screen_keyboard_support(): */ /*else*/ { SDL_SetTextInputRect(NULL); } __pyx_L3:; /* "pygame_sdl2/key.pyx":104 * SDL_StopTextInput() * * def set_text_input_rect(rect): # <<<<<<<<<<<<<< * cdef SDL_Rect sdl_rect; * */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("pygame_sdl2.key.set_text_input_rect", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/key.pyx":113 * SDL_SetTextInputRect(NULL) * * def has_screen_keyboard_support(): # <<<<<<<<<<<<<< * return SDL_HasScreenKeyboardSupport() * */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_3key_21has_screen_keyboard_support(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused); /*proto*/ static PyMethodDef __pyx_mdef_11pygame_sdl2_3key_21has_screen_keyboard_support = {"has_screen_keyboard_support", (PyCFunction)__pyx_pw_11pygame_sdl2_3key_21has_screen_keyboard_support, METH_NOARGS, 0}; static PyObject *__pyx_pw_11pygame_sdl2_3key_21has_screen_keyboard_support(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("has_screen_keyboard_support (wrapper)", 0); __pyx_r = __pyx_pf_11pygame_sdl2_3key_20has_screen_keyboard_support(__pyx_self); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_3key_20has_screen_keyboard_support(CYTHON_UNUSED PyObject *__pyx_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("has_screen_keyboard_support", 0); /* "pygame_sdl2/key.pyx":114 * * def has_screen_keyboard_support(): * return SDL_HasScreenKeyboardSupport() # <<<<<<<<<<<<<< * * def is_screen_keyboard_shown(Window window=None): */ __Pyx_XDECREF(__pyx_r); __pyx_t_1 = __Pyx_PyInt_From_SDL_bool(SDL_HasScreenKeyboardSupport()); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 114; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "pygame_sdl2/key.pyx":113 * SDL_SetTextInputRect(NULL) * * def has_screen_keyboard_support(): # <<<<<<<<<<<<<< * return SDL_HasScreenKeyboardSupport() * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("pygame_sdl2.key.has_screen_keyboard_support", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/key.pyx":116 * return SDL_HasScreenKeyboardSupport() * * def is_screen_keyboard_shown(Window window=None): # <<<<<<<<<<<<<< * if window is None: * window = main_window */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_3key_23is_screen_keyboard_shown(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static PyMethodDef __pyx_mdef_11pygame_sdl2_3key_23is_screen_keyboard_shown = {"is_screen_keyboard_shown", (PyCFunction)__pyx_pw_11pygame_sdl2_3key_23is_screen_keyboard_shown, METH_VARARGS|METH_KEYWORDS, 0}; static PyObject *__pyx_pw_11pygame_sdl2_3key_23is_screen_keyboard_shown(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { struct __pyx_obj_11pygame_sdl2_7display_Window *__pyx_v_window = 0; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("is_screen_keyboard_shown (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_window,0}; PyObject* values[1] = {0}; values[0] = (PyObject *)((struct __pyx_obj_11pygame_sdl2_7display_Window *)Py_None); if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (kw_args > 0) { PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_window); if (value) { values[0] = value; kw_args--; } } } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "is_screen_keyboard_shown") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 116; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } } else { switch (PyTuple_GET_SIZE(__pyx_args)) { case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); case 0: break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_window = ((struct __pyx_obj_11pygame_sdl2_7display_Window *)values[0]); } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("is_screen_keyboard_shown", 0, 0, 1, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 116; __pyx_clineno = __LINE__; goto __pyx_L3_error;} __pyx_L3_error:; __Pyx_AddTraceback("pygame_sdl2.key.is_screen_keyboard_shown", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_window), __pyx_ptype_11pygame_sdl2_7display_Window, 1, "window", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 116; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_r = __pyx_pf_11pygame_sdl2_3key_22is_screen_keyboard_shown(__pyx_self, __pyx_v_window); /* function exit code */ goto __pyx_L0; __pyx_L1_error:; __pyx_r = NULL; __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_3key_22is_screen_keyboard_shown(CYTHON_UNUSED PyObject *__pyx_self, struct __pyx_obj_11pygame_sdl2_7display_Window *__pyx_v_window) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; int __pyx_t_2; PyObject *__pyx_t_3 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("is_screen_keyboard_shown", 0); __Pyx_INCREF((PyObject *)__pyx_v_window); /* "pygame_sdl2/key.pyx":117 * * def is_screen_keyboard_shown(Window window=None): * if window is None: # <<<<<<<<<<<<<< * window = main_window * */ __pyx_t_1 = (((PyObject *)__pyx_v_window) == Py_None); __pyx_t_2 = (__pyx_t_1 != 0); if (__pyx_t_2) { /* "pygame_sdl2/key.pyx":118 * def is_screen_keyboard_shown(Window window=None): * if window is None: * window = main_window # <<<<<<<<<<<<<< * * return SDL_IsScreenKeyboardShown(window.window) */ __Pyx_INCREF(((PyObject *)__pyx_v_11pygame_sdl2_7display_main_window)); __Pyx_DECREF_SET(__pyx_v_window, __pyx_v_11pygame_sdl2_7display_main_window); /* "pygame_sdl2/key.pyx":117 * * def is_screen_keyboard_shown(Window window=None): * if window is None: # <<<<<<<<<<<<<< * window = main_window * */ } /* "pygame_sdl2/key.pyx":120 * window = main_window * * return SDL_IsScreenKeyboardShown(window.window) # <<<<<<<<<<<<<< */ __Pyx_XDECREF(__pyx_r); __pyx_t_3 = __Pyx_PyInt_From_SDL_bool(SDL_IsScreenKeyboardShown(__pyx_v_window->window)); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 120; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __pyx_r = __pyx_t_3; __pyx_t_3 = 0; goto __pyx_L0; /* "pygame_sdl2/key.pyx":116 * return SDL_HasScreenKeyboardSupport() * * def is_screen_keyboard_shown(Window window=None): # <<<<<<<<<<<<<< * if window is None: * window = main_window */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("pygame_sdl2.key.is_screen_keyboard_shown", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF((PyObject *)__pyx_v_window); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_tp_new_11pygame_sdl2_3key_KeyboardState(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) { PyObject *o; if (likely((t->tp_flags & Py_TPFLAGS_IS_ABSTRACT) == 0)) { o = (*t->tp_alloc)(t, 0); } else { o = (PyObject *) PyBaseObject_Type.tp_new(t, __pyx_empty_tuple, 0); } if (unlikely(!o)) return 0; if (unlikely(__pyx_pw_11pygame_sdl2_3key_13KeyboardState_1__cinit__(o, __pyx_empty_tuple, NULL) < 0)) { Py_DECREF(o); o = 0; } return o; } static void __pyx_tp_dealloc_11pygame_sdl2_3key_KeyboardState(PyObject *o) { struct __pyx_obj_11pygame_sdl2_3key_KeyboardState *p = (struct __pyx_obj_11pygame_sdl2_3key_KeyboardState *)o; #if PY_VERSION_HEX >= 0x030400a1 if (unlikely(Py_TYPE(o)->tp_finalize) && (!PyType_IS_GC(Py_TYPE(o)) || !_PyGC_FINALIZED(o))) { if (PyObject_CallFinalizerFromDealloc(o)) return; } #endif { PyObject *etype, *eval, *etb; PyErr_Fetch(&etype, &eval, &etb); ++Py_REFCNT(o); __pyx_pw_11pygame_sdl2_3key_13KeyboardState_3__dealloc__(o); --Py_REFCNT(o); PyErr_Restore(etype, eval, etb); } if (p->__weakref__) PyObject_ClearWeakRefs(o); (*Py_TYPE(o)->tp_free)(o); } static PyObject *__pyx_sq_item_11pygame_sdl2_3key_KeyboardState(PyObject *o, Py_ssize_t i) { PyObject *r; PyObject *x = PyInt_FromSsize_t(i); if(!x) return 0; r = Py_TYPE(o)->tp_as_mapping->mp_subscript(o, x); Py_DECREF(x); return r; } static PyMethodDef __pyx_methods_11pygame_sdl2_3key_KeyboardState[] = { {0, 0, 0, 0} }; static PySequenceMethods __pyx_tp_as_sequence_KeyboardState = { 0, /*sq_length*/ 0, /*sq_concat*/ 0, /*sq_repeat*/ __pyx_sq_item_11pygame_sdl2_3key_KeyboardState, /*sq_item*/ 0, /*sq_slice*/ 0, /*sq_ass_item*/ 0, /*sq_ass_slice*/ 0, /*sq_contains*/ 0, /*sq_inplace_concat*/ 0, /*sq_inplace_repeat*/ }; static PyMappingMethods __pyx_tp_as_mapping_KeyboardState = { 0, /*mp_length*/ __pyx_pw_11pygame_sdl2_3key_13KeyboardState_7__getitem__, /*mp_subscript*/ 0, /*mp_ass_subscript*/ }; static PyTypeObject __pyx_type_11pygame_sdl2_3key_KeyboardState = { PyVarObject_HEAD_INIT(0, 0) "pygame_sdl2.key.KeyboardState", /*tp_name*/ sizeof(struct __pyx_obj_11pygame_sdl2_3key_KeyboardState), /*tp_basicsize*/ 0, /*tp_itemsize*/ __pyx_tp_dealloc_11pygame_sdl2_3key_KeyboardState, /*tp_dealloc*/ 0, /*tp_print*/ 0, /*tp_getattr*/ 0, /*tp_setattr*/ #if PY_MAJOR_VERSION < 3 0, /*tp_compare*/ #endif #if PY_MAJOR_VERSION >= 3 0, /*tp_as_async*/ #endif 0, /*tp_repr*/ 0, /*tp_as_number*/ &__pyx_tp_as_sequence_KeyboardState, /*tp_as_sequence*/ &__pyx_tp_as_mapping_KeyboardState, /*tp_as_mapping*/ 0, /*tp_hash*/ 0, /*tp_call*/ 0, /*tp_str*/ 0, /*tp_getattro*/ 0, /*tp_setattro*/ 0, /*tp_as_buffer*/ Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE, /*tp_flags*/ 0, /*tp_doc*/ 0, /*tp_traverse*/ 0, /*tp_clear*/ 0, /*tp_richcompare*/ 0, /*tp_weaklistoffset*/ 0, /*tp_iter*/ 0, /*tp_iternext*/ __pyx_methods_11pygame_sdl2_3key_KeyboardState, /*tp_methods*/ 0, /*tp_members*/ 0, /*tp_getset*/ 0, /*tp_base*/ 0, /*tp_dict*/ 0, /*tp_descr_get*/ 0, /*tp_descr_set*/ 0, /*tp_dictoffset*/ __pyx_pw_11pygame_sdl2_3key_13KeyboardState_5__init__, /*tp_init*/ 0, /*tp_alloc*/ __pyx_tp_new_11pygame_sdl2_3key_KeyboardState, /*tp_new*/ 0, /*tp_free*/ 0, /*tp_is_gc*/ 0, /*tp_bases*/ 0, /*tp_mro*/ 0, /*tp_cache*/ 0, /*tp_subclasses*/ 0, /*tp_weaklist*/ 0, /*tp_del*/ 0, /*tp_version_tag*/ #if PY_VERSION_HEX >= 0x030400a1 0, /*tp_finalize*/ #endif }; static PyMethodDef __pyx_methods[] = { {0, 0, 0, 0} }; #if PY_MAJOR_VERSION >= 3 static struct PyModuleDef __pyx_moduledef = { #if PY_VERSION_HEX < 0x03020000 { PyObject_HEAD_INIT(NULL) NULL, 0, NULL }, #else PyModuleDef_HEAD_INIT, #endif "key", 0, /* m_doc */ -1, /* m_size */ __pyx_methods /* m_methods */, NULL, /* m_reload */ NULL, /* m_traverse */ NULL, /* m_clear */ NULL /* m_free */ }; #endif static __Pyx_StringTabEntry __pyx_string_tab[] = { {&__pyx_n_s_IndexError, __pyx_k_IndexError, sizeof(__pyx_k_IndexError), 0, 0, 1, 1}, {&__pyx_kp_u_Out_of_range, __pyx_k_Out_of_range, sizeof(__pyx_k_Out_of_range), 0, 1, 0, 0}, {&__pyx_n_s_delay, __pyx_k_delay, sizeof(__pyx_k_delay), 0, 0, 1, 1}, {&__pyx_n_s_error, __pyx_k_error, sizeof(__pyx_k_error), 0, 0, 1, 1}, {&__pyx_n_s_get_focused, __pyx_k_get_focused, sizeof(__pyx_k_get_focused), 0, 0, 1, 1}, {&__pyx_n_s_get_mods, __pyx_k_get_mods, sizeof(__pyx_k_get_mods), 0, 0, 1, 1}, {&__pyx_n_s_get_pressed, __pyx_k_get_pressed, sizeof(__pyx_k_get_pressed), 0, 0, 1, 1}, {&__pyx_n_s_get_repeat, __pyx_k_get_repeat, sizeof(__pyx_k_get_repeat), 0, 0, 1, 1}, {&__pyx_n_s_has_screen_keyboard_support, __pyx_k_has_screen_keyboard_support, sizeof(__pyx_k_has_screen_keyboard_support), 0, 0, 1, 1}, {&__pyx_kp_s_home_tom_ab_pygame_sdl2_src_pyg, __pyx_k_home_tom_ab_pygame_sdl2_src_pyg, sizeof(__pyx_k_home_tom_ab_pygame_sdl2_src_pyg), 0, 0, 1, 0}, {&__pyx_n_s_import, __pyx_k_import, sizeof(__pyx_k_import), 0, 0, 1, 1}, {&__pyx_n_s_interval, __pyx_k_interval, sizeof(__pyx_k_interval), 0, 0, 1, 1}, {&__pyx_n_s_is_screen_keyboard_shown, __pyx_k_is_screen_keyboard_shown, sizeof(__pyx_k_is_screen_keyboard_shown), 0, 0, 1, 1}, {&__pyx_n_s_key, __pyx_k_key, sizeof(__pyx_k_key), 0, 0, 1, 1}, {&__pyx_n_s_main, __pyx_k_main, sizeof(__pyx_k_main), 0, 0, 1, 1}, {&__pyx_n_s_name, __pyx_k_name, sizeof(__pyx_k_name), 0, 0, 1, 1}, {&__pyx_n_s_pygame_sdl2_error, __pyx_k_pygame_sdl2_error, sizeof(__pyx_k_pygame_sdl2_error), 0, 0, 1, 1}, {&__pyx_n_s_pygame_sdl2_key, __pyx_k_pygame_sdl2_key, sizeof(__pyx_k_pygame_sdl2_key), 0, 0, 1, 1}, {&__pyx_n_s_pyx_vtable, __pyx_k_pyx_vtable, sizeof(__pyx_k_pyx_vtable), 0, 0, 1, 1}, {&__pyx_n_s_rect, __pyx_k_rect, sizeof(__pyx_k_rect), 0, 0, 1, 1}, {&__pyx_n_s_sdl_rect, __pyx_k_sdl_rect, sizeof(__pyx_k_sdl_rect), 0, 0, 1, 1}, {&__pyx_n_s_set_mods, __pyx_k_set_mods, sizeof(__pyx_k_set_mods), 0, 0, 1, 1}, {&__pyx_n_s_set_repeat, __pyx_k_set_repeat, sizeof(__pyx_k_set_repeat), 0, 0, 1, 1}, {&__pyx_n_s_set_text_input_rect, __pyx_k_set_text_input_rect, sizeof(__pyx_k_set_text_input_rect), 0, 0, 1, 1}, {&__pyx_n_s_start_text_input, __pyx_k_start_text_input, sizeof(__pyx_k_start_text_input), 0, 0, 1, 1}, {&__pyx_n_s_state, __pyx_k_state, sizeof(__pyx_k_state), 0, 0, 1, 1}, {&__pyx_n_s_stop_text_input, __pyx_k_stop_text_input, sizeof(__pyx_k_stop_text_input), 0, 0, 1, 1}, {&__pyx_n_s_test, __pyx_k_test, sizeof(__pyx_k_test), 0, 0, 1, 1}, {&__pyx_n_s_text_input, __pyx_k_text_input, sizeof(__pyx_k_text_input), 0, 0, 1, 1}, {&__pyx_n_s_window, __pyx_k_window, sizeof(__pyx_k_window), 0, 0, 1, 1}, {0, 0, 0, 0, 0, 0, 0} }; static int __Pyx_InitCachedBuiltins(void) { __pyx_builtin_IndexError = __Pyx_GetBuiltinName(__pyx_n_s_IndexError); if (!__pyx_builtin_IndexError) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 53; __pyx_clineno = __LINE__; goto __pyx_L1_error;} return 0; __pyx_L1_error:; return -1; } static int __Pyx_InitCachedConstants(void) { __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__Pyx_InitCachedConstants", 0); /* "pygame_sdl2/key.pyx":53 * def __getitem__(self, int key): * if SDLK_DELETE < key < SDLK_CAPSLOCK: * raise IndexError("Out of range.") # <<<<<<<<<<<<<< * * cdef int sc = SDL_GetScancodeFromKey(key) */ __pyx_tuple_ = PyTuple_Pack(1, __pyx_kp_u_Out_of_range); if (unlikely(!__pyx_tuple_)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 53; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_tuple_); __Pyx_GIVEREF(__pyx_tuple_); /* "pygame_sdl2/key.pyx":57 * cdef int sc = SDL_GetScancodeFromKey(key) * if sc > self.numkeys: * raise IndexError("Out of range.") # <<<<<<<<<<<<<< * * return self.data[sc] */ __pyx_tuple__2 = PyTuple_Pack(1, __pyx_kp_u_Out_of_range); if (unlikely(!__pyx_tuple__2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 57; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_tuple__2); __Pyx_GIVEREF(__pyx_tuple__2); /* "pygame_sdl2/key.pyx":83 * def get_repeat(): * # Not possible with SDL2. * return (0,0) # <<<<<<<<<<<<<< * * def name(key): */ __pyx_tuple__3 = PyTuple_Pack(2, __pyx_int_0, __pyx_int_0); if (unlikely(!__pyx_tuple__3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 83; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_tuple__3); __Pyx_GIVEREF(__pyx_tuple__3); /* "pygame_sdl2/key.pyx":62 * * * def get_focused(): # <<<<<<<<<<<<<< * return SDL_GetKeyboardFocus() != NULL * */ __pyx_codeobj__4 = (PyObject*)__Pyx_PyCode_New(0, 0, 0, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_tom_ab_pygame_sdl2_src_pyg, __pyx_n_s_get_focused, 62, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 62; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "pygame_sdl2/key.pyx":65 * return SDL_GetKeyboardFocus() != NULL * * def get_pressed(): # <<<<<<<<<<<<<< * """ No longer returns a tuple. Use the returned object to check for * individual keys, but don't loop through it. """ */ __pyx_codeobj__5 = (PyObject*)__Pyx_PyCode_New(0, 0, 0, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_tom_ab_pygame_sdl2_src_pyg, __pyx_n_s_get_pressed, 65, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 65; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "pygame_sdl2/key.pyx":71 * return KeyboardState() * * def get_mods(): # <<<<<<<<<<<<<< * return SDL_GetModState() * */ __pyx_codeobj__6 = (PyObject*)__Pyx_PyCode_New(0, 0, 0, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_tom_ab_pygame_sdl2_src_pyg, __pyx_n_s_get_mods, 71, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 71; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "pygame_sdl2/key.pyx":74 * return SDL_GetModState() * * def set_mods(state): # <<<<<<<<<<<<<< * SDL_SetModState(state) * */ __pyx_tuple__7 = PyTuple_Pack(1, __pyx_n_s_state); if (unlikely(!__pyx_tuple__7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 74; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_tuple__7); __Pyx_GIVEREF(__pyx_tuple__7); __pyx_codeobj__8 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__7, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_tom_ab_pygame_sdl2_src_pyg, __pyx_n_s_set_mods, 74, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 74; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "pygame_sdl2/key.pyx":77 * SDL_SetModState(state) * * def set_repeat(delay=0, interval=0): # <<<<<<<<<<<<<< * # Not possible with SDL2. * pass */ __pyx_tuple__9 = PyTuple_Pack(2, __pyx_n_s_delay, __pyx_n_s_interval); if (unlikely(!__pyx_tuple__9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 77; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_tuple__9); __Pyx_GIVEREF(__pyx_tuple__9); __pyx_codeobj__10 = (PyObject*)__Pyx_PyCode_New(2, 0, 2, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__9, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_tom_ab_pygame_sdl2_src_pyg, __pyx_n_s_set_repeat, 77, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 77; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "pygame_sdl2/key.pyx":81 * pass * * def get_repeat(): # <<<<<<<<<<<<<< * # Not possible with SDL2. * return (0,0) */ __pyx_codeobj__11 = (PyObject*)__Pyx_PyCode_New(0, 0, 0, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_tom_ab_pygame_sdl2_src_pyg, __pyx_n_s_get_repeat, 81, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 81; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "pygame_sdl2/key.pyx":85 * return (0,0) * * def name(key): # <<<<<<<<<<<<<< * return SDL_GetKeyName(key) * */ __pyx_tuple__12 = PyTuple_Pack(1, __pyx_n_s_key); if (unlikely(!__pyx_tuple__12)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 85; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_tuple__12); __Pyx_GIVEREF(__pyx_tuple__12); __pyx_codeobj__13 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__12, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_tom_ab_pygame_sdl2_src_pyg, __pyx_n_s_name, 85, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__13)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 85; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "pygame_sdl2/key.pyx":90 * text_input = False * * def start_text_input(): # <<<<<<<<<<<<<< * global text_input * text_input = True */ __pyx_codeobj__14 = (PyObject*)__Pyx_PyCode_New(0, 0, 0, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_tom_ab_pygame_sdl2_src_pyg, __pyx_n_s_start_text_input, 90, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__14)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 90; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "pygame_sdl2/key.pyx":97 * SDL_StartTextInput() * * def stop_text_input(): # <<<<<<<<<<<<<< * global text_input * text_input = False */ __pyx_codeobj__15 = (PyObject*)__Pyx_PyCode_New(0, 0, 0, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_tom_ab_pygame_sdl2_src_pyg, __pyx_n_s_stop_text_input, 97, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__15)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 97; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "pygame_sdl2/key.pyx":104 * SDL_StopTextInput() * * def set_text_input_rect(rect): # <<<<<<<<<<<<<< * cdef SDL_Rect sdl_rect; * */ __pyx_tuple__16 = PyTuple_Pack(2, __pyx_n_s_rect, __pyx_n_s_sdl_rect); if (unlikely(!__pyx_tuple__16)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 104; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_tuple__16); __Pyx_GIVEREF(__pyx_tuple__16); __pyx_codeobj__17 = (PyObject*)__Pyx_PyCode_New(1, 0, 2, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__16, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_tom_ab_pygame_sdl2_src_pyg, __pyx_n_s_set_text_input_rect, 104, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__17)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 104; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "pygame_sdl2/key.pyx":113 * SDL_SetTextInputRect(NULL) * * def has_screen_keyboard_support(): # <<<<<<<<<<<<<< * return SDL_HasScreenKeyboardSupport() * */ __pyx_codeobj__18 = (PyObject*)__Pyx_PyCode_New(0, 0, 0, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_tom_ab_pygame_sdl2_src_pyg, __pyx_n_s_has_screen_keyboard_support, 113, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__18)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 113; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "pygame_sdl2/key.pyx":116 * return SDL_HasScreenKeyboardSupport() * * def is_screen_keyboard_shown(Window window=None): # <<<<<<<<<<<<<< * if window is None: * window = main_window */ __pyx_tuple__19 = PyTuple_Pack(1, __pyx_n_s_window); if (unlikely(!__pyx_tuple__19)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 116; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_tuple__19); __Pyx_GIVEREF(__pyx_tuple__19); __pyx_codeobj__20 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__19, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_tom_ab_pygame_sdl2_src_pyg, __pyx_n_s_is_screen_keyboard_shown, 116, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__20)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 116; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_RefNannyFinishContext(); return 0; __pyx_L1_error:; __Pyx_RefNannyFinishContext(); return -1; } static int __Pyx_InitGlobals(void) { if (__Pyx_InitStrings(__pyx_string_tab) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; __pyx_int_0 = PyInt_FromLong(0); if (unlikely(!__pyx_int_0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} return 0; __pyx_L1_error:; return -1; } #if PY_MAJOR_VERSION < 3 PyMODINIT_FUNC initkey(void); /*proto*/ PyMODINIT_FUNC initkey(void) #else PyMODINIT_FUNC PyInit_key(void); /*proto*/ PyMODINIT_FUNC PyInit_key(void) #endif { PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannyDeclarations #if CYTHON_REFNANNY __Pyx_RefNanny = __Pyx_RefNannyImportAPI("refnanny"); if (!__Pyx_RefNanny) { PyErr_Clear(); __Pyx_RefNanny = __Pyx_RefNannyImportAPI("Cython.Runtime.refnanny"); if (!__Pyx_RefNanny) Py_FatalError("failed to import 'refnanny' module"); } #endif __Pyx_RefNannySetupContext("PyMODINIT_FUNC PyInit_key(void)", 0); if (__Pyx_check_binary_version() < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_empty_tuple = PyTuple_New(0); if (unlikely(!__pyx_empty_tuple)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_empty_bytes = PyBytes_FromStringAndSize("", 0); if (unlikely(!__pyx_empty_bytes)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} #ifdef __Pyx_CyFunction_USED if (__pyx_CyFunction_init() < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} #endif #ifdef __Pyx_FusedFunction_USED if (__pyx_FusedFunction_init() < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} #endif #ifdef __Pyx_Coroutine_USED if (__pyx_Coroutine_init() < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} #endif #ifdef __Pyx_Generator_USED if (__pyx_Generator_init() < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} #endif #ifdef __Pyx_StopAsyncIteration_USED if (__pyx_StopAsyncIteration_init() < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} #endif /*--- Library function declarations ---*/ /*--- Threads initialization code ---*/ #if defined(__PYX_FORCE_INIT_THREADS) && __PYX_FORCE_INIT_THREADS #ifdef WITH_THREAD /* Python build with threading support? */ PyEval_InitThreads(); #endif #endif /*--- Module creation code ---*/ #if PY_MAJOR_VERSION < 3 __pyx_m = Py_InitModule4("key", __pyx_methods, 0, 0, PYTHON_API_VERSION); Py_XINCREF(__pyx_m); #else __pyx_m = PyModule_Create(&__pyx_moduledef); #endif if (unlikely(!__pyx_m)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_d = PyModule_GetDict(__pyx_m); if (unlikely(!__pyx_d)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} Py_INCREF(__pyx_d); __pyx_b = PyImport_AddModule(__Pyx_BUILTIN_MODULE_NAME); if (unlikely(!__pyx_b)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} #if CYTHON_COMPILING_IN_PYPY Py_INCREF(__pyx_b); #endif if (PyObject_SetAttrString(__pyx_m, "__builtins__", __pyx_b) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; /*--- Initialize various global constants etc. ---*/ if (__Pyx_InitGlobals() < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} #if PY_MAJOR_VERSION < 3 && (__PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT) if (__Pyx_init_sys_getdefaultencoding_params() < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} #endif if (__pyx_module_is_main_pygame_sdl2__key) { if (PyObject_SetAttrString(__pyx_m, "__name__", __pyx_n_s_main) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } #if PY_MAJOR_VERSION >= 3 { PyObject *modules = PyImport_GetModuleDict(); if (unlikely(!modules)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} if (!PyDict_GetItemString(modules, "pygame_sdl2.key")) { if (unlikely(PyDict_SetItemString(modules, "pygame_sdl2.key", __pyx_m) < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } } #endif /*--- Builtin init code ---*/ if (__Pyx_InitCachedBuiltins() < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /*--- Constants init code ---*/ if (__Pyx_InitCachedConstants() < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /*--- Global init code ---*/ /*--- Variable export code ---*/ /*--- Function export code ---*/ /*--- Type init code ---*/ if (PyType_Ready(&__pyx_type_11pygame_sdl2_3key_KeyboardState) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 28; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_type_11pygame_sdl2_3key_KeyboardState.tp_print = 0; if (PyObject_SetAttrString(__pyx_m, "KeyboardState", (PyObject *)&__pyx_type_11pygame_sdl2_3key_KeyboardState) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 28; __pyx_clineno = __LINE__; goto __pyx_L1_error;} if (__pyx_type_11pygame_sdl2_3key_KeyboardState.tp_weaklistoffset == 0) __pyx_type_11pygame_sdl2_3key_KeyboardState.tp_weaklistoffset = offsetof(struct __pyx_obj_11pygame_sdl2_3key_KeyboardState, __weakref__); __pyx_ptype_11pygame_sdl2_3key_KeyboardState = &__pyx_type_11pygame_sdl2_3key_KeyboardState; /*--- Type import code ---*/ __pyx_ptype_11pygame_sdl2_7surface_Surface = __Pyx_ImportType("pygame_sdl2.surface", "Surface", sizeof(struct __pyx_obj_11pygame_sdl2_7surface_Surface), 1); if (unlikely(!__pyx_ptype_11pygame_sdl2_7surface_Surface)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 23; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_vtabptr_11pygame_sdl2_7surface_Surface = (struct __pyx_vtabstruct_11pygame_sdl2_7surface_Surface*)__Pyx_GetVtable(__pyx_ptype_11pygame_sdl2_7surface_Surface->tp_dict); if (unlikely(!__pyx_vtabptr_11pygame_sdl2_7surface_Surface)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 23; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_ptype_11pygame_sdl2_7display_Window = __Pyx_ImportType("pygame_sdl2.display", "Window", sizeof(struct __pyx_obj_11pygame_sdl2_7display_Window), 1); if (unlikely(!__pyx_ptype_11pygame_sdl2_7display_Window)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 23; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_ptype_11pygame_sdl2_4rect_Rect = __Pyx_ImportType("pygame_sdl2.rect", "Rect", sizeof(struct __pyx_obj_11pygame_sdl2_4rect_Rect), 1); if (unlikely(!__pyx_ptype_11pygame_sdl2_4rect_Rect)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 21; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /*--- Variable import code ---*/ __pyx_t_1 = __Pyx_ImportModule("pygame_sdl2.display"); if (!__pyx_t_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} if (__Pyx_ImportVoidPtr(__pyx_t_1, "main_window", (void **)&__pyx_vp_11pygame_sdl2_7display_main_window, "struct __pyx_obj_11pygame_sdl2_7display_Window *") < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} Py_DECREF(__pyx_t_1); __pyx_t_1 = 0; /*--- Function import code ---*/ __pyx_t_2 = __Pyx_ImportModule("pygame_sdl2.rect"); if (!__pyx_t_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} if (__Pyx_ImportFunction(__pyx_t_2, "to_sdl_rect", (void (**)(void))&__pyx_f_11pygame_sdl2_4rect_to_sdl_rect, "int (PyObject *, SDL_Rect *, struct __pyx_opt_args_11pygame_sdl2_4rect_to_sdl_rect *__pyx_optional_args)") < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} Py_DECREF(__pyx_t_2); __pyx_t_2 = 0; /*--- Execution code ---*/ #if defined(__Pyx_Generator_USED) || defined(__Pyx_Coroutine_USED) if (__Pyx_patch_abc() < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} #endif /* "pygame_sdl2/key.pyx":25 * from pygame_sdl2.rect cimport to_sdl_rect * * from pygame_sdl2.error import error # <<<<<<<<<<<<<< * * */ __pyx_t_3 = PyList_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 25; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __Pyx_INCREF(__pyx_n_s_error); __Pyx_GIVEREF(__pyx_n_s_error); PyList_SET_ITEM(__pyx_t_3, 0, __pyx_n_s_error); __pyx_t_4 = __Pyx_Import(__pyx_n_s_pygame_sdl2_error, __pyx_t_3, 0); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 25; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_3 = __Pyx_ImportFrom(__pyx_t_4, __pyx_n_s_error); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 25; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); if (PyDict_SetItem(__pyx_d, __pyx_n_s_error, __pyx_t_3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 25; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; /* "pygame_sdl2/key.pyx":62 * * * def get_focused(): # <<<<<<<<<<<<<< * return SDL_GetKeyboardFocus() != NULL * */ __pyx_t_4 = PyCFunction_NewEx(&__pyx_mdef_11pygame_sdl2_3key_1get_focused, NULL, __pyx_n_s_pygame_sdl2_key); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 62; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); if (PyDict_SetItem(__pyx_d, __pyx_n_s_get_focused, __pyx_t_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 62; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; /* "pygame_sdl2/key.pyx":65 * return SDL_GetKeyboardFocus() != NULL * * def get_pressed(): # <<<<<<<<<<<<<< * """ No longer returns a tuple. Use the returned object to check for * individual keys, but don't loop through it. """ */ __pyx_t_4 = PyCFunction_NewEx(&__pyx_mdef_11pygame_sdl2_3key_3get_pressed, NULL, __pyx_n_s_pygame_sdl2_key); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 65; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); if (PyDict_SetItem(__pyx_d, __pyx_n_s_get_pressed, __pyx_t_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 65; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; /* "pygame_sdl2/key.pyx":71 * return KeyboardState() * * def get_mods(): # <<<<<<<<<<<<<< * return SDL_GetModState() * */ __pyx_t_4 = PyCFunction_NewEx(&__pyx_mdef_11pygame_sdl2_3key_5get_mods, NULL, __pyx_n_s_pygame_sdl2_key); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 71; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); if (PyDict_SetItem(__pyx_d, __pyx_n_s_get_mods, __pyx_t_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 71; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; /* "pygame_sdl2/key.pyx":74 * return SDL_GetModState() * * def set_mods(state): # <<<<<<<<<<<<<< * SDL_SetModState(state) * */ __pyx_t_4 = PyCFunction_NewEx(&__pyx_mdef_11pygame_sdl2_3key_7set_mods, NULL, __pyx_n_s_pygame_sdl2_key); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 74; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); if (PyDict_SetItem(__pyx_d, __pyx_n_s_set_mods, __pyx_t_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 74; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; /* "pygame_sdl2/key.pyx":77 * SDL_SetModState(state) * * def set_repeat(delay=0, interval=0): # <<<<<<<<<<<<<< * # Not possible with SDL2. * pass */ __pyx_t_4 = PyCFunction_NewEx(&__pyx_mdef_11pygame_sdl2_3key_9set_repeat, NULL, __pyx_n_s_pygame_sdl2_key); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 77; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); if (PyDict_SetItem(__pyx_d, __pyx_n_s_set_repeat, __pyx_t_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 77; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; /* "pygame_sdl2/key.pyx":81 * pass * * def get_repeat(): # <<<<<<<<<<<<<< * # Not possible with SDL2. * return (0,0) */ __pyx_t_4 = PyCFunction_NewEx(&__pyx_mdef_11pygame_sdl2_3key_11get_repeat, NULL, __pyx_n_s_pygame_sdl2_key); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 81; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); if (PyDict_SetItem(__pyx_d, __pyx_n_s_get_repeat, __pyx_t_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 81; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; /* "pygame_sdl2/key.pyx":85 * return (0,0) * * def name(key): # <<<<<<<<<<<<<< * return SDL_GetKeyName(key) * */ __pyx_t_4 = PyCFunction_NewEx(&__pyx_mdef_11pygame_sdl2_3key_13name, NULL, __pyx_n_s_pygame_sdl2_key); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 85; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); if (PyDict_SetItem(__pyx_d, __pyx_n_s_name, __pyx_t_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 85; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; /* "pygame_sdl2/key.pyx":88 * return SDL_GetKeyName(key) * * text_input = False # <<<<<<<<<<<<<< * * def start_text_input(): */ if (PyDict_SetItem(__pyx_d, __pyx_n_s_text_input, Py_False) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 88; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "pygame_sdl2/key.pyx":90 * text_input = False * * def start_text_input(): # <<<<<<<<<<<<<< * global text_input * text_input = True */ __pyx_t_4 = PyCFunction_NewEx(&__pyx_mdef_11pygame_sdl2_3key_15start_text_input, NULL, __pyx_n_s_pygame_sdl2_key); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 90; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); if (PyDict_SetItem(__pyx_d, __pyx_n_s_start_text_input, __pyx_t_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 90; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; /* "pygame_sdl2/key.pyx":97 * SDL_StartTextInput() * * def stop_text_input(): # <<<<<<<<<<<<<< * global text_input * text_input = False */ __pyx_t_4 = PyCFunction_NewEx(&__pyx_mdef_11pygame_sdl2_3key_17stop_text_input, NULL, __pyx_n_s_pygame_sdl2_key); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 97; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); if (PyDict_SetItem(__pyx_d, __pyx_n_s_stop_text_input, __pyx_t_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 97; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; /* "pygame_sdl2/key.pyx":104 * SDL_StopTextInput() * * def set_text_input_rect(rect): # <<<<<<<<<<<<<< * cdef SDL_Rect sdl_rect; * */ __pyx_t_4 = PyCFunction_NewEx(&__pyx_mdef_11pygame_sdl2_3key_19set_text_input_rect, NULL, __pyx_n_s_pygame_sdl2_key); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 104; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); if (PyDict_SetItem(__pyx_d, __pyx_n_s_set_text_input_rect, __pyx_t_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 104; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; /* "pygame_sdl2/key.pyx":113 * SDL_SetTextInputRect(NULL) * * def has_screen_keyboard_support(): # <<<<<<<<<<<<<< * return SDL_HasScreenKeyboardSupport() * */ __pyx_t_4 = PyCFunction_NewEx(&__pyx_mdef_11pygame_sdl2_3key_21has_screen_keyboard_support, NULL, __pyx_n_s_pygame_sdl2_key); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 113; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); if (PyDict_SetItem(__pyx_d, __pyx_n_s_has_screen_keyboard_support, __pyx_t_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 113; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; /* "pygame_sdl2/key.pyx":116 * return SDL_HasScreenKeyboardSupport() * * def is_screen_keyboard_shown(Window window=None): # <<<<<<<<<<<<<< * if window is None: * window = main_window */ __pyx_t_4 = PyCFunction_NewEx(&__pyx_mdef_11pygame_sdl2_3key_23is_screen_keyboard_shown, NULL, __pyx_n_s_pygame_sdl2_key); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 116; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); if (PyDict_SetItem(__pyx_d, __pyx_n_s_is_screen_keyboard_shown, __pyx_t_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 116; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; /* "pygame_sdl2/key.pyx":1 * # Copyright 2014 Patrick Dawson # <<<<<<<<<<<<<< * # * # This software is provided 'as-is', without any express or implied */ __pyx_t_4 = PyDict_New(); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); if (PyDict_SetItem(__pyx_d, __pyx_n_s_test, __pyx_t_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; /*--- Wrapped vars code ---*/ goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); if (__pyx_m) { if (__pyx_d) { __Pyx_AddTraceback("init pygame_sdl2.key", __pyx_clineno, __pyx_lineno, __pyx_filename); } Py_DECREF(__pyx_m); __pyx_m = 0; } else if (!PyErr_Occurred()) { PyErr_SetString(PyExc_ImportError, "init pygame_sdl2.key"); } __pyx_L0:; __Pyx_RefNannyFinishContext(); #if PY_MAJOR_VERSION < 3 return; #else return __pyx_m; #endif } /* --- Runtime support code --- */ #if CYTHON_REFNANNY static __Pyx_RefNannyAPIStruct *__Pyx_RefNannyImportAPI(const char *modname) { PyObject *m = NULL, *p = NULL; void *r = NULL; m = PyImport_ImportModule((char *)modname); if (!m) goto end; p = PyObject_GetAttrString(m, (char *)"RefNannyAPI"); if (!p) goto end; r = PyLong_AsVoidPtr(p); end: Py_XDECREF(p); Py_XDECREF(m); return (__Pyx_RefNannyAPIStruct *)r; } #endif static PyObject *__Pyx_GetBuiltinName(PyObject *name) { PyObject* result = __Pyx_PyObject_GetAttrStr(__pyx_b, name); if (unlikely(!result)) { PyErr_Format(PyExc_NameError, #if PY_MAJOR_VERSION >= 3 "name '%U' is not defined", name); #else "name '%.200s' is not defined", PyString_AS_STRING(name)); #endif } return result; } static void __Pyx_RaiseArgtupleInvalid( const char* func_name, int exact, Py_ssize_t num_min, Py_ssize_t num_max, Py_ssize_t num_found) { Py_ssize_t num_expected; const char *more_or_less; if (num_found < num_min) { num_expected = num_min; more_or_less = "at least"; } else { num_expected = num_max; more_or_less = "at most"; } if (exact) { more_or_less = "exactly"; } PyErr_Format(PyExc_TypeError, "%.200s() takes %.8s %" CYTHON_FORMAT_SSIZE_T "d positional argument%.1s (%" CYTHON_FORMAT_SSIZE_T "d given)", func_name, more_or_less, num_expected, (num_expected == 1) ? "" : "s", num_found); } static CYTHON_INLINE int __Pyx_CheckKeywordStrings( PyObject *kwdict, const char* function_name, int kw_allowed) { PyObject* key = 0; Py_ssize_t pos = 0; #if CYTHON_COMPILING_IN_PYPY if (!kw_allowed && PyDict_Next(kwdict, &pos, &key, 0)) goto invalid_keyword; return 1; #else while (PyDict_Next(kwdict, &pos, &key, 0)) { #if PY_MAJOR_VERSION < 3 if (unlikely(!PyString_CheckExact(key)) && unlikely(!PyString_Check(key))) #endif if (unlikely(!PyUnicode_Check(key))) goto invalid_keyword_type; } if ((!kw_allowed) && unlikely(key)) goto invalid_keyword; return 1; invalid_keyword_type: PyErr_Format(PyExc_TypeError, "%.200s() keywords must be strings", function_name); return 0; #endif invalid_keyword: PyErr_Format(PyExc_TypeError, #if PY_MAJOR_VERSION < 3 "%.200s() got an unexpected keyword argument '%.200s'", function_name, PyString_AsString(key)); #else "%s() got an unexpected keyword argument '%U'", function_name, key); #endif return 0; } static CYTHON_INLINE PyObject *__Pyx_GetModuleGlobalName(PyObject *name) { PyObject *result; #if CYTHON_COMPILING_IN_CPYTHON result = PyDict_GetItem(__pyx_d, name); if (likely(result)) { Py_INCREF(result); } else { #else result = PyObject_GetItem(__pyx_d, name); if (!result) { PyErr_Clear(); #endif result = __Pyx_GetBuiltinName(name); } return result; } #if CYTHON_COMPILING_IN_CPYTHON static CYTHON_INLINE PyObject* __Pyx_PyObject_Call(PyObject *func, PyObject *arg, PyObject *kw) { PyObject *result; ternaryfunc call = func->ob_type->tp_call; if (unlikely(!call)) return PyObject_Call(func, arg, kw); if (unlikely(Py_EnterRecursiveCall((char*)" while calling a Python object"))) return NULL; result = (*call)(func, arg, kw); Py_LeaveRecursiveCall(); if (unlikely(!result) && unlikely(!PyErr_Occurred())) { PyErr_SetString( PyExc_SystemError, "NULL result without error in PyObject_Call"); } return result; } #endif #if CYTHON_COMPILING_IN_CPYTHON static CYTHON_INLINE PyObject* __Pyx_PyObject_CallMethO(PyObject *func, PyObject *arg) { PyObject *self, *result; PyCFunction cfunc; cfunc = PyCFunction_GET_FUNCTION(func); self = PyCFunction_GET_SELF(func); if (unlikely(Py_EnterRecursiveCall((char*)" while calling a Python object"))) return NULL; result = cfunc(self, arg); Py_LeaveRecursiveCall(); if (unlikely(!result) && unlikely(!PyErr_Occurred())) { PyErr_SetString( PyExc_SystemError, "NULL result without error in PyObject_Call"); } return result; } #endif #if CYTHON_COMPILING_IN_CPYTHON static PyObject* __Pyx__PyObject_CallOneArg(PyObject *func, PyObject *arg) { PyObject *result; PyObject *args = PyTuple_New(1); if (unlikely(!args)) return NULL; Py_INCREF(arg); PyTuple_SET_ITEM(args, 0, arg); result = __Pyx_PyObject_Call(func, args, NULL); Py_DECREF(args); return result; } static CYTHON_INLINE PyObject* __Pyx_PyObject_CallOneArg(PyObject *func, PyObject *arg) { #ifdef __Pyx_CyFunction_USED if (likely(PyCFunction_Check(func) || PyObject_TypeCheck(func, __pyx_CyFunctionType))) { #else if (likely(PyCFunction_Check(func))) { #endif if (likely(PyCFunction_GET_FLAGS(func) & METH_O)) { return __Pyx_PyObject_CallMethO(func, arg); } } return __Pyx__PyObject_CallOneArg(func, arg); } #else static CYTHON_INLINE PyObject* __Pyx_PyObject_CallOneArg(PyObject *func, PyObject *arg) { PyObject* args = PyTuple_Pack(1, arg); return (likely(args)) ? __Pyx_PyObject_Call(func, args, NULL) : NULL; } #endif #if CYTHON_COMPILING_IN_CPYTHON static CYTHON_INLINE PyObject* __Pyx_PyObject_CallNoArg(PyObject *func) { #ifdef __Pyx_CyFunction_USED if (likely(PyCFunction_Check(func) || PyObject_TypeCheck(func, __pyx_CyFunctionType))) { #else if (likely(PyCFunction_Check(func))) { #endif if (likely(PyCFunction_GET_FLAGS(func) & METH_NOARGS)) { return __Pyx_PyObject_CallMethO(func, NULL); } } return __Pyx_PyObject_Call(func, __pyx_empty_tuple, NULL); } #endif static CYTHON_INLINE void __Pyx_ErrRestore(PyObject *type, PyObject *value, PyObject *tb) { #if CYTHON_COMPILING_IN_CPYTHON PyObject *tmp_type, *tmp_value, *tmp_tb; PyThreadState *tstate = PyThreadState_GET(); tmp_type = tstate->curexc_type; tmp_value = tstate->curexc_value; tmp_tb = tstate->curexc_traceback; tstate->curexc_type = type; tstate->curexc_value = value; tstate->curexc_traceback = tb; Py_XDECREF(tmp_type); Py_XDECREF(tmp_value); Py_XDECREF(tmp_tb); #else PyErr_Restore(type, value, tb); #endif } static CYTHON_INLINE void __Pyx_ErrFetch(PyObject **type, PyObject **value, PyObject **tb) { #if CYTHON_COMPILING_IN_CPYTHON PyThreadState *tstate = PyThreadState_GET(); *type = tstate->curexc_type; *value = tstate->curexc_value; *tb = tstate->curexc_traceback; tstate->curexc_type = 0; tstate->curexc_value = 0; tstate->curexc_traceback = 0; #else PyErr_Fetch(type, value, tb); #endif } #if PY_MAJOR_VERSION < 3 static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, CYTHON_UNUSED PyObject *cause) { Py_XINCREF(type); if (!value || value == Py_None) value = NULL; else Py_INCREF(value); if (!tb || tb == Py_None) tb = NULL; else { Py_INCREF(tb); if (!PyTraceBack_Check(tb)) { PyErr_SetString(PyExc_TypeError, "raise: arg 3 must be a traceback or None"); goto raise_error; } } if (PyType_Check(type)) { #if CYTHON_COMPILING_IN_PYPY if (!value) { Py_INCREF(Py_None); value = Py_None; } #endif PyErr_NormalizeException(&type, &value, &tb); } else { if (value) { PyErr_SetString(PyExc_TypeError, "instance exception may not have a separate value"); goto raise_error; } value = type; type = (PyObject*) Py_TYPE(type); Py_INCREF(type); if (!PyType_IsSubtype((PyTypeObject *)type, (PyTypeObject *)PyExc_BaseException)) { PyErr_SetString(PyExc_TypeError, "raise: exception class must be a subclass of BaseException"); goto raise_error; } } __Pyx_ErrRestore(type, value, tb); return; raise_error: Py_XDECREF(value); Py_XDECREF(type); Py_XDECREF(tb); return; } #else static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, PyObject *cause) { PyObject* owned_instance = NULL; if (tb == Py_None) { tb = 0; } else if (tb && !PyTraceBack_Check(tb)) { PyErr_SetString(PyExc_TypeError, "raise: arg 3 must be a traceback or None"); goto bad; } if (value == Py_None) value = 0; if (PyExceptionInstance_Check(type)) { if (value) { PyErr_SetString(PyExc_TypeError, "instance exception may not have a separate value"); goto bad; } value = type; type = (PyObject*) Py_TYPE(value); } else if (PyExceptionClass_Check(type)) { PyObject *instance_class = NULL; if (value && PyExceptionInstance_Check(value)) { instance_class = (PyObject*) Py_TYPE(value); if (instance_class != type) { int is_subclass = PyObject_IsSubclass(instance_class, type); if (!is_subclass) { instance_class = NULL; } else if (unlikely(is_subclass == -1)) { goto bad; } else { type = instance_class; } } } if (!instance_class) { PyObject *args; if (!value) args = PyTuple_New(0); else if (PyTuple_Check(value)) { Py_INCREF(value); args = value; } else args = PyTuple_Pack(1, value); if (!args) goto bad; owned_instance = PyObject_Call(type, args, NULL); Py_DECREF(args); if (!owned_instance) goto bad; value = owned_instance; if (!PyExceptionInstance_Check(value)) { PyErr_Format(PyExc_TypeError, "calling %R should have returned an instance of " "BaseException, not %R", type, Py_TYPE(value)); goto bad; } } } else { PyErr_SetString(PyExc_TypeError, "raise: exception class must be a subclass of BaseException"); goto bad; } #if PY_VERSION_HEX >= 0x03030000 if (cause) { #else if (cause && cause != Py_None) { #endif PyObject *fixed_cause; if (cause == Py_None) { fixed_cause = NULL; } else if (PyExceptionClass_Check(cause)) { fixed_cause = PyObject_CallObject(cause, NULL); if (fixed_cause == NULL) goto bad; } else if (PyExceptionInstance_Check(cause)) { fixed_cause = cause; Py_INCREF(fixed_cause); } else { PyErr_SetString(PyExc_TypeError, "exception causes must derive from " "BaseException"); goto bad; } PyException_SetCause(value, fixed_cause); } PyErr_SetObject(type, value); if (tb) { #if CYTHON_COMPILING_IN_PYPY PyObject *tmp_type, *tmp_value, *tmp_tb; PyErr_Fetch(&tmp_type, &tmp_value, &tmp_tb); Py_INCREF(tb); PyErr_Restore(tmp_type, tmp_value, tb); Py_XDECREF(tmp_tb); #else PyThreadState *tstate = PyThreadState_GET(); PyObject* tmp_tb = tstate->curexc_traceback; if (tb != tmp_tb) { Py_INCREF(tb); tstate->curexc_traceback = tb; Py_XDECREF(tmp_tb); } #endif } bad: Py_XDECREF(owned_instance); return; } #endif static void __Pyx_RaiseDoubleKeywordsError( const char* func_name, PyObject* kw_name) { PyErr_Format(PyExc_TypeError, #if PY_MAJOR_VERSION >= 3 "%s() got multiple values for keyword argument '%U'", func_name, kw_name); #else "%s() got multiple values for keyword argument '%s'", func_name, PyString_AsString(kw_name)); #endif } static int __Pyx_ParseOptionalKeywords( PyObject *kwds, PyObject **argnames[], PyObject *kwds2, PyObject *values[], Py_ssize_t num_pos_args, const char* function_name) { PyObject *key = 0, *value = 0; Py_ssize_t pos = 0; PyObject*** name; PyObject*** first_kw_arg = argnames + num_pos_args; while (PyDict_Next(kwds, &pos, &key, &value)) { name = first_kw_arg; while (*name && (**name != key)) name++; if (*name) { values[name-argnames] = value; continue; } name = first_kw_arg; #if PY_MAJOR_VERSION < 3 if (likely(PyString_CheckExact(key)) || likely(PyString_Check(key))) { while (*name) { if ((CYTHON_COMPILING_IN_PYPY || PyString_GET_SIZE(**name) == PyString_GET_SIZE(key)) && _PyString_Eq(**name, key)) { values[name-argnames] = value; break; } name++; } if (*name) continue; else { PyObject*** argname = argnames; while (argname != first_kw_arg) { if ((**argname == key) || ( (CYTHON_COMPILING_IN_PYPY || PyString_GET_SIZE(**argname) == PyString_GET_SIZE(key)) && _PyString_Eq(**argname, key))) { goto arg_passed_twice; } argname++; } } } else #endif if (likely(PyUnicode_Check(key))) { while (*name) { int cmp = (**name == key) ? 0 : #if !CYTHON_COMPILING_IN_PYPY && PY_MAJOR_VERSION >= 3 (PyUnicode_GET_SIZE(**name) != PyUnicode_GET_SIZE(key)) ? 1 : #endif PyUnicode_Compare(**name, key); if (cmp < 0 && unlikely(PyErr_Occurred())) goto bad; if (cmp == 0) { values[name-argnames] = value; break; } name++; } if (*name) continue; else { PyObject*** argname = argnames; while (argname != first_kw_arg) { int cmp = (**argname == key) ? 0 : #if !CYTHON_COMPILING_IN_PYPY && PY_MAJOR_VERSION >= 3 (PyUnicode_GET_SIZE(**argname) != PyUnicode_GET_SIZE(key)) ? 1 : #endif PyUnicode_Compare(**argname, key); if (cmp < 0 && unlikely(PyErr_Occurred())) goto bad; if (cmp == 0) goto arg_passed_twice; argname++; } } } else goto invalid_keyword_type; if (kwds2) { if (unlikely(PyDict_SetItem(kwds2, key, value))) goto bad; } else { goto invalid_keyword; } } return 0; arg_passed_twice: __Pyx_RaiseDoubleKeywordsError(function_name, key); goto bad; invalid_keyword_type: PyErr_Format(PyExc_TypeError, "%.200s() keywords must be strings", function_name); goto bad; invalid_keyword: PyErr_Format(PyExc_TypeError, #if PY_MAJOR_VERSION < 3 "%.200s() got an unexpected keyword argument '%.200s'", function_name, PyString_AsString(key)); #else "%s() got an unexpected keyword argument '%U'", function_name, key); #endif bad: return -1; } static void __Pyx_RaiseArgumentTypeInvalid(const char* name, PyObject *obj, PyTypeObject *type) { PyErr_Format(PyExc_TypeError, "Argument '%.200s' has incorrect type (expected %.200s, got %.200s)", name, type->tp_name, Py_TYPE(obj)->tp_name); } static CYTHON_INLINE int __Pyx_ArgTypeTest(PyObject *obj, PyTypeObject *type, int none_allowed, const char *name, int exact) { if (unlikely(!type)) { PyErr_SetString(PyExc_SystemError, "Missing type object"); return 0; } if (none_allowed && obj == Py_None) return 1; else if (exact) { if (likely(Py_TYPE(obj) == type)) return 1; #if PY_MAJOR_VERSION == 2 else if ((type == &PyBaseString_Type) && likely(__Pyx_PyBaseString_CheckExact(obj))) return 1; #endif } else { if (likely(PyObject_TypeCheck(obj, type))) return 1; } __Pyx_RaiseArgumentTypeInvalid(name, obj, type); return 0; } static void* __Pyx_GetVtable(PyObject *dict) { void* ptr; PyObject *ob = PyObject_GetItem(dict, __pyx_n_s_pyx_vtable); if (!ob) goto bad; #if PY_VERSION_HEX >= 0x02070000 ptr = PyCapsule_GetPointer(ob, 0); #else ptr = PyCObject_AsVoidPtr(ob); #endif if (!ptr && !PyErr_Occurred()) PyErr_SetString(PyExc_RuntimeError, "invalid vtable found for imported type"); Py_DECREF(ob); return ptr; bad: Py_XDECREF(ob); return NULL; } static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list, int level) { PyObject *empty_list = 0; PyObject *module = 0; PyObject *global_dict = 0; PyObject *empty_dict = 0; PyObject *list; #if PY_VERSION_HEX < 0x03030000 PyObject *py_import; py_import = __Pyx_PyObject_GetAttrStr(__pyx_b, __pyx_n_s_import); if (!py_import) goto bad; #endif if (from_list) list = from_list; else { empty_list = PyList_New(0); if (!empty_list) goto bad; list = empty_list; } global_dict = PyModule_GetDict(__pyx_m); if (!global_dict) goto bad; empty_dict = PyDict_New(); if (!empty_dict) goto bad; { #if PY_MAJOR_VERSION >= 3 if (level == -1) { if (strchr(__Pyx_MODULE_NAME, '.')) { #if PY_VERSION_HEX < 0x03030000 PyObject *py_level = PyInt_FromLong(1); if (!py_level) goto bad; module = PyObject_CallFunctionObjArgs(py_import, name, global_dict, empty_dict, list, py_level, NULL); Py_DECREF(py_level); #else module = PyImport_ImportModuleLevelObject( name, global_dict, empty_dict, list, 1); #endif if (!module) { if (!PyErr_ExceptionMatches(PyExc_ImportError)) goto bad; PyErr_Clear(); } } level = 0; } #endif if (!module) { #if PY_VERSION_HEX < 0x03030000 PyObject *py_level = PyInt_FromLong(level); if (!py_level) goto bad; module = PyObject_CallFunctionObjArgs(py_import, name, global_dict, empty_dict, list, py_level, NULL); Py_DECREF(py_level); #else module = PyImport_ImportModuleLevelObject( name, global_dict, empty_dict, list, level); #endif } } bad: #if PY_VERSION_HEX < 0x03030000 Py_XDECREF(py_import); #endif Py_XDECREF(empty_list); Py_XDECREF(empty_dict); return module; } static PyObject* __Pyx_ImportFrom(PyObject* module, PyObject* name) { PyObject* value = __Pyx_PyObject_GetAttrStr(module, name); if (unlikely(!value) && PyErr_ExceptionMatches(PyExc_AttributeError)) { PyErr_Format(PyExc_ImportError, #if PY_MAJOR_VERSION < 3 "cannot import name %.230s", PyString_AS_STRING(name)); #else "cannot import name %S", name); #endif } return value; } static int __pyx_bisect_code_objects(__Pyx_CodeObjectCacheEntry* entries, int count, int code_line) { int start = 0, mid = 0, end = count - 1; if (end >= 0 && code_line > entries[end].code_line) { return count; } while (start < end) { mid = start + (end - start) / 2; if (code_line < entries[mid].code_line) { end = mid; } else if (code_line > entries[mid].code_line) { start = mid + 1; } else { return mid; } } if (code_line <= entries[mid].code_line) { return mid; } else { return mid + 1; } } static PyCodeObject *__pyx_find_code_object(int code_line) { PyCodeObject* code_object; int pos; if (unlikely(!code_line) || unlikely(!__pyx_code_cache.entries)) { return NULL; } pos = __pyx_bisect_code_objects(__pyx_code_cache.entries, __pyx_code_cache.count, code_line); if (unlikely(pos >= __pyx_code_cache.count) || unlikely(__pyx_code_cache.entries[pos].code_line != code_line)) { return NULL; } code_object = __pyx_code_cache.entries[pos].code_object; Py_INCREF(code_object); return code_object; } static void __pyx_insert_code_object(int code_line, PyCodeObject* code_object) { int pos, i; __Pyx_CodeObjectCacheEntry* entries = __pyx_code_cache.entries; if (unlikely(!code_line)) { return; } if (unlikely(!entries)) { entries = (__Pyx_CodeObjectCacheEntry*)PyMem_Malloc(64*sizeof(__Pyx_CodeObjectCacheEntry)); if (likely(entries)) { __pyx_code_cache.entries = entries; __pyx_code_cache.max_count = 64; __pyx_code_cache.count = 1; entries[0].code_line = code_line; entries[0].code_object = code_object; Py_INCREF(code_object); } return; } pos = __pyx_bisect_code_objects(__pyx_code_cache.entries, __pyx_code_cache.count, code_line); if ((pos < __pyx_code_cache.count) && unlikely(__pyx_code_cache.entries[pos].code_line == code_line)) { PyCodeObject* tmp = entries[pos].code_object; entries[pos].code_object = code_object; Py_DECREF(tmp); return; } if (__pyx_code_cache.count == __pyx_code_cache.max_count) { int new_max = __pyx_code_cache.max_count + 64; entries = (__Pyx_CodeObjectCacheEntry*)PyMem_Realloc( __pyx_code_cache.entries, (size_t)new_max*sizeof(__Pyx_CodeObjectCacheEntry)); if (unlikely(!entries)) { return; } __pyx_code_cache.entries = entries; __pyx_code_cache.max_count = new_max; } for (i=__pyx_code_cache.count; i>pos; i--) { entries[i] = entries[i-1]; } entries[pos].code_line = code_line; entries[pos].code_object = code_object; __pyx_code_cache.count++; Py_INCREF(code_object); } #include "compile.h" #include "frameobject.h" #include "traceback.h" static PyCodeObject* __Pyx_CreateCodeObjectForTraceback( const char *funcname, int c_line, int py_line, const char *filename) { PyCodeObject *py_code = 0; PyObject *py_srcfile = 0; PyObject *py_funcname = 0; #if PY_MAJOR_VERSION < 3 py_srcfile = PyString_FromString(filename); #else py_srcfile = PyUnicode_FromString(filename); #endif if (!py_srcfile) goto bad; if (c_line) { #if PY_MAJOR_VERSION < 3 py_funcname = PyString_FromFormat( "%s (%s:%d)", funcname, __pyx_cfilenm, c_line); #else py_funcname = PyUnicode_FromFormat( "%s (%s:%d)", funcname, __pyx_cfilenm, c_line); #endif } else { #if PY_MAJOR_VERSION < 3 py_funcname = PyString_FromString(funcname); #else py_funcname = PyUnicode_FromString(funcname); #endif } if (!py_funcname) goto bad; py_code = __Pyx_PyCode_New( 0, 0, 0, 0, 0, __pyx_empty_bytes, /*PyObject *code,*/ __pyx_empty_tuple, /*PyObject *consts,*/ __pyx_empty_tuple, /*PyObject *names,*/ __pyx_empty_tuple, /*PyObject *varnames,*/ __pyx_empty_tuple, /*PyObject *freevars,*/ __pyx_empty_tuple, /*PyObject *cellvars,*/ py_srcfile, /*PyObject *filename,*/ py_funcname, /*PyObject *name,*/ py_line, __pyx_empty_bytes /*PyObject *lnotab*/ ); Py_DECREF(py_srcfile); Py_DECREF(py_funcname); return py_code; bad: Py_XDECREF(py_srcfile); Py_XDECREF(py_funcname); return NULL; } static void __Pyx_AddTraceback(const char *funcname, int c_line, int py_line, const char *filename) { PyCodeObject *py_code = 0; PyFrameObject *py_frame = 0; py_code = __pyx_find_code_object(c_line ? c_line : py_line); if (!py_code) { py_code = __Pyx_CreateCodeObjectForTraceback( funcname, c_line, py_line, filename); if (!py_code) goto bad; __pyx_insert_code_object(c_line ? c_line : py_line, py_code); } py_frame = PyFrame_New( PyThreadState_GET(), /*PyThreadState *tstate,*/ py_code, /*PyCodeObject *code,*/ __pyx_d, /*PyObject *globals,*/ 0 /*PyObject *locals*/ ); if (!py_frame) goto bad; py_frame->f_lineno = py_line; PyTraceBack_Here(py_frame); bad: Py_XDECREF(py_code); Py_XDECREF(py_frame); } #define __PYX_VERIFY_RETURN_INT(target_type, func_type, func_value)\ __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, 0) #define __PYX_VERIFY_RETURN_INT_EXC(target_type, func_type, func_value)\ __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, 1) #define __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, exc)\ {\ func_type value = func_value;\ if (sizeof(target_type) < sizeof(func_type)) {\ if (unlikely(value != (func_type) (target_type) value)) {\ func_type zero = 0;\ if (exc && unlikely(value == (func_type)-1 && PyErr_Occurred()))\ return (target_type) -1;\ if (is_unsigned && unlikely(value < zero))\ goto raise_neg_overflow;\ else\ goto raise_overflow;\ }\ }\ return (target_type) value;\ } #if CYTHON_USE_PYLONG_INTERNALS #include "longintrepr.h" #endif static CYTHON_INLINE int __Pyx_PyInt_As_int(PyObject *x) { const int neg_one = (int) -1, const_zero = (int) 0; const int is_unsigned = neg_one > const_zero; #if PY_MAJOR_VERSION < 3 if (likely(PyInt_Check(x))) { if (sizeof(int) < sizeof(long)) { __PYX_VERIFY_RETURN_INT(int, long, PyInt_AS_LONG(x)) } else { long val = PyInt_AS_LONG(x); if (is_unsigned && unlikely(val < 0)) { goto raise_neg_overflow; } return (int) val; } } else #endif if (likely(PyLong_Check(x))) { if (is_unsigned) { #if CYTHON_USE_PYLONG_INTERNALS const digit* digits = ((PyLongObject*)x)->ob_digit; switch (Py_SIZE(x)) { case 0: return (int) 0; case 1: __PYX_VERIFY_RETURN_INT(int, digit, digits[0]) case 2: if (8 * sizeof(int) > 1 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(int) >= 2 * PyLong_SHIFT) { return (int) (((((int)digits[1]) << PyLong_SHIFT) | (int)digits[0])); } } break; case 3: if (8 * sizeof(int) > 2 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(int) >= 3 * PyLong_SHIFT) { return (int) (((((((int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0])); } } break; case 4: if (8 * sizeof(int) > 3 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(int) >= 4 * PyLong_SHIFT) { return (int) (((((((((int)digits[3]) << PyLong_SHIFT) | (int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0])); } } break; } #endif #if CYTHON_COMPILING_IN_CPYTHON if (unlikely(Py_SIZE(x) < 0)) { goto raise_neg_overflow; } #else { int result = PyObject_RichCompareBool(x, Py_False, Py_LT); if (unlikely(result < 0)) return (int) -1; if (unlikely(result == 1)) goto raise_neg_overflow; } #endif if (sizeof(int) <= sizeof(unsigned long)) { __PYX_VERIFY_RETURN_INT_EXC(int, unsigned long, PyLong_AsUnsignedLong(x)) } else if (sizeof(int) <= sizeof(unsigned PY_LONG_LONG)) { __PYX_VERIFY_RETURN_INT_EXC(int, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x)) } } else { #if CYTHON_USE_PYLONG_INTERNALS const digit* digits = ((PyLongObject*)x)->ob_digit; switch (Py_SIZE(x)) { case 0: return (int) 0; case -1: __PYX_VERIFY_RETURN_INT(int, sdigit, -(sdigit) digits[0]) case 1: __PYX_VERIFY_RETURN_INT(int, digit, +digits[0]) case -2: if (8 * sizeof(int) - 1 > 1 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(int, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(int) - 1 > 2 * PyLong_SHIFT) { return (int) (((int)-1)*(((((int)digits[1]) << PyLong_SHIFT) | (int)digits[0]))); } } break; case 2: if (8 * sizeof(int) > 1 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(int) - 1 > 2 * PyLong_SHIFT) { return (int) ((((((int)digits[1]) << PyLong_SHIFT) | (int)digits[0]))); } } break; case -3: if (8 * sizeof(int) - 1 > 2 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(int, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(int) - 1 > 3 * PyLong_SHIFT) { return (int) (((int)-1)*(((((((int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0]))); } } break; case 3: if (8 * sizeof(int) > 2 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(int) - 1 > 3 * PyLong_SHIFT) { return (int) ((((((((int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0]))); } } break; case -4: if (8 * sizeof(int) - 1 > 3 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(int, long, -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(int) - 1 > 4 * PyLong_SHIFT) { return (int) (((int)-1)*(((((((((int)digits[3]) << PyLong_SHIFT) | (int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0]))); } } break; case 4: if (8 * sizeof(int) > 3 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(int) - 1 > 4 * PyLong_SHIFT) { return (int) ((((((((((int)digits[3]) << PyLong_SHIFT) | (int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0]))); } } break; } #endif if (sizeof(int) <= sizeof(long)) { __PYX_VERIFY_RETURN_INT_EXC(int, long, PyLong_AsLong(x)) } else if (sizeof(int) <= sizeof(PY_LONG_LONG)) { __PYX_VERIFY_RETURN_INT_EXC(int, PY_LONG_LONG, PyLong_AsLongLong(x)) } } { #if CYTHON_COMPILING_IN_PYPY && !defined(_PyLong_AsByteArray) PyErr_SetString(PyExc_RuntimeError, "_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers"); #else int val; PyObject *v = __Pyx_PyNumber_Int(x); #if PY_MAJOR_VERSION < 3 if (likely(v) && !PyLong_Check(v)) { PyObject *tmp = v; v = PyNumber_Long(tmp); Py_DECREF(tmp); } #endif if (likely(v)) { int one = 1; int is_little = (int)*(unsigned char *)&one; unsigned char *bytes = (unsigned char *)&val; int ret = _PyLong_AsByteArray((PyLongObject *)v, bytes, sizeof(val), is_little, !is_unsigned); Py_DECREF(v); if (likely(!ret)) return val; } #endif return (int) -1; } } else { int val; PyObject *tmp = __Pyx_PyNumber_Int(x); if (!tmp) return (int) -1; val = __Pyx_PyInt_As_int(tmp); Py_DECREF(tmp); return val; } raise_overflow: PyErr_SetString(PyExc_OverflowError, "value too large to convert to int"); return (int) -1; raise_neg_overflow: PyErr_SetString(PyExc_OverflowError, "can't convert negative value to int"); return (int) -1; } static CYTHON_INLINE PyObject* __Pyx_PyInt_From_uint8_t(uint8_t value) { const uint8_t neg_one = (uint8_t) -1, const_zero = (uint8_t) 0; const int is_unsigned = neg_one > const_zero; if (is_unsigned) { if (sizeof(uint8_t) < sizeof(long)) { return PyInt_FromLong((long) value); } else if (sizeof(uint8_t) <= sizeof(unsigned long)) { return PyLong_FromUnsignedLong((unsigned long) value); } else if (sizeof(uint8_t) <= sizeof(unsigned PY_LONG_LONG)) { return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value); } } else { if (sizeof(uint8_t) <= sizeof(long)) { return PyInt_FromLong((long) value); } else if (sizeof(uint8_t) <= sizeof(PY_LONG_LONG)) { return PyLong_FromLongLong((PY_LONG_LONG) value); } } { int one = 1; int little = (int)*(unsigned char *)&one; unsigned char *bytes = (unsigned char *)&value; return _PyLong_FromByteArray(bytes, sizeof(uint8_t), little, !is_unsigned); } } static CYTHON_INLINE PyObject* __Pyx_PyInt_From_SDL_Keymod(SDL_Keymod value) { const SDL_Keymod neg_one = (SDL_Keymod) -1, const_zero = (SDL_Keymod) 0; const int is_unsigned = neg_one > const_zero; if (is_unsigned) { if (sizeof(SDL_Keymod) < sizeof(long)) { return PyInt_FromLong((long) value); } else if (sizeof(SDL_Keymod) <= sizeof(unsigned long)) { return PyLong_FromUnsignedLong((unsigned long) value); } else if (sizeof(SDL_Keymod) <= sizeof(unsigned PY_LONG_LONG)) { return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value); } } else { if (sizeof(SDL_Keymod) <= sizeof(long)) { return PyInt_FromLong((long) value); } else if (sizeof(SDL_Keymod) <= sizeof(PY_LONG_LONG)) { return PyLong_FromLongLong((PY_LONG_LONG) value); } } { int one = 1; int little = (int)*(unsigned char *)&one; unsigned char *bytes = (unsigned char *)&value; return _PyLong_FromByteArray(bytes, sizeof(SDL_Keymod), little, !is_unsigned); } } static CYTHON_INLINE SDL_Keymod __Pyx_PyInt_As_SDL_Keymod(PyObject *x) { const SDL_Keymod neg_one = (SDL_Keymod) -1, const_zero = (SDL_Keymod) 0; const int is_unsigned = neg_one > const_zero; #if PY_MAJOR_VERSION < 3 if (likely(PyInt_Check(x))) { if (sizeof(SDL_Keymod) < sizeof(long)) { __PYX_VERIFY_RETURN_INT(SDL_Keymod, long, PyInt_AS_LONG(x)) } else { long val = PyInt_AS_LONG(x); if (is_unsigned && unlikely(val < 0)) { goto raise_neg_overflow; } return (SDL_Keymod) val; } } else #endif if (likely(PyLong_Check(x))) { if (is_unsigned) { #if CYTHON_USE_PYLONG_INTERNALS const digit* digits = ((PyLongObject*)x)->ob_digit; switch (Py_SIZE(x)) { case 0: return (SDL_Keymod) 0; case 1: __PYX_VERIFY_RETURN_INT(SDL_Keymod, digit, digits[0]) case 2: if (8 * sizeof(SDL_Keymod) > 1 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(SDL_Keymod, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(SDL_Keymod) >= 2 * PyLong_SHIFT) { return (SDL_Keymod) (((((SDL_Keymod)digits[1]) << PyLong_SHIFT) | (SDL_Keymod)digits[0])); } } break; case 3: if (8 * sizeof(SDL_Keymod) > 2 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(SDL_Keymod, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(SDL_Keymod) >= 3 * PyLong_SHIFT) { return (SDL_Keymod) (((((((SDL_Keymod)digits[2]) << PyLong_SHIFT) | (SDL_Keymod)digits[1]) << PyLong_SHIFT) | (SDL_Keymod)digits[0])); } } break; case 4: if (8 * sizeof(SDL_Keymod) > 3 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(SDL_Keymod, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(SDL_Keymod) >= 4 * PyLong_SHIFT) { return (SDL_Keymod) (((((((((SDL_Keymod)digits[3]) << PyLong_SHIFT) | (SDL_Keymod)digits[2]) << PyLong_SHIFT) | (SDL_Keymod)digits[1]) << PyLong_SHIFT) | (SDL_Keymod)digits[0])); } } break; } #endif #if CYTHON_COMPILING_IN_CPYTHON if (unlikely(Py_SIZE(x) < 0)) { goto raise_neg_overflow; } #else { int result = PyObject_RichCompareBool(x, Py_False, Py_LT); if (unlikely(result < 0)) return (SDL_Keymod) -1; if (unlikely(result == 1)) goto raise_neg_overflow; } #endif if (sizeof(SDL_Keymod) <= sizeof(unsigned long)) { __PYX_VERIFY_RETURN_INT_EXC(SDL_Keymod, unsigned long, PyLong_AsUnsignedLong(x)) } else if (sizeof(SDL_Keymod) <= sizeof(unsigned PY_LONG_LONG)) { __PYX_VERIFY_RETURN_INT_EXC(SDL_Keymod, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x)) } } else { #if CYTHON_USE_PYLONG_INTERNALS const digit* digits = ((PyLongObject*)x)->ob_digit; switch (Py_SIZE(x)) { case 0: return (SDL_Keymod) 0; case -1: __PYX_VERIFY_RETURN_INT(SDL_Keymod, sdigit, -(sdigit) digits[0]) case 1: __PYX_VERIFY_RETURN_INT(SDL_Keymod, digit, +digits[0]) case -2: if (8 * sizeof(SDL_Keymod) - 1 > 1 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(SDL_Keymod, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(SDL_Keymod) - 1 > 2 * PyLong_SHIFT) { return (SDL_Keymod) (((SDL_Keymod)-1)*(((((SDL_Keymod)digits[1]) << PyLong_SHIFT) | (SDL_Keymod)digits[0]))); } } break; case 2: if (8 * sizeof(SDL_Keymod) > 1 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(SDL_Keymod, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(SDL_Keymod) - 1 > 2 * PyLong_SHIFT) { return (SDL_Keymod) ((((((SDL_Keymod)digits[1]) << PyLong_SHIFT) | (SDL_Keymod)digits[0]))); } } break; case -3: if (8 * sizeof(SDL_Keymod) - 1 > 2 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(SDL_Keymod, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(SDL_Keymod) - 1 > 3 * PyLong_SHIFT) { return (SDL_Keymod) (((SDL_Keymod)-1)*(((((((SDL_Keymod)digits[2]) << PyLong_SHIFT) | (SDL_Keymod)digits[1]) << PyLong_SHIFT) | (SDL_Keymod)digits[0]))); } } break; case 3: if (8 * sizeof(SDL_Keymod) > 2 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(SDL_Keymod, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(SDL_Keymod) - 1 > 3 * PyLong_SHIFT) { return (SDL_Keymod) ((((((((SDL_Keymod)digits[2]) << PyLong_SHIFT) | (SDL_Keymod)digits[1]) << PyLong_SHIFT) | (SDL_Keymod)digits[0]))); } } break; case -4: if (8 * sizeof(SDL_Keymod) - 1 > 3 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(SDL_Keymod, long, -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(SDL_Keymod) - 1 > 4 * PyLong_SHIFT) { return (SDL_Keymod) (((SDL_Keymod)-1)*(((((((((SDL_Keymod)digits[3]) << PyLong_SHIFT) | (SDL_Keymod)digits[2]) << PyLong_SHIFT) | (SDL_Keymod)digits[1]) << PyLong_SHIFT) | (SDL_Keymod)digits[0]))); } } break; case 4: if (8 * sizeof(SDL_Keymod) > 3 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(SDL_Keymod, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(SDL_Keymod) - 1 > 4 * PyLong_SHIFT) { return (SDL_Keymod) ((((((((((SDL_Keymod)digits[3]) << PyLong_SHIFT) | (SDL_Keymod)digits[2]) << PyLong_SHIFT) | (SDL_Keymod)digits[1]) << PyLong_SHIFT) | (SDL_Keymod)digits[0]))); } } break; } #endif if (sizeof(SDL_Keymod) <= sizeof(long)) { __PYX_VERIFY_RETURN_INT_EXC(SDL_Keymod, long, PyLong_AsLong(x)) } else if (sizeof(SDL_Keymod) <= sizeof(PY_LONG_LONG)) { __PYX_VERIFY_RETURN_INT_EXC(SDL_Keymod, PY_LONG_LONG, PyLong_AsLongLong(x)) } } { #if CYTHON_COMPILING_IN_PYPY && !defined(_PyLong_AsByteArray) PyErr_SetString(PyExc_RuntimeError, "_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers"); #else SDL_Keymod val; PyObject *v = __Pyx_PyNumber_Int(x); #if PY_MAJOR_VERSION < 3 if (likely(v) && !PyLong_Check(v)) { PyObject *tmp = v; v = PyNumber_Long(tmp); Py_DECREF(tmp); } #endif if (likely(v)) { int one = 1; int is_little = (int)*(unsigned char *)&one; unsigned char *bytes = (unsigned char *)&val; int ret = _PyLong_AsByteArray((PyLongObject *)v, bytes, sizeof(val), is_little, !is_unsigned); Py_DECREF(v); if (likely(!ret)) return val; } #endif return (SDL_Keymod) -1; } } else { SDL_Keymod val; PyObject *tmp = __Pyx_PyNumber_Int(x); if (!tmp) return (SDL_Keymod) -1; val = __Pyx_PyInt_As_SDL_Keymod(tmp); Py_DECREF(tmp); return val; } raise_overflow: PyErr_SetString(PyExc_OverflowError, "value too large to convert to SDL_Keymod"); return (SDL_Keymod) -1; raise_neg_overflow: PyErr_SetString(PyExc_OverflowError, "can't convert negative value to SDL_Keymod"); return (SDL_Keymod) -1; } static CYTHON_INLINE int32_t __Pyx_PyInt_As_int32_t(PyObject *x) { const int32_t neg_one = (int32_t) -1, const_zero = (int32_t) 0; const int is_unsigned = neg_one > const_zero; #if PY_MAJOR_VERSION < 3 if (likely(PyInt_Check(x))) { if (sizeof(int32_t) < sizeof(long)) { __PYX_VERIFY_RETURN_INT(int32_t, long, PyInt_AS_LONG(x)) } else { long val = PyInt_AS_LONG(x); if (is_unsigned && unlikely(val < 0)) { goto raise_neg_overflow; } return (int32_t) val; } } else #endif if (likely(PyLong_Check(x))) { if (is_unsigned) { #if CYTHON_USE_PYLONG_INTERNALS const digit* digits = ((PyLongObject*)x)->ob_digit; switch (Py_SIZE(x)) { case 0: return (int32_t) 0; case 1: __PYX_VERIFY_RETURN_INT(int32_t, digit, digits[0]) case 2: if (8 * sizeof(int32_t) > 1 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(int32_t, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(int32_t) >= 2 * PyLong_SHIFT) { return (int32_t) (((((int32_t)digits[1]) << PyLong_SHIFT) | (int32_t)digits[0])); } } break; case 3: if (8 * sizeof(int32_t) > 2 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(int32_t, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(int32_t) >= 3 * PyLong_SHIFT) { return (int32_t) (((((((int32_t)digits[2]) << PyLong_SHIFT) | (int32_t)digits[1]) << PyLong_SHIFT) | (int32_t)digits[0])); } } break; case 4: if (8 * sizeof(int32_t) > 3 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(int32_t, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(int32_t) >= 4 * PyLong_SHIFT) { return (int32_t) (((((((((int32_t)digits[3]) << PyLong_SHIFT) | (int32_t)digits[2]) << PyLong_SHIFT) | (int32_t)digits[1]) << PyLong_SHIFT) | (int32_t)digits[0])); } } break; } #endif #if CYTHON_COMPILING_IN_CPYTHON if (unlikely(Py_SIZE(x) < 0)) { goto raise_neg_overflow; } #else { int result = PyObject_RichCompareBool(x, Py_False, Py_LT); if (unlikely(result < 0)) return (int32_t) -1; if (unlikely(result == 1)) goto raise_neg_overflow; } #endif if (sizeof(int32_t) <= sizeof(unsigned long)) { __PYX_VERIFY_RETURN_INT_EXC(int32_t, unsigned long, PyLong_AsUnsignedLong(x)) } else if (sizeof(int32_t) <= sizeof(unsigned PY_LONG_LONG)) { __PYX_VERIFY_RETURN_INT_EXC(int32_t, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x)) } } else { #if CYTHON_USE_PYLONG_INTERNALS const digit* digits = ((PyLongObject*)x)->ob_digit; switch (Py_SIZE(x)) { case 0: return (int32_t) 0; case -1: __PYX_VERIFY_RETURN_INT(int32_t, sdigit, -(sdigit) digits[0]) case 1: __PYX_VERIFY_RETURN_INT(int32_t, digit, +digits[0]) case -2: if (8 * sizeof(int32_t) - 1 > 1 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(int32_t, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(int32_t) - 1 > 2 * PyLong_SHIFT) { return (int32_t) (((int32_t)-1)*(((((int32_t)digits[1]) << PyLong_SHIFT) | (int32_t)digits[0]))); } } break; case 2: if (8 * sizeof(int32_t) > 1 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(int32_t, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(int32_t) - 1 > 2 * PyLong_SHIFT) { return (int32_t) ((((((int32_t)digits[1]) << PyLong_SHIFT) | (int32_t)digits[0]))); } } break; case -3: if (8 * sizeof(int32_t) - 1 > 2 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(int32_t, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(int32_t) - 1 > 3 * PyLong_SHIFT) { return (int32_t) (((int32_t)-1)*(((((((int32_t)digits[2]) << PyLong_SHIFT) | (int32_t)digits[1]) << PyLong_SHIFT) | (int32_t)digits[0]))); } } break; case 3: if (8 * sizeof(int32_t) > 2 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(int32_t, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(int32_t) - 1 > 3 * PyLong_SHIFT) { return (int32_t) ((((((((int32_t)digits[2]) << PyLong_SHIFT) | (int32_t)digits[1]) << PyLong_SHIFT) | (int32_t)digits[0]))); } } break; case -4: if (8 * sizeof(int32_t) - 1 > 3 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(int32_t, long, -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(int32_t) - 1 > 4 * PyLong_SHIFT) { return (int32_t) (((int32_t)-1)*(((((((((int32_t)digits[3]) << PyLong_SHIFT) | (int32_t)digits[2]) << PyLong_SHIFT) | (int32_t)digits[1]) << PyLong_SHIFT) | (int32_t)digits[0]))); } } break; case 4: if (8 * sizeof(int32_t) > 3 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(int32_t, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(int32_t) - 1 > 4 * PyLong_SHIFT) { return (int32_t) ((((((((((int32_t)digits[3]) << PyLong_SHIFT) | (int32_t)digits[2]) << PyLong_SHIFT) | (int32_t)digits[1]) << PyLong_SHIFT) | (int32_t)digits[0]))); } } break; } #endif if (sizeof(int32_t) <= sizeof(long)) { __PYX_VERIFY_RETURN_INT_EXC(int32_t, long, PyLong_AsLong(x)) } else if (sizeof(int32_t) <= sizeof(PY_LONG_LONG)) { __PYX_VERIFY_RETURN_INT_EXC(int32_t, PY_LONG_LONG, PyLong_AsLongLong(x)) } } { #if CYTHON_COMPILING_IN_PYPY && !defined(_PyLong_AsByteArray) PyErr_SetString(PyExc_RuntimeError, "_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers"); #else int32_t val; PyObject *v = __Pyx_PyNumber_Int(x); #if PY_MAJOR_VERSION < 3 if (likely(v) && !PyLong_Check(v)) { PyObject *tmp = v; v = PyNumber_Long(tmp); Py_DECREF(tmp); } #endif if (likely(v)) { int one = 1; int is_little = (int)*(unsigned char *)&one; unsigned char *bytes = (unsigned char *)&val; int ret = _PyLong_AsByteArray((PyLongObject *)v, bytes, sizeof(val), is_little, !is_unsigned); Py_DECREF(v); if (likely(!ret)) return val; } #endif return (int32_t) -1; } } else { int32_t val; PyObject *tmp = __Pyx_PyNumber_Int(x); if (!tmp) return (int32_t) -1; val = __Pyx_PyInt_As_int32_t(tmp); Py_DECREF(tmp); return val; } raise_overflow: PyErr_SetString(PyExc_OverflowError, "value too large to convert to int32_t"); return (int32_t) -1; raise_neg_overflow: PyErr_SetString(PyExc_OverflowError, "can't convert negative value to int32_t"); return (int32_t) -1; } static CYTHON_INLINE PyObject* __Pyx_PyInt_From_SDL_bool(SDL_bool value) { const SDL_bool neg_one = (SDL_bool) -1, const_zero = (SDL_bool) 0; const int is_unsigned = neg_one > const_zero; if (is_unsigned) { if (sizeof(SDL_bool) < sizeof(long)) { return PyInt_FromLong((long) value); } else if (sizeof(SDL_bool) <= sizeof(unsigned long)) { return PyLong_FromUnsignedLong((unsigned long) value); } else if (sizeof(SDL_bool) <= sizeof(unsigned PY_LONG_LONG)) { return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value); } } else { if (sizeof(SDL_bool) <= sizeof(long)) { return PyInt_FromLong((long) value); } else if (sizeof(SDL_bool) <= sizeof(PY_LONG_LONG)) { return PyLong_FromLongLong((PY_LONG_LONG) value); } } { int one = 1; int little = (int)*(unsigned char *)&one; unsigned char *bytes = (unsigned char *)&value; return _PyLong_FromByteArray(bytes, sizeof(SDL_bool), little, !is_unsigned); } } static CYTHON_INLINE PyObject* __Pyx_PyInt_From_long(long value) { const long neg_one = (long) -1, const_zero = (long) 0; const int is_unsigned = neg_one > const_zero; if (is_unsigned) { if (sizeof(long) < sizeof(long)) { return PyInt_FromLong((long) value); } else if (sizeof(long) <= sizeof(unsigned long)) { return PyLong_FromUnsignedLong((unsigned long) value); } else if (sizeof(long) <= sizeof(unsigned PY_LONG_LONG)) { return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value); } } else { if (sizeof(long) <= sizeof(long)) { return PyInt_FromLong((long) value); } else if (sizeof(long) <= sizeof(PY_LONG_LONG)) { return PyLong_FromLongLong((PY_LONG_LONG) value); } } { int one = 1; int little = (int)*(unsigned char *)&one; unsigned char *bytes = (unsigned char *)&value; return _PyLong_FromByteArray(bytes, sizeof(long), little, !is_unsigned); } } static CYTHON_INLINE long __Pyx_PyInt_As_long(PyObject *x) { const long neg_one = (long) -1, const_zero = (long) 0; const int is_unsigned = neg_one > const_zero; #if PY_MAJOR_VERSION < 3 if (likely(PyInt_Check(x))) { if (sizeof(long) < sizeof(long)) { __PYX_VERIFY_RETURN_INT(long, long, PyInt_AS_LONG(x)) } else { long val = PyInt_AS_LONG(x); if (is_unsigned && unlikely(val < 0)) { goto raise_neg_overflow; } return (long) val; } } else #endif if (likely(PyLong_Check(x))) { if (is_unsigned) { #if CYTHON_USE_PYLONG_INTERNALS const digit* digits = ((PyLongObject*)x)->ob_digit; switch (Py_SIZE(x)) { case 0: return (long) 0; case 1: __PYX_VERIFY_RETURN_INT(long, digit, digits[0]) case 2: if (8 * sizeof(long) > 1 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(long) >= 2 * PyLong_SHIFT) { return (long) (((((long)digits[1]) << PyLong_SHIFT) | (long)digits[0])); } } break; case 3: if (8 * sizeof(long) > 2 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(long) >= 3 * PyLong_SHIFT) { return (long) (((((((long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0])); } } break; case 4: if (8 * sizeof(long) > 3 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(long) >= 4 * PyLong_SHIFT) { return (long) (((((((((long)digits[3]) << PyLong_SHIFT) | (long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0])); } } break; } #endif #if CYTHON_COMPILING_IN_CPYTHON if (unlikely(Py_SIZE(x) < 0)) { goto raise_neg_overflow; } #else { int result = PyObject_RichCompareBool(x, Py_False, Py_LT); if (unlikely(result < 0)) return (long) -1; if (unlikely(result == 1)) goto raise_neg_overflow; } #endif if (sizeof(long) <= sizeof(unsigned long)) { __PYX_VERIFY_RETURN_INT_EXC(long, unsigned long, PyLong_AsUnsignedLong(x)) } else if (sizeof(long) <= sizeof(unsigned PY_LONG_LONG)) { __PYX_VERIFY_RETURN_INT_EXC(long, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x)) } } else { #if CYTHON_USE_PYLONG_INTERNALS const digit* digits = ((PyLongObject*)x)->ob_digit; switch (Py_SIZE(x)) { case 0: return (long) 0; case -1: __PYX_VERIFY_RETURN_INT(long, sdigit, -(sdigit) digits[0]) case 1: __PYX_VERIFY_RETURN_INT(long, digit, +digits[0]) case -2: if (8 * sizeof(long) - 1 > 1 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(long, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) { return (long) (((long)-1)*(((((long)digits[1]) << PyLong_SHIFT) | (long)digits[0]))); } } break; case 2: if (8 * sizeof(long) > 1 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) { return (long) ((((((long)digits[1]) << PyLong_SHIFT) | (long)digits[0]))); } } break; case -3: if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(long, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) { return (long) (((long)-1)*(((((((long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0]))); } } break; case 3: if (8 * sizeof(long) > 2 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) { return (long) ((((((((long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0]))); } } break; case -4: if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(long, long, -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(long) - 1 > 4 * PyLong_SHIFT) { return (long) (((long)-1)*(((((((((long)digits[3]) << PyLong_SHIFT) | (long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0]))); } } break; case 4: if (8 * sizeof(long) > 3 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(long) - 1 > 4 * PyLong_SHIFT) { return (long) ((((((((((long)digits[3]) << PyLong_SHIFT) | (long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0]))); } } break; } #endif if (sizeof(long) <= sizeof(long)) { __PYX_VERIFY_RETURN_INT_EXC(long, long, PyLong_AsLong(x)) } else if (sizeof(long) <= sizeof(PY_LONG_LONG)) { __PYX_VERIFY_RETURN_INT_EXC(long, PY_LONG_LONG, PyLong_AsLongLong(x)) } } { #if CYTHON_COMPILING_IN_PYPY && !defined(_PyLong_AsByteArray) PyErr_SetString(PyExc_RuntimeError, "_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers"); #else long val; PyObject *v = __Pyx_PyNumber_Int(x); #if PY_MAJOR_VERSION < 3 if (likely(v) && !PyLong_Check(v)) { PyObject *tmp = v; v = PyNumber_Long(tmp); Py_DECREF(tmp); } #endif if (likely(v)) { int one = 1; int is_little = (int)*(unsigned char *)&one; unsigned char *bytes = (unsigned char *)&val; int ret = _PyLong_AsByteArray((PyLongObject *)v, bytes, sizeof(val), is_little, !is_unsigned); Py_DECREF(v); if (likely(!ret)) return val; } #endif return (long) -1; } } else { long val; PyObject *tmp = __Pyx_PyNumber_Int(x); if (!tmp) return (long) -1; val = __Pyx_PyInt_As_long(tmp); Py_DECREF(tmp); return val; } raise_overflow: PyErr_SetString(PyExc_OverflowError, "value too large to convert to long"); return (long) -1; raise_neg_overflow: PyErr_SetString(PyExc_OverflowError, "can't convert negative value to long"); return (long) -1; } static int __Pyx_check_binary_version(void) { char ctversion[4], rtversion[4]; PyOS_snprintf(ctversion, 4, "%d.%d", PY_MAJOR_VERSION, PY_MINOR_VERSION); PyOS_snprintf(rtversion, 4, "%s", Py_GetVersion()); if (ctversion[0] != rtversion[0] || ctversion[2] != rtversion[2]) { char message[200]; PyOS_snprintf(message, sizeof(message), "compiletime version %s of module '%.100s' " "does not match runtime version %s", ctversion, __Pyx_MODULE_NAME, rtversion); return PyErr_WarnEx(NULL, message, 1); } return 0; } #ifndef __PYX_HAVE_RT_ImportModule #define __PYX_HAVE_RT_ImportModule static PyObject *__Pyx_ImportModule(const char *name) { PyObject *py_name = 0; PyObject *py_module = 0; py_name = __Pyx_PyIdentifier_FromString(name); if (!py_name) goto bad; py_module = PyImport_Import(py_name); Py_DECREF(py_name); return py_module; bad: Py_XDECREF(py_name); return 0; } #endif #ifndef __PYX_HAVE_RT_ImportType #define __PYX_HAVE_RT_ImportType static PyTypeObject *__Pyx_ImportType(const char *module_name, const char *class_name, size_t size, int strict) { PyObject *py_module = 0; PyObject *result = 0; PyObject *py_name = 0; char warning[200]; Py_ssize_t basicsize; #ifdef Py_LIMITED_API PyObject *py_basicsize; #endif py_module = __Pyx_ImportModule(module_name); if (!py_module) goto bad; py_name = __Pyx_PyIdentifier_FromString(class_name); if (!py_name) goto bad; result = PyObject_GetAttr(py_module, py_name); Py_DECREF(py_name); py_name = 0; Py_DECREF(py_module); py_module = 0; if (!result) goto bad; if (!PyType_Check(result)) { PyErr_Format(PyExc_TypeError, "%.200s.%.200s is not a type object", module_name, class_name); goto bad; } #ifndef Py_LIMITED_API basicsize = ((PyTypeObject *)result)->tp_basicsize; #else py_basicsize = PyObject_GetAttrString(result, "__basicsize__"); if (!py_basicsize) goto bad; basicsize = PyLong_AsSsize_t(py_basicsize); Py_DECREF(py_basicsize); py_basicsize = 0; if (basicsize == (Py_ssize_t)-1 && PyErr_Occurred()) goto bad; #endif if (!strict && (size_t)basicsize > size) { PyOS_snprintf(warning, sizeof(warning), "%s.%s size changed, may indicate binary incompatibility", module_name, class_name); if (PyErr_WarnEx(NULL, warning, 0) < 0) goto bad; } else if ((size_t)basicsize != size) { PyErr_Format(PyExc_ValueError, "%.200s.%.200s has the wrong size, try recompiling", module_name, class_name); goto bad; } return (PyTypeObject *)result; bad: Py_XDECREF(py_module); Py_XDECREF(result); return NULL; } #endif #ifndef __PYX_HAVE_RT_ImportVoidPtr #define __PYX_HAVE_RT_ImportVoidPtr static int __Pyx_ImportVoidPtr(PyObject *module, const char *name, void **p, const char *sig) { PyObject *d = 0; PyObject *cobj = 0; d = PyObject_GetAttrString(module, (char *)"__pyx_capi__"); if (!d) goto bad; cobj = PyDict_GetItemString(d, name); if (!cobj) { PyErr_Format(PyExc_ImportError, "%.200s does not export expected C variable %.200s", PyModule_GetName(module), name); goto bad; } #if PY_VERSION_HEX >= 0x02070000 if (!PyCapsule_IsValid(cobj, sig)) { PyErr_Format(PyExc_TypeError, "C variable %.200s.%.200s has wrong signature (expected %.500s, got %.500s)", PyModule_GetName(module), name, sig, PyCapsule_GetName(cobj)); goto bad; } *p = PyCapsule_GetPointer(cobj, sig); #else {const char *desc, *s1, *s2; desc = (const char *)PyCObject_GetDesc(cobj); if (!desc) goto bad; s1 = desc; s2 = sig; while (*s1 != '\0' && *s1 == *s2) { s1++; s2++; } if (*s1 != *s2) { PyErr_Format(PyExc_TypeError, "C variable %.200s.%.200s has wrong signature (expected %.500s, got %.500s)", PyModule_GetName(module), name, sig, desc); goto bad; } *p = PyCObject_AsVoidPtr(cobj);} #endif if (!(*p)) goto bad; Py_DECREF(d); return 0; bad: Py_XDECREF(d); return -1; } #endif #ifndef __PYX_HAVE_RT_ImportFunction #define __PYX_HAVE_RT_ImportFunction static int __Pyx_ImportFunction(PyObject *module, const char *funcname, void (**f)(void), const char *sig) { PyObject *d = 0; PyObject *cobj = 0; union { void (*fp)(void); void *p; } tmp; d = PyObject_GetAttrString(module, (char *)"__pyx_capi__"); if (!d) goto bad; cobj = PyDict_GetItemString(d, funcname); if (!cobj) { PyErr_Format(PyExc_ImportError, "%.200s does not export expected C function %.200s", PyModule_GetName(module), funcname); goto bad; } #if PY_VERSION_HEX >= 0x02070000 if (!PyCapsule_IsValid(cobj, sig)) { PyErr_Format(PyExc_TypeError, "C function %.200s.%.200s has wrong signature (expected %.500s, got %.500s)", PyModule_GetName(module), funcname, sig, PyCapsule_GetName(cobj)); goto bad; } tmp.p = PyCapsule_GetPointer(cobj, sig); #else {const char *desc, *s1, *s2; desc = (const char *)PyCObject_GetDesc(cobj); if (!desc) goto bad; s1 = desc; s2 = sig; while (*s1 != '\0' && *s1 == *s2) { s1++; s2++; } if (*s1 != *s2) { PyErr_Format(PyExc_TypeError, "C function %.200s.%.200s has wrong signature (expected %.500s, got %.500s)", PyModule_GetName(module), funcname, sig, desc); goto bad; } tmp.p = PyCObject_AsVoidPtr(cobj);} #endif *f = tmp.fp; if (!(*f)) goto bad; Py_DECREF(d); return 0; bad: Py_XDECREF(d); return -1; } #endif static int __Pyx_InitStrings(__Pyx_StringTabEntry *t) { while (t->p) { #if PY_MAJOR_VERSION < 3 if (t->is_unicode) { *t->p = PyUnicode_DecodeUTF8(t->s, t->n - 1, NULL); } else if (t->intern) { *t->p = PyString_InternFromString(t->s); } else { *t->p = PyString_FromStringAndSize(t->s, t->n - 1); } #else if (t->is_unicode | t->is_str) { if (t->intern) { *t->p = PyUnicode_InternFromString(t->s); } else if (t->encoding) { *t->p = PyUnicode_Decode(t->s, t->n - 1, t->encoding, NULL); } else { *t->p = PyUnicode_FromStringAndSize(t->s, t->n - 1); } } else { *t->p = PyBytes_FromStringAndSize(t->s, t->n - 1); } #endif if (!*t->p) return -1; ++t; } return 0; } static CYTHON_INLINE PyObject* __Pyx_PyUnicode_FromString(const char* c_str) { return __Pyx_PyUnicode_FromStringAndSize(c_str, (Py_ssize_t)strlen(c_str)); } static CYTHON_INLINE char* __Pyx_PyObject_AsString(PyObject* o) { Py_ssize_t ignore; return __Pyx_PyObject_AsStringAndSize(o, &ignore); } static CYTHON_INLINE char* __Pyx_PyObject_AsStringAndSize(PyObject* o, Py_ssize_t *length) { #if CYTHON_COMPILING_IN_CPYTHON && (__PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT) if ( #if PY_MAJOR_VERSION < 3 && __PYX_DEFAULT_STRING_ENCODING_IS_ASCII __Pyx_sys_getdefaultencoding_not_ascii && #endif PyUnicode_Check(o)) { #if PY_VERSION_HEX < 0x03030000 char* defenc_c; PyObject* defenc = _PyUnicode_AsDefaultEncodedString(o, NULL); if (!defenc) return NULL; defenc_c = PyBytes_AS_STRING(defenc); #if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII { char* end = defenc_c + PyBytes_GET_SIZE(defenc); char* c; for (c = defenc_c; c < end; c++) { if ((unsigned char) (*c) >= 128) { PyUnicode_AsASCIIString(o); return NULL; } } } #endif *length = PyBytes_GET_SIZE(defenc); return defenc_c; #else if (__Pyx_PyUnicode_READY(o) == -1) return NULL; #if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII if (PyUnicode_IS_ASCII(o)) { *length = PyUnicode_GET_LENGTH(o); return PyUnicode_AsUTF8(o); } else { PyUnicode_AsASCIIString(o); return NULL; } #else return PyUnicode_AsUTF8AndSize(o, length); #endif #endif } else #endif #if (!CYTHON_COMPILING_IN_PYPY) || (defined(PyByteArray_AS_STRING) && defined(PyByteArray_GET_SIZE)) if (PyByteArray_Check(o)) { *length = PyByteArray_GET_SIZE(o); return PyByteArray_AS_STRING(o); } else #endif { char* result; int r = PyBytes_AsStringAndSize(o, &result, length); if (unlikely(r < 0)) { return NULL; } else { return result; } } } static CYTHON_INLINE int __Pyx_PyObject_IsTrue(PyObject* x) { int is_true = x == Py_True; if (is_true | (x == Py_False) | (x == Py_None)) return is_true; else return PyObject_IsTrue(x); } static CYTHON_INLINE PyObject* __Pyx_PyNumber_Int(PyObject* x) { PyNumberMethods *m; const char *name = NULL; PyObject *res = NULL; #if PY_MAJOR_VERSION < 3 if (PyInt_Check(x) || PyLong_Check(x)) #else if (PyLong_Check(x)) #endif return __Pyx_NewRef(x); m = Py_TYPE(x)->tp_as_number; #if PY_MAJOR_VERSION < 3 if (m && m->nb_int) { name = "int"; res = PyNumber_Int(x); } else if (m && m->nb_long) { name = "long"; res = PyNumber_Long(x); } #else if (m && m->nb_int) { name = "int"; res = PyNumber_Long(x); } #endif if (res) { #if PY_MAJOR_VERSION < 3 if (!PyInt_Check(res) && !PyLong_Check(res)) { #else if (!PyLong_Check(res)) { #endif PyErr_Format(PyExc_TypeError, "__%.4s__ returned non-%.4s (type %.200s)", name, name, Py_TYPE(res)->tp_name); Py_DECREF(res); return NULL; } } else if (!PyErr_Occurred()) { PyErr_SetString(PyExc_TypeError, "an integer is required"); } return res; } static CYTHON_INLINE Py_ssize_t __Pyx_PyIndex_AsSsize_t(PyObject* b) { Py_ssize_t ival; PyObject *x; #if PY_MAJOR_VERSION < 3 if (likely(PyInt_CheckExact(b))) { if (sizeof(Py_ssize_t) >= sizeof(long)) return PyInt_AS_LONG(b); else return PyInt_AsSsize_t(x); } #endif if (likely(PyLong_CheckExact(b))) { #if CYTHON_USE_PYLONG_INTERNALS const digit* digits = ((PyLongObject*)b)->ob_digit; const Py_ssize_t size = Py_SIZE(b); if (likely(__Pyx_sst_abs(size) <= 1)) { ival = likely(size) ? digits[0] : 0; if (size == -1) ival = -ival; return ival; } else { switch (size) { case 2: if (8 * sizeof(Py_ssize_t) > 2 * PyLong_SHIFT) { return (Py_ssize_t) (((((size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])); } break; case -2: if (8 * sizeof(Py_ssize_t) > 2 * PyLong_SHIFT) { return -(Py_ssize_t) (((((size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])); } break; case 3: if (8 * sizeof(Py_ssize_t) > 3 * PyLong_SHIFT) { return (Py_ssize_t) (((((((size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])); } break; case -3: if (8 * sizeof(Py_ssize_t) > 3 * PyLong_SHIFT) { return -(Py_ssize_t) (((((((size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])); } break; case 4: if (8 * sizeof(Py_ssize_t) > 4 * PyLong_SHIFT) { return (Py_ssize_t) (((((((((size_t)digits[3]) << PyLong_SHIFT) | (size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])); } break; case -4: if (8 * sizeof(Py_ssize_t) > 4 * PyLong_SHIFT) { return -(Py_ssize_t) (((((((((size_t)digits[3]) << PyLong_SHIFT) | (size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])); } break; } } #endif return PyLong_AsSsize_t(b); } x = PyNumber_Index(b); if (!x) return -1; ival = PyInt_AsSsize_t(x); Py_DECREF(x); return ival; } static CYTHON_INLINE PyObject * __Pyx_PyInt_FromSize_t(size_t ival) { return PyInt_FromSize_t(ival); } #endif /* Py_PYTHON_H */ pygame_sdl2-2.1.0-for-renpy-6.99.14.1/gen3/pygame_sdl2.image.c0000664000175000017500000060652612673650750022567 0ustar tomtom00000000000000/* Generated by Cython 0.23.3 */ #define PY_SSIZE_T_CLEAN #include "Python.h" #ifndef Py_PYTHON_H #error Python headers needed to compile C extensions, please install development version of Python. #elif PY_VERSION_HEX < 0x02060000 || (0x03000000 <= PY_VERSION_HEX && PY_VERSION_HEX < 0x03020000) #error Cython requires Python 2.6+ or Python 3.2+. #else #define CYTHON_ABI "0_23_3" #include #ifndef offsetof #define offsetof(type, member) ( (size_t) & ((type*)0) -> member ) #endif #if !defined(WIN32) && !defined(MS_WINDOWS) #ifndef __stdcall #define __stdcall #endif #ifndef __cdecl #define __cdecl #endif #ifndef __fastcall #define __fastcall #endif #endif #ifndef DL_IMPORT #define DL_IMPORT(t) t #endif #ifndef DL_EXPORT #define DL_EXPORT(t) t #endif #ifndef PY_LONG_LONG #define PY_LONG_LONG LONG_LONG #endif #ifndef Py_HUGE_VAL #define Py_HUGE_VAL HUGE_VAL #endif #ifdef PYPY_VERSION #define CYTHON_COMPILING_IN_PYPY 1 #define CYTHON_COMPILING_IN_CPYTHON 0 #else #define CYTHON_COMPILING_IN_PYPY 0 #define CYTHON_COMPILING_IN_CPYTHON 1 #endif #if !defined(CYTHON_USE_PYLONG_INTERNALS) && CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x02070000 #define CYTHON_USE_PYLONG_INTERNALS 1 #endif #if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX < 0x02070600 && !defined(Py_OptimizeFlag) #define Py_OptimizeFlag 0 #endif #define __PYX_BUILD_PY_SSIZE_T "n" #define CYTHON_FORMAT_SSIZE_T "z" #if PY_MAJOR_VERSION < 3 #define __Pyx_BUILTIN_MODULE_NAME "__builtin__" #define __Pyx_PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)\ PyCode_New(a+k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos) #define __Pyx_DefaultClassType PyClass_Type #else #define __Pyx_BUILTIN_MODULE_NAME "builtins" #define __Pyx_PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)\ PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos) #define __Pyx_DefaultClassType PyType_Type #endif #ifndef Py_TPFLAGS_CHECKTYPES #define Py_TPFLAGS_CHECKTYPES 0 #endif #ifndef Py_TPFLAGS_HAVE_INDEX #define Py_TPFLAGS_HAVE_INDEX 0 #endif #ifndef Py_TPFLAGS_HAVE_NEWBUFFER #define Py_TPFLAGS_HAVE_NEWBUFFER 0 #endif #ifndef Py_TPFLAGS_HAVE_FINALIZE #define Py_TPFLAGS_HAVE_FINALIZE 0 #endif #if PY_VERSION_HEX > 0x03030000 && defined(PyUnicode_KIND) #define CYTHON_PEP393_ENABLED 1 #define __Pyx_PyUnicode_READY(op) (likely(PyUnicode_IS_READY(op)) ?\ 0 : _PyUnicode_Ready((PyObject *)(op))) #define __Pyx_PyUnicode_GET_LENGTH(u) PyUnicode_GET_LENGTH(u) #define __Pyx_PyUnicode_READ_CHAR(u, i) PyUnicode_READ_CHAR(u, i) #define __Pyx_PyUnicode_KIND(u) PyUnicode_KIND(u) #define __Pyx_PyUnicode_DATA(u) PyUnicode_DATA(u) #define __Pyx_PyUnicode_READ(k, d, i) PyUnicode_READ(k, d, i) #else #define CYTHON_PEP393_ENABLED 0 #define __Pyx_PyUnicode_READY(op) (0) #define __Pyx_PyUnicode_GET_LENGTH(u) PyUnicode_GET_SIZE(u) #define __Pyx_PyUnicode_READ_CHAR(u, i) ((Py_UCS4)(PyUnicode_AS_UNICODE(u)[i])) #define __Pyx_PyUnicode_KIND(u) (sizeof(Py_UNICODE)) #define __Pyx_PyUnicode_DATA(u) ((void*)PyUnicode_AS_UNICODE(u)) #define __Pyx_PyUnicode_READ(k, d, i) ((void)(k), (Py_UCS4)(((Py_UNICODE*)d)[i])) #endif #if CYTHON_COMPILING_IN_PYPY #define __Pyx_PyUnicode_Concat(a, b) PyNumber_Add(a, b) #define __Pyx_PyUnicode_ConcatSafe(a, b) PyNumber_Add(a, b) #else #define __Pyx_PyUnicode_Concat(a, b) PyUnicode_Concat(a, b) #define __Pyx_PyUnicode_ConcatSafe(a, b) ((unlikely((a) == Py_None) || unlikely((b) == Py_None)) ?\ PyNumber_Add(a, b) : __Pyx_PyUnicode_Concat(a, b)) #endif #if CYTHON_COMPILING_IN_PYPY && !defined(PyUnicode_Contains) #define PyUnicode_Contains(u, s) PySequence_Contains(u, s) #endif #define __Pyx_PyString_FormatSafe(a, b) ((unlikely((a) == Py_None)) ? PyNumber_Remainder(a, b) : __Pyx_PyString_Format(a, b)) #define __Pyx_PyUnicode_FormatSafe(a, b) ((unlikely((a) == Py_None)) ? PyNumber_Remainder(a, b) : PyUnicode_Format(a, b)) #if PY_MAJOR_VERSION >= 3 #define __Pyx_PyString_Format(a, b) PyUnicode_Format(a, b) #else #define __Pyx_PyString_Format(a, b) PyString_Format(a, b) #endif #if PY_MAJOR_VERSION >= 3 #define PyBaseString_Type PyUnicode_Type #define PyStringObject PyUnicodeObject #define PyString_Type PyUnicode_Type #define PyString_Check PyUnicode_Check #define PyString_CheckExact PyUnicode_CheckExact #endif #if PY_MAJOR_VERSION >= 3 #define __Pyx_PyBaseString_Check(obj) PyUnicode_Check(obj) #define __Pyx_PyBaseString_CheckExact(obj) PyUnicode_CheckExact(obj) #else #define __Pyx_PyBaseString_Check(obj) (PyString_Check(obj) || PyUnicode_Check(obj)) #define __Pyx_PyBaseString_CheckExact(obj) (PyString_CheckExact(obj) || PyUnicode_CheckExact(obj)) #endif #ifndef PySet_CheckExact #define PySet_CheckExact(obj) (Py_TYPE(obj) == &PySet_Type) #endif #define __Pyx_TypeCheck(obj, type) PyObject_TypeCheck(obj, (PyTypeObject *)type) #if PY_MAJOR_VERSION >= 3 #define PyIntObject PyLongObject #define PyInt_Type PyLong_Type #define PyInt_Check(op) PyLong_Check(op) #define PyInt_CheckExact(op) PyLong_CheckExact(op) #define PyInt_FromString PyLong_FromString #define PyInt_FromUnicode PyLong_FromUnicode #define PyInt_FromLong PyLong_FromLong #define PyInt_FromSize_t PyLong_FromSize_t #define PyInt_FromSsize_t PyLong_FromSsize_t #define PyInt_AsLong PyLong_AsLong #define PyInt_AS_LONG PyLong_AS_LONG #define PyInt_AsSsize_t PyLong_AsSsize_t #define PyInt_AsUnsignedLongMask PyLong_AsUnsignedLongMask #define PyInt_AsUnsignedLongLongMask PyLong_AsUnsignedLongLongMask #define PyNumber_Int PyNumber_Long #endif #if PY_MAJOR_VERSION >= 3 #define PyBoolObject PyLongObject #endif #if PY_MAJOR_VERSION >= 3 && CYTHON_COMPILING_IN_PYPY #ifndef PyUnicode_InternFromString #define PyUnicode_InternFromString(s) PyUnicode_FromString(s) #endif #endif #if PY_VERSION_HEX < 0x030200A4 typedef long Py_hash_t; #define __Pyx_PyInt_FromHash_t PyInt_FromLong #define __Pyx_PyInt_AsHash_t PyInt_AsLong #else #define __Pyx_PyInt_FromHash_t PyInt_FromSsize_t #define __Pyx_PyInt_AsHash_t PyInt_AsSsize_t #endif #if PY_MAJOR_VERSION >= 3 #define __Pyx_PyMethod_New(func, self, klass) ((self) ? PyMethod_New(func, self) : PyInstanceMethod_New(func)) #else #define __Pyx_PyMethod_New(func, self, klass) PyMethod_New(func, self, klass) #endif #if PY_VERSION_HEX >= 0x030500B1 #define __Pyx_PyAsyncMethodsStruct PyAsyncMethods #define __Pyx_PyType_AsAsync(obj) (Py_TYPE(obj)->tp_as_async) #elif CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3 typedef struct { unaryfunc am_await; unaryfunc am_aiter; unaryfunc am_anext; } __Pyx_PyAsyncMethodsStruct; #define __Pyx_PyType_AsAsync(obj) ((__Pyx_PyAsyncMethodsStruct*) (Py_TYPE(obj)->tp_reserved)) #else #define __Pyx_PyType_AsAsync(obj) NULL #endif #ifndef CYTHON_RESTRICT #if defined(__GNUC__) #define CYTHON_RESTRICT __restrict__ #elif defined(_MSC_VER) && _MSC_VER >= 1400 #define CYTHON_RESTRICT __restrict #elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L #define CYTHON_RESTRICT restrict #else #define CYTHON_RESTRICT #endif #endif #define __Pyx_void_to_None(void_result) (void_result, Py_INCREF(Py_None), Py_None) #ifndef CYTHON_INLINE #if defined(__GNUC__) #define CYTHON_INLINE __inline__ #elif defined(_MSC_VER) #define CYTHON_INLINE __inline #elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L #define CYTHON_INLINE inline #else #define CYTHON_INLINE #endif #endif #if defined(WIN32) || defined(MS_WINDOWS) #define _USE_MATH_DEFINES #endif #include #ifdef NAN #define __PYX_NAN() ((float) NAN) #else static CYTHON_INLINE float __PYX_NAN() { float value; memset(&value, 0xFF, sizeof(value)); return value; } #endif #if PY_MAJOR_VERSION >= 3 #define __Pyx_PyNumber_Divide(x,y) PyNumber_TrueDivide(x,y) #define __Pyx_PyNumber_InPlaceDivide(x,y) PyNumber_InPlaceTrueDivide(x,y) #else #define __Pyx_PyNumber_Divide(x,y) PyNumber_TrueDivide(x,y) #define __Pyx_PyNumber_InPlaceDivide(x,y) PyNumber_InPlaceTrueDivide(x,y) #endif #ifndef __PYX_EXTERN_C #ifdef __cplusplus #define __PYX_EXTERN_C extern "C" #else #define __PYX_EXTERN_C extern #endif #endif #define __PYX_HAVE__pygame_sdl2__image #define __PYX_HAVE_API__pygame_sdl2__image #include "stdint.h" #include "string.h" #include "stdio.h" #include "stddef.h" #include "SDL.h" #include "SDL_image.h" #include "write_jpeg.h" #include "write_png.h" #ifdef _OPENMP #include #endif /* _OPENMP */ #ifdef PYREX_WITHOUT_ASSERTIONS #define CYTHON_WITHOUT_ASSERTIONS #endif #ifndef CYTHON_UNUSED # if defined(__GNUC__) # if !(defined(__cplusplus)) || (__GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 4)) # define CYTHON_UNUSED __attribute__ ((__unused__)) # else # define CYTHON_UNUSED # endif # elif defined(__ICC) || (defined(__INTEL_COMPILER) && !defined(_MSC_VER)) # define CYTHON_UNUSED __attribute__ ((__unused__)) # else # define CYTHON_UNUSED # endif #endif #ifndef CYTHON_NCP_UNUSED # if CYTHON_COMPILING_IN_CPYTHON # define CYTHON_NCP_UNUSED # else # define CYTHON_NCP_UNUSED CYTHON_UNUSED # endif #endif typedef struct {PyObject **p; char *s; const Py_ssize_t n; const char* encoding; const char is_unicode; const char is_str; const char intern; } __Pyx_StringTabEntry; #define __PYX_DEFAULT_STRING_ENCODING_IS_ASCII 0 #define __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT 0 #define __PYX_DEFAULT_STRING_ENCODING "" #define __Pyx_PyObject_FromString __Pyx_PyBytes_FromString #define __Pyx_PyObject_FromStringAndSize __Pyx_PyBytes_FromStringAndSize #define __Pyx_uchar_cast(c) ((unsigned char)c) #define __Pyx_long_cast(x) ((long)x) #define __Pyx_fits_Py_ssize_t(v, type, is_signed) (\ (sizeof(type) < sizeof(Py_ssize_t)) ||\ (sizeof(type) > sizeof(Py_ssize_t) &&\ likely(v < (type)PY_SSIZE_T_MAX ||\ v == (type)PY_SSIZE_T_MAX) &&\ (!is_signed || likely(v > (type)PY_SSIZE_T_MIN ||\ v == (type)PY_SSIZE_T_MIN))) ||\ (sizeof(type) == sizeof(Py_ssize_t) &&\ (is_signed || likely(v < (type)PY_SSIZE_T_MAX ||\ v == (type)PY_SSIZE_T_MAX))) ) #if defined (__cplusplus) && __cplusplus >= 201103L #include #define __Pyx_sst_abs(value) std::abs(value) #elif SIZEOF_INT >= SIZEOF_SIZE_T #define __Pyx_sst_abs(value) abs(value) #elif SIZEOF_LONG >= SIZEOF_SIZE_T #define __Pyx_sst_abs(value) labs(value) #elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L #define __Pyx_sst_abs(value) llabs(value) #elif defined (_MSC_VER) && defined (_M_X64) #define __Pyx_sst_abs(value) _abs64(value) #elif defined (__GNUC__) #define __Pyx_sst_abs(value) __builtin_llabs(value) #else #define __Pyx_sst_abs(value) ((value<0) ? -value : value) #endif static CYTHON_INLINE char* __Pyx_PyObject_AsString(PyObject*); static CYTHON_INLINE char* __Pyx_PyObject_AsStringAndSize(PyObject*, Py_ssize_t* length); #define __Pyx_PyByteArray_FromString(s) PyByteArray_FromStringAndSize((const char*)s, strlen((const char*)s)) #define __Pyx_PyByteArray_FromStringAndSize(s, l) PyByteArray_FromStringAndSize((const char*)s, l) #define __Pyx_PyBytes_FromString PyBytes_FromString #define __Pyx_PyBytes_FromStringAndSize PyBytes_FromStringAndSize static CYTHON_INLINE PyObject* __Pyx_PyUnicode_FromString(const char*); #if PY_MAJOR_VERSION < 3 #define __Pyx_PyStr_FromString __Pyx_PyBytes_FromString #define __Pyx_PyStr_FromStringAndSize __Pyx_PyBytes_FromStringAndSize #else #define __Pyx_PyStr_FromString __Pyx_PyUnicode_FromString #define __Pyx_PyStr_FromStringAndSize __Pyx_PyUnicode_FromStringAndSize #endif #define __Pyx_PyObject_AsSString(s) ((signed char*) __Pyx_PyObject_AsString(s)) #define __Pyx_PyObject_AsUString(s) ((unsigned char*) __Pyx_PyObject_AsString(s)) #define __Pyx_PyObject_FromCString(s) __Pyx_PyObject_FromString((const char*)s) #define __Pyx_PyBytes_FromCString(s) __Pyx_PyBytes_FromString((const char*)s) #define __Pyx_PyByteArray_FromCString(s) __Pyx_PyByteArray_FromString((const char*)s) #define __Pyx_PyStr_FromCString(s) __Pyx_PyStr_FromString((const char*)s) #define __Pyx_PyUnicode_FromCString(s) __Pyx_PyUnicode_FromString((const char*)s) #if PY_MAJOR_VERSION < 3 static CYTHON_INLINE size_t __Pyx_Py_UNICODE_strlen(const Py_UNICODE *u) { const Py_UNICODE *u_end = u; while (*u_end++) ; return (size_t)(u_end - u - 1); } #else #define __Pyx_Py_UNICODE_strlen Py_UNICODE_strlen #endif #define __Pyx_PyUnicode_FromUnicode(u) PyUnicode_FromUnicode(u, __Pyx_Py_UNICODE_strlen(u)) #define __Pyx_PyUnicode_FromUnicodeAndLength PyUnicode_FromUnicode #define __Pyx_PyUnicode_AsUnicode PyUnicode_AsUnicode #define __Pyx_NewRef(obj) (Py_INCREF(obj), obj) #define __Pyx_Owned_Py_None(b) __Pyx_NewRef(Py_None) #define __Pyx_PyBool_FromLong(b) ((b) ? __Pyx_NewRef(Py_True) : __Pyx_NewRef(Py_False)) static CYTHON_INLINE int __Pyx_PyObject_IsTrue(PyObject*); static CYTHON_INLINE PyObject* __Pyx_PyNumber_Int(PyObject* x); static CYTHON_INLINE Py_ssize_t __Pyx_PyIndex_AsSsize_t(PyObject*); static CYTHON_INLINE PyObject * __Pyx_PyInt_FromSize_t(size_t); #if CYTHON_COMPILING_IN_CPYTHON #define __pyx_PyFloat_AsDouble(x) (PyFloat_CheckExact(x) ? PyFloat_AS_DOUBLE(x) : PyFloat_AsDouble(x)) #else #define __pyx_PyFloat_AsDouble(x) PyFloat_AsDouble(x) #endif #define __pyx_PyFloat_AsFloat(x) ((float) __pyx_PyFloat_AsDouble(x)) #if PY_MAJOR_VERSION < 3 && __PYX_DEFAULT_STRING_ENCODING_IS_ASCII static int __Pyx_sys_getdefaultencoding_not_ascii; static int __Pyx_init_sys_getdefaultencoding_params(void) { PyObject* sys; PyObject* default_encoding = NULL; PyObject* ascii_chars_u = NULL; PyObject* ascii_chars_b = NULL; const char* default_encoding_c; sys = PyImport_ImportModule("sys"); if (!sys) goto bad; default_encoding = PyObject_CallMethod(sys, (char*) "getdefaultencoding", NULL); Py_DECREF(sys); if (!default_encoding) goto bad; default_encoding_c = PyBytes_AsString(default_encoding); if (!default_encoding_c) goto bad; if (strcmp(default_encoding_c, "ascii") == 0) { __Pyx_sys_getdefaultencoding_not_ascii = 0; } else { char ascii_chars[128]; int c; for (c = 0; c < 128; c++) { ascii_chars[c] = c; } __Pyx_sys_getdefaultencoding_not_ascii = 1; ascii_chars_u = PyUnicode_DecodeASCII(ascii_chars, 128, NULL); if (!ascii_chars_u) goto bad; ascii_chars_b = PyUnicode_AsEncodedString(ascii_chars_u, default_encoding_c, NULL); if (!ascii_chars_b || !PyBytes_Check(ascii_chars_b) || memcmp(ascii_chars, PyBytes_AS_STRING(ascii_chars_b), 128) != 0) { PyErr_Format( PyExc_ValueError, "This module compiled with c_string_encoding=ascii, but default encoding '%.200s' is not a superset of ascii.", default_encoding_c); goto bad; } Py_DECREF(ascii_chars_u); Py_DECREF(ascii_chars_b); } Py_DECREF(default_encoding); return 0; bad: Py_XDECREF(default_encoding); Py_XDECREF(ascii_chars_u); Py_XDECREF(ascii_chars_b); return -1; } #endif #if __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT && PY_MAJOR_VERSION >= 3 #define __Pyx_PyUnicode_FromStringAndSize(c_str, size) PyUnicode_DecodeUTF8(c_str, size, NULL) #else #define __Pyx_PyUnicode_FromStringAndSize(c_str, size) PyUnicode_Decode(c_str, size, __PYX_DEFAULT_STRING_ENCODING, NULL) #if __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT static char* __PYX_DEFAULT_STRING_ENCODING; static int __Pyx_init_sys_getdefaultencoding_params(void) { PyObject* sys; PyObject* default_encoding = NULL; char* default_encoding_c; sys = PyImport_ImportModule("sys"); if (!sys) goto bad; default_encoding = PyObject_CallMethod(sys, (char*) (const char*) "getdefaultencoding", NULL); Py_DECREF(sys); if (!default_encoding) goto bad; default_encoding_c = PyBytes_AsString(default_encoding); if (!default_encoding_c) goto bad; __PYX_DEFAULT_STRING_ENCODING = (char*) malloc(strlen(default_encoding_c)); if (!__PYX_DEFAULT_STRING_ENCODING) goto bad; strcpy(__PYX_DEFAULT_STRING_ENCODING, default_encoding_c); Py_DECREF(default_encoding); return 0; bad: Py_XDECREF(default_encoding); return -1; } #endif #endif /* Test for GCC > 2.95 */ #if defined(__GNUC__) && (__GNUC__ > 2 || (__GNUC__ == 2 && (__GNUC_MINOR__ > 95))) #define likely(x) __builtin_expect(!!(x), 1) #define unlikely(x) __builtin_expect(!!(x), 0) #else /* !__GNUC__ or GCC < 2.95 */ #define likely(x) (x) #define unlikely(x) (x) #endif /* __GNUC__ */ static PyObject *__pyx_m; static PyObject *__pyx_d; static PyObject *__pyx_b; static PyObject *__pyx_empty_tuple; static PyObject *__pyx_empty_bytes; static int __pyx_lineno; static int __pyx_clineno = 0; static const char * __pyx_cfilenm= __FILE__; static const char *__pyx_filename; static const char *__pyx_f[] = { "src/pygame_sdl2/image.pyx", "src/pygame_sdl2/surface.pxd", }; /*--- Type declarations ---*/ struct __pyx_obj_11pygame_sdl2_7surface_Surface; struct __pyx_opt_args_11pygame_sdl2_8rwobject_to_rwops; /* "pygame_sdl2/rwobject.pxd":21 * from sdl2 cimport SDL_RWops * * cdef SDL_RWops *to_rwops(filelike, mode=*) except NULL # <<<<<<<<<<<<<< * */ struct __pyx_opt_args_11pygame_sdl2_8rwobject_to_rwops { int __pyx_n; PyObject *mode; }; /* "pygame_sdl2/surface.pxd":23 * from sdl2 cimport SDL_Surface * * cdef class Surface: # <<<<<<<<<<<<<< * # Allow weak references. * cdef object __weakref__ */ struct __pyx_obj_11pygame_sdl2_7surface_Surface { PyObject_HEAD struct __pyx_vtabstruct_11pygame_sdl2_7surface_Surface *__pyx_vtab; PyObject *__weakref__; SDL_Surface *surface; int owns_surface; int window_surface; PyObject *locklist; struct __pyx_obj_11pygame_sdl2_7surface_Surface *parent; struct __pyx_obj_11pygame_sdl2_7surface_Surface *root; int offset_x; int offset_y; PyObject *get_window_flags; int has_alpha; }; struct __pyx_vtabstruct_11pygame_sdl2_7surface_Surface { void (*take_surface)(struct __pyx_obj_11pygame_sdl2_7surface_Surface *, SDL_Surface *); }; static struct __pyx_vtabstruct_11pygame_sdl2_7surface_Surface *__pyx_vtabptr_11pygame_sdl2_7surface_Surface; /* --- Runtime support code (head) --- */ #ifndef CYTHON_REFNANNY #define CYTHON_REFNANNY 0 #endif #if CYTHON_REFNANNY typedef struct { void (*INCREF)(void*, PyObject*, int); void (*DECREF)(void*, PyObject*, int); void (*GOTREF)(void*, PyObject*, int); void (*GIVEREF)(void*, PyObject*, int); void* (*SetupContext)(const char*, int, const char*); void (*FinishContext)(void**); } __Pyx_RefNannyAPIStruct; static __Pyx_RefNannyAPIStruct *__Pyx_RefNanny = NULL; static __Pyx_RefNannyAPIStruct *__Pyx_RefNannyImportAPI(const char *modname); #define __Pyx_RefNannyDeclarations void *__pyx_refnanny = NULL; #ifdef WITH_THREAD #define __Pyx_RefNannySetupContext(name, acquire_gil)\ if (acquire_gil) {\ PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure();\ __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), __LINE__, __FILE__);\ PyGILState_Release(__pyx_gilstate_save);\ } else {\ __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), __LINE__, __FILE__);\ } #else #define __Pyx_RefNannySetupContext(name, acquire_gil)\ __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), __LINE__, __FILE__) #endif #define __Pyx_RefNannyFinishContext()\ __Pyx_RefNanny->FinishContext(&__pyx_refnanny) #define __Pyx_INCREF(r) __Pyx_RefNanny->INCREF(__pyx_refnanny, (PyObject *)(r), __LINE__) #define __Pyx_DECREF(r) __Pyx_RefNanny->DECREF(__pyx_refnanny, (PyObject *)(r), __LINE__) #define __Pyx_GOTREF(r) __Pyx_RefNanny->GOTREF(__pyx_refnanny, (PyObject *)(r), __LINE__) #define __Pyx_GIVEREF(r) __Pyx_RefNanny->GIVEREF(__pyx_refnanny, (PyObject *)(r), __LINE__) #define __Pyx_XINCREF(r) do { if((r) != NULL) {__Pyx_INCREF(r); }} while(0) #define __Pyx_XDECREF(r) do { if((r) != NULL) {__Pyx_DECREF(r); }} while(0) #define __Pyx_XGOTREF(r) do { if((r) != NULL) {__Pyx_GOTREF(r); }} while(0) #define __Pyx_XGIVEREF(r) do { if((r) != NULL) {__Pyx_GIVEREF(r);}} while(0) #else #define __Pyx_RefNannyDeclarations #define __Pyx_RefNannySetupContext(name, acquire_gil) #define __Pyx_RefNannyFinishContext() #define __Pyx_INCREF(r) Py_INCREF(r) #define __Pyx_DECREF(r) Py_DECREF(r) #define __Pyx_GOTREF(r) #define __Pyx_GIVEREF(r) #define __Pyx_XINCREF(r) Py_XINCREF(r) #define __Pyx_XDECREF(r) Py_XDECREF(r) #define __Pyx_XGOTREF(r) #define __Pyx_XGIVEREF(r) #endif #define __Pyx_XDECREF_SET(r, v) do {\ PyObject *tmp = (PyObject *) r;\ r = v; __Pyx_XDECREF(tmp);\ } while (0) #define __Pyx_DECREF_SET(r, v) do {\ PyObject *tmp = (PyObject *) r;\ r = v; __Pyx_DECREF(tmp);\ } while (0) #define __Pyx_CLEAR(r) do { PyObject* tmp = ((PyObject*)(r)); r = NULL; __Pyx_DECREF(tmp);} while(0) #define __Pyx_XCLEAR(r) do { if((r) != NULL) {PyObject* tmp = ((PyObject*)(r)); r = NULL; __Pyx_DECREF(tmp);}} while(0) #if CYTHON_COMPILING_IN_CPYTHON static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStr(PyObject* obj, PyObject* attr_name) { PyTypeObject* tp = Py_TYPE(obj); if (likely(tp->tp_getattro)) return tp->tp_getattro(obj, attr_name); #if PY_MAJOR_VERSION < 3 if (likely(tp->tp_getattr)) return tp->tp_getattr(obj, PyString_AS_STRING(attr_name)); #endif return PyObject_GetAttr(obj, attr_name); } #else #define __Pyx_PyObject_GetAttrStr(o,n) PyObject_GetAttr(o,n) #endif static PyObject *__Pyx_GetBuiltinName(PyObject *name); static CYTHON_INLINE PyObject *__Pyx_GetModuleGlobalName(PyObject *name); #if CYTHON_COMPILING_IN_CPYTHON static CYTHON_INLINE PyObject* __Pyx_PyObject_Call(PyObject *func, PyObject *arg, PyObject *kw); #else #define __Pyx_PyObject_Call(func, arg, kw) PyObject_Call(func, arg, kw) #endif #if CYTHON_COMPILING_IN_CPYTHON static CYTHON_INLINE PyObject* __Pyx_PyObject_CallMethO(PyObject *func, PyObject *arg); #endif static CYTHON_INLINE PyObject* __Pyx_PyObject_CallOneArg(PyObject *func, PyObject *arg); #if CYTHON_COMPILING_IN_CPYTHON static CYTHON_INLINE PyObject* __Pyx_PyObject_CallNoArg(PyObject *func); #else #define __Pyx_PyObject_CallNoArg(func) __Pyx_PyObject_Call(func, __pyx_empty_tuple, NULL) #endif static CYTHON_INLINE void __Pyx_ErrRestore(PyObject *type, PyObject *value, PyObject *tb); static CYTHON_INLINE void __Pyx_ErrFetch(PyObject **type, PyObject **value, PyObject **tb); static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, PyObject *cause); #define __Pyx_GetItemInt(o, i, type, is_signed, to_py_func, is_list, wraparound, boundscheck)\ (__Pyx_fits_Py_ssize_t(i, type, is_signed) ?\ __Pyx_GetItemInt_Fast(o, (Py_ssize_t)i, is_list, wraparound, boundscheck) :\ (is_list ? (PyErr_SetString(PyExc_IndexError, "list index out of range"), (PyObject*)NULL) :\ __Pyx_GetItemInt_Generic(o, to_py_func(i)))) #define __Pyx_GetItemInt_List(o, i, type, is_signed, to_py_func, is_list, wraparound, boundscheck)\ (__Pyx_fits_Py_ssize_t(i, type, is_signed) ?\ __Pyx_GetItemInt_List_Fast(o, (Py_ssize_t)i, wraparound, boundscheck) :\ (PyErr_SetString(PyExc_IndexError, "list index out of range"), (PyObject*)NULL)) static CYTHON_INLINE PyObject *__Pyx_GetItemInt_List_Fast(PyObject *o, Py_ssize_t i, int wraparound, int boundscheck); #define __Pyx_GetItemInt_Tuple(o, i, type, is_signed, to_py_func, is_list, wraparound, boundscheck)\ (__Pyx_fits_Py_ssize_t(i, type, is_signed) ?\ __Pyx_GetItemInt_Tuple_Fast(o, (Py_ssize_t)i, wraparound, boundscheck) :\ (PyErr_SetString(PyExc_IndexError, "tuple index out of range"), (PyObject*)NULL)) static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Tuple_Fast(PyObject *o, Py_ssize_t i, int wraparound, int boundscheck); static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Generic(PyObject *o, PyObject* j); static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Fast(PyObject *o, Py_ssize_t i, int is_list, int wraparound, int boundscheck); #include static CYTHON_INLINE int __Pyx_PyBytes_Equals(PyObject* s1, PyObject* s2, int equals); static CYTHON_INLINE PyObject* __Pyx_PyObject_GetSlice( PyObject* obj, Py_ssize_t cstart, Py_ssize_t cstop, PyObject** py_start, PyObject** py_stop, PyObject** py_slice, int has_cstart, int has_cstop, int wraparound); static void __Pyx_RaiseDoubleKeywordsError(const char* func_name, PyObject* kw_name); static int __Pyx_ParseOptionalKeywords(PyObject *kwds, PyObject **argnames[],\ PyObject *kwds2, PyObject *values[], Py_ssize_t num_pos_args,\ const char* function_name); static void __Pyx_RaiseArgtupleInvalid(const char* func_name, int exact, Py_ssize_t num_min, Py_ssize_t num_max, Py_ssize_t num_found); static CYTHON_INLINE int __Pyx_PyUnicode_Equals(PyObject* s1, PyObject* s2, int equals); static CYTHON_INLINE void __Pyx_ExceptionSave(PyObject **type, PyObject **value, PyObject **tb); static void __Pyx_ExceptionReset(PyObject *type, PyObject *value, PyObject *tb); static int __Pyx_GetException(PyObject **type, PyObject **value, PyObject **tb); static CYTHON_INLINE int __Pyx_ArgTypeTest(PyObject *obj, PyTypeObject *type, int none_allowed, const char *name, int exact); static void* __Pyx_GetVtable(PyObject *dict); static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list, int level); static PyObject* __Pyx_ImportFrom(PyObject* module, PyObject* name); typedef struct { int code_line; PyCodeObject* code_object; } __Pyx_CodeObjectCacheEntry; struct __Pyx_CodeObjectCache { int count; int max_count; __Pyx_CodeObjectCacheEntry* entries; }; static struct __Pyx_CodeObjectCache __pyx_code_cache = {0,0,NULL}; static int __pyx_bisect_code_objects(__Pyx_CodeObjectCacheEntry* entries, int count, int code_line); static PyCodeObject *__pyx_find_code_object(int code_line); static void __pyx_insert_code_object(int code_line, PyCodeObject* code_object); static void __Pyx_AddTraceback(const char *funcname, int c_line, int py_line, const char *filename); static CYTHON_INLINE PyObject* __Pyx_PyInt_From_long(long value); #ifndef __PYX_FORCE_INIT_THREADS #define __PYX_FORCE_INIT_THREADS 0 #endif static CYTHON_INLINE int __Pyx_PyInt_As_int(PyObject *); static CYTHON_INLINE long __Pyx_PyInt_As_long(PyObject *); static int __Pyx_check_binary_version(void); #if !defined(__Pyx_PyIdentifier_FromString) #if PY_MAJOR_VERSION < 3 #define __Pyx_PyIdentifier_FromString(s) PyString_FromString(s) #else #define __Pyx_PyIdentifier_FromString(s) PyUnicode_FromString(s) #endif #endif static PyObject *__Pyx_ImportModule(const char *name); static PyTypeObject *__Pyx_ImportType(const char *module_name, const char *class_name, size_t size, int strict); static int __Pyx_ImportFunction(PyObject *module, const char *funcname, void (**f)(void), const char *sig); static int __Pyx_InitStrings(__Pyx_StringTabEntry *t); /* Module declarations from 'libc.stdint' */ /* Module declarations from 'libc.string' */ /* Module declarations from 'libc.stdio' */ /* Module declarations from 'libc.stddef' */ /* Module declarations from 'sdl2' */ /* Module declarations from 'sdl2_image' */ /* Module declarations from 'pygame_sdl2.surface' */ static PyTypeObject *__pyx_ptype_11pygame_sdl2_7surface_Surface = 0; /* Module declarations from 'pygame_sdl2.rwobject' */ static SDL_RWops *(*__pyx_f_11pygame_sdl2_8rwobject_to_rwops)(PyObject *, struct __pyx_opt_args_11pygame_sdl2_8rwobject_to_rwops *__pyx_optional_args); /*proto*/ /* Module declarations from 'pygame_sdl2.image' */ static int __pyx_v_11pygame_sdl2_5image_image_formats; static PyObject *__pyx_f_11pygame_sdl2_5image_process_namehint(PyObject *); /*proto*/ #define __Pyx_MODULE_NAME "pygame_sdl2.image" int __pyx_module_is_main_pygame_sdl2__image = 0; /* Implementation of 'pygame_sdl2.image' */ static PyObject *__pyx_builtin_ValueError; static char __pyx_k_n[] = "n"; static char __pyx_k__2[] = ""; static char __pyx_k__3[] = "."; static char __pyx_k_fi[] = "fi"; static char __pyx_k_fn[] = "fn"; static char __pyx_k_os[] = "os"; static char __pyx_k_wb[] = "wb"; static char __pyx_k_BMP[] = ".BMP"; static char __pyx_k_JPG[] = ".JPG"; static char __pyx_k_PNG[] = ".PNG"; static char __pyx_k_TGA[] = "TGA"; static char __pyx_k_err[] = "err"; static char __pyx_k_ext[] = "ext"; static char __pyx_k_img[] = "img"; static char __pyx_k_tga[] = ".tga"; static char __pyx_k_JPEG[] = ".JPEG"; static char __pyx_k_init[] = "init"; static char __pyx_k_load[] = "load"; static char __pyx_k_main[] = "__main__"; static char __pyx_k_path[] = "path"; static char __pyx_k_quit[] = "quit"; static char __pyx_k_save[] = "save"; static char __pyx_k_surf[] = "surf"; static char __pyx_k_test[] = "__test__"; static char __pyx_k_ascii[] = "ascii"; static char __pyx_k_bytes[] = "bytes_"; static char __pyx_k_error[] = "error"; static char __pyx_k_ftype[] = "ftype"; static char __pyx_k_lower[] = "lower"; static char __pyx_k_rwops[] = "rwops"; static char __pyx_k_upper[] = "upper"; static char __pyx_k_encode[] = "encode"; static char __pyx_k_import[] = "__import__"; static char __pyx_k_convert[] = "convert"; static char __pyx_k_replace[] = "replace"; static char __pyx_k_surface[] = "surface"; static char __pyx_k_unicode[] = "unicode_"; static char __pyx_k_endswith[] = "endswith"; static char __pyx_k_filename[] = "filename"; static char __pyx_k_namehint[] = "namehint"; static char __pyx_k_splitext[] = "splitext"; static char __pyx_k_has_alpha[] = "has_alpha"; static char __pyx_k_ValueError[] = "ValueError"; static char __pyx_k_pyx_vtable[] = "__pyx_vtable__"; static char __pyx_k_compression[] = "compression"; static char __pyx_k_pygame_sdl2[] = "pygame_sdl2"; static char __pyx_k_get_extended[] = "get_extended"; static char __pyx_k_convert_alpha[] = "convert_alpha"; static char __pyx_k_compression_level[] = "compression_level"; static char __pyx_k_filesystem_encode[] = "filesystem_encode"; static char __pyx_k_pygame_sdl2_error[] = "pygame_sdl2.error"; static char __pyx_k_pygame_sdl2_image[] = "pygame_sdl2.image"; static char __pyx_k_pygame_sdl2_compat[] = "pygame_sdl2.compat"; static char __pyx_k_Unsupported_format_s[] = "Unsupported format: %s"; static char __pyx_k_home_tom_ab_pygame_sdl2_src_pyg[] = "/home/tom/ab/pygame_sdl2/src/pygame_sdl2/image.pyx"; static PyObject *__pyx_kp_b_BMP; static PyObject *__pyx_kp_b_JPEG; static PyObject *__pyx_kp_b_JPG; static PyObject *__pyx_kp_b_PNG; static PyObject *__pyx_n_u_TGA; static PyObject *__pyx_kp_u_Unsupported_format_s; static PyObject *__pyx_n_s_ValueError; static PyObject *__pyx_kp_b__2; static PyObject *__pyx_kp_u__2; static PyObject *__pyx_kp_b__3; static PyObject *__pyx_n_u_ascii; static PyObject *__pyx_n_s_bytes; static PyObject *__pyx_n_s_compression; static PyObject *__pyx_n_s_compression_level; static PyObject *__pyx_n_s_convert; static PyObject *__pyx_n_s_convert_alpha; static PyObject *__pyx_n_s_encode; static PyObject *__pyx_n_s_endswith; static PyObject *__pyx_n_s_err; static PyObject *__pyx_n_s_error; static PyObject *__pyx_n_s_ext; static PyObject *__pyx_n_s_fi; static PyObject *__pyx_n_s_filename; static PyObject *__pyx_n_s_filesystem_encode; static PyObject *__pyx_n_s_fn; static PyObject *__pyx_n_s_ftype; static PyObject *__pyx_n_s_get_extended; static PyObject *__pyx_n_s_has_alpha; static PyObject *__pyx_kp_s_home_tom_ab_pygame_sdl2_src_pyg; static PyObject *__pyx_n_s_img; static PyObject *__pyx_n_s_import; static PyObject *__pyx_n_s_init; static PyObject *__pyx_n_s_load; static PyObject *__pyx_n_s_lower; static PyObject *__pyx_n_s_main; static PyObject *__pyx_n_s_n; static PyObject *__pyx_n_s_namehint; static PyObject *__pyx_n_s_os; static PyObject *__pyx_n_s_path; static PyObject *__pyx_n_s_pygame_sdl2; static PyObject *__pyx_n_s_pygame_sdl2_compat; static PyObject *__pyx_n_s_pygame_sdl2_error; static PyObject *__pyx_n_s_pygame_sdl2_image; static PyObject *__pyx_n_s_pyx_vtable; static PyObject *__pyx_n_s_quit; static PyObject *__pyx_n_u_replace; static PyObject *__pyx_n_s_rwops; static PyObject *__pyx_n_s_save; static PyObject *__pyx_n_s_splitext; static PyObject *__pyx_n_s_surf; static PyObject *__pyx_n_s_surface; static PyObject *__pyx_n_s_test; static PyObject *__pyx_kp_u_tga; static PyObject *__pyx_n_s_unicode; static PyObject *__pyx_n_s_upper; static PyObject *__pyx_n_u_wb; static PyObject *__pyx_pf_11pygame_sdl2_5image_init(CYTHON_UNUSED PyObject *__pyx_self); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_5image_2quit(CYTHON_UNUSED PyObject *__pyx_self); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_5image_4load(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_fi, PyObject *__pyx_v_namehint); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_5image_6save(CYTHON_UNUSED PyObject *__pyx_self, struct __pyx_obj_11pygame_sdl2_7surface_Surface *__pyx_v_surface, PyObject *__pyx_v_filename, PyObject *__pyx_v_compression); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_5image_8get_extended(CYTHON_UNUSED PyObject *__pyx_self); /* proto */ static PyObject *__pyx_int_1; static PyObject *__pyx_int_neg_1; static PyObject *__pyx_tuple_; static PyObject *__pyx_slice__4; static PyObject *__pyx_tuple__5; static PyObject *__pyx_tuple__6; static PyObject *__pyx_tuple__9; static PyObject *__pyx_tuple__11; static PyObject *__pyx_codeobj__7; static PyObject *__pyx_codeobj__8; static PyObject *__pyx_codeobj__10; static PyObject *__pyx_codeobj__12; static PyObject *__pyx_codeobj__13; /* "pygame_sdl2/image.pyx":33 * cdef int image_formats = 0 * * def init(): # <<<<<<<<<<<<<< * global image_formats * image_formats = IMG_Init(IMG_INIT_JPG | IMG_INIT_PNG | IMG_INIT_TIF | IMG_INIT_WEBP) */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_5image_1init(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused); /*proto*/ static PyMethodDef __pyx_mdef_11pygame_sdl2_5image_1init = {"init", (PyCFunction)__pyx_pw_11pygame_sdl2_5image_1init, METH_NOARGS, 0}; static PyObject *__pyx_pw_11pygame_sdl2_5image_1init(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("init (wrapper)", 0); __pyx_r = __pyx_pf_11pygame_sdl2_5image_init(__pyx_self); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_5image_init(CYTHON_UNUSED PyObject *__pyx_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("init", 0); /* "pygame_sdl2/image.pyx":35 * def init(): * global image_formats * image_formats = IMG_Init(IMG_INIT_JPG | IMG_INIT_PNG | IMG_INIT_TIF | IMG_INIT_WEBP) # <<<<<<<<<<<<<< * if image_formats == 0: * raise error() */ __pyx_v_11pygame_sdl2_5image_image_formats = IMG_Init((((IMG_INIT_JPG | IMG_INIT_PNG) | IMG_INIT_TIF) | IMG_INIT_WEBP)); /* "pygame_sdl2/image.pyx":36 * global image_formats * image_formats = IMG_Init(IMG_INIT_JPG | IMG_INIT_PNG | IMG_INIT_TIF | IMG_INIT_WEBP) * if image_formats == 0: # <<<<<<<<<<<<<< * raise error() * */ __pyx_t_1 = ((__pyx_v_11pygame_sdl2_5image_image_formats == 0) != 0); if (__pyx_t_1) { /* "pygame_sdl2/image.pyx":37 * image_formats = IMG_Init(IMG_INIT_JPG | IMG_INIT_PNG | IMG_INIT_TIF | IMG_INIT_WEBP) * if image_formats == 0: * raise error() # <<<<<<<<<<<<<< * * init() */ __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_error); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 37; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = NULL; if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_3))) { __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3); if (likely(__pyx_t_4)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); __Pyx_INCREF(__pyx_t_4); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_3, function); } } if (__pyx_t_4) { __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 37; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; } else { __pyx_t_2 = __Pyx_PyObject_CallNoArg(__pyx_t_3); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 37; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_Raise(__pyx_t_2, 0, 0, 0); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; {__pyx_filename = __pyx_f[0]; __pyx_lineno = 37; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "pygame_sdl2/image.pyx":36 * global image_formats * image_formats = IMG_Init(IMG_INIT_JPG | IMG_INIT_PNG | IMG_INIT_TIF | IMG_INIT_WEBP) * if image_formats == 0: # <<<<<<<<<<<<<< * raise error() * */ } /* "pygame_sdl2/image.pyx":33 * cdef int image_formats = 0 * * def init(): # <<<<<<<<<<<<<< * global image_formats * image_formats = IMG_Init(IMG_INIT_JPG | IMG_INIT_PNG | IMG_INIT_TIF | IMG_INIT_WEBP) */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_AddTraceback("pygame_sdl2.image.init", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/image.pyx":41 * init() * * def quit(): # @ReservedAssignment # <<<<<<<<<<<<<< * IMG_Quit() * */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_5image_3quit(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused); /*proto*/ static PyMethodDef __pyx_mdef_11pygame_sdl2_5image_3quit = {"quit", (PyCFunction)__pyx_pw_11pygame_sdl2_5image_3quit, METH_NOARGS, 0}; static PyObject *__pyx_pw_11pygame_sdl2_5image_3quit(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("quit (wrapper)", 0); __pyx_r = __pyx_pf_11pygame_sdl2_5image_2quit(__pyx_self); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_5image_2quit(CYTHON_UNUSED PyObject *__pyx_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("quit", 0); /* "pygame_sdl2/image.pyx":42 * * def quit(): # @ReservedAssignment * IMG_Quit() # <<<<<<<<<<<<<< * * cdef process_namehint(namehint): */ IMG_Quit(); /* "pygame_sdl2/image.pyx":41 * init() * * def quit(): # @ReservedAssignment # <<<<<<<<<<<<<< * IMG_Quit() * */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/image.pyx":44 * IMG_Quit() * * cdef process_namehint(namehint): # <<<<<<<<<<<<<< * # Accepts "foo.png", ".png", or "png" * */ static PyObject *__pyx_f_11pygame_sdl2_5image_process_namehint(PyObject *__pyx_v_namehint) { PyObject *__pyx_v_ext = NULL; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_t_2; int __pyx_t_3; PyObject *__pyx_t_4 = NULL; PyObject *__pyx_t_5 = NULL; PyObject *__pyx_t_6 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("process_namehint", 0); __Pyx_INCREF(__pyx_v_namehint); /* "pygame_sdl2/image.pyx":47 * # Accepts "foo.png", ".png", or "png" * * if not isinstance(namehint, bytes_): # <<<<<<<<<<<<<< * namehint = namehint.encode("ascii", "replace") * */ __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_bytes); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 47; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = PyObject_IsInstance(__pyx_v_namehint, __pyx_t_1); if (unlikely(__pyx_t_2 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 47; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_3 = ((!(__pyx_t_2 != 0)) != 0); if (__pyx_t_3) { /* "pygame_sdl2/image.pyx":48 * * if not isinstance(namehint, bytes_): * namehint = namehint.encode("ascii", "replace") # <<<<<<<<<<<<<< * * if not namehint: */ __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_namehint, __pyx_n_s_encode); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 48; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_tuple_, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 48; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF_SET(__pyx_v_namehint, __pyx_t_4); __pyx_t_4 = 0; /* "pygame_sdl2/image.pyx":47 * # Accepts "foo.png", ".png", or "png" * * if not isinstance(namehint, bytes_): # <<<<<<<<<<<<<< * namehint = namehint.encode("ascii", "replace") * */ } /* "pygame_sdl2/image.pyx":50 * namehint = namehint.encode("ascii", "replace") * * if not namehint: # <<<<<<<<<<<<<< * return b'' * */ __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_v_namehint); if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 50; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_t_2 = ((!__pyx_t_3) != 0); if (__pyx_t_2) { /* "pygame_sdl2/image.pyx":51 * * if not namehint: * return b'' # <<<<<<<<<<<<<< * * ext = os.path.splitext(namehint)[1] */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(__pyx_kp_b__2); __pyx_r = __pyx_kp_b__2; goto __pyx_L0; /* "pygame_sdl2/image.pyx":50 * namehint = namehint.encode("ascii", "replace") * * if not namehint: # <<<<<<<<<<<<<< * return b'' * */ } /* "pygame_sdl2/image.pyx":53 * return b'' * * ext = os.path.splitext(namehint)[1] # <<<<<<<<<<<<<< * if not ext: * ext = namehint */ __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_os); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 53; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_path); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 53; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_splitext); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 53; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __pyx_t_5 = NULL; if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_1))) { __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_1); if (likely(__pyx_t_5)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1); __Pyx_INCREF(__pyx_t_5); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_1, function); } } if (!__pyx_t_5) { __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_t_1, __pyx_v_namehint); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 53; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); } else { __pyx_t_6 = PyTuple_New(1+1); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 53; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_6); __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_5); __pyx_t_5 = NULL; __Pyx_INCREF(__pyx_v_namehint); __Pyx_GIVEREF(__pyx_v_namehint); PyTuple_SET_ITEM(__pyx_t_6, 0+1, __pyx_v_namehint); __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_6, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 53; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_1 = __Pyx_GetItemInt(__pyx_t_4, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(__pyx_t_1 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 53; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_v_ext = __pyx_t_1; __pyx_t_1 = 0; /* "pygame_sdl2/image.pyx":54 * * ext = os.path.splitext(namehint)[1] * if not ext: # <<<<<<<<<<<<<< * ext = namehint * if ext[0] == b'.': */ __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_v_ext); if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 54; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_t_3 = ((!__pyx_t_2) != 0); if (__pyx_t_3) { /* "pygame_sdl2/image.pyx":55 * ext = os.path.splitext(namehint)[1] * if not ext: * ext = namehint # <<<<<<<<<<<<<< * if ext[0] == b'.': * ext = ext[1:] */ __Pyx_INCREF(__pyx_v_namehint); __Pyx_DECREF_SET(__pyx_v_ext, __pyx_v_namehint); /* "pygame_sdl2/image.pyx":54 * * ext = os.path.splitext(namehint)[1] * if not ext: # <<<<<<<<<<<<<< * ext = namehint * if ext[0] == b'.': */ } /* "pygame_sdl2/image.pyx":56 * if not ext: * ext = namehint * if ext[0] == b'.': # <<<<<<<<<<<<<< * ext = ext[1:] * */ __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_ext, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(__pyx_t_1 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 56; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; __Pyx_GOTREF(__pyx_t_1); __pyx_t_3 = (__Pyx_PyBytes_Equals(__pyx_t_1, __pyx_kp_b__3, Py_EQ)); if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 56; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (__pyx_t_3) { /* "pygame_sdl2/image.pyx":57 * ext = namehint * if ext[0] == b'.': * ext = ext[1:] # <<<<<<<<<<<<<< * * return ext.upper() */ __pyx_t_1 = __Pyx_PyObject_GetSlice(__pyx_v_ext, 1, 0, NULL, NULL, &__pyx_slice__4, 1, 0, 1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 57; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF_SET(__pyx_v_ext, __pyx_t_1); __pyx_t_1 = 0; /* "pygame_sdl2/image.pyx":56 * if not ext: * ext = namehint * if ext[0] == b'.': # <<<<<<<<<<<<<< * ext = ext[1:] * */ } /* "pygame_sdl2/image.pyx":59 * ext = ext[1:] * * return ext.upper() # <<<<<<<<<<<<<< * * def load(fi, namehint=""): */ __Pyx_XDECREF(__pyx_r); __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_ext, __pyx_n_s_upper); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 59; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); __pyx_t_6 = NULL; if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_4))) { __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_4); if (likely(__pyx_t_6)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4); __Pyx_INCREF(__pyx_t_6); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_4, function); } } if (__pyx_t_6) { __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_6); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 59; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; } else { __pyx_t_1 = __Pyx_PyObject_CallNoArg(__pyx_t_4); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 59; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "pygame_sdl2/image.pyx":44 * IMG_Quit() * * cdef process_namehint(namehint): # <<<<<<<<<<<<<< * # Accepts "foo.png", ".png", or "png" * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_5); __Pyx_XDECREF(__pyx_t_6); __Pyx_AddTraceback("pygame_sdl2.image.process_namehint", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XDECREF(__pyx_v_ext); __Pyx_XDECREF(__pyx_v_namehint); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/image.pyx":61 * return ext.upper() * * def load(fi, namehint=""): # <<<<<<<<<<<<<< * cdef SDL_Surface *img * */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_5image_5load(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static PyMethodDef __pyx_mdef_11pygame_sdl2_5image_5load = {"load", (PyCFunction)__pyx_pw_11pygame_sdl2_5image_5load, METH_VARARGS|METH_KEYWORDS, 0}; static PyObject *__pyx_pw_11pygame_sdl2_5image_5load(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_fi = 0; PyObject *__pyx_v_namehint = 0; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("load (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_fi,&__pyx_n_s_namehint,0}; PyObject* values[2] = {0,0}; values[1] = ((PyObject *)__pyx_kp_u__2); if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_fi)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; case 1: if (kw_args > 0) { PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_namehint); if (value) { values[1] = value; kw_args--; } } } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "load") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 61; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } } else { switch (PyTuple_GET_SIZE(__pyx_args)) { case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_fi = values[0]; __pyx_v_namehint = values[1]; } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("load", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 61; __pyx_clineno = __LINE__; goto __pyx_L3_error;} __pyx_L3_error:; __Pyx_AddTraceback("pygame_sdl2.image.load", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_11pygame_sdl2_5image_4load(__pyx_self, __pyx_v_fi, __pyx_v_namehint); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_5image_4load(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_fi, PyObject *__pyx_v_namehint) { SDL_Surface *__pyx_v_img; SDL_RWops *__pyx_v_rwops; char *__pyx_v_ftype; struct __pyx_obj_11pygame_sdl2_7surface_Surface *__pyx_v_surf = 0; int __pyx_v_n; int __pyx_v_has_alpha; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; int __pyx_t_2; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; PyObject *__pyx_t_5 = NULL; SDL_RWops *__pyx_t_6; char *__pyx_t_7; PyObject *__pyx_t_8 = NULL; PyObject *__pyx_t_9 = NULL; PyObject *__pyx_t_10 = NULL; int __pyx_t_11; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("load", 0); __Pyx_INCREF(__pyx_v_namehint); /* "pygame_sdl2/image.pyx":68 * * # IMG_Load_RW can't load TGA images. * if isinstance(fi, str): # <<<<<<<<<<<<<< * if fi.lower().endswith('.tga'): * namehint = "TGA" */ __pyx_t_1 = PyUnicode_Check(__pyx_v_fi); __pyx_t_2 = (__pyx_t_1 != 0); if (__pyx_t_2) { /* "pygame_sdl2/image.pyx":69 * # IMG_Load_RW can't load TGA images. * if isinstance(fi, str): * if fi.lower().endswith('.tga'): # <<<<<<<<<<<<<< * namehint = "TGA" * */ __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_fi, __pyx_n_s_lower); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 69; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); __pyx_t_5 = NULL; if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_4))) { __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4); if (likely(__pyx_t_5)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4); __Pyx_INCREF(__pyx_t_5); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_4, function); } } if (__pyx_t_5) { __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_5); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 69; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; } else { __pyx_t_3 = __Pyx_PyObject_CallNoArg(__pyx_t_4); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 69; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_endswith); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 69; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_tuple__5, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 69; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 69; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; if (__pyx_t_2) { /* "pygame_sdl2/image.pyx":70 * if isinstance(fi, str): * if fi.lower().endswith('.tga'): * namehint = "TGA" # <<<<<<<<<<<<<< * * rwops = to_rwops(fi) */ __Pyx_INCREF(__pyx_n_u_TGA); __Pyx_DECREF_SET(__pyx_v_namehint, __pyx_n_u_TGA); /* "pygame_sdl2/image.pyx":69 * # IMG_Load_RW can't load TGA images. * if isinstance(fi, str): * if fi.lower().endswith('.tga'): # <<<<<<<<<<<<<< * namehint = "TGA" * */ } /* "pygame_sdl2/image.pyx":68 * * # IMG_Load_RW can't load TGA images. * if isinstance(fi, str): # <<<<<<<<<<<<<< * if fi.lower().endswith('.tga'): * namehint = "TGA" */ } /* "pygame_sdl2/image.pyx":72 * namehint = "TGA" * * rwops = to_rwops(fi) # <<<<<<<<<<<<<< * * if namehint == "": */ __pyx_t_6 = __pyx_f_11pygame_sdl2_8rwobject_to_rwops(__pyx_v_fi, NULL); if (unlikely(__pyx_t_6 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 72; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_v_rwops = __pyx_t_6; /* "pygame_sdl2/image.pyx":74 * rwops = to_rwops(fi) * * if namehint == "": # <<<<<<<<<<<<<< * with nogil: * img = IMG_Load_RW(rwops, 1) */ __pyx_t_2 = (__Pyx_PyUnicode_Equals(__pyx_v_namehint, __pyx_kp_u__2, Py_EQ)); if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 74; __pyx_clineno = __LINE__; goto __pyx_L1_error;} if (__pyx_t_2) { /* "pygame_sdl2/image.pyx":75 * * if namehint == "": * with nogil: # <<<<<<<<<<<<<< * img = IMG_Load_RW(rwops, 1) * */ { #ifdef WITH_THREAD PyThreadState *_save; Py_UNBLOCK_THREADS #endif /*try:*/ { /* "pygame_sdl2/image.pyx":76 * if namehint == "": * with nogil: * img = IMG_Load_RW(rwops, 1) # <<<<<<<<<<<<<< * * else: */ __pyx_v_img = IMG_Load_RW(__pyx_v_rwops, 1); } /* "pygame_sdl2/image.pyx":75 * * if namehint == "": * with nogil: # <<<<<<<<<<<<<< * img = IMG_Load_RW(rwops, 1) * */ /*finally:*/ { /*normal exit:*/{ #ifdef WITH_THREAD Py_BLOCK_THREADS #endif goto __pyx_L8; } __pyx_L8:; } } /* "pygame_sdl2/image.pyx":74 * rwops = to_rwops(fi) * * if namehint == "": # <<<<<<<<<<<<<< * with nogil: * img = IMG_Load_RW(rwops, 1) */ goto __pyx_L5; } /* "pygame_sdl2/image.pyx":79 * * else: * namehint = process_namehint(namehint) # <<<<<<<<<<<<<< * ftype = namehint * */ /*else*/ { __pyx_t_3 = __pyx_f_11pygame_sdl2_5image_process_namehint(__pyx_v_namehint); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 79; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF_SET(__pyx_v_namehint, __pyx_t_3); __pyx_t_3 = 0; /* "pygame_sdl2/image.pyx":80 * else: * namehint = process_namehint(namehint) * ftype = namehint # <<<<<<<<<<<<<< * * with nogil: */ __pyx_t_7 = __Pyx_PyObject_AsString(__pyx_v_namehint); if (unlikely((!__pyx_t_7) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 80; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_v_ftype = __pyx_t_7; /* "pygame_sdl2/image.pyx":82 * ftype = namehint * * with nogil: # <<<<<<<<<<<<<< * img = IMG_LoadTyped_RW(rwops, 1, ftype) * */ { #ifdef WITH_THREAD PyThreadState *_save; Py_UNBLOCK_THREADS #endif /*try:*/ { /* "pygame_sdl2/image.pyx":83 * * with nogil: * img = IMG_LoadTyped_RW(rwops, 1, ftype) # <<<<<<<<<<<<<< * * if img == NULL: */ __pyx_v_img = IMG_LoadTyped_RW(__pyx_v_rwops, 1, __pyx_v_ftype); } /* "pygame_sdl2/image.pyx":82 * ftype = namehint * * with nogil: # <<<<<<<<<<<<<< * img = IMG_LoadTyped_RW(rwops, 1, ftype) * */ /*finally:*/ { /*normal exit:*/{ #ifdef WITH_THREAD Py_BLOCK_THREADS #endif goto __pyx_L11; } __pyx_L11:; } } } __pyx_L5:; /* "pygame_sdl2/image.pyx":85 * img = IMG_LoadTyped_RW(rwops, 1, ftype) * * if img == NULL: # <<<<<<<<<<<<<< * raise error() * */ __pyx_t_2 = ((__pyx_v_img == NULL) != 0); if (__pyx_t_2) { /* "pygame_sdl2/image.pyx":86 * * if img == NULL: * raise error() # <<<<<<<<<<<<<< * * cdef Surface surf = Surface(()) */ __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_error); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 86; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); __pyx_t_5 = NULL; if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_4))) { __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4); if (likely(__pyx_t_5)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4); __Pyx_INCREF(__pyx_t_5); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_4, function); } } if (__pyx_t_5) { __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_5); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 86; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; } else { __pyx_t_3 = __Pyx_PyObject_CallNoArg(__pyx_t_4); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 86; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_Raise(__pyx_t_3, 0, 0, 0); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; {__pyx_filename = __pyx_f[0]; __pyx_lineno = 86; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "pygame_sdl2/image.pyx":85 * img = IMG_LoadTyped_RW(rwops, 1, ftype) * * if img == NULL: # <<<<<<<<<<<<<< * raise error() * */ } /* "pygame_sdl2/image.pyx":88 * raise error() * * cdef Surface surf = Surface(()) # <<<<<<<<<<<<<< * surf.take_surface(img) * */ __pyx_t_3 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_11pygame_sdl2_7surface_Surface), __pyx_tuple__6, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 88; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __pyx_v_surf = ((struct __pyx_obj_11pygame_sdl2_7surface_Surface *)__pyx_t_3); __pyx_t_3 = 0; /* "pygame_sdl2/image.pyx":89 * * cdef Surface surf = Surface(()) * surf.take_surface(img) # <<<<<<<<<<<<<< * * if img.format.BitsPerPixel == 32: */ ((struct __pyx_vtabstruct_11pygame_sdl2_7surface_Surface *)__pyx_v_surf->__pyx_vtab)->take_surface(__pyx_v_surf, __pyx_v_img); /* "pygame_sdl2/image.pyx":91 * surf.take_surface(img) * * if img.format.BitsPerPixel == 32: # <<<<<<<<<<<<<< * return surf * */ __pyx_t_2 = ((__pyx_v_img->format->BitsPerPixel == 32) != 0); if (__pyx_t_2) { /* "pygame_sdl2/image.pyx":92 * * if img.format.BitsPerPixel == 32: * return surf # <<<<<<<<<<<<<< * * cdef int n = 0 */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(((PyObject *)__pyx_v_surf)); __pyx_r = ((PyObject *)__pyx_v_surf); goto __pyx_L0; /* "pygame_sdl2/image.pyx":91 * surf.take_surface(img) * * if img.format.BitsPerPixel == 32: # <<<<<<<<<<<<<< * return surf * */ } /* "pygame_sdl2/image.pyx":94 * return surf * * cdef int n = 0 # <<<<<<<<<<<<<< * has_alpha = False * */ __pyx_v_n = 0; /* "pygame_sdl2/image.pyx":95 * * cdef int n = 0 * has_alpha = False # <<<<<<<<<<<<<< * * if img.format.Amask: */ __pyx_v_has_alpha = 0; /* "pygame_sdl2/image.pyx":97 * has_alpha = False * * if img.format.Amask: # <<<<<<<<<<<<<< * has_alpha = True * elif (img.format.format >> 24) & SDL_PIXELTYPE_INDEX1: */ __pyx_t_2 = (__pyx_v_img->format->Amask != 0); if (__pyx_t_2) { /* "pygame_sdl2/image.pyx":98 * * if img.format.Amask: * has_alpha = True # <<<<<<<<<<<<<< * elif (img.format.format >> 24) & SDL_PIXELTYPE_INDEX1: * has_alpha = True */ __pyx_v_has_alpha = 1; /* "pygame_sdl2/image.pyx":97 * has_alpha = False * * if img.format.Amask: # <<<<<<<<<<<<<< * has_alpha = True * elif (img.format.format >> 24) & SDL_PIXELTYPE_INDEX1: */ goto __pyx_L14; } /* "pygame_sdl2/image.pyx":99 * if img.format.Amask: * has_alpha = True * elif (img.format.format >> 24) & SDL_PIXELTYPE_INDEX1: # <<<<<<<<<<<<<< * has_alpha = True * elif img.format.palette != NULL: */ __pyx_t_2 = (((__pyx_v_img->format->format >> 24) & SDL_PIXELTYPE_INDEX1) != 0); if (__pyx_t_2) { /* "pygame_sdl2/image.pyx":100 * has_alpha = True * elif (img.format.format >> 24) & SDL_PIXELTYPE_INDEX1: * has_alpha = True # <<<<<<<<<<<<<< * elif img.format.palette != NULL: * # Check for non-opaque palette colors. */ __pyx_v_has_alpha = 1; /* "pygame_sdl2/image.pyx":99 * if img.format.Amask: * has_alpha = True * elif (img.format.format >> 24) & SDL_PIXELTYPE_INDEX1: # <<<<<<<<<<<<<< * has_alpha = True * elif img.format.palette != NULL: */ goto __pyx_L14; } /* "pygame_sdl2/image.pyx":101 * elif (img.format.format >> 24) & SDL_PIXELTYPE_INDEX1: * has_alpha = True * elif img.format.palette != NULL: # <<<<<<<<<<<<<< * # Check for non-opaque palette colors. * while n < img.format.palette.ncolors: */ __pyx_t_2 = ((__pyx_v_img->format->palette != NULL) != 0); if (__pyx_t_2) { /* "pygame_sdl2/image.pyx":103 * elif img.format.palette != NULL: * # Check for non-opaque palette colors. * while n < img.format.palette.ncolors: # <<<<<<<<<<<<<< * if img.format.palette.colors[n].a != 255: * has_alpha = True */ while (1) { __pyx_t_2 = ((__pyx_v_n < __pyx_v_img->format->palette->ncolors) != 0); if (!__pyx_t_2) break; /* "pygame_sdl2/image.pyx":104 * # Check for non-opaque palette colors. * while n < img.format.palette.ncolors: * if img.format.palette.colors[n].a != 255: # <<<<<<<<<<<<<< * has_alpha = True * break */ __pyx_t_2 = (((__pyx_v_img->format->palette->colors[__pyx_v_n]).a != 0xFF) != 0); if (__pyx_t_2) { /* "pygame_sdl2/image.pyx":105 * while n < img.format.palette.ncolors: * if img.format.palette.colors[n].a != 255: * has_alpha = True # <<<<<<<<<<<<<< * break * n += 1 */ __pyx_v_has_alpha = 1; /* "pygame_sdl2/image.pyx":106 * if img.format.palette.colors[n].a != 255: * has_alpha = True * break # <<<<<<<<<<<<<< * n += 1 * */ goto __pyx_L16_break; /* "pygame_sdl2/image.pyx":104 * # Check for non-opaque palette colors. * while n < img.format.palette.ncolors: * if img.format.palette.colors[n].a != 255: # <<<<<<<<<<<<<< * has_alpha = True * break */ } /* "pygame_sdl2/image.pyx":107 * has_alpha = True * break * n += 1 # <<<<<<<<<<<<<< * * try: */ __pyx_v_n = (__pyx_v_n + 1); } __pyx_L16_break:; /* "pygame_sdl2/image.pyx":101 * elif (img.format.format >> 24) & SDL_PIXELTYPE_INDEX1: * has_alpha = True * elif img.format.palette != NULL: # <<<<<<<<<<<<<< * # Check for non-opaque palette colors. * while n < img.format.palette.ncolors: */ } __pyx_L14:; /* "pygame_sdl2/image.pyx":109 * n += 1 * * try: # <<<<<<<<<<<<<< * if has_alpha: * return surf.convert_alpha() */ { __Pyx_ExceptionSave(&__pyx_t_8, &__pyx_t_9, &__pyx_t_10); __Pyx_XGOTREF(__pyx_t_8); __Pyx_XGOTREF(__pyx_t_9); __Pyx_XGOTREF(__pyx_t_10); /*try:*/ { /* "pygame_sdl2/image.pyx":110 * * try: * if has_alpha: # <<<<<<<<<<<<<< * return surf.convert_alpha() * else: */ __pyx_t_2 = (__pyx_v_has_alpha != 0); if (__pyx_t_2) { /* "pygame_sdl2/image.pyx":111 * try: * if has_alpha: * return surf.convert_alpha() # <<<<<<<<<<<<<< * else: * return surf.convert() */ __Pyx_XDECREF(__pyx_r); __pyx_t_4 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_surf), __pyx_n_s_convert_alpha); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 111; __pyx_clineno = __LINE__; goto __pyx_L18_error;} __Pyx_GOTREF(__pyx_t_4); __pyx_t_5 = NULL; if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_4))) { __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4); if (likely(__pyx_t_5)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4); __Pyx_INCREF(__pyx_t_5); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_4, function); } } if (__pyx_t_5) { __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_5); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 111; __pyx_clineno = __LINE__; goto __pyx_L18_error;} __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; } else { __pyx_t_3 = __Pyx_PyObject_CallNoArg(__pyx_t_4); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 111; __pyx_clineno = __LINE__; goto __pyx_L18_error;} } __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_r = __pyx_t_3; __pyx_t_3 = 0; goto __pyx_L22_try_return; /* "pygame_sdl2/image.pyx":110 * * try: * if has_alpha: # <<<<<<<<<<<<<< * return surf.convert_alpha() * else: */ } /* "pygame_sdl2/image.pyx":113 * return surf.convert_alpha() * else: * return surf.convert() # <<<<<<<<<<<<<< * except error: * return surf */ /*else*/ { __Pyx_XDECREF(__pyx_r); __pyx_t_4 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_surf), __pyx_n_s_convert); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 113; __pyx_clineno = __LINE__; goto __pyx_L18_error;} __Pyx_GOTREF(__pyx_t_4); __pyx_t_5 = NULL; if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_4))) { __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4); if (likely(__pyx_t_5)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4); __Pyx_INCREF(__pyx_t_5); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_4, function); } } if (__pyx_t_5) { __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_5); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 113; __pyx_clineno = __LINE__; goto __pyx_L18_error;} __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; } else { __pyx_t_3 = __Pyx_PyObject_CallNoArg(__pyx_t_4); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 113; __pyx_clineno = __LINE__; goto __pyx_L18_error;} } __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_r = __pyx_t_3; __pyx_t_3 = 0; goto __pyx_L22_try_return; } /* "pygame_sdl2/image.pyx":109 * n += 1 * * try: # <<<<<<<<<<<<<< * if has_alpha: * return surf.convert_alpha() */ } __pyx_L18_error:; __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; /* "pygame_sdl2/image.pyx":114 * else: * return surf.convert() * except error: # <<<<<<<<<<<<<< * return surf * */ __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_error); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 114; __pyx_clineno = __LINE__; goto __pyx_L20_except_error;} __Pyx_GOTREF(__pyx_t_3); __pyx_t_11 = PyErr_ExceptionMatches(__pyx_t_3); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; if (__pyx_t_11) { __Pyx_AddTraceback("pygame_sdl2.image.load", __pyx_clineno, __pyx_lineno, __pyx_filename); if (__Pyx_GetException(&__pyx_t_3, &__pyx_t_4, &__pyx_t_5) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 114; __pyx_clineno = __LINE__; goto __pyx_L20_except_error;} __Pyx_GOTREF(__pyx_t_3); __Pyx_GOTREF(__pyx_t_4); __Pyx_GOTREF(__pyx_t_5); /* "pygame_sdl2/image.pyx":115 * return surf.convert() * except error: * return surf # <<<<<<<<<<<<<< * * cdef extern from "write_jpeg.h": */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(((PyObject *)__pyx_v_surf)); __pyx_r = ((PyObject *)__pyx_v_surf); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; goto __pyx_L21_except_return; } goto __pyx_L20_except_error; __pyx_L20_except_error:; /* "pygame_sdl2/image.pyx":109 * n += 1 * * try: # <<<<<<<<<<<<<< * if has_alpha: * return surf.convert_alpha() */ __Pyx_XGIVEREF(__pyx_t_8); __Pyx_XGIVEREF(__pyx_t_9); __Pyx_XGIVEREF(__pyx_t_10); __Pyx_ExceptionReset(__pyx_t_8, __pyx_t_9, __pyx_t_10); goto __pyx_L1_error; __pyx_L22_try_return:; __Pyx_XGIVEREF(__pyx_t_8); __Pyx_XGIVEREF(__pyx_t_9); __Pyx_XGIVEREF(__pyx_t_10); __Pyx_ExceptionReset(__pyx_t_8, __pyx_t_9, __pyx_t_10); goto __pyx_L0; __pyx_L21_except_return:; __Pyx_XGIVEREF(__pyx_t_8); __Pyx_XGIVEREF(__pyx_t_9); __Pyx_XGIVEREF(__pyx_t_10); __Pyx_ExceptionReset(__pyx_t_8, __pyx_t_9, __pyx_t_10); goto __pyx_L0; } /* "pygame_sdl2/image.pyx":61 * return ext.upper() * * def load(fi, namehint=""): # <<<<<<<<<<<<<< * cdef SDL_Surface *img * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_5); __Pyx_AddTraceback("pygame_sdl2.image.load", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF((PyObject *)__pyx_v_surf); __Pyx_XDECREF(__pyx_v_namehint); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/image.pyx":123 * int Pygame_SDL2_SavePNG(const char *, SDL_Surface *, int) nogil * * def save(Surface surface not None, filename, compression=-1): # <<<<<<<<<<<<<< * * if isinstance(filename, unicode_): */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_5image_7save(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static PyMethodDef __pyx_mdef_11pygame_sdl2_5image_7save = {"save", (PyCFunction)__pyx_pw_11pygame_sdl2_5image_7save, METH_VARARGS|METH_KEYWORDS, 0}; static PyObject *__pyx_pw_11pygame_sdl2_5image_7save(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { struct __pyx_obj_11pygame_sdl2_7surface_Surface *__pyx_v_surface = 0; PyObject *__pyx_v_filename = 0; PyObject *__pyx_v_compression = 0; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("save (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_surface,&__pyx_n_s_filename,&__pyx_n_s_compression,0}; PyObject* values[3] = {0,0,0}; values[2] = ((PyObject *)__pyx_int_neg_1); if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_surface)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; case 1: if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_filename)) != 0)) kw_args--; else { __Pyx_RaiseArgtupleInvalid("save", 0, 2, 3, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 123; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } case 2: if (kw_args > 0) { PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_compression); if (value) { values[2] = value; kw_args--; } } } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "save") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 123; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } } else { switch (PyTuple_GET_SIZE(__pyx_args)) { case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); values[0] = PyTuple_GET_ITEM(__pyx_args, 0); break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_surface = ((struct __pyx_obj_11pygame_sdl2_7surface_Surface *)values[0]); __pyx_v_filename = values[1]; __pyx_v_compression = values[2]; } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("save", 0, 2, 3, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 123; __pyx_clineno = __LINE__; goto __pyx_L3_error;} __pyx_L3_error:; __Pyx_AddTraceback("pygame_sdl2.image.save", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_surface), __pyx_ptype_11pygame_sdl2_7surface_Surface, 0, "surface", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 123; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_r = __pyx_pf_11pygame_sdl2_5image_6save(__pyx_self, __pyx_v_surface, __pyx_v_filename, __pyx_v_compression); /* function exit code */ goto __pyx_L0; __pyx_L1_error:; __pyx_r = NULL; __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_5image_6save(CYTHON_UNUSED PyObject *__pyx_self, struct __pyx_obj_11pygame_sdl2_7surface_Surface *__pyx_v_surface, PyObject *__pyx_v_filename, PyObject *__pyx_v_compression) { PyObject *__pyx_v_ext = NULL; long __pyx_v_err; char *__pyx_v_fn; SDL_RWops *__pyx_v_rwops; int __pyx_v_compression_level; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_t_2; int __pyx_t_3; PyObject *__pyx_t_4 = NULL; PyObject *__pyx_t_5 = NULL; PyObject *__pyx_t_6 = NULL; char *__pyx_t_7; int __pyx_t_8; SDL_RWops *__pyx_t_9; struct __pyx_opt_args_11pygame_sdl2_8rwobject_to_rwops __pyx_t_10; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("save", 0); __Pyx_INCREF(__pyx_v_filename); /* "pygame_sdl2/image.pyx":125 * def save(Surface surface not None, filename, compression=-1): * * if isinstance(filename, unicode_): # <<<<<<<<<<<<<< * filename = filesystem_encode(filename) * */ __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_unicode); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 125; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = PyObject_IsInstance(__pyx_v_filename, __pyx_t_1); if (unlikely(__pyx_t_2 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 125; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_3 = (__pyx_t_2 != 0); if (__pyx_t_3) { /* "pygame_sdl2/image.pyx":126 * * if isinstance(filename, unicode_): * filename = filesystem_encode(filename) # <<<<<<<<<<<<<< * * ext = os.path.splitext(filename)[1] */ __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_filesystem_encode); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 126; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); __pyx_t_5 = NULL; if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_4))) { __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4); if (likely(__pyx_t_5)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4); __Pyx_INCREF(__pyx_t_5); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_4, function); } } if (!__pyx_t_5) { __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_v_filename); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 126; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); } else { __pyx_t_6 = PyTuple_New(1+1); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 126; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_6); __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_5); __pyx_t_5 = NULL; __Pyx_INCREF(__pyx_v_filename); __Pyx_GIVEREF(__pyx_v_filename); PyTuple_SET_ITEM(__pyx_t_6, 0+1, __pyx_v_filename); __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_6, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 126; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; } __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF_SET(__pyx_v_filename, __pyx_t_1); __pyx_t_1 = 0; /* "pygame_sdl2/image.pyx":125 * def save(Surface surface not None, filename, compression=-1): * * if isinstance(filename, unicode_): # <<<<<<<<<<<<<< * filename = filesystem_encode(filename) * */ } /* "pygame_sdl2/image.pyx":128 * filename = filesystem_encode(filename) * * ext = os.path.splitext(filename)[1] # <<<<<<<<<<<<<< * ext = ext.upper() * err = 0 */ __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_os); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 128; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_path); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 128; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_splitext); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 128; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __pyx_t_6 = NULL; if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_4))) { __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_4); if (likely(__pyx_t_6)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4); __Pyx_INCREF(__pyx_t_6); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_4, function); } } if (!__pyx_t_6) { __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_v_filename); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 128; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); } else { __pyx_t_5 = PyTuple_New(1+1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 128; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); __Pyx_GIVEREF(__pyx_t_6); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_6); __pyx_t_6 = NULL; __Pyx_INCREF(__pyx_v_filename); __Pyx_GIVEREF(__pyx_v_filename); PyTuple_SET_ITEM(__pyx_t_5, 0+1, __pyx_v_filename); __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_5, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 128; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; } __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_t_4 = __Pyx_GetItemInt(__pyx_t_1, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(__pyx_t_4 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 128; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_v_ext = __pyx_t_4; __pyx_t_4 = 0; /* "pygame_sdl2/image.pyx":129 * * ext = os.path.splitext(filename)[1] * ext = ext.upper() # <<<<<<<<<<<<<< * err = 0 * */ __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_ext, __pyx_n_s_upper); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 129; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_t_5 = NULL; if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_1))) { __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_1); if (likely(__pyx_t_5)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1); __Pyx_INCREF(__pyx_t_5); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_1, function); } } if (__pyx_t_5) { __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_t_1, __pyx_t_5); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 129; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; } else { __pyx_t_4 = __Pyx_PyObject_CallNoArg(__pyx_t_1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 129; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF_SET(__pyx_v_ext, __pyx_t_4); __pyx_t_4 = 0; /* "pygame_sdl2/image.pyx":130 * ext = os.path.splitext(filename)[1] * ext = ext.upper() * err = 0 # <<<<<<<<<<<<<< * * */ __pyx_v_err = 0; /* "pygame_sdl2/image.pyx":133 * * * cdef char *fn = filename # <<<<<<<<<<<<<< * cdef SDL_RWops *rwops * cdef int compression_level = compression */ __pyx_t_7 = __Pyx_PyObject_AsString(__pyx_v_filename); if (unlikely((!__pyx_t_7) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 133; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_v_fn = __pyx_t_7; /* "pygame_sdl2/image.pyx":135 * cdef char *fn = filename * cdef SDL_RWops *rwops * cdef int compression_level = compression # <<<<<<<<<<<<<< * * if ext == b'.PNG': */ __pyx_t_8 = __Pyx_PyInt_As_int(__pyx_v_compression); if (unlikely((__pyx_t_8 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 135; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_v_compression_level = __pyx_t_8; /* "pygame_sdl2/image.pyx":137 * cdef int compression_level = compression * * if ext == b'.PNG': # <<<<<<<<<<<<<< * with nogil: * err = Pygame_SDL2_SavePNG(fn, surface.surface, compression_level) */ __pyx_t_3 = (__Pyx_PyBytes_Equals(__pyx_v_ext, __pyx_kp_b_PNG, Py_EQ)); if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 137; __pyx_clineno = __LINE__; goto __pyx_L1_error;} if (__pyx_t_3) { /* "pygame_sdl2/image.pyx":138 * * if ext == b'.PNG': * with nogil: # <<<<<<<<<<<<<< * err = Pygame_SDL2_SavePNG(fn, surface.surface, compression_level) * elif ext == b'.BMP': */ { #ifdef WITH_THREAD PyThreadState *_save; Py_UNBLOCK_THREADS #endif /*try:*/ { /* "pygame_sdl2/image.pyx":139 * if ext == b'.PNG': * with nogil: * err = Pygame_SDL2_SavePNG(fn, surface.surface, compression_level) # <<<<<<<<<<<<<< * elif ext == b'.BMP': * rwops = to_rwops(filename, "wb") */ __pyx_v_err = Pygame_SDL2_SavePNG(__pyx_v_fn, __pyx_v_surface->surface, __pyx_v_compression_level); } /* "pygame_sdl2/image.pyx":138 * * if ext == b'.PNG': * with nogil: # <<<<<<<<<<<<<< * err = Pygame_SDL2_SavePNG(fn, surface.surface, compression_level) * elif ext == b'.BMP': */ /*finally:*/ { /*normal exit:*/{ #ifdef WITH_THREAD Py_BLOCK_THREADS #endif goto __pyx_L7; } __pyx_L7:; } } /* "pygame_sdl2/image.pyx":137 * cdef int compression_level = compression * * if ext == b'.PNG': # <<<<<<<<<<<<<< * with nogil: * err = Pygame_SDL2_SavePNG(fn, surface.surface, compression_level) */ goto __pyx_L4; } /* "pygame_sdl2/image.pyx":140 * with nogil: * err = Pygame_SDL2_SavePNG(fn, surface.surface, compression_level) * elif ext == b'.BMP': # <<<<<<<<<<<<<< * rwops = to_rwops(filename, "wb") * with nogil: */ __pyx_t_3 = (__Pyx_PyBytes_Equals(__pyx_v_ext, __pyx_kp_b_BMP, Py_EQ)); if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 140; __pyx_clineno = __LINE__; goto __pyx_L1_error;} if (__pyx_t_3) { /* "pygame_sdl2/image.pyx":141 * err = Pygame_SDL2_SavePNG(fn, surface.surface, compression_level) * elif ext == b'.BMP': * rwops = to_rwops(filename, "wb") # <<<<<<<<<<<<<< * with nogil: * err = SDL_SaveBMP_RW(surface.surface, rwops, 1) */ __pyx_t_10.__pyx_n = 1; __pyx_t_10.mode = __pyx_n_u_wb; __pyx_t_9 = __pyx_f_11pygame_sdl2_8rwobject_to_rwops(__pyx_v_filename, &__pyx_t_10); if (unlikely(__pyx_t_9 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 141; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_v_rwops = __pyx_t_9; /* "pygame_sdl2/image.pyx":142 * elif ext == b'.BMP': * rwops = to_rwops(filename, "wb") * with nogil: # <<<<<<<<<<<<<< * err = SDL_SaveBMP_RW(surface.surface, rwops, 1) * elif ext == b".JPG" or ext == b".JPEG": */ { #ifdef WITH_THREAD PyThreadState *_save; Py_UNBLOCK_THREADS #endif /*try:*/ { /* "pygame_sdl2/image.pyx":143 * rwops = to_rwops(filename, "wb") * with nogil: * err = SDL_SaveBMP_RW(surface.surface, rwops, 1) # <<<<<<<<<<<<<< * elif ext == b".JPG" or ext == b".JPEG": * with nogil: */ __pyx_v_err = SDL_SaveBMP_RW(__pyx_v_surface->surface, __pyx_v_rwops, 1); } /* "pygame_sdl2/image.pyx":142 * elif ext == b'.BMP': * rwops = to_rwops(filename, "wb") * with nogil: # <<<<<<<<<<<<<< * err = SDL_SaveBMP_RW(surface.surface, rwops, 1) * elif ext == b".JPG" or ext == b".JPEG": */ /*finally:*/ { /*normal exit:*/{ #ifdef WITH_THREAD Py_BLOCK_THREADS #endif goto __pyx_L10; } __pyx_L10:; } } /* "pygame_sdl2/image.pyx":140 * with nogil: * err = Pygame_SDL2_SavePNG(fn, surface.surface, compression_level) * elif ext == b'.BMP': # <<<<<<<<<<<<<< * rwops = to_rwops(filename, "wb") * with nogil: */ goto __pyx_L4; } /* "pygame_sdl2/image.pyx":144 * with nogil: * err = SDL_SaveBMP_RW(surface.surface, rwops, 1) * elif ext == b".JPG" or ext == b".JPEG": # <<<<<<<<<<<<<< * with nogil: * err = Pygame_SDL2_SaveJPEG(surface.surface, fn, compression_level) */ __pyx_t_2 = (__Pyx_PyBytes_Equals(__pyx_v_ext, __pyx_kp_b_JPG, Py_EQ)); if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 144; __pyx_clineno = __LINE__; goto __pyx_L1_error;} if (!__pyx_t_2) { } else { __pyx_t_3 = __pyx_t_2; goto __pyx_L11_bool_binop_done; } __pyx_t_2 = (__Pyx_PyBytes_Equals(__pyx_v_ext, __pyx_kp_b_JPEG, Py_EQ)); if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 144; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_t_3 = __pyx_t_2; __pyx_L11_bool_binop_done:; if (__pyx_t_3) { /* "pygame_sdl2/image.pyx":145 * err = SDL_SaveBMP_RW(surface.surface, rwops, 1) * elif ext == b".JPG" or ext == b".JPEG": * with nogil: # <<<<<<<<<<<<<< * err = Pygame_SDL2_SaveJPEG(surface.surface, fn, compression_level) * else: */ { #ifdef WITH_THREAD PyThreadState *_save; Py_UNBLOCK_THREADS #endif /*try:*/ { /* "pygame_sdl2/image.pyx":146 * elif ext == b".JPG" or ext == b".JPEG": * with nogil: * err = Pygame_SDL2_SaveJPEG(surface.surface, fn, compression_level) # <<<<<<<<<<<<<< * else: * raise ValueError("Unsupported format: %s" % ext) */ __pyx_v_err = Pygame_SDL2_SaveJPEG(__pyx_v_surface->surface, __pyx_v_fn, __pyx_v_compression_level); } /* "pygame_sdl2/image.pyx":145 * err = SDL_SaveBMP_RW(surface.surface, rwops, 1) * elif ext == b".JPG" or ext == b".JPEG": * with nogil: # <<<<<<<<<<<<<< * err = Pygame_SDL2_SaveJPEG(surface.surface, fn, compression_level) * else: */ /*finally:*/ { /*normal exit:*/{ #ifdef WITH_THREAD Py_BLOCK_THREADS #endif goto __pyx_L15; } __pyx_L15:; } } /* "pygame_sdl2/image.pyx":144 * with nogil: * err = SDL_SaveBMP_RW(surface.surface, rwops, 1) * elif ext == b".JPG" or ext == b".JPEG": # <<<<<<<<<<<<<< * with nogil: * err = Pygame_SDL2_SaveJPEG(surface.surface, fn, compression_level) */ goto __pyx_L4; } /* "pygame_sdl2/image.pyx":148 * err = Pygame_SDL2_SaveJPEG(surface.surface, fn, compression_level) * else: * raise ValueError("Unsupported format: %s" % ext) # <<<<<<<<<<<<<< * * if err != 0: */ /*else*/ { __pyx_t_4 = PyUnicode_Format(__pyx_kp_u_Unsupported_format_s, __pyx_v_ext); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 148; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 148; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_4); __pyx_t_4 = 0; __pyx_t_4 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_t_1, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 148; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_Raise(__pyx_t_4, 0, 0, 0); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; {__pyx_filename = __pyx_f[0]; __pyx_lineno = 148; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } __pyx_L4:; /* "pygame_sdl2/image.pyx":150 * raise ValueError("Unsupported format: %s" % ext) * * if err != 0: # <<<<<<<<<<<<<< * raise error() * */ __pyx_t_3 = ((__pyx_v_err != 0) != 0); if (__pyx_t_3) { /* "pygame_sdl2/image.pyx":151 * * if err != 0: * raise error() # <<<<<<<<<<<<<< * * def get_extended(): */ __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_error); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 151; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_t_5 = NULL; if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_1))) { __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_1); if (likely(__pyx_t_5)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1); __Pyx_INCREF(__pyx_t_5); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_1, function); } } if (__pyx_t_5) { __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_t_1, __pyx_t_5); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 151; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; } else { __pyx_t_4 = __Pyx_PyObject_CallNoArg(__pyx_t_1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 151; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_Raise(__pyx_t_4, 0, 0, 0); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; {__pyx_filename = __pyx_f[0]; __pyx_lineno = 151; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "pygame_sdl2/image.pyx":150 * raise ValueError("Unsupported format: %s" % ext) * * if err != 0: # <<<<<<<<<<<<<< * raise error() * */ } /* "pygame_sdl2/image.pyx":123 * int Pygame_SDL2_SavePNG(const char *, SDL_Surface *, int) nogil * * def save(Surface surface not None, filename, compression=-1): # <<<<<<<<<<<<<< * * if isinstance(filename, unicode_): */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_5); __Pyx_XDECREF(__pyx_t_6); __Pyx_AddTraceback("pygame_sdl2.image.save", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF(__pyx_v_ext); __Pyx_XDECREF(__pyx_v_filename); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/image.pyx":153 * raise error() * * def get_extended(): # <<<<<<<<<<<<<< * # This may be called before init. * return True */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_5image_9get_extended(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused); /*proto*/ static PyMethodDef __pyx_mdef_11pygame_sdl2_5image_9get_extended = {"get_extended", (PyCFunction)__pyx_pw_11pygame_sdl2_5image_9get_extended, METH_NOARGS, 0}; static PyObject *__pyx_pw_11pygame_sdl2_5image_9get_extended(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("get_extended (wrapper)", 0); __pyx_r = __pyx_pf_11pygame_sdl2_5image_8get_extended(__pyx_self); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_5image_8get_extended(CYTHON_UNUSED PyObject *__pyx_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("get_extended", 0); /* "pygame_sdl2/image.pyx":155 * def get_extended(): * # This may be called before init. * return True # <<<<<<<<<<<<<< */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(Py_True); __pyx_r = Py_True; goto __pyx_L0; /* "pygame_sdl2/image.pyx":153 * raise error() * * def get_extended(): # <<<<<<<<<<<<<< * # This may be called before init. * return True */ /* function exit code */ __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyMethodDef __pyx_methods[] = { {0, 0, 0, 0} }; #if PY_MAJOR_VERSION >= 3 static struct PyModuleDef __pyx_moduledef = { #if PY_VERSION_HEX < 0x03020000 { PyObject_HEAD_INIT(NULL) NULL, 0, NULL }, #else PyModuleDef_HEAD_INIT, #endif "image", 0, /* m_doc */ -1, /* m_size */ __pyx_methods /* m_methods */, NULL, /* m_reload */ NULL, /* m_traverse */ NULL, /* m_clear */ NULL /* m_free */ }; #endif static __Pyx_StringTabEntry __pyx_string_tab[] = { {&__pyx_kp_b_BMP, __pyx_k_BMP, sizeof(__pyx_k_BMP), 0, 0, 0, 0}, {&__pyx_kp_b_JPEG, __pyx_k_JPEG, sizeof(__pyx_k_JPEG), 0, 0, 0, 0}, {&__pyx_kp_b_JPG, __pyx_k_JPG, sizeof(__pyx_k_JPG), 0, 0, 0, 0}, {&__pyx_kp_b_PNG, __pyx_k_PNG, sizeof(__pyx_k_PNG), 0, 0, 0, 0}, {&__pyx_n_u_TGA, __pyx_k_TGA, sizeof(__pyx_k_TGA), 0, 1, 0, 1}, {&__pyx_kp_u_Unsupported_format_s, __pyx_k_Unsupported_format_s, sizeof(__pyx_k_Unsupported_format_s), 0, 1, 0, 0}, {&__pyx_n_s_ValueError, __pyx_k_ValueError, sizeof(__pyx_k_ValueError), 0, 0, 1, 1}, {&__pyx_kp_b__2, __pyx_k__2, sizeof(__pyx_k__2), 0, 0, 0, 0}, {&__pyx_kp_u__2, __pyx_k__2, sizeof(__pyx_k__2), 0, 1, 0, 0}, {&__pyx_kp_b__3, __pyx_k__3, sizeof(__pyx_k__3), 0, 0, 0, 0}, {&__pyx_n_u_ascii, __pyx_k_ascii, sizeof(__pyx_k_ascii), 0, 1, 0, 1}, {&__pyx_n_s_bytes, __pyx_k_bytes, sizeof(__pyx_k_bytes), 0, 0, 1, 1}, {&__pyx_n_s_compression, __pyx_k_compression, sizeof(__pyx_k_compression), 0, 0, 1, 1}, {&__pyx_n_s_compression_level, __pyx_k_compression_level, sizeof(__pyx_k_compression_level), 0, 0, 1, 1}, {&__pyx_n_s_convert, __pyx_k_convert, sizeof(__pyx_k_convert), 0, 0, 1, 1}, {&__pyx_n_s_convert_alpha, __pyx_k_convert_alpha, sizeof(__pyx_k_convert_alpha), 0, 0, 1, 1}, {&__pyx_n_s_encode, __pyx_k_encode, sizeof(__pyx_k_encode), 0, 0, 1, 1}, {&__pyx_n_s_endswith, __pyx_k_endswith, sizeof(__pyx_k_endswith), 0, 0, 1, 1}, {&__pyx_n_s_err, __pyx_k_err, sizeof(__pyx_k_err), 0, 0, 1, 1}, {&__pyx_n_s_error, __pyx_k_error, sizeof(__pyx_k_error), 0, 0, 1, 1}, {&__pyx_n_s_ext, __pyx_k_ext, sizeof(__pyx_k_ext), 0, 0, 1, 1}, {&__pyx_n_s_fi, __pyx_k_fi, sizeof(__pyx_k_fi), 0, 0, 1, 1}, {&__pyx_n_s_filename, __pyx_k_filename, sizeof(__pyx_k_filename), 0, 0, 1, 1}, {&__pyx_n_s_filesystem_encode, __pyx_k_filesystem_encode, sizeof(__pyx_k_filesystem_encode), 0, 0, 1, 1}, {&__pyx_n_s_fn, __pyx_k_fn, sizeof(__pyx_k_fn), 0, 0, 1, 1}, {&__pyx_n_s_ftype, __pyx_k_ftype, sizeof(__pyx_k_ftype), 0, 0, 1, 1}, {&__pyx_n_s_get_extended, __pyx_k_get_extended, sizeof(__pyx_k_get_extended), 0, 0, 1, 1}, {&__pyx_n_s_has_alpha, __pyx_k_has_alpha, sizeof(__pyx_k_has_alpha), 0, 0, 1, 1}, {&__pyx_kp_s_home_tom_ab_pygame_sdl2_src_pyg, __pyx_k_home_tom_ab_pygame_sdl2_src_pyg, sizeof(__pyx_k_home_tom_ab_pygame_sdl2_src_pyg), 0, 0, 1, 0}, {&__pyx_n_s_img, __pyx_k_img, sizeof(__pyx_k_img), 0, 0, 1, 1}, {&__pyx_n_s_import, __pyx_k_import, sizeof(__pyx_k_import), 0, 0, 1, 1}, {&__pyx_n_s_init, __pyx_k_init, sizeof(__pyx_k_init), 0, 0, 1, 1}, {&__pyx_n_s_load, __pyx_k_load, sizeof(__pyx_k_load), 0, 0, 1, 1}, {&__pyx_n_s_lower, __pyx_k_lower, sizeof(__pyx_k_lower), 0, 0, 1, 1}, {&__pyx_n_s_main, __pyx_k_main, sizeof(__pyx_k_main), 0, 0, 1, 1}, {&__pyx_n_s_n, __pyx_k_n, sizeof(__pyx_k_n), 0, 0, 1, 1}, {&__pyx_n_s_namehint, __pyx_k_namehint, sizeof(__pyx_k_namehint), 0, 0, 1, 1}, {&__pyx_n_s_os, __pyx_k_os, sizeof(__pyx_k_os), 0, 0, 1, 1}, {&__pyx_n_s_path, __pyx_k_path, sizeof(__pyx_k_path), 0, 0, 1, 1}, {&__pyx_n_s_pygame_sdl2, __pyx_k_pygame_sdl2, sizeof(__pyx_k_pygame_sdl2), 0, 0, 1, 1}, {&__pyx_n_s_pygame_sdl2_compat, __pyx_k_pygame_sdl2_compat, sizeof(__pyx_k_pygame_sdl2_compat), 0, 0, 1, 1}, {&__pyx_n_s_pygame_sdl2_error, __pyx_k_pygame_sdl2_error, sizeof(__pyx_k_pygame_sdl2_error), 0, 0, 1, 1}, {&__pyx_n_s_pygame_sdl2_image, __pyx_k_pygame_sdl2_image, sizeof(__pyx_k_pygame_sdl2_image), 0, 0, 1, 1}, {&__pyx_n_s_pyx_vtable, __pyx_k_pyx_vtable, sizeof(__pyx_k_pyx_vtable), 0, 0, 1, 1}, {&__pyx_n_s_quit, __pyx_k_quit, sizeof(__pyx_k_quit), 0, 0, 1, 1}, {&__pyx_n_u_replace, __pyx_k_replace, sizeof(__pyx_k_replace), 0, 1, 0, 1}, {&__pyx_n_s_rwops, __pyx_k_rwops, sizeof(__pyx_k_rwops), 0, 0, 1, 1}, {&__pyx_n_s_save, __pyx_k_save, sizeof(__pyx_k_save), 0, 0, 1, 1}, {&__pyx_n_s_splitext, __pyx_k_splitext, sizeof(__pyx_k_splitext), 0, 0, 1, 1}, {&__pyx_n_s_surf, __pyx_k_surf, sizeof(__pyx_k_surf), 0, 0, 1, 1}, {&__pyx_n_s_surface, __pyx_k_surface, sizeof(__pyx_k_surface), 0, 0, 1, 1}, {&__pyx_n_s_test, __pyx_k_test, sizeof(__pyx_k_test), 0, 0, 1, 1}, {&__pyx_kp_u_tga, __pyx_k_tga, sizeof(__pyx_k_tga), 0, 1, 0, 0}, {&__pyx_n_s_unicode, __pyx_k_unicode, sizeof(__pyx_k_unicode), 0, 0, 1, 1}, {&__pyx_n_s_upper, __pyx_k_upper, sizeof(__pyx_k_upper), 0, 0, 1, 1}, {&__pyx_n_u_wb, __pyx_k_wb, sizeof(__pyx_k_wb), 0, 1, 0, 1}, {0, 0, 0, 0, 0, 0, 0} }; static int __Pyx_InitCachedBuiltins(void) { __pyx_builtin_ValueError = __Pyx_GetBuiltinName(__pyx_n_s_ValueError); if (!__pyx_builtin_ValueError) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 148; __pyx_clineno = __LINE__; goto __pyx_L1_error;} return 0; __pyx_L1_error:; return -1; } static int __Pyx_InitCachedConstants(void) { __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__Pyx_InitCachedConstants", 0); /* "pygame_sdl2/image.pyx":48 * * if not isinstance(namehint, bytes_): * namehint = namehint.encode("ascii", "replace") # <<<<<<<<<<<<<< * * if not namehint: */ __pyx_tuple_ = PyTuple_Pack(2, __pyx_n_u_ascii, __pyx_n_u_replace); if (unlikely(!__pyx_tuple_)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 48; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_tuple_); __Pyx_GIVEREF(__pyx_tuple_); /* "pygame_sdl2/image.pyx":57 * ext = namehint * if ext[0] == b'.': * ext = ext[1:] # <<<<<<<<<<<<<< * * return ext.upper() */ __pyx_slice__4 = PySlice_New(__pyx_int_1, Py_None, Py_None); if (unlikely(!__pyx_slice__4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 57; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_slice__4); __Pyx_GIVEREF(__pyx_slice__4); /* "pygame_sdl2/image.pyx":69 * # IMG_Load_RW can't load TGA images. * if isinstance(fi, str): * if fi.lower().endswith('.tga'): # <<<<<<<<<<<<<< * namehint = "TGA" * */ __pyx_tuple__5 = PyTuple_Pack(1, __pyx_kp_u_tga); if (unlikely(!__pyx_tuple__5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 69; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_tuple__5); __Pyx_GIVEREF(__pyx_tuple__5); /* "pygame_sdl2/image.pyx":88 * raise error() * * cdef Surface surf = Surface(()) # <<<<<<<<<<<<<< * surf.take_surface(img) * */ __pyx_tuple__6 = PyTuple_Pack(1, __pyx_empty_tuple); if (unlikely(!__pyx_tuple__6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 88; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_tuple__6); __Pyx_GIVEREF(__pyx_tuple__6); /* "pygame_sdl2/image.pyx":33 * cdef int image_formats = 0 * * def init(): # <<<<<<<<<<<<<< * global image_formats * image_formats = IMG_Init(IMG_INIT_JPG | IMG_INIT_PNG | IMG_INIT_TIF | IMG_INIT_WEBP) */ __pyx_codeobj__7 = (PyObject*)__Pyx_PyCode_New(0, 0, 0, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_tom_ab_pygame_sdl2_src_pyg, __pyx_n_s_init, 33, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 33; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "pygame_sdl2/image.pyx":41 * init() * * def quit(): # @ReservedAssignment # <<<<<<<<<<<<<< * IMG_Quit() * */ __pyx_codeobj__8 = (PyObject*)__Pyx_PyCode_New(0, 0, 0, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_tom_ab_pygame_sdl2_src_pyg, __pyx_n_s_quit, 41, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 41; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "pygame_sdl2/image.pyx":61 * return ext.upper() * * def load(fi, namehint=""): # <<<<<<<<<<<<<< * cdef SDL_Surface *img * */ __pyx_tuple__9 = PyTuple_Pack(8, __pyx_n_s_fi, __pyx_n_s_namehint, __pyx_n_s_img, __pyx_n_s_rwops, __pyx_n_s_ftype, __pyx_n_s_surf, __pyx_n_s_n, __pyx_n_s_has_alpha); if (unlikely(!__pyx_tuple__9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 61; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_tuple__9); __Pyx_GIVEREF(__pyx_tuple__9); __pyx_codeobj__10 = (PyObject*)__Pyx_PyCode_New(2, 0, 8, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__9, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_tom_ab_pygame_sdl2_src_pyg, __pyx_n_s_load, 61, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 61; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "pygame_sdl2/image.pyx":123 * int Pygame_SDL2_SavePNG(const char *, SDL_Surface *, int) nogil * * def save(Surface surface not None, filename, compression=-1): # <<<<<<<<<<<<<< * * if isinstance(filename, unicode_): */ __pyx_tuple__11 = PyTuple_Pack(8, __pyx_n_s_surface, __pyx_n_s_filename, __pyx_n_s_compression, __pyx_n_s_ext, __pyx_n_s_err, __pyx_n_s_fn, __pyx_n_s_rwops, __pyx_n_s_compression_level); if (unlikely(!__pyx_tuple__11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 123; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_tuple__11); __Pyx_GIVEREF(__pyx_tuple__11); __pyx_codeobj__12 = (PyObject*)__Pyx_PyCode_New(3, 0, 8, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__11, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_tom_ab_pygame_sdl2_src_pyg, __pyx_n_s_save, 123, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__12)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 123; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "pygame_sdl2/image.pyx":153 * raise error() * * def get_extended(): # <<<<<<<<<<<<<< * # This may be called before init. * return True */ __pyx_codeobj__13 = (PyObject*)__Pyx_PyCode_New(0, 0, 0, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_tom_ab_pygame_sdl2_src_pyg, __pyx_n_s_get_extended, 153, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__13)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 153; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_RefNannyFinishContext(); return 0; __pyx_L1_error:; __Pyx_RefNannyFinishContext(); return -1; } static int __Pyx_InitGlobals(void) { if (__Pyx_InitStrings(__pyx_string_tab) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; __pyx_int_1 = PyInt_FromLong(1); if (unlikely(!__pyx_int_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_int_neg_1 = PyInt_FromLong(-1); if (unlikely(!__pyx_int_neg_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} return 0; __pyx_L1_error:; return -1; } #if PY_MAJOR_VERSION < 3 PyMODINIT_FUNC initimage(void); /*proto*/ PyMODINIT_FUNC initimage(void) #else PyMODINIT_FUNC PyInit_image(void); /*proto*/ PyMODINIT_FUNC PyInit_image(void) #endif { PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannyDeclarations #if CYTHON_REFNANNY __Pyx_RefNanny = __Pyx_RefNannyImportAPI("refnanny"); if (!__Pyx_RefNanny) { PyErr_Clear(); __Pyx_RefNanny = __Pyx_RefNannyImportAPI("Cython.Runtime.refnanny"); if (!__Pyx_RefNanny) Py_FatalError("failed to import 'refnanny' module"); } #endif __Pyx_RefNannySetupContext("PyMODINIT_FUNC PyInit_image(void)", 0); if (__Pyx_check_binary_version() < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_empty_tuple = PyTuple_New(0); if (unlikely(!__pyx_empty_tuple)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_empty_bytes = PyBytes_FromStringAndSize("", 0); if (unlikely(!__pyx_empty_bytes)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} #ifdef __Pyx_CyFunction_USED if (__pyx_CyFunction_init() < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} #endif #ifdef __Pyx_FusedFunction_USED if (__pyx_FusedFunction_init() < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} #endif #ifdef __Pyx_Coroutine_USED if (__pyx_Coroutine_init() < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} #endif #ifdef __Pyx_Generator_USED if (__pyx_Generator_init() < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} #endif #ifdef __Pyx_StopAsyncIteration_USED if (__pyx_StopAsyncIteration_init() < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} #endif /*--- Library function declarations ---*/ /*--- Threads initialization code ---*/ #if defined(__PYX_FORCE_INIT_THREADS) && __PYX_FORCE_INIT_THREADS #ifdef WITH_THREAD /* Python build with threading support? */ PyEval_InitThreads(); #endif #endif /*--- Module creation code ---*/ #if PY_MAJOR_VERSION < 3 __pyx_m = Py_InitModule4("image", __pyx_methods, 0, 0, PYTHON_API_VERSION); Py_XINCREF(__pyx_m); #else __pyx_m = PyModule_Create(&__pyx_moduledef); #endif if (unlikely(!__pyx_m)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_d = PyModule_GetDict(__pyx_m); if (unlikely(!__pyx_d)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} Py_INCREF(__pyx_d); __pyx_b = PyImport_AddModule(__Pyx_BUILTIN_MODULE_NAME); if (unlikely(!__pyx_b)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} #if CYTHON_COMPILING_IN_PYPY Py_INCREF(__pyx_b); #endif if (PyObject_SetAttrString(__pyx_m, "__builtins__", __pyx_b) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; /*--- Initialize various global constants etc. ---*/ if (__Pyx_InitGlobals() < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} #if PY_MAJOR_VERSION < 3 && (__PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT) if (__Pyx_init_sys_getdefaultencoding_params() < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} #endif if (__pyx_module_is_main_pygame_sdl2__image) { if (PyObject_SetAttrString(__pyx_m, "__name__", __pyx_n_s_main) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } #if PY_MAJOR_VERSION >= 3 { PyObject *modules = PyImport_GetModuleDict(); if (unlikely(!modules)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} if (!PyDict_GetItemString(modules, "pygame_sdl2.image")) { if (unlikely(PyDict_SetItemString(modules, "pygame_sdl2.image", __pyx_m) < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } } #endif /*--- Builtin init code ---*/ if (__Pyx_InitCachedBuiltins() < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /*--- Constants init code ---*/ if (__Pyx_InitCachedConstants() < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /*--- Global init code ---*/ /*--- Variable export code ---*/ /*--- Function export code ---*/ /*--- Type init code ---*/ /*--- Type import code ---*/ __pyx_ptype_11pygame_sdl2_7surface_Surface = __Pyx_ImportType("pygame_sdl2.surface", "Surface", sizeof(struct __pyx_obj_11pygame_sdl2_7surface_Surface), 1); if (unlikely(!__pyx_ptype_11pygame_sdl2_7surface_Surface)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 23; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_vtabptr_11pygame_sdl2_7surface_Surface = (struct __pyx_vtabstruct_11pygame_sdl2_7surface_Surface*)__Pyx_GetVtable(__pyx_ptype_11pygame_sdl2_7surface_Surface->tp_dict); if (unlikely(!__pyx_vtabptr_11pygame_sdl2_7surface_Surface)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 23; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /*--- Variable import code ---*/ /*--- Function import code ---*/ __pyx_t_1 = __Pyx_ImportModule("pygame_sdl2.rwobject"); if (!__pyx_t_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} if (__Pyx_ImportFunction(__pyx_t_1, "to_rwops", (void (**)(void))&__pyx_f_11pygame_sdl2_8rwobject_to_rwops, "SDL_RWops *(PyObject *, struct __pyx_opt_args_11pygame_sdl2_8rwobject_to_rwops *__pyx_optional_args)") < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} Py_DECREF(__pyx_t_1); __pyx_t_1 = 0; /*--- Execution code ---*/ #if defined(__Pyx_Generator_USED) || defined(__Pyx_Coroutine_USED) if (__Pyx_patch_abc() < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} #endif /* "pygame_sdl2/image.pyx":24 * from pygame_sdl2.rwobject cimport to_rwops * * from pygame_sdl2.error import error # <<<<<<<<<<<<<< * from pygame_sdl2.compat import bytes_, unicode_, filesystem_encode * */ __pyx_t_2 = PyList_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 24; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __Pyx_INCREF(__pyx_n_s_error); __Pyx_GIVEREF(__pyx_n_s_error); PyList_SET_ITEM(__pyx_t_2, 0, __pyx_n_s_error); __pyx_t_3 = __Pyx_Import(__pyx_n_s_pygame_sdl2_error, __pyx_t_2, 0); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 24; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_2 = __Pyx_ImportFrom(__pyx_t_3, __pyx_n_s_error); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 24; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_error, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 24; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "pygame_sdl2/image.pyx":25 * * from pygame_sdl2.error import error * from pygame_sdl2.compat import bytes_, unicode_, filesystem_encode # <<<<<<<<<<<<<< * * import os */ __pyx_t_3 = PyList_New(3); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 25; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __Pyx_INCREF(__pyx_n_s_bytes); __Pyx_GIVEREF(__pyx_n_s_bytes); PyList_SET_ITEM(__pyx_t_3, 0, __pyx_n_s_bytes); __Pyx_INCREF(__pyx_n_s_unicode); __Pyx_GIVEREF(__pyx_n_s_unicode); PyList_SET_ITEM(__pyx_t_3, 1, __pyx_n_s_unicode); __Pyx_INCREF(__pyx_n_s_filesystem_encode); __Pyx_GIVEREF(__pyx_n_s_filesystem_encode); PyList_SET_ITEM(__pyx_t_3, 2, __pyx_n_s_filesystem_encode); __pyx_t_2 = __Pyx_Import(__pyx_n_s_pygame_sdl2_compat, __pyx_t_3, 0); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 25; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_3 = __Pyx_ImportFrom(__pyx_t_2, __pyx_n_s_bytes); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 25; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); if (PyDict_SetItem(__pyx_d, __pyx_n_s_bytes, __pyx_t_3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 25; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_3 = __Pyx_ImportFrom(__pyx_t_2, __pyx_n_s_unicode); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 25; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); if (PyDict_SetItem(__pyx_d, __pyx_n_s_unicode, __pyx_t_3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 25; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_3 = __Pyx_ImportFrom(__pyx_t_2, __pyx_n_s_filesystem_encode); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 25; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); if (PyDict_SetItem(__pyx_d, __pyx_n_s_filesystem_encode, __pyx_t_3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 25; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "pygame_sdl2/image.pyx":27 * from pygame_sdl2.compat import bytes_, unicode_, filesystem_encode * * import os # <<<<<<<<<<<<<< * import pygame_sdl2 * */ __pyx_t_2 = __Pyx_Import(__pyx_n_s_os, 0, 0); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 27; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_os, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 27; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "pygame_sdl2/image.pyx":28 * * import os * import pygame_sdl2 # <<<<<<<<<<<<<< * * */ __pyx_t_2 = __Pyx_Import(__pyx_n_s_pygame_sdl2, 0, 0); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 28; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_pygame_sdl2, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 28; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "pygame_sdl2/image.pyx":31 * * * cdef int image_formats = 0 # <<<<<<<<<<<<<< * * def init(): */ __pyx_v_11pygame_sdl2_5image_image_formats = 0; /* "pygame_sdl2/image.pyx":33 * cdef int image_formats = 0 * * def init(): # <<<<<<<<<<<<<< * global image_formats * image_formats = IMG_Init(IMG_INIT_JPG | IMG_INIT_PNG | IMG_INIT_TIF | IMG_INIT_WEBP) */ __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_11pygame_sdl2_5image_1init, NULL, __pyx_n_s_pygame_sdl2_image); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 33; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_init, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 33; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "pygame_sdl2/image.pyx":39 * raise error() * * init() # <<<<<<<<<<<<<< * * def quit(): # @ReservedAssignment */ __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_init); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 39; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = NULL; if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_3))) { __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3); if (likely(__pyx_t_4)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); __Pyx_INCREF(__pyx_t_4); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_3, function); } } if (__pyx_t_4) { __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 39; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; } else { __pyx_t_2 = __Pyx_PyObject_CallNoArg(__pyx_t_3); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 39; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "pygame_sdl2/image.pyx":41 * init() * * def quit(): # @ReservedAssignment # <<<<<<<<<<<<<< * IMG_Quit() * */ __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_11pygame_sdl2_5image_3quit, NULL, __pyx_n_s_pygame_sdl2_image); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 41; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_quit, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 41; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "pygame_sdl2/image.pyx":61 * return ext.upper() * * def load(fi, namehint=""): # <<<<<<<<<<<<<< * cdef SDL_Surface *img * */ __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_11pygame_sdl2_5image_5load, NULL, __pyx_n_s_pygame_sdl2_image); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 61; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_load, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 61; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "pygame_sdl2/image.pyx":123 * int Pygame_SDL2_SavePNG(const char *, SDL_Surface *, int) nogil * * def save(Surface surface not None, filename, compression=-1): # <<<<<<<<<<<<<< * * if isinstance(filename, unicode_): */ __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_11pygame_sdl2_5image_7save, NULL, __pyx_n_s_pygame_sdl2_image); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 123; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_save, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 123; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "pygame_sdl2/image.pyx":153 * raise error() * * def get_extended(): # <<<<<<<<<<<<<< * # This may be called before init. * return True */ __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_11pygame_sdl2_5image_9get_extended, NULL, __pyx_n_s_pygame_sdl2_image); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 153; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_get_extended, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 153; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "pygame_sdl2/image.pyx":1 * # Copyright 2014 Patrick Dawson # <<<<<<<<<<<<<< * # * # This software is provided 'as-is', without any express or implied */ __pyx_t_2 = PyDict_New(); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_test, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /*--- Wrapped vars code ---*/ goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); if (__pyx_m) { if (__pyx_d) { __Pyx_AddTraceback("init pygame_sdl2.image", __pyx_clineno, __pyx_lineno, __pyx_filename); } Py_DECREF(__pyx_m); __pyx_m = 0; } else if (!PyErr_Occurred()) { PyErr_SetString(PyExc_ImportError, "init pygame_sdl2.image"); } __pyx_L0:; __Pyx_RefNannyFinishContext(); #if PY_MAJOR_VERSION < 3 return; #else return __pyx_m; #endif } /* --- Runtime support code --- */ #if CYTHON_REFNANNY static __Pyx_RefNannyAPIStruct *__Pyx_RefNannyImportAPI(const char *modname) { PyObject *m = NULL, *p = NULL; void *r = NULL; m = PyImport_ImportModule((char *)modname); if (!m) goto end; p = PyObject_GetAttrString(m, (char *)"RefNannyAPI"); if (!p) goto end; r = PyLong_AsVoidPtr(p); end: Py_XDECREF(p); Py_XDECREF(m); return (__Pyx_RefNannyAPIStruct *)r; } #endif static PyObject *__Pyx_GetBuiltinName(PyObject *name) { PyObject* result = __Pyx_PyObject_GetAttrStr(__pyx_b, name); if (unlikely(!result)) { PyErr_Format(PyExc_NameError, #if PY_MAJOR_VERSION >= 3 "name '%U' is not defined", name); #else "name '%.200s' is not defined", PyString_AS_STRING(name)); #endif } return result; } static CYTHON_INLINE PyObject *__Pyx_GetModuleGlobalName(PyObject *name) { PyObject *result; #if CYTHON_COMPILING_IN_CPYTHON result = PyDict_GetItem(__pyx_d, name); if (likely(result)) { Py_INCREF(result); } else { #else result = PyObject_GetItem(__pyx_d, name); if (!result) { PyErr_Clear(); #endif result = __Pyx_GetBuiltinName(name); } return result; } #if CYTHON_COMPILING_IN_CPYTHON static CYTHON_INLINE PyObject* __Pyx_PyObject_Call(PyObject *func, PyObject *arg, PyObject *kw) { PyObject *result; ternaryfunc call = func->ob_type->tp_call; if (unlikely(!call)) return PyObject_Call(func, arg, kw); if (unlikely(Py_EnterRecursiveCall((char*)" while calling a Python object"))) return NULL; result = (*call)(func, arg, kw); Py_LeaveRecursiveCall(); if (unlikely(!result) && unlikely(!PyErr_Occurred())) { PyErr_SetString( PyExc_SystemError, "NULL result without error in PyObject_Call"); } return result; } #endif #if CYTHON_COMPILING_IN_CPYTHON static CYTHON_INLINE PyObject* __Pyx_PyObject_CallMethO(PyObject *func, PyObject *arg) { PyObject *self, *result; PyCFunction cfunc; cfunc = PyCFunction_GET_FUNCTION(func); self = PyCFunction_GET_SELF(func); if (unlikely(Py_EnterRecursiveCall((char*)" while calling a Python object"))) return NULL; result = cfunc(self, arg); Py_LeaveRecursiveCall(); if (unlikely(!result) && unlikely(!PyErr_Occurred())) { PyErr_SetString( PyExc_SystemError, "NULL result without error in PyObject_Call"); } return result; } #endif #if CYTHON_COMPILING_IN_CPYTHON static PyObject* __Pyx__PyObject_CallOneArg(PyObject *func, PyObject *arg) { PyObject *result; PyObject *args = PyTuple_New(1); if (unlikely(!args)) return NULL; Py_INCREF(arg); PyTuple_SET_ITEM(args, 0, arg); result = __Pyx_PyObject_Call(func, args, NULL); Py_DECREF(args); return result; } static CYTHON_INLINE PyObject* __Pyx_PyObject_CallOneArg(PyObject *func, PyObject *arg) { #ifdef __Pyx_CyFunction_USED if (likely(PyCFunction_Check(func) || PyObject_TypeCheck(func, __pyx_CyFunctionType))) { #else if (likely(PyCFunction_Check(func))) { #endif if (likely(PyCFunction_GET_FLAGS(func) & METH_O)) { return __Pyx_PyObject_CallMethO(func, arg); } } return __Pyx__PyObject_CallOneArg(func, arg); } #else static CYTHON_INLINE PyObject* __Pyx_PyObject_CallOneArg(PyObject *func, PyObject *arg) { PyObject* args = PyTuple_Pack(1, arg); return (likely(args)) ? __Pyx_PyObject_Call(func, args, NULL) : NULL; } #endif #if CYTHON_COMPILING_IN_CPYTHON static CYTHON_INLINE PyObject* __Pyx_PyObject_CallNoArg(PyObject *func) { #ifdef __Pyx_CyFunction_USED if (likely(PyCFunction_Check(func) || PyObject_TypeCheck(func, __pyx_CyFunctionType))) { #else if (likely(PyCFunction_Check(func))) { #endif if (likely(PyCFunction_GET_FLAGS(func) & METH_NOARGS)) { return __Pyx_PyObject_CallMethO(func, NULL); } } return __Pyx_PyObject_Call(func, __pyx_empty_tuple, NULL); } #endif static CYTHON_INLINE void __Pyx_ErrRestore(PyObject *type, PyObject *value, PyObject *tb) { #if CYTHON_COMPILING_IN_CPYTHON PyObject *tmp_type, *tmp_value, *tmp_tb; PyThreadState *tstate = PyThreadState_GET(); tmp_type = tstate->curexc_type; tmp_value = tstate->curexc_value; tmp_tb = tstate->curexc_traceback; tstate->curexc_type = type; tstate->curexc_value = value; tstate->curexc_traceback = tb; Py_XDECREF(tmp_type); Py_XDECREF(tmp_value); Py_XDECREF(tmp_tb); #else PyErr_Restore(type, value, tb); #endif } static CYTHON_INLINE void __Pyx_ErrFetch(PyObject **type, PyObject **value, PyObject **tb) { #if CYTHON_COMPILING_IN_CPYTHON PyThreadState *tstate = PyThreadState_GET(); *type = tstate->curexc_type; *value = tstate->curexc_value; *tb = tstate->curexc_traceback; tstate->curexc_type = 0; tstate->curexc_value = 0; tstate->curexc_traceback = 0; #else PyErr_Fetch(type, value, tb); #endif } #if PY_MAJOR_VERSION < 3 static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, CYTHON_UNUSED PyObject *cause) { Py_XINCREF(type); if (!value || value == Py_None) value = NULL; else Py_INCREF(value); if (!tb || tb == Py_None) tb = NULL; else { Py_INCREF(tb); if (!PyTraceBack_Check(tb)) { PyErr_SetString(PyExc_TypeError, "raise: arg 3 must be a traceback or None"); goto raise_error; } } if (PyType_Check(type)) { #if CYTHON_COMPILING_IN_PYPY if (!value) { Py_INCREF(Py_None); value = Py_None; } #endif PyErr_NormalizeException(&type, &value, &tb); } else { if (value) { PyErr_SetString(PyExc_TypeError, "instance exception may not have a separate value"); goto raise_error; } value = type; type = (PyObject*) Py_TYPE(type); Py_INCREF(type); if (!PyType_IsSubtype((PyTypeObject *)type, (PyTypeObject *)PyExc_BaseException)) { PyErr_SetString(PyExc_TypeError, "raise: exception class must be a subclass of BaseException"); goto raise_error; } } __Pyx_ErrRestore(type, value, tb); return; raise_error: Py_XDECREF(value); Py_XDECREF(type); Py_XDECREF(tb); return; } #else static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, PyObject *cause) { PyObject* owned_instance = NULL; if (tb == Py_None) { tb = 0; } else if (tb && !PyTraceBack_Check(tb)) { PyErr_SetString(PyExc_TypeError, "raise: arg 3 must be a traceback or None"); goto bad; } if (value == Py_None) value = 0; if (PyExceptionInstance_Check(type)) { if (value) { PyErr_SetString(PyExc_TypeError, "instance exception may not have a separate value"); goto bad; } value = type; type = (PyObject*) Py_TYPE(value); } else if (PyExceptionClass_Check(type)) { PyObject *instance_class = NULL; if (value && PyExceptionInstance_Check(value)) { instance_class = (PyObject*) Py_TYPE(value); if (instance_class != type) { int is_subclass = PyObject_IsSubclass(instance_class, type); if (!is_subclass) { instance_class = NULL; } else if (unlikely(is_subclass == -1)) { goto bad; } else { type = instance_class; } } } if (!instance_class) { PyObject *args; if (!value) args = PyTuple_New(0); else if (PyTuple_Check(value)) { Py_INCREF(value); args = value; } else args = PyTuple_Pack(1, value); if (!args) goto bad; owned_instance = PyObject_Call(type, args, NULL); Py_DECREF(args); if (!owned_instance) goto bad; value = owned_instance; if (!PyExceptionInstance_Check(value)) { PyErr_Format(PyExc_TypeError, "calling %R should have returned an instance of " "BaseException, not %R", type, Py_TYPE(value)); goto bad; } } } else { PyErr_SetString(PyExc_TypeError, "raise: exception class must be a subclass of BaseException"); goto bad; } #if PY_VERSION_HEX >= 0x03030000 if (cause) { #else if (cause && cause != Py_None) { #endif PyObject *fixed_cause; if (cause == Py_None) { fixed_cause = NULL; } else if (PyExceptionClass_Check(cause)) { fixed_cause = PyObject_CallObject(cause, NULL); if (fixed_cause == NULL) goto bad; } else if (PyExceptionInstance_Check(cause)) { fixed_cause = cause; Py_INCREF(fixed_cause); } else { PyErr_SetString(PyExc_TypeError, "exception causes must derive from " "BaseException"); goto bad; } PyException_SetCause(value, fixed_cause); } PyErr_SetObject(type, value); if (tb) { #if CYTHON_COMPILING_IN_PYPY PyObject *tmp_type, *tmp_value, *tmp_tb; PyErr_Fetch(&tmp_type, &tmp_value, &tmp_tb); Py_INCREF(tb); PyErr_Restore(tmp_type, tmp_value, tb); Py_XDECREF(tmp_tb); #else PyThreadState *tstate = PyThreadState_GET(); PyObject* tmp_tb = tstate->curexc_traceback; if (tb != tmp_tb) { Py_INCREF(tb); tstate->curexc_traceback = tb; Py_XDECREF(tmp_tb); } #endif } bad: Py_XDECREF(owned_instance); return; } #endif static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Generic(PyObject *o, PyObject* j) { PyObject *r; if (!j) return NULL; r = PyObject_GetItem(o, j); Py_DECREF(j); return r; } static CYTHON_INLINE PyObject *__Pyx_GetItemInt_List_Fast(PyObject *o, Py_ssize_t i, CYTHON_NCP_UNUSED int wraparound, CYTHON_NCP_UNUSED int boundscheck) { #if CYTHON_COMPILING_IN_CPYTHON if (wraparound & unlikely(i < 0)) i += PyList_GET_SIZE(o); if ((!boundscheck) || likely((0 <= i) & (i < PyList_GET_SIZE(o)))) { PyObject *r = PyList_GET_ITEM(o, i); Py_INCREF(r); return r; } return __Pyx_GetItemInt_Generic(o, PyInt_FromSsize_t(i)); #else return PySequence_GetItem(o, i); #endif } static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Tuple_Fast(PyObject *o, Py_ssize_t i, CYTHON_NCP_UNUSED int wraparound, CYTHON_NCP_UNUSED int boundscheck) { #if CYTHON_COMPILING_IN_CPYTHON if (wraparound & unlikely(i < 0)) i += PyTuple_GET_SIZE(o); if ((!boundscheck) || likely((0 <= i) & (i < PyTuple_GET_SIZE(o)))) { PyObject *r = PyTuple_GET_ITEM(o, i); Py_INCREF(r); return r; } return __Pyx_GetItemInt_Generic(o, PyInt_FromSsize_t(i)); #else return PySequence_GetItem(o, i); #endif } static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Fast(PyObject *o, Py_ssize_t i, int is_list, CYTHON_NCP_UNUSED int wraparound, CYTHON_NCP_UNUSED int boundscheck) { #if CYTHON_COMPILING_IN_CPYTHON if (is_list || PyList_CheckExact(o)) { Py_ssize_t n = ((!wraparound) | likely(i >= 0)) ? i : i + PyList_GET_SIZE(o); if ((!boundscheck) || (likely((n >= 0) & (n < PyList_GET_SIZE(o))))) { PyObject *r = PyList_GET_ITEM(o, n); Py_INCREF(r); return r; } } else if (PyTuple_CheckExact(o)) { Py_ssize_t n = ((!wraparound) | likely(i >= 0)) ? i : i + PyTuple_GET_SIZE(o); if ((!boundscheck) || likely((n >= 0) & (n < PyTuple_GET_SIZE(o)))) { PyObject *r = PyTuple_GET_ITEM(o, n); Py_INCREF(r); return r; } } else { PySequenceMethods *m = Py_TYPE(o)->tp_as_sequence; if (likely(m && m->sq_item)) { if (wraparound && unlikely(i < 0) && likely(m->sq_length)) { Py_ssize_t l = m->sq_length(o); if (likely(l >= 0)) { i += l; } else { if (PyErr_ExceptionMatches(PyExc_OverflowError)) PyErr_Clear(); else return NULL; } } return m->sq_item(o, i); } } #else if (is_list || PySequence_Check(o)) { return PySequence_GetItem(o, i); } #endif return __Pyx_GetItemInt_Generic(o, PyInt_FromSsize_t(i)); } static CYTHON_INLINE int __Pyx_PyBytes_Equals(PyObject* s1, PyObject* s2, int equals) { #if CYTHON_COMPILING_IN_PYPY return PyObject_RichCompareBool(s1, s2, equals); #else if (s1 == s2) { return (equals == Py_EQ); } else if (PyBytes_CheckExact(s1) & PyBytes_CheckExact(s2)) { const char *ps1, *ps2; Py_ssize_t length = PyBytes_GET_SIZE(s1); if (length != PyBytes_GET_SIZE(s2)) return (equals == Py_NE); ps1 = PyBytes_AS_STRING(s1); ps2 = PyBytes_AS_STRING(s2); if (ps1[0] != ps2[0]) { return (equals == Py_NE); } else if (length == 1) { return (equals == Py_EQ); } else { int result = memcmp(ps1, ps2, (size_t)length); return (equals == Py_EQ) ? (result == 0) : (result != 0); } } else if ((s1 == Py_None) & PyBytes_CheckExact(s2)) { return (equals == Py_NE); } else if ((s2 == Py_None) & PyBytes_CheckExact(s1)) { return (equals == Py_NE); } else { int result; PyObject* py_result = PyObject_RichCompare(s1, s2, equals); if (!py_result) return -1; result = __Pyx_PyObject_IsTrue(py_result); Py_DECREF(py_result); return result; } #endif } static CYTHON_INLINE PyObject* __Pyx_PyObject_GetSlice(PyObject* obj, Py_ssize_t cstart, Py_ssize_t cstop, PyObject** _py_start, PyObject** _py_stop, PyObject** _py_slice, int has_cstart, int has_cstop, CYTHON_UNUSED int wraparound) { #if CYTHON_COMPILING_IN_CPYTHON PyMappingMethods* mp; #if PY_MAJOR_VERSION < 3 PySequenceMethods* ms = Py_TYPE(obj)->tp_as_sequence; if (likely(ms && ms->sq_slice)) { if (!has_cstart) { if (_py_start && (*_py_start != Py_None)) { cstart = __Pyx_PyIndex_AsSsize_t(*_py_start); if ((cstart == (Py_ssize_t)-1) && PyErr_Occurred()) goto bad; } else cstart = 0; } if (!has_cstop) { if (_py_stop && (*_py_stop != Py_None)) { cstop = __Pyx_PyIndex_AsSsize_t(*_py_stop); if ((cstop == (Py_ssize_t)-1) && PyErr_Occurred()) goto bad; } else cstop = PY_SSIZE_T_MAX; } if (wraparound && unlikely((cstart < 0) | (cstop < 0)) && likely(ms->sq_length)) { Py_ssize_t l = ms->sq_length(obj); if (likely(l >= 0)) { if (cstop < 0) { cstop += l; if (cstop < 0) cstop = 0; } if (cstart < 0) { cstart += l; if (cstart < 0) cstart = 0; } } else { if (PyErr_ExceptionMatches(PyExc_OverflowError)) PyErr_Clear(); else goto bad; } } return ms->sq_slice(obj, cstart, cstop); } #endif mp = Py_TYPE(obj)->tp_as_mapping; if (likely(mp && mp->mp_subscript)) #endif { PyObject* result; PyObject *py_slice, *py_start, *py_stop; if (_py_slice) { py_slice = *_py_slice; } else { PyObject* owned_start = NULL; PyObject* owned_stop = NULL; if (_py_start) { py_start = *_py_start; } else { if (has_cstart) { owned_start = py_start = PyInt_FromSsize_t(cstart); if (unlikely(!py_start)) goto bad; } else py_start = Py_None; } if (_py_stop) { py_stop = *_py_stop; } else { if (has_cstop) { owned_stop = py_stop = PyInt_FromSsize_t(cstop); if (unlikely(!py_stop)) { Py_XDECREF(owned_start); goto bad; } } else py_stop = Py_None; } py_slice = PySlice_New(py_start, py_stop, Py_None); Py_XDECREF(owned_start); Py_XDECREF(owned_stop); if (unlikely(!py_slice)) goto bad; } #if CYTHON_COMPILING_IN_CPYTHON result = mp->mp_subscript(obj, py_slice); #else result = PyObject_GetItem(obj, py_slice); #endif if (!_py_slice) { Py_DECREF(py_slice); } return result; } PyErr_Format(PyExc_TypeError, "'%.200s' object is unsliceable", Py_TYPE(obj)->tp_name); bad: return NULL; } static void __Pyx_RaiseDoubleKeywordsError( const char* func_name, PyObject* kw_name) { PyErr_Format(PyExc_TypeError, #if PY_MAJOR_VERSION >= 3 "%s() got multiple values for keyword argument '%U'", func_name, kw_name); #else "%s() got multiple values for keyword argument '%s'", func_name, PyString_AsString(kw_name)); #endif } static int __Pyx_ParseOptionalKeywords( PyObject *kwds, PyObject **argnames[], PyObject *kwds2, PyObject *values[], Py_ssize_t num_pos_args, const char* function_name) { PyObject *key = 0, *value = 0; Py_ssize_t pos = 0; PyObject*** name; PyObject*** first_kw_arg = argnames + num_pos_args; while (PyDict_Next(kwds, &pos, &key, &value)) { name = first_kw_arg; while (*name && (**name != key)) name++; if (*name) { values[name-argnames] = value; continue; } name = first_kw_arg; #if PY_MAJOR_VERSION < 3 if (likely(PyString_CheckExact(key)) || likely(PyString_Check(key))) { while (*name) { if ((CYTHON_COMPILING_IN_PYPY || PyString_GET_SIZE(**name) == PyString_GET_SIZE(key)) && _PyString_Eq(**name, key)) { values[name-argnames] = value; break; } name++; } if (*name) continue; else { PyObject*** argname = argnames; while (argname != first_kw_arg) { if ((**argname == key) || ( (CYTHON_COMPILING_IN_PYPY || PyString_GET_SIZE(**argname) == PyString_GET_SIZE(key)) && _PyString_Eq(**argname, key))) { goto arg_passed_twice; } argname++; } } } else #endif if (likely(PyUnicode_Check(key))) { while (*name) { int cmp = (**name == key) ? 0 : #if !CYTHON_COMPILING_IN_PYPY && PY_MAJOR_VERSION >= 3 (PyUnicode_GET_SIZE(**name) != PyUnicode_GET_SIZE(key)) ? 1 : #endif PyUnicode_Compare(**name, key); if (cmp < 0 && unlikely(PyErr_Occurred())) goto bad; if (cmp == 0) { values[name-argnames] = value; break; } name++; } if (*name) continue; else { PyObject*** argname = argnames; while (argname != first_kw_arg) { int cmp = (**argname == key) ? 0 : #if !CYTHON_COMPILING_IN_PYPY && PY_MAJOR_VERSION >= 3 (PyUnicode_GET_SIZE(**argname) != PyUnicode_GET_SIZE(key)) ? 1 : #endif PyUnicode_Compare(**argname, key); if (cmp < 0 && unlikely(PyErr_Occurred())) goto bad; if (cmp == 0) goto arg_passed_twice; argname++; } } } else goto invalid_keyword_type; if (kwds2) { if (unlikely(PyDict_SetItem(kwds2, key, value))) goto bad; } else { goto invalid_keyword; } } return 0; arg_passed_twice: __Pyx_RaiseDoubleKeywordsError(function_name, key); goto bad; invalid_keyword_type: PyErr_Format(PyExc_TypeError, "%.200s() keywords must be strings", function_name); goto bad; invalid_keyword: PyErr_Format(PyExc_TypeError, #if PY_MAJOR_VERSION < 3 "%.200s() got an unexpected keyword argument '%.200s'", function_name, PyString_AsString(key)); #else "%s() got an unexpected keyword argument '%U'", function_name, key); #endif bad: return -1; } static void __Pyx_RaiseArgtupleInvalid( const char* func_name, int exact, Py_ssize_t num_min, Py_ssize_t num_max, Py_ssize_t num_found) { Py_ssize_t num_expected; const char *more_or_less; if (num_found < num_min) { num_expected = num_min; more_or_less = "at least"; } else { num_expected = num_max; more_or_less = "at most"; } if (exact) { more_or_less = "exactly"; } PyErr_Format(PyExc_TypeError, "%.200s() takes %.8s %" CYTHON_FORMAT_SSIZE_T "d positional argument%.1s (%" CYTHON_FORMAT_SSIZE_T "d given)", func_name, more_or_less, num_expected, (num_expected == 1) ? "" : "s", num_found); } static CYTHON_INLINE int __Pyx_PyUnicode_Equals(PyObject* s1, PyObject* s2, int equals) { #if CYTHON_COMPILING_IN_PYPY return PyObject_RichCompareBool(s1, s2, equals); #else #if PY_MAJOR_VERSION < 3 PyObject* owned_ref = NULL; #endif int s1_is_unicode, s2_is_unicode; if (s1 == s2) { goto return_eq; } s1_is_unicode = PyUnicode_CheckExact(s1); s2_is_unicode = PyUnicode_CheckExact(s2); #if PY_MAJOR_VERSION < 3 if ((s1_is_unicode & (!s2_is_unicode)) && PyString_CheckExact(s2)) { owned_ref = PyUnicode_FromObject(s2); if (unlikely(!owned_ref)) return -1; s2 = owned_ref; s2_is_unicode = 1; } else if ((s2_is_unicode & (!s1_is_unicode)) && PyString_CheckExact(s1)) { owned_ref = PyUnicode_FromObject(s1); if (unlikely(!owned_ref)) return -1; s1 = owned_ref; s1_is_unicode = 1; } else if (((!s2_is_unicode) & (!s1_is_unicode))) { return __Pyx_PyBytes_Equals(s1, s2, equals); } #endif if (s1_is_unicode & s2_is_unicode) { Py_ssize_t length; int kind; void *data1, *data2; if (unlikely(__Pyx_PyUnicode_READY(s1) < 0) || unlikely(__Pyx_PyUnicode_READY(s2) < 0)) return -1; length = __Pyx_PyUnicode_GET_LENGTH(s1); if (length != __Pyx_PyUnicode_GET_LENGTH(s2)) { goto return_ne; } kind = __Pyx_PyUnicode_KIND(s1); if (kind != __Pyx_PyUnicode_KIND(s2)) { goto return_ne; } data1 = __Pyx_PyUnicode_DATA(s1); data2 = __Pyx_PyUnicode_DATA(s2); if (__Pyx_PyUnicode_READ(kind, data1, 0) != __Pyx_PyUnicode_READ(kind, data2, 0)) { goto return_ne; } else if (length == 1) { goto return_eq; } else { int result = memcmp(data1, data2, (size_t)(length * kind)); #if PY_MAJOR_VERSION < 3 Py_XDECREF(owned_ref); #endif return (equals == Py_EQ) ? (result == 0) : (result != 0); } } else if ((s1 == Py_None) & s2_is_unicode) { goto return_ne; } else if ((s2 == Py_None) & s1_is_unicode) { goto return_ne; } else { int result; PyObject* py_result = PyObject_RichCompare(s1, s2, equals); if (!py_result) return -1; result = __Pyx_PyObject_IsTrue(py_result); Py_DECREF(py_result); return result; } return_eq: #if PY_MAJOR_VERSION < 3 Py_XDECREF(owned_ref); #endif return (equals == Py_EQ); return_ne: #if PY_MAJOR_VERSION < 3 Py_XDECREF(owned_ref); #endif return (equals == Py_NE); #endif } static CYTHON_INLINE void __Pyx_ExceptionSave(PyObject **type, PyObject **value, PyObject **tb) { #if CYTHON_COMPILING_IN_CPYTHON PyThreadState *tstate = PyThreadState_GET(); *type = tstate->exc_type; *value = tstate->exc_value; *tb = tstate->exc_traceback; Py_XINCREF(*type); Py_XINCREF(*value); Py_XINCREF(*tb); #else PyErr_GetExcInfo(type, value, tb); #endif } static void __Pyx_ExceptionReset(PyObject *type, PyObject *value, PyObject *tb) { #if CYTHON_COMPILING_IN_CPYTHON PyObject *tmp_type, *tmp_value, *tmp_tb; PyThreadState *tstate = PyThreadState_GET(); tmp_type = tstate->exc_type; tmp_value = tstate->exc_value; tmp_tb = tstate->exc_traceback; tstate->exc_type = type; tstate->exc_value = value; tstate->exc_traceback = tb; Py_XDECREF(tmp_type); Py_XDECREF(tmp_value); Py_XDECREF(tmp_tb); #else PyErr_SetExcInfo(type, value, tb); #endif } static int __Pyx_GetException(PyObject **type, PyObject **value, PyObject **tb) { PyObject *local_type, *local_value, *local_tb; #if CYTHON_COMPILING_IN_CPYTHON PyObject *tmp_type, *tmp_value, *tmp_tb; PyThreadState *tstate = PyThreadState_GET(); local_type = tstate->curexc_type; local_value = tstate->curexc_value; local_tb = tstate->curexc_traceback; tstate->curexc_type = 0; tstate->curexc_value = 0; tstate->curexc_traceback = 0; #else PyErr_Fetch(&local_type, &local_value, &local_tb); #endif PyErr_NormalizeException(&local_type, &local_value, &local_tb); #if CYTHON_COMPILING_IN_CPYTHON if (unlikely(tstate->curexc_type)) #else if (unlikely(PyErr_Occurred())) #endif goto bad; #if PY_MAJOR_VERSION >= 3 if (local_tb) { if (unlikely(PyException_SetTraceback(local_value, local_tb) < 0)) goto bad; } #endif Py_XINCREF(local_tb); Py_XINCREF(local_type); Py_XINCREF(local_value); *type = local_type; *value = local_value; *tb = local_tb; #if CYTHON_COMPILING_IN_CPYTHON tmp_type = tstate->exc_type; tmp_value = tstate->exc_value; tmp_tb = tstate->exc_traceback; tstate->exc_type = local_type; tstate->exc_value = local_value; tstate->exc_traceback = local_tb; Py_XDECREF(tmp_type); Py_XDECREF(tmp_value); Py_XDECREF(tmp_tb); #else PyErr_SetExcInfo(local_type, local_value, local_tb); #endif return 0; bad: *type = 0; *value = 0; *tb = 0; Py_XDECREF(local_type); Py_XDECREF(local_value); Py_XDECREF(local_tb); return -1; } static void __Pyx_RaiseArgumentTypeInvalid(const char* name, PyObject *obj, PyTypeObject *type) { PyErr_Format(PyExc_TypeError, "Argument '%.200s' has incorrect type (expected %.200s, got %.200s)", name, type->tp_name, Py_TYPE(obj)->tp_name); } static CYTHON_INLINE int __Pyx_ArgTypeTest(PyObject *obj, PyTypeObject *type, int none_allowed, const char *name, int exact) { if (unlikely(!type)) { PyErr_SetString(PyExc_SystemError, "Missing type object"); return 0; } if (none_allowed && obj == Py_None) return 1; else if (exact) { if (likely(Py_TYPE(obj) == type)) return 1; #if PY_MAJOR_VERSION == 2 else if ((type == &PyBaseString_Type) && likely(__Pyx_PyBaseString_CheckExact(obj))) return 1; #endif } else { if (likely(PyObject_TypeCheck(obj, type))) return 1; } __Pyx_RaiseArgumentTypeInvalid(name, obj, type); return 0; } static void* __Pyx_GetVtable(PyObject *dict) { void* ptr; PyObject *ob = PyObject_GetItem(dict, __pyx_n_s_pyx_vtable); if (!ob) goto bad; #if PY_VERSION_HEX >= 0x02070000 ptr = PyCapsule_GetPointer(ob, 0); #else ptr = PyCObject_AsVoidPtr(ob); #endif if (!ptr && !PyErr_Occurred()) PyErr_SetString(PyExc_RuntimeError, "invalid vtable found for imported type"); Py_DECREF(ob); return ptr; bad: Py_XDECREF(ob); return NULL; } static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list, int level) { PyObject *empty_list = 0; PyObject *module = 0; PyObject *global_dict = 0; PyObject *empty_dict = 0; PyObject *list; #if PY_VERSION_HEX < 0x03030000 PyObject *py_import; py_import = __Pyx_PyObject_GetAttrStr(__pyx_b, __pyx_n_s_import); if (!py_import) goto bad; #endif if (from_list) list = from_list; else { empty_list = PyList_New(0); if (!empty_list) goto bad; list = empty_list; } global_dict = PyModule_GetDict(__pyx_m); if (!global_dict) goto bad; empty_dict = PyDict_New(); if (!empty_dict) goto bad; { #if PY_MAJOR_VERSION >= 3 if (level == -1) { if (strchr(__Pyx_MODULE_NAME, '.')) { #if PY_VERSION_HEX < 0x03030000 PyObject *py_level = PyInt_FromLong(1); if (!py_level) goto bad; module = PyObject_CallFunctionObjArgs(py_import, name, global_dict, empty_dict, list, py_level, NULL); Py_DECREF(py_level); #else module = PyImport_ImportModuleLevelObject( name, global_dict, empty_dict, list, 1); #endif if (!module) { if (!PyErr_ExceptionMatches(PyExc_ImportError)) goto bad; PyErr_Clear(); } } level = 0; } #endif if (!module) { #if PY_VERSION_HEX < 0x03030000 PyObject *py_level = PyInt_FromLong(level); if (!py_level) goto bad; module = PyObject_CallFunctionObjArgs(py_import, name, global_dict, empty_dict, list, py_level, NULL); Py_DECREF(py_level); #else module = PyImport_ImportModuleLevelObject( name, global_dict, empty_dict, list, level); #endif } } bad: #if PY_VERSION_HEX < 0x03030000 Py_XDECREF(py_import); #endif Py_XDECREF(empty_list); Py_XDECREF(empty_dict); return module; } static PyObject* __Pyx_ImportFrom(PyObject* module, PyObject* name) { PyObject* value = __Pyx_PyObject_GetAttrStr(module, name); if (unlikely(!value) && PyErr_ExceptionMatches(PyExc_AttributeError)) { PyErr_Format(PyExc_ImportError, #if PY_MAJOR_VERSION < 3 "cannot import name %.230s", PyString_AS_STRING(name)); #else "cannot import name %S", name); #endif } return value; } static int __pyx_bisect_code_objects(__Pyx_CodeObjectCacheEntry* entries, int count, int code_line) { int start = 0, mid = 0, end = count - 1; if (end >= 0 && code_line > entries[end].code_line) { return count; } while (start < end) { mid = start + (end - start) / 2; if (code_line < entries[mid].code_line) { end = mid; } else if (code_line > entries[mid].code_line) { start = mid + 1; } else { return mid; } } if (code_line <= entries[mid].code_line) { return mid; } else { return mid + 1; } } static PyCodeObject *__pyx_find_code_object(int code_line) { PyCodeObject* code_object; int pos; if (unlikely(!code_line) || unlikely(!__pyx_code_cache.entries)) { return NULL; } pos = __pyx_bisect_code_objects(__pyx_code_cache.entries, __pyx_code_cache.count, code_line); if (unlikely(pos >= __pyx_code_cache.count) || unlikely(__pyx_code_cache.entries[pos].code_line != code_line)) { return NULL; } code_object = __pyx_code_cache.entries[pos].code_object; Py_INCREF(code_object); return code_object; } static void __pyx_insert_code_object(int code_line, PyCodeObject* code_object) { int pos, i; __Pyx_CodeObjectCacheEntry* entries = __pyx_code_cache.entries; if (unlikely(!code_line)) { return; } if (unlikely(!entries)) { entries = (__Pyx_CodeObjectCacheEntry*)PyMem_Malloc(64*sizeof(__Pyx_CodeObjectCacheEntry)); if (likely(entries)) { __pyx_code_cache.entries = entries; __pyx_code_cache.max_count = 64; __pyx_code_cache.count = 1; entries[0].code_line = code_line; entries[0].code_object = code_object; Py_INCREF(code_object); } return; } pos = __pyx_bisect_code_objects(__pyx_code_cache.entries, __pyx_code_cache.count, code_line); if ((pos < __pyx_code_cache.count) && unlikely(__pyx_code_cache.entries[pos].code_line == code_line)) { PyCodeObject* tmp = entries[pos].code_object; entries[pos].code_object = code_object; Py_DECREF(tmp); return; } if (__pyx_code_cache.count == __pyx_code_cache.max_count) { int new_max = __pyx_code_cache.max_count + 64; entries = (__Pyx_CodeObjectCacheEntry*)PyMem_Realloc( __pyx_code_cache.entries, (size_t)new_max*sizeof(__Pyx_CodeObjectCacheEntry)); if (unlikely(!entries)) { return; } __pyx_code_cache.entries = entries; __pyx_code_cache.max_count = new_max; } for (i=__pyx_code_cache.count; i>pos; i--) { entries[i] = entries[i-1]; } entries[pos].code_line = code_line; entries[pos].code_object = code_object; __pyx_code_cache.count++; Py_INCREF(code_object); } #include "compile.h" #include "frameobject.h" #include "traceback.h" static PyCodeObject* __Pyx_CreateCodeObjectForTraceback( const char *funcname, int c_line, int py_line, const char *filename) { PyCodeObject *py_code = 0; PyObject *py_srcfile = 0; PyObject *py_funcname = 0; #if PY_MAJOR_VERSION < 3 py_srcfile = PyString_FromString(filename); #else py_srcfile = PyUnicode_FromString(filename); #endif if (!py_srcfile) goto bad; if (c_line) { #if PY_MAJOR_VERSION < 3 py_funcname = PyString_FromFormat( "%s (%s:%d)", funcname, __pyx_cfilenm, c_line); #else py_funcname = PyUnicode_FromFormat( "%s (%s:%d)", funcname, __pyx_cfilenm, c_line); #endif } else { #if PY_MAJOR_VERSION < 3 py_funcname = PyString_FromString(funcname); #else py_funcname = PyUnicode_FromString(funcname); #endif } if (!py_funcname) goto bad; py_code = __Pyx_PyCode_New( 0, 0, 0, 0, 0, __pyx_empty_bytes, /*PyObject *code,*/ __pyx_empty_tuple, /*PyObject *consts,*/ __pyx_empty_tuple, /*PyObject *names,*/ __pyx_empty_tuple, /*PyObject *varnames,*/ __pyx_empty_tuple, /*PyObject *freevars,*/ __pyx_empty_tuple, /*PyObject *cellvars,*/ py_srcfile, /*PyObject *filename,*/ py_funcname, /*PyObject *name,*/ py_line, __pyx_empty_bytes /*PyObject *lnotab*/ ); Py_DECREF(py_srcfile); Py_DECREF(py_funcname); return py_code; bad: Py_XDECREF(py_srcfile); Py_XDECREF(py_funcname); return NULL; } static void __Pyx_AddTraceback(const char *funcname, int c_line, int py_line, const char *filename) { PyCodeObject *py_code = 0; PyFrameObject *py_frame = 0; py_code = __pyx_find_code_object(c_line ? c_line : py_line); if (!py_code) { py_code = __Pyx_CreateCodeObjectForTraceback( funcname, c_line, py_line, filename); if (!py_code) goto bad; __pyx_insert_code_object(c_line ? c_line : py_line, py_code); } py_frame = PyFrame_New( PyThreadState_GET(), /*PyThreadState *tstate,*/ py_code, /*PyCodeObject *code,*/ __pyx_d, /*PyObject *globals,*/ 0 /*PyObject *locals*/ ); if (!py_frame) goto bad; py_frame->f_lineno = py_line; PyTraceBack_Here(py_frame); bad: Py_XDECREF(py_code); Py_XDECREF(py_frame); } static CYTHON_INLINE PyObject* __Pyx_PyInt_From_long(long value) { const long neg_one = (long) -1, const_zero = (long) 0; const int is_unsigned = neg_one > const_zero; if (is_unsigned) { if (sizeof(long) < sizeof(long)) { return PyInt_FromLong((long) value); } else if (sizeof(long) <= sizeof(unsigned long)) { return PyLong_FromUnsignedLong((unsigned long) value); } else if (sizeof(long) <= sizeof(unsigned PY_LONG_LONG)) { return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value); } } else { if (sizeof(long) <= sizeof(long)) { return PyInt_FromLong((long) value); } else if (sizeof(long) <= sizeof(PY_LONG_LONG)) { return PyLong_FromLongLong((PY_LONG_LONG) value); } } { int one = 1; int little = (int)*(unsigned char *)&one; unsigned char *bytes = (unsigned char *)&value; return _PyLong_FromByteArray(bytes, sizeof(long), little, !is_unsigned); } } #define __PYX_VERIFY_RETURN_INT(target_type, func_type, func_value)\ __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, 0) #define __PYX_VERIFY_RETURN_INT_EXC(target_type, func_type, func_value)\ __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, 1) #define __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, exc)\ {\ func_type value = func_value;\ if (sizeof(target_type) < sizeof(func_type)) {\ if (unlikely(value != (func_type) (target_type) value)) {\ func_type zero = 0;\ if (exc && unlikely(value == (func_type)-1 && PyErr_Occurred()))\ return (target_type) -1;\ if (is_unsigned && unlikely(value < zero))\ goto raise_neg_overflow;\ else\ goto raise_overflow;\ }\ }\ return (target_type) value;\ } #if CYTHON_USE_PYLONG_INTERNALS #include "longintrepr.h" #endif static CYTHON_INLINE int __Pyx_PyInt_As_int(PyObject *x) { const int neg_one = (int) -1, const_zero = (int) 0; const int is_unsigned = neg_one > const_zero; #if PY_MAJOR_VERSION < 3 if (likely(PyInt_Check(x))) { if (sizeof(int) < sizeof(long)) { __PYX_VERIFY_RETURN_INT(int, long, PyInt_AS_LONG(x)) } else { long val = PyInt_AS_LONG(x); if (is_unsigned && unlikely(val < 0)) { goto raise_neg_overflow; } return (int) val; } } else #endif if (likely(PyLong_Check(x))) { if (is_unsigned) { #if CYTHON_USE_PYLONG_INTERNALS const digit* digits = ((PyLongObject*)x)->ob_digit; switch (Py_SIZE(x)) { case 0: return (int) 0; case 1: __PYX_VERIFY_RETURN_INT(int, digit, digits[0]) case 2: if (8 * sizeof(int) > 1 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(int) >= 2 * PyLong_SHIFT) { return (int) (((((int)digits[1]) << PyLong_SHIFT) | (int)digits[0])); } } break; case 3: if (8 * sizeof(int) > 2 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(int) >= 3 * PyLong_SHIFT) { return (int) (((((((int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0])); } } break; case 4: if (8 * sizeof(int) > 3 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(int) >= 4 * PyLong_SHIFT) { return (int) (((((((((int)digits[3]) << PyLong_SHIFT) | (int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0])); } } break; } #endif #if CYTHON_COMPILING_IN_CPYTHON if (unlikely(Py_SIZE(x) < 0)) { goto raise_neg_overflow; } #else { int result = PyObject_RichCompareBool(x, Py_False, Py_LT); if (unlikely(result < 0)) return (int) -1; if (unlikely(result == 1)) goto raise_neg_overflow; } #endif if (sizeof(int) <= sizeof(unsigned long)) { __PYX_VERIFY_RETURN_INT_EXC(int, unsigned long, PyLong_AsUnsignedLong(x)) } else if (sizeof(int) <= sizeof(unsigned PY_LONG_LONG)) { __PYX_VERIFY_RETURN_INT_EXC(int, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x)) } } else { #if CYTHON_USE_PYLONG_INTERNALS const digit* digits = ((PyLongObject*)x)->ob_digit; switch (Py_SIZE(x)) { case 0: return (int) 0; case -1: __PYX_VERIFY_RETURN_INT(int, sdigit, -(sdigit) digits[0]) case 1: __PYX_VERIFY_RETURN_INT(int, digit, +digits[0]) case -2: if (8 * sizeof(int) - 1 > 1 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(int, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(int) - 1 > 2 * PyLong_SHIFT) { return (int) (((int)-1)*(((((int)digits[1]) << PyLong_SHIFT) | (int)digits[0]))); } } break; case 2: if (8 * sizeof(int) > 1 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(int) - 1 > 2 * PyLong_SHIFT) { return (int) ((((((int)digits[1]) << PyLong_SHIFT) | (int)digits[0]))); } } break; case -3: if (8 * sizeof(int) - 1 > 2 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(int, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(int) - 1 > 3 * PyLong_SHIFT) { return (int) (((int)-1)*(((((((int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0]))); } } break; case 3: if (8 * sizeof(int) > 2 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(int) - 1 > 3 * PyLong_SHIFT) { return (int) ((((((((int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0]))); } } break; case -4: if (8 * sizeof(int) - 1 > 3 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(int, long, -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(int) - 1 > 4 * PyLong_SHIFT) { return (int) (((int)-1)*(((((((((int)digits[3]) << PyLong_SHIFT) | (int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0]))); } } break; case 4: if (8 * sizeof(int) > 3 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(int) - 1 > 4 * PyLong_SHIFT) { return (int) ((((((((((int)digits[3]) << PyLong_SHIFT) | (int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0]))); } } break; } #endif if (sizeof(int) <= sizeof(long)) { __PYX_VERIFY_RETURN_INT_EXC(int, long, PyLong_AsLong(x)) } else if (sizeof(int) <= sizeof(PY_LONG_LONG)) { __PYX_VERIFY_RETURN_INT_EXC(int, PY_LONG_LONG, PyLong_AsLongLong(x)) } } { #if CYTHON_COMPILING_IN_PYPY && !defined(_PyLong_AsByteArray) PyErr_SetString(PyExc_RuntimeError, "_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers"); #else int val; PyObject *v = __Pyx_PyNumber_Int(x); #if PY_MAJOR_VERSION < 3 if (likely(v) && !PyLong_Check(v)) { PyObject *tmp = v; v = PyNumber_Long(tmp); Py_DECREF(tmp); } #endif if (likely(v)) { int one = 1; int is_little = (int)*(unsigned char *)&one; unsigned char *bytes = (unsigned char *)&val; int ret = _PyLong_AsByteArray((PyLongObject *)v, bytes, sizeof(val), is_little, !is_unsigned); Py_DECREF(v); if (likely(!ret)) return val; } #endif return (int) -1; } } else { int val; PyObject *tmp = __Pyx_PyNumber_Int(x); if (!tmp) return (int) -1; val = __Pyx_PyInt_As_int(tmp); Py_DECREF(tmp); return val; } raise_overflow: PyErr_SetString(PyExc_OverflowError, "value too large to convert to int"); return (int) -1; raise_neg_overflow: PyErr_SetString(PyExc_OverflowError, "can't convert negative value to int"); return (int) -1; } static CYTHON_INLINE long __Pyx_PyInt_As_long(PyObject *x) { const long neg_one = (long) -1, const_zero = (long) 0; const int is_unsigned = neg_one > const_zero; #if PY_MAJOR_VERSION < 3 if (likely(PyInt_Check(x))) { if (sizeof(long) < sizeof(long)) { __PYX_VERIFY_RETURN_INT(long, long, PyInt_AS_LONG(x)) } else { long val = PyInt_AS_LONG(x); if (is_unsigned && unlikely(val < 0)) { goto raise_neg_overflow; } return (long) val; } } else #endif if (likely(PyLong_Check(x))) { if (is_unsigned) { #if CYTHON_USE_PYLONG_INTERNALS const digit* digits = ((PyLongObject*)x)->ob_digit; switch (Py_SIZE(x)) { case 0: return (long) 0; case 1: __PYX_VERIFY_RETURN_INT(long, digit, digits[0]) case 2: if (8 * sizeof(long) > 1 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(long) >= 2 * PyLong_SHIFT) { return (long) (((((long)digits[1]) << PyLong_SHIFT) | (long)digits[0])); } } break; case 3: if (8 * sizeof(long) > 2 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(long) >= 3 * PyLong_SHIFT) { return (long) (((((((long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0])); } } break; case 4: if (8 * sizeof(long) > 3 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(long) >= 4 * PyLong_SHIFT) { return (long) (((((((((long)digits[3]) << PyLong_SHIFT) | (long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0])); } } break; } #endif #if CYTHON_COMPILING_IN_CPYTHON if (unlikely(Py_SIZE(x) < 0)) { goto raise_neg_overflow; } #else { int result = PyObject_RichCompareBool(x, Py_False, Py_LT); if (unlikely(result < 0)) return (long) -1; if (unlikely(result == 1)) goto raise_neg_overflow; } #endif if (sizeof(long) <= sizeof(unsigned long)) { __PYX_VERIFY_RETURN_INT_EXC(long, unsigned long, PyLong_AsUnsignedLong(x)) } else if (sizeof(long) <= sizeof(unsigned PY_LONG_LONG)) { __PYX_VERIFY_RETURN_INT_EXC(long, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x)) } } else { #if CYTHON_USE_PYLONG_INTERNALS const digit* digits = ((PyLongObject*)x)->ob_digit; switch (Py_SIZE(x)) { case 0: return (long) 0; case -1: __PYX_VERIFY_RETURN_INT(long, sdigit, -(sdigit) digits[0]) case 1: __PYX_VERIFY_RETURN_INT(long, digit, +digits[0]) case -2: if (8 * sizeof(long) - 1 > 1 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(long, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) { return (long) (((long)-1)*(((((long)digits[1]) << PyLong_SHIFT) | (long)digits[0]))); } } break; case 2: if (8 * sizeof(long) > 1 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) { return (long) ((((((long)digits[1]) << PyLong_SHIFT) | (long)digits[0]))); } } break; case -3: if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(long, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) { return (long) (((long)-1)*(((((((long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0]))); } } break; case 3: if (8 * sizeof(long) > 2 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) { return (long) ((((((((long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0]))); } } break; case -4: if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(long, long, -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(long) - 1 > 4 * PyLong_SHIFT) { return (long) (((long)-1)*(((((((((long)digits[3]) << PyLong_SHIFT) | (long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0]))); } } break; case 4: if (8 * sizeof(long) > 3 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(long) - 1 > 4 * PyLong_SHIFT) { return (long) ((((((((((long)digits[3]) << PyLong_SHIFT) | (long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0]))); } } break; } #endif if (sizeof(long) <= sizeof(long)) { __PYX_VERIFY_RETURN_INT_EXC(long, long, PyLong_AsLong(x)) } else if (sizeof(long) <= sizeof(PY_LONG_LONG)) { __PYX_VERIFY_RETURN_INT_EXC(long, PY_LONG_LONG, PyLong_AsLongLong(x)) } } { #if CYTHON_COMPILING_IN_PYPY && !defined(_PyLong_AsByteArray) PyErr_SetString(PyExc_RuntimeError, "_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers"); #else long val; PyObject *v = __Pyx_PyNumber_Int(x); #if PY_MAJOR_VERSION < 3 if (likely(v) && !PyLong_Check(v)) { PyObject *tmp = v; v = PyNumber_Long(tmp); Py_DECREF(tmp); } #endif if (likely(v)) { int one = 1; int is_little = (int)*(unsigned char *)&one; unsigned char *bytes = (unsigned char *)&val; int ret = _PyLong_AsByteArray((PyLongObject *)v, bytes, sizeof(val), is_little, !is_unsigned); Py_DECREF(v); if (likely(!ret)) return val; } #endif return (long) -1; } } else { long val; PyObject *tmp = __Pyx_PyNumber_Int(x); if (!tmp) return (long) -1; val = __Pyx_PyInt_As_long(tmp); Py_DECREF(tmp); return val; } raise_overflow: PyErr_SetString(PyExc_OverflowError, "value too large to convert to long"); return (long) -1; raise_neg_overflow: PyErr_SetString(PyExc_OverflowError, "can't convert negative value to long"); return (long) -1; } static int __Pyx_check_binary_version(void) { char ctversion[4], rtversion[4]; PyOS_snprintf(ctversion, 4, "%d.%d", PY_MAJOR_VERSION, PY_MINOR_VERSION); PyOS_snprintf(rtversion, 4, "%s", Py_GetVersion()); if (ctversion[0] != rtversion[0] || ctversion[2] != rtversion[2]) { char message[200]; PyOS_snprintf(message, sizeof(message), "compiletime version %s of module '%.100s' " "does not match runtime version %s", ctversion, __Pyx_MODULE_NAME, rtversion); return PyErr_WarnEx(NULL, message, 1); } return 0; } #ifndef __PYX_HAVE_RT_ImportModule #define __PYX_HAVE_RT_ImportModule static PyObject *__Pyx_ImportModule(const char *name) { PyObject *py_name = 0; PyObject *py_module = 0; py_name = __Pyx_PyIdentifier_FromString(name); if (!py_name) goto bad; py_module = PyImport_Import(py_name); Py_DECREF(py_name); return py_module; bad: Py_XDECREF(py_name); return 0; } #endif #ifndef __PYX_HAVE_RT_ImportType #define __PYX_HAVE_RT_ImportType static PyTypeObject *__Pyx_ImportType(const char *module_name, const char *class_name, size_t size, int strict) { PyObject *py_module = 0; PyObject *result = 0; PyObject *py_name = 0; char warning[200]; Py_ssize_t basicsize; #ifdef Py_LIMITED_API PyObject *py_basicsize; #endif py_module = __Pyx_ImportModule(module_name); if (!py_module) goto bad; py_name = __Pyx_PyIdentifier_FromString(class_name); if (!py_name) goto bad; result = PyObject_GetAttr(py_module, py_name); Py_DECREF(py_name); py_name = 0; Py_DECREF(py_module); py_module = 0; if (!result) goto bad; if (!PyType_Check(result)) { PyErr_Format(PyExc_TypeError, "%.200s.%.200s is not a type object", module_name, class_name); goto bad; } #ifndef Py_LIMITED_API basicsize = ((PyTypeObject *)result)->tp_basicsize; #else py_basicsize = PyObject_GetAttrString(result, "__basicsize__"); if (!py_basicsize) goto bad; basicsize = PyLong_AsSsize_t(py_basicsize); Py_DECREF(py_basicsize); py_basicsize = 0; if (basicsize == (Py_ssize_t)-1 && PyErr_Occurred()) goto bad; #endif if (!strict && (size_t)basicsize > size) { PyOS_snprintf(warning, sizeof(warning), "%s.%s size changed, may indicate binary incompatibility", module_name, class_name); if (PyErr_WarnEx(NULL, warning, 0) < 0) goto bad; } else if ((size_t)basicsize != size) { PyErr_Format(PyExc_ValueError, "%.200s.%.200s has the wrong size, try recompiling", module_name, class_name); goto bad; } return (PyTypeObject *)result; bad: Py_XDECREF(py_module); Py_XDECREF(result); return NULL; } #endif #ifndef __PYX_HAVE_RT_ImportFunction #define __PYX_HAVE_RT_ImportFunction static int __Pyx_ImportFunction(PyObject *module, const char *funcname, void (**f)(void), const char *sig) { PyObject *d = 0; PyObject *cobj = 0; union { void (*fp)(void); void *p; } tmp; d = PyObject_GetAttrString(module, (char *)"__pyx_capi__"); if (!d) goto bad; cobj = PyDict_GetItemString(d, funcname); if (!cobj) { PyErr_Format(PyExc_ImportError, "%.200s does not export expected C function %.200s", PyModule_GetName(module), funcname); goto bad; } #if PY_VERSION_HEX >= 0x02070000 if (!PyCapsule_IsValid(cobj, sig)) { PyErr_Format(PyExc_TypeError, "C function %.200s.%.200s has wrong signature (expected %.500s, got %.500s)", PyModule_GetName(module), funcname, sig, PyCapsule_GetName(cobj)); goto bad; } tmp.p = PyCapsule_GetPointer(cobj, sig); #else {const char *desc, *s1, *s2; desc = (const char *)PyCObject_GetDesc(cobj); if (!desc) goto bad; s1 = desc; s2 = sig; while (*s1 != '\0' && *s1 == *s2) { s1++; s2++; } if (*s1 != *s2) { PyErr_Format(PyExc_TypeError, "C function %.200s.%.200s has wrong signature (expected %.500s, got %.500s)", PyModule_GetName(module), funcname, sig, desc); goto bad; } tmp.p = PyCObject_AsVoidPtr(cobj);} #endif *f = tmp.fp; if (!(*f)) goto bad; Py_DECREF(d); return 0; bad: Py_XDECREF(d); return -1; } #endif static int __Pyx_InitStrings(__Pyx_StringTabEntry *t) { while (t->p) { #if PY_MAJOR_VERSION < 3 if (t->is_unicode) { *t->p = PyUnicode_DecodeUTF8(t->s, t->n - 1, NULL); } else if (t->intern) { *t->p = PyString_InternFromString(t->s); } else { *t->p = PyString_FromStringAndSize(t->s, t->n - 1); } #else if (t->is_unicode | t->is_str) { if (t->intern) { *t->p = PyUnicode_InternFromString(t->s); } else if (t->encoding) { *t->p = PyUnicode_Decode(t->s, t->n - 1, t->encoding, NULL); } else { *t->p = PyUnicode_FromStringAndSize(t->s, t->n - 1); } } else { *t->p = PyBytes_FromStringAndSize(t->s, t->n - 1); } #endif if (!*t->p) return -1; ++t; } return 0; } static CYTHON_INLINE PyObject* __Pyx_PyUnicode_FromString(const char* c_str) { return __Pyx_PyUnicode_FromStringAndSize(c_str, (Py_ssize_t)strlen(c_str)); } static CYTHON_INLINE char* __Pyx_PyObject_AsString(PyObject* o) { Py_ssize_t ignore; return __Pyx_PyObject_AsStringAndSize(o, &ignore); } static CYTHON_INLINE char* __Pyx_PyObject_AsStringAndSize(PyObject* o, Py_ssize_t *length) { #if CYTHON_COMPILING_IN_CPYTHON && (__PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT) if ( #if PY_MAJOR_VERSION < 3 && __PYX_DEFAULT_STRING_ENCODING_IS_ASCII __Pyx_sys_getdefaultencoding_not_ascii && #endif PyUnicode_Check(o)) { #if PY_VERSION_HEX < 0x03030000 char* defenc_c; PyObject* defenc = _PyUnicode_AsDefaultEncodedString(o, NULL); if (!defenc) return NULL; defenc_c = PyBytes_AS_STRING(defenc); #if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII { char* end = defenc_c + PyBytes_GET_SIZE(defenc); char* c; for (c = defenc_c; c < end; c++) { if ((unsigned char) (*c) >= 128) { PyUnicode_AsASCIIString(o); return NULL; } } } #endif *length = PyBytes_GET_SIZE(defenc); return defenc_c; #else if (__Pyx_PyUnicode_READY(o) == -1) return NULL; #if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII if (PyUnicode_IS_ASCII(o)) { *length = PyUnicode_GET_LENGTH(o); return PyUnicode_AsUTF8(o); } else { PyUnicode_AsASCIIString(o); return NULL; } #else return PyUnicode_AsUTF8AndSize(o, length); #endif #endif } else #endif #if (!CYTHON_COMPILING_IN_PYPY) || (defined(PyByteArray_AS_STRING) && defined(PyByteArray_GET_SIZE)) if (PyByteArray_Check(o)) { *length = PyByteArray_GET_SIZE(o); return PyByteArray_AS_STRING(o); } else #endif { char* result; int r = PyBytes_AsStringAndSize(o, &result, length); if (unlikely(r < 0)) { return NULL; } else { return result; } } } static CYTHON_INLINE int __Pyx_PyObject_IsTrue(PyObject* x) { int is_true = x == Py_True; if (is_true | (x == Py_False) | (x == Py_None)) return is_true; else return PyObject_IsTrue(x); } static CYTHON_INLINE PyObject* __Pyx_PyNumber_Int(PyObject* x) { PyNumberMethods *m; const char *name = NULL; PyObject *res = NULL; #if PY_MAJOR_VERSION < 3 if (PyInt_Check(x) || PyLong_Check(x)) #else if (PyLong_Check(x)) #endif return __Pyx_NewRef(x); m = Py_TYPE(x)->tp_as_number; #if PY_MAJOR_VERSION < 3 if (m && m->nb_int) { name = "int"; res = PyNumber_Int(x); } else if (m && m->nb_long) { name = "long"; res = PyNumber_Long(x); } #else if (m && m->nb_int) { name = "int"; res = PyNumber_Long(x); } #endif if (res) { #if PY_MAJOR_VERSION < 3 if (!PyInt_Check(res) && !PyLong_Check(res)) { #else if (!PyLong_Check(res)) { #endif PyErr_Format(PyExc_TypeError, "__%.4s__ returned non-%.4s (type %.200s)", name, name, Py_TYPE(res)->tp_name); Py_DECREF(res); return NULL; } } else if (!PyErr_Occurred()) { PyErr_SetString(PyExc_TypeError, "an integer is required"); } return res; } static CYTHON_INLINE Py_ssize_t __Pyx_PyIndex_AsSsize_t(PyObject* b) { Py_ssize_t ival; PyObject *x; #if PY_MAJOR_VERSION < 3 if (likely(PyInt_CheckExact(b))) { if (sizeof(Py_ssize_t) >= sizeof(long)) return PyInt_AS_LONG(b); else return PyInt_AsSsize_t(x); } #endif if (likely(PyLong_CheckExact(b))) { #if CYTHON_USE_PYLONG_INTERNALS const digit* digits = ((PyLongObject*)b)->ob_digit; const Py_ssize_t size = Py_SIZE(b); if (likely(__Pyx_sst_abs(size) <= 1)) { ival = likely(size) ? digits[0] : 0; if (size == -1) ival = -ival; return ival; } else { switch (size) { case 2: if (8 * sizeof(Py_ssize_t) > 2 * PyLong_SHIFT) { return (Py_ssize_t) (((((size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])); } break; case -2: if (8 * sizeof(Py_ssize_t) > 2 * PyLong_SHIFT) { return -(Py_ssize_t) (((((size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])); } break; case 3: if (8 * sizeof(Py_ssize_t) > 3 * PyLong_SHIFT) { return (Py_ssize_t) (((((((size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])); } break; case -3: if (8 * sizeof(Py_ssize_t) > 3 * PyLong_SHIFT) { return -(Py_ssize_t) (((((((size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])); } break; case 4: if (8 * sizeof(Py_ssize_t) > 4 * PyLong_SHIFT) { return (Py_ssize_t) (((((((((size_t)digits[3]) << PyLong_SHIFT) | (size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])); } break; case -4: if (8 * sizeof(Py_ssize_t) > 4 * PyLong_SHIFT) { return -(Py_ssize_t) (((((((((size_t)digits[3]) << PyLong_SHIFT) | (size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])); } break; } } #endif return PyLong_AsSsize_t(b); } x = PyNumber_Index(b); if (!x) return -1; ival = PyInt_AsSsize_t(x); Py_DECREF(x); return ival; } static CYTHON_INLINE PyObject * __Pyx_PyInt_FromSize_t(size_t ival) { return PyInt_FromSize_t(ival); } #endif /* Py_PYTHON_H */ pygame_sdl2-2.1.0-for-renpy-6.99.14.1/gen3/pygame_sdl2.pygame_time.c0000664000175000017500000074537212665223542024004 0ustar tomtom00000000000000/* Generated by Cython 0.23.3 */ #define PY_SSIZE_T_CLEAN #include "Python.h" #ifndef Py_PYTHON_H #error Python headers needed to compile C extensions, please install development version of Python. #elif PY_VERSION_HEX < 0x02060000 || (0x03000000 <= PY_VERSION_HEX && PY_VERSION_HEX < 0x03020000) #error Cython requires Python 2.6+ or Python 3.2+. #else #define CYTHON_ABI "0_23_3" #include #ifndef offsetof #define offsetof(type, member) ( (size_t) & ((type*)0) -> member ) #endif #if !defined(WIN32) && !defined(MS_WINDOWS) #ifndef __stdcall #define __stdcall #endif #ifndef __cdecl #define __cdecl #endif #ifndef __fastcall #define __fastcall #endif #endif #ifndef DL_IMPORT #define DL_IMPORT(t) t #endif #ifndef DL_EXPORT #define DL_EXPORT(t) t #endif #ifndef PY_LONG_LONG #define PY_LONG_LONG LONG_LONG #endif #ifndef Py_HUGE_VAL #define Py_HUGE_VAL HUGE_VAL #endif #ifdef PYPY_VERSION #define CYTHON_COMPILING_IN_PYPY 1 #define CYTHON_COMPILING_IN_CPYTHON 0 #else #define CYTHON_COMPILING_IN_PYPY 0 #define CYTHON_COMPILING_IN_CPYTHON 1 #endif #if !defined(CYTHON_USE_PYLONG_INTERNALS) && CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x02070000 #define CYTHON_USE_PYLONG_INTERNALS 1 #endif #if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX < 0x02070600 && !defined(Py_OptimizeFlag) #define Py_OptimizeFlag 0 #endif #define __PYX_BUILD_PY_SSIZE_T "n" #define CYTHON_FORMAT_SSIZE_T "z" #if PY_MAJOR_VERSION < 3 #define __Pyx_BUILTIN_MODULE_NAME "__builtin__" #define __Pyx_PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)\ PyCode_New(a+k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos) #define __Pyx_DefaultClassType PyClass_Type #else #define __Pyx_BUILTIN_MODULE_NAME "builtins" #define __Pyx_PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)\ PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos) #define __Pyx_DefaultClassType PyType_Type #endif #ifndef Py_TPFLAGS_CHECKTYPES #define Py_TPFLAGS_CHECKTYPES 0 #endif #ifndef Py_TPFLAGS_HAVE_INDEX #define Py_TPFLAGS_HAVE_INDEX 0 #endif #ifndef Py_TPFLAGS_HAVE_NEWBUFFER #define Py_TPFLAGS_HAVE_NEWBUFFER 0 #endif #ifndef Py_TPFLAGS_HAVE_FINALIZE #define Py_TPFLAGS_HAVE_FINALIZE 0 #endif #if PY_VERSION_HEX > 0x03030000 && defined(PyUnicode_KIND) #define CYTHON_PEP393_ENABLED 1 #define __Pyx_PyUnicode_READY(op) (likely(PyUnicode_IS_READY(op)) ?\ 0 : _PyUnicode_Ready((PyObject *)(op))) #define __Pyx_PyUnicode_GET_LENGTH(u) PyUnicode_GET_LENGTH(u) #define __Pyx_PyUnicode_READ_CHAR(u, i) PyUnicode_READ_CHAR(u, i) #define __Pyx_PyUnicode_KIND(u) PyUnicode_KIND(u) #define __Pyx_PyUnicode_DATA(u) PyUnicode_DATA(u) #define __Pyx_PyUnicode_READ(k, d, i) PyUnicode_READ(k, d, i) #else #define CYTHON_PEP393_ENABLED 0 #define __Pyx_PyUnicode_READY(op) (0) #define __Pyx_PyUnicode_GET_LENGTH(u) PyUnicode_GET_SIZE(u) #define __Pyx_PyUnicode_READ_CHAR(u, i) ((Py_UCS4)(PyUnicode_AS_UNICODE(u)[i])) #define __Pyx_PyUnicode_KIND(u) (sizeof(Py_UNICODE)) #define __Pyx_PyUnicode_DATA(u) ((void*)PyUnicode_AS_UNICODE(u)) #define __Pyx_PyUnicode_READ(k, d, i) ((void)(k), (Py_UCS4)(((Py_UNICODE*)d)[i])) #endif #if CYTHON_COMPILING_IN_PYPY #define __Pyx_PyUnicode_Concat(a, b) PyNumber_Add(a, b) #define __Pyx_PyUnicode_ConcatSafe(a, b) PyNumber_Add(a, b) #else #define __Pyx_PyUnicode_Concat(a, b) PyUnicode_Concat(a, b) #define __Pyx_PyUnicode_ConcatSafe(a, b) ((unlikely((a) == Py_None) || unlikely((b) == Py_None)) ?\ PyNumber_Add(a, b) : __Pyx_PyUnicode_Concat(a, b)) #endif #if CYTHON_COMPILING_IN_PYPY && !defined(PyUnicode_Contains) #define PyUnicode_Contains(u, s) PySequence_Contains(u, s) #endif #define __Pyx_PyString_FormatSafe(a, b) ((unlikely((a) == Py_None)) ? PyNumber_Remainder(a, b) : __Pyx_PyString_Format(a, b)) #define __Pyx_PyUnicode_FormatSafe(a, b) ((unlikely((a) == Py_None)) ? PyNumber_Remainder(a, b) : PyUnicode_Format(a, b)) #if PY_MAJOR_VERSION >= 3 #define __Pyx_PyString_Format(a, b) PyUnicode_Format(a, b) #else #define __Pyx_PyString_Format(a, b) PyString_Format(a, b) #endif #if PY_MAJOR_VERSION >= 3 #define PyBaseString_Type PyUnicode_Type #define PyStringObject PyUnicodeObject #define PyString_Type PyUnicode_Type #define PyString_Check PyUnicode_Check #define PyString_CheckExact PyUnicode_CheckExact #endif #if PY_MAJOR_VERSION >= 3 #define __Pyx_PyBaseString_Check(obj) PyUnicode_Check(obj) #define __Pyx_PyBaseString_CheckExact(obj) PyUnicode_CheckExact(obj) #else #define __Pyx_PyBaseString_Check(obj) (PyString_Check(obj) || PyUnicode_Check(obj)) #define __Pyx_PyBaseString_CheckExact(obj) (PyString_CheckExact(obj) || PyUnicode_CheckExact(obj)) #endif #ifndef PySet_CheckExact #define PySet_CheckExact(obj) (Py_TYPE(obj) == &PySet_Type) #endif #define __Pyx_TypeCheck(obj, type) PyObject_TypeCheck(obj, (PyTypeObject *)type) #if PY_MAJOR_VERSION >= 3 #define PyIntObject PyLongObject #define PyInt_Type PyLong_Type #define PyInt_Check(op) PyLong_Check(op) #define PyInt_CheckExact(op) PyLong_CheckExact(op) #define PyInt_FromString PyLong_FromString #define PyInt_FromUnicode PyLong_FromUnicode #define PyInt_FromLong PyLong_FromLong #define PyInt_FromSize_t PyLong_FromSize_t #define PyInt_FromSsize_t PyLong_FromSsize_t #define PyInt_AsLong PyLong_AsLong #define PyInt_AS_LONG PyLong_AS_LONG #define PyInt_AsSsize_t PyLong_AsSsize_t #define PyInt_AsUnsignedLongMask PyLong_AsUnsignedLongMask #define PyInt_AsUnsignedLongLongMask PyLong_AsUnsignedLongLongMask #define PyNumber_Int PyNumber_Long #endif #if PY_MAJOR_VERSION >= 3 #define PyBoolObject PyLongObject #endif #if PY_MAJOR_VERSION >= 3 && CYTHON_COMPILING_IN_PYPY #ifndef PyUnicode_InternFromString #define PyUnicode_InternFromString(s) PyUnicode_FromString(s) #endif #endif #if PY_VERSION_HEX < 0x030200A4 typedef long Py_hash_t; #define __Pyx_PyInt_FromHash_t PyInt_FromLong #define __Pyx_PyInt_AsHash_t PyInt_AsLong #else #define __Pyx_PyInt_FromHash_t PyInt_FromSsize_t #define __Pyx_PyInt_AsHash_t PyInt_AsSsize_t #endif #if PY_MAJOR_VERSION >= 3 #define __Pyx_PyMethod_New(func, self, klass) ((self) ? PyMethod_New(func, self) : PyInstanceMethod_New(func)) #else #define __Pyx_PyMethod_New(func, self, klass) PyMethod_New(func, self, klass) #endif #if PY_VERSION_HEX >= 0x030500B1 #define __Pyx_PyAsyncMethodsStruct PyAsyncMethods #define __Pyx_PyType_AsAsync(obj) (Py_TYPE(obj)->tp_as_async) #elif CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3 typedef struct { unaryfunc am_await; unaryfunc am_aiter; unaryfunc am_anext; } __Pyx_PyAsyncMethodsStruct; #define __Pyx_PyType_AsAsync(obj) ((__Pyx_PyAsyncMethodsStruct*) (Py_TYPE(obj)->tp_reserved)) #else #define __Pyx_PyType_AsAsync(obj) NULL #endif #ifndef CYTHON_RESTRICT #if defined(__GNUC__) #define CYTHON_RESTRICT __restrict__ #elif defined(_MSC_VER) && _MSC_VER >= 1400 #define CYTHON_RESTRICT __restrict #elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L #define CYTHON_RESTRICT restrict #else #define CYTHON_RESTRICT #endif #endif #define __Pyx_void_to_None(void_result) (void_result, Py_INCREF(Py_None), Py_None) #ifndef CYTHON_INLINE #if defined(__GNUC__) #define CYTHON_INLINE __inline__ #elif defined(_MSC_VER) #define CYTHON_INLINE __inline #elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L #define CYTHON_INLINE inline #else #define CYTHON_INLINE #endif #endif #if defined(WIN32) || defined(MS_WINDOWS) #define _USE_MATH_DEFINES #endif #include #ifdef NAN #define __PYX_NAN() ((float) NAN) #else static CYTHON_INLINE float __PYX_NAN() { float value; memset(&value, 0xFF, sizeof(value)); return value; } #endif #if PY_MAJOR_VERSION >= 3 #define __Pyx_PyNumber_Divide(x,y) PyNumber_TrueDivide(x,y) #define __Pyx_PyNumber_InPlaceDivide(x,y) PyNumber_InPlaceTrueDivide(x,y) #else #define __Pyx_PyNumber_Divide(x,y) PyNumber_TrueDivide(x,y) #define __Pyx_PyNumber_InPlaceDivide(x,y) PyNumber_InPlaceTrueDivide(x,y) #endif #ifndef __PYX_EXTERN_C #ifdef __cplusplus #define __PYX_EXTERN_C extern "C" #else #define __PYX_EXTERN_C extern #endif #endif #define __PYX_HAVE__pygame_sdl2__pygame_time #define __PYX_HAVE_API__pygame_sdl2__pygame_time #include "stdint.h" #include "string.h" #include "stdio.h" #include "stddef.h" #include "SDL.h" #ifdef _OPENMP #include #endif /* _OPENMP */ #ifdef PYREX_WITHOUT_ASSERTIONS #define CYTHON_WITHOUT_ASSERTIONS #endif #ifndef CYTHON_UNUSED # if defined(__GNUC__) # if !(defined(__cplusplus)) || (__GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 4)) # define CYTHON_UNUSED __attribute__ ((__unused__)) # else # define CYTHON_UNUSED # endif # elif defined(__ICC) || (defined(__INTEL_COMPILER) && !defined(_MSC_VER)) # define CYTHON_UNUSED __attribute__ ((__unused__)) # else # define CYTHON_UNUSED # endif #endif #ifndef CYTHON_NCP_UNUSED # if CYTHON_COMPILING_IN_CPYTHON # define CYTHON_NCP_UNUSED # else # define CYTHON_NCP_UNUSED CYTHON_UNUSED # endif #endif typedef struct {PyObject **p; char *s; const Py_ssize_t n; const char* encoding; const char is_unicode; const char is_str; const char intern; } __Pyx_StringTabEntry; #define __PYX_DEFAULT_STRING_ENCODING_IS_ASCII 0 #define __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT 0 #define __PYX_DEFAULT_STRING_ENCODING "" #define __Pyx_PyObject_FromString __Pyx_PyBytes_FromString #define __Pyx_PyObject_FromStringAndSize __Pyx_PyBytes_FromStringAndSize #define __Pyx_uchar_cast(c) ((unsigned char)c) #define __Pyx_long_cast(x) ((long)x) #define __Pyx_fits_Py_ssize_t(v, type, is_signed) (\ (sizeof(type) < sizeof(Py_ssize_t)) ||\ (sizeof(type) > sizeof(Py_ssize_t) &&\ likely(v < (type)PY_SSIZE_T_MAX ||\ v == (type)PY_SSIZE_T_MAX) &&\ (!is_signed || likely(v > (type)PY_SSIZE_T_MIN ||\ v == (type)PY_SSIZE_T_MIN))) ||\ (sizeof(type) == sizeof(Py_ssize_t) &&\ (is_signed || likely(v < (type)PY_SSIZE_T_MAX ||\ v == (type)PY_SSIZE_T_MAX))) ) #if defined (__cplusplus) && __cplusplus >= 201103L #include #define __Pyx_sst_abs(value) std::abs(value) #elif SIZEOF_INT >= SIZEOF_SIZE_T #define __Pyx_sst_abs(value) abs(value) #elif SIZEOF_LONG >= SIZEOF_SIZE_T #define __Pyx_sst_abs(value) labs(value) #elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L #define __Pyx_sst_abs(value) llabs(value) #elif defined (_MSC_VER) && defined (_M_X64) #define __Pyx_sst_abs(value) _abs64(value) #elif defined (__GNUC__) #define __Pyx_sst_abs(value) __builtin_llabs(value) #else #define __Pyx_sst_abs(value) ((value<0) ? -value : value) #endif static CYTHON_INLINE char* __Pyx_PyObject_AsString(PyObject*); static CYTHON_INLINE char* __Pyx_PyObject_AsStringAndSize(PyObject*, Py_ssize_t* length); #define __Pyx_PyByteArray_FromString(s) PyByteArray_FromStringAndSize((const char*)s, strlen((const char*)s)) #define __Pyx_PyByteArray_FromStringAndSize(s, l) PyByteArray_FromStringAndSize((const char*)s, l) #define __Pyx_PyBytes_FromString PyBytes_FromString #define __Pyx_PyBytes_FromStringAndSize PyBytes_FromStringAndSize static CYTHON_INLINE PyObject* __Pyx_PyUnicode_FromString(const char*); #if PY_MAJOR_VERSION < 3 #define __Pyx_PyStr_FromString __Pyx_PyBytes_FromString #define __Pyx_PyStr_FromStringAndSize __Pyx_PyBytes_FromStringAndSize #else #define __Pyx_PyStr_FromString __Pyx_PyUnicode_FromString #define __Pyx_PyStr_FromStringAndSize __Pyx_PyUnicode_FromStringAndSize #endif #define __Pyx_PyObject_AsSString(s) ((signed char*) __Pyx_PyObject_AsString(s)) #define __Pyx_PyObject_AsUString(s) ((unsigned char*) __Pyx_PyObject_AsString(s)) #define __Pyx_PyObject_FromCString(s) __Pyx_PyObject_FromString((const char*)s) #define __Pyx_PyBytes_FromCString(s) __Pyx_PyBytes_FromString((const char*)s) #define __Pyx_PyByteArray_FromCString(s) __Pyx_PyByteArray_FromString((const char*)s) #define __Pyx_PyStr_FromCString(s) __Pyx_PyStr_FromString((const char*)s) #define __Pyx_PyUnicode_FromCString(s) __Pyx_PyUnicode_FromString((const char*)s) #if PY_MAJOR_VERSION < 3 static CYTHON_INLINE size_t __Pyx_Py_UNICODE_strlen(const Py_UNICODE *u) { const Py_UNICODE *u_end = u; while (*u_end++) ; return (size_t)(u_end - u - 1); } #else #define __Pyx_Py_UNICODE_strlen Py_UNICODE_strlen #endif #define __Pyx_PyUnicode_FromUnicode(u) PyUnicode_FromUnicode(u, __Pyx_Py_UNICODE_strlen(u)) #define __Pyx_PyUnicode_FromUnicodeAndLength PyUnicode_FromUnicode #define __Pyx_PyUnicode_AsUnicode PyUnicode_AsUnicode #define __Pyx_NewRef(obj) (Py_INCREF(obj), obj) #define __Pyx_Owned_Py_None(b) __Pyx_NewRef(Py_None) #define __Pyx_PyBool_FromLong(b) ((b) ? __Pyx_NewRef(Py_True) : __Pyx_NewRef(Py_False)) static CYTHON_INLINE int __Pyx_PyObject_IsTrue(PyObject*); static CYTHON_INLINE PyObject* __Pyx_PyNumber_Int(PyObject* x); static CYTHON_INLINE Py_ssize_t __Pyx_PyIndex_AsSsize_t(PyObject*); static CYTHON_INLINE PyObject * __Pyx_PyInt_FromSize_t(size_t); #if CYTHON_COMPILING_IN_CPYTHON #define __pyx_PyFloat_AsDouble(x) (PyFloat_CheckExact(x) ? PyFloat_AS_DOUBLE(x) : PyFloat_AsDouble(x)) #else #define __pyx_PyFloat_AsDouble(x) PyFloat_AsDouble(x) #endif #define __pyx_PyFloat_AsFloat(x) ((float) __pyx_PyFloat_AsDouble(x)) #if PY_MAJOR_VERSION < 3 && __PYX_DEFAULT_STRING_ENCODING_IS_ASCII static int __Pyx_sys_getdefaultencoding_not_ascii; static int __Pyx_init_sys_getdefaultencoding_params(void) { PyObject* sys; PyObject* default_encoding = NULL; PyObject* ascii_chars_u = NULL; PyObject* ascii_chars_b = NULL; const char* default_encoding_c; sys = PyImport_ImportModule("sys"); if (!sys) goto bad; default_encoding = PyObject_CallMethod(sys, (char*) "getdefaultencoding", NULL); Py_DECREF(sys); if (!default_encoding) goto bad; default_encoding_c = PyBytes_AsString(default_encoding); if (!default_encoding_c) goto bad; if (strcmp(default_encoding_c, "ascii") == 0) { __Pyx_sys_getdefaultencoding_not_ascii = 0; } else { char ascii_chars[128]; int c; for (c = 0; c < 128; c++) { ascii_chars[c] = c; } __Pyx_sys_getdefaultencoding_not_ascii = 1; ascii_chars_u = PyUnicode_DecodeASCII(ascii_chars, 128, NULL); if (!ascii_chars_u) goto bad; ascii_chars_b = PyUnicode_AsEncodedString(ascii_chars_u, default_encoding_c, NULL); if (!ascii_chars_b || !PyBytes_Check(ascii_chars_b) || memcmp(ascii_chars, PyBytes_AS_STRING(ascii_chars_b), 128) != 0) { PyErr_Format( PyExc_ValueError, "This module compiled with c_string_encoding=ascii, but default encoding '%.200s' is not a superset of ascii.", default_encoding_c); goto bad; } Py_DECREF(ascii_chars_u); Py_DECREF(ascii_chars_b); } Py_DECREF(default_encoding); return 0; bad: Py_XDECREF(default_encoding); Py_XDECREF(ascii_chars_u); Py_XDECREF(ascii_chars_b); return -1; } #endif #if __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT && PY_MAJOR_VERSION >= 3 #define __Pyx_PyUnicode_FromStringAndSize(c_str, size) PyUnicode_DecodeUTF8(c_str, size, NULL) #else #define __Pyx_PyUnicode_FromStringAndSize(c_str, size) PyUnicode_Decode(c_str, size, __PYX_DEFAULT_STRING_ENCODING, NULL) #if __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT static char* __PYX_DEFAULT_STRING_ENCODING; static int __Pyx_init_sys_getdefaultencoding_params(void) { PyObject* sys; PyObject* default_encoding = NULL; char* default_encoding_c; sys = PyImport_ImportModule("sys"); if (!sys) goto bad; default_encoding = PyObject_CallMethod(sys, (char*) (const char*) "getdefaultencoding", NULL); Py_DECREF(sys); if (!default_encoding) goto bad; default_encoding_c = PyBytes_AsString(default_encoding); if (!default_encoding_c) goto bad; __PYX_DEFAULT_STRING_ENCODING = (char*) malloc(strlen(default_encoding_c)); if (!__PYX_DEFAULT_STRING_ENCODING) goto bad; strcpy(__PYX_DEFAULT_STRING_ENCODING, default_encoding_c); Py_DECREF(default_encoding); return 0; bad: Py_XDECREF(default_encoding); return -1; } #endif #endif /* Test for GCC > 2.95 */ #if defined(__GNUC__) && (__GNUC__ > 2 || (__GNUC__ == 2 && (__GNUC_MINOR__ > 95))) #define likely(x) __builtin_expect(!!(x), 1) #define unlikely(x) __builtin_expect(!!(x), 0) #else /* !__GNUC__ or GCC < 2.95 */ #define likely(x) (x) #define unlikely(x) (x) #endif /* __GNUC__ */ static PyObject *__pyx_m; static PyObject *__pyx_d; static PyObject *__pyx_b; static PyObject *__pyx_empty_tuple; static PyObject *__pyx_empty_bytes; static int __pyx_lineno; static int __pyx_clineno = 0; static const char * __pyx_cfilenm= __FILE__; static const char *__pyx_filename; static const char *__pyx_f[] = { "src/pygame_sdl2/pygame_time.pyx", }; /*--- Type declarations ---*/ /* --- Runtime support code (head) --- */ #ifndef CYTHON_REFNANNY #define CYTHON_REFNANNY 0 #endif #if CYTHON_REFNANNY typedef struct { void (*INCREF)(void*, PyObject*, int); void (*DECREF)(void*, PyObject*, int); void (*GOTREF)(void*, PyObject*, int); void (*GIVEREF)(void*, PyObject*, int); void* (*SetupContext)(const char*, int, const char*); void (*FinishContext)(void**); } __Pyx_RefNannyAPIStruct; static __Pyx_RefNannyAPIStruct *__Pyx_RefNanny = NULL; static __Pyx_RefNannyAPIStruct *__Pyx_RefNannyImportAPI(const char *modname); #define __Pyx_RefNannyDeclarations void *__pyx_refnanny = NULL; #ifdef WITH_THREAD #define __Pyx_RefNannySetupContext(name, acquire_gil)\ if (acquire_gil) {\ PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure();\ __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), __LINE__, __FILE__);\ PyGILState_Release(__pyx_gilstate_save);\ } else {\ __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), __LINE__, __FILE__);\ } #else #define __Pyx_RefNannySetupContext(name, acquire_gil)\ __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), __LINE__, __FILE__) #endif #define __Pyx_RefNannyFinishContext()\ __Pyx_RefNanny->FinishContext(&__pyx_refnanny) #define __Pyx_INCREF(r) __Pyx_RefNanny->INCREF(__pyx_refnanny, (PyObject *)(r), __LINE__) #define __Pyx_DECREF(r) __Pyx_RefNanny->DECREF(__pyx_refnanny, (PyObject *)(r), __LINE__) #define __Pyx_GOTREF(r) __Pyx_RefNanny->GOTREF(__pyx_refnanny, (PyObject *)(r), __LINE__) #define __Pyx_GIVEREF(r) __Pyx_RefNanny->GIVEREF(__pyx_refnanny, (PyObject *)(r), __LINE__) #define __Pyx_XINCREF(r) do { if((r) != NULL) {__Pyx_INCREF(r); }} while(0) #define __Pyx_XDECREF(r) do { if((r) != NULL) {__Pyx_DECREF(r); }} while(0) #define __Pyx_XGOTREF(r) do { if((r) != NULL) {__Pyx_GOTREF(r); }} while(0) #define __Pyx_XGIVEREF(r) do { if((r) != NULL) {__Pyx_GIVEREF(r);}} while(0) #else #define __Pyx_RefNannyDeclarations #define __Pyx_RefNannySetupContext(name, acquire_gil) #define __Pyx_RefNannyFinishContext() #define __Pyx_INCREF(r) Py_INCREF(r) #define __Pyx_DECREF(r) Py_DECREF(r) #define __Pyx_GOTREF(r) #define __Pyx_GIVEREF(r) #define __Pyx_XINCREF(r) Py_XINCREF(r) #define __Pyx_XDECREF(r) Py_XDECREF(r) #define __Pyx_XGOTREF(r) #define __Pyx_XGIVEREF(r) #endif #define __Pyx_XDECREF_SET(r, v) do {\ PyObject *tmp = (PyObject *) r;\ r = v; __Pyx_XDECREF(tmp);\ } while (0) #define __Pyx_DECREF_SET(r, v) do {\ PyObject *tmp = (PyObject *) r;\ r = v; __Pyx_DECREF(tmp);\ } while (0) #define __Pyx_CLEAR(r) do { PyObject* tmp = ((PyObject*)(r)); r = NULL; __Pyx_DECREF(tmp);} while(0) #define __Pyx_XCLEAR(r) do { if((r) != NULL) {PyObject* tmp = ((PyObject*)(r)); r = NULL; __Pyx_DECREF(tmp);}} while(0) #if CYTHON_COMPILING_IN_CPYTHON static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStr(PyObject* obj, PyObject* attr_name) { PyTypeObject* tp = Py_TYPE(obj); if (likely(tp->tp_getattro)) return tp->tp_getattro(obj, attr_name); #if PY_MAJOR_VERSION < 3 if (likely(tp->tp_getattr)) return tp->tp_getattr(obj, PyString_AS_STRING(attr_name)); #endif return PyObject_GetAttr(obj, attr_name); } #else #define __Pyx_PyObject_GetAttrStr(o,n) PyObject_GetAttr(o,n) #endif static PyObject *__Pyx_GetBuiltinName(PyObject *name); static CYTHON_INLINE PyObject *__Pyx_GetModuleGlobalName(PyObject *name); #if CYTHON_COMPILING_IN_CPYTHON static CYTHON_INLINE PyObject* __Pyx_PyObject_Call(PyObject *func, PyObject *arg, PyObject *kw); #else #define __Pyx_PyObject_Call(func, arg, kw) PyObject_Call(func, arg, kw) #endif #if CYTHON_COMPILING_IN_CPYTHON static CYTHON_INLINE PyObject* __Pyx_PyObject_CallMethO(PyObject *func, PyObject *arg); #endif static CYTHON_INLINE PyObject* __Pyx_PyObject_CallOneArg(PyObject *func, PyObject *arg); #if CYTHON_COMPILING_IN_CPYTHON static CYTHON_INLINE PyObject* __Pyx_PyObject_CallNoArg(PyObject *func); #else #define __Pyx_PyObject_CallNoArg(func) __Pyx_PyObject_Call(func, __pyx_empty_tuple, NULL) #endif static CYTHON_INLINE void __Pyx_ErrRestore(PyObject *type, PyObject *value, PyObject *tb); static CYTHON_INLINE void __Pyx_ErrFetch(PyObject **type, PyObject **value, PyObject **tb); static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, PyObject *cause); static void __Pyx_RaiseArgtupleInvalid(const char* func_name, int exact, Py_ssize_t num_min, Py_ssize_t num_max, Py_ssize_t num_found); static void __Pyx_RaiseDoubleKeywordsError(const char* func_name, PyObject* kw_name); static int __Pyx_ParseOptionalKeywords(PyObject *kwds, PyObject **argnames[],\ PyObject *kwds2, PyObject *values[], Py_ssize_t num_pos_args,\ const char* function_name); static PyObject* __Pyx_PyDict_GetItemDefault(PyObject* d, PyObject* key, PyObject* default_value); #if CYTHON_COMPILING_IN_CPYTHON #define __Pyx_PyObject_DelAttrStr(o,n) __Pyx_PyObject_SetAttrStr(o,n,NULL) static CYTHON_INLINE int __Pyx_PyObject_SetAttrStr(PyObject* obj, PyObject* attr_name, PyObject* value) { PyTypeObject* tp = Py_TYPE(obj); if (likely(tp->tp_setattro)) return tp->tp_setattro(obj, attr_name, value); #if PY_MAJOR_VERSION < 3 if (likely(tp->tp_setattr)) return tp->tp_setattr(obj, PyString_AS_STRING(attr_name), value); #endif return PyObject_SetAttr(obj, attr_name, value); } #else #define __Pyx_PyObject_DelAttrStr(o,n) PyObject_DelAttr(o,n) #define __Pyx_PyObject_SetAttrStr(o,n,v) PyObject_SetAttr(o,n,v) #endif static PyObject* __Pyx_PyObject_CallMethod1(PyObject* obj, PyObject* method_name, PyObject* arg); static PyObject* __Pyx__PyObject_PopNewIndex(PyObject* L, PyObject* py_ix); static PyObject* __Pyx__PyObject_PopIndex(PyObject* L, PyObject* py_ix); #if CYTHON_COMPILING_IN_CPYTHON static PyObject* __Pyx__PyList_PopIndex(PyObject* L, PyObject* py_ix, Py_ssize_t ix); #define __Pyx_PyObject_PopIndex(L, py_ix, ix, is_signed, type, to_py_func) (\ (likely(PyList_CheckExact(L) && __Pyx_fits_Py_ssize_t(ix, type, is_signed))) ?\ __Pyx__PyList_PopIndex(L, py_ix, ix) : (\ (unlikely(py_ix == Py_None)) ? __Pyx__PyObject_PopNewIndex(L, to_py_func(ix)) :\ __Pyx__PyObject_PopIndex(L, py_ix))) #define __Pyx_PyList_PopIndex(L, py_ix, ix, is_signed, type, to_py_func) (\ __Pyx_fits_Py_ssize_t(ix, type, is_signed) ?\ __Pyx__PyList_PopIndex(L, py_ix, ix) : (\ (unlikely(py_ix == Py_None)) ? __Pyx__PyObject_PopNewIndex(L, to_py_func(ix)) :\ __Pyx__PyObject_PopIndex(L, py_ix))) #else #define __Pyx_PyList_PopIndex(L, py_ix, ix, is_signed, type, to_py_func)\ __Pyx_PyObject_PopIndex(L, py_ix, ix, is_signed, type, to_py_func) #define __Pyx_PyObject_PopIndex(L, py_ix, ix, is_signed, type, to_py_func) (\ (unlikely(py_ix == Py_None)) ? __Pyx__PyObject_PopNewIndex(L, to_py_func(ix)) :\ __Pyx__PyObject_PopIndex(L, py_ix)) #endif #if CYTHON_COMPILING_IN_CPYTHON static PyObject* __Pyx_PyInt_EqObjC(PyObject *op1, PyObject *op2, long intval, int inplace); #else #define __Pyx_PyInt_EqObjC(op1, op2, intval, inplace)\ PyObject_RichCompare(op1, op2, Py_EQ) #endif #if CYTHON_COMPILING_IN_CPYTHON static CYTHON_INLINE int __Pyx_PyList_Append(PyObject* list, PyObject* x) { PyListObject* L = (PyListObject*) list; Py_ssize_t len = Py_SIZE(list); if (likely(L->allocated > len) & likely(len > (L->allocated >> 1))) { Py_INCREF(x); PyList_SET_ITEM(list, len, x); Py_SIZE(list) = len+1; return 0; } return PyList_Append(list, x); } #else #define __Pyx_PyList_Append(L,x) PyList_Append(L,x) #endif static CYTHON_INLINE int __Pyx_PyObject_Append(PyObject* L, PyObject* x); #if CYTHON_COMPILING_IN_CPYTHON static PyObject* __Pyx_PyFloat_TrueDivideCObj(PyObject *op1, PyObject *op2, double floatval, int inplace); #else #define __Pyx_PyFloat_TrueDivideCObj(op1, op2, floatval, inplace)\ (inplace ? PyNumber_InPlaceTrueDivide(op1, op2) : PyNumber_TrueDivide(op1, op2)) #endif static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list, int level); static PyObject* __Pyx_ImportFrom(PyObject* module, PyObject* name); static PyTypeObject* __Pyx_FetchCommonType(PyTypeObject* type); #define __Pyx_CyFunction_USED 1 #include #define __Pyx_CYFUNCTION_STATICMETHOD 0x01 #define __Pyx_CYFUNCTION_CLASSMETHOD 0x02 #define __Pyx_CYFUNCTION_CCLASS 0x04 #define __Pyx_CyFunction_GetClosure(f)\ (((__pyx_CyFunctionObject *) (f))->func_closure) #define __Pyx_CyFunction_GetClassObj(f)\ (((__pyx_CyFunctionObject *) (f))->func_classobj) #define __Pyx_CyFunction_Defaults(type, f)\ ((type *)(((__pyx_CyFunctionObject *) (f))->defaults)) #define __Pyx_CyFunction_SetDefaultsGetter(f, g)\ ((__pyx_CyFunctionObject *) (f))->defaults_getter = (g) typedef struct { PyCFunctionObject func; #if PY_VERSION_HEX < 0x030500A0 PyObject *func_weakreflist; #endif PyObject *func_dict; PyObject *func_name; PyObject *func_qualname; PyObject *func_doc; PyObject *func_globals; PyObject *func_code; PyObject *func_closure; PyObject *func_classobj; void *defaults; int defaults_pyobjects; int flags; PyObject *defaults_tuple; PyObject *defaults_kwdict; PyObject *(*defaults_getter)(PyObject *); PyObject *func_annotations; } __pyx_CyFunctionObject; static PyTypeObject *__pyx_CyFunctionType = 0; #define __Pyx_CyFunction_NewEx(ml, flags, qualname, self, module, globals, code)\ __Pyx_CyFunction_New(__pyx_CyFunctionType, ml, flags, qualname, self, module, globals, code) static PyObject *__Pyx_CyFunction_New(PyTypeObject *, PyMethodDef *ml, int flags, PyObject* qualname, PyObject *self, PyObject *module, PyObject *globals, PyObject* code); static CYTHON_INLINE void *__Pyx_CyFunction_InitDefaults(PyObject *m, size_t size, int pyobjects); static CYTHON_INLINE void __Pyx_CyFunction_SetDefaultsTuple(PyObject *m, PyObject *tuple); static CYTHON_INLINE void __Pyx_CyFunction_SetDefaultsKwDict(PyObject *m, PyObject *dict); static CYTHON_INLINE void __Pyx_CyFunction_SetAnnotationsDict(PyObject *m, PyObject *dict); static int __pyx_CyFunction_init(void); static PyObject *__Pyx_CalculateMetaclass(PyTypeObject *metaclass, PyObject *bases); static PyObject *__Pyx_Py3MetaclassPrepare(PyObject *metaclass, PyObject *bases, PyObject *name, PyObject *qualname, PyObject *mkw, PyObject *modname, PyObject *doc); static PyObject *__Pyx_Py3ClassCreate(PyObject *metaclass, PyObject *name, PyObject *bases, PyObject *dict, PyObject *mkw, int calculate_metaclass, int allow_py2_metaclass); typedef struct { int code_line; PyCodeObject* code_object; } __Pyx_CodeObjectCacheEntry; struct __Pyx_CodeObjectCache { int count; int max_count; __Pyx_CodeObjectCacheEntry* entries; }; static struct __Pyx_CodeObjectCache __pyx_code_cache = {0,0,NULL}; static int __pyx_bisect_code_objects(__Pyx_CodeObjectCacheEntry* entries, int count, int code_line); static PyCodeObject *__pyx_find_code_object(int code_line); static void __pyx_insert_code_object(int code_line, PyCodeObject* code_object); static void __Pyx_AddTraceback(const char *funcname, int c_line, int py_line, const char *filename); static CYTHON_INLINE int __Pyx_PyInt_As_int(PyObject *); static CYTHON_INLINE PyObject* __Pyx_PyInt_From_uint32_t(uint32_t value); #ifndef __PYX_FORCE_INIT_THREADS #define __PYX_FORCE_INIT_THREADS 0 #endif static CYTHON_INLINE uint32_t __Pyx_PyInt_As_uint32_t(PyObject *); static CYTHON_INLINE PyObject* __Pyx_PyInt_From_int(int value); static CYTHON_INLINE PyObject* __Pyx_PyInt_From_long(long value); static CYTHON_INLINE long __Pyx_PyInt_As_long(PyObject *); static int __Pyx_check_binary_version(void); static int __Pyx_InitStrings(__Pyx_StringTabEntry *t); /* Module declarations from 'cython' */ /* Module declarations from 'libc.stdint' */ /* Module declarations from 'libc.string' */ /* Module declarations from 'libc.stdio' */ /* Module declarations from 'libc.stddef' */ /* Module declarations from 'sdl2' */ /* Module declarations from 'pygame_sdl2.pygame_time' */ static int __pyx_v_11pygame_sdl2_11pygame_time_timer_id; static PyObject *__pyx_v_11pygame_sdl2_11pygame_time_timer_by_event = 0; static Uint32 __pyx_f_11pygame_sdl2_11pygame_time_timer_callback(Uint32, void *); /*proto*/ #define __Pyx_MODULE_NAME "pygame_sdl2.pygame_time" int __pyx_module_is_main_pygame_sdl2__pygame_time = 0; /* Implementation of 'pygame_sdl2.pygame_time' */ static PyObject *__pyx_builtin_sum; static char __pyx_k_doc[] = "__doc__"; static char __pyx_k_get[] = "get"; static char __pyx_k_now[] = "now"; static char __pyx_k_pop[] = "pop"; static char __pyx_k_sum[] = "sum"; static char __pyx_k_init[] = "init"; static char __pyx_k_last[] = "last"; static char __pyx_k_main[] = "__main__"; static char __pyx_k_math[] = "math"; static char __pyx_k_quit[] = "quit"; static char __pyx_k_self[] = "self"; static char __pyx_k_test[] = "__test__"; static char __pyx_k_tick[] = "tick"; static char __pyx_k_wait[] = "wait"; static char __pyx_k_Clock[] = "Clock"; static char __pyx_k_delay[] = "delay"; static char __pyx_k_error[] = "error"; static char __pyx_k_isnan[] = "isnan"; static char __pyx_k_start[] = "start"; static char __pyx_k_append[] = "append"; static char __pyx_k_import[] = "__import__"; static char __pyx_k_init_2[] = "__init__"; static char __pyx_k_module[] = "__module__"; static char __pyx_k_display[] = "display"; static char __pyx_k_eventid[] = "eventid"; static char __pyx_k_get_fps[] = "get_fps"; static char __pyx_k_prepare[] = "__prepare__"; static char __pyx_k_get_time[] = "get_time"; static char __pyx_k_qualname[] = "__qualname__"; static char __pyx_k_timer_id[] = "timer_id"; static char __pyx_k_framerate[] = "framerate"; static char __pyx_k_frametime[] = "frametime"; static char __pyx_k_get_ticks[] = "get_ticks"; static char __pyx_k_metaclass[] = "__metaclass__"; static char __pyx_k_set_timer[] = "set_timer"; static char __pyx_k_Clock_tick[] = "Clock.tick"; static char __pyx_k_total_time[] = "total_time"; static char __pyx_k_average_fps[] = "average_fps"; static char __pyx_k_get_rawtime[] = "get_rawtime"; static char __pyx_k_last_frames[] = "last_frames"; static char __pyx_k_pygame_sdl2[] = "pygame_sdl2"; static char __pyx_k_Clock___init[] = "Clock.__init__"; static char __pyx_k_average_time[] = "average_time"; static char __pyx_k_milliseconds[] = "milliseconds"; static char __pyx_k_Clock_get_fps[] = "Clock.get_fps"; static char __pyx_k_raw_frametime[] = "raw_frametime"; static char __pyx_k_register_init[] = "register_init"; static char __pyx_k_register_quit[] = "register_quit"; static char __pyx_k_sdl_main_init[] = "sdl_main_init"; static char __pyx_k_Clock_get_time[] = "Clock.get_time"; static char __pyx_k_frame_duration[] = "frame_duration"; static char __pyx_k_tick_busy_loop[] = "tick_busy_loop"; static char __pyx_k_Clock_get_rawtime[] = "Clock.get_rawtime"; static char __pyx_k_pygame_sdl2_error[] = "pygame_sdl2.error"; static char __pyx_k_Clock_tick_busy_loop[] = "Clock.tick_busy_loop"; static char __pyx_k_pygame_sdl2_pygame_time[] = "pygame_sdl2.pygame_time"; static char __pyx_k_home_tom_ab_pygame_sdl2_src_pyg[] = "/home/tom/ab/pygame_sdl2/src/pygame_sdl2/pygame_time.pyx"; static PyObject *__pyx_n_s_Clock; static PyObject *__pyx_n_s_Clock___init; static PyObject *__pyx_n_s_Clock_get_fps; static PyObject *__pyx_n_s_Clock_get_rawtime; static PyObject *__pyx_n_s_Clock_get_time; static PyObject *__pyx_n_s_Clock_tick; static PyObject *__pyx_n_s_Clock_tick_busy_loop; static PyObject *__pyx_n_s_append; static PyObject *__pyx_n_s_average_fps; static PyObject *__pyx_n_s_average_time; static PyObject *__pyx_n_s_delay; static PyObject *__pyx_n_s_display; static PyObject *__pyx_n_s_doc; static PyObject *__pyx_n_s_error; static PyObject *__pyx_n_s_eventid; static PyObject *__pyx_n_s_frame_duration; static PyObject *__pyx_n_s_framerate; static PyObject *__pyx_n_s_frametime; static PyObject *__pyx_n_s_get; static PyObject *__pyx_n_s_get_fps; static PyObject *__pyx_n_s_get_rawtime; static PyObject *__pyx_n_s_get_ticks; static PyObject *__pyx_n_s_get_time; static PyObject *__pyx_kp_s_home_tom_ab_pygame_sdl2_src_pyg; static PyObject *__pyx_n_s_import; static PyObject *__pyx_n_s_init; static PyObject *__pyx_n_s_init_2; static PyObject *__pyx_n_s_isnan; static PyObject *__pyx_n_s_last; static PyObject *__pyx_n_s_last_frames; static PyObject *__pyx_n_s_main; static PyObject *__pyx_n_s_math; static PyObject *__pyx_n_s_metaclass; static PyObject *__pyx_n_s_milliseconds; static PyObject *__pyx_n_s_module; static PyObject *__pyx_n_s_now; static PyObject *__pyx_n_s_pop; static PyObject *__pyx_n_s_prepare; static PyObject *__pyx_n_s_pygame_sdl2; static PyObject *__pyx_n_s_pygame_sdl2_error; static PyObject *__pyx_n_s_pygame_sdl2_pygame_time; static PyObject *__pyx_n_s_qualname; static PyObject *__pyx_n_s_quit; static PyObject *__pyx_n_s_raw_frametime; static PyObject *__pyx_n_s_register_init; static PyObject *__pyx_n_s_register_quit; static PyObject *__pyx_n_s_sdl_main_init; static PyObject *__pyx_n_s_self; static PyObject *__pyx_n_s_set_timer; static PyObject *__pyx_n_s_start; static PyObject *__pyx_n_s_sum; static PyObject *__pyx_n_s_test; static PyObject *__pyx_n_s_tick; static PyObject *__pyx_n_s_tick_busy_loop; static PyObject *__pyx_n_s_timer_id; static PyObject *__pyx_n_s_total_time; static PyObject *__pyx_n_s_wait; static PyObject *__pyx_pf_11pygame_sdl2_11pygame_time_init(CYTHON_UNUSED PyObject *__pyx_self); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_11pygame_time_2quit(CYTHON_UNUSED PyObject *__pyx_self); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_11pygame_time_4get_ticks(CYTHON_UNUSED PyObject *__pyx_self); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_11pygame_time_6wait(CYTHON_UNUSED PyObject *__pyx_self, int __pyx_v_milliseconds); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_11pygame_time_8delay(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_milliseconds); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_11pygame_time_10set_timer(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_eventid, PyObject *__pyx_v_milliseconds); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_11pygame_time_5Clock___init__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_11pygame_time_5Clock_2tick(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_framerate); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_11pygame_time_5Clock_4tick_busy_loop(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_framerate); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_11pygame_time_5Clock_6get_time(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_11pygame_time_5Clock_8get_rawtime(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_11pygame_time_5Clock_10get_fps(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self); /* proto */ static PyObject *__pyx_float_1_0; static PyObject *__pyx_int_0; static PyObject *__pyx_int_1000; static PyObject *__pyx_codeobj_; static PyObject *__pyx_tuple__4; static PyObject *__pyx_tuple__6; static PyObject *__pyx_tuple__8; static PyObject *__pyx_tuple__10; static PyObject *__pyx_tuple__12; static PyObject *__pyx_tuple__14; static PyObject *__pyx_tuple__15; static PyObject *__pyx_tuple__17; static PyObject *__pyx_tuple__18; static PyObject *__pyx_tuple__20; static PyObject *__pyx_tuple__22; static PyObject *__pyx_codeobj__2; static PyObject *__pyx_codeobj__3; static PyObject *__pyx_codeobj__5; static PyObject *__pyx_codeobj__7; static PyObject *__pyx_codeobj__9; static PyObject *__pyx_codeobj__11; static PyObject *__pyx_codeobj__13; static PyObject *__pyx_codeobj__16; static PyObject *__pyx_codeobj__19; static PyObject *__pyx_codeobj__21; static PyObject *__pyx_codeobj__23; /* "pygame_sdl2/pygame_time.pyx":28 * * @pygame_sdl2.register_init * def init(): # <<<<<<<<<<<<<< * pygame_sdl2.display.sdl_main_init() * */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_11pygame_time_1init(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused); /*proto*/ static PyMethodDef __pyx_mdef_11pygame_sdl2_11pygame_time_1init = {"init", (PyCFunction)__pyx_pw_11pygame_sdl2_11pygame_time_1init, METH_NOARGS, 0}; static PyObject *__pyx_pw_11pygame_sdl2_11pygame_time_1init(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("init (wrapper)", 0); __pyx_r = __pyx_pf_11pygame_sdl2_11pygame_time_init(__pyx_self); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_11pygame_time_init(CYTHON_UNUSED PyObject *__pyx_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; int __pyx_t_4; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("init", 0); /* "pygame_sdl2/pygame_time.pyx":29 * @pygame_sdl2.register_init * def init(): * pygame_sdl2.display.sdl_main_init() # <<<<<<<<<<<<<< * * if SDL_InitSubSystem(SDL_INIT_TIMER): */ __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_pygame_sdl2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 29; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_display); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 29; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_sdl_main_init); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 29; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_3 = NULL; if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_2))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); if (likely(__pyx_t_3)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); } } if (__pyx_t_3) { __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 29; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } else { __pyx_t_1 = __Pyx_PyObject_CallNoArg(__pyx_t_2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 29; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "pygame_sdl2/pygame_time.pyx":31 * pygame_sdl2.display.sdl_main_init() * * if SDL_InitSubSystem(SDL_INIT_TIMER): # <<<<<<<<<<<<<< * raise error() * */ __pyx_t_4 = (SDL_InitSubSystem(SDL_INIT_TIMER) != 0); if (__pyx_t_4) { /* "pygame_sdl2/pygame_time.pyx":32 * * if SDL_InitSubSystem(SDL_INIT_TIMER): * raise error() # <<<<<<<<<<<<<< * * @pygame_sdl2.register_quit */ __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_error); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 32; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = NULL; if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_2))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); if (likely(__pyx_t_3)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); } } if (__pyx_t_3) { __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 32; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } else { __pyx_t_1 = __Pyx_PyObject_CallNoArg(__pyx_t_2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 32; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_Raise(__pyx_t_1, 0, 0, 0); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; {__pyx_filename = __pyx_f[0]; __pyx_lineno = 32; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "pygame_sdl2/pygame_time.pyx":31 * pygame_sdl2.display.sdl_main_init() * * if SDL_InitSubSystem(SDL_INIT_TIMER): # <<<<<<<<<<<<<< * raise error() * */ } /* "pygame_sdl2/pygame_time.pyx":28 * * @pygame_sdl2.register_init * def init(): # <<<<<<<<<<<<<< * pygame_sdl2.display.sdl_main_init() * */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("pygame_sdl2.pygame_time.init", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/pygame_time.pyx":35 * * @pygame_sdl2.register_quit * def quit(): # @ReservedAssignment # <<<<<<<<<<<<<< * SDL_QuitSubSystem(SDL_INIT_TIMER) * */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_11pygame_time_3quit(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused); /*proto*/ static PyMethodDef __pyx_mdef_11pygame_sdl2_11pygame_time_3quit = {"quit", (PyCFunction)__pyx_pw_11pygame_sdl2_11pygame_time_3quit, METH_NOARGS, 0}; static PyObject *__pyx_pw_11pygame_sdl2_11pygame_time_3quit(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("quit (wrapper)", 0); __pyx_r = __pyx_pf_11pygame_sdl2_11pygame_time_2quit(__pyx_self); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_11pygame_time_2quit(CYTHON_UNUSED PyObject *__pyx_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("quit", 0); /* "pygame_sdl2/pygame_time.pyx":36 * @pygame_sdl2.register_quit * def quit(): # @ReservedAssignment * SDL_QuitSubSystem(SDL_INIT_TIMER) # <<<<<<<<<<<<<< * * def get_ticks(): */ SDL_QuitSubSystem(SDL_INIT_TIMER); /* "pygame_sdl2/pygame_time.pyx":35 * * @pygame_sdl2.register_quit * def quit(): # @ReservedAssignment # <<<<<<<<<<<<<< * SDL_QuitSubSystem(SDL_INIT_TIMER) * */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/pygame_time.pyx":38 * SDL_QuitSubSystem(SDL_INIT_TIMER) * * def get_ticks(): # <<<<<<<<<<<<<< * return SDL_GetTicks() * */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_11pygame_time_5get_ticks(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused); /*proto*/ static PyMethodDef __pyx_mdef_11pygame_sdl2_11pygame_time_5get_ticks = {"get_ticks", (PyCFunction)__pyx_pw_11pygame_sdl2_11pygame_time_5get_ticks, METH_NOARGS, 0}; static PyObject *__pyx_pw_11pygame_sdl2_11pygame_time_5get_ticks(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("get_ticks (wrapper)", 0); __pyx_r = __pyx_pf_11pygame_sdl2_11pygame_time_4get_ticks(__pyx_self); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_11pygame_time_4get_ticks(CYTHON_UNUSED PyObject *__pyx_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("get_ticks", 0); /* "pygame_sdl2/pygame_time.pyx":39 * * def get_ticks(): * return SDL_GetTicks() # <<<<<<<<<<<<<< * * def wait(int milliseconds): */ __Pyx_XDECREF(__pyx_r); __pyx_t_1 = __Pyx_PyInt_From_uint32_t(SDL_GetTicks()); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 39; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "pygame_sdl2/pygame_time.pyx":38 * SDL_QuitSubSystem(SDL_INIT_TIMER) * * def get_ticks(): # <<<<<<<<<<<<<< * return SDL_GetTicks() * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("pygame_sdl2.pygame_time.get_ticks", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/pygame_time.pyx":41 * return SDL_GetTicks() * * def wait(int milliseconds): # <<<<<<<<<<<<<< * cdef int start * */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_11pygame_time_7wait(PyObject *__pyx_self, PyObject *__pyx_arg_milliseconds); /*proto*/ static PyMethodDef __pyx_mdef_11pygame_sdl2_11pygame_time_7wait = {"wait", (PyCFunction)__pyx_pw_11pygame_sdl2_11pygame_time_7wait, METH_O, 0}; static PyObject *__pyx_pw_11pygame_sdl2_11pygame_time_7wait(PyObject *__pyx_self, PyObject *__pyx_arg_milliseconds) { int __pyx_v_milliseconds; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("wait (wrapper)", 0); assert(__pyx_arg_milliseconds); { __pyx_v_milliseconds = __Pyx_PyInt_As_int(__pyx_arg_milliseconds); if (unlikely((__pyx_v_milliseconds == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 41; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; __Pyx_AddTraceback("pygame_sdl2.pygame_time.wait", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_11pygame_sdl2_11pygame_time_6wait(__pyx_self, ((int)__pyx_v_milliseconds)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_11pygame_time_6wait(CYTHON_UNUSED PyObject *__pyx_self, int __pyx_v_milliseconds) { int __pyx_v_start; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("wait", 0); /* "pygame_sdl2/pygame_time.pyx":44 * cdef int start * * start = SDL_GetTicks() # <<<<<<<<<<<<<< * with nogil: * SDL_Delay(milliseconds) */ __pyx_v_start = SDL_GetTicks(); /* "pygame_sdl2/pygame_time.pyx":45 * * start = SDL_GetTicks() * with nogil: # <<<<<<<<<<<<<< * SDL_Delay(milliseconds) * return SDL_GetTicks() - start */ { #ifdef WITH_THREAD PyThreadState *_save; Py_UNBLOCK_THREADS #endif /*try:*/ { /* "pygame_sdl2/pygame_time.pyx":46 * start = SDL_GetTicks() * with nogil: * SDL_Delay(milliseconds) # <<<<<<<<<<<<<< * return SDL_GetTicks() - start * */ SDL_Delay(__pyx_v_milliseconds); } /* "pygame_sdl2/pygame_time.pyx":45 * * start = SDL_GetTicks() * with nogil: # <<<<<<<<<<<<<< * SDL_Delay(milliseconds) * return SDL_GetTicks() - start */ /*finally:*/ { /*normal exit:*/{ #ifdef WITH_THREAD Py_BLOCK_THREADS #endif goto __pyx_L5; } __pyx_L5:; } } /* "pygame_sdl2/pygame_time.pyx":47 * with nogil: * SDL_Delay(milliseconds) * return SDL_GetTicks() - start # <<<<<<<<<<<<<< * * def delay(milliseconds): */ __Pyx_XDECREF(__pyx_r); __pyx_t_1 = __Pyx_PyInt_From_uint32_t((SDL_GetTicks() - __pyx_v_start)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 47; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "pygame_sdl2/pygame_time.pyx":41 * return SDL_GetTicks() * * def wait(int milliseconds): # <<<<<<<<<<<<<< * cdef int start * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("pygame_sdl2.pygame_time.wait", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/pygame_time.pyx":49 * return SDL_GetTicks() - start * * def delay(milliseconds): # <<<<<<<<<<<<<< * # SDL_Delay() should be accurate enough. * return wait(milliseconds) */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_11pygame_time_9delay(PyObject *__pyx_self, PyObject *__pyx_v_milliseconds); /*proto*/ static PyMethodDef __pyx_mdef_11pygame_sdl2_11pygame_time_9delay = {"delay", (PyCFunction)__pyx_pw_11pygame_sdl2_11pygame_time_9delay, METH_O, 0}; static PyObject *__pyx_pw_11pygame_sdl2_11pygame_time_9delay(PyObject *__pyx_self, PyObject *__pyx_v_milliseconds) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("delay (wrapper)", 0); __pyx_r = __pyx_pf_11pygame_sdl2_11pygame_time_8delay(__pyx_self, ((PyObject *)__pyx_v_milliseconds)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_11pygame_time_8delay(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_milliseconds) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("delay", 0); /* "pygame_sdl2/pygame_time.pyx":51 * def delay(milliseconds): * # SDL_Delay() should be accurate enough. * return wait(milliseconds) # <<<<<<<<<<<<<< * * cdef Uint32 timer_callback(Uint32 interval, void *param): */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_wait); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 51; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = NULL; if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_2))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); if (likely(__pyx_t_3)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); } } if (!__pyx_t_3) { __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_v_milliseconds); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 51; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); } else { __pyx_t_4 = PyTuple_New(1+1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 51; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_3); __pyx_t_3 = NULL; __Pyx_INCREF(__pyx_v_milliseconds); __Pyx_GIVEREF(__pyx_v_milliseconds); PyTuple_SET_ITEM(__pyx_t_4, 0+1, __pyx_v_milliseconds); __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_4, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 51; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; } __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "pygame_sdl2/pygame_time.pyx":49 * return SDL_GetTicks() - start * * def delay(milliseconds): # <<<<<<<<<<<<<< * # SDL_Delay() should be accurate enough. * return wait(milliseconds) */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_AddTraceback("pygame_sdl2.pygame_time.delay", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/pygame_time.pyx":53 * return wait(milliseconds) * * cdef Uint32 timer_callback(Uint32 interval, void *param): # <<<<<<<<<<<<<< * cdef SDL_Event e * e.type = param */ static Uint32 __pyx_f_11pygame_sdl2_11pygame_time_timer_callback(Uint32 __pyx_v_interval, void *__pyx_v_param) { SDL_Event __pyx_v_e; Uint32 __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("timer_callback", 0); /* "pygame_sdl2/pygame_time.pyx":55 * cdef Uint32 timer_callback(Uint32 interval, void *param): * cdef SDL_Event e * e.type = param # <<<<<<<<<<<<<< * e.user.code = 0 * e.user.data1 = NULL */ __pyx_v_e.type = ((int)__pyx_v_param); /* "pygame_sdl2/pygame_time.pyx":56 * cdef SDL_Event e * e.type = param * e.user.code = 0 # <<<<<<<<<<<<<< * e.user.data1 = NULL * e.user.data2 = NULL */ __pyx_v_e.user.code = 0; /* "pygame_sdl2/pygame_time.pyx":57 * e.type = param * e.user.code = 0 * e.user.data1 = NULL # <<<<<<<<<<<<<< * e.user.data2 = NULL * SDL_PushEvent(&e) */ __pyx_v_e.user.data1 = NULL; /* "pygame_sdl2/pygame_time.pyx":58 * e.user.code = 0 * e.user.data1 = NULL * e.user.data2 = NULL # <<<<<<<<<<<<<< * SDL_PushEvent(&e) * return interval */ __pyx_v_e.user.data2 = NULL; /* "pygame_sdl2/pygame_time.pyx":59 * e.user.data1 = NULL * e.user.data2 = NULL * SDL_PushEvent(&e) # <<<<<<<<<<<<<< * return interval * */ SDL_PushEvent((&__pyx_v_e)); /* "pygame_sdl2/pygame_time.pyx":60 * e.user.data2 = NULL * SDL_PushEvent(&e) * return interval # <<<<<<<<<<<<<< * * # A map from eventid to SDL_Timer_ID. */ __pyx_r = __pyx_v_interval; goto __pyx_L0; /* "pygame_sdl2/pygame_time.pyx":53 * return wait(milliseconds) * * cdef Uint32 timer_callback(Uint32 interval, void *param): # <<<<<<<<<<<<<< * cdef SDL_Event e * e.type = param */ /* function exit code */ __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/pygame_time.pyx":65 * cdef dict timer_by_event = { } * * def set_timer(eventid, milliseconds): # <<<<<<<<<<<<<< * * cdef int timer_id = timer_by_event.get(eventid, 0) */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_11pygame_time_11set_timer(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static PyMethodDef __pyx_mdef_11pygame_sdl2_11pygame_time_11set_timer = {"set_timer", (PyCFunction)__pyx_pw_11pygame_sdl2_11pygame_time_11set_timer, METH_VARARGS|METH_KEYWORDS, 0}; static PyObject *__pyx_pw_11pygame_sdl2_11pygame_time_11set_timer(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_eventid = 0; PyObject *__pyx_v_milliseconds = 0; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("set_timer (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_eventid,&__pyx_n_s_milliseconds,0}; PyObject* values[2] = {0,0}; if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_eventid)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; case 1: if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_milliseconds)) != 0)) kw_args--; else { __Pyx_RaiseArgtupleInvalid("set_timer", 1, 2, 2, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 65; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "set_timer") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 65; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } } else if (PyTuple_GET_SIZE(__pyx_args) != 2) { goto __pyx_L5_argtuple_error; } else { values[0] = PyTuple_GET_ITEM(__pyx_args, 0); values[1] = PyTuple_GET_ITEM(__pyx_args, 1); } __pyx_v_eventid = values[0]; __pyx_v_milliseconds = values[1]; } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("set_timer", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 65; __pyx_clineno = __LINE__; goto __pyx_L3_error;} __pyx_L3_error:; __Pyx_AddTraceback("pygame_sdl2.pygame_time.set_timer", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_11pygame_sdl2_11pygame_time_10set_timer(__pyx_self, __pyx_v_eventid, __pyx_v_milliseconds); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_11pygame_time_10set_timer(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_eventid, PyObject *__pyx_v_milliseconds) { int __pyx_v_timer_id; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_t_2; int __pyx_t_3; Uint32 __pyx_t_4; PyObject *__pyx_t_5 = NULL; PyObject *__pyx_t_6 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("set_timer", 0); /* "pygame_sdl2/pygame_time.pyx":67 * def set_timer(eventid, milliseconds): * * cdef int timer_id = timer_by_event.get(eventid, 0) # <<<<<<<<<<<<<< * * if timer_id != 0: */ if (unlikely(__pyx_v_11pygame_sdl2_11pygame_time_timer_by_event == Py_None)) { PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%s'", "get"); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 67; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } __pyx_t_1 = __Pyx_PyDict_GetItemDefault(__pyx_v_11pygame_sdl2_11pygame_time_timer_by_event, __pyx_v_eventid, __pyx_int_0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 67; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = __Pyx_PyInt_As_int(__pyx_t_1); if (unlikely((__pyx_t_2 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 67; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_v_timer_id = __pyx_t_2; /* "pygame_sdl2/pygame_time.pyx":69 * cdef int timer_id = timer_by_event.get(eventid, 0) * * if timer_id != 0: # <<<<<<<<<<<<<< * SDL_RemoveTimer(timer_id) * timer_id = 0 */ __pyx_t_3 = ((__pyx_v_timer_id != 0) != 0); if (__pyx_t_3) { /* "pygame_sdl2/pygame_time.pyx":70 * * if timer_id != 0: * SDL_RemoveTimer(timer_id) # <<<<<<<<<<<<<< * timer_id = 0 * */ SDL_RemoveTimer(__pyx_v_timer_id); /* "pygame_sdl2/pygame_time.pyx":71 * if timer_id != 0: * SDL_RemoveTimer(timer_id) * timer_id = 0 # <<<<<<<<<<<<<< * * if milliseconds > 0: */ __pyx_v_timer_id = 0; /* "pygame_sdl2/pygame_time.pyx":69 * cdef int timer_id = timer_by_event.get(eventid, 0) * * if timer_id != 0: # <<<<<<<<<<<<<< * SDL_RemoveTimer(timer_id) * timer_id = 0 */ } /* "pygame_sdl2/pygame_time.pyx":73 * timer_id = 0 * * if milliseconds > 0: # <<<<<<<<<<<<<< * timer_id = SDL_AddTimer(milliseconds, timer_callback, eventid) * if timer_id == 0: */ __pyx_t_1 = PyObject_RichCompare(__pyx_v_milliseconds, __pyx_int_0, Py_GT); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 73; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 73; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (__pyx_t_3) { /* "pygame_sdl2/pygame_time.pyx":74 * * if milliseconds > 0: * timer_id = SDL_AddTimer(milliseconds, timer_callback, eventid) # <<<<<<<<<<<<<< * if timer_id == 0: * raise error() */ __pyx_t_4 = __Pyx_PyInt_As_uint32_t(__pyx_v_milliseconds); if (unlikely((__pyx_t_4 == (Uint32)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 74; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_t_2 = __Pyx_PyInt_As_int(__pyx_v_eventid); if (unlikely((__pyx_t_2 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 74; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_v_timer_id = SDL_AddTimer(__pyx_t_4, ((SDL_TimerCallback)__pyx_f_11pygame_sdl2_11pygame_time_timer_callback), ((void *)((int)__pyx_t_2))); /* "pygame_sdl2/pygame_time.pyx":75 * if milliseconds > 0: * timer_id = SDL_AddTimer(milliseconds, timer_callback, eventid) * if timer_id == 0: # <<<<<<<<<<<<<< * raise error() * */ __pyx_t_3 = ((__pyx_v_timer_id == 0) != 0); if (__pyx_t_3) { /* "pygame_sdl2/pygame_time.pyx":76 * timer_id = SDL_AddTimer(milliseconds, timer_callback, eventid) * if timer_id == 0: * raise error() # <<<<<<<<<<<<<< * * timer_by_event[eventid] = timer_id */ __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_error); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 76; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); __pyx_t_6 = NULL; if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_5))) { __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_5); if (likely(__pyx_t_6)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5); __Pyx_INCREF(__pyx_t_6); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_5, function); } } if (__pyx_t_6) { __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_t_6); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 76; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; } else { __pyx_t_1 = __Pyx_PyObject_CallNoArg(__pyx_t_5); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 76; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_Raise(__pyx_t_1, 0, 0, 0); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; {__pyx_filename = __pyx_f[0]; __pyx_lineno = 76; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "pygame_sdl2/pygame_time.pyx":75 * if milliseconds > 0: * timer_id = SDL_AddTimer(milliseconds, timer_callback, eventid) * if timer_id == 0: # <<<<<<<<<<<<<< * raise error() * */ } /* "pygame_sdl2/pygame_time.pyx":73 * timer_id = 0 * * if milliseconds > 0: # <<<<<<<<<<<<<< * timer_id = SDL_AddTimer(milliseconds, timer_callback, eventid) * if timer_id == 0: */ } /* "pygame_sdl2/pygame_time.pyx":78 * raise error() * * timer_by_event[eventid] = timer_id # <<<<<<<<<<<<<< * * class Clock: */ __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_timer_id); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 78; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); if (unlikely(__pyx_v_11pygame_sdl2_11pygame_time_timer_by_event == Py_None)) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 78; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } if (unlikely(PyDict_SetItem(__pyx_v_11pygame_sdl2_11pygame_time_timer_by_event, __pyx_v_eventid, __pyx_t_1) < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 78; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "pygame_sdl2/pygame_time.pyx":65 * cdef dict timer_by_event = { } * * def set_timer(eventid, milliseconds): # <<<<<<<<<<<<<< * * cdef int timer_id = timer_by_event.get(eventid, 0) */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_5); __Pyx_XDECREF(__pyx_t_6); __Pyx_AddTraceback("pygame_sdl2.pygame_time.set_timer", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/pygame_time.pyx":81 * * class Clock: * def __init__(self): # <<<<<<<<<<<<<< * self.last = SDL_GetTicks() * self.last_frames = [] */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_11pygame_time_5Clock_1__init__(PyObject *__pyx_self, PyObject *__pyx_v_self); /*proto*/ static PyMethodDef __pyx_mdef_11pygame_sdl2_11pygame_time_5Clock_1__init__ = {"__init__", (PyCFunction)__pyx_pw_11pygame_sdl2_11pygame_time_5Clock_1__init__, METH_O, 0}; static PyObject *__pyx_pw_11pygame_sdl2_11pygame_time_5Clock_1__init__(PyObject *__pyx_self, PyObject *__pyx_v_self) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__init__ (wrapper)", 0); __pyx_r = __pyx_pf_11pygame_sdl2_11pygame_time_5Clock___init__(__pyx_self, ((PyObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_11pygame_time_5Clock___init__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__init__", 0); /* "pygame_sdl2/pygame_time.pyx":82 * class Clock: * def __init__(self): * self.last = SDL_GetTicks() # <<<<<<<<<<<<<< * self.last_frames = [] * self.frametime = 0 */ __pyx_t_1 = __Pyx_PyInt_From_uint32_t(SDL_GetTicks()); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 82; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_last, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 82; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "pygame_sdl2/pygame_time.pyx":83 * def __init__(self): * self.last = SDL_GetTicks() * self.last_frames = [] # <<<<<<<<<<<<<< * self.frametime = 0 * self.raw_frametime = 0 */ __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 83; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_last_frames, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 83; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "pygame_sdl2/pygame_time.pyx":84 * self.last = SDL_GetTicks() * self.last_frames = [] * self.frametime = 0 # <<<<<<<<<<<<<< * self.raw_frametime = 0 * */ if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_frametime, __pyx_int_0) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 84; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "pygame_sdl2/pygame_time.pyx":85 * self.last_frames = [] * self.frametime = 0 * self.raw_frametime = 0 # <<<<<<<<<<<<<< * * def tick(self, framerate=0): */ if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_raw_frametime, __pyx_int_0) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 85; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "pygame_sdl2/pygame_time.pyx":81 * * class Clock: * def __init__(self): # <<<<<<<<<<<<<< * self.last = SDL_GetTicks() * self.last_frames = [] */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("pygame_sdl2.pygame_time.Clock.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/pygame_time.pyx":87 * self.raw_frametime = 0 * * def tick(self, framerate=0): # <<<<<<<<<<<<<< * cdef int now = SDL_GetTicks() * self.raw_frametime = now - self.last */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_11pygame_time_5Clock_3tick(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static PyMethodDef __pyx_mdef_11pygame_sdl2_11pygame_time_5Clock_3tick = {"tick", (PyCFunction)__pyx_pw_11pygame_sdl2_11pygame_time_5Clock_3tick, METH_VARARGS|METH_KEYWORDS, 0}; static PyObject *__pyx_pw_11pygame_sdl2_11pygame_time_5Clock_3tick(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_self = 0; PyObject *__pyx_v_framerate = 0; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("tick (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_framerate,0}; PyObject* values[2] = {0,0}; values[1] = ((PyObject *)((PyObject *)__pyx_int_0)); if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_self)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; case 1: if (kw_args > 0) { PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_framerate); if (value) { values[1] = value; kw_args--; } } } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "tick") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 87; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } } else { switch (PyTuple_GET_SIZE(__pyx_args)) { case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_self = values[0]; __pyx_v_framerate = values[1]; } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("tick", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 87; __pyx_clineno = __LINE__; goto __pyx_L3_error;} __pyx_L3_error:; __Pyx_AddTraceback("pygame_sdl2.pygame_time.Clock.tick", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_11pygame_sdl2_11pygame_time_5Clock_2tick(__pyx_self, __pyx_v_self, __pyx_v_framerate); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_11pygame_time_5Clock_2tick(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_framerate) { int __pyx_v_now; int __pyx_v_frame_duration; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; Py_ssize_t __pyx_t_4; int __pyx_t_5; int __pyx_t_6; int __pyx_t_7; PyObject *__pyx_t_8 = NULL; PyObject *__pyx_t_9 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("tick", 0); /* "pygame_sdl2/pygame_time.pyx":88 * * def tick(self, framerate=0): * cdef int now = SDL_GetTicks() # <<<<<<<<<<<<<< * self.raw_frametime = now - self.last * while len(self.last_frames) > 9: */ __pyx_v_now = SDL_GetTicks(); /* "pygame_sdl2/pygame_time.pyx":89 * def tick(self, framerate=0): * cdef int now = SDL_GetTicks() * self.raw_frametime = now - self.last # <<<<<<<<<<<<<< * while len(self.last_frames) > 9: * self.last_frames.pop(0) */ __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_now); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 89; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_last); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 89; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = PyNumber_Subtract(__pyx_t_1, __pyx_t_2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 89; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_raw_frametime, __pyx_t_3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 89; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "pygame_sdl2/pygame_time.pyx":90 * cdef int now = SDL_GetTicks() * self.raw_frametime = now - self.last * while len(self.last_frames) > 9: # <<<<<<<<<<<<<< * self.last_frames.pop(0) * if framerate == 0: */ while (1) { __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_last_frames); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 90; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = PyObject_Length(__pyx_t_3); if (unlikely(__pyx_t_4 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 90; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_5 = ((__pyx_t_4 > 9) != 0); if (!__pyx_t_5) break; /* "pygame_sdl2/pygame_time.pyx":91 * self.raw_frametime = now - self.last * while len(self.last_frames) > 9: * self.last_frames.pop(0) # <<<<<<<<<<<<<< * if framerate == 0: * self.last = now */ __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_last_frames); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 91; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __pyx_t_2 = __Pyx_PyObject_PopIndex(__pyx_t_3, __pyx_int_0, 0, 1, Py_ssize_t, PyInt_FromSsize_t); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 91; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } /* "pygame_sdl2/pygame_time.pyx":92 * while len(self.last_frames) > 9: * self.last_frames.pop(0) * if framerate == 0: # <<<<<<<<<<<<<< * self.last = now * self.last_frames.append(self.raw_frametime) */ __pyx_t_2 = __Pyx_PyInt_EqObjC(__pyx_v_framerate, __pyx_int_0, 0, 0); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 92; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_5 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 92; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; if (__pyx_t_5) { /* "pygame_sdl2/pygame_time.pyx":93 * self.last_frames.pop(0) * if framerate == 0: * self.last = now # <<<<<<<<<<<<<< * self.last_frames.append(self.raw_frametime) * return self.raw_frametime */ __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_v_now); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 93; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_last, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 93; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "pygame_sdl2/pygame_time.pyx":94 * if framerate == 0: * self.last = now * self.last_frames.append(self.raw_frametime) # <<<<<<<<<<<<<< * return self.raw_frametime * cdef int frame_duration = 1.0 / framerate * 1000 */ __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_last_frames); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 94; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_raw_frametime); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 94; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __pyx_t_6 = __Pyx_PyObject_Append(__pyx_t_2, __pyx_t_3); if (unlikely(__pyx_t_6 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 94; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "pygame_sdl2/pygame_time.pyx":95 * self.last = now * self.last_frames.append(self.raw_frametime) * return self.raw_frametime # <<<<<<<<<<<<<< * cdef int frame_duration = 1.0 / framerate * 1000 * if self.raw_frametime < frame_duration: */ __Pyx_XDECREF(__pyx_r); __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_raw_frametime); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 95; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __pyx_r = __pyx_t_3; __pyx_t_3 = 0; goto __pyx_L0; /* "pygame_sdl2/pygame_time.pyx":92 * while len(self.last_frames) > 9: * self.last_frames.pop(0) * if framerate == 0: # <<<<<<<<<<<<<< * self.last = now * self.last_frames.append(self.raw_frametime) */ } /* "pygame_sdl2/pygame_time.pyx":96 * self.last_frames.append(self.raw_frametime) * return self.raw_frametime * cdef int frame_duration = 1.0 / framerate * 1000 # <<<<<<<<<<<<<< * if self.raw_frametime < frame_duration: * delay(frame_duration - self.raw_frametime) */ __pyx_t_3 = __Pyx_PyFloat_TrueDivideCObj(__pyx_float_1_0, __pyx_v_framerate, 1.0, 0); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 96; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __pyx_t_2 = PyNumber_Multiply(__pyx_t_3, __pyx_int_1000); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 96; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_7 = __Pyx_PyInt_As_int(__pyx_t_2); if (unlikely((__pyx_t_7 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 96; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_v_frame_duration = __pyx_t_7; /* "pygame_sdl2/pygame_time.pyx":97 * return self.raw_frametime * cdef int frame_duration = 1.0 / framerate * 1000 * if self.raw_frametime < frame_duration: # <<<<<<<<<<<<<< * delay(frame_duration - self.raw_frametime) * now = SDL_GetTicks() */ __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_raw_frametime); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 97; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = __Pyx_PyInt_From_int(__pyx_v_frame_duration); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 97; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __pyx_t_1 = PyObject_RichCompare(__pyx_t_2, __pyx_t_3, Py_LT); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 97; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_5 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 97; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (__pyx_t_5) { /* "pygame_sdl2/pygame_time.pyx":98 * cdef int frame_duration = 1.0 / framerate * 1000 * if self.raw_frametime < frame_duration: * delay(frame_duration - self.raw_frametime) # <<<<<<<<<<<<<< * now = SDL_GetTicks() * self.frametime = now - self.last */ __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_delay); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 98; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_v_frame_duration); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 98; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_raw_frametime); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 98; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_8); __pyx_t_9 = PyNumber_Subtract(__pyx_t_2, __pyx_t_8); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 98; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_9); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; __pyx_t_8 = NULL; if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_3))) { __pyx_t_8 = PyMethod_GET_SELF(__pyx_t_3); if (likely(__pyx_t_8)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); __Pyx_INCREF(__pyx_t_8); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_3, function); } } if (!__pyx_t_8) { __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_9); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 98; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; __Pyx_GOTREF(__pyx_t_1); } else { __pyx_t_2 = PyTuple_New(1+1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 98; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __Pyx_GIVEREF(__pyx_t_8); PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_8); __pyx_t_8 = NULL; __Pyx_GIVEREF(__pyx_t_9); PyTuple_SET_ITEM(__pyx_t_2, 0+1, __pyx_t_9); __pyx_t_9 = 0; __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_2, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 98; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "pygame_sdl2/pygame_time.pyx":97 * return self.raw_frametime * cdef int frame_duration = 1.0 / framerate * 1000 * if self.raw_frametime < frame_duration: # <<<<<<<<<<<<<< * delay(frame_duration - self.raw_frametime) * now = SDL_GetTicks() */ } /* "pygame_sdl2/pygame_time.pyx":99 * if self.raw_frametime < frame_duration: * delay(frame_duration - self.raw_frametime) * now = SDL_GetTicks() # <<<<<<<<<<<<<< * self.frametime = now - self.last * self.last = now */ __pyx_v_now = SDL_GetTicks(); /* "pygame_sdl2/pygame_time.pyx":100 * delay(frame_duration - self.raw_frametime) * now = SDL_GetTicks() * self.frametime = now - self.last # <<<<<<<<<<<<<< * self.last = now * self.last_frames.append(self.frametime) */ __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_now); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 100; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_last); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 100; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __pyx_t_2 = PyNumber_Subtract(__pyx_t_1, __pyx_t_3); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 100; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_frametime, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 100; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "pygame_sdl2/pygame_time.pyx":101 * now = SDL_GetTicks() * self.frametime = now - self.last * self.last = now # <<<<<<<<<<<<<< * self.last_frames.append(self.frametime) * return self.frametime */ __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_v_now); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 101; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_last, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 101; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "pygame_sdl2/pygame_time.pyx":102 * self.frametime = now - self.last * self.last = now * self.last_frames.append(self.frametime) # <<<<<<<<<<<<<< * return self.frametime * */ __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_last_frames); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 102; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_frametime); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 102; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __pyx_t_6 = __Pyx_PyObject_Append(__pyx_t_2, __pyx_t_3); if (unlikely(__pyx_t_6 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 102; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "pygame_sdl2/pygame_time.pyx":103 * self.last = now * self.last_frames.append(self.frametime) * return self.frametime # <<<<<<<<<<<<<< * * def tick_busy_loop(self, framerate=0): */ __Pyx_XDECREF(__pyx_r); __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_frametime); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 103; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __pyx_r = __pyx_t_3; __pyx_t_3 = 0; goto __pyx_L0; /* "pygame_sdl2/pygame_time.pyx":87 * self.raw_frametime = 0 * * def tick(self, framerate=0): # <<<<<<<<<<<<<< * cdef int now = SDL_GetTicks() * self.raw_frametime = now - self.last */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_8); __Pyx_XDECREF(__pyx_t_9); __Pyx_AddTraceback("pygame_sdl2.pygame_time.Clock.tick", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/pygame_time.pyx":105 * return self.frametime * * def tick_busy_loop(self, framerate=0): # <<<<<<<<<<<<<< * return self.tick(framerate) * */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_11pygame_time_5Clock_5tick_busy_loop(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static PyMethodDef __pyx_mdef_11pygame_sdl2_11pygame_time_5Clock_5tick_busy_loop = {"tick_busy_loop", (PyCFunction)__pyx_pw_11pygame_sdl2_11pygame_time_5Clock_5tick_busy_loop, METH_VARARGS|METH_KEYWORDS, 0}; static PyObject *__pyx_pw_11pygame_sdl2_11pygame_time_5Clock_5tick_busy_loop(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_self = 0; PyObject *__pyx_v_framerate = 0; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("tick_busy_loop (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_framerate,0}; PyObject* values[2] = {0,0}; values[1] = ((PyObject *)((PyObject *)__pyx_int_0)); if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_self)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; case 1: if (kw_args > 0) { PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_framerate); if (value) { values[1] = value; kw_args--; } } } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "tick_busy_loop") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 105; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } } else { switch (PyTuple_GET_SIZE(__pyx_args)) { case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_self = values[0]; __pyx_v_framerate = values[1]; } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("tick_busy_loop", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 105; __pyx_clineno = __LINE__; goto __pyx_L3_error;} __pyx_L3_error:; __Pyx_AddTraceback("pygame_sdl2.pygame_time.Clock.tick_busy_loop", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_11pygame_sdl2_11pygame_time_5Clock_4tick_busy_loop(__pyx_self, __pyx_v_self, __pyx_v_framerate); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_11pygame_time_5Clock_4tick_busy_loop(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_framerate) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("tick_busy_loop", 0); /* "pygame_sdl2/pygame_time.pyx":106 * * def tick_busy_loop(self, framerate=0): * return self.tick(framerate) # <<<<<<<<<<<<<< * * def get_time(self): */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_tick); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 106; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = NULL; if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_2))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); if (likely(__pyx_t_3)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); } } if (!__pyx_t_3) { __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_v_framerate); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 106; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); } else { __pyx_t_4 = PyTuple_New(1+1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 106; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_3); __pyx_t_3 = NULL; __Pyx_INCREF(__pyx_v_framerate); __Pyx_GIVEREF(__pyx_v_framerate); PyTuple_SET_ITEM(__pyx_t_4, 0+1, __pyx_v_framerate); __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_4, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 106; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; } __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "pygame_sdl2/pygame_time.pyx":105 * return self.frametime * * def tick_busy_loop(self, framerate=0): # <<<<<<<<<<<<<< * return self.tick(framerate) * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_AddTraceback("pygame_sdl2.pygame_time.Clock.tick_busy_loop", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/pygame_time.pyx":108 * return self.tick(framerate) * * def get_time(self): # <<<<<<<<<<<<<< * return self.frametime * */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_11pygame_time_5Clock_7get_time(PyObject *__pyx_self, PyObject *__pyx_v_self); /*proto*/ static PyMethodDef __pyx_mdef_11pygame_sdl2_11pygame_time_5Clock_7get_time = {"get_time", (PyCFunction)__pyx_pw_11pygame_sdl2_11pygame_time_5Clock_7get_time, METH_O, 0}; static PyObject *__pyx_pw_11pygame_sdl2_11pygame_time_5Clock_7get_time(PyObject *__pyx_self, PyObject *__pyx_v_self) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("get_time (wrapper)", 0); __pyx_r = __pyx_pf_11pygame_sdl2_11pygame_time_5Clock_6get_time(__pyx_self, ((PyObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_11pygame_time_5Clock_6get_time(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("get_time", 0); /* "pygame_sdl2/pygame_time.pyx":109 * * def get_time(self): * return self.frametime # <<<<<<<<<<<<<< * * def get_rawtime(self): */ __Pyx_XDECREF(__pyx_r); __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_frametime); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 109; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "pygame_sdl2/pygame_time.pyx":108 * return self.tick(framerate) * * def get_time(self): # <<<<<<<<<<<<<< * return self.frametime * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("pygame_sdl2.pygame_time.Clock.get_time", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/pygame_time.pyx":111 * return self.frametime * * def get_rawtime(self): # <<<<<<<<<<<<<< * return self.raw_frametime * */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_11pygame_time_5Clock_9get_rawtime(PyObject *__pyx_self, PyObject *__pyx_v_self); /*proto*/ static PyMethodDef __pyx_mdef_11pygame_sdl2_11pygame_time_5Clock_9get_rawtime = {"get_rawtime", (PyCFunction)__pyx_pw_11pygame_sdl2_11pygame_time_5Clock_9get_rawtime, METH_O, 0}; static PyObject *__pyx_pw_11pygame_sdl2_11pygame_time_5Clock_9get_rawtime(PyObject *__pyx_self, PyObject *__pyx_v_self) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("get_rawtime (wrapper)", 0); __pyx_r = __pyx_pf_11pygame_sdl2_11pygame_time_5Clock_8get_rawtime(__pyx_self, ((PyObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_11pygame_time_5Clock_8get_rawtime(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("get_rawtime", 0); /* "pygame_sdl2/pygame_time.pyx":112 * * def get_rawtime(self): * return self.raw_frametime # <<<<<<<<<<<<<< * * @cython.cdivision(True) */ __Pyx_XDECREF(__pyx_r); __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_raw_frametime); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 112; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "pygame_sdl2/pygame_time.pyx":111 * return self.frametime * * def get_rawtime(self): # <<<<<<<<<<<<<< * return self.raw_frametime * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("pygame_sdl2.pygame_time.Clock.get_rawtime", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/pygame_time.pyx":115 * * @cython.cdivision(True) * def get_fps(self): # <<<<<<<<<<<<<< * cdef int total_time = sum(self.last_frames) * cdef float average_time = total_time / 1000.0 / len(self.last_frames) */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_11pygame_time_5Clock_11get_fps(PyObject *__pyx_self, PyObject *__pyx_v_self); /*proto*/ static PyMethodDef __pyx_mdef_11pygame_sdl2_11pygame_time_5Clock_11get_fps = {"get_fps", (PyCFunction)__pyx_pw_11pygame_sdl2_11pygame_time_5Clock_11get_fps, METH_O, 0}; static PyObject *__pyx_pw_11pygame_sdl2_11pygame_time_5Clock_11get_fps(PyObject *__pyx_self, PyObject *__pyx_v_self) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("get_fps (wrapper)", 0); __pyx_r = __pyx_pf_11pygame_sdl2_11pygame_time_5Clock_10get_fps(__pyx_self, ((PyObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_11pygame_time_5Clock_10get_fps(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self) { int __pyx_v_total_time; float __pyx_v_average_time; float __pyx_v_average_fps; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; int __pyx_t_3; Py_ssize_t __pyx_t_4; PyObject *__pyx_t_5 = NULL; PyObject *__pyx_t_6 = NULL; PyObject *__pyx_t_7 = NULL; PyObject *__pyx_t_8 = NULL; int __pyx_t_9; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("get_fps", 0); /* "pygame_sdl2/pygame_time.pyx":116 * @cython.cdivision(True) * def get_fps(self): * cdef int total_time = sum(self.last_frames) # <<<<<<<<<<<<<< * cdef float average_time = total_time / 1000.0 / len(self.last_frames) * cdef float average_fps = 1.0 / average_time */ __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_last_frames); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 116; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 116; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __Pyx_GIVEREF(__pyx_t_1); PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_1); __pyx_t_1 = 0; __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_sum, __pyx_t_2, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 116; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_3 = __Pyx_PyInt_As_int(__pyx_t_1); if (unlikely((__pyx_t_3 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 116; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_v_total_time = __pyx_t_3; /* "pygame_sdl2/pygame_time.pyx":117 * def get_fps(self): * cdef int total_time = sum(self.last_frames) * cdef float average_time = total_time / 1000.0 / len(self.last_frames) # <<<<<<<<<<<<<< * cdef float average_fps = 1.0 / average_time * return 0 if math.isnan(average_fps) else average_fps */ __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_last_frames); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 117; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_t_4 = PyObject_Length(__pyx_t_1); if (unlikely(__pyx_t_4 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 117; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_v_average_time = ((((double)__pyx_v_total_time) / 1000.0) / ((double)__pyx_t_4)); /* "pygame_sdl2/pygame_time.pyx":118 * cdef int total_time = sum(self.last_frames) * cdef float average_time = total_time / 1000.0 / len(self.last_frames) * cdef float average_fps = 1.0 / average_time # <<<<<<<<<<<<<< * return 0 if math.isnan(average_fps) else average_fps */ __pyx_v_average_fps = (1.0 / ((double)__pyx_v_average_time)); /* "pygame_sdl2/pygame_time.pyx":119 * cdef float average_time = total_time / 1000.0 / len(self.last_frames) * cdef float average_fps = 1.0 / average_time * return 0 if math.isnan(average_fps) else average_fps # <<<<<<<<<<<<<< */ __Pyx_XDECREF(__pyx_r); __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_math); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 119; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_isnan); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 119; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __pyx_t_5 = PyFloat_FromDouble(__pyx_v_average_fps); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 119; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); __pyx_t_7 = NULL; if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_6))) { __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_6); if (likely(__pyx_t_7)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6); __Pyx_INCREF(__pyx_t_7); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_6, function); } } if (!__pyx_t_7) { __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_6, __pyx_t_5); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 119; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_GOTREF(__pyx_t_2); } else { __pyx_t_8 = PyTuple_New(1+1); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 119; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_8); __Pyx_GIVEREF(__pyx_t_7); PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_7); __pyx_t_7 = NULL; __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_8, 0+1, __pyx_t_5); __pyx_t_5 = 0; __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_8, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 119; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; } __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __pyx_t_9 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_9 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 119; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; if (__pyx_t_9) { __Pyx_INCREF(__pyx_int_0); __pyx_t_1 = __pyx_int_0; } else { __pyx_t_2 = PyFloat_FromDouble(__pyx_v_average_fps); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 119; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __pyx_t_1 = __pyx_t_2; __pyx_t_2 = 0; } __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "pygame_sdl2/pygame_time.pyx":115 * * @cython.cdivision(True) * def get_fps(self): # <<<<<<<<<<<<<< * cdef int total_time = sum(self.last_frames) * cdef float average_time = total_time / 1000.0 / len(self.last_frames) */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_5); __Pyx_XDECREF(__pyx_t_6); __Pyx_XDECREF(__pyx_t_7); __Pyx_XDECREF(__pyx_t_8); __Pyx_AddTraceback("pygame_sdl2.pygame_time.Clock.get_fps", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyMethodDef __pyx_methods[] = { {0, 0, 0, 0} }; #if PY_MAJOR_VERSION >= 3 static struct PyModuleDef __pyx_moduledef = { #if PY_VERSION_HEX < 0x03020000 { PyObject_HEAD_INIT(NULL) NULL, 0, NULL }, #else PyModuleDef_HEAD_INIT, #endif "pygame_time", 0, /* m_doc */ -1, /* m_size */ __pyx_methods /* m_methods */, NULL, /* m_reload */ NULL, /* m_traverse */ NULL, /* m_clear */ NULL /* m_free */ }; #endif static __Pyx_StringTabEntry __pyx_string_tab[] = { {&__pyx_n_s_Clock, __pyx_k_Clock, sizeof(__pyx_k_Clock), 0, 0, 1, 1}, {&__pyx_n_s_Clock___init, __pyx_k_Clock___init, sizeof(__pyx_k_Clock___init), 0, 0, 1, 1}, {&__pyx_n_s_Clock_get_fps, __pyx_k_Clock_get_fps, sizeof(__pyx_k_Clock_get_fps), 0, 0, 1, 1}, {&__pyx_n_s_Clock_get_rawtime, __pyx_k_Clock_get_rawtime, sizeof(__pyx_k_Clock_get_rawtime), 0, 0, 1, 1}, {&__pyx_n_s_Clock_get_time, __pyx_k_Clock_get_time, sizeof(__pyx_k_Clock_get_time), 0, 0, 1, 1}, {&__pyx_n_s_Clock_tick, __pyx_k_Clock_tick, sizeof(__pyx_k_Clock_tick), 0, 0, 1, 1}, {&__pyx_n_s_Clock_tick_busy_loop, __pyx_k_Clock_tick_busy_loop, sizeof(__pyx_k_Clock_tick_busy_loop), 0, 0, 1, 1}, {&__pyx_n_s_append, __pyx_k_append, sizeof(__pyx_k_append), 0, 0, 1, 1}, {&__pyx_n_s_average_fps, __pyx_k_average_fps, sizeof(__pyx_k_average_fps), 0, 0, 1, 1}, {&__pyx_n_s_average_time, __pyx_k_average_time, sizeof(__pyx_k_average_time), 0, 0, 1, 1}, {&__pyx_n_s_delay, __pyx_k_delay, sizeof(__pyx_k_delay), 0, 0, 1, 1}, {&__pyx_n_s_display, __pyx_k_display, sizeof(__pyx_k_display), 0, 0, 1, 1}, {&__pyx_n_s_doc, __pyx_k_doc, sizeof(__pyx_k_doc), 0, 0, 1, 1}, {&__pyx_n_s_error, __pyx_k_error, sizeof(__pyx_k_error), 0, 0, 1, 1}, {&__pyx_n_s_eventid, __pyx_k_eventid, sizeof(__pyx_k_eventid), 0, 0, 1, 1}, {&__pyx_n_s_frame_duration, __pyx_k_frame_duration, sizeof(__pyx_k_frame_duration), 0, 0, 1, 1}, {&__pyx_n_s_framerate, __pyx_k_framerate, sizeof(__pyx_k_framerate), 0, 0, 1, 1}, {&__pyx_n_s_frametime, __pyx_k_frametime, sizeof(__pyx_k_frametime), 0, 0, 1, 1}, {&__pyx_n_s_get, __pyx_k_get, sizeof(__pyx_k_get), 0, 0, 1, 1}, {&__pyx_n_s_get_fps, __pyx_k_get_fps, sizeof(__pyx_k_get_fps), 0, 0, 1, 1}, {&__pyx_n_s_get_rawtime, __pyx_k_get_rawtime, sizeof(__pyx_k_get_rawtime), 0, 0, 1, 1}, {&__pyx_n_s_get_ticks, __pyx_k_get_ticks, sizeof(__pyx_k_get_ticks), 0, 0, 1, 1}, {&__pyx_n_s_get_time, __pyx_k_get_time, sizeof(__pyx_k_get_time), 0, 0, 1, 1}, {&__pyx_kp_s_home_tom_ab_pygame_sdl2_src_pyg, __pyx_k_home_tom_ab_pygame_sdl2_src_pyg, sizeof(__pyx_k_home_tom_ab_pygame_sdl2_src_pyg), 0, 0, 1, 0}, {&__pyx_n_s_import, __pyx_k_import, sizeof(__pyx_k_import), 0, 0, 1, 1}, {&__pyx_n_s_init, __pyx_k_init, sizeof(__pyx_k_init), 0, 0, 1, 1}, {&__pyx_n_s_init_2, __pyx_k_init_2, sizeof(__pyx_k_init_2), 0, 0, 1, 1}, {&__pyx_n_s_isnan, __pyx_k_isnan, sizeof(__pyx_k_isnan), 0, 0, 1, 1}, {&__pyx_n_s_last, __pyx_k_last, sizeof(__pyx_k_last), 0, 0, 1, 1}, {&__pyx_n_s_last_frames, __pyx_k_last_frames, sizeof(__pyx_k_last_frames), 0, 0, 1, 1}, {&__pyx_n_s_main, __pyx_k_main, sizeof(__pyx_k_main), 0, 0, 1, 1}, {&__pyx_n_s_math, __pyx_k_math, sizeof(__pyx_k_math), 0, 0, 1, 1}, {&__pyx_n_s_metaclass, __pyx_k_metaclass, sizeof(__pyx_k_metaclass), 0, 0, 1, 1}, {&__pyx_n_s_milliseconds, __pyx_k_milliseconds, sizeof(__pyx_k_milliseconds), 0, 0, 1, 1}, {&__pyx_n_s_module, __pyx_k_module, sizeof(__pyx_k_module), 0, 0, 1, 1}, {&__pyx_n_s_now, __pyx_k_now, sizeof(__pyx_k_now), 0, 0, 1, 1}, {&__pyx_n_s_pop, __pyx_k_pop, sizeof(__pyx_k_pop), 0, 0, 1, 1}, {&__pyx_n_s_prepare, __pyx_k_prepare, sizeof(__pyx_k_prepare), 0, 0, 1, 1}, {&__pyx_n_s_pygame_sdl2, __pyx_k_pygame_sdl2, sizeof(__pyx_k_pygame_sdl2), 0, 0, 1, 1}, {&__pyx_n_s_pygame_sdl2_error, __pyx_k_pygame_sdl2_error, sizeof(__pyx_k_pygame_sdl2_error), 0, 0, 1, 1}, {&__pyx_n_s_pygame_sdl2_pygame_time, __pyx_k_pygame_sdl2_pygame_time, sizeof(__pyx_k_pygame_sdl2_pygame_time), 0, 0, 1, 1}, {&__pyx_n_s_qualname, __pyx_k_qualname, sizeof(__pyx_k_qualname), 0, 0, 1, 1}, {&__pyx_n_s_quit, __pyx_k_quit, sizeof(__pyx_k_quit), 0, 0, 1, 1}, {&__pyx_n_s_raw_frametime, __pyx_k_raw_frametime, sizeof(__pyx_k_raw_frametime), 0, 0, 1, 1}, {&__pyx_n_s_register_init, __pyx_k_register_init, sizeof(__pyx_k_register_init), 0, 0, 1, 1}, {&__pyx_n_s_register_quit, __pyx_k_register_quit, sizeof(__pyx_k_register_quit), 0, 0, 1, 1}, {&__pyx_n_s_sdl_main_init, __pyx_k_sdl_main_init, sizeof(__pyx_k_sdl_main_init), 0, 0, 1, 1}, {&__pyx_n_s_self, __pyx_k_self, sizeof(__pyx_k_self), 0, 0, 1, 1}, {&__pyx_n_s_set_timer, __pyx_k_set_timer, sizeof(__pyx_k_set_timer), 0, 0, 1, 1}, {&__pyx_n_s_start, __pyx_k_start, sizeof(__pyx_k_start), 0, 0, 1, 1}, {&__pyx_n_s_sum, __pyx_k_sum, sizeof(__pyx_k_sum), 0, 0, 1, 1}, {&__pyx_n_s_test, __pyx_k_test, sizeof(__pyx_k_test), 0, 0, 1, 1}, {&__pyx_n_s_tick, __pyx_k_tick, sizeof(__pyx_k_tick), 0, 0, 1, 1}, {&__pyx_n_s_tick_busy_loop, __pyx_k_tick_busy_loop, sizeof(__pyx_k_tick_busy_loop), 0, 0, 1, 1}, {&__pyx_n_s_timer_id, __pyx_k_timer_id, sizeof(__pyx_k_timer_id), 0, 0, 1, 1}, {&__pyx_n_s_total_time, __pyx_k_total_time, sizeof(__pyx_k_total_time), 0, 0, 1, 1}, {&__pyx_n_s_wait, __pyx_k_wait, sizeof(__pyx_k_wait), 0, 0, 1, 1}, {0, 0, 0, 0, 0, 0, 0} }; static int __Pyx_InitCachedBuiltins(void) { __pyx_builtin_sum = __Pyx_GetBuiltinName(__pyx_n_s_sum); if (!__pyx_builtin_sum) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 116; __pyx_clineno = __LINE__; goto __pyx_L1_error;} return 0; __pyx_L1_error:; return -1; } static int __Pyx_InitCachedConstants(void) { __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__Pyx_InitCachedConstants", 0); /* "pygame_sdl2/pygame_time.pyx":28 * * @pygame_sdl2.register_init * def init(): # <<<<<<<<<<<<<< * pygame_sdl2.display.sdl_main_init() * */ __pyx_codeobj_ = (PyObject*)__Pyx_PyCode_New(0, 0, 0, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_tom_ab_pygame_sdl2_src_pyg, __pyx_n_s_init, 28, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj_)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 28; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "pygame_sdl2/pygame_time.pyx":35 * * @pygame_sdl2.register_quit * def quit(): # @ReservedAssignment # <<<<<<<<<<<<<< * SDL_QuitSubSystem(SDL_INIT_TIMER) * */ __pyx_codeobj__2 = (PyObject*)__Pyx_PyCode_New(0, 0, 0, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_tom_ab_pygame_sdl2_src_pyg, __pyx_n_s_quit, 35, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 35; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "pygame_sdl2/pygame_time.pyx":38 * SDL_QuitSubSystem(SDL_INIT_TIMER) * * def get_ticks(): # <<<<<<<<<<<<<< * return SDL_GetTicks() * */ __pyx_codeobj__3 = (PyObject*)__Pyx_PyCode_New(0, 0, 0, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_tom_ab_pygame_sdl2_src_pyg, __pyx_n_s_get_ticks, 38, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 38; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "pygame_sdl2/pygame_time.pyx":41 * return SDL_GetTicks() * * def wait(int milliseconds): # <<<<<<<<<<<<<< * cdef int start * */ __pyx_tuple__4 = PyTuple_Pack(3, __pyx_n_s_milliseconds, __pyx_n_s_milliseconds, __pyx_n_s_start); if (unlikely(!__pyx_tuple__4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 41; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_tuple__4); __Pyx_GIVEREF(__pyx_tuple__4); __pyx_codeobj__5 = (PyObject*)__Pyx_PyCode_New(1, 0, 3, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__4, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_tom_ab_pygame_sdl2_src_pyg, __pyx_n_s_wait, 41, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 41; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "pygame_sdl2/pygame_time.pyx":49 * return SDL_GetTicks() - start * * def delay(milliseconds): # <<<<<<<<<<<<<< * # SDL_Delay() should be accurate enough. * return wait(milliseconds) */ __pyx_tuple__6 = PyTuple_Pack(1, __pyx_n_s_milliseconds); if (unlikely(!__pyx_tuple__6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 49; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_tuple__6); __Pyx_GIVEREF(__pyx_tuple__6); __pyx_codeobj__7 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__6, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_tom_ab_pygame_sdl2_src_pyg, __pyx_n_s_delay, 49, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 49; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "pygame_sdl2/pygame_time.pyx":65 * cdef dict timer_by_event = { } * * def set_timer(eventid, milliseconds): # <<<<<<<<<<<<<< * * cdef int timer_id = timer_by_event.get(eventid, 0) */ __pyx_tuple__8 = PyTuple_Pack(3, __pyx_n_s_eventid, __pyx_n_s_milliseconds, __pyx_n_s_timer_id); if (unlikely(!__pyx_tuple__8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 65; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_tuple__8); __Pyx_GIVEREF(__pyx_tuple__8); __pyx_codeobj__9 = (PyObject*)__Pyx_PyCode_New(2, 0, 3, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__8, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_tom_ab_pygame_sdl2_src_pyg, __pyx_n_s_set_timer, 65, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 65; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "pygame_sdl2/pygame_time.pyx":81 * * class Clock: * def __init__(self): # <<<<<<<<<<<<<< * self.last = SDL_GetTicks() * self.last_frames = [] */ __pyx_tuple__10 = PyTuple_Pack(1, __pyx_n_s_self); if (unlikely(!__pyx_tuple__10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 81; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_tuple__10); __Pyx_GIVEREF(__pyx_tuple__10); __pyx_codeobj__11 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__10, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_tom_ab_pygame_sdl2_src_pyg, __pyx_n_s_init_2, 81, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 81; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "pygame_sdl2/pygame_time.pyx":87 * self.raw_frametime = 0 * * def tick(self, framerate=0): # <<<<<<<<<<<<<< * cdef int now = SDL_GetTicks() * self.raw_frametime = now - self.last */ __pyx_tuple__12 = PyTuple_Pack(4, __pyx_n_s_self, __pyx_n_s_framerate, __pyx_n_s_now, __pyx_n_s_frame_duration); if (unlikely(!__pyx_tuple__12)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 87; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_tuple__12); __Pyx_GIVEREF(__pyx_tuple__12); __pyx_codeobj__13 = (PyObject*)__Pyx_PyCode_New(2, 0, 4, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__12, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_tom_ab_pygame_sdl2_src_pyg, __pyx_n_s_tick, 87, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__13)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 87; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_tuple__14 = PyTuple_Pack(1, ((PyObject *)__pyx_int_0)); if (unlikely(!__pyx_tuple__14)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 87; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_tuple__14); __Pyx_GIVEREF(__pyx_tuple__14); /* "pygame_sdl2/pygame_time.pyx":105 * return self.frametime * * def tick_busy_loop(self, framerate=0): # <<<<<<<<<<<<<< * return self.tick(framerate) * */ __pyx_tuple__15 = PyTuple_Pack(2, __pyx_n_s_self, __pyx_n_s_framerate); if (unlikely(!__pyx_tuple__15)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 105; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_tuple__15); __Pyx_GIVEREF(__pyx_tuple__15); __pyx_codeobj__16 = (PyObject*)__Pyx_PyCode_New(2, 0, 2, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__15, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_tom_ab_pygame_sdl2_src_pyg, __pyx_n_s_tick_busy_loop, 105, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__16)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 105; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_tuple__17 = PyTuple_Pack(1, ((PyObject *)__pyx_int_0)); if (unlikely(!__pyx_tuple__17)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 105; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_tuple__17); __Pyx_GIVEREF(__pyx_tuple__17); /* "pygame_sdl2/pygame_time.pyx":108 * return self.tick(framerate) * * def get_time(self): # <<<<<<<<<<<<<< * return self.frametime * */ __pyx_tuple__18 = PyTuple_Pack(1, __pyx_n_s_self); if (unlikely(!__pyx_tuple__18)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 108; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_tuple__18); __Pyx_GIVEREF(__pyx_tuple__18); __pyx_codeobj__19 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__18, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_tom_ab_pygame_sdl2_src_pyg, __pyx_n_s_get_time, 108, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__19)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 108; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "pygame_sdl2/pygame_time.pyx":111 * return self.frametime * * def get_rawtime(self): # <<<<<<<<<<<<<< * return self.raw_frametime * */ __pyx_tuple__20 = PyTuple_Pack(1, __pyx_n_s_self); if (unlikely(!__pyx_tuple__20)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 111; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_tuple__20); __Pyx_GIVEREF(__pyx_tuple__20); __pyx_codeobj__21 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__20, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_tom_ab_pygame_sdl2_src_pyg, __pyx_n_s_get_rawtime, 111, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__21)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 111; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "pygame_sdl2/pygame_time.pyx":115 * * @cython.cdivision(True) * def get_fps(self): # <<<<<<<<<<<<<< * cdef int total_time = sum(self.last_frames) * cdef float average_time = total_time / 1000.0 / len(self.last_frames) */ __pyx_tuple__22 = PyTuple_Pack(4, __pyx_n_s_self, __pyx_n_s_total_time, __pyx_n_s_average_time, __pyx_n_s_average_fps); if (unlikely(!__pyx_tuple__22)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 115; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_tuple__22); __Pyx_GIVEREF(__pyx_tuple__22); __pyx_codeobj__23 = (PyObject*)__Pyx_PyCode_New(1, 0, 4, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__22, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_tom_ab_pygame_sdl2_src_pyg, __pyx_n_s_get_fps, 115, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__23)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 115; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_RefNannyFinishContext(); return 0; __pyx_L1_error:; __Pyx_RefNannyFinishContext(); return -1; } static int __Pyx_InitGlobals(void) { if (__Pyx_InitStrings(__pyx_string_tab) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; __pyx_float_1_0 = PyFloat_FromDouble(1.0); if (unlikely(!__pyx_float_1_0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_int_0 = PyInt_FromLong(0); if (unlikely(!__pyx_int_0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_int_1000 = PyInt_FromLong(1000); if (unlikely(!__pyx_int_1000)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} return 0; __pyx_L1_error:; return -1; } #if PY_MAJOR_VERSION < 3 PyMODINIT_FUNC initpygame_time(void); /*proto*/ PyMODINIT_FUNC initpygame_time(void) #else PyMODINIT_FUNC PyInit_pygame_time(void); /*proto*/ PyMODINIT_FUNC PyInit_pygame_time(void) #endif { PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; PyObject *__pyx_t_5 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannyDeclarations #if CYTHON_REFNANNY __Pyx_RefNanny = __Pyx_RefNannyImportAPI("refnanny"); if (!__Pyx_RefNanny) { PyErr_Clear(); __Pyx_RefNanny = __Pyx_RefNannyImportAPI("Cython.Runtime.refnanny"); if (!__Pyx_RefNanny) Py_FatalError("failed to import 'refnanny' module"); } #endif __Pyx_RefNannySetupContext("PyMODINIT_FUNC PyInit_pygame_time(void)", 0); if (__Pyx_check_binary_version() < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_empty_tuple = PyTuple_New(0); if (unlikely(!__pyx_empty_tuple)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_empty_bytes = PyBytes_FromStringAndSize("", 0); if (unlikely(!__pyx_empty_bytes)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} #ifdef __Pyx_CyFunction_USED if (__pyx_CyFunction_init() < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} #endif #ifdef __Pyx_FusedFunction_USED if (__pyx_FusedFunction_init() < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} #endif #ifdef __Pyx_Coroutine_USED if (__pyx_Coroutine_init() < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} #endif #ifdef __Pyx_Generator_USED if (__pyx_Generator_init() < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} #endif #ifdef __Pyx_StopAsyncIteration_USED if (__pyx_StopAsyncIteration_init() < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} #endif /*--- Library function declarations ---*/ /*--- Threads initialization code ---*/ #if defined(__PYX_FORCE_INIT_THREADS) && __PYX_FORCE_INIT_THREADS #ifdef WITH_THREAD /* Python build with threading support? */ PyEval_InitThreads(); #endif #endif /*--- Module creation code ---*/ #if PY_MAJOR_VERSION < 3 __pyx_m = Py_InitModule4("pygame_time", __pyx_methods, 0, 0, PYTHON_API_VERSION); Py_XINCREF(__pyx_m); #else __pyx_m = PyModule_Create(&__pyx_moduledef); #endif if (unlikely(!__pyx_m)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_d = PyModule_GetDict(__pyx_m); if (unlikely(!__pyx_d)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} Py_INCREF(__pyx_d); __pyx_b = PyImport_AddModule(__Pyx_BUILTIN_MODULE_NAME); if (unlikely(!__pyx_b)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} #if CYTHON_COMPILING_IN_PYPY Py_INCREF(__pyx_b); #endif if (PyObject_SetAttrString(__pyx_m, "__builtins__", __pyx_b) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; /*--- Initialize various global constants etc. ---*/ if (__Pyx_InitGlobals() < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} #if PY_MAJOR_VERSION < 3 && (__PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT) if (__Pyx_init_sys_getdefaultencoding_params() < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} #endif if (__pyx_module_is_main_pygame_sdl2__pygame_time) { if (PyObject_SetAttrString(__pyx_m, "__name__", __pyx_n_s_main) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } #if PY_MAJOR_VERSION >= 3 { PyObject *modules = PyImport_GetModuleDict(); if (unlikely(!modules)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} if (!PyDict_GetItemString(modules, "pygame_sdl2.pygame_time")) { if (unlikely(PyDict_SetItemString(modules, "pygame_sdl2.pygame_time", __pyx_m) < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } } #endif /*--- Builtin init code ---*/ if (__Pyx_InitCachedBuiltins() < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /*--- Constants init code ---*/ if (__Pyx_InitCachedConstants() < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /*--- Global init code ---*/ __pyx_v_11pygame_sdl2_11pygame_time_timer_by_event = ((PyObject*)Py_None); Py_INCREF(Py_None); /*--- Variable export code ---*/ /*--- Function export code ---*/ /*--- Type init code ---*/ /*--- Type import code ---*/ /*--- Variable import code ---*/ /*--- Function import code ---*/ /*--- Execution code ---*/ #if defined(__Pyx_Generator_USED) || defined(__Pyx_Coroutine_USED) if (__Pyx_patch_abc() < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} #endif /* "pygame_sdl2/pygame_time.pyx":20 * * import cython * import math # <<<<<<<<<<<<<< * from sdl2 cimport * * from pygame_sdl2.error import error */ __pyx_t_1 = __Pyx_Import(__pyx_n_s_math, 0, 0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 20; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); if (PyDict_SetItem(__pyx_d, __pyx_n_s_math, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 20; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "pygame_sdl2/pygame_time.pyx":22 * import math * from sdl2 cimport * * from pygame_sdl2.error import error # <<<<<<<<<<<<<< * import pygame_sdl2 * */ __pyx_t_1 = PyList_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 22; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __Pyx_INCREF(__pyx_n_s_error); __Pyx_GIVEREF(__pyx_n_s_error); PyList_SET_ITEM(__pyx_t_1, 0, __pyx_n_s_error); __pyx_t_2 = __Pyx_Import(__pyx_n_s_pygame_sdl2_error, __pyx_t_1, 0); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 22; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_1 = __Pyx_ImportFrom(__pyx_t_2, __pyx_n_s_error); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 22; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); if (PyDict_SetItem(__pyx_d, __pyx_n_s_error, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 22; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "pygame_sdl2/pygame_time.pyx":23 * from sdl2 cimport * * from pygame_sdl2.error import error * import pygame_sdl2 # <<<<<<<<<<<<<< * * cdef int timer_id = 0 */ __pyx_t_2 = __Pyx_Import(__pyx_n_s_pygame_sdl2, 0, 0); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 23; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_pygame_sdl2, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 23; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "pygame_sdl2/pygame_time.pyx":25 * import pygame_sdl2 * * cdef int timer_id = 0 # <<<<<<<<<<<<<< * * @pygame_sdl2.register_init */ __pyx_v_11pygame_sdl2_11pygame_time_timer_id = 0; /* "pygame_sdl2/pygame_time.pyx":27 * cdef int timer_id = 0 * * @pygame_sdl2.register_init # <<<<<<<<<<<<<< * def init(): * pygame_sdl2.display.sdl_main_init() */ __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_pygame_sdl2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 27; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_register_init); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 27; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "pygame_sdl2/pygame_time.pyx":28 * * @pygame_sdl2.register_init * def init(): # <<<<<<<<<<<<<< * pygame_sdl2.display.sdl_main_init() * */ __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_11pygame_sdl2_11pygame_time_1init, NULL, __pyx_n_s_pygame_sdl2_pygame_time); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 28; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_t_4 = NULL; if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_3))) { __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3); if (likely(__pyx_t_4)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); __Pyx_INCREF(__pyx_t_4); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_3, function); } } if (!__pyx_t_4) { __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 27; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_GOTREF(__pyx_t_2); } else { __pyx_t_5 = PyTuple_New(1+1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 27; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_4); __pyx_t_4 = NULL; __Pyx_GIVEREF(__pyx_t_1); PyTuple_SET_ITEM(__pyx_t_5, 0+1, __pyx_t_1); __pyx_t_1 = 0; __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_5, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 27; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; } __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; if (PyDict_SetItem(__pyx_d, __pyx_n_s_init, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 28; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "pygame_sdl2/pygame_time.pyx":34 * raise error() * * @pygame_sdl2.register_quit # <<<<<<<<<<<<<< * def quit(): # @ReservedAssignment * SDL_QuitSubSystem(SDL_INIT_TIMER) */ __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_pygame_sdl2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 34; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_register_quit); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 34; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "pygame_sdl2/pygame_time.pyx":35 * * @pygame_sdl2.register_quit * def quit(): # @ReservedAssignment # <<<<<<<<<<<<<< * SDL_QuitSubSystem(SDL_INIT_TIMER) * */ __pyx_t_3 = PyCFunction_NewEx(&__pyx_mdef_11pygame_sdl2_11pygame_time_3quit, NULL, __pyx_n_s_pygame_sdl2_pygame_time); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 35; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __pyx_t_1 = NULL; if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_5))) { __pyx_t_1 = PyMethod_GET_SELF(__pyx_t_5); if (likely(__pyx_t_1)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5); __Pyx_INCREF(__pyx_t_1); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_5, function); } } if (!__pyx_t_1) { __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_t_3); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 34; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_GOTREF(__pyx_t_2); } else { __pyx_t_4 = PyTuple_New(1+1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 34; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); __Pyx_GIVEREF(__pyx_t_1); PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_1); __pyx_t_1 = NULL; __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_4, 0+1, __pyx_t_3); __pyx_t_3 = 0; __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_4, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 34; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; } __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; if (PyDict_SetItem(__pyx_d, __pyx_n_s_quit, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 35; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "pygame_sdl2/pygame_time.pyx":38 * SDL_QuitSubSystem(SDL_INIT_TIMER) * * def get_ticks(): # <<<<<<<<<<<<<< * return SDL_GetTicks() * */ __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_11pygame_sdl2_11pygame_time_5get_ticks, NULL, __pyx_n_s_pygame_sdl2_pygame_time); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 38; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_get_ticks, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 38; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "pygame_sdl2/pygame_time.pyx":41 * return SDL_GetTicks() * * def wait(int milliseconds): # <<<<<<<<<<<<<< * cdef int start * */ __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_11pygame_sdl2_11pygame_time_7wait, NULL, __pyx_n_s_pygame_sdl2_pygame_time); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 41; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_wait, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 41; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "pygame_sdl2/pygame_time.pyx":49 * return SDL_GetTicks() - start * * def delay(milliseconds): # <<<<<<<<<<<<<< * # SDL_Delay() should be accurate enough. * return wait(milliseconds) */ __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_11pygame_sdl2_11pygame_time_9delay, NULL, __pyx_n_s_pygame_sdl2_pygame_time); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 49; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_delay, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 49; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "pygame_sdl2/pygame_time.pyx":63 * * # A map from eventid to SDL_Timer_ID. * cdef dict timer_by_event = { } # <<<<<<<<<<<<<< * * def set_timer(eventid, milliseconds): */ __pyx_t_2 = PyDict_New(); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 63; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __Pyx_XGOTREF(__pyx_v_11pygame_sdl2_11pygame_time_timer_by_event); __Pyx_DECREF_SET(__pyx_v_11pygame_sdl2_11pygame_time_timer_by_event, ((PyObject*)__pyx_t_2)); __Pyx_GIVEREF(__pyx_t_2); __pyx_t_2 = 0; /* "pygame_sdl2/pygame_time.pyx":65 * cdef dict timer_by_event = { } * * def set_timer(eventid, milliseconds): # <<<<<<<<<<<<<< * * cdef int timer_id = timer_by_event.get(eventid, 0) */ __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_11pygame_sdl2_11pygame_time_11set_timer, NULL, __pyx_n_s_pygame_sdl2_pygame_time); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 65; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_set_timer, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 65; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "pygame_sdl2/pygame_time.pyx":80 * timer_by_event[eventid] = timer_id * * class Clock: # <<<<<<<<<<<<<< * def __init__(self): * self.last = SDL_GetTicks() */ __pyx_t_2 = __Pyx_Py3MetaclassPrepare((PyObject *) NULL, __pyx_empty_tuple, __pyx_n_s_Clock, __pyx_n_s_Clock, (PyObject *) NULL, __pyx_n_s_pygame_sdl2_pygame_time, (PyObject *) NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 80; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); /* "pygame_sdl2/pygame_time.pyx":81 * * class Clock: * def __init__(self): # <<<<<<<<<<<<<< * self.last = SDL_GetTicks() * self.last_frames = [] */ __pyx_t_5 = __Pyx_CyFunction_NewEx(&__pyx_mdef_11pygame_sdl2_11pygame_time_5Clock_1__init__, 0, __pyx_n_s_Clock___init, NULL, __pyx_n_s_pygame_sdl2_pygame_time, __pyx_d, ((PyObject *)__pyx_codeobj__11)); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 81; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); if (PyObject_SetItem(__pyx_t_2, __pyx_n_s_init_2, __pyx_t_5) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 81; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; /* "pygame_sdl2/pygame_time.pyx":87 * self.raw_frametime = 0 * * def tick(self, framerate=0): # <<<<<<<<<<<<<< * cdef int now = SDL_GetTicks() * self.raw_frametime = now - self.last */ __pyx_t_5 = __Pyx_CyFunction_NewEx(&__pyx_mdef_11pygame_sdl2_11pygame_time_5Clock_3tick, 0, __pyx_n_s_Clock_tick, NULL, __pyx_n_s_pygame_sdl2_pygame_time, __pyx_d, ((PyObject *)__pyx_codeobj__13)); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 87; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_5, __pyx_tuple__14); if (PyObject_SetItem(__pyx_t_2, __pyx_n_s_tick, __pyx_t_5) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 87; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; /* "pygame_sdl2/pygame_time.pyx":105 * return self.frametime * * def tick_busy_loop(self, framerate=0): # <<<<<<<<<<<<<< * return self.tick(framerate) * */ __pyx_t_5 = __Pyx_CyFunction_NewEx(&__pyx_mdef_11pygame_sdl2_11pygame_time_5Clock_5tick_busy_loop, 0, __pyx_n_s_Clock_tick_busy_loop, NULL, __pyx_n_s_pygame_sdl2_pygame_time, __pyx_d, ((PyObject *)__pyx_codeobj__16)); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 105; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_5, __pyx_tuple__17); if (PyObject_SetItem(__pyx_t_2, __pyx_n_s_tick_busy_loop, __pyx_t_5) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 105; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; /* "pygame_sdl2/pygame_time.pyx":108 * return self.tick(framerate) * * def get_time(self): # <<<<<<<<<<<<<< * return self.frametime * */ __pyx_t_5 = __Pyx_CyFunction_NewEx(&__pyx_mdef_11pygame_sdl2_11pygame_time_5Clock_7get_time, 0, __pyx_n_s_Clock_get_time, NULL, __pyx_n_s_pygame_sdl2_pygame_time, __pyx_d, ((PyObject *)__pyx_codeobj__19)); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 108; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); if (PyObject_SetItem(__pyx_t_2, __pyx_n_s_get_time, __pyx_t_5) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 108; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; /* "pygame_sdl2/pygame_time.pyx":111 * return self.frametime * * def get_rawtime(self): # <<<<<<<<<<<<<< * return self.raw_frametime * */ __pyx_t_5 = __Pyx_CyFunction_NewEx(&__pyx_mdef_11pygame_sdl2_11pygame_time_5Clock_9get_rawtime, 0, __pyx_n_s_Clock_get_rawtime, NULL, __pyx_n_s_pygame_sdl2_pygame_time, __pyx_d, ((PyObject *)__pyx_codeobj__21)); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 111; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); if (PyObject_SetItem(__pyx_t_2, __pyx_n_s_get_rawtime, __pyx_t_5) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 111; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; /* "pygame_sdl2/pygame_time.pyx":115 * * @cython.cdivision(True) * def get_fps(self): # <<<<<<<<<<<<<< * cdef int total_time = sum(self.last_frames) * cdef float average_time = total_time / 1000.0 / len(self.last_frames) */ __pyx_t_5 = __Pyx_CyFunction_NewEx(&__pyx_mdef_11pygame_sdl2_11pygame_time_5Clock_11get_fps, 0, __pyx_n_s_Clock_get_fps, NULL, __pyx_n_s_pygame_sdl2_pygame_time, __pyx_d, ((PyObject *)__pyx_codeobj__23)); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 115; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); if (PyObject_SetItem(__pyx_t_2, __pyx_n_s_get_fps, __pyx_t_5) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 115; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; /* "pygame_sdl2/pygame_time.pyx":80 * timer_by_event[eventid] = timer_id * * class Clock: # <<<<<<<<<<<<<< * def __init__(self): * self.last = SDL_GetTicks() */ __pyx_t_5 = __Pyx_Py3ClassCreate(((PyObject*)&__Pyx_DefaultClassType), __pyx_n_s_Clock, __pyx_empty_tuple, __pyx_t_2, NULL, 0, 0); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 80; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); if (PyDict_SetItem(__pyx_d, __pyx_n_s_Clock, __pyx_t_5) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 80; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "pygame_sdl2/pygame_time.pyx":1 * # Copyright 2014 Patrick Dawson # <<<<<<<<<<<<<< * # * # This software is provided 'as-is', without any express or implied */ __pyx_t_2 = PyDict_New(); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_test, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /*--- Wrapped vars code ---*/ goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_5); if (__pyx_m) { if (__pyx_d) { __Pyx_AddTraceback("init pygame_sdl2.pygame_time", __pyx_clineno, __pyx_lineno, __pyx_filename); } Py_DECREF(__pyx_m); __pyx_m = 0; } else if (!PyErr_Occurred()) { PyErr_SetString(PyExc_ImportError, "init pygame_sdl2.pygame_time"); } __pyx_L0:; __Pyx_RefNannyFinishContext(); #if PY_MAJOR_VERSION < 3 return; #else return __pyx_m; #endif } /* --- Runtime support code --- */ #if CYTHON_REFNANNY static __Pyx_RefNannyAPIStruct *__Pyx_RefNannyImportAPI(const char *modname) { PyObject *m = NULL, *p = NULL; void *r = NULL; m = PyImport_ImportModule((char *)modname); if (!m) goto end; p = PyObject_GetAttrString(m, (char *)"RefNannyAPI"); if (!p) goto end; r = PyLong_AsVoidPtr(p); end: Py_XDECREF(p); Py_XDECREF(m); return (__Pyx_RefNannyAPIStruct *)r; } #endif static PyObject *__Pyx_GetBuiltinName(PyObject *name) { PyObject* result = __Pyx_PyObject_GetAttrStr(__pyx_b, name); if (unlikely(!result)) { PyErr_Format(PyExc_NameError, #if PY_MAJOR_VERSION >= 3 "name '%U' is not defined", name); #else "name '%.200s' is not defined", PyString_AS_STRING(name)); #endif } return result; } static CYTHON_INLINE PyObject *__Pyx_GetModuleGlobalName(PyObject *name) { PyObject *result; #if CYTHON_COMPILING_IN_CPYTHON result = PyDict_GetItem(__pyx_d, name); if (likely(result)) { Py_INCREF(result); } else { #else result = PyObject_GetItem(__pyx_d, name); if (!result) { PyErr_Clear(); #endif result = __Pyx_GetBuiltinName(name); } return result; } #if CYTHON_COMPILING_IN_CPYTHON static CYTHON_INLINE PyObject* __Pyx_PyObject_Call(PyObject *func, PyObject *arg, PyObject *kw) { PyObject *result; ternaryfunc call = func->ob_type->tp_call; if (unlikely(!call)) return PyObject_Call(func, arg, kw); if (unlikely(Py_EnterRecursiveCall((char*)" while calling a Python object"))) return NULL; result = (*call)(func, arg, kw); Py_LeaveRecursiveCall(); if (unlikely(!result) && unlikely(!PyErr_Occurred())) { PyErr_SetString( PyExc_SystemError, "NULL result without error in PyObject_Call"); } return result; } #endif #if CYTHON_COMPILING_IN_CPYTHON static CYTHON_INLINE PyObject* __Pyx_PyObject_CallMethO(PyObject *func, PyObject *arg) { PyObject *self, *result; PyCFunction cfunc; cfunc = PyCFunction_GET_FUNCTION(func); self = PyCFunction_GET_SELF(func); if (unlikely(Py_EnterRecursiveCall((char*)" while calling a Python object"))) return NULL; result = cfunc(self, arg); Py_LeaveRecursiveCall(); if (unlikely(!result) && unlikely(!PyErr_Occurred())) { PyErr_SetString( PyExc_SystemError, "NULL result without error in PyObject_Call"); } return result; } #endif #if CYTHON_COMPILING_IN_CPYTHON static PyObject* __Pyx__PyObject_CallOneArg(PyObject *func, PyObject *arg) { PyObject *result; PyObject *args = PyTuple_New(1); if (unlikely(!args)) return NULL; Py_INCREF(arg); PyTuple_SET_ITEM(args, 0, arg); result = __Pyx_PyObject_Call(func, args, NULL); Py_DECREF(args); return result; } static CYTHON_INLINE PyObject* __Pyx_PyObject_CallOneArg(PyObject *func, PyObject *arg) { #ifdef __Pyx_CyFunction_USED if (likely(PyCFunction_Check(func) || PyObject_TypeCheck(func, __pyx_CyFunctionType))) { #else if (likely(PyCFunction_Check(func))) { #endif if (likely(PyCFunction_GET_FLAGS(func) & METH_O)) { return __Pyx_PyObject_CallMethO(func, arg); } } return __Pyx__PyObject_CallOneArg(func, arg); } #else static CYTHON_INLINE PyObject* __Pyx_PyObject_CallOneArg(PyObject *func, PyObject *arg) { PyObject* args = PyTuple_Pack(1, arg); return (likely(args)) ? __Pyx_PyObject_Call(func, args, NULL) : NULL; } #endif #if CYTHON_COMPILING_IN_CPYTHON static CYTHON_INLINE PyObject* __Pyx_PyObject_CallNoArg(PyObject *func) { #ifdef __Pyx_CyFunction_USED if (likely(PyCFunction_Check(func) || PyObject_TypeCheck(func, __pyx_CyFunctionType))) { #else if (likely(PyCFunction_Check(func))) { #endif if (likely(PyCFunction_GET_FLAGS(func) & METH_NOARGS)) { return __Pyx_PyObject_CallMethO(func, NULL); } } return __Pyx_PyObject_Call(func, __pyx_empty_tuple, NULL); } #endif static CYTHON_INLINE void __Pyx_ErrRestore(PyObject *type, PyObject *value, PyObject *tb) { #if CYTHON_COMPILING_IN_CPYTHON PyObject *tmp_type, *tmp_value, *tmp_tb; PyThreadState *tstate = PyThreadState_GET(); tmp_type = tstate->curexc_type; tmp_value = tstate->curexc_value; tmp_tb = tstate->curexc_traceback; tstate->curexc_type = type; tstate->curexc_value = value; tstate->curexc_traceback = tb; Py_XDECREF(tmp_type); Py_XDECREF(tmp_value); Py_XDECREF(tmp_tb); #else PyErr_Restore(type, value, tb); #endif } static CYTHON_INLINE void __Pyx_ErrFetch(PyObject **type, PyObject **value, PyObject **tb) { #if CYTHON_COMPILING_IN_CPYTHON PyThreadState *tstate = PyThreadState_GET(); *type = tstate->curexc_type; *value = tstate->curexc_value; *tb = tstate->curexc_traceback; tstate->curexc_type = 0; tstate->curexc_value = 0; tstate->curexc_traceback = 0; #else PyErr_Fetch(type, value, tb); #endif } #if PY_MAJOR_VERSION < 3 static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, CYTHON_UNUSED PyObject *cause) { Py_XINCREF(type); if (!value || value == Py_None) value = NULL; else Py_INCREF(value); if (!tb || tb == Py_None) tb = NULL; else { Py_INCREF(tb); if (!PyTraceBack_Check(tb)) { PyErr_SetString(PyExc_TypeError, "raise: arg 3 must be a traceback or None"); goto raise_error; } } if (PyType_Check(type)) { #if CYTHON_COMPILING_IN_PYPY if (!value) { Py_INCREF(Py_None); value = Py_None; } #endif PyErr_NormalizeException(&type, &value, &tb); } else { if (value) { PyErr_SetString(PyExc_TypeError, "instance exception may not have a separate value"); goto raise_error; } value = type; type = (PyObject*) Py_TYPE(type); Py_INCREF(type); if (!PyType_IsSubtype((PyTypeObject *)type, (PyTypeObject *)PyExc_BaseException)) { PyErr_SetString(PyExc_TypeError, "raise: exception class must be a subclass of BaseException"); goto raise_error; } } __Pyx_ErrRestore(type, value, tb); return; raise_error: Py_XDECREF(value); Py_XDECREF(type); Py_XDECREF(tb); return; } #else static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, PyObject *cause) { PyObject* owned_instance = NULL; if (tb == Py_None) { tb = 0; } else if (tb && !PyTraceBack_Check(tb)) { PyErr_SetString(PyExc_TypeError, "raise: arg 3 must be a traceback or None"); goto bad; } if (value == Py_None) value = 0; if (PyExceptionInstance_Check(type)) { if (value) { PyErr_SetString(PyExc_TypeError, "instance exception may not have a separate value"); goto bad; } value = type; type = (PyObject*) Py_TYPE(value); } else if (PyExceptionClass_Check(type)) { PyObject *instance_class = NULL; if (value && PyExceptionInstance_Check(value)) { instance_class = (PyObject*) Py_TYPE(value); if (instance_class != type) { int is_subclass = PyObject_IsSubclass(instance_class, type); if (!is_subclass) { instance_class = NULL; } else if (unlikely(is_subclass == -1)) { goto bad; } else { type = instance_class; } } } if (!instance_class) { PyObject *args; if (!value) args = PyTuple_New(0); else if (PyTuple_Check(value)) { Py_INCREF(value); args = value; } else args = PyTuple_Pack(1, value); if (!args) goto bad; owned_instance = PyObject_Call(type, args, NULL); Py_DECREF(args); if (!owned_instance) goto bad; value = owned_instance; if (!PyExceptionInstance_Check(value)) { PyErr_Format(PyExc_TypeError, "calling %R should have returned an instance of " "BaseException, not %R", type, Py_TYPE(value)); goto bad; } } } else { PyErr_SetString(PyExc_TypeError, "raise: exception class must be a subclass of BaseException"); goto bad; } #if PY_VERSION_HEX >= 0x03030000 if (cause) { #else if (cause && cause != Py_None) { #endif PyObject *fixed_cause; if (cause == Py_None) { fixed_cause = NULL; } else if (PyExceptionClass_Check(cause)) { fixed_cause = PyObject_CallObject(cause, NULL); if (fixed_cause == NULL) goto bad; } else if (PyExceptionInstance_Check(cause)) { fixed_cause = cause; Py_INCREF(fixed_cause); } else { PyErr_SetString(PyExc_TypeError, "exception causes must derive from " "BaseException"); goto bad; } PyException_SetCause(value, fixed_cause); } PyErr_SetObject(type, value); if (tb) { #if CYTHON_COMPILING_IN_PYPY PyObject *tmp_type, *tmp_value, *tmp_tb; PyErr_Fetch(&tmp_type, &tmp_value, &tmp_tb); Py_INCREF(tb); PyErr_Restore(tmp_type, tmp_value, tb); Py_XDECREF(tmp_tb); #else PyThreadState *tstate = PyThreadState_GET(); PyObject* tmp_tb = tstate->curexc_traceback; if (tb != tmp_tb) { Py_INCREF(tb); tstate->curexc_traceback = tb; Py_XDECREF(tmp_tb); } #endif } bad: Py_XDECREF(owned_instance); return; } #endif static void __Pyx_RaiseArgtupleInvalid( const char* func_name, int exact, Py_ssize_t num_min, Py_ssize_t num_max, Py_ssize_t num_found) { Py_ssize_t num_expected; const char *more_or_less; if (num_found < num_min) { num_expected = num_min; more_or_less = "at least"; } else { num_expected = num_max; more_or_less = "at most"; } if (exact) { more_or_less = "exactly"; } PyErr_Format(PyExc_TypeError, "%.200s() takes %.8s %" CYTHON_FORMAT_SSIZE_T "d positional argument%.1s (%" CYTHON_FORMAT_SSIZE_T "d given)", func_name, more_or_less, num_expected, (num_expected == 1) ? "" : "s", num_found); } static void __Pyx_RaiseDoubleKeywordsError( const char* func_name, PyObject* kw_name) { PyErr_Format(PyExc_TypeError, #if PY_MAJOR_VERSION >= 3 "%s() got multiple values for keyword argument '%U'", func_name, kw_name); #else "%s() got multiple values for keyword argument '%s'", func_name, PyString_AsString(kw_name)); #endif } static int __Pyx_ParseOptionalKeywords( PyObject *kwds, PyObject **argnames[], PyObject *kwds2, PyObject *values[], Py_ssize_t num_pos_args, const char* function_name) { PyObject *key = 0, *value = 0; Py_ssize_t pos = 0; PyObject*** name; PyObject*** first_kw_arg = argnames + num_pos_args; while (PyDict_Next(kwds, &pos, &key, &value)) { name = first_kw_arg; while (*name && (**name != key)) name++; if (*name) { values[name-argnames] = value; continue; } name = first_kw_arg; #if PY_MAJOR_VERSION < 3 if (likely(PyString_CheckExact(key)) || likely(PyString_Check(key))) { while (*name) { if ((CYTHON_COMPILING_IN_PYPY || PyString_GET_SIZE(**name) == PyString_GET_SIZE(key)) && _PyString_Eq(**name, key)) { values[name-argnames] = value; break; } name++; } if (*name) continue; else { PyObject*** argname = argnames; while (argname != first_kw_arg) { if ((**argname == key) || ( (CYTHON_COMPILING_IN_PYPY || PyString_GET_SIZE(**argname) == PyString_GET_SIZE(key)) && _PyString_Eq(**argname, key))) { goto arg_passed_twice; } argname++; } } } else #endif if (likely(PyUnicode_Check(key))) { while (*name) { int cmp = (**name == key) ? 0 : #if !CYTHON_COMPILING_IN_PYPY && PY_MAJOR_VERSION >= 3 (PyUnicode_GET_SIZE(**name) != PyUnicode_GET_SIZE(key)) ? 1 : #endif PyUnicode_Compare(**name, key); if (cmp < 0 && unlikely(PyErr_Occurred())) goto bad; if (cmp == 0) { values[name-argnames] = value; break; } name++; } if (*name) continue; else { PyObject*** argname = argnames; while (argname != first_kw_arg) { int cmp = (**argname == key) ? 0 : #if !CYTHON_COMPILING_IN_PYPY && PY_MAJOR_VERSION >= 3 (PyUnicode_GET_SIZE(**argname) != PyUnicode_GET_SIZE(key)) ? 1 : #endif PyUnicode_Compare(**argname, key); if (cmp < 0 && unlikely(PyErr_Occurred())) goto bad; if (cmp == 0) goto arg_passed_twice; argname++; } } } else goto invalid_keyword_type; if (kwds2) { if (unlikely(PyDict_SetItem(kwds2, key, value))) goto bad; } else { goto invalid_keyword; } } return 0; arg_passed_twice: __Pyx_RaiseDoubleKeywordsError(function_name, key); goto bad; invalid_keyword_type: PyErr_Format(PyExc_TypeError, "%.200s() keywords must be strings", function_name); goto bad; invalid_keyword: PyErr_Format(PyExc_TypeError, #if PY_MAJOR_VERSION < 3 "%.200s() got an unexpected keyword argument '%.200s'", function_name, PyString_AsString(key)); #else "%s() got an unexpected keyword argument '%U'", function_name, key); #endif bad: return -1; } static PyObject* __Pyx_PyDict_GetItemDefault(PyObject* d, PyObject* key, PyObject* default_value) { PyObject* value; #if PY_MAJOR_VERSION >= 3 && !CYTHON_COMPILING_IN_PYPY value = PyDict_GetItemWithError(d, key); if (unlikely(!value)) { if (unlikely(PyErr_Occurred())) return NULL; value = default_value; } Py_INCREF(value); #else if (PyString_CheckExact(key) || PyUnicode_CheckExact(key) || PyInt_CheckExact(key)) { value = PyDict_GetItem(d, key); if (unlikely(!value)) { value = default_value; } Py_INCREF(value); } else { if (default_value == Py_None) default_value = NULL; value = PyObject_CallMethodObjArgs( d, __pyx_n_s_get, key, default_value, NULL); } #endif return value; } static PyObject* __Pyx_PyObject_CallMethod1(PyObject* obj, PyObject* method_name, PyObject* arg) { PyObject *method, *result = NULL; method = __Pyx_PyObject_GetAttrStr(obj, method_name); if (unlikely(!method)) goto bad; #if CYTHON_COMPILING_IN_CPYTHON if (likely(PyMethod_Check(method))) { PyObject *self = PyMethod_GET_SELF(method); if (likely(self)) { PyObject *args; PyObject *function = PyMethod_GET_FUNCTION(method); args = PyTuple_New(2); if (unlikely(!args)) goto bad; Py_INCREF(self); PyTuple_SET_ITEM(args, 0, self); Py_INCREF(arg); PyTuple_SET_ITEM(args, 1, arg); Py_INCREF(function); Py_DECREF(method); method = NULL; result = __Pyx_PyObject_Call(function, args, NULL); Py_DECREF(args); Py_DECREF(function); return result; } } #endif result = __Pyx_PyObject_CallOneArg(method, arg); bad: Py_XDECREF(method); return result; } static PyObject* __Pyx__PyObject_PopNewIndex(PyObject* L, PyObject* py_ix) { PyObject *r; if (unlikely(!py_ix)) return NULL; r = __Pyx__PyObject_PopIndex(L, py_ix); Py_DECREF(py_ix); return r; } static PyObject* __Pyx__PyObject_PopIndex(PyObject* L, PyObject* py_ix) { return __Pyx_PyObject_CallMethod1(L, __pyx_n_s_pop, py_ix); } #if CYTHON_COMPILING_IN_CPYTHON static PyObject* __Pyx__PyList_PopIndex(PyObject* L, PyObject* py_ix, Py_ssize_t ix) { Py_ssize_t size = PyList_GET_SIZE(L); if (likely(size > (((PyListObject*)L)->allocated >> 1))) { Py_ssize_t cix = ix; if (cix < 0) { cix += size; } if (likely(0 <= cix && cix < size)) { PyObject* v = PyList_GET_ITEM(L, cix); Py_SIZE(L) -= 1; size -= 1; memmove(&PyList_GET_ITEM(L, cix), &PyList_GET_ITEM(L, cix+1), (size_t)(size-cix)*sizeof(PyObject*)); return v; } } if (py_ix == Py_None) { return __Pyx__PyObject_PopNewIndex(L, PyInt_FromSsize_t(ix)); } else { return __Pyx__PyObject_PopIndex(L, py_ix); } } #endif #if CYTHON_USE_PYLONG_INTERNALS #include "longintrepr.h" #endif #if CYTHON_COMPILING_IN_CPYTHON static PyObject* __Pyx_PyInt_EqObjC(PyObject *op1, PyObject *op2, CYTHON_UNUSED long intval, CYTHON_UNUSED int inplace) { if (op1 == op2) { Py_RETURN_TRUE; } #if PY_MAJOR_VERSION < 3 if (likely(PyInt_CheckExact(op1))) { const long b = intval; long a = PyInt_AS_LONG(op1); if (a == b) { Py_RETURN_TRUE; } else { Py_RETURN_FALSE; } } #endif #if CYTHON_USE_PYLONG_INTERNALS && PY_MAJOR_VERSION >= 3 if (likely(PyLong_CheckExact(op1))) { const long b = intval; long a; const digit* digits = ((PyLongObject*)op1)->ob_digit; const Py_ssize_t size = Py_SIZE(op1); if (likely(__Pyx_sst_abs(size) <= 1)) { a = likely(size) ? digits[0] : 0; if (size == -1) a = -a; } else { switch (size) { case -2: if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) { a = -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])); break; } case 2: if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) { a = (long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])); break; } case -3: if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) { a = -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])); break; } case 3: if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) { a = (long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])); break; } case -4: if (8 * sizeof(long) - 1 > 4 * PyLong_SHIFT) { a = -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])); break; } case 4: if (8 * sizeof(long) - 1 > 4 * PyLong_SHIFT) { a = (long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])); break; } #if PyLong_SHIFT < 30 && PyLong_SHIFT != 15 default: return PyLong_Type.tp_richcompare(op1, op2, Py_EQ); #else default: Py_RETURN_FALSE; #endif } } if (a == b) { Py_RETURN_TRUE; } else { Py_RETURN_FALSE; } } #endif if (PyFloat_CheckExact(op1)) { const long b = intval; double a = PyFloat_AS_DOUBLE(op1); if ((double)a == (double)b) { Py_RETURN_TRUE; } else { Py_RETURN_FALSE; } } return PyObject_RichCompare(op1, op2, Py_EQ); } #endif static CYTHON_INLINE int __Pyx_PyObject_Append(PyObject* L, PyObject* x) { if (likely(PyList_CheckExact(L))) { if (unlikely(__Pyx_PyList_Append(L, x) < 0)) return -1; } else { PyObject* retval = __Pyx_PyObject_CallMethod1(L, __pyx_n_s_append, x); if (unlikely(!retval)) return -1; Py_DECREF(retval); } return 0; } #if CYTHON_COMPILING_IN_CPYTHON static PyObject* __Pyx_PyFloat_TrueDivideCObj(PyObject *op1, PyObject *op2, double floatval, CYTHON_UNUSED int inplace) { const double a = floatval; double b, result; if (likely(PyFloat_CheckExact(op2))) { b = PyFloat_AS_DOUBLE(op2); } else #if PY_MAJOR_VERSION < 3 if (likely(PyInt_CheckExact(op2))) { b = (double) PyInt_AS_LONG(op2); } else #endif if (likely(PyLong_CheckExact(op2))) { #if CYTHON_USE_PYLONG_INTERNALS && PY_MAJOR_VERSION >= 3 const digit* digits = ((PyLongObject*)op2)->ob_digit; const Py_ssize_t size = Py_SIZE(op2); switch (size) { case 0: b = 0.0; break; case -1: b = -(double) digits[0]; break; case 1: b = (double) digits[0]; break; case -2: case 2: if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT && ((8 * sizeof(unsigned long) < 53) || (1 * PyLong_SHIFT < 53))) { b = (double) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])); if ((8 * sizeof(unsigned long) < 53) || (2 * PyLong_SHIFT < 53) || (b < (double) (1L<<53))) { if (size == -2) b = -b; break; } } case -3: case 3: if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT && ((8 * sizeof(unsigned long) < 53) || (2 * PyLong_SHIFT < 53))) { b = (double) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])); if ((8 * sizeof(unsigned long) < 53) || (3 * PyLong_SHIFT < 53) || (b < (double) (1L<<53))) { if (size == -3) b = -b; break; } } case -4: case 4: if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT && ((8 * sizeof(unsigned long) < 53) || (3 * PyLong_SHIFT < 53))) { b = (double) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])); if ((8 * sizeof(unsigned long) < 53) || (4 * PyLong_SHIFT < 53) || (b < (double) (1L<<53))) { if (size == -4) b = -b; break; } } default: #else { #endif b = PyLong_AsDouble(op2); if (unlikely(b == -1.0 && PyErr_Occurred())) return NULL; } } else { return (inplace ? PyNumber_InPlaceTrueDivide : PyNumber_TrueDivide)(op1, op2); } PyFPE_START_PROTECT("divide", return NULL) result = a / b; PyFPE_END_PROTECT(result) return PyFloat_FromDouble(result); } #endif static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list, int level) { PyObject *empty_list = 0; PyObject *module = 0; PyObject *global_dict = 0; PyObject *empty_dict = 0; PyObject *list; #if PY_VERSION_HEX < 0x03030000 PyObject *py_import; py_import = __Pyx_PyObject_GetAttrStr(__pyx_b, __pyx_n_s_import); if (!py_import) goto bad; #endif if (from_list) list = from_list; else { empty_list = PyList_New(0); if (!empty_list) goto bad; list = empty_list; } global_dict = PyModule_GetDict(__pyx_m); if (!global_dict) goto bad; empty_dict = PyDict_New(); if (!empty_dict) goto bad; { #if PY_MAJOR_VERSION >= 3 if (level == -1) { if (strchr(__Pyx_MODULE_NAME, '.')) { #if PY_VERSION_HEX < 0x03030000 PyObject *py_level = PyInt_FromLong(1); if (!py_level) goto bad; module = PyObject_CallFunctionObjArgs(py_import, name, global_dict, empty_dict, list, py_level, NULL); Py_DECREF(py_level); #else module = PyImport_ImportModuleLevelObject( name, global_dict, empty_dict, list, 1); #endif if (!module) { if (!PyErr_ExceptionMatches(PyExc_ImportError)) goto bad; PyErr_Clear(); } } level = 0; } #endif if (!module) { #if PY_VERSION_HEX < 0x03030000 PyObject *py_level = PyInt_FromLong(level); if (!py_level) goto bad; module = PyObject_CallFunctionObjArgs(py_import, name, global_dict, empty_dict, list, py_level, NULL); Py_DECREF(py_level); #else module = PyImport_ImportModuleLevelObject( name, global_dict, empty_dict, list, level); #endif } } bad: #if PY_VERSION_HEX < 0x03030000 Py_XDECREF(py_import); #endif Py_XDECREF(empty_list); Py_XDECREF(empty_dict); return module; } static PyObject* __Pyx_ImportFrom(PyObject* module, PyObject* name) { PyObject* value = __Pyx_PyObject_GetAttrStr(module, name); if (unlikely(!value) && PyErr_ExceptionMatches(PyExc_AttributeError)) { PyErr_Format(PyExc_ImportError, #if PY_MAJOR_VERSION < 3 "cannot import name %.230s", PyString_AS_STRING(name)); #else "cannot import name %S", name); #endif } return value; } static PyTypeObject* __Pyx_FetchCommonType(PyTypeObject* type) { PyObject* fake_module; PyTypeObject* cached_type = NULL; fake_module = PyImport_AddModule((char*) "_cython_" CYTHON_ABI); if (!fake_module) return NULL; Py_INCREF(fake_module); cached_type = (PyTypeObject*) PyObject_GetAttrString(fake_module, type->tp_name); if (cached_type) { if (!PyType_Check((PyObject*)cached_type)) { PyErr_Format(PyExc_TypeError, "Shared Cython type %.200s is not a type object", type->tp_name); goto bad; } if (cached_type->tp_basicsize != type->tp_basicsize) { PyErr_Format(PyExc_TypeError, "Shared Cython type %.200s has the wrong size, try recompiling", type->tp_name); goto bad; } } else { if (!PyErr_ExceptionMatches(PyExc_AttributeError)) goto bad; PyErr_Clear(); if (PyType_Ready(type) < 0) goto bad; if (PyObject_SetAttrString(fake_module, type->tp_name, (PyObject*) type) < 0) goto bad; Py_INCREF(type); cached_type = type; } done: Py_DECREF(fake_module); return cached_type; bad: Py_XDECREF(cached_type); cached_type = NULL; goto done; } static PyObject * __Pyx_CyFunction_get_doc(__pyx_CyFunctionObject *op, CYTHON_UNUSED void *closure) { if (unlikely(op->func_doc == NULL)) { if (op->func.m_ml->ml_doc) { #if PY_MAJOR_VERSION >= 3 op->func_doc = PyUnicode_FromString(op->func.m_ml->ml_doc); #else op->func_doc = PyString_FromString(op->func.m_ml->ml_doc); #endif if (unlikely(op->func_doc == NULL)) return NULL; } else { Py_INCREF(Py_None); return Py_None; } } Py_INCREF(op->func_doc); return op->func_doc; } static int __Pyx_CyFunction_set_doc(__pyx_CyFunctionObject *op, PyObject *value) { PyObject *tmp = op->func_doc; if (value == NULL) { value = Py_None; } Py_INCREF(value); op->func_doc = value; Py_XDECREF(tmp); return 0; } static PyObject * __Pyx_CyFunction_get_name(__pyx_CyFunctionObject *op) { if (unlikely(op->func_name == NULL)) { #if PY_MAJOR_VERSION >= 3 op->func_name = PyUnicode_InternFromString(op->func.m_ml->ml_name); #else op->func_name = PyString_InternFromString(op->func.m_ml->ml_name); #endif if (unlikely(op->func_name == NULL)) return NULL; } Py_INCREF(op->func_name); return op->func_name; } static int __Pyx_CyFunction_set_name(__pyx_CyFunctionObject *op, PyObject *value) { PyObject *tmp; #if PY_MAJOR_VERSION >= 3 if (unlikely(value == NULL || !PyUnicode_Check(value))) { #else if (unlikely(value == NULL || !PyString_Check(value))) { #endif PyErr_SetString(PyExc_TypeError, "__name__ must be set to a string object"); return -1; } tmp = op->func_name; Py_INCREF(value); op->func_name = value; Py_XDECREF(tmp); return 0; } static PyObject * __Pyx_CyFunction_get_qualname(__pyx_CyFunctionObject *op) { Py_INCREF(op->func_qualname); return op->func_qualname; } static int __Pyx_CyFunction_set_qualname(__pyx_CyFunctionObject *op, PyObject *value) { PyObject *tmp; #if PY_MAJOR_VERSION >= 3 if (unlikely(value == NULL || !PyUnicode_Check(value))) { #else if (unlikely(value == NULL || !PyString_Check(value))) { #endif PyErr_SetString(PyExc_TypeError, "__qualname__ must be set to a string object"); return -1; } tmp = op->func_qualname; Py_INCREF(value); op->func_qualname = value; Py_XDECREF(tmp); return 0; } static PyObject * __Pyx_CyFunction_get_self(__pyx_CyFunctionObject *m, CYTHON_UNUSED void *closure) { PyObject *self; self = m->func_closure; if (self == NULL) self = Py_None; Py_INCREF(self); return self; } static PyObject * __Pyx_CyFunction_get_dict(__pyx_CyFunctionObject *op) { if (unlikely(op->func_dict == NULL)) { op->func_dict = PyDict_New(); if (unlikely(op->func_dict == NULL)) return NULL; } Py_INCREF(op->func_dict); return op->func_dict; } static int __Pyx_CyFunction_set_dict(__pyx_CyFunctionObject *op, PyObject *value) { PyObject *tmp; if (unlikely(value == NULL)) { PyErr_SetString(PyExc_TypeError, "function's dictionary may not be deleted"); return -1; } if (unlikely(!PyDict_Check(value))) { PyErr_SetString(PyExc_TypeError, "setting function's dictionary to a non-dict"); return -1; } tmp = op->func_dict; Py_INCREF(value); op->func_dict = value; Py_XDECREF(tmp); return 0; } static PyObject * __Pyx_CyFunction_get_globals(__pyx_CyFunctionObject *op) { Py_INCREF(op->func_globals); return op->func_globals; } static PyObject * __Pyx_CyFunction_get_closure(CYTHON_UNUSED __pyx_CyFunctionObject *op) { Py_INCREF(Py_None); return Py_None; } static PyObject * __Pyx_CyFunction_get_code(__pyx_CyFunctionObject *op) { PyObject* result = (op->func_code) ? op->func_code : Py_None; Py_INCREF(result); return result; } static int __Pyx_CyFunction_init_defaults(__pyx_CyFunctionObject *op) { int result = 0; PyObject *res = op->defaults_getter((PyObject *) op); if (unlikely(!res)) return -1; #if CYTHON_COMPILING_IN_CPYTHON op->defaults_tuple = PyTuple_GET_ITEM(res, 0); Py_INCREF(op->defaults_tuple); op->defaults_kwdict = PyTuple_GET_ITEM(res, 1); Py_INCREF(op->defaults_kwdict); #else op->defaults_tuple = PySequence_ITEM(res, 0); if (unlikely(!op->defaults_tuple)) result = -1; else { op->defaults_kwdict = PySequence_ITEM(res, 1); if (unlikely(!op->defaults_kwdict)) result = -1; } #endif Py_DECREF(res); return result; } static int __Pyx_CyFunction_set_defaults(__pyx_CyFunctionObject *op, PyObject* value) { PyObject* tmp; if (!value) { value = Py_None; } else if (value != Py_None && !PyTuple_Check(value)) { PyErr_SetString(PyExc_TypeError, "__defaults__ must be set to a tuple object"); return -1; } Py_INCREF(value); tmp = op->defaults_tuple; op->defaults_tuple = value; Py_XDECREF(tmp); return 0; } static PyObject * __Pyx_CyFunction_get_defaults(__pyx_CyFunctionObject *op) { PyObject* result = op->defaults_tuple; if (unlikely(!result)) { if (op->defaults_getter) { if (__Pyx_CyFunction_init_defaults(op) < 0) return NULL; result = op->defaults_tuple; } else { result = Py_None; } } Py_INCREF(result); return result; } static int __Pyx_CyFunction_set_kwdefaults(__pyx_CyFunctionObject *op, PyObject* value) { PyObject* tmp; if (!value) { value = Py_None; } else if (value != Py_None && !PyDict_Check(value)) { PyErr_SetString(PyExc_TypeError, "__kwdefaults__ must be set to a dict object"); return -1; } Py_INCREF(value); tmp = op->defaults_kwdict; op->defaults_kwdict = value; Py_XDECREF(tmp); return 0; } static PyObject * __Pyx_CyFunction_get_kwdefaults(__pyx_CyFunctionObject *op) { PyObject* result = op->defaults_kwdict; if (unlikely(!result)) { if (op->defaults_getter) { if (__Pyx_CyFunction_init_defaults(op) < 0) return NULL; result = op->defaults_kwdict; } else { result = Py_None; } } Py_INCREF(result); return result; } static int __Pyx_CyFunction_set_annotations(__pyx_CyFunctionObject *op, PyObject* value) { PyObject* tmp; if (!value || value == Py_None) { value = NULL; } else if (!PyDict_Check(value)) { PyErr_SetString(PyExc_TypeError, "__annotations__ must be set to a dict object"); return -1; } Py_XINCREF(value); tmp = op->func_annotations; op->func_annotations = value; Py_XDECREF(tmp); return 0; } static PyObject * __Pyx_CyFunction_get_annotations(__pyx_CyFunctionObject *op) { PyObject* result = op->func_annotations; if (unlikely(!result)) { result = PyDict_New(); if (unlikely(!result)) return NULL; op->func_annotations = result; } Py_INCREF(result); return result; } static PyGetSetDef __pyx_CyFunction_getsets[] = { {(char *) "func_doc", (getter)__Pyx_CyFunction_get_doc, (setter)__Pyx_CyFunction_set_doc, 0, 0}, {(char *) "__doc__", (getter)__Pyx_CyFunction_get_doc, (setter)__Pyx_CyFunction_set_doc, 0, 0}, {(char *) "func_name", (getter)__Pyx_CyFunction_get_name, (setter)__Pyx_CyFunction_set_name, 0, 0}, {(char *) "__name__", (getter)__Pyx_CyFunction_get_name, (setter)__Pyx_CyFunction_set_name, 0, 0}, {(char *) "__qualname__", (getter)__Pyx_CyFunction_get_qualname, (setter)__Pyx_CyFunction_set_qualname, 0, 0}, {(char *) "__self__", (getter)__Pyx_CyFunction_get_self, 0, 0, 0}, {(char *) "func_dict", (getter)__Pyx_CyFunction_get_dict, (setter)__Pyx_CyFunction_set_dict, 0, 0}, {(char *) "__dict__", (getter)__Pyx_CyFunction_get_dict, (setter)__Pyx_CyFunction_set_dict, 0, 0}, {(char *) "func_globals", (getter)__Pyx_CyFunction_get_globals, 0, 0, 0}, {(char *) "__globals__", (getter)__Pyx_CyFunction_get_globals, 0, 0, 0}, {(char *) "func_closure", (getter)__Pyx_CyFunction_get_closure, 0, 0, 0}, {(char *) "__closure__", (getter)__Pyx_CyFunction_get_closure, 0, 0, 0}, {(char *) "func_code", (getter)__Pyx_CyFunction_get_code, 0, 0, 0}, {(char *) "__code__", (getter)__Pyx_CyFunction_get_code, 0, 0, 0}, {(char *) "func_defaults", (getter)__Pyx_CyFunction_get_defaults, (setter)__Pyx_CyFunction_set_defaults, 0, 0}, {(char *) "__defaults__", (getter)__Pyx_CyFunction_get_defaults, (setter)__Pyx_CyFunction_set_defaults, 0, 0}, {(char *) "__kwdefaults__", (getter)__Pyx_CyFunction_get_kwdefaults, (setter)__Pyx_CyFunction_set_kwdefaults, 0, 0}, {(char *) "__annotations__", (getter)__Pyx_CyFunction_get_annotations, (setter)__Pyx_CyFunction_set_annotations, 0, 0}, {0, 0, 0, 0, 0} }; static PyMemberDef __pyx_CyFunction_members[] = { {(char *) "__module__", T_OBJECT, offsetof(__pyx_CyFunctionObject, func.m_module), PY_WRITE_RESTRICTED, 0}, {0, 0, 0, 0, 0} }; static PyObject * __Pyx_CyFunction_reduce(__pyx_CyFunctionObject *m, CYTHON_UNUSED PyObject *args) { #if PY_MAJOR_VERSION >= 3 return PyUnicode_FromString(m->func.m_ml->ml_name); #else return PyString_FromString(m->func.m_ml->ml_name); #endif } static PyMethodDef __pyx_CyFunction_methods[] = { {"__reduce__", (PyCFunction)__Pyx_CyFunction_reduce, METH_VARARGS, 0}, {0, 0, 0, 0} }; #if PY_VERSION_HEX < 0x030500A0 #define __Pyx_CyFunction_weakreflist(cyfunc) ((cyfunc)->func_weakreflist) #else #define __Pyx_CyFunction_weakreflist(cyfunc) ((cyfunc)->func.m_weakreflist) #endif static PyObject *__Pyx_CyFunction_New(PyTypeObject *type, PyMethodDef *ml, int flags, PyObject* qualname, PyObject *closure, PyObject *module, PyObject* globals, PyObject* code) { __pyx_CyFunctionObject *op = PyObject_GC_New(__pyx_CyFunctionObject, type); if (op == NULL) return NULL; op->flags = flags; __Pyx_CyFunction_weakreflist(op) = NULL; op->func.m_ml = ml; op->func.m_self = (PyObject *) op; Py_XINCREF(closure); op->func_closure = closure; Py_XINCREF(module); op->func.m_module = module; op->func_dict = NULL; op->func_name = NULL; Py_INCREF(qualname); op->func_qualname = qualname; op->func_doc = NULL; op->func_classobj = NULL; op->func_globals = globals; Py_INCREF(op->func_globals); Py_XINCREF(code); op->func_code = code; op->defaults_pyobjects = 0; op->defaults = NULL; op->defaults_tuple = NULL; op->defaults_kwdict = NULL; op->defaults_getter = NULL; op->func_annotations = NULL; PyObject_GC_Track(op); return (PyObject *) op; } static int __Pyx_CyFunction_clear(__pyx_CyFunctionObject *m) { Py_CLEAR(m->func_closure); Py_CLEAR(m->func.m_module); Py_CLEAR(m->func_dict); Py_CLEAR(m->func_name); Py_CLEAR(m->func_qualname); Py_CLEAR(m->func_doc); Py_CLEAR(m->func_globals); Py_CLEAR(m->func_code); Py_CLEAR(m->func_classobj); Py_CLEAR(m->defaults_tuple); Py_CLEAR(m->defaults_kwdict); Py_CLEAR(m->func_annotations); if (m->defaults) { PyObject **pydefaults = __Pyx_CyFunction_Defaults(PyObject *, m); int i; for (i = 0; i < m->defaults_pyobjects; i++) Py_XDECREF(pydefaults[i]); PyMem_Free(m->defaults); m->defaults = NULL; } return 0; } static void __Pyx_CyFunction_dealloc(__pyx_CyFunctionObject *m) { PyObject_GC_UnTrack(m); if (__Pyx_CyFunction_weakreflist(m) != NULL) PyObject_ClearWeakRefs((PyObject *) m); __Pyx_CyFunction_clear(m); PyObject_GC_Del(m); } static int __Pyx_CyFunction_traverse(__pyx_CyFunctionObject *m, visitproc visit, void *arg) { Py_VISIT(m->func_closure); Py_VISIT(m->func.m_module); Py_VISIT(m->func_dict); Py_VISIT(m->func_name); Py_VISIT(m->func_qualname); Py_VISIT(m->func_doc); Py_VISIT(m->func_globals); Py_VISIT(m->func_code); Py_VISIT(m->func_classobj); Py_VISIT(m->defaults_tuple); Py_VISIT(m->defaults_kwdict); if (m->defaults) { PyObject **pydefaults = __Pyx_CyFunction_Defaults(PyObject *, m); int i; for (i = 0; i < m->defaults_pyobjects; i++) Py_VISIT(pydefaults[i]); } return 0; } static PyObject *__Pyx_CyFunction_descr_get(PyObject *func, PyObject *obj, PyObject *type) { __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func; if (m->flags & __Pyx_CYFUNCTION_STATICMETHOD) { Py_INCREF(func); return func; } if (m->flags & __Pyx_CYFUNCTION_CLASSMETHOD) { if (type == NULL) type = (PyObject *)(Py_TYPE(obj)); return __Pyx_PyMethod_New(func, type, (PyObject *)(Py_TYPE(type))); } if (obj == Py_None) obj = NULL; return __Pyx_PyMethod_New(func, obj, type); } static PyObject* __Pyx_CyFunction_repr(__pyx_CyFunctionObject *op) { #if PY_MAJOR_VERSION >= 3 return PyUnicode_FromFormat("", op->func_qualname, (void *)op); #else return PyString_FromFormat("", PyString_AsString(op->func_qualname), (void *)op); #endif } #if CYTHON_COMPILING_IN_PYPY static PyObject * __Pyx_CyFunction_Call(PyObject *func, PyObject *arg, PyObject *kw) { PyCFunctionObject* f = (PyCFunctionObject*)func; PyCFunction meth = f->m_ml->ml_meth; PyObject *self = f->m_self; Py_ssize_t size; switch (f->m_ml->ml_flags & (METH_VARARGS | METH_KEYWORDS | METH_NOARGS | METH_O)) { case METH_VARARGS: if (likely(kw == NULL || PyDict_Size(kw) == 0)) return (*meth)(self, arg); break; case METH_VARARGS | METH_KEYWORDS: return (*(PyCFunctionWithKeywords)meth)(self, arg, kw); case METH_NOARGS: if (likely(kw == NULL || PyDict_Size(kw) == 0)) { size = PyTuple_GET_SIZE(arg); if (likely(size == 0)) return (*meth)(self, NULL); PyErr_Format(PyExc_TypeError, "%.200s() takes no arguments (%" CYTHON_FORMAT_SSIZE_T "d given)", f->m_ml->ml_name, size); return NULL; } break; case METH_O: if (likely(kw == NULL || PyDict_Size(kw) == 0)) { size = PyTuple_GET_SIZE(arg); if (likely(size == 1)) { PyObject *result, *arg0 = PySequence_ITEM(arg, 0); if (unlikely(!arg0)) return NULL; result = (*meth)(self, arg0); Py_DECREF(arg0); return result; } PyErr_Format(PyExc_TypeError, "%.200s() takes exactly one argument (%" CYTHON_FORMAT_SSIZE_T "d given)", f->m_ml->ml_name, size); return NULL; } break; default: PyErr_SetString(PyExc_SystemError, "Bad call flags in " "__Pyx_CyFunction_Call. METH_OLDARGS is no " "longer supported!"); return NULL; } PyErr_Format(PyExc_TypeError, "%.200s() takes no keyword arguments", f->m_ml->ml_name); return NULL; } #else static PyObject * __Pyx_CyFunction_Call(PyObject *func, PyObject *arg, PyObject *kw) { return PyCFunction_Call(func, arg, kw); } #endif static PyTypeObject __pyx_CyFunctionType_type = { PyVarObject_HEAD_INIT(0, 0) "cython_function_or_method", sizeof(__pyx_CyFunctionObject), 0, (destructor) __Pyx_CyFunction_dealloc, 0, 0, 0, #if PY_MAJOR_VERSION < 3 0, #else 0, #endif (reprfunc) __Pyx_CyFunction_repr, 0, 0, 0, 0, __Pyx_CyFunction_Call, 0, 0, 0, 0, Py_TPFLAGS_DEFAULT | Py_TPFLAGS_HAVE_GC, 0, (traverseproc) __Pyx_CyFunction_traverse, (inquiry) __Pyx_CyFunction_clear, 0, #if PY_VERSION_HEX < 0x030500A0 offsetof(__pyx_CyFunctionObject, func_weakreflist), #else offsetof(PyCFunctionObject, m_weakreflist), #endif 0, 0, __pyx_CyFunction_methods, __pyx_CyFunction_members, __pyx_CyFunction_getsets, 0, 0, __Pyx_CyFunction_descr_get, 0, offsetof(__pyx_CyFunctionObject, func_dict), 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, #if PY_VERSION_HEX >= 0x030400a1 0, #endif }; static int __pyx_CyFunction_init(void) { #if !CYTHON_COMPILING_IN_PYPY __pyx_CyFunctionType_type.tp_call = PyCFunction_Call; #endif __pyx_CyFunctionType = __Pyx_FetchCommonType(&__pyx_CyFunctionType_type); if (__pyx_CyFunctionType == NULL) { return -1; } return 0; } static CYTHON_INLINE void *__Pyx_CyFunction_InitDefaults(PyObject *func, size_t size, int pyobjects) { __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func; m->defaults = PyMem_Malloc(size); if (!m->defaults) return PyErr_NoMemory(); memset(m->defaults, 0, size); m->defaults_pyobjects = pyobjects; return m->defaults; } static CYTHON_INLINE void __Pyx_CyFunction_SetDefaultsTuple(PyObject *func, PyObject *tuple) { __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func; m->defaults_tuple = tuple; Py_INCREF(tuple); } static CYTHON_INLINE void __Pyx_CyFunction_SetDefaultsKwDict(PyObject *func, PyObject *dict) { __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func; m->defaults_kwdict = dict; Py_INCREF(dict); } static CYTHON_INLINE void __Pyx_CyFunction_SetAnnotationsDict(PyObject *func, PyObject *dict) { __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func; m->func_annotations = dict; Py_INCREF(dict); } static PyObject *__Pyx_CalculateMetaclass(PyTypeObject *metaclass, PyObject *bases) { Py_ssize_t i, nbases = PyTuple_GET_SIZE(bases); for (i=0; i < nbases; i++) { PyTypeObject *tmptype; PyObject *tmp = PyTuple_GET_ITEM(bases, i); tmptype = Py_TYPE(tmp); #if PY_MAJOR_VERSION < 3 if (tmptype == &PyClass_Type) continue; #endif if (!metaclass) { metaclass = tmptype; continue; } if (PyType_IsSubtype(metaclass, tmptype)) continue; if (PyType_IsSubtype(tmptype, metaclass)) { metaclass = tmptype; continue; } PyErr_SetString(PyExc_TypeError, "metaclass conflict: " "the metaclass of a derived class " "must be a (non-strict) subclass " "of the metaclasses of all its bases"); return NULL; } if (!metaclass) { #if PY_MAJOR_VERSION < 3 metaclass = &PyClass_Type; #else metaclass = &PyType_Type; #endif } Py_INCREF((PyObject*) metaclass); return (PyObject*) metaclass; } static PyObject *__Pyx_Py3MetaclassPrepare(PyObject *metaclass, PyObject *bases, PyObject *name, PyObject *qualname, PyObject *mkw, PyObject *modname, PyObject *doc) { PyObject *ns; if (metaclass) { PyObject *prep = __Pyx_PyObject_GetAttrStr(metaclass, __pyx_n_s_prepare); if (prep) { PyObject *pargs = PyTuple_Pack(2, name, bases); if (unlikely(!pargs)) { Py_DECREF(prep); return NULL; } ns = PyObject_Call(prep, pargs, mkw); Py_DECREF(prep); Py_DECREF(pargs); } else { if (unlikely(!PyErr_ExceptionMatches(PyExc_AttributeError))) return NULL; PyErr_Clear(); ns = PyDict_New(); } } else { ns = PyDict_New(); } if (unlikely(!ns)) return NULL; if (unlikely(PyObject_SetItem(ns, __pyx_n_s_module, modname) < 0)) goto bad; if (unlikely(PyObject_SetItem(ns, __pyx_n_s_qualname, qualname) < 0)) goto bad; if (unlikely(doc && PyObject_SetItem(ns, __pyx_n_s_doc, doc) < 0)) goto bad; return ns; bad: Py_DECREF(ns); return NULL; } static PyObject *__Pyx_Py3ClassCreate(PyObject *metaclass, PyObject *name, PyObject *bases, PyObject *dict, PyObject *mkw, int calculate_metaclass, int allow_py2_metaclass) { PyObject *result, *margs; PyObject *owned_metaclass = NULL; if (allow_py2_metaclass) { owned_metaclass = PyObject_GetItem(dict, __pyx_n_s_metaclass); if (owned_metaclass) { metaclass = owned_metaclass; } else if (likely(PyErr_ExceptionMatches(PyExc_KeyError))) { PyErr_Clear(); } else { return NULL; } } if (calculate_metaclass && (!metaclass || PyType_Check(metaclass))) { metaclass = __Pyx_CalculateMetaclass((PyTypeObject*) metaclass, bases); Py_XDECREF(owned_metaclass); if (unlikely(!metaclass)) return NULL; owned_metaclass = metaclass; } margs = PyTuple_Pack(3, name, bases, dict); if (unlikely(!margs)) { result = NULL; } else { result = PyObject_Call(metaclass, margs, mkw); Py_DECREF(margs); } Py_XDECREF(owned_metaclass); return result; } static int __pyx_bisect_code_objects(__Pyx_CodeObjectCacheEntry* entries, int count, int code_line) { int start = 0, mid = 0, end = count - 1; if (end >= 0 && code_line > entries[end].code_line) { return count; } while (start < end) { mid = start + (end - start) / 2; if (code_line < entries[mid].code_line) { end = mid; } else if (code_line > entries[mid].code_line) { start = mid + 1; } else { return mid; } } if (code_line <= entries[mid].code_line) { return mid; } else { return mid + 1; } } static PyCodeObject *__pyx_find_code_object(int code_line) { PyCodeObject* code_object; int pos; if (unlikely(!code_line) || unlikely(!__pyx_code_cache.entries)) { return NULL; } pos = __pyx_bisect_code_objects(__pyx_code_cache.entries, __pyx_code_cache.count, code_line); if (unlikely(pos >= __pyx_code_cache.count) || unlikely(__pyx_code_cache.entries[pos].code_line != code_line)) { return NULL; } code_object = __pyx_code_cache.entries[pos].code_object; Py_INCREF(code_object); return code_object; } static void __pyx_insert_code_object(int code_line, PyCodeObject* code_object) { int pos, i; __Pyx_CodeObjectCacheEntry* entries = __pyx_code_cache.entries; if (unlikely(!code_line)) { return; } if (unlikely(!entries)) { entries = (__Pyx_CodeObjectCacheEntry*)PyMem_Malloc(64*sizeof(__Pyx_CodeObjectCacheEntry)); if (likely(entries)) { __pyx_code_cache.entries = entries; __pyx_code_cache.max_count = 64; __pyx_code_cache.count = 1; entries[0].code_line = code_line; entries[0].code_object = code_object; Py_INCREF(code_object); } return; } pos = __pyx_bisect_code_objects(__pyx_code_cache.entries, __pyx_code_cache.count, code_line); if ((pos < __pyx_code_cache.count) && unlikely(__pyx_code_cache.entries[pos].code_line == code_line)) { PyCodeObject* tmp = entries[pos].code_object; entries[pos].code_object = code_object; Py_DECREF(tmp); return; } if (__pyx_code_cache.count == __pyx_code_cache.max_count) { int new_max = __pyx_code_cache.max_count + 64; entries = (__Pyx_CodeObjectCacheEntry*)PyMem_Realloc( __pyx_code_cache.entries, (size_t)new_max*sizeof(__Pyx_CodeObjectCacheEntry)); if (unlikely(!entries)) { return; } __pyx_code_cache.entries = entries; __pyx_code_cache.max_count = new_max; } for (i=__pyx_code_cache.count; i>pos; i--) { entries[i] = entries[i-1]; } entries[pos].code_line = code_line; entries[pos].code_object = code_object; __pyx_code_cache.count++; Py_INCREF(code_object); } #include "compile.h" #include "frameobject.h" #include "traceback.h" static PyCodeObject* __Pyx_CreateCodeObjectForTraceback( const char *funcname, int c_line, int py_line, const char *filename) { PyCodeObject *py_code = 0; PyObject *py_srcfile = 0; PyObject *py_funcname = 0; #if PY_MAJOR_VERSION < 3 py_srcfile = PyString_FromString(filename); #else py_srcfile = PyUnicode_FromString(filename); #endif if (!py_srcfile) goto bad; if (c_line) { #if PY_MAJOR_VERSION < 3 py_funcname = PyString_FromFormat( "%s (%s:%d)", funcname, __pyx_cfilenm, c_line); #else py_funcname = PyUnicode_FromFormat( "%s (%s:%d)", funcname, __pyx_cfilenm, c_line); #endif } else { #if PY_MAJOR_VERSION < 3 py_funcname = PyString_FromString(funcname); #else py_funcname = PyUnicode_FromString(funcname); #endif } if (!py_funcname) goto bad; py_code = __Pyx_PyCode_New( 0, 0, 0, 0, 0, __pyx_empty_bytes, /*PyObject *code,*/ __pyx_empty_tuple, /*PyObject *consts,*/ __pyx_empty_tuple, /*PyObject *names,*/ __pyx_empty_tuple, /*PyObject *varnames,*/ __pyx_empty_tuple, /*PyObject *freevars,*/ __pyx_empty_tuple, /*PyObject *cellvars,*/ py_srcfile, /*PyObject *filename,*/ py_funcname, /*PyObject *name,*/ py_line, __pyx_empty_bytes /*PyObject *lnotab*/ ); Py_DECREF(py_srcfile); Py_DECREF(py_funcname); return py_code; bad: Py_XDECREF(py_srcfile); Py_XDECREF(py_funcname); return NULL; } static void __Pyx_AddTraceback(const char *funcname, int c_line, int py_line, const char *filename) { PyCodeObject *py_code = 0; PyFrameObject *py_frame = 0; py_code = __pyx_find_code_object(c_line ? c_line : py_line); if (!py_code) { py_code = __Pyx_CreateCodeObjectForTraceback( funcname, c_line, py_line, filename); if (!py_code) goto bad; __pyx_insert_code_object(c_line ? c_line : py_line, py_code); } py_frame = PyFrame_New( PyThreadState_GET(), /*PyThreadState *tstate,*/ py_code, /*PyCodeObject *code,*/ __pyx_d, /*PyObject *globals,*/ 0 /*PyObject *locals*/ ); if (!py_frame) goto bad; py_frame->f_lineno = py_line; PyTraceBack_Here(py_frame); bad: Py_XDECREF(py_code); Py_XDECREF(py_frame); } #define __PYX_VERIFY_RETURN_INT(target_type, func_type, func_value)\ __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, 0) #define __PYX_VERIFY_RETURN_INT_EXC(target_type, func_type, func_value)\ __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, 1) #define __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, exc)\ {\ func_type value = func_value;\ if (sizeof(target_type) < sizeof(func_type)) {\ if (unlikely(value != (func_type) (target_type) value)) {\ func_type zero = 0;\ if (exc && unlikely(value == (func_type)-1 && PyErr_Occurred()))\ return (target_type) -1;\ if (is_unsigned && unlikely(value < zero))\ goto raise_neg_overflow;\ else\ goto raise_overflow;\ }\ }\ return (target_type) value;\ } static CYTHON_INLINE int __Pyx_PyInt_As_int(PyObject *x) { const int neg_one = (int) -1, const_zero = (int) 0; const int is_unsigned = neg_one > const_zero; #if PY_MAJOR_VERSION < 3 if (likely(PyInt_Check(x))) { if (sizeof(int) < sizeof(long)) { __PYX_VERIFY_RETURN_INT(int, long, PyInt_AS_LONG(x)) } else { long val = PyInt_AS_LONG(x); if (is_unsigned && unlikely(val < 0)) { goto raise_neg_overflow; } return (int) val; } } else #endif if (likely(PyLong_Check(x))) { if (is_unsigned) { #if CYTHON_USE_PYLONG_INTERNALS const digit* digits = ((PyLongObject*)x)->ob_digit; switch (Py_SIZE(x)) { case 0: return (int) 0; case 1: __PYX_VERIFY_RETURN_INT(int, digit, digits[0]) case 2: if (8 * sizeof(int) > 1 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(int) >= 2 * PyLong_SHIFT) { return (int) (((((int)digits[1]) << PyLong_SHIFT) | (int)digits[0])); } } break; case 3: if (8 * sizeof(int) > 2 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(int) >= 3 * PyLong_SHIFT) { return (int) (((((((int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0])); } } break; case 4: if (8 * sizeof(int) > 3 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(int) >= 4 * PyLong_SHIFT) { return (int) (((((((((int)digits[3]) << PyLong_SHIFT) | (int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0])); } } break; } #endif #if CYTHON_COMPILING_IN_CPYTHON if (unlikely(Py_SIZE(x) < 0)) { goto raise_neg_overflow; } #else { int result = PyObject_RichCompareBool(x, Py_False, Py_LT); if (unlikely(result < 0)) return (int) -1; if (unlikely(result == 1)) goto raise_neg_overflow; } #endif if (sizeof(int) <= sizeof(unsigned long)) { __PYX_VERIFY_RETURN_INT_EXC(int, unsigned long, PyLong_AsUnsignedLong(x)) } else if (sizeof(int) <= sizeof(unsigned PY_LONG_LONG)) { __PYX_VERIFY_RETURN_INT_EXC(int, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x)) } } else { #if CYTHON_USE_PYLONG_INTERNALS const digit* digits = ((PyLongObject*)x)->ob_digit; switch (Py_SIZE(x)) { case 0: return (int) 0; case -1: __PYX_VERIFY_RETURN_INT(int, sdigit, -(sdigit) digits[0]) case 1: __PYX_VERIFY_RETURN_INT(int, digit, +digits[0]) case -2: if (8 * sizeof(int) - 1 > 1 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(int, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(int) - 1 > 2 * PyLong_SHIFT) { return (int) (((int)-1)*(((((int)digits[1]) << PyLong_SHIFT) | (int)digits[0]))); } } break; case 2: if (8 * sizeof(int) > 1 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(int) - 1 > 2 * PyLong_SHIFT) { return (int) ((((((int)digits[1]) << PyLong_SHIFT) | (int)digits[0]))); } } break; case -3: if (8 * sizeof(int) - 1 > 2 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(int, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(int) - 1 > 3 * PyLong_SHIFT) { return (int) (((int)-1)*(((((((int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0]))); } } break; case 3: if (8 * sizeof(int) > 2 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(int) - 1 > 3 * PyLong_SHIFT) { return (int) ((((((((int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0]))); } } break; case -4: if (8 * sizeof(int) - 1 > 3 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(int, long, -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(int) - 1 > 4 * PyLong_SHIFT) { return (int) (((int)-1)*(((((((((int)digits[3]) << PyLong_SHIFT) | (int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0]))); } } break; case 4: if (8 * sizeof(int) > 3 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(int) - 1 > 4 * PyLong_SHIFT) { return (int) ((((((((((int)digits[3]) << PyLong_SHIFT) | (int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0]))); } } break; } #endif if (sizeof(int) <= sizeof(long)) { __PYX_VERIFY_RETURN_INT_EXC(int, long, PyLong_AsLong(x)) } else if (sizeof(int) <= sizeof(PY_LONG_LONG)) { __PYX_VERIFY_RETURN_INT_EXC(int, PY_LONG_LONG, PyLong_AsLongLong(x)) } } { #if CYTHON_COMPILING_IN_PYPY && !defined(_PyLong_AsByteArray) PyErr_SetString(PyExc_RuntimeError, "_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers"); #else int val; PyObject *v = __Pyx_PyNumber_Int(x); #if PY_MAJOR_VERSION < 3 if (likely(v) && !PyLong_Check(v)) { PyObject *tmp = v; v = PyNumber_Long(tmp); Py_DECREF(tmp); } #endif if (likely(v)) { int one = 1; int is_little = (int)*(unsigned char *)&one; unsigned char *bytes = (unsigned char *)&val; int ret = _PyLong_AsByteArray((PyLongObject *)v, bytes, sizeof(val), is_little, !is_unsigned); Py_DECREF(v); if (likely(!ret)) return val; } #endif return (int) -1; } } else { int val; PyObject *tmp = __Pyx_PyNumber_Int(x); if (!tmp) return (int) -1; val = __Pyx_PyInt_As_int(tmp); Py_DECREF(tmp); return val; } raise_overflow: PyErr_SetString(PyExc_OverflowError, "value too large to convert to int"); return (int) -1; raise_neg_overflow: PyErr_SetString(PyExc_OverflowError, "can't convert negative value to int"); return (int) -1; } static CYTHON_INLINE PyObject* __Pyx_PyInt_From_uint32_t(uint32_t value) { const uint32_t neg_one = (uint32_t) -1, const_zero = (uint32_t) 0; const int is_unsigned = neg_one > const_zero; if (is_unsigned) { if (sizeof(uint32_t) < sizeof(long)) { return PyInt_FromLong((long) value); } else if (sizeof(uint32_t) <= sizeof(unsigned long)) { return PyLong_FromUnsignedLong((unsigned long) value); } else if (sizeof(uint32_t) <= sizeof(unsigned PY_LONG_LONG)) { return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value); } } else { if (sizeof(uint32_t) <= sizeof(long)) { return PyInt_FromLong((long) value); } else if (sizeof(uint32_t) <= sizeof(PY_LONG_LONG)) { return PyLong_FromLongLong((PY_LONG_LONG) value); } } { int one = 1; int little = (int)*(unsigned char *)&one; unsigned char *bytes = (unsigned char *)&value; return _PyLong_FromByteArray(bytes, sizeof(uint32_t), little, !is_unsigned); } } static CYTHON_INLINE uint32_t __Pyx_PyInt_As_uint32_t(PyObject *x) { const uint32_t neg_one = (uint32_t) -1, const_zero = (uint32_t) 0; const int is_unsigned = neg_one > const_zero; #if PY_MAJOR_VERSION < 3 if (likely(PyInt_Check(x))) { if (sizeof(uint32_t) < sizeof(long)) { __PYX_VERIFY_RETURN_INT(uint32_t, long, PyInt_AS_LONG(x)) } else { long val = PyInt_AS_LONG(x); if (is_unsigned && unlikely(val < 0)) { goto raise_neg_overflow; } return (uint32_t) val; } } else #endif if (likely(PyLong_Check(x))) { if (is_unsigned) { #if CYTHON_USE_PYLONG_INTERNALS const digit* digits = ((PyLongObject*)x)->ob_digit; switch (Py_SIZE(x)) { case 0: return (uint32_t) 0; case 1: __PYX_VERIFY_RETURN_INT(uint32_t, digit, digits[0]) case 2: if (8 * sizeof(uint32_t) > 1 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(uint32_t, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(uint32_t) >= 2 * PyLong_SHIFT) { return (uint32_t) (((((uint32_t)digits[1]) << PyLong_SHIFT) | (uint32_t)digits[0])); } } break; case 3: if (8 * sizeof(uint32_t) > 2 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(uint32_t, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(uint32_t) >= 3 * PyLong_SHIFT) { return (uint32_t) (((((((uint32_t)digits[2]) << PyLong_SHIFT) | (uint32_t)digits[1]) << PyLong_SHIFT) | (uint32_t)digits[0])); } } break; case 4: if (8 * sizeof(uint32_t) > 3 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(uint32_t, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(uint32_t) >= 4 * PyLong_SHIFT) { return (uint32_t) (((((((((uint32_t)digits[3]) << PyLong_SHIFT) | (uint32_t)digits[2]) << PyLong_SHIFT) | (uint32_t)digits[1]) << PyLong_SHIFT) | (uint32_t)digits[0])); } } break; } #endif #if CYTHON_COMPILING_IN_CPYTHON if (unlikely(Py_SIZE(x) < 0)) { goto raise_neg_overflow; } #else { int result = PyObject_RichCompareBool(x, Py_False, Py_LT); if (unlikely(result < 0)) return (uint32_t) -1; if (unlikely(result == 1)) goto raise_neg_overflow; } #endif if (sizeof(uint32_t) <= sizeof(unsigned long)) { __PYX_VERIFY_RETURN_INT_EXC(uint32_t, unsigned long, PyLong_AsUnsignedLong(x)) } else if (sizeof(uint32_t) <= sizeof(unsigned PY_LONG_LONG)) { __PYX_VERIFY_RETURN_INT_EXC(uint32_t, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x)) } } else { #if CYTHON_USE_PYLONG_INTERNALS const digit* digits = ((PyLongObject*)x)->ob_digit; switch (Py_SIZE(x)) { case 0: return (uint32_t) 0; case -1: __PYX_VERIFY_RETURN_INT(uint32_t, sdigit, -(sdigit) digits[0]) case 1: __PYX_VERIFY_RETURN_INT(uint32_t, digit, +digits[0]) case -2: if (8 * sizeof(uint32_t) - 1 > 1 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(uint32_t, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(uint32_t) - 1 > 2 * PyLong_SHIFT) { return (uint32_t) (((uint32_t)-1)*(((((uint32_t)digits[1]) << PyLong_SHIFT) | (uint32_t)digits[0]))); } } break; case 2: if (8 * sizeof(uint32_t) > 1 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(uint32_t, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(uint32_t) - 1 > 2 * PyLong_SHIFT) { return (uint32_t) ((((((uint32_t)digits[1]) << PyLong_SHIFT) | (uint32_t)digits[0]))); } } break; case -3: if (8 * sizeof(uint32_t) - 1 > 2 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(uint32_t, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(uint32_t) - 1 > 3 * PyLong_SHIFT) { return (uint32_t) (((uint32_t)-1)*(((((((uint32_t)digits[2]) << PyLong_SHIFT) | (uint32_t)digits[1]) << PyLong_SHIFT) | (uint32_t)digits[0]))); } } break; case 3: if (8 * sizeof(uint32_t) > 2 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(uint32_t, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(uint32_t) - 1 > 3 * PyLong_SHIFT) { return (uint32_t) ((((((((uint32_t)digits[2]) << PyLong_SHIFT) | (uint32_t)digits[1]) << PyLong_SHIFT) | (uint32_t)digits[0]))); } } break; case -4: if (8 * sizeof(uint32_t) - 1 > 3 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(uint32_t, long, -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(uint32_t) - 1 > 4 * PyLong_SHIFT) { return (uint32_t) (((uint32_t)-1)*(((((((((uint32_t)digits[3]) << PyLong_SHIFT) | (uint32_t)digits[2]) << PyLong_SHIFT) | (uint32_t)digits[1]) << PyLong_SHIFT) | (uint32_t)digits[0]))); } } break; case 4: if (8 * sizeof(uint32_t) > 3 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(uint32_t, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(uint32_t) - 1 > 4 * PyLong_SHIFT) { return (uint32_t) ((((((((((uint32_t)digits[3]) << PyLong_SHIFT) | (uint32_t)digits[2]) << PyLong_SHIFT) | (uint32_t)digits[1]) << PyLong_SHIFT) | (uint32_t)digits[0]))); } } break; } #endif if (sizeof(uint32_t) <= sizeof(long)) { __PYX_VERIFY_RETURN_INT_EXC(uint32_t, long, PyLong_AsLong(x)) } else if (sizeof(uint32_t) <= sizeof(PY_LONG_LONG)) { __PYX_VERIFY_RETURN_INT_EXC(uint32_t, PY_LONG_LONG, PyLong_AsLongLong(x)) } } { #if CYTHON_COMPILING_IN_PYPY && !defined(_PyLong_AsByteArray) PyErr_SetString(PyExc_RuntimeError, "_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers"); #else uint32_t val; PyObject *v = __Pyx_PyNumber_Int(x); #if PY_MAJOR_VERSION < 3 if (likely(v) && !PyLong_Check(v)) { PyObject *tmp = v; v = PyNumber_Long(tmp); Py_DECREF(tmp); } #endif if (likely(v)) { int one = 1; int is_little = (int)*(unsigned char *)&one; unsigned char *bytes = (unsigned char *)&val; int ret = _PyLong_AsByteArray((PyLongObject *)v, bytes, sizeof(val), is_little, !is_unsigned); Py_DECREF(v); if (likely(!ret)) return val; } #endif return (uint32_t) -1; } } else { uint32_t val; PyObject *tmp = __Pyx_PyNumber_Int(x); if (!tmp) return (uint32_t) -1; val = __Pyx_PyInt_As_uint32_t(tmp); Py_DECREF(tmp); return val; } raise_overflow: PyErr_SetString(PyExc_OverflowError, "value too large to convert to uint32_t"); return (uint32_t) -1; raise_neg_overflow: PyErr_SetString(PyExc_OverflowError, "can't convert negative value to uint32_t"); return (uint32_t) -1; } static CYTHON_INLINE PyObject* __Pyx_PyInt_From_int(int value) { const int neg_one = (int) -1, const_zero = (int) 0; const int is_unsigned = neg_one > const_zero; if (is_unsigned) { if (sizeof(int) < sizeof(long)) { return PyInt_FromLong((long) value); } else if (sizeof(int) <= sizeof(unsigned long)) { return PyLong_FromUnsignedLong((unsigned long) value); } else if (sizeof(int) <= sizeof(unsigned PY_LONG_LONG)) { return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value); } } else { if (sizeof(int) <= sizeof(long)) { return PyInt_FromLong((long) value); } else if (sizeof(int) <= sizeof(PY_LONG_LONG)) { return PyLong_FromLongLong((PY_LONG_LONG) value); } } { int one = 1; int little = (int)*(unsigned char *)&one; unsigned char *bytes = (unsigned char *)&value; return _PyLong_FromByteArray(bytes, sizeof(int), little, !is_unsigned); } } static CYTHON_INLINE PyObject* __Pyx_PyInt_From_long(long value) { const long neg_one = (long) -1, const_zero = (long) 0; const int is_unsigned = neg_one > const_zero; if (is_unsigned) { if (sizeof(long) < sizeof(long)) { return PyInt_FromLong((long) value); } else if (sizeof(long) <= sizeof(unsigned long)) { return PyLong_FromUnsignedLong((unsigned long) value); } else if (sizeof(long) <= sizeof(unsigned PY_LONG_LONG)) { return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value); } } else { if (sizeof(long) <= sizeof(long)) { return PyInt_FromLong((long) value); } else if (sizeof(long) <= sizeof(PY_LONG_LONG)) { return PyLong_FromLongLong((PY_LONG_LONG) value); } } { int one = 1; int little = (int)*(unsigned char *)&one; unsigned char *bytes = (unsigned char *)&value; return _PyLong_FromByteArray(bytes, sizeof(long), little, !is_unsigned); } } static CYTHON_INLINE long __Pyx_PyInt_As_long(PyObject *x) { const long neg_one = (long) -1, const_zero = (long) 0; const int is_unsigned = neg_one > const_zero; #if PY_MAJOR_VERSION < 3 if (likely(PyInt_Check(x))) { if (sizeof(long) < sizeof(long)) { __PYX_VERIFY_RETURN_INT(long, long, PyInt_AS_LONG(x)) } else { long val = PyInt_AS_LONG(x); if (is_unsigned && unlikely(val < 0)) { goto raise_neg_overflow; } return (long) val; } } else #endif if (likely(PyLong_Check(x))) { if (is_unsigned) { #if CYTHON_USE_PYLONG_INTERNALS const digit* digits = ((PyLongObject*)x)->ob_digit; switch (Py_SIZE(x)) { case 0: return (long) 0; case 1: __PYX_VERIFY_RETURN_INT(long, digit, digits[0]) case 2: if (8 * sizeof(long) > 1 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(long) >= 2 * PyLong_SHIFT) { return (long) (((((long)digits[1]) << PyLong_SHIFT) | (long)digits[0])); } } break; case 3: if (8 * sizeof(long) > 2 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(long) >= 3 * PyLong_SHIFT) { return (long) (((((((long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0])); } } break; case 4: if (8 * sizeof(long) > 3 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(long) >= 4 * PyLong_SHIFT) { return (long) (((((((((long)digits[3]) << PyLong_SHIFT) | (long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0])); } } break; } #endif #if CYTHON_COMPILING_IN_CPYTHON if (unlikely(Py_SIZE(x) < 0)) { goto raise_neg_overflow; } #else { int result = PyObject_RichCompareBool(x, Py_False, Py_LT); if (unlikely(result < 0)) return (long) -1; if (unlikely(result == 1)) goto raise_neg_overflow; } #endif if (sizeof(long) <= sizeof(unsigned long)) { __PYX_VERIFY_RETURN_INT_EXC(long, unsigned long, PyLong_AsUnsignedLong(x)) } else if (sizeof(long) <= sizeof(unsigned PY_LONG_LONG)) { __PYX_VERIFY_RETURN_INT_EXC(long, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x)) } } else { #if CYTHON_USE_PYLONG_INTERNALS const digit* digits = ((PyLongObject*)x)->ob_digit; switch (Py_SIZE(x)) { case 0: return (long) 0; case -1: __PYX_VERIFY_RETURN_INT(long, sdigit, -(sdigit) digits[0]) case 1: __PYX_VERIFY_RETURN_INT(long, digit, +digits[0]) case -2: if (8 * sizeof(long) - 1 > 1 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(long, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) { return (long) (((long)-1)*(((((long)digits[1]) << PyLong_SHIFT) | (long)digits[0]))); } } break; case 2: if (8 * sizeof(long) > 1 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) { return (long) ((((((long)digits[1]) << PyLong_SHIFT) | (long)digits[0]))); } } break; case -3: if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(long, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) { return (long) (((long)-1)*(((((((long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0]))); } } break; case 3: if (8 * sizeof(long) > 2 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) { return (long) ((((((((long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0]))); } } break; case -4: if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(long, long, -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(long) - 1 > 4 * PyLong_SHIFT) { return (long) (((long)-1)*(((((((((long)digits[3]) << PyLong_SHIFT) | (long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0]))); } } break; case 4: if (8 * sizeof(long) > 3 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(long) - 1 > 4 * PyLong_SHIFT) { return (long) ((((((((((long)digits[3]) << PyLong_SHIFT) | (long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0]))); } } break; } #endif if (sizeof(long) <= sizeof(long)) { __PYX_VERIFY_RETURN_INT_EXC(long, long, PyLong_AsLong(x)) } else if (sizeof(long) <= sizeof(PY_LONG_LONG)) { __PYX_VERIFY_RETURN_INT_EXC(long, PY_LONG_LONG, PyLong_AsLongLong(x)) } } { #if CYTHON_COMPILING_IN_PYPY && !defined(_PyLong_AsByteArray) PyErr_SetString(PyExc_RuntimeError, "_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers"); #else long val; PyObject *v = __Pyx_PyNumber_Int(x); #if PY_MAJOR_VERSION < 3 if (likely(v) && !PyLong_Check(v)) { PyObject *tmp = v; v = PyNumber_Long(tmp); Py_DECREF(tmp); } #endif if (likely(v)) { int one = 1; int is_little = (int)*(unsigned char *)&one; unsigned char *bytes = (unsigned char *)&val; int ret = _PyLong_AsByteArray((PyLongObject *)v, bytes, sizeof(val), is_little, !is_unsigned); Py_DECREF(v); if (likely(!ret)) return val; } #endif return (long) -1; } } else { long val; PyObject *tmp = __Pyx_PyNumber_Int(x); if (!tmp) return (long) -1; val = __Pyx_PyInt_As_long(tmp); Py_DECREF(tmp); return val; } raise_overflow: PyErr_SetString(PyExc_OverflowError, "value too large to convert to long"); return (long) -1; raise_neg_overflow: PyErr_SetString(PyExc_OverflowError, "can't convert negative value to long"); return (long) -1; } static int __Pyx_check_binary_version(void) { char ctversion[4], rtversion[4]; PyOS_snprintf(ctversion, 4, "%d.%d", PY_MAJOR_VERSION, PY_MINOR_VERSION); PyOS_snprintf(rtversion, 4, "%s", Py_GetVersion()); if (ctversion[0] != rtversion[0] || ctversion[2] != rtversion[2]) { char message[200]; PyOS_snprintf(message, sizeof(message), "compiletime version %s of module '%.100s' " "does not match runtime version %s", ctversion, __Pyx_MODULE_NAME, rtversion); return PyErr_WarnEx(NULL, message, 1); } return 0; } static int __Pyx_InitStrings(__Pyx_StringTabEntry *t) { while (t->p) { #if PY_MAJOR_VERSION < 3 if (t->is_unicode) { *t->p = PyUnicode_DecodeUTF8(t->s, t->n - 1, NULL); } else if (t->intern) { *t->p = PyString_InternFromString(t->s); } else { *t->p = PyString_FromStringAndSize(t->s, t->n - 1); } #else if (t->is_unicode | t->is_str) { if (t->intern) { *t->p = PyUnicode_InternFromString(t->s); } else if (t->encoding) { *t->p = PyUnicode_Decode(t->s, t->n - 1, t->encoding, NULL); } else { *t->p = PyUnicode_FromStringAndSize(t->s, t->n - 1); } } else { *t->p = PyBytes_FromStringAndSize(t->s, t->n - 1); } #endif if (!*t->p) return -1; ++t; } return 0; } static CYTHON_INLINE PyObject* __Pyx_PyUnicode_FromString(const char* c_str) { return __Pyx_PyUnicode_FromStringAndSize(c_str, (Py_ssize_t)strlen(c_str)); } static CYTHON_INLINE char* __Pyx_PyObject_AsString(PyObject* o) { Py_ssize_t ignore; return __Pyx_PyObject_AsStringAndSize(o, &ignore); } static CYTHON_INLINE char* __Pyx_PyObject_AsStringAndSize(PyObject* o, Py_ssize_t *length) { #if CYTHON_COMPILING_IN_CPYTHON && (__PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT) if ( #if PY_MAJOR_VERSION < 3 && __PYX_DEFAULT_STRING_ENCODING_IS_ASCII __Pyx_sys_getdefaultencoding_not_ascii && #endif PyUnicode_Check(o)) { #if PY_VERSION_HEX < 0x03030000 char* defenc_c; PyObject* defenc = _PyUnicode_AsDefaultEncodedString(o, NULL); if (!defenc) return NULL; defenc_c = PyBytes_AS_STRING(defenc); #if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII { char* end = defenc_c + PyBytes_GET_SIZE(defenc); char* c; for (c = defenc_c; c < end; c++) { if ((unsigned char) (*c) >= 128) { PyUnicode_AsASCIIString(o); return NULL; } } } #endif *length = PyBytes_GET_SIZE(defenc); return defenc_c; #else if (__Pyx_PyUnicode_READY(o) == -1) return NULL; #if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII if (PyUnicode_IS_ASCII(o)) { *length = PyUnicode_GET_LENGTH(o); return PyUnicode_AsUTF8(o); } else { PyUnicode_AsASCIIString(o); return NULL; } #else return PyUnicode_AsUTF8AndSize(o, length); #endif #endif } else #endif #if (!CYTHON_COMPILING_IN_PYPY) || (defined(PyByteArray_AS_STRING) && defined(PyByteArray_GET_SIZE)) if (PyByteArray_Check(o)) { *length = PyByteArray_GET_SIZE(o); return PyByteArray_AS_STRING(o); } else #endif { char* result; int r = PyBytes_AsStringAndSize(o, &result, length); if (unlikely(r < 0)) { return NULL; } else { return result; } } } static CYTHON_INLINE int __Pyx_PyObject_IsTrue(PyObject* x) { int is_true = x == Py_True; if (is_true | (x == Py_False) | (x == Py_None)) return is_true; else return PyObject_IsTrue(x); } static CYTHON_INLINE PyObject* __Pyx_PyNumber_Int(PyObject* x) { PyNumberMethods *m; const char *name = NULL; PyObject *res = NULL; #if PY_MAJOR_VERSION < 3 if (PyInt_Check(x) || PyLong_Check(x)) #else if (PyLong_Check(x)) #endif return __Pyx_NewRef(x); m = Py_TYPE(x)->tp_as_number; #if PY_MAJOR_VERSION < 3 if (m && m->nb_int) { name = "int"; res = PyNumber_Int(x); } else if (m && m->nb_long) { name = "long"; res = PyNumber_Long(x); } #else if (m && m->nb_int) { name = "int"; res = PyNumber_Long(x); } #endif if (res) { #if PY_MAJOR_VERSION < 3 if (!PyInt_Check(res) && !PyLong_Check(res)) { #else if (!PyLong_Check(res)) { #endif PyErr_Format(PyExc_TypeError, "__%.4s__ returned non-%.4s (type %.200s)", name, name, Py_TYPE(res)->tp_name); Py_DECREF(res); return NULL; } } else if (!PyErr_Occurred()) { PyErr_SetString(PyExc_TypeError, "an integer is required"); } return res; } static CYTHON_INLINE Py_ssize_t __Pyx_PyIndex_AsSsize_t(PyObject* b) { Py_ssize_t ival; PyObject *x; #if PY_MAJOR_VERSION < 3 if (likely(PyInt_CheckExact(b))) { if (sizeof(Py_ssize_t) >= sizeof(long)) return PyInt_AS_LONG(b); else return PyInt_AsSsize_t(x); } #endif if (likely(PyLong_CheckExact(b))) { #if CYTHON_USE_PYLONG_INTERNALS const digit* digits = ((PyLongObject*)b)->ob_digit; const Py_ssize_t size = Py_SIZE(b); if (likely(__Pyx_sst_abs(size) <= 1)) { ival = likely(size) ? digits[0] : 0; if (size == -1) ival = -ival; return ival; } else { switch (size) { case 2: if (8 * sizeof(Py_ssize_t) > 2 * PyLong_SHIFT) { return (Py_ssize_t) (((((size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])); } break; case -2: if (8 * sizeof(Py_ssize_t) > 2 * PyLong_SHIFT) { return -(Py_ssize_t) (((((size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])); } break; case 3: if (8 * sizeof(Py_ssize_t) > 3 * PyLong_SHIFT) { return (Py_ssize_t) (((((((size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])); } break; case -3: if (8 * sizeof(Py_ssize_t) > 3 * PyLong_SHIFT) { return -(Py_ssize_t) (((((((size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])); } break; case 4: if (8 * sizeof(Py_ssize_t) > 4 * PyLong_SHIFT) { return (Py_ssize_t) (((((((((size_t)digits[3]) << PyLong_SHIFT) | (size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])); } break; case -4: if (8 * sizeof(Py_ssize_t) > 4 * PyLong_SHIFT) { return -(Py_ssize_t) (((((((((size_t)digits[3]) << PyLong_SHIFT) | (size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])); } break; } } #endif return PyLong_AsSsize_t(b); } x = PyNumber_Index(b); if (!x) return -1; ival = PyInt_AsSsize_t(x); Py_DECREF(x); return ival; } static CYTHON_INLINE PyObject * __Pyx_PyInt_FromSize_t(size_t ival) { return PyInt_FromSize_t(ival); } #endif /* Py_PYTHON_H */ pygame_sdl2-2.1.0-for-renpy-6.99.14.1/gen3/pygame_sdl2.color.c0000644000175000017500000464144613113674671022623 0ustar tomtom00000000000000/* Generated by Cython 0.24 */ #define PY_SSIZE_T_CLEAN #include "Python.h" #ifndef Py_PYTHON_H #error Python headers needed to compile C extensions, please install development version of Python. #elif PY_VERSION_HEX < 0x02060000 || (0x03000000 <= PY_VERSION_HEX && PY_VERSION_HEX < 0x03020000) #error Cython requires Python 2.6+ or Python 3.2+. #else #define CYTHON_ABI "0_24" #include #ifndef offsetof #define offsetof(type, member) ( (size_t) & ((type*)0) -> member ) #endif #if !defined(WIN32) && !defined(MS_WINDOWS) #ifndef __stdcall #define __stdcall #endif #ifndef __cdecl #define __cdecl #endif #ifndef __fastcall #define __fastcall #endif #endif #ifndef DL_IMPORT #define DL_IMPORT(t) t #endif #ifndef DL_EXPORT #define DL_EXPORT(t) t #endif #ifndef PY_LONG_LONG #define PY_LONG_LONG LONG_LONG #endif #ifndef Py_HUGE_VAL #define Py_HUGE_VAL HUGE_VAL #endif #ifdef PYPY_VERSION #define CYTHON_COMPILING_IN_PYPY 1 #define CYTHON_COMPILING_IN_CPYTHON 0 #else #define CYTHON_COMPILING_IN_PYPY 0 #define CYTHON_COMPILING_IN_CPYTHON 1 #endif #if !defined(CYTHON_USE_PYLONG_INTERNALS) && CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x02070000 #define CYTHON_USE_PYLONG_INTERNALS 1 #endif #if CYTHON_USE_PYLONG_INTERNALS #include "longintrepr.h" #undef SHIFT #undef BASE #undef MASK #endif #if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX < 0x02070600 && !defined(Py_OptimizeFlag) #define Py_OptimizeFlag 0 #endif #define __PYX_BUILD_PY_SSIZE_T "n" #define CYTHON_FORMAT_SSIZE_T "z" #if PY_MAJOR_VERSION < 3 #define __Pyx_BUILTIN_MODULE_NAME "__builtin__" #define __Pyx_PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)\ PyCode_New(a+k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos) #define __Pyx_DefaultClassType PyClass_Type #else #define __Pyx_BUILTIN_MODULE_NAME "builtins" #define __Pyx_PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)\ PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos) #define __Pyx_DefaultClassType PyType_Type #endif #ifndef Py_TPFLAGS_CHECKTYPES #define Py_TPFLAGS_CHECKTYPES 0 #endif #ifndef Py_TPFLAGS_HAVE_INDEX #define Py_TPFLAGS_HAVE_INDEX 0 #endif #ifndef Py_TPFLAGS_HAVE_NEWBUFFER #define Py_TPFLAGS_HAVE_NEWBUFFER 0 #endif #ifndef Py_TPFLAGS_HAVE_FINALIZE #define Py_TPFLAGS_HAVE_FINALIZE 0 #endif #if PY_VERSION_HEX > 0x03030000 && defined(PyUnicode_KIND) #define CYTHON_PEP393_ENABLED 1 #define __Pyx_PyUnicode_READY(op) (likely(PyUnicode_IS_READY(op)) ?\ 0 : _PyUnicode_Ready((PyObject *)(op))) #define __Pyx_PyUnicode_GET_LENGTH(u) PyUnicode_GET_LENGTH(u) #define __Pyx_PyUnicode_READ_CHAR(u, i) PyUnicode_READ_CHAR(u, i) #define __Pyx_PyUnicode_KIND(u) PyUnicode_KIND(u) #define __Pyx_PyUnicode_DATA(u) PyUnicode_DATA(u) #define __Pyx_PyUnicode_READ(k, d, i) PyUnicode_READ(k, d, i) #define __Pyx_PyUnicode_IS_TRUE(u) (0 != (likely(PyUnicode_IS_READY(u)) ? PyUnicode_GET_LENGTH(u) : PyUnicode_GET_SIZE(u))) #else #define CYTHON_PEP393_ENABLED 0 #define __Pyx_PyUnicode_READY(op) (0) #define __Pyx_PyUnicode_GET_LENGTH(u) PyUnicode_GET_SIZE(u) #define __Pyx_PyUnicode_READ_CHAR(u, i) ((Py_UCS4)(PyUnicode_AS_UNICODE(u)[i])) #define __Pyx_PyUnicode_KIND(u) (sizeof(Py_UNICODE)) #define __Pyx_PyUnicode_DATA(u) ((void*)PyUnicode_AS_UNICODE(u)) #define __Pyx_PyUnicode_READ(k, d, i) ((void)(k), (Py_UCS4)(((Py_UNICODE*)d)[i])) #define __Pyx_PyUnicode_IS_TRUE(u) (0 != PyUnicode_GET_SIZE(u)) #endif #if CYTHON_COMPILING_IN_PYPY #define __Pyx_PyUnicode_Concat(a, b) PyNumber_Add(a, b) #define __Pyx_PyUnicode_ConcatSafe(a, b) PyNumber_Add(a, b) #else #define __Pyx_PyUnicode_Concat(a, b) PyUnicode_Concat(a, b) #define __Pyx_PyUnicode_ConcatSafe(a, b) ((unlikely((a) == Py_None) || unlikely((b) == Py_None)) ?\ PyNumber_Add(a, b) : __Pyx_PyUnicode_Concat(a, b)) #endif #if CYTHON_COMPILING_IN_PYPY && !defined(PyUnicode_Contains) #define PyUnicode_Contains(u, s) PySequence_Contains(u, s) #endif #if CYTHON_COMPILING_IN_PYPY && !defined(PyObject_Format) #define PyObject_Format(obj, fmt) PyObject_CallMethod(obj, "__format__", "O", fmt) #endif #if CYTHON_COMPILING_IN_PYPY && !defined(PyObject_Malloc) #define PyObject_Malloc(s) PyMem_Malloc(s) #define PyObject_Free(p) PyMem_Free(p) #define PyObject_Realloc(p) PyMem_Realloc(p) #endif #define __Pyx_PyString_FormatSafe(a, b) ((unlikely((a) == Py_None)) ? PyNumber_Remainder(a, b) : __Pyx_PyString_Format(a, b)) #define __Pyx_PyUnicode_FormatSafe(a, b) ((unlikely((a) == Py_None)) ? PyNumber_Remainder(a, b) : PyUnicode_Format(a, b)) #if PY_MAJOR_VERSION >= 3 #define __Pyx_PyString_Format(a, b) PyUnicode_Format(a, b) #else #define __Pyx_PyString_Format(a, b) PyString_Format(a, b) #endif #if PY_MAJOR_VERSION < 3 && !defined(PyObject_ASCII) #define PyObject_ASCII(o) PyObject_Repr(o) #endif #if PY_MAJOR_VERSION >= 3 #define PyBaseString_Type PyUnicode_Type #define PyStringObject PyUnicodeObject #define PyString_Type PyUnicode_Type #define PyString_Check PyUnicode_Check #define PyString_CheckExact PyUnicode_CheckExact #endif #if PY_MAJOR_VERSION >= 3 #define __Pyx_PyBaseString_Check(obj) PyUnicode_Check(obj) #define __Pyx_PyBaseString_CheckExact(obj) PyUnicode_CheckExact(obj) #else #define __Pyx_PyBaseString_Check(obj) (PyString_Check(obj) || PyUnicode_Check(obj)) #define __Pyx_PyBaseString_CheckExact(obj) (PyString_CheckExact(obj) || PyUnicode_CheckExact(obj)) #endif #ifndef PySet_CheckExact #define PySet_CheckExact(obj) (Py_TYPE(obj) == &PySet_Type) #endif #define __Pyx_TypeCheck(obj, type) PyObject_TypeCheck(obj, (PyTypeObject *)type) #if PY_MAJOR_VERSION >= 3 #define PyIntObject PyLongObject #define PyInt_Type PyLong_Type #define PyInt_Check(op) PyLong_Check(op) #define PyInt_CheckExact(op) PyLong_CheckExact(op) #define PyInt_FromString PyLong_FromString #define PyInt_FromUnicode PyLong_FromUnicode #define PyInt_FromLong PyLong_FromLong #define PyInt_FromSize_t PyLong_FromSize_t #define PyInt_FromSsize_t PyLong_FromSsize_t #define PyInt_AsLong PyLong_AsLong #define PyInt_AS_LONG PyLong_AS_LONG #define PyInt_AsSsize_t PyLong_AsSsize_t #define PyInt_AsUnsignedLongMask PyLong_AsUnsignedLongMask #define PyInt_AsUnsignedLongLongMask PyLong_AsUnsignedLongLongMask #define PyNumber_Int PyNumber_Long #endif #if PY_MAJOR_VERSION >= 3 #define PyBoolObject PyLongObject #endif #if PY_MAJOR_VERSION >= 3 && CYTHON_COMPILING_IN_PYPY #ifndef PyUnicode_InternFromString #define PyUnicode_InternFromString(s) PyUnicode_FromString(s) #endif #endif #if PY_VERSION_HEX < 0x030200A4 typedef long Py_hash_t; #define __Pyx_PyInt_FromHash_t PyInt_FromLong #define __Pyx_PyInt_AsHash_t PyInt_AsLong #else #define __Pyx_PyInt_FromHash_t PyInt_FromSsize_t #define __Pyx_PyInt_AsHash_t PyInt_AsSsize_t #endif #if PY_MAJOR_VERSION >= 3 #define __Pyx_PyMethod_New(func, self, klass) ((self) ? PyMethod_New(func, self) : PyInstanceMethod_New(func)) #else #define __Pyx_PyMethod_New(func, self, klass) PyMethod_New(func, self, klass) #endif #if PY_VERSION_HEX >= 0x030500B1 #define __Pyx_PyAsyncMethodsStruct PyAsyncMethods #define __Pyx_PyType_AsAsync(obj) (Py_TYPE(obj)->tp_as_async) #elif CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3 typedef struct { unaryfunc am_await; unaryfunc am_aiter; unaryfunc am_anext; } __Pyx_PyAsyncMethodsStruct; #define __Pyx_PyType_AsAsync(obj) ((__Pyx_PyAsyncMethodsStruct*) (Py_TYPE(obj)->tp_reserved)) #else #define __Pyx_PyType_AsAsync(obj) NULL #endif #ifndef CYTHON_RESTRICT #if defined(__GNUC__) #define CYTHON_RESTRICT __restrict__ #elif defined(_MSC_VER) && _MSC_VER >= 1400 #define CYTHON_RESTRICT __restrict #elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L #define CYTHON_RESTRICT restrict #else #define CYTHON_RESTRICT #endif #endif #define __Pyx_void_to_None(void_result) ((void)(void_result), Py_INCREF(Py_None), Py_None) #ifndef CYTHON_INLINE #if defined(__GNUC__) #define CYTHON_INLINE __inline__ #elif defined(_MSC_VER) #define CYTHON_INLINE __inline #elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L #define CYTHON_INLINE inline #else #define CYTHON_INLINE #endif #endif #if defined(WIN32) || defined(MS_WINDOWS) #define _USE_MATH_DEFINES #endif #include #ifdef NAN #define __PYX_NAN() ((float) NAN) #else static CYTHON_INLINE float __PYX_NAN() { float value; memset(&value, 0xFF, sizeof(value)); return value; } #endif #define __PYX_ERR(f_index, lineno, Ln_error) \ { \ __pyx_filename = __pyx_f[f_index]; __pyx_lineno = lineno; __pyx_clineno = __LINE__; goto Ln_error; \ } #if PY_MAJOR_VERSION >= 3 #define __Pyx_PyNumber_Divide(x,y) PyNumber_TrueDivide(x,y) #define __Pyx_PyNumber_InPlaceDivide(x,y) PyNumber_InPlaceTrueDivide(x,y) #else #define __Pyx_PyNumber_Divide(x,y) PyNumber_TrueDivide(x,y) #define __Pyx_PyNumber_InPlaceDivide(x,y) PyNumber_InPlaceTrueDivide(x,y) #endif #ifndef __PYX_EXTERN_C #ifdef __cplusplus #define __PYX_EXTERN_C extern "C" #else #define __PYX_EXTERN_C extern #endif #endif #define __PYX_HAVE__pygame_sdl2__color #define __PYX_HAVE_API__pygame_sdl2__color #include "stdint.h" #include "string.h" #include "stdio.h" #include "stddef.h" #include "SDL.h" #ifdef _OPENMP #include #endif /* _OPENMP */ #ifdef PYREX_WITHOUT_ASSERTIONS #define CYTHON_WITHOUT_ASSERTIONS #endif #ifndef CYTHON_UNUSED # if defined(__GNUC__) # if !(defined(__cplusplus)) || (__GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 4)) # define CYTHON_UNUSED __attribute__ ((__unused__)) # else # define CYTHON_UNUSED # endif # elif defined(__ICC) || (defined(__INTEL_COMPILER) && !defined(_MSC_VER)) # define CYTHON_UNUSED __attribute__ ((__unused__)) # else # define CYTHON_UNUSED # endif #endif #ifndef CYTHON_NCP_UNUSED # if CYTHON_COMPILING_IN_CPYTHON # define CYTHON_NCP_UNUSED # else # define CYTHON_NCP_UNUSED CYTHON_UNUSED # endif #endif typedef struct {PyObject **p; const char *s; const Py_ssize_t n; const char* encoding; const char is_unicode; const char is_str; const char intern; } __Pyx_StringTabEntry; #define __PYX_DEFAULT_STRING_ENCODING_IS_ASCII 0 #define __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT 0 #define __PYX_DEFAULT_STRING_ENCODING "" #define __Pyx_PyObject_FromString __Pyx_PyBytes_FromString #define __Pyx_PyObject_FromStringAndSize __Pyx_PyBytes_FromStringAndSize #define __Pyx_uchar_cast(c) ((unsigned char)c) #define __Pyx_long_cast(x) ((long)x) #define __Pyx_fits_Py_ssize_t(v, type, is_signed) (\ (sizeof(type) < sizeof(Py_ssize_t)) ||\ (sizeof(type) > sizeof(Py_ssize_t) &&\ likely(v < (type)PY_SSIZE_T_MAX ||\ v == (type)PY_SSIZE_T_MAX) &&\ (!is_signed || likely(v > (type)PY_SSIZE_T_MIN ||\ v == (type)PY_SSIZE_T_MIN))) ||\ (sizeof(type) == sizeof(Py_ssize_t) &&\ (is_signed || likely(v < (type)PY_SSIZE_T_MAX ||\ v == (type)PY_SSIZE_T_MAX))) ) #if defined (__cplusplus) && __cplusplus >= 201103L #include #define __Pyx_sst_abs(value) std::abs(value) #elif SIZEOF_INT >= SIZEOF_SIZE_T #define __Pyx_sst_abs(value) abs(value) #elif SIZEOF_LONG >= SIZEOF_SIZE_T #define __Pyx_sst_abs(value) labs(value) #elif defined (_MSC_VER) && defined (_M_X64) #define __Pyx_sst_abs(value) _abs64(value) #elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L #define __Pyx_sst_abs(value) llabs(value) #elif defined (__GNUC__) #define __Pyx_sst_abs(value) __builtin_llabs(value) #else #define __Pyx_sst_abs(value) ((value<0) ? -value : value) #endif static CYTHON_INLINE char* __Pyx_PyObject_AsString(PyObject*); static CYTHON_INLINE char* __Pyx_PyObject_AsStringAndSize(PyObject*, Py_ssize_t* length); #define __Pyx_PyByteArray_FromString(s) PyByteArray_FromStringAndSize((const char*)s, strlen((const char*)s)) #define __Pyx_PyByteArray_FromStringAndSize(s, l) PyByteArray_FromStringAndSize((const char*)s, l) #define __Pyx_PyBytes_FromString PyBytes_FromString #define __Pyx_PyBytes_FromStringAndSize PyBytes_FromStringAndSize static CYTHON_INLINE PyObject* __Pyx_PyUnicode_FromString(const char*); #if PY_MAJOR_VERSION < 3 #define __Pyx_PyStr_FromString __Pyx_PyBytes_FromString #define __Pyx_PyStr_FromStringAndSize __Pyx_PyBytes_FromStringAndSize #else #define __Pyx_PyStr_FromString __Pyx_PyUnicode_FromString #define __Pyx_PyStr_FromStringAndSize __Pyx_PyUnicode_FromStringAndSize #endif #define __Pyx_PyObject_AsSString(s) ((signed char*) __Pyx_PyObject_AsString(s)) #define __Pyx_PyObject_AsUString(s) ((unsigned char*) __Pyx_PyObject_AsString(s)) #define __Pyx_PyObject_FromCString(s) __Pyx_PyObject_FromString((const char*)s) #define __Pyx_PyBytes_FromCString(s) __Pyx_PyBytes_FromString((const char*)s) #define __Pyx_PyByteArray_FromCString(s) __Pyx_PyByteArray_FromString((const char*)s) #define __Pyx_PyStr_FromCString(s) __Pyx_PyStr_FromString((const char*)s) #define __Pyx_PyUnicode_FromCString(s) __Pyx_PyUnicode_FromString((const char*)s) #if PY_MAJOR_VERSION < 3 static CYTHON_INLINE size_t __Pyx_Py_UNICODE_strlen(const Py_UNICODE *u) { const Py_UNICODE *u_end = u; while (*u_end++) ; return (size_t)(u_end - u - 1); } #else #define __Pyx_Py_UNICODE_strlen Py_UNICODE_strlen #endif #define __Pyx_PyUnicode_FromUnicode(u) PyUnicode_FromUnicode(u, __Pyx_Py_UNICODE_strlen(u)) #define __Pyx_PyUnicode_FromUnicodeAndLength PyUnicode_FromUnicode #define __Pyx_PyUnicode_AsUnicode PyUnicode_AsUnicode #define __Pyx_NewRef(obj) (Py_INCREF(obj), obj) #define __Pyx_Owned_Py_None(b) __Pyx_NewRef(Py_None) #define __Pyx_PyBool_FromLong(b) ((b) ? __Pyx_NewRef(Py_True) : __Pyx_NewRef(Py_False)) static CYTHON_INLINE int __Pyx_PyObject_IsTrue(PyObject*); static CYTHON_INLINE PyObject* __Pyx_PyNumber_IntOrLong(PyObject* x); static CYTHON_INLINE Py_ssize_t __Pyx_PyIndex_AsSsize_t(PyObject*); static CYTHON_INLINE PyObject * __Pyx_PyInt_FromSize_t(size_t); #if CYTHON_COMPILING_IN_CPYTHON #define __pyx_PyFloat_AsDouble(x) (PyFloat_CheckExact(x) ? PyFloat_AS_DOUBLE(x) : PyFloat_AsDouble(x)) #else #define __pyx_PyFloat_AsDouble(x) PyFloat_AsDouble(x) #endif #define __pyx_PyFloat_AsFloat(x) ((float) __pyx_PyFloat_AsDouble(x)) #if PY_MAJOR_VERSION >= 3 #define __Pyx_PyNumber_Int(x) (PyLong_CheckExact(x) ? __Pyx_NewRef(x) : PyNumber_Long(x)) #else #define __Pyx_PyNumber_Int(x) (PyInt_CheckExact(x) ? __Pyx_NewRef(x) : PyNumber_Int(x)) #endif #define __Pyx_PyNumber_Float(x) (PyFloat_CheckExact(x) ? __Pyx_NewRef(x) : PyNumber_Float(x)) #if PY_MAJOR_VERSION < 3 && __PYX_DEFAULT_STRING_ENCODING_IS_ASCII static int __Pyx_sys_getdefaultencoding_not_ascii; static int __Pyx_init_sys_getdefaultencoding_params(void) { PyObject* sys; PyObject* default_encoding = NULL; PyObject* ascii_chars_u = NULL; PyObject* ascii_chars_b = NULL; const char* default_encoding_c; sys = PyImport_ImportModule("sys"); if (!sys) goto bad; default_encoding = PyObject_CallMethod(sys, (char*) "getdefaultencoding", NULL); Py_DECREF(sys); if (!default_encoding) goto bad; default_encoding_c = PyBytes_AsString(default_encoding); if (!default_encoding_c) goto bad; if (strcmp(default_encoding_c, "ascii") == 0) { __Pyx_sys_getdefaultencoding_not_ascii = 0; } else { char ascii_chars[128]; int c; for (c = 0; c < 128; c++) { ascii_chars[c] = c; } __Pyx_sys_getdefaultencoding_not_ascii = 1; ascii_chars_u = PyUnicode_DecodeASCII(ascii_chars, 128, NULL); if (!ascii_chars_u) goto bad; ascii_chars_b = PyUnicode_AsEncodedString(ascii_chars_u, default_encoding_c, NULL); if (!ascii_chars_b || !PyBytes_Check(ascii_chars_b) || memcmp(ascii_chars, PyBytes_AS_STRING(ascii_chars_b), 128) != 0) { PyErr_Format( PyExc_ValueError, "This module compiled with c_string_encoding=ascii, but default encoding '%.200s' is not a superset of ascii.", default_encoding_c); goto bad; } Py_DECREF(ascii_chars_u); Py_DECREF(ascii_chars_b); } Py_DECREF(default_encoding); return 0; bad: Py_XDECREF(default_encoding); Py_XDECREF(ascii_chars_u); Py_XDECREF(ascii_chars_b); return -1; } #endif #if __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT && PY_MAJOR_VERSION >= 3 #define __Pyx_PyUnicode_FromStringAndSize(c_str, size) PyUnicode_DecodeUTF8(c_str, size, NULL) #else #define __Pyx_PyUnicode_FromStringAndSize(c_str, size) PyUnicode_Decode(c_str, size, __PYX_DEFAULT_STRING_ENCODING, NULL) #if __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT static char* __PYX_DEFAULT_STRING_ENCODING; static int __Pyx_init_sys_getdefaultencoding_params(void) { PyObject* sys; PyObject* default_encoding = NULL; char* default_encoding_c; sys = PyImport_ImportModule("sys"); if (!sys) goto bad; default_encoding = PyObject_CallMethod(sys, (char*) (const char*) "getdefaultencoding", NULL); Py_DECREF(sys); if (!default_encoding) goto bad; default_encoding_c = PyBytes_AsString(default_encoding); if (!default_encoding_c) goto bad; __PYX_DEFAULT_STRING_ENCODING = (char*) malloc(strlen(default_encoding_c)); if (!__PYX_DEFAULT_STRING_ENCODING) goto bad; strcpy(__PYX_DEFAULT_STRING_ENCODING, default_encoding_c); Py_DECREF(default_encoding); return 0; bad: Py_XDECREF(default_encoding); return -1; } #endif #endif /* Test for GCC > 2.95 */ #if defined(__GNUC__) && (__GNUC__ > 2 || (__GNUC__ == 2 && (__GNUC_MINOR__ > 95))) #define likely(x) __builtin_expect(!!(x), 1) #define unlikely(x) __builtin_expect(!!(x), 0) #else /* !__GNUC__ or GCC < 2.95 */ #define likely(x) (x) #define unlikely(x) (x) #endif /* __GNUC__ */ static PyObject *__pyx_m; static PyObject *__pyx_d; static PyObject *__pyx_b; static PyObject *__pyx_empty_tuple; static PyObject *__pyx_empty_bytes; static PyObject *__pyx_empty_unicode; static int __pyx_lineno; static int __pyx_clineno = 0; static const char * __pyx_cfilenm= __FILE__; static const char *__pyx_filename; static const char *__pyx_f[] = { "src/pygame_sdl2/color.pyx", "src/pygame_sdl2/color.pxd", "include/color_dict.pxi", }; /*--- Type declarations ---*/ struct __pyx_obj_11pygame_sdl2_5color_Color; struct __pyx_obj_11pygame_sdl2_5color___pyx_scope_struct__correct_gamma; /* "pygame_sdl2/color.pxd":26 * cdef to_sdl_color(color, SDL_Color *out) * * cdef class Color: # <<<<<<<<<<<<<< * # Allow weak references. * cdef object __weakref__ */ struct __pyx_obj_11pygame_sdl2_5color_Color { PyObject_HEAD struct __pyx_vtabstruct_11pygame_sdl2_5color_Color *__pyx_vtab; PyObject *__weakref__; Uint8 r; Uint8 g; Uint8 b; Uint8 a; uint8_t length; }; /* "pygame_sdl2/color.pyx":452 * return self.r / 255.0, self.g / 255.0, self.b / 255.0, self.a / 255.0 * * def correct_gamma(self, gamma): # <<<<<<<<<<<<<< * m = map(lambda x: int(round(pow(x / 255.0, gamma) * 255)), tuple(self)) * c = type(self)(tuple(m)) */ struct __pyx_obj_11pygame_sdl2_5color___pyx_scope_struct__correct_gamma { PyObject_HEAD PyObject *__pyx_v_gamma; }; /* "pygame_sdl2/color.pyx":63 * out.a = color.a * * cdef class Color: # <<<<<<<<<<<<<< * cdef from_rgba(self, Uint8 r, Uint8 g, Uint8 b, Uint8 a): * self.r = r */ struct __pyx_vtabstruct_11pygame_sdl2_5color_Color { PyObject *(*from_rgba)(struct __pyx_obj_11pygame_sdl2_5color_Color *, Uint8, Uint8, Uint8, Uint8); PyObject *(*from_name)(struct __pyx_obj_11pygame_sdl2_5color_Color *, PyObject *); PyObject *(*from_hex)(struct __pyx_obj_11pygame_sdl2_5color_Color *, PyObject *); }; static struct __pyx_vtabstruct_11pygame_sdl2_5color_Color *__pyx_vtabptr_11pygame_sdl2_5color_Color; /* --- Runtime support code (head) --- */ /* Refnanny.proto */ #ifndef CYTHON_REFNANNY #define CYTHON_REFNANNY 0 #endif #if CYTHON_REFNANNY typedef struct { void (*INCREF)(void*, PyObject*, int); void (*DECREF)(void*, PyObject*, int); void (*GOTREF)(void*, PyObject*, int); void (*GIVEREF)(void*, PyObject*, int); void* (*SetupContext)(const char*, int, const char*); void (*FinishContext)(void**); } __Pyx_RefNannyAPIStruct; static __Pyx_RefNannyAPIStruct *__Pyx_RefNanny = NULL; static __Pyx_RefNannyAPIStruct *__Pyx_RefNannyImportAPI(const char *modname); #define __Pyx_RefNannyDeclarations void *__pyx_refnanny = NULL; #ifdef WITH_THREAD #define __Pyx_RefNannySetupContext(name, acquire_gil)\ if (acquire_gil) {\ PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure();\ __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), __LINE__, __FILE__);\ PyGILState_Release(__pyx_gilstate_save);\ } else {\ __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), __LINE__, __FILE__);\ } #else #define __Pyx_RefNannySetupContext(name, acquire_gil)\ __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), __LINE__, __FILE__) #endif #define __Pyx_RefNannyFinishContext()\ __Pyx_RefNanny->FinishContext(&__pyx_refnanny) #define __Pyx_INCREF(r) __Pyx_RefNanny->INCREF(__pyx_refnanny, (PyObject *)(r), __LINE__) #define __Pyx_DECREF(r) __Pyx_RefNanny->DECREF(__pyx_refnanny, (PyObject *)(r), __LINE__) #define __Pyx_GOTREF(r) __Pyx_RefNanny->GOTREF(__pyx_refnanny, (PyObject *)(r), __LINE__) #define __Pyx_GIVEREF(r) __Pyx_RefNanny->GIVEREF(__pyx_refnanny, (PyObject *)(r), __LINE__) #define __Pyx_XINCREF(r) do { if((r) != NULL) {__Pyx_INCREF(r); }} while(0) #define __Pyx_XDECREF(r) do { if((r) != NULL) {__Pyx_DECREF(r); }} while(0) #define __Pyx_XGOTREF(r) do { if((r) != NULL) {__Pyx_GOTREF(r); }} while(0) #define __Pyx_XGIVEREF(r) do { if((r) != NULL) {__Pyx_GIVEREF(r);}} while(0) #else #define __Pyx_RefNannyDeclarations #define __Pyx_RefNannySetupContext(name, acquire_gil) #define __Pyx_RefNannyFinishContext() #define __Pyx_INCREF(r) Py_INCREF(r) #define __Pyx_DECREF(r) Py_DECREF(r) #define __Pyx_GOTREF(r) #define __Pyx_GIVEREF(r) #define __Pyx_XINCREF(r) Py_XINCREF(r) #define __Pyx_XDECREF(r) Py_XDECREF(r) #define __Pyx_XGOTREF(r) #define __Pyx_XGIVEREF(r) #endif #define __Pyx_XDECREF_SET(r, v) do {\ PyObject *tmp = (PyObject *) r;\ r = v; __Pyx_XDECREF(tmp);\ } while (0) #define __Pyx_DECREF_SET(r, v) do {\ PyObject *tmp = (PyObject *) r;\ r = v; __Pyx_DECREF(tmp);\ } while (0) #define __Pyx_CLEAR(r) do { PyObject* tmp = ((PyObject*)(r)); r = NULL; __Pyx_DECREF(tmp);} while(0) #define __Pyx_XCLEAR(r) do { if((r) != NULL) {PyObject* tmp = ((PyObject*)(r)); r = NULL; __Pyx_DECREF(tmp);}} while(0) /* PyObjectGetAttrStr.proto */ #if CYTHON_COMPILING_IN_CPYTHON static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStr(PyObject* obj, PyObject* attr_name) { PyTypeObject* tp = Py_TYPE(obj); if (likely(tp->tp_getattro)) return tp->tp_getattro(obj, attr_name); #if PY_MAJOR_VERSION < 3 if (likely(tp->tp_getattr)) return tp->tp_getattr(obj, PyString_AS_STRING(attr_name)); #endif return PyObject_GetAttr(obj, attr_name); } #else #define __Pyx_PyObject_GetAttrStr(o,n) PyObject_GetAttr(o,n) #endif /* GetBuiltinName.proto */ static PyObject *__Pyx_GetBuiltinName(PyObject *name); /* RaiseTooManyValuesToUnpack.proto */ static CYTHON_INLINE void __Pyx_RaiseTooManyValuesError(Py_ssize_t expected); /* RaiseNeedMoreValuesToUnpack.proto */ static CYTHON_INLINE void __Pyx_RaiseNeedMoreValuesError(Py_ssize_t index); /* IterFinish.proto */ static CYTHON_INLINE int __Pyx_IterFinish(void); /* UnpackItemEndCheck.proto */ static int __Pyx_IternextUnpackEndCheck(PyObject *retval, Py_ssize_t expected); /* PyObjectCall.proto */ #if CYTHON_COMPILING_IN_CPYTHON static CYTHON_INLINE PyObject* __Pyx_PyObject_Call(PyObject *func, PyObject *arg, PyObject *kw); #else #define __Pyx_PyObject_Call(func, arg, kw) PyObject_Call(func, arg, kw) #endif /* PyThreadStateGet.proto */ #if CYTHON_COMPILING_IN_CPYTHON #define __Pyx_PyThreadState_declare PyThreadState *__pyx_tstate; #define __Pyx_PyThreadState_assign __pyx_tstate = PyThreadState_GET(); #else #define __Pyx_PyThreadState_declare #define __Pyx_PyThreadState_assign #endif /* PyErrFetchRestore.proto */ #if CYTHON_COMPILING_IN_CPYTHON #define __Pyx_ErrRestoreWithState(type, value, tb) __Pyx_ErrRestoreInState(PyThreadState_GET(), type, value, tb) #define __Pyx_ErrFetchWithState(type, value, tb) __Pyx_ErrFetchInState(PyThreadState_GET(), type, value, tb) #define __Pyx_ErrRestore(type, value, tb) __Pyx_ErrRestoreInState(__pyx_tstate, type, value, tb) #define __Pyx_ErrFetch(type, value, tb) __Pyx_ErrFetchInState(__pyx_tstate, type, value, tb) static CYTHON_INLINE void __Pyx_ErrRestoreInState(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb); static CYTHON_INLINE void __Pyx_ErrFetchInState(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb); #else #define __Pyx_ErrRestoreWithState(type, value, tb) PyErr_Restore(type, value, tb) #define __Pyx_ErrFetchWithState(type, value, tb) PyErr_Fetch(type, value, tb) #define __Pyx_ErrRestore(type, value, tb) PyErr_Restore(type, value, tb) #define __Pyx_ErrFetch(type, value, tb) PyErr_Fetch(type, value, tb) #endif /* RaiseException.proto */ static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, PyObject *cause); /* FetchCommonType.proto */ static PyTypeObject* __Pyx_FetchCommonType(PyTypeObject* type); /* CythonFunction.proto */ #define __Pyx_CyFunction_USED 1 #include #define __Pyx_CYFUNCTION_STATICMETHOD 0x01 #define __Pyx_CYFUNCTION_CLASSMETHOD 0x02 #define __Pyx_CYFUNCTION_CCLASS 0x04 #define __Pyx_CyFunction_GetClosure(f)\ (((__pyx_CyFunctionObject *) (f))->func_closure) #define __Pyx_CyFunction_GetClassObj(f)\ (((__pyx_CyFunctionObject *) (f))->func_classobj) #define __Pyx_CyFunction_Defaults(type, f)\ ((type *)(((__pyx_CyFunctionObject *) (f))->defaults)) #define __Pyx_CyFunction_SetDefaultsGetter(f, g)\ ((__pyx_CyFunctionObject *) (f))->defaults_getter = (g) typedef struct { PyCFunctionObject func; #if PY_VERSION_HEX < 0x030500A0 PyObject *func_weakreflist; #endif PyObject *func_dict; PyObject *func_name; PyObject *func_qualname; PyObject *func_doc; PyObject *func_globals; PyObject *func_code; PyObject *func_closure; PyObject *func_classobj; void *defaults; int defaults_pyobjects; int flags; PyObject *defaults_tuple; PyObject *defaults_kwdict; PyObject *(*defaults_getter)(PyObject *); PyObject *func_annotations; } __pyx_CyFunctionObject; static PyTypeObject *__pyx_CyFunctionType = 0; #define __Pyx_CyFunction_NewEx(ml, flags, qualname, self, module, globals, code)\ __Pyx_CyFunction_New(__pyx_CyFunctionType, ml, flags, qualname, self, module, globals, code) static PyObject *__Pyx_CyFunction_New(PyTypeObject *, PyMethodDef *ml, int flags, PyObject* qualname, PyObject *self, PyObject *module, PyObject *globals, PyObject* code); static CYTHON_INLINE void *__Pyx_CyFunction_InitDefaults(PyObject *m, size_t size, int pyobjects); static CYTHON_INLINE void __Pyx_CyFunction_SetDefaultsTuple(PyObject *m, PyObject *tuple); static CYTHON_INLINE void __Pyx_CyFunction_SetDefaultsKwDict(PyObject *m, PyObject *dict); static CYTHON_INLINE void __Pyx_CyFunction_SetAnnotationsDict(PyObject *m, PyObject *dict); static int __pyx_CyFunction_init(void); /* GetModuleGlobalName.proto */ static CYTHON_INLINE PyObject *__Pyx_GetModuleGlobalName(PyObject *name); /* PyObjectCallMethO.proto */ #if CYTHON_COMPILING_IN_CPYTHON static CYTHON_INLINE PyObject* __Pyx_PyObject_CallMethO(PyObject *func, PyObject *arg); #endif /* PyObjectCallOneArg.proto */ static CYTHON_INLINE PyObject* __Pyx_PyObject_CallOneArg(PyObject *func, PyObject *arg); /* SaveResetException.proto */ #if CYTHON_COMPILING_IN_CPYTHON #define __Pyx_ExceptionSave(type, value, tb) __Pyx__ExceptionSave(__pyx_tstate, type, value, tb) static CYTHON_INLINE void __Pyx__ExceptionSave(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb); #define __Pyx_ExceptionReset(type, value, tb) __Pyx__ExceptionReset(__pyx_tstate, type, value, tb) static CYTHON_INLINE void __Pyx__ExceptionReset(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb); #else #define __Pyx_ExceptionSave(type, value, tb) PyErr_GetExcInfo(type, value, tb) #define __Pyx_ExceptionReset(type, value, tb) PyErr_SetExcInfo(type, value, tb) #endif /* PyErrExceptionMatches.proto */ #if CYTHON_COMPILING_IN_CPYTHON #define __Pyx_PyErr_ExceptionMatches(err) __Pyx_PyErr_ExceptionMatchesInState(__pyx_tstate, err) static CYTHON_INLINE int __Pyx_PyErr_ExceptionMatchesInState(PyThreadState* tstate, PyObject* err); #else #define __Pyx_PyErr_ExceptionMatches(err) PyErr_ExceptionMatches(err) #endif /* GetException.proto */ #if CYTHON_COMPILING_IN_CPYTHON #define __Pyx_GetException(type, value, tb) __Pyx__GetException(__pyx_tstate, type, value, tb) static int __Pyx__GetException(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb); #else static int __Pyx_GetException(PyObject **type, PyObject **value, PyObject **tb); #endif /* SwapException.proto */ #if CYTHON_COMPILING_IN_CPYTHON #define __Pyx_ExceptionSwap(type, value, tb) __Pyx__ExceptionSwap(__pyx_tstate, type, value, tb) static CYTHON_INLINE void __Pyx__ExceptionSwap(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb); #else static CYTHON_INLINE void __Pyx_ExceptionSwap(PyObject **type, PyObject **value, PyObject **tb); #endif /* PyObjectCallNoArg.proto */ #if CYTHON_COMPILING_IN_CPYTHON static CYTHON_INLINE PyObject* __Pyx_PyObject_CallNoArg(PyObject *func); #else #define __Pyx_PyObject_CallNoArg(func) __Pyx_PyObject_Call(func, __pyx_empty_tuple, NULL) #endif /* ArgTypeTest.proto */ static CYTHON_INLINE int __Pyx_ArgTypeTest(PyObject *obj, PyTypeObject *type, int none_allowed, const char *name, int exact); /* RaiseArgTupleInvalid.proto */ static void __Pyx_RaiseArgtupleInvalid(const char* func_name, int exact, Py_ssize_t num_min, Py_ssize_t num_max, Py_ssize_t num_found); /* KeywordStringCheck.proto */ static CYTHON_INLINE int __Pyx_CheckKeywordStrings(PyObject *kwdict, const char* function_name, int kw_allowed); /* GetItemInt.proto */ #define __Pyx_GetItemInt(o, i, type, is_signed, to_py_func, is_list, wraparound, boundscheck)\ (__Pyx_fits_Py_ssize_t(i, type, is_signed) ?\ __Pyx_GetItemInt_Fast(o, (Py_ssize_t)i, is_list, wraparound, boundscheck) :\ (is_list ? (PyErr_SetString(PyExc_IndexError, "list index out of range"), (PyObject*)NULL) :\ __Pyx_GetItemInt_Generic(o, to_py_func(i)))) #define __Pyx_GetItemInt_List(o, i, type, is_signed, to_py_func, is_list, wraparound, boundscheck)\ (__Pyx_fits_Py_ssize_t(i, type, is_signed) ?\ __Pyx_GetItemInt_List_Fast(o, (Py_ssize_t)i, wraparound, boundscheck) :\ (PyErr_SetString(PyExc_IndexError, "list index out of range"), (PyObject*)NULL)) static CYTHON_INLINE PyObject *__Pyx_GetItemInt_List_Fast(PyObject *o, Py_ssize_t i, int wraparound, int boundscheck); #define __Pyx_GetItemInt_Tuple(o, i, type, is_signed, to_py_func, is_list, wraparound, boundscheck)\ (__Pyx_fits_Py_ssize_t(i, type, is_signed) ?\ __Pyx_GetItemInt_Tuple_Fast(o, (Py_ssize_t)i, wraparound, boundscheck) :\ (PyErr_SetString(PyExc_IndexError, "tuple index out of range"), (PyObject*)NULL)) static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Tuple_Fast(PyObject *o, Py_ssize_t i, int wraparound, int boundscheck); static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Generic(PyObject *o, PyObject* j); static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Fast(PyObject *o, Py_ssize_t i, int is_list, int wraparound, int boundscheck); /* SliceObject.proto */ static CYTHON_INLINE PyObject* __Pyx_PyObject_GetSlice( PyObject* obj, Py_ssize_t cstart, Py_ssize_t cstop, PyObject** py_start, PyObject** py_stop, PyObject** py_slice, int has_cstart, int has_cstop, int wraparound); /* PyIntBinop.proto */ #if CYTHON_COMPILING_IN_CPYTHON static PyObject* __Pyx_PyInt_EqObjC(PyObject *op1, PyObject *op2, long intval, int inplace); #else #define __Pyx_PyInt_EqObjC(op1, op2, intval, inplace)\ PyObject_RichCompare(op1, op2, Py_EQ) #endif /* RaiseDoubleKeywords.proto */ static void __Pyx_RaiseDoubleKeywordsError(const char* func_name, PyObject* kw_name); /* ParseKeywords.proto */ static int __Pyx_ParseOptionalKeywords(PyObject *kwds, PyObject **argnames[],\ PyObject *kwds2, PyObject *values[], Py_ssize_t num_pos_args,\ const char* function_name); /* PyIntBinop.proto */ #if CYTHON_COMPILING_IN_CPYTHON static PyObject* __Pyx_PyInt_SubtractCObj(PyObject *op1, PyObject *op2, long intval, int inplace); #else #define __Pyx_PyInt_SubtractCObj(op1, op2, intval, inplace)\ (inplace ? PyNumber_InPlaceSubtract(op1, op2) : PyNumber_Subtract(op1, op2)) #endif /* None.proto */ static CYTHON_INLINE double __Pyx_mod_double(double, double); /* PyFloatBinop.proto */ #if CYTHON_COMPILING_IN_CPYTHON static PyObject* __Pyx_PyFloat_RemainderObjC(PyObject *op1, PyObject *op2, double floatval, int inplace); #else #define __Pyx_PyFloat_RemainderObjC(op1, op2, floatval, inplace)\ (inplace ? PyNumber_InPlaceRemainder(op1, op2) : PyNumber_Remainder(op1, op2)) #endif /* PyFloatBinop.proto */ #if CYTHON_COMPILING_IN_CPYTHON static PyObject* __Pyx_PyFloat_TrueDivideObjC(PyObject *op1, PyObject *op2, double floatval, int inplace); #else #define __Pyx_PyFloat_TrueDivideObjC(op1, op2, floatval, inplace)\ (inplace ? PyNumber_InPlaceTrueDivide(op1, op2) : PyNumber_TrueDivide(op1, op2)) #endif /* None.proto */ static CYTHON_INLINE void __Pyx_RaiseClosureNameError(const char *varname); /* pow2.proto */ #define __Pyx_PyNumber_Power2(a, b) PyNumber_Power(a, b, Py_None) /* IncludeStringH.proto */ #include /* SetVTable.proto */ static int __Pyx_SetVtable(PyObject *dict, void *vtable); /* Import.proto */ static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list, int level); /* CodeObjectCache.proto */ typedef struct { PyCodeObject* code_object; int code_line; } __Pyx_CodeObjectCacheEntry; struct __Pyx_CodeObjectCache { int count; int max_count; __Pyx_CodeObjectCacheEntry* entries; }; static struct __Pyx_CodeObjectCache __pyx_code_cache = {0,0,NULL}; static int __pyx_bisect_code_objects(__Pyx_CodeObjectCacheEntry* entries, int count, int code_line); static PyCodeObject *__pyx_find_code_object(int code_line); static void __pyx_insert_code_object(int code_line, PyCodeObject* code_object); /* AddTraceback.proto */ static void __Pyx_AddTraceback(const char *funcname, int c_line, int py_line, const char *filename); /* CIntToPy.proto */ static CYTHON_INLINE PyObject* __Pyx_PyInt_From_uint8_t(uint8_t value); /* CIntToPy.proto */ static CYTHON_INLINE PyObject* __Pyx_PyInt_From_long(long value); /* CIntFromPy.proto */ static CYTHON_INLINE int __Pyx_PyInt_As_int(PyObject *); /* CIntFromPy.proto */ static CYTHON_INLINE uint8_t __Pyx_PyInt_As_uint8_t(PyObject *); /* CIntFromPy.proto */ static CYTHON_INLINE uint32_t __Pyx_PyInt_As_uint32_t(PyObject *); /* CIntFromPy.proto */ static CYTHON_INLINE long __Pyx_PyInt_As_long(PyObject *); /* CheckBinaryVersion.proto */ static int __Pyx_check_binary_version(void); /* FunctionExport.proto */ static int __Pyx_ExportFunction(const char *name, void (*f)(void), const char *sig); /* InitStrings.proto */ static int __Pyx_InitStrings(__Pyx_StringTabEntry *t); static PyObject *__pyx_f_11pygame_sdl2_5color_5Color_from_rgba(struct __pyx_obj_11pygame_sdl2_5color_Color *__pyx_v_self, Uint8 __pyx_v_r, Uint8 __pyx_v_g, Uint8 __pyx_v_b, Uint8 __pyx_v_a); /* proto*/ static PyObject *__pyx_f_11pygame_sdl2_5color_5Color_from_hex(struct __pyx_obj_11pygame_sdl2_5color_Color *__pyx_v_self, PyObject *__pyx_v_c); /* proto*/ static PyObject *__pyx_f_11pygame_sdl2_5color_5Color_from_name(struct __pyx_obj_11pygame_sdl2_5color_Color *__pyx_v_self, PyObject *__pyx_v_c); /* proto*/ /* Module declarations from 'libc.stdint' */ /* Module declarations from 'libc.string' */ /* Module declarations from 'libc.stdio' */ /* Module declarations from 'libc.stddef' */ /* Module declarations from 'sdl2' */ /* Module declarations from 'pygame_sdl2.color' */ static PyTypeObject *__pyx_ptype_11pygame_sdl2_5color_Color = 0; static PyTypeObject *__pyx_ptype_11pygame_sdl2_5color___pyx_scope_struct__correct_gamma = 0; static PyObject *__pyx_v_11pygame_sdl2_5color_colors = 0; #define __Pyx_MODULE_NAME "pygame_sdl2.color" int __pyx_module_is_main_pygame_sdl2__color = 0; /* Implementation of 'pygame_sdl2.color' */ static PyObject *__pyx_builtin_TypeError; static PyObject *__pyx_builtin_map; static PyObject *__pyx_builtin_ValueError; static PyObject *__pyx_builtin_KeyError; static PyObject *__pyx_builtin_hex; static PyObject *__pyx_builtin_oct; static PyObject *__pyx_builtin_IndexError; static PyObject *__pyx_builtin_round; static const char __pyx_k_L[] = ">L"; static const char __pyx_k_a[] = "a"; static const char __pyx_k_b[] = "b"; static const char __pyx_k_g[] = "g"; static const char __pyx_k_l[] = "l"; static const char __pyx_k_r[] = "r"; static const char __pyx_k_0x[] = "0x"; static const char __pyx_k__2[] = ""; static const char __pyx_k__3[] = "#"; static const char __pyx_k_08x[] = "%08x"; static const char __pyx_k_BBB[] = "BBB"; static const char __pyx_k_div[] = "div"; static const char __pyx_k_hex[] = "hex"; static const char __pyx_k_map[] = "map"; static const char __pyx_k_mod[] = "mod"; static const char __pyx_k_oct[] = "oct"; static const char __pyx_k_red[] = "red"; static const char __pyx_k_tan[] = "tan"; static const char __pyx_k_BBBB[] = "BBBB"; static const char __pyx_k_aqua[] = "aqua"; static const char __pyx_k_blue[] = "blue"; static const char __pyx_k_cyan[] = "cyan"; static const char __pyx_k_gold[] = "gold"; static const char __pyx_k_gray[] = "gray"; static const char __pyx_k_grey[] = "grey"; static const char __pyx_k_hsva[] = "hsva"; static const char __pyx_k_lime[] = "lime"; static const char __pyx_k_main[] = "__main__"; static const char __pyx_k_navy[] = "navy"; static const char __pyx_k_pack[] = "pack"; static const char __pyx_k_peru[] = "peru"; static const char __pyx_k_pink[] = "pink"; static const char __pyx_k_plum[] = "plum"; static const char __pyx_k_red1[] = "red1"; static const char __pyx_k_red2[] = "red2"; static const char __pyx_k_red3[] = "red3"; static const char __pyx_k_red4[] = "red4"; static const char __pyx_k_rgba[] = "rgba"; static const char __pyx_k_snow[] = "snow"; static const char __pyx_k_tan1[] = "tan1"; static const char __pyx_k_tan2[] = "tan2"; static const char __pyx_k_tan3[] = "tan3"; static const char __pyx_k_tan4[] = "tan4"; static const char __pyx_k_teal[] = "teal"; static const char __pyx_k_test[] = "__test__"; static const char __pyx_k_azure[] = "azure"; static const char __pyx_k_beige[] = "beige"; static const char __pyx_k_black[] = "black"; static const char __pyx_k_blue1[] = "blue1"; static const char __pyx_k_blue2[] = "blue2"; static const char __pyx_k_blue3[] = "blue3"; static const char __pyx_k_blue4[] = "blue4"; static const char __pyx_k_brown[] = "brown"; static const char __pyx_k_coral[] = "coral"; static const char __pyx_k_cyan1[] = "cyan1"; static const char __pyx_k_cyan2[] = "cyan2"; static const char __pyx_k_cyan3[] = "cyan3"; static const char __pyx_k_cyan4[] = "cyan4"; static const char __pyx_k_gold1[] = "gold1"; static const char __pyx_k_gold2[] = "gold2"; static const char __pyx_k_gold3[] = "gold3"; static const char __pyx_k_gold4[] = "gold4"; static const char __pyx_k_gray0[] = "gray0"; static const char __pyx_k_gray1[] = "gray1"; static const char __pyx_k_gray2[] = "gray2"; static const char __pyx_k_gray3[] = "gray3"; static const char __pyx_k_gray4[] = "gray4"; static const char __pyx_k_gray5[] = "gray5"; static const char __pyx_k_gray6[] = "gray6"; static const char __pyx_k_gray7[] = "gray7"; static const char __pyx_k_gray8[] = "gray8"; static const char __pyx_k_gray9[] = "gray9"; static const char __pyx_k_green[] = "green"; static const char __pyx_k_grey0[] = "grey0"; static const char __pyx_k_grey1[] = "grey1"; static const char __pyx_k_grey2[] = "grey2"; static const char __pyx_k_grey3[] = "grey3"; static const char __pyx_k_grey4[] = "grey4"; static const char __pyx_k_grey5[] = "grey5"; static const char __pyx_k_grey6[] = "grey6"; static const char __pyx_k_grey7[] = "grey7"; static const char __pyx_k_grey8[] = "grey8"; static const char __pyx_k_grey9[] = "grey9"; static const char __pyx_k_ivory[] = "ivory"; static const char __pyx_k_khaki[] = "khaki"; static const char __pyx_k_linen[] = "linen"; static const char __pyx_k_lower[] = "lower"; static const char __pyx_k_olive[] = "olive"; static const char __pyx_k_pink1[] = "pink1"; static const char __pyx_k_pink2[] = "pink2"; static const char __pyx_k_pink3[] = "pink3"; static const char __pyx_k_pink4[] = "pink4"; static const char __pyx_k_plum1[] = "plum1"; static const char __pyx_k_plum2[] = "plum2"; static const char __pyx_k_plum3[] = "plum3"; static const char __pyx_k_plum4[] = "plum4"; static const char __pyx_k_round[] = "round"; static const char __pyx_k_snow1[] = "snow1"; static const char __pyx_k_snow2[] = "snow2"; static const char __pyx_k_snow3[] = "snow3"; static const char __pyx_k_snow4[] = "snow4"; static const char __pyx_k_split[] = "split"; static const char __pyx_k_wheat[] = "wheat"; static const char __pyx_k_white[] = "white"; static const char __pyx_k_azure1[] = "azure1"; static const char __pyx_k_azure2[] = "azure2"; static const char __pyx_k_azure3[] = "azure3"; static const char __pyx_k_azure4[] = "azure4"; static const char __pyx_k_bisque[] = "bisque"; static const char __pyx_k_brown1[] = "brown1"; static const char __pyx_k_brown2[] = "brown2"; static const char __pyx_k_brown3[] = "brown3"; static const char __pyx_k_brown4[] = "brown4"; static const char __pyx_k_coral1[] = "coral1"; static const char __pyx_k_coral2[] = "coral2"; static const char __pyx_k_coral3[] = "coral3"; static const char __pyx_k_coral4[] = "coral4"; static const char __pyx_k_gray10[] = "gray10"; static const char __pyx_k_gray11[] = "gray11"; static const char __pyx_k_gray12[] = "gray12"; static const char __pyx_k_gray13[] = "gray13"; static const char __pyx_k_gray14[] = "gray14"; static const char __pyx_k_gray15[] = "gray15"; static const char __pyx_k_gray16[] = "gray16"; static const char __pyx_k_gray17[] = "gray17"; static const char __pyx_k_gray18[] = "gray18"; static const char __pyx_k_gray19[] = "gray19"; static const char __pyx_k_gray20[] = "gray20"; static const char __pyx_k_gray21[] = "gray21"; static const char __pyx_k_gray22[] = "gray22"; static const char __pyx_k_gray23[] = "gray23"; static const char __pyx_k_gray24[] = "gray24"; static const char __pyx_k_gray25[] = "gray25"; static const char __pyx_k_gray26[] = "gray26"; static const char __pyx_k_gray27[] = "gray27"; static const char __pyx_k_gray28[] = "gray28"; static const char __pyx_k_gray29[] = "gray29"; static const char __pyx_k_gray30[] = "gray30"; static const char __pyx_k_gray31[] = "gray31"; static const char __pyx_k_gray32[] = "gray32"; static const char __pyx_k_gray33[] = "gray33"; static const char __pyx_k_gray34[] = "gray34"; static const char __pyx_k_gray35[] = "gray35"; static const char __pyx_k_gray36[] = "gray36"; static const char __pyx_k_gray37[] = "gray37"; static const char __pyx_k_gray38[] = "gray38"; static const char __pyx_k_gray39[] = "gray39"; static const char __pyx_k_gray40[] = "gray40"; static const char __pyx_k_gray41[] = "gray41"; static const char __pyx_k_gray42[] = "gray42"; static const char __pyx_k_gray43[] = "gray43"; static const char __pyx_k_gray44[] = "gray44"; static const char __pyx_k_gray45[] = "gray45"; static const char __pyx_k_gray46[] = "gray46"; static const char __pyx_k_gray47[] = "gray47"; static const char __pyx_k_gray48[] = "gray48"; static const char __pyx_k_gray49[] = "gray49"; static const char __pyx_k_gray50[] = "gray50"; static const char __pyx_k_gray51[] = "gray51"; static const char __pyx_k_gray52[] = "gray52"; static const char __pyx_k_gray53[] = "gray53"; static const char __pyx_k_gray54[] = "gray54"; static const char __pyx_k_gray55[] = "gray55"; static const char __pyx_k_gray56[] = "gray56"; static const char __pyx_k_gray57[] = "gray57"; static const char __pyx_k_gray58[] = "gray58"; static const char __pyx_k_gray59[] = "gray59"; static const char __pyx_k_gray60[] = "gray60"; static const char __pyx_k_gray61[] = "gray61"; static const char __pyx_k_gray62[] = "gray62"; static const char __pyx_k_gray63[] = "gray63"; static const char __pyx_k_gray64[] = "gray64"; static const char __pyx_k_gray65[] = "gray65"; static const char __pyx_k_gray66[] = "gray66"; static const char __pyx_k_gray67[] = "gray67"; static const char __pyx_k_gray68[] = "gray68"; static const char __pyx_k_gray69[] = "gray69"; static const char __pyx_k_gray70[] = "gray70"; static const char __pyx_k_gray71[] = "gray71"; static const char __pyx_k_gray72[] = "gray72"; static const char __pyx_k_gray73[] = "gray73"; static const char __pyx_k_gray74[] = "gray74"; static const char __pyx_k_gray75[] = "gray75"; static const char __pyx_k_gray76[] = "gray76"; static const char __pyx_k_gray77[] = "gray77"; static const char __pyx_k_gray78[] = "gray78"; static const char __pyx_k_gray79[] = "gray79"; static const char __pyx_k_gray80[] = "gray80"; static const char __pyx_k_gray81[] = "gray81"; static const char __pyx_k_gray82[] = "gray82"; static const char __pyx_k_gray83[] = "gray83"; static const char __pyx_k_gray84[] = "gray84"; static const char __pyx_k_gray85[] = "gray85"; static const char __pyx_k_gray86[] = "gray86"; static const char __pyx_k_gray87[] = "gray87"; static const char __pyx_k_gray88[] = "gray88"; static const char __pyx_k_gray89[] = "gray89"; static const char __pyx_k_gray90[] = "gray90"; static const char __pyx_k_gray91[] = "gray91"; static const char __pyx_k_gray92[] = "gray92"; static const char __pyx_k_gray93[] = "gray93"; static const char __pyx_k_gray94[] = "gray94"; static const char __pyx_k_gray95[] = "gray95"; static const char __pyx_k_gray96[] = "gray96"; static const char __pyx_k_gray97[] = "gray97"; static const char __pyx_k_gray98[] = "gray98"; static const char __pyx_k_gray99[] = "gray99"; static const char __pyx_k_green1[] = "green1"; static const char __pyx_k_green2[] = "green2"; static const char __pyx_k_green3[] = "green3"; static const char __pyx_k_green4[] = "green4"; static const char __pyx_k_grey10[] = "grey10"; static const char __pyx_k_grey11[] = "grey11"; static const char __pyx_k_grey12[] = "grey12"; static const char __pyx_k_grey13[] = "grey13"; static const char __pyx_k_grey14[] = "grey14"; static const char __pyx_k_grey15[] = "grey15"; static const char __pyx_k_grey16[] = "grey16"; static const char __pyx_k_grey17[] = "grey17"; static const char __pyx_k_grey18[] = "grey18"; static const char __pyx_k_grey19[] = "grey19"; static const char __pyx_k_grey20[] = "grey20"; static const char __pyx_k_grey21[] = "grey21"; static const char __pyx_k_grey22[] = "grey22"; static const char __pyx_k_grey23[] = "grey23"; static const char __pyx_k_grey24[] = "grey24"; static const char __pyx_k_grey25[] = "grey25"; static const char __pyx_k_grey26[] = "grey26"; static const char __pyx_k_grey27[] = "grey27"; static const char __pyx_k_grey28[] = "grey28"; static const char __pyx_k_grey29[] = "grey29"; static const char __pyx_k_grey30[] = "grey30"; static const char __pyx_k_grey31[] = "grey31"; static const char __pyx_k_grey32[] = "grey32"; static const char __pyx_k_grey33[] = "grey33"; static const char __pyx_k_grey34[] = "grey34"; static const char __pyx_k_grey35[] = "grey35"; static const char __pyx_k_grey36[] = "grey36"; static const char __pyx_k_grey37[] = "grey37"; static const char __pyx_k_grey38[] = "grey38"; static const char __pyx_k_grey39[] = "grey39"; static const char __pyx_k_grey40[] = "grey40"; static const char __pyx_k_grey41[] = "grey41"; static const char __pyx_k_grey42[] = "grey42"; static const char __pyx_k_grey43[] = "grey43"; static const char __pyx_k_grey44[] = "grey44"; static const char __pyx_k_grey45[] = "grey45"; static const char __pyx_k_grey46[] = "grey46"; static const char __pyx_k_grey47[] = "grey47"; static const char __pyx_k_grey48[] = "grey48"; static const char __pyx_k_grey49[] = "grey49"; static const char __pyx_k_grey50[] = "grey50"; static const char __pyx_k_grey51[] = "grey51"; static const char __pyx_k_grey52[] = "grey52"; static const char __pyx_k_grey53[] = "grey53"; static const char __pyx_k_grey54[] = "grey54"; static const char __pyx_k_grey55[] = "grey55"; static const char __pyx_k_grey56[] = "grey56"; static const char __pyx_k_grey57[] = "grey57"; static const char __pyx_k_grey58[] = "grey58"; static const char __pyx_k_grey59[] = "grey59"; static const char __pyx_k_grey60[] = "grey60"; static const char __pyx_k_grey61[] = "grey61"; static const char __pyx_k_grey62[] = "grey62"; static const char __pyx_k_grey63[] = "grey63"; static const char __pyx_k_grey64[] = "grey64"; static const char __pyx_k_grey65[] = "grey65"; static const char __pyx_k_grey66[] = "grey66"; static const char __pyx_k_grey67[] = "grey67"; static const char __pyx_k_grey68[] = "grey68"; static const char __pyx_k_grey69[] = "grey69"; static const char __pyx_k_grey70[] = "grey70"; static const char __pyx_k_grey71[] = "grey71"; static const char __pyx_k_grey72[] = "grey72"; static const char __pyx_k_grey73[] = "grey73"; static const char __pyx_k_grey74[] = "grey74"; static const char __pyx_k_grey75[] = "grey75"; static const char __pyx_k_grey76[] = "grey76"; static const char __pyx_k_grey77[] = "grey77"; static const char __pyx_k_grey78[] = "grey78"; static const char __pyx_k_grey79[] = "grey79"; static const char __pyx_k_grey80[] = "grey80"; static const char __pyx_k_grey81[] = "grey81"; static const char __pyx_k_grey82[] = "grey82"; static const char __pyx_k_grey83[] = "grey83"; static const char __pyx_k_grey84[] = "grey84"; static const char __pyx_k_grey85[] = "grey85"; static const char __pyx_k_grey86[] = "grey86"; static const char __pyx_k_grey87[] = "grey87"; static const char __pyx_k_grey88[] = "grey88"; static const char __pyx_k_grey89[] = "grey89"; static const char __pyx_k_grey90[] = "grey90"; static const char __pyx_k_grey91[] = "grey91"; static const char __pyx_k_grey92[] = "grey92"; static const char __pyx_k_grey93[] = "grey93"; static const char __pyx_k_grey94[] = "grey94"; static const char __pyx_k_grey95[] = "grey95"; static const char __pyx_k_grey96[] = "grey96"; static const char __pyx_k_grey97[] = "grey97"; static const char __pyx_k_grey98[] = "grey98"; static const char __pyx_k_grey99[] = "grey99"; static const char __pyx_k_import[] = "__import__"; static const char __pyx_k_indigo[] = "indigo"; static const char __pyx_k_ivory1[] = "ivory1"; static const char __pyx_k_ivory2[] = "ivory2"; static const char __pyx_k_ivory3[] = "ivory3"; static const char __pyx_k_ivory4[] = "ivory4"; static const char __pyx_k_khaki1[] = "khaki1"; static const char __pyx_k_khaki2[] = "khaki2"; static const char __pyx_k_khaki3[] = "khaki3"; static const char __pyx_k_khaki4[] = "khaki4"; static const char __pyx_k_maroon[] = "maroon"; static const char __pyx_k_orange[] = "orange"; static const char __pyx_k_orchid[] = "orchid"; static const char __pyx_k_purple[] = "purple"; static const char __pyx_k_salmon[] = "salmon"; static const char __pyx_k_sienna[] = "sienna"; static const char __pyx_k_silver[] = "silver"; static const char __pyx_k_struct[] = "struct"; static const char __pyx_k_tomato[] = "tomato"; static const char __pyx_k_unpack[] = "unpack"; static const char __pyx_k_violet[] = "violet"; static const char __pyx_k_wheat1[] = "wheat1"; static const char __pyx_k_wheat2[] = "wheat2"; static const char __pyx_k_wheat3[] = "wheat3"; static const char __pyx_k_wheat4[] = "wheat4"; static const char __pyx_k_yellow[] = "yellow"; static const char __pyx_k_bisque1[] = "bisque1"; static const char __pyx_k_bisque2[] = "bisque2"; static const char __pyx_k_bisque3[] = "bisque3"; static const char __pyx_k_bisque4[] = "bisque4"; static const char __pyx_k_crimson[] = "crimson"; static const char __pyx_k_darkred[] = "darkred"; static const char __pyx_k_dimgray[] = "dimgray"; static const char __pyx_k_dimgrey[] = "dimgrey"; static const char __pyx_k_fuchsia[] = "fuchsia"; static const char __pyx_k_gray100[] = "gray100"; static const char __pyx_k_grey100[] = "grey100"; static const char __pyx_k_hotpink[] = "hotpink"; static const char __pyx_k_magenta[] = "magenta"; static const char __pyx_k_maroon1[] = "maroon1"; static const char __pyx_k_maroon2[] = "maroon2"; static const char __pyx_k_maroon3[] = "maroon3"; static const char __pyx_k_maroon4[] = "maroon4"; static const char __pyx_k_oldlace[] = "oldlace"; static const char __pyx_k_orange1[] = "orange1"; static const char __pyx_k_orange2[] = "orange2"; static const char __pyx_k_orange3[] = "orange3"; static const char __pyx_k_orange4[] = "orange4"; static const char __pyx_k_orchid1[] = "orchid1"; static const char __pyx_k_orchid2[] = "orchid2"; static const char __pyx_k_orchid3[] = "orchid3"; static const char __pyx_k_orchid4[] = "orchid4"; static const char __pyx_k_purple1[] = "purple1"; static const char __pyx_k_purple2[] = "purple2"; static const char __pyx_k_purple3[] = "purple3"; static const char __pyx_k_purple4[] = "purple4"; static const char __pyx_k_salmon1[] = "salmon1"; static const char __pyx_k_salmon2[] = "salmon2"; static const char __pyx_k_salmon3[] = "salmon3"; static const char __pyx_k_salmon4[] = "salmon4"; static const char __pyx_k_sienna1[] = "sienna1"; static const char __pyx_k_sienna2[] = "sienna2"; static const char __pyx_k_sienna3[] = "sienna3"; static const char __pyx_k_sienna4[] = "sienna4"; static const char __pyx_k_skyblue[] = "skyblue"; static const char __pyx_k_thistle[] = "thistle"; static const char __pyx_k_tomato1[] = "tomato1"; static const char __pyx_k_tomato2[] = "tomato2"; static const char __pyx_k_tomato3[] = "tomato3"; static const char __pyx_k_tomato4[] = "tomato4"; static const char __pyx_k_webgray[] = "webgray"; static const char __pyx_k_webgrey[] = "webgrey"; static const char __pyx_k_x11gray[] = "x11gray"; static const char __pyx_k_x11grey[] = "x11grey"; static const char __pyx_k_yellow1[] = "yellow1"; static const char __pyx_k_yellow2[] = "yellow2"; static const char __pyx_k_yellow3[] = "yellow3"; static const char __pyx_k_yellow4[] = "yellow4"; static const char __pyx_k_KeyError[] = "KeyError"; static const char __pyx_k_binascii[] = "binascii"; static const char __pyx_k_cornsilk[] = "cornsilk"; static const char __pyx_k_darkblue[] = "darkblue"; static const char __pyx_k_darkcyan[] = "darkcyan"; static const char __pyx_k_darkgray[] = "darkgray"; static const char __pyx_k_darkgrey[] = "darkgrey"; static const char __pyx_k_deeppink[] = "deeppink"; static const char __pyx_k_honeydew[] = "honeydew"; static const char __pyx_k_hotpink1[] = "hotpink1"; static const char __pyx_k_hotpink2[] = "hotpink2"; static const char __pyx_k_hotpink3[] = "hotpink3"; static const char __pyx_k_hotpink4[] = "hotpink4"; static const char __pyx_k_lavender[] = "lavender"; static const char __pyx_k_magenta1[] = "magenta1"; static const char __pyx_k_magenta2[] = "magenta2"; static const char __pyx_k_magenta3[] = "magenta3"; static const char __pyx_k_magenta4[] = "magenta4"; static const char __pyx_k_moccasin[] = "moccasin"; static const char __pyx_k_navyblue[] = "navyblue"; static const char __pyx_k_seagreen[] = "seagreen"; static const char __pyx_k_seashell[] = "seashell"; static const char __pyx_k_skyblue1[] = "skyblue1"; static const char __pyx_k_skyblue2[] = "skyblue2"; static const char __pyx_k_skyblue3[] = "skyblue3"; static const char __pyx_k_skyblue4[] = "skyblue4"; static const char __pyx_k_thistle1[] = "thistle1"; static const char __pyx_k_thistle2[] = "thistle2"; static const char __pyx_k_thistle3[] = "thistle3"; static const char __pyx_k_thistle4[] = "thistle4"; static const char __pyx_k_webgreen[] = "webgreen"; static const char __pyx_k_x11green[] = "x11green"; static const char __pyx_k_TypeError[] = "TypeError"; static const char __pyx_k_aliceblue[] = "aliceblue"; static const char __pyx_k_burlywood[] = "burlywood"; static const char __pyx_k_cadetblue[] = "cadetblue"; static const char __pyx_k_chocolate[] = "chocolate"; static const char __pyx_k_cornsilk1[] = "cornsilk1"; static const char __pyx_k_cornsilk2[] = "cornsilk2"; static const char __pyx_k_cornsilk3[] = "cornsilk3"; static const char __pyx_k_cornsilk4[] = "cornsilk4"; static const char __pyx_k_darkgreen[] = "darkgreen"; static const char __pyx_k_darkkhaki[] = "darkkhaki"; static const char __pyx_k_deeppink1[] = "deeppink1"; static const char __pyx_k_deeppink2[] = "deeppink2"; static const char __pyx_k_deeppink3[] = "deeppink3"; static const char __pyx_k_deeppink4[] = "deeppink4"; static const char __pyx_k_firebrick[] = "firebrick"; static const char __pyx_k_gainsboro[] = "gainsboro"; static const char __pyx_k_goldenrod[] = "goldenrod"; static const char __pyx_k_honeydew1[] = "honeydew1"; static const char __pyx_k_honeydew2[] = "honeydew2"; static const char __pyx_k_honeydew3[] = "honeydew3"; static const char __pyx_k_honeydew4[] = "honeydew4"; static const char __pyx_k_indianred[] = "indianred"; static const char __pyx_k_lawngreen[] = "lawngreen"; static const char __pyx_k_lightblue[] = "lightblue"; static const char __pyx_k_lightcyan[] = "lightcyan"; static const char __pyx_k_lightgray[] = "lightgray"; static const char __pyx_k_lightgrey[] = "lightgrey"; static const char __pyx_k_lightpink[] = "lightpink"; static const char __pyx_k_limegreen[] = "limegreen"; static const char __pyx_k_mintcream[] = "mintcream"; static const char __pyx_k_mistyrose[] = "mistyrose"; static const char __pyx_k_olivedrab[] = "olivedrab"; static const char __pyx_k_orangered[] = "orangered"; static const char __pyx_k_palegreen[] = "palegreen"; static const char __pyx_k_peachpuff[] = "peachpuff"; static const char __pyx_k_rosybrown[] = "rosybrown"; static const char __pyx_k_royalblue[] = "royalblue"; static const char __pyx_k_seagreen1[] = "seagreen1"; static const char __pyx_k_seagreen2[] = "seagreen2"; static const char __pyx_k_seagreen3[] = "seagreen3"; static const char __pyx_k_seagreen4[] = "seagreen4"; static const char __pyx_k_seashell1[] = "seashell1"; static const char __pyx_k_seashell2[] = "seashell2"; static const char __pyx_k_seashell3[] = "seashell3"; static const char __pyx_k_seashell4[] = "seashell4"; static const char __pyx_k_slateblue[] = "slateblue"; static const char __pyx_k_slategray[] = "slategray"; static const char __pyx_k_slategrey[] = "slategrey"; static const char __pyx_k_steelblue[] = "steelblue"; static const char __pyx_k_turquoise[] = "turquoise"; static const char __pyx_k_unhexlify[] = "unhexlify"; static const char __pyx_k_violetred[] = "violetred"; static const char __pyx_k_webmaroon[] = "webmaroon"; static const char __pyx_k_webpurple[] = "webpurple"; static const char __pyx_k_x11maroon[] = "x11maroon"; static const char __pyx_k_x11purple[] = "x11purple"; static const char __pyx_k_IndexError[] = "IndexError"; static const char __pyx_k_ValueError[] = "ValueError"; static const char __pyx_k_aquamarine[] = "aquamarine"; static const char __pyx_k_blueviolet[] = "blueviolet"; static const char __pyx_k_burlywood1[] = "burlywood1"; static const char __pyx_k_burlywood2[] = "burlywood2"; static const char __pyx_k_burlywood3[] = "burlywood3"; static const char __pyx_k_burlywood4[] = "burlywood4"; static const char __pyx_k_cadetblue1[] = "cadetblue1"; static const char __pyx_k_cadetblue2[] = "cadetblue2"; static const char __pyx_k_cadetblue3[] = "cadetblue3"; static const char __pyx_k_cadetblue4[] = "cadetblue4"; static const char __pyx_k_chartreuse[] = "chartreuse"; static const char __pyx_k_chocolate1[] = "chocolate1"; static const char __pyx_k_chocolate2[] = "chocolate2"; static const char __pyx_k_chocolate3[] = "chocolate3"; static const char __pyx_k_chocolate4[] = "chocolate4"; static const char __pyx_k_darkorange[] = "darkorange"; static const char __pyx_k_darkorchid[] = "darkorchid"; static const char __pyx_k_darksalmon[] = "darksalmon"; static const char __pyx_k_darkviolet[] = "darkviolet"; static const char __pyx_k_dodgerblue[] = "dodgerblue"; static const char __pyx_k_firebrick1[] = "firebrick1"; static const char __pyx_k_firebrick2[] = "firebrick2"; static const char __pyx_k_firebrick3[] = "firebrick3"; static const char __pyx_k_firebrick4[] = "firebrick4"; static const char __pyx_k_ghostwhite[] = "ghostwhite"; static const char __pyx_k_goldenrod1[] = "goldenrod1"; static const char __pyx_k_goldenrod2[] = "goldenrod2"; static const char __pyx_k_goldenrod3[] = "goldenrod3"; static const char __pyx_k_goldenrod4[] = "goldenrod4"; static const char __pyx_k_indianred1[] = "indianred1"; static const char __pyx_k_indianred2[] = "indianred2"; static const char __pyx_k_indianred3[] = "indianred3"; static const char __pyx_k_indianred4[] = "indianred4"; static const char __pyx_k_lightblue1[] = "lightblue1"; static const char __pyx_k_lightblue2[] = "lightblue2"; static const char __pyx_k_lightblue3[] = "lightblue3"; static const char __pyx_k_lightblue4[] = "lightblue4"; static const char __pyx_k_lightcoral[] = "lightcoral"; static const char __pyx_k_lightcyan1[] = "lightcyan1"; static const char __pyx_k_lightcyan2[] = "lightcyan2"; static const char __pyx_k_lightcyan3[] = "lightcyan3"; static const char __pyx_k_lightcyan4[] = "lightcyan4"; static const char __pyx_k_lightgreen[] = "lightgreen"; static const char __pyx_k_lightpink1[] = "lightpink1"; static const char __pyx_k_lightpink2[] = "lightpink2"; static const char __pyx_k_lightpink3[] = "lightpink3"; static const char __pyx_k_lightpink4[] = "lightpink4"; static const char __pyx_k_mediumblue[] = "mediumblue"; static const char __pyx_k_mistyrose1[] = "mistyrose1"; static const char __pyx_k_mistyrose2[] = "mistyrose2"; static const char __pyx_k_mistyrose3[] = "mistyrose3"; static const char __pyx_k_mistyrose4[] = "mistyrose4"; static const char __pyx_k_olivedrab1[] = "olivedrab1"; static const char __pyx_k_olivedrab2[] = "olivedrab2"; static const char __pyx_k_olivedrab3[] = "olivedrab3"; static const char __pyx_k_olivedrab4[] = "olivedrab4"; static const char __pyx_k_orangered1[] = "orangered1"; static const char __pyx_k_orangered2[] = "orangered2"; static const char __pyx_k_orangered3[] = "orangered3"; static const char __pyx_k_orangered4[] = "orangered4"; static const char __pyx_k_palegreen1[] = "palegreen1"; static const char __pyx_k_palegreen2[] = "palegreen2"; static const char __pyx_k_palegreen3[] = "palegreen3"; static const char __pyx_k_palegreen4[] = "palegreen4"; static const char __pyx_k_papayawhip[] = "papayawhip"; static const char __pyx_k_peachpuff1[] = "peachpuff1"; static const char __pyx_k_peachpuff2[] = "peachpuff2"; static const char __pyx_k_peachpuff3[] = "peachpuff3"; static const char __pyx_k_peachpuff4[] = "peachpuff4"; static const char __pyx_k_powderblue[] = "powderblue"; static const char __pyx_k_pyx_vtable[] = "__pyx_vtable__"; static const char __pyx_k_rosybrown1[] = "rosybrown1"; static const char __pyx_k_rosybrown2[] = "rosybrown2"; static const char __pyx_k_rosybrown3[] = "rosybrown3"; static const char __pyx_k_rosybrown4[] = "rosybrown4"; static const char __pyx_k_royalblue1[] = "royalblue1"; static const char __pyx_k_royalblue2[] = "royalblue2"; static const char __pyx_k_royalblue3[] = "royalblue3"; static const char __pyx_k_royalblue4[] = "royalblue4"; static const char __pyx_k_sandybrown[] = "sandybrown"; static const char __pyx_k_slateblue1[] = "slateblue1"; static const char __pyx_k_slateblue2[] = "slateblue2"; static const char __pyx_k_slateblue3[] = "slateblue3"; static const char __pyx_k_slateblue4[] = "slateblue4"; static const char __pyx_k_slategray1[] = "slategray1"; static const char __pyx_k_slategray2[] = "slategray2"; static const char __pyx_k_slategray3[] = "slategray3"; static const char __pyx_k_slategray4[] = "slategray4"; static const char __pyx_k_startswith[] = "startswith"; static const char __pyx_k_steelblue1[] = "steelblue1"; static const char __pyx_k_steelblue2[] = "steelblue2"; static const char __pyx_k_steelblue3[] = "steelblue3"; static const char __pyx_k_steelblue4[] = "steelblue4"; static const char __pyx_k_turquoise1[] = "turquoise1"; static const char __pyx_k_turquoise2[] = "turquoise2"; static const char __pyx_k_turquoise3[] = "turquoise3"; static const char __pyx_k_turquoise4[] = "turquoise4"; static const char __pyx_k_violetred1[] = "violetred1"; static const char __pyx_k_violetred2[] = "violetred2"; static const char __pyx_k_violetred3[] = "violetred3"; static const char __pyx_k_violetred4[] = "violetred4"; static const char __pyx_k_whitesmoke[] = "whitesmoke"; static const char __pyx_k_aquamarine1[] = "aquamarine1"; static const char __pyx_k_aquamarine2[] = "aquamarine2"; static const char __pyx_k_aquamarine3[] = "aquamarine3"; static const char __pyx_k_aquamarine4[] = "aquamarine4"; static const char __pyx_k_chartreuse1[] = "chartreuse1"; static const char __pyx_k_chartreuse2[] = "chartreuse2"; static const char __pyx_k_chartreuse3[] = "chartreuse3"; static const char __pyx_k_chartreuse4[] = "chartreuse4"; static const char __pyx_k_darkmagenta[] = "darkmagenta"; static const char __pyx_k_darkorange1[] = "darkorange1"; static const char __pyx_k_darkorange2[] = "darkorange2"; static const char __pyx_k_darkorange3[] = "darkorange3"; static const char __pyx_k_darkorange4[] = "darkorange4"; static const char __pyx_k_darkorchid1[] = "darkorchid1"; static const char __pyx_k_darkorchid2[] = "darkorchid2"; static const char __pyx_k_darkorchid3[] = "darkorchid3"; static const char __pyx_k_darkorchid4[] = "darkorchid4"; static const char __pyx_k_deepskyblue[] = "deepskyblue"; static const char __pyx_k_dodgerblue1[] = "dodgerblue1"; static const char __pyx_k_dodgerblue2[] = "dodgerblue2"; static const char __pyx_k_dodgerblue3[] = "dodgerblue3"; static const char __pyx_k_dodgerblue4[] = "dodgerblue4"; static const char __pyx_k_floralwhite[] = "floralwhite"; static const char __pyx_k_forestgreen[] = "forestgreen"; static const char __pyx_k_greenyellow[] = "greenyellow"; static const char __pyx_k_lightsalmon[] = "lightsalmon"; static const char __pyx_k_lightyellow[] = "lightyellow"; static const char __pyx_k_navajowhite[] = "navajowhite"; static const char __pyx_k_saddlebrown[] = "saddlebrown"; static const char __pyx_k_springgreen[] = "springgreen"; static const char __pyx_k_yellowgreen[] = "yellowgreen"; static const char __pyx_k_antiquewhite[] = "antiquewhite"; static const char __pyx_k_darkseagreen[] = "darkseagreen"; static const char __pyx_k_deepskyblue1[] = "deepskyblue1"; static const char __pyx_k_deepskyblue2[] = "deepskyblue2"; static const char __pyx_k_deepskyblue3[] = "deepskyblue3"; static const char __pyx_k_deepskyblue4[] = "deepskyblue4"; static const char __pyx_k_lemonchiffon[] = "lemonchiffon"; static const char __pyx_k_lightsalmon1[] = "lightsalmon1"; static const char __pyx_k_lightsalmon2[] = "lightsalmon2"; static const char __pyx_k_lightsalmon3[] = "lightsalmon3"; static const char __pyx_k_lightsalmon4[] = "lightsalmon4"; static const char __pyx_k_lightskyblue[] = "lightskyblue"; static const char __pyx_k_lightyellow1[] = "lightyellow1"; static const char __pyx_k_lightyellow2[] = "lightyellow2"; static const char __pyx_k_lightyellow3[] = "lightyellow3"; static const char __pyx_k_lightyellow4[] = "lightyellow4"; static const char __pyx_k_mediumorchid[] = "mediumorchid"; static const char __pyx_k_mediumpurple[] = "mediumpurple"; static const char __pyx_k_midnightblue[] = "midnightblue"; static const char __pyx_k_navajowhite1[] = "navajowhite1"; static const char __pyx_k_navajowhite2[] = "navajowhite2"; static const char __pyx_k_navajowhite3[] = "navajowhite3"; static const char __pyx_k_navajowhite4[] = "navajowhite4"; static const char __pyx_k_springgreen1[] = "springgreen1"; static const char __pyx_k_springgreen2[] = "springgreen2"; static const char __pyx_k_springgreen3[] = "springgreen3"; static const char __pyx_k_springgreen4[] = "springgreen4"; static const char __pyx_k_antiquewhite1[] = "antiquewhite1"; static const char __pyx_k_antiquewhite2[] = "antiquewhite2"; static const char __pyx_k_antiquewhite3[] = "antiquewhite3"; static const char __pyx_k_antiquewhite4[] = "antiquewhite4"; static const char __pyx_k_darkgoldenrod[] = "darkgoldenrod"; static const char __pyx_k_darkseagreen1[] = "darkseagreen1"; static const char __pyx_k_darkseagreen2[] = "darkseagreen2"; static const char __pyx_k_darkseagreen3[] = "darkseagreen3"; static const char __pyx_k_darkseagreen4[] = "darkseagreen4"; static const char __pyx_k_darkslateblue[] = "darkslateblue"; static const char __pyx_k_darkslategray[] = "darkslategray"; static const char __pyx_k_darkslategrey[] = "darkslategrey"; static const char __pyx_k_darkturquoise[] = "darkturquoise"; static const char __pyx_k_lavenderblush[] = "lavenderblush"; static const char __pyx_k_lemonchiffon1[] = "lemonchiffon1"; static const char __pyx_k_lemonchiffon2[] = "lemonchiffon2"; static const char __pyx_k_lemonchiffon3[] = "lemonchiffon3"; static const char __pyx_k_lemonchiffon4[] = "lemonchiffon4"; static const char __pyx_k_lightseagreen[] = "lightseagreen"; static const char __pyx_k_lightskyblue1[] = "lightskyblue1"; static const char __pyx_k_lightskyblue2[] = "lightskyblue2"; static const char __pyx_k_lightskyblue3[] = "lightskyblue3"; static const char __pyx_k_lightskyblue4[] = "lightskyblue4"; static const char __pyx_k_mediumorchid1[] = "mediumorchid1"; static const char __pyx_k_mediumorchid2[] = "mediumorchid2"; static const char __pyx_k_mediumorchid3[] = "mediumorchid3"; static const char __pyx_k_mediumorchid4[] = "mediumorchid4"; static const char __pyx_k_mediumpurple1[] = "mediumpurple1"; static const char __pyx_k_mediumpurple2[] = "mediumpurple2"; static const char __pyx_k_mediumpurple3[] = "mediumpurple3"; static const char __pyx_k_mediumpurple4[] = "mediumpurple4"; static const char __pyx_k_palegoldenrod[] = "palegoldenrod"; static const char __pyx_k_paleturquoise[] = "paleturquoise"; static const char __pyx_k_palevioletred[] = "palevioletred"; static const char __pyx_k_rebeccapurple[] = "rebeccapurple"; static const char __pyx_k_blanchedalmond[] = "blanchedalmond"; static const char __pyx_k_cornflowerblue[] = "cornflowerblue"; static const char __pyx_k_darkgoldenrod1[] = "darkgoldenrod1"; static const char __pyx_k_darkgoldenrod2[] = "darkgoldenrod2"; static const char __pyx_k_darkgoldenrod3[] = "darkgoldenrod3"; static const char __pyx_k_darkgoldenrod4[] = "darkgoldenrod4"; static const char __pyx_k_darkolivegreen[] = "darkolivegreen"; static const char __pyx_k_darkslategray1[] = "darkslategray1"; static const char __pyx_k_darkslategray2[] = "darkslategray2"; static const char __pyx_k_darkslategray3[] = "darkslategray3"; static const char __pyx_k_darkslategray4[] = "darkslategray4"; static const char __pyx_k_lavenderblush1[] = "lavenderblush1"; static const char __pyx_k_lavenderblush2[] = "lavenderblush2"; static const char __pyx_k_lavenderblush3[] = "lavenderblush3"; static const char __pyx_k_lavenderblush4[] = "lavenderblush4"; static const char __pyx_k_lightgoldenrod[] = "lightgoldenrod"; static const char __pyx_k_lightslateblue[] = "lightslateblue"; static const char __pyx_k_lightslategray[] = "lightslategray"; static const char __pyx_k_lightslategrey[] = "lightslategrey"; static const char __pyx_k_lightsteelblue[] = "lightsteelblue"; static const char __pyx_k_mediumseagreen[] = "mediumseagreen"; static const char __pyx_k_paleturquoise1[] = "paleturquoise1"; static const char __pyx_k_paleturquoise2[] = "paleturquoise2"; static const char __pyx_k_paleturquoise3[] = "paleturquoise3"; static const char __pyx_k_paleturquoise4[] = "paleturquoise4"; static const char __pyx_k_palevioletred1[] = "palevioletred1"; static const char __pyx_k_palevioletred2[] = "palevioletred2"; static const char __pyx_k_palevioletred3[] = "palevioletred3"; static const char __pyx_k_palevioletred4[] = "palevioletred4"; static const char __pyx_k_darkolivegreen1[] = "darkolivegreen1"; static const char __pyx_k_darkolivegreen2[] = "darkolivegreen2"; static const char __pyx_k_darkolivegreen3[] = "darkolivegreen3"; static const char __pyx_k_darkolivegreen4[] = "darkolivegreen4"; static const char __pyx_k_lightgoldenrod1[] = "lightgoldenrod1"; static const char __pyx_k_lightgoldenrod2[] = "lightgoldenrod2"; static const char __pyx_k_lightgoldenrod3[] = "lightgoldenrod3"; static const char __pyx_k_lightgoldenrod4[] = "lightgoldenrod4"; static const char __pyx_k_lightsteelblue1[] = "lightsteelblue1"; static const char __pyx_k_lightsteelblue2[] = "lightsteelblue2"; static const char __pyx_k_lightsteelblue3[] = "lightsteelblue3"; static const char __pyx_k_lightsteelblue4[] = "lightsteelblue4"; static const char __pyx_k_mediumslateblue[] = "mediumslateblue"; static const char __pyx_k_mediumturquoise[] = "mediumturquoise"; static const char __pyx_k_mediumvioletred[] = "mediumvioletred"; static const char __pyx_k_Expected_a_color[] = "Expected a color."; static const char __pyx_k_mediumaquamarine[] = "mediumaquamarine"; static const char __pyx_k_mod___locals_mod[] = "__mod__..mod"; static const char __pyx_k_mediumspringgreen[] = "mediumspringgreen"; static const char __pyx_k_pygame_sdl2_color[] = "pygame_sdl2.color"; static const char __pyx_k_lightgoldenrodyellow[] = "lightgoldenrodyellow"; static const char __pyx_k_floordiv___locals_div[] = "__floordiv__..div"; static const char __pyx_k_correct_gamma_locals_lambda[] = "correct_gamma.."; static const char __pyx_k_Color_from_hex_locals_lambda[] = "Color.from_hex.."; static const char __pyx_k_home_tom_ab_pygame_sdl2_src_pyg[] = "/home/tom/ab/pygame_sdl2/src/pygame_sdl2/color.pyx"; static PyObject *__pyx_kp_u_08x; static PyObject *__pyx_kp_u_0x; static PyObject *__pyx_n_u_BBB; static PyObject *__pyx_n_u_BBBB; static PyObject *__pyx_n_s_Color_from_hex_locals_lambda; static PyObject *__pyx_kp_u_Expected_a_color; static PyObject *__pyx_n_s_IndexError; static PyObject *__pyx_n_s_KeyError; static PyObject *__pyx_kp_u_L; static PyObject *__pyx_n_s_TypeError; static PyObject *__pyx_n_s_ValueError; static PyObject *__pyx_kp_u__2; static PyObject *__pyx_kp_u__3; static PyObject *__pyx_n_s_a; static PyObject *__pyx_n_u_aliceblue; static PyObject *__pyx_n_u_antiquewhite; static PyObject *__pyx_n_u_antiquewhite1; static PyObject *__pyx_n_u_antiquewhite2; static PyObject *__pyx_n_u_antiquewhite3; static PyObject *__pyx_n_u_antiquewhite4; static PyObject *__pyx_n_u_aqua; static PyObject *__pyx_n_u_aquamarine; static PyObject *__pyx_n_u_aquamarine1; static PyObject *__pyx_n_u_aquamarine2; static PyObject *__pyx_n_u_aquamarine3; static PyObject *__pyx_n_u_aquamarine4; static PyObject *__pyx_n_u_azure; static PyObject *__pyx_n_u_azure1; static PyObject *__pyx_n_u_azure2; static PyObject *__pyx_n_u_azure3; static PyObject *__pyx_n_u_azure4; static PyObject *__pyx_n_s_b; static PyObject *__pyx_n_u_beige; static PyObject *__pyx_n_s_binascii; static PyObject *__pyx_n_u_bisque; static PyObject *__pyx_n_u_bisque1; static PyObject *__pyx_n_u_bisque2; static PyObject *__pyx_n_u_bisque3; static PyObject *__pyx_n_u_bisque4; static PyObject *__pyx_n_u_black; static PyObject *__pyx_n_u_blanchedalmond; static PyObject *__pyx_n_u_blue; static PyObject *__pyx_n_u_blue1; static PyObject *__pyx_n_u_blue2; static PyObject *__pyx_n_u_blue3; static PyObject *__pyx_n_u_blue4; static PyObject *__pyx_n_u_blueviolet; static PyObject *__pyx_n_u_brown; static PyObject *__pyx_n_u_brown1; static PyObject *__pyx_n_u_brown2; static PyObject *__pyx_n_u_brown3; static PyObject *__pyx_n_u_brown4; static PyObject *__pyx_n_u_burlywood; static PyObject *__pyx_n_u_burlywood1; static PyObject *__pyx_n_u_burlywood2; static PyObject *__pyx_n_u_burlywood3; static PyObject *__pyx_n_u_burlywood4; static PyObject *__pyx_n_u_cadetblue; static PyObject *__pyx_n_u_cadetblue1; static PyObject *__pyx_n_u_cadetblue2; static PyObject *__pyx_n_u_cadetblue3; static PyObject *__pyx_n_u_cadetblue4; static PyObject *__pyx_n_u_chartreuse; static PyObject *__pyx_n_u_chartreuse1; static PyObject *__pyx_n_u_chartreuse2; static PyObject *__pyx_n_u_chartreuse3; static PyObject *__pyx_n_u_chartreuse4; static PyObject *__pyx_n_u_chocolate; static PyObject *__pyx_n_u_chocolate1; static PyObject *__pyx_n_u_chocolate2; static PyObject *__pyx_n_u_chocolate3; static PyObject *__pyx_n_u_chocolate4; static PyObject *__pyx_n_u_coral; static PyObject *__pyx_n_u_coral1; static PyObject *__pyx_n_u_coral2; static PyObject *__pyx_n_u_coral3; static PyObject *__pyx_n_u_coral4; static PyObject *__pyx_n_u_cornflowerblue; static PyObject *__pyx_n_u_cornsilk; static PyObject *__pyx_n_u_cornsilk1; static PyObject *__pyx_n_u_cornsilk2; static PyObject *__pyx_n_u_cornsilk3; static PyObject *__pyx_n_u_cornsilk4; static PyObject *__pyx_n_s_correct_gamma_locals_lambda; static PyObject *__pyx_n_u_crimson; static PyObject *__pyx_n_u_cyan; static PyObject *__pyx_n_u_cyan1; static PyObject *__pyx_n_u_cyan2; static PyObject *__pyx_n_u_cyan3; static PyObject *__pyx_n_u_cyan4; static PyObject *__pyx_n_u_darkblue; static PyObject *__pyx_n_u_darkcyan; static PyObject *__pyx_n_u_darkgoldenrod; static PyObject *__pyx_n_u_darkgoldenrod1; static PyObject *__pyx_n_u_darkgoldenrod2; static PyObject *__pyx_n_u_darkgoldenrod3; static PyObject *__pyx_n_u_darkgoldenrod4; static PyObject *__pyx_n_u_darkgray; static PyObject *__pyx_n_u_darkgreen; static PyObject *__pyx_n_u_darkgrey; static PyObject *__pyx_n_u_darkkhaki; static PyObject *__pyx_n_u_darkmagenta; static PyObject *__pyx_n_u_darkolivegreen; static PyObject *__pyx_n_u_darkolivegreen1; static PyObject *__pyx_n_u_darkolivegreen2; static PyObject *__pyx_n_u_darkolivegreen3; static PyObject *__pyx_n_u_darkolivegreen4; static PyObject *__pyx_n_u_darkorange; static PyObject *__pyx_n_u_darkorange1; static PyObject *__pyx_n_u_darkorange2; static PyObject *__pyx_n_u_darkorange3; static PyObject *__pyx_n_u_darkorange4; static PyObject *__pyx_n_u_darkorchid; static PyObject *__pyx_n_u_darkorchid1; static PyObject *__pyx_n_u_darkorchid2; static PyObject *__pyx_n_u_darkorchid3; static PyObject *__pyx_n_u_darkorchid4; static PyObject *__pyx_n_u_darkred; static PyObject *__pyx_n_u_darksalmon; static PyObject *__pyx_n_u_darkseagreen; static PyObject *__pyx_n_u_darkseagreen1; static PyObject *__pyx_n_u_darkseagreen2; static PyObject *__pyx_n_u_darkseagreen3; static PyObject *__pyx_n_u_darkseagreen4; static PyObject *__pyx_n_u_darkslateblue; static PyObject *__pyx_n_u_darkslategray; static PyObject *__pyx_n_u_darkslategray1; static PyObject *__pyx_n_u_darkslategray2; static PyObject *__pyx_n_u_darkslategray3; static PyObject *__pyx_n_u_darkslategray4; static PyObject *__pyx_n_u_darkslategrey; static PyObject *__pyx_n_u_darkturquoise; static PyObject *__pyx_n_u_darkviolet; static PyObject *__pyx_n_u_deeppink; static PyObject *__pyx_n_u_deeppink1; static PyObject *__pyx_n_u_deeppink2; static PyObject *__pyx_n_u_deeppink3; static PyObject *__pyx_n_u_deeppink4; static PyObject *__pyx_n_u_deepskyblue; static PyObject *__pyx_n_u_deepskyblue1; static PyObject *__pyx_n_u_deepskyblue2; static PyObject *__pyx_n_u_deepskyblue3; static PyObject *__pyx_n_u_deepskyblue4; static PyObject *__pyx_n_u_dimgray; static PyObject *__pyx_n_u_dimgrey; static PyObject *__pyx_n_s_div; static PyObject *__pyx_n_u_dodgerblue; static PyObject *__pyx_n_u_dodgerblue1; static PyObject *__pyx_n_u_dodgerblue2; static PyObject *__pyx_n_u_dodgerblue3; static PyObject *__pyx_n_u_dodgerblue4; static PyObject *__pyx_n_u_firebrick; static PyObject *__pyx_n_u_firebrick1; static PyObject *__pyx_n_u_firebrick2; static PyObject *__pyx_n_u_firebrick3; static PyObject *__pyx_n_u_firebrick4; static PyObject *__pyx_n_s_floordiv___locals_div; static PyObject *__pyx_n_u_floralwhite; static PyObject *__pyx_n_u_forestgreen; static PyObject *__pyx_n_u_fuchsia; static PyObject *__pyx_n_s_g; static PyObject *__pyx_n_u_gainsboro; static PyObject *__pyx_n_u_ghostwhite; static PyObject *__pyx_n_u_gold; static PyObject *__pyx_n_u_gold1; static PyObject *__pyx_n_u_gold2; static PyObject *__pyx_n_u_gold3; static PyObject *__pyx_n_u_gold4; static PyObject *__pyx_n_u_goldenrod; static PyObject *__pyx_n_u_goldenrod1; static PyObject *__pyx_n_u_goldenrod2; static PyObject *__pyx_n_u_goldenrod3; static PyObject *__pyx_n_u_goldenrod4; static PyObject *__pyx_n_u_gray; static PyObject *__pyx_n_u_gray0; static PyObject *__pyx_n_u_gray1; static PyObject *__pyx_n_u_gray10; static PyObject *__pyx_n_u_gray100; static PyObject *__pyx_n_u_gray11; static PyObject *__pyx_n_u_gray12; static PyObject *__pyx_n_u_gray13; static PyObject *__pyx_n_u_gray14; static PyObject *__pyx_n_u_gray15; static PyObject *__pyx_n_u_gray16; static PyObject *__pyx_n_u_gray17; static PyObject *__pyx_n_u_gray18; static PyObject *__pyx_n_u_gray19; static PyObject *__pyx_n_u_gray2; static PyObject *__pyx_n_u_gray20; static PyObject *__pyx_n_u_gray21; static PyObject *__pyx_n_u_gray22; static PyObject *__pyx_n_u_gray23; static PyObject *__pyx_n_u_gray24; static PyObject *__pyx_n_u_gray25; static PyObject *__pyx_n_u_gray26; static PyObject *__pyx_n_u_gray27; static PyObject *__pyx_n_u_gray28; static PyObject *__pyx_n_u_gray29; static PyObject *__pyx_n_u_gray3; static PyObject *__pyx_n_u_gray30; static PyObject *__pyx_n_u_gray31; static PyObject *__pyx_n_u_gray32; static PyObject *__pyx_n_u_gray33; static PyObject *__pyx_n_u_gray34; static PyObject *__pyx_n_u_gray35; static PyObject *__pyx_n_u_gray36; static PyObject *__pyx_n_u_gray37; static PyObject *__pyx_n_u_gray38; static PyObject *__pyx_n_u_gray39; static PyObject *__pyx_n_u_gray4; static PyObject *__pyx_n_u_gray40; static PyObject *__pyx_n_u_gray41; static PyObject *__pyx_n_u_gray42; static PyObject *__pyx_n_u_gray43; static PyObject *__pyx_n_u_gray44; static PyObject *__pyx_n_u_gray45; static PyObject *__pyx_n_u_gray46; static PyObject *__pyx_n_u_gray47; static PyObject *__pyx_n_u_gray48; static PyObject *__pyx_n_u_gray49; static PyObject *__pyx_n_u_gray5; static PyObject *__pyx_n_u_gray50; static PyObject *__pyx_n_u_gray51; static PyObject *__pyx_n_u_gray52; static PyObject *__pyx_n_u_gray53; static PyObject *__pyx_n_u_gray54; static PyObject *__pyx_n_u_gray55; static PyObject *__pyx_n_u_gray56; static PyObject *__pyx_n_u_gray57; static PyObject *__pyx_n_u_gray58; static PyObject *__pyx_n_u_gray59; static PyObject *__pyx_n_u_gray6; static PyObject *__pyx_n_u_gray60; static PyObject *__pyx_n_u_gray61; static PyObject *__pyx_n_u_gray62; static PyObject *__pyx_n_u_gray63; static PyObject *__pyx_n_u_gray64; static PyObject *__pyx_n_u_gray65; static PyObject *__pyx_n_u_gray66; static PyObject *__pyx_n_u_gray67; static PyObject *__pyx_n_u_gray68; static PyObject *__pyx_n_u_gray69; static PyObject *__pyx_n_u_gray7; static PyObject *__pyx_n_u_gray70; static PyObject *__pyx_n_u_gray71; static PyObject *__pyx_n_u_gray72; static PyObject *__pyx_n_u_gray73; static PyObject *__pyx_n_u_gray74; static PyObject *__pyx_n_u_gray75; static PyObject *__pyx_n_u_gray76; static PyObject *__pyx_n_u_gray77; static PyObject *__pyx_n_u_gray78; static PyObject *__pyx_n_u_gray79; static PyObject *__pyx_n_u_gray8; static PyObject *__pyx_n_u_gray80; static PyObject *__pyx_n_u_gray81; static PyObject *__pyx_n_u_gray82; static PyObject *__pyx_n_u_gray83; static PyObject *__pyx_n_u_gray84; static PyObject *__pyx_n_u_gray85; static PyObject *__pyx_n_u_gray86; static PyObject *__pyx_n_u_gray87; static PyObject *__pyx_n_u_gray88; static PyObject *__pyx_n_u_gray89; static PyObject *__pyx_n_u_gray9; static PyObject *__pyx_n_u_gray90; static PyObject *__pyx_n_u_gray91; static PyObject *__pyx_n_u_gray92; static PyObject *__pyx_n_u_gray93; static PyObject *__pyx_n_u_gray94; static PyObject *__pyx_n_u_gray95; static PyObject *__pyx_n_u_gray96; static PyObject *__pyx_n_u_gray97; static PyObject *__pyx_n_u_gray98; static PyObject *__pyx_n_u_gray99; static PyObject *__pyx_n_u_green; static PyObject *__pyx_n_u_green1; static PyObject *__pyx_n_u_green2; static PyObject *__pyx_n_u_green3; static PyObject *__pyx_n_u_green4; static PyObject *__pyx_n_u_greenyellow; static PyObject *__pyx_n_u_grey; static PyObject *__pyx_n_u_grey0; static PyObject *__pyx_n_u_grey1; static PyObject *__pyx_n_u_grey10; static PyObject *__pyx_n_u_grey100; static PyObject *__pyx_n_u_grey11; static PyObject *__pyx_n_u_grey12; static PyObject *__pyx_n_u_grey13; static PyObject *__pyx_n_u_grey14; static PyObject *__pyx_n_u_grey15; static PyObject *__pyx_n_u_grey16; static PyObject *__pyx_n_u_grey17; static PyObject *__pyx_n_u_grey18; static PyObject *__pyx_n_u_grey19; static PyObject *__pyx_n_u_grey2; static PyObject *__pyx_n_u_grey20; static PyObject *__pyx_n_u_grey21; static PyObject *__pyx_n_u_grey22; static PyObject *__pyx_n_u_grey23; static PyObject *__pyx_n_u_grey24; static PyObject *__pyx_n_u_grey25; static PyObject *__pyx_n_u_grey26; static PyObject *__pyx_n_u_grey27; static PyObject *__pyx_n_u_grey28; static PyObject *__pyx_n_u_grey29; static PyObject *__pyx_n_u_grey3; static PyObject *__pyx_n_u_grey30; static PyObject *__pyx_n_u_grey31; static PyObject *__pyx_n_u_grey32; static PyObject *__pyx_n_u_grey33; static PyObject *__pyx_n_u_grey34; static PyObject *__pyx_n_u_grey35; static PyObject *__pyx_n_u_grey36; static PyObject *__pyx_n_u_grey37; static PyObject *__pyx_n_u_grey38; static PyObject *__pyx_n_u_grey39; static PyObject *__pyx_n_u_grey4; static PyObject *__pyx_n_u_grey40; static PyObject *__pyx_n_u_grey41; static PyObject *__pyx_n_u_grey42; static PyObject *__pyx_n_u_grey43; static PyObject *__pyx_n_u_grey44; static PyObject *__pyx_n_u_grey45; static PyObject *__pyx_n_u_grey46; static PyObject *__pyx_n_u_grey47; static PyObject *__pyx_n_u_grey48; static PyObject *__pyx_n_u_grey49; static PyObject *__pyx_n_u_grey5; static PyObject *__pyx_n_u_grey50; static PyObject *__pyx_n_u_grey51; static PyObject *__pyx_n_u_grey52; static PyObject *__pyx_n_u_grey53; static PyObject *__pyx_n_u_grey54; static PyObject *__pyx_n_u_grey55; static PyObject *__pyx_n_u_grey56; static PyObject *__pyx_n_u_grey57; static PyObject *__pyx_n_u_grey58; static PyObject *__pyx_n_u_grey59; static PyObject *__pyx_n_u_grey6; static PyObject *__pyx_n_u_grey60; static PyObject *__pyx_n_u_grey61; static PyObject *__pyx_n_u_grey62; static PyObject *__pyx_n_u_grey63; static PyObject *__pyx_n_u_grey64; static PyObject *__pyx_n_u_grey65; static PyObject *__pyx_n_u_grey66; static PyObject *__pyx_n_u_grey67; static PyObject *__pyx_n_u_grey68; static PyObject *__pyx_n_u_grey69; static PyObject *__pyx_n_u_grey7; static PyObject *__pyx_n_u_grey70; static PyObject *__pyx_n_u_grey71; static PyObject *__pyx_n_u_grey72; static PyObject *__pyx_n_u_grey73; static PyObject *__pyx_n_u_grey74; static PyObject *__pyx_n_u_grey75; static PyObject *__pyx_n_u_grey76; static PyObject *__pyx_n_u_grey77; static PyObject *__pyx_n_u_grey78; static PyObject *__pyx_n_u_grey79; static PyObject *__pyx_n_u_grey8; static PyObject *__pyx_n_u_grey80; static PyObject *__pyx_n_u_grey81; static PyObject *__pyx_n_u_grey82; static PyObject *__pyx_n_u_grey83; static PyObject *__pyx_n_u_grey84; static PyObject *__pyx_n_u_grey85; static PyObject *__pyx_n_u_grey86; static PyObject *__pyx_n_u_grey87; static PyObject *__pyx_n_u_grey88; static PyObject *__pyx_n_u_grey89; static PyObject *__pyx_n_u_grey9; static PyObject *__pyx_n_u_grey90; static PyObject *__pyx_n_u_grey91; static PyObject *__pyx_n_u_grey92; static PyObject *__pyx_n_u_grey93; static PyObject *__pyx_n_u_grey94; static PyObject *__pyx_n_u_grey95; static PyObject *__pyx_n_u_grey96; static PyObject *__pyx_n_u_grey97; static PyObject *__pyx_n_u_grey98; static PyObject *__pyx_n_u_grey99; static PyObject *__pyx_n_s_hex; static PyObject *__pyx_kp_s_home_tom_ab_pygame_sdl2_src_pyg; static PyObject *__pyx_n_u_honeydew; static PyObject *__pyx_n_u_honeydew1; static PyObject *__pyx_n_u_honeydew2; static PyObject *__pyx_n_u_honeydew3; static PyObject *__pyx_n_u_honeydew4; static PyObject *__pyx_n_u_hotpink; static PyObject *__pyx_n_u_hotpink1; static PyObject *__pyx_n_u_hotpink2; static PyObject *__pyx_n_u_hotpink3; static PyObject *__pyx_n_u_hotpink4; static PyObject *__pyx_n_s_hsva; static PyObject *__pyx_n_s_import; static PyObject *__pyx_n_u_indianred; static PyObject *__pyx_n_u_indianred1; static PyObject *__pyx_n_u_indianred2; static PyObject *__pyx_n_u_indianred3; static PyObject *__pyx_n_u_indianred4; static PyObject *__pyx_n_u_indigo; static PyObject *__pyx_n_u_ivory; static PyObject *__pyx_n_u_ivory1; static PyObject *__pyx_n_u_ivory2; static PyObject *__pyx_n_u_ivory3; static PyObject *__pyx_n_u_ivory4; static PyObject *__pyx_n_u_khaki; static PyObject *__pyx_n_u_khaki1; static PyObject *__pyx_n_u_khaki2; static PyObject *__pyx_n_u_khaki3; static PyObject *__pyx_n_u_khaki4; static PyObject *__pyx_n_s_l; static PyObject *__pyx_n_u_lavender; static PyObject *__pyx_n_u_lavenderblush; static PyObject *__pyx_n_u_lavenderblush1; static PyObject *__pyx_n_u_lavenderblush2; static PyObject *__pyx_n_u_lavenderblush3; static PyObject *__pyx_n_u_lavenderblush4; static PyObject *__pyx_n_u_lawngreen; static PyObject *__pyx_n_u_lemonchiffon; static PyObject *__pyx_n_u_lemonchiffon1; static PyObject *__pyx_n_u_lemonchiffon2; static PyObject *__pyx_n_u_lemonchiffon3; static PyObject *__pyx_n_u_lemonchiffon4; static PyObject *__pyx_n_u_lightblue; static PyObject *__pyx_n_u_lightblue1; static PyObject *__pyx_n_u_lightblue2; static PyObject *__pyx_n_u_lightblue3; static PyObject *__pyx_n_u_lightblue4; static PyObject *__pyx_n_u_lightcoral; static PyObject *__pyx_n_u_lightcyan; static PyObject *__pyx_n_u_lightcyan1; static PyObject *__pyx_n_u_lightcyan2; static PyObject *__pyx_n_u_lightcyan3; static PyObject *__pyx_n_u_lightcyan4; static PyObject *__pyx_n_u_lightgoldenrod; static PyObject *__pyx_n_u_lightgoldenrod1; static PyObject *__pyx_n_u_lightgoldenrod2; static PyObject *__pyx_n_u_lightgoldenrod3; static PyObject *__pyx_n_u_lightgoldenrod4; static PyObject *__pyx_n_u_lightgoldenrodyellow; static PyObject *__pyx_n_u_lightgray; static PyObject *__pyx_n_u_lightgreen; static PyObject *__pyx_n_u_lightgrey; static PyObject *__pyx_n_u_lightpink; static PyObject *__pyx_n_u_lightpink1; static PyObject *__pyx_n_u_lightpink2; static PyObject *__pyx_n_u_lightpink3; static PyObject *__pyx_n_u_lightpink4; static PyObject *__pyx_n_u_lightsalmon; static PyObject *__pyx_n_u_lightsalmon1; static PyObject *__pyx_n_u_lightsalmon2; static PyObject *__pyx_n_u_lightsalmon3; static PyObject *__pyx_n_u_lightsalmon4; static PyObject *__pyx_n_u_lightseagreen; static PyObject *__pyx_n_u_lightskyblue; static PyObject *__pyx_n_u_lightskyblue1; static PyObject *__pyx_n_u_lightskyblue2; static PyObject *__pyx_n_u_lightskyblue3; static PyObject *__pyx_n_u_lightskyblue4; static PyObject *__pyx_n_u_lightslateblue; static PyObject *__pyx_n_u_lightslategray; static PyObject *__pyx_n_u_lightslategrey; static PyObject *__pyx_n_u_lightsteelblue; static PyObject *__pyx_n_u_lightsteelblue1; static PyObject *__pyx_n_u_lightsteelblue2; static PyObject *__pyx_n_u_lightsteelblue3; static PyObject *__pyx_n_u_lightsteelblue4; static PyObject *__pyx_n_u_lightyellow; static PyObject *__pyx_n_u_lightyellow1; static PyObject *__pyx_n_u_lightyellow2; static PyObject *__pyx_n_u_lightyellow3; static PyObject *__pyx_n_u_lightyellow4; static PyObject *__pyx_n_u_lime; static PyObject *__pyx_n_u_limegreen; static PyObject *__pyx_n_u_linen; static PyObject *__pyx_n_s_lower; static PyObject *__pyx_n_u_magenta; static PyObject *__pyx_n_u_magenta1; static PyObject *__pyx_n_u_magenta2; static PyObject *__pyx_n_u_magenta3; static PyObject *__pyx_n_u_magenta4; static PyObject *__pyx_n_s_main; static PyObject *__pyx_n_s_map; static PyObject *__pyx_n_u_maroon; static PyObject *__pyx_n_u_maroon1; static PyObject *__pyx_n_u_maroon2; static PyObject *__pyx_n_u_maroon3; static PyObject *__pyx_n_u_maroon4; static PyObject *__pyx_n_u_mediumaquamarine; static PyObject *__pyx_n_u_mediumblue; static PyObject *__pyx_n_u_mediumorchid; static PyObject *__pyx_n_u_mediumorchid1; static PyObject *__pyx_n_u_mediumorchid2; static PyObject *__pyx_n_u_mediumorchid3; static PyObject *__pyx_n_u_mediumorchid4; static PyObject *__pyx_n_u_mediumpurple; static PyObject *__pyx_n_u_mediumpurple1; static PyObject *__pyx_n_u_mediumpurple2; static PyObject *__pyx_n_u_mediumpurple3; static PyObject *__pyx_n_u_mediumpurple4; static PyObject *__pyx_n_u_mediumseagreen; static PyObject *__pyx_n_u_mediumslateblue; static PyObject *__pyx_n_u_mediumspringgreen; static PyObject *__pyx_n_u_mediumturquoise; static PyObject *__pyx_n_u_mediumvioletred; static PyObject *__pyx_n_u_midnightblue; static PyObject *__pyx_n_u_mintcream; static PyObject *__pyx_n_u_mistyrose; static PyObject *__pyx_n_u_mistyrose1; static PyObject *__pyx_n_u_mistyrose2; static PyObject *__pyx_n_u_mistyrose3; static PyObject *__pyx_n_u_mistyrose4; static PyObject *__pyx_n_u_moccasin; static PyObject *__pyx_n_s_mod; static PyObject *__pyx_n_s_mod___locals_mod; static PyObject *__pyx_n_u_navajowhite; static PyObject *__pyx_n_u_navajowhite1; static PyObject *__pyx_n_u_navajowhite2; static PyObject *__pyx_n_u_navajowhite3; static PyObject *__pyx_n_u_navajowhite4; static PyObject *__pyx_n_u_navy; static PyObject *__pyx_n_u_navyblue; static PyObject *__pyx_n_s_oct; static PyObject *__pyx_n_u_oldlace; static PyObject *__pyx_n_u_olive; static PyObject *__pyx_n_u_olivedrab; static PyObject *__pyx_n_u_olivedrab1; static PyObject *__pyx_n_u_olivedrab2; static PyObject *__pyx_n_u_olivedrab3; static PyObject *__pyx_n_u_olivedrab4; static PyObject *__pyx_n_u_orange; static PyObject *__pyx_n_u_orange1; static PyObject *__pyx_n_u_orange2; static PyObject *__pyx_n_u_orange3; static PyObject *__pyx_n_u_orange4; static PyObject *__pyx_n_u_orangered; static PyObject *__pyx_n_u_orangered1; static PyObject *__pyx_n_u_orangered2; static PyObject *__pyx_n_u_orangered3; static PyObject *__pyx_n_u_orangered4; static PyObject *__pyx_n_u_orchid; static PyObject *__pyx_n_u_orchid1; static PyObject *__pyx_n_u_orchid2; static PyObject *__pyx_n_u_orchid3; static PyObject *__pyx_n_u_orchid4; static PyObject *__pyx_n_s_pack; static PyObject *__pyx_n_u_palegoldenrod; static PyObject *__pyx_n_u_palegreen; static PyObject *__pyx_n_u_palegreen1; static PyObject *__pyx_n_u_palegreen2; static PyObject *__pyx_n_u_palegreen3; static PyObject *__pyx_n_u_palegreen4; static PyObject *__pyx_n_u_paleturquoise; static PyObject *__pyx_n_u_paleturquoise1; static PyObject *__pyx_n_u_paleturquoise2; static PyObject *__pyx_n_u_paleturquoise3; static PyObject *__pyx_n_u_paleturquoise4; static PyObject *__pyx_n_u_palevioletred; static PyObject *__pyx_n_u_palevioletred1; static PyObject *__pyx_n_u_palevioletred2; static PyObject *__pyx_n_u_palevioletred3; static PyObject *__pyx_n_u_palevioletred4; static PyObject *__pyx_n_u_papayawhip; static PyObject *__pyx_n_u_peachpuff; static PyObject *__pyx_n_u_peachpuff1; static PyObject *__pyx_n_u_peachpuff2; static PyObject *__pyx_n_u_peachpuff3; static PyObject *__pyx_n_u_peachpuff4; static PyObject *__pyx_n_u_peru; static PyObject *__pyx_n_u_pink; static PyObject *__pyx_n_u_pink1; static PyObject *__pyx_n_u_pink2; static PyObject *__pyx_n_u_pink3; static PyObject *__pyx_n_u_pink4; static PyObject *__pyx_n_u_plum; static PyObject *__pyx_n_u_plum1; static PyObject *__pyx_n_u_plum2; static PyObject *__pyx_n_u_plum3; static PyObject *__pyx_n_u_plum4; static PyObject *__pyx_n_u_powderblue; static PyObject *__pyx_n_u_purple; static PyObject *__pyx_n_u_purple1; static PyObject *__pyx_n_u_purple2; static PyObject *__pyx_n_u_purple3; static PyObject *__pyx_n_u_purple4; static PyObject *__pyx_n_s_pygame_sdl2_color; static PyObject *__pyx_n_s_pyx_vtable; static PyObject *__pyx_n_s_r; static PyObject *__pyx_n_u_rebeccapurple; static PyObject *__pyx_n_u_red; static PyObject *__pyx_n_u_red1; static PyObject *__pyx_n_u_red2; static PyObject *__pyx_n_u_red3; static PyObject *__pyx_n_u_red4; static PyObject *__pyx_n_u_rgba; static PyObject *__pyx_n_u_rosybrown; static PyObject *__pyx_n_u_rosybrown1; static PyObject *__pyx_n_u_rosybrown2; static PyObject *__pyx_n_u_rosybrown3; static PyObject *__pyx_n_u_rosybrown4; static PyObject *__pyx_n_s_round; static PyObject *__pyx_n_u_royalblue; static PyObject *__pyx_n_u_royalblue1; static PyObject *__pyx_n_u_royalblue2; static PyObject *__pyx_n_u_royalblue3; static PyObject *__pyx_n_u_royalblue4; static PyObject *__pyx_n_u_saddlebrown; static PyObject *__pyx_n_u_salmon; static PyObject *__pyx_n_u_salmon1; static PyObject *__pyx_n_u_salmon2; static PyObject *__pyx_n_u_salmon3; static PyObject *__pyx_n_u_salmon4; static PyObject *__pyx_n_u_sandybrown; static PyObject *__pyx_n_u_seagreen; static PyObject *__pyx_n_u_seagreen1; static PyObject *__pyx_n_u_seagreen2; static PyObject *__pyx_n_u_seagreen3; static PyObject *__pyx_n_u_seagreen4; static PyObject *__pyx_n_u_seashell; static PyObject *__pyx_n_u_seashell1; static PyObject *__pyx_n_u_seashell2; static PyObject *__pyx_n_u_seashell3; static PyObject *__pyx_n_u_seashell4; static PyObject *__pyx_n_u_sienna; static PyObject *__pyx_n_u_sienna1; static PyObject *__pyx_n_u_sienna2; static PyObject *__pyx_n_u_sienna3; static PyObject *__pyx_n_u_sienna4; static PyObject *__pyx_n_u_silver; static PyObject *__pyx_n_u_skyblue; static PyObject *__pyx_n_u_skyblue1; static PyObject *__pyx_n_u_skyblue2; static PyObject *__pyx_n_u_skyblue3; static PyObject *__pyx_n_u_skyblue4; static PyObject *__pyx_n_u_slateblue; static PyObject *__pyx_n_u_slateblue1; static PyObject *__pyx_n_u_slateblue2; static PyObject *__pyx_n_u_slateblue3; static PyObject *__pyx_n_u_slateblue4; static PyObject *__pyx_n_u_slategray; static PyObject *__pyx_n_u_slategray1; static PyObject *__pyx_n_u_slategray2; static PyObject *__pyx_n_u_slategray3; static PyObject *__pyx_n_u_slategray4; static PyObject *__pyx_n_u_slategrey; static PyObject *__pyx_n_u_snow; static PyObject *__pyx_n_u_snow1; static PyObject *__pyx_n_u_snow2; static PyObject *__pyx_n_u_snow3; static PyObject *__pyx_n_u_snow4; static PyObject *__pyx_n_s_split; static PyObject *__pyx_n_u_springgreen; static PyObject *__pyx_n_u_springgreen1; static PyObject *__pyx_n_u_springgreen2; static PyObject *__pyx_n_u_springgreen3; static PyObject *__pyx_n_u_springgreen4; static PyObject *__pyx_n_s_startswith; static PyObject *__pyx_n_u_steelblue; static PyObject *__pyx_n_u_steelblue1; static PyObject *__pyx_n_u_steelblue2; static PyObject *__pyx_n_u_steelblue3; static PyObject *__pyx_n_u_steelblue4; static PyObject *__pyx_n_s_struct; static PyObject *__pyx_n_u_tan; static PyObject *__pyx_n_u_tan1; static PyObject *__pyx_n_u_tan2; static PyObject *__pyx_n_u_tan3; static PyObject *__pyx_n_u_tan4; static PyObject *__pyx_n_u_teal; static PyObject *__pyx_n_s_test; static PyObject *__pyx_n_u_thistle; static PyObject *__pyx_n_u_thistle1; static PyObject *__pyx_n_u_thistle2; static PyObject *__pyx_n_u_thistle3; static PyObject *__pyx_n_u_thistle4; static PyObject *__pyx_n_u_tomato; static PyObject *__pyx_n_u_tomato1; static PyObject *__pyx_n_u_tomato2; static PyObject *__pyx_n_u_tomato3; static PyObject *__pyx_n_u_tomato4; static PyObject *__pyx_n_u_turquoise; static PyObject *__pyx_n_u_turquoise1; static PyObject *__pyx_n_u_turquoise2; static PyObject *__pyx_n_u_turquoise3; static PyObject *__pyx_n_u_turquoise4; static PyObject *__pyx_n_s_unhexlify; static PyObject *__pyx_n_s_unpack; static PyObject *__pyx_n_u_violet; static PyObject *__pyx_n_u_violetred; static PyObject *__pyx_n_u_violetred1; static PyObject *__pyx_n_u_violetred2; static PyObject *__pyx_n_u_violetred3; static PyObject *__pyx_n_u_violetred4; static PyObject *__pyx_n_u_webgray; static PyObject *__pyx_n_u_webgreen; static PyObject *__pyx_n_u_webgrey; static PyObject *__pyx_n_u_webmaroon; static PyObject *__pyx_n_u_webpurple; static PyObject *__pyx_n_u_wheat; static PyObject *__pyx_n_u_wheat1; static PyObject *__pyx_n_u_wheat2; static PyObject *__pyx_n_u_wheat3; static PyObject *__pyx_n_u_wheat4; static PyObject *__pyx_n_u_white; static PyObject *__pyx_n_u_whitesmoke; static PyObject *__pyx_n_u_x11gray; static PyObject *__pyx_n_u_x11green; static PyObject *__pyx_n_u_x11grey; static PyObject *__pyx_n_u_x11maroon; static PyObject *__pyx_n_u_x11purple; static PyObject *__pyx_n_u_yellow; static PyObject *__pyx_n_u_yellow1; static PyObject *__pyx_n_u_yellow2; static PyObject *__pyx_n_u_yellow3; static PyObject *__pyx_n_u_yellow4; static PyObject *__pyx_n_u_yellowgreen; static PyObject *__pyx_lambda_funcdef_lambda(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_x); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_5color_5Color___richcmp__(struct __pyx_obj_11pygame_sdl2_5color_Color *__pyx_v_x, PyObject *__pyx_v_y, int __pyx_v_op); /* proto */ static int __pyx_pf_11pygame_sdl2_5color_5Color_2__cinit__(struct __pyx_obj_11pygame_sdl2_5color_Color *__pyx_v_self); /* proto */ static int __pyx_pf_11pygame_sdl2_5color_5Color_4__init__(struct __pyx_obj_11pygame_sdl2_5color_Color *__pyx_v_self, PyObject *__pyx_v_args); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_5color_5Color_6__repr__(struct __pyx_obj_11pygame_sdl2_5color_Color *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_5color_5Color_8__int__(struct __pyx_obj_11pygame_sdl2_5color_Color *__pyx_v_self); /* proto */ #if PY_MAJOR_VERSION < 3 || CYTHON_COMPILING_IN_PYPY static PyObject *__pyx_pf_11pygame_sdl2_5color_5Color_10__hex__(struct __pyx_obj_11pygame_sdl2_5color_Color *__pyx_v_self); /* proto */ #endif #if PY_MAJOR_VERSION < 3 || CYTHON_COMPILING_IN_PYPY static PyObject *__pyx_pf_11pygame_sdl2_5color_5Color_12__oct__(struct __pyx_obj_11pygame_sdl2_5color_Color *__pyx_v_self); /* proto */ #endif static PyObject *__pyx_pf_11pygame_sdl2_5color_5Color_14__float__(struct __pyx_obj_11pygame_sdl2_5color_Color *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_5color_5Color_16__reduce__(struct __pyx_obj_11pygame_sdl2_5color_Color *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_5color_5Color_18__setstate__(struct __pyx_obj_11pygame_sdl2_5color_Color *__pyx_v_self, PyObject *__pyx_v_d); /* proto */ static int __pyx_pf_11pygame_sdl2_5color_5Color_20__setitem__(struct __pyx_obj_11pygame_sdl2_5color_Color *__pyx_v_self, PyObject *__pyx_v_key, PyObject *__pyx_v_val); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_5color_5Color_22__getitem__(struct __pyx_obj_11pygame_sdl2_5color_Color *__pyx_v_self, PyObject *__pyx_v_key); /* proto */ static Py_ssize_t __pyx_pf_11pygame_sdl2_5color_5Color_24__len__(struct __pyx_obj_11pygame_sdl2_5color_Color *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_5color_5Color_26__mul__(PyObject *__pyx_v_self, struct __pyx_obj_11pygame_sdl2_5color_Color *__pyx_v_rhs); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_5color_5Color_28__add__(PyObject *__pyx_v_self, struct __pyx_obj_11pygame_sdl2_5color_Color *__pyx_v_rhs); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_5color_5Color_30__sub__(PyObject *__pyx_v_self, struct __pyx_obj_11pygame_sdl2_5color_Color *__pyx_v_rhs); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_5color_5Color_7__mod___mod(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_l, PyObject *__pyx_v_r); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_5color_5Color_32__mod__(PyObject *__pyx_v_self, struct __pyx_obj_11pygame_sdl2_5color_Color *__pyx_v_rhs); /* proto */ #if PY_MAJOR_VERSION < 3 || CYTHON_COMPILING_IN_PYPY static PyObject *__pyx_pf_11pygame_sdl2_5color_5Color_34__div__(PyObject *__pyx_v_self, struct __pyx_obj_11pygame_sdl2_5color_Color *__pyx_v_rhs); /* proto */ #endif static PyObject *__pyx_pf_11pygame_sdl2_5color_5Color_12__floordiv___div(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_a, PyObject *__pyx_v_b); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_5color_5Color_36__floordiv__(PyObject *__pyx_v_self, struct __pyx_obj_11pygame_sdl2_5color_Color *__pyx_v_rhs); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_5color_5Color_3cmy___get__(struct __pyx_obj_11pygame_sdl2_5color_Color *__pyx_v_self); /* proto */ static int __pyx_pf_11pygame_sdl2_5color_5Color_3cmy_2__set__(struct __pyx_obj_11pygame_sdl2_5color_Color *__pyx_v_self, PyObject *__pyx_v_val); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_5color_5Color_4hsva___get__(struct __pyx_obj_11pygame_sdl2_5color_Color *__pyx_v_self); /* proto */ static int __pyx_pf_11pygame_sdl2_5color_5Color_4hsva_2__set__(struct __pyx_obj_11pygame_sdl2_5color_Color *__pyx_v_self, PyObject *__pyx_v_val); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_5color_5Color_4hsla___get__(struct __pyx_obj_11pygame_sdl2_5color_Color *__pyx_v_self); /* proto */ static int __pyx_pf_11pygame_sdl2_5color_5Color_4hsla_2__set__(struct __pyx_obj_11pygame_sdl2_5color_Color *__pyx_v_self, PyObject *__pyx_v_val); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_5color_5Color_6i1i2i3___get__(struct __pyx_obj_11pygame_sdl2_5color_Color *__pyx_v_self); /* proto */ static int __pyx_pf_11pygame_sdl2_5color_5Color_6i1i2i3_2__set__(struct __pyx_obj_11pygame_sdl2_5color_Color *__pyx_v_self, PyObject *__pyx_v_val); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_5color_5Color_38normalize(struct __pyx_obj_11pygame_sdl2_5color_Color *__pyx_v_self); /* proto */ static PyObject *__pyx_lambda_funcdef_lambda1(PyObject *__pyx_self, PyObject *__pyx_v_x); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_5color_5Color_40correct_gamma(struct __pyx_obj_11pygame_sdl2_5color_Color *__pyx_v_self, PyObject *__pyx_v_gamma); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_5color_5Color_42set_length(struct __pyx_obj_11pygame_sdl2_5color_Color *__pyx_v_self, PyObject *__pyx_v_n); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_5color_5Color_1r___get__(struct __pyx_obj_11pygame_sdl2_5color_Color *__pyx_v_self); /* proto */ static int __pyx_pf_11pygame_sdl2_5color_5Color_1r_2__set__(struct __pyx_obj_11pygame_sdl2_5color_Color *__pyx_v_self, PyObject *__pyx_v_value); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_5color_5Color_1g___get__(struct __pyx_obj_11pygame_sdl2_5color_Color *__pyx_v_self); /* proto */ static int __pyx_pf_11pygame_sdl2_5color_5Color_1g_2__set__(struct __pyx_obj_11pygame_sdl2_5color_Color *__pyx_v_self, PyObject *__pyx_v_value); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_5color_5Color_1b___get__(struct __pyx_obj_11pygame_sdl2_5color_Color *__pyx_v_self); /* proto */ static int __pyx_pf_11pygame_sdl2_5color_5Color_1b_2__set__(struct __pyx_obj_11pygame_sdl2_5color_Color *__pyx_v_self, PyObject *__pyx_v_value); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_5color_5Color_1a___get__(struct __pyx_obj_11pygame_sdl2_5color_Color *__pyx_v_self); /* proto */ static int __pyx_pf_11pygame_sdl2_5color_5Color_1a_2__set__(struct __pyx_obj_11pygame_sdl2_5color_Color *__pyx_v_self, PyObject *__pyx_v_value); /* proto */ static PyObject *__pyx_tp_new_11pygame_sdl2_5color_Color(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ static PyObject *__pyx_tp_new_11pygame_sdl2_5color___pyx_scope_struct__correct_gamma(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ static PyObject *__pyx_float_255_0; static PyObject *__pyx_float_360_0; static PyObject *__pyx_int_0; static PyObject *__pyx_int_1; static PyObject *__pyx_int_2; static PyObject *__pyx_int_3; static PyObject *__pyx_int_4; static PyObject *__pyx_int_5; static PyObject *__pyx_int_8; static PyObject *__pyx_int_10; static PyObject *__pyx_int_11; static PyObject *__pyx_int_12; static PyObject *__pyx_int_13; static PyObject *__pyx_int_14; static PyObject *__pyx_int_15; static PyObject *__pyx_int_16; static PyObject *__pyx_int_18; static PyObject *__pyx_int_19; static PyObject *__pyx_int_20; static PyObject *__pyx_int_21; static PyObject *__pyx_int_23; static PyObject *__pyx_int_24; static PyObject *__pyx_int_25; static PyObject *__pyx_int_26; static PyObject *__pyx_int_28; static PyObject *__pyx_int_29; static PyObject *__pyx_int_30; static PyObject *__pyx_int_31; static PyObject *__pyx_int_32; static PyObject *__pyx_int_33; static PyObject *__pyx_int_34; static PyObject *__pyx_int_35; static PyObject *__pyx_int_36; static PyObject *__pyx_int_37; static PyObject *__pyx_int_38; static PyObject *__pyx_int_39; static PyObject *__pyx_int_41; static PyObject *__pyx_int_42; static PyObject *__pyx_int_43; static PyObject *__pyx_int_44; static PyObject *__pyx_int_45; static PyObject *__pyx_int_46; static PyObject *__pyx_int_47; static PyObject *__pyx_int_48; static PyObject *__pyx_int_50; static PyObject *__pyx_int_51; static PyObject *__pyx_int_52; static PyObject *__pyx_int_54; static PyObject *__pyx_int_55; static PyObject *__pyx_int_56; static PyObject *__pyx_int_57; static PyObject *__pyx_int_58; static PyObject *__pyx_int_59; static PyObject *__pyx_int_60; static PyObject *__pyx_int_61; static PyObject *__pyx_int_62; static PyObject *__pyx_int_63; static PyObject *__pyx_int_64; static PyObject *__pyx_int_65; static PyObject *__pyx_int_66; static PyObject *__pyx_int_67; static PyObject *__pyx_int_69; static PyObject *__pyx_int_70; static PyObject *__pyx_int_71; static PyObject *__pyx_int_72; static PyObject *__pyx_int_73; static PyObject *__pyx_int_74; static PyObject *__pyx_int_75; static PyObject *__pyx_int_76; static PyObject *__pyx_int_77; static PyObject *__pyx_int_78; static PyObject *__pyx_int_79; static PyObject *__pyx_int_80; static PyObject *__pyx_int_82; static PyObject *__pyx_int_83; static PyObject *__pyx_int_84; static PyObject *__pyx_int_85; static PyObject *__pyx_int_86; static PyObject *__pyx_int_87; static PyObject *__pyx_int_89; static PyObject *__pyx_int_90; static PyObject *__pyx_int_91; static PyObject *__pyx_int_92; static PyObject *__pyx_int_93; static PyObject *__pyx_int_94; static PyObject *__pyx_int_95; static PyObject *__pyx_int_96; static PyObject *__pyx_int_97; static PyObject *__pyx_int_98; static PyObject *__pyx_int_99; static PyObject *__pyx_int_100; static PyObject *__pyx_int_101; static PyObject *__pyx_int_102; static PyObject *__pyx_int_103; static PyObject *__pyx_int_104; static PyObject *__pyx_int_105; static PyObject *__pyx_int_106; static PyObject *__pyx_int_107; static PyObject *__pyx_int_108; static PyObject *__pyx_int_110; static PyObject *__pyx_int_111; static PyObject *__pyx_int_112; static PyObject *__pyx_int_113; static PyObject *__pyx_int_114; static PyObject *__pyx_int_115; static PyObject *__pyx_int_116; static PyObject *__pyx_int_117; static PyObject *__pyx_int_118; static PyObject *__pyx_int_119; static PyObject *__pyx_int_120; static PyObject *__pyx_int_121; static PyObject *__pyx_int_122; static PyObject *__pyx_int_123; static PyObject *__pyx_int_124; static PyObject *__pyx_int_125; static PyObject *__pyx_int_126; static PyObject *__pyx_int_127; static PyObject *__pyx_int_128; static PyObject *__pyx_int_129; static PyObject *__pyx_int_130; static PyObject *__pyx_int_131; static PyObject *__pyx_int_132; static PyObject *__pyx_int_133; static PyObject *__pyx_int_134; static PyObject *__pyx_int_135; static PyObject *__pyx_int_136; static PyObject *__pyx_int_137; static PyObject *__pyx_int_138; static PyObject *__pyx_int_139; static PyObject *__pyx_int_140; static PyObject *__pyx_int_141; static PyObject *__pyx_int_142; static PyObject *__pyx_int_143; static PyObject *__pyx_int_144; static PyObject *__pyx_int_145; static PyObject *__pyx_int_147; static PyObject *__pyx_int_148; static PyObject *__pyx_int_149; static PyObject *__pyx_int_150; static PyObject *__pyx_int_151; static PyObject *__pyx_int_152; static PyObject *__pyx_int_153; static PyObject *__pyx_int_154; static PyObject *__pyx_int_155; static PyObject *__pyx_int_156; static PyObject *__pyx_int_158; static PyObject *__pyx_int_159; static PyObject *__pyx_int_160; static PyObject *__pyx_int_161; static PyObject *__pyx_int_162; static PyObject *__pyx_int_163; static PyObject *__pyx_int_164; static PyObject *__pyx_int_165; static PyObject *__pyx_int_166; static PyObject *__pyx_int_167; static PyObject *__pyx_int_168; static PyObject *__pyx_int_169; static PyObject *__pyx_int_170; static PyObject *__pyx_int_171; static PyObject *__pyx_int_172; static PyObject *__pyx_int_173; static PyObject *__pyx_int_174; static PyObject *__pyx_int_175; static PyObject *__pyx_int_176; static PyObject *__pyx_int_177; static PyObject *__pyx_int_178; static PyObject *__pyx_int_179; static PyObject *__pyx_int_180; static PyObject *__pyx_int_181; static PyObject *__pyx_int_182; static PyObject *__pyx_int_183; static PyObject *__pyx_int_184; static PyObject *__pyx_int_185; static PyObject *__pyx_int_186; static PyObject *__pyx_int_187; static PyObject *__pyx_int_188; static PyObject *__pyx_int_189; static PyObject *__pyx_int_190; static PyObject *__pyx_int_191; static PyObject *__pyx_int_192; static PyObject *__pyx_int_193; static PyObject *__pyx_int_194; static PyObject *__pyx_int_196; static PyObject *__pyx_int_197; static PyObject *__pyx_int_198; static PyObject *__pyx_int_199; static PyObject *__pyx_int_200; static PyObject *__pyx_int_201; static PyObject *__pyx_int_202; static PyObject *__pyx_int_203; static PyObject *__pyx_int_204; static PyObject *__pyx_int_205; static PyObject *__pyx_int_206; static PyObject *__pyx_int_207; static PyObject *__pyx_int_208; static PyObject *__pyx_int_209; static PyObject *__pyx_int_210; static PyObject *__pyx_int_211; static PyObject *__pyx_int_212; static PyObject *__pyx_int_213; static PyObject *__pyx_int_214; static PyObject *__pyx_int_215; static PyObject *__pyx_int_216; static PyObject *__pyx_int_217; static PyObject *__pyx_int_218; static PyObject *__pyx_int_219; static PyObject *__pyx_int_220; static PyObject *__pyx_int_221; static PyObject *__pyx_int_222; static PyObject *__pyx_int_223; static PyObject *__pyx_int_224; static PyObject *__pyx_int_225; static PyObject *__pyx_int_226; static PyObject *__pyx_int_227; static PyObject *__pyx_int_228; static PyObject *__pyx_int_229; static PyObject *__pyx_int_230; static PyObject *__pyx_int_231; static PyObject *__pyx_int_232; static PyObject *__pyx_int_233; static PyObject *__pyx_int_235; static PyObject *__pyx_int_236; static PyObject *__pyx_int_237; static PyObject *__pyx_int_238; static PyObject *__pyx_int_239; static PyObject *__pyx_int_240; static PyObject *__pyx_int_242; static PyObject *__pyx_int_244; static PyObject *__pyx_int_245; static PyObject *__pyx_int_246; static PyObject *__pyx_int_247; static PyObject *__pyx_int_248; static PyObject *__pyx_int_250; static PyObject *__pyx_int_251; static PyObject *__pyx_int_252; static PyObject *__pyx_int_253; static PyObject *__pyx_int_255; static PyObject *__pyx_tuple_; static PyObject *__pyx_slice__5; static PyObject *__pyx_slice__7; static PyObject *__pyx_tuple__4; static PyObject *__pyx_tuple__6; static PyObject *__pyx_tuple__8; static PyObject *__pyx_tuple__10; static PyObject *__pyx_tuple__12; static PyObject *__pyx_tuple__13; static PyObject *__pyx_tuple__14; static PyObject *__pyx_tuple__15; static PyObject *__pyx_tuple__16; static PyObject *__pyx_tuple__17; static PyObject *__pyx_tuple__18; static PyObject *__pyx_tuple__19; static PyObject *__pyx_tuple__20; static PyObject *__pyx_tuple__21; static PyObject *__pyx_tuple__22; static PyObject *__pyx_tuple__23; static PyObject *__pyx_tuple__24; static PyObject *__pyx_tuple__25; static PyObject *__pyx_tuple__26; static PyObject *__pyx_tuple__27; static PyObject *__pyx_tuple__28; static PyObject *__pyx_tuple__29; static PyObject *__pyx_tuple__30; static PyObject *__pyx_tuple__31; static PyObject *__pyx_tuple__32; static PyObject *__pyx_tuple__33; static PyObject *__pyx_tuple__34; static PyObject *__pyx_tuple__35; static PyObject *__pyx_tuple__36; static PyObject *__pyx_tuple__37; static PyObject *__pyx_tuple__38; static PyObject *__pyx_tuple__39; static PyObject *__pyx_tuple__40; static PyObject *__pyx_tuple__41; static PyObject *__pyx_tuple__42; static PyObject *__pyx_tuple__43; static PyObject *__pyx_tuple__44; static PyObject *__pyx_tuple__45; static PyObject *__pyx_tuple__46; static PyObject *__pyx_tuple__47; static PyObject *__pyx_tuple__48; static PyObject *__pyx_tuple__49; static PyObject *__pyx_tuple__50; static PyObject *__pyx_tuple__51; static PyObject *__pyx_tuple__52; static PyObject *__pyx_tuple__53; static PyObject *__pyx_tuple__54; static PyObject *__pyx_tuple__55; static PyObject *__pyx_tuple__56; static PyObject *__pyx_tuple__57; static PyObject *__pyx_tuple__58; static PyObject *__pyx_tuple__59; static PyObject *__pyx_tuple__60; static PyObject *__pyx_tuple__61; static PyObject *__pyx_tuple__62; static PyObject *__pyx_tuple__63; static PyObject *__pyx_tuple__64; static PyObject *__pyx_tuple__65; static PyObject *__pyx_tuple__66; static PyObject *__pyx_tuple__67; static PyObject *__pyx_tuple__68; static PyObject *__pyx_tuple__69; static PyObject *__pyx_tuple__70; static PyObject *__pyx_tuple__71; static PyObject *__pyx_tuple__72; static PyObject *__pyx_tuple__73; static PyObject *__pyx_tuple__74; static PyObject *__pyx_tuple__75; static PyObject *__pyx_tuple__76; static PyObject *__pyx_tuple__77; static PyObject *__pyx_tuple__78; static PyObject *__pyx_tuple__79; static PyObject *__pyx_tuple__80; static PyObject *__pyx_tuple__81; static PyObject *__pyx_tuple__82; static PyObject *__pyx_tuple__83; static PyObject *__pyx_tuple__84; static PyObject *__pyx_tuple__85; static PyObject *__pyx_tuple__86; static PyObject *__pyx_tuple__87; static PyObject *__pyx_tuple__88; static PyObject *__pyx_tuple__89; static PyObject *__pyx_tuple__90; static PyObject *__pyx_tuple__91; static PyObject *__pyx_tuple__92; static PyObject *__pyx_tuple__93; static PyObject *__pyx_tuple__94; static PyObject *__pyx_tuple__95; static PyObject *__pyx_tuple__96; static PyObject *__pyx_tuple__97; static PyObject *__pyx_tuple__98; static PyObject *__pyx_tuple__99; static PyObject *__pyx_codeobj__9; static PyObject *__pyx_tuple__100; static PyObject *__pyx_tuple__101; static PyObject *__pyx_tuple__102; static PyObject *__pyx_tuple__103; static PyObject *__pyx_tuple__104; static PyObject *__pyx_tuple__105; static PyObject *__pyx_tuple__106; static PyObject *__pyx_tuple__107; static PyObject *__pyx_tuple__108; static PyObject *__pyx_tuple__109; static PyObject *__pyx_tuple__110; static PyObject *__pyx_tuple__111; static PyObject *__pyx_tuple__112; static PyObject *__pyx_tuple__113; static PyObject *__pyx_tuple__114; static PyObject *__pyx_tuple__115; static PyObject *__pyx_tuple__116; static PyObject *__pyx_tuple__117; static PyObject *__pyx_tuple__118; static PyObject *__pyx_tuple__119; static PyObject *__pyx_tuple__120; static PyObject *__pyx_tuple__121; static PyObject *__pyx_tuple__122; static PyObject *__pyx_tuple__123; static PyObject *__pyx_tuple__124; static PyObject *__pyx_tuple__125; static PyObject *__pyx_tuple__126; static PyObject *__pyx_tuple__127; static PyObject *__pyx_tuple__128; static PyObject *__pyx_tuple__129; static PyObject *__pyx_tuple__130; static PyObject *__pyx_tuple__131; static PyObject *__pyx_tuple__132; static PyObject *__pyx_tuple__133; static PyObject *__pyx_tuple__134; static PyObject *__pyx_tuple__135; static PyObject *__pyx_tuple__136; static PyObject *__pyx_tuple__137; static PyObject *__pyx_tuple__138; static PyObject *__pyx_tuple__139; static PyObject *__pyx_tuple__140; static PyObject *__pyx_tuple__141; static PyObject *__pyx_tuple__142; static PyObject *__pyx_tuple__143; static PyObject *__pyx_tuple__144; static PyObject *__pyx_tuple__145; static PyObject *__pyx_tuple__146; static PyObject *__pyx_tuple__147; static PyObject *__pyx_tuple__148; static PyObject *__pyx_tuple__149; static PyObject *__pyx_tuple__150; static PyObject *__pyx_tuple__151; static PyObject *__pyx_tuple__152; static PyObject *__pyx_tuple__153; static PyObject *__pyx_tuple__154; static PyObject *__pyx_tuple__155; static PyObject *__pyx_tuple__156; static PyObject *__pyx_tuple__157; static PyObject *__pyx_tuple__158; static PyObject *__pyx_tuple__159; static PyObject *__pyx_tuple__160; static PyObject *__pyx_tuple__161; static PyObject *__pyx_tuple__162; static PyObject *__pyx_tuple__163; static PyObject *__pyx_tuple__164; static PyObject *__pyx_tuple__165; static PyObject *__pyx_tuple__166; static PyObject *__pyx_tuple__167; static PyObject *__pyx_tuple__168; static PyObject *__pyx_tuple__169; static PyObject *__pyx_tuple__170; static PyObject *__pyx_tuple__171; static PyObject *__pyx_tuple__172; static PyObject *__pyx_tuple__173; static PyObject *__pyx_tuple__174; static PyObject *__pyx_tuple__175; static PyObject *__pyx_tuple__176; static PyObject *__pyx_tuple__177; static PyObject *__pyx_tuple__178; static PyObject *__pyx_tuple__179; static PyObject *__pyx_tuple__180; static PyObject *__pyx_tuple__181; static PyObject *__pyx_tuple__182; static PyObject *__pyx_tuple__183; static PyObject *__pyx_tuple__184; static PyObject *__pyx_tuple__185; static PyObject *__pyx_tuple__186; static PyObject *__pyx_tuple__187; static PyObject *__pyx_tuple__188; static PyObject *__pyx_tuple__189; static PyObject *__pyx_tuple__190; static PyObject *__pyx_tuple__191; static PyObject *__pyx_tuple__192; static PyObject *__pyx_tuple__193; static PyObject *__pyx_tuple__194; static PyObject *__pyx_tuple__195; static PyObject *__pyx_tuple__196; static PyObject *__pyx_tuple__197; static PyObject *__pyx_tuple__198; static PyObject *__pyx_tuple__199; static PyObject *__pyx_tuple__200; static PyObject *__pyx_tuple__201; static PyObject *__pyx_tuple__202; static PyObject *__pyx_tuple__203; static PyObject *__pyx_tuple__204; static PyObject *__pyx_tuple__205; static PyObject *__pyx_tuple__206; static PyObject *__pyx_tuple__207; static PyObject *__pyx_tuple__208; static PyObject *__pyx_tuple__209; static PyObject *__pyx_tuple__210; static PyObject *__pyx_tuple__211; static PyObject *__pyx_tuple__212; static PyObject *__pyx_tuple__213; static PyObject *__pyx_tuple__214; static PyObject *__pyx_tuple__215; static PyObject *__pyx_tuple__216; static PyObject *__pyx_tuple__217; static PyObject *__pyx_tuple__218; static PyObject *__pyx_tuple__219; static PyObject *__pyx_tuple__220; static PyObject *__pyx_tuple__221; static PyObject *__pyx_tuple__222; static PyObject *__pyx_tuple__223; static PyObject *__pyx_tuple__224; static PyObject *__pyx_tuple__225; static PyObject *__pyx_tuple__226; static PyObject *__pyx_tuple__227; static PyObject *__pyx_tuple__228; static PyObject *__pyx_tuple__229; static PyObject *__pyx_tuple__230; static PyObject *__pyx_tuple__231; static PyObject *__pyx_tuple__232; static PyObject *__pyx_tuple__233; static PyObject *__pyx_tuple__234; static PyObject *__pyx_tuple__235; static PyObject *__pyx_tuple__236; static PyObject *__pyx_tuple__237; static PyObject *__pyx_tuple__238; static PyObject *__pyx_tuple__239; static PyObject *__pyx_tuple__240; static PyObject *__pyx_tuple__241; static PyObject *__pyx_tuple__242; static PyObject *__pyx_tuple__243; static PyObject *__pyx_tuple__244; static PyObject *__pyx_tuple__245; static PyObject *__pyx_tuple__246; static PyObject *__pyx_tuple__247; static PyObject *__pyx_tuple__248; static PyObject *__pyx_tuple__249; static PyObject *__pyx_tuple__250; static PyObject *__pyx_tuple__251; static PyObject *__pyx_tuple__252; static PyObject *__pyx_tuple__253; static PyObject *__pyx_tuple__254; static PyObject *__pyx_tuple__255; static PyObject *__pyx_tuple__256; static PyObject *__pyx_tuple__257; static PyObject *__pyx_tuple__258; static PyObject *__pyx_tuple__259; static PyObject *__pyx_tuple__260; static PyObject *__pyx_tuple__261; static PyObject *__pyx_tuple__262; static PyObject *__pyx_tuple__263; static PyObject *__pyx_tuple__264; static PyObject *__pyx_tuple__265; static PyObject *__pyx_tuple__266; static PyObject *__pyx_tuple__267; static PyObject *__pyx_tuple__268; static PyObject *__pyx_tuple__269; static PyObject *__pyx_tuple__270; static PyObject *__pyx_tuple__271; static PyObject *__pyx_tuple__272; static PyObject *__pyx_tuple__273; static PyObject *__pyx_tuple__274; static PyObject *__pyx_tuple__275; static PyObject *__pyx_tuple__276; static PyObject *__pyx_tuple__277; static PyObject *__pyx_tuple__278; static PyObject *__pyx_tuple__279; static PyObject *__pyx_tuple__280; static PyObject *__pyx_tuple__281; static PyObject *__pyx_tuple__282; static PyObject *__pyx_tuple__283; static PyObject *__pyx_tuple__284; static PyObject *__pyx_tuple__285; static PyObject *__pyx_tuple__286; static PyObject *__pyx_tuple__287; static PyObject *__pyx_tuple__288; static PyObject *__pyx_tuple__289; static PyObject *__pyx_tuple__290; static PyObject *__pyx_tuple__291; static PyObject *__pyx_tuple__292; static PyObject *__pyx_tuple__293; static PyObject *__pyx_tuple__294; static PyObject *__pyx_tuple__295; static PyObject *__pyx_tuple__296; static PyObject *__pyx_tuple__297; static PyObject *__pyx_tuple__298; static PyObject *__pyx_tuple__299; static PyObject *__pyx_tuple__300; static PyObject *__pyx_tuple__301; static PyObject *__pyx_tuple__302; static PyObject *__pyx_tuple__303; static PyObject *__pyx_tuple__304; static PyObject *__pyx_tuple__305; static PyObject *__pyx_tuple__306; static PyObject *__pyx_tuple__307; static PyObject *__pyx_tuple__308; static PyObject *__pyx_tuple__309; static PyObject *__pyx_tuple__310; static PyObject *__pyx_tuple__311; static PyObject *__pyx_tuple__312; static PyObject *__pyx_tuple__313; static PyObject *__pyx_tuple__314; static PyObject *__pyx_tuple__315; static PyObject *__pyx_tuple__316; static PyObject *__pyx_tuple__317; static PyObject *__pyx_tuple__318; static PyObject *__pyx_tuple__319; static PyObject *__pyx_tuple__320; static PyObject *__pyx_tuple__321; static PyObject *__pyx_tuple__322; static PyObject *__pyx_tuple__323; static PyObject *__pyx_tuple__324; static PyObject *__pyx_tuple__325; static PyObject *__pyx_tuple__326; static PyObject *__pyx_tuple__327; static PyObject *__pyx_tuple__328; static PyObject *__pyx_tuple__329; static PyObject *__pyx_tuple__330; static PyObject *__pyx_tuple__331; static PyObject *__pyx_tuple__332; static PyObject *__pyx_tuple__333; static PyObject *__pyx_tuple__334; static PyObject *__pyx_tuple__335; static PyObject *__pyx_tuple__336; static PyObject *__pyx_tuple__337; static PyObject *__pyx_tuple__338; static PyObject *__pyx_tuple__339; static PyObject *__pyx_tuple__340; static PyObject *__pyx_tuple__341; static PyObject *__pyx_tuple__342; static PyObject *__pyx_tuple__343; static PyObject *__pyx_tuple__344; static PyObject *__pyx_tuple__345; static PyObject *__pyx_tuple__346; static PyObject *__pyx_tuple__347; static PyObject *__pyx_tuple__348; static PyObject *__pyx_tuple__349; static PyObject *__pyx_tuple__350; static PyObject *__pyx_tuple__351; static PyObject *__pyx_tuple__352; static PyObject *__pyx_tuple__353; static PyObject *__pyx_tuple__354; static PyObject *__pyx_tuple__355; static PyObject *__pyx_tuple__356; static PyObject *__pyx_tuple__357; static PyObject *__pyx_tuple__358; static PyObject *__pyx_tuple__359; static PyObject *__pyx_tuple__360; static PyObject *__pyx_tuple__361; static PyObject *__pyx_tuple__362; static PyObject *__pyx_tuple__363; static PyObject *__pyx_tuple__364; static PyObject *__pyx_tuple__365; static PyObject *__pyx_tuple__366; static PyObject *__pyx_tuple__367; static PyObject *__pyx_tuple__368; static PyObject *__pyx_tuple__369; static PyObject *__pyx_tuple__370; static PyObject *__pyx_tuple__371; static PyObject *__pyx_tuple__372; static PyObject *__pyx_tuple__373; static PyObject *__pyx_tuple__374; static PyObject *__pyx_tuple__375; static PyObject *__pyx_tuple__376; static PyObject *__pyx_tuple__377; static PyObject *__pyx_tuple__378; static PyObject *__pyx_tuple__379; static PyObject *__pyx_tuple__380; static PyObject *__pyx_tuple__381; static PyObject *__pyx_tuple__382; static PyObject *__pyx_tuple__383; static PyObject *__pyx_tuple__384; static PyObject *__pyx_tuple__385; static PyObject *__pyx_tuple__386; static PyObject *__pyx_tuple__387; static PyObject *__pyx_tuple__388; static PyObject *__pyx_tuple__389; static PyObject *__pyx_tuple__390; static PyObject *__pyx_tuple__391; static PyObject *__pyx_tuple__392; static PyObject *__pyx_tuple__393; static PyObject *__pyx_tuple__394; static PyObject *__pyx_tuple__395; static PyObject *__pyx_tuple__396; static PyObject *__pyx_tuple__397; static PyObject *__pyx_tuple__398; static PyObject *__pyx_tuple__399; static PyObject *__pyx_tuple__400; static PyObject *__pyx_tuple__401; static PyObject *__pyx_tuple__402; static PyObject *__pyx_tuple__403; static PyObject *__pyx_tuple__404; static PyObject *__pyx_tuple__405; static PyObject *__pyx_tuple__406; static PyObject *__pyx_tuple__407; static PyObject *__pyx_tuple__408; static PyObject *__pyx_tuple__409; static PyObject *__pyx_tuple__410; static PyObject *__pyx_tuple__411; static PyObject *__pyx_tuple__412; static PyObject *__pyx_tuple__413; static PyObject *__pyx_tuple__414; static PyObject *__pyx_tuple__415; static PyObject *__pyx_tuple__416; static PyObject *__pyx_tuple__417; static PyObject *__pyx_tuple__418; static PyObject *__pyx_tuple__419; static PyObject *__pyx_tuple__420; static PyObject *__pyx_tuple__421; static PyObject *__pyx_tuple__422; static PyObject *__pyx_tuple__423; static PyObject *__pyx_tuple__424; static PyObject *__pyx_tuple__425; static PyObject *__pyx_tuple__426; static PyObject *__pyx_tuple__427; static PyObject *__pyx_tuple__428; static PyObject *__pyx_tuple__429; static PyObject *__pyx_tuple__430; static PyObject *__pyx_tuple__431; static PyObject *__pyx_tuple__432; static PyObject *__pyx_tuple__433; static PyObject *__pyx_tuple__434; static PyObject *__pyx_tuple__435; static PyObject *__pyx_tuple__436; static PyObject *__pyx_tuple__437; static PyObject *__pyx_tuple__438; static PyObject *__pyx_tuple__439; static PyObject *__pyx_tuple__440; static PyObject *__pyx_tuple__441; static PyObject *__pyx_tuple__442; static PyObject *__pyx_tuple__443; static PyObject *__pyx_tuple__444; static PyObject *__pyx_tuple__445; static PyObject *__pyx_tuple__446; static PyObject *__pyx_tuple__447; static PyObject *__pyx_tuple__448; static PyObject *__pyx_tuple__449; static PyObject *__pyx_tuple__450; static PyObject *__pyx_tuple__451; static PyObject *__pyx_tuple__452; static PyObject *__pyx_tuple__453; static PyObject *__pyx_tuple__454; static PyObject *__pyx_tuple__455; static PyObject *__pyx_tuple__456; static PyObject *__pyx_tuple__457; static PyObject *__pyx_tuple__458; static PyObject *__pyx_tuple__459; static PyObject *__pyx_tuple__460; static PyObject *__pyx_tuple__461; static PyObject *__pyx_tuple__462; static PyObject *__pyx_tuple__463; static PyObject *__pyx_tuple__464; static PyObject *__pyx_tuple__465; static PyObject *__pyx_tuple__466; static PyObject *__pyx_tuple__467; static PyObject *__pyx_tuple__468; static PyObject *__pyx_tuple__469; static PyObject *__pyx_tuple__470; static PyObject *__pyx_tuple__471; static PyObject *__pyx_tuple__472; static PyObject *__pyx_tuple__473; static PyObject *__pyx_tuple__474; static PyObject *__pyx_tuple__475; static PyObject *__pyx_tuple__476; static PyObject *__pyx_tuple__477; static PyObject *__pyx_tuple__478; static PyObject *__pyx_tuple__479; static PyObject *__pyx_tuple__480; static PyObject *__pyx_tuple__481; static PyObject *__pyx_tuple__482; static PyObject *__pyx_tuple__483; static PyObject *__pyx_tuple__484; static PyObject *__pyx_tuple__485; static PyObject *__pyx_tuple__486; static PyObject *__pyx_tuple__487; static PyObject *__pyx_tuple__488; static PyObject *__pyx_tuple__489; static PyObject *__pyx_tuple__490; static PyObject *__pyx_tuple__491; static PyObject *__pyx_tuple__492; static PyObject *__pyx_tuple__493; static PyObject *__pyx_tuple__494; static PyObject *__pyx_tuple__495; static PyObject *__pyx_tuple__496; static PyObject *__pyx_tuple__497; static PyObject *__pyx_tuple__498; static PyObject *__pyx_tuple__499; static PyObject *__pyx_tuple__500; static PyObject *__pyx_tuple__501; static PyObject *__pyx_tuple__502; static PyObject *__pyx_tuple__503; static PyObject *__pyx_tuple__504; static PyObject *__pyx_tuple__505; static PyObject *__pyx_tuple__506; static PyObject *__pyx_tuple__507; static PyObject *__pyx_tuple__508; static PyObject *__pyx_tuple__509; static PyObject *__pyx_tuple__510; static PyObject *__pyx_tuple__511; static PyObject *__pyx_tuple__512; static PyObject *__pyx_tuple__513; static PyObject *__pyx_tuple__514; static PyObject *__pyx_tuple__515; static PyObject *__pyx_tuple__516; static PyObject *__pyx_tuple__517; static PyObject *__pyx_tuple__518; static PyObject *__pyx_tuple__519; static PyObject *__pyx_tuple__520; static PyObject *__pyx_tuple__521; static PyObject *__pyx_tuple__522; static PyObject *__pyx_tuple__523; static PyObject *__pyx_tuple__524; static PyObject *__pyx_tuple__525; static PyObject *__pyx_tuple__526; static PyObject *__pyx_tuple__527; static PyObject *__pyx_tuple__528; static PyObject *__pyx_tuple__529; static PyObject *__pyx_tuple__530; static PyObject *__pyx_tuple__531; static PyObject *__pyx_tuple__532; static PyObject *__pyx_tuple__533; static PyObject *__pyx_tuple__534; static PyObject *__pyx_tuple__535; static PyObject *__pyx_tuple__536; static PyObject *__pyx_tuple__537; static PyObject *__pyx_tuple__538; static PyObject *__pyx_tuple__539; static PyObject *__pyx_tuple__540; static PyObject *__pyx_tuple__541; static PyObject *__pyx_tuple__542; static PyObject *__pyx_tuple__543; static PyObject *__pyx_tuple__544; static PyObject *__pyx_tuple__545; static PyObject *__pyx_tuple__546; static PyObject *__pyx_tuple__547; static PyObject *__pyx_tuple__548; static PyObject *__pyx_tuple__549; static PyObject *__pyx_tuple__550; static PyObject *__pyx_tuple__551; static PyObject *__pyx_tuple__552; static PyObject *__pyx_tuple__553; static PyObject *__pyx_tuple__554; static PyObject *__pyx_tuple__555; static PyObject *__pyx_tuple__556; static PyObject *__pyx_tuple__557; static PyObject *__pyx_tuple__558; static PyObject *__pyx_tuple__559; static PyObject *__pyx_tuple__560; static PyObject *__pyx_tuple__561; static PyObject *__pyx_tuple__562; static PyObject *__pyx_tuple__563; static PyObject *__pyx_tuple__564; static PyObject *__pyx_tuple__565; static PyObject *__pyx_tuple__566; static PyObject *__pyx_tuple__567; static PyObject *__pyx_tuple__568; static PyObject *__pyx_tuple__569; static PyObject *__pyx_tuple__570; static PyObject *__pyx_tuple__571; static PyObject *__pyx_tuple__572; static PyObject *__pyx_tuple__573; static PyObject *__pyx_tuple__574; static PyObject *__pyx_tuple__575; static PyObject *__pyx_tuple__576; static PyObject *__pyx_tuple__577; static PyObject *__pyx_tuple__578; static PyObject *__pyx_tuple__579; static PyObject *__pyx_tuple__580; static PyObject *__pyx_tuple__581; static PyObject *__pyx_tuple__582; static PyObject *__pyx_tuple__583; static PyObject *__pyx_tuple__584; static PyObject *__pyx_tuple__585; static PyObject *__pyx_tuple__586; static PyObject *__pyx_tuple__587; static PyObject *__pyx_tuple__588; static PyObject *__pyx_tuple__589; static PyObject *__pyx_tuple__590; static PyObject *__pyx_tuple__591; static PyObject *__pyx_tuple__592; static PyObject *__pyx_tuple__593; static PyObject *__pyx_tuple__594; static PyObject *__pyx_tuple__595; static PyObject *__pyx_tuple__596; static PyObject *__pyx_tuple__597; static PyObject *__pyx_tuple__598; static PyObject *__pyx_tuple__599; static PyObject *__pyx_tuple__600; static PyObject *__pyx_tuple__601; static PyObject *__pyx_tuple__602; static PyObject *__pyx_tuple__603; static PyObject *__pyx_tuple__604; static PyObject *__pyx_tuple__605; static PyObject *__pyx_tuple__606; static PyObject *__pyx_tuple__607; static PyObject *__pyx_tuple__608; static PyObject *__pyx_tuple__609; static PyObject *__pyx_tuple__610; static PyObject *__pyx_tuple__611; static PyObject *__pyx_tuple__612; static PyObject *__pyx_tuple__613; static PyObject *__pyx_tuple__614; static PyObject *__pyx_tuple__615; static PyObject *__pyx_tuple__616; static PyObject *__pyx_tuple__617; static PyObject *__pyx_tuple__618; static PyObject *__pyx_tuple__619; static PyObject *__pyx_tuple__620; static PyObject *__pyx_tuple__621; static PyObject *__pyx_tuple__622; static PyObject *__pyx_tuple__623; static PyObject *__pyx_tuple__624; static PyObject *__pyx_tuple__625; static PyObject *__pyx_tuple__626; static PyObject *__pyx_tuple__627; static PyObject *__pyx_tuple__628; static PyObject *__pyx_tuple__629; static PyObject *__pyx_tuple__630; static PyObject *__pyx_tuple__631; static PyObject *__pyx_tuple__632; static PyObject *__pyx_tuple__633; static PyObject *__pyx_tuple__634; static PyObject *__pyx_tuple__635; static PyObject *__pyx_tuple__636; static PyObject *__pyx_tuple__637; static PyObject *__pyx_tuple__638; static PyObject *__pyx_tuple__639; static PyObject *__pyx_tuple__640; static PyObject *__pyx_tuple__641; static PyObject *__pyx_tuple__642; static PyObject *__pyx_tuple__643; static PyObject *__pyx_tuple__644; static PyObject *__pyx_tuple__645; static PyObject *__pyx_tuple__646; static PyObject *__pyx_tuple__647; static PyObject *__pyx_tuple__648; static PyObject *__pyx_tuple__649; static PyObject *__pyx_tuple__650; static PyObject *__pyx_tuple__651; static PyObject *__pyx_tuple__652; static PyObject *__pyx_tuple__653; static PyObject *__pyx_tuple__654; static PyObject *__pyx_tuple__655; static PyObject *__pyx_tuple__656; static PyObject *__pyx_tuple__657; static PyObject *__pyx_tuple__658; static PyObject *__pyx_tuple__659; static PyObject *__pyx_tuple__660; static PyObject *__pyx_tuple__661; static PyObject *__pyx_tuple__662; static PyObject *__pyx_tuple__663; static PyObject *__pyx_tuple__664; static PyObject *__pyx_tuple__665; static PyObject *__pyx_tuple__666; static PyObject *__pyx_tuple__667; static PyObject *__pyx_tuple__668; static PyObject *__pyx_tuple__669; static PyObject *__pyx_tuple__670; static PyObject *__pyx_tuple__671; static PyObject *__pyx_tuple__672; static PyObject *__pyx_tuple__673; static PyObject *__pyx_tuple__674; static PyObject *__pyx_tuple__675; static PyObject *__pyx_tuple__676; static PyObject *__pyx_tuple__677; static PyObject *__pyx_tuple__678; static PyObject *__pyx_tuple__679; static PyObject *__pyx_tuple__680; static PyObject *__pyx_tuple__681; static PyObject *__pyx_tuple__682; static PyObject *__pyx_tuple__683; static PyObject *__pyx_tuple__684; static PyObject *__pyx_tuple__685; static PyObject *__pyx_tuple__686; static PyObject *__pyx_tuple__687; static PyObject *__pyx_codeobj__11; /* "pygame_sdl2/color.pyx":26 * include "color_dict.pxi" * * cdef Uint32 map_color(SDL_Surface *surface, color) except? 0xaabbccdd: # <<<<<<<<<<<<<< * """ * Maps `color` into an RGBA color value that can be used with `surface`. */ static Uint32 __pyx_f_11pygame_sdl2_5color_map_color(SDL_Surface *__pyx_v_surface, PyObject *__pyx_v_color) { Uint8 __pyx_v_r; Uint8 __pyx_v_g; Uint8 __pyx_v_b; Uint8 __pyx_v_a; Uint32 __pyx_r; __Pyx_RefNannyDeclarations int __pyx_t_1; int __pyx_t_2; int __pyx_t_3; int __pyx_t_4; Py_ssize_t __pyx_t_5; PyObject *__pyx_t_6 = NULL; PyObject *__pyx_t_7 = NULL; PyObject *__pyx_t_8 = NULL; PyObject *__pyx_t_9 = NULL; PyObject *__pyx_t_10 = NULL; PyObject *(*__pyx_t_11)(PyObject *); Uint8 __pyx_t_12; Uint8 __pyx_t_13; Uint8 __pyx_t_14; Uint8 __pyx_t_15; Uint32 __pyx_t_16; __Pyx_RefNannySetupContext("map_color", 0); /* "pygame_sdl2/color.pyx":33 * cdef Uint8 r, g, b, a * * if isinstance(color, (tuple, list, Color)) and len(color) == 4: # <<<<<<<<<<<<<< * r, g, b, a = color * elif isinstance(color, (tuple, list, Color)) and len(color) == 3: */ __pyx_t_3 = PyTuple_Check(__pyx_v_color); __pyx_t_4 = (__pyx_t_3 != 0); if (!__pyx_t_4) { } else { __pyx_t_2 = __pyx_t_4; goto __pyx_L6_bool_binop_done; } __pyx_t_4 = PyList_Check(__pyx_v_color); __pyx_t_3 = (__pyx_t_4 != 0); if (!__pyx_t_3) { } else { __pyx_t_2 = __pyx_t_3; goto __pyx_L6_bool_binop_done; } __pyx_t_3 = __Pyx_TypeCheck(__pyx_v_color, __pyx_ptype_11pygame_sdl2_5color_Color); __pyx_t_4 = (__pyx_t_3 != 0); __pyx_t_2 = __pyx_t_4; __pyx_L6_bool_binop_done:; __pyx_t_4 = (__pyx_t_2 != 0); if (__pyx_t_4) { } else { __pyx_t_1 = __pyx_t_4; goto __pyx_L4_bool_binop_done; } __pyx_t_5 = PyObject_Length(__pyx_v_color); if (unlikely(__pyx_t_5 == -1)) __PYX_ERR(0, 33, __pyx_L1_error) __pyx_t_4 = ((__pyx_t_5 == 4) != 0); __pyx_t_1 = __pyx_t_4; __pyx_L4_bool_binop_done:; if (__pyx_t_1) { /* "pygame_sdl2/color.pyx":34 * * if isinstance(color, (tuple, list, Color)) and len(color) == 4: * r, g, b, a = color # <<<<<<<<<<<<<< * elif isinstance(color, (tuple, list, Color)) and len(color) == 3: * r, g, b = color */ if ((likely(PyTuple_CheckExact(__pyx_v_color))) || (PyList_CheckExact(__pyx_v_color))) { PyObject* sequence = __pyx_v_color; #if CYTHON_COMPILING_IN_CPYTHON Py_ssize_t size = Py_SIZE(sequence); #else Py_ssize_t size = PySequence_Size(sequence); #endif if (unlikely(size != 4)) { if (size > 4) __Pyx_RaiseTooManyValuesError(4); else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); __PYX_ERR(0, 34, __pyx_L1_error) } #if CYTHON_COMPILING_IN_CPYTHON if (likely(PyTuple_CheckExact(sequence))) { __pyx_t_6 = PyTuple_GET_ITEM(sequence, 0); __pyx_t_7 = PyTuple_GET_ITEM(sequence, 1); __pyx_t_8 = PyTuple_GET_ITEM(sequence, 2); __pyx_t_9 = PyTuple_GET_ITEM(sequence, 3); } else { __pyx_t_6 = PyList_GET_ITEM(sequence, 0); __pyx_t_7 = PyList_GET_ITEM(sequence, 1); __pyx_t_8 = PyList_GET_ITEM(sequence, 2); __pyx_t_9 = PyList_GET_ITEM(sequence, 3); } __Pyx_INCREF(__pyx_t_6); __Pyx_INCREF(__pyx_t_7); __Pyx_INCREF(__pyx_t_8); __Pyx_INCREF(__pyx_t_9); #else { Py_ssize_t i; PyObject** temps[4] = {&__pyx_t_6,&__pyx_t_7,&__pyx_t_8,&__pyx_t_9}; for (i=0; i < 4; i++) { PyObject* item = PySequence_ITEM(sequence, i); if (unlikely(!item)) __PYX_ERR(0, 34, __pyx_L1_error) __Pyx_GOTREF(item); *(temps[i]) = item; } } #endif } else { Py_ssize_t index = -1; PyObject** temps[4] = {&__pyx_t_6,&__pyx_t_7,&__pyx_t_8,&__pyx_t_9}; __pyx_t_10 = PyObject_GetIter(__pyx_v_color); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 34, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_10); __pyx_t_11 = Py_TYPE(__pyx_t_10)->tp_iternext; for (index=0; index < 4; index++) { PyObject* item = __pyx_t_11(__pyx_t_10); if (unlikely(!item)) goto __pyx_L9_unpacking_failed; __Pyx_GOTREF(item); *(temps[index]) = item; } if (__Pyx_IternextUnpackEndCheck(__pyx_t_11(__pyx_t_10), 4) < 0) __PYX_ERR(0, 34, __pyx_L1_error) __pyx_t_11 = NULL; __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; goto __pyx_L10_unpacking_done; __pyx_L9_unpacking_failed:; __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; __pyx_t_11 = NULL; if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); __PYX_ERR(0, 34, __pyx_L1_error) __pyx_L10_unpacking_done:; } __pyx_t_12 = __Pyx_PyInt_As_uint8_t(__pyx_t_6); if (unlikely((__pyx_t_12 == (Uint8)-1) && PyErr_Occurred())) __PYX_ERR(0, 34, __pyx_L1_error) __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __pyx_t_13 = __Pyx_PyInt_As_uint8_t(__pyx_t_7); if (unlikely((__pyx_t_13 == (Uint8)-1) && PyErr_Occurred())) __PYX_ERR(0, 34, __pyx_L1_error) __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __pyx_t_14 = __Pyx_PyInt_As_uint8_t(__pyx_t_8); if (unlikely((__pyx_t_14 == (Uint8)-1) && PyErr_Occurred())) __PYX_ERR(0, 34, __pyx_L1_error) __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; __pyx_t_15 = __Pyx_PyInt_As_uint8_t(__pyx_t_9); if (unlikely((__pyx_t_15 == (Uint8)-1) && PyErr_Occurred())) __PYX_ERR(0, 34, __pyx_L1_error) __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; __pyx_v_r = __pyx_t_12; __pyx_v_g = __pyx_t_13; __pyx_v_b = __pyx_t_14; __pyx_v_a = __pyx_t_15; /* "pygame_sdl2/color.pyx":33 * cdef Uint8 r, g, b, a * * if isinstance(color, (tuple, list, Color)) and len(color) == 4: # <<<<<<<<<<<<<< * r, g, b, a = color * elif isinstance(color, (tuple, list, Color)) and len(color) == 3: */ goto __pyx_L3; } /* "pygame_sdl2/color.pyx":35 * if isinstance(color, (tuple, list, Color)) and len(color) == 4: * r, g, b, a = color * elif isinstance(color, (tuple, list, Color)) and len(color) == 3: # <<<<<<<<<<<<<< * r, g, b = color * a = 255 */ __pyx_t_2 = PyTuple_Check(__pyx_v_color); __pyx_t_3 = (__pyx_t_2 != 0); if (!__pyx_t_3) { } else { __pyx_t_4 = __pyx_t_3; goto __pyx_L13_bool_binop_done; } __pyx_t_3 = PyList_Check(__pyx_v_color); __pyx_t_2 = (__pyx_t_3 != 0); if (!__pyx_t_2) { } else { __pyx_t_4 = __pyx_t_2; goto __pyx_L13_bool_binop_done; } __pyx_t_2 = __Pyx_TypeCheck(__pyx_v_color, __pyx_ptype_11pygame_sdl2_5color_Color); __pyx_t_3 = (__pyx_t_2 != 0); __pyx_t_4 = __pyx_t_3; __pyx_L13_bool_binop_done:; __pyx_t_3 = (__pyx_t_4 != 0); if (__pyx_t_3) { } else { __pyx_t_1 = __pyx_t_3; goto __pyx_L11_bool_binop_done; } __pyx_t_5 = PyObject_Length(__pyx_v_color); if (unlikely(__pyx_t_5 == -1)) __PYX_ERR(0, 35, __pyx_L1_error) __pyx_t_3 = ((__pyx_t_5 == 3) != 0); __pyx_t_1 = __pyx_t_3; __pyx_L11_bool_binop_done:; if (__pyx_t_1) { /* "pygame_sdl2/color.pyx":36 * r, g, b, a = color * elif isinstance(color, (tuple, list, Color)) and len(color) == 3: * r, g, b = color # <<<<<<<<<<<<<< * a = 255 * elif isinstance(color, int): */ if ((likely(PyTuple_CheckExact(__pyx_v_color))) || (PyList_CheckExact(__pyx_v_color))) { PyObject* sequence = __pyx_v_color; #if CYTHON_COMPILING_IN_CPYTHON Py_ssize_t size = Py_SIZE(sequence); #else Py_ssize_t size = PySequence_Size(sequence); #endif if (unlikely(size != 3)) { if (size > 3) __Pyx_RaiseTooManyValuesError(3); else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); __PYX_ERR(0, 36, __pyx_L1_error) } #if CYTHON_COMPILING_IN_CPYTHON if (likely(PyTuple_CheckExact(sequence))) { __pyx_t_9 = PyTuple_GET_ITEM(sequence, 0); __pyx_t_8 = PyTuple_GET_ITEM(sequence, 1); __pyx_t_7 = PyTuple_GET_ITEM(sequence, 2); } else { __pyx_t_9 = PyList_GET_ITEM(sequence, 0); __pyx_t_8 = PyList_GET_ITEM(sequence, 1); __pyx_t_7 = PyList_GET_ITEM(sequence, 2); } __Pyx_INCREF(__pyx_t_9); __Pyx_INCREF(__pyx_t_8); __Pyx_INCREF(__pyx_t_7); #else __pyx_t_9 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 36, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); __pyx_t_8 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 36, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __pyx_t_7 = PySequence_ITEM(sequence, 2); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 36, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); #endif } else { Py_ssize_t index = -1; __pyx_t_6 = PyObject_GetIter(__pyx_v_color); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 36, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __pyx_t_11 = Py_TYPE(__pyx_t_6)->tp_iternext; index = 0; __pyx_t_9 = __pyx_t_11(__pyx_t_6); if (unlikely(!__pyx_t_9)) goto __pyx_L16_unpacking_failed; __Pyx_GOTREF(__pyx_t_9); index = 1; __pyx_t_8 = __pyx_t_11(__pyx_t_6); if (unlikely(!__pyx_t_8)) goto __pyx_L16_unpacking_failed; __Pyx_GOTREF(__pyx_t_8); index = 2; __pyx_t_7 = __pyx_t_11(__pyx_t_6); if (unlikely(!__pyx_t_7)) goto __pyx_L16_unpacking_failed; __Pyx_GOTREF(__pyx_t_7); if (__Pyx_IternextUnpackEndCheck(__pyx_t_11(__pyx_t_6), 3) < 0) __PYX_ERR(0, 36, __pyx_L1_error) __pyx_t_11 = NULL; __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; goto __pyx_L17_unpacking_done; __pyx_L16_unpacking_failed:; __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __pyx_t_11 = NULL; if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); __PYX_ERR(0, 36, __pyx_L1_error) __pyx_L17_unpacking_done:; } __pyx_t_15 = __Pyx_PyInt_As_uint8_t(__pyx_t_9); if (unlikely((__pyx_t_15 == (Uint8)-1) && PyErr_Occurred())) __PYX_ERR(0, 36, __pyx_L1_error) __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; __pyx_t_14 = __Pyx_PyInt_As_uint8_t(__pyx_t_8); if (unlikely((__pyx_t_14 == (Uint8)-1) && PyErr_Occurred())) __PYX_ERR(0, 36, __pyx_L1_error) __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; __pyx_t_13 = __Pyx_PyInt_As_uint8_t(__pyx_t_7); if (unlikely((__pyx_t_13 == (Uint8)-1) && PyErr_Occurred())) __PYX_ERR(0, 36, __pyx_L1_error) __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __pyx_v_r = __pyx_t_15; __pyx_v_g = __pyx_t_14; __pyx_v_b = __pyx_t_13; /* "pygame_sdl2/color.pyx":37 * elif isinstance(color, (tuple, list, Color)) and len(color) == 3: * r, g, b = color * a = 255 # <<<<<<<<<<<<<< * elif isinstance(color, int): * return color */ __pyx_v_a = 0xFF; /* "pygame_sdl2/color.pyx":35 * if isinstance(color, (tuple, list, Color)) and len(color) == 4: * r, g, b, a = color * elif isinstance(color, (tuple, list, Color)) and len(color) == 3: # <<<<<<<<<<<<<< * r, g, b = color * a = 255 */ goto __pyx_L3; } /* "pygame_sdl2/color.pyx":38 * r, g, b = color * a = 255 * elif isinstance(color, int): # <<<<<<<<<<<<<< * return color * else: */ __pyx_t_1 = PyInt_Check(__pyx_v_color); __pyx_t_3 = (__pyx_t_1 != 0); if (__pyx_t_3) { /* "pygame_sdl2/color.pyx":39 * a = 255 * elif isinstance(color, int): * return color # <<<<<<<<<<<<<< * else: * raise TypeError("Expected a color.") */ __pyx_t_16 = __Pyx_PyInt_As_uint32_t(__pyx_v_color); if (unlikely((__pyx_t_16 == (Uint32)-1) && PyErr_Occurred())) __PYX_ERR(0, 39, __pyx_L1_error) __pyx_r = __pyx_t_16; goto __pyx_L0; /* "pygame_sdl2/color.pyx":38 * r, g, b = color * a = 255 * elif isinstance(color, int): # <<<<<<<<<<<<<< * return color * else: */ } /* "pygame_sdl2/color.pyx":41 * return color * else: * raise TypeError("Expected a color.") # <<<<<<<<<<<<<< * * return SDL_MapRGBA(surface.format, r, g, b, a) */ /*else*/ { __pyx_t_7 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple_, NULL); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 41, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_Raise(__pyx_t_7, 0, 0, 0); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __PYX_ERR(0, 41, __pyx_L1_error) } __pyx_L3:; /* "pygame_sdl2/color.pyx":43 * raise TypeError("Expected a color.") * * return SDL_MapRGBA(surface.format, r, g, b, a) # <<<<<<<<<<<<<< * * cdef object get_color(Uint32 pixel, SDL_Surface *surface): */ __pyx_r = SDL_MapRGBA(__pyx_v_surface->format, __pyx_v_r, __pyx_v_g, __pyx_v_b, __pyx_v_a); goto __pyx_L0; /* "pygame_sdl2/color.pyx":26 * include "color_dict.pxi" * * cdef Uint32 map_color(SDL_Surface *surface, color) except? 0xaabbccdd: # <<<<<<<<<<<<<< * """ * Maps `color` into an RGBA color value that can be used with `surface`. */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_6); __Pyx_XDECREF(__pyx_t_7); __Pyx_XDECREF(__pyx_t_8); __Pyx_XDECREF(__pyx_t_9); __Pyx_XDECREF(__pyx_t_10); __Pyx_AddTraceback("pygame_sdl2.color.map_color", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0xaabbccdd; __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/color.pyx":45 * return SDL_MapRGBA(surface.format, r, g, b, a) * * cdef object get_color(Uint32 pixel, SDL_Surface *surface): # <<<<<<<<<<<<<< * cdef Uint8 r * cdef Uint8 g */ static PyObject *__pyx_f_11pygame_sdl2_5color_get_color(Uint32 __pyx_v_pixel, SDL_Surface *__pyx_v_surface) { Uint8 __pyx_v_r; Uint8 __pyx_v_g; Uint8 __pyx_v_b; Uint8 __pyx_v_a; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; PyObject *__pyx_t_5 = NULL; __Pyx_RefNannySetupContext("get_color", 0); /* "pygame_sdl2/color.pyx":51 * cdef Uint8 a * * SDL_GetRGBA(pixel, surface.format, &r, &g, &b, &a) # <<<<<<<<<<<<<< * * return Color(r, g, b, a) */ SDL_GetRGBA(__pyx_v_pixel, __pyx_v_surface->format, (&__pyx_v_r), (&__pyx_v_g), (&__pyx_v_b), (&__pyx_v_a)); /* "pygame_sdl2/color.pyx":53 * SDL_GetRGBA(pixel, surface.format, &r, &g, &b, &a) * * return Color(r, g, b, a) # <<<<<<<<<<<<<< * * cdef to_sdl_color(color, SDL_Color *out): */ __Pyx_XDECREF(__pyx_r); __pyx_t_1 = __Pyx_PyInt_From_uint8_t(__pyx_v_r); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 53, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = __Pyx_PyInt_From_uint8_t(__pyx_v_g); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 53, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = __Pyx_PyInt_From_uint8_t(__pyx_v_b); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 53, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = __Pyx_PyInt_From_uint8_t(__pyx_v_a); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 53, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_5 = PyTuple_New(4); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 53, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_GIVEREF(__pyx_t_1); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_1); __Pyx_GIVEREF(__pyx_t_2); PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_t_2); __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_5, 2, __pyx_t_3); __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_5, 3, __pyx_t_4); __pyx_t_1 = 0; __pyx_t_2 = 0; __pyx_t_3 = 0; __pyx_t_4 = 0; __pyx_t_4 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_11pygame_sdl2_5color_Color), __pyx_t_5, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 53, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __pyx_r = __pyx_t_4; __pyx_t_4 = 0; goto __pyx_L0; /* "pygame_sdl2/color.pyx":45 * return SDL_MapRGBA(surface.format, r, g, b, a) * * cdef object get_color(Uint32 pixel, SDL_Surface *surface): # <<<<<<<<<<<<<< * cdef Uint8 r * cdef Uint8 g */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_5); __Pyx_AddTraceback("pygame_sdl2.color.get_color", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/color.pyx":55 * return Color(r, g, b, a) * * cdef to_sdl_color(color, SDL_Color *out): # <<<<<<<<<<<<<< * if not isinstance(color, Color): * color = Color(color) */ static PyObject *__pyx_f_11pygame_sdl2_5color_to_sdl_color(PyObject *__pyx_v_color, SDL_Color *__pyx_v_out) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; int __pyx_t_2; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; Uint8 __pyx_t_5; __Pyx_RefNannySetupContext("to_sdl_color", 0); __Pyx_INCREF(__pyx_v_color); /* "pygame_sdl2/color.pyx":56 * * cdef to_sdl_color(color, SDL_Color *out): * if not isinstance(color, Color): # <<<<<<<<<<<<<< * color = Color(color) * out.r = color.r */ __pyx_t_1 = __Pyx_TypeCheck(__pyx_v_color, __pyx_ptype_11pygame_sdl2_5color_Color); __pyx_t_2 = ((!(__pyx_t_1 != 0)) != 0); if (__pyx_t_2) { /* "pygame_sdl2/color.pyx":57 * cdef to_sdl_color(color, SDL_Color *out): * if not isinstance(color, Color): * color = Color(color) # <<<<<<<<<<<<<< * out.r = color.r * out.g = color.g */ __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 57, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_INCREF(__pyx_v_color); __Pyx_GIVEREF(__pyx_v_color); PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_color); __pyx_t_4 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_11pygame_sdl2_5color_Color), __pyx_t_3, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 57, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF_SET(__pyx_v_color, __pyx_t_4); __pyx_t_4 = 0; /* "pygame_sdl2/color.pyx":56 * * cdef to_sdl_color(color, SDL_Color *out): * if not isinstance(color, Color): # <<<<<<<<<<<<<< * color = Color(color) * out.r = color.r */ } /* "pygame_sdl2/color.pyx":58 * if not isinstance(color, Color): * color = Color(color) * out.r = color.r # <<<<<<<<<<<<<< * out.g = color.g * out.b = color.b */ __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_color, __pyx_n_s_r); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 58, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_5 = __Pyx_PyInt_As_uint8_t(__pyx_t_4); if (unlikely((__pyx_t_5 == (Uint8)-1) && PyErr_Occurred())) __PYX_ERR(0, 58, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_v_out->r = __pyx_t_5; /* "pygame_sdl2/color.pyx":59 * color = Color(color) * out.r = color.r * out.g = color.g # <<<<<<<<<<<<<< * out.b = color.b * out.a = color.a */ __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_color, __pyx_n_s_g); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 59, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_5 = __Pyx_PyInt_As_uint8_t(__pyx_t_4); if (unlikely((__pyx_t_5 == (Uint8)-1) && PyErr_Occurred())) __PYX_ERR(0, 59, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_v_out->g = __pyx_t_5; /* "pygame_sdl2/color.pyx":60 * out.r = color.r * out.g = color.g * out.b = color.b # <<<<<<<<<<<<<< * out.a = color.a * */ __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_color, __pyx_n_s_b); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 60, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_5 = __Pyx_PyInt_As_uint8_t(__pyx_t_4); if (unlikely((__pyx_t_5 == (Uint8)-1) && PyErr_Occurred())) __PYX_ERR(0, 60, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_v_out->b = __pyx_t_5; /* "pygame_sdl2/color.pyx":61 * out.g = color.g * out.b = color.b * out.a = color.a # <<<<<<<<<<<<<< * * cdef class Color: */ __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_color, __pyx_n_s_a); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 61, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_5 = __Pyx_PyInt_As_uint8_t(__pyx_t_4); if (unlikely((__pyx_t_5 == (Uint8)-1) && PyErr_Occurred())) __PYX_ERR(0, 61, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_v_out->a = __pyx_t_5; /* "pygame_sdl2/color.pyx":55 * return Color(r, g, b, a) * * cdef to_sdl_color(color, SDL_Color *out): # <<<<<<<<<<<<<< * if not isinstance(color, Color): * color = Color(color) */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_AddTraceback("pygame_sdl2.color.to_sdl_color", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XDECREF(__pyx_v_color); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/color.pyx":64 * * cdef class Color: * cdef from_rgba(self, Uint8 r, Uint8 g, Uint8 b, Uint8 a): # <<<<<<<<<<<<<< * self.r = r * self.g = g */ static PyObject *__pyx_f_11pygame_sdl2_5color_5Color_from_rgba(struct __pyx_obj_11pygame_sdl2_5color_Color *__pyx_v_self, Uint8 __pyx_v_r, Uint8 __pyx_v_g, Uint8 __pyx_v_b, Uint8 __pyx_v_a) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("from_rgba", 0); /* "pygame_sdl2/color.pyx":65 * cdef class Color: * cdef from_rgba(self, Uint8 r, Uint8 g, Uint8 b, Uint8 a): * self.r = r # <<<<<<<<<<<<<< * self.g = g * self.b = b */ __pyx_v_self->r = __pyx_v_r; /* "pygame_sdl2/color.pyx":66 * cdef from_rgba(self, Uint8 r, Uint8 g, Uint8 b, Uint8 a): * self.r = r * self.g = g # <<<<<<<<<<<<<< * self.b = b * self.a = a */ __pyx_v_self->g = __pyx_v_g; /* "pygame_sdl2/color.pyx":67 * self.r = r * self.g = g * self.b = b # <<<<<<<<<<<<<< * self.a = a * */ __pyx_v_self->b = __pyx_v_b; /* "pygame_sdl2/color.pyx":68 * self.g = g * self.b = b * self.a = a # <<<<<<<<<<<<<< * * cdef from_hex(self, c): */ __pyx_v_self->a = __pyx_v_a; /* "pygame_sdl2/color.pyx":64 * * cdef class Color: * cdef from_rgba(self, Uint8 r, Uint8 g, Uint8 b, Uint8 a): # <<<<<<<<<<<<<< * self.r = r * self.g = g */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/color.pyx":73 * # Handle short hex strings. * if len(c) == 3 or len(c) == 4: * c = "".join(map(lambda x: x*2, c)) # <<<<<<<<<<<<<< * * try: */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_5color_5Color_8from_hex_lambda(PyObject *__pyx_self, PyObject *__pyx_v_x); /*proto*/ static PyMethodDef __pyx_mdef_11pygame_sdl2_5color_5Color_8from_hex_lambda = {"lambda", (PyCFunction)__pyx_pw_11pygame_sdl2_5color_5Color_8from_hex_lambda, METH_O, 0}; static PyObject *__pyx_pw_11pygame_sdl2_5color_5Color_8from_hex_lambda(PyObject *__pyx_self, PyObject *__pyx_v_x) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("lambda (wrapper)", 0); __pyx_r = __pyx_lambda_funcdef_lambda(__pyx_self, ((PyObject *)__pyx_v_x)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_lambda_funcdef_lambda(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_x) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; __Pyx_RefNannySetupContext("lambda", 0); __Pyx_XDECREF(__pyx_r); __pyx_t_1 = PyNumber_Multiply(__pyx_v_x, __pyx_int_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 73, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("pygame_sdl2.color.Color.from_hex.lambda", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/color.pyx":70 * self.a = a * * cdef from_hex(self, c): # <<<<<<<<<<<<<< * # Handle short hex strings. * if len(c) == 3 or len(c) == 4: */ static PyObject *__pyx_f_11pygame_sdl2_5color_5Color_from_hex(struct __pyx_obj_11pygame_sdl2_5color_Color *__pyx_v_self, PyObject *__pyx_v_c) { PyObject *__pyx_v_r = NULL; PyObject *__pyx_v_g = NULL; PyObject *__pyx_v_b = NULL; PyObject *__pyx_v_a = NULL; CYTHON_UNUSED PyObject *__pyx_v_e = NULL; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; Py_ssize_t __pyx_t_2; int __pyx_t_3; PyObject *__pyx_t_4 = NULL; PyObject *__pyx_t_5 = NULL; PyObject *__pyx_t_6 = NULL; PyObject *__pyx_t_7 = NULL; PyObject *__pyx_t_8 = NULL; PyObject *__pyx_t_9 = NULL; PyObject *__pyx_t_10 = NULL; PyObject *__pyx_t_11 = NULL; PyObject *__pyx_t_12 = NULL; PyObject *(*__pyx_t_13)(PyObject *); int __pyx_t_14; int __pyx_t_15; char const *__pyx_t_16; PyObject *__pyx_t_17 = NULL; PyObject *__pyx_t_18 = NULL; PyObject *__pyx_t_19 = NULL; PyObject *__pyx_t_20 = NULL; PyObject *__pyx_t_21 = NULL; PyObject *__pyx_t_22 = NULL; Uint8 __pyx_t_23; Uint8 __pyx_t_24; Uint8 __pyx_t_25; Uint8 __pyx_t_26; __Pyx_RefNannySetupContext("from_hex", 0); __Pyx_INCREF(__pyx_v_c); /* "pygame_sdl2/color.pyx":72 * cdef from_hex(self, c): * # Handle short hex strings. * if len(c) == 3 or len(c) == 4: # <<<<<<<<<<<<<< * c = "".join(map(lambda x: x*2, c)) * */ __pyx_t_2 = PyObject_Length(__pyx_v_c); if (unlikely(__pyx_t_2 == -1)) __PYX_ERR(0, 72, __pyx_L1_error) __pyx_t_3 = ((__pyx_t_2 == 3) != 0); if (!__pyx_t_3) { } else { __pyx_t_1 = __pyx_t_3; goto __pyx_L4_bool_binop_done; } __pyx_t_2 = PyObject_Length(__pyx_v_c); if (unlikely(__pyx_t_2 == -1)) __PYX_ERR(0, 72, __pyx_L1_error) __pyx_t_3 = ((__pyx_t_2 == 4) != 0); __pyx_t_1 = __pyx_t_3; __pyx_L4_bool_binop_done:; if (__pyx_t_1) { /* "pygame_sdl2/color.pyx":73 * # Handle short hex strings. * if len(c) == 3 or len(c) == 4: * c = "".join(map(lambda x: x*2, c)) # <<<<<<<<<<<<<< * * try: */ __pyx_t_4 = __Pyx_CyFunction_NewEx(&__pyx_mdef_11pygame_sdl2_5color_5Color_8from_hex_lambda, 0, __pyx_n_s_Color_from_hex_locals_lambda, NULL, __pyx_n_s_pygame_sdl2_color, __pyx_d, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 73, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_5 = PyTuple_New(2); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 73, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_4); __Pyx_INCREF(__pyx_v_c); __Pyx_GIVEREF(__pyx_v_c); PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_v_c); __pyx_t_4 = 0; __pyx_t_4 = __Pyx_PyObject_Call(__pyx_builtin_map, __pyx_t_5, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 73, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __pyx_t_5 = PyUnicode_Join(__pyx_kp_u__2, __pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 73, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF_SET(__pyx_v_c, __pyx_t_5); __pyx_t_5 = 0; /* "pygame_sdl2/color.pyx":72 * cdef from_hex(self, c): * # Handle short hex strings. * if len(c) == 3 or len(c) == 4: # <<<<<<<<<<<<<< * c = "".join(map(lambda x: x*2, c)) * */ } /* "pygame_sdl2/color.pyx":75 * c = "".join(map(lambda x: x*2, c)) * * try: # <<<<<<<<<<<<<< * if len(c) == 6: * r, g, b = struct.unpack('BBB', binascii.unhexlify(c)) */ { __Pyx_PyThreadState_declare __Pyx_PyThreadState_assign __Pyx_ExceptionSave(&__pyx_t_6, &__pyx_t_7, &__pyx_t_8); __Pyx_XGOTREF(__pyx_t_6); __Pyx_XGOTREF(__pyx_t_7); __Pyx_XGOTREF(__pyx_t_8); /*try:*/ { /* "pygame_sdl2/color.pyx":76 * * try: * if len(c) == 6: # <<<<<<<<<<<<<< * r, g, b = struct.unpack('BBB', binascii.unhexlify(c)) * a = 255 */ __pyx_t_2 = PyObject_Length(__pyx_v_c); if (unlikely(__pyx_t_2 == -1)) __PYX_ERR(0, 76, __pyx_L6_error) __pyx_t_1 = ((__pyx_t_2 == 6) != 0); if (__pyx_t_1) { /* "pygame_sdl2/color.pyx":77 * try: * if len(c) == 6: * r, g, b = struct.unpack('BBB', binascii.unhexlify(c)) # <<<<<<<<<<<<<< * a = 255 * elif len(c) == 8: */ __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_struct); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 77, __pyx_L6_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_unpack); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 77, __pyx_L6_error) __Pyx_GOTREF(__pyx_t_9); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_t_10 = __Pyx_GetModuleGlobalName(__pyx_n_s_binascii); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 77, __pyx_L6_error) __Pyx_GOTREF(__pyx_t_10); __pyx_t_11 = __Pyx_PyObject_GetAttrStr(__pyx_t_10, __pyx_n_s_unhexlify); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 77, __pyx_L6_error) __Pyx_GOTREF(__pyx_t_11); __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; __pyx_t_10 = NULL; if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_11))) { __pyx_t_10 = PyMethod_GET_SELF(__pyx_t_11); if (likely(__pyx_t_10)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_11); __Pyx_INCREF(__pyx_t_10); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_11, function); } } if (!__pyx_t_10) { __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_t_11, __pyx_v_c); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 77, __pyx_L6_error) __Pyx_GOTREF(__pyx_t_4); } else { __pyx_t_12 = PyTuple_New(1+1); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 77, __pyx_L6_error) __Pyx_GOTREF(__pyx_t_12); __Pyx_GIVEREF(__pyx_t_10); PyTuple_SET_ITEM(__pyx_t_12, 0, __pyx_t_10); __pyx_t_10 = NULL; __Pyx_INCREF(__pyx_v_c); __Pyx_GIVEREF(__pyx_v_c); PyTuple_SET_ITEM(__pyx_t_12, 0+1, __pyx_v_c); __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_11, __pyx_t_12, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 77, __pyx_L6_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; } __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; __pyx_t_11 = NULL; __pyx_t_2 = 0; if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_9))) { __pyx_t_11 = PyMethod_GET_SELF(__pyx_t_9); if (likely(__pyx_t_11)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_9); __Pyx_INCREF(__pyx_t_11); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_9, function); __pyx_t_2 = 1; } } __pyx_t_12 = PyTuple_New(2+__pyx_t_2); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 77, __pyx_L6_error) __Pyx_GOTREF(__pyx_t_12); if (__pyx_t_11) { __Pyx_GIVEREF(__pyx_t_11); PyTuple_SET_ITEM(__pyx_t_12, 0, __pyx_t_11); __pyx_t_11 = NULL; } __Pyx_INCREF(__pyx_n_u_BBB); __Pyx_GIVEREF(__pyx_n_u_BBB); PyTuple_SET_ITEM(__pyx_t_12, 0+__pyx_t_2, __pyx_n_u_BBB); __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_12, 1+__pyx_t_2, __pyx_t_4); __pyx_t_4 = 0; __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_9, __pyx_t_12, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 77, __pyx_L6_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; if ((likely(PyTuple_CheckExact(__pyx_t_5))) || (PyList_CheckExact(__pyx_t_5))) { PyObject* sequence = __pyx_t_5; #if CYTHON_COMPILING_IN_CPYTHON Py_ssize_t size = Py_SIZE(sequence); #else Py_ssize_t size = PySequence_Size(sequence); #endif if (unlikely(size != 3)) { if (size > 3) __Pyx_RaiseTooManyValuesError(3); else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); __PYX_ERR(0, 77, __pyx_L6_error) } #if CYTHON_COMPILING_IN_CPYTHON if (likely(PyTuple_CheckExact(sequence))) { __pyx_t_9 = PyTuple_GET_ITEM(sequence, 0); __pyx_t_12 = PyTuple_GET_ITEM(sequence, 1); __pyx_t_4 = PyTuple_GET_ITEM(sequence, 2); } else { __pyx_t_9 = PyList_GET_ITEM(sequence, 0); __pyx_t_12 = PyList_GET_ITEM(sequence, 1); __pyx_t_4 = PyList_GET_ITEM(sequence, 2); } __Pyx_INCREF(__pyx_t_9); __Pyx_INCREF(__pyx_t_12); __Pyx_INCREF(__pyx_t_4); #else __pyx_t_9 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 77, __pyx_L6_error) __Pyx_GOTREF(__pyx_t_9); __pyx_t_12 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 77, __pyx_L6_error) __Pyx_GOTREF(__pyx_t_12); __pyx_t_4 = PySequence_ITEM(sequence, 2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 77, __pyx_L6_error) __Pyx_GOTREF(__pyx_t_4); #endif __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; } else { Py_ssize_t index = -1; __pyx_t_11 = PyObject_GetIter(__pyx_t_5); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 77, __pyx_L6_error) __Pyx_GOTREF(__pyx_t_11); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __pyx_t_13 = Py_TYPE(__pyx_t_11)->tp_iternext; index = 0; __pyx_t_9 = __pyx_t_13(__pyx_t_11); if (unlikely(!__pyx_t_9)) goto __pyx_L15_unpacking_failed; __Pyx_GOTREF(__pyx_t_9); index = 1; __pyx_t_12 = __pyx_t_13(__pyx_t_11); if (unlikely(!__pyx_t_12)) goto __pyx_L15_unpacking_failed; __Pyx_GOTREF(__pyx_t_12); index = 2; __pyx_t_4 = __pyx_t_13(__pyx_t_11); if (unlikely(!__pyx_t_4)) goto __pyx_L15_unpacking_failed; __Pyx_GOTREF(__pyx_t_4); if (__Pyx_IternextUnpackEndCheck(__pyx_t_13(__pyx_t_11), 3) < 0) __PYX_ERR(0, 77, __pyx_L6_error) __pyx_t_13 = NULL; __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; goto __pyx_L16_unpacking_done; __pyx_L15_unpacking_failed:; __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; __pyx_t_13 = NULL; if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); __PYX_ERR(0, 77, __pyx_L6_error) __pyx_L16_unpacking_done:; } __pyx_v_r = __pyx_t_9; __pyx_t_9 = 0; __pyx_v_g = __pyx_t_12; __pyx_t_12 = 0; __pyx_v_b = __pyx_t_4; __pyx_t_4 = 0; /* "pygame_sdl2/color.pyx":78 * if len(c) == 6: * r, g, b = struct.unpack('BBB', binascii.unhexlify(c)) * a = 255 # <<<<<<<<<<<<<< * elif len(c) == 8: * r, g, b, a = struct.unpack('BBBB', binascii.unhexlify(c)) */ __Pyx_INCREF(__pyx_int_255); __pyx_v_a = __pyx_int_255; /* "pygame_sdl2/color.pyx":76 * * try: * if len(c) == 6: # <<<<<<<<<<<<<< * r, g, b = struct.unpack('BBB', binascii.unhexlify(c)) * a = 255 */ goto __pyx_L14; } /* "pygame_sdl2/color.pyx":79 * r, g, b = struct.unpack('BBB', binascii.unhexlify(c)) * a = 255 * elif len(c) == 8: # <<<<<<<<<<<<<< * r, g, b, a = struct.unpack('BBBB', binascii.unhexlify(c)) * else: */ __pyx_t_2 = PyObject_Length(__pyx_v_c); if (unlikely(__pyx_t_2 == -1)) __PYX_ERR(0, 79, __pyx_L6_error) __pyx_t_1 = ((__pyx_t_2 == 8) != 0); if (__pyx_t_1) { /* "pygame_sdl2/color.pyx":80 * a = 255 * elif len(c) == 8: * r, g, b, a = struct.unpack('BBBB', binascii.unhexlify(c)) # <<<<<<<<<<<<<< * else: * raise ValueError(c) */ __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_struct); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 80, __pyx_L6_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_12 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_unpack); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 80, __pyx_L6_error) __Pyx_GOTREF(__pyx_t_12); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_t_9 = __Pyx_GetModuleGlobalName(__pyx_n_s_binascii); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 80, __pyx_L6_error) __Pyx_GOTREF(__pyx_t_9); __pyx_t_11 = __Pyx_PyObject_GetAttrStr(__pyx_t_9, __pyx_n_s_unhexlify); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 80, __pyx_L6_error) __Pyx_GOTREF(__pyx_t_11); __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; __pyx_t_9 = NULL; if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_11))) { __pyx_t_9 = PyMethod_GET_SELF(__pyx_t_11); if (likely(__pyx_t_9)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_11); __Pyx_INCREF(__pyx_t_9); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_11, function); } } if (!__pyx_t_9) { __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_t_11, __pyx_v_c); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 80, __pyx_L6_error) __Pyx_GOTREF(__pyx_t_4); } else { __pyx_t_10 = PyTuple_New(1+1); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 80, __pyx_L6_error) __Pyx_GOTREF(__pyx_t_10); __Pyx_GIVEREF(__pyx_t_9); PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_t_9); __pyx_t_9 = NULL; __Pyx_INCREF(__pyx_v_c); __Pyx_GIVEREF(__pyx_v_c); PyTuple_SET_ITEM(__pyx_t_10, 0+1, __pyx_v_c); __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_11, __pyx_t_10, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 80, __pyx_L6_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; } __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; __pyx_t_11 = NULL; __pyx_t_2 = 0; if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_12))) { __pyx_t_11 = PyMethod_GET_SELF(__pyx_t_12); if (likely(__pyx_t_11)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_12); __Pyx_INCREF(__pyx_t_11); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_12, function); __pyx_t_2 = 1; } } __pyx_t_10 = PyTuple_New(2+__pyx_t_2); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 80, __pyx_L6_error) __Pyx_GOTREF(__pyx_t_10); if (__pyx_t_11) { __Pyx_GIVEREF(__pyx_t_11); PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_t_11); __pyx_t_11 = NULL; } __Pyx_INCREF(__pyx_n_u_BBBB); __Pyx_GIVEREF(__pyx_n_u_BBBB); PyTuple_SET_ITEM(__pyx_t_10, 0+__pyx_t_2, __pyx_n_u_BBBB); __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_10, 1+__pyx_t_2, __pyx_t_4); __pyx_t_4 = 0; __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_12, __pyx_t_10, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 80, __pyx_L6_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; if ((likely(PyTuple_CheckExact(__pyx_t_5))) || (PyList_CheckExact(__pyx_t_5))) { PyObject* sequence = __pyx_t_5; #if CYTHON_COMPILING_IN_CPYTHON Py_ssize_t size = Py_SIZE(sequence); #else Py_ssize_t size = PySequence_Size(sequence); #endif if (unlikely(size != 4)) { if (size > 4) __Pyx_RaiseTooManyValuesError(4); else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); __PYX_ERR(0, 80, __pyx_L6_error) } #if CYTHON_COMPILING_IN_CPYTHON if (likely(PyTuple_CheckExact(sequence))) { __pyx_t_12 = PyTuple_GET_ITEM(sequence, 0); __pyx_t_10 = PyTuple_GET_ITEM(sequence, 1); __pyx_t_4 = PyTuple_GET_ITEM(sequence, 2); __pyx_t_11 = PyTuple_GET_ITEM(sequence, 3); } else { __pyx_t_12 = PyList_GET_ITEM(sequence, 0); __pyx_t_10 = PyList_GET_ITEM(sequence, 1); __pyx_t_4 = PyList_GET_ITEM(sequence, 2); __pyx_t_11 = PyList_GET_ITEM(sequence, 3); } __Pyx_INCREF(__pyx_t_12); __Pyx_INCREF(__pyx_t_10); __Pyx_INCREF(__pyx_t_4); __Pyx_INCREF(__pyx_t_11); #else { Py_ssize_t i; PyObject** temps[4] = {&__pyx_t_12,&__pyx_t_10,&__pyx_t_4,&__pyx_t_11}; for (i=0; i < 4; i++) { PyObject* item = PySequence_ITEM(sequence, i); if (unlikely(!item)) __PYX_ERR(0, 80, __pyx_L6_error) __Pyx_GOTREF(item); *(temps[i]) = item; } } #endif __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; } else { Py_ssize_t index = -1; PyObject** temps[4] = {&__pyx_t_12,&__pyx_t_10,&__pyx_t_4,&__pyx_t_11}; __pyx_t_9 = PyObject_GetIter(__pyx_t_5); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 80, __pyx_L6_error) __Pyx_GOTREF(__pyx_t_9); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __pyx_t_13 = Py_TYPE(__pyx_t_9)->tp_iternext; for (index=0; index < 4; index++) { PyObject* item = __pyx_t_13(__pyx_t_9); if (unlikely(!item)) goto __pyx_L17_unpacking_failed; __Pyx_GOTREF(item); *(temps[index]) = item; } if (__Pyx_IternextUnpackEndCheck(__pyx_t_13(__pyx_t_9), 4) < 0) __PYX_ERR(0, 80, __pyx_L6_error) __pyx_t_13 = NULL; __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; goto __pyx_L18_unpacking_done; __pyx_L17_unpacking_failed:; __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; __pyx_t_13 = NULL; if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); __PYX_ERR(0, 80, __pyx_L6_error) __pyx_L18_unpacking_done:; } __pyx_v_r = __pyx_t_12; __pyx_t_12 = 0; __pyx_v_g = __pyx_t_10; __pyx_t_10 = 0; __pyx_v_b = __pyx_t_4; __pyx_t_4 = 0; __pyx_v_a = __pyx_t_11; __pyx_t_11 = 0; /* "pygame_sdl2/color.pyx":79 * r, g, b = struct.unpack('BBB', binascii.unhexlify(c)) * a = 255 * elif len(c) == 8: # <<<<<<<<<<<<<< * r, g, b, a = struct.unpack('BBBB', binascii.unhexlify(c)) * else: */ goto __pyx_L14; } /* "pygame_sdl2/color.pyx":82 * r, g, b, a = struct.unpack('BBBB', binascii.unhexlify(c)) * else: * raise ValueError(c) # <<<<<<<<<<<<<< * except TypeError as e: * raise ValueError(c) */ /*else*/ { __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 82, __pyx_L6_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_INCREF(__pyx_v_c); __Pyx_GIVEREF(__pyx_v_c); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_v_c); __pyx_t_11 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_t_5, NULL); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 82, __pyx_L6_error) __Pyx_GOTREF(__pyx_t_11); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_Raise(__pyx_t_11, 0, 0, 0); __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; __PYX_ERR(0, 82, __pyx_L6_error) } __pyx_L14:; /* "pygame_sdl2/color.pyx":75 * c = "".join(map(lambda x: x*2, c)) * * try: # <<<<<<<<<<<<<< * if len(c) == 6: * r, g, b = struct.unpack('BBB', binascii.unhexlify(c)) */ } __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0; goto __pyx_L13_try_end; __pyx_L6_error:; __Pyx_PyThreadState_assign __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0; __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0; __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0; __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0; /* "pygame_sdl2/color.pyx":83 * else: * raise ValueError(c) * except TypeError as e: # <<<<<<<<<<<<<< * raise ValueError(c) * */ __pyx_t_14 = __Pyx_PyErr_ExceptionMatches(__pyx_builtin_TypeError); if (__pyx_t_14) { __Pyx_AddTraceback("pygame_sdl2.color.Color.from_hex", __pyx_clineno, __pyx_lineno, __pyx_filename); if (__Pyx_GetException(&__pyx_t_11, &__pyx_t_5, &__pyx_t_4) < 0) __PYX_ERR(0, 83, __pyx_L8_except_error) __Pyx_GOTREF(__pyx_t_11); __Pyx_GOTREF(__pyx_t_5); __Pyx_GOTREF(__pyx_t_4); __Pyx_INCREF(__pyx_t_5); __pyx_v_e = __pyx_t_5; /*try:*/ { /* "pygame_sdl2/color.pyx":84 * raise ValueError(c) * except TypeError as e: * raise ValueError(c) # <<<<<<<<<<<<<< * * self.from_rgba(r, g, b, a) */ __pyx_t_10 = PyTuple_New(1); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 84, __pyx_L24_error) __Pyx_GOTREF(__pyx_t_10); __Pyx_INCREF(__pyx_v_c); __Pyx_GIVEREF(__pyx_v_c); PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_v_c); __pyx_t_12 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_t_10, NULL); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 84, __pyx_L24_error) __Pyx_GOTREF(__pyx_t_12); __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; __Pyx_Raise(__pyx_t_12, 0, 0, 0); __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; __PYX_ERR(0, 84, __pyx_L24_error) } /* "pygame_sdl2/color.pyx":83 * else: * raise ValueError(c) * except TypeError as e: # <<<<<<<<<<<<<< * raise ValueError(c) * */ /*finally:*/ { /*exception exit:*/{ __Pyx_PyThreadState_declare __pyx_L24_error:; __pyx_t_17 = 0; __pyx_t_18 = 0; __pyx_t_19 = 0; __pyx_t_20 = 0; __pyx_t_21 = 0; __pyx_t_22 = 0; __Pyx_PyThreadState_assign __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0; __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0; __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0; if (PY_MAJOR_VERSION >= 3) __Pyx_ExceptionSwap(&__pyx_t_20, &__pyx_t_21, &__pyx_t_22); if ((PY_MAJOR_VERSION < 3) || unlikely(__Pyx_GetException(&__pyx_t_17, &__pyx_t_18, &__pyx_t_19) < 0)) __Pyx_ErrFetch(&__pyx_t_17, &__pyx_t_18, &__pyx_t_19); __Pyx_XGOTREF(__pyx_t_17); __Pyx_XGOTREF(__pyx_t_18); __Pyx_XGOTREF(__pyx_t_19); __Pyx_XGOTREF(__pyx_t_20); __Pyx_XGOTREF(__pyx_t_21); __Pyx_XGOTREF(__pyx_t_22); __pyx_t_14 = __pyx_lineno; __pyx_t_15 = __pyx_clineno; __pyx_t_16 = __pyx_filename; { __Pyx_DECREF(__pyx_v_e); __pyx_v_e = NULL; } __Pyx_PyThreadState_assign if (PY_MAJOR_VERSION >= 3) { __Pyx_XGIVEREF(__pyx_t_20); __Pyx_XGIVEREF(__pyx_t_21); __Pyx_XGIVEREF(__pyx_t_22); __Pyx_ExceptionReset(__pyx_t_20, __pyx_t_21, __pyx_t_22); } __Pyx_XGIVEREF(__pyx_t_17); __Pyx_XGIVEREF(__pyx_t_18); __Pyx_XGIVEREF(__pyx_t_19); __Pyx_ErrRestore(__pyx_t_17, __pyx_t_18, __pyx_t_19); __pyx_t_17 = 0; __pyx_t_18 = 0; __pyx_t_19 = 0; __pyx_t_20 = 0; __pyx_t_21 = 0; __pyx_t_22 = 0; __pyx_lineno = __pyx_t_14; __pyx_clineno = __pyx_t_15; __pyx_filename = __pyx_t_16; goto __pyx_L8_except_error; } } } goto __pyx_L8_except_error; __pyx_L8_except_error:; /* "pygame_sdl2/color.pyx":75 * c = "".join(map(lambda x: x*2, c)) * * try: # <<<<<<<<<<<<<< * if len(c) == 6: * r, g, b = struct.unpack('BBB', binascii.unhexlify(c)) */ __Pyx_PyThreadState_assign __Pyx_XGIVEREF(__pyx_t_6); __Pyx_XGIVEREF(__pyx_t_7); __Pyx_XGIVEREF(__pyx_t_8); __Pyx_ExceptionReset(__pyx_t_6, __pyx_t_7, __pyx_t_8); goto __pyx_L1_error; __pyx_L13_try_end:; } /* "pygame_sdl2/color.pyx":86 * raise ValueError(c) * * self.from_rgba(r, g, b, a) # <<<<<<<<<<<<<< * * cdef from_name(self, c): */ __pyx_t_23 = __Pyx_PyInt_As_uint8_t(__pyx_v_r); if (unlikely((__pyx_t_23 == (Uint8)-1) && PyErr_Occurred())) __PYX_ERR(0, 86, __pyx_L1_error) __pyx_t_24 = __Pyx_PyInt_As_uint8_t(__pyx_v_g); if (unlikely((__pyx_t_24 == (Uint8)-1) && PyErr_Occurred())) __PYX_ERR(0, 86, __pyx_L1_error) __pyx_t_25 = __Pyx_PyInt_As_uint8_t(__pyx_v_b); if (unlikely((__pyx_t_25 == (Uint8)-1) && PyErr_Occurred())) __PYX_ERR(0, 86, __pyx_L1_error) __pyx_t_26 = __Pyx_PyInt_As_uint8_t(__pyx_v_a); if (unlikely((__pyx_t_26 == (Uint8)-1) && PyErr_Occurred())) __PYX_ERR(0, 86, __pyx_L1_error) __pyx_t_4 = ((struct __pyx_vtabstruct_11pygame_sdl2_5color_Color *)__pyx_v_self->__pyx_vtab)->from_rgba(__pyx_v_self, __pyx_t_23, __pyx_t_24, __pyx_t_25, __pyx_t_26); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 86, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; /* "pygame_sdl2/color.pyx":70 * self.a = a * * cdef from_hex(self, c): # <<<<<<<<<<<<<< * # Handle short hex strings. * if len(c) == 3 or len(c) == 4: */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_5); __Pyx_XDECREF(__pyx_t_9); __Pyx_XDECREF(__pyx_t_10); __Pyx_XDECREF(__pyx_t_11); __Pyx_XDECREF(__pyx_t_12); __Pyx_AddTraceback("pygame_sdl2.color.Color.from_hex", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XDECREF(__pyx_v_r); __Pyx_XDECREF(__pyx_v_g); __Pyx_XDECREF(__pyx_v_b); __Pyx_XDECREF(__pyx_v_a); __Pyx_XDECREF(__pyx_v_e); __Pyx_XDECREF(__pyx_v_c); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/color.pyx":88 * self.from_rgba(r, g, b, a) * * cdef from_name(self, c): # <<<<<<<<<<<<<< * # Remove all whitespace. * c = "".join(c.split()).lower() */ static PyObject *__pyx_f_11pygame_sdl2_5color_5Color_from_name(struct __pyx_obj_11pygame_sdl2_5color_Color *__pyx_v_self, PyObject *__pyx_v_c) { PyObject *__pyx_v_r = NULL; PyObject *__pyx_v_g = NULL; PyObject *__pyx_v_b = NULL; CYTHON_UNUSED PyObject *__pyx_v_e = NULL; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; PyObject *__pyx_t_5 = NULL; PyObject *__pyx_t_6 = NULL; PyObject *__pyx_t_7 = NULL; PyObject *__pyx_t_8 = NULL; PyObject *(*__pyx_t_9)(PyObject *); int __pyx_t_10; int __pyx_t_11; char const *__pyx_t_12; PyObject *__pyx_t_13 = NULL; PyObject *__pyx_t_14 = NULL; PyObject *__pyx_t_15 = NULL; PyObject *__pyx_t_16 = NULL; PyObject *__pyx_t_17 = NULL; PyObject *__pyx_t_18 = NULL; Uint8 __pyx_t_19; Uint8 __pyx_t_20; Uint8 __pyx_t_21; __Pyx_RefNannySetupContext("from_name", 0); __Pyx_INCREF(__pyx_v_c); /* "pygame_sdl2/color.pyx":90 * cdef from_name(self, c): * # Remove all whitespace. * c = "".join(c.split()).lower() # <<<<<<<<<<<<<< * * try: */ __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_c, __pyx_n_s_split); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 90, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = NULL; if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_3))) { __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3); if (likely(__pyx_t_4)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); __Pyx_INCREF(__pyx_t_4); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_3, function); } } if (__pyx_t_4) { __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 90, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; } else { __pyx_t_2 = __Pyx_PyObject_CallNoArg(__pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 90, __pyx_L1_error) } __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_3 = PyUnicode_Join(__pyx_kp_u__2, __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 90, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_lower); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 90, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_3 = NULL; if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_2))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); if (likely(__pyx_t_3)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); } } if (__pyx_t_3) { __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 90, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } else { __pyx_t_1 = __Pyx_PyObject_CallNoArg(__pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 90, __pyx_L1_error) } __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF_SET(__pyx_v_c, __pyx_t_1); __pyx_t_1 = 0; /* "pygame_sdl2/color.pyx":92 * c = "".join(c.split()).lower() * * try: # <<<<<<<<<<<<<< * r, g, b = colors[c] * except KeyError as e: */ { __Pyx_PyThreadState_declare __Pyx_PyThreadState_assign __Pyx_ExceptionSave(&__pyx_t_5, &__pyx_t_6, &__pyx_t_7); __Pyx_XGOTREF(__pyx_t_5); __Pyx_XGOTREF(__pyx_t_6); __Pyx_XGOTREF(__pyx_t_7); /*try:*/ { /* "pygame_sdl2/color.pyx":93 * * try: * r, g, b = colors[c] # <<<<<<<<<<<<<< * except KeyError as e: * raise ValueError(c) */ __pyx_t_1 = PyObject_GetItem(__pyx_v_11pygame_sdl2_5color_colors, __pyx_v_c); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 93, __pyx_L3_error) __Pyx_GOTREF(__pyx_t_1); if ((likely(PyTuple_CheckExact(__pyx_t_1))) || (PyList_CheckExact(__pyx_t_1))) { PyObject* sequence = __pyx_t_1; #if CYTHON_COMPILING_IN_CPYTHON Py_ssize_t size = Py_SIZE(sequence); #else Py_ssize_t size = PySequence_Size(sequence); #endif if (unlikely(size != 3)) { if (size > 3) __Pyx_RaiseTooManyValuesError(3); else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); __PYX_ERR(0, 93, __pyx_L3_error) } #if CYTHON_COMPILING_IN_CPYTHON if (likely(PyTuple_CheckExact(sequence))) { __pyx_t_2 = PyTuple_GET_ITEM(sequence, 0); __pyx_t_3 = PyTuple_GET_ITEM(sequence, 1); __pyx_t_4 = PyTuple_GET_ITEM(sequence, 2); } else { __pyx_t_2 = PyList_GET_ITEM(sequence, 0); __pyx_t_3 = PyList_GET_ITEM(sequence, 1); __pyx_t_4 = PyList_GET_ITEM(sequence, 2); } __Pyx_INCREF(__pyx_t_2); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(__pyx_t_4); #else __pyx_t_2 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 93, __pyx_L3_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 93, __pyx_L3_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = PySequence_ITEM(sequence, 2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 93, __pyx_L3_error) __Pyx_GOTREF(__pyx_t_4); #endif __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; } else { Py_ssize_t index = -1; __pyx_t_8 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 93, __pyx_L3_error) __Pyx_GOTREF(__pyx_t_8); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_9 = Py_TYPE(__pyx_t_8)->tp_iternext; index = 0; __pyx_t_2 = __pyx_t_9(__pyx_t_8); if (unlikely(!__pyx_t_2)) goto __pyx_L11_unpacking_failed; __Pyx_GOTREF(__pyx_t_2); index = 1; __pyx_t_3 = __pyx_t_9(__pyx_t_8); if (unlikely(!__pyx_t_3)) goto __pyx_L11_unpacking_failed; __Pyx_GOTREF(__pyx_t_3); index = 2; __pyx_t_4 = __pyx_t_9(__pyx_t_8); if (unlikely(!__pyx_t_4)) goto __pyx_L11_unpacking_failed; __Pyx_GOTREF(__pyx_t_4); if (__Pyx_IternextUnpackEndCheck(__pyx_t_9(__pyx_t_8), 3) < 0) __PYX_ERR(0, 93, __pyx_L3_error) __pyx_t_9 = NULL; __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; goto __pyx_L12_unpacking_done; __pyx_L11_unpacking_failed:; __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; __pyx_t_9 = NULL; if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); __PYX_ERR(0, 93, __pyx_L3_error) __pyx_L12_unpacking_done:; } __pyx_v_r = __pyx_t_2; __pyx_t_2 = 0; __pyx_v_g = __pyx_t_3; __pyx_t_3 = 0; __pyx_v_b = __pyx_t_4; __pyx_t_4 = 0; /* "pygame_sdl2/color.pyx":92 * c = "".join(c.split()).lower() * * try: # <<<<<<<<<<<<<< * r, g, b = colors[c] * except KeyError as e: */ } __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; goto __pyx_L10_try_end; __pyx_L3_error:; __Pyx_PyThreadState_assign __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0; __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; /* "pygame_sdl2/color.pyx":94 * try: * r, g, b = colors[c] * except KeyError as e: # <<<<<<<<<<<<<< * raise ValueError(c) * self.from_rgba(r, g, b, 255) */ __pyx_t_10 = __Pyx_PyErr_ExceptionMatches(__pyx_builtin_KeyError); if (__pyx_t_10) { __Pyx_AddTraceback("pygame_sdl2.color.Color.from_name", __pyx_clineno, __pyx_lineno, __pyx_filename); if (__Pyx_GetException(&__pyx_t_1, &__pyx_t_4, &__pyx_t_3) < 0) __PYX_ERR(0, 94, __pyx_L5_except_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_GOTREF(__pyx_t_4); __Pyx_GOTREF(__pyx_t_3); __Pyx_INCREF(__pyx_t_4); __pyx_v_e = __pyx_t_4; /*try:*/ { /* "pygame_sdl2/color.pyx":95 * r, g, b = colors[c] * except KeyError as e: * raise ValueError(c) # <<<<<<<<<<<<<< * self.from_rgba(r, g, b, 255) * */ __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 95, __pyx_L18_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_INCREF(__pyx_v_c); __Pyx_GIVEREF(__pyx_v_c); PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_c); __pyx_t_8 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_t_2, NULL); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 95, __pyx_L18_error) __Pyx_GOTREF(__pyx_t_8); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_Raise(__pyx_t_8, 0, 0, 0); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; __PYX_ERR(0, 95, __pyx_L18_error) } /* "pygame_sdl2/color.pyx":94 * try: * r, g, b = colors[c] * except KeyError as e: # <<<<<<<<<<<<<< * raise ValueError(c) * self.from_rgba(r, g, b, 255) */ /*finally:*/ { /*exception exit:*/{ __Pyx_PyThreadState_declare __pyx_L18_error:; __pyx_t_13 = 0; __pyx_t_14 = 0; __pyx_t_15 = 0; __pyx_t_16 = 0; __pyx_t_17 = 0; __pyx_t_18 = 0; __Pyx_PyThreadState_assign __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0; if (PY_MAJOR_VERSION >= 3) __Pyx_ExceptionSwap(&__pyx_t_16, &__pyx_t_17, &__pyx_t_18); if ((PY_MAJOR_VERSION < 3) || unlikely(__Pyx_GetException(&__pyx_t_13, &__pyx_t_14, &__pyx_t_15) < 0)) __Pyx_ErrFetch(&__pyx_t_13, &__pyx_t_14, &__pyx_t_15); __Pyx_XGOTREF(__pyx_t_13); __Pyx_XGOTREF(__pyx_t_14); __Pyx_XGOTREF(__pyx_t_15); __Pyx_XGOTREF(__pyx_t_16); __Pyx_XGOTREF(__pyx_t_17); __Pyx_XGOTREF(__pyx_t_18); __pyx_t_10 = __pyx_lineno; __pyx_t_11 = __pyx_clineno; __pyx_t_12 = __pyx_filename; { __Pyx_DECREF(__pyx_v_e); __pyx_v_e = NULL; } __Pyx_PyThreadState_assign if (PY_MAJOR_VERSION >= 3) { __Pyx_XGIVEREF(__pyx_t_16); __Pyx_XGIVEREF(__pyx_t_17); __Pyx_XGIVEREF(__pyx_t_18); __Pyx_ExceptionReset(__pyx_t_16, __pyx_t_17, __pyx_t_18); } __Pyx_XGIVEREF(__pyx_t_13); __Pyx_XGIVEREF(__pyx_t_14); __Pyx_XGIVEREF(__pyx_t_15); __Pyx_ErrRestore(__pyx_t_13, __pyx_t_14, __pyx_t_15); __pyx_t_13 = 0; __pyx_t_14 = 0; __pyx_t_15 = 0; __pyx_t_16 = 0; __pyx_t_17 = 0; __pyx_t_18 = 0; __pyx_lineno = __pyx_t_10; __pyx_clineno = __pyx_t_11; __pyx_filename = __pyx_t_12; goto __pyx_L5_except_error; } } } goto __pyx_L5_except_error; __pyx_L5_except_error:; /* "pygame_sdl2/color.pyx":92 * c = "".join(c.split()).lower() * * try: # <<<<<<<<<<<<<< * r, g, b = colors[c] * except KeyError as e: */ __Pyx_PyThreadState_assign __Pyx_XGIVEREF(__pyx_t_5); __Pyx_XGIVEREF(__pyx_t_6); __Pyx_XGIVEREF(__pyx_t_7); __Pyx_ExceptionReset(__pyx_t_5, __pyx_t_6, __pyx_t_7); goto __pyx_L1_error; __pyx_L10_try_end:; } /* "pygame_sdl2/color.pyx":96 * except KeyError as e: * raise ValueError(c) * self.from_rgba(r, g, b, 255) # <<<<<<<<<<<<<< * * def __richcmp__(Color x, y, int op): */ __pyx_t_19 = __Pyx_PyInt_As_uint8_t(__pyx_v_r); if (unlikely((__pyx_t_19 == (Uint8)-1) && PyErr_Occurred())) __PYX_ERR(0, 96, __pyx_L1_error) __pyx_t_20 = __Pyx_PyInt_As_uint8_t(__pyx_v_g); if (unlikely((__pyx_t_20 == (Uint8)-1) && PyErr_Occurred())) __PYX_ERR(0, 96, __pyx_L1_error) __pyx_t_21 = __Pyx_PyInt_As_uint8_t(__pyx_v_b); if (unlikely((__pyx_t_21 == (Uint8)-1) && PyErr_Occurred())) __PYX_ERR(0, 96, __pyx_L1_error) __pyx_t_3 = ((struct __pyx_vtabstruct_11pygame_sdl2_5color_Color *)__pyx_v_self->__pyx_vtab)->from_rgba(__pyx_v_self, __pyx_t_19, __pyx_t_20, __pyx_t_21, 0xFF); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 96, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "pygame_sdl2/color.pyx":88 * self.from_rgba(r, g, b, a) * * cdef from_name(self, c): # <<<<<<<<<<<<<< * # Remove all whitespace. * c = "".join(c.split()).lower() */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_8); __Pyx_AddTraceback("pygame_sdl2.color.Color.from_name", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XDECREF(__pyx_v_r); __Pyx_XDECREF(__pyx_v_g); __Pyx_XDECREF(__pyx_v_b); __Pyx_XDECREF(__pyx_v_e); __Pyx_XDECREF(__pyx_v_c); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/color.pyx":98 * self.from_rgba(r, g, b, 255) * * def __richcmp__(Color x, y, int op): # <<<<<<<<<<<<<< * if op == 3: * return not (x == y) */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_5color_5Color_1__richcmp__(PyObject *__pyx_v_x, PyObject *__pyx_v_y, int __pyx_v_op); /*proto*/ static PyObject *__pyx_pw_11pygame_sdl2_5color_5Color_1__richcmp__(PyObject *__pyx_v_x, PyObject *__pyx_v_y, int __pyx_v_op) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__richcmp__ (wrapper)", 0); if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_x), __pyx_ptype_11pygame_sdl2_5color_Color, 1, "x", 0))) __PYX_ERR(0, 98, __pyx_L1_error) __pyx_r = __pyx_pf_11pygame_sdl2_5color_5Color___richcmp__(((struct __pyx_obj_11pygame_sdl2_5color_Color *)__pyx_v_x), ((PyObject *)__pyx_v_y), ((int)__pyx_v_op)); /* function exit code */ goto __pyx_L0; __pyx_L1_error:; __pyx_r = NULL; __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_5color_5Color___richcmp__(struct __pyx_obj_11pygame_sdl2_5color_Color *__pyx_v_x, PyObject *__pyx_v_y, int __pyx_v_op) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; PyObject *__pyx_t_2 = NULL; int __pyx_t_3; PyObject *__pyx_t_4 = NULL; PyObject *__pyx_t_5 = NULL; PyObject *__pyx_t_6 = NULL; __Pyx_RefNannySetupContext("__richcmp__", 0); __Pyx_INCREF(__pyx_v_y); /* "pygame_sdl2/color.pyx":99 * * def __richcmp__(Color x, y, int op): * if op == 3: # <<<<<<<<<<<<<< * return not (x == y) * */ __pyx_t_1 = ((__pyx_v_op == 3) != 0); if (__pyx_t_1) { /* "pygame_sdl2/color.pyx":100 * def __richcmp__(Color x, y, int op): * if op == 3: * return not (x == y) # <<<<<<<<<<<<<< * * if isinstance(y, tuple): */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = PyObject_RichCompare(((PyObject *)__pyx_v_x), __pyx_v_y, Py_EQ); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 100, __pyx_L1_error) __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(0, 100, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_2 = __Pyx_PyBool_FromLong((!__pyx_t_1)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 100, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; /* "pygame_sdl2/color.pyx":99 * * def __richcmp__(Color x, y, int op): * if op == 3: # <<<<<<<<<<<<<< * return not (x == y) * */ } /* "pygame_sdl2/color.pyx":102 * return not (x == y) * * if isinstance(y, tuple): # <<<<<<<<<<<<<< * y = Color(y) * if not isinstance(y, Color): */ __pyx_t_1 = PyTuple_Check(__pyx_v_y); __pyx_t_3 = (__pyx_t_1 != 0); if (__pyx_t_3) { /* "pygame_sdl2/color.pyx":103 * * if isinstance(y, tuple): * y = Color(y) # <<<<<<<<<<<<<< * if not isinstance(y, Color): * return False */ __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 103, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_INCREF(__pyx_v_y); __Pyx_GIVEREF(__pyx_v_y); PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_y); __pyx_t_4 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_11pygame_sdl2_5color_Color), __pyx_t_2, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 103, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF_SET(__pyx_v_y, __pyx_t_4); __pyx_t_4 = 0; /* "pygame_sdl2/color.pyx":102 * return not (x == y) * * if isinstance(y, tuple): # <<<<<<<<<<<<<< * y = Color(y) * if not isinstance(y, Color): */ } /* "pygame_sdl2/color.pyx":104 * if isinstance(y, tuple): * y = Color(y) * if not isinstance(y, Color): # <<<<<<<<<<<<<< * return False * if op == 2: */ __pyx_t_3 = __Pyx_TypeCheck(__pyx_v_y, __pyx_ptype_11pygame_sdl2_5color_Color); __pyx_t_1 = ((!(__pyx_t_3 != 0)) != 0); if (__pyx_t_1) { /* "pygame_sdl2/color.pyx":105 * y = Color(y) * if not isinstance(y, Color): * return False # <<<<<<<<<<<<<< * if op == 2: * return x.r == y.r and x.g == y.g and x.b == y.b and x.a == y.a */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(Py_False); __pyx_r = Py_False; goto __pyx_L0; /* "pygame_sdl2/color.pyx":104 * if isinstance(y, tuple): * y = Color(y) * if not isinstance(y, Color): # <<<<<<<<<<<<<< * return False * if op == 2: */ } /* "pygame_sdl2/color.pyx":106 * if not isinstance(y, Color): * return False * if op == 2: # <<<<<<<<<<<<<< * return x.r == y.r and x.g == y.g and x.b == y.b and x.a == y.a * */ __pyx_t_1 = ((__pyx_v_op == 2) != 0); if (__pyx_t_1) { /* "pygame_sdl2/color.pyx":107 * return False * if op == 2: * return x.r == y.r and x.g == y.g and x.b == y.b and x.a == y.a # <<<<<<<<<<<<<< * * def __cinit__(self): */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __Pyx_PyInt_From_uint8_t(__pyx_v_x->r); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 107, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_y, __pyx_n_s_r); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 107, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_6 = PyObject_RichCompare(__pyx_t_2, __pyx_t_5, Py_EQ); __Pyx_XGOTREF(__pyx_t_6); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 107, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_6); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(0, 107, __pyx_L1_error) if (__pyx_t_1) { __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; } else { __Pyx_INCREF(__pyx_t_6); __pyx_t_4 = __pyx_t_6; __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; goto __pyx_L7_bool_binop_done; } __pyx_t_6 = __Pyx_PyInt_From_uint8_t(__pyx_v_x->g); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 107, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_y, __pyx_n_s_g); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 107, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_2 = PyObject_RichCompare(__pyx_t_6, __pyx_t_5, Py_EQ); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 107, __pyx_L1_error) __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(0, 107, __pyx_L1_error) if (__pyx_t_1) { __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } else { __Pyx_INCREF(__pyx_t_2); __pyx_t_4 = __pyx_t_2; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; goto __pyx_L7_bool_binop_done; } __pyx_t_2 = __Pyx_PyInt_From_uint8_t(__pyx_v_x->b); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 107, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_y, __pyx_n_s_b); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 107, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_6 = PyObject_RichCompare(__pyx_t_2, __pyx_t_5, Py_EQ); __Pyx_XGOTREF(__pyx_t_6); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 107, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_6); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(0, 107, __pyx_L1_error) if (__pyx_t_1) { __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; } else { __Pyx_INCREF(__pyx_t_6); __pyx_t_4 = __pyx_t_6; __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; goto __pyx_L7_bool_binop_done; } __pyx_t_6 = __Pyx_PyInt_From_uint8_t(__pyx_v_x->a); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 107, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_y, __pyx_n_s_a); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 107, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_2 = PyObject_RichCompare(__pyx_t_6, __pyx_t_5, Py_EQ); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 107, __pyx_L1_error) __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_INCREF(__pyx_t_2); __pyx_t_4 = __pyx_t_2; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_L7_bool_binop_done:; __pyx_r = __pyx_t_4; __pyx_t_4 = 0; goto __pyx_L0; /* "pygame_sdl2/color.pyx":106 * if not isinstance(y, Color): * return False * if op == 2: # <<<<<<<<<<<<<< * return x.r == y.r and x.g == y.g and x.b == y.b and x.a == y.a * */ } /* "pygame_sdl2/color.pyx":98 * self.from_rgba(r, g, b, 255) * * def __richcmp__(Color x, y, int op): # <<<<<<<<<<<<<< * if op == 3: * return not (x == y) */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_5); __Pyx_XDECREF(__pyx_t_6); __Pyx_AddTraceback("pygame_sdl2.color.Color.__richcmp__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF(__pyx_v_y); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/color.pyx":109 * return x.r == y.r and x.g == y.g and x.b == y.b and x.a == y.a * * def __cinit__(self): # <<<<<<<<<<<<<< * self.length = 4 * self.r = 0 */ /* Python wrapper */ static int __pyx_pw_11pygame_sdl2_5color_5Color_3__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static int __pyx_pw_11pygame_sdl2_5color_5Color_3__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__cinit__ (wrapper)", 0); if (unlikely(PyTuple_GET_SIZE(__pyx_args) > 0)) { __Pyx_RaiseArgtupleInvalid("__cinit__", 1, 0, 0, PyTuple_GET_SIZE(__pyx_args)); return -1;} if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "__cinit__", 0))) return -1; __pyx_r = __pyx_pf_11pygame_sdl2_5color_5Color_2__cinit__(((struct __pyx_obj_11pygame_sdl2_5color_Color *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static int __pyx_pf_11pygame_sdl2_5color_5Color_2__cinit__(struct __pyx_obj_11pygame_sdl2_5color_Color *__pyx_v_self) { int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__cinit__", 0); /* "pygame_sdl2/color.pyx":110 * * def __cinit__(self): * self.length = 4 # <<<<<<<<<<<<<< * self.r = 0 * self.g = 0 */ __pyx_v_self->length = 4; /* "pygame_sdl2/color.pyx":111 * def __cinit__(self): * self.length = 4 * self.r = 0 # <<<<<<<<<<<<<< * self.g = 0 * self.b = 0 */ __pyx_v_self->r = 0; /* "pygame_sdl2/color.pyx":112 * self.length = 4 * self.r = 0 * self.g = 0 # <<<<<<<<<<<<<< * self.b = 0 * self.a = 255 */ __pyx_v_self->g = 0; /* "pygame_sdl2/color.pyx":113 * self.r = 0 * self.g = 0 * self.b = 0 # <<<<<<<<<<<<<< * self.a = 255 * */ __pyx_v_self->b = 0; /* "pygame_sdl2/color.pyx":114 * self.g = 0 * self.b = 0 * self.a = 255 # <<<<<<<<<<<<<< * * def __init__(self, *args): */ __pyx_v_self->a = 0xFF; /* "pygame_sdl2/color.pyx":109 * return x.r == y.r and x.g == y.g and x.b == y.b and x.a == y.a * * def __cinit__(self): # <<<<<<<<<<<<<< * self.length = 4 * self.r = 0 */ /* function exit code */ __pyx_r = 0; __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/color.pyx":116 * self.a = 255 * * def __init__(self, *args): # <<<<<<<<<<<<<< * self.length = 4 * */ /* Python wrapper */ static int __pyx_pw_11pygame_sdl2_5color_5Color_5__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static int __pyx_pw_11pygame_sdl2_5color_5Color_5__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_args = 0; int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__init__ (wrapper)", 0); if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "__init__", 0))) return -1; __Pyx_INCREF(__pyx_args); __pyx_v_args = __pyx_args; __pyx_r = __pyx_pf_11pygame_sdl2_5color_5Color_4__init__(((struct __pyx_obj_11pygame_sdl2_5color_Color *)__pyx_v_self), __pyx_v_args); /* function exit code */ __Pyx_XDECREF(__pyx_v_args); __Pyx_RefNannyFinishContext(); return __pyx_r; } static int __pyx_pf_11pygame_sdl2_5color_5Color_4__init__(struct __pyx_obj_11pygame_sdl2_5color_Color *__pyx_v_self, PyObject *__pyx_v_args) { PyObject *__pyx_v_c = NULL; PyObject *__pyx_v_r = NULL; PyObject *__pyx_v_g = NULL; PyObject *__pyx_v_b = NULL; PyObject *__pyx_v_a = NULL; int __pyx_r; __Pyx_RefNannyDeclarations Py_ssize_t __pyx_t_1; int __pyx_t_2; PyObject *__pyx_t_3 = NULL; int __pyx_t_4; PyObject *__pyx_t_5 = NULL; int __pyx_t_6; Uint8 __pyx_t_7; Uint8 __pyx_t_8; Uint8 __pyx_t_9; Uint8 __pyx_t_10; PyObject *__pyx_t_11 = NULL; PyObject *__pyx_t_12 = NULL; __Pyx_RefNannySetupContext("__init__", 0); /* "pygame_sdl2/color.pyx":117 * * def __init__(self, *args): * self.length = 4 # <<<<<<<<<<<<<< * * if len(args) == 1: */ __pyx_v_self->length = 4; /* "pygame_sdl2/color.pyx":119 * self.length = 4 * * if len(args) == 1: # <<<<<<<<<<<<<< * c = args[0] * if isinstance(c, basestring): */ __pyx_t_1 = PyTuple_GET_SIZE(__pyx_v_args); if (unlikely(__pyx_t_1 == -1)) __PYX_ERR(0, 119, __pyx_L1_error) __pyx_t_2 = ((__pyx_t_1 == 1) != 0); if (__pyx_t_2) { /* "pygame_sdl2/color.pyx":120 * * if len(args) == 1: * c = args[0] # <<<<<<<<<<<<<< * if isinstance(c, basestring): * if c.startswith('#'): */ __pyx_t_3 = __Pyx_GetItemInt_Tuple(__pyx_v_args, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 120, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_v_c = __pyx_t_3; __pyx_t_3 = 0; /* "pygame_sdl2/color.pyx":121 * if len(args) == 1: * c = args[0] * if isinstance(c, basestring): # <<<<<<<<<<<<<< * if c.startswith('#'): * self.from_hex(c[1:]) */ __pyx_t_2 = __Pyx_PyBaseString_Check(__pyx_v_c); __pyx_t_4 = (__pyx_t_2 != 0); if (__pyx_t_4) { /* "pygame_sdl2/color.pyx":122 * c = args[0] * if isinstance(c, basestring): * if c.startswith('#'): # <<<<<<<<<<<<<< * self.from_hex(c[1:]) * elif c.startswith('0x'): */ __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_c, __pyx_n_s_startswith); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 122, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_tuple__4, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 122, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(0, 122, __pyx_L1_error) __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; if (__pyx_t_4) { /* "pygame_sdl2/color.pyx":123 * if isinstance(c, basestring): * if c.startswith('#'): * self.from_hex(c[1:]) # <<<<<<<<<<<<<< * elif c.startswith('0x'): * self.from_hex(c[2:]) */ __pyx_t_5 = __Pyx_PyObject_GetSlice(__pyx_v_c, 1, 0, NULL, NULL, &__pyx_slice__5, 1, 0, 1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 123, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_3 = ((struct __pyx_vtabstruct_11pygame_sdl2_5color_Color *)__pyx_v_self->__pyx_vtab)->from_hex(__pyx_v_self, __pyx_t_5); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 123, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "pygame_sdl2/color.pyx":122 * c = args[0] * if isinstance(c, basestring): * if c.startswith('#'): # <<<<<<<<<<<<<< * self.from_hex(c[1:]) * elif c.startswith('0x'): */ goto __pyx_L5; } /* "pygame_sdl2/color.pyx":124 * if c.startswith('#'): * self.from_hex(c[1:]) * elif c.startswith('0x'): # <<<<<<<<<<<<<< * self.from_hex(c[2:]) * else: */ __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_c, __pyx_n_s_startswith); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 124, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_tuple__6, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 124, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(0, 124, __pyx_L1_error) __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; if (__pyx_t_4) { /* "pygame_sdl2/color.pyx":125 * self.from_hex(c[1:]) * elif c.startswith('0x'): * self.from_hex(c[2:]) # <<<<<<<<<<<<<< * else: * self.from_name(c) */ __pyx_t_5 = __Pyx_PyObject_GetSlice(__pyx_v_c, 2, 0, NULL, NULL, &__pyx_slice__7, 1, 0, 1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 125, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_3 = ((struct __pyx_vtabstruct_11pygame_sdl2_5color_Color *)__pyx_v_self->__pyx_vtab)->from_hex(__pyx_v_self, __pyx_t_5); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 125, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "pygame_sdl2/color.pyx":124 * if c.startswith('#'): * self.from_hex(c[1:]) * elif c.startswith('0x'): # <<<<<<<<<<<<<< * self.from_hex(c[2:]) * else: */ goto __pyx_L5; } /* "pygame_sdl2/color.pyx":127 * self.from_hex(c[2:]) * else: * self.from_name(c) # <<<<<<<<<<<<<< * elif isinstance(c, (tuple, list, Color)): * if len(c) == 4: */ /*else*/ { __pyx_t_3 = ((struct __pyx_vtabstruct_11pygame_sdl2_5color_Color *)__pyx_v_self->__pyx_vtab)->from_name(__pyx_v_self, __pyx_v_c); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 127, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } __pyx_L5:; /* "pygame_sdl2/color.pyx":121 * if len(args) == 1: * c = args[0] * if isinstance(c, basestring): # <<<<<<<<<<<<<< * if c.startswith('#'): * self.from_hex(c[1:]) */ goto __pyx_L4; } /* "pygame_sdl2/color.pyx":128 * else: * self.from_name(c) * elif isinstance(c, (tuple, list, Color)): # <<<<<<<<<<<<<< * if len(c) == 4: * self.from_rgba(c[0], c[1], c[2], c[3]) */ __pyx_t_2 = PyTuple_Check(__pyx_v_c); __pyx_t_6 = (__pyx_t_2 != 0); if (!__pyx_t_6) { } else { __pyx_t_4 = __pyx_t_6; goto __pyx_L6_bool_binop_done; } __pyx_t_6 = PyList_Check(__pyx_v_c); __pyx_t_2 = (__pyx_t_6 != 0); if (!__pyx_t_2) { } else { __pyx_t_4 = __pyx_t_2; goto __pyx_L6_bool_binop_done; } __pyx_t_2 = __Pyx_TypeCheck(__pyx_v_c, __pyx_ptype_11pygame_sdl2_5color_Color); __pyx_t_6 = (__pyx_t_2 != 0); __pyx_t_4 = __pyx_t_6; __pyx_L6_bool_binop_done:; __pyx_t_6 = (__pyx_t_4 != 0); if (__pyx_t_6) { /* "pygame_sdl2/color.pyx":129 * self.from_name(c) * elif isinstance(c, (tuple, list, Color)): * if len(c) == 4: # <<<<<<<<<<<<<< * self.from_rgba(c[0], c[1], c[2], c[3]) * elif len(c) == 3: */ __pyx_t_1 = PyObject_Length(__pyx_v_c); if (unlikely(__pyx_t_1 == -1)) __PYX_ERR(0, 129, __pyx_L1_error) __pyx_t_6 = ((__pyx_t_1 == 4) != 0); if (__pyx_t_6) { /* "pygame_sdl2/color.pyx":130 * elif isinstance(c, (tuple, list, Color)): * if len(c) == 4: * self.from_rgba(c[0], c[1], c[2], c[3]) # <<<<<<<<<<<<<< * elif len(c) == 3: * self.from_rgba(c[0], c[1], c[2], 255) */ __pyx_t_3 = __Pyx_GetItemInt(__pyx_v_c, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 130, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_7 = __Pyx_PyInt_As_uint8_t(__pyx_t_3); if (unlikely((__pyx_t_7 == (Uint8)-1) && PyErr_Occurred())) __PYX_ERR(0, 130, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_3 = __Pyx_GetItemInt(__pyx_v_c, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 130, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_8 = __Pyx_PyInt_As_uint8_t(__pyx_t_3); if (unlikely((__pyx_t_8 == (Uint8)-1) && PyErr_Occurred())) __PYX_ERR(0, 130, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_3 = __Pyx_GetItemInt(__pyx_v_c, 2, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 130, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_9 = __Pyx_PyInt_As_uint8_t(__pyx_t_3); if (unlikely((__pyx_t_9 == (Uint8)-1) && PyErr_Occurred())) __PYX_ERR(0, 130, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_3 = __Pyx_GetItemInt(__pyx_v_c, 3, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 130, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_10 = __Pyx_PyInt_As_uint8_t(__pyx_t_3); if (unlikely((__pyx_t_10 == (Uint8)-1) && PyErr_Occurred())) __PYX_ERR(0, 130, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_3 = ((struct __pyx_vtabstruct_11pygame_sdl2_5color_Color *)__pyx_v_self->__pyx_vtab)->from_rgba(__pyx_v_self, __pyx_t_7, __pyx_t_8, __pyx_t_9, __pyx_t_10); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 130, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "pygame_sdl2/color.pyx":129 * self.from_name(c) * elif isinstance(c, (tuple, list, Color)): * if len(c) == 4: # <<<<<<<<<<<<<< * self.from_rgba(c[0], c[1], c[2], c[3]) * elif len(c) == 3: */ goto __pyx_L9; } /* "pygame_sdl2/color.pyx":131 * if len(c) == 4: * self.from_rgba(c[0], c[1], c[2], c[3]) * elif len(c) == 3: # <<<<<<<<<<<<<< * self.from_rgba(c[0], c[1], c[2], 255) * else: */ __pyx_t_1 = PyObject_Length(__pyx_v_c); if (unlikely(__pyx_t_1 == -1)) __PYX_ERR(0, 131, __pyx_L1_error) __pyx_t_6 = ((__pyx_t_1 == 3) != 0); if (__pyx_t_6) { /* "pygame_sdl2/color.pyx":132 * self.from_rgba(c[0], c[1], c[2], c[3]) * elif len(c) == 3: * self.from_rgba(c[0], c[1], c[2], 255) # <<<<<<<<<<<<<< * else: * raise ValueError(c) */ __pyx_t_3 = __Pyx_GetItemInt(__pyx_v_c, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 132, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_10 = __Pyx_PyInt_As_uint8_t(__pyx_t_3); if (unlikely((__pyx_t_10 == (Uint8)-1) && PyErr_Occurred())) __PYX_ERR(0, 132, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_3 = __Pyx_GetItemInt(__pyx_v_c, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 132, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_9 = __Pyx_PyInt_As_uint8_t(__pyx_t_3); if (unlikely((__pyx_t_9 == (Uint8)-1) && PyErr_Occurred())) __PYX_ERR(0, 132, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_3 = __Pyx_GetItemInt(__pyx_v_c, 2, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 132, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_8 = __Pyx_PyInt_As_uint8_t(__pyx_t_3); if (unlikely((__pyx_t_8 == (Uint8)-1) && PyErr_Occurred())) __PYX_ERR(0, 132, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_3 = ((struct __pyx_vtabstruct_11pygame_sdl2_5color_Color *)__pyx_v_self->__pyx_vtab)->from_rgba(__pyx_v_self, __pyx_t_10, __pyx_t_9, __pyx_t_8, 0xFF); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 132, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "pygame_sdl2/color.pyx":131 * if len(c) == 4: * self.from_rgba(c[0], c[1], c[2], c[3]) * elif len(c) == 3: # <<<<<<<<<<<<<< * self.from_rgba(c[0], c[1], c[2], 255) * else: */ goto __pyx_L9; } /* "pygame_sdl2/color.pyx":134 * self.from_rgba(c[0], c[1], c[2], 255) * else: * raise ValueError(c) # <<<<<<<<<<<<<< * else: * self.from_hex("%08x" % c) */ /*else*/ { __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 134, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_INCREF(__pyx_v_c); __Pyx_GIVEREF(__pyx_v_c); PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_c); __pyx_t_5 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_t_3, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 134, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_Raise(__pyx_t_5, 0, 0, 0); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __PYX_ERR(0, 134, __pyx_L1_error) } __pyx_L9:; /* "pygame_sdl2/color.pyx":128 * else: * self.from_name(c) * elif isinstance(c, (tuple, list, Color)): # <<<<<<<<<<<<<< * if len(c) == 4: * self.from_rgba(c[0], c[1], c[2], c[3]) */ goto __pyx_L4; } /* "pygame_sdl2/color.pyx":136 * raise ValueError(c) * else: * self.from_hex("%08x" % c) # <<<<<<<<<<<<<< * * elif len(args) == 3: */ /*else*/ { __pyx_t_5 = PyUnicode_Format(__pyx_kp_u_08x, __pyx_v_c); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 136, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_3 = ((struct __pyx_vtabstruct_11pygame_sdl2_5color_Color *)__pyx_v_self->__pyx_vtab)->from_hex(__pyx_v_self, __pyx_t_5); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 136, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } __pyx_L4:; /* "pygame_sdl2/color.pyx":119 * self.length = 4 * * if len(args) == 1: # <<<<<<<<<<<<<< * c = args[0] * if isinstance(c, basestring): */ goto __pyx_L3; } /* "pygame_sdl2/color.pyx":138 * self.from_hex("%08x" % c) * * elif len(args) == 3: # <<<<<<<<<<<<<< * r, g, b = args * self.from_rgba(r, g, b, 255) */ __pyx_t_1 = PyTuple_GET_SIZE(__pyx_v_args); if (unlikely(__pyx_t_1 == -1)) __PYX_ERR(0, 138, __pyx_L1_error) __pyx_t_6 = ((__pyx_t_1 == 3) != 0); if (__pyx_t_6) { /* "pygame_sdl2/color.pyx":139 * * elif len(args) == 3: * r, g, b = args # <<<<<<<<<<<<<< * self.from_rgba(r, g, b, 255) * elif len(args) == 4: */ if (1) { PyObject* sequence = __pyx_v_args; #if CYTHON_COMPILING_IN_CPYTHON Py_ssize_t size = Py_SIZE(sequence); #else Py_ssize_t size = PySequence_Size(sequence); #endif if (unlikely(size != 3)) { if (size > 3) __Pyx_RaiseTooManyValuesError(3); else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); __PYX_ERR(0, 139, __pyx_L1_error) } #if CYTHON_COMPILING_IN_CPYTHON __pyx_t_3 = PyTuple_GET_ITEM(sequence, 0); __pyx_t_5 = PyTuple_GET_ITEM(sequence, 1); __pyx_t_11 = PyTuple_GET_ITEM(sequence, 2); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(__pyx_t_5); __Pyx_INCREF(__pyx_t_11); #else __pyx_t_3 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 139, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_5 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 139, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_11 = PySequence_ITEM(sequence, 2); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 139, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); #endif } __pyx_v_r = __pyx_t_3; __pyx_t_3 = 0; __pyx_v_g = __pyx_t_5; __pyx_t_5 = 0; __pyx_v_b = __pyx_t_11; __pyx_t_11 = 0; /* "pygame_sdl2/color.pyx":140 * elif len(args) == 3: * r, g, b = args * self.from_rgba(r, g, b, 255) # <<<<<<<<<<<<<< * elif len(args) == 4: * r, g, b, a = args */ __pyx_t_8 = __Pyx_PyInt_As_uint8_t(__pyx_v_r); if (unlikely((__pyx_t_8 == (Uint8)-1) && PyErr_Occurred())) __PYX_ERR(0, 140, __pyx_L1_error) __pyx_t_9 = __Pyx_PyInt_As_uint8_t(__pyx_v_g); if (unlikely((__pyx_t_9 == (Uint8)-1) && PyErr_Occurred())) __PYX_ERR(0, 140, __pyx_L1_error) __pyx_t_10 = __Pyx_PyInt_As_uint8_t(__pyx_v_b); if (unlikely((__pyx_t_10 == (Uint8)-1) && PyErr_Occurred())) __PYX_ERR(0, 140, __pyx_L1_error) __pyx_t_11 = ((struct __pyx_vtabstruct_11pygame_sdl2_5color_Color *)__pyx_v_self->__pyx_vtab)->from_rgba(__pyx_v_self, __pyx_t_8, __pyx_t_9, __pyx_t_10, 0xFF); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 140, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; /* "pygame_sdl2/color.pyx":138 * self.from_hex("%08x" % c) * * elif len(args) == 3: # <<<<<<<<<<<<<< * r, g, b = args * self.from_rgba(r, g, b, 255) */ goto __pyx_L3; } /* "pygame_sdl2/color.pyx":141 * r, g, b = args * self.from_rgba(r, g, b, 255) * elif len(args) == 4: # <<<<<<<<<<<<<< * r, g, b, a = args * self.from_rgba(r, g, b, a) */ __pyx_t_1 = PyTuple_GET_SIZE(__pyx_v_args); if (unlikely(__pyx_t_1 == -1)) __PYX_ERR(0, 141, __pyx_L1_error) __pyx_t_6 = ((__pyx_t_1 == 4) != 0); if (__pyx_t_6) { /* "pygame_sdl2/color.pyx":142 * self.from_rgba(r, g, b, 255) * elif len(args) == 4: * r, g, b, a = args # <<<<<<<<<<<<<< * self.from_rgba(r, g, b, a) * */ if (1) { PyObject* sequence = __pyx_v_args; #if CYTHON_COMPILING_IN_CPYTHON Py_ssize_t size = Py_SIZE(sequence); #else Py_ssize_t size = PySequence_Size(sequence); #endif if (unlikely(size != 4)) { if (size > 4) __Pyx_RaiseTooManyValuesError(4); else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); __PYX_ERR(0, 142, __pyx_L1_error) } #if CYTHON_COMPILING_IN_CPYTHON __pyx_t_11 = PyTuple_GET_ITEM(sequence, 0); __pyx_t_5 = PyTuple_GET_ITEM(sequence, 1); __pyx_t_3 = PyTuple_GET_ITEM(sequence, 2); __pyx_t_12 = PyTuple_GET_ITEM(sequence, 3); __Pyx_INCREF(__pyx_t_11); __Pyx_INCREF(__pyx_t_5); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(__pyx_t_12); #else { Py_ssize_t i; PyObject** temps[4] = {&__pyx_t_11,&__pyx_t_5,&__pyx_t_3,&__pyx_t_12}; for (i=0; i < 4; i++) { PyObject* item = PySequence_ITEM(sequence, i); if (unlikely(!item)) __PYX_ERR(0, 142, __pyx_L1_error) __Pyx_GOTREF(item); *(temps[i]) = item; } } #endif } __pyx_v_r = __pyx_t_11; __pyx_t_11 = 0; __pyx_v_g = __pyx_t_5; __pyx_t_5 = 0; __pyx_v_b = __pyx_t_3; __pyx_t_3 = 0; __pyx_v_a = __pyx_t_12; __pyx_t_12 = 0; /* "pygame_sdl2/color.pyx":143 * elif len(args) == 4: * r, g, b, a = args * self.from_rgba(r, g, b, a) # <<<<<<<<<<<<<< * * def __repr__(self): */ __pyx_t_10 = __Pyx_PyInt_As_uint8_t(__pyx_v_r); if (unlikely((__pyx_t_10 == (Uint8)-1) && PyErr_Occurred())) __PYX_ERR(0, 143, __pyx_L1_error) __pyx_t_9 = __Pyx_PyInt_As_uint8_t(__pyx_v_g); if (unlikely((__pyx_t_9 == (Uint8)-1) && PyErr_Occurred())) __PYX_ERR(0, 143, __pyx_L1_error) __pyx_t_8 = __Pyx_PyInt_As_uint8_t(__pyx_v_b); if (unlikely((__pyx_t_8 == (Uint8)-1) && PyErr_Occurred())) __PYX_ERR(0, 143, __pyx_L1_error) __pyx_t_7 = __Pyx_PyInt_As_uint8_t(__pyx_v_a); if (unlikely((__pyx_t_7 == (Uint8)-1) && PyErr_Occurred())) __PYX_ERR(0, 143, __pyx_L1_error) __pyx_t_12 = ((struct __pyx_vtabstruct_11pygame_sdl2_5color_Color *)__pyx_v_self->__pyx_vtab)->from_rgba(__pyx_v_self, __pyx_t_10, __pyx_t_9, __pyx_t_8, __pyx_t_7); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 143, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_12); __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; /* "pygame_sdl2/color.pyx":141 * r, g, b = args * self.from_rgba(r, g, b, 255) * elif len(args) == 4: # <<<<<<<<<<<<<< * r, g, b, a = args * self.from_rgba(r, g, b, a) */ } __pyx_L3:; /* "pygame_sdl2/color.pyx":116 * self.a = 255 * * def __init__(self, *args): # <<<<<<<<<<<<<< * self.length = 4 * */ /* function exit code */ __pyx_r = 0; goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_5); __Pyx_XDECREF(__pyx_t_11); __Pyx_XDECREF(__pyx_t_12); __Pyx_AddTraceback("pygame_sdl2.color.Color.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = -1; __pyx_L0:; __Pyx_XDECREF(__pyx_v_c); __Pyx_XDECREF(__pyx_v_r); __Pyx_XDECREF(__pyx_v_g); __Pyx_XDECREF(__pyx_v_b); __Pyx_XDECREF(__pyx_v_a); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/color.pyx":145 * self.from_rgba(r, g, b, a) * * def __repr__(self): # <<<<<<<<<<<<<< * return str((self.r, self.g, self.b, self.a)) * */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_5color_5Color_7__repr__(PyObject *__pyx_v_self); /*proto*/ static PyObject *__pyx_pw_11pygame_sdl2_5color_5Color_7__repr__(PyObject *__pyx_v_self) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__repr__ (wrapper)", 0); __pyx_r = __pyx_pf_11pygame_sdl2_5color_5Color_6__repr__(((struct __pyx_obj_11pygame_sdl2_5color_Color *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_5color_5Color_6__repr__(struct __pyx_obj_11pygame_sdl2_5color_Color *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; PyObject *__pyx_t_5 = NULL; __Pyx_RefNannySetupContext("__repr__", 0); /* "pygame_sdl2/color.pyx":146 * * def __repr__(self): * return str((self.r, self.g, self.b, self.a)) # <<<<<<<<<<<<<< * * def __int__(self): */ __Pyx_XDECREF(__pyx_r); __pyx_t_1 = __Pyx_PyInt_From_uint8_t(__pyx_v_self->r); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 146, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = __Pyx_PyInt_From_uint8_t(__pyx_v_self->g); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 146, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = __Pyx_PyInt_From_uint8_t(__pyx_v_self->b); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 146, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = __Pyx_PyInt_From_uint8_t(__pyx_v_self->a); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 146, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_5 = PyTuple_New(4); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 146, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_GIVEREF(__pyx_t_1); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_1); __Pyx_GIVEREF(__pyx_t_2); PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_t_2); __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_5, 2, __pyx_t_3); __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_5, 3, __pyx_t_4); __pyx_t_1 = 0; __pyx_t_2 = 0; __pyx_t_3 = 0; __pyx_t_4 = 0; __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 146, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_5); __pyx_t_5 = 0; __pyx_t_5 = __Pyx_PyObject_Call(((PyObject *)(&PyUnicode_Type)), __pyx_t_4, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 146, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_r = __pyx_t_5; __pyx_t_5 = 0; goto __pyx_L0; /* "pygame_sdl2/color.pyx":145 * self.from_rgba(r, g, b, a) * * def __repr__(self): # <<<<<<<<<<<<<< * return str((self.r, self.g, self.b, self.a)) * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_5); __Pyx_AddTraceback("pygame_sdl2.color.Color.__repr__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/color.pyx":148 * return str((self.r, self.g, self.b, self.a)) * * def __int__(self): # <<<<<<<<<<<<<< * packed = struct.pack('BBBB', self.r, self.g, self.b, self.a) * return struct.unpack('>L', packed)[0] */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_5color_5Color_9__int__(PyObject *__pyx_v_self); /*proto*/ static PyObject *__pyx_pw_11pygame_sdl2_5color_5Color_9__int__(PyObject *__pyx_v_self) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__int__ (wrapper)", 0); __pyx_r = __pyx_pf_11pygame_sdl2_5color_5Color_8__int__(((struct __pyx_obj_11pygame_sdl2_5color_Color *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_5color_5Color_8__int__(struct __pyx_obj_11pygame_sdl2_5color_Color *__pyx_v_self) { PyObject *__pyx_v_packed = NULL; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; PyObject *__pyx_t_5 = NULL; PyObject *__pyx_t_6 = NULL; PyObject *__pyx_t_7 = NULL; Py_ssize_t __pyx_t_8; PyObject *__pyx_t_9 = NULL; __Pyx_RefNannySetupContext("__int__", 0); /* "pygame_sdl2/color.pyx":149 * * def __int__(self): * packed = struct.pack('BBBB', self.r, self.g, self.b, self.a) # <<<<<<<<<<<<<< * return struct.unpack('>L', packed)[0] * */ __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_struct); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 149, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_pack); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 149, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_2 = __Pyx_PyInt_From_uint8_t(__pyx_v_self->r); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 149, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_4 = __Pyx_PyInt_From_uint8_t(__pyx_v_self->g); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 149, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_5 = __Pyx_PyInt_From_uint8_t(__pyx_v_self->b); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 149, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_6 = __Pyx_PyInt_From_uint8_t(__pyx_v_self->a); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 149, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __pyx_t_7 = NULL; __pyx_t_8 = 0; if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_3))) { __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_3); if (likely(__pyx_t_7)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); __Pyx_INCREF(__pyx_t_7); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_3, function); __pyx_t_8 = 1; } } __pyx_t_9 = PyTuple_New(5+__pyx_t_8); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 149, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); if (__pyx_t_7) { __Pyx_GIVEREF(__pyx_t_7); PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_t_7); __pyx_t_7 = NULL; } __Pyx_INCREF(__pyx_n_u_BBBB); __Pyx_GIVEREF(__pyx_n_u_BBBB); PyTuple_SET_ITEM(__pyx_t_9, 0+__pyx_t_8, __pyx_n_u_BBBB); __Pyx_GIVEREF(__pyx_t_2); PyTuple_SET_ITEM(__pyx_t_9, 1+__pyx_t_8, __pyx_t_2); __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_9, 2+__pyx_t_8, __pyx_t_4); __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_9, 3+__pyx_t_8, __pyx_t_5); __Pyx_GIVEREF(__pyx_t_6); PyTuple_SET_ITEM(__pyx_t_9, 4+__pyx_t_8, __pyx_t_6); __pyx_t_2 = 0; __pyx_t_4 = 0; __pyx_t_5 = 0; __pyx_t_6 = 0; __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_9, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 149, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_v_packed = __pyx_t_1; __pyx_t_1 = 0; /* "pygame_sdl2/color.pyx":150 * def __int__(self): * packed = struct.pack('BBBB', self.r, self.g, self.b, self.a) * return struct.unpack('>L', packed)[0] # <<<<<<<<<<<<<< * * def __hex__(self): */ __Pyx_XDECREF(__pyx_r); __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_struct); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 150, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_unpack); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 150, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_3 = NULL; __pyx_t_8 = 0; if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_9))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_9); if (likely(__pyx_t_3)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_9); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_9, function); __pyx_t_8 = 1; } } __pyx_t_6 = PyTuple_New(2+__pyx_t_8); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 150, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); if (__pyx_t_3) { __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_3); __pyx_t_3 = NULL; } __Pyx_INCREF(__pyx_kp_u_L); __Pyx_GIVEREF(__pyx_kp_u_L); PyTuple_SET_ITEM(__pyx_t_6, 0+__pyx_t_8, __pyx_kp_u_L); __Pyx_INCREF(__pyx_v_packed); __Pyx_GIVEREF(__pyx_v_packed); PyTuple_SET_ITEM(__pyx_t_6, 1+__pyx_t_8, __pyx_v_packed); __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_9, __pyx_t_6, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 150, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; __pyx_t_9 = __Pyx_GetItemInt(__pyx_t_1, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 150, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_r = __pyx_t_9; __pyx_t_9 = 0; goto __pyx_L0; /* "pygame_sdl2/color.pyx":148 * return str((self.r, self.g, self.b, self.a)) * * def __int__(self): # <<<<<<<<<<<<<< * packed = struct.pack('BBBB', self.r, self.g, self.b, self.a) * return struct.unpack('>L', packed)[0] */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_5); __Pyx_XDECREF(__pyx_t_6); __Pyx_XDECREF(__pyx_t_7); __Pyx_XDECREF(__pyx_t_9); __Pyx_AddTraceback("pygame_sdl2.color.Color.__int__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF(__pyx_v_packed); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/color.pyx":152 * return struct.unpack('>L', packed)[0] * * def __hex__(self): # <<<<<<<<<<<<<< * return hex(int(self)) * */ /* Python wrapper */ #if PY_MAJOR_VERSION < 3 || CYTHON_COMPILING_IN_PYPY static PyObject *__pyx_pw_11pygame_sdl2_5color_5Color_11__hex__(PyObject *__pyx_v_self); /*proto*/ static PyObject *__pyx_pw_11pygame_sdl2_5color_5Color_11__hex__(PyObject *__pyx_v_self) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__hex__ (wrapper)", 0); __pyx_r = __pyx_pf_11pygame_sdl2_5color_5Color_10__hex__(((struct __pyx_obj_11pygame_sdl2_5color_Color *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } #endif /*!(#if PY_MAJOR_VERSION < 3 || CYTHON_COMPILING_IN_PYPY)*/ #if PY_MAJOR_VERSION < 3 || CYTHON_COMPILING_IN_PYPY static PyObject *__pyx_pf_11pygame_sdl2_5color_5Color_10__hex__(struct __pyx_obj_11pygame_sdl2_5color_Color *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; __Pyx_RefNannySetupContext("__hex__", 0); /* "pygame_sdl2/color.pyx":153 * * def __hex__(self): * return hex(int(self)) # <<<<<<<<<<<<<< * * def __oct__(self): */ __Pyx_XDECREF(__pyx_r); __pyx_t_1 = __Pyx_PyNumber_Int(((PyObject *)__pyx_v_self)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 153, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 153, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_GIVEREF(__pyx_t_1); PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_1); __pyx_t_1 = 0; __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_hex, __pyx_t_2, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 153, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "pygame_sdl2/color.pyx":152 * return struct.unpack('>L', packed)[0] * * def __hex__(self): # <<<<<<<<<<<<<< * return hex(int(self)) * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_AddTraceback("pygame_sdl2.color.Color.__hex__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } #endif /*!(#if PY_MAJOR_VERSION < 3 || CYTHON_COMPILING_IN_PYPY)*/ /* "pygame_sdl2/color.pyx":155 * return hex(int(self)) * * def __oct__(self): # <<<<<<<<<<<<<< * return oct(int(self)) * */ /* Python wrapper */ #if PY_MAJOR_VERSION < 3 || CYTHON_COMPILING_IN_PYPY static PyObject *__pyx_pw_11pygame_sdl2_5color_5Color_13__oct__(PyObject *__pyx_v_self); /*proto*/ static PyObject *__pyx_pw_11pygame_sdl2_5color_5Color_13__oct__(PyObject *__pyx_v_self) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__oct__ (wrapper)", 0); __pyx_r = __pyx_pf_11pygame_sdl2_5color_5Color_12__oct__(((struct __pyx_obj_11pygame_sdl2_5color_Color *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } #endif /*!(#if PY_MAJOR_VERSION < 3 || CYTHON_COMPILING_IN_PYPY)*/ #if PY_MAJOR_VERSION < 3 || CYTHON_COMPILING_IN_PYPY static PyObject *__pyx_pf_11pygame_sdl2_5color_5Color_12__oct__(struct __pyx_obj_11pygame_sdl2_5color_Color *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; __Pyx_RefNannySetupContext("__oct__", 0); /* "pygame_sdl2/color.pyx":156 * * def __oct__(self): * return oct(int(self)) # <<<<<<<<<<<<<< * * def __float__(self): */ __Pyx_XDECREF(__pyx_r); __pyx_t_1 = __Pyx_PyNumber_Int(((PyObject *)__pyx_v_self)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 156, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 156, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_GIVEREF(__pyx_t_1); PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_1); __pyx_t_1 = 0; __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_oct, __pyx_t_2, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 156, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "pygame_sdl2/color.pyx":155 * return hex(int(self)) * * def __oct__(self): # <<<<<<<<<<<<<< * return oct(int(self)) * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_AddTraceback("pygame_sdl2.color.Color.__oct__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } #endif /*!(#if PY_MAJOR_VERSION < 3 || CYTHON_COMPILING_IN_PYPY)*/ /* "pygame_sdl2/color.pyx":158 * return oct(int(self)) * * def __float__(self): # <<<<<<<<<<<<<< * return float(int(self)) * */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_5color_5Color_15__float__(PyObject *__pyx_v_self); /*proto*/ static PyObject *__pyx_pw_11pygame_sdl2_5color_5Color_15__float__(PyObject *__pyx_v_self) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__float__ (wrapper)", 0); __pyx_r = __pyx_pf_11pygame_sdl2_5color_5Color_14__float__(((struct __pyx_obj_11pygame_sdl2_5color_Color *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_5color_5Color_14__float__(struct __pyx_obj_11pygame_sdl2_5color_Color *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; __Pyx_RefNannySetupContext("__float__", 0); /* "pygame_sdl2/color.pyx":159 * * def __float__(self): * return float(int(self)) # <<<<<<<<<<<<<< * * def __reduce__(self): */ __Pyx_XDECREF(__pyx_r); __pyx_t_1 = __Pyx_PyNumber_Int(((PyObject *)__pyx_v_self)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 159, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = __Pyx_PyNumber_Float(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 159, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; /* "pygame_sdl2/color.pyx":158 * return oct(int(self)) * * def __float__(self): # <<<<<<<<<<<<<< * return float(int(self)) * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_AddTraceback("pygame_sdl2.color.Color.__float__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/color.pyx":161 * return float(int(self)) * * def __reduce__(self): # <<<<<<<<<<<<<< * d = {} * d['rgba'] = (self.r, self.g, self.b, self.a) */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_5color_5Color_17__reduce__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/ static PyObject *__pyx_pw_11pygame_sdl2_5color_5Color_17__reduce__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__reduce__ (wrapper)", 0); __pyx_r = __pyx_pf_11pygame_sdl2_5color_5Color_16__reduce__(((struct __pyx_obj_11pygame_sdl2_5color_Color *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_5color_5Color_16__reduce__(struct __pyx_obj_11pygame_sdl2_5color_Color *__pyx_v_self) { PyObject *__pyx_v_d = NULL; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; PyObject *__pyx_t_5 = NULL; __Pyx_RefNannySetupContext("__reduce__", 0); /* "pygame_sdl2/color.pyx":162 * * def __reduce__(self): * d = {} # <<<<<<<<<<<<<< * d['rgba'] = (self.r, self.g, self.b, self.a) * return (Color, (), d) */ __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 162, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_d = ((PyObject*)__pyx_t_1); __pyx_t_1 = 0; /* "pygame_sdl2/color.pyx":163 * def __reduce__(self): * d = {} * d['rgba'] = (self.r, self.g, self.b, self.a) # <<<<<<<<<<<<<< * return (Color, (), d) * */ __pyx_t_1 = __Pyx_PyInt_From_uint8_t(__pyx_v_self->r); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 163, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = __Pyx_PyInt_From_uint8_t(__pyx_v_self->g); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 163, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = __Pyx_PyInt_From_uint8_t(__pyx_v_self->b); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 163, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = __Pyx_PyInt_From_uint8_t(__pyx_v_self->a); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 163, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_5 = PyTuple_New(4); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 163, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_GIVEREF(__pyx_t_1); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_1); __Pyx_GIVEREF(__pyx_t_2); PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_t_2); __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_5, 2, __pyx_t_3); __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_5, 3, __pyx_t_4); __pyx_t_1 = 0; __pyx_t_2 = 0; __pyx_t_3 = 0; __pyx_t_4 = 0; if (unlikely(PyDict_SetItem(__pyx_v_d, __pyx_n_u_rgba, __pyx_t_5) < 0)) __PYX_ERR(0, 163, __pyx_L1_error) __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; /* "pygame_sdl2/color.pyx":164 * d = {} * d['rgba'] = (self.r, self.g, self.b, self.a) * return (Color, (), d) # <<<<<<<<<<<<<< * * def __setstate__(self, d): */ __Pyx_XDECREF(__pyx_r); __pyx_t_5 = PyTuple_New(3); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 164, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_INCREF(((PyObject *)__pyx_ptype_11pygame_sdl2_5color_Color)); __Pyx_GIVEREF(((PyObject *)__pyx_ptype_11pygame_sdl2_5color_Color)); PyTuple_SET_ITEM(__pyx_t_5, 0, ((PyObject *)__pyx_ptype_11pygame_sdl2_5color_Color)); __Pyx_INCREF(__pyx_empty_tuple); __Pyx_GIVEREF(__pyx_empty_tuple); PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_empty_tuple); __Pyx_INCREF(__pyx_v_d); __Pyx_GIVEREF(__pyx_v_d); PyTuple_SET_ITEM(__pyx_t_5, 2, __pyx_v_d); __pyx_r = __pyx_t_5; __pyx_t_5 = 0; goto __pyx_L0; /* "pygame_sdl2/color.pyx":161 * return float(int(self)) * * def __reduce__(self): # <<<<<<<<<<<<<< * d = {} * d['rgba'] = (self.r, self.g, self.b, self.a) */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_5); __Pyx_AddTraceback("pygame_sdl2.color.Color.__reduce__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF(__pyx_v_d); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/color.pyx":166 * return (Color, (), d) * * def __setstate__(self, d): # <<<<<<<<<<<<<< * self.r, self.g, self.b, self.a = d['rgba'] * */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_5color_5Color_19__setstate__(PyObject *__pyx_v_self, PyObject *__pyx_v_d); /*proto*/ static PyObject *__pyx_pw_11pygame_sdl2_5color_5Color_19__setstate__(PyObject *__pyx_v_self, PyObject *__pyx_v_d) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__setstate__ (wrapper)", 0); __pyx_r = __pyx_pf_11pygame_sdl2_5color_5Color_18__setstate__(((struct __pyx_obj_11pygame_sdl2_5color_Color *)__pyx_v_self), ((PyObject *)__pyx_v_d)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_5color_5Color_18__setstate__(struct __pyx_obj_11pygame_sdl2_5color_Color *__pyx_v_self, PyObject *__pyx_v_d) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; PyObject *__pyx_t_5 = NULL; PyObject *__pyx_t_6 = NULL; PyObject *(*__pyx_t_7)(PyObject *); Uint8 __pyx_t_8; Uint8 __pyx_t_9; Uint8 __pyx_t_10; Uint8 __pyx_t_11; __Pyx_RefNannySetupContext("__setstate__", 0); /* "pygame_sdl2/color.pyx":167 * * def __setstate__(self, d): * self.r, self.g, self.b, self.a = d['rgba'] # <<<<<<<<<<<<<< * * def __setitem__(self, key, val): */ __pyx_t_1 = PyObject_GetItem(__pyx_v_d, __pyx_n_u_rgba); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 167, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if ((likely(PyTuple_CheckExact(__pyx_t_1))) || (PyList_CheckExact(__pyx_t_1))) { PyObject* sequence = __pyx_t_1; #if CYTHON_COMPILING_IN_CPYTHON Py_ssize_t size = Py_SIZE(sequence); #else Py_ssize_t size = PySequence_Size(sequence); #endif if (unlikely(size != 4)) { if (size > 4) __Pyx_RaiseTooManyValuesError(4); else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); __PYX_ERR(0, 167, __pyx_L1_error) } #if CYTHON_COMPILING_IN_CPYTHON if (likely(PyTuple_CheckExact(sequence))) { __pyx_t_2 = PyTuple_GET_ITEM(sequence, 0); __pyx_t_3 = PyTuple_GET_ITEM(sequence, 1); __pyx_t_4 = PyTuple_GET_ITEM(sequence, 2); __pyx_t_5 = PyTuple_GET_ITEM(sequence, 3); } else { __pyx_t_2 = PyList_GET_ITEM(sequence, 0); __pyx_t_3 = PyList_GET_ITEM(sequence, 1); __pyx_t_4 = PyList_GET_ITEM(sequence, 2); __pyx_t_5 = PyList_GET_ITEM(sequence, 3); } __Pyx_INCREF(__pyx_t_2); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(__pyx_t_4); __Pyx_INCREF(__pyx_t_5); #else { Py_ssize_t i; PyObject** temps[4] = {&__pyx_t_2,&__pyx_t_3,&__pyx_t_4,&__pyx_t_5}; for (i=0; i < 4; i++) { PyObject* item = PySequence_ITEM(sequence, i); if (unlikely(!item)) __PYX_ERR(0, 167, __pyx_L1_error) __Pyx_GOTREF(item); *(temps[i]) = item; } } #endif __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; } else { Py_ssize_t index = -1; PyObject** temps[4] = {&__pyx_t_2,&__pyx_t_3,&__pyx_t_4,&__pyx_t_5}; __pyx_t_6 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 167, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_7 = Py_TYPE(__pyx_t_6)->tp_iternext; for (index=0; index < 4; index++) { PyObject* item = __pyx_t_7(__pyx_t_6); if (unlikely(!item)) goto __pyx_L3_unpacking_failed; __Pyx_GOTREF(item); *(temps[index]) = item; } if (__Pyx_IternextUnpackEndCheck(__pyx_t_7(__pyx_t_6), 4) < 0) __PYX_ERR(0, 167, __pyx_L1_error) __pyx_t_7 = NULL; __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; goto __pyx_L4_unpacking_done; __pyx_L3_unpacking_failed:; __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __pyx_t_7 = NULL; if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); __PYX_ERR(0, 167, __pyx_L1_error) __pyx_L4_unpacking_done:; } __pyx_t_8 = __Pyx_PyInt_As_uint8_t(__pyx_t_2); if (unlikely((__pyx_t_8 == (Uint8)-1) && PyErr_Occurred())) __PYX_ERR(0, 167, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_9 = __Pyx_PyInt_As_uint8_t(__pyx_t_3); if (unlikely((__pyx_t_9 == (Uint8)-1) && PyErr_Occurred())) __PYX_ERR(0, 167, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_10 = __Pyx_PyInt_As_uint8_t(__pyx_t_4); if (unlikely((__pyx_t_10 == (Uint8)-1) && PyErr_Occurred())) __PYX_ERR(0, 167, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_t_11 = __Pyx_PyInt_As_uint8_t(__pyx_t_5); if (unlikely((__pyx_t_11 == (Uint8)-1) && PyErr_Occurred())) __PYX_ERR(0, 167, __pyx_L1_error) __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __pyx_v_self->r = __pyx_t_8; __pyx_v_self->g = __pyx_t_9; __pyx_v_self->b = __pyx_t_10; __pyx_v_self->a = __pyx_t_11; /* "pygame_sdl2/color.pyx":166 * return (Color, (), d) * * def __setstate__(self, d): # <<<<<<<<<<<<<< * self.r, self.g, self.b, self.a = d['rgba'] * */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_5); __Pyx_XDECREF(__pyx_t_6); __Pyx_AddTraceback("pygame_sdl2.color.Color.__setstate__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/color.pyx":169 * self.r, self.g, self.b, self.a = d['rgba'] * * def __setitem__(self, key, val): # <<<<<<<<<<<<<< * if not isinstance(val, int): * raise ValueError(val) */ /* Python wrapper */ static int __pyx_pw_11pygame_sdl2_5color_5Color_21__setitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_key, PyObject *__pyx_v_val); /*proto*/ static int __pyx_pw_11pygame_sdl2_5color_5Color_21__setitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_key, PyObject *__pyx_v_val) { int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__setitem__ (wrapper)", 0); __pyx_r = __pyx_pf_11pygame_sdl2_5color_5Color_20__setitem__(((struct __pyx_obj_11pygame_sdl2_5color_Color *)__pyx_v_self), ((PyObject *)__pyx_v_key), ((PyObject *)__pyx_v_val)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static int __pyx_pf_11pygame_sdl2_5color_5Color_20__setitem__(struct __pyx_obj_11pygame_sdl2_5color_Color *__pyx_v_self, PyObject *__pyx_v_key, PyObject *__pyx_v_val) { int __pyx_r; __Pyx_RefNannyDeclarations int __pyx_t_1; int __pyx_t_2; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; Uint8 __pyx_t_5; __Pyx_RefNannySetupContext("__setitem__", 0); /* "pygame_sdl2/color.pyx":170 * * def __setitem__(self, key, val): * if not isinstance(val, int): # <<<<<<<<<<<<<< * raise ValueError(val) * if key >= self.length: */ __pyx_t_1 = PyInt_Check(__pyx_v_val); __pyx_t_2 = ((!(__pyx_t_1 != 0)) != 0); if (__pyx_t_2) { /* "pygame_sdl2/color.pyx":171 * def __setitem__(self, key, val): * if not isinstance(val, int): * raise ValueError(val) # <<<<<<<<<<<<<< * if key >= self.length: * raise IndexError(key) */ __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 171, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_INCREF(__pyx_v_val); __Pyx_GIVEREF(__pyx_v_val); PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_val); __pyx_t_4 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_t_3, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 171, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_Raise(__pyx_t_4, 0, 0, 0); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __PYX_ERR(0, 171, __pyx_L1_error) /* "pygame_sdl2/color.pyx":170 * * def __setitem__(self, key, val): * if not isinstance(val, int): # <<<<<<<<<<<<<< * raise ValueError(val) * if key >= self.length: */ } /* "pygame_sdl2/color.pyx":172 * if not isinstance(val, int): * raise ValueError(val) * if key >= self.length: # <<<<<<<<<<<<<< * raise IndexError(key) * if val < 0 or val > 255: */ __pyx_t_4 = __Pyx_PyInt_From_uint8_t(__pyx_v_self->length); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 172, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_3 = PyObject_RichCompare(__pyx_v_key, __pyx_t_4, Py_GE); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 172, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 172, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; if (__pyx_t_2) { /* "pygame_sdl2/color.pyx":173 * raise ValueError(val) * if key >= self.length: * raise IndexError(key) # <<<<<<<<<<<<<< * if val < 0 or val > 255: * raise ValueError(val) */ __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 173, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_INCREF(__pyx_v_key); __Pyx_GIVEREF(__pyx_v_key); PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_key); __pyx_t_4 = __Pyx_PyObject_Call(__pyx_builtin_IndexError, __pyx_t_3, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 173, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_Raise(__pyx_t_4, 0, 0, 0); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __PYX_ERR(0, 173, __pyx_L1_error) /* "pygame_sdl2/color.pyx":172 * if not isinstance(val, int): * raise ValueError(val) * if key >= self.length: # <<<<<<<<<<<<<< * raise IndexError(key) * if val < 0 or val > 255: */ } /* "pygame_sdl2/color.pyx":174 * if key >= self.length: * raise IndexError(key) * if val < 0 or val > 255: # <<<<<<<<<<<<<< * raise ValueError(val) * */ __pyx_t_4 = PyObject_RichCompare(__pyx_v_val, __pyx_int_0, Py_LT); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 174, __pyx_L1_error) __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(0, 174, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; if (!__pyx_t_1) { } else { __pyx_t_2 = __pyx_t_1; goto __pyx_L6_bool_binop_done; } __pyx_t_4 = PyObject_RichCompare(__pyx_v_val, __pyx_int_255, Py_GT); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 174, __pyx_L1_error) __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(0, 174, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_t_2 = __pyx_t_1; __pyx_L6_bool_binop_done:; if (__pyx_t_2) { /* "pygame_sdl2/color.pyx":175 * raise IndexError(key) * if val < 0 or val > 255: * raise ValueError(val) # <<<<<<<<<<<<<< * * if key == 0: self.r = val */ __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 175, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_INCREF(__pyx_v_val); __Pyx_GIVEREF(__pyx_v_val); PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_v_val); __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_t_4, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 175, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_Raise(__pyx_t_3, 0, 0, 0); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __PYX_ERR(0, 175, __pyx_L1_error) /* "pygame_sdl2/color.pyx":174 * if key >= self.length: * raise IndexError(key) * if val < 0 or val > 255: # <<<<<<<<<<<<<< * raise ValueError(val) * */ } /* "pygame_sdl2/color.pyx":177 * raise ValueError(val) * * if key == 0: self.r = val # <<<<<<<<<<<<<< * elif key == 1: self.g = val * elif key == 2: self.b = val */ __pyx_t_3 = __Pyx_PyInt_EqObjC(__pyx_v_key, __pyx_int_0, 0, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 177, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 177, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; if (__pyx_t_2) { __pyx_t_5 = __Pyx_PyInt_As_uint8_t(__pyx_v_val); if (unlikely((__pyx_t_5 == (Uint8)-1) && PyErr_Occurred())) __PYX_ERR(0, 177, __pyx_L1_error) __pyx_v_self->r = __pyx_t_5; goto __pyx_L8; } /* "pygame_sdl2/color.pyx":178 * * if key == 0: self.r = val * elif key == 1: self.g = val # <<<<<<<<<<<<<< * elif key == 2: self.b = val * elif key == 3: self.a = val */ __pyx_t_3 = __Pyx_PyInt_EqObjC(__pyx_v_key, __pyx_int_1, 1, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 178, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 178, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; if (__pyx_t_2) { __pyx_t_5 = __Pyx_PyInt_As_uint8_t(__pyx_v_val); if (unlikely((__pyx_t_5 == (Uint8)-1) && PyErr_Occurred())) __PYX_ERR(0, 178, __pyx_L1_error) __pyx_v_self->g = __pyx_t_5; goto __pyx_L8; } /* "pygame_sdl2/color.pyx":179 * if key == 0: self.r = val * elif key == 1: self.g = val * elif key == 2: self.b = val # <<<<<<<<<<<<<< * elif key == 3: self.a = val * else: */ __pyx_t_3 = __Pyx_PyInt_EqObjC(__pyx_v_key, __pyx_int_2, 2, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 179, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 179, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; if (__pyx_t_2) { __pyx_t_5 = __Pyx_PyInt_As_uint8_t(__pyx_v_val); if (unlikely((__pyx_t_5 == (Uint8)-1) && PyErr_Occurred())) __PYX_ERR(0, 179, __pyx_L1_error) __pyx_v_self->b = __pyx_t_5; goto __pyx_L8; } /* "pygame_sdl2/color.pyx":180 * elif key == 1: self.g = val * elif key == 2: self.b = val * elif key == 3: self.a = val # <<<<<<<<<<<<<< * else: * raise IndexError(key) */ __pyx_t_3 = __Pyx_PyInt_EqObjC(__pyx_v_key, __pyx_int_3, 3, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 180, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 180, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; if (__pyx_t_2) { __pyx_t_5 = __Pyx_PyInt_As_uint8_t(__pyx_v_val); if (unlikely((__pyx_t_5 == (Uint8)-1) && PyErr_Occurred())) __PYX_ERR(0, 180, __pyx_L1_error) __pyx_v_self->a = __pyx_t_5; goto __pyx_L8; } /* "pygame_sdl2/color.pyx":182 * elif key == 3: self.a = val * else: * raise IndexError(key) # <<<<<<<<<<<<<< * * def __getitem__(self, key): */ /*else*/ { __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 182, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_INCREF(__pyx_v_key); __Pyx_GIVEREF(__pyx_v_key); PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_key); __pyx_t_4 = __Pyx_PyObject_Call(__pyx_builtin_IndexError, __pyx_t_3, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 182, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_Raise(__pyx_t_4, 0, 0, 0); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __PYX_ERR(0, 182, __pyx_L1_error) } __pyx_L8:; /* "pygame_sdl2/color.pyx":169 * self.r, self.g, self.b, self.a = d['rgba'] * * def __setitem__(self, key, val): # <<<<<<<<<<<<<< * if not isinstance(val, int): * raise ValueError(val) */ /* function exit code */ __pyx_r = 0; goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_AddTraceback("pygame_sdl2.color.Color.__setitem__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = -1; __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/color.pyx":184 * raise IndexError(key) * * def __getitem__(self, key): # <<<<<<<<<<<<<< * if isinstance(key, slice): * return tuple(self)[key] */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_5color_5Color_23__getitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_key); /*proto*/ static PyObject *__pyx_pw_11pygame_sdl2_5color_5Color_23__getitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_key) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__getitem__ (wrapper)", 0); __pyx_r = __pyx_pf_11pygame_sdl2_5color_5Color_22__getitem__(((struct __pyx_obj_11pygame_sdl2_5color_Color *)__pyx_v_self), ((PyObject *)__pyx_v_key)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_5color_5Color_22__getitem__(struct __pyx_obj_11pygame_sdl2_5color_Color *__pyx_v_self, PyObject *__pyx_v_key) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; int __pyx_t_2; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; __Pyx_RefNannySetupContext("__getitem__", 0); /* "pygame_sdl2/color.pyx":185 * * def __getitem__(self, key): * if isinstance(key, slice): # <<<<<<<<<<<<<< * return tuple(self)[key] * if key >= self.length: */ __pyx_t_1 = PySlice_Check(__pyx_v_key); __pyx_t_2 = (__pyx_t_1 != 0); if (__pyx_t_2) { /* "pygame_sdl2/color.pyx":186 * def __getitem__(self, key): * if isinstance(key, slice): * return tuple(self)[key] # <<<<<<<<<<<<<< * if key >= self.length: * raise IndexError(key) */ __Pyx_XDECREF(__pyx_r); __pyx_t_3 = PySequence_Tuple(((PyObject *)__pyx_v_self)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 186, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = PyObject_GetItem(__pyx_t_3, __pyx_v_key); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 186, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_r = __pyx_t_4; __pyx_t_4 = 0; goto __pyx_L0; /* "pygame_sdl2/color.pyx":185 * * def __getitem__(self, key): * if isinstance(key, slice): # <<<<<<<<<<<<<< * return tuple(self)[key] * if key >= self.length: */ } /* "pygame_sdl2/color.pyx":187 * if isinstance(key, slice): * return tuple(self)[key] * if key >= self.length: # <<<<<<<<<<<<<< * raise IndexError(key) * if key == 0: return self.r */ __pyx_t_4 = __Pyx_PyInt_From_uint8_t(__pyx_v_self->length); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 187, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_3 = PyObject_RichCompare(__pyx_v_key, __pyx_t_4, Py_GE); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 187, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 187, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; if (__pyx_t_2) { /* "pygame_sdl2/color.pyx":188 * return tuple(self)[key] * if key >= self.length: * raise IndexError(key) # <<<<<<<<<<<<<< * if key == 0: return self.r * elif key == 1: return self.g */ __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 188, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_INCREF(__pyx_v_key); __Pyx_GIVEREF(__pyx_v_key); PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_key); __pyx_t_4 = __Pyx_PyObject_Call(__pyx_builtin_IndexError, __pyx_t_3, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 188, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_Raise(__pyx_t_4, 0, 0, 0); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __PYX_ERR(0, 188, __pyx_L1_error) /* "pygame_sdl2/color.pyx":187 * if isinstance(key, slice): * return tuple(self)[key] * if key >= self.length: # <<<<<<<<<<<<<< * raise IndexError(key) * if key == 0: return self.r */ } /* "pygame_sdl2/color.pyx":189 * if key >= self.length: * raise IndexError(key) * if key == 0: return self.r # <<<<<<<<<<<<<< * elif key == 1: return self.g * elif key == 2: return self.b */ __pyx_t_4 = __Pyx_PyInt_EqObjC(__pyx_v_key, __pyx_int_0, 0, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 189, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 189, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; if (__pyx_t_2) { __Pyx_XDECREF(__pyx_r); __pyx_t_4 = __Pyx_PyInt_From_uint8_t(__pyx_v_self->r); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 189, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_r = __pyx_t_4; __pyx_t_4 = 0; goto __pyx_L0; } /* "pygame_sdl2/color.pyx":190 * raise IndexError(key) * if key == 0: return self.r * elif key == 1: return self.g # <<<<<<<<<<<<<< * elif key == 2: return self.b * elif key == 3: return self.a */ __pyx_t_4 = __Pyx_PyInt_EqObjC(__pyx_v_key, __pyx_int_1, 1, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 190, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 190, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; if (__pyx_t_2) { __Pyx_XDECREF(__pyx_r); __pyx_t_4 = __Pyx_PyInt_From_uint8_t(__pyx_v_self->g); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 190, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_r = __pyx_t_4; __pyx_t_4 = 0; goto __pyx_L0; } /* "pygame_sdl2/color.pyx":191 * if key == 0: return self.r * elif key == 1: return self.g * elif key == 2: return self.b # <<<<<<<<<<<<<< * elif key == 3: return self.a * else: */ __pyx_t_4 = __Pyx_PyInt_EqObjC(__pyx_v_key, __pyx_int_2, 2, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 191, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 191, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; if (__pyx_t_2) { __Pyx_XDECREF(__pyx_r); __pyx_t_4 = __Pyx_PyInt_From_uint8_t(__pyx_v_self->b); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 191, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_r = __pyx_t_4; __pyx_t_4 = 0; goto __pyx_L0; } /* "pygame_sdl2/color.pyx":192 * elif key == 1: return self.g * elif key == 2: return self.b * elif key == 3: return self.a # <<<<<<<<<<<<<< * else: * raise IndexError(key) */ __pyx_t_4 = __Pyx_PyInt_EqObjC(__pyx_v_key, __pyx_int_3, 3, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 192, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 192, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; if (__pyx_t_2) { __Pyx_XDECREF(__pyx_r); __pyx_t_4 = __Pyx_PyInt_From_uint8_t(__pyx_v_self->a); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 192, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_r = __pyx_t_4; __pyx_t_4 = 0; goto __pyx_L0; } /* "pygame_sdl2/color.pyx":194 * elif key == 3: return self.a * else: * raise IndexError(key) # <<<<<<<<<<<<<< * * def __len__(self): */ /*else*/ { __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 194, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_INCREF(__pyx_v_key); __Pyx_GIVEREF(__pyx_v_key); PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_v_key); __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_IndexError, __pyx_t_4, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 194, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_Raise(__pyx_t_3, 0, 0, 0); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __PYX_ERR(0, 194, __pyx_L1_error) } /* "pygame_sdl2/color.pyx":184 * raise IndexError(key) * * def __getitem__(self, key): # <<<<<<<<<<<<<< * if isinstance(key, slice): * return tuple(self)[key] */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_AddTraceback("pygame_sdl2.color.Color.__getitem__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/color.pyx":196 * raise IndexError(key) * * def __len__(self): # <<<<<<<<<<<<<< * return self.length * */ /* Python wrapper */ static Py_ssize_t __pyx_pw_11pygame_sdl2_5color_5Color_25__len__(PyObject *__pyx_v_self); /*proto*/ static Py_ssize_t __pyx_pw_11pygame_sdl2_5color_5Color_25__len__(PyObject *__pyx_v_self) { Py_ssize_t __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__len__ (wrapper)", 0); __pyx_r = __pyx_pf_11pygame_sdl2_5color_5Color_24__len__(((struct __pyx_obj_11pygame_sdl2_5color_Color *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static Py_ssize_t __pyx_pf_11pygame_sdl2_5color_5Color_24__len__(struct __pyx_obj_11pygame_sdl2_5color_Color *__pyx_v_self) { Py_ssize_t __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__len__", 0); /* "pygame_sdl2/color.pyx":197 * * def __len__(self): * return self.length # <<<<<<<<<<<<<< * * def __mul__(self not None, Color rhs not None): */ __pyx_r = __pyx_v_self->length; goto __pyx_L0; /* "pygame_sdl2/color.pyx":196 * raise IndexError(key) * * def __len__(self): # <<<<<<<<<<<<<< * return self.length * */ /* function exit code */ __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/color.pyx":199 * return self.length * * def __mul__(self not None, Color rhs not None): # <<<<<<<<<<<<<< * # Multiplying this way doesn't make much sense, * # but it's how pygame does it. */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_5color_5Color_27__mul__(PyObject *__pyx_v_self, PyObject *__pyx_v_rhs); /*proto*/ static PyObject *__pyx_pw_11pygame_sdl2_5color_5Color_27__mul__(PyObject *__pyx_v_self, PyObject *__pyx_v_rhs) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__mul__ (wrapper)", 0); if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) { PyErr_Format(PyExc_TypeError, "Argument '%.200s' must not be None", "self"); __PYX_ERR(0, 199, __pyx_L1_error) } if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_rhs), __pyx_ptype_11pygame_sdl2_5color_Color, 0, "rhs", 0))) __PYX_ERR(0, 199, __pyx_L1_error) __pyx_r = __pyx_pf_11pygame_sdl2_5color_5Color_26__mul__(((PyObject *)__pyx_v_self), ((struct __pyx_obj_11pygame_sdl2_5color_Color *)__pyx_v_rhs)); /* function exit code */ goto __pyx_L0; __pyx_L1_error:; __pyx_r = NULL; __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_5color_5Color_26__mul__(PyObject *__pyx_v_self, struct __pyx_obj_11pygame_sdl2_5color_Color *__pyx_v_rhs) { PyObject *__pyx_v_r = NULL; PyObject *__pyx_v_g = NULL; PyObject *__pyx_v_b = NULL; PyObject *__pyx_v_a = NULL; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; long __pyx_t_4; PyObject *__pyx_t_5 = NULL; int __pyx_t_6; Py_ssize_t __pyx_t_7; __Pyx_RefNannySetupContext("__mul__", 0); /* "pygame_sdl2/color.pyx":203 * # but it's how pygame does it. * * r = min(255, self.r * rhs.r) # <<<<<<<<<<<<<< * g = min(255, self.g * rhs.g) * b = min(255, self.b * rhs.b) */ __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_r); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 203, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = __Pyx_PyInt_From_uint8_t(__pyx_v_rhs->r); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 203, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = PyNumber_Multiply(__pyx_t_1, __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 203, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_4 = 0xFF; __pyx_t_1 = __Pyx_PyInt_From_long(__pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 203, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_5 = PyObject_RichCompare(__pyx_t_3, __pyx_t_1, Py_LT); __Pyx_XGOTREF(__pyx_t_5); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 203, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(0, 203, __pyx_L1_error) __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; if (__pyx_t_6) { __Pyx_INCREF(__pyx_t_3); __pyx_t_2 = __pyx_t_3; } else { __pyx_t_5 = __Pyx_PyInt_From_long(__pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 203, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_2 = __pyx_t_5; __pyx_t_5 = 0; } __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_3 = __pyx_t_2; __Pyx_INCREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_v_r = __pyx_t_3; __pyx_t_3 = 0; /* "pygame_sdl2/color.pyx":204 * * r = min(255, self.r * rhs.r) * g = min(255, self.g * rhs.g) # <<<<<<<<<<<<<< * b = min(255, self.b * rhs.b) * a = min(255, self.a * rhs.a) */ __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_g); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 204, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_2 = __Pyx_PyInt_From_uint8_t(__pyx_v_rhs->g); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 204, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_5 = PyNumber_Multiply(__pyx_t_3, __pyx_t_2); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 204, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_4 = 0xFF; __pyx_t_3 = __Pyx_PyInt_From_long(__pyx_t_4); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 204, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_1 = PyObject_RichCompare(__pyx_t_5, __pyx_t_3, Py_LT); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 204, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(0, 204, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (__pyx_t_6) { __Pyx_INCREF(__pyx_t_5); __pyx_t_2 = __pyx_t_5; } else { __pyx_t_1 = __Pyx_PyInt_From_long(__pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 204, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = __pyx_t_1; __pyx_t_1 = 0; } __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __pyx_t_5 = __pyx_t_2; __Pyx_INCREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_v_g = __pyx_t_5; __pyx_t_5 = 0; /* "pygame_sdl2/color.pyx":205 * r = min(255, self.r * rhs.r) * g = min(255, self.g * rhs.g) * b = min(255, self.b * rhs.b) # <<<<<<<<<<<<<< * a = min(255, self.a * rhs.a) * */ __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_b); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 205, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_2 = __Pyx_PyInt_From_uint8_t(__pyx_v_rhs->b); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 205, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_1 = PyNumber_Multiply(__pyx_t_5, __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 205, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_4 = 0xFF; __pyx_t_5 = __Pyx_PyInt_From_long(__pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 205, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_3 = PyObject_RichCompare(__pyx_t_1, __pyx_t_5, Py_LT); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 205, __pyx_L1_error) __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(0, 205, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; if (__pyx_t_6) { __Pyx_INCREF(__pyx_t_1); __pyx_t_2 = __pyx_t_1; } else { __pyx_t_3 = __Pyx_PyInt_From_long(__pyx_t_4); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 205, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_2 = __pyx_t_3; __pyx_t_3 = 0; } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_1 = __pyx_t_2; __Pyx_INCREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_v_b = __pyx_t_1; __pyx_t_1 = 0; /* "pygame_sdl2/color.pyx":206 * g = min(255, self.g * rhs.g) * b = min(255, self.b * rhs.b) * a = min(255, self.a * rhs.a) # <<<<<<<<<<<<<< * * return type(self)(r, g, b, a) */ __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_a); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 206, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = __Pyx_PyInt_From_uint8_t(__pyx_v_rhs->a); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 206, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = PyNumber_Multiply(__pyx_t_1, __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 206, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_4 = 0xFF; __pyx_t_1 = __Pyx_PyInt_From_long(__pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 206, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_5 = PyObject_RichCompare(__pyx_t_3, __pyx_t_1, Py_LT); __Pyx_XGOTREF(__pyx_t_5); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 206, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(0, 206, __pyx_L1_error) __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; if (__pyx_t_6) { __Pyx_INCREF(__pyx_t_3); __pyx_t_2 = __pyx_t_3; } else { __pyx_t_5 = __Pyx_PyInt_From_long(__pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 206, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_2 = __pyx_t_5; __pyx_t_5 = 0; } __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_3 = __pyx_t_2; __Pyx_INCREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_v_a = __pyx_t_3; __pyx_t_3 = 0; /* "pygame_sdl2/color.pyx":208 * a = min(255, self.a * rhs.a) * * return type(self)(r, g, b, a) # <<<<<<<<<<<<<< * * def __add__(self not None, Color rhs not None): */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(((PyObject *)Py_TYPE(__pyx_v_self))); __pyx_t_2 = ((PyObject *)Py_TYPE(__pyx_v_self)); __pyx_t_5 = NULL; __pyx_t_7 = 0; if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_2))) { __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_2); if (likely(__pyx_t_5)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_5); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); __pyx_t_7 = 1; } } __pyx_t_1 = PyTuple_New(4+__pyx_t_7); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 208, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (__pyx_t_5) { __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_5); __pyx_t_5 = NULL; } __Pyx_INCREF(__pyx_v_r); __Pyx_GIVEREF(__pyx_v_r); PyTuple_SET_ITEM(__pyx_t_1, 0+__pyx_t_7, __pyx_v_r); __Pyx_INCREF(__pyx_v_g); __Pyx_GIVEREF(__pyx_v_g); PyTuple_SET_ITEM(__pyx_t_1, 1+__pyx_t_7, __pyx_v_g); __Pyx_INCREF(__pyx_v_b); __Pyx_GIVEREF(__pyx_v_b); PyTuple_SET_ITEM(__pyx_t_1, 2+__pyx_t_7, __pyx_v_b); __Pyx_INCREF(__pyx_v_a); __Pyx_GIVEREF(__pyx_v_a); PyTuple_SET_ITEM(__pyx_t_1, 3+__pyx_t_7, __pyx_v_a); __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_1, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 208, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_r = __pyx_t_3; __pyx_t_3 = 0; goto __pyx_L0; /* "pygame_sdl2/color.pyx":199 * return self.length * * def __mul__(self not None, Color rhs not None): # <<<<<<<<<<<<<< * # Multiplying this way doesn't make much sense, * # but it's how pygame does it. */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_5); __Pyx_AddTraceback("pygame_sdl2.color.Color.__mul__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF(__pyx_v_r); __Pyx_XDECREF(__pyx_v_g); __Pyx_XDECREF(__pyx_v_b); __Pyx_XDECREF(__pyx_v_a); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/color.pyx":210 * return type(self)(r, g, b, a) * * def __add__(self not None, Color rhs not None): # <<<<<<<<<<<<<< * r = min(255, self.r + rhs.r) * g = min(255, self.g + rhs.g) */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_5color_5Color_29__add__(PyObject *__pyx_v_self, PyObject *__pyx_v_rhs); /*proto*/ static PyObject *__pyx_pw_11pygame_sdl2_5color_5Color_29__add__(PyObject *__pyx_v_self, PyObject *__pyx_v_rhs) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__add__ (wrapper)", 0); if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) { PyErr_Format(PyExc_TypeError, "Argument '%.200s' must not be None", "self"); __PYX_ERR(0, 210, __pyx_L1_error) } if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_rhs), __pyx_ptype_11pygame_sdl2_5color_Color, 0, "rhs", 0))) __PYX_ERR(0, 210, __pyx_L1_error) __pyx_r = __pyx_pf_11pygame_sdl2_5color_5Color_28__add__(((PyObject *)__pyx_v_self), ((struct __pyx_obj_11pygame_sdl2_5color_Color *)__pyx_v_rhs)); /* function exit code */ goto __pyx_L0; __pyx_L1_error:; __pyx_r = NULL; __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_5color_5Color_28__add__(PyObject *__pyx_v_self, struct __pyx_obj_11pygame_sdl2_5color_Color *__pyx_v_rhs) { PyObject *__pyx_v_r = NULL; PyObject *__pyx_v_g = NULL; PyObject *__pyx_v_b = NULL; PyObject *__pyx_v_a = NULL; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; long __pyx_t_4; PyObject *__pyx_t_5 = NULL; int __pyx_t_6; Py_ssize_t __pyx_t_7; __Pyx_RefNannySetupContext("__add__", 0); /* "pygame_sdl2/color.pyx":211 * * def __add__(self not None, Color rhs not None): * r = min(255, self.r + rhs.r) # <<<<<<<<<<<<<< * g = min(255, self.g + rhs.g) * b = min(255, self.b + rhs.b) */ __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_r); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 211, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = __Pyx_PyInt_From_uint8_t(__pyx_v_rhs->r); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 211, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = PyNumber_Add(__pyx_t_1, __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 211, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_4 = 0xFF; __pyx_t_1 = __Pyx_PyInt_From_long(__pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 211, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_5 = PyObject_RichCompare(__pyx_t_3, __pyx_t_1, Py_LT); __Pyx_XGOTREF(__pyx_t_5); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 211, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(0, 211, __pyx_L1_error) __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; if (__pyx_t_6) { __Pyx_INCREF(__pyx_t_3); __pyx_t_2 = __pyx_t_3; } else { __pyx_t_5 = __Pyx_PyInt_From_long(__pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 211, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_2 = __pyx_t_5; __pyx_t_5 = 0; } __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_3 = __pyx_t_2; __Pyx_INCREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_v_r = __pyx_t_3; __pyx_t_3 = 0; /* "pygame_sdl2/color.pyx":212 * def __add__(self not None, Color rhs not None): * r = min(255, self.r + rhs.r) * g = min(255, self.g + rhs.g) # <<<<<<<<<<<<<< * b = min(255, self.b + rhs.b) * a = min(255, self.a + rhs.a) */ __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_g); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 212, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_2 = __Pyx_PyInt_From_uint8_t(__pyx_v_rhs->g); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 212, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_5 = PyNumber_Add(__pyx_t_3, __pyx_t_2); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 212, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_4 = 0xFF; __pyx_t_3 = __Pyx_PyInt_From_long(__pyx_t_4); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 212, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_1 = PyObject_RichCompare(__pyx_t_5, __pyx_t_3, Py_LT); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 212, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(0, 212, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (__pyx_t_6) { __Pyx_INCREF(__pyx_t_5); __pyx_t_2 = __pyx_t_5; } else { __pyx_t_1 = __Pyx_PyInt_From_long(__pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 212, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = __pyx_t_1; __pyx_t_1 = 0; } __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __pyx_t_5 = __pyx_t_2; __Pyx_INCREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_v_g = __pyx_t_5; __pyx_t_5 = 0; /* "pygame_sdl2/color.pyx":213 * r = min(255, self.r + rhs.r) * g = min(255, self.g + rhs.g) * b = min(255, self.b + rhs.b) # <<<<<<<<<<<<<< * a = min(255, self.a + rhs.a) * */ __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_b); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 213, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_2 = __Pyx_PyInt_From_uint8_t(__pyx_v_rhs->b); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 213, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_1 = PyNumber_Add(__pyx_t_5, __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 213, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_4 = 0xFF; __pyx_t_5 = __Pyx_PyInt_From_long(__pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 213, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_3 = PyObject_RichCompare(__pyx_t_1, __pyx_t_5, Py_LT); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 213, __pyx_L1_error) __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(0, 213, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; if (__pyx_t_6) { __Pyx_INCREF(__pyx_t_1); __pyx_t_2 = __pyx_t_1; } else { __pyx_t_3 = __Pyx_PyInt_From_long(__pyx_t_4); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 213, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_2 = __pyx_t_3; __pyx_t_3 = 0; } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_1 = __pyx_t_2; __Pyx_INCREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_v_b = __pyx_t_1; __pyx_t_1 = 0; /* "pygame_sdl2/color.pyx":214 * g = min(255, self.g + rhs.g) * b = min(255, self.b + rhs.b) * a = min(255, self.a + rhs.a) # <<<<<<<<<<<<<< * * return type(self)(r, g, b, a) */ __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_a); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 214, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = __Pyx_PyInt_From_uint8_t(__pyx_v_rhs->a); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 214, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = PyNumber_Add(__pyx_t_1, __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 214, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_4 = 0xFF; __pyx_t_1 = __Pyx_PyInt_From_long(__pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 214, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_5 = PyObject_RichCompare(__pyx_t_3, __pyx_t_1, Py_LT); __Pyx_XGOTREF(__pyx_t_5); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 214, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(0, 214, __pyx_L1_error) __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; if (__pyx_t_6) { __Pyx_INCREF(__pyx_t_3); __pyx_t_2 = __pyx_t_3; } else { __pyx_t_5 = __Pyx_PyInt_From_long(__pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 214, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_2 = __pyx_t_5; __pyx_t_5 = 0; } __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_3 = __pyx_t_2; __Pyx_INCREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_v_a = __pyx_t_3; __pyx_t_3 = 0; /* "pygame_sdl2/color.pyx":216 * a = min(255, self.a + rhs.a) * * return type(self)(r, g, b, a) # <<<<<<<<<<<<<< * * def __sub__(self not None, Color rhs not None): */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(((PyObject *)Py_TYPE(__pyx_v_self))); __pyx_t_2 = ((PyObject *)Py_TYPE(__pyx_v_self)); __pyx_t_5 = NULL; __pyx_t_7 = 0; if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_2))) { __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_2); if (likely(__pyx_t_5)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_5); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); __pyx_t_7 = 1; } } __pyx_t_1 = PyTuple_New(4+__pyx_t_7); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 216, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (__pyx_t_5) { __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_5); __pyx_t_5 = NULL; } __Pyx_INCREF(__pyx_v_r); __Pyx_GIVEREF(__pyx_v_r); PyTuple_SET_ITEM(__pyx_t_1, 0+__pyx_t_7, __pyx_v_r); __Pyx_INCREF(__pyx_v_g); __Pyx_GIVEREF(__pyx_v_g); PyTuple_SET_ITEM(__pyx_t_1, 1+__pyx_t_7, __pyx_v_g); __Pyx_INCREF(__pyx_v_b); __Pyx_GIVEREF(__pyx_v_b); PyTuple_SET_ITEM(__pyx_t_1, 2+__pyx_t_7, __pyx_v_b); __Pyx_INCREF(__pyx_v_a); __Pyx_GIVEREF(__pyx_v_a); PyTuple_SET_ITEM(__pyx_t_1, 3+__pyx_t_7, __pyx_v_a); __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_1, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 216, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_r = __pyx_t_3; __pyx_t_3 = 0; goto __pyx_L0; /* "pygame_sdl2/color.pyx":210 * return type(self)(r, g, b, a) * * def __add__(self not None, Color rhs not None): # <<<<<<<<<<<<<< * r = min(255, self.r + rhs.r) * g = min(255, self.g + rhs.g) */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_5); __Pyx_AddTraceback("pygame_sdl2.color.Color.__add__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF(__pyx_v_r); __Pyx_XDECREF(__pyx_v_g); __Pyx_XDECREF(__pyx_v_b); __Pyx_XDECREF(__pyx_v_a); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/color.pyx":218 * return type(self)(r, g, b, a) * * def __sub__(self not None, Color rhs not None): # <<<<<<<<<<<<<< * r = max(0, self.r - rhs.r) * g = max(0, self.g - rhs.g) */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_5color_5Color_31__sub__(PyObject *__pyx_v_self, PyObject *__pyx_v_rhs); /*proto*/ static PyObject *__pyx_pw_11pygame_sdl2_5color_5Color_31__sub__(PyObject *__pyx_v_self, PyObject *__pyx_v_rhs) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__sub__ (wrapper)", 0); if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) { PyErr_Format(PyExc_TypeError, "Argument '%.200s' must not be None", "self"); __PYX_ERR(0, 218, __pyx_L1_error) } if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_rhs), __pyx_ptype_11pygame_sdl2_5color_Color, 0, "rhs", 0))) __PYX_ERR(0, 218, __pyx_L1_error) __pyx_r = __pyx_pf_11pygame_sdl2_5color_5Color_30__sub__(((PyObject *)__pyx_v_self), ((struct __pyx_obj_11pygame_sdl2_5color_Color *)__pyx_v_rhs)); /* function exit code */ goto __pyx_L0; __pyx_L1_error:; __pyx_r = NULL; __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_5color_5Color_30__sub__(PyObject *__pyx_v_self, struct __pyx_obj_11pygame_sdl2_5color_Color *__pyx_v_rhs) { PyObject *__pyx_v_r = NULL; PyObject *__pyx_v_g = NULL; PyObject *__pyx_v_b = NULL; PyObject *__pyx_v_a = NULL; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; long __pyx_t_4; PyObject *__pyx_t_5 = NULL; int __pyx_t_6; Py_ssize_t __pyx_t_7; __Pyx_RefNannySetupContext("__sub__", 0); /* "pygame_sdl2/color.pyx":219 * * def __sub__(self not None, Color rhs not None): * r = max(0, self.r - rhs.r) # <<<<<<<<<<<<<< * g = max(0, self.g - rhs.g) * b = max(0, self.b - rhs.b) */ __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_r); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 219, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = __Pyx_PyInt_From_uint8_t(__pyx_v_rhs->r); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 219, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = PyNumber_Subtract(__pyx_t_1, __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 219, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_4 = 0; __pyx_t_1 = __Pyx_PyInt_From_long(__pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 219, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_5 = PyObject_RichCompare(__pyx_t_3, __pyx_t_1, Py_GT); __Pyx_XGOTREF(__pyx_t_5); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 219, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(0, 219, __pyx_L1_error) __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; if (__pyx_t_6) { __Pyx_INCREF(__pyx_t_3); __pyx_t_2 = __pyx_t_3; } else { __pyx_t_5 = __Pyx_PyInt_From_long(__pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 219, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_2 = __pyx_t_5; __pyx_t_5 = 0; } __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_3 = __pyx_t_2; __Pyx_INCREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_v_r = __pyx_t_3; __pyx_t_3 = 0; /* "pygame_sdl2/color.pyx":220 * def __sub__(self not None, Color rhs not None): * r = max(0, self.r - rhs.r) * g = max(0, self.g - rhs.g) # <<<<<<<<<<<<<< * b = max(0, self.b - rhs.b) * a = max(0, self.a - rhs.a) */ __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_g); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 220, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_2 = __Pyx_PyInt_From_uint8_t(__pyx_v_rhs->g); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 220, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_5 = PyNumber_Subtract(__pyx_t_3, __pyx_t_2); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 220, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_4 = 0; __pyx_t_3 = __Pyx_PyInt_From_long(__pyx_t_4); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 220, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_1 = PyObject_RichCompare(__pyx_t_5, __pyx_t_3, Py_GT); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 220, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(0, 220, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (__pyx_t_6) { __Pyx_INCREF(__pyx_t_5); __pyx_t_2 = __pyx_t_5; } else { __pyx_t_1 = __Pyx_PyInt_From_long(__pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 220, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = __pyx_t_1; __pyx_t_1 = 0; } __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __pyx_t_5 = __pyx_t_2; __Pyx_INCREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_v_g = __pyx_t_5; __pyx_t_5 = 0; /* "pygame_sdl2/color.pyx":221 * r = max(0, self.r - rhs.r) * g = max(0, self.g - rhs.g) * b = max(0, self.b - rhs.b) # <<<<<<<<<<<<<< * a = max(0, self.a - rhs.a) * */ __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_b); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 221, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_2 = __Pyx_PyInt_From_uint8_t(__pyx_v_rhs->b); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 221, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_1 = PyNumber_Subtract(__pyx_t_5, __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 221, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_4 = 0; __pyx_t_5 = __Pyx_PyInt_From_long(__pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 221, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_3 = PyObject_RichCompare(__pyx_t_1, __pyx_t_5, Py_GT); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 221, __pyx_L1_error) __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(0, 221, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; if (__pyx_t_6) { __Pyx_INCREF(__pyx_t_1); __pyx_t_2 = __pyx_t_1; } else { __pyx_t_3 = __Pyx_PyInt_From_long(__pyx_t_4); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 221, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_2 = __pyx_t_3; __pyx_t_3 = 0; } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_1 = __pyx_t_2; __Pyx_INCREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_v_b = __pyx_t_1; __pyx_t_1 = 0; /* "pygame_sdl2/color.pyx":222 * g = max(0, self.g - rhs.g) * b = max(0, self.b - rhs.b) * a = max(0, self.a - rhs.a) # <<<<<<<<<<<<<< * * return type(self)(r, g, b, a) */ __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_a); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 222, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = __Pyx_PyInt_From_uint8_t(__pyx_v_rhs->a); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 222, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = PyNumber_Subtract(__pyx_t_1, __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 222, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_4 = 0; __pyx_t_1 = __Pyx_PyInt_From_long(__pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 222, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_5 = PyObject_RichCompare(__pyx_t_3, __pyx_t_1, Py_GT); __Pyx_XGOTREF(__pyx_t_5); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 222, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(0, 222, __pyx_L1_error) __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; if (__pyx_t_6) { __Pyx_INCREF(__pyx_t_3); __pyx_t_2 = __pyx_t_3; } else { __pyx_t_5 = __Pyx_PyInt_From_long(__pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 222, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_2 = __pyx_t_5; __pyx_t_5 = 0; } __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_3 = __pyx_t_2; __Pyx_INCREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_v_a = __pyx_t_3; __pyx_t_3 = 0; /* "pygame_sdl2/color.pyx":224 * a = max(0, self.a - rhs.a) * * return type(self)(r, g, b, a) # <<<<<<<<<<<<<< * * def __mod__(self not None, Color rhs not None): */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(((PyObject *)Py_TYPE(__pyx_v_self))); __pyx_t_2 = ((PyObject *)Py_TYPE(__pyx_v_self)); __pyx_t_5 = NULL; __pyx_t_7 = 0; if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_2))) { __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_2); if (likely(__pyx_t_5)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_5); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); __pyx_t_7 = 1; } } __pyx_t_1 = PyTuple_New(4+__pyx_t_7); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 224, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (__pyx_t_5) { __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_5); __pyx_t_5 = NULL; } __Pyx_INCREF(__pyx_v_r); __Pyx_GIVEREF(__pyx_v_r); PyTuple_SET_ITEM(__pyx_t_1, 0+__pyx_t_7, __pyx_v_r); __Pyx_INCREF(__pyx_v_g); __Pyx_GIVEREF(__pyx_v_g); PyTuple_SET_ITEM(__pyx_t_1, 1+__pyx_t_7, __pyx_v_g); __Pyx_INCREF(__pyx_v_b); __Pyx_GIVEREF(__pyx_v_b); PyTuple_SET_ITEM(__pyx_t_1, 2+__pyx_t_7, __pyx_v_b); __Pyx_INCREF(__pyx_v_a); __Pyx_GIVEREF(__pyx_v_a); PyTuple_SET_ITEM(__pyx_t_1, 3+__pyx_t_7, __pyx_v_a); __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_1, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 224, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_r = __pyx_t_3; __pyx_t_3 = 0; goto __pyx_L0; /* "pygame_sdl2/color.pyx":218 * return type(self)(r, g, b, a) * * def __sub__(self not None, Color rhs not None): # <<<<<<<<<<<<<< * r = max(0, self.r - rhs.r) * g = max(0, self.g - rhs.g) */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_5); __Pyx_AddTraceback("pygame_sdl2.color.Color.__sub__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF(__pyx_v_r); __Pyx_XDECREF(__pyx_v_g); __Pyx_XDECREF(__pyx_v_b); __Pyx_XDECREF(__pyx_v_a); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/color.pyx":226 * return type(self)(r, g, b, a) * * def __mod__(self not None, Color rhs not None): # <<<<<<<<<<<<<< * * def mod(l, r): */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_5color_5Color_33__mod__(PyObject *__pyx_v_self, PyObject *__pyx_v_rhs); /*proto*/ static PyObject *__pyx_pw_11pygame_sdl2_5color_5Color_33__mod__(PyObject *__pyx_v_self, PyObject *__pyx_v_rhs) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__mod__ (wrapper)", 0); if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) { PyErr_Format(PyExc_TypeError, "Argument '%.200s' must not be None", "self"); __PYX_ERR(0, 226, __pyx_L1_error) } if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_rhs), __pyx_ptype_11pygame_sdl2_5color_Color, 0, "rhs", 0))) __PYX_ERR(0, 226, __pyx_L1_error) __pyx_r = __pyx_pf_11pygame_sdl2_5color_5Color_32__mod__(((PyObject *)__pyx_v_self), ((struct __pyx_obj_11pygame_sdl2_5color_Color *)__pyx_v_rhs)); /* function exit code */ goto __pyx_L0; __pyx_L1_error:; __pyx_r = NULL; __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/color.pyx":228 * def __mod__(self not None, Color rhs not None): * * def mod(l, r): # <<<<<<<<<<<<<< * if r == 0: * return 0 */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_5color_5Color_7__mod___1mod(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static PyMethodDef __pyx_mdef_11pygame_sdl2_5color_5Color_7__mod___1mod = {"mod", (PyCFunction)__pyx_pw_11pygame_sdl2_5color_5Color_7__mod___1mod, METH_VARARGS|METH_KEYWORDS, 0}; static PyObject *__pyx_pw_11pygame_sdl2_5color_5Color_7__mod___1mod(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_l = 0; PyObject *__pyx_v_r = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("mod (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_l,&__pyx_n_s_r,0}; PyObject* values[2] = {0,0}; if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_l)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; case 1: if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_r)) != 0)) kw_args--; else { __Pyx_RaiseArgtupleInvalid("mod", 1, 2, 2, 1); __PYX_ERR(0, 228, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "mod") < 0)) __PYX_ERR(0, 228, __pyx_L3_error) } } else if (PyTuple_GET_SIZE(__pyx_args) != 2) { goto __pyx_L5_argtuple_error; } else { values[0] = PyTuple_GET_ITEM(__pyx_args, 0); values[1] = PyTuple_GET_ITEM(__pyx_args, 1); } __pyx_v_l = values[0]; __pyx_v_r = values[1]; } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("mod", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 228, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("pygame_sdl2.color.Color.__mod__.mod", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_11pygame_sdl2_5color_5Color_7__mod___mod(__pyx_self, __pyx_v_l, __pyx_v_r); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_5color_5Color_7__mod___mod(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_l, PyObject *__pyx_v_r) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_t_2; __Pyx_RefNannySetupContext("mod", 0); /* "pygame_sdl2/color.pyx":229 * * def mod(l, r): * if r == 0: # <<<<<<<<<<<<<< * return 0 * */ __pyx_t_1 = __Pyx_PyInt_EqObjC(__pyx_v_r, __pyx_int_0, 0, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 229, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 229, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (__pyx_t_2) { /* "pygame_sdl2/color.pyx":230 * def mod(l, r): * if r == 0: * return 0 # <<<<<<<<<<<<<< * * return l % r */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(__pyx_int_0); __pyx_r = __pyx_int_0; goto __pyx_L0; /* "pygame_sdl2/color.pyx":229 * * def mod(l, r): * if r == 0: # <<<<<<<<<<<<<< * return 0 * */ } /* "pygame_sdl2/color.pyx":232 * return 0 * * return l % r # <<<<<<<<<<<<<< * * r = mod(self.r, rhs.r) */ __Pyx_XDECREF(__pyx_r); __pyx_t_1 = PyNumber_Remainder(__pyx_v_l, __pyx_v_r); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 232, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "pygame_sdl2/color.pyx":228 * def __mod__(self not None, Color rhs not None): * * def mod(l, r): # <<<<<<<<<<<<<< * if r == 0: * return 0 */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("pygame_sdl2.color.Color.__mod__.mod", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/color.pyx":226 * return type(self)(r, g, b, a) * * def __mod__(self not None, Color rhs not None): # <<<<<<<<<<<<<< * * def mod(l, r): */ static PyObject *__pyx_pf_11pygame_sdl2_5color_5Color_32__mod__(PyObject *__pyx_v_self, struct __pyx_obj_11pygame_sdl2_5color_Color *__pyx_v_rhs) { PyObject *__pyx_v_mod = 0; PyObject *__pyx_v_r = NULL; PyObject *__pyx_v_g = NULL; PyObject *__pyx_v_b = NULL; PyObject *__pyx_v_a = NULL; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; Py_ssize_t __pyx_t_4; PyObject *__pyx_t_5 = NULL; __Pyx_RefNannySetupContext("__mod__", 0); /* "pygame_sdl2/color.pyx":228 * def __mod__(self not None, Color rhs not None): * * def mod(l, r): # <<<<<<<<<<<<<< * if r == 0: * return 0 */ __pyx_t_1 = __Pyx_CyFunction_NewEx(&__pyx_mdef_11pygame_sdl2_5color_5Color_7__mod___1mod, 0, __pyx_n_s_mod___locals_mod, NULL, __pyx_n_s_pygame_sdl2_color, __pyx_d, ((PyObject *)__pyx_codeobj__9)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 228, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_mod = __pyx_t_1; __pyx_t_1 = 0; /* "pygame_sdl2/color.pyx":234 * return l % r * * r = mod(self.r, rhs.r) # <<<<<<<<<<<<<< * g = mod(self.g, rhs.g) * b = mod(self.b, rhs.b) */ __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_r); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 234, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = __Pyx_PyInt_From_uint8_t(__pyx_v_rhs->r); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 234, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = __pyx_pf_11pygame_sdl2_5color_5Color_7__mod___mod(__pyx_v_mod, __pyx_t_1, __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 234, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_v_r = __pyx_t_3; __pyx_t_3 = 0; /* "pygame_sdl2/color.pyx":235 * * r = mod(self.r, rhs.r) * g = mod(self.g, rhs.g) # <<<<<<<<<<<<<< * b = mod(self.b, rhs.b) * a = mod(self.a, rhs.a) */ __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_g); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 235, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_2 = __Pyx_PyInt_From_uint8_t(__pyx_v_rhs->g); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 235, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_1 = __pyx_pf_11pygame_sdl2_5color_5Color_7__mod___mod(__pyx_v_mod, __pyx_t_3, __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 235, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_v_g = __pyx_t_1; __pyx_t_1 = 0; /* "pygame_sdl2/color.pyx":236 * r = mod(self.r, rhs.r) * g = mod(self.g, rhs.g) * b = mod(self.b, rhs.b) # <<<<<<<<<<<<<< * a = mod(self.a, rhs.a) * */ __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_b); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 236, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = __Pyx_PyInt_From_uint8_t(__pyx_v_rhs->b); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 236, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = __pyx_pf_11pygame_sdl2_5color_5Color_7__mod___mod(__pyx_v_mod, __pyx_t_1, __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 236, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_v_b = __pyx_t_3; __pyx_t_3 = 0; /* "pygame_sdl2/color.pyx":237 * g = mod(self.g, rhs.g) * b = mod(self.b, rhs.b) * a = mod(self.a, rhs.a) # <<<<<<<<<<<<<< * * return type(self)(r, g, b, a) */ __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_a); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 237, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_2 = __Pyx_PyInt_From_uint8_t(__pyx_v_rhs->a); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 237, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_1 = __pyx_pf_11pygame_sdl2_5color_5Color_7__mod___mod(__pyx_v_mod, __pyx_t_3, __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 237, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_v_a = __pyx_t_1; __pyx_t_1 = 0; /* "pygame_sdl2/color.pyx":239 * a = mod(self.a, rhs.a) * * return type(self)(r, g, b, a) # <<<<<<<<<<<<<< * * def __div__(self not None, Color rhs not None): */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(((PyObject *)Py_TYPE(__pyx_v_self))); __pyx_t_2 = ((PyObject *)Py_TYPE(__pyx_v_self)); __pyx_t_3 = NULL; __pyx_t_4 = 0; if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_2))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); if (likely(__pyx_t_3)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); __pyx_t_4 = 1; } } __pyx_t_5 = PyTuple_New(4+__pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 239, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); if (__pyx_t_3) { __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_3); __pyx_t_3 = NULL; } __Pyx_INCREF(__pyx_v_r); __Pyx_GIVEREF(__pyx_v_r); PyTuple_SET_ITEM(__pyx_t_5, 0+__pyx_t_4, __pyx_v_r); __Pyx_INCREF(__pyx_v_g); __Pyx_GIVEREF(__pyx_v_g); PyTuple_SET_ITEM(__pyx_t_5, 1+__pyx_t_4, __pyx_v_g); __Pyx_INCREF(__pyx_v_b); __Pyx_GIVEREF(__pyx_v_b); PyTuple_SET_ITEM(__pyx_t_5, 2+__pyx_t_4, __pyx_v_b); __Pyx_INCREF(__pyx_v_a); __Pyx_GIVEREF(__pyx_v_a); PyTuple_SET_ITEM(__pyx_t_5, 3+__pyx_t_4, __pyx_v_a); __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_5, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 239, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "pygame_sdl2/color.pyx":226 * return type(self)(r, g, b, a) * * def __mod__(self not None, Color rhs not None): # <<<<<<<<<<<<<< * * def mod(l, r): */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_5); __Pyx_AddTraceback("pygame_sdl2.color.Color.__mod__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF(__pyx_v_mod); __Pyx_XDECREF(__pyx_v_r); __Pyx_XDECREF(__pyx_v_g); __Pyx_XDECREF(__pyx_v_b); __Pyx_XDECREF(__pyx_v_a); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/color.pyx":241 * return type(self)(r, g, b, a) * * def __div__(self not None, Color rhs not None): # <<<<<<<<<<<<<< * r = min(255, self.r / rhs.r) * g = min(255, self.g / rhs.g) */ /* Python wrapper */ #if PY_MAJOR_VERSION < 3 || CYTHON_COMPILING_IN_PYPY static PyObject *__pyx_pw_11pygame_sdl2_5color_5Color_35__div__(PyObject *__pyx_v_self, PyObject *__pyx_v_rhs); /*proto*/ static PyObject *__pyx_pw_11pygame_sdl2_5color_5Color_35__div__(PyObject *__pyx_v_self, PyObject *__pyx_v_rhs) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__div__ (wrapper)", 0); if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) { PyErr_Format(PyExc_TypeError, "Argument '%.200s' must not be None", "self"); __PYX_ERR(0, 241, __pyx_L1_error) } if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_rhs), __pyx_ptype_11pygame_sdl2_5color_Color, 0, "rhs", 0))) __PYX_ERR(0, 241, __pyx_L1_error) __pyx_r = __pyx_pf_11pygame_sdl2_5color_5Color_34__div__(((PyObject *)__pyx_v_self), ((struct __pyx_obj_11pygame_sdl2_5color_Color *)__pyx_v_rhs)); /* function exit code */ goto __pyx_L0; __pyx_L1_error:; __pyx_r = NULL; __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; } #endif /*!(#if PY_MAJOR_VERSION < 3 || CYTHON_COMPILING_IN_PYPY)*/ #if PY_MAJOR_VERSION < 3 || CYTHON_COMPILING_IN_PYPY static PyObject *__pyx_pf_11pygame_sdl2_5color_5Color_34__div__(PyObject *__pyx_v_self, struct __pyx_obj_11pygame_sdl2_5color_Color *__pyx_v_rhs) { PyObject *__pyx_v_r = NULL; PyObject *__pyx_v_g = NULL; PyObject *__pyx_v_b = NULL; PyObject *__pyx_v_a = NULL; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; long __pyx_t_4; PyObject *__pyx_t_5 = NULL; int __pyx_t_6; Py_ssize_t __pyx_t_7; __Pyx_RefNannySetupContext("__div__", 0); /* "pygame_sdl2/color.pyx":242 * * def __div__(self not None, Color rhs not None): * r = min(255, self.r / rhs.r) # <<<<<<<<<<<<<< * g = min(255, self.g / rhs.g) * b = min(255, self.b / rhs.b) */ __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_r); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 242, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = __Pyx_PyInt_From_uint8_t(__pyx_v_rhs->r); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 242, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = __Pyx_PyNumber_Divide(__pyx_t_1, __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 242, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_4 = 0xFF; __pyx_t_1 = __Pyx_PyInt_From_long(__pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 242, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_5 = PyObject_RichCompare(__pyx_t_3, __pyx_t_1, Py_LT); __Pyx_XGOTREF(__pyx_t_5); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 242, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(0, 242, __pyx_L1_error) __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; if (__pyx_t_6) { __Pyx_INCREF(__pyx_t_3); __pyx_t_2 = __pyx_t_3; } else { __pyx_t_5 = __Pyx_PyInt_From_long(__pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 242, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_2 = __pyx_t_5; __pyx_t_5 = 0; } __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_3 = __pyx_t_2; __Pyx_INCREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_v_r = __pyx_t_3; __pyx_t_3 = 0; /* "pygame_sdl2/color.pyx":243 * def __div__(self not None, Color rhs not None): * r = min(255, self.r / rhs.r) * g = min(255, self.g / rhs.g) # <<<<<<<<<<<<<< * b = min(255, self.b / rhs.b) * a = min(255, self.a / rhs.a) */ __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_g); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 243, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_2 = __Pyx_PyInt_From_uint8_t(__pyx_v_rhs->g); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 243, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_5 = __Pyx_PyNumber_Divide(__pyx_t_3, __pyx_t_2); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 243, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_4 = 0xFF; __pyx_t_3 = __Pyx_PyInt_From_long(__pyx_t_4); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 243, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_1 = PyObject_RichCompare(__pyx_t_5, __pyx_t_3, Py_LT); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 243, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(0, 243, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (__pyx_t_6) { __Pyx_INCREF(__pyx_t_5); __pyx_t_2 = __pyx_t_5; } else { __pyx_t_1 = __Pyx_PyInt_From_long(__pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 243, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = __pyx_t_1; __pyx_t_1 = 0; } __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __pyx_t_5 = __pyx_t_2; __Pyx_INCREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_v_g = __pyx_t_5; __pyx_t_5 = 0; /* "pygame_sdl2/color.pyx":244 * r = min(255, self.r / rhs.r) * g = min(255, self.g / rhs.g) * b = min(255, self.b / rhs.b) # <<<<<<<<<<<<<< * a = min(255, self.a / rhs.a) * */ __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_b); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 244, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_2 = __Pyx_PyInt_From_uint8_t(__pyx_v_rhs->b); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 244, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_1 = __Pyx_PyNumber_Divide(__pyx_t_5, __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 244, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_4 = 0xFF; __pyx_t_5 = __Pyx_PyInt_From_long(__pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 244, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_3 = PyObject_RichCompare(__pyx_t_1, __pyx_t_5, Py_LT); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 244, __pyx_L1_error) __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(0, 244, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; if (__pyx_t_6) { __Pyx_INCREF(__pyx_t_1); __pyx_t_2 = __pyx_t_1; } else { __pyx_t_3 = __Pyx_PyInt_From_long(__pyx_t_4); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 244, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_2 = __pyx_t_3; __pyx_t_3 = 0; } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_1 = __pyx_t_2; __Pyx_INCREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_v_b = __pyx_t_1; __pyx_t_1 = 0; /* "pygame_sdl2/color.pyx":245 * g = min(255, self.g / rhs.g) * b = min(255, self.b / rhs.b) * a = min(255, self.a / rhs.a) # <<<<<<<<<<<<<< * * return type(self)(r, g, b, a) */ __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_a); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 245, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = __Pyx_PyInt_From_uint8_t(__pyx_v_rhs->a); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 245, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = __Pyx_PyNumber_Divide(__pyx_t_1, __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 245, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_4 = 0xFF; __pyx_t_1 = __Pyx_PyInt_From_long(__pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 245, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_5 = PyObject_RichCompare(__pyx_t_3, __pyx_t_1, Py_LT); __Pyx_XGOTREF(__pyx_t_5); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 245, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(0, 245, __pyx_L1_error) __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; if (__pyx_t_6) { __Pyx_INCREF(__pyx_t_3); __pyx_t_2 = __pyx_t_3; } else { __pyx_t_5 = __Pyx_PyInt_From_long(__pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 245, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_2 = __pyx_t_5; __pyx_t_5 = 0; } __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_3 = __pyx_t_2; __Pyx_INCREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_v_a = __pyx_t_3; __pyx_t_3 = 0; /* "pygame_sdl2/color.pyx":247 * a = min(255, self.a / rhs.a) * * return type(self)(r, g, b, a) # <<<<<<<<<<<<<< * * def __floordiv__(self not None, Color rhs not None): */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(((PyObject *)Py_TYPE(__pyx_v_self))); __pyx_t_2 = ((PyObject *)Py_TYPE(__pyx_v_self)); __pyx_t_5 = NULL; __pyx_t_7 = 0; if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_2))) { __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_2); if (likely(__pyx_t_5)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_5); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); __pyx_t_7 = 1; } } __pyx_t_1 = PyTuple_New(4+__pyx_t_7); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 247, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (__pyx_t_5) { __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_5); __pyx_t_5 = NULL; } __Pyx_INCREF(__pyx_v_r); __Pyx_GIVEREF(__pyx_v_r); PyTuple_SET_ITEM(__pyx_t_1, 0+__pyx_t_7, __pyx_v_r); __Pyx_INCREF(__pyx_v_g); __Pyx_GIVEREF(__pyx_v_g); PyTuple_SET_ITEM(__pyx_t_1, 1+__pyx_t_7, __pyx_v_g); __Pyx_INCREF(__pyx_v_b); __Pyx_GIVEREF(__pyx_v_b); PyTuple_SET_ITEM(__pyx_t_1, 2+__pyx_t_7, __pyx_v_b); __Pyx_INCREF(__pyx_v_a); __Pyx_GIVEREF(__pyx_v_a); PyTuple_SET_ITEM(__pyx_t_1, 3+__pyx_t_7, __pyx_v_a); __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_1, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 247, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_r = __pyx_t_3; __pyx_t_3 = 0; goto __pyx_L0; /* "pygame_sdl2/color.pyx":241 * return type(self)(r, g, b, a) * * def __div__(self not None, Color rhs not None): # <<<<<<<<<<<<<< * r = min(255, self.r / rhs.r) * g = min(255, self.g / rhs.g) */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_5); __Pyx_AddTraceback("pygame_sdl2.color.Color.__div__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF(__pyx_v_r); __Pyx_XDECREF(__pyx_v_g); __Pyx_XDECREF(__pyx_v_b); __Pyx_XDECREF(__pyx_v_a); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } #endif /*!(#if PY_MAJOR_VERSION < 3 || CYTHON_COMPILING_IN_PYPY)*/ /* "pygame_sdl2/color.pyx":249 * return type(self)(r, g, b, a) * * def __floordiv__(self not None, Color rhs not None): # <<<<<<<<<<<<<< * * def div(a, b): */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_5color_5Color_37__floordiv__(PyObject *__pyx_v_self, PyObject *__pyx_v_rhs); /*proto*/ static PyObject *__pyx_pw_11pygame_sdl2_5color_5Color_37__floordiv__(PyObject *__pyx_v_self, PyObject *__pyx_v_rhs) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__floordiv__ (wrapper)", 0); if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) { PyErr_Format(PyExc_TypeError, "Argument '%.200s' must not be None", "self"); __PYX_ERR(0, 249, __pyx_L1_error) } if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_rhs), __pyx_ptype_11pygame_sdl2_5color_Color, 0, "rhs", 0))) __PYX_ERR(0, 249, __pyx_L1_error) __pyx_r = __pyx_pf_11pygame_sdl2_5color_5Color_36__floordiv__(((PyObject *)__pyx_v_self), ((struct __pyx_obj_11pygame_sdl2_5color_Color *)__pyx_v_rhs)); /* function exit code */ goto __pyx_L0; __pyx_L1_error:; __pyx_r = NULL; __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/color.pyx":251 * def __floordiv__(self not None, Color rhs not None): * * def div(a, b): # <<<<<<<<<<<<<< * if b == 0: * return b */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_5color_5Color_12__floordiv___1div(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static PyMethodDef __pyx_mdef_11pygame_sdl2_5color_5Color_12__floordiv___1div = {"div", (PyCFunction)__pyx_pw_11pygame_sdl2_5color_5Color_12__floordiv___1div, METH_VARARGS|METH_KEYWORDS, 0}; static PyObject *__pyx_pw_11pygame_sdl2_5color_5Color_12__floordiv___1div(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_a = 0; PyObject *__pyx_v_b = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("div (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_a,&__pyx_n_s_b,0}; PyObject* values[2] = {0,0}; if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_a)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; case 1: if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_b)) != 0)) kw_args--; else { __Pyx_RaiseArgtupleInvalid("div", 1, 2, 2, 1); __PYX_ERR(0, 251, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "div") < 0)) __PYX_ERR(0, 251, __pyx_L3_error) } } else if (PyTuple_GET_SIZE(__pyx_args) != 2) { goto __pyx_L5_argtuple_error; } else { values[0] = PyTuple_GET_ITEM(__pyx_args, 0); values[1] = PyTuple_GET_ITEM(__pyx_args, 1); } __pyx_v_a = values[0]; __pyx_v_b = values[1]; } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("div", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 251, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("pygame_sdl2.color.Color.__floordiv__.div", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_11pygame_sdl2_5color_5Color_12__floordiv___div(__pyx_self, __pyx_v_a, __pyx_v_b); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_5color_5Color_12__floordiv___div(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_a, PyObject *__pyx_v_b) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_t_2; long __pyx_t_3; PyObject *__pyx_t_4 = NULL; PyObject *__pyx_t_5 = NULL; PyObject *__pyx_t_6 = NULL; __Pyx_RefNannySetupContext("div", 0); /* "pygame_sdl2/color.pyx":252 * * def div(a, b): * if b == 0: # <<<<<<<<<<<<<< * return b * */ __pyx_t_1 = __Pyx_PyInt_EqObjC(__pyx_v_b, __pyx_int_0, 0, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 252, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 252, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (__pyx_t_2) { /* "pygame_sdl2/color.pyx":253 * def div(a, b): * if b == 0: * return b # <<<<<<<<<<<<<< * * return min(255, a // b) */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(__pyx_v_b); __pyx_r = __pyx_v_b; goto __pyx_L0; /* "pygame_sdl2/color.pyx":252 * * def div(a, b): * if b == 0: # <<<<<<<<<<<<<< * return b * */ } /* "pygame_sdl2/color.pyx":255 * return b * * return min(255, a // b) # <<<<<<<<<<<<<< * * r = div(self.r, rhs.r) */ __Pyx_XDECREF(__pyx_r); __pyx_t_1 = PyNumber_FloorDivide(__pyx_v_a, __pyx_v_b); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 255, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_3 = 0xFF; __pyx_t_5 = __Pyx_PyInt_From_long(__pyx_t_3); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 255, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_6 = PyObject_RichCompare(__pyx_t_1, __pyx_t_5, Py_LT); __Pyx_XGOTREF(__pyx_t_6); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 255, __pyx_L1_error) __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_6); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 255, __pyx_L1_error) __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; if (__pyx_t_2) { __Pyx_INCREF(__pyx_t_1); __pyx_t_4 = __pyx_t_1; } else { __pyx_t_6 = __Pyx_PyInt_From_long(__pyx_t_3); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 255, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __pyx_t_4 = __pyx_t_6; __pyx_t_6 = 0; } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_INCREF(__pyx_t_4); __pyx_r = __pyx_t_4; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; goto __pyx_L0; /* "pygame_sdl2/color.pyx":251 * def __floordiv__(self not None, Color rhs not None): * * def div(a, b): # <<<<<<<<<<<<<< * if b == 0: * return b */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_5); __Pyx_XDECREF(__pyx_t_6); __Pyx_AddTraceback("pygame_sdl2.color.Color.__floordiv__.div", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/color.pyx":249 * return type(self)(r, g, b, a) * * def __floordiv__(self not None, Color rhs not None): # <<<<<<<<<<<<<< * * def div(a, b): */ static PyObject *__pyx_pf_11pygame_sdl2_5color_5Color_36__floordiv__(PyObject *__pyx_v_self, struct __pyx_obj_11pygame_sdl2_5color_Color *__pyx_v_rhs) { PyObject *__pyx_v_div = 0; PyObject *__pyx_v_r = NULL; PyObject *__pyx_v_g = NULL; PyObject *__pyx_v_b = NULL; PyObject *__pyx_v_a = NULL; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; Py_ssize_t __pyx_t_4; PyObject *__pyx_t_5 = NULL; __Pyx_RefNannySetupContext("__floordiv__", 0); /* "pygame_sdl2/color.pyx":251 * def __floordiv__(self not None, Color rhs not None): * * def div(a, b): # <<<<<<<<<<<<<< * if b == 0: * return b */ __pyx_t_1 = __Pyx_CyFunction_NewEx(&__pyx_mdef_11pygame_sdl2_5color_5Color_12__floordiv___1div, 0, __pyx_n_s_floordiv___locals_div, NULL, __pyx_n_s_pygame_sdl2_color, __pyx_d, ((PyObject *)__pyx_codeobj__11)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 251, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_div = __pyx_t_1; __pyx_t_1 = 0; /* "pygame_sdl2/color.pyx":257 * return min(255, a // b) * * r = div(self.r, rhs.r) # <<<<<<<<<<<<<< * g = div(self.g, rhs.g) * b = div(self.b, rhs.b) */ __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_r); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 257, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = __Pyx_PyInt_From_uint8_t(__pyx_v_rhs->r); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 257, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = __pyx_pf_11pygame_sdl2_5color_5Color_12__floordiv___div(__pyx_v_div, __pyx_t_1, __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 257, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_v_r = __pyx_t_3; __pyx_t_3 = 0; /* "pygame_sdl2/color.pyx":258 * * r = div(self.r, rhs.r) * g = div(self.g, rhs.g) # <<<<<<<<<<<<<< * b = div(self.b, rhs.b) * a = div(self.a, rhs.a) */ __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_g); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 258, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_2 = __Pyx_PyInt_From_uint8_t(__pyx_v_rhs->g); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 258, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_1 = __pyx_pf_11pygame_sdl2_5color_5Color_12__floordiv___div(__pyx_v_div, __pyx_t_3, __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 258, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_v_g = __pyx_t_1; __pyx_t_1 = 0; /* "pygame_sdl2/color.pyx":259 * r = div(self.r, rhs.r) * g = div(self.g, rhs.g) * b = div(self.b, rhs.b) # <<<<<<<<<<<<<< * a = div(self.a, rhs.a) * */ __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_b); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 259, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = __Pyx_PyInt_From_uint8_t(__pyx_v_rhs->b); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 259, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = __pyx_pf_11pygame_sdl2_5color_5Color_12__floordiv___div(__pyx_v_div, __pyx_t_1, __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 259, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_v_b = __pyx_t_3; __pyx_t_3 = 0; /* "pygame_sdl2/color.pyx":260 * g = div(self.g, rhs.g) * b = div(self.b, rhs.b) * a = div(self.a, rhs.a) # <<<<<<<<<<<<<< * * return type(self)(r, g, b, a) */ __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_a); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 260, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_2 = __Pyx_PyInt_From_uint8_t(__pyx_v_rhs->a); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 260, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_1 = __pyx_pf_11pygame_sdl2_5color_5Color_12__floordiv___div(__pyx_v_div, __pyx_t_3, __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 260, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_v_a = __pyx_t_1; __pyx_t_1 = 0; /* "pygame_sdl2/color.pyx":262 * a = div(self.a, rhs.a) * * return type(self)(r, g, b, a) # <<<<<<<<<<<<<< * * property cmy: */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(((PyObject *)Py_TYPE(__pyx_v_self))); __pyx_t_2 = ((PyObject *)Py_TYPE(__pyx_v_self)); __pyx_t_3 = NULL; __pyx_t_4 = 0; if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_2))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); if (likely(__pyx_t_3)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); __pyx_t_4 = 1; } } __pyx_t_5 = PyTuple_New(4+__pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 262, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); if (__pyx_t_3) { __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_3); __pyx_t_3 = NULL; } __Pyx_INCREF(__pyx_v_r); __Pyx_GIVEREF(__pyx_v_r); PyTuple_SET_ITEM(__pyx_t_5, 0+__pyx_t_4, __pyx_v_r); __Pyx_INCREF(__pyx_v_g); __Pyx_GIVEREF(__pyx_v_g); PyTuple_SET_ITEM(__pyx_t_5, 1+__pyx_t_4, __pyx_v_g); __Pyx_INCREF(__pyx_v_b); __Pyx_GIVEREF(__pyx_v_b); PyTuple_SET_ITEM(__pyx_t_5, 2+__pyx_t_4, __pyx_v_b); __Pyx_INCREF(__pyx_v_a); __Pyx_GIVEREF(__pyx_v_a); PyTuple_SET_ITEM(__pyx_t_5, 3+__pyx_t_4, __pyx_v_a); __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_5, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 262, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "pygame_sdl2/color.pyx":249 * return type(self)(r, g, b, a) * * def __floordiv__(self not None, Color rhs not None): # <<<<<<<<<<<<<< * * def div(a, b): */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_5); __Pyx_AddTraceback("pygame_sdl2.color.Color.__floordiv__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF(__pyx_v_div); __Pyx_XDECREF(__pyx_v_r); __Pyx_XDECREF(__pyx_v_g); __Pyx_XDECREF(__pyx_v_b); __Pyx_XDECREF(__pyx_v_a); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/color.pyx":265 * * property cmy: * def __get__(self): # <<<<<<<<<<<<<< * return 1 - (self.r / 255.0), 1 - (self.g / 255.0), 1 - (self.b / 255.0) * */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_5color_5Color_3cmy_1__get__(PyObject *__pyx_v_self); /*proto*/ static PyObject *__pyx_pw_11pygame_sdl2_5color_5Color_3cmy_1__get__(PyObject *__pyx_v_self) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); __pyx_r = __pyx_pf_11pygame_sdl2_5color_5Color_3cmy___get__(((struct __pyx_obj_11pygame_sdl2_5color_Color *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_5color_5Color_3cmy___get__(struct __pyx_obj_11pygame_sdl2_5color_Color *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; __Pyx_RefNannySetupContext("__get__", 0); /* "pygame_sdl2/color.pyx":266 * property cmy: * def __get__(self): * return 1 - (self.r / 255.0), 1 - (self.g / 255.0), 1 - (self.b / 255.0) # <<<<<<<<<<<<<< * * def __set__(self, val): */ __Pyx_XDECREF(__pyx_r); __pyx_t_1 = PyFloat_FromDouble((1.0 - (((double)__pyx_v_self->r) / 255.0))); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 266, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = PyFloat_FromDouble((1.0 - (((double)__pyx_v_self->g) / 255.0))); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 266, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = PyFloat_FromDouble((1.0 - (((double)__pyx_v_self->b) / 255.0))); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 266, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = PyTuple_New(3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 266, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_GIVEREF(__pyx_t_1); PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_1); __Pyx_GIVEREF(__pyx_t_2); PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_2); __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_4, 2, __pyx_t_3); __pyx_t_1 = 0; __pyx_t_2 = 0; __pyx_t_3 = 0; __pyx_r = __pyx_t_4; __pyx_t_4 = 0; goto __pyx_L0; /* "pygame_sdl2/color.pyx":265 * * property cmy: * def __get__(self): # <<<<<<<<<<<<<< * return 1 - (self.r / 255.0), 1 - (self.g / 255.0), 1 - (self.b / 255.0) * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_AddTraceback("pygame_sdl2.color.Color.cmy.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/color.pyx":268 * return 1 - (self.r / 255.0), 1 - (self.g / 255.0), 1 - (self.b / 255.0) * * def __set__(self, val): # <<<<<<<<<<<<<< * c, m, y = val * self.r = (1 - c) * 255 */ /* Python wrapper */ static int __pyx_pw_11pygame_sdl2_5color_5Color_3cmy_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_val); /*proto*/ static int __pyx_pw_11pygame_sdl2_5color_5Color_3cmy_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_val) { int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__set__ (wrapper)", 0); __pyx_r = __pyx_pf_11pygame_sdl2_5color_5Color_3cmy_2__set__(((struct __pyx_obj_11pygame_sdl2_5color_Color *)__pyx_v_self), ((PyObject *)__pyx_v_val)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static int __pyx_pf_11pygame_sdl2_5color_5Color_3cmy_2__set__(struct __pyx_obj_11pygame_sdl2_5color_Color *__pyx_v_self, PyObject *__pyx_v_val) { PyObject *__pyx_v_c = NULL; PyObject *__pyx_v_m = NULL; PyObject *__pyx_v_y = NULL; int __pyx_r; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; PyObject *(*__pyx_t_5)(PyObject *); Uint8 __pyx_t_6; __Pyx_RefNannySetupContext("__set__", 0); /* "pygame_sdl2/color.pyx":269 * * def __set__(self, val): * c, m, y = val # <<<<<<<<<<<<<< * self.r = (1 - c) * 255 * self.g = (1 - m) * 255 */ if ((likely(PyTuple_CheckExact(__pyx_v_val))) || (PyList_CheckExact(__pyx_v_val))) { PyObject* sequence = __pyx_v_val; #if CYTHON_COMPILING_IN_CPYTHON Py_ssize_t size = Py_SIZE(sequence); #else Py_ssize_t size = PySequence_Size(sequence); #endif if (unlikely(size != 3)) { if (size > 3) __Pyx_RaiseTooManyValuesError(3); else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); __PYX_ERR(0, 269, __pyx_L1_error) } #if CYTHON_COMPILING_IN_CPYTHON if (likely(PyTuple_CheckExact(sequence))) { __pyx_t_1 = PyTuple_GET_ITEM(sequence, 0); __pyx_t_2 = PyTuple_GET_ITEM(sequence, 1); __pyx_t_3 = PyTuple_GET_ITEM(sequence, 2); } else { __pyx_t_1 = PyList_GET_ITEM(sequence, 0); __pyx_t_2 = PyList_GET_ITEM(sequence, 1); __pyx_t_3 = PyList_GET_ITEM(sequence, 2); } __Pyx_INCREF(__pyx_t_1); __Pyx_INCREF(__pyx_t_2); __Pyx_INCREF(__pyx_t_3); #else __pyx_t_1 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 269, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 269, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = PySequence_ITEM(sequence, 2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 269, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); #endif } else { Py_ssize_t index = -1; __pyx_t_4 = PyObject_GetIter(__pyx_v_val); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 269, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_5 = Py_TYPE(__pyx_t_4)->tp_iternext; index = 0; __pyx_t_1 = __pyx_t_5(__pyx_t_4); if (unlikely(!__pyx_t_1)) goto __pyx_L3_unpacking_failed; __Pyx_GOTREF(__pyx_t_1); index = 1; __pyx_t_2 = __pyx_t_5(__pyx_t_4); if (unlikely(!__pyx_t_2)) goto __pyx_L3_unpacking_failed; __Pyx_GOTREF(__pyx_t_2); index = 2; __pyx_t_3 = __pyx_t_5(__pyx_t_4); if (unlikely(!__pyx_t_3)) goto __pyx_L3_unpacking_failed; __Pyx_GOTREF(__pyx_t_3); if (__Pyx_IternextUnpackEndCheck(__pyx_t_5(__pyx_t_4), 3) < 0) __PYX_ERR(0, 269, __pyx_L1_error) __pyx_t_5 = NULL; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; goto __pyx_L4_unpacking_done; __pyx_L3_unpacking_failed:; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_t_5 = NULL; if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); __PYX_ERR(0, 269, __pyx_L1_error) __pyx_L4_unpacking_done:; } __pyx_v_c = __pyx_t_1; __pyx_t_1 = 0; __pyx_v_m = __pyx_t_2; __pyx_t_2 = 0; __pyx_v_y = __pyx_t_3; __pyx_t_3 = 0; /* "pygame_sdl2/color.pyx":270 * def __set__(self, val): * c, m, y = val * self.r = (1 - c) * 255 # <<<<<<<<<<<<<< * self.g = (1 - m) * 255 * self.b = (1 - y) * 255 */ __pyx_t_3 = __Pyx_PyInt_SubtractCObj(__pyx_int_1, __pyx_v_c, 1, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 270, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_2 = PyNumber_Multiply(__pyx_t_3, __pyx_int_255); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 270, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_6 = __Pyx_PyInt_As_uint8_t(__pyx_t_2); if (unlikely((__pyx_t_6 == (Uint8)-1) && PyErr_Occurred())) __PYX_ERR(0, 270, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_v_self->r = __pyx_t_6; /* "pygame_sdl2/color.pyx":271 * c, m, y = val * self.r = (1 - c) * 255 * self.g = (1 - m) * 255 # <<<<<<<<<<<<<< * self.b = (1 - y) * 255 * */ __pyx_t_2 = __Pyx_PyInt_SubtractCObj(__pyx_int_1, __pyx_v_m, 1, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 271, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = PyNumber_Multiply(__pyx_t_2, __pyx_int_255); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 271, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_6 = __Pyx_PyInt_As_uint8_t(__pyx_t_3); if (unlikely((__pyx_t_6 == (Uint8)-1) && PyErr_Occurred())) __PYX_ERR(0, 271, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_v_self->g = __pyx_t_6; /* "pygame_sdl2/color.pyx":272 * self.r = (1 - c) * 255 * self.g = (1 - m) * 255 * self.b = (1 - y) * 255 # <<<<<<<<<<<<<< * * property hsva: */ __pyx_t_3 = __Pyx_PyInt_SubtractCObj(__pyx_int_1, __pyx_v_y, 1, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 272, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_2 = PyNumber_Multiply(__pyx_t_3, __pyx_int_255); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 272, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_6 = __Pyx_PyInt_As_uint8_t(__pyx_t_2); if (unlikely((__pyx_t_6 == (Uint8)-1) && PyErr_Occurred())) __PYX_ERR(0, 272, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_v_self->b = __pyx_t_6; /* "pygame_sdl2/color.pyx":268 * return 1 - (self.r / 255.0), 1 - (self.g / 255.0), 1 - (self.b / 255.0) * * def __set__(self, val): # <<<<<<<<<<<<<< * c, m, y = val * self.r = (1 - c) * 255 */ /* function exit code */ __pyx_r = 0; goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_AddTraceback("pygame_sdl2.color.Color.cmy.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = -1; __pyx_L0:; __Pyx_XDECREF(__pyx_v_c); __Pyx_XDECREF(__pyx_v_m); __Pyx_XDECREF(__pyx_v_y); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/color.pyx":275 * * property hsva: * def __get__(self): # <<<<<<<<<<<<<< * cdef double r = self.r / 255.0 * cdef double g = self.g / 255.0 */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_5color_5Color_4hsva_1__get__(PyObject *__pyx_v_self); /*proto*/ static PyObject *__pyx_pw_11pygame_sdl2_5color_5Color_4hsva_1__get__(PyObject *__pyx_v_self) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); __pyx_r = __pyx_pf_11pygame_sdl2_5color_5Color_4hsva___get__(((struct __pyx_obj_11pygame_sdl2_5color_Color *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_5color_5Color_4hsva___get__(struct __pyx_obj_11pygame_sdl2_5color_Color *__pyx_v_self) { double __pyx_v_r; double __pyx_v_g; double __pyx_v_b; double __pyx_v_cmax; double __pyx_v_cmin; double __pyx_v_delta; double __pyx_v_h; double __pyx_v_s; double __pyx_v_v; double __pyx_v_a; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations double __pyx_t_1; double __pyx_t_2; double __pyx_t_3; double __pyx_t_4; int __pyx_t_5; int __pyx_t_6; PyObject *__pyx_t_7 = NULL; PyObject *__pyx_t_8 = NULL; PyObject *__pyx_t_9 = NULL; PyObject *__pyx_t_10 = NULL; PyObject *__pyx_t_11 = NULL; __Pyx_RefNannySetupContext("__get__", 0); /* "pygame_sdl2/color.pyx":276 * property hsva: * def __get__(self): * cdef double r = self.r / 255.0 # <<<<<<<<<<<<<< * cdef double g = self.g / 255.0 * cdef double b = self.b / 255.0 */ __pyx_v_r = (((double)__pyx_v_self->r) / 255.0); /* "pygame_sdl2/color.pyx":277 * def __get__(self): * cdef double r = self.r / 255.0 * cdef double g = self.g / 255.0 # <<<<<<<<<<<<<< * cdef double b = self.b / 255.0 * */ __pyx_v_g = (((double)__pyx_v_self->g) / 255.0); /* "pygame_sdl2/color.pyx":278 * cdef double r = self.r / 255.0 * cdef double g = self.g / 255.0 * cdef double b = self.b / 255.0 # <<<<<<<<<<<<<< * * cdef double cmax = max(r, g, b) */ __pyx_v_b = (((double)__pyx_v_self->b) / 255.0); /* "pygame_sdl2/color.pyx":280 * cdef double b = self.b / 255.0 * * cdef double cmax = max(r, g, b) # <<<<<<<<<<<<<< * cdef double cmin = min(r, g, b) * cdef double delta = cmax - cmin */ __pyx_t_1 = __pyx_v_g; __pyx_t_2 = __pyx_v_b; __pyx_t_3 = __pyx_v_r; if (((__pyx_t_1 > __pyx_t_3) != 0)) { __pyx_t_4 = __pyx_t_1; } else { __pyx_t_4 = __pyx_t_3; } __pyx_t_3 = __pyx_t_4; if (((__pyx_t_2 > __pyx_t_3) != 0)) { __pyx_t_4 = __pyx_t_2; } else { __pyx_t_4 = __pyx_t_3; } __pyx_v_cmax = __pyx_t_4; /* "pygame_sdl2/color.pyx":281 * * cdef double cmax = max(r, g, b) * cdef double cmin = min(r, g, b) # <<<<<<<<<<<<<< * cdef double delta = cmax - cmin * */ __pyx_t_4 = __pyx_v_g; __pyx_t_1 = __pyx_v_b; __pyx_t_2 = __pyx_v_r; if (((__pyx_t_4 < __pyx_t_2) != 0)) { __pyx_t_3 = __pyx_t_4; } else { __pyx_t_3 = __pyx_t_2; } __pyx_t_2 = __pyx_t_3; if (((__pyx_t_1 < __pyx_t_2) != 0)) { __pyx_t_3 = __pyx_t_1; } else { __pyx_t_3 = __pyx_t_2; } __pyx_v_cmin = __pyx_t_3; /* "pygame_sdl2/color.pyx":282 * cdef double cmax = max(r, g, b) * cdef double cmin = min(r, g, b) * cdef double delta = cmax - cmin # <<<<<<<<<<<<<< * * cdef double h, s, v, a */ __pyx_v_delta = (__pyx_v_cmax - __pyx_v_cmin); /* "pygame_sdl2/color.pyx":286 * cdef double h, s, v, a * * if r == g == b: # <<<<<<<<<<<<<< * h = 0.0 * s = 0.0 */ __pyx_t_5 = (__pyx_v_r == __pyx_v_g); if (__pyx_t_5) { __pyx_t_5 = (__pyx_v_g == __pyx_v_b); } __pyx_t_6 = (__pyx_t_5 != 0); if (__pyx_t_6) { /* "pygame_sdl2/color.pyx":287 * * if r == g == b: * h = 0.0 # <<<<<<<<<<<<<< * s = 0.0 * else: */ __pyx_v_h = 0.0; /* "pygame_sdl2/color.pyx":288 * if r == g == b: * h = 0.0 * s = 0.0 # <<<<<<<<<<<<<< * else: * if cmax == r: */ __pyx_v_s = 0.0; /* "pygame_sdl2/color.pyx":286 * cdef double h, s, v, a * * if r == g == b: # <<<<<<<<<<<<<< * h = 0.0 * s = 0.0 */ goto __pyx_L3; } /* "pygame_sdl2/color.pyx":290 * s = 0.0 * else: * if cmax == r: # <<<<<<<<<<<<<< * h = 60.0 * ((g - b) / delta % 6) * elif cmax == g: */ /*else*/ { __pyx_t_6 = ((__pyx_v_cmax == __pyx_v_r) != 0); if (__pyx_t_6) { /* "pygame_sdl2/color.pyx":291 * else: * if cmax == r: * h = 60.0 * ((g - b) / delta % 6) # <<<<<<<<<<<<<< * elif cmax == g: * h = 60.0 * ((b - r) / delta + 2) */ __pyx_t_3 = (__pyx_v_g - __pyx_v_b); if (unlikely(__pyx_v_delta == 0)) { PyErr_SetString(PyExc_ZeroDivisionError, "float division"); __PYX_ERR(0, 291, __pyx_L1_error) } __pyx_v_h = (60.0 * __Pyx_mod_double((__pyx_t_3 / __pyx_v_delta), 6.0)); /* "pygame_sdl2/color.pyx":290 * s = 0.0 * else: * if cmax == r: # <<<<<<<<<<<<<< * h = 60.0 * ((g - b) / delta % 6) * elif cmax == g: */ goto __pyx_L4; } /* "pygame_sdl2/color.pyx":292 * if cmax == r: * h = 60.0 * ((g - b) / delta % 6) * elif cmax == g: # <<<<<<<<<<<<<< * h = 60.0 * ((b - r) / delta + 2) * else: */ __pyx_t_6 = ((__pyx_v_cmax == __pyx_v_g) != 0); if (__pyx_t_6) { /* "pygame_sdl2/color.pyx":293 * h = 60.0 * ((g - b) / delta % 6) * elif cmax == g: * h = 60.0 * ((b - r) / delta + 2) # <<<<<<<<<<<<<< * else: * h = 60.0 * ((r - g) / delta + 4) */ __pyx_t_3 = (__pyx_v_b - __pyx_v_r); if (unlikely(__pyx_v_delta == 0)) { PyErr_SetString(PyExc_ZeroDivisionError, "float division"); __PYX_ERR(0, 293, __pyx_L1_error) } __pyx_v_h = (60.0 * ((__pyx_t_3 / __pyx_v_delta) + 2.0)); /* "pygame_sdl2/color.pyx":292 * if cmax == r: * h = 60.0 * ((g - b) / delta % 6) * elif cmax == g: # <<<<<<<<<<<<<< * h = 60.0 * ((b - r) / delta + 2) * else: */ goto __pyx_L4; } /* "pygame_sdl2/color.pyx":295 * h = 60.0 * ((b - r) / delta + 2) * else: * h = 60.0 * ((r - g) / delta + 4) # <<<<<<<<<<<<<< * * if cmax == 0.0: */ /*else*/ { __pyx_t_3 = (__pyx_v_r - __pyx_v_g); if (unlikely(__pyx_v_delta == 0)) { PyErr_SetString(PyExc_ZeroDivisionError, "float division"); __PYX_ERR(0, 295, __pyx_L1_error) } __pyx_v_h = (60.0 * ((__pyx_t_3 / __pyx_v_delta) + 4.0)); } __pyx_L4:; /* "pygame_sdl2/color.pyx":297 * h = 60.0 * ((r - g) / delta + 4) * * if cmax == 0.0: # <<<<<<<<<<<<<< * s = 0.0 * else: */ __pyx_t_6 = ((__pyx_v_cmax == 0.0) != 0); if (__pyx_t_6) { /* "pygame_sdl2/color.pyx":298 * * if cmax == 0.0: * s = 0.0 # <<<<<<<<<<<<<< * else: * s = delta / cmax * 100 */ __pyx_v_s = 0.0; /* "pygame_sdl2/color.pyx":297 * h = 60.0 * ((r - g) / delta + 4) * * if cmax == 0.0: # <<<<<<<<<<<<<< * s = 0.0 * else: */ goto __pyx_L5; } /* "pygame_sdl2/color.pyx":300 * s = 0.0 * else: * s = delta / cmax * 100 # <<<<<<<<<<<<<< * * v = cmax * 100 */ /*else*/ { if (unlikely(__pyx_v_cmax == 0)) { PyErr_SetString(PyExc_ZeroDivisionError, "float division"); __PYX_ERR(0, 300, __pyx_L1_error) } __pyx_v_s = ((__pyx_v_delta / __pyx_v_cmax) * 100.0); } __pyx_L5:; } __pyx_L3:; /* "pygame_sdl2/color.pyx":302 * s = delta / cmax * 100 * * v = cmax * 100 # <<<<<<<<<<<<<< * a = self.a / 255.0 * 100 * return h, s, v, a */ __pyx_v_v = (__pyx_v_cmax * 100.0); /* "pygame_sdl2/color.pyx":303 * * v = cmax * 100 * a = self.a / 255.0 * 100 # <<<<<<<<<<<<<< * return h, s, v, a * */ __pyx_v_a = ((((double)__pyx_v_self->a) / 255.0) * 100.0); /* "pygame_sdl2/color.pyx":304 * v = cmax * 100 * a = self.a / 255.0 * 100 * return h, s, v, a # <<<<<<<<<<<<<< * * def __set__(self, val): */ __Pyx_XDECREF(__pyx_r); __pyx_t_7 = PyFloat_FromDouble(__pyx_v_h); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 304, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __pyx_t_8 = PyFloat_FromDouble(__pyx_v_s); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 304, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __pyx_t_9 = PyFloat_FromDouble(__pyx_v_v); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 304, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); __pyx_t_10 = PyFloat_FromDouble(__pyx_v_a); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 304, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_10); __pyx_t_11 = PyTuple_New(4); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 304, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); __Pyx_GIVEREF(__pyx_t_7); PyTuple_SET_ITEM(__pyx_t_11, 0, __pyx_t_7); __Pyx_GIVEREF(__pyx_t_8); PyTuple_SET_ITEM(__pyx_t_11, 1, __pyx_t_8); __Pyx_GIVEREF(__pyx_t_9); PyTuple_SET_ITEM(__pyx_t_11, 2, __pyx_t_9); __Pyx_GIVEREF(__pyx_t_10); PyTuple_SET_ITEM(__pyx_t_11, 3, __pyx_t_10); __pyx_t_7 = 0; __pyx_t_8 = 0; __pyx_t_9 = 0; __pyx_t_10 = 0; __pyx_r = __pyx_t_11; __pyx_t_11 = 0; goto __pyx_L0; /* "pygame_sdl2/color.pyx":275 * * property hsva: * def __get__(self): # <<<<<<<<<<<<<< * cdef double r = self.r / 255.0 * cdef double g = self.g / 255.0 */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_7); __Pyx_XDECREF(__pyx_t_8); __Pyx_XDECREF(__pyx_t_9); __Pyx_XDECREF(__pyx_t_10); __Pyx_XDECREF(__pyx_t_11); __Pyx_AddTraceback("pygame_sdl2.color.Color.hsva.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/color.pyx":306 * return h, s, v, a * * def __set__(self, val): # <<<<<<<<<<<<<< * cdef double h, s, v, a * if len(val) == 3: */ /* Python wrapper */ static int __pyx_pw_11pygame_sdl2_5color_5Color_4hsva_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_val); /*proto*/ static int __pyx_pw_11pygame_sdl2_5color_5Color_4hsva_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_val) { int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__set__ (wrapper)", 0); __pyx_r = __pyx_pf_11pygame_sdl2_5color_5Color_4hsva_2__set__(((struct __pyx_obj_11pygame_sdl2_5color_Color *)__pyx_v_self), ((PyObject *)__pyx_v_val)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static int __pyx_pf_11pygame_sdl2_5color_5Color_4hsva_2__set__(struct __pyx_obj_11pygame_sdl2_5color_Color *__pyx_v_self, PyObject *__pyx_v_val) { double __pyx_v_h; double __pyx_v_s; double __pyx_v_v; double __pyx_v_a; double __pyx_v_c; double __pyx_v_x; double __pyx_v_m; double __pyx_v_r; double __pyx_v_g; double __pyx_v_b; int __pyx_r; __Pyx_RefNannyDeclarations Py_ssize_t __pyx_t_1; int __pyx_t_2; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; PyObject *__pyx_t_5 = NULL; PyObject *__pyx_t_6 = NULL; PyObject *(*__pyx_t_7)(PyObject *); double __pyx_t_8; double __pyx_t_9; double __pyx_t_10; PyObject *__pyx_t_11 = NULL; double __pyx_t_12; int __pyx_t_13; __Pyx_RefNannySetupContext("__set__", 0); /* "pygame_sdl2/color.pyx":308 * def __set__(self, val): * cdef double h, s, v, a * if len(val) == 3: # <<<<<<<<<<<<<< * h, s, v = val * a = 0.0 */ __pyx_t_1 = PyObject_Length(__pyx_v_val); if (unlikely(__pyx_t_1 == -1)) __PYX_ERR(0, 308, __pyx_L1_error) __pyx_t_2 = ((__pyx_t_1 == 3) != 0); if (__pyx_t_2) { /* "pygame_sdl2/color.pyx":309 * cdef double h, s, v, a * if len(val) == 3: * h, s, v = val # <<<<<<<<<<<<<< * a = 0.0 * else: */ if ((likely(PyTuple_CheckExact(__pyx_v_val))) || (PyList_CheckExact(__pyx_v_val))) { PyObject* sequence = __pyx_v_val; #if CYTHON_COMPILING_IN_CPYTHON Py_ssize_t size = Py_SIZE(sequence); #else Py_ssize_t size = PySequence_Size(sequence); #endif if (unlikely(size != 3)) { if (size > 3) __Pyx_RaiseTooManyValuesError(3); else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); __PYX_ERR(0, 309, __pyx_L1_error) } #if CYTHON_COMPILING_IN_CPYTHON if (likely(PyTuple_CheckExact(sequence))) { __pyx_t_3 = PyTuple_GET_ITEM(sequence, 0); __pyx_t_4 = PyTuple_GET_ITEM(sequence, 1); __pyx_t_5 = PyTuple_GET_ITEM(sequence, 2); } else { __pyx_t_3 = PyList_GET_ITEM(sequence, 0); __pyx_t_4 = PyList_GET_ITEM(sequence, 1); __pyx_t_5 = PyList_GET_ITEM(sequence, 2); } __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(__pyx_t_4); __Pyx_INCREF(__pyx_t_5); #else __pyx_t_3 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 309, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 309, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_5 = PySequence_ITEM(sequence, 2); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 309, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); #endif } else { Py_ssize_t index = -1; __pyx_t_6 = PyObject_GetIter(__pyx_v_val); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 309, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __pyx_t_7 = Py_TYPE(__pyx_t_6)->tp_iternext; index = 0; __pyx_t_3 = __pyx_t_7(__pyx_t_6); if (unlikely(!__pyx_t_3)) goto __pyx_L4_unpacking_failed; __Pyx_GOTREF(__pyx_t_3); index = 1; __pyx_t_4 = __pyx_t_7(__pyx_t_6); if (unlikely(!__pyx_t_4)) goto __pyx_L4_unpacking_failed; __Pyx_GOTREF(__pyx_t_4); index = 2; __pyx_t_5 = __pyx_t_7(__pyx_t_6); if (unlikely(!__pyx_t_5)) goto __pyx_L4_unpacking_failed; __Pyx_GOTREF(__pyx_t_5); if (__Pyx_IternextUnpackEndCheck(__pyx_t_7(__pyx_t_6), 3) < 0) __PYX_ERR(0, 309, __pyx_L1_error) __pyx_t_7 = NULL; __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; goto __pyx_L5_unpacking_done; __pyx_L4_unpacking_failed:; __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __pyx_t_7 = NULL; if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); __PYX_ERR(0, 309, __pyx_L1_error) __pyx_L5_unpacking_done:; } __pyx_t_8 = __pyx_PyFloat_AsDouble(__pyx_t_3); if (unlikely((__pyx_t_8 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 309, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_9 = __pyx_PyFloat_AsDouble(__pyx_t_4); if (unlikely((__pyx_t_9 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 309, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_t_10 = __pyx_PyFloat_AsDouble(__pyx_t_5); if (unlikely((__pyx_t_10 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 309, __pyx_L1_error) __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __pyx_v_h = __pyx_t_8; __pyx_v_s = __pyx_t_9; __pyx_v_v = __pyx_t_10; /* "pygame_sdl2/color.pyx":310 * if len(val) == 3: * h, s, v = val * a = 0.0 # <<<<<<<<<<<<<< * else: * h, s, v, a = val */ __pyx_v_a = 0.0; /* "pygame_sdl2/color.pyx":308 * def __set__(self, val): * cdef double h, s, v, a * if len(val) == 3: # <<<<<<<<<<<<<< * h, s, v = val * a = 0.0 */ goto __pyx_L3; } /* "pygame_sdl2/color.pyx":312 * a = 0.0 * else: * h, s, v, a = val # <<<<<<<<<<<<<< * * h = h % 360.0 */ /*else*/ { if ((likely(PyTuple_CheckExact(__pyx_v_val))) || (PyList_CheckExact(__pyx_v_val))) { PyObject* sequence = __pyx_v_val; #if CYTHON_COMPILING_IN_CPYTHON Py_ssize_t size = Py_SIZE(sequence); #else Py_ssize_t size = PySequence_Size(sequence); #endif if (unlikely(size != 4)) { if (size > 4) __Pyx_RaiseTooManyValuesError(4); else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); __PYX_ERR(0, 312, __pyx_L1_error) } #if CYTHON_COMPILING_IN_CPYTHON if (likely(PyTuple_CheckExact(sequence))) { __pyx_t_5 = PyTuple_GET_ITEM(sequence, 0); __pyx_t_4 = PyTuple_GET_ITEM(sequence, 1); __pyx_t_3 = PyTuple_GET_ITEM(sequence, 2); __pyx_t_6 = PyTuple_GET_ITEM(sequence, 3); } else { __pyx_t_5 = PyList_GET_ITEM(sequence, 0); __pyx_t_4 = PyList_GET_ITEM(sequence, 1); __pyx_t_3 = PyList_GET_ITEM(sequence, 2); __pyx_t_6 = PyList_GET_ITEM(sequence, 3); } __Pyx_INCREF(__pyx_t_5); __Pyx_INCREF(__pyx_t_4); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(__pyx_t_6); #else { Py_ssize_t i; PyObject** temps[4] = {&__pyx_t_5,&__pyx_t_4,&__pyx_t_3,&__pyx_t_6}; for (i=0; i < 4; i++) { PyObject* item = PySequence_ITEM(sequence, i); if (unlikely(!item)) __PYX_ERR(0, 312, __pyx_L1_error) __Pyx_GOTREF(item); *(temps[i]) = item; } } #endif } else { Py_ssize_t index = -1; PyObject** temps[4] = {&__pyx_t_5,&__pyx_t_4,&__pyx_t_3,&__pyx_t_6}; __pyx_t_11 = PyObject_GetIter(__pyx_v_val); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 312, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); __pyx_t_7 = Py_TYPE(__pyx_t_11)->tp_iternext; for (index=0; index < 4; index++) { PyObject* item = __pyx_t_7(__pyx_t_11); if (unlikely(!item)) goto __pyx_L6_unpacking_failed; __Pyx_GOTREF(item); *(temps[index]) = item; } if (__Pyx_IternextUnpackEndCheck(__pyx_t_7(__pyx_t_11), 4) < 0) __PYX_ERR(0, 312, __pyx_L1_error) __pyx_t_7 = NULL; __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; goto __pyx_L7_unpacking_done; __pyx_L6_unpacking_failed:; __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; __pyx_t_7 = NULL; if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); __PYX_ERR(0, 312, __pyx_L1_error) __pyx_L7_unpacking_done:; } __pyx_t_10 = __pyx_PyFloat_AsDouble(__pyx_t_5); if (unlikely((__pyx_t_10 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 312, __pyx_L1_error) __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __pyx_t_9 = __pyx_PyFloat_AsDouble(__pyx_t_4); if (unlikely((__pyx_t_9 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 312, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_t_8 = __pyx_PyFloat_AsDouble(__pyx_t_3); if (unlikely((__pyx_t_8 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 312, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_12 = __pyx_PyFloat_AsDouble(__pyx_t_6); if (unlikely((__pyx_t_12 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 312, __pyx_L1_error) __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __pyx_v_h = __pyx_t_10; __pyx_v_s = __pyx_t_9; __pyx_v_v = __pyx_t_8; __pyx_v_a = __pyx_t_12; } __pyx_L3:; /* "pygame_sdl2/color.pyx":314 * h, s, v, a = val * * h = h % 360.0 # <<<<<<<<<<<<<< * * # These should be in a range of [0.0, 1.0] */ __pyx_v_h = __Pyx_mod_double(__pyx_v_h, 360.0); /* "pygame_sdl2/color.pyx":317 * * # These should be in a range of [0.0, 1.0] * s /= 100.0 # <<<<<<<<<<<<<< * v /= 100.0 * a /= 100.0 */ __pyx_v_s = (__pyx_v_s / 100.0); /* "pygame_sdl2/color.pyx":318 * # These should be in a range of [0.0, 1.0] * s /= 100.0 * v /= 100.0 # <<<<<<<<<<<<<< * a /= 100.0 * */ __pyx_v_v = (__pyx_v_v / 100.0); /* "pygame_sdl2/color.pyx":319 * s /= 100.0 * v /= 100.0 * a /= 100.0 # <<<<<<<<<<<<<< * * cdef double c = v * s */ __pyx_v_a = (__pyx_v_a / 100.0); /* "pygame_sdl2/color.pyx":321 * a /= 100.0 * * cdef double c = v * s # <<<<<<<<<<<<<< * cdef double x = c * (1 - abs((h / 60.0) % 2 - 1)) * cdef double m = v - c */ __pyx_v_c = (__pyx_v_v * __pyx_v_s); /* "pygame_sdl2/color.pyx":322 * * cdef double c = v * s * cdef double x = c * (1 - abs((h / 60.0) % 2 - 1)) # <<<<<<<<<<<<<< * cdef double m = v - c * */ __pyx_v_x = (__pyx_v_c * (1.0 - fabs((__Pyx_mod_double((__pyx_v_h / 60.0), 2.0) - 1.0)))); /* "pygame_sdl2/color.pyx":323 * cdef double c = v * s * cdef double x = c * (1 - abs((h / 60.0) % 2 - 1)) * cdef double m = v - c # <<<<<<<<<<<<<< * * cdef double r, g, b */ __pyx_v_m = (__pyx_v_v - __pyx_v_c); /* "pygame_sdl2/color.pyx":327 * cdef double r, g, b * * if 0 <= h < 60: # <<<<<<<<<<<<<< * r, g, b = c, x, 0 * elif 60 <= h < 120: */ __pyx_t_2 = (0.0 <= __pyx_v_h); if (__pyx_t_2) { __pyx_t_2 = (__pyx_v_h < 60.0); } __pyx_t_13 = (__pyx_t_2 != 0); if (__pyx_t_13) { /* "pygame_sdl2/color.pyx":328 * * if 0 <= h < 60: * r, g, b = c, x, 0 # <<<<<<<<<<<<<< * elif 60 <= h < 120: * r, g, b = x, c, 0 */ __pyx_t_12 = __pyx_v_c; __pyx_t_8 = __pyx_v_x; __pyx_t_9 = 0.0; __pyx_v_r = __pyx_t_12; __pyx_v_g = __pyx_t_8; __pyx_v_b = __pyx_t_9; /* "pygame_sdl2/color.pyx":327 * cdef double r, g, b * * if 0 <= h < 60: # <<<<<<<<<<<<<< * r, g, b = c, x, 0 * elif 60 <= h < 120: */ goto __pyx_L8; } /* "pygame_sdl2/color.pyx":329 * if 0 <= h < 60: * r, g, b = c, x, 0 * elif 60 <= h < 120: # <<<<<<<<<<<<<< * r, g, b = x, c, 0 * elif 120 <= h < 180: */ __pyx_t_13 = (60.0 <= __pyx_v_h); if (__pyx_t_13) { __pyx_t_13 = (__pyx_v_h < 120.0); } __pyx_t_2 = (__pyx_t_13 != 0); if (__pyx_t_2) { /* "pygame_sdl2/color.pyx":330 * r, g, b = c, x, 0 * elif 60 <= h < 120: * r, g, b = x, c, 0 # <<<<<<<<<<<<<< * elif 120 <= h < 180: * r, g, b = 0, c, x */ __pyx_t_9 = __pyx_v_x; __pyx_t_8 = __pyx_v_c; __pyx_t_12 = 0.0; __pyx_v_r = __pyx_t_9; __pyx_v_g = __pyx_t_8; __pyx_v_b = __pyx_t_12; /* "pygame_sdl2/color.pyx":329 * if 0 <= h < 60: * r, g, b = c, x, 0 * elif 60 <= h < 120: # <<<<<<<<<<<<<< * r, g, b = x, c, 0 * elif 120 <= h < 180: */ goto __pyx_L8; } /* "pygame_sdl2/color.pyx":331 * elif 60 <= h < 120: * r, g, b = x, c, 0 * elif 120 <= h < 180: # <<<<<<<<<<<<<< * r, g, b = 0, c, x * elif 180 <= h < 240: */ __pyx_t_2 = (120.0 <= __pyx_v_h); if (__pyx_t_2) { __pyx_t_2 = (__pyx_v_h < 180.0); } __pyx_t_13 = (__pyx_t_2 != 0); if (__pyx_t_13) { /* "pygame_sdl2/color.pyx":332 * r, g, b = x, c, 0 * elif 120 <= h < 180: * r, g, b = 0, c, x # <<<<<<<<<<<<<< * elif 180 <= h < 240: * r, g, b = 0, x, c */ __pyx_t_12 = 0.0; __pyx_t_8 = __pyx_v_c; __pyx_t_9 = __pyx_v_x; __pyx_v_r = __pyx_t_12; __pyx_v_g = __pyx_t_8; __pyx_v_b = __pyx_t_9; /* "pygame_sdl2/color.pyx":331 * elif 60 <= h < 120: * r, g, b = x, c, 0 * elif 120 <= h < 180: # <<<<<<<<<<<<<< * r, g, b = 0, c, x * elif 180 <= h < 240: */ goto __pyx_L8; } /* "pygame_sdl2/color.pyx":333 * elif 120 <= h < 180: * r, g, b = 0, c, x * elif 180 <= h < 240: # <<<<<<<<<<<<<< * r, g, b = 0, x, c * elif 240 <= h < 300: */ __pyx_t_13 = (180.0 <= __pyx_v_h); if (__pyx_t_13) { __pyx_t_13 = (__pyx_v_h < 240.0); } __pyx_t_2 = (__pyx_t_13 != 0); if (__pyx_t_2) { /* "pygame_sdl2/color.pyx":334 * r, g, b = 0, c, x * elif 180 <= h < 240: * r, g, b = 0, x, c # <<<<<<<<<<<<<< * elif 240 <= h < 300: * r, g, b = x, 0, c */ __pyx_t_9 = 0.0; __pyx_t_8 = __pyx_v_x; __pyx_t_12 = __pyx_v_c; __pyx_v_r = __pyx_t_9; __pyx_v_g = __pyx_t_8; __pyx_v_b = __pyx_t_12; /* "pygame_sdl2/color.pyx":333 * elif 120 <= h < 180: * r, g, b = 0, c, x * elif 180 <= h < 240: # <<<<<<<<<<<<<< * r, g, b = 0, x, c * elif 240 <= h < 300: */ goto __pyx_L8; } /* "pygame_sdl2/color.pyx":335 * elif 180 <= h < 240: * r, g, b = 0, x, c * elif 240 <= h < 300: # <<<<<<<<<<<<<< * r, g, b = x, 0, c * elif 300 <= h < 360: */ __pyx_t_2 = (240.0 <= __pyx_v_h); if (__pyx_t_2) { __pyx_t_2 = (__pyx_v_h < 300.0); } __pyx_t_13 = (__pyx_t_2 != 0); if (__pyx_t_13) { /* "pygame_sdl2/color.pyx":336 * r, g, b = 0, x, c * elif 240 <= h < 300: * r, g, b = x, 0, c # <<<<<<<<<<<<<< * elif 300 <= h < 360: * r, g, b = c, 0, x */ __pyx_t_12 = __pyx_v_x; __pyx_t_8 = 0.0; __pyx_t_9 = __pyx_v_c; __pyx_v_r = __pyx_t_12; __pyx_v_g = __pyx_t_8; __pyx_v_b = __pyx_t_9; /* "pygame_sdl2/color.pyx":335 * elif 180 <= h < 240: * r, g, b = 0, x, c * elif 240 <= h < 300: # <<<<<<<<<<<<<< * r, g, b = x, 0, c * elif 300 <= h < 360: */ goto __pyx_L8; } /* "pygame_sdl2/color.pyx":337 * elif 240 <= h < 300: * r, g, b = x, 0, c * elif 300 <= h < 360: # <<<<<<<<<<<<<< * r, g, b = c, 0, x * else: */ __pyx_t_13 = (300.0 <= __pyx_v_h); if (__pyx_t_13) { __pyx_t_13 = (__pyx_v_h < 360.0); } __pyx_t_2 = (__pyx_t_13 != 0); if (__pyx_t_2) { /* "pygame_sdl2/color.pyx":338 * r, g, b = x, 0, c * elif 300 <= h < 360: * r, g, b = c, 0, x # <<<<<<<<<<<<<< * else: * raise ValueError() */ __pyx_t_9 = __pyx_v_c; __pyx_t_8 = 0.0; __pyx_t_12 = __pyx_v_x; __pyx_v_r = __pyx_t_9; __pyx_v_g = __pyx_t_8; __pyx_v_b = __pyx_t_12; /* "pygame_sdl2/color.pyx":337 * elif 240 <= h < 300: * r, g, b = x, 0, c * elif 300 <= h < 360: # <<<<<<<<<<<<<< * r, g, b = c, 0, x * else: */ goto __pyx_L8; } /* "pygame_sdl2/color.pyx":340 * r, g, b = c, 0, x * else: * raise ValueError() # <<<<<<<<<<<<<< * * self.r = int(255 * (r + m)) */ /*else*/ { __pyx_t_6 = __Pyx_PyObject_CallNoArg(__pyx_builtin_ValueError); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 340, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_Raise(__pyx_t_6, 0, 0, 0); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __PYX_ERR(0, 340, __pyx_L1_error) } __pyx_L8:; /* "pygame_sdl2/color.pyx":342 * raise ValueError() * * self.r = int(255 * (r + m)) # <<<<<<<<<<<<<< * self.g = int(255 * (g + m)) * self.b = int(255 * (b + m)) */ __pyx_v_self->r = ((Uint8)(255.0 * (__pyx_v_r + __pyx_v_m))); /* "pygame_sdl2/color.pyx":343 * * self.r = int(255 * (r + m)) * self.g = int(255 * (g + m)) # <<<<<<<<<<<<<< * self.b = int(255 * (b + m)) * self.a = int(255 * a) */ __pyx_v_self->g = ((Uint8)(255.0 * (__pyx_v_g + __pyx_v_m))); /* "pygame_sdl2/color.pyx":344 * self.r = int(255 * (r + m)) * self.g = int(255 * (g + m)) * self.b = int(255 * (b + m)) # <<<<<<<<<<<<<< * self.a = int(255 * a) * */ __pyx_v_self->b = ((Uint8)(255.0 * (__pyx_v_b + __pyx_v_m))); /* "pygame_sdl2/color.pyx":345 * self.g = int(255 * (g + m)) * self.b = int(255 * (b + m)) * self.a = int(255 * a) # <<<<<<<<<<<<<< * * property hsla: */ __pyx_v_self->a = ((Uint8)(255.0 * __pyx_v_a)); /* "pygame_sdl2/color.pyx":306 * return h, s, v, a * * def __set__(self, val): # <<<<<<<<<<<<<< * cdef double h, s, v, a * if len(val) == 3: */ /* function exit code */ __pyx_r = 0; goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_5); __Pyx_XDECREF(__pyx_t_6); __Pyx_XDECREF(__pyx_t_11); __Pyx_AddTraceback("pygame_sdl2.color.Color.hsva.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = -1; __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/color.pyx":348 * * property hsla: * def __get__(self): # <<<<<<<<<<<<<< * cdef double h, s, l, a * cdef double r, g, b */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_5color_5Color_4hsla_1__get__(PyObject *__pyx_v_self); /*proto*/ static PyObject *__pyx_pw_11pygame_sdl2_5color_5Color_4hsla_1__get__(PyObject *__pyx_v_self) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); __pyx_r = __pyx_pf_11pygame_sdl2_5color_5Color_4hsla___get__(((struct __pyx_obj_11pygame_sdl2_5color_Color *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_5color_5Color_4hsla___get__(struct __pyx_obj_11pygame_sdl2_5color_Color *__pyx_v_self) { double __pyx_v_h; double __pyx_v_s; double __pyx_v_l; double __pyx_v_a; double __pyx_v_r; double __pyx_v_g; double __pyx_v_b; double __pyx_v_cmin; double __pyx_v_cmax; double __pyx_v_delta; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; double __pyx_t_3; double __pyx_t_4; double __pyx_t_5; double __pyx_t_6; int __pyx_t_7; PyObject *__pyx_t_8 = NULL; PyObject *__pyx_t_9 = NULL; PyObject *__pyx_t_10 = NULL; __Pyx_RefNannySetupContext("__get__", 0); /* "pygame_sdl2/color.pyx":353 * cdef double cmin, cmax, delta * * h = self.hsva[0] % 360.0 # <<<<<<<<<<<<<< * * r = self.r / 255.0 */ __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_hsva); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 353, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = __Pyx_GetItemInt(__pyx_t_1, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 353, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_1 = __Pyx_PyFloat_RemainderObjC(__pyx_t_2, __pyx_float_360_0, 360.0, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 353, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_3 = __pyx_PyFloat_AsDouble(__pyx_t_1); if (unlikely((__pyx_t_3 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 353, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_v_h = __pyx_t_3; /* "pygame_sdl2/color.pyx":355 * h = self.hsva[0] % 360.0 * * r = self.r / 255.0 # <<<<<<<<<<<<<< * g = self.g / 255.0 * b = self.b / 255.0 */ __pyx_v_r = (((double)__pyx_v_self->r) / 255.0); /* "pygame_sdl2/color.pyx":356 * * r = self.r / 255.0 * g = self.g / 255.0 # <<<<<<<<<<<<<< * b = self.b / 255.0 * */ __pyx_v_g = (((double)__pyx_v_self->g) / 255.0); /* "pygame_sdl2/color.pyx":357 * r = self.r / 255.0 * g = self.g / 255.0 * b = self.b / 255.0 # <<<<<<<<<<<<<< * * cmin = min(r, g, b) */ __pyx_v_b = (((double)__pyx_v_self->b) / 255.0); /* "pygame_sdl2/color.pyx":359 * b = self.b / 255.0 * * cmin = min(r, g, b) # <<<<<<<<<<<<<< * cmax = max(r, g, b) * delta = cmax - cmin */ __pyx_t_3 = __pyx_v_g; __pyx_t_4 = __pyx_v_b; __pyx_t_5 = __pyx_v_r; if (((__pyx_t_3 < __pyx_t_5) != 0)) { __pyx_t_6 = __pyx_t_3; } else { __pyx_t_6 = __pyx_t_5; } __pyx_t_5 = __pyx_t_6; if (((__pyx_t_4 < __pyx_t_5) != 0)) { __pyx_t_6 = __pyx_t_4; } else { __pyx_t_6 = __pyx_t_5; } __pyx_v_cmin = __pyx_t_6; /* "pygame_sdl2/color.pyx":360 * * cmin = min(r, g, b) * cmax = max(r, g, b) # <<<<<<<<<<<<<< * delta = cmax - cmin * */ __pyx_t_6 = __pyx_v_g; __pyx_t_3 = __pyx_v_b; __pyx_t_4 = __pyx_v_r; if (((__pyx_t_6 > __pyx_t_4) != 0)) { __pyx_t_5 = __pyx_t_6; } else { __pyx_t_5 = __pyx_t_4; } __pyx_t_4 = __pyx_t_5; if (((__pyx_t_3 > __pyx_t_4) != 0)) { __pyx_t_5 = __pyx_t_3; } else { __pyx_t_5 = __pyx_t_4; } __pyx_v_cmax = __pyx_t_5; /* "pygame_sdl2/color.pyx":361 * cmin = min(r, g, b) * cmax = max(r, g, b) * delta = cmax - cmin # <<<<<<<<<<<<<< * * l = (cmax + cmin) / 2.0 */ __pyx_v_delta = (__pyx_v_cmax - __pyx_v_cmin); /* "pygame_sdl2/color.pyx":363 * delta = cmax - cmin * * l = (cmax + cmin) / 2.0 # <<<<<<<<<<<<<< * * if delta == 0: */ __pyx_v_l = ((__pyx_v_cmax + __pyx_v_cmin) / 2.0); /* "pygame_sdl2/color.pyx":365 * l = (cmax + cmin) / 2.0 * * if delta == 0: # <<<<<<<<<<<<<< * s = 0.0 * else: */ __pyx_t_7 = ((__pyx_v_delta == 0.0) != 0); if (__pyx_t_7) { /* "pygame_sdl2/color.pyx":366 * * if delta == 0: * s = 0.0 # <<<<<<<<<<<<<< * else: * s = delta / (1 - abs(2 * l - 1)) */ __pyx_v_s = 0.0; /* "pygame_sdl2/color.pyx":365 * l = (cmax + cmin) / 2.0 * * if delta == 0: # <<<<<<<<<<<<<< * s = 0.0 * else: */ goto __pyx_L3; } /* "pygame_sdl2/color.pyx":368 * s = 0.0 * else: * s = delta / (1 - abs(2 * l - 1)) # <<<<<<<<<<<<<< * * a = self.a / 255.0 * 100 */ /*else*/ { __pyx_t_5 = (1.0 - fabs(((2.0 * __pyx_v_l) - 1.0))); if (unlikely(__pyx_t_5 == 0)) { PyErr_SetString(PyExc_ZeroDivisionError, "float division"); __PYX_ERR(0, 368, __pyx_L1_error) } __pyx_v_s = (__pyx_v_delta / __pyx_t_5); } __pyx_L3:; /* "pygame_sdl2/color.pyx":370 * s = delta / (1 - abs(2 * l - 1)) * * a = self.a / 255.0 * 100 # <<<<<<<<<<<<<< * * s = min(100.0, s * 100) */ __pyx_v_a = ((((double)__pyx_v_self->a) / 255.0) * 100.0); /* "pygame_sdl2/color.pyx":372 * a = self.a / 255.0 * 100 * * s = min(100.0, s * 100) # <<<<<<<<<<<<<< * l = min(100.0, l * 100) * */ __pyx_t_5 = (__pyx_v_s * 100.0); __pyx_t_6 = 100.0; if (((__pyx_t_5 < __pyx_t_6) != 0)) { __pyx_t_3 = __pyx_t_5; } else { __pyx_t_3 = __pyx_t_6; } __pyx_v_s = __pyx_t_3; /* "pygame_sdl2/color.pyx":373 * * s = min(100.0, s * 100) * l = min(100.0, l * 100) # <<<<<<<<<<<<<< * * return h, s, l, a */ __pyx_t_3 = (__pyx_v_l * 100.0); __pyx_t_5 = 100.0; if (((__pyx_t_3 < __pyx_t_5) != 0)) { __pyx_t_6 = __pyx_t_3; } else { __pyx_t_6 = __pyx_t_5; } __pyx_v_l = __pyx_t_6; /* "pygame_sdl2/color.pyx":375 * l = min(100.0, l * 100) * * return h, s, l, a # <<<<<<<<<<<<<< * * def __set__(self, val): */ __Pyx_XDECREF(__pyx_r); __pyx_t_1 = PyFloat_FromDouble(__pyx_v_h); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 375, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = PyFloat_FromDouble(__pyx_v_s); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 375, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_8 = PyFloat_FromDouble(__pyx_v_l); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 375, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __pyx_t_9 = PyFloat_FromDouble(__pyx_v_a); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 375, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); __pyx_t_10 = PyTuple_New(4); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 375, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_10); __Pyx_GIVEREF(__pyx_t_1); PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_t_1); __Pyx_GIVEREF(__pyx_t_2); PyTuple_SET_ITEM(__pyx_t_10, 1, __pyx_t_2); __Pyx_GIVEREF(__pyx_t_8); PyTuple_SET_ITEM(__pyx_t_10, 2, __pyx_t_8); __Pyx_GIVEREF(__pyx_t_9); PyTuple_SET_ITEM(__pyx_t_10, 3, __pyx_t_9); __pyx_t_1 = 0; __pyx_t_2 = 0; __pyx_t_8 = 0; __pyx_t_9 = 0; __pyx_r = __pyx_t_10; __pyx_t_10 = 0; goto __pyx_L0; /* "pygame_sdl2/color.pyx":348 * * property hsla: * def __get__(self): # <<<<<<<<<<<<<< * cdef double h, s, l, a * cdef double r, g, b */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_8); __Pyx_XDECREF(__pyx_t_9); __Pyx_XDECREF(__pyx_t_10); __Pyx_AddTraceback("pygame_sdl2.color.Color.hsla.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/color.pyx":377 * return h, s, l, a * * def __set__(self, val): # <<<<<<<<<<<<<< * cdef double h, s, l, a * if len(val) == 3: */ /* Python wrapper */ static int __pyx_pw_11pygame_sdl2_5color_5Color_4hsla_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_val); /*proto*/ static int __pyx_pw_11pygame_sdl2_5color_5Color_4hsla_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_val) { int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__set__ (wrapper)", 0); __pyx_r = __pyx_pf_11pygame_sdl2_5color_5Color_4hsla_2__set__(((struct __pyx_obj_11pygame_sdl2_5color_Color *)__pyx_v_self), ((PyObject *)__pyx_v_val)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static int __pyx_pf_11pygame_sdl2_5color_5Color_4hsla_2__set__(struct __pyx_obj_11pygame_sdl2_5color_Color *__pyx_v_self, PyObject *__pyx_v_val) { double __pyx_v_h; double __pyx_v_s; double __pyx_v_l; double __pyx_v_a; double __pyx_v_c; double __pyx_v_x; double __pyx_v_m; double __pyx_v_r; double __pyx_v_g; double __pyx_v_b; int __pyx_r; __Pyx_RefNannyDeclarations Py_ssize_t __pyx_t_1; int __pyx_t_2; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; PyObject *__pyx_t_5 = NULL; PyObject *__pyx_t_6 = NULL; PyObject *(*__pyx_t_7)(PyObject *); double __pyx_t_8; double __pyx_t_9; double __pyx_t_10; PyObject *__pyx_t_11 = NULL; double __pyx_t_12; int __pyx_t_13; __Pyx_RefNannySetupContext("__set__", 0); /* "pygame_sdl2/color.pyx":379 * def __set__(self, val): * cdef double h, s, l, a * if len(val) == 3: # <<<<<<<<<<<<<< * h, s, l = val * a = 0.0 */ __pyx_t_1 = PyObject_Length(__pyx_v_val); if (unlikely(__pyx_t_1 == -1)) __PYX_ERR(0, 379, __pyx_L1_error) __pyx_t_2 = ((__pyx_t_1 == 3) != 0); if (__pyx_t_2) { /* "pygame_sdl2/color.pyx":380 * cdef double h, s, l, a * if len(val) == 3: * h, s, l = val # <<<<<<<<<<<<<< * a = 0.0 * else: */ if ((likely(PyTuple_CheckExact(__pyx_v_val))) || (PyList_CheckExact(__pyx_v_val))) { PyObject* sequence = __pyx_v_val; #if CYTHON_COMPILING_IN_CPYTHON Py_ssize_t size = Py_SIZE(sequence); #else Py_ssize_t size = PySequence_Size(sequence); #endif if (unlikely(size != 3)) { if (size > 3) __Pyx_RaiseTooManyValuesError(3); else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); __PYX_ERR(0, 380, __pyx_L1_error) } #if CYTHON_COMPILING_IN_CPYTHON if (likely(PyTuple_CheckExact(sequence))) { __pyx_t_3 = PyTuple_GET_ITEM(sequence, 0); __pyx_t_4 = PyTuple_GET_ITEM(sequence, 1); __pyx_t_5 = PyTuple_GET_ITEM(sequence, 2); } else { __pyx_t_3 = PyList_GET_ITEM(sequence, 0); __pyx_t_4 = PyList_GET_ITEM(sequence, 1); __pyx_t_5 = PyList_GET_ITEM(sequence, 2); } __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(__pyx_t_4); __Pyx_INCREF(__pyx_t_5); #else __pyx_t_3 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 380, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 380, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_5 = PySequence_ITEM(sequence, 2); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 380, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); #endif } else { Py_ssize_t index = -1; __pyx_t_6 = PyObject_GetIter(__pyx_v_val); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 380, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __pyx_t_7 = Py_TYPE(__pyx_t_6)->tp_iternext; index = 0; __pyx_t_3 = __pyx_t_7(__pyx_t_6); if (unlikely(!__pyx_t_3)) goto __pyx_L4_unpacking_failed; __Pyx_GOTREF(__pyx_t_3); index = 1; __pyx_t_4 = __pyx_t_7(__pyx_t_6); if (unlikely(!__pyx_t_4)) goto __pyx_L4_unpacking_failed; __Pyx_GOTREF(__pyx_t_4); index = 2; __pyx_t_5 = __pyx_t_7(__pyx_t_6); if (unlikely(!__pyx_t_5)) goto __pyx_L4_unpacking_failed; __Pyx_GOTREF(__pyx_t_5); if (__Pyx_IternextUnpackEndCheck(__pyx_t_7(__pyx_t_6), 3) < 0) __PYX_ERR(0, 380, __pyx_L1_error) __pyx_t_7 = NULL; __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; goto __pyx_L5_unpacking_done; __pyx_L4_unpacking_failed:; __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __pyx_t_7 = NULL; if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); __PYX_ERR(0, 380, __pyx_L1_error) __pyx_L5_unpacking_done:; } __pyx_t_8 = __pyx_PyFloat_AsDouble(__pyx_t_3); if (unlikely((__pyx_t_8 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 380, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_9 = __pyx_PyFloat_AsDouble(__pyx_t_4); if (unlikely((__pyx_t_9 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 380, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_t_10 = __pyx_PyFloat_AsDouble(__pyx_t_5); if (unlikely((__pyx_t_10 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 380, __pyx_L1_error) __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __pyx_v_h = __pyx_t_8; __pyx_v_s = __pyx_t_9; __pyx_v_l = __pyx_t_10; /* "pygame_sdl2/color.pyx":381 * if len(val) == 3: * h, s, l = val * a = 0.0 # <<<<<<<<<<<<<< * else: * h, s, l, a = val */ __pyx_v_a = 0.0; /* "pygame_sdl2/color.pyx":379 * def __set__(self, val): * cdef double h, s, l, a * if len(val) == 3: # <<<<<<<<<<<<<< * h, s, l = val * a = 0.0 */ goto __pyx_L3; } /* "pygame_sdl2/color.pyx":383 * a = 0.0 * else: * h, s, l, a = val # <<<<<<<<<<<<<< * * s /= 100.0 */ /*else*/ { if ((likely(PyTuple_CheckExact(__pyx_v_val))) || (PyList_CheckExact(__pyx_v_val))) { PyObject* sequence = __pyx_v_val; #if CYTHON_COMPILING_IN_CPYTHON Py_ssize_t size = Py_SIZE(sequence); #else Py_ssize_t size = PySequence_Size(sequence); #endif if (unlikely(size != 4)) { if (size > 4) __Pyx_RaiseTooManyValuesError(4); else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); __PYX_ERR(0, 383, __pyx_L1_error) } #if CYTHON_COMPILING_IN_CPYTHON if (likely(PyTuple_CheckExact(sequence))) { __pyx_t_5 = PyTuple_GET_ITEM(sequence, 0); __pyx_t_4 = PyTuple_GET_ITEM(sequence, 1); __pyx_t_3 = PyTuple_GET_ITEM(sequence, 2); __pyx_t_6 = PyTuple_GET_ITEM(sequence, 3); } else { __pyx_t_5 = PyList_GET_ITEM(sequence, 0); __pyx_t_4 = PyList_GET_ITEM(sequence, 1); __pyx_t_3 = PyList_GET_ITEM(sequence, 2); __pyx_t_6 = PyList_GET_ITEM(sequence, 3); } __Pyx_INCREF(__pyx_t_5); __Pyx_INCREF(__pyx_t_4); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(__pyx_t_6); #else { Py_ssize_t i; PyObject** temps[4] = {&__pyx_t_5,&__pyx_t_4,&__pyx_t_3,&__pyx_t_6}; for (i=0; i < 4; i++) { PyObject* item = PySequence_ITEM(sequence, i); if (unlikely(!item)) __PYX_ERR(0, 383, __pyx_L1_error) __Pyx_GOTREF(item); *(temps[i]) = item; } } #endif } else { Py_ssize_t index = -1; PyObject** temps[4] = {&__pyx_t_5,&__pyx_t_4,&__pyx_t_3,&__pyx_t_6}; __pyx_t_11 = PyObject_GetIter(__pyx_v_val); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 383, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); __pyx_t_7 = Py_TYPE(__pyx_t_11)->tp_iternext; for (index=0; index < 4; index++) { PyObject* item = __pyx_t_7(__pyx_t_11); if (unlikely(!item)) goto __pyx_L6_unpacking_failed; __Pyx_GOTREF(item); *(temps[index]) = item; } if (__Pyx_IternextUnpackEndCheck(__pyx_t_7(__pyx_t_11), 4) < 0) __PYX_ERR(0, 383, __pyx_L1_error) __pyx_t_7 = NULL; __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; goto __pyx_L7_unpacking_done; __pyx_L6_unpacking_failed:; __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; __pyx_t_7 = NULL; if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); __PYX_ERR(0, 383, __pyx_L1_error) __pyx_L7_unpacking_done:; } __pyx_t_10 = __pyx_PyFloat_AsDouble(__pyx_t_5); if (unlikely((__pyx_t_10 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 383, __pyx_L1_error) __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __pyx_t_9 = __pyx_PyFloat_AsDouble(__pyx_t_4); if (unlikely((__pyx_t_9 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 383, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_t_8 = __pyx_PyFloat_AsDouble(__pyx_t_3); if (unlikely((__pyx_t_8 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 383, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_12 = __pyx_PyFloat_AsDouble(__pyx_t_6); if (unlikely((__pyx_t_12 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 383, __pyx_L1_error) __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __pyx_v_h = __pyx_t_10; __pyx_v_s = __pyx_t_9; __pyx_v_l = __pyx_t_8; __pyx_v_a = __pyx_t_12; } __pyx_L3:; /* "pygame_sdl2/color.pyx":385 * h, s, l, a = val * * s /= 100.0 # <<<<<<<<<<<<<< * l /= 100.0 * a /= 100.0 */ __pyx_v_s = (__pyx_v_s / 100.0); /* "pygame_sdl2/color.pyx":386 * * s /= 100.0 * l /= 100.0 # <<<<<<<<<<<<<< * a /= 100.0 * */ __pyx_v_l = (__pyx_v_l / 100.0); /* "pygame_sdl2/color.pyx":387 * s /= 100.0 * l /= 100.0 * a /= 100.0 # <<<<<<<<<<<<<< * * cdef double c = (1 - abs(2*l - 1)) * s */ __pyx_v_a = (__pyx_v_a / 100.0); /* "pygame_sdl2/color.pyx":389 * a /= 100.0 * * cdef double c = (1 - abs(2*l - 1)) * s # <<<<<<<<<<<<<< * cdef double x = c * (1 - abs((h / 60.0) % 2 - 1)) * cdef double m = l - c / 2.0 */ __pyx_v_c = ((1.0 - fabs(((2.0 * __pyx_v_l) - 1.0))) * __pyx_v_s); /* "pygame_sdl2/color.pyx":390 * * cdef double c = (1 - abs(2*l - 1)) * s * cdef double x = c * (1 - abs((h / 60.0) % 2 - 1)) # <<<<<<<<<<<<<< * cdef double m = l - c / 2.0 * */ __pyx_v_x = (__pyx_v_c * (1.0 - fabs((__Pyx_mod_double((__pyx_v_h / 60.0), 2.0) - 1.0)))); /* "pygame_sdl2/color.pyx":391 * cdef double c = (1 - abs(2*l - 1)) * s * cdef double x = c * (1 - abs((h / 60.0) % 2 - 1)) * cdef double m = l - c / 2.0 # <<<<<<<<<<<<<< * * cdef double r, g, b */ __pyx_v_m = (__pyx_v_l - (__pyx_v_c / 2.0)); /* "pygame_sdl2/color.pyx":394 * * cdef double r, g, b * if 0 <= h < 60: # <<<<<<<<<<<<<< * r, g, b = c, x, 0 * elif 60 <= h < 120: */ __pyx_t_2 = (0.0 <= __pyx_v_h); if (__pyx_t_2) { __pyx_t_2 = (__pyx_v_h < 60.0); } __pyx_t_13 = (__pyx_t_2 != 0); if (__pyx_t_13) { /* "pygame_sdl2/color.pyx":395 * cdef double r, g, b * if 0 <= h < 60: * r, g, b = c, x, 0 # <<<<<<<<<<<<<< * elif 60 <= h < 120: * r, g, b = x, c, 0 */ __pyx_t_12 = __pyx_v_c; __pyx_t_8 = __pyx_v_x; __pyx_t_9 = 0.0; __pyx_v_r = __pyx_t_12; __pyx_v_g = __pyx_t_8; __pyx_v_b = __pyx_t_9; /* "pygame_sdl2/color.pyx":394 * * cdef double r, g, b * if 0 <= h < 60: # <<<<<<<<<<<<<< * r, g, b = c, x, 0 * elif 60 <= h < 120: */ goto __pyx_L8; } /* "pygame_sdl2/color.pyx":396 * if 0 <= h < 60: * r, g, b = c, x, 0 * elif 60 <= h < 120: # <<<<<<<<<<<<<< * r, g, b = x, c, 0 * elif 120 <= h < 180: */ __pyx_t_13 = (60.0 <= __pyx_v_h); if (__pyx_t_13) { __pyx_t_13 = (__pyx_v_h < 120.0); } __pyx_t_2 = (__pyx_t_13 != 0); if (__pyx_t_2) { /* "pygame_sdl2/color.pyx":397 * r, g, b = c, x, 0 * elif 60 <= h < 120: * r, g, b = x, c, 0 # <<<<<<<<<<<<<< * elif 120 <= h < 180: * r, g, b = 0, c, x */ __pyx_t_9 = __pyx_v_x; __pyx_t_8 = __pyx_v_c; __pyx_t_12 = 0.0; __pyx_v_r = __pyx_t_9; __pyx_v_g = __pyx_t_8; __pyx_v_b = __pyx_t_12; /* "pygame_sdl2/color.pyx":396 * if 0 <= h < 60: * r, g, b = c, x, 0 * elif 60 <= h < 120: # <<<<<<<<<<<<<< * r, g, b = x, c, 0 * elif 120 <= h < 180: */ goto __pyx_L8; } /* "pygame_sdl2/color.pyx":398 * elif 60 <= h < 120: * r, g, b = x, c, 0 * elif 120 <= h < 180: # <<<<<<<<<<<<<< * r, g, b = 0, c, x * elif 180 <= h < 240: */ __pyx_t_2 = (120.0 <= __pyx_v_h); if (__pyx_t_2) { __pyx_t_2 = (__pyx_v_h < 180.0); } __pyx_t_13 = (__pyx_t_2 != 0); if (__pyx_t_13) { /* "pygame_sdl2/color.pyx":399 * r, g, b = x, c, 0 * elif 120 <= h < 180: * r, g, b = 0, c, x # <<<<<<<<<<<<<< * elif 180 <= h < 240: * r, g, b = 0, x, c */ __pyx_t_12 = 0.0; __pyx_t_8 = __pyx_v_c; __pyx_t_9 = __pyx_v_x; __pyx_v_r = __pyx_t_12; __pyx_v_g = __pyx_t_8; __pyx_v_b = __pyx_t_9; /* "pygame_sdl2/color.pyx":398 * elif 60 <= h < 120: * r, g, b = x, c, 0 * elif 120 <= h < 180: # <<<<<<<<<<<<<< * r, g, b = 0, c, x * elif 180 <= h < 240: */ goto __pyx_L8; } /* "pygame_sdl2/color.pyx":400 * elif 120 <= h < 180: * r, g, b = 0, c, x * elif 180 <= h < 240: # <<<<<<<<<<<<<< * r, g, b = 0, x, c * elif 240 <= h < 300: */ __pyx_t_13 = (180.0 <= __pyx_v_h); if (__pyx_t_13) { __pyx_t_13 = (__pyx_v_h < 240.0); } __pyx_t_2 = (__pyx_t_13 != 0); if (__pyx_t_2) { /* "pygame_sdl2/color.pyx":401 * r, g, b = 0, c, x * elif 180 <= h < 240: * r, g, b = 0, x, c # <<<<<<<<<<<<<< * elif 240 <= h < 300: * r, g, b = x, 0, c */ __pyx_t_9 = 0.0; __pyx_t_8 = __pyx_v_x; __pyx_t_12 = __pyx_v_c; __pyx_v_r = __pyx_t_9; __pyx_v_g = __pyx_t_8; __pyx_v_b = __pyx_t_12; /* "pygame_sdl2/color.pyx":400 * elif 120 <= h < 180: * r, g, b = 0, c, x * elif 180 <= h < 240: # <<<<<<<<<<<<<< * r, g, b = 0, x, c * elif 240 <= h < 300: */ goto __pyx_L8; } /* "pygame_sdl2/color.pyx":402 * elif 180 <= h < 240: * r, g, b = 0, x, c * elif 240 <= h < 300: # <<<<<<<<<<<<<< * r, g, b = x, 0, c * elif 300 <= h < 360: */ __pyx_t_2 = (240.0 <= __pyx_v_h); if (__pyx_t_2) { __pyx_t_2 = (__pyx_v_h < 300.0); } __pyx_t_13 = (__pyx_t_2 != 0); if (__pyx_t_13) { /* "pygame_sdl2/color.pyx":403 * r, g, b = 0, x, c * elif 240 <= h < 300: * r, g, b = x, 0, c # <<<<<<<<<<<<<< * elif 300 <= h < 360: * r, g, b = c, 0, x */ __pyx_t_12 = __pyx_v_x; __pyx_t_8 = 0.0; __pyx_t_9 = __pyx_v_c; __pyx_v_r = __pyx_t_12; __pyx_v_g = __pyx_t_8; __pyx_v_b = __pyx_t_9; /* "pygame_sdl2/color.pyx":402 * elif 180 <= h < 240: * r, g, b = 0, x, c * elif 240 <= h < 300: # <<<<<<<<<<<<<< * r, g, b = x, 0, c * elif 300 <= h < 360: */ goto __pyx_L8; } /* "pygame_sdl2/color.pyx":404 * elif 240 <= h < 300: * r, g, b = x, 0, c * elif 300 <= h < 360: # <<<<<<<<<<<<<< * r, g, b = c, 0, x * else: */ __pyx_t_13 = (300.0 <= __pyx_v_h); if (__pyx_t_13) { __pyx_t_13 = (__pyx_v_h < 360.0); } __pyx_t_2 = (__pyx_t_13 != 0); if (__pyx_t_2) { /* "pygame_sdl2/color.pyx":405 * r, g, b = x, 0, c * elif 300 <= h < 360: * r, g, b = c, 0, x # <<<<<<<<<<<<<< * else: * raise ValueError() */ __pyx_t_9 = __pyx_v_c; __pyx_t_8 = 0.0; __pyx_t_12 = __pyx_v_x; __pyx_v_r = __pyx_t_9; __pyx_v_g = __pyx_t_8; __pyx_v_b = __pyx_t_12; /* "pygame_sdl2/color.pyx":404 * elif 240 <= h < 300: * r, g, b = x, 0, c * elif 300 <= h < 360: # <<<<<<<<<<<<<< * r, g, b = c, 0, x * else: */ goto __pyx_L8; } /* "pygame_sdl2/color.pyx":407 * r, g, b = c, 0, x * else: * raise ValueError() # <<<<<<<<<<<<<< * * self.r = int(255 * (r + m)) */ /*else*/ { __pyx_t_6 = __Pyx_PyObject_CallNoArg(__pyx_builtin_ValueError); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 407, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_Raise(__pyx_t_6, 0, 0, 0); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __PYX_ERR(0, 407, __pyx_L1_error) } __pyx_L8:; /* "pygame_sdl2/color.pyx":409 * raise ValueError() * * self.r = int(255 * (r + m)) # <<<<<<<<<<<<<< * self.g = int(255 * (g + m)) * self.b = int(255 * (b + m)) */ __pyx_v_self->r = ((Uint8)(255.0 * (__pyx_v_r + __pyx_v_m))); /* "pygame_sdl2/color.pyx":410 * * self.r = int(255 * (r + m)) * self.g = int(255 * (g + m)) # <<<<<<<<<<<<<< * self.b = int(255 * (b + m)) * self.a = int(255 * a) */ __pyx_v_self->g = ((Uint8)(255.0 * (__pyx_v_g + __pyx_v_m))); /* "pygame_sdl2/color.pyx":411 * self.r = int(255 * (r + m)) * self.g = int(255 * (g + m)) * self.b = int(255 * (b + m)) # <<<<<<<<<<<<<< * self.a = int(255 * a) * */ __pyx_v_self->b = ((Uint8)(255.0 * (__pyx_v_b + __pyx_v_m))); /* "pygame_sdl2/color.pyx":412 * self.g = int(255 * (g + m)) * self.b = int(255 * (b + m)) * self.a = int(255 * a) # <<<<<<<<<<<<<< * * property i1i2i3: */ __pyx_v_self->a = ((Uint8)(255.0 * __pyx_v_a)); /* "pygame_sdl2/color.pyx":377 * return h, s, l, a * * def __set__(self, val): # <<<<<<<<<<<<<< * cdef double h, s, l, a * if len(val) == 3: */ /* function exit code */ __pyx_r = 0; goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_5); __Pyx_XDECREF(__pyx_t_6); __Pyx_XDECREF(__pyx_t_11); __Pyx_AddTraceback("pygame_sdl2.color.Color.hsla.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = -1; __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/color.pyx":415 * * property i1i2i3: * def __get__(self): # <<<<<<<<<<<<<< * # Take the dot product as described here: * # http://de.wikipedia.org/wiki/I1I2I3-Farbraum */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_5color_5Color_6i1i2i3_1__get__(PyObject *__pyx_v_self); /*proto*/ static PyObject *__pyx_pw_11pygame_sdl2_5color_5Color_6i1i2i3_1__get__(PyObject *__pyx_v_self) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); __pyx_r = __pyx_pf_11pygame_sdl2_5color_5Color_6i1i2i3___get__(((struct __pyx_obj_11pygame_sdl2_5color_Color *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_5color_5Color_6i1i2i3___get__(struct __pyx_obj_11pygame_sdl2_5color_Color *__pyx_v_self) { double __pyx_v_i1; double __pyx_v_i2; double __pyx_v_i3; double __pyx_v_r; double __pyx_v_g; double __pyx_v_b; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; __Pyx_RefNannySetupContext("__get__", 0); /* "pygame_sdl2/color.pyx":422 * cdef double r, g, b * * r = self.r / 255.0 # <<<<<<<<<<<<<< * g = self.g / 255.0 * b = self.b / 255.0 */ __pyx_v_r = (((double)__pyx_v_self->r) / 255.0); /* "pygame_sdl2/color.pyx":423 * * r = self.r / 255.0 * g = self.g / 255.0 # <<<<<<<<<<<<<< * b = self.b / 255.0 * */ __pyx_v_g = (((double)__pyx_v_self->g) / 255.0); /* "pygame_sdl2/color.pyx":424 * r = self.r / 255.0 * g = self.g / 255.0 * b = self.b / 255.0 # <<<<<<<<<<<<<< * * i1 = (r + g + b) / 3.0 */ __pyx_v_b = (((double)__pyx_v_self->b) / 255.0); /* "pygame_sdl2/color.pyx":426 * b = self.b / 255.0 * * i1 = (r + g + b) / 3.0 # <<<<<<<<<<<<<< * i2 = (r - b) / 2.0 * i3 = (2*g - r - b) / 4.0 */ __pyx_v_i1 = (((__pyx_v_r + __pyx_v_g) + __pyx_v_b) / 3.0); /* "pygame_sdl2/color.pyx":427 * * i1 = (r + g + b) / 3.0 * i2 = (r - b) / 2.0 # <<<<<<<<<<<<<< * i3 = (2*g - r - b) / 4.0 * */ __pyx_v_i2 = ((__pyx_v_r - __pyx_v_b) / 2.0); /* "pygame_sdl2/color.pyx":428 * i1 = (r + g + b) / 3.0 * i2 = (r - b) / 2.0 * i3 = (2*g - r - b) / 4.0 # <<<<<<<<<<<<<< * * return i1, i2, i3 */ __pyx_v_i3 = ((((2.0 * __pyx_v_g) - __pyx_v_r) - __pyx_v_b) / 4.0); /* "pygame_sdl2/color.pyx":430 * i3 = (2*g - r - b) / 4.0 * * return i1, i2, i3 # <<<<<<<<<<<<<< * * def __set__(self, val): */ __Pyx_XDECREF(__pyx_r); __pyx_t_1 = PyFloat_FromDouble(__pyx_v_i1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 430, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = PyFloat_FromDouble(__pyx_v_i2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 430, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = PyFloat_FromDouble(__pyx_v_i3); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 430, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = PyTuple_New(3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 430, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_GIVEREF(__pyx_t_1); PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_1); __Pyx_GIVEREF(__pyx_t_2); PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_2); __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_4, 2, __pyx_t_3); __pyx_t_1 = 0; __pyx_t_2 = 0; __pyx_t_3 = 0; __pyx_r = __pyx_t_4; __pyx_t_4 = 0; goto __pyx_L0; /* "pygame_sdl2/color.pyx":415 * * property i1i2i3: * def __get__(self): # <<<<<<<<<<<<<< * # Take the dot product as described here: * # http://de.wikipedia.org/wiki/I1I2I3-Farbraum */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_AddTraceback("pygame_sdl2.color.Color.i1i2i3.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/color.pyx":432 * return i1, i2, i3 * * def __set__(self, val): # <<<<<<<<<<<<<< * # Dot product with the inverted matrix. * */ /* Python wrapper */ static int __pyx_pw_11pygame_sdl2_5color_5Color_6i1i2i3_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_val); /*proto*/ static int __pyx_pw_11pygame_sdl2_5color_5Color_6i1i2i3_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_val) { int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__set__ (wrapper)", 0); __pyx_r = __pyx_pf_11pygame_sdl2_5color_5Color_6i1i2i3_2__set__(((struct __pyx_obj_11pygame_sdl2_5color_Color *)__pyx_v_self), ((PyObject *)__pyx_v_val)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static int __pyx_pf_11pygame_sdl2_5color_5Color_6i1i2i3_2__set__(struct __pyx_obj_11pygame_sdl2_5color_Color *__pyx_v_self, PyObject *__pyx_v_val) { double __pyx_v_i1; double __pyx_v_i2; double __pyx_v_i3; double __pyx_v_r; double __pyx_v_g; double __pyx_v_b; int __pyx_r; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; PyObject *(*__pyx_t_5)(PyObject *); double __pyx_t_6; double __pyx_t_7; double __pyx_t_8; __Pyx_RefNannySetupContext("__set__", 0); /* "pygame_sdl2/color.pyx":438 * cdef double r, g, b * * i1, i2, i3 = val # <<<<<<<<<<<<<< * * r = i1 + i2 - (2.0/3.0 * i3) */ if ((likely(PyTuple_CheckExact(__pyx_v_val))) || (PyList_CheckExact(__pyx_v_val))) { PyObject* sequence = __pyx_v_val; #if CYTHON_COMPILING_IN_CPYTHON Py_ssize_t size = Py_SIZE(sequence); #else Py_ssize_t size = PySequence_Size(sequence); #endif if (unlikely(size != 3)) { if (size > 3) __Pyx_RaiseTooManyValuesError(3); else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); __PYX_ERR(0, 438, __pyx_L1_error) } #if CYTHON_COMPILING_IN_CPYTHON if (likely(PyTuple_CheckExact(sequence))) { __pyx_t_1 = PyTuple_GET_ITEM(sequence, 0); __pyx_t_2 = PyTuple_GET_ITEM(sequence, 1); __pyx_t_3 = PyTuple_GET_ITEM(sequence, 2); } else { __pyx_t_1 = PyList_GET_ITEM(sequence, 0); __pyx_t_2 = PyList_GET_ITEM(sequence, 1); __pyx_t_3 = PyList_GET_ITEM(sequence, 2); } __Pyx_INCREF(__pyx_t_1); __Pyx_INCREF(__pyx_t_2); __Pyx_INCREF(__pyx_t_3); #else __pyx_t_1 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 438, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 438, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = PySequence_ITEM(sequence, 2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 438, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); #endif } else { Py_ssize_t index = -1; __pyx_t_4 = PyObject_GetIter(__pyx_v_val); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 438, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_5 = Py_TYPE(__pyx_t_4)->tp_iternext; index = 0; __pyx_t_1 = __pyx_t_5(__pyx_t_4); if (unlikely(!__pyx_t_1)) goto __pyx_L3_unpacking_failed; __Pyx_GOTREF(__pyx_t_1); index = 1; __pyx_t_2 = __pyx_t_5(__pyx_t_4); if (unlikely(!__pyx_t_2)) goto __pyx_L3_unpacking_failed; __Pyx_GOTREF(__pyx_t_2); index = 2; __pyx_t_3 = __pyx_t_5(__pyx_t_4); if (unlikely(!__pyx_t_3)) goto __pyx_L3_unpacking_failed; __Pyx_GOTREF(__pyx_t_3); if (__Pyx_IternextUnpackEndCheck(__pyx_t_5(__pyx_t_4), 3) < 0) __PYX_ERR(0, 438, __pyx_L1_error) __pyx_t_5 = NULL; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; goto __pyx_L4_unpacking_done; __pyx_L3_unpacking_failed:; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_t_5 = NULL; if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); __PYX_ERR(0, 438, __pyx_L1_error) __pyx_L4_unpacking_done:; } __pyx_t_6 = __pyx_PyFloat_AsDouble(__pyx_t_1); if (unlikely((__pyx_t_6 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 438, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_7 = __pyx_PyFloat_AsDouble(__pyx_t_2); if (unlikely((__pyx_t_7 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 438, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_8 = __pyx_PyFloat_AsDouble(__pyx_t_3); if (unlikely((__pyx_t_8 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 438, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_v_i1 = __pyx_t_6; __pyx_v_i2 = __pyx_t_7; __pyx_v_i3 = __pyx_t_8; /* "pygame_sdl2/color.pyx":440 * i1, i2, i3 = val * * r = i1 + i2 - (2.0/3.0 * i3) # <<<<<<<<<<<<<< * g = i1 + (4.0/3.0 * i3) * b = i1 - i2 - (2.0/3.0 * i3) */ __pyx_v_r = ((__pyx_v_i1 + __pyx_v_i2) - ((2.0 / 3.0) * __pyx_v_i3)); /* "pygame_sdl2/color.pyx":441 * * r = i1 + i2 - (2.0/3.0 * i3) * g = i1 + (4.0/3.0 * i3) # <<<<<<<<<<<<<< * b = i1 - i2 - (2.0/3.0 * i3) * */ __pyx_v_g = (__pyx_v_i1 + ((4.0 / 3.0) * __pyx_v_i3)); /* "pygame_sdl2/color.pyx":442 * r = i1 + i2 - (2.0/3.0 * i3) * g = i1 + (4.0/3.0 * i3) * b = i1 - i2 - (2.0/3.0 * i3) # <<<<<<<<<<<<<< * * # Don't change alpha. */ __pyx_v_b = ((__pyx_v_i1 - __pyx_v_i2) - ((2.0 / 3.0) * __pyx_v_i3)); /* "pygame_sdl2/color.pyx":445 * * # Don't change alpha. * self.r = int(r * 255) # <<<<<<<<<<<<<< * self.g = int(g * 255) * self.b = int(b * 255) */ __pyx_v_self->r = ((Uint8)(__pyx_v_r * 255.0)); /* "pygame_sdl2/color.pyx":446 * # Don't change alpha. * self.r = int(r * 255) * self.g = int(g * 255) # <<<<<<<<<<<<<< * self.b = int(b * 255) * */ __pyx_v_self->g = ((Uint8)(__pyx_v_g * 255.0)); /* "pygame_sdl2/color.pyx":447 * self.r = int(r * 255) * self.g = int(g * 255) * self.b = int(b * 255) # <<<<<<<<<<<<<< * * def normalize(self): */ __pyx_v_self->b = ((Uint8)(__pyx_v_b * 255.0)); /* "pygame_sdl2/color.pyx":432 * return i1, i2, i3 * * def __set__(self, val): # <<<<<<<<<<<<<< * # Dot product with the inverted matrix. * */ /* function exit code */ __pyx_r = 0; goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_AddTraceback("pygame_sdl2.color.Color.i1i2i3.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = -1; __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/color.pyx":449 * self.b = int(b * 255) * * def normalize(self): # <<<<<<<<<<<<<< * return self.r / 255.0, self.g / 255.0, self.b / 255.0, self.a / 255.0 * */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_5color_5Color_39normalize(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/ static PyObject *__pyx_pw_11pygame_sdl2_5color_5Color_39normalize(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("normalize (wrapper)", 0); __pyx_r = __pyx_pf_11pygame_sdl2_5color_5Color_38normalize(((struct __pyx_obj_11pygame_sdl2_5color_Color *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_5color_5Color_38normalize(struct __pyx_obj_11pygame_sdl2_5color_Color *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; PyObject *__pyx_t_5 = NULL; __Pyx_RefNannySetupContext("normalize", 0); /* "pygame_sdl2/color.pyx":450 * * def normalize(self): * return self.r / 255.0, self.g / 255.0, self.b / 255.0, self.a / 255.0 # <<<<<<<<<<<<<< * * def correct_gamma(self, gamma): */ __Pyx_XDECREF(__pyx_r); __pyx_t_1 = PyFloat_FromDouble((((double)__pyx_v_self->r) / 255.0)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 450, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = PyFloat_FromDouble((((double)__pyx_v_self->g) / 255.0)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 450, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = PyFloat_FromDouble((((double)__pyx_v_self->b) / 255.0)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 450, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = PyFloat_FromDouble((((double)__pyx_v_self->a) / 255.0)); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 450, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_5 = PyTuple_New(4); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 450, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_GIVEREF(__pyx_t_1); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_1); __Pyx_GIVEREF(__pyx_t_2); PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_t_2); __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_5, 2, __pyx_t_3); __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_5, 3, __pyx_t_4); __pyx_t_1 = 0; __pyx_t_2 = 0; __pyx_t_3 = 0; __pyx_t_4 = 0; __pyx_r = __pyx_t_5; __pyx_t_5 = 0; goto __pyx_L0; /* "pygame_sdl2/color.pyx":449 * self.b = int(b * 255) * * def normalize(self): # <<<<<<<<<<<<<< * return self.r / 255.0, self.g / 255.0, self.b / 255.0, self.a / 255.0 * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_5); __Pyx_AddTraceback("pygame_sdl2.color.Color.normalize", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/color.pyx":452 * return self.r / 255.0, self.g / 255.0, self.b / 255.0, self.a / 255.0 * * def correct_gamma(self, gamma): # <<<<<<<<<<<<<< * m = map(lambda x: int(round(pow(x / 255.0, gamma) * 255)), tuple(self)) * c = type(self)(tuple(m)) */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_5color_5Color_41correct_gamma(PyObject *__pyx_v_self, PyObject *__pyx_v_gamma); /*proto*/ static PyObject *__pyx_pw_11pygame_sdl2_5color_5Color_41correct_gamma(PyObject *__pyx_v_self, PyObject *__pyx_v_gamma) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("correct_gamma (wrapper)", 0); __pyx_r = __pyx_pf_11pygame_sdl2_5color_5Color_40correct_gamma(((struct __pyx_obj_11pygame_sdl2_5color_Color *)__pyx_v_self), ((PyObject *)__pyx_v_gamma)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/color.pyx":453 * * def correct_gamma(self, gamma): * m = map(lambda x: int(round(pow(x / 255.0, gamma) * 255)), tuple(self)) # <<<<<<<<<<<<<< * c = type(self)(tuple(m)) * return c */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_5color_5Color_13correct_gamma_lambda1(PyObject *__pyx_self, PyObject *__pyx_v_x); /*proto*/ static PyMethodDef __pyx_mdef_11pygame_sdl2_5color_5Color_13correct_gamma_lambda1 = {"lambda1", (PyCFunction)__pyx_pw_11pygame_sdl2_5color_5Color_13correct_gamma_lambda1, METH_O, 0}; static PyObject *__pyx_pw_11pygame_sdl2_5color_5Color_13correct_gamma_lambda1(PyObject *__pyx_self, PyObject *__pyx_v_x) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("lambda1 (wrapper)", 0); __pyx_r = __pyx_lambda_funcdef_lambda1(__pyx_self, ((PyObject *)__pyx_v_x)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_lambda_funcdef_lambda1(PyObject *__pyx_self, PyObject *__pyx_v_x) { struct __pyx_obj_11pygame_sdl2_5color___pyx_scope_struct__correct_gamma *__pyx_cur_scope; struct __pyx_obj_11pygame_sdl2_5color___pyx_scope_struct__correct_gamma *__pyx_outer_scope; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; __Pyx_RefNannySetupContext("lambda1", 0); __pyx_outer_scope = (struct __pyx_obj_11pygame_sdl2_5color___pyx_scope_struct__correct_gamma *) __Pyx_CyFunction_GetClosure(__pyx_self); __pyx_cur_scope = __pyx_outer_scope; __Pyx_XDECREF(__pyx_r); __pyx_t_1 = __Pyx_PyFloat_TrueDivideObjC(__pyx_v_x, __pyx_float_255_0, 255.0, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 453, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (unlikely(!__pyx_cur_scope->__pyx_v_gamma)) { __Pyx_RaiseClosureNameError("gamma"); __PYX_ERR(0, 453, __pyx_L1_error) } __pyx_t_2 = __pyx_cur_scope->__pyx_v_gamma; __Pyx_INCREF(__pyx_t_2); __pyx_t_3 = __Pyx_PyNumber_Power2(__pyx_t_1, __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 453, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_2 = PyNumber_Multiply(__pyx_t_3, __pyx_int_255); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 453, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 453, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_GIVEREF(__pyx_t_2); PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_2); __pyx_t_2 = 0; __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_round, __pyx_t_3, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 453, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_3 = __Pyx_PyNumber_Int(__pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 453, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_r = __pyx_t_3; __pyx_t_3 = 0; goto __pyx_L0; /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("pygame_sdl2.color.Color.correct_gamma.lambda1", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/color.pyx":452 * return self.r / 255.0, self.g / 255.0, self.b / 255.0, self.a / 255.0 * * def correct_gamma(self, gamma): # <<<<<<<<<<<<<< * m = map(lambda x: int(round(pow(x / 255.0, gamma) * 255)), tuple(self)) * c = type(self)(tuple(m)) */ static PyObject *__pyx_pf_11pygame_sdl2_5color_5Color_40correct_gamma(struct __pyx_obj_11pygame_sdl2_5color_Color *__pyx_v_self, PyObject *__pyx_v_gamma) { struct __pyx_obj_11pygame_sdl2_5color___pyx_scope_struct__correct_gamma *__pyx_cur_scope; PyObject *__pyx_v_m = NULL; PyObject *__pyx_v_c = NULL; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; PyObject *__pyx_t_5 = NULL; __Pyx_RefNannySetupContext("correct_gamma", 0); __pyx_cur_scope = (struct __pyx_obj_11pygame_sdl2_5color___pyx_scope_struct__correct_gamma *)__pyx_tp_new_11pygame_sdl2_5color___pyx_scope_struct__correct_gamma(__pyx_ptype_11pygame_sdl2_5color___pyx_scope_struct__correct_gamma, __pyx_empty_tuple, NULL); if (unlikely(!__pyx_cur_scope)) { __Pyx_RefNannyFinishContext(); return NULL; } __Pyx_GOTREF(__pyx_cur_scope); __pyx_cur_scope->__pyx_v_gamma = __pyx_v_gamma; __Pyx_INCREF(__pyx_cur_scope->__pyx_v_gamma); __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_gamma); /* "pygame_sdl2/color.pyx":453 * * def correct_gamma(self, gamma): * m = map(lambda x: int(round(pow(x / 255.0, gamma) * 255)), tuple(self)) # <<<<<<<<<<<<<< * c = type(self)(tuple(m)) * return c */ __pyx_t_1 = __Pyx_CyFunction_NewEx(&__pyx_mdef_11pygame_sdl2_5color_5Color_13correct_gamma_lambda1, 0, __pyx_n_s_correct_gamma_locals_lambda, ((PyObject*)__pyx_cur_scope), __pyx_n_s_pygame_sdl2_color, __pyx_d, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 453, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = PySequence_Tuple(((PyObject *)__pyx_v_self)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 453, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 453, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_GIVEREF(__pyx_t_1); PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_1); __Pyx_GIVEREF(__pyx_t_2); PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_2); __pyx_t_1 = 0; __pyx_t_2 = 0; __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_map, __pyx_t_3, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 453, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_v_m = __pyx_t_2; __pyx_t_2 = 0; /* "pygame_sdl2/color.pyx":454 * def correct_gamma(self, gamma): * m = map(lambda x: int(round(pow(x / 255.0, gamma) * 255)), tuple(self)) * c = type(self)(tuple(m)) # <<<<<<<<<<<<<< * return c * */ __pyx_t_3 = PySequence_Tuple(__pyx_v_m); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 454, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_INCREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self)))); __pyx_t_1 = ((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))); __pyx_t_4 = NULL; if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_1))) { __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_1); if (likely(__pyx_t_4)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1); __Pyx_INCREF(__pyx_t_4); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_1, function); } } if (!__pyx_t_4) { __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_1, __pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 454, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_GOTREF(__pyx_t_2); } else { __pyx_t_5 = PyTuple_New(1+1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 454, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_4); __pyx_t_4 = NULL; __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_5, 0+1, __pyx_t_3); __pyx_t_3 = 0; __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_5, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 454, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_v_c = __pyx_t_2; __pyx_t_2 = 0; /* "pygame_sdl2/color.pyx":455 * m = map(lambda x: int(round(pow(x / 255.0, gamma) * 255)), tuple(self)) * c = type(self)(tuple(m)) * return c # <<<<<<<<<<<<<< * * def set_length(self, n): */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(__pyx_v_c); __pyx_r = __pyx_v_c; goto __pyx_L0; /* "pygame_sdl2/color.pyx":452 * return self.r / 255.0, self.g / 255.0, self.b / 255.0, self.a / 255.0 * * def correct_gamma(self, gamma): # <<<<<<<<<<<<<< * m = map(lambda x: int(round(pow(x / 255.0, gamma) * 255)), tuple(self)) * c = type(self)(tuple(m)) */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_5); __Pyx_AddTraceback("pygame_sdl2.color.Color.correct_gamma", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF(__pyx_v_m); __Pyx_XDECREF(__pyx_v_c); __Pyx_DECREF(((PyObject *)__pyx_cur_scope)); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/color.pyx":457 * return c * * def set_length(self, n): # <<<<<<<<<<<<<< * if n > 4 or n < 1: * raise ValueError(n) */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_5color_5Color_43set_length(PyObject *__pyx_v_self, PyObject *__pyx_v_n); /*proto*/ static PyObject *__pyx_pw_11pygame_sdl2_5color_5Color_43set_length(PyObject *__pyx_v_self, PyObject *__pyx_v_n) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("set_length (wrapper)", 0); __pyx_r = __pyx_pf_11pygame_sdl2_5color_5Color_42set_length(((struct __pyx_obj_11pygame_sdl2_5color_Color *)__pyx_v_self), ((PyObject *)__pyx_v_n)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_5color_5Color_42set_length(struct __pyx_obj_11pygame_sdl2_5color_Color *__pyx_v_self, PyObject *__pyx_v_n) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; PyObject *__pyx_t_2 = NULL; int __pyx_t_3; PyObject *__pyx_t_4 = NULL; uint8_t __pyx_t_5; __Pyx_RefNannySetupContext("set_length", 0); /* "pygame_sdl2/color.pyx":458 * * def set_length(self, n): * if n > 4 or n < 1: # <<<<<<<<<<<<<< * raise ValueError(n) * self.length = n */ __pyx_t_2 = PyObject_RichCompare(__pyx_v_n, __pyx_int_4, Py_GT); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 458, __pyx_L1_error) __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(0, 458, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; if (!__pyx_t_3) { } else { __pyx_t_1 = __pyx_t_3; goto __pyx_L4_bool_binop_done; } __pyx_t_2 = PyObject_RichCompare(__pyx_v_n, __pyx_int_1, Py_LT); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 458, __pyx_L1_error) __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(0, 458, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_1 = __pyx_t_3; __pyx_L4_bool_binop_done:; if (__pyx_t_1) { /* "pygame_sdl2/color.pyx":459 * def set_length(self, n): * if n > 4 or n < 1: * raise ValueError(n) # <<<<<<<<<<<<<< * self.length = n */ __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 459, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_INCREF(__pyx_v_n); __Pyx_GIVEREF(__pyx_v_n); PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_n); __pyx_t_4 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_t_2, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 459, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_Raise(__pyx_t_4, 0, 0, 0); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __PYX_ERR(0, 459, __pyx_L1_error) /* "pygame_sdl2/color.pyx":458 * * def set_length(self, n): * if n > 4 or n < 1: # <<<<<<<<<<<<<< * raise ValueError(n) * self.length = n */ } /* "pygame_sdl2/color.pyx":460 * if n > 4 or n < 1: * raise ValueError(n) * self.length = n # <<<<<<<<<<<<<< */ __pyx_t_5 = __Pyx_PyInt_As_uint8_t(__pyx_v_n); if (unlikely((__pyx_t_5 == (uint8_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 460, __pyx_L1_error) __pyx_v_self->length = __pyx_t_5; /* "pygame_sdl2/color.pyx":457 * return c * * def set_length(self, n): # <<<<<<<<<<<<<< * if n > 4 or n < 1: * raise ValueError(n) */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_4); __Pyx_AddTraceback("pygame_sdl2.color.Color.set_length", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/color.pxd":30 * cdef object __weakref__ * * cdef public Uint8 r, g, b, a # <<<<<<<<<<<<<< * cdef uint8_t length * */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_5color_5Color_1r_1__get__(PyObject *__pyx_v_self); /*proto*/ static PyObject *__pyx_pw_11pygame_sdl2_5color_5Color_1r_1__get__(PyObject *__pyx_v_self) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); __pyx_r = __pyx_pf_11pygame_sdl2_5color_5Color_1r___get__(((struct __pyx_obj_11pygame_sdl2_5color_Color *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_5color_5Color_1r___get__(struct __pyx_obj_11pygame_sdl2_5color_Color *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; __Pyx_RefNannySetupContext("__get__", 0); __Pyx_XDECREF(__pyx_r); __pyx_t_1 = __Pyx_PyInt_From_uint8_t(__pyx_v_self->r); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 30, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("pygame_sdl2.color.Color.r.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* Python wrapper */ static int __pyx_pw_11pygame_sdl2_5color_5Color_1r_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/ static int __pyx_pw_11pygame_sdl2_5color_5Color_1r_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) { int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__set__ (wrapper)", 0); __pyx_r = __pyx_pf_11pygame_sdl2_5color_5Color_1r_2__set__(((struct __pyx_obj_11pygame_sdl2_5color_Color *)__pyx_v_self), ((PyObject *)__pyx_v_value)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static int __pyx_pf_11pygame_sdl2_5color_5Color_1r_2__set__(struct __pyx_obj_11pygame_sdl2_5color_Color *__pyx_v_self, PyObject *__pyx_v_value) { int __pyx_r; __Pyx_RefNannyDeclarations Uint8 __pyx_t_1; __Pyx_RefNannySetupContext("__set__", 0); __pyx_t_1 = __Pyx_PyInt_As_uint8_t(__pyx_v_value); if (unlikely((__pyx_t_1 == (Uint8)-1) && PyErr_Occurred())) __PYX_ERR(1, 30, __pyx_L1_error) __pyx_v_self->r = __pyx_t_1; /* function exit code */ __pyx_r = 0; goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("pygame_sdl2.color.Color.r.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = -1; __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; } /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_5color_5Color_1g_1__get__(PyObject *__pyx_v_self); /*proto*/ static PyObject *__pyx_pw_11pygame_sdl2_5color_5Color_1g_1__get__(PyObject *__pyx_v_self) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); __pyx_r = __pyx_pf_11pygame_sdl2_5color_5Color_1g___get__(((struct __pyx_obj_11pygame_sdl2_5color_Color *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_5color_5Color_1g___get__(struct __pyx_obj_11pygame_sdl2_5color_Color *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; __Pyx_RefNannySetupContext("__get__", 0); __Pyx_XDECREF(__pyx_r); __pyx_t_1 = __Pyx_PyInt_From_uint8_t(__pyx_v_self->g); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 30, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("pygame_sdl2.color.Color.g.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* Python wrapper */ static int __pyx_pw_11pygame_sdl2_5color_5Color_1g_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/ static int __pyx_pw_11pygame_sdl2_5color_5Color_1g_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) { int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__set__ (wrapper)", 0); __pyx_r = __pyx_pf_11pygame_sdl2_5color_5Color_1g_2__set__(((struct __pyx_obj_11pygame_sdl2_5color_Color *)__pyx_v_self), ((PyObject *)__pyx_v_value)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static int __pyx_pf_11pygame_sdl2_5color_5Color_1g_2__set__(struct __pyx_obj_11pygame_sdl2_5color_Color *__pyx_v_self, PyObject *__pyx_v_value) { int __pyx_r; __Pyx_RefNannyDeclarations Uint8 __pyx_t_1; __Pyx_RefNannySetupContext("__set__", 0); __pyx_t_1 = __Pyx_PyInt_As_uint8_t(__pyx_v_value); if (unlikely((__pyx_t_1 == (Uint8)-1) && PyErr_Occurred())) __PYX_ERR(1, 30, __pyx_L1_error) __pyx_v_self->g = __pyx_t_1; /* function exit code */ __pyx_r = 0; goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("pygame_sdl2.color.Color.g.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = -1; __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; } /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_5color_5Color_1b_1__get__(PyObject *__pyx_v_self); /*proto*/ static PyObject *__pyx_pw_11pygame_sdl2_5color_5Color_1b_1__get__(PyObject *__pyx_v_self) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); __pyx_r = __pyx_pf_11pygame_sdl2_5color_5Color_1b___get__(((struct __pyx_obj_11pygame_sdl2_5color_Color *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_5color_5Color_1b___get__(struct __pyx_obj_11pygame_sdl2_5color_Color *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; __Pyx_RefNannySetupContext("__get__", 0); __Pyx_XDECREF(__pyx_r); __pyx_t_1 = __Pyx_PyInt_From_uint8_t(__pyx_v_self->b); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 30, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("pygame_sdl2.color.Color.b.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* Python wrapper */ static int __pyx_pw_11pygame_sdl2_5color_5Color_1b_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/ static int __pyx_pw_11pygame_sdl2_5color_5Color_1b_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) { int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__set__ (wrapper)", 0); __pyx_r = __pyx_pf_11pygame_sdl2_5color_5Color_1b_2__set__(((struct __pyx_obj_11pygame_sdl2_5color_Color *)__pyx_v_self), ((PyObject *)__pyx_v_value)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static int __pyx_pf_11pygame_sdl2_5color_5Color_1b_2__set__(struct __pyx_obj_11pygame_sdl2_5color_Color *__pyx_v_self, PyObject *__pyx_v_value) { int __pyx_r; __Pyx_RefNannyDeclarations Uint8 __pyx_t_1; __Pyx_RefNannySetupContext("__set__", 0); __pyx_t_1 = __Pyx_PyInt_As_uint8_t(__pyx_v_value); if (unlikely((__pyx_t_1 == (Uint8)-1) && PyErr_Occurred())) __PYX_ERR(1, 30, __pyx_L1_error) __pyx_v_self->b = __pyx_t_1; /* function exit code */ __pyx_r = 0; goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("pygame_sdl2.color.Color.b.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = -1; __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; } /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_5color_5Color_1a_1__get__(PyObject *__pyx_v_self); /*proto*/ static PyObject *__pyx_pw_11pygame_sdl2_5color_5Color_1a_1__get__(PyObject *__pyx_v_self) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); __pyx_r = __pyx_pf_11pygame_sdl2_5color_5Color_1a___get__(((struct __pyx_obj_11pygame_sdl2_5color_Color *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_5color_5Color_1a___get__(struct __pyx_obj_11pygame_sdl2_5color_Color *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; __Pyx_RefNannySetupContext("__get__", 0); __Pyx_XDECREF(__pyx_r); __pyx_t_1 = __Pyx_PyInt_From_uint8_t(__pyx_v_self->a); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 30, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("pygame_sdl2.color.Color.a.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* Python wrapper */ static int __pyx_pw_11pygame_sdl2_5color_5Color_1a_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/ static int __pyx_pw_11pygame_sdl2_5color_5Color_1a_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) { int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__set__ (wrapper)", 0); __pyx_r = __pyx_pf_11pygame_sdl2_5color_5Color_1a_2__set__(((struct __pyx_obj_11pygame_sdl2_5color_Color *)__pyx_v_self), ((PyObject *)__pyx_v_value)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static int __pyx_pf_11pygame_sdl2_5color_5Color_1a_2__set__(struct __pyx_obj_11pygame_sdl2_5color_Color *__pyx_v_self, PyObject *__pyx_v_value) { int __pyx_r; __Pyx_RefNannyDeclarations Uint8 __pyx_t_1; __Pyx_RefNannySetupContext("__set__", 0); __pyx_t_1 = __Pyx_PyInt_As_uint8_t(__pyx_v_value); if (unlikely((__pyx_t_1 == (Uint8)-1) && PyErr_Occurred())) __PYX_ERR(1, 30, __pyx_L1_error) __pyx_v_self->a = __pyx_t_1; /* function exit code */ __pyx_r = 0; goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("pygame_sdl2.color.Color.a.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = -1; __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; } static struct __pyx_vtabstruct_11pygame_sdl2_5color_Color __pyx_vtable_11pygame_sdl2_5color_Color; static PyObject *__pyx_tp_new_11pygame_sdl2_5color_Color(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) { struct __pyx_obj_11pygame_sdl2_5color_Color *p; PyObject *o; if (likely((t->tp_flags & Py_TPFLAGS_IS_ABSTRACT) == 0)) { o = (*t->tp_alloc)(t, 0); } else { o = (PyObject *) PyBaseObject_Type.tp_new(t, __pyx_empty_tuple, 0); } if (unlikely(!o)) return 0; p = ((struct __pyx_obj_11pygame_sdl2_5color_Color *)o); p->__pyx_vtab = __pyx_vtabptr_11pygame_sdl2_5color_Color; if (unlikely(__pyx_pw_11pygame_sdl2_5color_5Color_3__cinit__(o, __pyx_empty_tuple, NULL) < 0)) { Py_DECREF(o); o = 0; } return o; } static void __pyx_tp_dealloc_11pygame_sdl2_5color_Color(PyObject *o) { struct __pyx_obj_11pygame_sdl2_5color_Color *p = (struct __pyx_obj_11pygame_sdl2_5color_Color *)o; #if PY_VERSION_HEX >= 0x030400a1 if (unlikely(Py_TYPE(o)->tp_finalize) && (!PyType_IS_GC(Py_TYPE(o)) || !_PyGC_FINALIZED(o))) { if (PyObject_CallFinalizerFromDealloc(o)) return; } #endif if (p->__weakref__) PyObject_ClearWeakRefs(o); (*Py_TYPE(o)->tp_free)(o); } static PyObject *__pyx_sq_item_11pygame_sdl2_5color_Color(PyObject *o, Py_ssize_t i) { PyObject *r; PyObject *x = PyInt_FromSsize_t(i); if(!x) return 0; r = Py_TYPE(o)->tp_as_mapping->mp_subscript(o, x); Py_DECREF(x); return r; } static int __pyx_mp_ass_subscript_11pygame_sdl2_5color_Color(PyObject *o, PyObject *i, PyObject *v) { if (v) { return __pyx_pw_11pygame_sdl2_5color_5Color_21__setitem__(o, i, v); } else { PyErr_Format(PyExc_NotImplementedError, "Subscript deletion not supported by %.200s", Py_TYPE(o)->tp_name); return -1; } } static PyObject *__pyx_getprop_11pygame_sdl2_5color_5Color_cmy(PyObject *o, CYTHON_UNUSED void *x) { return __pyx_pw_11pygame_sdl2_5color_5Color_3cmy_1__get__(o); } static int __pyx_setprop_11pygame_sdl2_5color_5Color_cmy(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) { if (v) { return __pyx_pw_11pygame_sdl2_5color_5Color_3cmy_3__set__(o, v); } else { PyErr_SetString(PyExc_NotImplementedError, "__del__"); return -1; } } static PyObject *__pyx_getprop_11pygame_sdl2_5color_5Color_hsva(PyObject *o, CYTHON_UNUSED void *x) { return __pyx_pw_11pygame_sdl2_5color_5Color_4hsva_1__get__(o); } static int __pyx_setprop_11pygame_sdl2_5color_5Color_hsva(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) { if (v) { return __pyx_pw_11pygame_sdl2_5color_5Color_4hsva_3__set__(o, v); } else { PyErr_SetString(PyExc_NotImplementedError, "__del__"); return -1; } } static PyObject *__pyx_getprop_11pygame_sdl2_5color_5Color_hsla(PyObject *o, CYTHON_UNUSED void *x) { return __pyx_pw_11pygame_sdl2_5color_5Color_4hsla_1__get__(o); } static int __pyx_setprop_11pygame_sdl2_5color_5Color_hsla(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) { if (v) { return __pyx_pw_11pygame_sdl2_5color_5Color_4hsla_3__set__(o, v); } else { PyErr_SetString(PyExc_NotImplementedError, "__del__"); return -1; } } static PyObject *__pyx_getprop_11pygame_sdl2_5color_5Color_i1i2i3(PyObject *o, CYTHON_UNUSED void *x) { return __pyx_pw_11pygame_sdl2_5color_5Color_6i1i2i3_1__get__(o); } static int __pyx_setprop_11pygame_sdl2_5color_5Color_i1i2i3(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) { if (v) { return __pyx_pw_11pygame_sdl2_5color_5Color_6i1i2i3_3__set__(o, v); } else { PyErr_SetString(PyExc_NotImplementedError, "__del__"); return -1; } } static PyObject *__pyx_getprop_11pygame_sdl2_5color_5Color_r(PyObject *o, CYTHON_UNUSED void *x) { return __pyx_pw_11pygame_sdl2_5color_5Color_1r_1__get__(o); } static int __pyx_setprop_11pygame_sdl2_5color_5Color_r(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) { if (v) { return __pyx_pw_11pygame_sdl2_5color_5Color_1r_3__set__(o, v); } else { PyErr_SetString(PyExc_NotImplementedError, "__del__"); return -1; } } static PyObject *__pyx_getprop_11pygame_sdl2_5color_5Color_g(PyObject *o, CYTHON_UNUSED void *x) { return __pyx_pw_11pygame_sdl2_5color_5Color_1g_1__get__(o); } static int __pyx_setprop_11pygame_sdl2_5color_5Color_g(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) { if (v) { return __pyx_pw_11pygame_sdl2_5color_5Color_1g_3__set__(o, v); } else { PyErr_SetString(PyExc_NotImplementedError, "__del__"); return -1; } } static PyObject *__pyx_getprop_11pygame_sdl2_5color_5Color_b(PyObject *o, CYTHON_UNUSED void *x) { return __pyx_pw_11pygame_sdl2_5color_5Color_1b_1__get__(o); } static int __pyx_setprop_11pygame_sdl2_5color_5Color_b(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) { if (v) { return __pyx_pw_11pygame_sdl2_5color_5Color_1b_3__set__(o, v); } else { PyErr_SetString(PyExc_NotImplementedError, "__del__"); return -1; } } static PyObject *__pyx_getprop_11pygame_sdl2_5color_5Color_a(PyObject *o, CYTHON_UNUSED void *x) { return __pyx_pw_11pygame_sdl2_5color_5Color_1a_1__get__(o); } static int __pyx_setprop_11pygame_sdl2_5color_5Color_a(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) { if (v) { return __pyx_pw_11pygame_sdl2_5color_5Color_1a_3__set__(o, v); } else { PyErr_SetString(PyExc_NotImplementedError, "__del__"); return -1; } } static PyMethodDef __pyx_methods_11pygame_sdl2_5color_Color[] = { {"__reduce__", (PyCFunction)__pyx_pw_11pygame_sdl2_5color_5Color_17__reduce__, METH_NOARGS, 0}, {"__setstate__", (PyCFunction)__pyx_pw_11pygame_sdl2_5color_5Color_19__setstate__, METH_O, 0}, {"normalize", (PyCFunction)__pyx_pw_11pygame_sdl2_5color_5Color_39normalize, METH_NOARGS, 0}, {"correct_gamma", (PyCFunction)__pyx_pw_11pygame_sdl2_5color_5Color_41correct_gamma, METH_O, 0}, {"set_length", (PyCFunction)__pyx_pw_11pygame_sdl2_5color_5Color_43set_length, METH_O, 0}, {0, 0, 0, 0} }; static struct PyGetSetDef __pyx_getsets_11pygame_sdl2_5color_Color[] = { {(char *)"cmy", __pyx_getprop_11pygame_sdl2_5color_5Color_cmy, __pyx_setprop_11pygame_sdl2_5color_5Color_cmy, (char *)0, 0}, {(char *)"hsva", __pyx_getprop_11pygame_sdl2_5color_5Color_hsva, __pyx_setprop_11pygame_sdl2_5color_5Color_hsva, (char *)0, 0}, {(char *)"hsla", __pyx_getprop_11pygame_sdl2_5color_5Color_hsla, __pyx_setprop_11pygame_sdl2_5color_5Color_hsla, (char *)0, 0}, {(char *)"i1i2i3", __pyx_getprop_11pygame_sdl2_5color_5Color_i1i2i3, __pyx_setprop_11pygame_sdl2_5color_5Color_i1i2i3, (char *)0, 0}, {(char *)"r", __pyx_getprop_11pygame_sdl2_5color_5Color_r, __pyx_setprop_11pygame_sdl2_5color_5Color_r, (char *)0, 0}, {(char *)"g", __pyx_getprop_11pygame_sdl2_5color_5Color_g, __pyx_setprop_11pygame_sdl2_5color_5Color_g, (char *)0, 0}, {(char *)"b", __pyx_getprop_11pygame_sdl2_5color_5Color_b, __pyx_setprop_11pygame_sdl2_5color_5Color_b, (char *)0, 0}, {(char *)"a", __pyx_getprop_11pygame_sdl2_5color_5Color_a, __pyx_setprop_11pygame_sdl2_5color_5Color_a, (char *)0, 0}, {0, 0, 0, 0, 0} }; static PyNumberMethods __pyx_tp_as_number_Color = { __pyx_pw_11pygame_sdl2_5color_5Color_29__add__, /*nb_add*/ __pyx_pw_11pygame_sdl2_5color_5Color_31__sub__, /*nb_subtract*/ __pyx_pw_11pygame_sdl2_5color_5Color_27__mul__, /*nb_multiply*/ #if PY_MAJOR_VERSION < 3 || CYTHON_COMPILING_IN_PYPY __pyx_pw_11pygame_sdl2_5color_5Color_35__div__, /*nb_divide*/ #endif __pyx_pw_11pygame_sdl2_5color_5Color_33__mod__, /*nb_remainder*/ 0, /*nb_divmod*/ 0, /*nb_power*/ 0, /*nb_negative*/ 0, /*nb_positive*/ 0, /*nb_absolute*/ 0, /*nb_nonzero*/ 0, /*nb_invert*/ 0, /*nb_lshift*/ 0, /*nb_rshift*/ 0, /*nb_and*/ 0, /*nb_xor*/ 0, /*nb_or*/ #if PY_MAJOR_VERSION < 3 || CYTHON_COMPILING_IN_PYPY 0, /*nb_coerce*/ #endif __pyx_pw_11pygame_sdl2_5color_5Color_9__int__, /*nb_int*/ #if PY_MAJOR_VERSION < 3 __pyx_pw_11pygame_sdl2_5color_5Color_9__int__, /*nb_long*/ #else 0, /*reserved*/ #endif __pyx_pw_11pygame_sdl2_5color_5Color_15__float__, /*nb_float*/ #if PY_MAJOR_VERSION < 3 || CYTHON_COMPILING_IN_PYPY __pyx_pw_11pygame_sdl2_5color_5Color_13__oct__, /*nb_oct*/ #endif #if PY_MAJOR_VERSION < 3 || CYTHON_COMPILING_IN_PYPY __pyx_pw_11pygame_sdl2_5color_5Color_11__hex__, /*nb_hex*/ #endif 0, /*nb_inplace_add*/ 0, /*nb_inplace_subtract*/ 0, /*nb_inplace_multiply*/ #if PY_MAJOR_VERSION < 3 || CYTHON_COMPILING_IN_PYPY 0, /*nb_inplace_divide*/ #endif 0, /*nb_inplace_remainder*/ 0, /*nb_inplace_power*/ 0, /*nb_inplace_lshift*/ 0, /*nb_inplace_rshift*/ 0, /*nb_inplace_and*/ 0, /*nb_inplace_xor*/ 0, /*nb_inplace_or*/ __pyx_pw_11pygame_sdl2_5color_5Color_37__floordiv__, /*nb_floor_divide*/ 0, /*nb_true_divide*/ 0, /*nb_inplace_floor_divide*/ 0, /*nb_inplace_true_divide*/ 0, /*nb_index*/ #if PY_VERSION_HEX >= 0x03050000 0, /*nb_matrix_multiply*/ #endif #if PY_VERSION_HEX >= 0x03050000 0, /*nb_inplace_matrix_multiply*/ #endif }; static PySequenceMethods __pyx_tp_as_sequence_Color = { __pyx_pw_11pygame_sdl2_5color_5Color_25__len__, /*sq_length*/ 0, /*sq_concat*/ 0, /*sq_repeat*/ __pyx_sq_item_11pygame_sdl2_5color_Color, /*sq_item*/ 0, /*sq_slice*/ 0, /*sq_ass_item*/ 0, /*sq_ass_slice*/ 0, /*sq_contains*/ 0, /*sq_inplace_concat*/ 0, /*sq_inplace_repeat*/ }; static PyMappingMethods __pyx_tp_as_mapping_Color = { __pyx_pw_11pygame_sdl2_5color_5Color_25__len__, /*mp_length*/ __pyx_pw_11pygame_sdl2_5color_5Color_23__getitem__, /*mp_subscript*/ __pyx_mp_ass_subscript_11pygame_sdl2_5color_Color, /*mp_ass_subscript*/ }; static PyTypeObject __pyx_type_11pygame_sdl2_5color_Color = { PyVarObject_HEAD_INIT(0, 0) "pygame_sdl2.color.Color", /*tp_name*/ sizeof(struct __pyx_obj_11pygame_sdl2_5color_Color), /*tp_basicsize*/ 0, /*tp_itemsize*/ __pyx_tp_dealloc_11pygame_sdl2_5color_Color, /*tp_dealloc*/ 0, /*tp_print*/ 0, /*tp_getattr*/ 0, /*tp_setattr*/ #if PY_MAJOR_VERSION < 3 0, /*tp_compare*/ #endif #if PY_MAJOR_VERSION >= 3 0, /*tp_as_async*/ #endif __pyx_pw_11pygame_sdl2_5color_5Color_7__repr__, /*tp_repr*/ &__pyx_tp_as_number_Color, /*tp_as_number*/ &__pyx_tp_as_sequence_Color, /*tp_as_sequence*/ &__pyx_tp_as_mapping_Color, /*tp_as_mapping*/ 0, /*tp_hash*/ 0, /*tp_call*/ 0, /*tp_str*/ 0, /*tp_getattro*/ 0, /*tp_setattro*/ 0, /*tp_as_buffer*/ Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE, /*tp_flags*/ 0, /*tp_doc*/ 0, /*tp_traverse*/ 0, /*tp_clear*/ __pyx_pw_11pygame_sdl2_5color_5Color_1__richcmp__, /*tp_richcompare*/ 0, /*tp_weaklistoffset*/ 0, /*tp_iter*/ 0, /*tp_iternext*/ __pyx_methods_11pygame_sdl2_5color_Color, /*tp_methods*/ 0, /*tp_members*/ __pyx_getsets_11pygame_sdl2_5color_Color, /*tp_getset*/ 0, /*tp_base*/ 0, /*tp_dict*/ 0, /*tp_descr_get*/ 0, /*tp_descr_set*/ 0, /*tp_dictoffset*/ __pyx_pw_11pygame_sdl2_5color_5Color_5__init__, /*tp_init*/ 0, /*tp_alloc*/ __pyx_tp_new_11pygame_sdl2_5color_Color, /*tp_new*/ 0, /*tp_free*/ 0, /*tp_is_gc*/ 0, /*tp_bases*/ 0, /*tp_mro*/ 0, /*tp_cache*/ 0, /*tp_subclasses*/ 0, /*tp_weaklist*/ 0, /*tp_del*/ 0, /*tp_version_tag*/ #if PY_VERSION_HEX >= 0x030400a1 0, /*tp_finalize*/ #endif }; static struct __pyx_obj_11pygame_sdl2_5color___pyx_scope_struct__correct_gamma *__pyx_freelist_11pygame_sdl2_5color___pyx_scope_struct__correct_gamma[8]; static int __pyx_freecount_11pygame_sdl2_5color___pyx_scope_struct__correct_gamma = 0; static PyObject *__pyx_tp_new_11pygame_sdl2_5color___pyx_scope_struct__correct_gamma(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) { PyObject *o; if (CYTHON_COMPILING_IN_CPYTHON && likely((__pyx_freecount_11pygame_sdl2_5color___pyx_scope_struct__correct_gamma > 0) & (t->tp_basicsize == sizeof(struct __pyx_obj_11pygame_sdl2_5color___pyx_scope_struct__correct_gamma)))) { o = (PyObject*)__pyx_freelist_11pygame_sdl2_5color___pyx_scope_struct__correct_gamma[--__pyx_freecount_11pygame_sdl2_5color___pyx_scope_struct__correct_gamma]; memset(o, 0, sizeof(struct __pyx_obj_11pygame_sdl2_5color___pyx_scope_struct__correct_gamma)); (void) PyObject_INIT(o, t); PyObject_GC_Track(o); } else { o = (*t->tp_alloc)(t, 0); if (unlikely(!o)) return 0; } return o; } static void __pyx_tp_dealloc_11pygame_sdl2_5color___pyx_scope_struct__correct_gamma(PyObject *o) { struct __pyx_obj_11pygame_sdl2_5color___pyx_scope_struct__correct_gamma *p = (struct __pyx_obj_11pygame_sdl2_5color___pyx_scope_struct__correct_gamma *)o; PyObject_GC_UnTrack(o); Py_CLEAR(p->__pyx_v_gamma); if (CYTHON_COMPILING_IN_CPYTHON && ((__pyx_freecount_11pygame_sdl2_5color___pyx_scope_struct__correct_gamma < 8) & (Py_TYPE(o)->tp_basicsize == sizeof(struct __pyx_obj_11pygame_sdl2_5color___pyx_scope_struct__correct_gamma)))) { __pyx_freelist_11pygame_sdl2_5color___pyx_scope_struct__correct_gamma[__pyx_freecount_11pygame_sdl2_5color___pyx_scope_struct__correct_gamma++] = ((struct __pyx_obj_11pygame_sdl2_5color___pyx_scope_struct__correct_gamma *)o); } else { (*Py_TYPE(o)->tp_free)(o); } } static int __pyx_tp_traverse_11pygame_sdl2_5color___pyx_scope_struct__correct_gamma(PyObject *o, visitproc v, void *a) { int e; struct __pyx_obj_11pygame_sdl2_5color___pyx_scope_struct__correct_gamma *p = (struct __pyx_obj_11pygame_sdl2_5color___pyx_scope_struct__correct_gamma *)o; if (p->__pyx_v_gamma) { e = (*v)(p->__pyx_v_gamma, a); if (e) return e; } return 0; } static int __pyx_tp_clear_11pygame_sdl2_5color___pyx_scope_struct__correct_gamma(PyObject *o) { PyObject* tmp; struct __pyx_obj_11pygame_sdl2_5color___pyx_scope_struct__correct_gamma *p = (struct __pyx_obj_11pygame_sdl2_5color___pyx_scope_struct__correct_gamma *)o; tmp = ((PyObject*)p->__pyx_v_gamma); p->__pyx_v_gamma = Py_None; Py_INCREF(Py_None); Py_XDECREF(tmp); return 0; } static PyTypeObject __pyx_type_11pygame_sdl2_5color___pyx_scope_struct__correct_gamma = { PyVarObject_HEAD_INIT(0, 0) "pygame_sdl2.color.__pyx_scope_struct__correct_gamma", /*tp_name*/ sizeof(struct __pyx_obj_11pygame_sdl2_5color___pyx_scope_struct__correct_gamma), /*tp_basicsize*/ 0, /*tp_itemsize*/ __pyx_tp_dealloc_11pygame_sdl2_5color___pyx_scope_struct__correct_gamma, /*tp_dealloc*/ 0, /*tp_print*/ 0, /*tp_getattr*/ 0, /*tp_setattr*/ #if PY_MAJOR_VERSION < 3 0, /*tp_compare*/ #endif #if PY_MAJOR_VERSION >= 3 0, /*tp_as_async*/ #endif 0, /*tp_repr*/ 0, /*tp_as_number*/ 0, /*tp_as_sequence*/ 0, /*tp_as_mapping*/ 0, /*tp_hash*/ 0, /*tp_call*/ 0, /*tp_str*/ 0, /*tp_getattro*/ 0, /*tp_setattro*/ 0, /*tp_as_buffer*/ Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC, /*tp_flags*/ 0, /*tp_doc*/ __pyx_tp_traverse_11pygame_sdl2_5color___pyx_scope_struct__correct_gamma, /*tp_traverse*/ __pyx_tp_clear_11pygame_sdl2_5color___pyx_scope_struct__correct_gamma, /*tp_clear*/ 0, /*tp_richcompare*/ 0, /*tp_weaklistoffset*/ 0, /*tp_iter*/ 0, /*tp_iternext*/ 0, /*tp_methods*/ 0, /*tp_members*/ 0, /*tp_getset*/ 0, /*tp_base*/ 0, /*tp_dict*/ 0, /*tp_descr_get*/ 0, /*tp_descr_set*/ 0, /*tp_dictoffset*/ 0, /*tp_init*/ 0, /*tp_alloc*/ __pyx_tp_new_11pygame_sdl2_5color___pyx_scope_struct__correct_gamma, /*tp_new*/ 0, /*tp_free*/ 0, /*tp_is_gc*/ 0, /*tp_bases*/ 0, /*tp_mro*/ 0, /*tp_cache*/ 0, /*tp_subclasses*/ 0, /*tp_weaklist*/ 0, /*tp_del*/ 0, /*tp_version_tag*/ #if PY_VERSION_HEX >= 0x030400a1 0, /*tp_finalize*/ #endif }; static PyMethodDef __pyx_methods[] = { {0, 0, 0, 0} }; #if PY_MAJOR_VERSION >= 3 static struct PyModuleDef __pyx_moduledef = { #if PY_VERSION_HEX < 0x03020000 { PyObject_HEAD_INIT(NULL) NULL, 0, NULL }, #else PyModuleDef_HEAD_INIT, #endif "color", 0, /* m_doc */ -1, /* m_size */ __pyx_methods /* m_methods */, NULL, /* m_reload */ NULL, /* m_traverse */ NULL, /* m_clear */ NULL /* m_free */ }; #endif static __Pyx_StringTabEntry __pyx_string_tab[] = { {&__pyx_kp_u_08x, __pyx_k_08x, sizeof(__pyx_k_08x), 0, 1, 0, 0}, {&__pyx_kp_u_0x, __pyx_k_0x, sizeof(__pyx_k_0x), 0, 1, 0, 0}, {&__pyx_n_u_BBB, __pyx_k_BBB, sizeof(__pyx_k_BBB), 0, 1, 0, 1}, {&__pyx_n_u_BBBB, __pyx_k_BBBB, sizeof(__pyx_k_BBBB), 0, 1, 0, 1}, {&__pyx_n_s_Color_from_hex_locals_lambda, __pyx_k_Color_from_hex_locals_lambda, sizeof(__pyx_k_Color_from_hex_locals_lambda), 0, 0, 1, 1}, {&__pyx_kp_u_Expected_a_color, __pyx_k_Expected_a_color, sizeof(__pyx_k_Expected_a_color), 0, 1, 0, 0}, {&__pyx_n_s_IndexError, __pyx_k_IndexError, sizeof(__pyx_k_IndexError), 0, 0, 1, 1}, {&__pyx_n_s_KeyError, __pyx_k_KeyError, sizeof(__pyx_k_KeyError), 0, 0, 1, 1}, {&__pyx_kp_u_L, __pyx_k_L, sizeof(__pyx_k_L), 0, 1, 0, 0}, {&__pyx_n_s_TypeError, __pyx_k_TypeError, sizeof(__pyx_k_TypeError), 0, 0, 1, 1}, {&__pyx_n_s_ValueError, __pyx_k_ValueError, sizeof(__pyx_k_ValueError), 0, 0, 1, 1}, {&__pyx_kp_u__2, __pyx_k__2, sizeof(__pyx_k__2), 0, 1, 0, 0}, {&__pyx_kp_u__3, __pyx_k__3, sizeof(__pyx_k__3), 0, 1, 0, 0}, {&__pyx_n_s_a, __pyx_k_a, sizeof(__pyx_k_a), 0, 0, 1, 1}, {&__pyx_n_u_aliceblue, __pyx_k_aliceblue, sizeof(__pyx_k_aliceblue), 0, 1, 0, 1}, {&__pyx_n_u_antiquewhite, __pyx_k_antiquewhite, sizeof(__pyx_k_antiquewhite), 0, 1, 0, 1}, {&__pyx_n_u_antiquewhite1, __pyx_k_antiquewhite1, sizeof(__pyx_k_antiquewhite1), 0, 1, 0, 1}, {&__pyx_n_u_antiquewhite2, __pyx_k_antiquewhite2, sizeof(__pyx_k_antiquewhite2), 0, 1, 0, 1}, {&__pyx_n_u_antiquewhite3, __pyx_k_antiquewhite3, sizeof(__pyx_k_antiquewhite3), 0, 1, 0, 1}, {&__pyx_n_u_antiquewhite4, __pyx_k_antiquewhite4, sizeof(__pyx_k_antiquewhite4), 0, 1, 0, 1}, {&__pyx_n_u_aqua, __pyx_k_aqua, sizeof(__pyx_k_aqua), 0, 1, 0, 1}, {&__pyx_n_u_aquamarine, __pyx_k_aquamarine, sizeof(__pyx_k_aquamarine), 0, 1, 0, 1}, {&__pyx_n_u_aquamarine1, __pyx_k_aquamarine1, sizeof(__pyx_k_aquamarine1), 0, 1, 0, 1}, {&__pyx_n_u_aquamarine2, __pyx_k_aquamarine2, sizeof(__pyx_k_aquamarine2), 0, 1, 0, 1}, {&__pyx_n_u_aquamarine3, __pyx_k_aquamarine3, sizeof(__pyx_k_aquamarine3), 0, 1, 0, 1}, {&__pyx_n_u_aquamarine4, __pyx_k_aquamarine4, sizeof(__pyx_k_aquamarine4), 0, 1, 0, 1}, {&__pyx_n_u_azure, __pyx_k_azure, sizeof(__pyx_k_azure), 0, 1, 0, 1}, {&__pyx_n_u_azure1, __pyx_k_azure1, sizeof(__pyx_k_azure1), 0, 1, 0, 1}, {&__pyx_n_u_azure2, __pyx_k_azure2, sizeof(__pyx_k_azure2), 0, 1, 0, 1}, {&__pyx_n_u_azure3, __pyx_k_azure3, sizeof(__pyx_k_azure3), 0, 1, 0, 1}, {&__pyx_n_u_azure4, __pyx_k_azure4, sizeof(__pyx_k_azure4), 0, 1, 0, 1}, {&__pyx_n_s_b, __pyx_k_b, sizeof(__pyx_k_b), 0, 0, 1, 1}, {&__pyx_n_u_beige, __pyx_k_beige, sizeof(__pyx_k_beige), 0, 1, 0, 1}, {&__pyx_n_s_binascii, __pyx_k_binascii, sizeof(__pyx_k_binascii), 0, 0, 1, 1}, {&__pyx_n_u_bisque, __pyx_k_bisque, sizeof(__pyx_k_bisque), 0, 1, 0, 1}, {&__pyx_n_u_bisque1, __pyx_k_bisque1, sizeof(__pyx_k_bisque1), 0, 1, 0, 1}, {&__pyx_n_u_bisque2, __pyx_k_bisque2, sizeof(__pyx_k_bisque2), 0, 1, 0, 1}, {&__pyx_n_u_bisque3, __pyx_k_bisque3, sizeof(__pyx_k_bisque3), 0, 1, 0, 1}, {&__pyx_n_u_bisque4, __pyx_k_bisque4, sizeof(__pyx_k_bisque4), 0, 1, 0, 1}, {&__pyx_n_u_black, __pyx_k_black, sizeof(__pyx_k_black), 0, 1, 0, 1}, {&__pyx_n_u_blanchedalmond, __pyx_k_blanchedalmond, sizeof(__pyx_k_blanchedalmond), 0, 1, 0, 1}, {&__pyx_n_u_blue, __pyx_k_blue, sizeof(__pyx_k_blue), 0, 1, 0, 1}, {&__pyx_n_u_blue1, __pyx_k_blue1, sizeof(__pyx_k_blue1), 0, 1, 0, 1}, {&__pyx_n_u_blue2, __pyx_k_blue2, sizeof(__pyx_k_blue2), 0, 1, 0, 1}, {&__pyx_n_u_blue3, __pyx_k_blue3, sizeof(__pyx_k_blue3), 0, 1, 0, 1}, {&__pyx_n_u_blue4, __pyx_k_blue4, sizeof(__pyx_k_blue4), 0, 1, 0, 1}, {&__pyx_n_u_blueviolet, __pyx_k_blueviolet, sizeof(__pyx_k_blueviolet), 0, 1, 0, 1}, {&__pyx_n_u_brown, __pyx_k_brown, sizeof(__pyx_k_brown), 0, 1, 0, 1}, {&__pyx_n_u_brown1, __pyx_k_brown1, sizeof(__pyx_k_brown1), 0, 1, 0, 1}, {&__pyx_n_u_brown2, __pyx_k_brown2, sizeof(__pyx_k_brown2), 0, 1, 0, 1}, {&__pyx_n_u_brown3, __pyx_k_brown3, sizeof(__pyx_k_brown3), 0, 1, 0, 1}, {&__pyx_n_u_brown4, __pyx_k_brown4, sizeof(__pyx_k_brown4), 0, 1, 0, 1}, {&__pyx_n_u_burlywood, __pyx_k_burlywood, sizeof(__pyx_k_burlywood), 0, 1, 0, 1}, {&__pyx_n_u_burlywood1, __pyx_k_burlywood1, sizeof(__pyx_k_burlywood1), 0, 1, 0, 1}, {&__pyx_n_u_burlywood2, __pyx_k_burlywood2, sizeof(__pyx_k_burlywood2), 0, 1, 0, 1}, {&__pyx_n_u_burlywood3, __pyx_k_burlywood3, sizeof(__pyx_k_burlywood3), 0, 1, 0, 1}, {&__pyx_n_u_burlywood4, __pyx_k_burlywood4, sizeof(__pyx_k_burlywood4), 0, 1, 0, 1}, {&__pyx_n_u_cadetblue, __pyx_k_cadetblue, sizeof(__pyx_k_cadetblue), 0, 1, 0, 1}, {&__pyx_n_u_cadetblue1, __pyx_k_cadetblue1, sizeof(__pyx_k_cadetblue1), 0, 1, 0, 1}, {&__pyx_n_u_cadetblue2, __pyx_k_cadetblue2, sizeof(__pyx_k_cadetblue2), 0, 1, 0, 1}, {&__pyx_n_u_cadetblue3, __pyx_k_cadetblue3, sizeof(__pyx_k_cadetblue3), 0, 1, 0, 1}, {&__pyx_n_u_cadetblue4, __pyx_k_cadetblue4, sizeof(__pyx_k_cadetblue4), 0, 1, 0, 1}, {&__pyx_n_u_chartreuse, __pyx_k_chartreuse, sizeof(__pyx_k_chartreuse), 0, 1, 0, 1}, {&__pyx_n_u_chartreuse1, __pyx_k_chartreuse1, sizeof(__pyx_k_chartreuse1), 0, 1, 0, 1}, {&__pyx_n_u_chartreuse2, __pyx_k_chartreuse2, sizeof(__pyx_k_chartreuse2), 0, 1, 0, 1}, {&__pyx_n_u_chartreuse3, __pyx_k_chartreuse3, sizeof(__pyx_k_chartreuse3), 0, 1, 0, 1}, {&__pyx_n_u_chartreuse4, __pyx_k_chartreuse4, sizeof(__pyx_k_chartreuse4), 0, 1, 0, 1}, {&__pyx_n_u_chocolate, __pyx_k_chocolate, sizeof(__pyx_k_chocolate), 0, 1, 0, 1}, {&__pyx_n_u_chocolate1, __pyx_k_chocolate1, sizeof(__pyx_k_chocolate1), 0, 1, 0, 1}, {&__pyx_n_u_chocolate2, __pyx_k_chocolate2, sizeof(__pyx_k_chocolate2), 0, 1, 0, 1}, {&__pyx_n_u_chocolate3, __pyx_k_chocolate3, sizeof(__pyx_k_chocolate3), 0, 1, 0, 1}, {&__pyx_n_u_chocolate4, __pyx_k_chocolate4, sizeof(__pyx_k_chocolate4), 0, 1, 0, 1}, {&__pyx_n_u_coral, __pyx_k_coral, sizeof(__pyx_k_coral), 0, 1, 0, 1}, {&__pyx_n_u_coral1, __pyx_k_coral1, sizeof(__pyx_k_coral1), 0, 1, 0, 1}, {&__pyx_n_u_coral2, __pyx_k_coral2, sizeof(__pyx_k_coral2), 0, 1, 0, 1}, {&__pyx_n_u_coral3, __pyx_k_coral3, sizeof(__pyx_k_coral3), 0, 1, 0, 1}, {&__pyx_n_u_coral4, __pyx_k_coral4, sizeof(__pyx_k_coral4), 0, 1, 0, 1}, {&__pyx_n_u_cornflowerblue, __pyx_k_cornflowerblue, sizeof(__pyx_k_cornflowerblue), 0, 1, 0, 1}, {&__pyx_n_u_cornsilk, __pyx_k_cornsilk, sizeof(__pyx_k_cornsilk), 0, 1, 0, 1}, {&__pyx_n_u_cornsilk1, __pyx_k_cornsilk1, sizeof(__pyx_k_cornsilk1), 0, 1, 0, 1}, {&__pyx_n_u_cornsilk2, __pyx_k_cornsilk2, sizeof(__pyx_k_cornsilk2), 0, 1, 0, 1}, {&__pyx_n_u_cornsilk3, __pyx_k_cornsilk3, sizeof(__pyx_k_cornsilk3), 0, 1, 0, 1}, {&__pyx_n_u_cornsilk4, __pyx_k_cornsilk4, sizeof(__pyx_k_cornsilk4), 0, 1, 0, 1}, {&__pyx_n_s_correct_gamma_locals_lambda, __pyx_k_correct_gamma_locals_lambda, sizeof(__pyx_k_correct_gamma_locals_lambda), 0, 0, 1, 1}, {&__pyx_n_u_crimson, __pyx_k_crimson, sizeof(__pyx_k_crimson), 0, 1, 0, 1}, {&__pyx_n_u_cyan, __pyx_k_cyan, sizeof(__pyx_k_cyan), 0, 1, 0, 1}, {&__pyx_n_u_cyan1, __pyx_k_cyan1, sizeof(__pyx_k_cyan1), 0, 1, 0, 1}, {&__pyx_n_u_cyan2, __pyx_k_cyan2, sizeof(__pyx_k_cyan2), 0, 1, 0, 1}, {&__pyx_n_u_cyan3, __pyx_k_cyan3, sizeof(__pyx_k_cyan3), 0, 1, 0, 1}, {&__pyx_n_u_cyan4, __pyx_k_cyan4, sizeof(__pyx_k_cyan4), 0, 1, 0, 1}, {&__pyx_n_u_darkblue, __pyx_k_darkblue, sizeof(__pyx_k_darkblue), 0, 1, 0, 1}, {&__pyx_n_u_darkcyan, __pyx_k_darkcyan, sizeof(__pyx_k_darkcyan), 0, 1, 0, 1}, {&__pyx_n_u_darkgoldenrod, __pyx_k_darkgoldenrod, sizeof(__pyx_k_darkgoldenrod), 0, 1, 0, 1}, {&__pyx_n_u_darkgoldenrod1, __pyx_k_darkgoldenrod1, sizeof(__pyx_k_darkgoldenrod1), 0, 1, 0, 1}, {&__pyx_n_u_darkgoldenrod2, __pyx_k_darkgoldenrod2, sizeof(__pyx_k_darkgoldenrod2), 0, 1, 0, 1}, {&__pyx_n_u_darkgoldenrod3, __pyx_k_darkgoldenrod3, sizeof(__pyx_k_darkgoldenrod3), 0, 1, 0, 1}, {&__pyx_n_u_darkgoldenrod4, __pyx_k_darkgoldenrod4, sizeof(__pyx_k_darkgoldenrod4), 0, 1, 0, 1}, {&__pyx_n_u_darkgray, __pyx_k_darkgray, sizeof(__pyx_k_darkgray), 0, 1, 0, 1}, {&__pyx_n_u_darkgreen, __pyx_k_darkgreen, sizeof(__pyx_k_darkgreen), 0, 1, 0, 1}, {&__pyx_n_u_darkgrey, __pyx_k_darkgrey, sizeof(__pyx_k_darkgrey), 0, 1, 0, 1}, {&__pyx_n_u_darkkhaki, __pyx_k_darkkhaki, sizeof(__pyx_k_darkkhaki), 0, 1, 0, 1}, {&__pyx_n_u_darkmagenta, __pyx_k_darkmagenta, sizeof(__pyx_k_darkmagenta), 0, 1, 0, 1}, {&__pyx_n_u_darkolivegreen, __pyx_k_darkolivegreen, sizeof(__pyx_k_darkolivegreen), 0, 1, 0, 1}, {&__pyx_n_u_darkolivegreen1, __pyx_k_darkolivegreen1, sizeof(__pyx_k_darkolivegreen1), 0, 1, 0, 1}, {&__pyx_n_u_darkolivegreen2, __pyx_k_darkolivegreen2, sizeof(__pyx_k_darkolivegreen2), 0, 1, 0, 1}, {&__pyx_n_u_darkolivegreen3, __pyx_k_darkolivegreen3, sizeof(__pyx_k_darkolivegreen3), 0, 1, 0, 1}, {&__pyx_n_u_darkolivegreen4, __pyx_k_darkolivegreen4, sizeof(__pyx_k_darkolivegreen4), 0, 1, 0, 1}, {&__pyx_n_u_darkorange, __pyx_k_darkorange, sizeof(__pyx_k_darkorange), 0, 1, 0, 1}, {&__pyx_n_u_darkorange1, __pyx_k_darkorange1, sizeof(__pyx_k_darkorange1), 0, 1, 0, 1}, {&__pyx_n_u_darkorange2, __pyx_k_darkorange2, sizeof(__pyx_k_darkorange2), 0, 1, 0, 1}, {&__pyx_n_u_darkorange3, __pyx_k_darkorange3, sizeof(__pyx_k_darkorange3), 0, 1, 0, 1}, {&__pyx_n_u_darkorange4, __pyx_k_darkorange4, sizeof(__pyx_k_darkorange4), 0, 1, 0, 1}, {&__pyx_n_u_darkorchid, __pyx_k_darkorchid, sizeof(__pyx_k_darkorchid), 0, 1, 0, 1}, {&__pyx_n_u_darkorchid1, __pyx_k_darkorchid1, sizeof(__pyx_k_darkorchid1), 0, 1, 0, 1}, {&__pyx_n_u_darkorchid2, __pyx_k_darkorchid2, sizeof(__pyx_k_darkorchid2), 0, 1, 0, 1}, {&__pyx_n_u_darkorchid3, __pyx_k_darkorchid3, sizeof(__pyx_k_darkorchid3), 0, 1, 0, 1}, {&__pyx_n_u_darkorchid4, __pyx_k_darkorchid4, sizeof(__pyx_k_darkorchid4), 0, 1, 0, 1}, {&__pyx_n_u_darkred, __pyx_k_darkred, sizeof(__pyx_k_darkred), 0, 1, 0, 1}, {&__pyx_n_u_darksalmon, __pyx_k_darksalmon, sizeof(__pyx_k_darksalmon), 0, 1, 0, 1}, {&__pyx_n_u_darkseagreen, __pyx_k_darkseagreen, sizeof(__pyx_k_darkseagreen), 0, 1, 0, 1}, {&__pyx_n_u_darkseagreen1, __pyx_k_darkseagreen1, sizeof(__pyx_k_darkseagreen1), 0, 1, 0, 1}, {&__pyx_n_u_darkseagreen2, __pyx_k_darkseagreen2, sizeof(__pyx_k_darkseagreen2), 0, 1, 0, 1}, {&__pyx_n_u_darkseagreen3, __pyx_k_darkseagreen3, sizeof(__pyx_k_darkseagreen3), 0, 1, 0, 1}, {&__pyx_n_u_darkseagreen4, __pyx_k_darkseagreen4, sizeof(__pyx_k_darkseagreen4), 0, 1, 0, 1}, {&__pyx_n_u_darkslateblue, __pyx_k_darkslateblue, sizeof(__pyx_k_darkslateblue), 0, 1, 0, 1}, {&__pyx_n_u_darkslategray, __pyx_k_darkslategray, sizeof(__pyx_k_darkslategray), 0, 1, 0, 1}, {&__pyx_n_u_darkslategray1, __pyx_k_darkslategray1, sizeof(__pyx_k_darkslategray1), 0, 1, 0, 1}, {&__pyx_n_u_darkslategray2, __pyx_k_darkslategray2, sizeof(__pyx_k_darkslategray2), 0, 1, 0, 1}, {&__pyx_n_u_darkslategray3, __pyx_k_darkslategray3, sizeof(__pyx_k_darkslategray3), 0, 1, 0, 1}, {&__pyx_n_u_darkslategray4, __pyx_k_darkslategray4, sizeof(__pyx_k_darkslategray4), 0, 1, 0, 1}, {&__pyx_n_u_darkslategrey, __pyx_k_darkslategrey, sizeof(__pyx_k_darkslategrey), 0, 1, 0, 1}, {&__pyx_n_u_darkturquoise, __pyx_k_darkturquoise, sizeof(__pyx_k_darkturquoise), 0, 1, 0, 1}, {&__pyx_n_u_darkviolet, __pyx_k_darkviolet, sizeof(__pyx_k_darkviolet), 0, 1, 0, 1}, {&__pyx_n_u_deeppink, __pyx_k_deeppink, sizeof(__pyx_k_deeppink), 0, 1, 0, 1}, {&__pyx_n_u_deeppink1, __pyx_k_deeppink1, sizeof(__pyx_k_deeppink1), 0, 1, 0, 1}, {&__pyx_n_u_deeppink2, __pyx_k_deeppink2, sizeof(__pyx_k_deeppink2), 0, 1, 0, 1}, {&__pyx_n_u_deeppink3, __pyx_k_deeppink3, sizeof(__pyx_k_deeppink3), 0, 1, 0, 1}, {&__pyx_n_u_deeppink4, __pyx_k_deeppink4, sizeof(__pyx_k_deeppink4), 0, 1, 0, 1}, {&__pyx_n_u_deepskyblue, __pyx_k_deepskyblue, sizeof(__pyx_k_deepskyblue), 0, 1, 0, 1}, {&__pyx_n_u_deepskyblue1, __pyx_k_deepskyblue1, sizeof(__pyx_k_deepskyblue1), 0, 1, 0, 1}, {&__pyx_n_u_deepskyblue2, __pyx_k_deepskyblue2, sizeof(__pyx_k_deepskyblue2), 0, 1, 0, 1}, {&__pyx_n_u_deepskyblue3, __pyx_k_deepskyblue3, sizeof(__pyx_k_deepskyblue3), 0, 1, 0, 1}, {&__pyx_n_u_deepskyblue4, __pyx_k_deepskyblue4, sizeof(__pyx_k_deepskyblue4), 0, 1, 0, 1}, {&__pyx_n_u_dimgray, __pyx_k_dimgray, sizeof(__pyx_k_dimgray), 0, 1, 0, 1}, {&__pyx_n_u_dimgrey, __pyx_k_dimgrey, sizeof(__pyx_k_dimgrey), 0, 1, 0, 1}, {&__pyx_n_s_div, __pyx_k_div, sizeof(__pyx_k_div), 0, 0, 1, 1}, {&__pyx_n_u_dodgerblue, __pyx_k_dodgerblue, sizeof(__pyx_k_dodgerblue), 0, 1, 0, 1}, {&__pyx_n_u_dodgerblue1, __pyx_k_dodgerblue1, sizeof(__pyx_k_dodgerblue1), 0, 1, 0, 1}, {&__pyx_n_u_dodgerblue2, __pyx_k_dodgerblue2, sizeof(__pyx_k_dodgerblue2), 0, 1, 0, 1}, {&__pyx_n_u_dodgerblue3, __pyx_k_dodgerblue3, sizeof(__pyx_k_dodgerblue3), 0, 1, 0, 1}, {&__pyx_n_u_dodgerblue4, __pyx_k_dodgerblue4, sizeof(__pyx_k_dodgerblue4), 0, 1, 0, 1}, {&__pyx_n_u_firebrick, __pyx_k_firebrick, sizeof(__pyx_k_firebrick), 0, 1, 0, 1}, {&__pyx_n_u_firebrick1, __pyx_k_firebrick1, sizeof(__pyx_k_firebrick1), 0, 1, 0, 1}, {&__pyx_n_u_firebrick2, __pyx_k_firebrick2, sizeof(__pyx_k_firebrick2), 0, 1, 0, 1}, {&__pyx_n_u_firebrick3, __pyx_k_firebrick3, sizeof(__pyx_k_firebrick3), 0, 1, 0, 1}, {&__pyx_n_u_firebrick4, __pyx_k_firebrick4, sizeof(__pyx_k_firebrick4), 0, 1, 0, 1}, {&__pyx_n_s_floordiv___locals_div, __pyx_k_floordiv___locals_div, sizeof(__pyx_k_floordiv___locals_div), 0, 0, 1, 1}, {&__pyx_n_u_floralwhite, __pyx_k_floralwhite, sizeof(__pyx_k_floralwhite), 0, 1, 0, 1}, {&__pyx_n_u_forestgreen, __pyx_k_forestgreen, sizeof(__pyx_k_forestgreen), 0, 1, 0, 1}, {&__pyx_n_u_fuchsia, __pyx_k_fuchsia, sizeof(__pyx_k_fuchsia), 0, 1, 0, 1}, {&__pyx_n_s_g, __pyx_k_g, sizeof(__pyx_k_g), 0, 0, 1, 1}, {&__pyx_n_u_gainsboro, __pyx_k_gainsboro, sizeof(__pyx_k_gainsboro), 0, 1, 0, 1}, {&__pyx_n_u_ghostwhite, __pyx_k_ghostwhite, sizeof(__pyx_k_ghostwhite), 0, 1, 0, 1}, {&__pyx_n_u_gold, __pyx_k_gold, sizeof(__pyx_k_gold), 0, 1, 0, 1}, {&__pyx_n_u_gold1, __pyx_k_gold1, sizeof(__pyx_k_gold1), 0, 1, 0, 1}, {&__pyx_n_u_gold2, __pyx_k_gold2, sizeof(__pyx_k_gold2), 0, 1, 0, 1}, {&__pyx_n_u_gold3, __pyx_k_gold3, sizeof(__pyx_k_gold3), 0, 1, 0, 1}, {&__pyx_n_u_gold4, __pyx_k_gold4, sizeof(__pyx_k_gold4), 0, 1, 0, 1}, {&__pyx_n_u_goldenrod, __pyx_k_goldenrod, sizeof(__pyx_k_goldenrod), 0, 1, 0, 1}, {&__pyx_n_u_goldenrod1, __pyx_k_goldenrod1, sizeof(__pyx_k_goldenrod1), 0, 1, 0, 1}, {&__pyx_n_u_goldenrod2, __pyx_k_goldenrod2, sizeof(__pyx_k_goldenrod2), 0, 1, 0, 1}, {&__pyx_n_u_goldenrod3, __pyx_k_goldenrod3, sizeof(__pyx_k_goldenrod3), 0, 1, 0, 1}, {&__pyx_n_u_goldenrod4, __pyx_k_goldenrod4, sizeof(__pyx_k_goldenrod4), 0, 1, 0, 1}, {&__pyx_n_u_gray, __pyx_k_gray, sizeof(__pyx_k_gray), 0, 1, 0, 1}, {&__pyx_n_u_gray0, __pyx_k_gray0, sizeof(__pyx_k_gray0), 0, 1, 0, 1}, {&__pyx_n_u_gray1, __pyx_k_gray1, sizeof(__pyx_k_gray1), 0, 1, 0, 1}, {&__pyx_n_u_gray10, __pyx_k_gray10, sizeof(__pyx_k_gray10), 0, 1, 0, 1}, {&__pyx_n_u_gray100, __pyx_k_gray100, sizeof(__pyx_k_gray100), 0, 1, 0, 1}, {&__pyx_n_u_gray11, __pyx_k_gray11, sizeof(__pyx_k_gray11), 0, 1, 0, 1}, {&__pyx_n_u_gray12, __pyx_k_gray12, sizeof(__pyx_k_gray12), 0, 1, 0, 1}, {&__pyx_n_u_gray13, __pyx_k_gray13, sizeof(__pyx_k_gray13), 0, 1, 0, 1}, {&__pyx_n_u_gray14, __pyx_k_gray14, sizeof(__pyx_k_gray14), 0, 1, 0, 1}, {&__pyx_n_u_gray15, __pyx_k_gray15, sizeof(__pyx_k_gray15), 0, 1, 0, 1}, {&__pyx_n_u_gray16, __pyx_k_gray16, sizeof(__pyx_k_gray16), 0, 1, 0, 1}, {&__pyx_n_u_gray17, __pyx_k_gray17, sizeof(__pyx_k_gray17), 0, 1, 0, 1}, {&__pyx_n_u_gray18, __pyx_k_gray18, sizeof(__pyx_k_gray18), 0, 1, 0, 1}, {&__pyx_n_u_gray19, __pyx_k_gray19, sizeof(__pyx_k_gray19), 0, 1, 0, 1}, {&__pyx_n_u_gray2, __pyx_k_gray2, sizeof(__pyx_k_gray2), 0, 1, 0, 1}, {&__pyx_n_u_gray20, __pyx_k_gray20, sizeof(__pyx_k_gray20), 0, 1, 0, 1}, {&__pyx_n_u_gray21, __pyx_k_gray21, sizeof(__pyx_k_gray21), 0, 1, 0, 1}, {&__pyx_n_u_gray22, __pyx_k_gray22, sizeof(__pyx_k_gray22), 0, 1, 0, 1}, {&__pyx_n_u_gray23, __pyx_k_gray23, sizeof(__pyx_k_gray23), 0, 1, 0, 1}, {&__pyx_n_u_gray24, __pyx_k_gray24, sizeof(__pyx_k_gray24), 0, 1, 0, 1}, {&__pyx_n_u_gray25, __pyx_k_gray25, sizeof(__pyx_k_gray25), 0, 1, 0, 1}, {&__pyx_n_u_gray26, __pyx_k_gray26, sizeof(__pyx_k_gray26), 0, 1, 0, 1}, {&__pyx_n_u_gray27, __pyx_k_gray27, sizeof(__pyx_k_gray27), 0, 1, 0, 1}, {&__pyx_n_u_gray28, __pyx_k_gray28, sizeof(__pyx_k_gray28), 0, 1, 0, 1}, {&__pyx_n_u_gray29, __pyx_k_gray29, sizeof(__pyx_k_gray29), 0, 1, 0, 1}, {&__pyx_n_u_gray3, __pyx_k_gray3, sizeof(__pyx_k_gray3), 0, 1, 0, 1}, {&__pyx_n_u_gray30, __pyx_k_gray30, sizeof(__pyx_k_gray30), 0, 1, 0, 1}, {&__pyx_n_u_gray31, __pyx_k_gray31, sizeof(__pyx_k_gray31), 0, 1, 0, 1}, {&__pyx_n_u_gray32, __pyx_k_gray32, sizeof(__pyx_k_gray32), 0, 1, 0, 1}, {&__pyx_n_u_gray33, __pyx_k_gray33, sizeof(__pyx_k_gray33), 0, 1, 0, 1}, {&__pyx_n_u_gray34, __pyx_k_gray34, sizeof(__pyx_k_gray34), 0, 1, 0, 1}, {&__pyx_n_u_gray35, __pyx_k_gray35, sizeof(__pyx_k_gray35), 0, 1, 0, 1}, {&__pyx_n_u_gray36, __pyx_k_gray36, sizeof(__pyx_k_gray36), 0, 1, 0, 1}, {&__pyx_n_u_gray37, __pyx_k_gray37, sizeof(__pyx_k_gray37), 0, 1, 0, 1}, {&__pyx_n_u_gray38, __pyx_k_gray38, sizeof(__pyx_k_gray38), 0, 1, 0, 1}, {&__pyx_n_u_gray39, __pyx_k_gray39, sizeof(__pyx_k_gray39), 0, 1, 0, 1}, {&__pyx_n_u_gray4, __pyx_k_gray4, sizeof(__pyx_k_gray4), 0, 1, 0, 1}, {&__pyx_n_u_gray40, __pyx_k_gray40, sizeof(__pyx_k_gray40), 0, 1, 0, 1}, {&__pyx_n_u_gray41, __pyx_k_gray41, sizeof(__pyx_k_gray41), 0, 1, 0, 1}, {&__pyx_n_u_gray42, __pyx_k_gray42, sizeof(__pyx_k_gray42), 0, 1, 0, 1}, {&__pyx_n_u_gray43, __pyx_k_gray43, sizeof(__pyx_k_gray43), 0, 1, 0, 1}, {&__pyx_n_u_gray44, __pyx_k_gray44, sizeof(__pyx_k_gray44), 0, 1, 0, 1}, {&__pyx_n_u_gray45, __pyx_k_gray45, sizeof(__pyx_k_gray45), 0, 1, 0, 1}, {&__pyx_n_u_gray46, __pyx_k_gray46, sizeof(__pyx_k_gray46), 0, 1, 0, 1}, {&__pyx_n_u_gray47, __pyx_k_gray47, sizeof(__pyx_k_gray47), 0, 1, 0, 1}, {&__pyx_n_u_gray48, __pyx_k_gray48, sizeof(__pyx_k_gray48), 0, 1, 0, 1}, {&__pyx_n_u_gray49, __pyx_k_gray49, sizeof(__pyx_k_gray49), 0, 1, 0, 1}, {&__pyx_n_u_gray5, __pyx_k_gray5, sizeof(__pyx_k_gray5), 0, 1, 0, 1}, {&__pyx_n_u_gray50, __pyx_k_gray50, sizeof(__pyx_k_gray50), 0, 1, 0, 1}, {&__pyx_n_u_gray51, __pyx_k_gray51, sizeof(__pyx_k_gray51), 0, 1, 0, 1}, {&__pyx_n_u_gray52, __pyx_k_gray52, sizeof(__pyx_k_gray52), 0, 1, 0, 1}, {&__pyx_n_u_gray53, __pyx_k_gray53, sizeof(__pyx_k_gray53), 0, 1, 0, 1}, {&__pyx_n_u_gray54, __pyx_k_gray54, sizeof(__pyx_k_gray54), 0, 1, 0, 1}, {&__pyx_n_u_gray55, __pyx_k_gray55, sizeof(__pyx_k_gray55), 0, 1, 0, 1}, {&__pyx_n_u_gray56, __pyx_k_gray56, sizeof(__pyx_k_gray56), 0, 1, 0, 1}, {&__pyx_n_u_gray57, __pyx_k_gray57, sizeof(__pyx_k_gray57), 0, 1, 0, 1}, {&__pyx_n_u_gray58, __pyx_k_gray58, sizeof(__pyx_k_gray58), 0, 1, 0, 1}, {&__pyx_n_u_gray59, __pyx_k_gray59, sizeof(__pyx_k_gray59), 0, 1, 0, 1}, {&__pyx_n_u_gray6, __pyx_k_gray6, sizeof(__pyx_k_gray6), 0, 1, 0, 1}, {&__pyx_n_u_gray60, __pyx_k_gray60, sizeof(__pyx_k_gray60), 0, 1, 0, 1}, {&__pyx_n_u_gray61, __pyx_k_gray61, sizeof(__pyx_k_gray61), 0, 1, 0, 1}, {&__pyx_n_u_gray62, __pyx_k_gray62, sizeof(__pyx_k_gray62), 0, 1, 0, 1}, {&__pyx_n_u_gray63, __pyx_k_gray63, sizeof(__pyx_k_gray63), 0, 1, 0, 1}, {&__pyx_n_u_gray64, __pyx_k_gray64, sizeof(__pyx_k_gray64), 0, 1, 0, 1}, {&__pyx_n_u_gray65, __pyx_k_gray65, sizeof(__pyx_k_gray65), 0, 1, 0, 1}, {&__pyx_n_u_gray66, __pyx_k_gray66, sizeof(__pyx_k_gray66), 0, 1, 0, 1}, {&__pyx_n_u_gray67, __pyx_k_gray67, sizeof(__pyx_k_gray67), 0, 1, 0, 1}, {&__pyx_n_u_gray68, __pyx_k_gray68, sizeof(__pyx_k_gray68), 0, 1, 0, 1}, {&__pyx_n_u_gray69, __pyx_k_gray69, sizeof(__pyx_k_gray69), 0, 1, 0, 1}, {&__pyx_n_u_gray7, __pyx_k_gray7, sizeof(__pyx_k_gray7), 0, 1, 0, 1}, {&__pyx_n_u_gray70, __pyx_k_gray70, sizeof(__pyx_k_gray70), 0, 1, 0, 1}, {&__pyx_n_u_gray71, __pyx_k_gray71, sizeof(__pyx_k_gray71), 0, 1, 0, 1}, {&__pyx_n_u_gray72, __pyx_k_gray72, sizeof(__pyx_k_gray72), 0, 1, 0, 1}, {&__pyx_n_u_gray73, __pyx_k_gray73, sizeof(__pyx_k_gray73), 0, 1, 0, 1}, {&__pyx_n_u_gray74, __pyx_k_gray74, sizeof(__pyx_k_gray74), 0, 1, 0, 1}, {&__pyx_n_u_gray75, __pyx_k_gray75, sizeof(__pyx_k_gray75), 0, 1, 0, 1}, {&__pyx_n_u_gray76, __pyx_k_gray76, sizeof(__pyx_k_gray76), 0, 1, 0, 1}, {&__pyx_n_u_gray77, __pyx_k_gray77, sizeof(__pyx_k_gray77), 0, 1, 0, 1}, {&__pyx_n_u_gray78, __pyx_k_gray78, sizeof(__pyx_k_gray78), 0, 1, 0, 1}, {&__pyx_n_u_gray79, __pyx_k_gray79, sizeof(__pyx_k_gray79), 0, 1, 0, 1}, {&__pyx_n_u_gray8, __pyx_k_gray8, sizeof(__pyx_k_gray8), 0, 1, 0, 1}, {&__pyx_n_u_gray80, __pyx_k_gray80, sizeof(__pyx_k_gray80), 0, 1, 0, 1}, {&__pyx_n_u_gray81, __pyx_k_gray81, sizeof(__pyx_k_gray81), 0, 1, 0, 1}, {&__pyx_n_u_gray82, __pyx_k_gray82, sizeof(__pyx_k_gray82), 0, 1, 0, 1}, {&__pyx_n_u_gray83, __pyx_k_gray83, sizeof(__pyx_k_gray83), 0, 1, 0, 1}, {&__pyx_n_u_gray84, __pyx_k_gray84, sizeof(__pyx_k_gray84), 0, 1, 0, 1}, {&__pyx_n_u_gray85, __pyx_k_gray85, sizeof(__pyx_k_gray85), 0, 1, 0, 1}, {&__pyx_n_u_gray86, __pyx_k_gray86, sizeof(__pyx_k_gray86), 0, 1, 0, 1}, {&__pyx_n_u_gray87, __pyx_k_gray87, sizeof(__pyx_k_gray87), 0, 1, 0, 1}, {&__pyx_n_u_gray88, __pyx_k_gray88, sizeof(__pyx_k_gray88), 0, 1, 0, 1}, {&__pyx_n_u_gray89, __pyx_k_gray89, sizeof(__pyx_k_gray89), 0, 1, 0, 1}, {&__pyx_n_u_gray9, __pyx_k_gray9, sizeof(__pyx_k_gray9), 0, 1, 0, 1}, {&__pyx_n_u_gray90, __pyx_k_gray90, sizeof(__pyx_k_gray90), 0, 1, 0, 1}, {&__pyx_n_u_gray91, __pyx_k_gray91, sizeof(__pyx_k_gray91), 0, 1, 0, 1}, {&__pyx_n_u_gray92, __pyx_k_gray92, sizeof(__pyx_k_gray92), 0, 1, 0, 1}, {&__pyx_n_u_gray93, __pyx_k_gray93, sizeof(__pyx_k_gray93), 0, 1, 0, 1}, {&__pyx_n_u_gray94, __pyx_k_gray94, sizeof(__pyx_k_gray94), 0, 1, 0, 1}, {&__pyx_n_u_gray95, __pyx_k_gray95, sizeof(__pyx_k_gray95), 0, 1, 0, 1}, {&__pyx_n_u_gray96, __pyx_k_gray96, sizeof(__pyx_k_gray96), 0, 1, 0, 1}, {&__pyx_n_u_gray97, __pyx_k_gray97, sizeof(__pyx_k_gray97), 0, 1, 0, 1}, {&__pyx_n_u_gray98, __pyx_k_gray98, sizeof(__pyx_k_gray98), 0, 1, 0, 1}, {&__pyx_n_u_gray99, __pyx_k_gray99, sizeof(__pyx_k_gray99), 0, 1, 0, 1}, {&__pyx_n_u_green, __pyx_k_green, sizeof(__pyx_k_green), 0, 1, 0, 1}, {&__pyx_n_u_green1, __pyx_k_green1, sizeof(__pyx_k_green1), 0, 1, 0, 1}, {&__pyx_n_u_green2, __pyx_k_green2, sizeof(__pyx_k_green2), 0, 1, 0, 1}, {&__pyx_n_u_green3, __pyx_k_green3, sizeof(__pyx_k_green3), 0, 1, 0, 1}, {&__pyx_n_u_green4, __pyx_k_green4, sizeof(__pyx_k_green4), 0, 1, 0, 1}, {&__pyx_n_u_greenyellow, __pyx_k_greenyellow, sizeof(__pyx_k_greenyellow), 0, 1, 0, 1}, {&__pyx_n_u_grey, __pyx_k_grey, sizeof(__pyx_k_grey), 0, 1, 0, 1}, {&__pyx_n_u_grey0, __pyx_k_grey0, sizeof(__pyx_k_grey0), 0, 1, 0, 1}, {&__pyx_n_u_grey1, __pyx_k_grey1, sizeof(__pyx_k_grey1), 0, 1, 0, 1}, {&__pyx_n_u_grey10, __pyx_k_grey10, sizeof(__pyx_k_grey10), 0, 1, 0, 1}, {&__pyx_n_u_grey100, __pyx_k_grey100, sizeof(__pyx_k_grey100), 0, 1, 0, 1}, {&__pyx_n_u_grey11, __pyx_k_grey11, sizeof(__pyx_k_grey11), 0, 1, 0, 1}, {&__pyx_n_u_grey12, __pyx_k_grey12, sizeof(__pyx_k_grey12), 0, 1, 0, 1}, {&__pyx_n_u_grey13, __pyx_k_grey13, sizeof(__pyx_k_grey13), 0, 1, 0, 1}, {&__pyx_n_u_grey14, __pyx_k_grey14, sizeof(__pyx_k_grey14), 0, 1, 0, 1}, {&__pyx_n_u_grey15, __pyx_k_grey15, sizeof(__pyx_k_grey15), 0, 1, 0, 1}, {&__pyx_n_u_grey16, __pyx_k_grey16, sizeof(__pyx_k_grey16), 0, 1, 0, 1}, {&__pyx_n_u_grey17, __pyx_k_grey17, sizeof(__pyx_k_grey17), 0, 1, 0, 1}, {&__pyx_n_u_grey18, __pyx_k_grey18, sizeof(__pyx_k_grey18), 0, 1, 0, 1}, {&__pyx_n_u_grey19, __pyx_k_grey19, sizeof(__pyx_k_grey19), 0, 1, 0, 1}, {&__pyx_n_u_grey2, __pyx_k_grey2, sizeof(__pyx_k_grey2), 0, 1, 0, 1}, {&__pyx_n_u_grey20, __pyx_k_grey20, sizeof(__pyx_k_grey20), 0, 1, 0, 1}, {&__pyx_n_u_grey21, __pyx_k_grey21, sizeof(__pyx_k_grey21), 0, 1, 0, 1}, {&__pyx_n_u_grey22, __pyx_k_grey22, sizeof(__pyx_k_grey22), 0, 1, 0, 1}, {&__pyx_n_u_grey23, __pyx_k_grey23, sizeof(__pyx_k_grey23), 0, 1, 0, 1}, {&__pyx_n_u_grey24, __pyx_k_grey24, sizeof(__pyx_k_grey24), 0, 1, 0, 1}, {&__pyx_n_u_grey25, __pyx_k_grey25, sizeof(__pyx_k_grey25), 0, 1, 0, 1}, {&__pyx_n_u_grey26, __pyx_k_grey26, sizeof(__pyx_k_grey26), 0, 1, 0, 1}, {&__pyx_n_u_grey27, __pyx_k_grey27, sizeof(__pyx_k_grey27), 0, 1, 0, 1}, {&__pyx_n_u_grey28, __pyx_k_grey28, sizeof(__pyx_k_grey28), 0, 1, 0, 1}, {&__pyx_n_u_grey29, __pyx_k_grey29, sizeof(__pyx_k_grey29), 0, 1, 0, 1}, {&__pyx_n_u_grey3, __pyx_k_grey3, sizeof(__pyx_k_grey3), 0, 1, 0, 1}, {&__pyx_n_u_grey30, __pyx_k_grey30, sizeof(__pyx_k_grey30), 0, 1, 0, 1}, {&__pyx_n_u_grey31, __pyx_k_grey31, sizeof(__pyx_k_grey31), 0, 1, 0, 1}, {&__pyx_n_u_grey32, __pyx_k_grey32, sizeof(__pyx_k_grey32), 0, 1, 0, 1}, {&__pyx_n_u_grey33, __pyx_k_grey33, sizeof(__pyx_k_grey33), 0, 1, 0, 1}, {&__pyx_n_u_grey34, __pyx_k_grey34, sizeof(__pyx_k_grey34), 0, 1, 0, 1}, {&__pyx_n_u_grey35, __pyx_k_grey35, sizeof(__pyx_k_grey35), 0, 1, 0, 1}, {&__pyx_n_u_grey36, __pyx_k_grey36, sizeof(__pyx_k_grey36), 0, 1, 0, 1}, {&__pyx_n_u_grey37, __pyx_k_grey37, sizeof(__pyx_k_grey37), 0, 1, 0, 1}, {&__pyx_n_u_grey38, __pyx_k_grey38, sizeof(__pyx_k_grey38), 0, 1, 0, 1}, {&__pyx_n_u_grey39, __pyx_k_grey39, sizeof(__pyx_k_grey39), 0, 1, 0, 1}, {&__pyx_n_u_grey4, __pyx_k_grey4, sizeof(__pyx_k_grey4), 0, 1, 0, 1}, {&__pyx_n_u_grey40, __pyx_k_grey40, sizeof(__pyx_k_grey40), 0, 1, 0, 1}, {&__pyx_n_u_grey41, __pyx_k_grey41, sizeof(__pyx_k_grey41), 0, 1, 0, 1}, {&__pyx_n_u_grey42, __pyx_k_grey42, sizeof(__pyx_k_grey42), 0, 1, 0, 1}, {&__pyx_n_u_grey43, __pyx_k_grey43, sizeof(__pyx_k_grey43), 0, 1, 0, 1}, {&__pyx_n_u_grey44, __pyx_k_grey44, sizeof(__pyx_k_grey44), 0, 1, 0, 1}, {&__pyx_n_u_grey45, __pyx_k_grey45, sizeof(__pyx_k_grey45), 0, 1, 0, 1}, {&__pyx_n_u_grey46, __pyx_k_grey46, sizeof(__pyx_k_grey46), 0, 1, 0, 1}, {&__pyx_n_u_grey47, __pyx_k_grey47, sizeof(__pyx_k_grey47), 0, 1, 0, 1}, {&__pyx_n_u_grey48, __pyx_k_grey48, sizeof(__pyx_k_grey48), 0, 1, 0, 1}, {&__pyx_n_u_grey49, __pyx_k_grey49, sizeof(__pyx_k_grey49), 0, 1, 0, 1}, {&__pyx_n_u_grey5, __pyx_k_grey5, sizeof(__pyx_k_grey5), 0, 1, 0, 1}, {&__pyx_n_u_grey50, __pyx_k_grey50, sizeof(__pyx_k_grey50), 0, 1, 0, 1}, {&__pyx_n_u_grey51, __pyx_k_grey51, sizeof(__pyx_k_grey51), 0, 1, 0, 1}, {&__pyx_n_u_grey52, __pyx_k_grey52, sizeof(__pyx_k_grey52), 0, 1, 0, 1}, {&__pyx_n_u_grey53, __pyx_k_grey53, sizeof(__pyx_k_grey53), 0, 1, 0, 1}, {&__pyx_n_u_grey54, __pyx_k_grey54, sizeof(__pyx_k_grey54), 0, 1, 0, 1}, {&__pyx_n_u_grey55, __pyx_k_grey55, sizeof(__pyx_k_grey55), 0, 1, 0, 1}, {&__pyx_n_u_grey56, __pyx_k_grey56, sizeof(__pyx_k_grey56), 0, 1, 0, 1}, {&__pyx_n_u_grey57, __pyx_k_grey57, sizeof(__pyx_k_grey57), 0, 1, 0, 1}, {&__pyx_n_u_grey58, __pyx_k_grey58, sizeof(__pyx_k_grey58), 0, 1, 0, 1}, {&__pyx_n_u_grey59, __pyx_k_grey59, sizeof(__pyx_k_grey59), 0, 1, 0, 1}, {&__pyx_n_u_grey6, __pyx_k_grey6, sizeof(__pyx_k_grey6), 0, 1, 0, 1}, {&__pyx_n_u_grey60, __pyx_k_grey60, sizeof(__pyx_k_grey60), 0, 1, 0, 1}, {&__pyx_n_u_grey61, __pyx_k_grey61, sizeof(__pyx_k_grey61), 0, 1, 0, 1}, {&__pyx_n_u_grey62, __pyx_k_grey62, sizeof(__pyx_k_grey62), 0, 1, 0, 1}, {&__pyx_n_u_grey63, __pyx_k_grey63, sizeof(__pyx_k_grey63), 0, 1, 0, 1}, {&__pyx_n_u_grey64, __pyx_k_grey64, sizeof(__pyx_k_grey64), 0, 1, 0, 1}, {&__pyx_n_u_grey65, __pyx_k_grey65, sizeof(__pyx_k_grey65), 0, 1, 0, 1}, {&__pyx_n_u_grey66, __pyx_k_grey66, sizeof(__pyx_k_grey66), 0, 1, 0, 1}, {&__pyx_n_u_grey67, __pyx_k_grey67, sizeof(__pyx_k_grey67), 0, 1, 0, 1}, {&__pyx_n_u_grey68, __pyx_k_grey68, sizeof(__pyx_k_grey68), 0, 1, 0, 1}, {&__pyx_n_u_grey69, __pyx_k_grey69, sizeof(__pyx_k_grey69), 0, 1, 0, 1}, {&__pyx_n_u_grey7, __pyx_k_grey7, sizeof(__pyx_k_grey7), 0, 1, 0, 1}, {&__pyx_n_u_grey70, __pyx_k_grey70, sizeof(__pyx_k_grey70), 0, 1, 0, 1}, {&__pyx_n_u_grey71, __pyx_k_grey71, sizeof(__pyx_k_grey71), 0, 1, 0, 1}, {&__pyx_n_u_grey72, __pyx_k_grey72, sizeof(__pyx_k_grey72), 0, 1, 0, 1}, {&__pyx_n_u_grey73, __pyx_k_grey73, sizeof(__pyx_k_grey73), 0, 1, 0, 1}, {&__pyx_n_u_grey74, __pyx_k_grey74, sizeof(__pyx_k_grey74), 0, 1, 0, 1}, {&__pyx_n_u_grey75, __pyx_k_grey75, sizeof(__pyx_k_grey75), 0, 1, 0, 1}, {&__pyx_n_u_grey76, __pyx_k_grey76, sizeof(__pyx_k_grey76), 0, 1, 0, 1}, {&__pyx_n_u_grey77, __pyx_k_grey77, sizeof(__pyx_k_grey77), 0, 1, 0, 1}, {&__pyx_n_u_grey78, __pyx_k_grey78, sizeof(__pyx_k_grey78), 0, 1, 0, 1}, {&__pyx_n_u_grey79, __pyx_k_grey79, sizeof(__pyx_k_grey79), 0, 1, 0, 1}, {&__pyx_n_u_grey8, __pyx_k_grey8, sizeof(__pyx_k_grey8), 0, 1, 0, 1}, {&__pyx_n_u_grey80, __pyx_k_grey80, sizeof(__pyx_k_grey80), 0, 1, 0, 1}, {&__pyx_n_u_grey81, __pyx_k_grey81, sizeof(__pyx_k_grey81), 0, 1, 0, 1}, {&__pyx_n_u_grey82, __pyx_k_grey82, sizeof(__pyx_k_grey82), 0, 1, 0, 1}, {&__pyx_n_u_grey83, __pyx_k_grey83, sizeof(__pyx_k_grey83), 0, 1, 0, 1}, {&__pyx_n_u_grey84, __pyx_k_grey84, sizeof(__pyx_k_grey84), 0, 1, 0, 1}, {&__pyx_n_u_grey85, __pyx_k_grey85, sizeof(__pyx_k_grey85), 0, 1, 0, 1}, {&__pyx_n_u_grey86, __pyx_k_grey86, sizeof(__pyx_k_grey86), 0, 1, 0, 1}, {&__pyx_n_u_grey87, __pyx_k_grey87, sizeof(__pyx_k_grey87), 0, 1, 0, 1}, {&__pyx_n_u_grey88, __pyx_k_grey88, sizeof(__pyx_k_grey88), 0, 1, 0, 1}, {&__pyx_n_u_grey89, __pyx_k_grey89, sizeof(__pyx_k_grey89), 0, 1, 0, 1}, {&__pyx_n_u_grey9, __pyx_k_grey9, sizeof(__pyx_k_grey9), 0, 1, 0, 1}, {&__pyx_n_u_grey90, __pyx_k_grey90, sizeof(__pyx_k_grey90), 0, 1, 0, 1}, {&__pyx_n_u_grey91, __pyx_k_grey91, sizeof(__pyx_k_grey91), 0, 1, 0, 1}, {&__pyx_n_u_grey92, __pyx_k_grey92, sizeof(__pyx_k_grey92), 0, 1, 0, 1}, {&__pyx_n_u_grey93, __pyx_k_grey93, sizeof(__pyx_k_grey93), 0, 1, 0, 1}, {&__pyx_n_u_grey94, __pyx_k_grey94, sizeof(__pyx_k_grey94), 0, 1, 0, 1}, {&__pyx_n_u_grey95, __pyx_k_grey95, sizeof(__pyx_k_grey95), 0, 1, 0, 1}, {&__pyx_n_u_grey96, __pyx_k_grey96, sizeof(__pyx_k_grey96), 0, 1, 0, 1}, {&__pyx_n_u_grey97, __pyx_k_grey97, sizeof(__pyx_k_grey97), 0, 1, 0, 1}, {&__pyx_n_u_grey98, __pyx_k_grey98, sizeof(__pyx_k_grey98), 0, 1, 0, 1}, {&__pyx_n_u_grey99, __pyx_k_grey99, sizeof(__pyx_k_grey99), 0, 1, 0, 1}, {&__pyx_n_s_hex, __pyx_k_hex, sizeof(__pyx_k_hex), 0, 0, 1, 1}, {&__pyx_kp_s_home_tom_ab_pygame_sdl2_src_pyg, __pyx_k_home_tom_ab_pygame_sdl2_src_pyg, sizeof(__pyx_k_home_tom_ab_pygame_sdl2_src_pyg), 0, 0, 1, 0}, {&__pyx_n_u_honeydew, __pyx_k_honeydew, sizeof(__pyx_k_honeydew), 0, 1, 0, 1}, {&__pyx_n_u_honeydew1, __pyx_k_honeydew1, sizeof(__pyx_k_honeydew1), 0, 1, 0, 1}, {&__pyx_n_u_honeydew2, __pyx_k_honeydew2, sizeof(__pyx_k_honeydew2), 0, 1, 0, 1}, {&__pyx_n_u_honeydew3, __pyx_k_honeydew3, sizeof(__pyx_k_honeydew3), 0, 1, 0, 1}, {&__pyx_n_u_honeydew4, __pyx_k_honeydew4, sizeof(__pyx_k_honeydew4), 0, 1, 0, 1}, {&__pyx_n_u_hotpink, __pyx_k_hotpink, sizeof(__pyx_k_hotpink), 0, 1, 0, 1}, {&__pyx_n_u_hotpink1, __pyx_k_hotpink1, sizeof(__pyx_k_hotpink1), 0, 1, 0, 1}, {&__pyx_n_u_hotpink2, __pyx_k_hotpink2, sizeof(__pyx_k_hotpink2), 0, 1, 0, 1}, {&__pyx_n_u_hotpink3, __pyx_k_hotpink3, sizeof(__pyx_k_hotpink3), 0, 1, 0, 1}, {&__pyx_n_u_hotpink4, __pyx_k_hotpink4, sizeof(__pyx_k_hotpink4), 0, 1, 0, 1}, {&__pyx_n_s_hsva, __pyx_k_hsva, sizeof(__pyx_k_hsva), 0, 0, 1, 1}, {&__pyx_n_s_import, __pyx_k_import, sizeof(__pyx_k_import), 0, 0, 1, 1}, {&__pyx_n_u_indianred, __pyx_k_indianred, sizeof(__pyx_k_indianred), 0, 1, 0, 1}, {&__pyx_n_u_indianred1, __pyx_k_indianred1, sizeof(__pyx_k_indianred1), 0, 1, 0, 1}, {&__pyx_n_u_indianred2, __pyx_k_indianred2, sizeof(__pyx_k_indianred2), 0, 1, 0, 1}, {&__pyx_n_u_indianred3, __pyx_k_indianred3, sizeof(__pyx_k_indianred3), 0, 1, 0, 1}, {&__pyx_n_u_indianred4, __pyx_k_indianred4, sizeof(__pyx_k_indianred4), 0, 1, 0, 1}, {&__pyx_n_u_indigo, __pyx_k_indigo, sizeof(__pyx_k_indigo), 0, 1, 0, 1}, {&__pyx_n_u_ivory, __pyx_k_ivory, sizeof(__pyx_k_ivory), 0, 1, 0, 1}, {&__pyx_n_u_ivory1, __pyx_k_ivory1, sizeof(__pyx_k_ivory1), 0, 1, 0, 1}, {&__pyx_n_u_ivory2, __pyx_k_ivory2, sizeof(__pyx_k_ivory2), 0, 1, 0, 1}, {&__pyx_n_u_ivory3, __pyx_k_ivory3, sizeof(__pyx_k_ivory3), 0, 1, 0, 1}, {&__pyx_n_u_ivory4, __pyx_k_ivory4, sizeof(__pyx_k_ivory4), 0, 1, 0, 1}, {&__pyx_n_u_khaki, __pyx_k_khaki, sizeof(__pyx_k_khaki), 0, 1, 0, 1}, {&__pyx_n_u_khaki1, __pyx_k_khaki1, sizeof(__pyx_k_khaki1), 0, 1, 0, 1}, {&__pyx_n_u_khaki2, __pyx_k_khaki2, sizeof(__pyx_k_khaki2), 0, 1, 0, 1}, {&__pyx_n_u_khaki3, __pyx_k_khaki3, sizeof(__pyx_k_khaki3), 0, 1, 0, 1}, {&__pyx_n_u_khaki4, __pyx_k_khaki4, sizeof(__pyx_k_khaki4), 0, 1, 0, 1}, {&__pyx_n_s_l, __pyx_k_l, sizeof(__pyx_k_l), 0, 0, 1, 1}, {&__pyx_n_u_lavender, __pyx_k_lavender, sizeof(__pyx_k_lavender), 0, 1, 0, 1}, {&__pyx_n_u_lavenderblush, __pyx_k_lavenderblush, sizeof(__pyx_k_lavenderblush), 0, 1, 0, 1}, {&__pyx_n_u_lavenderblush1, __pyx_k_lavenderblush1, sizeof(__pyx_k_lavenderblush1), 0, 1, 0, 1}, {&__pyx_n_u_lavenderblush2, __pyx_k_lavenderblush2, sizeof(__pyx_k_lavenderblush2), 0, 1, 0, 1}, {&__pyx_n_u_lavenderblush3, __pyx_k_lavenderblush3, sizeof(__pyx_k_lavenderblush3), 0, 1, 0, 1}, {&__pyx_n_u_lavenderblush4, __pyx_k_lavenderblush4, sizeof(__pyx_k_lavenderblush4), 0, 1, 0, 1}, {&__pyx_n_u_lawngreen, __pyx_k_lawngreen, sizeof(__pyx_k_lawngreen), 0, 1, 0, 1}, {&__pyx_n_u_lemonchiffon, __pyx_k_lemonchiffon, sizeof(__pyx_k_lemonchiffon), 0, 1, 0, 1}, {&__pyx_n_u_lemonchiffon1, __pyx_k_lemonchiffon1, sizeof(__pyx_k_lemonchiffon1), 0, 1, 0, 1}, {&__pyx_n_u_lemonchiffon2, __pyx_k_lemonchiffon2, sizeof(__pyx_k_lemonchiffon2), 0, 1, 0, 1}, {&__pyx_n_u_lemonchiffon3, __pyx_k_lemonchiffon3, sizeof(__pyx_k_lemonchiffon3), 0, 1, 0, 1}, {&__pyx_n_u_lemonchiffon4, __pyx_k_lemonchiffon4, sizeof(__pyx_k_lemonchiffon4), 0, 1, 0, 1}, {&__pyx_n_u_lightblue, __pyx_k_lightblue, sizeof(__pyx_k_lightblue), 0, 1, 0, 1}, {&__pyx_n_u_lightblue1, __pyx_k_lightblue1, sizeof(__pyx_k_lightblue1), 0, 1, 0, 1}, {&__pyx_n_u_lightblue2, __pyx_k_lightblue2, sizeof(__pyx_k_lightblue2), 0, 1, 0, 1}, {&__pyx_n_u_lightblue3, __pyx_k_lightblue3, sizeof(__pyx_k_lightblue3), 0, 1, 0, 1}, {&__pyx_n_u_lightblue4, __pyx_k_lightblue4, sizeof(__pyx_k_lightblue4), 0, 1, 0, 1}, {&__pyx_n_u_lightcoral, __pyx_k_lightcoral, sizeof(__pyx_k_lightcoral), 0, 1, 0, 1}, {&__pyx_n_u_lightcyan, __pyx_k_lightcyan, sizeof(__pyx_k_lightcyan), 0, 1, 0, 1}, {&__pyx_n_u_lightcyan1, __pyx_k_lightcyan1, sizeof(__pyx_k_lightcyan1), 0, 1, 0, 1}, {&__pyx_n_u_lightcyan2, __pyx_k_lightcyan2, sizeof(__pyx_k_lightcyan2), 0, 1, 0, 1}, {&__pyx_n_u_lightcyan3, __pyx_k_lightcyan3, sizeof(__pyx_k_lightcyan3), 0, 1, 0, 1}, {&__pyx_n_u_lightcyan4, __pyx_k_lightcyan4, sizeof(__pyx_k_lightcyan4), 0, 1, 0, 1}, {&__pyx_n_u_lightgoldenrod, __pyx_k_lightgoldenrod, sizeof(__pyx_k_lightgoldenrod), 0, 1, 0, 1}, {&__pyx_n_u_lightgoldenrod1, __pyx_k_lightgoldenrod1, sizeof(__pyx_k_lightgoldenrod1), 0, 1, 0, 1}, {&__pyx_n_u_lightgoldenrod2, __pyx_k_lightgoldenrod2, sizeof(__pyx_k_lightgoldenrod2), 0, 1, 0, 1}, {&__pyx_n_u_lightgoldenrod3, __pyx_k_lightgoldenrod3, sizeof(__pyx_k_lightgoldenrod3), 0, 1, 0, 1}, {&__pyx_n_u_lightgoldenrod4, __pyx_k_lightgoldenrod4, sizeof(__pyx_k_lightgoldenrod4), 0, 1, 0, 1}, {&__pyx_n_u_lightgoldenrodyellow, __pyx_k_lightgoldenrodyellow, sizeof(__pyx_k_lightgoldenrodyellow), 0, 1, 0, 1}, {&__pyx_n_u_lightgray, __pyx_k_lightgray, sizeof(__pyx_k_lightgray), 0, 1, 0, 1}, {&__pyx_n_u_lightgreen, __pyx_k_lightgreen, sizeof(__pyx_k_lightgreen), 0, 1, 0, 1}, {&__pyx_n_u_lightgrey, __pyx_k_lightgrey, sizeof(__pyx_k_lightgrey), 0, 1, 0, 1}, {&__pyx_n_u_lightpink, __pyx_k_lightpink, sizeof(__pyx_k_lightpink), 0, 1, 0, 1}, {&__pyx_n_u_lightpink1, __pyx_k_lightpink1, sizeof(__pyx_k_lightpink1), 0, 1, 0, 1}, {&__pyx_n_u_lightpink2, __pyx_k_lightpink2, sizeof(__pyx_k_lightpink2), 0, 1, 0, 1}, {&__pyx_n_u_lightpink3, __pyx_k_lightpink3, sizeof(__pyx_k_lightpink3), 0, 1, 0, 1}, {&__pyx_n_u_lightpink4, __pyx_k_lightpink4, sizeof(__pyx_k_lightpink4), 0, 1, 0, 1}, {&__pyx_n_u_lightsalmon, __pyx_k_lightsalmon, sizeof(__pyx_k_lightsalmon), 0, 1, 0, 1}, {&__pyx_n_u_lightsalmon1, __pyx_k_lightsalmon1, sizeof(__pyx_k_lightsalmon1), 0, 1, 0, 1}, {&__pyx_n_u_lightsalmon2, __pyx_k_lightsalmon2, sizeof(__pyx_k_lightsalmon2), 0, 1, 0, 1}, {&__pyx_n_u_lightsalmon3, __pyx_k_lightsalmon3, sizeof(__pyx_k_lightsalmon3), 0, 1, 0, 1}, {&__pyx_n_u_lightsalmon4, __pyx_k_lightsalmon4, sizeof(__pyx_k_lightsalmon4), 0, 1, 0, 1}, {&__pyx_n_u_lightseagreen, __pyx_k_lightseagreen, sizeof(__pyx_k_lightseagreen), 0, 1, 0, 1}, {&__pyx_n_u_lightskyblue, __pyx_k_lightskyblue, sizeof(__pyx_k_lightskyblue), 0, 1, 0, 1}, {&__pyx_n_u_lightskyblue1, __pyx_k_lightskyblue1, sizeof(__pyx_k_lightskyblue1), 0, 1, 0, 1}, {&__pyx_n_u_lightskyblue2, __pyx_k_lightskyblue2, sizeof(__pyx_k_lightskyblue2), 0, 1, 0, 1}, {&__pyx_n_u_lightskyblue3, __pyx_k_lightskyblue3, sizeof(__pyx_k_lightskyblue3), 0, 1, 0, 1}, {&__pyx_n_u_lightskyblue4, __pyx_k_lightskyblue4, sizeof(__pyx_k_lightskyblue4), 0, 1, 0, 1}, {&__pyx_n_u_lightslateblue, __pyx_k_lightslateblue, sizeof(__pyx_k_lightslateblue), 0, 1, 0, 1}, {&__pyx_n_u_lightslategray, __pyx_k_lightslategray, sizeof(__pyx_k_lightslategray), 0, 1, 0, 1}, {&__pyx_n_u_lightslategrey, __pyx_k_lightslategrey, sizeof(__pyx_k_lightslategrey), 0, 1, 0, 1}, {&__pyx_n_u_lightsteelblue, __pyx_k_lightsteelblue, sizeof(__pyx_k_lightsteelblue), 0, 1, 0, 1}, {&__pyx_n_u_lightsteelblue1, __pyx_k_lightsteelblue1, sizeof(__pyx_k_lightsteelblue1), 0, 1, 0, 1}, {&__pyx_n_u_lightsteelblue2, __pyx_k_lightsteelblue2, sizeof(__pyx_k_lightsteelblue2), 0, 1, 0, 1}, {&__pyx_n_u_lightsteelblue3, __pyx_k_lightsteelblue3, sizeof(__pyx_k_lightsteelblue3), 0, 1, 0, 1}, {&__pyx_n_u_lightsteelblue4, __pyx_k_lightsteelblue4, sizeof(__pyx_k_lightsteelblue4), 0, 1, 0, 1}, {&__pyx_n_u_lightyellow, __pyx_k_lightyellow, sizeof(__pyx_k_lightyellow), 0, 1, 0, 1}, {&__pyx_n_u_lightyellow1, __pyx_k_lightyellow1, sizeof(__pyx_k_lightyellow1), 0, 1, 0, 1}, {&__pyx_n_u_lightyellow2, __pyx_k_lightyellow2, sizeof(__pyx_k_lightyellow2), 0, 1, 0, 1}, {&__pyx_n_u_lightyellow3, __pyx_k_lightyellow3, sizeof(__pyx_k_lightyellow3), 0, 1, 0, 1}, {&__pyx_n_u_lightyellow4, __pyx_k_lightyellow4, sizeof(__pyx_k_lightyellow4), 0, 1, 0, 1}, {&__pyx_n_u_lime, __pyx_k_lime, sizeof(__pyx_k_lime), 0, 1, 0, 1}, {&__pyx_n_u_limegreen, __pyx_k_limegreen, sizeof(__pyx_k_limegreen), 0, 1, 0, 1}, {&__pyx_n_u_linen, __pyx_k_linen, sizeof(__pyx_k_linen), 0, 1, 0, 1}, {&__pyx_n_s_lower, __pyx_k_lower, sizeof(__pyx_k_lower), 0, 0, 1, 1}, {&__pyx_n_u_magenta, __pyx_k_magenta, sizeof(__pyx_k_magenta), 0, 1, 0, 1}, {&__pyx_n_u_magenta1, __pyx_k_magenta1, sizeof(__pyx_k_magenta1), 0, 1, 0, 1}, {&__pyx_n_u_magenta2, __pyx_k_magenta2, sizeof(__pyx_k_magenta2), 0, 1, 0, 1}, {&__pyx_n_u_magenta3, __pyx_k_magenta3, sizeof(__pyx_k_magenta3), 0, 1, 0, 1}, {&__pyx_n_u_magenta4, __pyx_k_magenta4, sizeof(__pyx_k_magenta4), 0, 1, 0, 1}, {&__pyx_n_s_main, __pyx_k_main, sizeof(__pyx_k_main), 0, 0, 1, 1}, {&__pyx_n_s_map, __pyx_k_map, sizeof(__pyx_k_map), 0, 0, 1, 1}, {&__pyx_n_u_maroon, __pyx_k_maroon, sizeof(__pyx_k_maroon), 0, 1, 0, 1}, {&__pyx_n_u_maroon1, __pyx_k_maroon1, sizeof(__pyx_k_maroon1), 0, 1, 0, 1}, {&__pyx_n_u_maroon2, __pyx_k_maroon2, sizeof(__pyx_k_maroon2), 0, 1, 0, 1}, {&__pyx_n_u_maroon3, __pyx_k_maroon3, sizeof(__pyx_k_maroon3), 0, 1, 0, 1}, {&__pyx_n_u_maroon4, __pyx_k_maroon4, sizeof(__pyx_k_maroon4), 0, 1, 0, 1}, {&__pyx_n_u_mediumaquamarine, __pyx_k_mediumaquamarine, sizeof(__pyx_k_mediumaquamarine), 0, 1, 0, 1}, {&__pyx_n_u_mediumblue, __pyx_k_mediumblue, sizeof(__pyx_k_mediumblue), 0, 1, 0, 1}, {&__pyx_n_u_mediumorchid, __pyx_k_mediumorchid, sizeof(__pyx_k_mediumorchid), 0, 1, 0, 1}, {&__pyx_n_u_mediumorchid1, __pyx_k_mediumorchid1, sizeof(__pyx_k_mediumorchid1), 0, 1, 0, 1}, {&__pyx_n_u_mediumorchid2, __pyx_k_mediumorchid2, sizeof(__pyx_k_mediumorchid2), 0, 1, 0, 1}, {&__pyx_n_u_mediumorchid3, __pyx_k_mediumorchid3, sizeof(__pyx_k_mediumorchid3), 0, 1, 0, 1}, {&__pyx_n_u_mediumorchid4, __pyx_k_mediumorchid4, sizeof(__pyx_k_mediumorchid4), 0, 1, 0, 1}, {&__pyx_n_u_mediumpurple, __pyx_k_mediumpurple, sizeof(__pyx_k_mediumpurple), 0, 1, 0, 1}, {&__pyx_n_u_mediumpurple1, __pyx_k_mediumpurple1, sizeof(__pyx_k_mediumpurple1), 0, 1, 0, 1}, {&__pyx_n_u_mediumpurple2, __pyx_k_mediumpurple2, sizeof(__pyx_k_mediumpurple2), 0, 1, 0, 1}, {&__pyx_n_u_mediumpurple3, __pyx_k_mediumpurple3, sizeof(__pyx_k_mediumpurple3), 0, 1, 0, 1}, {&__pyx_n_u_mediumpurple4, __pyx_k_mediumpurple4, sizeof(__pyx_k_mediumpurple4), 0, 1, 0, 1}, {&__pyx_n_u_mediumseagreen, __pyx_k_mediumseagreen, sizeof(__pyx_k_mediumseagreen), 0, 1, 0, 1}, {&__pyx_n_u_mediumslateblue, __pyx_k_mediumslateblue, sizeof(__pyx_k_mediumslateblue), 0, 1, 0, 1}, {&__pyx_n_u_mediumspringgreen, __pyx_k_mediumspringgreen, sizeof(__pyx_k_mediumspringgreen), 0, 1, 0, 1}, {&__pyx_n_u_mediumturquoise, __pyx_k_mediumturquoise, sizeof(__pyx_k_mediumturquoise), 0, 1, 0, 1}, {&__pyx_n_u_mediumvioletred, __pyx_k_mediumvioletred, sizeof(__pyx_k_mediumvioletred), 0, 1, 0, 1}, {&__pyx_n_u_midnightblue, __pyx_k_midnightblue, sizeof(__pyx_k_midnightblue), 0, 1, 0, 1}, {&__pyx_n_u_mintcream, __pyx_k_mintcream, sizeof(__pyx_k_mintcream), 0, 1, 0, 1}, {&__pyx_n_u_mistyrose, __pyx_k_mistyrose, sizeof(__pyx_k_mistyrose), 0, 1, 0, 1}, {&__pyx_n_u_mistyrose1, __pyx_k_mistyrose1, sizeof(__pyx_k_mistyrose1), 0, 1, 0, 1}, {&__pyx_n_u_mistyrose2, __pyx_k_mistyrose2, sizeof(__pyx_k_mistyrose2), 0, 1, 0, 1}, {&__pyx_n_u_mistyrose3, __pyx_k_mistyrose3, sizeof(__pyx_k_mistyrose3), 0, 1, 0, 1}, {&__pyx_n_u_mistyrose4, __pyx_k_mistyrose4, sizeof(__pyx_k_mistyrose4), 0, 1, 0, 1}, {&__pyx_n_u_moccasin, __pyx_k_moccasin, sizeof(__pyx_k_moccasin), 0, 1, 0, 1}, {&__pyx_n_s_mod, __pyx_k_mod, sizeof(__pyx_k_mod), 0, 0, 1, 1}, {&__pyx_n_s_mod___locals_mod, __pyx_k_mod___locals_mod, sizeof(__pyx_k_mod___locals_mod), 0, 0, 1, 1}, {&__pyx_n_u_navajowhite, __pyx_k_navajowhite, sizeof(__pyx_k_navajowhite), 0, 1, 0, 1}, {&__pyx_n_u_navajowhite1, __pyx_k_navajowhite1, sizeof(__pyx_k_navajowhite1), 0, 1, 0, 1}, {&__pyx_n_u_navajowhite2, __pyx_k_navajowhite2, sizeof(__pyx_k_navajowhite2), 0, 1, 0, 1}, {&__pyx_n_u_navajowhite3, __pyx_k_navajowhite3, sizeof(__pyx_k_navajowhite3), 0, 1, 0, 1}, {&__pyx_n_u_navajowhite4, __pyx_k_navajowhite4, sizeof(__pyx_k_navajowhite4), 0, 1, 0, 1}, {&__pyx_n_u_navy, __pyx_k_navy, sizeof(__pyx_k_navy), 0, 1, 0, 1}, {&__pyx_n_u_navyblue, __pyx_k_navyblue, sizeof(__pyx_k_navyblue), 0, 1, 0, 1}, {&__pyx_n_s_oct, __pyx_k_oct, sizeof(__pyx_k_oct), 0, 0, 1, 1}, {&__pyx_n_u_oldlace, __pyx_k_oldlace, sizeof(__pyx_k_oldlace), 0, 1, 0, 1}, {&__pyx_n_u_olive, __pyx_k_olive, sizeof(__pyx_k_olive), 0, 1, 0, 1}, {&__pyx_n_u_olivedrab, __pyx_k_olivedrab, sizeof(__pyx_k_olivedrab), 0, 1, 0, 1}, {&__pyx_n_u_olivedrab1, __pyx_k_olivedrab1, sizeof(__pyx_k_olivedrab1), 0, 1, 0, 1}, {&__pyx_n_u_olivedrab2, __pyx_k_olivedrab2, sizeof(__pyx_k_olivedrab2), 0, 1, 0, 1}, {&__pyx_n_u_olivedrab3, __pyx_k_olivedrab3, sizeof(__pyx_k_olivedrab3), 0, 1, 0, 1}, {&__pyx_n_u_olivedrab4, __pyx_k_olivedrab4, sizeof(__pyx_k_olivedrab4), 0, 1, 0, 1}, {&__pyx_n_u_orange, __pyx_k_orange, sizeof(__pyx_k_orange), 0, 1, 0, 1}, {&__pyx_n_u_orange1, __pyx_k_orange1, sizeof(__pyx_k_orange1), 0, 1, 0, 1}, {&__pyx_n_u_orange2, __pyx_k_orange2, sizeof(__pyx_k_orange2), 0, 1, 0, 1}, {&__pyx_n_u_orange3, __pyx_k_orange3, sizeof(__pyx_k_orange3), 0, 1, 0, 1}, {&__pyx_n_u_orange4, __pyx_k_orange4, sizeof(__pyx_k_orange4), 0, 1, 0, 1}, {&__pyx_n_u_orangered, __pyx_k_orangered, sizeof(__pyx_k_orangered), 0, 1, 0, 1}, {&__pyx_n_u_orangered1, __pyx_k_orangered1, sizeof(__pyx_k_orangered1), 0, 1, 0, 1}, {&__pyx_n_u_orangered2, __pyx_k_orangered2, sizeof(__pyx_k_orangered2), 0, 1, 0, 1}, {&__pyx_n_u_orangered3, __pyx_k_orangered3, sizeof(__pyx_k_orangered3), 0, 1, 0, 1}, {&__pyx_n_u_orangered4, __pyx_k_orangered4, sizeof(__pyx_k_orangered4), 0, 1, 0, 1}, {&__pyx_n_u_orchid, __pyx_k_orchid, sizeof(__pyx_k_orchid), 0, 1, 0, 1}, {&__pyx_n_u_orchid1, __pyx_k_orchid1, sizeof(__pyx_k_orchid1), 0, 1, 0, 1}, {&__pyx_n_u_orchid2, __pyx_k_orchid2, sizeof(__pyx_k_orchid2), 0, 1, 0, 1}, {&__pyx_n_u_orchid3, __pyx_k_orchid3, sizeof(__pyx_k_orchid3), 0, 1, 0, 1}, {&__pyx_n_u_orchid4, __pyx_k_orchid4, sizeof(__pyx_k_orchid4), 0, 1, 0, 1}, {&__pyx_n_s_pack, __pyx_k_pack, sizeof(__pyx_k_pack), 0, 0, 1, 1}, {&__pyx_n_u_palegoldenrod, __pyx_k_palegoldenrod, sizeof(__pyx_k_palegoldenrod), 0, 1, 0, 1}, {&__pyx_n_u_palegreen, __pyx_k_palegreen, sizeof(__pyx_k_palegreen), 0, 1, 0, 1}, {&__pyx_n_u_palegreen1, __pyx_k_palegreen1, sizeof(__pyx_k_palegreen1), 0, 1, 0, 1}, {&__pyx_n_u_palegreen2, __pyx_k_palegreen2, sizeof(__pyx_k_palegreen2), 0, 1, 0, 1}, {&__pyx_n_u_palegreen3, __pyx_k_palegreen3, sizeof(__pyx_k_palegreen3), 0, 1, 0, 1}, {&__pyx_n_u_palegreen4, __pyx_k_palegreen4, sizeof(__pyx_k_palegreen4), 0, 1, 0, 1}, {&__pyx_n_u_paleturquoise, __pyx_k_paleturquoise, sizeof(__pyx_k_paleturquoise), 0, 1, 0, 1}, {&__pyx_n_u_paleturquoise1, __pyx_k_paleturquoise1, sizeof(__pyx_k_paleturquoise1), 0, 1, 0, 1}, {&__pyx_n_u_paleturquoise2, __pyx_k_paleturquoise2, sizeof(__pyx_k_paleturquoise2), 0, 1, 0, 1}, {&__pyx_n_u_paleturquoise3, __pyx_k_paleturquoise3, sizeof(__pyx_k_paleturquoise3), 0, 1, 0, 1}, {&__pyx_n_u_paleturquoise4, __pyx_k_paleturquoise4, sizeof(__pyx_k_paleturquoise4), 0, 1, 0, 1}, {&__pyx_n_u_palevioletred, __pyx_k_palevioletred, sizeof(__pyx_k_palevioletred), 0, 1, 0, 1}, {&__pyx_n_u_palevioletred1, __pyx_k_palevioletred1, sizeof(__pyx_k_palevioletred1), 0, 1, 0, 1}, {&__pyx_n_u_palevioletred2, __pyx_k_palevioletred2, sizeof(__pyx_k_palevioletred2), 0, 1, 0, 1}, {&__pyx_n_u_palevioletred3, __pyx_k_palevioletred3, sizeof(__pyx_k_palevioletred3), 0, 1, 0, 1}, {&__pyx_n_u_palevioletred4, __pyx_k_palevioletred4, sizeof(__pyx_k_palevioletred4), 0, 1, 0, 1}, {&__pyx_n_u_papayawhip, __pyx_k_papayawhip, sizeof(__pyx_k_papayawhip), 0, 1, 0, 1}, {&__pyx_n_u_peachpuff, __pyx_k_peachpuff, sizeof(__pyx_k_peachpuff), 0, 1, 0, 1}, {&__pyx_n_u_peachpuff1, __pyx_k_peachpuff1, sizeof(__pyx_k_peachpuff1), 0, 1, 0, 1}, {&__pyx_n_u_peachpuff2, __pyx_k_peachpuff2, sizeof(__pyx_k_peachpuff2), 0, 1, 0, 1}, {&__pyx_n_u_peachpuff3, __pyx_k_peachpuff3, sizeof(__pyx_k_peachpuff3), 0, 1, 0, 1}, {&__pyx_n_u_peachpuff4, __pyx_k_peachpuff4, sizeof(__pyx_k_peachpuff4), 0, 1, 0, 1}, {&__pyx_n_u_peru, __pyx_k_peru, sizeof(__pyx_k_peru), 0, 1, 0, 1}, {&__pyx_n_u_pink, __pyx_k_pink, sizeof(__pyx_k_pink), 0, 1, 0, 1}, {&__pyx_n_u_pink1, __pyx_k_pink1, sizeof(__pyx_k_pink1), 0, 1, 0, 1}, {&__pyx_n_u_pink2, __pyx_k_pink2, sizeof(__pyx_k_pink2), 0, 1, 0, 1}, {&__pyx_n_u_pink3, __pyx_k_pink3, sizeof(__pyx_k_pink3), 0, 1, 0, 1}, {&__pyx_n_u_pink4, __pyx_k_pink4, sizeof(__pyx_k_pink4), 0, 1, 0, 1}, {&__pyx_n_u_plum, __pyx_k_plum, sizeof(__pyx_k_plum), 0, 1, 0, 1}, {&__pyx_n_u_plum1, __pyx_k_plum1, sizeof(__pyx_k_plum1), 0, 1, 0, 1}, {&__pyx_n_u_plum2, __pyx_k_plum2, sizeof(__pyx_k_plum2), 0, 1, 0, 1}, {&__pyx_n_u_plum3, __pyx_k_plum3, sizeof(__pyx_k_plum3), 0, 1, 0, 1}, {&__pyx_n_u_plum4, __pyx_k_plum4, sizeof(__pyx_k_plum4), 0, 1, 0, 1}, {&__pyx_n_u_powderblue, __pyx_k_powderblue, sizeof(__pyx_k_powderblue), 0, 1, 0, 1}, {&__pyx_n_u_purple, __pyx_k_purple, sizeof(__pyx_k_purple), 0, 1, 0, 1}, {&__pyx_n_u_purple1, __pyx_k_purple1, sizeof(__pyx_k_purple1), 0, 1, 0, 1}, {&__pyx_n_u_purple2, __pyx_k_purple2, sizeof(__pyx_k_purple2), 0, 1, 0, 1}, {&__pyx_n_u_purple3, __pyx_k_purple3, sizeof(__pyx_k_purple3), 0, 1, 0, 1}, {&__pyx_n_u_purple4, __pyx_k_purple4, sizeof(__pyx_k_purple4), 0, 1, 0, 1}, {&__pyx_n_s_pygame_sdl2_color, __pyx_k_pygame_sdl2_color, sizeof(__pyx_k_pygame_sdl2_color), 0, 0, 1, 1}, {&__pyx_n_s_pyx_vtable, __pyx_k_pyx_vtable, sizeof(__pyx_k_pyx_vtable), 0, 0, 1, 1}, {&__pyx_n_s_r, __pyx_k_r, sizeof(__pyx_k_r), 0, 0, 1, 1}, {&__pyx_n_u_rebeccapurple, __pyx_k_rebeccapurple, sizeof(__pyx_k_rebeccapurple), 0, 1, 0, 1}, {&__pyx_n_u_red, __pyx_k_red, sizeof(__pyx_k_red), 0, 1, 0, 1}, {&__pyx_n_u_red1, __pyx_k_red1, sizeof(__pyx_k_red1), 0, 1, 0, 1}, {&__pyx_n_u_red2, __pyx_k_red2, sizeof(__pyx_k_red2), 0, 1, 0, 1}, {&__pyx_n_u_red3, __pyx_k_red3, sizeof(__pyx_k_red3), 0, 1, 0, 1}, {&__pyx_n_u_red4, __pyx_k_red4, sizeof(__pyx_k_red4), 0, 1, 0, 1}, {&__pyx_n_u_rgba, __pyx_k_rgba, sizeof(__pyx_k_rgba), 0, 1, 0, 1}, {&__pyx_n_u_rosybrown, __pyx_k_rosybrown, sizeof(__pyx_k_rosybrown), 0, 1, 0, 1}, {&__pyx_n_u_rosybrown1, __pyx_k_rosybrown1, sizeof(__pyx_k_rosybrown1), 0, 1, 0, 1}, {&__pyx_n_u_rosybrown2, __pyx_k_rosybrown2, sizeof(__pyx_k_rosybrown2), 0, 1, 0, 1}, {&__pyx_n_u_rosybrown3, __pyx_k_rosybrown3, sizeof(__pyx_k_rosybrown3), 0, 1, 0, 1}, {&__pyx_n_u_rosybrown4, __pyx_k_rosybrown4, sizeof(__pyx_k_rosybrown4), 0, 1, 0, 1}, {&__pyx_n_s_round, __pyx_k_round, sizeof(__pyx_k_round), 0, 0, 1, 1}, {&__pyx_n_u_royalblue, __pyx_k_royalblue, sizeof(__pyx_k_royalblue), 0, 1, 0, 1}, {&__pyx_n_u_royalblue1, __pyx_k_royalblue1, sizeof(__pyx_k_royalblue1), 0, 1, 0, 1}, {&__pyx_n_u_royalblue2, __pyx_k_royalblue2, sizeof(__pyx_k_royalblue2), 0, 1, 0, 1}, {&__pyx_n_u_royalblue3, __pyx_k_royalblue3, sizeof(__pyx_k_royalblue3), 0, 1, 0, 1}, {&__pyx_n_u_royalblue4, __pyx_k_royalblue4, sizeof(__pyx_k_royalblue4), 0, 1, 0, 1}, {&__pyx_n_u_saddlebrown, __pyx_k_saddlebrown, sizeof(__pyx_k_saddlebrown), 0, 1, 0, 1}, {&__pyx_n_u_salmon, __pyx_k_salmon, sizeof(__pyx_k_salmon), 0, 1, 0, 1}, {&__pyx_n_u_salmon1, __pyx_k_salmon1, sizeof(__pyx_k_salmon1), 0, 1, 0, 1}, {&__pyx_n_u_salmon2, __pyx_k_salmon2, sizeof(__pyx_k_salmon2), 0, 1, 0, 1}, {&__pyx_n_u_salmon3, __pyx_k_salmon3, sizeof(__pyx_k_salmon3), 0, 1, 0, 1}, {&__pyx_n_u_salmon4, __pyx_k_salmon4, sizeof(__pyx_k_salmon4), 0, 1, 0, 1}, {&__pyx_n_u_sandybrown, __pyx_k_sandybrown, sizeof(__pyx_k_sandybrown), 0, 1, 0, 1}, {&__pyx_n_u_seagreen, __pyx_k_seagreen, sizeof(__pyx_k_seagreen), 0, 1, 0, 1}, {&__pyx_n_u_seagreen1, __pyx_k_seagreen1, sizeof(__pyx_k_seagreen1), 0, 1, 0, 1}, {&__pyx_n_u_seagreen2, __pyx_k_seagreen2, sizeof(__pyx_k_seagreen2), 0, 1, 0, 1}, {&__pyx_n_u_seagreen3, __pyx_k_seagreen3, sizeof(__pyx_k_seagreen3), 0, 1, 0, 1}, {&__pyx_n_u_seagreen4, __pyx_k_seagreen4, sizeof(__pyx_k_seagreen4), 0, 1, 0, 1}, {&__pyx_n_u_seashell, __pyx_k_seashell, sizeof(__pyx_k_seashell), 0, 1, 0, 1}, {&__pyx_n_u_seashell1, __pyx_k_seashell1, sizeof(__pyx_k_seashell1), 0, 1, 0, 1}, {&__pyx_n_u_seashell2, __pyx_k_seashell2, sizeof(__pyx_k_seashell2), 0, 1, 0, 1}, {&__pyx_n_u_seashell3, __pyx_k_seashell3, sizeof(__pyx_k_seashell3), 0, 1, 0, 1}, {&__pyx_n_u_seashell4, __pyx_k_seashell4, sizeof(__pyx_k_seashell4), 0, 1, 0, 1}, {&__pyx_n_u_sienna, __pyx_k_sienna, sizeof(__pyx_k_sienna), 0, 1, 0, 1}, {&__pyx_n_u_sienna1, __pyx_k_sienna1, sizeof(__pyx_k_sienna1), 0, 1, 0, 1}, {&__pyx_n_u_sienna2, __pyx_k_sienna2, sizeof(__pyx_k_sienna2), 0, 1, 0, 1}, {&__pyx_n_u_sienna3, __pyx_k_sienna3, sizeof(__pyx_k_sienna3), 0, 1, 0, 1}, {&__pyx_n_u_sienna4, __pyx_k_sienna4, sizeof(__pyx_k_sienna4), 0, 1, 0, 1}, {&__pyx_n_u_silver, __pyx_k_silver, sizeof(__pyx_k_silver), 0, 1, 0, 1}, {&__pyx_n_u_skyblue, __pyx_k_skyblue, sizeof(__pyx_k_skyblue), 0, 1, 0, 1}, {&__pyx_n_u_skyblue1, __pyx_k_skyblue1, sizeof(__pyx_k_skyblue1), 0, 1, 0, 1}, {&__pyx_n_u_skyblue2, __pyx_k_skyblue2, sizeof(__pyx_k_skyblue2), 0, 1, 0, 1}, {&__pyx_n_u_skyblue3, __pyx_k_skyblue3, sizeof(__pyx_k_skyblue3), 0, 1, 0, 1}, {&__pyx_n_u_skyblue4, __pyx_k_skyblue4, sizeof(__pyx_k_skyblue4), 0, 1, 0, 1}, {&__pyx_n_u_slateblue, __pyx_k_slateblue, sizeof(__pyx_k_slateblue), 0, 1, 0, 1}, {&__pyx_n_u_slateblue1, __pyx_k_slateblue1, sizeof(__pyx_k_slateblue1), 0, 1, 0, 1}, {&__pyx_n_u_slateblue2, __pyx_k_slateblue2, sizeof(__pyx_k_slateblue2), 0, 1, 0, 1}, {&__pyx_n_u_slateblue3, __pyx_k_slateblue3, sizeof(__pyx_k_slateblue3), 0, 1, 0, 1}, {&__pyx_n_u_slateblue4, __pyx_k_slateblue4, sizeof(__pyx_k_slateblue4), 0, 1, 0, 1}, {&__pyx_n_u_slategray, __pyx_k_slategray, sizeof(__pyx_k_slategray), 0, 1, 0, 1}, {&__pyx_n_u_slategray1, __pyx_k_slategray1, sizeof(__pyx_k_slategray1), 0, 1, 0, 1}, {&__pyx_n_u_slategray2, __pyx_k_slategray2, sizeof(__pyx_k_slategray2), 0, 1, 0, 1}, {&__pyx_n_u_slategray3, __pyx_k_slategray3, sizeof(__pyx_k_slategray3), 0, 1, 0, 1}, {&__pyx_n_u_slategray4, __pyx_k_slategray4, sizeof(__pyx_k_slategray4), 0, 1, 0, 1}, {&__pyx_n_u_slategrey, __pyx_k_slategrey, sizeof(__pyx_k_slategrey), 0, 1, 0, 1}, {&__pyx_n_u_snow, __pyx_k_snow, sizeof(__pyx_k_snow), 0, 1, 0, 1}, {&__pyx_n_u_snow1, __pyx_k_snow1, sizeof(__pyx_k_snow1), 0, 1, 0, 1}, {&__pyx_n_u_snow2, __pyx_k_snow2, sizeof(__pyx_k_snow2), 0, 1, 0, 1}, {&__pyx_n_u_snow3, __pyx_k_snow3, sizeof(__pyx_k_snow3), 0, 1, 0, 1}, {&__pyx_n_u_snow4, __pyx_k_snow4, sizeof(__pyx_k_snow4), 0, 1, 0, 1}, {&__pyx_n_s_split, __pyx_k_split, sizeof(__pyx_k_split), 0, 0, 1, 1}, {&__pyx_n_u_springgreen, __pyx_k_springgreen, sizeof(__pyx_k_springgreen), 0, 1, 0, 1}, {&__pyx_n_u_springgreen1, __pyx_k_springgreen1, sizeof(__pyx_k_springgreen1), 0, 1, 0, 1}, {&__pyx_n_u_springgreen2, __pyx_k_springgreen2, sizeof(__pyx_k_springgreen2), 0, 1, 0, 1}, {&__pyx_n_u_springgreen3, __pyx_k_springgreen3, sizeof(__pyx_k_springgreen3), 0, 1, 0, 1}, {&__pyx_n_u_springgreen4, __pyx_k_springgreen4, sizeof(__pyx_k_springgreen4), 0, 1, 0, 1}, {&__pyx_n_s_startswith, __pyx_k_startswith, sizeof(__pyx_k_startswith), 0, 0, 1, 1}, {&__pyx_n_u_steelblue, __pyx_k_steelblue, sizeof(__pyx_k_steelblue), 0, 1, 0, 1}, {&__pyx_n_u_steelblue1, __pyx_k_steelblue1, sizeof(__pyx_k_steelblue1), 0, 1, 0, 1}, {&__pyx_n_u_steelblue2, __pyx_k_steelblue2, sizeof(__pyx_k_steelblue2), 0, 1, 0, 1}, {&__pyx_n_u_steelblue3, __pyx_k_steelblue3, sizeof(__pyx_k_steelblue3), 0, 1, 0, 1}, {&__pyx_n_u_steelblue4, __pyx_k_steelblue4, sizeof(__pyx_k_steelblue4), 0, 1, 0, 1}, {&__pyx_n_s_struct, __pyx_k_struct, sizeof(__pyx_k_struct), 0, 0, 1, 1}, {&__pyx_n_u_tan, __pyx_k_tan, sizeof(__pyx_k_tan), 0, 1, 0, 1}, {&__pyx_n_u_tan1, __pyx_k_tan1, sizeof(__pyx_k_tan1), 0, 1, 0, 1}, {&__pyx_n_u_tan2, __pyx_k_tan2, sizeof(__pyx_k_tan2), 0, 1, 0, 1}, {&__pyx_n_u_tan3, __pyx_k_tan3, sizeof(__pyx_k_tan3), 0, 1, 0, 1}, {&__pyx_n_u_tan4, __pyx_k_tan4, sizeof(__pyx_k_tan4), 0, 1, 0, 1}, {&__pyx_n_u_teal, __pyx_k_teal, sizeof(__pyx_k_teal), 0, 1, 0, 1}, {&__pyx_n_s_test, __pyx_k_test, sizeof(__pyx_k_test), 0, 0, 1, 1}, {&__pyx_n_u_thistle, __pyx_k_thistle, sizeof(__pyx_k_thistle), 0, 1, 0, 1}, {&__pyx_n_u_thistle1, __pyx_k_thistle1, sizeof(__pyx_k_thistle1), 0, 1, 0, 1}, {&__pyx_n_u_thistle2, __pyx_k_thistle2, sizeof(__pyx_k_thistle2), 0, 1, 0, 1}, {&__pyx_n_u_thistle3, __pyx_k_thistle3, sizeof(__pyx_k_thistle3), 0, 1, 0, 1}, {&__pyx_n_u_thistle4, __pyx_k_thistle4, sizeof(__pyx_k_thistle4), 0, 1, 0, 1}, {&__pyx_n_u_tomato, __pyx_k_tomato, sizeof(__pyx_k_tomato), 0, 1, 0, 1}, {&__pyx_n_u_tomato1, __pyx_k_tomato1, sizeof(__pyx_k_tomato1), 0, 1, 0, 1}, {&__pyx_n_u_tomato2, __pyx_k_tomato2, sizeof(__pyx_k_tomato2), 0, 1, 0, 1}, {&__pyx_n_u_tomato3, __pyx_k_tomato3, sizeof(__pyx_k_tomato3), 0, 1, 0, 1}, {&__pyx_n_u_tomato4, __pyx_k_tomato4, sizeof(__pyx_k_tomato4), 0, 1, 0, 1}, {&__pyx_n_u_turquoise, __pyx_k_turquoise, sizeof(__pyx_k_turquoise), 0, 1, 0, 1}, {&__pyx_n_u_turquoise1, __pyx_k_turquoise1, sizeof(__pyx_k_turquoise1), 0, 1, 0, 1}, {&__pyx_n_u_turquoise2, __pyx_k_turquoise2, sizeof(__pyx_k_turquoise2), 0, 1, 0, 1}, {&__pyx_n_u_turquoise3, __pyx_k_turquoise3, sizeof(__pyx_k_turquoise3), 0, 1, 0, 1}, {&__pyx_n_u_turquoise4, __pyx_k_turquoise4, sizeof(__pyx_k_turquoise4), 0, 1, 0, 1}, {&__pyx_n_s_unhexlify, __pyx_k_unhexlify, sizeof(__pyx_k_unhexlify), 0, 0, 1, 1}, {&__pyx_n_s_unpack, __pyx_k_unpack, sizeof(__pyx_k_unpack), 0, 0, 1, 1}, {&__pyx_n_u_violet, __pyx_k_violet, sizeof(__pyx_k_violet), 0, 1, 0, 1}, {&__pyx_n_u_violetred, __pyx_k_violetred, sizeof(__pyx_k_violetred), 0, 1, 0, 1}, {&__pyx_n_u_violetred1, __pyx_k_violetred1, sizeof(__pyx_k_violetred1), 0, 1, 0, 1}, {&__pyx_n_u_violetred2, __pyx_k_violetred2, sizeof(__pyx_k_violetred2), 0, 1, 0, 1}, {&__pyx_n_u_violetred3, __pyx_k_violetred3, sizeof(__pyx_k_violetred3), 0, 1, 0, 1}, {&__pyx_n_u_violetred4, __pyx_k_violetred4, sizeof(__pyx_k_violetred4), 0, 1, 0, 1}, {&__pyx_n_u_webgray, __pyx_k_webgray, sizeof(__pyx_k_webgray), 0, 1, 0, 1}, {&__pyx_n_u_webgreen, __pyx_k_webgreen, sizeof(__pyx_k_webgreen), 0, 1, 0, 1}, {&__pyx_n_u_webgrey, __pyx_k_webgrey, sizeof(__pyx_k_webgrey), 0, 1, 0, 1}, {&__pyx_n_u_webmaroon, __pyx_k_webmaroon, sizeof(__pyx_k_webmaroon), 0, 1, 0, 1}, {&__pyx_n_u_webpurple, __pyx_k_webpurple, sizeof(__pyx_k_webpurple), 0, 1, 0, 1}, {&__pyx_n_u_wheat, __pyx_k_wheat, sizeof(__pyx_k_wheat), 0, 1, 0, 1}, {&__pyx_n_u_wheat1, __pyx_k_wheat1, sizeof(__pyx_k_wheat1), 0, 1, 0, 1}, {&__pyx_n_u_wheat2, __pyx_k_wheat2, sizeof(__pyx_k_wheat2), 0, 1, 0, 1}, {&__pyx_n_u_wheat3, __pyx_k_wheat3, sizeof(__pyx_k_wheat3), 0, 1, 0, 1}, {&__pyx_n_u_wheat4, __pyx_k_wheat4, sizeof(__pyx_k_wheat4), 0, 1, 0, 1}, {&__pyx_n_u_white, __pyx_k_white, sizeof(__pyx_k_white), 0, 1, 0, 1}, {&__pyx_n_u_whitesmoke, __pyx_k_whitesmoke, sizeof(__pyx_k_whitesmoke), 0, 1, 0, 1}, {&__pyx_n_u_x11gray, __pyx_k_x11gray, sizeof(__pyx_k_x11gray), 0, 1, 0, 1}, {&__pyx_n_u_x11green, __pyx_k_x11green, sizeof(__pyx_k_x11green), 0, 1, 0, 1}, {&__pyx_n_u_x11grey, __pyx_k_x11grey, sizeof(__pyx_k_x11grey), 0, 1, 0, 1}, {&__pyx_n_u_x11maroon, __pyx_k_x11maroon, sizeof(__pyx_k_x11maroon), 0, 1, 0, 1}, {&__pyx_n_u_x11purple, __pyx_k_x11purple, sizeof(__pyx_k_x11purple), 0, 1, 0, 1}, {&__pyx_n_u_yellow, __pyx_k_yellow, sizeof(__pyx_k_yellow), 0, 1, 0, 1}, {&__pyx_n_u_yellow1, __pyx_k_yellow1, sizeof(__pyx_k_yellow1), 0, 1, 0, 1}, {&__pyx_n_u_yellow2, __pyx_k_yellow2, sizeof(__pyx_k_yellow2), 0, 1, 0, 1}, {&__pyx_n_u_yellow3, __pyx_k_yellow3, sizeof(__pyx_k_yellow3), 0, 1, 0, 1}, {&__pyx_n_u_yellow4, __pyx_k_yellow4, sizeof(__pyx_k_yellow4), 0, 1, 0, 1}, {&__pyx_n_u_yellowgreen, __pyx_k_yellowgreen, sizeof(__pyx_k_yellowgreen), 0, 1, 0, 1}, {0, 0, 0, 0, 0, 0, 0} }; static int __Pyx_InitCachedBuiltins(void) { __pyx_builtin_TypeError = __Pyx_GetBuiltinName(__pyx_n_s_TypeError); if (!__pyx_builtin_TypeError) __PYX_ERR(0, 41, __pyx_L1_error) __pyx_builtin_map = __Pyx_GetBuiltinName(__pyx_n_s_map); if (!__pyx_builtin_map) __PYX_ERR(0, 73, __pyx_L1_error) __pyx_builtin_ValueError = __Pyx_GetBuiltinName(__pyx_n_s_ValueError); if (!__pyx_builtin_ValueError) __PYX_ERR(0, 82, __pyx_L1_error) __pyx_builtin_KeyError = __Pyx_GetBuiltinName(__pyx_n_s_KeyError); if (!__pyx_builtin_KeyError) __PYX_ERR(0, 94, __pyx_L1_error) __pyx_builtin_hex = __Pyx_GetBuiltinName(__pyx_n_s_hex); if (!__pyx_builtin_hex) __PYX_ERR(0, 153, __pyx_L1_error) __pyx_builtin_oct = __Pyx_GetBuiltinName(__pyx_n_s_oct); if (!__pyx_builtin_oct) __PYX_ERR(0, 156, __pyx_L1_error) __pyx_builtin_IndexError = __Pyx_GetBuiltinName(__pyx_n_s_IndexError); if (!__pyx_builtin_IndexError) __PYX_ERR(0, 173, __pyx_L1_error) __pyx_builtin_round = __Pyx_GetBuiltinName(__pyx_n_s_round); if (!__pyx_builtin_round) __PYX_ERR(0, 453, __pyx_L1_error) return 0; __pyx_L1_error:; return -1; } static int __Pyx_InitCachedConstants(void) { __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__Pyx_InitCachedConstants", 0); /* "pygame_sdl2/color.pyx":41 * return color * else: * raise TypeError("Expected a color.") # <<<<<<<<<<<<<< * * return SDL_MapRGBA(surface.format, r, g, b, a) */ __pyx_tuple_ = PyTuple_Pack(1, __pyx_kp_u_Expected_a_color); if (unlikely(!__pyx_tuple_)) __PYX_ERR(0, 41, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple_); __Pyx_GIVEREF(__pyx_tuple_); /* "pygame_sdl2/color.pyx":122 * c = args[0] * if isinstance(c, basestring): * if c.startswith('#'): # <<<<<<<<<<<<<< * self.from_hex(c[1:]) * elif c.startswith('0x'): */ __pyx_tuple__4 = PyTuple_Pack(1, __pyx_kp_u__3); if (unlikely(!__pyx_tuple__4)) __PYX_ERR(0, 122, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__4); __Pyx_GIVEREF(__pyx_tuple__4); /* "pygame_sdl2/color.pyx":123 * if isinstance(c, basestring): * if c.startswith('#'): * self.from_hex(c[1:]) # <<<<<<<<<<<<<< * elif c.startswith('0x'): * self.from_hex(c[2:]) */ __pyx_slice__5 = PySlice_New(__pyx_int_1, Py_None, Py_None); if (unlikely(!__pyx_slice__5)) __PYX_ERR(0, 123, __pyx_L1_error) __Pyx_GOTREF(__pyx_slice__5); __Pyx_GIVEREF(__pyx_slice__5); /* "pygame_sdl2/color.pyx":124 * if c.startswith('#'): * self.from_hex(c[1:]) * elif c.startswith('0x'): # <<<<<<<<<<<<<< * self.from_hex(c[2:]) * else: */ __pyx_tuple__6 = PyTuple_Pack(1, __pyx_kp_u_0x); if (unlikely(!__pyx_tuple__6)) __PYX_ERR(0, 124, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__6); __Pyx_GIVEREF(__pyx_tuple__6); /* "pygame_sdl2/color.pyx":125 * self.from_hex(c[1:]) * elif c.startswith('0x'): * self.from_hex(c[2:]) # <<<<<<<<<<<<<< * else: * self.from_name(c) */ __pyx_slice__7 = PySlice_New(__pyx_int_2, Py_None, Py_None); if (unlikely(!__pyx_slice__7)) __PYX_ERR(0, 125, __pyx_L1_error) __Pyx_GOTREF(__pyx_slice__7); __Pyx_GIVEREF(__pyx_slice__7); /* "pygame_sdl2/color.pyx":228 * def __mod__(self not None, Color rhs not None): * * def mod(l, r): # <<<<<<<<<<<<<< * if r == 0: * return 0 */ __pyx_tuple__8 = PyTuple_Pack(2, __pyx_n_s_l, __pyx_n_s_r); if (unlikely(!__pyx_tuple__8)) __PYX_ERR(0, 228, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__8); __Pyx_GIVEREF(__pyx_tuple__8); __pyx_codeobj__9 = (PyObject*)__Pyx_PyCode_New(2, 0, 2, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__8, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_tom_ab_pygame_sdl2_src_pyg, __pyx_n_s_mod, 228, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__9)) __PYX_ERR(0, 228, __pyx_L1_error) /* "pygame_sdl2/color.pyx":251 * def __floordiv__(self not None, Color rhs not None): * * def div(a, b): # <<<<<<<<<<<<<< * if b == 0: * return b */ __pyx_tuple__10 = PyTuple_Pack(2, __pyx_n_s_a, __pyx_n_s_b); if (unlikely(!__pyx_tuple__10)) __PYX_ERR(0, 251, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__10); __Pyx_GIVEREF(__pyx_tuple__10); __pyx_codeobj__11 = (PyObject*)__Pyx_PyCode_New(2, 0, 2, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__10, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_tom_ab_pygame_sdl2_src_pyg, __pyx_n_s_div, 251, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__11)) __PYX_ERR(0, 251, __pyx_L1_error) /* "include/color_dict.pxi":5 * * cdef object colors = { * 'aliceblue' : (240, 248, 255), # <<<<<<<<<<<<<< * 'antiquewhite' : (250, 235, 215), * 'antiquewhite1' : (255, 239, 219), */ __pyx_tuple__12 = PyTuple_Pack(3, __pyx_int_240, __pyx_int_248, __pyx_int_255); if (unlikely(!__pyx_tuple__12)) __PYX_ERR(2, 5, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__12); __Pyx_GIVEREF(__pyx_tuple__12); /* "include/color_dict.pxi":6 * cdef object colors = { * 'aliceblue' : (240, 248, 255), * 'antiquewhite' : (250, 235, 215), # <<<<<<<<<<<<<< * 'antiquewhite1' : (255, 239, 219), * 'antiquewhite2' : (238, 223, 204), */ __pyx_tuple__13 = PyTuple_Pack(3, __pyx_int_250, __pyx_int_235, __pyx_int_215); if (unlikely(!__pyx_tuple__13)) __PYX_ERR(2, 6, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__13); __Pyx_GIVEREF(__pyx_tuple__13); /* "include/color_dict.pxi":7 * 'aliceblue' : (240, 248, 255), * 'antiquewhite' : (250, 235, 215), * 'antiquewhite1' : (255, 239, 219), # <<<<<<<<<<<<<< * 'antiquewhite2' : (238, 223, 204), * 'antiquewhite3' : (205, 192, 176), */ __pyx_tuple__14 = PyTuple_Pack(3, __pyx_int_255, __pyx_int_239, __pyx_int_219); if (unlikely(!__pyx_tuple__14)) __PYX_ERR(2, 7, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__14); __Pyx_GIVEREF(__pyx_tuple__14); /* "include/color_dict.pxi":8 * 'antiquewhite' : (250, 235, 215), * 'antiquewhite1' : (255, 239, 219), * 'antiquewhite2' : (238, 223, 204), # <<<<<<<<<<<<<< * 'antiquewhite3' : (205, 192, 176), * 'antiquewhite4' : (139, 131, 120), */ __pyx_tuple__15 = PyTuple_Pack(3, __pyx_int_238, __pyx_int_223, __pyx_int_204); if (unlikely(!__pyx_tuple__15)) __PYX_ERR(2, 8, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__15); __Pyx_GIVEREF(__pyx_tuple__15); /* "include/color_dict.pxi":9 * 'antiquewhite1' : (255, 239, 219), * 'antiquewhite2' : (238, 223, 204), * 'antiquewhite3' : (205, 192, 176), # <<<<<<<<<<<<<< * 'antiquewhite4' : (139, 131, 120), * 'aqua' : (0, 255, 255), */ __pyx_tuple__16 = PyTuple_Pack(3, __pyx_int_205, __pyx_int_192, __pyx_int_176); if (unlikely(!__pyx_tuple__16)) __PYX_ERR(2, 9, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__16); __Pyx_GIVEREF(__pyx_tuple__16); /* "include/color_dict.pxi":10 * 'antiquewhite2' : (238, 223, 204), * 'antiquewhite3' : (205, 192, 176), * 'antiquewhite4' : (139, 131, 120), # <<<<<<<<<<<<<< * 'aqua' : (0, 255, 255), * 'aquamarine' : (127, 255, 212), */ __pyx_tuple__17 = PyTuple_Pack(3, __pyx_int_139, __pyx_int_131, __pyx_int_120); if (unlikely(!__pyx_tuple__17)) __PYX_ERR(2, 10, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__17); __Pyx_GIVEREF(__pyx_tuple__17); /* "include/color_dict.pxi":11 * 'antiquewhite3' : (205, 192, 176), * 'antiquewhite4' : (139, 131, 120), * 'aqua' : (0, 255, 255), # <<<<<<<<<<<<<< * 'aquamarine' : (127, 255, 212), * 'aquamarine1' : (127, 255, 212), */ __pyx_tuple__18 = PyTuple_Pack(3, __pyx_int_0, __pyx_int_255, __pyx_int_255); if (unlikely(!__pyx_tuple__18)) __PYX_ERR(2, 11, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__18); __Pyx_GIVEREF(__pyx_tuple__18); /* "include/color_dict.pxi":12 * 'antiquewhite4' : (139, 131, 120), * 'aqua' : (0, 255, 255), * 'aquamarine' : (127, 255, 212), # <<<<<<<<<<<<<< * 'aquamarine1' : (127, 255, 212), * 'aquamarine2' : (118, 238, 198), */ __pyx_tuple__19 = PyTuple_Pack(3, __pyx_int_127, __pyx_int_255, __pyx_int_212); if (unlikely(!__pyx_tuple__19)) __PYX_ERR(2, 12, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__19); __Pyx_GIVEREF(__pyx_tuple__19); /* "include/color_dict.pxi":13 * 'aqua' : (0, 255, 255), * 'aquamarine' : (127, 255, 212), * 'aquamarine1' : (127, 255, 212), # <<<<<<<<<<<<<< * 'aquamarine2' : (118, 238, 198), * 'aquamarine3' : (102, 205, 170), */ __pyx_tuple__20 = PyTuple_Pack(3, __pyx_int_127, __pyx_int_255, __pyx_int_212); if (unlikely(!__pyx_tuple__20)) __PYX_ERR(2, 13, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__20); __Pyx_GIVEREF(__pyx_tuple__20); /* "include/color_dict.pxi":14 * 'aquamarine' : (127, 255, 212), * 'aquamarine1' : (127, 255, 212), * 'aquamarine2' : (118, 238, 198), # <<<<<<<<<<<<<< * 'aquamarine3' : (102, 205, 170), * 'aquamarine4' : (69, 139, 116), */ __pyx_tuple__21 = PyTuple_Pack(3, __pyx_int_118, __pyx_int_238, __pyx_int_198); if (unlikely(!__pyx_tuple__21)) __PYX_ERR(2, 14, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__21); __Pyx_GIVEREF(__pyx_tuple__21); /* "include/color_dict.pxi":15 * 'aquamarine1' : (127, 255, 212), * 'aquamarine2' : (118, 238, 198), * 'aquamarine3' : (102, 205, 170), # <<<<<<<<<<<<<< * 'aquamarine4' : (69, 139, 116), * 'azure' : (240, 255, 255), */ __pyx_tuple__22 = PyTuple_Pack(3, __pyx_int_102, __pyx_int_205, __pyx_int_170); if (unlikely(!__pyx_tuple__22)) __PYX_ERR(2, 15, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__22); __Pyx_GIVEREF(__pyx_tuple__22); /* "include/color_dict.pxi":16 * 'aquamarine2' : (118, 238, 198), * 'aquamarine3' : (102, 205, 170), * 'aquamarine4' : (69, 139, 116), # <<<<<<<<<<<<<< * 'azure' : (240, 255, 255), * 'azure1' : (240, 255, 255), */ __pyx_tuple__23 = PyTuple_Pack(3, __pyx_int_69, __pyx_int_139, __pyx_int_116); if (unlikely(!__pyx_tuple__23)) __PYX_ERR(2, 16, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__23); __Pyx_GIVEREF(__pyx_tuple__23); /* "include/color_dict.pxi":17 * 'aquamarine3' : (102, 205, 170), * 'aquamarine4' : (69, 139, 116), * 'azure' : (240, 255, 255), # <<<<<<<<<<<<<< * 'azure1' : (240, 255, 255), * 'azure2' : (224, 238, 238), */ __pyx_tuple__24 = PyTuple_Pack(3, __pyx_int_240, __pyx_int_255, __pyx_int_255); if (unlikely(!__pyx_tuple__24)) __PYX_ERR(2, 17, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__24); __Pyx_GIVEREF(__pyx_tuple__24); /* "include/color_dict.pxi":18 * 'aquamarine4' : (69, 139, 116), * 'azure' : (240, 255, 255), * 'azure1' : (240, 255, 255), # <<<<<<<<<<<<<< * 'azure2' : (224, 238, 238), * 'azure3' : (193, 205, 205), */ __pyx_tuple__25 = PyTuple_Pack(3, __pyx_int_240, __pyx_int_255, __pyx_int_255); if (unlikely(!__pyx_tuple__25)) __PYX_ERR(2, 18, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__25); __Pyx_GIVEREF(__pyx_tuple__25); /* "include/color_dict.pxi":19 * 'azure' : (240, 255, 255), * 'azure1' : (240, 255, 255), * 'azure2' : (224, 238, 238), # <<<<<<<<<<<<<< * 'azure3' : (193, 205, 205), * 'azure4' : (131, 139, 139), */ __pyx_tuple__26 = PyTuple_Pack(3, __pyx_int_224, __pyx_int_238, __pyx_int_238); if (unlikely(!__pyx_tuple__26)) __PYX_ERR(2, 19, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__26); __Pyx_GIVEREF(__pyx_tuple__26); /* "include/color_dict.pxi":20 * 'azure1' : (240, 255, 255), * 'azure2' : (224, 238, 238), * 'azure3' : (193, 205, 205), # <<<<<<<<<<<<<< * 'azure4' : (131, 139, 139), * 'beige' : (245, 245, 220), */ __pyx_tuple__27 = PyTuple_Pack(3, __pyx_int_193, __pyx_int_205, __pyx_int_205); if (unlikely(!__pyx_tuple__27)) __PYX_ERR(2, 20, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__27); __Pyx_GIVEREF(__pyx_tuple__27); /* "include/color_dict.pxi":21 * 'azure2' : (224, 238, 238), * 'azure3' : (193, 205, 205), * 'azure4' : (131, 139, 139), # <<<<<<<<<<<<<< * 'beige' : (245, 245, 220), * 'bisque' : (255, 228, 196), */ __pyx_tuple__28 = PyTuple_Pack(3, __pyx_int_131, __pyx_int_139, __pyx_int_139); if (unlikely(!__pyx_tuple__28)) __PYX_ERR(2, 21, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__28); __Pyx_GIVEREF(__pyx_tuple__28); /* "include/color_dict.pxi":22 * 'azure3' : (193, 205, 205), * 'azure4' : (131, 139, 139), * 'beige' : (245, 245, 220), # <<<<<<<<<<<<<< * 'bisque' : (255, 228, 196), * 'bisque1' : (255, 228, 196), */ __pyx_tuple__29 = PyTuple_Pack(3, __pyx_int_245, __pyx_int_245, __pyx_int_220); if (unlikely(!__pyx_tuple__29)) __PYX_ERR(2, 22, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__29); __Pyx_GIVEREF(__pyx_tuple__29); /* "include/color_dict.pxi":23 * 'azure4' : (131, 139, 139), * 'beige' : (245, 245, 220), * 'bisque' : (255, 228, 196), # <<<<<<<<<<<<<< * 'bisque1' : (255, 228, 196), * 'bisque2' : (238, 213, 183), */ __pyx_tuple__30 = PyTuple_Pack(3, __pyx_int_255, __pyx_int_228, __pyx_int_196); if (unlikely(!__pyx_tuple__30)) __PYX_ERR(2, 23, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__30); __Pyx_GIVEREF(__pyx_tuple__30); /* "include/color_dict.pxi":24 * 'beige' : (245, 245, 220), * 'bisque' : (255, 228, 196), * 'bisque1' : (255, 228, 196), # <<<<<<<<<<<<<< * 'bisque2' : (238, 213, 183), * 'bisque3' : (205, 183, 158), */ __pyx_tuple__31 = PyTuple_Pack(3, __pyx_int_255, __pyx_int_228, __pyx_int_196); if (unlikely(!__pyx_tuple__31)) __PYX_ERR(2, 24, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__31); __Pyx_GIVEREF(__pyx_tuple__31); /* "include/color_dict.pxi":25 * 'bisque' : (255, 228, 196), * 'bisque1' : (255, 228, 196), * 'bisque2' : (238, 213, 183), # <<<<<<<<<<<<<< * 'bisque3' : (205, 183, 158), * 'bisque4' : (139, 125, 107), */ __pyx_tuple__32 = PyTuple_Pack(3, __pyx_int_238, __pyx_int_213, __pyx_int_183); if (unlikely(!__pyx_tuple__32)) __PYX_ERR(2, 25, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__32); __Pyx_GIVEREF(__pyx_tuple__32); /* "include/color_dict.pxi":26 * 'bisque1' : (255, 228, 196), * 'bisque2' : (238, 213, 183), * 'bisque3' : (205, 183, 158), # <<<<<<<<<<<<<< * 'bisque4' : (139, 125, 107), * 'black' : (0, 0, 0), */ __pyx_tuple__33 = PyTuple_Pack(3, __pyx_int_205, __pyx_int_183, __pyx_int_158); if (unlikely(!__pyx_tuple__33)) __PYX_ERR(2, 26, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__33); __Pyx_GIVEREF(__pyx_tuple__33); /* "include/color_dict.pxi":27 * 'bisque2' : (238, 213, 183), * 'bisque3' : (205, 183, 158), * 'bisque4' : (139, 125, 107), # <<<<<<<<<<<<<< * 'black' : (0, 0, 0), * 'blanchedalmond' : (255, 235, 205), */ __pyx_tuple__34 = PyTuple_Pack(3, __pyx_int_139, __pyx_int_125, __pyx_int_107); if (unlikely(!__pyx_tuple__34)) __PYX_ERR(2, 27, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__34); __Pyx_GIVEREF(__pyx_tuple__34); /* "include/color_dict.pxi":28 * 'bisque3' : (205, 183, 158), * 'bisque4' : (139, 125, 107), * 'black' : (0, 0, 0), # <<<<<<<<<<<<<< * 'blanchedalmond' : (255, 235, 205), * 'blue' : (0, 0, 255), */ __pyx_tuple__35 = PyTuple_Pack(3, __pyx_int_0, __pyx_int_0, __pyx_int_0); if (unlikely(!__pyx_tuple__35)) __PYX_ERR(2, 28, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__35); __Pyx_GIVEREF(__pyx_tuple__35); /* "include/color_dict.pxi":29 * 'bisque4' : (139, 125, 107), * 'black' : (0, 0, 0), * 'blanchedalmond' : (255, 235, 205), # <<<<<<<<<<<<<< * 'blue' : (0, 0, 255), * 'blue1' : (0, 0, 255), */ __pyx_tuple__36 = PyTuple_Pack(3, __pyx_int_255, __pyx_int_235, __pyx_int_205); if (unlikely(!__pyx_tuple__36)) __PYX_ERR(2, 29, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__36); __Pyx_GIVEREF(__pyx_tuple__36); /* "include/color_dict.pxi":30 * 'black' : (0, 0, 0), * 'blanchedalmond' : (255, 235, 205), * 'blue' : (0, 0, 255), # <<<<<<<<<<<<<< * 'blue1' : (0, 0, 255), * 'blue2' : (0, 0, 238), */ __pyx_tuple__37 = PyTuple_Pack(3, __pyx_int_0, __pyx_int_0, __pyx_int_255); if (unlikely(!__pyx_tuple__37)) __PYX_ERR(2, 30, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__37); __Pyx_GIVEREF(__pyx_tuple__37); /* "include/color_dict.pxi":31 * 'blanchedalmond' : (255, 235, 205), * 'blue' : (0, 0, 255), * 'blue1' : (0, 0, 255), # <<<<<<<<<<<<<< * 'blue2' : (0, 0, 238), * 'blue3' : (0, 0, 205), */ __pyx_tuple__38 = PyTuple_Pack(3, __pyx_int_0, __pyx_int_0, __pyx_int_255); if (unlikely(!__pyx_tuple__38)) __PYX_ERR(2, 31, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__38); __Pyx_GIVEREF(__pyx_tuple__38); /* "include/color_dict.pxi":32 * 'blue' : (0, 0, 255), * 'blue1' : (0, 0, 255), * 'blue2' : (0, 0, 238), # <<<<<<<<<<<<<< * 'blue3' : (0, 0, 205), * 'blue4' : (0, 0, 139), */ __pyx_tuple__39 = PyTuple_Pack(3, __pyx_int_0, __pyx_int_0, __pyx_int_238); if (unlikely(!__pyx_tuple__39)) __PYX_ERR(2, 32, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__39); __Pyx_GIVEREF(__pyx_tuple__39); /* "include/color_dict.pxi":33 * 'blue1' : (0, 0, 255), * 'blue2' : (0, 0, 238), * 'blue3' : (0, 0, 205), # <<<<<<<<<<<<<< * 'blue4' : (0, 0, 139), * 'blueviolet' : (138, 43, 226), */ __pyx_tuple__40 = PyTuple_Pack(3, __pyx_int_0, __pyx_int_0, __pyx_int_205); if (unlikely(!__pyx_tuple__40)) __PYX_ERR(2, 33, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__40); __Pyx_GIVEREF(__pyx_tuple__40); /* "include/color_dict.pxi":34 * 'blue2' : (0, 0, 238), * 'blue3' : (0, 0, 205), * 'blue4' : (0, 0, 139), # <<<<<<<<<<<<<< * 'blueviolet' : (138, 43, 226), * 'brown' : (165, 42, 42), */ __pyx_tuple__41 = PyTuple_Pack(3, __pyx_int_0, __pyx_int_0, __pyx_int_139); if (unlikely(!__pyx_tuple__41)) __PYX_ERR(2, 34, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__41); __Pyx_GIVEREF(__pyx_tuple__41); /* "include/color_dict.pxi":35 * 'blue3' : (0, 0, 205), * 'blue4' : (0, 0, 139), * 'blueviolet' : (138, 43, 226), # <<<<<<<<<<<<<< * 'brown' : (165, 42, 42), * 'brown1' : (255, 64, 64), */ __pyx_tuple__42 = PyTuple_Pack(3, __pyx_int_138, __pyx_int_43, __pyx_int_226); if (unlikely(!__pyx_tuple__42)) __PYX_ERR(2, 35, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__42); __Pyx_GIVEREF(__pyx_tuple__42); /* "include/color_dict.pxi":36 * 'blue4' : (0, 0, 139), * 'blueviolet' : (138, 43, 226), * 'brown' : (165, 42, 42), # <<<<<<<<<<<<<< * 'brown1' : (255, 64, 64), * 'brown2' : (238, 59, 59), */ __pyx_tuple__43 = PyTuple_Pack(3, __pyx_int_165, __pyx_int_42, __pyx_int_42); if (unlikely(!__pyx_tuple__43)) __PYX_ERR(2, 36, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__43); __Pyx_GIVEREF(__pyx_tuple__43); /* "include/color_dict.pxi":37 * 'blueviolet' : (138, 43, 226), * 'brown' : (165, 42, 42), * 'brown1' : (255, 64, 64), # <<<<<<<<<<<<<< * 'brown2' : (238, 59, 59), * 'brown3' : (205, 51, 51), */ __pyx_tuple__44 = PyTuple_Pack(3, __pyx_int_255, __pyx_int_64, __pyx_int_64); if (unlikely(!__pyx_tuple__44)) __PYX_ERR(2, 37, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__44); __Pyx_GIVEREF(__pyx_tuple__44); /* "include/color_dict.pxi":38 * 'brown' : (165, 42, 42), * 'brown1' : (255, 64, 64), * 'brown2' : (238, 59, 59), # <<<<<<<<<<<<<< * 'brown3' : (205, 51, 51), * 'brown4' : (139, 35, 35), */ __pyx_tuple__45 = PyTuple_Pack(3, __pyx_int_238, __pyx_int_59, __pyx_int_59); if (unlikely(!__pyx_tuple__45)) __PYX_ERR(2, 38, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__45); __Pyx_GIVEREF(__pyx_tuple__45); /* "include/color_dict.pxi":39 * 'brown1' : (255, 64, 64), * 'brown2' : (238, 59, 59), * 'brown3' : (205, 51, 51), # <<<<<<<<<<<<<< * 'brown4' : (139, 35, 35), * 'burlywood' : (222, 184, 135), */ __pyx_tuple__46 = PyTuple_Pack(3, __pyx_int_205, __pyx_int_51, __pyx_int_51); if (unlikely(!__pyx_tuple__46)) __PYX_ERR(2, 39, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__46); __Pyx_GIVEREF(__pyx_tuple__46); /* "include/color_dict.pxi":40 * 'brown2' : (238, 59, 59), * 'brown3' : (205, 51, 51), * 'brown4' : (139, 35, 35), # <<<<<<<<<<<<<< * 'burlywood' : (222, 184, 135), * 'burlywood1' : (255, 211, 155), */ __pyx_tuple__47 = PyTuple_Pack(3, __pyx_int_139, __pyx_int_35, __pyx_int_35); if (unlikely(!__pyx_tuple__47)) __PYX_ERR(2, 40, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__47); __Pyx_GIVEREF(__pyx_tuple__47); /* "include/color_dict.pxi":41 * 'brown3' : (205, 51, 51), * 'brown4' : (139, 35, 35), * 'burlywood' : (222, 184, 135), # <<<<<<<<<<<<<< * 'burlywood1' : (255, 211, 155), * 'burlywood2' : (238, 197, 145), */ __pyx_tuple__48 = PyTuple_Pack(3, __pyx_int_222, __pyx_int_184, __pyx_int_135); if (unlikely(!__pyx_tuple__48)) __PYX_ERR(2, 41, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__48); __Pyx_GIVEREF(__pyx_tuple__48); /* "include/color_dict.pxi":42 * 'brown4' : (139, 35, 35), * 'burlywood' : (222, 184, 135), * 'burlywood1' : (255, 211, 155), # <<<<<<<<<<<<<< * 'burlywood2' : (238, 197, 145), * 'burlywood3' : (205, 170, 125), */ __pyx_tuple__49 = PyTuple_Pack(3, __pyx_int_255, __pyx_int_211, __pyx_int_155); if (unlikely(!__pyx_tuple__49)) __PYX_ERR(2, 42, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__49); __Pyx_GIVEREF(__pyx_tuple__49); /* "include/color_dict.pxi":43 * 'burlywood' : (222, 184, 135), * 'burlywood1' : (255, 211, 155), * 'burlywood2' : (238, 197, 145), # <<<<<<<<<<<<<< * 'burlywood3' : (205, 170, 125), * 'burlywood4' : (139, 115, 85), */ __pyx_tuple__50 = PyTuple_Pack(3, __pyx_int_238, __pyx_int_197, __pyx_int_145); if (unlikely(!__pyx_tuple__50)) __PYX_ERR(2, 43, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__50); __Pyx_GIVEREF(__pyx_tuple__50); /* "include/color_dict.pxi":44 * 'burlywood1' : (255, 211, 155), * 'burlywood2' : (238, 197, 145), * 'burlywood3' : (205, 170, 125), # <<<<<<<<<<<<<< * 'burlywood4' : (139, 115, 85), * 'cadetblue' : (95, 158, 160), */ __pyx_tuple__51 = PyTuple_Pack(3, __pyx_int_205, __pyx_int_170, __pyx_int_125); if (unlikely(!__pyx_tuple__51)) __PYX_ERR(2, 44, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__51); __Pyx_GIVEREF(__pyx_tuple__51); /* "include/color_dict.pxi":45 * 'burlywood2' : (238, 197, 145), * 'burlywood3' : (205, 170, 125), * 'burlywood4' : (139, 115, 85), # <<<<<<<<<<<<<< * 'cadetblue' : (95, 158, 160), * 'cadetblue1' : (152, 245, 255), */ __pyx_tuple__52 = PyTuple_Pack(3, __pyx_int_139, __pyx_int_115, __pyx_int_85); if (unlikely(!__pyx_tuple__52)) __PYX_ERR(2, 45, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__52); __Pyx_GIVEREF(__pyx_tuple__52); /* "include/color_dict.pxi":46 * 'burlywood3' : (205, 170, 125), * 'burlywood4' : (139, 115, 85), * 'cadetblue' : (95, 158, 160), # <<<<<<<<<<<<<< * 'cadetblue1' : (152, 245, 255), * 'cadetblue2' : (142, 229, 238), */ __pyx_tuple__53 = PyTuple_Pack(3, __pyx_int_95, __pyx_int_158, __pyx_int_160); if (unlikely(!__pyx_tuple__53)) __PYX_ERR(2, 46, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__53); __Pyx_GIVEREF(__pyx_tuple__53); /* "include/color_dict.pxi":47 * 'burlywood4' : (139, 115, 85), * 'cadetblue' : (95, 158, 160), * 'cadetblue1' : (152, 245, 255), # <<<<<<<<<<<<<< * 'cadetblue2' : (142, 229, 238), * 'cadetblue3' : (122, 197, 205), */ __pyx_tuple__54 = PyTuple_Pack(3, __pyx_int_152, __pyx_int_245, __pyx_int_255); if (unlikely(!__pyx_tuple__54)) __PYX_ERR(2, 47, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__54); __Pyx_GIVEREF(__pyx_tuple__54); /* "include/color_dict.pxi":48 * 'cadetblue' : (95, 158, 160), * 'cadetblue1' : (152, 245, 255), * 'cadetblue2' : (142, 229, 238), # <<<<<<<<<<<<<< * 'cadetblue3' : (122, 197, 205), * 'cadetblue4' : (83, 134, 139), */ __pyx_tuple__55 = PyTuple_Pack(3, __pyx_int_142, __pyx_int_229, __pyx_int_238); if (unlikely(!__pyx_tuple__55)) __PYX_ERR(2, 48, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__55); __Pyx_GIVEREF(__pyx_tuple__55); /* "include/color_dict.pxi":49 * 'cadetblue1' : (152, 245, 255), * 'cadetblue2' : (142, 229, 238), * 'cadetblue3' : (122, 197, 205), # <<<<<<<<<<<<<< * 'cadetblue4' : (83, 134, 139), * 'chartreuse' : (127, 255, 0), */ __pyx_tuple__56 = PyTuple_Pack(3, __pyx_int_122, __pyx_int_197, __pyx_int_205); if (unlikely(!__pyx_tuple__56)) __PYX_ERR(2, 49, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__56); __Pyx_GIVEREF(__pyx_tuple__56); /* "include/color_dict.pxi":50 * 'cadetblue2' : (142, 229, 238), * 'cadetblue3' : (122, 197, 205), * 'cadetblue4' : (83, 134, 139), # <<<<<<<<<<<<<< * 'chartreuse' : (127, 255, 0), * 'chartreuse1' : (127, 255, 0), */ __pyx_tuple__57 = PyTuple_Pack(3, __pyx_int_83, __pyx_int_134, __pyx_int_139); if (unlikely(!__pyx_tuple__57)) __PYX_ERR(2, 50, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__57); __Pyx_GIVEREF(__pyx_tuple__57); /* "include/color_dict.pxi":51 * 'cadetblue3' : (122, 197, 205), * 'cadetblue4' : (83, 134, 139), * 'chartreuse' : (127, 255, 0), # <<<<<<<<<<<<<< * 'chartreuse1' : (127, 255, 0), * 'chartreuse2' : (118, 238, 0), */ __pyx_tuple__58 = PyTuple_Pack(3, __pyx_int_127, __pyx_int_255, __pyx_int_0); if (unlikely(!__pyx_tuple__58)) __PYX_ERR(2, 51, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__58); __Pyx_GIVEREF(__pyx_tuple__58); /* "include/color_dict.pxi":52 * 'cadetblue4' : (83, 134, 139), * 'chartreuse' : (127, 255, 0), * 'chartreuse1' : (127, 255, 0), # <<<<<<<<<<<<<< * 'chartreuse2' : (118, 238, 0), * 'chartreuse3' : (102, 205, 0), */ __pyx_tuple__59 = PyTuple_Pack(3, __pyx_int_127, __pyx_int_255, __pyx_int_0); if (unlikely(!__pyx_tuple__59)) __PYX_ERR(2, 52, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__59); __Pyx_GIVEREF(__pyx_tuple__59); /* "include/color_dict.pxi":53 * 'chartreuse' : (127, 255, 0), * 'chartreuse1' : (127, 255, 0), * 'chartreuse2' : (118, 238, 0), # <<<<<<<<<<<<<< * 'chartreuse3' : (102, 205, 0), * 'chartreuse4' : (69, 139, 0), */ __pyx_tuple__60 = PyTuple_Pack(3, __pyx_int_118, __pyx_int_238, __pyx_int_0); if (unlikely(!__pyx_tuple__60)) __PYX_ERR(2, 53, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__60); __Pyx_GIVEREF(__pyx_tuple__60); /* "include/color_dict.pxi":54 * 'chartreuse1' : (127, 255, 0), * 'chartreuse2' : (118, 238, 0), * 'chartreuse3' : (102, 205, 0), # <<<<<<<<<<<<<< * 'chartreuse4' : (69, 139, 0), * 'chocolate' : (210, 105, 30), */ __pyx_tuple__61 = PyTuple_Pack(3, __pyx_int_102, __pyx_int_205, __pyx_int_0); if (unlikely(!__pyx_tuple__61)) __PYX_ERR(2, 54, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__61); __Pyx_GIVEREF(__pyx_tuple__61); /* "include/color_dict.pxi":55 * 'chartreuse2' : (118, 238, 0), * 'chartreuse3' : (102, 205, 0), * 'chartreuse4' : (69, 139, 0), # <<<<<<<<<<<<<< * 'chocolate' : (210, 105, 30), * 'chocolate1' : (255, 127, 36), */ __pyx_tuple__62 = PyTuple_Pack(3, __pyx_int_69, __pyx_int_139, __pyx_int_0); if (unlikely(!__pyx_tuple__62)) __PYX_ERR(2, 55, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__62); __Pyx_GIVEREF(__pyx_tuple__62); /* "include/color_dict.pxi":56 * 'chartreuse3' : (102, 205, 0), * 'chartreuse4' : (69, 139, 0), * 'chocolate' : (210, 105, 30), # <<<<<<<<<<<<<< * 'chocolate1' : (255, 127, 36), * 'chocolate2' : (238, 118, 33), */ __pyx_tuple__63 = PyTuple_Pack(3, __pyx_int_210, __pyx_int_105, __pyx_int_30); if (unlikely(!__pyx_tuple__63)) __PYX_ERR(2, 56, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__63); __Pyx_GIVEREF(__pyx_tuple__63); /* "include/color_dict.pxi":57 * 'chartreuse4' : (69, 139, 0), * 'chocolate' : (210, 105, 30), * 'chocolate1' : (255, 127, 36), # <<<<<<<<<<<<<< * 'chocolate2' : (238, 118, 33), * 'chocolate3' : (205, 102, 29), */ __pyx_tuple__64 = PyTuple_Pack(3, __pyx_int_255, __pyx_int_127, __pyx_int_36); if (unlikely(!__pyx_tuple__64)) __PYX_ERR(2, 57, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__64); __Pyx_GIVEREF(__pyx_tuple__64); /* "include/color_dict.pxi":58 * 'chocolate' : (210, 105, 30), * 'chocolate1' : (255, 127, 36), * 'chocolate2' : (238, 118, 33), # <<<<<<<<<<<<<< * 'chocolate3' : (205, 102, 29), * 'chocolate4' : (139, 69, 19), */ __pyx_tuple__65 = PyTuple_Pack(3, __pyx_int_238, __pyx_int_118, __pyx_int_33); if (unlikely(!__pyx_tuple__65)) __PYX_ERR(2, 58, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__65); __Pyx_GIVEREF(__pyx_tuple__65); /* "include/color_dict.pxi":59 * 'chocolate1' : (255, 127, 36), * 'chocolate2' : (238, 118, 33), * 'chocolate3' : (205, 102, 29), # <<<<<<<<<<<<<< * 'chocolate4' : (139, 69, 19), * 'coral' : (255, 127, 80), */ __pyx_tuple__66 = PyTuple_Pack(3, __pyx_int_205, __pyx_int_102, __pyx_int_29); if (unlikely(!__pyx_tuple__66)) __PYX_ERR(2, 59, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__66); __Pyx_GIVEREF(__pyx_tuple__66); /* "include/color_dict.pxi":60 * 'chocolate2' : (238, 118, 33), * 'chocolate3' : (205, 102, 29), * 'chocolate4' : (139, 69, 19), # <<<<<<<<<<<<<< * 'coral' : (255, 127, 80), * 'coral1' : (255, 114, 86), */ __pyx_tuple__67 = PyTuple_Pack(3, __pyx_int_139, __pyx_int_69, __pyx_int_19); if (unlikely(!__pyx_tuple__67)) __PYX_ERR(2, 60, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__67); __Pyx_GIVEREF(__pyx_tuple__67); /* "include/color_dict.pxi":61 * 'chocolate3' : (205, 102, 29), * 'chocolate4' : (139, 69, 19), * 'coral' : (255, 127, 80), # <<<<<<<<<<<<<< * 'coral1' : (255, 114, 86), * 'coral2' : (238, 106, 80), */ __pyx_tuple__68 = PyTuple_Pack(3, __pyx_int_255, __pyx_int_127, __pyx_int_80); if (unlikely(!__pyx_tuple__68)) __PYX_ERR(2, 61, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__68); __Pyx_GIVEREF(__pyx_tuple__68); /* "include/color_dict.pxi":62 * 'chocolate4' : (139, 69, 19), * 'coral' : (255, 127, 80), * 'coral1' : (255, 114, 86), # <<<<<<<<<<<<<< * 'coral2' : (238, 106, 80), * 'coral3' : (205, 91, 69), */ __pyx_tuple__69 = PyTuple_Pack(3, __pyx_int_255, __pyx_int_114, __pyx_int_86); if (unlikely(!__pyx_tuple__69)) __PYX_ERR(2, 62, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__69); __Pyx_GIVEREF(__pyx_tuple__69); /* "include/color_dict.pxi":63 * 'coral' : (255, 127, 80), * 'coral1' : (255, 114, 86), * 'coral2' : (238, 106, 80), # <<<<<<<<<<<<<< * 'coral3' : (205, 91, 69), * 'coral4' : (139, 62, 47), */ __pyx_tuple__70 = PyTuple_Pack(3, __pyx_int_238, __pyx_int_106, __pyx_int_80); if (unlikely(!__pyx_tuple__70)) __PYX_ERR(2, 63, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__70); __Pyx_GIVEREF(__pyx_tuple__70); /* "include/color_dict.pxi":64 * 'coral1' : (255, 114, 86), * 'coral2' : (238, 106, 80), * 'coral3' : (205, 91, 69), # <<<<<<<<<<<<<< * 'coral4' : (139, 62, 47), * 'cornflowerblue' : (100, 149, 237), */ __pyx_tuple__71 = PyTuple_Pack(3, __pyx_int_205, __pyx_int_91, __pyx_int_69); if (unlikely(!__pyx_tuple__71)) __PYX_ERR(2, 64, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__71); __Pyx_GIVEREF(__pyx_tuple__71); /* "include/color_dict.pxi":65 * 'coral2' : (238, 106, 80), * 'coral3' : (205, 91, 69), * 'coral4' : (139, 62, 47), # <<<<<<<<<<<<<< * 'cornflowerblue' : (100, 149, 237), * 'cornsilk' : (255, 248, 220), */ __pyx_tuple__72 = PyTuple_Pack(3, __pyx_int_139, __pyx_int_62, __pyx_int_47); if (unlikely(!__pyx_tuple__72)) __PYX_ERR(2, 65, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__72); __Pyx_GIVEREF(__pyx_tuple__72); /* "include/color_dict.pxi":66 * 'coral3' : (205, 91, 69), * 'coral4' : (139, 62, 47), * 'cornflowerblue' : (100, 149, 237), # <<<<<<<<<<<<<< * 'cornsilk' : (255, 248, 220), * 'cornsilk1' : (255, 248, 220), */ __pyx_tuple__73 = PyTuple_Pack(3, __pyx_int_100, __pyx_int_149, __pyx_int_237); if (unlikely(!__pyx_tuple__73)) __PYX_ERR(2, 66, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__73); __Pyx_GIVEREF(__pyx_tuple__73); /* "include/color_dict.pxi":67 * 'coral4' : (139, 62, 47), * 'cornflowerblue' : (100, 149, 237), * 'cornsilk' : (255, 248, 220), # <<<<<<<<<<<<<< * 'cornsilk1' : (255, 248, 220), * 'cornsilk2' : (238, 232, 205), */ __pyx_tuple__74 = PyTuple_Pack(3, __pyx_int_255, __pyx_int_248, __pyx_int_220); if (unlikely(!__pyx_tuple__74)) __PYX_ERR(2, 67, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__74); __Pyx_GIVEREF(__pyx_tuple__74); /* "include/color_dict.pxi":68 * 'cornflowerblue' : (100, 149, 237), * 'cornsilk' : (255, 248, 220), * 'cornsilk1' : (255, 248, 220), # <<<<<<<<<<<<<< * 'cornsilk2' : (238, 232, 205), * 'cornsilk3' : (205, 200, 177), */ __pyx_tuple__75 = PyTuple_Pack(3, __pyx_int_255, __pyx_int_248, __pyx_int_220); if (unlikely(!__pyx_tuple__75)) __PYX_ERR(2, 68, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__75); __Pyx_GIVEREF(__pyx_tuple__75); /* "include/color_dict.pxi":69 * 'cornsilk' : (255, 248, 220), * 'cornsilk1' : (255, 248, 220), * 'cornsilk2' : (238, 232, 205), # <<<<<<<<<<<<<< * 'cornsilk3' : (205, 200, 177), * 'cornsilk4' : (139, 136, 120), */ __pyx_tuple__76 = PyTuple_Pack(3, __pyx_int_238, __pyx_int_232, __pyx_int_205); if (unlikely(!__pyx_tuple__76)) __PYX_ERR(2, 69, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__76); __Pyx_GIVEREF(__pyx_tuple__76); /* "include/color_dict.pxi":70 * 'cornsilk1' : (255, 248, 220), * 'cornsilk2' : (238, 232, 205), * 'cornsilk3' : (205, 200, 177), # <<<<<<<<<<<<<< * 'cornsilk4' : (139, 136, 120), * 'crimson' : (220, 20, 60), */ __pyx_tuple__77 = PyTuple_Pack(3, __pyx_int_205, __pyx_int_200, __pyx_int_177); if (unlikely(!__pyx_tuple__77)) __PYX_ERR(2, 70, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__77); __Pyx_GIVEREF(__pyx_tuple__77); /* "include/color_dict.pxi":71 * 'cornsilk2' : (238, 232, 205), * 'cornsilk3' : (205, 200, 177), * 'cornsilk4' : (139, 136, 120), # <<<<<<<<<<<<<< * 'crimson' : (220, 20, 60), * 'cyan' : (0, 255, 255), */ __pyx_tuple__78 = PyTuple_Pack(3, __pyx_int_139, __pyx_int_136, __pyx_int_120); if (unlikely(!__pyx_tuple__78)) __PYX_ERR(2, 71, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__78); __Pyx_GIVEREF(__pyx_tuple__78); /* "include/color_dict.pxi":72 * 'cornsilk3' : (205, 200, 177), * 'cornsilk4' : (139, 136, 120), * 'crimson' : (220, 20, 60), # <<<<<<<<<<<<<< * 'cyan' : (0, 255, 255), * 'cyan1' : (0, 255, 255), */ __pyx_tuple__79 = PyTuple_Pack(3, __pyx_int_220, __pyx_int_20, __pyx_int_60); if (unlikely(!__pyx_tuple__79)) __PYX_ERR(2, 72, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__79); __Pyx_GIVEREF(__pyx_tuple__79); /* "include/color_dict.pxi":73 * 'cornsilk4' : (139, 136, 120), * 'crimson' : (220, 20, 60), * 'cyan' : (0, 255, 255), # <<<<<<<<<<<<<< * 'cyan1' : (0, 255, 255), * 'cyan2' : (0, 238, 238), */ __pyx_tuple__80 = PyTuple_Pack(3, __pyx_int_0, __pyx_int_255, __pyx_int_255); if (unlikely(!__pyx_tuple__80)) __PYX_ERR(2, 73, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__80); __Pyx_GIVEREF(__pyx_tuple__80); /* "include/color_dict.pxi":74 * 'crimson' : (220, 20, 60), * 'cyan' : (0, 255, 255), * 'cyan1' : (0, 255, 255), # <<<<<<<<<<<<<< * 'cyan2' : (0, 238, 238), * 'cyan3' : (0, 205, 205), */ __pyx_tuple__81 = PyTuple_Pack(3, __pyx_int_0, __pyx_int_255, __pyx_int_255); if (unlikely(!__pyx_tuple__81)) __PYX_ERR(2, 74, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__81); __Pyx_GIVEREF(__pyx_tuple__81); /* "include/color_dict.pxi":75 * 'cyan' : (0, 255, 255), * 'cyan1' : (0, 255, 255), * 'cyan2' : (0, 238, 238), # <<<<<<<<<<<<<< * 'cyan3' : (0, 205, 205), * 'cyan4' : (0, 139, 139), */ __pyx_tuple__82 = PyTuple_Pack(3, __pyx_int_0, __pyx_int_238, __pyx_int_238); if (unlikely(!__pyx_tuple__82)) __PYX_ERR(2, 75, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__82); __Pyx_GIVEREF(__pyx_tuple__82); /* "include/color_dict.pxi":76 * 'cyan1' : (0, 255, 255), * 'cyan2' : (0, 238, 238), * 'cyan3' : (0, 205, 205), # <<<<<<<<<<<<<< * 'cyan4' : (0, 139, 139), * 'darkblue' : (0, 0, 139), */ __pyx_tuple__83 = PyTuple_Pack(3, __pyx_int_0, __pyx_int_205, __pyx_int_205); if (unlikely(!__pyx_tuple__83)) __PYX_ERR(2, 76, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__83); __Pyx_GIVEREF(__pyx_tuple__83); /* "include/color_dict.pxi":77 * 'cyan2' : (0, 238, 238), * 'cyan3' : (0, 205, 205), * 'cyan4' : (0, 139, 139), # <<<<<<<<<<<<<< * 'darkblue' : (0, 0, 139), * 'darkcyan' : (0, 139, 139), */ __pyx_tuple__84 = PyTuple_Pack(3, __pyx_int_0, __pyx_int_139, __pyx_int_139); if (unlikely(!__pyx_tuple__84)) __PYX_ERR(2, 77, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__84); __Pyx_GIVEREF(__pyx_tuple__84); /* "include/color_dict.pxi":78 * 'cyan3' : (0, 205, 205), * 'cyan4' : (0, 139, 139), * 'darkblue' : (0, 0, 139), # <<<<<<<<<<<<<< * 'darkcyan' : (0, 139, 139), * 'darkgoldenrod' : (184, 134, 11), */ __pyx_tuple__85 = PyTuple_Pack(3, __pyx_int_0, __pyx_int_0, __pyx_int_139); if (unlikely(!__pyx_tuple__85)) __PYX_ERR(2, 78, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__85); __Pyx_GIVEREF(__pyx_tuple__85); /* "include/color_dict.pxi":79 * 'cyan4' : (0, 139, 139), * 'darkblue' : (0, 0, 139), * 'darkcyan' : (0, 139, 139), # <<<<<<<<<<<<<< * 'darkgoldenrod' : (184, 134, 11), * 'darkgoldenrod1' : (255, 185, 15), */ __pyx_tuple__86 = PyTuple_Pack(3, __pyx_int_0, __pyx_int_139, __pyx_int_139); if (unlikely(!__pyx_tuple__86)) __PYX_ERR(2, 79, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__86); __Pyx_GIVEREF(__pyx_tuple__86); /* "include/color_dict.pxi":80 * 'darkblue' : (0, 0, 139), * 'darkcyan' : (0, 139, 139), * 'darkgoldenrod' : (184, 134, 11), # <<<<<<<<<<<<<< * 'darkgoldenrod1' : (255, 185, 15), * 'darkgoldenrod2' : (238, 173, 14), */ __pyx_tuple__87 = PyTuple_Pack(3, __pyx_int_184, __pyx_int_134, __pyx_int_11); if (unlikely(!__pyx_tuple__87)) __PYX_ERR(2, 80, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__87); __Pyx_GIVEREF(__pyx_tuple__87); /* "include/color_dict.pxi":81 * 'darkcyan' : (0, 139, 139), * 'darkgoldenrod' : (184, 134, 11), * 'darkgoldenrod1' : (255, 185, 15), # <<<<<<<<<<<<<< * 'darkgoldenrod2' : (238, 173, 14), * 'darkgoldenrod3' : (205, 149, 12), */ __pyx_tuple__88 = PyTuple_Pack(3, __pyx_int_255, __pyx_int_185, __pyx_int_15); if (unlikely(!__pyx_tuple__88)) __PYX_ERR(2, 81, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__88); __Pyx_GIVEREF(__pyx_tuple__88); /* "include/color_dict.pxi":82 * 'darkgoldenrod' : (184, 134, 11), * 'darkgoldenrod1' : (255, 185, 15), * 'darkgoldenrod2' : (238, 173, 14), # <<<<<<<<<<<<<< * 'darkgoldenrod3' : (205, 149, 12), * 'darkgoldenrod4' : (139, 101, 8), */ __pyx_tuple__89 = PyTuple_Pack(3, __pyx_int_238, __pyx_int_173, __pyx_int_14); if (unlikely(!__pyx_tuple__89)) __PYX_ERR(2, 82, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__89); __Pyx_GIVEREF(__pyx_tuple__89); /* "include/color_dict.pxi":83 * 'darkgoldenrod1' : (255, 185, 15), * 'darkgoldenrod2' : (238, 173, 14), * 'darkgoldenrod3' : (205, 149, 12), # <<<<<<<<<<<<<< * 'darkgoldenrod4' : (139, 101, 8), * 'darkgray' : (169, 169, 169), */ __pyx_tuple__90 = PyTuple_Pack(3, __pyx_int_205, __pyx_int_149, __pyx_int_12); if (unlikely(!__pyx_tuple__90)) __PYX_ERR(2, 83, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__90); __Pyx_GIVEREF(__pyx_tuple__90); /* "include/color_dict.pxi":84 * 'darkgoldenrod2' : (238, 173, 14), * 'darkgoldenrod3' : (205, 149, 12), * 'darkgoldenrod4' : (139, 101, 8), # <<<<<<<<<<<<<< * 'darkgray' : (169, 169, 169), * 'darkgreen' : (0, 100, 0), */ __pyx_tuple__91 = PyTuple_Pack(3, __pyx_int_139, __pyx_int_101, __pyx_int_8); if (unlikely(!__pyx_tuple__91)) __PYX_ERR(2, 84, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__91); __Pyx_GIVEREF(__pyx_tuple__91); /* "include/color_dict.pxi":85 * 'darkgoldenrod3' : (205, 149, 12), * 'darkgoldenrod4' : (139, 101, 8), * 'darkgray' : (169, 169, 169), # <<<<<<<<<<<<<< * 'darkgreen' : (0, 100, 0), * 'darkgrey' : (169, 169, 169), */ __pyx_tuple__92 = PyTuple_Pack(3, __pyx_int_169, __pyx_int_169, __pyx_int_169); if (unlikely(!__pyx_tuple__92)) __PYX_ERR(2, 85, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__92); __Pyx_GIVEREF(__pyx_tuple__92); /* "include/color_dict.pxi":86 * 'darkgoldenrod4' : (139, 101, 8), * 'darkgray' : (169, 169, 169), * 'darkgreen' : (0, 100, 0), # <<<<<<<<<<<<<< * 'darkgrey' : (169, 169, 169), * 'darkkhaki' : (189, 183, 107), */ __pyx_tuple__93 = PyTuple_Pack(3, __pyx_int_0, __pyx_int_100, __pyx_int_0); if (unlikely(!__pyx_tuple__93)) __PYX_ERR(2, 86, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__93); __Pyx_GIVEREF(__pyx_tuple__93); /* "include/color_dict.pxi":87 * 'darkgray' : (169, 169, 169), * 'darkgreen' : (0, 100, 0), * 'darkgrey' : (169, 169, 169), # <<<<<<<<<<<<<< * 'darkkhaki' : (189, 183, 107), * 'darkmagenta' : (139, 0, 139), */ __pyx_tuple__94 = PyTuple_Pack(3, __pyx_int_169, __pyx_int_169, __pyx_int_169); if (unlikely(!__pyx_tuple__94)) __PYX_ERR(2, 87, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__94); __Pyx_GIVEREF(__pyx_tuple__94); /* "include/color_dict.pxi":88 * 'darkgreen' : (0, 100, 0), * 'darkgrey' : (169, 169, 169), * 'darkkhaki' : (189, 183, 107), # <<<<<<<<<<<<<< * 'darkmagenta' : (139, 0, 139), * 'darkolivegreen' : (85, 107, 47), */ __pyx_tuple__95 = PyTuple_Pack(3, __pyx_int_189, __pyx_int_183, __pyx_int_107); if (unlikely(!__pyx_tuple__95)) __PYX_ERR(2, 88, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__95); __Pyx_GIVEREF(__pyx_tuple__95); /* "include/color_dict.pxi":89 * 'darkgrey' : (169, 169, 169), * 'darkkhaki' : (189, 183, 107), * 'darkmagenta' : (139, 0, 139), # <<<<<<<<<<<<<< * 'darkolivegreen' : (85, 107, 47), * 'darkolivegreen1' : (202, 255, 112), */ __pyx_tuple__96 = PyTuple_Pack(3, __pyx_int_139, __pyx_int_0, __pyx_int_139); if (unlikely(!__pyx_tuple__96)) __PYX_ERR(2, 89, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__96); __Pyx_GIVEREF(__pyx_tuple__96); /* "include/color_dict.pxi":90 * 'darkkhaki' : (189, 183, 107), * 'darkmagenta' : (139, 0, 139), * 'darkolivegreen' : (85, 107, 47), # <<<<<<<<<<<<<< * 'darkolivegreen1' : (202, 255, 112), * 'darkolivegreen2' : (188, 238, 104), */ __pyx_tuple__97 = PyTuple_Pack(3, __pyx_int_85, __pyx_int_107, __pyx_int_47); if (unlikely(!__pyx_tuple__97)) __PYX_ERR(2, 90, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__97); __Pyx_GIVEREF(__pyx_tuple__97); /* "include/color_dict.pxi":91 * 'darkmagenta' : (139, 0, 139), * 'darkolivegreen' : (85, 107, 47), * 'darkolivegreen1' : (202, 255, 112), # <<<<<<<<<<<<<< * 'darkolivegreen2' : (188, 238, 104), * 'darkolivegreen3' : (162, 205, 90), */ __pyx_tuple__98 = PyTuple_Pack(3, __pyx_int_202, __pyx_int_255, __pyx_int_112); if (unlikely(!__pyx_tuple__98)) __PYX_ERR(2, 91, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__98); __Pyx_GIVEREF(__pyx_tuple__98); /* "include/color_dict.pxi":92 * 'darkolivegreen' : (85, 107, 47), * 'darkolivegreen1' : (202, 255, 112), * 'darkolivegreen2' : (188, 238, 104), # <<<<<<<<<<<<<< * 'darkolivegreen3' : (162, 205, 90), * 'darkolivegreen4' : (110, 139, 61), */ __pyx_tuple__99 = PyTuple_Pack(3, __pyx_int_188, __pyx_int_238, __pyx_int_104); if (unlikely(!__pyx_tuple__99)) __PYX_ERR(2, 92, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__99); __Pyx_GIVEREF(__pyx_tuple__99); /* "include/color_dict.pxi":93 * 'darkolivegreen1' : (202, 255, 112), * 'darkolivegreen2' : (188, 238, 104), * 'darkolivegreen3' : (162, 205, 90), # <<<<<<<<<<<<<< * 'darkolivegreen4' : (110, 139, 61), * 'darkorange' : (255, 140, 0), */ __pyx_tuple__100 = PyTuple_Pack(3, __pyx_int_162, __pyx_int_205, __pyx_int_90); if (unlikely(!__pyx_tuple__100)) __PYX_ERR(2, 93, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__100); __Pyx_GIVEREF(__pyx_tuple__100); /* "include/color_dict.pxi":94 * 'darkolivegreen2' : (188, 238, 104), * 'darkolivegreen3' : (162, 205, 90), * 'darkolivegreen4' : (110, 139, 61), # <<<<<<<<<<<<<< * 'darkorange' : (255, 140, 0), * 'darkorange1' : (255, 127, 0), */ __pyx_tuple__101 = PyTuple_Pack(3, __pyx_int_110, __pyx_int_139, __pyx_int_61); if (unlikely(!__pyx_tuple__101)) __PYX_ERR(2, 94, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__101); __Pyx_GIVEREF(__pyx_tuple__101); /* "include/color_dict.pxi":95 * 'darkolivegreen3' : (162, 205, 90), * 'darkolivegreen4' : (110, 139, 61), * 'darkorange' : (255, 140, 0), # <<<<<<<<<<<<<< * 'darkorange1' : (255, 127, 0), * 'darkorange2' : (238, 118, 0), */ __pyx_tuple__102 = PyTuple_Pack(3, __pyx_int_255, __pyx_int_140, __pyx_int_0); if (unlikely(!__pyx_tuple__102)) __PYX_ERR(2, 95, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__102); __Pyx_GIVEREF(__pyx_tuple__102); /* "include/color_dict.pxi":96 * 'darkolivegreen4' : (110, 139, 61), * 'darkorange' : (255, 140, 0), * 'darkorange1' : (255, 127, 0), # <<<<<<<<<<<<<< * 'darkorange2' : (238, 118, 0), * 'darkorange3' : (205, 102, 0), */ __pyx_tuple__103 = PyTuple_Pack(3, __pyx_int_255, __pyx_int_127, __pyx_int_0); if (unlikely(!__pyx_tuple__103)) __PYX_ERR(2, 96, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__103); __Pyx_GIVEREF(__pyx_tuple__103); /* "include/color_dict.pxi":97 * 'darkorange' : (255, 140, 0), * 'darkorange1' : (255, 127, 0), * 'darkorange2' : (238, 118, 0), # <<<<<<<<<<<<<< * 'darkorange3' : (205, 102, 0), * 'darkorange4' : (139, 69, 0), */ __pyx_tuple__104 = PyTuple_Pack(3, __pyx_int_238, __pyx_int_118, __pyx_int_0); if (unlikely(!__pyx_tuple__104)) __PYX_ERR(2, 97, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__104); __Pyx_GIVEREF(__pyx_tuple__104); /* "include/color_dict.pxi":98 * 'darkorange1' : (255, 127, 0), * 'darkorange2' : (238, 118, 0), * 'darkorange3' : (205, 102, 0), # <<<<<<<<<<<<<< * 'darkorange4' : (139, 69, 0), * 'darkorchid' : (153, 50, 204), */ __pyx_tuple__105 = PyTuple_Pack(3, __pyx_int_205, __pyx_int_102, __pyx_int_0); if (unlikely(!__pyx_tuple__105)) __PYX_ERR(2, 98, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__105); __Pyx_GIVEREF(__pyx_tuple__105); /* "include/color_dict.pxi":99 * 'darkorange2' : (238, 118, 0), * 'darkorange3' : (205, 102, 0), * 'darkorange4' : (139, 69, 0), # <<<<<<<<<<<<<< * 'darkorchid' : (153, 50, 204), * 'darkorchid1' : (191, 62, 255), */ __pyx_tuple__106 = PyTuple_Pack(3, __pyx_int_139, __pyx_int_69, __pyx_int_0); if (unlikely(!__pyx_tuple__106)) __PYX_ERR(2, 99, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__106); __Pyx_GIVEREF(__pyx_tuple__106); /* "include/color_dict.pxi":100 * 'darkorange3' : (205, 102, 0), * 'darkorange4' : (139, 69, 0), * 'darkorchid' : (153, 50, 204), # <<<<<<<<<<<<<< * 'darkorchid1' : (191, 62, 255), * 'darkorchid2' : (178, 58, 238), */ __pyx_tuple__107 = PyTuple_Pack(3, __pyx_int_153, __pyx_int_50, __pyx_int_204); if (unlikely(!__pyx_tuple__107)) __PYX_ERR(2, 100, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__107); __Pyx_GIVEREF(__pyx_tuple__107); /* "include/color_dict.pxi":101 * 'darkorange4' : (139, 69, 0), * 'darkorchid' : (153, 50, 204), * 'darkorchid1' : (191, 62, 255), # <<<<<<<<<<<<<< * 'darkorchid2' : (178, 58, 238), * 'darkorchid3' : (154, 50, 205), */ __pyx_tuple__108 = PyTuple_Pack(3, __pyx_int_191, __pyx_int_62, __pyx_int_255); if (unlikely(!__pyx_tuple__108)) __PYX_ERR(2, 101, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__108); __Pyx_GIVEREF(__pyx_tuple__108); /* "include/color_dict.pxi":102 * 'darkorchid' : (153, 50, 204), * 'darkorchid1' : (191, 62, 255), * 'darkorchid2' : (178, 58, 238), # <<<<<<<<<<<<<< * 'darkorchid3' : (154, 50, 205), * 'darkorchid4' : (104, 34, 139), */ __pyx_tuple__109 = PyTuple_Pack(3, __pyx_int_178, __pyx_int_58, __pyx_int_238); if (unlikely(!__pyx_tuple__109)) __PYX_ERR(2, 102, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__109); __Pyx_GIVEREF(__pyx_tuple__109); /* "include/color_dict.pxi":103 * 'darkorchid1' : (191, 62, 255), * 'darkorchid2' : (178, 58, 238), * 'darkorchid3' : (154, 50, 205), # <<<<<<<<<<<<<< * 'darkorchid4' : (104, 34, 139), * 'darkred' : (139, 0, 0), */ __pyx_tuple__110 = PyTuple_Pack(3, __pyx_int_154, __pyx_int_50, __pyx_int_205); if (unlikely(!__pyx_tuple__110)) __PYX_ERR(2, 103, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__110); __Pyx_GIVEREF(__pyx_tuple__110); /* "include/color_dict.pxi":104 * 'darkorchid2' : (178, 58, 238), * 'darkorchid3' : (154, 50, 205), * 'darkorchid4' : (104, 34, 139), # <<<<<<<<<<<<<< * 'darkred' : (139, 0, 0), * 'darksalmon' : (233, 150, 122), */ __pyx_tuple__111 = PyTuple_Pack(3, __pyx_int_104, __pyx_int_34, __pyx_int_139); if (unlikely(!__pyx_tuple__111)) __PYX_ERR(2, 104, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__111); __Pyx_GIVEREF(__pyx_tuple__111); /* "include/color_dict.pxi":105 * 'darkorchid3' : (154, 50, 205), * 'darkorchid4' : (104, 34, 139), * 'darkred' : (139, 0, 0), # <<<<<<<<<<<<<< * 'darksalmon' : (233, 150, 122), * 'darkseagreen' : (143, 188, 143), */ __pyx_tuple__112 = PyTuple_Pack(3, __pyx_int_139, __pyx_int_0, __pyx_int_0); if (unlikely(!__pyx_tuple__112)) __PYX_ERR(2, 105, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__112); __Pyx_GIVEREF(__pyx_tuple__112); /* "include/color_dict.pxi":106 * 'darkorchid4' : (104, 34, 139), * 'darkred' : (139, 0, 0), * 'darksalmon' : (233, 150, 122), # <<<<<<<<<<<<<< * 'darkseagreen' : (143, 188, 143), * 'darkseagreen1' : (193, 255, 193), */ __pyx_tuple__113 = PyTuple_Pack(3, __pyx_int_233, __pyx_int_150, __pyx_int_122); if (unlikely(!__pyx_tuple__113)) __PYX_ERR(2, 106, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__113); __Pyx_GIVEREF(__pyx_tuple__113); /* "include/color_dict.pxi":107 * 'darkred' : (139, 0, 0), * 'darksalmon' : (233, 150, 122), * 'darkseagreen' : (143, 188, 143), # <<<<<<<<<<<<<< * 'darkseagreen1' : (193, 255, 193), * 'darkseagreen2' : (180, 238, 180), */ __pyx_tuple__114 = PyTuple_Pack(3, __pyx_int_143, __pyx_int_188, __pyx_int_143); if (unlikely(!__pyx_tuple__114)) __PYX_ERR(2, 107, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__114); __Pyx_GIVEREF(__pyx_tuple__114); /* "include/color_dict.pxi":108 * 'darksalmon' : (233, 150, 122), * 'darkseagreen' : (143, 188, 143), * 'darkseagreen1' : (193, 255, 193), # <<<<<<<<<<<<<< * 'darkseagreen2' : (180, 238, 180), * 'darkseagreen3' : (155, 205, 155), */ __pyx_tuple__115 = PyTuple_Pack(3, __pyx_int_193, __pyx_int_255, __pyx_int_193); if (unlikely(!__pyx_tuple__115)) __PYX_ERR(2, 108, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__115); __Pyx_GIVEREF(__pyx_tuple__115); /* "include/color_dict.pxi":109 * 'darkseagreen' : (143, 188, 143), * 'darkseagreen1' : (193, 255, 193), * 'darkseagreen2' : (180, 238, 180), # <<<<<<<<<<<<<< * 'darkseagreen3' : (155, 205, 155), * 'darkseagreen4' : (105, 139, 105), */ __pyx_tuple__116 = PyTuple_Pack(3, __pyx_int_180, __pyx_int_238, __pyx_int_180); if (unlikely(!__pyx_tuple__116)) __PYX_ERR(2, 109, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__116); __Pyx_GIVEREF(__pyx_tuple__116); /* "include/color_dict.pxi":110 * 'darkseagreen1' : (193, 255, 193), * 'darkseagreen2' : (180, 238, 180), * 'darkseagreen3' : (155, 205, 155), # <<<<<<<<<<<<<< * 'darkseagreen4' : (105, 139, 105), * 'darkslateblue' : (72, 61, 139), */ __pyx_tuple__117 = PyTuple_Pack(3, __pyx_int_155, __pyx_int_205, __pyx_int_155); if (unlikely(!__pyx_tuple__117)) __PYX_ERR(2, 110, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__117); __Pyx_GIVEREF(__pyx_tuple__117); /* "include/color_dict.pxi":111 * 'darkseagreen2' : (180, 238, 180), * 'darkseagreen3' : (155, 205, 155), * 'darkseagreen4' : (105, 139, 105), # <<<<<<<<<<<<<< * 'darkslateblue' : (72, 61, 139), * 'darkslategray' : (47, 79, 79), */ __pyx_tuple__118 = PyTuple_Pack(3, __pyx_int_105, __pyx_int_139, __pyx_int_105); if (unlikely(!__pyx_tuple__118)) __PYX_ERR(2, 111, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__118); __Pyx_GIVEREF(__pyx_tuple__118); /* "include/color_dict.pxi":112 * 'darkseagreen3' : (155, 205, 155), * 'darkseagreen4' : (105, 139, 105), * 'darkslateblue' : (72, 61, 139), # <<<<<<<<<<<<<< * 'darkslategray' : (47, 79, 79), * 'darkslategray1' : (151, 255, 255), */ __pyx_tuple__119 = PyTuple_Pack(3, __pyx_int_72, __pyx_int_61, __pyx_int_139); if (unlikely(!__pyx_tuple__119)) __PYX_ERR(2, 112, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__119); __Pyx_GIVEREF(__pyx_tuple__119); /* "include/color_dict.pxi":113 * 'darkseagreen4' : (105, 139, 105), * 'darkslateblue' : (72, 61, 139), * 'darkslategray' : (47, 79, 79), # <<<<<<<<<<<<<< * 'darkslategray1' : (151, 255, 255), * 'darkslategray2' : (141, 238, 238), */ __pyx_tuple__120 = PyTuple_Pack(3, __pyx_int_47, __pyx_int_79, __pyx_int_79); if (unlikely(!__pyx_tuple__120)) __PYX_ERR(2, 113, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__120); __Pyx_GIVEREF(__pyx_tuple__120); /* "include/color_dict.pxi":114 * 'darkslateblue' : (72, 61, 139), * 'darkslategray' : (47, 79, 79), * 'darkslategray1' : (151, 255, 255), # <<<<<<<<<<<<<< * 'darkslategray2' : (141, 238, 238), * 'darkslategray3' : (121, 205, 205), */ __pyx_tuple__121 = PyTuple_Pack(3, __pyx_int_151, __pyx_int_255, __pyx_int_255); if (unlikely(!__pyx_tuple__121)) __PYX_ERR(2, 114, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__121); __Pyx_GIVEREF(__pyx_tuple__121); /* "include/color_dict.pxi":115 * 'darkslategray' : (47, 79, 79), * 'darkslategray1' : (151, 255, 255), * 'darkslategray2' : (141, 238, 238), # <<<<<<<<<<<<<< * 'darkslategray3' : (121, 205, 205), * 'darkslategray4' : (82, 139, 139), */ __pyx_tuple__122 = PyTuple_Pack(3, __pyx_int_141, __pyx_int_238, __pyx_int_238); if (unlikely(!__pyx_tuple__122)) __PYX_ERR(2, 115, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__122); __Pyx_GIVEREF(__pyx_tuple__122); /* "include/color_dict.pxi":116 * 'darkslategray1' : (151, 255, 255), * 'darkslategray2' : (141, 238, 238), * 'darkslategray3' : (121, 205, 205), # <<<<<<<<<<<<<< * 'darkslategray4' : (82, 139, 139), * 'darkslategrey' : (47, 79, 79), */ __pyx_tuple__123 = PyTuple_Pack(3, __pyx_int_121, __pyx_int_205, __pyx_int_205); if (unlikely(!__pyx_tuple__123)) __PYX_ERR(2, 116, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__123); __Pyx_GIVEREF(__pyx_tuple__123); /* "include/color_dict.pxi":117 * 'darkslategray2' : (141, 238, 238), * 'darkslategray3' : (121, 205, 205), * 'darkslategray4' : (82, 139, 139), # <<<<<<<<<<<<<< * 'darkslategrey' : (47, 79, 79), * 'darkturquoise' : (0, 206, 209), */ __pyx_tuple__124 = PyTuple_Pack(3, __pyx_int_82, __pyx_int_139, __pyx_int_139); if (unlikely(!__pyx_tuple__124)) __PYX_ERR(2, 117, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__124); __Pyx_GIVEREF(__pyx_tuple__124); /* "include/color_dict.pxi":118 * 'darkslategray3' : (121, 205, 205), * 'darkslategray4' : (82, 139, 139), * 'darkslategrey' : (47, 79, 79), # <<<<<<<<<<<<<< * 'darkturquoise' : (0, 206, 209), * 'darkviolet' : (148, 0, 211), */ __pyx_tuple__125 = PyTuple_Pack(3, __pyx_int_47, __pyx_int_79, __pyx_int_79); if (unlikely(!__pyx_tuple__125)) __PYX_ERR(2, 118, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__125); __Pyx_GIVEREF(__pyx_tuple__125); /* "include/color_dict.pxi":119 * 'darkslategray4' : (82, 139, 139), * 'darkslategrey' : (47, 79, 79), * 'darkturquoise' : (0, 206, 209), # <<<<<<<<<<<<<< * 'darkviolet' : (148, 0, 211), * 'deeppink' : (255, 20, 147), */ __pyx_tuple__126 = PyTuple_Pack(3, __pyx_int_0, __pyx_int_206, __pyx_int_209); if (unlikely(!__pyx_tuple__126)) __PYX_ERR(2, 119, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__126); __Pyx_GIVEREF(__pyx_tuple__126); /* "include/color_dict.pxi":120 * 'darkslategrey' : (47, 79, 79), * 'darkturquoise' : (0, 206, 209), * 'darkviolet' : (148, 0, 211), # <<<<<<<<<<<<<< * 'deeppink' : (255, 20, 147), * 'deeppink1' : (255, 20, 147), */ __pyx_tuple__127 = PyTuple_Pack(3, __pyx_int_148, __pyx_int_0, __pyx_int_211); if (unlikely(!__pyx_tuple__127)) __PYX_ERR(2, 120, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__127); __Pyx_GIVEREF(__pyx_tuple__127); /* "include/color_dict.pxi":121 * 'darkturquoise' : (0, 206, 209), * 'darkviolet' : (148, 0, 211), * 'deeppink' : (255, 20, 147), # <<<<<<<<<<<<<< * 'deeppink1' : (255, 20, 147), * 'deeppink2' : (238, 18, 137), */ __pyx_tuple__128 = PyTuple_Pack(3, __pyx_int_255, __pyx_int_20, __pyx_int_147); if (unlikely(!__pyx_tuple__128)) __PYX_ERR(2, 121, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__128); __Pyx_GIVEREF(__pyx_tuple__128); /* "include/color_dict.pxi":122 * 'darkviolet' : (148, 0, 211), * 'deeppink' : (255, 20, 147), * 'deeppink1' : (255, 20, 147), # <<<<<<<<<<<<<< * 'deeppink2' : (238, 18, 137), * 'deeppink3' : (205, 16, 118), */ __pyx_tuple__129 = PyTuple_Pack(3, __pyx_int_255, __pyx_int_20, __pyx_int_147); if (unlikely(!__pyx_tuple__129)) __PYX_ERR(2, 122, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__129); __Pyx_GIVEREF(__pyx_tuple__129); /* "include/color_dict.pxi":123 * 'deeppink' : (255, 20, 147), * 'deeppink1' : (255, 20, 147), * 'deeppink2' : (238, 18, 137), # <<<<<<<<<<<<<< * 'deeppink3' : (205, 16, 118), * 'deeppink4' : (139, 10, 80), */ __pyx_tuple__130 = PyTuple_Pack(3, __pyx_int_238, __pyx_int_18, __pyx_int_137); if (unlikely(!__pyx_tuple__130)) __PYX_ERR(2, 123, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__130); __Pyx_GIVEREF(__pyx_tuple__130); /* "include/color_dict.pxi":124 * 'deeppink1' : (255, 20, 147), * 'deeppink2' : (238, 18, 137), * 'deeppink3' : (205, 16, 118), # <<<<<<<<<<<<<< * 'deeppink4' : (139, 10, 80), * 'deepskyblue' : (0, 191, 255), */ __pyx_tuple__131 = PyTuple_Pack(3, __pyx_int_205, __pyx_int_16, __pyx_int_118); if (unlikely(!__pyx_tuple__131)) __PYX_ERR(2, 124, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__131); __Pyx_GIVEREF(__pyx_tuple__131); /* "include/color_dict.pxi":125 * 'deeppink2' : (238, 18, 137), * 'deeppink3' : (205, 16, 118), * 'deeppink4' : (139, 10, 80), # <<<<<<<<<<<<<< * 'deepskyblue' : (0, 191, 255), * 'deepskyblue1' : (0, 191, 255), */ __pyx_tuple__132 = PyTuple_Pack(3, __pyx_int_139, __pyx_int_10, __pyx_int_80); if (unlikely(!__pyx_tuple__132)) __PYX_ERR(2, 125, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__132); __Pyx_GIVEREF(__pyx_tuple__132); /* "include/color_dict.pxi":126 * 'deeppink3' : (205, 16, 118), * 'deeppink4' : (139, 10, 80), * 'deepskyblue' : (0, 191, 255), # <<<<<<<<<<<<<< * 'deepskyblue1' : (0, 191, 255), * 'deepskyblue2' : (0, 178, 238), */ __pyx_tuple__133 = PyTuple_Pack(3, __pyx_int_0, __pyx_int_191, __pyx_int_255); if (unlikely(!__pyx_tuple__133)) __PYX_ERR(2, 126, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__133); __Pyx_GIVEREF(__pyx_tuple__133); /* "include/color_dict.pxi":127 * 'deeppink4' : (139, 10, 80), * 'deepskyblue' : (0, 191, 255), * 'deepskyblue1' : (0, 191, 255), # <<<<<<<<<<<<<< * 'deepskyblue2' : (0, 178, 238), * 'deepskyblue3' : (0, 154, 205), */ __pyx_tuple__134 = PyTuple_Pack(3, __pyx_int_0, __pyx_int_191, __pyx_int_255); if (unlikely(!__pyx_tuple__134)) __PYX_ERR(2, 127, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__134); __Pyx_GIVEREF(__pyx_tuple__134); /* "include/color_dict.pxi":128 * 'deepskyblue' : (0, 191, 255), * 'deepskyblue1' : (0, 191, 255), * 'deepskyblue2' : (0, 178, 238), # <<<<<<<<<<<<<< * 'deepskyblue3' : (0, 154, 205), * 'deepskyblue4' : (0, 104, 139), */ __pyx_tuple__135 = PyTuple_Pack(3, __pyx_int_0, __pyx_int_178, __pyx_int_238); if (unlikely(!__pyx_tuple__135)) __PYX_ERR(2, 128, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__135); __Pyx_GIVEREF(__pyx_tuple__135); /* "include/color_dict.pxi":129 * 'deepskyblue1' : (0, 191, 255), * 'deepskyblue2' : (0, 178, 238), * 'deepskyblue3' : (0, 154, 205), # <<<<<<<<<<<<<< * 'deepskyblue4' : (0, 104, 139), * 'dimgray' : (105, 105, 105), */ __pyx_tuple__136 = PyTuple_Pack(3, __pyx_int_0, __pyx_int_154, __pyx_int_205); if (unlikely(!__pyx_tuple__136)) __PYX_ERR(2, 129, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__136); __Pyx_GIVEREF(__pyx_tuple__136); /* "include/color_dict.pxi":130 * 'deepskyblue2' : (0, 178, 238), * 'deepskyblue3' : (0, 154, 205), * 'deepskyblue4' : (0, 104, 139), # <<<<<<<<<<<<<< * 'dimgray' : (105, 105, 105), * 'dimgrey' : (105, 105, 105), */ __pyx_tuple__137 = PyTuple_Pack(3, __pyx_int_0, __pyx_int_104, __pyx_int_139); if (unlikely(!__pyx_tuple__137)) __PYX_ERR(2, 130, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__137); __Pyx_GIVEREF(__pyx_tuple__137); /* "include/color_dict.pxi":131 * 'deepskyblue3' : (0, 154, 205), * 'deepskyblue4' : (0, 104, 139), * 'dimgray' : (105, 105, 105), # <<<<<<<<<<<<<< * 'dimgrey' : (105, 105, 105), * 'dodgerblue' : (30, 144, 255), */ __pyx_tuple__138 = PyTuple_Pack(3, __pyx_int_105, __pyx_int_105, __pyx_int_105); if (unlikely(!__pyx_tuple__138)) __PYX_ERR(2, 131, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__138); __Pyx_GIVEREF(__pyx_tuple__138); /* "include/color_dict.pxi":132 * 'deepskyblue4' : (0, 104, 139), * 'dimgray' : (105, 105, 105), * 'dimgrey' : (105, 105, 105), # <<<<<<<<<<<<<< * 'dodgerblue' : (30, 144, 255), * 'dodgerblue1' : (30, 144, 255), */ __pyx_tuple__139 = PyTuple_Pack(3, __pyx_int_105, __pyx_int_105, __pyx_int_105); if (unlikely(!__pyx_tuple__139)) __PYX_ERR(2, 132, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__139); __Pyx_GIVEREF(__pyx_tuple__139); /* "include/color_dict.pxi":133 * 'dimgray' : (105, 105, 105), * 'dimgrey' : (105, 105, 105), * 'dodgerblue' : (30, 144, 255), # <<<<<<<<<<<<<< * 'dodgerblue1' : (30, 144, 255), * 'dodgerblue2' : (28, 134, 238), */ __pyx_tuple__140 = PyTuple_Pack(3, __pyx_int_30, __pyx_int_144, __pyx_int_255); if (unlikely(!__pyx_tuple__140)) __PYX_ERR(2, 133, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__140); __Pyx_GIVEREF(__pyx_tuple__140); /* "include/color_dict.pxi":134 * 'dimgrey' : (105, 105, 105), * 'dodgerblue' : (30, 144, 255), * 'dodgerblue1' : (30, 144, 255), # <<<<<<<<<<<<<< * 'dodgerblue2' : (28, 134, 238), * 'dodgerblue3' : (24, 116, 205), */ __pyx_tuple__141 = PyTuple_Pack(3, __pyx_int_30, __pyx_int_144, __pyx_int_255); if (unlikely(!__pyx_tuple__141)) __PYX_ERR(2, 134, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__141); __Pyx_GIVEREF(__pyx_tuple__141); /* "include/color_dict.pxi":135 * 'dodgerblue' : (30, 144, 255), * 'dodgerblue1' : (30, 144, 255), * 'dodgerblue2' : (28, 134, 238), # <<<<<<<<<<<<<< * 'dodgerblue3' : (24, 116, 205), * 'dodgerblue4' : (16, 78, 139), */ __pyx_tuple__142 = PyTuple_Pack(3, __pyx_int_28, __pyx_int_134, __pyx_int_238); if (unlikely(!__pyx_tuple__142)) __PYX_ERR(2, 135, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__142); __Pyx_GIVEREF(__pyx_tuple__142); /* "include/color_dict.pxi":136 * 'dodgerblue1' : (30, 144, 255), * 'dodgerblue2' : (28, 134, 238), * 'dodgerblue3' : (24, 116, 205), # <<<<<<<<<<<<<< * 'dodgerblue4' : (16, 78, 139), * 'firebrick' : (178, 34, 34), */ __pyx_tuple__143 = PyTuple_Pack(3, __pyx_int_24, __pyx_int_116, __pyx_int_205); if (unlikely(!__pyx_tuple__143)) __PYX_ERR(2, 136, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__143); __Pyx_GIVEREF(__pyx_tuple__143); /* "include/color_dict.pxi":137 * 'dodgerblue2' : (28, 134, 238), * 'dodgerblue3' : (24, 116, 205), * 'dodgerblue4' : (16, 78, 139), # <<<<<<<<<<<<<< * 'firebrick' : (178, 34, 34), * 'firebrick1' : (255, 48, 48), */ __pyx_tuple__144 = PyTuple_Pack(3, __pyx_int_16, __pyx_int_78, __pyx_int_139); if (unlikely(!__pyx_tuple__144)) __PYX_ERR(2, 137, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__144); __Pyx_GIVEREF(__pyx_tuple__144); /* "include/color_dict.pxi":138 * 'dodgerblue3' : (24, 116, 205), * 'dodgerblue4' : (16, 78, 139), * 'firebrick' : (178, 34, 34), # <<<<<<<<<<<<<< * 'firebrick1' : (255, 48, 48), * 'firebrick2' : (238, 44, 44), */ __pyx_tuple__145 = PyTuple_Pack(3, __pyx_int_178, __pyx_int_34, __pyx_int_34); if (unlikely(!__pyx_tuple__145)) __PYX_ERR(2, 138, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__145); __Pyx_GIVEREF(__pyx_tuple__145); /* "include/color_dict.pxi":139 * 'dodgerblue4' : (16, 78, 139), * 'firebrick' : (178, 34, 34), * 'firebrick1' : (255, 48, 48), # <<<<<<<<<<<<<< * 'firebrick2' : (238, 44, 44), * 'firebrick3' : (205, 38, 38), */ __pyx_tuple__146 = PyTuple_Pack(3, __pyx_int_255, __pyx_int_48, __pyx_int_48); if (unlikely(!__pyx_tuple__146)) __PYX_ERR(2, 139, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__146); __Pyx_GIVEREF(__pyx_tuple__146); /* "include/color_dict.pxi":140 * 'firebrick' : (178, 34, 34), * 'firebrick1' : (255, 48, 48), * 'firebrick2' : (238, 44, 44), # <<<<<<<<<<<<<< * 'firebrick3' : (205, 38, 38), * 'firebrick4' : (139, 26, 26), */ __pyx_tuple__147 = PyTuple_Pack(3, __pyx_int_238, __pyx_int_44, __pyx_int_44); if (unlikely(!__pyx_tuple__147)) __PYX_ERR(2, 140, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__147); __Pyx_GIVEREF(__pyx_tuple__147); /* "include/color_dict.pxi":141 * 'firebrick1' : (255, 48, 48), * 'firebrick2' : (238, 44, 44), * 'firebrick3' : (205, 38, 38), # <<<<<<<<<<<<<< * 'firebrick4' : (139, 26, 26), * 'floralwhite' : (255, 250, 240), */ __pyx_tuple__148 = PyTuple_Pack(3, __pyx_int_205, __pyx_int_38, __pyx_int_38); if (unlikely(!__pyx_tuple__148)) __PYX_ERR(2, 141, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__148); __Pyx_GIVEREF(__pyx_tuple__148); /* "include/color_dict.pxi":142 * 'firebrick2' : (238, 44, 44), * 'firebrick3' : (205, 38, 38), * 'firebrick4' : (139, 26, 26), # <<<<<<<<<<<<<< * 'floralwhite' : (255, 250, 240), * 'forestgreen' : (34, 139, 34), */ __pyx_tuple__149 = PyTuple_Pack(3, __pyx_int_139, __pyx_int_26, __pyx_int_26); if (unlikely(!__pyx_tuple__149)) __PYX_ERR(2, 142, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__149); __Pyx_GIVEREF(__pyx_tuple__149); /* "include/color_dict.pxi":143 * 'firebrick3' : (205, 38, 38), * 'firebrick4' : (139, 26, 26), * 'floralwhite' : (255, 250, 240), # <<<<<<<<<<<<<< * 'forestgreen' : (34, 139, 34), * 'fuchsia' : (255, 0, 255), */ __pyx_tuple__150 = PyTuple_Pack(3, __pyx_int_255, __pyx_int_250, __pyx_int_240); if (unlikely(!__pyx_tuple__150)) __PYX_ERR(2, 143, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__150); __Pyx_GIVEREF(__pyx_tuple__150); /* "include/color_dict.pxi":144 * 'firebrick4' : (139, 26, 26), * 'floralwhite' : (255, 250, 240), * 'forestgreen' : (34, 139, 34), # <<<<<<<<<<<<<< * 'fuchsia' : (255, 0, 255), * 'gainsboro' : (220, 220, 220), */ __pyx_tuple__151 = PyTuple_Pack(3, __pyx_int_34, __pyx_int_139, __pyx_int_34); if (unlikely(!__pyx_tuple__151)) __PYX_ERR(2, 144, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__151); __Pyx_GIVEREF(__pyx_tuple__151); /* "include/color_dict.pxi":145 * 'floralwhite' : (255, 250, 240), * 'forestgreen' : (34, 139, 34), * 'fuchsia' : (255, 0, 255), # <<<<<<<<<<<<<< * 'gainsboro' : (220, 220, 220), * 'ghostwhite' : (248, 248, 255), */ __pyx_tuple__152 = PyTuple_Pack(3, __pyx_int_255, __pyx_int_0, __pyx_int_255); if (unlikely(!__pyx_tuple__152)) __PYX_ERR(2, 145, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__152); __Pyx_GIVEREF(__pyx_tuple__152); /* "include/color_dict.pxi":146 * 'forestgreen' : (34, 139, 34), * 'fuchsia' : (255, 0, 255), * 'gainsboro' : (220, 220, 220), # <<<<<<<<<<<<<< * 'ghostwhite' : (248, 248, 255), * 'gold' : (255, 215, 0), */ __pyx_tuple__153 = PyTuple_Pack(3, __pyx_int_220, __pyx_int_220, __pyx_int_220); if (unlikely(!__pyx_tuple__153)) __PYX_ERR(2, 146, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__153); __Pyx_GIVEREF(__pyx_tuple__153); /* "include/color_dict.pxi":147 * 'fuchsia' : (255, 0, 255), * 'gainsboro' : (220, 220, 220), * 'ghostwhite' : (248, 248, 255), # <<<<<<<<<<<<<< * 'gold' : (255, 215, 0), * 'gold1' : (255, 215, 0), */ __pyx_tuple__154 = PyTuple_Pack(3, __pyx_int_248, __pyx_int_248, __pyx_int_255); if (unlikely(!__pyx_tuple__154)) __PYX_ERR(2, 147, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__154); __Pyx_GIVEREF(__pyx_tuple__154); /* "include/color_dict.pxi":148 * 'gainsboro' : (220, 220, 220), * 'ghostwhite' : (248, 248, 255), * 'gold' : (255, 215, 0), # <<<<<<<<<<<<<< * 'gold1' : (255, 215, 0), * 'gold2' : (238, 201, 0), */ __pyx_tuple__155 = PyTuple_Pack(3, __pyx_int_255, __pyx_int_215, __pyx_int_0); if (unlikely(!__pyx_tuple__155)) __PYX_ERR(2, 148, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__155); __Pyx_GIVEREF(__pyx_tuple__155); /* "include/color_dict.pxi":149 * 'ghostwhite' : (248, 248, 255), * 'gold' : (255, 215, 0), * 'gold1' : (255, 215, 0), # <<<<<<<<<<<<<< * 'gold2' : (238, 201, 0), * 'gold3' : (205, 173, 0), */ __pyx_tuple__156 = PyTuple_Pack(3, __pyx_int_255, __pyx_int_215, __pyx_int_0); if (unlikely(!__pyx_tuple__156)) __PYX_ERR(2, 149, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__156); __Pyx_GIVEREF(__pyx_tuple__156); /* "include/color_dict.pxi":150 * 'gold' : (255, 215, 0), * 'gold1' : (255, 215, 0), * 'gold2' : (238, 201, 0), # <<<<<<<<<<<<<< * 'gold3' : (205, 173, 0), * 'gold4' : (139, 117, 0), */ __pyx_tuple__157 = PyTuple_Pack(3, __pyx_int_238, __pyx_int_201, __pyx_int_0); if (unlikely(!__pyx_tuple__157)) __PYX_ERR(2, 150, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__157); __Pyx_GIVEREF(__pyx_tuple__157); /* "include/color_dict.pxi":151 * 'gold1' : (255, 215, 0), * 'gold2' : (238, 201, 0), * 'gold3' : (205, 173, 0), # <<<<<<<<<<<<<< * 'gold4' : (139, 117, 0), * 'goldenrod' : (218, 165, 32), */ __pyx_tuple__158 = PyTuple_Pack(3, __pyx_int_205, __pyx_int_173, __pyx_int_0); if (unlikely(!__pyx_tuple__158)) __PYX_ERR(2, 151, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__158); __Pyx_GIVEREF(__pyx_tuple__158); /* "include/color_dict.pxi":152 * 'gold2' : (238, 201, 0), * 'gold3' : (205, 173, 0), * 'gold4' : (139, 117, 0), # <<<<<<<<<<<<<< * 'goldenrod' : (218, 165, 32), * 'goldenrod1' : (255, 193, 37), */ __pyx_tuple__159 = PyTuple_Pack(3, __pyx_int_139, __pyx_int_117, __pyx_int_0); if (unlikely(!__pyx_tuple__159)) __PYX_ERR(2, 152, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__159); __Pyx_GIVEREF(__pyx_tuple__159); /* "include/color_dict.pxi":153 * 'gold3' : (205, 173, 0), * 'gold4' : (139, 117, 0), * 'goldenrod' : (218, 165, 32), # <<<<<<<<<<<<<< * 'goldenrod1' : (255, 193, 37), * 'goldenrod2' : (238, 180, 34), */ __pyx_tuple__160 = PyTuple_Pack(3, __pyx_int_218, __pyx_int_165, __pyx_int_32); if (unlikely(!__pyx_tuple__160)) __PYX_ERR(2, 153, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__160); __Pyx_GIVEREF(__pyx_tuple__160); /* "include/color_dict.pxi":154 * 'gold4' : (139, 117, 0), * 'goldenrod' : (218, 165, 32), * 'goldenrod1' : (255, 193, 37), # <<<<<<<<<<<<<< * 'goldenrod2' : (238, 180, 34), * 'goldenrod3' : (205, 155, 29), */ __pyx_tuple__161 = PyTuple_Pack(3, __pyx_int_255, __pyx_int_193, __pyx_int_37); if (unlikely(!__pyx_tuple__161)) __PYX_ERR(2, 154, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__161); __Pyx_GIVEREF(__pyx_tuple__161); /* "include/color_dict.pxi":155 * 'goldenrod' : (218, 165, 32), * 'goldenrod1' : (255, 193, 37), * 'goldenrod2' : (238, 180, 34), # <<<<<<<<<<<<<< * 'goldenrod3' : (205, 155, 29), * 'goldenrod4' : (139, 105, 20), */ __pyx_tuple__162 = PyTuple_Pack(3, __pyx_int_238, __pyx_int_180, __pyx_int_34); if (unlikely(!__pyx_tuple__162)) __PYX_ERR(2, 155, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__162); __Pyx_GIVEREF(__pyx_tuple__162); /* "include/color_dict.pxi":156 * 'goldenrod1' : (255, 193, 37), * 'goldenrod2' : (238, 180, 34), * 'goldenrod3' : (205, 155, 29), # <<<<<<<<<<<<<< * 'goldenrod4' : (139, 105, 20), * 'gray' : (190, 190, 190), */ __pyx_tuple__163 = PyTuple_Pack(3, __pyx_int_205, __pyx_int_155, __pyx_int_29); if (unlikely(!__pyx_tuple__163)) __PYX_ERR(2, 156, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__163); __Pyx_GIVEREF(__pyx_tuple__163); /* "include/color_dict.pxi":157 * 'goldenrod2' : (238, 180, 34), * 'goldenrod3' : (205, 155, 29), * 'goldenrod4' : (139, 105, 20), # <<<<<<<<<<<<<< * 'gray' : (190, 190, 190), * 'gray0' : (0, 0, 0), */ __pyx_tuple__164 = PyTuple_Pack(3, __pyx_int_139, __pyx_int_105, __pyx_int_20); if (unlikely(!__pyx_tuple__164)) __PYX_ERR(2, 157, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__164); __Pyx_GIVEREF(__pyx_tuple__164); /* "include/color_dict.pxi":158 * 'goldenrod3' : (205, 155, 29), * 'goldenrod4' : (139, 105, 20), * 'gray' : (190, 190, 190), # <<<<<<<<<<<<<< * 'gray0' : (0, 0, 0), * 'gray1' : (3, 3, 3), */ __pyx_tuple__165 = PyTuple_Pack(3, __pyx_int_190, __pyx_int_190, __pyx_int_190); if (unlikely(!__pyx_tuple__165)) __PYX_ERR(2, 158, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__165); __Pyx_GIVEREF(__pyx_tuple__165); /* "include/color_dict.pxi":159 * 'goldenrod4' : (139, 105, 20), * 'gray' : (190, 190, 190), * 'gray0' : (0, 0, 0), # <<<<<<<<<<<<<< * 'gray1' : (3, 3, 3), * 'gray10' : (26, 26, 26), */ __pyx_tuple__166 = PyTuple_Pack(3, __pyx_int_0, __pyx_int_0, __pyx_int_0); if (unlikely(!__pyx_tuple__166)) __PYX_ERR(2, 159, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__166); __Pyx_GIVEREF(__pyx_tuple__166); /* "include/color_dict.pxi":160 * 'gray' : (190, 190, 190), * 'gray0' : (0, 0, 0), * 'gray1' : (3, 3, 3), # <<<<<<<<<<<<<< * 'gray10' : (26, 26, 26), * 'gray100' : (255, 255, 255), */ __pyx_tuple__167 = PyTuple_Pack(3, __pyx_int_3, __pyx_int_3, __pyx_int_3); if (unlikely(!__pyx_tuple__167)) __PYX_ERR(2, 160, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__167); __Pyx_GIVEREF(__pyx_tuple__167); /* "include/color_dict.pxi":161 * 'gray0' : (0, 0, 0), * 'gray1' : (3, 3, 3), * 'gray10' : (26, 26, 26), # <<<<<<<<<<<<<< * 'gray100' : (255, 255, 255), * 'gray11' : (28, 28, 28), */ __pyx_tuple__168 = PyTuple_Pack(3, __pyx_int_26, __pyx_int_26, __pyx_int_26); if (unlikely(!__pyx_tuple__168)) __PYX_ERR(2, 161, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__168); __Pyx_GIVEREF(__pyx_tuple__168); /* "include/color_dict.pxi":162 * 'gray1' : (3, 3, 3), * 'gray10' : (26, 26, 26), * 'gray100' : (255, 255, 255), # <<<<<<<<<<<<<< * 'gray11' : (28, 28, 28), * 'gray12' : (31, 31, 31), */ __pyx_tuple__169 = PyTuple_Pack(3, __pyx_int_255, __pyx_int_255, __pyx_int_255); if (unlikely(!__pyx_tuple__169)) __PYX_ERR(2, 162, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__169); __Pyx_GIVEREF(__pyx_tuple__169); /* "include/color_dict.pxi":163 * 'gray10' : (26, 26, 26), * 'gray100' : (255, 255, 255), * 'gray11' : (28, 28, 28), # <<<<<<<<<<<<<< * 'gray12' : (31, 31, 31), * 'gray13' : (33, 33, 33), */ __pyx_tuple__170 = PyTuple_Pack(3, __pyx_int_28, __pyx_int_28, __pyx_int_28); if (unlikely(!__pyx_tuple__170)) __PYX_ERR(2, 163, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__170); __Pyx_GIVEREF(__pyx_tuple__170); /* "include/color_dict.pxi":164 * 'gray100' : (255, 255, 255), * 'gray11' : (28, 28, 28), * 'gray12' : (31, 31, 31), # <<<<<<<<<<<<<< * 'gray13' : (33, 33, 33), * 'gray14' : (36, 36, 36), */ __pyx_tuple__171 = PyTuple_Pack(3, __pyx_int_31, __pyx_int_31, __pyx_int_31); if (unlikely(!__pyx_tuple__171)) __PYX_ERR(2, 164, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__171); __Pyx_GIVEREF(__pyx_tuple__171); /* "include/color_dict.pxi":165 * 'gray11' : (28, 28, 28), * 'gray12' : (31, 31, 31), * 'gray13' : (33, 33, 33), # <<<<<<<<<<<<<< * 'gray14' : (36, 36, 36), * 'gray15' : (38, 38, 38), */ __pyx_tuple__172 = PyTuple_Pack(3, __pyx_int_33, __pyx_int_33, __pyx_int_33); if (unlikely(!__pyx_tuple__172)) __PYX_ERR(2, 165, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__172); __Pyx_GIVEREF(__pyx_tuple__172); /* "include/color_dict.pxi":166 * 'gray12' : (31, 31, 31), * 'gray13' : (33, 33, 33), * 'gray14' : (36, 36, 36), # <<<<<<<<<<<<<< * 'gray15' : (38, 38, 38), * 'gray16' : (41, 41, 41), */ __pyx_tuple__173 = PyTuple_Pack(3, __pyx_int_36, __pyx_int_36, __pyx_int_36); if (unlikely(!__pyx_tuple__173)) __PYX_ERR(2, 166, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__173); __Pyx_GIVEREF(__pyx_tuple__173); /* "include/color_dict.pxi":167 * 'gray13' : (33, 33, 33), * 'gray14' : (36, 36, 36), * 'gray15' : (38, 38, 38), # <<<<<<<<<<<<<< * 'gray16' : (41, 41, 41), * 'gray17' : (43, 43, 43), */ __pyx_tuple__174 = PyTuple_Pack(3, __pyx_int_38, __pyx_int_38, __pyx_int_38); if (unlikely(!__pyx_tuple__174)) __PYX_ERR(2, 167, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__174); __Pyx_GIVEREF(__pyx_tuple__174); /* "include/color_dict.pxi":168 * 'gray14' : (36, 36, 36), * 'gray15' : (38, 38, 38), * 'gray16' : (41, 41, 41), # <<<<<<<<<<<<<< * 'gray17' : (43, 43, 43), * 'gray18' : (46, 46, 46), */ __pyx_tuple__175 = PyTuple_Pack(3, __pyx_int_41, __pyx_int_41, __pyx_int_41); if (unlikely(!__pyx_tuple__175)) __PYX_ERR(2, 168, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__175); __Pyx_GIVEREF(__pyx_tuple__175); /* "include/color_dict.pxi":169 * 'gray15' : (38, 38, 38), * 'gray16' : (41, 41, 41), * 'gray17' : (43, 43, 43), # <<<<<<<<<<<<<< * 'gray18' : (46, 46, 46), * 'gray19' : (48, 48, 48), */ __pyx_tuple__176 = PyTuple_Pack(3, __pyx_int_43, __pyx_int_43, __pyx_int_43); if (unlikely(!__pyx_tuple__176)) __PYX_ERR(2, 169, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__176); __Pyx_GIVEREF(__pyx_tuple__176); /* "include/color_dict.pxi":170 * 'gray16' : (41, 41, 41), * 'gray17' : (43, 43, 43), * 'gray18' : (46, 46, 46), # <<<<<<<<<<<<<< * 'gray19' : (48, 48, 48), * 'gray2' : (5, 5, 5), */ __pyx_tuple__177 = PyTuple_Pack(3, __pyx_int_46, __pyx_int_46, __pyx_int_46); if (unlikely(!__pyx_tuple__177)) __PYX_ERR(2, 170, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__177); __Pyx_GIVEREF(__pyx_tuple__177); /* "include/color_dict.pxi":171 * 'gray17' : (43, 43, 43), * 'gray18' : (46, 46, 46), * 'gray19' : (48, 48, 48), # <<<<<<<<<<<<<< * 'gray2' : (5, 5, 5), * 'gray20' : (51, 51, 51), */ __pyx_tuple__178 = PyTuple_Pack(3, __pyx_int_48, __pyx_int_48, __pyx_int_48); if (unlikely(!__pyx_tuple__178)) __PYX_ERR(2, 171, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__178); __Pyx_GIVEREF(__pyx_tuple__178); /* "include/color_dict.pxi":172 * 'gray18' : (46, 46, 46), * 'gray19' : (48, 48, 48), * 'gray2' : (5, 5, 5), # <<<<<<<<<<<<<< * 'gray20' : (51, 51, 51), * 'gray21' : (54, 54, 54), */ __pyx_tuple__179 = PyTuple_Pack(3, __pyx_int_5, __pyx_int_5, __pyx_int_5); if (unlikely(!__pyx_tuple__179)) __PYX_ERR(2, 172, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__179); __Pyx_GIVEREF(__pyx_tuple__179); /* "include/color_dict.pxi":173 * 'gray19' : (48, 48, 48), * 'gray2' : (5, 5, 5), * 'gray20' : (51, 51, 51), # <<<<<<<<<<<<<< * 'gray21' : (54, 54, 54), * 'gray22' : (56, 56, 56), */ __pyx_tuple__180 = PyTuple_Pack(3, __pyx_int_51, __pyx_int_51, __pyx_int_51); if (unlikely(!__pyx_tuple__180)) __PYX_ERR(2, 173, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__180); __Pyx_GIVEREF(__pyx_tuple__180); /* "include/color_dict.pxi":174 * 'gray2' : (5, 5, 5), * 'gray20' : (51, 51, 51), * 'gray21' : (54, 54, 54), # <<<<<<<<<<<<<< * 'gray22' : (56, 56, 56), * 'gray23' : (59, 59, 59), */ __pyx_tuple__181 = PyTuple_Pack(3, __pyx_int_54, __pyx_int_54, __pyx_int_54); if (unlikely(!__pyx_tuple__181)) __PYX_ERR(2, 174, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__181); __Pyx_GIVEREF(__pyx_tuple__181); /* "include/color_dict.pxi":175 * 'gray20' : (51, 51, 51), * 'gray21' : (54, 54, 54), * 'gray22' : (56, 56, 56), # <<<<<<<<<<<<<< * 'gray23' : (59, 59, 59), * 'gray24' : (61, 61, 61), */ __pyx_tuple__182 = PyTuple_Pack(3, __pyx_int_56, __pyx_int_56, __pyx_int_56); if (unlikely(!__pyx_tuple__182)) __PYX_ERR(2, 175, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__182); __Pyx_GIVEREF(__pyx_tuple__182); /* "include/color_dict.pxi":176 * 'gray21' : (54, 54, 54), * 'gray22' : (56, 56, 56), * 'gray23' : (59, 59, 59), # <<<<<<<<<<<<<< * 'gray24' : (61, 61, 61), * 'gray25' : (64, 64, 64), */ __pyx_tuple__183 = PyTuple_Pack(3, __pyx_int_59, __pyx_int_59, __pyx_int_59); if (unlikely(!__pyx_tuple__183)) __PYX_ERR(2, 176, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__183); __Pyx_GIVEREF(__pyx_tuple__183); /* "include/color_dict.pxi":177 * 'gray22' : (56, 56, 56), * 'gray23' : (59, 59, 59), * 'gray24' : (61, 61, 61), # <<<<<<<<<<<<<< * 'gray25' : (64, 64, 64), * 'gray26' : (66, 66, 66), */ __pyx_tuple__184 = PyTuple_Pack(3, __pyx_int_61, __pyx_int_61, __pyx_int_61); if (unlikely(!__pyx_tuple__184)) __PYX_ERR(2, 177, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__184); __Pyx_GIVEREF(__pyx_tuple__184); /* "include/color_dict.pxi":178 * 'gray23' : (59, 59, 59), * 'gray24' : (61, 61, 61), * 'gray25' : (64, 64, 64), # <<<<<<<<<<<<<< * 'gray26' : (66, 66, 66), * 'gray27' : (69, 69, 69), */ __pyx_tuple__185 = PyTuple_Pack(3, __pyx_int_64, __pyx_int_64, __pyx_int_64); if (unlikely(!__pyx_tuple__185)) __PYX_ERR(2, 178, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__185); __Pyx_GIVEREF(__pyx_tuple__185); /* "include/color_dict.pxi":179 * 'gray24' : (61, 61, 61), * 'gray25' : (64, 64, 64), * 'gray26' : (66, 66, 66), # <<<<<<<<<<<<<< * 'gray27' : (69, 69, 69), * 'gray28' : (71, 71, 71), */ __pyx_tuple__186 = PyTuple_Pack(3, __pyx_int_66, __pyx_int_66, __pyx_int_66); if (unlikely(!__pyx_tuple__186)) __PYX_ERR(2, 179, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__186); __Pyx_GIVEREF(__pyx_tuple__186); /* "include/color_dict.pxi":180 * 'gray25' : (64, 64, 64), * 'gray26' : (66, 66, 66), * 'gray27' : (69, 69, 69), # <<<<<<<<<<<<<< * 'gray28' : (71, 71, 71), * 'gray29' : (74, 74, 74), */ __pyx_tuple__187 = PyTuple_Pack(3, __pyx_int_69, __pyx_int_69, __pyx_int_69); if (unlikely(!__pyx_tuple__187)) __PYX_ERR(2, 180, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__187); __Pyx_GIVEREF(__pyx_tuple__187); /* "include/color_dict.pxi":181 * 'gray26' : (66, 66, 66), * 'gray27' : (69, 69, 69), * 'gray28' : (71, 71, 71), # <<<<<<<<<<<<<< * 'gray29' : (74, 74, 74), * 'gray3' : (8, 8, 8), */ __pyx_tuple__188 = PyTuple_Pack(3, __pyx_int_71, __pyx_int_71, __pyx_int_71); if (unlikely(!__pyx_tuple__188)) __PYX_ERR(2, 181, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__188); __Pyx_GIVEREF(__pyx_tuple__188); /* "include/color_dict.pxi":182 * 'gray27' : (69, 69, 69), * 'gray28' : (71, 71, 71), * 'gray29' : (74, 74, 74), # <<<<<<<<<<<<<< * 'gray3' : (8, 8, 8), * 'gray30' : (77, 77, 77), */ __pyx_tuple__189 = PyTuple_Pack(3, __pyx_int_74, __pyx_int_74, __pyx_int_74); if (unlikely(!__pyx_tuple__189)) __PYX_ERR(2, 182, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__189); __Pyx_GIVEREF(__pyx_tuple__189); /* "include/color_dict.pxi":183 * 'gray28' : (71, 71, 71), * 'gray29' : (74, 74, 74), * 'gray3' : (8, 8, 8), # <<<<<<<<<<<<<< * 'gray30' : (77, 77, 77), * 'gray31' : (79, 79, 79), */ __pyx_tuple__190 = PyTuple_Pack(3, __pyx_int_8, __pyx_int_8, __pyx_int_8); if (unlikely(!__pyx_tuple__190)) __PYX_ERR(2, 183, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__190); __Pyx_GIVEREF(__pyx_tuple__190); /* "include/color_dict.pxi":184 * 'gray29' : (74, 74, 74), * 'gray3' : (8, 8, 8), * 'gray30' : (77, 77, 77), # <<<<<<<<<<<<<< * 'gray31' : (79, 79, 79), * 'gray32' : (82, 82, 82), */ __pyx_tuple__191 = PyTuple_Pack(3, __pyx_int_77, __pyx_int_77, __pyx_int_77); if (unlikely(!__pyx_tuple__191)) __PYX_ERR(2, 184, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__191); __Pyx_GIVEREF(__pyx_tuple__191); /* "include/color_dict.pxi":185 * 'gray3' : (8, 8, 8), * 'gray30' : (77, 77, 77), * 'gray31' : (79, 79, 79), # <<<<<<<<<<<<<< * 'gray32' : (82, 82, 82), * 'gray33' : (84, 84, 84), */ __pyx_tuple__192 = PyTuple_Pack(3, __pyx_int_79, __pyx_int_79, __pyx_int_79); if (unlikely(!__pyx_tuple__192)) __PYX_ERR(2, 185, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__192); __Pyx_GIVEREF(__pyx_tuple__192); /* "include/color_dict.pxi":186 * 'gray30' : (77, 77, 77), * 'gray31' : (79, 79, 79), * 'gray32' : (82, 82, 82), # <<<<<<<<<<<<<< * 'gray33' : (84, 84, 84), * 'gray34' : (87, 87, 87), */ __pyx_tuple__193 = PyTuple_Pack(3, __pyx_int_82, __pyx_int_82, __pyx_int_82); if (unlikely(!__pyx_tuple__193)) __PYX_ERR(2, 186, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__193); __Pyx_GIVEREF(__pyx_tuple__193); /* "include/color_dict.pxi":187 * 'gray31' : (79, 79, 79), * 'gray32' : (82, 82, 82), * 'gray33' : (84, 84, 84), # <<<<<<<<<<<<<< * 'gray34' : (87, 87, 87), * 'gray35' : (89, 89, 89), */ __pyx_tuple__194 = PyTuple_Pack(3, __pyx_int_84, __pyx_int_84, __pyx_int_84); if (unlikely(!__pyx_tuple__194)) __PYX_ERR(2, 187, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__194); __Pyx_GIVEREF(__pyx_tuple__194); /* "include/color_dict.pxi":188 * 'gray32' : (82, 82, 82), * 'gray33' : (84, 84, 84), * 'gray34' : (87, 87, 87), # <<<<<<<<<<<<<< * 'gray35' : (89, 89, 89), * 'gray36' : (92, 92, 92), */ __pyx_tuple__195 = PyTuple_Pack(3, __pyx_int_87, __pyx_int_87, __pyx_int_87); if (unlikely(!__pyx_tuple__195)) __PYX_ERR(2, 188, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__195); __Pyx_GIVEREF(__pyx_tuple__195); /* "include/color_dict.pxi":189 * 'gray33' : (84, 84, 84), * 'gray34' : (87, 87, 87), * 'gray35' : (89, 89, 89), # <<<<<<<<<<<<<< * 'gray36' : (92, 92, 92), * 'gray37' : (94, 94, 94), */ __pyx_tuple__196 = PyTuple_Pack(3, __pyx_int_89, __pyx_int_89, __pyx_int_89); if (unlikely(!__pyx_tuple__196)) __PYX_ERR(2, 189, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__196); __Pyx_GIVEREF(__pyx_tuple__196); /* "include/color_dict.pxi":190 * 'gray34' : (87, 87, 87), * 'gray35' : (89, 89, 89), * 'gray36' : (92, 92, 92), # <<<<<<<<<<<<<< * 'gray37' : (94, 94, 94), * 'gray38' : (97, 97, 97), */ __pyx_tuple__197 = PyTuple_Pack(3, __pyx_int_92, __pyx_int_92, __pyx_int_92); if (unlikely(!__pyx_tuple__197)) __PYX_ERR(2, 190, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__197); __Pyx_GIVEREF(__pyx_tuple__197); /* "include/color_dict.pxi":191 * 'gray35' : (89, 89, 89), * 'gray36' : (92, 92, 92), * 'gray37' : (94, 94, 94), # <<<<<<<<<<<<<< * 'gray38' : (97, 97, 97), * 'gray39' : (99, 99, 99), */ __pyx_tuple__198 = PyTuple_Pack(3, __pyx_int_94, __pyx_int_94, __pyx_int_94); if (unlikely(!__pyx_tuple__198)) __PYX_ERR(2, 191, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__198); __Pyx_GIVEREF(__pyx_tuple__198); /* "include/color_dict.pxi":192 * 'gray36' : (92, 92, 92), * 'gray37' : (94, 94, 94), * 'gray38' : (97, 97, 97), # <<<<<<<<<<<<<< * 'gray39' : (99, 99, 99), * 'gray4' : (10, 10, 10), */ __pyx_tuple__199 = PyTuple_Pack(3, __pyx_int_97, __pyx_int_97, __pyx_int_97); if (unlikely(!__pyx_tuple__199)) __PYX_ERR(2, 192, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__199); __Pyx_GIVEREF(__pyx_tuple__199); /* "include/color_dict.pxi":193 * 'gray37' : (94, 94, 94), * 'gray38' : (97, 97, 97), * 'gray39' : (99, 99, 99), # <<<<<<<<<<<<<< * 'gray4' : (10, 10, 10), * 'gray40' : (102, 102, 102), */ __pyx_tuple__200 = PyTuple_Pack(3, __pyx_int_99, __pyx_int_99, __pyx_int_99); if (unlikely(!__pyx_tuple__200)) __PYX_ERR(2, 193, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__200); __Pyx_GIVEREF(__pyx_tuple__200); /* "include/color_dict.pxi":194 * 'gray38' : (97, 97, 97), * 'gray39' : (99, 99, 99), * 'gray4' : (10, 10, 10), # <<<<<<<<<<<<<< * 'gray40' : (102, 102, 102), * 'gray41' : (105, 105, 105), */ __pyx_tuple__201 = PyTuple_Pack(3, __pyx_int_10, __pyx_int_10, __pyx_int_10); if (unlikely(!__pyx_tuple__201)) __PYX_ERR(2, 194, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__201); __Pyx_GIVEREF(__pyx_tuple__201); /* "include/color_dict.pxi":195 * 'gray39' : (99, 99, 99), * 'gray4' : (10, 10, 10), * 'gray40' : (102, 102, 102), # <<<<<<<<<<<<<< * 'gray41' : (105, 105, 105), * 'gray42' : (107, 107, 107), */ __pyx_tuple__202 = PyTuple_Pack(3, __pyx_int_102, __pyx_int_102, __pyx_int_102); if (unlikely(!__pyx_tuple__202)) __PYX_ERR(2, 195, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__202); __Pyx_GIVEREF(__pyx_tuple__202); /* "include/color_dict.pxi":196 * 'gray4' : (10, 10, 10), * 'gray40' : (102, 102, 102), * 'gray41' : (105, 105, 105), # <<<<<<<<<<<<<< * 'gray42' : (107, 107, 107), * 'gray43' : (110, 110, 110), */ __pyx_tuple__203 = PyTuple_Pack(3, __pyx_int_105, __pyx_int_105, __pyx_int_105); if (unlikely(!__pyx_tuple__203)) __PYX_ERR(2, 196, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__203); __Pyx_GIVEREF(__pyx_tuple__203); /* "include/color_dict.pxi":197 * 'gray40' : (102, 102, 102), * 'gray41' : (105, 105, 105), * 'gray42' : (107, 107, 107), # <<<<<<<<<<<<<< * 'gray43' : (110, 110, 110), * 'gray44' : (112, 112, 112), */ __pyx_tuple__204 = PyTuple_Pack(3, __pyx_int_107, __pyx_int_107, __pyx_int_107); if (unlikely(!__pyx_tuple__204)) __PYX_ERR(2, 197, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__204); __Pyx_GIVEREF(__pyx_tuple__204); /* "include/color_dict.pxi":198 * 'gray41' : (105, 105, 105), * 'gray42' : (107, 107, 107), * 'gray43' : (110, 110, 110), # <<<<<<<<<<<<<< * 'gray44' : (112, 112, 112), * 'gray45' : (115, 115, 115), */ __pyx_tuple__205 = PyTuple_Pack(3, __pyx_int_110, __pyx_int_110, __pyx_int_110); if (unlikely(!__pyx_tuple__205)) __PYX_ERR(2, 198, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__205); __Pyx_GIVEREF(__pyx_tuple__205); /* "include/color_dict.pxi":199 * 'gray42' : (107, 107, 107), * 'gray43' : (110, 110, 110), * 'gray44' : (112, 112, 112), # <<<<<<<<<<<<<< * 'gray45' : (115, 115, 115), * 'gray46' : (117, 117, 117), */ __pyx_tuple__206 = PyTuple_Pack(3, __pyx_int_112, __pyx_int_112, __pyx_int_112); if (unlikely(!__pyx_tuple__206)) __PYX_ERR(2, 199, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__206); __Pyx_GIVEREF(__pyx_tuple__206); /* "include/color_dict.pxi":200 * 'gray43' : (110, 110, 110), * 'gray44' : (112, 112, 112), * 'gray45' : (115, 115, 115), # <<<<<<<<<<<<<< * 'gray46' : (117, 117, 117), * 'gray47' : (120, 120, 120), */ __pyx_tuple__207 = PyTuple_Pack(3, __pyx_int_115, __pyx_int_115, __pyx_int_115); if (unlikely(!__pyx_tuple__207)) __PYX_ERR(2, 200, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__207); __Pyx_GIVEREF(__pyx_tuple__207); /* "include/color_dict.pxi":201 * 'gray44' : (112, 112, 112), * 'gray45' : (115, 115, 115), * 'gray46' : (117, 117, 117), # <<<<<<<<<<<<<< * 'gray47' : (120, 120, 120), * 'gray48' : (122, 122, 122), */ __pyx_tuple__208 = PyTuple_Pack(3, __pyx_int_117, __pyx_int_117, __pyx_int_117); if (unlikely(!__pyx_tuple__208)) __PYX_ERR(2, 201, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__208); __Pyx_GIVEREF(__pyx_tuple__208); /* "include/color_dict.pxi":202 * 'gray45' : (115, 115, 115), * 'gray46' : (117, 117, 117), * 'gray47' : (120, 120, 120), # <<<<<<<<<<<<<< * 'gray48' : (122, 122, 122), * 'gray49' : (125, 125, 125), */ __pyx_tuple__209 = PyTuple_Pack(3, __pyx_int_120, __pyx_int_120, __pyx_int_120); if (unlikely(!__pyx_tuple__209)) __PYX_ERR(2, 202, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__209); __Pyx_GIVEREF(__pyx_tuple__209); /* "include/color_dict.pxi":203 * 'gray46' : (117, 117, 117), * 'gray47' : (120, 120, 120), * 'gray48' : (122, 122, 122), # <<<<<<<<<<<<<< * 'gray49' : (125, 125, 125), * 'gray5' : (13, 13, 13), */ __pyx_tuple__210 = PyTuple_Pack(3, __pyx_int_122, __pyx_int_122, __pyx_int_122); if (unlikely(!__pyx_tuple__210)) __PYX_ERR(2, 203, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__210); __Pyx_GIVEREF(__pyx_tuple__210); /* "include/color_dict.pxi":204 * 'gray47' : (120, 120, 120), * 'gray48' : (122, 122, 122), * 'gray49' : (125, 125, 125), # <<<<<<<<<<<<<< * 'gray5' : (13, 13, 13), * 'gray50' : (127, 127, 127), */ __pyx_tuple__211 = PyTuple_Pack(3, __pyx_int_125, __pyx_int_125, __pyx_int_125); if (unlikely(!__pyx_tuple__211)) __PYX_ERR(2, 204, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__211); __Pyx_GIVEREF(__pyx_tuple__211); /* "include/color_dict.pxi":205 * 'gray48' : (122, 122, 122), * 'gray49' : (125, 125, 125), * 'gray5' : (13, 13, 13), # <<<<<<<<<<<<<< * 'gray50' : (127, 127, 127), * 'gray51' : (130, 130, 130), */ __pyx_tuple__212 = PyTuple_Pack(3, __pyx_int_13, __pyx_int_13, __pyx_int_13); if (unlikely(!__pyx_tuple__212)) __PYX_ERR(2, 205, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__212); __Pyx_GIVEREF(__pyx_tuple__212); /* "include/color_dict.pxi":206 * 'gray49' : (125, 125, 125), * 'gray5' : (13, 13, 13), * 'gray50' : (127, 127, 127), # <<<<<<<<<<<<<< * 'gray51' : (130, 130, 130), * 'gray52' : (133, 133, 133), */ __pyx_tuple__213 = PyTuple_Pack(3, __pyx_int_127, __pyx_int_127, __pyx_int_127); if (unlikely(!__pyx_tuple__213)) __PYX_ERR(2, 206, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__213); __Pyx_GIVEREF(__pyx_tuple__213); /* "include/color_dict.pxi":207 * 'gray5' : (13, 13, 13), * 'gray50' : (127, 127, 127), * 'gray51' : (130, 130, 130), # <<<<<<<<<<<<<< * 'gray52' : (133, 133, 133), * 'gray53' : (135, 135, 135), */ __pyx_tuple__214 = PyTuple_Pack(3, __pyx_int_130, __pyx_int_130, __pyx_int_130); if (unlikely(!__pyx_tuple__214)) __PYX_ERR(2, 207, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__214); __Pyx_GIVEREF(__pyx_tuple__214); /* "include/color_dict.pxi":208 * 'gray50' : (127, 127, 127), * 'gray51' : (130, 130, 130), * 'gray52' : (133, 133, 133), # <<<<<<<<<<<<<< * 'gray53' : (135, 135, 135), * 'gray54' : (138, 138, 138), */ __pyx_tuple__215 = PyTuple_Pack(3, __pyx_int_133, __pyx_int_133, __pyx_int_133); if (unlikely(!__pyx_tuple__215)) __PYX_ERR(2, 208, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__215); __Pyx_GIVEREF(__pyx_tuple__215); /* "include/color_dict.pxi":209 * 'gray51' : (130, 130, 130), * 'gray52' : (133, 133, 133), * 'gray53' : (135, 135, 135), # <<<<<<<<<<<<<< * 'gray54' : (138, 138, 138), * 'gray55' : (140, 140, 140), */ __pyx_tuple__216 = PyTuple_Pack(3, __pyx_int_135, __pyx_int_135, __pyx_int_135); if (unlikely(!__pyx_tuple__216)) __PYX_ERR(2, 209, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__216); __Pyx_GIVEREF(__pyx_tuple__216); /* "include/color_dict.pxi":210 * 'gray52' : (133, 133, 133), * 'gray53' : (135, 135, 135), * 'gray54' : (138, 138, 138), # <<<<<<<<<<<<<< * 'gray55' : (140, 140, 140), * 'gray56' : (143, 143, 143), */ __pyx_tuple__217 = PyTuple_Pack(3, __pyx_int_138, __pyx_int_138, __pyx_int_138); if (unlikely(!__pyx_tuple__217)) __PYX_ERR(2, 210, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__217); __Pyx_GIVEREF(__pyx_tuple__217); /* "include/color_dict.pxi":211 * 'gray53' : (135, 135, 135), * 'gray54' : (138, 138, 138), * 'gray55' : (140, 140, 140), # <<<<<<<<<<<<<< * 'gray56' : (143, 143, 143), * 'gray57' : (145, 145, 145), */ __pyx_tuple__218 = PyTuple_Pack(3, __pyx_int_140, __pyx_int_140, __pyx_int_140); if (unlikely(!__pyx_tuple__218)) __PYX_ERR(2, 211, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__218); __Pyx_GIVEREF(__pyx_tuple__218); /* "include/color_dict.pxi":212 * 'gray54' : (138, 138, 138), * 'gray55' : (140, 140, 140), * 'gray56' : (143, 143, 143), # <<<<<<<<<<<<<< * 'gray57' : (145, 145, 145), * 'gray58' : (148, 148, 148), */ __pyx_tuple__219 = PyTuple_Pack(3, __pyx_int_143, __pyx_int_143, __pyx_int_143); if (unlikely(!__pyx_tuple__219)) __PYX_ERR(2, 212, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__219); __Pyx_GIVEREF(__pyx_tuple__219); /* "include/color_dict.pxi":213 * 'gray55' : (140, 140, 140), * 'gray56' : (143, 143, 143), * 'gray57' : (145, 145, 145), # <<<<<<<<<<<<<< * 'gray58' : (148, 148, 148), * 'gray59' : (150, 150, 150), */ __pyx_tuple__220 = PyTuple_Pack(3, __pyx_int_145, __pyx_int_145, __pyx_int_145); if (unlikely(!__pyx_tuple__220)) __PYX_ERR(2, 213, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__220); __Pyx_GIVEREF(__pyx_tuple__220); /* "include/color_dict.pxi":214 * 'gray56' : (143, 143, 143), * 'gray57' : (145, 145, 145), * 'gray58' : (148, 148, 148), # <<<<<<<<<<<<<< * 'gray59' : (150, 150, 150), * 'gray6' : (15, 15, 15), */ __pyx_tuple__221 = PyTuple_Pack(3, __pyx_int_148, __pyx_int_148, __pyx_int_148); if (unlikely(!__pyx_tuple__221)) __PYX_ERR(2, 214, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__221); __Pyx_GIVEREF(__pyx_tuple__221); /* "include/color_dict.pxi":215 * 'gray57' : (145, 145, 145), * 'gray58' : (148, 148, 148), * 'gray59' : (150, 150, 150), # <<<<<<<<<<<<<< * 'gray6' : (15, 15, 15), * 'gray60' : (153, 153, 153), */ __pyx_tuple__222 = PyTuple_Pack(3, __pyx_int_150, __pyx_int_150, __pyx_int_150); if (unlikely(!__pyx_tuple__222)) __PYX_ERR(2, 215, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__222); __Pyx_GIVEREF(__pyx_tuple__222); /* "include/color_dict.pxi":216 * 'gray58' : (148, 148, 148), * 'gray59' : (150, 150, 150), * 'gray6' : (15, 15, 15), # <<<<<<<<<<<<<< * 'gray60' : (153, 153, 153), * 'gray61' : (156, 156, 156), */ __pyx_tuple__223 = PyTuple_Pack(3, __pyx_int_15, __pyx_int_15, __pyx_int_15); if (unlikely(!__pyx_tuple__223)) __PYX_ERR(2, 216, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__223); __Pyx_GIVEREF(__pyx_tuple__223); /* "include/color_dict.pxi":217 * 'gray59' : (150, 150, 150), * 'gray6' : (15, 15, 15), * 'gray60' : (153, 153, 153), # <<<<<<<<<<<<<< * 'gray61' : (156, 156, 156), * 'gray62' : (158, 158, 158), */ __pyx_tuple__224 = PyTuple_Pack(3, __pyx_int_153, __pyx_int_153, __pyx_int_153); if (unlikely(!__pyx_tuple__224)) __PYX_ERR(2, 217, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__224); __Pyx_GIVEREF(__pyx_tuple__224); /* "include/color_dict.pxi":218 * 'gray6' : (15, 15, 15), * 'gray60' : (153, 153, 153), * 'gray61' : (156, 156, 156), # <<<<<<<<<<<<<< * 'gray62' : (158, 158, 158), * 'gray63' : (161, 161, 161), */ __pyx_tuple__225 = PyTuple_Pack(3, __pyx_int_156, __pyx_int_156, __pyx_int_156); if (unlikely(!__pyx_tuple__225)) __PYX_ERR(2, 218, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__225); __Pyx_GIVEREF(__pyx_tuple__225); /* "include/color_dict.pxi":219 * 'gray60' : (153, 153, 153), * 'gray61' : (156, 156, 156), * 'gray62' : (158, 158, 158), # <<<<<<<<<<<<<< * 'gray63' : (161, 161, 161), * 'gray64' : (163, 163, 163), */ __pyx_tuple__226 = PyTuple_Pack(3, __pyx_int_158, __pyx_int_158, __pyx_int_158); if (unlikely(!__pyx_tuple__226)) __PYX_ERR(2, 219, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__226); __Pyx_GIVEREF(__pyx_tuple__226); /* "include/color_dict.pxi":220 * 'gray61' : (156, 156, 156), * 'gray62' : (158, 158, 158), * 'gray63' : (161, 161, 161), # <<<<<<<<<<<<<< * 'gray64' : (163, 163, 163), * 'gray65' : (166, 166, 166), */ __pyx_tuple__227 = PyTuple_Pack(3, __pyx_int_161, __pyx_int_161, __pyx_int_161); if (unlikely(!__pyx_tuple__227)) __PYX_ERR(2, 220, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__227); __Pyx_GIVEREF(__pyx_tuple__227); /* "include/color_dict.pxi":221 * 'gray62' : (158, 158, 158), * 'gray63' : (161, 161, 161), * 'gray64' : (163, 163, 163), # <<<<<<<<<<<<<< * 'gray65' : (166, 166, 166), * 'gray66' : (168, 168, 168), */ __pyx_tuple__228 = PyTuple_Pack(3, __pyx_int_163, __pyx_int_163, __pyx_int_163); if (unlikely(!__pyx_tuple__228)) __PYX_ERR(2, 221, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__228); __Pyx_GIVEREF(__pyx_tuple__228); /* "include/color_dict.pxi":222 * 'gray63' : (161, 161, 161), * 'gray64' : (163, 163, 163), * 'gray65' : (166, 166, 166), # <<<<<<<<<<<<<< * 'gray66' : (168, 168, 168), * 'gray67' : (171, 171, 171), */ __pyx_tuple__229 = PyTuple_Pack(3, __pyx_int_166, __pyx_int_166, __pyx_int_166); if (unlikely(!__pyx_tuple__229)) __PYX_ERR(2, 222, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__229); __Pyx_GIVEREF(__pyx_tuple__229); /* "include/color_dict.pxi":223 * 'gray64' : (163, 163, 163), * 'gray65' : (166, 166, 166), * 'gray66' : (168, 168, 168), # <<<<<<<<<<<<<< * 'gray67' : (171, 171, 171), * 'gray68' : (173, 173, 173), */ __pyx_tuple__230 = PyTuple_Pack(3, __pyx_int_168, __pyx_int_168, __pyx_int_168); if (unlikely(!__pyx_tuple__230)) __PYX_ERR(2, 223, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__230); __Pyx_GIVEREF(__pyx_tuple__230); /* "include/color_dict.pxi":224 * 'gray65' : (166, 166, 166), * 'gray66' : (168, 168, 168), * 'gray67' : (171, 171, 171), # <<<<<<<<<<<<<< * 'gray68' : (173, 173, 173), * 'gray69' : (176, 176, 176), */ __pyx_tuple__231 = PyTuple_Pack(3, __pyx_int_171, __pyx_int_171, __pyx_int_171); if (unlikely(!__pyx_tuple__231)) __PYX_ERR(2, 224, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__231); __Pyx_GIVEREF(__pyx_tuple__231); /* "include/color_dict.pxi":225 * 'gray66' : (168, 168, 168), * 'gray67' : (171, 171, 171), * 'gray68' : (173, 173, 173), # <<<<<<<<<<<<<< * 'gray69' : (176, 176, 176), * 'gray7' : (18, 18, 18), */ __pyx_tuple__232 = PyTuple_Pack(3, __pyx_int_173, __pyx_int_173, __pyx_int_173); if (unlikely(!__pyx_tuple__232)) __PYX_ERR(2, 225, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__232); __Pyx_GIVEREF(__pyx_tuple__232); /* "include/color_dict.pxi":226 * 'gray67' : (171, 171, 171), * 'gray68' : (173, 173, 173), * 'gray69' : (176, 176, 176), # <<<<<<<<<<<<<< * 'gray7' : (18, 18, 18), * 'gray70' : (179, 179, 179), */ __pyx_tuple__233 = PyTuple_Pack(3, __pyx_int_176, __pyx_int_176, __pyx_int_176); if (unlikely(!__pyx_tuple__233)) __PYX_ERR(2, 226, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__233); __Pyx_GIVEREF(__pyx_tuple__233); /* "include/color_dict.pxi":227 * 'gray68' : (173, 173, 173), * 'gray69' : (176, 176, 176), * 'gray7' : (18, 18, 18), # <<<<<<<<<<<<<< * 'gray70' : (179, 179, 179), * 'gray71' : (181, 181, 181), */ __pyx_tuple__234 = PyTuple_Pack(3, __pyx_int_18, __pyx_int_18, __pyx_int_18); if (unlikely(!__pyx_tuple__234)) __PYX_ERR(2, 227, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__234); __Pyx_GIVEREF(__pyx_tuple__234); /* "include/color_dict.pxi":228 * 'gray69' : (176, 176, 176), * 'gray7' : (18, 18, 18), * 'gray70' : (179, 179, 179), # <<<<<<<<<<<<<< * 'gray71' : (181, 181, 181), * 'gray72' : (184, 184, 184), */ __pyx_tuple__235 = PyTuple_Pack(3, __pyx_int_179, __pyx_int_179, __pyx_int_179); if (unlikely(!__pyx_tuple__235)) __PYX_ERR(2, 228, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__235); __Pyx_GIVEREF(__pyx_tuple__235); /* "include/color_dict.pxi":229 * 'gray7' : (18, 18, 18), * 'gray70' : (179, 179, 179), * 'gray71' : (181, 181, 181), # <<<<<<<<<<<<<< * 'gray72' : (184, 184, 184), * 'gray73' : (186, 186, 186), */ __pyx_tuple__236 = PyTuple_Pack(3, __pyx_int_181, __pyx_int_181, __pyx_int_181); if (unlikely(!__pyx_tuple__236)) __PYX_ERR(2, 229, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__236); __Pyx_GIVEREF(__pyx_tuple__236); /* "include/color_dict.pxi":230 * 'gray70' : (179, 179, 179), * 'gray71' : (181, 181, 181), * 'gray72' : (184, 184, 184), # <<<<<<<<<<<<<< * 'gray73' : (186, 186, 186), * 'gray74' : (189, 189, 189), */ __pyx_tuple__237 = PyTuple_Pack(3, __pyx_int_184, __pyx_int_184, __pyx_int_184); if (unlikely(!__pyx_tuple__237)) __PYX_ERR(2, 230, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__237); __Pyx_GIVEREF(__pyx_tuple__237); /* "include/color_dict.pxi":231 * 'gray71' : (181, 181, 181), * 'gray72' : (184, 184, 184), * 'gray73' : (186, 186, 186), # <<<<<<<<<<<<<< * 'gray74' : (189, 189, 189), * 'gray75' : (191, 191, 191), */ __pyx_tuple__238 = PyTuple_Pack(3, __pyx_int_186, __pyx_int_186, __pyx_int_186); if (unlikely(!__pyx_tuple__238)) __PYX_ERR(2, 231, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__238); __Pyx_GIVEREF(__pyx_tuple__238); /* "include/color_dict.pxi":232 * 'gray72' : (184, 184, 184), * 'gray73' : (186, 186, 186), * 'gray74' : (189, 189, 189), # <<<<<<<<<<<<<< * 'gray75' : (191, 191, 191), * 'gray76' : (194, 194, 194), */ __pyx_tuple__239 = PyTuple_Pack(3, __pyx_int_189, __pyx_int_189, __pyx_int_189); if (unlikely(!__pyx_tuple__239)) __PYX_ERR(2, 232, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__239); __Pyx_GIVEREF(__pyx_tuple__239); /* "include/color_dict.pxi":233 * 'gray73' : (186, 186, 186), * 'gray74' : (189, 189, 189), * 'gray75' : (191, 191, 191), # <<<<<<<<<<<<<< * 'gray76' : (194, 194, 194), * 'gray77' : (196, 196, 196), */ __pyx_tuple__240 = PyTuple_Pack(3, __pyx_int_191, __pyx_int_191, __pyx_int_191); if (unlikely(!__pyx_tuple__240)) __PYX_ERR(2, 233, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__240); __Pyx_GIVEREF(__pyx_tuple__240); /* "include/color_dict.pxi":234 * 'gray74' : (189, 189, 189), * 'gray75' : (191, 191, 191), * 'gray76' : (194, 194, 194), # <<<<<<<<<<<<<< * 'gray77' : (196, 196, 196), * 'gray78' : (199, 199, 199), */ __pyx_tuple__241 = PyTuple_Pack(3, __pyx_int_194, __pyx_int_194, __pyx_int_194); if (unlikely(!__pyx_tuple__241)) __PYX_ERR(2, 234, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__241); __Pyx_GIVEREF(__pyx_tuple__241); /* "include/color_dict.pxi":235 * 'gray75' : (191, 191, 191), * 'gray76' : (194, 194, 194), * 'gray77' : (196, 196, 196), # <<<<<<<<<<<<<< * 'gray78' : (199, 199, 199), * 'gray79' : (201, 201, 201), */ __pyx_tuple__242 = PyTuple_Pack(3, __pyx_int_196, __pyx_int_196, __pyx_int_196); if (unlikely(!__pyx_tuple__242)) __PYX_ERR(2, 235, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__242); __Pyx_GIVEREF(__pyx_tuple__242); /* "include/color_dict.pxi":236 * 'gray76' : (194, 194, 194), * 'gray77' : (196, 196, 196), * 'gray78' : (199, 199, 199), # <<<<<<<<<<<<<< * 'gray79' : (201, 201, 201), * 'gray8' : (20, 20, 20), */ __pyx_tuple__243 = PyTuple_Pack(3, __pyx_int_199, __pyx_int_199, __pyx_int_199); if (unlikely(!__pyx_tuple__243)) __PYX_ERR(2, 236, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__243); __Pyx_GIVEREF(__pyx_tuple__243); /* "include/color_dict.pxi":237 * 'gray77' : (196, 196, 196), * 'gray78' : (199, 199, 199), * 'gray79' : (201, 201, 201), # <<<<<<<<<<<<<< * 'gray8' : (20, 20, 20), * 'gray80' : (204, 204, 204), */ __pyx_tuple__244 = PyTuple_Pack(3, __pyx_int_201, __pyx_int_201, __pyx_int_201); if (unlikely(!__pyx_tuple__244)) __PYX_ERR(2, 237, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__244); __Pyx_GIVEREF(__pyx_tuple__244); /* "include/color_dict.pxi":238 * 'gray78' : (199, 199, 199), * 'gray79' : (201, 201, 201), * 'gray8' : (20, 20, 20), # <<<<<<<<<<<<<< * 'gray80' : (204, 204, 204), * 'gray81' : (207, 207, 207), */ __pyx_tuple__245 = PyTuple_Pack(3, __pyx_int_20, __pyx_int_20, __pyx_int_20); if (unlikely(!__pyx_tuple__245)) __PYX_ERR(2, 238, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__245); __Pyx_GIVEREF(__pyx_tuple__245); /* "include/color_dict.pxi":239 * 'gray79' : (201, 201, 201), * 'gray8' : (20, 20, 20), * 'gray80' : (204, 204, 204), # <<<<<<<<<<<<<< * 'gray81' : (207, 207, 207), * 'gray82' : (209, 209, 209), */ __pyx_tuple__246 = PyTuple_Pack(3, __pyx_int_204, __pyx_int_204, __pyx_int_204); if (unlikely(!__pyx_tuple__246)) __PYX_ERR(2, 239, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__246); __Pyx_GIVEREF(__pyx_tuple__246); /* "include/color_dict.pxi":240 * 'gray8' : (20, 20, 20), * 'gray80' : (204, 204, 204), * 'gray81' : (207, 207, 207), # <<<<<<<<<<<<<< * 'gray82' : (209, 209, 209), * 'gray83' : (212, 212, 212), */ __pyx_tuple__247 = PyTuple_Pack(3, __pyx_int_207, __pyx_int_207, __pyx_int_207); if (unlikely(!__pyx_tuple__247)) __PYX_ERR(2, 240, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__247); __Pyx_GIVEREF(__pyx_tuple__247); /* "include/color_dict.pxi":241 * 'gray80' : (204, 204, 204), * 'gray81' : (207, 207, 207), * 'gray82' : (209, 209, 209), # <<<<<<<<<<<<<< * 'gray83' : (212, 212, 212), * 'gray84' : (214, 214, 214), */ __pyx_tuple__248 = PyTuple_Pack(3, __pyx_int_209, __pyx_int_209, __pyx_int_209); if (unlikely(!__pyx_tuple__248)) __PYX_ERR(2, 241, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__248); __Pyx_GIVEREF(__pyx_tuple__248); /* "include/color_dict.pxi":242 * 'gray81' : (207, 207, 207), * 'gray82' : (209, 209, 209), * 'gray83' : (212, 212, 212), # <<<<<<<<<<<<<< * 'gray84' : (214, 214, 214), * 'gray85' : (217, 217, 217), */ __pyx_tuple__249 = PyTuple_Pack(3, __pyx_int_212, __pyx_int_212, __pyx_int_212); if (unlikely(!__pyx_tuple__249)) __PYX_ERR(2, 242, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__249); __Pyx_GIVEREF(__pyx_tuple__249); /* "include/color_dict.pxi":243 * 'gray82' : (209, 209, 209), * 'gray83' : (212, 212, 212), * 'gray84' : (214, 214, 214), # <<<<<<<<<<<<<< * 'gray85' : (217, 217, 217), * 'gray86' : (219, 219, 219), */ __pyx_tuple__250 = PyTuple_Pack(3, __pyx_int_214, __pyx_int_214, __pyx_int_214); if (unlikely(!__pyx_tuple__250)) __PYX_ERR(2, 243, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__250); __Pyx_GIVEREF(__pyx_tuple__250); /* "include/color_dict.pxi":244 * 'gray83' : (212, 212, 212), * 'gray84' : (214, 214, 214), * 'gray85' : (217, 217, 217), # <<<<<<<<<<<<<< * 'gray86' : (219, 219, 219), * 'gray87' : (222, 222, 222), */ __pyx_tuple__251 = PyTuple_Pack(3, __pyx_int_217, __pyx_int_217, __pyx_int_217); if (unlikely(!__pyx_tuple__251)) __PYX_ERR(2, 244, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__251); __Pyx_GIVEREF(__pyx_tuple__251); /* "include/color_dict.pxi":245 * 'gray84' : (214, 214, 214), * 'gray85' : (217, 217, 217), * 'gray86' : (219, 219, 219), # <<<<<<<<<<<<<< * 'gray87' : (222, 222, 222), * 'gray88' : (224, 224, 224), */ __pyx_tuple__252 = PyTuple_Pack(3, __pyx_int_219, __pyx_int_219, __pyx_int_219); if (unlikely(!__pyx_tuple__252)) __PYX_ERR(2, 245, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__252); __Pyx_GIVEREF(__pyx_tuple__252); /* "include/color_dict.pxi":246 * 'gray85' : (217, 217, 217), * 'gray86' : (219, 219, 219), * 'gray87' : (222, 222, 222), # <<<<<<<<<<<<<< * 'gray88' : (224, 224, 224), * 'gray89' : (227, 227, 227), */ __pyx_tuple__253 = PyTuple_Pack(3, __pyx_int_222, __pyx_int_222, __pyx_int_222); if (unlikely(!__pyx_tuple__253)) __PYX_ERR(2, 246, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__253); __Pyx_GIVEREF(__pyx_tuple__253); /* "include/color_dict.pxi":247 * 'gray86' : (219, 219, 219), * 'gray87' : (222, 222, 222), * 'gray88' : (224, 224, 224), # <<<<<<<<<<<<<< * 'gray89' : (227, 227, 227), * 'gray9' : (23, 23, 23), */ __pyx_tuple__254 = PyTuple_Pack(3, __pyx_int_224, __pyx_int_224, __pyx_int_224); if (unlikely(!__pyx_tuple__254)) __PYX_ERR(2, 247, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__254); __Pyx_GIVEREF(__pyx_tuple__254); /* "include/color_dict.pxi":248 * 'gray87' : (222, 222, 222), * 'gray88' : (224, 224, 224), * 'gray89' : (227, 227, 227), # <<<<<<<<<<<<<< * 'gray9' : (23, 23, 23), * 'gray90' : (229, 229, 229), */ __pyx_tuple__255 = PyTuple_Pack(3, __pyx_int_227, __pyx_int_227, __pyx_int_227); if (unlikely(!__pyx_tuple__255)) __PYX_ERR(2, 248, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__255); __Pyx_GIVEREF(__pyx_tuple__255); /* "include/color_dict.pxi":249 * 'gray88' : (224, 224, 224), * 'gray89' : (227, 227, 227), * 'gray9' : (23, 23, 23), # <<<<<<<<<<<<<< * 'gray90' : (229, 229, 229), * 'gray91' : (232, 232, 232), */ __pyx_tuple__256 = PyTuple_Pack(3, __pyx_int_23, __pyx_int_23, __pyx_int_23); if (unlikely(!__pyx_tuple__256)) __PYX_ERR(2, 249, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__256); __Pyx_GIVEREF(__pyx_tuple__256); /* "include/color_dict.pxi":250 * 'gray89' : (227, 227, 227), * 'gray9' : (23, 23, 23), * 'gray90' : (229, 229, 229), # <<<<<<<<<<<<<< * 'gray91' : (232, 232, 232), * 'gray92' : (235, 235, 235), */ __pyx_tuple__257 = PyTuple_Pack(3, __pyx_int_229, __pyx_int_229, __pyx_int_229); if (unlikely(!__pyx_tuple__257)) __PYX_ERR(2, 250, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__257); __Pyx_GIVEREF(__pyx_tuple__257); /* "include/color_dict.pxi":251 * 'gray9' : (23, 23, 23), * 'gray90' : (229, 229, 229), * 'gray91' : (232, 232, 232), # <<<<<<<<<<<<<< * 'gray92' : (235, 235, 235), * 'gray93' : (237, 237, 237), */ __pyx_tuple__258 = PyTuple_Pack(3, __pyx_int_232, __pyx_int_232, __pyx_int_232); if (unlikely(!__pyx_tuple__258)) __PYX_ERR(2, 251, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__258); __Pyx_GIVEREF(__pyx_tuple__258); /* "include/color_dict.pxi":252 * 'gray90' : (229, 229, 229), * 'gray91' : (232, 232, 232), * 'gray92' : (235, 235, 235), # <<<<<<<<<<<<<< * 'gray93' : (237, 237, 237), * 'gray94' : (240, 240, 240), */ __pyx_tuple__259 = PyTuple_Pack(3, __pyx_int_235, __pyx_int_235, __pyx_int_235); if (unlikely(!__pyx_tuple__259)) __PYX_ERR(2, 252, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__259); __Pyx_GIVEREF(__pyx_tuple__259); /* "include/color_dict.pxi":253 * 'gray91' : (232, 232, 232), * 'gray92' : (235, 235, 235), * 'gray93' : (237, 237, 237), # <<<<<<<<<<<<<< * 'gray94' : (240, 240, 240), * 'gray95' : (242, 242, 242), */ __pyx_tuple__260 = PyTuple_Pack(3, __pyx_int_237, __pyx_int_237, __pyx_int_237); if (unlikely(!__pyx_tuple__260)) __PYX_ERR(2, 253, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__260); __Pyx_GIVEREF(__pyx_tuple__260); /* "include/color_dict.pxi":254 * 'gray92' : (235, 235, 235), * 'gray93' : (237, 237, 237), * 'gray94' : (240, 240, 240), # <<<<<<<<<<<<<< * 'gray95' : (242, 242, 242), * 'gray96' : (245, 245, 245), */ __pyx_tuple__261 = PyTuple_Pack(3, __pyx_int_240, __pyx_int_240, __pyx_int_240); if (unlikely(!__pyx_tuple__261)) __PYX_ERR(2, 254, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__261); __Pyx_GIVEREF(__pyx_tuple__261); /* "include/color_dict.pxi":255 * 'gray93' : (237, 237, 237), * 'gray94' : (240, 240, 240), * 'gray95' : (242, 242, 242), # <<<<<<<<<<<<<< * 'gray96' : (245, 245, 245), * 'gray97' : (247, 247, 247), */ __pyx_tuple__262 = PyTuple_Pack(3, __pyx_int_242, __pyx_int_242, __pyx_int_242); if (unlikely(!__pyx_tuple__262)) __PYX_ERR(2, 255, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__262); __Pyx_GIVEREF(__pyx_tuple__262); /* "include/color_dict.pxi":256 * 'gray94' : (240, 240, 240), * 'gray95' : (242, 242, 242), * 'gray96' : (245, 245, 245), # <<<<<<<<<<<<<< * 'gray97' : (247, 247, 247), * 'gray98' : (250, 250, 250), */ __pyx_tuple__263 = PyTuple_Pack(3, __pyx_int_245, __pyx_int_245, __pyx_int_245); if (unlikely(!__pyx_tuple__263)) __PYX_ERR(2, 256, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__263); __Pyx_GIVEREF(__pyx_tuple__263); /* "include/color_dict.pxi":257 * 'gray95' : (242, 242, 242), * 'gray96' : (245, 245, 245), * 'gray97' : (247, 247, 247), # <<<<<<<<<<<<<< * 'gray98' : (250, 250, 250), * 'gray99' : (252, 252, 252), */ __pyx_tuple__264 = PyTuple_Pack(3, __pyx_int_247, __pyx_int_247, __pyx_int_247); if (unlikely(!__pyx_tuple__264)) __PYX_ERR(2, 257, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__264); __Pyx_GIVEREF(__pyx_tuple__264); /* "include/color_dict.pxi":258 * 'gray96' : (245, 245, 245), * 'gray97' : (247, 247, 247), * 'gray98' : (250, 250, 250), # <<<<<<<<<<<<<< * 'gray99' : (252, 252, 252), * 'green' : (0, 255, 0), */ __pyx_tuple__265 = PyTuple_Pack(3, __pyx_int_250, __pyx_int_250, __pyx_int_250); if (unlikely(!__pyx_tuple__265)) __PYX_ERR(2, 258, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__265); __Pyx_GIVEREF(__pyx_tuple__265); /* "include/color_dict.pxi":259 * 'gray97' : (247, 247, 247), * 'gray98' : (250, 250, 250), * 'gray99' : (252, 252, 252), # <<<<<<<<<<<<<< * 'green' : (0, 255, 0), * 'green1' : (0, 255, 0), */ __pyx_tuple__266 = PyTuple_Pack(3, __pyx_int_252, __pyx_int_252, __pyx_int_252); if (unlikely(!__pyx_tuple__266)) __PYX_ERR(2, 259, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__266); __Pyx_GIVEREF(__pyx_tuple__266); /* "include/color_dict.pxi":260 * 'gray98' : (250, 250, 250), * 'gray99' : (252, 252, 252), * 'green' : (0, 255, 0), # <<<<<<<<<<<<<< * 'green1' : (0, 255, 0), * 'green2' : (0, 238, 0), */ __pyx_tuple__267 = PyTuple_Pack(3, __pyx_int_0, __pyx_int_255, __pyx_int_0); if (unlikely(!__pyx_tuple__267)) __PYX_ERR(2, 260, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__267); __Pyx_GIVEREF(__pyx_tuple__267); /* "include/color_dict.pxi":261 * 'gray99' : (252, 252, 252), * 'green' : (0, 255, 0), * 'green1' : (0, 255, 0), # <<<<<<<<<<<<<< * 'green2' : (0, 238, 0), * 'green3' : (0, 205, 0), */ __pyx_tuple__268 = PyTuple_Pack(3, __pyx_int_0, __pyx_int_255, __pyx_int_0); if (unlikely(!__pyx_tuple__268)) __PYX_ERR(2, 261, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__268); __Pyx_GIVEREF(__pyx_tuple__268); /* "include/color_dict.pxi":262 * 'green' : (0, 255, 0), * 'green1' : (0, 255, 0), * 'green2' : (0, 238, 0), # <<<<<<<<<<<<<< * 'green3' : (0, 205, 0), * 'green4' : (0, 139, 0), */ __pyx_tuple__269 = PyTuple_Pack(3, __pyx_int_0, __pyx_int_238, __pyx_int_0); if (unlikely(!__pyx_tuple__269)) __PYX_ERR(2, 262, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__269); __Pyx_GIVEREF(__pyx_tuple__269); /* "include/color_dict.pxi":263 * 'green1' : (0, 255, 0), * 'green2' : (0, 238, 0), * 'green3' : (0, 205, 0), # <<<<<<<<<<<<<< * 'green4' : (0, 139, 0), * 'greenyellow' : (173, 255, 47), */ __pyx_tuple__270 = PyTuple_Pack(3, __pyx_int_0, __pyx_int_205, __pyx_int_0); if (unlikely(!__pyx_tuple__270)) __PYX_ERR(2, 263, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__270); __Pyx_GIVEREF(__pyx_tuple__270); /* "include/color_dict.pxi":264 * 'green2' : (0, 238, 0), * 'green3' : (0, 205, 0), * 'green4' : (0, 139, 0), # <<<<<<<<<<<<<< * 'greenyellow' : (173, 255, 47), * 'grey' : (190, 190, 190), */ __pyx_tuple__271 = PyTuple_Pack(3, __pyx_int_0, __pyx_int_139, __pyx_int_0); if (unlikely(!__pyx_tuple__271)) __PYX_ERR(2, 264, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__271); __Pyx_GIVEREF(__pyx_tuple__271); /* "include/color_dict.pxi":265 * 'green3' : (0, 205, 0), * 'green4' : (0, 139, 0), * 'greenyellow' : (173, 255, 47), # <<<<<<<<<<<<<< * 'grey' : (190, 190, 190), * 'grey0' : (0, 0, 0), */ __pyx_tuple__272 = PyTuple_Pack(3, __pyx_int_173, __pyx_int_255, __pyx_int_47); if (unlikely(!__pyx_tuple__272)) __PYX_ERR(2, 265, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__272); __Pyx_GIVEREF(__pyx_tuple__272); /* "include/color_dict.pxi":266 * 'green4' : (0, 139, 0), * 'greenyellow' : (173, 255, 47), * 'grey' : (190, 190, 190), # <<<<<<<<<<<<<< * 'grey0' : (0, 0, 0), * 'grey1' : (3, 3, 3), */ __pyx_tuple__273 = PyTuple_Pack(3, __pyx_int_190, __pyx_int_190, __pyx_int_190); if (unlikely(!__pyx_tuple__273)) __PYX_ERR(2, 266, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__273); __Pyx_GIVEREF(__pyx_tuple__273); /* "include/color_dict.pxi":267 * 'greenyellow' : (173, 255, 47), * 'grey' : (190, 190, 190), * 'grey0' : (0, 0, 0), # <<<<<<<<<<<<<< * 'grey1' : (3, 3, 3), * 'grey10' : (26, 26, 26), */ __pyx_tuple__274 = PyTuple_Pack(3, __pyx_int_0, __pyx_int_0, __pyx_int_0); if (unlikely(!__pyx_tuple__274)) __PYX_ERR(2, 267, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__274); __Pyx_GIVEREF(__pyx_tuple__274); /* "include/color_dict.pxi":268 * 'grey' : (190, 190, 190), * 'grey0' : (0, 0, 0), * 'grey1' : (3, 3, 3), # <<<<<<<<<<<<<< * 'grey10' : (26, 26, 26), * 'grey100' : (255, 255, 255), */ __pyx_tuple__275 = PyTuple_Pack(3, __pyx_int_3, __pyx_int_3, __pyx_int_3); if (unlikely(!__pyx_tuple__275)) __PYX_ERR(2, 268, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__275); __Pyx_GIVEREF(__pyx_tuple__275); /* "include/color_dict.pxi":269 * 'grey0' : (0, 0, 0), * 'grey1' : (3, 3, 3), * 'grey10' : (26, 26, 26), # <<<<<<<<<<<<<< * 'grey100' : (255, 255, 255), * 'grey11' : (28, 28, 28), */ __pyx_tuple__276 = PyTuple_Pack(3, __pyx_int_26, __pyx_int_26, __pyx_int_26); if (unlikely(!__pyx_tuple__276)) __PYX_ERR(2, 269, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__276); __Pyx_GIVEREF(__pyx_tuple__276); /* "include/color_dict.pxi":270 * 'grey1' : (3, 3, 3), * 'grey10' : (26, 26, 26), * 'grey100' : (255, 255, 255), # <<<<<<<<<<<<<< * 'grey11' : (28, 28, 28), * 'grey12' : (31, 31, 31), */ __pyx_tuple__277 = PyTuple_Pack(3, __pyx_int_255, __pyx_int_255, __pyx_int_255); if (unlikely(!__pyx_tuple__277)) __PYX_ERR(2, 270, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__277); __Pyx_GIVEREF(__pyx_tuple__277); /* "include/color_dict.pxi":271 * 'grey10' : (26, 26, 26), * 'grey100' : (255, 255, 255), * 'grey11' : (28, 28, 28), # <<<<<<<<<<<<<< * 'grey12' : (31, 31, 31), * 'grey13' : (33, 33, 33), */ __pyx_tuple__278 = PyTuple_Pack(3, __pyx_int_28, __pyx_int_28, __pyx_int_28); if (unlikely(!__pyx_tuple__278)) __PYX_ERR(2, 271, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__278); __Pyx_GIVEREF(__pyx_tuple__278); /* "include/color_dict.pxi":272 * 'grey100' : (255, 255, 255), * 'grey11' : (28, 28, 28), * 'grey12' : (31, 31, 31), # <<<<<<<<<<<<<< * 'grey13' : (33, 33, 33), * 'grey14' : (36, 36, 36), */ __pyx_tuple__279 = PyTuple_Pack(3, __pyx_int_31, __pyx_int_31, __pyx_int_31); if (unlikely(!__pyx_tuple__279)) __PYX_ERR(2, 272, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__279); __Pyx_GIVEREF(__pyx_tuple__279); /* "include/color_dict.pxi":273 * 'grey11' : (28, 28, 28), * 'grey12' : (31, 31, 31), * 'grey13' : (33, 33, 33), # <<<<<<<<<<<<<< * 'grey14' : (36, 36, 36), * 'grey15' : (38, 38, 38), */ __pyx_tuple__280 = PyTuple_Pack(3, __pyx_int_33, __pyx_int_33, __pyx_int_33); if (unlikely(!__pyx_tuple__280)) __PYX_ERR(2, 273, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__280); __Pyx_GIVEREF(__pyx_tuple__280); /* "include/color_dict.pxi":274 * 'grey12' : (31, 31, 31), * 'grey13' : (33, 33, 33), * 'grey14' : (36, 36, 36), # <<<<<<<<<<<<<< * 'grey15' : (38, 38, 38), * 'grey16' : (41, 41, 41), */ __pyx_tuple__281 = PyTuple_Pack(3, __pyx_int_36, __pyx_int_36, __pyx_int_36); if (unlikely(!__pyx_tuple__281)) __PYX_ERR(2, 274, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__281); __Pyx_GIVEREF(__pyx_tuple__281); /* "include/color_dict.pxi":275 * 'grey13' : (33, 33, 33), * 'grey14' : (36, 36, 36), * 'grey15' : (38, 38, 38), # <<<<<<<<<<<<<< * 'grey16' : (41, 41, 41), * 'grey17' : (43, 43, 43), */ __pyx_tuple__282 = PyTuple_Pack(3, __pyx_int_38, __pyx_int_38, __pyx_int_38); if (unlikely(!__pyx_tuple__282)) __PYX_ERR(2, 275, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__282); __Pyx_GIVEREF(__pyx_tuple__282); /* "include/color_dict.pxi":276 * 'grey14' : (36, 36, 36), * 'grey15' : (38, 38, 38), * 'grey16' : (41, 41, 41), # <<<<<<<<<<<<<< * 'grey17' : (43, 43, 43), * 'grey18' : (46, 46, 46), */ __pyx_tuple__283 = PyTuple_Pack(3, __pyx_int_41, __pyx_int_41, __pyx_int_41); if (unlikely(!__pyx_tuple__283)) __PYX_ERR(2, 276, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__283); __Pyx_GIVEREF(__pyx_tuple__283); /* "include/color_dict.pxi":277 * 'grey15' : (38, 38, 38), * 'grey16' : (41, 41, 41), * 'grey17' : (43, 43, 43), # <<<<<<<<<<<<<< * 'grey18' : (46, 46, 46), * 'grey19' : (48, 48, 48), */ __pyx_tuple__284 = PyTuple_Pack(3, __pyx_int_43, __pyx_int_43, __pyx_int_43); if (unlikely(!__pyx_tuple__284)) __PYX_ERR(2, 277, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__284); __Pyx_GIVEREF(__pyx_tuple__284); /* "include/color_dict.pxi":278 * 'grey16' : (41, 41, 41), * 'grey17' : (43, 43, 43), * 'grey18' : (46, 46, 46), # <<<<<<<<<<<<<< * 'grey19' : (48, 48, 48), * 'grey2' : (5, 5, 5), */ __pyx_tuple__285 = PyTuple_Pack(3, __pyx_int_46, __pyx_int_46, __pyx_int_46); if (unlikely(!__pyx_tuple__285)) __PYX_ERR(2, 278, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__285); __Pyx_GIVEREF(__pyx_tuple__285); /* "include/color_dict.pxi":279 * 'grey17' : (43, 43, 43), * 'grey18' : (46, 46, 46), * 'grey19' : (48, 48, 48), # <<<<<<<<<<<<<< * 'grey2' : (5, 5, 5), * 'grey20' : (51, 51, 51), */ __pyx_tuple__286 = PyTuple_Pack(3, __pyx_int_48, __pyx_int_48, __pyx_int_48); if (unlikely(!__pyx_tuple__286)) __PYX_ERR(2, 279, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__286); __Pyx_GIVEREF(__pyx_tuple__286); /* "include/color_dict.pxi":280 * 'grey18' : (46, 46, 46), * 'grey19' : (48, 48, 48), * 'grey2' : (5, 5, 5), # <<<<<<<<<<<<<< * 'grey20' : (51, 51, 51), * 'grey21' : (54, 54, 54), */ __pyx_tuple__287 = PyTuple_Pack(3, __pyx_int_5, __pyx_int_5, __pyx_int_5); if (unlikely(!__pyx_tuple__287)) __PYX_ERR(2, 280, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__287); __Pyx_GIVEREF(__pyx_tuple__287); /* "include/color_dict.pxi":281 * 'grey19' : (48, 48, 48), * 'grey2' : (5, 5, 5), * 'grey20' : (51, 51, 51), # <<<<<<<<<<<<<< * 'grey21' : (54, 54, 54), * 'grey22' : (56, 56, 56), */ __pyx_tuple__288 = PyTuple_Pack(3, __pyx_int_51, __pyx_int_51, __pyx_int_51); if (unlikely(!__pyx_tuple__288)) __PYX_ERR(2, 281, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__288); __Pyx_GIVEREF(__pyx_tuple__288); /* "include/color_dict.pxi":282 * 'grey2' : (5, 5, 5), * 'grey20' : (51, 51, 51), * 'grey21' : (54, 54, 54), # <<<<<<<<<<<<<< * 'grey22' : (56, 56, 56), * 'grey23' : (59, 59, 59), */ __pyx_tuple__289 = PyTuple_Pack(3, __pyx_int_54, __pyx_int_54, __pyx_int_54); if (unlikely(!__pyx_tuple__289)) __PYX_ERR(2, 282, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__289); __Pyx_GIVEREF(__pyx_tuple__289); /* "include/color_dict.pxi":283 * 'grey20' : (51, 51, 51), * 'grey21' : (54, 54, 54), * 'grey22' : (56, 56, 56), # <<<<<<<<<<<<<< * 'grey23' : (59, 59, 59), * 'grey24' : (61, 61, 61), */ __pyx_tuple__290 = PyTuple_Pack(3, __pyx_int_56, __pyx_int_56, __pyx_int_56); if (unlikely(!__pyx_tuple__290)) __PYX_ERR(2, 283, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__290); __Pyx_GIVEREF(__pyx_tuple__290); /* "include/color_dict.pxi":284 * 'grey21' : (54, 54, 54), * 'grey22' : (56, 56, 56), * 'grey23' : (59, 59, 59), # <<<<<<<<<<<<<< * 'grey24' : (61, 61, 61), * 'grey25' : (64, 64, 64), */ __pyx_tuple__291 = PyTuple_Pack(3, __pyx_int_59, __pyx_int_59, __pyx_int_59); if (unlikely(!__pyx_tuple__291)) __PYX_ERR(2, 284, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__291); __Pyx_GIVEREF(__pyx_tuple__291); /* "include/color_dict.pxi":285 * 'grey22' : (56, 56, 56), * 'grey23' : (59, 59, 59), * 'grey24' : (61, 61, 61), # <<<<<<<<<<<<<< * 'grey25' : (64, 64, 64), * 'grey26' : (66, 66, 66), */ __pyx_tuple__292 = PyTuple_Pack(3, __pyx_int_61, __pyx_int_61, __pyx_int_61); if (unlikely(!__pyx_tuple__292)) __PYX_ERR(2, 285, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__292); __Pyx_GIVEREF(__pyx_tuple__292); /* "include/color_dict.pxi":286 * 'grey23' : (59, 59, 59), * 'grey24' : (61, 61, 61), * 'grey25' : (64, 64, 64), # <<<<<<<<<<<<<< * 'grey26' : (66, 66, 66), * 'grey27' : (69, 69, 69), */ __pyx_tuple__293 = PyTuple_Pack(3, __pyx_int_64, __pyx_int_64, __pyx_int_64); if (unlikely(!__pyx_tuple__293)) __PYX_ERR(2, 286, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__293); __Pyx_GIVEREF(__pyx_tuple__293); /* "include/color_dict.pxi":287 * 'grey24' : (61, 61, 61), * 'grey25' : (64, 64, 64), * 'grey26' : (66, 66, 66), # <<<<<<<<<<<<<< * 'grey27' : (69, 69, 69), * 'grey28' : (71, 71, 71), */ __pyx_tuple__294 = PyTuple_Pack(3, __pyx_int_66, __pyx_int_66, __pyx_int_66); if (unlikely(!__pyx_tuple__294)) __PYX_ERR(2, 287, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__294); __Pyx_GIVEREF(__pyx_tuple__294); /* "include/color_dict.pxi":288 * 'grey25' : (64, 64, 64), * 'grey26' : (66, 66, 66), * 'grey27' : (69, 69, 69), # <<<<<<<<<<<<<< * 'grey28' : (71, 71, 71), * 'grey29' : (74, 74, 74), */ __pyx_tuple__295 = PyTuple_Pack(3, __pyx_int_69, __pyx_int_69, __pyx_int_69); if (unlikely(!__pyx_tuple__295)) __PYX_ERR(2, 288, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__295); __Pyx_GIVEREF(__pyx_tuple__295); /* "include/color_dict.pxi":289 * 'grey26' : (66, 66, 66), * 'grey27' : (69, 69, 69), * 'grey28' : (71, 71, 71), # <<<<<<<<<<<<<< * 'grey29' : (74, 74, 74), * 'grey3' : (8, 8, 8), */ __pyx_tuple__296 = PyTuple_Pack(3, __pyx_int_71, __pyx_int_71, __pyx_int_71); if (unlikely(!__pyx_tuple__296)) __PYX_ERR(2, 289, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__296); __Pyx_GIVEREF(__pyx_tuple__296); /* "include/color_dict.pxi":290 * 'grey27' : (69, 69, 69), * 'grey28' : (71, 71, 71), * 'grey29' : (74, 74, 74), # <<<<<<<<<<<<<< * 'grey3' : (8, 8, 8), * 'grey30' : (77, 77, 77), */ __pyx_tuple__297 = PyTuple_Pack(3, __pyx_int_74, __pyx_int_74, __pyx_int_74); if (unlikely(!__pyx_tuple__297)) __PYX_ERR(2, 290, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__297); __Pyx_GIVEREF(__pyx_tuple__297); /* "include/color_dict.pxi":291 * 'grey28' : (71, 71, 71), * 'grey29' : (74, 74, 74), * 'grey3' : (8, 8, 8), # <<<<<<<<<<<<<< * 'grey30' : (77, 77, 77), * 'grey31' : (79, 79, 79), */ __pyx_tuple__298 = PyTuple_Pack(3, __pyx_int_8, __pyx_int_8, __pyx_int_8); if (unlikely(!__pyx_tuple__298)) __PYX_ERR(2, 291, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__298); __Pyx_GIVEREF(__pyx_tuple__298); /* "include/color_dict.pxi":292 * 'grey29' : (74, 74, 74), * 'grey3' : (8, 8, 8), * 'grey30' : (77, 77, 77), # <<<<<<<<<<<<<< * 'grey31' : (79, 79, 79), * 'grey32' : (82, 82, 82), */ __pyx_tuple__299 = PyTuple_Pack(3, __pyx_int_77, __pyx_int_77, __pyx_int_77); if (unlikely(!__pyx_tuple__299)) __PYX_ERR(2, 292, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__299); __Pyx_GIVEREF(__pyx_tuple__299); /* "include/color_dict.pxi":293 * 'grey3' : (8, 8, 8), * 'grey30' : (77, 77, 77), * 'grey31' : (79, 79, 79), # <<<<<<<<<<<<<< * 'grey32' : (82, 82, 82), * 'grey33' : (84, 84, 84), */ __pyx_tuple__300 = PyTuple_Pack(3, __pyx_int_79, __pyx_int_79, __pyx_int_79); if (unlikely(!__pyx_tuple__300)) __PYX_ERR(2, 293, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__300); __Pyx_GIVEREF(__pyx_tuple__300); /* "include/color_dict.pxi":294 * 'grey30' : (77, 77, 77), * 'grey31' : (79, 79, 79), * 'grey32' : (82, 82, 82), # <<<<<<<<<<<<<< * 'grey33' : (84, 84, 84), * 'grey34' : (87, 87, 87), */ __pyx_tuple__301 = PyTuple_Pack(3, __pyx_int_82, __pyx_int_82, __pyx_int_82); if (unlikely(!__pyx_tuple__301)) __PYX_ERR(2, 294, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__301); __Pyx_GIVEREF(__pyx_tuple__301); /* "include/color_dict.pxi":295 * 'grey31' : (79, 79, 79), * 'grey32' : (82, 82, 82), * 'grey33' : (84, 84, 84), # <<<<<<<<<<<<<< * 'grey34' : (87, 87, 87), * 'grey35' : (89, 89, 89), */ __pyx_tuple__302 = PyTuple_Pack(3, __pyx_int_84, __pyx_int_84, __pyx_int_84); if (unlikely(!__pyx_tuple__302)) __PYX_ERR(2, 295, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__302); __Pyx_GIVEREF(__pyx_tuple__302); /* "include/color_dict.pxi":296 * 'grey32' : (82, 82, 82), * 'grey33' : (84, 84, 84), * 'grey34' : (87, 87, 87), # <<<<<<<<<<<<<< * 'grey35' : (89, 89, 89), * 'grey36' : (92, 92, 92), */ __pyx_tuple__303 = PyTuple_Pack(3, __pyx_int_87, __pyx_int_87, __pyx_int_87); if (unlikely(!__pyx_tuple__303)) __PYX_ERR(2, 296, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__303); __Pyx_GIVEREF(__pyx_tuple__303); /* "include/color_dict.pxi":297 * 'grey33' : (84, 84, 84), * 'grey34' : (87, 87, 87), * 'grey35' : (89, 89, 89), # <<<<<<<<<<<<<< * 'grey36' : (92, 92, 92), * 'grey37' : (94, 94, 94), */ __pyx_tuple__304 = PyTuple_Pack(3, __pyx_int_89, __pyx_int_89, __pyx_int_89); if (unlikely(!__pyx_tuple__304)) __PYX_ERR(2, 297, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__304); __Pyx_GIVEREF(__pyx_tuple__304); /* "include/color_dict.pxi":298 * 'grey34' : (87, 87, 87), * 'grey35' : (89, 89, 89), * 'grey36' : (92, 92, 92), # <<<<<<<<<<<<<< * 'grey37' : (94, 94, 94), * 'grey38' : (97, 97, 97), */ __pyx_tuple__305 = PyTuple_Pack(3, __pyx_int_92, __pyx_int_92, __pyx_int_92); if (unlikely(!__pyx_tuple__305)) __PYX_ERR(2, 298, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__305); __Pyx_GIVEREF(__pyx_tuple__305); /* "include/color_dict.pxi":299 * 'grey35' : (89, 89, 89), * 'grey36' : (92, 92, 92), * 'grey37' : (94, 94, 94), # <<<<<<<<<<<<<< * 'grey38' : (97, 97, 97), * 'grey39' : (99, 99, 99), */ __pyx_tuple__306 = PyTuple_Pack(3, __pyx_int_94, __pyx_int_94, __pyx_int_94); if (unlikely(!__pyx_tuple__306)) __PYX_ERR(2, 299, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__306); __Pyx_GIVEREF(__pyx_tuple__306); /* "include/color_dict.pxi":300 * 'grey36' : (92, 92, 92), * 'grey37' : (94, 94, 94), * 'grey38' : (97, 97, 97), # <<<<<<<<<<<<<< * 'grey39' : (99, 99, 99), * 'grey4' : (10, 10, 10), */ __pyx_tuple__307 = PyTuple_Pack(3, __pyx_int_97, __pyx_int_97, __pyx_int_97); if (unlikely(!__pyx_tuple__307)) __PYX_ERR(2, 300, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__307); __Pyx_GIVEREF(__pyx_tuple__307); /* "include/color_dict.pxi":301 * 'grey37' : (94, 94, 94), * 'grey38' : (97, 97, 97), * 'grey39' : (99, 99, 99), # <<<<<<<<<<<<<< * 'grey4' : (10, 10, 10), * 'grey40' : (102, 102, 102), */ __pyx_tuple__308 = PyTuple_Pack(3, __pyx_int_99, __pyx_int_99, __pyx_int_99); if (unlikely(!__pyx_tuple__308)) __PYX_ERR(2, 301, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__308); __Pyx_GIVEREF(__pyx_tuple__308); /* "include/color_dict.pxi":302 * 'grey38' : (97, 97, 97), * 'grey39' : (99, 99, 99), * 'grey4' : (10, 10, 10), # <<<<<<<<<<<<<< * 'grey40' : (102, 102, 102), * 'grey41' : (105, 105, 105), */ __pyx_tuple__309 = PyTuple_Pack(3, __pyx_int_10, __pyx_int_10, __pyx_int_10); if (unlikely(!__pyx_tuple__309)) __PYX_ERR(2, 302, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__309); __Pyx_GIVEREF(__pyx_tuple__309); /* "include/color_dict.pxi":303 * 'grey39' : (99, 99, 99), * 'grey4' : (10, 10, 10), * 'grey40' : (102, 102, 102), # <<<<<<<<<<<<<< * 'grey41' : (105, 105, 105), * 'grey42' : (107, 107, 107), */ __pyx_tuple__310 = PyTuple_Pack(3, __pyx_int_102, __pyx_int_102, __pyx_int_102); if (unlikely(!__pyx_tuple__310)) __PYX_ERR(2, 303, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__310); __Pyx_GIVEREF(__pyx_tuple__310); /* "include/color_dict.pxi":304 * 'grey4' : (10, 10, 10), * 'grey40' : (102, 102, 102), * 'grey41' : (105, 105, 105), # <<<<<<<<<<<<<< * 'grey42' : (107, 107, 107), * 'grey43' : (110, 110, 110), */ __pyx_tuple__311 = PyTuple_Pack(3, __pyx_int_105, __pyx_int_105, __pyx_int_105); if (unlikely(!__pyx_tuple__311)) __PYX_ERR(2, 304, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__311); __Pyx_GIVEREF(__pyx_tuple__311); /* "include/color_dict.pxi":305 * 'grey40' : (102, 102, 102), * 'grey41' : (105, 105, 105), * 'grey42' : (107, 107, 107), # <<<<<<<<<<<<<< * 'grey43' : (110, 110, 110), * 'grey44' : (112, 112, 112), */ __pyx_tuple__312 = PyTuple_Pack(3, __pyx_int_107, __pyx_int_107, __pyx_int_107); if (unlikely(!__pyx_tuple__312)) __PYX_ERR(2, 305, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__312); __Pyx_GIVEREF(__pyx_tuple__312); /* "include/color_dict.pxi":306 * 'grey41' : (105, 105, 105), * 'grey42' : (107, 107, 107), * 'grey43' : (110, 110, 110), # <<<<<<<<<<<<<< * 'grey44' : (112, 112, 112), * 'grey45' : (115, 115, 115), */ __pyx_tuple__313 = PyTuple_Pack(3, __pyx_int_110, __pyx_int_110, __pyx_int_110); if (unlikely(!__pyx_tuple__313)) __PYX_ERR(2, 306, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__313); __Pyx_GIVEREF(__pyx_tuple__313); /* "include/color_dict.pxi":307 * 'grey42' : (107, 107, 107), * 'grey43' : (110, 110, 110), * 'grey44' : (112, 112, 112), # <<<<<<<<<<<<<< * 'grey45' : (115, 115, 115), * 'grey46' : (117, 117, 117), */ __pyx_tuple__314 = PyTuple_Pack(3, __pyx_int_112, __pyx_int_112, __pyx_int_112); if (unlikely(!__pyx_tuple__314)) __PYX_ERR(2, 307, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__314); __Pyx_GIVEREF(__pyx_tuple__314); /* "include/color_dict.pxi":308 * 'grey43' : (110, 110, 110), * 'grey44' : (112, 112, 112), * 'grey45' : (115, 115, 115), # <<<<<<<<<<<<<< * 'grey46' : (117, 117, 117), * 'grey47' : (120, 120, 120), */ __pyx_tuple__315 = PyTuple_Pack(3, __pyx_int_115, __pyx_int_115, __pyx_int_115); if (unlikely(!__pyx_tuple__315)) __PYX_ERR(2, 308, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__315); __Pyx_GIVEREF(__pyx_tuple__315); /* "include/color_dict.pxi":309 * 'grey44' : (112, 112, 112), * 'grey45' : (115, 115, 115), * 'grey46' : (117, 117, 117), # <<<<<<<<<<<<<< * 'grey47' : (120, 120, 120), * 'grey48' : (122, 122, 122), */ __pyx_tuple__316 = PyTuple_Pack(3, __pyx_int_117, __pyx_int_117, __pyx_int_117); if (unlikely(!__pyx_tuple__316)) __PYX_ERR(2, 309, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__316); __Pyx_GIVEREF(__pyx_tuple__316); /* "include/color_dict.pxi":310 * 'grey45' : (115, 115, 115), * 'grey46' : (117, 117, 117), * 'grey47' : (120, 120, 120), # <<<<<<<<<<<<<< * 'grey48' : (122, 122, 122), * 'grey49' : (125, 125, 125), */ __pyx_tuple__317 = PyTuple_Pack(3, __pyx_int_120, __pyx_int_120, __pyx_int_120); if (unlikely(!__pyx_tuple__317)) __PYX_ERR(2, 310, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__317); __Pyx_GIVEREF(__pyx_tuple__317); /* "include/color_dict.pxi":311 * 'grey46' : (117, 117, 117), * 'grey47' : (120, 120, 120), * 'grey48' : (122, 122, 122), # <<<<<<<<<<<<<< * 'grey49' : (125, 125, 125), * 'grey5' : (13, 13, 13), */ __pyx_tuple__318 = PyTuple_Pack(3, __pyx_int_122, __pyx_int_122, __pyx_int_122); if (unlikely(!__pyx_tuple__318)) __PYX_ERR(2, 311, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__318); __Pyx_GIVEREF(__pyx_tuple__318); /* "include/color_dict.pxi":312 * 'grey47' : (120, 120, 120), * 'grey48' : (122, 122, 122), * 'grey49' : (125, 125, 125), # <<<<<<<<<<<<<< * 'grey5' : (13, 13, 13), * 'grey50' : (127, 127, 127), */ __pyx_tuple__319 = PyTuple_Pack(3, __pyx_int_125, __pyx_int_125, __pyx_int_125); if (unlikely(!__pyx_tuple__319)) __PYX_ERR(2, 312, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__319); __Pyx_GIVEREF(__pyx_tuple__319); /* "include/color_dict.pxi":313 * 'grey48' : (122, 122, 122), * 'grey49' : (125, 125, 125), * 'grey5' : (13, 13, 13), # <<<<<<<<<<<<<< * 'grey50' : (127, 127, 127), * 'grey51' : (130, 130, 130), */ __pyx_tuple__320 = PyTuple_Pack(3, __pyx_int_13, __pyx_int_13, __pyx_int_13); if (unlikely(!__pyx_tuple__320)) __PYX_ERR(2, 313, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__320); __Pyx_GIVEREF(__pyx_tuple__320); /* "include/color_dict.pxi":314 * 'grey49' : (125, 125, 125), * 'grey5' : (13, 13, 13), * 'grey50' : (127, 127, 127), # <<<<<<<<<<<<<< * 'grey51' : (130, 130, 130), * 'grey52' : (133, 133, 133), */ __pyx_tuple__321 = PyTuple_Pack(3, __pyx_int_127, __pyx_int_127, __pyx_int_127); if (unlikely(!__pyx_tuple__321)) __PYX_ERR(2, 314, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__321); __Pyx_GIVEREF(__pyx_tuple__321); /* "include/color_dict.pxi":315 * 'grey5' : (13, 13, 13), * 'grey50' : (127, 127, 127), * 'grey51' : (130, 130, 130), # <<<<<<<<<<<<<< * 'grey52' : (133, 133, 133), * 'grey53' : (135, 135, 135), */ __pyx_tuple__322 = PyTuple_Pack(3, __pyx_int_130, __pyx_int_130, __pyx_int_130); if (unlikely(!__pyx_tuple__322)) __PYX_ERR(2, 315, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__322); __Pyx_GIVEREF(__pyx_tuple__322); /* "include/color_dict.pxi":316 * 'grey50' : (127, 127, 127), * 'grey51' : (130, 130, 130), * 'grey52' : (133, 133, 133), # <<<<<<<<<<<<<< * 'grey53' : (135, 135, 135), * 'grey54' : (138, 138, 138), */ __pyx_tuple__323 = PyTuple_Pack(3, __pyx_int_133, __pyx_int_133, __pyx_int_133); if (unlikely(!__pyx_tuple__323)) __PYX_ERR(2, 316, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__323); __Pyx_GIVEREF(__pyx_tuple__323); /* "include/color_dict.pxi":317 * 'grey51' : (130, 130, 130), * 'grey52' : (133, 133, 133), * 'grey53' : (135, 135, 135), # <<<<<<<<<<<<<< * 'grey54' : (138, 138, 138), * 'grey55' : (140, 140, 140), */ __pyx_tuple__324 = PyTuple_Pack(3, __pyx_int_135, __pyx_int_135, __pyx_int_135); if (unlikely(!__pyx_tuple__324)) __PYX_ERR(2, 317, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__324); __Pyx_GIVEREF(__pyx_tuple__324); /* "include/color_dict.pxi":318 * 'grey52' : (133, 133, 133), * 'grey53' : (135, 135, 135), * 'grey54' : (138, 138, 138), # <<<<<<<<<<<<<< * 'grey55' : (140, 140, 140), * 'grey56' : (143, 143, 143), */ __pyx_tuple__325 = PyTuple_Pack(3, __pyx_int_138, __pyx_int_138, __pyx_int_138); if (unlikely(!__pyx_tuple__325)) __PYX_ERR(2, 318, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__325); __Pyx_GIVEREF(__pyx_tuple__325); /* "include/color_dict.pxi":319 * 'grey53' : (135, 135, 135), * 'grey54' : (138, 138, 138), * 'grey55' : (140, 140, 140), # <<<<<<<<<<<<<< * 'grey56' : (143, 143, 143), * 'grey57' : (145, 145, 145), */ __pyx_tuple__326 = PyTuple_Pack(3, __pyx_int_140, __pyx_int_140, __pyx_int_140); if (unlikely(!__pyx_tuple__326)) __PYX_ERR(2, 319, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__326); __Pyx_GIVEREF(__pyx_tuple__326); /* "include/color_dict.pxi":320 * 'grey54' : (138, 138, 138), * 'grey55' : (140, 140, 140), * 'grey56' : (143, 143, 143), # <<<<<<<<<<<<<< * 'grey57' : (145, 145, 145), * 'grey58' : (148, 148, 148), */ __pyx_tuple__327 = PyTuple_Pack(3, __pyx_int_143, __pyx_int_143, __pyx_int_143); if (unlikely(!__pyx_tuple__327)) __PYX_ERR(2, 320, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__327); __Pyx_GIVEREF(__pyx_tuple__327); /* "include/color_dict.pxi":321 * 'grey55' : (140, 140, 140), * 'grey56' : (143, 143, 143), * 'grey57' : (145, 145, 145), # <<<<<<<<<<<<<< * 'grey58' : (148, 148, 148), * 'grey59' : (150, 150, 150), */ __pyx_tuple__328 = PyTuple_Pack(3, __pyx_int_145, __pyx_int_145, __pyx_int_145); if (unlikely(!__pyx_tuple__328)) __PYX_ERR(2, 321, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__328); __Pyx_GIVEREF(__pyx_tuple__328); /* "include/color_dict.pxi":322 * 'grey56' : (143, 143, 143), * 'grey57' : (145, 145, 145), * 'grey58' : (148, 148, 148), # <<<<<<<<<<<<<< * 'grey59' : (150, 150, 150), * 'grey6' : (15, 15, 15), */ __pyx_tuple__329 = PyTuple_Pack(3, __pyx_int_148, __pyx_int_148, __pyx_int_148); if (unlikely(!__pyx_tuple__329)) __PYX_ERR(2, 322, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__329); __Pyx_GIVEREF(__pyx_tuple__329); /* "include/color_dict.pxi":323 * 'grey57' : (145, 145, 145), * 'grey58' : (148, 148, 148), * 'grey59' : (150, 150, 150), # <<<<<<<<<<<<<< * 'grey6' : (15, 15, 15), * 'grey60' : (153, 153, 153), */ __pyx_tuple__330 = PyTuple_Pack(3, __pyx_int_150, __pyx_int_150, __pyx_int_150); if (unlikely(!__pyx_tuple__330)) __PYX_ERR(2, 323, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__330); __Pyx_GIVEREF(__pyx_tuple__330); /* "include/color_dict.pxi":324 * 'grey58' : (148, 148, 148), * 'grey59' : (150, 150, 150), * 'grey6' : (15, 15, 15), # <<<<<<<<<<<<<< * 'grey60' : (153, 153, 153), * 'grey61' : (156, 156, 156), */ __pyx_tuple__331 = PyTuple_Pack(3, __pyx_int_15, __pyx_int_15, __pyx_int_15); if (unlikely(!__pyx_tuple__331)) __PYX_ERR(2, 324, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__331); __Pyx_GIVEREF(__pyx_tuple__331); /* "include/color_dict.pxi":325 * 'grey59' : (150, 150, 150), * 'grey6' : (15, 15, 15), * 'grey60' : (153, 153, 153), # <<<<<<<<<<<<<< * 'grey61' : (156, 156, 156), * 'grey62' : (158, 158, 158), */ __pyx_tuple__332 = PyTuple_Pack(3, __pyx_int_153, __pyx_int_153, __pyx_int_153); if (unlikely(!__pyx_tuple__332)) __PYX_ERR(2, 325, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__332); __Pyx_GIVEREF(__pyx_tuple__332); /* "include/color_dict.pxi":326 * 'grey6' : (15, 15, 15), * 'grey60' : (153, 153, 153), * 'grey61' : (156, 156, 156), # <<<<<<<<<<<<<< * 'grey62' : (158, 158, 158), * 'grey63' : (161, 161, 161), */ __pyx_tuple__333 = PyTuple_Pack(3, __pyx_int_156, __pyx_int_156, __pyx_int_156); if (unlikely(!__pyx_tuple__333)) __PYX_ERR(2, 326, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__333); __Pyx_GIVEREF(__pyx_tuple__333); /* "include/color_dict.pxi":327 * 'grey60' : (153, 153, 153), * 'grey61' : (156, 156, 156), * 'grey62' : (158, 158, 158), # <<<<<<<<<<<<<< * 'grey63' : (161, 161, 161), * 'grey64' : (163, 163, 163), */ __pyx_tuple__334 = PyTuple_Pack(3, __pyx_int_158, __pyx_int_158, __pyx_int_158); if (unlikely(!__pyx_tuple__334)) __PYX_ERR(2, 327, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__334); __Pyx_GIVEREF(__pyx_tuple__334); /* "include/color_dict.pxi":328 * 'grey61' : (156, 156, 156), * 'grey62' : (158, 158, 158), * 'grey63' : (161, 161, 161), # <<<<<<<<<<<<<< * 'grey64' : (163, 163, 163), * 'grey65' : (166, 166, 166), */ __pyx_tuple__335 = PyTuple_Pack(3, __pyx_int_161, __pyx_int_161, __pyx_int_161); if (unlikely(!__pyx_tuple__335)) __PYX_ERR(2, 328, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__335); __Pyx_GIVEREF(__pyx_tuple__335); /* "include/color_dict.pxi":329 * 'grey62' : (158, 158, 158), * 'grey63' : (161, 161, 161), * 'grey64' : (163, 163, 163), # <<<<<<<<<<<<<< * 'grey65' : (166, 166, 166), * 'grey66' : (168, 168, 168), */ __pyx_tuple__336 = PyTuple_Pack(3, __pyx_int_163, __pyx_int_163, __pyx_int_163); if (unlikely(!__pyx_tuple__336)) __PYX_ERR(2, 329, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__336); __Pyx_GIVEREF(__pyx_tuple__336); /* "include/color_dict.pxi":330 * 'grey63' : (161, 161, 161), * 'grey64' : (163, 163, 163), * 'grey65' : (166, 166, 166), # <<<<<<<<<<<<<< * 'grey66' : (168, 168, 168), * 'grey67' : (171, 171, 171), */ __pyx_tuple__337 = PyTuple_Pack(3, __pyx_int_166, __pyx_int_166, __pyx_int_166); if (unlikely(!__pyx_tuple__337)) __PYX_ERR(2, 330, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__337); __Pyx_GIVEREF(__pyx_tuple__337); /* "include/color_dict.pxi":331 * 'grey64' : (163, 163, 163), * 'grey65' : (166, 166, 166), * 'grey66' : (168, 168, 168), # <<<<<<<<<<<<<< * 'grey67' : (171, 171, 171), * 'grey68' : (173, 173, 173), */ __pyx_tuple__338 = PyTuple_Pack(3, __pyx_int_168, __pyx_int_168, __pyx_int_168); if (unlikely(!__pyx_tuple__338)) __PYX_ERR(2, 331, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__338); __Pyx_GIVEREF(__pyx_tuple__338); /* "include/color_dict.pxi":332 * 'grey65' : (166, 166, 166), * 'grey66' : (168, 168, 168), * 'grey67' : (171, 171, 171), # <<<<<<<<<<<<<< * 'grey68' : (173, 173, 173), * 'grey69' : (176, 176, 176), */ __pyx_tuple__339 = PyTuple_Pack(3, __pyx_int_171, __pyx_int_171, __pyx_int_171); if (unlikely(!__pyx_tuple__339)) __PYX_ERR(2, 332, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__339); __Pyx_GIVEREF(__pyx_tuple__339); /* "include/color_dict.pxi":333 * 'grey66' : (168, 168, 168), * 'grey67' : (171, 171, 171), * 'grey68' : (173, 173, 173), # <<<<<<<<<<<<<< * 'grey69' : (176, 176, 176), * 'grey7' : (18, 18, 18), */ __pyx_tuple__340 = PyTuple_Pack(3, __pyx_int_173, __pyx_int_173, __pyx_int_173); if (unlikely(!__pyx_tuple__340)) __PYX_ERR(2, 333, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__340); __Pyx_GIVEREF(__pyx_tuple__340); /* "include/color_dict.pxi":334 * 'grey67' : (171, 171, 171), * 'grey68' : (173, 173, 173), * 'grey69' : (176, 176, 176), # <<<<<<<<<<<<<< * 'grey7' : (18, 18, 18), * 'grey70' : (179, 179, 179), */ __pyx_tuple__341 = PyTuple_Pack(3, __pyx_int_176, __pyx_int_176, __pyx_int_176); if (unlikely(!__pyx_tuple__341)) __PYX_ERR(2, 334, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__341); __Pyx_GIVEREF(__pyx_tuple__341); /* "include/color_dict.pxi":335 * 'grey68' : (173, 173, 173), * 'grey69' : (176, 176, 176), * 'grey7' : (18, 18, 18), # <<<<<<<<<<<<<< * 'grey70' : (179, 179, 179), * 'grey71' : (181, 181, 181), */ __pyx_tuple__342 = PyTuple_Pack(3, __pyx_int_18, __pyx_int_18, __pyx_int_18); if (unlikely(!__pyx_tuple__342)) __PYX_ERR(2, 335, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__342); __Pyx_GIVEREF(__pyx_tuple__342); /* "include/color_dict.pxi":336 * 'grey69' : (176, 176, 176), * 'grey7' : (18, 18, 18), * 'grey70' : (179, 179, 179), # <<<<<<<<<<<<<< * 'grey71' : (181, 181, 181), * 'grey72' : (184, 184, 184), */ __pyx_tuple__343 = PyTuple_Pack(3, __pyx_int_179, __pyx_int_179, __pyx_int_179); if (unlikely(!__pyx_tuple__343)) __PYX_ERR(2, 336, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__343); __Pyx_GIVEREF(__pyx_tuple__343); /* "include/color_dict.pxi":337 * 'grey7' : (18, 18, 18), * 'grey70' : (179, 179, 179), * 'grey71' : (181, 181, 181), # <<<<<<<<<<<<<< * 'grey72' : (184, 184, 184), * 'grey73' : (186, 186, 186), */ __pyx_tuple__344 = PyTuple_Pack(3, __pyx_int_181, __pyx_int_181, __pyx_int_181); if (unlikely(!__pyx_tuple__344)) __PYX_ERR(2, 337, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__344); __Pyx_GIVEREF(__pyx_tuple__344); /* "include/color_dict.pxi":338 * 'grey70' : (179, 179, 179), * 'grey71' : (181, 181, 181), * 'grey72' : (184, 184, 184), # <<<<<<<<<<<<<< * 'grey73' : (186, 186, 186), * 'grey74' : (189, 189, 189), */ __pyx_tuple__345 = PyTuple_Pack(3, __pyx_int_184, __pyx_int_184, __pyx_int_184); if (unlikely(!__pyx_tuple__345)) __PYX_ERR(2, 338, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__345); __Pyx_GIVEREF(__pyx_tuple__345); /* "include/color_dict.pxi":339 * 'grey71' : (181, 181, 181), * 'grey72' : (184, 184, 184), * 'grey73' : (186, 186, 186), # <<<<<<<<<<<<<< * 'grey74' : (189, 189, 189), * 'grey75' : (191, 191, 191), */ __pyx_tuple__346 = PyTuple_Pack(3, __pyx_int_186, __pyx_int_186, __pyx_int_186); if (unlikely(!__pyx_tuple__346)) __PYX_ERR(2, 339, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__346); __Pyx_GIVEREF(__pyx_tuple__346); /* "include/color_dict.pxi":340 * 'grey72' : (184, 184, 184), * 'grey73' : (186, 186, 186), * 'grey74' : (189, 189, 189), # <<<<<<<<<<<<<< * 'grey75' : (191, 191, 191), * 'grey76' : (194, 194, 194), */ __pyx_tuple__347 = PyTuple_Pack(3, __pyx_int_189, __pyx_int_189, __pyx_int_189); if (unlikely(!__pyx_tuple__347)) __PYX_ERR(2, 340, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__347); __Pyx_GIVEREF(__pyx_tuple__347); /* "include/color_dict.pxi":341 * 'grey73' : (186, 186, 186), * 'grey74' : (189, 189, 189), * 'grey75' : (191, 191, 191), # <<<<<<<<<<<<<< * 'grey76' : (194, 194, 194), * 'grey77' : (196, 196, 196), */ __pyx_tuple__348 = PyTuple_Pack(3, __pyx_int_191, __pyx_int_191, __pyx_int_191); if (unlikely(!__pyx_tuple__348)) __PYX_ERR(2, 341, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__348); __Pyx_GIVEREF(__pyx_tuple__348); /* "include/color_dict.pxi":342 * 'grey74' : (189, 189, 189), * 'grey75' : (191, 191, 191), * 'grey76' : (194, 194, 194), # <<<<<<<<<<<<<< * 'grey77' : (196, 196, 196), * 'grey78' : (199, 199, 199), */ __pyx_tuple__349 = PyTuple_Pack(3, __pyx_int_194, __pyx_int_194, __pyx_int_194); if (unlikely(!__pyx_tuple__349)) __PYX_ERR(2, 342, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__349); __Pyx_GIVEREF(__pyx_tuple__349); /* "include/color_dict.pxi":343 * 'grey75' : (191, 191, 191), * 'grey76' : (194, 194, 194), * 'grey77' : (196, 196, 196), # <<<<<<<<<<<<<< * 'grey78' : (199, 199, 199), * 'grey79' : (201, 201, 201), */ __pyx_tuple__350 = PyTuple_Pack(3, __pyx_int_196, __pyx_int_196, __pyx_int_196); if (unlikely(!__pyx_tuple__350)) __PYX_ERR(2, 343, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__350); __Pyx_GIVEREF(__pyx_tuple__350); /* "include/color_dict.pxi":344 * 'grey76' : (194, 194, 194), * 'grey77' : (196, 196, 196), * 'grey78' : (199, 199, 199), # <<<<<<<<<<<<<< * 'grey79' : (201, 201, 201), * 'grey8' : (20, 20, 20), */ __pyx_tuple__351 = PyTuple_Pack(3, __pyx_int_199, __pyx_int_199, __pyx_int_199); if (unlikely(!__pyx_tuple__351)) __PYX_ERR(2, 344, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__351); __Pyx_GIVEREF(__pyx_tuple__351); /* "include/color_dict.pxi":345 * 'grey77' : (196, 196, 196), * 'grey78' : (199, 199, 199), * 'grey79' : (201, 201, 201), # <<<<<<<<<<<<<< * 'grey8' : (20, 20, 20), * 'grey80' : (204, 204, 204), */ __pyx_tuple__352 = PyTuple_Pack(3, __pyx_int_201, __pyx_int_201, __pyx_int_201); if (unlikely(!__pyx_tuple__352)) __PYX_ERR(2, 345, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__352); __Pyx_GIVEREF(__pyx_tuple__352); /* "include/color_dict.pxi":346 * 'grey78' : (199, 199, 199), * 'grey79' : (201, 201, 201), * 'grey8' : (20, 20, 20), # <<<<<<<<<<<<<< * 'grey80' : (204, 204, 204), * 'grey81' : (207, 207, 207), */ __pyx_tuple__353 = PyTuple_Pack(3, __pyx_int_20, __pyx_int_20, __pyx_int_20); if (unlikely(!__pyx_tuple__353)) __PYX_ERR(2, 346, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__353); __Pyx_GIVEREF(__pyx_tuple__353); /* "include/color_dict.pxi":347 * 'grey79' : (201, 201, 201), * 'grey8' : (20, 20, 20), * 'grey80' : (204, 204, 204), # <<<<<<<<<<<<<< * 'grey81' : (207, 207, 207), * 'grey82' : (209, 209, 209), */ __pyx_tuple__354 = PyTuple_Pack(3, __pyx_int_204, __pyx_int_204, __pyx_int_204); if (unlikely(!__pyx_tuple__354)) __PYX_ERR(2, 347, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__354); __Pyx_GIVEREF(__pyx_tuple__354); /* "include/color_dict.pxi":348 * 'grey8' : (20, 20, 20), * 'grey80' : (204, 204, 204), * 'grey81' : (207, 207, 207), # <<<<<<<<<<<<<< * 'grey82' : (209, 209, 209), * 'grey83' : (212, 212, 212), */ __pyx_tuple__355 = PyTuple_Pack(3, __pyx_int_207, __pyx_int_207, __pyx_int_207); if (unlikely(!__pyx_tuple__355)) __PYX_ERR(2, 348, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__355); __Pyx_GIVEREF(__pyx_tuple__355); /* "include/color_dict.pxi":349 * 'grey80' : (204, 204, 204), * 'grey81' : (207, 207, 207), * 'grey82' : (209, 209, 209), # <<<<<<<<<<<<<< * 'grey83' : (212, 212, 212), * 'grey84' : (214, 214, 214), */ __pyx_tuple__356 = PyTuple_Pack(3, __pyx_int_209, __pyx_int_209, __pyx_int_209); if (unlikely(!__pyx_tuple__356)) __PYX_ERR(2, 349, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__356); __Pyx_GIVEREF(__pyx_tuple__356); /* "include/color_dict.pxi":350 * 'grey81' : (207, 207, 207), * 'grey82' : (209, 209, 209), * 'grey83' : (212, 212, 212), # <<<<<<<<<<<<<< * 'grey84' : (214, 214, 214), * 'grey85' : (217, 217, 217), */ __pyx_tuple__357 = PyTuple_Pack(3, __pyx_int_212, __pyx_int_212, __pyx_int_212); if (unlikely(!__pyx_tuple__357)) __PYX_ERR(2, 350, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__357); __Pyx_GIVEREF(__pyx_tuple__357); /* "include/color_dict.pxi":351 * 'grey82' : (209, 209, 209), * 'grey83' : (212, 212, 212), * 'grey84' : (214, 214, 214), # <<<<<<<<<<<<<< * 'grey85' : (217, 217, 217), * 'grey86' : (219, 219, 219), */ __pyx_tuple__358 = PyTuple_Pack(3, __pyx_int_214, __pyx_int_214, __pyx_int_214); if (unlikely(!__pyx_tuple__358)) __PYX_ERR(2, 351, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__358); __Pyx_GIVEREF(__pyx_tuple__358); /* "include/color_dict.pxi":352 * 'grey83' : (212, 212, 212), * 'grey84' : (214, 214, 214), * 'grey85' : (217, 217, 217), # <<<<<<<<<<<<<< * 'grey86' : (219, 219, 219), * 'grey87' : (222, 222, 222), */ __pyx_tuple__359 = PyTuple_Pack(3, __pyx_int_217, __pyx_int_217, __pyx_int_217); if (unlikely(!__pyx_tuple__359)) __PYX_ERR(2, 352, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__359); __Pyx_GIVEREF(__pyx_tuple__359); /* "include/color_dict.pxi":353 * 'grey84' : (214, 214, 214), * 'grey85' : (217, 217, 217), * 'grey86' : (219, 219, 219), # <<<<<<<<<<<<<< * 'grey87' : (222, 222, 222), * 'grey88' : (224, 224, 224), */ __pyx_tuple__360 = PyTuple_Pack(3, __pyx_int_219, __pyx_int_219, __pyx_int_219); if (unlikely(!__pyx_tuple__360)) __PYX_ERR(2, 353, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__360); __Pyx_GIVEREF(__pyx_tuple__360); /* "include/color_dict.pxi":354 * 'grey85' : (217, 217, 217), * 'grey86' : (219, 219, 219), * 'grey87' : (222, 222, 222), # <<<<<<<<<<<<<< * 'grey88' : (224, 224, 224), * 'grey89' : (227, 227, 227), */ __pyx_tuple__361 = PyTuple_Pack(3, __pyx_int_222, __pyx_int_222, __pyx_int_222); if (unlikely(!__pyx_tuple__361)) __PYX_ERR(2, 354, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__361); __Pyx_GIVEREF(__pyx_tuple__361); /* "include/color_dict.pxi":355 * 'grey86' : (219, 219, 219), * 'grey87' : (222, 222, 222), * 'grey88' : (224, 224, 224), # <<<<<<<<<<<<<< * 'grey89' : (227, 227, 227), * 'grey9' : (23, 23, 23), */ __pyx_tuple__362 = PyTuple_Pack(3, __pyx_int_224, __pyx_int_224, __pyx_int_224); if (unlikely(!__pyx_tuple__362)) __PYX_ERR(2, 355, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__362); __Pyx_GIVEREF(__pyx_tuple__362); /* "include/color_dict.pxi":356 * 'grey87' : (222, 222, 222), * 'grey88' : (224, 224, 224), * 'grey89' : (227, 227, 227), # <<<<<<<<<<<<<< * 'grey9' : (23, 23, 23), * 'grey90' : (229, 229, 229), */ __pyx_tuple__363 = PyTuple_Pack(3, __pyx_int_227, __pyx_int_227, __pyx_int_227); if (unlikely(!__pyx_tuple__363)) __PYX_ERR(2, 356, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__363); __Pyx_GIVEREF(__pyx_tuple__363); /* "include/color_dict.pxi":357 * 'grey88' : (224, 224, 224), * 'grey89' : (227, 227, 227), * 'grey9' : (23, 23, 23), # <<<<<<<<<<<<<< * 'grey90' : (229, 229, 229), * 'grey91' : (232, 232, 232), */ __pyx_tuple__364 = PyTuple_Pack(3, __pyx_int_23, __pyx_int_23, __pyx_int_23); if (unlikely(!__pyx_tuple__364)) __PYX_ERR(2, 357, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__364); __Pyx_GIVEREF(__pyx_tuple__364); /* "include/color_dict.pxi":358 * 'grey89' : (227, 227, 227), * 'grey9' : (23, 23, 23), * 'grey90' : (229, 229, 229), # <<<<<<<<<<<<<< * 'grey91' : (232, 232, 232), * 'grey92' : (235, 235, 235), */ __pyx_tuple__365 = PyTuple_Pack(3, __pyx_int_229, __pyx_int_229, __pyx_int_229); if (unlikely(!__pyx_tuple__365)) __PYX_ERR(2, 358, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__365); __Pyx_GIVEREF(__pyx_tuple__365); /* "include/color_dict.pxi":359 * 'grey9' : (23, 23, 23), * 'grey90' : (229, 229, 229), * 'grey91' : (232, 232, 232), # <<<<<<<<<<<<<< * 'grey92' : (235, 235, 235), * 'grey93' : (237, 237, 237), */ __pyx_tuple__366 = PyTuple_Pack(3, __pyx_int_232, __pyx_int_232, __pyx_int_232); if (unlikely(!__pyx_tuple__366)) __PYX_ERR(2, 359, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__366); __Pyx_GIVEREF(__pyx_tuple__366); /* "include/color_dict.pxi":360 * 'grey90' : (229, 229, 229), * 'grey91' : (232, 232, 232), * 'grey92' : (235, 235, 235), # <<<<<<<<<<<<<< * 'grey93' : (237, 237, 237), * 'grey94' : (240, 240, 240), */ __pyx_tuple__367 = PyTuple_Pack(3, __pyx_int_235, __pyx_int_235, __pyx_int_235); if (unlikely(!__pyx_tuple__367)) __PYX_ERR(2, 360, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__367); __Pyx_GIVEREF(__pyx_tuple__367); /* "include/color_dict.pxi":361 * 'grey91' : (232, 232, 232), * 'grey92' : (235, 235, 235), * 'grey93' : (237, 237, 237), # <<<<<<<<<<<<<< * 'grey94' : (240, 240, 240), * 'grey95' : (242, 242, 242), */ __pyx_tuple__368 = PyTuple_Pack(3, __pyx_int_237, __pyx_int_237, __pyx_int_237); if (unlikely(!__pyx_tuple__368)) __PYX_ERR(2, 361, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__368); __Pyx_GIVEREF(__pyx_tuple__368); /* "include/color_dict.pxi":362 * 'grey92' : (235, 235, 235), * 'grey93' : (237, 237, 237), * 'grey94' : (240, 240, 240), # <<<<<<<<<<<<<< * 'grey95' : (242, 242, 242), * 'grey96' : (245, 245, 245), */ __pyx_tuple__369 = PyTuple_Pack(3, __pyx_int_240, __pyx_int_240, __pyx_int_240); if (unlikely(!__pyx_tuple__369)) __PYX_ERR(2, 362, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__369); __Pyx_GIVEREF(__pyx_tuple__369); /* "include/color_dict.pxi":363 * 'grey93' : (237, 237, 237), * 'grey94' : (240, 240, 240), * 'grey95' : (242, 242, 242), # <<<<<<<<<<<<<< * 'grey96' : (245, 245, 245), * 'grey97' : (247, 247, 247), */ __pyx_tuple__370 = PyTuple_Pack(3, __pyx_int_242, __pyx_int_242, __pyx_int_242); if (unlikely(!__pyx_tuple__370)) __PYX_ERR(2, 363, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__370); __Pyx_GIVEREF(__pyx_tuple__370); /* "include/color_dict.pxi":364 * 'grey94' : (240, 240, 240), * 'grey95' : (242, 242, 242), * 'grey96' : (245, 245, 245), # <<<<<<<<<<<<<< * 'grey97' : (247, 247, 247), * 'grey98' : (250, 250, 250), */ __pyx_tuple__371 = PyTuple_Pack(3, __pyx_int_245, __pyx_int_245, __pyx_int_245); if (unlikely(!__pyx_tuple__371)) __PYX_ERR(2, 364, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__371); __Pyx_GIVEREF(__pyx_tuple__371); /* "include/color_dict.pxi":365 * 'grey95' : (242, 242, 242), * 'grey96' : (245, 245, 245), * 'grey97' : (247, 247, 247), # <<<<<<<<<<<<<< * 'grey98' : (250, 250, 250), * 'grey99' : (252, 252, 252), */ __pyx_tuple__372 = PyTuple_Pack(3, __pyx_int_247, __pyx_int_247, __pyx_int_247); if (unlikely(!__pyx_tuple__372)) __PYX_ERR(2, 365, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__372); __Pyx_GIVEREF(__pyx_tuple__372); /* "include/color_dict.pxi":366 * 'grey96' : (245, 245, 245), * 'grey97' : (247, 247, 247), * 'grey98' : (250, 250, 250), # <<<<<<<<<<<<<< * 'grey99' : (252, 252, 252), * 'honeydew' : (240, 255, 240), */ __pyx_tuple__373 = PyTuple_Pack(3, __pyx_int_250, __pyx_int_250, __pyx_int_250); if (unlikely(!__pyx_tuple__373)) __PYX_ERR(2, 366, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__373); __Pyx_GIVEREF(__pyx_tuple__373); /* "include/color_dict.pxi":367 * 'grey97' : (247, 247, 247), * 'grey98' : (250, 250, 250), * 'grey99' : (252, 252, 252), # <<<<<<<<<<<<<< * 'honeydew' : (240, 255, 240), * 'honeydew1' : (240, 255, 240), */ __pyx_tuple__374 = PyTuple_Pack(3, __pyx_int_252, __pyx_int_252, __pyx_int_252); if (unlikely(!__pyx_tuple__374)) __PYX_ERR(2, 367, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__374); __Pyx_GIVEREF(__pyx_tuple__374); /* "include/color_dict.pxi":368 * 'grey98' : (250, 250, 250), * 'grey99' : (252, 252, 252), * 'honeydew' : (240, 255, 240), # <<<<<<<<<<<<<< * 'honeydew1' : (240, 255, 240), * 'honeydew2' : (224, 238, 224), */ __pyx_tuple__375 = PyTuple_Pack(3, __pyx_int_240, __pyx_int_255, __pyx_int_240); if (unlikely(!__pyx_tuple__375)) __PYX_ERR(2, 368, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__375); __Pyx_GIVEREF(__pyx_tuple__375); /* "include/color_dict.pxi":369 * 'grey99' : (252, 252, 252), * 'honeydew' : (240, 255, 240), * 'honeydew1' : (240, 255, 240), # <<<<<<<<<<<<<< * 'honeydew2' : (224, 238, 224), * 'honeydew3' : (193, 205, 193), */ __pyx_tuple__376 = PyTuple_Pack(3, __pyx_int_240, __pyx_int_255, __pyx_int_240); if (unlikely(!__pyx_tuple__376)) __PYX_ERR(2, 369, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__376); __Pyx_GIVEREF(__pyx_tuple__376); /* "include/color_dict.pxi":370 * 'honeydew' : (240, 255, 240), * 'honeydew1' : (240, 255, 240), * 'honeydew2' : (224, 238, 224), # <<<<<<<<<<<<<< * 'honeydew3' : (193, 205, 193), * 'honeydew4' : (131, 139, 131), */ __pyx_tuple__377 = PyTuple_Pack(3, __pyx_int_224, __pyx_int_238, __pyx_int_224); if (unlikely(!__pyx_tuple__377)) __PYX_ERR(2, 370, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__377); __Pyx_GIVEREF(__pyx_tuple__377); /* "include/color_dict.pxi":371 * 'honeydew1' : (240, 255, 240), * 'honeydew2' : (224, 238, 224), * 'honeydew3' : (193, 205, 193), # <<<<<<<<<<<<<< * 'honeydew4' : (131, 139, 131), * 'hotpink' : (255, 105, 180), */ __pyx_tuple__378 = PyTuple_Pack(3, __pyx_int_193, __pyx_int_205, __pyx_int_193); if (unlikely(!__pyx_tuple__378)) __PYX_ERR(2, 371, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__378); __Pyx_GIVEREF(__pyx_tuple__378); /* "include/color_dict.pxi":372 * 'honeydew2' : (224, 238, 224), * 'honeydew3' : (193, 205, 193), * 'honeydew4' : (131, 139, 131), # <<<<<<<<<<<<<< * 'hotpink' : (255, 105, 180), * 'hotpink1' : (255, 110, 180), */ __pyx_tuple__379 = PyTuple_Pack(3, __pyx_int_131, __pyx_int_139, __pyx_int_131); if (unlikely(!__pyx_tuple__379)) __PYX_ERR(2, 372, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__379); __Pyx_GIVEREF(__pyx_tuple__379); /* "include/color_dict.pxi":373 * 'honeydew3' : (193, 205, 193), * 'honeydew4' : (131, 139, 131), * 'hotpink' : (255, 105, 180), # <<<<<<<<<<<<<< * 'hotpink1' : (255, 110, 180), * 'hotpink2' : (238, 106, 167), */ __pyx_tuple__380 = PyTuple_Pack(3, __pyx_int_255, __pyx_int_105, __pyx_int_180); if (unlikely(!__pyx_tuple__380)) __PYX_ERR(2, 373, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__380); __Pyx_GIVEREF(__pyx_tuple__380); /* "include/color_dict.pxi":374 * 'honeydew4' : (131, 139, 131), * 'hotpink' : (255, 105, 180), * 'hotpink1' : (255, 110, 180), # <<<<<<<<<<<<<< * 'hotpink2' : (238, 106, 167), * 'hotpink3' : (205, 96, 144), */ __pyx_tuple__381 = PyTuple_Pack(3, __pyx_int_255, __pyx_int_110, __pyx_int_180); if (unlikely(!__pyx_tuple__381)) __PYX_ERR(2, 374, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__381); __Pyx_GIVEREF(__pyx_tuple__381); /* "include/color_dict.pxi":375 * 'hotpink' : (255, 105, 180), * 'hotpink1' : (255, 110, 180), * 'hotpink2' : (238, 106, 167), # <<<<<<<<<<<<<< * 'hotpink3' : (205, 96, 144), * 'hotpink4' : (139, 58, 98), */ __pyx_tuple__382 = PyTuple_Pack(3, __pyx_int_238, __pyx_int_106, __pyx_int_167); if (unlikely(!__pyx_tuple__382)) __PYX_ERR(2, 375, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__382); __Pyx_GIVEREF(__pyx_tuple__382); /* "include/color_dict.pxi":376 * 'hotpink1' : (255, 110, 180), * 'hotpink2' : (238, 106, 167), * 'hotpink3' : (205, 96, 144), # <<<<<<<<<<<<<< * 'hotpink4' : (139, 58, 98), * 'indianred' : (205, 92, 92), */ __pyx_tuple__383 = PyTuple_Pack(3, __pyx_int_205, __pyx_int_96, __pyx_int_144); if (unlikely(!__pyx_tuple__383)) __PYX_ERR(2, 376, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__383); __Pyx_GIVEREF(__pyx_tuple__383); /* "include/color_dict.pxi":377 * 'hotpink2' : (238, 106, 167), * 'hotpink3' : (205, 96, 144), * 'hotpink4' : (139, 58, 98), # <<<<<<<<<<<<<< * 'indianred' : (205, 92, 92), * 'indianred1' : (255, 106, 106), */ __pyx_tuple__384 = PyTuple_Pack(3, __pyx_int_139, __pyx_int_58, __pyx_int_98); if (unlikely(!__pyx_tuple__384)) __PYX_ERR(2, 377, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__384); __Pyx_GIVEREF(__pyx_tuple__384); /* "include/color_dict.pxi":378 * 'hotpink3' : (205, 96, 144), * 'hotpink4' : (139, 58, 98), * 'indianred' : (205, 92, 92), # <<<<<<<<<<<<<< * 'indianred1' : (255, 106, 106), * 'indianred2' : (238, 99, 99), */ __pyx_tuple__385 = PyTuple_Pack(3, __pyx_int_205, __pyx_int_92, __pyx_int_92); if (unlikely(!__pyx_tuple__385)) __PYX_ERR(2, 378, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__385); __Pyx_GIVEREF(__pyx_tuple__385); /* "include/color_dict.pxi":379 * 'hotpink4' : (139, 58, 98), * 'indianred' : (205, 92, 92), * 'indianred1' : (255, 106, 106), # <<<<<<<<<<<<<< * 'indianred2' : (238, 99, 99), * 'indianred3' : (205, 85, 85), */ __pyx_tuple__386 = PyTuple_Pack(3, __pyx_int_255, __pyx_int_106, __pyx_int_106); if (unlikely(!__pyx_tuple__386)) __PYX_ERR(2, 379, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__386); __Pyx_GIVEREF(__pyx_tuple__386); /* "include/color_dict.pxi":380 * 'indianred' : (205, 92, 92), * 'indianred1' : (255, 106, 106), * 'indianred2' : (238, 99, 99), # <<<<<<<<<<<<<< * 'indianred3' : (205, 85, 85), * 'indianred4' : (139, 58, 58), */ __pyx_tuple__387 = PyTuple_Pack(3, __pyx_int_238, __pyx_int_99, __pyx_int_99); if (unlikely(!__pyx_tuple__387)) __PYX_ERR(2, 380, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__387); __Pyx_GIVEREF(__pyx_tuple__387); /* "include/color_dict.pxi":381 * 'indianred1' : (255, 106, 106), * 'indianred2' : (238, 99, 99), * 'indianred3' : (205, 85, 85), # <<<<<<<<<<<<<< * 'indianred4' : (139, 58, 58), * 'indigo' : (75, 0, 130), */ __pyx_tuple__388 = PyTuple_Pack(3, __pyx_int_205, __pyx_int_85, __pyx_int_85); if (unlikely(!__pyx_tuple__388)) __PYX_ERR(2, 381, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__388); __Pyx_GIVEREF(__pyx_tuple__388); /* "include/color_dict.pxi":382 * 'indianred2' : (238, 99, 99), * 'indianred3' : (205, 85, 85), * 'indianred4' : (139, 58, 58), # <<<<<<<<<<<<<< * 'indigo' : (75, 0, 130), * 'ivory' : (255, 255, 240), */ __pyx_tuple__389 = PyTuple_Pack(3, __pyx_int_139, __pyx_int_58, __pyx_int_58); if (unlikely(!__pyx_tuple__389)) __PYX_ERR(2, 382, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__389); __Pyx_GIVEREF(__pyx_tuple__389); /* "include/color_dict.pxi":383 * 'indianred3' : (205, 85, 85), * 'indianred4' : (139, 58, 58), * 'indigo' : (75, 0, 130), # <<<<<<<<<<<<<< * 'ivory' : (255, 255, 240), * 'ivory1' : (255, 255, 240), */ __pyx_tuple__390 = PyTuple_Pack(3, __pyx_int_75, __pyx_int_0, __pyx_int_130); if (unlikely(!__pyx_tuple__390)) __PYX_ERR(2, 383, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__390); __Pyx_GIVEREF(__pyx_tuple__390); /* "include/color_dict.pxi":384 * 'indianred4' : (139, 58, 58), * 'indigo' : (75, 0, 130), * 'ivory' : (255, 255, 240), # <<<<<<<<<<<<<< * 'ivory1' : (255, 255, 240), * 'ivory2' : (238, 238, 224), */ __pyx_tuple__391 = PyTuple_Pack(3, __pyx_int_255, __pyx_int_255, __pyx_int_240); if (unlikely(!__pyx_tuple__391)) __PYX_ERR(2, 384, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__391); __Pyx_GIVEREF(__pyx_tuple__391); /* "include/color_dict.pxi":385 * 'indigo' : (75, 0, 130), * 'ivory' : (255, 255, 240), * 'ivory1' : (255, 255, 240), # <<<<<<<<<<<<<< * 'ivory2' : (238, 238, 224), * 'ivory3' : (205, 205, 193), */ __pyx_tuple__392 = PyTuple_Pack(3, __pyx_int_255, __pyx_int_255, __pyx_int_240); if (unlikely(!__pyx_tuple__392)) __PYX_ERR(2, 385, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__392); __Pyx_GIVEREF(__pyx_tuple__392); /* "include/color_dict.pxi":386 * 'ivory' : (255, 255, 240), * 'ivory1' : (255, 255, 240), * 'ivory2' : (238, 238, 224), # <<<<<<<<<<<<<< * 'ivory3' : (205, 205, 193), * 'ivory4' : (139, 139, 131), */ __pyx_tuple__393 = PyTuple_Pack(3, __pyx_int_238, __pyx_int_238, __pyx_int_224); if (unlikely(!__pyx_tuple__393)) __PYX_ERR(2, 386, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__393); __Pyx_GIVEREF(__pyx_tuple__393); /* "include/color_dict.pxi":387 * 'ivory1' : (255, 255, 240), * 'ivory2' : (238, 238, 224), * 'ivory3' : (205, 205, 193), # <<<<<<<<<<<<<< * 'ivory4' : (139, 139, 131), * 'khaki' : (240, 230, 140), */ __pyx_tuple__394 = PyTuple_Pack(3, __pyx_int_205, __pyx_int_205, __pyx_int_193); if (unlikely(!__pyx_tuple__394)) __PYX_ERR(2, 387, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__394); __Pyx_GIVEREF(__pyx_tuple__394); /* "include/color_dict.pxi":388 * 'ivory2' : (238, 238, 224), * 'ivory3' : (205, 205, 193), * 'ivory4' : (139, 139, 131), # <<<<<<<<<<<<<< * 'khaki' : (240, 230, 140), * 'khaki1' : (255, 246, 143), */ __pyx_tuple__395 = PyTuple_Pack(3, __pyx_int_139, __pyx_int_139, __pyx_int_131); if (unlikely(!__pyx_tuple__395)) __PYX_ERR(2, 388, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__395); __Pyx_GIVEREF(__pyx_tuple__395); /* "include/color_dict.pxi":389 * 'ivory3' : (205, 205, 193), * 'ivory4' : (139, 139, 131), * 'khaki' : (240, 230, 140), # <<<<<<<<<<<<<< * 'khaki1' : (255, 246, 143), * 'khaki2' : (238, 230, 133), */ __pyx_tuple__396 = PyTuple_Pack(3, __pyx_int_240, __pyx_int_230, __pyx_int_140); if (unlikely(!__pyx_tuple__396)) __PYX_ERR(2, 389, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__396); __Pyx_GIVEREF(__pyx_tuple__396); /* "include/color_dict.pxi":390 * 'ivory4' : (139, 139, 131), * 'khaki' : (240, 230, 140), * 'khaki1' : (255, 246, 143), # <<<<<<<<<<<<<< * 'khaki2' : (238, 230, 133), * 'khaki3' : (205, 198, 115), */ __pyx_tuple__397 = PyTuple_Pack(3, __pyx_int_255, __pyx_int_246, __pyx_int_143); if (unlikely(!__pyx_tuple__397)) __PYX_ERR(2, 390, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__397); __Pyx_GIVEREF(__pyx_tuple__397); /* "include/color_dict.pxi":391 * 'khaki' : (240, 230, 140), * 'khaki1' : (255, 246, 143), * 'khaki2' : (238, 230, 133), # <<<<<<<<<<<<<< * 'khaki3' : (205, 198, 115), * 'khaki4' : (139, 134, 78), */ __pyx_tuple__398 = PyTuple_Pack(3, __pyx_int_238, __pyx_int_230, __pyx_int_133); if (unlikely(!__pyx_tuple__398)) __PYX_ERR(2, 391, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__398); __Pyx_GIVEREF(__pyx_tuple__398); /* "include/color_dict.pxi":392 * 'khaki1' : (255, 246, 143), * 'khaki2' : (238, 230, 133), * 'khaki3' : (205, 198, 115), # <<<<<<<<<<<<<< * 'khaki4' : (139, 134, 78), * 'lavender' : (230, 230, 250), */ __pyx_tuple__399 = PyTuple_Pack(3, __pyx_int_205, __pyx_int_198, __pyx_int_115); if (unlikely(!__pyx_tuple__399)) __PYX_ERR(2, 392, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__399); __Pyx_GIVEREF(__pyx_tuple__399); /* "include/color_dict.pxi":393 * 'khaki2' : (238, 230, 133), * 'khaki3' : (205, 198, 115), * 'khaki4' : (139, 134, 78), # <<<<<<<<<<<<<< * 'lavender' : (230, 230, 250), * 'lavenderblush' : (255, 240, 245), */ __pyx_tuple__400 = PyTuple_Pack(3, __pyx_int_139, __pyx_int_134, __pyx_int_78); if (unlikely(!__pyx_tuple__400)) __PYX_ERR(2, 393, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__400); __Pyx_GIVEREF(__pyx_tuple__400); /* "include/color_dict.pxi":394 * 'khaki3' : (205, 198, 115), * 'khaki4' : (139, 134, 78), * 'lavender' : (230, 230, 250), # <<<<<<<<<<<<<< * 'lavenderblush' : (255, 240, 245), * 'lavenderblush1' : (255, 240, 245), */ __pyx_tuple__401 = PyTuple_Pack(3, __pyx_int_230, __pyx_int_230, __pyx_int_250); if (unlikely(!__pyx_tuple__401)) __PYX_ERR(2, 394, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__401); __Pyx_GIVEREF(__pyx_tuple__401); /* "include/color_dict.pxi":395 * 'khaki4' : (139, 134, 78), * 'lavender' : (230, 230, 250), * 'lavenderblush' : (255, 240, 245), # <<<<<<<<<<<<<< * 'lavenderblush1' : (255, 240, 245), * 'lavenderblush2' : (238, 224, 229), */ __pyx_tuple__402 = PyTuple_Pack(3, __pyx_int_255, __pyx_int_240, __pyx_int_245); if (unlikely(!__pyx_tuple__402)) __PYX_ERR(2, 395, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__402); __Pyx_GIVEREF(__pyx_tuple__402); /* "include/color_dict.pxi":396 * 'lavender' : (230, 230, 250), * 'lavenderblush' : (255, 240, 245), * 'lavenderblush1' : (255, 240, 245), # <<<<<<<<<<<<<< * 'lavenderblush2' : (238, 224, 229), * 'lavenderblush3' : (205, 193, 197), */ __pyx_tuple__403 = PyTuple_Pack(3, __pyx_int_255, __pyx_int_240, __pyx_int_245); if (unlikely(!__pyx_tuple__403)) __PYX_ERR(2, 396, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__403); __Pyx_GIVEREF(__pyx_tuple__403); /* "include/color_dict.pxi":397 * 'lavenderblush' : (255, 240, 245), * 'lavenderblush1' : (255, 240, 245), * 'lavenderblush2' : (238, 224, 229), # <<<<<<<<<<<<<< * 'lavenderblush3' : (205, 193, 197), * 'lavenderblush4' : (139, 131, 134), */ __pyx_tuple__404 = PyTuple_Pack(3, __pyx_int_238, __pyx_int_224, __pyx_int_229); if (unlikely(!__pyx_tuple__404)) __PYX_ERR(2, 397, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__404); __Pyx_GIVEREF(__pyx_tuple__404); /* "include/color_dict.pxi":398 * 'lavenderblush1' : (255, 240, 245), * 'lavenderblush2' : (238, 224, 229), * 'lavenderblush3' : (205, 193, 197), # <<<<<<<<<<<<<< * 'lavenderblush4' : (139, 131, 134), * 'lawngreen' : (124, 252, 0), */ __pyx_tuple__405 = PyTuple_Pack(3, __pyx_int_205, __pyx_int_193, __pyx_int_197); if (unlikely(!__pyx_tuple__405)) __PYX_ERR(2, 398, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__405); __Pyx_GIVEREF(__pyx_tuple__405); /* "include/color_dict.pxi":399 * 'lavenderblush2' : (238, 224, 229), * 'lavenderblush3' : (205, 193, 197), * 'lavenderblush4' : (139, 131, 134), # <<<<<<<<<<<<<< * 'lawngreen' : (124, 252, 0), * 'lemonchiffon' : (255, 250, 205), */ __pyx_tuple__406 = PyTuple_Pack(3, __pyx_int_139, __pyx_int_131, __pyx_int_134); if (unlikely(!__pyx_tuple__406)) __PYX_ERR(2, 399, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__406); __Pyx_GIVEREF(__pyx_tuple__406); /* "include/color_dict.pxi":400 * 'lavenderblush3' : (205, 193, 197), * 'lavenderblush4' : (139, 131, 134), * 'lawngreen' : (124, 252, 0), # <<<<<<<<<<<<<< * 'lemonchiffon' : (255, 250, 205), * 'lemonchiffon1' : (255, 250, 205), */ __pyx_tuple__407 = PyTuple_Pack(3, __pyx_int_124, __pyx_int_252, __pyx_int_0); if (unlikely(!__pyx_tuple__407)) __PYX_ERR(2, 400, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__407); __Pyx_GIVEREF(__pyx_tuple__407); /* "include/color_dict.pxi":401 * 'lavenderblush4' : (139, 131, 134), * 'lawngreen' : (124, 252, 0), * 'lemonchiffon' : (255, 250, 205), # <<<<<<<<<<<<<< * 'lemonchiffon1' : (255, 250, 205), * 'lemonchiffon2' : (238, 233, 191), */ __pyx_tuple__408 = PyTuple_Pack(3, __pyx_int_255, __pyx_int_250, __pyx_int_205); if (unlikely(!__pyx_tuple__408)) __PYX_ERR(2, 401, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__408); __Pyx_GIVEREF(__pyx_tuple__408); /* "include/color_dict.pxi":402 * 'lawngreen' : (124, 252, 0), * 'lemonchiffon' : (255, 250, 205), * 'lemonchiffon1' : (255, 250, 205), # <<<<<<<<<<<<<< * 'lemonchiffon2' : (238, 233, 191), * 'lemonchiffon3' : (205, 201, 165), */ __pyx_tuple__409 = PyTuple_Pack(3, __pyx_int_255, __pyx_int_250, __pyx_int_205); if (unlikely(!__pyx_tuple__409)) __PYX_ERR(2, 402, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__409); __Pyx_GIVEREF(__pyx_tuple__409); /* "include/color_dict.pxi":403 * 'lemonchiffon' : (255, 250, 205), * 'lemonchiffon1' : (255, 250, 205), * 'lemonchiffon2' : (238, 233, 191), # <<<<<<<<<<<<<< * 'lemonchiffon3' : (205, 201, 165), * 'lemonchiffon4' : (139, 137, 112), */ __pyx_tuple__410 = PyTuple_Pack(3, __pyx_int_238, __pyx_int_233, __pyx_int_191); if (unlikely(!__pyx_tuple__410)) __PYX_ERR(2, 403, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__410); __Pyx_GIVEREF(__pyx_tuple__410); /* "include/color_dict.pxi":404 * 'lemonchiffon1' : (255, 250, 205), * 'lemonchiffon2' : (238, 233, 191), * 'lemonchiffon3' : (205, 201, 165), # <<<<<<<<<<<<<< * 'lemonchiffon4' : (139, 137, 112), * 'lightblue' : (173, 216, 230), */ __pyx_tuple__411 = PyTuple_Pack(3, __pyx_int_205, __pyx_int_201, __pyx_int_165); if (unlikely(!__pyx_tuple__411)) __PYX_ERR(2, 404, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__411); __Pyx_GIVEREF(__pyx_tuple__411); /* "include/color_dict.pxi":405 * 'lemonchiffon2' : (238, 233, 191), * 'lemonchiffon3' : (205, 201, 165), * 'lemonchiffon4' : (139, 137, 112), # <<<<<<<<<<<<<< * 'lightblue' : (173, 216, 230), * 'lightblue1' : (191, 239, 255), */ __pyx_tuple__412 = PyTuple_Pack(3, __pyx_int_139, __pyx_int_137, __pyx_int_112); if (unlikely(!__pyx_tuple__412)) __PYX_ERR(2, 405, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__412); __Pyx_GIVEREF(__pyx_tuple__412); /* "include/color_dict.pxi":406 * 'lemonchiffon3' : (205, 201, 165), * 'lemonchiffon4' : (139, 137, 112), * 'lightblue' : (173, 216, 230), # <<<<<<<<<<<<<< * 'lightblue1' : (191, 239, 255), * 'lightblue2' : (178, 223, 238), */ __pyx_tuple__413 = PyTuple_Pack(3, __pyx_int_173, __pyx_int_216, __pyx_int_230); if (unlikely(!__pyx_tuple__413)) __PYX_ERR(2, 406, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__413); __Pyx_GIVEREF(__pyx_tuple__413); /* "include/color_dict.pxi":407 * 'lemonchiffon4' : (139, 137, 112), * 'lightblue' : (173, 216, 230), * 'lightblue1' : (191, 239, 255), # <<<<<<<<<<<<<< * 'lightblue2' : (178, 223, 238), * 'lightblue3' : (154, 192, 205), */ __pyx_tuple__414 = PyTuple_Pack(3, __pyx_int_191, __pyx_int_239, __pyx_int_255); if (unlikely(!__pyx_tuple__414)) __PYX_ERR(2, 407, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__414); __Pyx_GIVEREF(__pyx_tuple__414); /* "include/color_dict.pxi":408 * 'lightblue' : (173, 216, 230), * 'lightblue1' : (191, 239, 255), * 'lightblue2' : (178, 223, 238), # <<<<<<<<<<<<<< * 'lightblue3' : (154, 192, 205), * 'lightblue4' : (104, 131, 139), */ __pyx_tuple__415 = PyTuple_Pack(3, __pyx_int_178, __pyx_int_223, __pyx_int_238); if (unlikely(!__pyx_tuple__415)) __PYX_ERR(2, 408, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__415); __Pyx_GIVEREF(__pyx_tuple__415); /* "include/color_dict.pxi":409 * 'lightblue1' : (191, 239, 255), * 'lightblue2' : (178, 223, 238), * 'lightblue3' : (154, 192, 205), # <<<<<<<<<<<<<< * 'lightblue4' : (104, 131, 139), * 'lightcoral' : (240, 128, 128), */ __pyx_tuple__416 = PyTuple_Pack(3, __pyx_int_154, __pyx_int_192, __pyx_int_205); if (unlikely(!__pyx_tuple__416)) __PYX_ERR(2, 409, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__416); __Pyx_GIVEREF(__pyx_tuple__416); /* "include/color_dict.pxi":410 * 'lightblue2' : (178, 223, 238), * 'lightblue3' : (154, 192, 205), * 'lightblue4' : (104, 131, 139), # <<<<<<<<<<<<<< * 'lightcoral' : (240, 128, 128), * 'lightcyan' : (224, 255, 255), */ __pyx_tuple__417 = PyTuple_Pack(3, __pyx_int_104, __pyx_int_131, __pyx_int_139); if (unlikely(!__pyx_tuple__417)) __PYX_ERR(2, 410, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__417); __Pyx_GIVEREF(__pyx_tuple__417); /* "include/color_dict.pxi":411 * 'lightblue3' : (154, 192, 205), * 'lightblue4' : (104, 131, 139), * 'lightcoral' : (240, 128, 128), # <<<<<<<<<<<<<< * 'lightcyan' : (224, 255, 255), * 'lightcyan1' : (224, 255, 255), */ __pyx_tuple__418 = PyTuple_Pack(3, __pyx_int_240, __pyx_int_128, __pyx_int_128); if (unlikely(!__pyx_tuple__418)) __PYX_ERR(2, 411, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__418); __Pyx_GIVEREF(__pyx_tuple__418); /* "include/color_dict.pxi":412 * 'lightblue4' : (104, 131, 139), * 'lightcoral' : (240, 128, 128), * 'lightcyan' : (224, 255, 255), # <<<<<<<<<<<<<< * 'lightcyan1' : (224, 255, 255), * 'lightcyan2' : (209, 238, 238), */ __pyx_tuple__419 = PyTuple_Pack(3, __pyx_int_224, __pyx_int_255, __pyx_int_255); if (unlikely(!__pyx_tuple__419)) __PYX_ERR(2, 412, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__419); __Pyx_GIVEREF(__pyx_tuple__419); /* "include/color_dict.pxi":413 * 'lightcoral' : (240, 128, 128), * 'lightcyan' : (224, 255, 255), * 'lightcyan1' : (224, 255, 255), # <<<<<<<<<<<<<< * 'lightcyan2' : (209, 238, 238), * 'lightcyan3' : (180, 205, 205), */ __pyx_tuple__420 = PyTuple_Pack(3, __pyx_int_224, __pyx_int_255, __pyx_int_255); if (unlikely(!__pyx_tuple__420)) __PYX_ERR(2, 413, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__420); __Pyx_GIVEREF(__pyx_tuple__420); /* "include/color_dict.pxi":414 * 'lightcyan' : (224, 255, 255), * 'lightcyan1' : (224, 255, 255), * 'lightcyan2' : (209, 238, 238), # <<<<<<<<<<<<<< * 'lightcyan3' : (180, 205, 205), * 'lightcyan4' : (122, 139, 139), */ __pyx_tuple__421 = PyTuple_Pack(3, __pyx_int_209, __pyx_int_238, __pyx_int_238); if (unlikely(!__pyx_tuple__421)) __PYX_ERR(2, 414, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__421); __Pyx_GIVEREF(__pyx_tuple__421); /* "include/color_dict.pxi":415 * 'lightcyan1' : (224, 255, 255), * 'lightcyan2' : (209, 238, 238), * 'lightcyan3' : (180, 205, 205), # <<<<<<<<<<<<<< * 'lightcyan4' : (122, 139, 139), * 'lightgoldenrod' : (238, 221, 130), */ __pyx_tuple__422 = PyTuple_Pack(3, __pyx_int_180, __pyx_int_205, __pyx_int_205); if (unlikely(!__pyx_tuple__422)) __PYX_ERR(2, 415, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__422); __Pyx_GIVEREF(__pyx_tuple__422); /* "include/color_dict.pxi":416 * 'lightcyan2' : (209, 238, 238), * 'lightcyan3' : (180, 205, 205), * 'lightcyan4' : (122, 139, 139), # <<<<<<<<<<<<<< * 'lightgoldenrod' : (238, 221, 130), * 'lightgoldenrod1' : (255, 236, 139), */ __pyx_tuple__423 = PyTuple_Pack(3, __pyx_int_122, __pyx_int_139, __pyx_int_139); if (unlikely(!__pyx_tuple__423)) __PYX_ERR(2, 416, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__423); __Pyx_GIVEREF(__pyx_tuple__423); /* "include/color_dict.pxi":417 * 'lightcyan3' : (180, 205, 205), * 'lightcyan4' : (122, 139, 139), * 'lightgoldenrod' : (238, 221, 130), # <<<<<<<<<<<<<< * 'lightgoldenrod1' : (255, 236, 139), * 'lightgoldenrod2' : (238, 220, 130), */ __pyx_tuple__424 = PyTuple_Pack(3, __pyx_int_238, __pyx_int_221, __pyx_int_130); if (unlikely(!__pyx_tuple__424)) __PYX_ERR(2, 417, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__424); __Pyx_GIVEREF(__pyx_tuple__424); /* "include/color_dict.pxi":418 * 'lightcyan4' : (122, 139, 139), * 'lightgoldenrod' : (238, 221, 130), * 'lightgoldenrod1' : (255, 236, 139), # <<<<<<<<<<<<<< * 'lightgoldenrod2' : (238, 220, 130), * 'lightgoldenrod3' : (205, 190, 112), */ __pyx_tuple__425 = PyTuple_Pack(3, __pyx_int_255, __pyx_int_236, __pyx_int_139); if (unlikely(!__pyx_tuple__425)) __PYX_ERR(2, 418, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__425); __Pyx_GIVEREF(__pyx_tuple__425); /* "include/color_dict.pxi":419 * 'lightgoldenrod' : (238, 221, 130), * 'lightgoldenrod1' : (255, 236, 139), * 'lightgoldenrod2' : (238, 220, 130), # <<<<<<<<<<<<<< * 'lightgoldenrod3' : (205, 190, 112), * 'lightgoldenrod4' : (139, 129, 76), */ __pyx_tuple__426 = PyTuple_Pack(3, __pyx_int_238, __pyx_int_220, __pyx_int_130); if (unlikely(!__pyx_tuple__426)) __PYX_ERR(2, 419, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__426); __Pyx_GIVEREF(__pyx_tuple__426); /* "include/color_dict.pxi":420 * 'lightgoldenrod1' : (255, 236, 139), * 'lightgoldenrod2' : (238, 220, 130), * 'lightgoldenrod3' : (205, 190, 112), # <<<<<<<<<<<<<< * 'lightgoldenrod4' : (139, 129, 76), * 'lightgoldenrodyellow' : (250, 250, 210), */ __pyx_tuple__427 = PyTuple_Pack(3, __pyx_int_205, __pyx_int_190, __pyx_int_112); if (unlikely(!__pyx_tuple__427)) __PYX_ERR(2, 420, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__427); __Pyx_GIVEREF(__pyx_tuple__427); /* "include/color_dict.pxi":421 * 'lightgoldenrod2' : (238, 220, 130), * 'lightgoldenrod3' : (205, 190, 112), * 'lightgoldenrod4' : (139, 129, 76), # <<<<<<<<<<<<<< * 'lightgoldenrodyellow' : (250, 250, 210), * 'lightgray' : (211, 211, 211), */ __pyx_tuple__428 = PyTuple_Pack(3, __pyx_int_139, __pyx_int_129, __pyx_int_76); if (unlikely(!__pyx_tuple__428)) __PYX_ERR(2, 421, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__428); __Pyx_GIVEREF(__pyx_tuple__428); /* "include/color_dict.pxi":422 * 'lightgoldenrod3' : (205, 190, 112), * 'lightgoldenrod4' : (139, 129, 76), * 'lightgoldenrodyellow' : (250, 250, 210), # <<<<<<<<<<<<<< * 'lightgray' : (211, 211, 211), * 'lightgreen' : (144, 238, 144), */ __pyx_tuple__429 = PyTuple_Pack(3, __pyx_int_250, __pyx_int_250, __pyx_int_210); if (unlikely(!__pyx_tuple__429)) __PYX_ERR(2, 422, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__429); __Pyx_GIVEREF(__pyx_tuple__429); /* "include/color_dict.pxi":423 * 'lightgoldenrod4' : (139, 129, 76), * 'lightgoldenrodyellow' : (250, 250, 210), * 'lightgray' : (211, 211, 211), # <<<<<<<<<<<<<< * 'lightgreen' : (144, 238, 144), * 'lightgrey' : (211, 211, 211), */ __pyx_tuple__430 = PyTuple_Pack(3, __pyx_int_211, __pyx_int_211, __pyx_int_211); if (unlikely(!__pyx_tuple__430)) __PYX_ERR(2, 423, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__430); __Pyx_GIVEREF(__pyx_tuple__430); /* "include/color_dict.pxi":424 * 'lightgoldenrodyellow' : (250, 250, 210), * 'lightgray' : (211, 211, 211), * 'lightgreen' : (144, 238, 144), # <<<<<<<<<<<<<< * 'lightgrey' : (211, 211, 211), * 'lightpink' : (255, 182, 193), */ __pyx_tuple__431 = PyTuple_Pack(3, __pyx_int_144, __pyx_int_238, __pyx_int_144); if (unlikely(!__pyx_tuple__431)) __PYX_ERR(2, 424, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__431); __Pyx_GIVEREF(__pyx_tuple__431); /* "include/color_dict.pxi":425 * 'lightgray' : (211, 211, 211), * 'lightgreen' : (144, 238, 144), * 'lightgrey' : (211, 211, 211), # <<<<<<<<<<<<<< * 'lightpink' : (255, 182, 193), * 'lightpink1' : (255, 174, 185), */ __pyx_tuple__432 = PyTuple_Pack(3, __pyx_int_211, __pyx_int_211, __pyx_int_211); if (unlikely(!__pyx_tuple__432)) __PYX_ERR(2, 425, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__432); __Pyx_GIVEREF(__pyx_tuple__432); /* "include/color_dict.pxi":426 * 'lightgreen' : (144, 238, 144), * 'lightgrey' : (211, 211, 211), * 'lightpink' : (255, 182, 193), # <<<<<<<<<<<<<< * 'lightpink1' : (255, 174, 185), * 'lightpink2' : (238, 162, 173), */ __pyx_tuple__433 = PyTuple_Pack(3, __pyx_int_255, __pyx_int_182, __pyx_int_193); if (unlikely(!__pyx_tuple__433)) __PYX_ERR(2, 426, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__433); __Pyx_GIVEREF(__pyx_tuple__433); /* "include/color_dict.pxi":427 * 'lightgrey' : (211, 211, 211), * 'lightpink' : (255, 182, 193), * 'lightpink1' : (255, 174, 185), # <<<<<<<<<<<<<< * 'lightpink2' : (238, 162, 173), * 'lightpink3' : (205, 140, 149), */ __pyx_tuple__434 = PyTuple_Pack(3, __pyx_int_255, __pyx_int_174, __pyx_int_185); if (unlikely(!__pyx_tuple__434)) __PYX_ERR(2, 427, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__434); __Pyx_GIVEREF(__pyx_tuple__434); /* "include/color_dict.pxi":428 * 'lightpink' : (255, 182, 193), * 'lightpink1' : (255, 174, 185), * 'lightpink2' : (238, 162, 173), # <<<<<<<<<<<<<< * 'lightpink3' : (205, 140, 149), * 'lightpink4' : (139, 95, 101), */ __pyx_tuple__435 = PyTuple_Pack(3, __pyx_int_238, __pyx_int_162, __pyx_int_173); if (unlikely(!__pyx_tuple__435)) __PYX_ERR(2, 428, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__435); __Pyx_GIVEREF(__pyx_tuple__435); /* "include/color_dict.pxi":429 * 'lightpink1' : (255, 174, 185), * 'lightpink2' : (238, 162, 173), * 'lightpink3' : (205, 140, 149), # <<<<<<<<<<<<<< * 'lightpink4' : (139, 95, 101), * 'lightsalmon' : (255, 160, 122), */ __pyx_tuple__436 = PyTuple_Pack(3, __pyx_int_205, __pyx_int_140, __pyx_int_149); if (unlikely(!__pyx_tuple__436)) __PYX_ERR(2, 429, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__436); __Pyx_GIVEREF(__pyx_tuple__436); /* "include/color_dict.pxi":430 * 'lightpink2' : (238, 162, 173), * 'lightpink3' : (205, 140, 149), * 'lightpink4' : (139, 95, 101), # <<<<<<<<<<<<<< * 'lightsalmon' : (255, 160, 122), * 'lightsalmon1' : (255, 160, 122), */ __pyx_tuple__437 = PyTuple_Pack(3, __pyx_int_139, __pyx_int_95, __pyx_int_101); if (unlikely(!__pyx_tuple__437)) __PYX_ERR(2, 430, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__437); __Pyx_GIVEREF(__pyx_tuple__437); /* "include/color_dict.pxi":431 * 'lightpink3' : (205, 140, 149), * 'lightpink4' : (139, 95, 101), * 'lightsalmon' : (255, 160, 122), # <<<<<<<<<<<<<< * 'lightsalmon1' : (255, 160, 122), * 'lightsalmon2' : (238, 149, 114), */ __pyx_tuple__438 = PyTuple_Pack(3, __pyx_int_255, __pyx_int_160, __pyx_int_122); if (unlikely(!__pyx_tuple__438)) __PYX_ERR(2, 431, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__438); __Pyx_GIVEREF(__pyx_tuple__438); /* "include/color_dict.pxi":432 * 'lightpink4' : (139, 95, 101), * 'lightsalmon' : (255, 160, 122), * 'lightsalmon1' : (255, 160, 122), # <<<<<<<<<<<<<< * 'lightsalmon2' : (238, 149, 114), * 'lightsalmon3' : (205, 129, 98), */ __pyx_tuple__439 = PyTuple_Pack(3, __pyx_int_255, __pyx_int_160, __pyx_int_122); if (unlikely(!__pyx_tuple__439)) __PYX_ERR(2, 432, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__439); __Pyx_GIVEREF(__pyx_tuple__439); /* "include/color_dict.pxi":433 * 'lightsalmon' : (255, 160, 122), * 'lightsalmon1' : (255, 160, 122), * 'lightsalmon2' : (238, 149, 114), # <<<<<<<<<<<<<< * 'lightsalmon3' : (205, 129, 98), * 'lightsalmon4' : (139, 87, 66), */ __pyx_tuple__440 = PyTuple_Pack(3, __pyx_int_238, __pyx_int_149, __pyx_int_114); if (unlikely(!__pyx_tuple__440)) __PYX_ERR(2, 433, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__440); __Pyx_GIVEREF(__pyx_tuple__440); /* "include/color_dict.pxi":434 * 'lightsalmon1' : (255, 160, 122), * 'lightsalmon2' : (238, 149, 114), * 'lightsalmon3' : (205, 129, 98), # <<<<<<<<<<<<<< * 'lightsalmon4' : (139, 87, 66), * 'lightseagreen' : (32, 178, 170), */ __pyx_tuple__441 = PyTuple_Pack(3, __pyx_int_205, __pyx_int_129, __pyx_int_98); if (unlikely(!__pyx_tuple__441)) __PYX_ERR(2, 434, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__441); __Pyx_GIVEREF(__pyx_tuple__441); /* "include/color_dict.pxi":435 * 'lightsalmon2' : (238, 149, 114), * 'lightsalmon3' : (205, 129, 98), * 'lightsalmon4' : (139, 87, 66), # <<<<<<<<<<<<<< * 'lightseagreen' : (32, 178, 170), * 'lightskyblue' : (135, 206, 250), */ __pyx_tuple__442 = PyTuple_Pack(3, __pyx_int_139, __pyx_int_87, __pyx_int_66); if (unlikely(!__pyx_tuple__442)) __PYX_ERR(2, 435, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__442); __Pyx_GIVEREF(__pyx_tuple__442); /* "include/color_dict.pxi":436 * 'lightsalmon3' : (205, 129, 98), * 'lightsalmon4' : (139, 87, 66), * 'lightseagreen' : (32, 178, 170), # <<<<<<<<<<<<<< * 'lightskyblue' : (135, 206, 250), * 'lightskyblue1' : (176, 226, 255), */ __pyx_tuple__443 = PyTuple_Pack(3, __pyx_int_32, __pyx_int_178, __pyx_int_170); if (unlikely(!__pyx_tuple__443)) __PYX_ERR(2, 436, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__443); __Pyx_GIVEREF(__pyx_tuple__443); /* "include/color_dict.pxi":437 * 'lightsalmon4' : (139, 87, 66), * 'lightseagreen' : (32, 178, 170), * 'lightskyblue' : (135, 206, 250), # <<<<<<<<<<<<<< * 'lightskyblue1' : (176, 226, 255), * 'lightskyblue2' : (164, 211, 238), */ __pyx_tuple__444 = PyTuple_Pack(3, __pyx_int_135, __pyx_int_206, __pyx_int_250); if (unlikely(!__pyx_tuple__444)) __PYX_ERR(2, 437, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__444); __Pyx_GIVEREF(__pyx_tuple__444); /* "include/color_dict.pxi":438 * 'lightseagreen' : (32, 178, 170), * 'lightskyblue' : (135, 206, 250), * 'lightskyblue1' : (176, 226, 255), # <<<<<<<<<<<<<< * 'lightskyblue2' : (164, 211, 238), * 'lightskyblue3' : (141, 182, 205), */ __pyx_tuple__445 = PyTuple_Pack(3, __pyx_int_176, __pyx_int_226, __pyx_int_255); if (unlikely(!__pyx_tuple__445)) __PYX_ERR(2, 438, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__445); __Pyx_GIVEREF(__pyx_tuple__445); /* "include/color_dict.pxi":439 * 'lightskyblue' : (135, 206, 250), * 'lightskyblue1' : (176, 226, 255), * 'lightskyblue2' : (164, 211, 238), # <<<<<<<<<<<<<< * 'lightskyblue3' : (141, 182, 205), * 'lightskyblue4' : (96, 123, 139), */ __pyx_tuple__446 = PyTuple_Pack(3, __pyx_int_164, __pyx_int_211, __pyx_int_238); if (unlikely(!__pyx_tuple__446)) __PYX_ERR(2, 439, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__446); __Pyx_GIVEREF(__pyx_tuple__446); /* "include/color_dict.pxi":440 * 'lightskyblue1' : (176, 226, 255), * 'lightskyblue2' : (164, 211, 238), * 'lightskyblue3' : (141, 182, 205), # <<<<<<<<<<<<<< * 'lightskyblue4' : (96, 123, 139), * 'lightslateblue' : (132, 112, 255), */ __pyx_tuple__447 = PyTuple_Pack(3, __pyx_int_141, __pyx_int_182, __pyx_int_205); if (unlikely(!__pyx_tuple__447)) __PYX_ERR(2, 440, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__447); __Pyx_GIVEREF(__pyx_tuple__447); /* "include/color_dict.pxi":441 * 'lightskyblue2' : (164, 211, 238), * 'lightskyblue3' : (141, 182, 205), * 'lightskyblue4' : (96, 123, 139), # <<<<<<<<<<<<<< * 'lightslateblue' : (132, 112, 255), * 'lightslategray' : (119, 136, 153), */ __pyx_tuple__448 = PyTuple_Pack(3, __pyx_int_96, __pyx_int_123, __pyx_int_139); if (unlikely(!__pyx_tuple__448)) __PYX_ERR(2, 441, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__448); __Pyx_GIVEREF(__pyx_tuple__448); /* "include/color_dict.pxi":442 * 'lightskyblue3' : (141, 182, 205), * 'lightskyblue4' : (96, 123, 139), * 'lightslateblue' : (132, 112, 255), # <<<<<<<<<<<<<< * 'lightslategray' : (119, 136, 153), * 'lightslategrey' : (119, 136, 153), */ __pyx_tuple__449 = PyTuple_Pack(3, __pyx_int_132, __pyx_int_112, __pyx_int_255); if (unlikely(!__pyx_tuple__449)) __PYX_ERR(2, 442, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__449); __Pyx_GIVEREF(__pyx_tuple__449); /* "include/color_dict.pxi":443 * 'lightskyblue4' : (96, 123, 139), * 'lightslateblue' : (132, 112, 255), * 'lightslategray' : (119, 136, 153), # <<<<<<<<<<<<<< * 'lightslategrey' : (119, 136, 153), * 'lightsteelblue' : (176, 196, 222), */ __pyx_tuple__450 = PyTuple_Pack(3, __pyx_int_119, __pyx_int_136, __pyx_int_153); if (unlikely(!__pyx_tuple__450)) __PYX_ERR(2, 443, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__450); __Pyx_GIVEREF(__pyx_tuple__450); /* "include/color_dict.pxi":444 * 'lightslateblue' : (132, 112, 255), * 'lightslategray' : (119, 136, 153), * 'lightslategrey' : (119, 136, 153), # <<<<<<<<<<<<<< * 'lightsteelblue' : (176, 196, 222), * 'lightsteelblue1' : (202, 225, 255), */ __pyx_tuple__451 = PyTuple_Pack(3, __pyx_int_119, __pyx_int_136, __pyx_int_153); if (unlikely(!__pyx_tuple__451)) __PYX_ERR(2, 444, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__451); __Pyx_GIVEREF(__pyx_tuple__451); /* "include/color_dict.pxi":445 * 'lightslategray' : (119, 136, 153), * 'lightslategrey' : (119, 136, 153), * 'lightsteelblue' : (176, 196, 222), # <<<<<<<<<<<<<< * 'lightsteelblue1' : (202, 225, 255), * 'lightsteelblue2' : (188, 210, 238), */ __pyx_tuple__452 = PyTuple_Pack(3, __pyx_int_176, __pyx_int_196, __pyx_int_222); if (unlikely(!__pyx_tuple__452)) __PYX_ERR(2, 445, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__452); __Pyx_GIVEREF(__pyx_tuple__452); /* "include/color_dict.pxi":446 * 'lightslategrey' : (119, 136, 153), * 'lightsteelblue' : (176, 196, 222), * 'lightsteelblue1' : (202, 225, 255), # <<<<<<<<<<<<<< * 'lightsteelblue2' : (188, 210, 238), * 'lightsteelblue3' : (162, 181, 205), */ __pyx_tuple__453 = PyTuple_Pack(3, __pyx_int_202, __pyx_int_225, __pyx_int_255); if (unlikely(!__pyx_tuple__453)) __PYX_ERR(2, 446, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__453); __Pyx_GIVEREF(__pyx_tuple__453); /* "include/color_dict.pxi":447 * 'lightsteelblue' : (176, 196, 222), * 'lightsteelblue1' : (202, 225, 255), * 'lightsteelblue2' : (188, 210, 238), # <<<<<<<<<<<<<< * 'lightsteelblue3' : (162, 181, 205), * 'lightsteelblue4' : (110, 123, 139), */ __pyx_tuple__454 = PyTuple_Pack(3, __pyx_int_188, __pyx_int_210, __pyx_int_238); if (unlikely(!__pyx_tuple__454)) __PYX_ERR(2, 447, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__454); __Pyx_GIVEREF(__pyx_tuple__454); /* "include/color_dict.pxi":448 * 'lightsteelblue1' : (202, 225, 255), * 'lightsteelblue2' : (188, 210, 238), * 'lightsteelblue3' : (162, 181, 205), # <<<<<<<<<<<<<< * 'lightsteelblue4' : (110, 123, 139), * 'lightyellow' : (255, 255, 224), */ __pyx_tuple__455 = PyTuple_Pack(3, __pyx_int_162, __pyx_int_181, __pyx_int_205); if (unlikely(!__pyx_tuple__455)) __PYX_ERR(2, 448, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__455); __Pyx_GIVEREF(__pyx_tuple__455); /* "include/color_dict.pxi":449 * 'lightsteelblue2' : (188, 210, 238), * 'lightsteelblue3' : (162, 181, 205), * 'lightsteelblue4' : (110, 123, 139), # <<<<<<<<<<<<<< * 'lightyellow' : (255, 255, 224), * 'lightyellow1' : (255, 255, 224), */ __pyx_tuple__456 = PyTuple_Pack(3, __pyx_int_110, __pyx_int_123, __pyx_int_139); if (unlikely(!__pyx_tuple__456)) __PYX_ERR(2, 449, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__456); __Pyx_GIVEREF(__pyx_tuple__456); /* "include/color_dict.pxi":450 * 'lightsteelblue3' : (162, 181, 205), * 'lightsteelblue4' : (110, 123, 139), * 'lightyellow' : (255, 255, 224), # <<<<<<<<<<<<<< * 'lightyellow1' : (255, 255, 224), * 'lightyellow2' : (238, 238, 209), */ __pyx_tuple__457 = PyTuple_Pack(3, __pyx_int_255, __pyx_int_255, __pyx_int_224); if (unlikely(!__pyx_tuple__457)) __PYX_ERR(2, 450, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__457); __Pyx_GIVEREF(__pyx_tuple__457); /* "include/color_dict.pxi":451 * 'lightsteelblue4' : (110, 123, 139), * 'lightyellow' : (255, 255, 224), * 'lightyellow1' : (255, 255, 224), # <<<<<<<<<<<<<< * 'lightyellow2' : (238, 238, 209), * 'lightyellow3' : (205, 205, 180), */ __pyx_tuple__458 = PyTuple_Pack(3, __pyx_int_255, __pyx_int_255, __pyx_int_224); if (unlikely(!__pyx_tuple__458)) __PYX_ERR(2, 451, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__458); __Pyx_GIVEREF(__pyx_tuple__458); /* "include/color_dict.pxi":452 * 'lightyellow' : (255, 255, 224), * 'lightyellow1' : (255, 255, 224), * 'lightyellow2' : (238, 238, 209), # <<<<<<<<<<<<<< * 'lightyellow3' : (205, 205, 180), * 'lightyellow4' : (139, 139, 122), */ __pyx_tuple__459 = PyTuple_Pack(3, __pyx_int_238, __pyx_int_238, __pyx_int_209); if (unlikely(!__pyx_tuple__459)) __PYX_ERR(2, 452, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__459); __Pyx_GIVEREF(__pyx_tuple__459); /* "include/color_dict.pxi":453 * 'lightyellow1' : (255, 255, 224), * 'lightyellow2' : (238, 238, 209), * 'lightyellow3' : (205, 205, 180), # <<<<<<<<<<<<<< * 'lightyellow4' : (139, 139, 122), * 'lime' : (0, 255, 0), */ __pyx_tuple__460 = PyTuple_Pack(3, __pyx_int_205, __pyx_int_205, __pyx_int_180); if (unlikely(!__pyx_tuple__460)) __PYX_ERR(2, 453, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__460); __Pyx_GIVEREF(__pyx_tuple__460); /* "include/color_dict.pxi":454 * 'lightyellow2' : (238, 238, 209), * 'lightyellow3' : (205, 205, 180), * 'lightyellow4' : (139, 139, 122), # <<<<<<<<<<<<<< * 'lime' : (0, 255, 0), * 'limegreen' : (50, 205, 50), */ __pyx_tuple__461 = PyTuple_Pack(3, __pyx_int_139, __pyx_int_139, __pyx_int_122); if (unlikely(!__pyx_tuple__461)) __PYX_ERR(2, 454, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__461); __Pyx_GIVEREF(__pyx_tuple__461); /* "include/color_dict.pxi":455 * 'lightyellow3' : (205, 205, 180), * 'lightyellow4' : (139, 139, 122), * 'lime' : (0, 255, 0), # <<<<<<<<<<<<<< * 'limegreen' : (50, 205, 50), * 'linen' : (250, 240, 230), */ __pyx_tuple__462 = PyTuple_Pack(3, __pyx_int_0, __pyx_int_255, __pyx_int_0); if (unlikely(!__pyx_tuple__462)) __PYX_ERR(2, 455, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__462); __Pyx_GIVEREF(__pyx_tuple__462); /* "include/color_dict.pxi":456 * 'lightyellow4' : (139, 139, 122), * 'lime' : (0, 255, 0), * 'limegreen' : (50, 205, 50), # <<<<<<<<<<<<<< * 'linen' : (250, 240, 230), * 'magenta' : (255, 0, 255), */ __pyx_tuple__463 = PyTuple_Pack(3, __pyx_int_50, __pyx_int_205, __pyx_int_50); if (unlikely(!__pyx_tuple__463)) __PYX_ERR(2, 456, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__463); __Pyx_GIVEREF(__pyx_tuple__463); /* "include/color_dict.pxi":457 * 'lime' : (0, 255, 0), * 'limegreen' : (50, 205, 50), * 'linen' : (250, 240, 230), # <<<<<<<<<<<<<< * 'magenta' : (255, 0, 255), * 'magenta1' : (255, 0, 255), */ __pyx_tuple__464 = PyTuple_Pack(3, __pyx_int_250, __pyx_int_240, __pyx_int_230); if (unlikely(!__pyx_tuple__464)) __PYX_ERR(2, 457, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__464); __Pyx_GIVEREF(__pyx_tuple__464); /* "include/color_dict.pxi":458 * 'limegreen' : (50, 205, 50), * 'linen' : (250, 240, 230), * 'magenta' : (255, 0, 255), # <<<<<<<<<<<<<< * 'magenta1' : (255, 0, 255), * 'magenta2' : (238, 0, 238), */ __pyx_tuple__465 = PyTuple_Pack(3, __pyx_int_255, __pyx_int_0, __pyx_int_255); if (unlikely(!__pyx_tuple__465)) __PYX_ERR(2, 458, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__465); __Pyx_GIVEREF(__pyx_tuple__465); /* "include/color_dict.pxi":459 * 'linen' : (250, 240, 230), * 'magenta' : (255, 0, 255), * 'magenta1' : (255, 0, 255), # <<<<<<<<<<<<<< * 'magenta2' : (238, 0, 238), * 'magenta3' : (205, 0, 205), */ __pyx_tuple__466 = PyTuple_Pack(3, __pyx_int_255, __pyx_int_0, __pyx_int_255); if (unlikely(!__pyx_tuple__466)) __PYX_ERR(2, 459, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__466); __Pyx_GIVEREF(__pyx_tuple__466); /* "include/color_dict.pxi":460 * 'magenta' : (255, 0, 255), * 'magenta1' : (255, 0, 255), * 'magenta2' : (238, 0, 238), # <<<<<<<<<<<<<< * 'magenta3' : (205, 0, 205), * 'magenta4' : (139, 0, 139), */ __pyx_tuple__467 = PyTuple_Pack(3, __pyx_int_238, __pyx_int_0, __pyx_int_238); if (unlikely(!__pyx_tuple__467)) __PYX_ERR(2, 460, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__467); __Pyx_GIVEREF(__pyx_tuple__467); /* "include/color_dict.pxi":461 * 'magenta1' : (255, 0, 255), * 'magenta2' : (238, 0, 238), * 'magenta3' : (205, 0, 205), # <<<<<<<<<<<<<< * 'magenta4' : (139, 0, 139), * 'maroon' : (176, 48, 96), */ __pyx_tuple__468 = PyTuple_Pack(3, __pyx_int_205, __pyx_int_0, __pyx_int_205); if (unlikely(!__pyx_tuple__468)) __PYX_ERR(2, 461, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__468); __Pyx_GIVEREF(__pyx_tuple__468); /* "include/color_dict.pxi":462 * 'magenta2' : (238, 0, 238), * 'magenta3' : (205, 0, 205), * 'magenta4' : (139, 0, 139), # <<<<<<<<<<<<<< * 'maroon' : (176, 48, 96), * 'maroon1' : (255, 52, 179), */ __pyx_tuple__469 = PyTuple_Pack(3, __pyx_int_139, __pyx_int_0, __pyx_int_139); if (unlikely(!__pyx_tuple__469)) __PYX_ERR(2, 462, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__469); __Pyx_GIVEREF(__pyx_tuple__469); /* "include/color_dict.pxi":463 * 'magenta3' : (205, 0, 205), * 'magenta4' : (139, 0, 139), * 'maroon' : (176, 48, 96), # <<<<<<<<<<<<<< * 'maroon1' : (255, 52, 179), * 'maroon2' : (238, 48, 167), */ __pyx_tuple__470 = PyTuple_Pack(3, __pyx_int_176, __pyx_int_48, __pyx_int_96); if (unlikely(!__pyx_tuple__470)) __PYX_ERR(2, 463, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__470); __Pyx_GIVEREF(__pyx_tuple__470); /* "include/color_dict.pxi":464 * 'magenta4' : (139, 0, 139), * 'maroon' : (176, 48, 96), * 'maroon1' : (255, 52, 179), # <<<<<<<<<<<<<< * 'maroon2' : (238, 48, 167), * 'maroon3' : (205, 41, 144), */ __pyx_tuple__471 = PyTuple_Pack(3, __pyx_int_255, __pyx_int_52, __pyx_int_179); if (unlikely(!__pyx_tuple__471)) __PYX_ERR(2, 464, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__471); __Pyx_GIVEREF(__pyx_tuple__471); /* "include/color_dict.pxi":465 * 'maroon' : (176, 48, 96), * 'maroon1' : (255, 52, 179), * 'maroon2' : (238, 48, 167), # <<<<<<<<<<<<<< * 'maroon3' : (205, 41, 144), * 'maroon4' : (139, 28, 98), */ __pyx_tuple__472 = PyTuple_Pack(3, __pyx_int_238, __pyx_int_48, __pyx_int_167); if (unlikely(!__pyx_tuple__472)) __PYX_ERR(2, 465, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__472); __Pyx_GIVEREF(__pyx_tuple__472); /* "include/color_dict.pxi":466 * 'maroon1' : (255, 52, 179), * 'maroon2' : (238, 48, 167), * 'maroon3' : (205, 41, 144), # <<<<<<<<<<<<<< * 'maroon4' : (139, 28, 98), * 'mediumaquamarine' : (102, 205, 170), */ __pyx_tuple__473 = PyTuple_Pack(3, __pyx_int_205, __pyx_int_41, __pyx_int_144); if (unlikely(!__pyx_tuple__473)) __PYX_ERR(2, 466, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__473); __Pyx_GIVEREF(__pyx_tuple__473); /* "include/color_dict.pxi":467 * 'maroon2' : (238, 48, 167), * 'maroon3' : (205, 41, 144), * 'maroon4' : (139, 28, 98), # <<<<<<<<<<<<<< * 'mediumaquamarine' : (102, 205, 170), * 'mediumblue' : (0, 0, 205), */ __pyx_tuple__474 = PyTuple_Pack(3, __pyx_int_139, __pyx_int_28, __pyx_int_98); if (unlikely(!__pyx_tuple__474)) __PYX_ERR(2, 467, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__474); __Pyx_GIVEREF(__pyx_tuple__474); /* "include/color_dict.pxi":468 * 'maroon3' : (205, 41, 144), * 'maroon4' : (139, 28, 98), * 'mediumaquamarine' : (102, 205, 170), # <<<<<<<<<<<<<< * 'mediumblue' : (0, 0, 205), * 'mediumorchid' : (186, 85, 211), */ __pyx_tuple__475 = PyTuple_Pack(3, __pyx_int_102, __pyx_int_205, __pyx_int_170); if (unlikely(!__pyx_tuple__475)) __PYX_ERR(2, 468, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__475); __Pyx_GIVEREF(__pyx_tuple__475); /* "include/color_dict.pxi":469 * 'maroon4' : (139, 28, 98), * 'mediumaquamarine' : (102, 205, 170), * 'mediumblue' : (0, 0, 205), # <<<<<<<<<<<<<< * 'mediumorchid' : (186, 85, 211), * 'mediumorchid1' : (224, 102, 255), */ __pyx_tuple__476 = PyTuple_Pack(3, __pyx_int_0, __pyx_int_0, __pyx_int_205); if (unlikely(!__pyx_tuple__476)) __PYX_ERR(2, 469, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__476); __Pyx_GIVEREF(__pyx_tuple__476); /* "include/color_dict.pxi":470 * 'mediumaquamarine' : (102, 205, 170), * 'mediumblue' : (0, 0, 205), * 'mediumorchid' : (186, 85, 211), # <<<<<<<<<<<<<< * 'mediumorchid1' : (224, 102, 255), * 'mediumorchid2' : (209, 95, 238), */ __pyx_tuple__477 = PyTuple_Pack(3, __pyx_int_186, __pyx_int_85, __pyx_int_211); if (unlikely(!__pyx_tuple__477)) __PYX_ERR(2, 470, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__477); __Pyx_GIVEREF(__pyx_tuple__477); /* "include/color_dict.pxi":471 * 'mediumblue' : (0, 0, 205), * 'mediumorchid' : (186, 85, 211), * 'mediumorchid1' : (224, 102, 255), # <<<<<<<<<<<<<< * 'mediumorchid2' : (209, 95, 238), * 'mediumorchid3' : (180, 82, 205), */ __pyx_tuple__478 = PyTuple_Pack(3, __pyx_int_224, __pyx_int_102, __pyx_int_255); if (unlikely(!__pyx_tuple__478)) __PYX_ERR(2, 471, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__478); __Pyx_GIVEREF(__pyx_tuple__478); /* "include/color_dict.pxi":472 * 'mediumorchid' : (186, 85, 211), * 'mediumorchid1' : (224, 102, 255), * 'mediumorchid2' : (209, 95, 238), # <<<<<<<<<<<<<< * 'mediumorchid3' : (180, 82, 205), * 'mediumorchid4' : (122, 55, 139), */ __pyx_tuple__479 = PyTuple_Pack(3, __pyx_int_209, __pyx_int_95, __pyx_int_238); if (unlikely(!__pyx_tuple__479)) __PYX_ERR(2, 472, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__479); __Pyx_GIVEREF(__pyx_tuple__479); /* "include/color_dict.pxi":473 * 'mediumorchid1' : (224, 102, 255), * 'mediumorchid2' : (209, 95, 238), * 'mediumorchid3' : (180, 82, 205), # <<<<<<<<<<<<<< * 'mediumorchid4' : (122, 55, 139), * 'mediumpurple' : (147, 112, 219), */ __pyx_tuple__480 = PyTuple_Pack(3, __pyx_int_180, __pyx_int_82, __pyx_int_205); if (unlikely(!__pyx_tuple__480)) __PYX_ERR(2, 473, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__480); __Pyx_GIVEREF(__pyx_tuple__480); /* "include/color_dict.pxi":474 * 'mediumorchid2' : (209, 95, 238), * 'mediumorchid3' : (180, 82, 205), * 'mediumorchid4' : (122, 55, 139), # <<<<<<<<<<<<<< * 'mediumpurple' : (147, 112, 219), * 'mediumpurple1' : (171, 130, 255), */ __pyx_tuple__481 = PyTuple_Pack(3, __pyx_int_122, __pyx_int_55, __pyx_int_139); if (unlikely(!__pyx_tuple__481)) __PYX_ERR(2, 474, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__481); __Pyx_GIVEREF(__pyx_tuple__481); /* "include/color_dict.pxi":475 * 'mediumorchid3' : (180, 82, 205), * 'mediumorchid4' : (122, 55, 139), * 'mediumpurple' : (147, 112, 219), # <<<<<<<<<<<<<< * 'mediumpurple1' : (171, 130, 255), * 'mediumpurple2' : (159, 121, 238), */ __pyx_tuple__482 = PyTuple_Pack(3, __pyx_int_147, __pyx_int_112, __pyx_int_219); if (unlikely(!__pyx_tuple__482)) __PYX_ERR(2, 475, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__482); __Pyx_GIVEREF(__pyx_tuple__482); /* "include/color_dict.pxi":476 * 'mediumorchid4' : (122, 55, 139), * 'mediumpurple' : (147, 112, 219), * 'mediumpurple1' : (171, 130, 255), # <<<<<<<<<<<<<< * 'mediumpurple2' : (159, 121, 238), * 'mediumpurple3' : (137, 104, 205), */ __pyx_tuple__483 = PyTuple_Pack(3, __pyx_int_171, __pyx_int_130, __pyx_int_255); if (unlikely(!__pyx_tuple__483)) __PYX_ERR(2, 476, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__483); __Pyx_GIVEREF(__pyx_tuple__483); /* "include/color_dict.pxi":477 * 'mediumpurple' : (147, 112, 219), * 'mediumpurple1' : (171, 130, 255), * 'mediumpurple2' : (159, 121, 238), # <<<<<<<<<<<<<< * 'mediumpurple3' : (137, 104, 205), * 'mediumpurple4' : (93, 71, 139), */ __pyx_tuple__484 = PyTuple_Pack(3, __pyx_int_159, __pyx_int_121, __pyx_int_238); if (unlikely(!__pyx_tuple__484)) __PYX_ERR(2, 477, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__484); __Pyx_GIVEREF(__pyx_tuple__484); /* "include/color_dict.pxi":478 * 'mediumpurple1' : (171, 130, 255), * 'mediumpurple2' : (159, 121, 238), * 'mediumpurple3' : (137, 104, 205), # <<<<<<<<<<<<<< * 'mediumpurple4' : (93, 71, 139), * 'mediumseagreen' : (60, 179, 113), */ __pyx_tuple__485 = PyTuple_Pack(3, __pyx_int_137, __pyx_int_104, __pyx_int_205); if (unlikely(!__pyx_tuple__485)) __PYX_ERR(2, 478, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__485); __Pyx_GIVEREF(__pyx_tuple__485); /* "include/color_dict.pxi":479 * 'mediumpurple2' : (159, 121, 238), * 'mediumpurple3' : (137, 104, 205), * 'mediumpurple4' : (93, 71, 139), # <<<<<<<<<<<<<< * 'mediumseagreen' : (60, 179, 113), * 'mediumslateblue' : (123, 104, 238), */ __pyx_tuple__486 = PyTuple_Pack(3, __pyx_int_93, __pyx_int_71, __pyx_int_139); if (unlikely(!__pyx_tuple__486)) __PYX_ERR(2, 479, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__486); __Pyx_GIVEREF(__pyx_tuple__486); /* "include/color_dict.pxi":480 * 'mediumpurple3' : (137, 104, 205), * 'mediumpurple4' : (93, 71, 139), * 'mediumseagreen' : (60, 179, 113), # <<<<<<<<<<<<<< * 'mediumslateblue' : (123, 104, 238), * 'mediumspringgreen' : (0, 250, 154), */ __pyx_tuple__487 = PyTuple_Pack(3, __pyx_int_60, __pyx_int_179, __pyx_int_113); if (unlikely(!__pyx_tuple__487)) __PYX_ERR(2, 480, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__487); __Pyx_GIVEREF(__pyx_tuple__487); /* "include/color_dict.pxi":481 * 'mediumpurple4' : (93, 71, 139), * 'mediumseagreen' : (60, 179, 113), * 'mediumslateblue' : (123, 104, 238), # <<<<<<<<<<<<<< * 'mediumspringgreen' : (0, 250, 154), * 'mediumturquoise' : (72, 209, 204), */ __pyx_tuple__488 = PyTuple_Pack(3, __pyx_int_123, __pyx_int_104, __pyx_int_238); if (unlikely(!__pyx_tuple__488)) __PYX_ERR(2, 481, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__488); __Pyx_GIVEREF(__pyx_tuple__488); /* "include/color_dict.pxi":482 * 'mediumseagreen' : (60, 179, 113), * 'mediumslateblue' : (123, 104, 238), * 'mediumspringgreen' : (0, 250, 154), # <<<<<<<<<<<<<< * 'mediumturquoise' : (72, 209, 204), * 'mediumvioletred' : (199, 21, 133), */ __pyx_tuple__489 = PyTuple_Pack(3, __pyx_int_0, __pyx_int_250, __pyx_int_154); if (unlikely(!__pyx_tuple__489)) __PYX_ERR(2, 482, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__489); __Pyx_GIVEREF(__pyx_tuple__489); /* "include/color_dict.pxi":483 * 'mediumslateblue' : (123, 104, 238), * 'mediumspringgreen' : (0, 250, 154), * 'mediumturquoise' : (72, 209, 204), # <<<<<<<<<<<<<< * 'mediumvioletred' : (199, 21, 133), * 'midnightblue' : (25, 25, 112), */ __pyx_tuple__490 = PyTuple_Pack(3, __pyx_int_72, __pyx_int_209, __pyx_int_204); if (unlikely(!__pyx_tuple__490)) __PYX_ERR(2, 483, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__490); __Pyx_GIVEREF(__pyx_tuple__490); /* "include/color_dict.pxi":484 * 'mediumspringgreen' : (0, 250, 154), * 'mediumturquoise' : (72, 209, 204), * 'mediumvioletred' : (199, 21, 133), # <<<<<<<<<<<<<< * 'midnightblue' : (25, 25, 112), * 'mintcream' : (245, 255, 250), */ __pyx_tuple__491 = PyTuple_Pack(3, __pyx_int_199, __pyx_int_21, __pyx_int_133); if (unlikely(!__pyx_tuple__491)) __PYX_ERR(2, 484, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__491); __Pyx_GIVEREF(__pyx_tuple__491); /* "include/color_dict.pxi":485 * 'mediumturquoise' : (72, 209, 204), * 'mediumvioletred' : (199, 21, 133), * 'midnightblue' : (25, 25, 112), # <<<<<<<<<<<<<< * 'mintcream' : (245, 255, 250), * 'mistyrose' : (255, 228, 225), */ __pyx_tuple__492 = PyTuple_Pack(3, __pyx_int_25, __pyx_int_25, __pyx_int_112); if (unlikely(!__pyx_tuple__492)) __PYX_ERR(2, 485, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__492); __Pyx_GIVEREF(__pyx_tuple__492); /* "include/color_dict.pxi":486 * 'mediumvioletred' : (199, 21, 133), * 'midnightblue' : (25, 25, 112), * 'mintcream' : (245, 255, 250), # <<<<<<<<<<<<<< * 'mistyrose' : (255, 228, 225), * 'mistyrose1' : (255, 228, 225), */ __pyx_tuple__493 = PyTuple_Pack(3, __pyx_int_245, __pyx_int_255, __pyx_int_250); if (unlikely(!__pyx_tuple__493)) __PYX_ERR(2, 486, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__493); __Pyx_GIVEREF(__pyx_tuple__493); /* "include/color_dict.pxi":487 * 'midnightblue' : (25, 25, 112), * 'mintcream' : (245, 255, 250), * 'mistyrose' : (255, 228, 225), # <<<<<<<<<<<<<< * 'mistyrose1' : (255, 228, 225), * 'mistyrose2' : (238, 213, 210), */ __pyx_tuple__494 = PyTuple_Pack(3, __pyx_int_255, __pyx_int_228, __pyx_int_225); if (unlikely(!__pyx_tuple__494)) __PYX_ERR(2, 487, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__494); __Pyx_GIVEREF(__pyx_tuple__494); /* "include/color_dict.pxi":488 * 'mintcream' : (245, 255, 250), * 'mistyrose' : (255, 228, 225), * 'mistyrose1' : (255, 228, 225), # <<<<<<<<<<<<<< * 'mistyrose2' : (238, 213, 210), * 'mistyrose3' : (205, 183, 181), */ __pyx_tuple__495 = PyTuple_Pack(3, __pyx_int_255, __pyx_int_228, __pyx_int_225); if (unlikely(!__pyx_tuple__495)) __PYX_ERR(2, 488, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__495); __Pyx_GIVEREF(__pyx_tuple__495); /* "include/color_dict.pxi":489 * 'mistyrose' : (255, 228, 225), * 'mistyrose1' : (255, 228, 225), * 'mistyrose2' : (238, 213, 210), # <<<<<<<<<<<<<< * 'mistyrose3' : (205, 183, 181), * 'mistyrose4' : (139, 125, 123), */ __pyx_tuple__496 = PyTuple_Pack(3, __pyx_int_238, __pyx_int_213, __pyx_int_210); if (unlikely(!__pyx_tuple__496)) __PYX_ERR(2, 489, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__496); __Pyx_GIVEREF(__pyx_tuple__496); /* "include/color_dict.pxi":490 * 'mistyrose1' : (255, 228, 225), * 'mistyrose2' : (238, 213, 210), * 'mistyrose3' : (205, 183, 181), # <<<<<<<<<<<<<< * 'mistyrose4' : (139, 125, 123), * 'moccasin' : (255, 228, 181), */ __pyx_tuple__497 = PyTuple_Pack(3, __pyx_int_205, __pyx_int_183, __pyx_int_181); if (unlikely(!__pyx_tuple__497)) __PYX_ERR(2, 490, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__497); __Pyx_GIVEREF(__pyx_tuple__497); /* "include/color_dict.pxi":491 * 'mistyrose2' : (238, 213, 210), * 'mistyrose3' : (205, 183, 181), * 'mistyrose4' : (139, 125, 123), # <<<<<<<<<<<<<< * 'moccasin' : (255, 228, 181), * 'navajowhite' : (255, 222, 173), */ __pyx_tuple__498 = PyTuple_Pack(3, __pyx_int_139, __pyx_int_125, __pyx_int_123); if (unlikely(!__pyx_tuple__498)) __PYX_ERR(2, 491, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__498); __Pyx_GIVEREF(__pyx_tuple__498); /* "include/color_dict.pxi":492 * 'mistyrose3' : (205, 183, 181), * 'mistyrose4' : (139, 125, 123), * 'moccasin' : (255, 228, 181), # <<<<<<<<<<<<<< * 'navajowhite' : (255, 222, 173), * 'navajowhite1' : (255, 222, 173), */ __pyx_tuple__499 = PyTuple_Pack(3, __pyx_int_255, __pyx_int_228, __pyx_int_181); if (unlikely(!__pyx_tuple__499)) __PYX_ERR(2, 492, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__499); __Pyx_GIVEREF(__pyx_tuple__499); /* "include/color_dict.pxi":493 * 'mistyrose4' : (139, 125, 123), * 'moccasin' : (255, 228, 181), * 'navajowhite' : (255, 222, 173), # <<<<<<<<<<<<<< * 'navajowhite1' : (255, 222, 173), * 'navajowhite2' : (238, 207, 161), */ __pyx_tuple__500 = PyTuple_Pack(3, __pyx_int_255, __pyx_int_222, __pyx_int_173); if (unlikely(!__pyx_tuple__500)) __PYX_ERR(2, 493, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__500); __Pyx_GIVEREF(__pyx_tuple__500); /* "include/color_dict.pxi":494 * 'moccasin' : (255, 228, 181), * 'navajowhite' : (255, 222, 173), * 'navajowhite1' : (255, 222, 173), # <<<<<<<<<<<<<< * 'navajowhite2' : (238, 207, 161), * 'navajowhite3' : (205, 179, 139), */ __pyx_tuple__501 = PyTuple_Pack(3, __pyx_int_255, __pyx_int_222, __pyx_int_173); if (unlikely(!__pyx_tuple__501)) __PYX_ERR(2, 494, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__501); __Pyx_GIVEREF(__pyx_tuple__501); /* "include/color_dict.pxi":495 * 'navajowhite' : (255, 222, 173), * 'navajowhite1' : (255, 222, 173), * 'navajowhite2' : (238, 207, 161), # <<<<<<<<<<<<<< * 'navajowhite3' : (205, 179, 139), * 'navajowhite4' : (139, 121, 94), */ __pyx_tuple__502 = PyTuple_Pack(3, __pyx_int_238, __pyx_int_207, __pyx_int_161); if (unlikely(!__pyx_tuple__502)) __PYX_ERR(2, 495, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__502); __Pyx_GIVEREF(__pyx_tuple__502); /* "include/color_dict.pxi":496 * 'navajowhite1' : (255, 222, 173), * 'navajowhite2' : (238, 207, 161), * 'navajowhite3' : (205, 179, 139), # <<<<<<<<<<<<<< * 'navajowhite4' : (139, 121, 94), * 'navy' : (0, 0, 128), */ __pyx_tuple__503 = PyTuple_Pack(3, __pyx_int_205, __pyx_int_179, __pyx_int_139); if (unlikely(!__pyx_tuple__503)) __PYX_ERR(2, 496, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__503); __Pyx_GIVEREF(__pyx_tuple__503); /* "include/color_dict.pxi":497 * 'navajowhite2' : (238, 207, 161), * 'navajowhite3' : (205, 179, 139), * 'navajowhite4' : (139, 121, 94), # <<<<<<<<<<<<<< * 'navy' : (0, 0, 128), * 'navyblue' : (0, 0, 128), */ __pyx_tuple__504 = PyTuple_Pack(3, __pyx_int_139, __pyx_int_121, __pyx_int_94); if (unlikely(!__pyx_tuple__504)) __PYX_ERR(2, 497, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__504); __Pyx_GIVEREF(__pyx_tuple__504); /* "include/color_dict.pxi":498 * 'navajowhite3' : (205, 179, 139), * 'navajowhite4' : (139, 121, 94), * 'navy' : (0, 0, 128), # <<<<<<<<<<<<<< * 'navyblue' : (0, 0, 128), * 'oldlace' : (253, 245, 230), */ __pyx_tuple__505 = PyTuple_Pack(3, __pyx_int_0, __pyx_int_0, __pyx_int_128); if (unlikely(!__pyx_tuple__505)) __PYX_ERR(2, 498, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__505); __Pyx_GIVEREF(__pyx_tuple__505); /* "include/color_dict.pxi":499 * 'navajowhite4' : (139, 121, 94), * 'navy' : (0, 0, 128), * 'navyblue' : (0, 0, 128), # <<<<<<<<<<<<<< * 'oldlace' : (253, 245, 230), * 'olive' : (128, 128, 0), */ __pyx_tuple__506 = PyTuple_Pack(3, __pyx_int_0, __pyx_int_0, __pyx_int_128); if (unlikely(!__pyx_tuple__506)) __PYX_ERR(2, 499, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__506); __Pyx_GIVEREF(__pyx_tuple__506); /* "include/color_dict.pxi":500 * 'navy' : (0, 0, 128), * 'navyblue' : (0, 0, 128), * 'oldlace' : (253, 245, 230), # <<<<<<<<<<<<<< * 'olive' : (128, 128, 0), * 'olivedrab' : (107, 142, 35), */ __pyx_tuple__507 = PyTuple_Pack(3, __pyx_int_253, __pyx_int_245, __pyx_int_230); if (unlikely(!__pyx_tuple__507)) __PYX_ERR(2, 500, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__507); __Pyx_GIVEREF(__pyx_tuple__507); /* "include/color_dict.pxi":501 * 'navyblue' : (0, 0, 128), * 'oldlace' : (253, 245, 230), * 'olive' : (128, 128, 0), # <<<<<<<<<<<<<< * 'olivedrab' : (107, 142, 35), * 'olivedrab1' : (192, 255, 62), */ __pyx_tuple__508 = PyTuple_Pack(3, __pyx_int_128, __pyx_int_128, __pyx_int_0); if (unlikely(!__pyx_tuple__508)) __PYX_ERR(2, 501, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__508); __Pyx_GIVEREF(__pyx_tuple__508); /* "include/color_dict.pxi":502 * 'oldlace' : (253, 245, 230), * 'olive' : (128, 128, 0), * 'olivedrab' : (107, 142, 35), # <<<<<<<<<<<<<< * 'olivedrab1' : (192, 255, 62), * 'olivedrab2' : (179, 238, 58), */ __pyx_tuple__509 = PyTuple_Pack(3, __pyx_int_107, __pyx_int_142, __pyx_int_35); if (unlikely(!__pyx_tuple__509)) __PYX_ERR(2, 502, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__509); __Pyx_GIVEREF(__pyx_tuple__509); /* "include/color_dict.pxi":503 * 'olive' : (128, 128, 0), * 'olivedrab' : (107, 142, 35), * 'olivedrab1' : (192, 255, 62), # <<<<<<<<<<<<<< * 'olivedrab2' : (179, 238, 58), * 'olivedrab3' : (154, 205, 50), */ __pyx_tuple__510 = PyTuple_Pack(3, __pyx_int_192, __pyx_int_255, __pyx_int_62); if (unlikely(!__pyx_tuple__510)) __PYX_ERR(2, 503, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__510); __Pyx_GIVEREF(__pyx_tuple__510); /* "include/color_dict.pxi":504 * 'olivedrab' : (107, 142, 35), * 'olivedrab1' : (192, 255, 62), * 'olivedrab2' : (179, 238, 58), # <<<<<<<<<<<<<< * 'olivedrab3' : (154, 205, 50), * 'olivedrab4' : (105, 139, 34), */ __pyx_tuple__511 = PyTuple_Pack(3, __pyx_int_179, __pyx_int_238, __pyx_int_58); if (unlikely(!__pyx_tuple__511)) __PYX_ERR(2, 504, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__511); __Pyx_GIVEREF(__pyx_tuple__511); /* "include/color_dict.pxi":505 * 'olivedrab1' : (192, 255, 62), * 'olivedrab2' : (179, 238, 58), * 'olivedrab3' : (154, 205, 50), # <<<<<<<<<<<<<< * 'olivedrab4' : (105, 139, 34), * 'orange' : (255, 165, 0), */ __pyx_tuple__512 = PyTuple_Pack(3, __pyx_int_154, __pyx_int_205, __pyx_int_50); if (unlikely(!__pyx_tuple__512)) __PYX_ERR(2, 505, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__512); __Pyx_GIVEREF(__pyx_tuple__512); /* "include/color_dict.pxi":506 * 'olivedrab2' : (179, 238, 58), * 'olivedrab3' : (154, 205, 50), * 'olivedrab4' : (105, 139, 34), # <<<<<<<<<<<<<< * 'orange' : (255, 165, 0), * 'orange1' : (255, 165, 0), */ __pyx_tuple__513 = PyTuple_Pack(3, __pyx_int_105, __pyx_int_139, __pyx_int_34); if (unlikely(!__pyx_tuple__513)) __PYX_ERR(2, 506, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__513); __Pyx_GIVEREF(__pyx_tuple__513); /* "include/color_dict.pxi":507 * 'olivedrab3' : (154, 205, 50), * 'olivedrab4' : (105, 139, 34), * 'orange' : (255, 165, 0), # <<<<<<<<<<<<<< * 'orange1' : (255, 165, 0), * 'orange2' : (238, 154, 0), */ __pyx_tuple__514 = PyTuple_Pack(3, __pyx_int_255, __pyx_int_165, __pyx_int_0); if (unlikely(!__pyx_tuple__514)) __PYX_ERR(2, 507, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__514); __Pyx_GIVEREF(__pyx_tuple__514); /* "include/color_dict.pxi":508 * 'olivedrab4' : (105, 139, 34), * 'orange' : (255, 165, 0), * 'orange1' : (255, 165, 0), # <<<<<<<<<<<<<< * 'orange2' : (238, 154, 0), * 'orange3' : (205, 133, 0), */ __pyx_tuple__515 = PyTuple_Pack(3, __pyx_int_255, __pyx_int_165, __pyx_int_0); if (unlikely(!__pyx_tuple__515)) __PYX_ERR(2, 508, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__515); __Pyx_GIVEREF(__pyx_tuple__515); /* "include/color_dict.pxi":509 * 'orange' : (255, 165, 0), * 'orange1' : (255, 165, 0), * 'orange2' : (238, 154, 0), # <<<<<<<<<<<<<< * 'orange3' : (205, 133, 0), * 'orange4' : (139, 90, 0), */ __pyx_tuple__516 = PyTuple_Pack(3, __pyx_int_238, __pyx_int_154, __pyx_int_0); if (unlikely(!__pyx_tuple__516)) __PYX_ERR(2, 509, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__516); __Pyx_GIVEREF(__pyx_tuple__516); /* "include/color_dict.pxi":510 * 'orange1' : (255, 165, 0), * 'orange2' : (238, 154, 0), * 'orange3' : (205, 133, 0), # <<<<<<<<<<<<<< * 'orange4' : (139, 90, 0), * 'orangered' : (255, 69, 0), */ __pyx_tuple__517 = PyTuple_Pack(3, __pyx_int_205, __pyx_int_133, __pyx_int_0); if (unlikely(!__pyx_tuple__517)) __PYX_ERR(2, 510, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__517); __Pyx_GIVEREF(__pyx_tuple__517); /* "include/color_dict.pxi":511 * 'orange2' : (238, 154, 0), * 'orange3' : (205, 133, 0), * 'orange4' : (139, 90, 0), # <<<<<<<<<<<<<< * 'orangered' : (255, 69, 0), * 'orangered1' : (255, 69, 0), */ __pyx_tuple__518 = PyTuple_Pack(3, __pyx_int_139, __pyx_int_90, __pyx_int_0); if (unlikely(!__pyx_tuple__518)) __PYX_ERR(2, 511, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__518); __Pyx_GIVEREF(__pyx_tuple__518); /* "include/color_dict.pxi":512 * 'orange3' : (205, 133, 0), * 'orange4' : (139, 90, 0), * 'orangered' : (255, 69, 0), # <<<<<<<<<<<<<< * 'orangered1' : (255, 69, 0), * 'orangered2' : (238, 64, 0), */ __pyx_tuple__519 = PyTuple_Pack(3, __pyx_int_255, __pyx_int_69, __pyx_int_0); if (unlikely(!__pyx_tuple__519)) __PYX_ERR(2, 512, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__519); __Pyx_GIVEREF(__pyx_tuple__519); /* "include/color_dict.pxi":513 * 'orange4' : (139, 90, 0), * 'orangered' : (255, 69, 0), * 'orangered1' : (255, 69, 0), # <<<<<<<<<<<<<< * 'orangered2' : (238, 64, 0), * 'orangered3' : (205, 55, 0), */ __pyx_tuple__520 = PyTuple_Pack(3, __pyx_int_255, __pyx_int_69, __pyx_int_0); if (unlikely(!__pyx_tuple__520)) __PYX_ERR(2, 513, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__520); __Pyx_GIVEREF(__pyx_tuple__520); /* "include/color_dict.pxi":514 * 'orangered' : (255, 69, 0), * 'orangered1' : (255, 69, 0), * 'orangered2' : (238, 64, 0), # <<<<<<<<<<<<<< * 'orangered3' : (205, 55, 0), * 'orangered4' : (139, 37, 0), */ __pyx_tuple__521 = PyTuple_Pack(3, __pyx_int_238, __pyx_int_64, __pyx_int_0); if (unlikely(!__pyx_tuple__521)) __PYX_ERR(2, 514, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__521); __Pyx_GIVEREF(__pyx_tuple__521); /* "include/color_dict.pxi":515 * 'orangered1' : (255, 69, 0), * 'orangered2' : (238, 64, 0), * 'orangered3' : (205, 55, 0), # <<<<<<<<<<<<<< * 'orangered4' : (139, 37, 0), * 'orchid' : (218, 112, 214), */ __pyx_tuple__522 = PyTuple_Pack(3, __pyx_int_205, __pyx_int_55, __pyx_int_0); if (unlikely(!__pyx_tuple__522)) __PYX_ERR(2, 515, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__522); __Pyx_GIVEREF(__pyx_tuple__522); /* "include/color_dict.pxi":516 * 'orangered2' : (238, 64, 0), * 'orangered3' : (205, 55, 0), * 'orangered4' : (139, 37, 0), # <<<<<<<<<<<<<< * 'orchid' : (218, 112, 214), * 'orchid1' : (255, 131, 250), */ __pyx_tuple__523 = PyTuple_Pack(3, __pyx_int_139, __pyx_int_37, __pyx_int_0); if (unlikely(!__pyx_tuple__523)) __PYX_ERR(2, 516, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__523); __Pyx_GIVEREF(__pyx_tuple__523); /* "include/color_dict.pxi":517 * 'orangered3' : (205, 55, 0), * 'orangered4' : (139, 37, 0), * 'orchid' : (218, 112, 214), # <<<<<<<<<<<<<< * 'orchid1' : (255, 131, 250), * 'orchid2' : (238, 122, 233), */ __pyx_tuple__524 = PyTuple_Pack(3, __pyx_int_218, __pyx_int_112, __pyx_int_214); if (unlikely(!__pyx_tuple__524)) __PYX_ERR(2, 517, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__524); __Pyx_GIVEREF(__pyx_tuple__524); /* "include/color_dict.pxi":518 * 'orangered4' : (139, 37, 0), * 'orchid' : (218, 112, 214), * 'orchid1' : (255, 131, 250), # <<<<<<<<<<<<<< * 'orchid2' : (238, 122, 233), * 'orchid3' : (205, 105, 201), */ __pyx_tuple__525 = PyTuple_Pack(3, __pyx_int_255, __pyx_int_131, __pyx_int_250); if (unlikely(!__pyx_tuple__525)) __PYX_ERR(2, 518, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__525); __Pyx_GIVEREF(__pyx_tuple__525); /* "include/color_dict.pxi":519 * 'orchid' : (218, 112, 214), * 'orchid1' : (255, 131, 250), * 'orchid2' : (238, 122, 233), # <<<<<<<<<<<<<< * 'orchid3' : (205, 105, 201), * 'orchid4' : (139, 71, 137), */ __pyx_tuple__526 = PyTuple_Pack(3, __pyx_int_238, __pyx_int_122, __pyx_int_233); if (unlikely(!__pyx_tuple__526)) __PYX_ERR(2, 519, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__526); __Pyx_GIVEREF(__pyx_tuple__526); /* "include/color_dict.pxi":520 * 'orchid1' : (255, 131, 250), * 'orchid2' : (238, 122, 233), * 'orchid3' : (205, 105, 201), # <<<<<<<<<<<<<< * 'orchid4' : (139, 71, 137), * 'palegoldenrod' : (238, 232, 170), */ __pyx_tuple__527 = PyTuple_Pack(3, __pyx_int_205, __pyx_int_105, __pyx_int_201); if (unlikely(!__pyx_tuple__527)) __PYX_ERR(2, 520, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__527); __Pyx_GIVEREF(__pyx_tuple__527); /* "include/color_dict.pxi":521 * 'orchid2' : (238, 122, 233), * 'orchid3' : (205, 105, 201), * 'orchid4' : (139, 71, 137), # <<<<<<<<<<<<<< * 'palegoldenrod' : (238, 232, 170), * 'palegreen' : (152, 251, 152), */ __pyx_tuple__528 = PyTuple_Pack(3, __pyx_int_139, __pyx_int_71, __pyx_int_137); if (unlikely(!__pyx_tuple__528)) __PYX_ERR(2, 521, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__528); __Pyx_GIVEREF(__pyx_tuple__528); /* "include/color_dict.pxi":522 * 'orchid3' : (205, 105, 201), * 'orchid4' : (139, 71, 137), * 'palegoldenrod' : (238, 232, 170), # <<<<<<<<<<<<<< * 'palegreen' : (152, 251, 152), * 'palegreen1' : (154, 255, 154), */ __pyx_tuple__529 = PyTuple_Pack(3, __pyx_int_238, __pyx_int_232, __pyx_int_170); if (unlikely(!__pyx_tuple__529)) __PYX_ERR(2, 522, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__529); __Pyx_GIVEREF(__pyx_tuple__529); /* "include/color_dict.pxi":523 * 'orchid4' : (139, 71, 137), * 'palegoldenrod' : (238, 232, 170), * 'palegreen' : (152, 251, 152), # <<<<<<<<<<<<<< * 'palegreen1' : (154, 255, 154), * 'palegreen2' : (144, 238, 144), */ __pyx_tuple__530 = PyTuple_Pack(3, __pyx_int_152, __pyx_int_251, __pyx_int_152); if (unlikely(!__pyx_tuple__530)) __PYX_ERR(2, 523, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__530); __Pyx_GIVEREF(__pyx_tuple__530); /* "include/color_dict.pxi":524 * 'palegoldenrod' : (238, 232, 170), * 'palegreen' : (152, 251, 152), * 'palegreen1' : (154, 255, 154), # <<<<<<<<<<<<<< * 'palegreen2' : (144, 238, 144), * 'palegreen3' : (124, 205, 124), */ __pyx_tuple__531 = PyTuple_Pack(3, __pyx_int_154, __pyx_int_255, __pyx_int_154); if (unlikely(!__pyx_tuple__531)) __PYX_ERR(2, 524, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__531); __Pyx_GIVEREF(__pyx_tuple__531); /* "include/color_dict.pxi":525 * 'palegreen' : (152, 251, 152), * 'palegreen1' : (154, 255, 154), * 'palegreen2' : (144, 238, 144), # <<<<<<<<<<<<<< * 'palegreen3' : (124, 205, 124), * 'palegreen4' : (84, 139, 84), */ __pyx_tuple__532 = PyTuple_Pack(3, __pyx_int_144, __pyx_int_238, __pyx_int_144); if (unlikely(!__pyx_tuple__532)) __PYX_ERR(2, 525, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__532); __Pyx_GIVEREF(__pyx_tuple__532); /* "include/color_dict.pxi":526 * 'palegreen1' : (154, 255, 154), * 'palegreen2' : (144, 238, 144), * 'palegreen3' : (124, 205, 124), # <<<<<<<<<<<<<< * 'palegreen4' : (84, 139, 84), * 'paleturquoise' : (175, 238, 238), */ __pyx_tuple__533 = PyTuple_Pack(3, __pyx_int_124, __pyx_int_205, __pyx_int_124); if (unlikely(!__pyx_tuple__533)) __PYX_ERR(2, 526, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__533); __Pyx_GIVEREF(__pyx_tuple__533); /* "include/color_dict.pxi":527 * 'palegreen2' : (144, 238, 144), * 'palegreen3' : (124, 205, 124), * 'palegreen4' : (84, 139, 84), # <<<<<<<<<<<<<< * 'paleturquoise' : (175, 238, 238), * 'paleturquoise1' : (187, 255, 255), */ __pyx_tuple__534 = PyTuple_Pack(3, __pyx_int_84, __pyx_int_139, __pyx_int_84); if (unlikely(!__pyx_tuple__534)) __PYX_ERR(2, 527, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__534); __Pyx_GIVEREF(__pyx_tuple__534); /* "include/color_dict.pxi":528 * 'palegreen3' : (124, 205, 124), * 'palegreen4' : (84, 139, 84), * 'paleturquoise' : (175, 238, 238), # <<<<<<<<<<<<<< * 'paleturquoise1' : (187, 255, 255), * 'paleturquoise2' : (174, 238, 238), */ __pyx_tuple__535 = PyTuple_Pack(3, __pyx_int_175, __pyx_int_238, __pyx_int_238); if (unlikely(!__pyx_tuple__535)) __PYX_ERR(2, 528, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__535); __Pyx_GIVEREF(__pyx_tuple__535); /* "include/color_dict.pxi":529 * 'palegreen4' : (84, 139, 84), * 'paleturquoise' : (175, 238, 238), * 'paleturquoise1' : (187, 255, 255), # <<<<<<<<<<<<<< * 'paleturquoise2' : (174, 238, 238), * 'paleturquoise3' : (150, 205, 205), */ __pyx_tuple__536 = PyTuple_Pack(3, __pyx_int_187, __pyx_int_255, __pyx_int_255); if (unlikely(!__pyx_tuple__536)) __PYX_ERR(2, 529, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__536); __Pyx_GIVEREF(__pyx_tuple__536); /* "include/color_dict.pxi":530 * 'paleturquoise' : (175, 238, 238), * 'paleturquoise1' : (187, 255, 255), * 'paleturquoise2' : (174, 238, 238), # <<<<<<<<<<<<<< * 'paleturquoise3' : (150, 205, 205), * 'paleturquoise4' : (102, 139, 139), */ __pyx_tuple__537 = PyTuple_Pack(3, __pyx_int_174, __pyx_int_238, __pyx_int_238); if (unlikely(!__pyx_tuple__537)) __PYX_ERR(2, 530, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__537); __Pyx_GIVEREF(__pyx_tuple__537); /* "include/color_dict.pxi":531 * 'paleturquoise1' : (187, 255, 255), * 'paleturquoise2' : (174, 238, 238), * 'paleturquoise3' : (150, 205, 205), # <<<<<<<<<<<<<< * 'paleturquoise4' : (102, 139, 139), * 'palevioletred' : (219, 112, 147), */ __pyx_tuple__538 = PyTuple_Pack(3, __pyx_int_150, __pyx_int_205, __pyx_int_205); if (unlikely(!__pyx_tuple__538)) __PYX_ERR(2, 531, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__538); __Pyx_GIVEREF(__pyx_tuple__538); /* "include/color_dict.pxi":532 * 'paleturquoise2' : (174, 238, 238), * 'paleturquoise3' : (150, 205, 205), * 'paleturquoise4' : (102, 139, 139), # <<<<<<<<<<<<<< * 'palevioletred' : (219, 112, 147), * 'palevioletred1' : (255, 130, 171), */ __pyx_tuple__539 = PyTuple_Pack(3, __pyx_int_102, __pyx_int_139, __pyx_int_139); if (unlikely(!__pyx_tuple__539)) __PYX_ERR(2, 532, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__539); __Pyx_GIVEREF(__pyx_tuple__539); /* "include/color_dict.pxi":533 * 'paleturquoise3' : (150, 205, 205), * 'paleturquoise4' : (102, 139, 139), * 'palevioletred' : (219, 112, 147), # <<<<<<<<<<<<<< * 'palevioletred1' : (255, 130, 171), * 'palevioletred2' : (238, 121, 159), */ __pyx_tuple__540 = PyTuple_Pack(3, __pyx_int_219, __pyx_int_112, __pyx_int_147); if (unlikely(!__pyx_tuple__540)) __PYX_ERR(2, 533, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__540); __Pyx_GIVEREF(__pyx_tuple__540); /* "include/color_dict.pxi":534 * 'paleturquoise4' : (102, 139, 139), * 'palevioletred' : (219, 112, 147), * 'palevioletred1' : (255, 130, 171), # <<<<<<<<<<<<<< * 'palevioletred2' : (238, 121, 159), * 'palevioletred3' : (205, 104, 137), */ __pyx_tuple__541 = PyTuple_Pack(3, __pyx_int_255, __pyx_int_130, __pyx_int_171); if (unlikely(!__pyx_tuple__541)) __PYX_ERR(2, 534, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__541); __Pyx_GIVEREF(__pyx_tuple__541); /* "include/color_dict.pxi":535 * 'palevioletred' : (219, 112, 147), * 'palevioletred1' : (255, 130, 171), * 'palevioletred2' : (238, 121, 159), # <<<<<<<<<<<<<< * 'palevioletred3' : (205, 104, 137), * 'palevioletred4' : (139, 71, 93), */ __pyx_tuple__542 = PyTuple_Pack(3, __pyx_int_238, __pyx_int_121, __pyx_int_159); if (unlikely(!__pyx_tuple__542)) __PYX_ERR(2, 535, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__542); __Pyx_GIVEREF(__pyx_tuple__542); /* "include/color_dict.pxi":536 * 'palevioletred1' : (255, 130, 171), * 'palevioletred2' : (238, 121, 159), * 'palevioletred3' : (205, 104, 137), # <<<<<<<<<<<<<< * 'palevioletred4' : (139, 71, 93), * 'papayawhip' : (255, 239, 213), */ __pyx_tuple__543 = PyTuple_Pack(3, __pyx_int_205, __pyx_int_104, __pyx_int_137); if (unlikely(!__pyx_tuple__543)) __PYX_ERR(2, 536, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__543); __Pyx_GIVEREF(__pyx_tuple__543); /* "include/color_dict.pxi":537 * 'palevioletred2' : (238, 121, 159), * 'palevioletred3' : (205, 104, 137), * 'palevioletred4' : (139, 71, 93), # <<<<<<<<<<<<<< * 'papayawhip' : (255, 239, 213), * 'peachpuff' : (255, 218, 185), */ __pyx_tuple__544 = PyTuple_Pack(3, __pyx_int_139, __pyx_int_71, __pyx_int_93); if (unlikely(!__pyx_tuple__544)) __PYX_ERR(2, 537, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__544); __Pyx_GIVEREF(__pyx_tuple__544); /* "include/color_dict.pxi":538 * 'palevioletred3' : (205, 104, 137), * 'palevioletred4' : (139, 71, 93), * 'papayawhip' : (255, 239, 213), # <<<<<<<<<<<<<< * 'peachpuff' : (255, 218, 185), * 'peachpuff1' : (255, 218, 185), */ __pyx_tuple__545 = PyTuple_Pack(3, __pyx_int_255, __pyx_int_239, __pyx_int_213); if (unlikely(!__pyx_tuple__545)) __PYX_ERR(2, 538, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__545); __Pyx_GIVEREF(__pyx_tuple__545); /* "include/color_dict.pxi":539 * 'palevioletred4' : (139, 71, 93), * 'papayawhip' : (255, 239, 213), * 'peachpuff' : (255, 218, 185), # <<<<<<<<<<<<<< * 'peachpuff1' : (255, 218, 185), * 'peachpuff2' : (238, 203, 173), */ __pyx_tuple__546 = PyTuple_Pack(3, __pyx_int_255, __pyx_int_218, __pyx_int_185); if (unlikely(!__pyx_tuple__546)) __PYX_ERR(2, 539, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__546); __Pyx_GIVEREF(__pyx_tuple__546); /* "include/color_dict.pxi":540 * 'papayawhip' : (255, 239, 213), * 'peachpuff' : (255, 218, 185), * 'peachpuff1' : (255, 218, 185), # <<<<<<<<<<<<<< * 'peachpuff2' : (238, 203, 173), * 'peachpuff3' : (205, 175, 149), */ __pyx_tuple__547 = PyTuple_Pack(3, __pyx_int_255, __pyx_int_218, __pyx_int_185); if (unlikely(!__pyx_tuple__547)) __PYX_ERR(2, 540, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__547); __Pyx_GIVEREF(__pyx_tuple__547); /* "include/color_dict.pxi":541 * 'peachpuff' : (255, 218, 185), * 'peachpuff1' : (255, 218, 185), * 'peachpuff2' : (238, 203, 173), # <<<<<<<<<<<<<< * 'peachpuff3' : (205, 175, 149), * 'peachpuff4' : (139, 119, 101), */ __pyx_tuple__548 = PyTuple_Pack(3, __pyx_int_238, __pyx_int_203, __pyx_int_173); if (unlikely(!__pyx_tuple__548)) __PYX_ERR(2, 541, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__548); __Pyx_GIVEREF(__pyx_tuple__548); /* "include/color_dict.pxi":542 * 'peachpuff1' : (255, 218, 185), * 'peachpuff2' : (238, 203, 173), * 'peachpuff3' : (205, 175, 149), # <<<<<<<<<<<<<< * 'peachpuff4' : (139, 119, 101), * 'peru' : (205, 133, 63), */ __pyx_tuple__549 = PyTuple_Pack(3, __pyx_int_205, __pyx_int_175, __pyx_int_149); if (unlikely(!__pyx_tuple__549)) __PYX_ERR(2, 542, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__549); __Pyx_GIVEREF(__pyx_tuple__549); /* "include/color_dict.pxi":543 * 'peachpuff2' : (238, 203, 173), * 'peachpuff3' : (205, 175, 149), * 'peachpuff4' : (139, 119, 101), # <<<<<<<<<<<<<< * 'peru' : (205, 133, 63), * 'pink' : (255, 192, 203), */ __pyx_tuple__550 = PyTuple_Pack(3, __pyx_int_139, __pyx_int_119, __pyx_int_101); if (unlikely(!__pyx_tuple__550)) __PYX_ERR(2, 543, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__550); __Pyx_GIVEREF(__pyx_tuple__550); /* "include/color_dict.pxi":544 * 'peachpuff3' : (205, 175, 149), * 'peachpuff4' : (139, 119, 101), * 'peru' : (205, 133, 63), # <<<<<<<<<<<<<< * 'pink' : (255, 192, 203), * 'pink1' : (255, 181, 197), */ __pyx_tuple__551 = PyTuple_Pack(3, __pyx_int_205, __pyx_int_133, __pyx_int_63); if (unlikely(!__pyx_tuple__551)) __PYX_ERR(2, 544, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__551); __Pyx_GIVEREF(__pyx_tuple__551); /* "include/color_dict.pxi":545 * 'peachpuff4' : (139, 119, 101), * 'peru' : (205, 133, 63), * 'pink' : (255, 192, 203), # <<<<<<<<<<<<<< * 'pink1' : (255, 181, 197), * 'pink2' : (238, 169, 184), */ __pyx_tuple__552 = PyTuple_Pack(3, __pyx_int_255, __pyx_int_192, __pyx_int_203); if (unlikely(!__pyx_tuple__552)) __PYX_ERR(2, 545, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__552); __Pyx_GIVEREF(__pyx_tuple__552); /* "include/color_dict.pxi":546 * 'peru' : (205, 133, 63), * 'pink' : (255, 192, 203), * 'pink1' : (255, 181, 197), # <<<<<<<<<<<<<< * 'pink2' : (238, 169, 184), * 'pink3' : (205, 145, 158), */ __pyx_tuple__553 = PyTuple_Pack(3, __pyx_int_255, __pyx_int_181, __pyx_int_197); if (unlikely(!__pyx_tuple__553)) __PYX_ERR(2, 546, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__553); __Pyx_GIVEREF(__pyx_tuple__553); /* "include/color_dict.pxi":547 * 'pink' : (255, 192, 203), * 'pink1' : (255, 181, 197), * 'pink2' : (238, 169, 184), # <<<<<<<<<<<<<< * 'pink3' : (205, 145, 158), * 'pink4' : (139, 99, 108), */ __pyx_tuple__554 = PyTuple_Pack(3, __pyx_int_238, __pyx_int_169, __pyx_int_184); if (unlikely(!__pyx_tuple__554)) __PYX_ERR(2, 547, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__554); __Pyx_GIVEREF(__pyx_tuple__554); /* "include/color_dict.pxi":548 * 'pink1' : (255, 181, 197), * 'pink2' : (238, 169, 184), * 'pink3' : (205, 145, 158), # <<<<<<<<<<<<<< * 'pink4' : (139, 99, 108), * 'plum' : (221, 160, 221), */ __pyx_tuple__555 = PyTuple_Pack(3, __pyx_int_205, __pyx_int_145, __pyx_int_158); if (unlikely(!__pyx_tuple__555)) __PYX_ERR(2, 548, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__555); __Pyx_GIVEREF(__pyx_tuple__555); /* "include/color_dict.pxi":549 * 'pink2' : (238, 169, 184), * 'pink3' : (205, 145, 158), * 'pink4' : (139, 99, 108), # <<<<<<<<<<<<<< * 'plum' : (221, 160, 221), * 'plum1' : (255, 187, 255), */ __pyx_tuple__556 = PyTuple_Pack(3, __pyx_int_139, __pyx_int_99, __pyx_int_108); if (unlikely(!__pyx_tuple__556)) __PYX_ERR(2, 549, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__556); __Pyx_GIVEREF(__pyx_tuple__556); /* "include/color_dict.pxi":550 * 'pink3' : (205, 145, 158), * 'pink4' : (139, 99, 108), * 'plum' : (221, 160, 221), # <<<<<<<<<<<<<< * 'plum1' : (255, 187, 255), * 'plum2' : (238, 174, 238), */ __pyx_tuple__557 = PyTuple_Pack(3, __pyx_int_221, __pyx_int_160, __pyx_int_221); if (unlikely(!__pyx_tuple__557)) __PYX_ERR(2, 550, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__557); __Pyx_GIVEREF(__pyx_tuple__557); /* "include/color_dict.pxi":551 * 'pink4' : (139, 99, 108), * 'plum' : (221, 160, 221), * 'plum1' : (255, 187, 255), # <<<<<<<<<<<<<< * 'plum2' : (238, 174, 238), * 'plum3' : (205, 150, 205), */ __pyx_tuple__558 = PyTuple_Pack(3, __pyx_int_255, __pyx_int_187, __pyx_int_255); if (unlikely(!__pyx_tuple__558)) __PYX_ERR(2, 551, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__558); __Pyx_GIVEREF(__pyx_tuple__558); /* "include/color_dict.pxi":552 * 'plum' : (221, 160, 221), * 'plum1' : (255, 187, 255), * 'plum2' : (238, 174, 238), # <<<<<<<<<<<<<< * 'plum3' : (205, 150, 205), * 'plum4' : (139, 102, 139), */ __pyx_tuple__559 = PyTuple_Pack(3, __pyx_int_238, __pyx_int_174, __pyx_int_238); if (unlikely(!__pyx_tuple__559)) __PYX_ERR(2, 552, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__559); __Pyx_GIVEREF(__pyx_tuple__559); /* "include/color_dict.pxi":553 * 'plum1' : (255, 187, 255), * 'plum2' : (238, 174, 238), * 'plum3' : (205, 150, 205), # <<<<<<<<<<<<<< * 'plum4' : (139, 102, 139), * 'powderblue' : (176, 224, 230), */ __pyx_tuple__560 = PyTuple_Pack(3, __pyx_int_205, __pyx_int_150, __pyx_int_205); if (unlikely(!__pyx_tuple__560)) __PYX_ERR(2, 553, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__560); __Pyx_GIVEREF(__pyx_tuple__560); /* "include/color_dict.pxi":554 * 'plum2' : (238, 174, 238), * 'plum3' : (205, 150, 205), * 'plum4' : (139, 102, 139), # <<<<<<<<<<<<<< * 'powderblue' : (176, 224, 230), * 'purple' : (160, 32, 240), */ __pyx_tuple__561 = PyTuple_Pack(3, __pyx_int_139, __pyx_int_102, __pyx_int_139); if (unlikely(!__pyx_tuple__561)) __PYX_ERR(2, 554, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__561); __Pyx_GIVEREF(__pyx_tuple__561); /* "include/color_dict.pxi":555 * 'plum3' : (205, 150, 205), * 'plum4' : (139, 102, 139), * 'powderblue' : (176, 224, 230), # <<<<<<<<<<<<<< * 'purple' : (160, 32, 240), * 'purple1' : (155, 48, 255), */ __pyx_tuple__562 = PyTuple_Pack(3, __pyx_int_176, __pyx_int_224, __pyx_int_230); if (unlikely(!__pyx_tuple__562)) __PYX_ERR(2, 555, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__562); __Pyx_GIVEREF(__pyx_tuple__562); /* "include/color_dict.pxi":556 * 'plum4' : (139, 102, 139), * 'powderblue' : (176, 224, 230), * 'purple' : (160, 32, 240), # <<<<<<<<<<<<<< * 'purple1' : (155, 48, 255), * 'purple2' : (145, 44, 238), */ __pyx_tuple__563 = PyTuple_Pack(3, __pyx_int_160, __pyx_int_32, __pyx_int_240); if (unlikely(!__pyx_tuple__563)) __PYX_ERR(2, 556, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__563); __Pyx_GIVEREF(__pyx_tuple__563); /* "include/color_dict.pxi":557 * 'powderblue' : (176, 224, 230), * 'purple' : (160, 32, 240), * 'purple1' : (155, 48, 255), # <<<<<<<<<<<<<< * 'purple2' : (145, 44, 238), * 'purple3' : (125, 38, 205), */ __pyx_tuple__564 = PyTuple_Pack(3, __pyx_int_155, __pyx_int_48, __pyx_int_255); if (unlikely(!__pyx_tuple__564)) __PYX_ERR(2, 557, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__564); __Pyx_GIVEREF(__pyx_tuple__564); /* "include/color_dict.pxi":558 * 'purple' : (160, 32, 240), * 'purple1' : (155, 48, 255), * 'purple2' : (145, 44, 238), # <<<<<<<<<<<<<< * 'purple3' : (125, 38, 205), * 'purple4' : (85, 26, 139), */ __pyx_tuple__565 = PyTuple_Pack(3, __pyx_int_145, __pyx_int_44, __pyx_int_238); if (unlikely(!__pyx_tuple__565)) __PYX_ERR(2, 558, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__565); __Pyx_GIVEREF(__pyx_tuple__565); /* "include/color_dict.pxi":559 * 'purple1' : (155, 48, 255), * 'purple2' : (145, 44, 238), * 'purple3' : (125, 38, 205), # <<<<<<<<<<<<<< * 'purple4' : (85, 26, 139), * 'rebeccapurple' : (102, 51, 153), */ __pyx_tuple__566 = PyTuple_Pack(3, __pyx_int_125, __pyx_int_38, __pyx_int_205); if (unlikely(!__pyx_tuple__566)) __PYX_ERR(2, 559, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__566); __Pyx_GIVEREF(__pyx_tuple__566); /* "include/color_dict.pxi":560 * 'purple2' : (145, 44, 238), * 'purple3' : (125, 38, 205), * 'purple4' : (85, 26, 139), # <<<<<<<<<<<<<< * 'rebeccapurple' : (102, 51, 153), * 'red' : (255, 0, 0), */ __pyx_tuple__567 = PyTuple_Pack(3, __pyx_int_85, __pyx_int_26, __pyx_int_139); if (unlikely(!__pyx_tuple__567)) __PYX_ERR(2, 560, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__567); __Pyx_GIVEREF(__pyx_tuple__567); /* "include/color_dict.pxi":561 * 'purple3' : (125, 38, 205), * 'purple4' : (85, 26, 139), * 'rebeccapurple' : (102, 51, 153), # <<<<<<<<<<<<<< * 'red' : (255, 0, 0), * 'red1' : (255, 0, 0), */ __pyx_tuple__568 = PyTuple_Pack(3, __pyx_int_102, __pyx_int_51, __pyx_int_153); if (unlikely(!__pyx_tuple__568)) __PYX_ERR(2, 561, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__568); __Pyx_GIVEREF(__pyx_tuple__568); /* "include/color_dict.pxi":562 * 'purple4' : (85, 26, 139), * 'rebeccapurple' : (102, 51, 153), * 'red' : (255, 0, 0), # <<<<<<<<<<<<<< * 'red1' : (255, 0, 0), * 'red2' : (238, 0, 0), */ __pyx_tuple__569 = PyTuple_Pack(3, __pyx_int_255, __pyx_int_0, __pyx_int_0); if (unlikely(!__pyx_tuple__569)) __PYX_ERR(2, 562, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__569); __Pyx_GIVEREF(__pyx_tuple__569); /* "include/color_dict.pxi":563 * 'rebeccapurple' : (102, 51, 153), * 'red' : (255, 0, 0), * 'red1' : (255, 0, 0), # <<<<<<<<<<<<<< * 'red2' : (238, 0, 0), * 'red3' : (205, 0, 0), */ __pyx_tuple__570 = PyTuple_Pack(3, __pyx_int_255, __pyx_int_0, __pyx_int_0); if (unlikely(!__pyx_tuple__570)) __PYX_ERR(2, 563, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__570); __Pyx_GIVEREF(__pyx_tuple__570); /* "include/color_dict.pxi":564 * 'red' : (255, 0, 0), * 'red1' : (255, 0, 0), * 'red2' : (238, 0, 0), # <<<<<<<<<<<<<< * 'red3' : (205, 0, 0), * 'red4' : (139, 0, 0), */ __pyx_tuple__571 = PyTuple_Pack(3, __pyx_int_238, __pyx_int_0, __pyx_int_0); if (unlikely(!__pyx_tuple__571)) __PYX_ERR(2, 564, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__571); __Pyx_GIVEREF(__pyx_tuple__571); /* "include/color_dict.pxi":565 * 'red1' : (255, 0, 0), * 'red2' : (238, 0, 0), * 'red3' : (205, 0, 0), # <<<<<<<<<<<<<< * 'red4' : (139, 0, 0), * 'rosybrown' : (188, 143, 143), */ __pyx_tuple__572 = PyTuple_Pack(3, __pyx_int_205, __pyx_int_0, __pyx_int_0); if (unlikely(!__pyx_tuple__572)) __PYX_ERR(2, 565, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__572); __Pyx_GIVEREF(__pyx_tuple__572); /* "include/color_dict.pxi":566 * 'red2' : (238, 0, 0), * 'red3' : (205, 0, 0), * 'red4' : (139, 0, 0), # <<<<<<<<<<<<<< * 'rosybrown' : (188, 143, 143), * 'rosybrown1' : (255, 193, 193), */ __pyx_tuple__573 = PyTuple_Pack(3, __pyx_int_139, __pyx_int_0, __pyx_int_0); if (unlikely(!__pyx_tuple__573)) __PYX_ERR(2, 566, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__573); __Pyx_GIVEREF(__pyx_tuple__573); /* "include/color_dict.pxi":567 * 'red3' : (205, 0, 0), * 'red4' : (139, 0, 0), * 'rosybrown' : (188, 143, 143), # <<<<<<<<<<<<<< * 'rosybrown1' : (255, 193, 193), * 'rosybrown2' : (238, 180, 180), */ __pyx_tuple__574 = PyTuple_Pack(3, __pyx_int_188, __pyx_int_143, __pyx_int_143); if (unlikely(!__pyx_tuple__574)) __PYX_ERR(2, 567, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__574); __Pyx_GIVEREF(__pyx_tuple__574); /* "include/color_dict.pxi":568 * 'red4' : (139, 0, 0), * 'rosybrown' : (188, 143, 143), * 'rosybrown1' : (255, 193, 193), # <<<<<<<<<<<<<< * 'rosybrown2' : (238, 180, 180), * 'rosybrown3' : (205, 155, 155), */ __pyx_tuple__575 = PyTuple_Pack(3, __pyx_int_255, __pyx_int_193, __pyx_int_193); if (unlikely(!__pyx_tuple__575)) __PYX_ERR(2, 568, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__575); __Pyx_GIVEREF(__pyx_tuple__575); /* "include/color_dict.pxi":569 * 'rosybrown' : (188, 143, 143), * 'rosybrown1' : (255, 193, 193), * 'rosybrown2' : (238, 180, 180), # <<<<<<<<<<<<<< * 'rosybrown3' : (205, 155, 155), * 'rosybrown4' : (139, 105, 105), */ __pyx_tuple__576 = PyTuple_Pack(3, __pyx_int_238, __pyx_int_180, __pyx_int_180); if (unlikely(!__pyx_tuple__576)) __PYX_ERR(2, 569, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__576); __Pyx_GIVEREF(__pyx_tuple__576); /* "include/color_dict.pxi":570 * 'rosybrown1' : (255, 193, 193), * 'rosybrown2' : (238, 180, 180), * 'rosybrown3' : (205, 155, 155), # <<<<<<<<<<<<<< * 'rosybrown4' : (139, 105, 105), * 'royalblue' : (65, 105, 225), */ __pyx_tuple__577 = PyTuple_Pack(3, __pyx_int_205, __pyx_int_155, __pyx_int_155); if (unlikely(!__pyx_tuple__577)) __PYX_ERR(2, 570, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__577); __Pyx_GIVEREF(__pyx_tuple__577); /* "include/color_dict.pxi":571 * 'rosybrown2' : (238, 180, 180), * 'rosybrown3' : (205, 155, 155), * 'rosybrown4' : (139, 105, 105), # <<<<<<<<<<<<<< * 'royalblue' : (65, 105, 225), * 'royalblue1' : (72, 118, 255), */ __pyx_tuple__578 = PyTuple_Pack(3, __pyx_int_139, __pyx_int_105, __pyx_int_105); if (unlikely(!__pyx_tuple__578)) __PYX_ERR(2, 571, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__578); __Pyx_GIVEREF(__pyx_tuple__578); /* "include/color_dict.pxi":572 * 'rosybrown3' : (205, 155, 155), * 'rosybrown4' : (139, 105, 105), * 'royalblue' : (65, 105, 225), # <<<<<<<<<<<<<< * 'royalblue1' : (72, 118, 255), * 'royalblue2' : (67, 110, 238), */ __pyx_tuple__579 = PyTuple_Pack(3, __pyx_int_65, __pyx_int_105, __pyx_int_225); if (unlikely(!__pyx_tuple__579)) __PYX_ERR(2, 572, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__579); __Pyx_GIVEREF(__pyx_tuple__579); /* "include/color_dict.pxi":573 * 'rosybrown4' : (139, 105, 105), * 'royalblue' : (65, 105, 225), * 'royalblue1' : (72, 118, 255), # <<<<<<<<<<<<<< * 'royalblue2' : (67, 110, 238), * 'royalblue3' : (58, 95, 205), */ __pyx_tuple__580 = PyTuple_Pack(3, __pyx_int_72, __pyx_int_118, __pyx_int_255); if (unlikely(!__pyx_tuple__580)) __PYX_ERR(2, 573, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__580); __Pyx_GIVEREF(__pyx_tuple__580); /* "include/color_dict.pxi":574 * 'royalblue' : (65, 105, 225), * 'royalblue1' : (72, 118, 255), * 'royalblue2' : (67, 110, 238), # <<<<<<<<<<<<<< * 'royalblue3' : (58, 95, 205), * 'royalblue4' : (39, 64, 139), */ __pyx_tuple__581 = PyTuple_Pack(3, __pyx_int_67, __pyx_int_110, __pyx_int_238); if (unlikely(!__pyx_tuple__581)) __PYX_ERR(2, 574, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__581); __Pyx_GIVEREF(__pyx_tuple__581); /* "include/color_dict.pxi":575 * 'royalblue1' : (72, 118, 255), * 'royalblue2' : (67, 110, 238), * 'royalblue3' : (58, 95, 205), # <<<<<<<<<<<<<< * 'royalblue4' : (39, 64, 139), * 'saddlebrown' : (139, 69, 19), */ __pyx_tuple__582 = PyTuple_Pack(3, __pyx_int_58, __pyx_int_95, __pyx_int_205); if (unlikely(!__pyx_tuple__582)) __PYX_ERR(2, 575, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__582); __Pyx_GIVEREF(__pyx_tuple__582); /* "include/color_dict.pxi":576 * 'royalblue2' : (67, 110, 238), * 'royalblue3' : (58, 95, 205), * 'royalblue4' : (39, 64, 139), # <<<<<<<<<<<<<< * 'saddlebrown' : (139, 69, 19), * 'salmon' : (250, 128, 114), */ __pyx_tuple__583 = PyTuple_Pack(3, __pyx_int_39, __pyx_int_64, __pyx_int_139); if (unlikely(!__pyx_tuple__583)) __PYX_ERR(2, 576, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__583); __Pyx_GIVEREF(__pyx_tuple__583); /* "include/color_dict.pxi":577 * 'royalblue3' : (58, 95, 205), * 'royalblue4' : (39, 64, 139), * 'saddlebrown' : (139, 69, 19), # <<<<<<<<<<<<<< * 'salmon' : (250, 128, 114), * 'salmon1' : (255, 140, 105), */ __pyx_tuple__584 = PyTuple_Pack(3, __pyx_int_139, __pyx_int_69, __pyx_int_19); if (unlikely(!__pyx_tuple__584)) __PYX_ERR(2, 577, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__584); __Pyx_GIVEREF(__pyx_tuple__584); /* "include/color_dict.pxi":578 * 'royalblue4' : (39, 64, 139), * 'saddlebrown' : (139, 69, 19), * 'salmon' : (250, 128, 114), # <<<<<<<<<<<<<< * 'salmon1' : (255, 140, 105), * 'salmon2' : (238, 130, 98), */ __pyx_tuple__585 = PyTuple_Pack(3, __pyx_int_250, __pyx_int_128, __pyx_int_114); if (unlikely(!__pyx_tuple__585)) __PYX_ERR(2, 578, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__585); __Pyx_GIVEREF(__pyx_tuple__585); /* "include/color_dict.pxi":579 * 'saddlebrown' : (139, 69, 19), * 'salmon' : (250, 128, 114), * 'salmon1' : (255, 140, 105), # <<<<<<<<<<<<<< * 'salmon2' : (238, 130, 98), * 'salmon3' : (205, 112, 84), */ __pyx_tuple__586 = PyTuple_Pack(3, __pyx_int_255, __pyx_int_140, __pyx_int_105); if (unlikely(!__pyx_tuple__586)) __PYX_ERR(2, 579, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__586); __Pyx_GIVEREF(__pyx_tuple__586); /* "include/color_dict.pxi":580 * 'salmon' : (250, 128, 114), * 'salmon1' : (255, 140, 105), * 'salmon2' : (238, 130, 98), # <<<<<<<<<<<<<< * 'salmon3' : (205, 112, 84), * 'salmon4' : (139, 76, 57), */ __pyx_tuple__587 = PyTuple_Pack(3, __pyx_int_238, __pyx_int_130, __pyx_int_98); if (unlikely(!__pyx_tuple__587)) __PYX_ERR(2, 580, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__587); __Pyx_GIVEREF(__pyx_tuple__587); /* "include/color_dict.pxi":581 * 'salmon1' : (255, 140, 105), * 'salmon2' : (238, 130, 98), * 'salmon3' : (205, 112, 84), # <<<<<<<<<<<<<< * 'salmon4' : (139, 76, 57), * 'sandybrown' : (244, 164, 96), */ __pyx_tuple__588 = PyTuple_Pack(3, __pyx_int_205, __pyx_int_112, __pyx_int_84); if (unlikely(!__pyx_tuple__588)) __PYX_ERR(2, 581, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__588); __Pyx_GIVEREF(__pyx_tuple__588); /* "include/color_dict.pxi":582 * 'salmon2' : (238, 130, 98), * 'salmon3' : (205, 112, 84), * 'salmon4' : (139, 76, 57), # <<<<<<<<<<<<<< * 'sandybrown' : (244, 164, 96), * 'seagreen' : (46, 139, 87), */ __pyx_tuple__589 = PyTuple_Pack(3, __pyx_int_139, __pyx_int_76, __pyx_int_57); if (unlikely(!__pyx_tuple__589)) __PYX_ERR(2, 582, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__589); __Pyx_GIVEREF(__pyx_tuple__589); /* "include/color_dict.pxi":583 * 'salmon3' : (205, 112, 84), * 'salmon4' : (139, 76, 57), * 'sandybrown' : (244, 164, 96), # <<<<<<<<<<<<<< * 'seagreen' : (46, 139, 87), * 'seagreen1' : (84, 255, 159), */ __pyx_tuple__590 = PyTuple_Pack(3, __pyx_int_244, __pyx_int_164, __pyx_int_96); if (unlikely(!__pyx_tuple__590)) __PYX_ERR(2, 583, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__590); __Pyx_GIVEREF(__pyx_tuple__590); /* "include/color_dict.pxi":584 * 'salmon4' : (139, 76, 57), * 'sandybrown' : (244, 164, 96), * 'seagreen' : (46, 139, 87), # <<<<<<<<<<<<<< * 'seagreen1' : (84, 255, 159), * 'seagreen2' : (78, 238, 148), */ __pyx_tuple__591 = PyTuple_Pack(3, __pyx_int_46, __pyx_int_139, __pyx_int_87); if (unlikely(!__pyx_tuple__591)) __PYX_ERR(2, 584, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__591); __Pyx_GIVEREF(__pyx_tuple__591); /* "include/color_dict.pxi":585 * 'sandybrown' : (244, 164, 96), * 'seagreen' : (46, 139, 87), * 'seagreen1' : (84, 255, 159), # <<<<<<<<<<<<<< * 'seagreen2' : (78, 238, 148), * 'seagreen3' : (67, 205, 128), */ __pyx_tuple__592 = PyTuple_Pack(3, __pyx_int_84, __pyx_int_255, __pyx_int_159); if (unlikely(!__pyx_tuple__592)) __PYX_ERR(2, 585, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__592); __Pyx_GIVEREF(__pyx_tuple__592); /* "include/color_dict.pxi":586 * 'seagreen' : (46, 139, 87), * 'seagreen1' : (84, 255, 159), * 'seagreen2' : (78, 238, 148), # <<<<<<<<<<<<<< * 'seagreen3' : (67, 205, 128), * 'seagreen4' : (46, 139, 87), */ __pyx_tuple__593 = PyTuple_Pack(3, __pyx_int_78, __pyx_int_238, __pyx_int_148); if (unlikely(!__pyx_tuple__593)) __PYX_ERR(2, 586, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__593); __Pyx_GIVEREF(__pyx_tuple__593); /* "include/color_dict.pxi":587 * 'seagreen1' : (84, 255, 159), * 'seagreen2' : (78, 238, 148), * 'seagreen3' : (67, 205, 128), # <<<<<<<<<<<<<< * 'seagreen4' : (46, 139, 87), * 'seashell' : (255, 245, 238), */ __pyx_tuple__594 = PyTuple_Pack(3, __pyx_int_67, __pyx_int_205, __pyx_int_128); if (unlikely(!__pyx_tuple__594)) __PYX_ERR(2, 587, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__594); __Pyx_GIVEREF(__pyx_tuple__594); /* "include/color_dict.pxi":588 * 'seagreen2' : (78, 238, 148), * 'seagreen3' : (67, 205, 128), * 'seagreen4' : (46, 139, 87), # <<<<<<<<<<<<<< * 'seashell' : (255, 245, 238), * 'seashell1' : (255, 245, 238), */ __pyx_tuple__595 = PyTuple_Pack(3, __pyx_int_46, __pyx_int_139, __pyx_int_87); if (unlikely(!__pyx_tuple__595)) __PYX_ERR(2, 588, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__595); __Pyx_GIVEREF(__pyx_tuple__595); /* "include/color_dict.pxi":589 * 'seagreen3' : (67, 205, 128), * 'seagreen4' : (46, 139, 87), * 'seashell' : (255, 245, 238), # <<<<<<<<<<<<<< * 'seashell1' : (255, 245, 238), * 'seashell2' : (238, 229, 222), */ __pyx_tuple__596 = PyTuple_Pack(3, __pyx_int_255, __pyx_int_245, __pyx_int_238); if (unlikely(!__pyx_tuple__596)) __PYX_ERR(2, 589, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__596); __Pyx_GIVEREF(__pyx_tuple__596); /* "include/color_dict.pxi":590 * 'seagreen4' : (46, 139, 87), * 'seashell' : (255, 245, 238), * 'seashell1' : (255, 245, 238), # <<<<<<<<<<<<<< * 'seashell2' : (238, 229, 222), * 'seashell3' : (205, 197, 191), */ __pyx_tuple__597 = PyTuple_Pack(3, __pyx_int_255, __pyx_int_245, __pyx_int_238); if (unlikely(!__pyx_tuple__597)) __PYX_ERR(2, 590, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__597); __Pyx_GIVEREF(__pyx_tuple__597); /* "include/color_dict.pxi":591 * 'seashell' : (255, 245, 238), * 'seashell1' : (255, 245, 238), * 'seashell2' : (238, 229, 222), # <<<<<<<<<<<<<< * 'seashell3' : (205, 197, 191), * 'seashell4' : (139, 134, 130), */ __pyx_tuple__598 = PyTuple_Pack(3, __pyx_int_238, __pyx_int_229, __pyx_int_222); if (unlikely(!__pyx_tuple__598)) __PYX_ERR(2, 591, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__598); __Pyx_GIVEREF(__pyx_tuple__598); /* "include/color_dict.pxi":592 * 'seashell1' : (255, 245, 238), * 'seashell2' : (238, 229, 222), * 'seashell3' : (205, 197, 191), # <<<<<<<<<<<<<< * 'seashell4' : (139, 134, 130), * 'sienna' : (160, 82, 45), */ __pyx_tuple__599 = PyTuple_Pack(3, __pyx_int_205, __pyx_int_197, __pyx_int_191); if (unlikely(!__pyx_tuple__599)) __PYX_ERR(2, 592, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__599); __Pyx_GIVEREF(__pyx_tuple__599); /* "include/color_dict.pxi":593 * 'seashell2' : (238, 229, 222), * 'seashell3' : (205, 197, 191), * 'seashell4' : (139, 134, 130), # <<<<<<<<<<<<<< * 'sienna' : (160, 82, 45), * 'sienna1' : (255, 130, 71), */ __pyx_tuple__600 = PyTuple_Pack(3, __pyx_int_139, __pyx_int_134, __pyx_int_130); if (unlikely(!__pyx_tuple__600)) __PYX_ERR(2, 593, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__600); __Pyx_GIVEREF(__pyx_tuple__600); /* "include/color_dict.pxi":594 * 'seashell3' : (205, 197, 191), * 'seashell4' : (139, 134, 130), * 'sienna' : (160, 82, 45), # <<<<<<<<<<<<<< * 'sienna1' : (255, 130, 71), * 'sienna2' : (238, 121, 66), */ __pyx_tuple__601 = PyTuple_Pack(3, __pyx_int_160, __pyx_int_82, __pyx_int_45); if (unlikely(!__pyx_tuple__601)) __PYX_ERR(2, 594, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__601); __Pyx_GIVEREF(__pyx_tuple__601); /* "include/color_dict.pxi":595 * 'seashell4' : (139, 134, 130), * 'sienna' : (160, 82, 45), * 'sienna1' : (255, 130, 71), # <<<<<<<<<<<<<< * 'sienna2' : (238, 121, 66), * 'sienna3' : (205, 104, 57), */ __pyx_tuple__602 = PyTuple_Pack(3, __pyx_int_255, __pyx_int_130, __pyx_int_71); if (unlikely(!__pyx_tuple__602)) __PYX_ERR(2, 595, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__602); __Pyx_GIVEREF(__pyx_tuple__602); /* "include/color_dict.pxi":596 * 'sienna' : (160, 82, 45), * 'sienna1' : (255, 130, 71), * 'sienna2' : (238, 121, 66), # <<<<<<<<<<<<<< * 'sienna3' : (205, 104, 57), * 'sienna4' : (139, 71, 38), */ __pyx_tuple__603 = PyTuple_Pack(3, __pyx_int_238, __pyx_int_121, __pyx_int_66); if (unlikely(!__pyx_tuple__603)) __PYX_ERR(2, 596, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__603); __Pyx_GIVEREF(__pyx_tuple__603); /* "include/color_dict.pxi":597 * 'sienna1' : (255, 130, 71), * 'sienna2' : (238, 121, 66), * 'sienna3' : (205, 104, 57), # <<<<<<<<<<<<<< * 'sienna4' : (139, 71, 38), * 'silver' : (192, 192, 192), */ __pyx_tuple__604 = PyTuple_Pack(3, __pyx_int_205, __pyx_int_104, __pyx_int_57); if (unlikely(!__pyx_tuple__604)) __PYX_ERR(2, 597, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__604); __Pyx_GIVEREF(__pyx_tuple__604); /* "include/color_dict.pxi":598 * 'sienna2' : (238, 121, 66), * 'sienna3' : (205, 104, 57), * 'sienna4' : (139, 71, 38), # <<<<<<<<<<<<<< * 'silver' : (192, 192, 192), * 'skyblue' : (135, 206, 235), */ __pyx_tuple__605 = PyTuple_Pack(3, __pyx_int_139, __pyx_int_71, __pyx_int_38); if (unlikely(!__pyx_tuple__605)) __PYX_ERR(2, 598, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__605); __Pyx_GIVEREF(__pyx_tuple__605); /* "include/color_dict.pxi":599 * 'sienna3' : (205, 104, 57), * 'sienna4' : (139, 71, 38), * 'silver' : (192, 192, 192), # <<<<<<<<<<<<<< * 'skyblue' : (135, 206, 235), * 'skyblue1' : (135, 206, 255), */ __pyx_tuple__606 = PyTuple_Pack(3, __pyx_int_192, __pyx_int_192, __pyx_int_192); if (unlikely(!__pyx_tuple__606)) __PYX_ERR(2, 599, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__606); __Pyx_GIVEREF(__pyx_tuple__606); /* "include/color_dict.pxi":600 * 'sienna4' : (139, 71, 38), * 'silver' : (192, 192, 192), * 'skyblue' : (135, 206, 235), # <<<<<<<<<<<<<< * 'skyblue1' : (135, 206, 255), * 'skyblue2' : (126, 192, 238), */ __pyx_tuple__607 = PyTuple_Pack(3, __pyx_int_135, __pyx_int_206, __pyx_int_235); if (unlikely(!__pyx_tuple__607)) __PYX_ERR(2, 600, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__607); __Pyx_GIVEREF(__pyx_tuple__607); /* "include/color_dict.pxi":601 * 'silver' : (192, 192, 192), * 'skyblue' : (135, 206, 235), * 'skyblue1' : (135, 206, 255), # <<<<<<<<<<<<<< * 'skyblue2' : (126, 192, 238), * 'skyblue3' : (108, 166, 205), */ __pyx_tuple__608 = PyTuple_Pack(3, __pyx_int_135, __pyx_int_206, __pyx_int_255); if (unlikely(!__pyx_tuple__608)) __PYX_ERR(2, 601, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__608); __Pyx_GIVEREF(__pyx_tuple__608); /* "include/color_dict.pxi":602 * 'skyblue' : (135, 206, 235), * 'skyblue1' : (135, 206, 255), * 'skyblue2' : (126, 192, 238), # <<<<<<<<<<<<<< * 'skyblue3' : (108, 166, 205), * 'skyblue4' : (74, 112, 139), */ __pyx_tuple__609 = PyTuple_Pack(3, __pyx_int_126, __pyx_int_192, __pyx_int_238); if (unlikely(!__pyx_tuple__609)) __PYX_ERR(2, 602, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__609); __Pyx_GIVEREF(__pyx_tuple__609); /* "include/color_dict.pxi":603 * 'skyblue1' : (135, 206, 255), * 'skyblue2' : (126, 192, 238), * 'skyblue3' : (108, 166, 205), # <<<<<<<<<<<<<< * 'skyblue4' : (74, 112, 139), * 'slateblue' : (106, 90, 205), */ __pyx_tuple__610 = PyTuple_Pack(3, __pyx_int_108, __pyx_int_166, __pyx_int_205); if (unlikely(!__pyx_tuple__610)) __PYX_ERR(2, 603, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__610); __Pyx_GIVEREF(__pyx_tuple__610); /* "include/color_dict.pxi":604 * 'skyblue2' : (126, 192, 238), * 'skyblue3' : (108, 166, 205), * 'skyblue4' : (74, 112, 139), # <<<<<<<<<<<<<< * 'slateblue' : (106, 90, 205), * 'slateblue1' : (131, 111, 255), */ __pyx_tuple__611 = PyTuple_Pack(3, __pyx_int_74, __pyx_int_112, __pyx_int_139); if (unlikely(!__pyx_tuple__611)) __PYX_ERR(2, 604, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__611); __Pyx_GIVEREF(__pyx_tuple__611); /* "include/color_dict.pxi":605 * 'skyblue3' : (108, 166, 205), * 'skyblue4' : (74, 112, 139), * 'slateblue' : (106, 90, 205), # <<<<<<<<<<<<<< * 'slateblue1' : (131, 111, 255), * 'slateblue2' : (122, 103, 238), */ __pyx_tuple__612 = PyTuple_Pack(3, __pyx_int_106, __pyx_int_90, __pyx_int_205); if (unlikely(!__pyx_tuple__612)) __PYX_ERR(2, 605, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__612); __Pyx_GIVEREF(__pyx_tuple__612); /* "include/color_dict.pxi":606 * 'skyblue4' : (74, 112, 139), * 'slateblue' : (106, 90, 205), * 'slateblue1' : (131, 111, 255), # <<<<<<<<<<<<<< * 'slateblue2' : (122, 103, 238), * 'slateblue3' : (105, 89, 205), */ __pyx_tuple__613 = PyTuple_Pack(3, __pyx_int_131, __pyx_int_111, __pyx_int_255); if (unlikely(!__pyx_tuple__613)) __PYX_ERR(2, 606, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__613); __Pyx_GIVEREF(__pyx_tuple__613); /* "include/color_dict.pxi":607 * 'slateblue' : (106, 90, 205), * 'slateblue1' : (131, 111, 255), * 'slateblue2' : (122, 103, 238), # <<<<<<<<<<<<<< * 'slateblue3' : (105, 89, 205), * 'slateblue4' : (71, 60, 139), */ __pyx_tuple__614 = PyTuple_Pack(3, __pyx_int_122, __pyx_int_103, __pyx_int_238); if (unlikely(!__pyx_tuple__614)) __PYX_ERR(2, 607, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__614); __Pyx_GIVEREF(__pyx_tuple__614); /* "include/color_dict.pxi":608 * 'slateblue1' : (131, 111, 255), * 'slateblue2' : (122, 103, 238), * 'slateblue3' : (105, 89, 205), # <<<<<<<<<<<<<< * 'slateblue4' : (71, 60, 139), * 'slategray' : (112, 128, 144), */ __pyx_tuple__615 = PyTuple_Pack(3, __pyx_int_105, __pyx_int_89, __pyx_int_205); if (unlikely(!__pyx_tuple__615)) __PYX_ERR(2, 608, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__615); __Pyx_GIVEREF(__pyx_tuple__615); /* "include/color_dict.pxi":609 * 'slateblue2' : (122, 103, 238), * 'slateblue3' : (105, 89, 205), * 'slateblue4' : (71, 60, 139), # <<<<<<<<<<<<<< * 'slategray' : (112, 128, 144), * 'slategray1' : (198, 226, 255), */ __pyx_tuple__616 = PyTuple_Pack(3, __pyx_int_71, __pyx_int_60, __pyx_int_139); if (unlikely(!__pyx_tuple__616)) __PYX_ERR(2, 609, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__616); __Pyx_GIVEREF(__pyx_tuple__616); /* "include/color_dict.pxi":610 * 'slateblue3' : (105, 89, 205), * 'slateblue4' : (71, 60, 139), * 'slategray' : (112, 128, 144), # <<<<<<<<<<<<<< * 'slategray1' : (198, 226, 255), * 'slategray2' : (185, 211, 238), */ __pyx_tuple__617 = PyTuple_Pack(3, __pyx_int_112, __pyx_int_128, __pyx_int_144); if (unlikely(!__pyx_tuple__617)) __PYX_ERR(2, 610, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__617); __Pyx_GIVEREF(__pyx_tuple__617); /* "include/color_dict.pxi":611 * 'slateblue4' : (71, 60, 139), * 'slategray' : (112, 128, 144), * 'slategray1' : (198, 226, 255), # <<<<<<<<<<<<<< * 'slategray2' : (185, 211, 238), * 'slategray3' : (159, 182, 205), */ __pyx_tuple__618 = PyTuple_Pack(3, __pyx_int_198, __pyx_int_226, __pyx_int_255); if (unlikely(!__pyx_tuple__618)) __PYX_ERR(2, 611, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__618); __Pyx_GIVEREF(__pyx_tuple__618); /* "include/color_dict.pxi":612 * 'slategray' : (112, 128, 144), * 'slategray1' : (198, 226, 255), * 'slategray2' : (185, 211, 238), # <<<<<<<<<<<<<< * 'slategray3' : (159, 182, 205), * 'slategray4' : (108, 123, 139), */ __pyx_tuple__619 = PyTuple_Pack(3, __pyx_int_185, __pyx_int_211, __pyx_int_238); if (unlikely(!__pyx_tuple__619)) __PYX_ERR(2, 612, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__619); __Pyx_GIVEREF(__pyx_tuple__619); /* "include/color_dict.pxi":613 * 'slategray1' : (198, 226, 255), * 'slategray2' : (185, 211, 238), * 'slategray3' : (159, 182, 205), # <<<<<<<<<<<<<< * 'slategray4' : (108, 123, 139), * 'slategrey' : (112, 128, 144), */ __pyx_tuple__620 = PyTuple_Pack(3, __pyx_int_159, __pyx_int_182, __pyx_int_205); if (unlikely(!__pyx_tuple__620)) __PYX_ERR(2, 613, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__620); __Pyx_GIVEREF(__pyx_tuple__620); /* "include/color_dict.pxi":614 * 'slategray2' : (185, 211, 238), * 'slategray3' : (159, 182, 205), * 'slategray4' : (108, 123, 139), # <<<<<<<<<<<<<< * 'slategrey' : (112, 128, 144), * 'snow' : (255, 250, 250), */ __pyx_tuple__621 = PyTuple_Pack(3, __pyx_int_108, __pyx_int_123, __pyx_int_139); if (unlikely(!__pyx_tuple__621)) __PYX_ERR(2, 614, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__621); __Pyx_GIVEREF(__pyx_tuple__621); /* "include/color_dict.pxi":615 * 'slategray3' : (159, 182, 205), * 'slategray4' : (108, 123, 139), * 'slategrey' : (112, 128, 144), # <<<<<<<<<<<<<< * 'snow' : (255, 250, 250), * 'snow1' : (255, 250, 250), */ __pyx_tuple__622 = PyTuple_Pack(3, __pyx_int_112, __pyx_int_128, __pyx_int_144); if (unlikely(!__pyx_tuple__622)) __PYX_ERR(2, 615, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__622); __Pyx_GIVEREF(__pyx_tuple__622); /* "include/color_dict.pxi":616 * 'slategray4' : (108, 123, 139), * 'slategrey' : (112, 128, 144), * 'snow' : (255, 250, 250), # <<<<<<<<<<<<<< * 'snow1' : (255, 250, 250), * 'snow2' : (238, 233, 233), */ __pyx_tuple__623 = PyTuple_Pack(3, __pyx_int_255, __pyx_int_250, __pyx_int_250); if (unlikely(!__pyx_tuple__623)) __PYX_ERR(2, 616, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__623); __Pyx_GIVEREF(__pyx_tuple__623); /* "include/color_dict.pxi":617 * 'slategrey' : (112, 128, 144), * 'snow' : (255, 250, 250), * 'snow1' : (255, 250, 250), # <<<<<<<<<<<<<< * 'snow2' : (238, 233, 233), * 'snow3' : (205, 201, 201), */ __pyx_tuple__624 = PyTuple_Pack(3, __pyx_int_255, __pyx_int_250, __pyx_int_250); if (unlikely(!__pyx_tuple__624)) __PYX_ERR(2, 617, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__624); __Pyx_GIVEREF(__pyx_tuple__624); /* "include/color_dict.pxi":618 * 'snow' : (255, 250, 250), * 'snow1' : (255, 250, 250), * 'snow2' : (238, 233, 233), # <<<<<<<<<<<<<< * 'snow3' : (205, 201, 201), * 'snow4' : (139, 137, 137), */ __pyx_tuple__625 = PyTuple_Pack(3, __pyx_int_238, __pyx_int_233, __pyx_int_233); if (unlikely(!__pyx_tuple__625)) __PYX_ERR(2, 618, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__625); __Pyx_GIVEREF(__pyx_tuple__625); /* "include/color_dict.pxi":619 * 'snow1' : (255, 250, 250), * 'snow2' : (238, 233, 233), * 'snow3' : (205, 201, 201), # <<<<<<<<<<<<<< * 'snow4' : (139, 137, 137), * 'springgreen' : (0, 255, 127), */ __pyx_tuple__626 = PyTuple_Pack(3, __pyx_int_205, __pyx_int_201, __pyx_int_201); if (unlikely(!__pyx_tuple__626)) __PYX_ERR(2, 619, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__626); __Pyx_GIVEREF(__pyx_tuple__626); /* "include/color_dict.pxi":620 * 'snow2' : (238, 233, 233), * 'snow3' : (205, 201, 201), * 'snow4' : (139, 137, 137), # <<<<<<<<<<<<<< * 'springgreen' : (0, 255, 127), * 'springgreen1' : (0, 255, 127), */ __pyx_tuple__627 = PyTuple_Pack(3, __pyx_int_139, __pyx_int_137, __pyx_int_137); if (unlikely(!__pyx_tuple__627)) __PYX_ERR(2, 620, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__627); __Pyx_GIVEREF(__pyx_tuple__627); /* "include/color_dict.pxi":621 * 'snow3' : (205, 201, 201), * 'snow4' : (139, 137, 137), * 'springgreen' : (0, 255, 127), # <<<<<<<<<<<<<< * 'springgreen1' : (0, 255, 127), * 'springgreen2' : (0, 238, 118), */ __pyx_tuple__628 = PyTuple_Pack(3, __pyx_int_0, __pyx_int_255, __pyx_int_127); if (unlikely(!__pyx_tuple__628)) __PYX_ERR(2, 621, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__628); __Pyx_GIVEREF(__pyx_tuple__628); /* "include/color_dict.pxi":622 * 'snow4' : (139, 137, 137), * 'springgreen' : (0, 255, 127), * 'springgreen1' : (0, 255, 127), # <<<<<<<<<<<<<< * 'springgreen2' : (0, 238, 118), * 'springgreen3' : (0, 205, 102), */ __pyx_tuple__629 = PyTuple_Pack(3, __pyx_int_0, __pyx_int_255, __pyx_int_127); if (unlikely(!__pyx_tuple__629)) __PYX_ERR(2, 622, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__629); __Pyx_GIVEREF(__pyx_tuple__629); /* "include/color_dict.pxi":623 * 'springgreen' : (0, 255, 127), * 'springgreen1' : (0, 255, 127), * 'springgreen2' : (0, 238, 118), # <<<<<<<<<<<<<< * 'springgreen3' : (0, 205, 102), * 'springgreen4' : (0, 139, 69), */ __pyx_tuple__630 = PyTuple_Pack(3, __pyx_int_0, __pyx_int_238, __pyx_int_118); if (unlikely(!__pyx_tuple__630)) __PYX_ERR(2, 623, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__630); __Pyx_GIVEREF(__pyx_tuple__630); /* "include/color_dict.pxi":624 * 'springgreen1' : (0, 255, 127), * 'springgreen2' : (0, 238, 118), * 'springgreen3' : (0, 205, 102), # <<<<<<<<<<<<<< * 'springgreen4' : (0, 139, 69), * 'steelblue' : (70, 130, 180), */ __pyx_tuple__631 = PyTuple_Pack(3, __pyx_int_0, __pyx_int_205, __pyx_int_102); if (unlikely(!__pyx_tuple__631)) __PYX_ERR(2, 624, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__631); __Pyx_GIVEREF(__pyx_tuple__631); /* "include/color_dict.pxi":625 * 'springgreen2' : (0, 238, 118), * 'springgreen3' : (0, 205, 102), * 'springgreen4' : (0, 139, 69), # <<<<<<<<<<<<<< * 'steelblue' : (70, 130, 180), * 'steelblue1' : (99, 184, 255), */ __pyx_tuple__632 = PyTuple_Pack(3, __pyx_int_0, __pyx_int_139, __pyx_int_69); if (unlikely(!__pyx_tuple__632)) __PYX_ERR(2, 625, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__632); __Pyx_GIVEREF(__pyx_tuple__632); /* "include/color_dict.pxi":626 * 'springgreen3' : (0, 205, 102), * 'springgreen4' : (0, 139, 69), * 'steelblue' : (70, 130, 180), # <<<<<<<<<<<<<< * 'steelblue1' : (99, 184, 255), * 'steelblue2' : (92, 172, 238), */ __pyx_tuple__633 = PyTuple_Pack(3, __pyx_int_70, __pyx_int_130, __pyx_int_180); if (unlikely(!__pyx_tuple__633)) __PYX_ERR(2, 626, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__633); __Pyx_GIVEREF(__pyx_tuple__633); /* "include/color_dict.pxi":627 * 'springgreen4' : (0, 139, 69), * 'steelblue' : (70, 130, 180), * 'steelblue1' : (99, 184, 255), # <<<<<<<<<<<<<< * 'steelblue2' : (92, 172, 238), * 'steelblue3' : (79, 148, 205), */ __pyx_tuple__634 = PyTuple_Pack(3, __pyx_int_99, __pyx_int_184, __pyx_int_255); if (unlikely(!__pyx_tuple__634)) __PYX_ERR(2, 627, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__634); __Pyx_GIVEREF(__pyx_tuple__634); /* "include/color_dict.pxi":628 * 'steelblue' : (70, 130, 180), * 'steelblue1' : (99, 184, 255), * 'steelblue2' : (92, 172, 238), # <<<<<<<<<<<<<< * 'steelblue3' : (79, 148, 205), * 'steelblue4' : (54, 100, 139), */ __pyx_tuple__635 = PyTuple_Pack(3, __pyx_int_92, __pyx_int_172, __pyx_int_238); if (unlikely(!__pyx_tuple__635)) __PYX_ERR(2, 628, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__635); __Pyx_GIVEREF(__pyx_tuple__635); /* "include/color_dict.pxi":629 * 'steelblue1' : (99, 184, 255), * 'steelblue2' : (92, 172, 238), * 'steelblue3' : (79, 148, 205), # <<<<<<<<<<<<<< * 'steelblue4' : (54, 100, 139), * 'tan' : (210, 180, 140), */ __pyx_tuple__636 = PyTuple_Pack(3, __pyx_int_79, __pyx_int_148, __pyx_int_205); if (unlikely(!__pyx_tuple__636)) __PYX_ERR(2, 629, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__636); __Pyx_GIVEREF(__pyx_tuple__636); /* "include/color_dict.pxi":630 * 'steelblue2' : (92, 172, 238), * 'steelblue3' : (79, 148, 205), * 'steelblue4' : (54, 100, 139), # <<<<<<<<<<<<<< * 'tan' : (210, 180, 140), * 'tan1' : (255, 165, 79), */ __pyx_tuple__637 = PyTuple_Pack(3, __pyx_int_54, __pyx_int_100, __pyx_int_139); if (unlikely(!__pyx_tuple__637)) __PYX_ERR(2, 630, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__637); __Pyx_GIVEREF(__pyx_tuple__637); /* "include/color_dict.pxi":631 * 'steelblue3' : (79, 148, 205), * 'steelblue4' : (54, 100, 139), * 'tan' : (210, 180, 140), # <<<<<<<<<<<<<< * 'tan1' : (255, 165, 79), * 'tan2' : (238, 154, 73), */ __pyx_tuple__638 = PyTuple_Pack(3, __pyx_int_210, __pyx_int_180, __pyx_int_140); if (unlikely(!__pyx_tuple__638)) __PYX_ERR(2, 631, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__638); __Pyx_GIVEREF(__pyx_tuple__638); /* "include/color_dict.pxi":632 * 'steelblue4' : (54, 100, 139), * 'tan' : (210, 180, 140), * 'tan1' : (255, 165, 79), # <<<<<<<<<<<<<< * 'tan2' : (238, 154, 73), * 'tan3' : (205, 133, 63), */ __pyx_tuple__639 = PyTuple_Pack(3, __pyx_int_255, __pyx_int_165, __pyx_int_79); if (unlikely(!__pyx_tuple__639)) __PYX_ERR(2, 632, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__639); __Pyx_GIVEREF(__pyx_tuple__639); /* "include/color_dict.pxi":633 * 'tan' : (210, 180, 140), * 'tan1' : (255, 165, 79), * 'tan2' : (238, 154, 73), # <<<<<<<<<<<<<< * 'tan3' : (205, 133, 63), * 'tan4' : (139, 90, 43), */ __pyx_tuple__640 = PyTuple_Pack(3, __pyx_int_238, __pyx_int_154, __pyx_int_73); if (unlikely(!__pyx_tuple__640)) __PYX_ERR(2, 633, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__640); __Pyx_GIVEREF(__pyx_tuple__640); /* "include/color_dict.pxi":634 * 'tan1' : (255, 165, 79), * 'tan2' : (238, 154, 73), * 'tan3' : (205, 133, 63), # <<<<<<<<<<<<<< * 'tan4' : (139, 90, 43), * 'teal' : (0, 128, 128), */ __pyx_tuple__641 = PyTuple_Pack(3, __pyx_int_205, __pyx_int_133, __pyx_int_63); if (unlikely(!__pyx_tuple__641)) __PYX_ERR(2, 634, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__641); __Pyx_GIVEREF(__pyx_tuple__641); /* "include/color_dict.pxi":635 * 'tan2' : (238, 154, 73), * 'tan3' : (205, 133, 63), * 'tan4' : (139, 90, 43), # <<<<<<<<<<<<<< * 'teal' : (0, 128, 128), * 'thistle' : (216, 191, 216), */ __pyx_tuple__642 = PyTuple_Pack(3, __pyx_int_139, __pyx_int_90, __pyx_int_43); if (unlikely(!__pyx_tuple__642)) __PYX_ERR(2, 635, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__642); __Pyx_GIVEREF(__pyx_tuple__642); /* "include/color_dict.pxi":636 * 'tan3' : (205, 133, 63), * 'tan4' : (139, 90, 43), * 'teal' : (0, 128, 128), # <<<<<<<<<<<<<< * 'thistle' : (216, 191, 216), * 'thistle1' : (255, 225, 255), */ __pyx_tuple__643 = PyTuple_Pack(3, __pyx_int_0, __pyx_int_128, __pyx_int_128); if (unlikely(!__pyx_tuple__643)) __PYX_ERR(2, 636, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__643); __Pyx_GIVEREF(__pyx_tuple__643); /* "include/color_dict.pxi":637 * 'tan4' : (139, 90, 43), * 'teal' : (0, 128, 128), * 'thistle' : (216, 191, 216), # <<<<<<<<<<<<<< * 'thistle1' : (255, 225, 255), * 'thistle2' : (238, 210, 238), */ __pyx_tuple__644 = PyTuple_Pack(3, __pyx_int_216, __pyx_int_191, __pyx_int_216); if (unlikely(!__pyx_tuple__644)) __PYX_ERR(2, 637, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__644); __Pyx_GIVEREF(__pyx_tuple__644); /* "include/color_dict.pxi":638 * 'teal' : (0, 128, 128), * 'thistle' : (216, 191, 216), * 'thistle1' : (255, 225, 255), # <<<<<<<<<<<<<< * 'thistle2' : (238, 210, 238), * 'thistle3' : (205, 181, 205), */ __pyx_tuple__645 = PyTuple_Pack(3, __pyx_int_255, __pyx_int_225, __pyx_int_255); if (unlikely(!__pyx_tuple__645)) __PYX_ERR(2, 638, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__645); __Pyx_GIVEREF(__pyx_tuple__645); /* "include/color_dict.pxi":639 * 'thistle' : (216, 191, 216), * 'thistle1' : (255, 225, 255), * 'thistle2' : (238, 210, 238), # <<<<<<<<<<<<<< * 'thistle3' : (205, 181, 205), * 'thistle4' : (139, 123, 139), */ __pyx_tuple__646 = PyTuple_Pack(3, __pyx_int_238, __pyx_int_210, __pyx_int_238); if (unlikely(!__pyx_tuple__646)) __PYX_ERR(2, 639, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__646); __Pyx_GIVEREF(__pyx_tuple__646); /* "include/color_dict.pxi":640 * 'thistle1' : (255, 225, 255), * 'thistle2' : (238, 210, 238), * 'thistle3' : (205, 181, 205), # <<<<<<<<<<<<<< * 'thistle4' : (139, 123, 139), * 'tomato' : (255, 99, 71), */ __pyx_tuple__647 = PyTuple_Pack(3, __pyx_int_205, __pyx_int_181, __pyx_int_205); if (unlikely(!__pyx_tuple__647)) __PYX_ERR(2, 640, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__647); __Pyx_GIVEREF(__pyx_tuple__647); /* "include/color_dict.pxi":641 * 'thistle2' : (238, 210, 238), * 'thistle3' : (205, 181, 205), * 'thistle4' : (139, 123, 139), # <<<<<<<<<<<<<< * 'tomato' : (255, 99, 71), * 'tomato1' : (255, 99, 71), */ __pyx_tuple__648 = PyTuple_Pack(3, __pyx_int_139, __pyx_int_123, __pyx_int_139); if (unlikely(!__pyx_tuple__648)) __PYX_ERR(2, 641, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__648); __Pyx_GIVEREF(__pyx_tuple__648); /* "include/color_dict.pxi":642 * 'thistle3' : (205, 181, 205), * 'thistle4' : (139, 123, 139), * 'tomato' : (255, 99, 71), # <<<<<<<<<<<<<< * 'tomato1' : (255, 99, 71), * 'tomato2' : (238, 92, 66), */ __pyx_tuple__649 = PyTuple_Pack(3, __pyx_int_255, __pyx_int_99, __pyx_int_71); if (unlikely(!__pyx_tuple__649)) __PYX_ERR(2, 642, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__649); __Pyx_GIVEREF(__pyx_tuple__649); /* "include/color_dict.pxi":643 * 'thistle4' : (139, 123, 139), * 'tomato' : (255, 99, 71), * 'tomato1' : (255, 99, 71), # <<<<<<<<<<<<<< * 'tomato2' : (238, 92, 66), * 'tomato3' : (205, 79, 57), */ __pyx_tuple__650 = PyTuple_Pack(3, __pyx_int_255, __pyx_int_99, __pyx_int_71); if (unlikely(!__pyx_tuple__650)) __PYX_ERR(2, 643, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__650); __Pyx_GIVEREF(__pyx_tuple__650); /* "include/color_dict.pxi":644 * 'tomato' : (255, 99, 71), * 'tomato1' : (255, 99, 71), * 'tomato2' : (238, 92, 66), # <<<<<<<<<<<<<< * 'tomato3' : (205, 79, 57), * 'tomato4' : (139, 54, 38), */ __pyx_tuple__651 = PyTuple_Pack(3, __pyx_int_238, __pyx_int_92, __pyx_int_66); if (unlikely(!__pyx_tuple__651)) __PYX_ERR(2, 644, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__651); __Pyx_GIVEREF(__pyx_tuple__651); /* "include/color_dict.pxi":645 * 'tomato1' : (255, 99, 71), * 'tomato2' : (238, 92, 66), * 'tomato3' : (205, 79, 57), # <<<<<<<<<<<<<< * 'tomato4' : (139, 54, 38), * 'turquoise' : (64, 224, 208), */ __pyx_tuple__652 = PyTuple_Pack(3, __pyx_int_205, __pyx_int_79, __pyx_int_57); if (unlikely(!__pyx_tuple__652)) __PYX_ERR(2, 645, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__652); __Pyx_GIVEREF(__pyx_tuple__652); /* "include/color_dict.pxi":646 * 'tomato2' : (238, 92, 66), * 'tomato3' : (205, 79, 57), * 'tomato4' : (139, 54, 38), # <<<<<<<<<<<<<< * 'turquoise' : (64, 224, 208), * 'turquoise1' : (0, 245, 255), */ __pyx_tuple__653 = PyTuple_Pack(3, __pyx_int_139, __pyx_int_54, __pyx_int_38); if (unlikely(!__pyx_tuple__653)) __PYX_ERR(2, 646, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__653); __Pyx_GIVEREF(__pyx_tuple__653); /* "include/color_dict.pxi":647 * 'tomato3' : (205, 79, 57), * 'tomato4' : (139, 54, 38), * 'turquoise' : (64, 224, 208), # <<<<<<<<<<<<<< * 'turquoise1' : (0, 245, 255), * 'turquoise2' : (0, 229, 238), */ __pyx_tuple__654 = PyTuple_Pack(3, __pyx_int_64, __pyx_int_224, __pyx_int_208); if (unlikely(!__pyx_tuple__654)) __PYX_ERR(2, 647, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__654); __Pyx_GIVEREF(__pyx_tuple__654); /* "include/color_dict.pxi":648 * 'tomato4' : (139, 54, 38), * 'turquoise' : (64, 224, 208), * 'turquoise1' : (0, 245, 255), # <<<<<<<<<<<<<< * 'turquoise2' : (0, 229, 238), * 'turquoise3' : (0, 197, 205), */ __pyx_tuple__655 = PyTuple_Pack(3, __pyx_int_0, __pyx_int_245, __pyx_int_255); if (unlikely(!__pyx_tuple__655)) __PYX_ERR(2, 648, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__655); __Pyx_GIVEREF(__pyx_tuple__655); /* "include/color_dict.pxi":649 * 'turquoise' : (64, 224, 208), * 'turquoise1' : (0, 245, 255), * 'turquoise2' : (0, 229, 238), # <<<<<<<<<<<<<< * 'turquoise3' : (0, 197, 205), * 'turquoise4' : (0, 134, 139), */ __pyx_tuple__656 = PyTuple_Pack(3, __pyx_int_0, __pyx_int_229, __pyx_int_238); if (unlikely(!__pyx_tuple__656)) __PYX_ERR(2, 649, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__656); __Pyx_GIVEREF(__pyx_tuple__656); /* "include/color_dict.pxi":650 * 'turquoise1' : (0, 245, 255), * 'turquoise2' : (0, 229, 238), * 'turquoise3' : (0, 197, 205), # <<<<<<<<<<<<<< * 'turquoise4' : (0, 134, 139), * 'violet' : (238, 130, 238), */ __pyx_tuple__657 = PyTuple_Pack(3, __pyx_int_0, __pyx_int_197, __pyx_int_205); if (unlikely(!__pyx_tuple__657)) __PYX_ERR(2, 650, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__657); __Pyx_GIVEREF(__pyx_tuple__657); /* "include/color_dict.pxi":651 * 'turquoise2' : (0, 229, 238), * 'turquoise3' : (0, 197, 205), * 'turquoise4' : (0, 134, 139), # <<<<<<<<<<<<<< * 'violet' : (238, 130, 238), * 'violetred' : (208, 32, 144), */ __pyx_tuple__658 = PyTuple_Pack(3, __pyx_int_0, __pyx_int_134, __pyx_int_139); if (unlikely(!__pyx_tuple__658)) __PYX_ERR(2, 651, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__658); __Pyx_GIVEREF(__pyx_tuple__658); /* "include/color_dict.pxi":652 * 'turquoise3' : (0, 197, 205), * 'turquoise4' : (0, 134, 139), * 'violet' : (238, 130, 238), # <<<<<<<<<<<<<< * 'violetred' : (208, 32, 144), * 'violetred1' : (255, 62, 150), */ __pyx_tuple__659 = PyTuple_Pack(3, __pyx_int_238, __pyx_int_130, __pyx_int_238); if (unlikely(!__pyx_tuple__659)) __PYX_ERR(2, 652, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__659); __Pyx_GIVEREF(__pyx_tuple__659); /* "include/color_dict.pxi":653 * 'turquoise4' : (0, 134, 139), * 'violet' : (238, 130, 238), * 'violetred' : (208, 32, 144), # <<<<<<<<<<<<<< * 'violetred1' : (255, 62, 150), * 'violetred2' : (238, 58, 140), */ __pyx_tuple__660 = PyTuple_Pack(3, __pyx_int_208, __pyx_int_32, __pyx_int_144); if (unlikely(!__pyx_tuple__660)) __PYX_ERR(2, 653, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__660); __Pyx_GIVEREF(__pyx_tuple__660); /* "include/color_dict.pxi":654 * 'violet' : (238, 130, 238), * 'violetred' : (208, 32, 144), * 'violetred1' : (255, 62, 150), # <<<<<<<<<<<<<< * 'violetred2' : (238, 58, 140), * 'violetred3' : (205, 50, 120), */ __pyx_tuple__661 = PyTuple_Pack(3, __pyx_int_255, __pyx_int_62, __pyx_int_150); if (unlikely(!__pyx_tuple__661)) __PYX_ERR(2, 654, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__661); __Pyx_GIVEREF(__pyx_tuple__661); /* "include/color_dict.pxi":655 * 'violetred' : (208, 32, 144), * 'violetred1' : (255, 62, 150), * 'violetred2' : (238, 58, 140), # <<<<<<<<<<<<<< * 'violetred3' : (205, 50, 120), * 'violetred4' : (139, 34, 82), */ __pyx_tuple__662 = PyTuple_Pack(3, __pyx_int_238, __pyx_int_58, __pyx_int_140); if (unlikely(!__pyx_tuple__662)) __PYX_ERR(2, 655, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__662); __Pyx_GIVEREF(__pyx_tuple__662); /* "include/color_dict.pxi":656 * 'violetred1' : (255, 62, 150), * 'violetred2' : (238, 58, 140), * 'violetred3' : (205, 50, 120), # <<<<<<<<<<<<<< * 'violetred4' : (139, 34, 82), * 'webgray' : (128, 128, 128), */ __pyx_tuple__663 = PyTuple_Pack(3, __pyx_int_205, __pyx_int_50, __pyx_int_120); if (unlikely(!__pyx_tuple__663)) __PYX_ERR(2, 656, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__663); __Pyx_GIVEREF(__pyx_tuple__663); /* "include/color_dict.pxi":657 * 'violetred2' : (238, 58, 140), * 'violetred3' : (205, 50, 120), * 'violetred4' : (139, 34, 82), # <<<<<<<<<<<<<< * 'webgray' : (128, 128, 128), * 'webgreen' : (0, 128, 0), */ __pyx_tuple__664 = PyTuple_Pack(3, __pyx_int_139, __pyx_int_34, __pyx_int_82); if (unlikely(!__pyx_tuple__664)) __PYX_ERR(2, 657, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__664); __Pyx_GIVEREF(__pyx_tuple__664); /* "include/color_dict.pxi":658 * 'violetred3' : (205, 50, 120), * 'violetred4' : (139, 34, 82), * 'webgray' : (128, 128, 128), # <<<<<<<<<<<<<< * 'webgreen' : (0, 128, 0), * 'webgrey' : (128, 128, 128), */ __pyx_tuple__665 = PyTuple_Pack(3, __pyx_int_128, __pyx_int_128, __pyx_int_128); if (unlikely(!__pyx_tuple__665)) __PYX_ERR(2, 658, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__665); __Pyx_GIVEREF(__pyx_tuple__665); /* "include/color_dict.pxi":659 * 'violetred4' : (139, 34, 82), * 'webgray' : (128, 128, 128), * 'webgreen' : (0, 128, 0), # <<<<<<<<<<<<<< * 'webgrey' : (128, 128, 128), * 'webmaroon' : (128, 0, 0), */ __pyx_tuple__666 = PyTuple_Pack(3, __pyx_int_0, __pyx_int_128, __pyx_int_0); if (unlikely(!__pyx_tuple__666)) __PYX_ERR(2, 659, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__666); __Pyx_GIVEREF(__pyx_tuple__666); /* "include/color_dict.pxi":660 * 'webgray' : (128, 128, 128), * 'webgreen' : (0, 128, 0), * 'webgrey' : (128, 128, 128), # <<<<<<<<<<<<<< * 'webmaroon' : (128, 0, 0), * 'webpurple' : (128, 0, 128), */ __pyx_tuple__667 = PyTuple_Pack(3, __pyx_int_128, __pyx_int_128, __pyx_int_128); if (unlikely(!__pyx_tuple__667)) __PYX_ERR(2, 660, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__667); __Pyx_GIVEREF(__pyx_tuple__667); /* "include/color_dict.pxi":661 * 'webgreen' : (0, 128, 0), * 'webgrey' : (128, 128, 128), * 'webmaroon' : (128, 0, 0), # <<<<<<<<<<<<<< * 'webpurple' : (128, 0, 128), * 'wheat' : (245, 222, 179), */ __pyx_tuple__668 = PyTuple_Pack(3, __pyx_int_128, __pyx_int_0, __pyx_int_0); if (unlikely(!__pyx_tuple__668)) __PYX_ERR(2, 661, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__668); __Pyx_GIVEREF(__pyx_tuple__668); /* "include/color_dict.pxi":662 * 'webgrey' : (128, 128, 128), * 'webmaroon' : (128, 0, 0), * 'webpurple' : (128, 0, 128), # <<<<<<<<<<<<<< * 'wheat' : (245, 222, 179), * 'wheat1' : (255, 231, 186), */ __pyx_tuple__669 = PyTuple_Pack(3, __pyx_int_128, __pyx_int_0, __pyx_int_128); if (unlikely(!__pyx_tuple__669)) __PYX_ERR(2, 662, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__669); __Pyx_GIVEREF(__pyx_tuple__669); /* "include/color_dict.pxi":663 * 'webmaroon' : (128, 0, 0), * 'webpurple' : (128, 0, 128), * 'wheat' : (245, 222, 179), # <<<<<<<<<<<<<< * 'wheat1' : (255, 231, 186), * 'wheat2' : (238, 216, 174), */ __pyx_tuple__670 = PyTuple_Pack(3, __pyx_int_245, __pyx_int_222, __pyx_int_179); if (unlikely(!__pyx_tuple__670)) __PYX_ERR(2, 663, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__670); __Pyx_GIVEREF(__pyx_tuple__670); /* "include/color_dict.pxi":664 * 'webpurple' : (128, 0, 128), * 'wheat' : (245, 222, 179), * 'wheat1' : (255, 231, 186), # <<<<<<<<<<<<<< * 'wheat2' : (238, 216, 174), * 'wheat3' : (205, 186, 150), */ __pyx_tuple__671 = PyTuple_Pack(3, __pyx_int_255, __pyx_int_231, __pyx_int_186); if (unlikely(!__pyx_tuple__671)) __PYX_ERR(2, 664, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__671); __Pyx_GIVEREF(__pyx_tuple__671); /* "include/color_dict.pxi":665 * 'wheat' : (245, 222, 179), * 'wheat1' : (255, 231, 186), * 'wheat2' : (238, 216, 174), # <<<<<<<<<<<<<< * 'wheat3' : (205, 186, 150), * 'wheat4' : (139, 126, 102), */ __pyx_tuple__672 = PyTuple_Pack(3, __pyx_int_238, __pyx_int_216, __pyx_int_174); if (unlikely(!__pyx_tuple__672)) __PYX_ERR(2, 665, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__672); __Pyx_GIVEREF(__pyx_tuple__672); /* "include/color_dict.pxi":666 * 'wheat1' : (255, 231, 186), * 'wheat2' : (238, 216, 174), * 'wheat3' : (205, 186, 150), # <<<<<<<<<<<<<< * 'wheat4' : (139, 126, 102), * 'white' : (255, 255, 255), */ __pyx_tuple__673 = PyTuple_Pack(3, __pyx_int_205, __pyx_int_186, __pyx_int_150); if (unlikely(!__pyx_tuple__673)) __PYX_ERR(2, 666, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__673); __Pyx_GIVEREF(__pyx_tuple__673); /* "include/color_dict.pxi":667 * 'wheat2' : (238, 216, 174), * 'wheat3' : (205, 186, 150), * 'wheat4' : (139, 126, 102), # <<<<<<<<<<<<<< * 'white' : (255, 255, 255), * 'whitesmoke' : (245, 245, 245), */ __pyx_tuple__674 = PyTuple_Pack(3, __pyx_int_139, __pyx_int_126, __pyx_int_102); if (unlikely(!__pyx_tuple__674)) __PYX_ERR(2, 667, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__674); __Pyx_GIVEREF(__pyx_tuple__674); /* "include/color_dict.pxi":668 * 'wheat3' : (205, 186, 150), * 'wheat4' : (139, 126, 102), * 'white' : (255, 255, 255), # <<<<<<<<<<<<<< * 'whitesmoke' : (245, 245, 245), * 'x11gray' : (190, 190, 190), */ __pyx_tuple__675 = PyTuple_Pack(3, __pyx_int_255, __pyx_int_255, __pyx_int_255); if (unlikely(!__pyx_tuple__675)) __PYX_ERR(2, 668, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__675); __Pyx_GIVEREF(__pyx_tuple__675); /* "include/color_dict.pxi":669 * 'wheat4' : (139, 126, 102), * 'white' : (255, 255, 255), * 'whitesmoke' : (245, 245, 245), # <<<<<<<<<<<<<< * 'x11gray' : (190, 190, 190), * 'x11green' : (0, 255, 0), */ __pyx_tuple__676 = PyTuple_Pack(3, __pyx_int_245, __pyx_int_245, __pyx_int_245); if (unlikely(!__pyx_tuple__676)) __PYX_ERR(2, 669, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__676); __Pyx_GIVEREF(__pyx_tuple__676); /* "include/color_dict.pxi":670 * 'white' : (255, 255, 255), * 'whitesmoke' : (245, 245, 245), * 'x11gray' : (190, 190, 190), # <<<<<<<<<<<<<< * 'x11green' : (0, 255, 0), * 'x11grey' : (190, 190, 190), */ __pyx_tuple__677 = PyTuple_Pack(3, __pyx_int_190, __pyx_int_190, __pyx_int_190); if (unlikely(!__pyx_tuple__677)) __PYX_ERR(2, 670, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__677); __Pyx_GIVEREF(__pyx_tuple__677); /* "include/color_dict.pxi":671 * 'whitesmoke' : (245, 245, 245), * 'x11gray' : (190, 190, 190), * 'x11green' : (0, 255, 0), # <<<<<<<<<<<<<< * 'x11grey' : (190, 190, 190), * 'x11maroon' : (176, 48, 96), */ __pyx_tuple__678 = PyTuple_Pack(3, __pyx_int_0, __pyx_int_255, __pyx_int_0); if (unlikely(!__pyx_tuple__678)) __PYX_ERR(2, 671, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__678); __Pyx_GIVEREF(__pyx_tuple__678); /* "include/color_dict.pxi":672 * 'x11gray' : (190, 190, 190), * 'x11green' : (0, 255, 0), * 'x11grey' : (190, 190, 190), # <<<<<<<<<<<<<< * 'x11maroon' : (176, 48, 96), * 'x11purple' : (160, 32, 240), */ __pyx_tuple__679 = PyTuple_Pack(3, __pyx_int_190, __pyx_int_190, __pyx_int_190); if (unlikely(!__pyx_tuple__679)) __PYX_ERR(2, 672, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__679); __Pyx_GIVEREF(__pyx_tuple__679); /* "include/color_dict.pxi":673 * 'x11green' : (0, 255, 0), * 'x11grey' : (190, 190, 190), * 'x11maroon' : (176, 48, 96), # <<<<<<<<<<<<<< * 'x11purple' : (160, 32, 240), * 'yellow' : (255, 255, 0), */ __pyx_tuple__680 = PyTuple_Pack(3, __pyx_int_176, __pyx_int_48, __pyx_int_96); if (unlikely(!__pyx_tuple__680)) __PYX_ERR(2, 673, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__680); __Pyx_GIVEREF(__pyx_tuple__680); /* "include/color_dict.pxi":674 * 'x11grey' : (190, 190, 190), * 'x11maroon' : (176, 48, 96), * 'x11purple' : (160, 32, 240), # <<<<<<<<<<<<<< * 'yellow' : (255, 255, 0), * 'yellow1' : (255, 255, 0), */ __pyx_tuple__681 = PyTuple_Pack(3, __pyx_int_160, __pyx_int_32, __pyx_int_240); if (unlikely(!__pyx_tuple__681)) __PYX_ERR(2, 674, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__681); __Pyx_GIVEREF(__pyx_tuple__681); /* "include/color_dict.pxi":675 * 'x11maroon' : (176, 48, 96), * 'x11purple' : (160, 32, 240), * 'yellow' : (255, 255, 0), # <<<<<<<<<<<<<< * 'yellow1' : (255, 255, 0), * 'yellow2' : (238, 238, 0), */ __pyx_tuple__682 = PyTuple_Pack(3, __pyx_int_255, __pyx_int_255, __pyx_int_0); if (unlikely(!__pyx_tuple__682)) __PYX_ERR(2, 675, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__682); __Pyx_GIVEREF(__pyx_tuple__682); /* "include/color_dict.pxi":676 * 'x11purple' : (160, 32, 240), * 'yellow' : (255, 255, 0), * 'yellow1' : (255, 255, 0), # <<<<<<<<<<<<<< * 'yellow2' : (238, 238, 0), * 'yellow3' : (205, 205, 0), */ __pyx_tuple__683 = PyTuple_Pack(3, __pyx_int_255, __pyx_int_255, __pyx_int_0); if (unlikely(!__pyx_tuple__683)) __PYX_ERR(2, 676, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__683); __Pyx_GIVEREF(__pyx_tuple__683); /* "include/color_dict.pxi":677 * 'yellow' : (255, 255, 0), * 'yellow1' : (255, 255, 0), * 'yellow2' : (238, 238, 0), # <<<<<<<<<<<<<< * 'yellow3' : (205, 205, 0), * 'yellow4' : (139, 139, 0), */ __pyx_tuple__684 = PyTuple_Pack(3, __pyx_int_238, __pyx_int_238, __pyx_int_0); if (unlikely(!__pyx_tuple__684)) __PYX_ERR(2, 677, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__684); __Pyx_GIVEREF(__pyx_tuple__684); /* "include/color_dict.pxi":678 * 'yellow1' : (255, 255, 0), * 'yellow2' : (238, 238, 0), * 'yellow3' : (205, 205, 0), # <<<<<<<<<<<<<< * 'yellow4' : (139, 139, 0), * 'yellowgreen' : (154, 205, 50), */ __pyx_tuple__685 = PyTuple_Pack(3, __pyx_int_205, __pyx_int_205, __pyx_int_0); if (unlikely(!__pyx_tuple__685)) __PYX_ERR(2, 678, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__685); __Pyx_GIVEREF(__pyx_tuple__685); /* "include/color_dict.pxi":679 * 'yellow2' : (238, 238, 0), * 'yellow3' : (205, 205, 0), * 'yellow4' : (139, 139, 0), # <<<<<<<<<<<<<< * 'yellowgreen' : (154, 205, 50), * } */ __pyx_tuple__686 = PyTuple_Pack(3, __pyx_int_139, __pyx_int_139, __pyx_int_0); if (unlikely(!__pyx_tuple__686)) __PYX_ERR(2, 679, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__686); __Pyx_GIVEREF(__pyx_tuple__686); /* "include/color_dict.pxi":680 * 'yellow3' : (205, 205, 0), * 'yellow4' : (139, 139, 0), * 'yellowgreen' : (154, 205, 50), # <<<<<<<<<<<<<< * } */ __pyx_tuple__687 = PyTuple_Pack(3, __pyx_int_154, __pyx_int_205, __pyx_int_50); if (unlikely(!__pyx_tuple__687)) __PYX_ERR(2, 680, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__687); __Pyx_GIVEREF(__pyx_tuple__687); __Pyx_RefNannyFinishContext(); return 0; __pyx_L1_error:; __Pyx_RefNannyFinishContext(); return -1; } static int __Pyx_InitGlobals(void) { if (__Pyx_InitStrings(__pyx_string_tab) < 0) __PYX_ERR(0, 1, __pyx_L1_error); __pyx_float_255_0 = PyFloat_FromDouble(255.0); if (unlikely(!__pyx_float_255_0)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_float_360_0 = PyFloat_FromDouble(360.0); if (unlikely(!__pyx_float_360_0)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_int_0 = PyInt_FromLong(0); if (unlikely(!__pyx_int_0)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_int_1 = PyInt_FromLong(1); if (unlikely(!__pyx_int_1)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_int_2 = PyInt_FromLong(2); if (unlikely(!__pyx_int_2)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_int_3 = PyInt_FromLong(3); if (unlikely(!__pyx_int_3)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_int_4 = PyInt_FromLong(4); if (unlikely(!__pyx_int_4)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_int_5 = PyInt_FromLong(5); if (unlikely(!__pyx_int_5)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_int_8 = PyInt_FromLong(8); if (unlikely(!__pyx_int_8)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_int_10 = PyInt_FromLong(10); if (unlikely(!__pyx_int_10)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_int_11 = PyInt_FromLong(11); if (unlikely(!__pyx_int_11)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_int_12 = PyInt_FromLong(12); if (unlikely(!__pyx_int_12)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_int_13 = PyInt_FromLong(13); if (unlikely(!__pyx_int_13)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_int_14 = PyInt_FromLong(14); if (unlikely(!__pyx_int_14)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_int_15 = PyInt_FromLong(15); if (unlikely(!__pyx_int_15)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_int_16 = PyInt_FromLong(16); if (unlikely(!__pyx_int_16)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_int_18 = PyInt_FromLong(18); if (unlikely(!__pyx_int_18)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_int_19 = PyInt_FromLong(19); if (unlikely(!__pyx_int_19)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_int_20 = PyInt_FromLong(20); if (unlikely(!__pyx_int_20)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_int_21 = PyInt_FromLong(21); if (unlikely(!__pyx_int_21)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_int_23 = PyInt_FromLong(23); if (unlikely(!__pyx_int_23)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_int_24 = PyInt_FromLong(24); if (unlikely(!__pyx_int_24)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_int_25 = PyInt_FromLong(25); if (unlikely(!__pyx_int_25)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_int_26 = PyInt_FromLong(26); if (unlikely(!__pyx_int_26)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_int_28 = PyInt_FromLong(28); if (unlikely(!__pyx_int_28)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_int_29 = PyInt_FromLong(29); if (unlikely(!__pyx_int_29)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_int_30 = PyInt_FromLong(30); if (unlikely(!__pyx_int_30)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_int_31 = PyInt_FromLong(31); if (unlikely(!__pyx_int_31)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_int_32 = PyInt_FromLong(32); if (unlikely(!__pyx_int_32)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_int_33 = PyInt_FromLong(33); if (unlikely(!__pyx_int_33)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_int_34 = PyInt_FromLong(34); if (unlikely(!__pyx_int_34)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_int_35 = PyInt_FromLong(35); if (unlikely(!__pyx_int_35)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_int_36 = PyInt_FromLong(36); if (unlikely(!__pyx_int_36)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_int_37 = PyInt_FromLong(37); if (unlikely(!__pyx_int_37)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_int_38 = PyInt_FromLong(38); if (unlikely(!__pyx_int_38)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_int_39 = PyInt_FromLong(39); if (unlikely(!__pyx_int_39)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_int_41 = PyInt_FromLong(41); if (unlikely(!__pyx_int_41)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_int_42 = PyInt_FromLong(42); if (unlikely(!__pyx_int_42)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_int_43 = PyInt_FromLong(43); if (unlikely(!__pyx_int_43)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_int_44 = PyInt_FromLong(44); if (unlikely(!__pyx_int_44)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_int_45 = PyInt_FromLong(45); if (unlikely(!__pyx_int_45)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_int_46 = PyInt_FromLong(46); if (unlikely(!__pyx_int_46)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_int_47 = PyInt_FromLong(47); if (unlikely(!__pyx_int_47)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_int_48 = PyInt_FromLong(48); if (unlikely(!__pyx_int_48)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_int_50 = PyInt_FromLong(50); if (unlikely(!__pyx_int_50)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_int_51 = PyInt_FromLong(51); if (unlikely(!__pyx_int_51)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_int_52 = PyInt_FromLong(52); if (unlikely(!__pyx_int_52)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_int_54 = PyInt_FromLong(54); if (unlikely(!__pyx_int_54)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_int_55 = PyInt_FromLong(55); if (unlikely(!__pyx_int_55)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_int_56 = PyInt_FromLong(56); if (unlikely(!__pyx_int_56)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_int_57 = PyInt_FromLong(57); if (unlikely(!__pyx_int_57)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_int_58 = PyInt_FromLong(58); if (unlikely(!__pyx_int_58)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_int_59 = PyInt_FromLong(59); if (unlikely(!__pyx_int_59)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_int_60 = PyInt_FromLong(60); if (unlikely(!__pyx_int_60)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_int_61 = PyInt_FromLong(61); if (unlikely(!__pyx_int_61)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_int_62 = PyInt_FromLong(62); if (unlikely(!__pyx_int_62)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_int_63 = PyInt_FromLong(63); if (unlikely(!__pyx_int_63)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_int_64 = PyInt_FromLong(64); if (unlikely(!__pyx_int_64)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_int_65 = PyInt_FromLong(65); if (unlikely(!__pyx_int_65)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_int_66 = PyInt_FromLong(66); if (unlikely(!__pyx_int_66)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_int_67 = PyInt_FromLong(67); if (unlikely(!__pyx_int_67)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_int_69 = PyInt_FromLong(69); if (unlikely(!__pyx_int_69)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_int_70 = PyInt_FromLong(70); if (unlikely(!__pyx_int_70)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_int_71 = PyInt_FromLong(71); if (unlikely(!__pyx_int_71)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_int_72 = PyInt_FromLong(72); if (unlikely(!__pyx_int_72)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_int_73 = PyInt_FromLong(73); if (unlikely(!__pyx_int_73)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_int_74 = PyInt_FromLong(74); if (unlikely(!__pyx_int_74)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_int_75 = PyInt_FromLong(75); if (unlikely(!__pyx_int_75)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_int_76 = PyInt_FromLong(76); if (unlikely(!__pyx_int_76)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_int_77 = PyInt_FromLong(77); if (unlikely(!__pyx_int_77)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_int_78 = PyInt_FromLong(78); if (unlikely(!__pyx_int_78)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_int_79 = PyInt_FromLong(79); if (unlikely(!__pyx_int_79)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_int_80 = PyInt_FromLong(80); if (unlikely(!__pyx_int_80)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_int_82 = PyInt_FromLong(82); if (unlikely(!__pyx_int_82)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_int_83 = PyInt_FromLong(83); if (unlikely(!__pyx_int_83)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_int_84 = PyInt_FromLong(84); if (unlikely(!__pyx_int_84)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_int_85 = PyInt_FromLong(85); if (unlikely(!__pyx_int_85)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_int_86 = PyInt_FromLong(86); if (unlikely(!__pyx_int_86)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_int_87 = PyInt_FromLong(87); if (unlikely(!__pyx_int_87)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_int_89 = PyInt_FromLong(89); if (unlikely(!__pyx_int_89)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_int_90 = PyInt_FromLong(90); if (unlikely(!__pyx_int_90)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_int_91 = PyInt_FromLong(91); if (unlikely(!__pyx_int_91)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_int_92 = PyInt_FromLong(92); if (unlikely(!__pyx_int_92)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_int_93 = PyInt_FromLong(93); if (unlikely(!__pyx_int_93)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_int_94 = PyInt_FromLong(94); if (unlikely(!__pyx_int_94)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_int_95 = PyInt_FromLong(95); if (unlikely(!__pyx_int_95)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_int_96 = PyInt_FromLong(96); if (unlikely(!__pyx_int_96)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_int_97 = PyInt_FromLong(97); if (unlikely(!__pyx_int_97)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_int_98 = PyInt_FromLong(98); if (unlikely(!__pyx_int_98)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_int_99 = PyInt_FromLong(99); if (unlikely(!__pyx_int_99)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_int_100 = PyInt_FromLong(100); if (unlikely(!__pyx_int_100)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_int_101 = PyInt_FromLong(101); if (unlikely(!__pyx_int_101)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_int_102 = PyInt_FromLong(102); if (unlikely(!__pyx_int_102)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_int_103 = PyInt_FromLong(103); if (unlikely(!__pyx_int_103)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_int_104 = PyInt_FromLong(104); if (unlikely(!__pyx_int_104)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_int_105 = PyInt_FromLong(105); if (unlikely(!__pyx_int_105)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_int_106 = PyInt_FromLong(106); if (unlikely(!__pyx_int_106)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_int_107 = PyInt_FromLong(107); if (unlikely(!__pyx_int_107)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_int_108 = PyInt_FromLong(108); if (unlikely(!__pyx_int_108)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_int_110 = PyInt_FromLong(110); if (unlikely(!__pyx_int_110)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_int_111 = PyInt_FromLong(111); if (unlikely(!__pyx_int_111)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_int_112 = PyInt_FromLong(112); if (unlikely(!__pyx_int_112)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_int_113 = PyInt_FromLong(113); if (unlikely(!__pyx_int_113)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_int_114 = PyInt_FromLong(114); if (unlikely(!__pyx_int_114)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_int_115 = PyInt_FromLong(115); if (unlikely(!__pyx_int_115)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_int_116 = PyInt_FromLong(116); if (unlikely(!__pyx_int_116)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_int_117 = PyInt_FromLong(117); if (unlikely(!__pyx_int_117)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_int_118 = PyInt_FromLong(118); if (unlikely(!__pyx_int_118)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_int_119 = PyInt_FromLong(119); if (unlikely(!__pyx_int_119)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_int_120 = PyInt_FromLong(120); if (unlikely(!__pyx_int_120)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_int_121 = PyInt_FromLong(121); if (unlikely(!__pyx_int_121)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_int_122 = PyInt_FromLong(122); if (unlikely(!__pyx_int_122)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_int_123 = PyInt_FromLong(123); if (unlikely(!__pyx_int_123)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_int_124 = PyInt_FromLong(124); if (unlikely(!__pyx_int_124)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_int_125 = PyInt_FromLong(125); if (unlikely(!__pyx_int_125)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_int_126 = PyInt_FromLong(126); if (unlikely(!__pyx_int_126)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_int_127 = PyInt_FromLong(127); if (unlikely(!__pyx_int_127)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_int_128 = PyInt_FromLong(128); if (unlikely(!__pyx_int_128)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_int_129 = PyInt_FromLong(129); if (unlikely(!__pyx_int_129)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_int_130 = PyInt_FromLong(130); if (unlikely(!__pyx_int_130)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_int_131 = PyInt_FromLong(131); if (unlikely(!__pyx_int_131)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_int_132 = PyInt_FromLong(132); if (unlikely(!__pyx_int_132)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_int_133 = PyInt_FromLong(133); if (unlikely(!__pyx_int_133)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_int_134 = PyInt_FromLong(134); if (unlikely(!__pyx_int_134)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_int_135 = PyInt_FromLong(135); if (unlikely(!__pyx_int_135)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_int_136 = PyInt_FromLong(136); if (unlikely(!__pyx_int_136)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_int_137 = PyInt_FromLong(137); if (unlikely(!__pyx_int_137)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_int_138 = PyInt_FromLong(138); if (unlikely(!__pyx_int_138)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_int_139 = PyInt_FromLong(139); if (unlikely(!__pyx_int_139)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_int_140 = PyInt_FromLong(140); if (unlikely(!__pyx_int_140)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_int_141 = PyInt_FromLong(141); if (unlikely(!__pyx_int_141)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_int_142 = PyInt_FromLong(142); if (unlikely(!__pyx_int_142)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_int_143 = PyInt_FromLong(143); if (unlikely(!__pyx_int_143)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_int_144 = PyInt_FromLong(144); if (unlikely(!__pyx_int_144)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_int_145 = PyInt_FromLong(145); if (unlikely(!__pyx_int_145)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_int_147 = PyInt_FromLong(147); if (unlikely(!__pyx_int_147)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_int_148 = PyInt_FromLong(148); if (unlikely(!__pyx_int_148)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_int_149 = PyInt_FromLong(149); if (unlikely(!__pyx_int_149)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_int_150 = PyInt_FromLong(150); if (unlikely(!__pyx_int_150)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_int_151 = PyInt_FromLong(151); if (unlikely(!__pyx_int_151)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_int_152 = PyInt_FromLong(152); if (unlikely(!__pyx_int_152)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_int_153 = PyInt_FromLong(153); if (unlikely(!__pyx_int_153)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_int_154 = PyInt_FromLong(154); if (unlikely(!__pyx_int_154)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_int_155 = PyInt_FromLong(155); if (unlikely(!__pyx_int_155)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_int_156 = PyInt_FromLong(156); if (unlikely(!__pyx_int_156)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_int_158 = PyInt_FromLong(158); if (unlikely(!__pyx_int_158)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_int_159 = PyInt_FromLong(159); if (unlikely(!__pyx_int_159)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_int_160 = PyInt_FromLong(160); if (unlikely(!__pyx_int_160)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_int_161 = PyInt_FromLong(161); if (unlikely(!__pyx_int_161)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_int_162 = PyInt_FromLong(162); if (unlikely(!__pyx_int_162)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_int_163 = PyInt_FromLong(163); if (unlikely(!__pyx_int_163)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_int_164 = PyInt_FromLong(164); if (unlikely(!__pyx_int_164)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_int_165 = PyInt_FromLong(165); if (unlikely(!__pyx_int_165)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_int_166 = PyInt_FromLong(166); if (unlikely(!__pyx_int_166)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_int_167 = PyInt_FromLong(167); if (unlikely(!__pyx_int_167)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_int_168 = PyInt_FromLong(168); if (unlikely(!__pyx_int_168)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_int_169 = PyInt_FromLong(169); if (unlikely(!__pyx_int_169)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_int_170 = PyInt_FromLong(170); if (unlikely(!__pyx_int_170)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_int_171 = PyInt_FromLong(171); if (unlikely(!__pyx_int_171)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_int_172 = PyInt_FromLong(172); if (unlikely(!__pyx_int_172)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_int_173 = PyInt_FromLong(173); if (unlikely(!__pyx_int_173)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_int_174 = PyInt_FromLong(174); if (unlikely(!__pyx_int_174)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_int_175 = PyInt_FromLong(175); if (unlikely(!__pyx_int_175)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_int_176 = PyInt_FromLong(176); if (unlikely(!__pyx_int_176)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_int_177 = PyInt_FromLong(177); if (unlikely(!__pyx_int_177)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_int_178 = PyInt_FromLong(178); if (unlikely(!__pyx_int_178)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_int_179 = PyInt_FromLong(179); if (unlikely(!__pyx_int_179)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_int_180 = PyInt_FromLong(180); if (unlikely(!__pyx_int_180)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_int_181 = PyInt_FromLong(181); if (unlikely(!__pyx_int_181)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_int_182 = PyInt_FromLong(182); if (unlikely(!__pyx_int_182)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_int_183 = PyInt_FromLong(183); if (unlikely(!__pyx_int_183)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_int_184 = PyInt_FromLong(184); if (unlikely(!__pyx_int_184)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_int_185 = PyInt_FromLong(185); if (unlikely(!__pyx_int_185)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_int_186 = PyInt_FromLong(186); if (unlikely(!__pyx_int_186)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_int_187 = PyInt_FromLong(187); if (unlikely(!__pyx_int_187)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_int_188 = PyInt_FromLong(188); if (unlikely(!__pyx_int_188)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_int_189 = PyInt_FromLong(189); if (unlikely(!__pyx_int_189)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_int_190 = PyInt_FromLong(190); if (unlikely(!__pyx_int_190)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_int_191 = PyInt_FromLong(191); if (unlikely(!__pyx_int_191)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_int_192 = PyInt_FromLong(192); if (unlikely(!__pyx_int_192)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_int_193 = PyInt_FromLong(193); if (unlikely(!__pyx_int_193)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_int_194 = PyInt_FromLong(194); if (unlikely(!__pyx_int_194)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_int_196 = PyInt_FromLong(196); if (unlikely(!__pyx_int_196)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_int_197 = PyInt_FromLong(197); if (unlikely(!__pyx_int_197)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_int_198 = PyInt_FromLong(198); if (unlikely(!__pyx_int_198)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_int_199 = PyInt_FromLong(199); if (unlikely(!__pyx_int_199)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_int_200 = PyInt_FromLong(200); if (unlikely(!__pyx_int_200)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_int_201 = PyInt_FromLong(201); if (unlikely(!__pyx_int_201)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_int_202 = PyInt_FromLong(202); if (unlikely(!__pyx_int_202)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_int_203 = PyInt_FromLong(203); if (unlikely(!__pyx_int_203)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_int_204 = PyInt_FromLong(204); if (unlikely(!__pyx_int_204)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_int_205 = PyInt_FromLong(205); if (unlikely(!__pyx_int_205)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_int_206 = PyInt_FromLong(206); if (unlikely(!__pyx_int_206)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_int_207 = PyInt_FromLong(207); if (unlikely(!__pyx_int_207)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_int_208 = PyInt_FromLong(208); if (unlikely(!__pyx_int_208)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_int_209 = PyInt_FromLong(209); if (unlikely(!__pyx_int_209)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_int_210 = PyInt_FromLong(210); if (unlikely(!__pyx_int_210)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_int_211 = PyInt_FromLong(211); if (unlikely(!__pyx_int_211)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_int_212 = PyInt_FromLong(212); if (unlikely(!__pyx_int_212)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_int_213 = PyInt_FromLong(213); if (unlikely(!__pyx_int_213)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_int_214 = PyInt_FromLong(214); if (unlikely(!__pyx_int_214)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_int_215 = PyInt_FromLong(215); if (unlikely(!__pyx_int_215)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_int_216 = PyInt_FromLong(216); if (unlikely(!__pyx_int_216)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_int_217 = PyInt_FromLong(217); if (unlikely(!__pyx_int_217)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_int_218 = PyInt_FromLong(218); if (unlikely(!__pyx_int_218)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_int_219 = PyInt_FromLong(219); if (unlikely(!__pyx_int_219)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_int_220 = PyInt_FromLong(220); if (unlikely(!__pyx_int_220)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_int_221 = PyInt_FromLong(221); if (unlikely(!__pyx_int_221)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_int_222 = PyInt_FromLong(222); if (unlikely(!__pyx_int_222)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_int_223 = PyInt_FromLong(223); if (unlikely(!__pyx_int_223)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_int_224 = PyInt_FromLong(224); if (unlikely(!__pyx_int_224)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_int_225 = PyInt_FromLong(225); if (unlikely(!__pyx_int_225)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_int_226 = PyInt_FromLong(226); if (unlikely(!__pyx_int_226)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_int_227 = PyInt_FromLong(227); if (unlikely(!__pyx_int_227)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_int_228 = PyInt_FromLong(228); if (unlikely(!__pyx_int_228)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_int_229 = PyInt_FromLong(229); if (unlikely(!__pyx_int_229)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_int_230 = PyInt_FromLong(230); if (unlikely(!__pyx_int_230)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_int_231 = PyInt_FromLong(231); if (unlikely(!__pyx_int_231)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_int_232 = PyInt_FromLong(232); if (unlikely(!__pyx_int_232)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_int_233 = PyInt_FromLong(233); if (unlikely(!__pyx_int_233)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_int_235 = PyInt_FromLong(235); if (unlikely(!__pyx_int_235)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_int_236 = PyInt_FromLong(236); if (unlikely(!__pyx_int_236)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_int_237 = PyInt_FromLong(237); if (unlikely(!__pyx_int_237)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_int_238 = PyInt_FromLong(238); if (unlikely(!__pyx_int_238)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_int_239 = PyInt_FromLong(239); if (unlikely(!__pyx_int_239)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_int_240 = PyInt_FromLong(240); if (unlikely(!__pyx_int_240)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_int_242 = PyInt_FromLong(242); if (unlikely(!__pyx_int_242)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_int_244 = PyInt_FromLong(244); if (unlikely(!__pyx_int_244)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_int_245 = PyInt_FromLong(245); if (unlikely(!__pyx_int_245)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_int_246 = PyInt_FromLong(246); if (unlikely(!__pyx_int_246)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_int_247 = PyInt_FromLong(247); if (unlikely(!__pyx_int_247)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_int_248 = PyInt_FromLong(248); if (unlikely(!__pyx_int_248)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_int_250 = PyInt_FromLong(250); if (unlikely(!__pyx_int_250)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_int_251 = PyInt_FromLong(251); if (unlikely(!__pyx_int_251)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_int_252 = PyInt_FromLong(252); if (unlikely(!__pyx_int_252)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_int_253 = PyInt_FromLong(253); if (unlikely(!__pyx_int_253)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_int_255 = PyInt_FromLong(255); if (unlikely(!__pyx_int_255)) __PYX_ERR(0, 1, __pyx_L1_error) return 0; __pyx_L1_error:; return -1; } #if PY_MAJOR_VERSION < 3 PyMODINIT_FUNC initcolor(void); /*proto*/ PyMODINIT_FUNC initcolor(void) #else PyMODINIT_FUNC PyInit_color(void); /*proto*/ PyMODINIT_FUNC PyInit_color(void) #endif { PyObject *__pyx_t_1 = NULL; __Pyx_RefNannyDeclarations #if CYTHON_REFNANNY __Pyx_RefNanny = __Pyx_RefNannyImportAPI("refnanny"); if (!__Pyx_RefNanny) { PyErr_Clear(); __Pyx_RefNanny = __Pyx_RefNannyImportAPI("Cython.Runtime.refnanny"); if (!__Pyx_RefNanny) Py_FatalError("failed to import 'refnanny' module"); } #endif __Pyx_RefNannySetupContext("PyMODINIT_FUNC PyInit_color(void)", 0); if (__Pyx_check_binary_version() < 0) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_empty_tuple = PyTuple_New(0); if (unlikely(!__pyx_empty_tuple)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_empty_bytes = PyBytes_FromStringAndSize("", 0); if (unlikely(!__pyx_empty_bytes)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_empty_unicode = PyUnicode_FromStringAndSize("", 0); if (unlikely(!__pyx_empty_unicode)) __PYX_ERR(0, 1, __pyx_L1_error) #ifdef __Pyx_CyFunction_USED if (__pyx_CyFunction_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error) #endif #ifdef __Pyx_FusedFunction_USED if (__pyx_FusedFunction_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error) #endif #ifdef __Pyx_Coroutine_USED if (__pyx_Coroutine_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error) #endif #ifdef __Pyx_Generator_USED if (__pyx_Generator_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error) #endif #ifdef __Pyx_StopAsyncIteration_USED if (__pyx_StopAsyncIteration_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error) #endif /*--- Library function declarations ---*/ /*--- Threads initialization code ---*/ #if defined(__PYX_FORCE_INIT_THREADS) && __PYX_FORCE_INIT_THREADS #ifdef WITH_THREAD /* Python build with threading support? */ PyEval_InitThreads(); #endif #endif /*--- Module creation code ---*/ #if PY_MAJOR_VERSION < 3 __pyx_m = Py_InitModule4("color", __pyx_methods, 0, 0, PYTHON_API_VERSION); Py_XINCREF(__pyx_m); #else __pyx_m = PyModule_Create(&__pyx_moduledef); #endif if (unlikely(!__pyx_m)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_d = PyModule_GetDict(__pyx_m); if (unlikely(!__pyx_d)) __PYX_ERR(0, 1, __pyx_L1_error) Py_INCREF(__pyx_d); __pyx_b = PyImport_AddModule(__Pyx_BUILTIN_MODULE_NAME); if (unlikely(!__pyx_b)) __PYX_ERR(0, 1, __pyx_L1_error) #if CYTHON_COMPILING_IN_PYPY Py_INCREF(__pyx_b); #endif if (PyObject_SetAttrString(__pyx_m, "__builtins__", __pyx_b) < 0) __PYX_ERR(0, 1, __pyx_L1_error); /*--- Initialize various global constants etc. ---*/ if (__Pyx_InitGlobals() < 0) __PYX_ERR(0, 1, __pyx_L1_error) #if PY_MAJOR_VERSION < 3 && (__PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT) if (__Pyx_init_sys_getdefaultencoding_params() < 0) __PYX_ERR(0, 1, __pyx_L1_error) #endif if (__pyx_module_is_main_pygame_sdl2__color) { if (PyObject_SetAttrString(__pyx_m, "__name__", __pyx_n_s_main) < 0) __PYX_ERR(0, 1, __pyx_L1_error) } #if PY_MAJOR_VERSION >= 3 { PyObject *modules = PyImport_GetModuleDict(); if (unlikely(!modules)) __PYX_ERR(0, 1, __pyx_L1_error) if (!PyDict_GetItemString(modules, "pygame_sdl2.color")) { if (unlikely(PyDict_SetItemString(modules, "pygame_sdl2.color", __pyx_m) < 0)) __PYX_ERR(0, 1, __pyx_L1_error) } } #endif /*--- Builtin init code ---*/ if (__Pyx_InitCachedBuiltins() < 0) __PYX_ERR(0, 1, __pyx_L1_error) /*--- Constants init code ---*/ if (__Pyx_InitCachedConstants() < 0) __PYX_ERR(0, 1, __pyx_L1_error) /*--- Global init code ---*/ __pyx_v_11pygame_sdl2_5color_colors = Py_None; Py_INCREF(Py_None); /*--- Variable export code ---*/ /*--- Function export code ---*/ if (__Pyx_ExportFunction("map_color", (void (*)(void))__pyx_f_11pygame_sdl2_5color_map_color, "Uint32 (SDL_Surface *, PyObject *)") < 0) __PYX_ERR(0, 1, __pyx_L1_error) if (__Pyx_ExportFunction("get_color", (void (*)(void))__pyx_f_11pygame_sdl2_5color_get_color, "PyObject *(Uint32, SDL_Surface *)") < 0) __PYX_ERR(0, 1, __pyx_L1_error) if (__Pyx_ExportFunction("to_sdl_color", (void (*)(void))__pyx_f_11pygame_sdl2_5color_to_sdl_color, "PyObject *(PyObject *, SDL_Color *)") < 0) __PYX_ERR(0, 1, __pyx_L1_error) /*--- Type init code ---*/ __pyx_vtabptr_11pygame_sdl2_5color_Color = &__pyx_vtable_11pygame_sdl2_5color_Color; __pyx_vtable_11pygame_sdl2_5color_Color.from_rgba = (PyObject *(*)(struct __pyx_obj_11pygame_sdl2_5color_Color *, Uint8, Uint8, Uint8, Uint8))__pyx_f_11pygame_sdl2_5color_5Color_from_rgba; __pyx_vtable_11pygame_sdl2_5color_Color.from_name = (PyObject *(*)(struct __pyx_obj_11pygame_sdl2_5color_Color *, PyObject *))__pyx_f_11pygame_sdl2_5color_5Color_from_name; __pyx_vtable_11pygame_sdl2_5color_Color.from_hex = (PyObject *(*)(struct __pyx_obj_11pygame_sdl2_5color_Color *, PyObject *))__pyx_f_11pygame_sdl2_5color_5Color_from_hex; if (PyType_Ready(&__pyx_type_11pygame_sdl2_5color_Color) < 0) __PYX_ERR(0, 63, __pyx_L1_error) __pyx_type_11pygame_sdl2_5color_Color.tp_print = 0; if (__Pyx_SetVtable(__pyx_type_11pygame_sdl2_5color_Color.tp_dict, __pyx_vtabptr_11pygame_sdl2_5color_Color) < 0) __PYX_ERR(0, 63, __pyx_L1_error) if (PyObject_SetAttrString(__pyx_m, "Color", (PyObject *)&__pyx_type_11pygame_sdl2_5color_Color) < 0) __PYX_ERR(0, 63, __pyx_L1_error) if (__pyx_type_11pygame_sdl2_5color_Color.tp_weaklistoffset == 0) __pyx_type_11pygame_sdl2_5color_Color.tp_weaklistoffset = offsetof(struct __pyx_obj_11pygame_sdl2_5color_Color, __weakref__); __pyx_ptype_11pygame_sdl2_5color_Color = &__pyx_type_11pygame_sdl2_5color_Color; if (PyType_Ready(&__pyx_type_11pygame_sdl2_5color___pyx_scope_struct__correct_gamma) < 0) __PYX_ERR(0, 452, __pyx_L1_error) __pyx_type_11pygame_sdl2_5color___pyx_scope_struct__correct_gamma.tp_print = 0; __pyx_ptype_11pygame_sdl2_5color___pyx_scope_struct__correct_gamma = &__pyx_type_11pygame_sdl2_5color___pyx_scope_struct__correct_gamma; /*--- Type import code ---*/ /*--- Variable import code ---*/ /*--- Function import code ---*/ /*--- Execution code ---*/ #if defined(__Pyx_Generator_USED) || defined(__Pyx_Coroutine_USED) if (__Pyx_patch_abc() < 0) __PYX_ERR(0, 1, __pyx_L1_error) #endif /* "pygame_sdl2/color.pyx":21 * * from sdl2 cimport * * import binascii # <<<<<<<<<<<<<< * import struct * */ __pyx_t_1 = __Pyx_Import(__pyx_n_s_binascii, 0, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 21, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (PyDict_SetItem(__pyx_d, __pyx_n_s_binascii, __pyx_t_1) < 0) __PYX_ERR(0, 21, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "pygame_sdl2/color.pyx":22 * from sdl2 cimport * * import binascii * import struct # <<<<<<<<<<<<<< * * include "color_dict.pxi" */ __pyx_t_1 = __Pyx_Import(__pyx_n_s_struct, 0, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 22, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (PyDict_SetItem(__pyx_d, __pyx_n_s_struct, __pyx_t_1) < 0) __PYX_ERR(0, 22, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "include/color_dict.pxi":5 * * cdef object colors = { * 'aliceblue' : (240, 248, 255), # <<<<<<<<<<<<<< * 'antiquewhite' : (250, 235, 215), * 'antiquewhite1' : (255, 239, 219), */ __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 5, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (PyDict_SetItem(__pyx_t_1, __pyx_n_u_aliceblue, __pyx_tuple__12) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":6 * cdef object colors = { * 'aliceblue' : (240, 248, 255), * 'antiquewhite' : (250, 235, 215), # <<<<<<<<<<<<<< * 'antiquewhite1' : (255, 239, 219), * 'antiquewhite2' : (238, 223, 204), */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_u_antiquewhite, __pyx_tuple__13) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":7 * 'aliceblue' : (240, 248, 255), * 'antiquewhite' : (250, 235, 215), * 'antiquewhite1' : (255, 239, 219), # <<<<<<<<<<<<<< * 'antiquewhite2' : (238, 223, 204), * 'antiquewhite3' : (205, 192, 176), */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_u_antiquewhite1, __pyx_tuple__14) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":8 * 'antiquewhite' : (250, 235, 215), * 'antiquewhite1' : (255, 239, 219), * 'antiquewhite2' : (238, 223, 204), # <<<<<<<<<<<<<< * 'antiquewhite3' : (205, 192, 176), * 'antiquewhite4' : (139, 131, 120), */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_u_antiquewhite2, __pyx_tuple__15) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":9 * 'antiquewhite1' : (255, 239, 219), * 'antiquewhite2' : (238, 223, 204), * 'antiquewhite3' : (205, 192, 176), # <<<<<<<<<<<<<< * 'antiquewhite4' : (139, 131, 120), * 'aqua' : (0, 255, 255), */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_u_antiquewhite3, __pyx_tuple__16) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":10 * 'antiquewhite2' : (238, 223, 204), * 'antiquewhite3' : (205, 192, 176), * 'antiquewhite4' : (139, 131, 120), # <<<<<<<<<<<<<< * 'aqua' : (0, 255, 255), * 'aquamarine' : (127, 255, 212), */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_u_antiquewhite4, __pyx_tuple__17) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":11 * 'antiquewhite3' : (205, 192, 176), * 'antiquewhite4' : (139, 131, 120), * 'aqua' : (0, 255, 255), # <<<<<<<<<<<<<< * 'aquamarine' : (127, 255, 212), * 'aquamarine1' : (127, 255, 212), */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_u_aqua, __pyx_tuple__18) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":12 * 'antiquewhite4' : (139, 131, 120), * 'aqua' : (0, 255, 255), * 'aquamarine' : (127, 255, 212), # <<<<<<<<<<<<<< * 'aquamarine1' : (127, 255, 212), * 'aquamarine2' : (118, 238, 198), */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_u_aquamarine, __pyx_tuple__19) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":13 * 'aqua' : (0, 255, 255), * 'aquamarine' : (127, 255, 212), * 'aquamarine1' : (127, 255, 212), # <<<<<<<<<<<<<< * 'aquamarine2' : (118, 238, 198), * 'aquamarine3' : (102, 205, 170), */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_u_aquamarine1, __pyx_tuple__20) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":14 * 'aquamarine' : (127, 255, 212), * 'aquamarine1' : (127, 255, 212), * 'aquamarine2' : (118, 238, 198), # <<<<<<<<<<<<<< * 'aquamarine3' : (102, 205, 170), * 'aquamarine4' : (69, 139, 116), */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_u_aquamarine2, __pyx_tuple__21) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":15 * 'aquamarine1' : (127, 255, 212), * 'aquamarine2' : (118, 238, 198), * 'aquamarine3' : (102, 205, 170), # <<<<<<<<<<<<<< * 'aquamarine4' : (69, 139, 116), * 'azure' : (240, 255, 255), */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_u_aquamarine3, __pyx_tuple__22) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":16 * 'aquamarine2' : (118, 238, 198), * 'aquamarine3' : (102, 205, 170), * 'aquamarine4' : (69, 139, 116), # <<<<<<<<<<<<<< * 'azure' : (240, 255, 255), * 'azure1' : (240, 255, 255), */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_u_aquamarine4, __pyx_tuple__23) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":17 * 'aquamarine3' : (102, 205, 170), * 'aquamarine4' : (69, 139, 116), * 'azure' : (240, 255, 255), # <<<<<<<<<<<<<< * 'azure1' : (240, 255, 255), * 'azure2' : (224, 238, 238), */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_u_azure, __pyx_tuple__24) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":18 * 'aquamarine4' : (69, 139, 116), * 'azure' : (240, 255, 255), * 'azure1' : (240, 255, 255), # <<<<<<<<<<<<<< * 'azure2' : (224, 238, 238), * 'azure3' : (193, 205, 205), */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_u_azure1, __pyx_tuple__25) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":19 * 'azure' : (240, 255, 255), * 'azure1' : (240, 255, 255), * 'azure2' : (224, 238, 238), # <<<<<<<<<<<<<< * 'azure3' : (193, 205, 205), * 'azure4' : (131, 139, 139), */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_u_azure2, __pyx_tuple__26) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":20 * 'azure1' : (240, 255, 255), * 'azure2' : (224, 238, 238), * 'azure3' : (193, 205, 205), # <<<<<<<<<<<<<< * 'azure4' : (131, 139, 139), * 'beige' : (245, 245, 220), */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_u_azure3, __pyx_tuple__27) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":21 * 'azure2' : (224, 238, 238), * 'azure3' : (193, 205, 205), * 'azure4' : (131, 139, 139), # <<<<<<<<<<<<<< * 'beige' : (245, 245, 220), * 'bisque' : (255, 228, 196), */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_u_azure4, __pyx_tuple__28) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":22 * 'azure3' : (193, 205, 205), * 'azure4' : (131, 139, 139), * 'beige' : (245, 245, 220), # <<<<<<<<<<<<<< * 'bisque' : (255, 228, 196), * 'bisque1' : (255, 228, 196), */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_u_beige, __pyx_tuple__29) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":23 * 'azure4' : (131, 139, 139), * 'beige' : (245, 245, 220), * 'bisque' : (255, 228, 196), # <<<<<<<<<<<<<< * 'bisque1' : (255, 228, 196), * 'bisque2' : (238, 213, 183), */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_u_bisque, __pyx_tuple__30) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":24 * 'beige' : (245, 245, 220), * 'bisque' : (255, 228, 196), * 'bisque1' : (255, 228, 196), # <<<<<<<<<<<<<< * 'bisque2' : (238, 213, 183), * 'bisque3' : (205, 183, 158), */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_u_bisque1, __pyx_tuple__31) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":25 * 'bisque' : (255, 228, 196), * 'bisque1' : (255, 228, 196), * 'bisque2' : (238, 213, 183), # <<<<<<<<<<<<<< * 'bisque3' : (205, 183, 158), * 'bisque4' : (139, 125, 107), */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_u_bisque2, __pyx_tuple__32) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":26 * 'bisque1' : (255, 228, 196), * 'bisque2' : (238, 213, 183), * 'bisque3' : (205, 183, 158), # <<<<<<<<<<<<<< * 'bisque4' : (139, 125, 107), * 'black' : (0, 0, 0), */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_u_bisque3, __pyx_tuple__33) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":27 * 'bisque2' : (238, 213, 183), * 'bisque3' : (205, 183, 158), * 'bisque4' : (139, 125, 107), # <<<<<<<<<<<<<< * 'black' : (0, 0, 0), * 'blanchedalmond' : (255, 235, 205), */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_u_bisque4, __pyx_tuple__34) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":28 * 'bisque3' : (205, 183, 158), * 'bisque4' : (139, 125, 107), * 'black' : (0, 0, 0), # <<<<<<<<<<<<<< * 'blanchedalmond' : (255, 235, 205), * 'blue' : (0, 0, 255), */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_u_black, __pyx_tuple__35) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":29 * 'bisque4' : (139, 125, 107), * 'black' : (0, 0, 0), * 'blanchedalmond' : (255, 235, 205), # <<<<<<<<<<<<<< * 'blue' : (0, 0, 255), * 'blue1' : (0, 0, 255), */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_u_blanchedalmond, __pyx_tuple__36) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":30 * 'black' : (0, 0, 0), * 'blanchedalmond' : (255, 235, 205), * 'blue' : (0, 0, 255), # <<<<<<<<<<<<<< * 'blue1' : (0, 0, 255), * 'blue2' : (0, 0, 238), */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_u_blue, __pyx_tuple__37) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":31 * 'blanchedalmond' : (255, 235, 205), * 'blue' : (0, 0, 255), * 'blue1' : (0, 0, 255), # <<<<<<<<<<<<<< * 'blue2' : (0, 0, 238), * 'blue3' : (0, 0, 205), */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_u_blue1, __pyx_tuple__38) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":32 * 'blue' : (0, 0, 255), * 'blue1' : (0, 0, 255), * 'blue2' : (0, 0, 238), # <<<<<<<<<<<<<< * 'blue3' : (0, 0, 205), * 'blue4' : (0, 0, 139), */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_u_blue2, __pyx_tuple__39) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":33 * 'blue1' : (0, 0, 255), * 'blue2' : (0, 0, 238), * 'blue3' : (0, 0, 205), # <<<<<<<<<<<<<< * 'blue4' : (0, 0, 139), * 'blueviolet' : (138, 43, 226), */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_u_blue3, __pyx_tuple__40) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":34 * 'blue2' : (0, 0, 238), * 'blue3' : (0, 0, 205), * 'blue4' : (0, 0, 139), # <<<<<<<<<<<<<< * 'blueviolet' : (138, 43, 226), * 'brown' : (165, 42, 42), */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_u_blue4, __pyx_tuple__41) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":35 * 'blue3' : (0, 0, 205), * 'blue4' : (0, 0, 139), * 'blueviolet' : (138, 43, 226), # <<<<<<<<<<<<<< * 'brown' : (165, 42, 42), * 'brown1' : (255, 64, 64), */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_u_blueviolet, __pyx_tuple__42) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":36 * 'blue4' : (0, 0, 139), * 'blueviolet' : (138, 43, 226), * 'brown' : (165, 42, 42), # <<<<<<<<<<<<<< * 'brown1' : (255, 64, 64), * 'brown2' : (238, 59, 59), */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_u_brown, __pyx_tuple__43) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":37 * 'blueviolet' : (138, 43, 226), * 'brown' : (165, 42, 42), * 'brown1' : (255, 64, 64), # <<<<<<<<<<<<<< * 'brown2' : (238, 59, 59), * 'brown3' : (205, 51, 51), */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_u_brown1, __pyx_tuple__44) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":38 * 'brown' : (165, 42, 42), * 'brown1' : (255, 64, 64), * 'brown2' : (238, 59, 59), # <<<<<<<<<<<<<< * 'brown3' : (205, 51, 51), * 'brown4' : (139, 35, 35), */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_u_brown2, __pyx_tuple__45) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":39 * 'brown1' : (255, 64, 64), * 'brown2' : (238, 59, 59), * 'brown3' : (205, 51, 51), # <<<<<<<<<<<<<< * 'brown4' : (139, 35, 35), * 'burlywood' : (222, 184, 135), */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_u_brown3, __pyx_tuple__46) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":40 * 'brown2' : (238, 59, 59), * 'brown3' : (205, 51, 51), * 'brown4' : (139, 35, 35), # <<<<<<<<<<<<<< * 'burlywood' : (222, 184, 135), * 'burlywood1' : (255, 211, 155), */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_u_brown4, __pyx_tuple__47) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":41 * 'brown3' : (205, 51, 51), * 'brown4' : (139, 35, 35), * 'burlywood' : (222, 184, 135), # <<<<<<<<<<<<<< * 'burlywood1' : (255, 211, 155), * 'burlywood2' : (238, 197, 145), */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_u_burlywood, __pyx_tuple__48) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":42 * 'brown4' : (139, 35, 35), * 'burlywood' : (222, 184, 135), * 'burlywood1' : (255, 211, 155), # <<<<<<<<<<<<<< * 'burlywood2' : (238, 197, 145), * 'burlywood3' : (205, 170, 125), */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_u_burlywood1, __pyx_tuple__49) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":43 * 'burlywood' : (222, 184, 135), * 'burlywood1' : (255, 211, 155), * 'burlywood2' : (238, 197, 145), # <<<<<<<<<<<<<< * 'burlywood3' : (205, 170, 125), * 'burlywood4' : (139, 115, 85), */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_u_burlywood2, __pyx_tuple__50) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":44 * 'burlywood1' : (255, 211, 155), * 'burlywood2' : (238, 197, 145), * 'burlywood3' : (205, 170, 125), # <<<<<<<<<<<<<< * 'burlywood4' : (139, 115, 85), * 'cadetblue' : (95, 158, 160), */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_u_burlywood3, __pyx_tuple__51) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":45 * 'burlywood2' : (238, 197, 145), * 'burlywood3' : (205, 170, 125), * 'burlywood4' : (139, 115, 85), # <<<<<<<<<<<<<< * 'cadetblue' : (95, 158, 160), * 'cadetblue1' : (152, 245, 255), */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_u_burlywood4, __pyx_tuple__52) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":46 * 'burlywood3' : (205, 170, 125), * 'burlywood4' : (139, 115, 85), * 'cadetblue' : (95, 158, 160), # <<<<<<<<<<<<<< * 'cadetblue1' : (152, 245, 255), * 'cadetblue2' : (142, 229, 238), */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_u_cadetblue, __pyx_tuple__53) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":47 * 'burlywood4' : (139, 115, 85), * 'cadetblue' : (95, 158, 160), * 'cadetblue1' : (152, 245, 255), # <<<<<<<<<<<<<< * 'cadetblue2' : (142, 229, 238), * 'cadetblue3' : (122, 197, 205), */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_u_cadetblue1, __pyx_tuple__54) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":48 * 'cadetblue' : (95, 158, 160), * 'cadetblue1' : (152, 245, 255), * 'cadetblue2' : (142, 229, 238), # <<<<<<<<<<<<<< * 'cadetblue3' : (122, 197, 205), * 'cadetblue4' : (83, 134, 139), */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_u_cadetblue2, __pyx_tuple__55) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":49 * 'cadetblue1' : (152, 245, 255), * 'cadetblue2' : (142, 229, 238), * 'cadetblue3' : (122, 197, 205), # <<<<<<<<<<<<<< * 'cadetblue4' : (83, 134, 139), * 'chartreuse' : (127, 255, 0), */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_u_cadetblue3, __pyx_tuple__56) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":50 * 'cadetblue2' : (142, 229, 238), * 'cadetblue3' : (122, 197, 205), * 'cadetblue4' : (83, 134, 139), # <<<<<<<<<<<<<< * 'chartreuse' : (127, 255, 0), * 'chartreuse1' : (127, 255, 0), */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_u_cadetblue4, __pyx_tuple__57) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":51 * 'cadetblue3' : (122, 197, 205), * 'cadetblue4' : (83, 134, 139), * 'chartreuse' : (127, 255, 0), # <<<<<<<<<<<<<< * 'chartreuse1' : (127, 255, 0), * 'chartreuse2' : (118, 238, 0), */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_u_chartreuse, __pyx_tuple__58) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":52 * 'cadetblue4' : (83, 134, 139), * 'chartreuse' : (127, 255, 0), * 'chartreuse1' : (127, 255, 0), # <<<<<<<<<<<<<< * 'chartreuse2' : (118, 238, 0), * 'chartreuse3' : (102, 205, 0), */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_u_chartreuse1, __pyx_tuple__59) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":53 * 'chartreuse' : (127, 255, 0), * 'chartreuse1' : (127, 255, 0), * 'chartreuse2' : (118, 238, 0), # <<<<<<<<<<<<<< * 'chartreuse3' : (102, 205, 0), * 'chartreuse4' : (69, 139, 0), */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_u_chartreuse2, __pyx_tuple__60) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":54 * 'chartreuse1' : (127, 255, 0), * 'chartreuse2' : (118, 238, 0), * 'chartreuse3' : (102, 205, 0), # <<<<<<<<<<<<<< * 'chartreuse4' : (69, 139, 0), * 'chocolate' : (210, 105, 30), */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_u_chartreuse3, __pyx_tuple__61) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":55 * 'chartreuse2' : (118, 238, 0), * 'chartreuse3' : (102, 205, 0), * 'chartreuse4' : (69, 139, 0), # <<<<<<<<<<<<<< * 'chocolate' : (210, 105, 30), * 'chocolate1' : (255, 127, 36), */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_u_chartreuse4, __pyx_tuple__62) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":56 * 'chartreuse3' : (102, 205, 0), * 'chartreuse4' : (69, 139, 0), * 'chocolate' : (210, 105, 30), # <<<<<<<<<<<<<< * 'chocolate1' : (255, 127, 36), * 'chocolate2' : (238, 118, 33), */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_u_chocolate, __pyx_tuple__63) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":57 * 'chartreuse4' : (69, 139, 0), * 'chocolate' : (210, 105, 30), * 'chocolate1' : (255, 127, 36), # <<<<<<<<<<<<<< * 'chocolate2' : (238, 118, 33), * 'chocolate3' : (205, 102, 29), */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_u_chocolate1, __pyx_tuple__64) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":58 * 'chocolate' : (210, 105, 30), * 'chocolate1' : (255, 127, 36), * 'chocolate2' : (238, 118, 33), # <<<<<<<<<<<<<< * 'chocolate3' : (205, 102, 29), * 'chocolate4' : (139, 69, 19), */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_u_chocolate2, __pyx_tuple__65) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":59 * 'chocolate1' : (255, 127, 36), * 'chocolate2' : (238, 118, 33), * 'chocolate3' : (205, 102, 29), # <<<<<<<<<<<<<< * 'chocolate4' : (139, 69, 19), * 'coral' : (255, 127, 80), */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_u_chocolate3, __pyx_tuple__66) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":60 * 'chocolate2' : (238, 118, 33), * 'chocolate3' : (205, 102, 29), * 'chocolate4' : (139, 69, 19), # <<<<<<<<<<<<<< * 'coral' : (255, 127, 80), * 'coral1' : (255, 114, 86), */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_u_chocolate4, __pyx_tuple__67) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":61 * 'chocolate3' : (205, 102, 29), * 'chocolate4' : (139, 69, 19), * 'coral' : (255, 127, 80), # <<<<<<<<<<<<<< * 'coral1' : (255, 114, 86), * 'coral2' : (238, 106, 80), */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_u_coral, __pyx_tuple__68) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":62 * 'chocolate4' : (139, 69, 19), * 'coral' : (255, 127, 80), * 'coral1' : (255, 114, 86), # <<<<<<<<<<<<<< * 'coral2' : (238, 106, 80), * 'coral3' : (205, 91, 69), */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_u_coral1, __pyx_tuple__69) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":63 * 'coral' : (255, 127, 80), * 'coral1' : (255, 114, 86), * 'coral2' : (238, 106, 80), # <<<<<<<<<<<<<< * 'coral3' : (205, 91, 69), * 'coral4' : (139, 62, 47), */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_u_coral2, __pyx_tuple__70) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":64 * 'coral1' : (255, 114, 86), * 'coral2' : (238, 106, 80), * 'coral3' : (205, 91, 69), # <<<<<<<<<<<<<< * 'coral4' : (139, 62, 47), * 'cornflowerblue' : (100, 149, 237), */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_u_coral3, __pyx_tuple__71) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":65 * 'coral2' : (238, 106, 80), * 'coral3' : (205, 91, 69), * 'coral4' : (139, 62, 47), # <<<<<<<<<<<<<< * 'cornflowerblue' : (100, 149, 237), * 'cornsilk' : (255, 248, 220), */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_u_coral4, __pyx_tuple__72) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":66 * 'coral3' : (205, 91, 69), * 'coral4' : (139, 62, 47), * 'cornflowerblue' : (100, 149, 237), # <<<<<<<<<<<<<< * 'cornsilk' : (255, 248, 220), * 'cornsilk1' : (255, 248, 220), */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_u_cornflowerblue, __pyx_tuple__73) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":67 * 'coral4' : (139, 62, 47), * 'cornflowerblue' : (100, 149, 237), * 'cornsilk' : (255, 248, 220), # <<<<<<<<<<<<<< * 'cornsilk1' : (255, 248, 220), * 'cornsilk2' : (238, 232, 205), */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_u_cornsilk, __pyx_tuple__74) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":68 * 'cornflowerblue' : (100, 149, 237), * 'cornsilk' : (255, 248, 220), * 'cornsilk1' : (255, 248, 220), # <<<<<<<<<<<<<< * 'cornsilk2' : (238, 232, 205), * 'cornsilk3' : (205, 200, 177), */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_u_cornsilk1, __pyx_tuple__75) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":69 * 'cornsilk' : (255, 248, 220), * 'cornsilk1' : (255, 248, 220), * 'cornsilk2' : (238, 232, 205), # <<<<<<<<<<<<<< * 'cornsilk3' : (205, 200, 177), * 'cornsilk4' : (139, 136, 120), */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_u_cornsilk2, __pyx_tuple__76) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":70 * 'cornsilk1' : (255, 248, 220), * 'cornsilk2' : (238, 232, 205), * 'cornsilk3' : (205, 200, 177), # <<<<<<<<<<<<<< * 'cornsilk4' : (139, 136, 120), * 'crimson' : (220, 20, 60), */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_u_cornsilk3, __pyx_tuple__77) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":71 * 'cornsilk2' : (238, 232, 205), * 'cornsilk3' : (205, 200, 177), * 'cornsilk4' : (139, 136, 120), # <<<<<<<<<<<<<< * 'crimson' : (220, 20, 60), * 'cyan' : (0, 255, 255), */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_u_cornsilk4, __pyx_tuple__78) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":72 * 'cornsilk3' : (205, 200, 177), * 'cornsilk4' : (139, 136, 120), * 'crimson' : (220, 20, 60), # <<<<<<<<<<<<<< * 'cyan' : (0, 255, 255), * 'cyan1' : (0, 255, 255), */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_u_crimson, __pyx_tuple__79) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":73 * 'cornsilk4' : (139, 136, 120), * 'crimson' : (220, 20, 60), * 'cyan' : (0, 255, 255), # <<<<<<<<<<<<<< * 'cyan1' : (0, 255, 255), * 'cyan2' : (0, 238, 238), */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_u_cyan, __pyx_tuple__80) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":74 * 'crimson' : (220, 20, 60), * 'cyan' : (0, 255, 255), * 'cyan1' : (0, 255, 255), # <<<<<<<<<<<<<< * 'cyan2' : (0, 238, 238), * 'cyan3' : (0, 205, 205), */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_u_cyan1, __pyx_tuple__81) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":75 * 'cyan' : (0, 255, 255), * 'cyan1' : (0, 255, 255), * 'cyan2' : (0, 238, 238), # <<<<<<<<<<<<<< * 'cyan3' : (0, 205, 205), * 'cyan4' : (0, 139, 139), */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_u_cyan2, __pyx_tuple__82) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":76 * 'cyan1' : (0, 255, 255), * 'cyan2' : (0, 238, 238), * 'cyan3' : (0, 205, 205), # <<<<<<<<<<<<<< * 'cyan4' : (0, 139, 139), * 'darkblue' : (0, 0, 139), */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_u_cyan3, __pyx_tuple__83) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":77 * 'cyan2' : (0, 238, 238), * 'cyan3' : (0, 205, 205), * 'cyan4' : (0, 139, 139), # <<<<<<<<<<<<<< * 'darkblue' : (0, 0, 139), * 'darkcyan' : (0, 139, 139), */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_u_cyan4, __pyx_tuple__84) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":78 * 'cyan3' : (0, 205, 205), * 'cyan4' : (0, 139, 139), * 'darkblue' : (0, 0, 139), # <<<<<<<<<<<<<< * 'darkcyan' : (0, 139, 139), * 'darkgoldenrod' : (184, 134, 11), */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_u_darkblue, __pyx_tuple__85) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":79 * 'cyan4' : (0, 139, 139), * 'darkblue' : (0, 0, 139), * 'darkcyan' : (0, 139, 139), # <<<<<<<<<<<<<< * 'darkgoldenrod' : (184, 134, 11), * 'darkgoldenrod1' : (255, 185, 15), */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_u_darkcyan, __pyx_tuple__86) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":80 * 'darkblue' : (0, 0, 139), * 'darkcyan' : (0, 139, 139), * 'darkgoldenrod' : (184, 134, 11), # <<<<<<<<<<<<<< * 'darkgoldenrod1' : (255, 185, 15), * 'darkgoldenrod2' : (238, 173, 14), */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_u_darkgoldenrod, __pyx_tuple__87) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":81 * 'darkcyan' : (0, 139, 139), * 'darkgoldenrod' : (184, 134, 11), * 'darkgoldenrod1' : (255, 185, 15), # <<<<<<<<<<<<<< * 'darkgoldenrod2' : (238, 173, 14), * 'darkgoldenrod3' : (205, 149, 12), */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_u_darkgoldenrod1, __pyx_tuple__88) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":82 * 'darkgoldenrod' : (184, 134, 11), * 'darkgoldenrod1' : (255, 185, 15), * 'darkgoldenrod2' : (238, 173, 14), # <<<<<<<<<<<<<< * 'darkgoldenrod3' : (205, 149, 12), * 'darkgoldenrod4' : (139, 101, 8), */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_u_darkgoldenrod2, __pyx_tuple__89) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":83 * 'darkgoldenrod1' : (255, 185, 15), * 'darkgoldenrod2' : (238, 173, 14), * 'darkgoldenrod3' : (205, 149, 12), # <<<<<<<<<<<<<< * 'darkgoldenrod4' : (139, 101, 8), * 'darkgray' : (169, 169, 169), */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_u_darkgoldenrod3, __pyx_tuple__90) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":84 * 'darkgoldenrod2' : (238, 173, 14), * 'darkgoldenrod3' : (205, 149, 12), * 'darkgoldenrod4' : (139, 101, 8), # <<<<<<<<<<<<<< * 'darkgray' : (169, 169, 169), * 'darkgreen' : (0, 100, 0), */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_u_darkgoldenrod4, __pyx_tuple__91) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":85 * 'darkgoldenrod3' : (205, 149, 12), * 'darkgoldenrod4' : (139, 101, 8), * 'darkgray' : (169, 169, 169), # <<<<<<<<<<<<<< * 'darkgreen' : (0, 100, 0), * 'darkgrey' : (169, 169, 169), */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_u_darkgray, __pyx_tuple__92) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":86 * 'darkgoldenrod4' : (139, 101, 8), * 'darkgray' : (169, 169, 169), * 'darkgreen' : (0, 100, 0), # <<<<<<<<<<<<<< * 'darkgrey' : (169, 169, 169), * 'darkkhaki' : (189, 183, 107), */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_u_darkgreen, __pyx_tuple__93) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":87 * 'darkgray' : (169, 169, 169), * 'darkgreen' : (0, 100, 0), * 'darkgrey' : (169, 169, 169), # <<<<<<<<<<<<<< * 'darkkhaki' : (189, 183, 107), * 'darkmagenta' : (139, 0, 139), */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_u_darkgrey, __pyx_tuple__94) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":88 * 'darkgreen' : (0, 100, 0), * 'darkgrey' : (169, 169, 169), * 'darkkhaki' : (189, 183, 107), # <<<<<<<<<<<<<< * 'darkmagenta' : (139, 0, 139), * 'darkolivegreen' : (85, 107, 47), */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_u_darkkhaki, __pyx_tuple__95) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":89 * 'darkgrey' : (169, 169, 169), * 'darkkhaki' : (189, 183, 107), * 'darkmagenta' : (139, 0, 139), # <<<<<<<<<<<<<< * 'darkolivegreen' : (85, 107, 47), * 'darkolivegreen1' : (202, 255, 112), */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_u_darkmagenta, __pyx_tuple__96) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":90 * 'darkkhaki' : (189, 183, 107), * 'darkmagenta' : (139, 0, 139), * 'darkolivegreen' : (85, 107, 47), # <<<<<<<<<<<<<< * 'darkolivegreen1' : (202, 255, 112), * 'darkolivegreen2' : (188, 238, 104), */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_u_darkolivegreen, __pyx_tuple__97) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":91 * 'darkmagenta' : (139, 0, 139), * 'darkolivegreen' : (85, 107, 47), * 'darkolivegreen1' : (202, 255, 112), # <<<<<<<<<<<<<< * 'darkolivegreen2' : (188, 238, 104), * 'darkolivegreen3' : (162, 205, 90), */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_u_darkolivegreen1, __pyx_tuple__98) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":92 * 'darkolivegreen' : (85, 107, 47), * 'darkolivegreen1' : (202, 255, 112), * 'darkolivegreen2' : (188, 238, 104), # <<<<<<<<<<<<<< * 'darkolivegreen3' : (162, 205, 90), * 'darkolivegreen4' : (110, 139, 61), */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_u_darkolivegreen2, __pyx_tuple__99) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":93 * 'darkolivegreen1' : (202, 255, 112), * 'darkolivegreen2' : (188, 238, 104), * 'darkolivegreen3' : (162, 205, 90), # <<<<<<<<<<<<<< * 'darkolivegreen4' : (110, 139, 61), * 'darkorange' : (255, 140, 0), */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_u_darkolivegreen3, __pyx_tuple__100) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":94 * 'darkolivegreen2' : (188, 238, 104), * 'darkolivegreen3' : (162, 205, 90), * 'darkolivegreen4' : (110, 139, 61), # <<<<<<<<<<<<<< * 'darkorange' : (255, 140, 0), * 'darkorange1' : (255, 127, 0), */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_u_darkolivegreen4, __pyx_tuple__101) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":95 * 'darkolivegreen3' : (162, 205, 90), * 'darkolivegreen4' : (110, 139, 61), * 'darkorange' : (255, 140, 0), # <<<<<<<<<<<<<< * 'darkorange1' : (255, 127, 0), * 'darkorange2' : (238, 118, 0), */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_u_darkorange, __pyx_tuple__102) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":96 * 'darkolivegreen4' : (110, 139, 61), * 'darkorange' : (255, 140, 0), * 'darkorange1' : (255, 127, 0), # <<<<<<<<<<<<<< * 'darkorange2' : (238, 118, 0), * 'darkorange3' : (205, 102, 0), */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_u_darkorange1, __pyx_tuple__103) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":97 * 'darkorange' : (255, 140, 0), * 'darkorange1' : (255, 127, 0), * 'darkorange2' : (238, 118, 0), # <<<<<<<<<<<<<< * 'darkorange3' : (205, 102, 0), * 'darkorange4' : (139, 69, 0), */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_u_darkorange2, __pyx_tuple__104) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":98 * 'darkorange1' : (255, 127, 0), * 'darkorange2' : (238, 118, 0), * 'darkorange3' : (205, 102, 0), # <<<<<<<<<<<<<< * 'darkorange4' : (139, 69, 0), * 'darkorchid' : (153, 50, 204), */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_u_darkorange3, __pyx_tuple__105) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":99 * 'darkorange2' : (238, 118, 0), * 'darkorange3' : (205, 102, 0), * 'darkorange4' : (139, 69, 0), # <<<<<<<<<<<<<< * 'darkorchid' : (153, 50, 204), * 'darkorchid1' : (191, 62, 255), */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_u_darkorange4, __pyx_tuple__106) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":100 * 'darkorange3' : (205, 102, 0), * 'darkorange4' : (139, 69, 0), * 'darkorchid' : (153, 50, 204), # <<<<<<<<<<<<<< * 'darkorchid1' : (191, 62, 255), * 'darkorchid2' : (178, 58, 238), */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_u_darkorchid, __pyx_tuple__107) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":101 * 'darkorange4' : (139, 69, 0), * 'darkorchid' : (153, 50, 204), * 'darkorchid1' : (191, 62, 255), # <<<<<<<<<<<<<< * 'darkorchid2' : (178, 58, 238), * 'darkorchid3' : (154, 50, 205), */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_u_darkorchid1, __pyx_tuple__108) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":102 * 'darkorchid' : (153, 50, 204), * 'darkorchid1' : (191, 62, 255), * 'darkorchid2' : (178, 58, 238), # <<<<<<<<<<<<<< * 'darkorchid3' : (154, 50, 205), * 'darkorchid4' : (104, 34, 139), */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_u_darkorchid2, __pyx_tuple__109) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":103 * 'darkorchid1' : (191, 62, 255), * 'darkorchid2' : (178, 58, 238), * 'darkorchid3' : (154, 50, 205), # <<<<<<<<<<<<<< * 'darkorchid4' : (104, 34, 139), * 'darkred' : (139, 0, 0), */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_u_darkorchid3, __pyx_tuple__110) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":104 * 'darkorchid2' : (178, 58, 238), * 'darkorchid3' : (154, 50, 205), * 'darkorchid4' : (104, 34, 139), # <<<<<<<<<<<<<< * 'darkred' : (139, 0, 0), * 'darksalmon' : (233, 150, 122), */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_u_darkorchid4, __pyx_tuple__111) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":105 * 'darkorchid3' : (154, 50, 205), * 'darkorchid4' : (104, 34, 139), * 'darkred' : (139, 0, 0), # <<<<<<<<<<<<<< * 'darksalmon' : (233, 150, 122), * 'darkseagreen' : (143, 188, 143), */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_u_darkred, __pyx_tuple__112) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":106 * 'darkorchid4' : (104, 34, 139), * 'darkred' : (139, 0, 0), * 'darksalmon' : (233, 150, 122), # <<<<<<<<<<<<<< * 'darkseagreen' : (143, 188, 143), * 'darkseagreen1' : (193, 255, 193), */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_u_darksalmon, __pyx_tuple__113) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":107 * 'darkred' : (139, 0, 0), * 'darksalmon' : (233, 150, 122), * 'darkseagreen' : (143, 188, 143), # <<<<<<<<<<<<<< * 'darkseagreen1' : (193, 255, 193), * 'darkseagreen2' : (180, 238, 180), */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_u_darkseagreen, __pyx_tuple__114) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":108 * 'darksalmon' : (233, 150, 122), * 'darkseagreen' : (143, 188, 143), * 'darkseagreen1' : (193, 255, 193), # <<<<<<<<<<<<<< * 'darkseagreen2' : (180, 238, 180), * 'darkseagreen3' : (155, 205, 155), */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_u_darkseagreen1, __pyx_tuple__115) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":109 * 'darkseagreen' : (143, 188, 143), * 'darkseagreen1' : (193, 255, 193), * 'darkseagreen2' : (180, 238, 180), # <<<<<<<<<<<<<< * 'darkseagreen3' : (155, 205, 155), * 'darkseagreen4' : (105, 139, 105), */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_u_darkseagreen2, __pyx_tuple__116) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":110 * 'darkseagreen1' : (193, 255, 193), * 'darkseagreen2' : (180, 238, 180), * 'darkseagreen3' : (155, 205, 155), # <<<<<<<<<<<<<< * 'darkseagreen4' : (105, 139, 105), * 'darkslateblue' : (72, 61, 139), */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_u_darkseagreen3, __pyx_tuple__117) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":111 * 'darkseagreen2' : (180, 238, 180), * 'darkseagreen3' : (155, 205, 155), * 'darkseagreen4' : (105, 139, 105), # <<<<<<<<<<<<<< * 'darkslateblue' : (72, 61, 139), * 'darkslategray' : (47, 79, 79), */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_u_darkseagreen4, __pyx_tuple__118) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":112 * 'darkseagreen3' : (155, 205, 155), * 'darkseagreen4' : (105, 139, 105), * 'darkslateblue' : (72, 61, 139), # <<<<<<<<<<<<<< * 'darkslategray' : (47, 79, 79), * 'darkslategray1' : (151, 255, 255), */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_u_darkslateblue, __pyx_tuple__119) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":113 * 'darkseagreen4' : (105, 139, 105), * 'darkslateblue' : (72, 61, 139), * 'darkslategray' : (47, 79, 79), # <<<<<<<<<<<<<< * 'darkslategray1' : (151, 255, 255), * 'darkslategray2' : (141, 238, 238), */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_u_darkslategray, __pyx_tuple__120) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":114 * 'darkslateblue' : (72, 61, 139), * 'darkslategray' : (47, 79, 79), * 'darkslategray1' : (151, 255, 255), # <<<<<<<<<<<<<< * 'darkslategray2' : (141, 238, 238), * 'darkslategray3' : (121, 205, 205), */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_u_darkslategray1, __pyx_tuple__121) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":115 * 'darkslategray' : (47, 79, 79), * 'darkslategray1' : (151, 255, 255), * 'darkslategray2' : (141, 238, 238), # <<<<<<<<<<<<<< * 'darkslategray3' : (121, 205, 205), * 'darkslategray4' : (82, 139, 139), */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_u_darkslategray2, __pyx_tuple__122) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":116 * 'darkslategray1' : (151, 255, 255), * 'darkslategray2' : (141, 238, 238), * 'darkslategray3' : (121, 205, 205), # <<<<<<<<<<<<<< * 'darkslategray4' : (82, 139, 139), * 'darkslategrey' : (47, 79, 79), */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_u_darkslategray3, __pyx_tuple__123) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":117 * 'darkslategray2' : (141, 238, 238), * 'darkslategray3' : (121, 205, 205), * 'darkslategray4' : (82, 139, 139), # <<<<<<<<<<<<<< * 'darkslategrey' : (47, 79, 79), * 'darkturquoise' : (0, 206, 209), */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_u_darkslategray4, __pyx_tuple__124) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":118 * 'darkslategray3' : (121, 205, 205), * 'darkslategray4' : (82, 139, 139), * 'darkslategrey' : (47, 79, 79), # <<<<<<<<<<<<<< * 'darkturquoise' : (0, 206, 209), * 'darkviolet' : (148, 0, 211), */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_u_darkslategrey, __pyx_tuple__125) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":119 * 'darkslategray4' : (82, 139, 139), * 'darkslategrey' : (47, 79, 79), * 'darkturquoise' : (0, 206, 209), # <<<<<<<<<<<<<< * 'darkviolet' : (148, 0, 211), * 'deeppink' : (255, 20, 147), */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_u_darkturquoise, __pyx_tuple__126) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":120 * 'darkslategrey' : (47, 79, 79), * 'darkturquoise' : (0, 206, 209), * 'darkviolet' : (148, 0, 211), # <<<<<<<<<<<<<< * 'deeppink' : (255, 20, 147), * 'deeppink1' : (255, 20, 147), */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_u_darkviolet, __pyx_tuple__127) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":121 * 'darkturquoise' : (0, 206, 209), * 'darkviolet' : (148, 0, 211), * 'deeppink' : (255, 20, 147), # <<<<<<<<<<<<<< * 'deeppink1' : (255, 20, 147), * 'deeppink2' : (238, 18, 137), */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_u_deeppink, __pyx_tuple__128) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":122 * 'darkviolet' : (148, 0, 211), * 'deeppink' : (255, 20, 147), * 'deeppink1' : (255, 20, 147), # <<<<<<<<<<<<<< * 'deeppink2' : (238, 18, 137), * 'deeppink3' : (205, 16, 118), */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_u_deeppink1, __pyx_tuple__129) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":123 * 'deeppink' : (255, 20, 147), * 'deeppink1' : (255, 20, 147), * 'deeppink2' : (238, 18, 137), # <<<<<<<<<<<<<< * 'deeppink3' : (205, 16, 118), * 'deeppink4' : (139, 10, 80), */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_u_deeppink2, __pyx_tuple__130) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":124 * 'deeppink1' : (255, 20, 147), * 'deeppink2' : (238, 18, 137), * 'deeppink3' : (205, 16, 118), # <<<<<<<<<<<<<< * 'deeppink4' : (139, 10, 80), * 'deepskyblue' : (0, 191, 255), */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_u_deeppink3, __pyx_tuple__131) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":125 * 'deeppink2' : (238, 18, 137), * 'deeppink3' : (205, 16, 118), * 'deeppink4' : (139, 10, 80), # <<<<<<<<<<<<<< * 'deepskyblue' : (0, 191, 255), * 'deepskyblue1' : (0, 191, 255), */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_u_deeppink4, __pyx_tuple__132) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":126 * 'deeppink3' : (205, 16, 118), * 'deeppink4' : (139, 10, 80), * 'deepskyblue' : (0, 191, 255), # <<<<<<<<<<<<<< * 'deepskyblue1' : (0, 191, 255), * 'deepskyblue2' : (0, 178, 238), */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_u_deepskyblue, __pyx_tuple__133) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":127 * 'deeppink4' : (139, 10, 80), * 'deepskyblue' : (0, 191, 255), * 'deepskyblue1' : (0, 191, 255), # <<<<<<<<<<<<<< * 'deepskyblue2' : (0, 178, 238), * 'deepskyblue3' : (0, 154, 205), */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_u_deepskyblue1, __pyx_tuple__134) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":128 * 'deepskyblue' : (0, 191, 255), * 'deepskyblue1' : (0, 191, 255), * 'deepskyblue2' : (0, 178, 238), # <<<<<<<<<<<<<< * 'deepskyblue3' : (0, 154, 205), * 'deepskyblue4' : (0, 104, 139), */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_u_deepskyblue2, __pyx_tuple__135) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":129 * 'deepskyblue1' : (0, 191, 255), * 'deepskyblue2' : (0, 178, 238), * 'deepskyblue3' : (0, 154, 205), # <<<<<<<<<<<<<< * 'deepskyblue4' : (0, 104, 139), * 'dimgray' : (105, 105, 105), */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_u_deepskyblue3, __pyx_tuple__136) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":130 * 'deepskyblue2' : (0, 178, 238), * 'deepskyblue3' : (0, 154, 205), * 'deepskyblue4' : (0, 104, 139), # <<<<<<<<<<<<<< * 'dimgray' : (105, 105, 105), * 'dimgrey' : (105, 105, 105), */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_u_deepskyblue4, __pyx_tuple__137) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":131 * 'deepskyblue3' : (0, 154, 205), * 'deepskyblue4' : (0, 104, 139), * 'dimgray' : (105, 105, 105), # <<<<<<<<<<<<<< * 'dimgrey' : (105, 105, 105), * 'dodgerblue' : (30, 144, 255), */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_u_dimgray, __pyx_tuple__138) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":132 * 'deepskyblue4' : (0, 104, 139), * 'dimgray' : (105, 105, 105), * 'dimgrey' : (105, 105, 105), # <<<<<<<<<<<<<< * 'dodgerblue' : (30, 144, 255), * 'dodgerblue1' : (30, 144, 255), */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_u_dimgrey, __pyx_tuple__139) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":133 * 'dimgray' : (105, 105, 105), * 'dimgrey' : (105, 105, 105), * 'dodgerblue' : (30, 144, 255), # <<<<<<<<<<<<<< * 'dodgerblue1' : (30, 144, 255), * 'dodgerblue2' : (28, 134, 238), */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_u_dodgerblue, __pyx_tuple__140) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":134 * 'dimgrey' : (105, 105, 105), * 'dodgerblue' : (30, 144, 255), * 'dodgerblue1' : (30, 144, 255), # <<<<<<<<<<<<<< * 'dodgerblue2' : (28, 134, 238), * 'dodgerblue3' : (24, 116, 205), */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_u_dodgerblue1, __pyx_tuple__141) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":135 * 'dodgerblue' : (30, 144, 255), * 'dodgerblue1' : (30, 144, 255), * 'dodgerblue2' : (28, 134, 238), # <<<<<<<<<<<<<< * 'dodgerblue3' : (24, 116, 205), * 'dodgerblue4' : (16, 78, 139), */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_u_dodgerblue2, __pyx_tuple__142) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":136 * 'dodgerblue1' : (30, 144, 255), * 'dodgerblue2' : (28, 134, 238), * 'dodgerblue3' : (24, 116, 205), # <<<<<<<<<<<<<< * 'dodgerblue4' : (16, 78, 139), * 'firebrick' : (178, 34, 34), */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_u_dodgerblue3, __pyx_tuple__143) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":137 * 'dodgerblue2' : (28, 134, 238), * 'dodgerblue3' : (24, 116, 205), * 'dodgerblue4' : (16, 78, 139), # <<<<<<<<<<<<<< * 'firebrick' : (178, 34, 34), * 'firebrick1' : (255, 48, 48), */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_u_dodgerblue4, __pyx_tuple__144) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":138 * 'dodgerblue3' : (24, 116, 205), * 'dodgerblue4' : (16, 78, 139), * 'firebrick' : (178, 34, 34), # <<<<<<<<<<<<<< * 'firebrick1' : (255, 48, 48), * 'firebrick2' : (238, 44, 44), */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_u_firebrick, __pyx_tuple__145) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":139 * 'dodgerblue4' : (16, 78, 139), * 'firebrick' : (178, 34, 34), * 'firebrick1' : (255, 48, 48), # <<<<<<<<<<<<<< * 'firebrick2' : (238, 44, 44), * 'firebrick3' : (205, 38, 38), */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_u_firebrick1, __pyx_tuple__146) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":140 * 'firebrick' : (178, 34, 34), * 'firebrick1' : (255, 48, 48), * 'firebrick2' : (238, 44, 44), # <<<<<<<<<<<<<< * 'firebrick3' : (205, 38, 38), * 'firebrick4' : (139, 26, 26), */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_u_firebrick2, __pyx_tuple__147) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":141 * 'firebrick1' : (255, 48, 48), * 'firebrick2' : (238, 44, 44), * 'firebrick3' : (205, 38, 38), # <<<<<<<<<<<<<< * 'firebrick4' : (139, 26, 26), * 'floralwhite' : (255, 250, 240), */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_u_firebrick3, __pyx_tuple__148) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":142 * 'firebrick2' : (238, 44, 44), * 'firebrick3' : (205, 38, 38), * 'firebrick4' : (139, 26, 26), # <<<<<<<<<<<<<< * 'floralwhite' : (255, 250, 240), * 'forestgreen' : (34, 139, 34), */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_u_firebrick4, __pyx_tuple__149) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":143 * 'firebrick3' : (205, 38, 38), * 'firebrick4' : (139, 26, 26), * 'floralwhite' : (255, 250, 240), # <<<<<<<<<<<<<< * 'forestgreen' : (34, 139, 34), * 'fuchsia' : (255, 0, 255), */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_u_floralwhite, __pyx_tuple__150) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":144 * 'firebrick4' : (139, 26, 26), * 'floralwhite' : (255, 250, 240), * 'forestgreen' : (34, 139, 34), # <<<<<<<<<<<<<< * 'fuchsia' : (255, 0, 255), * 'gainsboro' : (220, 220, 220), */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_u_forestgreen, __pyx_tuple__151) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":145 * 'floralwhite' : (255, 250, 240), * 'forestgreen' : (34, 139, 34), * 'fuchsia' : (255, 0, 255), # <<<<<<<<<<<<<< * 'gainsboro' : (220, 220, 220), * 'ghostwhite' : (248, 248, 255), */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_u_fuchsia, __pyx_tuple__152) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":146 * 'forestgreen' : (34, 139, 34), * 'fuchsia' : (255, 0, 255), * 'gainsboro' : (220, 220, 220), # <<<<<<<<<<<<<< * 'ghostwhite' : (248, 248, 255), * 'gold' : (255, 215, 0), */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_u_gainsboro, __pyx_tuple__153) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":147 * 'fuchsia' : (255, 0, 255), * 'gainsboro' : (220, 220, 220), * 'ghostwhite' : (248, 248, 255), # <<<<<<<<<<<<<< * 'gold' : (255, 215, 0), * 'gold1' : (255, 215, 0), */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_u_ghostwhite, __pyx_tuple__154) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":148 * 'gainsboro' : (220, 220, 220), * 'ghostwhite' : (248, 248, 255), * 'gold' : (255, 215, 0), # <<<<<<<<<<<<<< * 'gold1' : (255, 215, 0), * 'gold2' : (238, 201, 0), */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_u_gold, __pyx_tuple__155) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":149 * 'ghostwhite' : (248, 248, 255), * 'gold' : (255, 215, 0), * 'gold1' : (255, 215, 0), # <<<<<<<<<<<<<< * 'gold2' : (238, 201, 0), * 'gold3' : (205, 173, 0), */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_u_gold1, __pyx_tuple__156) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":150 * 'gold' : (255, 215, 0), * 'gold1' : (255, 215, 0), * 'gold2' : (238, 201, 0), # <<<<<<<<<<<<<< * 'gold3' : (205, 173, 0), * 'gold4' : (139, 117, 0), */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_u_gold2, __pyx_tuple__157) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":151 * 'gold1' : (255, 215, 0), * 'gold2' : (238, 201, 0), * 'gold3' : (205, 173, 0), # <<<<<<<<<<<<<< * 'gold4' : (139, 117, 0), * 'goldenrod' : (218, 165, 32), */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_u_gold3, __pyx_tuple__158) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":152 * 'gold2' : (238, 201, 0), * 'gold3' : (205, 173, 0), * 'gold4' : (139, 117, 0), # <<<<<<<<<<<<<< * 'goldenrod' : (218, 165, 32), * 'goldenrod1' : (255, 193, 37), */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_u_gold4, __pyx_tuple__159) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":153 * 'gold3' : (205, 173, 0), * 'gold4' : (139, 117, 0), * 'goldenrod' : (218, 165, 32), # <<<<<<<<<<<<<< * 'goldenrod1' : (255, 193, 37), * 'goldenrod2' : (238, 180, 34), */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_u_goldenrod, __pyx_tuple__160) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":154 * 'gold4' : (139, 117, 0), * 'goldenrod' : (218, 165, 32), * 'goldenrod1' : (255, 193, 37), # <<<<<<<<<<<<<< * 'goldenrod2' : (238, 180, 34), * 'goldenrod3' : (205, 155, 29), */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_u_goldenrod1, __pyx_tuple__161) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":155 * 'goldenrod' : (218, 165, 32), * 'goldenrod1' : (255, 193, 37), * 'goldenrod2' : (238, 180, 34), # <<<<<<<<<<<<<< * 'goldenrod3' : (205, 155, 29), * 'goldenrod4' : (139, 105, 20), */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_u_goldenrod2, __pyx_tuple__162) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":156 * 'goldenrod1' : (255, 193, 37), * 'goldenrod2' : (238, 180, 34), * 'goldenrod3' : (205, 155, 29), # <<<<<<<<<<<<<< * 'goldenrod4' : (139, 105, 20), * 'gray' : (190, 190, 190), */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_u_goldenrod3, __pyx_tuple__163) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":157 * 'goldenrod2' : (238, 180, 34), * 'goldenrod3' : (205, 155, 29), * 'goldenrod4' : (139, 105, 20), # <<<<<<<<<<<<<< * 'gray' : (190, 190, 190), * 'gray0' : (0, 0, 0), */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_u_goldenrod4, __pyx_tuple__164) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":158 * 'goldenrod3' : (205, 155, 29), * 'goldenrod4' : (139, 105, 20), * 'gray' : (190, 190, 190), # <<<<<<<<<<<<<< * 'gray0' : (0, 0, 0), * 'gray1' : (3, 3, 3), */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_u_gray, __pyx_tuple__165) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":159 * 'goldenrod4' : (139, 105, 20), * 'gray' : (190, 190, 190), * 'gray0' : (0, 0, 0), # <<<<<<<<<<<<<< * 'gray1' : (3, 3, 3), * 'gray10' : (26, 26, 26), */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_u_gray0, __pyx_tuple__166) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":160 * 'gray' : (190, 190, 190), * 'gray0' : (0, 0, 0), * 'gray1' : (3, 3, 3), # <<<<<<<<<<<<<< * 'gray10' : (26, 26, 26), * 'gray100' : (255, 255, 255), */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_u_gray1, __pyx_tuple__167) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":161 * 'gray0' : (0, 0, 0), * 'gray1' : (3, 3, 3), * 'gray10' : (26, 26, 26), # <<<<<<<<<<<<<< * 'gray100' : (255, 255, 255), * 'gray11' : (28, 28, 28), */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_u_gray10, __pyx_tuple__168) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":162 * 'gray1' : (3, 3, 3), * 'gray10' : (26, 26, 26), * 'gray100' : (255, 255, 255), # <<<<<<<<<<<<<< * 'gray11' : (28, 28, 28), * 'gray12' : (31, 31, 31), */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_u_gray100, __pyx_tuple__169) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":163 * 'gray10' : (26, 26, 26), * 'gray100' : (255, 255, 255), * 'gray11' : (28, 28, 28), # <<<<<<<<<<<<<< * 'gray12' : (31, 31, 31), * 'gray13' : (33, 33, 33), */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_u_gray11, __pyx_tuple__170) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":164 * 'gray100' : (255, 255, 255), * 'gray11' : (28, 28, 28), * 'gray12' : (31, 31, 31), # <<<<<<<<<<<<<< * 'gray13' : (33, 33, 33), * 'gray14' : (36, 36, 36), */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_u_gray12, __pyx_tuple__171) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":165 * 'gray11' : (28, 28, 28), * 'gray12' : (31, 31, 31), * 'gray13' : (33, 33, 33), # <<<<<<<<<<<<<< * 'gray14' : (36, 36, 36), * 'gray15' : (38, 38, 38), */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_u_gray13, __pyx_tuple__172) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":166 * 'gray12' : (31, 31, 31), * 'gray13' : (33, 33, 33), * 'gray14' : (36, 36, 36), # <<<<<<<<<<<<<< * 'gray15' : (38, 38, 38), * 'gray16' : (41, 41, 41), */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_u_gray14, __pyx_tuple__173) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":167 * 'gray13' : (33, 33, 33), * 'gray14' : (36, 36, 36), * 'gray15' : (38, 38, 38), # <<<<<<<<<<<<<< * 'gray16' : (41, 41, 41), * 'gray17' : (43, 43, 43), */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_u_gray15, __pyx_tuple__174) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":168 * 'gray14' : (36, 36, 36), * 'gray15' : (38, 38, 38), * 'gray16' : (41, 41, 41), # <<<<<<<<<<<<<< * 'gray17' : (43, 43, 43), * 'gray18' : (46, 46, 46), */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_u_gray16, __pyx_tuple__175) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":169 * 'gray15' : (38, 38, 38), * 'gray16' : (41, 41, 41), * 'gray17' : (43, 43, 43), # <<<<<<<<<<<<<< * 'gray18' : (46, 46, 46), * 'gray19' : (48, 48, 48), */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_u_gray17, __pyx_tuple__176) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":170 * 'gray16' : (41, 41, 41), * 'gray17' : (43, 43, 43), * 'gray18' : (46, 46, 46), # <<<<<<<<<<<<<< * 'gray19' : (48, 48, 48), * 'gray2' : (5, 5, 5), */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_u_gray18, __pyx_tuple__177) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":171 * 'gray17' : (43, 43, 43), * 'gray18' : (46, 46, 46), * 'gray19' : (48, 48, 48), # <<<<<<<<<<<<<< * 'gray2' : (5, 5, 5), * 'gray20' : (51, 51, 51), */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_u_gray19, __pyx_tuple__178) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":172 * 'gray18' : (46, 46, 46), * 'gray19' : (48, 48, 48), * 'gray2' : (5, 5, 5), # <<<<<<<<<<<<<< * 'gray20' : (51, 51, 51), * 'gray21' : (54, 54, 54), */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_u_gray2, __pyx_tuple__179) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":173 * 'gray19' : (48, 48, 48), * 'gray2' : (5, 5, 5), * 'gray20' : (51, 51, 51), # <<<<<<<<<<<<<< * 'gray21' : (54, 54, 54), * 'gray22' : (56, 56, 56), */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_u_gray20, __pyx_tuple__180) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":174 * 'gray2' : (5, 5, 5), * 'gray20' : (51, 51, 51), * 'gray21' : (54, 54, 54), # <<<<<<<<<<<<<< * 'gray22' : (56, 56, 56), * 'gray23' : (59, 59, 59), */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_u_gray21, __pyx_tuple__181) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":175 * 'gray20' : (51, 51, 51), * 'gray21' : (54, 54, 54), * 'gray22' : (56, 56, 56), # <<<<<<<<<<<<<< * 'gray23' : (59, 59, 59), * 'gray24' : (61, 61, 61), */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_u_gray22, __pyx_tuple__182) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":176 * 'gray21' : (54, 54, 54), * 'gray22' : (56, 56, 56), * 'gray23' : (59, 59, 59), # <<<<<<<<<<<<<< * 'gray24' : (61, 61, 61), * 'gray25' : (64, 64, 64), */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_u_gray23, __pyx_tuple__183) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":177 * 'gray22' : (56, 56, 56), * 'gray23' : (59, 59, 59), * 'gray24' : (61, 61, 61), # <<<<<<<<<<<<<< * 'gray25' : (64, 64, 64), * 'gray26' : (66, 66, 66), */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_u_gray24, __pyx_tuple__184) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":178 * 'gray23' : (59, 59, 59), * 'gray24' : (61, 61, 61), * 'gray25' : (64, 64, 64), # <<<<<<<<<<<<<< * 'gray26' : (66, 66, 66), * 'gray27' : (69, 69, 69), */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_u_gray25, __pyx_tuple__185) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":179 * 'gray24' : (61, 61, 61), * 'gray25' : (64, 64, 64), * 'gray26' : (66, 66, 66), # <<<<<<<<<<<<<< * 'gray27' : (69, 69, 69), * 'gray28' : (71, 71, 71), */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_u_gray26, __pyx_tuple__186) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":180 * 'gray25' : (64, 64, 64), * 'gray26' : (66, 66, 66), * 'gray27' : (69, 69, 69), # <<<<<<<<<<<<<< * 'gray28' : (71, 71, 71), * 'gray29' : (74, 74, 74), */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_u_gray27, __pyx_tuple__187) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":181 * 'gray26' : (66, 66, 66), * 'gray27' : (69, 69, 69), * 'gray28' : (71, 71, 71), # <<<<<<<<<<<<<< * 'gray29' : (74, 74, 74), * 'gray3' : (8, 8, 8), */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_u_gray28, __pyx_tuple__188) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":182 * 'gray27' : (69, 69, 69), * 'gray28' : (71, 71, 71), * 'gray29' : (74, 74, 74), # <<<<<<<<<<<<<< * 'gray3' : (8, 8, 8), * 'gray30' : (77, 77, 77), */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_u_gray29, __pyx_tuple__189) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":183 * 'gray28' : (71, 71, 71), * 'gray29' : (74, 74, 74), * 'gray3' : (8, 8, 8), # <<<<<<<<<<<<<< * 'gray30' : (77, 77, 77), * 'gray31' : (79, 79, 79), */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_u_gray3, __pyx_tuple__190) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":184 * 'gray29' : (74, 74, 74), * 'gray3' : (8, 8, 8), * 'gray30' : (77, 77, 77), # <<<<<<<<<<<<<< * 'gray31' : (79, 79, 79), * 'gray32' : (82, 82, 82), */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_u_gray30, __pyx_tuple__191) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":185 * 'gray3' : (8, 8, 8), * 'gray30' : (77, 77, 77), * 'gray31' : (79, 79, 79), # <<<<<<<<<<<<<< * 'gray32' : (82, 82, 82), * 'gray33' : (84, 84, 84), */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_u_gray31, __pyx_tuple__192) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":186 * 'gray30' : (77, 77, 77), * 'gray31' : (79, 79, 79), * 'gray32' : (82, 82, 82), # <<<<<<<<<<<<<< * 'gray33' : (84, 84, 84), * 'gray34' : (87, 87, 87), */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_u_gray32, __pyx_tuple__193) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":187 * 'gray31' : (79, 79, 79), * 'gray32' : (82, 82, 82), * 'gray33' : (84, 84, 84), # <<<<<<<<<<<<<< * 'gray34' : (87, 87, 87), * 'gray35' : (89, 89, 89), */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_u_gray33, __pyx_tuple__194) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":188 * 'gray32' : (82, 82, 82), * 'gray33' : (84, 84, 84), * 'gray34' : (87, 87, 87), # <<<<<<<<<<<<<< * 'gray35' : (89, 89, 89), * 'gray36' : (92, 92, 92), */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_u_gray34, __pyx_tuple__195) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":189 * 'gray33' : (84, 84, 84), * 'gray34' : (87, 87, 87), * 'gray35' : (89, 89, 89), # <<<<<<<<<<<<<< * 'gray36' : (92, 92, 92), * 'gray37' : (94, 94, 94), */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_u_gray35, __pyx_tuple__196) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":190 * 'gray34' : (87, 87, 87), * 'gray35' : (89, 89, 89), * 'gray36' : (92, 92, 92), # <<<<<<<<<<<<<< * 'gray37' : (94, 94, 94), * 'gray38' : (97, 97, 97), */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_u_gray36, __pyx_tuple__197) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":191 * 'gray35' : (89, 89, 89), * 'gray36' : (92, 92, 92), * 'gray37' : (94, 94, 94), # <<<<<<<<<<<<<< * 'gray38' : (97, 97, 97), * 'gray39' : (99, 99, 99), */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_u_gray37, __pyx_tuple__198) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":192 * 'gray36' : (92, 92, 92), * 'gray37' : (94, 94, 94), * 'gray38' : (97, 97, 97), # <<<<<<<<<<<<<< * 'gray39' : (99, 99, 99), * 'gray4' : (10, 10, 10), */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_u_gray38, __pyx_tuple__199) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":193 * 'gray37' : (94, 94, 94), * 'gray38' : (97, 97, 97), * 'gray39' : (99, 99, 99), # <<<<<<<<<<<<<< * 'gray4' : (10, 10, 10), * 'gray40' : (102, 102, 102), */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_u_gray39, __pyx_tuple__200) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":194 * 'gray38' : (97, 97, 97), * 'gray39' : (99, 99, 99), * 'gray4' : (10, 10, 10), # <<<<<<<<<<<<<< * 'gray40' : (102, 102, 102), * 'gray41' : (105, 105, 105), */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_u_gray4, __pyx_tuple__201) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":195 * 'gray39' : (99, 99, 99), * 'gray4' : (10, 10, 10), * 'gray40' : (102, 102, 102), # <<<<<<<<<<<<<< * 'gray41' : (105, 105, 105), * 'gray42' : (107, 107, 107), */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_u_gray40, __pyx_tuple__202) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":196 * 'gray4' : (10, 10, 10), * 'gray40' : (102, 102, 102), * 'gray41' : (105, 105, 105), # <<<<<<<<<<<<<< * 'gray42' : (107, 107, 107), * 'gray43' : (110, 110, 110), */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_u_gray41, __pyx_tuple__203) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":197 * 'gray40' : (102, 102, 102), * 'gray41' : (105, 105, 105), * 'gray42' : (107, 107, 107), # <<<<<<<<<<<<<< * 'gray43' : (110, 110, 110), * 'gray44' : (112, 112, 112), */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_u_gray42, __pyx_tuple__204) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":198 * 'gray41' : (105, 105, 105), * 'gray42' : (107, 107, 107), * 'gray43' : (110, 110, 110), # <<<<<<<<<<<<<< * 'gray44' : (112, 112, 112), * 'gray45' : (115, 115, 115), */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_u_gray43, __pyx_tuple__205) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":199 * 'gray42' : (107, 107, 107), * 'gray43' : (110, 110, 110), * 'gray44' : (112, 112, 112), # <<<<<<<<<<<<<< * 'gray45' : (115, 115, 115), * 'gray46' : (117, 117, 117), */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_u_gray44, __pyx_tuple__206) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":200 * 'gray43' : (110, 110, 110), * 'gray44' : (112, 112, 112), * 'gray45' : (115, 115, 115), # <<<<<<<<<<<<<< * 'gray46' : (117, 117, 117), * 'gray47' : (120, 120, 120), */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_u_gray45, __pyx_tuple__207) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":201 * 'gray44' : (112, 112, 112), * 'gray45' : (115, 115, 115), * 'gray46' : (117, 117, 117), # <<<<<<<<<<<<<< * 'gray47' : (120, 120, 120), * 'gray48' : (122, 122, 122), */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_u_gray46, __pyx_tuple__208) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":202 * 'gray45' : (115, 115, 115), * 'gray46' : (117, 117, 117), * 'gray47' : (120, 120, 120), # <<<<<<<<<<<<<< * 'gray48' : (122, 122, 122), * 'gray49' : (125, 125, 125), */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_u_gray47, __pyx_tuple__209) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":203 * 'gray46' : (117, 117, 117), * 'gray47' : (120, 120, 120), * 'gray48' : (122, 122, 122), # <<<<<<<<<<<<<< * 'gray49' : (125, 125, 125), * 'gray5' : (13, 13, 13), */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_u_gray48, __pyx_tuple__210) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":204 * 'gray47' : (120, 120, 120), * 'gray48' : (122, 122, 122), * 'gray49' : (125, 125, 125), # <<<<<<<<<<<<<< * 'gray5' : (13, 13, 13), * 'gray50' : (127, 127, 127), */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_u_gray49, __pyx_tuple__211) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":205 * 'gray48' : (122, 122, 122), * 'gray49' : (125, 125, 125), * 'gray5' : (13, 13, 13), # <<<<<<<<<<<<<< * 'gray50' : (127, 127, 127), * 'gray51' : (130, 130, 130), */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_u_gray5, __pyx_tuple__212) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":206 * 'gray49' : (125, 125, 125), * 'gray5' : (13, 13, 13), * 'gray50' : (127, 127, 127), # <<<<<<<<<<<<<< * 'gray51' : (130, 130, 130), * 'gray52' : (133, 133, 133), */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_u_gray50, __pyx_tuple__213) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":207 * 'gray5' : (13, 13, 13), * 'gray50' : (127, 127, 127), * 'gray51' : (130, 130, 130), # <<<<<<<<<<<<<< * 'gray52' : (133, 133, 133), * 'gray53' : (135, 135, 135), */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_u_gray51, __pyx_tuple__214) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":208 * 'gray50' : (127, 127, 127), * 'gray51' : (130, 130, 130), * 'gray52' : (133, 133, 133), # <<<<<<<<<<<<<< * 'gray53' : (135, 135, 135), * 'gray54' : (138, 138, 138), */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_u_gray52, __pyx_tuple__215) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":209 * 'gray51' : (130, 130, 130), * 'gray52' : (133, 133, 133), * 'gray53' : (135, 135, 135), # <<<<<<<<<<<<<< * 'gray54' : (138, 138, 138), * 'gray55' : (140, 140, 140), */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_u_gray53, __pyx_tuple__216) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":210 * 'gray52' : (133, 133, 133), * 'gray53' : (135, 135, 135), * 'gray54' : (138, 138, 138), # <<<<<<<<<<<<<< * 'gray55' : (140, 140, 140), * 'gray56' : (143, 143, 143), */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_u_gray54, __pyx_tuple__217) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":211 * 'gray53' : (135, 135, 135), * 'gray54' : (138, 138, 138), * 'gray55' : (140, 140, 140), # <<<<<<<<<<<<<< * 'gray56' : (143, 143, 143), * 'gray57' : (145, 145, 145), */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_u_gray55, __pyx_tuple__218) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":212 * 'gray54' : (138, 138, 138), * 'gray55' : (140, 140, 140), * 'gray56' : (143, 143, 143), # <<<<<<<<<<<<<< * 'gray57' : (145, 145, 145), * 'gray58' : (148, 148, 148), */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_u_gray56, __pyx_tuple__219) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":213 * 'gray55' : (140, 140, 140), * 'gray56' : (143, 143, 143), * 'gray57' : (145, 145, 145), # <<<<<<<<<<<<<< * 'gray58' : (148, 148, 148), * 'gray59' : (150, 150, 150), */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_u_gray57, __pyx_tuple__220) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":214 * 'gray56' : (143, 143, 143), * 'gray57' : (145, 145, 145), * 'gray58' : (148, 148, 148), # <<<<<<<<<<<<<< * 'gray59' : (150, 150, 150), * 'gray6' : (15, 15, 15), */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_u_gray58, __pyx_tuple__221) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":215 * 'gray57' : (145, 145, 145), * 'gray58' : (148, 148, 148), * 'gray59' : (150, 150, 150), # <<<<<<<<<<<<<< * 'gray6' : (15, 15, 15), * 'gray60' : (153, 153, 153), */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_u_gray59, __pyx_tuple__222) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":216 * 'gray58' : (148, 148, 148), * 'gray59' : (150, 150, 150), * 'gray6' : (15, 15, 15), # <<<<<<<<<<<<<< * 'gray60' : (153, 153, 153), * 'gray61' : (156, 156, 156), */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_u_gray6, __pyx_tuple__223) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":217 * 'gray59' : (150, 150, 150), * 'gray6' : (15, 15, 15), * 'gray60' : (153, 153, 153), # <<<<<<<<<<<<<< * 'gray61' : (156, 156, 156), * 'gray62' : (158, 158, 158), */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_u_gray60, __pyx_tuple__224) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":218 * 'gray6' : (15, 15, 15), * 'gray60' : (153, 153, 153), * 'gray61' : (156, 156, 156), # <<<<<<<<<<<<<< * 'gray62' : (158, 158, 158), * 'gray63' : (161, 161, 161), */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_u_gray61, __pyx_tuple__225) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":219 * 'gray60' : (153, 153, 153), * 'gray61' : (156, 156, 156), * 'gray62' : (158, 158, 158), # <<<<<<<<<<<<<< * 'gray63' : (161, 161, 161), * 'gray64' : (163, 163, 163), */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_u_gray62, __pyx_tuple__226) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":220 * 'gray61' : (156, 156, 156), * 'gray62' : (158, 158, 158), * 'gray63' : (161, 161, 161), # <<<<<<<<<<<<<< * 'gray64' : (163, 163, 163), * 'gray65' : (166, 166, 166), */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_u_gray63, __pyx_tuple__227) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":221 * 'gray62' : (158, 158, 158), * 'gray63' : (161, 161, 161), * 'gray64' : (163, 163, 163), # <<<<<<<<<<<<<< * 'gray65' : (166, 166, 166), * 'gray66' : (168, 168, 168), */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_u_gray64, __pyx_tuple__228) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":222 * 'gray63' : (161, 161, 161), * 'gray64' : (163, 163, 163), * 'gray65' : (166, 166, 166), # <<<<<<<<<<<<<< * 'gray66' : (168, 168, 168), * 'gray67' : (171, 171, 171), */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_u_gray65, __pyx_tuple__229) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":223 * 'gray64' : (163, 163, 163), * 'gray65' : (166, 166, 166), * 'gray66' : (168, 168, 168), # <<<<<<<<<<<<<< * 'gray67' : (171, 171, 171), * 'gray68' : (173, 173, 173), */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_u_gray66, __pyx_tuple__230) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":224 * 'gray65' : (166, 166, 166), * 'gray66' : (168, 168, 168), * 'gray67' : (171, 171, 171), # <<<<<<<<<<<<<< * 'gray68' : (173, 173, 173), * 'gray69' : (176, 176, 176), */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_u_gray67, __pyx_tuple__231) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":225 * 'gray66' : (168, 168, 168), * 'gray67' : (171, 171, 171), * 'gray68' : (173, 173, 173), # <<<<<<<<<<<<<< * 'gray69' : (176, 176, 176), * 'gray7' : (18, 18, 18), */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_u_gray68, __pyx_tuple__232) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":226 * 'gray67' : (171, 171, 171), * 'gray68' : (173, 173, 173), * 'gray69' : (176, 176, 176), # <<<<<<<<<<<<<< * 'gray7' : (18, 18, 18), * 'gray70' : (179, 179, 179), */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_u_gray69, __pyx_tuple__233) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":227 * 'gray68' : (173, 173, 173), * 'gray69' : (176, 176, 176), * 'gray7' : (18, 18, 18), # <<<<<<<<<<<<<< * 'gray70' : (179, 179, 179), * 'gray71' : (181, 181, 181), */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_u_gray7, __pyx_tuple__234) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":228 * 'gray69' : (176, 176, 176), * 'gray7' : (18, 18, 18), * 'gray70' : (179, 179, 179), # <<<<<<<<<<<<<< * 'gray71' : (181, 181, 181), * 'gray72' : (184, 184, 184), */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_u_gray70, __pyx_tuple__235) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":229 * 'gray7' : (18, 18, 18), * 'gray70' : (179, 179, 179), * 'gray71' : (181, 181, 181), # <<<<<<<<<<<<<< * 'gray72' : (184, 184, 184), * 'gray73' : (186, 186, 186), */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_u_gray71, __pyx_tuple__236) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":230 * 'gray70' : (179, 179, 179), * 'gray71' : (181, 181, 181), * 'gray72' : (184, 184, 184), # <<<<<<<<<<<<<< * 'gray73' : (186, 186, 186), * 'gray74' : (189, 189, 189), */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_u_gray72, __pyx_tuple__237) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":231 * 'gray71' : (181, 181, 181), * 'gray72' : (184, 184, 184), * 'gray73' : (186, 186, 186), # <<<<<<<<<<<<<< * 'gray74' : (189, 189, 189), * 'gray75' : (191, 191, 191), */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_u_gray73, __pyx_tuple__238) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":232 * 'gray72' : (184, 184, 184), * 'gray73' : (186, 186, 186), * 'gray74' : (189, 189, 189), # <<<<<<<<<<<<<< * 'gray75' : (191, 191, 191), * 'gray76' : (194, 194, 194), */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_u_gray74, __pyx_tuple__239) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":233 * 'gray73' : (186, 186, 186), * 'gray74' : (189, 189, 189), * 'gray75' : (191, 191, 191), # <<<<<<<<<<<<<< * 'gray76' : (194, 194, 194), * 'gray77' : (196, 196, 196), */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_u_gray75, __pyx_tuple__240) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":234 * 'gray74' : (189, 189, 189), * 'gray75' : (191, 191, 191), * 'gray76' : (194, 194, 194), # <<<<<<<<<<<<<< * 'gray77' : (196, 196, 196), * 'gray78' : (199, 199, 199), */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_u_gray76, __pyx_tuple__241) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":235 * 'gray75' : (191, 191, 191), * 'gray76' : (194, 194, 194), * 'gray77' : (196, 196, 196), # <<<<<<<<<<<<<< * 'gray78' : (199, 199, 199), * 'gray79' : (201, 201, 201), */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_u_gray77, __pyx_tuple__242) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":236 * 'gray76' : (194, 194, 194), * 'gray77' : (196, 196, 196), * 'gray78' : (199, 199, 199), # <<<<<<<<<<<<<< * 'gray79' : (201, 201, 201), * 'gray8' : (20, 20, 20), */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_u_gray78, __pyx_tuple__243) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":237 * 'gray77' : (196, 196, 196), * 'gray78' : (199, 199, 199), * 'gray79' : (201, 201, 201), # <<<<<<<<<<<<<< * 'gray8' : (20, 20, 20), * 'gray80' : (204, 204, 204), */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_u_gray79, __pyx_tuple__244) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":238 * 'gray78' : (199, 199, 199), * 'gray79' : (201, 201, 201), * 'gray8' : (20, 20, 20), # <<<<<<<<<<<<<< * 'gray80' : (204, 204, 204), * 'gray81' : (207, 207, 207), */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_u_gray8, __pyx_tuple__245) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":239 * 'gray79' : (201, 201, 201), * 'gray8' : (20, 20, 20), * 'gray80' : (204, 204, 204), # <<<<<<<<<<<<<< * 'gray81' : (207, 207, 207), * 'gray82' : (209, 209, 209), */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_u_gray80, __pyx_tuple__246) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":240 * 'gray8' : (20, 20, 20), * 'gray80' : (204, 204, 204), * 'gray81' : (207, 207, 207), # <<<<<<<<<<<<<< * 'gray82' : (209, 209, 209), * 'gray83' : (212, 212, 212), */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_u_gray81, __pyx_tuple__247) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":241 * 'gray80' : (204, 204, 204), * 'gray81' : (207, 207, 207), * 'gray82' : (209, 209, 209), # <<<<<<<<<<<<<< * 'gray83' : (212, 212, 212), * 'gray84' : (214, 214, 214), */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_u_gray82, __pyx_tuple__248) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":242 * 'gray81' : (207, 207, 207), * 'gray82' : (209, 209, 209), * 'gray83' : (212, 212, 212), # <<<<<<<<<<<<<< * 'gray84' : (214, 214, 214), * 'gray85' : (217, 217, 217), */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_u_gray83, __pyx_tuple__249) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":243 * 'gray82' : (209, 209, 209), * 'gray83' : (212, 212, 212), * 'gray84' : (214, 214, 214), # <<<<<<<<<<<<<< * 'gray85' : (217, 217, 217), * 'gray86' : (219, 219, 219), */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_u_gray84, __pyx_tuple__250) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":244 * 'gray83' : (212, 212, 212), * 'gray84' : (214, 214, 214), * 'gray85' : (217, 217, 217), # <<<<<<<<<<<<<< * 'gray86' : (219, 219, 219), * 'gray87' : (222, 222, 222), */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_u_gray85, __pyx_tuple__251) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":245 * 'gray84' : (214, 214, 214), * 'gray85' : (217, 217, 217), * 'gray86' : (219, 219, 219), # <<<<<<<<<<<<<< * 'gray87' : (222, 222, 222), * 'gray88' : (224, 224, 224), */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_u_gray86, __pyx_tuple__252) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":246 * 'gray85' : (217, 217, 217), * 'gray86' : (219, 219, 219), * 'gray87' : (222, 222, 222), # <<<<<<<<<<<<<< * 'gray88' : (224, 224, 224), * 'gray89' : (227, 227, 227), */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_u_gray87, __pyx_tuple__253) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":247 * 'gray86' : (219, 219, 219), * 'gray87' : (222, 222, 222), * 'gray88' : (224, 224, 224), # <<<<<<<<<<<<<< * 'gray89' : (227, 227, 227), * 'gray9' : (23, 23, 23), */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_u_gray88, __pyx_tuple__254) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":248 * 'gray87' : (222, 222, 222), * 'gray88' : (224, 224, 224), * 'gray89' : (227, 227, 227), # <<<<<<<<<<<<<< * 'gray9' : (23, 23, 23), * 'gray90' : (229, 229, 229), */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_u_gray89, __pyx_tuple__255) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":249 * 'gray88' : (224, 224, 224), * 'gray89' : (227, 227, 227), * 'gray9' : (23, 23, 23), # <<<<<<<<<<<<<< * 'gray90' : (229, 229, 229), * 'gray91' : (232, 232, 232), */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_u_gray9, __pyx_tuple__256) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":250 * 'gray89' : (227, 227, 227), * 'gray9' : (23, 23, 23), * 'gray90' : (229, 229, 229), # <<<<<<<<<<<<<< * 'gray91' : (232, 232, 232), * 'gray92' : (235, 235, 235), */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_u_gray90, __pyx_tuple__257) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":251 * 'gray9' : (23, 23, 23), * 'gray90' : (229, 229, 229), * 'gray91' : (232, 232, 232), # <<<<<<<<<<<<<< * 'gray92' : (235, 235, 235), * 'gray93' : (237, 237, 237), */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_u_gray91, __pyx_tuple__258) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":252 * 'gray90' : (229, 229, 229), * 'gray91' : (232, 232, 232), * 'gray92' : (235, 235, 235), # <<<<<<<<<<<<<< * 'gray93' : (237, 237, 237), * 'gray94' : (240, 240, 240), */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_u_gray92, __pyx_tuple__259) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":253 * 'gray91' : (232, 232, 232), * 'gray92' : (235, 235, 235), * 'gray93' : (237, 237, 237), # <<<<<<<<<<<<<< * 'gray94' : (240, 240, 240), * 'gray95' : (242, 242, 242), */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_u_gray93, __pyx_tuple__260) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":254 * 'gray92' : (235, 235, 235), * 'gray93' : (237, 237, 237), * 'gray94' : (240, 240, 240), # <<<<<<<<<<<<<< * 'gray95' : (242, 242, 242), * 'gray96' : (245, 245, 245), */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_u_gray94, __pyx_tuple__261) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":255 * 'gray93' : (237, 237, 237), * 'gray94' : (240, 240, 240), * 'gray95' : (242, 242, 242), # <<<<<<<<<<<<<< * 'gray96' : (245, 245, 245), * 'gray97' : (247, 247, 247), */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_u_gray95, __pyx_tuple__262) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":256 * 'gray94' : (240, 240, 240), * 'gray95' : (242, 242, 242), * 'gray96' : (245, 245, 245), # <<<<<<<<<<<<<< * 'gray97' : (247, 247, 247), * 'gray98' : (250, 250, 250), */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_u_gray96, __pyx_tuple__263) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":257 * 'gray95' : (242, 242, 242), * 'gray96' : (245, 245, 245), * 'gray97' : (247, 247, 247), # <<<<<<<<<<<<<< * 'gray98' : (250, 250, 250), * 'gray99' : (252, 252, 252), */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_u_gray97, __pyx_tuple__264) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":258 * 'gray96' : (245, 245, 245), * 'gray97' : (247, 247, 247), * 'gray98' : (250, 250, 250), # <<<<<<<<<<<<<< * 'gray99' : (252, 252, 252), * 'green' : (0, 255, 0), */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_u_gray98, __pyx_tuple__265) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":259 * 'gray97' : (247, 247, 247), * 'gray98' : (250, 250, 250), * 'gray99' : (252, 252, 252), # <<<<<<<<<<<<<< * 'green' : (0, 255, 0), * 'green1' : (0, 255, 0), */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_u_gray99, __pyx_tuple__266) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":260 * 'gray98' : (250, 250, 250), * 'gray99' : (252, 252, 252), * 'green' : (0, 255, 0), # <<<<<<<<<<<<<< * 'green1' : (0, 255, 0), * 'green2' : (0, 238, 0), */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_u_green, __pyx_tuple__267) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":261 * 'gray99' : (252, 252, 252), * 'green' : (0, 255, 0), * 'green1' : (0, 255, 0), # <<<<<<<<<<<<<< * 'green2' : (0, 238, 0), * 'green3' : (0, 205, 0), */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_u_green1, __pyx_tuple__268) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":262 * 'green' : (0, 255, 0), * 'green1' : (0, 255, 0), * 'green2' : (0, 238, 0), # <<<<<<<<<<<<<< * 'green3' : (0, 205, 0), * 'green4' : (0, 139, 0), */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_u_green2, __pyx_tuple__269) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":263 * 'green1' : (0, 255, 0), * 'green2' : (0, 238, 0), * 'green3' : (0, 205, 0), # <<<<<<<<<<<<<< * 'green4' : (0, 139, 0), * 'greenyellow' : (173, 255, 47), */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_u_green3, __pyx_tuple__270) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":264 * 'green2' : (0, 238, 0), * 'green3' : (0, 205, 0), * 'green4' : (0, 139, 0), # <<<<<<<<<<<<<< * 'greenyellow' : (173, 255, 47), * 'grey' : (190, 190, 190), */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_u_green4, __pyx_tuple__271) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":265 * 'green3' : (0, 205, 0), * 'green4' : (0, 139, 0), * 'greenyellow' : (173, 255, 47), # <<<<<<<<<<<<<< * 'grey' : (190, 190, 190), * 'grey0' : (0, 0, 0), */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_u_greenyellow, __pyx_tuple__272) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":266 * 'green4' : (0, 139, 0), * 'greenyellow' : (173, 255, 47), * 'grey' : (190, 190, 190), # <<<<<<<<<<<<<< * 'grey0' : (0, 0, 0), * 'grey1' : (3, 3, 3), */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_u_grey, __pyx_tuple__273) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":267 * 'greenyellow' : (173, 255, 47), * 'grey' : (190, 190, 190), * 'grey0' : (0, 0, 0), # <<<<<<<<<<<<<< * 'grey1' : (3, 3, 3), * 'grey10' : (26, 26, 26), */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_u_grey0, __pyx_tuple__274) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":268 * 'grey' : (190, 190, 190), * 'grey0' : (0, 0, 0), * 'grey1' : (3, 3, 3), # <<<<<<<<<<<<<< * 'grey10' : (26, 26, 26), * 'grey100' : (255, 255, 255), */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_u_grey1, __pyx_tuple__275) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":269 * 'grey0' : (0, 0, 0), * 'grey1' : (3, 3, 3), * 'grey10' : (26, 26, 26), # <<<<<<<<<<<<<< * 'grey100' : (255, 255, 255), * 'grey11' : (28, 28, 28), */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_u_grey10, __pyx_tuple__276) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":270 * 'grey1' : (3, 3, 3), * 'grey10' : (26, 26, 26), * 'grey100' : (255, 255, 255), # <<<<<<<<<<<<<< * 'grey11' : (28, 28, 28), * 'grey12' : (31, 31, 31), */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_u_grey100, __pyx_tuple__277) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":271 * 'grey10' : (26, 26, 26), * 'grey100' : (255, 255, 255), * 'grey11' : (28, 28, 28), # <<<<<<<<<<<<<< * 'grey12' : (31, 31, 31), * 'grey13' : (33, 33, 33), */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_u_grey11, __pyx_tuple__278) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":272 * 'grey100' : (255, 255, 255), * 'grey11' : (28, 28, 28), * 'grey12' : (31, 31, 31), # <<<<<<<<<<<<<< * 'grey13' : (33, 33, 33), * 'grey14' : (36, 36, 36), */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_u_grey12, __pyx_tuple__279) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":273 * 'grey11' : (28, 28, 28), * 'grey12' : (31, 31, 31), * 'grey13' : (33, 33, 33), # <<<<<<<<<<<<<< * 'grey14' : (36, 36, 36), * 'grey15' : (38, 38, 38), */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_u_grey13, __pyx_tuple__280) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":274 * 'grey12' : (31, 31, 31), * 'grey13' : (33, 33, 33), * 'grey14' : (36, 36, 36), # <<<<<<<<<<<<<< * 'grey15' : (38, 38, 38), * 'grey16' : (41, 41, 41), */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_u_grey14, __pyx_tuple__281) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":275 * 'grey13' : (33, 33, 33), * 'grey14' : (36, 36, 36), * 'grey15' : (38, 38, 38), # <<<<<<<<<<<<<< * 'grey16' : (41, 41, 41), * 'grey17' : (43, 43, 43), */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_u_grey15, __pyx_tuple__282) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":276 * 'grey14' : (36, 36, 36), * 'grey15' : (38, 38, 38), * 'grey16' : (41, 41, 41), # <<<<<<<<<<<<<< * 'grey17' : (43, 43, 43), * 'grey18' : (46, 46, 46), */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_u_grey16, __pyx_tuple__283) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":277 * 'grey15' : (38, 38, 38), * 'grey16' : (41, 41, 41), * 'grey17' : (43, 43, 43), # <<<<<<<<<<<<<< * 'grey18' : (46, 46, 46), * 'grey19' : (48, 48, 48), */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_u_grey17, __pyx_tuple__284) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":278 * 'grey16' : (41, 41, 41), * 'grey17' : (43, 43, 43), * 'grey18' : (46, 46, 46), # <<<<<<<<<<<<<< * 'grey19' : (48, 48, 48), * 'grey2' : (5, 5, 5), */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_u_grey18, __pyx_tuple__285) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":279 * 'grey17' : (43, 43, 43), * 'grey18' : (46, 46, 46), * 'grey19' : (48, 48, 48), # <<<<<<<<<<<<<< * 'grey2' : (5, 5, 5), * 'grey20' : (51, 51, 51), */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_u_grey19, __pyx_tuple__286) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":280 * 'grey18' : (46, 46, 46), * 'grey19' : (48, 48, 48), * 'grey2' : (5, 5, 5), # <<<<<<<<<<<<<< * 'grey20' : (51, 51, 51), * 'grey21' : (54, 54, 54), */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_u_grey2, __pyx_tuple__287) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":281 * 'grey19' : (48, 48, 48), * 'grey2' : (5, 5, 5), * 'grey20' : (51, 51, 51), # <<<<<<<<<<<<<< * 'grey21' : (54, 54, 54), * 'grey22' : (56, 56, 56), */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_u_grey20, __pyx_tuple__288) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":282 * 'grey2' : (5, 5, 5), * 'grey20' : (51, 51, 51), * 'grey21' : (54, 54, 54), # <<<<<<<<<<<<<< * 'grey22' : (56, 56, 56), * 'grey23' : (59, 59, 59), */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_u_grey21, __pyx_tuple__289) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":283 * 'grey20' : (51, 51, 51), * 'grey21' : (54, 54, 54), * 'grey22' : (56, 56, 56), # <<<<<<<<<<<<<< * 'grey23' : (59, 59, 59), * 'grey24' : (61, 61, 61), */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_u_grey22, __pyx_tuple__290) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":284 * 'grey21' : (54, 54, 54), * 'grey22' : (56, 56, 56), * 'grey23' : (59, 59, 59), # <<<<<<<<<<<<<< * 'grey24' : (61, 61, 61), * 'grey25' : (64, 64, 64), */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_u_grey23, __pyx_tuple__291) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":285 * 'grey22' : (56, 56, 56), * 'grey23' : (59, 59, 59), * 'grey24' : (61, 61, 61), # <<<<<<<<<<<<<< * 'grey25' : (64, 64, 64), * 'grey26' : (66, 66, 66), */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_u_grey24, __pyx_tuple__292) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":286 * 'grey23' : (59, 59, 59), * 'grey24' : (61, 61, 61), * 'grey25' : (64, 64, 64), # <<<<<<<<<<<<<< * 'grey26' : (66, 66, 66), * 'grey27' : (69, 69, 69), */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_u_grey25, __pyx_tuple__293) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":287 * 'grey24' : (61, 61, 61), * 'grey25' : (64, 64, 64), * 'grey26' : (66, 66, 66), # <<<<<<<<<<<<<< * 'grey27' : (69, 69, 69), * 'grey28' : (71, 71, 71), */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_u_grey26, __pyx_tuple__294) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":288 * 'grey25' : (64, 64, 64), * 'grey26' : (66, 66, 66), * 'grey27' : (69, 69, 69), # <<<<<<<<<<<<<< * 'grey28' : (71, 71, 71), * 'grey29' : (74, 74, 74), */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_u_grey27, __pyx_tuple__295) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":289 * 'grey26' : (66, 66, 66), * 'grey27' : (69, 69, 69), * 'grey28' : (71, 71, 71), # <<<<<<<<<<<<<< * 'grey29' : (74, 74, 74), * 'grey3' : (8, 8, 8), */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_u_grey28, __pyx_tuple__296) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":290 * 'grey27' : (69, 69, 69), * 'grey28' : (71, 71, 71), * 'grey29' : (74, 74, 74), # <<<<<<<<<<<<<< * 'grey3' : (8, 8, 8), * 'grey30' : (77, 77, 77), */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_u_grey29, __pyx_tuple__297) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":291 * 'grey28' : (71, 71, 71), * 'grey29' : (74, 74, 74), * 'grey3' : (8, 8, 8), # <<<<<<<<<<<<<< * 'grey30' : (77, 77, 77), * 'grey31' : (79, 79, 79), */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_u_grey3, __pyx_tuple__298) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":292 * 'grey29' : (74, 74, 74), * 'grey3' : (8, 8, 8), * 'grey30' : (77, 77, 77), # <<<<<<<<<<<<<< * 'grey31' : (79, 79, 79), * 'grey32' : (82, 82, 82), */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_u_grey30, __pyx_tuple__299) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":293 * 'grey3' : (8, 8, 8), * 'grey30' : (77, 77, 77), * 'grey31' : (79, 79, 79), # <<<<<<<<<<<<<< * 'grey32' : (82, 82, 82), * 'grey33' : (84, 84, 84), */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_u_grey31, __pyx_tuple__300) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":294 * 'grey30' : (77, 77, 77), * 'grey31' : (79, 79, 79), * 'grey32' : (82, 82, 82), # <<<<<<<<<<<<<< * 'grey33' : (84, 84, 84), * 'grey34' : (87, 87, 87), */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_u_grey32, __pyx_tuple__301) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":295 * 'grey31' : (79, 79, 79), * 'grey32' : (82, 82, 82), * 'grey33' : (84, 84, 84), # <<<<<<<<<<<<<< * 'grey34' : (87, 87, 87), * 'grey35' : (89, 89, 89), */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_u_grey33, __pyx_tuple__302) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":296 * 'grey32' : (82, 82, 82), * 'grey33' : (84, 84, 84), * 'grey34' : (87, 87, 87), # <<<<<<<<<<<<<< * 'grey35' : (89, 89, 89), * 'grey36' : (92, 92, 92), */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_u_grey34, __pyx_tuple__303) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":297 * 'grey33' : (84, 84, 84), * 'grey34' : (87, 87, 87), * 'grey35' : (89, 89, 89), # <<<<<<<<<<<<<< * 'grey36' : (92, 92, 92), * 'grey37' : (94, 94, 94), */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_u_grey35, __pyx_tuple__304) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":298 * 'grey34' : (87, 87, 87), * 'grey35' : (89, 89, 89), * 'grey36' : (92, 92, 92), # <<<<<<<<<<<<<< * 'grey37' : (94, 94, 94), * 'grey38' : (97, 97, 97), */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_u_grey36, __pyx_tuple__305) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":299 * 'grey35' : (89, 89, 89), * 'grey36' : (92, 92, 92), * 'grey37' : (94, 94, 94), # <<<<<<<<<<<<<< * 'grey38' : (97, 97, 97), * 'grey39' : (99, 99, 99), */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_u_grey37, __pyx_tuple__306) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":300 * 'grey36' : (92, 92, 92), * 'grey37' : (94, 94, 94), * 'grey38' : (97, 97, 97), # <<<<<<<<<<<<<< * 'grey39' : (99, 99, 99), * 'grey4' : (10, 10, 10), */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_u_grey38, __pyx_tuple__307) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":301 * 'grey37' : (94, 94, 94), * 'grey38' : (97, 97, 97), * 'grey39' : (99, 99, 99), # <<<<<<<<<<<<<< * 'grey4' : (10, 10, 10), * 'grey40' : (102, 102, 102), */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_u_grey39, __pyx_tuple__308) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":302 * 'grey38' : (97, 97, 97), * 'grey39' : (99, 99, 99), * 'grey4' : (10, 10, 10), # <<<<<<<<<<<<<< * 'grey40' : (102, 102, 102), * 'grey41' : (105, 105, 105), */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_u_grey4, __pyx_tuple__309) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":303 * 'grey39' : (99, 99, 99), * 'grey4' : (10, 10, 10), * 'grey40' : (102, 102, 102), # <<<<<<<<<<<<<< * 'grey41' : (105, 105, 105), * 'grey42' : (107, 107, 107), */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_u_grey40, __pyx_tuple__310) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":304 * 'grey4' : (10, 10, 10), * 'grey40' : (102, 102, 102), * 'grey41' : (105, 105, 105), # <<<<<<<<<<<<<< * 'grey42' : (107, 107, 107), * 'grey43' : (110, 110, 110), */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_u_grey41, __pyx_tuple__311) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":305 * 'grey40' : (102, 102, 102), * 'grey41' : (105, 105, 105), * 'grey42' : (107, 107, 107), # <<<<<<<<<<<<<< * 'grey43' : (110, 110, 110), * 'grey44' : (112, 112, 112), */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_u_grey42, __pyx_tuple__312) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":306 * 'grey41' : (105, 105, 105), * 'grey42' : (107, 107, 107), * 'grey43' : (110, 110, 110), # <<<<<<<<<<<<<< * 'grey44' : (112, 112, 112), * 'grey45' : (115, 115, 115), */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_u_grey43, __pyx_tuple__313) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":307 * 'grey42' : (107, 107, 107), * 'grey43' : (110, 110, 110), * 'grey44' : (112, 112, 112), # <<<<<<<<<<<<<< * 'grey45' : (115, 115, 115), * 'grey46' : (117, 117, 117), */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_u_grey44, __pyx_tuple__314) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":308 * 'grey43' : (110, 110, 110), * 'grey44' : (112, 112, 112), * 'grey45' : (115, 115, 115), # <<<<<<<<<<<<<< * 'grey46' : (117, 117, 117), * 'grey47' : (120, 120, 120), */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_u_grey45, __pyx_tuple__315) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":309 * 'grey44' : (112, 112, 112), * 'grey45' : (115, 115, 115), * 'grey46' : (117, 117, 117), # <<<<<<<<<<<<<< * 'grey47' : (120, 120, 120), * 'grey48' : (122, 122, 122), */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_u_grey46, __pyx_tuple__316) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":310 * 'grey45' : (115, 115, 115), * 'grey46' : (117, 117, 117), * 'grey47' : (120, 120, 120), # <<<<<<<<<<<<<< * 'grey48' : (122, 122, 122), * 'grey49' : (125, 125, 125), */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_u_grey47, __pyx_tuple__317) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":311 * 'grey46' : (117, 117, 117), * 'grey47' : (120, 120, 120), * 'grey48' : (122, 122, 122), # <<<<<<<<<<<<<< * 'grey49' : (125, 125, 125), * 'grey5' : (13, 13, 13), */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_u_grey48, __pyx_tuple__318) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":312 * 'grey47' : (120, 120, 120), * 'grey48' : (122, 122, 122), * 'grey49' : (125, 125, 125), # <<<<<<<<<<<<<< * 'grey5' : (13, 13, 13), * 'grey50' : (127, 127, 127), */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_u_grey49, __pyx_tuple__319) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":313 * 'grey48' : (122, 122, 122), * 'grey49' : (125, 125, 125), * 'grey5' : (13, 13, 13), # <<<<<<<<<<<<<< * 'grey50' : (127, 127, 127), * 'grey51' : (130, 130, 130), */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_u_grey5, __pyx_tuple__320) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":314 * 'grey49' : (125, 125, 125), * 'grey5' : (13, 13, 13), * 'grey50' : (127, 127, 127), # <<<<<<<<<<<<<< * 'grey51' : (130, 130, 130), * 'grey52' : (133, 133, 133), */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_u_grey50, __pyx_tuple__321) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":315 * 'grey5' : (13, 13, 13), * 'grey50' : (127, 127, 127), * 'grey51' : (130, 130, 130), # <<<<<<<<<<<<<< * 'grey52' : (133, 133, 133), * 'grey53' : (135, 135, 135), */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_u_grey51, __pyx_tuple__322) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":316 * 'grey50' : (127, 127, 127), * 'grey51' : (130, 130, 130), * 'grey52' : (133, 133, 133), # <<<<<<<<<<<<<< * 'grey53' : (135, 135, 135), * 'grey54' : (138, 138, 138), */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_u_grey52, __pyx_tuple__323) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":317 * 'grey51' : (130, 130, 130), * 'grey52' : (133, 133, 133), * 'grey53' : (135, 135, 135), # <<<<<<<<<<<<<< * 'grey54' : (138, 138, 138), * 'grey55' : (140, 140, 140), */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_u_grey53, __pyx_tuple__324) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":318 * 'grey52' : (133, 133, 133), * 'grey53' : (135, 135, 135), * 'grey54' : (138, 138, 138), # <<<<<<<<<<<<<< * 'grey55' : (140, 140, 140), * 'grey56' : (143, 143, 143), */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_u_grey54, __pyx_tuple__325) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":319 * 'grey53' : (135, 135, 135), * 'grey54' : (138, 138, 138), * 'grey55' : (140, 140, 140), # <<<<<<<<<<<<<< * 'grey56' : (143, 143, 143), * 'grey57' : (145, 145, 145), */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_u_grey55, __pyx_tuple__326) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":320 * 'grey54' : (138, 138, 138), * 'grey55' : (140, 140, 140), * 'grey56' : (143, 143, 143), # <<<<<<<<<<<<<< * 'grey57' : (145, 145, 145), * 'grey58' : (148, 148, 148), */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_u_grey56, __pyx_tuple__327) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":321 * 'grey55' : (140, 140, 140), * 'grey56' : (143, 143, 143), * 'grey57' : (145, 145, 145), # <<<<<<<<<<<<<< * 'grey58' : (148, 148, 148), * 'grey59' : (150, 150, 150), */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_u_grey57, __pyx_tuple__328) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":322 * 'grey56' : (143, 143, 143), * 'grey57' : (145, 145, 145), * 'grey58' : (148, 148, 148), # <<<<<<<<<<<<<< * 'grey59' : (150, 150, 150), * 'grey6' : (15, 15, 15), */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_u_grey58, __pyx_tuple__329) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":323 * 'grey57' : (145, 145, 145), * 'grey58' : (148, 148, 148), * 'grey59' : (150, 150, 150), # <<<<<<<<<<<<<< * 'grey6' : (15, 15, 15), * 'grey60' : (153, 153, 153), */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_u_grey59, __pyx_tuple__330) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":324 * 'grey58' : (148, 148, 148), * 'grey59' : (150, 150, 150), * 'grey6' : (15, 15, 15), # <<<<<<<<<<<<<< * 'grey60' : (153, 153, 153), * 'grey61' : (156, 156, 156), */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_u_grey6, __pyx_tuple__331) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":325 * 'grey59' : (150, 150, 150), * 'grey6' : (15, 15, 15), * 'grey60' : (153, 153, 153), # <<<<<<<<<<<<<< * 'grey61' : (156, 156, 156), * 'grey62' : (158, 158, 158), */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_u_grey60, __pyx_tuple__332) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":326 * 'grey6' : (15, 15, 15), * 'grey60' : (153, 153, 153), * 'grey61' : (156, 156, 156), # <<<<<<<<<<<<<< * 'grey62' : (158, 158, 158), * 'grey63' : (161, 161, 161), */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_u_grey61, __pyx_tuple__333) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":327 * 'grey60' : (153, 153, 153), * 'grey61' : (156, 156, 156), * 'grey62' : (158, 158, 158), # <<<<<<<<<<<<<< * 'grey63' : (161, 161, 161), * 'grey64' : (163, 163, 163), */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_u_grey62, __pyx_tuple__334) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":328 * 'grey61' : (156, 156, 156), * 'grey62' : (158, 158, 158), * 'grey63' : (161, 161, 161), # <<<<<<<<<<<<<< * 'grey64' : (163, 163, 163), * 'grey65' : (166, 166, 166), */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_u_grey63, __pyx_tuple__335) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":329 * 'grey62' : (158, 158, 158), * 'grey63' : (161, 161, 161), * 'grey64' : (163, 163, 163), # <<<<<<<<<<<<<< * 'grey65' : (166, 166, 166), * 'grey66' : (168, 168, 168), */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_u_grey64, __pyx_tuple__336) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":330 * 'grey63' : (161, 161, 161), * 'grey64' : (163, 163, 163), * 'grey65' : (166, 166, 166), # <<<<<<<<<<<<<< * 'grey66' : (168, 168, 168), * 'grey67' : (171, 171, 171), */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_u_grey65, __pyx_tuple__337) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":331 * 'grey64' : (163, 163, 163), * 'grey65' : (166, 166, 166), * 'grey66' : (168, 168, 168), # <<<<<<<<<<<<<< * 'grey67' : (171, 171, 171), * 'grey68' : (173, 173, 173), */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_u_grey66, __pyx_tuple__338) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":332 * 'grey65' : (166, 166, 166), * 'grey66' : (168, 168, 168), * 'grey67' : (171, 171, 171), # <<<<<<<<<<<<<< * 'grey68' : (173, 173, 173), * 'grey69' : (176, 176, 176), */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_u_grey67, __pyx_tuple__339) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":333 * 'grey66' : (168, 168, 168), * 'grey67' : (171, 171, 171), * 'grey68' : (173, 173, 173), # <<<<<<<<<<<<<< * 'grey69' : (176, 176, 176), * 'grey7' : (18, 18, 18), */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_u_grey68, __pyx_tuple__340) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":334 * 'grey67' : (171, 171, 171), * 'grey68' : (173, 173, 173), * 'grey69' : (176, 176, 176), # <<<<<<<<<<<<<< * 'grey7' : (18, 18, 18), * 'grey70' : (179, 179, 179), */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_u_grey69, __pyx_tuple__341) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":335 * 'grey68' : (173, 173, 173), * 'grey69' : (176, 176, 176), * 'grey7' : (18, 18, 18), # <<<<<<<<<<<<<< * 'grey70' : (179, 179, 179), * 'grey71' : (181, 181, 181), */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_u_grey7, __pyx_tuple__342) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":336 * 'grey69' : (176, 176, 176), * 'grey7' : (18, 18, 18), * 'grey70' : (179, 179, 179), # <<<<<<<<<<<<<< * 'grey71' : (181, 181, 181), * 'grey72' : (184, 184, 184), */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_u_grey70, __pyx_tuple__343) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":337 * 'grey7' : (18, 18, 18), * 'grey70' : (179, 179, 179), * 'grey71' : (181, 181, 181), # <<<<<<<<<<<<<< * 'grey72' : (184, 184, 184), * 'grey73' : (186, 186, 186), */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_u_grey71, __pyx_tuple__344) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":338 * 'grey70' : (179, 179, 179), * 'grey71' : (181, 181, 181), * 'grey72' : (184, 184, 184), # <<<<<<<<<<<<<< * 'grey73' : (186, 186, 186), * 'grey74' : (189, 189, 189), */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_u_grey72, __pyx_tuple__345) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":339 * 'grey71' : (181, 181, 181), * 'grey72' : (184, 184, 184), * 'grey73' : (186, 186, 186), # <<<<<<<<<<<<<< * 'grey74' : (189, 189, 189), * 'grey75' : (191, 191, 191), */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_u_grey73, __pyx_tuple__346) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":340 * 'grey72' : (184, 184, 184), * 'grey73' : (186, 186, 186), * 'grey74' : (189, 189, 189), # <<<<<<<<<<<<<< * 'grey75' : (191, 191, 191), * 'grey76' : (194, 194, 194), */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_u_grey74, __pyx_tuple__347) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":341 * 'grey73' : (186, 186, 186), * 'grey74' : (189, 189, 189), * 'grey75' : (191, 191, 191), # <<<<<<<<<<<<<< * 'grey76' : (194, 194, 194), * 'grey77' : (196, 196, 196), */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_u_grey75, __pyx_tuple__348) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":342 * 'grey74' : (189, 189, 189), * 'grey75' : (191, 191, 191), * 'grey76' : (194, 194, 194), # <<<<<<<<<<<<<< * 'grey77' : (196, 196, 196), * 'grey78' : (199, 199, 199), */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_u_grey76, __pyx_tuple__349) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":343 * 'grey75' : (191, 191, 191), * 'grey76' : (194, 194, 194), * 'grey77' : (196, 196, 196), # <<<<<<<<<<<<<< * 'grey78' : (199, 199, 199), * 'grey79' : (201, 201, 201), */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_u_grey77, __pyx_tuple__350) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":344 * 'grey76' : (194, 194, 194), * 'grey77' : (196, 196, 196), * 'grey78' : (199, 199, 199), # <<<<<<<<<<<<<< * 'grey79' : (201, 201, 201), * 'grey8' : (20, 20, 20), */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_u_grey78, __pyx_tuple__351) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":345 * 'grey77' : (196, 196, 196), * 'grey78' : (199, 199, 199), * 'grey79' : (201, 201, 201), # <<<<<<<<<<<<<< * 'grey8' : (20, 20, 20), * 'grey80' : (204, 204, 204), */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_u_grey79, __pyx_tuple__352) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":346 * 'grey78' : (199, 199, 199), * 'grey79' : (201, 201, 201), * 'grey8' : (20, 20, 20), # <<<<<<<<<<<<<< * 'grey80' : (204, 204, 204), * 'grey81' : (207, 207, 207), */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_u_grey8, __pyx_tuple__353) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":347 * 'grey79' : (201, 201, 201), * 'grey8' : (20, 20, 20), * 'grey80' : (204, 204, 204), # <<<<<<<<<<<<<< * 'grey81' : (207, 207, 207), * 'grey82' : (209, 209, 209), */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_u_grey80, __pyx_tuple__354) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":348 * 'grey8' : (20, 20, 20), * 'grey80' : (204, 204, 204), * 'grey81' : (207, 207, 207), # <<<<<<<<<<<<<< * 'grey82' : (209, 209, 209), * 'grey83' : (212, 212, 212), */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_u_grey81, __pyx_tuple__355) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":349 * 'grey80' : (204, 204, 204), * 'grey81' : (207, 207, 207), * 'grey82' : (209, 209, 209), # <<<<<<<<<<<<<< * 'grey83' : (212, 212, 212), * 'grey84' : (214, 214, 214), */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_u_grey82, __pyx_tuple__356) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":350 * 'grey81' : (207, 207, 207), * 'grey82' : (209, 209, 209), * 'grey83' : (212, 212, 212), # <<<<<<<<<<<<<< * 'grey84' : (214, 214, 214), * 'grey85' : (217, 217, 217), */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_u_grey83, __pyx_tuple__357) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":351 * 'grey82' : (209, 209, 209), * 'grey83' : (212, 212, 212), * 'grey84' : (214, 214, 214), # <<<<<<<<<<<<<< * 'grey85' : (217, 217, 217), * 'grey86' : (219, 219, 219), */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_u_grey84, __pyx_tuple__358) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":352 * 'grey83' : (212, 212, 212), * 'grey84' : (214, 214, 214), * 'grey85' : (217, 217, 217), # <<<<<<<<<<<<<< * 'grey86' : (219, 219, 219), * 'grey87' : (222, 222, 222), */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_u_grey85, __pyx_tuple__359) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":353 * 'grey84' : (214, 214, 214), * 'grey85' : (217, 217, 217), * 'grey86' : (219, 219, 219), # <<<<<<<<<<<<<< * 'grey87' : (222, 222, 222), * 'grey88' : (224, 224, 224), */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_u_grey86, __pyx_tuple__360) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":354 * 'grey85' : (217, 217, 217), * 'grey86' : (219, 219, 219), * 'grey87' : (222, 222, 222), # <<<<<<<<<<<<<< * 'grey88' : (224, 224, 224), * 'grey89' : (227, 227, 227), */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_u_grey87, __pyx_tuple__361) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":355 * 'grey86' : (219, 219, 219), * 'grey87' : (222, 222, 222), * 'grey88' : (224, 224, 224), # <<<<<<<<<<<<<< * 'grey89' : (227, 227, 227), * 'grey9' : (23, 23, 23), */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_u_grey88, __pyx_tuple__362) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":356 * 'grey87' : (222, 222, 222), * 'grey88' : (224, 224, 224), * 'grey89' : (227, 227, 227), # <<<<<<<<<<<<<< * 'grey9' : (23, 23, 23), * 'grey90' : (229, 229, 229), */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_u_grey89, __pyx_tuple__363) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":357 * 'grey88' : (224, 224, 224), * 'grey89' : (227, 227, 227), * 'grey9' : (23, 23, 23), # <<<<<<<<<<<<<< * 'grey90' : (229, 229, 229), * 'grey91' : (232, 232, 232), */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_u_grey9, __pyx_tuple__364) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":358 * 'grey89' : (227, 227, 227), * 'grey9' : (23, 23, 23), * 'grey90' : (229, 229, 229), # <<<<<<<<<<<<<< * 'grey91' : (232, 232, 232), * 'grey92' : (235, 235, 235), */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_u_grey90, __pyx_tuple__365) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":359 * 'grey9' : (23, 23, 23), * 'grey90' : (229, 229, 229), * 'grey91' : (232, 232, 232), # <<<<<<<<<<<<<< * 'grey92' : (235, 235, 235), * 'grey93' : (237, 237, 237), */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_u_grey91, __pyx_tuple__366) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":360 * 'grey90' : (229, 229, 229), * 'grey91' : (232, 232, 232), * 'grey92' : (235, 235, 235), # <<<<<<<<<<<<<< * 'grey93' : (237, 237, 237), * 'grey94' : (240, 240, 240), */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_u_grey92, __pyx_tuple__367) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":361 * 'grey91' : (232, 232, 232), * 'grey92' : (235, 235, 235), * 'grey93' : (237, 237, 237), # <<<<<<<<<<<<<< * 'grey94' : (240, 240, 240), * 'grey95' : (242, 242, 242), */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_u_grey93, __pyx_tuple__368) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":362 * 'grey92' : (235, 235, 235), * 'grey93' : (237, 237, 237), * 'grey94' : (240, 240, 240), # <<<<<<<<<<<<<< * 'grey95' : (242, 242, 242), * 'grey96' : (245, 245, 245), */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_u_grey94, __pyx_tuple__369) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":363 * 'grey93' : (237, 237, 237), * 'grey94' : (240, 240, 240), * 'grey95' : (242, 242, 242), # <<<<<<<<<<<<<< * 'grey96' : (245, 245, 245), * 'grey97' : (247, 247, 247), */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_u_grey95, __pyx_tuple__370) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":364 * 'grey94' : (240, 240, 240), * 'grey95' : (242, 242, 242), * 'grey96' : (245, 245, 245), # <<<<<<<<<<<<<< * 'grey97' : (247, 247, 247), * 'grey98' : (250, 250, 250), */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_u_grey96, __pyx_tuple__371) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":365 * 'grey95' : (242, 242, 242), * 'grey96' : (245, 245, 245), * 'grey97' : (247, 247, 247), # <<<<<<<<<<<<<< * 'grey98' : (250, 250, 250), * 'grey99' : (252, 252, 252), */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_u_grey97, __pyx_tuple__372) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":366 * 'grey96' : (245, 245, 245), * 'grey97' : (247, 247, 247), * 'grey98' : (250, 250, 250), # <<<<<<<<<<<<<< * 'grey99' : (252, 252, 252), * 'honeydew' : (240, 255, 240), */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_u_grey98, __pyx_tuple__373) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":367 * 'grey97' : (247, 247, 247), * 'grey98' : (250, 250, 250), * 'grey99' : (252, 252, 252), # <<<<<<<<<<<<<< * 'honeydew' : (240, 255, 240), * 'honeydew1' : (240, 255, 240), */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_u_grey99, __pyx_tuple__374) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":368 * 'grey98' : (250, 250, 250), * 'grey99' : (252, 252, 252), * 'honeydew' : (240, 255, 240), # <<<<<<<<<<<<<< * 'honeydew1' : (240, 255, 240), * 'honeydew2' : (224, 238, 224), */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_u_honeydew, __pyx_tuple__375) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":369 * 'grey99' : (252, 252, 252), * 'honeydew' : (240, 255, 240), * 'honeydew1' : (240, 255, 240), # <<<<<<<<<<<<<< * 'honeydew2' : (224, 238, 224), * 'honeydew3' : (193, 205, 193), */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_u_honeydew1, __pyx_tuple__376) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":370 * 'honeydew' : (240, 255, 240), * 'honeydew1' : (240, 255, 240), * 'honeydew2' : (224, 238, 224), # <<<<<<<<<<<<<< * 'honeydew3' : (193, 205, 193), * 'honeydew4' : (131, 139, 131), */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_u_honeydew2, __pyx_tuple__377) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":371 * 'honeydew1' : (240, 255, 240), * 'honeydew2' : (224, 238, 224), * 'honeydew3' : (193, 205, 193), # <<<<<<<<<<<<<< * 'honeydew4' : (131, 139, 131), * 'hotpink' : (255, 105, 180), */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_u_honeydew3, __pyx_tuple__378) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":372 * 'honeydew2' : (224, 238, 224), * 'honeydew3' : (193, 205, 193), * 'honeydew4' : (131, 139, 131), # <<<<<<<<<<<<<< * 'hotpink' : (255, 105, 180), * 'hotpink1' : (255, 110, 180), */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_u_honeydew4, __pyx_tuple__379) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":373 * 'honeydew3' : (193, 205, 193), * 'honeydew4' : (131, 139, 131), * 'hotpink' : (255, 105, 180), # <<<<<<<<<<<<<< * 'hotpink1' : (255, 110, 180), * 'hotpink2' : (238, 106, 167), */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_u_hotpink, __pyx_tuple__380) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":374 * 'honeydew4' : (131, 139, 131), * 'hotpink' : (255, 105, 180), * 'hotpink1' : (255, 110, 180), # <<<<<<<<<<<<<< * 'hotpink2' : (238, 106, 167), * 'hotpink3' : (205, 96, 144), */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_u_hotpink1, __pyx_tuple__381) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":375 * 'hotpink' : (255, 105, 180), * 'hotpink1' : (255, 110, 180), * 'hotpink2' : (238, 106, 167), # <<<<<<<<<<<<<< * 'hotpink3' : (205, 96, 144), * 'hotpink4' : (139, 58, 98), */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_u_hotpink2, __pyx_tuple__382) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":376 * 'hotpink1' : (255, 110, 180), * 'hotpink2' : (238, 106, 167), * 'hotpink3' : (205, 96, 144), # <<<<<<<<<<<<<< * 'hotpink4' : (139, 58, 98), * 'indianred' : (205, 92, 92), */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_u_hotpink3, __pyx_tuple__383) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":377 * 'hotpink2' : (238, 106, 167), * 'hotpink3' : (205, 96, 144), * 'hotpink4' : (139, 58, 98), # <<<<<<<<<<<<<< * 'indianred' : (205, 92, 92), * 'indianred1' : (255, 106, 106), */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_u_hotpink4, __pyx_tuple__384) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":378 * 'hotpink3' : (205, 96, 144), * 'hotpink4' : (139, 58, 98), * 'indianred' : (205, 92, 92), # <<<<<<<<<<<<<< * 'indianred1' : (255, 106, 106), * 'indianred2' : (238, 99, 99), */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_u_indianred, __pyx_tuple__385) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":379 * 'hotpink4' : (139, 58, 98), * 'indianred' : (205, 92, 92), * 'indianred1' : (255, 106, 106), # <<<<<<<<<<<<<< * 'indianred2' : (238, 99, 99), * 'indianred3' : (205, 85, 85), */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_u_indianred1, __pyx_tuple__386) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":380 * 'indianred' : (205, 92, 92), * 'indianred1' : (255, 106, 106), * 'indianred2' : (238, 99, 99), # <<<<<<<<<<<<<< * 'indianred3' : (205, 85, 85), * 'indianred4' : (139, 58, 58), */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_u_indianred2, __pyx_tuple__387) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":381 * 'indianred1' : (255, 106, 106), * 'indianred2' : (238, 99, 99), * 'indianred3' : (205, 85, 85), # <<<<<<<<<<<<<< * 'indianred4' : (139, 58, 58), * 'indigo' : (75, 0, 130), */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_u_indianred3, __pyx_tuple__388) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":382 * 'indianred2' : (238, 99, 99), * 'indianred3' : (205, 85, 85), * 'indianred4' : (139, 58, 58), # <<<<<<<<<<<<<< * 'indigo' : (75, 0, 130), * 'ivory' : (255, 255, 240), */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_u_indianred4, __pyx_tuple__389) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":383 * 'indianred3' : (205, 85, 85), * 'indianred4' : (139, 58, 58), * 'indigo' : (75, 0, 130), # <<<<<<<<<<<<<< * 'ivory' : (255, 255, 240), * 'ivory1' : (255, 255, 240), */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_u_indigo, __pyx_tuple__390) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":384 * 'indianred4' : (139, 58, 58), * 'indigo' : (75, 0, 130), * 'ivory' : (255, 255, 240), # <<<<<<<<<<<<<< * 'ivory1' : (255, 255, 240), * 'ivory2' : (238, 238, 224), */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_u_ivory, __pyx_tuple__391) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":385 * 'indigo' : (75, 0, 130), * 'ivory' : (255, 255, 240), * 'ivory1' : (255, 255, 240), # <<<<<<<<<<<<<< * 'ivory2' : (238, 238, 224), * 'ivory3' : (205, 205, 193), */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_u_ivory1, __pyx_tuple__392) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":386 * 'ivory' : (255, 255, 240), * 'ivory1' : (255, 255, 240), * 'ivory2' : (238, 238, 224), # <<<<<<<<<<<<<< * 'ivory3' : (205, 205, 193), * 'ivory4' : (139, 139, 131), */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_u_ivory2, __pyx_tuple__393) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":387 * 'ivory1' : (255, 255, 240), * 'ivory2' : (238, 238, 224), * 'ivory3' : (205, 205, 193), # <<<<<<<<<<<<<< * 'ivory4' : (139, 139, 131), * 'khaki' : (240, 230, 140), */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_u_ivory3, __pyx_tuple__394) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":388 * 'ivory2' : (238, 238, 224), * 'ivory3' : (205, 205, 193), * 'ivory4' : (139, 139, 131), # <<<<<<<<<<<<<< * 'khaki' : (240, 230, 140), * 'khaki1' : (255, 246, 143), */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_u_ivory4, __pyx_tuple__395) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":389 * 'ivory3' : (205, 205, 193), * 'ivory4' : (139, 139, 131), * 'khaki' : (240, 230, 140), # <<<<<<<<<<<<<< * 'khaki1' : (255, 246, 143), * 'khaki2' : (238, 230, 133), */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_u_khaki, __pyx_tuple__396) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":390 * 'ivory4' : (139, 139, 131), * 'khaki' : (240, 230, 140), * 'khaki1' : (255, 246, 143), # <<<<<<<<<<<<<< * 'khaki2' : (238, 230, 133), * 'khaki3' : (205, 198, 115), */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_u_khaki1, __pyx_tuple__397) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":391 * 'khaki' : (240, 230, 140), * 'khaki1' : (255, 246, 143), * 'khaki2' : (238, 230, 133), # <<<<<<<<<<<<<< * 'khaki3' : (205, 198, 115), * 'khaki4' : (139, 134, 78), */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_u_khaki2, __pyx_tuple__398) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":392 * 'khaki1' : (255, 246, 143), * 'khaki2' : (238, 230, 133), * 'khaki3' : (205, 198, 115), # <<<<<<<<<<<<<< * 'khaki4' : (139, 134, 78), * 'lavender' : (230, 230, 250), */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_u_khaki3, __pyx_tuple__399) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":393 * 'khaki2' : (238, 230, 133), * 'khaki3' : (205, 198, 115), * 'khaki4' : (139, 134, 78), # <<<<<<<<<<<<<< * 'lavender' : (230, 230, 250), * 'lavenderblush' : (255, 240, 245), */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_u_khaki4, __pyx_tuple__400) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":394 * 'khaki3' : (205, 198, 115), * 'khaki4' : (139, 134, 78), * 'lavender' : (230, 230, 250), # <<<<<<<<<<<<<< * 'lavenderblush' : (255, 240, 245), * 'lavenderblush1' : (255, 240, 245), */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_u_lavender, __pyx_tuple__401) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":395 * 'khaki4' : (139, 134, 78), * 'lavender' : (230, 230, 250), * 'lavenderblush' : (255, 240, 245), # <<<<<<<<<<<<<< * 'lavenderblush1' : (255, 240, 245), * 'lavenderblush2' : (238, 224, 229), */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_u_lavenderblush, __pyx_tuple__402) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":396 * 'lavender' : (230, 230, 250), * 'lavenderblush' : (255, 240, 245), * 'lavenderblush1' : (255, 240, 245), # <<<<<<<<<<<<<< * 'lavenderblush2' : (238, 224, 229), * 'lavenderblush3' : (205, 193, 197), */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_u_lavenderblush1, __pyx_tuple__403) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":397 * 'lavenderblush' : (255, 240, 245), * 'lavenderblush1' : (255, 240, 245), * 'lavenderblush2' : (238, 224, 229), # <<<<<<<<<<<<<< * 'lavenderblush3' : (205, 193, 197), * 'lavenderblush4' : (139, 131, 134), */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_u_lavenderblush2, __pyx_tuple__404) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":398 * 'lavenderblush1' : (255, 240, 245), * 'lavenderblush2' : (238, 224, 229), * 'lavenderblush3' : (205, 193, 197), # <<<<<<<<<<<<<< * 'lavenderblush4' : (139, 131, 134), * 'lawngreen' : (124, 252, 0), */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_u_lavenderblush3, __pyx_tuple__405) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":399 * 'lavenderblush2' : (238, 224, 229), * 'lavenderblush3' : (205, 193, 197), * 'lavenderblush4' : (139, 131, 134), # <<<<<<<<<<<<<< * 'lawngreen' : (124, 252, 0), * 'lemonchiffon' : (255, 250, 205), */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_u_lavenderblush4, __pyx_tuple__406) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":400 * 'lavenderblush3' : (205, 193, 197), * 'lavenderblush4' : (139, 131, 134), * 'lawngreen' : (124, 252, 0), # <<<<<<<<<<<<<< * 'lemonchiffon' : (255, 250, 205), * 'lemonchiffon1' : (255, 250, 205), */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_u_lawngreen, __pyx_tuple__407) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":401 * 'lavenderblush4' : (139, 131, 134), * 'lawngreen' : (124, 252, 0), * 'lemonchiffon' : (255, 250, 205), # <<<<<<<<<<<<<< * 'lemonchiffon1' : (255, 250, 205), * 'lemonchiffon2' : (238, 233, 191), */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_u_lemonchiffon, __pyx_tuple__408) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":402 * 'lawngreen' : (124, 252, 0), * 'lemonchiffon' : (255, 250, 205), * 'lemonchiffon1' : (255, 250, 205), # <<<<<<<<<<<<<< * 'lemonchiffon2' : (238, 233, 191), * 'lemonchiffon3' : (205, 201, 165), */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_u_lemonchiffon1, __pyx_tuple__409) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":403 * 'lemonchiffon' : (255, 250, 205), * 'lemonchiffon1' : (255, 250, 205), * 'lemonchiffon2' : (238, 233, 191), # <<<<<<<<<<<<<< * 'lemonchiffon3' : (205, 201, 165), * 'lemonchiffon4' : (139, 137, 112), */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_u_lemonchiffon2, __pyx_tuple__410) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":404 * 'lemonchiffon1' : (255, 250, 205), * 'lemonchiffon2' : (238, 233, 191), * 'lemonchiffon3' : (205, 201, 165), # <<<<<<<<<<<<<< * 'lemonchiffon4' : (139, 137, 112), * 'lightblue' : (173, 216, 230), */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_u_lemonchiffon3, __pyx_tuple__411) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":405 * 'lemonchiffon2' : (238, 233, 191), * 'lemonchiffon3' : (205, 201, 165), * 'lemonchiffon4' : (139, 137, 112), # <<<<<<<<<<<<<< * 'lightblue' : (173, 216, 230), * 'lightblue1' : (191, 239, 255), */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_u_lemonchiffon4, __pyx_tuple__412) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":406 * 'lemonchiffon3' : (205, 201, 165), * 'lemonchiffon4' : (139, 137, 112), * 'lightblue' : (173, 216, 230), # <<<<<<<<<<<<<< * 'lightblue1' : (191, 239, 255), * 'lightblue2' : (178, 223, 238), */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_u_lightblue, __pyx_tuple__413) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":407 * 'lemonchiffon4' : (139, 137, 112), * 'lightblue' : (173, 216, 230), * 'lightblue1' : (191, 239, 255), # <<<<<<<<<<<<<< * 'lightblue2' : (178, 223, 238), * 'lightblue3' : (154, 192, 205), */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_u_lightblue1, __pyx_tuple__414) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":408 * 'lightblue' : (173, 216, 230), * 'lightblue1' : (191, 239, 255), * 'lightblue2' : (178, 223, 238), # <<<<<<<<<<<<<< * 'lightblue3' : (154, 192, 205), * 'lightblue4' : (104, 131, 139), */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_u_lightblue2, __pyx_tuple__415) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":409 * 'lightblue1' : (191, 239, 255), * 'lightblue2' : (178, 223, 238), * 'lightblue3' : (154, 192, 205), # <<<<<<<<<<<<<< * 'lightblue4' : (104, 131, 139), * 'lightcoral' : (240, 128, 128), */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_u_lightblue3, __pyx_tuple__416) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":410 * 'lightblue2' : (178, 223, 238), * 'lightblue3' : (154, 192, 205), * 'lightblue4' : (104, 131, 139), # <<<<<<<<<<<<<< * 'lightcoral' : (240, 128, 128), * 'lightcyan' : (224, 255, 255), */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_u_lightblue4, __pyx_tuple__417) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":411 * 'lightblue3' : (154, 192, 205), * 'lightblue4' : (104, 131, 139), * 'lightcoral' : (240, 128, 128), # <<<<<<<<<<<<<< * 'lightcyan' : (224, 255, 255), * 'lightcyan1' : (224, 255, 255), */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_u_lightcoral, __pyx_tuple__418) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":412 * 'lightblue4' : (104, 131, 139), * 'lightcoral' : (240, 128, 128), * 'lightcyan' : (224, 255, 255), # <<<<<<<<<<<<<< * 'lightcyan1' : (224, 255, 255), * 'lightcyan2' : (209, 238, 238), */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_u_lightcyan, __pyx_tuple__419) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":413 * 'lightcoral' : (240, 128, 128), * 'lightcyan' : (224, 255, 255), * 'lightcyan1' : (224, 255, 255), # <<<<<<<<<<<<<< * 'lightcyan2' : (209, 238, 238), * 'lightcyan3' : (180, 205, 205), */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_u_lightcyan1, __pyx_tuple__420) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":414 * 'lightcyan' : (224, 255, 255), * 'lightcyan1' : (224, 255, 255), * 'lightcyan2' : (209, 238, 238), # <<<<<<<<<<<<<< * 'lightcyan3' : (180, 205, 205), * 'lightcyan4' : (122, 139, 139), */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_u_lightcyan2, __pyx_tuple__421) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":415 * 'lightcyan1' : (224, 255, 255), * 'lightcyan2' : (209, 238, 238), * 'lightcyan3' : (180, 205, 205), # <<<<<<<<<<<<<< * 'lightcyan4' : (122, 139, 139), * 'lightgoldenrod' : (238, 221, 130), */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_u_lightcyan3, __pyx_tuple__422) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":416 * 'lightcyan2' : (209, 238, 238), * 'lightcyan3' : (180, 205, 205), * 'lightcyan4' : (122, 139, 139), # <<<<<<<<<<<<<< * 'lightgoldenrod' : (238, 221, 130), * 'lightgoldenrod1' : (255, 236, 139), */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_u_lightcyan4, __pyx_tuple__423) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":417 * 'lightcyan3' : (180, 205, 205), * 'lightcyan4' : (122, 139, 139), * 'lightgoldenrod' : (238, 221, 130), # <<<<<<<<<<<<<< * 'lightgoldenrod1' : (255, 236, 139), * 'lightgoldenrod2' : (238, 220, 130), */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_u_lightgoldenrod, __pyx_tuple__424) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":418 * 'lightcyan4' : (122, 139, 139), * 'lightgoldenrod' : (238, 221, 130), * 'lightgoldenrod1' : (255, 236, 139), # <<<<<<<<<<<<<< * 'lightgoldenrod2' : (238, 220, 130), * 'lightgoldenrod3' : (205, 190, 112), */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_u_lightgoldenrod1, __pyx_tuple__425) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":419 * 'lightgoldenrod' : (238, 221, 130), * 'lightgoldenrod1' : (255, 236, 139), * 'lightgoldenrod2' : (238, 220, 130), # <<<<<<<<<<<<<< * 'lightgoldenrod3' : (205, 190, 112), * 'lightgoldenrod4' : (139, 129, 76), */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_u_lightgoldenrod2, __pyx_tuple__426) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":420 * 'lightgoldenrod1' : (255, 236, 139), * 'lightgoldenrod2' : (238, 220, 130), * 'lightgoldenrod3' : (205, 190, 112), # <<<<<<<<<<<<<< * 'lightgoldenrod4' : (139, 129, 76), * 'lightgoldenrodyellow' : (250, 250, 210), */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_u_lightgoldenrod3, __pyx_tuple__427) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":421 * 'lightgoldenrod2' : (238, 220, 130), * 'lightgoldenrod3' : (205, 190, 112), * 'lightgoldenrod4' : (139, 129, 76), # <<<<<<<<<<<<<< * 'lightgoldenrodyellow' : (250, 250, 210), * 'lightgray' : (211, 211, 211), */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_u_lightgoldenrod4, __pyx_tuple__428) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":422 * 'lightgoldenrod3' : (205, 190, 112), * 'lightgoldenrod4' : (139, 129, 76), * 'lightgoldenrodyellow' : (250, 250, 210), # <<<<<<<<<<<<<< * 'lightgray' : (211, 211, 211), * 'lightgreen' : (144, 238, 144), */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_u_lightgoldenrodyellow, __pyx_tuple__429) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":423 * 'lightgoldenrod4' : (139, 129, 76), * 'lightgoldenrodyellow' : (250, 250, 210), * 'lightgray' : (211, 211, 211), # <<<<<<<<<<<<<< * 'lightgreen' : (144, 238, 144), * 'lightgrey' : (211, 211, 211), */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_u_lightgray, __pyx_tuple__430) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":424 * 'lightgoldenrodyellow' : (250, 250, 210), * 'lightgray' : (211, 211, 211), * 'lightgreen' : (144, 238, 144), # <<<<<<<<<<<<<< * 'lightgrey' : (211, 211, 211), * 'lightpink' : (255, 182, 193), */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_u_lightgreen, __pyx_tuple__431) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":425 * 'lightgray' : (211, 211, 211), * 'lightgreen' : (144, 238, 144), * 'lightgrey' : (211, 211, 211), # <<<<<<<<<<<<<< * 'lightpink' : (255, 182, 193), * 'lightpink1' : (255, 174, 185), */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_u_lightgrey, __pyx_tuple__432) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":426 * 'lightgreen' : (144, 238, 144), * 'lightgrey' : (211, 211, 211), * 'lightpink' : (255, 182, 193), # <<<<<<<<<<<<<< * 'lightpink1' : (255, 174, 185), * 'lightpink2' : (238, 162, 173), */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_u_lightpink, __pyx_tuple__433) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":427 * 'lightgrey' : (211, 211, 211), * 'lightpink' : (255, 182, 193), * 'lightpink1' : (255, 174, 185), # <<<<<<<<<<<<<< * 'lightpink2' : (238, 162, 173), * 'lightpink3' : (205, 140, 149), */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_u_lightpink1, __pyx_tuple__434) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":428 * 'lightpink' : (255, 182, 193), * 'lightpink1' : (255, 174, 185), * 'lightpink2' : (238, 162, 173), # <<<<<<<<<<<<<< * 'lightpink3' : (205, 140, 149), * 'lightpink4' : (139, 95, 101), */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_u_lightpink2, __pyx_tuple__435) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":429 * 'lightpink1' : (255, 174, 185), * 'lightpink2' : (238, 162, 173), * 'lightpink3' : (205, 140, 149), # <<<<<<<<<<<<<< * 'lightpink4' : (139, 95, 101), * 'lightsalmon' : (255, 160, 122), */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_u_lightpink3, __pyx_tuple__436) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":430 * 'lightpink2' : (238, 162, 173), * 'lightpink3' : (205, 140, 149), * 'lightpink4' : (139, 95, 101), # <<<<<<<<<<<<<< * 'lightsalmon' : (255, 160, 122), * 'lightsalmon1' : (255, 160, 122), */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_u_lightpink4, __pyx_tuple__437) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":431 * 'lightpink3' : (205, 140, 149), * 'lightpink4' : (139, 95, 101), * 'lightsalmon' : (255, 160, 122), # <<<<<<<<<<<<<< * 'lightsalmon1' : (255, 160, 122), * 'lightsalmon2' : (238, 149, 114), */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_u_lightsalmon, __pyx_tuple__438) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":432 * 'lightpink4' : (139, 95, 101), * 'lightsalmon' : (255, 160, 122), * 'lightsalmon1' : (255, 160, 122), # <<<<<<<<<<<<<< * 'lightsalmon2' : (238, 149, 114), * 'lightsalmon3' : (205, 129, 98), */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_u_lightsalmon1, __pyx_tuple__439) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":433 * 'lightsalmon' : (255, 160, 122), * 'lightsalmon1' : (255, 160, 122), * 'lightsalmon2' : (238, 149, 114), # <<<<<<<<<<<<<< * 'lightsalmon3' : (205, 129, 98), * 'lightsalmon4' : (139, 87, 66), */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_u_lightsalmon2, __pyx_tuple__440) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":434 * 'lightsalmon1' : (255, 160, 122), * 'lightsalmon2' : (238, 149, 114), * 'lightsalmon3' : (205, 129, 98), # <<<<<<<<<<<<<< * 'lightsalmon4' : (139, 87, 66), * 'lightseagreen' : (32, 178, 170), */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_u_lightsalmon3, __pyx_tuple__441) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":435 * 'lightsalmon2' : (238, 149, 114), * 'lightsalmon3' : (205, 129, 98), * 'lightsalmon4' : (139, 87, 66), # <<<<<<<<<<<<<< * 'lightseagreen' : (32, 178, 170), * 'lightskyblue' : (135, 206, 250), */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_u_lightsalmon4, __pyx_tuple__442) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":436 * 'lightsalmon3' : (205, 129, 98), * 'lightsalmon4' : (139, 87, 66), * 'lightseagreen' : (32, 178, 170), # <<<<<<<<<<<<<< * 'lightskyblue' : (135, 206, 250), * 'lightskyblue1' : (176, 226, 255), */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_u_lightseagreen, __pyx_tuple__443) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":437 * 'lightsalmon4' : (139, 87, 66), * 'lightseagreen' : (32, 178, 170), * 'lightskyblue' : (135, 206, 250), # <<<<<<<<<<<<<< * 'lightskyblue1' : (176, 226, 255), * 'lightskyblue2' : (164, 211, 238), */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_u_lightskyblue, __pyx_tuple__444) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":438 * 'lightseagreen' : (32, 178, 170), * 'lightskyblue' : (135, 206, 250), * 'lightskyblue1' : (176, 226, 255), # <<<<<<<<<<<<<< * 'lightskyblue2' : (164, 211, 238), * 'lightskyblue3' : (141, 182, 205), */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_u_lightskyblue1, __pyx_tuple__445) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":439 * 'lightskyblue' : (135, 206, 250), * 'lightskyblue1' : (176, 226, 255), * 'lightskyblue2' : (164, 211, 238), # <<<<<<<<<<<<<< * 'lightskyblue3' : (141, 182, 205), * 'lightskyblue4' : (96, 123, 139), */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_u_lightskyblue2, __pyx_tuple__446) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":440 * 'lightskyblue1' : (176, 226, 255), * 'lightskyblue2' : (164, 211, 238), * 'lightskyblue3' : (141, 182, 205), # <<<<<<<<<<<<<< * 'lightskyblue4' : (96, 123, 139), * 'lightslateblue' : (132, 112, 255), */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_u_lightskyblue3, __pyx_tuple__447) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":441 * 'lightskyblue2' : (164, 211, 238), * 'lightskyblue3' : (141, 182, 205), * 'lightskyblue4' : (96, 123, 139), # <<<<<<<<<<<<<< * 'lightslateblue' : (132, 112, 255), * 'lightslategray' : (119, 136, 153), */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_u_lightskyblue4, __pyx_tuple__448) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":442 * 'lightskyblue3' : (141, 182, 205), * 'lightskyblue4' : (96, 123, 139), * 'lightslateblue' : (132, 112, 255), # <<<<<<<<<<<<<< * 'lightslategray' : (119, 136, 153), * 'lightslategrey' : (119, 136, 153), */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_u_lightslateblue, __pyx_tuple__449) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":443 * 'lightskyblue4' : (96, 123, 139), * 'lightslateblue' : (132, 112, 255), * 'lightslategray' : (119, 136, 153), # <<<<<<<<<<<<<< * 'lightslategrey' : (119, 136, 153), * 'lightsteelblue' : (176, 196, 222), */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_u_lightslategray, __pyx_tuple__450) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":444 * 'lightslateblue' : (132, 112, 255), * 'lightslategray' : (119, 136, 153), * 'lightslategrey' : (119, 136, 153), # <<<<<<<<<<<<<< * 'lightsteelblue' : (176, 196, 222), * 'lightsteelblue1' : (202, 225, 255), */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_u_lightslategrey, __pyx_tuple__451) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":445 * 'lightslategray' : (119, 136, 153), * 'lightslategrey' : (119, 136, 153), * 'lightsteelblue' : (176, 196, 222), # <<<<<<<<<<<<<< * 'lightsteelblue1' : (202, 225, 255), * 'lightsteelblue2' : (188, 210, 238), */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_u_lightsteelblue, __pyx_tuple__452) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":446 * 'lightslategrey' : (119, 136, 153), * 'lightsteelblue' : (176, 196, 222), * 'lightsteelblue1' : (202, 225, 255), # <<<<<<<<<<<<<< * 'lightsteelblue2' : (188, 210, 238), * 'lightsteelblue3' : (162, 181, 205), */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_u_lightsteelblue1, __pyx_tuple__453) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":447 * 'lightsteelblue' : (176, 196, 222), * 'lightsteelblue1' : (202, 225, 255), * 'lightsteelblue2' : (188, 210, 238), # <<<<<<<<<<<<<< * 'lightsteelblue3' : (162, 181, 205), * 'lightsteelblue4' : (110, 123, 139), */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_u_lightsteelblue2, __pyx_tuple__454) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":448 * 'lightsteelblue1' : (202, 225, 255), * 'lightsteelblue2' : (188, 210, 238), * 'lightsteelblue3' : (162, 181, 205), # <<<<<<<<<<<<<< * 'lightsteelblue4' : (110, 123, 139), * 'lightyellow' : (255, 255, 224), */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_u_lightsteelblue3, __pyx_tuple__455) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":449 * 'lightsteelblue2' : (188, 210, 238), * 'lightsteelblue3' : (162, 181, 205), * 'lightsteelblue4' : (110, 123, 139), # <<<<<<<<<<<<<< * 'lightyellow' : (255, 255, 224), * 'lightyellow1' : (255, 255, 224), */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_u_lightsteelblue4, __pyx_tuple__456) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":450 * 'lightsteelblue3' : (162, 181, 205), * 'lightsteelblue4' : (110, 123, 139), * 'lightyellow' : (255, 255, 224), # <<<<<<<<<<<<<< * 'lightyellow1' : (255, 255, 224), * 'lightyellow2' : (238, 238, 209), */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_u_lightyellow, __pyx_tuple__457) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":451 * 'lightsteelblue4' : (110, 123, 139), * 'lightyellow' : (255, 255, 224), * 'lightyellow1' : (255, 255, 224), # <<<<<<<<<<<<<< * 'lightyellow2' : (238, 238, 209), * 'lightyellow3' : (205, 205, 180), */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_u_lightyellow1, __pyx_tuple__458) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":452 * 'lightyellow' : (255, 255, 224), * 'lightyellow1' : (255, 255, 224), * 'lightyellow2' : (238, 238, 209), # <<<<<<<<<<<<<< * 'lightyellow3' : (205, 205, 180), * 'lightyellow4' : (139, 139, 122), */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_u_lightyellow2, __pyx_tuple__459) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":453 * 'lightyellow1' : (255, 255, 224), * 'lightyellow2' : (238, 238, 209), * 'lightyellow3' : (205, 205, 180), # <<<<<<<<<<<<<< * 'lightyellow4' : (139, 139, 122), * 'lime' : (0, 255, 0), */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_u_lightyellow3, __pyx_tuple__460) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":454 * 'lightyellow2' : (238, 238, 209), * 'lightyellow3' : (205, 205, 180), * 'lightyellow4' : (139, 139, 122), # <<<<<<<<<<<<<< * 'lime' : (0, 255, 0), * 'limegreen' : (50, 205, 50), */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_u_lightyellow4, __pyx_tuple__461) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":455 * 'lightyellow3' : (205, 205, 180), * 'lightyellow4' : (139, 139, 122), * 'lime' : (0, 255, 0), # <<<<<<<<<<<<<< * 'limegreen' : (50, 205, 50), * 'linen' : (250, 240, 230), */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_u_lime, __pyx_tuple__462) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":456 * 'lightyellow4' : (139, 139, 122), * 'lime' : (0, 255, 0), * 'limegreen' : (50, 205, 50), # <<<<<<<<<<<<<< * 'linen' : (250, 240, 230), * 'magenta' : (255, 0, 255), */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_u_limegreen, __pyx_tuple__463) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":457 * 'lime' : (0, 255, 0), * 'limegreen' : (50, 205, 50), * 'linen' : (250, 240, 230), # <<<<<<<<<<<<<< * 'magenta' : (255, 0, 255), * 'magenta1' : (255, 0, 255), */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_u_linen, __pyx_tuple__464) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":458 * 'limegreen' : (50, 205, 50), * 'linen' : (250, 240, 230), * 'magenta' : (255, 0, 255), # <<<<<<<<<<<<<< * 'magenta1' : (255, 0, 255), * 'magenta2' : (238, 0, 238), */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_u_magenta, __pyx_tuple__465) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":459 * 'linen' : (250, 240, 230), * 'magenta' : (255, 0, 255), * 'magenta1' : (255, 0, 255), # <<<<<<<<<<<<<< * 'magenta2' : (238, 0, 238), * 'magenta3' : (205, 0, 205), */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_u_magenta1, __pyx_tuple__466) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":460 * 'magenta' : (255, 0, 255), * 'magenta1' : (255, 0, 255), * 'magenta2' : (238, 0, 238), # <<<<<<<<<<<<<< * 'magenta3' : (205, 0, 205), * 'magenta4' : (139, 0, 139), */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_u_magenta2, __pyx_tuple__467) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":461 * 'magenta1' : (255, 0, 255), * 'magenta2' : (238, 0, 238), * 'magenta3' : (205, 0, 205), # <<<<<<<<<<<<<< * 'magenta4' : (139, 0, 139), * 'maroon' : (176, 48, 96), */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_u_magenta3, __pyx_tuple__468) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":462 * 'magenta2' : (238, 0, 238), * 'magenta3' : (205, 0, 205), * 'magenta4' : (139, 0, 139), # <<<<<<<<<<<<<< * 'maroon' : (176, 48, 96), * 'maroon1' : (255, 52, 179), */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_u_magenta4, __pyx_tuple__469) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":463 * 'magenta3' : (205, 0, 205), * 'magenta4' : (139, 0, 139), * 'maroon' : (176, 48, 96), # <<<<<<<<<<<<<< * 'maroon1' : (255, 52, 179), * 'maroon2' : (238, 48, 167), */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_u_maroon, __pyx_tuple__470) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":464 * 'magenta4' : (139, 0, 139), * 'maroon' : (176, 48, 96), * 'maroon1' : (255, 52, 179), # <<<<<<<<<<<<<< * 'maroon2' : (238, 48, 167), * 'maroon3' : (205, 41, 144), */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_u_maroon1, __pyx_tuple__471) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":465 * 'maroon' : (176, 48, 96), * 'maroon1' : (255, 52, 179), * 'maroon2' : (238, 48, 167), # <<<<<<<<<<<<<< * 'maroon3' : (205, 41, 144), * 'maroon4' : (139, 28, 98), */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_u_maroon2, __pyx_tuple__472) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":466 * 'maroon1' : (255, 52, 179), * 'maroon2' : (238, 48, 167), * 'maroon3' : (205, 41, 144), # <<<<<<<<<<<<<< * 'maroon4' : (139, 28, 98), * 'mediumaquamarine' : (102, 205, 170), */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_u_maroon3, __pyx_tuple__473) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":467 * 'maroon2' : (238, 48, 167), * 'maroon3' : (205, 41, 144), * 'maroon4' : (139, 28, 98), # <<<<<<<<<<<<<< * 'mediumaquamarine' : (102, 205, 170), * 'mediumblue' : (0, 0, 205), */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_u_maroon4, __pyx_tuple__474) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":468 * 'maroon3' : (205, 41, 144), * 'maroon4' : (139, 28, 98), * 'mediumaquamarine' : (102, 205, 170), # <<<<<<<<<<<<<< * 'mediumblue' : (0, 0, 205), * 'mediumorchid' : (186, 85, 211), */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_u_mediumaquamarine, __pyx_tuple__475) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":469 * 'maroon4' : (139, 28, 98), * 'mediumaquamarine' : (102, 205, 170), * 'mediumblue' : (0, 0, 205), # <<<<<<<<<<<<<< * 'mediumorchid' : (186, 85, 211), * 'mediumorchid1' : (224, 102, 255), */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_u_mediumblue, __pyx_tuple__476) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":470 * 'mediumaquamarine' : (102, 205, 170), * 'mediumblue' : (0, 0, 205), * 'mediumorchid' : (186, 85, 211), # <<<<<<<<<<<<<< * 'mediumorchid1' : (224, 102, 255), * 'mediumorchid2' : (209, 95, 238), */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_u_mediumorchid, __pyx_tuple__477) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":471 * 'mediumblue' : (0, 0, 205), * 'mediumorchid' : (186, 85, 211), * 'mediumorchid1' : (224, 102, 255), # <<<<<<<<<<<<<< * 'mediumorchid2' : (209, 95, 238), * 'mediumorchid3' : (180, 82, 205), */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_u_mediumorchid1, __pyx_tuple__478) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":472 * 'mediumorchid' : (186, 85, 211), * 'mediumorchid1' : (224, 102, 255), * 'mediumorchid2' : (209, 95, 238), # <<<<<<<<<<<<<< * 'mediumorchid3' : (180, 82, 205), * 'mediumorchid4' : (122, 55, 139), */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_u_mediumorchid2, __pyx_tuple__479) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":473 * 'mediumorchid1' : (224, 102, 255), * 'mediumorchid2' : (209, 95, 238), * 'mediumorchid3' : (180, 82, 205), # <<<<<<<<<<<<<< * 'mediumorchid4' : (122, 55, 139), * 'mediumpurple' : (147, 112, 219), */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_u_mediumorchid3, __pyx_tuple__480) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":474 * 'mediumorchid2' : (209, 95, 238), * 'mediumorchid3' : (180, 82, 205), * 'mediumorchid4' : (122, 55, 139), # <<<<<<<<<<<<<< * 'mediumpurple' : (147, 112, 219), * 'mediumpurple1' : (171, 130, 255), */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_u_mediumorchid4, __pyx_tuple__481) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":475 * 'mediumorchid3' : (180, 82, 205), * 'mediumorchid4' : (122, 55, 139), * 'mediumpurple' : (147, 112, 219), # <<<<<<<<<<<<<< * 'mediumpurple1' : (171, 130, 255), * 'mediumpurple2' : (159, 121, 238), */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_u_mediumpurple, __pyx_tuple__482) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":476 * 'mediumorchid4' : (122, 55, 139), * 'mediumpurple' : (147, 112, 219), * 'mediumpurple1' : (171, 130, 255), # <<<<<<<<<<<<<< * 'mediumpurple2' : (159, 121, 238), * 'mediumpurple3' : (137, 104, 205), */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_u_mediumpurple1, __pyx_tuple__483) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":477 * 'mediumpurple' : (147, 112, 219), * 'mediumpurple1' : (171, 130, 255), * 'mediumpurple2' : (159, 121, 238), # <<<<<<<<<<<<<< * 'mediumpurple3' : (137, 104, 205), * 'mediumpurple4' : (93, 71, 139), */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_u_mediumpurple2, __pyx_tuple__484) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":478 * 'mediumpurple1' : (171, 130, 255), * 'mediumpurple2' : (159, 121, 238), * 'mediumpurple3' : (137, 104, 205), # <<<<<<<<<<<<<< * 'mediumpurple4' : (93, 71, 139), * 'mediumseagreen' : (60, 179, 113), */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_u_mediumpurple3, __pyx_tuple__485) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":479 * 'mediumpurple2' : (159, 121, 238), * 'mediumpurple3' : (137, 104, 205), * 'mediumpurple4' : (93, 71, 139), # <<<<<<<<<<<<<< * 'mediumseagreen' : (60, 179, 113), * 'mediumslateblue' : (123, 104, 238), */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_u_mediumpurple4, __pyx_tuple__486) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":480 * 'mediumpurple3' : (137, 104, 205), * 'mediumpurple4' : (93, 71, 139), * 'mediumseagreen' : (60, 179, 113), # <<<<<<<<<<<<<< * 'mediumslateblue' : (123, 104, 238), * 'mediumspringgreen' : (0, 250, 154), */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_u_mediumseagreen, __pyx_tuple__487) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":481 * 'mediumpurple4' : (93, 71, 139), * 'mediumseagreen' : (60, 179, 113), * 'mediumslateblue' : (123, 104, 238), # <<<<<<<<<<<<<< * 'mediumspringgreen' : (0, 250, 154), * 'mediumturquoise' : (72, 209, 204), */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_u_mediumslateblue, __pyx_tuple__488) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":482 * 'mediumseagreen' : (60, 179, 113), * 'mediumslateblue' : (123, 104, 238), * 'mediumspringgreen' : (0, 250, 154), # <<<<<<<<<<<<<< * 'mediumturquoise' : (72, 209, 204), * 'mediumvioletred' : (199, 21, 133), */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_u_mediumspringgreen, __pyx_tuple__489) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":483 * 'mediumslateblue' : (123, 104, 238), * 'mediumspringgreen' : (0, 250, 154), * 'mediumturquoise' : (72, 209, 204), # <<<<<<<<<<<<<< * 'mediumvioletred' : (199, 21, 133), * 'midnightblue' : (25, 25, 112), */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_u_mediumturquoise, __pyx_tuple__490) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":484 * 'mediumspringgreen' : (0, 250, 154), * 'mediumturquoise' : (72, 209, 204), * 'mediumvioletred' : (199, 21, 133), # <<<<<<<<<<<<<< * 'midnightblue' : (25, 25, 112), * 'mintcream' : (245, 255, 250), */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_u_mediumvioletred, __pyx_tuple__491) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":485 * 'mediumturquoise' : (72, 209, 204), * 'mediumvioletred' : (199, 21, 133), * 'midnightblue' : (25, 25, 112), # <<<<<<<<<<<<<< * 'mintcream' : (245, 255, 250), * 'mistyrose' : (255, 228, 225), */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_u_midnightblue, __pyx_tuple__492) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":486 * 'mediumvioletred' : (199, 21, 133), * 'midnightblue' : (25, 25, 112), * 'mintcream' : (245, 255, 250), # <<<<<<<<<<<<<< * 'mistyrose' : (255, 228, 225), * 'mistyrose1' : (255, 228, 225), */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_u_mintcream, __pyx_tuple__493) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":487 * 'midnightblue' : (25, 25, 112), * 'mintcream' : (245, 255, 250), * 'mistyrose' : (255, 228, 225), # <<<<<<<<<<<<<< * 'mistyrose1' : (255, 228, 225), * 'mistyrose2' : (238, 213, 210), */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_u_mistyrose, __pyx_tuple__494) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":488 * 'mintcream' : (245, 255, 250), * 'mistyrose' : (255, 228, 225), * 'mistyrose1' : (255, 228, 225), # <<<<<<<<<<<<<< * 'mistyrose2' : (238, 213, 210), * 'mistyrose3' : (205, 183, 181), */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_u_mistyrose1, __pyx_tuple__495) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":489 * 'mistyrose' : (255, 228, 225), * 'mistyrose1' : (255, 228, 225), * 'mistyrose2' : (238, 213, 210), # <<<<<<<<<<<<<< * 'mistyrose3' : (205, 183, 181), * 'mistyrose4' : (139, 125, 123), */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_u_mistyrose2, __pyx_tuple__496) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":490 * 'mistyrose1' : (255, 228, 225), * 'mistyrose2' : (238, 213, 210), * 'mistyrose3' : (205, 183, 181), # <<<<<<<<<<<<<< * 'mistyrose4' : (139, 125, 123), * 'moccasin' : (255, 228, 181), */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_u_mistyrose3, __pyx_tuple__497) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":491 * 'mistyrose2' : (238, 213, 210), * 'mistyrose3' : (205, 183, 181), * 'mistyrose4' : (139, 125, 123), # <<<<<<<<<<<<<< * 'moccasin' : (255, 228, 181), * 'navajowhite' : (255, 222, 173), */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_u_mistyrose4, __pyx_tuple__498) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":492 * 'mistyrose3' : (205, 183, 181), * 'mistyrose4' : (139, 125, 123), * 'moccasin' : (255, 228, 181), # <<<<<<<<<<<<<< * 'navajowhite' : (255, 222, 173), * 'navajowhite1' : (255, 222, 173), */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_u_moccasin, __pyx_tuple__499) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":493 * 'mistyrose4' : (139, 125, 123), * 'moccasin' : (255, 228, 181), * 'navajowhite' : (255, 222, 173), # <<<<<<<<<<<<<< * 'navajowhite1' : (255, 222, 173), * 'navajowhite2' : (238, 207, 161), */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_u_navajowhite, __pyx_tuple__500) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":494 * 'moccasin' : (255, 228, 181), * 'navajowhite' : (255, 222, 173), * 'navajowhite1' : (255, 222, 173), # <<<<<<<<<<<<<< * 'navajowhite2' : (238, 207, 161), * 'navajowhite3' : (205, 179, 139), */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_u_navajowhite1, __pyx_tuple__501) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":495 * 'navajowhite' : (255, 222, 173), * 'navajowhite1' : (255, 222, 173), * 'navajowhite2' : (238, 207, 161), # <<<<<<<<<<<<<< * 'navajowhite3' : (205, 179, 139), * 'navajowhite4' : (139, 121, 94), */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_u_navajowhite2, __pyx_tuple__502) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":496 * 'navajowhite1' : (255, 222, 173), * 'navajowhite2' : (238, 207, 161), * 'navajowhite3' : (205, 179, 139), # <<<<<<<<<<<<<< * 'navajowhite4' : (139, 121, 94), * 'navy' : (0, 0, 128), */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_u_navajowhite3, __pyx_tuple__503) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":497 * 'navajowhite2' : (238, 207, 161), * 'navajowhite3' : (205, 179, 139), * 'navajowhite4' : (139, 121, 94), # <<<<<<<<<<<<<< * 'navy' : (0, 0, 128), * 'navyblue' : (0, 0, 128), */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_u_navajowhite4, __pyx_tuple__504) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":498 * 'navajowhite3' : (205, 179, 139), * 'navajowhite4' : (139, 121, 94), * 'navy' : (0, 0, 128), # <<<<<<<<<<<<<< * 'navyblue' : (0, 0, 128), * 'oldlace' : (253, 245, 230), */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_u_navy, __pyx_tuple__505) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":499 * 'navajowhite4' : (139, 121, 94), * 'navy' : (0, 0, 128), * 'navyblue' : (0, 0, 128), # <<<<<<<<<<<<<< * 'oldlace' : (253, 245, 230), * 'olive' : (128, 128, 0), */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_u_navyblue, __pyx_tuple__506) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":500 * 'navy' : (0, 0, 128), * 'navyblue' : (0, 0, 128), * 'oldlace' : (253, 245, 230), # <<<<<<<<<<<<<< * 'olive' : (128, 128, 0), * 'olivedrab' : (107, 142, 35), */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_u_oldlace, __pyx_tuple__507) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":501 * 'navyblue' : (0, 0, 128), * 'oldlace' : (253, 245, 230), * 'olive' : (128, 128, 0), # <<<<<<<<<<<<<< * 'olivedrab' : (107, 142, 35), * 'olivedrab1' : (192, 255, 62), */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_u_olive, __pyx_tuple__508) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":502 * 'oldlace' : (253, 245, 230), * 'olive' : (128, 128, 0), * 'olivedrab' : (107, 142, 35), # <<<<<<<<<<<<<< * 'olivedrab1' : (192, 255, 62), * 'olivedrab2' : (179, 238, 58), */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_u_olivedrab, __pyx_tuple__509) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":503 * 'olive' : (128, 128, 0), * 'olivedrab' : (107, 142, 35), * 'olivedrab1' : (192, 255, 62), # <<<<<<<<<<<<<< * 'olivedrab2' : (179, 238, 58), * 'olivedrab3' : (154, 205, 50), */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_u_olivedrab1, __pyx_tuple__510) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":504 * 'olivedrab' : (107, 142, 35), * 'olivedrab1' : (192, 255, 62), * 'olivedrab2' : (179, 238, 58), # <<<<<<<<<<<<<< * 'olivedrab3' : (154, 205, 50), * 'olivedrab4' : (105, 139, 34), */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_u_olivedrab2, __pyx_tuple__511) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":505 * 'olivedrab1' : (192, 255, 62), * 'olivedrab2' : (179, 238, 58), * 'olivedrab3' : (154, 205, 50), # <<<<<<<<<<<<<< * 'olivedrab4' : (105, 139, 34), * 'orange' : (255, 165, 0), */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_u_olivedrab3, __pyx_tuple__512) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":506 * 'olivedrab2' : (179, 238, 58), * 'olivedrab3' : (154, 205, 50), * 'olivedrab4' : (105, 139, 34), # <<<<<<<<<<<<<< * 'orange' : (255, 165, 0), * 'orange1' : (255, 165, 0), */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_u_olivedrab4, __pyx_tuple__513) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":507 * 'olivedrab3' : (154, 205, 50), * 'olivedrab4' : (105, 139, 34), * 'orange' : (255, 165, 0), # <<<<<<<<<<<<<< * 'orange1' : (255, 165, 0), * 'orange2' : (238, 154, 0), */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_u_orange, __pyx_tuple__514) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":508 * 'olivedrab4' : (105, 139, 34), * 'orange' : (255, 165, 0), * 'orange1' : (255, 165, 0), # <<<<<<<<<<<<<< * 'orange2' : (238, 154, 0), * 'orange3' : (205, 133, 0), */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_u_orange1, __pyx_tuple__515) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":509 * 'orange' : (255, 165, 0), * 'orange1' : (255, 165, 0), * 'orange2' : (238, 154, 0), # <<<<<<<<<<<<<< * 'orange3' : (205, 133, 0), * 'orange4' : (139, 90, 0), */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_u_orange2, __pyx_tuple__516) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":510 * 'orange1' : (255, 165, 0), * 'orange2' : (238, 154, 0), * 'orange3' : (205, 133, 0), # <<<<<<<<<<<<<< * 'orange4' : (139, 90, 0), * 'orangered' : (255, 69, 0), */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_u_orange3, __pyx_tuple__517) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":511 * 'orange2' : (238, 154, 0), * 'orange3' : (205, 133, 0), * 'orange4' : (139, 90, 0), # <<<<<<<<<<<<<< * 'orangered' : (255, 69, 0), * 'orangered1' : (255, 69, 0), */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_u_orange4, __pyx_tuple__518) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":512 * 'orange3' : (205, 133, 0), * 'orange4' : (139, 90, 0), * 'orangered' : (255, 69, 0), # <<<<<<<<<<<<<< * 'orangered1' : (255, 69, 0), * 'orangered2' : (238, 64, 0), */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_u_orangered, __pyx_tuple__519) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":513 * 'orange4' : (139, 90, 0), * 'orangered' : (255, 69, 0), * 'orangered1' : (255, 69, 0), # <<<<<<<<<<<<<< * 'orangered2' : (238, 64, 0), * 'orangered3' : (205, 55, 0), */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_u_orangered1, __pyx_tuple__520) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":514 * 'orangered' : (255, 69, 0), * 'orangered1' : (255, 69, 0), * 'orangered2' : (238, 64, 0), # <<<<<<<<<<<<<< * 'orangered3' : (205, 55, 0), * 'orangered4' : (139, 37, 0), */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_u_orangered2, __pyx_tuple__521) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":515 * 'orangered1' : (255, 69, 0), * 'orangered2' : (238, 64, 0), * 'orangered3' : (205, 55, 0), # <<<<<<<<<<<<<< * 'orangered4' : (139, 37, 0), * 'orchid' : (218, 112, 214), */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_u_orangered3, __pyx_tuple__522) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":516 * 'orangered2' : (238, 64, 0), * 'orangered3' : (205, 55, 0), * 'orangered4' : (139, 37, 0), # <<<<<<<<<<<<<< * 'orchid' : (218, 112, 214), * 'orchid1' : (255, 131, 250), */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_u_orangered4, __pyx_tuple__523) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":517 * 'orangered3' : (205, 55, 0), * 'orangered4' : (139, 37, 0), * 'orchid' : (218, 112, 214), # <<<<<<<<<<<<<< * 'orchid1' : (255, 131, 250), * 'orchid2' : (238, 122, 233), */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_u_orchid, __pyx_tuple__524) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":518 * 'orangered4' : (139, 37, 0), * 'orchid' : (218, 112, 214), * 'orchid1' : (255, 131, 250), # <<<<<<<<<<<<<< * 'orchid2' : (238, 122, 233), * 'orchid3' : (205, 105, 201), */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_u_orchid1, __pyx_tuple__525) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":519 * 'orchid' : (218, 112, 214), * 'orchid1' : (255, 131, 250), * 'orchid2' : (238, 122, 233), # <<<<<<<<<<<<<< * 'orchid3' : (205, 105, 201), * 'orchid4' : (139, 71, 137), */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_u_orchid2, __pyx_tuple__526) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":520 * 'orchid1' : (255, 131, 250), * 'orchid2' : (238, 122, 233), * 'orchid3' : (205, 105, 201), # <<<<<<<<<<<<<< * 'orchid4' : (139, 71, 137), * 'palegoldenrod' : (238, 232, 170), */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_u_orchid3, __pyx_tuple__527) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":521 * 'orchid2' : (238, 122, 233), * 'orchid3' : (205, 105, 201), * 'orchid4' : (139, 71, 137), # <<<<<<<<<<<<<< * 'palegoldenrod' : (238, 232, 170), * 'palegreen' : (152, 251, 152), */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_u_orchid4, __pyx_tuple__528) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":522 * 'orchid3' : (205, 105, 201), * 'orchid4' : (139, 71, 137), * 'palegoldenrod' : (238, 232, 170), # <<<<<<<<<<<<<< * 'palegreen' : (152, 251, 152), * 'palegreen1' : (154, 255, 154), */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_u_palegoldenrod, __pyx_tuple__529) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":523 * 'orchid4' : (139, 71, 137), * 'palegoldenrod' : (238, 232, 170), * 'palegreen' : (152, 251, 152), # <<<<<<<<<<<<<< * 'palegreen1' : (154, 255, 154), * 'palegreen2' : (144, 238, 144), */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_u_palegreen, __pyx_tuple__530) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":524 * 'palegoldenrod' : (238, 232, 170), * 'palegreen' : (152, 251, 152), * 'palegreen1' : (154, 255, 154), # <<<<<<<<<<<<<< * 'palegreen2' : (144, 238, 144), * 'palegreen3' : (124, 205, 124), */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_u_palegreen1, __pyx_tuple__531) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":525 * 'palegreen' : (152, 251, 152), * 'palegreen1' : (154, 255, 154), * 'palegreen2' : (144, 238, 144), # <<<<<<<<<<<<<< * 'palegreen3' : (124, 205, 124), * 'palegreen4' : (84, 139, 84), */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_u_palegreen2, __pyx_tuple__532) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":526 * 'palegreen1' : (154, 255, 154), * 'palegreen2' : (144, 238, 144), * 'palegreen3' : (124, 205, 124), # <<<<<<<<<<<<<< * 'palegreen4' : (84, 139, 84), * 'paleturquoise' : (175, 238, 238), */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_u_palegreen3, __pyx_tuple__533) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":527 * 'palegreen2' : (144, 238, 144), * 'palegreen3' : (124, 205, 124), * 'palegreen4' : (84, 139, 84), # <<<<<<<<<<<<<< * 'paleturquoise' : (175, 238, 238), * 'paleturquoise1' : (187, 255, 255), */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_u_palegreen4, __pyx_tuple__534) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":528 * 'palegreen3' : (124, 205, 124), * 'palegreen4' : (84, 139, 84), * 'paleturquoise' : (175, 238, 238), # <<<<<<<<<<<<<< * 'paleturquoise1' : (187, 255, 255), * 'paleturquoise2' : (174, 238, 238), */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_u_paleturquoise, __pyx_tuple__535) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":529 * 'palegreen4' : (84, 139, 84), * 'paleturquoise' : (175, 238, 238), * 'paleturquoise1' : (187, 255, 255), # <<<<<<<<<<<<<< * 'paleturquoise2' : (174, 238, 238), * 'paleturquoise3' : (150, 205, 205), */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_u_paleturquoise1, __pyx_tuple__536) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":530 * 'paleturquoise' : (175, 238, 238), * 'paleturquoise1' : (187, 255, 255), * 'paleturquoise2' : (174, 238, 238), # <<<<<<<<<<<<<< * 'paleturquoise3' : (150, 205, 205), * 'paleturquoise4' : (102, 139, 139), */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_u_paleturquoise2, __pyx_tuple__537) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":531 * 'paleturquoise1' : (187, 255, 255), * 'paleturquoise2' : (174, 238, 238), * 'paleturquoise3' : (150, 205, 205), # <<<<<<<<<<<<<< * 'paleturquoise4' : (102, 139, 139), * 'palevioletred' : (219, 112, 147), */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_u_paleturquoise3, __pyx_tuple__538) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":532 * 'paleturquoise2' : (174, 238, 238), * 'paleturquoise3' : (150, 205, 205), * 'paleturquoise4' : (102, 139, 139), # <<<<<<<<<<<<<< * 'palevioletred' : (219, 112, 147), * 'palevioletred1' : (255, 130, 171), */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_u_paleturquoise4, __pyx_tuple__539) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":533 * 'paleturquoise3' : (150, 205, 205), * 'paleturquoise4' : (102, 139, 139), * 'palevioletred' : (219, 112, 147), # <<<<<<<<<<<<<< * 'palevioletred1' : (255, 130, 171), * 'palevioletred2' : (238, 121, 159), */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_u_palevioletred, __pyx_tuple__540) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":534 * 'paleturquoise4' : (102, 139, 139), * 'palevioletred' : (219, 112, 147), * 'palevioletred1' : (255, 130, 171), # <<<<<<<<<<<<<< * 'palevioletred2' : (238, 121, 159), * 'palevioletred3' : (205, 104, 137), */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_u_palevioletred1, __pyx_tuple__541) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":535 * 'palevioletred' : (219, 112, 147), * 'palevioletred1' : (255, 130, 171), * 'palevioletred2' : (238, 121, 159), # <<<<<<<<<<<<<< * 'palevioletred3' : (205, 104, 137), * 'palevioletred4' : (139, 71, 93), */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_u_palevioletred2, __pyx_tuple__542) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":536 * 'palevioletred1' : (255, 130, 171), * 'palevioletred2' : (238, 121, 159), * 'palevioletred3' : (205, 104, 137), # <<<<<<<<<<<<<< * 'palevioletred4' : (139, 71, 93), * 'papayawhip' : (255, 239, 213), */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_u_palevioletred3, __pyx_tuple__543) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":537 * 'palevioletred2' : (238, 121, 159), * 'palevioletred3' : (205, 104, 137), * 'palevioletred4' : (139, 71, 93), # <<<<<<<<<<<<<< * 'papayawhip' : (255, 239, 213), * 'peachpuff' : (255, 218, 185), */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_u_palevioletred4, __pyx_tuple__544) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":538 * 'palevioletred3' : (205, 104, 137), * 'palevioletred4' : (139, 71, 93), * 'papayawhip' : (255, 239, 213), # <<<<<<<<<<<<<< * 'peachpuff' : (255, 218, 185), * 'peachpuff1' : (255, 218, 185), */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_u_papayawhip, __pyx_tuple__545) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":539 * 'palevioletred4' : (139, 71, 93), * 'papayawhip' : (255, 239, 213), * 'peachpuff' : (255, 218, 185), # <<<<<<<<<<<<<< * 'peachpuff1' : (255, 218, 185), * 'peachpuff2' : (238, 203, 173), */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_u_peachpuff, __pyx_tuple__546) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":540 * 'papayawhip' : (255, 239, 213), * 'peachpuff' : (255, 218, 185), * 'peachpuff1' : (255, 218, 185), # <<<<<<<<<<<<<< * 'peachpuff2' : (238, 203, 173), * 'peachpuff3' : (205, 175, 149), */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_u_peachpuff1, __pyx_tuple__547) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":541 * 'peachpuff' : (255, 218, 185), * 'peachpuff1' : (255, 218, 185), * 'peachpuff2' : (238, 203, 173), # <<<<<<<<<<<<<< * 'peachpuff3' : (205, 175, 149), * 'peachpuff4' : (139, 119, 101), */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_u_peachpuff2, __pyx_tuple__548) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":542 * 'peachpuff1' : (255, 218, 185), * 'peachpuff2' : (238, 203, 173), * 'peachpuff3' : (205, 175, 149), # <<<<<<<<<<<<<< * 'peachpuff4' : (139, 119, 101), * 'peru' : (205, 133, 63), */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_u_peachpuff3, __pyx_tuple__549) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":543 * 'peachpuff2' : (238, 203, 173), * 'peachpuff3' : (205, 175, 149), * 'peachpuff4' : (139, 119, 101), # <<<<<<<<<<<<<< * 'peru' : (205, 133, 63), * 'pink' : (255, 192, 203), */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_u_peachpuff4, __pyx_tuple__550) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":544 * 'peachpuff3' : (205, 175, 149), * 'peachpuff4' : (139, 119, 101), * 'peru' : (205, 133, 63), # <<<<<<<<<<<<<< * 'pink' : (255, 192, 203), * 'pink1' : (255, 181, 197), */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_u_peru, __pyx_tuple__551) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":545 * 'peachpuff4' : (139, 119, 101), * 'peru' : (205, 133, 63), * 'pink' : (255, 192, 203), # <<<<<<<<<<<<<< * 'pink1' : (255, 181, 197), * 'pink2' : (238, 169, 184), */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_u_pink, __pyx_tuple__552) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":546 * 'peru' : (205, 133, 63), * 'pink' : (255, 192, 203), * 'pink1' : (255, 181, 197), # <<<<<<<<<<<<<< * 'pink2' : (238, 169, 184), * 'pink3' : (205, 145, 158), */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_u_pink1, __pyx_tuple__553) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":547 * 'pink' : (255, 192, 203), * 'pink1' : (255, 181, 197), * 'pink2' : (238, 169, 184), # <<<<<<<<<<<<<< * 'pink3' : (205, 145, 158), * 'pink4' : (139, 99, 108), */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_u_pink2, __pyx_tuple__554) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":548 * 'pink1' : (255, 181, 197), * 'pink2' : (238, 169, 184), * 'pink3' : (205, 145, 158), # <<<<<<<<<<<<<< * 'pink4' : (139, 99, 108), * 'plum' : (221, 160, 221), */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_u_pink3, __pyx_tuple__555) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":549 * 'pink2' : (238, 169, 184), * 'pink3' : (205, 145, 158), * 'pink4' : (139, 99, 108), # <<<<<<<<<<<<<< * 'plum' : (221, 160, 221), * 'plum1' : (255, 187, 255), */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_u_pink4, __pyx_tuple__556) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":550 * 'pink3' : (205, 145, 158), * 'pink4' : (139, 99, 108), * 'plum' : (221, 160, 221), # <<<<<<<<<<<<<< * 'plum1' : (255, 187, 255), * 'plum2' : (238, 174, 238), */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_u_plum, __pyx_tuple__557) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":551 * 'pink4' : (139, 99, 108), * 'plum' : (221, 160, 221), * 'plum1' : (255, 187, 255), # <<<<<<<<<<<<<< * 'plum2' : (238, 174, 238), * 'plum3' : (205, 150, 205), */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_u_plum1, __pyx_tuple__558) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":552 * 'plum' : (221, 160, 221), * 'plum1' : (255, 187, 255), * 'plum2' : (238, 174, 238), # <<<<<<<<<<<<<< * 'plum3' : (205, 150, 205), * 'plum4' : (139, 102, 139), */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_u_plum2, __pyx_tuple__559) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":553 * 'plum1' : (255, 187, 255), * 'plum2' : (238, 174, 238), * 'plum3' : (205, 150, 205), # <<<<<<<<<<<<<< * 'plum4' : (139, 102, 139), * 'powderblue' : (176, 224, 230), */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_u_plum3, __pyx_tuple__560) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":554 * 'plum2' : (238, 174, 238), * 'plum3' : (205, 150, 205), * 'plum4' : (139, 102, 139), # <<<<<<<<<<<<<< * 'powderblue' : (176, 224, 230), * 'purple' : (160, 32, 240), */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_u_plum4, __pyx_tuple__561) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":555 * 'plum3' : (205, 150, 205), * 'plum4' : (139, 102, 139), * 'powderblue' : (176, 224, 230), # <<<<<<<<<<<<<< * 'purple' : (160, 32, 240), * 'purple1' : (155, 48, 255), */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_u_powderblue, __pyx_tuple__562) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":556 * 'plum4' : (139, 102, 139), * 'powderblue' : (176, 224, 230), * 'purple' : (160, 32, 240), # <<<<<<<<<<<<<< * 'purple1' : (155, 48, 255), * 'purple2' : (145, 44, 238), */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_u_purple, __pyx_tuple__563) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":557 * 'powderblue' : (176, 224, 230), * 'purple' : (160, 32, 240), * 'purple1' : (155, 48, 255), # <<<<<<<<<<<<<< * 'purple2' : (145, 44, 238), * 'purple3' : (125, 38, 205), */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_u_purple1, __pyx_tuple__564) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":558 * 'purple' : (160, 32, 240), * 'purple1' : (155, 48, 255), * 'purple2' : (145, 44, 238), # <<<<<<<<<<<<<< * 'purple3' : (125, 38, 205), * 'purple4' : (85, 26, 139), */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_u_purple2, __pyx_tuple__565) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":559 * 'purple1' : (155, 48, 255), * 'purple2' : (145, 44, 238), * 'purple3' : (125, 38, 205), # <<<<<<<<<<<<<< * 'purple4' : (85, 26, 139), * 'rebeccapurple' : (102, 51, 153), */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_u_purple3, __pyx_tuple__566) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":560 * 'purple2' : (145, 44, 238), * 'purple3' : (125, 38, 205), * 'purple4' : (85, 26, 139), # <<<<<<<<<<<<<< * 'rebeccapurple' : (102, 51, 153), * 'red' : (255, 0, 0), */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_u_purple4, __pyx_tuple__567) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":561 * 'purple3' : (125, 38, 205), * 'purple4' : (85, 26, 139), * 'rebeccapurple' : (102, 51, 153), # <<<<<<<<<<<<<< * 'red' : (255, 0, 0), * 'red1' : (255, 0, 0), */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_u_rebeccapurple, __pyx_tuple__568) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":562 * 'purple4' : (85, 26, 139), * 'rebeccapurple' : (102, 51, 153), * 'red' : (255, 0, 0), # <<<<<<<<<<<<<< * 'red1' : (255, 0, 0), * 'red2' : (238, 0, 0), */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_u_red, __pyx_tuple__569) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":563 * 'rebeccapurple' : (102, 51, 153), * 'red' : (255, 0, 0), * 'red1' : (255, 0, 0), # <<<<<<<<<<<<<< * 'red2' : (238, 0, 0), * 'red3' : (205, 0, 0), */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_u_red1, __pyx_tuple__570) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":564 * 'red' : (255, 0, 0), * 'red1' : (255, 0, 0), * 'red2' : (238, 0, 0), # <<<<<<<<<<<<<< * 'red3' : (205, 0, 0), * 'red4' : (139, 0, 0), */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_u_red2, __pyx_tuple__571) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":565 * 'red1' : (255, 0, 0), * 'red2' : (238, 0, 0), * 'red3' : (205, 0, 0), # <<<<<<<<<<<<<< * 'red4' : (139, 0, 0), * 'rosybrown' : (188, 143, 143), */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_u_red3, __pyx_tuple__572) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":566 * 'red2' : (238, 0, 0), * 'red3' : (205, 0, 0), * 'red4' : (139, 0, 0), # <<<<<<<<<<<<<< * 'rosybrown' : (188, 143, 143), * 'rosybrown1' : (255, 193, 193), */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_u_red4, __pyx_tuple__573) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":567 * 'red3' : (205, 0, 0), * 'red4' : (139, 0, 0), * 'rosybrown' : (188, 143, 143), # <<<<<<<<<<<<<< * 'rosybrown1' : (255, 193, 193), * 'rosybrown2' : (238, 180, 180), */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_u_rosybrown, __pyx_tuple__574) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":568 * 'red4' : (139, 0, 0), * 'rosybrown' : (188, 143, 143), * 'rosybrown1' : (255, 193, 193), # <<<<<<<<<<<<<< * 'rosybrown2' : (238, 180, 180), * 'rosybrown3' : (205, 155, 155), */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_u_rosybrown1, __pyx_tuple__575) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":569 * 'rosybrown' : (188, 143, 143), * 'rosybrown1' : (255, 193, 193), * 'rosybrown2' : (238, 180, 180), # <<<<<<<<<<<<<< * 'rosybrown3' : (205, 155, 155), * 'rosybrown4' : (139, 105, 105), */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_u_rosybrown2, __pyx_tuple__576) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":570 * 'rosybrown1' : (255, 193, 193), * 'rosybrown2' : (238, 180, 180), * 'rosybrown3' : (205, 155, 155), # <<<<<<<<<<<<<< * 'rosybrown4' : (139, 105, 105), * 'royalblue' : (65, 105, 225), */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_u_rosybrown3, __pyx_tuple__577) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":571 * 'rosybrown2' : (238, 180, 180), * 'rosybrown3' : (205, 155, 155), * 'rosybrown4' : (139, 105, 105), # <<<<<<<<<<<<<< * 'royalblue' : (65, 105, 225), * 'royalblue1' : (72, 118, 255), */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_u_rosybrown4, __pyx_tuple__578) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":572 * 'rosybrown3' : (205, 155, 155), * 'rosybrown4' : (139, 105, 105), * 'royalblue' : (65, 105, 225), # <<<<<<<<<<<<<< * 'royalblue1' : (72, 118, 255), * 'royalblue2' : (67, 110, 238), */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_u_royalblue, __pyx_tuple__579) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":573 * 'rosybrown4' : (139, 105, 105), * 'royalblue' : (65, 105, 225), * 'royalblue1' : (72, 118, 255), # <<<<<<<<<<<<<< * 'royalblue2' : (67, 110, 238), * 'royalblue3' : (58, 95, 205), */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_u_royalblue1, __pyx_tuple__580) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":574 * 'royalblue' : (65, 105, 225), * 'royalblue1' : (72, 118, 255), * 'royalblue2' : (67, 110, 238), # <<<<<<<<<<<<<< * 'royalblue3' : (58, 95, 205), * 'royalblue4' : (39, 64, 139), */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_u_royalblue2, __pyx_tuple__581) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":575 * 'royalblue1' : (72, 118, 255), * 'royalblue2' : (67, 110, 238), * 'royalblue3' : (58, 95, 205), # <<<<<<<<<<<<<< * 'royalblue4' : (39, 64, 139), * 'saddlebrown' : (139, 69, 19), */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_u_royalblue3, __pyx_tuple__582) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":576 * 'royalblue2' : (67, 110, 238), * 'royalblue3' : (58, 95, 205), * 'royalblue4' : (39, 64, 139), # <<<<<<<<<<<<<< * 'saddlebrown' : (139, 69, 19), * 'salmon' : (250, 128, 114), */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_u_royalblue4, __pyx_tuple__583) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":577 * 'royalblue3' : (58, 95, 205), * 'royalblue4' : (39, 64, 139), * 'saddlebrown' : (139, 69, 19), # <<<<<<<<<<<<<< * 'salmon' : (250, 128, 114), * 'salmon1' : (255, 140, 105), */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_u_saddlebrown, __pyx_tuple__584) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":578 * 'royalblue4' : (39, 64, 139), * 'saddlebrown' : (139, 69, 19), * 'salmon' : (250, 128, 114), # <<<<<<<<<<<<<< * 'salmon1' : (255, 140, 105), * 'salmon2' : (238, 130, 98), */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_u_salmon, __pyx_tuple__585) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":579 * 'saddlebrown' : (139, 69, 19), * 'salmon' : (250, 128, 114), * 'salmon1' : (255, 140, 105), # <<<<<<<<<<<<<< * 'salmon2' : (238, 130, 98), * 'salmon3' : (205, 112, 84), */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_u_salmon1, __pyx_tuple__586) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":580 * 'salmon' : (250, 128, 114), * 'salmon1' : (255, 140, 105), * 'salmon2' : (238, 130, 98), # <<<<<<<<<<<<<< * 'salmon3' : (205, 112, 84), * 'salmon4' : (139, 76, 57), */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_u_salmon2, __pyx_tuple__587) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":581 * 'salmon1' : (255, 140, 105), * 'salmon2' : (238, 130, 98), * 'salmon3' : (205, 112, 84), # <<<<<<<<<<<<<< * 'salmon4' : (139, 76, 57), * 'sandybrown' : (244, 164, 96), */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_u_salmon3, __pyx_tuple__588) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":582 * 'salmon2' : (238, 130, 98), * 'salmon3' : (205, 112, 84), * 'salmon4' : (139, 76, 57), # <<<<<<<<<<<<<< * 'sandybrown' : (244, 164, 96), * 'seagreen' : (46, 139, 87), */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_u_salmon4, __pyx_tuple__589) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":583 * 'salmon3' : (205, 112, 84), * 'salmon4' : (139, 76, 57), * 'sandybrown' : (244, 164, 96), # <<<<<<<<<<<<<< * 'seagreen' : (46, 139, 87), * 'seagreen1' : (84, 255, 159), */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_u_sandybrown, __pyx_tuple__590) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":584 * 'salmon4' : (139, 76, 57), * 'sandybrown' : (244, 164, 96), * 'seagreen' : (46, 139, 87), # <<<<<<<<<<<<<< * 'seagreen1' : (84, 255, 159), * 'seagreen2' : (78, 238, 148), */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_u_seagreen, __pyx_tuple__591) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":585 * 'sandybrown' : (244, 164, 96), * 'seagreen' : (46, 139, 87), * 'seagreen1' : (84, 255, 159), # <<<<<<<<<<<<<< * 'seagreen2' : (78, 238, 148), * 'seagreen3' : (67, 205, 128), */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_u_seagreen1, __pyx_tuple__592) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":586 * 'seagreen' : (46, 139, 87), * 'seagreen1' : (84, 255, 159), * 'seagreen2' : (78, 238, 148), # <<<<<<<<<<<<<< * 'seagreen3' : (67, 205, 128), * 'seagreen4' : (46, 139, 87), */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_u_seagreen2, __pyx_tuple__593) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":587 * 'seagreen1' : (84, 255, 159), * 'seagreen2' : (78, 238, 148), * 'seagreen3' : (67, 205, 128), # <<<<<<<<<<<<<< * 'seagreen4' : (46, 139, 87), * 'seashell' : (255, 245, 238), */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_u_seagreen3, __pyx_tuple__594) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":588 * 'seagreen2' : (78, 238, 148), * 'seagreen3' : (67, 205, 128), * 'seagreen4' : (46, 139, 87), # <<<<<<<<<<<<<< * 'seashell' : (255, 245, 238), * 'seashell1' : (255, 245, 238), */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_u_seagreen4, __pyx_tuple__595) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":589 * 'seagreen3' : (67, 205, 128), * 'seagreen4' : (46, 139, 87), * 'seashell' : (255, 245, 238), # <<<<<<<<<<<<<< * 'seashell1' : (255, 245, 238), * 'seashell2' : (238, 229, 222), */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_u_seashell, __pyx_tuple__596) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":590 * 'seagreen4' : (46, 139, 87), * 'seashell' : (255, 245, 238), * 'seashell1' : (255, 245, 238), # <<<<<<<<<<<<<< * 'seashell2' : (238, 229, 222), * 'seashell3' : (205, 197, 191), */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_u_seashell1, __pyx_tuple__597) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":591 * 'seashell' : (255, 245, 238), * 'seashell1' : (255, 245, 238), * 'seashell2' : (238, 229, 222), # <<<<<<<<<<<<<< * 'seashell3' : (205, 197, 191), * 'seashell4' : (139, 134, 130), */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_u_seashell2, __pyx_tuple__598) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":592 * 'seashell1' : (255, 245, 238), * 'seashell2' : (238, 229, 222), * 'seashell3' : (205, 197, 191), # <<<<<<<<<<<<<< * 'seashell4' : (139, 134, 130), * 'sienna' : (160, 82, 45), */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_u_seashell3, __pyx_tuple__599) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":593 * 'seashell2' : (238, 229, 222), * 'seashell3' : (205, 197, 191), * 'seashell4' : (139, 134, 130), # <<<<<<<<<<<<<< * 'sienna' : (160, 82, 45), * 'sienna1' : (255, 130, 71), */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_u_seashell4, __pyx_tuple__600) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":594 * 'seashell3' : (205, 197, 191), * 'seashell4' : (139, 134, 130), * 'sienna' : (160, 82, 45), # <<<<<<<<<<<<<< * 'sienna1' : (255, 130, 71), * 'sienna2' : (238, 121, 66), */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_u_sienna, __pyx_tuple__601) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":595 * 'seashell4' : (139, 134, 130), * 'sienna' : (160, 82, 45), * 'sienna1' : (255, 130, 71), # <<<<<<<<<<<<<< * 'sienna2' : (238, 121, 66), * 'sienna3' : (205, 104, 57), */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_u_sienna1, __pyx_tuple__602) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":596 * 'sienna' : (160, 82, 45), * 'sienna1' : (255, 130, 71), * 'sienna2' : (238, 121, 66), # <<<<<<<<<<<<<< * 'sienna3' : (205, 104, 57), * 'sienna4' : (139, 71, 38), */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_u_sienna2, __pyx_tuple__603) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":597 * 'sienna1' : (255, 130, 71), * 'sienna2' : (238, 121, 66), * 'sienna3' : (205, 104, 57), # <<<<<<<<<<<<<< * 'sienna4' : (139, 71, 38), * 'silver' : (192, 192, 192), */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_u_sienna3, __pyx_tuple__604) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":598 * 'sienna2' : (238, 121, 66), * 'sienna3' : (205, 104, 57), * 'sienna4' : (139, 71, 38), # <<<<<<<<<<<<<< * 'silver' : (192, 192, 192), * 'skyblue' : (135, 206, 235), */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_u_sienna4, __pyx_tuple__605) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":599 * 'sienna3' : (205, 104, 57), * 'sienna4' : (139, 71, 38), * 'silver' : (192, 192, 192), # <<<<<<<<<<<<<< * 'skyblue' : (135, 206, 235), * 'skyblue1' : (135, 206, 255), */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_u_silver, __pyx_tuple__606) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":600 * 'sienna4' : (139, 71, 38), * 'silver' : (192, 192, 192), * 'skyblue' : (135, 206, 235), # <<<<<<<<<<<<<< * 'skyblue1' : (135, 206, 255), * 'skyblue2' : (126, 192, 238), */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_u_skyblue, __pyx_tuple__607) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":601 * 'silver' : (192, 192, 192), * 'skyblue' : (135, 206, 235), * 'skyblue1' : (135, 206, 255), # <<<<<<<<<<<<<< * 'skyblue2' : (126, 192, 238), * 'skyblue3' : (108, 166, 205), */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_u_skyblue1, __pyx_tuple__608) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":602 * 'skyblue' : (135, 206, 235), * 'skyblue1' : (135, 206, 255), * 'skyblue2' : (126, 192, 238), # <<<<<<<<<<<<<< * 'skyblue3' : (108, 166, 205), * 'skyblue4' : (74, 112, 139), */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_u_skyblue2, __pyx_tuple__609) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":603 * 'skyblue1' : (135, 206, 255), * 'skyblue2' : (126, 192, 238), * 'skyblue3' : (108, 166, 205), # <<<<<<<<<<<<<< * 'skyblue4' : (74, 112, 139), * 'slateblue' : (106, 90, 205), */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_u_skyblue3, __pyx_tuple__610) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":604 * 'skyblue2' : (126, 192, 238), * 'skyblue3' : (108, 166, 205), * 'skyblue4' : (74, 112, 139), # <<<<<<<<<<<<<< * 'slateblue' : (106, 90, 205), * 'slateblue1' : (131, 111, 255), */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_u_skyblue4, __pyx_tuple__611) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":605 * 'skyblue3' : (108, 166, 205), * 'skyblue4' : (74, 112, 139), * 'slateblue' : (106, 90, 205), # <<<<<<<<<<<<<< * 'slateblue1' : (131, 111, 255), * 'slateblue2' : (122, 103, 238), */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_u_slateblue, __pyx_tuple__612) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":606 * 'skyblue4' : (74, 112, 139), * 'slateblue' : (106, 90, 205), * 'slateblue1' : (131, 111, 255), # <<<<<<<<<<<<<< * 'slateblue2' : (122, 103, 238), * 'slateblue3' : (105, 89, 205), */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_u_slateblue1, __pyx_tuple__613) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":607 * 'slateblue' : (106, 90, 205), * 'slateblue1' : (131, 111, 255), * 'slateblue2' : (122, 103, 238), # <<<<<<<<<<<<<< * 'slateblue3' : (105, 89, 205), * 'slateblue4' : (71, 60, 139), */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_u_slateblue2, __pyx_tuple__614) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":608 * 'slateblue1' : (131, 111, 255), * 'slateblue2' : (122, 103, 238), * 'slateblue3' : (105, 89, 205), # <<<<<<<<<<<<<< * 'slateblue4' : (71, 60, 139), * 'slategray' : (112, 128, 144), */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_u_slateblue3, __pyx_tuple__615) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":609 * 'slateblue2' : (122, 103, 238), * 'slateblue3' : (105, 89, 205), * 'slateblue4' : (71, 60, 139), # <<<<<<<<<<<<<< * 'slategray' : (112, 128, 144), * 'slategray1' : (198, 226, 255), */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_u_slateblue4, __pyx_tuple__616) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":610 * 'slateblue3' : (105, 89, 205), * 'slateblue4' : (71, 60, 139), * 'slategray' : (112, 128, 144), # <<<<<<<<<<<<<< * 'slategray1' : (198, 226, 255), * 'slategray2' : (185, 211, 238), */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_u_slategray, __pyx_tuple__617) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":611 * 'slateblue4' : (71, 60, 139), * 'slategray' : (112, 128, 144), * 'slategray1' : (198, 226, 255), # <<<<<<<<<<<<<< * 'slategray2' : (185, 211, 238), * 'slategray3' : (159, 182, 205), */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_u_slategray1, __pyx_tuple__618) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":612 * 'slategray' : (112, 128, 144), * 'slategray1' : (198, 226, 255), * 'slategray2' : (185, 211, 238), # <<<<<<<<<<<<<< * 'slategray3' : (159, 182, 205), * 'slategray4' : (108, 123, 139), */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_u_slategray2, __pyx_tuple__619) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":613 * 'slategray1' : (198, 226, 255), * 'slategray2' : (185, 211, 238), * 'slategray3' : (159, 182, 205), # <<<<<<<<<<<<<< * 'slategray4' : (108, 123, 139), * 'slategrey' : (112, 128, 144), */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_u_slategray3, __pyx_tuple__620) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":614 * 'slategray2' : (185, 211, 238), * 'slategray3' : (159, 182, 205), * 'slategray4' : (108, 123, 139), # <<<<<<<<<<<<<< * 'slategrey' : (112, 128, 144), * 'snow' : (255, 250, 250), */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_u_slategray4, __pyx_tuple__621) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":615 * 'slategray3' : (159, 182, 205), * 'slategray4' : (108, 123, 139), * 'slategrey' : (112, 128, 144), # <<<<<<<<<<<<<< * 'snow' : (255, 250, 250), * 'snow1' : (255, 250, 250), */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_u_slategrey, __pyx_tuple__622) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":616 * 'slategray4' : (108, 123, 139), * 'slategrey' : (112, 128, 144), * 'snow' : (255, 250, 250), # <<<<<<<<<<<<<< * 'snow1' : (255, 250, 250), * 'snow2' : (238, 233, 233), */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_u_snow, __pyx_tuple__623) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":617 * 'slategrey' : (112, 128, 144), * 'snow' : (255, 250, 250), * 'snow1' : (255, 250, 250), # <<<<<<<<<<<<<< * 'snow2' : (238, 233, 233), * 'snow3' : (205, 201, 201), */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_u_snow1, __pyx_tuple__624) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":618 * 'snow' : (255, 250, 250), * 'snow1' : (255, 250, 250), * 'snow2' : (238, 233, 233), # <<<<<<<<<<<<<< * 'snow3' : (205, 201, 201), * 'snow4' : (139, 137, 137), */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_u_snow2, __pyx_tuple__625) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":619 * 'snow1' : (255, 250, 250), * 'snow2' : (238, 233, 233), * 'snow3' : (205, 201, 201), # <<<<<<<<<<<<<< * 'snow4' : (139, 137, 137), * 'springgreen' : (0, 255, 127), */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_u_snow3, __pyx_tuple__626) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":620 * 'snow2' : (238, 233, 233), * 'snow3' : (205, 201, 201), * 'snow4' : (139, 137, 137), # <<<<<<<<<<<<<< * 'springgreen' : (0, 255, 127), * 'springgreen1' : (0, 255, 127), */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_u_snow4, __pyx_tuple__627) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":621 * 'snow3' : (205, 201, 201), * 'snow4' : (139, 137, 137), * 'springgreen' : (0, 255, 127), # <<<<<<<<<<<<<< * 'springgreen1' : (0, 255, 127), * 'springgreen2' : (0, 238, 118), */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_u_springgreen, __pyx_tuple__628) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":622 * 'snow4' : (139, 137, 137), * 'springgreen' : (0, 255, 127), * 'springgreen1' : (0, 255, 127), # <<<<<<<<<<<<<< * 'springgreen2' : (0, 238, 118), * 'springgreen3' : (0, 205, 102), */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_u_springgreen1, __pyx_tuple__629) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":623 * 'springgreen' : (0, 255, 127), * 'springgreen1' : (0, 255, 127), * 'springgreen2' : (0, 238, 118), # <<<<<<<<<<<<<< * 'springgreen3' : (0, 205, 102), * 'springgreen4' : (0, 139, 69), */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_u_springgreen2, __pyx_tuple__630) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":624 * 'springgreen1' : (0, 255, 127), * 'springgreen2' : (0, 238, 118), * 'springgreen3' : (0, 205, 102), # <<<<<<<<<<<<<< * 'springgreen4' : (0, 139, 69), * 'steelblue' : (70, 130, 180), */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_u_springgreen3, __pyx_tuple__631) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":625 * 'springgreen2' : (0, 238, 118), * 'springgreen3' : (0, 205, 102), * 'springgreen4' : (0, 139, 69), # <<<<<<<<<<<<<< * 'steelblue' : (70, 130, 180), * 'steelblue1' : (99, 184, 255), */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_u_springgreen4, __pyx_tuple__632) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":626 * 'springgreen3' : (0, 205, 102), * 'springgreen4' : (0, 139, 69), * 'steelblue' : (70, 130, 180), # <<<<<<<<<<<<<< * 'steelblue1' : (99, 184, 255), * 'steelblue2' : (92, 172, 238), */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_u_steelblue, __pyx_tuple__633) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":627 * 'springgreen4' : (0, 139, 69), * 'steelblue' : (70, 130, 180), * 'steelblue1' : (99, 184, 255), # <<<<<<<<<<<<<< * 'steelblue2' : (92, 172, 238), * 'steelblue3' : (79, 148, 205), */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_u_steelblue1, __pyx_tuple__634) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":628 * 'steelblue' : (70, 130, 180), * 'steelblue1' : (99, 184, 255), * 'steelblue2' : (92, 172, 238), # <<<<<<<<<<<<<< * 'steelblue3' : (79, 148, 205), * 'steelblue4' : (54, 100, 139), */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_u_steelblue2, __pyx_tuple__635) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":629 * 'steelblue1' : (99, 184, 255), * 'steelblue2' : (92, 172, 238), * 'steelblue3' : (79, 148, 205), # <<<<<<<<<<<<<< * 'steelblue4' : (54, 100, 139), * 'tan' : (210, 180, 140), */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_u_steelblue3, __pyx_tuple__636) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":630 * 'steelblue2' : (92, 172, 238), * 'steelblue3' : (79, 148, 205), * 'steelblue4' : (54, 100, 139), # <<<<<<<<<<<<<< * 'tan' : (210, 180, 140), * 'tan1' : (255, 165, 79), */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_u_steelblue4, __pyx_tuple__637) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":631 * 'steelblue3' : (79, 148, 205), * 'steelblue4' : (54, 100, 139), * 'tan' : (210, 180, 140), # <<<<<<<<<<<<<< * 'tan1' : (255, 165, 79), * 'tan2' : (238, 154, 73), */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_u_tan, __pyx_tuple__638) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":632 * 'steelblue4' : (54, 100, 139), * 'tan' : (210, 180, 140), * 'tan1' : (255, 165, 79), # <<<<<<<<<<<<<< * 'tan2' : (238, 154, 73), * 'tan3' : (205, 133, 63), */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_u_tan1, __pyx_tuple__639) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":633 * 'tan' : (210, 180, 140), * 'tan1' : (255, 165, 79), * 'tan2' : (238, 154, 73), # <<<<<<<<<<<<<< * 'tan3' : (205, 133, 63), * 'tan4' : (139, 90, 43), */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_u_tan2, __pyx_tuple__640) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":634 * 'tan1' : (255, 165, 79), * 'tan2' : (238, 154, 73), * 'tan3' : (205, 133, 63), # <<<<<<<<<<<<<< * 'tan4' : (139, 90, 43), * 'teal' : (0, 128, 128), */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_u_tan3, __pyx_tuple__641) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":635 * 'tan2' : (238, 154, 73), * 'tan3' : (205, 133, 63), * 'tan4' : (139, 90, 43), # <<<<<<<<<<<<<< * 'teal' : (0, 128, 128), * 'thistle' : (216, 191, 216), */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_u_tan4, __pyx_tuple__642) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":636 * 'tan3' : (205, 133, 63), * 'tan4' : (139, 90, 43), * 'teal' : (0, 128, 128), # <<<<<<<<<<<<<< * 'thistle' : (216, 191, 216), * 'thistle1' : (255, 225, 255), */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_u_teal, __pyx_tuple__643) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":637 * 'tan4' : (139, 90, 43), * 'teal' : (0, 128, 128), * 'thistle' : (216, 191, 216), # <<<<<<<<<<<<<< * 'thistle1' : (255, 225, 255), * 'thistle2' : (238, 210, 238), */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_u_thistle, __pyx_tuple__644) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":638 * 'teal' : (0, 128, 128), * 'thistle' : (216, 191, 216), * 'thistle1' : (255, 225, 255), # <<<<<<<<<<<<<< * 'thistle2' : (238, 210, 238), * 'thistle3' : (205, 181, 205), */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_u_thistle1, __pyx_tuple__645) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":639 * 'thistle' : (216, 191, 216), * 'thistle1' : (255, 225, 255), * 'thistle2' : (238, 210, 238), # <<<<<<<<<<<<<< * 'thistle3' : (205, 181, 205), * 'thistle4' : (139, 123, 139), */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_u_thistle2, __pyx_tuple__646) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":640 * 'thistle1' : (255, 225, 255), * 'thistle2' : (238, 210, 238), * 'thistle3' : (205, 181, 205), # <<<<<<<<<<<<<< * 'thistle4' : (139, 123, 139), * 'tomato' : (255, 99, 71), */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_u_thistle3, __pyx_tuple__647) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":641 * 'thistle2' : (238, 210, 238), * 'thistle3' : (205, 181, 205), * 'thistle4' : (139, 123, 139), # <<<<<<<<<<<<<< * 'tomato' : (255, 99, 71), * 'tomato1' : (255, 99, 71), */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_u_thistle4, __pyx_tuple__648) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":642 * 'thistle3' : (205, 181, 205), * 'thistle4' : (139, 123, 139), * 'tomato' : (255, 99, 71), # <<<<<<<<<<<<<< * 'tomato1' : (255, 99, 71), * 'tomato2' : (238, 92, 66), */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_u_tomato, __pyx_tuple__649) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":643 * 'thistle4' : (139, 123, 139), * 'tomato' : (255, 99, 71), * 'tomato1' : (255, 99, 71), # <<<<<<<<<<<<<< * 'tomato2' : (238, 92, 66), * 'tomato3' : (205, 79, 57), */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_u_tomato1, __pyx_tuple__650) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":644 * 'tomato' : (255, 99, 71), * 'tomato1' : (255, 99, 71), * 'tomato2' : (238, 92, 66), # <<<<<<<<<<<<<< * 'tomato3' : (205, 79, 57), * 'tomato4' : (139, 54, 38), */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_u_tomato2, __pyx_tuple__651) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":645 * 'tomato1' : (255, 99, 71), * 'tomato2' : (238, 92, 66), * 'tomato3' : (205, 79, 57), # <<<<<<<<<<<<<< * 'tomato4' : (139, 54, 38), * 'turquoise' : (64, 224, 208), */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_u_tomato3, __pyx_tuple__652) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":646 * 'tomato2' : (238, 92, 66), * 'tomato3' : (205, 79, 57), * 'tomato4' : (139, 54, 38), # <<<<<<<<<<<<<< * 'turquoise' : (64, 224, 208), * 'turquoise1' : (0, 245, 255), */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_u_tomato4, __pyx_tuple__653) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":647 * 'tomato3' : (205, 79, 57), * 'tomato4' : (139, 54, 38), * 'turquoise' : (64, 224, 208), # <<<<<<<<<<<<<< * 'turquoise1' : (0, 245, 255), * 'turquoise2' : (0, 229, 238), */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_u_turquoise, __pyx_tuple__654) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":648 * 'tomato4' : (139, 54, 38), * 'turquoise' : (64, 224, 208), * 'turquoise1' : (0, 245, 255), # <<<<<<<<<<<<<< * 'turquoise2' : (0, 229, 238), * 'turquoise3' : (0, 197, 205), */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_u_turquoise1, __pyx_tuple__655) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":649 * 'turquoise' : (64, 224, 208), * 'turquoise1' : (0, 245, 255), * 'turquoise2' : (0, 229, 238), # <<<<<<<<<<<<<< * 'turquoise3' : (0, 197, 205), * 'turquoise4' : (0, 134, 139), */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_u_turquoise2, __pyx_tuple__656) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":650 * 'turquoise1' : (0, 245, 255), * 'turquoise2' : (0, 229, 238), * 'turquoise3' : (0, 197, 205), # <<<<<<<<<<<<<< * 'turquoise4' : (0, 134, 139), * 'violet' : (238, 130, 238), */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_u_turquoise3, __pyx_tuple__657) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":651 * 'turquoise2' : (0, 229, 238), * 'turquoise3' : (0, 197, 205), * 'turquoise4' : (0, 134, 139), # <<<<<<<<<<<<<< * 'violet' : (238, 130, 238), * 'violetred' : (208, 32, 144), */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_u_turquoise4, __pyx_tuple__658) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":652 * 'turquoise3' : (0, 197, 205), * 'turquoise4' : (0, 134, 139), * 'violet' : (238, 130, 238), # <<<<<<<<<<<<<< * 'violetred' : (208, 32, 144), * 'violetred1' : (255, 62, 150), */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_u_violet, __pyx_tuple__659) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":653 * 'turquoise4' : (0, 134, 139), * 'violet' : (238, 130, 238), * 'violetred' : (208, 32, 144), # <<<<<<<<<<<<<< * 'violetred1' : (255, 62, 150), * 'violetred2' : (238, 58, 140), */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_u_violetred, __pyx_tuple__660) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":654 * 'violet' : (238, 130, 238), * 'violetred' : (208, 32, 144), * 'violetred1' : (255, 62, 150), # <<<<<<<<<<<<<< * 'violetred2' : (238, 58, 140), * 'violetred3' : (205, 50, 120), */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_u_violetred1, __pyx_tuple__661) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":655 * 'violetred' : (208, 32, 144), * 'violetred1' : (255, 62, 150), * 'violetred2' : (238, 58, 140), # <<<<<<<<<<<<<< * 'violetred3' : (205, 50, 120), * 'violetred4' : (139, 34, 82), */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_u_violetred2, __pyx_tuple__662) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":656 * 'violetred1' : (255, 62, 150), * 'violetred2' : (238, 58, 140), * 'violetred3' : (205, 50, 120), # <<<<<<<<<<<<<< * 'violetred4' : (139, 34, 82), * 'webgray' : (128, 128, 128), */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_u_violetred3, __pyx_tuple__663) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":657 * 'violetred2' : (238, 58, 140), * 'violetred3' : (205, 50, 120), * 'violetred4' : (139, 34, 82), # <<<<<<<<<<<<<< * 'webgray' : (128, 128, 128), * 'webgreen' : (0, 128, 0), */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_u_violetred4, __pyx_tuple__664) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":658 * 'violetred3' : (205, 50, 120), * 'violetred4' : (139, 34, 82), * 'webgray' : (128, 128, 128), # <<<<<<<<<<<<<< * 'webgreen' : (0, 128, 0), * 'webgrey' : (128, 128, 128), */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_u_webgray, __pyx_tuple__665) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":659 * 'violetred4' : (139, 34, 82), * 'webgray' : (128, 128, 128), * 'webgreen' : (0, 128, 0), # <<<<<<<<<<<<<< * 'webgrey' : (128, 128, 128), * 'webmaroon' : (128, 0, 0), */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_u_webgreen, __pyx_tuple__666) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":660 * 'webgray' : (128, 128, 128), * 'webgreen' : (0, 128, 0), * 'webgrey' : (128, 128, 128), # <<<<<<<<<<<<<< * 'webmaroon' : (128, 0, 0), * 'webpurple' : (128, 0, 128), */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_u_webgrey, __pyx_tuple__667) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":661 * 'webgreen' : (0, 128, 0), * 'webgrey' : (128, 128, 128), * 'webmaroon' : (128, 0, 0), # <<<<<<<<<<<<<< * 'webpurple' : (128, 0, 128), * 'wheat' : (245, 222, 179), */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_u_webmaroon, __pyx_tuple__668) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":662 * 'webgrey' : (128, 128, 128), * 'webmaroon' : (128, 0, 0), * 'webpurple' : (128, 0, 128), # <<<<<<<<<<<<<< * 'wheat' : (245, 222, 179), * 'wheat1' : (255, 231, 186), */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_u_webpurple, __pyx_tuple__669) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":663 * 'webmaroon' : (128, 0, 0), * 'webpurple' : (128, 0, 128), * 'wheat' : (245, 222, 179), # <<<<<<<<<<<<<< * 'wheat1' : (255, 231, 186), * 'wheat2' : (238, 216, 174), */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_u_wheat, __pyx_tuple__670) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":664 * 'webpurple' : (128, 0, 128), * 'wheat' : (245, 222, 179), * 'wheat1' : (255, 231, 186), # <<<<<<<<<<<<<< * 'wheat2' : (238, 216, 174), * 'wheat3' : (205, 186, 150), */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_u_wheat1, __pyx_tuple__671) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":665 * 'wheat' : (245, 222, 179), * 'wheat1' : (255, 231, 186), * 'wheat2' : (238, 216, 174), # <<<<<<<<<<<<<< * 'wheat3' : (205, 186, 150), * 'wheat4' : (139, 126, 102), */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_u_wheat2, __pyx_tuple__672) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":666 * 'wheat1' : (255, 231, 186), * 'wheat2' : (238, 216, 174), * 'wheat3' : (205, 186, 150), # <<<<<<<<<<<<<< * 'wheat4' : (139, 126, 102), * 'white' : (255, 255, 255), */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_u_wheat3, __pyx_tuple__673) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":667 * 'wheat2' : (238, 216, 174), * 'wheat3' : (205, 186, 150), * 'wheat4' : (139, 126, 102), # <<<<<<<<<<<<<< * 'white' : (255, 255, 255), * 'whitesmoke' : (245, 245, 245), */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_u_wheat4, __pyx_tuple__674) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":668 * 'wheat3' : (205, 186, 150), * 'wheat4' : (139, 126, 102), * 'white' : (255, 255, 255), # <<<<<<<<<<<<<< * 'whitesmoke' : (245, 245, 245), * 'x11gray' : (190, 190, 190), */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_u_white, __pyx_tuple__675) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":669 * 'wheat4' : (139, 126, 102), * 'white' : (255, 255, 255), * 'whitesmoke' : (245, 245, 245), # <<<<<<<<<<<<<< * 'x11gray' : (190, 190, 190), * 'x11green' : (0, 255, 0), */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_u_whitesmoke, __pyx_tuple__676) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":670 * 'white' : (255, 255, 255), * 'whitesmoke' : (245, 245, 245), * 'x11gray' : (190, 190, 190), # <<<<<<<<<<<<<< * 'x11green' : (0, 255, 0), * 'x11grey' : (190, 190, 190), */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_u_x11gray, __pyx_tuple__677) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":671 * 'whitesmoke' : (245, 245, 245), * 'x11gray' : (190, 190, 190), * 'x11green' : (0, 255, 0), # <<<<<<<<<<<<<< * 'x11grey' : (190, 190, 190), * 'x11maroon' : (176, 48, 96), */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_u_x11green, __pyx_tuple__678) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":672 * 'x11gray' : (190, 190, 190), * 'x11green' : (0, 255, 0), * 'x11grey' : (190, 190, 190), # <<<<<<<<<<<<<< * 'x11maroon' : (176, 48, 96), * 'x11purple' : (160, 32, 240), */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_u_x11grey, __pyx_tuple__679) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":673 * 'x11green' : (0, 255, 0), * 'x11grey' : (190, 190, 190), * 'x11maroon' : (176, 48, 96), # <<<<<<<<<<<<<< * 'x11purple' : (160, 32, 240), * 'yellow' : (255, 255, 0), */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_u_x11maroon, __pyx_tuple__680) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":674 * 'x11grey' : (190, 190, 190), * 'x11maroon' : (176, 48, 96), * 'x11purple' : (160, 32, 240), # <<<<<<<<<<<<<< * 'yellow' : (255, 255, 0), * 'yellow1' : (255, 255, 0), */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_u_x11purple, __pyx_tuple__681) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":675 * 'x11maroon' : (176, 48, 96), * 'x11purple' : (160, 32, 240), * 'yellow' : (255, 255, 0), # <<<<<<<<<<<<<< * 'yellow1' : (255, 255, 0), * 'yellow2' : (238, 238, 0), */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_u_yellow, __pyx_tuple__682) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":676 * 'x11purple' : (160, 32, 240), * 'yellow' : (255, 255, 0), * 'yellow1' : (255, 255, 0), # <<<<<<<<<<<<<< * 'yellow2' : (238, 238, 0), * 'yellow3' : (205, 205, 0), */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_u_yellow1, __pyx_tuple__683) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":677 * 'yellow' : (255, 255, 0), * 'yellow1' : (255, 255, 0), * 'yellow2' : (238, 238, 0), # <<<<<<<<<<<<<< * 'yellow3' : (205, 205, 0), * 'yellow4' : (139, 139, 0), */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_u_yellow2, __pyx_tuple__684) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":678 * 'yellow1' : (255, 255, 0), * 'yellow2' : (238, 238, 0), * 'yellow3' : (205, 205, 0), # <<<<<<<<<<<<<< * 'yellow4' : (139, 139, 0), * 'yellowgreen' : (154, 205, 50), */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_u_yellow3, __pyx_tuple__685) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":679 * 'yellow2' : (238, 238, 0), * 'yellow3' : (205, 205, 0), * 'yellow4' : (139, 139, 0), # <<<<<<<<<<<<<< * 'yellowgreen' : (154, 205, 50), * } */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_u_yellow4, __pyx_tuple__686) < 0) __PYX_ERR(2, 5, __pyx_L1_error) /* "include/color_dict.pxi":680 * 'yellow3' : (205, 205, 0), * 'yellow4' : (139, 139, 0), * 'yellowgreen' : (154, 205, 50), # <<<<<<<<<<<<<< * } */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_u_yellowgreen, __pyx_tuple__687) < 0) __PYX_ERR(2, 5, __pyx_L1_error) __Pyx_XGOTREF(__pyx_v_11pygame_sdl2_5color_colors); __Pyx_DECREF_SET(__pyx_v_11pygame_sdl2_5color_colors, __pyx_t_1); __Pyx_GIVEREF(__pyx_t_1); __pyx_t_1 = 0; /* "pygame_sdl2/color.pyx":1 * # Copyright 2014 Tom Rothamel # <<<<<<<<<<<<<< * # Copyright 2014 Patrick Dawson * # */ __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (PyDict_SetItem(__pyx_d, __pyx_n_s_test, __pyx_t_1) < 0) __PYX_ERR(0, 1, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /*--- Wrapped vars code ---*/ goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); if (__pyx_m) { if (__pyx_d) { __Pyx_AddTraceback("init pygame_sdl2.color", __pyx_clineno, __pyx_lineno, __pyx_filename); } Py_DECREF(__pyx_m); __pyx_m = 0; } else if (!PyErr_Occurred()) { PyErr_SetString(PyExc_ImportError, "init pygame_sdl2.color"); } __pyx_L0:; __Pyx_RefNannyFinishContext(); #if PY_MAJOR_VERSION < 3 return; #else return __pyx_m; #endif } /* --- Runtime support code --- */ /* Refnanny */ #if CYTHON_REFNANNY static __Pyx_RefNannyAPIStruct *__Pyx_RefNannyImportAPI(const char *modname) { PyObject *m = NULL, *p = NULL; void *r = NULL; m = PyImport_ImportModule((char *)modname); if (!m) goto end; p = PyObject_GetAttrString(m, (char *)"RefNannyAPI"); if (!p) goto end; r = PyLong_AsVoidPtr(p); end: Py_XDECREF(p); Py_XDECREF(m); return (__Pyx_RefNannyAPIStruct *)r; } #endif /* GetBuiltinName */ static PyObject *__Pyx_GetBuiltinName(PyObject *name) { PyObject* result = __Pyx_PyObject_GetAttrStr(__pyx_b, name); if (unlikely(!result)) { PyErr_Format(PyExc_NameError, #if PY_MAJOR_VERSION >= 3 "name '%U' is not defined", name); #else "name '%.200s' is not defined", PyString_AS_STRING(name)); #endif } return result; } /* RaiseTooManyValuesToUnpack */ static CYTHON_INLINE void __Pyx_RaiseTooManyValuesError(Py_ssize_t expected) { PyErr_Format(PyExc_ValueError, "too many values to unpack (expected %" CYTHON_FORMAT_SSIZE_T "d)", expected); } /* RaiseNeedMoreValuesToUnpack */ static CYTHON_INLINE void __Pyx_RaiseNeedMoreValuesError(Py_ssize_t index) { PyErr_Format(PyExc_ValueError, "need more than %" CYTHON_FORMAT_SSIZE_T "d value%.1s to unpack", index, (index == 1) ? "" : "s"); } /* IterFinish */ static CYTHON_INLINE int __Pyx_IterFinish(void) { #if CYTHON_COMPILING_IN_CPYTHON PyThreadState *tstate = PyThreadState_GET(); PyObject* exc_type = tstate->curexc_type; if (unlikely(exc_type)) { if (likely(exc_type == PyExc_StopIteration) || PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration)) { PyObject *exc_value, *exc_tb; exc_value = tstate->curexc_value; exc_tb = tstate->curexc_traceback; tstate->curexc_type = 0; tstate->curexc_value = 0; tstate->curexc_traceback = 0; Py_DECREF(exc_type); Py_XDECREF(exc_value); Py_XDECREF(exc_tb); return 0; } else { return -1; } } return 0; #else if (unlikely(PyErr_Occurred())) { if (likely(PyErr_ExceptionMatches(PyExc_StopIteration))) { PyErr_Clear(); return 0; } else { return -1; } } return 0; #endif } /* UnpackItemEndCheck */ static int __Pyx_IternextUnpackEndCheck(PyObject *retval, Py_ssize_t expected) { if (unlikely(retval)) { Py_DECREF(retval); __Pyx_RaiseTooManyValuesError(expected); return -1; } else { return __Pyx_IterFinish(); } return 0; } /* PyObjectCall */ #if CYTHON_COMPILING_IN_CPYTHON static CYTHON_INLINE PyObject* __Pyx_PyObject_Call(PyObject *func, PyObject *arg, PyObject *kw) { PyObject *result; ternaryfunc call = func->ob_type->tp_call; if (unlikely(!call)) return PyObject_Call(func, arg, kw); if (unlikely(Py_EnterRecursiveCall((char*)" while calling a Python object"))) return NULL; result = (*call)(func, arg, kw); Py_LeaveRecursiveCall(); if (unlikely(!result) && unlikely(!PyErr_Occurred())) { PyErr_SetString( PyExc_SystemError, "NULL result without error in PyObject_Call"); } return result; } #endif /* PyErrFetchRestore */ #if CYTHON_COMPILING_IN_CPYTHON static CYTHON_INLINE void __Pyx_ErrRestoreInState(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb) { PyObject *tmp_type, *tmp_value, *tmp_tb; tmp_type = tstate->curexc_type; tmp_value = tstate->curexc_value; tmp_tb = tstate->curexc_traceback; tstate->curexc_type = type; tstate->curexc_value = value; tstate->curexc_traceback = tb; Py_XDECREF(tmp_type); Py_XDECREF(tmp_value); Py_XDECREF(tmp_tb); } static CYTHON_INLINE void __Pyx_ErrFetchInState(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb) { *type = tstate->curexc_type; *value = tstate->curexc_value; *tb = tstate->curexc_traceback; tstate->curexc_type = 0; tstate->curexc_value = 0; tstate->curexc_traceback = 0; } #endif /* RaiseException */ #if PY_MAJOR_VERSION < 3 static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, CYTHON_UNUSED PyObject *cause) { __Pyx_PyThreadState_declare Py_XINCREF(type); if (!value || value == Py_None) value = NULL; else Py_INCREF(value); if (!tb || tb == Py_None) tb = NULL; else { Py_INCREF(tb); if (!PyTraceBack_Check(tb)) { PyErr_SetString(PyExc_TypeError, "raise: arg 3 must be a traceback or None"); goto raise_error; } } if (PyType_Check(type)) { #if CYTHON_COMPILING_IN_PYPY if (!value) { Py_INCREF(Py_None); value = Py_None; } #endif PyErr_NormalizeException(&type, &value, &tb); } else { if (value) { PyErr_SetString(PyExc_TypeError, "instance exception may not have a separate value"); goto raise_error; } value = type; type = (PyObject*) Py_TYPE(type); Py_INCREF(type); if (!PyType_IsSubtype((PyTypeObject *)type, (PyTypeObject *)PyExc_BaseException)) { PyErr_SetString(PyExc_TypeError, "raise: exception class must be a subclass of BaseException"); goto raise_error; } } __Pyx_PyThreadState_assign __Pyx_ErrRestore(type, value, tb); return; raise_error: Py_XDECREF(value); Py_XDECREF(type); Py_XDECREF(tb); return; } #else static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, PyObject *cause) { PyObject* owned_instance = NULL; if (tb == Py_None) { tb = 0; } else if (tb && !PyTraceBack_Check(tb)) { PyErr_SetString(PyExc_TypeError, "raise: arg 3 must be a traceback or None"); goto bad; } if (value == Py_None) value = 0; if (PyExceptionInstance_Check(type)) { if (value) { PyErr_SetString(PyExc_TypeError, "instance exception may not have a separate value"); goto bad; } value = type; type = (PyObject*) Py_TYPE(value); } else if (PyExceptionClass_Check(type)) { PyObject *instance_class = NULL; if (value && PyExceptionInstance_Check(value)) { instance_class = (PyObject*) Py_TYPE(value); if (instance_class != type) { int is_subclass = PyObject_IsSubclass(instance_class, type); if (!is_subclass) { instance_class = NULL; } else if (unlikely(is_subclass == -1)) { goto bad; } else { type = instance_class; } } } if (!instance_class) { PyObject *args; if (!value) args = PyTuple_New(0); else if (PyTuple_Check(value)) { Py_INCREF(value); args = value; } else args = PyTuple_Pack(1, value); if (!args) goto bad; owned_instance = PyObject_Call(type, args, NULL); Py_DECREF(args); if (!owned_instance) goto bad; value = owned_instance; if (!PyExceptionInstance_Check(value)) { PyErr_Format(PyExc_TypeError, "calling %R should have returned an instance of " "BaseException, not %R", type, Py_TYPE(value)); goto bad; } } } else { PyErr_SetString(PyExc_TypeError, "raise: exception class must be a subclass of BaseException"); goto bad; } #if PY_VERSION_HEX >= 0x03030000 if (cause) { #else if (cause && cause != Py_None) { #endif PyObject *fixed_cause; if (cause == Py_None) { fixed_cause = NULL; } else if (PyExceptionClass_Check(cause)) { fixed_cause = PyObject_CallObject(cause, NULL); if (fixed_cause == NULL) goto bad; } else if (PyExceptionInstance_Check(cause)) { fixed_cause = cause; Py_INCREF(fixed_cause); } else { PyErr_SetString(PyExc_TypeError, "exception causes must derive from " "BaseException"); goto bad; } PyException_SetCause(value, fixed_cause); } PyErr_SetObject(type, value); if (tb) { #if CYTHON_COMPILING_IN_PYPY PyObject *tmp_type, *tmp_value, *tmp_tb; PyErr_Fetch(&tmp_type, &tmp_value, &tmp_tb); Py_INCREF(tb); PyErr_Restore(tmp_type, tmp_value, tb); Py_XDECREF(tmp_tb); #else PyThreadState *tstate = PyThreadState_GET(); PyObject* tmp_tb = tstate->curexc_traceback; if (tb != tmp_tb) { Py_INCREF(tb); tstate->curexc_traceback = tb; Py_XDECREF(tmp_tb); } #endif } bad: Py_XDECREF(owned_instance); return; } #endif /* FetchCommonType */ static PyTypeObject* __Pyx_FetchCommonType(PyTypeObject* type) { PyObject* fake_module; PyTypeObject* cached_type = NULL; fake_module = PyImport_AddModule((char*) "_cython_" CYTHON_ABI); if (!fake_module) return NULL; Py_INCREF(fake_module); cached_type = (PyTypeObject*) PyObject_GetAttrString(fake_module, type->tp_name); if (cached_type) { if (!PyType_Check((PyObject*)cached_type)) { PyErr_Format(PyExc_TypeError, "Shared Cython type %.200s is not a type object", type->tp_name); goto bad; } if (cached_type->tp_basicsize != type->tp_basicsize) { PyErr_Format(PyExc_TypeError, "Shared Cython type %.200s has the wrong size, try recompiling", type->tp_name); goto bad; } } else { if (!PyErr_ExceptionMatches(PyExc_AttributeError)) goto bad; PyErr_Clear(); if (PyType_Ready(type) < 0) goto bad; if (PyObject_SetAttrString(fake_module, type->tp_name, (PyObject*) type) < 0) goto bad; Py_INCREF(type); cached_type = type; } done: Py_DECREF(fake_module); return cached_type; bad: Py_XDECREF(cached_type); cached_type = NULL; goto done; } /* CythonFunction */ static PyObject * __Pyx_CyFunction_get_doc(__pyx_CyFunctionObject *op, CYTHON_UNUSED void *closure) { if (unlikely(op->func_doc == NULL)) { if (op->func.m_ml->ml_doc) { #if PY_MAJOR_VERSION >= 3 op->func_doc = PyUnicode_FromString(op->func.m_ml->ml_doc); #else op->func_doc = PyString_FromString(op->func.m_ml->ml_doc); #endif if (unlikely(op->func_doc == NULL)) return NULL; } else { Py_INCREF(Py_None); return Py_None; } } Py_INCREF(op->func_doc); return op->func_doc; } static int __Pyx_CyFunction_set_doc(__pyx_CyFunctionObject *op, PyObject *value) { PyObject *tmp = op->func_doc; if (value == NULL) { value = Py_None; } Py_INCREF(value); op->func_doc = value; Py_XDECREF(tmp); return 0; } static PyObject * __Pyx_CyFunction_get_name(__pyx_CyFunctionObject *op) { if (unlikely(op->func_name == NULL)) { #if PY_MAJOR_VERSION >= 3 op->func_name = PyUnicode_InternFromString(op->func.m_ml->ml_name); #else op->func_name = PyString_InternFromString(op->func.m_ml->ml_name); #endif if (unlikely(op->func_name == NULL)) return NULL; } Py_INCREF(op->func_name); return op->func_name; } static int __Pyx_CyFunction_set_name(__pyx_CyFunctionObject *op, PyObject *value) { PyObject *tmp; #if PY_MAJOR_VERSION >= 3 if (unlikely(value == NULL || !PyUnicode_Check(value))) { #else if (unlikely(value == NULL || !PyString_Check(value))) { #endif PyErr_SetString(PyExc_TypeError, "__name__ must be set to a string object"); return -1; } tmp = op->func_name; Py_INCREF(value); op->func_name = value; Py_XDECREF(tmp); return 0; } static PyObject * __Pyx_CyFunction_get_qualname(__pyx_CyFunctionObject *op) { Py_INCREF(op->func_qualname); return op->func_qualname; } static int __Pyx_CyFunction_set_qualname(__pyx_CyFunctionObject *op, PyObject *value) { PyObject *tmp; #if PY_MAJOR_VERSION >= 3 if (unlikely(value == NULL || !PyUnicode_Check(value))) { #else if (unlikely(value == NULL || !PyString_Check(value))) { #endif PyErr_SetString(PyExc_TypeError, "__qualname__ must be set to a string object"); return -1; } tmp = op->func_qualname; Py_INCREF(value); op->func_qualname = value; Py_XDECREF(tmp); return 0; } static PyObject * __Pyx_CyFunction_get_self(__pyx_CyFunctionObject *m, CYTHON_UNUSED void *closure) { PyObject *self; self = m->func_closure; if (self == NULL) self = Py_None; Py_INCREF(self); return self; } static PyObject * __Pyx_CyFunction_get_dict(__pyx_CyFunctionObject *op) { if (unlikely(op->func_dict == NULL)) { op->func_dict = PyDict_New(); if (unlikely(op->func_dict == NULL)) return NULL; } Py_INCREF(op->func_dict); return op->func_dict; } static int __Pyx_CyFunction_set_dict(__pyx_CyFunctionObject *op, PyObject *value) { PyObject *tmp; if (unlikely(value == NULL)) { PyErr_SetString(PyExc_TypeError, "function's dictionary may not be deleted"); return -1; } if (unlikely(!PyDict_Check(value))) { PyErr_SetString(PyExc_TypeError, "setting function's dictionary to a non-dict"); return -1; } tmp = op->func_dict; Py_INCREF(value); op->func_dict = value; Py_XDECREF(tmp); return 0; } static PyObject * __Pyx_CyFunction_get_globals(__pyx_CyFunctionObject *op) { Py_INCREF(op->func_globals); return op->func_globals; } static PyObject * __Pyx_CyFunction_get_closure(CYTHON_UNUSED __pyx_CyFunctionObject *op) { Py_INCREF(Py_None); return Py_None; } static PyObject * __Pyx_CyFunction_get_code(__pyx_CyFunctionObject *op) { PyObject* result = (op->func_code) ? op->func_code : Py_None; Py_INCREF(result); return result; } static int __Pyx_CyFunction_init_defaults(__pyx_CyFunctionObject *op) { int result = 0; PyObject *res = op->defaults_getter((PyObject *) op); if (unlikely(!res)) return -1; #if CYTHON_COMPILING_IN_CPYTHON op->defaults_tuple = PyTuple_GET_ITEM(res, 0); Py_INCREF(op->defaults_tuple); op->defaults_kwdict = PyTuple_GET_ITEM(res, 1); Py_INCREF(op->defaults_kwdict); #else op->defaults_tuple = PySequence_ITEM(res, 0); if (unlikely(!op->defaults_tuple)) result = -1; else { op->defaults_kwdict = PySequence_ITEM(res, 1); if (unlikely(!op->defaults_kwdict)) result = -1; } #endif Py_DECREF(res); return result; } static int __Pyx_CyFunction_set_defaults(__pyx_CyFunctionObject *op, PyObject* value) { PyObject* tmp; if (!value) { value = Py_None; } else if (value != Py_None && !PyTuple_Check(value)) { PyErr_SetString(PyExc_TypeError, "__defaults__ must be set to a tuple object"); return -1; } Py_INCREF(value); tmp = op->defaults_tuple; op->defaults_tuple = value; Py_XDECREF(tmp); return 0; } static PyObject * __Pyx_CyFunction_get_defaults(__pyx_CyFunctionObject *op) { PyObject* result = op->defaults_tuple; if (unlikely(!result)) { if (op->defaults_getter) { if (__Pyx_CyFunction_init_defaults(op) < 0) return NULL; result = op->defaults_tuple; } else { result = Py_None; } } Py_INCREF(result); return result; } static int __Pyx_CyFunction_set_kwdefaults(__pyx_CyFunctionObject *op, PyObject* value) { PyObject* tmp; if (!value) { value = Py_None; } else if (value != Py_None && !PyDict_Check(value)) { PyErr_SetString(PyExc_TypeError, "__kwdefaults__ must be set to a dict object"); return -1; } Py_INCREF(value); tmp = op->defaults_kwdict; op->defaults_kwdict = value; Py_XDECREF(tmp); return 0; } static PyObject * __Pyx_CyFunction_get_kwdefaults(__pyx_CyFunctionObject *op) { PyObject* result = op->defaults_kwdict; if (unlikely(!result)) { if (op->defaults_getter) { if (__Pyx_CyFunction_init_defaults(op) < 0) return NULL; result = op->defaults_kwdict; } else { result = Py_None; } } Py_INCREF(result); return result; } static int __Pyx_CyFunction_set_annotations(__pyx_CyFunctionObject *op, PyObject* value) { PyObject* tmp; if (!value || value == Py_None) { value = NULL; } else if (!PyDict_Check(value)) { PyErr_SetString(PyExc_TypeError, "__annotations__ must be set to a dict object"); return -1; } Py_XINCREF(value); tmp = op->func_annotations; op->func_annotations = value; Py_XDECREF(tmp); return 0; } static PyObject * __Pyx_CyFunction_get_annotations(__pyx_CyFunctionObject *op) { PyObject* result = op->func_annotations; if (unlikely(!result)) { result = PyDict_New(); if (unlikely(!result)) return NULL; op->func_annotations = result; } Py_INCREF(result); return result; } static PyGetSetDef __pyx_CyFunction_getsets[] = { {(char *) "func_doc", (getter)__Pyx_CyFunction_get_doc, (setter)__Pyx_CyFunction_set_doc, 0, 0}, {(char *) "__doc__", (getter)__Pyx_CyFunction_get_doc, (setter)__Pyx_CyFunction_set_doc, 0, 0}, {(char *) "func_name", (getter)__Pyx_CyFunction_get_name, (setter)__Pyx_CyFunction_set_name, 0, 0}, {(char *) "__name__", (getter)__Pyx_CyFunction_get_name, (setter)__Pyx_CyFunction_set_name, 0, 0}, {(char *) "__qualname__", (getter)__Pyx_CyFunction_get_qualname, (setter)__Pyx_CyFunction_set_qualname, 0, 0}, {(char *) "__self__", (getter)__Pyx_CyFunction_get_self, 0, 0, 0}, {(char *) "func_dict", (getter)__Pyx_CyFunction_get_dict, (setter)__Pyx_CyFunction_set_dict, 0, 0}, {(char *) "__dict__", (getter)__Pyx_CyFunction_get_dict, (setter)__Pyx_CyFunction_set_dict, 0, 0}, {(char *) "func_globals", (getter)__Pyx_CyFunction_get_globals, 0, 0, 0}, {(char *) "__globals__", (getter)__Pyx_CyFunction_get_globals, 0, 0, 0}, {(char *) "func_closure", (getter)__Pyx_CyFunction_get_closure, 0, 0, 0}, {(char *) "__closure__", (getter)__Pyx_CyFunction_get_closure, 0, 0, 0}, {(char *) "func_code", (getter)__Pyx_CyFunction_get_code, 0, 0, 0}, {(char *) "__code__", (getter)__Pyx_CyFunction_get_code, 0, 0, 0}, {(char *) "func_defaults", (getter)__Pyx_CyFunction_get_defaults, (setter)__Pyx_CyFunction_set_defaults, 0, 0}, {(char *) "__defaults__", (getter)__Pyx_CyFunction_get_defaults, (setter)__Pyx_CyFunction_set_defaults, 0, 0}, {(char *) "__kwdefaults__", (getter)__Pyx_CyFunction_get_kwdefaults, (setter)__Pyx_CyFunction_set_kwdefaults, 0, 0}, {(char *) "__annotations__", (getter)__Pyx_CyFunction_get_annotations, (setter)__Pyx_CyFunction_set_annotations, 0, 0}, {0, 0, 0, 0, 0} }; static PyMemberDef __pyx_CyFunction_members[] = { {(char *) "__module__", T_OBJECT, offsetof(__pyx_CyFunctionObject, func.m_module), PY_WRITE_RESTRICTED, 0}, {0, 0, 0, 0, 0} }; static PyObject * __Pyx_CyFunction_reduce(__pyx_CyFunctionObject *m, CYTHON_UNUSED PyObject *args) { #if PY_MAJOR_VERSION >= 3 return PyUnicode_FromString(m->func.m_ml->ml_name); #else return PyString_FromString(m->func.m_ml->ml_name); #endif } static PyMethodDef __pyx_CyFunction_methods[] = { {"__reduce__", (PyCFunction)__Pyx_CyFunction_reduce, METH_VARARGS, 0}, {0, 0, 0, 0} }; #if PY_VERSION_HEX < 0x030500A0 #define __Pyx_CyFunction_weakreflist(cyfunc) ((cyfunc)->func_weakreflist) #else #define __Pyx_CyFunction_weakreflist(cyfunc) ((cyfunc)->func.m_weakreflist) #endif static PyObject *__Pyx_CyFunction_New(PyTypeObject *type, PyMethodDef *ml, int flags, PyObject* qualname, PyObject *closure, PyObject *module, PyObject* globals, PyObject* code) { __pyx_CyFunctionObject *op = PyObject_GC_New(__pyx_CyFunctionObject, type); if (op == NULL) return NULL; op->flags = flags; __Pyx_CyFunction_weakreflist(op) = NULL; op->func.m_ml = ml; op->func.m_self = (PyObject *) op; Py_XINCREF(closure); op->func_closure = closure; Py_XINCREF(module); op->func.m_module = module; op->func_dict = NULL; op->func_name = NULL; Py_INCREF(qualname); op->func_qualname = qualname; op->func_doc = NULL; op->func_classobj = NULL; op->func_globals = globals; Py_INCREF(op->func_globals); Py_XINCREF(code); op->func_code = code; op->defaults_pyobjects = 0; op->defaults = NULL; op->defaults_tuple = NULL; op->defaults_kwdict = NULL; op->defaults_getter = NULL; op->func_annotations = NULL; PyObject_GC_Track(op); return (PyObject *) op; } static int __Pyx_CyFunction_clear(__pyx_CyFunctionObject *m) { Py_CLEAR(m->func_closure); Py_CLEAR(m->func.m_module); Py_CLEAR(m->func_dict); Py_CLEAR(m->func_name); Py_CLEAR(m->func_qualname); Py_CLEAR(m->func_doc); Py_CLEAR(m->func_globals); Py_CLEAR(m->func_code); Py_CLEAR(m->func_classobj); Py_CLEAR(m->defaults_tuple); Py_CLEAR(m->defaults_kwdict); Py_CLEAR(m->func_annotations); if (m->defaults) { PyObject **pydefaults = __Pyx_CyFunction_Defaults(PyObject *, m); int i; for (i = 0; i < m->defaults_pyobjects; i++) Py_XDECREF(pydefaults[i]); PyObject_Free(m->defaults); m->defaults = NULL; } return 0; } static void __Pyx_CyFunction_dealloc(__pyx_CyFunctionObject *m) { PyObject_GC_UnTrack(m); if (__Pyx_CyFunction_weakreflist(m) != NULL) PyObject_ClearWeakRefs((PyObject *) m); __Pyx_CyFunction_clear(m); PyObject_GC_Del(m); } static int __Pyx_CyFunction_traverse(__pyx_CyFunctionObject *m, visitproc visit, void *arg) { Py_VISIT(m->func_closure); Py_VISIT(m->func.m_module); Py_VISIT(m->func_dict); Py_VISIT(m->func_name); Py_VISIT(m->func_qualname); Py_VISIT(m->func_doc); Py_VISIT(m->func_globals); Py_VISIT(m->func_code); Py_VISIT(m->func_classobj); Py_VISIT(m->defaults_tuple); Py_VISIT(m->defaults_kwdict); if (m->defaults) { PyObject **pydefaults = __Pyx_CyFunction_Defaults(PyObject *, m); int i; for (i = 0; i < m->defaults_pyobjects; i++) Py_VISIT(pydefaults[i]); } return 0; } static PyObject *__Pyx_CyFunction_descr_get(PyObject *func, PyObject *obj, PyObject *type) { __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func; if (m->flags & __Pyx_CYFUNCTION_STATICMETHOD) { Py_INCREF(func); return func; } if (m->flags & __Pyx_CYFUNCTION_CLASSMETHOD) { if (type == NULL) type = (PyObject *)(Py_TYPE(obj)); return __Pyx_PyMethod_New(func, type, (PyObject *)(Py_TYPE(type))); } if (obj == Py_None) obj = NULL; return __Pyx_PyMethod_New(func, obj, type); } static PyObject* __Pyx_CyFunction_repr(__pyx_CyFunctionObject *op) { #if PY_MAJOR_VERSION >= 3 return PyUnicode_FromFormat("", op->func_qualname, (void *)op); #else return PyString_FromFormat("", PyString_AsString(op->func_qualname), (void *)op); #endif } #if CYTHON_COMPILING_IN_PYPY static PyObject * __Pyx_CyFunction_Call(PyObject *func, PyObject *arg, PyObject *kw) { PyCFunctionObject* f = (PyCFunctionObject*)func; PyCFunction meth = f->m_ml->ml_meth; PyObject *self = f->m_self; Py_ssize_t size; switch (f->m_ml->ml_flags & (METH_VARARGS | METH_KEYWORDS | METH_NOARGS | METH_O)) { case METH_VARARGS: if (likely(kw == NULL || PyDict_Size(kw) == 0)) return (*meth)(self, arg); break; case METH_VARARGS | METH_KEYWORDS: return (*(PyCFunctionWithKeywords)meth)(self, arg, kw); case METH_NOARGS: if (likely(kw == NULL || PyDict_Size(kw) == 0)) { size = PyTuple_GET_SIZE(arg); if (likely(size == 0)) return (*meth)(self, NULL); PyErr_Format(PyExc_TypeError, "%.200s() takes no arguments (%" CYTHON_FORMAT_SSIZE_T "d given)", f->m_ml->ml_name, size); return NULL; } break; case METH_O: if (likely(kw == NULL || PyDict_Size(kw) == 0)) { size = PyTuple_GET_SIZE(arg); if (likely(size == 1)) { PyObject *result, *arg0 = PySequence_ITEM(arg, 0); if (unlikely(!arg0)) return NULL; result = (*meth)(self, arg0); Py_DECREF(arg0); return result; } PyErr_Format(PyExc_TypeError, "%.200s() takes exactly one argument (%" CYTHON_FORMAT_SSIZE_T "d given)", f->m_ml->ml_name, size); return NULL; } break; default: PyErr_SetString(PyExc_SystemError, "Bad call flags in " "__Pyx_CyFunction_Call. METH_OLDARGS is no " "longer supported!"); return NULL; } PyErr_Format(PyExc_TypeError, "%.200s() takes no keyword arguments", f->m_ml->ml_name); return NULL; } #else static PyObject * __Pyx_CyFunction_Call(PyObject *func, PyObject *arg, PyObject *kw) { return PyCFunction_Call(func, arg, kw); } #endif static PyTypeObject __pyx_CyFunctionType_type = { PyVarObject_HEAD_INIT(0, 0) "cython_function_or_method", sizeof(__pyx_CyFunctionObject), 0, (destructor) __Pyx_CyFunction_dealloc, 0, 0, 0, #if PY_MAJOR_VERSION < 3 0, #else 0, #endif (reprfunc) __Pyx_CyFunction_repr, 0, 0, 0, 0, __Pyx_CyFunction_Call, 0, 0, 0, 0, Py_TPFLAGS_DEFAULT | Py_TPFLAGS_HAVE_GC, 0, (traverseproc) __Pyx_CyFunction_traverse, (inquiry) __Pyx_CyFunction_clear, 0, #if PY_VERSION_HEX < 0x030500A0 offsetof(__pyx_CyFunctionObject, func_weakreflist), #else offsetof(PyCFunctionObject, m_weakreflist), #endif 0, 0, __pyx_CyFunction_methods, __pyx_CyFunction_members, __pyx_CyFunction_getsets, 0, 0, __Pyx_CyFunction_descr_get, 0, offsetof(__pyx_CyFunctionObject, func_dict), 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, #if PY_VERSION_HEX >= 0x030400a1 0, #endif }; static int __pyx_CyFunction_init(void) { #if !CYTHON_COMPILING_IN_PYPY __pyx_CyFunctionType_type.tp_call = PyCFunction_Call; #endif __pyx_CyFunctionType = __Pyx_FetchCommonType(&__pyx_CyFunctionType_type); if (__pyx_CyFunctionType == NULL) { return -1; } return 0; } static CYTHON_INLINE void *__Pyx_CyFunction_InitDefaults(PyObject *func, size_t size, int pyobjects) { __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func; m->defaults = PyObject_Malloc(size); if (!m->defaults) return PyErr_NoMemory(); memset(m->defaults, 0, size); m->defaults_pyobjects = pyobjects; return m->defaults; } static CYTHON_INLINE void __Pyx_CyFunction_SetDefaultsTuple(PyObject *func, PyObject *tuple) { __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func; m->defaults_tuple = tuple; Py_INCREF(tuple); } static CYTHON_INLINE void __Pyx_CyFunction_SetDefaultsKwDict(PyObject *func, PyObject *dict) { __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func; m->defaults_kwdict = dict; Py_INCREF(dict); } static CYTHON_INLINE void __Pyx_CyFunction_SetAnnotationsDict(PyObject *func, PyObject *dict) { __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func; m->func_annotations = dict; Py_INCREF(dict); } /* GetModuleGlobalName */ static CYTHON_INLINE PyObject *__Pyx_GetModuleGlobalName(PyObject *name) { PyObject *result; #if CYTHON_COMPILING_IN_CPYTHON result = PyDict_GetItem(__pyx_d, name); if (likely(result)) { Py_INCREF(result); } else { #else result = PyObject_GetItem(__pyx_d, name); if (!result) { PyErr_Clear(); #endif result = __Pyx_GetBuiltinName(name); } return result; } /* PyObjectCallMethO */ #if CYTHON_COMPILING_IN_CPYTHON static CYTHON_INLINE PyObject* __Pyx_PyObject_CallMethO(PyObject *func, PyObject *arg) { PyObject *self, *result; PyCFunction cfunc; cfunc = PyCFunction_GET_FUNCTION(func); self = PyCFunction_GET_SELF(func); if (unlikely(Py_EnterRecursiveCall((char*)" while calling a Python object"))) return NULL; result = cfunc(self, arg); Py_LeaveRecursiveCall(); if (unlikely(!result) && unlikely(!PyErr_Occurred())) { PyErr_SetString( PyExc_SystemError, "NULL result without error in PyObject_Call"); } return result; } #endif /* PyObjectCallOneArg */ #if CYTHON_COMPILING_IN_CPYTHON static PyObject* __Pyx__PyObject_CallOneArg(PyObject *func, PyObject *arg) { PyObject *result; PyObject *args = PyTuple_New(1); if (unlikely(!args)) return NULL; Py_INCREF(arg); PyTuple_SET_ITEM(args, 0, arg); result = __Pyx_PyObject_Call(func, args, NULL); Py_DECREF(args); return result; } static CYTHON_INLINE PyObject* __Pyx_PyObject_CallOneArg(PyObject *func, PyObject *arg) { #ifdef __Pyx_CyFunction_USED if (likely(PyCFunction_Check(func) || PyObject_TypeCheck(func, __pyx_CyFunctionType))) { #else if (likely(PyCFunction_Check(func))) { #endif if (likely(PyCFunction_GET_FLAGS(func) & METH_O)) { return __Pyx_PyObject_CallMethO(func, arg); } } return __Pyx__PyObject_CallOneArg(func, arg); } #else static CYTHON_INLINE PyObject* __Pyx_PyObject_CallOneArg(PyObject *func, PyObject *arg) { PyObject *result; PyObject *args = PyTuple_Pack(1, arg); if (unlikely(!args)) return NULL; result = __Pyx_PyObject_Call(func, args, NULL); Py_DECREF(args); return result; } #endif /* SaveResetException */ #if CYTHON_COMPILING_IN_CPYTHON static CYTHON_INLINE void __Pyx__ExceptionSave(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb) { *type = tstate->exc_type; *value = tstate->exc_value; *tb = tstate->exc_traceback; Py_XINCREF(*type); Py_XINCREF(*value); Py_XINCREF(*tb); } static CYTHON_INLINE void __Pyx__ExceptionReset(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb) { PyObject *tmp_type, *tmp_value, *tmp_tb; tmp_type = tstate->exc_type; tmp_value = tstate->exc_value; tmp_tb = tstate->exc_traceback; tstate->exc_type = type; tstate->exc_value = value; tstate->exc_traceback = tb; Py_XDECREF(tmp_type); Py_XDECREF(tmp_value); Py_XDECREF(tmp_tb); } #endif /* PyErrExceptionMatches */ #if CYTHON_COMPILING_IN_CPYTHON static CYTHON_INLINE int __Pyx_PyErr_ExceptionMatchesInState(PyThreadState* tstate, PyObject* err) { PyObject *exc_type = tstate->curexc_type; if (exc_type == err) return 1; if (unlikely(!exc_type)) return 0; return PyErr_GivenExceptionMatches(exc_type, err); } #endif /* GetException */ #if CYTHON_COMPILING_IN_CPYTHON static int __Pyx__GetException(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb) { #else static int __Pyx_GetException(PyObject **type, PyObject **value, PyObject **tb) { #endif PyObject *local_type, *local_value, *local_tb; #if CYTHON_COMPILING_IN_CPYTHON PyObject *tmp_type, *tmp_value, *tmp_tb; local_type = tstate->curexc_type; local_value = tstate->curexc_value; local_tb = tstate->curexc_traceback; tstate->curexc_type = 0; tstate->curexc_value = 0; tstate->curexc_traceback = 0; #else PyErr_Fetch(&local_type, &local_value, &local_tb); #endif PyErr_NormalizeException(&local_type, &local_value, &local_tb); #if CYTHON_COMPILING_IN_CPYTHON if (unlikely(tstate->curexc_type)) #else if (unlikely(PyErr_Occurred())) #endif goto bad; #if PY_MAJOR_VERSION >= 3 if (local_tb) { if (unlikely(PyException_SetTraceback(local_value, local_tb) < 0)) goto bad; } #endif Py_XINCREF(local_tb); Py_XINCREF(local_type); Py_XINCREF(local_value); *type = local_type; *value = local_value; *tb = local_tb; #if CYTHON_COMPILING_IN_CPYTHON tmp_type = tstate->exc_type; tmp_value = tstate->exc_value; tmp_tb = tstate->exc_traceback; tstate->exc_type = local_type; tstate->exc_value = local_value; tstate->exc_traceback = local_tb; Py_XDECREF(tmp_type); Py_XDECREF(tmp_value); Py_XDECREF(tmp_tb); #else PyErr_SetExcInfo(local_type, local_value, local_tb); #endif return 0; bad: *type = 0; *value = 0; *tb = 0; Py_XDECREF(local_type); Py_XDECREF(local_value); Py_XDECREF(local_tb); return -1; } /* SwapException */ #if CYTHON_COMPILING_IN_CPYTHON static CYTHON_INLINE void __Pyx__ExceptionSwap(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb) { PyObject *tmp_type, *tmp_value, *tmp_tb; tmp_type = tstate->exc_type; tmp_value = tstate->exc_value; tmp_tb = tstate->exc_traceback; tstate->exc_type = *type; tstate->exc_value = *value; tstate->exc_traceback = *tb; *type = tmp_type; *value = tmp_value; *tb = tmp_tb; } #else static CYTHON_INLINE void __Pyx_ExceptionSwap(PyObject **type, PyObject **value, PyObject **tb) { PyObject *tmp_type, *tmp_value, *tmp_tb; PyErr_GetExcInfo(&tmp_type, &tmp_value, &tmp_tb); PyErr_SetExcInfo(*type, *value, *tb); *type = tmp_type; *value = tmp_value; *tb = tmp_tb; } #endif /* PyObjectCallNoArg */ #if CYTHON_COMPILING_IN_CPYTHON static CYTHON_INLINE PyObject* __Pyx_PyObject_CallNoArg(PyObject *func) { #ifdef __Pyx_CyFunction_USED if (likely(PyCFunction_Check(func) || PyObject_TypeCheck(func, __pyx_CyFunctionType))) { #else if (likely(PyCFunction_Check(func))) { #endif if (likely(PyCFunction_GET_FLAGS(func) & METH_NOARGS)) { return __Pyx_PyObject_CallMethO(func, NULL); } } return __Pyx_PyObject_Call(func, __pyx_empty_tuple, NULL); } #endif /* ArgTypeTest */ static void __Pyx_RaiseArgumentTypeInvalid(const char* name, PyObject *obj, PyTypeObject *type) { PyErr_Format(PyExc_TypeError, "Argument '%.200s' has incorrect type (expected %.200s, got %.200s)", name, type->tp_name, Py_TYPE(obj)->tp_name); } static CYTHON_INLINE int __Pyx_ArgTypeTest(PyObject *obj, PyTypeObject *type, int none_allowed, const char *name, int exact) { if (unlikely(!type)) { PyErr_SetString(PyExc_SystemError, "Missing type object"); return 0; } if (none_allowed && obj == Py_None) return 1; else if (exact) { if (likely(Py_TYPE(obj) == type)) return 1; #if PY_MAJOR_VERSION == 2 else if ((type == &PyBaseString_Type) && likely(__Pyx_PyBaseString_CheckExact(obj))) return 1; #endif } else { if (likely(PyObject_TypeCheck(obj, type))) return 1; } __Pyx_RaiseArgumentTypeInvalid(name, obj, type); return 0; } /* RaiseArgTupleInvalid */ static void __Pyx_RaiseArgtupleInvalid( const char* func_name, int exact, Py_ssize_t num_min, Py_ssize_t num_max, Py_ssize_t num_found) { Py_ssize_t num_expected; const char *more_or_less; if (num_found < num_min) { num_expected = num_min; more_or_less = "at least"; } else { num_expected = num_max; more_or_less = "at most"; } if (exact) { more_or_less = "exactly"; } PyErr_Format(PyExc_TypeError, "%.200s() takes %.8s %" CYTHON_FORMAT_SSIZE_T "d positional argument%.1s (%" CYTHON_FORMAT_SSIZE_T "d given)", func_name, more_or_less, num_expected, (num_expected == 1) ? "" : "s", num_found); } /* KeywordStringCheck */ static CYTHON_INLINE int __Pyx_CheckKeywordStrings( PyObject *kwdict, const char* function_name, int kw_allowed) { PyObject* key = 0; Py_ssize_t pos = 0; #if CYTHON_COMPILING_IN_PYPY if (!kw_allowed && PyDict_Next(kwdict, &pos, &key, 0)) goto invalid_keyword; return 1; #else while (PyDict_Next(kwdict, &pos, &key, 0)) { #if PY_MAJOR_VERSION < 3 if (unlikely(!PyString_CheckExact(key)) && unlikely(!PyString_Check(key))) #endif if (unlikely(!PyUnicode_Check(key))) goto invalid_keyword_type; } if ((!kw_allowed) && unlikely(key)) goto invalid_keyword; return 1; invalid_keyword_type: PyErr_Format(PyExc_TypeError, "%.200s() keywords must be strings", function_name); return 0; #endif invalid_keyword: PyErr_Format(PyExc_TypeError, #if PY_MAJOR_VERSION < 3 "%.200s() got an unexpected keyword argument '%.200s'", function_name, PyString_AsString(key)); #else "%s() got an unexpected keyword argument '%U'", function_name, key); #endif return 0; } /* GetItemInt */ static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Generic(PyObject *o, PyObject* j) { PyObject *r; if (!j) return NULL; r = PyObject_GetItem(o, j); Py_DECREF(j); return r; } static CYTHON_INLINE PyObject *__Pyx_GetItemInt_List_Fast(PyObject *o, Py_ssize_t i, CYTHON_NCP_UNUSED int wraparound, CYTHON_NCP_UNUSED int boundscheck) { #if CYTHON_COMPILING_IN_CPYTHON if (wraparound & unlikely(i < 0)) i += PyList_GET_SIZE(o); if ((!boundscheck) || likely((0 <= i) & (i < PyList_GET_SIZE(o)))) { PyObject *r = PyList_GET_ITEM(o, i); Py_INCREF(r); return r; } return __Pyx_GetItemInt_Generic(o, PyInt_FromSsize_t(i)); #else return PySequence_GetItem(o, i); #endif } static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Tuple_Fast(PyObject *o, Py_ssize_t i, CYTHON_NCP_UNUSED int wraparound, CYTHON_NCP_UNUSED int boundscheck) { #if CYTHON_COMPILING_IN_CPYTHON if (wraparound & unlikely(i < 0)) i += PyTuple_GET_SIZE(o); if ((!boundscheck) || likely((0 <= i) & (i < PyTuple_GET_SIZE(o)))) { PyObject *r = PyTuple_GET_ITEM(o, i); Py_INCREF(r); return r; } return __Pyx_GetItemInt_Generic(o, PyInt_FromSsize_t(i)); #else return PySequence_GetItem(o, i); #endif } static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Fast(PyObject *o, Py_ssize_t i, int is_list, CYTHON_NCP_UNUSED int wraparound, CYTHON_NCP_UNUSED int boundscheck) { #if CYTHON_COMPILING_IN_CPYTHON if (is_list || PyList_CheckExact(o)) { Py_ssize_t n = ((!wraparound) | likely(i >= 0)) ? i : i + PyList_GET_SIZE(o); if ((!boundscheck) || (likely((n >= 0) & (n < PyList_GET_SIZE(o))))) { PyObject *r = PyList_GET_ITEM(o, n); Py_INCREF(r); return r; } } else if (PyTuple_CheckExact(o)) { Py_ssize_t n = ((!wraparound) | likely(i >= 0)) ? i : i + PyTuple_GET_SIZE(o); if ((!boundscheck) || likely((n >= 0) & (n < PyTuple_GET_SIZE(o)))) { PyObject *r = PyTuple_GET_ITEM(o, n); Py_INCREF(r); return r; } } else { PySequenceMethods *m = Py_TYPE(o)->tp_as_sequence; if (likely(m && m->sq_item)) { if (wraparound && unlikely(i < 0) && likely(m->sq_length)) { Py_ssize_t l = m->sq_length(o); if (likely(l >= 0)) { i += l; } else { if (!PyErr_ExceptionMatches(PyExc_OverflowError)) return NULL; PyErr_Clear(); } } return m->sq_item(o, i); } } #else if (is_list || PySequence_Check(o)) { return PySequence_GetItem(o, i); } #endif return __Pyx_GetItemInt_Generic(o, PyInt_FromSsize_t(i)); } /* SliceObject */ static CYTHON_INLINE PyObject* __Pyx_PyObject_GetSlice(PyObject* obj, Py_ssize_t cstart, Py_ssize_t cstop, PyObject** _py_start, PyObject** _py_stop, PyObject** _py_slice, int has_cstart, int has_cstop, CYTHON_UNUSED int wraparound) { #if CYTHON_COMPILING_IN_CPYTHON PyMappingMethods* mp; #if PY_MAJOR_VERSION < 3 PySequenceMethods* ms = Py_TYPE(obj)->tp_as_sequence; if (likely(ms && ms->sq_slice)) { if (!has_cstart) { if (_py_start && (*_py_start != Py_None)) { cstart = __Pyx_PyIndex_AsSsize_t(*_py_start); if ((cstart == (Py_ssize_t)-1) && PyErr_Occurred()) goto bad; } else cstart = 0; } if (!has_cstop) { if (_py_stop && (*_py_stop != Py_None)) { cstop = __Pyx_PyIndex_AsSsize_t(*_py_stop); if ((cstop == (Py_ssize_t)-1) && PyErr_Occurred()) goto bad; } else cstop = PY_SSIZE_T_MAX; } if (wraparound && unlikely((cstart < 0) | (cstop < 0)) && likely(ms->sq_length)) { Py_ssize_t l = ms->sq_length(obj); if (likely(l >= 0)) { if (cstop < 0) { cstop += l; if (cstop < 0) cstop = 0; } if (cstart < 0) { cstart += l; if (cstart < 0) cstart = 0; } } else { if (!PyErr_ExceptionMatches(PyExc_OverflowError)) goto bad; PyErr_Clear(); } } return ms->sq_slice(obj, cstart, cstop); } #endif mp = Py_TYPE(obj)->tp_as_mapping; if (likely(mp && mp->mp_subscript)) #endif { PyObject* result; PyObject *py_slice, *py_start, *py_stop; if (_py_slice) { py_slice = *_py_slice; } else { PyObject* owned_start = NULL; PyObject* owned_stop = NULL; if (_py_start) { py_start = *_py_start; } else { if (has_cstart) { owned_start = py_start = PyInt_FromSsize_t(cstart); if (unlikely(!py_start)) goto bad; } else py_start = Py_None; } if (_py_stop) { py_stop = *_py_stop; } else { if (has_cstop) { owned_stop = py_stop = PyInt_FromSsize_t(cstop); if (unlikely(!py_stop)) { Py_XDECREF(owned_start); goto bad; } } else py_stop = Py_None; } py_slice = PySlice_New(py_start, py_stop, Py_None); Py_XDECREF(owned_start); Py_XDECREF(owned_stop); if (unlikely(!py_slice)) goto bad; } #if CYTHON_COMPILING_IN_CPYTHON result = mp->mp_subscript(obj, py_slice); #else result = PyObject_GetItem(obj, py_slice); #endif if (!_py_slice) { Py_DECREF(py_slice); } return result; } PyErr_Format(PyExc_TypeError, "'%.200s' object is unsliceable", Py_TYPE(obj)->tp_name); bad: return NULL; } /* PyIntBinop */ #if CYTHON_COMPILING_IN_CPYTHON static PyObject* __Pyx_PyInt_EqObjC(PyObject *op1, PyObject *op2, CYTHON_UNUSED long intval, CYTHON_UNUSED int inplace) { if (op1 == op2) { Py_RETURN_TRUE; } #if PY_MAJOR_VERSION < 3 if (likely(PyInt_CheckExact(op1))) { const long b = intval; long a = PyInt_AS_LONG(op1); if (a == b) { Py_RETURN_TRUE; } else { Py_RETURN_FALSE; } } #endif #if CYTHON_USE_PYLONG_INTERNALS && PY_MAJOR_VERSION >= 3 if (likely(PyLong_CheckExact(op1))) { const long b = intval; long a; const digit* digits = ((PyLongObject*)op1)->ob_digit; const Py_ssize_t size = Py_SIZE(op1); if (likely(__Pyx_sst_abs(size) <= 1)) { a = likely(size) ? digits[0] : 0; if (size == -1) a = -a; } else { switch (size) { case -2: if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) { a = -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])); break; } case 2: if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) { a = (long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])); break; } case -3: if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) { a = -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])); break; } case 3: if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) { a = (long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])); break; } case -4: if (8 * sizeof(long) - 1 > 4 * PyLong_SHIFT) { a = -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])); break; } case 4: if (8 * sizeof(long) - 1 > 4 * PyLong_SHIFT) { a = (long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])); break; } #if PyLong_SHIFT < 30 && PyLong_SHIFT != 15 default: return PyLong_Type.tp_richcompare(op1, op2, Py_EQ); #else default: Py_RETURN_FALSE; #endif } } if (a == b) { Py_RETURN_TRUE; } else { Py_RETURN_FALSE; } } #endif if (PyFloat_CheckExact(op1)) { const long b = intval; double a = PyFloat_AS_DOUBLE(op1); if ((double)a == (double)b) { Py_RETURN_TRUE; } else { Py_RETURN_FALSE; } } return PyObject_RichCompare(op1, op2, Py_EQ); } #endif /* RaiseDoubleKeywords */ static void __Pyx_RaiseDoubleKeywordsError( const char* func_name, PyObject* kw_name) { PyErr_Format(PyExc_TypeError, #if PY_MAJOR_VERSION >= 3 "%s() got multiple values for keyword argument '%U'", func_name, kw_name); #else "%s() got multiple values for keyword argument '%s'", func_name, PyString_AsString(kw_name)); #endif } /* ParseKeywords */ static int __Pyx_ParseOptionalKeywords( PyObject *kwds, PyObject **argnames[], PyObject *kwds2, PyObject *values[], Py_ssize_t num_pos_args, const char* function_name) { PyObject *key = 0, *value = 0; Py_ssize_t pos = 0; PyObject*** name; PyObject*** first_kw_arg = argnames + num_pos_args; while (PyDict_Next(kwds, &pos, &key, &value)) { name = first_kw_arg; while (*name && (**name != key)) name++; if (*name) { values[name-argnames] = value; continue; } name = first_kw_arg; #if PY_MAJOR_VERSION < 3 if (likely(PyString_CheckExact(key)) || likely(PyString_Check(key))) { while (*name) { if ((CYTHON_COMPILING_IN_PYPY || PyString_GET_SIZE(**name) == PyString_GET_SIZE(key)) && _PyString_Eq(**name, key)) { values[name-argnames] = value; break; } name++; } if (*name) continue; else { PyObject*** argname = argnames; while (argname != first_kw_arg) { if ((**argname == key) || ( (CYTHON_COMPILING_IN_PYPY || PyString_GET_SIZE(**argname) == PyString_GET_SIZE(key)) && _PyString_Eq(**argname, key))) { goto arg_passed_twice; } argname++; } } } else #endif if (likely(PyUnicode_Check(key))) { while (*name) { int cmp = (**name == key) ? 0 : #if !CYTHON_COMPILING_IN_PYPY && PY_MAJOR_VERSION >= 3 (PyUnicode_GET_SIZE(**name) != PyUnicode_GET_SIZE(key)) ? 1 : #endif PyUnicode_Compare(**name, key); if (cmp < 0 && unlikely(PyErr_Occurred())) goto bad; if (cmp == 0) { values[name-argnames] = value; break; } name++; } if (*name) continue; else { PyObject*** argname = argnames; while (argname != first_kw_arg) { int cmp = (**argname == key) ? 0 : #if !CYTHON_COMPILING_IN_PYPY && PY_MAJOR_VERSION >= 3 (PyUnicode_GET_SIZE(**argname) != PyUnicode_GET_SIZE(key)) ? 1 : #endif PyUnicode_Compare(**argname, key); if (cmp < 0 && unlikely(PyErr_Occurred())) goto bad; if (cmp == 0) goto arg_passed_twice; argname++; } } } else goto invalid_keyword_type; if (kwds2) { if (unlikely(PyDict_SetItem(kwds2, key, value))) goto bad; } else { goto invalid_keyword; } } return 0; arg_passed_twice: __Pyx_RaiseDoubleKeywordsError(function_name, key); goto bad; invalid_keyword_type: PyErr_Format(PyExc_TypeError, "%.200s() keywords must be strings", function_name); goto bad; invalid_keyword: PyErr_Format(PyExc_TypeError, #if PY_MAJOR_VERSION < 3 "%.200s() got an unexpected keyword argument '%.200s'", function_name, PyString_AsString(key)); #else "%s() got an unexpected keyword argument '%U'", function_name, key); #endif bad: return -1; } /* PyIntBinop */ #if CYTHON_COMPILING_IN_CPYTHON static PyObject* __Pyx_PyInt_SubtractCObj(PyObject *op1, PyObject *op2, CYTHON_UNUSED long intval, CYTHON_UNUSED int inplace) { #if PY_MAJOR_VERSION < 3 if (likely(PyInt_CheckExact(op2))) { const long a = intval; long x; long b = PyInt_AS_LONG(op2); x = (long)((unsigned long)a - b); if (likely((x^a) >= 0 || (x^~b) >= 0)) return PyInt_FromLong(x); return PyLong_Type.tp_as_number->nb_subtract(op1, op2); } #endif #if CYTHON_USE_PYLONG_INTERNALS && PY_MAJOR_VERSION >= 3 if (likely(PyLong_CheckExact(op2))) { const long a = intval; long b, x; const PY_LONG_LONG lla = intval; PY_LONG_LONG llb, llx; const digit* digits = ((PyLongObject*)op2)->ob_digit; const Py_ssize_t size = Py_SIZE(op2); if (likely(__Pyx_sst_abs(size) <= 1)) { b = likely(size) ? digits[0] : 0; if (size == -1) b = -b; } else { switch (size) { case -2: if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) { b = -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])); break; } else if (8 * sizeof(PY_LONG_LONG) - 1 > 2 * PyLong_SHIFT) { llb = -(PY_LONG_LONG) (((((unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0])); goto long_long; } case 2: if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) { b = (long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])); break; } else if (8 * sizeof(PY_LONG_LONG) - 1 > 2 * PyLong_SHIFT) { llb = (PY_LONG_LONG) (((((unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0])); goto long_long; } case -3: if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) { b = -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])); break; } else if (8 * sizeof(PY_LONG_LONG) - 1 > 3 * PyLong_SHIFT) { llb = -(PY_LONG_LONG) (((((((unsigned PY_LONG_LONG)digits[2]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0])); goto long_long; } case 3: if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) { b = (long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])); break; } else if (8 * sizeof(PY_LONG_LONG) - 1 > 3 * PyLong_SHIFT) { llb = (PY_LONG_LONG) (((((((unsigned PY_LONG_LONG)digits[2]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0])); goto long_long; } case -4: if (8 * sizeof(long) - 1 > 4 * PyLong_SHIFT) { b = -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])); break; } else if (8 * sizeof(PY_LONG_LONG) - 1 > 4 * PyLong_SHIFT) { llb = -(PY_LONG_LONG) (((((((((unsigned PY_LONG_LONG)digits[3]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[2]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0])); goto long_long; } case 4: if (8 * sizeof(long) - 1 > 4 * PyLong_SHIFT) { b = (long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])); break; } else if (8 * sizeof(PY_LONG_LONG) - 1 > 4 * PyLong_SHIFT) { llb = (PY_LONG_LONG) (((((((((unsigned PY_LONG_LONG)digits[3]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[2]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0])); goto long_long; } default: return PyLong_Type.tp_as_number->nb_subtract(op1, op2); } } x = a - b; return PyLong_FromLong(x); long_long: llx = lla - llb; return PyLong_FromLongLong(llx); } #endif if (PyFloat_CheckExact(op2)) { const long a = intval; double b = PyFloat_AS_DOUBLE(op2); double result; PyFPE_START_PROTECT("subtract", return NULL) result = ((double)a) - (double)b; PyFPE_END_PROTECT(result) return PyFloat_FromDouble(result); } return (inplace ? PyNumber_InPlaceSubtract : PyNumber_Subtract)(op1, op2); } #endif /* None */ static CYTHON_INLINE double __Pyx_mod_double(double a, double b) { double r = fmod(a, b); r += ((r != 0) & ((r < 0) ^ (b < 0))) * b; return r; } /* PyFloatBinop */ #if CYTHON_COMPILING_IN_CPYTHON static PyObject* __Pyx_PyFloat_RemainderObjC(PyObject *op1, PyObject *op2, double floatval, CYTHON_UNUSED int inplace) { const double b = floatval; double a, result; if (likely(PyFloat_CheckExact(op1))) { a = PyFloat_AS_DOUBLE(op1); } else #if PY_MAJOR_VERSION < 3 if (likely(PyInt_CheckExact(op1))) { a = (double) PyInt_AS_LONG(op1); } else #endif if (likely(PyLong_CheckExact(op1))) { #if CYTHON_USE_PYLONG_INTERNALS && PY_MAJOR_VERSION >= 3 const digit* digits = ((PyLongObject*)op1)->ob_digit; const Py_ssize_t size = Py_SIZE(op1); switch (size) { case 0: a = 0.0; break; case -1: a = -(double) digits[0]; break; case 1: a = (double) digits[0]; break; case -2: case 2: if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT && ((8 * sizeof(unsigned long) < 53) || (1 * PyLong_SHIFT < 53))) { a = (double) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])); if ((8 * sizeof(unsigned long) < 53) || (2 * PyLong_SHIFT < 53) || (a < (double) (1L<<53))) { if (size == -2) a = -a; break; } } case -3: case 3: if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT && ((8 * sizeof(unsigned long) < 53) || (2 * PyLong_SHIFT < 53))) { a = (double) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])); if ((8 * sizeof(unsigned long) < 53) || (3 * PyLong_SHIFT < 53) || (a < (double) (1L<<53))) { if (size == -3) a = -a; break; } } case -4: case 4: if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT && ((8 * sizeof(unsigned long) < 53) || (3 * PyLong_SHIFT < 53))) { a = (double) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])); if ((8 * sizeof(unsigned long) < 53) || (4 * PyLong_SHIFT < 53) || (a < (double) (1L<<53))) { if (size == -4) a = -a; break; } } default: #else { #endif a = PyLong_AsDouble(op1); if (unlikely(a == -1.0 && PyErr_Occurred())) return NULL; } } else { return (inplace ? PyNumber_InPlaceRemainder : PyNumber_Remainder)(op1, op2); } PyFPE_START_PROTECT("remainder", return NULL) result = fmod(a, b); if (result) result += ((result < 0) ^ (b < 0)) * b; else result = copysign(0.0, b); PyFPE_END_PROTECT(result) return PyFloat_FromDouble(result); } #endif /* PyFloatBinop */ #if CYTHON_COMPILING_IN_CPYTHON static PyObject* __Pyx_PyFloat_TrueDivideObjC(PyObject *op1, PyObject *op2, double floatval, CYTHON_UNUSED int inplace) { const double b = floatval; double a, result; if (likely(PyFloat_CheckExact(op1))) { a = PyFloat_AS_DOUBLE(op1); } else #if PY_MAJOR_VERSION < 3 if (likely(PyInt_CheckExact(op1))) { a = (double) PyInt_AS_LONG(op1); } else #endif if (likely(PyLong_CheckExact(op1))) { #if CYTHON_USE_PYLONG_INTERNALS && PY_MAJOR_VERSION >= 3 const digit* digits = ((PyLongObject*)op1)->ob_digit; const Py_ssize_t size = Py_SIZE(op1); switch (size) { case 0: a = 0.0; break; case -1: a = -(double) digits[0]; break; case 1: a = (double) digits[0]; break; case -2: case 2: if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT && ((8 * sizeof(unsigned long) < 53) || (1 * PyLong_SHIFT < 53))) { a = (double) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])); if ((8 * sizeof(unsigned long) < 53) || (2 * PyLong_SHIFT < 53) || (a < (double) (1L<<53))) { if (size == -2) a = -a; break; } } case -3: case 3: if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT && ((8 * sizeof(unsigned long) < 53) || (2 * PyLong_SHIFT < 53))) { a = (double) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])); if ((8 * sizeof(unsigned long) < 53) || (3 * PyLong_SHIFT < 53) || (a < (double) (1L<<53))) { if (size == -3) a = -a; break; } } case -4: case 4: if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT && ((8 * sizeof(unsigned long) < 53) || (3 * PyLong_SHIFT < 53))) { a = (double) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])); if ((8 * sizeof(unsigned long) < 53) || (4 * PyLong_SHIFT < 53) || (a < (double) (1L<<53))) { if (size == -4) a = -a; break; } } default: #else { #endif a = PyLong_AsDouble(op1); if (unlikely(a == -1.0 && PyErr_Occurred())) return NULL; } } else { return (inplace ? PyNumber_InPlaceTrueDivide : PyNumber_TrueDivide)(op1, op2); } PyFPE_START_PROTECT("divide", return NULL) result = a / b; PyFPE_END_PROTECT(result) return PyFloat_FromDouble(result); } #endif /* None */ static CYTHON_INLINE void __Pyx_RaiseClosureNameError(const char *varname) { PyErr_Format(PyExc_NameError, "free variable '%s' referenced before assignment in enclosing scope", varname); } /* SetVTable */ static int __Pyx_SetVtable(PyObject *dict, void *vtable) { #if PY_VERSION_HEX >= 0x02070000 PyObject *ob = PyCapsule_New(vtable, 0, 0); #else PyObject *ob = PyCObject_FromVoidPtr(vtable, 0); #endif if (!ob) goto bad; if (PyDict_SetItem(dict, __pyx_n_s_pyx_vtable, ob) < 0) goto bad; Py_DECREF(ob); return 0; bad: Py_XDECREF(ob); return -1; } /* Import */ static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list, int level) { PyObject *empty_list = 0; PyObject *module = 0; PyObject *global_dict = 0; PyObject *empty_dict = 0; PyObject *list; #if PY_VERSION_HEX < 0x03030000 PyObject *py_import; py_import = __Pyx_PyObject_GetAttrStr(__pyx_b, __pyx_n_s_import); if (!py_import) goto bad; #endif if (from_list) list = from_list; else { empty_list = PyList_New(0); if (!empty_list) goto bad; list = empty_list; } global_dict = PyModule_GetDict(__pyx_m); if (!global_dict) goto bad; empty_dict = PyDict_New(); if (!empty_dict) goto bad; { #if PY_MAJOR_VERSION >= 3 if (level == -1) { if (strchr(__Pyx_MODULE_NAME, '.')) { #if PY_VERSION_HEX < 0x03030000 PyObject *py_level = PyInt_FromLong(1); if (!py_level) goto bad; module = PyObject_CallFunctionObjArgs(py_import, name, global_dict, empty_dict, list, py_level, NULL); Py_DECREF(py_level); #else module = PyImport_ImportModuleLevelObject( name, global_dict, empty_dict, list, 1); #endif if (!module) { if (!PyErr_ExceptionMatches(PyExc_ImportError)) goto bad; PyErr_Clear(); } } level = 0; } #endif if (!module) { #if PY_VERSION_HEX < 0x03030000 PyObject *py_level = PyInt_FromLong(level); if (!py_level) goto bad; module = PyObject_CallFunctionObjArgs(py_import, name, global_dict, empty_dict, list, py_level, NULL); Py_DECREF(py_level); #else module = PyImport_ImportModuleLevelObject( name, global_dict, empty_dict, list, level); #endif } } bad: #if PY_VERSION_HEX < 0x03030000 Py_XDECREF(py_import); #endif Py_XDECREF(empty_list); Py_XDECREF(empty_dict); return module; } /* CodeObjectCache */ static int __pyx_bisect_code_objects(__Pyx_CodeObjectCacheEntry* entries, int count, int code_line) { int start = 0, mid = 0, end = count - 1; if (end >= 0 && code_line > entries[end].code_line) { return count; } while (start < end) { mid = start + (end - start) / 2; if (code_line < entries[mid].code_line) { end = mid; } else if (code_line > entries[mid].code_line) { start = mid + 1; } else { return mid; } } if (code_line <= entries[mid].code_line) { return mid; } else { return mid + 1; } } static PyCodeObject *__pyx_find_code_object(int code_line) { PyCodeObject* code_object; int pos; if (unlikely(!code_line) || unlikely(!__pyx_code_cache.entries)) { return NULL; } pos = __pyx_bisect_code_objects(__pyx_code_cache.entries, __pyx_code_cache.count, code_line); if (unlikely(pos >= __pyx_code_cache.count) || unlikely(__pyx_code_cache.entries[pos].code_line != code_line)) { return NULL; } code_object = __pyx_code_cache.entries[pos].code_object; Py_INCREF(code_object); return code_object; } static void __pyx_insert_code_object(int code_line, PyCodeObject* code_object) { int pos, i; __Pyx_CodeObjectCacheEntry* entries = __pyx_code_cache.entries; if (unlikely(!code_line)) { return; } if (unlikely(!entries)) { entries = (__Pyx_CodeObjectCacheEntry*)PyMem_Malloc(64*sizeof(__Pyx_CodeObjectCacheEntry)); if (likely(entries)) { __pyx_code_cache.entries = entries; __pyx_code_cache.max_count = 64; __pyx_code_cache.count = 1; entries[0].code_line = code_line; entries[0].code_object = code_object; Py_INCREF(code_object); } return; } pos = __pyx_bisect_code_objects(__pyx_code_cache.entries, __pyx_code_cache.count, code_line); if ((pos < __pyx_code_cache.count) && unlikely(__pyx_code_cache.entries[pos].code_line == code_line)) { PyCodeObject* tmp = entries[pos].code_object; entries[pos].code_object = code_object; Py_DECREF(tmp); return; } if (__pyx_code_cache.count == __pyx_code_cache.max_count) { int new_max = __pyx_code_cache.max_count + 64; entries = (__Pyx_CodeObjectCacheEntry*)PyMem_Realloc( __pyx_code_cache.entries, (size_t)new_max*sizeof(__Pyx_CodeObjectCacheEntry)); if (unlikely(!entries)) { return; } __pyx_code_cache.entries = entries; __pyx_code_cache.max_count = new_max; } for (i=__pyx_code_cache.count; i>pos; i--) { entries[i] = entries[i-1]; } entries[pos].code_line = code_line; entries[pos].code_object = code_object; __pyx_code_cache.count++; Py_INCREF(code_object); } /* AddTraceback */ #include "compile.h" #include "frameobject.h" #include "traceback.h" static PyCodeObject* __Pyx_CreateCodeObjectForTraceback( const char *funcname, int c_line, int py_line, const char *filename) { PyCodeObject *py_code = 0; PyObject *py_srcfile = 0; PyObject *py_funcname = 0; #if PY_MAJOR_VERSION < 3 py_srcfile = PyString_FromString(filename); #else py_srcfile = PyUnicode_FromString(filename); #endif if (!py_srcfile) goto bad; if (c_line) { #if PY_MAJOR_VERSION < 3 py_funcname = PyString_FromFormat( "%s (%s:%d)", funcname, __pyx_cfilenm, c_line); #else py_funcname = PyUnicode_FromFormat( "%s (%s:%d)", funcname, __pyx_cfilenm, c_line); #endif } else { #if PY_MAJOR_VERSION < 3 py_funcname = PyString_FromString(funcname); #else py_funcname = PyUnicode_FromString(funcname); #endif } if (!py_funcname) goto bad; py_code = __Pyx_PyCode_New( 0, 0, 0, 0, 0, __pyx_empty_bytes, /*PyObject *code,*/ __pyx_empty_tuple, /*PyObject *consts,*/ __pyx_empty_tuple, /*PyObject *names,*/ __pyx_empty_tuple, /*PyObject *varnames,*/ __pyx_empty_tuple, /*PyObject *freevars,*/ __pyx_empty_tuple, /*PyObject *cellvars,*/ py_srcfile, /*PyObject *filename,*/ py_funcname, /*PyObject *name,*/ py_line, __pyx_empty_bytes /*PyObject *lnotab*/ ); Py_DECREF(py_srcfile); Py_DECREF(py_funcname); return py_code; bad: Py_XDECREF(py_srcfile); Py_XDECREF(py_funcname); return NULL; } static void __Pyx_AddTraceback(const char *funcname, int c_line, int py_line, const char *filename) { PyCodeObject *py_code = 0; PyFrameObject *py_frame = 0; py_code = __pyx_find_code_object(c_line ? c_line : py_line); if (!py_code) { py_code = __Pyx_CreateCodeObjectForTraceback( funcname, c_line, py_line, filename); if (!py_code) goto bad; __pyx_insert_code_object(c_line ? c_line : py_line, py_code); } py_frame = PyFrame_New( PyThreadState_GET(), /*PyThreadState *tstate,*/ py_code, /*PyCodeObject *code,*/ __pyx_d, /*PyObject *globals,*/ 0 /*PyObject *locals*/ ); if (!py_frame) goto bad; py_frame->f_lineno = py_line; PyTraceBack_Here(py_frame); bad: Py_XDECREF(py_code); Py_XDECREF(py_frame); } /* CIntFromPyVerify */ #define __PYX_VERIFY_RETURN_INT(target_type, func_type, func_value)\ __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, 0) #define __PYX_VERIFY_RETURN_INT_EXC(target_type, func_type, func_value)\ __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, 1) #define __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, exc)\ {\ func_type value = func_value;\ if (sizeof(target_type) < sizeof(func_type)) {\ if (unlikely(value != (func_type) (target_type) value)) {\ func_type zero = 0;\ if (exc && unlikely(value == (func_type)-1 && PyErr_Occurred()))\ return (target_type) -1;\ if (is_unsigned && unlikely(value < zero))\ goto raise_neg_overflow;\ else\ goto raise_overflow;\ }\ }\ return (target_type) value;\ } /* CIntToPy */ static CYTHON_INLINE PyObject* __Pyx_PyInt_From_uint8_t(uint8_t value) { const uint8_t neg_one = (uint8_t) -1, const_zero = (uint8_t) 0; const int is_unsigned = neg_one > const_zero; if (is_unsigned) { if (sizeof(uint8_t) < sizeof(long)) { return PyInt_FromLong((long) value); } else if (sizeof(uint8_t) <= sizeof(unsigned long)) { return PyLong_FromUnsignedLong((unsigned long) value); } else if (sizeof(uint8_t) <= sizeof(unsigned PY_LONG_LONG)) { return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value); } } else { if (sizeof(uint8_t) <= sizeof(long)) { return PyInt_FromLong((long) value); } else if (sizeof(uint8_t) <= sizeof(PY_LONG_LONG)) { return PyLong_FromLongLong((PY_LONG_LONG) value); } } { int one = 1; int little = (int)*(unsigned char *)&one; unsigned char *bytes = (unsigned char *)&value; return _PyLong_FromByteArray(bytes, sizeof(uint8_t), little, !is_unsigned); } } /* CIntToPy */ static CYTHON_INLINE PyObject* __Pyx_PyInt_From_long(long value) { const long neg_one = (long) -1, const_zero = (long) 0; const int is_unsigned = neg_one > const_zero; if (is_unsigned) { if (sizeof(long) < sizeof(long)) { return PyInt_FromLong((long) value); } else if (sizeof(long) <= sizeof(unsigned long)) { return PyLong_FromUnsignedLong((unsigned long) value); } else if (sizeof(long) <= sizeof(unsigned PY_LONG_LONG)) { return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value); } } else { if (sizeof(long) <= sizeof(long)) { return PyInt_FromLong((long) value); } else if (sizeof(long) <= sizeof(PY_LONG_LONG)) { return PyLong_FromLongLong((PY_LONG_LONG) value); } } { int one = 1; int little = (int)*(unsigned char *)&one; unsigned char *bytes = (unsigned char *)&value; return _PyLong_FromByteArray(bytes, sizeof(long), little, !is_unsigned); } } /* CIntFromPy */ static CYTHON_INLINE int __Pyx_PyInt_As_int(PyObject *x) { const int neg_one = (int) -1, const_zero = (int) 0; const int is_unsigned = neg_one > const_zero; #if PY_MAJOR_VERSION < 3 if (likely(PyInt_Check(x))) { if (sizeof(int) < sizeof(long)) { __PYX_VERIFY_RETURN_INT(int, long, PyInt_AS_LONG(x)) } else { long val = PyInt_AS_LONG(x); if (is_unsigned && unlikely(val < 0)) { goto raise_neg_overflow; } return (int) val; } } else #endif if (likely(PyLong_Check(x))) { if (is_unsigned) { #if CYTHON_USE_PYLONG_INTERNALS const digit* digits = ((PyLongObject*)x)->ob_digit; switch (Py_SIZE(x)) { case 0: return (int) 0; case 1: __PYX_VERIFY_RETURN_INT(int, digit, digits[0]) case 2: if (8 * sizeof(int) > 1 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(int) >= 2 * PyLong_SHIFT) { return (int) (((((int)digits[1]) << PyLong_SHIFT) | (int)digits[0])); } } break; case 3: if (8 * sizeof(int) > 2 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(int) >= 3 * PyLong_SHIFT) { return (int) (((((((int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0])); } } break; case 4: if (8 * sizeof(int) > 3 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(int) >= 4 * PyLong_SHIFT) { return (int) (((((((((int)digits[3]) << PyLong_SHIFT) | (int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0])); } } break; } #endif #if CYTHON_COMPILING_IN_CPYTHON if (unlikely(Py_SIZE(x) < 0)) { goto raise_neg_overflow; } #else { int result = PyObject_RichCompareBool(x, Py_False, Py_LT); if (unlikely(result < 0)) return (int) -1; if (unlikely(result == 1)) goto raise_neg_overflow; } #endif if (sizeof(int) <= sizeof(unsigned long)) { __PYX_VERIFY_RETURN_INT_EXC(int, unsigned long, PyLong_AsUnsignedLong(x)) } else if (sizeof(int) <= sizeof(unsigned PY_LONG_LONG)) { __PYX_VERIFY_RETURN_INT_EXC(int, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x)) } } else { #if CYTHON_USE_PYLONG_INTERNALS const digit* digits = ((PyLongObject*)x)->ob_digit; switch (Py_SIZE(x)) { case 0: return (int) 0; case -1: __PYX_VERIFY_RETURN_INT(int, sdigit, (sdigit) (-(sdigit)digits[0])) case 1: __PYX_VERIFY_RETURN_INT(int, digit, +digits[0]) case -2: if (8 * sizeof(int) - 1 > 1 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(int, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(int) - 1 > 2 * PyLong_SHIFT) { return (int) (((int)-1)*(((((int)digits[1]) << PyLong_SHIFT) | (int)digits[0]))); } } break; case 2: if (8 * sizeof(int) > 1 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(int) - 1 > 2 * PyLong_SHIFT) { return (int) ((((((int)digits[1]) << PyLong_SHIFT) | (int)digits[0]))); } } break; case -3: if (8 * sizeof(int) - 1 > 2 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(int, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(int) - 1 > 3 * PyLong_SHIFT) { return (int) (((int)-1)*(((((((int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0]))); } } break; case 3: if (8 * sizeof(int) > 2 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(int) - 1 > 3 * PyLong_SHIFT) { return (int) ((((((((int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0]))); } } break; case -4: if (8 * sizeof(int) - 1 > 3 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(int, long, -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(int) - 1 > 4 * PyLong_SHIFT) { return (int) (((int)-1)*(((((((((int)digits[3]) << PyLong_SHIFT) | (int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0]))); } } break; case 4: if (8 * sizeof(int) > 3 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(int) - 1 > 4 * PyLong_SHIFT) { return (int) ((((((((((int)digits[3]) << PyLong_SHIFT) | (int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0]))); } } break; } #endif if (sizeof(int) <= sizeof(long)) { __PYX_VERIFY_RETURN_INT_EXC(int, long, PyLong_AsLong(x)) } else if (sizeof(int) <= sizeof(PY_LONG_LONG)) { __PYX_VERIFY_RETURN_INT_EXC(int, PY_LONG_LONG, PyLong_AsLongLong(x)) } } { #if CYTHON_COMPILING_IN_PYPY && !defined(_PyLong_AsByteArray) PyErr_SetString(PyExc_RuntimeError, "_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers"); #else int val; PyObject *v = __Pyx_PyNumber_IntOrLong(x); #if PY_MAJOR_VERSION < 3 if (likely(v) && !PyLong_Check(v)) { PyObject *tmp = v; v = PyNumber_Long(tmp); Py_DECREF(tmp); } #endif if (likely(v)) { int one = 1; int is_little = (int)*(unsigned char *)&one; unsigned char *bytes = (unsigned char *)&val; int ret = _PyLong_AsByteArray((PyLongObject *)v, bytes, sizeof(val), is_little, !is_unsigned); Py_DECREF(v); if (likely(!ret)) return val; } #endif return (int) -1; } } else { int val; PyObject *tmp = __Pyx_PyNumber_IntOrLong(x); if (!tmp) return (int) -1; val = __Pyx_PyInt_As_int(tmp); Py_DECREF(tmp); return val; } raise_overflow: PyErr_SetString(PyExc_OverflowError, "value too large to convert to int"); return (int) -1; raise_neg_overflow: PyErr_SetString(PyExc_OverflowError, "can't convert negative value to int"); return (int) -1; } /* CIntFromPy */ static CYTHON_INLINE uint8_t __Pyx_PyInt_As_uint8_t(PyObject *x) { const uint8_t neg_one = (uint8_t) -1, const_zero = (uint8_t) 0; const int is_unsigned = neg_one > const_zero; #if PY_MAJOR_VERSION < 3 if (likely(PyInt_Check(x))) { if (sizeof(uint8_t) < sizeof(long)) { __PYX_VERIFY_RETURN_INT(uint8_t, long, PyInt_AS_LONG(x)) } else { long val = PyInt_AS_LONG(x); if (is_unsigned && unlikely(val < 0)) { goto raise_neg_overflow; } return (uint8_t) val; } } else #endif if (likely(PyLong_Check(x))) { if (is_unsigned) { #if CYTHON_USE_PYLONG_INTERNALS const digit* digits = ((PyLongObject*)x)->ob_digit; switch (Py_SIZE(x)) { case 0: return (uint8_t) 0; case 1: __PYX_VERIFY_RETURN_INT(uint8_t, digit, digits[0]) case 2: if (8 * sizeof(uint8_t) > 1 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(uint8_t, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(uint8_t) >= 2 * PyLong_SHIFT) { return (uint8_t) (((((uint8_t)digits[1]) << PyLong_SHIFT) | (uint8_t)digits[0])); } } break; case 3: if (8 * sizeof(uint8_t) > 2 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(uint8_t, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(uint8_t) >= 3 * PyLong_SHIFT) { return (uint8_t) (((((((uint8_t)digits[2]) << PyLong_SHIFT) | (uint8_t)digits[1]) << PyLong_SHIFT) | (uint8_t)digits[0])); } } break; case 4: if (8 * sizeof(uint8_t) > 3 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(uint8_t, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(uint8_t) >= 4 * PyLong_SHIFT) { return (uint8_t) (((((((((uint8_t)digits[3]) << PyLong_SHIFT) | (uint8_t)digits[2]) << PyLong_SHIFT) | (uint8_t)digits[1]) << PyLong_SHIFT) | (uint8_t)digits[0])); } } break; } #endif #if CYTHON_COMPILING_IN_CPYTHON if (unlikely(Py_SIZE(x) < 0)) { goto raise_neg_overflow; } #else { int result = PyObject_RichCompareBool(x, Py_False, Py_LT); if (unlikely(result < 0)) return (uint8_t) -1; if (unlikely(result == 1)) goto raise_neg_overflow; } #endif if (sizeof(uint8_t) <= sizeof(unsigned long)) { __PYX_VERIFY_RETURN_INT_EXC(uint8_t, unsigned long, PyLong_AsUnsignedLong(x)) } else if (sizeof(uint8_t) <= sizeof(unsigned PY_LONG_LONG)) { __PYX_VERIFY_RETURN_INT_EXC(uint8_t, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x)) } } else { #if CYTHON_USE_PYLONG_INTERNALS const digit* digits = ((PyLongObject*)x)->ob_digit; switch (Py_SIZE(x)) { case 0: return (uint8_t) 0; case -1: __PYX_VERIFY_RETURN_INT(uint8_t, sdigit, (sdigit) (-(sdigit)digits[0])) case 1: __PYX_VERIFY_RETURN_INT(uint8_t, digit, +digits[0]) case -2: if (8 * sizeof(uint8_t) - 1 > 1 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(uint8_t, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(uint8_t) - 1 > 2 * PyLong_SHIFT) { return (uint8_t) (((uint8_t)-1)*(((((uint8_t)digits[1]) << PyLong_SHIFT) | (uint8_t)digits[0]))); } } break; case 2: if (8 * sizeof(uint8_t) > 1 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(uint8_t, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(uint8_t) - 1 > 2 * PyLong_SHIFT) { return (uint8_t) ((((((uint8_t)digits[1]) << PyLong_SHIFT) | (uint8_t)digits[0]))); } } break; case -3: if (8 * sizeof(uint8_t) - 1 > 2 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(uint8_t, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(uint8_t) - 1 > 3 * PyLong_SHIFT) { return (uint8_t) (((uint8_t)-1)*(((((((uint8_t)digits[2]) << PyLong_SHIFT) | (uint8_t)digits[1]) << PyLong_SHIFT) | (uint8_t)digits[0]))); } } break; case 3: if (8 * sizeof(uint8_t) > 2 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(uint8_t, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(uint8_t) - 1 > 3 * PyLong_SHIFT) { return (uint8_t) ((((((((uint8_t)digits[2]) << PyLong_SHIFT) | (uint8_t)digits[1]) << PyLong_SHIFT) | (uint8_t)digits[0]))); } } break; case -4: if (8 * sizeof(uint8_t) - 1 > 3 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(uint8_t, long, -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(uint8_t) - 1 > 4 * PyLong_SHIFT) { return (uint8_t) (((uint8_t)-1)*(((((((((uint8_t)digits[3]) << PyLong_SHIFT) | (uint8_t)digits[2]) << PyLong_SHIFT) | (uint8_t)digits[1]) << PyLong_SHIFT) | (uint8_t)digits[0]))); } } break; case 4: if (8 * sizeof(uint8_t) > 3 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(uint8_t, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(uint8_t) - 1 > 4 * PyLong_SHIFT) { return (uint8_t) ((((((((((uint8_t)digits[3]) << PyLong_SHIFT) | (uint8_t)digits[2]) << PyLong_SHIFT) | (uint8_t)digits[1]) << PyLong_SHIFT) | (uint8_t)digits[0]))); } } break; } #endif if (sizeof(uint8_t) <= sizeof(long)) { __PYX_VERIFY_RETURN_INT_EXC(uint8_t, long, PyLong_AsLong(x)) } else if (sizeof(uint8_t) <= sizeof(PY_LONG_LONG)) { __PYX_VERIFY_RETURN_INT_EXC(uint8_t, PY_LONG_LONG, PyLong_AsLongLong(x)) } } { #if CYTHON_COMPILING_IN_PYPY && !defined(_PyLong_AsByteArray) PyErr_SetString(PyExc_RuntimeError, "_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers"); #else uint8_t val; PyObject *v = __Pyx_PyNumber_IntOrLong(x); #if PY_MAJOR_VERSION < 3 if (likely(v) && !PyLong_Check(v)) { PyObject *tmp = v; v = PyNumber_Long(tmp); Py_DECREF(tmp); } #endif if (likely(v)) { int one = 1; int is_little = (int)*(unsigned char *)&one; unsigned char *bytes = (unsigned char *)&val; int ret = _PyLong_AsByteArray((PyLongObject *)v, bytes, sizeof(val), is_little, !is_unsigned); Py_DECREF(v); if (likely(!ret)) return val; } #endif return (uint8_t) -1; } } else { uint8_t val; PyObject *tmp = __Pyx_PyNumber_IntOrLong(x); if (!tmp) return (uint8_t) -1; val = __Pyx_PyInt_As_uint8_t(tmp); Py_DECREF(tmp); return val; } raise_overflow: PyErr_SetString(PyExc_OverflowError, "value too large to convert to uint8_t"); return (uint8_t) -1; raise_neg_overflow: PyErr_SetString(PyExc_OverflowError, "can't convert negative value to uint8_t"); return (uint8_t) -1; } /* CIntFromPy */ static CYTHON_INLINE uint32_t __Pyx_PyInt_As_uint32_t(PyObject *x) { const uint32_t neg_one = (uint32_t) -1, const_zero = (uint32_t) 0; const int is_unsigned = neg_one > const_zero; #if PY_MAJOR_VERSION < 3 if (likely(PyInt_Check(x))) { if (sizeof(uint32_t) < sizeof(long)) { __PYX_VERIFY_RETURN_INT(uint32_t, long, PyInt_AS_LONG(x)) } else { long val = PyInt_AS_LONG(x); if (is_unsigned && unlikely(val < 0)) { goto raise_neg_overflow; } return (uint32_t) val; } } else #endif if (likely(PyLong_Check(x))) { if (is_unsigned) { #if CYTHON_USE_PYLONG_INTERNALS const digit* digits = ((PyLongObject*)x)->ob_digit; switch (Py_SIZE(x)) { case 0: return (uint32_t) 0; case 1: __PYX_VERIFY_RETURN_INT(uint32_t, digit, digits[0]) case 2: if (8 * sizeof(uint32_t) > 1 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(uint32_t, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(uint32_t) >= 2 * PyLong_SHIFT) { return (uint32_t) (((((uint32_t)digits[1]) << PyLong_SHIFT) | (uint32_t)digits[0])); } } break; case 3: if (8 * sizeof(uint32_t) > 2 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(uint32_t, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(uint32_t) >= 3 * PyLong_SHIFT) { return (uint32_t) (((((((uint32_t)digits[2]) << PyLong_SHIFT) | (uint32_t)digits[1]) << PyLong_SHIFT) | (uint32_t)digits[0])); } } break; case 4: if (8 * sizeof(uint32_t) > 3 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(uint32_t, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(uint32_t) >= 4 * PyLong_SHIFT) { return (uint32_t) (((((((((uint32_t)digits[3]) << PyLong_SHIFT) | (uint32_t)digits[2]) << PyLong_SHIFT) | (uint32_t)digits[1]) << PyLong_SHIFT) | (uint32_t)digits[0])); } } break; } #endif #if CYTHON_COMPILING_IN_CPYTHON if (unlikely(Py_SIZE(x) < 0)) { goto raise_neg_overflow; } #else { int result = PyObject_RichCompareBool(x, Py_False, Py_LT); if (unlikely(result < 0)) return (uint32_t) -1; if (unlikely(result == 1)) goto raise_neg_overflow; } #endif if (sizeof(uint32_t) <= sizeof(unsigned long)) { __PYX_VERIFY_RETURN_INT_EXC(uint32_t, unsigned long, PyLong_AsUnsignedLong(x)) } else if (sizeof(uint32_t) <= sizeof(unsigned PY_LONG_LONG)) { __PYX_VERIFY_RETURN_INT_EXC(uint32_t, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x)) } } else { #if CYTHON_USE_PYLONG_INTERNALS const digit* digits = ((PyLongObject*)x)->ob_digit; switch (Py_SIZE(x)) { case 0: return (uint32_t) 0; case -1: __PYX_VERIFY_RETURN_INT(uint32_t, sdigit, (sdigit) (-(sdigit)digits[0])) case 1: __PYX_VERIFY_RETURN_INT(uint32_t, digit, +digits[0]) case -2: if (8 * sizeof(uint32_t) - 1 > 1 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(uint32_t, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(uint32_t) - 1 > 2 * PyLong_SHIFT) { return (uint32_t) (((uint32_t)-1)*(((((uint32_t)digits[1]) << PyLong_SHIFT) | (uint32_t)digits[0]))); } } break; case 2: if (8 * sizeof(uint32_t) > 1 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(uint32_t, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(uint32_t) - 1 > 2 * PyLong_SHIFT) { return (uint32_t) ((((((uint32_t)digits[1]) << PyLong_SHIFT) | (uint32_t)digits[0]))); } } break; case -3: if (8 * sizeof(uint32_t) - 1 > 2 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(uint32_t, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(uint32_t) - 1 > 3 * PyLong_SHIFT) { return (uint32_t) (((uint32_t)-1)*(((((((uint32_t)digits[2]) << PyLong_SHIFT) | (uint32_t)digits[1]) << PyLong_SHIFT) | (uint32_t)digits[0]))); } } break; case 3: if (8 * sizeof(uint32_t) > 2 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(uint32_t, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(uint32_t) - 1 > 3 * PyLong_SHIFT) { return (uint32_t) ((((((((uint32_t)digits[2]) << PyLong_SHIFT) | (uint32_t)digits[1]) << PyLong_SHIFT) | (uint32_t)digits[0]))); } } break; case -4: if (8 * sizeof(uint32_t) - 1 > 3 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(uint32_t, long, -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(uint32_t) - 1 > 4 * PyLong_SHIFT) { return (uint32_t) (((uint32_t)-1)*(((((((((uint32_t)digits[3]) << PyLong_SHIFT) | (uint32_t)digits[2]) << PyLong_SHIFT) | (uint32_t)digits[1]) << PyLong_SHIFT) | (uint32_t)digits[0]))); } } break; case 4: if (8 * sizeof(uint32_t) > 3 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(uint32_t, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(uint32_t) - 1 > 4 * PyLong_SHIFT) { return (uint32_t) ((((((((((uint32_t)digits[3]) << PyLong_SHIFT) | (uint32_t)digits[2]) << PyLong_SHIFT) | (uint32_t)digits[1]) << PyLong_SHIFT) | (uint32_t)digits[0]))); } } break; } #endif if (sizeof(uint32_t) <= sizeof(long)) { __PYX_VERIFY_RETURN_INT_EXC(uint32_t, long, PyLong_AsLong(x)) } else if (sizeof(uint32_t) <= sizeof(PY_LONG_LONG)) { __PYX_VERIFY_RETURN_INT_EXC(uint32_t, PY_LONG_LONG, PyLong_AsLongLong(x)) } } { #if CYTHON_COMPILING_IN_PYPY && !defined(_PyLong_AsByteArray) PyErr_SetString(PyExc_RuntimeError, "_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers"); #else uint32_t val; PyObject *v = __Pyx_PyNumber_IntOrLong(x); #if PY_MAJOR_VERSION < 3 if (likely(v) && !PyLong_Check(v)) { PyObject *tmp = v; v = PyNumber_Long(tmp); Py_DECREF(tmp); } #endif if (likely(v)) { int one = 1; int is_little = (int)*(unsigned char *)&one; unsigned char *bytes = (unsigned char *)&val; int ret = _PyLong_AsByteArray((PyLongObject *)v, bytes, sizeof(val), is_little, !is_unsigned); Py_DECREF(v); if (likely(!ret)) return val; } #endif return (uint32_t) -1; } } else { uint32_t val; PyObject *tmp = __Pyx_PyNumber_IntOrLong(x); if (!tmp) return (uint32_t) -1; val = __Pyx_PyInt_As_uint32_t(tmp); Py_DECREF(tmp); return val; } raise_overflow: PyErr_SetString(PyExc_OverflowError, "value too large to convert to uint32_t"); return (uint32_t) -1; raise_neg_overflow: PyErr_SetString(PyExc_OverflowError, "can't convert negative value to uint32_t"); return (uint32_t) -1; } /* CIntFromPy */ static CYTHON_INLINE long __Pyx_PyInt_As_long(PyObject *x) { const long neg_one = (long) -1, const_zero = (long) 0; const int is_unsigned = neg_one > const_zero; #if PY_MAJOR_VERSION < 3 if (likely(PyInt_Check(x))) { if (sizeof(long) < sizeof(long)) { __PYX_VERIFY_RETURN_INT(long, long, PyInt_AS_LONG(x)) } else { long val = PyInt_AS_LONG(x); if (is_unsigned && unlikely(val < 0)) { goto raise_neg_overflow; } return (long) val; } } else #endif if (likely(PyLong_Check(x))) { if (is_unsigned) { #if CYTHON_USE_PYLONG_INTERNALS const digit* digits = ((PyLongObject*)x)->ob_digit; switch (Py_SIZE(x)) { case 0: return (long) 0; case 1: __PYX_VERIFY_RETURN_INT(long, digit, digits[0]) case 2: if (8 * sizeof(long) > 1 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(long) >= 2 * PyLong_SHIFT) { return (long) (((((long)digits[1]) << PyLong_SHIFT) | (long)digits[0])); } } break; case 3: if (8 * sizeof(long) > 2 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(long) >= 3 * PyLong_SHIFT) { return (long) (((((((long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0])); } } break; case 4: if (8 * sizeof(long) > 3 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(long) >= 4 * PyLong_SHIFT) { return (long) (((((((((long)digits[3]) << PyLong_SHIFT) | (long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0])); } } break; } #endif #if CYTHON_COMPILING_IN_CPYTHON if (unlikely(Py_SIZE(x) < 0)) { goto raise_neg_overflow; } #else { int result = PyObject_RichCompareBool(x, Py_False, Py_LT); if (unlikely(result < 0)) return (long) -1; if (unlikely(result == 1)) goto raise_neg_overflow; } #endif if (sizeof(long) <= sizeof(unsigned long)) { __PYX_VERIFY_RETURN_INT_EXC(long, unsigned long, PyLong_AsUnsignedLong(x)) } else if (sizeof(long) <= sizeof(unsigned PY_LONG_LONG)) { __PYX_VERIFY_RETURN_INT_EXC(long, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x)) } } else { #if CYTHON_USE_PYLONG_INTERNALS const digit* digits = ((PyLongObject*)x)->ob_digit; switch (Py_SIZE(x)) { case 0: return (long) 0; case -1: __PYX_VERIFY_RETURN_INT(long, sdigit, (sdigit) (-(sdigit)digits[0])) case 1: __PYX_VERIFY_RETURN_INT(long, digit, +digits[0]) case -2: if (8 * sizeof(long) - 1 > 1 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(long, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) { return (long) (((long)-1)*(((((long)digits[1]) << PyLong_SHIFT) | (long)digits[0]))); } } break; case 2: if (8 * sizeof(long) > 1 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) { return (long) ((((((long)digits[1]) << PyLong_SHIFT) | (long)digits[0]))); } } break; case -3: if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(long, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) { return (long) (((long)-1)*(((((((long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0]))); } } break; case 3: if (8 * sizeof(long) > 2 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) { return (long) ((((((((long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0]))); } } break; case -4: if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(long, long, -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(long) - 1 > 4 * PyLong_SHIFT) { return (long) (((long)-1)*(((((((((long)digits[3]) << PyLong_SHIFT) | (long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0]))); } } break; case 4: if (8 * sizeof(long) > 3 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(long) - 1 > 4 * PyLong_SHIFT) { return (long) ((((((((((long)digits[3]) << PyLong_SHIFT) | (long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0]))); } } break; } #endif if (sizeof(long) <= sizeof(long)) { __PYX_VERIFY_RETURN_INT_EXC(long, long, PyLong_AsLong(x)) } else if (sizeof(long) <= sizeof(PY_LONG_LONG)) { __PYX_VERIFY_RETURN_INT_EXC(long, PY_LONG_LONG, PyLong_AsLongLong(x)) } } { #if CYTHON_COMPILING_IN_PYPY && !defined(_PyLong_AsByteArray) PyErr_SetString(PyExc_RuntimeError, "_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers"); #else long val; PyObject *v = __Pyx_PyNumber_IntOrLong(x); #if PY_MAJOR_VERSION < 3 if (likely(v) && !PyLong_Check(v)) { PyObject *tmp = v; v = PyNumber_Long(tmp); Py_DECREF(tmp); } #endif if (likely(v)) { int one = 1; int is_little = (int)*(unsigned char *)&one; unsigned char *bytes = (unsigned char *)&val; int ret = _PyLong_AsByteArray((PyLongObject *)v, bytes, sizeof(val), is_little, !is_unsigned); Py_DECREF(v); if (likely(!ret)) return val; } #endif return (long) -1; } } else { long val; PyObject *tmp = __Pyx_PyNumber_IntOrLong(x); if (!tmp) return (long) -1; val = __Pyx_PyInt_As_long(tmp); Py_DECREF(tmp); return val; } raise_overflow: PyErr_SetString(PyExc_OverflowError, "value too large to convert to long"); return (long) -1; raise_neg_overflow: PyErr_SetString(PyExc_OverflowError, "can't convert negative value to long"); return (long) -1; } /* CheckBinaryVersion */ static int __Pyx_check_binary_version(void) { char ctversion[4], rtversion[4]; PyOS_snprintf(ctversion, 4, "%d.%d", PY_MAJOR_VERSION, PY_MINOR_VERSION); PyOS_snprintf(rtversion, 4, "%s", Py_GetVersion()); if (ctversion[0] != rtversion[0] || ctversion[2] != rtversion[2]) { char message[200]; PyOS_snprintf(message, sizeof(message), "compiletime version %s of module '%.100s' " "does not match runtime version %s", ctversion, __Pyx_MODULE_NAME, rtversion); return PyErr_WarnEx(NULL, message, 1); } return 0; } /* FunctionExport */ static int __Pyx_ExportFunction(const char *name, void (*f)(void), const char *sig) { PyObject *d = 0; PyObject *cobj = 0; union { void (*fp)(void); void *p; } tmp; d = PyObject_GetAttrString(__pyx_m, (char *)"__pyx_capi__"); if (!d) { PyErr_Clear(); d = PyDict_New(); if (!d) goto bad; Py_INCREF(d); if (PyModule_AddObject(__pyx_m, (char *)"__pyx_capi__", d) < 0) goto bad; } tmp.fp = f; #if PY_VERSION_HEX >= 0x02070000 cobj = PyCapsule_New(tmp.p, sig, 0); #else cobj = PyCObject_FromVoidPtrAndDesc(tmp.p, (void *)sig, 0); #endif if (!cobj) goto bad; if (PyDict_SetItemString(d, name, cobj) < 0) goto bad; Py_DECREF(cobj); Py_DECREF(d); return 0; bad: Py_XDECREF(cobj); Py_XDECREF(d); return -1; } /* InitStrings */ static int __Pyx_InitStrings(__Pyx_StringTabEntry *t) { while (t->p) { #if PY_MAJOR_VERSION < 3 if (t->is_unicode) { *t->p = PyUnicode_DecodeUTF8(t->s, t->n - 1, NULL); } else if (t->intern) { *t->p = PyString_InternFromString(t->s); } else { *t->p = PyString_FromStringAndSize(t->s, t->n - 1); } #else if (t->is_unicode | t->is_str) { if (t->intern) { *t->p = PyUnicode_InternFromString(t->s); } else if (t->encoding) { *t->p = PyUnicode_Decode(t->s, t->n - 1, t->encoding, NULL); } else { *t->p = PyUnicode_FromStringAndSize(t->s, t->n - 1); } } else { *t->p = PyBytes_FromStringAndSize(t->s, t->n - 1); } #endif if (!*t->p) return -1; ++t; } return 0; } static CYTHON_INLINE PyObject* __Pyx_PyUnicode_FromString(const char* c_str) { return __Pyx_PyUnicode_FromStringAndSize(c_str, (Py_ssize_t)strlen(c_str)); } static CYTHON_INLINE char* __Pyx_PyObject_AsString(PyObject* o) { Py_ssize_t ignore; return __Pyx_PyObject_AsStringAndSize(o, &ignore); } static CYTHON_INLINE char* __Pyx_PyObject_AsStringAndSize(PyObject* o, Py_ssize_t *length) { #if CYTHON_COMPILING_IN_CPYTHON && (__PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT) if ( #if PY_MAJOR_VERSION < 3 && __PYX_DEFAULT_STRING_ENCODING_IS_ASCII __Pyx_sys_getdefaultencoding_not_ascii && #endif PyUnicode_Check(o)) { #if PY_VERSION_HEX < 0x03030000 char* defenc_c; PyObject* defenc = _PyUnicode_AsDefaultEncodedString(o, NULL); if (!defenc) return NULL; defenc_c = PyBytes_AS_STRING(defenc); #if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII { char* end = defenc_c + PyBytes_GET_SIZE(defenc); char* c; for (c = defenc_c; c < end; c++) { if ((unsigned char) (*c) >= 128) { PyUnicode_AsASCIIString(o); return NULL; } } } #endif *length = PyBytes_GET_SIZE(defenc); return defenc_c; #else if (__Pyx_PyUnicode_READY(o) == -1) return NULL; #if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII if (PyUnicode_IS_ASCII(o)) { *length = PyUnicode_GET_LENGTH(o); return PyUnicode_AsUTF8(o); } else { PyUnicode_AsASCIIString(o); return NULL; } #else return PyUnicode_AsUTF8AndSize(o, length); #endif #endif } else #endif #if (!CYTHON_COMPILING_IN_PYPY) || (defined(PyByteArray_AS_STRING) && defined(PyByteArray_GET_SIZE)) if (PyByteArray_Check(o)) { *length = PyByteArray_GET_SIZE(o); return PyByteArray_AS_STRING(o); } else #endif { char* result; int r = PyBytes_AsStringAndSize(o, &result, length); if (unlikely(r < 0)) { return NULL; } else { return result; } } } static CYTHON_INLINE int __Pyx_PyObject_IsTrue(PyObject* x) { int is_true = x == Py_True; if (is_true | (x == Py_False) | (x == Py_None)) return is_true; else return PyObject_IsTrue(x); } static CYTHON_INLINE PyObject* __Pyx_PyNumber_IntOrLong(PyObject* x) { PyNumberMethods *m; const char *name = NULL; PyObject *res = NULL; #if PY_MAJOR_VERSION < 3 if (PyInt_Check(x) || PyLong_Check(x)) #else if (PyLong_Check(x)) #endif return __Pyx_NewRef(x); m = Py_TYPE(x)->tp_as_number; #if PY_MAJOR_VERSION < 3 if (m && m->nb_int) { name = "int"; res = PyNumber_Int(x); } else if (m && m->nb_long) { name = "long"; res = PyNumber_Long(x); } #else if (m && m->nb_int) { name = "int"; res = PyNumber_Long(x); } #endif if (res) { #if PY_MAJOR_VERSION < 3 if (!PyInt_Check(res) && !PyLong_Check(res)) { #else if (!PyLong_Check(res)) { #endif PyErr_Format(PyExc_TypeError, "__%.4s__ returned non-%.4s (type %.200s)", name, name, Py_TYPE(res)->tp_name); Py_DECREF(res); return NULL; } } else if (!PyErr_Occurred()) { PyErr_SetString(PyExc_TypeError, "an integer is required"); } return res; } static CYTHON_INLINE Py_ssize_t __Pyx_PyIndex_AsSsize_t(PyObject* b) { Py_ssize_t ival; PyObject *x; #if PY_MAJOR_VERSION < 3 if (likely(PyInt_CheckExact(b))) { if (sizeof(Py_ssize_t) >= sizeof(long)) return PyInt_AS_LONG(b); else return PyInt_AsSsize_t(x); } #endif if (likely(PyLong_CheckExact(b))) { #if CYTHON_USE_PYLONG_INTERNALS const digit* digits = ((PyLongObject*)b)->ob_digit; const Py_ssize_t size = Py_SIZE(b); if (likely(__Pyx_sst_abs(size) <= 1)) { ival = likely(size) ? digits[0] : 0; if (size == -1) ival = -ival; return ival; } else { switch (size) { case 2: if (8 * sizeof(Py_ssize_t) > 2 * PyLong_SHIFT) { return (Py_ssize_t) (((((size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])); } break; case -2: if (8 * sizeof(Py_ssize_t) > 2 * PyLong_SHIFT) { return -(Py_ssize_t) (((((size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])); } break; case 3: if (8 * sizeof(Py_ssize_t) > 3 * PyLong_SHIFT) { return (Py_ssize_t) (((((((size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])); } break; case -3: if (8 * sizeof(Py_ssize_t) > 3 * PyLong_SHIFT) { return -(Py_ssize_t) (((((((size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])); } break; case 4: if (8 * sizeof(Py_ssize_t) > 4 * PyLong_SHIFT) { return (Py_ssize_t) (((((((((size_t)digits[3]) << PyLong_SHIFT) | (size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])); } break; case -4: if (8 * sizeof(Py_ssize_t) > 4 * PyLong_SHIFT) { return -(Py_ssize_t) (((((((((size_t)digits[3]) << PyLong_SHIFT) | (size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])); } break; } } #endif return PyLong_AsSsize_t(b); } x = PyNumber_Index(b); if (!x) return -1; ival = PyInt_AsSsize_t(x); Py_DECREF(x); return ival; } static CYTHON_INLINE PyObject * __Pyx_PyInt_FromSize_t(size_t ival) { return PyInt_FromSize_t(ival); } #endif /* Py_PYTHON_H */ pygame_sdl2-2.1.0-for-renpy-6.99.14.1/gen3/pygame_sdl2.power.c0000644000175000017500000047176713205100065022623 0ustar tomtom00000000000000/* Generated by Cython 0.27.3 */ #define PY_SSIZE_T_CLEAN #include "Python.h" #ifndef Py_PYTHON_H #error Python headers needed to compile C extensions, please install development version of Python. #elif PY_VERSION_HEX < 0x02060000 || (0x03000000 <= PY_VERSION_HEX && PY_VERSION_HEX < 0x03030000) #error Cython requires Python 2.6+ or Python 3.3+. #else #define CYTHON_ABI "0_27_3" #define CYTHON_FUTURE_DIVISION 1 #include #ifndef offsetof #define offsetof(type, member) ( (size_t) & ((type*)0) -> member ) #endif #if !defined(WIN32) && !defined(MS_WINDOWS) #ifndef __stdcall #define __stdcall #endif #ifndef __cdecl #define __cdecl #endif #ifndef __fastcall #define __fastcall #endif #endif #ifndef DL_IMPORT #define DL_IMPORT(t) t #endif #ifndef DL_EXPORT #define DL_EXPORT(t) t #endif #define __PYX_COMMA , #ifndef HAVE_LONG_LONG #if PY_VERSION_HEX >= 0x02070000 #define HAVE_LONG_LONG #endif #endif #ifndef PY_LONG_LONG #define PY_LONG_LONG LONG_LONG #endif #ifndef Py_HUGE_VAL #define Py_HUGE_VAL HUGE_VAL #endif #ifdef PYPY_VERSION #define CYTHON_COMPILING_IN_PYPY 1 #define CYTHON_COMPILING_IN_PYSTON 0 #define CYTHON_COMPILING_IN_CPYTHON 0 #undef CYTHON_USE_TYPE_SLOTS #define CYTHON_USE_TYPE_SLOTS 0 #undef CYTHON_USE_PYTYPE_LOOKUP #define CYTHON_USE_PYTYPE_LOOKUP 0 #if PY_VERSION_HEX < 0x03050000 #undef CYTHON_USE_ASYNC_SLOTS #define CYTHON_USE_ASYNC_SLOTS 0 #elif !defined(CYTHON_USE_ASYNC_SLOTS) #define CYTHON_USE_ASYNC_SLOTS 1 #endif #undef CYTHON_USE_PYLIST_INTERNALS #define CYTHON_USE_PYLIST_INTERNALS 0 #undef CYTHON_USE_UNICODE_INTERNALS #define CYTHON_USE_UNICODE_INTERNALS 0 #undef CYTHON_USE_UNICODE_WRITER #define CYTHON_USE_UNICODE_WRITER 0 #undef CYTHON_USE_PYLONG_INTERNALS #define CYTHON_USE_PYLONG_INTERNALS 0 #undef CYTHON_AVOID_BORROWED_REFS #define CYTHON_AVOID_BORROWED_REFS 1 #undef CYTHON_ASSUME_SAFE_MACROS #define CYTHON_ASSUME_SAFE_MACROS 0 #undef CYTHON_UNPACK_METHODS #define CYTHON_UNPACK_METHODS 0 #undef CYTHON_FAST_THREAD_STATE #define CYTHON_FAST_THREAD_STATE 0 #undef CYTHON_FAST_PYCALL #define CYTHON_FAST_PYCALL 0 #undef CYTHON_PEP489_MULTI_PHASE_INIT #define CYTHON_PEP489_MULTI_PHASE_INIT 0 #undef CYTHON_USE_TP_FINALIZE #define CYTHON_USE_TP_FINALIZE 0 #elif defined(PYSTON_VERSION) #define CYTHON_COMPILING_IN_PYPY 0 #define CYTHON_COMPILING_IN_PYSTON 1 #define CYTHON_COMPILING_IN_CPYTHON 0 #ifndef CYTHON_USE_TYPE_SLOTS #define CYTHON_USE_TYPE_SLOTS 1 #endif #undef CYTHON_USE_PYTYPE_LOOKUP #define CYTHON_USE_PYTYPE_LOOKUP 0 #undef CYTHON_USE_ASYNC_SLOTS #define CYTHON_USE_ASYNC_SLOTS 0 #undef CYTHON_USE_PYLIST_INTERNALS #define CYTHON_USE_PYLIST_INTERNALS 0 #ifndef CYTHON_USE_UNICODE_INTERNALS #define CYTHON_USE_UNICODE_INTERNALS 1 #endif #undef CYTHON_USE_UNICODE_WRITER #define CYTHON_USE_UNICODE_WRITER 0 #undef CYTHON_USE_PYLONG_INTERNALS #define CYTHON_USE_PYLONG_INTERNALS 0 #ifndef CYTHON_AVOID_BORROWED_REFS #define CYTHON_AVOID_BORROWED_REFS 0 #endif #ifndef CYTHON_ASSUME_SAFE_MACROS #define CYTHON_ASSUME_SAFE_MACROS 1 #endif #ifndef CYTHON_UNPACK_METHODS #define CYTHON_UNPACK_METHODS 1 #endif #undef CYTHON_FAST_THREAD_STATE #define CYTHON_FAST_THREAD_STATE 0 #undef CYTHON_FAST_PYCALL #define CYTHON_FAST_PYCALL 0 #undef CYTHON_PEP489_MULTI_PHASE_INIT #define CYTHON_PEP489_MULTI_PHASE_INIT 0 #undef CYTHON_USE_TP_FINALIZE #define CYTHON_USE_TP_FINALIZE 0 #else #define CYTHON_COMPILING_IN_PYPY 0 #define CYTHON_COMPILING_IN_PYSTON 0 #define CYTHON_COMPILING_IN_CPYTHON 1 #ifndef CYTHON_USE_TYPE_SLOTS #define CYTHON_USE_TYPE_SLOTS 1 #endif #if PY_VERSION_HEX < 0x02070000 #undef CYTHON_USE_PYTYPE_LOOKUP #define CYTHON_USE_PYTYPE_LOOKUP 0 #elif !defined(CYTHON_USE_PYTYPE_LOOKUP) #define CYTHON_USE_PYTYPE_LOOKUP 1 #endif #if PY_MAJOR_VERSION < 3 #undef CYTHON_USE_ASYNC_SLOTS #define CYTHON_USE_ASYNC_SLOTS 0 #elif !defined(CYTHON_USE_ASYNC_SLOTS) #define CYTHON_USE_ASYNC_SLOTS 1 #endif #if PY_VERSION_HEX < 0x02070000 #undef CYTHON_USE_PYLONG_INTERNALS #define CYTHON_USE_PYLONG_INTERNALS 0 #elif !defined(CYTHON_USE_PYLONG_INTERNALS) #define CYTHON_USE_PYLONG_INTERNALS 1 #endif #ifndef CYTHON_USE_PYLIST_INTERNALS #define CYTHON_USE_PYLIST_INTERNALS 1 #endif #ifndef CYTHON_USE_UNICODE_INTERNALS #define CYTHON_USE_UNICODE_INTERNALS 1 #endif #if PY_VERSION_HEX < 0x030300F0 #undef CYTHON_USE_UNICODE_WRITER #define CYTHON_USE_UNICODE_WRITER 0 #elif !defined(CYTHON_USE_UNICODE_WRITER) #define CYTHON_USE_UNICODE_WRITER 1 #endif #ifndef CYTHON_AVOID_BORROWED_REFS #define CYTHON_AVOID_BORROWED_REFS 0 #endif #ifndef CYTHON_ASSUME_SAFE_MACROS #define CYTHON_ASSUME_SAFE_MACROS 1 #endif #ifndef CYTHON_UNPACK_METHODS #define CYTHON_UNPACK_METHODS 1 #endif #ifndef CYTHON_FAST_THREAD_STATE #define CYTHON_FAST_THREAD_STATE 1 #endif #ifndef CYTHON_FAST_PYCALL #define CYTHON_FAST_PYCALL 1 #endif #ifndef CYTHON_PEP489_MULTI_PHASE_INIT #define CYTHON_PEP489_MULTI_PHASE_INIT (0 && PY_VERSION_HEX >= 0x03050000) #endif #ifndef CYTHON_USE_TP_FINALIZE #define CYTHON_USE_TP_FINALIZE (PY_VERSION_HEX >= 0x030400a1) #endif #endif #if !defined(CYTHON_FAST_PYCCALL) #define CYTHON_FAST_PYCCALL (CYTHON_FAST_PYCALL && PY_VERSION_HEX >= 0x030600B1) #endif #if CYTHON_USE_PYLONG_INTERNALS #include "longintrepr.h" #undef SHIFT #undef BASE #undef MASK #endif #if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX < 0x02070600 && !defined(Py_OptimizeFlag) #define Py_OptimizeFlag 0 #endif #define __PYX_BUILD_PY_SSIZE_T "n" #define CYTHON_FORMAT_SSIZE_T "z" #if PY_MAJOR_VERSION < 3 #define __Pyx_BUILTIN_MODULE_NAME "__builtin__" #define __Pyx_PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)\ PyCode_New(a+k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos) #define __Pyx_DefaultClassType PyClass_Type #else #define __Pyx_BUILTIN_MODULE_NAME "builtins" #define __Pyx_PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)\ PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos) #define __Pyx_DefaultClassType PyType_Type #endif #ifndef Py_TPFLAGS_CHECKTYPES #define Py_TPFLAGS_CHECKTYPES 0 #endif #ifndef Py_TPFLAGS_HAVE_INDEX #define Py_TPFLAGS_HAVE_INDEX 0 #endif #ifndef Py_TPFLAGS_HAVE_NEWBUFFER #define Py_TPFLAGS_HAVE_NEWBUFFER 0 #endif #ifndef Py_TPFLAGS_HAVE_FINALIZE #define Py_TPFLAGS_HAVE_FINALIZE 0 #endif #if PY_VERSION_HEX < 0x030700A0 || !defined(METH_FASTCALL) #ifndef METH_FASTCALL #define METH_FASTCALL 0x80 #endif typedef PyObject *(*__Pyx_PyCFunctionFast) (PyObject *self, PyObject **args, Py_ssize_t nargs); typedef PyObject *(*__Pyx_PyCFunctionFastWithKeywords) (PyObject *self, PyObject **args, Py_ssize_t nargs, PyObject *kwnames); #else #define __Pyx_PyCFunctionFast _PyCFunctionFast #define __Pyx_PyCFunctionFastWithKeywords _PyCFunctionFastWithKeywords #endif #if CYTHON_FAST_PYCCALL #define __Pyx_PyFastCFunction_Check(func)\ ((PyCFunction_Check(func) && (METH_FASTCALL == (PyCFunction_GET_FLAGS(func) & ~(METH_CLASS | METH_STATIC | METH_COEXIST | METH_KEYWORDS))))) #else #define __Pyx_PyFastCFunction_Check(func) 0 #endif #if !CYTHON_FAST_THREAD_STATE || PY_VERSION_HEX < 0x02070000 #define __Pyx_PyThreadState_Current PyThreadState_GET() #elif PY_VERSION_HEX >= 0x03060000 #define __Pyx_PyThreadState_Current _PyThreadState_UncheckedGet() #elif PY_VERSION_HEX >= 0x03000000 #define __Pyx_PyThreadState_Current PyThreadState_GET() #else #define __Pyx_PyThreadState_Current _PyThreadState_Current #endif #if CYTHON_COMPILING_IN_CPYTHON || defined(_PyDict_NewPresized) #define __Pyx_PyDict_NewPresized(n) ((n <= 8) ? PyDict_New() : _PyDict_NewPresized(n)) #else #define __Pyx_PyDict_NewPresized(n) PyDict_New() #endif #if PY_MAJOR_VERSION >= 3 || CYTHON_FUTURE_DIVISION #define __Pyx_PyNumber_Divide(x,y) PyNumber_TrueDivide(x,y) #define __Pyx_PyNumber_InPlaceDivide(x,y) PyNumber_InPlaceTrueDivide(x,y) #else #define __Pyx_PyNumber_Divide(x,y) PyNumber_Divide(x,y) #define __Pyx_PyNumber_InPlaceDivide(x,y) PyNumber_InPlaceDivide(x,y) #endif #if PY_VERSION_HEX > 0x03030000 && defined(PyUnicode_KIND) #define CYTHON_PEP393_ENABLED 1 #define __Pyx_PyUnicode_READY(op) (likely(PyUnicode_IS_READY(op)) ?\ 0 : _PyUnicode_Ready((PyObject *)(op))) #define __Pyx_PyUnicode_GET_LENGTH(u) PyUnicode_GET_LENGTH(u) #define __Pyx_PyUnicode_READ_CHAR(u, i) PyUnicode_READ_CHAR(u, i) #define __Pyx_PyUnicode_MAX_CHAR_VALUE(u) PyUnicode_MAX_CHAR_VALUE(u) #define __Pyx_PyUnicode_KIND(u) PyUnicode_KIND(u) #define __Pyx_PyUnicode_DATA(u) PyUnicode_DATA(u) #define __Pyx_PyUnicode_READ(k, d, i) PyUnicode_READ(k, d, i) #define __Pyx_PyUnicode_WRITE(k, d, i, ch) PyUnicode_WRITE(k, d, i, ch) #define __Pyx_PyUnicode_IS_TRUE(u) (0 != (likely(PyUnicode_IS_READY(u)) ? PyUnicode_GET_LENGTH(u) : PyUnicode_GET_SIZE(u))) #else #define CYTHON_PEP393_ENABLED 0 #define PyUnicode_1BYTE_KIND 1 #define PyUnicode_2BYTE_KIND 2 #define PyUnicode_4BYTE_KIND 4 #define __Pyx_PyUnicode_READY(op) (0) #define __Pyx_PyUnicode_GET_LENGTH(u) PyUnicode_GET_SIZE(u) #define __Pyx_PyUnicode_READ_CHAR(u, i) ((Py_UCS4)(PyUnicode_AS_UNICODE(u)[i])) #define __Pyx_PyUnicode_MAX_CHAR_VALUE(u) ((sizeof(Py_UNICODE) == 2) ? 65535 : 1114111) #define __Pyx_PyUnicode_KIND(u) (sizeof(Py_UNICODE)) #define __Pyx_PyUnicode_DATA(u) ((void*)PyUnicode_AS_UNICODE(u)) #define __Pyx_PyUnicode_READ(k, d, i) ((void)(k), (Py_UCS4)(((Py_UNICODE*)d)[i])) #define __Pyx_PyUnicode_WRITE(k, d, i, ch) (((void)(k)), ((Py_UNICODE*)d)[i] = ch) #define __Pyx_PyUnicode_IS_TRUE(u) (0 != PyUnicode_GET_SIZE(u)) #endif #if CYTHON_COMPILING_IN_PYPY #define __Pyx_PyUnicode_Concat(a, b) PyNumber_Add(a, b) #define __Pyx_PyUnicode_ConcatSafe(a, b) PyNumber_Add(a, b) #else #define __Pyx_PyUnicode_Concat(a, b) PyUnicode_Concat(a, b) #define __Pyx_PyUnicode_ConcatSafe(a, b) ((unlikely((a) == Py_None) || unlikely((b) == Py_None)) ?\ PyNumber_Add(a, b) : __Pyx_PyUnicode_Concat(a, b)) #endif #if CYTHON_COMPILING_IN_PYPY && !defined(PyUnicode_Contains) #define PyUnicode_Contains(u, s) PySequence_Contains(u, s) #endif #if CYTHON_COMPILING_IN_PYPY && !defined(PyByteArray_Check) #define PyByteArray_Check(obj) PyObject_TypeCheck(obj, &PyByteArray_Type) #endif #if CYTHON_COMPILING_IN_PYPY && !defined(PyObject_Format) #define PyObject_Format(obj, fmt) PyObject_CallMethod(obj, "__format__", "O", fmt) #endif #if CYTHON_COMPILING_IN_PYPY && !defined(PyObject_Malloc) #define PyObject_Malloc(s) PyMem_Malloc(s) #define PyObject_Free(p) PyMem_Free(p) #define PyObject_Realloc(p) PyMem_Realloc(p) #endif #if CYTHON_COMPILING_IN_PYSTON #define __Pyx_PyCode_HasFreeVars(co) PyCode_HasFreeVars(co) #define __Pyx_PyFrame_SetLineNumber(frame, lineno) PyFrame_SetLineNumber(frame, lineno) #else #define __Pyx_PyCode_HasFreeVars(co) (PyCode_GetNumFree(co) > 0) #define __Pyx_PyFrame_SetLineNumber(frame, lineno) (frame)->f_lineno = (lineno) #endif #define __Pyx_PyString_FormatSafe(a, b) ((unlikely((a) == Py_None)) ? PyNumber_Remainder(a, b) : __Pyx_PyString_Format(a, b)) #define __Pyx_PyUnicode_FormatSafe(a, b) ((unlikely((a) == Py_None)) ? PyNumber_Remainder(a, b) : PyUnicode_Format(a, b)) #if PY_MAJOR_VERSION >= 3 #define __Pyx_PyString_Format(a, b) PyUnicode_Format(a, b) #else #define __Pyx_PyString_Format(a, b) PyString_Format(a, b) #endif #if PY_MAJOR_VERSION < 3 && !defined(PyObject_ASCII) #define PyObject_ASCII(o) PyObject_Repr(o) #endif #if PY_MAJOR_VERSION >= 3 #define PyBaseString_Type PyUnicode_Type #define PyStringObject PyUnicodeObject #define PyString_Type PyUnicode_Type #define PyString_Check PyUnicode_Check #define PyString_CheckExact PyUnicode_CheckExact #endif #if PY_MAJOR_VERSION >= 3 #define __Pyx_PyBaseString_Check(obj) PyUnicode_Check(obj) #define __Pyx_PyBaseString_CheckExact(obj) PyUnicode_CheckExact(obj) #else #define __Pyx_PyBaseString_Check(obj) (PyString_Check(obj) || PyUnicode_Check(obj)) #define __Pyx_PyBaseString_CheckExact(obj) (PyString_CheckExact(obj) || PyUnicode_CheckExact(obj)) #endif #ifndef PySet_CheckExact #define PySet_CheckExact(obj) (Py_TYPE(obj) == &PySet_Type) #endif #define __Pyx_PyException_Check(obj) __Pyx_TypeCheck(obj, PyExc_Exception) #if PY_MAJOR_VERSION >= 3 #define PyIntObject PyLongObject #define PyInt_Type PyLong_Type #define PyInt_Check(op) PyLong_Check(op) #define PyInt_CheckExact(op) PyLong_CheckExact(op) #define PyInt_FromString PyLong_FromString #define PyInt_FromUnicode PyLong_FromUnicode #define PyInt_FromLong PyLong_FromLong #define PyInt_FromSize_t PyLong_FromSize_t #define PyInt_FromSsize_t PyLong_FromSsize_t #define PyInt_AsLong PyLong_AsLong #define PyInt_AS_LONG PyLong_AS_LONG #define PyInt_AsSsize_t PyLong_AsSsize_t #define PyInt_AsUnsignedLongMask PyLong_AsUnsignedLongMask #define PyInt_AsUnsignedLongLongMask PyLong_AsUnsignedLongLongMask #define PyNumber_Int PyNumber_Long #endif #if PY_MAJOR_VERSION >= 3 #define PyBoolObject PyLongObject #endif #if PY_MAJOR_VERSION >= 3 && CYTHON_COMPILING_IN_PYPY #ifndef PyUnicode_InternFromString #define PyUnicode_InternFromString(s) PyUnicode_FromString(s) #endif #endif #if PY_VERSION_HEX < 0x030200A4 typedef long Py_hash_t; #define __Pyx_PyInt_FromHash_t PyInt_FromLong #define __Pyx_PyInt_AsHash_t PyInt_AsLong #else #define __Pyx_PyInt_FromHash_t PyInt_FromSsize_t #define __Pyx_PyInt_AsHash_t PyInt_AsSsize_t #endif #if PY_MAJOR_VERSION >= 3 #define __Pyx_PyMethod_New(func, self, klass) ((self) ? PyMethod_New(func, self) : PyInstanceMethod_New(func)) #else #define __Pyx_PyMethod_New(func, self, klass) PyMethod_New(func, self, klass) #endif #ifndef __has_attribute #define __has_attribute(x) 0 #endif #ifndef __has_cpp_attribute #define __has_cpp_attribute(x) 0 #endif #if CYTHON_USE_ASYNC_SLOTS #if PY_VERSION_HEX >= 0x030500B1 #define __Pyx_PyAsyncMethodsStruct PyAsyncMethods #define __Pyx_PyType_AsAsync(obj) (Py_TYPE(obj)->tp_as_async) #else #define __Pyx_PyType_AsAsync(obj) ((__Pyx_PyAsyncMethodsStruct*) (Py_TYPE(obj)->tp_reserved)) #endif #else #define __Pyx_PyType_AsAsync(obj) NULL #endif #ifndef __Pyx_PyAsyncMethodsStruct typedef struct { unaryfunc am_await; unaryfunc am_aiter; unaryfunc am_anext; } __Pyx_PyAsyncMethodsStruct; #endif #ifndef CYTHON_RESTRICT #if defined(__GNUC__) #define CYTHON_RESTRICT __restrict__ #elif defined(_MSC_VER) && _MSC_VER >= 1400 #define CYTHON_RESTRICT __restrict #elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L #define CYTHON_RESTRICT restrict #else #define CYTHON_RESTRICT #endif #endif #ifndef CYTHON_UNUSED # if defined(__GNUC__) # if !(defined(__cplusplus)) || (__GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 4)) # define CYTHON_UNUSED __attribute__ ((__unused__)) # else # define CYTHON_UNUSED # endif # elif defined(__ICC) || (defined(__INTEL_COMPILER) && !defined(_MSC_VER)) # define CYTHON_UNUSED __attribute__ ((__unused__)) # else # define CYTHON_UNUSED # endif #endif #ifndef CYTHON_MAYBE_UNUSED_VAR # if defined(__cplusplus) template void CYTHON_MAYBE_UNUSED_VAR( const T& ) { } # else # define CYTHON_MAYBE_UNUSED_VAR(x) (void)(x) # endif #endif #ifndef CYTHON_NCP_UNUSED # if CYTHON_COMPILING_IN_CPYTHON # define CYTHON_NCP_UNUSED # else # define CYTHON_NCP_UNUSED CYTHON_UNUSED # endif #endif #define __Pyx_void_to_None(void_result) ((void)(void_result), Py_INCREF(Py_None), Py_None) #ifdef _MSC_VER #ifndef _MSC_STDINT_H_ #if _MSC_VER < 1300 typedef unsigned char uint8_t; typedef unsigned int uint32_t; #else typedef unsigned __int8 uint8_t; typedef unsigned __int32 uint32_t; #endif #endif #else #include #endif #ifndef CYTHON_FALLTHROUGH #if defined(__cplusplus) && __cplusplus >= 201103L #if __has_cpp_attribute(fallthrough) #define CYTHON_FALLTHROUGH [[fallthrough]] #elif __has_cpp_attribute(clang::fallthrough) #define CYTHON_FALLTHROUGH [[clang::fallthrough]] #elif __has_cpp_attribute(gnu::fallthrough) #define CYTHON_FALLTHROUGH [[gnu::fallthrough]] #endif #endif #ifndef CYTHON_FALLTHROUGH #if __has_attribute(fallthrough) #define CYTHON_FALLTHROUGH __attribute__((fallthrough)) #else #define CYTHON_FALLTHROUGH #endif #endif #if defined(__clang__ ) && defined(__apple_build_version__) #if __apple_build_version__ < 7000000 #undef CYTHON_FALLTHROUGH #define CYTHON_FALLTHROUGH #endif #endif #endif #ifndef CYTHON_INLINE #if defined(__clang__) #define CYTHON_INLINE __inline__ __attribute__ ((__unused__)) #elif defined(__GNUC__) #define CYTHON_INLINE __inline__ #elif defined(_MSC_VER) #define CYTHON_INLINE __inline #elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L #define CYTHON_INLINE inline #else #define CYTHON_INLINE #endif #endif #if defined(WIN32) || defined(MS_WINDOWS) #define _USE_MATH_DEFINES #endif #include #ifdef NAN #define __PYX_NAN() ((float) NAN) #else static CYTHON_INLINE float __PYX_NAN() { float value; memset(&value, 0xFF, sizeof(value)); return value; } #endif #if defined(__CYGWIN__) && defined(_LDBL_EQ_DBL) #define __Pyx_truncl trunc #else #define __Pyx_truncl truncl #endif #define __PYX_ERR(f_index, lineno, Ln_error) \ { \ __pyx_filename = __pyx_f[f_index]; __pyx_lineno = lineno; __pyx_clineno = __LINE__; goto Ln_error; \ } #ifndef __PYX_EXTERN_C #ifdef __cplusplus #define __PYX_EXTERN_C extern "C" #else #define __PYX_EXTERN_C extern #endif #endif #define __PYX_HAVE__pygame_sdl2__power #define __PYX_HAVE_API__pygame_sdl2__power #include #include #include #include #include "SDL.h" #ifdef _OPENMP #include #endif /* _OPENMP */ #if defined(PYREX_WITHOUT_ASSERTIONS) && !defined(CYTHON_WITHOUT_ASSERTIONS) #define CYTHON_WITHOUT_ASSERTIONS #endif typedef struct {PyObject **p; const char *s; const Py_ssize_t n; const char* encoding; const char is_unicode; const char is_str; const char intern; } __Pyx_StringTabEntry; #define __PYX_DEFAULT_STRING_ENCODING_IS_ASCII 0 #define __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT 0 #define __PYX_DEFAULT_STRING_ENCODING "" #define __Pyx_PyObject_FromString __Pyx_PyBytes_FromString #define __Pyx_PyObject_FromStringAndSize __Pyx_PyBytes_FromStringAndSize #define __Pyx_uchar_cast(c) ((unsigned char)c) #define __Pyx_long_cast(x) ((long)x) #define __Pyx_fits_Py_ssize_t(v, type, is_signed) (\ (sizeof(type) < sizeof(Py_ssize_t)) ||\ (sizeof(type) > sizeof(Py_ssize_t) &&\ likely(v < (type)PY_SSIZE_T_MAX ||\ v == (type)PY_SSIZE_T_MAX) &&\ (!is_signed || likely(v > (type)PY_SSIZE_T_MIN ||\ v == (type)PY_SSIZE_T_MIN))) ||\ (sizeof(type) == sizeof(Py_ssize_t) &&\ (is_signed || likely(v < (type)PY_SSIZE_T_MAX ||\ v == (type)PY_SSIZE_T_MAX))) ) #if defined (__cplusplus) && __cplusplus >= 201103L #include #define __Pyx_sst_abs(value) std::abs(value) #elif SIZEOF_INT >= SIZEOF_SIZE_T #define __Pyx_sst_abs(value) abs(value) #elif SIZEOF_LONG >= SIZEOF_SIZE_T #define __Pyx_sst_abs(value) labs(value) #elif defined (_MSC_VER) #define __Pyx_sst_abs(value) ((Py_ssize_t)_abs64(value)) #elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L #define __Pyx_sst_abs(value) llabs(value) #elif defined (__GNUC__) #define __Pyx_sst_abs(value) __builtin_llabs(value) #else #define __Pyx_sst_abs(value) ((value<0) ? -value : value) #endif static CYTHON_INLINE const char* __Pyx_PyObject_AsString(PyObject*); static CYTHON_INLINE const char* __Pyx_PyObject_AsStringAndSize(PyObject*, Py_ssize_t* length); #define __Pyx_PyByteArray_FromString(s) PyByteArray_FromStringAndSize((const char*)s, strlen((const char*)s)) #define __Pyx_PyByteArray_FromStringAndSize(s, l) PyByteArray_FromStringAndSize((const char*)s, l) #define __Pyx_PyBytes_FromString PyBytes_FromString #define __Pyx_PyBytes_FromStringAndSize PyBytes_FromStringAndSize static CYTHON_INLINE PyObject* __Pyx_PyUnicode_FromString(const char*); #if PY_MAJOR_VERSION < 3 #define __Pyx_PyStr_FromString __Pyx_PyBytes_FromString #define __Pyx_PyStr_FromStringAndSize __Pyx_PyBytes_FromStringAndSize #else #define __Pyx_PyStr_FromString __Pyx_PyUnicode_FromString #define __Pyx_PyStr_FromStringAndSize __Pyx_PyUnicode_FromStringAndSize #endif #define __Pyx_PyBytes_AsWritableString(s) ((char*) PyBytes_AS_STRING(s)) #define __Pyx_PyBytes_AsWritableSString(s) ((signed char*) PyBytes_AS_STRING(s)) #define __Pyx_PyBytes_AsWritableUString(s) ((unsigned char*) PyBytes_AS_STRING(s)) #define __Pyx_PyBytes_AsString(s) ((const char*) PyBytes_AS_STRING(s)) #define __Pyx_PyBytes_AsSString(s) ((const signed char*) PyBytes_AS_STRING(s)) #define __Pyx_PyBytes_AsUString(s) ((const unsigned char*) PyBytes_AS_STRING(s)) #define __Pyx_PyObject_AsWritableString(s) ((char*) __Pyx_PyObject_AsString(s)) #define __Pyx_PyObject_AsWritableSString(s) ((signed char*) __Pyx_PyObject_AsString(s)) #define __Pyx_PyObject_AsWritableUString(s) ((unsigned char*) __Pyx_PyObject_AsString(s)) #define __Pyx_PyObject_AsSString(s) ((const signed char*) __Pyx_PyObject_AsString(s)) #define __Pyx_PyObject_AsUString(s) ((const unsigned char*) __Pyx_PyObject_AsString(s)) #define __Pyx_PyObject_FromCString(s) __Pyx_PyObject_FromString((const char*)s) #define __Pyx_PyBytes_FromCString(s) __Pyx_PyBytes_FromString((const char*)s) #define __Pyx_PyByteArray_FromCString(s) __Pyx_PyByteArray_FromString((const char*)s) #define __Pyx_PyStr_FromCString(s) __Pyx_PyStr_FromString((const char*)s) #define __Pyx_PyUnicode_FromCString(s) __Pyx_PyUnicode_FromString((const char*)s) static CYTHON_INLINE size_t __Pyx_Py_UNICODE_strlen(const Py_UNICODE *u) { const Py_UNICODE *u_end = u; while (*u_end++) ; return (size_t)(u_end - u - 1); } #define __Pyx_PyUnicode_FromUnicode(u) PyUnicode_FromUnicode(u, __Pyx_Py_UNICODE_strlen(u)) #define __Pyx_PyUnicode_FromUnicodeAndLength PyUnicode_FromUnicode #define __Pyx_PyUnicode_AsUnicode PyUnicode_AsUnicode #define __Pyx_NewRef(obj) (Py_INCREF(obj), obj) #define __Pyx_Owned_Py_None(b) __Pyx_NewRef(Py_None) #define __Pyx_PyBool_FromLong(b) ((b) ? __Pyx_NewRef(Py_True) : __Pyx_NewRef(Py_False)) static CYTHON_INLINE int __Pyx_PyObject_IsTrue(PyObject*); static CYTHON_INLINE PyObject* __Pyx_PyNumber_IntOrLong(PyObject* x); #define __Pyx_PySequence_Tuple(obj)\ (likely(PyTuple_CheckExact(obj)) ? __Pyx_NewRef(obj) : PySequence_Tuple(obj)) static CYTHON_INLINE Py_ssize_t __Pyx_PyIndex_AsSsize_t(PyObject*); static CYTHON_INLINE PyObject * __Pyx_PyInt_FromSize_t(size_t); #if CYTHON_ASSUME_SAFE_MACROS #define __pyx_PyFloat_AsDouble(x) (PyFloat_CheckExact(x) ? PyFloat_AS_DOUBLE(x) : PyFloat_AsDouble(x)) #else #define __pyx_PyFloat_AsDouble(x) PyFloat_AsDouble(x) #endif #define __pyx_PyFloat_AsFloat(x) ((float) __pyx_PyFloat_AsDouble(x)) #if PY_MAJOR_VERSION >= 3 #define __Pyx_PyNumber_Int(x) (PyLong_CheckExact(x) ? __Pyx_NewRef(x) : PyNumber_Long(x)) #else #define __Pyx_PyNumber_Int(x) (PyInt_CheckExact(x) ? __Pyx_NewRef(x) : PyNumber_Int(x)) #endif #define __Pyx_PyNumber_Float(x) (PyFloat_CheckExact(x) ? __Pyx_NewRef(x) : PyNumber_Float(x)) #if PY_MAJOR_VERSION < 3 && __PYX_DEFAULT_STRING_ENCODING_IS_ASCII static int __Pyx_sys_getdefaultencoding_not_ascii; static int __Pyx_init_sys_getdefaultencoding_params(void) { PyObject* sys; PyObject* default_encoding = NULL; PyObject* ascii_chars_u = NULL; PyObject* ascii_chars_b = NULL; const char* default_encoding_c; sys = PyImport_ImportModule("sys"); if (!sys) goto bad; default_encoding = PyObject_CallMethod(sys, (char*) "getdefaultencoding", NULL); Py_DECREF(sys); if (!default_encoding) goto bad; default_encoding_c = PyBytes_AsString(default_encoding); if (!default_encoding_c) goto bad; if (strcmp(default_encoding_c, "ascii") == 0) { __Pyx_sys_getdefaultencoding_not_ascii = 0; } else { char ascii_chars[128]; int c; for (c = 0; c < 128; c++) { ascii_chars[c] = c; } __Pyx_sys_getdefaultencoding_not_ascii = 1; ascii_chars_u = PyUnicode_DecodeASCII(ascii_chars, 128, NULL); if (!ascii_chars_u) goto bad; ascii_chars_b = PyUnicode_AsEncodedString(ascii_chars_u, default_encoding_c, NULL); if (!ascii_chars_b || !PyBytes_Check(ascii_chars_b) || memcmp(ascii_chars, PyBytes_AS_STRING(ascii_chars_b), 128) != 0) { PyErr_Format( PyExc_ValueError, "This module compiled with c_string_encoding=ascii, but default encoding '%.200s' is not a superset of ascii.", default_encoding_c); goto bad; } Py_DECREF(ascii_chars_u); Py_DECREF(ascii_chars_b); } Py_DECREF(default_encoding); return 0; bad: Py_XDECREF(default_encoding); Py_XDECREF(ascii_chars_u); Py_XDECREF(ascii_chars_b); return -1; } #endif #if __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT && PY_MAJOR_VERSION >= 3 #define __Pyx_PyUnicode_FromStringAndSize(c_str, size) PyUnicode_DecodeUTF8(c_str, size, NULL) #else #define __Pyx_PyUnicode_FromStringAndSize(c_str, size) PyUnicode_Decode(c_str, size, __PYX_DEFAULT_STRING_ENCODING, NULL) #if __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT static char* __PYX_DEFAULT_STRING_ENCODING; static int __Pyx_init_sys_getdefaultencoding_params(void) { PyObject* sys; PyObject* default_encoding = NULL; char* default_encoding_c; sys = PyImport_ImportModule("sys"); if (!sys) goto bad; default_encoding = PyObject_CallMethod(sys, (char*) (const char*) "getdefaultencoding", NULL); Py_DECREF(sys); if (!default_encoding) goto bad; default_encoding_c = PyBytes_AsString(default_encoding); if (!default_encoding_c) goto bad; __PYX_DEFAULT_STRING_ENCODING = (char*) malloc(strlen(default_encoding_c)); if (!__PYX_DEFAULT_STRING_ENCODING) goto bad; strcpy(__PYX_DEFAULT_STRING_ENCODING, default_encoding_c); Py_DECREF(default_encoding); return 0; bad: Py_XDECREF(default_encoding); return -1; } #endif #endif /* Test for GCC > 2.95 */ #if defined(__GNUC__) && (__GNUC__ > 2 || (__GNUC__ == 2 && (__GNUC_MINOR__ > 95))) #define likely(x) __builtin_expect(!!(x), 1) #define unlikely(x) __builtin_expect(!!(x), 0) #else /* !__GNUC__ or GCC < 2.95 */ #define likely(x) (x) #define unlikely(x) (x) #endif /* __GNUC__ */ static CYTHON_INLINE void __Pyx_pretend_to_initialize(void* ptr) { (void)ptr; } static PyObject *__pyx_m = NULL; static PyObject *__pyx_d; static PyObject *__pyx_b; static PyObject *__pyx_cython_runtime; static PyObject *__pyx_empty_tuple; static PyObject *__pyx_empty_bytes; static PyObject *__pyx_empty_unicode; static int __pyx_lineno; static int __pyx_clineno = 0; static const char * __pyx_cfilenm= __FILE__; static const char *__pyx_filename; static const char *__pyx_f[] = { "src/pygame_sdl2/power.pyx", }; /*--- Type declarations ---*/ /* --- Runtime support code (head) --- */ /* Refnanny.proto */ #ifndef CYTHON_REFNANNY #define CYTHON_REFNANNY 0 #endif #if CYTHON_REFNANNY typedef struct { void (*INCREF)(void*, PyObject*, int); void (*DECREF)(void*, PyObject*, int); void (*GOTREF)(void*, PyObject*, int); void (*GIVEREF)(void*, PyObject*, int); void* (*SetupContext)(const char*, int, const char*); void (*FinishContext)(void**); } __Pyx_RefNannyAPIStruct; static __Pyx_RefNannyAPIStruct *__Pyx_RefNanny = NULL; static __Pyx_RefNannyAPIStruct *__Pyx_RefNannyImportAPI(const char *modname); #define __Pyx_RefNannyDeclarations void *__pyx_refnanny = NULL; #ifdef WITH_THREAD #define __Pyx_RefNannySetupContext(name, acquire_gil)\ if (acquire_gil) {\ PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure();\ __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), __LINE__, __FILE__);\ PyGILState_Release(__pyx_gilstate_save);\ } else {\ __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), __LINE__, __FILE__);\ } #else #define __Pyx_RefNannySetupContext(name, acquire_gil)\ __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), __LINE__, __FILE__) #endif #define __Pyx_RefNannyFinishContext()\ __Pyx_RefNanny->FinishContext(&__pyx_refnanny) #define __Pyx_INCREF(r) __Pyx_RefNanny->INCREF(__pyx_refnanny, (PyObject *)(r), __LINE__) #define __Pyx_DECREF(r) __Pyx_RefNanny->DECREF(__pyx_refnanny, (PyObject *)(r), __LINE__) #define __Pyx_GOTREF(r) __Pyx_RefNanny->GOTREF(__pyx_refnanny, (PyObject *)(r), __LINE__) #define __Pyx_GIVEREF(r) __Pyx_RefNanny->GIVEREF(__pyx_refnanny, (PyObject *)(r), __LINE__) #define __Pyx_XINCREF(r) do { if((r) != NULL) {__Pyx_INCREF(r); }} while(0) #define __Pyx_XDECREF(r) do { if((r) != NULL) {__Pyx_DECREF(r); }} while(0) #define __Pyx_XGOTREF(r) do { if((r) != NULL) {__Pyx_GOTREF(r); }} while(0) #define __Pyx_XGIVEREF(r) do { if((r) != NULL) {__Pyx_GIVEREF(r);}} while(0) #else #define __Pyx_RefNannyDeclarations #define __Pyx_RefNannySetupContext(name, acquire_gil) #define __Pyx_RefNannyFinishContext() #define __Pyx_INCREF(r) Py_INCREF(r) #define __Pyx_DECREF(r) Py_DECREF(r) #define __Pyx_GOTREF(r) #define __Pyx_GIVEREF(r) #define __Pyx_XINCREF(r) Py_XINCREF(r) #define __Pyx_XDECREF(r) Py_XDECREF(r) #define __Pyx_XGOTREF(r) #define __Pyx_XGIVEREF(r) #endif #define __Pyx_XDECREF_SET(r, v) do {\ PyObject *tmp = (PyObject *) r;\ r = v; __Pyx_XDECREF(tmp);\ } while (0) #define __Pyx_DECREF_SET(r, v) do {\ PyObject *tmp = (PyObject *) r;\ r = v; __Pyx_DECREF(tmp);\ } while (0) #define __Pyx_CLEAR(r) do { PyObject* tmp = ((PyObject*)(r)); r = NULL; __Pyx_DECREF(tmp);} while(0) #define __Pyx_XCLEAR(r) do { if((r) != NULL) {PyObject* tmp = ((PyObject*)(r)); r = NULL; __Pyx_DECREF(tmp);}} while(0) /* PyObjectGetAttrStr.proto */ #if CYTHON_USE_TYPE_SLOTS static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStr(PyObject* obj, PyObject* attr_name) { PyTypeObject* tp = Py_TYPE(obj); if (likely(tp->tp_getattro)) return tp->tp_getattro(obj, attr_name); #if PY_MAJOR_VERSION < 3 if (likely(tp->tp_getattr)) return tp->tp_getattr(obj, PyString_AS_STRING(attr_name)); #endif return PyObject_GetAttr(obj, attr_name); } #else #define __Pyx_PyObject_GetAttrStr(o,n) PyObject_GetAttr(o,n) #endif /* GetBuiltinName.proto */ static PyObject *__Pyx_GetBuiltinName(PyObject *name); /* GetModuleGlobalName.proto */ static CYTHON_INLINE PyObject *__Pyx_GetModuleGlobalName(PyObject *name); /* PyFunctionFastCall.proto */ #if CYTHON_FAST_PYCALL #define __Pyx_PyFunction_FastCall(func, args, nargs)\ __Pyx_PyFunction_FastCallDict((func), (args), (nargs), NULL) #if 1 || PY_VERSION_HEX < 0x030600B1 static PyObject *__Pyx_PyFunction_FastCallDict(PyObject *func, PyObject **args, int nargs, PyObject *kwargs); #else #define __Pyx_PyFunction_FastCallDict(func, args, nargs, kwargs) _PyFunction_FastCallDict(func, args, nargs, kwargs) #endif #endif /* PyCFunctionFastCall.proto */ #if CYTHON_FAST_PYCCALL static CYTHON_INLINE PyObject *__Pyx_PyCFunction_FastCall(PyObject *func, PyObject **args, Py_ssize_t nargs); #else #define __Pyx_PyCFunction_FastCall(func, args, nargs) (assert(0), NULL) #endif /* PyObjectCall.proto */ #if CYTHON_COMPILING_IN_CPYTHON static CYTHON_INLINE PyObject* __Pyx_PyObject_Call(PyObject *func, PyObject *arg, PyObject *kw); #else #define __Pyx_PyObject_Call(func, arg, kw) PyObject_Call(func, arg, kw) #endif /* PyObjectCallMethO.proto */ #if CYTHON_COMPILING_IN_CPYTHON static CYTHON_INLINE PyObject* __Pyx_PyObject_CallMethO(PyObject *func, PyObject *arg); #endif /* PyObjectCallOneArg.proto */ static CYTHON_INLINE PyObject* __Pyx_PyObject_CallOneArg(PyObject *func, PyObject *arg); /* PyObjectCallNoArg.proto */ #if CYTHON_COMPILING_IN_CPYTHON static CYTHON_INLINE PyObject* __Pyx_PyObject_CallNoArg(PyObject *func); #else #define __Pyx_PyObject_CallNoArg(func) __Pyx_PyObject_Call(func, __pyx_empty_tuple, NULL) #endif /* PyObjectSetAttrStr.proto */ #if CYTHON_USE_TYPE_SLOTS #define __Pyx_PyObject_DelAttrStr(o,n) __Pyx_PyObject_SetAttrStr(o,n,NULL) static CYTHON_INLINE int __Pyx_PyObject_SetAttrStr(PyObject* obj, PyObject* attr_name, PyObject* value) { PyTypeObject* tp = Py_TYPE(obj); if (likely(tp->tp_setattro)) return tp->tp_setattro(obj, attr_name, value); #if PY_MAJOR_VERSION < 3 if (likely(tp->tp_setattr)) return tp->tp_setattr(obj, PyString_AS_STRING(attr_name), value); #endif return PyObject_SetAttr(obj, attr_name, value); } #else #define __Pyx_PyObject_DelAttrStr(o,n) PyObject_DelAttr(o,n) #define __Pyx_PyObject_SetAttrStr(o,n,v) PyObject_SetAttr(o,n,v) #endif /* Import.proto */ static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list, int level); /* ImportFrom.proto */ static PyObject* __Pyx_ImportFrom(PyObject* module, PyObject* name); /* CalculateMetaclass.proto */ static PyObject *__Pyx_CalculateMetaclass(PyTypeObject *metaclass, PyObject *bases); /* FetchCommonType.proto */ static PyTypeObject* __Pyx_FetchCommonType(PyTypeObject* type); /* CythonFunction.proto */ #define __Pyx_CyFunction_USED 1 #include #define __Pyx_CYFUNCTION_STATICMETHOD 0x01 #define __Pyx_CYFUNCTION_CLASSMETHOD 0x02 #define __Pyx_CYFUNCTION_CCLASS 0x04 #define __Pyx_CyFunction_GetClosure(f)\ (((__pyx_CyFunctionObject *) (f))->func_closure) #define __Pyx_CyFunction_GetClassObj(f)\ (((__pyx_CyFunctionObject *) (f))->func_classobj) #define __Pyx_CyFunction_Defaults(type, f)\ ((type *)(((__pyx_CyFunctionObject *) (f))->defaults)) #define __Pyx_CyFunction_SetDefaultsGetter(f, g)\ ((__pyx_CyFunctionObject *) (f))->defaults_getter = (g) typedef struct { PyCFunctionObject func; #if PY_VERSION_HEX < 0x030500A0 PyObject *func_weakreflist; #endif PyObject *func_dict; PyObject *func_name; PyObject *func_qualname; PyObject *func_doc; PyObject *func_globals; PyObject *func_code; PyObject *func_closure; PyObject *func_classobj; void *defaults; int defaults_pyobjects; int flags; PyObject *defaults_tuple; PyObject *defaults_kwdict; PyObject *(*defaults_getter)(PyObject *); PyObject *func_annotations; } __pyx_CyFunctionObject; static PyTypeObject *__pyx_CyFunctionType = 0; #define __Pyx_CyFunction_NewEx(ml, flags, qualname, self, module, globals, code)\ __Pyx_CyFunction_New(__pyx_CyFunctionType, ml, flags, qualname, self, module, globals, code) static PyObject *__Pyx_CyFunction_New(PyTypeObject *, PyMethodDef *ml, int flags, PyObject* qualname, PyObject *self, PyObject *module, PyObject *globals, PyObject* code); static CYTHON_INLINE void *__Pyx_CyFunction_InitDefaults(PyObject *m, size_t size, int pyobjects); static CYTHON_INLINE void __Pyx_CyFunction_SetDefaultsTuple(PyObject *m, PyObject *tuple); static CYTHON_INLINE void __Pyx_CyFunction_SetDefaultsKwDict(PyObject *m, PyObject *dict); static CYTHON_INLINE void __Pyx_CyFunction_SetAnnotationsDict(PyObject *m, PyObject *dict); static int __pyx_CyFunction_init(void); /* Py3ClassCreate.proto */ static PyObject *__Pyx_Py3MetaclassPrepare(PyObject *metaclass, PyObject *bases, PyObject *name, PyObject *qualname, PyObject *mkw, PyObject *modname, PyObject *doc); static PyObject *__Pyx_Py3ClassCreate(PyObject *metaclass, PyObject *name, PyObject *bases, PyObject *dict, PyObject *mkw, int calculate_metaclass, int allow_py2_metaclass); /* PyThreadStateGet.proto */ #if CYTHON_FAST_THREAD_STATE #define __Pyx_PyThreadState_declare PyThreadState *__pyx_tstate; #define __Pyx_PyThreadState_assign __pyx_tstate = __Pyx_PyThreadState_Current; #define __Pyx_PyErr_Occurred() __pyx_tstate->curexc_type #else #define __Pyx_PyThreadState_declare #define __Pyx_PyThreadState_assign #define __Pyx_PyErr_Occurred() PyErr_Occurred() #endif /* PyErrFetchRestore.proto */ #if CYTHON_FAST_THREAD_STATE #define __Pyx_PyErr_Clear() __Pyx_ErrRestore(NULL, NULL, NULL) #define __Pyx_ErrRestoreWithState(type, value, tb) __Pyx_ErrRestoreInState(PyThreadState_GET(), type, value, tb) #define __Pyx_ErrFetchWithState(type, value, tb) __Pyx_ErrFetchInState(PyThreadState_GET(), type, value, tb) #define __Pyx_ErrRestore(type, value, tb) __Pyx_ErrRestoreInState(__pyx_tstate, type, value, tb) #define __Pyx_ErrFetch(type, value, tb) __Pyx_ErrFetchInState(__pyx_tstate, type, value, tb) static CYTHON_INLINE void __Pyx_ErrRestoreInState(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb); static CYTHON_INLINE void __Pyx_ErrFetchInState(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb); #if CYTHON_COMPILING_IN_CPYTHON #define __Pyx_PyErr_SetNone(exc) (Py_INCREF(exc), __Pyx_ErrRestore((exc), NULL, NULL)) #else #define __Pyx_PyErr_SetNone(exc) PyErr_SetNone(exc) #endif #else #define __Pyx_PyErr_Clear() PyErr_Clear() #define __Pyx_PyErr_SetNone(exc) PyErr_SetNone(exc) #define __Pyx_ErrRestoreWithState(type, value, tb) PyErr_Restore(type, value, tb) #define __Pyx_ErrFetchWithState(type, value, tb) PyErr_Fetch(type, value, tb) #define __Pyx_ErrRestoreInState(tstate, type, value, tb) PyErr_Restore(type, value, tb) #define __Pyx_ErrFetchInState(tstate, type, value, tb) PyErr_Fetch(type, value, tb) #define __Pyx_ErrRestore(type, value, tb) PyErr_Restore(type, value, tb) #define __Pyx_ErrFetch(type, value, tb) PyErr_Fetch(type, value, tb) #endif /* CLineInTraceback.proto */ #ifdef CYTHON_CLINE_IN_TRACEBACK #define __Pyx_CLineForTraceback(tstate, c_line) (((CYTHON_CLINE_IN_TRACEBACK)) ? c_line : 0) #else static int __Pyx_CLineForTraceback(PyThreadState *tstate, int c_line); #endif /* CodeObjectCache.proto */ typedef struct { PyCodeObject* code_object; int code_line; } __Pyx_CodeObjectCacheEntry; struct __Pyx_CodeObjectCache { int count; int max_count; __Pyx_CodeObjectCacheEntry* entries; }; static struct __Pyx_CodeObjectCache __pyx_code_cache = {0,0,NULL}; static int __pyx_bisect_code_objects(__Pyx_CodeObjectCacheEntry* entries, int count, int code_line); static PyCodeObject *__pyx_find_code_object(int code_line); static void __pyx_insert_code_object(int code_line, PyCodeObject* code_object); /* AddTraceback.proto */ static void __Pyx_AddTraceback(const char *funcname, int c_line, int py_line, const char *filename); /* CIntToPy.proto */ static CYTHON_INLINE PyObject* __Pyx_PyInt_From_SDL_PowerState(SDL_PowerState value); /* CIntToPy.proto */ static CYTHON_INLINE PyObject* __Pyx_PyInt_From_int(int value); /* CIntToPy.proto */ static CYTHON_INLINE PyObject* __Pyx_PyInt_From_long(long value); /* CIntFromPy.proto */ static CYTHON_INLINE long __Pyx_PyInt_As_long(PyObject *); /* CIntFromPy.proto */ static CYTHON_INLINE int __Pyx_PyInt_As_int(PyObject *); /* FastTypeChecks.proto */ #if CYTHON_COMPILING_IN_CPYTHON #define __Pyx_TypeCheck(obj, type) __Pyx_IsSubtype(Py_TYPE(obj), (PyTypeObject *)type) static CYTHON_INLINE int __Pyx_IsSubtype(PyTypeObject *a, PyTypeObject *b); static CYTHON_INLINE int __Pyx_PyErr_GivenExceptionMatches(PyObject *err, PyObject *type); static CYTHON_INLINE int __Pyx_PyErr_GivenExceptionMatches2(PyObject *err, PyObject *type1, PyObject *type2); #else #define __Pyx_TypeCheck(obj, type) PyObject_TypeCheck(obj, (PyTypeObject *)type) #define __Pyx_PyErr_GivenExceptionMatches(err, type) PyErr_GivenExceptionMatches(err, type) #define __Pyx_PyErr_GivenExceptionMatches2(err, type1, type2) (PyErr_GivenExceptionMatches(err, type1) || PyErr_GivenExceptionMatches(err, type2)) #endif /* CheckBinaryVersion.proto */ static int __Pyx_check_binary_version(void); /* InitStrings.proto */ static int __Pyx_InitStrings(__Pyx_StringTabEntry *t); /* Module declarations from 'libc.stdint' */ /* Module declarations from 'libc.string' */ /* Module declarations from 'libc.stdio' */ /* Module declarations from 'libc.stddef' */ /* Module declarations from 'sdl2' */ /* Module declarations from 'pygame_sdl2.power' */ #define __Pyx_MODULE_NAME "pygame_sdl2.power" extern int __pyx_module_is_main_pygame_sdl2__power; int __pyx_module_is_main_pygame_sdl2__power = 0; /* Implementation of 'pygame_sdl2.power' */ static PyObject *__pyx_builtin_object; static const char __pyx_k_rv[] = "rv"; static const char __pyx_k_doc[] = "__doc__"; static const char __pyx_k_get[] = "get"; static const char __pyx_k_main[] = "__main__"; static const char __pyx_k_repr[] = "__repr__"; static const char __pyx_k_self[] = "self"; static const char __pyx_k_test[] = "__test__"; static const char __pyx_k_state[] = "state"; static const char __pyx_k_format[] = "format"; static const char __pyx_k_import[] = "__import__"; static const char __pyx_k_module[] = "__module__"; static const char __pyx_k_object[] = "object"; static const char __pyx_k_INVALID[] = "INVALID"; static const char __pyx_k_percent[] = "percent"; static const char __pyx_k_prepare[] = "__prepare__"; static const char __pyx_k_seconds[] = "seconds"; static const char __pyx_k_qualname[] = "__qualname__"; static const char __pyx_k_PowerInfo[] = "PowerInfo"; static const char __pyx_k_metaclass[] = "__metaclass__"; static const char __pyx_k_get_power_info[] = "get_power_info"; static const char __pyx_k_PowerInfo___repr[] = "PowerInfo.__repr__"; static const char __pyx_k_pygame_sdl2_power[] = "pygame_sdl2.power"; static const char __pyx_k_POWERSTATE_CHARGED[] = "POWERSTATE_CHARGED"; static const char __pyx_k_POWERSTATE_UNKNOWN[] = "POWERSTATE_UNKNOWN"; static const char __pyx_k_cline_in_traceback[] = "cline_in_traceback"; static const char __pyx_k_powerstate_to_name[] = "powerstate_to_name"; static const char __pyx_k_pygame_sdl2_locals[] = "pygame_sdl2.locals"; static const char __pyx_k_POWERSTATE_CHARGING[] = "POWERSTATE_CHARGING"; static const char __pyx_k_POWERSTATE_NO_BATTERY[] = "POWERSTATE_NO_BATTERY"; static const char __pyx_k_POWERSTATE_ON_BATTERY[] = "POWERSTATE_ON_BATTERY"; static const char __pyx_k_src_pygame_sdl2_power_pyx[] = "src/pygame_sdl2/power.pyx"; static const char __pyx_k_PowerInfo_state_seconds_percent[] = ""; static PyObject *__pyx_n_u_INVALID; static PyObject *__pyx_n_s_POWERSTATE_CHARGED; static PyObject *__pyx_n_u_POWERSTATE_CHARGED; static PyObject *__pyx_n_s_POWERSTATE_CHARGING; static PyObject *__pyx_n_u_POWERSTATE_CHARGING; static PyObject *__pyx_n_s_POWERSTATE_NO_BATTERY; static PyObject *__pyx_n_u_POWERSTATE_NO_BATTERY; static PyObject *__pyx_n_s_POWERSTATE_ON_BATTERY; static PyObject *__pyx_n_u_POWERSTATE_ON_BATTERY; static PyObject *__pyx_n_s_POWERSTATE_UNKNOWN; static PyObject *__pyx_n_u_POWERSTATE_UNKNOWN; static PyObject *__pyx_n_s_PowerInfo; static PyObject *__pyx_n_s_PowerInfo___repr; static PyObject *__pyx_kp_u_PowerInfo_state_seconds_percent; static PyObject *__pyx_n_s_cline_in_traceback; static PyObject *__pyx_n_s_doc; static PyObject *__pyx_n_s_format; static PyObject *__pyx_n_s_get; static PyObject *__pyx_n_s_get_power_info; static PyObject *__pyx_n_s_import; static PyObject *__pyx_n_s_main; static PyObject *__pyx_n_s_metaclass; static PyObject *__pyx_n_s_module; static PyObject *__pyx_n_s_object; static PyObject *__pyx_n_s_percent; static PyObject *__pyx_n_s_powerstate_to_name; static PyObject *__pyx_n_s_prepare; static PyObject *__pyx_n_s_pygame_sdl2_locals; static PyObject *__pyx_n_s_pygame_sdl2_power; static PyObject *__pyx_n_s_qualname; static PyObject *__pyx_n_s_repr; static PyObject *__pyx_n_s_rv; static PyObject *__pyx_n_s_seconds; static PyObject *__pyx_n_s_self; static PyObject *__pyx_kp_s_src_pygame_sdl2_power_pyx; static PyObject *__pyx_n_s_state; static PyObject *__pyx_n_s_test; static PyObject *__pyx_pf_11pygame_sdl2_5power_9PowerInfo___repr__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_5power_get_power_info(CYTHON_UNUSED PyObject *__pyx_self); /* proto */ static PyObject *__pyx_tuple_; static PyObject *__pyx_tuple__2; static PyObject *__pyx_tuple__4; static PyObject *__pyx_codeobj__3; static PyObject *__pyx_codeobj__5; /* "pygame_sdl2/power.pyx":33 * * class PowerInfo(object): * def __repr__(self): # <<<<<<<<<<<<<< * return "".format( * powerstate_to_name.get(self.state, "INVALID"), */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_5power_9PowerInfo_1__repr__(PyObject *__pyx_self, PyObject *__pyx_v_self); /*proto*/ static PyMethodDef __pyx_mdef_11pygame_sdl2_5power_9PowerInfo_1__repr__ = {"__repr__", (PyCFunction)__pyx_pw_11pygame_sdl2_5power_9PowerInfo_1__repr__, METH_O, 0}; static PyObject *__pyx_pw_11pygame_sdl2_5power_9PowerInfo_1__repr__(PyObject *__pyx_self, PyObject *__pyx_v_self) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__repr__ (wrapper)", 0); __pyx_r = __pyx_pf_11pygame_sdl2_5power_9PowerInfo___repr__(__pyx_self, ((PyObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_5power_9PowerInfo___repr__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; PyObject *__pyx_t_5 = NULL; PyObject *__pyx_t_6 = NULL; int __pyx_t_7; PyObject *__pyx_t_8 = NULL; __Pyx_RefNannySetupContext("__repr__", 0); /* "pygame_sdl2/power.pyx":34 * class PowerInfo(object): * def __repr__(self): * return "".format( # <<<<<<<<<<<<<< * powerstate_to_name.get(self.state, "INVALID"), * self.seconds, */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_kp_u_PowerInfo_state_seconds_percent, __pyx_n_s_format); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 34, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); /* "pygame_sdl2/power.pyx":35 * def __repr__(self): * return "".format( * powerstate_to_name.get(self.state, "INVALID"), # <<<<<<<<<<<<<< * self.seconds, * self.percent) */ __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_powerstate_to_name); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 35, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_get); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 35, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_state); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 35, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_6 = NULL; __pyx_t_7 = 0; if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_5))) { __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_5); if (likely(__pyx_t_6)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5); __Pyx_INCREF(__pyx_t_6); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_5, function); __pyx_t_7 = 1; } } #if CYTHON_FAST_PYCALL if (PyFunction_Check(__pyx_t_5)) { PyObject *__pyx_temp[3] = {__pyx_t_6, __pyx_t_4, __pyx_n_u_INVALID}; __pyx_t_3 = __Pyx_PyFunction_FastCall(__pyx_t_5, __pyx_temp+1-__pyx_t_7, 2+__pyx_t_7); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 35, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; } else #endif #if CYTHON_FAST_PYCCALL if (__Pyx_PyFastCFunction_Check(__pyx_t_5)) { PyObject *__pyx_temp[3] = {__pyx_t_6, __pyx_t_4, __pyx_n_u_INVALID}; __pyx_t_3 = __Pyx_PyCFunction_FastCall(__pyx_t_5, __pyx_temp+1-__pyx_t_7, 2+__pyx_t_7); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 35, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; } else #endif { __pyx_t_8 = PyTuple_New(2+__pyx_t_7); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 35, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); if (__pyx_t_6) { __Pyx_GIVEREF(__pyx_t_6); PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_6); __pyx_t_6 = NULL; } __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_8, 0+__pyx_t_7, __pyx_t_4); __Pyx_INCREF(__pyx_n_u_INVALID); __Pyx_GIVEREF(__pyx_n_u_INVALID); PyTuple_SET_ITEM(__pyx_t_8, 1+__pyx_t_7, __pyx_n_u_INVALID); __pyx_t_4 = 0; __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_8, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 35, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; } __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; /* "pygame_sdl2/power.pyx":36 * return "".format( * powerstate_to_name.get(self.state, "INVALID"), * self.seconds, # <<<<<<<<<<<<<< * self.percent) * */ __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_seconds); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 36, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); /* "pygame_sdl2/power.pyx":37 * powerstate_to_name.get(self.state, "INVALID"), * self.seconds, * self.percent) # <<<<<<<<<<<<<< * * def get_power_info(): */ __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_percent); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 37, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __pyx_t_4 = NULL; __pyx_t_7 = 0; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) { __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_2); if (likely(__pyx_t_4)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_4); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); __pyx_t_7 = 1; } } #if CYTHON_FAST_PYCALL if (PyFunction_Check(__pyx_t_2)) { PyObject *__pyx_temp[4] = {__pyx_t_4, __pyx_t_3, __pyx_t_5, __pyx_t_8}; __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_7, 3+__pyx_t_7); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 34, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; } else #endif #if CYTHON_FAST_PYCCALL if (__Pyx_PyFastCFunction_Check(__pyx_t_2)) { PyObject *__pyx_temp[4] = {__pyx_t_4, __pyx_t_3, __pyx_t_5, __pyx_t_8}; __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_7, 3+__pyx_t_7); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 34, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; } else #endif { __pyx_t_6 = PyTuple_New(3+__pyx_t_7); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 34, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); if (__pyx_t_4) { __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_4); __pyx_t_4 = NULL; } __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_6, 0+__pyx_t_7, __pyx_t_3); __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_6, 1+__pyx_t_7, __pyx_t_5); __Pyx_GIVEREF(__pyx_t_8); PyTuple_SET_ITEM(__pyx_t_6, 2+__pyx_t_7, __pyx_t_8); __pyx_t_3 = 0; __pyx_t_5 = 0; __pyx_t_8 = 0; __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_6, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 34, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; } __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "pygame_sdl2/power.pyx":33 * * class PowerInfo(object): * def __repr__(self): # <<<<<<<<<<<<<< * return "".format( * powerstate_to_name.get(self.state, "INVALID"), */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_5); __Pyx_XDECREF(__pyx_t_6); __Pyx_XDECREF(__pyx_t_8); __Pyx_AddTraceback("pygame_sdl2.power.PowerInfo.__repr__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/power.pyx":39 * self.percent) * * def get_power_info(): # <<<<<<<<<<<<<< * * cdef int seconds */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_5power_1get_power_info(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused); /*proto*/ static PyMethodDef __pyx_mdef_11pygame_sdl2_5power_1get_power_info = {"get_power_info", (PyCFunction)__pyx_pw_11pygame_sdl2_5power_1get_power_info, METH_NOARGS, 0}; static PyObject *__pyx_pw_11pygame_sdl2_5power_1get_power_info(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("get_power_info (wrapper)", 0); __pyx_r = __pyx_pf_11pygame_sdl2_5power_get_power_info(__pyx_self); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_5power_get_power_info(CYTHON_UNUSED PyObject *__pyx_self) { int __pyx_v_seconds; int __pyx_v_percent; SDL_PowerState __pyx_v_state; PyObject *__pyx_v_rv = NULL; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; __Pyx_RefNannySetupContext("get_power_info", 0); /* "pygame_sdl2/power.pyx":44 * cdef int percent * * state = SDL_GetPowerInfo(&seconds, &percent) # <<<<<<<<<<<<<< * * rv = PowerInfo() */ __pyx_v_state = SDL_GetPowerInfo((&__pyx_v_seconds), (&__pyx_v_percent)); /* "pygame_sdl2/power.pyx":46 * state = SDL_GetPowerInfo(&seconds, &percent) * * rv = PowerInfo() # <<<<<<<<<<<<<< * rv.state = state * rv.seconds = seconds */ __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_PowerInfo); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 46, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = NULL; if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); if (likely(__pyx_t_3)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); } } if (__pyx_t_3) { __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 46, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } else { __pyx_t_1 = __Pyx_PyObject_CallNoArg(__pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 46, __pyx_L1_error) } __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_v_rv = __pyx_t_1; __pyx_t_1 = 0; /* "pygame_sdl2/power.pyx":47 * * rv = PowerInfo() * rv.state = state # <<<<<<<<<<<<<< * rv.seconds = seconds * rv.percent = percent */ __pyx_t_1 = __Pyx_PyInt_From_SDL_PowerState(__pyx_v_state); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 47, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (__Pyx_PyObject_SetAttrStr(__pyx_v_rv, __pyx_n_s_state, __pyx_t_1) < 0) __PYX_ERR(0, 47, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "pygame_sdl2/power.pyx":48 * rv = PowerInfo() * rv.state = state * rv.seconds = seconds # <<<<<<<<<<<<<< * rv.percent = percent * */ __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_seconds); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 48, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (__Pyx_PyObject_SetAttrStr(__pyx_v_rv, __pyx_n_s_seconds, __pyx_t_1) < 0) __PYX_ERR(0, 48, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "pygame_sdl2/power.pyx":49 * rv.state = state * rv.seconds = seconds * rv.percent = percent # <<<<<<<<<<<<<< * * return rv */ __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_percent); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 49, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (__Pyx_PyObject_SetAttrStr(__pyx_v_rv, __pyx_n_s_percent, __pyx_t_1) < 0) __PYX_ERR(0, 49, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "pygame_sdl2/power.pyx":51 * rv.percent = percent * * return rv # <<<<<<<<<<<<<< * * */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(__pyx_v_rv); __pyx_r = __pyx_v_rv; goto __pyx_L0; /* "pygame_sdl2/power.pyx":39 * self.percent) * * def get_power_info(): # <<<<<<<<<<<<<< * * cdef int seconds */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("pygame_sdl2.power.get_power_info", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF(__pyx_v_rv); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyMethodDef __pyx_methods[] = { {0, 0, 0, 0} }; #if PY_MAJOR_VERSION >= 3 #if CYTHON_PEP489_MULTI_PHASE_INIT static PyObject* __pyx_pymod_create(PyObject *spec, PyModuleDef *def); /*proto*/ static int __pyx_pymod_exec_power(PyObject* module); /*proto*/ static PyModuleDef_Slot __pyx_moduledef_slots[] = { {Py_mod_create, (void*)__pyx_pymod_create}, {Py_mod_exec, (void*)__pyx_pymod_exec_power}, {0, NULL} }; #endif static struct PyModuleDef __pyx_moduledef = { PyModuleDef_HEAD_INIT, "power", 0, /* m_doc */ #if CYTHON_PEP489_MULTI_PHASE_INIT 0, /* m_size */ #else -1, /* m_size */ #endif __pyx_methods /* m_methods */, #if CYTHON_PEP489_MULTI_PHASE_INIT __pyx_moduledef_slots, /* m_slots */ #else NULL, /* m_reload */ #endif NULL, /* m_traverse */ NULL, /* m_clear */ NULL /* m_free */ }; #endif static __Pyx_StringTabEntry __pyx_string_tab[] = { {&__pyx_n_u_INVALID, __pyx_k_INVALID, sizeof(__pyx_k_INVALID), 0, 1, 0, 1}, {&__pyx_n_s_POWERSTATE_CHARGED, __pyx_k_POWERSTATE_CHARGED, sizeof(__pyx_k_POWERSTATE_CHARGED), 0, 0, 1, 1}, {&__pyx_n_u_POWERSTATE_CHARGED, __pyx_k_POWERSTATE_CHARGED, sizeof(__pyx_k_POWERSTATE_CHARGED), 0, 1, 0, 1}, {&__pyx_n_s_POWERSTATE_CHARGING, __pyx_k_POWERSTATE_CHARGING, sizeof(__pyx_k_POWERSTATE_CHARGING), 0, 0, 1, 1}, {&__pyx_n_u_POWERSTATE_CHARGING, __pyx_k_POWERSTATE_CHARGING, sizeof(__pyx_k_POWERSTATE_CHARGING), 0, 1, 0, 1}, {&__pyx_n_s_POWERSTATE_NO_BATTERY, __pyx_k_POWERSTATE_NO_BATTERY, sizeof(__pyx_k_POWERSTATE_NO_BATTERY), 0, 0, 1, 1}, {&__pyx_n_u_POWERSTATE_NO_BATTERY, __pyx_k_POWERSTATE_NO_BATTERY, sizeof(__pyx_k_POWERSTATE_NO_BATTERY), 0, 1, 0, 1}, {&__pyx_n_s_POWERSTATE_ON_BATTERY, __pyx_k_POWERSTATE_ON_BATTERY, sizeof(__pyx_k_POWERSTATE_ON_BATTERY), 0, 0, 1, 1}, {&__pyx_n_u_POWERSTATE_ON_BATTERY, __pyx_k_POWERSTATE_ON_BATTERY, sizeof(__pyx_k_POWERSTATE_ON_BATTERY), 0, 1, 0, 1}, {&__pyx_n_s_POWERSTATE_UNKNOWN, __pyx_k_POWERSTATE_UNKNOWN, sizeof(__pyx_k_POWERSTATE_UNKNOWN), 0, 0, 1, 1}, {&__pyx_n_u_POWERSTATE_UNKNOWN, __pyx_k_POWERSTATE_UNKNOWN, sizeof(__pyx_k_POWERSTATE_UNKNOWN), 0, 1, 0, 1}, {&__pyx_n_s_PowerInfo, __pyx_k_PowerInfo, sizeof(__pyx_k_PowerInfo), 0, 0, 1, 1}, {&__pyx_n_s_PowerInfo___repr, __pyx_k_PowerInfo___repr, sizeof(__pyx_k_PowerInfo___repr), 0, 0, 1, 1}, {&__pyx_kp_u_PowerInfo_state_seconds_percent, __pyx_k_PowerInfo_state_seconds_percent, sizeof(__pyx_k_PowerInfo_state_seconds_percent), 0, 1, 0, 0}, {&__pyx_n_s_cline_in_traceback, __pyx_k_cline_in_traceback, sizeof(__pyx_k_cline_in_traceback), 0, 0, 1, 1}, {&__pyx_n_s_doc, __pyx_k_doc, sizeof(__pyx_k_doc), 0, 0, 1, 1}, {&__pyx_n_s_format, __pyx_k_format, sizeof(__pyx_k_format), 0, 0, 1, 1}, {&__pyx_n_s_get, __pyx_k_get, sizeof(__pyx_k_get), 0, 0, 1, 1}, {&__pyx_n_s_get_power_info, __pyx_k_get_power_info, sizeof(__pyx_k_get_power_info), 0, 0, 1, 1}, {&__pyx_n_s_import, __pyx_k_import, sizeof(__pyx_k_import), 0, 0, 1, 1}, {&__pyx_n_s_main, __pyx_k_main, sizeof(__pyx_k_main), 0, 0, 1, 1}, {&__pyx_n_s_metaclass, __pyx_k_metaclass, sizeof(__pyx_k_metaclass), 0, 0, 1, 1}, {&__pyx_n_s_module, __pyx_k_module, sizeof(__pyx_k_module), 0, 0, 1, 1}, {&__pyx_n_s_object, __pyx_k_object, sizeof(__pyx_k_object), 0, 0, 1, 1}, {&__pyx_n_s_percent, __pyx_k_percent, sizeof(__pyx_k_percent), 0, 0, 1, 1}, {&__pyx_n_s_powerstate_to_name, __pyx_k_powerstate_to_name, sizeof(__pyx_k_powerstate_to_name), 0, 0, 1, 1}, {&__pyx_n_s_prepare, __pyx_k_prepare, sizeof(__pyx_k_prepare), 0, 0, 1, 1}, {&__pyx_n_s_pygame_sdl2_locals, __pyx_k_pygame_sdl2_locals, sizeof(__pyx_k_pygame_sdl2_locals), 0, 0, 1, 1}, {&__pyx_n_s_pygame_sdl2_power, __pyx_k_pygame_sdl2_power, sizeof(__pyx_k_pygame_sdl2_power), 0, 0, 1, 1}, {&__pyx_n_s_qualname, __pyx_k_qualname, sizeof(__pyx_k_qualname), 0, 0, 1, 1}, {&__pyx_n_s_repr, __pyx_k_repr, sizeof(__pyx_k_repr), 0, 0, 1, 1}, {&__pyx_n_s_rv, __pyx_k_rv, sizeof(__pyx_k_rv), 0, 0, 1, 1}, {&__pyx_n_s_seconds, __pyx_k_seconds, sizeof(__pyx_k_seconds), 0, 0, 1, 1}, {&__pyx_n_s_self, __pyx_k_self, sizeof(__pyx_k_self), 0, 0, 1, 1}, {&__pyx_kp_s_src_pygame_sdl2_power_pyx, __pyx_k_src_pygame_sdl2_power_pyx, sizeof(__pyx_k_src_pygame_sdl2_power_pyx), 0, 0, 1, 0}, {&__pyx_n_s_state, __pyx_k_state, sizeof(__pyx_k_state), 0, 0, 1, 1}, {&__pyx_n_s_test, __pyx_k_test, sizeof(__pyx_k_test), 0, 0, 1, 1}, {0, 0, 0, 0, 0, 0, 0} }; static int __Pyx_InitCachedBuiltins(void) { __pyx_builtin_object = __Pyx_GetBuiltinName(__pyx_n_s_object); if (!__pyx_builtin_object) __PYX_ERR(0, 32, __pyx_L1_error) return 0; __pyx_L1_error:; return -1; } static int __Pyx_InitCachedConstants(void) { __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__Pyx_InitCachedConstants", 0); /* "pygame_sdl2/power.pyx":32 * * * class PowerInfo(object): # <<<<<<<<<<<<<< * def __repr__(self): * return "".format( */ __pyx_tuple_ = PyTuple_Pack(1, __pyx_builtin_object); if (unlikely(!__pyx_tuple_)) __PYX_ERR(0, 32, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple_); __Pyx_GIVEREF(__pyx_tuple_); /* "pygame_sdl2/power.pyx":33 * * class PowerInfo(object): * def __repr__(self): # <<<<<<<<<<<<<< * return "".format( * powerstate_to_name.get(self.state, "INVALID"), */ __pyx_tuple__2 = PyTuple_Pack(1, __pyx_n_s_self); if (unlikely(!__pyx_tuple__2)) __PYX_ERR(0, 33, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__2); __Pyx_GIVEREF(__pyx_tuple__2); __pyx_codeobj__3 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__2, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_power_pyx, __pyx_n_s_repr, 33, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__3)) __PYX_ERR(0, 33, __pyx_L1_error) /* "pygame_sdl2/power.pyx":39 * self.percent) * * def get_power_info(): # <<<<<<<<<<<<<< * * cdef int seconds */ __pyx_tuple__4 = PyTuple_Pack(4, __pyx_n_s_seconds, __pyx_n_s_percent, __pyx_n_s_state, __pyx_n_s_rv); if (unlikely(!__pyx_tuple__4)) __PYX_ERR(0, 39, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__4); __Pyx_GIVEREF(__pyx_tuple__4); __pyx_codeobj__5 = (PyObject*)__Pyx_PyCode_New(0, 0, 4, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__4, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_power_pyx, __pyx_n_s_get_power_info, 39, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__5)) __PYX_ERR(0, 39, __pyx_L1_error) __Pyx_RefNannyFinishContext(); return 0; __pyx_L1_error:; __Pyx_RefNannyFinishContext(); return -1; } static int __Pyx_InitGlobals(void) { if (__Pyx_InitStrings(__pyx_string_tab) < 0) __PYX_ERR(0, 1, __pyx_L1_error); return 0; __pyx_L1_error:; return -1; } #if PY_MAJOR_VERSION < 3 PyMODINIT_FUNC initpower(void); /*proto*/ PyMODINIT_FUNC initpower(void) #else PyMODINIT_FUNC PyInit_power(void); /*proto*/ PyMODINIT_FUNC PyInit_power(void) #if CYTHON_PEP489_MULTI_PHASE_INIT { return PyModuleDef_Init(&__pyx_moduledef); } static int __Pyx_copy_spec_to_module(PyObject *spec, PyObject *moddict, const char* from_name, const char* to_name) { PyObject *value = PyObject_GetAttrString(spec, from_name); int result = 0; if (likely(value)) { result = PyDict_SetItemString(moddict, to_name, value); Py_DECREF(value); } else if (PyErr_ExceptionMatches(PyExc_AttributeError)) { PyErr_Clear(); } else { result = -1; } return result; } static PyObject* __pyx_pymod_create(PyObject *spec, CYTHON_UNUSED PyModuleDef *def) { PyObject *module = NULL, *moddict, *modname; if (__pyx_m) return __Pyx_NewRef(__pyx_m); modname = PyObject_GetAttrString(spec, "name"); if (unlikely(!modname)) goto bad; module = PyModule_NewObject(modname); Py_DECREF(modname); if (unlikely(!module)) goto bad; moddict = PyModule_GetDict(module); if (unlikely(!moddict)) goto bad; if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "loader", "__loader__") < 0)) goto bad; if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "origin", "__file__") < 0)) goto bad; if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "parent", "__package__") < 0)) goto bad; if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "submodule_search_locations", "__path__") < 0)) goto bad; return module; bad: Py_XDECREF(module); return NULL; } static int __pyx_pymod_exec_power(PyObject *__pyx_pyinit_module) #endif #endif { PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; __Pyx_RefNannyDeclarations #if CYTHON_PEP489_MULTI_PHASE_INIT if (__pyx_m && __pyx_m == __pyx_pyinit_module) return 0; #endif #if CYTHON_REFNANNY __Pyx_RefNanny = __Pyx_RefNannyImportAPI("refnanny"); if (!__Pyx_RefNanny) { PyErr_Clear(); __Pyx_RefNanny = __Pyx_RefNannyImportAPI("Cython.Runtime.refnanny"); if (!__Pyx_RefNanny) Py_FatalError("failed to import 'refnanny' module"); } #endif __Pyx_RefNannySetupContext("PyMODINIT_FUNC PyInit_power(void)", 0); if (__Pyx_check_binary_version() < 0) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_empty_tuple = PyTuple_New(0); if (unlikely(!__pyx_empty_tuple)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_empty_bytes = PyBytes_FromStringAndSize("", 0); if (unlikely(!__pyx_empty_bytes)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_empty_unicode = PyUnicode_FromStringAndSize("", 0); if (unlikely(!__pyx_empty_unicode)) __PYX_ERR(0, 1, __pyx_L1_error) #ifdef __Pyx_CyFunction_USED if (__pyx_CyFunction_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error) #endif #ifdef __Pyx_FusedFunction_USED if (__pyx_FusedFunction_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error) #endif #ifdef __Pyx_Coroutine_USED if (__pyx_Coroutine_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error) #endif #ifdef __Pyx_Generator_USED if (__pyx_Generator_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error) #endif #ifdef __Pyx_AsyncGen_USED if (__pyx_AsyncGen_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error) #endif #ifdef __Pyx_StopAsyncIteration_USED if (__pyx_StopAsyncIteration_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error) #endif /*--- Library function declarations ---*/ /*--- Threads initialization code ---*/ #if defined(__PYX_FORCE_INIT_THREADS) && __PYX_FORCE_INIT_THREADS #ifdef WITH_THREAD /* Python build with threading support? */ PyEval_InitThreads(); #endif #endif /*--- Module creation code ---*/ #if CYTHON_PEP489_MULTI_PHASE_INIT __pyx_m = __pyx_pyinit_module; Py_INCREF(__pyx_m); #else #if PY_MAJOR_VERSION < 3 __pyx_m = Py_InitModule4("power", __pyx_methods, 0, 0, PYTHON_API_VERSION); Py_XINCREF(__pyx_m); #else __pyx_m = PyModule_Create(&__pyx_moduledef); #endif if (unlikely(!__pyx_m)) __PYX_ERR(0, 1, __pyx_L1_error) #endif __pyx_d = PyModule_GetDict(__pyx_m); if (unlikely(!__pyx_d)) __PYX_ERR(0, 1, __pyx_L1_error) Py_INCREF(__pyx_d); __pyx_b = PyImport_AddModule(__Pyx_BUILTIN_MODULE_NAME); if (unlikely(!__pyx_b)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_cython_runtime = PyImport_AddModule((char *) "cython_runtime"); if (unlikely(!__pyx_cython_runtime)) __PYX_ERR(0, 1, __pyx_L1_error) #if CYTHON_COMPILING_IN_PYPY Py_INCREF(__pyx_b); #endif if (PyObject_SetAttrString(__pyx_m, "__builtins__", __pyx_b) < 0) __PYX_ERR(0, 1, __pyx_L1_error); /*--- Initialize various global constants etc. ---*/ if (__Pyx_InitGlobals() < 0) __PYX_ERR(0, 1, __pyx_L1_error) #if PY_MAJOR_VERSION < 3 && (__PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT) if (__Pyx_init_sys_getdefaultencoding_params() < 0) __PYX_ERR(0, 1, __pyx_L1_error) #endif if (__pyx_module_is_main_pygame_sdl2__power) { if (PyObject_SetAttrString(__pyx_m, "__name__", __pyx_n_s_main) < 0) __PYX_ERR(0, 1, __pyx_L1_error) } #if PY_MAJOR_VERSION >= 3 { PyObject *modules = PyImport_GetModuleDict(); if (unlikely(!modules)) __PYX_ERR(0, 1, __pyx_L1_error) if (!PyDict_GetItemString(modules, "pygame_sdl2.power")) { if (unlikely(PyDict_SetItemString(modules, "pygame_sdl2.power", __pyx_m) < 0)) __PYX_ERR(0, 1, __pyx_L1_error) } } #endif /*--- Builtin init code ---*/ if (__Pyx_InitCachedBuiltins() < 0) __PYX_ERR(0, 1, __pyx_L1_error) /*--- Constants init code ---*/ if (__Pyx_InitCachedConstants() < 0) __PYX_ERR(0, 1, __pyx_L1_error) /*--- Global init code ---*/ /*--- Variable export code ---*/ /*--- Function export code ---*/ /*--- Type init code ---*/ /*--- Type import code ---*/ /*--- Variable import code ---*/ /*--- Function import code ---*/ /*--- Execution code ---*/ #if defined(__Pyx_Generator_USED) || defined(__Pyx_Coroutine_USED) if (__Pyx_patch_abc() < 0) __PYX_ERR(0, 1, __pyx_L1_error) #endif /* "pygame_sdl2/power.pyx":19 * # 3. This notice may not be removed or altered from any source distribution. * * from pygame_sdl2.locals import POWERSTATE_UNKNOWN, POWERSTATE_ON_BATTERY, POWERSTATE_NO_BATTERY, POWERSTATE_CHARGING, POWERSTATE_CHARGED # <<<<<<<<<<<<<< * * from sdl2 cimport * */ __pyx_t_1 = PyList_New(5); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 19, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_INCREF(__pyx_n_s_POWERSTATE_UNKNOWN); __Pyx_GIVEREF(__pyx_n_s_POWERSTATE_UNKNOWN); PyList_SET_ITEM(__pyx_t_1, 0, __pyx_n_s_POWERSTATE_UNKNOWN); __Pyx_INCREF(__pyx_n_s_POWERSTATE_ON_BATTERY); __Pyx_GIVEREF(__pyx_n_s_POWERSTATE_ON_BATTERY); PyList_SET_ITEM(__pyx_t_1, 1, __pyx_n_s_POWERSTATE_ON_BATTERY); __Pyx_INCREF(__pyx_n_s_POWERSTATE_NO_BATTERY); __Pyx_GIVEREF(__pyx_n_s_POWERSTATE_NO_BATTERY); PyList_SET_ITEM(__pyx_t_1, 2, __pyx_n_s_POWERSTATE_NO_BATTERY); __Pyx_INCREF(__pyx_n_s_POWERSTATE_CHARGING); __Pyx_GIVEREF(__pyx_n_s_POWERSTATE_CHARGING); PyList_SET_ITEM(__pyx_t_1, 3, __pyx_n_s_POWERSTATE_CHARGING); __Pyx_INCREF(__pyx_n_s_POWERSTATE_CHARGED); __Pyx_GIVEREF(__pyx_n_s_POWERSTATE_CHARGED); PyList_SET_ITEM(__pyx_t_1, 4, __pyx_n_s_POWERSTATE_CHARGED); __pyx_t_2 = __Pyx_Import(__pyx_n_s_pygame_sdl2_locals, __pyx_t_1, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 19, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_1 = __Pyx_ImportFrom(__pyx_t_2, __pyx_n_s_POWERSTATE_UNKNOWN); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 19, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (PyDict_SetItem(__pyx_d, __pyx_n_s_POWERSTATE_UNKNOWN, __pyx_t_1) < 0) __PYX_ERR(0, 19, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_1 = __Pyx_ImportFrom(__pyx_t_2, __pyx_n_s_POWERSTATE_ON_BATTERY); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 19, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (PyDict_SetItem(__pyx_d, __pyx_n_s_POWERSTATE_ON_BATTERY, __pyx_t_1) < 0) __PYX_ERR(0, 19, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_1 = __Pyx_ImportFrom(__pyx_t_2, __pyx_n_s_POWERSTATE_NO_BATTERY); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 19, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (PyDict_SetItem(__pyx_d, __pyx_n_s_POWERSTATE_NO_BATTERY, __pyx_t_1) < 0) __PYX_ERR(0, 19, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_1 = __Pyx_ImportFrom(__pyx_t_2, __pyx_n_s_POWERSTATE_CHARGING); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 19, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (PyDict_SetItem(__pyx_d, __pyx_n_s_POWERSTATE_CHARGING, __pyx_t_1) < 0) __PYX_ERR(0, 19, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_1 = __Pyx_ImportFrom(__pyx_t_2, __pyx_n_s_POWERSTATE_CHARGED); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 19, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (PyDict_SetItem(__pyx_d, __pyx_n_s_POWERSTATE_CHARGED, __pyx_t_1) < 0) __PYX_ERR(0, 19, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "pygame_sdl2/power.pyx":24 * * powerstate_to_name = { * POWERSTATE_UNKNOWN : "POWERSTATE_UNKNOWN", # <<<<<<<<<<<<<< * POWERSTATE_ON_BATTERY : "POWERSTATE_ON_BATTERY", * POWERSTATE_NO_BATTERY : "POWERSTATE_NO_BATTERY", */ __pyx_t_2 = __Pyx_PyDict_NewPresized(5); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 24, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_POWERSTATE_UNKNOWN); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 24, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (PyDict_SetItem(__pyx_t_2, __pyx_t_1, __pyx_n_u_POWERSTATE_UNKNOWN) < 0) __PYX_ERR(0, 24, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "pygame_sdl2/power.pyx":25 * powerstate_to_name = { * POWERSTATE_UNKNOWN : "POWERSTATE_UNKNOWN", * POWERSTATE_ON_BATTERY : "POWERSTATE_ON_BATTERY", # <<<<<<<<<<<<<< * POWERSTATE_NO_BATTERY : "POWERSTATE_NO_BATTERY", * POWERSTATE_CHARGING : "POWERSTATE_CHARGING", */ __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_POWERSTATE_ON_BATTERY); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 25, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (PyDict_SetItem(__pyx_t_2, __pyx_t_1, __pyx_n_u_POWERSTATE_ON_BATTERY) < 0) __PYX_ERR(0, 24, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "pygame_sdl2/power.pyx":26 * POWERSTATE_UNKNOWN : "POWERSTATE_UNKNOWN", * POWERSTATE_ON_BATTERY : "POWERSTATE_ON_BATTERY", * POWERSTATE_NO_BATTERY : "POWERSTATE_NO_BATTERY", # <<<<<<<<<<<<<< * POWERSTATE_CHARGING : "POWERSTATE_CHARGING", * POWERSTATE_CHARGED : "POWERSTATE_CHARGED", */ __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_POWERSTATE_NO_BATTERY); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 26, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (PyDict_SetItem(__pyx_t_2, __pyx_t_1, __pyx_n_u_POWERSTATE_NO_BATTERY) < 0) __PYX_ERR(0, 24, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "pygame_sdl2/power.pyx":27 * POWERSTATE_ON_BATTERY : "POWERSTATE_ON_BATTERY", * POWERSTATE_NO_BATTERY : "POWERSTATE_NO_BATTERY", * POWERSTATE_CHARGING : "POWERSTATE_CHARGING", # <<<<<<<<<<<<<< * POWERSTATE_CHARGED : "POWERSTATE_CHARGED", * } */ __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_POWERSTATE_CHARGING); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 27, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (PyDict_SetItem(__pyx_t_2, __pyx_t_1, __pyx_n_u_POWERSTATE_CHARGING) < 0) __PYX_ERR(0, 24, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "pygame_sdl2/power.pyx":28 * POWERSTATE_NO_BATTERY : "POWERSTATE_NO_BATTERY", * POWERSTATE_CHARGING : "POWERSTATE_CHARGING", * POWERSTATE_CHARGED : "POWERSTATE_CHARGED", # <<<<<<<<<<<<<< * } * */ __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_POWERSTATE_CHARGED); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 28, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (PyDict_SetItem(__pyx_t_2, __pyx_t_1, __pyx_n_u_POWERSTATE_CHARGED) < 0) __PYX_ERR(0, 24, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (PyDict_SetItem(__pyx_d, __pyx_n_s_powerstate_to_name, __pyx_t_2) < 0) __PYX_ERR(0, 23, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "pygame_sdl2/power.pyx":32 * * * class PowerInfo(object): # <<<<<<<<<<<<<< * def __repr__(self): * return "".format( */ __pyx_t_2 = __Pyx_CalculateMetaclass(NULL, __pyx_tuple_); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 32, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_1 = __Pyx_Py3MetaclassPrepare(__pyx_t_2, __pyx_tuple_, __pyx_n_s_PowerInfo, __pyx_n_s_PowerInfo, (PyObject *) NULL, __pyx_n_s_pygame_sdl2_power, (PyObject *) NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 32, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); /* "pygame_sdl2/power.pyx":33 * * class PowerInfo(object): * def __repr__(self): # <<<<<<<<<<<<<< * return "".format( * powerstate_to_name.get(self.state, "INVALID"), */ __pyx_t_3 = __Pyx_CyFunction_NewEx(&__pyx_mdef_11pygame_sdl2_5power_9PowerInfo_1__repr__, 0, __pyx_n_s_PowerInfo___repr, NULL, __pyx_n_s_pygame_sdl2_power, __pyx_d, ((PyObject *)__pyx_codeobj__3)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 33, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); if (PyObject_SetItem(__pyx_t_1, __pyx_n_s_repr, __pyx_t_3) < 0) __PYX_ERR(0, 33, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "pygame_sdl2/power.pyx":32 * * * class PowerInfo(object): # <<<<<<<<<<<<<< * def __repr__(self): * return "".format( */ __pyx_t_3 = __Pyx_Py3ClassCreate(__pyx_t_2, __pyx_n_s_PowerInfo, __pyx_tuple_, __pyx_t_1, NULL, 0, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 32, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); if (PyDict_SetItem(__pyx_d, __pyx_n_s_PowerInfo, __pyx_t_3) < 0) __PYX_ERR(0, 32, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "pygame_sdl2/power.pyx":39 * self.percent) * * def get_power_info(): # <<<<<<<<<<<<<< * * cdef int seconds */ __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_11pygame_sdl2_5power_1get_power_info, NULL, __pyx_n_s_pygame_sdl2_power); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 39, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_get_power_info, __pyx_t_2) < 0) __PYX_ERR(0, 39, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "pygame_sdl2/power.pyx":1 * # Copyright 2017 Tom Rothamel # <<<<<<<<<<<<<< * # * # This software is provided 'as-is', without any express or implied */ __pyx_t_2 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_test, __pyx_t_2) < 0) __PYX_ERR(0, 1, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /*--- Wrapped vars code ---*/ goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); if (__pyx_m) { if (__pyx_d) { __Pyx_AddTraceback("init pygame_sdl2.power", 0, __pyx_lineno, __pyx_filename); } Py_DECREF(__pyx_m); __pyx_m = 0; } else if (!PyErr_Occurred()) { PyErr_SetString(PyExc_ImportError, "init pygame_sdl2.power"); } __pyx_L0:; __Pyx_RefNannyFinishContext(); #if CYTHON_PEP489_MULTI_PHASE_INIT return (__pyx_m != NULL) ? 0 : -1; #elif PY_MAJOR_VERSION >= 3 return __pyx_m; #else return; #endif } /* --- Runtime support code --- */ /* Refnanny */ #if CYTHON_REFNANNY static __Pyx_RefNannyAPIStruct *__Pyx_RefNannyImportAPI(const char *modname) { PyObject *m = NULL, *p = NULL; void *r = NULL; m = PyImport_ImportModule((char *)modname); if (!m) goto end; p = PyObject_GetAttrString(m, (char *)"RefNannyAPI"); if (!p) goto end; r = PyLong_AsVoidPtr(p); end: Py_XDECREF(p); Py_XDECREF(m); return (__Pyx_RefNannyAPIStruct *)r; } #endif /* GetBuiltinName */ static PyObject *__Pyx_GetBuiltinName(PyObject *name) { PyObject* result = __Pyx_PyObject_GetAttrStr(__pyx_b, name); if (unlikely(!result)) { PyErr_Format(PyExc_NameError, #if PY_MAJOR_VERSION >= 3 "name '%U' is not defined", name); #else "name '%.200s' is not defined", PyString_AS_STRING(name)); #endif } return result; } /* GetModuleGlobalName */ static CYTHON_INLINE PyObject *__Pyx_GetModuleGlobalName(PyObject *name) { PyObject *result; #if !CYTHON_AVOID_BORROWED_REFS result = PyDict_GetItem(__pyx_d, name); if (likely(result)) { Py_INCREF(result); } else { #else result = PyObject_GetItem(__pyx_d, name); if (!result) { PyErr_Clear(); #endif result = __Pyx_GetBuiltinName(name); } return result; } /* PyFunctionFastCall */ #if CYTHON_FAST_PYCALL #include "frameobject.h" static PyObject* __Pyx_PyFunction_FastCallNoKw(PyCodeObject *co, PyObject **args, Py_ssize_t na, PyObject *globals) { PyFrameObject *f; PyThreadState *tstate = __Pyx_PyThreadState_Current; PyObject **fastlocals; Py_ssize_t i; PyObject *result; assert(globals != NULL); /* XXX Perhaps we should create a specialized PyFrame_New() that doesn't take locals, but does take builtins without sanity checking them. */ assert(tstate != NULL); f = PyFrame_New(tstate, co, globals, NULL); if (f == NULL) { return NULL; } fastlocals = f->f_localsplus; for (i = 0; i < na; i++) { Py_INCREF(*args); fastlocals[i] = *args++; } result = PyEval_EvalFrameEx(f,0); ++tstate->recursion_depth; Py_DECREF(f); --tstate->recursion_depth; return result; } #if 1 || PY_VERSION_HEX < 0x030600B1 static PyObject *__Pyx_PyFunction_FastCallDict(PyObject *func, PyObject **args, int nargs, PyObject *kwargs) { PyCodeObject *co = (PyCodeObject *)PyFunction_GET_CODE(func); PyObject *globals = PyFunction_GET_GLOBALS(func); PyObject *argdefs = PyFunction_GET_DEFAULTS(func); PyObject *closure; #if PY_MAJOR_VERSION >= 3 PyObject *kwdefs; #endif PyObject *kwtuple, **k; PyObject **d; Py_ssize_t nd; Py_ssize_t nk; PyObject *result; assert(kwargs == NULL || PyDict_Check(kwargs)); nk = kwargs ? PyDict_Size(kwargs) : 0; if (Py_EnterRecursiveCall((char*)" while calling a Python object")) { return NULL; } if ( #if PY_MAJOR_VERSION >= 3 co->co_kwonlyargcount == 0 && #endif likely(kwargs == NULL || nk == 0) && co->co_flags == (CO_OPTIMIZED | CO_NEWLOCALS | CO_NOFREE)) { if (argdefs == NULL && co->co_argcount == nargs) { result = __Pyx_PyFunction_FastCallNoKw(co, args, nargs, globals); goto done; } else if (nargs == 0 && argdefs != NULL && co->co_argcount == Py_SIZE(argdefs)) { /* function called with no arguments, but all parameters have a default value: use default values as arguments .*/ args = &PyTuple_GET_ITEM(argdefs, 0); result =__Pyx_PyFunction_FastCallNoKw(co, args, Py_SIZE(argdefs), globals); goto done; } } if (kwargs != NULL) { Py_ssize_t pos, i; kwtuple = PyTuple_New(2 * nk); if (kwtuple == NULL) { result = NULL; goto done; } k = &PyTuple_GET_ITEM(kwtuple, 0); pos = i = 0; while (PyDict_Next(kwargs, &pos, &k[i], &k[i+1])) { Py_INCREF(k[i]); Py_INCREF(k[i+1]); i += 2; } nk = i / 2; } else { kwtuple = NULL; k = NULL; } closure = PyFunction_GET_CLOSURE(func); #if PY_MAJOR_VERSION >= 3 kwdefs = PyFunction_GET_KW_DEFAULTS(func); #endif if (argdefs != NULL) { d = &PyTuple_GET_ITEM(argdefs, 0); nd = Py_SIZE(argdefs); } else { d = NULL; nd = 0; } #if PY_MAJOR_VERSION >= 3 result = PyEval_EvalCodeEx((PyObject*)co, globals, (PyObject *)NULL, args, nargs, k, (int)nk, d, (int)nd, kwdefs, closure); #else result = PyEval_EvalCodeEx(co, globals, (PyObject *)NULL, args, nargs, k, (int)nk, d, (int)nd, closure); #endif Py_XDECREF(kwtuple); done: Py_LeaveRecursiveCall(); return result; } #endif #endif /* PyCFunctionFastCall */ #if CYTHON_FAST_PYCCALL static CYTHON_INLINE PyObject * __Pyx_PyCFunction_FastCall(PyObject *func_obj, PyObject **args, Py_ssize_t nargs) { PyCFunctionObject *func = (PyCFunctionObject*)func_obj; PyCFunction meth = PyCFunction_GET_FUNCTION(func); PyObject *self = PyCFunction_GET_SELF(func); int flags = PyCFunction_GET_FLAGS(func); assert(PyCFunction_Check(func)); assert(METH_FASTCALL == (flags & ~(METH_CLASS | METH_STATIC | METH_COEXIST | METH_KEYWORDS))); assert(nargs >= 0); assert(nargs == 0 || args != NULL); /* _PyCFunction_FastCallDict() must not be called with an exception set, because it may clear it (directly or indirectly) and so the caller loses its exception */ assert(!PyErr_Occurred()); if ((PY_VERSION_HEX < 0x030700A0) || unlikely(flags & METH_KEYWORDS)) { return (*((__Pyx_PyCFunctionFastWithKeywords)meth)) (self, args, nargs, NULL); } else { return (*((__Pyx_PyCFunctionFast)meth)) (self, args, nargs); } } #endif /* PyObjectCall */ #if CYTHON_COMPILING_IN_CPYTHON static CYTHON_INLINE PyObject* __Pyx_PyObject_Call(PyObject *func, PyObject *arg, PyObject *kw) { PyObject *result; ternaryfunc call = func->ob_type->tp_call; if (unlikely(!call)) return PyObject_Call(func, arg, kw); if (unlikely(Py_EnterRecursiveCall((char*)" while calling a Python object"))) return NULL; result = (*call)(func, arg, kw); Py_LeaveRecursiveCall(); if (unlikely(!result) && unlikely(!PyErr_Occurred())) { PyErr_SetString( PyExc_SystemError, "NULL result without error in PyObject_Call"); } return result; } #endif /* PyObjectCallMethO */ #if CYTHON_COMPILING_IN_CPYTHON static CYTHON_INLINE PyObject* __Pyx_PyObject_CallMethO(PyObject *func, PyObject *arg) { PyObject *self, *result; PyCFunction cfunc; cfunc = PyCFunction_GET_FUNCTION(func); self = PyCFunction_GET_SELF(func); if (unlikely(Py_EnterRecursiveCall((char*)" while calling a Python object"))) return NULL; result = cfunc(self, arg); Py_LeaveRecursiveCall(); if (unlikely(!result) && unlikely(!PyErr_Occurred())) { PyErr_SetString( PyExc_SystemError, "NULL result without error in PyObject_Call"); } return result; } #endif /* PyObjectCallOneArg */ #if CYTHON_COMPILING_IN_CPYTHON static PyObject* __Pyx__PyObject_CallOneArg(PyObject *func, PyObject *arg) { PyObject *result; PyObject *args = PyTuple_New(1); if (unlikely(!args)) return NULL; Py_INCREF(arg); PyTuple_SET_ITEM(args, 0, arg); result = __Pyx_PyObject_Call(func, args, NULL); Py_DECREF(args); return result; } static CYTHON_INLINE PyObject* __Pyx_PyObject_CallOneArg(PyObject *func, PyObject *arg) { #if CYTHON_FAST_PYCALL if (PyFunction_Check(func)) { return __Pyx_PyFunction_FastCall(func, &arg, 1); } #endif if (likely(PyCFunction_Check(func))) { if (likely(PyCFunction_GET_FLAGS(func) & METH_O)) { return __Pyx_PyObject_CallMethO(func, arg); #if CYTHON_FAST_PYCCALL } else if (PyCFunction_GET_FLAGS(func) & METH_FASTCALL) { return __Pyx_PyCFunction_FastCall(func, &arg, 1); #endif } } return __Pyx__PyObject_CallOneArg(func, arg); } #else static CYTHON_INLINE PyObject* __Pyx_PyObject_CallOneArg(PyObject *func, PyObject *arg) { PyObject *result; PyObject *args = PyTuple_Pack(1, arg); if (unlikely(!args)) return NULL; result = __Pyx_PyObject_Call(func, args, NULL); Py_DECREF(args); return result; } #endif /* PyObjectCallNoArg */ #if CYTHON_COMPILING_IN_CPYTHON static CYTHON_INLINE PyObject* __Pyx_PyObject_CallNoArg(PyObject *func) { #if CYTHON_FAST_PYCALL if (PyFunction_Check(func)) { return __Pyx_PyFunction_FastCall(func, NULL, 0); } #endif #ifdef __Pyx_CyFunction_USED if (likely(PyCFunction_Check(func) || __Pyx_TypeCheck(func, __pyx_CyFunctionType))) { #else if (likely(PyCFunction_Check(func))) { #endif if (likely(PyCFunction_GET_FLAGS(func) & METH_NOARGS)) { return __Pyx_PyObject_CallMethO(func, NULL); } } return __Pyx_PyObject_Call(func, __pyx_empty_tuple, NULL); } #endif /* Import */ static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list, int level) { PyObject *empty_list = 0; PyObject *module = 0; PyObject *global_dict = 0; PyObject *empty_dict = 0; PyObject *list; #if PY_MAJOR_VERSION < 3 PyObject *py_import; py_import = __Pyx_PyObject_GetAttrStr(__pyx_b, __pyx_n_s_import); if (!py_import) goto bad; #endif if (from_list) list = from_list; else { empty_list = PyList_New(0); if (!empty_list) goto bad; list = empty_list; } global_dict = PyModule_GetDict(__pyx_m); if (!global_dict) goto bad; empty_dict = PyDict_New(); if (!empty_dict) goto bad; { #if PY_MAJOR_VERSION >= 3 if (level == -1) { if (strchr(__Pyx_MODULE_NAME, '.')) { module = PyImport_ImportModuleLevelObject( name, global_dict, empty_dict, list, 1); if (!module) { if (!PyErr_ExceptionMatches(PyExc_ImportError)) goto bad; PyErr_Clear(); } } level = 0; } #endif if (!module) { #if PY_MAJOR_VERSION < 3 PyObject *py_level = PyInt_FromLong(level); if (!py_level) goto bad; module = PyObject_CallFunctionObjArgs(py_import, name, global_dict, empty_dict, list, py_level, NULL); Py_DECREF(py_level); #else module = PyImport_ImportModuleLevelObject( name, global_dict, empty_dict, list, level); #endif } } bad: #if PY_MAJOR_VERSION < 3 Py_XDECREF(py_import); #endif Py_XDECREF(empty_list); Py_XDECREF(empty_dict); return module; } /* ImportFrom */ static PyObject* __Pyx_ImportFrom(PyObject* module, PyObject* name) { PyObject* value = __Pyx_PyObject_GetAttrStr(module, name); if (unlikely(!value) && PyErr_ExceptionMatches(PyExc_AttributeError)) { PyErr_Format(PyExc_ImportError, #if PY_MAJOR_VERSION < 3 "cannot import name %.230s", PyString_AS_STRING(name)); #else "cannot import name %S", name); #endif } return value; } /* CalculateMetaclass */ static PyObject *__Pyx_CalculateMetaclass(PyTypeObject *metaclass, PyObject *bases) { Py_ssize_t i, nbases = PyTuple_GET_SIZE(bases); for (i=0; i < nbases; i++) { PyTypeObject *tmptype; PyObject *tmp = PyTuple_GET_ITEM(bases, i); tmptype = Py_TYPE(tmp); #if PY_MAJOR_VERSION < 3 if (tmptype == &PyClass_Type) continue; #endif if (!metaclass) { metaclass = tmptype; continue; } if (PyType_IsSubtype(metaclass, tmptype)) continue; if (PyType_IsSubtype(tmptype, metaclass)) { metaclass = tmptype; continue; } PyErr_SetString(PyExc_TypeError, "metaclass conflict: " "the metaclass of a derived class " "must be a (non-strict) subclass " "of the metaclasses of all its bases"); return NULL; } if (!metaclass) { #if PY_MAJOR_VERSION < 3 metaclass = &PyClass_Type; #else metaclass = &PyType_Type; #endif } Py_INCREF((PyObject*) metaclass); return (PyObject*) metaclass; } /* FetchCommonType */ static PyTypeObject* __Pyx_FetchCommonType(PyTypeObject* type) { PyObject* fake_module; PyTypeObject* cached_type = NULL; fake_module = PyImport_AddModule((char*) "_cython_" CYTHON_ABI); if (!fake_module) return NULL; Py_INCREF(fake_module); cached_type = (PyTypeObject*) PyObject_GetAttrString(fake_module, type->tp_name); if (cached_type) { if (!PyType_Check((PyObject*)cached_type)) { PyErr_Format(PyExc_TypeError, "Shared Cython type %.200s is not a type object", type->tp_name); goto bad; } if (cached_type->tp_basicsize != type->tp_basicsize) { PyErr_Format(PyExc_TypeError, "Shared Cython type %.200s has the wrong size, try recompiling", type->tp_name); goto bad; } } else { if (!PyErr_ExceptionMatches(PyExc_AttributeError)) goto bad; PyErr_Clear(); if (PyType_Ready(type) < 0) goto bad; if (PyObject_SetAttrString(fake_module, type->tp_name, (PyObject*) type) < 0) goto bad; Py_INCREF(type); cached_type = type; } done: Py_DECREF(fake_module); return cached_type; bad: Py_XDECREF(cached_type); cached_type = NULL; goto done; } /* CythonFunction */ static PyObject * __Pyx_CyFunction_get_doc(__pyx_CyFunctionObject *op, CYTHON_UNUSED void *closure) { if (unlikely(op->func_doc == NULL)) { if (op->func.m_ml->ml_doc) { #if PY_MAJOR_VERSION >= 3 op->func_doc = PyUnicode_FromString(op->func.m_ml->ml_doc); #else op->func_doc = PyString_FromString(op->func.m_ml->ml_doc); #endif if (unlikely(op->func_doc == NULL)) return NULL; } else { Py_INCREF(Py_None); return Py_None; } } Py_INCREF(op->func_doc); return op->func_doc; } static int __Pyx_CyFunction_set_doc(__pyx_CyFunctionObject *op, PyObject *value) { PyObject *tmp = op->func_doc; if (value == NULL) { value = Py_None; } Py_INCREF(value); op->func_doc = value; Py_XDECREF(tmp); return 0; } static PyObject * __Pyx_CyFunction_get_name(__pyx_CyFunctionObject *op) { if (unlikely(op->func_name == NULL)) { #if PY_MAJOR_VERSION >= 3 op->func_name = PyUnicode_InternFromString(op->func.m_ml->ml_name); #else op->func_name = PyString_InternFromString(op->func.m_ml->ml_name); #endif if (unlikely(op->func_name == NULL)) return NULL; } Py_INCREF(op->func_name); return op->func_name; } static int __Pyx_CyFunction_set_name(__pyx_CyFunctionObject *op, PyObject *value) { PyObject *tmp; #if PY_MAJOR_VERSION >= 3 if (unlikely(value == NULL || !PyUnicode_Check(value))) { #else if (unlikely(value == NULL || !PyString_Check(value))) { #endif PyErr_SetString(PyExc_TypeError, "__name__ must be set to a string object"); return -1; } tmp = op->func_name; Py_INCREF(value); op->func_name = value; Py_XDECREF(tmp); return 0; } static PyObject * __Pyx_CyFunction_get_qualname(__pyx_CyFunctionObject *op) { Py_INCREF(op->func_qualname); return op->func_qualname; } static int __Pyx_CyFunction_set_qualname(__pyx_CyFunctionObject *op, PyObject *value) { PyObject *tmp; #if PY_MAJOR_VERSION >= 3 if (unlikely(value == NULL || !PyUnicode_Check(value))) { #else if (unlikely(value == NULL || !PyString_Check(value))) { #endif PyErr_SetString(PyExc_TypeError, "__qualname__ must be set to a string object"); return -1; } tmp = op->func_qualname; Py_INCREF(value); op->func_qualname = value; Py_XDECREF(tmp); return 0; } static PyObject * __Pyx_CyFunction_get_self(__pyx_CyFunctionObject *m, CYTHON_UNUSED void *closure) { PyObject *self; self = m->func_closure; if (self == NULL) self = Py_None; Py_INCREF(self); return self; } static PyObject * __Pyx_CyFunction_get_dict(__pyx_CyFunctionObject *op) { if (unlikely(op->func_dict == NULL)) { op->func_dict = PyDict_New(); if (unlikely(op->func_dict == NULL)) return NULL; } Py_INCREF(op->func_dict); return op->func_dict; } static int __Pyx_CyFunction_set_dict(__pyx_CyFunctionObject *op, PyObject *value) { PyObject *tmp; if (unlikely(value == NULL)) { PyErr_SetString(PyExc_TypeError, "function's dictionary may not be deleted"); return -1; } if (unlikely(!PyDict_Check(value))) { PyErr_SetString(PyExc_TypeError, "setting function's dictionary to a non-dict"); return -1; } tmp = op->func_dict; Py_INCREF(value); op->func_dict = value; Py_XDECREF(tmp); return 0; } static PyObject * __Pyx_CyFunction_get_globals(__pyx_CyFunctionObject *op) { Py_INCREF(op->func_globals); return op->func_globals; } static PyObject * __Pyx_CyFunction_get_closure(CYTHON_UNUSED __pyx_CyFunctionObject *op) { Py_INCREF(Py_None); return Py_None; } static PyObject * __Pyx_CyFunction_get_code(__pyx_CyFunctionObject *op) { PyObject* result = (op->func_code) ? op->func_code : Py_None; Py_INCREF(result); return result; } static int __Pyx_CyFunction_init_defaults(__pyx_CyFunctionObject *op) { int result = 0; PyObject *res = op->defaults_getter((PyObject *) op); if (unlikely(!res)) return -1; #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS op->defaults_tuple = PyTuple_GET_ITEM(res, 0); Py_INCREF(op->defaults_tuple); op->defaults_kwdict = PyTuple_GET_ITEM(res, 1); Py_INCREF(op->defaults_kwdict); #else op->defaults_tuple = PySequence_ITEM(res, 0); if (unlikely(!op->defaults_tuple)) result = -1; else { op->defaults_kwdict = PySequence_ITEM(res, 1); if (unlikely(!op->defaults_kwdict)) result = -1; } #endif Py_DECREF(res); return result; } static int __Pyx_CyFunction_set_defaults(__pyx_CyFunctionObject *op, PyObject* value) { PyObject* tmp; if (!value) { value = Py_None; } else if (value != Py_None && !PyTuple_Check(value)) { PyErr_SetString(PyExc_TypeError, "__defaults__ must be set to a tuple object"); return -1; } Py_INCREF(value); tmp = op->defaults_tuple; op->defaults_tuple = value; Py_XDECREF(tmp); return 0; } static PyObject * __Pyx_CyFunction_get_defaults(__pyx_CyFunctionObject *op) { PyObject* result = op->defaults_tuple; if (unlikely(!result)) { if (op->defaults_getter) { if (__Pyx_CyFunction_init_defaults(op) < 0) return NULL; result = op->defaults_tuple; } else { result = Py_None; } } Py_INCREF(result); return result; } static int __Pyx_CyFunction_set_kwdefaults(__pyx_CyFunctionObject *op, PyObject* value) { PyObject* tmp; if (!value) { value = Py_None; } else if (value != Py_None && !PyDict_Check(value)) { PyErr_SetString(PyExc_TypeError, "__kwdefaults__ must be set to a dict object"); return -1; } Py_INCREF(value); tmp = op->defaults_kwdict; op->defaults_kwdict = value; Py_XDECREF(tmp); return 0; } static PyObject * __Pyx_CyFunction_get_kwdefaults(__pyx_CyFunctionObject *op) { PyObject* result = op->defaults_kwdict; if (unlikely(!result)) { if (op->defaults_getter) { if (__Pyx_CyFunction_init_defaults(op) < 0) return NULL; result = op->defaults_kwdict; } else { result = Py_None; } } Py_INCREF(result); return result; } static int __Pyx_CyFunction_set_annotations(__pyx_CyFunctionObject *op, PyObject* value) { PyObject* tmp; if (!value || value == Py_None) { value = NULL; } else if (!PyDict_Check(value)) { PyErr_SetString(PyExc_TypeError, "__annotations__ must be set to a dict object"); return -1; } Py_XINCREF(value); tmp = op->func_annotations; op->func_annotations = value; Py_XDECREF(tmp); return 0; } static PyObject * __Pyx_CyFunction_get_annotations(__pyx_CyFunctionObject *op) { PyObject* result = op->func_annotations; if (unlikely(!result)) { result = PyDict_New(); if (unlikely(!result)) return NULL; op->func_annotations = result; } Py_INCREF(result); return result; } static PyGetSetDef __pyx_CyFunction_getsets[] = { {(char *) "func_doc", (getter)__Pyx_CyFunction_get_doc, (setter)__Pyx_CyFunction_set_doc, 0, 0}, {(char *) "__doc__", (getter)__Pyx_CyFunction_get_doc, (setter)__Pyx_CyFunction_set_doc, 0, 0}, {(char *) "func_name", (getter)__Pyx_CyFunction_get_name, (setter)__Pyx_CyFunction_set_name, 0, 0}, {(char *) "__name__", (getter)__Pyx_CyFunction_get_name, (setter)__Pyx_CyFunction_set_name, 0, 0}, {(char *) "__qualname__", (getter)__Pyx_CyFunction_get_qualname, (setter)__Pyx_CyFunction_set_qualname, 0, 0}, {(char *) "__self__", (getter)__Pyx_CyFunction_get_self, 0, 0, 0}, {(char *) "func_dict", (getter)__Pyx_CyFunction_get_dict, (setter)__Pyx_CyFunction_set_dict, 0, 0}, {(char *) "__dict__", (getter)__Pyx_CyFunction_get_dict, (setter)__Pyx_CyFunction_set_dict, 0, 0}, {(char *) "func_globals", (getter)__Pyx_CyFunction_get_globals, 0, 0, 0}, {(char *) "__globals__", (getter)__Pyx_CyFunction_get_globals, 0, 0, 0}, {(char *) "func_closure", (getter)__Pyx_CyFunction_get_closure, 0, 0, 0}, {(char *) "__closure__", (getter)__Pyx_CyFunction_get_closure, 0, 0, 0}, {(char *) "func_code", (getter)__Pyx_CyFunction_get_code, 0, 0, 0}, {(char *) "__code__", (getter)__Pyx_CyFunction_get_code, 0, 0, 0}, {(char *) "func_defaults", (getter)__Pyx_CyFunction_get_defaults, (setter)__Pyx_CyFunction_set_defaults, 0, 0}, {(char *) "__defaults__", (getter)__Pyx_CyFunction_get_defaults, (setter)__Pyx_CyFunction_set_defaults, 0, 0}, {(char *) "__kwdefaults__", (getter)__Pyx_CyFunction_get_kwdefaults, (setter)__Pyx_CyFunction_set_kwdefaults, 0, 0}, {(char *) "__annotations__", (getter)__Pyx_CyFunction_get_annotations, (setter)__Pyx_CyFunction_set_annotations, 0, 0}, {0, 0, 0, 0, 0} }; static PyMemberDef __pyx_CyFunction_members[] = { {(char *) "__module__", T_OBJECT, offsetof(PyCFunctionObject, m_module), PY_WRITE_RESTRICTED, 0}, {0, 0, 0, 0, 0} }; static PyObject * __Pyx_CyFunction_reduce(__pyx_CyFunctionObject *m, CYTHON_UNUSED PyObject *args) { #if PY_MAJOR_VERSION >= 3 return PyUnicode_FromString(m->func.m_ml->ml_name); #else return PyString_FromString(m->func.m_ml->ml_name); #endif } static PyMethodDef __pyx_CyFunction_methods[] = { {"__reduce__", (PyCFunction)__Pyx_CyFunction_reduce, METH_VARARGS, 0}, {0, 0, 0, 0} }; #if PY_VERSION_HEX < 0x030500A0 #define __Pyx_CyFunction_weakreflist(cyfunc) ((cyfunc)->func_weakreflist) #else #define __Pyx_CyFunction_weakreflist(cyfunc) ((cyfunc)->func.m_weakreflist) #endif static PyObject *__Pyx_CyFunction_New(PyTypeObject *type, PyMethodDef *ml, int flags, PyObject* qualname, PyObject *closure, PyObject *module, PyObject* globals, PyObject* code) { __pyx_CyFunctionObject *op = PyObject_GC_New(__pyx_CyFunctionObject, type); if (op == NULL) return NULL; op->flags = flags; __Pyx_CyFunction_weakreflist(op) = NULL; op->func.m_ml = ml; op->func.m_self = (PyObject *) op; Py_XINCREF(closure); op->func_closure = closure; Py_XINCREF(module); op->func.m_module = module; op->func_dict = NULL; op->func_name = NULL; Py_INCREF(qualname); op->func_qualname = qualname; op->func_doc = NULL; op->func_classobj = NULL; op->func_globals = globals; Py_INCREF(op->func_globals); Py_XINCREF(code); op->func_code = code; op->defaults_pyobjects = 0; op->defaults = NULL; op->defaults_tuple = NULL; op->defaults_kwdict = NULL; op->defaults_getter = NULL; op->func_annotations = NULL; PyObject_GC_Track(op); return (PyObject *) op; } static int __Pyx_CyFunction_clear(__pyx_CyFunctionObject *m) { Py_CLEAR(m->func_closure); Py_CLEAR(m->func.m_module); Py_CLEAR(m->func_dict); Py_CLEAR(m->func_name); Py_CLEAR(m->func_qualname); Py_CLEAR(m->func_doc); Py_CLEAR(m->func_globals); Py_CLEAR(m->func_code); Py_CLEAR(m->func_classobj); Py_CLEAR(m->defaults_tuple); Py_CLEAR(m->defaults_kwdict); Py_CLEAR(m->func_annotations); if (m->defaults) { PyObject **pydefaults = __Pyx_CyFunction_Defaults(PyObject *, m); int i; for (i = 0; i < m->defaults_pyobjects; i++) Py_XDECREF(pydefaults[i]); PyObject_Free(m->defaults); m->defaults = NULL; } return 0; } static void __Pyx__CyFunction_dealloc(__pyx_CyFunctionObject *m) { if (__Pyx_CyFunction_weakreflist(m) != NULL) PyObject_ClearWeakRefs((PyObject *) m); __Pyx_CyFunction_clear(m); PyObject_GC_Del(m); } static void __Pyx_CyFunction_dealloc(__pyx_CyFunctionObject *m) { PyObject_GC_UnTrack(m); __Pyx__CyFunction_dealloc(m); } static int __Pyx_CyFunction_traverse(__pyx_CyFunctionObject *m, visitproc visit, void *arg) { Py_VISIT(m->func_closure); Py_VISIT(m->func.m_module); Py_VISIT(m->func_dict); Py_VISIT(m->func_name); Py_VISIT(m->func_qualname); Py_VISIT(m->func_doc); Py_VISIT(m->func_globals); Py_VISIT(m->func_code); Py_VISIT(m->func_classobj); Py_VISIT(m->defaults_tuple); Py_VISIT(m->defaults_kwdict); if (m->defaults) { PyObject **pydefaults = __Pyx_CyFunction_Defaults(PyObject *, m); int i; for (i = 0; i < m->defaults_pyobjects; i++) Py_VISIT(pydefaults[i]); } return 0; } static PyObject *__Pyx_CyFunction_descr_get(PyObject *func, PyObject *obj, PyObject *type) { __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func; if (m->flags & __Pyx_CYFUNCTION_STATICMETHOD) { Py_INCREF(func); return func; } if (m->flags & __Pyx_CYFUNCTION_CLASSMETHOD) { if (type == NULL) type = (PyObject *)(Py_TYPE(obj)); return __Pyx_PyMethod_New(func, type, (PyObject *)(Py_TYPE(type))); } if (obj == Py_None) obj = NULL; return __Pyx_PyMethod_New(func, obj, type); } static PyObject* __Pyx_CyFunction_repr(__pyx_CyFunctionObject *op) { #if PY_MAJOR_VERSION >= 3 return PyUnicode_FromFormat("", op->func_qualname, (void *)op); #else return PyString_FromFormat("", PyString_AsString(op->func_qualname), (void *)op); #endif } static PyObject * __Pyx_CyFunction_CallMethod(PyObject *func, PyObject *self, PyObject *arg, PyObject *kw) { PyCFunctionObject* f = (PyCFunctionObject*)func; PyCFunction meth = f->m_ml->ml_meth; Py_ssize_t size; switch (f->m_ml->ml_flags & (METH_VARARGS | METH_KEYWORDS | METH_NOARGS | METH_O)) { case METH_VARARGS: if (likely(kw == NULL || PyDict_Size(kw) == 0)) return (*meth)(self, arg); break; case METH_VARARGS | METH_KEYWORDS: return (*(PyCFunctionWithKeywords)meth)(self, arg, kw); case METH_NOARGS: if (likely(kw == NULL || PyDict_Size(kw) == 0)) { size = PyTuple_GET_SIZE(arg); if (likely(size == 0)) return (*meth)(self, NULL); PyErr_Format(PyExc_TypeError, "%.200s() takes no arguments (%" CYTHON_FORMAT_SSIZE_T "d given)", f->m_ml->ml_name, size); return NULL; } break; case METH_O: if (likely(kw == NULL || PyDict_Size(kw) == 0)) { size = PyTuple_GET_SIZE(arg); if (likely(size == 1)) { PyObject *result, *arg0; #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS arg0 = PyTuple_GET_ITEM(arg, 0); #else arg0 = PySequence_ITEM(arg, 0); if (unlikely(!arg0)) return NULL; #endif result = (*meth)(self, arg0); #if !(CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS) Py_DECREF(arg0); #endif return result; } PyErr_Format(PyExc_TypeError, "%.200s() takes exactly one argument (%" CYTHON_FORMAT_SSIZE_T "d given)", f->m_ml->ml_name, size); return NULL; } break; default: PyErr_SetString(PyExc_SystemError, "Bad call flags in " "__Pyx_CyFunction_Call. METH_OLDARGS is no " "longer supported!"); return NULL; } PyErr_Format(PyExc_TypeError, "%.200s() takes no keyword arguments", f->m_ml->ml_name); return NULL; } static CYTHON_INLINE PyObject *__Pyx_CyFunction_Call(PyObject *func, PyObject *arg, PyObject *kw) { return __Pyx_CyFunction_CallMethod(func, ((PyCFunctionObject*)func)->m_self, arg, kw); } static PyObject *__Pyx_CyFunction_CallAsMethod(PyObject *func, PyObject *args, PyObject *kw) { PyObject *result; __pyx_CyFunctionObject *cyfunc = (__pyx_CyFunctionObject *) func; if ((cyfunc->flags & __Pyx_CYFUNCTION_CCLASS) && !(cyfunc->flags & __Pyx_CYFUNCTION_STATICMETHOD)) { Py_ssize_t argc; PyObject *new_args; PyObject *self; argc = PyTuple_GET_SIZE(args); new_args = PyTuple_GetSlice(args, 1, argc); if (unlikely(!new_args)) return NULL; self = PyTuple_GetItem(args, 0); if (unlikely(!self)) { Py_DECREF(new_args); return NULL; } result = __Pyx_CyFunction_CallMethod(func, self, new_args, kw); Py_DECREF(new_args); } else { result = __Pyx_CyFunction_Call(func, args, kw); } return result; } static PyTypeObject __pyx_CyFunctionType_type = { PyVarObject_HEAD_INIT(0, 0) "cython_function_or_method", sizeof(__pyx_CyFunctionObject), 0, (destructor) __Pyx_CyFunction_dealloc, 0, 0, 0, #if PY_MAJOR_VERSION < 3 0, #else 0, #endif (reprfunc) __Pyx_CyFunction_repr, 0, 0, 0, 0, __Pyx_CyFunction_CallAsMethod, 0, 0, 0, 0, Py_TPFLAGS_DEFAULT | Py_TPFLAGS_HAVE_GC, 0, (traverseproc) __Pyx_CyFunction_traverse, (inquiry) __Pyx_CyFunction_clear, 0, #if PY_VERSION_HEX < 0x030500A0 offsetof(__pyx_CyFunctionObject, func_weakreflist), #else offsetof(PyCFunctionObject, m_weakreflist), #endif 0, 0, __pyx_CyFunction_methods, __pyx_CyFunction_members, __pyx_CyFunction_getsets, 0, 0, __Pyx_CyFunction_descr_get, 0, offsetof(__pyx_CyFunctionObject, func_dict), 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, #if PY_VERSION_HEX >= 0x030400a1 0, #endif }; static int __pyx_CyFunction_init(void) { __pyx_CyFunctionType = __Pyx_FetchCommonType(&__pyx_CyFunctionType_type); if (unlikely(__pyx_CyFunctionType == NULL)) { return -1; } return 0; } static CYTHON_INLINE void *__Pyx_CyFunction_InitDefaults(PyObject *func, size_t size, int pyobjects) { __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func; m->defaults = PyObject_Malloc(size); if (unlikely(!m->defaults)) return PyErr_NoMemory(); memset(m->defaults, 0, size); m->defaults_pyobjects = pyobjects; return m->defaults; } static CYTHON_INLINE void __Pyx_CyFunction_SetDefaultsTuple(PyObject *func, PyObject *tuple) { __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func; m->defaults_tuple = tuple; Py_INCREF(tuple); } static CYTHON_INLINE void __Pyx_CyFunction_SetDefaultsKwDict(PyObject *func, PyObject *dict) { __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func; m->defaults_kwdict = dict; Py_INCREF(dict); } static CYTHON_INLINE void __Pyx_CyFunction_SetAnnotationsDict(PyObject *func, PyObject *dict) { __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func; m->func_annotations = dict; Py_INCREF(dict); } /* Py3ClassCreate */ static PyObject *__Pyx_Py3MetaclassPrepare(PyObject *metaclass, PyObject *bases, PyObject *name, PyObject *qualname, PyObject *mkw, PyObject *modname, PyObject *doc) { PyObject *ns; if (metaclass) { PyObject *prep = __Pyx_PyObject_GetAttrStr(metaclass, __pyx_n_s_prepare); if (prep) { PyObject *pargs = PyTuple_Pack(2, name, bases); if (unlikely(!pargs)) { Py_DECREF(prep); return NULL; } ns = PyObject_Call(prep, pargs, mkw); Py_DECREF(prep); Py_DECREF(pargs); } else { if (unlikely(!PyErr_ExceptionMatches(PyExc_AttributeError))) return NULL; PyErr_Clear(); ns = PyDict_New(); } } else { ns = PyDict_New(); } if (unlikely(!ns)) return NULL; if (unlikely(PyObject_SetItem(ns, __pyx_n_s_module, modname) < 0)) goto bad; if (unlikely(PyObject_SetItem(ns, __pyx_n_s_qualname, qualname) < 0)) goto bad; if (unlikely(doc && PyObject_SetItem(ns, __pyx_n_s_doc, doc) < 0)) goto bad; return ns; bad: Py_DECREF(ns); return NULL; } static PyObject *__Pyx_Py3ClassCreate(PyObject *metaclass, PyObject *name, PyObject *bases, PyObject *dict, PyObject *mkw, int calculate_metaclass, int allow_py2_metaclass) { PyObject *result, *margs; PyObject *owned_metaclass = NULL; if (allow_py2_metaclass) { owned_metaclass = PyObject_GetItem(dict, __pyx_n_s_metaclass); if (owned_metaclass) { metaclass = owned_metaclass; } else if (likely(PyErr_ExceptionMatches(PyExc_KeyError))) { PyErr_Clear(); } else { return NULL; } } if (calculate_metaclass && (!metaclass || PyType_Check(metaclass))) { metaclass = __Pyx_CalculateMetaclass((PyTypeObject*) metaclass, bases); Py_XDECREF(owned_metaclass); if (unlikely(!metaclass)) return NULL; owned_metaclass = metaclass; } margs = PyTuple_Pack(3, name, bases, dict); if (unlikely(!margs)) { result = NULL; } else { result = PyObject_Call(metaclass, margs, mkw); Py_DECREF(margs); } Py_XDECREF(owned_metaclass); return result; } /* PyErrFetchRestore */ #if CYTHON_FAST_THREAD_STATE static CYTHON_INLINE void __Pyx_ErrRestoreInState(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb) { PyObject *tmp_type, *tmp_value, *tmp_tb; tmp_type = tstate->curexc_type; tmp_value = tstate->curexc_value; tmp_tb = tstate->curexc_traceback; tstate->curexc_type = type; tstate->curexc_value = value; tstate->curexc_traceback = tb; Py_XDECREF(tmp_type); Py_XDECREF(tmp_value); Py_XDECREF(tmp_tb); } static CYTHON_INLINE void __Pyx_ErrFetchInState(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb) { *type = tstate->curexc_type; *value = tstate->curexc_value; *tb = tstate->curexc_traceback; tstate->curexc_type = 0; tstate->curexc_value = 0; tstate->curexc_traceback = 0; } #endif /* CLineInTraceback */ #ifndef CYTHON_CLINE_IN_TRACEBACK static int __Pyx_CLineForTraceback(CYTHON_UNUSED PyThreadState *tstate, int c_line) { PyObject *use_cline; PyObject *ptype, *pvalue, *ptraceback; #if CYTHON_COMPILING_IN_CPYTHON PyObject **cython_runtime_dict; #endif __Pyx_ErrFetchInState(tstate, &ptype, &pvalue, &ptraceback); #if CYTHON_COMPILING_IN_CPYTHON cython_runtime_dict = _PyObject_GetDictPtr(__pyx_cython_runtime); if (likely(cython_runtime_dict)) { use_cline = PyDict_GetItem(*cython_runtime_dict, __pyx_n_s_cline_in_traceback); } else #endif { PyObject *use_cline_obj = __Pyx_PyObject_GetAttrStr(__pyx_cython_runtime, __pyx_n_s_cline_in_traceback); if (use_cline_obj) { use_cline = PyObject_Not(use_cline_obj) ? Py_False : Py_True; Py_DECREF(use_cline_obj); } else { PyErr_Clear(); use_cline = NULL; } } if (!use_cline) { c_line = 0; PyObject_SetAttr(__pyx_cython_runtime, __pyx_n_s_cline_in_traceback, Py_False); } else if (PyObject_Not(use_cline) != 0) { c_line = 0; } __Pyx_ErrRestoreInState(tstate, ptype, pvalue, ptraceback); return c_line; } #endif /* CodeObjectCache */ static int __pyx_bisect_code_objects(__Pyx_CodeObjectCacheEntry* entries, int count, int code_line) { int start = 0, mid = 0, end = count - 1; if (end >= 0 && code_line > entries[end].code_line) { return count; } while (start < end) { mid = start + (end - start) / 2; if (code_line < entries[mid].code_line) { end = mid; } else if (code_line > entries[mid].code_line) { start = mid + 1; } else { return mid; } } if (code_line <= entries[mid].code_line) { return mid; } else { return mid + 1; } } static PyCodeObject *__pyx_find_code_object(int code_line) { PyCodeObject* code_object; int pos; if (unlikely(!code_line) || unlikely(!__pyx_code_cache.entries)) { return NULL; } pos = __pyx_bisect_code_objects(__pyx_code_cache.entries, __pyx_code_cache.count, code_line); if (unlikely(pos >= __pyx_code_cache.count) || unlikely(__pyx_code_cache.entries[pos].code_line != code_line)) { return NULL; } code_object = __pyx_code_cache.entries[pos].code_object; Py_INCREF(code_object); return code_object; } static void __pyx_insert_code_object(int code_line, PyCodeObject* code_object) { int pos, i; __Pyx_CodeObjectCacheEntry* entries = __pyx_code_cache.entries; if (unlikely(!code_line)) { return; } if (unlikely(!entries)) { entries = (__Pyx_CodeObjectCacheEntry*)PyMem_Malloc(64*sizeof(__Pyx_CodeObjectCacheEntry)); if (likely(entries)) { __pyx_code_cache.entries = entries; __pyx_code_cache.max_count = 64; __pyx_code_cache.count = 1; entries[0].code_line = code_line; entries[0].code_object = code_object; Py_INCREF(code_object); } return; } pos = __pyx_bisect_code_objects(__pyx_code_cache.entries, __pyx_code_cache.count, code_line); if ((pos < __pyx_code_cache.count) && unlikely(__pyx_code_cache.entries[pos].code_line == code_line)) { PyCodeObject* tmp = entries[pos].code_object; entries[pos].code_object = code_object; Py_DECREF(tmp); return; } if (__pyx_code_cache.count == __pyx_code_cache.max_count) { int new_max = __pyx_code_cache.max_count + 64; entries = (__Pyx_CodeObjectCacheEntry*)PyMem_Realloc( __pyx_code_cache.entries, (size_t)new_max*sizeof(__Pyx_CodeObjectCacheEntry)); if (unlikely(!entries)) { return; } __pyx_code_cache.entries = entries; __pyx_code_cache.max_count = new_max; } for (i=__pyx_code_cache.count; i>pos; i--) { entries[i] = entries[i-1]; } entries[pos].code_line = code_line; entries[pos].code_object = code_object; __pyx_code_cache.count++; Py_INCREF(code_object); } /* AddTraceback */ #include "compile.h" #include "frameobject.h" #include "traceback.h" static PyCodeObject* __Pyx_CreateCodeObjectForTraceback( const char *funcname, int c_line, int py_line, const char *filename) { PyCodeObject *py_code = 0; PyObject *py_srcfile = 0; PyObject *py_funcname = 0; #if PY_MAJOR_VERSION < 3 py_srcfile = PyString_FromString(filename); #else py_srcfile = PyUnicode_FromString(filename); #endif if (!py_srcfile) goto bad; if (c_line) { #if PY_MAJOR_VERSION < 3 py_funcname = PyString_FromFormat( "%s (%s:%d)", funcname, __pyx_cfilenm, c_line); #else py_funcname = PyUnicode_FromFormat( "%s (%s:%d)", funcname, __pyx_cfilenm, c_line); #endif } else { #if PY_MAJOR_VERSION < 3 py_funcname = PyString_FromString(funcname); #else py_funcname = PyUnicode_FromString(funcname); #endif } if (!py_funcname) goto bad; py_code = __Pyx_PyCode_New( 0, 0, 0, 0, 0, __pyx_empty_bytes, /*PyObject *code,*/ __pyx_empty_tuple, /*PyObject *consts,*/ __pyx_empty_tuple, /*PyObject *names,*/ __pyx_empty_tuple, /*PyObject *varnames,*/ __pyx_empty_tuple, /*PyObject *freevars,*/ __pyx_empty_tuple, /*PyObject *cellvars,*/ py_srcfile, /*PyObject *filename,*/ py_funcname, /*PyObject *name,*/ py_line, __pyx_empty_bytes /*PyObject *lnotab*/ ); Py_DECREF(py_srcfile); Py_DECREF(py_funcname); return py_code; bad: Py_XDECREF(py_srcfile); Py_XDECREF(py_funcname); return NULL; } static void __Pyx_AddTraceback(const char *funcname, int c_line, int py_line, const char *filename) { PyCodeObject *py_code = 0; PyFrameObject *py_frame = 0; PyThreadState *tstate = __Pyx_PyThreadState_Current; if (c_line) { c_line = __Pyx_CLineForTraceback(tstate, c_line); } py_code = __pyx_find_code_object(c_line ? -c_line : py_line); if (!py_code) { py_code = __Pyx_CreateCodeObjectForTraceback( funcname, c_line, py_line, filename); if (!py_code) goto bad; __pyx_insert_code_object(c_line ? -c_line : py_line, py_code); } py_frame = PyFrame_New( tstate, /*PyThreadState *tstate,*/ py_code, /*PyCodeObject *code,*/ __pyx_d, /*PyObject *globals,*/ 0 /*PyObject *locals*/ ); if (!py_frame) goto bad; __Pyx_PyFrame_SetLineNumber(py_frame, py_line); PyTraceBack_Here(py_frame); bad: Py_XDECREF(py_code); Py_XDECREF(py_frame); } /* CIntToPy */ static CYTHON_INLINE PyObject* __Pyx_PyInt_From_SDL_PowerState(SDL_PowerState value) { const SDL_PowerState neg_one = (SDL_PowerState) -1, const_zero = (SDL_PowerState) 0; const int is_unsigned = neg_one > const_zero; if (is_unsigned) { if (sizeof(SDL_PowerState) < sizeof(long)) { return PyInt_FromLong((long) value); } else if (sizeof(SDL_PowerState) <= sizeof(unsigned long)) { return PyLong_FromUnsignedLong((unsigned long) value); #ifdef HAVE_LONG_LONG } else if (sizeof(SDL_PowerState) <= sizeof(unsigned PY_LONG_LONG)) { return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value); #endif } } else { if (sizeof(SDL_PowerState) <= sizeof(long)) { return PyInt_FromLong((long) value); #ifdef HAVE_LONG_LONG } else if (sizeof(SDL_PowerState) <= sizeof(PY_LONG_LONG)) { return PyLong_FromLongLong((PY_LONG_LONG) value); #endif } } { int one = 1; int little = (int)*(unsigned char *)&one; unsigned char *bytes = (unsigned char *)&value; return _PyLong_FromByteArray(bytes, sizeof(SDL_PowerState), little, !is_unsigned); } } /* CIntToPy */ static CYTHON_INLINE PyObject* __Pyx_PyInt_From_int(int value) { const int neg_one = (int) -1, const_zero = (int) 0; const int is_unsigned = neg_one > const_zero; if (is_unsigned) { if (sizeof(int) < sizeof(long)) { return PyInt_FromLong((long) value); } else if (sizeof(int) <= sizeof(unsigned long)) { return PyLong_FromUnsignedLong((unsigned long) value); #ifdef HAVE_LONG_LONG } else if (sizeof(int) <= sizeof(unsigned PY_LONG_LONG)) { return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value); #endif } } else { if (sizeof(int) <= sizeof(long)) { return PyInt_FromLong((long) value); #ifdef HAVE_LONG_LONG } else if (sizeof(int) <= sizeof(PY_LONG_LONG)) { return PyLong_FromLongLong((PY_LONG_LONG) value); #endif } } { int one = 1; int little = (int)*(unsigned char *)&one; unsigned char *bytes = (unsigned char *)&value; return _PyLong_FromByteArray(bytes, sizeof(int), little, !is_unsigned); } } /* CIntToPy */ static CYTHON_INLINE PyObject* __Pyx_PyInt_From_long(long value) { const long neg_one = (long) -1, const_zero = (long) 0; const int is_unsigned = neg_one > const_zero; if (is_unsigned) { if (sizeof(long) < sizeof(long)) { return PyInt_FromLong((long) value); } else if (sizeof(long) <= sizeof(unsigned long)) { return PyLong_FromUnsignedLong((unsigned long) value); #ifdef HAVE_LONG_LONG } else if (sizeof(long) <= sizeof(unsigned PY_LONG_LONG)) { return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value); #endif } } else { if (sizeof(long) <= sizeof(long)) { return PyInt_FromLong((long) value); #ifdef HAVE_LONG_LONG } else if (sizeof(long) <= sizeof(PY_LONG_LONG)) { return PyLong_FromLongLong((PY_LONG_LONG) value); #endif } } { int one = 1; int little = (int)*(unsigned char *)&one; unsigned char *bytes = (unsigned char *)&value; return _PyLong_FromByteArray(bytes, sizeof(long), little, !is_unsigned); } } /* CIntFromPyVerify */ #define __PYX_VERIFY_RETURN_INT(target_type, func_type, func_value)\ __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, 0) #define __PYX_VERIFY_RETURN_INT_EXC(target_type, func_type, func_value)\ __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, 1) #define __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, exc)\ {\ func_type value = func_value;\ if (sizeof(target_type) < sizeof(func_type)) {\ if (unlikely(value != (func_type) (target_type) value)) {\ func_type zero = 0;\ if (exc && unlikely(value == (func_type)-1 && PyErr_Occurred()))\ return (target_type) -1;\ if (is_unsigned && unlikely(value < zero))\ goto raise_neg_overflow;\ else\ goto raise_overflow;\ }\ }\ return (target_type) value;\ } /* CIntFromPy */ static CYTHON_INLINE long __Pyx_PyInt_As_long(PyObject *x) { const long neg_one = (long) -1, const_zero = (long) 0; const int is_unsigned = neg_one > const_zero; #if PY_MAJOR_VERSION < 3 if (likely(PyInt_Check(x))) { if (sizeof(long) < sizeof(long)) { __PYX_VERIFY_RETURN_INT(long, long, PyInt_AS_LONG(x)) } else { long val = PyInt_AS_LONG(x); if (is_unsigned && unlikely(val < 0)) { goto raise_neg_overflow; } return (long) val; } } else #endif if (likely(PyLong_Check(x))) { if (is_unsigned) { #if CYTHON_USE_PYLONG_INTERNALS const digit* digits = ((PyLongObject*)x)->ob_digit; switch (Py_SIZE(x)) { case 0: return (long) 0; case 1: __PYX_VERIFY_RETURN_INT(long, digit, digits[0]) case 2: if (8 * sizeof(long) > 1 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(long) >= 2 * PyLong_SHIFT) { return (long) (((((long)digits[1]) << PyLong_SHIFT) | (long)digits[0])); } } break; case 3: if (8 * sizeof(long) > 2 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(long) >= 3 * PyLong_SHIFT) { return (long) (((((((long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0])); } } break; case 4: if (8 * sizeof(long) > 3 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(long) >= 4 * PyLong_SHIFT) { return (long) (((((((((long)digits[3]) << PyLong_SHIFT) | (long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0])); } } break; } #endif #if CYTHON_COMPILING_IN_CPYTHON if (unlikely(Py_SIZE(x) < 0)) { goto raise_neg_overflow; } #else { int result = PyObject_RichCompareBool(x, Py_False, Py_LT); if (unlikely(result < 0)) return (long) -1; if (unlikely(result == 1)) goto raise_neg_overflow; } #endif if (sizeof(long) <= sizeof(unsigned long)) { __PYX_VERIFY_RETURN_INT_EXC(long, unsigned long, PyLong_AsUnsignedLong(x)) #ifdef HAVE_LONG_LONG } else if (sizeof(long) <= sizeof(unsigned PY_LONG_LONG)) { __PYX_VERIFY_RETURN_INT_EXC(long, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x)) #endif } } else { #if CYTHON_USE_PYLONG_INTERNALS const digit* digits = ((PyLongObject*)x)->ob_digit; switch (Py_SIZE(x)) { case 0: return (long) 0; case -1: __PYX_VERIFY_RETURN_INT(long, sdigit, (sdigit) (-(sdigit)digits[0])) case 1: __PYX_VERIFY_RETURN_INT(long, digit, +digits[0]) case -2: if (8 * sizeof(long) - 1 > 1 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(long, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) { return (long) (((long)-1)*(((((long)digits[1]) << PyLong_SHIFT) | (long)digits[0]))); } } break; case 2: if (8 * sizeof(long) > 1 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) { return (long) ((((((long)digits[1]) << PyLong_SHIFT) | (long)digits[0]))); } } break; case -3: if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(long, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) { return (long) (((long)-1)*(((((((long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0]))); } } break; case 3: if (8 * sizeof(long) > 2 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) { return (long) ((((((((long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0]))); } } break; case -4: if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(long, long, -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(long) - 1 > 4 * PyLong_SHIFT) { return (long) (((long)-1)*(((((((((long)digits[3]) << PyLong_SHIFT) | (long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0]))); } } break; case 4: if (8 * sizeof(long) > 3 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(long) - 1 > 4 * PyLong_SHIFT) { return (long) ((((((((((long)digits[3]) << PyLong_SHIFT) | (long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0]))); } } break; } #endif if (sizeof(long) <= sizeof(long)) { __PYX_VERIFY_RETURN_INT_EXC(long, long, PyLong_AsLong(x)) #ifdef HAVE_LONG_LONG } else if (sizeof(long) <= sizeof(PY_LONG_LONG)) { __PYX_VERIFY_RETURN_INT_EXC(long, PY_LONG_LONG, PyLong_AsLongLong(x)) #endif } } { #if CYTHON_COMPILING_IN_PYPY && !defined(_PyLong_AsByteArray) PyErr_SetString(PyExc_RuntimeError, "_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers"); #else long val; PyObject *v = __Pyx_PyNumber_IntOrLong(x); #if PY_MAJOR_VERSION < 3 if (likely(v) && !PyLong_Check(v)) { PyObject *tmp = v; v = PyNumber_Long(tmp); Py_DECREF(tmp); } #endif if (likely(v)) { int one = 1; int is_little = (int)*(unsigned char *)&one; unsigned char *bytes = (unsigned char *)&val; int ret = _PyLong_AsByteArray((PyLongObject *)v, bytes, sizeof(val), is_little, !is_unsigned); Py_DECREF(v); if (likely(!ret)) return val; } #endif return (long) -1; } } else { long val; PyObject *tmp = __Pyx_PyNumber_IntOrLong(x); if (!tmp) return (long) -1; val = __Pyx_PyInt_As_long(tmp); Py_DECREF(tmp); return val; } raise_overflow: PyErr_SetString(PyExc_OverflowError, "value too large to convert to long"); return (long) -1; raise_neg_overflow: PyErr_SetString(PyExc_OverflowError, "can't convert negative value to long"); return (long) -1; } /* CIntFromPy */ static CYTHON_INLINE int __Pyx_PyInt_As_int(PyObject *x) { const int neg_one = (int) -1, const_zero = (int) 0; const int is_unsigned = neg_one > const_zero; #if PY_MAJOR_VERSION < 3 if (likely(PyInt_Check(x))) { if (sizeof(int) < sizeof(long)) { __PYX_VERIFY_RETURN_INT(int, long, PyInt_AS_LONG(x)) } else { long val = PyInt_AS_LONG(x); if (is_unsigned && unlikely(val < 0)) { goto raise_neg_overflow; } return (int) val; } } else #endif if (likely(PyLong_Check(x))) { if (is_unsigned) { #if CYTHON_USE_PYLONG_INTERNALS const digit* digits = ((PyLongObject*)x)->ob_digit; switch (Py_SIZE(x)) { case 0: return (int) 0; case 1: __PYX_VERIFY_RETURN_INT(int, digit, digits[0]) case 2: if (8 * sizeof(int) > 1 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(int) >= 2 * PyLong_SHIFT) { return (int) (((((int)digits[1]) << PyLong_SHIFT) | (int)digits[0])); } } break; case 3: if (8 * sizeof(int) > 2 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(int) >= 3 * PyLong_SHIFT) { return (int) (((((((int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0])); } } break; case 4: if (8 * sizeof(int) > 3 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(int) >= 4 * PyLong_SHIFT) { return (int) (((((((((int)digits[3]) << PyLong_SHIFT) | (int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0])); } } break; } #endif #if CYTHON_COMPILING_IN_CPYTHON if (unlikely(Py_SIZE(x) < 0)) { goto raise_neg_overflow; } #else { int result = PyObject_RichCompareBool(x, Py_False, Py_LT); if (unlikely(result < 0)) return (int) -1; if (unlikely(result == 1)) goto raise_neg_overflow; } #endif if (sizeof(int) <= sizeof(unsigned long)) { __PYX_VERIFY_RETURN_INT_EXC(int, unsigned long, PyLong_AsUnsignedLong(x)) #ifdef HAVE_LONG_LONG } else if (sizeof(int) <= sizeof(unsigned PY_LONG_LONG)) { __PYX_VERIFY_RETURN_INT_EXC(int, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x)) #endif } } else { #if CYTHON_USE_PYLONG_INTERNALS const digit* digits = ((PyLongObject*)x)->ob_digit; switch (Py_SIZE(x)) { case 0: return (int) 0; case -1: __PYX_VERIFY_RETURN_INT(int, sdigit, (sdigit) (-(sdigit)digits[0])) case 1: __PYX_VERIFY_RETURN_INT(int, digit, +digits[0]) case -2: if (8 * sizeof(int) - 1 > 1 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(int, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(int) - 1 > 2 * PyLong_SHIFT) { return (int) (((int)-1)*(((((int)digits[1]) << PyLong_SHIFT) | (int)digits[0]))); } } break; case 2: if (8 * sizeof(int) > 1 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(int) - 1 > 2 * PyLong_SHIFT) { return (int) ((((((int)digits[1]) << PyLong_SHIFT) | (int)digits[0]))); } } break; case -3: if (8 * sizeof(int) - 1 > 2 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(int, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(int) - 1 > 3 * PyLong_SHIFT) { return (int) (((int)-1)*(((((((int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0]))); } } break; case 3: if (8 * sizeof(int) > 2 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(int) - 1 > 3 * PyLong_SHIFT) { return (int) ((((((((int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0]))); } } break; case -4: if (8 * sizeof(int) - 1 > 3 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(int, long, -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(int) - 1 > 4 * PyLong_SHIFT) { return (int) (((int)-1)*(((((((((int)digits[3]) << PyLong_SHIFT) | (int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0]))); } } break; case 4: if (8 * sizeof(int) > 3 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(int) - 1 > 4 * PyLong_SHIFT) { return (int) ((((((((((int)digits[3]) << PyLong_SHIFT) | (int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0]))); } } break; } #endif if (sizeof(int) <= sizeof(long)) { __PYX_VERIFY_RETURN_INT_EXC(int, long, PyLong_AsLong(x)) #ifdef HAVE_LONG_LONG } else if (sizeof(int) <= sizeof(PY_LONG_LONG)) { __PYX_VERIFY_RETURN_INT_EXC(int, PY_LONG_LONG, PyLong_AsLongLong(x)) #endif } } { #if CYTHON_COMPILING_IN_PYPY && !defined(_PyLong_AsByteArray) PyErr_SetString(PyExc_RuntimeError, "_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers"); #else int val; PyObject *v = __Pyx_PyNumber_IntOrLong(x); #if PY_MAJOR_VERSION < 3 if (likely(v) && !PyLong_Check(v)) { PyObject *tmp = v; v = PyNumber_Long(tmp); Py_DECREF(tmp); } #endif if (likely(v)) { int one = 1; int is_little = (int)*(unsigned char *)&one; unsigned char *bytes = (unsigned char *)&val; int ret = _PyLong_AsByteArray((PyLongObject *)v, bytes, sizeof(val), is_little, !is_unsigned); Py_DECREF(v); if (likely(!ret)) return val; } #endif return (int) -1; } } else { int val; PyObject *tmp = __Pyx_PyNumber_IntOrLong(x); if (!tmp) return (int) -1; val = __Pyx_PyInt_As_int(tmp); Py_DECREF(tmp); return val; } raise_overflow: PyErr_SetString(PyExc_OverflowError, "value too large to convert to int"); return (int) -1; raise_neg_overflow: PyErr_SetString(PyExc_OverflowError, "can't convert negative value to int"); return (int) -1; } /* FastTypeChecks */ #if CYTHON_COMPILING_IN_CPYTHON static int __Pyx_InBases(PyTypeObject *a, PyTypeObject *b) { while (a) { a = a->tp_base; if (a == b) return 1; } return b == &PyBaseObject_Type; } static CYTHON_INLINE int __Pyx_IsSubtype(PyTypeObject *a, PyTypeObject *b) { PyObject *mro; if (a == b) return 1; mro = a->tp_mro; if (likely(mro)) { Py_ssize_t i, n; n = PyTuple_GET_SIZE(mro); for (i = 0; i < n; i++) { if (PyTuple_GET_ITEM(mro, i) == (PyObject *)b) return 1; } return 0; } return __Pyx_InBases(a, b); } #if PY_MAJOR_VERSION == 2 static int __Pyx_inner_PyErr_GivenExceptionMatches2(PyObject *err, PyObject* exc_type1, PyObject* exc_type2) { PyObject *exception, *value, *tb; int res; __Pyx_PyThreadState_declare __Pyx_PyThreadState_assign __Pyx_ErrFetch(&exception, &value, &tb); res = exc_type1 ? PyObject_IsSubclass(err, exc_type1) : 0; if (unlikely(res == -1)) { PyErr_WriteUnraisable(err); res = 0; } if (!res) { res = PyObject_IsSubclass(err, exc_type2); if (unlikely(res == -1)) { PyErr_WriteUnraisable(err); res = 0; } } __Pyx_ErrRestore(exception, value, tb); return res; } #else static CYTHON_INLINE int __Pyx_inner_PyErr_GivenExceptionMatches2(PyObject *err, PyObject* exc_type1, PyObject *exc_type2) { int res = exc_type1 ? __Pyx_IsSubtype((PyTypeObject*)err, (PyTypeObject*)exc_type1) : 0; if (!res) { res = __Pyx_IsSubtype((PyTypeObject*)err, (PyTypeObject*)exc_type2); } return res; } #endif static CYTHON_INLINE int __Pyx_PyErr_GivenExceptionMatches(PyObject *err, PyObject* exc_type) { if (likely(err == exc_type)) return 1; if (likely(PyExceptionClass_Check(err))) { return __Pyx_inner_PyErr_GivenExceptionMatches2(err, NULL, exc_type); } return PyErr_GivenExceptionMatches(err, exc_type); } static CYTHON_INLINE int __Pyx_PyErr_GivenExceptionMatches2(PyObject *err, PyObject *exc_type1, PyObject *exc_type2) { if (likely(err == exc_type1 || err == exc_type2)) return 1; if (likely(PyExceptionClass_Check(err))) { return __Pyx_inner_PyErr_GivenExceptionMatches2(err, exc_type1, exc_type2); } return (PyErr_GivenExceptionMatches(err, exc_type1) || PyErr_GivenExceptionMatches(err, exc_type2)); } #endif /* CheckBinaryVersion */ static int __Pyx_check_binary_version(void) { char ctversion[4], rtversion[4]; PyOS_snprintf(ctversion, 4, "%d.%d", PY_MAJOR_VERSION, PY_MINOR_VERSION); PyOS_snprintf(rtversion, 4, "%s", Py_GetVersion()); if (ctversion[0] != rtversion[0] || ctversion[2] != rtversion[2]) { char message[200]; PyOS_snprintf(message, sizeof(message), "compiletime version %s of module '%.100s' " "does not match runtime version %s", ctversion, __Pyx_MODULE_NAME, rtversion); return PyErr_WarnEx(NULL, message, 1); } return 0; } /* InitStrings */ static int __Pyx_InitStrings(__Pyx_StringTabEntry *t) { while (t->p) { #if PY_MAJOR_VERSION < 3 if (t->is_unicode) { *t->p = PyUnicode_DecodeUTF8(t->s, t->n - 1, NULL); } else if (t->intern) { *t->p = PyString_InternFromString(t->s); } else { *t->p = PyString_FromStringAndSize(t->s, t->n - 1); } #else if (t->is_unicode | t->is_str) { if (t->intern) { *t->p = PyUnicode_InternFromString(t->s); } else if (t->encoding) { *t->p = PyUnicode_Decode(t->s, t->n - 1, t->encoding, NULL); } else { *t->p = PyUnicode_FromStringAndSize(t->s, t->n - 1); } } else { *t->p = PyBytes_FromStringAndSize(t->s, t->n - 1); } #endif if (!*t->p) return -1; if (PyObject_Hash(*t->p) == -1) PyErr_Clear(); ++t; } return 0; } static CYTHON_INLINE PyObject* __Pyx_PyUnicode_FromString(const char* c_str) { return __Pyx_PyUnicode_FromStringAndSize(c_str, (Py_ssize_t)strlen(c_str)); } static CYTHON_INLINE const char* __Pyx_PyObject_AsString(PyObject* o) { Py_ssize_t ignore; return __Pyx_PyObject_AsStringAndSize(o, &ignore); } #if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT #if !CYTHON_PEP393_ENABLED static const char* __Pyx_PyUnicode_AsStringAndSize(PyObject* o, Py_ssize_t *length) { char* defenc_c; PyObject* defenc = _PyUnicode_AsDefaultEncodedString(o, NULL); if (!defenc) return NULL; defenc_c = PyBytes_AS_STRING(defenc); #if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII { char* end = defenc_c + PyBytes_GET_SIZE(defenc); char* c; for (c = defenc_c; c < end; c++) { if ((unsigned char) (*c) >= 128) { PyUnicode_AsASCIIString(o); return NULL; } } } #endif *length = PyBytes_GET_SIZE(defenc); return defenc_c; } #else static CYTHON_INLINE const char* __Pyx_PyUnicode_AsStringAndSize(PyObject* o, Py_ssize_t *length) { if (unlikely(__Pyx_PyUnicode_READY(o) == -1)) return NULL; #if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII if (likely(PyUnicode_IS_ASCII(o))) { *length = PyUnicode_GET_LENGTH(o); return PyUnicode_AsUTF8(o); } else { PyUnicode_AsASCIIString(o); return NULL; } #else return PyUnicode_AsUTF8AndSize(o, length); #endif } #endif #endif static CYTHON_INLINE const char* __Pyx_PyObject_AsStringAndSize(PyObject* o, Py_ssize_t *length) { #if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT if ( #if PY_MAJOR_VERSION < 3 && __PYX_DEFAULT_STRING_ENCODING_IS_ASCII __Pyx_sys_getdefaultencoding_not_ascii && #endif PyUnicode_Check(o)) { return __Pyx_PyUnicode_AsStringAndSize(o, length); } else #endif #if (!CYTHON_COMPILING_IN_PYPY) || (defined(PyByteArray_AS_STRING) && defined(PyByteArray_GET_SIZE)) if (PyByteArray_Check(o)) { *length = PyByteArray_GET_SIZE(o); return PyByteArray_AS_STRING(o); } else #endif { char* result; int r = PyBytes_AsStringAndSize(o, &result, length); if (unlikely(r < 0)) { return NULL; } else { return result; } } } static CYTHON_INLINE int __Pyx_PyObject_IsTrue(PyObject* x) { int is_true = x == Py_True; if (is_true | (x == Py_False) | (x == Py_None)) return is_true; else return PyObject_IsTrue(x); } static PyObject* __Pyx_PyNumber_IntOrLongWrongResultType(PyObject* result, const char* type_name) { #if PY_MAJOR_VERSION >= 3 if (PyLong_Check(result)) { if (PyErr_WarnFormat(PyExc_DeprecationWarning, 1, "__int__ returned non-int (type %.200s). " "The ability to return an instance of a strict subclass of int " "is deprecated, and may be removed in a future version of Python.", Py_TYPE(result)->tp_name)) { Py_DECREF(result); return NULL; } return result; } #endif PyErr_Format(PyExc_TypeError, "__%.4s__ returned non-%.4s (type %.200s)", type_name, type_name, Py_TYPE(result)->tp_name); Py_DECREF(result); return NULL; } static CYTHON_INLINE PyObject* __Pyx_PyNumber_IntOrLong(PyObject* x) { #if CYTHON_USE_TYPE_SLOTS PyNumberMethods *m; #endif const char *name = NULL; PyObject *res = NULL; #if PY_MAJOR_VERSION < 3 if (likely(PyInt_Check(x) || PyLong_Check(x))) #else if (likely(PyLong_Check(x))) #endif return __Pyx_NewRef(x); #if CYTHON_USE_TYPE_SLOTS m = Py_TYPE(x)->tp_as_number; #if PY_MAJOR_VERSION < 3 if (m && m->nb_int) { name = "int"; res = m->nb_int(x); } else if (m && m->nb_long) { name = "long"; res = m->nb_long(x); } #else if (likely(m && m->nb_int)) { name = "int"; res = m->nb_int(x); } #endif #else if (!PyBytes_CheckExact(x) && !PyUnicode_CheckExact(x)) { res = PyNumber_Int(x); } #endif if (likely(res)) { #if PY_MAJOR_VERSION < 3 if (unlikely(!PyInt_Check(res) && !PyLong_Check(res))) { #else if (unlikely(!PyLong_CheckExact(res))) { #endif return __Pyx_PyNumber_IntOrLongWrongResultType(res, name); } } else if (!PyErr_Occurred()) { PyErr_SetString(PyExc_TypeError, "an integer is required"); } return res; } static CYTHON_INLINE Py_ssize_t __Pyx_PyIndex_AsSsize_t(PyObject* b) { Py_ssize_t ival; PyObject *x; #if PY_MAJOR_VERSION < 3 if (likely(PyInt_CheckExact(b))) { if (sizeof(Py_ssize_t) >= sizeof(long)) return PyInt_AS_LONG(b); else return PyInt_AsSsize_t(x); } #endif if (likely(PyLong_CheckExact(b))) { #if CYTHON_USE_PYLONG_INTERNALS const digit* digits = ((PyLongObject*)b)->ob_digit; const Py_ssize_t size = Py_SIZE(b); if (likely(__Pyx_sst_abs(size) <= 1)) { ival = likely(size) ? digits[0] : 0; if (size == -1) ival = -ival; return ival; } else { switch (size) { case 2: if (8 * sizeof(Py_ssize_t) > 2 * PyLong_SHIFT) { return (Py_ssize_t) (((((size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])); } break; case -2: if (8 * sizeof(Py_ssize_t) > 2 * PyLong_SHIFT) { return -(Py_ssize_t) (((((size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])); } break; case 3: if (8 * sizeof(Py_ssize_t) > 3 * PyLong_SHIFT) { return (Py_ssize_t) (((((((size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])); } break; case -3: if (8 * sizeof(Py_ssize_t) > 3 * PyLong_SHIFT) { return -(Py_ssize_t) (((((((size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])); } break; case 4: if (8 * sizeof(Py_ssize_t) > 4 * PyLong_SHIFT) { return (Py_ssize_t) (((((((((size_t)digits[3]) << PyLong_SHIFT) | (size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])); } break; case -4: if (8 * sizeof(Py_ssize_t) > 4 * PyLong_SHIFT) { return -(Py_ssize_t) (((((((((size_t)digits[3]) << PyLong_SHIFT) | (size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])); } break; } } #endif return PyLong_AsSsize_t(b); } x = PyNumber_Index(b); if (!x) return -1; ival = PyInt_AsSsize_t(x); Py_DECREF(x); return ival; } static CYTHON_INLINE PyObject * __Pyx_PyInt_FromSize_t(size_t ival) { return PyInt_FromSize_t(ival); } #endif /* Py_PYTHON_H */ pygame_sdl2-2.1.0-for-renpy-6.99.14.1/gen3/pygame_sdl2.font.c0000664000175000017500000070173412665223545022447 0ustar tomtom00000000000000/* Generated by Cython 0.23.3 */ #define PY_SSIZE_T_CLEAN #include "Python.h" #ifndef Py_PYTHON_H #error Python headers needed to compile C extensions, please install development version of Python. #elif PY_VERSION_HEX < 0x02060000 || (0x03000000 <= PY_VERSION_HEX && PY_VERSION_HEX < 0x03020000) #error Cython requires Python 2.6+ or Python 3.2+. #else #define CYTHON_ABI "0_23_3" #include #ifndef offsetof #define offsetof(type, member) ( (size_t) & ((type*)0) -> member ) #endif #if !defined(WIN32) && !defined(MS_WINDOWS) #ifndef __stdcall #define __stdcall #endif #ifndef __cdecl #define __cdecl #endif #ifndef __fastcall #define __fastcall #endif #endif #ifndef DL_IMPORT #define DL_IMPORT(t) t #endif #ifndef DL_EXPORT #define DL_EXPORT(t) t #endif #ifndef PY_LONG_LONG #define PY_LONG_LONG LONG_LONG #endif #ifndef Py_HUGE_VAL #define Py_HUGE_VAL HUGE_VAL #endif #ifdef PYPY_VERSION #define CYTHON_COMPILING_IN_PYPY 1 #define CYTHON_COMPILING_IN_CPYTHON 0 #else #define CYTHON_COMPILING_IN_PYPY 0 #define CYTHON_COMPILING_IN_CPYTHON 1 #endif #if !defined(CYTHON_USE_PYLONG_INTERNALS) && CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x02070000 #define CYTHON_USE_PYLONG_INTERNALS 1 #endif #if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX < 0x02070600 && !defined(Py_OptimizeFlag) #define Py_OptimizeFlag 0 #endif #define __PYX_BUILD_PY_SSIZE_T "n" #define CYTHON_FORMAT_SSIZE_T "z" #if PY_MAJOR_VERSION < 3 #define __Pyx_BUILTIN_MODULE_NAME "__builtin__" #define __Pyx_PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)\ PyCode_New(a+k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos) #define __Pyx_DefaultClassType PyClass_Type #else #define __Pyx_BUILTIN_MODULE_NAME "builtins" #define __Pyx_PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)\ PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos) #define __Pyx_DefaultClassType PyType_Type #endif #ifndef Py_TPFLAGS_CHECKTYPES #define Py_TPFLAGS_CHECKTYPES 0 #endif #ifndef Py_TPFLAGS_HAVE_INDEX #define Py_TPFLAGS_HAVE_INDEX 0 #endif #ifndef Py_TPFLAGS_HAVE_NEWBUFFER #define Py_TPFLAGS_HAVE_NEWBUFFER 0 #endif #ifndef Py_TPFLAGS_HAVE_FINALIZE #define Py_TPFLAGS_HAVE_FINALIZE 0 #endif #if PY_VERSION_HEX > 0x03030000 && defined(PyUnicode_KIND) #define CYTHON_PEP393_ENABLED 1 #define __Pyx_PyUnicode_READY(op) (likely(PyUnicode_IS_READY(op)) ?\ 0 : _PyUnicode_Ready((PyObject *)(op))) #define __Pyx_PyUnicode_GET_LENGTH(u) PyUnicode_GET_LENGTH(u) #define __Pyx_PyUnicode_READ_CHAR(u, i) PyUnicode_READ_CHAR(u, i) #define __Pyx_PyUnicode_KIND(u) PyUnicode_KIND(u) #define __Pyx_PyUnicode_DATA(u) PyUnicode_DATA(u) #define __Pyx_PyUnicode_READ(k, d, i) PyUnicode_READ(k, d, i) #else #define CYTHON_PEP393_ENABLED 0 #define __Pyx_PyUnicode_READY(op) (0) #define __Pyx_PyUnicode_GET_LENGTH(u) PyUnicode_GET_SIZE(u) #define __Pyx_PyUnicode_READ_CHAR(u, i) ((Py_UCS4)(PyUnicode_AS_UNICODE(u)[i])) #define __Pyx_PyUnicode_KIND(u) (sizeof(Py_UNICODE)) #define __Pyx_PyUnicode_DATA(u) ((void*)PyUnicode_AS_UNICODE(u)) #define __Pyx_PyUnicode_READ(k, d, i) ((void)(k), (Py_UCS4)(((Py_UNICODE*)d)[i])) #endif #if CYTHON_COMPILING_IN_PYPY #define __Pyx_PyUnicode_Concat(a, b) PyNumber_Add(a, b) #define __Pyx_PyUnicode_ConcatSafe(a, b) PyNumber_Add(a, b) #else #define __Pyx_PyUnicode_Concat(a, b) PyUnicode_Concat(a, b) #define __Pyx_PyUnicode_ConcatSafe(a, b) ((unlikely((a) == Py_None) || unlikely((b) == Py_None)) ?\ PyNumber_Add(a, b) : __Pyx_PyUnicode_Concat(a, b)) #endif #if CYTHON_COMPILING_IN_PYPY && !defined(PyUnicode_Contains) #define PyUnicode_Contains(u, s) PySequence_Contains(u, s) #endif #define __Pyx_PyString_FormatSafe(a, b) ((unlikely((a) == Py_None)) ? PyNumber_Remainder(a, b) : __Pyx_PyString_Format(a, b)) #define __Pyx_PyUnicode_FormatSafe(a, b) ((unlikely((a) == Py_None)) ? PyNumber_Remainder(a, b) : PyUnicode_Format(a, b)) #if PY_MAJOR_VERSION >= 3 #define __Pyx_PyString_Format(a, b) PyUnicode_Format(a, b) #else #define __Pyx_PyString_Format(a, b) PyString_Format(a, b) #endif #if PY_MAJOR_VERSION >= 3 #define PyBaseString_Type PyUnicode_Type #define PyStringObject PyUnicodeObject #define PyString_Type PyUnicode_Type #define PyString_Check PyUnicode_Check #define PyString_CheckExact PyUnicode_CheckExact #endif #if PY_MAJOR_VERSION >= 3 #define __Pyx_PyBaseString_Check(obj) PyUnicode_Check(obj) #define __Pyx_PyBaseString_CheckExact(obj) PyUnicode_CheckExact(obj) #else #define __Pyx_PyBaseString_Check(obj) (PyString_Check(obj) || PyUnicode_Check(obj)) #define __Pyx_PyBaseString_CheckExact(obj) (PyString_CheckExact(obj) || PyUnicode_CheckExact(obj)) #endif #ifndef PySet_CheckExact #define PySet_CheckExact(obj) (Py_TYPE(obj) == &PySet_Type) #endif #define __Pyx_TypeCheck(obj, type) PyObject_TypeCheck(obj, (PyTypeObject *)type) #if PY_MAJOR_VERSION >= 3 #define PyIntObject PyLongObject #define PyInt_Type PyLong_Type #define PyInt_Check(op) PyLong_Check(op) #define PyInt_CheckExact(op) PyLong_CheckExact(op) #define PyInt_FromString PyLong_FromString #define PyInt_FromUnicode PyLong_FromUnicode #define PyInt_FromLong PyLong_FromLong #define PyInt_FromSize_t PyLong_FromSize_t #define PyInt_FromSsize_t PyLong_FromSsize_t #define PyInt_AsLong PyLong_AsLong #define PyInt_AS_LONG PyLong_AS_LONG #define PyInt_AsSsize_t PyLong_AsSsize_t #define PyInt_AsUnsignedLongMask PyLong_AsUnsignedLongMask #define PyInt_AsUnsignedLongLongMask PyLong_AsUnsignedLongLongMask #define PyNumber_Int PyNumber_Long #endif #if PY_MAJOR_VERSION >= 3 #define PyBoolObject PyLongObject #endif #if PY_MAJOR_VERSION >= 3 && CYTHON_COMPILING_IN_PYPY #ifndef PyUnicode_InternFromString #define PyUnicode_InternFromString(s) PyUnicode_FromString(s) #endif #endif #if PY_VERSION_HEX < 0x030200A4 typedef long Py_hash_t; #define __Pyx_PyInt_FromHash_t PyInt_FromLong #define __Pyx_PyInt_AsHash_t PyInt_AsLong #else #define __Pyx_PyInt_FromHash_t PyInt_FromSsize_t #define __Pyx_PyInt_AsHash_t PyInt_AsSsize_t #endif #if PY_MAJOR_VERSION >= 3 #define __Pyx_PyMethod_New(func, self, klass) ((self) ? PyMethod_New(func, self) : PyInstanceMethod_New(func)) #else #define __Pyx_PyMethod_New(func, self, klass) PyMethod_New(func, self, klass) #endif #if PY_VERSION_HEX >= 0x030500B1 #define __Pyx_PyAsyncMethodsStruct PyAsyncMethods #define __Pyx_PyType_AsAsync(obj) (Py_TYPE(obj)->tp_as_async) #elif CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3 typedef struct { unaryfunc am_await; unaryfunc am_aiter; unaryfunc am_anext; } __Pyx_PyAsyncMethodsStruct; #define __Pyx_PyType_AsAsync(obj) ((__Pyx_PyAsyncMethodsStruct*) (Py_TYPE(obj)->tp_reserved)) #else #define __Pyx_PyType_AsAsync(obj) NULL #endif #ifndef CYTHON_RESTRICT #if defined(__GNUC__) #define CYTHON_RESTRICT __restrict__ #elif defined(_MSC_VER) && _MSC_VER >= 1400 #define CYTHON_RESTRICT __restrict #elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L #define CYTHON_RESTRICT restrict #else #define CYTHON_RESTRICT #endif #endif #define __Pyx_void_to_None(void_result) (void_result, Py_INCREF(Py_None), Py_None) #ifndef CYTHON_INLINE #if defined(__GNUC__) #define CYTHON_INLINE __inline__ #elif defined(_MSC_VER) #define CYTHON_INLINE __inline #elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L #define CYTHON_INLINE inline #else #define CYTHON_INLINE #endif #endif #if defined(WIN32) || defined(MS_WINDOWS) #define _USE_MATH_DEFINES #endif #include #ifdef NAN #define __PYX_NAN() ((float) NAN) #else static CYTHON_INLINE float __PYX_NAN() { float value; memset(&value, 0xFF, sizeof(value)); return value; } #endif #if PY_MAJOR_VERSION >= 3 #define __Pyx_PyNumber_Divide(x,y) PyNumber_TrueDivide(x,y) #define __Pyx_PyNumber_InPlaceDivide(x,y) PyNumber_InPlaceTrueDivide(x,y) #else #define __Pyx_PyNumber_Divide(x,y) PyNumber_TrueDivide(x,y) #define __Pyx_PyNumber_InPlaceDivide(x,y) PyNumber_InPlaceTrueDivide(x,y) #endif #ifndef __PYX_EXTERN_C #ifdef __cplusplus #define __PYX_EXTERN_C extern "C" #else #define __PYX_EXTERN_C extern #endif #endif #define __PYX_HAVE__pygame_sdl2__font #define __PYX_HAVE_API__pygame_sdl2__font #include "stdint.h" #include "string.h" #include "stdio.h" #include "stddef.h" #include "SDL.h" #include "SDL_ttf.h" #ifdef _OPENMP #include #endif /* _OPENMP */ #ifdef PYREX_WITHOUT_ASSERTIONS #define CYTHON_WITHOUT_ASSERTIONS #endif #ifndef CYTHON_UNUSED # if defined(__GNUC__) # if !(defined(__cplusplus)) || (__GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 4)) # define CYTHON_UNUSED __attribute__ ((__unused__)) # else # define CYTHON_UNUSED # endif # elif defined(__ICC) || (defined(__INTEL_COMPILER) && !defined(_MSC_VER)) # define CYTHON_UNUSED __attribute__ ((__unused__)) # else # define CYTHON_UNUSED # endif #endif #ifndef CYTHON_NCP_UNUSED # if CYTHON_COMPILING_IN_CPYTHON # define CYTHON_NCP_UNUSED # else # define CYTHON_NCP_UNUSED CYTHON_UNUSED # endif #endif typedef struct {PyObject **p; char *s; const Py_ssize_t n; const char* encoding; const char is_unicode; const char is_str; const char intern; } __Pyx_StringTabEntry; #define __PYX_DEFAULT_STRING_ENCODING_IS_ASCII 0 #define __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT 0 #define __PYX_DEFAULT_STRING_ENCODING "" #define __Pyx_PyObject_FromString __Pyx_PyBytes_FromString #define __Pyx_PyObject_FromStringAndSize __Pyx_PyBytes_FromStringAndSize #define __Pyx_uchar_cast(c) ((unsigned char)c) #define __Pyx_long_cast(x) ((long)x) #define __Pyx_fits_Py_ssize_t(v, type, is_signed) (\ (sizeof(type) < sizeof(Py_ssize_t)) ||\ (sizeof(type) > sizeof(Py_ssize_t) &&\ likely(v < (type)PY_SSIZE_T_MAX ||\ v == (type)PY_SSIZE_T_MAX) &&\ (!is_signed || likely(v > (type)PY_SSIZE_T_MIN ||\ v == (type)PY_SSIZE_T_MIN))) ||\ (sizeof(type) == sizeof(Py_ssize_t) &&\ (is_signed || likely(v < (type)PY_SSIZE_T_MAX ||\ v == (type)PY_SSIZE_T_MAX))) ) #if defined (__cplusplus) && __cplusplus >= 201103L #include #define __Pyx_sst_abs(value) std::abs(value) #elif SIZEOF_INT >= SIZEOF_SIZE_T #define __Pyx_sst_abs(value) abs(value) #elif SIZEOF_LONG >= SIZEOF_SIZE_T #define __Pyx_sst_abs(value) labs(value) #elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L #define __Pyx_sst_abs(value) llabs(value) #elif defined (_MSC_VER) && defined (_M_X64) #define __Pyx_sst_abs(value) _abs64(value) #elif defined (__GNUC__) #define __Pyx_sst_abs(value) __builtin_llabs(value) #else #define __Pyx_sst_abs(value) ((value<0) ? -value : value) #endif static CYTHON_INLINE char* __Pyx_PyObject_AsString(PyObject*); static CYTHON_INLINE char* __Pyx_PyObject_AsStringAndSize(PyObject*, Py_ssize_t* length); #define __Pyx_PyByteArray_FromString(s) PyByteArray_FromStringAndSize((const char*)s, strlen((const char*)s)) #define __Pyx_PyByteArray_FromStringAndSize(s, l) PyByteArray_FromStringAndSize((const char*)s, l) #define __Pyx_PyBytes_FromString PyBytes_FromString #define __Pyx_PyBytes_FromStringAndSize PyBytes_FromStringAndSize static CYTHON_INLINE PyObject* __Pyx_PyUnicode_FromString(const char*); #if PY_MAJOR_VERSION < 3 #define __Pyx_PyStr_FromString __Pyx_PyBytes_FromString #define __Pyx_PyStr_FromStringAndSize __Pyx_PyBytes_FromStringAndSize #else #define __Pyx_PyStr_FromString __Pyx_PyUnicode_FromString #define __Pyx_PyStr_FromStringAndSize __Pyx_PyUnicode_FromStringAndSize #endif #define __Pyx_PyObject_AsSString(s) ((signed char*) __Pyx_PyObject_AsString(s)) #define __Pyx_PyObject_AsUString(s) ((unsigned char*) __Pyx_PyObject_AsString(s)) #define __Pyx_PyObject_FromCString(s) __Pyx_PyObject_FromString((const char*)s) #define __Pyx_PyBytes_FromCString(s) __Pyx_PyBytes_FromString((const char*)s) #define __Pyx_PyByteArray_FromCString(s) __Pyx_PyByteArray_FromString((const char*)s) #define __Pyx_PyStr_FromCString(s) __Pyx_PyStr_FromString((const char*)s) #define __Pyx_PyUnicode_FromCString(s) __Pyx_PyUnicode_FromString((const char*)s) #if PY_MAJOR_VERSION < 3 static CYTHON_INLINE size_t __Pyx_Py_UNICODE_strlen(const Py_UNICODE *u) { const Py_UNICODE *u_end = u; while (*u_end++) ; return (size_t)(u_end - u - 1); } #else #define __Pyx_Py_UNICODE_strlen Py_UNICODE_strlen #endif #define __Pyx_PyUnicode_FromUnicode(u) PyUnicode_FromUnicode(u, __Pyx_Py_UNICODE_strlen(u)) #define __Pyx_PyUnicode_FromUnicodeAndLength PyUnicode_FromUnicode #define __Pyx_PyUnicode_AsUnicode PyUnicode_AsUnicode #define __Pyx_NewRef(obj) (Py_INCREF(obj), obj) #define __Pyx_Owned_Py_None(b) __Pyx_NewRef(Py_None) #define __Pyx_PyBool_FromLong(b) ((b) ? __Pyx_NewRef(Py_True) : __Pyx_NewRef(Py_False)) static CYTHON_INLINE int __Pyx_PyObject_IsTrue(PyObject*); static CYTHON_INLINE PyObject* __Pyx_PyNumber_Int(PyObject* x); static CYTHON_INLINE Py_ssize_t __Pyx_PyIndex_AsSsize_t(PyObject*); static CYTHON_INLINE PyObject * __Pyx_PyInt_FromSize_t(size_t); #if CYTHON_COMPILING_IN_CPYTHON #define __pyx_PyFloat_AsDouble(x) (PyFloat_CheckExact(x) ? PyFloat_AS_DOUBLE(x) : PyFloat_AsDouble(x)) #else #define __pyx_PyFloat_AsDouble(x) PyFloat_AsDouble(x) #endif #define __pyx_PyFloat_AsFloat(x) ((float) __pyx_PyFloat_AsDouble(x)) #if PY_MAJOR_VERSION < 3 && __PYX_DEFAULT_STRING_ENCODING_IS_ASCII static int __Pyx_sys_getdefaultencoding_not_ascii; static int __Pyx_init_sys_getdefaultencoding_params(void) { PyObject* sys; PyObject* default_encoding = NULL; PyObject* ascii_chars_u = NULL; PyObject* ascii_chars_b = NULL; const char* default_encoding_c; sys = PyImport_ImportModule("sys"); if (!sys) goto bad; default_encoding = PyObject_CallMethod(sys, (char*) "getdefaultencoding", NULL); Py_DECREF(sys); if (!default_encoding) goto bad; default_encoding_c = PyBytes_AsString(default_encoding); if (!default_encoding_c) goto bad; if (strcmp(default_encoding_c, "ascii") == 0) { __Pyx_sys_getdefaultencoding_not_ascii = 0; } else { char ascii_chars[128]; int c; for (c = 0; c < 128; c++) { ascii_chars[c] = c; } __Pyx_sys_getdefaultencoding_not_ascii = 1; ascii_chars_u = PyUnicode_DecodeASCII(ascii_chars, 128, NULL); if (!ascii_chars_u) goto bad; ascii_chars_b = PyUnicode_AsEncodedString(ascii_chars_u, default_encoding_c, NULL); if (!ascii_chars_b || !PyBytes_Check(ascii_chars_b) || memcmp(ascii_chars, PyBytes_AS_STRING(ascii_chars_b), 128) != 0) { PyErr_Format( PyExc_ValueError, "This module compiled with c_string_encoding=ascii, but default encoding '%.200s' is not a superset of ascii.", default_encoding_c); goto bad; } Py_DECREF(ascii_chars_u); Py_DECREF(ascii_chars_b); } Py_DECREF(default_encoding); return 0; bad: Py_XDECREF(default_encoding); Py_XDECREF(ascii_chars_u); Py_XDECREF(ascii_chars_b); return -1; } #endif #if __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT && PY_MAJOR_VERSION >= 3 #define __Pyx_PyUnicode_FromStringAndSize(c_str, size) PyUnicode_DecodeUTF8(c_str, size, NULL) #else #define __Pyx_PyUnicode_FromStringAndSize(c_str, size) PyUnicode_Decode(c_str, size, __PYX_DEFAULT_STRING_ENCODING, NULL) #if __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT static char* __PYX_DEFAULT_STRING_ENCODING; static int __Pyx_init_sys_getdefaultencoding_params(void) { PyObject* sys; PyObject* default_encoding = NULL; char* default_encoding_c; sys = PyImport_ImportModule("sys"); if (!sys) goto bad; default_encoding = PyObject_CallMethod(sys, (char*) (const char*) "getdefaultencoding", NULL); Py_DECREF(sys); if (!default_encoding) goto bad; default_encoding_c = PyBytes_AsString(default_encoding); if (!default_encoding_c) goto bad; __PYX_DEFAULT_STRING_ENCODING = (char*) malloc(strlen(default_encoding_c)); if (!__PYX_DEFAULT_STRING_ENCODING) goto bad; strcpy(__PYX_DEFAULT_STRING_ENCODING, default_encoding_c); Py_DECREF(default_encoding); return 0; bad: Py_XDECREF(default_encoding); return -1; } #endif #endif /* Test for GCC > 2.95 */ #if defined(__GNUC__) && (__GNUC__ > 2 || (__GNUC__ == 2 && (__GNUC_MINOR__ > 95))) #define likely(x) __builtin_expect(!!(x), 1) #define unlikely(x) __builtin_expect(!!(x), 0) #else /* !__GNUC__ or GCC < 2.95 */ #define likely(x) (x) #define unlikely(x) (x) #endif /* __GNUC__ */ static PyObject *__pyx_m; static PyObject *__pyx_d; static PyObject *__pyx_b; static PyObject *__pyx_empty_tuple; static PyObject *__pyx_empty_bytes; static int __pyx_lineno; static int __pyx_clineno = 0; static const char * __pyx_cfilenm= __FILE__; static const char *__pyx_filename; static const char *__pyx_f[] = { "src/pygame_sdl2/font.pyx", "src/pygame_sdl2/surface.pxd", "src/pygame_sdl2/color.pxd", }; /*--- Type declarations ---*/ struct __pyx_obj_11pygame_sdl2_7surface_Surface; struct __pyx_obj_11pygame_sdl2_5color_Color; struct __pyx_obj_11pygame_sdl2_4font_Font; struct __pyx_opt_args_11pygame_sdl2_8rwobject_to_rwops; /* "pygame_sdl2/rwobject.pxd":21 * from sdl2 cimport SDL_RWops * * cdef SDL_RWops *to_rwops(filelike, mode=*) except NULL # <<<<<<<<<<<<<< * */ struct __pyx_opt_args_11pygame_sdl2_8rwobject_to_rwops { int __pyx_n; PyObject *mode; }; /* "pygame_sdl2/surface.pxd":23 * from sdl2 cimport SDL_Surface * * cdef class Surface: # <<<<<<<<<<<<<< * # Allow weak references. * cdef object __weakref__ */ struct __pyx_obj_11pygame_sdl2_7surface_Surface { PyObject_HEAD struct __pyx_vtabstruct_11pygame_sdl2_7surface_Surface *__pyx_vtab; PyObject *__weakref__; SDL_Surface *surface; int owns_surface; int window_surface; PyObject *locklist; struct __pyx_obj_11pygame_sdl2_7surface_Surface *parent; struct __pyx_obj_11pygame_sdl2_7surface_Surface *root; int offset_x; int offset_y; PyObject *get_window_flags; int has_alpha; }; /* "pygame_sdl2/color.pxd":26 * cdef to_sdl_color(color, SDL_Color *out) * * cdef class Color: # <<<<<<<<<<<<<< * # Allow weak references. * cdef object __weakref__ */ struct __pyx_obj_11pygame_sdl2_5color_Color { PyObject_HEAD struct __pyx_vtabstruct_11pygame_sdl2_5color_Color *__pyx_vtab; PyObject *__weakref__; Uint8 r; Uint8 g; Uint8 b; Uint8 a; uint8_t length; }; /* "pygame_sdl2/font.pyx":50 * return match_font("sans") * * cdef class Font: # <<<<<<<<<<<<<< * cdef TTF_Font *font * cdef int style */ struct __pyx_obj_11pygame_sdl2_4font_Font { PyObject_HEAD struct __pyx_vtabstruct_11pygame_sdl2_4font_Font *__pyx_vtab; TTF_Font *font; int style; }; /* "pygame_sdl2/surface.pxd":23 * from sdl2 cimport SDL_Surface * * cdef class Surface: # <<<<<<<<<<<<<< * # Allow weak references. * cdef object __weakref__ */ struct __pyx_vtabstruct_11pygame_sdl2_7surface_Surface { void (*take_surface)(struct __pyx_obj_11pygame_sdl2_7surface_Surface *, SDL_Surface *); }; static struct __pyx_vtabstruct_11pygame_sdl2_7surface_Surface *__pyx_vtabptr_11pygame_sdl2_7surface_Surface; /* "pygame_sdl2/color.pxd":26 * cdef to_sdl_color(color, SDL_Color *out) * * cdef class Color: # <<<<<<<<<<<<<< * # Allow weak references. * cdef object __weakref__ */ struct __pyx_vtabstruct_11pygame_sdl2_5color_Color { PyObject *(*from_rgba)(struct __pyx_obj_11pygame_sdl2_5color_Color *, Uint8, Uint8, Uint8, Uint8); PyObject *(*from_name)(struct __pyx_obj_11pygame_sdl2_5color_Color *, PyObject *); PyObject *(*from_hex)(struct __pyx_obj_11pygame_sdl2_5color_Color *, PyObject *); }; static struct __pyx_vtabstruct_11pygame_sdl2_5color_Color *__pyx_vtabptr_11pygame_sdl2_5color_Color; /* "pygame_sdl2/font.pyx":50 * return match_font("sans") * * cdef class Font: # <<<<<<<<<<<<<< * cdef TTF_Font *font * cdef int style */ struct __pyx_vtabstruct_11pygame_sdl2_4font_Font { PyObject *(*set_style)(struct __pyx_obj_11pygame_sdl2_4font_Font *, PyObject *, PyObject *); }; static struct __pyx_vtabstruct_11pygame_sdl2_4font_Font *__pyx_vtabptr_11pygame_sdl2_4font_Font; /* --- Runtime support code (head) --- */ #ifndef CYTHON_REFNANNY #define CYTHON_REFNANNY 0 #endif #if CYTHON_REFNANNY typedef struct { void (*INCREF)(void*, PyObject*, int); void (*DECREF)(void*, PyObject*, int); void (*GOTREF)(void*, PyObject*, int); void (*GIVEREF)(void*, PyObject*, int); void* (*SetupContext)(const char*, int, const char*); void (*FinishContext)(void**); } __Pyx_RefNannyAPIStruct; static __Pyx_RefNannyAPIStruct *__Pyx_RefNanny = NULL; static __Pyx_RefNannyAPIStruct *__Pyx_RefNannyImportAPI(const char *modname); #define __Pyx_RefNannyDeclarations void *__pyx_refnanny = NULL; #ifdef WITH_THREAD #define __Pyx_RefNannySetupContext(name, acquire_gil)\ if (acquire_gil) {\ PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure();\ __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), __LINE__, __FILE__);\ PyGILState_Release(__pyx_gilstate_save);\ } else {\ __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), __LINE__, __FILE__);\ } #else #define __Pyx_RefNannySetupContext(name, acquire_gil)\ __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), __LINE__, __FILE__) #endif #define __Pyx_RefNannyFinishContext()\ __Pyx_RefNanny->FinishContext(&__pyx_refnanny) #define __Pyx_INCREF(r) __Pyx_RefNanny->INCREF(__pyx_refnanny, (PyObject *)(r), __LINE__) #define __Pyx_DECREF(r) __Pyx_RefNanny->DECREF(__pyx_refnanny, (PyObject *)(r), __LINE__) #define __Pyx_GOTREF(r) __Pyx_RefNanny->GOTREF(__pyx_refnanny, (PyObject *)(r), __LINE__) #define __Pyx_GIVEREF(r) __Pyx_RefNanny->GIVEREF(__pyx_refnanny, (PyObject *)(r), __LINE__) #define __Pyx_XINCREF(r) do { if((r) != NULL) {__Pyx_INCREF(r); }} while(0) #define __Pyx_XDECREF(r) do { if((r) != NULL) {__Pyx_DECREF(r); }} while(0) #define __Pyx_XGOTREF(r) do { if((r) != NULL) {__Pyx_GOTREF(r); }} while(0) #define __Pyx_XGIVEREF(r) do { if((r) != NULL) {__Pyx_GIVEREF(r);}} while(0) #else #define __Pyx_RefNannyDeclarations #define __Pyx_RefNannySetupContext(name, acquire_gil) #define __Pyx_RefNannyFinishContext() #define __Pyx_INCREF(r) Py_INCREF(r) #define __Pyx_DECREF(r) Py_DECREF(r) #define __Pyx_GOTREF(r) #define __Pyx_GIVEREF(r) #define __Pyx_XINCREF(r) Py_XINCREF(r) #define __Pyx_XDECREF(r) Py_XDECREF(r) #define __Pyx_XGOTREF(r) #define __Pyx_XGIVEREF(r) #endif #define __Pyx_XDECREF_SET(r, v) do {\ PyObject *tmp = (PyObject *) r;\ r = v; __Pyx_XDECREF(tmp);\ } while (0) #define __Pyx_DECREF_SET(r, v) do {\ PyObject *tmp = (PyObject *) r;\ r = v; __Pyx_DECREF(tmp);\ } while (0) #define __Pyx_CLEAR(r) do { PyObject* tmp = ((PyObject*)(r)); r = NULL; __Pyx_DECREF(tmp);} while(0) #define __Pyx_XCLEAR(r) do { if((r) != NULL) {PyObject* tmp = ((PyObject*)(r)); r = NULL; __Pyx_DECREF(tmp);}} while(0) #if CYTHON_COMPILING_IN_CPYTHON static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStr(PyObject* obj, PyObject* attr_name) { PyTypeObject* tp = Py_TYPE(obj); if (likely(tp->tp_getattro)) return tp->tp_getattro(obj, attr_name); #if PY_MAJOR_VERSION < 3 if (likely(tp->tp_getattr)) return tp->tp_getattr(obj, PyString_AS_STRING(attr_name)); #endif return PyObject_GetAttr(obj, attr_name); } #else #define __Pyx_PyObject_GetAttrStr(o,n) PyObject_GetAttr(o,n) #endif static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list, int level); static PyObject *__Pyx_GetBuiltinName(PyObject *name); static CYTHON_INLINE PyObject *__Pyx_GetModuleGlobalName(PyObject *name); #if CYTHON_COMPILING_IN_CPYTHON static CYTHON_INLINE PyObject* __Pyx_PyObject_Call(PyObject *func, PyObject *arg, PyObject *kw); #else #define __Pyx_PyObject_Call(func, arg, kw) PyObject_Call(func, arg, kw) #endif #if CYTHON_COMPILING_IN_CPYTHON static CYTHON_INLINE PyObject* __Pyx_PyObject_CallMethO(PyObject *func, PyObject *arg); #endif static CYTHON_INLINE PyObject* __Pyx_PyObject_CallOneArg(PyObject *func, PyObject *arg); static void __Pyx_RaiseArgtupleInvalid(const char* func_name, int exact, Py_ssize_t num_min, Py_ssize_t num_max, Py_ssize_t num_found); static CYTHON_INLINE int __Pyx_CheckKeywordStrings(PyObject *kwdict, const char* function_name, int kw_allowed); static void __Pyx_RaiseDoubleKeywordsError(const char* func_name, PyObject* kw_name); static int __Pyx_ParseOptionalKeywords(PyObject *kwds, PyObject **argnames[],\ PyObject *kwds2, PyObject *values[], Py_ssize_t num_pos_args,\ const char* function_name); #if CYTHON_COMPILING_IN_CPYTHON static CYTHON_INLINE PyObject* __Pyx_PyObject_CallNoArg(PyObject *func); #else #define __Pyx_PyObject_CallNoArg(func) __Pyx_PyObject_Call(func, __pyx_empty_tuple, NULL) #endif static CYTHON_INLINE void __Pyx_ErrRestore(PyObject *type, PyObject *value, PyObject *tb); static CYTHON_INLINE void __Pyx_ErrFetch(PyObject **type, PyObject **value, PyObject **tb); static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, PyObject *cause); static CYTHON_INLINE void __Pyx_RaiseTooManyValuesError(Py_ssize_t expected); static CYTHON_INLINE void __Pyx_RaiseNeedMoreValuesError(Py_ssize_t index); static CYTHON_INLINE int __Pyx_IterFinish(void); static int __Pyx_IternextUnpackEndCheck(PyObject *retval, Py_ssize_t expected); static CYTHON_INLINE int __Pyx_TypeTest(PyObject *obj, PyTypeObject *type); static CYTHON_INLINE Py_UCS4 __Pyx_PyUnicode_AsPy_UCS4(PyObject*); #if PY_MAJOR_VERSION >= 3 #define __Pyx_PyObject_Ord(c)\ (likely(PyUnicode_Check(c)) ? (long)__Pyx_PyUnicode_AsPy_UCS4(c) : __Pyx__PyObject_Ord(c)) #else #define __Pyx_PyObject_Ord(c) __Pyx__PyObject_Ord(c) #endif static long __Pyx__PyObject_Ord(PyObject* c); #if CYTHON_COMPILING_IN_CPYTHON static CYTHON_INLINE int __Pyx_PyList_Append(PyObject* list, PyObject* x) { PyListObject* L = (PyListObject*) list; Py_ssize_t len = Py_SIZE(list); if (likely(L->allocated > len) & likely(len > (L->allocated >> 1))) { Py_INCREF(x); PyList_SET_ITEM(list, len, x); Py_SIZE(list) = len+1; return 0; } return PyList_Append(list, x); } #else #define __Pyx_PyList_Append(L,x) PyList_Append(L,x) #endif static int __Pyx_SetVtable(PyObject *dict, void *vtable); static void* __Pyx_GetVtable(PyObject *dict); static PyObject* __Pyx_ImportFrom(PyObject* module, PyObject* name); typedef struct { int code_line; PyCodeObject* code_object; } __Pyx_CodeObjectCacheEntry; struct __Pyx_CodeObjectCache { int count; int max_count; __Pyx_CodeObjectCacheEntry* entries; }; static struct __Pyx_CodeObjectCache __pyx_code_cache = {0,0,NULL}; static int __pyx_bisect_code_objects(__Pyx_CodeObjectCacheEntry* entries, int count, int code_line); static PyCodeObject *__pyx_find_code_object(int code_line); static void __pyx_insert_code_object(int code_line, PyCodeObject* code_object); static void __Pyx_AddTraceback(const char *funcname, int c_line, int py_line, const char *filename); static CYTHON_INLINE int __Pyx_PyInt_As_int(PyObject *); static CYTHON_INLINE PyObject* __Pyx_PyInt_From_int(int value); static CYTHON_INLINE PyObject* __Pyx_PyInt_From_long(long value); static CYTHON_INLINE long __Pyx_PyInt_As_long(PyObject *); static int __Pyx_check_binary_version(void); #if !defined(__Pyx_PyIdentifier_FromString) #if PY_MAJOR_VERSION < 3 #define __Pyx_PyIdentifier_FromString(s) PyString_FromString(s) #else #define __Pyx_PyIdentifier_FromString(s) PyUnicode_FromString(s) #endif #endif static PyObject *__Pyx_ImportModule(const char *name); static PyTypeObject *__Pyx_ImportType(const char *module_name, const char *class_name, size_t size, int strict); static int __Pyx_ImportFunction(PyObject *module, const char *funcname, void (**f)(void), const char *sig); static int __Pyx_InitStrings(__Pyx_StringTabEntry *t); static PyObject *__pyx_f_11pygame_sdl2_4font_4Font_set_style(struct __pyx_obj_11pygame_sdl2_4font_Font *__pyx_v_self, PyObject *__pyx_v_flag, PyObject *__pyx_v_on); /* proto*/ /* Module declarations from 'libc.stdint' */ /* Module declarations from 'libc.string' */ /* Module declarations from 'libc.stdio' */ /* Module declarations from 'libc.stddef' */ /* Module declarations from 'sdl2' */ /* Module declarations from 'sdl2_ttf' */ /* Module declarations from 'pygame_sdl2.surface' */ static PyTypeObject *__pyx_ptype_11pygame_sdl2_7surface_Surface = 0; /* Module declarations from 'pygame_sdl2.color' */ static PyTypeObject *__pyx_ptype_11pygame_sdl2_5color_Color = 0; static PyObject *(*__pyx_f_11pygame_sdl2_5color_to_sdl_color)(PyObject *, SDL_Color *); /*proto*/ /* Module declarations from 'pygame_sdl2.rwobject' */ static SDL_RWops *(*__pyx_f_11pygame_sdl2_8rwobject_to_rwops)(PyObject *, struct __pyx_opt_args_11pygame_sdl2_8rwobject_to_rwops *__pyx_optional_args); /*proto*/ /* Module declarations from 'pygame_sdl2.font' */ static PyTypeObject *__pyx_ptype_11pygame_sdl2_4font_Font = 0; #define __Pyx_MODULE_NAME "pygame_sdl2.font" int __pyx_module_is_main_pygame_sdl2__font = 0; /* Implementation of 'pygame_sdl2.font' */ static char __pyx_k__2[] = " "; static char __pyx_k_fi[] = "fi"; static char __pyx_k_os[] = "os"; static char __pyx_k_blit[] = "blit"; static char __pyx_k_copy[] = "copy"; static char __pyx_k_file[] = "__file__"; static char __pyx_k_fill[] = "fill"; static char __pyx_k_init[] = "init"; static char __pyx_k_join[] = "join"; static char __pyx_k_main[] = "__main__"; static char __pyx_k_path[] = "path"; static char __pyx_k_quit[] = "quit"; static char __pyx_k_sans[] = "sans"; static char __pyx_k_size[] = "size"; static char __pyx_k_test[] = "__test__"; static char __pyx_k_text[] = "text"; static char __pyx_k_color[] = "color"; static char __pyx_k_error[] = "error"; static char __pyx_k_utf_8[] = "utf-8"; static char __pyx_k_encode[] = "encode"; static char __pyx_k_exists[] = "exists"; static char __pyx_k_import[] = "__import__"; static char __pyx_k_SysFont[] = "SysFont"; static char __pyx_k_convert[] = "convert"; static char __pyx_k_default[] = "default"; static char __pyx_k_dirname[] = "dirname"; static char __pyx_k_get_init[] = "get_init"; static char __pyx_k_antialias[] = "antialias"; static char __pyx_k_get_fonts[] = "get_fonts"; static char __pyx_k_background[] = "background"; static char __pyx_k_match_font[] = "match_font"; static char __pyx_k_pyx_vtable[] = "__pyx_vtable__"; static char __pyx_k_pygame_sdl2[] = "pygame_sdl2"; static char __pyx_k_register_init[] = "register_init"; static char __pyx_k_register_quit[] = "register_quit"; static char __pyx_k_DejaVuSans_ttf[] = "DejaVuSans.ttf"; static char __pyx_k_get_default_font[] = "get_default_font"; static char __pyx_k_pygame_sdl2_font[] = "pygame_sdl2.font"; static char __pyx_k_pygame_sdl2_error[] = "pygame_sdl2.error"; static char __pyx_k_pygame_sdl2_sysfont[] = "pygame_sdl2.sysfont"; static char __pyx_k_home_tom_ab_pygame_sdl2_src_pyg[] = "/home/tom/ab/pygame_sdl2/src/pygame_sdl2/font.pyx"; static PyObject *__pyx_kp_u_DejaVuSans_ttf; static PyObject *__pyx_n_s_SysFont; static PyObject *__pyx_kp_u__2; static PyObject *__pyx_n_s_antialias; static PyObject *__pyx_n_s_background; static PyObject *__pyx_n_s_blit; static PyObject *__pyx_n_s_color; static PyObject *__pyx_n_s_convert; static PyObject *__pyx_n_s_copy; static PyObject *__pyx_n_s_default; static PyObject *__pyx_n_s_dirname; static PyObject *__pyx_n_s_encode; static PyObject *__pyx_n_s_error; static PyObject *__pyx_n_s_exists; static PyObject *__pyx_n_s_fi; static PyObject *__pyx_n_s_file; static PyObject *__pyx_n_s_fill; static PyObject *__pyx_n_s_get_default_font; static PyObject *__pyx_n_s_get_fonts; static PyObject *__pyx_n_s_get_init; static PyObject *__pyx_kp_s_home_tom_ab_pygame_sdl2_src_pyg; static PyObject *__pyx_n_s_import; static PyObject *__pyx_n_s_init; static PyObject *__pyx_n_s_join; static PyObject *__pyx_n_s_main; static PyObject *__pyx_n_s_match_font; static PyObject *__pyx_n_s_os; static PyObject *__pyx_n_s_path; static PyObject *__pyx_n_s_pygame_sdl2; static PyObject *__pyx_n_s_pygame_sdl2_error; static PyObject *__pyx_n_s_pygame_sdl2_font; static PyObject *__pyx_n_s_pygame_sdl2_sysfont; static PyObject *__pyx_n_s_pyx_vtable; static PyObject *__pyx_n_s_quit; static PyObject *__pyx_n_s_register_init; static PyObject *__pyx_n_s_register_quit; static PyObject *__pyx_n_u_sans; static PyObject *__pyx_n_s_size; static PyObject *__pyx_n_s_test; static PyObject *__pyx_n_s_text; static PyObject *__pyx_kp_u_utf_8; static PyObject *__pyx_pf_11pygame_sdl2_4font_init(CYTHON_UNUSED PyObject *__pyx_self); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_4font_2quit(CYTHON_UNUSED PyObject *__pyx_self); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_4font_4get_init(CYTHON_UNUSED PyObject *__pyx_self); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_4font_6get_default_font(CYTHON_UNUSED PyObject *__pyx_self); /* proto */ static int __pyx_pf_11pygame_sdl2_4font_4Font___cinit__(struct __pyx_obj_11pygame_sdl2_4font_Font *__pyx_v_self); /* proto */ static void __pyx_pf_11pygame_sdl2_4font_4Font_2__dealloc__(struct __pyx_obj_11pygame_sdl2_4font_Font *__pyx_v_self); /* proto */ static int __pyx_pf_11pygame_sdl2_4font_4Font_4__init__(struct __pyx_obj_11pygame_sdl2_4font_Font *__pyx_v_self, PyObject *__pyx_v_fi, PyObject *__pyx_v_size); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_4font_4Font_6render(struct __pyx_obj_11pygame_sdl2_4font_Font *__pyx_v_self, PyObject *__pyx_v_text, PyObject *__pyx_v_antialias, PyObject *__pyx_v_color, PyObject *__pyx_v_background); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_4font_4Font_8size(struct __pyx_obj_11pygame_sdl2_4font_Font *__pyx_v_self, PyObject *__pyx_v_text); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_4font_4Font_10set_underline(struct __pyx_obj_11pygame_sdl2_4font_Font *__pyx_v_self, PyObject *__pyx_v_on); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_4font_4Font_12get_underline(struct __pyx_obj_11pygame_sdl2_4font_Font *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_4font_4Font_14set_bold(struct __pyx_obj_11pygame_sdl2_4font_Font *__pyx_v_self, PyObject *__pyx_v_on); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_4font_4Font_16get_bold(struct __pyx_obj_11pygame_sdl2_4font_Font *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_4font_4Font_18set_italic(struct __pyx_obj_11pygame_sdl2_4font_Font *__pyx_v_self, PyObject *__pyx_v_on); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_4font_4Font_20get_italic(struct __pyx_obj_11pygame_sdl2_4font_Font *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_4font_4Font_22get_linesize(struct __pyx_obj_11pygame_sdl2_4font_Font *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_4font_4Font_24get_height(struct __pyx_obj_11pygame_sdl2_4font_Font *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_4font_4Font_26get_ascent(struct __pyx_obj_11pygame_sdl2_4font_Font *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_4font_4Font_28get_descent(struct __pyx_obj_11pygame_sdl2_4font_Font *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_4font_4Font_30metrics(struct __pyx_obj_11pygame_sdl2_4font_Font *__pyx_v_self, PyObject *__pyx_v_text); /* proto */ static PyObject *__pyx_tp_new_11pygame_sdl2_4font_Font(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ static PyObject *__pyx_int_0; static PyObject *__pyx_tuple_; static PyObject *__pyx_tuple__3; static PyObject *__pyx_tuple__4; static PyObject *__pyx_tuple__5; static PyObject *__pyx_tuple__6; static PyObject *__pyx_tuple__7; static PyObject *__pyx_tuple__8; static PyObject *__pyx_tuple__12; static PyObject *__pyx_codeobj__9; static PyObject *__pyx_codeobj__10; static PyObject *__pyx_codeobj__11; static PyObject *__pyx_codeobj__13; /* "pygame_sdl2/font.pyx":30 * * @pygame_sdl2.register_init * def init(): # <<<<<<<<<<<<<< * TTF_Init() * */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_4font_1init(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused); /*proto*/ static PyMethodDef __pyx_mdef_11pygame_sdl2_4font_1init = {"init", (PyCFunction)__pyx_pw_11pygame_sdl2_4font_1init, METH_NOARGS, 0}; static PyObject *__pyx_pw_11pygame_sdl2_4font_1init(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("init (wrapper)", 0); __pyx_r = __pyx_pf_11pygame_sdl2_4font_init(__pyx_self); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_4font_init(CYTHON_UNUSED PyObject *__pyx_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("init", 0); /* "pygame_sdl2/font.pyx":31 * @pygame_sdl2.register_init * def init(): * TTF_Init() # <<<<<<<<<<<<<< * * @pygame_sdl2.register_quit */ TTF_Init(); /* "pygame_sdl2/font.pyx":30 * * @pygame_sdl2.register_init * def init(): # <<<<<<<<<<<<<< * TTF_Init() * */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/font.pyx":34 * * @pygame_sdl2.register_quit * def quit(): # @ReservedAssignment # <<<<<<<<<<<<<< * TTF_Quit() * */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_4font_3quit(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused); /*proto*/ static PyMethodDef __pyx_mdef_11pygame_sdl2_4font_3quit = {"quit", (PyCFunction)__pyx_pw_11pygame_sdl2_4font_3quit, METH_NOARGS, 0}; static PyObject *__pyx_pw_11pygame_sdl2_4font_3quit(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("quit (wrapper)", 0); __pyx_r = __pyx_pf_11pygame_sdl2_4font_2quit(__pyx_self); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_4font_2quit(CYTHON_UNUSED PyObject *__pyx_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("quit", 0); /* "pygame_sdl2/font.pyx":35 * @pygame_sdl2.register_quit * def quit(): # @ReservedAssignment * TTF_Quit() # <<<<<<<<<<<<<< * * def get_init(): */ TTF_Quit(); /* "pygame_sdl2/font.pyx":34 * * @pygame_sdl2.register_quit * def quit(): # @ReservedAssignment # <<<<<<<<<<<<<< * TTF_Quit() * */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/font.pyx":37 * TTF_Quit() * * def get_init(): # <<<<<<<<<<<<<< * return TTF_WasInit() != 0 * */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_4font_5get_init(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused); /*proto*/ static PyMethodDef __pyx_mdef_11pygame_sdl2_4font_5get_init = {"get_init", (PyCFunction)__pyx_pw_11pygame_sdl2_4font_5get_init, METH_NOARGS, 0}; static PyObject *__pyx_pw_11pygame_sdl2_4font_5get_init(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("get_init (wrapper)", 0); __pyx_r = __pyx_pf_11pygame_sdl2_4font_4get_init(__pyx_self); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_4font_4get_init(CYTHON_UNUSED PyObject *__pyx_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("get_init", 0); /* "pygame_sdl2/font.pyx":38 * * def get_init(): * return TTF_WasInit() != 0 # <<<<<<<<<<<<<< * * def get_default_font(): */ __Pyx_XDECREF(__pyx_r); __pyx_t_1 = __Pyx_PyBool_FromLong((TTF_WasInit() != 0)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 38; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "pygame_sdl2/font.pyx":37 * TTF_Quit() * * def get_init(): # <<<<<<<<<<<<<< * return TTF_WasInit() != 0 * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("pygame_sdl2.font.get_init", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/font.pyx":40 * return TTF_WasInit() != 0 * * def get_default_font(): # <<<<<<<<<<<<<< * import os * */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_4font_7get_default_font(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused); /*proto*/ static PyMethodDef __pyx_mdef_11pygame_sdl2_4font_7get_default_font = {"get_default_font", (PyCFunction)__pyx_pw_11pygame_sdl2_4font_7get_default_font, METH_NOARGS, 0}; static PyObject *__pyx_pw_11pygame_sdl2_4font_7get_default_font(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("get_default_font (wrapper)", 0); __pyx_r = __pyx_pf_11pygame_sdl2_4font_6get_default_font(__pyx_self); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_4font_6get_default_font(CYTHON_UNUSED PyObject *__pyx_self) { PyObject *__pyx_v_os = NULL; PyObject *__pyx_v_default = NULL; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; PyObject *__pyx_t_5 = NULL; PyObject *__pyx_t_6 = NULL; PyObject *__pyx_t_7 = NULL; Py_ssize_t __pyx_t_8; int __pyx_t_9; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("get_default_font", 0); /* "pygame_sdl2/font.pyx":41 * * def get_default_font(): * import os # <<<<<<<<<<<<<< * * default = os.path.join(os.path.dirname(__file__), "DejaVuSans.ttf") */ __pyx_t_1 = __Pyx_Import(__pyx_n_s_os, 0, 0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 41; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_v_os = __pyx_t_1; __pyx_t_1 = 0; /* "pygame_sdl2/font.pyx":43 * import os * * default = os.path.join(os.path.dirname(__file__), "DejaVuSans.ttf") # <<<<<<<<<<<<<< * * if os.path.exists(default): */ __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_os, __pyx_n_s_path); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 43; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_join); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 43; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_os, __pyx_n_s_path); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 43; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_dirname); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 43; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_file); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 43; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); __pyx_t_6 = NULL; if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_5))) { __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_5); if (likely(__pyx_t_6)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5); __Pyx_INCREF(__pyx_t_6); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_5, function); } } if (!__pyx_t_6) { __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_t_4); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 43; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_GOTREF(__pyx_t_2); } else { __pyx_t_7 = PyTuple_New(1+1); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 43; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_7); __Pyx_GIVEREF(__pyx_t_6); PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_6); __pyx_t_6 = NULL; __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_7, 0+1, __pyx_t_4); __pyx_t_4 = 0; __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_7, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 43; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; } __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __pyx_t_5 = NULL; __pyx_t_8 = 0; if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_3))) { __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_3); if (likely(__pyx_t_5)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); __Pyx_INCREF(__pyx_t_5); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_3, function); __pyx_t_8 = 1; } } __pyx_t_7 = PyTuple_New(2+__pyx_t_8); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 43; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_7); if (__pyx_t_5) { __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_5); __pyx_t_5 = NULL; } __Pyx_GIVEREF(__pyx_t_2); PyTuple_SET_ITEM(__pyx_t_7, 0+__pyx_t_8, __pyx_t_2); __Pyx_INCREF(__pyx_kp_u_DejaVuSans_ttf); __Pyx_GIVEREF(__pyx_kp_u_DejaVuSans_ttf); PyTuple_SET_ITEM(__pyx_t_7, 1+__pyx_t_8, __pyx_kp_u_DejaVuSans_ttf); __pyx_t_2 = 0; __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_7, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 43; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_v_default = __pyx_t_1; __pyx_t_1 = 0; /* "pygame_sdl2/font.pyx":45 * default = os.path.join(os.path.dirname(__file__), "DejaVuSans.ttf") * * if os.path.exists(default): # <<<<<<<<<<<<<< * return default * */ __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_os, __pyx_n_s_path); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 45; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_exists); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 45; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_3 = NULL; if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_7))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_7); if (likely(__pyx_t_3)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_7); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_7, function); } } if (!__pyx_t_3) { __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_7, __pyx_v_default); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 45; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); } else { __pyx_t_2 = PyTuple_New(1+1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 45; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_3); __pyx_t_3 = NULL; __Pyx_INCREF(__pyx_v_default); __Pyx_GIVEREF(__pyx_v_default); PyTuple_SET_ITEM(__pyx_t_2, 0+1, __pyx_v_default); __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_7, __pyx_t_2, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 45; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __pyx_t_9 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_9 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 45; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (__pyx_t_9) { /* "pygame_sdl2/font.pyx":46 * * if os.path.exists(default): * return default # <<<<<<<<<<<<<< * * return match_font("sans") */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(__pyx_v_default); __pyx_r = __pyx_v_default; goto __pyx_L0; /* "pygame_sdl2/font.pyx":45 * default = os.path.join(os.path.dirname(__file__), "DejaVuSans.ttf") * * if os.path.exists(default): # <<<<<<<<<<<<<< * return default * */ } /* "pygame_sdl2/font.pyx":48 * return default * * return match_font("sans") # <<<<<<<<<<<<<< * * cdef class Font: */ __Pyx_XDECREF(__pyx_r); __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_match_font); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 48; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_t_7 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_tuple_, NULL); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 48; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_r = __pyx_t_7; __pyx_t_7 = 0; goto __pyx_L0; /* "pygame_sdl2/font.pyx":40 * return TTF_WasInit() != 0 * * def get_default_font(): # <<<<<<<<<<<<<< * import os * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_5); __Pyx_XDECREF(__pyx_t_6); __Pyx_XDECREF(__pyx_t_7); __Pyx_AddTraceback("pygame_sdl2.font.get_default_font", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF(__pyx_v_os); __Pyx_XDECREF(__pyx_v_default); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/font.pyx":54 * cdef int style * * def __cinit__(self): # <<<<<<<<<<<<<< * self.font = NULL * self.style = TTF_STYLE_NORMAL */ /* Python wrapper */ static int __pyx_pw_11pygame_sdl2_4font_4Font_1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static int __pyx_pw_11pygame_sdl2_4font_4Font_1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__cinit__ (wrapper)", 0); if (unlikely(PyTuple_GET_SIZE(__pyx_args) > 0)) { __Pyx_RaiseArgtupleInvalid("__cinit__", 1, 0, 0, PyTuple_GET_SIZE(__pyx_args)); return -1;} if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "__cinit__", 0))) return -1; __pyx_r = __pyx_pf_11pygame_sdl2_4font_4Font___cinit__(((struct __pyx_obj_11pygame_sdl2_4font_Font *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static int __pyx_pf_11pygame_sdl2_4font_4Font___cinit__(struct __pyx_obj_11pygame_sdl2_4font_Font *__pyx_v_self) { int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__cinit__", 0); /* "pygame_sdl2/font.pyx":55 * * def __cinit__(self): * self.font = NULL # <<<<<<<<<<<<<< * self.style = TTF_STYLE_NORMAL * */ __pyx_v_self->font = NULL; /* "pygame_sdl2/font.pyx":56 * def __cinit__(self): * self.font = NULL * self.style = TTF_STYLE_NORMAL # <<<<<<<<<<<<<< * * def __dealloc__(self): */ __pyx_v_self->style = TTF_STYLE_NORMAL; /* "pygame_sdl2/font.pyx":54 * cdef int style * * def __cinit__(self): # <<<<<<<<<<<<<< * self.font = NULL * self.style = TTF_STYLE_NORMAL */ /* function exit code */ __pyx_r = 0; __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/font.pyx":58 * self.style = TTF_STYLE_NORMAL * * def __dealloc__(self): # <<<<<<<<<<<<<< * if self.font: * TTF_CloseFont(self.font) */ /* Python wrapper */ static void __pyx_pw_11pygame_sdl2_4font_4Font_3__dealloc__(PyObject *__pyx_v_self); /*proto*/ static void __pyx_pw_11pygame_sdl2_4font_4Font_3__dealloc__(PyObject *__pyx_v_self) { __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__dealloc__ (wrapper)", 0); __pyx_pf_11pygame_sdl2_4font_4Font_2__dealloc__(((struct __pyx_obj_11pygame_sdl2_4font_Font *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); } static void __pyx_pf_11pygame_sdl2_4font_4Font_2__dealloc__(struct __pyx_obj_11pygame_sdl2_4font_Font *__pyx_v_self) { __Pyx_RefNannyDeclarations int __pyx_t_1; __Pyx_RefNannySetupContext("__dealloc__", 0); /* "pygame_sdl2/font.pyx":59 * * def __dealloc__(self): * if self.font: # <<<<<<<<<<<<<< * TTF_CloseFont(self.font) * */ __pyx_t_1 = (__pyx_v_self->font != 0); if (__pyx_t_1) { /* "pygame_sdl2/font.pyx":60 * def __dealloc__(self): * if self.font: * TTF_CloseFont(self.font) # <<<<<<<<<<<<<< * * def __init__(self, fi, size): */ TTF_CloseFont(__pyx_v_self->font); /* "pygame_sdl2/font.pyx":59 * * def __dealloc__(self): * if self.font: # <<<<<<<<<<<<<< * TTF_CloseFont(self.font) * */ } /* "pygame_sdl2/font.pyx":58 * self.style = TTF_STYLE_NORMAL * * def __dealloc__(self): # <<<<<<<<<<<<<< * if self.font: * TTF_CloseFont(self.font) */ /* function exit code */ __Pyx_RefNannyFinishContext(); } /* "pygame_sdl2/font.pyx":62 * TTF_CloseFont(self.font) * * def __init__(self, fi, size): # <<<<<<<<<<<<<< * if fi is None: * fi = get_default_font() */ /* Python wrapper */ static int __pyx_pw_11pygame_sdl2_4font_4Font_5__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static int __pyx_pw_11pygame_sdl2_4font_4Font_5__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_fi = 0; PyObject *__pyx_v_size = 0; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__init__ (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_fi,&__pyx_n_s_size,0}; PyObject* values[2] = {0,0}; if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_fi)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; case 1: if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_size)) != 0)) kw_args--; else { __Pyx_RaiseArgtupleInvalid("__init__", 1, 2, 2, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 62; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__init__") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 62; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } } else if (PyTuple_GET_SIZE(__pyx_args) != 2) { goto __pyx_L5_argtuple_error; } else { values[0] = PyTuple_GET_ITEM(__pyx_args, 0); values[1] = PyTuple_GET_ITEM(__pyx_args, 1); } __pyx_v_fi = values[0]; __pyx_v_size = values[1]; } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("__init__", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 62; __pyx_clineno = __LINE__; goto __pyx_L3_error;} __pyx_L3_error:; __Pyx_AddTraceback("pygame_sdl2.font.Font.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return -1; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_11pygame_sdl2_4font_4Font_4__init__(((struct __pyx_obj_11pygame_sdl2_4font_Font *)__pyx_v_self), __pyx_v_fi, __pyx_v_size); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static int __pyx_pf_11pygame_sdl2_4font_4Font_4__init__(struct __pyx_obj_11pygame_sdl2_4font_Font *__pyx_v_self, PyObject *__pyx_v_fi, PyObject *__pyx_v_size) { int __pyx_r; __Pyx_RefNannyDeclarations int __pyx_t_1; int __pyx_t_2; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; PyObject *__pyx_t_5 = NULL; SDL_RWops *__pyx_t_6; int __pyx_t_7; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__init__", 0); __Pyx_INCREF(__pyx_v_fi); /* "pygame_sdl2/font.pyx":63 * * def __init__(self, fi, size): * if fi is None: # <<<<<<<<<<<<<< * fi = get_default_font() * self.font = TTF_OpenFontRW(to_rwops(fi), 1, size) */ __pyx_t_1 = (__pyx_v_fi == Py_None); __pyx_t_2 = (__pyx_t_1 != 0); if (__pyx_t_2) { /* "pygame_sdl2/font.pyx":64 * def __init__(self, fi, size): * if fi is None: * fi = get_default_font() # <<<<<<<<<<<<<< * self.font = TTF_OpenFontRW(to_rwops(fi), 1, size) * if self.font == NULL: */ __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_get_default_font); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 64; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); __pyx_t_5 = NULL; if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_4))) { __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4); if (likely(__pyx_t_5)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4); __Pyx_INCREF(__pyx_t_5); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_4, function); } } if (__pyx_t_5) { __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_5); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 64; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; } else { __pyx_t_3 = __Pyx_PyObject_CallNoArg(__pyx_t_4); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 64; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF_SET(__pyx_v_fi, __pyx_t_3); __pyx_t_3 = 0; /* "pygame_sdl2/font.pyx":63 * * def __init__(self, fi, size): * if fi is None: # <<<<<<<<<<<<<< * fi = get_default_font() * self.font = TTF_OpenFontRW(to_rwops(fi), 1, size) */ } /* "pygame_sdl2/font.pyx":65 * if fi is None: * fi = get_default_font() * self.font = TTF_OpenFontRW(to_rwops(fi), 1, size) # <<<<<<<<<<<<<< * if self.font == NULL: * raise error() */ __pyx_t_6 = __pyx_f_11pygame_sdl2_8rwobject_to_rwops(__pyx_v_fi, NULL); if (unlikely(__pyx_t_6 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 65; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_t_7 = __Pyx_PyInt_As_int(__pyx_v_size); if (unlikely((__pyx_t_7 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 65; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_v_self->font = TTF_OpenFontRW(__pyx_t_6, 1, __pyx_t_7); /* "pygame_sdl2/font.pyx":66 * fi = get_default_font() * self.font = TTF_OpenFontRW(to_rwops(fi), 1, size) * if self.font == NULL: # <<<<<<<<<<<<<< * raise error() * */ __pyx_t_2 = ((__pyx_v_self->font == NULL) != 0); if (__pyx_t_2) { /* "pygame_sdl2/font.pyx":67 * self.font = TTF_OpenFontRW(to_rwops(fi), 1, size) * if self.font == NULL: * raise error() # <<<<<<<<<<<<<< * * def render(self, text, antialias, color, background=None): */ __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_error); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 67; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); __pyx_t_5 = NULL; if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_4))) { __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4); if (likely(__pyx_t_5)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4); __Pyx_INCREF(__pyx_t_5); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_4, function); } } if (__pyx_t_5) { __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_5); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 67; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; } else { __pyx_t_3 = __Pyx_PyObject_CallNoArg(__pyx_t_4); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 67; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_Raise(__pyx_t_3, 0, 0, 0); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; {__pyx_filename = __pyx_f[0]; __pyx_lineno = 67; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "pygame_sdl2/font.pyx":66 * fi = get_default_font() * self.font = TTF_OpenFontRW(to_rwops(fi), 1, size) * if self.font == NULL: # <<<<<<<<<<<<<< * raise error() * */ } /* "pygame_sdl2/font.pyx":62 * TTF_CloseFont(self.font) * * def __init__(self, fi, size): # <<<<<<<<<<<<<< * if fi is None: * fi = get_default_font() */ /* function exit code */ __pyx_r = 0; goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_5); __Pyx_AddTraceback("pygame_sdl2.font.Font.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = -1; __pyx_L0:; __Pyx_XDECREF(__pyx_v_fi); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/font.pyx":69 * raise error() * * def render(self, text, antialias, color, background=None): # <<<<<<<<<<<<<< * cdef SDL_Surface *surf * cdef SDL_Color fg */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_4font_4Font_7render(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static PyObject *__pyx_pw_11pygame_sdl2_4font_4Font_7render(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_text = 0; PyObject *__pyx_v_antialias = 0; PyObject *__pyx_v_color = 0; PyObject *__pyx_v_background = 0; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("render (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_text,&__pyx_n_s_antialias,&__pyx_n_s_color,&__pyx_n_s_background,0}; PyObject* values[4] = {0,0,0,0}; values[3] = ((PyObject *)Py_None); if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_text)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; case 1: if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_antialias)) != 0)) kw_args--; else { __Pyx_RaiseArgtupleInvalid("render", 0, 3, 4, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 69; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } case 2: if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_color)) != 0)) kw_args--; else { __Pyx_RaiseArgtupleInvalid("render", 0, 3, 4, 2); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 69; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } case 3: if (kw_args > 0) { PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_background); if (value) { values[3] = value; kw_args--; } } } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "render") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 69; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } } else { switch (PyTuple_GET_SIZE(__pyx_args)) { case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); values[1] = PyTuple_GET_ITEM(__pyx_args, 1); values[0] = PyTuple_GET_ITEM(__pyx_args, 0); break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_text = values[0]; __pyx_v_antialias = values[1]; __pyx_v_color = values[2]; __pyx_v_background = values[3]; } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("render", 0, 3, 4, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 69; __pyx_clineno = __LINE__; goto __pyx_L3_error;} __pyx_L3_error:; __Pyx_AddTraceback("pygame_sdl2.font.Font.render", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_11pygame_sdl2_4font_4Font_6render(((struct __pyx_obj_11pygame_sdl2_4font_Font *)__pyx_v_self), __pyx_v_text, __pyx_v_antialias, __pyx_v_color, __pyx_v_background); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_4font_4Font_6render(struct __pyx_obj_11pygame_sdl2_4font_Font *__pyx_v_self, PyObject *__pyx_v_text, PyObject *__pyx_v_antialias, PyObject *__pyx_v_color, PyObject *__pyx_v_background) { SDL_Surface *__pyx_v_surf; SDL_Color __pyx_v_fg; CYTHON_UNUSED PyObject *__pyx_v_w = NULL; PyObject *__pyx_v_h = NULL; struct __pyx_obj_11pygame_sdl2_7surface_Surface *__pyx_v_rv = 0; PyObject *__pyx_v_bgsurf = NULL; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; int __pyx_t_2; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; PyObject *__pyx_t_5 = NULL; PyObject *__pyx_t_6 = NULL; PyObject *(*__pyx_t_7)(PyObject *); char const *__pyx_t_8; char const *__pyx_t_9; Py_ssize_t __pyx_t_10; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("render", 0); /* "pygame_sdl2/font.pyx":73 * cdef SDL_Color fg * * if not text: # <<<<<<<<<<<<<< * w, h = self.size(" ") * return Surface((0, h)) */ __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_text); if (unlikely(__pyx_t_1 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 73; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_t_2 = ((!__pyx_t_1) != 0); if (__pyx_t_2) { /* "pygame_sdl2/font.pyx":74 * * if not text: * w, h = self.size(" ") # <<<<<<<<<<<<<< * return Surface((0, h)) * */ __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_size); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 74; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_tuple__3, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 74; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; if ((likely(PyTuple_CheckExact(__pyx_t_4))) || (PyList_CheckExact(__pyx_t_4))) { PyObject* sequence = __pyx_t_4; #if CYTHON_COMPILING_IN_CPYTHON Py_ssize_t size = Py_SIZE(sequence); #else Py_ssize_t size = PySequence_Size(sequence); #endif if (unlikely(size != 2)) { if (size > 2) __Pyx_RaiseTooManyValuesError(2); else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 74; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } #if CYTHON_COMPILING_IN_CPYTHON if (likely(PyTuple_CheckExact(sequence))) { __pyx_t_3 = PyTuple_GET_ITEM(sequence, 0); __pyx_t_5 = PyTuple_GET_ITEM(sequence, 1); } else { __pyx_t_3 = PyList_GET_ITEM(sequence, 0); __pyx_t_5 = PyList_GET_ITEM(sequence, 1); } __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(__pyx_t_5); #else __pyx_t_3 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 74; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __pyx_t_5 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 74; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); #endif __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; } else { Py_ssize_t index = -1; __pyx_t_6 = PyObject_GetIter(__pyx_t_4); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 74; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_t_7 = Py_TYPE(__pyx_t_6)->tp_iternext; index = 0; __pyx_t_3 = __pyx_t_7(__pyx_t_6); if (unlikely(!__pyx_t_3)) goto __pyx_L4_unpacking_failed; __Pyx_GOTREF(__pyx_t_3); index = 1; __pyx_t_5 = __pyx_t_7(__pyx_t_6); if (unlikely(!__pyx_t_5)) goto __pyx_L4_unpacking_failed; __Pyx_GOTREF(__pyx_t_5); if (__Pyx_IternextUnpackEndCheck(__pyx_t_7(__pyx_t_6), 2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 74; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_t_7 = NULL; __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; goto __pyx_L5_unpacking_done; __pyx_L4_unpacking_failed:; __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __pyx_t_7 = NULL; if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 74; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_L5_unpacking_done:; } __pyx_v_w = __pyx_t_3; __pyx_t_3 = 0; __pyx_v_h = __pyx_t_5; __pyx_t_5 = 0; /* "pygame_sdl2/font.pyx":75 * if not text: * w, h = self.size(" ") * return Surface((0, h)) # <<<<<<<<<<<<<< * * to_sdl_color(color, &fg) */ __Pyx_XDECREF(__pyx_r); __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 75; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); __Pyx_INCREF(__pyx_int_0); __Pyx_GIVEREF(__pyx_int_0); PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_int_0); __Pyx_INCREF(__pyx_v_h); __Pyx_GIVEREF(__pyx_v_h); PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_v_h); __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 75; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_4); __pyx_t_4 = 0; __pyx_t_4 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_11pygame_sdl2_7surface_Surface), __pyx_t_5, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 75; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __pyx_r = __pyx_t_4; __pyx_t_4 = 0; goto __pyx_L0; /* "pygame_sdl2/font.pyx":73 * cdef SDL_Color fg * * if not text: # <<<<<<<<<<<<<< * w, h = self.size(" ") * return Surface((0, h)) */ } /* "pygame_sdl2/font.pyx":77 * return Surface((0, h)) * * to_sdl_color(color, &fg) # <<<<<<<<<<<<<< * * TTF_SetFontStyle(self.font, self.style) */ __pyx_t_4 = __pyx_f_11pygame_sdl2_5color_to_sdl_color(__pyx_v_color, (&__pyx_v_fg)); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 77; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; /* "pygame_sdl2/font.pyx":79 * to_sdl_color(color, &fg) * * TTF_SetFontStyle(self.font, self.style) # <<<<<<<<<<<<<< * if antialias: * surf = TTF_RenderUTF8_Blended(self.font, text.encode('utf-8'), fg) */ TTF_SetFontStyle(__pyx_v_self->font, __pyx_v_self->style); /* "pygame_sdl2/font.pyx":80 * * TTF_SetFontStyle(self.font, self.style) * if antialias: # <<<<<<<<<<<<<< * surf = TTF_RenderUTF8_Blended(self.font, text.encode('utf-8'), fg) * else: */ __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_v_antialias); if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 80; __pyx_clineno = __LINE__; goto __pyx_L1_error;} if (__pyx_t_2) { /* "pygame_sdl2/font.pyx":81 * TTF_SetFontStyle(self.font, self.style) * if antialias: * surf = TTF_RenderUTF8_Blended(self.font, text.encode('utf-8'), fg) # <<<<<<<<<<<<<< * else: * surf = TTF_RenderUTF8_Solid(self.font, text.encode('utf-8'), fg) */ __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_text, __pyx_n_s_encode); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 81; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_tuple__4, NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 81; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_t_8 = __Pyx_PyObject_AsString(__pyx_t_5); if (unlikely((!__pyx_t_8) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 81; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_v_surf = TTF_RenderUTF8_Blended(__pyx_v_self->font, __pyx_t_8, __pyx_v_fg); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; /* "pygame_sdl2/font.pyx":80 * * TTF_SetFontStyle(self.font, self.style) * if antialias: # <<<<<<<<<<<<<< * surf = TTF_RenderUTF8_Blended(self.font, text.encode('utf-8'), fg) * else: */ goto __pyx_L6; } /* "pygame_sdl2/font.pyx":83 * surf = TTF_RenderUTF8_Blended(self.font, text.encode('utf-8'), fg) * else: * surf = TTF_RenderUTF8_Solid(self.font, text.encode('utf-8'), fg) # <<<<<<<<<<<<<< * * if surf == NULL: */ /*else*/ { __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_text, __pyx_n_s_encode); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 83; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_tuple__5, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 83; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __pyx_t_9 = __Pyx_PyObject_AsString(__pyx_t_4); if (unlikely((!__pyx_t_9) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 83; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_v_surf = TTF_RenderUTF8_Solid(__pyx_v_self->font, __pyx_t_9, __pyx_v_fg); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; } __pyx_L6:; /* "pygame_sdl2/font.pyx":85 * surf = TTF_RenderUTF8_Solid(self.font, text.encode('utf-8'), fg) * * if surf == NULL: # <<<<<<<<<<<<<< * raise error() * */ __pyx_t_2 = ((__pyx_v_surf == NULL) != 0); if (__pyx_t_2) { /* "pygame_sdl2/font.pyx":86 * * if surf == NULL: * raise error() # <<<<<<<<<<<<<< * * cdef Surface rv = Surface(()) */ __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_error); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 86; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); __pyx_t_3 = NULL; if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_5))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_5); if (likely(__pyx_t_3)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_5, function); } } if (__pyx_t_3) { __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_t_3); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 86; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } else { __pyx_t_4 = __Pyx_PyObject_CallNoArg(__pyx_t_5); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 86; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_Raise(__pyx_t_4, 0, 0, 0); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; {__pyx_filename = __pyx_f[0]; __pyx_lineno = 86; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "pygame_sdl2/font.pyx":85 * surf = TTF_RenderUTF8_Solid(self.font, text.encode('utf-8'), fg) * * if surf == NULL: # <<<<<<<<<<<<<< * raise error() * */ } /* "pygame_sdl2/font.pyx":88 * raise error() * * cdef Surface rv = Surface(()) # <<<<<<<<<<<<<< * rv.take_surface(surf) * */ __pyx_t_4 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_11pygame_sdl2_7surface_Surface), __pyx_tuple__6, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 88; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); __pyx_v_rv = ((struct __pyx_obj_11pygame_sdl2_7surface_Surface *)__pyx_t_4); __pyx_t_4 = 0; /* "pygame_sdl2/font.pyx":89 * * cdef Surface rv = Surface(()) * rv.take_surface(surf) # <<<<<<<<<<<<<< * * if rv.surface.format.BitsPerPixel != 32: */ ((struct __pyx_vtabstruct_11pygame_sdl2_7surface_Surface *)__pyx_v_rv->__pyx_vtab)->take_surface(__pyx_v_rv, __pyx_v_surf); /* "pygame_sdl2/font.pyx":91 * rv.take_surface(surf) * * if rv.surface.format.BitsPerPixel != 32: # <<<<<<<<<<<<<< * rv = rv.convert() * */ __pyx_t_2 = ((__pyx_v_rv->surface->format->BitsPerPixel != 32) != 0); if (__pyx_t_2) { /* "pygame_sdl2/font.pyx":92 * * if rv.surface.format.BitsPerPixel != 32: * rv = rv.convert() # <<<<<<<<<<<<<< * * if background is not None: */ __pyx_t_5 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_rv), __pyx_n_s_convert); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 92; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); __pyx_t_3 = NULL; if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_5))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_5); if (likely(__pyx_t_3)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_5, function); } } if (__pyx_t_3) { __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_t_3); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 92; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } else { __pyx_t_4 = __Pyx_PyObject_CallNoArg(__pyx_t_5); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 92; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; if (!(likely(((__pyx_t_4) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_4, __pyx_ptype_11pygame_sdl2_7surface_Surface))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 92; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF_SET(__pyx_v_rv, ((struct __pyx_obj_11pygame_sdl2_7surface_Surface *)__pyx_t_4)); __pyx_t_4 = 0; /* "pygame_sdl2/font.pyx":91 * rv.take_surface(surf) * * if rv.surface.format.BitsPerPixel != 32: # <<<<<<<<<<<<<< * rv = rv.convert() * */ } /* "pygame_sdl2/font.pyx":94 * rv = rv.convert() * * if background is not None: # <<<<<<<<<<<<<< * bgsurf = rv.copy() * bgsurf.fill(background) */ __pyx_t_2 = (__pyx_v_background != Py_None); __pyx_t_1 = (__pyx_t_2 != 0); if (__pyx_t_1) { /* "pygame_sdl2/font.pyx":95 * * if background is not None: * bgsurf = rv.copy() # <<<<<<<<<<<<<< * bgsurf.fill(background) * bgsurf.blit(rv, (0,0)) */ __pyx_t_5 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_rv), __pyx_n_s_copy); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 95; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); __pyx_t_3 = NULL; if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_5))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_5); if (likely(__pyx_t_3)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_5, function); } } if (__pyx_t_3) { __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_t_3); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 95; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } else { __pyx_t_4 = __Pyx_PyObject_CallNoArg(__pyx_t_5); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 95; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __pyx_v_bgsurf = __pyx_t_4; __pyx_t_4 = 0; /* "pygame_sdl2/font.pyx":96 * if background is not None: * bgsurf = rv.copy() * bgsurf.fill(background) # <<<<<<<<<<<<<< * bgsurf.blit(rv, (0,0)) * return bgsurf */ __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_bgsurf, __pyx_n_s_fill); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 96; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); __pyx_t_3 = NULL; if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_5))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_5); if (likely(__pyx_t_3)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_5, function); } } if (!__pyx_t_3) { __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_v_background); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 96; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); } else { __pyx_t_6 = PyTuple_New(1+1); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 96; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_6); __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_3); __pyx_t_3 = NULL; __Pyx_INCREF(__pyx_v_background); __Pyx_GIVEREF(__pyx_v_background); PyTuple_SET_ITEM(__pyx_t_6, 0+1, __pyx_v_background); __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_6, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 96; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; } __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; /* "pygame_sdl2/font.pyx":97 * bgsurf = rv.copy() * bgsurf.fill(background) * bgsurf.blit(rv, (0,0)) # <<<<<<<<<<<<<< * return bgsurf * return rv */ __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_bgsurf, __pyx_n_s_blit); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 97; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); __pyx_t_6 = NULL; __pyx_t_10 = 0; if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_5))) { __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_5); if (likely(__pyx_t_6)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5); __Pyx_INCREF(__pyx_t_6); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_5, function); __pyx_t_10 = 1; } } __pyx_t_3 = PyTuple_New(2+__pyx_t_10); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 97; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); if (__pyx_t_6) { __Pyx_GIVEREF(__pyx_t_6); PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_6); __pyx_t_6 = NULL; } __Pyx_INCREF(((PyObject *)__pyx_v_rv)); __Pyx_GIVEREF(((PyObject *)__pyx_v_rv)); PyTuple_SET_ITEM(__pyx_t_3, 0+__pyx_t_10, ((PyObject *)__pyx_v_rv)); __Pyx_INCREF(__pyx_tuple__7); __Pyx_GIVEREF(__pyx_tuple__7); PyTuple_SET_ITEM(__pyx_t_3, 1+__pyx_t_10, __pyx_tuple__7); __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_3, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 97; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; /* "pygame_sdl2/font.pyx":98 * bgsurf.fill(background) * bgsurf.blit(rv, (0,0)) * return bgsurf # <<<<<<<<<<<<<< * return rv * */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(__pyx_v_bgsurf); __pyx_r = __pyx_v_bgsurf; goto __pyx_L0; /* "pygame_sdl2/font.pyx":94 * rv = rv.convert() * * if background is not None: # <<<<<<<<<<<<<< * bgsurf = rv.copy() * bgsurf.fill(background) */ } /* "pygame_sdl2/font.pyx":99 * bgsurf.blit(rv, (0,0)) * return bgsurf * return rv # <<<<<<<<<<<<<< * * def size(self, text): */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(((PyObject *)__pyx_v_rv)); __pyx_r = ((PyObject *)__pyx_v_rv); goto __pyx_L0; /* "pygame_sdl2/font.pyx":69 * raise error() * * def render(self, text, antialias, color, background=None): # <<<<<<<<<<<<<< * cdef SDL_Surface *surf * cdef SDL_Color fg */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_5); __Pyx_XDECREF(__pyx_t_6); __Pyx_AddTraceback("pygame_sdl2.font.Font.render", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF(__pyx_v_w); __Pyx_XDECREF(__pyx_v_h); __Pyx_XDECREF((PyObject *)__pyx_v_rv); __Pyx_XDECREF(__pyx_v_bgsurf); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/font.pyx":101 * return rv * * def size(self, text): # <<<<<<<<<<<<<< * cdef int w, h * if TTF_SizeUTF8(self.font, text.encode('utf-8'), &w, &h) != 0: */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_4font_4Font_9size(PyObject *__pyx_v_self, PyObject *__pyx_v_text); /*proto*/ static PyObject *__pyx_pw_11pygame_sdl2_4font_4Font_9size(PyObject *__pyx_v_self, PyObject *__pyx_v_text) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("size (wrapper)", 0); __pyx_r = __pyx_pf_11pygame_sdl2_4font_4Font_8size(((struct __pyx_obj_11pygame_sdl2_4font_Font *)__pyx_v_self), ((PyObject *)__pyx_v_text)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_4font_4Font_8size(struct __pyx_obj_11pygame_sdl2_4font_Font *__pyx_v_self, PyObject *__pyx_v_text) { int __pyx_v_w; int __pyx_v_h; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; char const *__pyx_t_3; int __pyx_t_4; PyObject *__pyx_t_5 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("size", 0); /* "pygame_sdl2/font.pyx":103 * def size(self, text): * cdef int w, h * if TTF_SizeUTF8(self.font, text.encode('utf-8'), &w, &h) != 0: # <<<<<<<<<<<<<< * raise error() * return w, h */ __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_text, __pyx_n_s_encode); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 103; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_tuple__8, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 103; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_3 = __Pyx_PyObject_AsString(__pyx_t_2); if (unlikely((!__pyx_t_3) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 103; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_t_4 = ((TTF_SizeUTF8(__pyx_v_self->font, __pyx_t_3, (&__pyx_v_w), (&__pyx_v_h)) != 0) != 0); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; if (__pyx_t_4) { /* "pygame_sdl2/font.pyx":104 * cdef int w, h * if TTF_SizeUTF8(self.font, text.encode('utf-8'), &w, &h) != 0: * raise error() # <<<<<<<<<<<<<< * return w, h * */ __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_error); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 104; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_t_5 = NULL; if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_1))) { __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_1); if (likely(__pyx_t_5)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1); __Pyx_INCREF(__pyx_t_5); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_1, function); } } if (__pyx_t_5) { __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_1, __pyx_t_5); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 104; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; } else { __pyx_t_2 = __Pyx_PyObject_CallNoArg(__pyx_t_1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 104; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_Raise(__pyx_t_2, 0, 0, 0); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; {__pyx_filename = __pyx_f[0]; __pyx_lineno = 104; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "pygame_sdl2/font.pyx":103 * def size(self, text): * cdef int w, h * if TTF_SizeUTF8(self.font, text.encode('utf-8'), &w, &h) != 0: # <<<<<<<<<<<<<< * raise error() * return w, h */ } /* "pygame_sdl2/font.pyx":105 * if TTF_SizeUTF8(self.font, text.encode('utf-8'), &w, &h) != 0: * raise error() * return w, h # <<<<<<<<<<<<<< * * cdef set_style(self, flag, on): */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_v_w); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 105; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_h); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 105; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_t_5 = PyTuple_New(2); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 105; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); __Pyx_GIVEREF(__pyx_t_2); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_2); __Pyx_GIVEREF(__pyx_t_1); PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_t_1); __pyx_t_2 = 0; __pyx_t_1 = 0; __pyx_r = __pyx_t_5; __pyx_t_5 = 0; goto __pyx_L0; /* "pygame_sdl2/font.pyx":101 * return rv * * def size(self, text): # <<<<<<<<<<<<<< * cdef int w, h * if TTF_SizeUTF8(self.font, text.encode('utf-8'), &w, &h) != 0: */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_5); __Pyx_AddTraceback("pygame_sdl2.font.Font.size", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/font.pyx":107 * return w, h * * cdef set_style(self, flag, on): # <<<<<<<<<<<<<< * if on: * self.style |= flag */ static PyObject *__pyx_f_11pygame_sdl2_4font_4Font_set_style(struct __pyx_obj_11pygame_sdl2_4font_Font *__pyx_v_self, PyObject *__pyx_v_flag, PyObject *__pyx_v_on) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; int __pyx_t_4; PyObject *__pyx_t_5 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("set_style", 0); /* "pygame_sdl2/font.pyx":108 * * cdef set_style(self, flag, on): * if on: # <<<<<<<<<<<<<< * self.style |= flag * else: */ __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_on); if (unlikely(__pyx_t_1 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 108; __pyx_clineno = __LINE__; goto __pyx_L1_error;} if (__pyx_t_1) { /* "pygame_sdl2/font.pyx":109 * cdef set_style(self, flag, on): * if on: * self.style |= flag # <<<<<<<<<<<<<< * else: * self.style &= ~flag */ __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_v_self->style); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 109; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = PyNumber_InPlaceOr(__pyx_t_2, __pyx_v_flag); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 109; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_4 = __Pyx_PyInt_As_int(__pyx_t_3); if (unlikely((__pyx_t_4 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 109; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_v_self->style = __pyx_t_4; /* "pygame_sdl2/font.pyx":108 * * cdef set_style(self, flag, on): * if on: # <<<<<<<<<<<<<< * self.style |= flag * else: */ goto __pyx_L3; } /* "pygame_sdl2/font.pyx":111 * self.style |= flag * else: * self.style &= ~flag # <<<<<<<<<<<<<< * * def set_underline(self, on): */ /*else*/ { __pyx_t_3 = __Pyx_PyInt_From_int(__pyx_v_self->style); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 111; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __pyx_t_2 = PyNumber_Invert(__pyx_v_flag); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 111; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __pyx_t_5 = PyNumber_InPlaceAnd(__pyx_t_3, __pyx_t_2); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 111; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_4 = __Pyx_PyInt_As_int(__pyx_t_5); if (unlikely((__pyx_t_4 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 111; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __pyx_v_self->style = __pyx_t_4; } __pyx_L3:; /* "pygame_sdl2/font.pyx":107 * return w, h * * cdef set_style(self, flag, on): # <<<<<<<<<<<<<< * if on: * self.style |= flag */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_5); __Pyx_AddTraceback("pygame_sdl2.font.Font.set_style", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/font.pyx":113 * self.style &= ~flag * * def set_underline(self, on): # <<<<<<<<<<<<<< * self.set_style(TTF_STYLE_UNDERLINE, on) * */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_4font_4Font_11set_underline(PyObject *__pyx_v_self, PyObject *__pyx_v_on); /*proto*/ static PyObject *__pyx_pw_11pygame_sdl2_4font_4Font_11set_underline(PyObject *__pyx_v_self, PyObject *__pyx_v_on) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("set_underline (wrapper)", 0); __pyx_r = __pyx_pf_11pygame_sdl2_4font_4Font_10set_underline(((struct __pyx_obj_11pygame_sdl2_4font_Font *)__pyx_v_self), ((PyObject *)__pyx_v_on)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_4font_4Font_10set_underline(struct __pyx_obj_11pygame_sdl2_4font_Font *__pyx_v_self, PyObject *__pyx_v_on) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("set_underline", 0); /* "pygame_sdl2/font.pyx":114 * * def set_underline(self, on): * self.set_style(TTF_STYLE_UNDERLINE, on) # <<<<<<<<<<<<<< * * def get_underline(self): */ __pyx_t_1 = __Pyx_PyInt_From_int(TTF_STYLE_UNDERLINE); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 114; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = ((struct __pyx_vtabstruct_11pygame_sdl2_4font_Font *)__pyx_v_self->__pyx_vtab)->set_style(__pyx_v_self, __pyx_t_1, __pyx_v_on); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 114; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "pygame_sdl2/font.pyx":113 * self.style &= ~flag * * def set_underline(self, on): # <<<<<<<<<<<<<< * self.set_style(TTF_STYLE_UNDERLINE, on) * */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_AddTraceback("pygame_sdl2.font.Font.set_underline", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/font.pyx":116 * self.set_style(TTF_STYLE_UNDERLINE, on) * * def get_underline(self): # <<<<<<<<<<<<<< * return self.style & TTF_STYLE_UNDERLINE * */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_4font_4Font_13get_underline(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/ static PyObject *__pyx_pw_11pygame_sdl2_4font_4Font_13get_underline(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("get_underline (wrapper)", 0); __pyx_r = __pyx_pf_11pygame_sdl2_4font_4Font_12get_underline(((struct __pyx_obj_11pygame_sdl2_4font_Font *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_4font_4Font_12get_underline(struct __pyx_obj_11pygame_sdl2_4font_Font *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("get_underline", 0); /* "pygame_sdl2/font.pyx":117 * * def get_underline(self): * return self.style & TTF_STYLE_UNDERLINE # <<<<<<<<<<<<<< * * def set_bold(self, on): */ __Pyx_XDECREF(__pyx_r); __pyx_t_1 = __Pyx_PyInt_From_int((__pyx_v_self->style & TTF_STYLE_UNDERLINE)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 117; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "pygame_sdl2/font.pyx":116 * self.set_style(TTF_STYLE_UNDERLINE, on) * * def get_underline(self): # <<<<<<<<<<<<<< * return self.style & TTF_STYLE_UNDERLINE * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("pygame_sdl2.font.Font.get_underline", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/font.pyx":119 * return self.style & TTF_STYLE_UNDERLINE * * def set_bold(self, on): # <<<<<<<<<<<<<< * self.set_style(TTF_STYLE_BOLD, on) * */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_4font_4Font_15set_bold(PyObject *__pyx_v_self, PyObject *__pyx_v_on); /*proto*/ static PyObject *__pyx_pw_11pygame_sdl2_4font_4Font_15set_bold(PyObject *__pyx_v_self, PyObject *__pyx_v_on) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("set_bold (wrapper)", 0); __pyx_r = __pyx_pf_11pygame_sdl2_4font_4Font_14set_bold(((struct __pyx_obj_11pygame_sdl2_4font_Font *)__pyx_v_self), ((PyObject *)__pyx_v_on)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_4font_4Font_14set_bold(struct __pyx_obj_11pygame_sdl2_4font_Font *__pyx_v_self, PyObject *__pyx_v_on) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("set_bold", 0); /* "pygame_sdl2/font.pyx":120 * * def set_bold(self, on): * self.set_style(TTF_STYLE_BOLD, on) # <<<<<<<<<<<<<< * * def get_bold(self): */ __pyx_t_1 = __Pyx_PyInt_From_int(TTF_STYLE_BOLD); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 120; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = ((struct __pyx_vtabstruct_11pygame_sdl2_4font_Font *)__pyx_v_self->__pyx_vtab)->set_style(__pyx_v_self, __pyx_t_1, __pyx_v_on); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 120; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "pygame_sdl2/font.pyx":119 * return self.style & TTF_STYLE_UNDERLINE * * def set_bold(self, on): # <<<<<<<<<<<<<< * self.set_style(TTF_STYLE_BOLD, on) * */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_AddTraceback("pygame_sdl2.font.Font.set_bold", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/font.pyx":122 * self.set_style(TTF_STYLE_BOLD, on) * * def get_bold(self): # <<<<<<<<<<<<<< * return self.style & TTF_STYLE_BOLD * */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_4font_4Font_17get_bold(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/ static PyObject *__pyx_pw_11pygame_sdl2_4font_4Font_17get_bold(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("get_bold (wrapper)", 0); __pyx_r = __pyx_pf_11pygame_sdl2_4font_4Font_16get_bold(((struct __pyx_obj_11pygame_sdl2_4font_Font *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_4font_4Font_16get_bold(struct __pyx_obj_11pygame_sdl2_4font_Font *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("get_bold", 0); /* "pygame_sdl2/font.pyx":123 * * def get_bold(self): * return self.style & TTF_STYLE_BOLD # <<<<<<<<<<<<<< * * def set_italic(self, on): */ __Pyx_XDECREF(__pyx_r); __pyx_t_1 = __Pyx_PyInt_From_int((__pyx_v_self->style & TTF_STYLE_BOLD)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 123; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "pygame_sdl2/font.pyx":122 * self.set_style(TTF_STYLE_BOLD, on) * * def get_bold(self): # <<<<<<<<<<<<<< * return self.style & TTF_STYLE_BOLD * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("pygame_sdl2.font.Font.get_bold", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/font.pyx":125 * return self.style & TTF_STYLE_BOLD * * def set_italic(self, on): # <<<<<<<<<<<<<< * self.set_style(TTF_STYLE_ITALIC, on) * */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_4font_4Font_19set_italic(PyObject *__pyx_v_self, PyObject *__pyx_v_on); /*proto*/ static PyObject *__pyx_pw_11pygame_sdl2_4font_4Font_19set_italic(PyObject *__pyx_v_self, PyObject *__pyx_v_on) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("set_italic (wrapper)", 0); __pyx_r = __pyx_pf_11pygame_sdl2_4font_4Font_18set_italic(((struct __pyx_obj_11pygame_sdl2_4font_Font *)__pyx_v_self), ((PyObject *)__pyx_v_on)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_4font_4Font_18set_italic(struct __pyx_obj_11pygame_sdl2_4font_Font *__pyx_v_self, PyObject *__pyx_v_on) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("set_italic", 0); /* "pygame_sdl2/font.pyx":126 * * def set_italic(self, on): * self.set_style(TTF_STYLE_ITALIC, on) # <<<<<<<<<<<<<< * * def get_italic(self): */ __pyx_t_1 = __Pyx_PyInt_From_int(TTF_STYLE_ITALIC); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 126; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = ((struct __pyx_vtabstruct_11pygame_sdl2_4font_Font *)__pyx_v_self->__pyx_vtab)->set_style(__pyx_v_self, __pyx_t_1, __pyx_v_on); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 126; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "pygame_sdl2/font.pyx":125 * return self.style & TTF_STYLE_BOLD * * def set_italic(self, on): # <<<<<<<<<<<<<< * self.set_style(TTF_STYLE_ITALIC, on) * */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_AddTraceback("pygame_sdl2.font.Font.set_italic", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/font.pyx":128 * self.set_style(TTF_STYLE_ITALIC, on) * * def get_italic(self): # <<<<<<<<<<<<<< * return self.style & TTF_STYLE_ITALIC * */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_4font_4Font_21get_italic(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/ static PyObject *__pyx_pw_11pygame_sdl2_4font_4Font_21get_italic(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("get_italic (wrapper)", 0); __pyx_r = __pyx_pf_11pygame_sdl2_4font_4Font_20get_italic(((struct __pyx_obj_11pygame_sdl2_4font_Font *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_4font_4Font_20get_italic(struct __pyx_obj_11pygame_sdl2_4font_Font *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("get_italic", 0); /* "pygame_sdl2/font.pyx":129 * * def get_italic(self): * return self.style & TTF_STYLE_ITALIC # <<<<<<<<<<<<<< * * def get_linesize(self): */ __Pyx_XDECREF(__pyx_r); __pyx_t_1 = __Pyx_PyInt_From_int((__pyx_v_self->style & TTF_STYLE_ITALIC)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 129; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "pygame_sdl2/font.pyx":128 * self.set_style(TTF_STYLE_ITALIC, on) * * def get_italic(self): # <<<<<<<<<<<<<< * return self.style & TTF_STYLE_ITALIC * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("pygame_sdl2.font.Font.get_italic", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/font.pyx":131 * return self.style & TTF_STYLE_ITALIC * * def get_linesize(self): # <<<<<<<<<<<<<< * return TTF_FontLineSkip(self.font) * */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_4font_4Font_23get_linesize(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/ static PyObject *__pyx_pw_11pygame_sdl2_4font_4Font_23get_linesize(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("get_linesize (wrapper)", 0); __pyx_r = __pyx_pf_11pygame_sdl2_4font_4Font_22get_linesize(((struct __pyx_obj_11pygame_sdl2_4font_Font *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_4font_4Font_22get_linesize(struct __pyx_obj_11pygame_sdl2_4font_Font *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("get_linesize", 0); /* "pygame_sdl2/font.pyx":132 * * def get_linesize(self): * return TTF_FontLineSkip(self.font) # <<<<<<<<<<<<<< * * def get_height(self): */ __Pyx_XDECREF(__pyx_r); __pyx_t_1 = __Pyx_PyInt_From_int(TTF_FontLineSkip(__pyx_v_self->font)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 132; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "pygame_sdl2/font.pyx":131 * return self.style & TTF_STYLE_ITALIC * * def get_linesize(self): # <<<<<<<<<<<<<< * return TTF_FontLineSkip(self.font) * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("pygame_sdl2.font.Font.get_linesize", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/font.pyx":134 * return TTF_FontLineSkip(self.font) * * def get_height(self): # <<<<<<<<<<<<<< * return TTF_FontHeight(self.font) * */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_4font_4Font_25get_height(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/ static PyObject *__pyx_pw_11pygame_sdl2_4font_4Font_25get_height(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("get_height (wrapper)", 0); __pyx_r = __pyx_pf_11pygame_sdl2_4font_4Font_24get_height(((struct __pyx_obj_11pygame_sdl2_4font_Font *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_4font_4Font_24get_height(struct __pyx_obj_11pygame_sdl2_4font_Font *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("get_height", 0); /* "pygame_sdl2/font.pyx":135 * * def get_height(self): * return TTF_FontHeight(self.font) # <<<<<<<<<<<<<< * * def get_ascent(self): */ __Pyx_XDECREF(__pyx_r); __pyx_t_1 = __Pyx_PyInt_From_int(TTF_FontHeight(__pyx_v_self->font)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 135; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "pygame_sdl2/font.pyx":134 * return TTF_FontLineSkip(self.font) * * def get_height(self): # <<<<<<<<<<<<<< * return TTF_FontHeight(self.font) * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("pygame_sdl2.font.Font.get_height", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/font.pyx":137 * return TTF_FontHeight(self.font) * * def get_ascent(self): # <<<<<<<<<<<<<< * return TTF_FontAscent(self.font) * */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_4font_4Font_27get_ascent(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/ static PyObject *__pyx_pw_11pygame_sdl2_4font_4Font_27get_ascent(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("get_ascent (wrapper)", 0); __pyx_r = __pyx_pf_11pygame_sdl2_4font_4Font_26get_ascent(((struct __pyx_obj_11pygame_sdl2_4font_Font *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_4font_4Font_26get_ascent(struct __pyx_obj_11pygame_sdl2_4font_Font *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("get_ascent", 0); /* "pygame_sdl2/font.pyx":138 * * def get_ascent(self): * return TTF_FontAscent(self.font) # <<<<<<<<<<<<<< * * def get_descent(self): */ __Pyx_XDECREF(__pyx_r); __pyx_t_1 = __Pyx_PyInt_From_int(TTF_FontAscent(__pyx_v_self->font)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 138; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "pygame_sdl2/font.pyx":137 * return TTF_FontHeight(self.font) * * def get_ascent(self): # <<<<<<<<<<<<<< * return TTF_FontAscent(self.font) * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("pygame_sdl2.font.Font.get_ascent", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/font.pyx":140 * return TTF_FontAscent(self.font) * * def get_descent(self): # <<<<<<<<<<<<<< * return TTF_FontDescent(self.font) * */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_4font_4Font_29get_descent(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/ static PyObject *__pyx_pw_11pygame_sdl2_4font_4Font_29get_descent(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("get_descent (wrapper)", 0); __pyx_r = __pyx_pf_11pygame_sdl2_4font_4Font_28get_descent(((struct __pyx_obj_11pygame_sdl2_4font_Font *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_4font_4Font_28get_descent(struct __pyx_obj_11pygame_sdl2_4font_Font *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("get_descent", 0); /* "pygame_sdl2/font.pyx":141 * * def get_descent(self): * return TTF_FontDescent(self.font) # <<<<<<<<<<<<<< * * def metrics(self, text not None): */ __Pyx_XDECREF(__pyx_r); __pyx_t_1 = __Pyx_PyInt_From_int(TTF_FontDescent(__pyx_v_self->font)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 141; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "pygame_sdl2/font.pyx":140 * return TTF_FontAscent(self.font) * * def get_descent(self): # <<<<<<<<<<<<<< * return TTF_FontDescent(self.font) * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("pygame_sdl2.font.Font.get_descent", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/font.pyx":143 * return TTF_FontDescent(self.font) * * def metrics(self, text not None): # <<<<<<<<<<<<<< * cdef int minx, maxx, miny, maxy, advance * cdef uint16_t chnum */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_4font_4Font_31metrics(PyObject *__pyx_v_self, PyObject *__pyx_v_text); /*proto*/ static PyObject *__pyx_pw_11pygame_sdl2_4font_4Font_31metrics(PyObject *__pyx_v_self, PyObject *__pyx_v_text) { CYTHON_UNUSED int __pyx_lineno = 0; CYTHON_UNUSED const char *__pyx_filename = NULL; CYTHON_UNUSED int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("metrics (wrapper)", 0); if (unlikely(((PyObject *)__pyx_v_text) == Py_None)) { PyErr_Format(PyExc_TypeError, "Argument '%.200s' must not be None", "text"); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 143; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } __pyx_r = __pyx_pf_11pygame_sdl2_4font_4Font_30metrics(((struct __pyx_obj_11pygame_sdl2_4font_Font *)__pyx_v_self), ((PyObject *)__pyx_v_text)); /* function exit code */ goto __pyx_L0; __pyx_L1_error:; __pyx_r = NULL; __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_4font_4Font_30metrics(struct __pyx_obj_11pygame_sdl2_4font_Font *__pyx_v_self, PyObject *__pyx_v_text) { int __pyx_v_minx; int __pyx_v_maxx; int __pyx_v_miny; int __pyx_v_maxy; int __pyx_v_advance; uint16_t __pyx_v_chnum; PyObject *__pyx_v_rv = NULL; PyObject *__pyx_v_ch = NULL; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; Py_ssize_t __pyx_t_2; PyObject *(*__pyx_t_3)(PyObject *); PyObject *__pyx_t_4 = NULL; long __pyx_t_5; int __pyx_t_6; PyObject *__pyx_t_7 = NULL; PyObject *__pyx_t_8 = NULL; PyObject *__pyx_t_9 = NULL; PyObject *__pyx_t_10 = NULL; PyObject *__pyx_t_11 = NULL; int __pyx_t_12; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("metrics", 0); /* "pygame_sdl2/font.pyx":146 * cdef int minx, maxx, miny, maxy, advance * cdef uint16_t chnum * rv = [] # <<<<<<<<<<<<<< * * for ch in text: */ __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 146; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_v_rv = ((PyObject*)__pyx_t_1); __pyx_t_1 = 0; /* "pygame_sdl2/font.pyx":148 * rv = [] * * for ch in text: # <<<<<<<<<<<<<< * chnum = ord(ch) * */ if (likely(PyList_CheckExact(__pyx_v_text)) || PyTuple_CheckExact(__pyx_v_text)) { __pyx_t_1 = __pyx_v_text; __Pyx_INCREF(__pyx_t_1); __pyx_t_2 = 0; __pyx_t_3 = NULL; } else { __pyx_t_2 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_v_text); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 148; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_t_3 = Py_TYPE(__pyx_t_1)->tp_iternext; if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 148; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } for (;;) { if (likely(!__pyx_t_3)) { if (likely(PyList_CheckExact(__pyx_t_1))) { if (__pyx_t_2 >= PyList_GET_SIZE(__pyx_t_1)) break; #if CYTHON_COMPILING_IN_CPYTHON __pyx_t_4 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_2); __Pyx_INCREF(__pyx_t_4); __pyx_t_2++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 148; __pyx_clineno = __LINE__; goto __pyx_L1_error;} #else __pyx_t_4 = PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 148; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); #endif } else { if (__pyx_t_2 >= PyTuple_GET_SIZE(__pyx_t_1)) break; #if CYTHON_COMPILING_IN_CPYTHON __pyx_t_4 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_2); __Pyx_INCREF(__pyx_t_4); __pyx_t_2++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 148; __pyx_clineno = __LINE__; goto __pyx_L1_error;} #else __pyx_t_4 = PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 148; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); #endif } } else { __pyx_t_4 = __pyx_t_3(__pyx_t_1); if (unlikely(!__pyx_t_4)) { PyObject* exc_type = PyErr_Occurred(); if (exc_type) { if (likely(exc_type == PyExc_StopIteration || PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); else {__pyx_filename = __pyx_f[0]; __pyx_lineno = 148; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } break; } __Pyx_GOTREF(__pyx_t_4); } __Pyx_XDECREF_SET(__pyx_v_ch, __pyx_t_4); __pyx_t_4 = 0; /* "pygame_sdl2/font.pyx":149 * * for ch in text: * chnum = ord(ch) # <<<<<<<<<<<<<< * * if TTF_GlyphMetrics(self.font, chnum, &minx, &maxx, &miny, &maxy, &advance) == 0: */ __pyx_t_5 = __Pyx_PyObject_Ord(__pyx_v_ch); if (unlikely(__pyx_t_5 == (long)(Py_UCS4)-1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 149; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_v_chnum = __pyx_t_5; /* "pygame_sdl2/font.pyx":151 * chnum = ord(ch) * * if TTF_GlyphMetrics(self.font, chnum, &minx, &maxx, &miny, &maxy, &advance) == 0: # <<<<<<<<<<<<<< * rv.append((minx, maxx, miny, maxy, advance)) * else: */ __pyx_t_6 = ((TTF_GlyphMetrics(__pyx_v_self->font, __pyx_v_chnum, (&__pyx_v_minx), (&__pyx_v_maxx), (&__pyx_v_miny), (&__pyx_v_maxy), (&__pyx_v_advance)) == 0) != 0); if (__pyx_t_6) { /* "pygame_sdl2/font.pyx":152 * * if TTF_GlyphMetrics(self.font, chnum, &minx, &maxx, &miny, &maxy, &advance) == 0: * rv.append((minx, maxx, miny, maxy, advance)) # <<<<<<<<<<<<<< * else: * rv.append(None) */ __pyx_t_4 = __Pyx_PyInt_From_int(__pyx_v_minx); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 152; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); __pyx_t_7 = __Pyx_PyInt_From_int(__pyx_v_maxx); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 152; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_7); __pyx_t_8 = __Pyx_PyInt_From_int(__pyx_v_miny); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 152; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_8); __pyx_t_9 = __Pyx_PyInt_From_int(__pyx_v_maxy); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 152; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_9); __pyx_t_10 = __Pyx_PyInt_From_int(__pyx_v_advance); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 152; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_10); __pyx_t_11 = PyTuple_New(5); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 152; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_11); __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_11, 0, __pyx_t_4); __Pyx_GIVEREF(__pyx_t_7); PyTuple_SET_ITEM(__pyx_t_11, 1, __pyx_t_7); __Pyx_GIVEREF(__pyx_t_8); PyTuple_SET_ITEM(__pyx_t_11, 2, __pyx_t_8); __Pyx_GIVEREF(__pyx_t_9); PyTuple_SET_ITEM(__pyx_t_11, 3, __pyx_t_9); __Pyx_GIVEREF(__pyx_t_10); PyTuple_SET_ITEM(__pyx_t_11, 4, __pyx_t_10); __pyx_t_4 = 0; __pyx_t_7 = 0; __pyx_t_8 = 0; __pyx_t_9 = 0; __pyx_t_10 = 0; __pyx_t_12 = __Pyx_PyList_Append(__pyx_v_rv, __pyx_t_11); if (unlikely(__pyx_t_12 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 152; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; /* "pygame_sdl2/font.pyx":151 * chnum = ord(ch) * * if TTF_GlyphMetrics(self.font, chnum, &minx, &maxx, &miny, &maxy, &advance) == 0: # <<<<<<<<<<<<<< * rv.append((minx, maxx, miny, maxy, advance)) * else: */ goto __pyx_L5; } /* "pygame_sdl2/font.pyx":154 * rv.append((minx, maxx, miny, maxy, advance)) * else: * rv.append(None) # <<<<<<<<<<<<<< * * return rv */ /*else*/ { __pyx_t_12 = __Pyx_PyList_Append(__pyx_v_rv, Py_None); if (unlikely(__pyx_t_12 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 154; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } __pyx_L5:; /* "pygame_sdl2/font.pyx":148 * rv = [] * * for ch in text: # <<<<<<<<<<<<<< * chnum = ord(ch) * */ } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "pygame_sdl2/font.pyx":156 * rv.append(None) * * return rv # <<<<<<<<<<<<<< */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(__pyx_v_rv); __pyx_r = __pyx_v_rv; goto __pyx_L0; /* "pygame_sdl2/font.pyx":143 * return TTF_FontDescent(self.font) * * def metrics(self, text not None): # <<<<<<<<<<<<<< * cdef int minx, maxx, miny, maxy, advance * cdef uint16_t chnum */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_7); __Pyx_XDECREF(__pyx_t_8); __Pyx_XDECREF(__pyx_t_9); __Pyx_XDECREF(__pyx_t_10); __Pyx_XDECREF(__pyx_t_11); __Pyx_AddTraceback("pygame_sdl2.font.Font.metrics", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF(__pyx_v_rv); __Pyx_XDECREF(__pyx_v_ch); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } static struct __pyx_vtabstruct_11pygame_sdl2_4font_Font __pyx_vtable_11pygame_sdl2_4font_Font; static PyObject *__pyx_tp_new_11pygame_sdl2_4font_Font(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) { struct __pyx_obj_11pygame_sdl2_4font_Font *p; PyObject *o; if (likely((t->tp_flags & Py_TPFLAGS_IS_ABSTRACT) == 0)) { o = (*t->tp_alloc)(t, 0); } else { o = (PyObject *) PyBaseObject_Type.tp_new(t, __pyx_empty_tuple, 0); } if (unlikely(!o)) return 0; p = ((struct __pyx_obj_11pygame_sdl2_4font_Font *)o); p->__pyx_vtab = __pyx_vtabptr_11pygame_sdl2_4font_Font; if (unlikely(__pyx_pw_11pygame_sdl2_4font_4Font_1__cinit__(o, __pyx_empty_tuple, NULL) < 0)) { Py_DECREF(o); o = 0; } return o; } static void __pyx_tp_dealloc_11pygame_sdl2_4font_Font(PyObject *o) { #if PY_VERSION_HEX >= 0x030400a1 if (unlikely(Py_TYPE(o)->tp_finalize) && (!PyType_IS_GC(Py_TYPE(o)) || !_PyGC_FINALIZED(o))) { if (PyObject_CallFinalizerFromDealloc(o)) return; } #endif { PyObject *etype, *eval, *etb; PyErr_Fetch(&etype, &eval, &etb); ++Py_REFCNT(o); __pyx_pw_11pygame_sdl2_4font_4Font_3__dealloc__(o); --Py_REFCNT(o); PyErr_Restore(etype, eval, etb); } (*Py_TYPE(o)->tp_free)(o); } static PyMethodDef __pyx_methods_11pygame_sdl2_4font_Font[] = { {"render", (PyCFunction)__pyx_pw_11pygame_sdl2_4font_4Font_7render, METH_VARARGS|METH_KEYWORDS, 0}, {"size", (PyCFunction)__pyx_pw_11pygame_sdl2_4font_4Font_9size, METH_O, 0}, {"set_underline", (PyCFunction)__pyx_pw_11pygame_sdl2_4font_4Font_11set_underline, METH_O, 0}, {"get_underline", (PyCFunction)__pyx_pw_11pygame_sdl2_4font_4Font_13get_underline, METH_NOARGS, 0}, {"set_bold", (PyCFunction)__pyx_pw_11pygame_sdl2_4font_4Font_15set_bold, METH_O, 0}, {"get_bold", (PyCFunction)__pyx_pw_11pygame_sdl2_4font_4Font_17get_bold, METH_NOARGS, 0}, {"set_italic", (PyCFunction)__pyx_pw_11pygame_sdl2_4font_4Font_19set_italic, METH_O, 0}, {"get_italic", (PyCFunction)__pyx_pw_11pygame_sdl2_4font_4Font_21get_italic, METH_NOARGS, 0}, {"get_linesize", (PyCFunction)__pyx_pw_11pygame_sdl2_4font_4Font_23get_linesize, METH_NOARGS, 0}, {"get_height", (PyCFunction)__pyx_pw_11pygame_sdl2_4font_4Font_25get_height, METH_NOARGS, 0}, {"get_ascent", (PyCFunction)__pyx_pw_11pygame_sdl2_4font_4Font_27get_ascent, METH_NOARGS, 0}, {"get_descent", (PyCFunction)__pyx_pw_11pygame_sdl2_4font_4Font_29get_descent, METH_NOARGS, 0}, {"metrics", (PyCFunction)__pyx_pw_11pygame_sdl2_4font_4Font_31metrics, METH_O, 0}, {0, 0, 0, 0} }; static PyTypeObject __pyx_type_11pygame_sdl2_4font_Font = { PyVarObject_HEAD_INIT(0, 0) "pygame_sdl2.font.Font", /*tp_name*/ sizeof(struct __pyx_obj_11pygame_sdl2_4font_Font), /*tp_basicsize*/ 0, /*tp_itemsize*/ __pyx_tp_dealloc_11pygame_sdl2_4font_Font, /*tp_dealloc*/ 0, /*tp_print*/ 0, /*tp_getattr*/ 0, /*tp_setattr*/ #if PY_MAJOR_VERSION < 3 0, /*tp_compare*/ #endif #if PY_MAJOR_VERSION >= 3 0, /*tp_as_async*/ #endif 0, /*tp_repr*/ 0, /*tp_as_number*/ 0, /*tp_as_sequence*/ 0, /*tp_as_mapping*/ 0, /*tp_hash*/ 0, /*tp_call*/ 0, /*tp_str*/ 0, /*tp_getattro*/ 0, /*tp_setattro*/ 0, /*tp_as_buffer*/ Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE, /*tp_flags*/ 0, /*tp_doc*/ 0, /*tp_traverse*/ 0, /*tp_clear*/ 0, /*tp_richcompare*/ 0, /*tp_weaklistoffset*/ 0, /*tp_iter*/ 0, /*tp_iternext*/ __pyx_methods_11pygame_sdl2_4font_Font, /*tp_methods*/ 0, /*tp_members*/ 0, /*tp_getset*/ 0, /*tp_base*/ 0, /*tp_dict*/ 0, /*tp_descr_get*/ 0, /*tp_descr_set*/ 0, /*tp_dictoffset*/ __pyx_pw_11pygame_sdl2_4font_4Font_5__init__, /*tp_init*/ 0, /*tp_alloc*/ __pyx_tp_new_11pygame_sdl2_4font_Font, /*tp_new*/ 0, /*tp_free*/ 0, /*tp_is_gc*/ 0, /*tp_bases*/ 0, /*tp_mro*/ 0, /*tp_cache*/ 0, /*tp_subclasses*/ 0, /*tp_weaklist*/ 0, /*tp_del*/ 0, /*tp_version_tag*/ #if PY_VERSION_HEX >= 0x030400a1 0, /*tp_finalize*/ #endif }; static PyMethodDef __pyx_methods[] = { {0, 0, 0, 0} }; #if PY_MAJOR_VERSION >= 3 static struct PyModuleDef __pyx_moduledef = { #if PY_VERSION_HEX < 0x03020000 { PyObject_HEAD_INIT(NULL) NULL, 0, NULL }, #else PyModuleDef_HEAD_INIT, #endif "font", 0, /* m_doc */ -1, /* m_size */ __pyx_methods /* m_methods */, NULL, /* m_reload */ NULL, /* m_traverse */ NULL, /* m_clear */ NULL /* m_free */ }; #endif static __Pyx_StringTabEntry __pyx_string_tab[] = { {&__pyx_kp_u_DejaVuSans_ttf, __pyx_k_DejaVuSans_ttf, sizeof(__pyx_k_DejaVuSans_ttf), 0, 1, 0, 0}, {&__pyx_n_s_SysFont, __pyx_k_SysFont, sizeof(__pyx_k_SysFont), 0, 0, 1, 1}, {&__pyx_kp_u__2, __pyx_k__2, sizeof(__pyx_k__2), 0, 1, 0, 0}, {&__pyx_n_s_antialias, __pyx_k_antialias, sizeof(__pyx_k_antialias), 0, 0, 1, 1}, {&__pyx_n_s_background, __pyx_k_background, sizeof(__pyx_k_background), 0, 0, 1, 1}, {&__pyx_n_s_blit, __pyx_k_blit, sizeof(__pyx_k_blit), 0, 0, 1, 1}, {&__pyx_n_s_color, __pyx_k_color, sizeof(__pyx_k_color), 0, 0, 1, 1}, {&__pyx_n_s_convert, __pyx_k_convert, sizeof(__pyx_k_convert), 0, 0, 1, 1}, {&__pyx_n_s_copy, __pyx_k_copy, sizeof(__pyx_k_copy), 0, 0, 1, 1}, {&__pyx_n_s_default, __pyx_k_default, sizeof(__pyx_k_default), 0, 0, 1, 1}, {&__pyx_n_s_dirname, __pyx_k_dirname, sizeof(__pyx_k_dirname), 0, 0, 1, 1}, {&__pyx_n_s_encode, __pyx_k_encode, sizeof(__pyx_k_encode), 0, 0, 1, 1}, {&__pyx_n_s_error, __pyx_k_error, sizeof(__pyx_k_error), 0, 0, 1, 1}, {&__pyx_n_s_exists, __pyx_k_exists, sizeof(__pyx_k_exists), 0, 0, 1, 1}, {&__pyx_n_s_fi, __pyx_k_fi, sizeof(__pyx_k_fi), 0, 0, 1, 1}, {&__pyx_n_s_file, __pyx_k_file, sizeof(__pyx_k_file), 0, 0, 1, 1}, {&__pyx_n_s_fill, __pyx_k_fill, sizeof(__pyx_k_fill), 0, 0, 1, 1}, {&__pyx_n_s_get_default_font, __pyx_k_get_default_font, sizeof(__pyx_k_get_default_font), 0, 0, 1, 1}, {&__pyx_n_s_get_fonts, __pyx_k_get_fonts, sizeof(__pyx_k_get_fonts), 0, 0, 1, 1}, {&__pyx_n_s_get_init, __pyx_k_get_init, sizeof(__pyx_k_get_init), 0, 0, 1, 1}, {&__pyx_kp_s_home_tom_ab_pygame_sdl2_src_pyg, __pyx_k_home_tom_ab_pygame_sdl2_src_pyg, sizeof(__pyx_k_home_tom_ab_pygame_sdl2_src_pyg), 0, 0, 1, 0}, {&__pyx_n_s_import, __pyx_k_import, sizeof(__pyx_k_import), 0, 0, 1, 1}, {&__pyx_n_s_init, __pyx_k_init, sizeof(__pyx_k_init), 0, 0, 1, 1}, {&__pyx_n_s_join, __pyx_k_join, sizeof(__pyx_k_join), 0, 0, 1, 1}, {&__pyx_n_s_main, __pyx_k_main, sizeof(__pyx_k_main), 0, 0, 1, 1}, {&__pyx_n_s_match_font, __pyx_k_match_font, sizeof(__pyx_k_match_font), 0, 0, 1, 1}, {&__pyx_n_s_os, __pyx_k_os, sizeof(__pyx_k_os), 0, 0, 1, 1}, {&__pyx_n_s_path, __pyx_k_path, sizeof(__pyx_k_path), 0, 0, 1, 1}, {&__pyx_n_s_pygame_sdl2, __pyx_k_pygame_sdl2, sizeof(__pyx_k_pygame_sdl2), 0, 0, 1, 1}, {&__pyx_n_s_pygame_sdl2_error, __pyx_k_pygame_sdl2_error, sizeof(__pyx_k_pygame_sdl2_error), 0, 0, 1, 1}, {&__pyx_n_s_pygame_sdl2_font, __pyx_k_pygame_sdl2_font, sizeof(__pyx_k_pygame_sdl2_font), 0, 0, 1, 1}, {&__pyx_n_s_pygame_sdl2_sysfont, __pyx_k_pygame_sdl2_sysfont, sizeof(__pyx_k_pygame_sdl2_sysfont), 0, 0, 1, 1}, {&__pyx_n_s_pyx_vtable, __pyx_k_pyx_vtable, sizeof(__pyx_k_pyx_vtable), 0, 0, 1, 1}, {&__pyx_n_s_quit, __pyx_k_quit, sizeof(__pyx_k_quit), 0, 0, 1, 1}, {&__pyx_n_s_register_init, __pyx_k_register_init, sizeof(__pyx_k_register_init), 0, 0, 1, 1}, {&__pyx_n_s_register_quit, __pyx_k_register_quit, sizeof(__pyx_k_register_quit), 0, 0, 1, 1}, {&__pyx_n_u_sans, __pyx_k_sans, sizeof(__pyx_k_sans), 0, 1, 0, 1}, {&__pyx_n_s_size, __pyx_k_size, sizeof(__pyx_k_size), 0, 0, 1, 1}, {&__pyx_n_s_test, __pyx_k_test, sizeof(__pyx_k_test), 0, 0, 1, 1}, {&__pyx_n_s_text, __pyx_k_text, sizeof(__pyx_k_text), 0, 0, 1, 1}, {&__pyx_kp_u_utf_8, __pyx_k_utf_8, sizeof(__pyx_k_utf_8), 0, 1, 0, 0}, {0, 0, 0, 0, 0, 0, 0} }; static int __Pyx_InitCachedBuiltins(void) { return 0; } static int __Pyx_InitCachedConstants(void) { __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__Pyx_InitCachedConstants", 0); /* "pygame_sdl2/font.pyx":48 * return default * * return match_font("sans") # <<<<<<<<<<<<<< * * cdef class Font: */ __pyx_tuple_ = PyTuple_Pack(1, __pyx_n_u_sans); if (unlikely(!__pyx_tuple_)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 48; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_tuple_); __Pyx_GIVEREF(__pyx_tuple_); /* "pygame_sdl2/font.pyx":74 * * if not text: * w, h = self.size(" ") # <<<<<<<<<<<<<< * return Surface((0, h)) * */ __pyx_tuple__3 = PyTuple_Pack(1, __pyx_kp_u__2); if (unlikely(!__pyx_tuple__3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 74; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_tuple__3); __Pyx_GIVEREF(__pyx_tuple__3); /* "pygame_sdl2/font.pyx":81 * TTF_SetFontStyle(self.font, self.style) * if antialias: * surf = TTF_RenderUTF8_Blended(self.font, text.encode('utf-8'), fg) # <<<<<<<<<<<<<< * else: * surf = TTF_RenderUTF8_Solid(self.font, text.encode('utf-8'), fg) */ __pyx_tuple__4 = PyTuple_Pack(1, __pyx_kp_u_utf_8); if (unlikely(!__pyx_tuple__4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 81; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_tuple__4); __Pyx_GIVEREF(__pyx_tuple__4); /* "pygame_sdl2/font.pyx":83 * surf = TTF_RenderUTF8_Blended(self.font, text.encode('utf-8'), fg) * else: * surf = TTF_RenderUTF8_Solid(self.font, text.encode('utf-8'), fg) # <<<<<<<<<<<<<< * * if surf == NULL: */ __pyx_tuple__5 = PyTuple_Pack(1, __pyx_kp_u_utf_8); if (unlikely(!__pyx_tuple__5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 83; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_tuple__5); __Pyx_GIVEREF(__pyx_tuple__5); /* "pygame_sdl2/font.pyx":88 * raise error() * * cdef Surface rv = Surface(()) # <<<<<<<<<<<<<< * rv.take_surface(surf) * */ __pyx_tuple__6 = PyTuple_Pack(1, __pyx_empty_tuple); if (unlikely(!__pyx_tuple__6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 88; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_tuple__6); __Pyx_GIVEREF(__pyx_tuple__6); /* "pygame_sdl2/font.pyx":97 * bgsurf = rv.copy() * bgsurf.fill(background) * bgsurf.blit(rv, (0,0)) # <<<<<<<<<<<<<< * return bgsurf * return rv */ __pyx_tuple__7 = PyTuple_Pack(2, __pyx_int_0, __pyx_int_0); if (unlikely(!__pyx_tuple__7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 97; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_tuple__7); __Pyx_GIVEREF(__pyx_tuple__7); /* "pygame_sdl2/font.pyx":103 * def size(self, text): * cdef int w, h * if TTF_SizeUTF8(self.font, text.encode('utf-8'), &w, &h) != 0: # <<<<<<<<<<<<<< * raise error() * return w, h */ __pyx_tuple__8 = PyTuple_Pack(1, __pyx_kp_u_utf_8); if (unlikely(!__pyx_tuple__8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 103; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_tuple__8); __Pyx_GIVEREF(__pyx_tuple__8); /* "pygame_sdl2/font.pyx":30 * * @pygame_sdl2.register_init * def init(): # <<<<<<<<<<<<<< * TTF_Init() * */ __pyx_codeobj__9 = (PyObject*)__Pyx_PyCode_New(0, 0, 0, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_tom_ab_pygame_sdl2_src_pyg, __pyx_n_s_init, 30, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 30; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "pygame_sdl2/font.pyx":34 * * @pygame_sdl2.register_quit * def quit(): # @ReservedAssignment # <<<<<<<<<<<<<< * TTF_Quit() * */ __pyx_codeobj__10 = (PyObject*)__Pyx_PyCode_New(0, 0, 0, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_tom_ab_pygame_sdl2_src_pyg, __pyx_n_s_quit, 34, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 34; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "pygame_sdl2/font.pyx":37 * TTF_Quit() * * def get_init(): # <<<<<<<<<<<<<< * return TTF_WasInit() != 0 * */ __pyx_codeobj__11 = (PyObject*)__Pyx_PyCode_New(0, 0, 0, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_tom_ab_pygame_sdl2_src_pyg, __pyx_n_s_get_init, 37, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 37; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "pygame_sdl2/font.pyx":40 * return TTF_WasInit() != 0 * * def get_default_font(): # <<<<<<<<<<<<<< * import os * */ __pyx_tuple__12 = PyTuple_Pack(2, __pyx_n_s_os, __pyx_n_s_default); if (unlikely(!__pyx_tuple__12)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 40; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_tuple__12); __Pyx_GIVEREF(__pyx_tuple__12); __pyx_codeobj__13 = (PyObject*)__Pyx_PyCode_New(0, 0, 2, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__12, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_tom_ab_pygame_sdl2_src_pyg, __pyx_n_s_get_default_font, 40, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__13)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 40; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_RefNannyFinishContext(); return 0; __pyx_L1_error:; __Pyx_RefNannyFinishContext(); return -1; } static int __Pyx_InitGlobals(void) { if (__Pyx_InitStrings(__pyx_string_tab) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; __pyx_int_0 = PyInt_FromLong(0); if (unlikely(!__pyx_int_0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} return 0; __pyx_L1_error:; return -1; } #if PY_MAJOR_VERSION < 3 PyMODINIT_FUNC initfont(void); /*proto*/ PyMODINIT_FUNC initfont(void) #else PyMODINIT_FUNC PyInit_font(void); /*proto*/ PyMODINIT_FUNC PyInit_font(void) #endif { PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; PyObject *__pyx_t_5 = NULL; PyObject *__pyx_t_6 = NULL; PyObject *__pyx_t_7 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannyDeclarations #if CYTHON_REFNANNY __Pyx_RefNanny = __Pyx_RefNannyImportAPI("refnanny"); if (!__Pyx_RefNanny) { PyErr_Clear(); __Pyx_RefNanny = __Pyx_RefNannyImportAPI("Cython.Runtime.refnanny"); if (!__Pyx_RefNanny) Py_FatalError("failed to import 'refnanny' module"); } #endif __Pyx_RefNannySetupContext("PyMODINIT_FUNC PyInit_font(void)", 0); if (__Pyx_check_binary_version() < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_empty_tuple = PyTuple_New(0); if (unlikely(!__pyx_empty_tuple)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_empty_bytes = PyBytes_FromStringAndSize("", 0); if (unlikely(!__pyx_empty_bytes)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} #ifdef __Pyx_CyFunction_USED if (__pyx_CyFunction_init() < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} #endif #ifdef __Pyx_FusedFunction_USED if (__pyx_FusedFunction_init() < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} #endif #ifdef __Pyx_Coroutine_USED if (__pyx_Coroutine_init() < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} #endif #ifdef __Pyx_Generator_USED if (__pyx_Generator_init() < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} #endif #ifdef __Pyx_StopAsyncIteration_USED if (__pyx_StopAsyncIteration_init() < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} #endif /*--- Library function declarations ---*/ /*--- Threads initialization code ---*/ #if defined(__PYX_FORCE_INIT_THREADS) && __PYX_FORCE_INIT_THREADS #ifdef WITH_THREAD /* Python build with threading support? */ PyEval_InitThreads(); #endif #endif /*--- Module creation code ---*/ #if PY_MAJOR_VERSION < 3 __pyx_m = Py_InitModule4("font", __pyx_methods, 0, 0, PYTHON_API_VERSION); Py_XINCREF(__pyx_m); #else __pyx_m = PyModule_Create(&__pyx_moduledef); #endif if (unlikely(!__pyx_m)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_d = PyModule_GetDict(__pyx_m); if (unlikely(!__pyx_d)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} Py_INCREF(__pyx_d); __pyx_b = PyImport_AddModule(__Pyx_BUILTIN_MODULE_NAME); if (unlikely(!__pyx_b)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} #if CYTHON_COMPILING_IN_PYPY Py_INCREF(__pyx_b); #endif if (PyObject_SetAttrString(__pyx_m, "__builtins__", __pyx_b) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; /*--- Initialize various global constants etc. ---*/ if (__Pyx_InitGlobals() < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} #if PY_MAJOR_VERSION < 3 && (__PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT) if (__Pyx_init_sys_getdefaultencoding_params() < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} #endif if (__pyx_module_is_main_pygame_sdl2__font) { if (PyObject_SetAttrString(__pyx_m, "__name__", __pyx_n_s_main) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } #if PY_MAJOR_VERSION >= 3 { PyObject *modules = PyImport_GetModuleDict(); if (unlikely(!modules)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} if (!PyDict_GetItemString(modules, "pygame_sdl2.font")) { if (unlikely(PyDict_SetItemString(modules, "pygame_sdl2.font", __pyx_m) < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } } #endif /*--- Builtin init code ---*/ if (__Pyx_InitCachedBuiltins() < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /*--- Constants init code ---*/ if (__Pyx_InitCachedConstants() < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /*--- Global init code ---*/ /*--- Variable export code ---*/ /*--- Function export code ---*/ /*--- Type init code ---*/ __pyx_vtabptr_11pygame_sdl2_4font_Font = &__pyx_vtable_11pygame_sdl2_4font_Font; __pyx_vtable_11pygame_sdl2_4font_Font.set_style = (PyObject *(*)(struct __pyx_obj_11pygame_sdl2_4font_Font *, PyObject *, PyObject *))__pyx_f_11pygame_sdl2_4font_4Font_set_style; if (PyType_Ready(&__pyx_type_11pygame_sdl2_4font_Font) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 50; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_type_11pygame_sdl2_4font_Font.tp_print = 0; if (__Pyx_SetVtable(__pyx_type_11pygame_sdl2_4font_Font.tp_dict, __pyx_vtabptr_11pygame_sdl2_4font_Font) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 50; __pyx_clineno = __LINE__; goto __pyx_L1_error;} if (PyObject_SetAttrString(__pyx_m, "Font", (PyObject *)&__pyx_type_11pygame_sdl2_4font_Font) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 50; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_ptype_11pygame_sdl2_4font_Font = &__pyx_type_11pygame_sdl2_4font_Font; /*--- Type import code ---*/ __pyx_ptype_11pygame_sdl2_7surface_Surface = __Pyx_ImportType("pygame_sdl2.surface", "Surface", sizeof(struct __pyx_obj_11pygame_sdl2_7surface_Surface), 1); if (unlikely(!__pyx_ptype_11pygame_sdl2_7surface_Surface)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 23; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_vtabptr_11pygame_sdl2_7surface_Surface = (struct __pyx_vtabstruct_11pygame_sdl2_7surface_Surface*)__Pyx_GetVtable(__pyx_ptype_11pygame_sdl2_7surface_Surface->tp_dict); if (unlikely(!__pyx_vtabptr_11pygame_sdl2_7surface_Surface)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 23; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_ptype_11pygame_sdl2_5color_Color = __Pyx_ImportType("pygame_sdl2.color", "Color", sizeof(struct __pyx_obj_11pygame_sdl2_5color_Color), 1); if (unlikely(!__pyx_ptype_11pygame_sdl2_5color_Color)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 26; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_vtabptr_11pygame_sdl2_5color_Color = (struct __pyx_vtabstruct_11pygame_sdl2_5color_Color*)__Pyx_GetVtable(__pyx_ptype_11pygame_sdl2_5color_Color->tp_dict); if (unlikely(!__pyx_vtabptr_11pygame_sdl2_5color_Color)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 26; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /*--- Variable import code ---*/ /*--- Function import code ---*/ __pyx_t_1 = __Pyx_ImportModule("pygame_sdl2.color"); if (!__pyx_t_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} if (__Pyx_ImportFunction(__pyx_t_1, "to_sdl_color", (void (**)(void))&__pyx_f_11pygame_sdl2_5color_to_sdl_color, "PyObject *(PyObject *, SDL_Color *)") < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} Py_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_2 = __Pyx_ImportModule("pygame_sdl2.rwobject"); if (!__pyx_t_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} if (__Pyx_ImportFunction(__pyx_t_2, "to_rwops", (void (**)(void))&__pyx_f_11pygame_sdl2_8rwobject_to_rwops, "SDL_RWops *(PyObject *, struct __pyx_opt_args_11pygame_sdl2_8rwobject_to_rwops *__pyx_optional_args)") < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} Py_DECREF(__pyx_t_2); __pyx_t_2 = 0; /*--- Execution code ---*/ #if defined(__Pyx_Generator_USED) || defined(__Pyx_Coroutine_USED) if (__Pyx_patch_abc() < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} #endif /* "pygame_sdl2/font.pyx":25 * from pygame_sdl2.rwobject cimport to_rwops * * from pygame_sdl2.sysfont import SysFont, match_font, get_fonts # <<<<<<<<<<<<<< * from pygame_sdl2.error import error * import pygame_sdl2 */ __pyx_t_3 = PyList_New(3); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 25; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __Pyx_INCREF(__pyx_n_s_SysFont); __Pyx_GIVEREF(__pyx_n_s_SysFont); PyList_SET_ITEM(__pyx_t_3, 0, __pyx_n_s_SysFont); __Pyx_INCREF(__pyx_n_s_match_font); __Pyx_GIVEREF(__pyx_n_s_match_font); PyList_SET_ITEM(__pyx_t_3, 1, __pyx_n_s_match_font); __Pyx_INCREF(__pyx_n_s_get_fonts); __Pyx_GIVEREF(__pyx_n_s_get_fonts); PyList_SET_ITEM(__pyx_t_3, 2, __pyx_n_s_get_fonts); __pyx_t_4 = __Pyx_Import(__pyx_n_s_pygame_sdl2_sysfont, __pyx_t_3, 0); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 25; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_3 = __Pyx_ImportFrom(__pyx_t_4, __pyx_n_s_SysFont); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 25; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); if (PyDict_SetItem(__pyx_d, __pyx_n_s_SysFont, __pyx_t_3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 25; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_3 = __Pyx_ImportFrom(__pyx_t_4, __pyx_n_s_match_font); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 25; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); if (PyDict_SetItem(__pyx_d, __pyx_n_s_match_font, __pyx_t_3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 25; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_3 = __Pyx_ImportFrom(__pyx_t_4, __pyx_n_s_get_fonts); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 25; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); if (PyDict_SetItem(__pyx_d, __pyx_n_s_get_fonts, __pyx_t_3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 25; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; /* "pygame_sdl2/font.pyx":26 * * from pygame_sdl2.sysfont import SysFont, match_font, get_fonts * from pygame_sdl2.error import error # <<<<<<<<<<<<<< * import pygame_sdl2 * */ __pyx_t_4 = PyList_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 26; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); __Pyx_INCREF(__pyx_n_s_error); __Pyx_GIVEREF(__pyx_n_s_error); PyList_SET_ITEM(__pyx_t_4, 0, __pyx_n_s_error); __pyx_t_3 = __Pyx_Import(__pyx_n_s_pygame_sdl2_error, __pyx_t_4, 0); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 26; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_t_4 = __Pyx_ImportFrom(__pyx_t_3, __pyx_n_s_error); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 26; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); if (PyDict_SetItem(__pyx_d, __pyx_n_s_error, __pyx_t_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 26; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "pygame_sdl2/font.pyx":27 * from pygame_sdl2.sysfont import SysFont, match_font, get_fonts * from pygame_sdl2.error import error * import pygame_sdl2 # <<<<<<<<<<<<<< * * @pygame_sdl2.register_init */ __pyx_t_3 = __Pyx_Import(__pyx_n_s_pygame_sdl2, 0, 0); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 27; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); if (PyDict_SetItem(__pyx_d, __pyx_n_s_pygame_sdl2, __pyx_t_3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 27; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "pygame_sdl2/font.pyx":29 * import pygame_sdl2 * * @pygame_sdl2.register_init # <<<<<<<<<<<<<< * def init(): * TTF_Init() */ __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_pygame_sdl2); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 29; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_register_init); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 29; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; /* "pygame_sdl2/font.pyx":30 * * @pygame_sdl2.register_init * def init(): # <<<<<<<<<<<<<< * TTF_Init() * */ __pyx_t_4 = PyCFunction_NewEx(&__pyx_mdef_11pygame_sdl2_4font_1init, NULL, __pyx_n_s_pygame_sdl2_font); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 30; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); __pyx_t_6 = NULL; if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_5))) { __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_5); if (likely(__pyx_t_6)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5); __Pyx_INCREF(__pyx_t_6); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_5, function); } } if (!__pyx_t_6) { __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_t_4); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 29; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_GOTREF(__pyx_t_3); } else { __pyx_t_7 = PyTuple_New(1+1); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 29; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_7); __Pyx_GIVEREF(__pyx_t_6); PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_6); __pyx_t_6 = NULL; __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_7, 0+1, __pyx_t_4); __pyx_t_4 = 0; __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_7, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 29; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; } __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; if (PyDict_SetItem(__pyx_d, __pyx_n_s_init, __pyx_t_3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 30; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "pygame_sdl2/font.pyx":33 * TTF_Init() * * @pygame_sdl2.register_quit # <<<<<<<<<<<<<< * def quit(): # @ReservedAssignment * TTF_Quit() */ __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_pygame_sdl2); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 33; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_register_quit); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 33; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; /* "pygame_sdl2/font.pyx":34 * * @pygame_sdl2.register_quit * def quit(): # @ReservedAssignment # <<<<<<<<<<<<<< * TTF_Quit() * */ __pyx_t_5 = PyCFunction_NewEx(&__pyx_mdef_11pygame_sdl2_4font_3quit, NULL, __pyx_n_s_pygame_sdl2_font); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 34; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); __pyx_t_4 = NULL; if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_7))) { __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_7); if (likely(__pyx_t_4)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_7); __Pyx_INCREF(__pyx_t_4); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_7, function); } } if (!__pyx_t_4) { __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_t_7, __pyx_t_5); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 33; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_GOTREF(__pyx_t_3); } else { __pyx_t_6 = PyTuple_New(1+1); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 33; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_6); __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_4); __pyx_t_4 = NULL; __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_6, 0+1, __pyx_t_5); __pyx_t_5 = 0; __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_7, __pyx_t_6, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 33; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; } __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; if (PyDict_SetItem(__pyx_d, __pyx_n_s_quit, __pyx_t_3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 34; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "pygame_sdl2/font.pyx":37 * TTF_Quit() * * def get_init(): # <<<<<<<<<<<<<< * return TTF_WasInit() != 0 * */ __pyx_t_3 = PyCFunction_NewEx(&__pyx_mdef_11pygame_sdl2_4font_5get_init, NULL, __pyx_n_s_pygame_sdl2_font); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 37; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); if (PyDict_SetItem(__pyx_d, __pyx_n_s_get_init, __pyx_t_3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 37; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "pygame_sdl2/font.pyx":40 * return TTF_WasInit() != 0 * * def get_default_font(): # <<<<<<<<<<<<<< * import os * */ __pyx_t_3 = PyCFunction_NewEx(&__pyx_mdef_11pygame_sdl2_4font_7get_default_font, NULL, __pyx_n_s_pygame_sdl2_font); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 40; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); if (PyDict_SetItem(__pyx_d, __pyx_n_s_get_default_font, __pyx_t_3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 40; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "pygame_sdl2/font.pyx":1 * # Copyright 2014 Patrick Dawson # <<<<<<<<<<<<<< * # * # This software is provided 'as-is', without any express or implied */ __pyx_t_3 = PyDict_New(); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); if (PyDict_SetItem(__pyx_d, __pyx_n_s_test, __pyx_t_3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /*--- Wrapped vars code ---*/ goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_5); __Pyx_XDECREF(__pyx_t_6); __Pyx_XDECREF(__pyx_t_7); if (__pyx_m) { if (__pyx_d) { __Pyx_AddTraceback("init pygame_sdl2.font", __pyx_clineno, __pyx_lineno, __pyx_filename); } Py_DECREF(__pyx_m); __pyx_m = 0; } else if (!PyErr_Occurred()) { PyErr_SetString(PyExc_ImportError, "init pygame_sdl2.font"); } __pyx_L0:; __Pyx_RefNannyFinishContext(); #if PY_MAJOR_VERSION < 3 return; #else return __pyx_m; #endif } /* --- Runtime support code --- */ #if CYTHON_REFNANNY static __Pyx_RefNannyAPIStruct *__Pyx_RefNannyImportAPI(const char *modname) { PyObject *m = NULL, *p = NULL; void *r = NULL; m = PyImport_ImportModule((char *)modname); if (!m) goto end; p = PyObject_GetAttrString(m, (char *)"RefNannyAPI"); if (!p) goto end; r = PyLong_AsVoidPtr(p); end: Py_XDECREF(p); Py_XDECREF(m); return (__Pyx_RefNannyAPIStruct *)r; } #endif static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list, int level) { PyObject *empty_list = 0; PyObject *module = 0; PyObject *global_dict = 0; PyObject *empty_dict = 0; PyObject *list; #if PY_VERSION_HEX < 0x03030000 PyObject *py_import; py_import = __Pyx_PyObject_GetAttrStr(__pyx_b, __pyx_n_s_import); if (!py_import) goto bad; #endif if (from_list) list = from_list; else { empty_list = PyList_New(0); if (!empty_list) goto bad; list = empty_list; } global_dict = PyModule_GetDict(__pyx_m); if (!global_dict) goto bad; empty_dict = PyDict_New(); if (!empty_dict) goto bad; { #if PY_MAJOR_VERSION >= 3 if (level == -1) { if (strchr(__Pyx_MODULE_NAME, '.')) { #if PY_VERSION_HEX < 0x03030000 PyObject *py_level = PyInt_FromLong(1); if (!py_level) goto bad; module = PyObject_CallFunctionObjArgs(py_import, name, global_dict, empty_dict, list, py_level, NULL); Py_DECREF(py_level); #else module = PyImport_ImportModuleLevelObject( name, global_dict, empty_dict, list, 1); #endif if (!module) { if (!PyErr_ExceptionMatches(PyExc_ImportError)) goto bad; PyErr_Clear(); } } level = 0; } #endif if (!module) { #if PY_VERSION_HEX < 0x03030000 PyObject *py_level = PyInt_FromLong(level); if (!py_level) goto bad; module = PyObject_CallFunctionObjArgs(py_import, name, global_dict, empty_dict, list, py_level, NULL); Py_DECREF(py_level); #else module = PyImport_ImportModuleLevelObject( name, global_dict, empty_dict, list, level); #endif } } bad: #if PY_VERSION_HEX < 0x03030000 Py_XDECREF(py_import); #endif Py_XDECREF(empty_list); Py_XDECREF(empty_dict); return module; } static PyObject *__Pyx_GetBuiltinName(PyObject *name) { PyObject* result = __Pyx_PyObject_GetAttrStr(__pyx_b, name); if (unlikely(!result)) { PyErr_Format(PyExc_NameError, #if PY_MAJOR_VERSION >= 3 "name '%U' is not defined", name); #else "name '%.200s' is not defined", PyString_AS_STRING(name)); #endif } return result; } static CYTHON_INLINE PyObject *__Pyx_GetModuleGlobalName(PyObject *name) { PyObject *result; #if CYTHON_COMPILING_IN_CPYTHON result = PyDict_GetItem(__pyx_d, name); if (likely(result)) { Py_INCREF(result); } else { #else result = PyObject_GetItem(__pyx_d, name); if (!result) { PyErr_Clear(); #endif result = __Pyx_GetBuiltinName(name); } return result; } #if CYTHON_COMPILING_IN_CPYTHON static CYTHON_INLINE PyObject* __Pyx_PyObject_Call(PyObject *func, PyObject *arg, PyObject *kw) { PyObject *result; ternaryfunc call = func->ob_type->tp_call; if (unlikely(!call)) return PyObject_Call(func, arg, kw); if (unlikely(Py_EnterRecursiveCall((char*)" while calling a Python object"))) return NULL; result = (*call)(func, arg, kw); Py_LeaveRecursiveCall(); if (unlikely(!result) && unlikely(!PyErr_Occurred())) { PyErr_SetString( PyExc_SystemError, "NULL result without error in PyObject_Call"); } return result; } #endif #if CYTHON_COMPILING_IN_CPYTHON static CYTHON_INLINE PyObject* __Pyx_PyObject_CallMethO(PyObject *func, PyObject *arg) { PyObject *self, *result; PyCFunction cfunc; cfunc = PyCFunction_GET_FUNCTION(func); self = PyCFunction_GET_SELF(func); if (unlikely(Py_EnterRecursiveCall((char*)" while calling a Python object"))) return NULL; result = cfunc(self, arg); Py_LeaveRecursiveCall(); if (unlikely(!result) && unlikely(!PyErr_Occurred())) { PyErr_SetString( PyExc_SystemError, "NULL result without error in PyObject_Call"); } return result; } #endif #if CYTHON_COMPILING_IN_CPYTHON static PyObject* __Pyx__PyObject_CallOneArg(PyObject *func, PyObject *arg) { PyObject *result; PyObject *args = PyTuple_New(1); if (unlikely(!args)) return NULL; Py_INCREF(arg); PyTuple_SET_ITEM(args, 0, arg); result = __Pyx_PyObject_Call(func, args, NULL); Py_DECREF(args); return result; } static CYTHON_INLINE PyObject* __Pyx_PyObject_CallOneArg(PyObject *func, PyObject *arg) { #ifdef __Pyx_CyFunction_USED if (likely(PyCFunction_Check(func) || PyObject_TypeCheck(func, __pyx_CyFunctionType))) { #else if (likely(PyCFunction_Check(func))) { #endif if (likely(PyCFunction_GET_FLAGS(func) & METH_O)) { return __Pyx_PyObject_CallMethO(func, arg); } } return __Pyx__PyObject_CallOneArg(func, arg); } #else static CYTHON_INLINE PyObject* __Pyx_PyObject_CallOneArg(PyObject *func, PyObject *arg) { PyObject* args = PyTuple_Pack(1, arg); return (likely(args)) ? __Pyx_PyObject_Call(func, args, NULL) : NULL; } #endif static void __Pyx_RaiseArgtupleInvalid( const char* func_name, int exact, Py_ssize_t num_min, Py_ssize_t num_max, Py_ssize_t num_found) { Py_ssize_t num_expected; const char *more_or_less; if (num_found < num_min) { num_expected = num_min; more_or_less = "at least"; } else { num_expected = num_max; more_or_less = "at most"; } if (exact) { more_or_less = "exactly"; } PyErr_Format(PyExc_TypeError, "%.200s() takes %.8s %" CYTHON_FORMAT_SSIZE_T "d positional argument%.1s (%" CYTHON_FORMAT_SSIZE_T "d given)", func_name, more_or_less, num_expected, (num_expected == 1) ? "" : "s", num_found); } static CYTHON_INLINE int __Pyx_CheckKeywordStrings( PyObject *kwdict, const char* function_name, int kw_allowed) { PyObject* key = 0; Py_ssize_t pos = 0; #if CYTHON_COMPILING_IN_PYPY if (!kw_allowed && PyDict_Next(kwdict, &pos, &key, 0)) goto invalid_keyword; return 1; #else while (PyDict_Next(kwdict, &pos, &key, 0)) { #if PY_MAJOR_VERSION < 3 if (unlikely(!PyString_CheckExact(key)) && unlikely(!PyString_Check(key))) #endif if (unlikely(!PyUnicode_Check(key))) goto invalid_keyword_type; } if ((!kw_allowed) && unlikely(key)) goto invalid_keyword; return 1; invalid_keyword_type: PyErr_Format(PyExc_TypeError, "%.200s() keywords must be strings", function_name); return 0; #endif invalid_keyword: PyErr_Format(PyExc_TypeError, #if PY_MAJOR_VERSION < 3 "%.200s() got an unexpected keyword argument '%.200s'", function_name, PyString_AsString(key)); #else "%s() got an unexpected keyword argument '%U'", function_name, key); #endif return 0; } static void __Pyx_RaiseDoubleKeywordsError( const char* func_name, PyObject* kw_name) { PyErr_Format(PyExc_TypeError, #if PY_MAJOR_VERSION >= 3 "%s() got multiple values for keyword argument '%U'", func_name, kw_name); #else "%s() got multiple values for keyword argument '%s'", func_name, PyString_AsString(kw_name)); #endif } static int __Pyx_ParseOptionalKeywords( PyObject *kwds, PyObject **argnames[], PyObject *kwds2, PyObject *values[], Py_ssize_t num_pos_args, const char* function_name) { PyObject *key = 0, *value = 0; Py_ssize_t pos = 0; PyObject*** name; PyObject*** first_kw_arg = argnames + num_pos_args; while (PyDict_Next(kwds, &pos, &key, &value)) { name = first_kw_arg; while (*name && (**name != key)) name++; if (*name) { values[name-argnames] = value; continue; } name = first_kw_arg; #if PY_MAJOR_VERSION < 3 if (likely(PyString_CheckExact(key)) || likely(PyString_Check(key))) { while (*name) { if ((CYTHON_COMPILING_IN_PYPY || PyString_GET_SIZE(**name) == PyString_GET_SIZE(key)) && _PyString_Eq(**name, key)) { values[name-argnames] = value; break; } name++; } if (*name) continue; else { PyObject*** argname = argnames; while (argname != first_kw_arg) { if ((**argname == key) || ( (CYTHON_COMPILING_IN_PYPY || PyString_GET_SIZE(**argname) == PyString_GET_SIZE(key)) && _PyString_Eq(**argname, key))) { goto arg_passed_twice; } argname++; } } } else #endif if (likely(PyUnicode_Check(key))) { while (*name) { int cmp = (**name == key) ? 0 : #if !CYTHON_COMPILING_IN_PYPY && PY_MAJOR_VERSION >= 3 (PyUnicode_GET_SIZE(**name) != PyUnicode_GET_SIZE(key)) ? 1 : #endif PyUnicode_Compare(**name, key); if (cmp < 0 && unlikely(PyErr_Occurred())) goto bad; if (cmp == 0) { values[name-argnames] = value; break; } name++; } if (*name) continue; else { PyObject*** argname = argnames; while (argname != first_kw_arg) { int cmp = (**argname == key) ? 0 : #if !CYTHON_COMPILING_IN_PYPY && PY_MAJOR_VERSION >= 3 (PyUnicode_GET_SIZE(**argname) != PyUnicode_GET_SIZE(key)) ? 1 : #endif PyUnicode_Compare(**argname, key); if (cmp < 0 && unlikely(PyErr_Occurred())) goto bad; if (cmp == 0) goto arg_passed_twice; argname++; } } } else goto invalid_keyword_type; if (kwds2) { if (unlikely(PyDict_SetItem(kwds2, key, value))) goto bad; } else { goto invalid_keyword; } } return 0; arg_passed_twice: __Pyx_RaiseDoubleKeywordsError(function_name, key); goto bad; invalid_keyword_type: PyErr_Format(PyExc_TypeError, "%.200s() keywords must be strings", function_name); goto bad; invalid_keyword: PyErr_Format(PyExc_TypeError, #if PY_MAJOR_VERSION < 3 "%.200s() got an unexpected keyword argument '%.200s'", function_name, PyString_AsString(key)); #else "%s() got an unexpected keyword argument '%U'", function_name, key); #endif bad: return -1; } #if CYTHON_COMPILING_IN_CPYTHON static CYTHON_INLINE PyObject* __Pyx_PyObject_CallNoArg(PyObject *func) { #ifdef __Pyx_CyFunction_USED if (likely(PyCFunction_Check(func) || PyObject_TypeCheck(func, __pyx_CyFunctionType))) { #else if (likely(PyCFunction_Check(func))) { #endif if (likely(PyCFunction_GET_FLAGS(func) & METH_NOARGS)) { return __Pyx_PyObject_CallMethO(func, NULL); } } return __Pyx_PyObject_Call(func, __pyx_empty_tuple, NULL); } #endif static CYTHON_INLINE void __Pyx_ErrRestore(PyObject *type, PyObject *value, PyObject *tb) { #if CYTHON_COMPILING_IN_CPYTHON PyObject *tmp_type, *tmp_value, *tmp_tb; PyThreadState *tstate = PyThreadState_GET(); tmp_type = tstate->curexc_type; tmp_value = tstate->curexc_value; tmp_tb = tstate->curexc_traceback; tstate->curexc_type = type; tstate->curexc_value = value; tstate->curexc_traceback = tb; Py_XDECREF(tmp_type); Py_XDECREF(tmp_value); Py_XDECREF(tmp_tb); #else PyErr_Restore(type, value, tb); #endif } static CYTHON_INLINE void __Pyx_ErrFetch(PyObject **type, PyObject **value, PyObject **tb) { #if CYTHON_COMPILING_IN_CPYTHON PyThreadState *tstate = PyThreadState_GET(); *type = tstate->curexc_type; *value = tstate->curexc_value; *tb = tstate->curexc_traceback; tstate->curexc_type = 0; tstate->curexc_value = 0; tstate->curexc_traceback = 0; #else PyErr_Fetch(type, value, tb); #endif } #if PY_MAJOR_VERSION < 3 static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, CYTHON_UNUSED PyObject *cause) { Py_XINCREF(type); if (!value || value == Py_None) value = NULL; else Py_INCREF(value); if (!tb || tb == Py_None) tb = NULL; else { Py_INCREF(tb); if (!PyTraceBack_Check(tb)) { PyErr_SetString(PyExc_TypeError, "raise: arg 3 must be a traceback or None"); goto raise_error; } } if (PyType_Check(type)) { #if CYTHON_COMPILING_IN_PYPY if (!value) { Py_INCREF(Py_None); value = Py_None; } #endif PyErr_NormalizeException(&type, &value, &tb); } else { if (value) { PyErr_SetString(PyExc_TypeError, "instance exception may not have a separate value"); goto raise_error; } value = type; type = (PyObject*) Py_TYPE(type); Py_INCREF(type); if (!PyType_IsSubtype((PyTypeObject *)type, (PyTypeObject *)PyExc_BaseException)) { PyErr_SetString(PyExc_TypeError, "raise: exception class must be a subclass of BaseException"); goto raise_error; } } __Pyx_ErrRestore(type, value, tb); return; raise_error: Py_XDECREF(value); Py_XDECREF(type); Py_XDECREF(tb); return; } #else static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, PyObject *cause) { PyObject* owned_instance = NULL; if (tb == Py_None) { tb = 0; } else if (tb && !PyTraceBack_Check(tb)) { PyErr_SetString(PyExc_TypeError, "raise: arg 3 must be a traceback or None"); goto bad; } if (value == Py_None) value = 0; if (PyExceptionInstance_Check(type)) { if (value) { PyErr_SetString(PyExc_TypeError, "instance exception may not have a separate value"); goto bad; } value = type; type = (PyObject*) Py_TYPE(value); } else if (PyExceptionClass_Check(type)) { PyObject *instance_class = NULL; if (value && PyExceptionInstance_Check(value)) { instance_class = (PyObject*) Py_TYPE(value); if (instance_class != type) { int is_subclass = PyObject_IsSubclass(instance_class, type); if (!is_subclass) { instance_class = NULL; } else if (unlikely(is_subclass == -1)) { goto bad; } else { type = instance_class; } } } if (!instance_class) { PyObject *args; if (!value) args = PyTuple_New(0); else if (PyTuple_Check(value)) { Py_INCREF(value); args = value; } else args = PyTuple_Pack(1, value); if (!args) goto bad; owned_instance = PyObject_Call(type, args, NULL); Py_DECREF(args); if (!owned_instance) goto bad; value = owned_instance; if (!PyExceptionInstance_Check(value)) { PyErr_Format(PyExc_TypeError, "calling %R should have returned an instance of " "BaseException, not %R", type, Py_TYPE(value)); goto bad; } } } else { PyErr_SetString(PyExc_TypeError, "raise: exception class must be a subclass of BaseException"); goto bad; } #if PY_VERSION_HEX >= 0x03030000 if (cause) { #else if (cause && cause != Py_None) { #endif PyObject *fixed_cause; if (cause == Py_None) { fixed_cause = NULL; } else if (PyExceptionClass_Check(cause)) { fixed_cause = PyObject_CallObject(cause, NULL); if (fixed_cause == NULL) goto bad; } else if (PyExceptionInstance_Check(cause)) { fixed_cause = cause; Py_INCREF(fixed_cause); } else { PyErr_SetString(PyExc_TypeError, "exception causes must derive from " "BaseException"); goto bad; } PyException_SetCause(value, fixed_cause); } PyErr_SetObject(type, value); if (tb) { #if CYTHON_COMPILING_IN_PYPY PyObject *tmp_type, *tmp_value, *tmp_tb; PyErr_Fetch(&tmp_type, &tmp_value, &tmp_tb); Py_INCREF(tb); PyErr_Restore(tmp_type, tmp_value, tb); Py_XDECREF(tmp_tb); #else PyThreadState *tstate = PyThreadState_GET(); PyObject* tmp_tb = tstate->curexc_traceback; if (tb != tmp_tb) { Py_INCREF(tb); tstate->curexc_traceback = tb; Py_XDECREF(tmp_tb); } #endif } bad: Py_XDECREF(owned_instance); return; } #endif static CYTHON_INLINE void __Pyx_RaiseTooManyValuesError(Py_ssize_t expected) { PyErr_Format(PyExc_ValueError, "too many values to unpack (expected %" CYTHON_FORMAT_SSIZE_T "d)", expected); } static CYTHON_INLINE void __Pyx_RaiseNeedMoreValuesError(Py_ssize_t index) { PyErr_Format(PyExc_ValueError, "need more than %" CYTHON_FORMAT_SSIZE_T "d value%.1s to unpack", index, (index == 1) ? "" : "s"); } static CYTHON_INLINE int __Pyx_IterFinish(void) { #if CYTHON_COMPILING_IN_CPYTHON PyThreadState *tstate = PyThreadState_GET(); PyObject* exc_type = tstate->curexc_type; if (unlikely(exc_type)) { if (likely(exc_type == PyExc_StopIteration) || PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration)) { PyObject *exc_value, *exc_tb; exc_value = tstate->curexc_value; exc_tb = tstate->curexc_traceback; tstate->curexc_type = 0; tstate->curexc_value = 0; tstate->curexc_traceback = 0; Py_DECREF(exc_type); Py_XDECREF(exc_value); Py_XDECREF(exc_tb); return 0; } else { return -1; } } return 0; #else if (unlikely(PyErr_Occurred())) { if (likely(PyErr_ExceptionMatches(PyExc_StopIteration))) { PyErr_Clear(); return 0; } else { return -1; } } return 0; #endif } static int __Pyx_IternextUnpackEndCheck(PyObject *retval, Py_ssize_t expected) { if (unlikely(retval)) { Py_DECREF(retval); __Pyx_RaiseTooManyValuesError(expected); return -1; } else { return __Pyx_IterFinish(); } return 0; } static CYTHON_INLINE int __Pyx_TypeTest(PyObject *obj, PyTypeObject *type) { if (unlikely(!type)) { PyErr_SetString(PyExc_SystemError, "Missing type object"); return 0; } if (likely(PyObject_TypeCheck(obj, type))) return 1; PyErr_Format(PyExc_TypeError, "Cannot convert %.200s to %.200s", Py_TYPE(obj)->tp_name, type->tp_name); return 0; } static CYTHON_INLINE Py_UCS4 __Pyx_PyUnicode_AsPy_UCS4(PyObject* x) { Py_ssize_t length; #if CYTHON_PEP393_ENABLED length = PyUnicode_GET_LENGTH(x); if (likely(length == 1)) { return PyUnicode_READ_CHAR(x, 0); } #else length = PyUnicode_GET_SIZE(x); if (likely(length == 1)) { return PyUnicode_AS_UNICODE(x)[0]; } #if Py_UNICODE_SIZE == 2 else if (PyUnicode_GET_SIZE(x) == 2) { Py_UCS4 high_val = PyUnicode_AS_UNICODE(x)[0]; if (high_val >= 0xD800 && high_val <= 0xDBFF) { Py_UCS4 low_val = PyUnicode_AS_UNICODE(x)[1]; if (low_val >= 0xDC00 && low_val <= 0xDFFF) { return 0x10000 + (((high_val & ((1<<10)-1)) << 10) | (low_val & ((1<<10)-1))); } } } #endif #endif PyErr_Format(PyExc_ValueError, "only single character unicode strings can be converted to Py_UCS4, " "got length %" CYTHON_FORMAT_SSIZE_T "d", length); return (Py_UCS4)-1; } static long __Pyx__PyObject_Ord(PyObject* c) { Py_ssize_t size; if (PyBytes_Check(c)) { size = PyBytes_GET_SIZE(c); if (likely(size == 1)) { return (unsigned char) PyBytes_AS_STRING(c)[0]; } #if PY_MAJOR_VERSION < 3 } else if (PyUnicode_Check(c)) { return (long)__Pyx_PyUnicode_AsPy_UCS4(c); #endif #if (!CYTHON_COMPILING_IN_PYPY) || (defined(PyByteArray_AS_STRING) && defined(PyByteArray_GET_SIZE)) } else if (PyByteArray_Check(c)) { size = PyByteArray_GET_SIZE(c); if (likely(size == 1)) { return (unsigned char) PyByteArray_AS_STRING(c)[0]; } #endif } else { PyErr_Format(PyExc_TypeError, "ord() expected string of length 1, but %.200s found", c->ob_type->tp_name); return (long)(Py_UCS4)-1; } PyErr_Format(PyExc_TypeError, "ord() expected a character, but string of length %zd found", size); return (long)(Py_UCS4)-1; } static int __Pyx_SetVtable(PyObject *dict, void *vtable) { #if PY_VERSION_HEX >= 0x02070000 PyObject *ob = PyCapsule_New(vtable, 0, 0); #else PyObject *ob = PyCObject_FromVoidPtr(vtable, 0); #endif if (!ob) goto bad; if (PyDict_SetItem(dict, __pyx_n_s_pyx_vtable, ob) < 0) goto bad; Py_DECREF(ob); return 0; bad: Py_XDECREF(ob); return -1; } static void* __Pyx_GetVtable(PyObject *dict) { void* ptr; PyObject *ob = PyObject_GetItem(dict, __pyx_n_s_pyx_vtable); if (!ob) goto bad; #if PY_VERSION_HEX >= 0x02070000 ptr = PyCapsule_GetPointer(ob, 0); #else ptr = PyCObject_AsVoidPtr(ob); #endif if (!ptr && !PyErr_Occurred()) PyErr_SetString(PyExc_RuntimeError, "invalid vtable found for imported type"); Py_DECREF(ob); return ptr; bad: Py_XDECREF(ob); return NULL; } static PyObject* __Pyx_ImportFrom(PyObject* module, PyObject* name) { PyObject* value = __Pyx_PyObject_GetAttrStr(module, name); if (unlikely(!value) && PyErr_ExceptionMatches(PyExc_AttributeError)) { PyErr_Format(PyExc_ImportError, #if PY_MAJOR_VERSION < 3 "cannot import name %.230s", PyString_AS_STRING(name)); #else "cannot import name %S", name); #endif } return value; } static int __pyx_bisect_code_objects(__Pyx_CodeObjectCacheEntry* entries, int count, int code_line) { int start = 0, mid = 0, end = count - 1; if (end >= 0 && code_line > entries[end].code_line) { return count; } while (start < end) { mid = start + (end - start) / 2; if (code_line < entries[mid].code_line) { end = mid; } else if (code_line > entries[mid].code_line) { start = mid + 1; } else { return mid; } } if (code_line <= entries[mid].code_line) { return mid; } else { return mid + 1; } } static PyCodeObject *__pyx_find_code_object(int code_line) { PyCodeObject* code_object; int pos; if (unlikely(!code_line) || unlikely(!__pyx_code_cache.entries)) { return NULL; } pos = __pyx_bisect_code_objects(__pyx_code_cache.entries, __pyx_code_cache.count, code_line); if (unlikely(pos >= __pyx_code_cache.count) || unlikely(__pyx_code_cache.entries[pos].code_line != code_line)) { return NULL; } code_object = __pyx_code_cache.entries[pos].code_object; Py_INCREF(code_object); return code_object; } static void __pyx_insert_code_object(int code_line, PyCodeObject* code_object) { int pos, i; __Pyx_CodeObjectCacheEntry* entries = __pyx_code_cache.entries; if (unlikely(!code_line)) { return; } if (unlikely(!entries)) { entries = (__Pyx_CodeObjectCacheEntry*)PyMem_Malloc(64*sizeof(__Pyx_CodeObjectCacheEntry)); if (likely(entries)) { __pyx_code_cache.entries = entries; __pyx_code_cache.max_count = 64; __pyx_code_cache.count = 1; entries[0].code_line = code_line; entries[0].code_object = code_object; Py_INCREF(code_object); } return; } pos = __pyx_bisect_code_objects(__pyx_code_cache.entries, __pyx_code_cache.count, code_line); if ((pos < __pyx_code_cache.count) && unlikely(__pyx_code_cache.entries[pos].code_line == code_line)) { PyCodeObject* tmp = entries[pos].code_object; entries[pos].code_object = code_object; Py_DECREF(tmp); return; } if (__pyx_code_cache.count == __pyx_code_cache.max_count) { int new_max = __pyx_code_cache.max_count + 64; entries = (__Pyx_CodeObjectCacheEntry*)PyMem_Realloc( __pyx_code_cache.entries, (size_t)new_max*sizeof(__Pyx_CodeObjectCacheEntry)); if (unlikely(!entries)) { return; } __pyx_code_cache.entries = entries; __pyx_code_cache.max_count = new_max; } for (i=__pyx_code_cache.count; i>pos; i--) { entries[i] = entries[i-1]; } entries[pos].code_line = code_line; entries[pos].code_object = code_object; __pyx_code_cache.count++; Py_INCREF(code_object); } #include "compile.h" #include "frameobject.h" #include "traceback.h" static PyCodeObject* __Pyx_CreateCodeObjectForTraceback( const char *funcname, int c_line, int py_line, const char *filename) { PyCodeObject *py_code = 0; PyObject *py_srcfile = 0; PyObject *py_funcname = 0; #if PY_MAJOR_VERSION < 3 py_srcfile = PyString_FromString(filename); #else py_srcfile = PyUnicode_FromString(filename); #endif if (!py_srcfile) goto bad; if (c_line) { #if PY_MAJOR_VERSION < 3 py_funcname = PyString_FromFormat( "%s (%s:%d)", funcname, __pyx_cfilenm, c_line); #else py_funcname = PyUnicode_FromFormat( "%s (%s:%d)", funcname, __pyx_cfilenm, c_line); #endif } else { #if PY_MAJOR_VERSION < 3 py_funcname = PyString_FromString(funcname); #else py_funcname = PyUnicode_FromString(funcname); #endif } if (!py_funcname) goto bad; py_code = __Pyx_PyCode_New( 0, 0, 0, 0, 0, __pyx_empty_bytes, /*PyObject *code,*/ __pyx_empty_tuple, /*PyObject *consts,*/ __pyx_empty_tuple, /*PyObject *names,*/ __pyx_empty_tuple, /*PyObject *varnames,*/ __pyx_empty_tuple, /*PyObject *freevars,*/ __pyx_empty_tuple, /*PyObject *cellvars,*/ py_srcfile, /*PyObject *filename,*/ py_funcname, /*PyObject *name,*/ py_line, __pyx_empty_bytes /*PyObject *lnotab*/ ); Py_DECREF(py_srcfile); Py_DECREF(py_funcname); return py_code; bad: Py_XDECREF(py_srcfile); Py_XDECREF(py_funcname); return NULL; } static void __Pyx_AddTraceback(const char *funcname, int c_line, int py_line, const char *filename) { PyCodeObject *py_code = 0; PyFrameObject *py_frame = 0; py_code = __pyx_find_code_object(c_line ? c_line : py_line); if (!py_code) { py_code = __Pyx_CreateCodeObjectForTraceback( funcname, c_line, py_line, filename); if (!py_code) goto bad; __pyx_insert_code_object(c_line ? c_line : py_line, py_code); } py_frame = PyFrame_New( PyThreadState_GET(), /*PyThreadState *tstate,*/ py_code, /*PyCodeObject *code,*/ __pyx_d, /*PyObject *globals,*/ 0 /*PyObject *locals*/ ); if (!py_frame) goto bad; py_frame->f_lineno = py_line; PyTraceBack_Here(py_frame); bad: Py_XDECREF(py_code); Py_XDECREF(py_frame); } #define __PYX_VERIFY_RETURN_INT(target_type, func_type, func_value)\ __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, 0) #define __PYX_VERIFY_RETURN_INT_EXC(target_type, func_type, func_value)\ __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, 1) #define __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, exc)\ {\ func_type value = func_value;\ if (sizeof(target_type) < sizeof(func_type)) {\ if (unlikely(value != (func_type) (target_type) value)) {\ func_type zero = 0;\ if (exc && unlikely(value == (func_type)-1 && PyErr_Occurred()))\ return (target_type) -1;\ if (is_unsigned && unlikely(value < zero))\ goto raise_neg_overflow;\ else\ goto raise_overflow;\ }\ }\ return (target_type) value;\ } #if CYTHON_USE_PYLONG_INTERNALS #include "longintrepr.h" #endif static CYTHON_INLINE int __Pyx_PyInt_As_int(PyObject *x) { const int neg_one = (int) -1, const_zero = (int) 0; const int is_unsigned = neg_one > const_zero; #if PY_MAJOR_VERSION < 3 if (likely(PyInt_Check(x))) { if (sizeof(int) < sizeof(long)) { __PYX_VERIFY_RETURN_INT(int, long, PyInt_AS_LONG(x)) } else { long val = PyInt_AS_LONG(x); if (is_unsigned && unlikely(val < 0)) { goto raise_neg_overflow; } return (int) val; } } else #endif if (likely(PyLong_Check(x))) { if (is_unsigned) { #if CYTHON_USE_PYLONG_INTERNALS const digit* digits = ((PyLongObject*)x)->ob_digit; switch (Py_SIZE(x)) { case 0: return (int) 0; case 1: __PYX_VERIFY_RETURN_INT(int, digit, digits[0]) case 2: if (8 * sizeof(int) > 1 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(int) >= 2 * PyLong_SHIFT) { return (int) (((((int)digits[1]) << PyLong_SHIFT) | (int)digits[0])); } } break; case 3: if (8 * sizeof(int) > 2 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(int) >= 3 * PyLong_SHIFT) { return (int) (((((((int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0])); } } break; case 4: if (8 * sizeof(int) > 3 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(int) >= 4 * PyLong_SHIFT) { return (int) (((((((((int)digits[3]) << PyLong_SHIFT) | (int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0])); } } break; } #endif #if CYTHON_COMPILING_IN_CPYTHON if (unlikely(Py_SIZE(x) < 0)) { goto raise_neg_overflow; } #else { int result = PyObject_RichCompareBool(x, Py_False, Py_LT); if (unlikely(result < 0)) return (int) -1; if (unlikely(result == 1)) goto raise_neg_overflow; } #endif if (sizeof(int) <= sizeof(unsigned long)) { __PYX_VERIFY_RETURN_INT_EXC(int, unsigned long, PyLong_AsUnsignedLong(x)) } else if (sizeof(int) <= sizeof(unsigned PY_LONG_LONG)) { __PYX_VERIFY_RETURN_INT_EXC(int, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x)) } } else { #if CYTHON_USE_PYLONG_INTERNALS const digit* digits = ((PyLongObject*)x)->ob_digit; switch (Py_SIZE(x)) { case 0: return (int) 0; case -1: __PYX_VERIFY_RETURN_INT(int, sdigit, -(sdigit) digits[0]) case 1: __PYX_VERIFY_RETURN_INT(int, digit, +digits[0]) case -2: if (8 * sizeof(int) - 1 > 1 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(int, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(int) - 1 > 2 * PyLong_SHIFT) { return (int) (((int)-1)*(((((int)digits[1]) << PyLong_SHIFT) | (int)digits[0]))); } } break; case 2: if (8 * sizeof(int) > 1 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(int) - 1 > 2 * PyLong_SHIFT) { return (int) ((((((int)digits[1]) << PyLong_SHIFT) | (int)digits[0]))); } } break; case -3: if (8 * sizeof(int) - 1 > 2 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(int, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(int) - 1 > 3 * PyLong_SHIFT) { return (int) (((int)-1)*(((((((int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0]))); } } break; case 3: if (8 * sizeof(int) > 2 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(int) - 1 > 3 * PyLong_SHIFT) { return (int) ((((((((int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0]))); } } break; case -4: if (8 * sizeof(int) - 1 > 3 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(int, long, -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(int) - 1 > 4 * PyLong_SHIFT) { return (int) (((int)-1)*(((((((((int)digits[3]) << PyLong_SHIFT) | (int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0]))); } } break; case 4: if (8 * sizeof(int) > 3 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(int) - 1 > 4 * PyLong_SHIFT) { return (int) ((((((((((int)digits[3]) << PyLong_SHIFT) | (int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0]))); } } break; } #endif if (sizeof(int) <= sizeof(long)) { __PYX_VERIFY_RETURN_INT_EXC(int, long, PyLong_AsLong(x)) } else if (sizeof(int) <= sizeof(PY_LONG_LONG)) { __PYX_VERIFY_RETURN_INT_EXC(int, PY_LONG_LONG, PyLong_AsLongLong(x)) } } { #if CYTHON_COMPILING_IN_PYPY && !defined(_PyLong_AsByteArray) PyErr_SetString(PyExc_RuntimeError, "_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers"); #else int val; PyObject *v = __Pyx_PyNumber_Int(x); #if PY_MAJOR_VERSION < 3 if (likely(v) && !PyLong_Check(v)) { PyObject *tmp = v; v = PyNumber_Long(tmp); Py_DECREF(tmp); } #endif if (likely(v)) { int one = 1; int is_little = (int)*(unsigned char *)&one; unsigned char *bytes = (unsigned char *)&val; int ret = _PyLong_AsByteArray((PyLongObject *)v, bytes, sizeof(val), is_little, !is_unsigned); Py_DECREF(v); if (likely(!ret)) return val; } #endif return (int) -1; } } else { int val; PyObject *tmp = __Pyx_PyNumber_Int(x); if (!tmp) return (int) -1; val = __Pyx_PyInt_As_int(tmp); Py_DECREF(tmp); return val; } raise_overflow: PyErr_SetString(PyExc_OverflowError, "value too large to convert to int"); return (int) -1; raise_neg_overflow: PyErr_SetString(PyExc_OverflowError, "can't convert negative value to int"); return (int) -1; } static CYTHON_INLINE PyObject* __Pyx_PyInt_From_int(int value) { const int neg_one = (int) -1, const_zero = (int) 0; const int is_unsigned = neg_one > const_zero; if (is_unsigned) { if (sizeof(int) < sizeof(long)) { return PyInt_FromLong((long) value); } else if (sizeof(int) <= sizeof(unsigned long)) { return PyLong_FromUnsignedLong((unsigned long) value); } else if (sizeof(int) <= sizeof(unsigned PY_LONG_LONG)) { return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value); } } else { if (sizeof(int) <= sizeof(long)) { return PyInt_FromLong((long) value); } else if (sizeof(int) <= sizeof(PY_LONG_LONG)) { return PyLong_FromLongLong((PY_LONG_LONG) value); } } { int one = 1; int little = (int)*(unsigned char *)&one; unsigned char *bytes = (unsigned char *)&value; return _PyLong_FromByteArray(bytes, sizeof(int), little, !is_unsigned); } } static CYTHON_INLINE PyObject* __Pyx_PyInt_From_long(long value) { const long neg_one = (long) -1, const_zero = (long) 0; const int is_unsigned = neg_one > const_zero; if (is_unsigned) { if (sizeof(long) < sizeof(long)) { return PyInt_FromLong((long) value); } else if (sizeof(long) <= sizeof(unsigned long)) { return PyLong_FromUnsignedLong((unsigned long) value); } else if (sizeof(long) <= sizeof(unsigned PY_LONG_LONG)) { return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value); } } else { if (sizeof(long) <= sizeof(long)) { return PyInt_FromLong((long) value); } else if (sizeof(long) <= sizeof(PY_LONG_LONG)) { return PyLong_FromLongLong((PY_LONG_LONG) value); } } { int one = 1; int little = (int)*(unsigned char *)&one; unsigned char *bytes = (unsigned char *)&value; return _PyLong_FromByteArray(bytes, sizeof(long), little, !is_unsigned); } } static CYTHON_INLINE long __Pyx_PyInt_As_long(PyObject *x) { const long neg_one = (long) -1, const_zero = (long) 0; const int is_unsigned = neg_one > const_zero; #if PY_MAJOR_VERSION < 3 if (likely(PyInt_Check(x))) { if (sizeof(long) < sizeof(long)) { __PYX_VERIFY_RETURN_INT(long, long, PyInt_AS_LONG(x)) } else { long val = PyInt_AS_LONG(x); if (is_unsigned && unlikely(val < 0)) { goto raise_neg_overflow; } return (long) val; } } else #endif if (likely(PyLong_Check(x))) { if (is_unsigned) { #if CYTHON_USE_PYLONG_INTERNALS const digit* digits = ((PyLongObject*)x)->ob_digit; switch (Py_SIZE(x)) { case 0: return (long) 0; case 1: __PYX_VERIFY_RETURN_INT(long, digit, digits[0]) case 2: if (8 * sizeof(long) > 1 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(long) >= 2 * PyLong_SHIFT) { return (long) (((((long)digits[1]) << PyLong_SHIFT) | (long)digits[0])); } } break; case 3: if (8 * sizeof(long) > 2 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(long) >= 3 * PyLong_SHIFT) { return (long) (((((((long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0])); } } break; case 4: if (8 * sizeof(long) > 3 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(long) >= 4 * PyLong_SHIFT) { return (long) (((((((((long)digits[3]) << PyLong_SHIFT) | (long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0])); } } break; } #endif #if CYTHON_COMPILING_IN_CPYTHON if (unlikely(Py_SIZE(x) < 0)) { goto raise_neg_overflow; } #else { int result = PyObject_RichCompareBool(x, Py_False, Py_LT); if (unlikely(result < 0)) return (long) -1; if (unlikely(result == 1)) goto raise_neg_overflow; } #endif if (sizeof(long) <= sizeof(unsigned long)) { __PYX_VERIFY_RETURN_INT_EXC(long, unsigned long, PyLong_AsUnsignedLong(x)) } else if (sizeof(long) <= sizeof(unsigned PY_LONG_LONG)) { __PYX_VERIFY_RETURN_INT_EXC(long, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x)) } } else { #if CYTHON_USE_PYLONG_INTERNALS const digit* digits = ((PyLongObject*)x)->ob_digit; switch (Py_SIZE(x)) { case 0: return (long) 0; case -1: __PYX_VERIFY_RETURN_INT(long, sdigit, -(sdigit) digits[0]) case 1: __PYX_VERIFY_RETURN_INT(long, digit, +digits[0]) case -2: if (8 * sizeof(long) - 1 > 1 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(long, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) { return (long) (((long)-1)*(((((long)digits[1]) << PyLong_SHIFT) | (long)digits[0]))); } } break; case 2: if (8 * sizeof(long) > 1 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) { return (long) ((((((long)digits[1]) << PyLong_SHIFT) | (long)digits[0]))); } } break; case -3: if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(long, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) { return (long) (((long)-1)*(((((((long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0]))); } } break; case 3: if (8 * sizeof(long) > 2 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) { return (long) ((((((((long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0]))); } } break; case -4: if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(long, long, -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(long) - 1 > 4 * PyLong_SHIFT) { return (long) (((long)-1)*(((((((((long)digits[3]) << PyLong_SHIFT) | (long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0]))); } } break; case 4: if (8 * sizeof(long) > 3 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(long) - 1 > 4 * PyLong_SHIFT) { return (long) ((((((((((long)digits[3]) << PyLong_SHIFT) | (long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0]))); } } break; } #endif if (sizeof(long) <= sizeof(long)) { __PYX_VERIFY_RETURN_INT_EXC(long, long, PyLong_AsLong(x)) } else if (sizeof(long) <= sizeof(PY_LONG_LONG)) { __PYX_VERIFY_RETURN_INT_EXC(long, PY_LONG_LONG, PyLong_AsLongLong(x)) } } { #if CYTHON_COMPILING_IN_PYPY && !defined(_PyLong_AsByteArray) PyErr_SetString(PyExc_RuntimeError, "_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers"); #else long val; PyObject *v = __Pyx_PyNumber_Int(x); #if PY_MAJOR_VERSION < 3 if (likely(v) && !PyLong_Check(v)) { PyObject *tmp = v; v = PyNumber_Long(tmp); Py_DECREF(tmp); } #endif if (likely(v)) { int one = 1; int is_little = (int)*(unsigned char *)&one; unsigned char *bytes = (unsigned char *)&val; int ret = _PyLong_AsByteArray((PyLongObject *)v, bytes, sizeof(val), is_little, !is_unsigned); Py_DECREF(v); if (likely(!ret)) return val; } #endif return (long) -1; } } else { long val; PyObject *tmp = __Pyx_PyNumber_Int(x); if (!tmp) return (long) -1; val = __Pyx_PyInt_As_long(tmp); Py_DECREF(tmp); return val; } raise_overflow: PyErr_SetString(PyExc_OverflowError, "value too large to convert to long"); return (long) -1; raise_neg_overflow: PyErr_SetString(PyExc_OverflowError, "can't convert negative value to long"); return (long) -1; } static int __Pyx_check_binary_version(void) { char ctversion[4], rtversion[4]; PyOS_snprintf(ctversion, 4, "%d.%d", PY_MAJOR_VERSION, PY_MINOR_VERSION); PyOS_snprintf(rtversion, 4, "%s", Py_GetVersion()); if (ctversion[0] != rtversion[0] || ctversion[2] != rtversion[2]) { char message[200]; PyOS_snprintf(message, sizeof(message), "compiletime version %s of module '%.100s' " "does not match runtime version %s", ctversion, __Pyx_MODULE_NAME, rtversion); return PyErr_WarnEx(NULL, message, 1); } return 0; } #ifndef __PYX_HAVE_RT_ImportModule #define __PYX_HAVE_RT_ImportModule static PyObject *__Pyx_ImportModule(const char *name) { PyObject *py_name = 0; PyObject *py_module = 0; py_name = __Pyx_PyIdentifier_FromString(name); if (!py_name) goto bad; py_module = PyImport_Import(py_name); Py_DECREF(py_name); return py_module; bad: Py_XDECREF(py_name); return 0; } #endif #ifndef __PYX_HAVE_RT_ImportType #define __PYX_HAVE_RT_ImportType static PyTypeObject *__Pyx_ImportType(const char *module_name, const char *class_name, size_t size, int strict) { PyObject *py_module = 0; PyObject *result = 0; PyObject *py_name = 0; char warning[200]; Py_ssize_t basicsize; #ifdef Py_LIMITED_API PyObject *py_basicsize; #endif py_module = __Pyx_ImportModule(module_name); if (!py_module) goto bad; py_name = __Pyx_PyIdentifier_FromString(class_name); if (!py_name) goto bad; result = PyObject_GetAttr(py_module, py_name); Py_DECREF(py_name); py_name = 0; Py_DECREF(py_module); py_module = 0; if (!result) goto bad; if (!PyType_Check(result)) { PyErr_Format(PyExc_TypeError, "%.200s.%.200s is not a type object", module_name, class_name); goto bad; } #ifndef Py_LIMITED_API basicsize = ((PyTypeObject *)result)->tp_basicsize; #else py_basicsize = PyObject_GetAttrString(result, "__basicsize__"); if (!py_basicsize) goto bad; basicsize = PyLong_AsSsize_t(py_basicsize); Py_DECREF(py_basicsize); py_basicsize = 0; if (basicsize == (Py_ssize_t)-1 && PyErr_Occurred()) goto bad; #endif if (!strict && (size_t)basicsize > size) { PyOS_snprintf(warning, sizeof(warning), "%s.%s size changed, may indicate binary incompatibility", module_name, class_name); if (PyErr_WarnEx(NULL, warning, 0) < 0) goto bad; } else if ((size_t)basicsize != size) { PyErr_Format(PyExc_ValueError, "%.200s.%.200s has the wrong size, try recompiling", module_name, class_name); goto bad; } return (PyTypeObject *)result; bad: Py_XDECREF(py_module); Py_XDECREF(result); return NULL; } #endif #ifndef __PYX_HAVE_RT_ImportFunction #define __PYX_HAVE_RT_ImportFunction static int __Pyx_ImportFunction(PyObject *module, const char *funcname, void (**f)(void), const char *sig) { PyObject *d = 0; PyObject *cobj = 0; union { void (*fp)(void); void *p; } tmp; d = PyObject_GetAttrString(module, (char *)"__pyx_capi__"); if (!d) goto bad; cobj = PyDict_GetItemString(d, funcname); if (!cobj) { PyErr_Format(PyExc_ImportError, "%.200s does not export expected C function %.200s", PyModule_GetName(module), funcname); goto bad; } #if PY_VERSION_HEX >= 0x02070000 if (!PyCapsule_IsValid(cobj, sig)) { PyErr_Format(PyExc_TypeError, "C function %.200s.%.200s has wrong signature (expected %.500s, got %.500s)", PyModule_GetName(module), funcname, sig, PyCapsule_GetName(cobj)); goto bad; } tmp.p = PyCapsule_GetPointer(cobj, sig); #else {const char *desc, *s1, *s2; desc = (const char *)PyCObject_GetDesc(cobj); if (!desc) goto bad; s1 = desc; s2 = sig; while (*s1 != '\0' && *s1 == *s2) { s1++; s2++; } if (*s1 != *s2) { PyErr_Format(PyExc_TypeError, "C function %.200s.%.200s has wrong signature (expected %.500s, got %.500s)", PyModule_GetName(module), funcname, sig, desc); goto bad; } tmp.p = PyCObject_AsVoidPtr(cobj);} #endif *f = tmp.fp; if (!(*f)) goto bad; Py_DECREF(d); return 0; bad: Py_XDECREF(d); return -1; } #endif static int __Pyx_InitStrings(__Pyx_StringTabEntry *t) { while (t->p) { #if PY_MAJOR_VERSION < 3 if (t->is_unicode) { *t->p = PyUnicode_DecodeUTF8(t->s, t->n - 1, NULL); } else if (t->intern) { *t->p = PyString_InternFromString(t->s); } else { *t->p = PyString_FromStringAndSize(t->s, t->n - 1); } #else if (t->is_unicode | t->is_str) { if (t->intern) { *t->p = PyUnicode_InternFromString(t->s); } else if (t->encoding) { *t->p = PyUnicode_Decode(t->s, t->n - 1, t->encoding, NULL); } else { *t->p = PyUnicode_FromStringAndSize(t->s, t->n - 1); } } else { *t->p = PyBytes_FromStringAndSize(t->s, t->n - 1); } #endif if (!*t->p) return -1; ++t; } return 0; } static CYTHON_INLINE PyObject* __Pyx_PyUnicode_FromString(const char* c_str) { return __Pyx_PyUnicode_FromStringAndSize(c_str, (Py_ssize_t)strlen(c_str)); } static CYTHON_INLINE char* __Pyx_PyObject_AsString(PyObject* o) { Py_ssize_t ignore; return __Pyx_PyObject_AsStringAndSize(o, &ignore); } static CYTHON_INLINE char* __Pyx_PyObject_AsStringAndSize(PyObject* o, Py_ssize_t *length) { #if CYTHON_COMPILING_IN_CPYTHON && (__PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT) if ( #if PY_MAJOR_VERSION < 3 && __PYX_DEFAULT_STRING_ENCODING_IS_ASCII __Pyx_sys_getdefaultencoding_not_ascii && #endif PyUnicode_Check(o)) { #if PY_VERSION_HEX < 0x03030000 char* defenc_c; PyObject* defenc = _PyUnicode_AsDefaultEncodedString(o, NULL); if (!defenc) return NULL; defenc_c = PyBytes_AS_STRING(defenc); #if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII { char* end = defenc_c + PyBytes_GET_SIZE(defenc); char* c; for (c = defenc_c; c < end; c++) { if ((unsigned char) (*c) >= 128) { PyUnicode_AsASCIIString(o); return NULL; } } } #endif *length = PyBytes_GET_SIZE(defenc); return defenc_c; #else if (__Pyx_PyUnicode_READY(o) == -1) return NULL; #if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII if (PyUnicode_IS_ASCII(o)) { *length = PyUnicode_GET_LENGTH(o); return PyUnicode_AsUTF8(o); } else { PyUnicode_AsASCIIString(o); return NULL; } #else return PyUnicode_AsUTF8AndSize(o, length); #endif #endif } else #endif #if (!CYTHON_COMPILING_IN_PYPY) || (defined(PyByteArray_AS_STRING) && defined(PyByteArray_GET_SIZE)) if (PyByteArray_Check(o)) { *length = PyByteArray_GET_SIZE(o); return PyByteArray_AS_STRING(o); } else #endif { char* result; int r = PyBytes_AsStringAndSize(o, &result, length); if (unlikely(r < 0)) { return NULL; } else { return result; } } } static CYTHON_INLINE int __Pyx_PyObject_IsTrue(PyObject* x) { int is_true = x == Py_True; if (is_true | (x == Py_False) | (x == Py_None)) return is_true; else return PyObject_IsTrue(x); } static CYTHON_INLINE PyObject* __Pyx_PyNumber_Int(PyObject* x) { PyNumberMethods *m; const char *name = NULL; PyObject *res = NULL; #if PY_MAJOR_VERSION < 3 if (PyInt_Check(x) || PyLong_Check(x)) #else if (PyLong_Check(x)) #endif return __Pyx_NewRef(x); m = Py_TYPE(x)->tp_as_number; #if PY_MAJOR_VERSION < 3 if (m && m->nb_int) { name = "int"; res = PyNumber_Int(x); } else if (m && m->nb_long) { name = "long"; res = PyNumber_Long(x); } #else if (m && m->nb_int) { name = "int"; res = PyNumber_Long(x); } #endif if (res) { #if PY_MAJOR_VERSION < 3 if (!PyInt_Check(res) && !PyLong_Check(res)) { #else if (!PyLong_Check(res)) { #endif PyErr_Format(PyExc_TypeError, "__%.4s__ returned non-%.4s (type %.200s)", name, name, Py_TYPE(res)->tp_name); Py_DECREF(res); return NULL; } } else if (!PyErr_Occurred()) { PyErr_SetString(PyExc_TypeError, "an integer is required"); } return res; } static CYTHON_INLINE Py_ssize_t __Pyx_PyIndex_AsSsize_t(PyObject* b) { Py_ssize_t ival; PyObject *x; #if PY_MAJOR_VERSION < 3 if (likely(PyInt_CheckExact(b))) { if (sizeof(Py_ssize_t) >= sizeof(long)) return PyInt_AS_LONG(b); else return PyInt_AsSsize_t(x); } #endif if (likely(PyLong_CheckExact(b))) { #if CYTHON_USE_PYLONG_INTERNALS const digit* digits = ((PyLongObject*)b)->ob_digit; const Py_ssize_t size = Py_SIZE(b); if (likely(__Pyx_sst_abs(size) <= 1)) { ival = likely(size) ? digits[0] : 0; if (size == -1) ival = -ival; return ival; } else { switch (size) { case 2: if (8 * sizeof(Py_ssize_t) > 2 * PyLong_SHIFT) { return (Py_ssize_t) (((((size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])); } break; case -2: if (8 * sizeof(Py_ssize_t) > 2 * PyLong_SHIFT) { return -(Py_ssize_t) (((((size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])); } break; case 3: if (8 * sizeof(Py_ssize_t) > 3 * PyLong_SHIFT) { return (Py_ssize_t) (((((((size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])); } break; case -3: if (8 * sizeof(Py_ssize_t) > 3 * PyLong_SHIFT) { return -(Py_ssize_t) (((((((size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])); } break; case 4: if (8 * sizeof(Py_ssize_t) > 4 * PyLong_SHIFT) { return (Py_ssize_t) (((((((((size_t)digits[3]) << PyLong_SHIFT) | (size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])); } break; case -4: if (8 * sizeof(Py_ssize_t) > 4 * PyLong_SHIFT) { return -(Py_ssize_t) (((((((((size_t)digits[3]) << PyLong_SHIFT) | (size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])); } break; } } #endif return PyLong_AsSsize_t(b); } x = PyNumber_Index(b); if (!x) return -1; ival = PyInt_AsSsize_t(x); Py_DECREF(x); return ival; } static CYTHON_INLINE PyObject * __Pyx_PyInt_FromSize_t(size_t ival) { return PyInt_FromSize_t(ival); } #endif /* Py_PYTHON_H */ pygame_sdl2-2.1.0-for-renpy-6.99.14.1/gen3/pygame_sdl2.rect.c0000664000175000017500000213247513042563034022426 0ustar tomtom00000000000000/* Generated by Cython 0.23.5 */ #define PY_SSIZE_T_CLEAN #include "Python.h" #ifndef Py_PYTHON_H #error Python headers needed to compile C extensions, please install development version of Python. #elif PY_VERSION_HEX < 0x02060000 || (0x03000000 <= PY_VERSION_HEX && PY_VERSION_HEX < 0x03020000) #error Cython requires Python 2.6+ or Python 3.2+. #else #define CYTHON_ABI "0_23_5" #include #ifndef offsetof #define offsetof(type, member) ( (size_t) & ((type*)0) -> member ) #endif #if !defined(WIN32) && !defined(MS_WINDOWS) #ifndef __stdcall #define __stdcall #endif #ifndef __cdecl #define __cdecl #endif #ifndef __fastcall #define __fastcall #endif #endif #ifndef DL_IMPORT #define DL_IMPORT(t) t #endif #ifndef DL_EXPORT #define DL_EXPORT(t) t #endif #ifndef PY_LONG_LONG #define PY_LONG_LONG LONG_LONG #endif #ifndef Py_HUGE_VAL #define Py_HUGE_VAL HUGE_VAL #endif #ifdef PYPY_VERSION #define CYTHON_COMPILING_IN_PYPY 1 #define CYTHON_COMPILING_IN_CPYTHON 0 #else #define CYTHON_COMPILING_IN_PYPY 0 #define CYTHON_COMPILING_IN_CPYTHON 1 #endif #if !defined(CYTHON_USE_PYLONG_INTERNALS) && CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x02070000 #define CYTHON_USE_PYLONG_INTERNALS 1 #endif #if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX < 0x02070600 && !defined(Py_OptimizeFlag) #define Py_OptimizeFlag 0 #endif #define __PYX_BUILD_PY_SSIZE_T "n" #define CYTHON_FORMAT_SSIZE_T "z" #if PY_MAJOR_VERSION < 3 #define __Pyx_BUILTIN_MODULE_NAME "__builtin__" #define __Pyx_PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)\ PyCode_New(a+k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos) #define __Pyx_DefaultClassType PyClass_Type #else #define __Pyx_BUILTIN_MODULE_NAME "builtins" #define __Pyx_PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)\ PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos) #define __Pyx_DefaultClassType PyType_Type #endif #ifndef Py_TPFLAGS_CHECKTYPES #define Py_TPFLAGS_CHECKTYPES 0 #endif #ifndef Py_TPFLAGS_HAVE_INDEX #define Py_TPFLAGS_HAVE_INDEX 0 #endif #ifndef Py_TPFLAGS_HAVE_NEWBUFFER #define Py_TPFLAGS_HAVE_NEWBUFFER 0 #endif #ifndef Py_TPFLAGS_HAVE_FINALIZE #define Py_TPFLAGS_HAVE_FINALIZE 0 #endif #if PY_VERSION_HEX > 0x03030000 && defined(PyUnicode_KIND) #define CYTHON_PEP393_ENABLED 1 #define __Pyx_PyUnicode_READY(op) (likely(PyUnicode_IS_READY(op)) ?\ 0 : _PyUnicode_Ready((PyObject *)(op))) #define __Pyx_PyUnicode_GET_LENGTH(u) PyUnicode_GET_LENGTH(u) #define __Pyx_PyUnicode_READ_CHAR(u, i) PyUnicode_READ_CHAR(u, i) #define __Pyx_PyUnicode_KIND(u) PyUnicode_KIND(u) #define __Pyx_PyUnicode_DATA(u) PyUnicode_DATA(u) #define __Pyx_PyUnicode_READ(k, d, i) PyUnicode_READ(k, d, i) #else #define CYTHON_PEP393_ENABLED 0 #define __Pyx_PyUnicode_READY(op) (0) #define __Pyx_PyUnicode_GET_LENGTH(u) PyUnicode_GET_SIZE(u) #define __Pyx_PyUnicode_READ_CHAR(u, i) ((Py_UCS4)(PyUnicode_AS_UNICODE(u)[i])) #define __Pyx_PyUnicode_KIND(u) (sizeof(Py_UNICODE)) #define __Pyx_PyUnicode_DATA(u) ((void*)PyUnicode_AS_UNICODE(u)) #define __Pyx_PyUnicode_READ(k, d, i) ((void)(k), (Py_UCS4)(((Py_UNICODE*)d)[i])) #endif #if CYTHON_COMPILING_IN_PYPY #define __Pyx_PyUnicode_Concat(a, b) PyNumber_Add(a, b) #define __Pyx_PyUnicode_ConcatSafe(a, b) PyNumber_Add(a, b) #else #define __Pyx_PyUnicode_Concat(a, b) PyUnicode_Concat(a, b) #define __Pyx_PyUnicode_ConcatSafe(a, b) ((unlikely((a) == Py_None) || unlikely((b) == Py_None)) ?\ PyNumber_Add(a, b) : __Pyx_PyUnicode_Concat(a, b)) #endif #if CYTHON_COMPILING_IN_PYPY && !defined(PyUnicode_Contains) #define PyUnicode_Contains(u, s) PySequence_Contains(u, s) #endif #define __Pyx_PyString_FormatSafe(a, b) ((unlikely((a) == Py_None)) ? PyNumber_Remainder(a, b) : __Pyx_PyString_Format(a, b)) #define __Pyx_PyUnicode_FormatSafe(a, b) ((unlikely((a) == Py_None)) ? PyNumber_Remainder(a, b) : PyUnicode_Format(a, b)) #if PY_MAJOR_VERSION >= 3 #define __Pyx_PyString_Format(a, b) PyUnicode_Format(a, b) #else #define __Pyx_PyString_Format(a, b) PyString_Format(a, b) #endif #if PY_MAJOR_VERSION >= 3 #define PyBaseString_Type PyUnicode_Type #define PyStringObject PyUnicodeObject #define PyString_Type PyUnicode_Type #define PyString_Check PyUnicode_Check #define PyString_CheckExact PyUnicode_CheckExact #endif #if PY_MAJOR_VERSION >= 3 #define __Pyx_PyBaseString_Check(obj) PyUnicode_Check(obj) #define __Pyx_PyBaseString_CheckExact(obj) PyUnicode_CheckExact(obj) #else #define __Pyx_PyBaseString_Check(obj) (PyString_Check(obj) || PyUnicode_Check(obj)) #define __Pyx_PyBaseString_CheckExact(obj) (PyString_CheckExact(obj) || PyUnicode_CheckExact(obj)) #endif #ifndef PySet_CheckExact #define PySet_CheckExact(obj) (Py_TYPE(obj) == &PySet_Type) #endif #define __Pyx_TypeCheck(obj, type) PyObject_TypeCheck(obj, (PyTypeObject *)type) #if PY_MAJOR_VERSION >= 3 #define PyIntObject PyLongObject #define PyInt_Type PyLong_Type #define PyInt_Check(op) PyLong_Check(op) #define PyInt_CheckExact(op) PyLong_CheckExact(op) #define PyInt_FromString PyLong_FromString #define PyInt_FromUnicode PyLong_FromUnicode #define PyInt_FromLong PyLong_FromLong #define PyInt_FromSize_t PyLong_FromSize_t #define PyInt_FromSsize_t PyLong_FromSsize_t #define PyInt_AsLong PyLong_AsLong #define PyInt_AS_LONG PyLong_AS_LONG #define PyInt_AsSsize_t PyLong_AsSsize_t #define PyInt_AsUnsignedLongMask PyLong_AsUnsignedLongMask #define PyInt_AsUnsignedLongLongMask PyLong_AsUnsignedLongLongMask #define PyNumber_Int PyNumber_Long #endif #if PY_MAJOR_VERSION >= 3 #define PyBoolObject PyLongObject #endif #if PY_MAJOR_VERSION >= 3 && CYTHON_COMPILING_IN_PYPY #ifndef PyUnicode_InternFromString #define PyUnicode_InternFromString(s) PyUnicode_FromString(s) #endif #endif #if PY_VERSION_HEX < 0x030200A4 typedef long Py_hash_t; #define __Pyx_PyInt_FromHash_t PyInt_FromLong #define __Pyx_PyInt_AsHash_t PyInt_AsLong #else #define __Pyx_PyInt_FromHash_t PyInt_FromSsize_t #define __Pyx_PyInt_AsHash_t PyInt_AsSsize_t #endif #if PY_MAJOR_VERSION >= 3 #define __Pyx_PyMethod_New(func, self, klass) ((self) ? PyMethod_New(func, self) : PyInstanceMethod_New(func)) #else #define __Pyx_PyMethod_New(func, self, klass) PyMethod_New(func, self, klass) #endif #if PY_VERSION_HEX >= 0x030500B1 #define __Pyx_PyAsyncMethodsStruct PyAsyncMethods #define __Pyx_PyType_AsAsync(obj) (Py_TYPE(obj)->tp_as_async) #elif CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3 typedef struct { unaryfunc am_await; unaryfunc am_aiter; unaryfunc am_anext; } __Pyx_PyAsyncMethodsStruct; #define __Pyx_PyType_AsAsync(obj) ((__Pyx_PyAsyncMethodsStruct*) (Py_TYPE(obj)->tp_reserved)) #else #define __Pyx_PyType_AsAsync(obj) NULL #endif #ifndef CYTHON_RESTRICT #if defined(__GNUC__) #define CYTHON_RESTRICT __restrict__ #elif defined(_MSC_VER) && _MSC_VER >= 1400 #define CYTHON_RESTRICT __restrict #elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L #define CYTHON_RESTRICT restrict #else #define CYTHON_RESTRICT #endif #endif #define __Pyx_void_to_None(void_result) ((void)(void_result), Py_INCREF(Py_None), Py_None) #ifndef CYTHON_INLINE #if defined(__GNUC__) #define CYTHON_INLINE __inline__ #elif defined(_MSC_VER) #define CYTHON_INLINE __inline #elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L #define CYTHON_INLINE inline #else #define CYTHON_INLINE #endif #endif #if defined(WIN32) || defined(MS_WINDOWS) #define _USE_MATH_DEFINES #endif #include #ifdef NAN #define __PYX_NAN() ((float) NAN) #else static CYTHON_INLINE float __PYX_NAN() { float value; memset(&value, 0xFF, sizeof(value)); return value; } #endif #if PY_MAJOR_VERSION >= 3 #define __Pyx_PyNumber_Divide(x,y) PyNumber_TrueDivide(x,y) #define __Pyx_PyNumber_InPlaceDivide(x,y) PyNumber_InPlaceTrueDivide(x,y) #else #define __Pyx_PyNumber_Divide(x,y) PyNumber_TrueDivide(x,y) #define __Pyx_PyNumber_InPlaceDivide(x,y) PyNumber_InPlaceTrueDivide(x,y) #endif #ifndef __PYX_EXTERN_C #ifdef __cplusplus #define __PYX_EXTERN_C extern "C" #else #define __PYX_EXTERN_C extern #endif #endif #define __PYX_HAVE__pygame_sdl2__rect #define __PYX_HAVE_API__pygame_sdl2__rect #include "stdint.h" #include "string.h" #include "stdio.h" #include "stddef.h" #include "SDL.h" #ifdef _OPENMP #include #endif /* _OPENMP */ #ifdef PYREX_WITHOUT_ASSERTIONS #define CYTHON_WITHOUT_ASSERTIONS #endif #ifndef CYTHON_UNUSED # if defined(__GNUC__) # if !(defined(__cplusplus)) || (__GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 4)) # define CYTHON_UNUSED __attribute__ ((__unused__)) # else # define CYTHON_UNUSED # endif # elif defined(__ICC) || (defined(__INTEL_COMPILER) && !defined(_MSC_VER)) # define CYTHON_UNUSED __attribute__ ((__unused__)) # else # define CYTHON_UNUSED # endif #endif #ifndef CYTHON_NCP_UNUSED # if CYTHON_COMPILING_IN_CPYTHON # define CYTHON_NCP_UNUSED # else # define CYTHON_NCP_UNUSED CYTHON_UNUSED # endif #endif typedef struct {PyObject **p; char *s; const Py_ssize_t n; const char* encoding; const char is_unicode; const char is_str; const char intern; } __Pyx_StringTabEntry; #define __PYX_DEFAULT_STRING_ENCODING_IS_ASCII 0 #define __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT 0 #define __PYX_DEFAULT_STRING_ENCODING "" #define __Pyx_PyObject_FromString __Pyx_PyBytes_FromString #define __Pyx_PyObject_FromStringAndSize __Pyx_PyBytes_FromStringAndSize #define __Pyx_uchar_cast(c) ((unsigned char)c) #define __Pyx_long_cast(x) ((long)x) #define __Pyx_fits_Py_ssize_t(v, type, is_signed) (\ (sizeof(type) < sizeof(Py_ssize_t)) ||\ (sizeof(type) > sizeof(Py_ssize_t) &&\ likely(v < (type)PY_SSIZE_T_MAX ||\ v == (type)PY_SSIZE_T_MAX) &&\ (!is_signed || likely(v > (type)PY_SSIZE_T_MIN ||\ v == (type)PY_SSIZE_T_MIN))) ||\ (sizeof(type) == sizeof(Py_ssize_t) &&\ (is_signed || likely(v < (type)PY_SSIZE_T_MAX ||\ v == (type)PY_SSIZE_T_MAX))) ) #if defined (__cplusplus) && __cplusplus >= 201103L #include #define __Pyx_sst_abs(value) std::abs(value) #elif SIZEOF_INT >= SIZEOF_SIZE_T #define __Pyx_sst_abs(value) abs(value) #elif SIZEOF_LONG >= SIZEOF_SIZE_T #define __Pyx_sst_abs(value) labs(value) #elif defined (_MSC_VER) && defined (_M_X64) #define __Pyx_sst_abs(value) _abs64(value) #elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L #define __Pyx_sst_abs(value) llabs(value) #elif defined (__GNUC__) #define __Pyx_sst_abs(value) __builtin_llabs(value) #else #define __Pyx_sst_abs(value) ((value<0) ? -value : value) #endif static CYTHON_INLINE char* __Pyx_PyObject_AsString(PyObject*); static CYTHON_INLINE char* __Pyx_PyObject_AsStringAndSize(PyObject*, Py_ssize_t* length); #define __Pyx_PyByteArray_FromString(s) PyByteArray_FromStringAndSize((const char*)s, strlen((const char*)s)) #define __Pyx_PyByteArray_FromStringAndSize(s, l) PyByteArray_FromStringAndSize((const char*)s, l) #define __Pyx_PyBytes_FromString PyBytes_FromString #define __Pyx_PyBytes_FromStringAndSize PyBytes_FromStringAndSize static CYTHON_INLINE PyObject* __Pyx_PyUnicode_FromString(const char*); #if PY_MAJOR_VERSION < 3 #define __Pyx_PyStr_FromString __Pyx_PyBytes_FromString #define __Pyx_PyStr_FromStringAndSize __Pyx_PyBytes_FromStringAndSize #else #define __Pyx_PyStr_FromString __Pyx_PyUnicode_FromString #define __Pyx_PyStr_FromStringAndSize __Pyx_PyUnicode_FromStringAndSize #endif #define __Pyx_PyObject_AsSString(s) ((signed char*) __Pyx_PyObject_AsString(s)) #define __Pyx_PyObject_AsUString(s) ((unsigned char*) __Pyx_PyObject_AsString(s)) #define __Pyx_PyObject_FromCString(s) __Pyx_PyObject_FromString((const char*)s) #define __Pyx_PyBytes_FromCString(s) __Pyx_PyBytes_FromString((const char*)s) #define __Pyx_PyByteArray_FromCString(s) __Pyx_PyByteArray_FromString((const char*)s) #define __Pyx_PyStr_FromCString(s) __Pyx_PyStr_FromString((const char*)s) #define __Pyx_PyUnicode_FromCString(s) __Pyx_PyUnicode_FromString((const char*)s) #if PY_MAJOR_VERSION < 3 static CYTHON_INLINE size_t __Pyx_Py_UNICODE_strlen(const Py_UNICODE *u) { const Py_UNICODE *u_end = u; while (*u_end++) ; return (size_t)(u_end - u - 1); } #else #define __Pyx_Py_UNICODE_strlen Py_UNICODE_strlen #endif #define __Pyx_PyUnicode_FromUnicode(u) PyUnicode_FromUnicode(u, __Pyx_Py_UNICODE_strlen(u)) #define __Pyx_PyUnicode_FromUnicodeAndLength PyUnicode_FromUnicode #define __Pyx_PyUnicode_AsUnicode PyUnicode_AsUnicode #define __Pyx_NewRef(obj) (Py_INCREF(obj), obj) #define __Pyx_Owned_Py_None(b) __Pyx_NewRef(Py_None) #define __Pyx_PyBool_FromLong(b) ((b) ? __Pyx_NewRef(Py_True) : __Pyx_NewRef(Py_False)) static CYTHON_INLINE int __Pyx_PyObject_IsTrue(PyObject*); static CYTHON_INLINE PyObject* __Pyx_PyNumber_Int(PyObject* x); static CYTHON_INLINE Py_ssize_t __Pyx_PyIndex_AsSsize_t(PyObject*); static CYTHON_INLINE PyObject * __Pyx_PyInt_FromSize_t(size_t); #if CYTHON_COMPILING_IN_CPYTHON #define __pyx_PyFloat_AsDouble(x) (PyFloat_CheckExact(x) ? PyFloat_AS_DOUBLE(x) : PyFloat_AsDouble(x)) #else #define __pyx_PyFloat_AsDouble(x) PyFloat_AsDouble(x) #endif #define __pyx_PyFloat_AsFloat(x) ((float) __pyx_PyFloat_AsDouble(x)) #if PY_MAJOR_VERSION < 3 && __PYX_DEFAULT_STRING_ENCODING_IS_ASCII static int __Pyx_sys_getdefaultencoding_not_ascii; static int __Pyx_init_sys_getdefaultencoding_params(void) { PyObject* sys; PyObject* default_encoding = NULL; PyObject* ascii_chars_u = NULL; PyObject* ascii_chars_b = NULL; const char* default_encoding_c; sys = PyImport_ImportModule("sys"); if (!sys) goto bad; default_encoding = PyObject_CallMethod(sys, (char*) "getdefaultencoding", NULL); Py_DECREF(sys); if (!default_encoding) goto bad; default_encoding_c = PyBytes_AsString(default_encoding); if (!default_encoding_c) goto bad; if (strcmp(default_encoding_c, "ascii") == 0) { __Pyx_sys_getdefaultencoding_not_ascii = 0; } else { char ascii_chars[128]; int c; for (c = 0; c < 128; c++) { ascii_chars[c] = c; } __Pyx_sys_getdefaultencoding_not_ascii = 1; ascii_chars_u = PyUnicode_DecodeASCII(ascii_chars, 128, NULL); if (!ascii_chars_u) goto bad; ascii_chars_b = PyUnicode_AsEncodedString(ascii_chars_u, default_encoding_c, NULL); if (!ascii_chars_b || !PyBytes_Check(ascii_chars_b) || memcmp(ascii_chars, PyBytes_AS_STRING(ascii_chars_b), 128) != 0) { PyErr_Format( PyExc_ValueError, "This module compiled with c_string_encoding=ascii, but default encoding '%.200s' is not a superset of ascii.", default_encoding_c); goto bad; } Py_DECREF(ascii_chars_u); Py_DECREF(ascii_chars_b); } Py_DECREF(default_encoding); return 0; bad: Py_XDECREF(default_encoding); Py_XDECREF(ascii_chars_u); Py_XDECREF(ascii_chars_b); return -1; } #endif #if __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT && PY_MAJOR_VERSION >= 3 #define __Pyx_PyUnicode_FromStringAndSize(c_str, size) PyUnicode_DecodeUTF8(c_str, size, NULL) #else #define __Pyx_PyUnicode_FromStringAndSize(c_str, size) PyUnicode_Decode(c_str, size, __PYX_DEFAULT_STRING_ENCODING, NULL) #if __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT static char* __PYX_DEFAULT_STRING_ENCODING; static int __Pyx_init_sys_getdefaultencoding_params(void) { PyObject* sys; PyObject* default_encoding = NULL; char* default_encoding_c; sys = PyImport_ImportModule("sys"); if (!sys) goto bad; default_encoding = PyObject_CallMethod(sys, (char*) (const char*) "getdefaultencoding", NULL); Py_DECREF(sys); if (!default_encoding) goto bad; default_encoding_c = PyBytes_AsString(default_encoding); if (!default_encoding_c) goto bad; __PYX_DEFAULT_STRING_ENCODING = (char*) malloc(strlen(default_encoding_c)); if (!__PYX_DEFAULT_STRING_ENCODING) goto bad; strcpy(__PYX_DEFAULT_STRING_ENCODING, default_encoding_c); Py_DECREF(default_encoding); return 0; bad: Py_XDECREF(default_encoding); return -1; } #endif #endif /* Test for GCC > 2.95 */ #if defined(__GNUC__) && (__GNUC__ > 2 || (__GNUC__ == 2 && (__GNUC_MINOR__ > 95))) #define likely(x) __builtin_expect(!!(x), 1) #define unlikely(x) __builtin_expect(!!(x), 0) #else /* !__GNUC__ or GCC < 2.95 */ #define likely(x) (x) #define unlikely(x) (x) #endif /* __GNUC__ */ static PyObject *__pyx_m; static PyObject *__pyx_d; static PyObject *__pyx_b; static PyObject *__pyx_empty_tuple; static PyObject *__pyx_empty_bytes; static int __pyx_lineno; static int __pyx_clineno = 0; static const char * __pyx_cfilenm= __FILE__; static const char *__pyx_filename; static const char *__pyx_f[] = { "src/pygame_sdl2/rect.pyx", "src/pygame_sdl2/rect.pxd", }; /*--- Type declarations ---*/ struct __pyx_obj_11pygame_sdl2_4rect_Rect; struct __pyx_opt_args_11pygame_sdl2_4rect_to_sdl_rect; /* "pygame_sdl2/rect.pxd":31 * * * cdef int to_sdl_rect(rectlike, SDL_Rect *rect, argname=*) except -1 # <<<<<<<<<<<<<< */ struct __pyx_opt_args_11pygame_sdl2_4rect_to_sdl_rect { int __pyx_n; PyObject *argname; }; /* "pygame_sdl2/rect.pxd":21 * from sdl2 cimport * * * cdef class Rect: # <<<<<<<<<<<<<< * # Allow weak references. * cdef object __weakref__ */ struct __pyx_obj_11pygame_sdl2_4rect_Rect { PyObject_HEAD PyObject *__weakref__; int x; int y; int w; int h; }; /* --- Runtime support code (head) --- */ #ifndef CYTHON_REFNANNY #define CYTHON_REFNANNY 0 #endif #if CYTHON_REFNANNY typedef struct { void (*INCREF)(void*, PyObject*, int); void (*DECREF)(void*, PyObject*, int); void (*GOTREF)(void*, PyObject*, int); void (*GIVEREF)(void*, PyObject*, int); void* (*SetupContext)(const char*, int, const char*); void (*FinishContext)(void**); } __Pyx_RefNannyAPIStruct; static __Pyx_RefNannyAPIStruct *__Pyx_RefNanny = NULL; static __Pyx_RefNannyAPIStruct *__Pyx_RefNannyImportAPI(const char *modname); #define __Pyx_RefNannyDeclarations void *__pyx_refnanny = NULL; #ifdef WITH_THREAD #define __Pyx_RefNannySetupContext(name, acquire_gil)\ if (acquire_gil) {\ PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure();\ __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), __LINE__, __FILE__);\ PyGILState_Release(__pyx_gilstate_save);\ } else {\ __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), __LINE__, __FILE__);\ } #else #define __Pyx_RefNannySetupContext(name, acquire_gil)\ __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), __LINE__, __FILE__) #endif #define __Pyx_RefNannyFinishContext()\ __Pyx_RefNanny->FinishContext(&__pyx_refnanny) #define __Pyx_INCREF(r) __Pyx_RefNanny->INCREF(__pyx_refnanny, (PyObject *)(r), __LINE__) #define __Pyx_DECREF(r) __Pyx_RefNanny->DECREF(__pyx_refnanny, (PyObject *)(r), __LINE__) #define __Pyx_GOTREF(r) __Pyx_RefNanny->GOTREF(__pyx_refnanny, (PyObject *)(r), __LINE__) #define __Pyx_GIVEREF(r) __Pyx_RefNanny->GIVEREF(__pyx_refnanny, (PyObject *)(r), __LINE__) #define __Pyx_XINCREF(r) do { if((r) != NULL) {__Pyx_INCREF(r); }} while(0) #define __Pyx_XDECREF(r) do { if((r) != NULL) {__Pyx_DECREF(r); }} while(0) #define __Pyx_XGOTREF(r) do { if((r) != NULL) {__Pyx_GOTREF(r); }} while(0) #define __Pyx_XGIVEREF(r) do { if((r) != NULL) {__Pyx_GIVEREF(r);}} while(0) #else #define __Pyx_RefNannyDeclarations #define __Pyx_RefNannySetupContext(name, acquire_gil) #define __Pyx_RefNannyFinishContext() #define __Pyx_INCREF(r) Py_INCREF(r) #define __Pyx_DECREF(r) Py_DECREF(r) #define __Pyx_GOTREF(r) #define __Pyx_GIVEREF(r) #define __Pyx_XINCREF(r) Py_XINCREF(r) #define __Pyx_XDECREF(r) Py_XDECREF(r) #define __Pyx_XGOTREF(r) #define __Pyx_XGIVEREF(r) #endif #define __Pyx_XDECREF_SET(r, v) do {\ PyObject *tmp = (PyObject *) r;\ r = v; __Pyx_XDECREF(tmp);\ } while (0) #define __Pyx_DECREF_SET(r, v) do {\ PyObject *tmp = (PyObject *) r;\ r = v; __Pyx_DECREF(tmp);\ } while (0) #define __Pyx_CLEAR(r) do { PyObject* tmp = ((PyObject*)(r)); r = NULL; __Pyx_DECREF(tmp);} while(0) #define __Pyx_XCLEAR(r) do { if((r) != NULL) {PyObject* tmp = ((PyObject*)(r)); r = NULL; __Pyx_DECREF(tmp);}} while(0) #if CYTHON_COMPILING_IN_CPYTHON static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStr(PyObject* obj, PyObject* attr_name) { PyTypeObject* tp = Py_TYPE(obj); if (likely(tp->tp_getattro)) return tp->tp_getattro(obj, attr_name); #if PY_MAJOR_VERSION < 3 if (likely(tp->tp_getattr)) return tp->tp_getattr(obj, PyString_AS_STRING(attr_name)); #endif return PyObject_GetAttr(obj, attr_name); } #else #define __Pyx_PyObject_GetAttrStr(o,n) PyObject_GetAttr(o,n) #endif static PyObject *__Pyx_GetBuiltinName(PyObject *name); static CYTHON_INLINE int __Pyx_CheckKeywordStrings(PyObject *kwdict, const char* function_name, int kw_allowed); #define __Pyx_GetItemInt(o, i, type, is_signed, to_py_func, is_list, wraparound, boundscheck)\ (__Pyx_fits_Py_ssize_t(i, type, is_signed) ?\ __Pyx_GetItemInt_Fast(o, (Py_ssize_t)i, is_list, wraparound, boundscheck) :\ (is_list ? (PyErr_SetString(PyExc_IndexError, "list index out of range"), (PyObject*)NULL) :\ __Pyx_GetItemInt_Generic(o, to_py_func(i)))) #define __Pyx_GetItemInt_List(o, i, type, is_signed, to_py_func, is_list, wraparound, boundscheck)\ (__Pyx_fits_Py_ssize_t(i, type, is_signed) ?\ __Pyx_GetItemInt_List_Fast(o, (Py_ssize_t)i, wraparound, boundscheck) :\ (PyErr_SetString(PyExc_IndexError, "list index out of range"), (PyObject*)NULL)) static CYTHON_INLINE PyObject *__Pyx_GetItemInt_List_Fast(PyObject *o, Py_ssize_t i, int wraparound, int boundscheck); #define __Pyx_GetItemInt_Tuple(o, i, type, is_signed, to_py_func, is_list, wraparound, boundscheck)\ (__Pyx_fits_Py_ssize_t(i, type, is_signed) ?\ __Pyx_GetItemInt_Tuple_Fast(o, (Py_ssize_t)i, wraparound, boundscheck) :\ (PyErr_SetString(PyExc_IndexError, "tuple index out of range"), (PyObject*)NULL)) static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Tuple_Fast(PyObject *o, Py_ssize_t i, int wraparound, int boundscheck); static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Generic(PyObject *o, PyObject* j); static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Fast(PyObject *o, Py_ssize_t i, int is_list, int wraparound, int boundscheck); static CYTHON_INLINE int __Pyx_TypeTest(PyObject *obj, PyTypeObject *type); static CYTHON_INLINE void __Pyx_RaiseTooManyValuesError(Py_ssize_t expected); static CYTHON_INLINE void __Pyx_RaiseNeedMoreValuesError(Py_ssize_t index); static CYTHON_INLINE int __Pyx_IterFinish(void); static int __Pyx_IternextUnpackEndCheck(PyObject *retval, Py_ssize_t expected); #if CYTHON_COMPILING_IN_CPYTHON static CYTHON_INLINE PyObject* __Pyx_PyObject_Call(PyObject *func, PyObject *arg, PyObject *kw); #else #define __Pyx_PyObject_Call(func, arg, kw) PyObject_Call(func, arg, kw) #endif static CYTHON_INLINE void __Pyx_ErrRestore(PyObject *type, PyObject *value, PyObject *tb); static CYTHON_INLINE void __Pyx_ErrFetch(PyObject **type, PyObject **value, PyObject **tb); static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, PyObject *cause); static CYTHON_INLINE int __Pyx_ArgTypeTest(PyObject *obj, PyTypeObject *type, int none_allowed, const char *name, int exact); #if CYTHON_COMPILING_IN_CPYTHON static PyObject* __Pyx_PyInt_EqObjC(PyObject *op1, PyObject *op2, long intval, int inplace); #else #define __Pyx_PyInt_EqObjC(op1, op2, intval, inplace)\ PyObject_RichCompare(op1, op2, Py_EQ) #endif #if CYTHON_COMPILING_IN_CPYTHON #define __Pyx_PyObject_DelAttrStr(o,n) __Pyx_PyObject_SetAttrStr(o,n,NULL) static CYTHON_INLINE int __Pyx_PyObject_SetAttrStr(PyObject* obj, PyObject* attr_name, PyObject* value) { PyTypeObject* tp = Py_TYPE(obj); if (likely(tp->tp_setattro)) return tp->tp_setattro(obj, attr_name, value); #if PY_MAJOR_VERSION < 3 if (likely(tp->tp_setattr)) return tp->tp_setattr(obj, PyString_AS_STRING(attr_name), value); #endif return PyObject_SetAttr(obj, attr_name, value); } #else #define __Pyx_PyObject_DelAttrStr(o,n) PyObject_DelAttr(o,n) #define __Pyx_PyObject_SetAttrStr(o,n,v) PyObject_SetAttr(o,n,v) #endif #if CYTHON_COMPILING_IN_CPYTHON static CYTHON_INLINE PyObject* __Pyx_PyObject_CallMethO(PyObject *func, PyObject *arg); #endif static CYTHON_INLINE PyObject* __Pyx_PyObject_CallOneArg(PyObject *func, PyObject *arg); #if CYTHON_COMPILING_IN_CPYTHON static CYTHON_INLINE PyObject* __Pyx_PyObject_CallNoArg(PyObject *func); #else #define __Pyx_PyObject_CallNoArg(func) __Pyx_PyObject_Call(func, __pyx_empty_tuple, NULL) #endif static CYTHON_INLINE PyObject *__Pyx_GetModuleGlobalName(PyObject *name); static void __Pyx_RaiseDoubleKeywordsError(const char* func_name, PyObject* kw_name); static int __Pyx_ParseOptionalKeywords(PyObject *kwds, PyObject **argnames[],\ PyObject *kwds2, PyObject *values[], Py_ssize_t num_pos_args,\ const char* function_name); static void __Pyx_RaiseArgtupleInvalid(const char* func_name, int exact, Py_ssize_t num_min, Py_ssize_t num_max, Py_ssize_t num_found); static double __Pyx__PyObject_AsDouble(PyObject* obj); #if CYTHON_COMPILING_IN_PYPY #define __Pyx_PyObject_AsDouble(obj)\ (likely(PyFloat_CheckExact(obj)) ? PyFloat_AS_DOUBLE(obj) :\ likely(PyInt_CheckExact(obj)) ?\ PyFloat_AsDouble(obj) : __Pyx__PyObject_AsDouble(obj)) #else #define __Pyx_PyObject_AsDouble(obj)\ ((likely(PyFloat_CheckExact(obj))) ?\ PyFloat_AS_DOUBLE(obj) : __Pyx__PyObject_AsDouble(obj)) #endif #if CYTHON_COMPILING_IN_CPYTHON static CYTHON_INLINE int __Pyx_PyList_Append(PyObject* list, PyObject* x) { PyListObject* L = (PyListObject*) list; Py_ssize_t len = Py_SIZE(list); if (likely(L->allocated > len) & likely(len > (L->allocated >> 1))) { Py_INCREF(x); PyList_SET_ITEM(list, len, x); Py_SIZE(list) = len+1; return 0; } return PyList_Append(list, x); } #else #define __Pyx_PyList_Append(L,x) PyList_Append(L,x) #endif static PyObject* __Pyx_PyObject_CallMethod0(PyObject* obj, PyObject* method_name); static CYTHON_INLINE void __Pyx_RaiseNoneNotIterableError(void); static void __Pyx_UnpackTupleError(PyObject *, Py_ssize_t index); static CYTHON_INLINE int __Pyx_unpack_tuple2(PyObject* tuple, PyObject** value1, PyObject** value2, int is_tuple, int has_known_size, int decref_tuple); static CYTHON_INLINE PyObject* __Pyx_dict_iterator(PyObject* dict, int is_dict, PyObject* method_name, Py_ssize_t* p_orig_length, int* p_is_dict); static CYTHON_INLINE int __Pyx_dict_iter_next(PyObject* dict_or_iter, Py_ssize_t orig_length, Py_ssize_t* ppos, PyObject** pkey, PyObject** pvalue, PyObject** pitem, int is_dict); static CYTHON_INLINE void __Pyx_ExceptionSave(PyObject **type, PyObject **value, PyObject **tb); static void __Pyx_ExceptionReset(PyObject *type, PyObject *value, PyObject *tb); static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list, int level); typedef struct { int code_line; PyCodeObject* code_object; } __Pyx_CodeObjectCacheEntry; struct __Pyx_CodeObjectCache { int count; int max_count; __Pyx_CodeObjectCacheEntry* entries; }; static struct __Pyx_CodeObjectCache __pyx_code_cache = {0,0,NULL}; static int __pyx_bisect_code_objects(__Pyx_CodeObjectCacheEntry* entries, int count, int code_line); static PyCodeObject *__pyx_find_code_object(int code_line); static void __pyx_insert_code_object(int code_line, PyCodeObject* code_object); static void __Pyx_AddTraceback(const char *funcname, int c_line, int py_line, const char *filename); static CYTHON_INLINE int __Pyx_PyInt_As_int(PyObject *); static CYTHON_INLINE PyObject* __Pyx_PyInt_From_long(long value); static CYTHON_INLINE PyObject* __Pyx_PyInt_From_int(int value); static CYTHON_INLINE long __Pyx_PyInt_As_long(PyObject *); static int __Pyx_check_binary_version(void); static int __Pyx_ExportFunction(const char *name, void (*f)(void), const char *sig); static int __Pyx_InitStrings(__Pyx_StringTabEntry *t); /* Module declarations from 'libc.stdint' */ /* Module declarations from 'libc.string' */ /* Module declarations from 'libc.stdio' */ /* Module declarations from 'libc.stddef' */ /* Module declarations from 'sdl2' */ /* Module declarations from 'pygame_sdl2.rect' */ static PyTypeObject *__pyx_ptype_11pygame_sdl2_4rect_Rect = 0; #define __Pyx_MODULE_NAME "pygame_sdl2.rect" int __pyx_module_is_main_pygame_sdl2__rect = 0; /* Implementation of 'pygame_sdl2.rect' */ static PyObject *__pyx_builtin_TypeError; static PyObject *__pyx_builtin_IndexError; static PyObject *__pyx_builtin_zip; static PyObject *__pyx_builtin_range; static char __pyx_k_h[] = "h"; static char __pyx_k_w[] = "w"; static char __pyx_k_x[] = "x"; static char __pyx_k_y[] = "y"; static char __pyx_k_top[] = "top"; static char __pyx_k_zip[] = "zip"; static char __pyx_k_args[] = "args"; static char __pyx_k_copy[] = "copy"; static char __pyx_k_left[] = "left"; static char __pyx_k_main[] = "__main__"; static char __pyx_k_test[] = "__test__"; static char __pyx_k_other[] = "other"; static char __pyx_k_range[] = "range"; static char __pyx_k_right[] = "right"; static char __pyx_k_width[] = "width"; static char __pyx_k_bottom[] = "bottom"; static char __pyx_k_center[] = "center"; static char __pyx_k_format[] = "format"; static char __pyx_k_height[] = "height"; static char __pyx_k_import[] = "__import__"; static char __pyx_k_centerx[] = "centerx"; static char __pyx_k_centery[] = "centery"; static char __pyx_k_flatten[] = "flatten"; static char __pyx_k_move_ip[] = "move_ip"; static char __pyx_k_topleft[] = "topleft"; static char __pyx_k_clamp_ip[] = "clamp_ip"; static char __pyx_k_union_ip[] = "union_ip"; static char __pyx_k_TypeError[] = "TypeError"; static char __pyx_k_iteritems[] = "iteritems"; static char __pyx_k_IndexError[] = "IndexError"; static char __pyx_k_inflate_ip[] = "inflate_ip"; static char __pyx_k_other_dict[] = "other_dict"; static char __pyx_k_collections[] = "collections"; static char __pyx_k_colliderect[] = "colliderect"; static char __pyx_k_unionall_ip[] = "unionall_ip"; static char __pyx_k_rect_d_d_d_d[] = ""; static char __pyx_k_rects_values[] = "rects_values"; static char __pyx_k_pygame_sdl2_rect[] = "pygame_sdl2.rect"; static char __pyx_k_home_tom_ab_pygame_sdl2_src_pyg[] = "/home/tom/ab/pygame_sdl2/src/pygame_sdl2/rect.pyx"; static char __pyx_k_Argument_must_be_a_rect_style_ob[] = "Argument must be a rect style object."; static char __pyx_k_Argument_must_be_a_rect_style_ob_2[] = "Argument {} must be a rect style object."; static PyObject *__pyx_kp_u_Argument_must_be_a_rect_style_ob; static PyObject *__pyx_kp_u_Argument_must_be_a_rect_style_ob_2; static PyObject *__pyx_n_s_IndexError; static PyObject *__pyx_n_s_TypeError; static PyObject *__pyx_n_s_args; static PyObject *__pyx_n_s_bottom; static PyObject *__pyx_n_s_center; static PyObject *__pyx_n_s_centerx; static PyObject *__pyx_n_s_centery; static PyObject *__pyx_n_s_clamp_ip; static PyObject *__pyx_n_s_collections; static PyObject *__pyx_n_s_colliderect; static PyObject *__pyx_n_s_copy; static PyObject *__pyx_n_s_flatten; static PyObject *__pyx_n_s_format; static PyObject *__pyx_n_s_h; static PyObject *__pyx_n_s_height; static PyObject *__pyx_kp_s_home_tom_ab_pygame_sdl2_src_pyg; static PyObject *__pyx_n_s_import; static PyObject *__pyx_n_s_inflate_ip; static PyObject *__pyx_n_s_iteritems; static PyObject *__pyx_n_s_left; static PyObject *__pyx_n_s_main; static PyObject *__pyx_n_s_move_ip; static PyObject *__pyx_n_s_other; static PyObject *__pyx_n_s_other_dict; static PyObject *__pyx_n_s_pygame_sdl2_rect; static PyObject *__pyx_n_s_range; static PyObject *__pyx_kp_u_rect_d_d_d_d; static PyObject *__pyx_n_s_rects_values; static PyObject *__pyx_n_s_right; static PyObject *__pyx_n_s_test; static PyObject *__pyx_n_s_top; static PyObject *__pyx_n_s_topleft; static PyObject *__pyx_n_s_union_ip; static PyObject *__pyx_n_s_unionall_ip; static PyObject *__pyx_n_s_w; static PyObject *__pyx_n_s_width; static PyObject *__pyx_n_s_x; static PyObject *__pyx_n_s_y; static PyObject *__pyx_n_s_zip; static PyObject *__pyx_pf_11pygame_sdl2_4rect_flatten(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_args); /* proto */ static int __pyx_pf_11pygame_sdl2_4rect_4Rect___init__(struct __pyx_obj_11pygame_sdl2_4rect_Rect *__pyx_v_self, PyObject *__pyx_v_args); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_4rect_4Rect_2__reduce__(struct __pyx_obj_11pygame_sdl2_4rect_Rect *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_4rect_4Rect_4__repr__(struct __pyx_obj_11pygame_sdl2_4rect_Rect *__pyx_v_self); /* proto */ static Py_ssize_t __pyx_pf_11pygame_sdl2_4rect_4Rect_6__len__(CYTHON_UNUSED struct __pyx_obj_11pygame_sdl2_4rect_Rect *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_4rect_4Rect_8__iter__(struct __pyx_obj_11pygame_sdl2_4rect_Rect *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_4rect_4Rect_10__richcmp__(struct __pyx_obj_11pygame_sdl2_4rect_Rect *__pyx_v_a, PyObject *__pyx_v_b, int __pyx_v_op); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_4rect_4Rect_12__getitem__(struct __pyx_obj_11pygame_sdl2_4rect_Rect *__pyx_v_self, PyObject *__pyx_v_key); /* proto */ static int __pyx_pf_11pygame_sdl2_4rect_4Rect_14__setitem__(struct __pyx_obj_11pygame_sdl2_4rect_Rect *__pyx_v_self, PyObject *__pyx_v_key, PyObject *__pyx_v_val); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_4rect_4Rect_4left___get__(struct __pyx_obj_11pygame_sdl2_4rect_Rect *__pyx_v_self); /* proto */ static int __pyx_pf_11pygame_sdl2_4rect_4Rect_4left_2__set__(struct __pyx_obj_11pygame_sdl2_4rect_Rect *__pyx_v_self, PyObject *__pyx_v_val); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_4rect_4Rect_3top___get__(struct __pyx_obj_11pygame_sdl2_4rect_Rect *__pyx_v_self); /* proto */ static int __pyx_pf_11pygame_sdl2_4rect_4Rect_3top_2__set__(struct __pyx_obj_11pygame_sdl2_4rect_Rect *__pyx_v_self, PyObject *__pyx_v_val); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_4rect_4Rect_5width___get__(struct __pyx_obj_11pygame_sdl2_4rect_Rect *__pyx_v_self); /* proto */ static int __pyx_pf_11pygame_sdl2_4rect_4Rect_5width_2__set__(struct __pyx_obj_11pygame_sdl2_4rect_Rect *__pyx_v_self, PyObject *__pyx_v_val); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_4rect_4Rect_6height___get__(struct __pyx_obj_11pygame_sdl2_4rect_Rect *__pyx_v_self); /* proto */ static int __pyx_pf_11pygame_sdl2_4rect_4Rect_6height_2__set__(struct __pyx_obj_11pygame_sdl2_4rect_Rect *__pyx_v_self, PyObject *__pyx_v_val); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_4rect_4Rect_5right___get__(struct __pyx_obj_11pygame_sdl2_4rect_Rect *__pyx_v_self); /* proto */ static int __pyx_pf_11pygame_sdl2_4rect_4Rect_5right_2__set__(struct __pyx_obj_11pygame_sdl2_4rect_Rect *__pyx_v_self, PyObject *__pyx_v_val); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_4rect_4Rect_6bottom___get__(struct __pyx_obj_11pygame_sdl2_4rect_Rect *__pyx_v_self); /* proto */ static int __pyx_pf_11pygame_sdl2_4rect_4Rect_6bottom_2__set__(struct __pyx_obj_11pygame_sdl2_4rect_Rect *__pyx_v_self, PyObject *__pyx_v_val); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_4rect_4Rect_4size___get__(struct __pyx_obj_11pygame_sdl2_4rect_Rect *__pyx_v_self); /* proto */ static int __pyx_pf_11pygame_sdl2_4rect_4Rect_4size_2__set__(struct __pyx_obj_11pygame_sdl2_4rect_Rect *__pyx_v_self, PyObject *__pyx_v_val); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_4rect_4Rect_7topleft___get__(struct __pyx_obj_11pygame_sdl2_4rect_Rect *__pyx_v_self); /* proto */ static int __pyx_pf_11pygame_sdl2_4rect_4Rect_7topleft_2__set__(struct __pyx_obj_11pygame_sdl2_4rect_Rect *__pyx_v_self, PyObject *__pyx_v_val); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_4rect_4Rect_8topright___get__(struct __pyx_obj_11pygame_sdl2_4rect_Rect *__pyx_v_self); /* proto */ static int __pyx_pf_11pygame_sdl2_4rect_4Rect_8topright_2__set__(struct __pyx_obj_11pygame_sdl2_4rect_Rect *__pyx_v_self, PyObject *__pyx_v_val); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_4rect_4Rect_11bottomright___get__(struct __pyx_obj_11pygame_sdl2_4rect_Rect *__pyx_v_self); /* proto */ static int __pyx_pf_11pygame_sdl2_4rect_4Rect_11bottomright_2__set__(struct __pyx_obj_11pygame_sdl2_4rect_Rect *__pyx_v_self, PyObject *__pyx_v_val); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_4rect_4Rect_10bottomleft___get__(struct __pyx_obj_11pygame_sdl2_4rect_Rect *__pyx_v_self); /* proto */ static int __pyx_pf_11pygame_sdl2_4rect_4Rect_10bottomleft_2__set__(struct __pyx_obj_11pygame_sdl2_4rect_Rect *__pyx_v_self, PyObject *__pyx_v_val); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_4rect_4Rect_7centerx___get__(struct __pyx_obj_11pygame_sdl2_4rect_Rect *__pyx_v_self); /* proto */ static int __pyx_pf_11pygame_sdl2_4rect_4Rect_7centerx_2__set__(struct __pyx_obj_11pygame_sdl2_4rect_Rect *__pyx_v_self, PyObject *__pyx_v_val); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_4rect_4Rect_7centery___get__(struct __pyx_obj_11pygame_sdl2_4rect_Rect *__pyx_v_self); /* proto */ static int __pyx_pf_11pygame_sdl2_4rect_4Rect_7centery_2__set__(struct __pyx_obj_11pygame_sdl2_4rect_Rect *__pyx_v_self, PyObject *__pyx_v_val); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_4rect_4Rect_6center___get__(struct __pyx_obj_11pygame_sdl2_4rect_Rect *__pyx_v_self); /* proto */ static int __pyx_pf_11pygame_sdl2_4rect_4Rect_6center_2__set__(struct __pyx_obj_11pygame_sdl2_4rect_Rect *__pyx_v_self, PyObject *__pyx_v_val); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_4rect_4Rect_6midtop___get__(struct __pyx_obj_11pygame_sdl2_4rect_Rect *__pyx_v_self); /* proto */ static int __pyx_pf_11pygame_sdl2_4rect_4Rect_6midtop_2__set__(struct __pyx_obj_11pygame_sdl2_4rect_Rect *__pyx_v_self, PyObject *__pyx_v_val); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_4rect_4Rect_7midleft___get__(struct __pyx_obj_11pygame_sdl2_4rect_Rect *__pyx_v_self); /* proto */ static int __pyx_pf_11pygame_sdl2_4rect_4Rect_7midleft_2__set__(struct __pyx_obj_11pygame_sdl2_4rect_Rect *__pyx_v_self, PyObject *__pyx_v_val); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_4rect_4Rect_9midbottom___get__(struct __pyx_obj_11pygame_sdl2_4rect_Rect *__pyx_v_self); /* proto */ static int __pyx_pf_11pygame_sdl2_4rect_4Rect_9midbottom_2__set__(struct __pyx_obj_11pygame_sdl2_4rect_Rect *__pyx_v_self, PyObject *__pyx_v_val); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_4rect_4Rect_8midright___get__(struct __pyx_obj_11pygame_sdl2_4rect_Rect *__pyx_v_self); /* proto */ static int __pyx_pf_11pygame_sdl2_4rect_4Rect_8midright_2__set__(struct __pyx_obj_11pygame_sdl2_4rect_Rect *__pyx_v_self, PyObject *__pyx_v_val); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_4rect_4Rect_16copy(struct __pyx_obj_11pygame_sdl2_4rect_Rect *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_4rect_4Rect_18move(struct __pyx_obj_11pygame_sdl2_4rect_Rect *__pyx_v_self, PyObject *__pyx_v_args); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_4rect_4Rect_20move_ip(struct __pyx_obj_11pygame_sdl2_4rect_Rect *__pyx_v_self, PyObject *__pyx_v_args); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_4rect_4Rect_22inflate(struct __pyx_obj_11pygame_sdl2_4rect_Rect *__pyx_v_self, PyObject *__pyx_v_args); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_4rect_4Rect_24inflate_ip(struct __pyx_obj_11pygame_sdl2_4rect_Rect *__pyx_v_self, PyObject *__pyx_v_args); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_4rect_4Rect_26clamp(struct __pyx_obj_11pygame_sdl2_4rect_Rect *__pyx_v_self, PyObject *__pyx_v_other); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_4rect_4Rect_28clamp_ip(struct __pyx_obj_11pygame_sdl2_4rect_Rect *__pyx_v_self, PyObject *__pyx_v_other); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_4rect_4Rect_30clip(struct __pyx_obj_11pygame_sdl2_4rect_Rect *__pyx_v_self, PyObject *__pyx_v_other, PyObject *__pyx_v_y, PyObject *__pyx_v_w, PyObject *__pyx_v_h); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_4rect_4Rect_32union(struct __pyx_obj_11pygame_sdl2_4rect_Rect *__pyx_v_self, PyObject *__pyx_v_other); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_4rect_4Rect_34union_ip(struct __pyx_obj_11pygame_sdl2_4rect_Rect *__pyx_v_self, PyObject *__pyx_v_other); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_4rect_4Rect_36unionall(struct __pyx_obj_11pygame_sdl2_4rect_Rect *__pyx_v_self, PyObject *__pyx_v_other_seq); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_4rect_4Rect_38unionall_ip(struct __pyx_obj_11pygame_sdl2_4rect_Rect *__pyx_v_self, PyObject *__pyx_v_other_seq); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_4rect_4Rect_40fit(struct __pyx_obj_11pygame_sdl2_4rect_Rect *__pyx_v_self, PyObject *__pyx_v_other); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_4rect_4Rect_42normalize(struct __pyx_obj_11pygame_sdl2_4rect_Rect *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_4rect_4Rect_44contains(struct __pyx_obj_11pygame_sdl2_4rect_Rect *__pyx_v_self, PyObject *__pyx_v_other); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_4rect_4Rect_46collidepoint(struct __pyx_obj_11pygame_sdl2_4rect_Rect *__pyx_v_self, PyObject *__pyx_v_x, PyObject *__pyx_v_y); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_4rect_4Rect_48colliderect(struct __pyx_obj_11pygame_sdl2_4rect_Rect *__pyx_v_self, PyObject *__pyx_v_other); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_4rect_4Rect_50collidelist(struct __pyx_obj_11pygame_sdl2_4rect_Rect *__pyx_v_self, PyObject *__pyx_v_other_list); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_4rect_4Rect_52collidelistall(struct __pyx_obj_11pygame_sdl2_4rect_Rect *__pyx_v_self, PyObject *__pyx_v_other_list); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_4rect_4Rect_54collidedict(struct __pyx_obj_11pygame_sdl2_4rect_Rect *__pyx_v_self, PyObject *__pyx_v_other_dict, CYTHON_UNUSED PyObject *__pyx_v_rects_values); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_4rect_4Rect_56collidedictall(struct __pyx_obj_11pygame_sdl2_4rect_Rect *__pyx_v_self, PyObject *__pyx_v_other_dict, CYTHON_UNUSED PyObject *__pyx_v_rects_values); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_4rect_4Rect_1x___get__(struct __pyx_obj_11pygame_sdl2_4rect_Rect *__pyx_v_self); /* proto */ static int __pyx_pf_11pygame_sdl2_4rect_4Rect_1x_2__set__(struct __pyx_obj_11pygame_sdl2_4rect_Rect *__pyx_v_self, PyObject *__pyx_v_value); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_4rect_4Rect_1y___get__(struct __pyx_obj_11pygame_sdl2_4rect_Rect *__pyx_v_self); /* proto */ static int __pyx_pf_11pygame_sdl2_4rect_4Rect_1y_2__set__(struct __pyx_obj_11pygame_sdl2_4rect_Rect *__pyx_v_self, PyObject *__pyx_v_value); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_4rect_4Rect_1w___get__(struct __pyx_obj_11pygame_sdl2_4rect_Rect *__pyx_v_self); /* proto */ static int __pyx_pf_11pygame_sdl2_4rect_4Rect_1w_2__set__(struct __pyx_obj_11pygame_sdl2_4rect_Rect *__pyx_v_self, PyObject *__pyx_v_value); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_4rect_4Rect_1h___get__(struct __pyx_obj_11pygame_sdl2_4rect_Rect *__pyx_v_self); /* proto */ static int __pyx_pf_11pygame_sdl2_4rect_4Rect_1h_2__set__(struct __pyx_obj_11pygame_sdl2_4rect_Rect *__pyx_v_self, PyObject *__pyx_v_value); /* proto */ static PyObject *__pyx_tp_new_11pygame_sdl2_4rect_Rect(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ static PyObject *__pyx_int_0; static PyObject *__pyx_int_1; static PyObject *__pyx_int_2; static PyObject *__pyx_int_3; static PyObject *__pyx_int_neg_1; static PyObject *__pyx_tuple_; static PyObject *__pyx_tuple__2; static PyObject *__pyx_tuple__3; static PyObject *__pyx_tuple__4; static PyObject *__pyx_codeobj__5; /* "pygame_sdl2/rect.pyx":22 * import collections * * def flatten(*args): # <<<<<<<<<<<<<< * if len(args) == 1: * return args[0] */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_4rect_1flatten(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static PyMethodDef __pyx_mdef_11pygame_sdl2_4rect_1flatten = {"flatten", (PyCFunction)__pyx_pw_11pygame_sdl2_4rect_1flatten, METH_VARARGS|METH_KEYWORDS, 0}; static PyObject *__pyx_pw_11pygame_sdl2_4rect_1flatten(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_args = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("flatten (wrapper)", 0); if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "flatten", 0))) return NULL; __Pyx_INCREF(__pyx_args); __pyx_v_args = __pyx_args; __pyx_r = __pyx_pf_11pygame_sdl2_4rect_flatten(__pyx_self, __pyx_v_args); /* function exit code */ __Pyx_XDECREF(__pyx_v_args); __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_4rect_flatten(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_args) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations Py_ssize_t __pyx_t_1; int __pyx_t_2; PyObject *__pyx_t_3 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("flatten", 0); /* "pygame_sdl2/rect.pyx":23 * * def flatten(*args): * if len(args) == 1: # <<<<<<<<<<<<<< * return args[0] * else: */ __pyx_t_1 = PyTuple_GET_SIZE(__pyx_v_args); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 23; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_t_2 = ((__pyx_t_1 == 1) != 0); if (__pyx_t_2) { /* "pygame_sdl2/rect.pyx":24 * def flatten(*args): * if len(args) == 1: * return args[0] # <<<<<<<<<<<<<< * else: * return args */ __Pyx_XDECREF(__pyx_r); __pyx_t_3 = __Pyx_GetItemInt_Tuple(__pyx_v_args, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(__pyx_t_3 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 24; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; __Pyx_GOTREF(__pyx_t_3); __pyx_r = __pyx_t_3; __pyx_t_3 = 0; goto __pyx_L0; /* "pygame_sdl2/rect.pyx":23 * * def flatten(*args): * if len(args) == 1: # <<<<<<<<<<<<<< * return args[0] * else: */ } /* "pygame_sdl2/rect.pyx":26 * return args[0] * else: * return args # <<<<<<<<<<<<<< * * cdef class Rect: */ /*else*/ { __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(__pyx_v_args); __pyx_r = __pyx_v_args; goto __pyx_L0; } /* "pygame_sdl2/rect.pyx":22 * import collections * * def flatten(*args): # <<<<<<<<<<<<<< * if len(args) == 1: * return args[0] */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("pygame_sdl2.rect.flatten", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/rect.pyx":30 * cdef class Rect: * * def __init__(self, *args): # <<<<<<<<<<<<<< * * cdef int x, y, w, h */ /* Python wrapper */ static int __pyx_pw_11pygame_sdl2_4rect_4Rect_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static int __pyx_pw_11pygame_sdl2_4rect_4Rect_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_args = 0; int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__init__ (wrapper)", 0); if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "__init__", 0))) return -1; __Pyx_INCREF(__pyx_args); __pyx_v_args = __pyx_args; __pyx_r = __pyx_pf_11pygame_sdl2_4rect_4Rect___init__(((struct __pyx_obj_11pygame_sdl2_4rect_Rect *)__pyx_v_self), __pyx_v_args); /* function exit code */ __Pyx_XDECREF(__pyx_v_args); __Pyx_RefNannyFinishContext(); return __pyx_r; } static int __pyx_pf_11pygame_sdl2_4rect_4Rect___init__(struct __pyx_obj_11pygame_sdl2_4rect_Rect *__pyx_v_self, PyObject *__pyx_v_args) { int __pyx_v_x; int __pyx_v_y; int __pyx_v_w; int __pyx_v_h; int __pyx_v_len_args; struct __pyx_obj_11pygame_sdl2_4rect_Rect *__pyx_v_rect = 0; int __pyx_r; __Pyx_RefNannyDeclarations Py_ssize_t __pyx_t_1; int __pyx_t_2; int __pyx_t_3; PyObject *__pyx_t_4 = NULL; int __pyx_t_5; int __pyx_t_6; PyObject *__pyx_t_7 = NULL; PyObject *__pyx_t_8 = NULL; PyObject *__pyx_t_9 = NULL; PyObject *__pyx_t_10 = NULL; PyObject *__pyx_t_11 = NULL; PyObject *(*__pyx_t_12)(PyObject *); int __pyx_t_13; int __pyx_t_14; int __pyx_t_15; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__init__", 0); /* "pygame_sdl2/rect.pyx":36 * cdef Rect rect * * len_args = len(args) # <<<<<<<<<<<<<< * * if len_args == 1 and isinstance(args[0], Rect): */ __pyx_t_1 = PyTuple_GET_SIZE(__pyx_v_args); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 36; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_v_len_args = __pyx_t_1; /* "pygame_sdl2/rect.pyx":38 * len_args = len(args) * * if len_args == 1 and isinstance(args[0], Rect): # <<<<<<<<<<<<<< * rect = args[0] * x = rect.x */ __pyx_t_3 = ((__pyx_v_len_args == 1) != 0); if (__pyx_t_3) { } else { __pyx_t_2 = __pyx_t_3; goto __pyx_L4_bool_binop_done; } __pyx_t_4 = __Pyx_GetItemInt_Tuple(__pyx_v_args, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(__pyx_t_4 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 38; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; __Pyx_GOTREF(__pyx_t_4); __pyx_t_3 = __Pyx_TypeCheck(__pyx_t_4, __pyx_ptype_11pygame_sdl2_4rect_Rect); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_t_5 = (__pyx_t_3 != 0); __pyx_t_2 = __pyx_t_5; __pyx_L4_bool_binop_done:; if (__pyx_t_2) { /* "pygame_sdl2/rect.pyx":39 * * if len_args == 1 and isinstance(args[0], Rect): * rect = args[0] # <<<<<<<<<<<<<< * x = rect.x * y = rect.y */ __pyx_t_4 = __Pyx_GetItemInt_Tuple(__pyx_v_args, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(__pyx_t_4 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 39; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; __Pyx_GOTREF(__pyx_t_4); if (!(likely(((__pyx_t_4) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_4, __pyx_ptype_11pygame_sdl2_4rect_Rect))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 39; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_v_rect = ((struct __pyx_obj_11pygame_sdl2_4rect_Rect *)__pyx_t_4); __pyx_t_4 = 0; /* "pygame_sdl2/rect.pyx":40 * if len_args == 1 and isinstance(args[0], Rect): * rect = args[0] * x = rect.x # <<<<<<<<<<<<<< * y = rect.y * w = rect.w */ __pyx_t_6 = __pyx_v_rect->x; __pyx_v_x = __pyx_t_6; /* "pygame_sdl2/rect.pyx":41 * rect = args[0] * x = rect.x * y = rect.y # <<<<<<<<<<<<<< * w = rect.w * h = rect.h */ __pyx_t_6 = __pyx_v_rect->y; __pyx_v_y = __pyx_t_6; /* "pygame_sdl2/rect.pyx":42 * x = rect.x * y = rect.y * w = rect.w # <<<<<<<<<<<<<< * h = rect.h * */ __pyx_t_6 = __pyx_v_rect->w; __pyx_v_w = __pyx_t_6; /* "pygame_sdl2/rect.pyx":43 * y = rect.y * w = rect.w * h = rect.h # <<<<<<<<<<<<<< * * elif len_args == 1 and len(args[0]) == 4: */ __pyx_t_6 = __pyx_v_rect->h; __pyx_v_h = __pyx_t_6; /* "pygame_sdl2/rect.pyx":38 * len_args = len(args) * * if len_args == 1 and isinstance(args[0], Rect): # <<<<<<<<<<<<<< * rect = args[0] * x = rect.x */ goto __pyx_L3; } /* "pygame_sdl2/rect.pyx":45 * h = rect.h * * elif len_args == 1 and len(args[0]) == 4: # <<<<<<<<<<<<<< * x, y, w, h = args[0] * */ __pyx_t_5 = ((__pyx_v_len_args == 1) != 0); if (__pyx_t_5) { } else { __pyx_t_2 = __pyx_t_5; goto __pyx_L6_bool_binop_done; } __pyx_t_4 = __Pyx_GetItemInt_Tuple(__pyx_v_args, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(__pyx_t_4 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 45; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; __Pyx_GOTREF(__pyx_t_4); __pyx_t_1 = PyObject_Length(__pyx_t_4); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 45; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_t_5 = ((__pyx_t_1 == 4) != 0); __pyx_t_2 = __pyx_t_5; __pyx_L6_bool_binop_done:; if (__pyx_t_2) { /* "pygame_sdl2/rect.pyx":46 * * elif len_args == 1 and len(args[0]) == 4: * x, y, w, h = args[0] # <<<<<<<<<<<<<< * * elif len_args == 1 and len(args[0]) == 2: */ __pyx_t_4 = __Pyx_GetItemInt_Tuple(__pyx_v_args, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(__pyx_t_4 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 46; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; __Pyx_GOTREF(__pyx_t_4); if ((likely(PyTuple_CheckExact(__pyx_t_4))) || (PyList_CheckExact(__pyx_t_4))) { PyObject* sequence = __pyx_t_4; #if CYTHON_COMPILING_IN_CPYTHON Py_ssize_t size = Py_SIZE(sequence); #else Py_ssize_t size = PySequence_Size(sequence); #endif if (unlikely(size != 4)) { if (size > 4) __Pyx_RaiseTooManyValuesError(4); else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 46; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } #if CYTHON_COMPILING_IN_CPYTHON if (likely(PyTuple_CheckExact(sequence))) { __pyx_t_7 = PyTuple_GET_ITEM(sequence, 0); __pyx_t_8 = PyTuple_GET_ITEM(sequence, 1); __pyx_t_9 = PyTuple_GET_ITEM(sequence, 2); __pyx_t_10 = PyTuple_GET_ITEM(sequence, 3); } else { __pyx_t_7 = PyList_GET_ITEM(sequence, 0); __pyx_t_8 = PyList_GET_ITEM(sequence, 1); __pyx_t_9 = PyList_GET_ITEM(sequence, 2); __pyx_t_10 = PyList_GET_ITEM(sequence, 3); } __Pyx_INCREF(__pyx_t_7); __Pyx_INCREF(__pyx_t_8); __Pyx_INCREF(__pyx_t_9); __Pyx_INCREF(__pyx_t_10); #else { Py_ssize_t i; PyObject** temps[4] = {&__pyx_t_7,&__pyx_t_8,&__pyx_t_9,&__pyx_t_10}; for (i=0; i < 4; i++) { PyObject* item = PySequence_ITEM(sequence, i); if (unlikely(!item)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 46; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(item); *(temps[i]) = item; } } #endif __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; } else { Py_ssize_t index = -1; PyObject** temps[4] = {&__pyx_t_7,&__pyx_t_8,&__pyx_t_9,&__pyx_t_10}; __pyx_t_11 = PyObject_GetIter(__pyx_t_4); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 46; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_11); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_t_12 = Py_TYPE(__pyx_t_11)->tp_iternext; for (index=0; index < 4; index++) { PyObject* item = __pyx_t_12(__pyx_t_11); if (unlikely(!item)) goto __pyx_L8_unpacking_failed; __Pyx_GOTREF(item); *(temps[index]) = item; } if (__Pyx_IternextUnpackEndCheck(__pyx_t_12(__pyx_t_11), 4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 46; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_t_12 = NULL; __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; goto __pyx_L9_unpacking_done; __pyx_L8_unpacking_failed:; __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; __pyx_t_12 = NULL; if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 46; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_L9_unpacking_done:; } __pyx_t_6 = __Pyx_PyInt_As_int(__pyx_t_7); if (unlikely((__pyx_t_6 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 46; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __pyx_t_13 = __Pyx_PyInt_As_int(__pyx_t_8); if (unlikely((__pyx_t_13 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 46; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; __pyx_t_14 = __Pyx_PyInt_As_int(__pyx_t_9); if (unlikely((__pyx_t_14 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 46; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; __pyx_t_15 = __Pyx_PyInt_As_int(__pyx_t_10); if (unlikely((__pyx_t_15 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 46; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; __pyx_v_x = __pyx_t_6; __pyx_v_y = __pyx_t_13; __pyx_v_w = __pyx_t_14; __pyx_v_h = __pyx_t_15; /* "pygame_sdl2/rect.pyx":45 * h = rect.h * * elif len_args == 1 and len(args[0]) == 4: # <<<<<<<<<<<<<< * x, y, w, h = args[0] * */ goto __pyx_L3; } /* "pygame_sdl2/rect.pyx":48 * x, y, w, h = args[0] * * elif len_args == 1 and len(args[0]) == 2: # <<<<<<<<<<<<<< * x, y = args[0] * w = 0 */ __pyx_t_5 = ((__pyx_v_len_args == 1) != 0); if (__pyx_t_5) { } else { __pyx_t_2 = __pyx_t_5; goto __pyx_L10_bool_binop_done; } __pyx_t_4 = __Pyx_GetItemInt_Tuple(__pyx_v_args, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(__pyx_t_4 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 48; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; __Pyx_GOTREF(__pyx_t_4); __pyx_t_1 = PyObject_Length(__pyx_t_4); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 48; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_t_5 = ((__pyx_t_1 == 2) != 0); __pyx_t_2 = __pyx_t_5; __pyx_L10_bool_binop_done:; if (__pyx_t_2) { /* "pygame_sdl2/rect.pyx":49 * * elif len_args == 1 and len(args[0]) == 2: * x, y = args[0] # <<<<<<<<<<<<<< * w = 0 * h = 0 */ __pyx_t_4 = __Pyx_GetItemInt_Tuple(__pyx_v_args, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(__pyx_t_4 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 49; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; __Pyx_GOTREF(__pyx_t_4); if ((likely(PyTuple_CheckExact(__pyx_t_4))) || (PyList_CheckExact(__pyx_t_4))) { PyObject* sequence = __pyx_t_4; #if CYTHON_COMPILING_IN_CPYTHON Py_ssize_t size = Py_SIZE(sequence); #else Py_ssize_t size = PySequence_Size(sequence); #endif if (unlikely(size != 2)) { if (size > 2) __Pyx_RaiseTooManyValuesError(2); else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 49; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } #if CYTHON_COMPILING_IN_CPYTHON if (likely(PyTuple_CheckExact(sequence))) { __pyx_t_10 = PyTuple_GET_ITEM(sequence, 0); __pyx_t_9 = PyTuple_GET_ITEM(sequence, 1); } else { __pyx_t_10 = PyList_GET_ITEM(sequence, 0); __pyx_t_9 = PyList_GET_ITEM(sequence, 1); } __Pyx_INCREF(__pyx_t_10); __Pyx_INCREF(__pyx_t_9); #else __pyx_t_10 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 49; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_10); __pyx_t_9 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 49; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_9); #endif __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; } else { Py_ssize_t index = -1; __pyx_t_8 = PyObject_GetIter(__pyx_t_4); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 49; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_8); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_t_12 = Py_TYPE(__pyx_t_8)->tp_iternext; index = 0; __pyx_t_10 = __pyx_t_12(__pyx_t_8); if (unlikely(!__pyx_t_10)) goto __pyx_L12_unpacking_failed; __Pyx_GOTREF(__pyx_t_10); index = 1; __pyx_t_9 = __pyx_t_12(__pyx_t_8); if (unlikely(!__pyx_t_9)) goto __pyx_L12_unpacking_failed; __Pyx_GOTREF(__pyx_t_9); if (__Pyx_IternextUnpackEndCheck(__pyx_t_12(__pyx_t_8), 2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 49; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_t_12 = NULL; __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; goto __pyx_L13_unpacking_done; __pyx_L12_unpacking_failed:; __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; __pyx_t_12 = NULL; if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 49; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_L13_unpacking_done:; } __pyx_t_15 = __Pyx_PyInt_As_int(__pyx_t_10); if (unlikely((__pyx_t_15 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 49; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; __pyx_t_14 = __Pyx_PyInt_As_int(__pyx_t_9); if (unlikely((__pyx_t_14 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 49; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; __pyx_v_x = __pyx_t_15; __pyx_v_y = __pyx_t_14; /* "pygame_sdl2/rect.pyx":50 * elif len_args == 1 and len(args[0]) == 2: * x, y = args[0] * w = 0 # <<<<<<<<<<<<<< * h = 0 * */ __pyx_v_w = 0; /* "pygame_sdl2/rect.pyx":51 * x, y = args[0] * w = 0 * h = 0 # <<<<<<<<<<<<<< * * elif len_args == 2: */ __pyx_v_h = 0; /* "pygame_sdl2/rect.pyx":48 * x, y, w, h = args[0] * * elif len_args == 1 and len(args[0]) == 2: # <<<<<<<<<<<<<< * x, y = args[0] * w = 0 */ goto __pyx_L3; } /* "pygame_sdl2/rect.pyx":53 * h = 0 * * elif len_args == 2: # <<<<<<<<<<<<<< * x, y = args[0] * w, h = args[1] */ __pyx_t_2 = ((__pyx_v_len_args == 2) != 0); if (__pyx_t_2) { /* "pygame_sdl2/rect.pyx":54 * * elif len_args == 2: * x, y = args[0] # <<<<<<<<<<<<<< * w, h = args[1] * */ __pyx_t_4 = __Pyx_GetItemInt_Tuple(__pyx_v_args, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(__pyx_t_4 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 54; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; __Pyx_GOTREF(__pyx_t_4); if ((likely(PyTuple_CheckExact(__pyx_t_4))) || (PyList_CheckExact(__pyx_t_4))) { PyObject* sequence = __pyx_t_4; #if CYTHON_COMPILING_IN_CPYTHON Py_ssize_t size = Py_SIZE(sequence); #else Py_ssize_t size = PySequence_Size(sequence); #endif if (unlikely(size != 2)) { if (size > 2) __Pyx_RaiseTooManyValuesError(2); else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 54; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } #if CYTHON_COMPILING_IN_CPYTHON if (likely(PyTuple_CheckExact(sequence))) { __pyx_t_9 = PyTuple_GET_ITEM(sequence, 0); __pyx_t_10 = PyTuple_GET_ITEM(sequence, 1); } else { __pyx_t_9 = PyList_GET_ITEM(sequence, 0); __pyx_t_10 = PyList_GET_ITEM(sequence, 1); } __Pyx_INCREF(__pyx_t_9); __Pyx_INCREF(__pyx_t_10); #else __pyx_t_9 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 54; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_9); __pyx_t_10 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 54; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_10); #endif __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; } else { Py_ssize_t index = -1; __pyx_t_8 = PyObject_GetIter(__pyx_t_4); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 54; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_8); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_t_12 = Py_TYPE(__pyx_t_8)->tp_iternext; index = 0; __pyx_t_9 = __pyx_t_12(__pyx_t_8); if (unlikely(!__pyx_t_9)) goto __pyx_L14_unpacking_failed; __Pyx_GOTREF(__pyx_t_9); index = 1; __pyx_t_10 = __pyx_t_12(__pyx_t_8); if (unlikely(!__pyx_t_10)) goto __pyx_L14_unpacking_failed; __Pyx_GOTREF(__pyx_t_10); if (__Pyx_IternextUnpackEndCheck(__pyx_t_12(__pyx_t_8), 2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 54; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_t_12 = NULL; __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; goto __pyx_L15_unpacking_done; __pyx_L14_unpacking_failed:; __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; __pyx_t_12 = NULL; if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 54; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_L15_unpacking_done:; } __pyx_t_14 = __Pyx_PyInt_As_int(__pyx_t_9); if (unlikely((__pyx_t_14 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 54; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; __pyx_t_15 = __Pyx_PyInt_As_int(__pyx_t_10); if (unlikely((__pyx_t_15 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 54; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; __pyx_v_x = __pyx_t_14; __pyx_v_y = __pyx_t_15; /* "pygame_sdl2/rect.pyx":55 * elif len_args == 2: * x, y = args[0] * w, h = args[1] # <<<<<<<<<<<<<< * * elif len_args == 4: */ __pyx_t_4 = __Pyx_GetItemInt_Tuple(__pyx_v_args, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(__pyx_t_4 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 55; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; __Pyx_GOTREF(__pyx_t_4); if ((likely(PyTuple_CheckExact(__pyx_t_4))) || (PyList_CheckExact(__pyx_t_4))) { PyObject* sequence = __pyx_t_4; #if CYTHON_COMPILING_IN_CPYTHON Py_ssize_t size = Py_SIZE(sequence); #else Py_ssize_t size = PySequence_Size(sequence); #endif if (unlikely(size != 2)) { if (size > 2) __Pyx_RaiseTooManyValuesError(2); else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 55; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } #if CYTHON_COMPILING_IN_CPYTHON if (likely(PyTuple_CheckExact(sequence))) { __pyx_t_10 = PyTuple_GET_ITEM(sequence, 0); __pyx_t_9 = PyTuple_GET_ITEM(sequence, 1); } else { __pyx_t_10 = PyList_GET_ITEM(sequence, 0); __pyx_t_9 = PyList_GET_ITEM(sequence, 1); } __Pyx_INCREF(__pyx_t_10); __Pyx_INCREF(__pyx_t_9); #else __pyx_t_10 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 55; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_10); __pyx_t_9 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 55; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_9); #endif __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; } else { Py_ssize_t index = -1; __pyx_t_8 = PyObject_GetIter(__pyx_t_4); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 55; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_8); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_t_12 = Py_TYPE(__pyx_t_8)->tp_iternext; index = 0; __pyx_t_10 = __pyx_t_12(__pyx_t_8); if (unlikely(!__pyx_t_10)) goto __pyx_L16_unpacking_failed; __Pyx_GOTREF(__pyx_t_10); index = 1; __pyx_t_9 = __pyx_t_12(__pyx_t_8); if (unlikely(!__pyx_t_9)) goto __pyx_L16_unpacking_failed; __Pyx_GOTREF(__pyx_t_9); if (__Pyx_IternextUnpackEndCheck(__pyx_t_12(__pyx_t_8), 2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 55; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_t_12 = NULL; __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; goto __pyx_L17_unpacking_done; __pyx_L16_unpacking_failed:; __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; __pyx_t_12 = NULL; if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 55; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_L17_unpacking_done:; } __pyx_t_15 = __Pyx_PyInt_As_int(__pyx_t_10); if (unlikely((__pyx_t_15 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 55; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; __pyx_t_14 = __Pyx_PyInt_As_int(__pyx_t_9); if (unlikely((__pyx_t_14 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 55; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; __pyx_v_w = __pyx_t_15; __pyx_v_h = __pyx_t_14; /* "pygame_sdl2/rect.pyx":53 * h = 0 * * elif len_args == 2: # <<<<<<<<<<<<<< * x, y = args[0] * w, h = args[1] */ goto __pyx_L3; } /* "pygame_sdl2/rect.pyx":57 * w, h = args[1] * * elif len_args == 4: # <<<<<<<<<<<<<< * x, y, w, h = args * */ __pyx_t_2 = ((__pyx_v_len_args == 4) != 0); if (__pyx_t_2) { /* "pygame_sdl2/rect.pyx":58 * * elif len_args == 4: * x, y, w, h = args # <<<<<<<<<<<<<< * * else: */ if (1) { PyObject* sequence = __pyx_v_args; #if CYTHON_COMPILING_IN_CPYTHON Py_ssize_t size = Py_SIZE(sequence); #else Py_ssize_t size = PySequence_Size(sequence); #endif if (unlikely(size != 4)) { if (size > 4) __Pyx_RaiseTooManyValuesError(4); else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 58; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } #if CYTHON_COMPILING_IN_CPYTHON __pyx_t_4 = PyTuple_GET_ITEM(sequence, 0); __pyx_t_9 = PyTuple_GET_ITEM(sequence, 1); __pyx_t_10 = PyTuple_GET_ITEM(sequence, 2); __pyx_t_8 = PyTuple_GET_ITEM(sequence, 3); __Pyx_INCREF(__pyx_t_4); __Pyx_INCREF(__pyx_t_9); __Pyx_INCREF(__pyx_t_10); __Pyx_INCREF(__pyx_t_8); #else { Py_ssize_t i; PyObject** temps[4] = {&__pyx_t_4,&__pyx_t_9,&__pyx_t_10,&__pyx_t_8}; for (i=0; i < 4; i++) { PyObject* item = PySequence_ITEM(sequence, i); if (unlikely(!item)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 58; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(item); *(temps[i]) = item; } } #endif } __pyx_t_14 = __Pyx_PyInt_As_int(__pyx_t_4); if (unlikely((__pyx_t_14 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 58; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_t_15 = __Pyx_PyInt_As_int(__pyx_t_9); if (unlikely((__pyx_t_15 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 58; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; __pyx_t_13 = __Pyx_PyInt_As_int(__pyx_t_10); if (unlikely((__pyx_t_13 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 58; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; __pyx_t_6 = __Pyx_PyInt_As_int(__pyx_t_8); if (unlikely((__pyx_t_6 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 58; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; __pyx_v_x = __pyx_t_14; __pyx_v_y = __pyx_t_15; __pyx_v_w = __pyx_t_13; __pyx_v_h = __pyx_t_6; /* "pygame_sdl2/rect.pyx":57 * w, h = args[1] * * elif len_args == 4: # <<<<<<<<<<<<<< * x, y, w, h = args * */ goto __pyx_L3; } /* "pygame_sdl2/rect.pyx":61 * * else: * raise TypeError("Argument must be a rect style object.") # <<<<<<<<<<<<<< * * self.x = x */ /*else*/ { __pyx_t_8 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple_, NULL); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 61; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_8); __Pyx_Raise(__pyx_t_8, 0, 0, 0); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; {__pyx_filename = __pyx_f[0]; __pyx_lineno = 61; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } __pyx_L3:; /* "pygame_sdl2/rect.pyx":63 * raise TypeError("Argument must be a rect style object.") * * self.x = x # <<<<<<<<<<<<<< * self.y = y * self.w = w */ __pyx_v_self->x = __pyx_v_x; /* "pygame_sdl2/rect.pyx":64 * * self.x = x * self.y = y # <<<<<<<<<<<<<< * self.w = w * self.h = h */ __pyx_v_self->y = __pyx_v_y; /* "pygame_sdl2/rect.pyx":65 * self.x = x * self.y = y * self.w = w # <<<<<<<<<<<<<< * self.h = h * */ __pyx_v_self->w = __pyx_v_w; /* "pygame_sdl2/rect.pyx":66 * self.y = y * self.w = w * self.h = h # <<<<<<<<<<<<<< * * def __reduce__(self): */ __pyx_v_self->h = __pyx_v_h; /* "pygame_sdl2/rect.pyx":30 * cdef class Rect: * * def __init__(self, *args): # <<<<<<<<<<<<<< * * cdef int x, y, w, h */ /* function exit code */ __pyx_r = 0; goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_7); __Pyx_XDECREF(__pyx_t_8); __Pyx_XDECREF(__pyx_t_9); __Pyx_XDECREF(__pyx_t_10); __Pyx_XDECREF(__pyx_t_11); __Pyx_AddTraceback("pygame_sdl2.rect.Rect.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = -1; __pyx_L0:; __Pyx_XDECREF((PyObject *)__pyx_v_rect); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/rect.pyx":68 * self.h = h * * def __reduce__(self): # <<<<<<<<<<<<<< * return (Rect, (self.x, self.y, self.w, self.h)) * */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_4rect_4Rect_3__reduce__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/ static PyObject *__pyx_pw_11pygame_sdl2_4rect_4Rect_3__reduce__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__reduce__ (wrapper)", 0); __pyx_r = __pyx_pf_11pygame_sdl2_4rect_4Rect_2__reduce__(((struct __pyx_obj_11pygame_sdl2_4rect_Rect *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_4rect_4Rect_2__reduce__(struct __pyx_obj_11pygame_sdl2_4rect_Rect *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; PyObject *__pyx_t_5 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__reduce__", 0); /* "pygame_sdl2/rect.pyx":69 * * def __reduce__(self): * return (Rect, (self.x, self.y, self.w, self.h)) # <<<<<<<<<<<<<< * * def __repr__(self): */ __Pyx_XDECREF(__pyx_r); __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_self->x); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 69; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_v_self->y); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 69; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = __Pyx_PyInt_From_int(__pyx_v_self->w); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 69; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = __Pyx_PyInt_From_int(__pyx_v_self->h); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 69; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); __pyx_t_5 = PyTuple_New(4); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 69; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); __Pyx_GIVEREF(__pyx_t_1); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_1); __Pyx_GIVEREF(__pyx_t_2); PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_t_2); __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_5, 2, __pyx_t_3); __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_5, 3, __pyx_t_4); __pyx_t_1 = 0; __pyx_t_2 = 0; __pyx_t_3 = 0; __pyx_t_4 = 0; __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 69; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); __Pyx_INCREF(((PyObject *)__pyx_ptype_11pygame_sdl2_4rect_Rect)); __Pyx_GIVEREF(((PyObject *)__pyx_ptype_11pygame_sdl2_4rect_Rect)); PyTuple_SET_ITEM(__pyx_t_4, 0, ((PyObject *)__pyx_ptype_11pygame_sdl2_4rect_Rect)); __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_5); __pyx_t_5 = 0; __pyx_r = __pyx_t_4; __pyx_t_4 = 0; goto __pyx_L0; /* "pygame_sdl2/rect.pyx":68 * self.h = h * * def __reduce__(self): # <<<<<<<<<<<<<< * return (Rect, (self.x, self.y, self.w, self.h)) * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_5); __Pyx_AddTraceback("pygame_sdl2.rect.Rect.__reduce__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/rect.pyx":71 * return (Rect, (self.x, self.y, self.w, self.h)) * * def __repr__(self): # <<<<<<<<<<<<<< * return "" % (self.x, self.y, self.w, self.h) * */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_4rect_4Rect_5__repr__(PyObject *__pyx_v_self); /*proto*/ static PyObject *__pyx_pw_11pygame_sdl2_4rect_4Rect_5__repr__(PyObject *__pyx_v_self) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__repr__ (wrapper)", 0); __pyx_r = __pyx_pf_11pygame_sdl2_4rect_4Rect_4__repr__(((struct __pyx_obj_11pygame_sdl2_4rect_Rect *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_4rect_4Rect_4__repr__(struct __pyx_obj_11pygame_sdl2_4rect_Rect *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; PyObject *__pyx_t_5 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__repr__", 0); /* "pygame_sdl2/rect.pyx":72 * * def __repr__(self): * return "" % (self.x, self.y, self.w, self.h) # <<<<<<<<<<<<<< * * def __len__(self): */ __Pyx_XDECREF(__pyx_r); __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_self->x); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 72; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_v_self->y); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 72; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = __Pyx_PyInt_From_int(__pyx_v_self->w); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 72; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = __Pyx_PyInt_From_int(__pyx_v_self->h); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 72; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); __pyx_t_5 = PyTuple_New(4); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 72; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); __Pyx_GIVEREF(__pyx_t_1); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_1); __Pyx_GIVEREF(__pyx_t_2); PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_t_2); __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_5, 2, __pyx_t_3); __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_5, 3, __pyx_t_4); __pyx_t_1 = 0; __pyx_t_2 = 0; __pyx_t_3 = 0; __pyx_t_4 = 0; __pyx_t_4 = PyUnicode_Format(__pyx_kp_u_rect_d_d_d_d, __pyx_t_5); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 72; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __pyx_r = __pyx_t_4; __pyx_t_4 = 0; goto __pyx_L0; /* "pygame_sdl2/rect.pyx":71 * return (Rect, (self.x, self.y, self.w, self.h)) * * def __repr__(self): # <<<<<<<<<<<<<< * return "" % (self.x, self.y, self.w, self.h) * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_5); __Pyx_AddTraceback("pygame_sdl2.rect.Rect.__repr__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/rect.pyx":74 * return "" % (self.x, self.y, self.w, self.h) * * def __len__(self): # <<<<<<<<<<<<<< * return 4 * */ /* Python wrapper */ static Py_ssize_t __pyx_pw_11pygame_sdl2_4rect_4Rect_7__len__(PyObject *__pyx_v_self); /*proto*/ static Py_ssize_t __pyx_pw_11pygame_sdl2_4rect_4Rect_7__len__(PyObject *__pyx_v_self) { Py_ssize_t __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__len__ (wrapper)", 0); __pyx_r = __pyx_pf_11pygame_sdl2_4rect_4Rect_6__len__(((struct __pyx_obj_11pygame_sdl2_4rect_Rect *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static Py_ssize_t __pyx_pf_11pygame_sdl2_4rect_4Rect_6__len__(CYTHON_UNUSED struct __pyx_obj_11pygame_sdl2_4rect_Rect *__pyx_v_self) { Py_ssize_t __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__len__", 0); /* "pygame_sdl2/rect.pyx":75 * * def __len__(self): * return 4 # <<<<<<<<<<<<<< * * def __iter__(self): */ __pyx_r = 4; goto __pyx_L0; /* "pygame_sdl2/rect.pyx":74 * return "" % (self.x, self.y, self.w, self.h) * * def __len__(self): # <<<<<<<<<<<<<< * return 4 * */ /* function exit code */ __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/rect.pyx":77 * return 4 * * def __iter__(self): # <<<<<<<<<<<<<< * return iter((self.x, self.y, self.w, self.h)) * */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_4rect_4Rect_9__iter__(PyObject *__pyx_v_self); /*proto*/ static PyObject *__pyx_pw_11pygame_sdl2_4rect_4Rect_9__iter__(PyObject *__pyx_v_self) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__iter__ (wrapper)", 0); __pyx_r = __pyx_pf_11pygame_sdl2_4rect_4Rect_8__iter__(((struct __pyx_obj_11pygame_sdl2_4rect_Rect *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_4rect_4Rect_8__iter__(struct __pyx_obj_11pygame_sdl2_4rect_Rect *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; PyObject *__pyx_t_5 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__iter__", 0); /* "pygame_sdl2/rect.pyx":78 * * def __iter__(self): * return iter((self.x, self.y, self.w, self.h)) # <<<<<<<<<<<<<< * * def __richcmp__(Rect a, b, int op): */ __Pyx_XDECREF(__pyx_r); __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_self->x); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 78; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_v_self->y); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 78; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = __Pyx_PyInt_From_int(__pyx_v_self->w); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 78; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = __Pyx_PyInt_From_int(__pyx_v_self->h); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 78; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); __pyx_t_5 = PyTuple_New(4); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 78; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); __Pyx_GIVEREF(__pyx_t_1); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_1); __Pyx_GIVEREF(__pyx_t_2); PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_t_2); __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_5, 2, __pyx_t_3); __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_5, 3, __pyx_t_4); __pyx_t_1 = 0; __pyx_t_2 = 0; __pyx_t_3 = 0; __pyx_t_4 = 0; __pyx_t_4 = PyObject_GetIter(__pyx_t_5); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 78; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __pyx_r = __pyx_t_4; __pyx_t_4 = 0; goto __pyx_L0; /* "pygame_sdl2/rect.pyx":77 * return 4 * * def __iter__(self): # <<<<<<<<<<<<<< * return iter((self.x, self.y, self.w, self.h)) * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_5); __Pyx_AddTraceback("pygame_sdl2.rect.Rect.__iter__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/rect.pyx":80 * return iter((self.x, self.y, self.w, self.h)) * * def __richcmp__(Rect a, b, int op): # <<<<<<<<<<<<<< * if not isinstance(b, Rect): * b = Rect(b) */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_4rect_4Rect_11__richcmp__(PyObject *__pyx_v_a, PyObject *__pyx_v_b, int __pyx_v_op); /*proto*/ static PyObject *__pyx_pw_11pygame_sdl2_4rect_4Rect_11__richcmp__(PyObject *__pyx_v_a, PyObject *__pyx_v_b, int __pyx_v_op) { CYTHON_UNUSED int __pyx_lineno = 0; CYTHON_UNUSED const char *__pyx_filename = NULL; CYTHON_UNUSED int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__richcmp__ (wrapper)", 0); if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_a), __pyx_ptype_11pygame_sdl2_4rect_Rect, 1, "a", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 80; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_r = __pyx_pf_11pygame_sdl2_4rect_4Rect_10__richcmp__(((struct __pyx_obj_11pygame_sdl2_4rect_Rect *)__pyx_v_a), ((PyObject *)__pyx_v_b), ((int)__pyx_v_op)); /* function exit code */ goto __pyx_L0; __pyx_L1_error:; __pyx_r = NULL; __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_4rect_4Rect_10__richcmp__(struct __pyx_obj_11pygame_sdl2_4rect_Rect *__pyx_v_a, PyObject *__pyx_v_b, int __pyx_v_op) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; int __pyx_t_2; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; PyObject *__pyx_t_5 = NULL; PyObject *__pyx_t_6 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__richcmp__", 0); __Pyx_INCREF(__pyx_v_b); /* "pygame_sdl2/rect.pyx":81 * * def __richcmp__(Rect a, b, int op): * if not isinstance(b, Rect): # <<<<<<<<<<<<<< * b = Rect(b) * if op == 2: */ __pyx_t_1 = __Pyx_TypeCheck(__pyx_v_b, __pyx_ptype_11pygame_sdl2_4rect_Rect); __pyx_t_2 = ((!(__pyx_t_1 != 0)) != 0); if (__pyx_t_2) { /* "pygame_sdl2/rect.pyx":82 * def __richcmp__(Rect a, b, int op): * if not isinstance(b, Rect): * b = Rect(b) # <<<<<<<<<<<<<< * if op == 2: * return a.x == b.x and a.y == b.y and a.w == b.w and a.h == b.h */ __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 82; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __Pyx_INCREF(__pyx_v_b); __Pyx_GIVEREF(__pyx_v_b); PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_b); __pyx_t_4 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_11pygame_sdl2_4rect_Rect), __pyx_t_3, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 82; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF_SET(__pyx_v_b, __pyx_t_4); __pyx_t_4 = 0; /* "pygame_sdl2/rect.pyx":81 * * def __richcmp__(Rect a, b, int op): * if not isinstance(b, Rect): # <<<<<<<<<<<<<< * b = Rect(b) * if op == 2: */ } /* "pygame_sdl2/rect.pyx":83 * if not isinstance(b, Rect): * b = Rect(b) * if op == 2: # <<<<<<<<<<<<<< * return a.x == b.x and a.y == b.y and a.w == b.w and a.h == b.h * */ __pyx_t_2 = ((__pyx_v_op == 2) != 0); if (__pyx_t_2) { /* "pygame_sdl2/rect.pyx":84 * b = Rect(b) * if op == 2: * return a.x == b.x and a.y == b.y and a.w == b.w and a.h == b.h # <<<<<<<<<<<<<< * * def __getitem__(self, key): */ __Pyx_XDECREF(__pyx_r); __pyx_t_3 = __Pyx_PyInt_From_int(__pyx_v_a->x); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 84; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_b, __pyx_n_s_x); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 84; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); __pyx_t_6 = PyObject_RichCompare(__pyx_t_3, __pyx_t_5, Py_EQ); __Pyx_XGOTREF(__pyx_t_6); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 84; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_6); if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 84; __pyx_clineno = __LINE__; goto __pyx_L1_error;} if (__pyx_t_2) { __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; } else { __Pyx_INCREF(__pyx_t_6); __pyx_t_4 = __pyx_t_6; __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; goto __pyx_L5_bool_binop_done; } __pyx_t_6 = __Pyx_PyInt_From_int(__pyx_v_a->y); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 84; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_6); __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_b, __pyx_n_s_y); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 84; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); __pyx_t_3 = PyObject_RichCompare(__pyx_t_6, __pyx_t_5, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 84; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 84; __pyx_clineno = __LINE__; goto __pyx_L1_error;} if (__pyx_t_2) { __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } else { __Pyx_INCREF(__pyx_t_3); __pyx_t_4 = __pyx_t_3; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; goto __pyx_L5_bool_binop_done; } __pyx_t_3 = __Pyx_PyInt_From_int(__pyx_v_a->w); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 84; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_b, __pyx_n_s_w); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 84; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); __pyx_t_6 = PyObject_RichCompare(__pyx_t_3, __pyx_t_5, Py_EQ); __Pyx_XGOTREF(__pyx_t_6); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 84; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_6); if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 84; __pyx_clineno = __LINE__; goto __pyx_L1_error;} if (__pyx_t_2) { __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; } else { __Pyx_INCREF(__pyx_t_6); __pyx_t_4 = __pyx_t_6; __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; goto __pyx_L5_bool_binop_done; } __pyx_t_6 = __Pyx_PyInt_From_int(__pyx_v_a->h); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 84; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_6); __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_b, __pyx_n_s_h); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 84; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); __pyx_t_3 = PyObject_RichCompare(__pyx_t_6, __pyx_t_5, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 84; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_INCREF(__pyx_t_3); __pyx_t_4 = __pyx_t_3; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_L5_bool_binop_done:; __pyx_r = __pyx_t_4; __pyx_t_4 = 0; goto __pyx_L0; /* "pygame_sdl2/rect.pyx":83 * if not isinstance(b, Rect): * b = Rect(b) * if op == 2: # <<<<<<<<<<<<<< * return a.x == b.x and a.y == b.y and a.w == b.w and a.h == b.h * */ } /* "pygame_sdl2/rect.pyx":80 * return iter((self.x, self.y, self.w, self.h)) * * def __richcmp__(Rect a, b, int op): # <<<<<<<<<<<<<< * if not isinstance(b, Rect): * b = Rect(b) */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_5); __Pyx_XDECREF(__pyx_t_6); __Pyx_AddTraceback("pygame_sdl2.rect.Rect.__richcmp__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF(__pyx_v_b); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/rect.pyx":86 * return a.x == b.x and a.y == b.y and a.w == b.w and a.h == b.h * * def __getitem__(self, key): # <<<<<<<<<<<<<< * return (self.x, self.y, self.w, self.h)[key] * */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_4rect_4Rect_13__getitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_key); /*proto*/ static PyObject *__pyx_pw_11pygame_sdl2_4rect_4Rect_13__getitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_key) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__getitem__ (wrapper)", 0); __pyx_r = __pyx_pf_11pygame_sdl2_4rect_4Rect_12__getitem__(((struct __pyx_obj_11pygame_sdl2_4rect_Rect *)__pyx_v_self), ((PyObject *)__pyx_v_key)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_4rect_4Rect_12__getitem__(struct __pyx_obj_11pygame_sdl2_4rect_Rect *__pyx_v_self, PyObject *__pyx_v_key) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; PyObject *__pyx_t_5 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__getitem__", 0); /* "pygame_sdl2/rect.pyx":87 * * def __getitem__(self, key): * return (self.x, self.y, self.w, self.h)[key] # <<<<<<<<<<<<<< * * def __setitem__(self, key, val): */ __Pyx_XDECREF(__pyx_r); __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_self->x); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 87; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_v_self->y); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 87; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = __Pyx_PyInt_From_int(__pyx_v_self->w); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 87; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = __Pyx_PyInt_From_int(__pyx_v_self->h); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 87; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); __pyx_t_5 = PyTuple_New(4); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 87; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); __Pyx_GIVEREF(__pyx_t_1); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_1); __Pyx_GIVEREF(__pyx_t_2); PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_t_2); __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_5, 2, __pyx_t_3); __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_5, 3, __pyx_t_4); __pyx_t_1 = 0; __pyx_t_2 = 0; __pyx_t_3 = 0; __pyx_t_4 = 0; __pyx_t_4 = PyObject_GetItem(__pyx_t_5, __pyx_v_key); if (unlikely(__pyx_t_4 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 87; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __pyx_r = __pyx_t_4; __pyx_t_4 = 0; goto __pyx_L0; /* "pygame_sdl2/rect.pyx":86 * return a.x == b.x and a.y == b.y and a.w == b.w and a.h == b.h * * def __getitem__(self, key): # <<<<<<<<<<<<<< * return (self.x, self.y, self.w, self.h)[key] * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_5); __Pyx_AddTraceback("pygame_sdl2.rect.Rect.__getitem__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/rect.pyx":89 * return (self.x, self.y, self.w, self.h)[key] * * def __setitem__(self, key, val): # <<<<<<<<<<<<<< * if key == 0: * self.x = val */ /* Python wrapper */ static int __pyx_pw_11pygame_sdl2_4rect_4Rect_15__setitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_key, PyObject *__pyx_v_val); /*proto*/ static int __pyx_pw_11pygame_sdl2_4rect_4Rect_15__setitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_key, PyObject *__pyx_v_val) { int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__setitem__ (wrapper)", 0); __pyx_r = __pyx_pf_11pygame_sdl2_4rect_4Rect_14__setitem__(((struct __pyx_obj_11pygame_sdl2_4rect_Rect *)__pyx_v_self), ((PyObject *)__pyx_v_key), ((PyObject *)__pyx_v_val)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static int __pyx_pf_11pygame_sdl2_4rect_4Rect_14__setitem__(struct __pyx_obj_11pygame_sdl2_4rect_Rect *__pyx_v_self, PyObject *__pyx_v_key, PyObject *__pyx_v_val) { int __pyx_r; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_t_2; int __pyx_t_3; PyObject *__pyx_t_4 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__setitem__", 0); /* "pygame_sdl2/rect.pyx":90 * * def __setitem__(self, key, val): * if key == 0: # <<<<<<<<<<<<<< * self.x = val * elif key == 1: */ __pyx_t_1 = __Pyx_PyInt_EqObjC(__pyx_v_key, __pyx_int_0, 0, 0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 90; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 90; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (__pyx_t_2) { /* "pygame_sdl2/rect.pyx":91 * def __setitem__(self, key, val): * if key == 0: * self.x = val # <<<<<<<<<<<<<< * elif key == 1: * self.y = val */ __pyx_t_3 = __Pyx_PyInt_As_int(__pyx_v_val); if (unlikely((__pyx_t_3 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 91; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_v_self->x = __pyx_t_3; /* "pygame_sdl2/rect.pyx":90 * * def __setitem__(self, key, val): * if key == 0: # <<<<<<<<<<<<<< * self.x = val * elif key == 1: */ goto __pyx_L3; } /* "pygame_sdl2/rect.pyx":92 * if key == 0: * self.x = val * elif key == 1: # <<<<<<<<<<<<<< * self.y = val * elif key == 2: */ __pyx_t_1 = __Pyx_PyInt_EqObjC(__pyx_v_key, __pyx_int_1, 1, 0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 92; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 92; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (__pyx_t_2) { /* "pygame_sdl2/rect.pyx":93 * self.x = val * elif key == 1: * self.y = val # <<<<<<<<<<<<<< * elif key == 2: * self.w = val */ __pyx_t_3 = __Pyx_PyInt_As_int(__pyx_v_val); if (unlikely((__pyx_t_3 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 93; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_v_self->y = __pyx_t_3; /* "pygame_sdl2/rect.pyx":92 * if key == 0: * self.x = val * elif key == 1: # <<<<<<<<<<<<<< * self.y = val * elif key == 2: */ goto __pyx_L3; } /* "pygame_sdl2/rect.pyx":94 * elif key == 1: * self.y = val * elif key == 2: # <<<<<<<<<<<<<< * self.w = val * elif key == 3: */ __pyx_t_1 = __Pyx_PyInt_EqObjC(__pyx_v_key, __pyx_int_2, 2, 0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 94; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 94; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (__pyx_t_2) { /* "pygame_sdl2/rect.pyx":95 * self.y = val * elif key == 2: * self.w = val # <<<<<<<<<<<<<< * elif key == 3: * self.h = val */ __pyx_t_3 = __Pyx_PyInt_As_int(__pyx_v_val); if (unlikely((__pyx_t_3 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 95; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_v_self->w = __pyx_t_3; /* "pygame_sdl2/rect.pyx":94 * elif key == 1: * self.y = val * elif key == 2: # <<<<<<<<<<<<<< * self.w = val * elif key == 3: */ goto __pyx_L3; } /* "pygame_sdl2/rect.pyx":96 * elif key == 2: * self.w = val * elif key == 3: # <<<<<<<<<<<<<< * self.h = val * else: */ __pyx_t_1 = __Pyx_PyInt_EqObjC(__pyx_v_key, __pyx_int_3, 3, 0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 96; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 96; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (__pyx_t_2) { /* "pygame_sdl2/rect.pyx":97 * self.w = val * elif key == 3: * self.h = val # <<<<<<<<<<<<<< * else: * raise IndexError(key) */ __pyx_t_3 = __Pyx_PyInt_As_int(__pyx_v_val); if (unlikely((__pyx_t_3 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 97; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_v_self->h = __pyx_t_3; /* "pygame_sdl2/rect.pyx":96 * elif key == 2: * self.w = val * elif key == 3: # <<<<<<<<<<<<<< * self.h = val * else: */ goto __pyx_L3; } /* "pygame_sdl2/rect.pyx":99 * self.h = val * else: * raise IndexError(key) # <<<<<<<<<<<<<< * * property left: */ /*else*/ { __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 99; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __Pyx_INCREF(__pyx_v_key); __Pyx_GIVEREF(__pyx_v_key); PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_key); __pyx_t_4 = __Pyx_PyObject_Call(__pyx_builtin_IndexError, __pyx_t_1, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 99; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_Raise(__pyx_t_4, 0, 0, 0); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; {__pyx_filename = __pyx_f[0]; __pyx_lineno = 99; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } __pyx_L3:; /* "pygame_sdl2/rect.pyx":89 * return (self.x, self.y, self.w, self.h)[key] * * def __setitem__(self, key, val): # <<<<<<<<<<<<<< * if key == 0: * self.x = val */ /* function exit code */ __pyx_r = 0; goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_4); __Pyx_AddTraceback("pygame_sdl2.rect.Rect.__setitem__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = -1; __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/rect.pyx":102 * * property left: * def __get__(self): # <<<<<<<<<<<<<< * return self.x * def __set__(self, val): */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_4rect_4Rect_4left_1__get__(PyObject *__pyx_v_self); /*proto*/ static PyObject *__pyx_pw_11pygame_sdl2_4rect_4Rect_4left_1__get__(PyObject *__pyx_v_self) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); __pyx_r = __pyx_pf_11pygame_sdl2_4rect_4Rect_4left___get__(((struct __pyx_obj_11pygame_sdl2_4rect_Rect *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_4rect_4Rect_4left___get__(struct __pyx_obj_11pygame_sdl2_4rect_Rect *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__get__", 0); /* "pygame_sdl2/rect.pyx":103 * property left: * def __get__(self): * return self.x # <<<<<<<<<<<<<< * def __set__(self, val): * self.x = val */ __Pyx_XDECREF(__pyx_r); __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_self->x); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 103; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "pygame_sdl2/rect.pyx":102 * * property left: * def __get__(self): # <<<<<<<<<<<<<< * return self.x * def __set__(self, val): */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("pygame_sdl2.rect.Rect.left.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/rect.pyx":104 * def __get__(self): * return self.x * def __set__(self, val): # <<<<<<<<<<<<<< * self.x = val * */ /* Python wrapper */ static int __pyx_pw_11pygame_sdl2_4rect_4Rect_4left_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_val); /*proto*/ static int __pyx_pw_11pygame_sdl2_4rect_4Rect_4left_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_val) { int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__set__ (wrapper)", 0); __pyx_r = __pyx_pf_11pygame_sdl2_4rect_4Rect_4left_2__set__(((struct __pyx_obj_11pygame_sdl2_4rect_Rect *)__pyx_v_self), ((PyObject *)__pyx_v_val)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static int __pyx_pf_11pygame_sdl2_4rect_4Rect_4left_2__set__(struct __pyx_obj_11pygame_sdl2_4rect_Rect *__pyx_v_self, PyObject *__pyx_v_val) { int __pyx_r; __Pyx_RefNannyDeclarations int __pyx_t_1; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__set__", 0); /* "pygame_sdl2/rect.pyx":105 * return self.x * def __set__(self, val): * self.x = val # <<<<<<<<<<<<<< * * property top: */ __pyx_t_1 = __Pyx_PyInt_As_int(__pyx_v_val); if (unlikely((__pyx_t_1 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 105; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_v_self->x = __pyx_t_1; /* "pygame_sdl2/rect.pyx":104 * def __get__(self): * return self.x * def __set__(self, val): # <<<<<<<<<<<<<< * self.x = val * */ /* function exit code */ __pyx_r = 0; goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("pygame_sdl2.rect.Rect.left.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = -1; __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/rect.pyx":108 * * property top: * def __get__(self): # <<<<<<<<<<<<<< * return self.y * def __set__(self, val): */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_4rect_4Rect_3top_1__get__(PyObject *__pyx_v_self); /*proto*/ static PyObject *__pyx_pw_11pygame_sdl2_4rect_4Rect_3top_1__get__(PyObject *__pyx_v_self) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); __pyx_r = __pyx_pf_11pygame_sdl2_4rect_4Rect_3top___get__(((struct __pyx_obj_11pygame_sdl2_4rect_Rect *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_4rect_4Rect_3top___get__(struct __pyx_obj_11pygame_sdl2_4rect_Rect *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__get__", 0); /* "pygame_sdl2/rect.pyx":109 * property top: * def __get__(self): * return self.y # <<<<<<<<<<<<<< * def __set__(self, val): * self.y = val */ __Pyx_XDECREF(__pyx_r); __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_self->y); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 109; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "pygame_sdl2/rect.pyx":108 * * property top: * def __get__(self): # <<<<<<<<<<<<<< * return self.y * def __set__(self, val): */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("pygame_sdl2.rect.Rect.top.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/rect.pyx":110 * def __get__(self): * return self.y * def __set__(self, val): # <<<<<<<<<<<<<< * self.y = val * */ /* Python wrapper */ static int __pyx_pw_11pygame_sdl2_4rect_4Rect_3top_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_val); /*proto*/ static int __pyx_pw_11pygame_sdl2_4rect_4Rect_3top_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_val) { int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__set__ (wrapper)", 0); __pyx_r = __pyx_pf_11pygame_sdl2_4rect_4Rect_3top_2__set__(((struct __pyx_obj_11pygame_sdl2_4rect_Rect *)__pyx_v_self), ((PyObject *)__pyx_v_val)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static int __pyx_pf_11pygame_sdl2_4rect_4Rect_3top_2__set__(struct __pyx_obj_11pygame_sdl2_4rect_Rect *__pyx_v_self, PyObject *__pyx_v_val) { int __pyx_r; __Pyx_RefNannyDeclarations int __pyx_t_1; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__set__", 0); /* "pygame_sdl2/rect.pyx":111 * return self.y * def __set__(self, val): * self.y = val # <<<<<<<<<<<<<< * * property width: */ __pyx_t_1 = __Pyx_PyInt_As_int(__pyx_v_val); if (unlikely((__pyx_t_1 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 111; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_v_self->y = __pyx_t_1; /* "pygame_sdl2/rect.pyx":110 * def __get__(self): * return self.y * def __set__(self, val): # <<<<<<<<<<<<<< * self.y = val * */ /* function exit code */ __pyx_r = 0; goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("pygame_sdl2.rect.Rect.top.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = -1; __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/rect.pyx":114 * * property width: * def __get__(self): # <<<<<<<<<<<<<< * return self.w * def __set__(self, val): */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_4rect_4Rect_5width_1__get__(PyObject *__pyx_v_self); /*proto*/ static PyObject *__pyx_pw_11pygame_sdl2_4rect_4Rect_5width_1__get__(PyObject *__pyx_v_self) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); __pyx_r = __pyx_pf_11pygame_sdl2_4rect_4Rect_5width___get__(((struct __pyx_obj_11pygame_sdl2_4rect_Rect *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_4rect_4Rect_5width___get__(struct __pyx_obj_11pygame_sdl2_4rect_Rect *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__get__", 0); /* "pygame_sdl2/rect.pyx":115 * property width: * def __get__(self): * return self.w # <<<<<<<<<<<<<< * def __set__(self, val): * self.w = val */ __Pyx_XDECREF(__pyx_r); __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_self->w); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 115; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "pygame_sdl2/rect.pyx":114 * * property width: * def __get__(self): # <<<<<<<<<<<<<< * return self.w * def __set__(self, val): */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("pygame_sdl2.rect.Rect.width.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/rect.pyx":116 * def __get__(self): * return self.w * def __set__(self, val): # <<<<<<<<<<<<<< * self.w = val * */ /* Python wrapper */ static int __pyx_pw_11pygame_sdl2_4rect_4Rect_5width_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_val); /*proto*/ static int __pyx_pw_11pygame_sdl2_4rect_4Rect_5width_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_val) { int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__set__ (wrapper)", 0); __pyx_r = __pyx_pf_11pygame_sdl2_4rect_4Rect_5width_2__set__(((struct __pyx_obj_11pygame_sdl2_4rect_Rect *)__pyx_v_self), ((PyObject *)__pyx_v_val)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static int __pyx_pf_11pygame_sdl2_4rect_4Rect_5width_2__set__(struct __pyx_obj_11pygame_sdl2_4rect_Rect *__pyx_v_self, PyObject *__pyx_v_val) { int __pyx_r; __Pyx_RefNannyDeclarations int __pyx_t_1; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__set__", 0); /* "pygame_sdl2/rect.pyx":117 * return self.w * def __set__(self, val): * self.w = val # <<<<<<<<<<<<<< * * property height: */ __pyx_t_1 = __Pyx_PyInt_As_int(__pyx_v_val); if (unlikely((__pyx_t_1 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 117; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_v_self->w = __pyx_t_1; /* "pygame_sdl2/rect.pyx":116 * def __get__(self): * return self.w * def __set__(self, val): # <<<<<<<<<<<<<< * self.w = val * */ /* function exit code */ __pyx_r = 0; goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("pygame_sdl2.rect.Rect.width.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = -1; __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/rect.pyx":120 * * property height: * def __get__(self): # <<<<<<<<<<<<<< * return self.h * def __set__(self, val): */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_4rect_4Rect_6height_1__get__(PyObject *__pyx_v_self); /*proto*/ static PyObject *__pyx_pw_11pygame_sdl2_4rect_4Rect_6height_1__get__(PyObject *__pyx_v_self) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); __pyx_r = __pyx_pf_11pygame_sdl2_4rect_4Rect_6height___get__(((struct __pyx_obj_11pygame_sdl2_4rect_Rect *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_4rect_4Rect_6height___get__(struct __pyx_obj_11pygame_sdl2_4rect_Rect *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__get__", 0); /* "pygame_sdl2/rect.pyx":121 * property height: * def __get__(self): * return self.h # <<<<<<<<<<<<<< * def __set__(self, val): * self.h = val */ __Pyx_XDECREF(__pyx_r); __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_self->h); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 121; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "pygame_sdl2/rect.pyx":120 * * property height: * def __get__(self): # <<<<<<<<<<<<<< * return self.h * def __set__(self, val): */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("pygame_sdl2.rect.Rect.height.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/rect.pyx":122 * def __get__(self): * return self.h * def __set__(self, val): # <<<<<<<<<<<<<< * self.h = val * */ /* Python wrapper */ static int __pyx_pw_11pygame_sdl2_4rect_4Rect_6height_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_val); /*proto*/ static int __pyx_pw_11pygame_sdl2_4rect_4Rect_6height_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_val) { int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__set__ (wrapper)", 0); __pyx_r = __pyx_pf_11pygame_sdl2_4rect_4Rect_6height_2__set__(((struct __pyx_obj_11pygame_sdl2_4rect_Rect *)__pyx_v_self), ((PyObject *)__pyx_v_val)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static int __pyx_pf_11pygame_sdl2_4rect_4Rect_6height_2__set__(struct __pyx_obj_11pygame_sdl2_4rect_Rect *__pyx_v_self, PyObject *__pyx_v_val) { int __pyx_r; __Pyx_RefNannyDeclarations int __pyx_t_1; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__set__", 0); /* "pygame_sdl2/rect.pyx":123 * return self.h * def __set__(self, val): * self.h = val # <<<<<<<<<<<<<< * * property right: */ __pyx_t_1 = __Pyx_PyInt_As_int(__pyx_v_val); if (unlikely((__pyx_t_1 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 123; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_v_self->h = __pyx_t_1; /* "pygame_sdl2/rect.pyx":122 * def __get__(self): * return self.h * def __set__(self, val): # <<<<<<<<<<<<<< * self.h = val * */ /* function exit code */ __pyx_r = 0; goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("pygame_sdl2.rect.Rect.height.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = -1; __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/rect.pyx":126 * * property right: * def __get__(self): # <<<<<<<<<<<<<< * return self.x + self.width * def __set__(self, val): */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_4rect_4Rect_5right_1__get__(PyObject *__pyx_v_self); /*proto*/ static PyObject *__pyx_pw_11pygame_sdl2_4rect_4Rect_5right_1__get__(PyObject *__pyx_v_self) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); __pyx_r = __pyx_pf_11pygame_sdl2_4rect_4Rect_5right___get__(((struct __pyx_obj_11pygame_sdl2_4rect_Rect *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_4rect_4Rect_5right___get__(struct __pyx_obj_11pygame_sdl2_4rect_Rect *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__get__", 0); /* "pygame_sdl2/rect.pyx":127 * property right: * def __get__(self): * return self.x + self.width # <<<<<<<<<<<<<< * def __set__(self, val): * self.x += val - self.right */ __Pyx_XDECREF(__pyx_r); __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_self->x); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 127; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_width); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 127; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = PyNumber_Add(__pyx_t_1, __pyx_t_2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 127; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_r = __pyx_t_3; __pyx_t_3 = 0; goto __pyx_L0; /* "pygame_sdl2/rect.pyx":126 * * property right: * def __get__(self): # <<<<<<<<<<<<<< * return self.x + self.width * def __set__(self, val): */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("pygame_sdl2.rect.Rect.right.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/rect.pyx":128 * def __get__(self): * return self.x + self.width * def __set__(self, val): # <<<<<<<<<<<<<< * self.x += val - self.right * */ /* Python wrapper */ static int __pyx_pw_11pygame_sdl2_4rect_4Rect_5right_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_val); /*proto*/ static int __pyx_pw_11pygame_sdl2_4rect_4Rect_5right_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_val) { int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__set__ (wrapper)", 0); __pyx_r = __pyx_pf_11pygame_sdl2_4rect_4Rect_5right_2__set__(((struct __pyx_obj_11pygame_sdl2_4rect_Rect *)__pyx_v_self), ((PyObject *)__pyx_v_val)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static int __pyx_pf_11pygame_sdl2_4rect_4Rect_5right_2__set__(struct __pyx_obj_11pygame_sdl2_4rect_Rect *__pyx_v_self, PyObject *__pyx_v_val) { int __pyx_r; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; int __pyx_t_4; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__set__", 0); /* "pygame_sdl2/rect.pyx":129 * return self.x + self.width * def __set__(self, val): * self.x += val - self.right # <<<<<<<<<<<<<< * * property bottom: */ __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_self->x); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 129; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_right); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 129; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = PyNumber_Subtract(__pyx_v_val, __pyx_t_2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 129; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_2 = PyNumber_InPlaceAdd(__pyx_t_1, __pyx_t_3); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 129; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_4 = __Pyx_PyInt_As_int(__pyx_t_2); if (unlikely((__pyx_t_4 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 129; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_v_self->x = __pyx_t_4; /* "pygame_sdl2/rect.pyx":128 * def __get__(self): * return self.x + self.width * def __set__(self, val): # <<<<<<<<<<<<<< * self.x += val - self.right * */ /* function exit code */ __pyx_r = 0; goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("pygame_sdl2.rect.Rect.right.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = -1; __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/rect.pyx":132 * * property bottom: * def __get__(self): # <<<<<<<<<<<<<< * return self.y + self.height * def __set__(self, val): */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_4rect_4Rect_6bottom_1__get__(PyObject *__pyx_v_self); /*proto*/ static PyObject *__pyx_pw_11pygame_sdl2_4rect_4Rect_6bottom_1__get__(PyObject *__pyx_v_self) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); __pyx_r = __pyx_pf_11pygame_sdl2_4rect_4Rect_6bottom___get__(((struct __pyx_obj_11pygame_sdl2_4rect_Rect *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_4rect_4Rect_6bottom___get__(struct __pyx_obj_11pygame_sdl2_4rect_Rect *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__get__", 0); /* "pygame_sdl2/rect.pyx":133 * property bottom: * def __get__(self): * return self.y + self.height # <<<<<<<<<<<<<< * def __set__(self, val): * self.y += val - self.bottom */ __Pyx_XDECREF(__pyx_r); __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_self->y); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 133; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_height); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 133; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = PyNumber_Add(__pyx_t_1, __pyx_t_2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 133; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_r = __pyx_t_3; __pyx_t_3 = 0; goto __pyx_L0; /* "pygame_sdl2/rect.pyx":132 * * property bottom: * def __get__(self): # <<<<<<<<<<<<<< * return self.y + self.height * def __set__(self, val): */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("pygame_sdl2.rect.Rect.bottom.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/rect.pyx":134 * def __get__(self): * return self.y + self.height * def __set__(self, val): # <<<<<<<<<<<<<< * self.y += val - self.bottom * */ /* Python wrapper */ static int __pyx_pw_11pygame_sdl2_4rect_4Rect_6bottom_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_val); /*proto*/ static int __pyx_pw_11pygame_sdl2_4rect_4Rect_6bottom_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_val) { int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__set__ (wrapper)", 0); __pyx_r = __pyx_pf_11pygame_sdl2_4rect_4Rect_6bottom_2__set__(((struct __pyx_obj_11pygame_sdl2_4rect_Rect *)__pyx_v_self), ((PyObject *)__pyx_v_val)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static int __pyx_pf_11pygame_sdl2_4rect_4Rect_6bottom_2__set__(struct __pyx_obj_11pygame_sdl2_4rect_Rect *__pyx_v_self, PyObject *__pyx_v_val) { int __pyx_r; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; int __pyx_t_4; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__set__", 0); /* "pygame_sdl2/rect.pyx":135 * return self.y + self.height * def __set__(self, val): * self.y += val - self.bottom # <<<<<<<<<<<<<< * * property size: */ __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_self->y); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 135; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_bottom); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 135; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = PyNumber_Subtract(__pyx_v_val, __pyx_t_2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 135; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_2 = PyNumber_InPlaceAdd(__pyx_t_1, __pyx_t_3); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 135; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_4 = __Pyx_PyInt_As_int(__pyx_t_2); if (unlikely((__pyx_t_4 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 135; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_v_self->y = __pyx_t_4; /* "pygame_sdl2/rect.pyx":134 * def __get__(self): * return self.y + self.height * def __set__(self, val): # <<<<<<<<<<<<<< * self.y += val - self.bottom * */ /* function exit code */ __pyx_r = 0; goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("pygame_sdl2.rect.Rect.bottom.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = -1; __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/rect.pyx":138 * * property size: * def __get__(self): # <<<<<<<<<<<<<< * return (self.w, self.h) * def __set__(self, val): */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_4rect_4Rect_4size_1__get__(PyObject *__pyx_v_self); /*proto*/ static PyObject *__pyx_pw_11pygame_sdl2_4rect_4Rect_4size_1__get__(PyObject *__pyx_v_self) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); __pyx_r = __pyx_pf_11pygame_sdl2_4rect_4Rect_4size___get__(((struct __pyx_obj_11pygame_sdl2_4rect_Rect *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_4rect_4Rect_4size___get__(struct __pyx_obj_11pygame_sdl2_4rect_Rect *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__get__", 0); /* "pygame_sdl2/rect.pyx":139 * property size: * def __get__(self): * return (self.w, self.h) # <<<<<<<<<<<<<< * def __set__(self, val): * self.w, self.h = val */ __Pyx_XDECREF(__pyx_r); __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_self->w); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 139; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_v_self->h); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 139; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 139; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __Pyx_GIVEREF(__pyx_t_1); PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_1); __Pyx_GIVEREF(__pyx_t_2); PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_2); __pyx_t_1 = 0; __pyx_t_2 = 0; __pyx_r = __pyx_t_3; __pyx_t_3 = 0; goto __pyx_L0; /* "pygame_sdl2/rect.pyx":138 * * property size: * def __get__(self): # <<<<<<<<<<<<<< * return (self.w, self.h) * def __set__(self, val): */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("pygame_sdl2.rect.Rect.size.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/rect.pyx":140 * def __get__(self): * return (self.w, self.h) * def __set__(self, val): # <<<<<<<<<<<<<< * self.w, self.h = val * */ /* Python wrapper */ static int __pyx_pw_11pygame_sdl2_4rect_4Rect_4size_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_val); /*proto*/ static int __pyx_pw_11pygame_sdl2_4rect_4Rect_4size_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_val) { int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__set__ (wrapper)", 0); __pyx_r = __pyx_pf_11pygame_sdl2_4rect_4Rect_4size_2__set__(((struct __pyx_obj_11pygame_sdl2_4rect_Rect *)__pyx_v_self), ((PyObject *)__pyx_v_val)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static int __pyx_pf_11pygame_sdl2_4rect_4Rect_4size_2__set__(struct __pyx_obj_11pygame_sdl2_4rect_Rect *__pyx_v_self, PyObject *__pyx_v_val) { int __pyx_r; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; PyObject *(*__pyx_t_4)(PyObject *); int __pyx_t_5; int __pyx_t_6; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__set__", 0); /* "pygame_sdl2/rect.pyx":141 * return (self.w, self.h) * def __set__(self, val): * self.w, self.h = val # <<<<<<<<<<<<<< * * property topleft: */ if ((likely(PyTuple_CheckExact(__pyx_v_val))) || (PyList_CheckExact(__pyx_v_val))) { PyObject* sequence = __pyx_v_val; #if CYTHON_COMPILING_IN_CPYTHON Py_ssize_t size = Py_SIZE(sequence); #else Py_ssize_t size = PySequence_Size(sequence); #endif if (unlikely(size != 2)) { if (size > 2) __Pyx_RaiseTooManyValuesError(2); else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 141; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } #if CYTHON_COMPILING_IN_CPYTHON if (likely(PyTuple_CheckExact(sequence))) { __pyx_t_1 = PyTuple_GET_ITEM(sequence, 0); __pyx_t_2 = PyTuple_GET_ITEM(sequence, 1); } else { __pyx_t_1 = PyList_GET_ITEM(sequence, 0); __pyx_t_2 = PyList_GET_ITEM(sequence, 1); } __Pyx_INCREF(__pyx_t_1); __Pyx_INCREF(__pyx_t_2); #else __pyx_t_1 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 141; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 141; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); #endif } else { Py_ssize_t index = -1; __pyx_t_3 = PyObject_GetIter(__pyx_v_val); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 141; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = Py_TYPE(__pyx_t_3)->tp_iternext; index = 0; __pyx_t_1 = __pyx_t_4(__pyx_t_3); if (unlikely(!__pyx_t_1)) goto __pyx_L3_unpacking_failed; __Pyx_GOTREF(__pyx_t_1); index = 1; __pyx_t_2 = __pyx_t_4(__pyx_t_3); if (unlikely(!__pyx_t_2)) goto __pyx_L3_unpacking_failed; __Pyx_GOTREF(__pyx_t_2); if (__Pyx_IternextUnpackEndCheck(__pyx_t_4(__pyx_t_3), 2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 141; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_t_4 = NULL; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; goto __pyx_L4_unpacking_done; __pyx_L3_unpacking_failed:; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_4 = NULL; if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 141; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_L4_unpacking_done:; } __pyx_t_5 = __Pyx_PyInt_As_int(__pyx_t_1); if (unlikely((__pyx_t_5 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 141; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_6 = __Pyx_PyInt_As_int(__pyx_t_2); if (unlikely((__pyx_t_6 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 141; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_v_self->w = __pyx_t_5; __pyx_v_self->h = __pyx_t_6; /* "pygame_sdl2/rect.pyx":140 * def __get__(self): * return (self.w, self.h) * def __set__(self, val): # <<<<<<<<<<<<<< * self.w, self.h = val * */ /* function exit code */ __pyx_r = 0; goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("pygame_sdl2.rect.Rect.size.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = -1; __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/rect.pyx":144 * * property topleft: * def __get__(self): # <<<<<<<<<<<<<< * return (self.left, self.top) * def __set__(self, val): */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_4rect_4Rect_7topleft_1__get__(PyObject *__pyx_v_self); /*proto*/ static PyObject *__pyx_pw_11pygame_sdl2_4rect_4Rect_7topleft_1__get__(PyObject *__pyx_v_self) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); __pyx_r = __pyx_pf_11pygame_sdl2_4rect_4Rect_7topleft___get__(((struct __pyx_obj_11pygame_sdl2_4rect_Rect *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_4rect_4Rect_7topleft___get__(struct __pyx_obj_11pygame_sdl2_4rect_Rect *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__get__", 0); /* "pygame_sdl2/rect.pyx":145 * property topleft: * def __get__(self): * return (self.left, self.top) # <<<<<<<<<<<<<< * def __set__(self, val): * self.left, self.top = val */ __Pyx_XDECREF(__pyx_r); __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_left); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 145; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_top); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 145; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 145; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __Pyx_GIVEREF(__pyx_t_1); PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_1); __Pyx_GIVEREF(__pyx_t_2); PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_2); __pyx_t_1 = 0; __pyx_t_2 = 0; __pyx_r = __pyx_t_3; __pyx_t_3 = 0; goto __pyx_L0; /* "pygame_sdl2/rect.pyx":144 * * property topleft: * def __get__(self): # <<<<<<<<<<<<<< * return (self.left, self.top) * def __set__(self, val): */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("pygame_sdl2.rect.Rect.topleft.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/rect.pyx":146 * def __get__(self): * return (self.left, self.top) * def __set__(self, val): # <<<<<<<<<<<<<< * self.left, self.top = val * */ /* Python wrapper */ static int __pyx_pw_11pygame_sdl2_4rect_4Rect_7topleft_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_val); /*proto*/ static int __pyx_pw_11pygame_sdl2_4rect_4Rect_7topleft_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_val) { int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__set__ (wrapper)", 0); __pyx_r = __pyx_pf_11pygame_sdl2_4rect_4Rect_7topleft_2__set__(((struct __pyx_obj_11pygame_sdl2_4rect_Rect *)__pyx_v_self), ((PyObject *)__pyx_v_val)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static int __pyx_pf_11pygame_sdl2_4rect_4Rect_7topleft_2__set__(struct __pyx_obj_11pygame_sdl2_4rect_Rect *__pyx_v_self, PyObject *__pyx_v_val) { int __pyx_r; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; PyObject *(*__pyx_t_4)(PyObject *); int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__set__", 0); /* "pygame_sdl2/rect.pyx":147 * return (self.left, self.top) * def __set__(self, val): * self.left, self.top = val # <<<<<<<<<<<<<< * * property topright: */ if ((likely(PyTuple_CheckExact(__pyx_v_val))) || (PyList_CheckExact(__pyx_v_val))) { PyObject* sequence = __pyx_v_val; #if CYTHON_COMPILING_IN_CPYTHON Py_ssize_t size = Py_SIZE(sequence); #else Py_ssize_t size = PySequence_Size(sequence); #endif if (unlikely(size != 2)) { if (size > 2) __Pyx_RaiseTooManyValuesError(2); else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 147; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } #if CYTHON_COMPILING_IN_CPYTHON if (likely(PyTuple_CheckExact(sequence))) { __pyx_t_1 = PyTuple_GET_ITEM(sequence, 0); __pyx_t_2 = PyTuple_GET_ITEM(sequence, 1); } else { __pyx_t_1 = PyList_GET_ITEM(sequence, 0); __pyx_t_2 = PyList_GET_ITEM(sequence, 1); } __Pyx_INCREF(__pyx_t_1); __Pyx_INCREF(__pyx_t_2); #else __pyx_t_1 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 147; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 147; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); #endif } else { Py_ssize_t index = -1; __pyx_t_3 = PyObject_GetIter(__pyx_v_val); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 147; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = Py_TYPE(__pyx_t_3)->tp_iternext; index = 0; __pyx_t_1 = __pyx_t_4(__pyx_t_3); if (unlikely(!__pyx_t_1)) goto __pyx_L3_unpacking_failed; __Pyx_GOTREF(__pyx_t_1); index = 1; __pyx_t_2 = __pyx_t_4(__pyx_t_3); if (unlikely(!__pyx_t_2)) goto __pyx_L3_unpacking_failed; __Pyx_GOTREF(__pyx_t_2); if (__Pyx_IternextUnpackEndCheck(__pyx_t_4(__pyx_t_3), 2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 147; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_t_4 = NULL; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; goto __pyx_L4_unpacking_done; __pyx_L3_unpacking_failed:; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_4 = NULL; if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 147; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_L4_unpacking_done:; } if (__Pyx_PyObject_SetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_left, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 147; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (__Pyx_PyObject_SetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_top, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 147; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "pygame_sdl2/rect.pyx":146 * def __get__(self): * return (self.left, self.top) * def __set__(self, val): # <<<<<<<<<<<<<< * self.left, self.top = val * */ /* function exit code */ __pyx_r = 0; goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("pygame_sdl2.rect.Rect.topleft.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = -1; __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/rect.pyx":150 * * property topright: * def __get__(self): # <<<<<<<<<<<<<< * return (self.right, self.top) * def __set__(self, val): */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_4rect_4Rect_8topright_1__get__(PyObject *__pyx_v_self); /*proto*/ static PyObject *__pyx_pw_11pygame_sdl2_4rect_4Rect_8topright_1__get__(PyObject *__pyx_v_self) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); __pyx_r = __pyx_pf_11pygame_sdl2_4rect_4Rect_8topright___get__(((struct __pyx_obj_11pygame_sdl2_4rect_Rect *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_4rect_4Rect_8topright___get__(struct __pyx_obj_11pygame_sdl2_4rect_Rect *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__get__", 0); /* "pygame_sdl2/rect.pyx":151 * property topright: * def __get__(self): * return (self.right, self.top) # <<<<<<<<<<<<<< * def __set__(self, val): * self.right, self.top = val */ __Pyx_XDECREF(__pyx_r); __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_right); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 151; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_top); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 151; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 151; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __Pyx_GIVEREF(__pyx_t_1); PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_1); __Pyx_GIVEREF(__pyx_t_2); PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_2); __pyx_t_1 = 0; __pyx_t_2 = 0; __pyx_r = __pyx_t_3; __pyx_t_3 = 0; goto __pyx_L0; /* "pygame_sdl2/rect.pyx":150 * * property topright: * def __get__(self): # <<<<<<<<<<<<<< * return (self.right, self.top) * def __set__(self, val): */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("pygame_sdl2.rect.Rect.topright.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/rect.pyx":152 * def __get__(self): * return (self.right, self.top) * def __set__(self, val): # <<<<<<<<<<<<<< * self.right, self.top = val * */ /* Python wrapper */ static int __pyx_pw_11pygame_sdl2_4rect_4Rect_8topright_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_val); /*proto*/ static int __pyx_pw_11pygame_sdl2_4rect_4Rect_8topright_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_val) { int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__set__ (wrapper)", 0); __pyx_r = __pyx_pf_11pygame_sdl2_4rect_4Rect_8topright_2__set__(((struct __pyx_obj_11pygame_sdl2_4rect_Rect *)__pyx_v_self), ((PyObject *)__pyx_v_val)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static int __pyx_pf_11pygame_sdl2_4rect_4Rect_8topright_2__set__(struct __pyx_obj_11pygame_sdl2_4rect_Rect *__pyx_v_self, PyObject *__pyx_v_val) { int __pyx_r; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; PyObject *(*__pyx_t_4)(PyObject *); int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__set__", 0); /* "pygame_sdl2/rect.pyx":153 * return (self.right, self.top) * def __set__(self, val): * self.right, self.top = val # <<<<<<<<<<<<<< * * property bottomright: */ if ((likely(PyTuple_CheckExact(__pyx_v_val))) || (PyList_CheckExact(__pyx_v_val))) { PyObject* sequence = __pyx_v_val; #if CYTHON_COMPILING_IN_CPYTHON Py_ssize_t size = Py_SIZE(sequence); #else Py_ssize_t size = PySequence_Size(sequence); #endif if (unlikely(size != 2)) { if (size > 2) __Pyx_RaiseTooManyValuesError(2); else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 153; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } #if CYTHON_COMPILING_IN_CPYTHON if (likely(PyTuple_CheckExact(sequence))) { __pyx_t_1 = PyTuple_GET_ITEM(sequence, 0); __pyx_t_2 = PyTuple_GET_ITEM(sequence, 1); } else { __pyx_t_1 = PyList_GET_ITEM(sequence, 0); __pyx_t_2 = PyList_GET_ITEM(sequence, 1); } __Pyx_INCREF(__pyx_t_1); __Pyx_INCREF(__pyx_t_2); #else __pyx_t_1 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 153; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 153; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); #endif } else { Py_ssize_t index = -1; __pyx_t_3 = PyObject_GetIter(__pyx_v_val); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 153; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = Py_TYPE(__pyx_t_3)->tp_iternext; index = 0; __pyx_t_1 = __pyx_t_4(__pyx_t_3); if (unlikely(!__pyx_t_1)) goto __pyx_L3_unpacking_failed; __Pyx_GOTREF(__pyx_t_1); index = 1; __pyx_t_2 = __pyx_t_4(__pyx_t_3); if (unlikely(!__pyx_t_2)) goto __pyx_L3_unpacking_failed; __Pyx_GOTREF(__pyx_t_2); if (__Pyx_IternextUnpackEndCheck(__pyx_t_4(__pyx_t_3), 2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 153; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_t_4 = NULL; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; goto __pyx_L4_unpacking_done; __pyx_L3_unpacking_failed:; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_4 = NULL; if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 153; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_L4_unpacking_done:; } if (__Pyx_PyObject_SetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_right, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 153; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (__Pyx_PyObject_SetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_top, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 153; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "pygame_sdl2/rect.pyx":152 * def __get__(self): * return (self.right, self.top) * def __set__(self, val): # <<<<<<<<<<<<<< * self.right, self.top = val * */ /* function exit code */ __pyx_r = 0; goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("pygame_sdl2.rect.Rect.topright.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = -1; __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/rect.pyx":156 * * property bottomright: * def __get__(self): # <<<<<<<<<<<<<< * return (self.right, self.bottom) * def __set__(self, val): */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_4rect_4Rect_11bottomright_1__get__(PyObject *__pyx_v_self); /*proto*/ static PyObject *__pyx_pw_11pygame_sdl2_4rect_4Rect_11bottomright_1__get__(PyObject *__pyx_v_self) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); __pyx_r = __pyx_pf_11pygame_sdl2_4rect_4Rect_11bottomright___get__(((struct __pyx_obj_11pygame_sdl2_4rect_Rect *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_4rect_4Rect_11bottomright___get__(struct __pyx_obj_11pygame_sdl2_4rect_Rect *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__get__", 0); /* "pygame_sdl2/rect.pyx":157 * property bottomright: * def __get__(self): * return (self.right, self.bottom) # <<<<<<<<<<<<<< * def __set__(self, val): * self.right, self.bottom = val */ __Pyx_XDECREF(__pyx_r); __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_right); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 157; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_bottom); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 157; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 157; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __Pyx_GIVEREF(__pyx_t_1); PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_1); __Pyx_GIVEREF(__pyx_t_2); PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_2); __pyx_t_1 = 0; __pyx_t_2 = 0; __pyx_r = __pyx_t_3; __pyx_t_3 = 0; goto __pyx_L0; /* "pygame_sdl2/rect.pyx":156 * * property bottomright: * def __get__(self): # <<<<<<<<<<<<<< * return (self.right, self.bottom) * def __set__(self, val): */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("pygame_sdl2.rect.Rect.bottomright.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/rect.pyx":158 * def __get__(self): * return (self.right, self.bottom) * def __set__(self, val): # <<<<<<<<<<<<<< * self.right, self.bottom = val * */ /* Python wrapper */ static int __pyx_pw_11pygame_sdl2_4rect_4Rect_11bottomright_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_val); /*proto*/ static int __pyx_pw_11pygame_sdl2_4rect_4Rect_11bottomright_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_val) { int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__set__ (wrapper)", 0); __pyx_r = __pyx_pf_11pygame_sdl2_4rect_4Rect_11bottomright_2__set__(((struct __pyx_obj_11pygame_sdl2_4rect_Rect *)__pyx_v_self), ((PyObject *)__pyx_v_val)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static int __pyx_pf_11pygame_sdl2_4rect_4Rect_11bottomright_2__set__(struct __pyx_obj_11pygame_sdl2_4rect_Rect *__pyx_v_self, PyObject *__pyx_v_val) { int __pyx_r; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; PyObject *(*__pyx_t_4)(PyObject *); int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__set__", 0); /* "pygame_sdl2/rect.pyx":159 * return (self.right, self.bottom) * def __set__(self, val): * self.right, self.bottom = val # <<<<<<<<<<<<<< * * property bottomleft: */ if ((likely(PyTuple_CheckExact(__pyx_v_val))) || (PyList_CheckExact(__pyx_v_val))) { PyObject* sequence = __pyx_v_val; #if CYTHON_COMPILING_IN_CPYTHON Py_ssize_t size = Py_SIZE(sequence); #else Py_ssize_t size = PySequence_Size(sequence); #endif if (unlikely(size != 2)) { if (size > 2) __Pyx_RaiseTooManyValuesError(2); else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 159; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } #if CYTHON_COMPILING_IN_CPYTHON if (likely(PyTuple_CheckExact(sequence))) { __pyx_t_1 = PyTuple_GET_ITEM(sequence, 0); __pyx_t_2 = PyTuple_GET_ITEM(sequence, 1); } else { __pyx_t_1 = PyList_GET_ITEM(sequence, 0); __pyx_t_2 = PyList_GET_ITEM(sequence, 1); } __Pyx_INCREF(__pyx_t_1); __Pyx_INCREF(__pyx_t_2); #else __pyx_t_1 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 159; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 159; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); #endif } else { Py_ssize_t index = -1; __pyx_t_3 = PyObject_GetIter(__pyx_v_val); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 159; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = Py_TYPE(__pyx_t_3)->tp_iternext; index = 0; __pyx_t_1 = __pyx_t_4(__pyx_t_3); if (unlikely(!__pyx_t_1)) goto __pyx_L3_unpacking_failed; __Pyx_GOTREF(__pyx_t_1); index = 1; __pyx_t_2 = __pyx_t_4(__pyx_t_3); if (unlikely(!__pyx_t_2)) goto __pyx_L3_unpacking_failed; __Pyx_GOTREF(__pyx_t_2); if (__Pyx_IternextUnpackEndCheck(__pyx_t_4(__pyx_t_3), 2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 159; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_t_4 = NULL; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; goto __pyx_L4_unpacking_done; __pyx_L3_unpacking_failed:; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_4 = NULL; if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 159; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_L4_unpacking_done:; } if (__Pyx_PyObject_SetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_right, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 159; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (__Pyx_PyObject_SetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_bottom, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 159; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "pygame_sdl2/rect.pyx":158 * def __get__(self): * return (self.right, self.bottom) * def __set__(self, val): # <<<<<<<<<<<<<< * self.right, self.bottom = val * */ /* function exit code */ __pyx_r = 0; goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("pygame_sdl2.rect.Rect.bottomright.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = -1; __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/rect.pyx":162 * * property bottomleft: * def __get__(self): # <<<<<<<<<<<<<< * return (self.left, self.bottom) * def __set__(self, val): */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_4rect_4Rect_10bottomleft_1__get__(PyObject *__pyx_v_self); /*proto*/ static PyObject *__pyx_pw_11pygame_sdl2_4rect_4Rect_10bottomleft_1__get__(PyObject *__pyx_v_self) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); __pyx_r = __pyx_pf_11pygame_sdl2_4rect_4Rect_10bottomleft___get__(((struct __pyx_obj_11pygame_sdl2_4rect_Rect *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_4rect_4Rect_10bottomleft___get__(struct __pyx_obj_11pygame_sdl2_4rect_Rect *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__get__", 0); /* "pygame_sdl2/rect.pyx":163 * property bottomleft: * def __get__(self): * return (self.left, self.bottom) # <<<<<<<<<<<<<< * def __set__(self, val): * self.left, self.bottom = val */ __Pyx_XDECREF(__pyx_r); __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_left); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 163; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_bottom); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 163; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 163; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __Pyx_GIVEREF(__pyx_t_1); PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_1); __Pyx_GIVEREF(__pyx_t_2); PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_2); __pyx_t_1 = 0; __pyx_t_2 = 0; __pyx_r = __pyx_t_3; __pyx_t_3 = 0; goto __pyx_L0; /* "pygame_sdl2/rect.pyx":162 * * property bottomleft: * def __get__(self): # <<<<<<<<<<<<<< * return (self.left, self.bottom) * def __set__(self, val): */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("pygame_sdl2.rect.Rect.bottomleft.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/rect.pyx":164 * def __get__(self): * return (self.left, self.bottom) * def __set__(self, val): # <<<<<<<<<<<<<< * self.left, self.bottom = val * */ /* Python wrapper */ static int __pyx_pw_11pygame_sdl2_4rect_4Rect_10bottomleft_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_val); /*proto*/ static int __pyx_pw_11pygame_sdl2_4rect_4Rect_10bottomleft_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_val) { int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__set__ (wrapper)", 0); __pyx_r = __pyx_pf_11pygame_sdl2_4rect_4Rect_10bottomleft_2__set__(((struct __pyx_obj_11pygame_sdl2_4rect_Rect *)__pyx_v_self), ((PyObject *)__pyx_v_val)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static int __pyx_pf_11pygame_sdl2_4rect_4Rect_10bottomleft_2__set__(struct __pyx_obj_11pygame_sdl2_4rect_Rect *__pyx_v_self, PyObject *__pyx_v_val) { int __pyx_r; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; PyObject *(*__pyx_t_4)(PyObject *); int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__set__", 0); /* "pygame_sdl2/rect.pyx":165 * return (self.left, self.bottom) * def __set__(self, val): * self.left, self.bottom = val # <<<<<<<<<<<<<< * * property centerx: */ if ((likely(PyTuple_CheckExact(__pyx_v_val))) || (PyList_CheckExact(__pyx_v_val))) { PyObject* sequence = __pyx_v_val; #if CYTHON_COMPILING_IN_CPYTHON Py_ssize_t size = Py_SIZE(sequence); #else Py_ssize_t size = PySequence_Size(sequence); #endif if (unlikely(size != 2)) { if (size > 2) __Pyx_RaiseTooManyValuesError(2); else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 165; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } #if CYTHON_COMPILING_IN_CPYTHON if (likely(PyTuple_CheckExact(sequence))) { __pyx_t_1 = PyTuple_GET_ITEM(sequence, 0); __pyx_t_2 = PyTuple_GET_ITEM(sequence, 1); } else { __pyx_t_1 = PyList_GET_ITEM(sequence, 0); __pyx_t_2 = PyList_GET_ITEM(sequence, 1); } __Pyx_INCREF(__pyx_t_1); __Pyx_INCREF(__pyx_t_2); #else __pyx_t_1 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 165; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 165; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); #endif } else { Py_ssize_t index = -1; __pyx_t_3 = PyObject_GetIter(__pyx_v_val); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 165; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = Py_TYPE(__pyx_t_3)->tp_iternext; index = 0; __pyx_t_1 = __pyx_t_4(__pyx_t_3); if (unlikely(!__pyx_t_1)) goto __pyx_L3_unpacking_failed; __Pyx_GOTREF(__pyx_t_1); index = 1; __pyx_t_2 = __pyx_t_4(__pyx_t_3); if (unlikely(!__pyx_t_2)) goto __pyx_L3_unpacking_failed; __Pyx_GOTREF(__pyx_t_2); if (__Pyx_IternextUnpackEndCheck(__pyx_t_4(__pyx_t_3), 2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 165; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_t_4 = NULL; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; goto __pyx_L4_unpacking_done; __pyx_L3_unpacking_failed:; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_4 = NULL; if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 165; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_L4_unpacking_done:; } if (__Pyx_PyObject_SetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_left, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 165; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (__Pyx_PyObject_SetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_bottom, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 165; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "pygame_sdl2/rect.pyx":164 * def __get__(self): * return (self.left, self.bottom) * def __set__(self, val): # <<<<<<<<<<<<<< * self.left, self.bottom = val * */ /* function exit code */ __pyx_r = 0; goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("pygame_sdl2.rect.Rect.bottomleft.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = -1; __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/rect.pyx":168 * * property centerx: * def __get__(self): # <<<<<<<<<<<<<< * return self.x + (self.w / 2) * def __set__(self, val): */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_4rect_4Rect_7centerx_1__get__(PyObject *__pyx_v_self); /*proto*/ static PyObject *__pyx_pw_11pygame_sdl2_4rect_4Rect_7centerx_1__get__(PyObject *__pyx_v_self) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); __pyx_r = __pyx_pf_11pygame_sdl2_4rect_4Rect_7centerx___get__(((struct __pyx_obj_11pygame_sdl2_4rect_Rect *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_4rect_4Rect_7centerx___get__(struct __pyx_obj_11pygame_sdl2_4rect_Rect *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__get__", 0); /* "pygame_sdl2/rect.pyx":169 * property centerx: * def __get__(self): * return self.x + (self.w / 2) # <<<<<<<<<<<<<< * def __set__(self, val): * self.x += val - self.centerx */ __Pyx_XDECREF(__pyx_r); __pyx_t_1 = PyFloat_FromDouble((__pyx_v_self->x + (((double)__pyx_v_self->w) / 2.0))); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 169; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "pygame_sdl2/rect.pyx":168 * * property centerx: * def __get__(self): # <<<<<<<<<<<<<< * return self.x + (self.w / 2) * def __set__(self, val): */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("pygame_sdl2.rect.Rect.centerx.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/rect.pyx":170 * def __get__(self): * return self.x + (self.w / 2) * def __set__(self, val): # <<<<<<<<<<<<<< * self.x += val - self.centerx * */ /* Python wrapper */ static int __pyx_pw_11pygame_sdl2_4rect_4Rect_7centerx_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_val); /*proto*/ static int __pyx_pw_11pygame_sdl2_4rect_4Rect_7centerx_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_val) { int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__set__ (wrapper)", 0); __pyx_r = __pyx_pf_11pygame_sdl2_4rect_4Rect_7centerx_2__set__(((struct __pyx_obj_11pygame_sdl2_4rect_Rect *)__pyx_v_self), ((PyObject *)__pyx_v_val)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static int __pyx_pf_11pygame_sdl2_4rect_4Rect_7centerx_2__set__(struct __pyx_obj_11pygame_sdl2_4rect_Rect *__pyx_v_self, PyObject *__pyx_v_val) { int __pyx_r; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; int __pyx_t_4; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__set__", 0); /* "pygame_sdl2/rect.pyx":171 * return self.x + (self.w / 2) * def __set__(self, val): * self.x += val - self.centerx # <<<<<<<<<<<<<< * * property centery: */ __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_self->x); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 171; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_centerx); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 171; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = PyNumber_Subtract(__pyx_v_val, __pyx_t_2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 171; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_2 = PyNumber_InPlaceAdd(__pyx_t_1, __pyx_t_3); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 171; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_4 = __Pyx_PyInt_As_int(__pyx_t_2); if (unlikely((__pyx_t_4 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 171; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_v_self->x = __pyx_t_4; /* "pygame_sdl2/rect.pyx":170 * def __get__(self): * return self.x + (self.w / 2) * def __set__(self, val): # <<<<<<<<<<<<<< * self.x += val - self.centerx * */ /* function exit code */ __pyx_r = 0; goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("pygame_sdl2.rect.Rect.centerx.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = -1; __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/rect.pyx":174 * * property centery: * def __get__(self): # <<<<<<<<<<<<<< * return self.y + (self.h / 2) * def __set__(self, val): */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_4rect_4Rect_7centery_1__get__(PyObject *__pyx_v_self); /*proto*/ static PyObject *__pyx_pw_11pygame_sdl2_4rect_4Rect_7centery_1__get__(PyObject *__pyx_v_self) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); __pyx_r = __pyx_pf_11pygame_sdl2_4rect_4Rect_7centery___get__(((struct __pyx_obj_11pygame_sdl2_4rect_Rect *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_4rect_4Rect_7centery___get__(struct __pyx_obj_11pygame_sdl2_4rect_Rect *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__get__", 0); /* "pygame_sdl2/rect.pyx":175 * property centery: * def __get__(self): * return self.y + (self.h / 2) # <<<<<<<<<<<<<< * def __set__(self, val): * self.y += val - self.centery */ __Pyx_XDECREF(__pyx_r); __pyx_t_1 = PyFloat_FromDouble((__pyx_v_self->y + (((double)__pyx_v_self->h) / 2.0))); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 175; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "pygame_sdl2/rect.pyx":174 * * property centery: * def __get__(self): # <<<<<<<<<<<<<< * return self.y + (self.h / 2) * def __set__(self, val): */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("pygame_sdl2.rect.Rect.centery.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/rect.pyx":176 * def __get__(self): * return self.y + (self.h / 2) * def __set__(self, val): # <<<<<<<<<<<<<< * self.y += val - self.centery * */ /* Python wrapper */ static int __pyx_pw_11pygame_sdl2_4rect_4Rect_7centery_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_val); /*proto*/ static int __pyx_pw_11pygame_sdl2_4rect_4Rect_7centery_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_val) { int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__set__ (wrapper)", 0); __pyx_r = __pyx_pf_11pygame_sdl2_4rect_4Rect_7centery_2__set__(((struct __pyx_obj_11pygame_sdl2_4rect_Rect *)__pyx_v_self), ((PyObject *)__pyx_v_val)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static int __pyx_pf_11pygame_sdl2_4rect_4Rect_7centery_2__set__(struct __pyx_obj_11pygame_sdl2_4rect_Rect *__pyx_v_self, PyObject *__pyx_v_val) { int __pyx_r; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; int __pyx_t_4; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__set__", 0); /* "pygame_sdl2/rect.pyx":177 * return self.y + (self.h / 2) * def __set__(self, val): * self.y += val - self.centery # <<<<<<<<<<<<<< * * property center: */ __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_self->y); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 177; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_centery); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 177; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = PyNumber_Subtract(__pyx_v_val, __pyx_t_2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 177; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_2 = PyNumber_InPlaceAdd(__pyx_t_1, __pyx_t_3); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 177; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_4 = __Pyx_PyInt_As_int(__pyx_t_2); if (unlikely((__pyx_t_4 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 177; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_v_self->y = __pyx_t_4; /* "pygame_sdl2/rect.pyx":176 * def __get__(self): * return self.y + (self.h / 2) * def __set__(self, val): # <<<<<<<<<<<<<< * self.y += val - self.centery * */ /* function exit code */ __pyx_r = 0; goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("pygame_sdl2.rect.Rect.centery.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = -1; __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/rect.pyx":180 * * property center: * def __get__(self): # <<<<<<<<<<<<<< * return (self.centerx, self.centery) * def __set__(self, val): */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_4rect_4Rect_6center_1__get__(PyObject *__pyx_v_self); /*proto*/ static PyObject *__pyx_pw_11pygame_sdl2_4rect_4Rect_6center_1__get__(PyObject *__pyx_v_self) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); __pyx_r = __pyx_pf_11pygame_sdl2_4rect_4Rect_6center___get__(((struct __pyx_obj_11pygame_sdl2_4rect_Rect *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_4rect_4Rect_6center___get__(struct __pyx_obj_11pygame_sdl2_4rect_Rect *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__get__", 0); /* "pygame_sdl2/rect.pyx":181 * property center: * def __get__(self): * return (self.centerx, self.centery) # <<<<<<<<<<<<<< * def __set__(self, val): * self.centerx, self.centery = val */ __Pyx_XDECREF(__pyx_r); __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_centerx); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 181; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_centery); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 181; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 181; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __Pyx_GIVEREF(__pyx_t_1); PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_1); __Pyx_GIVEREF(__pyx_t_2); PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_2); __pyx_t_1 = 0; __pyx_t_2 = 0; __pyx_r = __pyx_t_3; __pyx_t_3 = 0; goto __pyx_L0; /* "pygame_sdl2/rect.pyx":180 * * property center: * def __get__(self): # <<<<<<<<<<<<<< * return (self.centerx, self.centery) * def __set__(self, val): */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("pygame_sdl2.rect.Rect.center.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/rect.pyx":182 * def __get__(self): * return (self.centerx, self.centery) * def __set__(self, val): # <<<<<<<<<<<<<< * self.centerx, self.centery = val * */ /* Python wrapper */ static int __pyx_pw_11pygame_sdl2_4rect_4Rect_6center_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_val); /*proto*/ static int __pyx_pw_11pygame_sdl2_4rect_4Rect_6center_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_val) { int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__set__ (wrapper)", 0); __pyx_r = __pyx_pf_11pygame_sdl2_4rect_4Rect_6center_2__set__(((struct __pyx_obj_11pygame_sdl2_4rect_Rect *)__pyx_v_self), ((PyObject *)__pyx_v_val)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static int __pyx_pf_11pygame_sdl2_4rect_4Rect_6center_2__set__(struct __pyx_obj_11pygame_sdl2_4rect_Rect *__pyx_v_self, PyObject *__pyx_v_val) { int __pyx_r; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; PyObject *(*__pyx_t_4)(PyObject *); int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__set__", 0); /* "pygame_sdl2/rect.pyx":183 * return (self.centerx, self.centery) * def __set__(self, val): * self.centerx, self.centery = val # <<<<<<<<<<<<<< * * property midtop: */ if ((likely(PyTuple_CheckExact(__pyx_v_val))) || (PyList_CheckExact(__pyx_v_val))) { PyObject* sequence = __pyx_v_val; #if CYTHON_COMPILING_IN_CPYTHON Py_ssize_t size = Py_SIZE(sequence); #else Py_ssize_t size = PySequence_Size(sequence); #endif if (unlikely(size != 2)) { if (size > 2) __Pyx_RaiseTooManyValuesError(2); else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 183; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } #if CYTHON_COMPILING_IN_CPYTHON if (likely(PyTuple_CheckExact(sequence))) { __pyx_t_1 = PyTuple_GET_ITEM(sequence, 0); __pyx_t_2 = PyTuple_GET_ITEM(sequence, 1); } else { __pyx_t_1 = PyList_GET_ITEM(sequence, 0); __pyx_t_2 = PyList_GET_ITEM(sequence, 1); } __Pyx_INCREF(__pyx_t_1); __Pyx_INCREF(__pyx_t_2); #else __pyx_t_1 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 183; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 183; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); #endif } else { Py_ssize_t index = -1; __pyx_t_3 = PyObject_GetIter(__pyx_v_val); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 183; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = Py_TYPE(__pyx_t_3)->tp_iternext; index = 0; __pyx_t_1 = __pyx_t_4(__pyx_t_3); if (unlikely(!__pyx_t_1)) goto __pyx_L3_unpacking_failed; __Pyx_GOTREF(__pyx_t_1); index = 1; __pyx_t_2 = __pyx_t_4(__pyx_t_3); if (unlikely(!__pyx_t_2)) goto __pyx_L3_unpacking_failed; __Pyx_GOTREF(__pyx_t_2); if (__Pyx_IternextUnpackEndCheck(__pyx_t_4(__pyx_t_3), 2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 183; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_t_4 = NULL; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; goto __pyx_L4_unpacking_done; __pyx_L3_unpacking_failed:; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_4 = NULL; if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 183; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_L4_unpacking_done:; } if (__Pyx_PyObject_SetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_centerx, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 183; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (__Pyx_PyObject_SetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_centery, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 183; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "pygame_sdl2/rect.pyx":182 * def __get__(self): * return (self.centerx, self.centery) * def __set__(self, val): # <<<<<<<<<<<<<< * self.centerx, self.centery = val * */ /* function exit code */ __pyx_r = 0; goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("pygame_sdl2.rect.Rect.center.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = -1; __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/rect.pyx":186 * * property midtop: * def __get__(self): # <<<<<<<<<<<<<< * return (self.centerx, self.top) * def __set__(self, val): */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_4rect_4Rect_6midtop_1__get__(PyObject *__pyx_v_self); /*proto*/ static PyObject *__pyx_pw_11pygame_sdl2_4rect_4Rect_6midtop_1__get__(PyObject *__pyx_v_self) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); __pyx_r = __pyx_pf_11pygame_sdl2_4rect_4Rect_6midtop___get__(((struct __pyx_obj_11pygame_sdl2_4rect_Rect *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_4rect_4Rect_6midtop___get__(struct __pyx_obj_11pygame_sdl2_4rect_Rect *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__get__", 0); /* "pygame_sdl2/rect.pyx":187 * property midtop: * def __get__(self): * return (self.centerx, self.top) # <<<<<<<<<<<<<< * def __set__(self, val): * self.centerx, self.top = val */ __Pyx_XDECREF(__pyx_r); __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_centerx); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 187; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_top); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 187; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 187; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __Pyx_GIVEREF(__pyx_t_1); PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_1); __Pyx_GIVEREF(__pyx_t_2); PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_2); __pyx_t_1 = 0; __pyx_t_2 = 0; __pyx_r = __pyx_t_3; __pyx_t_3 = 0; goto __pyx_L0; /* "pygame_sdl2/rect.pyx":186 * * property midtop: * def __get__(self): # <<<<<<<<<<<<<< * return (self.centerx, self.top) * def __set__(self, val): */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("pygame_sdl2.rect.Rect.midtop.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/rect.pyx":188 * def __get__(self): * return (self.centerx, self.top) * def __set__(self, val): # <<<<<<<<<<<<<< * self.centerx, self.top = val * */ /* Python wrapper */ static int __pyx_pw_11pygame_sdl2_4rect_4Rect_6midtop_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_val); /*proto*/ static int __pyx_pw_11pygame_sdl2_4rect_4Rect_6midtop_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_val) { int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__set__ (wrapper)", 0); __pyx_r = __pyx_pf_11pygame_sdl2_4rect_4Rect_6midtop_2__set__(((struct __pyx_obj_11pygame_sdl2_4rect_Rect *)__pyx_v_self), ((PyObject *)__pyx_v_val)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static int __pyx_pf_11pygame_sdl2_4rect_4Rect_6midtop_2__set__(struct __pyx_obj_11pygame_sdl2_4rect_Rect *__pyx_v_self, PyObject *__pyx_v_val) { int __pyx_r; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; PyObject *(*__pyx_t_4)(PyObject *); int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__set__", 0); /* "pygame_sdl2/rect.pyx":189 * return (self.centerx, self.top) * def __set__(self, val): * self.centerx, self.top = val # <<<<<<<<<<<<<< * * property midleft: */ if ((likely(PyTuple_CheckExact(__pyx_v_val))) || (PyList_CheckExact(__pyx_v_val))) { PyObject* sequence = __pyx_v_val; #if CYTHON_COMPILING_IN_CPYTHON Py_ssize_t size = Py_SIZE(sequence); #else Py_ssize_t size = PySequence_Size(sequence); #endif if (unlikely(size != 2)) { if (size > 2) __Pyx_RaiseTooManyValuesError(2); else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 189; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } #if CYTHON_COMPILING_IN_CPYTHON if (likely(PyTuple_CheckExact(sequence))) { __pyx_t_1 = PyTuple_GET_ITEM(sequence, 0); __pyx_t_2 = PyTuple_GET_ITEM(sequence, 1); } else { __pyx_t_1 = PyList_GET_ITEM(sequence, 0); __pyx_t_2 = PyList_GET_ITEM(sequence, 1); } __Pyx_INCREF(__pyx_t_1); __Pyx_INCREF(__pyx_t_2); #else __pyx_t_1 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 189; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 189; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); #endif } else { Py_ssize_t index = -1; __pyx_t_3 = PyObject_GetIter(__pyx_v_val); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 189; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = Py_TYPE(__pyx_t_3)->tp_iternext; index = 0; __pyx_t_1 = __pyx_t_4(__pyx_t_3); if (unlikely(!__pyx_t_1)) goto __pyx_L3_unpacking_failed; __Pyx_GOTREF(__pyx_t_1); index = 1; __pyx_t_2 = __pyx_t_4(__pyx_t_3); if (unlikely(!__pyx_t_2)) goto __pyx_L3_unpacking_failed; __Pyx_GOTREF(__pyx_t_2); if (__Pyx_IternextUnpackEndCheck(__pyx_t_4(__pyx_t_3), 2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 189; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_t_4 = NULL; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; goto __pyx_L4_unpacking_done; __pyx_L3_unpacking_failed:; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_4 = NULL; if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 189; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_L4_unpacking_done:; } if (__Pyx_PyObject_SetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_centerx, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 189; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (__Pyx_PyObject_SetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_top, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 189; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "pygame_sdl2/rect.pyx":188 * def __get__(self): * return (self.centerx, self.top) * def __set__(self, val): # <<<<<<<<<<<<<< * self.centerx, self.top = val * */ /* function exit code */ __pyx_r = 0; goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("pygame_sdl2.rect.Rect.midtop.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = -1; __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/rect.pyx":192 * * property midleft: * def __get__(self): # <<<<<<<<<<<<<< * return (self.left, self.centery) * def __set__(self, val): */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_4rect_4Rect_7midleft_1__get__(PyObject *__pyx_v_self); /*proto*/ static PyObject *__pyx_pw_11pygame_sdl2_4rect_4Rect_7midleft_1__get__(PyObject *__pyx_v_self) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); __pyx_r = __pyx_pf_11pygame_sdl2_4rect_4Rect_7midleft___get__(((struct __pyx_obj_11pygame_sdl2_4rect_Rect *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_4rect_4Rect_7midleft___get__(struct __pyx_obj_11pygame_sdl2_4rect_Rect *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__get__", 0); /* "pygame_sdl2/rect.pyx":193 * property midleft: * def __get__(self): * return (self.left, self.centery) # <<<<<<<<<<<<<< * def __set__(self, val): * self.left, self.centery = val */ __Pyx_XDECREF(__pyx_r); __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_left); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 193; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_centery); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 193; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 193; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __Pyx_GIVEREF(__pyx_t_1); PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_1); __Pyx_GIVEREF(__pyx_t_2); PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_2); __pyx_t_1 = 0; __pyx_t_2 = 0; __pyx_r = __pyx_t_3; __pyx_t_3 = 0; goto __pyx_L0; /* "pygame_sdl2/rect.pyx":192 * * property midleft: * def __get__(self): # <<<<<<<<<<<<<< * return (self.left, self.centery) * def __set__(self, val): */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("pygame_sdl2.rect.Rect.midleft.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/rect.pyx":194 * def __get__(self): * return (self.left, self.centery) * def __set__(self, val): # <<<<<<<<<<<<<< * self.left, self.centery = val * */ /* Python wrapper */ static int __pyx_pw_11pygame_sdl2_4rect_4Rect_7midleft_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_val); /*proto*/ static int __pyx_pw_11pygame_sdl2_4rect_4Rect_7midleft_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_val) { int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__set__ (wrapper)", 0); __pyx_r = __pyx_pf_11pygame_sdl2_4rect_4Rect_7midleft_2__set__(((struct __pyx_obj_11pygame_sdl2_4rect_Rect *)__pyx_v_self), ((PyObject *)__pyx_v_val)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static int __pyx_pf_11pygame_sdl2_4rect_4Rect_7midleft_2__set__(struct __pyx_obj_11pygame_sdl2_4rect_Rect *__pyx_v_self, PyObject *__pyx_v_val) { int __pyx_r; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; PyObject *(*__pyx_t_4)(PyObject *); int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__set__", 0); /* "pygame_sdl2/rect.pyx":195 * return (self.left, self.centery) * def __set__(self, val): * self.left, self.centery = val # <<<<<<<<<<<<<< * * property midbottom: */ if ((likely(PyTuple_CheckExact(__pyx_v_val))) || (PyList_CheckExact(__pyx_v_val))) { PyObject* sequence = __pyx_v_val; #if CYTHON_COMPILING_IN_CPYTHON Py_ssize_t size = Py_SIZE(sequence); #else Py_ssize_t size = PySequence_Size(sequence); #endif if (unlikely(size != 2)) { if (size > 2) __Pyx_RaiseTooManyValuesError(2); else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 195; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } #if CYTHON_COMPILING_IN_CPYTHON if (likely(PyTuple_CheckExact(sequence))) { __pyx_t_1 = PyTuple_GET_ITEM(sequence, 0); __pyx_t_2 = PyTuple_GET_ITEM(sequence, 1); } else { __pyx_t_1 = PyList_GET_ITEM(sequence, 0); __pyx_t_2 = PyList_GET_ITEM(sequence, 1); } __Pyx_INCREF(__pyx_t_1); __Pyx_INCREF(__pyx_t_2); #else __pyx_t_1 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 195; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 195; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); #endif } else { Py_ssize_t index = -1; __pyx_t_3 = PyObject_GetIter(__pyx_v_val); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 195; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = Py_TYPE(__pyx_t_3)->tp_iternext; index = 0; __pyx_t_1 = __pyx_t_4(__pyx_t_3); if (unlikely(!__pyx_t_1)) goto __pyx_L3_unpacking_failed; __Pyx_GOTREF(__pyx_t_1); index = 1; __pyx_t_2 = __pyx_t_4(__pyx_t_3); if (unlikely(!__pyx_t_2)) goto __pyx_L3_unpacking_failed; __Pyx_GOTREF(__pyx_t_2); if (__Pyx_IternextUnpackEndCheck(__pyx_t_4(__pyx_t_3), 2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 195; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_t_4 = NULL; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; goto __pyx_L4_unpacking_done; __pyx_L3_unpacking_failed:; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_4 = NULL; if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 195; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_L4_unpacking_done:; } if (__Pyx_PyObject_SetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_left, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 195; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (__Pyx_PyObject_SetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_centery, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 195; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "pygame_sdl2/rect.pyx":194 * def __get__(self): * return (self.left, self.centery) * def __set__(self, val): # <<<<<<<<<<<<<< * self.left, self.centery = val * */ /* function exit code */ __pyx_r = 0; goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("pygame_sdl2.rect.Rect.midleft.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = -1; __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/rect.pyx":198 * * property midbottom: * def __get__(self): # <<<<<<<<<<<<<< * return (self.centerx, self.bottom) * def __set__(self, val): */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_4rect_4Rect_9midbottom_1__get__(PyObject *__pyx_v_self); /*proto*/ static PyObject *__pyx_pw_11pygame_sdl2_4rect_4Rect_9midbottom_1__get__(PyObject *__pyx_v_self) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); __pyx_r = __pyx_pf_11pygame_sdl2_4rect_4Rect_9midbottom___get__(((struct __pyx_obj_11pygame_sdl2_4rect_Rect *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_4rect_4Rect_9midbottom___get__(struct __pyx_obj_11pygame_sdl2_4rect_Rect *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__get__", 0); /* "pygame_sdl2/rect.pyx":199 * property midbottom: * def __get__(self): * return (self.centerx, self.bottom) # <<<<<<<<<<<<<< * def __set__(self, val): * self.centerx, self.bottom = val */ __Pyx_XDECREF(__pyx_r); __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_centerx); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 199; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_bottom); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 199; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 199; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __Pyx_GIVEREF(__pyx_t_1); PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_1); __Pyx_GIVEREF(__pyx_t_2); PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_2); __pyx_t_1 = 0; __pyx_t_2 = 0; __pyx_r = __pyx_t_3; __pyx_t_3 = 0; goto __pyx_L0; /* "pygame_sdl2/rect.pyx":198 * * property midbottom: * def __get__(self): # <<<<<<<<<<<<<< * return (self.centerx, self.bottom) * def __set__(self, val): */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("pygame_sdl2.rect.Rect.midbottom.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/rect.pyx":200 * def __get__(self): * return (self.centerx, self.bottom) * def __set__(self, val): # <<<<<<<<<<<<<< * self.centerx, self.bottom = val * */ /* Python wrapper */ static int __pyx_pw_11pygame_sdl2_4rect_4Rect_9midbottom_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_val); /*proto*/ static int __pyx_pw_11pygame_sdl2_4rect_4Rect_9midbottom_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_val) { int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__set__ (wrapper)", 0); __pyx_r = __pyx_pf_11pygame_sdl2_4rect_4Rect_9midbottom_2__set__(((struct __pyx_obj_11pygame_sdl2_4rect_Rect *)__pyx_v_self), ((PyObject *)__pyx_v_val)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static int __pyx_pf_11pygame_sdl2_4rect_4Rect_9midbottom_2__set__(struct __pyx_obj_11pygame_sdl2_4rect_Rect *__pyx_v_self, PyObject *__pyx_v_val) { int __pyx_r; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; PyObject *(*__pyx_t_4)(PyObject *); int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__set__", 0); /* "pygame_sdl2/rect.pyx":201 * return (self.centerx, self.bottom) * def __set__(self, val): * self.centerx, self.bottom = val # <<<<<<<<<<<<<< * * property midright: */ if ((likely(PyTuple_CheckExact(__pyx_v_val))) || (PyList_CheckExact(__pyx_v_val))) { PyObject* sequence = __pyx_v_val; #if CYTHON_COMPILING_IN_CPYTHON Py_ssize_t size = Py_SIZE(sequence); #else Py_ssize_t size = PySequence_Size(sequence); #endif if (unlikely(size != 2)) { if (size > 2) __Pyx_RaiseTooManyValuesError(2); else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 201; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } #if CYTHON_COMPILING_IN_CPYTHON if (likely(PyTuple_CheckExact(sequence))) { __pyx_t_1 = PyTuple_GET_ITEM(sequence, 0); __pyx_t_2 = PyTuple_GET_ITEM(sequence, 1); } else { __pyx_t_1 = PyList_GET_ITEM(sequence, 0); __pyx_t_2 = PyList_GET_ITEM(sequence, 1); } __Pyx_INCREF(__pyx_t_1); __Pyx_INCREF(__pyx_t_2); #else __pyx_t_1 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 201; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 201; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); #endif } else { Py_ssize_t index = -1; __pyx_t_3 = PyObject_GetIter(__pyx_v_val); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 201; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = Py_TYPE(__pyx_t_3)->tp_iternext; index = 0; __pyx_t_1 = __pyx_t_4(__pyx_t_3); if (unlikely(!__pyx_t_1)) goto __pyx_L3_unpacking_failed; __Pyx_GOTREF(__pyx_t_1); index = 1; __pyx_t_2 = __pyx_t_4(__pyx_t_3); if (unlikely(!__pyx_t_2)) goto __pyx_L3_unpacking_failed; __Pyx_GOTREF(__pyx_t_2); if (__Pyx_IternextUnpackEndCheck(__pyx_t_4(__pyx_t_3), 2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 201; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_t_4 = NULL; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; goto __pyx_L4_unpacking_done; __pyx_L3_unpacking_failed:; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_4 = NULL; if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 201; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_L4_unpacking_done:; } if (__Pyx_PyObject_SetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_centerx, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 201; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (__Pyx_PyObject_SetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_bottom, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 201; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "pygame_sdl2/rect.pyx":200 * def __get__(self): * return (self.centerx, self.bottom) * def __set__(self, val): # <<<<<<<<<<<<<< * self.centerx, self.bottom = val * */ /* function exit code */ __pyx_r = 0; goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("pygame_sdl2.rect.Rect.midbottom.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = -1; __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/rect.pyx":204 * * property midright: * def __get__(self): # <<<<<<<<<<<<<< * return (self.right, self.centery) * def __set__(self, val): */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_4rect_4Rect_8midright_1__get__(PyObject *__pyx_v_self); /*proto*/ static PyObject *__pyx_pw_11pygame_sdl2_4rect_4Rect_8midright_1__get__(PyObject *__pyx_v_self) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); __pyx_r = __pyx_pf_11pygame_sdl2_4rect_4Rect_8midright___get__(((struct __pyx_obj_11pygame_sdl2_4rect_Rect *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_4rect_4Rect_8midright___get__(struct __pyx_obj_11pygame_sdl2_4rect_Rect *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__get__", 0); /* "pygame_sdl2/rect.pyx":205 * property midright: * def __get__(self): * return (self.right, self.centery) # <<<<<<<<<<<<<< * def __set__(self, val): * self.right, self.centery = val */ __Pyx_XDECREF(__pyx_r); __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_right); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 205; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_centery); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 205; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 205; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __Pyx_GIVEREF(__pyx_t_1); PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_1); __Pyx_GIVEREF(__pyx_t_2); PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_2); __pyx_t_1 = 0; __pyx_t_2 = 0; __pyx_r = __pyx_t_3; __pyx_t_3 = 0; goto __pyx_L0; /* "pygame_sdl2/rect.pyx":204 * * property midright: * def __get__(self): # <<<<<<<<<<<<<< * return (self.right, self.centery) * def __set__(self, val): */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("pygame_sdl2.rect.Rect.midright.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/rect.pyx":206 * def __get__(self): * return (self.right, self.centery) * def __set__(self, val): # <<<<<<<<<<<<<< * self.right, self.centery = val * */ /* Python wrapper */ static int __pyx_pw_11pygame_sdl2_4rect_4Rect_8midright_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_val); /*proto*/ static int __pyx_pw_11pygame_sdl2_4rect_4Rect_8midright_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_val) { int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__set__ (wrapper)", 0); __pyx_r = __pyx_pf_11pygame_sdl2_4rect_4Rect_8midright_2__set__(((struct __pyx_obj_11pygame_sdl2_4rect_Rect *)__pyx_v_self), ((PyObject *)__pyx_v_val)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static int __pyx_pf_11pygame_sdl2_4rect_4Rect_8midright_2__set__(struct __pyx_obj_11pygame_sdl2_4rect_Rect *__pyx_v_self, PyObject *__pyx_v_val) { int __pyx_r; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; PyObject *(*__pyx_t_4)(PyObject *); int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__set__", 0); /* "pygame_sdl2/rect.pyx":207 * return (self.right, self.centery) * def __set__(self, val): * self.right, self.centery = val # <<<<<<<<<<<<<< * * def copy(self): */ if ((likely(PyTuple_CheckExact(__pyx_v_val))) || (PyList_CheckExact(__pyx_v_val))) { PyObject* sequence = __pyx_v_val; #if CYTHON_COMPILING_IN_CPYTHON Py_ssize_t size = Py_SIZE(sequence); #else Py_ssize_t size = PySequence_Size(sequence); #endif if (unlikely(size != 2)) { if (size > 2) __Pyx_RaiseTooManyValuesError(2); else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 207; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } #if CYTHON_COMPILING_IN_CPYTHON if (likely(PyTuple_CheckExact(sequence))) { __pyx_t_1 = PyTuple_GET_ITEM(sequence, 0); __pyx_t_2 = PyTuple_GET_ITEM(sequence, 1); } else { __pyx_t_1 = PyList_GET_ITEM(sequence, 0); __pyx_t_2 = PyList_GET_ITEM(sequence, 1); } __Pyx_INCREF(__pyx_t_1); __Pyx_INCREF(__pyx_t_2); #else __pyx_t_1 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 207; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 207; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); #endif } else { Py_ssize_t index = -1; __pyx_t_3 = PyObject_GetIter(__pyx_v_val); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 207; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = Py_TYPE(__pyx_t_3)->tp_iternext; index = 0; __pyx_t_1 = __pyx_t_4(__pyx_t_3); if (unlikely(!__pyx_t_1)) goto __pyx_L3_unpacking_failed; __Pyx_GOTREF(__pyx_t_1); index = 1; __pyx_t_2 = __pyx_t_4(__pyx_t_3); if (unlikely(!__pyx_t_2)) goto __pyx_L3_unpacking_failed; __Pyx_GOTREF(__pyx_t_2); if (__Pyx_IternextUnpackEndCheck(__pyx_t_4(__pyx_t_3), 2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 207; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_t_4 = NULL; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; goto __pyx_L4_unpacking_done; __pyx_L3_unpacking_failed:; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_4 = NULL; if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 207; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_L4_unpacking_done:; } if (__Pyx_PyObject_SetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_right, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 207; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (__Pyx_PyObject_SetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_centery, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 207; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "pygame_sdl2/rect.pyx":206 * def __get__(self): * return (self.right, self.centery) * def __set__(self, val): # <<<<<<<<<<<<<< * self.right, self.centery = val * */ /* function exit code */ __pyx_r = 0; goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("pygame_sdl2.rect.Rect.midright.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = -1; __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/rect.pyx":209 * self.right, self.centery = val * * def copy(self): # <<<<<<<<<<<<<< * return Rect(self) * */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_4rect_4Rect_17copy(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/ static PyObject *__pyx_pw_11pygame_sdl2_4rect_4Rect_17copy(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("copy (wrapper)", 0); __pyx_r = __pyx_pf_11pygame_sdl2_4rect_4Rect_16copy(((struct __pyx_obj_11pygame_sdl2_4rect_Rect *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_4rect_4Rect_16copy(struct __pyx_obj_11pygame_sdl2_4rect_Rect *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("copy", 0); /* "pygame_sdl2/rect.pyx":210 * * def copy(self): * return Rect(self) # <<<<<<<<<<<<<< * * def move(self, *args): */ __Pyx_XDECREF(__pyx_r); __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 210; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __Pyx_INCREF(((PyObject *)__pyx_v_self)); __Pyx_GIVEREF(((PyObject *)__pyx_v_self)); PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)__pyx_v_self)); __pyx_t_2 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_11pygame_sdl2_4rect_Rect), __pyx_t_1, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 210; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; /* "pygame_sdl2/rect.pyx":209 * self.right, self.centery = val * * def copy(self): # <<<<<<<<<<<<<< * return Rect(self) * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_AddTraceback("pygame_sdl2.rect.Rect.copy", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/rect.pyx":212 * return Rect(self) * * def move(self, *args): # <<<<<<<<<<<<<< * r = self.copy() * r.move_ip(*args) */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_4rect_4Rect_19move(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static PyObject *__pyx_pw_11pygame_sdl2_4rect_4Rect_19move(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_args = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("move (wrapper)", 0); if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "move", 0))) return NULL; __Pyx_INCREF(__pyx_args); __pyx_v_args = __pyx_args; __pyx_r = __pyx_pf_11pygame_sdl2_4rect_4Rect_18move(((struct __pyx_obj_11pygame_sdl2_4rect_Rect *)__pyx_v_self), __pyx_v_args); /* function exit code */ __Pyx_XDECREF(__pyx_v_args); __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_4rect_4Rect_18move(struct __pyx_obj_11pygame_sdl2_4rect_Rect *__pyx_v_self, PyObject *__pyx_v_args) { PyObject *__pyx_v_r = NULL; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("move", 0); /* "pygame_sdl2/rect.pyx":213 * * def move(self, *args): * r = self.copy() # <<<<<<<<<<<<<< * r.move_ip(*args) * return r */ __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_copy); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 213; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = NULL; if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_2))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); if (likely(__pyx_t_3)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); } } if (__pyx_t_3) { __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 213; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } else { __pyx_t_1 = __Pyx_PyObject_CallNoArg(__pyx_t_2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 213; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_v_r = __pyx_t_1; __pyx_t_1 = 0; /* "pygame_sdl2/rect.pyx":214 * def move(self, *args): * r = self.copy() * r.move_ip(*args) # <<<<<<<<<<<<<< * return r * */ __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_r, __pyx_n_s_move_ip); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 214; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_v_args, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 214; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "pygame_sdl2/rect.pyx":215 * r = self.copy() * r.move_ip(*args) * return r # <<<<<<<<<<<<<< * * def move_ip(self, *args): */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(__pyx_v_r); __pyx_r = __pyx_v_r; goto __pyx_L0; /* "pygame_sdl2/rect.pyx":212 * return Rect(self) * * def move(self, *args): # <<<<<<<<<<<<<< * r = self.copy() * r.move_ip(*args) */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("pygame_sdl2.rect.Rect.move", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF(__pyx_v_r); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/rect.pyx":217 * return r * * def move_ip(self, *args): # <<<<<<<<<<<<<< * x, y = flatten(args) * self.x += x */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_4rect_4Rect_21move_ip(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static PyObject *__pyx_pw_11pygame_sdl2_4rect_4Rect_21move_ip(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_args = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("move_ip (wrapper)", 0); if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "move_ip", 0))) return NULL; __Pyx_INCREF(__pyx_args); __pyx_v_args = __pyx_args; __pyx_r = __pyx_pf_11pygame_sdl2_4rect_4Rect_20move_ip(((struct __pyx_obj_11pygame_sdl2_4rect_Rect *)__pyx_v_self), __pyx_v_args); /* function exit code */ __Pyx_XDECREF(__pyx_v_args); __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_4rect_4Rect_20move_ip(struct __pyx_obj_11pygame_sdl2_4rect_Rect *__pyx_v_self, PyObject *__pyx_v_args) { PyObject *__pyx_v_x = NULL; PyObject *__pyx_v_y = NULL; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; PyObject *(*__pyx_t_5)(PyObject *); int __pyx_t_6; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("move_ip", 0); /* "pygame_sdl2/rect.pyx":218 * * def move_ip(self, *args): * x, y = flatten(args) # <<<<<<<<<<<<<< * self.x += x * self.y += y */ __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_flatten); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 218; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = NULL; if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_2))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); if (likely(__pyx_t_3)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); } } if (!__pyx_t_3) { __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_v_args); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 218; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); } else { __pyx_t_4 = PyTuple_New(1+1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 218; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_3); __pyx_t_3 = NULL; __Pyx_INCREF(__pyx_v_args); __Pyx_GIVEREF(__pyx_v_args); PyTuple_SET_ITEM(__pyx_t_4, 0+1, __pyx_v_args); __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_4, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 218; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; } __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; if ((likely(PyTuple_CheckExact(__pyx_t_1))) || (PyList_CheckExact(__pyx_t_1))) { PyObject* sequence = __pyx_t_1; #if CYTHON_COMPILING_IN_CPYTHON Py_ssize_t size = Py_SIZE(sequence); #else Py_ssize_t size = PySequence_Size(sequence); #endif if (unlikely(size != 2)) { if (size > 2) __Pyx_RaiseTooManyValuesError(2); else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 218; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } #if CYTHON_COMPILING_IN_CPYTHON if (likely(PyTuple_CheckExact(sequence))) { __pyx_t_2 = PyTuple_GET_ITEM(sequence, 0); __pyx_t_4 = PyTuple_GET_ITEM(sequence, 1); } else { __pyx_t_2 = PyList_GET_ITEM(sequence, 0); __pyx_t_4 = PyList_GET_ITEM(sequence, 1); } __Pyx_INCREF(__pyx_t_2); __Pyx_INCREF(__pyx_t_4); #else __pyx_t_2 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 218; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __pyx_t_4 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 218; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); #endif __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; } else { Py_ssize_t index = -1; __pyx_t_3 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 218; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_5 = Py_TYPE(__pyx_t_3)->tp_iternext; index = 0; __pyx_t_2 = __pyx_t_5(__pyx_t_3); if (unlikely(!__pyx_t_2)) goto __pyx_L3_unpacking_failed; __Pyx_GOTREF(__pyx_t_2); index = 1; __pyx_t_4 = __pyx_t_5(__pyx_t_3); if (unlikely(!__pyx_t_4)) goto __pyx_L3_unpacking_failed; __Pyx_GOTREF(__pyx_t_4); if (__Pyx_IternextUnpackEndCheck(__pyx_t_5(__pyx_t_3), 2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 218; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_t_5 = NULL; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; goto __pyx_L4_unpacking_done; __pyx_L3_unpacking_failed:; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_5 = NULL; if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 218; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_L4_unpacking_done:; } __pyx_v_x = __pyx_t_2; __pyx_t_2 = 0; __pyx_v_y = __pyx_t_4; __pyx_t_4 = 0; /* "pygame_sdl2/rect.pyx":219 * def move_ip(self, *args): * x, y = flatten(args) * self.x += x # <<<<<<<<<<<<<< * self.y += y * */ __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_self->x); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 219; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_t_4 = PyNumber_InPlaceAdd(__pyx_t_1, __pyx_v_x); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 219; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_6 = __Pyx_PyInt_As_int(__pyx_t_4); if (unlikely((__pyx_t_6 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 219; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_v_self->x = __pyx_t_6; /* "pygame_sdl2/rect.pyx":220 * x, y = flatten(args) * self.x += x * self.y += y # <<<<<<<<<<<<<< * * def inflate(self, *args): */ __pyx_t_4 = __Pyx_PyInt_From_int(__pyx_v_self->y); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 220; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); __pyx_t_1 = PyNumber_InPlaceAdd(__pyx_t_4, __pyx_v_y); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 220; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_t_6 = __Pyx_PyInt_As_int(__pyx_t_1); if (unlikely((__pyx_t_6 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 220; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_v_self->y = __pyx_t_6; /* "pygame_sdl2/rect.pyx":217 * return r * * def move_ip(self, *args): # <<<<<<<<<<<<<< * x, y = flatten(args) * self.x += x */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_AddTraceback("pygame_sdl2.rect.Rect.move_ip", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF(__pyx_v_x); __Pyx_XDECREF(__pyx_v_y); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/rect.pyx":222 * self.y += y * * def inflate(self, *args): # <<<<<<<<<<<<<< * r = self.copy() * r.inflate_ip(*args) */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_4rect_4Rect_23inflate(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static PyObject *__pyx_pw_11pygame_sdl2_4rect_4Rect_23inflate(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_args = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("inflate (wrapper)", 0); if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "inflate", 0))) return NULL; __Pyx_INCREF(__pyx_args); __pyx_v_args = __pyx_args; __pyx_r = __pyx_pf_11pygame_sdl2_4rect_4Rect_22inflate(((struct __pyx_obj_11pygame_sdl2_4rect_Rect *)__pyx_v_self), __pyx_v_args); /* function exit code */ __Pyx_XDECREF(__pyx_v_args); __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_4rect_4Rect_22inflate(struct __pyx_obj_11pygame_sdl2_4rect_Rect *__pyx_v_self, PyObject *__pyx_v_args) { PyObject *__pyx_v_r = NULL; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("inflate", 0); /* "pygame_sdl2/rect.pyx":223 * * def inflate(self, *args): * r = self.copy() # <<<<<<<<<<<<<< * r.inflate_ip(*args) * return r */ __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_copy); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 223; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = NULL; if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_2))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); if (likely(__pyx_t_3)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); } } if (__pyx_t_3) { __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 223; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } else { __pyx_t_1 = __Pyx_PyObject_CallNoArg(__pyx_t_2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 223; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_v_r = __pyx_t_1; __pyx_t_1 = 0; /* "pygame_sdl2/rect.pyx":224 * def inflate(self, *args): * r = self.copy() * r.inflate_ip(*args) # <<<<<<<<<<<<<< * return r * */ __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_r, __pyx_n_s_inflate_ip); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 224; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_v_args, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 224; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "pygame_sdl2/rect.pyx":225 * r = self.copy() * r.inflate_ip(*args) * return r # <<<<<<<<<<<<<< * * def inflate_ip(self, *args): */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(__pyx_v_r); __pyx_r = __pyx_v_r; goto __pyx_L0; /* "pygame_sdl2/rect.pyx":222 * self.y += y * * def inflate(self, *args): # <<<<<<<<<<<<<< * r = self.copy() * r.inflate_ip(*args) */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("pygame_sdl2.rect.Rect.inflate", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF(__pyx_v_r); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/rect.pyx":227 * return r * * def inflate_ip(self, *args): # <<<<<<<<<<<<<< * x, y = flatten(args) * c = self.center */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_4rect_4Rect_25inflate_ip(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static PyObject *__pyx_pw_11pygame_sdl2_4rect_4Rect_25inflate_ip(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_args = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("inflate_ip (wrapper)", 0); if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "inflate_ip", 0))) return NULL; __Pyx_INCREF(__pyx_args); __pyx_v_args = __pyx_args; __pyx_r = __pyx_pf_11pygame_sdl2_4rect_4Rect_24inflate_ip(((struct __pyx_obj_11pygame_sdl2_4rect_Rect *)__pyx_v_self), __pyx_v_args); /* function exit code */ __Pyx_XDECREF(__pyx_v_args); __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_4rect_4Rect_24inflate_ip(struct __pyx_obj_11pygame_sdl2_4rect_Rect *__pyx_v_self, PyObject *__pyx_v_args) { PyObject *__pyx_v_x = NULL; PyObject *__pyx_v_y = NULL; PyObject *__pyx_v_c = NULL; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; PyObject *(*__pyx_t_5)(PyObject *); int __pyx_t_6; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("inflate_ip", 0); /* "pygame_sdl2/rect.pyx":228 * * def inflate_ip(self, *args): * x, y = flatten(args) # <<<<<<<<<<<<<< * c = self.center * self.w += x */ __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_flatten); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 228; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = NULL; if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_2))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); if (likely(__pyx_t_3)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); } } if (!__pyx_t_3) { __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_v_args); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 228; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); } else { __pyx_t_4 = PyTuple_New(1+1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 228; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_3); __pyx_t_3 = NULL; __Pyx_INCREF(__pyx_v_args); __Pyx_GIVEREF(__pyx_v_args); PyTuple_SET_ITEM(__pyx_t_4, 0+1, __pyx_v_args); __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_4, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 228; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; } __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; if ((likely(PyTuple_CheckExact(__pyx_t_1))) || (PyList_CheckExact(__pyx_t_1))) { PyObject* sequence = __pyx_t_1; #if CYTHON_COMPILING_IN_CPYTHON Py_ssize_t size = Py_SIZE(sequence); #else Py_ssize_t size = PySequence_Size(sequence); #endif if (unlikely(size != 2)) { if (size > 2) __Pyx_RaiseTooManyValuesError(2); else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 228; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } #if CYTHON_COMPILING_IN_CPYTHON if (likely(PyTuple_CheckExact(sequence))) { __pyx_t_2 = PyTuple_GET_ITEM(sequence, 0); __pyx_t_4 = PyTuple_GET_ITEM(sequence, 1); } else { __pyx_t_2 = PyList_GET_ITEM(sequence, 0); __pyx_t_4 = PyList_GET_ITEM(sequence, 1); } __Pyx_INCREF(__pyx_t_2); __Pyx_INCREF(__pyx_t_4); #else __pyx_t_2 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 228; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __pyx_t_4 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 228; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); #endif __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; } else { Py_ssize_t index = -1; __pyx_t_3 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 228; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_5 = Py_TYPE(__pyx_t_3)->tp_iternext; index = 0; __pyx_t_2 = __pyx_t_5(__pyx_t_3); if (unlikely(!__pyx_t_2)) goto __pyx_L3_unpacking_failed; __Pyx_GOTREF(__pyx_t_2); index = 1; __pyx_t_4 = __pyx_t_5(__pyx_t_3); if (unlikely(!__pyx_t_4)) goto __pyx_L3_unpacking_failed; __Pyx_GOTREF(__pyx_t_4); if (__Pyx_IternextUnpackEndCheck(__pyx_t_5(__pyx_t_3), 2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 228; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_t_5 = NULL; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; goto __pyx_L4_unpacking_done; __pyx_L3_unpacking_failed:; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_5 = NULL; if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 228; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_L4_unpacking_done:; } __pyx_v_x = __pyx_t_2; __pyx_t_2 = 0; __pyx_v_y = __pyx_t_4; __pyx_t_4 = 0; /* "pygame_sdl2/rect.pyx":229 * def inflate_ip(self, *args): * x, y = flatten(args) * c = self.center # <<<<<<<<<<<<<< * self.w += x * self.h += y */ __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_center); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 229; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_v_c = __pyx_t_1; __pyx_t_1 = 0; /* "pygame_sdl2/rect.pyx":230 * x, y = flatten(args) * c = self.center * self.w += x # <<<<<<<<<<<<<< * self.h += y * self.center = c */ __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_self->w); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 230; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_t_4 = PyNumber_InPlaceAdd(__pyx_t_1, __pyx_v_x); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 230; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_6 = __Pyx_PyInt_As_int(__pyx_t_4); if (unlikely((__pyx_t_6 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 230; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_v_self->w = __pyx_t_6; /* "pygame_sdl2/rect.pyx":231 * c = self.center * self.w += x * self.h += y # <<<<<<<<<<<<<< * self.center = c * */ __pyx_t_4 = __Pyx_PyInt_From_int(__pyx_v_self->h); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 231; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); __pyx_t_1 = PyNumber_InPlaceAdd(__pyx_t_4, __pyx_v_y); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 231; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_t_6 = __Pyx_PyInt_As_int(__pyx_t_1); if (unlikely((__pyx_t_6 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 231; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_v_self->h = __pyx_t_6; /* "pygame_sdl2/rect.pyx":232 * self.w += x * self.h += y * self.center = c # <<<<<<<<<<<<<< * * def clamp(self, other): */ if (__Pyx_PyObject_SetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_center, __pyx_v_c) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 232; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "pygame_sdl2/rect.pyx":227 * return r * * def inflate_ip(self, *args): # <<<<<<<<<<<<<< * x, y = flatten(args) * c = self.center */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_AddTraceback("pygame_sdl2.rect.Rect.inflate_ip", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF(__pyx_v_x); __Pyx_XDECREF(__pyx_v_y); __Pyx_XDECREF(__pyx_v_c); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/rect.pyx":234 * self.center = c * * def clamp(self, other): # <<<<<<<<<<<<<< * r = self.copy() * r.clamp_ip(other) */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_4rect_4Rect_27clamp(PyObject *__pyx_v_self, PyObject *__pyx_v_other); /*proto*/ static PyObject *__pyx_pw_11pygame_sdl2_4rect_4Rect_27clamp(PyObject *__pyx_v_self, PyObject *__pyx_v_other) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("clamp (wrapper)", 0); __pyx_r = __pyx_pf_11pygame_sdl2_4rect_4Rect_26clamp(((struct __pyx_obj_11pygame_sdl2_4rect_Rect *)__pyx_v_self), ((PyObject *)__pyx_v_other)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_4rect_4Rect_26clamp(struct __pyx_obj_11pygame_sdl2_4rect_Rect *__pyx_v_self, PyObject *__pyx_v_other) { PyObject *__pyx_v_r = NULL; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("clamp", 0); /* "pygame_sdl2/rect.pyx":235 * * def clamp(self, other): * r = self.copy() # <<<<<<<<<<<<<< * r.clamp_ip(other) * return r */ __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_copy); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 235; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = NULL; if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_2))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); if (likely(__pyx_t_3)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); } } if (__pyx_t_3) { __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 235; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } else { __pyx_t_1 = __Pyx_PyObject_CallNoArg(__pyx_t_2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 235; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_v_r = __pyx_t_1; __pyx_t_1 = 0; /* "pygame_sdl2/rect.pyx":236 * def clamp(self, other): * r = self.copy() * r.clamp_ip(other) # <<<<<<<<<<<<<< * return r * */ __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_r, __pyx_n_s_clamp_ip); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 236; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = NULL; if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_2))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); if (likely(__pyx_t_3)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); } } if (!__pyx_t_3) { __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_v_other); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 236; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); } else { __pyx_t_4 = PyTuple_New(1+1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 236; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_3); __pyx_t_3 = NULL; __Pyx_INCREF(__pyx_v_other); __Pyx_GIVEREF(__pyx_v_other); PyTuple_SET_ITEM(__pyx_t_4, 0+1, __pyx_v_other); __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_4, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 236; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; } __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "pygame_sdl2/rect.pyx":237 * r = self.copy() * r.clamp_ip(other) * return r # <<<<<<<<<<<<<< * * def clamp_ip(self, other): */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(__pyx_v_r); __pyx_r = __pyx_v_r; goto __pyx_L0; /* "pygame_sdl2/rect.pyx":234 * self.center = c * * def clamp(self, other): # <<<<<<<<<<<<<< * r = self.copy() * r.clamp_ip(other) */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_AddTraceback("pygame_sdl2.rect.Rect.clamp", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF(__pyx_v_r); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/rect.pyx":239 * return r * * def clamp_ip(self, other): # <<<<<<<<<<<<<< * if not isinstance(other, Rect): * other = Rect(other) */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_4rect_4Rect_29clamp_ip(PyObject *__pyx_v_self, PyObject *__pyx_v_other); /*proto*/ static PyObject *__pyx_pw_11pygame_sdl2_4rect_4Rect_29clamp_ip(PyObject *__pyx_v_self, PyObject *__pyx_v_other) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("clamp_ip (wrapper)", 0); __pyx_r = __pyx_pf_11pygame_sdl2_4rect_4Rect_28clamp_ip(((struct __pyx_obj_11pygame_sdl2_4rect_Rect *)__pyx_v_self), ((PyObject *)__pyx_v_other)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_4rect_4Rect_28clamp_ip(struct __pyx_obj_11pygame_sdl2_4rect_Rect *__pyx_v_self, PyObject *__pyx_v_other) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; int __pyx_t_2; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; PyObject *__pyx_t_5 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("clamp_ip", 0); __Pyx_INCREF(__pyx_v_other); /* "pygame_sdl2/rect.pyx":240 * * def clamp_ip(self, other): * if not isinstance(other, Rect): # <<<<<<<<<<<<<< * other = Rect(other) * */ __pyx_t_1 = __Pyx_TypeCheck(__pyx_v_other, __pyx_ptype_11pygame_sdl2_4rect_Rect); __pyx_t_2 = ((!(__pyx_t_1 != 0)) != 0); if (__pyx_t_2) { /* "pygame_sdl2/rect.pyx":241 * def clamp_ip(self, other): * if not isinstance(other, Rect): * other = Rect(other) # <<<<<<<<<<<<<< * * if self.w > other.w or self.h > other.h: */ __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 241; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __Pyx_INCREF(__pyx_v_other); __Pyx_GIVEREF(__pyx_v_other); PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_other); __pyx_t_4 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_11pygame_sdl2_4rect_Rect), __pyx_t_3, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 241; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF_SET(__pyx_v_other, __pyx_t_4); __pyx_t_4 = 0; /* "pygame_sdl2/rect.pyx":240 * * def clamp_ip(self, other): * if not isinstance(other, Rect): # <<<<<<<<<<<<<< * other = Rect(other) * */ } /* "pygame_sdl2/rect.pyx":243 * other = Rect(other) * * if self.w > other.w or self.h > other.h: # <<<<<<<<<<<<<< * self.center = other.center * else: */ __pyx_t_4 = __Pyx_PyInt_From_int(__pyx_v_self->w); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 243; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_other, __pyx_n_s_w); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 243; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __pyx_t_5 = PyObject_RichCompare(__pyx_t_4, __pyx_t_3, Py_GT); __Pyx_XGOTREF(__pyx_t_5); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 243; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_1 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 243; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; if (!__pyx_t_1) { } else { __pyx_t_2 = __pyx_t_1; goto __pyx_L5_bool_binop_done; } __pyx_t_5 = __Pyx_PyInt_From_int(__pyx_v_self->h); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 243; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_other, __pyx_n_s_h); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 243; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = PyObject_RichCompare(__pyx_t_5, __pyx_t_3, Py_GT); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 243; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_1 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 243; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_t_2 = __pyx_t_1; __pyx_L5_bool_binop_done:; if (__pyx_t_2) { /* "pygame_sdl2/rect.pyx":244 * * if self.w > other.w or self.h > other.h: * self.center = other.center # <<<<<<<<<<<<<< * else: * if self.left < other.left: */ __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_other, __pyx_n_s_center); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 244; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); if (__Pyx_PyObject_SetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_center, __pyx_t_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 244; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; /* "pygame_sdl2/rect.pyx":243 * other = Rect(other) * * if self.w > other.w or self.h > other.h: # <<<<<<<<<<<<<< * self.center = other.center * else: */ goto __pyx_L4; } /* "pygame_sdl2/rect.pyx":246 * self.center = other.center * else: * if self.left < other.left: # <<<<<<<<<<<<<< * self.left = other.left * elif self.right > other.right: */ /*else*/ { __pyx_t_4 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_left); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 246; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_other, __pyx_n_s_left); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 246; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __pyx_t_5 = PyObject_RichCompare(__pyx_t_4, __pyx_t_3, Py_LT); __Pyx_XGOTREF(__pyx_t_5); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 246; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 246; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; if (__pyx_t_2) { /* "pygame_sdl2/rect.pyx":247 * else: * if self.left < other.left: * self.left = other.left # <<<<<<<<<<<<<< * elif self.right > other.right: * self.right = other.right */ __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_other, __pyx_n_s_left); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 247; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); if (__Pyx_PyObject_SetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_left, __pyx_t_5) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 247; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; /* "pygame_sdl2/rect.pyx":246 * self.center = other.center * else: * if self.left < other.left: # <<<<<<<<<<<<<< * self.left = other.left * elif self.right > other.right: */ goto __pyx_L7; } /* "pygame_sdl2/rect.pyx":248 * if self.left < other.left: * self.left = other.left * elif self.right > other.right: # <<<<<<<<<<<<<< * self.right = other.right * if self.top < other.top: */ __pyx_t_5 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_right); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 248; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_other, __pyx_n_s_right); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 248; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = PyObject_RichCompare(__pyx_t_5, __pyx_t_3, Py_GT); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 248; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 248; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; if (__pyx_t_2) { /* "pygame_sdl2/rect.pyx":249 * self.left = other.left * elif self.right > other.right: * self.right = other.right # <<<<<<<<<<<<<< * if self.top < other.top: * self.top = other.top */ __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_other, __pyx_n_s_right); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 249; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); if (__Pyx_PyObject_SetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_right, __pyx_t_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 249; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; /* "pygame_sdl2/rect.pyx":248 * if self.left < other.left: * self.left = other.left * elif self.right > other.right: # <<<<<<<<<<<<<< * self.right = other.right * if self.top < other.top: */ } __pyx_L7:; /* "pygame_sdl2/rect.pyx":250 * elif self.right > other.right: * self.right = other.right * if self.top < other.top: # <<<<<<<<<<<<<< * self.top = other.top * elif self.bottom > other.bottom: */ __pyx_t_4 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_top); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 250; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_other, __pyx_n_s_top); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 250; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __pyx_t_5 = PyObject_RichCompare(__pyx_t_4, __pyx_t_3, Py_LT); __Pyx_XGOTREF(__pyx_t_5); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 250; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 250; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; if (__pyx_t_2) { /* "pygame_sdl2/rect.pyx":251 * self.right = other.right * if self.top < other.top: * self.top = other.top # <<<<<<<<<<<<<< * elif self.bottom > other.bottom: * self.bottom = other.bottom */ __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_other, __pyx_n_s_top); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 251; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); if (__Pyx_PyObject_SetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_top, __pyx_t_5) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 251; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; /* "pygame_sdl2/rect.pyx":250 * elif self.right > other.right: * self.right = other.right * if self.top < other.top: # <<<<<<<<<<<<<< * self.top = other.top * elif self.bottom > other.bottom: */ goto __pyx_L8; } /* "pygame_sdl2/rect.pyx":252 * if self.top < other.top: * self.top = other.top * elif self.bottom > other.bottom: # <<<<<<<<<<<<<< * self.bottom = other.bottom * */ __pyx_t_5 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_bottom); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 252; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_other, __pyx_n_s_bottom); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 252; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = PyObject_RichCompare(__pyx_t_5, __pyx_t_3, Py_GT); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 252; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 252; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; if (__pyx_t_2) { /* "pygame_sdl2/rect.pyx":253 * self.top = other.top * elif self.bottom > other.bottom: * self.bottom = other.bottom # <<<<<<<<<<<<<< * * def clip(self, other, y=None, w=None, h=None): */ __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_other, __pyx_n_s_bottom); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 253; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); if (__Pyx_PyObject_SetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_bottom, __pyx_t_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 253; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; /* "pygame_sdl2/rect.pyx":252 * if self.top < other.top: * self.top = other.top * elif self.bottom > other.bottom: # <<<<<<<<<<<<<< * self.bottom = other.bottom * */ } __pyx_L8:; } __pyx_L4:; /* "pygame_sdl2/rect.pyx":239 * return r * * def clamp_ip(self, other): # <<<<<<<<<<<<<< * if not isinstance(other, Rect): * other = Rect(other) */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_5); __Pyx_AddTraceback("pygame_sdl2.rect.Rect.clamp_ip", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF(__pyx_v_other); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/rect.pyx":255 * self.bottom = other.bottom * * def clip(self, other, y=None, w=None, h=None): # <<<<<<<<<<<<<< * if type(other) == int: * other = Rect(other, y, w, h) */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_4rect_4Rect_31clip(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static PyObject *__pyx_pw_11pygame_sdl2_4rect_4Rect_31clip(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_other = 0; PyObject *__pyx_v_y = 0; PyObject *__pyx_v_w = 0; PyObject *__pyx_v_h = 0; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("clip (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_other,&__pyx_n_s_y,&__pyx_n_s_w,&__pyx_n_s_h,0}; PyObject* values[4] = {0,0,0,0}; values[1] = ((PyObject *)Py_None); values[2] = ((PyObject *)Py_None); values[3] = ((PyObject *)Py_None); if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_other)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; case 1: if (kw_args > 0) { PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_y); if (value) { values[1] = value; kw_args--; } } case 2: if (kw_args > 0) { PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_w); if (value) { values[2] = value; kw_args--; } } case 3: if (kw_args > 0) { PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_h); if (value) { values[3] = value; kw_args--; } } } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "clip") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 255; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } } else { switch (PyTuple_GET_SIZE(__pyx_args)) { case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_other = values[0]; __pyx_v_y = values[1]; __pyx_v_w = values[2]; __pyx_v_h = values[3]; } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("clip", 0, 1, 4, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 255; __pyx_clineno = __LINE__; goto __pyx_L3_error;} __pyx_L3_error:; __Pyx_AddTraceback("pygame_sdl2.rect.Rect.clip", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_11pygame_sdl2_4rect_4Rect_30clip(((struct __pyx_obj_11pygame_sdl2_4rect_Rect *)__pyx_v_self), __pyx_v_other, __pyx_v_y, __pyx_v_w, __pyx_v_h); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_4rect_4Rect_30clip(struct __pyx_obj_11pygame_sdl2_4rect_Rect *__pyx_v_self, PyObject *__pyx_v_other, PyObject *__pyx_v_y, PyObject *__pyx_v_w, PyObject *__pyx_v_h) { PyObject *__pyx_v_r = NULL; PyObject *__pyx_v_d = NULL; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_t_2; PyObject *__pyx_t_3 = NULL; int __pyx_t_4; PyObject *__pyx_t_5 = NULL; PyObject *__pyx_t_6 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("clip", 0); __Pyx_INCREF(__pyx_v_other); /* "pygame_sdl2/rect.pyx":256 * * def clip(self, other, y=None, w=None, h=None): * if type(other) == int: # <<<<<<<<<<<<<< * other = Rect(other, y, w, h) * */ __pyx_t_1 = PyObject_RichCompare(((PyObject *)Py_TYPE(__pyx_v_other)), ((PyObject *)(&PyInt_Type)), Py_EQ); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 256; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 256; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (__pyx_t_2) { /* "pygame_sdl2/rect.pyx":257 * def clip(self, other, y=None, w=None, h=None): * if type(other) == int: * other = Rect(other, y, w, h) # <<<<<<<<<<<<<< * * if not isinstance(other, Rect): */ __pyx_t_1 = PyTuple_New(4); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 257; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __Pyx_INCREF(__pyx_v_other); __Pyx_GIVEREF(__pyx_v_other); PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_other); __Pyx_INCREF(__pyx_v_y); __Pyx_GIVEREF(__pyx_v_y); PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_v_y); __Pyx_INCREF(__pyx_v_w); __Pyx_GIVEREF(__pyx_v_w); PyTuple_SET_ITEM(__pyx_t_1, 2, __pyx_v_w); __Pyx_INCREF(__pyx_v_h); __Pyx_GIVEREF(__pyx_v_h); PyTuple_SET_ITEM(__pyx_t_1, 3, __pyx_v_h); __pyx_t_3 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_11pygame_sdl2_4rect_Rect), __pyx_t_1, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 257; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF_SET(__pyx_v_other, __pyx_t_3); __pyx_t_3 = 0; /* "pygame_sdl2/rect.pyx":256 * * def clip(self, other, y=None, w=None, h=None): * if type(other) == int: # <<<<<<<<<<<<<< * other = Rect(other, y, w, h) * */ } /* "pygame_sdl2/rect.pyx":259 * other = Rect(other, y, w, h) * * if not isinstance(other, Rect): # <<<<<<<<<<<<<< * other = Rect(other) * */ __pyx_t_2 = __Pyx_TypeCheck(__pyx_v_other, __pyx_ptype_11pygame_sdl2_4rect_Rect); __pyx_t_4 = ((!(__pyx_t_2 != 0)) != 0); if (__pyx_t_4) { /* "pygame_sdl2/rect.pyx":260 * * if not isinstance(other, Rect): * other = Rect(other) # <<<<<<<<<<<<<< * * if not self.colliderect(other): */ __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 260; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __Pyx_INCREF(__pyx_v_other); __Pyx_GIVEREF(__pyx_v_other); PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_other); __pyx_t_1 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_11pygame_sdl2_4rect_Rect), __pyx_t_3, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 260; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF_SET(__pyx_v_other, __pyx_t_1); __pyx_t_1 = 0; /* "pygame_sdl2/rect.pyx":259 * other = Rect(other, y, w, h) * * if not isinstance(other, Rect): # <<<<<<<<<<<<<< * other = Rect(other) * */ } /* "pygame_sdl2/rect.pyx":262 * other = Rect(other) * * if not self.colliderect(other): # <<<<<<<<<<<<<< * return Rect(0,0,0,0) * */ __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_colliderect); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 262; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __pyx_t_5 = NULL; if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_3))) { __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_3); if (likely(__pyx_t_5)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); __Pyx_INCREF(__pyx_t_5); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_3, function); } } if (!__pyx_t_5) { __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_v_other); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 262; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); } else { __pyx_t_6 = PyTuple_New(1+1); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 262; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_6); __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_5); __pyx_t_5 = NULL; __Pyx_INCREF(__pyx_v_other); __Pyx_GIVEREF(__pyx_v_other); PyTuple_SET_ITEM(__pyx_t_6, 0+1, __pyx_v_other); __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_6, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 262; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; } __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_4 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 262; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_2 = ((!__pyx_t_4) != 0); if (__pyx_t_2) { /* "pygame_sdl2/rect.pyx":263 * * if not self.colliderect(other): * return Rect(0,0,0,0) # <<<<<<<<<<<<<< * * r = self.copy() */ __Pyx_XDECREF(__pyx_r); __pyx_t_1 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_11pygame_sdl2_4rect_Rect), __pyx_tuple__2, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 263; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "pygame_sdl2/rect.pyx":262 * other = Rect(other) * * if not self.colliderect(other): # <<<<<<<<<<<<<< * return Rect(0,0,0,0) * */ } /* "pygame_sdl2/rect.pyx":265 * return Rect(0,0,0,0) * * r = self.copy() # <<<<<<<<<<<<<< * * # Remember that (0,0) is the top left. */ __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_copy); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 265; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __pyx_t_6 = NULL; if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_3))) { __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_3); if (likely(__pyx_t_6)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); __Pyx_INCREF(__pyx_t_6); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_3, function); } } if (__pyx_t_6) { __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_6); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 265; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; } else { __pyx_t_1 = __Pyx_PyObject_CallNoArg(__pyx_t_3); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 265; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_v_r = __pyx_t_1; __pyx_t_1 = 0; /* "pygame_sdl2/rect.pyx":268 * * # Remember that (0,0) is the top left. * if r.left < other.left: # <<<<<<<<<<<<<< * d = other.left - r.left * r.left += d */ __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_r, __pyx_n_s_left); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 268; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_other, __pyx_n_s_left); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 268; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __pyx_t_6 = PyObject_RichCompare(__pyx_t_1, __pyx_t_3, Py_LT); __Pyx_XGOTREF(__pyx_t_6); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 268; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_6); if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 268; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; if (__pyx_t_2) { /* "pygame_sdl2/rect.pyx":269 * # Remember that (0,0) is the top left. * if r.left < other.left: * d = other.left - r.left # <<<<<<<<<<<<<< * r.left += d * r.width -= d */ __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_other, __pyx_n_s_left); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 269; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_6); __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_r, __pyx_n_s_left); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 269; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __pyx_t_1 = PyNumber_Subtract(__pyx_t_6, __pyx_t_3); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 269; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_v_d = __pyx_t_1; __pyx_t_1 = 0; /* "pygame_sdl2/rect.pyx":270 * if r.left < other.left: * d = other.left - r.left * r.left += d # <<<<<<<<<<<<<< * r.width -= d * if r.right > other.right: */ __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_r, __pyx_n_s_left); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 270; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_t_3 = PyNumber_InPlaceAdd(__pyx_t_1, __pyx_v_d); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 270; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (__Pyx_PyObject_SetAttrStr(__pyx_v_r, __pyx_n_s_left, __pyx_t_3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 270; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "pygame_sdl2/rect.pyx":271 * d = other.left - r.left * r.left += d * r.width -= d # <<<<<<<<<<<<<< * if r.right > other.right: * d = r.right - other.right */ __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_r, __pyx_n_s_width); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 271; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __pyx_t_1 = PyNumber_InPlaceSubtract(__pyx_t_3, __pyx_v_d); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 271; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; if (__Pyx_PyObject_SetAttrStr(__pyx_v_r, __pyx_n_s_width, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 271; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "pygame_sdl2/rect.pyx":268 * * # Remember that (0,0) is the top left. * if r.left < other.left: # <<<<<<<<<<<<<< * d = other.left - r.left * r.left += d */ } /* "pygame_sdl2/rect.pyx":272 * r.left += d * r.width -= d * if r.right > other.right: # <<<<<<<<<<<<<< * d = r.right - other.right * r.width -=d */ __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_r, __pyx_n_s_right); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 272; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_other, __pyx_n_s_right); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 272; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __pyx_t_6 = PyObject_RichCompare(__pyx_t_1, __pyx_t_3, Py_GT); __Pyx_XGOTREF(__pyx_t_6); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 272; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_6); if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 272; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; if (__pyx_t_2) { /* "pygame_sdl2/rect.pyx":273 * r.width -= d * if r.right > other.right: * d = r.right - other.right # <<<<<<<<<<<<<< * r.width -=d * if r.top < other.top: */ __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_r, __pyx_n_s_right); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 273; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_6); __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_other, __pyx_n_s_right); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 273; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __pyx_t_1 = PyNumber_Subtract(__pyx_t_6, __pyx_t_3); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 273; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_XDECREF_SET(__pyx_v_d, __pyx_t_1); __pyx_t_1 = 0; /* "pygame_sdl2/rect.pyx":274 * if r.right > other.right: * d = r.right - other.right * r.width -=d # <<<<<<<<<<<<<< * if r.top < other.top: * d = other.top - r.top */ __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_r, __pyx_n_s_width); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 274; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_t_3 = PyNumber_InPlaceSubtract(__pyx_t_1, __pyx_v_d); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 274; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (__Pyx_PyObject_SetAttrStr(__pyx_v_r, __pyx_n_s_width, __pyx_t_3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 274; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "pygame_sdl2/rect.pyx":272 * r.left += d * r.width -= d * if r.right > other.right: # <<<<<<<<<<<<<< * d = r.right - other.right * r.width -=d */ } /* "pygame_sdl2/rect.pyx":275 * d = r.right - other.right * r.width -=d * if r.top < other.top: # <<<<<<<<<<<<<< * d = other.top - r.top * r.top += d */ __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_r, __pyx_n_s_top); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 275; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_other, __pyx_n_s_top); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 275; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_t_6 = PyObject_RichCompare(__pyx_t_3, __pyx_t_1, Py_LT); __Pyx_XGOTREF(__pyx_t_6); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 275; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_6); if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 275; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; if (__pyx_t_2) { /* "pygame_sdl2/rect.pyx":276 * r.width -=d * if r.top < other.top: * d = other.top - r.top # <<<<<<<<<<<<<< * r.top += d * r.height -= d */ __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_other, __pyx_n_s_top); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 276; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_6); __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_r, __pyx_n_s_top); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 276; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_t_3 = PyNumber_Subtract(__pyx_t_6, __pyx_t_1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 276; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_XDECREF_SET(__pyx_v_d, __pyx_t_3); __pyx_t_3 = 0; /* "pygame_sdl2/rect.pyx":277 * if r.top < other.top: * d = other.top - r.top * r.top += d # <<<<<<<<<<<<<< * r.height -= d * if r.bottom > other.bottom: */ __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_r, __pyx_n_s_top); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 277; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __pyx_t_1 = PyNumber_InPlaceAdd(__pyx_t_3, __pyx_v_d); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 277; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; if (__Pyx_PyObject_SetAttrStr(__pyx_v_r, __pyx_n_s_top, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 277; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "pygame_sdl2/rect.pyx":278 * d = other.top - r.top * r.top += d * r.height -= d # <<<<<<<<<<<<<< * if r.bottom > other.bottom: * d = r.bottom - other.bottom */ __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_r, __pyx_n_s_height); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 278; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_t_3 = PyNumber_InPlaceSubtract(__pyx_t_1, __pyx_v_d); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 278; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (__Pyx_PyObject_SetAttrStr(__pyx_v_r, __pyx_n_s_height, __pyx_t_3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 278; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "pygame_sdl2/rect.pyx":275 * d = r.right - other.right * r.width -=d * if r.top < other.top: # <<<<<<<<<<<<<< * d = other.top - r.top * r.top += d */ } /* "pygame_sdl2/rect.pyx":279 * r.top += d * r.height -= d * if r.bottom > other.bottom: # <<<<<<<<<<<<<< * d = r.bottom - other.bottom * r.height -= d */ __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_r, __pyx_n_s_bottom); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 279; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_other, __pyx_n_s_bottom); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 279; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_t_6 = PyObject_RichCompare(__pyx_t_3, __pyx_t_1, Py_GT); __Pyx_XGOTREF(__pyx_t_6); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 279; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_6); if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 279; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; if (__pyx_t_2) { /* "pygame_sdl2/rect.pyx":280 * r.height -= d * if r.bottom > other.bottom: * d = r.bottom - other.bottom # <<<<<<<<<<<<<< * r.height -= d * */ __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_r, __pyx_n_s_bottom); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 280; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_6); __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_other, __pyx_n_s_bottom); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 280; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_t_3 = PyNumber_Subtract(__pyx_t_6, __pyx_t_1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 280; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_XDECREF_SET(__pyx_v_d, __pyx_t_3); __pyx_t_3 = 0; /* "pygame_sdl2/rect.pyx":281 * if r.bottom > other.bottom: * d = r.bottom - other.bottom * r.height -= d # <<<<<<<<<<<<<< * * return r */ __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_r, __pyx_n_s_height); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 281; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __pyx_t_1 = PyNumber_InPlaceSubtract(__pyx_t_3, __pyx_v_d); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 281; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; if (__Pyx_PyObject_SetAttrStr(__pyx_v_r, __pyx_n_s_height, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 281; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "pygame_sdl2/rect.pyx":279 * r.top += d * r.height -= d * if r.bottom > other.bottom: # <<<<<<<<<<<<<< * d = r.bottom - other.bottom * r.height -= d */ } /* "pygame_sdl2/rect.pyx":283 * r.height -= d * * return r # <<<<<<<<<<<<<< * * def union(self, other): */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(__pyx_v_r); __pyx_r = __pyx_v_r; goto __pyx_L0; /* "pygame_sdl2/rect.pyx":255 * self.bottom = other.bottom * * def clip(self, other, y=None, w=None, h=None): # <<<<<<<<<<<<<< * if type(other) == int: * other = Rect(other, y, w, h) */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_5); __Pyx_XDECREF(__pyx_t_6); __Pyx_AddTraceback("pygame_sdl2.rect.Rect.clip", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF(__pyx_v_r); __Pyx_XDECREF(__pyx_v_d); __Pyx_XDECREF(__pyx_v_other); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/rect.pyx":285 * return r * * def union(self, other): # <<<<<<<<<<<<<< * r = self.copy() * r.union_ip(other) */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_4rect_4Rect_33union(PyObject *__pyx_v_self, PyObject *__pyx_v_other); /*proto*/ static PyObject *__pyx_pw_11pygame_sdl2_4rect_4Rect_33union(PyObject *__pyx_v_self, PyObject *__pyx_v_other) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("union (wrapper)", 0); __pyx_r = __pyx_pf_11pygame_sdl2_4rect_4Rect_32union(((struct __pyx_obj_11pygame_sdl2_4rect_Rect *)__pyx_v_self), ((PyObject *)__pyx_v_other)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_4rect_4Rect_32union(struct __pyx_obj_11pygame_sdl2_4rect_Rect *__pyx_v_self, PyObject *__pyx_v_other) { PyObject *__pyx_v_r = NULL; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("union", 0); /* "pygame_sdl2/rect.pyx":286 * * def union(self, other): * r = self.copy() # <<<<<<<<<<<<<< * r.union_ip(other) * return r */ __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_copy); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 286; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = NULL; if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_2))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); if (likely(__pyx_t_3)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); } } if (__pyx_t_3) { __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 286; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } else { __pyx_t_1 = __Pyx_PyObject_CallNoArg(__pyx_t_2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 286; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_v_r = __pyx_t_1; __pyx_t_1 = 0; /* "pygame_sdl2/rect.pyx":287 * def union(self, other): * r = self.copy() * r.union_ip(other) # <<<<<<<<<<<<<< * return r * */ __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_r, __pyx_n_s_union_ip); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 287; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = NULL; if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_2))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); if (likely(__pyx_t_3)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); } } if (!__pyx_t_3) { __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_v_other); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 287; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); } else { __pyx_t_4 = PyTuple_New(1+1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 287; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_3); __pyx_t_3 = NULL; __Pyx_INCREF(__pyx_v_other); __Pyx_GIVEREF(__pyx_v_other); PyTuple_SET_ITEM(__pyx_t_4, 0+1, __pyx_v_other); __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_4, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 287; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; } __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "pygame_sdl2/rect.pyx":288 * r = self.copy() * r.union_ip(other) * return r # <<<<<<<<<<<<<< * * def union_ip(self, other): */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(__pyx_v_r); __pyx_r = __pyx_v_r; goto __pyx_L0; /* "pygame_sdl2/rect.pyx":285 * return r * * def union(self, other): # <<<<<<<<<<<<<< * r = self.copy() * r.union_ip(other) */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_AddTraceback("pygame_sdl2.rect.Rect.union", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF(__pyx_v_r); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/rect.pyx":290 * return r * * def union_ip(self, other): # <<<<<<<<<<<<<< * if not isinstance(other, Rect): * other = Rect(other) */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_4rect_4Rect_35union_ip(PyObject *__pyx_v_self, PyObject *__pyx_v_other); /*proto*/ static PyObject *__pyx_pw_11pygame_sdl2_4rect_4Rect_35union_ip(PyObject *__pyx_v_self, PyObject *__pyx_v_other) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("union_ip (wrapper)", 0); __pyx_r = __pyx_pf_11pygame_sdl2_4rect_4Rect_34union_ip(((struct __pyx_obj_11pygame_sdl2_4rect_Rect *)__pyx_v_self), ((PyObject *)__pyx_v_other)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_4rect_4Rect_34union_ip(struct __pyx_obj_11pygame_sdl2_4rect_Rect *__pyx_v_self, PyObject *__pyx_v_other) { PyObject *__pyx_v_x = NULL; PyObject *__pyx_v_y = NULL; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; int __pyx_t_2; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; int __pyx_t_5; PyObject *__pyx_t_6 = NULL; PyObject *__pyx_t_7 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("union_ip", 0); __Pyx_INCREF(__pyx_v_other); /* "pygame_sdl2/rect.pyx":291 * * def union_ip(self, other): * if not isinstance(other, Rect): # <<<<<<<<<<<<<< * other = Rect(other) * */ __pyx_t_1 = __Pyx_TypeCheck(__pyx_v_other, __pyx_ptype_11pygame_sdl2_4rect_Rect); __pyx_t_2 = ((!(__pyx_t_1 != 0)) != 0); if (__pyx_t_2) { /* "pygame_sdl2/rect.pyx":292 * def union_ip(self, other): * if not isinstance(other, Rect): * other = Rect(other) # <<<<<<<<<<<<<< * * x = min(self.x, other.x) */ __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 292; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __Pyx_INCREF(__pyx_v_other); __Pyx_GIVEREF(__pyx_v_other); PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_other); __pyx_t_4 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_11pygame_sdl2_4rect_Rect), __pyx_t_3, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 292; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF_SET(__pyx_v_other, __pyx_t_4); __pyx_t_4 = 0; /* "pygame_sdl2/rect.pyx":291 * * def union_ip(self, other): * if not isinstance(other, Rect): # <<<<<<<<<<<<<< * other = Rect(other) * */ } /* "pygame_sdl2/rect.pyx":294 * other = Rect(other) * * x = min(self.x, other.x) # <<<<<<<<<<<<<< * y = min(self.y, other.y) * self.w = max(self.right, other.right) - x */ __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_other, __pyx_n_s_x); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 294; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); __pyx_t_5 = __pyx_v_self->x; __pyx_t_6 = __Pyx_PyInt_From_int(__pyx_t_5); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 294; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_6); __pyx_t_7 = PyObject_RichCompare(__pyx_t_4, __pyx_t_6, Py_LT); __Pyx_XGOTREF(__pyx_t_7); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 294; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_7); if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 294; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; if (__pyx_t_2) { __Pyx_INCREF(__pyx_t_4); __pyx_t_3 = __pyx_t_4; } else { __pyx_t_7 = __Pyx_PyInt_From_int(__pyx_t_5); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 294; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_7); __pyx_t_3 = __pyx_t_7; __pyx_t_7 = 0; } __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_t_4 = __pyx_t_3; __Pyx_INCREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_v_x = __pyx_t_4; __pyx_t_4 = 0; /* "pygame_sdl2/rect.pyx":295 * * x = min(self.x, other.x) * y = min(self.y, other.y) # <<<<<<<<<<<<<< * self.w = max(self.right, other.right) - x * self.h = max(self.bottom, other.bottom) - y */ __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_other, __pyx_n_s_y); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 295; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); __pyx_t_5 = __pyx_v_self->y; __pyx_t_7 = __Pyx_PyInt_From_int(__pyx_t_5); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 295; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_7); __pyx_t_6 = PyObject_RichCompare(__pyx_t_4, __pyx_t_7, Py_LT); __Pyx_XGOTREF(__pyx_t_6); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 295; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_6); if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 295; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; if (__pyx_t_2) { __Pyx_INCREF(__pyx_t_4); __pyx_t_3 = __pyx_t_4; } else { __pyx_t_6 = __Pyx_PyInt_From_int(__pyx_t_5); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 295; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_6); __pyx_t_3 = __pyx_t_6; __pyx_t_6 = 0; } __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_t_4 = __pyx_t_3; __Pyx_INCREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_v_y = __pyx_t_4; __pyx_t_4 = 0; /* "pygame_sdl2/rect.pyx":296 * x = min(self.x, other.x) * y = min(self.y, other.y) * self.w = max(self.right, other.right) - x # <<<<<<<<<<<<<< * self.h = max(self.bottom, other.bottom) - y * self.x = x */ __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_other, __pyx_n_s_right); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 296; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_right); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 296; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __pyx_t_7 = PyObject_RichCompare(__pyx_t_4, __pyx_t_3, Py_GT); __Pyx_XGOTREF(__pyx_t_7); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 296; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_7); if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 296; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; if (__pyx_t_2) { __Pyx_INCREF(__pyx_t_4); __pyx_t_6 = __pyx_t_4; } else { __Pyx_INCREF(__pyx_t_3); __pyx_t_6 = __pyx_t_3; } __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_t_4 = PyNumber_Subtract(__pyx_t_6, __pyx_v_x); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 296; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __pyx_t_5 = __Pyx_PyInt_As_int(__pyx_t_4); if (unlikely((__pyx_t_5 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 296; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_v_self->w = __pyx_t_5; /* "pygame_sdl2/rect.pyx":297 * y = min(self.y, other.y) * self.w = max(self.right, other.right) - x * self.h = max(self.bottom, other.bottom) - y # <<<<<<<<<<<<<< * self.x = x * self.y = y */ __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_other, __pyx_n_s_bottom); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 297; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); __pyx_t_6 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_bottom); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 297; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_6); __pyx_t_7 = PyObject_RichCompare(__pyx_t_4, __pyx_t_6, Py_GT); __Pyx_XGOTREF(__pyx_t_7); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 297; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_7); if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 297; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; if (__pyx_t_2) { __Pyx_INCREF(__pyx_t_4); __pyx_t_3 = __pyx_t_4; } else { __Pyx_INCREF(__pyx_t_6); __pyx_t_3 = __pyx_t_6; } __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_t_4 = PyNumber_Subtract(__pyx_t_3, __pyx_v_y); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 297; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_5 = __Pyx_PyInt_As_int(__pyx_t_4); if (unlikely((__pyx_t_5 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 297; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_v_self->h = __pyx_t_5; /* "pygame_sdl2/rect.pyx":298 * self.w = max(self.right, other.right) - x * self.h = max(self.bottom, other.bottom) - y * self.x = x # <<<<<<<<<<<<<< * self.y = y * */ __pyx_t_5 = __Pyx_PyInt_As_int(__pyx_v_x); if (unlikely((__pyx_t_5 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 298; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_v_self->x = __pyx_t_5; /* "pygame_sdl2/rect.pyx":299 * self.h = max(self.bottom, other.bottom) - y * self.x = x * self.y = y # <<<<<<<<<<<<<< * * def unionall(self, other_seq): */ __pyx_t_5 = __Pyx_PyInt_As_int(__pyx_v_y); if (unlikely((__pyx_t_5 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 299; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_v_self->y = __pyx_t_5; /* "pygame_sdl2/rect.pyx":290 * return r * * def union_ip(self, other): # <<<<<<<<<<<<<< * if not isinstance(other, Rect): * other = Rect(other) */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_6); __Pyx_XDECREF(__pyx_t_7); __Pyx_AddTraceback("pygame_sdl2.rect.Rect.union_ip", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF(__pyx_v_x); __Pyx_XDECREF(__pyx_v_y); __Pyx_XDECREF(__pyx_v_other); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/rect.pyx":301 * self.y = y * * def unionall(self, other_seq): # <<<<<<<<<<<<<< * r = self.copy() * r.unionall_ip(other_seq) */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_4rect_4Rect_37unionall(PyObject *__pyx_v_self, PyObject *__pyx_v_other_seq); /*proto*/ static PyObject *__pyx_pw_11pygame_sdl2_4rect_4Rect_37unionall(PyObject *__pyx_v_self, PyObject *__pyx_v_other_seq) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("unionall (wrapper)", 0); __pyx_r = __pyx_pf_11pygame_sdl2_4rect_4Rect_36unionall(((struct __pyx_obj_11pygame_sdl2_4rect_Rect *)__pyx_v_self), ((PyObject *)__pyx_v_other_seq)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_4rect_4Rect_36unionall(struct __pyx_obj_11pygame_sdl2_4rect_Rect *__pyx_v_self, PyObject *__pyx_v_other_seq) { PyObject *__pyx_v_r = NULL; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("unionall", 0); /* "pygame_sdl2/rect.pyx":302 * * def unionall(self, other_seq): * r = self.copy() # <<<<<<<<<<<<<< * r.unionall_ip(other_seq) * return r */ __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_copy); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 302; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = NULL; if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_2))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); if (likely(__pyx_t_3)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); } } if (__pyx_t_3) { __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 302; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } else { __pyx_t_1 = __Pyx_PyObject_CallNoArg(__pyx_t_2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 302; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_v_r = __pyx_t_1; __pyx_t_1 = 0; /* "pygame_sdl2/rect.pyx":303 * def unionall(self, other_seq): * r = self.copy() * r.unionall_ip(other_seq) # <<<<<<<<<<<<<< * return r * */ __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_r, __pyx_n_s_unionall_ip); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 303; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = NULL; if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_2))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); if (likely(__pyx_t_3)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); } } if (!__pyx_t_3) { __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_v_other_seq); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 303; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); } else { __pyx_t_4 = PyTuple_New(1+1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 303; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_3); __pyx_t_3 = NULL; __Pyx_INCREF(__pyx_v_other_seq); __Pyx_GIVEREF(__pyx_v_other_seq); PyTuple_SET_ITEM(__pyx_t_4, 0+1, __pyx_v_other_seq); __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_4, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 303; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; } __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "pygame_sdl2/rect.pyx":304 * r = self.copy() * r.unionall_ip(other_seq) * return r # <<<<<<<<<<<<<< * * def unionall_ip(self, other_seq): */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(__pyx_v_r); __pyx_r = __pyx_v_r; goto __pyx_L0; /* "pygame_sdl2/rect.pyx":301 * self.y = y * * def unionall(self, other_seq): # <<<<<<<<<<<<<< * r = self.copy() * r.unionall_ip(other_seq) */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_AddTraceback("pygame_sdl2.rect.Rect.unionall", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF(__pyx_v_r); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/rect.pyx":306 * return r * * def unionall_ip(self, other_seq): # <<<<<<<<<<<<<< * for other in other_seq: * self.union_ip(other) */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_4rect_4Rect_39unionall_ip(PyObject *__pyx_v_self, PyObject *__pyx_v_other_seq); /*proto*/ static PyObject *__pyx_pw_11pygame_sdl2_4rect_4Rect_39unionall_ip(PyObject *__pyx_v_self, PyObject *__pyx_v_other_seq) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("unionall_ip (wrapper)", 0); __pyx_r = __pyx_pf_11pygame_sdl2_4rect_4Rect_38unionall_ip(((struct __pyx_obj_11pygame_sdl2_4rect_Rect *)__pyx_v_self), ((PyObject *)__pyx_v_other_seq)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_4rect_4Rect_38unionall_ip(struct __pyx_obj_11pygame_sdl2_4rect_Rect *__pyx_v_self, PyObject *__pyx_v_other_seq) { PyObject *__pyx_v_other = NULL; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; Py_ssize_t __pyx_t_2; PyObject *(*__pyx_t_3)(PyObject *); PyObject *__pyx_t_4 = NULL; PyObject *__pyx_t_5 = NULL; PyObject *__pyx_t_6 = NULL; PyObject *__pyx_t_7 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("unionall_ip", 0); /* "pygame_sdl2/rect.pyx":307 * * def unionall_ip(self, other_seq): * for other in other_seq: # <<<<<<<<<<<<<< * self.union_ip(other) * */ if (likely(PyList_CheckExact(__pyx_v_other_seq)) || PyTuple_CheckExact(__pyx_v_other_seq)) { __pyx_t_1 = __pyx_v_other_seq; __Pyx_INCREF(__pyx_t_1); __pyx_t_2 = 0; __pyx_t_3 = NULL; } else { __pyx_t_2 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_v_other_seq); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 307; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_t_3 = Py_TYPE(__pyx_t_1)->tp_iternext; if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 307; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } for (;;) { if (likely(!__pyx_t_3)) { if (likely(PyList_CheckExact(__pyx_t_1))) { if (__pyx_t_2 >= PyList_GET_SIZE(__pyx_t_1)) break; #if CYTHON_COMPILING_IN_CPYTHON __pyx_t_4 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_2); __Pyx_INCREF(__pyx_t_4); __pyx_t_2++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 307; __pyx_clineno = __LINE__; goto __pyx_L1_error;} #else __pyx_t_4 = PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 307; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); #endif } else { if (__pyx_t_2 >= PyTuple_GET_SIZE(__pyx_t_1)) break; #if CYTHON_COMPILING_IN_CPYTHON __pyx_t_4 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_2); __Pyx_INCREF(__pyx_t_4); __pyx_t_2++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 307; __pyx_clineno = __LINE__; goto __pyx_L1_error;} #else __pyx_t_4 = PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 307; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); #endif } } else { __pyx_t_4 = __pyx_t_3(__pyx_t_1); if (unlikely(!__pyx_t_4)) { PyObject* exc_type = PyErr_Occurred(); if (exc_type) { if (likely(exc_type == PyExc_StopIteration || PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); else {__pyx_filename = __pyx_f[0]; __pyx_lineno = 307; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } break; } __Pyx_GOTREF(__pyx_t_4); } __Pyx_XDECREF_SET(__pyx_v_other, __pyx_t_4); __pyx_t_4 = 0; /* "pygame_sdl2/rect.pyx":308 * def unionall_ip(self, other_seq): * for other in other_seq: * self.union_ip(other) # <<<<<<<<<<<<<< * * def fit(self, other): */ __pyx_t_5 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_union_ip); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 308; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); __pyx_t_6 = NULL; if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_5))) { __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_5); if (likely(__pyx_t_6)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5); __Pyx_INCREF(__pyx_t_6); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_5, function); } } if (!__pyx_t_6) { __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_v_other); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 308; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); } else { __pyx_t_7 = PyTuple_New(1+1); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 308; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_7); __Pyx_GIVEREF(__pyx_t_6); PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_6); __pyx_t_6 = NULL; __Pyx_INCREF(__pyx_v_other); __Pyx_GIVEREF(__pyx_v_other); PyTuple_SET_ITEM(__pyx_t_7, 0+1, __pyx_v_other); __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_7, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 308; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; } __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; /* "pygame_sdl2/rect.pyx":307 * * def unionall_ip(self, other_seq): * for other in other_seq: # <<<<<<<<<<<<<< * self.union_ip(other) * */ } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "pygame_sdl2/rect.pyx":306 * return r * * def unionall_ip(self, other_seq): # <<<<<<<<<<<<<< * for other in other_seq: * self.union_ip(other) */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_5); __Pyx_XDECREF(__pyx_t_6); __Pyx_XDECREF(__pyx_t_7); __Pyx_AddTraceback("pygame_sdl2.rect.Rect.unionall_ip", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF(__pyx_v_other); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/rect.pyx":310 * self.union_ip(other) * * def fit(self, other): # <<<<<<<<<<<<<< * if not isinstance(other, Rect): * other = Rect(other) */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_4rect_4Rect_41fit(PyObject *__pyx_v_self, PyObject *__pyx_v_other); /*proto*/ static PyObject *__pyx_pw_11pygame_sdl2_4rect_4Rect_41fit(PyObject *__pyx_v_self, PyObject *__pyx_v_other) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("fit (wrapper)", 0); __pyx_r = __pyx_pf_11pygame_sdl2_4rect_4Rect_40fit(((struct __pyx_obj_11pygame_sdl2_4rect_Rect *)__pyx_v_self), ((PyObject *)__pyx_v_other)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_4rect_4Rect_40fit(struct __pyx_obj_11pygame_sdl2_4rect_Rect *__pyx_v_self, PyObject *__pyx_v_other) { PyObject *__pyx_v_r = NULL; PyObject *__pyx_v_w_ratio = NULL; PyObject *__pyx_v_h_ratio = NULL; PyObject *__pyx_v_factor = NULL; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; int __pyx_t_2; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; PyObject *__pyx_t_5 = NULL; double __pyx_t_6; PyObject *__pyx_t_7 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("fit", 0); __Pyx_INCREF(__pyx_v_other); /* "pygame_sdl2/rect.pyx":311 * * def fit(self, other): * if not isinstance(other, Rect): # <<<<<<<<<<<<<< * other = Rect(other) * */ __pyx_t_1 = __Pyx_TypeCheck(__pyx_v_other, __pyx_ptype_11pygame_sdl2_4rect_Rect); __pyx_t_2 = ((!(__pyx_t_1 != 0)) != 0); if (__pyx_t_2) { /* "pygame_sdl2/rect.pyx":312 * def fit(self, other): * if not isinstance(other, Rect): * other = Rect(other) # <<<<<<<<<<<<<< * * # Not sure if this is entirely correct. Docs and tests are ambiguous. */ __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 312; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __Pyx_INCREF(__pyx_v_other); __Pyx_GIVEREF(__pyx_v_other); PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_other); __pyx_t_4 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_11pygame_sdl2_4rect_Rect), __pyx_t_3, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 312; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF_SET(__pyx_v_other, __pyx_t_4); __pyx_t_4 = 0; /* "pygame_sdl2/rect.pyx":311 * * def fit(self, other): * if not isinstance(other, Rect): # <<<<<<<<<<<<<< * other = Rect(other) * */ } /* "pygame_sdl2/rect.pyx":315 * * # Not sure if this is entirely correct. Docs and tests are ambiguous. * r = self.copy() # <<<<<<<<<<<<<< * r.topleft = other.topleft * w_ratio = other.w / float(r.w) */ __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_copy); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 315; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __pyx_t_5 = NULL; if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_3))) { __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_3); if (likely(__pyx_t_5)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); __Pyx_INCREF(__pyx_t_5); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_3, function); } } if (__pyx_t_5) { __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_5); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 315; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; } else { __pyx_t_4 = __Pyx_PyObject_CallNoArg(__pyx_t_3); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 315; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_v_r = __pyx_t_4; __pyx_t_4 = 0; /* "pygame_sdl2/rect.pyx":316 * # Not sure if this is entirely correct. Docs and tests are ambiguous. * r = self.copy() * r.topleft = other.topleft # <<<<<<<<<<<<<< * w_ratio = other.w / float(r.w) * h_ratio = other.h / float(r.h) */ __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_other, __pyx_n_s_topleft); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 316; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); if (__Pyx_PyObject_SetAttrStr(__pyx_v_r, __pyx_n_s_topleft, __pyx_t_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 316; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; /* "pygame_sdl2/rect.pyx":317 * r = self.copy() * r.topleft = other.topleft * w_ratio = other.w / float(r.w) # <<<<<<<<<<<<<< * h_ratio = other.h / float(r.h) * factor = min(w_ratio, h_ratio) */ __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_other, __pyx_n_s_w); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 317; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_r, __pyx_n_s_w); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 317; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __pyx_t_6 = __Pyx_PyObject_AsDouble(__pyx_t_3); if (unlikely(__pyx_t_6 == ((double)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 317; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_3 = PyFloat_FromDouble(__pyx_t_6); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 317; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __pyx_t_5 = __Pyx_PyNumber_Divide(__pyx_t_4, __pyx_t_3); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 317; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_v_w_ratio = __pyx_t_5; __pyx_t_5 = 0; /* "pygame_sdl2/rect.pyx":318 * r.topleft = other.topleft * w_ratio = other.w / float(r.w) * h_ratio = other.h / float(r.h) # <<<<<<<<<<<<<< * factor = min(w_ratio, h_ratio) * r.w *= factor */ __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_other, __pyx_n_s_h); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 318; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_r, __pyx_n_s_h); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 318; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __pyx_t_6 = __Pyx_PyObject_AsDouble(__pyx_t_3); if (unlikely(__pyx_t_6 == ((double)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 318; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_3 = PyFloat_FromDouble(__pyx_t_6); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 318; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = __Pyx_PyNumber_Divide(__pyx_t_5, __pyx_t_3); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 318; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_v_h_ratio = __pyx_t_4; __pyx_t_4 = 0; /* "pygame_sdl2/rect.pyx":319 * w_ratio = other.w / float(r.w) * h_ratio = other.h / float(r.h) * factor = min(w_ratio, h_ratio) # <<<<<<<<<<<<<< * r.w *= factor * r.h *= factor */ __Pyx_INCREF(__pyx_v_h_ratio); __pyx_t_4 = __pyx_v_h_ratio; __Pyx_INCREF(__pyx_v_w_ratio); __pyx_t_3 = __pyx_v_w_ratio; __pyx_t_7 = PyObject_RichCompare(__pyx_t_4, __pyx_t_3, Py_LT); __Pyx_XGOTREF(__pyx_t_7); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 319; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_7); if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 319; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; if (__pyx_t_2) { __Pyx_INCREF(__pyx_t_4); __pyx_t_5 = __pyx_t_4; } else { __Pyx_INCREF(__pyx_t_3); __pyx_t_5 = __pyx_t_3; } __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_t_4 = __pyx_t_5; __Pyx_INCREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __pyx_v_factor = __pyx_t_4; __pyx_t_4 = 0; /* "pygame_sdl2/rect.pyx":320 * h_ratio = other.h / float(r.h) * factor = min(w_ratio, h_ratio) * r.w *= factor # <<<<<<<<<<<<<< * r.h *= factor * return r */ __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_r, __pyx_n_s_w); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 320; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); __pyx_t_5 = PyNumber_InPlaceMultiply(__pyx_t_4, __pyx_v_factor); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 320; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; if (__Pyx_PyObject_SetAttrStr(__pyx_v_r, __pyx_n_s_w, __pyx_t_5) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 320; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; /* "pygame_sdl2/rect.pyx":321 * factor = min(w_ratio, h_ratio) * r.w *= factor * r.h *= factor # <<<<<<<<<<<<<< * return r * */ __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_r, __pyx_n_s_h); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 321; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); __pyx_t_4 = PyNumber_InPlaceMultiply(__pyx_t_5, __pyx_v_factor); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 321; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; if (__Pyx_PyObject_SetAttrStr(__pyx_v_r, __pyx_n_s_h, __pyx_t_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 321; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; /* "pygame_sdl2/rect.pyx":322 * r.w *= factor * r.h *= factor * return r # <<<<<<<<<<<<<< * * def normalize(self): */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(__pyx_v_r); __pyx_r = __pyx_v_r; goto __pyx_L0; /* "pygame_sdl2/rect.pyx":310 * self.union_ip(other) * * def fit(self, other): # <<<<<<<<<<<<<< * if not isinstance(other, Rect): * other = Rect(other) */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_5); __Pyx_XDECREF(__pyx_t_7); __Pyx_AddTraceback("pygame_sdl2.rect.Rect.fit", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF(__pyx_v_r); __Pyx_XDECREF(__pyx_v_w_ratio); __Pyx_XDECREF(__pyx_v_h_ratio); __Pyx_XDECREF(__pyx_v_factor); __Pyx_XDECREF(__pyx_v_other); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/rect.pyx":324 * return r * * def normalize(self): # <<<<<<<<<<<<<< * if self.w < 0: * self.x += self.w */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_4rect_4Rect_43normalize(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/ static PyObject *__pyx_pw_11pygame_sdl2_4rect_4Rect_43normalize(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("normalize (wrapper)", 0); __pyx_r = __pyx_pf_11pygame_sdl2_4rect_4Rect_42normalize(((struct __pyx_obj_11pygame_sdl2_4rect_Rect *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_4rect_4Rect_42normalize(struct __pyx_obj_11pygame_sdl2_4rect_Rect *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; __Pyx_RefNannySetupContext("normalize", 0); /* "pygame_sdl2/rect.pyx":325 * * def normalize(self): * if self.w < 0: # <<<<<<<<<<<<<< * self.x += self.w * self.w = -self.w */ __pyx_t_1 = ((__pyx_v_self->w < 0) != 0); if (__pyx_t_1) { /* "pygame_sdl2/rect.pyx":326 * def normalize(self): * if self.w < 0: * self.x += self.w # <<<<<<<<<<<<<< * self.w = -self.w * if self.h < 0: */ __pyx_v_self->x = (__pyx_v_self->x + __pyx_v_self->w); /* "pygame_sdl2/rect.pyx":327 * if self.w < 0: * self.x += self.w * self.w = -self.w # <<<<<<<<<<<<<< * if self.h < 0: * self.y += self.h */ __pyx_v_self->w = (-__pyx_v_self->w); /* "pygame_sdl2/rect.pyx":325 * * def normalize(self): * if self.w < 0: # <<<<<<<<<<<<<< * self.x += self.w * self.w = -self.w */ } /* "pygame_sdl2/rect.pyx":328 * self.x += self.w * self.w = -self.w * if self.h < 0: # <<<<<<<<<<<<<< * self.y += self.h * self.h = -self.h */ __pyx_t_1 = ((__pyx_v_self->h < 0) != 0); if (__pyx_t_1) { /* "pygame_sdl2/rect.pyx":329 * self.w = -self.w * if self.h < 0: * self.y += self.h # <<<<<<<<<<<<<< * self.h = -self.h * */ __pyx_v_self->y = (__pyx_v_self->y + __pyx_v_self->h); /* "pygame_sdl2/rect.pyx":330 * if self.h < 0: * self.y += self.h * self.h = -self.h # <<<<<<<<<<<<<< * * def contains(self, other): */ __pyx_v_self->h = (-__pyx_v_self->h); /* "pygame_sdl2/rect.pyx":328 * self.x += self.w * self.w = -self.w * if self.h < 0: # <<<<<<<<<<<<<< * self.y += self.h * self.h = -self.h */ } /* "pygame_sdl2/rect.pyx":324 * return r * * def normalize(self): # <<<<<<<<<<<<<< * if self.w < 0: * self.x += self.w */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/rect.pyx":332 * self.h = -self.h * * def contains(self, other): # <<<<<<<<<<<<<< * if not isinstance(other, Rect): * other = Rect(other) */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_4rect_4Rect_45contains(PyObject *__pyx_v_self, PyObject *__pyx_v_other); /*proto*/ static PyObject *__pyx_pw_11pygame_sdl2_4rect_4Rect_45contains(PyObject *__pyx_v_self, PyObject *__pyx_v_other) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("contains (wrapper)", 0); __pyx_r = __pyx_pf_11pygame_sdl2_4rect_4Rect_44contains(((struct __pyx_obj_11pygame_sdl2_4rect_Rect *)__pyx_v_self), ((PyObject *)__pyx_v_other)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_4rect_4Rect_44contains(struct __pyx_obj_11pygame_sdl2_4rect_Rect *__pyx_v_self, PyObject *__pyx_v_other) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; int __pyx_t_2; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; PyObject *__pyx_t_5 = NULL; PyObject *__pyx_t_6 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("contains", 0); __Pyx_INCREF(__pyx_v_other); /* "pygame_sdl2/rect.pyx":333 * * def contains(self, other): * if not isinstance(other, Rect): # <<<<<<<<<<<<<< * other = Rect(other) * */ __pyx_t_1 = __Pyx_TypeCheck(__pyx_v_other, __pyx_ptype_11pygame_sdl2_4rect_Rect); __pyx_t_2 = ((!(__pyx_t_1 != 0)) != 0); if (__pyx_t_2) { /* "pygame_sdl2/rect.pyx":334 * def contains(self, other): * if not isinstance(other, Rect): * other = Rect(other) # <<<<<<<<<<<<<< * * return other.x >= self.x and other.right <= self.right and \ */ __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 334; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __Pyx_INCREF(__pyx_v_other); __Pyx_GIVEREF(__pyx_v_other); PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_other); __pyx_t_4 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_11pygame_sdl2_4rect_Rect), __pyx_t_3, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 334; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF_SET(__pyx_v_other, __pyx_t_4); __pyx_t_4 = 0; /* "pygame_sdl2/rect.pyx":333 * * def contains(self, other): * if not isinstance(other, Rect): # <<<<<<<<<<<<<< * other = Rect(other) * */ } /* "pygame_sdl2/rect.pyx":336 * other = Rect(other) * * return other.x >= self.x and other.right <= self.right and \ # <<<<<<<<<<<<<< * other.y >= self.y and other.bottom <= self.bottom and \ * other.left < self.right and other.top < self.bottom */ __Pyx_XDECREF(__pyx_r); __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_other, __pyx_n_s_x); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 336; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __pyx_t_5 = __Pyx_PyInt_From_int(__pyx_v_self->x); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 336; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); __pyx_t_6 = PyObject_RichCompare(__pyx_t_3, __pyx_t_5, Py_GE); __Pyx_XGOTREF(__pyx_t_6); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 336; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_6); if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 336; __pyx_clineno = __LINE__; goto __pyx_L1_error;} if (__pyx_t_2) { __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; } else { __Pyx_INCREF(__pyx_t_6); __pyx_t_4 = __pyx_t_6; __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; goto __pyx_L4_bool_binop_done; } __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_other, __pyx_n_s_right); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 336; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_6); __pyx_t_5 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_right); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 336; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); __pyx_t_3 = PyObject_RichCompare(__pyx_t_6, __pyx_t_5, Py_LE); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 336; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 336; __pyx_clineno = __LINE__; goto __pyx_L1_error;} if (__pyx_t_2) { __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } else { __Pyx_INCREF(__pyx_t_3); __pyx_t_4 = __pyx_t_3; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; goto __pyx_L4_bool_binop_done; } /* "pygame_sdl2/rect.pyx":337 * * return other.x >= self.x and other.right <= self.right and \ * other.y >= self.y and other.bottom <= self.bottom and \ # <<<<<<<<<<<<<< * other.left < self.right and other.top < self.bottom * */ __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_other, __pyx_n_s_y); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 337; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __pyx_t_5 = __Pyx_PyInt_From_int(__pyx_v_self->y); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 337; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); __pyx_t_6 = PyObject_RichCompare(__pyx_t_3, __pyx_t_5, Py_GE); __Pyx_XGOTREF(__pyx_t_6); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 337; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_6); if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 337; __pyx_clineno = __LINE__; goto __pyx_L1_error;} if (__pyx_t_2) { __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; } else { __Pyx_INCREF(__pyx_t_6); __pyx_t_4 = __pyx_t_6; __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; goto __pyx_L4_bool_binop_done; } __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_other, __pyx_n_s_bottom); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 337; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_6); __pyx_t_5 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_bottom); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 337; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); __pyx_t_3 = PyObject_RichCompare(__pyx_t_6, __pyx_t_5, Py_LE); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 337; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 337; __pyx_clineno = __LINE__; goto __pyx_L1_error;} if (__pyx_t_2) { __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } else { __Pyx_INCREF(__pyx_t_3); __pyx_t_4 = __pyx_t_3; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; goto __pyx_L4_bool_binop_done; } /* "pygame_sdl2/rect.pyx":338 * return other.x >= self.x and other.right <= self.right and \ * other.y >= self.y and other.bottom <= self.bottom and \ * other.left < self.right and other.top < self.bottom # <<<<<<<<<<<<<< * * def collidepoint(self, x, y=None): */ __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_other, __pyx_n_s_left); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 338; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __pyx_t_5 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_right); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 338; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); __pyx_t_6 = PyObject_RichCompare(__pyx_t_3, __pyx_t_5, Py_LT); __Pyx_XGOTREF(__pyx_t_6); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 338; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_6); if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 338; __pyx_clineno = __LINE__; goto __pyx_L1_error;} if (__pyx_t_2) { __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; } else { __Pyx_INCREF(__pyx_t_6); __pyx_t_4 = __pyx_t_6; __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; goto __pyx_L4_bool_binop_done; } __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_other, __pyx_n_s_top); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 338; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_6); __pyx_t_5 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_bottom); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 338; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); __pyx_t_3 = PyObject_RichCompare(__pyx_t_6, __pyx_t_5, Py_LT); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 338; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_INCREF(__pyx_t_3); __pyx_t_4 = __pyx_t_3; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_L4_bool_binop_done:; __pyx_r = __pyx_t_4; __pyx_t_4 = 0; goto __pyx_L0; /* "pygame_sdl2/rect.pyx":332 * self.h = -self.h * * def contains(self, other): # <<<<<<<<<<<<<< * if not isinstance(other, Rect): * other = Rect(other) */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_5); __Pyx_XDECREF(__pyx_t_6); __Pyx_AddTraceback("pygame_sdl2.rect.Rect.contains", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF(__pyx_v_other); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/rect.pyx":340 * other.left < self.right and other.top < self.bottom * * def collidepoint(self, x, y=None): # <<<<<<<<<<<<<< * if type(x) == tuple: * x, y = x */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_4rect_4Rect_47collidepoint(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static PyObject *__pyx_pw_11pygame_sdl2_4rect_4Rect_47collidepoint(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_x = 0; PyObject *__pyx_v_y = 0; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("collidepoint (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_x,&__pyx_n_s_y,0}; PyObject* values[2] = {0,0}; values[1] = ((PyObject *)Py_None); if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_x)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; case 1: if (kw_args > 0) { PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_y); if (value) { values[1] = value; kw_args--; } } } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "collidepoint") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 340; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } } else { switch (PyTuple_GET_SIZE(__pyx_args)) { case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_x = values[0]; __pyx_v_y = values[1]; } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("collidepoint", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 340; __pyx_clineno = __LINE__; goto __pyx_L3_error;} __pyx_L3_error:; __Pyx_AddTraceback("pygame_sdl2.rect.Rect.collidepoint", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_11pygame_sdl2_4rect_4Rect_46collidepoint(((struct __pyx_obj_11pygame_sdl2_4rect_Rect *)__pyx_v_self), __pyx_v_x, __pyx_v_y); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_4rect_4Rect_46collidepoint(struct __pyx_obj_11pygame_sdl2_4rect_Rect *__pyx_v_self, PyObject *__pyx_v_x, PyObject *__pyx_v_y) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_t_2; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; PyObject *(*__pyx_t_5)(PyObject *); int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("collidepoint", 0); __Pyx_INCREF(__pyx_v_x); __Pyx_INCREF(__pyx_v_y); /* "pygame_sdl2/rect.pyx":341 * * def collidepoint(self, x, y=None): * if type(x) == tuple: # <<<<<<<<<<<<<< * x, y = x * return x >= self.x and y >= self.y and \ */ __pyx_t_1 = PyObject_RichCompare(((PyObject *)Py_TYPE(__pyx_v_x)), ((PyObject *)(&PyTuple_Type)), Py_EQ); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 341; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 341; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (__pyx_t_2) { /* "pygame_sdl2/rect.pyx":342 * def collidepoint(self, x, y=None): * if type(x) == tuple: * x, y = x # <<<<<<<<<<<<<< * return x >= self.x and y >= self.y and \ * x < self.right and y < self.bottom */ if ((likely(PyTuple_CheckExact(__pyx_v_x))) || (PyList_CheckExact(__pyx_v_x))) { PyObject* sequence = __pyx_v_x; #if CYTHON_COMPILING_IN_CPYTHON Py_ssize_t size = Py_SIZE(sequence); #else Py_ssize_t size = PySequence_Size(sequence); #endif if (unlikely(size != 2)) { if (size > 2) __Pyx_RaiseTooManyValuesError(2); else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 342; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } #if CYTHON_COMPILING_IN_CPYTHON if (likely(PyTuple_CheckExact(sequence))) { __pyx_t_1 = PyTuple_GET_ITEM(sequence, 0); __pyx_t_3 = PyTuple_GET_ITEM(sequence, 1); } else { __pyx_t_1 = PyList_GET_ITEM(sequence, 0); __pyx_t_3 = PyList_GET_ITEM(sequence, 1); } __Pyx_INCREF(__pyx_t_1); __Pyx_INCREF(__pyx_t_3); #else __pyx_t_1 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 342; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_t_3 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 342; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); #endif } else { Py_ssize_t index = -1; __pyx_t_4 = PyObject_GetIter(__pyx_v_x); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 342; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); __pyx_t_5 = Py_TYPE(__pyx_t_4)->tp_iternext; index = 0; __pyx_t_1 = __pyx_t_5(__pyx_t_4); if (unlikely(!__pyx_t_1)) goto __pyx_L4_unpacking_failed; __Pyx_GOTREF(__pyx_t_1); index = 1; __pyx_t_3 = __pyx_t_5(__pyx_t_4); if (unlikely(!__pyx_t_3)) goto __pyx_L4_unpacking_failed; __Pyx_GOTREF(__pyx_t_3); if (__Pyx_IternextUnpackEndCheck(__pyx_t_5(__pyx_t_4), 2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 342; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_t_5 = NULL; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; goto __pyx_L5_unpacking_done; __pyx_L4_unpacking_failed:; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_t_5 = NULL; if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 342; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_L5_unpacking_done:; } __Pyx_DECREF_SET(__pyx_v_x, __pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF_SET(__pyx_v_y, __pyx_t_3); __pyx_t_3 = 0; /* "pygame_sdl2/rect.pyx":341 * * def collidepoint(self, x, y=None): * if type(x) == tuple: # <<<<<<<<<<<<<< * x, y = x * return x >= self.x and y >= self.y and \ */ } /* "pygame_sdl2/rect.pyx":343 * if type(x) == tuple: * x, y = x * return x >= self.x and y >= self.y and \ # <<<<<<<<<<<<<< * x < self.right and y < self.bottom * */ __Pyx_XDECREF(__pyx_r); __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_self->x); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 343; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_t_4 = PyObject_RichCompare(__pyx_v_x, __pyx_t_1, Py_GE); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 343; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 343; __pyx_clineno = __LINE__; goto __pyx_L1_error;} if (__pyx_t_2) { __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; } else { __Pyx_INCREF(__pyx_t_4); __pyx_t_3 = __pyx_t_4; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; goto __pyx_L6_bool_binop_done; } __pyx_t_4 = __Pyx_PyInt_From_int(__pyx_v_self->y); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 343; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); __pyx_t_1 = PyObject_RichCompare(__pyx_v_y, __pyx_t_4, Py_GE); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 343; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 343; __pyx_clineno = __LINE__; goto __pyx_L1_error;} if (__pyx_t_2) { __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; } else { __Pyx_INCREF(__pyx_t_1); __pyx_t_3 = __pyx_t_1; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; goto __pyx_L6_bool_binop_done; } /* "pygame_sdl2/rect.pyx":344 * x, y = x * return x >= self.x and y >= self.y and \ * x < self.right and y < self.bottom # <<<<<<<<<<<<<< * * def colliderect(self, other): */ __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_right); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 344; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_t_4 = PyObject_RichCompare(__pyx_v_x, __pyx_t_1, Py_LT); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 344; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 344; __pyx_clineno = __LINE__; goto __pyx_L1_error;} if (__pyx_t_2) { __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; } else { __Pyx_INCREF(__pyx_t_4); __pyx_t_3 = __pyx_t_4; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; goto __pyx_L6_bool_binop_done; } __pyx_t_4 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_bottom); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 344; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); __pyx_t_1 = PyObject_RichCompare(__pyx_v_y, __pyx_t_4, Py_LT); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 344; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_INCREF(__pyx_t_1); __pyx_t_3 = __pyx_t_1; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_L6_bool_binop_done:; __pyx_r = __pyx_t_3; __pyx_t_3 = 0; goto __pyx_L0; /* "pygame_sdl2/rect.pyx":340 * other.left < self.right and other.top < self.bottom * * def collidepoint(self, x, y=None): # <<<<<<<<<<<<<< * if type(x) == tuple: * x, y = x */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_AddTraceback("pygame_sdl2.rect.Rect.collidepoint", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF(__pyx_v_x); __Pyx_XDECREF(__pyx_v_y); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/rect.pyx":346 * x < self.right and y < self.bottom * * def colliderect(self, other): # <<<<<<<<<<<<<< * if not isinstance(other, Rect): * other = Rect(other) */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_4rect_4Rect_49colliderect(PyObject *__pyx_v_self, PyObject *__pyx_v_other); /*proto*/ static PyObject *__pyx_pw_11pygame_sdl2_4rect_4Rect_49colliderect(PyObject *__pyx_v_self, PyObject *__pyx_v_other) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("colliderect (wrapper)", 0); __pyx_r = __pyx_pf_11pygame_sdl2_4rect_4Rect_48colliderect(((struct __pyx_obj_11pygame_sdl2_4rect_Rect *)__pyx_v_self), ((PyObject *)__pyx_v_other)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_4rect_4Rect_48colliderect(struct __pyx_obj_11pygame_sdl2_4rect_Rect *__pyx_v_self, PyObject *__pyx_v_other) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; int __pyx_t_2; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; PyObject *__pyx_t_5 = NULL; PyObject *__pyx_t_6 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("colliderect", 0); __Pyx_INCREF(__pyx_v_other); /* "pygame_sdl2/rect.pyx":347 * * def colliderect(self, other): * if not isinstance(other, Rect): # <<<<<<<<<<<<<< * other = Rect(other) * */ __pyx_t_1 = __Pyx_TypeCheck(__pyx_v_other, __pyx_ptype_11pygame_sdl2_4rect_Rect); __pyx_t_2 = ((!(__pyx_t_1 != 0)) != 0); if (__pyx_t_2) { /* "pygame_sdl2/rect.pyx":348 * def colliderect(self, other): * if not isinstance(other, Rect): * other = Rect(other) # <<<<<<<<<<<<<< * * return self.left < other.right and self.top < other.bottom and \ */ __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 348; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __Pyx_INCREF(__pyx_v_other); __Pyx_GIVEREF(__pyx_v_other); PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_other); __pyx_t_4 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_11pygame_sdl2_4rect_Rect), __pyx_t_3, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 348; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF_SET(__pyx_v_other, __pyx_t_4); __pyx_t_4 = 0; /* "pygame_sdl2/rect.pyx":347 * * def colliderect(self, other): * if not isinstance(other, Rect): # <<<<<<<<<<<<<< * other = Rect(other) * */ } /* "pygame_sdl2/rect.pyx":350 * other = Rect(other) * * return self.left < other.right and self.top < other.bottom and \ # <<<<<<<<<<<<<< * self.right > other.left and self.bottom > other.top * */ __Pyx_XDECREF(__pyx_r); __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_left); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 350; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_other, __pyx_n_s_right); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 350; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); __pyx_t_6 = PyObject_RichCompare(__pyx_t_3, __pyx_t_5, Py_LT); __Pyx_XGOTREF(__pyx_t_6); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 350; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_6); if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 350; __pyx_clineno = __LINE__; goto __pyx_L1_error;} if (__pyx_t_2) { __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; } else { __Pyx_INCREF(__pyx_t_6); __pyx_t_4 = __pyx_t_6; __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; goto __pyx_L4_bool_binop_done; } __pyx_t_6 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_top); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 350; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_6); __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_other, __pyx_n_s_bottom); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 350; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); __pyx_t_3 = PyObject_RichCompare(__pyx_t_6, __pyx_t_5, Py_LT); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 350; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 350; __pyx_clineno = __LINE__; goto __pyx_L1_error;} if (__pyx_t_2) { __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } else { __Pyx_INCREF(__pyx_t_3); __pyx_t_4 = __pyx_t_3; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; goto __pyx_L4_bool_binop_done; } /* "pygame_sdl2/rect.pyx":351 * * return self.left < other.right and self.top < other.bottom and \ * self.right > other.left and self.bottom > other.top # <<<<<<<<<<<<<< * * def collidelist(self, other_list): */ __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_right); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 351; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_other, __pyx_n_s_left); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 351; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); __pyx_t_6 = PyObject_RichCompare(__pyx_t_3, __pyx_t_5, Py_GT); __Pyx_XGOTREF(__pyx_t_6); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 351; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_6); if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 351; __pyx_clineno = __LINE__; goto __pyx_L1_error;} if (__pyx_t_2) { __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; } else { __Pyx_INCREF(__pyx_t_6); __pyx_t_4 = __pyx_t_6; __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; goto __pyx_L4_bool_binop_done; } __pyx_t_6 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_bottom); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 351; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_6); __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_other, __pyx_n_s_top); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 351; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); __pyx_t_3 = PyObject_RichCompare(__pyx_t_6, __pyx_t_5, Py_GT); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 351; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_INCREF(__pyx_t_3); __pyx_t_4 = __pyx_t_3; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_L4_bool_binop_done:; __pyx_r = __pyx_t_4; __pyx_t_4 = 0; goto __pyx_L0; /* "pygame_sdl2/rect.pyx":346 * x < self.right and y < self.bottom * * def colliderect(self, other): # <<<<<<<<<<<<<< * if not isinstance(other, Rect): * other = Rect(other) */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_5); __Pyx_XDECREF(__pyx_t_6); __Pyx_AddTraceback("pygame_sdl2.rect.Rect.colliderect", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF(__pyx_v_other); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/rect.pyx":353 * self.right > other.left and self.bottom > other.top * * def collidelist(self, other_list): # <<<<<<<<<<<<<< * for n, other in zip(range(len(other_list)), other_list): * if self.colliderect(other): */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_4rect_4Rect_51collidelist(PyObject *__pyx_v_self, PyObject *__pyx_v_other_list); /*proto*/ static PyObject *__pyx_pw_11pygame_sdl2_4rect_4Rect_51collidelist(PyObject *__pyx_v_self, PyObject *__pyx_v_other_list) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("collidelist (wrapper)", 0); __pyx_r = __pyx_pf_11pygame_sdl2_4rect_4Rect_50collidelist(((struct __pyx_obj_11pygame_sdl2_4rect_Rect *)__pyx_v_self), ((PyObject *)__pyx_v_other_list)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_4rect_4Rect_50collidelist(struct __pyx_obj_11pygame_sdl2_4rect_Rect *__pyx_v_self, PyObject *__pyx_v_other_list) { PyObject *__pyx_v_n = NULL; PyObject *__pyx_v_other = NULL; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations Py_ssize_t __pyx_t_1; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; PyObject *(*__pyx_t_4)(PyObject *); PyObject *__pyx_t_5 = NULL; PyObject *__pyx_t_6 = NULL; PyObject *__pyx_t_7 = NULL; PyObject *(*__pyx_t_8)(PyObject *); int __pyx_t_9; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("collidelist", 0); /* "pygame_sdl2/rect.pyx":354 * * def collidelist(self, other_list): * for n, other in zip(range(len(other_list)), other_list): # <<<<<<<<<<<<<< * if self.colliderect(other): * return n */ __pyx_t_1 = PyObject_Length(__pyx_v_other_list); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 354; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_t_2 = PyInt_FromSsize_t(__pyx_t_1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 354; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 354; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __Pyx_GIVEREF(__pyx_t_2); PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_2); __pyx_t_2 = 0; __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_range, __pyx_t_3, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 354; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 354; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __Pyx_GIVEREF(__pyx_t_2); PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_2); __Pyx_INCREF(__pyx_v_other_list); __Pyx_GIVEREF(__pyx_v_other_list); PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_v_other_list); __pyx_t_2 = 0; __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_zip, __pyx_t_3, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 354; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; if (likely(PyList_CheckExact(__pyx_t_2)) || PyTuple_CheckExact(__pyx_t_2)) { __pyx_t_3 = __pyx_t_2; __Pyx_INCREF(__pyx_t_3); __pyx_t_1 = 0; __pyx_t_4 = NULL; } else { __pyx_t_1 = -1; __pyx_t_3 = PyObject_GetIter(__pyx_t_2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 354; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = Py_TYPE(__pyx_t_3)->tp_iternext; if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 354; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; for (;;) { if (likely(!__pyx_t_4)) { if (likely(PyList_CheckExact(__pyx_t_3))) { if (__pyx_t_1 >= PyList_GET_SIZE(__pyx_t_3)) break; #if CYTHON_COMPILING_IN_CPYTHON __pyx_t_2 = PyList_GET_ITEM(__pyx_t_3, __pyx_t_1); __Pyx_INCREF(__pyx_t_2); __pyx_t_1++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 354; __pyx_clineno = __LINE__; goto __pyx_L1_error;} #else __pyx_t_2 = PySequence_ITEM(__pyx_t_3, __pyx_t_1); __pyx_t_1++; if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 354; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); #endif } else { if (__pyx_t_1 >= PyTuple_GET_SIZE(__pyx_t_3)) break; #if CYTHON_COMPILING_IN_CPYTHON __pyx_t_2 = PyTuple_GET_ITEM(__pyx_t_3, __pyx_t_1); __Pyx_INCREF(__pyx_t_2); __pyx_t_1++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 354; __pyx_clineno = __LINE__; goto __pyx_L1_error;} #else __pyx_t_2 = PySequence_ITEM(__pyx_t_3, __pyx_t_1); __pyx_t_1++; if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 354; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); #endif } } else { __pyx_t_2 = __pyx_t_4(__pyx_t_3); if (unlikely(!__pyx_t_2)) { PyObject* exc_type = PyErr_Occurred(); if (exc_type) { if (likely(exc_type == PyExc_StopIteration || PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); else {__pyx_filename = __pyx_f[0]; __pyx_lineno = 354; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } break; } __Pyx_GOTREF(__pyx_t_2); } if ((likely(PyTuple_CheckExact(__pyx_t_2))) || (PyList_CheckExact(__pyx_t_2))) { PyObject* sequence = __pyx_t_2; #if CYTHON_COMPILING_IN_CPYTHON Py_ssize_t size = Py_SIZE(sequence); #else Py_ssize_t size = PySequence_Size(sequence); #endif if (unlikely(size != 2)) { if (size > 2) __Pyx_RaiseTooManyValuesError(2); else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 354; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } #if CYTHON_COMPILING_IN_CPYTHON if (likely(PyTuple_CheckExact(sequence))) { __pyx_t_5 = PyTuple_GET_ITEM(sequence, 0); __pyx_t_6 = PyTuple_GET_ITEM(sequence, 1); } else { __pyx_t_5 = PyList_GET_ITEM(sequence, 0); __pyx_t_6 = PyList_GET_ITEM(sequence, 1); } __Pyx_INCREF(__pyx_t_5); __Pyx_INCREF(__pyx_t_6); #else __pyx_t_5 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 354; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); __pyx_t_6 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 354; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_6); #endif __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } else { Py_ssize_t index = -1; __pyx_t_7 = PyObject_GetIter(__pyx_t_2); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 354; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_8 = Py_TYPE(__pyx_t_7)->tp_iternext; index = 0; __pyx_t_5 = __pyx_t_8(__pyx_t_7); if (unlikely(!__pyx_t_5)) goto __pyx_L5_unpacking_failed; __Pyx_GOTREF(__pyx_t_5); index = 1; __pyx_t_6 = __pyx_t_8(__pyx_t_7); if (unlikely(!__pyx_t_6)) goto __pyx_L5_unpacking_failed; __Pyx_GOTREF(__pyx_t_6); if (__Pyx_IternextUnpackEndCheck(__pyx_t_8(__pyx_t_7), 2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 354; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_t_8 = NULL; __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; goto __pyx_L6_unpacking_done; __pyx_L5_unpacking_failed:; __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __pyx_t_8 = NULL; if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 354; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_L6_unpacking_done:; } __Pyx_XDECREF_SET(__pyx_v_n, __pyx_t_5); __pyx_t_5 = 0; __Pyx_XDECREF_SET(__pyx_v_other, __pyx_t_6); __pyx_t_6 = 0; /* "pygame_sdl2/rect.pyx":355 * def collidelist(self, other_list): * for n, other in zip(range(len(other_list)), other_list): * if self.colliderect(other): # <<<<<<<<<<<<<< * return n * return -1 */ __pyx_t_6 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_colliderect); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 355; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_6); __pyx_t_5 = NULL; if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_6))) { __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_6); if (likely(__pyx_t_5)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6); __Pyx_INCREF(__pyx_t_5); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_6, function); } } if (!__pyx_t_5) { __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_6, __pyx_v_other); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 355; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); } else { __pyx_t_7 = PyTuple_New(1+1); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 355; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_7); __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_5); __pyx_t_5 = NULL; __Pyx_INCREF(__pyx_v_other); __Pyx_GIVEREF(__pyx_v_other); PyTuple_SET_ITEM(__pyx_t_7, 0+1, __pyx_v_other); __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_7, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 355; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; } __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __pyx_t_9 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_9 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 355; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; if (__pyx_t_9) { /* "pygame_sdl2/rect.pyx":356 * for n, other in zip(range(len(other_list)), other_list): * if self.colliderect(other): * return n # <<<<<<<<<<<<<< * return -1 * */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(__pyx_v_n); __pyx_r = __pyx_v_n; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; goto __pyx_L0; /* "pygame_sdl2/rect.pyx":355 * def collidelist(self, other_list): * for n, other in zip(range(len(other_list)), other_list): * if self.colliderect(other): # <<<<<<<<<<<<<< * return n * return -1 */ } /* "pygame_sdl2/rect.pyx":354 * * def collidelist(self, other_list): * for n, other in zip(range(len(other_list)), other_list): # <<<<<<<<<<<<<< * if self.colliderect(other): * return n */ } __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "pygame_sdl2/rect.pyx":357 * if self.colliderect(other): * return n * return -1 # <<<<<<<<<<<<<< * * def collidelistall(self, other_list): */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(__pyx_int_neg_1); __pyx_r = __pyx_int_neg_1; goto __pyx_L0; /* "pygame_sdl2/rect.pyx":353 * self.right > other.left and self.bottom > other.top * * def collidelist(self, other_list): # <<<<<<<<<<<<<< * for n, other in zip(range(len(other_list)), other_list): * if self.colliderect(other): */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_5); __Pyx_XDECREF(__pyx_t_6); __Pyx_XDECREF(__pyx_t_7); __Pyx_AddTraceback("pygame_sdl2.rect.Rect.collidelist", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF(__pyx_v_n); __Pyx_XDECREF(__pyx_v_other); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/rect.pyx":359 * return -1 * * def collidelistall(self, other_list): # <<<<<<<<<<<<<< * ret = [] * for n, other in zip(range(len(other_list)), other_list): */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_4rect_4Rect_53collidelistall(PyObject *__pyx_v_self, PyObject *__pyx_v_other_list); /*proto*/ static PyObject *__pyx_pw_11pygame_sdl2_4rect_4Rect_53collidelistall(PyObject *__pyx_v_self, PyObject *__pyx_v_other_list) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("collidelistall (wrapper)", 0); __pyx_r = __pyx_pf_11pygame_sdl2_4rect_4Rect_52collidelistall(((struct __pyx_obj_11pygame_sdl2_4rect_Rect *)__pyx_v_self), ((PyObject *)__pyx_v_other_list)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_4rect_4Rect_52collidelistall(struct __pyx_obj_11pygame_sdl2_4rect_Rect *__pyx_v_self, PyObject *__pyx_v_other_list) { PyObject *__pyx_v_ret = NULL; PyObject *__pyx_v_n = NULL; PyObject *__pyx_v_other = NULL; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; Py_ssize_t __pyx_t_2; PyObject *__pyx_t_3 = NULL; PyObject *(*__pyx_t_4)(PyObject *); PyObject *__pyx_t_5 = NULL; PyObject *__pyx_t_6 = NULL; PyObject *__pyx_t_7 = NULL; PyObject *(*__pyx_t_8)(PyObject *); int __pyx_t_9; int __pyx_t_10; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("collidelistall", 0); /* "pygame_sdl2/rect.pyx":360 * * def collidelistall(self, other_list): * ret = [] # <<<<<<<<<<<<<< * for n, other in zip(range(len(other_list)), other_list): * if self.colliderect(other): */ __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 360; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_v_ret = ((PyObject*)__pyx_t_1); __pyx_t_1 = 0; /* "pygame_sdl2/rect.pyx":361 * def collidelistall(self, other_list): * ret = [] * for n, other in zip(range(len(other_list)), other_list): # <<<<<<<<<<<<<< * if self.colliderect(other): * ret.append(n) */ __pyx_t_2 = PyObject_Length(__pyx_v_other_list); if (unlikely(__pyx_t_2 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 361; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_t_1 = PyInt_FromSsize_t(__pyx_t_2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 361; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 361; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __Pyx_GIVEREF(__pyx_t_1); PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_1); __pyx_t_1 = 0; __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_range, __pyx_t_3, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 361; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 361; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __Pyx_GIVEREF(__pyx_t_1); PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_1); __Pyx_INCREF(__pyx_v_other_list); __Pyx_GIVEREF(__pyx_v_other_list); PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_v_other_list); __pyx_t_1 = 0; __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_zip, __pyx_t_3, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 361; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; if (likely(PyList_CheckExact(__pyx_t_1)) || PyTuple_CheckExact(__pyx_t_1)) { __pyx_t_3 = __pyx_t_1; __Pyx_INCREF(__pyx_t_3); __pyx_t_2 = 0; __pyx_t_4 = NULL; } else { __pyx_t_2 = -1; __pyx_t_3 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 361; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = Py_TYPE(__pyx_t_3)->tp_iternext; if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 361; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; for (;;) { if (likely(!__pyx_t_4)) { if (likely(PyList_CheckExact(__pyx_t_3))) { if (__pyx_t_2 >= PyList_GET_SIZE(__pyx_t_3)) break; #if CYTHON_COMPILING_IN_CPYTHON __pyx_t_1 = PyList_GET_ITEM(__pyx_t_3, __pyx_t_2); __Pyx_INCREF(__pyx_t_1); __pyx_t_2++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 361; __pyx_clineno = __LINE__; goto __pyx_L1_error;} #else __pyx_t_1 = PySequence_ITEM(__pyx_t_3, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 361; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); #endif } else { if (__pyx_t_2 >= PyTuple_GET_SIZE(__pyx_t_3)) break; #if CYTHON_COMPILING_IN_CPYTHON __pyx_t_1 = PyTuple_GET_ITEM(__pyx_t_3, __pyx_t_2); __Pyx_INCREF(__pyx_t_1); __pyx_t_2++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 361; __pyx_clineno = __LINE__; goto __pyx_L1_error;} #else __pyx_t_1 = PySequence_ITEM(__pyx_t_3, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 361; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); #endif } } else { __pyx_t_1 = __pyx_t_4(__pyx_t_3); if (unlikely(!__pyx_t_1)) { PyObject* exc_type = PyErr_Occurred(); if (exc_type) { if (likely(exc_type == PyExc_StopIteration || PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); else {__pyx_filename = __pyx_f[0]; __pyx_lineno = 361; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } break; } __Pyx_GOTREF(__pyx_t_1); } if ((likely(PyTuple_CheckExact(__pyx_t_1))) || (PyList_CheckExact(__pyx_t_1))) { PyObject* sequence = __pyx_t_1; #if CYTHON_COMPILING_IN_CPYTHON Py_ssize_t size = Py_SIZE(sequence); #else Py_ssize_t size = PySequence_Size(sequence); #endif if (unlikely(size != 2)) { if (size > 2) __Pyx_RaiseTooManyValuesError(2); else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 361; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } #if CYTHON_COMPILING_IN_CPYTHON if (likely(PyTuple_CheckExact(sequence))) { __pyx_t_5 = PyTuple_GET_ITEM(sequence, 0); __pyx_t_6 = PyTuple_GET_ITEM(sequence, 1); } else { __pyx_t_5 = PyList_GET_ITEM(sequence, 0); __pyx_t_6 = PyList_GET_ITEM(sequence, 1); } __Pyx_INCREF(__pyx_t_5); __Pyx_INCREF(__pyx_t_6); #else __pyx_t_5 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 361; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); __pyx_t_6 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 361; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_6); #endif __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; } else { Py_ssize_t index = -1; __pyx_t_7 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 361; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_8 = Py_TYPE(__pyx_t_7)->tp_iternext; index = 0; __pyx_t_5 = __pyx_t_8(__pyx_t_7); if (unlikely(!__pyx_t_5)) goto __pyx_L5_unpacking_failed; __Pyx_GOTREF(__pyx_t_5); index = 1; __pyx_t_6 = __pyx_t_8(__pyx_t_7); if (unlikely(!__pyx_t_6)) goto __pyx_L5_unpacking_failed; __Pyx_GOTREF(__pyx_t_6); if (__Pyx_IternextUnpackEndCheck(__pyx_t_8(__pyx_t_7), 2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 361; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_t_8 = NULL; __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; goto __pyx_L6_unpacking_done; __pyx_L5_unpacking_failed:; __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __pyx_t_8 = NULL; if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 361; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_L6_unpacking_done:; } __Pyx_XDECREF_SET(__pyx_v_n, __pyx_t_5); __pyx_t_5 = 0; __Pyx_XDECREF_SET(__pyx_v_other, __pyx_t_6); __pyx_t_6 = 0; /* "pygame_sdl2/rect.pyx":362 * ret = [] * for n, other in zip(range(len(other_list)), other_list): * if self.colliderect(other): # <<<<<<<<<<<<<< * ret.append(n) * return ret */ __pyx_t_6 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_colliderect); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 362; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_6); __pyx_t_5 = NULL; if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_6))) { __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_6); if (likely(__pyx_t_5)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6); __Pyx_INCREF(__pyx_t_5); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_6, function); } } if (!__pyx_t_5) { __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_6, __pyx_v_other); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 362; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); } else { __pyx_t_7 = PyTuple_New(1+1); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 362; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_7); __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_5); __pyx_t_5 = NULL; __Pyx_INCREF(__pyx_v_other); __Pyx_GIVEREF(__pyx_v_other); PyTuple_SET_ITEM(__pyx_t_7, 0+1, __pyx_v_other); __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_7, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 362; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; } __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __pyx_t_9 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_9 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 362; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (__pyx_t_9) { /* "pygame_sdl2/rect.pyx":363 * for n, other in zip(range(len(other_list)), other_list): * if self.colliderect(other): * ret.append(n) # <<<<<<<<<<<<<< * return ret * */ __pyx_t_10 = __Pyx_PyList_Append(__pyx_v_ret, __pyx_v_n); if (unlikely(__pyx_t_10 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 363; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "pygame_sdl2/rect.pyx":362 * ret = [] * for n, other in zip(range(len(other_list)), other_list): * if self.colliderect(other): # <<<<<<<<<<<<<< * ret.append(n) * return ret */ } /* "pygame_sdl2/rect.pyx":361 * def collidelistall(self, other_list): * ret = [] * for n, other in zip(range(len(other_list)), other_list): # <<<<<<<<<<<<<< * if self.colliderect(other): * ret.append(n) */ } __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "pygame_sdl2/rect.pyx":364 * if self.colliderect(other): * ret.append(n) * return ret # <<<<<<<<<<<<<< * * def collidedict(self, other_dict, rects_values=0): */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(__pyx_v_ret); __pyx_r = __pyx_v_ret; goto __pyx_L0; /* "pygame_sdl2/rect.pyx":359 * return -1 * * def collidelistall(self, other_list): # <<<<<<<<<<<<<< * ret = [] * for n, other in zip(range(len(other_list)), other_list): */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_5); __Pyx_XDECREF(__pyx_t_6); __Pyx_XDECREF(__pyx_t_7); __Pyx_AddTraceback("pygame_sdl2.rect.Rect.collidelistall", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF(__pyx_v_ret); __Pyx_XDECREF(__pyx_v_n); __Pyx_XDECREF(__pyx_v_other); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/rect.pyx":366 * return ret * * def collidedict(self, other_dict, rects_values=0): # <<<<<<<<<<<<<< * # What is rects_values supposed to do? Not in docs. * for key, val in other_dict.iteritems(): */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_4rect_4Rect_55collidedict(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static PyObject *__pyx_pw_11pygame_sdl2_4rect_4Rect_55collidedict(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_other_dict = 0; CYTHON_UNUSED PyObject *__pyx_v_rects_values = 0; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("collidedict (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_other_dict,&__pyx_n_s_rects_values,0}; PyObject* values[2] = {0,0}; values[1] = ((PyObject *)__pyx_int_0); if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_other_dict)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; case 1: if (kw_args > 0) { PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_rects_values); if (value) { values[1] = value; kw_args--; } } } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "collidedict") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 366; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } } else { switch (PyTuple_GET_SIZE(__pyx_args)) { case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_other_dict = values[0]; __pyx_v_rects_values = values[1]; } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("collidedict", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 366; __pyx_clineno = __LINE__; goto __pyx_L3_error;} __pyx_L3_error:; __Pyx_AddTraceback("pygame_sdl2.rect.Rect.collidedict", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_11pygame_sdl2_4rect_4Rect_54collidedict(((struct __pyx_obj_11pygame_sdl2_4rect_Rect *)__pyx_v_self), __pyx_v_other_dict, __pyx_v_rects_values); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_4rect_4Rect_54collidedict(struct __pyx_obj_11pygame_sdl2_4rect_Rect *__pyx_v_self, PyObject *__pyx_v_other_dict, CYTHON_UNUSED PyObject *__pyx_v_rects_values) { PyObject *__pyx_v_key = NULL; PyObject *__pyx_v_val = NULL; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; Py_ssize_t __pyx_t_2; Py_ssize_t __pyx_t_3; int __pyx_t_4; PyObject *__pyx_t_5 = NULL; PyObject *__pyx_t_6 = NULL; int __pyx_t_7; PyObject *__pyx_t_8 = NULL; PyObject *__pyx_t_9 = NULL; int __pyx_t_10; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("collidedict", 0); /* "pygame_sdl2/rect.pyx":368 * def collidedict(self, other_dict, rects_values=0): * # What is rects_values supposed to do? Not in docs. * for key, val in other_dict.iteritems(): # <<<<<<<<<<<<<< * if self.colliderect(val): * return key, val */ __pyx_t_2 = 0; if (unlikely(__pyx_v_other_dict == Py_None)) { PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%s'", "iteritems"); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 368; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } __pyx_t_5 = __Pyx_dict_iterator(__pyx_v_other_dict, 0, __pyx_n_s_iteritems, (&__pyx_t_3), (&__pyx_t_4)); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 368; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = __pyx_t_5; __pyx_t_5 = 0; while (1) { __pyx_t_7 = __Pyx_dict_iter_next(__pyx_t_1, __pyx_t_3, &__pyx_t_2, &__pyx_t_5, &__pyx_t_6, NULL, __pyx_t_4); if (unlikely(__pyx_t_7 == 0)) break; if (unlikely(__pyx_t_7 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 368; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); __Pyx_GOTREF(__pyx_t_6); __Pyx_XDECREF_SET(__pyx_v_key, __pyx_t_5); __pyx_t_5 = 0; __Pyx_XDECREF_SET(__pyx_v_val, __pyx_t_6); __pyx_t_6 = 0; /* "pygame_sdl2/rect.pyx":369 * # What is rects_values supposed to do? Not in docs. * for key, val in other_dict.iteritems(): * if self.colliderect(val): # <<<<<<<<<<<<<< * return key, val * return None */ __pyx_t_5 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_colliderect); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 369; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); __pyx_t_8 = NULL; if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_5))) { __pyx_t_8 = PyMethod_GET_SELF(__pyx_t_5); if (likely(__pyx_t_8)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5); __Pyx_INCREF(__pyx_t_8); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_5, function); } } if (!__pyx_t_8) { __pyx_t_6 = __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_v_val); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 369; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_6); } else { __pyx_t_9 = PyTuple_New(1+1); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 369; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_9); __Pyx_GIVEREF(__pyx_t_8); PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_t_8); __pyx_t_8 = NULL; __Pyx_INCREF(__pyx_v_val); __Pyx_GIVEREF(__pyx_v_val); PyTuple_SET_ITEM(__pyx_t_9, 0+1, __pyx_v_val); __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_9, NULL); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 369; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; } __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __pyx_t_10 = __Pyx_PyObject_IsTrue(__pyx_t_6); if (unlikely(__pyx_t_10 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 369; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; if (__pyx_t_10) { /* "pygame_sdl2/rect.pyx":370 * for key, val in other_dict.iteritems(): * if self.colliderect(val): * return key, val # <<<<<<<<<<<<<< * return None * */ __Pyx_XDECREF(__pyx_r); __pyx_t_6 = PyTuple_New(2); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 370; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_6); __Pyx_INCREF(__pyx_v_key); __Pyx_GIVEREF(__pyx_v_key); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_v_key); __Pyx_INCREF(__pyx_v_val); __Pyx_GIVEREF(__pyx_v_val); PyTuple_SET_ITEM(__pyx_t_6, 1, __pyx_v_val); __pyx_r = __pyx_t_6; __pyx_t_6 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; goto __pyx_L0; /* "pygame_sdl2/rect.pyx":369 * # What is rects_values supposed to do? Not in docs. * for key, val in other_dict.iteritems(): * if self.colliderect(val): # <<<<<<<<<<<<<< * return key, val * return None */ } } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "pygame_sdl2/rect.pyx":371 * if self.colliderect(val): * return key, val * return None # <<<<<<<<<<<<<< * * def collidedictall(self, other_dict, rects_values=0): */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(Py_None); __pyx_r = Py_None; goto __pyx_L0; /* "pygame_sdl2/rect.pyx":366 * return ret * * def collidedict(self, other_dict, rects_values=0): # <<<<<<<<<<<<<< * # What is rects_values supposed to do? Not in docs. * for key, val in other_dict.iteritems(): */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_5); __Pyx_XDECREF(__pyx_t_6); __Pyx_XDECREF(__pyx_t_8); __Pyx_XDECREF(__pyx_t_9); __Pyx_AddTraceback("pygame_sdl2.rect.Rect.collidedict", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF(__pyx_v_key); __Pyx_XDECREF(__pyx_v_val); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/rect.pyx":373 * return None * * def collidedictall(self, other_dict, rects_values=0): # <<<<<<<<<<<<<< * ret = [] * for key, val in other_dict.iteritems(): */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_4rect_4Rect_57collidedictall(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static PyObject *__pyx_pw_11pygame_sdl2_4rect_4Rect_57collidedictall(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_other_dict = 0; CYTHON_UNUSED PyObject *__pyx_v_rects_values = 0; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("collidedictall (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_other_dict,&__pyx_n_s_rects_values,0}; PyObject* values[2] = {0,0}; values[1] = ((PyObject *)__pyx_int_0); if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_other_dict)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; case 1: if (kw_args > 0) { PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_rects_values); if (value) { values[1] = value; kw_args--; } } } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "collidedictall") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 373; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } } else { switch (PyTuple_GET_SIZE(__pyx_args)) { case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_other_dict = values[0]; __pyx_v_rects_values = values[1]; } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("collidedictall", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 373; __pyx_clineno = __LINE__; goto __pyx_L3_error;} __pyx_L3_error:; __Pyx_AddTraceback("pygame_sdl2.rect.Rect.collidedictall", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_11pygame_sdl2_4rect_4Rect_56collidedictall(((struct __pyx_obj_11pygame_sdl2_4rect_Rect *)__pyx_v_self), __pyx_v_other_dict, __pyx_v_rects_values); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_4rect_4Rect_56collidedictall(struct __pyx_obj_11pygame_sdl2_4rect_Rect *__pyx_v_self, PyObject *__pyx_v_other_dict, CYTHON_UNUSED PyObject *__pyx_v_rects_values) { PyObject *__pyx_v_ret = NULL; PyObject *__pyx_v_key = NULL; PyObject *__pyx_v_val = NULL; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; Py_ssize_t __pyx_t_2; Py_ssize_t __pyx_t_3; int __pyx_t_4; PyObject *__pyx_t_5 = NULL; PyObject *__pyx_t_6 = NULL; int __pyx_t_7; PyObject *__pyx_t_8 = NULL; PyObject *__pyx_t_9 = NULL; int __pyx_t_10; int __pyx_t_11; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("collidedictall", 0); /* "pygame_sdl2/rect.pyx":374 * * def collidedictall(self, other_dict, rects_values=0): * ret = [] # <<<<<<<<<<<<<< * for key, val in other_dict.iteritems(): * if self.colliderect(val): */ __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 374; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_v_ret = ((PyObject*)__pyx_t_1); __pyx_t_1 = 0; /* "pygame_sdl2/rect.pyx":375 * def collidedictall(self, other_dict, rects_values=0): * ret = [] * for key, val in other_dict.iteritems(): # <<<<<<<<<<<<<< * if self.colliderect(val): * ret.append((key,val)) */ __pyx_t_2 = 0; if (unlikely(__pyx_v_other_dict == Py_None)) { PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%s'", "iteritems"); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 375; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } __pyx_t_5 = __Pyx_dict_iterator(__pyx_v_other_dict, 0, __pyx_n_s_iteritems, (&__pyx_t_3), (&__pyx_t_4)); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 375; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = __pyx_t_5; __pyx_t_5 = 0; while (1) { __pyx_t_7 = __Pyx_dict_iter_next(__pyx_t_1, __pyx_t_3, &__pyx_t_2, &__pyx_t_5, &__pyx_t_6, NULL, __pyx_t_4); if (unlikely(__pyx_t_7 == 0)) break; if (unlikely(__pyx_t_7 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 375; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); __Pyx_GOTREF(__pyx_t_6); __Pyx_XDECREF_SET(__pyx_v_key, __pyx_t_5); __pyx_t_5 = 0; __Pyx_XDECREF_SET(__pyx_v_val, __pyx_t_6); __pyx_t_6 = 0; /* "pygame_sdl2/rect.pyx":376 * ret = [] * for key, val in other_dict.iteritems(): * if self.colliderect(val): # <<<<<<<<<<<<<< * ret.append((key,val)) * return ret */ __pyx_t_5 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_colliderect); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 376; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); __pyx_t_8 = NULL; if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_5))) { __pyx_t_8 = PyMethod_GET_SELF(__pyx_t_5); if (likely(__pyx_t_8)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5); __Pyx_INCREF(__pyx_t_8); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_5, function); } } if (!__pyx_t_8) { __pyx_t_6 = __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_v_val); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 376; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_6); } else { __pyx_t_9 = PyTuple_New(1+1); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 376; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_9); __Pyx_GIVEREF(__pyx_t_8); PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_t_8); __pyx_t_8 = NULL; __Pyx_INCREF(__pyx_v_val); __Pyx_GIVEREF(__pyx_v_val); PyTuple_SET_ITEM(__pyx_t_9, 0+1, __pyx_v_val); __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_9, NULL); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 376; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; } __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __pyx_t_10 = __Pyx_PyObject_IsTrue(__pyx_t_6); if (unlikely(__pyx_t_10 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 376; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; if (__pyx_t_10) { /* "pygame_sdl2/rect.pyx":377 * for key, val in other_dict.iteritems(): * if self.colliderect(val): * ret.append((key,val)) # <<<<<<<<<<<<<< * return ret * */ __pyx_t_6 = PyTuple_New(2); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 377; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_6); __Pyx_INCREF(__pyx_v_key); __Pyx_GIVEREF(__pyx_v_key); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_v_key); __Pyx_INCREF(__pyx_v_val); __Pyx_GIVEREF(__pyx_v_val); PyTuple_SET_ITEM(__pyx_t_6, 1, __pyx_v_val); __pyx_t_11 = __Pyx_PyList_Append(__pyx_v_ret, __pyx_t_6); if (unlikely(__pyx_t_11 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 377; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; /* "pygame_sdl2/rect.pyx":376 * ret = [] * for key, val in other_dict.iteritems(): * if self.colliderect(val): # <<<<<<<<<<<<<< * ret.append((key,val)) * return ret */ } } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "pygame_sdl2/rect.pyx":378 * if self.colliderect(val): * ret.append((key,val)) * return ret # <<<<<<<<<<<<<< * * */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(__pyx_v_ret); __pyx_r = __pyx_v_ret; goto __pyx_L0; /* "pygame_sdl2/rect.pyx":373 * return None * * def collidedictall(self, other_dict, rects_values=0): # <<<<<<<<<<<<<< * ret = [] * for key, val in other_dict.iteritems(): */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_5); __Pyx_XDECREF(__pyx_t_6); __Pyx_XDECREF(__pyx_t_8); __Pyx_XDECREF(__pyx_t_9); __Pyx_AddTraceback("pygame_sdl2.rect.Rect.collidedictall", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF(__pyx_v_ret); __Pyx_XDECREF(__pyx_v_key); __Pyx_XDECREF(__pyx_v_val); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/rect.pxd":25 * cdef object __weakref__ * * cdef public int x # <<<<<<<<<<<<<< * cdef public int y * cdef public int w */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_4rect_4Rect_1x_1__get__(PyObject *__pyx_v_self); /*proto*/ static PyObject *__pyx_pw_11pygame_sdl2_4rect_4Rect_1x_1__get__(PyObject *__pyx_v_self) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); __pyx_r = __pyx_pf_11pygame_sdl2_4rect_4Rect_1x___get__(((struct __pyx_obj_11pygame_sdl2_4rect_Rect *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_4rect_4Rect_1x___get__(struct __pyx_obj_11pygame_sdl2_4rect_Rect *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__get__", 0); __Pyx_XDECREF(__pyx_r); __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_self->x); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 25; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("pygame_sdl2.rect.Rect.x.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* Python wrapper */ static int __pyx_pw_11pygame_sdl2_4rect_4Rect_1x_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/ static int __pyx_pw_11pygame_sdl2_4rect_4Rect_1x_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) { int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__set__ (wrapper)", 0); __pyx_r = __pyx_pf_11pygame_sdl2_4rect_4Rect_1x_2__set__(((struct __pyx_obj_11pygame_sdl2_4rect_Rect *)__pyx_v_self), ((PyObject *)__pyx_v_value)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static int __pyx_pf_11pygame_sdl2_4rect_4Rect_1x_2__set__(struct __pyx_obj_11pygame_sdl2_4rect_Rect *__pyx_v_self, PyObject *__pyx_v_value) { int __pyx_r; __Pyx_RefNannyDeclarations int __pyx_t_1; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__set__", 0); __pyx_t_1 = __Pyx_PyInt_As_int(__pyx_v_value); if (unlikely((__pyx_t_1 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 25; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_v_self->x = __pyx_t_1; /* function exit code */ __pyx_r = 0; goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("pygame_sdl2.rect.Rect.x.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = -1; __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/rect.pxd":26 * * cdef public int x * cdef public int y # <<<<<<<<<<<<<< * cdef public int w * cdef public int h */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_4rect_4Rect_1y_1__get__(PyObject *__pyx_v_self); /*proto*/ static PyObject *__pyx_pw_11pygame_sdl2_4rect_4Rect_1y_1__get__(PyObject *__pyx_v_self) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); __pyx_r = __pyx_pf_11pygame_sdl2_4rect_4Rect_1y___get__(((struct __pyx_obj_11pygame_sdl2_4rect_Rect *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_4rect_4Rect_1y___get__(struct __pyx_obj_11pygame_sdl2_4rect_Rect *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__get__", 0); __Pyx_XDECREF(__pyx_r); __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_self->y); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 26; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("pygame_sdl2.rect.Rect.y.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* Python wrapper */ static int __pyx_pw_11pygame_sdl2_4rect_4Rect_1y_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/ static int __pyx_pw_11pygame_sdl2_4rect_4Rect_1y_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) { int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__set__ (wrapper)", 0); __pyx_r = __pyx_pf_11pygame_sdl2_4rect_4Rect_1y_2__set__(((struct __pyx_obj_11pygame_sdl2_4rect_Rect *)__pyx_v_self), ((PyObject *)__pyx_v_value)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static int __pyx_pf_11pygame_sdl2_4rect_4Rect_1y_2__set__(struct __pyx_obj_11pygame_sdl2_4rect_Rect *__pyx_v_self, PyObject *__pyx_v_value) { int __pyx_r; __Pyx_RefNannyDeclarations int __pyx_t_1; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__set__", 0); __pyx_t_1 = __Pyx_PyInt_As_int(__pyx_v_value); if (unlikely((__pyx_t_1 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 26; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_v_self->y = __pyx_t_1; /* function exit code */ __pyx_r = 0; goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("pygame_sdl2.rect.Rect.y.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = -1; __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/rect.pxd":27 * cdef public int x * cdef public int y * cdef public int w # <<<<<<<<<<<<<< * cdef public int h * */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_4rect_4Rect_1w_1__get__(PyObject *__pyx_v_self); /*proto*/ static PyObject *__pyx_pw_11pygame_sdl2_4rect_4Rect_1w_1__get__(PyObject *__pyx_v_self) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); __pyx_r = __pyx_pf_11pygame_sdl2_4rect_4Rect_1w___get__(((struct __pyx_obj_11pygame_sdl2_4rect_Rect *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_4rect_4Rect_1w___get__(struct __pyx_obj_11pygame_sdl2_4rect_Rect *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__get__", 0); __Pyx_XDECREF(__pyx_r); __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_self->w); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 27; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("pygame_sdl2.rect.Rect.w.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* Python wrapper */ static int __pyx_pw_11pygame_sdl2_4rect_4Rect_1w_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/ static int __pyx_pw_11pygame_sdl2_4rect_4Rect_1w_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) { int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__set__ (wrapper)", 0); __pyx_r = __pyx_pf_11pygame_sdl2_4rect_4Rect_1w_2__set__(((struct __pyx_obj_11pygame_sdl2_4rect_Rect *)__pyx_v_self), ((PyObject *)__pyx_v_value)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static int __pyx_pf_11pygame_sdl2_4rect_4Rect_1w_2__set__(struct __pyx_obj_11pygame_sdl2_4rect_Rect *__pyx_v_self, PyObject *__pyx_v_value) { int __pyx_r; __Pyx_RefNannyDeclarations int __pyx_t_1; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__set__", 0); __pyx_t_1 = __Pyx_PyInt_As_int(__pyx_v_value); if (unlikely((__pyx_t_1 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 27; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_v_self->w = __pyx_t_1; /* function exit code */ __pyx_r = 0; goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("pygame_sdl2.rect.Rect.w.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = -1; __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/rect.pxd":28 * cdef public int y * cdef public int w * cdef public int h # <<<<<<<<<<<<<< * * */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_4rect_4Rect_1h_1__get__(PyObject *__pyx_v_self); /*proto*/ static PyObject *__pyx_pw_11pygame_sdl2_4rect_4Rect_1h_1__get__(PyObject *__pyx_v_self) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); __pyx_r = __pyx_pf_11pygame_sdl2_4rect_4Rect_1h___get__(((struct __pyx_obj_11pygame_sdl2_4rect_Rect *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_4rect_4Rect_1h___get__(struct __pyx_obj_11pygame_sdl2_4rect_Rect *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__get__", 0); __Pyx_XDECREF(__pyx_r); __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_self->h); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 28; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("pygame_sdl2.rect.Rect.h.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* Python wrapper */ static int __pyx_pw_11pygame_sdl2_4rect_4Rect_1h_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/ static int __pyx_pw_11pygame_sdl2_4rect_4Rect_1h_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) { int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__set__ (wrapper)", 0); __pyx_r = __pyx_pf_11pygame_sdl2_4rect_4Rect_1h_2__set__(((struct __pyx_obj_11pygame_sdl2_4rect_Rect *)__pyx_v_self), ((PyObject *)__pyx_v_value)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static int __pyx_pf_11pygame_sdl2_4rect_4Rect_1h_2__set__(struct __pyx_obj_11pygame_sdl2_4rect_Rect *__pyx_v_self, PyObject *__pyx_v_value) { int __pyx_r; __Pyx_RefNannyDeclarations int __pyx_t_1; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__set__", 0); __pyx_t_1 = __Pyx_PyInt_As_int(__pyx_v_value); if (unlikely((__pyx_t_1 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 28; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_v_self->h = __pyx_t_1; /* function exit code */ __pyx_r = 0; goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("pygame_sdl2.rect.Rect.h.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = -1; __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/rect.pyx":381 * * * cdef int to_sdl_rect(rectlike, SDL_Rect *rect, argname=None) except -1: # <<<<<<<<<<<<<< * """ * Converts `rectlike` to the SDL_Rect `rect`. */ static int __pyx_f_11pygame_sdl2_4rect_to_sdl_rect(PyObject *__pyx_v_rectlike, SDL_Rect *__pyx_v_rect, struct __pyx_opt_args_11pygame_sdl2_4rect_to_sdl_rect *__pyx_optional_args) { PyObject *__pyx_v_argname = ((PyObject *)Py_None); struct __pyx_obj_11pygame_sdl2_4rect_Rect *__pyx_v_rl = 0; int __pyx_r; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; int __pyx_t_4; int __pyx_t_5; PyObject *__pyx_t_6 = NULL; int __pyx_t_7; Py_ssize_t __pyx_t_8; PyObject *__pyx_t_9 = NULL; PyObject *__pyx_t_10 = NULL; PyObject *__pyx_t_11 = NULL; PyObject *__pyx_t_12 = NULL; PyObject *(*__pyx_t_13)(PyObject *); int __pyx_t_14; int __pyx_t_15; int __pyx_t_16; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("to_sdl_rect", 0); if (__pyx_optional_args) { if (__pyx_optional_args->__pyx_n > 0) { __pyx_v_argname = __pyx_optional_args->argname; } } /* "pygame_sdl2/rect.pyx":391 * cdef Rect rl * * try: # <<<<<<<<<<<<<< * if isinstance(rectlike, Rect): * rl = rectlike */ { __Pyx_ExceptionSave(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3); __Pyx_XGOTREF(__pyx_t_1); __Pyx_XGOTREF(__pyx_t_2); __Pyx_XGOTREF(__pyx_t_3); /*try:*/ { /* "pygame_sdl2/rect.pyx":392 * * try: * if isinstance(rectlike, Rect): # <<<<<<<<<<<<<< * rl = rectlike * */ __pyx_t_4 = __Pyx_TypeCheck(__pyx_v_rectlike, __pyx_ptype_11pygame_sdl2_4rect_Rect); __pyx_t_5 = (__pyx_t_4 != 0); if (__pyx_t_5) { /* "pygame_sdl2/rect.pyx":393 * try: * if isinstance(rectlike, Rect): * rl = rectlike # <<<<<<<<<<<<<< * * rect.x = rl.x */ if (!(likely(((__pyx_v_rectlike) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_rectlike, __pyx_ptype_11pygame_sdl2_4rect_Rect))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 393; __pyx_clineno = __LINE__; goto __pyx_L3_error;} __pyx_t_6 = __pyx_v_rectlike; __Pyx_INCREF(__pyx_t_6); __pyx_v_rl = ((struct __pyx_obj_11pygame_sdl2_4rect_Rect *)__pyx_t_6); __pyx_t_6 = 0; /* "pygame_sdl2/rect.pyx":395 * rl = rectlike * * rect.x = rl.x # <<<<<<<<<<<<<< * rect.y = rl.y * rect.w = rl.w */ __pyx_t_7 = __pyx_v_rl->x; __pyx_v_rect->x = __pyx_t_7; /* "pygame_sdl2/rect.pyx":396 * * rect.x = rl.x * rect.y = rl.y # <<<<<<<<<<<<<< * rect.w = rl.w * rect.h = rl.h */ __pyx_t_7 = __pyx_v_rl->y; __pyx_v_rect->y = __pyx_t_7; /* "pygame_sdl2/rect.pyx":397 * rect.x = rl.x * rect.y = rl.y * rect.w = rl.w # <<<<<<<<<<<<<< * rect.h = rl.h * */ __pyx_t_7 = __pyx_v_rl->w; __pyx_v_rect->w = __pyx_t_7; /* "pygame_sdl2/rect.pyx":398 * rect.y = rl.y * rect.w = rl.w * rect.h = rl.h # <<<<<<<<<<<<<< * * return 0 */ __pyx_t_7 = __pyx_v_rl->h; __pyx_v_rect->h = __pyx_t_7; /* "pygame_sdl2/rect.pyx":400 * rect.h = rl.h * * return 0 # <<<<<<<<<<<<<< * * elif len(rectlike) == 4: */ __pyx_r = 0; goto __pyx_L7_try_return; /* "pygame_sdl2/rect.pyx":392 * * try: * if isinstance(rectlike, Rect): # <<<<<<<<<<<<<< * rl = rectlike * */ } /* "pygame_sdl2/rect.pyx":402 * return 0 * * elif len(rectlike) == 4: # <<<<<<<<<<<<<< * rect.x, rect.y, rect.w, rect.h = rectlike * return 0 */ __pyx_t_8 = PyObject_Length(__pyx_v_rectlike); if (unlikely(__pyx_t_8 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 402; __pyx_clineno = __LINE__; goto __pyx_L3_error;} __pyx_t_5 = ((__pyx_t_8 == 4) != 0); if (__pyx_t_5) { /* "pygame_sdl2/rect.pyx":403 * * elif len(rectlike) == 4: * rect.x, rect.y, rect.w, rect.h = rectlike # <<<<<<<<<<<<<< * return 0 * */ if ((likely(PyTuple_CheckExact(__pyx_v_rectlike))) || (PyList_CheckExact(__pyx_v_rectlike))) { PyObject* sequence = __pyx_v_rectlike; #if CYTHON_COMPILING_IN_CPYTHON Py_ssize_t size = Py_SIZE(sequence); #else Py_ssize_t size = PySequence_Size(sequence); #endif if (unlikely(size != 4)) { if (size > 4) __Pyx_RaiseTooManyValuesError(4); else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 403; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } #if CYTHON_COMPILING_IN_CPYTHON if (likely(PyTuple_CheckExact(sequence))) { __pyx_t_6 = PyTuple_GET_ITEM(sequence, 0); __pyx_t_9 = PyTuple_GET_ITEM(sequence, 1); __pyx_t_10 = PyTuple_GET_ITEM(sequence, 2); __pyx_t_11 = PyTuple_GET_ITEM(sequence, 3); } else { __pyx_t_6 = PyList_GET_ITEM(sequence, 0); __pyx_t_9 = PyList_GET_ITEM(sequence, 1); __pyx_t_10 = PyList_GET_ITEM(sequence, 2); __pyx_t_11 = PyList_GET_ITEM(sequence, 3); } __Pyx_INCREF(__pyx_t_6); __Pyx_INCREF(__pyx_t_9); __Pyx_INCREF(__pyx_t_10); __Pyx_INCREF(__pyx_t_11); #else { Py_ssize_t i; PyObject** temps[4] = {&__pyx_t_6,&__pyx_t_9,&__pyx_t_10,&__pyx_t_11}; for (i=0; i < 4; i++) { PyObject* item = PySequence_ITEM(sequence, i); if (unlikely(!item)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 403; __pyx_clineno = __LINE__; goto __pyx_L3_error;} __Pyx_GOTREF(item); *(temps[i]) = item; } } #endif } else { Py_ssize_t index = -1; PyObject** temps[4] = {&__pyx_t_6,&__pyx_t_9,&__pyx_t_10,&__pyx_t_11}; __pyx_t_12 = PyObject_GetIter(__pyx_v_rectlike); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 403; __pyx_clineno = __LINE__; goto __pyx_L3_error;} __Pyx_GOTREF(__pyx_t_12); __pyx_t_13 = Py_TYPE(__pyx_t_12)->tp_iternext; for (index=0; index < 4; index++) { PyObject* item = __pyx_t_13(__pyx_t_12); if (unlikely(!item)) goto __pyx_L12_unpacking_failed; __Pyx_GOTREF(item); *(temps[index]) = item; } if (__Pyx_IternextUnpackEndCheck(__pyx_t_13(__pyx_t_12), 4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 403; __pyx_clineno = __LINE__; goto __pyx_L3_error;} __pyx_t_13 = NULL; __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; goto __pyx_L13_unpacking_done; __pyx_L12_unpacking_failed:; __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; __pyx_t_13 = NULL; if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 403; __pyx_clineno = __LINE__; goto __pyx_L3_error;} __pyx_L13_unpacking_done:; } __pyx_t_7 = __Pyx_PyInt_As_int(__pyx_t_6); if (unlikely((__pyx_t_7 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 403; __pyx_clineno = __LINE__; goto __pyx_L3_error;} __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __pyx_t_14 = __Pyx_PyInt_As_int(__pyx_t_9); if (unlikely((__pyx_t_14 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 403; __pyx_clineno = __LINE__; goto __pyx_L3_error;} __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; __pyx_t_15 = __Pyx_PyInt_As_int(__pyx_t_10); if (unlikely((__pyx_t_15 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 403; __pyx_clineno = __LINE__; goto __pyx_L3_error;} __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; __pyx_t_16 = __Pyx_PyInt_As_int(__pyx_t_11); if (unlikely((__pyx_t_16 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 403; __pyx_clineno = __LINE__; goto __pyx_L3_error;} __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; __pyx_v_rect->x = __pyx_t_7; __pyx_v_rect->y = __pyx_t_14; __pyx_v_rect->w = __pyx_t_15; __pyx_v_rect->h = __pyx_t_16; /* "pygame_sdl2/rect.pyx":404 * elif len(rectlike) == 4: * rect.x, rect.y, rect.w, rect.h = rectlike * return 0 # <<<<<<<<<<<<<< * * elif len(rectlike) == 2: */ __pyx_r = 0; goto __pyx_L7_try_return; /* "pygame_sdl2/rect.pyx":402 * return 0 * * elif len(rectlike) == 4: # <<<<<<<<<<<<<< * rect.x, rect.y, rect.w, rect.h = rectlike * return 0 */ } /* "pygame_sdl2/rect.pyx":406 * return 0 * * elif len(rectlike) == 2: # <<<<<<<<<<<<<< * rect.x, rect.y = rectlike * rect.w, rect.h = rectlike */ __pyx_t_8 = PyObject_Length(__pyx_v_rectlike); if (unlikely(__pyx_t_8 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 406; __pyx_clineno = __LINE__; goto __pyx_L3_error;} __pyx_t_5 = ((__pyx_t_8 == 2) != 0); if (__pyx_t_5) { /* "pygame_sdl2/rect.pyx":407 * * elif len(rectlike) == 2: * rect.x, rect.y = rectlike # <<<<<<<<<<<<<< * rect.w, rect.h = rectlike * return 0 */ if ((likely(PyTuple_CheckExact(__pyx_v_rectlike))) || (PyList_CheckExact(__pyx_v_rectlike))) { PyObject* sequence = __pyx_v_rectlike; #if CYTHON_COMPILING_IN_CPYTHON Py_ssize_t size = Py_SIZE(sequence); #else Py_ssize_t size = PySequence_Size(sequence); #endif if (unlikely(size != 2)) { if (size > 2) __Pyx_RaiseTooManyValuesError(2); else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 407; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } #if CYTHON_COMPILING_IN_CPYTHON if (likely(PyTuple_CheckExact(sequence))) { __pyx_t_11 = PyTuple_GET_ITEM(sequence, 0); __pyx_t_10 = PyTuple_GET_ITEM(sequence, 1); } else { __pyx_t_11 = PyList_GET_ITEM(sequence, 0); __pyx_t_10 = PyList_GET_ITEM(sequence, 1); } __Pyx_INCREF(__pyx_t_11); __Pyx_INCREF(__pyx_t_10); #else __pyx_t_11 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 407; __pyx_clineno = __LINE__; goto __pyx_L3_error;} __Pyx_GOTREF(__pyx_t_11); __pyx_t_10 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 407; __pyx_clineno = __LINE__; goto __pyx_L3_error;} __Pyx_GOTREF(__pyx_t_10); #endif } else { Py_ssize_t index = -1; __pyx_t_9 = PyObject_GetIter(__pyx_v_rectlike); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 407; __pyx_clineno = __LINE__; goto __pyx_L3_error;} __Pyx_GOTREF(__pyx_t_9); __pyx_t_13 = Py_TYPE(__pyx_t_9)->tp_iternext; index = 0; __pyx_t_11 = __pyx_t_13(__pyx_t_9); if (unlikely(!__pyx_t_11)) goto __pyx_L14_unpacking_failed; __Pyx_GOTREF(__pyx_t_11); index = 1; __pyx_t_10 = __pyx_t_13(__pyx_t_9); if (unlikely(!__pyx_t_10)) goto __pyx_L14_unpacking_failed; __Pyx_GOTREF(__pyx_t_10); if (__Pyx_IternextUnpackEndCheck(__pyx_t_13(__pyx_t_9), 2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 407; __pyx_clineno = __LINE__; goto __pyx_L3_error;} __pyx_t_13 = NULL; __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; goto __pyx_L15_unpacking_done; __pyx_L14_unpacking_failed:; __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; __pyx_t_13 = NULL; if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 407; __pyx_clineno = __LINE__; goto __pyx_L3_error;} __pyx_L15_unpacking_done:; } __pyx_t_16 = __Pyx_PyInt_As_int(__pyx_t_11); if (unlikely((__pyx_t_16 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 407; __pyx_clineno = __LINE__; goto __pyx_L3_error;} __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; __pyx_t_15 = __Pyx_PyInt_As_int(__pyx_t_10); if (unlikely((__pyx_t_15 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 407; __pyx_clineno = __LINE__; goto __pyx_L3_error;} __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; __pyx_v_rect->x = __pyx_t_16; __pyx_v_rect->y = __pyx_t_15; /* "pygame_sdl2/rect.pyx":408 * elif len(rectlike) == 2: * rect.x, rect.y = rectlike * rect.w, rect.h = rectlike # <<<<<<<<<<<<<< * return 0 * */ if ((likely(PyTuple_CheckExact(__pyx_v_rectlike))) || (PyList_CheckExact(__pyx_v_rectlike))) { PyObject* sequence = __pyx_v_rectlike; #if CYTHON_COMPILING_IN_CPYTHON Py_ssize_t size = Py_SIZE(sequence); #else Py_ssize_t size = PySequence_Size(sequence); #endif if (unlikely(size != 2)) { if (size > 2) __Pyx_RaiseTooManyValuesError(2); else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 408; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } #if CYTHON_COMPILING_IN_CPYTHON if (likely(PyTuple_CheckExact(sequence))) { __pyx_t_10 = PyTuple_GET_ITEM(sequence, 0); __pyx_t_11 = PyTuple_GET_ITEM(sequence, 1); } else { __pyx_t_10 = PyList_GET_ITEM(sequence, 0); __pyx_t_11 = PyList_GET_ITEM(sequence, 1); } __Pyx_INCREF(__pyx_t_10); __Pyx_INCREF(__pyx_t_11); #else __pyx_t_10 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 408; __pyx_clineno = __LINE__; goto __pyx_L3_error;} __Pyx_GOTREF(__pyx_t_10); __pyx_t_11 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 408; __pyx_clineno = __LINE__; goto __pyx_L3_error;} __Pyx_GOTREF(__pyx_t_11); #endif } else { Py_ssize_t index = -1; __pyx_t_9 = PyObject_GetIter(__pyx_v_rectlike); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 408; __pyx_clineno = __LINE__; goto __pyx_L3_error;} __Pyx_GOTREF(__pyx_t_9); __pyx_t_13 = Py_TYPE(__pyx_t_9)->tp_iternext; index = 0; __pyx_t_10 = __pyx_t_13(__pyx_t_9); if (unlikely(!__pyx_t_10)) goto __pyx_L16_unpacking_failed; __Pyx_GOTREF(__pyx_t_10); index = 1; __pyx_t_11 = __pyx_t_13(__pyx_t_9); if (unlikely(!__pyx_t_11)) goto __pyx_L16_unpacking_failed; __Pyx_GOTREF(__pyx_t_11); if (__Pyx_IternextUnpackEndCheck(__pyx_t_13(__pyx_t_9), 2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 408; __pyx_clineno = __LINE__; goto __pyx_L3_error;} __pyx_t_13 = NULL; __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; goto __pyx_L17_unpacking_done; __pyx_L16_unpacking_failed:; __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; __pyx_t_13 = NULL; if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 408; __pyx_clineno = __LINE__; goto __pyx_L3_error;} __pyx_L17_unpacking_done:; } __pyx_t_15 = __Pyx_PyInt_As_int(__pyx_t_10); if (unlikely((__pyx_t_15 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 408; __pyx_clineno = __LINE__; goto __pyx_L3_error;} __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; __pyx_t_16 = __Pyx_PyInt_As_int(__pyx_t_11); if (unlikely((__pyx_t_16 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 408; __pyx_clineno = __LINE__; goto __pyx_L3_error;} __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; __pyx_v_rect->w = __pyx_t_15; __pyx_v_rect->h = __pyx_t_16; /* "pygame_sdl2/rect.pyx":409 * rect.x, rect.y = rectlike * rect.w, rect.h = rectlike * return 0 # <<<<<<<<<<<<<< * * except: */ __pyx_r = 0; goto __pyx_L7_try_return; /* "pygame_sdl2/rect.pyx":406 * return 0 * * elif len(rectlike) == 2: # <<<<<<<<<<<<<< * rect.x, rect.y = rectlike * rect.w, rect.h = rectlike */ } /* "pygame_sdl2/rect.pyx":391 * cdef Rect rl * * try: # <<<<<<<<<<<<<< * if isinstance(rectlike, Rect): * rl = rectlike */ } __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; goto __pyx_L10_try_end; __pyx_L3_error:; __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0; __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0; __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0; __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0; /* "pygame_sdl2/rect.pyx":411 * return 0 * * except: # <<<<<<<<<<<<<< * pass * */ /*except:*/ { PyErr_Restore(0,0,0); goto __pyx_L4_exception_handled; } __pyx_L7_try_return:; /* "pygame_sdl2/rect.pyx":391 * cdef Rect rl * * try: # <<<<<<<<<<<<<< * if isinstance(rectlike, Rect): * rl = rectlike */ __Pyx_XGIVEREF(__pyx_t_1); __Pyx_XGIVEREF(__pyx_t_2); __Pyx_XGIVEREF(__pyx_t_3); __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3); goto __pyx_L0; __pyx_L4_exception_handled:; __Pyx_XGIVEREF(__pyx_t_1); __Pyx_XGIVEREF(__pyx_t_2); __Pyx_XGIVEREF(__pyx_t_3); __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3); __pyx_L10_try_end:; } /* "pygame_sdl2/rect.pyx":414 * pass * * if argname: # <<<<<<<<<<<<<< * raise TypeError("Argument {} must be a rect style object.".format(argname)) * else: */ __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_v_argname); if (unlikely(__pyx_t_5 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 414; __pyx_clineno = __LINE__; goto __pyx_L1_error;} if (__pyx_t_5) { /* "pygame_sdl2/rect.pyx":415 * * if argname: * raise TypeError("Argument {} must be a rect style object.".format(argname)) # <<<<<<<<<<<<<< * else: * raise TypeError("Argument must be a rect style object.") */ __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_kp_u_Argument_must_be_a_rect_style_ob_2, __pyx_n_s_format); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 415; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_10); __pyx_t_9 = NULL; if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_10))) { __pyx_t_9 = PyMethod_GET_SELF(__pyx_t_10); if (likely(__pyx_t_9)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_10); __Pyx_INCREF(__pyx_t_9); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_10, function); } } if (!__pyx_t_9) { __pyx_t_11 = __Pyx_PyObject_CallOneArg(__pyx_t_10, __pyx_v_argname); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 415; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_11); } else { __pyx_t_6 = PyTuple_New(1+1); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 415; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_6); __Pyx_GIVEREF(__pyx_t_9); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_9); __pyx_t_9 = NULL; __Pyx_INCREF(__pyx_v_argname); __Pyx_GIVEREF(__pyx_v_argname); PyTuple_SET_ITEM(__pyx_t_6, 0+1, __pyx_v_argname); __pyx_t_11 = __Pyx_PyObject_Call(__pyx_t_10, __pyx_t_6, NULL); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 415; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_11); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; } __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; __pyx_t_10 = PyTuple_New(1); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 415; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_10); __Pyx_GIVEREF(__pyx_t_11); PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_t_11); __pyx_t_11 = 0; __pyx_t_11 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_t_10, NULL); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 415; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_11); __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; __Pyx_Raise(__pyx_t_11, 0, 0, 0); __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; {__pyx_filename = __pyx_f[0]; __pyx_lineno = 415; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "pygame_sdl2/rect.pyx":414 * pass * * if argname: # <<<<<<<<<<<<<< * raise TypeError("Argument {} must be a rect style object.".format(argname)) * else: */ } /* "pygame_sdl2/rect.pyx":417 * raise TypeError("Argument {} must be a rect style object.".format(argname)) * else: * raise TypeError("Argument must be a rect style object.") # <<<<<<<<<<<<<< */ /*else*/ { __pyx_t_11 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__3, NULL); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 417; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_11); __Pyx_Raise(__pyx_t_11, 0, 0, 0); __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; {__pyx_filename = __pyx_f[0]; __pyx_lineno = 417; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } /* "pygame_sdl2/rect.pyx":381 * * * cdef int to_sdl_rect(rectlike, SDL_Rect *rect, argname=None) except -1: # <<<<<<<<<<<<<< * """ * Converts `rectlike` to the SDL_Rect `rect`. */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_6); __Pyx_XDECREF(__pyx_t_9); __Pyx_XDECREF(__pyx_t_10); __Pyx_XDECREF(__pyx_t_11); __Pyx_XDECREF(__pyx_t_12); __Pyx_AddTraceback("pygame_sdl2.rect.to_sdl_rect", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = -1; __pyx_L0:; __Pyx_XDECREF((PyObject *)__pyx_v_rl); __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_tp_new_11pygame_sdl2_4rect_Rect(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) { PyObject *o; if (likely((t->tp_flags & Py_TPFLAGS_IS_ABSTRACT) == 0)) { o = (*t->tp_alloc)(t, 0); } else { o = (PyObject *) PyBaseObject_Type.tp_new(t, __pyx_empty_tuple, 0); } if (unlikely(!o)) return 0; return o; } static void __pyx_tp_dealloc_11pygame_sdl2_4rect_Rect(PyObject *o) { struct __pyx_obj_11pygame_sdl2_4rect_Rect *p = (struct __pyx_obj_11pygame_sdl2_4rect_Rect *)o; #if PY_VERSION_HEX >= 0x030400a1 if (unlikely(Py_TYPE(o)->tp_finalize) && (!PyType_IS_GC(Py_TYPE(o)) || !_PyGC_FINALIZED(o))) { if (PyObject_CallFinalizerFromDealloc(o)) return; } #endif if (p->__weakref__) PyObject_ClearWeakRefs(o); (*Py_TYPE(o)->tp_free)(o); } static PyObject *__pyx_sq_item_11pygame_sdl2_4rect_Rect(PyObject *o, Py_ssize_t i) { PyObject *r; PyObject *x = PyInt_FromSsize_t(i); if(!x) return 0; r = Py_TYPE(o)->tp_as_mapping->mp_subscript(o, x); Py_DECREF(x); return r; } static int __pyx_mp_ass_subscript_11pygame_sdl2_4rect_Rect(PyObject *o, PyObject *i, PyObject *v) { if (v) { return __pyx_pw_11pygame_sdl2_4rect_4Rect_15__setitem__(o, i, v); } else { PyErr_Format(PyExc_NotImplementedError, "Subscript deletion not supported by %.200s", Py_TYPE(o)->tp_name); return -1; } } static PyObject *__pyx_getprop_11pygame_sdl2_4rect_4Rect_left(PyObject *o, CYTHON_UNUSED void *x) { return __pyx_pw_11pygame_sdl2_4rect_4Rect_4left_1__get__(o); } static int __pyx_setprop_11pygame_sdl2_4rect_4Rect_left(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) { if (v) { return __pyx_pw_11pygame_sdl2_4rect_4Rect_4left_3__set__(o, v); } else { PyErr_SetString(PyExc_NotImplementedError, "__del__"); return -1; } } static PyObject *__pyx_getprop_11pygame_sdl2_4rect_4Rect_top(PyObject *o, CYTHON_UNUSED void *x) { return __pyx_pw_11pygame_sdl2_4rect_4Rect_3top_1__get__(o); } static int __pyx_setprop_11pygame_sdl2_4rect_4Rect_top(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) { if (v) { return __pyx_pw_11pygame_sdl2_4rect_4Rect_3top_3__set__(o, v); } else { PyErr_SetString(PyExc_NotImplementedError, "__del__"); return -1; } } static PyObject *__pyx_getprop_11pygame_sdl2_4rect_4Rect_width(PyObject *o, CYTHON_UNUSED void *x) { return __pyx_pw_11pygame_sdl2_4rect_4Rect_5width_1__get__(o); } static int __pyx_setprop_11pygame_sdl2_4rect_4Rect_width(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) { if (v) { return __pyx_pw_11pygame_sdl2_4rect_4Rect_5width_3__set__(o, v); } else { PyErr_SetString(PyExc_NotImplementedError, "__del__"); return -1; } } static PyObject *__pyx_getprop_11pygame_sdl2_4rect_4Rect_height(PyObject *o, CYTHON_UNUSED void *x) { return __pyx_pw_11pygame_sdl2_4rect_4Rect_6height_1__get__(o); } static int __pyx_setprop_11pygame_sdl2_4rect_4Rect_height(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) { if (v) { return __pyx_pw_11pygame_sdl2_4rect_4Rect_6height_3__set__(o, v); } else { PyErr_SetString(PyExc_NotImplementedError, "__del__"); return -1; } } static PyObject *__pyx_getprop_11pygame_sdl2_4rect_4Rect_right(PyObject *o, CYTHON_UNUSED void *x) { return __pyx_pw_11pygame_sdl2_4rect_4Rect_5right_1__get__(o); } static int __pyx_setprop_11pygame_sdl2_4rect_4Rect_right(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) { if (v) { return __pyx_pw_11pygame_sdl2_4rect_4Rect_5right_3__set__(o, v); } else { PyErr_SetString(PyExc_NotImplementedError, "__del__"); return -1; } } static PyObject *__pyx_getprop_11pygame_sdl2_4rect_4Rect_bottom(PyObject *o, CYTHON_UNUSED void *x) { return __pyx_pw_11pygame_sdl2_4rect_4Rect_6bottom_1__get__(o); } static int __pyx_setprop_11pygame_sdl2_4rect_4Rect_bottom(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) { if (v) { return __pyx_pw_11pygame_sdl2_4rect_4Rect_6bottom_3__set__(o, v); } else { PyErr_SetString(PyExc_NotImplementedError, "__del__"); return -1; } } static PyObject *__pyx_getprop_11pygame_sdl2_4rect_4Rect_size(PyObject *o, CYTHON_UNUSED void *x) { return __pyx_pw_11pygame_sdl2_4rect_4Rect_4size_1__get__(o); } static int __pyx_setprop_11pygame_sdl2_4rect_4Rect_size(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) { if (v) { return __pyx_pw_11pygame_sdl2_4rect_4Rect_4size_3__set__(o, v); } else { PyErr_SetString(PyExc_NotImplementedError, "__del__"); return -1; } } static PyObject *__pyx_getprop_11pygame_sdl2_4rect_4Rect_topleft(PyObject *o, CYTHON_UNUSED void *x) { return __pyx_pw_11pygame_sdl2_4rect_4Rect_7topleft_1__get__(o); } static int __pyx_setprop_11pygame_sdl2_4rect_4Rect_topleft(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) { if (v) { return __pyx_pw_11pygame_sdl2_4rect_4Rect_7topleft_3__set__(o, v); } else { PyErr_SetString(PyExc_NotImplementedError, "__del__"); return -1; } } static PyObject *__pyx_getprop_11pygame_sdl2_4rect_4Rect_topright(PyObject *o, CYTHON_UNUSED void *x) { return __pyx_pw_11pygame_sdl2_4rect_4Rect_8topright_1__get__(o); } static int __pyx_setprop_11pygame_sdl2_4rect_4Rect_topright(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) { if (v) { return __pyx_pw_11pygame_sdl2_4rect_4Rect_8topright_3__set__(o, v); } else { PyErr_SetString(PyExc_NotImplementedError, "__del__"); return -1; } } static PyObject *__pyx_getprop_11pygame_sdl2_4rect_4Rect_bottomright(PyObject *o, CYTHON_UNUSED void *x) { return __pyx_pw_11pygame_sdl2_4rect_4Rect_11bottomright_1__get__(o); } static int __pyx_setprop_11pygame_sdl2_4rect_4Rect_bottomright(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) { if (v) { return __pyx_pw_11pygame_sdl2_4rect_4Rect_11bottomright_3__set__(o, v); } else { PyErr_SetString(PyExc_NotImplementedError, "__del__"); return -1; } } static PyObject *__pyx_getprop_11pygame_sdl2_4rect_4Rect_bottomleft(PyObject *o, CYTHON_UNUSED void *x) { return __pyx_pw_11pygame_sdl2_4rect_4Rect_10bottomleft_1__get__(o); } static int __pyx_setprop_11pygame_sdl2_4rect_4Rect_bottomleft(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) { if (v) { return __pyx_pw_11pygame_sdl2_4rect_4Rect_10bottomleft_3__set__(o, v); } else { PyErr_SetString(PyExc_NotImplementedError, "__del__"); return -1; } } static PyObject *__pyx_getprop_11pygame_sdl2_4rect_4Rect_centerx(PyObject *o, CYTHON_UNUSED void *x) { return __pyx_pw_11pygame_sdl2_4rect_4Rect_7centerx_1__get__(o); } static int __pyx_setprop_11pygame_sdl2_4rect_4Rect_centerx(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) { if (v) { return __pyx_pw_11pygame_sdl2_4rect_4Rect_7centerx_3__set__(o, v); } else { PyErr_SetString(PyExc_NotImplementedError, "__del__"); return -1; } } static PyObject *__pyx_getprop_11pygame_sdl2_4rect_4Rect_centery(PyObject *o, CYTHON_UNUSED void *x) { return __pyx_pw_11pygame_sdl2_4rect_4Rect_7centery_1__get__(o); } static int __pyx_setprop_11pygame_sdl2_4rect_4Rect_centery(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) { if (v) { return __pyx_pw_11pygame_sdl2_4rect_4Rect_7centery_3__set__(o, v); } else { PyErr_SetString(PyExc_NotImplementedError, "__del__"); return -1; } } static PyObject *__pyx_getprop_11pygame_sdl2_4rect_4Rect_center(PyObject *o, CYTHON_UNUSED void *x) { return __pyx_pw_11pygame_sdl2_4rect_4Rect_6center_1__get__(o); } static int __pyx_setprop_11pygame_sdl2_4rect_4Rect_center(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) { if (v) { return __pyx_pw_11pygame_sdl2_4rect_4Rect_6center_3__set__(o, v); } else { PyErr_SetString(PyExc_NotImplementedError, "__del__"); return -1; } } static PyObject *__pyx_getprop_11pygame_sdl2_4rect_4Rect_midtop(PyObject *o, CYTHON_UNUSED void *x) { return __pyx_pw_11pygame_sdl2_4rect_4Rect_6midtop_1__get__(o); } static int __pyx_setprop_11pygame_sdl2_4rect_4Rect_midtop(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) { if (v) { return __pyx_pw_11pygame_sdl2_4rect_4Rect_6midtop_3__set__(o, v); } else { PyErr_SetString(PyExc_NotImplementedError, "__del__"); return -1; } } static PyObject *__pyx_getprop_11pygame_sdl2_4rect_4Rect_midleft(PyObject *o, CYTHON_UNUSED void *x) { return __pyx_pw_11pygame_sdl2_4rect_4Rect_7midleft_1__get__(o); } static int __pyx_setprop_11pygame_sdl2_4rect_4Rect_midleft(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) { if (v) { return __pyx_pw_11pygame_sdl2_4rect_4Rect_7midleft_3__set__(o, v); } else { PyErr_SetString(PyExc_NotImplementedError, "__del__"); return -1; } } static PyObject *__pyx_getprop_11pygame_sdl2_4rect_4Rect_midbottom(PyObject *o, CYTHON_UNUSED void *x) { return __pyx_pw_11pygame_sdl2_4rect_4Rect_9midbottom_1__get__(o); } static int __pyx_setprop_11pygame_sdl2_4rect_4Rect_midbottom(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) { if (v) { return __pyx_pw_11pygame_sdl2_4rect_4Rect_9midbottom_3__set__(o, v); } else { PyErr_SetString(PyExc_NotImplementedError, "__del__"); return -1; } } static PyObject *__pyx_getprop_11pygame_sdl2_4rect_4Rect_midright(PyObject *o, CYTHON_UNUSED void *x) { return __pyx_pw_11pygame_sdl2_4rect_4Rect_8midright_1__get__(o); } static int __pyx_setprop_11pygame_sdl2_4rect_4Rect_midright(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) { if (v) { return __pyx_pw_11pygame_sdl2_4rect_4Rect_8midright_3__set__(o, v); } else { PyErr_SetString(PyExc_NotImplementedError, "__del__"); return -1; } } static PyObject *__pyx_getprop_11pygame_sdl2_4rect_4Rect_x(PyObject *o, CYTHON_UNUSED void *x) { return __pyx_pw_11pygame_sdl2_4rect_4Rect_1x_1__get__(o); } static int __pyx_setprop_11pygame_sdl2_4rect_4Rect_x(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) { if (v) { return __pyx_pw_11pygame_sdl2_4rect_4Rect_1x_3__set__(o, v); } else { PyErr_SetString(PyExc_NotImplementedError, "__del__"); return -1; } } static PyObject *__pyx_getprop_11pygame_sdl2_4rect_4Rect_y(PyObject *o, CYTHON_UNUSED void *x) { return __pyx_pw_11pygame_sdl2_4rect_4Rect_1y_1__get__(o); } static int __pyx_setprop_11pygame_sdl2_4rect_4Rect_y(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) { if (v) { return __pyx_pw_11pygame_sdl2_4rect_4Rect_1y_3__set__(o, v); } else { PyErr_SetString(PyExc_NotImplementedError, "__del__"); return -1; } } static PyObject *__pyx_getprop_11pygame_sdl2_4rect_4Rect_w(PyObject *o, CYTHON_UNUSED void *x) { return __pyx_pw_11pygame_sdl2_4rect_4Rect_1w_1__get__(o); } static int __pyx_setprop_11pygame_sdl2_4rect_4Rect_w(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) { if (v) { return __pyx_pw_11pygame_sdl2_4rect_4Rect_1w_3__set__(o, v); } else { PyErr_SetString(PyExc_NotImplementedError, "__del__"); return -1; } } static PyObject *__pyx_getprop_11pygame_sdl2_4rect_4Rect_h(PyObject *o, CYTHON_UNUSED void *x) { return __pyx_pw_11pygame_sdl2_4rect_4Rect_1h_1__get__(o); } static int __pyx_setprop_11pygame_sdl2_4rect_4Rect_h(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) { if (v) { return __pyx_pw_11pygame_sdl2_4rect_4Rect_1h_3__set__(o, v); } else { PyErr_SetString(PyExc_NotImplementedError, "__del__"); return -1; } } static PyMethodDef __pyx_methods_11pygame_sdl2_4rect_Rect[] = { {"__reduce__", (PyCFunction)__pyx_pw_11pygame_sdl2_4rect_4Rect_3__reduce__, METH_NOARGS, 0}, {"copy", (PyCFunction)__pyx_pw_11pygame_sdl2_4rect_4Rect_17copy, METH_NOARGS, 0}, {"move", (PyCFunction)__pyx_pw_11pygame_sdl2_4rect_4Rect_19move, METH_VARARGS|METH_KEYWORDS, 0}, {"move_ip", (PyCFunction)__pyx_pw_11pygame_sdl2_4rect_4Rect_21move_ip, METH_VARARGS|METH_KEYWORDS, 0}, {"inflate", (PyCFunction)__pyx_pw_11pygame_sdl2_4rect_4Rect_23inflate, METH_VARARGS|METH_KEYWORDS, 0}, {"inflate_ip", (PyCFunction)__pyx_pw_11pygame_sdl2_4rect_4Rect_25inflate_ip, METH_VARARGS|METH_KEYWORDS, 0}, {"clamp", (PyCFunction)__pyx_pw_11pygame_sdl2_4rect_4Rect_27clamp, METH_O, 0}, {"clamp_ip", (PyCFunction)__pyx_pw_11pygame_sdl2_4rect_4Rect_29clamp_ip, METH_O, 0}, {"clip", (PyCFunction)__pyx_pw_11pygame_sdl2_4rect_4Rect_31clip, METH_VARARGS|METH_KEYWORDS, 0}, {"union", (PyCFunction)__pyx_pw_11pygame_sdl2_4rect_4Rect_33union, METH_O, 0}, {"union_ip", (PyCFunction)__pyx_pw_11pygame_sdl2_4rect_4Rect_35union_ip, METH_O, 0}, {"unionall", (PyCFunction)__pyx_pw_11pygame_sdl2_4rect_4Rect_37unionall, METH_O, 0}, {"unionall_ip", (PyCFunction)__pyx_pw_11pygame_sdl2_4rect_4Rect_39unionall_ip, METH_O, 0}, {"fit", (PyCFunction)__pyx_pw_11pygame_sdl2_4rect_4Rect_41fit, METH_O, 0}, {"normalize", (PyCFunction)__pyx_pw_11pygame_sdl2_4rect_4Rect_43normalize, METH_NOARGS, 0}, {"contains", (PyCFunction)__pyx_pw_11pygame_sdl2_4rect_4Rect_45contains, METH_O, 0}, {"collidepoint", (PyCFunction)__pyx_pw_11pygame_sdl2_4rect_4Rect_47collidepoint, METH_VARARGS|METH_KEYWORDS, 0}, {"colliderect", (PyCFunction)__pyx_pw_11pygame_sdl2_4rect_4Rect_49colliderect, METH_O, 0}, {"collidelist", (PyCFunction)__pyx_pw_11pygame_sdl2_4rect_4Rect_51collidelist, METH_O, 0}, {"collidelistall", (PyCFunction)__pyx_pw_11pygame_sdl2_4rect_4Rect_53collidelistall, METH_O, 0}, {"collidedict", (PyCFunction)__pyx_pw_11pygame_sdl2_4rect_4Rect_55collidedict, METH_VARARGS|METH_KEYWORDS, 0}, {"collidedictall", (PyCFunction)__pyx_pw_11pygame_sdl2_4rect_4Rect_57collidedictall, METH_VARARGS|METH_KEYWORDS, 0}, {0, 0, 0, 0} }; static struct PyGetSetDef __pyx_getsets_11pygame_sdl2_4rect_Rect[] = { {(char *)"left", __pyx_getprop_11pygame_sdl2_4rect_4Rect_left, __pyx_setprop_11pygame_sdl2_4rect_4Rect_left, 0, 0}, {(char *)"top", __pyx_getprop_11pygame_sdl2_4rect_4Rect_top, __pyx_setprop_11pygame_sdl2_4rect_4Rect_top, 0, 0}, {(char *)"width", __pyx_getprop_11pygame_sdl2_4rect_4Rect_width, __pyx_setprop_11pygame_sdl2_4rect_4Rect_width, 0, 0}, {(char *)"height", __pyx_getprop_11pygame_sdl2_4rect_4Rect_height, __pyx_setprop_11pygame_sdl2_4rect_4Rect_height, 0, 0}, {(char *)"right", __pyx_getprop_11pygame_sdl2_4rect_4Rect_right, __pyx_setprop_11pygame_sdl2_4rect_4Rect_right, 0, 0}, {(char *)"bottom", __pyx_getprop_11pygame_sdl2_4rect_4Rect_bottom, __pyx_setprop_11pygame_sdl2_4rect_4Rect_bottom, 0, 0}, {(char *)"size", __pyx_getprop_11pygame_sdl2_4rect_4Rect_size, __pyx_setprop_11pygame_sdl2_4rect_4Rect_size, 0, 0}, {(char *)"topleft", __pyx_getprop_11pygame_sdl2_4rect_4Rect_topleft, __pyx_setprop_11pygame_sdl2_4rect_4Rect_topleft, 0, 0}, {(char *)"topright", __pyx_getprop_11pygame_sdl2_4rect_4Rect_topright, __pyx_setprop_11pygame_sdl2_4rect_4Rect_topright, 0, 0}, {(char *)"bottomright", __pyx_getprop_11pygame_sdl2_4rect_4Rect_bottomright, __pyx_setprop_11pygame_sdl2_4rect_4Rect_bottomright, 0, 0}, {(char *)"bottomleft", __pyx_getprop_11pygame_sdl2_4rect_4Rect_bottomleft, __pyx_setprop_11pygame_sdl2_4rect_4Rect_bottomleft, 0, 0}, {(char *)"centerx", __pyx_getprop_11pygame_sdl2_4rect_4Rect_centerx, __pyx_setprop_11pygame_sdl2_4rect_4Rect_centerx, 0, 0}, {(char *)"centery", __pyx_getprop_11pygame_sdl2_4rect_4Rect_centery, __pyx_setprop_11pygame_sdl2_4rect_4Rect_centery, 0, 0}, {(char *)"center", __pyx_getprop_11pygame_sdl2_4rect_4Rect_center, __pyx_setprop_11pygame_sdl2_4rect_4Rect_center, 0, 0}, {(char *)"midtop", __pyx_getprop_11pygame_sdl2_4rect_4Rect_midtop, __pyx_setprop_11pygame_sdl2_4rect_4Rect_midtop, 0, 0}, {(char *)"midleft", __pyx_getprop_11pygame_sdl2_4rect_4Rect_midleft, __pyx_setprop_11pygame_sdl2_4rect_4Rect_midleft, 0, 0}, {(char *)"midbottom", __pyx_getprop_11pygame_sdl2_4rect_4Rect_midbottom, __pyx_setprop_11pygame_sdl2_4rect_4Rect_midbottom, 0, 0}, {(char *)"midright", __pyx_getprop_11pygame_sdl2_4rect_4Rect_midright, __pyx_setprop_11pygame_sdl2_4rect_4Rect_midright, 0, 0}, {(char *)"x", __pyx_getprop_11pygame_sdl2_4rect_4Rect_x, __pyx_setprop_11pygame_sdl2_4rect_4Rect_x, 0, 0}, {(char *)"y", __pyx_getprop_11pygame_sdl2_4rect_4Rect_y, __pyx_setprop_11pygame_sdl2_4rect_4Rect_y, 0, 0}, {(char *)"w", __pyx_getprop_11pygame_sdl2_4rect_4Rect_w, __pyx_setprop_11pygame_sdl2_4rect_4Rect_w, 0, 0}, {(char *)"h", __pyx_getprop_11pygame_sdl2_4rect_4Rect_h, __pyx_setprop_11pygame_sdl2_4rect_4Rect_h, 0, 0}, {0, 0, 0, 0, 0} }; static PySequenceMethods __pyx_tp_as_sequence_Rect = { __pyx_pw_11pygame_sdl2_4rect_4Rect_7__len__, /*sq_length*/ 0, /*sq_concat*/ 0, /*sq_repeat*/ __pyx_sq_item_11pygame_sdl2_4rect_Rect, /*sq_item*/ 0, /*sq_slice*/ 0, /*sq_ass_item*/ 0, /*sq_ass_slice*/ 0, /*sq_contains*/ 0, /*sq_inplace_concat*/ 0, /*sq_inplace_repeat*/ }; static PyMappingMethods __pyx_tp_as_mapping_Rect = { __pyx_pw_11pygame_sdl2_4rect_4Rect_7__len__, /*mp_length*/ __pyx_pw_11pygame_sdl2_4rect_4Rect_13__getitem__, /*mp_subscript*/ __pyx_mp_ass_subscript_11pygame_sdl2_4rect_Rect, /*mp_ass_subscript*/ }; static PyTypeObject __pyx_type_11pygame_sdl2_4rect_Rect = { PyVarObject_HEAD_INIT(0, 0) "pygame_sdl2.rect.Rect", /*tp_name*/ sizeof(struct __pyx_obj_11pygame_sdl2_4rect_Rect), /*tp_basicsize*/ 0, /*tp_itemsize*/ __pyx_tp_dealloc_11pygame_sdl2_4rect_Rect, /*tp_dealloc*/ 0, /*tp_print*/ 0, /*tp_getattr*/ 0, /*tp_setattr*/ #if PY_MAJOR_VERSION < 3 0, /*tp_compare*/ #endif #if PY_MAJOR_VERSION >= 3 0, /*tp_as_async*/ #endif __pyx_pw_11pygame_sdl2_4rect_4Rect_5__repr__, /*tp_repr*/ 0, /*tp_as_number*/ &__pyx_tp_as_sequence_Rect, /*tp_as_sequence*/ &__pyx_tp_as_mapping_Rect, /*tp_as_mapping*/ 0, /*tp_hash*/ 0, /*tp_call*/ 0, /*tp_str*/ 0, /*tp_getattro*/ 0, /*tp_setattro*/ 0, /*tp_as_buffer*/ Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE, /*tp_flags*/ 0, /*tp_doc*/ 0, /*tp_traverse*/ 0, /*tp_clear*/ __pyx_pw_11pygame_sdl2_4rect_4Rect_11__richcmp__, /*tp_richcompare*/ 0, /*tp_weaklistoffset*/ __pyx_pw_11pygame_sdl2_4rect_4Rect_9__iter__, /*tp_iter*/ 0, /*tp_iternext*/ __pyx_methods_11pygame_sdl2_4rect_Rect, /*tp_methods*/ 0, /*tp_members*/ __pyx_getsets_11pygame_sdl2_4rect_Rect, /*tp_getset*/ 0, /*tp_base*/ 0, /*tp_dict*/ 0, /*tp_descr_get*/ 0, /*tp_descr_set*/ 0, /*tp_dictoffset*/ __pyx_pw_11pygame_sdl2_4rect_4Rect_1__init__, /*tp_init*/ 0, /*tp_alloc*/ __pyx_tp_new_11pygame_sdl2_4rect_Rect, /*tp_new*/ 0, /*tp_free*/ 0, /*tp_is_gc*/ 0, /*tp_bases*/ 0, /*tp_mro*/ 0, /*tp_cache*/ 0, /*tp_subclasses*/ 0, /*tp_weaklist*/ 0, /*tp_del*/ 0, /*tp_version_tag*/ #if PY_VERSION_HEX >= 0x030400a1 0, /*tp_finalize*/ #endif }; static PyMethodDef __pyx_methods[] = { {0, 0, 0, 0} }; #if PY_MAJOR_VERSION >= 3 static struct PyModuleDef __pyx_moduledef = { #if PY_VERSION_HEX < 0x03020000 { PyObject_HEAD_INIT(NULL) NULL, 0, NULL }, #else PyModuleDef_HEAD_INIT, #endif "rect", 0, /* m_doc */ -1, /* m_size */ __pyx_methods /* m_methods */, NULL, /* m_reload */ NULL, /* m_traverse */ NULL, /* m_clear */ NULL /* m_free */ }; #endif static __Pyx_StringTabEntry __pyx_string_tab[] = { {&__pyx_kp_u_Argument_must_be_a_rect_style_ob, __pyx_k_Argument_must_be_a_rect_style_ob, sizeof(__pyx_k_Argument_must_be_a_rect_style_ob), 0, 1, 0, 0}, {&__pyx_kp_u_Argument_must_be_a_rect_style_ob_2, __pyx_k_Argument_must_be_a_rect_style_ob_2, sizeof(__pyx_k_Argument_must_be_a_rect_style_ob_2), 0, 1, 0, 0}, {&__pyx_n_s_IndexError, __pyx_k_IndexError, sizeof(__pyx_k_IndexError), 0, 0, 1, 1}, {&__pyx_n_s_TypeError, __pyx_k_TypeError, sizeof(__pyx_k_TypeError), 0, 0, 1, 1}, {&__pyx_n_s_args, __pyx_k_args, sizeof(__pyx_k_args), 0, 0, 1, 1}, {&__pyx_n_s_bottom, __pyx_k_bottom, sizeof(__pyx_k_bottom), 0, 0, 1, 1}, {&__pyx_n_s_center, __pyx_k_center, sizeof(__pyx_k_center), 0, 0, 1, 1}, {&__pyx_n_s_centerx, __pyx_k_centerx, sizeof(__pyx_k_centerx), 0, 0, 1, 1}, {&__pyx_n_s_centery, __pyx_k_centery, sizeof(__pyx_k_centery), 0, 0, 1, 1}, {&__pyx_n_s_clamp_ip, __pyx_k_clamp_ip, sizeof(__pyx_k_clamp_ip), 0, 0, 1, 1}, {&__pyx_n_s_collections, __pyx_k_collections, sizeof(__pyx_k_collections), 0, 0, 1, 1}, {&__pyx_n_s_colliderect, __pyx_k_colliderect, sizeof(__pyx_k_colliderect), 0, 0, 1, 1}, {&__pyx_n_s_copy, __pyx_k_copy, sizeof(__pyx_k_copy), 0, 0, 1, 1}, {&__pyx_n_s_flatten, __pyx_k_flatten, sizeof(__pyx_k_flatten), 0, 0, 1, 1}, {&__pyx_n_s_format, __pyx_k_format, sizeof(__pyx_k_format), 0, 0, 1, 1}, {&__pyx_n_s_h, __pyx_k_h, sizeof(__pyx_k_h), 0, 0, 1, 1}, {&__pyx_n_s_height, __pyx_k_height, sizeof(__pyx_k_height), 0, 0, 1, 1}, {&__pyx_kp_s_home_tom_ab_pygame_sdl2_src_pyg, __pyx_k_home_tom_ab_pygame_sdl2_src_pyg, sizeof(__pyx_k_home_tom_ab_pygame_sdl2_src_pyg), 0, 0, 1, 0}, {&__pyx_n_s_import, __pyx_k_import, sizeof(__pyx_k_import), 0, 0, 1, 1}, {&__pyx_n_s_inflate_ip, __pyx_k_inflate_ip, sizeof(__pyx_k_inflate_ip), 0, 0, 1, 1}, {&__pyx_n_s_iteritems, __pyx_k_iteritems, sizeof(__pyx_k_iteritems), 0, 0, 1, 1}, {&__pyx_n_s_left, __pyx_k_left, sizeof(__pyx_k_left), 0, 0, 1, 1}, {&__pyx_n_s_main, __pyx_k_main, sizeof(__pyx_k_main), 0, 0, 1, 1}, {&__pyx_n_s_move_ip, __pyx_k_move_ip, sizeof(__pyx_k_move_ip), 0, 0, 1, 1}, {&__pyx_n_s_other, __pyx_k_other, sizeof(__pyx_k_other), 0, 0, 1, 1}, {&__pyx_n_s_other_dict, __pyx_k_other_dict, sizeof(__pyx_k_other_dict), 0, 0, 1, 1}, {&__pyx_n_s_pygame_sdl2_rect, __pyx_k_pygame_sdl2_rect, sizeof(__pyx_k_pygame_sdl2_rect), 0, 0, 1, 1}, {&__pyx_n_s_range, __pyx_k_range, sizeof(__pyx_k_range), 0, 0, 1, 1}, {&__pyx_kp_u_rect_d_d_d_d, __pyx_k_rect_d_d_d_d, sizeof(__pyx_k_rect_d_d_d_d), 0, 1, 0, 0}, {&__pyx_n_s_rects_values, __pyx_k_rects_values, sizeof(__pyx_k_rects_values), 0, 0, 1, 1}, {&__pyx_n_s_right, __pyx_k_right, sizeof(__pyx_k_right), 0, 0, 1, 1}, {&__pyx_n_s_test, __pyx_k_test, sizeof(__pyx_k_test), 0, 0, 1, 1}, {&__pyx_n_s_top, __pyx_k_top, sizeof(__pyx_k_top), 0, 0, 1, 1}, {&__pyx_n_s_topleft, __pyx_k_topleft, sizeof(__pyx_k_topleft), 0, 0, 1, 1}, {&__pyx_n_s_union_ip, __pyx_k_union_ip, sizeof(__pyx_k_union_ip), 0, 0, 1, 1}, {&__pyx_n_s_unionall_ip, __pyx_k_unionall_ip, sizeof(__pyx_k_unionall_ip), 0, 0, 1, 1}, {&__pyx_n_s_w, __pyx_k_w, sizeof(__pyx_k_w), 0, 0, 1, 1}, {&__pyx_n_s_width, __pyx_k_width, sizeof(__pyx_k_width), 0, 0, 1, 1}, {&__pyx_n_s_x, __pyx_k_x, sizeof(__pyx_k_x), 0, 0, 1, 1}, {&__pyx_n_s_y, __pyx_k_y, sizeof(__pyx_k_y), 0, 0, 1, 1}, {&__pyx_n_s_zip, __pyx_k_zip, sizeof(__pyx_k_zip), 0, 0, 1, 1}, {0, 0, 0, 0, 0, 0, 0} }; static int __Pyx_InitCachedBuiltins(void) { __pyx_builtin_TypeError = __Pyx_GetBuiltinName(__pyx_n_s_TypeError); if (!__pyx_builtin_TypeError) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 61; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_builtin_IndexError = __Pyx_GetBuiltinName(__pyx_n_s_IndexError); if (!__pyx_builtin_IndexError) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 99; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_builtin_zip = __Pyx_GetBuiltinName(__pyx_n_s_zip); if (!__pyx_builtin_zip) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 354; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_builtin_range = __Pyx_GetBuiltinName(__pyx_n_s_range); if (!__pyx_builtin_range) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 354; __pyx_clineno = __LINE__; goto __pyx_L1_error;} return 0; __pyx_L1_error:; return -1; } static int __Pyx_InitCachedConstants(void) { __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__Pyx_InitCachedConstants", 0); /* "pygame_sdl2/rect.pyx":61 * * else: * raise TypeError("Argument must be a rect style object.") # <<<<<<<<<<<<<< * * self.x = x */ __pyx_tuple_ = PyTuple_Pack(1, __pyx_kp_u_Argument_must_be_a_rect_style_ob); if (unlikely(!__pyx_tuple_)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 61; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_tuple_); __Pyx_GIVEREF(__pyx_tuple_); /* "pygame_sdl2/rect.pyx":263 * * if not self.colliderect(other): * return Rect(0,0,0,0) # <<<<<<<<<<<<<< * * r = self.copy() */ __pyx_tuple__2 = PyTuple_Pack(4, __pyx_int_0, __pyx_int_0, __pyx_int_0, __pyx_int_0); if (unlikely(!__pyx_tuple__2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 263; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_tuple__2); __Pyx_GIVEREF(__pyx_tuple__2); /* "pygame_sdl2/rect.pyx":417 * raise TypeError("Argument {} must be a rect style object.".format(argname)) * else: * raise TypeError("Argument must be a rect style object.") # <<<<<<<<<<<<<< */ __pyx_tuple__3 = PyTuple_Pack(1, __pyx_kp_u_Argument_must_be_a_rect_style_ob); if (unlikely(!__pyx_tuple__3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 417; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_tuple__3); __Pyx_GIVEREF(__pyx_tuple__3); /* "pygame_sdl2/rect.pyx":22 * import collections * * def flatten(*args): # <<<<<<<<<<<<<< * if len(args) == 1: * return args[0] */ __pyx_tuple__4 = PyTuple_Pack(1, __pyx_n_s_args); if (unlikely(!__pyx_tuple__4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 22; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_tuple__4); __Pyx_GIVEREF(__pyx_tuple__4); __pyx_codeobj__5 = (PyObject*)__Pyx_PyCode_New(0, 0, 1, 0, CO_VARARGS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__4, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_tom_ab_pygame_sdl2_src_pyg, __pyx_n_s_flatten, 22, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 22; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_RefNannyFinishContext(); return 0; __pyx_L1_error:; __Pyx_RefNannyFinishContext(); return -1; } static int __Pyx_InitGlobals(void) { if (__Pyx_InitStrings(__pyx_string_tab) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; __pyx_int_0 = PyInt_FromLong(0); if (unlikely(!__pyx_int_0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_int_1 = PyInt_FromLong(1); if (unlikely(!__pyx_int_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_int_2 = PyInt_FromLong(2); if (unlikely(!__pyx_int_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_int_3 = PyInt_FromLong(3); if (unlikely(!__pyx_int_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_int_neg_1 = PyInt_FromLong(-1); if (unlikely(!__pyx_int_neg_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} return 0; __pyx_L1_error:; return -1; } #if PY_MAJOR_VERSION < 3 PyMODINIT_FUNC initrect(void); /*proto*/ PyMODINIT_FUNC initrect(void) #else PyMODINIT_FUNC PyInit_rect(void); /*proto*/ PyMODINIT_FUNC PyInit_rect(void) #endif { PyObject *__pyx_t_1 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannyDeclarations #if CYTHON_REFNANNY __Pyx_RefNanny = __Pyx_RefNannyImportAPI("refnanny"); if (!__Pyx_RefNanny) { PyErr_Clear(); __Pyx_RefNanny = __Pyx_RefNannyImportAPI("Cython.Runtime.refnanny"); if (!__Pyx_RefNanny) Py_FatalError("failed to import 'refnanny' module"); } #endif __Pyx_RefNannySetupContext("PyMODINIT_FUNC PyInit_rect(void)", 0); if (__Pyx_check_binary_version() < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_empty_tuple = PyTuple_New(0); if (unlikely(!__pyx_empty_tuple)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_empty_bytes = PyBytes_FromStringAndSize("", 0); if (unlikely(!__pyx_empty_bytes)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} #ifdef __Pyx_CyFunction_USED if (__pyx_CyFunction_init() < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} #endif #ifdef __Pyx_FusedFunction_USED if (__pyx_FusedFunction_init() < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} #endif #ifdef __Pyx_Coroutine_USED if (__pyx_Coroutine_init() < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} #endif #ifdef __Pyx_Generator_USED if (__pyx_Generator_init() < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} #endif #ifdef __Pyx_StopAsyncIteration_USED if (__pyx_StopAsyncIteration_init() < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} #endif /*--- Library function declarations ---*/ /*--- Threads initialization code ---*/ #if defined(__PYX_FORCE_INIT_THREADS) && __PYX_FORCE_INIT_THREADS #ifdef WITH_THREAD /* Python build with threading support? */ PyEval_InitThreads(); #endif #endif /*--- Module creation code ---*/ #if PY_MAJOR_VERSION < 3 __pyx_m = Py_InitModule4("rect", __pyx_methods, 0, 0, PYTHON_API_VERSION); Py_XINCREF(__pyx_m); #else __pyx_m = PyModule_Create(&__pyx_moduledef); #endif if (unlikely(!__pyx_m)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_d = PyModule_GetDict(__pyx_m); if (unlikely(!__pyx_d)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} Py_INCREF(__pyx_d); __pyx_b = PyImport_AddModule(__Pyx_BUILTIN_MODULE_NAME); if (unlikely(!__pyx_b)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} #if CYTHON_COMPILING_IN_PYPY Py_INCREF(__pyx_b); #endif if (PyObject_SetAttrString(__pyx_m, "__builtins__", __pyx_b) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; /*--- Initialize various global constants etc. ---*/ if (__Pyx_InitGlobals() < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} #if PY_MAJOR_VERSION < 3 && (__PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT) if (__Pyx_init_sys_getdefaultencoding_params() < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} #endif if (__pyx_module_is_main_pygame_sdl2__rect) { if (PyObject_SetAttrString(__pyx_m, "__name__", __pyx_n_s_main) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } #if PY_MAJOR_VERSION >= 3 { PyObject *modules = PyImport_GetModuleDict(); if (unlikely(!modules)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} if (!PyDict_GetItemString(modules, "pygame_sdl2.rect")) { if (unlikely(PyDict_SetItemString(modules, "pygame_sdl2.rect", __pyx_m) < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } } #endif /*--- Builtin init code ---*/ if (__Pyx_InitCachedBuiltins() < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /*--- Constants init code ---*/ if (__Pyx_InitCachedConstants() < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /*--- Global init code ---*/ /*--- Variable export code ---*/ /*--- Function export code ---*/ if (__Pyx_ExportFunction("to_sdl_rect", (void (*)(void))__pyx_f_11pygame_sdl2_4rect_to_sdl_rect, "int (PyObject *, SDL_Rect *, struct __pyx_opt_args_11pygame_sdl2_4rect_to_sdl_rect *__pyx_optional_args)") < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /*--- Type init code ---*/ if (PyType_Ready(&__pyx_type_11pygame_sdl2_4rect_Rect) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 28; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_type_11pygame_sdl2_4rect_Rect.tp_print = 0; if (PyObject_SetAttrString(__pyx_m, "Rect", (PyObject *)&__pyx_type_11pygame_sdl2_4rect_Rect) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 28; __pyx_clineno = __LINE__; goto __pyx_L1_error;} if (__pyx_type_11pygame_sdl2_4rect_Rect.tp_weaklistoffset == 0) __pyx_type_11pygame_sdl2_4rect_Rect.tp_weaklistoffset = offsetof(struct __pyx_obj_11pygame_sdl2_4rect_Rect, __weakref__); __pyx_ptype_11pygame_sdl2_4rect_Rect = &__pyx_type_11pygame_sdl2_4rect_Rect; /*--- Type import code ---*/ /*--- Variable import code ---*/ /*--- Function import code ---*/ /*--- Execution code ---*/ #if defined(__Pyx_Generator_USED) || defined(__Pyx_Coroutine_USED) if (__Pyx_patch_abc() < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} #endif /* "pygame_sdl2/rect.pyx":20 * # 3. This notice may not be removed or altered from any source distribution. * * import collections # <<<<<<<<<<<<<< * * def flatten(*args): */ __pyx_t_1 = __Pyx_Import(__pyx_n_s_collections, 0, 0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 20; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); if (PyDict_SetItem(__pyx_d, __pyx_n_s_collections, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 20; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "pygame_sdl2/rect.pyx":22 * import collections * * def flatten(*args): # <<<<<<<<<<<<<< * if len(args) == 1: * return args[0] */ __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_11pygame_sdl2_4rect_1flatten, NULL, __pyx_n_s_pygame_sdl2_rect); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 22; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); if (PyDict_SetItem(__pyx_d, __pyx_n_s_flatten, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 22; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "pygame_sdl2/rect.pyx":1 * # Copyright 2014 Tom Rothamel # <<<<<<<<<<<<<< * # Copyright 2014 Patrick Dawson * # */ __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); if (PyDict_SetItem(__pyx_d, __pyx_n_s_test, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /*--- Wrapped vars code ---*/ goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); if (__pyx_m) { if (__pyx_d) { __Pyx_AddTraceback("init pygame_sdl2.rect", __pyx_clineno, __pyx_lineno, __pyx_filename); } Py_DECREF(__pyx_m); __pyx_m = 0; } else if (!PyErr_Occurred()) { PyErr_SetString(PyExc_ImportError, "init pygame_sdl2.rect"); } __pyx_L0:; __Pyx_RefNannyFinishContext(); #if PY_MAJOR_VERSION < 3 return; #else return __pyx_m; #endif } /* --- Runtime support code --- */ #if CYTHON_REFNANNY static __Pyx_RefNannyAPIStruct *__Pyx_RefNannyImportAPI(const char *modname) { PyObject *m = NULL, *p = NULL; void *r = NULL; m = PyImport_ImportModule((char *)modname); if (!m) goto end; p = PyObject_GetAttrString(m, (char *)"RefNannyAPI"); if (!p) goto end; r = PyLong_AsVoidPtr(p); end: Py_XDECREF(p); Py_XDECREF(m); return (__Pyx_RefNannyAPIStruct *)r; } #endif static PyObject *__Pyx_GetBuiltinName(PyObject *name) { PyObject* result = __Pyx_PyObject_GetAttrStr(__pyx_b, name); if (unlikely(!result)) { PyErr_Format(PyExc_NameError, #if PY_MAJOR_VERSION >= 3 "name '%U' is not defined", name); #else "name '%.200s' is not defined", PyString_AS_STRING(name)); #endif } return result; } static CYTHON_INLINE int __Pyx_CheckKeywordStrings( PyObject *kwdict, const char* function_name, int kw_allowed) { PyObject* key = 0; Py_ssize_t pos = 0; #if CYTHON_COMPILING_IN_PYPY if (!kw_allowed && PyDict_Next(kwdict, &pos, &key, 0)) goto invalid_keyword; return 1; #else while (PyDict_Next(kwdict, &pos, &key, 0)) { #if PY_MAJOR_VERSION < 3 if (unlikely(!PyString_CheckExact(key)) && unlikely(!PyString_Check(key))) #endif if (unlikely(!PyUnicode_Check(key))) goto invalid_keyword_type; } if ((!kw_allowed) && unlikely(key)) goto invalid_keyword; return 1; invalid_keyword_type: PyErr_Format(PyExc_TypeError, "%.200s() keywords must be strings", function_name); return 0; #endif invalid_keyword: PyErr_Format(PyExc_TypeError, #if PY_MAJOR_VERSION < 3 "%.200s() got an unexpected keyword argument '%.200s'", function_name, PyString_AsString(key)); #else "%s() got an unexpected keyword argument '%U'", function_name, key); #endif return 0; } static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Generic(PyObject *o, PyObject* j) { PyObject *r; if (!j) return NULL; r = PyObject_GetItem(o, j); Py_DECREF(j); return r; } static CYTHON_INLINE PyObject *__Pyx_GetItemInt_List_Fast(PyObject *o, Py_ssize_t i, CYTHON_NCP_UNUSED int wraparound, CYTHON_NCP_UNUSED int boundscheck) { #if CYTHON_COMPILING_IN_CPYTHON if (wraparound & unlikely(i < 0)) i += PyList_GET_SIZE(o); if ((!boundscheck) || likely((0 <= i) & (i < PyList_GET_SIZE(o)))) { PyObject *r = PyList_GET_ITEM(o, i); Py_INCREF(r); return r; } return __Pyx_GetItemInt_Generic(o, PyInt_FromSsize_t(i)); #else return PySequence_GetItem(o, i); #endif } static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Tuple_Fast(PyObject *o, Py_ssize_t i, CYTHON_NCP_UNUSED int wraparound, CYTHON_NCP_UNUSED int boundscheck) { #if CYTHON_COMPILING_IN_CPYTHON if (wraparound & unlikely(i < 0)) i += PyTuple_GET_SIZE(o); if ((!boundscheck) || likely((0 <= i) & (i < PyTuple_GET_SIZE(o)))) { PyObject *r = PyTuple_GET_ITEM(o, i); Py_INCREF(r); return r; } return __Pyx_GetItemInt_Generic(o, PyInt_FromSsize_t(i)); #else return PySequence_GetItem(o, i); #endif } static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Fast(PyObject *o, Py_ssize_t i, int is_list, CYTHON_NCP_UNUSED int wraparound, CYTHON_NCP_UNUSED int boundscheck) { #if CYTHON_COMPILING_IN_CPYTHON if (is_list || PyList_CheckExact(o)) { Py_ssize_t n = ((!wraparound) | likely(i >= 0)) ? i : i + PyList_GET_SIZE(o); if ((!boundscheck) || (likely((n >= 0) & (n < PyList_GET_SIZE(o))))) { PyObject *r = PyList_GET_ITEM(o, n); Py_INCREF(r); return r; } } else if (PyTuple_CheckExact(o)) { Py_ssize_t n = ((!wraparound) | likely(i >= 0)) ? i : i + PyTuple_GET_SIZE(o); if ((!boundscheck) || likely((n >= 0) & (n < PyTuple_GET_SIZE(o)))) { PyObject *r = PyTuple_GET_ITEM(o, n); Py_INCREF(r); return r; } } else { PySequenceMethods *m = Py_TYPE(o)->tp_as_sequence; if (likely(m && m->sq_item)) { if (wraparound && unlikely(i < 0) && likely(m->sq_length)) { Py_ssize_t l = m->sq_length(o); if (likely(l >= 0)) { i += l; } else { if (PyErr_ExceptionMatches(PyExc_OverflowError)) PyErr_Clear(); else return NULL; } } return m->sq_item(o, i); } } #else if (is_list || PySequence_Check(o)) { return PySequence_GetItem(o, i); } #endif return __Pyx_GetItemInt_Generic(o, PyInt_FromSsize_t(i)); } static CYTHON_INLINE int __Pyx_TypeTest(PyObject *obj, PyTypeObject *type) { if (unlikely(!type)) { PyErr_SetString(PyExc_SystemError, "Missing type object"); return 0; } if (likely(PyObject_TypeCheck(obj, type))) return 1; PyErr_Format(PyExc_TypeError, "Cannot convert %.200s to %.200s", Py_TYPE(obj)->tp_name, type->tp_name); return 0; } static CYTHON_INLINE void __Pyx_RaiseTooManyValuesError(Py_ssize_t expected) { PyErr_Format(PyExc_ValueError, "too many values to unpack (expected %" CYTHON_FORMAT_SSIZE_T "d)", expected); } static CYTHON_INLINE void __Pyx_RaiseNeedMoreValuesError(Py_ssize_t index) { PyErr_Format(PyExc_ValueError, "need more than %" CYTHON_FORMAT_SSIZE_T "d value%.1s to unpack", index, (index == 1) ? "" : "s"); } static CYTHON_INLINE int __Pyx_IterFinish(void) { #if CYTHON_COMPILING_IN_CPYTHON PyThreadState *tstate = PyThreadState_GET(); PyObject* exc_type = tstate->curexc_type; if (unlikely(exc_type)) { if (likely(exc_type == PyExc_StopIteration) || PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration)) { PyObject *exc_value, *exc_tb; exc_value = tstate->curexc_value; exc_tb = tstate->curexc_traceback; tstate->curexc_type = 0; tstate->curexc_value = 0; tstate->curexc_traceback = 0; Py_DECREF(exc_type); Py_XDECREF(exc_value); Py_XDECREF(exc_tb); return 0; } else { return -1; } } return 0; #else if (unlikely(PyErr_Occurred())) { if (likely(PyErr_ExceptionMatches(PyExc_StopIteration))) { PyErr_Clear(); return 0; } else { return -1; } } return 0; #endif } static int __Pyx_IternextUnpackEndCheck(PyObject *retval, Py_ssize_t expected) { if (unlikely(retval)) { Py_DECREF(retval); __Pyx_RaiseTooManyValuesError(expected); return -1; } else { return __Pyx_IterFinish(); } return 0; } #if CYTHON_COMPILING_IN_CPYTHON static CYTHON_INLINE PyObject* __Pyx_PyObject_Call(PyObject *func, PyObject *arg, PyObject *kw) { PyObject *result; ternaryfunc call = func->ob_type->tp_call; if (unlikely(!call)) return PyObject_Call(func, arg, kw); if (unlikely(Py_EnterRecursiveCall((char*)" while calling a Python object"))) return NULL; result = (*call)(func, arg, kw); Py_LeaveRecursiveCall(); if (unlikely(!result) && unlikely(!PyErr_Occurred())) { PyErr_SetString( PyExc_SystemError, "NULL result without error in PyObject_Call"); } return result; } #endif static CYTHON_INLINE void __Pyx_ErrRestore(PyObject *type, PyObject *value, PyObject *tb) { #if CYTHON_COMPILING_IN_CPYTHON PyObject *tmp_type, *tmp_value, *tmp_tb; PyThreadState *tstate = PyThreadState_GET(); tmp_type = tstate->curexc_type; tmp_value = tstate->curexc_value; tmp_tb = tstate->curexc_traceback; tstate->curexc_type = type; tstate->curexc_value = value; tstate->curexc_traceback = tb; Py_XDECREF(tmp_type); Py_XDECREF(tmp_value); Py_XDECREF(tmp_tb); #else PyErr_Restore(type, value, tb); #endif } static CYTHON_INLINE void __Pyx_ErrFetch(PyObject **type, PyObject **value, PyObject **tb) { #if CYTHON_COMPILING_IN_CPYTHON PyThreadState *tstate = PyThreadState_GET(); *type = tstate->curexc_type; *value = tstate->curexc_value; *tb = tstate->curexc_traceback; tstate->curexc_type = 0; tstate->curexc_value = 0; tstate->curexc_traceback = 0; #else PyErr_Fetch(type, value, tb); #endif } #if PY_MAJOR_VERSION < 3 static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, CYTHON_UNUSED PyObject *cause) { Py_XINCREF(type); if (!value || value == Py_None) value = NULL; else Py_INCREF(value); if (!tb || tb == Py_None) tb = NULL; else { Py_INCREF(tb); if (!PyTraceBack_Check(tb)) { PyErr_SetString(PyExc_TypeError, "raise: arg 3 must be a traceback or None"); goto raise_error; } } if (PyType_Check(type)) { #if CYTHON_COMPILING_IN_PYPY if (!value) { Py_INCREF(Py_None); value = Py_None; } #endif PyErr_NormalizeException(&type, &value, &tb); } else { if (value) { PyErr_SetString(PyExc_TypeError, "instance exception may not have a separate value"); goto raise_error; } value = type; type = (PyObject*) Py_TYPE(type); Py_INCREF(type); if (!PyType_IsSubtype((PyTypeObject *)type, (PyTypeObject *)PyExc_BaseException)) { PyErr_SetString(PyExc_TypeError, "raise: exception class must be a subclass of BaseException"); goto raise_error; } } __Pyx_ErrRestore(type, value, tb); return; raise_error: Py_XDECREF(value); Py_XDECREF(type); Py_XDECREF(tb); return; } #else static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, PyObject *cause) { PyObject* owned_instance = NULL; if (tb == Py_None) { tb = 0; } else if (tb && !PyTraceBack_Check(tb)) { PyErr_SetString(PyExc_TypeError, "raise: arg 3 must be a traceback or None"); goto bad; } if (value == Py_None) value = 0; if (PyExceptionInstance_Check(type)) { if (value) { PyErr_SetString(PyExc_TypeError, "instance exception may not have a separate value"); goto bad; } value = type; type = (PyObject*) Py_TYPE(value); } else if (PyExceptionClass_Check(type)) { PyObject *instance_class = NULL; if (value && PyExceptionInstance_Check(value)) { instance_class = (PyObject*) Py_TYPE(value); if (instance_class != type) { int is_subclass = PyObject_IsSubclass(instance_class, type); if (!is_subclass) { instance_class = NULL; } else if (unlikely(is_subclass == -1)) { goto bad; } else { type = instance_class; } } } if (!instance_class) { PyObject *args; if (!value) args = PyTuple_New(0); else if (PyTuple_Check(value)) { Py_INCREF(value); args = value; } else args = PyTuple_Pack(1, value); if (!args) goto bad; owned_instance = PyObject_Call(type, args, NULL); Py_DECREF(args); if (!owned_instance) goto bad; value = owned_instance; if (!PyExceptionInstance_Check(value)) { PyErr_Format(PyExc_TypeError, "calling %R should have returned an instance of " "BaseException, not %R", type, Py_TYPE(value)); goto bad; } } } else { PyErr_SetString(PyExc_TypeError, "raise: exception class must be a subclass of BaseException"); goto bad; } #if PY_VERSION_HEX >= 0x03030000 if (cause) { #else if (cause && cause != Py_None) { #endif PyObject *fixed_cause; if (cause == Py_None) { fixed_cause = NULL; } else if (PyExceptionClass_Check(cause)) { fixed_cause = PyObject_CallObject(cause, NULL); if (fixed_cause == NULL) goto bad; } else if (PyExceptionInstance_Check(cause)) { fixed_cause = cause; Py_INCREF(fixed_cause); } else { PyErr_SetString(PyExc_TypeError, "exception causes must derive from " "BaseException"); goto bad; } PyException_SetCause(value, fixed_cause); } PyErr_SetObject(type, value); if (tb) { #if CYTHON_COMPILING_IN_PYPY PyObject *tmp_type, *tmp_value, *tmp_tb; PyErr_Fetch(&tmp_type, &tmp_value, &tmp_tb); Py_INCREF(tb); PyErr_Restore(tmp_type, tmp_value, tb); Py_XDECREF(tmp_tb); #else PyThreadState *tstate = PyThreadState_GET(); PyObject* tmp_tb = tstate->curexc_traceback; if (tb != tmp_tb) { Py_INCREF(tb); tstate->curexc_traceback = tb; Py_XDECREF(tmp_tb); } #endif } bad: Py_XDECREF(owned_instance); return; } #endif static void __Pyx_RaiseArgumentTypeInvalid(const char* name, PyObject *obj, PyTypeObject *type) { PyErr_Format(PyExc_TypeError, "Argument '%.200s' has incorrect type (expected %.200s, got %.200s)", name, type->tp_name, Py_TYPE(obj)->tp_name); } static CYTHON_INLINE int __Pyx_ArgTypeTest(PyObject *obj, PyTypeObject *type, int none_allowed, const char *name, int exact) { if (unlikely(!type)) { PyErr_SetString(PyExc_SystemError, "Missing type object"); return 0; } if (none_allowed && obj == Py_None) return 1; else if (exact) { if (likely(Py_TYPE(obj) == type)) return 1; #if PY_MAJOR_VERSION == 2 else if ((type == &PyBaseString_Type) && likely(__Pyx_PyBaseString_CheckExact(obj))) return 1; #endif } else { if (likely(PyObject_TypeCheck(obj, type))) return 1; } __Pyx_RaiseArgumentTypeInvalid(name, obj, type); return 0; } #if CYTHON_USE_PYLONG_INTERNALS #include "longintrepr.h" #endif #if CYTHON_COMPILING_IN_CPYTHON static PyObject* __Pyx_PyInt_EqObjC(PyObject *op1, PyObject *op2, CYTHON_UNUSED long intval, CYTHON_UNUSED int inplace) { if (op1 == op2) { Py_RETURN_TRUE; } #if PY_MAJOR_VERSION < 3 if (likely(PyInt_CheckExact(op1))) { const long b = intval; long a = PyInt_AS_LONG(op1); if (a == b) { Py_RETURN_TRUE; } else { Py_RETURN_FALSE; } } #endif #if CYTHON_USE_PYLONG_INTERNALS && PY_MAJOR_VERSION >= 3 if (likely(PyLong_CheckExact(op1))) { const long b = intval; long a; const digit* digits = ((PyLongObject*)op1)->ob_digit; const Py_ssize_t size = Py_SIZE(op1); if (likely(__Pyx_sst_abs(size) <= 1)) { a = likely(size) ? digits[0] : 0; if (size == -1) a = -a; } else { switch (size) { case -2: if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) { a = -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])); break; } case 2: if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) { a = (long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])); break; } case -3: if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) { a = -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])); break; } case 3: if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) { a = (long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])); break; } case -4: if (8 * sizeof(long) - 1 > 4 * PyLong_SHIFT) { a = -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])); break; } case 4: if (8 * sizeof(long) - 1 > 4 * PyLong_SHIFT) { a = (long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])); break; } #if PyLong_SHIFT < 30 && PyLong_SHIFT != 15 default: return PyLong_Type.tp_richcompare(op1, op2, Py_EQ); #else default: Py_RETURN_FALSE; #endif } } if (a == b) { Py_RETURN_TRUE; } else { Py_RETURN_FALSE; } } #endif if (PyFloat_CheckExact(op1)) { const long b = intval; double a = PyFloat_AS_DOUBLE(op1); if ((double)a == (double)b) { Py_RETURN_TRUE; } else { Py_RETURN_FALSE; } } return PyObject_RichCompare(op1, op2, Py_EQ); } #endif #if CYTHON_COMPILING_IN_CPYTHON static CYTHON_INLINE PyObject* __Pyx_PyObject_CallMethO(PyObject *func, PyObject *arg) { PyObject *self, *result; PyCFunction cfunc; cfunc = PyCFunction_GET_FUNCTION(func); self = PyCFunction_GET_SELF(func); if (unlikely(Py_EnterRecursiveCall((char*)" while calling a Python object"))) return NULL; result = cfunc(self, arg); Py_LeaveRecursiveCall(); if (unlikely(!result) && unlikely(!PyErr_Occurred())) { PyErr_SetString( PyExc_SystemError, "NULL result without error in PyObject_Call"); } return result; } #endif #if CYTHON_COMPILING_IN_CPYTHON static PyObject* __Pyx__PyObject_CallOneArg(PyObject *func, PyObject *arg) { PyObject *result; PyObject *args = PyTuple_New(1); if (unlikely(!args)) return NULL; Py_INCREF(arg); PyTuple_SET_ITEM(args, 0, arg); result = __Pyx_PyObject_Call(func, args, NULL); Py_DECREF(args); return result; } static CYTHON_INLINE PyObject* __Pyx_PyObject_CallOneArg(PyObject *func, PyObject *arg) { #ifdef __Pyx_CyFunction_USED if (likely(PyCFunction_Check(func) || PyObject_TypeCheck(func, __pyx_CyFunctionType))) { #else if (likely(PyCFunction_Check(func))) { #endif if (likely(PyCFunction_GET_FLAGS(func) & METH_O)) { return __Pyx_PyObject_CallMethO(func, arg); } } return __Pyx__PyObject_CallOneArg(func, arg); } #else static CYTHON_INLINE PyObject* __Pyx_PyObject_CallOneArg(PyObject *func, PyObject *arg) { PyObject *result; PyObject *args = PyTuple_Pack(1, arg); if (unlikely(!args)) return NULL; result = __Pyx_PyObject_Call(func, args, NULL); Py_DECREF(args); return result; } #endif #if CYTHON_COMPILING_IN_CPYTHON static CYTHON_INLINE PyObject* __Pyx_PyObject_CallNoArg(PyObject *func) { #ifdef __Pyx_CyFunction_USED if (likely(PyCFunction_Check(func) || PyObject_TypeCheck(func, __pyx_CyFunctionType))) { #else if (likely(PyCFunction_Check(func))) { #endif if (likely(PyCFunction_GET_FLAGS(func) & METH_NOARGS)) { return __Pyx_PyObject_CallMethO(func, NULL); } } return __Pyx_PyObject_Call(func, __pyx_empty_tuple, NULL); } #endif static CYTHON_INLINE PyObject *__Pyx_GetModuleGlobalName(PyObject *name) { PyObject *result; #if CYTHON_COMPILING_IN_CPYTHON result = PyDict_GetItem(__pyx_d, name); if (likely(result)) { Py_INCREF(result); } else { #else result = PyObject_GetItem(__pyx_d, name); if (!result) { PyErr_Clear(); #endif result = __Pyx_GetBuiltinName(name); } return result; } static void __Pyx_RaiseDoubleKeywordsError( const char* func_name, PyObject* kw_name) { PyErr_Format(PyExc_TypeError, #if PY_MAJOR_VERSION >= 3 "%s() got multiple values for keyword argument '%U'", func_name, kw_name); #else "%s() got multiple values for keyword argument '%s'", func_name, PyString_AsString(kw_name)); #endif } static int __Pyx_ParseOptionalKeywords( PyObject *kwds, PyObject **argnames[], PyObject *kwds2, PyObject *values[], Py_ssize_t num_pos_args, const char* function_name) { PyObject *key = 0, *value = 0; Py_ssize_t pos = 0; PyObject*** name; PyObject*** first_kw_arg = argnames + num_pos_args; while (PyDict_Next(kwds, &pos, &key, &value)) { name = first_kw_arg; while (*name && (**name != key)) name++; if (*name) { values[name-argnames] = value; continue; } name = first_kw_arg; #if PY_MAJOR_VERSION < 3 if (likely(PyString_CheckExact(key)) || likely(PyString_Check(key))) { while (*name) { if ((CYTHON_COMPILING_IN_PYPY || PyString_GET_SIZE(**name) == PyString_GET_SIZE(key)) && _PyString_Eq(**name, key)) { values[name-argnames] = value; break; } name++; } if (*name) continue; else { PyObject*** argname = argnames; while (argname != first_kw_arg) { if ((**argname == key) || ( (CYTHON_COMPILING_IN_PYPY || PyString_GET_SIZE(**argname) == PyString_GET_SIZE(key)) && _PyString_Eq(**argname, key))) { goto arg_passed_twice; } argname++; } } } else #endif if (likely(PyUnicode_Check(key))) { while (*name) { int cmp = (**name == key) ? 0 : #if !CYTHON_COMPILING_IN_PYPY && PY_MAJOR_VERSION >= 3 (PyUnicode_GET_SIZE(**name) != PyUnicode_GET_SIZE(key)) ? 1 : #endif PyUnicode_Compare(**name, key); if (cmp < 0 && unlikely(PyErr_Occurred())) goto bad; if (cmp == 0) { values[name-argnames] = value; break; } name++; } if (*name) continue; else { PyObject*** argname = argnames; while (argname != first_kw_arg) { int cmp = (**argname == key) ? 0 : #if !CYTHON_COMPILING_IN_PYPY && PY_MAJOR_VERSION >= 3 (PyUnicode_GET_SIZE(**argname) != PyUnicode_GET_SIZE(key)) ? 1 : #endif PyUnicode_Compare(**argname, key); if (cmp < 0 && unlikely(PyErr_Occurred())) goto bad; if (cmp == 0) goto arg_passed_twice; argname++; } } } else goto invalid_keyword_type; if (kwds2) { if (unlikely(PyDict_SetItem(kwds2, key, value))) goto bad; } else { goto invalid_keyword; } } return 0; arg_passed_twice: __Pyx_RaiseDoubleKeywordsError(function_name, key); goto bad; invalid_keyword_type: PyErr_Format(PyExc_TypeError, "%.200s() keywords must be strings", function_name); goto bad; invalid_keyword: PyErr_Format(PyExc_TypeError, #if PY_MAJOR_VERSION < 3 "%.200s() got an unexpected keyword argument '%.200s'", function_name, PyString_AsString(key)); #else "%s() got an unexpected keyword argument '%U'", function_name, key); #endif bad: return -1; } static void __Pyx_RaiseArgtupleInvalid( const char* func_name, int exact, Py_ssize_t num_min, Py_ssize_t num_max, Py_ssize_t num_found) { Py_ssize_t num_expected; const char *more_or_less; if (num_found < num_min) { num_expected = num_min; more_or_less = "at least"; } else { num_expected = num_max; more_or_less = "at most"; } if (exact) { more_or_less = "exactly"; } PyErr_Format(PyExc_TypeError, "%.200s() takes %.8s %" CYTHON_FORMAT_SSIZE_T "d positional argument%.1s (%" CYTHON_FORMAT_SSIZE_T "d given)", func_name, more_or_less, num_expected, (num_expected == 1) ? "" : "s", num_found); } static double __Pyx__PyObject_AsDouble(PyObject* obj) { PyObject* float_value; #if CYTHON_COMPILING_IN_PYPY float_value = PyNumber_Float(obj); if (0) goto bad; #else PyNumberMethods *nb = Py_TYPE(obj)->tp_as_number; if (likely(nb) && likely(nb->nb_float)) { float_value = nb->nb_float(obj); if (likely(float_value) && unlikely(!PyFloat_Check(float_value))) { PyErr_Format(PyExc_TypeError, "__float__ returned non-float (type %.200s)", Py_TYPE(float_value)->tp_name); Py_DECREF(float_value); goto bad; } } else if (PyUnicode_CheckExact(obj) || PyBytes_CheckExact(obj)) { #if PY_MAJOR_VERSION >= 3 float_value = PyFloat_FromString(obj); #else float_value = PyFloat_FromString(obj, 0); #endif } else { PyObject* args = PyTuple_New(1); if (unlikely(!args)) goto bad; PyTuple_SET_ITEM(args, 0, obj); float_value = PyObject_Call((PyObject*)&PyFloat_Type, args, 0); PyTuple_SET_ITEM(args, 0, 0); Py_DECREF(args); } #endif if (likely(float_value)) { double value = PyFloat_AS_DOUBLE(float_value); Py_DECREF(float_value); return value; } bad: return (double)-1; } static PyObject* __Pyx_PyObject_CallMethod0(PyObject* obj, PyObject* method_name) { PyObject *method, *result = NULL; method = __Pyx_PyObject_GetAttrStr(obj, method_name); if (unlikely(!method)) goto bad; #if CYTHON_COMPILING_IN_CPYTHON if (likely(PyMethod_Check(method))) { PyObject *self = PyMethod_GET_SELF(method); if (likely(self)) { PyObject *function = PyMethod_GET_FUNCTION(method); result = __Pyx_PyObject_CallOneArg(function, self); Py_DECREF(method); return result; } } #endif result = __Pyx_PyObject_CallNoArg(method); Py_DECREF(method); bad: return result; } static CYTHON_INLINE void __Pyx_RaiseNoneNotIterableError(void) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable"); } static void __Pyx_UnpackTupleError(PyObject *t, Py_ssize_t index) { if (t == Py_None) { __Pyx_RaiseNoneNotIterableError(); } else if (PyTuple_GET_SIZE(t) < index) { __Pyx_RaiseNeedMoreValuesError(PyTuple_GET_SIZE(t)); } else { __Pyx_RaiseTooManyValuesError(index); } } static CYTHON_INLINE int __Pyx_unpack_tuple2(PyObject* tuple, PyObject** pvalue1, PyObject** pvalue2, int is_tuple, int has_known_size, int decref_tuple) { Py_ssize_t index; PyObject *value1 = NULL, *value2 = NULL, *iter = NULL; if (!is_tuple && unlikely(!PyTuple_Check(tuple))) { iternextfunc iternext; iter = PyObject_GetIter(tuple); if (unlikely(!iter)) goto bad; if (decref_tuple) { Py_DECREF(tuple); tuple = NULL; } iternext = Py_TYPE(iter)->tp_iternext; value1 = iternext(iter); if (unlikely(!value1)) { index = 0; goto unpacking_failed; } value2 = iternext(iter); if (unlikely(!value2)) { index = 1; goto unpacking_failed; } if (!has_known_size && unlikely(__Pyx_IternextUnpackEndCheck(iternext(iter), 2))) goto bad; Py_DECREF(iter); } else { if (!has_known_size && unlikely(PyTuple_GET_SIZE(tuple) != 2)) { __Pyx_UnpackTupleError(tuple, 2); goto bad; } #if CYTHON_COMPILING_IN_PYPY value1 = PySequence_ITEM(tuple, 0); if (unlikely(!value1)) goto bad; value2 = PySequence_ITEM(tuple, 1); if (unlikely(!value2)) goto bad; #else value1 = PyTuple_GET_ITEM(tuple, 0); value2 = PyTuple_GET_ITEM(tuple, 1); Py_INCREF(value1); Py_INCREF(value2); #endif if (decref_tuple) { Py_DECREF(tuple); } } *pvalue1 = value1; *pvalue2 = value2; return 0; unpacking_failed: if (!has_known_size && __Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); bad: Py_XDECREF(iter); Py_XDECREF(value1); Py_XDECREF(value2); if (decref_tuple) { Py_XDECREF(tuple); } return -1; } static CYTHON_INLINE PyObject* __Pyx_dict_iterator(PyObject* iterable, int is_dict, PyObject* method_name, Py_ssize_t* p_orig_length, int* p_source_is_dict) { is_dict = is_dict || likely(PyDict_CheckExact(iterable)); *p_source_is_dict = is_dict; #if !CYTHON_COMPILING_IN_PYPY if (is_dict) { *p_orig_length = PyDict_Size(iterable); Py_INCREF(iterable); return iterable; } #endif *p_orig_length = 0; if (method_name) { PyObject* iter; iterable = __Pyx_PyObject_CallMethod0(iterable, method_name); if (!iterable) return NULL; #if !CYTHON_COMPILING_IN_PYPY if (PyTuple_CheckExact(iterable) || PyList_CheckExact(iterable)) return iterable; #endif iter = PyObject_GetIter(iterable); Py_DECREF(iterable); return iter; } return PyObject_GetIter(iterable); } static CYTHON_INLINE int __Pyx_dict_iter_next( PyObject* iter_obj, CYTHON_NCP_UNUSED Py_ssize_t orig_length, CYTHON_NCP_UNUSED Py_ssize_t* ppos, PyObject** pkey, PyObject** pvalue, PyObject** pitem, int source_is_dict) { PyObject* next_item; #if !CYTHON_COMPILING_IN_PYPY if (source_is_dict) { PyObject *key, *value; if (unlikely(orig_length != PyDict_Size(iter_obj))) { PyErr_SetString(PyExc_RuntimeError, "dictionary changed size during iteration"); return -1; } if (unlikely(!PyDict_Next(iter_obj, ppos, &key, &value))) { return 0; } if (pitem) { PyObject* tuple = PyTuple_New(2); if (unlikely(!tuple)) { return -1; } Py_INCREF(key); Py_INCREF(value); PyTuple_SET_ITEM(tuple, 0, key); PyTuple_SET_ITEM(tuple, 1, value); *pitem = tuple; } else { if (pkey) { Py_INCREF(key); *pkey = key; } if (pvalue) { Py_INCREF(value); *pvalue = value; } } return 1; } else if (PyTuple_CheckExact(iter_obj)) { Py_ssize_t pos = *ppos; if (unlikely(pos >= PyTuple_GET_SIZE(iter_obj))) return 0; *ppos = pos + 1; next_item = PyTuple_GET_ITEM(iter_obj, pos); Py_INCREF(next_item); } else if (PyList_CheckExact(iter_obj)) { Py_ssize_t pos = *ppos; if (unlikely(pos >= PyList_GET_SIZE(iter_obj))) return 0; *ppos = pos + 1; next_item = PyList_GET_ITEM(iter_obj, pos); Py_INCREF(next_item); } else #endif { next_item = PyIter_Next(iter_obj); if (unlikely(!next_item)) { return __Pyx_IterFinish(); } } if (pitem) { *pitem = next_item; } else if (pkey && pvalue) { if (__Pyx_unpack_tuple2(next_item, pkey, pvalue, source_is_dict, source_is_dict, 1)) return -1; } else if (pkey) { *pkey = next_item; } else { *pvalue = next_item; } return 1; } static CYTHON_INLINE void __Pyx_ExceptionSave(PyObject **type, PyObject **value, PyObject **tb) { #if CYTHON_COMPILING_IN_CPYTHON PyThreadState *tstate = PyThreadState_GET(); *type = tstate->exc_type; *value = tstate->exc_value; *tb = tstate->exc_traceback; Py_XINCREF(*type); Py_XINCREF(*value); Py_XINCREF(*tb); #else PyErr_GetExcInfo(type, value, tb); #endif } static void __Pyx_ExceptionReset(PyObject *type, PyObject *value, PyObject *tb) { #if CYTHON_COMPILING_IN_CPYTHON PyObject *tmp_type, *tmp_value, *tmp_tb; PyThreadState *tstate = PyThreadState_GET(); tmp_type = tstate->exc_type; tmp_value = tstate->exc_value; tmp_tb = tstate->exc_traceback; tstate->exc_type = type; tstate->exc_value = value; tstate->exc_traceback = tb; Py_XDECREF(tmp_type); Py_XDECREF(tmp_value); Py_XDECREF(tmp_tb); #else PyErr_SetExcInfo(type, value, tb); #endif } static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list, int level) { PyObject *empty_list = 0; PyObject *module = 0; PyObject *global_dict = 0; PyObject *empty_dict = 0; PyObject *list; #if PY_VERSION_HEX < 0x03030000 PyObject *py_import; py_import = __Pyx_PyObject_GetAttrStr(__pyx_b, __pyx_n_s_import); if (!py_import) goto bad; #endif if (from_list) list = from_list; else { empty_list = PyList_New(0); if (!empty_list) goto bad; list = empty_list; } global_dict = PyModule_GetDict(__pyx_m); if (!global_dict) goto bad; empty_dict = PyDict_New(); if (!empty_dict) goto bad; { #if PY_MAJOR_VERSION >= 3 if (level == -1) { if (strchr(__Pyx_MODULE_NAME, '.')) { #if PY_VERSION_HEX < 0x03030000 PyObject *py_level = PyInt_FromLong(1); if (!py_level) goto bad; module = PyObject_CallFunctionObjArgs(py_import, name, global_dict, empty_dict, list, py_level, NULL); Py_DECREF(py_level); #else module = PyImport_ImportModuleLevelObject( name, global_dict, empty_dict, list, 1); #endif if (!module) { if (!PyErr_ExceptionMatches(PyExc_ImportError)) goto bad; PyErr_Clear(); } } level = 0; } #endif if (!module) { #if PY_VERSION_HEX < 0x03030000 PyObject *py_level = PyInt_FromLong(level); if (!py_level) goto bad; module = PyObject_CallFunctionObjArgs(py_import, name, global_dict, empty_dict, list, py_level, NULL); Py_DECREF(py_level); #else module = PyImport_ImportModuleLevelObject( name, global_dict, empty_dict, list, level); #endif } } bad: #if PY_VERSION_HEX < 0x03030000 Py_XDECREF(py_import); #endif Py_XDECREF(empty_list); Py_XDECREF(empty_dict); return module; } static int __pyx_bisect_code_objects(__Pyx_CodeObjectCacheEntry* entries, int count, int code_line) { int start = 0, mid = 0, end = count - 1; if (end >= 0 && code_line > entries[end].code_line) { return count; } while (start < end) { mid = start + (end - start) / 2; if (code_line < entries[mid].code_line) { end = mid; } else if (code_line > entries[mid].code_line) { start = mid + 1; } else { return mid; } } if (code_line <= entries[mid].code_line) { return mid; } else { return mid + 1; } } static PyCodeObject *__pyx_find_code_object(int code_line) { PyCodeObject* code_object; int pos; if (unlikely(!code_line) || unlikely(!__pyx_code_cache.entries)) { return NULL; } pos = __pyx_bisect_code_objects(__pyx_code_cache.entries, __pyx_code_cache.count, code_line); if (unlikely(pos >= __pyx_code_cache.count) || unlikely(__pyx_code_cache.entries[pos].code_line != code_line)) { return NULL; } code_object = __pyx_code_cache.entries[pos].code_object; Py_INCREF(code_object); return code_object; } static void __pyx_insert_code_object(int code_line, PyCodeObject* code_object) { int pos, i; __Pyx_CodeObjectCacheEntry* entries = __pyx_code_cache.entries; if (unlikely(!code_line)) { return; } if (unlikely(!entries)) { entries = (__Pyx_CodeObjectCacheEntry*)PyMem_Malloc(64*sizeof(__Pyx_CodeObjectCacheEntry)); if (likely(entries)) { __pyx_code_cache.entries = entries; __pyx_code_cache.max_count = 64; __pyx_code_cache.count = 1; entries[0].code_line = code_line; entries[0].code_object = code_object; Py_INCREF(code_object); } return; } pos = __pyx_bisect_code_objects(__pyx_code_cache.entries, __pyx_code_cache.count, code_line); if ((pos < __pyx_code_cache.count) && unlikely(__pyx_code_cache.entries[pos].code_line == code_line)) { PyCodeObject* tmp = entries[pos].code_object; entries[pos].code_object = code_object; Py_DECREF(tmp); return; } if (__pyx_code_cache.count == __pyx_code_cache.max_count) { int new_max = __pyx_code_cache.max_count + 64; entries = (__Pyx_CodeObjectCacheEntry*)PyMem_Realloc( __pyx_code_cache.entries, (size_t)new_max*sizeof(__Pyx_CodeObjectCacheEntry)); if (unlikely(!entries)) { return; } __pyx_code_cache.entries = entries; __pyx_code_cache.max_count = new_max; } for (i=__pyx_code_cache.count; i>pos; i--) { entries[i] = entries[i-1]; } entries[pos].code_line = code_line; entries[pos].code_object = code_object; __pyx_code_cache.count++; Py_INCREF(code_object); } #include "compile.h" #include "frameobject.h" #include "traceback.h" static PyCodeObject* __Pyx_CreateCodeObjectForTraceback( const char *funcname, int c_line, int py_line, const char *filename) { PyCodeObject *py_code = 0; PyObject *py_srcfile = 0; PyObject *py_funcname = 0; #if PY_MAJOR_VERSION < 3 py_srcfile = PyString_FromString(filename); #else py_srcfile = PyUnicode_FromString(filename); #endif if (!py_srcfile) goto bad; if (c_line) { #if PY_MAJOR_VERSION < 3 py_funcname = PyString_FromFormat( "%s (%s:%d)", funcname, __pyx_cfilenm, c_line); #else py_funcname = PyUnicode_FromFormat( "%s (%s:%d)", funcname, __pyx_cfilenm, c_line); #endif } else { #if PY_MAJOR_VERSION < 3 py_funcname = PyString_FromString(funcname); #else py_funcname = PyUnicode_FromString(funcname); #endif } if (!py_funcname) goto bad; py_code = __Pyx_PyCode_New( 0, 0, 0, 0, 0, __pyx_empty_bytes, /*PyObject *code,*/ __pyx_empty_tuple, /*PyObject *consts,*/ __pyx_empty_tuple, /*PyObject *names,*/ __pyx_empty_tuple, /*PyObject *varnames,*/ __pyx_empty_tuple, /*PyObject *freevars,*/ __pyx_empty_tuple, /*PyObject *cellvars,*/ py_srcfile, /*PyObject *filename,*/ py_funcname, /*PyObject *name,*/ py_line, __pyx_empty_bytes /*PyObject *lnotab*/ ); Py_DECREF(py_srcfile); Py_DECREF(py_funcname); return py_code; bad: Py_XDECREF(py_srcfile); Py_XDECREF(py_funcname); return NULL; } static void __Pyx_AddTraceback(const char *funcname, int c_line, int py_line, const char *filename) { PyCodeObject *py_code = 0; PyFrameObject *py_frame = 0; py_code = __pyx_find_code_object(c_line ? c_line : py_line); if (!py_code) { py_code = __Pyx_CreateCodeObjectForTraceback( funcname, c_line, py_line, filename); if (!py_code) goto bad; __pyx_insert_code_object(c_line ? c_line : py_line, py_code); } py_frame = PyFrame_New( PyThreadState_GET(), /*PyThreadState *tstate,*/ py_code, /*PyCodeObject *code,*/ __pyx_d, /*PyObject *globals,*/ 0 /*PyObject *locals*/ ); if (!py_frame) goto bad; py_frame->f_lineno = py_line; PyTraceBack_Here(py_frame); bad: Py_XDECREF(py_code); Py_XDECREF(py_frame); } #define __PYX_VERIFY_RETURN_INT(target_type, func_type, func_value)\ __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, 0) #define __PYX_VERIFY_RETURN_INT_EXC(target_type, func_type, func_value)\ __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, 1) #define __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, exc)\ {\ func_type value = func_value;\ if (sizeof(target_type) < sizeof(func_type)) {\ if (unlikely(value != (func_type) (target_type) value)) {\ func_type zero = 0;\ if (exc && unlikely(value == (func_type)-1 && PyErr_Occurred()))\ return (target_type) -1;\ if (is_unsigned && unlikely(value < zero))\ goto raise_neg_overflow;\ else\ goto raise_overflow;\ }\ }\ return (target_type) value;\ } static CYTHON_INLINE int __Pyx_PyInt_As_int(PyObject *x) { const int neg_one = (int) -1, const_zero = (int) 0; const int is_unsigned = neg_one > const_zero; #if PY_MAJOR_VERSION < 3 if (likely(PyInt_Check(x))) { if (sizeof(int) < sizeof(long)) { __PYX_VERIFY_RETURN_INT(int, long, PyInt_AS_LONG(x)) } else { long val = PyInt_AS_LONG(x); if (is_unsigned && unlikely(val < 0)) { goto raise_neg_overflow; } return (int) val; } } else #endif if (likely(PyLong_Check(x))) { if (is_unsigned) { #if CYTHON_USE_PYLONG_INTERNALS const digit* digits = ((PyLongObject*)x)->ob_digit; switch (Py_SIZE(x)) { case 0: return (int) 0; case 1: __PYX_VERIFY_RETURN_INT(int, digit, digits[0]) case 2: if (8 * sizeof(int) > 1 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(int) >= 2 * PyLong_SHIFT) { return (int) (((((int)digits[1]) << PyLong_SHIFT) | (int)digits[0])); } } break; case 3: if (8 * sizeof(int) > 2 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(int) >= 3 * PyLong_SHIFT) { return (int) (((((((int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0])); } } break; case 4: if (8 * sizeof(int) > 3 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(int) >= 4 * PyLong_SHIFT) { return (int) (((((((((int)digits[3]) << PyLong_SHIFT) | (int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0])); } } break; } #endif #if CYTHON_COMPILING_IN_CPYTHON if (unlikely(Py_SIZE(x) < 0)) { goto raise_neg_overflow; } #else { int result = PyObject_RichCompareBool(x, Py_False, Py_LT); if (unlikely(result < 0)) return (int) -1; if (unlikely(result == 1)) goto raise_neg_overflow; } #endif if (sizeof(int) <= sizeof(unsigned long)) { __PYX_VERIFY_RETURN_INT_EXC(int, unsigned long, PyLong_AsUnsignedLong(x)) } else if (sizeof(int) <= sizeof(unsigned PY_LONG_LONG)) { __PYX_VERIFY_RETURN_INT_EXC(int, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x)) } } else { #if CYTHON_USE_PYLONG_INTERNALS const digit* digits = ((PyLongObject*)x)->ob_digit; switch (Py_SIZE(x)) { case 0: return (int) 0; case -1: __PYX_VERIFY_RETURN_INT(int, sdigit, (sdigit) (-(sdigit)digits[0])) case 1: __PYX_VERIFY_RETURN_INT(int, digit, +digits[0]) case -2: if (8 * sizeof(int) - 1 > 1 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(int, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(int) - 1 > 2 * PyLong_SHIFT) { return (int) (((int)-1)*(((((int)digits[1]) << PyLong_SHIFT) | (int)digits[0]))); } } break; case 2: if (8 * sizeof(int) > 1 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(int) - 1 > 2 * PyLong_SHIFT) { return (int) ((((((int)digits[1]) << PyLong_SHIFT) | (int)digits[0]))); } } break; case -3: if (8 * sizeof(int) - 1 > 2 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(int, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(int) - 1 > 3 * PyLong_SHIFT) { return (int) (((int)-1)*(((((((int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0]))); } } break; case 3: if (8 * sizeof(int) > 2 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(int) - 1 > 3 * PyLong_SHIFT) { return (int) ((((((((int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0]))); } } break; case -4: if (8 * sizeof(int) - 1 > 3 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(int, long, -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(int) - 1 > 4 * PyLong_SHIFT) { return (int) (((int)-1)*(((((((((int)digits[3]) << PyLong_SHIFT) | (int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0]))); } } break; case 4: if (8 * sizeof(int) > 3 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(int) - 1 > 4 * PyLong_SHIFT) { return (int) ((((((((((int)digits[3]) << PyLong_SHIFT) | (int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0]))); } } break; } #endif if (sizeof(int) <= sizeof(long)) { __PYX_VERIFY_RETURN_INT_EXC(int, long, PyLong_AsLong(x)) } else if (sizeof(int) <= sizeof(PY_LONG_LONG)) { __PYX_VERIFY_RETURN_INT_EXC(int, PY_LONG_LONG, PyLong_AsLongLong(x)) } } { #if CYTHON_COMPILING_IN_PYPY && !defined(_PyLong_AsByteArray) PyErr_SetString(PyExc_RuntimeError, "_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers"); #else int val; PyObject *v = __Pyx_PyNumber_Int(x); #if PY_MAJOR_VERSION < 3 if (likely(v) && !PyLong_Check(v)) { PyObject *tmp = v; v = PyNumber_Long(tmp); Py_DECREF(tmp); } #endif if (likely(v)) { int one = 1; int is_little = (int)*(unsigned char *)&one; unsigned char *bytes = (unsigned char *)&val; int ret = _PyLong_AsByteArray((PyLongObject *)v, bytes, sizeof(val), is_little, !is_unsigned); Py_DECREF(v); if (likely(!ret)) return val; } #endif return (int) -1; } } else { int val; PyObject *tmp = __Pyx_PyNumber_Int(x); if (!tmp) return (int) -1; val = __Pyx_PyInt_As_int(tmp); Py_DECREF(tmp); return val; } raise_overflow: PyErr_SetString(PyExc_OverflowError, "value too large to convert to int"); return (int) -1; raise_neg_overflow: PyErr_SetString(PyExc_OverflowError, "can't convert negative value to int"); return (int) -1; } static CYTHON_INLINE PyObject* __Pyx_PyInt_From_long(long value) { const long neg_one = (long) -1, const_zero = (long) 0; const int is_unsigned = neg_one > const_zero; if (is_unsigned) { if (sizeof(long) < sizeof(long)) { return PyInt_FromLong((long) value); } else if (sizeof(long) <= sizeof(unsigned long)) { return PyLong_FromUnsignedLong((unsigned long) value); } else if (sizeof(long) <= sizeof(unsigned PY_LONG_LONG)) { return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value); } } else { if (sizeof(long) <= sizeof(long)) { return PyInt_FromLong((long) value); } else if (sizeof(long) <= sizeof(PY_LONG_LONG)) { return PyLong_FromLongLong((PY_LONG_LONG) value); } } { int one = 1; int little = (int)*(unsigned char *)&one; unsigned char *bytes = (unsigned char *)&value; return _PyLong_FromByteArray(bytes, sizeof(long), little, !is_unsigned); } } static CYTHON_INLINE PyObject* __Pyx_PyInt_From_int(int value) { const int neg_one = (int) -1, const_zero = (int) 0; const int is_unsigned = neg_one > const_zero; if (is_unsigned) { if (sizeof(int) < sizeof(long)) { return PyInt_FromLong((long) value); } else if (sizeof(int) <= sizeof(unsigned long)) { return PyLong_FromUnsignedLong((unsigned long) value); } else if (sizeof(int) <= sizeof(unsigned PY_LONG_LONG)) { return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value); } } else { if (sizeof(int) <= sizeof(long)) { return PyInt_FromLong((long) value); } else if (sizeof(int) <= sizeof(PY_LONG_LONG)) { return PyLong_FromLongLong((PY_LONG_LONG) value); } } { int one = 1; int little = (int)*(unsigned char *)&one; unsigned char *bytes = (unsigned char *)&value; return _PyLong_FromByteArray(bytes, sizeof(int), little, !is_unsigned); } } static CYTHON_INLINE long __Pyx_PyInt_As_long(PyObject *x) { const long neg_one = (long) -1, const_zero = (long) 0; const int is_unsigned = neg_one > const_zero; #if PY_MAJOR_VERSION < 3 if (likely(PyInt_Check(x))) { if (sizeof(long) < sizeof(long)) { __PYX_VERIFY_RETURN_INT(long, long, PyInt_AS_LONG(x)) } else { long val = PyInt_AS_LONG(x); if (is_unsigned && unlikely(val < 0)) { goto raise_neg_overflow; } return (long) val; } } else #endif if (likely(PyLong_Check(x))) { if (is_unsigned) { #if CYTHON_USE_PYLONG_INTERNALS const digit* digits = ((PyLongObject*)x)->ob_digit; switch (Py_SIZE(x)) { case 0: return (long) 0; case 1: __PYX_VERIFY_RETURN_INT(long, digit, digits[0]) case 2: if (8 * sizeof(long) > 1 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(long) >= 2 * PyLong_SHIFT) { return (long) (((((long)digits[1]) << PyLong_SHIFT) | (long)digits[0])); } } break; case 3: if (8 * sizeof(long) > 2 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(long) >= 3 * PyLong_SHIFT) { return (long) (((((((long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0])); } } break; case 4: if (8 * sizeof(long) > 3 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(long) >= 4 * PyLong_SHIFT) { return (long) (((((((((long)digits[3]) << PyLong_SHIFT) | (long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0])); } } break; } #endif #if CYTHON_COMPILING_IN_CPYTHON if (unlikely(Py_SIZE(x) < 0)) { goto raise_neg_overflow; } #else { int result = PyObject_RichCompareBool(x, Py_False, Py_LT); if (unlikely(result < 0)) return (long) -1; if (unlikely(result == 1)) goto raise_neg_overflow; } #endif if (sizeof(long) <= sizeof(unsigned long)) { __PYX_VERIFY_RETURN_INT_EXC(long, unsigned long, PyLong_AsUnsignedLong(x)) } else if (sizeof(long) <= sizeof(unsigned PY_LONG_LONG)) { __PYX_VERIFY_RETURN_INT_EXC(long, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x)) } } else { #if CYTHON_USE_PYLONG_INTERNALS const digit* digits = ((PyLongObject*)x)->ob_digit; switch (Py_SIZE(x)) { case 0: return (long) 0; case -1: __PYX_VERIFY_RETURN_INT(long, sdigit, (sdigit) (-(sdigit)digits[0])) case 1: __PYX_VERIFY_RETURN_INT(long, digit, +digits[0]) case -2: if (8 * sizeof(long) - 1 > 1 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(long, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) { return (long) (((long)-1)*(((((long)digits[1]) << PyLong_SHIFT) | (long)digits[0]))); } } break; case 2: if (8 * sizeof(long) > 1 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) { return (long) ((((((long)digits[1]) << PyLong_SHIFT) | (long)digits[0]))); } } break; case -3: if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(long, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) { return (long) (((long)-1)*(((((((long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0]))); } } break; case 3: if (8 * sizeof(long) > 2 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) { return (long) ((((((((long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0]))); } } break; case -4: if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(long, long, -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(long) - 1 > 4 * PyLong_SHIFT) { return (long) (((long)-1)*(((((((((long)digits[3]) << PyLong_SHIFT) | (long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0]))); } } break; case 4: if (8 * sizeof(long) > 3 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(long) - 1 > 4 * PyLong_SHIFT) { return (long) ((((((((((long)digits[3]) << PyLong_SHIFT) | (long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0]))); } } break; } #endif if (sizeof(long) <= sizeof(long)) { __PYX_VERIFY_RETURN_INT_EXC(long, long, PyLong_AsLong(x)) } else if (sizeof(long) <= sizeof(PY_LONG_LONG)) { __PYX_VERIFY_RETURN_INT_EXC(long, PY_LONG_LONG, PyLong_AsLongLong(x)) } } { #if CYTHON_COMPILING_IN_PYPY && !defined(_PyLong_AsByteArray) PyErr_SetString(PyExc_RuntimeError, "_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers"); #else long val; PyObject *v = __Pyx_PyNumber_Int(x); #if PY_MAJOR_VERSION < 3 if (likely(v) && !PyLong_Check(v)) { PyObject *tmp = v; v = PyNumber_Long(tmp); Py_DECREF(tmp); } #endif if (likely(v)) { int one = 1; int is_little = (int)*(unsigned char *)&one; unsigned char *bytes = (unsigned char *)&val; int ret = _PyLong_AsByteArray((PyLongObject *)v, bytes, sizeof(val), is_little, !is_unsigned); Py_DECREF(v); if (likely(!ret)) return val; } #endif return (long) -1; } } else { long val; PyObject *tmp = __Pyx_PyNumber_Int(x); if (!tmp) return (long) -1; val = __Pyx_PyInt_As_long(tmp); Py_DECREF(tmp); return val; } raise_overflow: PyErr_SetString(PyExc_OverflowError, "value too large to convert to long"); return (long) -1; raise_neg_overflow: PyErr_SetString(PyExc_OverflowError, "can't convert negative value to long"); return (long) -1; } static int __Pyx_check_binary_version(void) { char ctversion[4], rtversion[4]; PyOS_snprintf(ctversion, 4, "%d.%d", PY_MAJOR_VERSION, PY_MINOR_VERSION); PyOS_snprintf(rtversion, 4, "%s", Py_GetVersion()); if (ctversion[0] != rtversion[0] || ctversion[2] != rtversion[2]) { char message[200]; PyOS_snprintf(message, sizeof(message), "compiletime version %s of module '%.100s' " "does not match runtime version %s", ctversion, __Pyx_MODULE_NAME, rtversion); return PyErr_WarnEx(NULL, message, 1); } return 0; } static int __Pyx_ExportFunction(const char *name, void (*f)(void), const char *sig) { PyObject *d = 0; PyObject *cobj = 0; union { void (*fp)(void); void *p; } tmp; d = PyObject_GetAttrString(__pyx_m, (char *)"__pyx_capi__"); if (!d) { PyErr_Clear(); d = PyDict_New(); if (!d) goto bad; Py_INCREF(d); if (PyModule_AddObject(__pyx_m, (char *)"__pyx_capi__", d) < 0) goto bad; } tmp.fp = f; #if PY_VERSION_HEX >= 0x02070000 cobj = PyCapsule_New(tmp.p, sig, 0); #else cobj = PyCObject_FromVoidPtrAndDesc(tmp.p, (void *)sig, 0); #endif if (!cobj) goto bad; if (PyDict_SetItemString(d, name, cobj) < 0) goto bad; Py_DECREF(cobj); Py_DECREF(d); return 0; bad: Py_XDECREF(cobj); Py_XDECREF(d); return -1; } static int __Pyx_InitStrings(__Pyx_StringTabEntry *t) { while (t->p) { #if PY_MAJOR_VERSION < 3 if (t->is_unicode) { *t->p = PyUnicode_DecodeUTF8(t->s, t->n - 1, NULL); } else if (t->intern) { *t->p = PyString_InternFromString(t->s); } else { *t->p = PyString_FromStringAndSize(t->s, t->n - 1); } #else if (t->is_unicode | t->is_str) { if (t->intern) { *t->p = PyUnicode_InternFromString(t->s); } else if (t->encoding) { *t->p = PyUnicode_Decode(t->s, t->n - 1, t->encoding, NULL); } else { *t->p = PyUnicode_FromStringAndSize(t->s, t->n - 1); } } else { *t->p = PyBytes_FromStringAndSize(t->s, t->n - 1); } #endif if (!*t->p) return -1; ++t; } return 0; } static CYTHON_INLINE PyObject* __Pyx_PyUnicode_FromString(const char* c_str) { return __Pyx_PyUnicode_FromStringAndSize(c_str, (Py_ssize_t)strlen(c_str)); } static CYTHON_INLINE char* __Pyx_PyObject_AsString(PyObject* o) { Py_ssize_t ignore; return __Pyx_PyObject_AsStringAndSize(o, &ignore); } static CYTHON_INLINE char* __Pyx_PyObject_AsStringAndSize(PyObject* o, Py_ssize_t *length) { #if CYTHON_COMPILING_IN_CPYTHON && (__PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT) if ( #if PY_MAJOR_VERSION < 3 && __PYX_DEFAULT_STRING_ENCODING_IS_ASCII __Pyx_sys_getdefaultencoding_not_ascii && #endif PyUnicode_Check(o)) { #if PY_VERSION_HEX < 0x03030000 char* defenc_c; PyObject* defenc = _PyUnicode_AsDefaultEncodedString(o, NULL); if (!defenc) return NULL; defenc_c = PyBytes_AS_STRING(defenc); #if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII { char* end = defenc_c + PyBytes_GET_SIZE(defenc); char* c; for (c = defenc_c; c < end; c++) { if ((unsigned char) (*c) >= 128) { PyUnicode_AsASCIIString(o); return NULL; } } } #endif *length = PyBytes_GET_SIZE(defenc); return defenc_c; #else if (__Pyx_PyUnicode_READY(o) == -1) return NULL; #if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII if (PyUnicode_IS_ASCII(o)) { *length = PyUnicode_GET_LENGTH(o); return PyUnicode_AsUTF8(o); } else { PyUnicode_AsASCIIString(o); return NULL; } #else return PyUnicode_AsUTF8AndSize(o, length); #endif #endif } else #endif #if (!CYTHON_COMPILING_IN_PYPY) || (defined(PyByteArray_AS_STRING) && defined(PyByteArray_GET_SIZE)) if (PyByteArray_Check(o)) { *length = PyByteArray_GET_SIZE(o); return PyByteArray_AS_STRING(o); } else #endif { char* result; int r = PyBytes_AsStringAndSize(o, &result, length); if (unlikely(r < 0)) { return NULL; } else { return result; } } } static CYTHON_INLINE int __Pyx_PyObject_IsTrue(PyObject* x) { int is_true = x == Py_True; if (is_true | (x == Py_False) | (x == Py_None)) return is_true; else return PyObject_IsTrue(x); } static CYTHON_INLINE PyObject* __Pyx_PyNumber_Int(PyObject* x) { PyNumberMethods *m; const char *name = NULL; PyObject *res = NULL; #if PY_MAJOR_VERSION < 3 if (PyInt_Check(x) || PyLong_Check(x)) #else if (PyLong_Check(x)) #endif return __Pyx_NewRef(x); m = Py_TYPE(x)->tp_as_number; #if PY_MAJOR_VERSION < 3 if (m && m->nb_int) { name = "int"; res = PyNumber_Int(x); } else if (m && m->nb_long) { name = "long"; res = PyNumber_Long(x); } #else if (m && m->nb_int) { name = "int"; res = PyNumber_Long(x); } #endif if (res) { #if PY_MAJOR_VERSION < 3 if (!PyInt_Check(res) && !PyLong_Check(res)) { #else if (!PyLong_Check(res)) { #endif PyErr_Format(PyExc_TypeError, "__%.4s__ returned non-%.4s (type %.200s)", name, name, Py_TYPE(res)->tp_name); Py_DECREF(res); return NULL; } } else if (!PyErr_Occurred()) { PyErr_SetString(PyExc_TypeError, "an integer is required"); } return res; } static CYTHON_INLINE Py_ssize_t __Pyx_PyIndex_AsSsize_t(PyObject* b) { Py_ssize_t ival; PyObject *x; #if PY_MAJOR_VERSION < 3 if (likely(PyInt_CheckExact(b))) { if (sizeof(Py_ssize_t) >= sizeof(long)) return PyInt_AS_LONG(b); else return PyInt_AsSsize_t(x); } #endif if (likely(PyLong_CheckExact(b))) { #if CYTHON_USE_PYLONG_INTERNALS const digit* digits = ((PyLongObject*)b)->ob_digit; const Py_ssize_t size = Py_SIZE(b); if (likely(__Pyx_sst_abs(size) <= 1)) { ival = likely(size) ? digits[0] : 0; if (size == -1) ival = -ival; return ival; } else { switch (size) { case 2: if (8 * sizeof(Py_ssize_t) > 2 * PyLong_SHIFT) { return (Py_ssize_t) (((((size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])); } break; case -2: if (8 * sizeof(Py_ssize_t) > 2 * PyLong_SHIFT) { return -(Py_ssize_t) (((((size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])); } break; case 3: if (8 * sizeof(Py_ssize_t) > 3 * PyLong_SHIFT) { return (Py_ssize_t) (((((((size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])); } break; case -3: if (8 * sizeof(Py_ssize_t) > 3 * PyLong_SHIFT) { return -(Py_ssize_t) (((((((size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])); } break; case 4: if (8 * sizeof(Py_ssize_t) > 4 * PyLong_SHIFT) { return (Py_ssize_t) (((((((((size_t)digits[3]) << PyLong_SHIFT) | (size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])); } break; case -4: if (8 * sizeof(Py_ssize_t) > 4 * PyLong_SHIFT) { return -(Py_ssize_t) (((((((((size_t)digits[3]) << PyLong_SHIFT) | (size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])); } break; } } #endif return PyLong_AsSsize_t(b); } x = PyNumber_Index(b); if (!x) return -1; ival = PyInt_AsSsize_t(x); Py_DECREF(x); return ival; } static CYTHON_INLINE PyObject * __Pyx_PyInt_FromSize_t(size_t ival) { return PyInt_FromSize_t(ival); } #endif /* Py_PYTHON_H */ pygame_sdl2-2.1.0-for-renpy-6.99.14.1/gen3/pygame_sdl2.surface.c0000644000175000017500000214361613231545025023116 0ustar tomtom00000000000000/* Generated by Cython 0.25.2 */ #define PY_SSIZE_T_CLEAN #include "Python.h" #ifndef Py_PYTHON_H #error Python headers needed to compile C extensions, please install development version of Python. #elif PY_VERSION_HEX < 0x02060000 || (0x03000000 <= PY_VERSION_HEX && PY_VERSION_HEX < 0x03020000) #error Cython requires Python 2.6+ or Python 3.2+. #else #define CYTHON_ABI "0_25_2" #include #ifndef offsetof #define offsetof(type, member) ( (size_t) & ((type*)0) -> member ) #endif #if !defined(WIN32) && !defined(MS_WINDOWS) #ifndef __stdcall #define __stdcall #endif #ifndef __cdecl #define __cdecl #endif #ifndef __fastcall #define __fastcall #endif #endif #ifndef DL_IMPORT #define DL_IMPORT(t) t #endif #ifndef DL_EXPORT #define DL_EXPORT(t) t #endif #ifndef HAVE_LONG_LONG #if PY_VERSION_HEX >= 0x03030000 || (PY_MAJOR_VERSION == 2 && PY_VERSION_HEX >= 0x02070000) #define HAVE_LONG_LONG #endif #endif #ifndef PY_LONG_LONG #define PY_LONG_LONG LONG_LONG #endif #ifndef Py_HUGE_VAL #define Py_HUGE_VAL HUGE_VAL #endif #ifdef PYPY_VERSION #define CYTHON_COMPILING_IN_PYPY 1 #define CYTHON_COMPILING_IN_PYSTON 0 #define CYTHON_COMPILING_IN_CPYTHON 0 #undef CYTHON_USE_TYPE_SLOTS #define CYTHON_USE_TYPE_SLOTS 0 #undef CYTHON_USE_ASYNC_SLOTS #define CYTHON_USE_ASYNC_SLOTS 0 #undef CYTHON_USE_PYLIST_INTERNALS #define CYTHON_USE_PYLIST_INTERNALS 0 #undef CYTHON_USE_UNICODE_INTERNALS #define CYTHON_USE_UNICODE_INTERNALS 0 #undef CYTHON_USE_UNICODE_WRITER #define CYTHON_USE_UNICODE_WRITER 0 #undef CYTHON_USE_PYLONG_INTERNALS #define CYTHON_USE_PYLONG_INTERNALS 0 #undef CYTHON_AVOID_BORROWED_REFS #define CYTHON_AVOID_BORROWED_REFS 1 #undef CYTHON_ASSUME_SAFE_MACROS #define CYTHON_ASSUME_SAFE_MACROS 0 #undef CYTHON_UNPACK_METHODS #define CYTHON_UNPACK_METHODS 0 #undef CYTHON_FAST_THREAD_STATE #define CYTHON_FAST_THREAD_STATE 0 #undef CYTHON_FAST_PYCALL #define CYTHON_FAST_PYCALL 0 #elif defined(PYSTON_VERSION) #define CYTHON_COMPILING_IN_PYPY 0 #define CYTHON_COMPILING_IN_PYSTON 1 #define CYTHON_COMPILING_IN_CPYTHON 0 #ifndef CYTHON_USE_TYPE_SLOTS #define CYTHON_USE_TYPE_SLOTS 1 #endif #undef CYTHON_USE_ASYNC_SLOTS #define CYTHON_USE_ASYNC_SLOTS 0 #undef CYTHON_USE_PYLIST_INTERNALS #define CYTHON_USE_PYLIST_INTERNALS 0 #ifndef CYTHON_USE_UNICODE_INTERNALS #define CYTHON_USE_UNICODE_INTERNALS 1 #endif #undef CYTHON_USE_UNICODE_WRITER #define CYTHON_USE_UNICODE_WRITER 0 #undef CYTHON_USE_PYLONG_INTERNALS #define CYTHON_USE_PYLONG_INTERNALS 0 #ifndef CYTHON_AVOID_BORROWED_REFS #define CYTHON_AVOID_BORROWED_REFS 0 #endif #ifndef CYTHON_ASSUME_SAFE_MACROS #define CYTHON_ASSUME_SAFE_MACROS 1 #endif #ifndef CYTHON_UNPACK_METHODS #define CYTHON_UNPACK_METHODS 1 #endif #undef CYTHON_FAST_THREAD_STATE #define CYTHON_FAST_THREAD_STATE 0 #undef CYTHON_FAST_PYCALL #define CYTHON_FAST_PYCALL 0 #else #define CYTHON_COMPILING_IN_PYPY 0 #define CYTHON_COMPILING_IN_PYSTON 0 #define CYTHON_COMPILING_IN_CPYTHON 1 #ifndef CYTHON_USE_TYPE_SLOTS #define CYTHON_USE_TYPE_SLOTS 1 #endif #if PY_MAJOR_VERSION < 3 #undef CYTHON_USE_ASYNC_SLOTS #define CYTHON_USE_ASYNC_SLOTS 0 #elif !defined(CYTHON_USE_ASYNC_SLOTS) #define CYTHON_USE_ASYNC_SLOTS 1 #endif #if PY_VERSION_HEX < 0x02070000 #undef CYTHON_USE_PYLONG_INTERNALS #define CYTHON_USE_PYLONG_INTERNALS 0 #elif !defined(CYTHON_USE_PYLONG_INTERNALS) #define CYTHON_USE_PYLONG_INTERNALS 1 #endif #ifndef CYTHON_USE_PYLIST_INTERNALS #define CYTHON_USE_PYLIST_INTERNALS 1 #endif #ifndef CYTHON_USE_UNICODE_INTERNALS #define CYTHON_USE_UNICODE_INTERNALS 1 #endif #if PY_VERSION_HEX < 0x030300F0 #undef CYTHON_USE_UNICODE_WRITER #define CYTHON_USE_UNICODE_WRITER 0 #elif !defined(CYTHON_USE_UNICODE_WRITER) #define CYTHON_USE_UNICODE_WRITER 1 #endif #ifndef CYTHON_AVOID_BORROWED_REFS #define CYTHON_AVOID_BORROWED_REFS 0 #endif #ifndef CYTHON_ASSUME_SAFE_MACROS #define CYTHON_ASSUME_SAFE_MACROS 1 #endif #ifndef CYTHON_UNPACK_METHODS #define CYTHON_UNPACK_METHODS 1 #endif #ifndef CYTHON_FAST_THREAD_STATE #define CYTHON_FAST_THREAD_STATE 1 #endif #ifndef CYTHON_FAST_PYCALL #define CYTHON_FAST_PYCALL 1 #endif #endif #if !defined(CYTHON_FAST_PYCCALL) #define CYTHON_FAST_PYCCALL (CYTHON_FAST_PYCALL && PY_VERSION_HEX >= 0x030600B1) #endif #if CYTHON_USE_PYLONG_INTERNALS #include "longintrepr.h" #undef SHIFT #undef BASE #undef MASK #endif #if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX < 0x02070600 && !defined(Py_OptimizeFlag) #define Py_OptimizeFlag 0 #endif #define __PYX_BUILD_PY_SSIZE_T "n" #define CYTHON_FORMAT_SSIZE_T "z" #if PY_MAJOR_VERSION < 3 #define __Pyx_BUILTIN_MODULE_NAME "__builtin__" #define __Pyx_PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)\ PyCode_New(a+k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos) #define __Pyx_DefaultClassType PyClass_Type #else #define __Pyx_BUILTIN_MODULE_NAME "builtins" #define __Pyx_PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)\ PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos) #define __Pyx_DefaultClassType PyType_Type #endif #ifndef Py_TPFLAGS_CHECKTYPES #define Py_TPFLAGS_CHECKTYPES 0 #endif #ifndef Py_TPFLAGS_HAVE_INDEX #define Py_TPFLAGS_HAVE_INDEX 0 #endif #ifndef Py_TPFLAGS_HAVE_NEWBUFFER #define Py_TPFLAGS_HAVE_NEWBUFFER 0 #endif #ifndef Py_TPFLAGS_HAVE_FINALIZE #define Py_TPFLAGS_HAVE_FINALIZE 0 #endif #ifndef METH_FASTCALL #define METH_FASTCALL 0x80 typedef PyObject *(*__Pyx_PyCFunctionFast) (PyObject *self, PyObject **args, Py_ssize_t nargs, PyObject *kwnames); #else #define __Pyx_PyCFunctionFast _PyCFunctionFast #endif #if CYTHON_FAST_PYCCALL #define __Pyx_PyFastCFunction_Check(func)\ ((PyCFunction_Check(func) && (METH_FASTCALL == (PyCFunction_GET_FLAGS(func) & ~(METH_CLASS | METH_STATIC | METH_COEXIST))))) #else #define __Pyx_PyFastCFunction_Check(func) 0 #endif #if PY_VERSION_HEX > 0x03030000 && defined(PyUnicode_KIND) #define CYTHON_PEP393_ENABLED 1 #define __Pyx_PyUnicode_READY(op) (likely(PyUnicode_IS_READY(op)) ?\ 0 : _PyUnicode_Ready((PyObject *)(op))) #define __Pyx_PyUnicode_GET_LENGTH(u) PyUnicode_GET_LENGTH(u) #define __Pyx_PyUnicode_READ_CHAR(u, i) PyUnicode_READ_CHAR(u, i) #define __Pyx_PyUnicode_MAX_CHAR_VALUE(u) PyUnicode_MAX_CHAR_VALUE(u) #define __Pyx_PyUnicode_KIND(u) PyUnicode_KIND(u) #define __Pyx_PyUnicode_DATA(u) PyUnicode_DATA(u) #define __Pyx_PyUnicode_READ(k, d, i) PyUnicode_READ(k, d, i) #define __Pyx_PyUnicode_WRITE(k, d, i, ch) PyUnicode_WRITE(k, d, i, ch) #define __Pyx_PyUnicode_IS_TRUE(u) (0 != (likely(PyUnicode_IS_READY(u)) ? PyUnicode_GET_LENGTH(u) : PyUnicode_GET_SIZE(u))) #else #define CYTHON_PEP393_ENABLED 0 #define PyUnicode_1BYTE_KIND 1 #define PyUnicode_2BYTE_KIND 2 #define PyUnicode_4BYTE_KIND 4 #define __Pyx_PyUnicode_READY(op) (0) #define __Pyx_PyUnicode_GET_LENGTH(u) PyUnicode_GET_SIZE(u) #define __Pyx_PyUnicode_READ_CHAR(u, i) ((Py_UCS4)(PyUnicode_AS_UNICODE(u)[i])) #define __Pyx_PyUnicode_MAX_CHAR_VALUE(u) ((sizeof(Py_UNICODE) == 2) ? 65535 : 1114111) #define __Pyx_PyUnicode_KIND(u) (sizeof(Py_UNICODE)) #define __Pyx_PyUnicode_DATA(u) ((void*)PyUnicode_AS_UNICODE(u)) #define __Pyx_PyUnicode_READ(k, d, i) ((void)(k), (Py_UCS4)(((Py_UNICODE*)d)[i])) #define __Pyx_PyUnicode_WRITE(k, d, i, ch) (((void)(k)), ((Py_UNICODE*)d)[i] = ch) #define __Pyx_PyUnicode_IS_TRUE(u) (0 != PyUnicode_GET_SIZE(u)) #endif #if CYTHON_COMPILING_IN_PYPY #define __Pyx_PyUnicode_Concat(a, b) PyNumber_Add(a, b) #define __Pyx_PyUnicode_ConcatSafe(a, b) PyNumber_Add(a, b) #else #define __Pyx_PyUnicode_Concat(a, b) PyUnicode_Concat(a, b) #define __Pyx_PyUnicode_ConcatSafe(a, b) ((unlikely((a) == Py_None) || unlikely((b) == Py_None)) ?\ PyNumber_Add(a, b) : __Pyx_PyUnicode_Concat(a, b)) #endif #if CYTHON_COMPILING_IN_PYPY && !defined(PyUnicode_Contains) #define PyUnicode_Contains(u, s) PySequence_Contains(u, s) #endif #if CYTHON_COMPILING_IN_PYPY && !defined(PyByteArray_Check) #define PyByteArray_Check(obj) PyObject_TypeCheck(obj, &PyByteArray_Type) #endif #if CYTHON_COMPILING_IN_PYPY && !defined(PyObject_Format) #define PyObject_Format(obj, fmt) PyObject_CallMethod(obj, "__format__", "O", fmt) #endif #if CYTHON_COMPILING_IN_PYPY && !defined(PyObject_Malloc) #define PyObject_Malloc(s) PyMem_Malloc(s) #define PyObject_Free(p) PyMem_Free(p) #define PyObject_Realloc(p) PyMem_Realloc(p) #endif #if CYTHON_COMPILING_IN_PYSTON #define __Pyx_PyCode_HasFreeVars(co) PyCode_HasFreeVars(co) #define __Pyx_PyFrame_SetLineNumber(frame, lineno) PyFrame_SetLineNumber(frame, lineno) #else #define __Pyx_PyCode_HasFreeVars(co) (PyCode_GetNumFree(co) > 0) #define __Pyx_PyFrame_SetLineNumber(frame, lineno) (frame)->f_lineno = (lineno) #endif #define __Pyx_PyString_FormatSafe(a, b) ((unlikely((a) == Py_None)) ? PyNumber_Remainder(a, b) : __Pyx_PyString_Format(a, b)) #define __Pyx_PyUnicode_FormatSafe(a, b) ((unlikely((a) == Py_None)) ? PyNumber_Remainder(a, b) : PyUnicode_Format(a, b)) #if PY_MAJOR_VERSION >= 3 #define __Pyx_PyString_Format(a, b) PyUnicode_Format(a, b) #else #define __Pyx_PyString_Format(a, b) PyString_Format(a, b) #endif #if PY_MAJOR_VERSION < 3 && !defined(PyObject_ASCII) #define PyObject_ASCII(o) PyObject_Repr(o) #endif #if PY_MAJOR_VERSION >= 3 #define PyBaseString_Type PyUnicode_Type #define PyStringObject PyUnicodeObject #define PyString_Type PyUnicode_Type #define PyString_Check PyUnicode_Check #define PyString_CheckExact PyUnicode_CheckExact #endif #if PY_MAJOR_VERSION >= 3 #define __Pyx_PyBaseString_Check(obj) PyUnicode_Check(obj) #define __Pyx_PyBaseString_CheckExact(obj) PyUnicode_CheckExact(obj) #else #define __Pyx_PyBaseString_Check(obj) (PyString_Check(obj) || PyUnicode_Check(obj)) #define __Pyx_PyBaseString_CheckExact(obj) (PyString_CheckExact(obj) || PyUnicode_CheckExact(obj)) #endif #ifndef PySet_CheckExact #define PySet_CheckExact(obj) (Py_TYPE(obj) == &PySet_Type) #endif #define __Pyx_TypeCheck(obj, type) PyObject_TypeCheck(obj, (PyTypeObject *)type) #define __Pyx_PyException_Check(obj) __Pyx_TypeCheck(obj, PyExc_Exception) #if PY_MAJOR_VERSION >= 3 #define PyIntObject PyLongObject #define PyInt_Type PyLong_Type #define PyInt_Check(op) PyLong_Check(op) #define PyInt_CheckExact(op) PyLong_CheckExact(op) #define PyInt_FromString PyLong_FromString #define PyInt_FromUnicode PyLong_FromUnicode #define PyInt_FromLong PyLong_FromLong #define PyInt_FromSize_t PyLong_FromSize_t #define PyInt_FromSsize_t PyLong_FromSsize_t #define PyInt_AsLong PyLong_AsLong #define PyInt_AS_LONG PyLong_AS_LONG #define PyInt_AsSsize_t PyLong_AsSsize_t #define PyInt_AsUnsignedLongMask PyLong_AsUnsignedLongMask #define PyInt_AsUnsignedLongLongMask PyLong_AsUnsignedLongLongMask #define PyNumber_Int PyNumber_Long #endif #if PY_MAJOR_VERSION >= 3 #define PyBoolObject PyLongObject #endif #if PY_MAJOR_VERSION >= 3 && CYTHON_COMPILING_IN_PYPY #ifndef PyUnicode_InternFromString #define PyUnicode_InternFromString(s) PyUnicode_FromString(s) #endif #endif #if PY_VERSION_HEX < 0x030200A4 typedef long Py_hash_t; #define __Pyx_PyInt_FromHash_t PyInt_FromLong #define __Pyx_PyInt_AsHash_t PyInt_AsLong #else #define __Pyx_PyInt_FromHash_t PyInt_FromSsize_t #define __Pyx_PyInt_AsHash_t PyInt_AsSsize_t #endif #if PY_MAJOR_VERSION >= 3 #define __Pyx_PyMethod_New(func, self, klass) ((self) ? PyMethod_New(func, self) : PyInstanceMethod_New(func)) #else #define __Pyx_PyMethod_New(func, self, klass) PyMethod_New(func, self, klass) #endif #if CYTHON_USE_ASYNC_SLOTS #if PY_VERSION_HEX >= 0x030500B1 #define __Pyx_PyAsyncMethodsStruct PyAsyncMethods #define __Pyx_PyType_AsAsync(obj) (Py_TYPE(obj)->tp_as_async) #else typedef struct { unaryfunc am_await; unaryfunc am_aiter; unaryfunc am_anext; } __Pyx_PyAsyncMethodsStruct; #define __Pyx_PyType_AsAsync(obj) ((__Pyx_PyAsyncMethodsStruct*) (Py_TYPE(obj)->tp_reserved)) #endif #else #define __Pyx_PyType_AsAsync(obj) NULL #endif #ifndef CYTHON_RESTRICT #if defined(__GNUC__) #define CYTHON_RESTRICT __restrict__ #elif defined(_MSC_VER) && _MSC_VER >= 1400 #define CYTHON_RESTRICT __restrict #elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L #define CYTHON_RESTRICT restrict #else #define CYTHON_RESTRICT #endif #endif #ifndef CYTHON_UNUSED # if defined(__GNUC__) # if !(defined(__cplusplus)) || (__GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 4)) # define CYTHON_UNUSED __attribute__ ((__unused__)) # else # define CYTHON_UNUSED # endif # elif defined(__ICC) || (defined(__INTEL_COMPILER) && !defined(_MSC_VER)) # define CYTHON_UNUSED __attribute__ ((__unused__)) # else # define CYTHON_UNUSED # endif #endif #ifndef CYTHON_MAYBE_UNUSED_VAR # if defined(__cplusplus) template void CYTHON_MAYBE_UNUSED_VAR( const T& ) { } # else # define CYTHON_MAYBE_UNUSED_VAR(x) (void)(x) # endif #endif #ifndef CYTHON_NCP_UNUSED # if CYTHON_COMPILING_IN_CPYTHON # define CYTHON_NCP_UNUSED # else # define CYTHON_NCP_UNUSED CYTHON_UNUSED # endif #endif #define __Pyx_void_to_None(void_result) ((void)(void_result), Py_INCREF(Py_None), Py_None) #ifndef CYTHON_INLINE #if defined(__clang__) #define CYTHON_INLINE __inline__ __attribute__ ((__unused__)) #elif defined(__GNUC__) #define CYTHON_INLINE __inline__ #elif defined(_MSC_VER) #define CYTHON_INLINE __inline #elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L #define CYTHON_INLINE inline #else #define CYTHON_INLINE #endif #endif #if defined(WIN32) || defined(MS_WINDOWS) #define _USE_MATH_DEFINES #endif #include #ifdef NAN #define __PYX_NAN() ((float) NAN) #else static CYTHON_INLINE float __PYX_NAN() { float value; memset(&value, 0xFF, sizeof(value)); return value; } #endif #if defined(__CYGWIN__) && defined(_LDBL_EQ_DBL) #define __Pyx_truncl trunc #else #define __Pyx_truncl truncl #endif #define __PYX_ERR(f_index, lineno, Ln_error) \ { \ __pyx_filename = __pyx_f[f_index]; __pyx_lineno = lineno; __pyx_clineno = __LINE__; goto Ln_error; \ } #if PY_MAJOR_VERSION >= 3 #define __Pyx_PyNumber_Divide(x,y) PyNumber_TrueDivide(x,y) #define __Pyx_PyNumber_InPlaceDivide(x,y) PyNumber_InPlaceTrueDivide(x,y) #else #define __Pyx_PyNumber_Divide(x,y) PyNumber_TrueDivide(x,y) #define __Pyx_PyNumber_InPlaceDivide(x,y) PyNumber_InPlaceTrueDivide(x,y) #endif #ifndef __PYX_EXTERN_C #ifdef __cplusplus #define __PYX_EXTERN_C extern "C" #else #define __PYX_EXTERN_C extern #endif #endif #define __PYX_HAVE__pygame_sdl2__surface #define __PYX_HAVE_API__pygame_sdl2__surface #include #include #include #include #include "SDL.h" #include "src/surface.h" #ifdef _OPENMP #include #endif /* _OPENMP */ #ifdef PYREX_WITHOUT_ASSERTIONS #define CYTHON_WITHOUT_ASSERTIONS #endif typedef struct {PyObject **p; const char *s; const Py_ssize_t n; const char* encoding; const char is_unicode; const char is_str; const char intern; } __Pyx_StringTabEntry; #define __PYX_DEFAULT_STRING_ENCODING_IS_ASCII 0 #define __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT 0 #define __PYX_DEFAULT_STRING_ENCODING "" #define __Pyx_PyObject_FromString __Pyx_PyBytes_FromString #define __Pyx_PyObject_FromStringAndSize __Pyx_PyBytes_FromStringAndSize #define __Pyx_uchar_cast(c) ((unsigned char)c) #define __Pyx_long_cast(x) ((long)x) #define __Pyx_fits_Py_ssize_t(v, type, is_signed) (\ (sizeof(type) < sizeof(Py_ssize_t)) ||\ (sizeof(type) > sizeof(Py_ssize_t) &&\ likely(v < (type)PY_SSIZE_T_MAX ||\ v == (type)PY_SSIZE_T_MAX) &&\ (!is_signed || likely(v > (type)PY_SSIZE_T_MIN ||\ v == (type)PY_SSIZE_T_MIN))) ||\ (sizeof(type) == sizeof(Py_ssize_t) &&\ (is_signed || likely(v < (type)PY_SSIZE_T_MAX ||\ v == (type)PY_SSIZE_T_MAX))) ) #if defined (__cplusplus) && __cplusplus >= 201103L #include #define __Pyx_sst_abs(value) std::abs(value) #elif SIZEOF_INT >= SIZEOF_SIZE_T #define __Pyx_sst_abs(value) abs(value) #elif SIZEOF_LONG >= SIZEOF_SIZE_T #define __Pyx_sst_abs(value) labs(value) #elif defined (_MSC_VER) && defined (_M_X64) #define __Pyx_sst_abs(value) _abs64(value) #elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L #define __Pyx_sst_abs(value) llabs(value) #elif defined (__GNUC__) #define __Pyx_sst_abs(value) __builtin_llabs(value) #else #define __Pyx_sst_abs(value) ((value<0) ? -value : value) #endif static CYTHON_INLINE char* __Pyx_PyObject_AsString(PyObject*); static CYTHON_INLINE char* __Pyx_PyObject_AsStringAndSize(PyObject*, Py_ssize_t* length); #define __Pyx_PyByteArray_FromString(s) PyByteArray_FromStringAndSize((const char*)s, strlen((const char*)s)) #define __Pyx_PyByteArray_FromStringAndSize(s, l) PyByteArray_FromStringAndSize((const char*)s, l) #define __Pyx_PyBytes_FromString PyBytes_FromString #define __Pyx_PyBytes_FromStringAndSize PyBytes_FromStringAndSize static CYTHON_INLINE PyObject* __Pyx_PyUnicode_FromString(const char*); #if PY_MAJOR_VERSION < 3 #define __Pyx_PyStr_FromString __Pyx_PyBytes_FromString #define __Pyx_PyStr_FromStringAndSize __Pyx_PyBytes_FromStringAndSize #else #define __Pyx_PyStr_FromString __Pyx_PyUnicode_FromString #define __Pyx_PyStr_FromStringAndSize __Pyx_PyUnicode_FromStringAndSize #endif #define __Pyx_PyObject_AsSString(s) ((signed char*) __Pyx_PyObject_AsString(s)) #define __Pyx_PyObject_AsUString(s) ((unsigned char*) __Pyx_PyObject_AsString(s)) #define __Pyx_PyObject_FromCString(s) __Pyx_PyObject_FromString((const char*)s) #define __Pyx_PyBytes_FromCString(s) __Pyx_PyBytes_FromString((const char*)s) #define __Pyx_PyByteArray_FromCString(s) __Pyx_PyByteArray_FromString((const char*)s) #define __Pyx_PyStr_FromCString(s) __Pyx_PyStr_FromString((const char*)s) #define __Pyx_PyUnicode_FromCString(s) __Pyx_PyUnicode_FromString((const char*)s) #if PY_MAJOR_VERSION < 3 static CYTHON_INLINE size_t __Pyx_Py_UNICODE_strlen(const Py_UNICODE *u) { const Py_UNICODE *u_end = u; while (*u_end++) ; return (size_t)(u_end - u - 1); } #else #define __Pyx_Py_UNICODE_strlen Py_UNICODE_strlen #endif #define __Pyx_PyUnicode_FromUnicode(u) PyUnicode_FromUnicode(u, __Pyx_Py_UNICODE_strlen(u)) #define __Pyx_PyUnicode_FromUnicodeAndLength PyUnicode_FromUnicode #define __Pyx_PyUnicode_AsUnicode PyUnicode_AsUnicode #define __Pyx_NewRef(obj) (Py_INCREF(obj), obj) #define __Pyx_Owned_Py_None(b) __Pyx_NewRef(Py_None) #define __Pyx_PyBool_FromLong(b) ((b) ? __Pyx_NewRef(Py_True) : __Pyx_NewRef(Py_False)) static CYTHON_INLINE int __Pyx_PyObject_IsTrue(PyObject*); static CYTHON_INLINE PyObject* __Pyx_PyNumber_IntOrLong(PyObject* x); static CYTHON_INLINE Py_ssize_t __Pyx_PyIndex_AsSsize_t(PyObject*); static CYTHON_INLINE PyObject * __Pyx_PyInt_FromSize_t(size_t); #if CYTHON_ASSUME_SAFE_MACROS #define __pyx_PyFloat_AsDouble(x) (PyFloat_CheckExact(x) ? PyFloat_AS_DOUBLE(x) : PyFloat_AsDouble(x)) #else #define __pyx_PyFloat_AsDouble(x) PyFloat_AsDouble(x) #endif #define __pyx_PyFloat_AsFloat(x) ((float) __pyx_PyFloat_AsDouble(x)) #if PY_MAJOR_VERSION >= 3 #define __Pyx_PyNumber_Int(x) (PyLong_CheckExact(x) ? __Pyx_NewRef(x) : PyNumber_Long(x)) #else #define __Pyx_PyNumber_Int(x) (PyInt_CheckExact(x) ? __Pyx_NewRef(x) : PyNumber_Int(x)) #endif #define __Pyx_PyNumber_Float(x) (PyFloat_CheckExact(x) ? __Pyx_NewRef(x) : PyNumber_Float(x)) #if PY_MAJOR_VERSION < 3 && __PYX_DEFAULT_STRING_ENCODING_IS_ASCII static int __Pyx_sys_getdefaultencoding_not_ascii; static int __Pyx_init_sys_getdefaultencoding_params(void) { PyObject* sys; PyObject* default_encoding = NULL; PyObject* ascii_chars_u = NULL; PyObject* ascii_chars_b = NULL; const char* default_encoding_c; sys = PyImport_ImportModule("sys"); if (!sys) goto bad; default_encoding = PyObject_CallMethod(sys, (char*) "getdefaultencoding", NULL); Py_DECREF(sys); if (!default_encoding) goto bad; default_encoding_c = PyBytes_AsString(default_encoding); if (!default_encoding_c) goto bad; if (strcmp(default_encoding_c, "ascii") == 0) { __Pyx_sys_getdefaultencoding_not_ascii = 0; } else { char ascii_chars[128]; int c; for (c = 0; c < 128; c++) { ascii_chars[c] = c; } __Pyx_sys_getdefaultencoding_not_ascii = 1; ascii_chars_u = PyUnicode_DecodeASCII(ascii_chars, 128, NULL); if (!ascii_chars_u) goto bad; ascii_chars_b = PyUnicode_AsEncodedString(ascii_chars_u, default_encoding_c, NULL); if (!ascii_chars_b || !PyBytes_Check(ascii_chars_b) || memcmp(ascii_chars, PyBytes_AS_STRING(ascii_chars_b), 128) != 0) { PyErr_Format( PyExc_ValueError, "This module compiled with c_string_encoding=ascii, but default encoding '%.200s' is not a superset of ascii.", default_encoding_c); goto bad; } Py_DECREF(ascii_chars_u); Py_DECREF(ascii_chars_b); } Py_DECREF(default_encoding); return 0; bad: Py_XDECREF(default_encoding); Py_XDECREF(ascii_chars_u); Py_XDECREF(ascii_chars_b); return -1; } #endif #if __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT && PY_MAJOR_VERSION >= 3 #define __Pyx_PyUnicode_FromStringAndSize(c_str, size) PyUnicode_DecodeUTF8(c_str, size, NULL) #else #define __Pyx_PyUnicode_FromStringAndSize(c_str, size) PyUnicode_Decode(c_str, size, __PYX_DEFAULT_STRING_ENCODING, NULL) #if __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT static char* __PYX_DEFAULT_STRING_ENCODING; static int __Pyx_init_sys_getdefaultencoding_params(void) { PyObject* sys; PyObject* default_encoding = NULL; char* default_encoding_c; sys = PyImport_ImportModule("sys"); if (!sys) goto bad; default_encoding = PyObject_CallMethod(sys, (char*) (const char*) "getdefaultencoding", NULL); Py_DECREF(sys); if (!default_encoding) goto bad; default_encoding_c = PyBytes_AsString(default_encoding); if (!default_encoding_c) goto bad; __PYX_DEFAULT_STRING_ENCODING = (char*) malloc(strlen(default_encoding_c)); if (!__PYX_DEFAULT_STRING_ENCODING) goto bad; strcpy(__PYX_DEFAULT_STRING_ENCODING, default_encoding_c); Py_DECREF(default_encoding); return 0; bad: Py_XDECREF(default_encoding); return -1; } #endif #endif /* Test for GCC > 2.95 */ #if defined(__GNUC__) && (__GNUC__ > 2 || (__GNUC__ == 2 && (__GNUC_MINOR__ > 95))) #define likely(x) __builtin_expect(!!(x), 1) #define unlikely(x) __builtin_expect(!!(x), 0) #else /* !__GNUC__ or GCC < 2.95 */ #define likely(x) (x) #define unlikely(x) (x) #endif /* __GNUC__ */ static PyObject *__pyx_m; static PyObject *__pyx_d; static PyObject *__pyx_b; static PyObject *__pyx_empty_tuple; static PyObject *__pyx_empty_bytes; static PyObject *__pyx_empty_unicode; static int __pyx_lineno; static int __pyx_clineno = 0; static const char * __pyx_cfilenm= __FILE__; static const char *__pyx_filename; static const char *__pyx_f[] = { "src/pygame_sdl2/surface.pyx", "src/pygame_sdl2/color.pxd", "src/pygame_sdl2/rect.pxd", }; /*--- Type declarations ---*/ struct __pyx_obj_11pygame_sdl2_5color_Color; struct __pyx_obj_11pygame_sdl2_4rect_Rect; struct __pyx_obj_11pygame_sdl2_7surface_Surface; struct __pyx_opt_args_11pygame_sdl2_4rect_to_sdl_rect; /* "pygame_sdl2/rect.pxd":31 * * * cdef int to_sdl_rect(rectlike, SDL_Rect *rect, argname=*) except -1 # <<<<<<<<<<<<<< */ struct __pyx_opt_args_11pygame_sdl2_4rect_to_sdl_rect { int __pyx_n; PyObject *argname; }; /* "pygame_sdl2/color.pxd":26 * cdef to_sdl_color(color, SDL_Color *out) * * cdef class Color: # <<<<<<<<<<<<<< * # Allow weak references. * cdef object __weakref__ */ struct __pyx_obj_11pygame_sdl2_5color_Color { PyObject_HEAD struct __pyx_vtabstruct_11pygame_sdl2_5color_Color *__pyx_vtab; PyObject *__weakref__; Uint8 r; Uint8 g; Uint8 b; Uint8 a; uint8_t length; }; /* "pygame_sdl2/rect.pxd":21 * from sdl2 cimport * * * cdef class Rect: # <<<<<<<<<<<<<< * # Allow weak references. * cdef object __weakref__ */ struct __pyx_obj_11pygame_sdl2_4rect_Rect { PyObject_HEAD PyObject *__weakref__; int x; int y; int w; int h; }; /* "pygame_sdl2/surface.pxd":23 * from sdl2 cimport SDL_Surface * * cdef class Surface: # <<<<<<<<<<<<<< * # Allow weak references. * cdef object __weakref__ */ struct __pyx_obj_11pygame_sdl2_7surface_Surface { PyObject_HEAD struct __pyx_vtabstruct_11pygame_sdl2_7surface_Surface *__pyx_vtab; PyObject *__weakref__; SDL_Surface *surface; int owns_surface; int window_surface; PyObject *locklist; struct __pyx_obj_11pygame_sdl2_7surface_Surface *parent; struct __pyx_obj_11pygame_sdl2_7surface_Surface *root; int offset_x; int offset_y; PyObject *get_window_flags; int has_alpha; }; /* "pygame_sdl2/color.pxd":26 * cdef to_sdl_color(color, SDL_Color *out) * * cdef class Color: # <<<<<<<<<<<<<< * # Allow weak references. * cdef object __weakref__ */ struct __pyx_vtabstruct_11pygame_sdl2_5color_Color { PyObject *(*from_rgba)(struct __pyx_obj_11pygame_sdl2_5color_Color *, Uint8, Uint8, Uint8, Uint8); PyObject *(*from_name)(struct __pyx_obj_11pygame_sdl2_5color_Color *, PyObject *); PyObject *(*from_hex)(struct __pyx_obj_11pygame_sdl2_5color_Color *, PyObject *); }; static struct __pyx_vtabstruct_11pygame_sdl2_5color_Color *__pyx_vtabptr_11pygame_sdl2_5color_Color; /* "pygame_sdl2/surface.pyx":53 * total_size = 0 * * cdef class Surface: # <<<<<<<<<<<<<< * * def __cinit__(self): */ struct __pyx_vtabstruct_11pygame_sdl2_7surface_Surface { void (*take_surface)(struct __pyx_obj_11pygame_sdl2_7surface_Surface *, SDL_Surface *); }; static struct __pyx_vtabstruct_11pygame_sdl2_7surface_Surface *__pyx_vtabptr_11pygame_sdl2_7surface_Surface; /* --- Runtime support code (head) --- */ /* Refnanny.proto */ #ifndef CYTHON_REFNANNY #define CYTHON_REFNANNY 0 #endif #if CYTHON_REFNANNY typedef struct { void (*INCREF)(void*, PyObject*, int); void (*DECREF)(void*, PyObject*, int); void (*GOTREF)(void*, PyObject*, int); void (*GIVEREF)(void*, PyObject*, int); void* (*SetupContext)(const char*, int, const char*); void (*FinishContext)(void**); } __Pyx_RefNannyAPIStruct; static __Pyx_RefNannyAPIStruct *__Pyx_RefNanny = NULL; static __Pyx_RefNannyAPIStruct *__Pyx_RefNannyImportAPI(const char *modname); #define __Pyx_RefNannyDeclarations void *__pyx_refnanny = NULL; #ifdef WITH_THREAD #define __Pyx_RefNannySetupContext(name, acquire_gil)\ if (acquire_gil) {\ PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure();\ __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), __LINE__, __FILE__);\ PyGILState_Release(__pyx_gilstate_save);\ } else {\ __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), __LINE__, __FILE__);\ } #else #define __Pyx_RefNannySetupContext(name, acquire_gil)\ __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), __LINE__, __FILE__) #endif #define __Pyx_RefNannyFinishContext()\ __Pyx_RefNanny->FinishContext(&__pyx_refnanny) #define __Pyx_INCREF(r) __Pyx_RefNanny->INCREF(__pyx_refnanny, (PyObject *)(r), __LINE__) #define __Pyx_DECREF(r) __Pyx_RefNanny->DECREF(__pyx_refnanny, (PyObject *)(r), __LINE__) #define __Pyx_GOTREF(r) __Pyx_RefNanny->GOTREF(__pyx_refnanny, (PyObject *)(r), __LINE__) #define __Pyx_GIVEREF(r) __Pyx_RefNanny->GIVEREF(__pyx_refnanny, (PyObject *)(r), __LINE__) #define __Pyx_XINCREF(r) do { if((r) != NULL) {__Pyx_INCREF(r); }} while(0) #define __Pyx_XDECREF(r) do { if((r) != NULL) {__Pyx_DECREF(r); }} while(0) #define __Pyx_XGOTREF(r) do { if((r) != NULL) {__Pyx_GOTREF(r); }} while(0) #define __Pyx_XGIVEREF(r) do { if((r) != NULL) {__Pyx_GIVEREF(r);}} while(0) #else #define __Pyx_RefNannyDeclarations #define __Pyx_RefNannySetupContext(name, acquire_gil) #define __Pyx_RefNannyFinishContext() #define __Pyx_INCREF(r) Py_INCREF(r) #define __Pyx_DECREF(r) Py_DECREF(r) #define __Pyx_GOTREF(r) #define __Pyx_GIVEREF(r) #define __Pyx_XINCREF(r) Py_XINCREF(r) #define __Pyx_XDECREF(r) Py_XDECREF(r) #define __Pyx_XGOTREF(r) #define __Pyx_XGIVEREF(r) #endif #define __Pyx_XDECREF_SET(r, v) do {\ PyObject *tmp = (PyObject *) r;\ r = v; __Pyx_XDECREF(tmp);\ } while (0) #define __Pyx_DECREF_SET(r, v) do {\ PyObject *tmp = (PyObject *) r;\ r = v; __Pyx_DECREF(tmp);\ } while (0) #define __Pyx_CLEAR(r) do { PyObject* tmp = ((PyObject*)(r)); r = NULL; __Pyx_DECREF(tmp);} while(0) #define __Pyx_XCLEAR(r) do { if((r) != NULL) {PyObject* tmp = ((PyObject*)(r)); r = NULL; __Pyx_DECREF(tmp);}} while(0) /* PyObjectGetAttrStr.proto */ #if CYTHON_USE_TYPE_SLOTS static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStr(PyObject* obj, PyObject* attr_name) { PyTypeObject* tp = Py_TYPE(obj); if (likely(tp->tp_getattro)) return tp->tp_getattro(obj, attr_name); #if PY_MAJOR_VERSION < 3 if (likely(tp->tp_getattr)) return tp->tp_getattr(obj, PyString_AS_STRING(attr_name)); #endif return PyObject_GetAttr(obj, attr_name); } #else #define __Pyx_PyObject_GetAttrStr(o,n) PyObject_GetAttr(o,n) #endif /* GetBuiltinName.proto */ static PyObject *__Pyx_GetBuiltinName(PyObject *name); /* RaiseArgTupleInvalid.proto */ static void __Pyx_RaiseArgtupleInvalid(const char* func_name, int exact, Py_ssize_t num_min, Py_ssize_t num_max, Py_ssize_t num_found); /* KeywordStringCheck.proto */ static CYTHON_INLINE int __Pyx_CheckKeywordStrings(PyObject *kwdict, const char* function_name, int kw_allowed); /* GetModuleGlobalName.proto */ static CYTHON_INLINE PyObject *__Pyx_GetModuleGlobalName(PyObject *name); /* PyObjectCall.proto */ #if CYTHON_COMPILING_IN_CPYTHON static CYTHON_INLINE PyObject* __Pyx_PyObject_Call(PyObject *func, PyObject *arg, PyObject *kw); #else #define __Pyx_PyObject_Call(func, arg, kw) PyObject_Call(func, arg, kw) #endif /* PyThreadStateGet.proto */ #if CYTHON_FAST_THREAD_STATE #define __Pyx_PyThreadState_declare PyThreadState *__pyx_tstate; #define __Pyx_PyThreadState_assign __pyx_tstate = PyThreadState_GET(); #else #define __Pyx_PyThreadState_declare #define __Pyx_PyThreadState_assign #endif /* PyErrFetchRestore.proto */ #if CYTHON_FAST_THREAD_STATE #define __Pyx_ErrRestoreWithState(type, value, tb) __Pyx_ErrRestoreInState(PyThreadState_GET(), type, value, tb) #define __Pyx_ErrFetchWithState(type, value, tb) __Pyx_ErrFetchInState(PyThreadState_GET(), type, value, tb) #define __Pyx_ErrRestore(type, value, tb) __Pyx_ErrRestoreInState(__pyx_tstate, type, value, tb) #define __Pyx_ErrFetch(type, value, tb) __Pyx_ErrFetchInState(__pyx_tstate, type, value, tb) static CYTHON_INLINE void __Pyx_ErrRestoreInState(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb); static CYTHON_INLINE void __Pyx_ErrFetchInState(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb); #else #define __Pyx_ErrRestoreWithState(type, value, tb) PyErr_Restore(type, value, tb) #define __Pyx_ErrFetchWithState(type, value, tb) PyErr_Fetch(type, value, tb) #define __Pyx_ErrRestore(type, value, tb) PyErr_Restore(type, value, tb) #define __Pyx_ErrFetch(type, value, tb) PyErr_Fetch(type, value, tb) #endif /* WriteUnraisableException.proto */ static void __Pyx_WriteUnraisable(const char *name, int clineno, int lineno, const char *filename, int full_traceback, int nogil); /* RaiseDoubleKeywords.proto */ static void __Pyx_RaiseDoubleKeywordsError(const char* func_name, PyObject* kw_name); /* ParseKeywords.proto */ static int __Pyx_ParseOptionalKeywords(PyObject *kwds, PyObject **argnames[],\ PyObject *kwds2, PyObject *values[], Py_ssize_t num_pos_args,\ const char* function_name); /* RaiseTooManyValuesToUnpack.proto */ static CYTHON_INLINE void __Pyx_RaiseTooManyValuesError(Py_ssize_t expected); /* RaiseNeedMoreValuesToUnpack.proto */ static CYTHON_INLINE void __Pyx_RaiseNeedMoreValuesError(Py_ssize_t index); /* IterFinish.proto */ static CYTHON_INLINE int __Pyx_IterFinish(void); /* UnpackItemEndCheck.proto */ static int __Pyx_IternextUnpackEndCheck(PyObject *retval, Py_ssize_t expected); /* ExtTypeTest.proto */ static CYTHON_INLINE int __Pyx_TypeTest(PyObject *obj, PyTypeObject *type); /* PyCFunctionFastCall.proto */ #if CYTHON_FAST_PYCCALL static CYTHON_INLINE PyObject *__Pyx_PyCFunction_FastCall(PyObject *func, PyObject **args, Py_ssize_t nargs); #else #define __Pyx_PyCFunction_FastCall(func, args, nargs) (assert(0), NULL) #endif /* PyFunctionFastCall.proto */ #if CYTHON_FAST_PYCALL #define __Pyx_PyFunction_FastCall(func, args, nargs)\ __Pyx_PyFunction_FastCallDict((func), (args), (nargs), NULL) #if 1 || PY_VERSION_HEX < 0x030600B1 static PyObject *__Pyx_PyFunction_FastCallDict(PyObject *func, PyObject **args, int nargs, PyObject *kwargs); #else #define __Pyx_PyFunction_FastCallDict(func, args, nargs, kwargs) _PyFunction_FastCallDict(func, args, nargs, kwargs) #endif #endif /* PyObjectCallMethO.proto */ #if CYTHON_COMPILING_IN_CPYTHON static CYTHON_INLINE PyObject* __Pyx_PyObject_CallMethO(PyObject *func, PyObject *arg); #endif /* PyObjectCallOneArg.proto */ static CYTHON_INLINE PyObject* __Pyx_PyObject_CallOneArg(PyObject *func, PyObject *arg); /* PyObjectCallNoArg.proto */ #if CYTHON_COMPILING_IN_CPYTHON static CYTHON_INLINE PyObject* __Pyx_PyObject_CallNoArg(PyObject *func); #else #define __Pyx_PyObject_CallNoArg(func) __Pyx_PyObject_Call(func, __pyx_empty_tuple, NULL) #endif /* RaiseException.proto */ static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, PyObject *cause); /* ArgTypeTest.proto */ static CYTHON_INLINE int __Pyx_ArgTypeTest(PyObject *obj, PyTypeObject *type, int none_allowed, const char *name, int exact); /* GetItemInt.proto */ #define __Pyx_GetItemInt(o, i, type, is_signed, to_py_func, is_list, wraparound, boundscheck)\ (__Pyx_fits_Py_ssize_t(i, type, is_signed) ?\ __Pyx_GetItemInt_Fast(o, (Py_ssize_t)i, is_list, wraparound, boundscheck) :\ (is_list ? (PyErr_SetString(PyExc_IndexError, "list index out of range"), (PyObject*)NULL) :\ __Pyx_GetItemInt_Generic(o, to_py_func(i)))) #define __Pyx_GetItemInt_List(o, i, type, is_signed, to_py_func, is_list, wraparound, boundscheck)\ (__Pyx_fits_Py_ssize_t(i, type, is_signed) ?\ __Pyx_GetItemInt_List_Fast(o, (Py_ssize_t)i, wraparound, boundscheck) :\ (PyErr_SetString(PyExc_IndexError, "list index out of range"), (PyObject*)NULL)) static CYTHON_INLINE PyObject *__Pyx_GetItemInt_List_Fast(PyObject *o, Py_ssize_t i, int wraparound, int boundscheck); #define __Pyx_GetItemInt_Tuple(o, i, type, is_signed, to_py_func, is_list, wraparound, boundscheck)\ (__Pyx_fits_Py_ssize_t(i, type, is_signed) ?\ __Pyx_GetItemInt_Tuple_Fast(o, (Py_ssize_t)i, wraparound, boundscheck) :\ (PyErr_SetString(PyExc_IndexError, "tuple index out of range"), (PyObject*)NULL)) static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Tuple_Fast(PyObject *o, Py_ssize_t i, int wraparound, int boundscheck); static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Generic(PyObject *o, PyObject* j); static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Fast(PyObject *o, Py_ssize_t i, int is_list, int wraparound, int boundscheck); /* ListAppend.proto */ #if CYTHON_USE_PYLIST_INTERNALS && CYTHON_ASSUME_SAFE_MACROS static CYTHON_INLINE int __Pyx_PyList_Append(PyObject* list, PyObject* x) { PyListObject* L = (PyListObject*) list; Py_ssize_t len = Py_SIZE(list); if (likely(L->allocated > len) & likely(len > (L->allocated >> 1))) { Py_INCREF(x); PyList_SET_ITEM(list, len, x); Py_SIZE(list) = len+1; return 0; } return PyList_Append(list, x); } #else #define __Pyx_PyList_Append(L,x) PyList_Append(L,x) #endif /* PyObjectCallMethod1.proto */ static PyObject* __Pyx_PyObject_CallMethod1(PyObject* obj, PyObject* method_name, PyObject* arg); /* append.proto */ static CYTHON_INLINE int __Pyx_PyObject_Append(PyObject* L, PyObject* x); /* PyObjectCallMethod0.proto */ static PyObject* __Pyx_PyObject_CallMethod0(PyObject* obj, PyObject* method_name); /* RaiseNoneIterError.proto */ static CYTHON_INLINE void __Pyx_RaiseNoneNotIterableError(void); /* UnpackTupleError.proto */ static void __Pyx_UnpackTupleError(PyObject *, Py_ssize_t index); /* UnpackTuple2.proto */ static CYTHON_INLINE int __Pyx_unpack_tuple2(PyObject* tuple, PyObject** value1, PyObject** value2, int is_tuple, int has_known_size, int decref_tuple); /* dict_iter.proto */ static CYTHON_INLINE PyObject* __Pyx_dict_iterator(PyObject* dict, int is_dict, PyObject* method_name, Py_ssize_t* p_orig_length, int* p_is_dict); static CYTHON_INLINE int __Pyx_dict_iter_next(PyObject* dict_or_iter, Py_ssize_t orig_length, Py_ssize_t* ppos, PyObject** pkey, PyObject** pvalue, PyObject** pitem, int is_dict); /* SetVTable.proto */ static int __Pyx_SetVtable(PyObject *dict, void *vtable); /* GetVTable.proto */ static void* __Pyx_GetVtable(PyObject *dict); /* Import.proto */ static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list, int level); /* ImportFrom.proto */ static PyObject* __Pyx_ImportFrom(PyObject* module, PyObject* name); /* CodeObjectCache.proto */ typedef struct { PyCodeObject* code_object; int code_line; } __Pyx_CodeObjectCacheEntry; struct __Pyx_CodeObjectCache { int count; int max_count; __Pyx_CodeObjectCacheEntry* entries; }; static struct __Pyx_CodeObjectCache __pyx_code_cache = {0,0,NULL}; static int __pyx_bisect_code_objects(__Pyx_CodeObjectCacheEntry* entries, int count, int code_line); static PyCodeObject *__pyx_find_code_object(int code_line); static void __pyx_insert_code_object(int code_line, PyCodeObject* code_object); /* AddTraceback.proto */ static void __Pyx_AddTraceback(const char *funcname, int c_line, int py_line, const char *filename); /* CIntToPy.proto */ static CYTHON_INLINE PyObject* __Pyx_PyInt_From_int(int value); /* CIntToPy.proto */ static CYTHON_INLINE PyObject* __Pyx_PyInt_From_uint32_t(uint32_t value); /* ForceInitThreads.proto */ #ifndef __PYX_FORCE_INIT_THREADS #define __PYX_FORCE_INIT_THREADS 0 #endif /* CIntToPy.proto */ static CYTHON_INLINE PyObject* __Pyx_PyInt_From_uint8_t(uint8_t value); /* CIntToPy.proto */ static CYTHON_INLINE PyObject* __Pyx_PyInt_From_long(long value); /* CIntToPy.proto */ static CYTHON_INLINE PyObject* __Pyx_PyInt_From_uint64_t(uint64_t value); /* CIntFromPy.proto */ static CYTHON_INLINE int __Pyx_PyInt_As_int(PyObject *); /* CIntFromPy.proto */ static CYTHON_INLINE uint32_t __Pyx_PyInt_As_uint32_t(PyObject *); /* CIntFromPy.proto */ static CYTHON_INLINE uint8_t __Pyx_PyInt_As_uint8_t(PyObject *); /* CIntFromPy.proto */ static CYTHON_INLINE long __Pyx_PyInt_As_long(PyObject *); /* CheckBinaryVersion.proto */ static int __Pyx_check_binary_version(void); /* FunctionExport.proto */ static int __Pyx_ExportFunction(const char *name, void (*f)(void), const char *sig); /* PyIdentifierFromString.proto */ #if !defined(__Pyx_PyIdentifier_FromString) #if PY_MAJOR_VERSION < 3 #define __Pyx_PyIdentifier_FromString(s) PyString_FromString(s) #else #define __Pyx_PyIdentifier_FromString(s) PyUnicode_FromString(s) #endif #endif /* ModuleImport.proto */ static PyObject *__Pyx_ImportModule(const char *name); /* TypeImport.proto */ static PyTypeObject *__Pyx_ImportType(const char *module_name, const char *class_name, size_t size, int strict); /* FunctionImport.proto */ static int __Pyx_ImportFunction(PyObject *module, const char *funcname, void (**f)(void), const char *sig); /* InitStrings.proto */ static int __Pyx_InitStrings(__Pyx_StringTabEntry *t); static void __pyx_f_11pygame_sdl2_7surface_7Surface_take_surface(struct __pyx_obj_11pygame_sdl2_7surface_Surface *__pyx_v_self, SDL_Surface *__pyx_v_surface); /* proto*/ /* Module declarations from 'libc.stdint' */ /* Module declarations from 'libc.string' */ /* Module declarations from 'libc.stdio' */ /* Module declarations from 'libc.stddef' */ /* Module declarations from 'sdl2' */ /* Module declarations from 'pygame_sdl2.color' */ static PyTypeObject *__pyx_ptype_11pygame_sdl2_5color_Color = 0; static Uint32 (*__pyx_f_11pygame_sdl2_5color_map_color)(SDL_Surface *, PyObject *); /*proto*/ static PyObject *(*__pyx_f_11pygame_sdl2_5color_get_color)(Uint32, SDL_Surface *); /*proto*/ /* Module declarations from 'pygame_sdl2.rect' */ static PyTypeObject *__pyx_ptype_11pygame_sdl2_4rect_Rect = 0; static int (*__pyx_f_11pygame_sdl2_4rect_to_sdl_rect)(PyObject *, SDL_Rect *, struct __pyx_opt_args_11pygame_sdl2_4rect_to_sdl_rect *__pyx_optional_args); /*proto*/ /* Module declarations from 'pygame_sdl2.surface' */ static PyTypeObject *__pyx_ptype_11pygame_sdl2_7surface_Surface = 0; static void __pyx_f_11pygame_sdl2_7surface_move_pixels(Uint8 *, Uint8 *, int, int, int, int); /*proto*/ static SDL_Surface *__pyx_f_11pygame_sdl2_7surface_PySurface_AsSurface(PyObject *); /*proto*/ static PyObject *__pyx_f_11pygame_sdl2_7surface_PySurface_New(SDL_Surface *); /*proto*/ #define __Pyx_MODULE_NAME "pygame_sdl2.surface" int __pyx_module_is_main_pygame_sdl2__surface = 0; /* Implementation of 'pygame_sdl2.surface' */ static PyObject *__pyx_builtin_IndexError; static PyObject *__pyx_builtin_ValueError; static const char __pyx_k_2[] = "2"; static const char __pyx_k_dx[] = "dx"; static const char __pyx_k_dy[] = "dy"; static const char __pyx_k_pos[] = "pos"; static const char __pyx_k_Rect[] = "Rect"; static const char __pyx_k_area[] = "area"; static const char __pyx_k_clip[] = "clip"; static const char __pyx_k_dest[] = "dest"; static const char __pyx_k_kind[] = "kind"; static const char __pyx_k_lock[] = "lock"; static const char __pyx_k_main[] = "__main__"; static const char __pyx_k_rect[] = "rect"; static const char __pyx_k_size[] = "size"; static const char __pyx_k_test[] = "__test__"; static const char __pyx_k_warn[] = "warn"; static const char __pyx_k_color[] = "color"; static const char __pyx_k_depth[] = "depth"; static const char __pyx_k_error[] = "error"; static const char __pyx_k_flags[] = "flags"; static const char __pyx_k_items[] = "items"; static const char __pyx_k_masks[] = "masks"; static const char __pyx_k_value[] = "value"; static const char __pyx_k_append[] = "append"; static const char __pyx_k_format[] = "format"; static const char __pyx_k_import[] = "__import__"; static const char __pyx_k_remove[] = "remove"; static const char __pyx_k_source[] = "source"; static const char __pyx_k_unlock[] = "unlock"; static const char __pyx_k_convert[] = "convert"; static const char __pyx_k_display[] = "display"; static const char __pyx_k_surface[] = "surface"; static const char __pyx_k_SRCALPHA[] = "SRCALPHA"; static const char __pyx_k_get_rect[] = "get_rect"; static const char __pyx_k_get_size[] = "get_size"; static const char __pyx_k_warnings[] = "warnings"; static const char __pyx_k_get_alpha[] = "get_alpha"; static const char __pyx_k_min_alpha[] = "min_alpha"; static const char __pyx_k_set_alpha[] = "set_alpha"; static const char __pyx_k_IndexError[] = "IndexError"; static const char __pyx_k_ValueError[] = "ValueError"; static const char __pyx_k_pyx_vtable[] = "__pyx_vtable__"; static const char __pyx_k_subsurface[] = "subsurface"; static const char __pyx_k_total_size[] = "total_size"; static const char __pyx_k_Surface_x_x[] = ""; static const char __pyx_k_get_surface[] = "get_surface"; static const char __pyx_k_pygame_sdl2[] = "pygame_sdl2"; static const char __pyx_k_convert_alpha[] = "convert_alpha"; static const char __pyx_k_special_flags[] = "special_flags"; static const char __pyx_k_pygame_sdl2_rect[] = "pygame_sdl2.rect"; static const char __pyx_k_pygame_sdl2_error[] = "pygame_sdl2.error"; static const char __pyx_k_pygame_sdl2_locals[] = "pygame_sdl2.locals"; static const char __pyx_k_Position_outside_surface[] = "Position outside surface."; static const char __pyx_k_No_video_mode_has_been_set[] = "No video mode has been set."; static const char __pyx_k_Memory_leak_via_Surface_in_pygam[] = "Memory leak via Surface in pygame_sdl2."; static const char __pyx_k_Surface_get_view_is_not_supporte[] = "Surface.get_view is not supported."; static const char __pyx_k_Surface_has_unsupported_bytesize[] = "Surface has unsupported bytesize."; static const char __pyx_k_Surface_set_masks_is_not_support[] = "Surface.set_masks is not supported."; static const char __pyx_k_Surface_set_shifts_is_not_suppor[] = "Surface.set_shifts is not supported."; static const char __pyx_k_subsurface_rectangle_outside_sur[] = "subsurface rectangle outside surface area."; static const char __pyx_k_subsurface_size_must_be_non_nega[] = "subsurface size must be non-negative."; static PyObject *__pyx_kp_u_2; static PyObject *__pyx_n_s_IndexError; static PyObject *__pyx_kp_u_Memory_leak_via_Surface_in_pygam; static PyObject *__pyx_kp_u_No_video_mode_has_been_set; static PyObject *__pyx_kp_u_Position_outside_surface; static PyObject *__pyx_n_s_Rect; static PyObject *__pyx_n_s_SRCALPHA; static PyObject *__pyx_kp_u_Surface_get_view_is_not_supporte; static PyObject *__pyx_kp_u_Surface_has_unsupported_bytesize; static PyObject *__pyx_kp_u_Surface_set_masks_is_not_support; static PyObject *__pyx_kp_u_Surface_set_shifts_is_not_suppor; static PyObject *__pyx_kp_u_Surface_x_x; static PyObject *__pyx_n_s_ValueError; static PyObject *__pyx_n_s_append; static PyObject *__pyx_n_s_area; static PyObject *__pyx_n_u_area; static PyObject *__pyx_n_s_clip; static PyObject *__pyx_n_s_color; static PyObject *__pyx_n_s_convert; static PyObject *__pyx_n_s_convert_alpha; static PyObject *__pyx_n_s_depth; static PyObject *__pyx_n_s_dest; static PyObject *__pyx_n_u_dest; static PyObject *__pyx_n_s_display; static PyObject *__pyx_n_s_dx; static PyObject *__pyx_n_s_dy; static PyObject *__pyx_n_s_error; static PyObject *__pyx_n_s_flags; static PyObject *__pyx_n_s_format; static PyObject *__pyx_n_s_get_alpha; static PyObject *__pyx_n_s_get_rect; static PyObject *__pyx_n_s_get_size; static PyObject *__pyx_n_s_get_surface; static PyObject *__pyx_n_s_import; static PyObject *__pyx_n_s_items; static PyObject *__pyx_n_s_kind; static PyObject *__pyx_n_s_lock; static PyObject *__pyx_n_s_main; static PyObject *__pyx_n_s_masks; static PyObject *__pyx_n_s_min_alpha; static PyObject *__pyx_n_s_pos; static PyObject *__pyx_n_s_pygame_sdl2; static PyObject *__pyx_n_s_pygame_sdl2_error; static PyObject *__pyx_n_s_pygame_sdl2_locals; static PyObject *__pyx_n_s_pygame_sdl2_rect; static PyObject *__pyx_n_s_pyx_vtable; static PyObject *__pyx_n_s_rect; static PyObject *__pyx_n_s_remove; static PyObject *__pyx_n_s_set_alpha; static PyObject *__pyx_n_s_size; static PyObject *__pyx_n_s_source; static PyObject *__pyx_n_s_special_flags; static PyObject *__pyx_n_s_subsurface; static PyObject *__pyx_kp_u_subsurface_rectangle_outside_sur; static PyObject *__pyx_kp_u_subsurface_size_must_be_non_nega; static PyObject *__pyx_n_s_surface; static PyObject *__pyx_n_s_test; static PyObject *__pyx_n_s_total_size; static PyObject *__pyx_n_s_unlock; static PyObject *__pyx_n_s_value; static PyObject *__pyx_n_s_warn; static PyObject *__pyx_n_s_warnings; static int __pyx_pf_11pygame_sdl2_7surface_7Surface___cinit__(struct __pyx_obj_11pygame_sdl2_7surface_Surface *__pyx_v_self); /* proto */ static void __pyx_pf_11pygame_sdl2_7surface_7Surface_2__dealloc__(struct __pyx_obj_11pygame_sdl2_7surface_Surface *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_7surface_7Surface_4__sizeof__(struct __pyx_obj_11pygame_sdl2_7surface_Surface *__pyx_v_self); /* proto */ static int __pyx_pf_11pygame_sdl2_7surface_7Surface_6__init__(struct __pyx_obj_11pygame_sdl2_7surface_Surface *__pyx_v_self, PyObject *__pyx_v_size, PyObject *__pyx_v_flags, PyObject *__pyx_v_depth, PyObject *__pyx_v_masks); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_7surface_7Surface_8__repr__(struct __pyx_obj_11pygame_sdl2_7surface_Surface *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_7surface_7Surface_10blit(struct __pyx_obj_11pygame_sdl2_7surface_Surface *__pyx_v_self, struct __pyx_obj_11pygame_sdl2_7surface_Surface *__pyx_v_source, PyObject *__pyx_v_dest, PyObject *__pyx_v_area, int __pyx_v_special_flags); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_7surface_7Surface_12convert(struct __pyx_obj_11pygame_sdl2_7surface_Surface *__pyx_v_self, PyObject *__pyx_v_surface); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_7surface_7Surface_14convert_alpha(struct __pyx_obj_11pygame_sdl2_7surface_Surface *__pyx_v_self, struct __pyx_obj_11pygame_sdl2_7surface_Surface *__pyx_v_surface); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_7surface_7Surface_16copy(struct __pyx_obj_11pygame_sdl2_7surface_Surface *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_7surface_7Surface_18fill(struct __pyx_obj_11pygame_sdl2_7surface_Surface *__pyx_v_self, PyObject *__pyx_v_color, PyObject *__pyx_v_rect, CYTHON_UNUSED PyObject *__pyx_v_special_flags); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_7surface_7Surface_20scroll(struct __pyx_obj_11pygame_sdl2_7surface_Surface *__pyx_v_self, int __pyx_v_dx, int __pyx_v_dy); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_7surface_7Surface_22set_colorkey(struct __pyx_obj_11pygame_sdl2_7surface_Surface *__pyx_v_self, PyObject *__pyx_v_color, CYTHON_UNUSED PyObject *__pyx_v_flags); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_7surface_7Surface_24get_colorkey(struct __pyx_obj_11pygame_sdl2_7surface_Surface *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_7surface_7Surface_26set_alpha(struct __pyx_obj_11pygame_sdl2_7surface_Surface *__pyx_v_self, PyObject *__pyx_v_value, CYTHON_UNUSED PyObject *__pyx_v_flags); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_7surface_7Surface_28get_alpha(struct __pyx_obj_11pygame_sdl2_7surface_Surface *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_7surface_7Surface_30lock(struct __pyx_obj_11pygame_sdl2_7surface_Surface *__pyx_v_self, PyObject *__pyx_v_lock); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_7surface_7Surface_32unlock(struct __pyx_obj_11pygame_sdl2_7surface_Surface *__pyx_v_self, PyObject *__pyx_v_lock); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_7surface_7Surface_34mustlock(struct __pyx_obj_11pygame_sdl2_7surface_Surface *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_7surface_7Surface_36get_locked(struct __pyx_obj_11pygame_sdl2_7surface_Surface *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_7surface_7Surface_38get_locks(struct __pyx_obj_11pygame_sdl2_7surface_Surface *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_7surface_7Surface_40get_at(struct __pyx_obj_11pygame_sdl2_7surface_Surface *__pyx_v_self, PyObject *__pyx_v_pos); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_7surface_7Surface_42set_at(struct __pyx_obj_11pygame_sdl2_7surface_Surface *__pyx_v_self, PyObject *__pyx_v_pos, PyObject *__pyx_v_color); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_7surface_7Surface_44get_at_mapped(struct __pyx_obj_11pygame_sdl2_7surface_Surface *__pyx_v_self, PyObject *__pyx_v_pos); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_7surface_7Surface_46map_rgb(struct __pyx_obj_11pygame_sdl2_7surface_Surface *__pyx_v_self, PyObject *__pyx_v_color); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_7surface_7Surface_48unmap_rgb(struct __pyx_obj_11pygame_sdl2_7surface_Surface *__pyx_v_self, PyObject *__pyx_v_pixel); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_7surface_7Surface_50set_clip(struct __pyx_obj_11pygame_sdl2_7surface_Surface *__pyx_v_self, PyObject *__pyx_v_rect); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_7surface_7Surface_52get_clip(struct __pyx_obj_11pygame_sdl2_7surface_Surface *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_7surface_7Surface_54subsurface(struct __pyx_obj_11pygame_sdl2_7surface_Surface *__pyx_v_self, PyObject *__pyx_v_args); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_7surface_7Surface_56get_parent(struct __pyx_obj_11pygame_sdl2_7surface_Surface *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_7surface_7Surface_58get_abs_parent(struct __pyx_obj_11pygame_sdl2_7surface_Surface *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_7surface_7Surface_60get_offset(struct __pyx_obj_11pygame_sdl2_7surface_Surface *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_7surface_7Surface_62get_abs_offset(struct __pyx_obj_11pygame_sdl2_7surface_Surface *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_7surface_7Surface_64get_size(struct __pyx_obj_11pygame_sdl2_7surface_Surface *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_7surface_7Surface_66get_width(struct __pyx_obj_11pygame_sdl2_7surface_Surface *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_7surface_7Surface_68get_height(struct __pyx_obj_11pygame_sdl2_7surface_Surface *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_7surface_7Surface_70get_rect(struct __pyx_obj_11pygame_sdl2_7surface_Surface *__pyx_v_self, PyObject *__pyx_v_kwargs); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_7surface_7Surface_72get_bitsize(struct __pyx_obj_11pygame_sdl2_7surface_Surface *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_7surface_7Surface_74get_bytesize(struct __pyx_obj_11pygame_sdl2_7surface_Surface *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_7surface_7Surface_76get_flags(struct __pyx_obj_11pygame_sdl2_7surface_Surface *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_7surface_7Surface_78get_pitch(struct __pyx_obj_11pygame_sdl2_7surface_Surface *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_7surface_7Surface_80get_masks(struct __pyx_obj_11pygame_sdl2_7surface_Surface *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_7surface_7Surface_82set_masks(CYTHON_UNUSED struct __pyx_obj_11pygame_sdl2_7surface_Surface *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v_masks); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_7surface_7Surface_84get_shifts(struct __pyx_obj_11pygame_sdl2_7surface_Surface *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_7surface_7Surface_86set_shifts(CYTHON_UNUSED struct __pyx_obj_11pygame_sdl2_7surface_Surface *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v_shifts); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_7surface_7Surface_88get_shifts(struct __pyx_obj_11pygame_sdl2_7surface_Surface *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_7surface_7Surface_90get_losses(struct __pyx_obj_11pygame_sdl2_7surface_Surface *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_7surface_7Surface_92get_bounding_rect(struct __pyx_obj_11pygame_sdl2_7surface_Surface *__pyx_v_self, PyObject *__pyx_v_min_alpha); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_7surface_7Surface_94get_view(CYTHON_UNUSED struct __pyx_obj_11pygame_sdl2_7surface_Surface *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v_kind); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_7surface_7Surface_96get_buffer(struct __pyx_obj_11pygame_sdl2_7surface_Surface *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_7surface_7Surface_15_pixels_address___get__(struct __pyx_obj_11pygame_sdl2_7surface_Surface *__pyx_v_self); /* proto */ static PyObject *__pyx_tp_new_11pygame_sdl2_7surface_Surface(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ static PyObject *__pyx_int_0; static PyObject *__pyx_int_1; static PyObject *__pyx_int_32; static PyObject *__pyx_int_255; static PyObject *__pyx_int_16843009; static PyObject *__pyx_int_4294967295; static PyObject *__pyx_tuple_; static PyObject *__pyx_tuple__2; static PyObject *__pyx_tuple__3; static PyObject *__pyx_tuple__4; static PyObject *__pyx_tuple__5; static PyObject *__pyx_tuple__6; static PyObject *__pyx_tuple__7; static PyObject *__pyx_tuple__8; static PyObject *__pyx_tuple__9; static PyObject *__pyx_tuple__10; static PyObject *__pyx_tuple__11; static PyObject *__pyx_tuple__12; static PyObject *__pyx_tuple__13; static PyObject *__pyx_tuple__14; static PyObject *__pyx_tuple__15; static PyObject *__pyx_tuple__16; static PyObject *__pyx_tuple__17; static PyObject *__pyx_tuple__18; static PyObject *__pyx_tuple__19; static PyObject *__pyx_tuple__20; static PyObject *__pyx_tuple__21; /* "pygame_sdl2/surface.pyx":37 * SDL_Surface * dst, SDL_Rect * dstrect, int the_args); * * cdef void move_pixels(Uint8 *src, Uint8 *dst, int h, int span, int srcpitch, int dstpitch) nogil: # <<<<<<<<<<<<<< * if src < dst: * src += (h - 1) * srcpitch; */ static void __pyx_f_11pygame_sdl2_7surface_move_pixels(Uint8 *__pyx_v_src, Uint8 *__pyx_v_dst, int __pyx_v_h, int __pyx_v_span, int __pyx_v_srcpitch, int __pyx_v_dstpitch) { int __pyx_t_1; /* "pygame_sdl2/surface.pyx":38 * * cdef void move_pixels(Uint8 *src, Uint8 *dst, int h, int span, int srcpitch, int dstpitch) nogil: * if src < dst: # <<<<<<<<<<<<<< * src += (h - 1) * srcpitch; * dst += (h - 1) * dstpitch; */ __pyx_t_1 = ((__pyx_v_src < __pyx_v_dst) != 0); if (__pyx_t_1) { /* "pygame_sdl2/surface.pyx":39 * cdef void move_pixels(Uint8 *src, Uint8 *dst, int h, int span, int srcpitch, int dstpitch) nogil: * if src < dst: * src += (h - 1) * srcpitch; # <<<<<<<<<<<<<< * dst += (h - 1) * dstpitch; * srcpitch = -srcpitch; */ __pyx_v_src = (__pyx_v_src + ((__pyx_v_h - 1) * __pyx_v_srcpitch)); /* "pygame_sdl2/surface.pyx":40 * if src < dst: * src += (h - 1) * srcpitch; * dst += (h - 1) * dstpitch; # <<<<<<<<<<<<<< * srcpitch = -srcpitch; * dstpitch = -dstpitch; */ __pyx_v_dst = (__pyx_v_dst + ((__pyx_v_h - 1) * __pyx_v_dstpitch)); /* "pygame_sdl2/surface.pyx":41 * src += (h - 1) * srcpitch; * dst += (h - 1) * dstpitch; * srcpitch = -srcpitch; # <<<<<<<<<<<<<< * dstpitch = -dstpitch; * */ __pyx_v_srcpitch = (-__pyx_v_srcpitch); /* "pygame_sdl2/surface.pyx":42 * dst += (h - 1) * dstpitch; * srcpitch = -srcpitch; * dstpitch = -dstpitch; # <<<<<<<<<<<<<< * * while h: */ __pyx_v_dstpitch = (-__pyx_v_dstpitch); /* "pygame_sdl2/surface.pyx":38 * * cdef void move_pixels(Uint8 *src, Uint8 *dst, int h, int span, int srcpitch, int dstpitch) nogil: * if src < dst: # <<<<<<<<<<<<<< * src += (h - 1) * srcpitch; * dst += (h - 1) * dstpitch; */ } /* "pygame_sdl2/surface.pyx":44 * dstpitch = -dstpitch; * * while h: # <<<<<<<<<<<<<< * h -= 1 * memmove(dst, src, span); */ while (1) { __pyx_t_1 = (__pyx_v_h != 0); if (!__pyx_t_1) break; /* "pygame_sdl2/surface.pyx":45 * * while h: * h -= 1 # <<<<<<<<<<<<<< * memmove(dst, src, span); * src += srcpitch; */ __pyx_v_h = (__pyx_v_h - 1); /* "pygame_sdl2/surface.pyx":46 * while h: * h -= 1 * memmove(dst, src, span); # <<<<<<<<<<<<<< * src += srcpitch; * dst += dstpitch; */ memmove(__pyx_v_dst, __pyx_v_src, __pyx_v_span); /* "pygame_sdl2/surface.pyx":47 * h -= 1 * memmove(dst, src, span); * src += srcpitch; # <<<<<<<<<<<<<< * dst += dstpitch; * */ __pyx_v_src = (__pyx_v_src + __pyx_v_srcpitch); /* "pygame_sdl2/surface.pyx":48 * memmove(dst, src, span); * src += srcpitch; * dst += dstpitch; # <<<<<<<<<<<<<< * * # The total size of all allocated surfaces */ __pyx_v_dst = (__pyx_v_dst + __pyx_v_dstpitch); } /* "pygame_sdl2/surface.pyx":37 * SDL_Surface * dst, SDL_Rect * dstrect, int the_args); * * cdef void move_pixels(Uint8 *src, Uint8 *dst, int h, int span, int srcpitch, int dstpitch) nogil: # <<<<<<<<<<<<<< * if src < dst: * src += (h - 1) * srcpitch; */ /* function exit code */ } /* "pygame_sdl2/surface.pyx":55 * cdef class Surface: * * def __cinit__(self): # <<<<<<<<<<<<<< * self.surface = NULL * self.owns_surface = False */ /* Python wrapper */ static int __pyx_pw_11pygame_sdl2_7surface_7Surface_1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static int __pyx_pw_11pygame_sdl2_7surface_7Surface_1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__cinit__ (wrapper)", 0); if (unlikely(PyTuple_GET_SIZE(__pyx_args) > 0)) { __Pyx_RaiseArgtupleInvalid("__cinit__", 1, 0, 0, PyTuple_GET_SIZE(__pyx_args)); return -1;} if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "__cinit__", 0))) return -1; __pyx_r = __pyx_pf_11pygame_sdl2_7surface_7Surface___cinit__(((struct __pyx_obj_11pygame_sdl2_7surface_Surface *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static int __pyx_pf_11pygame_sdl2_7surface_7Surface___cinit__(struct __pyx_obj_11pygame_sdl2_7surface_Surface *__pyx_v_self) { int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__cinit__", 0); /* "pygame_sdl2/surface.pyx":56 * * def __cinit__(self): * self.surface = NULL # <<<<<<<<<<<<<< * self.owns_surface = False * self.window_surface = False */ __pyx_v_self->surface = NULL; /* "pygame_sdl2/surface.pyx":57 * def __cinit__(self): * self.surface = NULL * self.owns_surface = False # <<<<<<<<<<<<<< * self.window_surface = False * self.has_alpha = False */ __pyx_v_self->owns_surface = 0; /* "pygame_sdl2/surface.pyx":58 * self.surface = NULL * self.owns_surface = False * self.window_surface = False # <<<<<<<<<<<<<< * self.has_alpha = False * */ __pyx_v_self->window_surface = 0; /* "pygame_sdl2/surface.pyx":59 * self.owns_surface = False * self.window_surface = False * self.has_alpha = False # <<<<<<<<<<<<<< * * def __dealloc__(self): */ __pyx_v_self->has_alpha = 0; /* "pygame_sdl2/surface.pyx":55 * cdef class Surface: * * def __cinit__(self): # <<<<<<<<<<<<<< * self.surface = NULL * self.owns_surface = False */ /* function exit code */ __pyx_r = 0; __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/surface.pyx":61 * self.has_alpha = False * * def __dealloc__(self): # <<<<<<<<<<<<<< * global total_size * */ /* Python wrapper */ static void __pyx_pw_11pygame_sdl2_7surface_7Surface_3__dealloc__(PyObject *__pyx_v_self); /*proto*/ static void __pyx_pw_11pygame_sdl2_7surface_7Surface_3__dealloc__(PyObject *__pyx_v_self) { __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__dealloc__ (wrapper)", 0); __pyx_pf_11pygame_sdl2_7surface_7Surface_2__dealloc__(((struct __pyx_obj_11pygame_sdl2_7surface_Surface *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); } static void __pyx_pf_11pygame_sdl2_7surface_7Surface_2__dealloc__(struct __pyx_obj_11pygame_sdl2_7surface_Surface *__pyx_v_self) { __Pyx_RefNannyDeclarations int __pyx_t_1; int __pyx_t_2; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; PyObject *__pyx_t_5 = NULL; __Pyx_RefNannySetupContext("__dealloc__", 0); /* "pygame_sdl2/surface.pyx":64 * global total_size * * if self.surface and self.owns_surface: # <<<<<<<<<<<<<< * if total_size: * total_size -= self.surface.pitch * self.surface.h */ __pyx_t_2 = (__pyx_v_self->surface != 0); if (__pyx_t_2) { } else { __pyx_t_1 = __pyx_t_2; goto __pyx_L4_bool_binop_done; } __pyx_t_2 = (__pyx_v_self->owns_surface != 0); __pyx_t_1 = __pyx_t_2; __pyx_L4_bool_binop_done:; if (__pyx_t_1) { /* "pygame_sdl2/surface.pyx":65 * * if self.surface and self.owns_surface: * if total_size: # <<<<<<<<<<<<<< * total_size -= self.surface.pitch * self.surface.h * */ __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_total_size); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 65, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(0, 65, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; if (__pyx_t_1) { /* "pygame_sdl2/surface.pyx":66 * if self.surface and self.owns_surface: * if total_size: * total_size -= self.surface.pitch * self.surface.h # <<<<<<<<<<<<<< * * SDL_FreeSurface(self.surface) */ __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_total_size); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 66, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = __Pyx_PyInt_From_int((__pyx_v_self->surface->pitch * __pyx_v_self->surface->h)); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 66, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_5 = PyNumber_InPlaceSubtract(__pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 66, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; if (PyDict_SetItem(__pyx_d, __pyx_n_s_total_size, __pyx_t_5) < 0) __PYX_ERR(0, 66, __pyx_L1_error) __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; /* "pygame_sdl2/surface.pyx":65 * * if self.surface and self.owns_surface: * if total_size: # <<<<<<<<<<<<<< * total_size -= self.surface.pitch * self.surface.h * */ } /* "pygame_sdl2/surface.pyx":68 * total_size -= self.surface.pitch * self.surface.h * * SDL_FreeSurface(self.surface) # <<<<<<<<<<<<<< * return * elif self.window_surface: */ SDL_FreeSurface(__pyx_v_self->surface); /* "pygame_sdl2/surface.pyx":69 * * SDL_FreeSurface(self.surface) * return # <<<<<<<<<<<<<< * elif self.window_surface: * return */ goto __pyx_L0; /* "pygame_sdl2/surface.pyx":64 * global total_size * * if self.surface and self.owns_surface: # <<<<<<<<<<<<<< * if total_size: * total_size -= self.surface.pitch * self.surface.h */ } /* "pygame_sdl2/surface.pyx":70 * SDL_FreeSurface(self.surface) * return * elif self.window_surface: # <<<<<<<<<<<<<< * return * elif self.parent: */ __pyx_t_1 = (__pyx_v_self->window_surface != 0); if (__pyx_t_1) { /* "pygame_sdl2/surface.pyx":71 * return * elif self.window_surface: * return # <<<<<<<<<<<<<< * elif self.parent: * SDL_FreeSurface(self.surface) */ goto __pyx_L0; /* "pygame_sdl2/surface.pyx":70 * SDL_FreeSurface(self.surface) * return * elif self.window_surface: # <<<<<<<<<<<<<< * return * elif self.parent: */ } /* "pygame_sdl2/surface.pyx":72 * elif self.window_surface: * return * elif self.parent: # <<<<<<<<<<<<<< * SDL_FreeSurface(self.surface) * return */ __pyx_t_1 = __Pyx_PyObject_IsTrue(((PyObject *)__pyx_v_self->parent)); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(0, 72, __pyx_L1_error) if (__pyx_t_1) { /* "pygame_sdl2/surface.pyx":73 * return * elif self.parent: * SDL_FreeSurface(self.surface) # <<<<<<<<<<<<<< * return * */ SDL_FreeSurface(__pyx_v_self->surface); /* "pygame_sdl2/surface.pyx":74 * elif self.parent: * SDL_FreeSurface(self.surface) * return # <<<<<<<<<<<<<< * * warnings.warn("Memory leak via Surface in pygame_sdl2.") */ goto __pyx_L0; /* "pygame_sdl2/surface.pyx":72 * elif self.window_surface: * return * elif self.parent: # <<<<<<<<<<<<<< * SDL_FreeSurface(self.surface) * return */ } /* "pygame_sdl2/surface.pyx":76 * return * * warnings.warn("Memory leak via Surface in pygame_sdl2.") # <<<<<<<<<<<<<< * * def __sizeof__(self): */ __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_warnings); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 76, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_warn); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 76, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_tuple_, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 76, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; /* "pygame_sdl2/surface.pyx":61 * self.has_alpha = False * * def __dealloc__(self): # <<<<<<<<<<<<<< * global total_size * */ /* function exit code */ goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_5); __Pyx_WriteUnraisable("pygame_sdl2.surface.Surface.__dealloc__", __pyx_clineno, __pyx_lineno, __pyx_filename, 0, 0); __pyx_L0:; __Pyx_RefNannyFinishContext(); } /* "pygame_sdl2/surface.pyx":78 * warnings.warn("Memory leak via Surface in pygame_sdl2.") * * def __sizeof__(self): # <<<<<<<<<<<<<< * if self.surface and self.owns_surface: * return self.surface.pitch * self.surface.h */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_7surface_7Surface_5__sizeof__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/ static PyObject *__pyx_pw_11pygame_sdl2_7surface_7Surface_5__sizeof__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__sizeof__ (wrapper)", 0); __pyx_r = __pyx_pf_11pygame_sdl2_7surface_7Surface_4__sizeof__(((struct __pyx_obj_11pygame_sdl2_7surface_Surface *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_7surface_7Surface_4__sizeof__(struct __pyx_obj_11pygame_sdl2_7surface_Surface *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; int __pyx_t_2; PyObject *__pyx_t_3 = NULL; __Pyx_RefNannySetupContext("__sizeof__", 0); /* "pygame_sdl2/surface.pyx":79 * * def __sizeof__(self): * if self.surface and self.owns_surface: # <<<<<<<<<<<<<< * return self.surface.pitch * self.surface.h * else: */ __pyx_t_2 = (__pyx_v_self->surface != 0); if (__pyx_t_2) { } else { __pyx_t_1 = __pyx_t_2; goto __pyx_L4_bool_binop_done; } __pyx_t_2 = (__pyx_v_self->owns_surface != 0); __pyx_t_1 = __pyx_t_2; __pyx_L4_bool_binop_done:; if (__pyx_t_1) { /* "pygame_sdl2/surface.pyx":80 * def __sizeof__(self): * if self.surface and self.owns_surface: * return self.surface.pitch * self.surface.h # <<<<<<<<<<<<<< * else: * return 0 */ __Pyx_XDECREF(__pyx_r); __pyx_t_3 = __Pyx_PyInt_From_int((__pyx_v_self->surface->pitch * __pyx_v_self->surface->h)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 80, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_r = __pyx_t_3; __pyx_t_3 = 0; goto __pyx_L0; /* "pygame_sdl2/surface.pyx":79 * * def __sizeof__(self): * if self.surface and self.owns_surface: # <<<<<<<<<<<<<< * return self.surface.pitch * self.surface.h * else: */ } /* "pygame_sdl2/surface.pyx":82 * return self.surface.pitch * self.surface.h * else: * return 0 # <<<<<<<<<<<<<< * * def __init__(self, size, flags=0, depth=32, masks=None): */ /*else*/ { __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(__pyx_int_0); __pyx_r = __pyx_int_0; goto __pyx_L0; } /* "pygame_sdl2/surface.pyx":78 * warnings.warn("Memory leak via Surface in pygame_sdl2.") * * def __sizeof__(self): # <<<<<<<<<<<<<< * if self.surface and self.owns_surface: * return self.surface.pitch * self.surface.h */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("pygame_sdl2.surface.Surface.__sizeof__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/surface.pyx":84 * return 0 * * def __init__(self, size, flags=0, depth=32, masks=None): # <<<<<<<<<<<<<< * * self.locklist = None */ /* Python wrapper */ static int __pyx_pw_11pygame_sdl2_7surface_7Surface_7__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static int __pyx_pw_11pygame_sdl2_7surface_7Surface_7__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_size = 0; PyObject *__pyx_v_flags = 0; PyObject *__pyx_v_depth = 0; PyObject *__pyx_v_masks = 0; int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__init__ (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_size,&__pyx_n_s_flags,&__pyx_n_s_depth,&__pyx_n_s_masks,0}; PyObject* values[4] = {0,0,0,0}; values[1] = ((PyObject *)__pyx_int_0); values[2] = ((PyObject *)__pyx_int_32); values[3] = ((PyObject *)Py_None); if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_size)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; case 1: if (kw_args > 0) { PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_flags); if (value) { values[1] = value; kw_args--; } } case 2: if (kw_args > 0) { PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_depth); if (value) { values[2] = value; kw_args--; } } case 3: if (kw_args > 0) { PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_masks); if (value) { values[3] = value; kw_args--; } } } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__init__") < 0)) __PYX_ERR(0, 84, __pyx_L3_error) } } else { switch (PyTuple_GET_SIZE(__pyx_args)) { case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_size = values[0]; __pyx_v_flags = values[1]; __pyx_v_depth = values[2]; __pyx_v_masks = values[3]; } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("__init__", 0, 1, 4, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 84, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("pygame_sdl2.surface.Surface.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return -1; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_11pygame_sdl2_7surface_7Surface_6__init__(((struct __pyx_obj_11pygame_sdl2_7surface_Surface *)__pyx_v_self), __pyx_v_size, __pyx_v_flags, __pyx_v_depth, __pyx_v_masks); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static int __pyx_pf_11pygame_sdl2_7surface_7Surface_6__init__(struct __pyx_obj_11pygame_sdl2_7surface_Surface *__pyx_v_self, PyObject *__pyx_v_size, PyObject *__pyx_v_flags, PyObject *__pyx_v_depth, PyObject *__pyx_v_masks) { int __pyx_v_w; int __pyx_v_h; Uint32 __pyx_v_Rmask; Uint32 __pyx_v_Gmask; Uint32 __pyx_v_Bmask; Uint32 __pyx_v_Amask; SDL_Surface *__pyx_v_sample; struct __pyx_obj_11pygame_sdl2_7surface_Surface *__pyx_v_pysample = 0; int __pyx_v_depth_int; SDL_Surface *__pyx_v_surface; int __pyx_r; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_t_2; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; PyObject *(*__pyx_t_5)(PyObject *); int __pyx_t_6; int __pyx_t_7; int __pyx_t_8; PyObject *__pyx_t_9 = NULL; PyObject *__pyx_t_10 = NULL; Uint32 __pyx_t_11; Uint32 __pyx_t_12; Uint32 __pyx_t_13; Uint32 __pyx_t_14; SDL_Surface *__pyx_t_15; Uint8 __pyx_t_16; __Pyx_RefNannySetupContext("__init__", 0); /* "pygame_sdl2/surface.pyx":86 * def __init__(self, size, flags=0, depth=32, masks=None): * * self.locklist = None # <<<<<<<<<<<<<< * self.parent = None * */ __Pyx_INCREF(Py_None); __Pyx_GIVEREF(Py_None); __Pyx_GOTREF(__pyx_v_self->locklist); __Pyx_DECREF(__pyx_v_self->locklist); __pyx_v_self->locklist = Py_None; /* "pygame_sdl2/surface.pyx":87 * * self.locklist = None * self.parent = None # <<<<<<<<<<<<<< * * self.offset_x = 0 */ __Pyx_INCREF(Py_None); __Pyx_GIVEREF(Py_None); __Pyx_GOTREF(__pyx_v_self->parent); __Pyx_DECREF(((PyObject *)__pyx_v_self->parent)); __pyx_v_self->parent = ((struct __pyx_obj_11pygame_sdl2_7surface_Surface *)Py_None); /* "pygame_sdl2/surface.pyx":89 * self.parent = None * * self.offset_x = 0 # <<<<<<<<<<<<<< * self.offset_y = 0 * */ __pyx_v_self->offset_x = 0; /* "pygame_sdl2/surface.pyx":90 * * self.offset_x = 0 * self.offset_y = 0 # <<<<<<<<<<<<<< * * self.get_window_flags = None */ __pyx_v_self->offset_y = 0; /* "pygame_sdl2/surface.pyx":92 * self.offset_y = 0 * * self.get_window_flags = None # <<<<<<<<<<<<<< * * # When size is an empty tuple, we do not create a surface, and */ __Pyx_INCREF(Py_None); __Pyx_GIVEREF(Py_None); __Pyx_GOTREF(__pyx_v_self->get_window_flags); __Pyx_DECREF(__pyx_v_self->get_window_flags); __pyx_v_self->get_window_flags = Py_None; /* "pygame_sdl2/surface.pyx":96 * # When size is an empty tuple, we do not create a surface, and * # expect our caller to set this object up. * if size == (): # <<<<<<<<<<<<<< * return * */ __pyx_t_1 = PyObject_RichCompare(__pyx_v_size, __pyx_empty_tuple, Py_EQ); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 96, __pyx_L1_error) __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 96, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (__pyx_t_2) { /* "pygame_sdl2/surface.pyx":97 * # expect our caller to set this object up. * if size == (): * return # <<<<<<<<<<<<<< * * cdef int w */ __pyx_r = 0; goto __pyx_L0; /* "pygame_sdl2/surface.pyx":96 * # When size is an empty tuple, we do not create a surface, and * # expect our caller to set this object up. * if size == (): # <<<<<<<<<<<<<< * return * */ } /* "pygame_sdl2/surface.pyx":102 * cdef int h * * w, h = size # <<<<<<<<<<<<<< * assert w >= 0 * assert h >= 0 */ if ((likely(PyTuple_CheckExact(__pyx_v_size))) || (PyList_CheckExact(__pyx_v_size))) { PyObject* sequence = __pyx_v_size; #if !CYTHON_COMPILING_IN_PYPY Py_ssize_t size = Py_SIZE(sequence); #else Py_ssize_t size = PySequence_Size(sequence); #endif if (unlikely(size != 2)) { if (size > 2) __Pyx_RaiseTooManyValuesError(2); else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); __PYX_ERR(0, 102, __pyx_L1_error) } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS if (likely(PyTuple_CheckExact(sequence))) { __pyx_t_1 = PyTuple_GET_ITEM(sequence, 0); __pyx_t_3 = PyTuple_GET_ITEM(sequence, 1); } else { __pyx_t_1 = PyList_GET_ITEM(sequence, 0); __pyx_t_3 = PyList_GET_ITEM(sequence, 1); } __Pyx_INCREF(__pyx_t_1); __Pyx_INCREF(__pyx_t_3); #else __pyx_t_1 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 102, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_3 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 102, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); #endif } else { Py_ssize_t index = -1; __pyx_t_4 = PyObject_GetIter(__pyx_v_size); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 102, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_5 = Py_TYPE(__pyx_t_4)->tp_iternext; index = 0; __pyx_t_1 = __pyx_t_5(__pyx_t_4); if (unlikely(!__pyx_t_1)) goto __pyx_L4_unpacking_failed; __Pyx_GOTREF(__pyx_t_1); index = 1; __pyx_t_3 = __pyx_t_5(__pyx_t_4); if (unlikely(!__pyx_t_3)) goto __pyx_L4_unpacking_failed; __Pyx_GOTREF(__pyx_t_3); if (__Pyx_IternextUnpackEndCheck(__pyx_t_5(__pyx_t_4), 2) < 0) __PYX_ERR(0, 102, __pyx_L1_error) __pyx_t_5 = NULL; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; goto __pyx_L5_unpacking_done; __pyx_L4_unpacking_failed:; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_t_5 = NULL; if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); __PYX_ERR(0, 102, __pyx_L1_error) __pyx_L5_unpacking_done:; } __pyx_t_6 = __Pyx_PyInt_As_int(__pyx_t_1); if (unlikely((__pyx_t_6 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 102, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_7 = __Pyx_PyInt_As_int(__pyx_t_3); if (unlikely((__pyx_t_7 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 102, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_v_w = __pyx_t_6; __pyx_v_h = __pyx_t_7; /* "pygame_sdl2/surface.pyx":103 * * w, h = size * assert w >= 0 # <<<<<<<<<<<<<< * assert h >= 0 * */ #ifndef CYTHON_WITHOUT_ASSERTIONS if (unlikely(!Py_OptimizeFlag)) { if (unlikely(!((__pyx_v_w >= 0) != 0))) { PyErr_SetNone(PyExc_AssertionError); __PYX_ERR(0, 103, __pyx_L1_error) } } #endif /* "pygame_sdl2/surface.pyx":104 * w, h = size * assert w >= 0 * assert h >= 0 # <<<<<<<<<<<<<< * * cdef Uint32 Rmask, Gmask, Bmask, Amask */ #ifndef CYTHON_WITHOUT_ASSERTIONS if (unlikely(!Py_OptimizeFlag)) { if (unlikely(!((__pyx_v_h >= 0) != 0))) { PyErr_SetNone(PyExc_AssertionError); __PYX_ERR(0, 104, __pyx_L1_error) } } #endif /* "pygame_sdl2/surface.pyx":111 * cdef int depth_int * * if masks is not None: # <<<<<<<<<<<<<< * Rmask, Gmask, Bmask, Amask = masks * depth_int = depth */ __pyx_t_2 = (__pyx_v_masks != Py_None); __pyx_t_8 = (__pyx_t_2 != 0); if (__pyx_t_8) { /* "pygame_sdl2/surface.pyx":112 * * if masks is not None: * Rmask, Gmask, Bmask, Amask = masks # <<<<<<<<<<<<<< * depth_int = depth * */ if ((likely(PyTuple_CheckExact(__pyx_v_masks))) || (PyList_CheckExact(__pyx_v_masks))) { PyObject* sequence = __pyx_v_masks; #if !CYTHON_COMPILING_IN_PYPY Py_ssize_t size = Py_SIZE(sequence); #else Py_ssize_t size = PySequence_Size(sequence); #endif if (unlikely(size != 4)) { if (size > 4) __Pyx_RaiseTooManyValuesError(4); else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); __PYX_ERR(0, 112, __pyx_L1_error) } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS if (likely(PyTuple_CheckExact(sequence))) { __pyx_t_3 = PyTuple_GET_ITEM(sequence, 0); __pyx_t_1 = PyTuple_GET_ITEM(sequence, 1); __pyx_t_4 = PyTuple_GET_ITEM(sequence, 2); __pyx_t_9 = PyTuple_GET_ITEM(sequence, 3); } else { __pyx_t_3 = PyList_GET_ITEM(sequence, 0); __pyx_t_1 = PyList_GET_ITEM(sequence, 1); __pyx_t_4 = PyList_GET_ITEM(sequence, 2); __pyx_t_9 = PyList_GET_ITEM(sequence, 3); } __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(__pyx_t_1); __Pyx_INCREF(__pyx_t_4); __Pyx_INCREF(__pyx_t_9); #else { Py_ssize_t i; PyObject** temps[4] = {&__pyx_t_3,&__pyx_t_1,&__pyx_t_4,&__pyx_t_9}; for (i=0; i < 4; i++) { PyObject* item = PySequence_ITEM(sequence, i); if (unlikely(!item)) __PYX_ERR(0, 112, __pyx_L1_error) __Pyx_GOTREF(item); *(temps[i]) = item; } } #endif } else { Py_ssize_t index = -1; PyObject** temps[4] = {&__pyx_t_3,&__pyx_t_1,&__pyx_t_4,&__pyx_t_9}; __pyx_t_10 = PyObject_GetIter(__pyx_v_masks); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 112, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_10); __pyx_t_5 = Py_TYPE(__pyx_t_10)->tp_iternext; for (index=0; index < 4; index++) { PyObject* item = __pyx_t_5(__pyx_t_10); if (unlikely(!item)) goto __pyx_L7_unpacking_failed; __Pyx_GOTREF(item); *(temps[index]) = item; } if (__Pyx_IternextUnpackEndCheck(__pyx_t_5(__pyx_t_10), 4) < 0) __PYX_ERR(0, 112, __pyx_L1_error) __pyx_t_5 = NULL; __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; goto __pyx_L8_unpacking_done; __pyx_L7_unpacking_failed:; __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; __pyx_t_5 = NULL; if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); __PYX_ERR(0, 112, __pyx_L1_error) __pyx_L8_unpacking_done:; } __pyx_t_11 = __Pyx_PyInt_As_uint32_t(__pyx_t_3); if (unlikely((__pyx_t_11 == ((Uint32)-1)) && PyErr_Occurred())) __PYX_ERR(0, 112, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_12 = __Pyx_PyInt_As_uint32_t(__pyx_t_1); if (unlikely((__pyx_t_12 == ((Uint32)-1)) && PyErr_Occurred())) __PYX_ERR(0, 112, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_13 = __Pyx_PyInt_As_uint32_t(__pyx_t_4); if (unlikely((__pyx_t_13 == ((Uint32)-1)) && PyErr_Occurred())) __PYX_ERR(0, 112, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_t_14 = __Pyx_PyInt_As_uint32_t(__pyx_t_9); if (unlikely((__pyx_t_14 == ((Uint32)-1)) && PyErr_Occurred())) __PYX_ERR(0, 112, __pyx_L1_error) __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; __pyx_v_Rmask = __pyx_t_11; __pyx_v_Gmask = __pyx_t_12; __pyx_v_Bmask = __pyx_t_13; __pyx_v_Amask = __pyx_t_14; /* "pygame_sdl2/surface.pyx":113 * if masks is not None: * Rmask, Gmask, Bmask, Amask = masks * depth_int = depth # <<<<<<<<<<<<<< * * elif isinstance(depth, Surface): */ __pyx_t_7 = __Pyx_PyInt_As_int(__pyx_v_depth); if (unlikely((__pyx_t_7 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 113, __pyx_L1_error) __pyx_v_depth_int = __pyx_t_7; /* "pygame_sdl2/surface.pyx":111 * cdef int depth_int * * if masks is not None: # <<<<<<<<<<<<<< * Rmask, Gmask, Bmask, Amask = masks * depth_int = depth */ goto __pyx_L6; } /* "pygame_sdl2/surface.pyx":115 * depth_int = depth * * elif isinstance(depth, Surface): # <<<<<<<<<<<<<< * * pysample = depth */ __pyx_t_8 = __Pyx_TypeCheck(__pyx_v_depth, __pyx_ptype_11pygame_sdl2_7surface_Surface); __pyx_t_2 = (__pyx_t_8 != 0); if (__pyx_t_2) { /* "pygame_sdl2/surface.pyx":117 * elif isinstance(depth, Surface): * * pysample = depth # <<<<<<<<<<<<<< * sample = pysample.surface * Rmask = sample.format.Rmask */ if (!(likely(((__pyx_v_depth) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_depth, __pyx_ptype_11pygame_sdl2_7surface_Surface))))) __PYX_ERR(0, 117, __pyx_L1_error) __pyx_t_9 = __pyx_v_depth; __Pyx_INCREF(__pyx_t_9); __pyx_v_pysample = ((struct __pyx_obj_11pygame_sdl2_7surface_Surface *)__pyx_t_9); __pyx_t_9 = 0; /* "pygame_sdl2/surface.pyx":118 * * pysample = depth * sample = pysample.surface # <<<<<<<<<<<<<< * Rmask = sample.format.Rmask * Gmask = sample.format.Gmask */ __pyx_t_15 = __pyx_v_pysample->surface; __pyx_v_sample = __pyx_t_15; /* "pygame_sdl2/surface.pyx":119 * pysample = depth * sample = pysample.surface * Rmask = sample.format.Rmask # <<<<<<<<<<<<<< * Gmask = sample.format.Gmask * Bmask = sample.format.Bmask */ __pyx_t_14 = __pyx_v_sample->format->Rmask; __pyx_v_Rmask = __pyx_t_14; /* "pygame_sdl2/surface.pyx":120 * sample = pysample.surface * Rmask = sample.format.Rmask * Gmask = sample.format.Gmask # <<<<<<<<<<<<<< * Bmask = sample.format.Bmask * Amask = sample.format.Amask */ __pyx_t_14 = __pyx_v_sample->format->Gmask; __pyx_v_Gmask = __pyx_t_14; /* "pygame_sdl2/surface.pyx":121 * Rmask = sample.format.Rmask * Gmask = sample.format.Gmask * Bmask = sample.format.Bmask # <<<<<<<<<<<<<< * Amask = sample.format.Amask * depth_int = sample.format.BitsPerPixel */ __pyx_t_14 = __pyx_v_sample->format->Bmask; __pyx_v_Bmask = __pyx_t_14; /* "pygame_sdl2/surface.pyx":122 * Gmask = sample.format.Gmask * Bmask = sample.format.Bmask * Amask = sample.format.Amask # <<<<<<<<<<<<<< * depth_int = sample.format.BitsPerPixel * */ __pyx_t_14 = __pyx_v_sample->format->Amask; __pyx_v_Amask = __pyx_t_14; /* "pygame_sdl2/surface.pyx":123 * Bmask = sample.format.Bmask * Amask = sample.format.Amask * depth_int = sample.format.BitsPerPixel # <<<<<<<<<<<<<< * * else: */ __pyx_t_16 = __pyx_v_sample->format->BitsPerPixel; __pyx_v_depth_int = __pyx_t_16; /* "pygame_sdl2/surface.pyx":115 * depth_int = depth * * elif isinstance(depth, Surface): # <<<<<<<<<<<<<< * * pysample = depth */ goto __pyx_L6; } /* "pygame_sdl2/surface.pyx":127 * else: * * pysample = pygame_sdl2.display.get_surface() # <<<<<<<<<<<<<< * * if pysample and pysample.surface.format.BitsPerPixel == 32: */ /*else*/ { __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_pygame_sdl2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 127, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_display); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 127, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_get_surface); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 127, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_1 = NULL; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_4))) { __pyx_t_1 = PyMethod_GET_SELF(__pyx_t_4); if (likely(__pyx_t_1)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4); __Pyx_INCREF(__pyx_t_1); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_4, function); } } if (__pyx_t_1) { __pyx_t_9 = __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_1); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 127, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; } else { __pyx_t_9 = __Pyx_PyObject_CallNoArg(__pyx_t_4); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 127, __pyx_L1_error) } __Pyx_GOTREF(__pyx_t_9); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; if (!(likely(((__pyx_t_9) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_9, __pyx_ptype_11pygame_sdl2_7surface_Surface))))) __PYX_ERR(0, 127, __pyx_L1_error) __pyx_v_pysample = ((struct __pyx_obj_11pygame_sdl2_7surface_Surface *)__pyx_t_9); __pyx_t_9 = 0; /* "pygame_sdl2/surface.pyx":129 * pysample = pygame_sdl2.display.get_surface() * * if pysample and pysample.surface.format.BitsPerPixel == 32: # <<<<<<<<<<<<<< * sample = pysample.surface * Rmask = sample.format.Rmask */ __pyx_t_8 = __Pyx_PyObject_IsTrue(((PyObject *)__pyx_v_pysample)); if (unlikely(__pyx_t_8 < 0)) __PYX_ERR(0, 129, __pyx_L1_error) if (__pyx_t_8) { } else { __pyx_t_2 = __pyx_t_8; goto __pyx_L10_bool_binop_done; } __pyx_t_8 = ((__pyx_v_pysample->surface->format->BitsPerPixel == 32) != 0); __pyx_t_2 = __pyx_t_8; __pyx_L10_bool_binop_done:; if (__pyx_t_2) { /* "pygame_sdl2/surface.pyx":130 * * if pysample and pysample.surface.format.BitsPerPixel == 32: * sample = pysample.surface # <<<<<<<<<<<<<< * Rmask = sample.format.Rmask * Gmask = sample.format.Gmask */ __pyx_t_15 = __pyx_v_pysample->surface; __pyx_v_sample = __pyx_t_15; /* "pygame_sdl2/surface.pyx":131 * if pysample and pysample.surface.format.BitsPerPixel == 32: * sample = pysample.surface * Rmask = sample.format.Rmask # <<<<<<<<<<<<<< * Gmask = sample.format.Gmask * Bmask = sample.format.Bmask */ __pyx_t_14 = __pyx_v_sample->format->Rmask; __pyx_v_Rmask = __pyx_t_14; /* "pygame_sdl2/surface.pyx":132 * sample = pysample.surface * Rmask = sample.format.Rmask * Gmask = sample.format.Gmask # <<<<<<<<<<<<<< * Bmask = sample.format.Bmask * Amask = sample.format.Amask */ __pyx_t_14 = __pyx_v_sample->format->Gmask; __pyx_v_Gmask = __pyx_t_14; /* "pygame_sdl2/surface.pyx":133 * Rmask = sample.format.Rmask * Gmask = sample.format.Gmask * Bmask = sample.format.Bmask # <<<<<<<<<<<<<< * Amask = sample.format.Amask * */ __pyx_t_14 = __pyx_v_sample->format->Bmask; __pyx_v_Bmask = __pyx_t_14; /* "pygame_sdl2/surface.pyx":134 * Gmask = sample.format.Gmask * Bmask = sample.format.Bmask * Amask = sample.format.Amask # <<<<<<<<<<<<<< * * else: */ __pyx_t_14 = __pyx_v_sample->format->Amask; __pyx_v_Amask = __pyx_t_14; /* "pygame_sdl2/surface.pyx":129 * pysample = pygame_sdl2.display.get_surface() * * if pysample and pysample.surface.format.BitsPerPixel == 32: # <<<<<<<<<<<<<< * sample = pysample.surface * Rmask = sample.format.Rmask */ goto __pyx_L9; } /* "pygame_sdl2/surface.pyx":139 * * # RGB(A) * if SDL_BYTEORDER == SDL_BIG_ENDIAN: # <<<<<<<<<<<<<< * Rmask = 0xff000000 * Gmask = 0x00ff0000 */ /*else*/ { __pyx_t_2 = ((SDL_BYTEORDER == SDL_BIG_ENDIAN) != 0); if (__pyx_t_2) { /* "pygame_sdl2/surface.pyx":140 * # RGB(A) * if SDL_BYTEORDER == SDL_BIG_ENDIAN: * Rmask = 0xff000000 # <<<<<<<<<<<<<< * Gmask = 0x00ff0000 * Bmask = 0x0000ff00 */ __pyx_v_Rmask = 0xff000000; /* "pygame_sdl2/surface.pyx":141 * if SDL_BYTEORDER == SDL_BIG_ENDIAN: * Rmask = 0xff000000 * Gmask = 0x00ff0000 # <<<<<<<<<<<<<< * Bmask = 0x0000ff00 * Amask = 0 */ __pyx_v_Gmask = 0x00ff0000; /* "pygame_sdl2/surface.pyx":142 * Rmask = 0xff000000 * Gmask = 0x00ff0000 * Bmask = 0x0000ff00 # <<<<<<<<<<<<<< * Amask = 0 * else: */ __pyx_v_Bmask = 0x0000ff00; /* "pygame_sdl2/surface.pyx":143 * Gmask = 0x00ff0000 * Bmask = 0x0000ff00 * Amask = 0 # <<<<<<<<<<<<<< * else: * Rmask = 0x000000ff */ __pyx_v_Amask = 0; /* "pygame_sdl2/surface.pyx":139 * * # RGB(A) * if SDL_BYTEORDER == SDL_BIG_ENDIAN: # <<<<<<<<<<<<<< * Rmask = 0xff000000 * Gmask = 0x00ff0000 */ goto __pyx_L12; } /* "pygame_sdl2/surface.pyx":145 * Amask = 0 * else: * Rmask = 0x000000ff # <<<<<<<<<<<<<< * Gmask = 0x0000ff00 * Bmask = 0x00ff0000 */ /*else*/ { __pyx_v_Rmask = 0x000000ff; /* "pygame_sdl2/surface.pyx":146 * else: * Rmask = 0x000000ff * Gmask = 0x0000ff00 # <<<<<<<<<<<<<< * Bmask = 0x00ff0000 * Amask = 0 */ __pyx_v_Gmask = 0x0000ff00; /* "pygame_sdl2/surface.pyx":147 * Rmask = 0x000000ff * Gmask = 0x0000ff00 * Bmask = 0x00ff0000 # <<<<<<<<<<<<<< * Amask = 0 * */ __pyx_v_Bmask = 0x00ff0000; /* "pygame_sdl2/surface.pyx":148 * Gmask = 0x0000ff00 * Bmask = 0x00ff0000 * Amask = 0 # <<<<<<<<<<<<<< * * if (flags & SRCALPHA): */ __pyx_v_Amask = 0; } __pyx_L12:; } __pyx_L9:; /* "pygame_sdl2/surface.pyx":150 * Amask = 0 * * if (flags & SRCALPHA): # <<<<<<<<<<<<<< * if not Amask: * Amask = 0xffffffff & ~(Rmask | Gmask | Bmask) */ __pyx_t_9 = __Pyx_GetModuleGlobalName(__pyx_n_s_SRCALPHA); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 150, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); __pyx_t_4 = PyNumber_And(__pyx_v_flags, __pyx_t_9); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 150, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 150, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; if (__pyx_t_2) { /* "pygame_sdl2/surface.pyx":151 * * if (flags & SRCALPHA): * if not Amask: # <<<<<<<<<<<<<< * Amask = 0xffffffff & ~(Rmask | Gmask | Bmask) * else: */ __pyx_t_2 = ((!(__pyx_v_Amask != 0)) != 0); if (__pyx_t_2) { /* "pygame_sdl2/surface.pyx":152 * if (flags & SRCALPHA): * if not Amask: * Amask = 0xffffffff & ~(Rmask | Gmask | Bmask) # <<<<<<<<<<<<<< * else: * Amask = 0 */ __pyx_t_4 = __Pyx_PyInt_From_uint32_t((~((__pyx_v_Rmask | __pyx_v_Gmask) | __pyx_v_Bmask))); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 152, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_9 = PyNumber_And(__pyx_int_4294967295, __pyx_t_4); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 152, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_t_14 = __Pyx_PyInt_As_uint32_t(__pyx_t_9); if (unlikely((__pyx_t_14 == ((Uint32)-1)) && PyErr_Occurred())) __PYX_ERR(0, 152, __pyx_L1_error) __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; __pyx_v_Amask = __pyx_t_14; /* "pygame_sdl2/surface.pyx":151 * * if (flags & SRCALPHA): * if not Amask: # <<<<<<<<<<<<<< * Amask = 0xffffffff & ~(Rmask | Gmask | Bmask) * else: */ } /* "pygame_sdl2/surface.pyx":150 * Amask = 0 * * if (flags & SRCALPHA): # <<<<<<<<<<<<<< * if not Amask: * Amask = 0xffffffff & ~(Rmask | Gmask | Bmask) */ goto __pyx_L13; } /* "pygame_sdl2/surface.pyx":154 * Amask = 0xffffffff & ~(Rmask | Gmask | Bmask) * else: * Amask = 0 # <<<<<<<<<<<<<< * * depth_int = 32 */ /*else*/ { __pyx_v_Amask = 0; } __pyx_L13:; /* "pygame_sdl2/surface.pyx":156 * Amask = 0 * * depth_int = 32 # <<<<<<<<<<<<<< * * cdef SDL_Surface *surface */ __pyx_v_depth_int = 32; } __pyx_L6:; /* "pygame_sdl2/surface.pyx":160 * cdef SDL_Surface *surface * * with nogil: # <<<<<<<<<<<<<< * surface = SDL_CreateRGBSurface(0, w, h, depth_int, Rmask, Gmask, Bmask, Amask) * */ { #ifdef WITH_THREAD PyThreadState *_save; Py_UNBLOCK_THREADS #endif /*try:*/ { /* "pygame_sdl2/surface.pyx":161 * * with nogil: * surface = SDL_CreateRGBSurface(0, w, h, depth_int, Rmask, Gmask, Bmask, Amask) # <<<<<<<<<<<<<< * * if not surface: */ __pyx_v_surface = SDL_CreateRGBSurface(0, __pyx_v_w, __pyx_v_h, __pyx_v_depth_int, __pyx_v_Rmask, __pyx_v_Gmask, __pyx_v_Bmask, __pyx_v_Amask); } /* "pygame_sdl2/surface.pyx":160 * cdef SDL_Surface *surface * * with nogil: # <<<<<<<<<<<<<< * surface = SDL_CreateRGBSurface(0, w, h, depth_int, Rmask, Gmask, Bmask, Amask) * */ /*finally:*/ { /*normal exit:*/{ #ifdef WITH_THREAD Py_BLOCK_THREADS #endif goto __pyx_L17; } __pyx_L17:; } } /* "pygame_sdl2/surface.pyx":163 * surface = SDL_CreateRGBSurface(0, w, h, depth_int, Rmask, Gmask, Bmask, Amask) * * if not surface: # <<<<<<<<<<<<<< * raise error() * */ __pyx_t_2 = ((!(__pyx_v_surface != 0)) != 0); if (__pyx_t_2) { /* "pygame_sdl2/surface.pyx":164 * * if not surface: * raise error() # <<<<<<<<<<<<<< * * self.take_surface(surface) */ __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_error); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 164, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_1 = NULL; if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_4))) { __pyx_t_1 = PyMethod_GET_SELF(__pyx_t_4); if (likely(__pyx_t_1)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4); __Pyx_INCREF(__pyx_t_1); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_4, function); } } if (__pyx_t_1) { __pyx_t_9 = __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_1); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 164, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; } else { __pyx_t_9 = __Pyx_PyObject_CallNoArg(__pyx_t_4); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 164, __pyx_L1_error) } __Pyx_GOTREF(__pyx_t_9); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_Raise(__pyx_t_9, 0, 0, 0); __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; __PYX_ERR(0, 164, __pyx_L1_error) /* "pygame_sdl2/surface.pyx":163 * surface = SDL_CreateRGBSurface(0, w, h, depth_int, Rmask, Gmask, Bmask, Amask) * * if not surface: # <<<<<<<<<<<<<< * raise error() * */ } /* "pygame_sdl2/surface.pyx":166 * raise error() * * self.take_surface(surface) # <<<<<<<<<<<<<< * * cdef void take_surface(self, SDL_Surface *surface): */ ((struct __pyx_vtabstruct_11pygame_sdl2_7surface_Surface *)__pyx_v_self->__pyx_vtab)->take_surface(__pyx_v_self, __pyx_v_surface); /* "pygame_sdl2/surface.pyx":84 * return 0 * * def __init__(self, size, flags=0, depth=32, masks=None): # <<<<<<<<<<<<<< * * self.locklist = None */ /* function exit code */ __pyx_r = 0; goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_9); __Pyx_XDECREF(__pyx_t_10); __Pyx_AddTraceback("pygame_sdl2.surface.Surface.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = -1; __pyx_L0:; __Pyx_XDECREF((PyObject *)__pyx_v_pysample); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/surface.pyx":168 * self.take_surface(surface) * * cdef void take_surface(self, SDL_Surface *surface): # <<<<<<<<<<<<<< * self.surface = surface * self.owns_surface = True */ static void __pyx_f_11pygame_sdl2_7surface_7Surface_take_surface(struct __pyx_obj_11pygame_sdl2_7surface_Surface *__pyx_v_self, SDL_Surface *__pyx_v_surface) { __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; __Pyx_RefNannySetupContext("take_surface", 0); /* "pygame_sdl2/surface.pyx":169 * * cdef void take_surface(self, SDL_Surface *surface): * self.surface = surface # <<<<<<<<<<<<<< * self.owns_surface = True * */ __pyx_v_self->surface = __pyx_v_surface; /* "pygame_sdl2/surface.pyx":170 * cdef void take_surface(self, SDL_Surface *surface): * self.surface = surface * self.owns_surface = True # <<<<<<<<<<<<<< * * global total_size */ __pyx_v_self->owns_surface = 1; /* "pygame_sdl2/surface.pyx":174 * global total_size * * total_size += self.surface.pitch * self.surface.h # <<<<<<<<<<<<<< * * def __repr__(self): */ __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_total_size); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 174, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = __Pyx_PyInt_From_int((__pyx_v_self->surface->pitch * __pyx_v_self->surface->h)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 174, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = PyNumber_InPlaceAdd(__pyx_t_1, __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 174, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; if (PyDict_SetItem(__pyx_d, __pyx_n_s_total_size, __pyx_t_3) < 0) __PYX_ERR(0, 174, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "pygame_sdl2/surface.pyx":168 * self.take_surface(surface) * * cdef void take_surface(self, SDL_Surface *surface): # <<<<<<<<<<<<<< * self.surface = surface * self.owns_surface = True */ /* function exit code */ goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_WriteUnraisable("pygame_sdl2.surface.Surface.take_surface", __pyx_clineno, __pyx_lineno, __pyx_filename, 0, 0); __pyx_L0:; __Pyx_RefNannyFinishContext(); } /* "pygame_sdl2/surface.pyx":176 * total_size += self.surface.pitch * self.surface.h * * def __repr__(self): # <<<<<<<<<<<<<< * return "".format(self.surface.w, self.surface.h, self.surface.format.BitsPerPixel) * */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_7surface_7Surface_9__repr__(PyObject *__pyx_v_self); /*proto*/ static PyObject *__pyx_pw_11pygame_sdl2_7surface_7Surface_9__repr__(PyObject *__pyx_v_self) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__repr__ (wrapper)", 0); __pyx_r = __pyx_pf_11pygame_sdl2_7surface_7Surface_8__repr__(((struct __pyx_obj_11pygame_sdl2_7surface_Surface *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_7surface_7Surface_8__repr__(struct __pyx_obj_11pygame_sdl2_7surface_Surface *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; PyObject *__pyx_t_5 = NULL; PyObject *__pyx_t_6 = NULL; int __pyx_t_7; PyObject *__pyx_t_8 = NULL; __Pyx_RefNannySetupContext("__repr__", 0); /* "pygame_sdl2/surface.pyx":177 * * def __repr__(self): * return "".format(self.surface.w, self.surface.h, self.surface.format.BitsPerPixel) # <<<<<<<<<<<<<< * * def blit(self, Surface source, dest, area=None, int special_flags=0): */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_kp_u_Surface_x_x, __pyx_n_s_format); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 177, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = __Pyx_PyInt_From_int(__pyx_v_self->surface->w); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 177, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = __Pyx_PyInt_From_int(__pyx_v_self->surface->h); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 177, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_5 = __Pyx_PyInt_From_uint8_t(__pyx_v_self->surface->format->BitsPerPixel); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 177, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_6 = NULL; __pyx_t_7 = 0; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) { __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_2); if (likely(__pyx_t_6)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_6); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); __pyx_t_7 = 1; } } #if CYTHON_FAST_PYCALL if (PyFunction_Check(__pyx_t_2)) { PyObject *__pyx_temp[4] = {__pyx_t_6, __pyx_t_3, __pyx_t_4, __pyx_t_5}; __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_7, 3+__pyx_t_7); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 177, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; } else #endif #if CYTHON_FAST_PYCCALL if (__Pyx_PyFastCFunction_Check(__pyx_t_2)) { PyObject *__pyx_temp[4] = {__pyx_t_6, __pyx_t_3, __pyx_t_4, __pyx_t_5}; __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_7, 3+__pyx_t_7); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 177, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; } else #endif { __pyx_t_8 = PyTuple_New(3+__pyx_t_7); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 177, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); if (__pyx_t_6) { __Pyx_GIVEREF(__pyx_t_6); PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_6); __pyx_t_6 = NULL; } __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_8, 0+__pyx_t_7, __pyx_t_3); __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_8, 1+__pyx_t_7, __pyx_t_4); __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_8, 2+__pyx_t_7, __pyx_t_5); __pyx_t_3 = 0; __pyx_t_4 = 0; __pyx_t_5 = 0; __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_8, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 177, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; } __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "pygame_sdl2/surface.pyx":176 * total_size += self.surface.pitch * self.surface.h * * def __repr__(self): # <<<<<<<<<<<<<< * return "".format(self.surface.w, self.surface.h, self.surface.format.BitsPerPixel) * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_5); __Pyx_XDECREF(__pyx_t_6); __Pyx_XDECREF(__pyx_t_8); __Pyx_AddTraceback("pygame_sdl2.surface.Surface.__repr__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/surface.pyx":179 * return "".format(self.surface.w, self.surface.h, self.surface.format.BitsPerPixel) * * def blit(self, Surface source, dest, area=None, int special_flags=0): # <<<<<<<<<<<<<< * cdef SDL_Rect dest_rect * cdef SDL_Rect area_rect */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_7surface_7Surface_11blit(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static PyObject *__pyx_pw_11pygame_sdl2_7surface_7Surface_11blit(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { struct __pyx_obj_11pygame_sdl2_7surface_Surface *__pyx_v_source = 0; PyObject *__pyx_v_dest = 0; PyObject *__pyx_v_area = 0; int __pyx_v_special_flags; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("blit (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_source,&__pyx_n_s_dest,&__pyx_n_s_area,&__pyx_n_s_special_flags,0}; PyObject* values[4] = {0,0,0,0}; values[2] = ((PyObject *)Py_None); if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_source)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; case 1: if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_dest)) != 0)) kw_args--; else { __Pyx_RaiseArgtupleInvalid("blit", 0, 2, 4, 1); __PYX_ERR(0, 179, __pyx_L3_error) } case 2: if (kw_args > 0) { PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_area); if (value) { values[2] = value; kw_args--; } } case 3: if (kw_args > 0) { PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_special_flags); if (value) { values[3] = value; kw_args--; } } } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "blit") < 0)) __PYX_ERR(0, 179, __pyx_L3_error) } } else { switch (PyTuple_GET_SIZE(__pyx_args)) { case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); values[0] = PyTuple_GET_ITEM(__pyx_args, 0); break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_source = ((struct __pyx_obj_11pygame_sdl2_7surface_Surface *)values[0]); __pyx_v_dest = values[1]; __pyx_v_area = values[2]; if (values[3]) { __pyx_v_special_flags = __Pyx_PyInt_As_int(values[3]); if (unlikely((__pyx_v_special_flags == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 179, __pyx_L3_error) } else { __pyx_v_special_flags = ((int)0); } } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("blit", 0, 2, 4, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 179, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("pygame_sdl2.surface.Surface.blit", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_source), __pyx_ptype_11pygame_sdl2_7surface_Surface, 1, "source", 0))) __PYX_ERR(0, 179, __pyx_L1_error) __pyx_r = __pyx_pf_11pygame_sdl2_7surface_7Surface_10blit(((struct __pyx_obj_11pygame_sdl2_7surface_Surface *)__pyx_v_self), __pyx_v_source, __pyx_v_dest, __pyx_v_area, __pyx_v_special_flags); /* function exit code */ goto __pyx_L0; __pyx_L1_error:; __pyx_r = NULL; __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_7surface_7Surface_10blit(struct __pyx_obj_11pygame_sdl2_7surface_Surface *__pyx_v_self, struct __pyx_obj_11pygame_sdl2_7surface_Surface *__pyx_v_source, PyObject *__pyx_v_dest, PyObject *__pyx_v_area, int __pyx_v_special_flags) { SDL_Rect __pyx_v_dest_rect; SDL_Rect __pyx_v_area_rect; SDL_Rect *__pyx_v_area_ptr; struct __pyx_obj_11pygame_sdl2_7surface_Surface *__pyx_v_temp = 0; int __pyx_v_err; Uint32 __pyx_v_key; Uint8 __pyx_v_alpha; int __pyx_v_colorkey; PyObject *__pyx_v_dirty = NULL; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; int __pyx_t_5; PyObject *__pyx_t_6 = NULL; int __pyx_t_7; struct __pyx_opt_args_11pygame_sdl2_4rect_to_sdl_rect __pyx_t_8; PyObject *__pyx_t_9 = NULL; PyObject *__pyx_t_10 = NULL; PyObject *__pyx_t_11 = NULL; PyObject *__pyx_t_12 = NULL; __Pyx_RefNannySetupContext("blit", 0); __Pyx_INCREF((PyObject *)__pyx_v_source); __Pyx_INCREF(__pyx_v_area); /* "pygame_sdl2/surface.pyx":182 * cdef SDL_Rect dest_rect * cdef SDL_Rect area_rect * cdef SDL_Rect *area_ptr = NULL # <<<<<<<<<<<<<< * * cdef Surface temp */ __pyx_v_area_ptr = NULL; /* "pygame_sdl2/surface.pyx":191 * cdef bint colorkey * * colorkey = (SDL_GetColorKey(source.surface, &key) == 0) # <<<<<<<<<<<<<< * * if not source.surface.format.Amask: */ __pyx_v_colorkey = (SDL_GetColorKey(__pyx_v_source->surface, (&__pyx_v_key)) == 0); /* "pygame_sdl2/surface.pyx":193 * colorkey = (SDL_GetColorKey(source.surface, &key) == 0) * * if not source.surface.format.Amask: # <<<<<<<<<<<<<< * if SDL_GetSurfaceAlphaMod(source.surface, &alpha): * raise error() */ __pyx_t_1 = ((!(__pyx_v_source->surface->format->Amask != 0)) != 0); if (__pyx_t_1) { /* "pygame_sdl2/surface.pyx":194 * * if not source.surface.format.Amask: * if SDL_GetSurfaceAlphaMod(source.surface, &alpha): # <<<<<<<<<<<<<< * raise error() * */ __pyx_t_1 = (SDL_GetSurfaceAlphaMod(__pyx_v_source->surface, (&__pyx_v_alpha)) != 0); if (__pyx_t_1) { /* "pygame_sdl2/surface.pyx":195 * if not source.surface.format.Amask: * if SDL_GetSurfaceAlphaMod(source.surface, &alpha): * raise error() # <<<<<<<<<<<<<< * * if alpha != 255 and (self.surface.format.Amask or colorkey): */ __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_error); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 195, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = NULL; if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) { __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3); if (likely(__pyx_t_4)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); __Pyx_INCREF(__pyx_t_4); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_3, function); } } if (__pyx_t_4) { __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 195, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; } else { __pyx_t_2 = __Pyx_PyObject_CallNoArg(__pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 195, __pyx_L1_error) } __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_Raise(__pyx_t_2, 0, 0, 0); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __PYX_ERR(0, 195, __pyx_L1_error) /* "pygame_sdl2/surface.pyx":194 * * if not source.surface.format.Amask: * if SDL_GetSurfaceAlphaMod(source.surface, &alpha): # <<<<<<<<<<<<<< * raise error() * */ } /* "pygame_sdl2/surface.pyx":197 * raise error() * * if alpha != 255 and (self.surface.format.Amask or colorkey): # <<<<<<<<<<<<<< * * if area: */ __pyx_t_5 = ((__pyx_v_alpha != 0xFF) != 0); if (__pyx_t_5) { } else { __pyx_t_1 = __pyx_t_5; goto __pyx_L6_bool_binop_done; } __pyx_t_5 = (__pyx_v_self->surface->format->Amask != 0); if (!__pyx_t_5) { } else { __pyx_t_1 = __pyx_t_5; goto __pyx_L6_bool_binop_done; } __pyx_t_5 = (__pyx_v_colorkey != 0); __pyx_t_1 = __pyx_t_5; __pyx_L6_bool_binop_done:; if (__pyx_t_1) { /* "pygame_sdl2/surface.pyx":199 * if alpha != 255 and (self.surface.format.Amask or colorkey): * * if area: # <<<<<<<<<<<<<< * source = source.subsurface(area) * area = None */ __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_area); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(0, 199, __pyx_L1_error) if (__pyx_t_1) { /* "pygame_sdl2/surface.pyx":200 * * if area: * source = source.subsurface(area) # <<<<<<<<<<<<<< * area = None * */ __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_source), __pyx_n_s_subsurface); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 200, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = NULL; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) { __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3); if (likely(__pyx_t_4)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); __Pyx_INCREF(__pyx_t_4); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_3, function); } } if (!__pyx_t_4) { __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_v_area); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 200, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); } else { #if CYTHON_FAST_PYCALL if (PyFunction_Check(__pyx_t_3)) { PyObject *__pyx_temp[2] = {__pyx_t_4, __pyx_v_area}; __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_3, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 200, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_GOTREF(__pyx_t_2); } else #endif #if CYTHON_FAST_PYCCALL if (__Pyx_PyFastCFunction_Check(__pyx_t_3)) { PyObject *__pyx_temp[2] = {__pyx_t_4, __pyx_v_area}; __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 200, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_GOTREF(__pyx_t_2); } else #endif { __pyx_t_6 = PyTuple_New(1+1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 200, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_4); __pyx_t_4 = NULL; __Pyx_INCREF(__pyx_v_area); __Pyx_GIVEREF(__pyx_v_area); PyTuple_SET_ITEM(__pyx_t_6, 0+1, __pyx_v_area); __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_6, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 200, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; } } __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_11pygame_sdl2_7surface_Surface))))) __PYX_ERR(0, 200, __pyx_L1_error) __Pyx_DECREF_SET(__pyx_v_source, ((struct __pyx_obj_11pygame_sdl2_7surface_Surface *)__pyx_t_2)); __pyx_t_2 = 0; /* "pygame_sdl2/surface.pyx":201 * if area: * source = source.subsurface(area) * area = None # <<<<<<<<<<<<<< * * SDL_SetSurfaceBlendMode(source.surface, SDL_BLENDMODE_NONE) */ __Pyx_INCREF(Py_None); __Pyx_DECREF_SET(__pyx_v_area, Py_None); /* "pygame_sdl2/surface.pyx":199 * if alpha != 255 and (self.surface.format.Amask or colorkey): * * if area: # <<<<<<<<<<<<<< * source = source.subsurface(area) * area = None */ } /* "pygame_sdl2/surface.pyx":203 * area = None * * SDL_SetSurfaceBlendMode(source.surface, SDL_BLENDMODE_NONE) # <<<<<<<<<<<<<< * temp = Surface(source.get_size(), SRCALPHA) * */ SDL_SetSurfaceBlendMode(__pyx_v_source->surface, SDL_BLENDMODE_NONE); /* "pygame_sdl2/surface.pyx":204 * * SDL_SetSurfaceBlendMode(source.surface, SDL_BLENDMODE_NONE) * temp = Surface(source.get_size(), SRCALPHA) # <<<<<<<<<<<<<< * * with nogil: */ __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_source), __pyx_n_s_get_size); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 204, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_6 = NULL; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) { __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_3); if (likely(__pyx_t_6)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); __Pyx_INCREF(__pyx_t_6); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_3, function); } } if (__pyx_t_6) { __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_6); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 204, __pyx_L1_error) __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; } else { __pyx_t_2 = __Pyx_PyObject_CallNoArg(__pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 204, __pyx_L1_error) } __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_SRCALPHA); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 204, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_6 = PyTuple_New(2); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 204, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_GIVEREF(__pyx_t_2); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_2); __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_6, 1, __pyx_t_3); __pyx_t_2 = 0; __pyx_t_3 = 0; __pyx_t_3 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_11pygame_sdl2_7surface_Surface), __pyx_t_6, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 204, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __pyx_v_temp = ((struct __pyx_obj_11pygame_sdl2_7surface_Surface *)__pyx_t_3); __pyx_t_3 = 0; /* "pygame_sdl2/surface.pyx":206 * temp = Surface(source.get_size(), SRCALPHA) * * with nogil: # <<<<<<<<<<<<<< * SDL_UpperBlit(source.surface, NULL, temp.surface, NULL) * */ { #ifdef WITH_THREAD PyThreadState *_save; Py_UNBLOCK_THREADS #endif /*try:*/ { /* "pygame_sdl2/surface.pyx":207 * * with nogil: * SDL_UpperBlit(source.surface, NULL, temp.surface, NULL) # <<<<<<<<<<<<<< * * source = temp */ SDL_UpperBlit(__pyx_v_source->surface, NULL, __pyx_v_temp->surface, NULL); } /* "pygame_sdl2/surface.pyx":206 * temp = Surface(source.get_size(), SRCALPHA) * * with nogil: # <<<<<<<<<<<<<< * SDL_UpperBlit(source.surface, NULL, temp.surface, NULL) * */ /*finally:*/ { /*normal exit:*/{ #ifdef WITH_THREAD Py_BLOCK_THREADS #endif goto __pyx_L12; } __pyx_L12:; } } /* "pygame_sdl2/surface.pyx":209 * SDL_UpperBlit(source.surface, NULL, temp.surface, NULL) * * source = temp # <<<<<<<<<<<<<< * colorkey = False * */ __Pyx_INCREF(((PyObject *)__pyx_v_temp)); __Pyx_DECREF_SET(__pyx_v_source, __pyx_v_temp); /* "pygame_sdl2/surface.pyx":210 * * source = temp * colorkey = False # <<<<<<<<<<<<<< * * if colorkey: */ __pyx_v_colorkey = 0; /* "pygame_sdl2/surface.pyx":197 * raise error() * * if alpha != 255 and (self.surface.format.Amask or colorkey): # <<<<<<<<<<<<<< * * if area: */ } /* "pygame_sdl2/surface.pyx":193 * colorkey = (SDL_GetColorKey(source.surface, &key) == 0) * * if not source.surface.format.Amask: # <<<<<<<<<<<<<< * if SDL_GetSurfaceAlphaMod(source.surface, &alpha): * raise error() */ } /* "pygame_sdl2/surface.pyx":212 * colorkey = False * * if colorkey: # <<<<<<<<<<<<<< * SDL_SetSurfaceBlendMode(source.surface, SDL_BLENDMODE_NONE) * else: */ __pyx_t_1 = (__pyx_v_colorkey != 0); if (__pyx_t_1) { /* "pygame_sdl2/surface.pyx":213 * * if colorkey: * SDL_SetSurfaceBlendMode(source.surface, SDL_BLENDMODE_NONE) # <<<<<<<<<<<<<< * else: * SDL_SetSurfaceBlendMode(source.surface, SDL_BLENDMODE_BLEND) */ SDL_SetSurfaceBlendMode(__pyx_v_source->surface, SDL_BLENDMODE_NONE); /* "pygame_sdl2/surface.pyx":212 * colorkey = False * * if colorkey: # <<<<<<<<<<<<<< * SDL_SetSurfaceBlendMode(source.surface, SDL_BLENDMODE_NONE) * else: */ goto __pyx_L13; } /* "pygame_sdl2/surface.pyx":215 * SDL_SetSurfaceBlendMode(source.surface, SDL_BLENDMODE_NONE) * else: * SDL_SetSurfaceBlendMode(source.surface, SDL_BLENDMODE_BLEND) # <<<<<<<<<<<<<< * * to_sdl_rect(dest, &dest_rect, "dest") */ /*else*/ { SDL_SetSurfaceBlendMode(__pyx_v_source->surface, SDL_BLENDMODE_BLEND); } __pyx_L13:; /* "pygame_sdl2/surface.pyx":217 * SDL_SetSurfaceBlendMode(source.surface, SDL_BLENDMODE_BLEND) * * to_sdl_rect(dest, &dest_rect, "dest") # <<<<<<<<<<<<<< * * if area is not None: */ __pyx_t_8.__pyx_n = 1; __pyx_t_8.argname = __pyx_n_u_dest; __pyx_t_7 = __pyx_f_11pygame_sdl2_4rect_to_sdl_rect(__pyx_v_dest, (&__pyx_v_dest_rect), &__pyx_t_8); if (unlikely(__pyx_t_7 == -1)) __PYX_ERR(0, 217, __pyx_L1_error) /* "pygame_sdl2/surface.pyx":219 * to_sdl_rect(dest, &dest_rect, "dest") * * if area is not None: # <<<<<<<<<<<<<< * to_sdl_rect(area, &area_rect, "area") * area_ptr = &area_rect */ __pyx_t_1 = (__pyx_v_area != Py_None); __pyx_t_5 = (__pyx_t_1 != 0); if (__pyx_t_5) { /* "pygame_sdl2/surface.pyx":220 * * if area is not None: * to_sdl_rect(area, &area_rect, "area") # <<<<<<<<<<<<<< * area_ptr = &area_rect * */ __pyx_t_8.__pyx_n = 1; __pyx_t_8.argname = __pyx_n_u_area; __pyx_t_7 = __pyx_f_11pygame_sdl2_4rect_to_sdl_rect(__pyx_v_area, (&__pyx_v_area_rect), &__pyx_t_8); if (unlikely(__pyx_t_7 == -1)) __PYX_ERR(0, 220, __pyx_L1_error) /* "pygame_sdl2/surface.pyx":221 * if area is not None: * to_sdl_rect(area, &area_rect, "area") * area_ptr = &area_rect # <<<<<<<<<<<<<< * * with nogil: */ __pyx_v_area_ptr = (&__pyx_v_area_rect); /* "pygame_sdl2/surface.pyx":219 * to_sdl_rect(dest, &dest_rect, "dest") * * if area is not None: # <<<<<<<<<<<<<< * to_sdl_rect(area, &area_rect, "area") * area_ptr = &area_rect */ } /* "pygame_sdl2/surface.pyx":223 * area_ptr = &area_rect * * with nogil: # <<<<<<<<<<<<<< * * if source.surface.format.Amask or special_flags: */ { #ifdef WITH_THREAD PyThreadState *_save; Py_UNBLOCK_THREADS #endif /*try:*/ { /* "pygame_sdl2/surface.pyx":225 * with nogil: * * if source.surface.format.Amask or special_flags: # <<<<<<<<<<<<<< * err = pygame_Blit(source.surface, area_ptr, self.surface, &dest_rect, special_flags) * else: */ __pyx_t_1 = (__pyx_v_source->surface->format->Amask != 0); if (!__pyx_t_1) { } else { __pyx_t_5 = __pyx_t_1; goto __pyx_L19_bool_binop_done; } __pyx_t_1 = (__pyx_v_special_flags != 0); __pyx_t_5 = __pyx_t_1; __pyx_L19_bool_binop_done:; if (__pyx_t_5) { /* "pygame_sdl2/surface.pyx":226 * * if source.surface.format.Amask or special_flags: * err = pygame_Blit(source.surface, area_ptr, self.surface, &dest_rect, special_flags) # <<<<<<<<<<<<<< * else: * err = SDL_UpperBlit(source.surface, area_ptr, self.surface, &dest_rect) */ __pyx_v_err = pygame_Blit(__pyx_v_source->surface, __pyx_v_area_ptr, __pyx_v_self->surface, (&__pyx_v_dest_rect), __pyx_v_special_flags); /* "pygame_sdl2/surface.pyx":225 * with nogil: * * if source.surface.format.Amask or special_flags: # <<<<<<<<<<<<<< * err = pygame_Blit(source.surface, area_ptr, self.surface, &dest_rect, special_flags) * else: */ goto __pyx_L18; } /* "pygame_sdl2/surface.pyx":228 * err = pygame_Blit(source.surface, area_ptr, self.surface, &dest_rect, special_flags) * else: * err = SDL_UpperBlit(source.surface, area_ptr, self.surface, &dest_rect) # <<<<<<<<<<<<<< * * if err: */ /*else*/ { __pyx_v_err = SDL_UpperBlit(__pyx_v_source->surface, __pyx_v_area_ptr, __pyx_v_self->surface, (&__pyx_v_dest_rect)); } __pyx_L18:; } /* "pygame_sdl2/surface.pyx":223 * area_ptr = &area_rect * * with nogil: # <<<<<<<<<<<<<< * * if source.surface.format.Amask or special_flags: */ /*finally:*/ { /*normal exit:*/{ #ifdef WITH_THREAD Py_BLOCK_THREADS #endif goto __pyx_L17; } __pyx_L17:; } } /* "pygame_sdl2/surface.pyx":230 * err = SDL_UpperBlit(source.surface, area_ptr, self.surface, &dest_rect) * * if err: # <<<<<<<<<<<<<< * raise error() * */ __pyx_t_5 = (__pyx_v_err != 0); if (__pyx_t_5) { /* "pygame_sdl2/surface.pyx":231 * * if err: * raise error() # <<<<<<<<<<<<<< * * dirty = Rect(dest[0], dest[1], source.surface.w, source.surface.h) */ __pyx_t_6 = __Pyx_GetModuleGlobalName(__pyx_n_s_error); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 231, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __pyx_t_2 = NULL; if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_6))) { __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_6); if (likely(__pyx_t_2)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6); __Pyx_INCREF(__pyx_t_2); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_6, function); } } if (__pyx_t_2) { __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_t_6, __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 231, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } else { __pyx_t_3 = __Pyx_PyObject_CallNoArg(__pyx_t_6); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 231, __pyx_L1_error) } __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_Raise(__pyx_t_3, 0, 0, 0); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __PYX_ERR(0, 231, __pyx_L1_error) /* "pygame_sdl2/surface.pyx":230 * err = SDL_UpperBlit(source.surface, area_ptr, self.surface, &dest_rect) * * if err: # <<<<<<<<<<<<<< * raise error() * */ } /* "pygame_sdl2/surface.pyx":233 * raise error() * * dirty = Rect(dest[0], dest[1], source.surface.w, source.surface.h) # <<<<<<<<<<<<<< * return dirty.clip(self.get_rect()) * */ __pyx_t_6 = __Pyx_GetModuleGlobalName(__pyx_n_s_Rect); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 233, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __pyx_t_2 = __Pyx_GetItemInt(__pyx_v_dest, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 233, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_4 = __Pyx_GetItemInt(__pyx_v_dest, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 233, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_9 = __Pyx_PyInt_From_int(__pyx_v_source->surface->w); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 233, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); __pyx_t_10 = __Pyx_PyInt_From_int(__pyx_v_source->surface->h); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 233, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_10); __pyx_t_11 = NULL; __pyx_t_7 = 0; if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_6))) { __pyx_t_11 = PyMethod_GET_SELF(__pyx_t_6); if (likely(__pyx_t_11)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6); __Pyx_INCREF(__pyx_t_11); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_6, function); __pyx_t_7 = 1; } } #if CYTHON_FAST_PYCALL if (PyFunction_Check(__pyx_t_6)) { PyObject *__pyx_temp[5] = {__pyx_t_11, __pyx_t_2, __pyx_t_4, __pyx_t_9, __pyx_t_10}; __pyx_t_3 = __Pyx_PyFunction_FastCall(__pyx_t_6, __pyx_temp+1-__pyx_t_7, 4+__pyx_t_7); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 233, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0; __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; } else #endif #if CYTHON_FAST_PYCCALL if (__Pyx_PyFastCFunction_Check(__pyx_t_6)) { PyObject *__pyx_temp[5] = {__pyx_t_11, __pyx_t_2, __pyx_t_4, __pyx_t_9, __pyx_t_10}; __pyx_t_3 = __Pyx_PyCFunction_FastCall(__pyx_t_6, __pyx_temp+1-__pyx_t_7, 4+__pyx_t_7); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 233, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0; __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; } else #endif { __pyx_t_12 = PyTuple_New(4+__pyx_t_7); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 233, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_12); if (__pyx_t_11) { __Pyx_GIVEREF(__pyx_t_11); PyTuple_SET_ITEM(__pyx_t_12, 0, __pyx_t_11); __pyx_t_11 = NULL; } __Pyx_GIVEREF(__pyx_t_2); PyTuple_SET_ITEM(__pyx_t_12, 0+__pyx_t_7, __pyx_t_2); __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_12, 1+__pyx_t_7, __pyx_t_4); __Pyx_GIVEREF(__pyx_t_9); PyTuple_SET_ITEM(__pyx_t_12, 2+__pyx_t_7, __pyx_t_9); __Pyx_GIVEREF(__pyx_t_10); PyTuple_SET_ITEM(__pyx_t_12, 3+__pyx_t_7, __pyx_t_10); __pyx_t_2 = 0; __pyx_t_4 = 0; __pyx_t_9 = 0; __pyx_t_10 = 0; __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_12, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 233, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; } __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __pyx_v_dirty = __pyx_t_3; __pyx_t_3 = 0; /* "pygame_sdl2/surface.pyx":234 * * dirty = Rect(dest[0], dest[1], source.surface.w, source.surface.h) * return dirty.clip(self.get_rect()) # <<<<<<<<<<<<<< * * def convert(self, surface=None): */ __Pyx_XDECREF(__pyx_r); __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_dirty, __pyx_n_s_clip); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 234, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __pyx_t_10 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_get_rect); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 234, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_10); __pyx_t_9 = NULL; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_10))) { __pyx_t_9 = PyMethod_GET_SELF(__pyx_t_10); if (likely(__pyx_t_9)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_10); __Pyx_INCREF(__pyx_t_9); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_10, function); } } if (__pyx_t_9) { __pyx_t_12 = __Pyx_PyObject_CallOneArg(__pyx_t_10, __pyx_t_9); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 234, __pyx_L1_error) __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; } else { __pyx_t_12 = __Pyx_PyObject_CallNoArg(__pyx_t_10); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 234, __pyx_L1_error) } __Pyx_GOTREF(__pyx_t_12); __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; __pyx_t_10 = NULL; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_6))) { __pyx_t_10 = PyMethod_GET_SELF(__pyx_t_6); if (likely(__pyx_t_10)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6); __Pyx_INCREF(__pyx_t_10); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_6, function); } } if (!__pyx_t_10) { __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_t_6, __pyx_t_12); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 234, __pyx_L1_error) __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; __Pyx_GOTREF(__pyx_t_3); } else { #if CYTHON_FAST_PYCALL if (PyFunction_Check(__pyx_t_6)) { PyObject *__pyx_temp[2] = {__pyx_t_10, __pyx_t_12}; __pyx_t_3 = __Pyx_PyFunction_FastCall(__pyx_t_6, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 234, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0; __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; } else #endif #if CYTHON_FAST_PYCCALL if (__Pyx_PyFastCFunction_Check(__pyx_t_6)) { PyObject *__pyx_temp[2] = {__pyx_t_10, __pyx_t_12}; __pyx_t_3 = __Pyx_PyCFunction_FastCall(__pyx_t_6, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 234, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0; __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; } else #endif { __pyx_t_9 = PyTuple_New(1+1); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 234, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); __Pyx_GIVEREF(__pyx_t_10); PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_t_10); __pyx_t_10 = NULL; __Pyx_GIVEREF(__pyx_t_12); PyTuple_SET_ITEM(__pyx_t_9, 0+1, __pyx_t_12); __pyx_t_12 = 0; __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_9, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 234, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; } } __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __pyx_r = __pyx_t_3; __pyx_t_3 = 0; goto __pyx_L0; /* "pygame_sdl2/surface.pyx":179 * return "".format(self.surface.w, self.surface.h, self.surface.format.BitsPerPixel) * * def blit(self, Surface source, dest, area=None, int special_flags=0): # <<<<<<<<<<<<<< * cdef SDL_Rect dest_rect * cdef SDL_Rect area_rect */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_6); __Pyx_XDECREF(__pyx_t_9); __Pyx_XDECREF(__pyx_t_10); __Pyx_XDECREF(__pyx_t_11); __Pyx_XDECREF(__pyx_t_12); __Pyx_AddTraceback("pygame_sdl2.surface.Surface.blit", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF((PyObject *)__pyx_v_temp); __Pyx_XDECREF(__pyx_v_dirty); __Pyx_XDECREF((PyObject *)__pyx_v_source); __Pyx_XDECREF(__pyx_v_area); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/surface.pyx":236 * return dirty.clip(self.get_rect()) * * def convert(self, surface=None): # <<<<<<<<<<<<<< * if not isinstance(surface, Surface): * surface = pygame_sdl2.display.get_surface() */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_7surface_7Surface_13convert(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static PyObject *__pyx_pw_11pygame_sdl2_7surface_7Surface_13convert(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_surface = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("convert (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_surface,0}; PyObject* values[1] = {0}; values[0] = ((PyObject *)Py_None); if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (kw_args > 0) { PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_surface); if (value) { values[0] = value; kw_args--; } } } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "convert") < 0)) __PYX_ERR(0, 236, __pyx_L3_error) } } else { switch (PyTuple_GET_SIZE(__pyx_args)) { case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); case 0: break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_surface = values[0]; } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("convert", 0, 0, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 236, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("pygame_sdl2.surface.Surface.convert", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_11pygame_sdl2_7surface_7Surface_12convert(((struct __pyx_obj_11pygame_sdl2_7surface_Surface *)__pyx_v_self), __pyx_v_surface); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_7surface_7Surface_12convert(struct __pyx_obj_11pygame_sdl2_7surface_Surface *__pyx_v_self, PyObject *__pyx_v_surface) { SDL_PixelFormat *__pyx_v_sample_format; Uint32 __pyx_v_amask; Uint32 __pyx_v_rmask; Uint32 __pyx_v_gmask; Uint32 __pyx_v_bmask; Uint32 __pyx_v_pixel_format; SDL_Surface *__pyx_v_new_surface; CYTHON_UNUSED SDL_PixelFormat *__pyx_v_use_format; struct __pyx_obj_11pygame_sdl2_7surface_Surface *__pyx_v_rv = 0; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; int __pyx_t_2; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; PyObject *__pyx_t_5 = NULL; SDL_PixelFormat *__pyx_t_6; Uint32 __pyx_t_7; __Pyx_RefNannySetupContext("convert", 0); __Pyx_INCREF(__pyx_v_surface); /* "pygame_sdl2/surface.pyx":237 * * def convert(self, surface=None): * if not isinstance(surface, Surface): # <<<<<<<<<<<<<< * surface = pygame_sdl2.display.get_surface() * */ __pyx_t_1 = __Pyx_TypeCheck(__pyx_v_surface, __pyx_ptype_11pygame_sdl2_7surface_Surface); __pyx_t_2 = ((!(__pyx_t_1 != 0)) != 0); if (__pyx_t_2) { /* "pygame_sdl2/surface.pyx":238 * def convert(self, surface=None): * if not isinstance(surface, Surface): * surface = pygame_sdl2.display.get_surface() # <<<<<<<<<<<<<< * * if surface is None: */ __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_pygame_sdl2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 238, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_display); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 238, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_get_surface); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 238, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __pyx_t_5 = NULL; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_4))) { __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4); if (likely(__pyx_t_5)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4); __Pyx_INCREF(__pyx_t_5); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_4, function); } } if (__pyx_t_5) { __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_5); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 238, __pyx_L1_error) __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; } else { __pyx_t_3 = __Pyx_PyObject_CallNoArg(__pyx_t_4); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 238, __pyx_L1_error) } __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF_SET(__pyx_v_surface, __pyx_t_3); __pyx_t_3 = 0; /* "pygame_sdl2/surface.pyx":237 * * def convert(self, surface=None): * if not isinstance(surface, Surface): # <<<<<<<<<<<<<< * surface = pygame_sdl2.display.get_surface() * */ } /* "pygame_sdl2/surface.pyx":240 * surface = pygame_sdl2.display.get_surface() * * if surface is None: # <<<<<<<<<<<<<< * raise error("No video mode has been set.") * */ __pyx_t_2 = (__pyx_v_surface == Py_None); __pyx_t_1 = (__pyx_t_2 != 0); if (__pyx_t_1) { /* "pygame_sdl2/surface.pyx":241 * * if surface is None: * raise error("No video mode has been set.") # <<<<<<<<<<<<<< * * cdef SDL_PixelFormat *sample_format = ( surface).surface.format */ __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_error); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 241, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_tuple__2, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 241, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_Raise(__pyx_t_4, 0, 0, 0); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __PYX_ERR(0, 241, __pyx_L1_error) /* "pygame_sdl2/surface.pyx":240 * surface = pygame_sdl2.display.get_surface() * * if surface is None: # <<<<<<<<<<<<<< * raise error("No video mode has been set.") * */ } /* "pygame_sdl2/surface.pyx":243 * raise error("No video mode has been set.") * * cdef SDL_PixelFormat *sample_format = ( surface).surface.format # <<<<<<<<<<<<<< * * cdef Uint32 amask */ __pyx_t_6 = ((struct __pyx_obj_11pygame_sdl2_7surface_Surface *)__pyx_v_surface)->surface->format; __pyx_v_sample_format = __pyx_t_6; /* "pygame_sdl2/surface.pyx":254 * * # If the sample surface has alpha, use it. * if not sample_format.Amask: # <<<<<<<<<<<<<< * use_format = sample_format * */ __pyx_t_1 = ((!(__pyx_v_sample_format->Amask != 0)) != 0); if (__pyx_t_1) { /* "pygame_sdl2/surface.pyx":255 * # If the sample surface has alpha, use it. * if not sample_format.Amask: * use_format = sample_format # <<<<<<<<<<<<<< * * with nogil: */ __pyx_v_use_format = __pyx_v_sample_format; /* "pygame_sdl2/surface.pyx":257 * use_format = sample_format * * with nogil: # <<<<<<<<<<<<<< * new_surface = SDL_ConvertSurface(self.surface, sample_format, 0) * */ { #ifdef WITH_THREAD PyThreadState *_save; Py_UNBLOCK_THREADS #endif /*try:*/ { /* "pygame_sdl2/surface.pyx":258 * * with nogil: * new_surface = SDL_ConvertSurface(self.surface, sample_format, 0) # <<<<<<<<<<<<<< * * else: */ __pyx_v_new_surface = SDL_ConvertSurface(__pyx_v_self->surface, __pyx_v_sample_format, 0); } /* "pygame_sdl2/surface.pyx":257 * use_format = sample_format * * with nogil: # <<<<<<<<<<<<<< * new_surface = SDL_ConvertSurface(self.surface, sample_format, 0) * */ /*finally:*/ { /*normal exit:*/{ #ifdef WITH_THREAD Py_BLOCK_THREADS #endif goto __pyx_L8; } __pyx_L8:; } } /* "pygame_sdl2/surface.pyx":254 * * # If the sample surface has alpha, use it. * if not sample_format.Amask: # <<<<<<<<<<<<<< * use_format = sample_format * */ goto __pyx_L5; } /* "pygame_sdl2/surface.pyx":262 * else: * * rmask = sample_format.Rmask # <<<<<<<<<<<<<< * gmask = sample_format.Gmask * bmask = sample_format.Bmask */ /*else*/ { __pyx_t_7 = __pyx_v_sample_format->Rmask; __pyx_v_rmask = __pyx_t_7; /* "pygame_sdl2/surface.pyx":263 * * rmask = sample_format.Rmask * gmask = sample_format.Gmask # <<<<<<<<<<<<<< * bmask = sample_format.Bmask * amask = 0 */ __pyx_t_7 = __pyx_v_sample_format->Gmask; __pyx_v_gmask = __pyx_t_7; /* "pygame_sdl2/surface.pyx":264 * rmask = sample_format.Rmask * gmask = sample_format.Gmask * bmask = sample_format.Bmask # <<<<<<<<<<<<<< * amask = 0 * */ __pyx_t_7 = __pyx_v_sample_format->Bmask; __pyx_v_bmask = __pyx_t_7; /* "pygame_sdl2/surface.pyx":265 * gmask = sample_format.Gmask * bmask = sample_format.Bmask * amask = 0 # <<<<<<<<<<<<<< * * pixel_format = SDL_MasksToPixelFormatEnum(32, rmask, gmask, bmask, amask) */ __pyx_v_amask = 0; /* "pygame_sdl2/surface.pyx":267 * amask = 0 * * pixel_format = SDL_MasksToPixelFormatEnum(32, rmask, gmask, bmask, amask) # <<<<<<<<<<<<<< * * with nogil: */ __pyx_v_pixel_format = SDL_MasksToPixelFormatEnum(32, __pyx_v_rmask, __pyx_v_gmask, __pyx_v_bmask, __pyx_v_amask); /* "pygame_sdl2/surface.pyx":269 * pixel_format = SDL_MasksToPixelFormatEnum(32, rmask, gmask, bmask, amask) * * with nogil: # <<<<<<<<<<<<<< * new_surface = SDL_ConvertSurfaceFormat(self.surface, pixel_format, 0) * */ { #ifdef WITH_THREAD PyThreadState *_save; Py_UNBLOCK_THREADS #endif /*try:*/ { /* "pygame_sdl2/surface.pyx":270 * * with nogil: * new_surface = SDL_ConvertSurfaceFormat(self.surface, pixel_format, 0) # <<<<<<<<<<<<<< * * cdef Surface rv = Surface(()) */ __pyx_v_new_surface = SDL_ConvertSurfaceFormat(__pyx_v_self->surface, __pyx_v_pixel_format, 0); } /* "pygame_sdl2/surface.pyx":269 * pixel_format = SDL_MasksToPixelFormatEnum(32, rmask, gmask, bmask, amask) * * with nogil: # <<<<<<<<<<<<<< * new_surface = SDL_ConvertSurfaceFormat(self.surface, pixel_format, 0) * */ /*finally:*/ { /*normal exit:*/{ #ifdef WITH_THREAD Py_BLOCK_THREADS #endif goto __pyx_L11; } __pyx_L11:; } } } __pyx_L5:; /* "pygame_sdl2/surface.pyx":272 * new_surface = SDL_ConvertSurfaceFormat(self.surface, pixel_format, 0) * * cdef Surface rv = Surface(()) # <<<<<<<<<<<<<< * rv.take_surface(new_surface) * */ __pyx_t_4 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_11pygame_sdl2_7surface_Surface), __pyx_tuple__3, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 272, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_v_rv = ((struct __pyx_obj_11pygame_sdl2_7surface_Surface *)__pyx_t_4); __pyx_t_4 = 0; /* "pygame_sdl2/surface.pyx":273 * * cdef Surface rv = Surface(()) * rv.take_surface(new_surface) # <<<<<<<<<<<<<< * * return rv */ ((struct __pyx_vtabstruct_11pygame_sdl2_7surface_Surface *)__pyx_v_rv->__pyx_vtab)->take_surface(__pyx_v_rv, __pyx_v_new_surface); /* "pygame_sdl2/surface.pyx":275 * rv.take_surface(new_surface) * * return rv # <<<<<<<<<<<<<< * * def convert_alpha(self, Surface surface=None): */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(((PyObject *)__pyx_v_rv)); __pyx_r = ((PyObject *)__pyx_v_rv); goto __pyx_L0; /* "pygame_sdl2/surface.pyx":236 * return dirty.clip(self.get_rect()) * * def convert(self, surface=None): # <<<<<<<<<<<<<< * if not isinstance(surface, Surface): * surface = pygame_sdl2.display.get_surface() */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_5); __Pyx_AddTraceback("pygame_sdl2.surface.Surface.convert", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF((PyObject *)__pyx_v_rv); __Pyx_XDECREF(__pyx_v_surface); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/surface.pyx":277 * return rv * * def convert_alpha(self, Surface surface=None): # <<<<<<<<<<<<<< * if surface is None: * surface = pygame_sdl2.display.get_surface() */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_7surface_7Surface_15convert_alpha(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static PyObject *__pyx_pw_11pygame_sdl2_7surface_7Surface_15convert_alpha(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { struct __pyx_obj_11pygame_sdl2_7surface_Surface *__pyx_v_surface = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("convert_alpha (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_surface,0}; PyObject* values[1] = {0}; values[0] = (PyObject *)((struct __pyx_obj_11pygame_sdl2_7surface_Surface *)Py_None); if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (kw_args > 0) { PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_surface); if (value) { values[0] = value; kw_args--; } } } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "convert_alpha") < 0)) __PYX_ERR(0, 277, __pyx_L3_error) } } else { switch (PyTuple_GET_SIZE(__pyx_args)) { case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); case 0: break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_surface = ((struct __pyx_obj_11pygame_sdl2_7surface_Surface *)values[0]); } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("convert_alpha", 0, 0, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 277, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("pygame_sdl2.surface.Surface.convert_alpha", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_surface), __pyx_ptype_11pygame_sdl2_7surface_Surface, 1, "surface", 0))) __PYX_ERR(0, 277, __pyx_L1_error) __pyx_r = __pyx_pf_11pygame_sdl2_7surface_7Surface_14convert_alpha(((struct __pyx_obj_11pygame_sdl2_7surface_Surface *)__pyx_v_self), __pyx_v_surface); /* function exit code */ goto __pyx_L0; __pyx_L1_error:; __pyx_r = NULL; __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_7surface_7Surface_14convert_alpha(struct __pyx_obj_11pygame_sdl2_7surface_Surface *__pyx_v_self, struct __pyx_obj_11pygame_sdl2_7surface_Surface *__pyx_v_surface) { SDL_PixelFormat *__pyx_v_sample_format; Uint32 __pyx_v_amask; Uint32 __pyx_v_rmask; Uint32 __pyx_v_gmask; Uint32 __pyx_v_bmask; Uint32 __pyx_v_pixel_format; SDL_Surface *__pyx_v_new_surface; CYTHON_UNUSED SDL_PixelFormat *__pyx_v_use_format; struct __pyx_obj_11pygame_sdl2_7surface_Surface *__pyx_v_rv = 0; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; int __pyx_t_2; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; PyObject *__pyx_t_5 = NULL; SDL_PixelFormat *__pyx_t_6; Uint32 __pyx_t_7; __Pyx_RefNannySetupContext("convert_alpha", 0); __Pyx_INCREF((PyObject *)__pyx_v_surface); /* "pygame_sdl2/surface.pyx":278 * * def convert_alpha(self, Surface surface=None): * if surface is None: # <<<<<<<<<<<<<< * surface = pygame_sdl2.display.get_surface() * */ __pyx_t_1 = (((PyObject *)__pyx_v_surface) == Py_None); __pyx_t_2 = (__pyx_t_1 != 0); if (__pyx_t_2) { /* "pygame_sdl2/surface.pyx":279 * def convert_alpha(self, Surface surface=None): * if surface is None: * surface = pygame_sdl2.display.get_surface() # <<<<<<<<<<<<<< * * if surface is None: */ __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_pygame_sdl2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 279, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_display); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 279, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_get_surface); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 279, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __pyx_t_5 = NULL; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_4))) { __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4); if (likely(__pyx_t_5)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4); __Pyx_INCREF(__pyx_t_5); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_4, function); } } if (__pyx_t_5) { __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_5); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 279, __pyx_L1_error) __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; } else { __pyx_t_3 = __Pyx_PyObject_CallNoArg(__pyx_t_4); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 279, __pyx_L1_error) } __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_ptype_11pygame_sdl2_7surface_Surface))))) __PYX_ERR(0, 279, __pyx_L1_error) __Pyx_DECREF_SET(__pyx_v_surface, ((struct __pyx_obj_11pygame_sdl2_7surface_Surface *)__pyx_t_3)); __pyx_t_3 = 0; /* "pygame_sdl2/surface.pyx":278 * * def convert_alpha(self, Surface surface=None): * if surface is None: # <<<<<<<<<<<<<< * surface = pygame_sdl2.display.get_surface() * */ } /* "pygame_sdl2/surface.pyx":281 * surface = pygame_sdl2.display.get_surface() * * if surface is None: # <<<<<<<<<<<<<< * raise error("No video mode has been set.") * */ __pyx_t_2 = (((PyObject *)__pyx_v_surface) == Py_None); __pyx_t_1 = (__pyx_t_2 != 0); if (__pyx_t_1) { /* "pygame_sdl2/surface.pyx":282 * * if surface is None: * raise error("No video mode has been set.") # <<<<<<<<<<<<<< * * cdef SDL_PixelFormat *sample_format = surface.surface.format */ __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_error); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 282, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_tuple__4, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 282, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_Raise(__pyx_t_4, 0, 0, 0); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __PYX_ERR(0, 282, __pyx_L1_error) /* "pygame_sdl2/surface.pyx":281 * surface = pygame_sdl2.display.get_surface() * * if surface is None: # <<<<<<<<<<<<<< * raise error("No video mode has been set.") * */ } /* "pygame_sdl2/surface.pyx":284 * raise error("No video mode has been set.") * * cdef SDL_PixelFormat *sample_format = surface.surface.format # <<<<<<<<<<<<<< * * cdef Uint32 amask = 0xff000000 */ __pyx_t_6 = __pyx_v_surface->surface->format; __pyx_v_sample_format = __pyx_t_6; /* "pygame_sdl2/surface.pyx":286 * cdef SDL_PixelFormat *sample_format = surface.surface.format * * cdef Uint32 amask = 0xff000000 # <<<<<<<<<<<<<< * cdef Uint32 rmask = 0x00ff0000 * cdef Uint32 gmask = 0x0000ff00 */ __pyx_v_amask = 0xff000000; /* "pygame_sdl2/surface.pyx":287 * * cdef Uint32 amask = 0xff000000 * cdef Uint32 rmask = 0x00ff0000 # <<<<<<<<<<<<<< * cdef Uint32 gmask = 0x0000ff00 * cdef Uint32 bmask = 0x000000ff */ __pyx_v_rmask = 0x00ff0000; /* "pygame_sdl2/surface.pyx":288 * cdef Uint32 amask = 0xff000000 * cdef Uint32 rmask = 0x00ff0000 * cdef Uint32 gmask = 0x0000ff00 # <<<<<<<<<<<<<< * cdef Uint32 bmask = 0x000000ff * */ __pyx_v_gmask = 0x0000ff00; /* "pygame_sdl2/surface.pyx":289 * cdef Uint32 rmask = 0x00ff0000 * cdef Uint32 gmask = 0x0000ff00 * cdef Uint32 bmask = 0x000000ff # <<<<<<<<<<<<<< * * cdef Uint32 pixel_format */ __pyx_v_bmask = 0x000000ff; /* "pygame_sdl2/surface.pyx":295 * * # If the sample surface has alpha, use it. * if sample_format.Amask: # <<<<<<<<<<<<<< * use_format = sample_format * */ __pyx_t_1 = (__pyx_v_sample_format->Amask != 0); if (__pyx_t_1) { /* "pygame_sdl2/surface.pyx":296 * # If the sample surface has alpha, use it. * if sample_format.Amask: * use_format = sample_format # <<<<<<<<<<<<<< * * with nogil: */ __pyx_v_use_format = __pyx_v_sample_format; /* "pygame_sdl2/surface.pyx":298 * use_format = sample_format * * with nogil: # <<<<<<<<<<<<<< * new_surface = SDL_ConvertSurface(self.surface, sample_format, 0) * */ { #ifdef WITH_THREAD PyThreadState *_save; Py_UNBLOCK_THREADS #endif /*try:*/ { /* "pygame_sdl2/surface.pyx":299 * * with nogil: * new_surface = SDL_ConvertSurface(self.surface, sample_format, 0) # <<<<<<<<<<<<<< * * else: */ __pyx_v_new_surface = SDL_ConvertSurface(__pyx_v_self->surface, __pyx_v_sample_format, 0); } /* "pygame_sdl2/surface.pyx":298 * use_format = sample_format * * with nogil: # <<<<<<<<<<<<<< * new_surface = SDL_ConvertSurface(self.surface, sample_format, 0) * */ /*finally:*/ { /*normal exit:*/{ #ifdef WITH_THREAD Py_BLOCK_THREADS #endif goto __pyx_L8; } __pyx_L8:; } } /* "pygame_sdl2/surface.pyx":295 * * # If the sample surface has alpha, use it. * if sample_format.Amask: # <<<<<<<<<<<<<< * use_format = sample_format * */ goto __pyx_L5; } /* "pygame_sdl2/surface.pyx":303 * else: * * if sample_format.BytesPerPixel == 4: # <<<<<<<<<<<<<< * rmask = sample_format.Rmask * gmask = sample_format.Gmask */ /*else*/ { __pyx_t_1 = ((__pyx_v_sample_format->BytesPerPixel == 4) != 0); if (__pyx_t_1) { /* "pygame_sdl2/surface.pyx":304 * * if sample_format.BytesPerPixel == 4: * rmask = sample_format.Rmask # <<<<<<<<<<<<<< * gmask = sample_format.Gmask * bmask = sample_format.Bmask */ __pyx_t_7 = __pyx_v_sample_format->Rmask; __pyx_v_rmask = __pyx_t_7; /* "pygame_sdl2/surface.pyx":305 * if sample_format.BytesPerPixel == 4: * rmask = sample_format.Rmask * gmask = sample_format.Gmask # <<<<<<<<<<<<<< * bmask = sample_format.Bmask * amask = 0xffffffff & ~(rmask | gmask | bmask) */ __pyx_t_7 = __pyx_v_sample_format->Gmask; __pyx_v_gmask = __pyx_t_7; /* "pygame_sdl2/surface.pyx":306 * rmask = sample_format.Rmask * gmask = sample_format.Gmask * bmask = sample_format.Bmask # <<<<<<<<<<<<<< * amask = 0xffffffff & ~(rmask | gmask | bmask) * */ __pyx_t_7 = __pyx_v_sample_format->Bmask; __pyx_v_bmask = __pyx_t_7; /* "pygame_sdl2/surface.pyx":307 * gmask = sample_format.Gmask * bmask = sample_format.Bmask * amask = 0xffffffff & ~(rmask | gmask | bmask) # <<<<<<<<<<<<<< * * pixel_format = SDL_MasksToPixelFormatEnum(32, rmask, gmask, bmask, amask) */ __pyx_t_4 = __Pyx_PyInt_From_uint32_t((~((__pyx_v_rmask | __pyx_v_gmask) | __pyx_v_bmask))); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 307, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_3 = PyNumber_And(__pyx_int_4294967295, __pyx_t_4); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 307, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_t_7 = __Pyx_PyInt_As_uint32_t(__pyx_t_3); if (unlikely((__pyx_t_7 == ((Uint32)-1)) && PyErr_Occurred())) __PYX_ERR(0, 307, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_v_amask = __pyx_t_7; /* "pygame_sdl2/surface.pyx":303 * else: * * if sample_format.BytesPerPixel == 4: # <<<<<<<<<<<<<< * rmask = sample_format.Rmask * gmask = sample_format.Gmask */ } /* "pygame_sdl2/surface.pyx":309 * amask = 0xffffffff & ~(rmask | gmask | bmask) * * pixel_format = SDL_MasksToPixelFormatEnum(32, rmask, gmask, bmask, amask) # <<<<<<<<<<<<<< * * with nogil: */ __pyx_v_pixel_format = SDL_MasksToPixelFormatEnum(32, __pyx_v_rmask, __pyx_v_gmask, __pyx_v_bmask, __pyx_v_amask); /* "pygame_sdl2/surface.pyx":311 * pixel_format = SDL_MasksToPixelFormatEnum(32, rmask, gmask, bmask, amask) * * with nogil: # <<<<<<<<<<<<<< * new_surface = SDL_ConvertSurfaceFormat(self.surface, pixel_format, 0) * */ { #ifdef WITH_THREAD PyThreadState *_save; Py_UNBLOCK_THREADS #endif /*try:*/ { /* "pygame_sdl2/surface.pyx":312 * * with nogil: * new_surface = SDL_ConvertSurfaceFormat(self.surface, pixel_format, 0) # <<<<<<<<<<<<<< * * cdef Surface rv = Surface(()) */ __pyx_v_new_surface = SDL_ConvertSurfaceFormat(__pyx_v_self->surface, __pyx_v_pixel_format, 0); } /* "pygame_sdl2/surface.pyx":311 * pixel_format = SDL_MasksToPixelFormatEnum(32, rmask, gmask, bmask, amask) * * with nogil: # <<<<<<<<<<<<<< * new_surface = SDL_ConvertSurfaceFormat(self.surface, pixel_format, 0) * */ /*finally:*/ { /*normal exit:*/{ #ifdef WITH_THREAD Py_BLOCK_THREADS #endif goto __pyx_L12; } __pyx_L12:; } } } __pyx_L5:; /* "pygame_sdl2/surface.pyx":314 * new_surface = SDL_ConvertSurfaceFormat(self.surface, pixel_format, 0) * * cdef Surface rv = Surface(()) # <<<<<<<<<<<<<< * rv.take_surface(new_surface) * */ __pyx_t_3 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_11pygame_sdl2_7surface_Surface), __pyx_tuple__5, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 314, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_v_rv = ((struct __pyx_obj_11pygame_sdl2_7surface_Surface *)__pyx_t_3); __pyx_t_3 = 0; /* "pygame_sdl2/surface.pyx":315 * * cdef Surface rv = Surface(()) * rv.take_surface(new_surface) # <<<<<<<<<<<<<< * * return rv */ ((struct __pyx_vtabstruct_11pygame_sdl2_7surface_Surface *)__pyx_v_rv->__pyx_vtab)->take_surface(__pyx_v_rv, __pyx_v_new_surface); /* "pygame_sdl2/surface.pyx":317 * rv.take_surface(new_surface) * * return rv # <<<<<<<<<<<<<< * * def copy(self): */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(((PyObject *)__pyx_v_rv)); __pyx_r = ((PyObject *)__pyx_v_rv); goto __pyx_L0; /* "pygame_sdl2/surface.pyx":277 * return rv * * def convert_alpha(self, Surface surface=None): # <<<<<<<<<<<<<< * if surface is None: * surface = pygame_sdl2.display.get_surface() */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_5); __Pyx_AddTraceback("pygame_sdl2.surface.Surface.convert_alpha", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF((PyObject *)__pyx_v_rv); __Pyx_XDECREF((PyObject *)__pyx_v_surface); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/surface.pyx":319 * return rv * * def copy(self): # <<<<<<<<<<<<<< * if self.surface.format.Amask: * return self.convert_alpha(self) */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_7surface_7Surface_17copy(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/ static PyObject *__pyx_pw_11pygame_sdl2_7surface_7Surface_17copy(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("copy (wrapper)", 0); __pyx_r = __pyx_pf_11pygame_sdl2_7surface_7Surface_16copy(((struct __pyx_obj_11pygame_sdl2_7surface_Surface *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_7surface_7Surface_16copy(struct __pyx_obj_11pygame_sdl2_7surface_Surface *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; PyObject *__pyx_t_5 = NULL; __Pyx_RefNannySetupContext("copy", 0); /* "pygame_sdl2/surface.pyx":320 * * def copy(self): * if self.surface.format.Amask: # <<<<<<<<<<<<<< * return self.convert_alpha(self) * else: */ __pyx_t_1 = (__pyx_v_self->surface->format->Amask != 0); if (__pyx_t_1) { /* "pygame_sdl2/surface.pyx":321 * def copy(self): * if self.surface.format.Amask: * return self.convert_alpha(self) # <<<<<<<<<<<<<< * else: * return self.convert(self) */ __Pyx_XDECREF(__pyx_r); __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_convert_alpha); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 321, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = NULL; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) { __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3); if (likely(__pyx_t_4)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); __Pyx_INCREF(__pyx_t_4); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_3, function); } } if (!__pyx_t_4) { __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_3, ((PyObject *)__pyx_v_self)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 321, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); } else { #if CYTHON_FAST_PYCALL if (PyFunction_Check(__pyx_t_3)) { PyObject *__pyx_temp[2] = {__pyx_t_4, ((PyObject *)__pyx_v_self)}; __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_3, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 321, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_GOTREF(__pyx_t_2); } else #endif #if CYTHON_FAST_PYCCALL if (__Pyx_PyFastCFunction_Check(__pyx_t_3)) { PyObject *__pyx_temp[2] = {__pyx_t_4, ((PyObject *)__pyx_v_self)}; __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 321, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_GOTREF(__pyx_t_2); } else #endif { __pyx_t_5 = PyTuple_New(1+1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 321, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_4); __pyx_t_4 = NULL; __Pyx_INCREF(((PyObject *)__pyx_v_self)); __Pyx_GIVEREF(((PyObject *)__pyx_v_self)); PyTuple_SET_ITEM(__pyx_t_5, 0+1, ((PyObject *)__pyx_v_self)); __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_5, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 321, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; } } __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; /* "pygame_sdl2/surface.pyx":320 * * def copy(self): * if self.surface.format.Amask: # <<<<<<<<<<<<<< * return self.convert_alpha(self) * else: */ } /* "pygame_sdl2/surface.pyx":323 * return self.convert_alpha(self) * else: * return self.convert(self) # <<<<<<<<<<<<<< * * def fill(self, color, rect=None, special_flags=0): */ /*else*/ { __Pyx_XDECREF(__pyx_r); __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_convert); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 323, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_5 = NULL; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) { __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_3); if (likely(__pyx_t_5)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); __Pyx_INCREF(__pyx_t_5); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_3, function); } } if (!__pyx_t_5) { __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_3, ((PyObject *)__pyx_v_self)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 323, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); } else { #if CYTHON_FAST_PYCALL if (PyFunction_Check(__pyx_t_3)) { PyObject *__pyx_temp[2] = {__pyx_t_5, ((PyObject *)__pyx_v_self)}; __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_3, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 323, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_GOTREF(__pyx_t_2); } else #endif #if CYTHON_FAST_PYCCALL if (__Pyx_PyFastCFunction_Check(__pyx_t_3)) { PyObject *__pyx_temp[2] = {__pyx_t_5, ((PyObject *)__pyx_v_self)}; __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 323, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_GOTREF(__pyx_t_2); } else #endif { __pyx_t_4 = PyTuple_New(1+1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 323, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_5); __pyx_t_5 = NULL; __Pyx_INCREF(((PyObject *)__pyx_v_self)); __Pyx_GIVEREF(((PyObject *)__pyx_v_self)); PyTuple_SET_ITEM(__pyx_t_4, 0+1, ((PyObject *)__pyx_v_self)); __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_4, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 323, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; } } __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; } /* "pygame_sdl2/surface.pyx":319 * return rv * * def copy(self): # <<<<<<<<<<<<<< * if self.surface.format.Amask: * return self.convert_alpha(self) */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_5); __Pyx_AddTraceback("pygame_sdl2.surface.Surface.copy", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/surface.pyx":325 * return self.convert(self) * * def fill(self, color, rect=None, special_flags=0): # <<<<<<<<<<<<<< * * cdef SDL_Rect sdl_rect */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_7surface_7Surface_19fill(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static PyObject *__pyx_pw_11pygame_sdl2_7surface_7Surface_19fill(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_color = 0; PyObject *__pyx_v_rect = 0; CYTHON_UNUSED PyObject *__pyx_v_special_flags = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("fill (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_color,&__pyx_n_s_rect,&__pyx_n_s_special_flags,0}; PyObject* values[3] = {0,0,0}; values[1] = ((PyObject *)Py_None); values[2] = ((PyObject *)__pyx_int_0); if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_color)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; case 1: if (kw_args > 0) { PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_rect); if (value) { values[1] = value; kw_args--; } } case 2: if (kw_args > 0) { PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_special_flags); if (value) { values[2] = value; kw_args--; } } } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "fill") < 0)) __PYX_ERR(0, 325, __pyx_L3_error) } } else { switch (PyTuple_GET_SIZE(__pyx_args)) { case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_color = values[0]; __pyx_v_rect = values[1]; __pyx_v_special_flags = values[2]; } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("fill", 0, 1, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 325, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("pygame_sdl2.surface.Surface.fill", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_11pygame_sdl2_7surface_7Surface_18fill(((struct __pyx_obj_11pygame_sdl2_7surface_Surface *)__pyx_v_self), __pyx_v_color, __pyx_v_rect, __pyx_v_special_flags); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_7surface_7Surface_18fill(struct __pyx_obj_11pygame_sdl2_7surface_Surface *__pyx_v_self, PyObject *__pyx_v_color, PyObject *__pyx_v_rect, CYTHON_UNUSED PyObject *__pyx_v_special_flags) { SDL_Rect __pyx_v_sdl_rect; Uint32 __pyx_v_pixel; int __pyx_v_err; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations Uint32 __pyx_t_1; int __pyx_t_2; int __pyx_t_3; int __pyx_t_4; PyObject *__pyx_t_5 = NULL; PyObject *__pyx_t_6 = NULL; PyObject *__pyx_t_7 = NULL; PyObject *__pyx_t_8 = NULL; PyObject *__pyx_t_9 = NULL; PyObject *__pyx_t_10 = NULL; PyObject *__pyx_t_11 = NULL; PyObject *__pyx_t_12 = NULL; __Pyx_RefNannySetupContext("fill", 0); /* "pygame_sdl2/surface.pyx":328 * * cdef SDL_Rect sdl_rect * cdef Uint32 pixel = map_color(self.surface, color) # <<<<<<<<<<<<<< * cdef int err * */ __pyx_t_1 = __pyx_f_11pygame_sdl2_5color_map_color(__pyx_v_self->surface, __pyx_v_color); if (unlikely(__pyx_t_1 == 0xaabbccdd && PyErr_Occurred())) __PYX_ERR(0, 328, __pyx_L1_error) __pyx_v_pixel = __pyx_t_1; /* "pygame_sdl2/surface.pyx":331 * cdef int err * * if rect is not None: # <<<<<<<<<<<<<< * to_sdl_rect(rect, &sdl_rect) * */ __pyx_t_2 = (__pyx_v_rect != Py_None); __pyx_t_3 = (__pyx_t_2 != 0); if (__pyx_t_3) { /* "pygame_sdl2/surface.pyx":332 * * if rect is not None: * to_sdl_rect(rect, &sdl_rect) # <<<<<<<<<<<<<< * * if sdl_rect.x < 0: */ __pyx_t_4 = __pyx_f_11pygame_sdl2_4rect_to_sdl_rect(__pyx_v_rect, (&__pyx_v_sdl_rect), NULL); if (unlikely(__pyx_t_4 == -1)) __PYX_ERR(0, 332, __pyx_L1_error) /* "pygame_sdl2/surface.pyx":334 * to_sdl_rect(rect, &sdl_rect) * * if sdl_rect.x < 0: # <<<<<<<<<<<<<< * sdl_rect.w = sdl_rect.w + sdl_rect.x * sdl_rect.x = 0 */ __pyx_t_3 = ((__pyx_v_sdl_rect.x < 0) != 0); if (__pyx_t_3) { /* "pygame_sdl2/surface.pyx":335 * * if sdl_rect.x < 0: * sdl_rect.w = sdl_rect.w + sdl_rect.x # <<<<<<<<<<<<<< * sdl_rect.x = 0 * */ __pyx_v_sdl_rect.w = (__pyx_v_sdl_rect.w + __pyx_v_sdl_rect.x); /* "pygame_sdl2/surface.pyx":336 * if sdl_rect.x < 0: * sdl_rect.w = sdl_rect.w + sdl_rect.x * sdl_rect.x = 0 # <<<<<<<<<<<<<< * * if sdl_rect.y < 0: */ __pyx_v_sdl_rect.x = 0; /* "pygame_sdl2/surface.pyx":334 * to_sdl_rect(rect, &sdl_rect) * * if sdl_rect.x < 0: # <<<<<<<<<<<<<< * sdl_rect.w = sdl_rect.w + sdl_rect.x * sdl_rect.x = 0 */ } /* "pygame_sdl2/surface.pyx":338 * sdl_rect.x = 0 * * if sdl_rect.y < 0: # <<<<<<<<<<<<<< * sdl_rect.w = sdl_rect.h + sdl_rect.y * sdl_rect.y = 0 */ __pyx_t_3 = ((__pyx_v_sdl_rect.y < 0) != 0); if (__pyx_t_3) { /* "pygame_sdl2/surface.pyx":339 * * if sdl_rect.y < 0: * sdl_rect.w = sdl_rect.h + sdl_rect.y # <<<<<<<<<<<<<< * sdl_rect.y = 0 * */ __pyx_v_sdl_rect.w = (__pyx_v_sdl_rect.h + __pyx_v_sdl_rect.y); /* "pygame_sdl2/surface.pyx":340 * if sdl_rect.y < 0: * sdl_rect.w = sdl_rect.h + sdl_rect.y * sdl_rect.y = 0 # <<<<<<<<<<<<<< * * if sdl_rect.w <= 0 or sdl_rect.h <= 0: */ __pyx_v_sdl_rect.y = 0; /* "pygame_sdl2/surface.pyx":338 * sdl_rect.x = 0 * * if sdl_rect.y < 0: # <<<<<<<<<<<<<< * sdl_rect.w = sdl_rect.h + sdl_rect.y * sdl_rect.y = 0 */ } /* "pygame_sdl2/surface.pyx":342 * sdl_rect.y = 0 * * if sdl_rect.w <= 0 or sdl_rect.h <= 0: # <<<<<<<<<<<<<< * return Rect(0, 0, 0, 0) * */ __pyx_t_2 = ((__pyx_v_sdl_rect.w <= 0) != 0); if (!__pyx_t_2) { } else { __pyx_t_3 = __pyx_t_2; goto __pyx_L7_bool_binop_done; } __pyx_t_2 = ((__pyx_v_sdl_rect.h <= 0) != 0); __pyx_t_3 = __pyx_t_2; __pyx_L7_bool_binop_done:; if (__pyx_t_3) { /* "pygame_sdl2/surface.pyx":343 * * if sdl_rect.w <= 0 or sdl_rect.h <= 0: * return Rect(0, 0, 0, 0) # <<<<<<<<<<<<<< * * with nogil: */ __Pyx_XDECREF(__pyx_r); __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_Rect); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 343, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_tuple__6, NULL); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 343, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __pyx_r = __pyx_t_6; __pyx_t_6 = 0; goto __pyx_L0; /* "pygame_sdl2/surface.pyx":342 * sdl_rect.y = 0 * * if sdl_rect.w <= 0 or sdl_rect.h <= 0: # <<<<<<<<<<<<<< * return Rect(0, 0, 0, 0) * */ } /* "pygame_sdl2/surface.pyx":345 * return Rect(0, 0, 0, 0) * * with nogil: # <<<<<<<<<<<<<< * err = SDL_FillRect(self.surface, &sdl_rect, pixel) * */ { #ifdef WITH_THREAD PyThreadState *_save; Py_UNBLOCK_THREADS #endif /*try:*/ { /* "pygame_sdl2/surface.pyx":346 * * with nogil: * err = SDL_FillRect(self.surface, &sdl_rect, pixel) # <<<<<<<<<<<<<< * * if err: */ __pyx_v_err = SDL_FillRect(__pyx_v_self->surface, (&__pyx_v_sdl_rect), __pyx_v_pixel); } /* "pygame_sdl2/surface.pyx":345 * return Rect(0, 0, 0, 0) * * with nogil: # <<<<<<<<<<<<<< * err = SDL_FillRect(self.surface, &sdl_rect, pixel) * */ /*finally:*/ { /*normal exit:*/{ #ifdef WITH_THREAD Py_BLOCK_THREADS #endif goto __pyx_L11; } __pyx_L11:; } } /* "pygame_sdl2/surface.pyx":348 * err = SDL_FillRect(self.surface, &sdl_rect, pixel) * * if err: # <<<<<<<<<<<<<< * raise error() * */ __pyx_t_3 = (__pyx_v_err != 0); if (__pyx_t_3) { /* "pygame_sdl2/surface.pyx":349 * * if err: * raise error() # <<<<<<<<<<<<<< * * return Rect(sdl_rect.x, sdl_rect.y, sdl_rect.w, sdl_rect.h) */ __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_error); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 349, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_7 = NULL; if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_5))) { __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_5); if (likely(__pyx_t_7)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5); __Pyx_INCREF(__pyx_t_7); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_5, function); } } if (__pyx_t_7) { __pyx_t_6 = __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_t_7); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 349, __pyx_L1_error) __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; } else { __pyx_t_6 = __Pyx_PyObject_CallNoArg(__pyx_t_5); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 349, __pyx_L1_error) } __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_Raise(__pyx_t_6, 0, 0, 0); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __PYX_ERR(0, 349, __pyx_L1_error) /* "pygame_sdl2/surface.pyx":348 * err = SDL_FillRect(self.surface, &sdl_rect, pixel) * * if err: # <<<<<<<<<<<<<< * raise error() * */ } /* "pygame_sdl2/surface.pyx":351 * raise error() * * return Rect(sdl_rect.x, sdl_rect.y, sdl_rect.w, sdl_rect.h) # <<<<<<<<<<<<<< * * else: */ __Pyx_XDECREF(__pyx_r); __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_Rect); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 351, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_7 = __Pyx_PyInt_From_int(__pyx_v_sdl_rect.x); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 351, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __pyx_t_8 = __Pyx_PyInt_From_int(__pyx_v_sdl_rect.y); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 351, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __pyx_t_9 = __Pyx_PyInt_From_int(__pyx_v_sdl_rect.w); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 351, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); __pyx_t_10 = __Pyx_PyInt_From_int(__pyx_v_sdl_rect.h); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 351, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_10); __pyx_t_11 = NULL; __pyx_t_4 = 0; if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_5))) { __pyx_t_11 = PyMethod_GET_SELF(__pyx_t_5); if (likely(__pyx_t_11)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5); __Pyx_INCREF(__pyx_t_11); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_5, function); __pyx_t_4 = 1; } } #if CYTHON_FAST_PYCALL if (PyFunction_Check(__pyx_t_5)) { PyObject *__pyx_temp[5] = {__pyx_t_11, __pyx_t_7, __pyx_t_8, __pyx_t_9, __pyx_t_10}; __pyx_t_6 = __Pyx_PyFunction_FastCall(__pyx_t_5, __pyx_temp+1-__pyx_t_4, 4+__pyx_t_4); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 351, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0; __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; } else #endif #if CYTHON_FAST_PYCCALL if (__Pyx_PyFastCFunction_Check(__pyx_t_5)) { PyObject *__pyx_temp[5] = {__pyx_t_11, __pyx_t_7, __pyx_t_8, __pyx_t_9, __pyx_t_10}; __pyx_t_6 = __Pyx_PyCFunction_FastCall(__pyx_t_5, __pyx_temp+1-__pyx_t_4, 4+__pyx_t_4); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 351, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0; __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; } else #endif { __pyx_t_12 = PyTuple_New(4+__pyx_t_4); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 351, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_12); if (__pyx_t_11) { __Pyx_GIVEREF(__pyx_t_11); PyTuple_SET_ITEM(__pyx_t_12, 0, __pyx_t_11); __pyx_t_11 = NULL; } __Pyx_GIVEREF(__pyx_t_7); PyTuple_SET_ITEM(__pyx_t_12, 0+__pyx_t_4, __pyx_t_7); __Pyx_GIVEREF(__pyx_t_8); PyTuple_SET_ITEM(__pyx_t_12, 1+__pyx_t_4, __pyx_t_8); __Pyx_GIVEREF(__pyx_t_9); PyTuple_SET_ITEM(__pyx_t_12, 2+__pyx_t_4, __pyx_t_9); __Pyx_GIVEREF(__pyx_t_10); PyTuple_SET_ITEM(__pyx_t_12, 3+__pyx_t_4, __pyx_t_10); __pyx_t_7 = 0; __pyx_t_8 = 0; __pyx_t_9 = 0; __pyx_t_10 = 0; __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_12, NULL); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 351, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; } __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __pyx_r = __pyx_t_6; __pyx_t_6 = 0; goto __pyx_L0; /* "pygame_sdl2/surface.pyx":331 * cdef int err * * if rect is not None: # <<<<<<<<<<<<<< * to_sdl_rect(rect, &sdl_rect) * */ } /* "pygame_sdl2/surface.pyx":354 * * else: * with nogil: # <<<<<<<<<<<<<< * err = SDL_FillRect(self.surface, NULL, pixel) * */ /*else*/ { { #ifdef WITH_THREAD PyThreadState *_save; Py_UNBLOCK_THREADS #endif /*try:*/ { /* "pygame_sdl2/surface.pyx":355 * else: * with nogil: * err = SDL_FillRect(self.surface, NULL, pixel) # <<<<<<<<<<<<<< * * if err: */ __pyx_v_err = SDL_FillRect(__pyx_v_self->surface, NULL, __pyx_v_pixel); } /* "pygame_sdl2/surface.pyx":354 * * else: * with nogil: # <<<<<<<<<<<<<< * err = SDL_FillRect(self.surface, NULL, pixel) * */ /*finally:*/ { /*normal exit:*/{ #ifdef WITH_THREAD Py_BLOCK_THREADS #endif goto __pyx_L15; } __pyx_L15:; } } /* "pygame_sdl2/surface.pyx":357 * err = SDL_FillRect(self.surface, NULL, pixel) * * if err: # <<<<<<<<<<<<<< * raise error() * */ __pyx_t_3 = (__pyx_v_err != 0); if (__pyx_t_3) { /* "pygame_sdl2/surface.pyx":358 * * if err: * raise error() # <<<<<<<<<<<<<< * * return Rect(0, 0, self.surface.w, self.surface.h) */ __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_error); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 358, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_12 = NULL; if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_5))) { __pyx_t_12 = PyMethod_GET_SELF(__pyx_t_5); if (likely(__pyx_t_12)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5); __Pyx_INCREF(__pyx_t_12); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_5, function); } } if (__pyx_t_12) { __pyx_t_6 = __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_t_12); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 358, __pyx_L1_error) __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; } else { __pyx_t_6 = __Pyx_PyObject_CallNoArg(__pyx_t_5); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 358, __pyx_L1_error) } __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_Raise(__pyx_t_6, 0, 0, 0); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __PYX_ERR(0, 358, __pyx_L1_error) /* "pygame_sdl2/surface.pyx":357 * err = SDL_FillRect(self.surface, NULL, pixel) * * if err: # <<<<<<<<<<<<<< * raise error() * */ } /* "pygame_sdl2/surface.pyx":360 * raise error() * * return Rect(0, 0, self.surface.w, self.surface.h) # <<<<<<<<<<<<<< * * */ __Pyx_XDECREF(__pyx_r); __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_Rect); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 360, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_12 = __Pyx_PyInt_From_int(__pyx_v_self->surface->w); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 360, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_12); __pyx_t_10 = __Pyx_PyInt_From_int(__pyx_v_self->surface->h); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 360, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_10); __pyx_t_9 = NULL; __pyx_t_4 = 0; if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_5))) { __pyx_t_9 = PyMethod_GET_SELF(__pyx_t_5); if (likely(__pyx_t_9)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5); __Pyx_INCREF(__pyx_t_9); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_5, function); __pyx_t_4 = 1; } } #if CYTHON_FAST_PYCALL if (PyFunction_Check(__pyx_t_5)) { PyObject *__pyx_temp[5] = {__pyx_t_9, __pyx_int_0, __pyx_int_0, __pyx_t_12, __pyx_t_10}; __pyx_t_6 = __Pyx_PyFunction_FastCall(__pyx_t_5, __pyx_temp+1-__pyx_t_4, 4+__pyx_t_4); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 360, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0; __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; } else #endif #if CYTHON_FAST_PYCCALL if (__Pyx_PyFastCFunction_Check(__pyx_t_5)) { PyObject *__pyx_temp[5] = {__pyx_t_9, __pyx_int_0, __pyx_int_0, __pyx_t_12, __pyx_t_10}; __pyx_t_6 = __Pyx_PyCFunction_FastCall(__pyx_t_5, __pyx_temp+1-__pyx_t_4, 4+__pyx_t_4); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 360, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0; __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; } else #endif { __pyx_t_8 = PyTuple_New(4+__pyx_t_4); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 360, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); if (__pyx_t_9) { __Pyx_GIVEREF(__pyx_t_9); PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_9); __pyx_t_9 = NULL; } __Pyx_INCREF(__pyx_int_0); __Pyx_GIVEREF(__pyx_int_0); PyTuple_SET_ITEM(__pyx_t_8, 0+__pyx_t_4, __pyx_int_0); __Pyx_INCREF(__pyx_int_0); __Pyx_GIVEREF(__pyx_int_0); PyTuple_SET_ITEM(__pyx_t_8, 1+__pyx_t_4, __pyx_int_0); __Pyx_GIVEREF(__pyx_t_12); PyTuple_SET_ITEM(__pyx_t_8, 2+__pyx_t_4, __pyx_t_12); __Pyx_GIVEREF(__pyx_t_10); PyTuple_SET_ITEM(__pyx_t_8, 3+__pyx_t_4, __pyx_t_10); __pyx_t_12 = 0; __pyx_t_10 = 0; __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_8, NULL); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 360, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; } __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __pyx_r = __pyx_t_6; __pyx_t_6 = 0; goto __pyx_L0; } /* "pygame_sdl2/surface.pyx":325 * return self.convert(self) * * def fill(self, color, rect=None, special_flags=0): # <<<<<<<<<<<<<< * * cdef SDL_Rect sdl_rect */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_5); __Pyx_XDECREF(__pyx_t_6); __Pyx_XDECREF(__pyx_t_7); __Pyx_XDECREF(__pyx_t_8); __Pyx_XDECREF(__pyx_t_9); __Pyx_XDECREF(__pyx_t_10); __Pyx_XDECREF(__pyx_t_11); __Pyx_XDECREF(__pyx_t_12); __Pyx_AddTraceback("pygame_sdl2.surface.Surface.fill", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/surface.pyx":363 * * * def scroll(self, int dx=0, int dy=0): # <<<<<<<<<<<<<< * cdef int srcx, destx, move_width * cdef int srcy, desty, move_height */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_7surface_7Surface_21scroll(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static PyObject *__pyx_pw_11pygame_sdl2_7surface_7Surface_21scroll(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { int __pyx_v_dx; int __pyx_v_dy; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("scroll (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_dx,&__pyx_n_s_dy,0}; PyObject* values[2] = {0,0}; if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (kw_args > 0) { PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_dx); if (value) { values[0] = value; kw_args--; } } case 1: if (kw_args > 0) { PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_dy); if (value) { values[1] = value; kw_args--; } } } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "scroll") < 0)) __PYX_ERR(0, 363, __pyx_L3_error) } } else { switch (PyTuple_GET_SIZE(__pyx_args)) { case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); case 0: break; default: goto __pyx_L5_argtuple_error; } } if (values[0]) { __pyx_v_dx = __Pyx_PyInt_As_int(values[0]); if (unlikely((__pyx_v_dx == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 363, __pyx_L3_error) } else { __pyx_v_dx = ((int)0); } if (values[1]) { __pyx_v_dy = __Pyx_PyInt_As_int(values[1]); if (unlikely((__pyx_v_dy == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 363, __pyx_L3_error) } else { __pyx_v_dy = ((int)0); } } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("scroll", 0, 0, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 363, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("pygame_sdl2.surface.Surface.scroll", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_11pygame_sdl2_7surface_7Surface_20scroll(((struct __pyx_obj_11pygame_sdl2_7surface_Surface *)__pyx_v_self), __pyx_v_dx, __pyx_v_dy); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_7surface_7Surface_20scroll(struct __pyx_obj_11pygame_sdl2_7surface_Surface *__pyx_v_self, int __pyx_v_dx, int __pyx_v_dy) { int __pyx_v_srcx; int __pyx_v_destx; int __pyx_v_move_width; int __pyx_v_srcy; int __pyx_v_desty; int __pyx_v_move_height; int __pyx_v_width; int __pyx_v_height; int __pyx_v_per_pixel; Uint8 *__pyx_v_srcptr; Uint8 *__pyx_v_destptr; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; Uint8 __pyx_t_2; int __pyx_t_3; PyObject *__pyx_t_4 = NULL; PyObject *__pyx_t_5 = NULL; PyObject *__pyx_t_6 = NULL; __Pyx_RefNannySetupContext("scroll", 0); /* "pygame_sdl2/surface.pyx":367 * cdef int srcy, desty, move_height * * cdef int width = self.surface.w # <<<<<<<<<<<<<< * cdef int height = self.surface.h * */ __pyx_t_1 = __pyx_v_self->surface->w; __pyx_v_width = __pyx_t_1; /* "pygame_sdl2/surface.pyx":368 * * cdef int width = self.surface.w * cdef int height = self.surface.h # <<<<<<<<<<<<<< * * cdef int per_pixel = self.surface.format.BytesPerPixel */ __pyx_t_1 = __pyx_v_self->surface->h; __pyx_v_height = __pyx_t_1; /* "pygame_sdl2/surface.pyx":370 * cdef int height = self.surface.h * * cdef int per_pixel = self.surface.format.BytesPerPixel # <<<<<<<<<<<<<< * * if dx >= 0: */ __pyx_t_2 = __pyx_v_self->surface->format->BytesPerPixel; __pyx_v_per_pixel = __pyx_t_2; /* "pygame_sdl2/surface.pyx":372 * cdef int per_pixel = self.surface.format.BytesPerPixel * * if dx >= 0: # <<<<<<<<<<<<<< * srcx = 0 * destx = dx */ __pyx_t_3 = ((__pyx_v_dx >= 0) != 0); if (__pyx_t_3) { /* "pygame_sdl2/surface.pyx":373 * * if dx >= 0: * srcx = 0 # <<<<<<<<<<<<<< * destx = dx * move_width = width - dx */ __pyx_v_srcx = 0; /* "pygame_sdl2/surface.pyx":374 * if dx >= 0: * srcx = 0 * destx = dx # <<<<<<<<<<<<<< * move_width = width - dx * else: */ __pyx_v_destx = __pyx_v_dx; /* "pygame_sdl2/surface.pyx":375 * srcx = 0 * destx = dx * move_width = width - dx # <<<<<<<<<<<<<< * else: * srcx = -dx */ __pyx_v_move_width = (__pyx_v_width - __pyx_v_dx); /* "pygame_sdl2/surface.pyx":372 * cdef int per_pixel = self.surface.format.BytesPerPixel * * if dx >= 0: # <<<<<<<<<<<<<< * srcx = 0 * destx = dx */ goto __pyx_L3; } /* "pygame_sdl2/surface.pyx":377 * move_width = width - dx * else: * srcx = -dx # <<<<<<<<<<<<<< * destx = 0 * move_width = width + dx */ /*else*/ { __pyx_v_srcx = (-__pyx_v_dx); /* "pygame_sdl2/surface.pyx":378 * else: * srcx = -dx * destx = 0 # <<<<<<<<<<<<<< * move_width = width + dx * */ __pyx_v_destx = 0; /* "pygame_sdl2/surface.pyx":379 * srcx = -dx * destx = 0 * move_width = width + dx # <<<<<<<<<<<<<< * * if dy >= 0: */ __pyx_v_move_width = (__pyx_v_width + __pyx_v_dx); } __pyx_L3:; /* "pygame_sdl2/surface.pyx":381 * move_width = width + dx * * if dy >= 0: # <<<<<<<<<<<<<< * srcy = 0 * desty = dy */ __pyx_t_3 = ((__pyx_v_dy >= 0) != 0); if (__pyx_t_3) { /* "pygame_sdl2/surface.pyx":382 * * if dy >= 0: * srcy = 0 # <<<<<<<<<<<<<< * desty = dy * move_height = height - dy */ __pyx_v_srcy = 0; /* "pygame_sdl2/surface.pyx":383 * if dy >= 0: * srcy = 0 * desty = dy # <<<<<<<<<<<<<< * move_height = height - dy * else: */ __pyx_v_desty = __pyx_v_dy; /* "pygame_sdl2/surface.pyx":384 * srcy = 0 * desty = dy * move_height = height - dy # <<<<<<<<<<<<<< * else: * srcy = -dy */ __pyx_v_move_height = (__pyx_v_height - __pyx_v_dy); /* "pygame_sdl2/surface.pyx":381 * move_width = width + dx * * if dy >= 0: # <<<<<<<<<<<<<< * srcy = 0 * desty = dy */ goto __pyx_L4; } /* "pygame_sdl2/surface.pyx":386 * move_height = height - dy * else: * srcy = -dy # <<<<<<<<<<<<<< * desty = 0 * move_height = height + dy */ /*else*/ { __pyx_v_srcy = (-__pyx_v_dy); /* "pygame_sdl2/surface.pyx":387 * else: * srcy = -dy * desty = 0 # <<<<<<<<<<<<<< * move_height = height + dy * */ __pyx_v_desty = 0; /* "pygame_sdl2/surface.pyx":388 * srcy = -dy * desty = 0 * move_height = height + dy # <<<<<<<<<<<<<< * * cdef Uint8 *srcptr = self.surface.pixels */ __pyx_v_move_height = (__pyx_v_height + __pyx_v_dy); } __pyx_L4:; /* "pygame_sdl2/surface.pyx":390 * move_height = height + dy * * cdef Uint8 *srcptr = self.surface.pixels # <<<<<<<<<<<<<< * cdef Uint8 *destptr = self.surface.pixels * */ __pyx_v_srcptr = ((Uint8 *)__pyx_v_self->surface->pixels); /* "pygame_sdl2/surface.pyx":391 * * cdef Uint8 *srcptr = self.surface.pixels * cdef Uint8 *destptr = self.surface.pixels # <<<<<<<<<<<<<< * * srcptr += srcy * self.surface.pitch + srcx * per_pixel */ __pyx_v_destptr = ((Uint8 *)__pyx_v_self->surface->pixels); /* "pygame_sdl2/surface.pyx":393 * cdef Uint8 *destptr = self.surface.pixels * * srcptr += srcy * self.surface.pitch + srcx * per_pixel # <<<<<<<<<<<<<< * destptr += desty * self.surface.pitch + destx * per_pixel * */ __pyx_v_srcptr = (__pyx_v_srcptr + ((__pyx_v_srcy * __pyx_v_self->surface->pitch) + (__pyx_v_srcx * __pyx_v_per_pixel))); /* "pygame_sdl2/surface.pyx":394 * * srcptr += srcy * self.surface.pitch + srcx * per_pixel * destptr += desty * self.surface.pitch + destx * per_pixel # <<<<<<<<<<<<<< * * self.lock() */ __pyx_v_destptr = (__pyx_v_destptr + ((__pyx_v_desty * __pyx_v_self->surface->pitch) + (__pyx_v_destx * __pyx_v_per_pixel))); /* "pygame_sdl2/surface.pyx":396 * destptr += desty * self.surface.pitch + destx * per_pixel * * self.lock() # <<<<<<<<<<<<<< * * with nogil: */ __pyx_t_5 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_lock); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 396, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_6 = NULL; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_5))) { __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_5); if (likely(__pyx_t_6)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5); __Pyx_INCREF(__pyx_t_6); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_5, function); } } if (__pyx_t_6) { __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_t_6); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 396, __pyx_L1_error) __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; } else { __pyx_t_4 = __Pyx_PyObject_CallNoArg(__pyx_t_5); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 396, __pyx_L1_error) } __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; /* "pygame_sdl2/surface.pyx":398 * self.lock() * * with nogil: # <<<<<<<<<<<<<< * move_pixels( * srcptr, */ { #ifdef WITH_THREAD PyThreadState *_save; Py_UNBLOCK_THREADS #endif /*try:*/ { /* "pygame_sdl2/surface.pyx":399 * * with nogil: * move_pixels( # <<<<<<<<<<<<<< * srcptr, * destptr, */ __pyx_f_11pygame_sdl2_7surface_move_pixels(__pyx_v_srcptr, __pyx_v_destptr, __pyx_v_move_height, (__pyx_v_move_width * __pyx_v_per_pixel), __pyx_v_self->surface->pitch, __pyx_v_self->surface->pitch); } /* "pygame_sdl2/surface.pyx":398 * self.lock() * * with nogil: # <<<<<<<<<<<<<< * move_pixels( * srcptr, */ /*finally:*/ { /*normal exit:*/{ #ifdef WITH_THREAD Py_BLOCK_THREADS #endif goto __pyx_L7; } __pyx_L7:; } } /* "pygame_sdl2/surface.pyx":407 * self.surface.pitch) * * self.unlock() # <<<<<<<<<<<<<< * * def set_colorkey(self, color, flags=0): */ __pyx_t_5 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_unlock); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 407, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_6 = NULL; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_5))) { __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_5); if (likely(__pyx_t_6)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5); __Pyx_INCREF(__pyx_t_6); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_5, function); } } if (__pyx_t_6) { __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_t_6); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 407, __pyx_L1_error) __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; } else { __pyx_t_4 = __Pyx_PyObject_CallNoArg(__pyx_t_5); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 407, __pyx_L1_error) } __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; /* "pygame_sdl2/surface.pyx":363 * * * def scroll(self, int dx=0, int dy=0): # <<<<<<<<<<<<<< * cdef int srcx, destx, move_width * cdef int srcy, desty, move_height */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_5); __Pyx_XDECREF(__pyx_t_6); __Pyx_AddTraceback("pygame_sdl2.surface.Surface.scroll", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/surface.pyx":409 * self.unlock() * * def set_colorkey(self, color, flags=0): # <<<<<<<<<<<<<< * * if color is None: */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_7surface_7Surface_23set_colorkey(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static PyObject *__pyx_pw_11pygame_sdl2_7surface_7Surface_23set_colorkey(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_color = 0; CYTHON_UNUSED PyObject *__pyx_v_flags = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("set_colorkey (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_color,&__pyx_n_s_flags,0}; PyObject* values[2] = {0,0}; values[1] = ((PyObject *)__pyx_int_0); if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_color)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; case 1: if (kw_args > 0) { PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_flags); if (value) { values[1] = value; kw_args--; } } } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "set_colorkey") < 0)) __PYX_ERR(0, 409, __pyx_L3_error) } } else { switch (PyTuple_GET_SIZE(__pyx_args)) { case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_color = values[0]; __pyx_v_flags = values[1]; } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("set_colorkey", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 409, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("pygame_sdl2.surface.Surface.set_colorkey", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_11pygame_sdl2_7surface_7Surface_22set_colorkey(((struct __pyx_obj_11pygame_sdl2_7surface_Surface *)__pyx_v_self), __pyx_v_color, __pyx_v_flags); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_7surface_7Surface_22set_colorkey(struct __pyx_obj_11pygame_sdl2_7surface_Surface *__pyx_v_self, PyObject *__pyx_v_color, CYTHON_UNUSED PyObject *__pyx_v_flags) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; int __pyx_t_2; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; PyObject *__pyx_t_5 = NULL; Uint32 __pyx_t_6; __Pyx_RefNannySetupContext("set_colorkey", 0); /* "pygame_sdl2/surface.pyx":411 * def set_colorkey(self, color, flags=0): * * if color is None: # <<<<<<<<<<<<<< * if SDL_SetColorKey(self.surface, SDL_FALSE, 0): * raise error() */ __pyx_t_1 = (__pyx_v_color == Py_None); __pyx_t_2 = (__pyx_t_1 != 0); if (__pyx_t_2) { /* "pygame_sdl2/surface.pyx":412 * * if color is None: * if SDL_SetColorKey(self.surface, SDL_FALSE, 0): # <<<<<<<<<<<<<< * raise error() * */ __pyx_t_2 = (SDL_SetColorKey(__pyx_v_self->surface, SDL_FALSE, 0) != 0); if (__pyx_t_2) { /* "pygame_sdl2/surface.pyx":413 * if color is None: * if SDL_SetColorKey(self.surface, SDL_FALSE, 0): * raise error() # <<<<<<<<<<<<<< * * else: */ __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_error); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 413, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_5 = NULL; if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_4))) { __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4); if (likely(__pyx_t_5)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4); __Pyx_INCREF(__pyx_t_5); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_4, function); } } if (__pyx_t_5) { __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_5); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 413, __pyx_L1_error) __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; } else { __pyx_t_3 = __Pyx_PyObject_CallNoArg(__pyx_t_4); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 413, __pyx_L1_error) } __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_Raise(__pyx_t_3, 0, 0, 0); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __PYX_ERR(0, 413, __pyx_L1_error) /* "pygame_sdl2/surface.pyx":412 * * if color is None: * if SDL_SetColorKey(self.surface, SDL_FALSE, 0): # <<<<<<<<<<<<<< * raise error() * */ } /* "pygame_sdl2/surface.pyx":411 * def set_colorkey(self, color, flags=0): * * if color is None: # <<<<<<<<<<<<<< * if SDL_SetColorKey(self.surface, SDL_FALSE, 0): * raise error() */ goto __pyx_L3; } /* "pygame_sdl2/surface.pyx":416 * * else: * if SDL_SetColorKey(self.surface, SDL_TRUE, map_color(self.surface, color)): # <<<<<<<<<<<<<< * raise error() * */ /*else*/ { __pyx_t_6 = __pyx_f_11pygame_sdl2_5color_map_color(__pyx_v_self->surface, __pyx_v_color); if (unlikely(__pyx_t_6 == 0xaabbccdd && PyErr_Occurred())) __PYX_ERR(0, 416, __pyx_L1_error) __pyx_t_2 = (SDL_SetColorKey(__pyx_v_self->surface, SDL_TRUE, __pyx_t_6) != 0); if (__pyx_t_2) { /* "pygame_sdl2/surface.pyx":417 * else: * if SDL_SetColorKey(self.surface, SDL_TRUE, map_color(self.surface, color)): * raise error() # <<<<<<<<<<<<<< * * def get_colorkey(self): */ __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_error); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 417, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_5 = NULL; if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_4))) { __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4); if (likely(__pyx_t_5)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4); __Pyx_INCREF(__pyx_t_5); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_4, function); } } if (__pyx_t_5) { __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_5); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 417, __pyx_L1_error) __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; } else { __pyx_t_3 = __Pyx_PyObject_CallNoArg(__pyx_t_4); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 417, __pyx_L1_error) } __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_Raise(__pyx_t_3, 0, 0, 0); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __PYX_ERR(0, 417, __pyx_L1_error) /* "pygame_sdl2/surface.pyx":416 * * else: * if SDL_SetColorKey(self.surface, SDL_TRUE, map_color(self.surface, color)): # <<<<<<<<<<<<<< * raise error() * */ } } __pyx_L3:; /* "pygame_sdl2/surface.pyx":409 * self.unlock() * * def set_colorkey(self, color, flags=0): # <<<<<<<<<<<<<< * * if color is None: */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_5); __Pyx_AddTraceback("pygame_sdl2.surface.Surface.set_colorkey", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/surface.pyx":419 * raise error() * * def get_colorkey(self): # <<<<<<<<<<<<<< * cdef Uint32 key * */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_7surface_7Surface_25get_colorkey(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/ static PyObject *__pyx_pw_11pygame_sdl2_7surface_7Surface_25get_colorkey(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("get_colorkey (wrapper)", 0); __pyx_r = __pyx_pf_11pygame_sdl2_7surface_7Surface_24get_colorkey(((struct __pyx_obj_11pygame_sdl2_7surface_Surface *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_7surface_7Surface_24get_colorkey(struct __pyx_obj_11pygame_sdl2_7surface_Surface *__pyx_v_self) { Uint32 __pyx_v_key; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; PyObject *__pyx_t_2 = NULL; __Pyx_RefNannySetupContext("get_colorkey", 0); /* "pygame_sdl2/surface.pyx":422 * cdef Uint32 key * * if SDL_GetColorKey(self.surface, &key): # <<<<<<<<<<<<<< * return None * */ __pyx_t_1 = (SDL_GetColorKey(__pyx_v_self->surface, (&__pyx_v_key)) != 0); if (__pyx_t_1) { /* "pygame_sdl2/surface.pyx":423 * * if SDL_GetColorKey(self.surface, &key): * return None # <<<<<<<<<<<<<< * * return get_color(key, self.surface) */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(Py_None); __pyx_r = Py_None; goto __pyx_L0; /* "pygame_sdl2/surface.pyx":422 * cdef Uint32 key * * if SDL_GetColorKey(self.surface, &key): # <<<<<<<<<<<<<< * return None * */ } /* "pygame_sdl2/surface.pyx":425 * return None * * return get_color(key, self.surface) # <<<<<<<<<<<<<< * * def set_alpha(self, value, flags=0): */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __pyx_f_11pygame_sdl2_5color_get_color(__pyx_v_key, __pyx_v_self->surface); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 425, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; /* "pygame_sdl2/surface.pyx":419 * raise error() * * def get_colorkey(self): # <<<<<<<<<<<<<< * cdef Uint32 key * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_AddTraceback("pygame_sdl2.surface.Surface.get_colorkey", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/surface.pyx":427 * return get_color(key, self.surface) * * def set_alpha(self, value, flags=0): # <<<<<<<<<<<<<< * if value is None: * value = 255 */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_7surface_7Surface_27set_alpha(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static PyObject *__pyx_pw_11pygame_sdl2_7surface_7Surface_27set_alpha(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_value = 0; CYTHON_UNUSED PyObject *__pyx_v_flags = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("set_alpha (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_value,&__pyx_n_s_flags,0}; PyObject* values[2] = {0,0}; values[1] = ((PyObject *)__pyx_int_0); if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_value)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; case 1: if (kw_args > 0) { PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_flags); if (value) { values[1] = value; kw_args--; } } } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "set_alpha") < 0)) __PYX_ERR(0, 427, __pyx_L3_error) } } else { switch (PyTuple_GET_SIZE(__pyx_args)) { case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_value = values[0]; __pyx_v_flags = values[1]; } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("set_alpha", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 427, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("pygame_sdl2.surface.Surface.set_alpha", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_11pygame_sdl2_7surface_7Surface_26set_alpha(((struct __pyx_obj_11pygame_sdl2_7surface_Surface *)__pyx_v_self), __pyx_v_value, __pyx_v_flags); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_7surface_7Surface_26set_alpha(struct __pyx_obj_11pygame_sdl2_7surface_Surface *__pyx_v_self, PyObject *__pyx_v_value, CYTHON_UNUSED PyObject *__pyx_v_flags) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; int __pyx_t_2; Uint8 __pyx_t_3; PyObject *__pyx_t_4 = NULL; PyObject *__pyx_t_5 = NULL; PyObject *__pyx_t_6 = NULL; __Pyx_RefNannySetupContext("set_alpha", 0); __Pyx_INCREF(__pyx_v_value); /* "pygame_sdl2/surface.pyx":428 * * def set_alpha(self, value, flags=0): * if value is None: # <<<<<<<<<<<<<< * value = 255 * self.has_alpha = False */ __pyx_t_1 = (__pyx_v_value == Py_None); __pyx_t_2 = (__pyx_t_1 != 0); if (__pyx_t_2) { /* "pygame_sdl2/surface.pyx":429 * def set_alpha(self, value, flags=0): * if value is None: * value = 255 # <<<<<<<<<<<<<< * self.has_alpha = False * else: */ __Pyx_INCREF(__pyx_int_255); __Pyx_DECREF_SET(__pyx_v_value, __pyx_int_255); /* "pygame_sdl2/surface.pyx":430 * if value is None: * value = 255 * self.has_alpha = False # <<<<<<<<<<<<<< * else: * self.has_alpha = True */ __pyx_v_self->has_alpha = 0; /* "pygame_sdl2/surface.pyx":428 * * def set_alpha(self, value, flags=0): * if value is None: # <<<<<<<<<<<<<< * value = 255 * self.has_alpha = False */ goto __pyx_L3; } /* "pygame_sdl2/surface.pyx":432 * self.has_alpha = False * else: * self.has_alpha = True # <<<<<<<<<<<<<< * * if SDL_SetSurfaceAlphaMod(self.surface, value): */ /*else*/ { __pyx_v_self->has_alpha = 1; } __pyx_L3:; /* "pygame_sdl2/surface.pyx":434 * self.has_alpha = True * * if SDL_SetSurfaceAlphaMod(self.surface, value): # <<<<<<<<<<<<<< * raise error() * */ __pyx_t_3 = __Pyx_PyInt_As_uint8_t(__pyx_v_value); if (unlikely((__pyx_t_3 == ((Uint8)-1)) && PyErr_Occurred())) __PYX_ERR(0, 434, __pyx_L1_error) __pyx_t_2 = (SDL_SetSurfaceAlphaMod(__pyx_v_self->surface, __pyx_t_3) != 0); if (__pyx_t_2) { /* "pygame_sdl2/surface.pyx":435 * * if SDL_SetSurfaceAlphaMod(self.surface, value): * raise error() # <<<<<<<<<<<<<< * * def get_alpha(self): */ __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_error); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 435, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_6 = NULL; if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_5))) { __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_5); if (likely(__pyx_t_6)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5); __Pyx_INCREF(__pyx_t_6); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_5, function); } } if (__pyx_t_6) { __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_t_6); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 435, __pyx_L1_error) __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; } else { __pyx_t_4 = __Pyx_PyObject_CallNoArg(__pyx_t_5); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 435, __pyx_L1_error) } __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_Raise(__pyx_t_4, 0, 0, 0); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __PYX_ERR(0, 435, __pyx_L1_error) /* "pygame_sdl2/surface.pyx":434 * self.has_alpha = True * * if SDL_SetSurfaceAlphaMod(self.surface, value): # <<<<<<<<<<<<<< * raise error() * */ } /* "pygame_sdl2/surface.pyx":427 * return get_color(key, self.surface) * * def set_alpha(self, value, flags=0): # <<<<<<<<<<<<<< * if value is None: * value = 255 */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_5); __Pyx_XDECREF(__pyx_t_6); __Pyx_AddTraceback("pygame_sdl2.surface.Surface.set_alpha", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF(__pyx_v_value); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/surface.pyx":437 * raise error() * * def get_alpha(self): # <<<<<<<<<<<<<< * cdef Uint8 rv * */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_7surface_7Surface_29get_alpha(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/ static PyObject *__pyx_pw_11pygame_sdl2_7surface_7Surface_29get_alpha(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("get_alpha (wrapper)", 0); __pyx_r = __pyx_pf_11pygame_sdl2_7surface_7Surface_28get_alpha(((struct __pyx_obj_11pygame_sdl2_7surface_Surface *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_7surface_7Surface_28get_alpha(struct __pyx_obj_11pygame_sdl2_7surface_Surface *__pyx_v_self) { Uint8 __pyx_v_rv; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; int __pyx_t_2; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; PyObject *__pyx_t_5 = NULL; __Pyx_RefNannySetupContext("get_alpha", 0); /* "pygame_sdl2/surface.pyx":440 * cdef Uint8 rv * * if self.has_alpha or self.surface.format.Amask: # <<<<<<<<<<<<<< * * if SDL_GetSurfaceAlphaMod(self.surface, &rv): */ __pyx_t_2 = (__pyx_v_self->has_alpha != 0); if (!__pyx_t_2) { } else { __pyx_t_1 = __pyx_t_2; goto __pyx_L4_bool_binop_done; } __pyx_t_2 = (__pyx_v_self->surface->format->Amask != 0); __pyx_t_1 = __pyx_t_2; __pyx_L4_bool_binop_done:; if (__pyx_t_1) { /* "pygame_sdl2/surface.pyx":442 * if self.has_alpha or self.surface.format.Amask: * * if SDL_GetSurfaceAlphaMod(self.surface, &rv): # <<<<<<<<<<<<<< * raise error() * */ __pyx_t_1 = (SDL_GetSurfaceAlphaMod(__pyx_v_self->surface, (&__pyx_v_rv)) != 0); if (__pyx_t_1) { /* "pygame_sdl2/surface.pyx":443 * * if SDL_GetSurfaceAlphaMod(self.surface, &rv): * raise error() # <<<<<<<<<<<<<< * * return rv */ __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_error); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 443, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_5 = NULL; if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_4))) { __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4); if (likely(__pyx_t_5)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4); __Pyx_INCREF(__pyx_t_5); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_4, function); } } if (__pyx_t_5) { __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_5); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 443, __pyx_L1_error) __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; } else { __pyx_t_3 = __Pyx_PyObject_CallNoArg(__pyx_t_4); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 443, __pyx_L1_error) } __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_Raise(__pyx_t_3, 0, 0, 0); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __PYX_ERR(0, 443, __pyx_L1_error) /* "pygame_sdl2/surface.pyx":442 * if self.has_alpha or self.surface.format.Amask: * * if SDL_GetSurfaceAlphaMod(self.surface, &rv): # <<<<<<<<<<<<<< * raise error() * */ } /* "pygame_sdl2/surface.pyx":445 * raise error() * * return rv # <<<<<<<<<<<<<< * * else: */ __Pyx_XDECREF(__pyx_r); __pyx_t_3 = __Pyx_PyInt_From_uint8_t(__pyx_v_rv); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 445, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_r = __pyx_t_3; __pyx_t_3 = 0; goto __pyx_L0; /* "pygame_sdl2/surface.pyx":440 * cdef Uint8 rv * * if self.has_alpha or self.surface.format.Amask: # <<<<<<<<<<<<<< * * if SDL_GetSurfaceAlphaMod(self.surface, &rv): */ } /* "pygame_sdl2/surface.pyx":448 * * else: * return None # <<<<<<<<<<<<<< * * def lock(self, lock=None): */ /*else*/ { __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(Py_None); __pyx_r = Py_None; goto __pyx_L0; } /* "pygame_sdl2/surface.pyx":437 * raise error() * * def get_alpha(self): # <<<<<<<<<<<<<< * cdef Uint8 rv * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_5); __Pyx_AddTraceback("pygame_sdl2.surface.Surface.get_alpha", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/surface.pyx":450 * return None * * def lock(self, lock=None): # <<<<<<<<<<<<<< * cdef Surface root = self * */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_7surface_7Surface_31lock(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static PyObject *__pyx_pw_11pygame_sdl2_7surface_7Surface_31lock(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_lock = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("lock (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_lock,0}; PyObject* values[1] = {0}; values[0] = ((PyObject *)Py_None); if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (kw_args > 0) { PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_lock); if (value) { values[0] = value; kw_args--; } } } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "lock") < 0)) __PYX_ERR(0, 450, __pyx_L3_error) } } else { switch (PyTuple_GET_SIZE(__pyx_args)) { case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); case 0: break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_lock = values[0]; } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("lock", 0, 0, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 450, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("pygame_sdl2.surface.Surface.lock", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_11pygame_sdl2_7surface_7Surface_30lock(((struct __pyx_obj_11pygame_sdl2_7surface_Surface *)__pyx_v_self), __pyx_v_lock); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_7surface_7Surface_30lock(struct __pyx_obj_11pygame_sdl2_7surface_Surface *__pyx_v_self, PyObject *__pyx_v_lock) { struct __pyx_obj_11pygame_sdl2_7surface_Surface *__pyx_v_root = 0; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; PyObject *__pyx_t_2 = NULL; int __pyx_t_3; int __pyx_t_4; __Pyx_RefNannySetupContext("lock", 0); __Pyx_INCREF(__pyx_v_lock); /* "pygame_sdl2/surface.pyx":451 * * def lock(self, lock=None): * cdef Surface root = self # <<<<<<<<<<<<<< * * while root.parent: */ __Pyx_INCREF(((PyObject *)__pyx_v_self)); __pyx_v_root = __pyx_v_self; /* "pygame_sdl2/surface.pyx":453 * cdef Surface root = self * * while root.parent: # <<<<<<<<<<<<<< * root = root.parent * */ while (1) { __pyx_t_1 = __Pyx_PyObject_IsTrue(((PyObject *)__pyx_v_root->parent)); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(0, 453, __pyx_L1_error) if (!__pyx_t_1) break; /* "pygame_sdl2/surface.pyx":454 * * while root.parent: * root = root.parent # <<<<<<<<<<<<<< * * if lock is None: */ __pyx_t_2 = ((PyObject *)__pyx_v_root->parent); __Pyx_INCREF(__pyx_t_2); __Pyx_DECREF_SET(__pyx_v_root, ((struct __pyx_obj_11pygame_sdl2_7surface_Surface *)__pyx_t_2)); __pyx_t_2 = 0; } /* "pygame_sdl2/surface.pyx":456 * root = root.parent * * if lock is None: # <<<<<<<<<<<<<< * lock = self * */ __pyx_t_1 = (__pyx_v_lock == Py_None); __pyx_t_3 = (__pyx_t_1 != 0); if (__pyx_t_3) { /* "pygame_sdl2/surface.pyx":457 * * if lock is None: * lock = self # <<<<<<<<<<<<<< * * if root.locklist is None: */ __Pyx_INCREF(((PyObject *)__pyx_v_self)); __Pyx_DECREF_SET(__pyx_v_lock, ((PyObject *)__pyx_v_self)); /* "pygame_sdl2/surface.pyx":456 * root = root.parent * * if lock is None: # <<<<<<<<<<<<<< * lock = self * */ } /* "pygame_sdl2/surface.pyx":459 * lock = self * * if root.locklist is None: # <<<<<<<<<<<<<< * root.locklist = [ ] * */ __pyx_t_3 = (__pyx_v_root->locklist == Py_None); __pyx_t_1 = (__pyx_t_3 != 0); if (__pyx_t_1) { /* "pygame_sdl2/surface.pyx":460 * * if root.locklist is None: * root.locklist = [ ] # <<<<<<<<<<<<<< * * root.locklist.append(lock) */ __pyx_t_2 = PyList_New(0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 460, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_GIVEREF(__pyx_t_2); __Pyx_GOTREF(__pyx_v_root->locklist); __Pyx_DECREF(__pyx_v_root->locklist); __pyx_v_root->locklist = __pyx_t_2; __pyx_t_2 = 0; /* "pygame_sdl2/surface.pyx":459 * lock = self * * if root.locklist is None: # <<<<<<<<<<<<<< * root.locklist = [ ] * */ } /* "pygame_sdl2/surface.pyx":462 * root.locklist = [ ] * * root.locklist.append(lock) # <<<<<<<<<<<<<< * * SDL_LockSurface(root.surface) */ __pyx_t_4 = __Pyx_PyObject_Append(__pyx_v_root->locklist, __pyx_v_lock); if (unlikely(__pyx_t_4 == -1)) __PYX_ERR(0, 462, __pyx_L1_error) /* "pygame_sdl2/surface.pyx":464 * root.locklist.append(lock) * * SDL_LockSurface(root.surface) # <<<<<<<<<<<<<< * * def unlock(self, lock=None): */ SDL_LockSurface(__pyx_v_root->surface); /* "pygame_sdl2/surface.pyx":450 * return None * * def lock(self, lock=None): # <<<<<<<<<<<<<< * cdef Surface root = self * */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_AddTraceback("pygame_sdl2.surface.Surface.lock", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF((PyObject *)__pyx_v_root); __Pyx_XDECREF(__pyx_v_lock); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/surface.pyx":466 * SDL_LockSurface(root.surface) * * def unlock(self, lock=None): # <<<<<<<<<<<<<< * cdef Surface root = self * */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_7surface_7Surface_33unlock(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static PyObject *__pyx_pw_11pygame_sdl2_7surface_7Surface_33unlock(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_lock = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("unlock (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_lock,0}; PyObject* values[1] = {0}; values[0] = ((PyObject *)Py_None); if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (kw_args > 0) { PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_lock); if (value) { values[0] = value; kw_args--; } } } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "unlock") < 0)) __PYX_ERR(0, 466, __pyx_L3_error) } } else { switch (PyTuple_GET_SIZE(__pyx_args)) { case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); case 0: break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_lock = values[0]; } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("unlock", 0, 0, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 466, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("pygame_sdl2.surface.Surface.unlock", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_11pygame_sdl2_7surface_7Surface_32unlock(((struct __pyx_obj_11pygame_sdl2_7surface_Surface *)__pyx_v_self), __pyx_v_lock); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_7surface_7Surface_32unlock(struct __pyx_obj_11pygame_sdl2_7surface_Surface *__pyx_v_self, PyObject *__pyx_v_lock) { struct __pyx_obj_11pygame_sdl2_7surface_Surface *__pyx_v_root = 0; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; PyObject *__pyx_t_2 = NULL; int __pyx_t_3; PyObject *__pyx_t_4 = NULL; PyObject *__pyx_t_5 = NULL; PyObject *__pyx_t_6 = NULL; __Pyx_RefNannySetupContext("unlock", 0); __Pyx_INCREF(__pyx_v_lock); /* "pygame_sdl2/surface.pyx":467 * * def unlock(self, lock=None): * cdef Surface root = self # <<<<<<<<<<<<<< * * while root.parent: */ __Pyx_INCREF(((PyObject *)__pyx_v_self)); __pyx_v_root = __pyx_v_self; /* "pygame_sdl2/surface.pyx":469 * cdef Surface root = self * * while root.parent: # <<<<<<<<<<<<<< * root = root.parent * */ while (1) { __pyx_t_1 = __Pyx_PyObject_IsTrue(((PyObject *)__pyx_v_root->parent)); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(0, 469, __pyx_L1_error) if (!__pyx_t_1) break; /* "pygame_sdl2/surface.pyx":470 * * while root.parent: * root = root.parent # <<<<<<<<<<<<<< * * if lock is None: */ __pyx_t_2 = ((PyObject *)__pyx_v_root->parent); __Pyx_INCREF(__pyx_t_2); __Pyx_DECREF_SET(__pyx_v_root, ((struct __pyx_obj_11pygame_sdl2_7surface_Surface *)__pyx_t_2)); __pyx_t_2 = 0; } /* "pygame_sdl2/surface.pyx":472 * root = root.parent * * if lock is None: # <<<<<<<<<<<<<< * lock = self * */ __pyx_t_1 = (__pyx_v_lock == Py_None); __pyx_t_3 = (__pyx_t_1 != 0); if (__pyx_t_3) { /* "pygame_sdl2/surface.pyx":473 * * if lock is None: * lock = self # <<<<<<<<<<<<<< * * if root.locklist is None: */ __Pyx_INCREF(((PyObject *)__pyx_v_self)); __Pyx_DECREF_SET(__pyx_v_lock, ((PyObject *)__pyx_v_self)); /* "pygame_sdl2/surface.pyx":472 * root = root.parent * * if lock is None: # <<<<<<<<<<<<<< * lock = self * */ } /* "pygame_sdl2/surface.pyx":475 * lock = self * * if root.locklist is None: # <<<<<<<<<<<<<< * root.locklist = [ ] * */ __pyx_t_3 = (__pyx_v_root->locklist == Py_None); __pyx_t_1 = (__pyx_t_3 != 0); if (__pyx_t_1) { /* "pygame_sdl2/surface.pyx":476 * * if root.locklist is None: * root.locklist = [ ] # <<<<<<<<<<<<<< * * root.locklist.remove(lock) */ __pyx_t_2 = PyList_New(0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 476, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_GIVEREF(__pyx_t_2); __Pyx_GOTREF(__pyx_v_root->locklist); __Pyx_DECREF(__pyx_v_root->locklist); __pyx_v_root->locklist = __pyx_t_2; __pyx_t_2 = 0; /* "pygame_sdl2/surface.pyx":475 * lock = self * * if root.locklist is None: # <<<<<<<<<<<<<< * root.locklist = [ ] * */ } /* "pygame_sdl2/surface.pyx":478 * root.locklist = [ ] * * root.locklist.remove(lock) # <<<<<<<<<<<<<< * * SDL_UnlockSurface(root.surface) */ __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_root->locklist, __pyx_n_s_remove); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 478, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_5 = NULL; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_4))) { __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4); if (likely(__pyx_t_5)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4); __Pyx_INCREF(__pyx_t_5); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_4, function); } } if (!__pyx_t_5) { __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_v_lock); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 478, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); } else { #if CYTHON_FAST_PYCALL if (PyFunction_Check(__pyx_t_4)) { PyObject *__pyx_temp[2] = {__pyx_t_5, __pyx_v_lock}; __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_4, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 478, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_GOTREF(__pyx_t_2); } else #endif #if CYTHON_FAST_PYCCALL if (__Pyx_PyFastCFunction_Check(__pyx_t_4)) { PyObject *__pyx_temp[2] = {__pyx_t_5, __pyx_v_lock}; __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_4, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 478, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_GOTREF(__pyx_t_2); } else #endif { __pyx_t_6 = PyTuple_New(1+1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 478, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_5); __pyx_t_5 = NULL; __Pyx_INCREF(__pyx_v_lock); __Pyx_GIVEREF(__pyx_v_lock); PyTuple_SET_ITEM(__pyx_t_6, 0+1, __pyx_v_lock); __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_6, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 478, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; } } __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "pygame_sdl2/surface.pyx":480 * root.locklist.remove(lock) * * SDL_UnlockSurface(root.surface) # <<<<<<<<<<<<<< * * def mustlock(self): */ SDL_UnlockSurface(__pyx_v_root->surface); /* "pygame_sdl2/surface.pyx":466 * SDL_LockSurface(root.surface) * * def unlock(self, lock=None): # <<<<<<<<<<<<<< * cdef Surface root = self * */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_5); __Pyx_XDECREF(__pyx_t_6); __Pyx_AddTraceback("pygame_sdl2.surface.Surface.unlock", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF((PyObject *)__pyx_v_root); __Pyx_XDECREF(__pyx_v_lock); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/surface.pyx":482 * SDL_UnlockSurface(root.surface) * * def mustlock(self): # <<<<<<<<<<<<<< * cdef Surface root = self * */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_7surface_7Surface_35mustlock(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/ static PyObject *__pyx_pw_11pygame_sdl2_7surface_7Surface_35mustlock(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("mustlock (wrapper)", 0); __pyx_r = __pyx_pf_11pygame_sdl2_7surface_7Surface_34mustlock(((struct __pyx_obj_11pygame_sdl2_7surface_Surface *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_7surface_7Surface_34mustlock(struct __pyx_obj_11pygame_sdl2_7surface_Surface *__pyx_v_self) { struct __pyx_obj_11pygame_sdl2_7surface_Surface *__pyx_v_root = 0; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; PyObject *__pyx_t_2 = NULL; __Pyx_RefNannySetupContext("mustlock", 0); /* "pygame_sdl2/surface.pyx":483 * * def mustlock(self): * cdef Surface root = self # <<<<<<<<<<<<<< * * while root.parent: */ __Pyx_INCREF(((PyObject *)__pyx_v_self)); __pyx_v_root = __pyx_v_self; /* "pygame_sdl2/surface.pyx":485 * cdef Surface root = self * * while root.parent: # <<<<<<<<<<<<<< * root = root.parent * */ while (1) { __pyx_t_1 = __Pyx_PyObject_IsTrue(((PyObject *)__pyx_v_root->parent)); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(0, 485, __pyx_L1_error) if (!__pyx_t_1) break; /* "pygame_sdl2/surface.pyx":486 * * while root.parent: * root = root.parent # <<<<<<<<<<<<<< * * return SDL_MUSTLOCK(root.surface) */ __pyx_t_2 = ((PyObject *)__pyx_v_root->parent); __Pyx_INCREF(__pyx_t_2); __Pyx_DECREF_SET(__pyx_v_root, ((struct __pyx_obj_11pygame_sdl2_7surface_Surface *)__pyx_t_2)); __pyx_t_2 = 0; } /* "pygame_sdl2/surface.pyx":488 * root = root.parent * * return SDL_MUSTLOCK(root.surface) # <<<<<<<<<<<<<< * * def get_locked(self): */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __Pyx_PyInt_From_int(SDL_MUSTLOCK(__pyx_v_root->surface)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 488, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; /* "pygame_sdl2/surface.pyx":482 * SDL_UnlockSurface(root.surface) * * def mustlock(self): # <<<<<<<<<<<<<< * cdef Surface root = self * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_AddTraceback("pygame_sdl2.surface.Surface.mustlock", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF((PyObject *)__pyx_v_root); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/surface.pyx":490 * return SDL_MUSTLOCK(root.surface) * * def get_locked(self): # <<<<<<<<<<<<<< * if self.locklist: * return True */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_7surface_7Surface_37get_locked(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/ static PyObject *__pyx_pw_11pygame_sdl2_7surface_7Surface_37get_locked(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("get_locked (wrapper)", 0); __pyx_r = __pyx_pf_11pygame_sdl2_7surface_7Surface_36get_locked(((struct __pyx_obj_11pygame_sdl2_7surface_Surface *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_7surface_7Surface_36get_locked(struct __pyx_obj_11pygame_sdl2_7surface_Surface *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; __Pyx_RefNannySetupContext("get_locked", 0); /* "pygame_sdl2/surface.pyx":491 * * def get_locked(self): * if self.locklist: # <<<<<<<<<<<<<< * return True * */ __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_self->locklist); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(0, 491, __pyx_L1_error) if (__pyx_t_1) { /* "pygame_sdl2/surface.pyx":492 * def get_locked(self): * if self.locklist: * return True # <<<<<<<<<<<<<< * * def get_locks(self): */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(Py_True); __pyx_r = Py_True; goto __pyx_L0; /* "pygame_sdl2/surface.pyx":491 * * def get_locked(self): * if self.locklist: # <<<<<<<<<<<<<< * return True * */ } /* "pygame_sdl2/surface.pyx":490 * return SDL_MUSTLOCK(root.surface) * * def get_locked(self): # <<<<<<<<<<<<<< * if self.locklist: * return True */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("pygame_sdl2.surface.Surface.get_locked", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/surface.pyx":494 * return True * * def get_locks(self): # <<<<<<<<<<<<<< * cdef Surface root = self * */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_7surface_7Surface_39get_locks(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/ static PyObject *__pyx_pw_11pygame_sdl2_7surface_7Surface_39get_locks(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("get_locks (wrapper)", 0); __pyx_r = __pyx_pf_11pygame_sdl2_7surface_7Surface_38get_locks(((struct __pyx_obj_11pygame_sdl2_7surface_Surface *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_7surface_7Surface_38get_locks(struct __pyx_obj_11pygame_sdl2_7surface_Surface *__pyx_v_self) { struct __pyx_obj_11pygame_sdl2_7surface_Surface *__pyx_v_root = 0; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; PyObject *__pyx_t_2 = NULL; int __pyx_t_3; __Pyx_RefNannySetupContext("get_locks", 0); /* "pygame_sdl2/surface.pyx":495 * * def get_locks(self): * cdef Surface root = self # <<<<<<<<<<<<<< * * while root.parent: */ __Pyx_INCREF(((PyObject *)__pyx_v_self)); __pyx_v_root = __pyx_v_self; /* "pygame_sdl2/surface.pyx":497 * cdef Surface root = self * * while root.parent: # <<<<<<<<<<<<<< * root = root.parent * */ while (1) { __pyx_t_1 = __Pyx_PyObject_IsTrue(((PyObject *)__pyx_v_root->parent)); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(0, 497, __pyx_L1_error) if (!__pyx_t_1) break; /* "pygame_sdl2/surface.pyx":498 * * while root.parent: * root = root.parent # <<<<<<<<<<<<<< * * if root.locklist is None: */ __pyx_t_2 = ((PyObject *)__pyx_v_root->parent); __Pyx_INCREF(__pyx_t_2); __Pyx_DECREF_SET(__pyx_v_root, ((struct __pyx_obj_11pygame_sdl2_7surface_Surface *)__pyx_t_2)); __pyx_t_2 = 0; } /* "pygame_sdl2/surface.pyx":500 * root = root.parent * * if root.locklist is None: # <<<<<<<<<<<<<< * root.locklist = [ ] * */ __pyx_t_1 = (__pyx_v_root->locklist == Py_None); __pyx_t_3 = (__pyx_t_1 != 0); if (__pyx_t_3) { /* "pygame_sdl2/surface.pyx":501 * * if root.locklist is None: * root.locklist = [ ] # <<<<<<<<<<<<<< * * return root.locklist */ __pyx_t_2 = PyList_New(0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 501, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_GIVEREF(__pyx_t_2); __Pyx_GOTREF(__pyx_v_root->locklist); __Pyx_DECREF(__pyx_v_root->locklist); __pyx_v_root->locklist = __pyx_t_2; __pyx_t_2 = 0; /* "pygame_sdl2/surface.pyx":500 * root = root.parent * * if root.locklist is None: # <<<<<<<<<<<<<< * root.locklist = [ ] * */ } /* "pygame_sdl2/surface.pyx":503 * root.locklist = [ ] * * return root.locklist # <<<<<<<<<<<<<< * * def get_at(self, pos): */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(__pyx_v_root->locklist); __pyx_r = __pyx_v_root->locklist; goto __pyx_L0; /* "pygame_sdl2/surface.pyx":494 * return True * * def get_locks(self): # <<<<<<<<<<<<<< * cdef Surface root = self * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_AddTraceback("pygame_sdl2.surface.Surface.get_locks", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF((PyObject *)__pyx_v_root); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/surface.pyx":505 * return root.locklist * * def get_at(self, pos): # <<<<<<<<<<<<<< * cdef int x, y * cdef Uint8 *p */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_7surface_7Surface_41get_at(PyObject *__pyx_v_self, PyObject *__pyx_v_pos); /*proto*/ static PyObject *__pyx_pw_11pygame_sdl2_7surface_7Surface_41get_at(PyObject *__pyx_v_self, PyObject *__pyx_v_pos) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("get_at (wrapper)", 0); __pyx_r = __pyx_pf_11pygame_sdl2_7surface_7Surface_40get_at(((struct __pyx_obj_11pygame_sdl2_7surface_Surface *)__pyx_v_self), ((PyObject *)__pyx_v_pos)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_7surface_7Surface_40get_at(struct __pyx_obj_11pygame_sdl2_7surface_Surface *__pyx_v_self, PyObject *__pyx_v_pos) { int __pyx_v_x; int __pyx_v_y; Uint8 *__pyx_v_p; Uint32 __pyx_v_pixel; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; PyObject *(*__pyx_t_4)(PyObject *); int __pyx_t_5; int __pyx_t_6; int __pyx_t_7; int __pyx_t_8; int __pyx_t_9; __Pyx_RefNannySetupContext("get_at", 0); /* "pygame_sdl2/surface.pyx":509 * cdef Uint8 *p * * x, y = pos # <<<<<<<<<<<<<< * * if not (0 <= x < self.surface.w) or not (0 <= y < self.surface.h): */ if ((likely(PyTuple_CheckExact(__pyx_v_pos))) || (PyList_CheckExact(__pyx_v_pos))) { PyObject* sequence = __pyx_v_pos; #if !CYTHON_COMPILING_IN_PYPY Py_ssize_t size = Py_SIZE(sequence); #else Py_ssize_t size = PySequence_Size(sequence); #endif if (unlikely(size != 2)) { if (size > 2) __Pyx_RaiseTooManyValuesError(2); else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); __PYX_ERR(0, 509, __pyx_L1_error) } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS if (likely(PyTuple_CheckExact(sequence))) { __pyx_t_1 = PyTuple_GET_ITEM(sequence, 0); __pyx_t_2 = PyTuple_GET_ITEM(sequence, 1); } else { __pyx_t_1 = PyList_GET_ITEM(sequence, 0); __pyx_t_2 = PyList_GET_ITEM(sequence, 1); } __Pyx_INCREF(__pyx_t_1); __Pyx_INCREF(__pyx_t_2); #else __pyx_t_1 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 509, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 509, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); #endif } else { Py_ssize_t index = -1; __pyx_t_3 = PyObject_GetIter(__pyx_v_pos); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 509, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = Py_TYPE(__pyx_t_3)->tp_iternext; index = 0; __pyx_t_1 = __pyx_t_4(__pyx_t_3); if (unlikely(!__pyx_t_1)) goto __pyx_L3_unpacking_failed; __Pyx_GOTREF(__pyx_t_1); index = 1; __pyx_t_2 = __pyx_t_4(__pyx_t_3); if (unlikely(!__pyx_t_2)) goto __pyx_L3_unpacking_failed; __Pyx_GOTREF(__pyx_t_2); if (__Pyx_IternextUnpackEndCheck(__pyx_t_4(__pyx_t_3), 2) < 0) __PYX_ERR(0, 509, __pyx_L1_error) __pyx_t_4 = NULL; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; goto __pyx_L4_unpacking_done; __pyx_L3_unpacking_failed:; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_4 = NULL; if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); __PYX_ERR(0, 509, __pyx_L1_error) __pyx_L4_unpacking_done:; } __pyx_t_5 = __Pyx_PyInt_As_int(__pyx_t_1); if (unlikely((__pyx_t_5 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 509, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_6 = __Pyx_PyInt_As_int(__pyx_t_2); if (unlikely((__pyx_t_6 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 509, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_v_x = __pyx_t_5; __pyx_v_y = __pyx_t_6; /* "pygame_sdl2/surface.pyx":511 * x, y = pos * * if not (0 <= x < self.surface.w) or not (0 <= y < self.surface.h): # <<<<<<<<<<<<<< * raise IndexError("Position outside surface.") * */ __pyx_t_8 = (0 <= __pyx_v_x); if (__pyx_t_8) { __pyx_t_8 = (__pyx_v_x < __pyx_v_self->surface->w); } __pyx_t_9 = ((!(__pyx_t_8 != 0)) != 0); if (!__pyx_t_9) { } else { __pyx_t_7 = __pyx_t_9; goto __pyx_L6_bool_binop_done; } __pyx_t_9 = (0 <= __pyx_v_y); if (__pyx_t_9) { __pyx_t_9 = (__pyx_v_y < __pyx_v_self->surface->h); } __pyx_t_8 = ((!(__pyx_t_9 != 0)) != 0); __pyx_t_7 = __pyx_t_8; __pyx_L6_bool_binop_done:; if (__pyx_t_7) { /* "pygame_sdl2/surface.pyx":512 * * if not (0 <= x < self.surface.w) or not (0 <= y < self.surface.h): * raise IndexError("Position outside surface.") # <<<<<<<<<<<<<< * * if self.surface.format.BytesPerPixel != 4: */ __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_IndexError, __pyx_tuple__7, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 512, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_Raise(__pyx_t_2, 0, 0, 0); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __PYX_ERR(0, 512, __pyx_L1_error) /* "pygame_sdl2/surface.pyx":511 * x, y = pos * * if not (0 <= x < self.surface.w) or not (0 <= y < self.surface.h): # <<<<<<<<<<<<<< * raise IndexError("Position outside surface.") * */ } /* "pygame_sdl2/surface.pyx":514 * raise IndexError("Position outside surface.") * * if self.surface.format.BytesPerPixel != 4: # <<<<<<<<<<<<<< * raise error("Surface has unsupported bytesize.") * */ __pyx_t_7 = ((__pyx_v_self->surface->format->BytesPerPixel != 4) != 0); if (__pyx_t_7) { /* "pygame_sdl2/surface.pyx":515 * * if self.surface.format.BytesPerPixel != 4: * raise error("Surface has unsupported bytesize.") # <<<<<<<<<<<<<< * * self.lock() */ __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_error); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 515, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_tuple__8, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 515, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_Raise(__pyx_t_1, 0, 0, 0); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __PYX_ERR(0, 515, __pyx_L1_error) /* "pygame_sdl2/surface.pyx":514 * raise IndexError("Position outside surface.") * * if self.surface.format.BytesPerPixel != 4: # <<<<<<<<<<<<<< * raise error("Surface has unsupported bytesize.") * */ } /* "pygame_sdl2/surface.pyx":517 * raise error("Surface has unsupported bytesize.") * * self.lock() # <<<<<<<<<<<<<< * * p = self.surface.pixels */ __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_lock); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 517, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = NULL; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); if (likely(__pyx_t_3)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); } } if (__pyx_t_3) { __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 517, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } else { __pyx_t_1 = __Pyx_PyObject_CallNoArg(__pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 517, __pyx_L1_error) } __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "pygame_sdl2/surface.pyx":519 * self.lock() * * p = self.surface.pixels # <<<<<<<<<<<<<< * p += y * self.surface.pitch * p += x * 4 */ __pyx_v_p = ((Uint8 *)__pyx_v_self->surface->pixels); /* "pygame_sdl2/surface.pyx":520 * * p = self.surface.pixels * p += y * self.surface.pitch # <<<<<<<<<<<<<< * p += x * 4 * */ __pyx_v_p = (__pyx_v_p + (__pyx_v_y * __pyx_v_self->surface->pitch)); /* "pygame_sdl2/surface.pyx":521 * p = self.surface.pixels * p += y * self.surface.pitch * p += x * 4 # <<<<<<<<<<<<<< * * cdef Uint32 pixel = ( p)[0] */ __pyx_v_p = (__pyx_v_p + (__pyx_v_x * 4)); /* "pygame_sdl2/surface.pyx":523 * p += x * 4 * * cdef Uint32 pixel = ( p)[0] # <<<<<<<<<<<<<< * * self.unlock() */ __pyx_v_pixel = (((Uint32 *)__pyx_v_p)[0]); /* "pygame_sdl2/surface.pyx":525 * cdef Uint32 pixel = ( p)[0] * * self.unlock() # <<<<<<<<<<<<<< * * return get_color(pixel, self.surface) */ __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_unlock); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 525, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = NULL; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); if (likely(__pyx_t_3)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); } } if (__pyx_t_3) { __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 525, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } else { __pyx_t_1 = __Pyx_PyObject_CallNoArg(__pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 525, __pyx_L1_error) } __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "pygame_sdl2/surface.pyx":527 * self.unlock() * * return get_color(pixel, self.surface) # <<<<<<<<<<<<<< * * def set_at(self, pos, color): */ __Pyx_XDECREF(__pyx_r); __pyx_t_1 = __pyx_f_11pygame_sdl2_5color_get_color(__pyx_v_pixel, __pyx_v_self->surface); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 527, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "pygame_sdl2/surface.pyx":505 * return root.locklist * * def get_at(self, pos): # <<<<<<<<<<<<<< * cdef int x, y * cdef Uint8 *p */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("pygame_sdl2.surface.Surface.get_at", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/surface.pyx":529 * return get_color(pixel, self.surface) * * def set_at(self, pos, color): # <<<<<<<<<<<<<< * cdef int x, y * cdef Uint8 *p */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_7surface_7Surface_43set_at(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static PyObject *__pyx_pw_11pygame_sdl2_7surface_7Surface_43set_at(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_pos = 0; PyObject *__pyx_v_color = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("set_at (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_pos,&__pyx_n_s_color,0}; PyObject* values[2] = {0,0}; if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_pos)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; case 1: if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_color)) != 0)) kw_args--; else { __Pyx_RaiseArgtupleInvalid("set_at", 1, 2, 2, 1); __PYX_ERR(0, 529, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "set_at") < 0)) __PYX_ERR(0, 529, __pyx_L3_error) } } else if (PyTuple_GET_SIZE(__pyx_args) != 2) { goto __pyx_L5_argtuple_error; } else { values[0] = PyTuple_GET_ITEM(__pyx_args, 0); values[1] = PyTuple_GET_ITEM(__pyx_args, 1); } __pyx_v_pos = values[0]; __pyx_v_color = values[1]; } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("set_at", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 529, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("pygame_sdl2.surface.Surface.set_at", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_11pygame_sdl2_7surface_7Surface_42set_at(((struct __pyx_obj_11pygame_sdl2_7surface_Surface *)__pyx_v_self), __pyx_v_pos, __pyx_v_color); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_7surface_7Surface_42set_at(struct __pyx_obj_11pygame_sdl2_7surface_Surface *__pyx_v_self, PyObject *__pyx_v_pos, PyObject *__pyx_v_color) { int __pyx_v_x; int __pyx_v_y; Uint8 *__pyx_v_p; Uint32 __pyx_v_pixel; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; PyObject *(*__pyx_t_4)(PyObject *); int __pyx_t_5; int __pyx_t_6; int __pyx_t_7; int __pyx_t_8; int __pyx_t_9; Uint32 __pyx_t_10; __Pyx_RefNannySetupContext("set_at", 0); /* "pygame_sdl2/surface.pyx":534 * cdef Uint32 pixel * * x, y = pos # <<<<<<<<<<<<<< * * if not (0 <= x < self.surface.w) or not (0 <= y < self.surface.h): */ if ((likely(PyTuple_CheckExact(__pyx_v_pos))) || (PyList_CheckExact(__pyx_v_pos))) { PyObject* sequence = __pyx_v_pos; #if !CYTHON_COMPILING_IN_PYPY Py_ssize_t size = Py_SIZE(sequence); #else Py_ssize_t size = PySequence_Size(sequence); #endif if (unlikely(size != 2)) { if (size > 2) __Pyx_RaiseTooManyValuesError(2); else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); __PYX_ERR(0, 534, __pyx_L1_error) } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS if (likely(PyTuple_CheckExact(sequence))) { __pyx_t_1 = PyTuple_GET_ITEM(sequence, 0); __pyx_t_2 = PyTuple_GET_ITEM(sequence, 1); } else { __pyx_t_1 = PyList_GET_ITEM(sequence, 0); __pyx_t_2 = PyList_GET_ITEM(sequence, 1); } __Pyx_INCREF(__pyx_t_1); __Pyx_INCREF(__pyx_t_2); #else __pyx_t_1 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 534, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 534, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); #endif } else { Py_ssize_t index = -1; __pyx_t_3 = PyObject_GetIter(__pyx_v_pos); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 534, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = Py_TYPE(__pyx_t_3)->tp_iternext; index = 0; __pyx_t_1 = __pyx_t_4(__pyx_t_3); if (unlikely(!__pyx_t_1)) goto __pyx_L3_unpacking_failed; __Pyx_GOTREF(__pyx_t_1); index = 1; __pyx_t_2 = __pyx_t_4(__pyx_t_3); if (unlikely(!__pyx_t_2)) goto __pyx_L3_unpacking_failed; __Pyx_GOTREF(__pyx_t_2); if (__Pyx_IternextUnpackEndCheck(__pyx_t_4(__pyx_t_3), 2) < 0) __PYX_ERR(0, 534, __pyx_L1_error) __pyx_t_4 = NULL; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; goto __pyx_L4_unpacking_done; __pyx_L3_unpacking_failed:; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_4 = NULL; if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); __PYX_ERR(0, 534, __pyx_L1_error) __pyx_L4_unpacking_done:; } __pyx_t_5 = __Pyx_PyInt_As_int(__pyx_t_1); if (unlikely((__pyx_t_5 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 534, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_6 = __Pyx_PyInt_As_int(__pyx_t_2); if (unlikely((__pyx_t_6 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 534, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_v_x = __pyx_t_5; __pyx_v_y = __pyx_t_6; /* "pygame_sdl2/surface.pyx":536 * x, y = pos * * if not (0 <= x < self.surface.w) or not (0 <= y < self.surface.h): # <<<<<<<<<<<<<< * raise ValueError("Position outside surface.") * */ __pyx_t_8 = (0 <= __pyx_v_x); if (__pyx_t_8) { __pyx_t_8 = (__pyx_v_x < __pyx_v_self->surface->w); } __pyx_t_9 = ((!(__pyx_t_8 != 0)) != 0); if (!__pyx_t_9) { } else { __pyx_t_7 = __pyx_t_9; goto __pyx_L6_bool_binop_done; } __pyx_t_9 = (0 <= __pyx_v_y); if (__pyx_t_9) { __pyx_t_9 = (__pyx_v_y < __pyx_v_self->surface->h); } __pyx_t_8 = ((!(__pyx_t_9 != 0)) != 0); __pyx_t_7 = __pyx_t_8; __pyx_L6_bool_binop_done:; if (__pyx_t_7) { /* "pygame_sdl2/surface.pyx":537 * * if not (0 <= x < self.surface.w) or not (0 <= y < self.surface.h): * raise ValueError("Position outside surface.") # <<<<<<<<<<<<<< * * if self.surface.format.BytesPerPixel != 4: */ __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__9, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 537, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_Raise(__pyx_t_2, 0, 0, 0); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __PYX_ERR(0, 537, __pyx_L1_error) /* "pygame_sdl2/surface.pyx":536 * x, y = pos * * if not (0 <= x < self.surface.w) or not (0 <= y < self.surface.h): # <<<<<<<<<<<<<< * raise ValueError("Position outside surface.") * */ } /* "pygame_sdl2/surface.pyx":539 * raise ValueError("Position outside surface.") * * if self.surface.format.BytesPerPixel != 4: # <<<<<<<<<<<<<< * raise error("Surface has unsupported bytesize.") * */ __pyx_t_7 = ((__pyx_v_self->surface->format->BytesPerPixel != 4) != 0); if (__pyx_t_7) { /* "pygame_sdl2/surface.pyx":540 * * if self.surface.format.BytesPerPixel != 4: * raise error("Surface has unsupported bytesize.") # <<<<<<<<<<<<<< * * pixel = map_color(self.surface, color) */ __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_error); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 540, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_tuple__10, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 540, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_Raise(__pyx_t_1, 0, 0, 0); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __PYX_ERR(0, 540, __pyx_L1_error) /* "pygame_sdl2/surface.pyx":539 * raise ValueError("Position outside surface.") * * if self.surface.format.BytesPerPixel != 4: # <<<<<<<<<<<<<< * raise error("Surface has unsupported bytesize.") * */ } /* "pygame_sdl2/surface.pyx":542 * raise error("Surface has unsupported bytesize.") * * pixel = map_color(self.surface, color) # <<<<<<<<<<<<<< * * self.lock() */ __pyx_t_10 = __pyx_f_11pygame_sdl2_5color_map_color(__pyx_v_self->surface, __pyx_v_color); if (unlikely(__pyx_t_10 == 0xaabbccdd && PyErr_Occurred())) __PYX_ERR(0, 542, __pyx_L1_error) __pyx_v_pixel = __pyx_t_10; /* "pygame_sdl2/surface.pyx":544 * pixel = map_color(self.surface, color) * * self.lock() # <<<<<<<<<<<<<< * * p = self.surface.pixels */ __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_lock); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 544, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = NULL; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); if (likely(__pyx_t_3)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); } } if (__pyx_t_3) { __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 544, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } else { __pyx_t_1 = __Pyx_PyObject_CallNoArg(__pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 544, __pyx_L1_error) } __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "pygame_sdl2/surface.pyx":546 * self.lock() * * p = self.surface.pixels # <<<<<<<<<<<<<< * p += y * self.surface.pitch * p += x * 4 */ __pyx_v_p = ((Uint8 *)__pyx_v_self->surface->pixels); /* "pygame_sdl2/surface.pyx":547 * * p = self.surface.pixels * p += y * self.surface.pitch # <<<<<<<<<<<<<< * p += x * 4 * */ __pyx_v_p = (__pyx_v_p + (__pyx_v_y * __pyx_v_self->surface->pitch)); /* "pygame_sdl2/surface.pyx":548 * p = self.surface.pixels * p += y * self.surface.pitch * p += x * 4 # <<<<<<<<<<<<<< * * ( p)[0] = pixel */ __pyx_v_p = (__pyx_v_p + (__pyx_v_x * 4)); /* "pygame_sdl2/surface.pyx":550 * p += x * 4 * * ( p)[0] = pixel # <<<<<<<<<<<<<< * * self.unlock() */ (((Uint32 *)__pyx_v_p)[0]) = __pyx_v_pixel; /* "pygame_sdl2/surface.pyx":552 * ( p)[0] = pixel * * self.unlock() # <<<<<<<<<<<<<< * * def get_at_mapped(self, pos): */ __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_unlock); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 552, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = NULL; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); if (likely(__pyx_t_3)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); } } if (__pyx_t_3) { __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 552, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } else { __pyx_t_1 = __Pyx_PyObject_CallNoArg(__pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 552, __pyx_L1_error) } __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "pygame_sdl2/surface.pyx":529 * return get_color(pixel, self.surface) * * def set_at(self, pos, color): # <<<<<<<<<<<<<< * cdef int x, y * cdef Uint8 *p */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("pygame_sdl2.surface.Surface.set_at", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/surface.pyx":554 * self.unlock() * * def get_at_mapped(self, pos): # <<<<<<<<<<<<<< * cdef int x, y * cdef Uint8 *p */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_7surface_7Surface_45get_at_mapped(PyObject *__pyx_v_self, PyObject *__pyx_v_pos); /*proto*/ static PyObject *__pyx_pw_11pygame_sdl2_7surface_7Surface_45get_at_mapped(PyObject *__pyx_v_self, PyObject *__pyx_v_pos) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("get_at_mapped (wrapper)", 0); __pyx_r = __pyx_pf_11pygame_sdl2_7surface_7Surface_44get_at_mapped(((struct __pyx_obj_11pygame_sdl2_7surface_Surface *)__pyx_v_self), ((PyObject *)__pyx_v_pos)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_7surface_7Surface_44get_at_mapped(struct __pyx_obj_11pygame_sdl2_7surface_Surface *__pyx_v_self, PyObject *__pyx_v_pos) { int __pyx_v_x; int __pyx_v_y; Uint8 *__pyx_v_p; Uint32 __pyx_v_pixel; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; PyObject *(*__pyx_t_4)(PyObject *); int __pyx_t_5; int __pyx_t_6; int __pyx_t_7; int __pyx_t_8; int __pyx_t_9; __Pyx_RefNannySetupContext("get_at_mapped", 0); /* "pygame_sdl2/surface.pyx":558 * cdef Uint8 *p * * x, y = pos # <<<<<<<<<<<<<< * * if not (0 <= x < self.surface.w) or not (0 <= y < self.surface.h): */ if ((likely(PyTuple_CheckExact(__pyx_v_pos))) || (PyList_CheckExact(__pyx_v_pos))) { PyObject* sequence = __pyx_v_pos; #if !CYTHON_COMPILING_IN_PYPY Py_ssize_t size = Py_SIZE(sequence); #else Py_ssize_t size = PySequence_Size(sequence); #endif if (unlikely(size != 2)) { if (size > 2) __Pyx_RaiseTooManyValuesError(2); else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); __PYX_ERR(0, 558, __pyx_L1_error) } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS if (likely(PyTuple_CheckExact(sequence))) { __pyx_t_1 = PyTuple_GET_ITEM(sequence, 0); __pyx_t_2 = PyTuple_GET_ITEM(sequence, 1); } else { __pyx_t_1 = PyList_GET_ITEM(sequence, 0); __pyx_t_2 = PyList_GET_ITEM(sequence, 1); } __Pyx_INCREF(__pyx_t_1); __Pyx_INCREF(__pyx_t_2); #else __pyx_t_1 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 558, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 558, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); #endif } else { Py_ssize_t index = -1; __pyx_t_3 = PyObject_GetIter(__pyx_v_pos); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 558, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = Py_TYPE(__pyx_t_3)->tp_iternext; index = 0; __pyx_t_1 = __pyx_t_4(__pyx_t_3); if (unlikely(!__pyx_t_1)) goto __pyx_L3_unpacking_failed; __Pyx_GOTREF(__pyx_t_1); index = 1; __pyx_t_2 = __pyx_t_4(__pyx_t_3); if (unlikely(!__pyx_t_2)) goto __pyx_L3_unpacking_failed; __Pyx_GOTREF(__pyx_t_2); if (__Pyx_IternextUnpackEndCheck(__pyx_t_4(__pyx_t_3), 2) < 0) __PYX_ERR(0, 558, __pyx_L1_error) __pyx_t_4 = NULL; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; goto __pyx_L4_unpacking_done; __pyx_L3_unpacking_failed:; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_4 = NULL; if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); __PYX_ERR(0, 558, __pyx_L1_error) __pyx_L4_unpacking_done:; } __pyx_t_5 = __Pyx_PyInt_As_int(__pyx_t_1); if (unlikely((__pyx_t_5 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 558, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_6 = __Pyx_PyInt_As_int(__pyx_t_2); if (unlikely((__pyx_t_6 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 558, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_v_x = __pyx_t_5; __pyx_v_y = __pyx_t_6; /* "pygame_sdl2/surface.pyx":560 * x, y = pos * * if not (0 <= x < self.surface.w) or not (0 <= y < self.surface.h): # <<<<<<<<<<<<<< * raise ValueError("Position outside surface.") * */ __pyx_t_8 = (0 <= __pyx_v_x); if (__pyx_t_8) { __pyx_t_8 = (__pyx_v_x < __pyx_v_self->surface->w); } __pyx_t_9 = ((!(__pyx_t_8 != 0)) != 0); if (!__pyx_t_9) { } else { __pyx_t_7 = __pyx_t_9; goto __pyx_L6_bool_binop_done; } __pyx_t_9 = (0 <= __pyx_v_y); if (__pyx_t_9) { __pyx_t_9 = (__pyx_v_y < __pyx_v_self->surface->h); } __pyx_t_8 = ((!(__pyx_t_9 != 0)) != 0); __pyx_t_7 = __pyx_t_8; __pyx_L6_bool_binop_done:; if (__pyx_t_7) { /* "pygame_sdl2/surface.pyx":561 * * if not (0 <= x < self.surface.w) or not (0 <= y < self.surface.h): * raise ValueError("Position outside surface.") # <<<<<<<<<<<<<< * * if self.surface.format.BytesPerPixel != 4: */ __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__11, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 561, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_Raise(__pyx_t_2, 0, 0, 0); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __PYX_ERR(0, 561, __pyx_L1_error) /* "pygame_sdl2/surface.pyx":560 * x, y = pos * * if not (0 <= x < self.surface.w) or not (0 <= y < self.surface.h): # <<<<<<<<<<<<<< * raise ValueError("Position outside surface.") * */ } /* "pygame_sdl2/surface.pyx":563 * raise ValueError("Position outside surface.") * * if self.surface.format.BytesPerPixel != 4: # <<<<<<<<<<<<<< * raise error("Surface has unsupported bytesize.") * */ __pyx_t_7 = ((__pyx_v_self->surface->format->BytesPerPixel != 4) != 0); if (__pyx_t_7) { /* "pygame_sdl2/surface.pyx":564 * * if self.surface.format.BytesPerPixel != 4: * raise error("Surface has unsupported bytesize.") # <<<<<<<<<<<<<< * * self.lock() */ __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_error); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 564, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_tuple__12, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 564, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_Raise(__pyx_t_1, 0, 0, 0); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __PYX_ERR(0, 564, __pyx_L1_error) /* "pygame_sdl2/surface.pyx":563 * raise ValueError("Position outside surface.") * * if self.surface.format.BytesPerPixel != 4: # <<<<<<<<<<<<<< * raise error("Surface has unsupported bytesize.") * */ } /* "pygame_sdl2/surface.pyx":566 * raise error("Surface has unsupported bytesize.") * * self.lock() # <<<<<<<<<<<<<< * * p = self.surface.pixels */ __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_lock); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 566, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = NULL; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); if (likely(__pyx_t_3)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); } } if (__pyx_t_3) { __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 566, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } else { __pyx_t_1 = __Pyx_PyObject_CallNoArg(__pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 566, __pyx_L1_error) } __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "pygame_sdl2/surface.pyx":568 * self.lock() * * p = self.surface.pixels # <<<<<<<<<<<<<< * p += y * self.surface.pitch * p += x * 4 */ __pyx_v_p = ((Uint8 *)__pyx_v_self->surface->pixels); /* "pygame_sdl2/surface.pyx":569 * * p = self.surface.pixels * p += y * self.surface.pitch # <<<<<<<<<<<<<< * p += x * 4 * */ __pyx_v_p = (__pyx_v_p + (__pyx_v_y * __pyx_v_self->surface->pitch)); /* "pygame_sdl2/surface.pyx":570 * p = self.surface.pixels * p += y * self.surface.pitch * p += x * 4 # <<<<<<<<<<<<<< * * cdef Uint32 pixel = ( p)[0] */ __pyx_v_p = (__pyx_v_p + (__pyx_v_x * 4)); /* "pygame_sdl2/surface.pyx":572 * p += x * 4 * * cdef Uint32 pixel = ( p)[0] # <<<<<<<<<<<<<< * * self.unlock() */ __pyx_v_pixel = (((Uint32 *)__pyx_v_p)[0]); /* "pygame_sdl2/surface.pyx":574 * cdef Uint32 pixel = ( p)[0] * * self.unlock() # <<<<<<<<<<<<<< * * return pixel */ __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_unlock); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 574, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = NULL; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); if (likely(__pyx_t_3)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); } } if (__pyx_t_3) { __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 574, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } else { __pyx_t_1 = __Pyx_PyObject_CallNoArg(__pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 574, __pyx_L1_error) } __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "pygame_sdl2/surface.pyx":576 * self.unlock() * * return pixel # <<<<<<<<<<<<<< * * def map_rgb(self, color): */ __Pyx_XDECREF(__pyx_r); __pyx_t_1 = __Pyx_PyInt_From_uint32_t(__pyx_v_pixel); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 576, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "pygame_sdl2/surface.pyx":554 * self.unlock() * * def get_at_mapped(self, pos): # <<<<<<<<<<<<<< * cdef int x, y * cdef Uint8 *p */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("pygame_sdl2.surface.Surface.get_at_mapped", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/surface.pyx":578 * return pixel * * def map_rgb(self, color): # <<<<<<<<<<<<<< * return map_color(self.surface, color) * */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_7surface_7Surface_47map_rgb(PyObject *__pyx_v_self, PyObject *__pyx_v_color); /*proto*/ static PyObject *__pyx_pw_11pygame_sdl2_7surface_7Surface_47map_rgb(PyObject *__pyx_v_self, PyObject *__pyx_v_color) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("map_rgb (wrapper)", 0); __pyx_r = __pyx_pf_11pygame_sdl2_7surface_7Surface_46map_rgb(((struct __pyx_obj_11pygame_sdl2_7surface_Surface *)__pyx_v_self), ((PyObject *)__pyx_v_color)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_7surface_7Surface_46map_rgb(struct __pyx_obj_11pygame_sdl2_7surface_Surface *__pyx_v_self, PyObject *__pyx_v_color) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations Uint32 __pyx_t_1; PyObject *__pyx_t_2 = NULL; __Pyx_RefNannySetupContext("map_rgb", 0); /* "pygame_sdl2/surface.pyx":579 * * def map_rgb(self, color): * return map_color(self.surface, color) # <<<<<<<<<<<<<< * * def unmap_rgb(self, pixel): */ __Pyx_XDECREF(__pyx_r); __pyx_t_1 = __pyx_f_11pygame_sdl2_5color_map_color(__pyx_v_self->surface, __pyx_v_color); if (unlikely(__pyx_t_1 == 0xaabbccdd && PyErr_Occurred())) __PYX_ERR(0, 579, __pyx_L1_error) __pyx_t_2 = __Pyx_PyInt_From_uint32_t(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 579, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; /* "pygame_sdl2/surface.pyx":578 * return pixel * * def map_rgb(self, color): # <<<<<<<<<<<<<< * return map_color(self.surface, color) * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_AddTraceback("pygame_sdl2.surface.Surface.map_rgb", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/surface.pyx":581 * return map_color(self.surface, color) * * def unmap_rgb(self, pixel): # <<<<<<<<<<<<<< * return get_color(pixel, self.surface) * */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_7surface_7Surface_49unmap_rgb(PyObject *__pyx_v_self, PyObject *__pyx_v_pixel); /*proto*/ static PyObject *__pyx_pw_11pygame_sdl2_7surface_7Surface_49unmap_rgb(PyObject *__pyx_v_self, PyObject *__pyx_v_pixel) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("unmap_rgb (wrapper)", 0); __pyx_r = __pyx_pf_11pygame_sdl2_7surface_7Surface_48unmap_rgb(((struct __pyx_obj_11pygame_sdl2_7surface_Surface *)__pyx_v_self), ((PyObject *)__pyx_v_pixel)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_7surface_7Surface_48unmap_rgb(struct __pyx_obj_11pygame_sdl2_7surface_Surface *__pyx_v_self, PyObject *__pyx_v_pixel) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations Uint32 __pyx_t_1; PyObject *__pyx_t_2 = NULL; __Pyx_RefNannySetupContext("unmap_rgb", 0); /* "pygame_sdl2/surface.pyx":582 * * def unmap_rgb(self, pixel): * return get_color(pixel, self.surface) # <<<<<<<<<<<<<< * * def set_clip(self, rect): */ __Pyx_XDECREF(__pyx_r); __pyx_t_1 = __Pyx_PyInt_As_uint32_t(__pyx_v_pixel); if (unlikely((__pyx_t_1 == ((Uint32)-1)) && PyErr_Occurred())) __PYX_ERR(0, 582, __pyx_L1_error) __pyx_t_2 = __pyx_f_11pygame_sdl2_5color_get_color(__pyx_t_1, __pyx_v_self->surface); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 582, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; /* "pygame_sdl2/surface.pyx":581 * return map_color(self.surface, color) * * def unmap_rgb(self, pixel): # <<<<<<<<<<<<<< * return get_color(pixel, self.surface) * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_AddTraceback("pygame_sdl2.surface.Surface.unmap_rgb", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/surface.pyx":584 * return get_color(pixel, self.surface) * * def set_clip(self, rect): # <<<<<<<<<<<<<< * cdef SDL_Rect sdl_rect * */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_7surface_7Surface_51set_clip(PyObject *__pyx_v_self, PyObject *__pyx_v_rect); /*proto*/ static PyObject *__pyx_pw_11pygame_sdl2_7surface_7Surface_51set_clip(PyObject *__pyx_v_self, PyObject *__pyx_v_rect) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("set_clip (wrapper)", 0); __pyx_r = __pyx_pf_11pygame_sdl2_7surface_7Surface_50set_clip(((struct __pyx_obj_11pygame_sdl2_7surface_Surface *)__pyx_v_self), ((PyObject *)__pyx_v_rect)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_7surface_7Surface_50set_clip(struct __pyx_obj_11pygame_sdl2_7surface_Surface *__pyx_v_self, PyObject *__pyx_v_rect) { SDL_Rect __pyx_v_sdl_rect; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; int __pyx_t_2; int __pyx_t_3; __Pyx_RefNannySetupContext("set_clip", 0); /* "pygame_sdl2/surface.pyx":587 * cdef SDL_Rect sdl_rect * * if rect is None: # <<<<<<<<<<<<<< * SDL_SetClipRect(self.surface, NULL) * else: */ __pyx_t_1 = (__pyx_v_rect == Py_None); __pyx_t_2 = (__pyx_t_1 != 0); if (__pyx_t_2) { /* "pygame_sdl2/surface.pyx":588 * * if rect is None: * SDL_SetClipRect(self.surface, NULL) # <<<<<<<<<<<<<< * else: * to_sdl_rect(rect, &sdl_rect) */ SDL_SetClipRect(__pyx_v_self->surface, NULL); /* "pygame_sdl2/surface.pyx":587 * cdef SDL_Rect sdl_rect * * if rect is None: # <<<<<<<<<<<<<< * SDL_SetClipRect(self.surface, NULL) * else: */ goto __pyx_L3; } /* "pygame_sdl2/surface.pyx":590 * SDL_SetClipRect(self.surface, NULL) * else: * to_sdl_rect(rect, &sdl_rect) # <<<<<<<<<<<<<< * SDL_SetClipRect(self.surface, &sdl_rect) * */ /*else*/ { __pyx_t_3 = __pyx_f_11pygame_sdl2_4rect_to_sdl_rect(__pyx_v_rect, (&__pyx_v_sdl_rect), NULL); if (unlikely(__pyx_t_3 == -1)) __PYX_ERR(0, 590, __pyx_L1_error) /* "pygame_sdl2/surface.pyx":591 * else: * to_sdl_rect(rect, &sdl_rect) * SDL_SetClipRect(self.surface, &sdl_rect) # <<<<<<<<<<<<<< * * def get_clip(self): */ SDL_SetClipRect(__pyx_v_self->surface, (&__pyx_v_sdl_rect)); } __pyx_L3:; /* "pygame_sdl2/surface.pyx":584 * return get_color(pixel, self.surface) * * def set_clip(self, rect): # <<<<<<<<<<<<<< * cdef SDL_Rect sdl_rect * */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("pygame_sdl2.surface.Surface.set_clip", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/surface.pyx":593 * SDL_SetClipRect(self.surface, &sdl_rect) * * def get_clip(self): # <<<<<<<<<<<<<< * cdef SDL_Rect sdl_rect * */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_7surface_7Surface_53get_clip(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/ static PyObject *__pyx_pw_11pygame_sdl2_7surface_7Surface_53get_clip(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("get_clip (wrapper)", 0); __pyx_r = __pyx_pf_11pygame_sdl2_7surface_7Surface_52get_clip(((struct __pyx_obj_11pygame_sdl2_7surface_Surface *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_7surface_7Surface_52get_clip(struct __pyx_obj_11pygame_sdl2_7surface_Surface *__pyx_v_self) { SDL_Rect __pyx_v_sdl_rect; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; PyObject *__pyx_t_5 = NULL; __Pyx_RefNannySetupContext("get_clip", 0); /* "pygame_sdl2/surface.pyx":596 * cdef SDL_Rect sdl_rect * * SDL_GetClipRect(self.surface, &sdl_rect) # <<<<<<<<<<<<<< * * return (sdl_rect.x, sdl_rect.y, sdl_rect.w, sdl_rect.h) */ SDL_GetClipRect(__pyx_v_self->surface, (&__pyx_v_sdl_rect)); /* "pygame_sdl2/surface.pyx":598 * SDL_GetClipRect(self.surface, &sdl_rect) * * return (sdl_rect.x, sdl_rect.y, sdl_rect.w, sdl_rect.h) # <<<<<<<<<<<<<< * * def subsurface(self, *args): */ __Pyx_XDECREF(__pyx_r); __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_sdl_rect.x); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 598, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_v_sdl_rect.y); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 598, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = __Pyx_PyInt_From_int(__pyx_v_sdl_rect.w); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 598, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = __Pyx_PyInt_From_int(__pyx_v_sdl_rect.h); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 598, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_5 = PyTuple_New(4); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 598, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_GIVEREF(__pyx_t_1); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_1); __Pyx_GIVEREF(__pyx_t_2); PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_t_2); __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_5, 2, __pyx_t_3); __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_5, 3, __pyx_t_4); __pyx_t_1 = 0; __pyx_t_2 = 0; __pyx_t_3 = 0; __pyx_t_4 = 0; __pyx_r = __pyx_t_5; __pyx_t_5 = 0; goto __pyx_L0; /* "pygame_sdl2/surface.pyx":593 * SDL_SetClipRect(self.surface, &sdl_rect) * * def get_clip(self): # <<<<<<<<<<<<<< * cdef SDL_Rect sdl_rect * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_5); __Pyx_AddTraceback("pygame_sdl2.surface.Surface.get_clip", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/surface.pyx":600 * return (sdl_rect.x, sdl_rect.y, sdl_rect.w, sdl_rect.h) * * def subsurface(self, *args): # <<<<<<<<<<<<<< * cdef SDL_Rect sdl_rect * */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_7surface_7Surface_55subsurface(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static PyObject *__pyx_pw_11pygame_sdl2_7surface_7Surface_55subsurface(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_args = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("subsurface (wrapper)", 0); if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "subsurface", 0))) return NULL; __Pyx_INCREF(__pyx_args); __pyx_v_args = __pyx_args; __pyx_r = __pyx_pf_11pygame_sdl2_7surface_7Surface_54subsurface(((struct __pyx_obj_11pygame_sdl2_7surface_Surface *)__pyx_v_self), __pyx_v_args); /* function exit code */ __Pyx_XDECREF(__pyx_v_args); __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_7surface_7Surface_54subsurface(struct __pyx_obj_11pygame_sdl2_7surface_Surface *__pyx_v_self, PyObject *__pyx_v_args) { SDL_Rect __pyx_v_sdl_rect; Uint8 *__pyx_v_pixels; SDL_Surface *__pyx_v_new_surface; struct __pyx_obj_11pygame_sdl2_7surface_Surface *__pyx_v_rv = 0; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations Py_ssize_t __pyx_t_1; int __pyx_t_2; PyObject *__pyx_t_3 = NULL; int __pyx_t_4; int __pyx_t_5; PyObject *__pyx_t_6 = NULL; PyObject *__pyx_t_7 = NULL; PyObject *__pyx_t_8 = NULL; PyObject *__pyx_t_9 = NULL; __Pyx_RefNannySetupContext("subsurface", 0); /* "pygame_sdl2/surface.pyx":603 * cdef SDL_Rect sdl_rect * * if len(args) == 1: # <<<<<<<<<<<<<< * to_sdl_rect(args[0], &sdl_rect) * else: */ __pyx_t_1 = PyTuple_GET_SIZE(__pyx_v_args); if (unlikely(__pyx_t_1 == -1)) __PYX_ERR(0, 603, __pyx_L1_error) __pyx_t_2 = ((__pyx_t_1 == 1) != 0); if (__pyx_t_2) { /* "pygame_sdl2/surface.pyx":604 * * if len(args) == 1: * to_sdl_rect(args[0], &sdl_rect) # <<<<<<<<<<<<<< * else: * to_sdl_rect(args, &sdl_rect) */ __pyx_t_3 = __Pyx_GetItemInt_Tuple(__pyx_v_args, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 604, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = __pyx_f_11pygame_sdl2_4rect_to_sdl_rect(__pyx_t_3, (&__pyx_v_sdl_rect), NULL); if (unlikely(__pyx_t_4 == -1)) __PYX_ERR(0, 604, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "pygame_sdl2/surface.pyx":603 * cdef SDL_Rect sdl_rect * * if len(args) == 1: # <<<<<<<<<<<<<< * to_sdl_rect(args[0], &sdl_rect) * else: */ goto __pyx_L3; } /* "pygame_sdl2/surface.pyx":606 * to_sdl_rect(args[0], &sdl_rect) * else: * to_sdl_rect(args, &sdl_rect) # <<<<<<<<<<<<<< * * if sdl_rect.w < 0 or sdl_rect.h < 0: */ /*else*/ { __pyx_t_4 = __pyx_f_11pygame_sdl2_4rect_to_sdl_rect(__pyx_v_args, (&__pyx_v_sdl_rect), NULL); if (unlikely(__pyx_t_4 == -1)) __PYX_ERR(0, 606, __pyx_L1_error) } __pyx_L3:; /* "pygame_sdl2/surface.pyx":608 * to_sdl_rect(args, &sdl_rect) * * if sdl_rect.w < 0 or sdl_rect.h < 0: # <<<<<<<<<<<<<< * raise error("subsurface size must be non-negative.") * */ __pyx_t_5 = ((__pyx_v_sdl_rect.w < 0) != 0); if (!__pyx_t_5) { } else { __pyx_t_2 = __pyx_t_5; goto __pyx_L5_bool_binop_done; } __pyx_t_5 = ((__pyx_v_sdl_rect.h < 0) != 0); __pyx_t_2 = __pyx_t_5; __pyx_L5_bool_binop_done:; if (__pyx_t_2) { /* "pygame_sdl2/surface.pyx":609 * * if sdl_rect.w < 0 or sdl_rect.h < 0: * raise error("subsurface size must be non-negative.") # <<<<<<<<<<<<<< * * if ((sdl_rect.x < 0) */ __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_error); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 609, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_tuple__13, NULL); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 609, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_Raise(__pyx_t_6, 0, 0, 0); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __PYX_ERR(0, 609, __pyx_L1_error) /* "pygame_sdl2/surface.pyx":608 * to_sdl_rect(args, &sdl_rect) * * if sdl_rect.w < 0 or sdl_rect.h < 0: # <<<<<<<<<<<<<< * raise error("subsurface size must be non-negative.") * */ } /* "pygame_sdl2/surface.pyx":611 * raise error("subsurface size must be non-negative.") * * if ((sdl_rect.x < 0) # <<<<<<<<<<<<<< * or (sdl_rect.y < 0) * or (sdl_rect.x + sdl_rect.w > self.surface.w) */ __pyx_t_5 = ((__pyx_v_sdl_rect.x < 0) != 0); if (!__pyx_t_5) { } else { __pyx_t_2 = __pyx_t_5; goto __pyx_L8_bool_binop_done; } /* "pygame_sdl2/surface.pyx":612 * * if ((sdl_rect.x < 0) * or (sdl_rect.y < 0) # <<<<<<<<<<<<<< * or (sdl_rect.x + sdl_rect.w > self.surface.w) * or (sdl_rect.y + sdl_rect.h > self.surface.h)): */ __pyx_t_5 = ((__pyx_v_sdl_rect.y < 0) != 0); if (!__pyx_t_5) { } else { __pyx_t_2 = __pyx_t_5; goto __pyx_L8_bool_binop_done; } /* "pygame_sdl2/surface.pyx":613 * if ((sdl_rect.x < 0) * or (sdl_rect.y < 0) * or (sdl_rect.x + sdl_rect.w > self.surface.w) # <<<<<<<<<<<<<< * or (sdl_rect.y + sdl_rect.h > self.surface.h)): * */ __pyx_t_5 = (((__pyx_v_sdl_rect.x + __pyx_v_sdl_rect.w) > __pyx_v_self->surface->w) != 0); if (!__pyx_t_5) { } else { __pyx_t_2 = __pyx_t_5; goto __pyx_L8_bool_binop_done; } /* "pygame_sdl2/surface.pyx":614 * or (sdl_rect.y < 0) * or (sdl_rect.x + sdl_rect.w > self.surface.w) * or (sdl_rect.y + sdl_rect.h > self.surface.h)): # <<<<<<<<<<<<<< * * raise error("subsurface rectangle outside surface area.") */ __pyx_t_5 = (((__pyx_v_sdl_rect.y + __pyx_v_sdl_rect.h) > __pyx_v_self->surface->h) != 0); __pyx_t_2 = __pyx_t_5; __pyx_L8_bool_binop_done:; /* "pygame_sdl2/surface.pyx":611 * raise error("subsurface size must be non-negative.") * * if ((sdl_rect.x < 0) # <<<<<<<<<<<<<< * or (sdl_rect.y < 0) * or (sdl_rect.x + sdl_rect.w > self.surface.w) */ if (__pyx_t_2) { /* "pygame_sdl2/surface.pyx":616 * or (sdl_rect.y + sdl_rect.h > self.surface.h)): * * raise error("subsurface rectangle outside surface area.") # <<<<<<<<<<<<<< * * cdef Uint8 *pixels = self.surface.pixels */ __pyx_t_6 = __Pyx_GetModuleGlobalName(__pyx_n_s_error); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 616, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_tuple__14, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 616, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_Raise(__pyx_t_3, 0, 0, 0); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __PYX_ERR(0, 616, __pyx_L1_error) /* "pygame_sdl2/surface.pyx":611 * raise error("subsurface size must be non-negative.") * * if ((sdl_rect.x < 0) # <<<<<<<<<<<<<< * or (sdl_rect.y < 0) * or (sdl_rect.x + sdl_rect.w > self.surface.w) */ } /* "pygame_sdl2/surface.pyx":618 * raise error("subsurface rectangle outside surface area.") * * cdef Uint8 *pixels = self.surface.pixels # <<<<<<<<<<<<<< * pixels += sdl_rect.y * self.surface.pitch * pixels += sdl_rect.x * self.surface.format.BytesPerPixel */ __pyx_v_pixels = ((Uint8 *)__pyx_v_self->surface->pixels); /* "pygame_sdl2/surface.pyx":619 * * cdef Uint8 *pixels = self.surface.pixels * pixels += sdl_rect.y * self.surface.pitch # <<<<<<<<<<<<<< * pixels += sdl_rect.x * self.surface.format.BytesPerPixel * */ __pyx_v_pixels = (__pyx_v_pixels + (__pyx_v_sdl_rect.y * __pyx_v_self->surface->pitch)); /* "pygame_sdl2/surface.pyx":620 * cdef Uint8 *pixels = self.surface.pixels * pixels += sdl_rect.y * self.surface.pitch * pixels += sdl_rect.x * self.surface.format.BytesPerPixel # <<<<<<<<<<<<<< * * cdef SDL_Surface *new_surface = SDL_CreateRGBSurfaceFrom( */ __pyx_v_pixels = (__pyx_v_pixels + (__pyx_v_sdl_rect.x * __pyx_v_self->surface->format->BytesPerPixel)); /* "pygame_sdl2/surface.pyx":622 * pixels += sdl_rect.x * self.surface.format.BytesPerPixel * * cdef SDL_Surface *new_surface = SDL_CreateRGBSurfaceFrom( # <<<<<<<<<<<<<< * pixels, * sdl_rect.w, */ __pyx_v_new_surface = SDL_CreateRGBSurfaceFrom(__pyx_v_pixels, __pyx_v_sdl_rect.w, __pyx_v_sdl_rect.h, __pyx_v_self->surface->format->BitsPerPixel, __pyx_v_self->surface->pitch, __pyx_v_self->surface->format->Rmask, __pyx_v_self->surface->format->Gmask, __pyx_v_self->surface->format->Bmask, __pyx_v_self->surface->format->Amask); /* "pygame_sdl2/surface.pyx":633 * self.surface.format.Amask) * * cdef Surface rv = Surface(()) # <<<<<<<<<<<<<< * * rv.surface = new_surface */ __pyx_t_3 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_11pygame_sdl2_7surface_Surface), __pyx_tuple__15, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 633, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_v_rv = ((struct __pyx_obj_11pygame_sdl2_7surface_Surface *)__pyx_t_3); __pyx_t_3 = 0; /* "pygame_sdl2/surface.pyx":635 * cdef Surface rv = Surface(()) * * rv.surface = new_surface # <<<<<<<<<<<<<< * rv.parent = self * rv.offset_x = sdl_rect.x */ __pyx_v_rv->surface = __pyx_v_new_surface; /* "pygame_sdl2/surface.pyx":636 * * rv.surface = new_surface * rv.parent = self # <<<<<<<<<<<<<< * rv.offset_x = sdl_rect.x * rv.offset_y = sdl_rect.y */ __Pyx_INCREF(((PyObject *)__pyx_v_self)); __Pyx_GIVEREF(((PyObject *)__pyx_v_self)); __Pyx_GOTREF(__pyx_v_rv->parent); __Pyx_DECREF(((PyObject *)__pyx_v_rv->parent)); __pyx_v_rv->parent = __pyx_v_self; /* "pygame_sdl2/surface.pyx":637 * rv.surface = new_surface * rv.parent = self * rv.offset_x = sdl_rect.x # <<<<<<<<<<<<<< * rv.offset_y = sdl_rect.y * */ __pyx_t_4 = __pyx_v_sdl_rect.x; __pyx_v_rv->offset_x = __pyx_t_4; /* "pygame_sdl2/surface.pyx":638 * rv.parent = self * rv.offset_x = sdl_rect.x * rv.offset_y = sdl_rect.y # <<<<<<<<<<<<<< * * if self.has_alpha: */ __pyx_t_4 = __pyx_v_sdl_rect.y; __pyx_v_rv->offset_y = __pyx_t_4; /* "pygame_sdl2/surface.pyx":640 * rv.offset_y = sdl_rect.y * * if self.has_alpha: # <<<<<<<<<<<<<< * rv.set_alpha(self.get_alpha()) * */ __pyx_t_2 = (__pyx_v_self->has_alpha != 0); if (__pyx_t_2) { /* "pygame_sdl2/surface.pyx":641 * * if self.has_alpha: * rv.set_alpha(self.get_alpha()) # <<<<<<<<<<<<<< * * return rv */ __pyx_t_6 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_rv), __pyx_n_s_set_alpha); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 641, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __pyx_t_8 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_get_alpha); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 641, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __pyx_t_9 = NULL; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_8))) { __pyx_t_9 = PyMethod_GET_SELF(__pyx_t_8); if (likely(__pyx_t_9)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_8); __Pyx_INCREF(__pyx_t_9); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_8, function); } } if (__pyx_t_9) { __pyx_t_7 = __Pyx_PyObject_CallOneArg(__pyx_t_8, __pyx_t_9); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 641, __pyx_L1_error) __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; } else { __pyx_t_7 = __Pyx_PyObject_CallNoArg(__pyx_t_8); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 641, __pyx_L1_error) } __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; __pyx_t_8 = NULL; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_6))) { __pyx_t_8 = PyMethod_GET_SELF(__pyx_t_6); if (likely(__pyx_t_8)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6); __Pyx_INCREF(__pyx_t_8); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_6, function); } } if (!__pyx_t_8) { __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_t_6, __pyx_t_7); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 641, __pyx_L1_error) __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_GOTREF(__pyx_t_3); } else { #if CYTHON_FAST_PYCALL if (PyFunction_Check(__pyx_t_6)) { PyObject *__pyx_temp[2] = {__pyx_t_8, __pyx_t_7}; __pyx_t_3 = __Pyx_PyFunction_FastCall(__pyx_t_6, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 641, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0; __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; } else #endif #if CYTHON_FAST_PYCCALL if (__Pyx_PyFastCFunction_Check(__pyx_t_6)) { PyObject *__pyx_temp[2] = {__pyx_t_8, __pyx_t_7}; __pyx_t_3 = __Pyx_PyCFunction_FastCall(__pyx_t_6, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 641, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0; __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; } else #endif { __pyx_t_9 = PyTuple_New(1+1); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 641, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); __Pyx_GIVEREF(__pyx_t_8); PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_t_8); __pyx_t_8 = NULL; __Pyx_GIVEREF(__pyx_t_7); PyTuple_SET_ITEM(__pyx_t_9, 0+1, __pyx_t_7); __pyx_t_7 = 0; __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_9, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 641, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; } } __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "pygame_sdl2/surface.pyx":640 * rv.offset_y = sdl_rect.y * * if self.has_alpha: # <<<<<<<<<<<<<< * rv.set_alpha(self.get_alpha()) * */ } /* "pygame_sdl2/surface.pyx":643 * rv.set_alpha(self.get_alpha()) * * return rv # <<<<<<<<<<<<<< * * def get_parent(self): */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(((PyObject *)__pyx_v_rv)); __pyx_r = ((PyObject *)__pyx_v_rv); goto __pyx_L0; /* "pygame_sdl2/surface.pyx":600 * return (sdl_rect.x, sdl_rect.y, sdl_rect.w, sdl_rect.h) * * def subsurface(self, *args): # <<<<<<<<<<<<<< * cdef SDL_Rect sdl_rect * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_6); __Pyx_XDECREF(__pyx_t_7); __Pyx_XDECREF(__pyx_t_8); __Pyx_XDECREF(__pyx_t_9); __Pyx_AddTraceback("pygame_sdl2.surface.Surface.subsurface", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF((PyObject *)__pyx_v_rv); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/surface.pyx":645 * return rv * * def get_parent(self): # <<<<<<<<<<<<<< * return self.parent * */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_7surface_7Surface_57get_parent(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/ static PyObject *__pyx_pw_11pygame_sdl2_7surface_7Surface_57get_parent(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("get_parent (wrapper)", 0); __pyx_r = __pyx_pf_11pygame_sdl2_7surface_7Surface_56get_parent(((struct __pyx_obj_11pygame_sdl2_7surface_Surface *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_7surface_7Surface_56get_parent(struct __pyx_obj_11pygame_sdl2_7surface_Surface *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("get_parent", 0); /* "pygame_sdl2/surface.pyx":646 * * def get_parent(self): * return self.parent # <<<<<<<<<<<<<< * * def get_abs_parent(self): */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(((PyObject *)__pyx_v_self->parent)); __pyx_r = ((PyObject *)__pyx_v_self->parent); goto __pyx_L0; /* "pygame_sdl2/surface.pyx":645 * return rv * * def get_parent(self): # <<<<<<<<<<<<<< * return self.parent * */ /* function exit code */ __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/surface.pyx":648 * return self.parent * * def get_abs_parent(self): # <<<<<<<<<<<<<< * rv = self * */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_7surface_7Surface_59get_abs_parent(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/ static PyObject *__pyx_pw_11pygame_sdl2_7surface_7Surface_59get_abs_parent(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("get_abs_parent (wrapper)", 0); __pyx_r = __pyx_pf_11pygame_sdl2_7surface_7Surface_58get_abs_parent(((struct __pyx_obj_11pygame_sdl2_7surface_Surface *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_7surface_7Surface_58get_abs_parent(struct __pyx_obj_11pygame_sdl2_7surface_Surface *__pyx_v_self) { struct __pyx_obj_11pygame_sdl2_7surface_Surface *__pyx_v_rv = NULL; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; PyObject *__pyx_t_2 = NULL; __Pyx_RefNannySetupContext("get_abs_parent", 0); /* "pygame_sdl2/surface.pyx":649 * * def get_abs_parent(self): * rv = self # <<<<<<<<<<<<<< * * while rv.parent: */ __Pyx_INCREF(((PyObject *)__pyx_v_self)); __pyx_v_rv = __pyx_v_self; /* "pygame_sdl2/surface.pyx":651 * rv = self * * while rv.parent: # <<<<<<<<<<<<<< * rv = rv.parent * */ while (1) { __pyx_t_1 = __Pyx_PyObject_IsTrue(((PyObject *)__pyx_v_rv->parent)); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(0, 651, __pyx_L1_error) if (!__pyx_t_1) break; /* "pygame_sdl2/surface.pyx":652 * * while rv.parent: * rv = rv.parent # <<<<<<<<<<<<<< * * return rv */ __pyx_t_2 = ((PyObject *)__pyx_v_rv->parent); __Pyx_INCREF(__pyx_t_2); __Pyx_DECREF_SET(__pyx_v_rv, ((struct __pyx_obj_11pygame_sdl2_7surface_Surface *)__pyx_t_2)); __pyx_t_2 = 0; } /* "pygame_sdl2/surface.pyx":654 * rv = rv.parent * * return rv # <<<<<<<<<<<<<< * * def get_offset(self): */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(((PyObject *)__pyx_v_rv)); __pyx_r = ((PyObject *)__pyx_v_rv); goto __pyx_L0; /* "pygame_sdl2/surface.pyx":648 * return self.parent * * def get_abs_parent(self): # <<<<<<<<<<<<<< * rv = self * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_AddTraceback("pygame_sdl2.surface.Surface.get_abs_parent", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF((PyObject *)__pyx_v_rv); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/surface.pyx":656 * return rv * * def get_offset(self): # <<<<<<<<<<<<<< * return (self.offset_x, self.offset_y) * */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_7surface_7Surface_61get_offset(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/ static PyObject *__pyx_pw_11pygame_sdl2_7surface_7Surface_61get_offset(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("get_offset (wrapper)", 0); __pyx_r = __pyx_pf_11pygame_sdl2_7surface_7Surface_60get_offset(((struct __pyx_obj_11pygame_sdl2_7surface_Surface *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_7surface_7Surface_60get_offset(struct __pyx_obj_11pygame_sdl2_7surface_Surface *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; __Pyx_RefNannySetupContext("get_offset", 0); /* "pygame_sdl2/surface.pyx":657 * * def get_offset(self): * return (self.offset_x, self.offset_y) # <<<<<<<<<<<<<< * * def get_abs_offset(self): */ __Pyx_XDECREF(__pyx_r); __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_self->offset_x); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 657, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_v_self->offset_y); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 657, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 657, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_GIVEREF(__pyx_t_1); PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_1); __Pyx_GIVEREF(__pyx_t_2); PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_2); __pyx_t_1 = 0; __pyx_t_2 = 0; __pyx_r = __pyx_t_3; __pyx_t_3 = 0; goto __pyx_L0; /* "pygame_sdl2/surface.pyx":656 * return rv * * def get_offset(self): # <<<<<<<<<<<<<< * return (self.offset_x, self.offset_y) * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("pygame_sdl2.surface.Surface.get_offset", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/surface.pyx":659 * return (self.offset_x, self.offset_y) * * def get_abs_offset(self): # <<<<<<<<<<<<<< * cdef Surface surf = self * */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_7surface_7Surface_63get_abs_offset(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/ static PyObject *__pyx_pw_11pygame_sdl2_7surface_7Surface_63get_abs_offset(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("get_abs_offset (wrapper)", 0); __pyx_r = __pyx_pf_11pygame_sdl2_7surface_7Surface_62get_abs_offset(((struct __pyx_obj_11pygame_sdl2_7surface_Surface *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_7surface_7Surface_62get_abs_offset(struct __pyx_obj_11pygame_sdl2_7surface_Surface *__pyx_v_self) { struct __pyx_obj_11pygame_sdl2_7surface_Surface *__pyx_v_surf = 0; int __pyx_v_offset_x; int __pyx_v_offset_y; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; __Pyx_RefNannySetupContext("get_abs_offset", 0); /* "pygame_sdl2/surface.pyx":660 * * def get_abs_offset(self): * cdef Surface surf = self # <<<<<<<<<<<<<< * * cdef int offset_x = 0 */ __Pyx_INCREF(((PyObject *)__pyx_v_self)); __pyx_v_surf = __pyx_v_self; /* "pygame_sdl2/surface.pyx":662 * cdef Surface surf = self * * cdef int offset_x = 0 # <<<<<<<<<<<<<< * cdef int offset_y = 0 * */ __pyx_v_offset_x = 0; /* "pygame_sdl2/surface.pyx":663 * * cdef int offset_x = 0 * cdef int offset_y = 0 # <<<<<<<<<<<<<< * * while surf: */ __pyx_v_offset_y = 0; /* "pygame_sdl2/surface.pyx":665 * cdef int offset_y = 0 * * while surf: # <<<<<<<<<<<<<< * offset_x += surf.offset_x * offset_y += surf.offset_y */ while (1) { __pyx_t_1 = __Pyx_PyObject_IsTrue(((PyObject *)__pyx_v_surf)); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(0, 665, __pyx_L1_error) if (!__pyx_t_1) break; /* "pygame_sdl2/surface.pyx":666 * * while surf: * offset_x += surf.offset_x # <<<<<<<<<<<<<< * offset_y += surf.offset_y * surf = surf.parent */ __pyx_v_offset_x = (__pyx_v_offset_x + __pyx_v_surf->offset_x); /* "pygame_sdl2/surface.pyx":667 * while surf: * offset_x += surf.offset_x * offset_y += surf.offset_y # <<<<<<<<<<<<<< * surf = surf.parent * */ __pyx_v_offset_y = (__pyx_v_offset_y + __pyx_v_surf->offset_y); /* "pygame_sdl2/surface.pyx":668 * offset_x += surf.offset_x * offset_y += surf.offset_y * surf = surf.parent # <<<<<<<<<<<<<< * * return (offset_x, offset_y) */ __pyx_t_2 = ((PyObject *)__pyx_v_surf->parent); __Pyx_INCREF(__pyx_t_2); __Pyx_DECREF_SET(__pyx_v_surf, ((struct __pyx_obj_11pygame_sdl2_7surface_Surface *)__pyx_t_2)); __pyx_t_2 = 0; } /* "pygame_sdl2/surface.pyx":670 * surf = surf.parent * * return (offset_x, offset_y) # <<<<<<<<<<<<<< * * def get_size(self): */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_v_offset_x); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 670, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = __Pyx_PyInt_From_int(__pyx_v_offset_y); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 670, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 670, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_GIVEREF(__pyx_t_2); PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_2); __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_3); __pyx_t_2 = 0; __pyx_t_3 = 0; __pyx_r = __pyx_t_4; __pyx_t_4 = 0; goto __pyx_L0; /* "pygame_sdl2/surface.pyx":659 * return (self.offset_x, self.offset_y) * * def get_abs_offset(self): # <<<<<<<<<<<<<< * cdef Surface surf = self * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_AddTraceback("pygame_sdl2.surface.Surface.get_abs_offset", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF((PyObject *)__pyx_v_surf); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/surface.pyx":672 * return (offset_x, offset_y) * * def get_size(self): # <<<<<<<<<<<<<< * return self.surface.w, self.surface.h * */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_7surface_7Surface_65get_size(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/ static PyObject *__pyx_pw_11pygame_sdl2_7surface_7Surface_65get_size(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("get_size (wrapper)", 0); __pyx_r = __pyx_pf_11pygame_sdl2_7surface_7Surface_64get_size(((struct __pyx_obj_11pygame_sdl2_7surface_Surface *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_7surface_7Surface_64get_size(struct __pyx_obj_11pygame_sdl2_7surface_Surface *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; __Pyx_RefNannySetupContext("get_size", 0); /* "pygame_sdl2/surface.pyx":673 * * def get_size(self): * return self.surface.w, self.surface.h # <<<<<<<<<<<<<< * * def get_width(self): */ __Pyx_XDECREF(__pyx_r); __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_self->surface->w); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 673, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_v_self->surface->h); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 673, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 673, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_GIVEREF(__pyx_t_1); PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_1); __Pyx_GIVEREF(__pyx_t_2); PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_2); __pyx_t_1 = 0; __pyx_t_2 = 0; __pyx_r = __pyx_t_3; __pyx_t_3 = 0; goto __pyx_L0; /* "pygame_sdl2/surface.pyx":672 * return (offset_x, offset_y) * * def get_size(self): # <<<<<<<<<<<<<< * return self.surface.w, self.surface.h * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("pygame_sdl2.surface.Surface.get_size", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/surface.pyx":675 * return self.surface.w, self.surface.h * * def get_width(self): # <<<<<<<<<<<<<< * return self.surface.w * */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_7surface_7Surface_67get_width(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/ static PyObject *__pyx_pw_11pygame_sdl2_7surface_7Surface_67get_width(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("get_width (wrapper)", 0); __pyx_r = __pyx_pf_11pygame_sdl2_7surface_7Surface_66get_width(((struct __pyx_obj_11pygame_sdl2_7surface_Surface *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_7surface_7Surface_66get_width(struct __pyx_obj_11pygame_sdl2_7surface_Surface *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; __Pyx_RefNannySetupContext("get_width", 0); /* "pygame_sdl2/surface.pyx":676 * * def get_width(self): * return self.surface.w # <<<<<<<<<<<<<< * * def get_height(self): */ __Pyx_XDECREF(__pyx_r); __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_self->surface->w); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 676, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "pygame_sdl2/surface.pyx":675 * return self.surface.w, self.surface.h * * def get_width(self): # <<<<<<<<<<<<<< * return self.surface.w * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("pygame_sdl2.surface.Surface.get_width", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/surface.pyx":678 * return self.surface.w * * def get_height(self): # <<<<<<<<<<<<<< * return self.surface.h * */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_7surface_7Surface_69get_height(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/ static PyObject *__pyx_pw_11pygame_sdl2_7surface_7Surface_69get_height(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("get_height (wrapper)", 0); __pyx_r = __pyx_pf_11pygame_sdl2_7surface_7Surface_68get_height(((struct __pyx_obj_11pygame_sdl2_7surface_Surface *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_7surface_7Surface_68get_height(struct __pyx_obj_11pygame_sdl2_7surface_Surface *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; __Pyx_RefNannySetupContext("get_height", 0); /* "pygame_sdl2/surface.pyx":679 * * def get_height(self): * return self.surface.h # <<<<<<<<<<<<<< * * def get_rect(self, **kwargs): */ __Pyx_XDECREF(__pyx_r); __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_self->surface->h); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 679, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "pygame_sdl2/surface.pyx":678 * return self.surface.w * * def get_height(self): # <<<<<<<<<<<<<< * return self.surface.h * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("pygame_sdl2.surface.Surface.get_height", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/surface.pyx":681 * return self.surface.h * * def get_rect(self, **kwargs): # <<<<<<<<<<<<<< * rv = Rect((0, 0, self.surface.w, self.surface.h)) * */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_7surface_7Surface_71get_rect(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static PyObject *__pyx_pw_11pygame_sdl2_7surface_7Surface_71get_rect(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_kwargs = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("get_rect (wrapper)", 0); if (unlikely(PyTuple_GET_SIZE(__pyx_args) > 0)) { __Pyx_RaiseArgtupleInvalid("get_rect", 1, 0, 0, PyTuple_GET_SIZE(__pyx_args)); return NULL;} if (__pyx_kwds && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "get_rect", 1))) return NULL; __pyx_v_kwargs = (__pyx_kwds) ? PyDict_Copy(__pyx_kwds) : PyDict_New(); if (unlikely(!__pyx_v_kwargs)) return NULL; __Pyx_GOTREF(__pyx_v_kwargs); __pyx_r = __pyx_pf_11pygame_sdl2_7surface_7Surface_70get_rect(((struct __pyx_obj_11pygame_sdl2_7surface_Surface *)__pyx_v_self), __pyx_v_kwargs); /* function exit code */ __Pyx_XDECREF(__pyx_v_kwargs); __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_7surface_7Surface_70get_rect(struct __pyx_obj_11pygame_sdl2_7surface_Surface *__pyx_v_self, PyObject *__pyx_v_kwargs) { PyObject *__pyx_v_rv = NULL; PyObject *__pyx_v_k = NULL; PyObject *__pyx_v_v = NULL; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; PyObject *__pyx_t_5 = NULL; Py_ssize_t __pyx_t_6; Py_ssize_t __pyx_t_7; int __pyx_t_8; int __pyx_t_9; int __pyx_t_10; __Pyx_RefNannySetupContext("get_rect", 0); /* "pygame_sdl2/surface.pyx":682 * * def get_rect(self, **kwargs): * rv = Rect((0, 0, self.surface.w, self.surface.h)) # <<<<<<<<<<<<<< * * for k, v in kwargs.items(): */ __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_Rect); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 682, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = __Pyx_PyInt_From_int(__pyx_v_self->surface->w); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 682, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = __Pyx_PyInt_From_int(__pyx_v_self->surface->h); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 682, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_5 = PyTuple_New(4); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 682, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_INCREF(__pyx_int_0); __Pyx_GIVEREF(__pyx_int_0); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_int_0); __Pyx_INCREF(__pyx_int_0); __Pyx_GIVEREF(__pyx_int_0); PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_int_0); __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_5, 2, __pyx_t_3); __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_5, 3, __pyx_t_4); __pyx_t_3 = 0; __pyx_t_4 = 0; __pyx_t_4 = NULL; if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) { __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_2); if (likely(__pyx_t_4)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_4); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); } } if (!__pyx_t_4) { __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_5); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 682, __pyx_L1_error) __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_GOTREF(__pyx_t_1); } else { #if CYTHON_FAST_PYCALL if (PyFunction_Check(__pyx_t_2)) { PyObject *__pyx_temp[2] = {__pyx_t_4, __pyx_t_5}; __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_2, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 682, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; } else #endif #if CYTHON_FAST_PYCCALL if (__Pyx_PyFastCFunction_Check(__pyx_t_2)) { PyObject *__pyx_temp[2] = {__pyx_t_4, __pyx_t_5}; __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_2, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 682, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; } else #endif { __pyx_t_3 = PyTuple_New(1+1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 682, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_4); __pyx_t_4 = NULL; __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_3, 0+1, __pyx_t_5); __pyx_t_5 = 0; __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_3, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 682, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } } __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_v_rv = __pyx_t_1; __pyx_t_1 = 0; /* "pygame_sdl2/surface.pyx":684 * rv = Rect((0, 0, self.surface.w, self.surface.h)) * * for k, v in kwargs.items(): # <<<<<<<<<<<<<< * setattr(rv, k, v) * */ __pyx_t_6 = 0; __pyx_t_2 = __Pyx_dict_iterator(__pyx_v_kwargs, 1, __pyx_n_s_items, (&__pyx_t_7), (&__pyx_t_8)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 684, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = __pyx_t_2; __pyx_t_2 = 0; while (1) { __pyx_t_9 = __Pyx_dict_iter_next(__pyx_t_1, __pyx_t_7, &__pyx_t_6, &__pyx_t_2, &__pyx_t_3, NULL, __pyx_t_8); if (unlikely(__pyx_t_9 == 0)) break; if (unlikely(__pyx_t_9 == -1)) __PYX_ERR(0, 684, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_GOTREF(__pyx_t_3); __Pyx_XDECREF_SET(__pyx_v_k, __pyx_t_2); __pyx_t_2 = 0; __Pyx_XDECREF_SET(__pyx_v_v, __pyx_t_3); __pyx_t_3 = 0; /* "pygame_sdl2/surface.pyx":685 * * for k, v in kwargs.items(): * setattr(rv, k, v) # <<<<<<<<<<<<<< * * return rv */ __pyx_t_10 = PyObject_SetAttr(__pyx_v_rv, __pyx_v_k, __pyx_v_v); if (unlikely(__pyx_t_10 == -1)) __PYX_ERR(0, 685, __pyx_L1_error) } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "pygame_sdl2/surface.pyx":687 * setattr(rv, k, v) * * return rv # <<<<<<<<<<<<<< * * def get_bitsize(self): */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(__pyx_v_rv); __pyx_r = __pyx_v_rv; goto __pyx_L0; /* "pygame_sdl2/surface.pyx":681 * return self.surface.h * * def get_rect(self, **kwargs): # <<<<<<<<<<<<<< * rv = Rect((0, 0, self.surface.w, self.surface.h)) * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_5); __Pyx_AddTraceback("pygame_sdl2.surface.Surface.get_rect", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF(__pyx_v_rv); __Pyx_XDECREF(__pyx_v_k); __Pyx_XDECREF(__pyx_v_v); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/surface.pyx":689 * return rv * * def get_bitsize(self): # <<<<<<<<<<<<<< * return self.surface.format.BitsPerPixel * */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_7surface_7Surface_73get_bitsize(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/ static PyObject *__pyx_pw_11pygame_sdl2_7surface_7Surface_73get_bitsize(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("get_bitsize (wrapper)", 0); __pyx_r = __pyx_pf_11pygame_sdl2_7surface_7Surface_72get_bitsize(((struct __pyx_obj_11pygame_sdl2_7surface_Surface *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_7surface_7Surface_72get_bitsize(struct __pyx_obj_11pygame_sdl2_7surface_Surface *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; __Pyx_RefNannySetupContext("get_bitsize", 0); /* "pygame_sdl2/surface.pyx":690 * * def get_bitsize(self): * return self.surface.format.BitsPerPixel # <<<<<<<<<<<<<< * * def get_bytesize(self): */ __Pyx_XDECREF(__pyx_r); __pyx_t_1 = __Pyx_PyInt_From_uint8_t(__pyx_v_self->surface->format->BitsPerPixel); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 690, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "pygame_sdl2/surface.pyx":689 * return rv * * def get_bitsize(self): # <<<<<<<<<<<<<< * return self.surface.format.BitsPerPixel * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("pygame_sdl2.surface.Surface.get_bitsize", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/surface.pyx":692 * return self.surface.format.BitsPerPixel * * def get_bytesize(self): # <<<<<<<<<<<<<< * return self.surface.format.BytesPerPixel * */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_7surface_7Surface_75get_bytesize(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/ static PyObject *__pyx_pw_11pygame_sdl2_7surface_7Surface_75get_bytesize(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("get_bytesize (wrapper)", 0); __pyx_r = __pyx_pf_11pygame_sdl2_7surface_7Surface_74get_bytesize(((struct __pyx_obj_11pygame_sdl2_7surface_Surface *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_7surface_7Surface_74get_bytesize(struct __pyx_obj_11pygame_sdl2_7surface_Surface *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; __Pyx_RefNannySetupContext("get_bytesize", 0); /* "pygame_sdl2/surface.pyx":693 * * def get_bytesize(self): * return self.surface.format.BytesPerPixel # <<<<<<<<<<<<<< * * def get_flags(self): */ __Pyx_XDECREF(__pyx_r); __pyx_t_1 = __Pyx_PyInt_From_uint8_t(__pyx_v_self->surface->format->BytesPerPixel); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 693, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "pygame_sdl2/surface.pyx":692 * return self.surface.format.BitsPerPixel * * def get_bytesize(self): # <<<<<<<<<<<<<< * return self.surface.format.BytesPerPixel * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("pygame_sdl2.surface.Surface.get_bytesize", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/surface.pyx":695 * return self.surface.format.BytesPerPixel * * def get_flags(self): # <<<<<<<<<<<<<< * * if self.get_window_flags: */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_7surface_7Surface_77get_flags(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/ static PyObject *__pyx_pw_11pygame_sdl2_7surface_7Surface_77get_flags(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("get_flags (wrapper)", 0); __pyx_r = __pyx_pf_11pygame_sdl2_7surface_7Surface_76get_flags(((struct __pyx_obj_11pygame_sdl2_7surface_Surface *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_7surface_7Surface_76get_flags(struct __pyx_obj_11pygame_sdl2_7surface_Surface *__pyx_v_self) { PyObject *__pyx_v_rv = NULL; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; int __pyx_t_5; __Pyx_RefNannySetupContext("get_flags", 0); /* "pygame_sdl2/surface.pyx":697 * def get_flags(self): * * if self.get_window_flags: # <<<<<<<<<<<<<< * rv = self.get_window_flags() * else: */ __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_self->get_window_flags); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(0, 697, __pyx_L1_error) if (__pyx_t_1) { /* "pygame_sdl2/surface.pyx":698 * * if self.get_window_flags: * rv = self.get_window_flags() # <<<<<<<<<<<<<< * else: * rv = 0 */ __Pyx_INCREF(__pyx_v_self->get_window_flags); __pyx_t_3 = __pyx_v_self->get_window_flags; __pyx_t_4 = NULL; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) { __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3); if (likely(__pyx_t_4)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); __Pyx_INCREF(__pyx_t_4); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_3, function); } } if (__pyx_t_4) { __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 698, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; } else { __pyx_t_2 = __Pyx_PyObject_CallNoArg(__pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 698, __pyx_L1_error) } __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_v_rv = __pyx_t_2; __pyx_t_2 = 0; /* "pygame_sdl2/surface.pyx":697 * def get_flags(self): * * if self.get_window_flags: # <<<<<<<<<<<<<< * rv = self.get_window_flags() * else: */ goto __pyx_L3; } /* "pygame_sdl2/surface.pyx":700 * rv = self.get_window_flags() * else: * rv = 0 # <<<<<<<<<<<<<< * * if self.surface.format.Amask or self.has_alpha: */ /*else*/ { __Pyx_INCREF(__pyx_int_0); __pyx_v_rv = __pyx_int_0; } __pyx_L3:; /* "pygame_sdl2/surface.pyx":702 * rv = 0 * * if self.surface.format.Amask or self.has_alpha: # <<<<<<<<<<<<<< * rv = rv | SRCALPHA * */ __pyx_t_5 = (__pyx_v_self->surface->format->Amask != 0); if (!__pyx_t_5) { } else { __pyx_t_1 = __pyx_t_5; goto __pyx_L5_bool_binop_done; } __pyx_t_5 = (__pyx_v_self->has_alpha != 0); __pyx_t_1 = __pyx_t_5; __pyx_L5_bool_binop_done:; if (__pyx_t_1) { /* "pygame_sdl2/surface.pyx":703 * * if self.surface.format.Amask or self.has_alpha: * rv = rv | SRCALPHA # <<<<<<<<<<<<<< * * return rv */ __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_SRCALPHA); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 703, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = PyNumber_Or(__pyx_v_rv, __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 703, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF_SET(__pyx_v_rv, __pyx_t_3); __pyx_t_3 = 0; /* "pygame_sdl2/surface.pyx":702 * rv = 0 * * if self.surface.format.Amask or self.has_alpha: # <<<<<<<<<<<<<< * rv = rv | SRCALPHA * */ } /* "pygame_sdl2/surface.pyx":705 * rv = rv | SRCALPHA * * return rv # <<<<<<<<<<<<<< * * def get_pitch(self): */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(__pyx_v_rv); __pyx_r = __pyx_v_rv; goto __pyx_L0; /* "pygame_sdl2/surface.pyx":695 * return self.surface.format.BytesPerPixel * * def get_flags(self): # <<<<<<<<<<<<<< * * if self.get_window_flags: */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_AddTraceback("pygame_sdl2.surface.Surface.get_flags", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF(__pyx_v_rv); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/surface.pyx":707 * return rv * * def get_pitch(self): # <<<<<<<<<<<<<< * return self.surface.pitch * */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_7surface_7Surface_79get_pitch(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/ static PyObject *__pyx_pw_11pygame_sdl2_7surface_7Surface_79get_pitch(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("get_pitch (wrapper)", 0); __pyx_r = __pyx_pf_11pygame_sdl2_7surface_7Surface_78get_pitch(((struct __pyx_obj_11pygame_sdl2_7surface_Surface *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_7surface_7Surface_78get_pitch(struct __pyx_obj_11pygame_sdl2_7surface_Surface *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; __Pyx_RefNannySetupContext("get_pitch", 0); /* "pygame_sdl2/surface.pyx":708 * * def get_pitch(self): * return self.surface.pitch # <<<<<<<<<<<<<< * * def get_masks(self): */ __Pyx_XDECREF(__pyx_r); __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_self->surface->pitch); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 708, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "pygame_sdl2/surface.pyx":707 * return rv * * def get_pitch(self): # <<<<<<<<<<<<<< * return self.surface.pitch * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("pygame_sdl2.surface.Surface.get_pitch", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/surface.pyx":710 * return self.surface.pitch * * def get_masks(self): # <<<<<<<<<<<<<< * cdef SDL_PixelFormat *format = self.surface.format * return (format.Rmask, format.Gmask, format.Bmask, format.Amask) */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_7surface_7Surface_81get_masks(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/ static PyObject *__pyx_pw_11pygame_sdl2_7surface_7Surface_81get_masks(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("get_masks (wrapper)", 0); __pyx_r = __pyx_pf_11pygame_sdl2_7surface_7Surface_80get_masks(((struct __pyx_obj_11pygame_sdl2_7surface_Surface *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_7surface_7Surface_80get_masks(struct __pyx_obj_11pygame_sdl2_7surface_Surface *__pyx_v_self) { SDL_PixelFormat *__pyx_v_format; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations SDL_PixelFormat *__pyx_t_1; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; PyObject *__pyx_t_5 = NULL; PyObject *__pyx_t_6 = NULL; __Pyx_RefNannySetupContext("get_masks", 0); /* "pygame_sdl2/surface.pyx":711 * * def get_masks(self): * cdef SDL_PixelFormat *format = self.surface.format # <<<<<<<<<<<<<< * return (format.Rmask, format.Gmask, format.Bmask, format.Amask) * */ __pyx_t_1 = __pyx_v_self->surface->format; __pyx_v_format = __pyx_t_1; /* "pygame_sdl2/surface.pyx":712 * def get_masks(self): * cdef SDL_PixelFormat *format = self.surface.format * return (format.Rmask, format.Gmask, format.Bmask, format.Amask) # <<<<<<<<<<<<<< * * def set_masks(self, masks): */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __Pyx_PyInt_From_uint32_t(__pyx_v_format->Rmask); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 712, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = __Pyx_PyInt_From_uint32_t(__pyx_v_format->Gmask); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 712, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = __Pyx_PyInt_From_uint32_t(__pyx_v_format->Bmask); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 712, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_5 = __Pyx_PyInt_From_uint32_t(__pyx_v_format->Amask); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 712, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_6 = PyTuple_New(4); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 712, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_GIVEREF(__pyx_t_2); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_2); __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_6, 1, __pyx_t_3); __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_6, 2, __pyx_t_4); __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_6, 3, __pyx_t_5); __pyx_t_2 = 0; __pyx_t_3 = 0; __pyx_t_4 = 0; __pyx_t_5 = 0; __pyx_r = __pyx_t_6; __pyx_t_6 = 0; goto __pyx_L0; /* "pygame_sdl2/surface.pyx":710 * return self.surface.pitch * * def get_masks(self): # <<<<<<<<<<<<<< * cdef SDL_PixelFormat *format = self.surface.format * return (format.Rmask, format.Gmask, format.Bmask, format.Amask) */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_5); __Pyx_XDECREF(__pyx_t_6); __Pyx_AddTraceback("pygame_sdl2.surface.Surface.get_masks", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/surface.pyx":714 * return (format.Rmask, format.Gmask, format.Bmask, format.Amask) * * def set_masks(self, masks): # <<<<<<<<<<<<<< * warnings.warn("Surface.set_masks is not supported.") * */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_7surface_7Surface_83set_masks(PyObject *__pyx_v_self, PyObject *__pyx_v_masks); /*proto*/ static PyObject *__pyx_pw_11pygame_sdl2_7surface_7Surface_83set_masks(PyObject *__pyx_v_self, PyObject *__pyx_v_masks) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("set_masks (wrapper)", 0); __pyx_r = __pyx_pf_11pygame_sdl2_7surface_7Surface_82set_masks(((struct __pyx_obj_11pygame_sdl2_7surface_Surface *)__pyx_v_self), ((PyObject *)__pyx_v_masks)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_7surface_7Surface_82set_masks(CYTHON_UNUSED struct __pyx_obj_11pygame_sdl2_7surface_Surface *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v_masks) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; __Pyx_RefNannySetupContext("set_masks", 0); /* "pygame_sdl2/surface.pyx":715 * * def set_masks(self, masks): * warnings.warn("Surface.set_masks is not supported.") # <<<<<<<<<<<<<< * * def get_shifts(self): */ __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_warnings); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 715, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_warn); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 715, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_tuple__16, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 715, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "pygame_sdl2/surface.pyx":714 * return (format.Rmask, format.Gmask, format.Bmask, format.Amask) * * def set_masks(self, masks): # <<<<<<<<<<<<<< * warnings.warn("Surface.set_masks is not supported.") * */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_AddTraceback("pygame_sdl2.surface.Surface.set_masks", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/surface.pyx":717 * warnings.warn("Surface.set_masks is not supported.") * * def get_shifts(self): # <<<<<<<<<<<<<< * cdef SDL_PixelFormat *format = self.surface.format * return (format.Rshift, format.Gshift, format.Bshift, format.Ashift) */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_7surface_7Surface_85get_shifts(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/ static PyObject *__pyx_pw_11pygame_sdl2_7surface_7Surface_85get_shifts(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("get_shifts (wrapper)", 0); __pyx_r = __pyx_pf_11pygame_sdl2_7surface_7Surface_84get_shifts(((struct __pyx_obj_11pygame_sdl2_7surface_Surface *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_7surface_7Surface_84get_shifts(struct __pyx_obj_11pygame_sdl2_7surface_Surface *__pyx_v_self) { SDL_PixelFormat *__pyx_v_format; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations SDL_PixelFormat *__pyx_t_1; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; PyObject *__pyx_t_5 = NULL; PyObject *__pyx_t_6 = NULL; __Pyx_RefNannySetupContext("get_shifts", 0); /* "pygame_sdl2/surface.pyx":718 * * def get_shifts(self): * cdef SDL_PixelFormat *format = self.surface.format # <<<<<<<<<<<<<< * return (format.Rshift, format.Gshift, format.Bshift, format.Ashift) * */ __pyx_t_1 = __pyx_v_self->surface->format; __pyx_v_format = __pyx_t_1; /* "pygame_sdl2/surface.pyx":719 * def get_shifts(self): * cdef SDL_PixelFormat *format = self.surface.format * return (format.Rshift, format.Gshift, format.Bshift, format.Ashift) # <<<<<<<<<<<<<< * * def set_shifts(self, shifts): */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __Pyx_PyInt_From_uint8_t(__pyx_v_format->Rshift); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 719, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = __Pyx_PyInt_From_uint8_t(__pyx_v_format->Gshift); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 719, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = __Pyx_PyInt_From_uint8_t(__pyx_v_format->Bshift); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 719, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_5 = __Pyx_PyInt_From_uint8_t(__pyx_v_format->Ashift); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 719, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_6 = PyTuple_New(4); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 719, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_GIVEREF(__pyx_t_2); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_2); __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_6, 1, __pyx_t_3); __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_6, 2, __pyx_t_4); __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_6, 3, __pyx_t_5); __pyx_t_2 = 0; __pyx_t_3 = 0; __pyx_t_4 = 0; __pyx_t_5 = 0; __pyx_r = __pyx_t_6; __pyx_t_6 = 0; goto __pyx_L0; /* "pygame_sdl2/surface.pyx":717 * warnings.warn("Surface.set_masks is not supported.") * * def get_shifts(self): # <<<<<<<<<<<<<< * cdef SDL_PixelFormat *format = self.surface.format * return (format.Rshift, format.Gshift, format.Bshift, format.Ashift) */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_5); __Pyx_XDECREF(__pyx_t_6); __Pyx_AddTraceback("pygame_sdl2.surface.Surface.get_shifts", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/surface.pyx":721 * return (format.Rshift, format.Gshift, format.Bshift, format.Ashift) * * def set_shifts(self, shifts): # <<<<<<<<<<<<<< * warnings.warn("Surface.set_shifts is not supported.") * */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_7surface_7Surface_87set_shifts(PyObject *__pyx_v_self, PyObject *__pyx_v_shifts); /*proto*/ static PyObject *__pyx_pw_11pygame_sdl2_7surface_7Surface_87set_shifts(PyObject *__pyx_v_self, PyObject *__pyx_v_shifts) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("set_shifts (wrapper)", 0); __pyx_r = __pyx_pf_11pygame_sdl2_7surface_7Surface_86set_shifts(((struct __pyx_obj_11pygame_sdl2_7surface_Surface *)__pyx_v_self), ((PyObject *)__pyx_v_shifts)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_7surface_7Surface_86set_shifts(CYTHON_UNUSED struct __pyx_obj_11pygame_sdl2_7surface_Surface *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v_shifts) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; __Pyx_RefNannySetupContext("set_shifts", 0); /* "pygame_sdl2/surface.pyx":722 * * def set_shifts(self, shifts): * warnings.warn("Surface.set_shifts is not supported.") # <<<<<<<<<<<<<< * * def get_shifts(self): */ __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_warnings); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 722, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_warn); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 722, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_tuple__17, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 722, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "pygame_sdl2/surface.pyx":721 * return (format.Rshift, format.Gshift, format.Bshift, format.Ashift) * * def set_shifts(self, shifts): # <<<<<<<<<<<<<< * warnings.warn("Surface.set_shifts is not supported.") * */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_AddTraceback("pygame_sdl2.surface.Surface.set_shifts", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/surface.pyx":724 * warnings.warn("Surface.set_shifts is not supported.") * * def get_shifts(self): # <<<<<<<<<<<<<< * cdef SDL_PixelFormat *format = self.surface.format * return (format.Rshift, format.Gshift, format.Bshift, format.Ashift) */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_7surface_7Surface_89get_shifts(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/ static PyObject *__pyx_pw_11pygame_sdl2_7surface_7Surface_89get_shifts(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("get_shifts (wrapper)", 0); __pyx_r = __pyx_pf_11pygame_sdl2_7surface_7Surface_88get_shifts(((struct __pyx_obj_11pygame_sdl2_7surface_Surface *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_7surface_7Surface_88get_shifts(struct __pyx_obj_11pygame_sdl2_7surface_Surface *__pyx_v_self) { SDL_PixelFormat *__pyx_v_format; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations SDL_PixelFormat *__pyx_t_1; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; PyObject *__pyx_t_5 = NULL; PyObject *__pyx_t_6 = NULL; __Pyx_RefNannySetupContext("get_shifts", 0); /* "pygame_sdl2/surface.pyx":725 * * def get_shifts(self): * cdef SDL_PixelFormat *format = self.surface.format # <<<<<<<<<<<<<< * return (format.Rshift, format.Gshift, format.Bshift, format.Ashift) * */ __pyx_t_1 = __pyx_v_self->surface->format; __pyx_v_format = __pyx_t_1; /* "pygame_sdl2/surface.pyx":726 * def get_shifts(self): * cdef SDL_PixelFormat *format = self.surface.format * return (format.Rshift, format.Gshift, format.Bshift, format.Ashift) # <<<<<<<<<<<<<< * * def get_losses(self): */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __Pyx_PyInt_From_uint8_t(__pyx_v_format->Rshift); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 726, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = __Pyx_PyInt_From_uint8_t(__pyx_v_format->Gshift); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 726, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = __Pyx_PyInt_From_uint8_t(__pyx_v_format->Bshift); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 726, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_5 = __Pyx_PyInt_From_uint8_t(__pyx_v_format->Ashift); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 726, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_6 = PyTuple_New(4); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 726, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_GIVEREF(__pyx_t_2); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_2); __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_6, 1, __pyx_t_3); __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_6, 2, __pyx_t_4); __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_6, 3, __pyx_t_5); __pyx_t_2 = 0; __pyx_t_3 = 0; __pyx_t_4 = 0; __pyx_t_5 = 0; __pyx_r = __pyx_t_6; __pyx_t_6 = 0; goto __pyx_L0; /* "pygame_sdl2/surface.pyx":724 * warnings.warn("Surface.set_shifts is not supported.") * * def get_shifts(self): # <<<<<<<<<<<<<< * cdef SDL_PixelFormat *format = self.surface.format * return (format.Rshift, format.Gshift, format.Bshift, format.Ashift) */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_5); __Pyx_XDECREF(__pyx_t_6); __Pyx_AddTraceback("pygame_sdl2.surface.Surface.get_shifts", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/surface.pyx":728 * return (format.Rshift, format.Gshift, format.Bshift, format.Ashift) * * def get_losses(self): # <<<<<<<<<<<<<< * cdef SDL_PixelFormat *format = self.surface.format * return (format.Rloss, format.Gloss, format.Bloss, format.Aloss) */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_7surface_7Surface_91get_losses(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/ static PyObject *__pyx_pw_11pygame_sdl2_7surface_7Surface_91get_losses(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("get_losses (wrapper)", 0); __pyx_r = __pyx_pf_11pygame_sdl2_7surface_7Surface_90get_losses(((struct __pyx_obj_11pygame_sdl2_7surface_Surface *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_7surface_7Surface_90get_losses(struct __pyx_obj_11pygame_sdl2_7surface_Surface *__pyx_v_self) { SDL_PixelFormat *__pyx_v_format; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations SDL_PixelFormat *__pyx_t_1; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; PyObject *__pyx_t_5 = NULL; PyObject *__pyx_t_6 = NULL; __Pyx_RefNannySetupContext("get_losses", 0); /* "pygame_sdl2/surface.pyx":729 * * def get_losses(self): * cdef SDL_PixelFormat *format = self.surface.format # <<<<<<<<<<<<<< * return (format.Rloss, format.Gloss, format.Bloss, format.Aloss) * */ __pyx_t_1 = __pyx_v_self->surface->format; __pyx_v_format = __pyx_t_1; /* "pygame_sdl2/surface.pyx":730 * def get_losses(self): * cdef SDL_PixelFormat *format = self.surface.format * return (format.Rloss, format.Gloss, format.Bloss, format.Aloss) # <<<<<<<<<<<<<< * * def get_bounding_rect(self, min_alpha=1): */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __Pyx_PyInt_From_uint8_t(__pyx_v_format->Rloss); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 730, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = __Pyx_PyInt_From_uint8_t(__pyx_v_format->Gloss); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 730, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = __Pyx_PyInt_From_uint8_t(__pyx_v_format->Bloss); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 730, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_5 = __Pyx_PyInt_From_uint8_t(__pyx_v_format->Aloss); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 730, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_6 = PyTuple_New(4); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 730, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_GIVEREF(__pyx_t_2); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_2); __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_6, 1, __pyx_t_3); __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_6, 2, __pyx_t_4); __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_6, 3, __pyx_t_5); __pyx_t_2 = 0; __pyx_t_3 = 0; __pyx_t_4 = 0; __pyx_t_5 = 0; __pyx_r = __pyx_t_6; __pyx_t_6 = 0; goto __pyx_L0; /* "pygame_sdl2/surface.pyx":728 * return (format.Rshift, format.Gshift, format.Bshift, format.Ashift) * * def get_losses(self): # <<<<<<<<<<<<<< * cdef SDL_PixelFormat *format = self.surface.format * return (format.Rloss, format.Gloss, format.Bloss, format.Aloss) */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_5); __Pyx_XDECREF(__pyx_t_6); __Pyx_AddTraceback("pygame_sdl2.surface.Surface.get_losses", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/surface.pyx":732 * return (format.Rloss, format.Gloss, format.Bloss, format.Aloss) * * def get_bounding_rect(self, min_alpha=1): # <<<<<<<<<<<<<< * * cdef Uint32 amask = self.surface.format.Amask */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_7surface_7Surface_93get_bounding_rect(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static PyObject *__pyx_pw_11pygame_sdl2_7surface_7Surface_93get_bounding_rect(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_min_alpha = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("get_bounding_rect (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_min_alpha,0}; PyObject* values[1] = {0}; values[0] = ((PyObject *)__pyx_int_1); if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (kw_args > 0) { PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_min_alpha); if (value) { values[0] = value; kw_args--; } } } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "get_bounding_rect") < 0)) __PYX_ERR(0, 732, __pyx_L3_error) } } else { switch (PyTuple_GET_SIZE(__pyx_args)) { case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); case 0: break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_min_alpha = values[0]; } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("get_bounding_rect", 0, 0, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 732, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("pygame_sdl2.surface.Surface.get_bounding_rect", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_11pygame_sdl2_7surface_7Surface_92get_bounding_rect(((struct __pyx_obj_11pygame_sdl2_7surface_Surface *)__pyx_v_self), __pyx_v_min_alpha); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_7surface_7Surface_92get_bounding_rect(struct __pyx_obj_11pygame_sdl2_7surface_Surface *__pyx_v_self, PyObject *__pyx_v_min_alpha) { Uint32 __pyx_v_amask; Uint32 __pyx_v_amin; int __pyx_v_x; int __pyx_v_y; int __pyx_v_w; int __pyx_v_h; int __pyx_v_minx; int __pyx_v_maxx; int __pyx_v_miny; int __pyx_v_maxy; Uint32 *__pyx_v_row; Uint32 __pyx_v_topleft; Uint32 __pyx_v_botright; Uint8 *__pyx_v_pixels; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations Uint32 __pyx_t_1; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; int __pyx_t_5; int __pyx_t_6; PyObject *__pyx_t_7 = NULL; PyObject *__pyx_t_8 = NULL; int __pyx_t_9; int __pyx_t_10; long __pyx_t_11; long __pyx_t_12; PyObject *__pyx_t_13 = NULL; PyObject *__pyx_t_14 = NULL; __Pyx_RefNannySetupContext("get_bounding_rect", 0); /* "pygame_sdl2/surface.pyx":734 * def get_bounding_rect(self, min_alpha=1): * * cdef Uint32 amask = self.surface.format.Amask # <<<<<<<<<<<<<< * cdef Uint32 amin = (0x01010101 * min_alpha) & amask * */ __pyx_t_1 = __pyx_v_self->surface->format->Amask; __pyx_v_amask = __pyx_t_1; /* "pygame_sdl2/surface.pyx":735 * * cdef Uint32 amask = self.surface.format.Amask * cdef Uint32 amin = (0x01010101 * min_alpha) & amask # <<<<<<<<<<<<<< * * cdef int x */ __pyx_t_2 = PyNumber_Multiply(__pyx_int_16843009, __pyx_v_min_alpha); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 735, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = __Pyx_PyInt_From_uint32_t(__pyx_v_amask); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 735, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = PyNumber_And(__pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 735, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_1 = __Pyx_PyInt_As_uint32_t(__pyx_t_4); if (unlikely((__pyx_t_1 == ((Uint32)-1)) && PyErr_Occurred())) __PYX_ERR(0, 735, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_v_amin = __pyx_t_1; /* "pygame_sdl2/surface.pyx":742 * cdef int h * * cdef int minx = self.surface.w - 1 # <<<<<<<<<<<<<< * cdef int maxx = 0 * cdef int miny = self.surface.h - 1 */ __pyx_v_minx = (__pyx_v_self->surface->w - 1); /* "pygame_sdl2/surface.pyx":743 * * cdef int minx = self.surface.w - 1 * cdef int maxx = 0 # <<<<<<<<<<<<<< * cdef int miny = self.surface.h - 1 * cdef int maxy = 0 */ __pyx_v_maxx = 0; /* "pygame_sdl2/surface.pyx":744 * cdef int minx = self.surface.w - 1 * cdef int maxx = 0 * cdef int miny = self.surface.h - 1 # <<<<<<<<<<<<<< * cdef int maxy = 0 * */ __pyx_v_miny = (__pyx_v_self->surface->h - 1); /* "pygame_sdl2/surface.pyx":745 * cdef int maxx = 0 * cdef int miny = self.surface.h - 1 * cdef int maxy = 0 # <<<<<<<<<<<<<< * * cdef Uint32 *row */ __pyx_v_maxy = 0; /* "pygame_sdl2/surface.pyx":752 * cdef Uint32 botright * * if (not amask) or (self.surface.w == 0) or (self.surface.h == 0): # <<<<<<<<<<<<<< * return Rect((0, 0, self.surface.w, self.surface.h)) * */ __pyx_t_6 = ((!(__pyx_v_amask != 0)) != 0); if (!__pyx_t_6) { } else { __pyx_t_5 = __pyx_t_6; goto __pyx_L4_bool_binop_done; } __pyx_t_6 = ((__pyx_v_self->surface->w == 0) != 0); if (!__pyx_t_6) { } else { __pyx_t_5 = __pyx_t_6; goto __pyx_L4_bool_binop_done; } __pyx_t_6 = ((__pyx_v_self->surface->h == 0) != 0); __pyx_t_5 = __pyx_t_6; __pyx_L4_bool_binop_done:; if (__pyx_t_5) { /* "pygame_sdl2/surface.pyx":753 * * if (not amask) or (self.surface.w == 0) or (self.surface.h == 0): * return Rect((0, 0, self.surface.w, self.surface.h)) # <<<<<<<<<<<<<< * * self.lock() */ __Pyx_XDECREF(__pyx_r); __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_Rect); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 753, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_v_self->surface->w); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 753, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_7 = __Pyx_PyInt_From_int(__pyx_v_self->surface->h); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 753, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __pyx_t_8 = PyTuple_New(4); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 753, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __Pyx_INCREF(__pyx_int_0); __Pyx_GIVEREF(__pyx_int_0); PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_int_0); __Pyx_INCREF(__pyx_int_0); __Pyx_GIVEREF(__pyx_int_0); PyTuple_SET_ITEM(__pyx_t_8, 1, __pyx_int_0); __Pyx_GIVEREF(__pyx_t_2); PyTuple_SET_ITEM(__pyx_t_8, 2, __pyx_t_2); __Pyx_GIVEREF(__pyx_t_7); PyTuple_SET_ITEM(__pyx_t_8, 3, __pyx_t_7); __pyx_t_2 = 0; __pyx_t_7 = 0; __pyx_t_7 = NULL; if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) { __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_3); if (likely(__pyx_t_7)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); __Pyx_INCREF(__pyx_t_7); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_3, function); } } if (!__pyx_t_7) { __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_8); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 753, __pyx_L1_error) __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; __Pyx_GOTREF(__pyx_t_4); } else { #if CYTHON_FAST_PYCALL if (PyFunction_Check(__pyx_t_3)) { PyObject *__pyx_temp[2] = {__pyx_t_7, __pyx_t_8}; __pyx_t_4 = __Pyx_PyFunction_FastCall(__pyx_t_3, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 753, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; } else #endif #if CYTHON_FAST_PYCCALL if (__Pyx_PyFastCFunction_Check(__pyx_t_3)) { PyObject *__pyx_temp[2] = {__pyx_t_7, __pyx_t_8}; __pyx_t_4 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 753, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; } else #endif { __pyx_t_2 = PyTuple_New(1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 753, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_GIVEREF(__pyx_t_7); PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_7); __pyx_t_7 = NULL; __Pyx_GIVEREF(__pyx_t_8); PyTuple_SET_ITEM(__pyx_t_2, 0+1, __pyx_t_8); __pyx_t_8 = 0; __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_2, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 753, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } } __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_r = __pyx_t_4; __pyx_t_4 = 0; goto __pyx_L0; /* "pygame_sdl2/surface.pyx":752 * cdef Uint32 botright * * if (not amask) or (self.surface.w == 0) or (self.surface.h == 0): # <<<<<<<<<<<<<< * return Rect((0, 0, self.surface.w, self.surface.h)) * */ } /* "pygame_sdl2/surface.pyx":755 * return Rect((0, 0, self.surface.w, self.surface.h)) * * self.lock() # <<<<<<<<<<<<<< * * cdef Uint8 *pixels = self.surface.pixels */ __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_lock); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 755, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_2 = NULL; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) { __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_3); if (likely(__pyx_t_2)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); __Pyx_INCREF(__pyx_t_2); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_3, function); } } if (__pyx_t_2) { __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 755, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } else { __pyx_t_4 = __Pyx_PyObject_CallNoArg(__pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 755, __pyx_L1_error) } __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; /* "pygame_sdl2/surface.pyx":757 * self.lock() * * cdef Uint8 *pixels = self.surface.pixels # <<<<<<<<<<<<<< * * with nogil: */ __pyx_v_pixels = ((Uint8 *)__pyx_v_self->surface->pixels); /* "pygame_sdl2/surface.pyx":759 * cdef Uint8 *pixels = self.surface.pixels * * with nogil: # <<<<<<<<<<<<<< * * topleft = ( pixels)[0] */ { #ifdef WITH_THREAD PyThreadState *_save; Py_UNBLOCK_THREADS #endif /*try:*/ { /* "pygame_sdl2/surface.pyx":761 * with nogil: * * topleft = ( pixels)[0] # <<<<<<<<<<<<<< * botright = ( (pixels + self.surface.pitch * (self.surface.h - 1)))[self.surface.w - 1] * */ __pyx_v_topleft = (((Uint32 *)__pyx_v_pixels)[0]); /* "pygame_sdl2/surface.pyx":762 * * topleft = ( pixels)[0] * botright = ( (pixels + self.surface.pitch * (self.surface.h - 1)))[self.surface.w - 1] # <<<<<<<<<<<<<< * * if ((topleft & amask) > amin) and ((botright & amask) > amin): */ __pyx_v_botright = (((Uint32 *)(__pyx_v_pixels + (__pyx_v_self->surface->pitch * (__pyx_v_self->surface->h - 1))))[(__pyx_v_self->surface->w - 1)]); /* "pygame_sdl2/surface.pyx":764 * botright = ( (pixels + self.surface.pitch * (self.surface.h - 1)))[self.surface.w - 1] * * if ((topleft & amask) > amin) and ((botright & amask) > amin): # <<<<<<<<<<<<<< * * # Bounding box covers image. */ __pyx_t_6 = (((__pyx_v_topleft & __pyx_v_amask) > __pyx_v_amin) != 0); if (__pyx_t_6) { } else { __pyx_t_5 = __pyx_t_6; goto __pyx_L11_bool_binop_done; } __pyx_t_6 = (((__pyx_v_botright & __pyx_v_amask) > __pyx_v_amin) != 0); __pyx_t_5 = __pyx_t_6; __pyx_L11_bool_binop_done:; if (__pyx_t_5) { /* "pygame_sdl2/surface.pyx":768 * # Bounding box covers image. * * minx = 0 # <<<<<<<<<<<<<< * miny = 0 * maxx = self.surface.w - 1 */ __pyx_v_minx = 0; /* "pygame_sdl2/surface.pyx":769 * * minx = 0 * miny = 0 # <<<<<<<<<<<<<< * maxx = self.surface.w - 1 * maxy = self.surface.h - 1 */ __pyx_v_miny = 0; /* "pygame_sdl2/surface.pyx":770 * minx = 0 * miny = 0 * maxx = self.surface.w - 1 # <<<<<<<<<<<<<< * maxy = self.surface.h - 1 * */ __pyx_v_maxx = (__pyx_v_self->surface->w - 1); /* "pygame_sdl2/surface.pyx":771 * miny = 0 * maxx = self.surface.w - 1 * maxy = self.surface.h - 1 # <<<<<<<<<<<<<< * * else: */ __pyx_v_maxy = (__pyx_v_self->surface->h - 1); /* "pygame_sdl2/surface.pyx":764 * botright = ( (pixels + self.surface.pitch * (self.surface.h - 1)))[self.surface.w - 1] * * if ((topleft & amask) > amin) and ((botright & amask) > amin): # <<<<<<<<<<<<<< * * # Bounding box covers image. */ goto __pyx_L10; } /* "pygame_sdl2/surface.pyx":777 * # Bounding box is smaller than image. * * for 0 <= y < self.surface.h: # <<<<<<<<<<<<<< * row = (pixels + self.surface.pitch * y) * */ /*else*/ { __pyx_t_9 = __pyx_v_self->surface->h; for (__pyx_v_y = 0; __pyx_v_y < __pyx_t_9; __pyx_v_y++) { /* "pygame_sdl2/surface.pyx":778 * * for 0 <= y < self.surface.h: * row = (pixels + self.surface.pitch * y) # <<<<<<<<<<<<<< * * for 0 <= x < self.surface.w: */ __pyx_v_row = ((Uint32 *)(__pyx_v_pixels + (__pyx_v_self->surface->pitch * __pyx_v_y))); /* "pygame_sdl2/surface.pyx":780 * row = (pixels + self.surface.pitch * y) * * for 0 <= x < self.surface.w: # <<<<<<<<<<<<<< * * if (row[x] & amask) >= amin: */ __pyx_t_10 = __pyx_v_self->surface->w; for (__pyx_v_x = 0; __pyx_v_x < __pyx_t_10; __pyx_v_x++) { /* "pygame_sdl2/surface.pyx":782 * for 0 <= x < self.surface.w: * * if (row[x] & amask) >= amin: # <<<<<<<<<<<<<< * * if minx > x: */ __pyx_t_5 = ((((__pyx_v_row[__pyx_v_x]) & __pyx_v_amask) >= __pyx_v_amin) != 0); if (__pyx_t_5) { /* "pygame_sdl2/surface.pyx":784 * if (row[x] & amask) >= amin: * * if minx > x: # <<<<<<<<<<<<<< * minx = x * if miny > y: */ __pyx_t_5 = ((__pyx_v_minx > __pyx_v_x) != 0); if (__pyx_t_5) { /* "pygame_sdl2/surface.pyx":785 * * if minx > x: * minx = x # <<<<<<<<<<<<<< * if miny > y: * miny = y */ __pyx_v_minx = __pyx_v_x; /* "pygame_sdl2/surface.pyx":784 * if (row[x] & amask) >= amin: * * if minx > x: # <<<<<<<<<<<<<< * minx = x * if miny > y: */ } /* "pygame_sdl2/surface.pyx":786 * if minx > x: * minx = x * if miny > y: # <<<<<<<<<<<<<< * miny = y * if maxx < x: */ __pyx_t_5 = ((__pyx_v_miny > __pyx_v_y) != 0); if (__pyx_t_5) { /* "pygame_sdl2/surface.pyx":787 * minx = x * if miny > y: * miny = y # <<<<<<<<<<<<<< * if maxx < x: * maxx = x */ __pyx_v_miny = __pyx_v_y; /* "pygame_sdl2/surface.pyx":786 * if minx > x: * minx = x * if miny > y: # <<<<<<<<<<<<<< * miny = y * if maxx < x: */ } /* "pygame_sdl2/surface.pyx":788 * if miny > y: * miny = y * if maxx < x: # <<<<<<<<<<<<<< * maxx = x * if maxy < y: */ __pyx_t_5 = ((__pyx_v_maxx < __pyx_v_x) != 0); if (__pyx_t_5) { /* "pygame_sdl2/surface.pyx":789 * miny = y * if maxx < x: * maxx = x # <<<<<<<<<<<<<< * if maxy < y: * maxy = y */ __pyx_v_maxx = __pyx_v_x; /* "pygame_sdl2/surface.pyx":788 * if miny > y: * miny = y * if maxx < x: # <<<<<<<<<<<<<< * maxx = x * if maxy < y: */ } /* "pygame_sdl2/surface.pyx":790 * if maxx < x: * maxx = x * if maxy < y: # <<<<<<<<<<<<<< * maxy = y * */ __pyx_t_5 = ((__pyx_v_maxy < __pyx_v_y) != 0); if (__pyx_t_5) { /* "pygame_sdl2/surface.pyx":791 * maxx = x * if maxy < y: * maxy = y # <<<<<<<<<<<<<< * * self.unlock() */ __pyx_v_maxy = __pyx_v_y; /* "pygame_sdl2/surface.pyx":790 * if maxx < x: * maxx = x * if maxy < y: # <<<<<<<<<<<<<< * maxy = y * */ } /* "pygame_sdl2/surface.pyx":782 * for 0 <= x < self.surface.w: * * if (row[x] & amask) >= amin: # <<<<<<<<<<<<<< * * if minx > x: */ } } } } __pyx_L10:; } /* "pygame_sdl2/surface.pyx":759 * cdef Uint8 *pixels = self.surface.pixels * * with nogil: # <<<<<<<<<<<<<< * * topleft = ( pixels)[0] */ /*finally:*/ { /*normal exit:*/{ #ifdef WITH_THREAD Py_BLOCK_THREADS #endif goto __pyx_L9; } __pyx_L9:; } } /* "pygame_sdl2/surface.pyx":793 * maxy = y * * self.unlock() # <<<<<<<<<<<<<< * * # Totally empty surface. */ __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_unlock); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 793, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_2 = NULL; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) { __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_3); if (likely(__pyx_t_2)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); __Pyx_INCREF(__pyx_t_2); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_3, function); } } if (__pyx_t_2) { __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 793, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } else { __pyx_t_4 = __Pyx_PyObject_CallNoArg(__pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 793, __pyx_L1_error) } __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; /* "pygame_sdl2/surface.pyx":796 * * # Totally empty surface. * if minx > maxx: # <<<<<<<<<<<<<< * return Rect((0, 0, 0, 0)) * */ __pyx_t_5 = ((__pyx_v_minx > __pyx_v_maxx) != 0); if (__pyx_t_5) { /* "pygame_sdl2/surface.pyx":797 * # Totally empty surface. * if minx > maxx: * return Rect((0, 0, 0, 0)) # <<<<<<<<<<<<<< * * x = minx */ __Pyx_XDECREF(__pyx_r); __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_Rect); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 797, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_tuple__19, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 797, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_r = __pyx_t_3; __pyx_t_3 = 0; goto __pyx_L0; /* "pygame_sdl2/surface.pyx":796 * * # Totally empty surface. * if minx > maxx: # <<<<<<<<<<<<<< * return Rect((0, 0, 0, 0)) * */ } /* "pygame_sdl2/surface.pyx":799 * return Rect((0, 0, 0, 0)) * * x = minx # <<<<<<<<<<<<<< * y = miny * w = min(maxx - minx + 1, self.surface.w - x) */ __pyx_v_x = __pyx_v_minx; /* "pygame_sdl2/surface.pyx":800 * * x = minx * y = miny # <<<<<<<<<<<<<< * w = min(maxx - minx + 1, self.surface.w - x) * h = min(maxy - miny + 1, self.surface.h - y) */ __pyx_v_y = __pyx_v_miny; /* "pygame_sdl2/surface.pyx":801 * x = minx * y = miny * w = min(maxx - minx + 1, self.surface.w - x) # <<<<<<<<<<<<<< * h = min(maxy - miny + 1, self.surface.h - y) * */ __pyx_t_9 = (__pyx_v_self->surface->w - __pyx_v_x); __pyx_t_11 = ((__pyx_v_maxx - __pyx_v_minx) + 1); if (((__pyx_t_9 < __pyx_t_11) != 0)) { __pyx_t_12 = __pyx_t_9; } else { __pyx_t_12 = __pyx_t_11; } __pyx_v_w = __pyx_t_12; /* "pygame_sdl2/surface.pyx":802 * y = miny * w = min(maxx - minx + 1, self.surface.w - x) * h = min(maxy - miny + 1, self.surface.h - y) # <<<<<<<<<<<<<< * * return Rect((x, y, w, h)) */ __pyx_t_9 = (__pyx_v_self->surface->h - __pyx_v_y); __pyx_t_12 = ((__pyx_v_maxy - __pyx_v_miny) + 1); if (((__pyx_t_9 < __pyx_t_12) != 0)) { __pyx_t_11 = __pyx_t_9; } else { __pyx_t_11 = __pyx_t_12; } __pyx_v_h = __pyx_t_11; /* "pygame_sdl2/surface.pyx":804 * h = min(maxy - miny + 1, self.surface.h - y) * * return Rect((x, y, w, h)) # <<<<<<<<<<<<<< * * def get_view(self, kind='2'): */ __Pyx_XDECREF(__pyx_r); __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_Rect); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 804, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_v_x); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 804, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_8 = __Pyx_PyInt_From_int(__pyx_v_y); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 804, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __pyx_t_7 = __Pyx_PyInt_From_int(__pyx_v_w); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 804, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __pyx_t_13 = __Pyx_PyInt_From_int(__pyx_v_h); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 804, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_13); __pyx_t_14 = PyTuple_New(4); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 804, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_14); __Pyx_GIVEREF(__pyx_t_2); PyTuple_SET_ITEM(__pyx_t_14, 0, __pyx_t_2); __Pyx_GIVEREF(__pyx_t_8); PyTuple_SET_ITEM(__pyx_t_14, 1, __pyx_t_8); __Pyx_GIVEREF(__pyx_t_7); PyTuple_SET_ITEM(__pyx_t_14, 2, __pyx_t_7); __Pyx_GIVEREF(__pyx_t_13); PyTuple_SET_ITEM(__pyx_t_14, 3, __pyx_t_13); __pyx_t_2 = 0; __pyx_t_8 = 0; __pyx_t_7 = 0; __pyx_t_13 = 0; __pyx_t_13 = NULL; if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_4))) { __pyx_t_13 = PyMethod_GET_SELF(__pyx_t_4); if (likely(__pyx_t_13)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4); __Pyx_INCREF(__pyx_t_13); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_4, function); } } if (!__pyx_t_13) { __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_14); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 804, __pyx_L1_error) __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0; __Pyx_GOTREF(__pyx_t_3); } else { #if CYTHON_FAST_PYCALL if (PyFunction_Check(__pyx_t_4)) { PyObject *__pyx_temp[2] = {__pyx_t_13, __pyx_t_14}; __pyx_t_3 = __Pyx_PyFunction_FastCall(__pyx_t_4, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 804, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0; __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0; } else #endif #if CYTHON_FAST_PYCCALL if (__Pyx_PyFastCFunction_Check(__pyx_t_4)) { PyObject *__pyx_temp[2] = {__pyx_t_13, __pyx_t_14}; __pyx_t_3 = __Pyx_PyCFunction_FastCall(__pyx_t_4, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 804, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0; __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0; } else #endif { __pyx_t_7 = PyTuple_New(1+1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 804, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_GIVEREF(__pyx_t_13); PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_13); __pyx_t_13 = NULL; __Pyx_GIVEREF(__pyx_t_14); PyTuple_SET_ITEM(__pyx_t_7, 0+1, __pyx_t_14); __pyx_t_14 = 0; __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_7, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 804, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; } } __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_r = __pyx_t_3; __pyx_t_3 = 0; goto __pyx_L0; /* "pygame_sdl2/surface.pyx":732 * return (format.Rloss, format.Gloss, format.Bloss, format.Aloss) * * def get_bounding_rect(self, min_alpha=1): # <<<<<<<<<<<<<< * * cdef Uint32 amask = self.surface.format.Amask */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_7); __Pyx_XDECREF(__pyx_t_8); __Pyx_XDECREF(__pyx_t_13); __Pyx_XDECREF(__pyx_t_14); __Pyx_AddTraceback("pygame_sdl2.surface.Surface.get_bounding_rect", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/surface.pyx":806 * return Rect((x, y, w, h)) * * def get_view(self, kind='2'): # <<<<<<<<<<<<<< * raise error("Surface.get_view is not supported.") * */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_7surface_7Surface_95get_view(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static PyObject *__pyx_pw_11pygame_sdl2_7surface_7Surface_95get_view(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { CYTHON_UNUSED PyObject *__pyx_v_kind = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("get_view (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_kind,0}; PyObject* values[1] = {0}; values[0] = ((PyObject *)__pyx_kp_u_2); if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (kw_args > 0) { PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_kind); if (value) { values[0] = value; kw_args--; } } } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "get_view") < 0)) __PYX_ERR(0, 806, __pyx_L3_error) } } else { switch (PyTuple_GET_SIZE(__pyx_args)) { case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); case 0: break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_kind = values[0]; } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("get_view", 0, 0, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 806, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("pygame_sdl2.surface.Surface.get_view", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_11pygame_sdl2_7surface_7Surface_94get_view(((struct __pyx_obj_11pygame_sdl2_7surface_Surface *)__pyx_v_self), __pyx_v_kind); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_7surface_7Surface_94get_view(CYTHON_UNUSED struct __pyx_obj_11pygame_sdl2_7surface_Surface *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v_kind) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; __Pyx_RefNannySetupContext("get_view", 0); /* "pygame_sdl2/surface.pyx":807 * * def get_view(self, kind='2'): * raise error("Surface.get_view is not supported.") # <<<<<<<<<<<<<< * * def get_buffer(self): */ __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_error); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 807, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_tuple__20, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 807, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_Raise(__pyx_t_2, 0, 0, 0); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __PYX_ERR(0, 807, __pyx_L1_error) /* "pygame_sdl2/surface.pyx":806 * return Rect((x, y, w, h)) * * def get_view(self, kind='2'): # <<<<<<<<<<<<<< * raise error("Surface.get_view is not supported.") * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_AddTraceback("pygame_sdl2.surface.Surface.get_view", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/surface.pyx":809 * raise error("Surface.get_view is not supported.") * * def get_buffer(self): # <<<<<<<<<<<<<< * cdef Uint8 *pixels = self.surface.pixels * return pixels[self.surface.h * self.surface.pitch] */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_7surface_7Surface_97get_buffer(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/ static PyObject *__pyx_pw_11pygame_sdl2_7surface_7Surface_97get_buffer(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("get_buffer (wrapper)", 0); __pyx_r = __pyx_pf_11pygame_sdl2_7surface_7Surface_96get_buffer(((struct __pyx_obj_11pygame_sdl2_7surface_Surface *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_7surface_7Surface_96get_buffer(struct __pyx_obj_11pygame_sdl2_7surface_Surface *__pyx_v_self) { Uint8 *__pyx_v_pixels; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; __Pyx_RefNannySetupContext("get_buffer", 0); /* "pygame_sdl2/surface.pyx":810 * * def get_buffer(self): * cdef Uint8 *pixels = self.surface.pixels # <<<<<<<<<<<<<< * return pixels[self.surface.h * self.surface.pitch] * */ __pyx_v_pixels = ((Uint8 *)__pyx_v_self->surface->pixels); /* "pygame_sdl2/surface.pyx":811 * def get_buffer(self): * cdef Uint8 *pixels = self.surface.pixels * return pixels[self.surface.h * self.surface.pitch] # <<<<<<<<<<<<<< * * property _pixels_address: */ __Pyx_XDECREF(__pyx_r); __pyx_t_1 = __Pyx_PyInt_From_uint8_t((__pyx_v_pixels[(__pyx_v_self->surface->h * __pyx_v_self->surface->pitch)])); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 811, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "pygame_sdl2/surface.pyx":809 * raise error("Surface.get_view is not supported.") * * def get_buffer(self): # <<<<<<<<<<<<<< * cdef Uint8 *pixels = self.surface.pixels * return pixels[self.surface.h * self.surface.pitch] */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("pygame_sdl2.surface.Surface.get_buffer", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/surface.pyx":814 * * property _pixels_address: * def __get__(self): # <<<<<<<<<<<<<< * return self.surface.pixels * */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_7surface_7Surface_15_pixels_address_1__get__(PyObject *__pyx_v_self); /*proto*/ static PyObject *__pyx_pw_11pygame_sdl2_7surface_7Surface_15_pixels_address_1__get__(PyObject *__pyx_v_self) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); __pyx_r = __pyx_pf_11pygame_sdl2_7surface_7Surface_15_pixels_address___get__(((struct __pyx_obj_11pygame_sdl2_7surface_Surface *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_7surface_7Surface_15_pixels_address___get__(struct __pyx_obj_11pygame_sdl2_7surface_Surface *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; __Pyx_RefNannySetupContext("__get__", 0); /* "pygame_sdl2/surface.pyx":815 * property _pixels_address: * def __get__(self): * return self.surface.pixels # <<<<<<<<<<<<<< * * */ __Pyx_XDECREF(__pyx_r); __pyx_t_1 = __Pyx_PyInt_From_uint64_t(((Uint64)__pyx_v_self->surface->pixels)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 815, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "pygame_sdl2/surface.pyx":814 * * property _pixels_address: * def __get__(self): # <<<<<<<<<<<<<< * return self.surface.pixels * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("pygame_sdl2.surface.Surface._pixels_address.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/surface.pyx":818 * * * cdef api SDL_Surface *PySurface_AsSurface(surface): # <<<<<<<<<<<<<< * return ( surface).surface * */ static SDL_Surface *__pyx_f_11pygame_sdl2_7surface_PySurface_AsSurface(PyObject *__pyx_v_surface) { SDL_Surface *__pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("PySurface_AsSurface", 0); /* "pygame_sdl2/surface.pyx":819 * * cdef api SDL_Surface *PySurface_AsSurface(surface): * return ( surface).surface # <<<<<<<<<<<<<< * * cdef api object PySurface_New(SDL_Surface *surf): */ __pyx_r = ((struct __pyx_obj_11pygame_sdl2_7surface_Surface *)__pyx_v_surface)->surface; goto __pyx_L0; /* "pygame_sdl2/surface.pyx":818 * * * cdef api SDL_Surface *PySurface_AsSurface(surface): # <<<<<<<<<<<<<< * return ( surface).surface * */ /* function exit code */ __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/surface.pyx":821 * return ( surface).surface * * cdef api object PySurface_New(SDL_Surface *surf): # <<<<<<<<<<<<<< * cdef Surface rv = Surface(()) * rv.take_surface(surf) */ static PyObject *__pyx_f_11pygame_sdl2_7surface_PySurface_New(SDL_Surface *__pyx_v_surf) { struct __pyx_obj_11pygame_sdl2_7surface_Surface *__pyx_v_rv = 0; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; __Pyx_RefNannySetupContext("PySurface_New", 0); /* "pygame_sdl2/surface.pyx":822 * * cdef api object PySurface_New(SDL_Surface *surf): * cdef Surface rv = Surface(()) # <<<<<<<<<<<<<< * rv.take_surface(surf) * return rv */ __pyx_t_1 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_11pygame_sdl2_7surface_Surface), __pyx_tuple__21, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 822, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_rv = ((struct __pyx_obj_11pygame_sdl2_7surface_Surface *)__pyx_t_1); __pyx_t_1 = 0; /* "pygame_sdl2/surface.pyx":823 * cdef api object PySurface_New(SDL_Surface *surf): * cdef Surface rv = Surface(()) * rv.take_surface(surf) # <<<<<<<<<<<<<< * return rv */ ((struct __pyx_vtabstruct_11pygame_sdl2_7surface_Surface *)__pyx_v_rv->__pyx_vtab)->take_surface(__pyx_v_rv, __pyx_v_surf); /* "pygame_sdl2/surface.pyx":824 * cdef Surface rv = Surface(()) * rv.take_surface(surf) * return rv # <<<<<<<<<<<<<< */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(((PyObject *)__pyx_v_rv)); __pyx_r = ((PyObject *)__pyx_v_rv); goto __pyx_L0; /* "pygame_sdl2/surface.pyx":821 * return ( surface).surface * * cdef api object PySurface_New(SDL_Surface *surf): # <<<<<<<<<<<<<< * cdef Surface rv = Surface(()) * rv.take_surface(surf) */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("pygame_sdl2.surface.PySurface_New", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XDECREF((PyObject *)__pyx_v_rv); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } static struct __pyx_vtabstruct_11pygame_sdl2_7surface_Surface __pyx_vtable_11pygame_sdl2_7surface_Surface; static PyObject *__pyx_tp_new_11pygame_sdl2_7surface_Surface(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) { struct __pyx_obj_11pygame_sdl2_7surface_Surface *p; PyObject *o; if (likely((t->tp_flags & Py_TPFLAGS_IS_ABSTRACT) == 0)) { o = (*t->tp_alloc)(t, 0); } else { o = (PyObject *) PyBaseObject_Type.tp_new(t, __pyx_empty_tuple, 0); } if (unlikely(!o)) return 0; p = ((struct __pyx_obj_11pygame_sdl2_7surface_Surface *)o); p->__pyx_vtab = __pyx_vtabptr_11pygame_sdl2_7surface_Surface; p->locklist = Py_None; Py_INCREF(Py_None); p->parent = ((struct __pyx_obj_11pygame_sdl2_7surface_Surface *)Py_None); Py_INCREF(Py_None); p->root = ((struct __pyx_obj_11pygame_sdl2_7surface_Surface *)Py_None); Py_INCREF(Py_None); p->get_window_flags = Py_None; Py_INCREF(Py_None); if (unlikely(__pyx_pw_11pygame_sdl2_7surface_7Surface_1__cinit__(o, __pyx_empty_tuple, NULL) < 0)) goto bad; return o; bad: Py_DECREF(o); o = 0; return NULL; } static void __pyx_tp_dealloc_11pygame_sdl2_7surface_Surface(PyObject *o) { struct __pyx_obj_11pygame_sdl2_7surface_Surface *p = (struct __pyx_obj_11pygame_sdl2_7surface_Surface *)o; #if PY_VERSION_HEX >= 0x030400a1 if (unlikely(Py_TYPE(o)->tp_finalize) && !_PyGC_FINALIZED(o)) { if (PyObject_CallFinalizerFromDealloc(o)) return; } #endif PyObject_GC_UnTrack(o); { PyObject *etype, *eval, *etb; PyErr_Fetch(&etype, &eval, &etb); ++Py_REFCNT(o); __pyx_pw_11pygame_sdl2_7surface_7Surface_3__dealloc__(o); --Py_REFCNT(o); PyErr_Restore(etype, eval, etb); } if (p->__weakref__) PyObject_ClearWeakRefs(o); Py_CLEAR(p->locklist); Py_CLEAR(p->parent); Py_CLEAR(p->root); Py_CLEAR(p->get_window_flags); (*Py_TYPE(o)->tp_free)(o); } static int __pyx_tp_traverse_11pygame_sdl2_7surface_Surface(PyObject *o, visitproc v, void *a) { int e; struct __pyx_obj_11pygame_sdl2_7surface_Surface *p = (struct __pyx_obj_11pygame_sdl2_7surface_Surface *)o; if (p->locklist) { e = (*v)(p->locklist, a); if (e) return e; } if (p->parent) { e = (*v)(((PyObject*)p->parent), a); if (e) return e; } if (p->root) { e = (*v)(((PyObject*)p->root), a); if (e) return e; } if (p->get_window_flags) { e = (*v)(p->get_window_flags, a); if (e) return e; } return 0; } static int __pyx_tp_clear_11pygame_sdl2_7surface_Surface(PyObject *o) { PyObject* tmp; struct __pyx_obj_11pygame_sdl2_7surface_Surface *p = (struct __pyx_obj_11pygame_sdl2_7surface_Surface *)o; tmp = ((PyObject*)p->locklist); p->locklist = Py_None; Py_INCREF(Py_None); Py_XDECREF(tmp); tmp = ((PyObject*)p->parent); p->parent = ((struct __pyx_obj_11pygame_sdl2_7surface_Surface *)Py_None); Py_INCREF(Py_None); Py_XDECREF(tmp); tmp = ((PyObject*)p->root); p->root = ((struct __pyx_obj_11pygame_sdl2_7surface_Surface *)Py_None); Py_INCREF(Py_None); Py_XDECREF(tmp); tmp = ((PyObject*)p->get_window_flags); p->get_window_flags = Py_None; Py_INCREF(Py_None); Py_XDECREF(tmp); return 0; } static PyObject *__pyx_getprop_11pygame_sdl2_7surface_7Surface__pixels_address(PyObject *o, CYTHON_UNUSED void *x) { return __pyx_pw_11pygame_sdl2_7surface_7Surface_15_pixels_address_1__get__(o); } static PyMethodDef __pyx_methods_11pygame_sdl2_7surface_Surface[] = { {"__sizeof__", (PyCFunction)__pyx_pw_11pygame_sdl2_7surface_7Surface_5__sizeof__, METH_NOARGS, 0}, {"blit", (PyCFunction)__pyx_pw_11pygame_sdl2_7surface_7Surface_11blit, METH_VARARGS|METH_KEYWORDS, 0}, {"convert", (PyCFunction)__pyx_pw_11pygame_sdl2_7surface_7Surface_13convert, METH_VARARGS|METH_KEYWORDS, 0}, {"convert_alpha", (PyCFunction)__pyx_pw_11pygame_sdl2_7surface_7Surface_15convert_alpha, METH_VARARGS|METH_KEYWORDS, 0}, {"copy", (PyCFunction)__pyx_pw_11pygame_sdl2_7surface_7Surface_17copy, METH_NOARGS, 0}, {"fill", (PyCFunction)__pyx_pw_11pygame_sdl2_7surface_7Surface_19fill, METH_VARARGS|METH_KEYWORDS, 0}, {"scroll", (PyCFunction)__pyx_pw_11pygame_sdl2_7surface_7Surface_21scroll, METH_VARARGS|METH_KEYWORDS, 0}, {"set_colorkey", (PyCFunction)__pyx_pw_11pygame_sdl2_7surface_7Surface_23set_colorkey, METH_VARARGS|METH_KEYWORDS, 0}, {"get_colorkey", (PyCFunction)__pyx_pw_11pygame_sdl2_7surface_7Surface_25get_colorkey, METH_NOARGS, 0}, {"set_alpha", (PyCFunction)__pyx_pw_11pygame_sdl2_7surface_7Surface_27set_alpha, METH_VARARGS|METH_KEYWORDS, 0}, {"get_alpha", (PyCFunction)__pyx_pw_11pygame_sdl2_7surface_7Surface_29get_alpha, METH_NOARGS, 0}, {"lock", (PyCFunction)__pyx_pw_11pygame_sdl2_7surface_7Surface_31lock, METH_VARARGS|METH_KEYWORDS, 0}, {"unlock", (PyCFunction)__pyx_pw_11pygame_sdl2_7surface_7Surface_33unlock, METH_VARARGS|METH_KEYWORDS, 0}, {"mustlock", (PyCFunction)__pyx_pw_11pygame_sdl2_7surface_7Surface_35mustlock, METH_NOARGS, 0}, {"get_locked", (PyCFunction)__pyx_pw_11pygame_sdl2_7surface_7Surface_37get_locked, METH_NOARGS, 0}, {"get_locks", (PyCFunction)__pyx_pw_11pygame_sdl2_7surface_7Surface_39get_locks, METH_NOARGS, 0}, {"get_at", (PyCFunction)__pyx_pw_11pygame_sdl2_7surface_7Surface_41get_at, METH_O, 0}, {"set_at", (PyCFunction)__pyx_pw_11pygame_sdl2_7surface_7Surface_43set_at, METH_VARARGS|METH_KEYWORDS, 0}, {"get_at_mapped", (PyCFunction)__pyx_pw_11pygame_sdl2_7surface_7Surface_45get_at_mapped, METH_O, 0}, {"map_rgb", (PyCFunction)__pyx_pw_11pygame_sdl2_7surface_7Surface_47map_rgb, METH_O, 0}, {"unmap_rgb", (PyCFunction)__pyx_pw_11pygame_sdl2_7surface_7Surface_49unmap_rgb, METH_O, 0}, {"set_clip", (PyCFunction)__pyx_pw_11pygame_sdl2_7surface_7Surface_51set_clip, METH_O, 0}, {"get_clip", (PyCFunction)__pyx_pw_11pygame_sdl2_7surface_7Surface_53get_clip, METH_NOARGS, 0}, {"subsurface", (PyCFunction)__pyx_pw_11pygame_sdl2_7surface_7Surface_55subsurface, METH_VARARGS|METH_KEYWORDS, 0}, {"get_parent", (PyCFunction)__pyx_pw_11pygame_sdl2_7surface_7Surface_57get_parent, METH_NOARGS, 0}, {"get_abs_parent", (PyCFunction)__pyx_pw_11pygame_sdl2_7surface_7Surface_59get_abs_parent, METH_NOARGS, 0}, {"get_offset", (PyCFunction)__pyx_pw_11pygame_sdl2_7surface_7Surface_61get_offset, METH_NOARGS, 0}, {"get_abs_offset", (PyCFunction)__pyx_pw_11pygame_sdl2_7surface_7Surface_63get_abs_offset, METH_NOARGS, 0}, {"get_size", (PyCFunction)__pyx_pw_11pygame_sdl2_7surface_7Surface_65get_size, METH_NOARGS, 0}, {"get_width", (PyCFunction)__pyx_pw_11pygame_sdl2_7surface_7Surface_67get_width, METH_NOARGS, 0}, {"get_height", (PyCFunction)__pyx_pw_11pygame_sdl2_7surface_7Surface_69get_height, METH_NOARGS, 0}, {"get_rect", (PyCFunction)__pyx_pw_11pygame_sdl2_7surface_7Surface_71get_rect, METH_VARARGS|METH_KEYWORDS, 0}, {"get_bitsize", (PyCFunction)__pyx_pw_11pygame_sdl2_7surface_7Surface_73get_bitsize, METH_NOARGS, 0}, {"get_bytesize", (PyCFunction)__pyx_pw_11pygame_sdl2_7surface_7Surface_75get_bytesize, METH_NOARGS, 0}, {"get_flags", (PyCFunction)__pyx_pw_11pygame_sdl2_7surface_7Surface_77get_flags, METH_NOARGS, 0}, {"get_pitch", (PyCFunction)__pyx_pw_11pygame_sdl2_7surface_7Surface_79get_pitch, METH_NOARGS, 0}, {"get_masks", (PyCFunction)__pyx_pw_11pygame_sdl2_7surface_7Surface_81get_masks, METH_NOARGS, 0}, {"set_masks", (PyCFunction)__pyx_pw_11pygame_sdl2_7surface_7Surface_83set_masks, METH_O, 0}, {"get_shifts", (PyCFunction)__pyx_pw_11pygame_sdl2_7surface_7Surface_85get_shifts, METH_NOARGS, 0}, {"set_shifts", (PyCFunction)__pyx_pw_11pygame_sdl2_7surface_7Surface_87set_shifts, METH_O, 0}, {"get_shifts", (PyCFunction)__pyx_pw_11pygame_sdl2_7surface_7Surface_89get_shifts, METH_NOARGS, 0}, {"get_losses", (PyCFunction)__pyx_pw_11pygame_sdl2_7surface_7Surface_91get_losses, METH_NOARGS, 0}, {"get_bounding_rect", (PyCFunction)__pyx_pw_11pygame_sdl2_7surface_7Surface_93get_bounding_rect, METH_VARARGS|METH_KEYWORDS, 0}, {"get_view", (PyCFunction)__pyx_pw_11pygame_sdl2_7surface_7Surface_95get_view, METH_VARARGS|METH_KEYWORDS, 0}, {"get_buffer", (PyCFunction)__pyx_pw_11pygame_sdl2_7surface_7Surface_97get_buffer, METH_NOARGS, 0}, {0, 0, 0, 0} }; static struct PyGetSetDef __pyx_getsets_11pygame_sdl2_7surface_Surface[] = { {(char *)"_pixels_address", __pyx_getprop_11pygame_sdl2_7surface_7Surface__pixels_address, 0, (char *)0, 0}, {0, 0, 0, 0, 0} }; static PyTypeObject __pyx_type_11pygame_sdl2_7surface_Surface = { PyVarObject_HEAD_INIT(0, 0) "pygame_sdl2.surface.Surface", /*tp_name*/ sizeof(struct __pyx_obj_11pygame_sdl2_7surface_Surface), /*tp_basicsize*/ 0, /*tp_itemsize*/ __pyx_tp_dealloc_11pygame_sdl2_7surface_Surface, /*tp_dealloc*/ 0, /*tp_print*/ 0, /*tp_getattr*/ 0, /*tp_setattr*/ #if PY_MAJOR_VERSION < 3 0, /*tp_compare*/ #endif #if PY_MAJOR_VERSION >= 3 0, /*tp_as_async*/ #endif __pyx_pw_11pygame_sdl2_7surface_7Surface_9__repr__, /*tp_repr*/ 0, /*tp_as_number*/ 0, /*tp_as_sequence*/ 0, /*tp_as_mapping*/ 0, /*tp_hash*/ 0, /*tp_call*/ 0, /*tp_str*/ 0, /*tp_getattro*/ 0, /*tp_setattro*/ 0, /*tp_as_buffer*/ Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/ 0, /*tp_doc*/ __pyx_tp_traverse_11pygame_sdl2_7surface_Surface, /*tp_traverse*/ __pyx_tp_clear_11pygame_sdl2_7surface_Surface, /*tp_clear*/ 0, /*tp_richcompare*/ 0, /*tp_weaklistoffset*/ 0, /*tp_iter*/ 0, /*tp_iternext*/ __pyx_methods_11pygame_sdl2_7surface_Surface, /*tp_methods*/ 0, /*tp_members*/ __pyx_getsets_11pygame_sdl2_7surface_Surface, /*tp_getset*/ 0, /*tp_base*/ 0, /*tp_dict*/ 0, /*tp_descr_get*/ 0, /*tp_descr_set*/ 0, /*tp_dictoffset*/ __pyx_pw_11pygame_sdl2_7surface_7Surface_7__init__, /*tp_init*/ 0, /*tp_alloc*/ __pyx_tp_new_11pygame_sdl2_7surface_Surface, /*tp_new*/ 0, /*tp_free*/ 0, /*tp_is_gc*/ 0, /*tp_bases*/ 0, /*tp_mro*/ 0, /*tp_cache*/ 0, /*tp_subclasses*/ 0, /*tp_weaklist*/ 0, /*tp_del*/ 0, /*tp_version_tag*/ #if PY_VERSION_HEX >= 0x030400a1 0, /*tp_finalize*/ #endif }; static PyMethodDef __pyx_methods[] = { {0, 0, 0, 0} }; #if PY_MAJOR_VERSION >= 3 static struct PyModuleDef __pyx_moduledef = { #if PY_VERSION_HEX < 0x03020000 { PyObject_HEAD_INIT(NULL) NULL, 0, NULL }, #else PyModuleDef_HEAD_INIT, #endif "surface", 0, /* m_doc */ -1, /* m_size */ __pyx_methods /* m_methods */, NULL, /* m_reload */ NULL, /* m_traverse */ NULL, /* m_clear */ NULL /* m_free */ }; #endif static __Pyx_StringTabEntry __pyx_string_tab[] = { {&__pyx_kp_u_2, __pyx_k_2, sizeof(__pyx_k_2), 0, 1, 0, 0}, {&__pyx_n_s_IndexError, __pyx_k_IndexError, sizeof(__pyx_k_IndexError), 0, 0, 1, 1}, {&__pyx_kp_u_Memory_leak_via_Surface_in_pygam, __pyx_k_Memory_leak_via_Surface_in_pygam, sizeof(__pyx_k_Memory_leak_via_Surface_in_pygam), 0, 1, 0, 0}, {&__pyx_kp_u_No_video_mode_has_been_set, __pyx_k_No_video_mode_has_been_set, sizeof(__pyx_k_No_video_mode_has_been_set), 0, 1, 0, 0}, {&__pyx_kp_u_Position_outside_surface, __pyx_k_Position_outside_surface, sizeof(__pyx_k_Position_outside_surface), 0, 1, 0, 0}, {&__pyx_n_s_Rect, __pyx_k_Rect, sizeof(__pyx_k_Rect), 0, 0, 1, 1}, {&__pyx_n_s_SRCALPHA, __pyx_k_SRCALPHA, sizeof(__pyx_k_SRCALPHA), 0, 0, 1, 1}, {&__pyx_kp_u_Surface_get_view_is_not_supporte, __pyx_k_Surface_get_view_is_not_supporte, sizeof(__pyx_k_Surface_get_view_is_not_supporte), 0, 1, 0, 0}, {&__pyx_kp_u_Surface_has_unsupported_bytesize, __pyx_k_Surface_has_unsupported_bytesize, sizeof(__pyx_k_Surface_has_unsupported_bytesize), 0, 1, 0, 0}, {&__pyx_kp_u_Surface_set_masks_is_not_support, __pyx_k_Surface_set_masks_is_not_support, sizeof(__pyx_k_Surface_set_masks_is_not_support), 0, 1, 0, 0}, {&__pyx_kp_u_Surface_set_shifts_is_not_suppor, __pyx_k_Surface_set_shifts_is_not_suppor, sizeof(__pyx_k_Surface_set_shifts_is_not_suppor), 0, 1, 0, 0}, {&__pyx_kp_u_Surface_x_x, __pyx_k_Surface_x_x, sizeof(__pyx_k_Surface_x_x), 0, 1, 0, 0}, {&__pyx_n_s_ValueError, __pyx_k_ValueError, sizeof(__pyx_k_ValueError), 0, 0, 1, 1}, {&__pyx_n_s_append, __pyx_k_append, sizeof(__pyx_k_append), 0, 0, 1, 1}, {&__pyx_n_s_area, __pyx_k_area, sizeof(__pyx_k_area), 0, 0, 1, 1}, {&__pyx_n_u_area, __pyx_k_area, sizeof(__pyx_k_area), 0, 1, 0, 1}, {&__pyx_n_s_clip, __pyx_k_clip, sizeof(__pyx_k_clip), 0, 0, 1, 1}, {&__pyx_n_s_color, __pyx_k_color, sizeof(__pyx_k_color), 0, 0, 1, 1}, {&__pyx_n_s_convert, __pyx_k_convert, sizeof(__pyx_k_convert), 0, 0, 1, 1}, {&__pyx_n_s_convert_alpha, __pyx_k_convert_alpha, sizeof(__pyx_k_convert_alpha), 0, 0, 1, 1}, {&__pyx_n_s_depth, __pyx_k_depth, sizeof(__pyx_k_depth), 0, 0, 1, 1}, {&__pyx_n_s_dest, __pyx_k_dest, sizeof(__pyx_k_dest), 0, 0, 1, 1}, {&__pyx_n_u_dest, __pyx_k_dest, sizeof(__pyx_k_dest), 0, 1, 0, 1}, {&__pyx_n_s_display, __pyx_k_display, sizeof(__pyx_k_display), 0, 0, 1, 1}, {&__pyx_n_s_dx, __pyx_k_dx, sizeof(__pyx_k_dx), 0, 0, 1, 1}, {&__pyx_n_s_dy, __pyx_k_dy, sizeof(__pyx_k_dy), 0, 0, 1, 1}, {&__pyx_n_s_error, __pyx_k_error, sizeof(__pyx_k_error), 0, 0, 1, 1}, {&__pyx_n_s_flags, __pyx_k_flags, sizeof(__pyx_k_flags), 0, 0, 1, 1}, {&__pyx_n_s_format, __pyx_k_format, sizeof(__pyx_k_format), 0, 0, 1, 1}, {&__pyx_n_s_get_alpha, __pyx_k_get_alpha, sizeof(__pyx_k_get_alpha), 0, 0, 1, 1}, {&__pyx_n_s_get_rect, __pyx_k_get_rect, sizeof(__pyx_k_get_rect), 0, 0, 1, 1}, {&__pyx_n_s_get_size, __pyx_k_get_size, sizeof(__pyx_k_get_size), 0, 0, 1, 1}, {&__pyx_n_s_get_surface, __pyx_k_get_surface, sizeof(__pyx_k_get_surface), 0, 0, 1, 1}, {&__pyx_n_s_import, __pyx_k_import, sizeof(__pyx_k_import), 0, 0, 1, 1}, {&__pyx_n_s_items, __pyx_k_items, sizeof(__pyx_k_items), 0, 0, 1, 1}, {&__pyx_n_s_kind, __pyx_k_kind, sizeof(__pyx_k_kind), 0, 0, 1, 1}, {&__pyx_n_s_lock, __pyx_k_lock, sizeof(__pyx_k_lock), 0, 0, 1, 1}, {&__pyx_n_s_main, __pyx_k_main, sizeof(__pyx_k_main), 0, 0, 1, 1}, {&__pyx_n_s_masks, __pyx_k_masks, sizeof(__pyx_k_masks), 0, 0, 1, 1}, {&__pyx_n_s_min_alpha, __pyx_k_min_alpha, sizeof(__pyx_k_min_alpha), 0, 0, 1, 1}, {&__pyx_n_s_pos, __pyx_k_pos, sizeof(__pyx_k_pos), 0, 0, 1, 1}, {&__pyx_n_s_pygame_sdl2, __pyx_k_pygame_sdl2, sizeof(__pyx_k_pygame_sdl2), 0, 0, 1, 1}, {&__pyx_n_s_pygame_sdl2_error, __pyx_k_pygame_sdl2_error, sizeof(__pyx_k_pygame_sdl2_error), 0, 0, 1, 1}, {&__pyx_n_s_pygame_sdl2_locals, __pyx_k_pygame_sdl2_locals, sizeof(__pyx_k_pygame_sdl2_locals), 0, 0, 1, 1}, {&__pyx_n_s_pygame_sdl2_rect, __pyx_k_pygame_sdl2_rect, sizeof(__pyx_k_pygame_sdl2_rect), 0, 0, 1, 1}, {&__pyx_n_s_pyx_vtable, __pyx_k_pyx_vtable, sizeof(__pyx_k_pyx_vtable), 0, 0, 1, 1}, {&__pyx_n_s_rect, __pyx_k_rect, sizeof(__pyx_k_rect), 0, 0, 1, 1}, {&__pyx_n_s_remove, __pyx_k_remove, sizeof(__pyx_k_remove), 0, 0, 1, 1}, {&__pyx_n_s_set_alpha, __pyx_k_set_alpha, sizeof(__pyx_k_set_alpha), 0, 0, 1, 1}, {&__pyx_n_s_size, __pyx_k_size, sizeof(__pyx_k_size), 0, 0, 1, 1}, {&__pyx_n_s_source, __pyx_k_source, sizeof(__pyx_k_source), 0, 0, 1, 1}, {&__pyx_n_s_special_flags, __pyx_k_special_flags, sizeof(__pyx_k_special_flags), 0, 0, 1, 1}, {&__pyx_n_s_subsurface, __pyx_k_subsurface, sizeof(__pyx_k_subsurface), 0, 0, 1, 1}, {&__pyx_kp_u_subsurface_rectangle_outside_sur, __pyx_k_subsurface_rectangle_outside_sur, sizeof(__pyx_k_subsurface_rectangle_outside_sur), 0, 1, 0, 0}, {&__pyx_kp_u_subsurface_size_must_be_non_nega, __pyx_k_subsurface_size_must_be_non_nega, sizeof(__pyx_k_subsurface_size_must_be_non_nega), 0, 1, 0, 0}, {&__pyx_n_s_surface, __pyx_k_surface, sizeof(__pyx_k_surface), 0, 0, 1, 1}, {&__pyx_n_s_test, __pyx_k_test, sizeof(__pyx_k_test), 0, 0, 1, 1}, {&__pyx_n_s_total_size, __pyx_k_total_size, sizeof(__pyx_k_total_size), 0, 0, 1, 1}, {&__pyx_n_s_unlock, __pyx_k_unlock, sizeof(__pyx_k_unlock), 0, 0, 1, 1}, {&__pyx_n_s_value, __pyx_k_value, sizeof(__pyx_k_value), 0, 0, 1, 1}, {&__pyx_n_s_warn, __pyx_k_warn, sizeof(__pyx_k_warn), 0, 0, 1, 1}, {&__pyx_n_s_warnings, __pyx_k_warnings, sizeof(__pyx_k_warnings), 0, 0, 1, 1}, {0, 0, 0, 0, 0, 0, 0} }; static int __Pyx_InitCachedBuiltins(void) { __pyx_builtin_IndexError = __Pyx_GetBuiltinName(__pyx_n_s_IndexError); if (!__pyx_builtin_IndexError) __PYX_ERR(0, 512, __pyx_L1_error) __pyx_builtin_ValueError = __Pyx_GetBuiltinName(__pyx_n_s_ValueError); if (!__pyx_builtin_ValueError) __PYX_ERR(0, 537, __pyx_L1_error) return 0; __pyx_L1_error:; return -1; } static int __Pyx_InitCachedConstants(void) { __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__Pyx_InitCachedConstants", 0); /* "pygame_sdl2/surface.pyx":76 * return * * warnings.warn("Memory leak via Surface in pygame_sdl2.") # <<<<<<<<<<<<<< * * def __sizeof__(self): */ __pyx_tuple_ = PyTuple_Pack(1, __pyx_kp_u_Memory_leak_via_Surface_in_pygam); if (unlikely(!__pyx_tuple_)) __PYX_ERR(0, 76, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple_); __Pyx_GIVEREF(__pyx_tuple_); /* "pygame_sdl2/surface.pyx":241 * * if surface is None: * raise error("No video mode has been set.") # <<<<<<<<<<<<<< * * cdef SDL_PixelFormat *sample_format = ( surface).surface.format */ __pyx_tuple__2 = PyTuple_Pack(1, __pyx_kp_u_No_video_mode_has_been_set); if (unlikely(!__pyx_tuple__2)) __PYX_ERR(0, 241, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__2); __Pyx_GIVEREF(__pyx_tuple__2); /* "pygame_sdl2/surface.pyx":272 * new_surface = SDL_ConvertSurfaceFormat(self.surface, pixel_format, 0) * * cdef Surface rv = Surface(()) # <<<<<<<<<<<<<< * rv.take_surface(new_surface) * */ __pyx_tuple__3 = PyTuple_Pack(1, __pyx_empty_tuple); if (unlikely(!__pyx_tuple__3)) __PYX_ERR(0, 272, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__3); __Pyx_GIVEREF(__pyx_tuple__3); /* "pygame_sdl2/surface.pyx":282 * * if surface is None: * raise error("No video mode has been set.") # <<<<<<<<<<<<<< * * cdef SDL_PixelFormat *sample_format = surface.surface.format */ __pyx_tuple__4 = PyTuple_Pack(1, __pyx_kp_u_No_video_mode_has_been_set); if (unlikely(!__pyx_tuple__4)) __PYX_ERR(0, 282, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__4); __Pyx_GIVEREF(__pyx_tuple__4); /* "pygame_sdl2/surface.pyx":314 * new_surface = SDL_ConvertSurfaceFormat(self.surface, pixel_format, 0) * * cdef Surface rv = Surface(()) # <<<<<<<<<<<<<< * rv.take_surface(new_surface) * */ __pyx_tuple__5 = PyTuple_Pack(1, __pyx_empty_tuple); if (unlikely(!__pyx_tuple__5)) __PYX_ERR(0, 314, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__5); __Pyx_GIVEREF(__pyx_tuple__5); /* "pygame_sdl2/surface.pyx":343 * * if sdl_rect.w <= 0 or sdl_rect.h <= 0: * return Rect(0, 0, 0, 0) # <<<<<<<<<<<<<< * * with nogil: */ __pyx_tuple__6 = PyTuple_Pack(4, __pyx_int_0, __pyx_int_0, __pyx_int_0, __pyx_int_0); if (unlikely(!__pyx_tuple__6)) __PYX_ERR(0, 343, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__6); __Pyx_GIVEREF(__pyx_tuple__6); /* "pygame_sdl2/surface.pyx":512 * * if not (0 <= x < self.surface.w) or not (0 <= y < self.surface.h): * raise IndexError("Position outside surface.") # <<<<<<<<<<<<<< * * if self.surface.format.BytesPerPixel != 4: */ __pyx_tuple__7 = PyTuple_Pack(1, __pyx_kp_u_Position_outside_surface); if (unlikely(!__pyx_tuple__7)) __PYX_ERR(0, 512, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__7); __Pyx_GIVEREF(__pyx_tuple__7); /* "pygame_sdl2/surface.pyx":515 * * if self.surface.format.BytesPerPixel != 4: * raise error("Surface has unsupported bytesize.") # <<<<<<<<<<<<<< * * self.lock() */ __pyx_tuple__8 = PyTuple_Pack(1, __pyx_kp_u_Surface_has_unsupported_bytesize); if (unlikely(!__pyx_tuple__8)) __PYX_ERR(0, 515, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__8); __Pyx_GIVEREF(__pyx_tuple__8); /* "pygame_sdl2/surface.pyx":537 * * if not (0 <= x < self.surface.w) or not (0 <= y < self.surface.h): * raise ValueError("Position outside surface.") # <<<<<<<<<<<<<< * * if self.surface.format.BytesPerPixel != 4: */ __pyx_tuple__9 = PyTuple_Pack(1, __pyx_kp_u_Position_outside_surface); if (unlikely(!__pyx_tuple__9)) __PYX_ERR(0, 537, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__9); __Pyx_GIVEREF(__pyx_tuple__9); /* "pygame_sdl2/surface.pyx":540 * * if self.surface.format.BytesPerPixel != 4: * raise error("Surface has unsupported bytesize.") # <<<<<<<<<<<<<< * * pixel = map_color(self.surface, color) */ __pyx_tuple__10 = PyTuple_Pack(1, __pyx_kp_u_Surface_has_unsupported_bytesize); if (unlikely(!__pyx_tuple__10)) __PYX_ERR(0, 540, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__10); __Pyx_GIVEREF(__pyx_tuple__10); /* "pygame_sdl2/surface.pyx":561 * * if not (0 <= x < self.surface.w) or not (0 <= y < self.surface.h): * raise ValueError("Position outside surface.") # <<<<<<<<<<<<<< * * if self.surface.format.BytesPerPixel != 4: */ __pyx_tuple__11 = PyTuple_Pack(1, __pyx_kp_u_Position_outside_surface); if (unlikely(!__pyx_tuple__11)) __PYX_ERR(0, 561, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__11); __Pyx_GIVEREF(__pyx_tuple__11); /* "pygame_sdl2/surface.pyx":564 * * if self.surface.format.BytesPerPixel != 4: * raise error("Surface has unsupported bytesize.") # <<<<<<<<<<<<<< * * self.lock() */ __pyx_tuple__12 = PyTuple_Pack(1, __pyx_kp_u_Surface_has_unsupported_bytesize); if (unlikely(!__pyx_tuple__12)) __PYX_ERR(0, 564, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__12); __Pyx_GIVEREF(__pyx_tuple__12); /* "pygame_sdl2/surface.pyx":609 * * if sdl_rect.w < 0 or sdl_rect.h < 0: * raise error("subsurface size must be non-negative.") # <<<<<<<<<<<<<< * * if ((sdl_rect.x < 0) */ __pyx_tuple__13 = PyTuple_Pack(1, __pyx_kp_u_subsurface_size_must_be_non_nega); if (unlikely(!__pyx_tuple__13)) __PYX_ERR(0, 609, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__13); __Pyx_GIVEREF(__pyx_tuple__13); /* "pygame_sdl2/surface.pyx":616 * or (sdl_rect.y + sdl_rect.h > self.surface.h)): * * raise error("subsurface rectangle outside surface area.") # <<<<<<<<<<<<<< * * cdef Uint8 *pixels = self.surface.pixels */ __pyx_tuple__14 = PyTuple_Pack(1, __pyx_kp_u_subsurface_rectangle_outside_sur); if (unlikely(!__pyx_tuple__14)) __PYX_ERR(0, 616, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__14); __Pyx_GIVEREF(__pyx_tuple__14); /* "pygame_sdl2/surface.pyx":633 * self.surface.format.Amask) * * cdef Surface rv = Surface(()) # <<<<<<<<<<<<<< * * rv.surface = new_surface */ __pyx_tuple__15 = PyTuple_Pack(1, __pyx_empty_tuple); if (unlikely(!__pyx_tuple__15)) __PYX_ERR(0, 633, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__15); __Pyx_GIVEREF(__pyx_tuple__15); /* "pygame_sdl2/surface.pyx":715 * * def set_masks(self, masks): * warnings.warn("Surface.set_masks is not supported.") # <<<<<<<<<<<<<< * * def get_shifts(self): */ __pyx_tuple__16 = PyTuple_Pack(1, __pyx_kp_u_Surface_set_masks_is_not_support); if (unlikely(!__pyx_tuple__16)) __PYX_ERR(0, 715, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__16); __Pyx_GIVEREF(__pyx_tuple__16); /* "pygame_sdl2/surface.pyx":722 * * def set_shifts(self, shifts): * warnings.warn("Surface.set_shifts is not supported.") # <<<<<<<<<<<<<< * * def get_shifts(self): */ __pyx_tuple__17 = PyTuple_Pack(1, __pyx_kp_u_Surface_set_shifts_is_not_suppor); if (unlikely(!__pyx_tuple__17)) __PYX_ERR(0, 722, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__17); __Pyx_GIVEREF(__pyx_tuple__17); /* "pygame_sdl2/surface.pyx":797 * # Totally empty surface. * if minx > maxx: * return Rect((0, 0, 0, 0)) # <<<<<<<<<<<<<< * * x = minx */ __pyx_tuple__18 = PyTuple_Pack(4, __pyx_int_0, __pyx_int_0, __pyx_int_0, __pyx_int_0); if (unlikely(!__pyx_tuple__18)) __PYX_ERR(0, 797, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__18); __Pyx_GIVEREF(__pyx_tuple__18); __pyx_tuple__19 = PyTuple_Pack(1, __pyx_tuple__18); if (unlikely(!__pyx_tuple__19)) __PYX_ERR(0, 797, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__19); __Pyx_GIVEREF(__pyx_tuple__19); /* "pygame_sdl2/surface.pyx":807 * * def get_view(self, kind='2'): * raise error("Surface.get_view is not supported.") # <<<<<<<<<<<<<< * * def get_buffer(self): */ __pyx_tuple__20 = PyTuple_Pack(1, __pyx_kp_u_Surface_get_view_is_not_supporte); if (unlikely(!__pyx_tuple__20)) __PYX_ERR(0, 807, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__20); __Pyx_GIVEREF(__pyx_tuple__20); /* "pygame_sdl2/surface.pyx":822 * * cdef api object PySurface_New(SDL_Surface *surf): * cdef Surface rv = Surface(()) # <<<<<<<<<<<<<< * rv.take_surface(surf) * return rv */ __pyx_tuple__21 = PyTuple_Pack(1, __pyx_empty_tuple); if (unlikely(!__pyx_tuple__21)) __PYX_ERR(0, 822, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__21); __Pyx_GIVEREF(__pyx_tuple__21); __Pyx_RefNannyFinishContext(); return 0; __pyx_L1_error:; __Pyx_RefNannyFinishContext(); return -1; } static int __Pyx_InitGlobals(void) { if (__Pyx_InitStrings(__pyx_string_tab) < 0) __PYX_ERR(0, 1, __pyx_L1_error); __pyx_int_0 = PyInt_FromLong(0); if (unlikely(!__pyx_int_0)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_int_1 = PyInt_FromLong(1); if (unlikely(!__pyx_int_1)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_int_32 = PyInt_FromLong(32); if (unlikely(!__pyx_int_32)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_int_255 = PyInt_FromLong(255); if (unlikely(!__pyx_int_255)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_int_16843009 = PyInt_FromLong(16843009L); if (unlikely(!__pyx_int_16843009)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_int_4294967295 = PyInt_FromString((char *)"4294967295", 0, 0); if (unlikely(!__pyx_int_4294967295)) __PYX_ERR(0, 1, __pyx_L1_error) return 0; __pyx_L1_error:; return -1; } #if PY_MAJOR_VERSION < 3 PyMODINIT_FUNC initsurface(void); /*proto*/ PyMODINIT_FUNC initsurface(void) #else PyMODINIT_FUNC PyInit_surface(void); /*proto*/ PyMODINIT_FUNC PyInit_surface(void) #endif { PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; __Pyx_RefNannyDeclarations #if CYTHON_REFNANNY __Pyx_RefNanny = __Pyx_RefNannyImportAPI("refnanny"); if (!__Pyx_RefNanny) { PyErr_Clear(); __Pyx_RefNanny = __Pyx_RefNannyImportAPI("Cython.Runtime.refnanny"); if (!__Pyx_RefNanny) Py_FatalError("failed to import 'refnanny' module"); } #endif __Pyx_RefNannySetupContext("PyMODINIT_FUNC PyInit_surface(void)", 0); if (__Pyx_check_binary_version() < 0) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_empty_tuple = PyTuple_New(0); if (unlikely(!__pyx_empty_tuple)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_empty_bytes = PyBytes_FromStringAndSize("", 0); if (unlikely(!__pyx_empty_bytes)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_empty_unicode = PyUnicode_FromStringAndSize("", 0); if (unlikely(!__pyx_empty_unicode)) __PYX_ERR(0, 1, __pyx_L1_error) #ifdef __Pyx_CyFunction_USED if (__pyx_CyFunction_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error) #endif #ifdef __Pyx_FusedFunction_USED if (__pyx_FusedFunction_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error) #endif #ifdef __Pyx_Coroutine_USED if (__pyx_Coroutine_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error) #endif #ifdef __Pyx_Generator_USED if (__pyx_Generator_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error) #endif #ifdef __Pyx_StopAsyncIteration_USED if (__pyx_StopAsyncIteration_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error) #endif /*--- Library function declarations ---*/ /*--- Threads initialization code ---*/ #if defined(__PYX_FORCE_INIT_THREADS) && __PYX_FORCE_INIT_THREADS #ifdef WITH_THREAD /* Python build with threading support? */ PyEval_InitThreads(); #endif #endif /*--- Module creation code ---*/ #if PY_MAJOR_VERSION < 3 __pyx_m = Py_InitModule4("surface", __pyx_methods, 0, 0, PYTHON_API_VERSION); Py_XINCREF(__pyx_m); #else __pyx_m = PyModule_Create(&__pyx_moduledef); #endif if (unlikely(!__pyx_m)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_d = PyModule_GetDict(__pyx_m); if (unlikely(!__pyx_d)) __PYX_ERR(0, 1, __pyx_L1_error) Py_INCREF(__pyx_d); __pyx_b = PyImport_AddModule(__Pyx_BUILTIN_MODULE_NAME); if (unlikely(!__pyx_b)) __PYX_ERR(0, 1, __pyx_L1_error) #if CYTHON_COMPILING_IN_PYPY Py_INCREF(__pyx_b); #endif if (PyObject_SetAttrString(__pyx_m, "__builtins__", __pyx_b) < 0) __PYX_ERR(0, 1, __pyx_L1_error); /*--- Initialize various global constants etc. ---*/ if (__Pyx_InitGlobals() < 0) __PYX_ERR(0, 1, __pyx_L1_error) #if PY_MAJOR_VERSION < 3 && (__PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT) if (__Pyx_init_sys_getdefaultencoding_params() < 0) __PYX_ERR(0, 1, __pyx_L1_error) #endif if (__pyx_module_is_main_pygame_sdl2__surface) { if (PyObject_SetAttrString(__pyx_m, "__name__", __pyx_n_s_main) < 0) __PYX_ERR(0, 1, __pyx_L1_error) } #if PY_MAJOR_VERSION >= 3 { PyObject *modules = PyImport_GetModuleDict(); if (unlikely(!modules)) __PYX_ERR(0, 1, __pyx_L1_error) if (!PyDict_GetItemString(modules, "pygame_sdl2.surface")) { if (unlikely(PyDict_SetItemString(modules, "pygame_sdl2.surface", __pyx_m) < 0)) __PYX_ERR(0, 1, __pyx_L1_error) } } #endif /*--- Builtin init code ---*/ if (__Pyx_InitCachedBuiltins() < 0) __PYX_ERR(0, 1, __pyx_L1_error) /*--- Constants init code ---*/ if (__Pyx_InitCachedConstants() < 0) __PYX_ERR(0, 1, __pyx_L1_error) /*--- Global init code ---*/ /*--- Variable export code ---*/ /*--- Function export code ---*/ if (__Pyx_ExportFunction("PySurface_AsSurface", (void (*)(void))__pyx_f_11pygame_sdl2_7surface_PySurface_AsSurface, "SDL_Surface *(PyObject *)") < 0) __PYX_ERR(0, 1, __pyx_L1_error) if (__Pyx_ExportFunction("PySurface_New", (void (*)(void))__pyx_f_11pygame_sdl2_7surface_PySurface_New, "PyObject *(SDL_Surface *)") < 0) __PYX_ERR(0, 1, __pyx_L1_error) /*--- Type init code ---*/ __pyx_vtabptr_11pygame_sdl2_7surface_Surface = &__pyx_vtable_11pygame_sdl2_7surface_Surface; __pyx_vtable_11pygame_sdl2_7surface_Surface.take_surface = (void (*)(struct __pyx_obj_11pygame_sdl2_7surface_Surface *, SDL_Surface *))__pyx_f_11pygame_sdl2_7surface_7Surface_take_surface; if (PyType_Ready(&__pyx_type_11pygame_sdl2_7surface_Surface) < 0) __PYX_ERR(0, 53, __pyx_L1_error) __pyx_type_11pygame_sdl2_7surface_Surface.tp_print = 0; if (__Pyx_SetVtable(__pyx_type_11pygame_sdl2_7surface_Surface.tp_dict, __pyx_vtabptr_11pygame_sdl2_7surface_Surface) < 0) __PYX_ERR(0, 53, __pyx_L1_error) if (PyObject_SetAttrString(__pyx_m, "Surface", (PyObject *)&__pyx_type_11pygame_sdl2_7surface_Surface) < 0) __PYX_ERR(0, 53, __pyx_L1_error) if (__pyx_type_11pygame_sdl2_7surface_Surface.tp_weaklistoffset == 0) __pyx_type_11pygame_sdl2_7surface_Surface.tp_weaklistoffset = offsetof(struct __pyx_obj_11pygame_sdl2_7surface_Surface, __weakref__); __pyx_ptype_11pygame_sdl2_7surface_Surface = &__pyx_type_11pygame_sdl2_7surface_Surface; /*--- Type import code ---*/ __pyx_ptype_11pygame_sdl2_5color_Color = __Pyx_ImportType("pygame_sdl2.color", "Color", sizeof(struct __pyx_obj_11pygame_sdl2_5color_Color), 1); if (unlikely(!__pyx_ptype_11pygame_sdl2_5color_Color)) __PYX_ERR(1, 26, __pyx_L1_error) __pyx_vtabptr_11pygame_sdl2_5color_Color = (struct __pyx_vtabstruct_11pygame_sdl2_5color_Color*)__Pyx_GetVtable(__pyx_ptype_11pygame_sdl2_5color_Color->tp_dict); if (unlikely(!__pyx_vtabptr_11pygame_sdl2_5color_Color)) __PYX_ERR(1, 26, __pyx_L1_error) __pyx_ptype_11pygame_sdl2_4rect_Rect = __Pyx_ImportType("pygame_sdl2.rect", "Rect", sizeof(struct __pyx_obj_11pygame_sdl2_4rect_Rect), 1); if (unlikely(!__pyx_ptype_11pygame_sdl2_4rect_Rect)) __PYX_ERR(2, 21, __pyx_L1_error) /*--- Variable import code ---*/ /*--- Function import code ---*/ __pyx_t_1 = __Pyx_ImportModule("pygame_sdl2.color"); if (!__pyx_t_1) __PYX_ERR(0, 1, __pyx_L1_error) if (__Pyx_ImportFunction(__pyx_t_1, "map_color", (void (**)(void))&__pyx_f_11pygame_sdl2_5color_map_color, "Uint32 (SDL_Surface *, PyObject *)") < 0) __PYX_ERR(0, 1, __pyx_L1_error) if (__Pyx_ImportFunction(__pyx_t_1, "get_color", (void (**)(void))&__pyx_f_11pygame_sdl2_5color_get_color, "PyObject *(Uint32, SDL_Surface *)") < 0) __PYX_ERR(0, 1, __pyx_L1_error) Py_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_2 = __Pyx_ImportModule("pygame_sdl2.rect"); if (!__pyx_t_2) __PYX_ERR(0, 1, __pyx_L1_error) if (__Pyx_ImportFunction(__pyx_t_2, "to_sdl_rect", (void (**)(void))&__pyx_f_11pygame_sdl2_4rect_to_sdl_rect, "int (PyObject *, SDL_Rect *, struct __pyx_opt_args_11pygame_sdl2_4rect_to_sdl_rect *__pyx_optional_args)") < 0) __PYX_ERR(0, 1, __pyx_L1_error) Py_DECREF(__pyx_t_2); __pyx_t_2 = 0; /*--- Execution code ---*/ #if defined(__Pyx_Generator_USED) || defined(__Pyx_Coroutine_USED) if (__Pyx_patch_abc() < 0) __PYX_ERR(0, 1, __pyx_L1_error) #endif /* "pygame_sdl2/surface.pyx":25 * from pygame_sdl2.color cimport map_color, get_color * from pygame_sdl2.rect cimport to_sdl_rect * from pygame_sdl2.rect import Rect # <<<<<<<<<<<<<< * * from pygame_sdl2.error import error */ __pyx_t_3 = PyList_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 25, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_INCREF(__pyx_n_s_Rect); __Pyx_GIVEREF(__pyx_n_s_Rect); PyList_SET_ITEM(__pyx_t_3, 0, __pyx_n_s_Rect); __pyx_t_4 = __Pyx_Import(__pyx_n_s_pygame_sdl2_rect, __pyx_t_3, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 25, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_3 = __Pyx_ImportFrom(__pyx_t_4, __pyx_n_s_Rect); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 25, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); if (PyDict_SetItem(__pyx_d, __pyx_n_s_Rect, __pyx_t_3) < 0) __PYX_ERR(0, 25, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; /* "pygame_sdl2/surface.pyx":27 * from pygame_sdl2.rect import Rect * * from pygame_sdl2.error import error # <<<<<<<<<<<<<< * from pygame_sdl2.locals import SRCALPHA * import pygame_sdl2 */ __pyx_t_4 = PyList_New(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 27, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_INCREF(__pyx_n_s_error); __Pyx_GIVEREF(__pyx_n_s_error); PyList_SET_ITEM(__pyx_t_4, 0, __pyx_n_s_error); __pyx_t_3 = __Pyx_Import(__pyx_n_s_pygame_sdl2_error, __pyx_t_4, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 27, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_t_4 = __Pyx_ImportFrom(__pyx_t_3, __pyx_n_s_error); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 27, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); if (PyDict_SetItem(__pyx_d, __pyx_n_s_error, __pyx_t_4) < 0) __PYX_ERR(0, 27, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "pygame_sdl2/surface.pyx":28 * * from pygame_sdl2.error import error * from pygame_sdl2.locals import SRCALPHA # <<<<<<<<<<<<<< * import pygame_sdl2 * */ __pyx_t_3 = PyList_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 28, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_INCREF(__pyx_n_s_SRCALPHA); __Pyx_GIVEREF(__pyx_n_s_SRCALPHA); PyList_SET_ITEM(__pyx_t_3, 0, __pyx_n_s_SRCALPHA); __pyx_t_4 = __Pyx_Import(__pyx_n_s_pygame_sdl2_locals, __pyx_t_3, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 28, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_3 = __Pyx_ImportFrom(__pyx_t_4, __pyx_n_s_SRCALPHA); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 28, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); if (PyDict_SetItem(__pyx_d, __pyx_n_s_SRCALPHA, __pyx_t_3) < 0) __PYX_ERR(0, 28, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; /* "pygame_sdl2/surface.pyx":29 * from pygame_sdl2.error import error * from pygame_sdl2.locals import SRCALPHA * import pygame_sdl2 # <<<<<<<<<<<<<< * * import warnings */ __pyx_t_4 = __Pyx_Import(__pyx_n_s_pygame_sdl2, 0, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 29, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); if (PyDict_SetItem(__pyx_d, __pyx_n_s_pygame_sdl2, __pyx_t_4) < 0) __PYX_ERR(0, 29, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; /* "pygame_sdl2/surface.pyx":31 * import pygame_sdl2 * * import warnings # <<<<<<<<<<<<<< * * cdef extern from "src/surface.h" nogil: */ __pyx_t_4 = __Pyx_Import(__pyx_n_s_warnings, 0, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 31, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); if (PyDict_SetItem(__pyx_d, __pyx_n_s_warnings, __pyx_t_4) < 0) __PYX_ERR(0, 31, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; /* "pygame_sdl2/surface.pyx":51 * * # The total size of all allocated surfaces * total_size = 0 # <<<<<<<<<<<<<< * * cdef class Surface: */ if (PyDict_SetItem(__pyx_d, __pyx_n_s_total_size, __pyx_int_0) < 0) __PYX_ERR(0, 51, __pyx_L1_error) /* "pygame_sdl2/surface.pyx":1 * # Copyright 2014 Patrick Dawson # <<<<<<<<<<<<<< * # Copyright 2014 Tom Rothamel * # */ __pyx_t_4 = PyDict_New(); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); if (PyDict_SetItem(__pyx_d, __pyx_n_s_test, __pyx_t_4) < 0) __PYX_ERR(0, 1, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; /*--- Wrapped vars code ---*/ goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); if (__pyx_m) { if (__pyx_d) { __Pyx_AddTraceback("init pygame_sdl2.surface", __pyx_clineno, __pyx_lineno, __pyx_filename); } Py_DECREF(__pyx_m); __pyx_m = 0; } else if (!PyErr_Occurred()) { PyErr_SetString(PyExc_ImportError, "init pygame_sdl2.surface"); } __pyx_L0:; __Pyx_RefNannyFinishContext(); #if PY_MAJOR_VERSION < 3 return; #else return __pyx_m; #endif } /* --- Runtime support code --- */ /* Refnanny */ #if CYTHON_REFNANNY static __Pyx_RefNannyAPIStruct *__Pyx_RefNannyImportAPI(const char *modname) { PyObject *m = NULL, *p = NULL; void *r = NULL; m = PyImport_ImportModule((char *)modname); if (!m) goto end; p = PyObject_GetAttrString(m, (char *)"RefNannyAPI"); if (!p) goto end; r = PyLong_AsVoidPtr(p); end: Py_XDECREF(p); Py_XDECREF(m); return (__Pyx_RefNannyAPIStruct *)r; } #endif /* GetBuiltinName */ static PyObject *__Pyx_GetBuiltinName(PyObject *name) { PyObject* result = __Pyx_PyObject_GetAttrStr(__pyx_b, name); if (unlikely(!result)) { PyErr_Format(PyExc_NameError, #if PY_MAJOR_VERSION >= 3 "name '%U' is not defined", name); #else "name '%.200s' is not defined", PyString_AS_STRING(name)); #endif } return result; } /* RaiseArgTupleInvalid */ static void __Pyx_RaiseArgtupleInvalid( const char* func_name, int exact, Py_ssize_t num_min, Py_ssize_t num_max, Py_ssize_t num_found) { Py_ssize_t num_expected; const char *more_or_less; if (num_found < num_min) { num_expected = num_min; more_or_less = "at least"; } else { num_expected = num_max; more_or_less = "at most"; } if (exact) { more_or_less = "exactly"; } PyErr_Format(PyExc_TypeError, "%.200s() takes %.8s %" CYTHON_FORMAT_SSIZE_T "d positional argument%.1s (%" CYTHON_FORMAT_SSIZE_T "d given)", func_name, more_or_less, num_expected, (num_expected == 1) ? "" : "s", num_found); } /* KeywordStringCheck */ static CYTHON_INLINE int __Pyx_CheckKeywordStrings( PyObject *kwdict, const char* function_name, int kw_allowed) { PyObject* key = 0; Py_ssize_t pos = 0; #if CYTHON_COMPILING_IN_PYPY if (!kw_allowed && PyDict_Next(kwdict, &pos, &key, 0)) goto invalid_keyword; return 1; #else while (PyDict_Next(kwdict, &pos, &key, 0)) { #if PY_MAJOR_VERSION < 3 if (unlikely(!PyString_CheckExact(key)) && unlikely(!PyString_Check(key))) #endif if (unlikely(!PyUnicode_Check(key))) goto invalid_keyword_type; } if ((!kw_allowed) && unlikely(key)) goto invalid_keyword; return 1; invalid_keyword_type: PyErr_Format(PyExc_TypeError, "%.200s() keywords must be strings", function_name); return 0; #endif invalid_keyword: PyErr_Format(PyExc_TypeError, #if PY_MAJOR_VERSION < 3 "%.200s() got an unexpected keyword argument '%.200s'", function_name, PyString_AsString(key)); #else "%s() got an unexpected keyword argument '%U'", function_name, key); #endif return 0; } /* GetModuleGlobalName */ static CYTHON_INLINE PyObject *__Pyx_GetModuleGlobalName(PyObject *name) { PyObject *result; #if !CYTHON_AVOID_BORROWED_REFS result = PyDict_GetItem(__pyx_d, name); if (likely(result)) { Py_INCREF(result); } else { #else result = PyObject_GetItem(__pyx_d, name); if (!result) { PyErr_Clear(); #endif result = __Pyx_GetBuiltinName(name); } return result; } /* PyObjectCall */ #if CYTHON_COMPILING_IN_CPYTHON static CYTHON_INLINE PyObject* __Pyx_PyObject_Call(PyObject *func, PyObject *arg, PyObject *kw) { PyObject *result; ternaryfunc call = func->ob_type->tp_call; if (unlikely(!call)) return PyObject_Call(func, arg, kw); if (unlikely(Py_EnterRecursiveCall((char*)" while calling a Python object"))) return NULL; result = (*call)(func, arg, kw); Py_LeaveRecursiveCall(); if (unlikely(!result) && unlikely(!PyErr_Occurred())) { PyErr_SetString( PyExc_SystemError, "NULL result without error in PyObject_Call"); } return result; } #endif /* PyErrFetchRestore */ #if CYTHON_FAST_THREAD_STATE static CYTHON_INLINE void __Pyx_ErrRestoreInState(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb) { PyObject *tmp_type, *tmp_value, *tmp_tb; tmp_type = tstate->curexc_type; tmp_value = tstate->curexc_value; tmp_tb = tstate->curexc_traceback; tstate->curexc_type = type; tstate->curexc_value = value; tstate->curexc_traceback = tb; Py_XDECREF(tmp_type); Py_XDECREF(tmp_value); Py_XDECREF(tmp_tb); } static CYTHON_INLINE void __Pyx_ErrFetchInState(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb) { *type = tstate->curexc_type; *value = tstate->curexc_value; *tb = tstate->curexc_traceback; tstate->curexc_type = 0; tstate->curexc_value = 0; tstate->curexc_traceback = 0; } #endif /* WriteUnraisableException */ static void __Pyx_WriteUnraisable(const char *name, CYTHON_UNUSED int clineno, CYTHON_UNUSED int lineno, CYTHON_UNUSED const char *filename, int full_traceback, CYTHON_UNUSED int nogil) { PyObject *old_exc, *old_val, *old_tb; PyObject *ctx; __Pyx_PyThreadState_declare #ifdef WITH_THREAD PyGILState_STATE state; if (nogil) state = PyGILState_Ensure(); #ifdef _MSC_VER else state = (PyGILState_STATE)-1; #endif #endif __Pyx_PyThreadState_assign __Pyx_ErrFetch(&old_exc, &old_val, &old_tb); if (full_traceback) { Py_XINCREF(old_exc); Py_XINCREF(old_val); Py_XINCREF(old_tb); __Pyx_ErrRestore(old_exc, old_val, old_tb); PyErr_PrintEx(1); } #if PY_MAJOR_VERSION < 3 ctx = PyString_FromString(name); #else ctx = PyUnicode_FromString(name); #endif __Pyx_ErrRestore(old_exc, old_val, old_tb); if (!ctx) { PyErr_WriteUnraisable(Py_None); } else { PyErr_WriteUnraisable(ctx); Py_DECREF(ctx); } #ifdef WITH_THREAD if (nogil) PyGILState_Release(state); #endif } /* RaiseDoubleKeywords */ static void __Pyx_RaiseDoubleKeywordsError( const char* func_name, PyObject* kw_name) { PyErr_Format(PyExc_TypeError, #if PY_MAJOR_VERSION >= 3 "%s() got multiple values for keyword argument '%U'", func_name, kw_name); #else "%s() got multiple values for keyword argument '%s'", func_name, PyString_AsString(kw_name)); #endif } /* ParseKeywords */ static int __Pyx_ParseOptionalKeywords( PyObject *kwds, PyObject **argnames[], PyObject *kwds2, PyObject *values[], Py_ssize_t num_pos_args, const char* function_name) { PyObject *key = 0, *value = 0; Py_ssize_t pos = 0; PyObject*** name; PyObject*** first_kw_arg = argnames + num_pos_args; while (PyDict_Next(kwds, &pos, &key, &value)) { name = first_kw_arg; while (*name && (**name != key)) name++; if (*name) { values[name-argnames] = value; continue; } name = first_kw_arg; #if PY_MAJOR_VERSION < 3 if (likely(PyString_CheckExact(key)) || likely(PyString_Check(key))) { while (*name) { if ((CYTHON_COMPILING_IN_PYPY || PyString_GET_SIZE(**name) == PyString_GET_SIZE(key)) && _PyString_Eq(**name, key)) { values[name-argnames] = value; break; } name++; } if (*name) continue; else { PyObject*** argname = argnames; while (argname != first_kw_arg) { if ((**argname == key) || ( (CYTHON_COMPILING_IN_PYPY || PyString_GET_SIZE(**argname) == PyString_GET_SIZE(key)) && _PyString_Eq(**argname, key))) { goto arg_passed_twice; } argname++; } } } else #endif if (likely(PyUnicode_Check(key))) { while (*name) { int cmp = (**name == key) ? 0 : #if !CYTHON_COMPILING_IN_PYPY && PY_MAJOR_VERSION >= 3 (PyUnicode_GET_SIZE(**name) != PyUnicode_GET_SIZE(key)) ? 1 : #endif PyUnicode_Compare(**name, key); if (cmp < 0 && unlikely(PyErr_Occurred())) goto bad; if (cmp == 0) { values[name-argnames] = value; break; } name++; } if (*name) continue; else { PyObject*** argname = argnames; while (argname != first_kw_arg) { int cmp = (**argname == key) ? 0 : #if !CYTHON_COMPILING_IN_PYPY && PY_MAJOR_VERSION >= 3 (PyUnicode_GET_SIZE(**argname) != PyUnicode_GET_SIZE(key)) ? 1 : #endif PyUnicode_Compare(**argname, key); if (cmp < 0 && unlikely(PyErr_Occurred())) goto bad; if (cmp == 0) goto arg_passed_twice; argname++; } } } else goto invalid_keyword_type; if (kwds2) { if (unlikely(PyDict_SetItem(kwds2, key, value))) goto bad; } else { goto invalid_keyword; } } return 0; arg_passed_twice: __Pyx_RaiseDoubleKeywordsError(function_name, key); goto bad; invalid_keyword_type: PyErr_Format(PyExc_TypeError, "%.200s() keywords must be strings", function_name); goto bad; invalid_keyword: PyErr_Format(PyExc_TypeError, #if PY_MAJOR_VERSION < 3 "%.200s() got an unexpected keyword argument '%.200s'", function_name, PyString_AsString(key)); #else "%s() got an unexpected keyword argument '%U'", function_name, key); #endif bad: return -1; } /* RaiseTooManyValuesToUnpack */ static CYTHON_INLINE void __Pyx_RaiseTooManyValuesError(Py_ssize_t expected) { PyErr_Format(PyExc_ValueError, "too many values to unpack (expected %" CYTHON_FORMAT_SSIZE_T "d)", expected); } /* RaiseNeedMoreValuesToUnpack */ static CYTHON_INLINE void __Pyx_RaiseNeedMoreValuesError(Py_ssize_t index) { PyErr_Format(PyExc_ValueError, "need more than %" CYTHON_FORMAT_SSIZE_T "d value%.1s to unpack", index, (index == 1) ? "" : "s"); } /* IterFinish */ static CYTHON_INLINE int __Pyx_IterFinish(void) { #if CYTHON_FAST_THREAD_STATE PyThreadState *tstate = PyThreadState_GET(); PyObject* exc_type = tstate->curexc_type; if (unlikely(exc_type)) { if (likely(exc_type == PyExc_StopIteration) || PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration)) { PyObject *exc_value, *exc_tb; exc_value = tstate->curexc_value; exc_tb = tstate->curexc_traceback; tstate->curexc_type = 0; tstate->curexc_value = 0; tstate->curexc_traceback = 0; Py_DECREF(exc_type); Py_XDECREF(exc_value); Py_XDECREF(exc_tb); return 0; } else { return -1; } } return 0; #else if (unlikely(PyErr_Occurred())) { if (likely(PyErr_ExceptionMatches(PyExc_StopIteration))) { PyErr_Clear(); return 0; } else { return -1; } } return 0; #endif } /* UnpackItemEndCheck */ static int __Pyx_IternextUnpackEndCheck(PyObject *retval, Py_ssize_t expected) { if (unlikely(retval)) { Py_DECREF(retval); __Pyx_RaiseTooManyValuesError(expected); return -1; } else { return __Pyx_IterFinish(); } return 0; } /* ExtTypeTest */ static CYTHON_INLINE int __Pyx_TypeTest(PyObject *obj, PyTypeObject *type) { if (unlikely(!type)) { PyErr_SetString(PyExc_SystemError, "Missing type object"); return 0; } if (likely(PyObject_TypeCheck(obj, type))) return 1; PyErr_Format(PyExc_TypeError, "Cannot convert %.200s to %.200s", Py_TYPE(obj)->tp_name, type->tp_name); return 0; } /* PyCFunctionFastCall */ #if CYTHON_FAST_PYCCALL static CYTHON_INLINE PyObject * __Pyx_PyCFunction_FastCall(PyObject *func_obj, PyObject **args, Py_ssize_t nargs) { PyCFunctionObject *func = (PyCFunctionObject*)func_obj; PyCFunction meth = PyCFunction_GET_FUNCTION(func); PyObject *self = PyCFunction_GET_SELF(func); assert(PyCFunction_Check(func)); assert(METH_FASTCALL == (PyCFunction_GET_FLAGS(func) & ~(METH_CLASS | METH_STATIC | METH_COEXIST))); assert(nargs >= 0); assert(nargs == 0 || args != NULL); /* _PyCFunction_FastCallDict() must not be called with an exception set, because it may clear it (directly or indirectly) and so the caller loses its exception */ assert(!PyErr_Occurred()); return (*((__Pyx_PyCFunctionFast)meth)) (self, args, nargs, NULL); } #endif // CYTHON_FAST_PYCCALL /* PyFunctionFastCall */ #if CYTHON_FAST_PYCALL #include "frameobject.h" static PyObject* __Pyx_PyFunction_FastCallNoKw(PyCodeObject *co, PyObject **args, Py_ssize_t na, PyObject *globals) { PyFrameObject *f; PyThreadState *tstate = PyThreadState_GET(); PyObject **fastlocals; Py_ssize_t i; PyObject *result; assert(globals != NULL); /* XXX Perhaps we should create a specialized PyFrame_New() that doesn't take locals, but does take builtins without sanity checking them. */ assert(tstate != NULL); f = PyFrame_New(tstate, co, globals, NULL); if (f == NULL) { return NULL; } fastlocals = f->f_localsplus; for (i = 0; i < na; i++) { Py_INCREF(*args); fastlocals[i] = *args++; } result = PyEval_EvalFrameEx(f,0); ++tstate->recursion_depth; Py_DECREF(f); --tstate->recursion_depth; return result; } #if 1 || PY_VERSION_HEX < 0x030600B1 static PyObject *__Pyx_PyFunction_FastCallDict(PyObject *func, PyObject **args, int nargs, PyObject *kwargs) { PyCodeObject *co = (PyCodeObject *)PyFunction_GET_CODE(func); PyObject *globals = PyFunction_GET_GLOBALS(func); PyObject *argdefs = PyFunction_GET_DEFAULTS(func); PyObject *closure; #if PY_MAJOR_VERSION >= 3 PyObject *kwdefs; #endif PyObject *kwtuple, **k; PyObject **d; Py_ssize_t nd; Py_ssize_t nk; PyObject *result; assert(kwargs == NULL || PyDict_Check(kwargs)); nk = kwargs ? PyDict_Size(kwargs) : 0; if (Py_EnterRecursiveCall((char*)" while calling a Python object")) { return NULL; } if ( #if PY_MAJOR_VERSION >= 3 co->co_kwonlyargcount == 0 && #endif likely(kwargs == NULL || nk == 0) && co->co_flags == (CO_OPTIMIZED | CO_NEWLOCALS | CO_NOFREE)) { if (argdefs == NULL && co->co_argcount == nargs) { result = __Pyx_PyFunction_FastCallNoKw(co, args, nargs, globals); goto done; } else if (nargs == 0 && argdefs != NULL && co->co_argcount == Py_SIZE(argdefs)) { /* function called with no arguments, but all parameters have a default value: use default values as arguments .*/ args = &PyTuple_GET_ITEM(argdefs, 0); result =__Pyx_PyFunction_FastCallNoKw(co, args, Py_SIZE(argdefs), globals); goto done; } } if (kwargs != NULL) { Py_ssize_t pos, i; kwtuple = PyTuple_New(2 * nk); if (kwtuple == NULL) { result = NULL; goto done; } k = &PyTuple_GET_ITEM(kwtuple, 0); pos = i = 0; while (PyDict_Next(kwargs, &pos, &k[i], &k[i+1])) { Py_INCREF(k[i]); Py_INCREF(k[i+1]); i += 2; } nk = i / 2; } else { kwtuple = NULL; k = NULL; } closure = PyFunction_GET_CLOSURE(func); #if PY_MAJOR_VERSION >= 3 kwdefs = PyFunction_GET_KW_DEFAULTS(func); #endif if (argdefs != NULL) { d = &PyTuple_GET_ITEM(argdefs, 0); nd = Py_SIZE(argdefs); } else { d = NULL; nd = 0; } #if PY_MAJOR_VERSION >= 3 result = PyEval_EvalCodeEx((PyObject*)co, globals, (PyObject *)NULL, args, nargs, k, (int)nk, d, (int)nd, kwdefs, closure); #else result = PyEval_EvalCodeEx(co, globals, (PyObject *)NULL, args, nargs, k, (int)nk, d, (int)nd, closure); #endif Py_XDECREF(kwtuple); done: Py_LeaveRecursiveCall(); return result; } #endif // CPython < 3.6 #endif // CYTHON_FAST_PYCALL /* PyObjectCallMethO */ #if CYTHON_COMPILING_IN_CPYTHON static CYTHON_INLINE PyObject* __Pyx_PyObject_CallMethO(PyObject *func, PyObject *arg) { PyObject *self, *result; PyCFunction cfunc; cfunc = PyCFunction_GET_FUNCTION(func); self = PyCFunction_GET_SELF(func); if (unlikely(Py_EnterRecursiveCall((char*)" while calling a Python object"))) return NULL; result = cfunc(self, arg); Py_LeaveRecursiveCall(); if (unlikely(!result) && unlikely(!PyErr_Occurred())) { PyErr_SetString( PyExc_SystemError, "NULL result without error in PyObject_Call"); } return result; } #endif /* PyObjectCallOneArg */ #if CYTHON_COMPILING_IN_CPYTHON static PyObject* __Pyx__PyObject_CallOneArg(PyObject *func, PyObject *arg) { PyObject *result; PyObject *args = PyTuple_New(1); if (unlikely(!args)) return NULL; Py_INCREF(arg); PyTuple_SET_ITEM(args, 0, arg); result = __Pyx_PyObject_Call(func, args, NULL); Py_DECREF(args); return result; } static CYTHON_INLINE PyObject* __Pyx_PyObject_CallOneArg(PyObject *func, PyObject *arg) { #if CYTHON_FAST_PYCALL if (PyFunction_Check(func)) { return __Pyx_PyFunction_FastCall(func, &arg, 1); } #endif #ifdef __Pyx_CyFunction_USED if (likely(PyCFunction_Check(func) || PyObject_TypeCheck(func, __pyx_CyFunctionType))) { #else if (likely(PyCFunction_Check(func))) { #endif if (likely(PyCFunction_GET_FLAGS(func) & METH_O)) { return __Pyx_PyObject_CallMethO(func, arg); #if CYTHON_FAST_PYCCALL } else if (PyCFunction_GET_FLAGS(func) & METH_FASTCALL) { return __Pyx_PyCFunction_FastCall(func, &arg, 1); #endif } } return __Pyx__PyObject_CallOneArg(func, arg); } #else static CYTHON_INLINE PyObject* __Pyx_PyObject_CallOneArg(PyObject *func, PyObject *arg) { PyObject *result; PyObject *args = PyTuple_Pack(1, arg); if (unlikely(!args)) return NULL; result = __Pyx_PyObject_Call(func, args, NULL); Py_DECREF(args); return result; } #endif /* PyObjectCallNoArg */ #if CYTHON_COMPILING_IN_CPYTHON static CYTHON_INLINE PyObject* __Pyx_PyObject_CallNoArg(PyObject *func) { #if CYTHON_FAST_PYCALL if (PyFunction_Check(func)) { return __Pyx_PyFunction_FastCall(func, NULL, 0); } #endif #ifdef __Pyx_CyFunction_USED if (likely(PyCFunction_Check(func) || PyObject_TypeCheck(func, __pyx_CyFunctionType))) { #else if (likely(PyCFunction_Check(func))) { #endif if (likely(PyCFunction_GET_FLAGS(func) & METH_NOARGS)) { return __Pyx_PyObject_CallMethO(func, NULL); } } return __Pyx_PyObject_Call(func, __pyx_empty_tuple, NULL); } #endif /* RaiseException */ #if PY_MAJOR_VERSION < 3 static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, CYTHON_UNUSED PyObject *cause) { __Pyx_PyThreadState_declare Py_XINCREF(type); if (!value || value == Py_None) value = NULL; else Py_INCREF(value); if (!tb || tb == Py_None) tb = NULL; else { Py_INCREF(tb); if (!PyTraceBack_Check(tb)) { PyErr_SetString(PyExc_TypeError, "raise: arg 3 must be a traceback or None"); goto raise_error; } } if (PyType_Check(type)) { #if CYTHON_COMPILING_IN_PYPY if (!value) { Py_INCREF(Py_None); value = Py_None; } #endif PyErr_NormalizeException(&type, &value, &tb); } else { if (value) { PyErr_SetString(PyExc_TypeError, "instance exception may not have a separate value"); goto raise_error; } value = type; type = (PyObject*) Py_TYPE(type); Py_INCREF(type); if (!PyType_IsSubtype((PyTypeObject *)type, (PyTypeObject *)PyExc_BaseException)) { PyErr_SetString(PyExc_TypeError, "raise: exception class must be a subclass of BaseException"); goto raise_error; } } __Pyx_PyThreadState_assign __Pyx_ErrRestore(type, value, tb); return; raise_error: Py_XDECREF(value); Py_XDECREF(type); Py_XDECREF(tb); return; } #else static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, PyObject *cause) { PyObject* owned_instance = NULL; if (tb == Py_None) { tb = 0; } else if (tb && !PyTraceBack_Check(tb)) { PyErr_SetString(PyExc_TypeError, "raise: arg 3 must be a traceback or None"); goto bad; } if (value == Py_None) value = 0; if (PyExceptionInstance_Check(type)) { if (value) { PyErr_SetString(PyExc_TypeError, "instance exception may not have a separate value"); goto bad; } value = type; type = (PyObject*) Py_TYPE(value); } else if (PyExceptionClass_Check(type)) { PyObject *instance_class = NULL; if (value && PyExceptionInstance_Check(value)) { instance_class = (PyObject*) Py_TYPE(value); if (instance_class != type) { int is_subclass = PyObject_IsSubclass(instance_class, type); if (!is_subclass) { instance_class = NULL; } else if (unlikely(is_subclass == -1)) { goto bad; } else { type = instance_class; } } } if (!instance_class) { PyObject *args; if (!value) args = PyTuple_New(0); else if (PyTuple_Check(value)) { Py_INCREF(value); args = value; } else args = PyTuple_Pack(1, value); if (!args) goto bad; owned_instance = PyObject_Call(type, args, NULL); Py_DECREF(args); if (!owned_instance) goto bad; value = owned_instance; if (!PyExceptionInstance_Check(value)) { PyErr_Format(PyExc_TypeError, "calling %R should have returned an instance of " "BaseException, not %R", type, Py_TYPE(value)); goto bad; } } } else { PyErr_SetString(PyExc_TypeError, "raise: exception class must be a subclass of BaseException"); goto bad; } #if PY_VERSION_HEX >= 0x03030000 if (cause) { #else if (cause && cause != Py_None) { #endif PyObject *fixed_cause; if (cause == Py_None) { fixed_cause = NULL; } else if (PyExceptionClass_Check(cause)) { fixed_cause = PyObject_CallObject(cause, NULL); if (fixed_cause == NULL) goto bad; } else if (PyExceptionInstance_Check(cause)) { fixed_cause = cause; Py_INCREF(fixed_cause); } else { PyErr_SetString(PyExc_TypeError, "exception causes must derive from " "BaseException"); goto bad; } PyException_SetCause(value, fixed_cause); } PyErr_SetObject(type, value); if (tb) { #if CYTHON_COMPILING_IN_PYPY PyObject *tmp_type, *tmp_value, *tmp_tb; PyErr_Fetch(&tmp_type, &tmp_value, &tmp_tb); Py_INCREF(tb); PyErr_Restore(tmp_type, tmp_value, tb); Py_XDECREF(tmp_tb); #else PyThreadState *tstate = PyThreadState_GET(); PyObject* tmp_tb = tstate->curexc_traceback; if (tb != tmp_tb) { Py_INCREF(tb); tstate->curexc_traceback = tb; Py_XDECREF(tmp_tb); } #endif } bad: Py_XDECREF(owned_instance); return; } #endif /* ArgTypeTest */ static void __Pyx_RaiseArgumentTypeInvalid(const char* name, PyObject *obj, PyTypeObject *type) { PyErr_Format(PyExc_TypeError, "Argument '%.200s' has incorrect type (expected %.200s, got %.200s)", name, type->tp_name, Py_TYPE(obj)->tp_name); } static CYTHON_INLINE int __Pyx_ArgTypeTest(PyObject *obj, PyTypeObject *type, int none_allowed, const char *name, int exact) { if (unlikely(!type)) { PyErr_SetString(PyExc_SystemError, "Missing type object"); return 0; } if (none_allowed && obj == Py_None) return 1; else if (exact) { if (likely(Py_TYPE(obj) == type)) return 1; #if PY_MAJOR_VERSION == 2 else if ((type == &PyBaseString_Type) && likely(__Pyx_PyBaseString_CheckExact(obj))) return 1; #endif } else { if (likely(PyObject_TypeCheck(obj, type))) return 1; } __Pyx_RaiseArgumentTypeInvalid(name, obj, type); return 0; } /* GetItemInt */ static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Generic(PyObject *o, PyObject* j) { PyObject *r; if (!j) return NULL; r = PyObject_GetItem(o, j); Py_DECREF(j); return r; } static CYTHON_INLINE PyObject *__Pyx_GetItemInt_List_Fast(PyObject *o, Py_ssize_t i, CYTHON_NCP_UNUSED int wraparound, CYTHON_NCP_UNUSED int boundscheck) { #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS if (wraparound & unlikely(i < 0)) i += PyList_GET_SIZE(o); if ((!boundscheck) || likely((0 <= i) & (i < PyList_GET_SIZE(o)))) { PyObject *r = PyList_GET_ITEM(o, i); Py_INCREF(r); return r; } return __Pyx_GetItemInt_Generic(o, PyInt_FromSsize_t(i)); #else return PySequence_GetItem(o, i); #endif } static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Tuple_Fast(PyObject *o, Py_ssize_t i, CYTHON_NCP_UNUSED int wraparound, CYTHON_NCP_UNUSED int boundscheck) { #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS if (wraparound & unlikely(i < 0)) i += PyTuple_GET_SIZE(o); if ((!boundscheck) || likely((0 <= i) & (i < PyTuple_GET_SIZE(o)))) { PyObject *r = PyTuple_GET_ITEM(o, i); Py_INCREF(r); return r; } return __Pyx_GetItemInt_Generic(o, PyInt_FromSsize_t(i)); #else return PySequence_GetItem(o, i); #endif } static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Fast(PyObject *o, Py_ssize_t i, int is_list, CYTHON_NCP_UNUSED int wraparound, CYTHON_NCP_UNUSED int boundscheck) { #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS && CYTHON_USE_TYPE_SLOTS if (is_list || PyList_CheckExact(o)) { Py_ssize_t n = ((!wraparound) | likely(i >= 0)) ? i : i + PyList_GET_SIZE(o); if ((!boundscheck) || (likely((n >= 0) & (n < PyList_GET_SIZE(o))))) { PyObject *r = PyList_GET_ITEM(o, n); Py_INCREF(r); return r; } } else if (PyTuple_CheckExact(o)) { Py_ssize_t n = ((!wraparound) | likely(i >= 0)) ? i : i + PyTuple_GET_SIZE(o); if ((!boundscheck) || likely((n >= 0) & (n < PyTuple_GET_SIZE(o)))) { PyObject *r = PyTuple_GET_ITEM(o, n); Py_INCREF(r); return r; } } else { PySequenceMethods *m = Py_TYPE(o)->tp_as_sequence; if (likely(m && m->sq_item)) { if (wraparound && unlikely(i < 0) && likely(m->sq_length)) { Py_ssize_t l = m->sq_length(o); if (likely(l >= 0)) { i += l; } else { if (!PyErr_ExceptionMatches(PyExc_OverflowError)) return NULL; PyErr_Clear(); } } return m->sq_item(o, i); } } #else if (is_list || PySequence_Check(o)) { return PySequence_GetItem(o, i); } #endif return __Pyx_GetItemInt_Generic(o, PyInt_FromSsize_t(i)); } /* PyObjectCallMethod1 */ static PyObject* __Pyx_PyObject_CallMethod1(PyObject* obj, PyObject* method_name, PyObject* arg) { PyObject *method, *result = NULL; method = __Pyx_PyObject_GetAttrStr(obj, method_name); if (unlikely(!method)) goto done; #if CYTHON_UNPACK_METHODS if (likely(PyMethod_Check(method))) { PyObject *self = PyMethod_GET_SELF(method); if (likely(self)) { PyObject *args; PyObject *function = PyMethod_GET_FUNCTION(method); #if CYTHON_FAST_PYCALL if (PyFunction_Check(function)) { PyObject *args[2] = {self, arg}; result = __Pyx_PyFunction_FastCall(function, args, 2); goto done; } #endif #if CYTHON_FAST_PYCCALL if (__Pyx_PyFastCFunction_Check(function)) { PyObject *args[2] = {self, arg}; result = __Pyx_PyCFunction_FastCall(function, args, 2); goto done; } #endif args = PyTuple_New(2); if (unlikely(!args)) goto done; Py_INCREF(self); PyTuple_SET_ITEM(args, 0, self); Py_INCREF(arg); PyTuple_SET_ITEM(args, 1, arg); Py_INCREF(function); Py_DECREF(method); method = NULL; result = __Pyx_PyObject_Call(function, args, NULL); Py_DECREF(args); Py_DECREF(function); return result; } } #endif result = __Pyx_PyObject_CallOneArg(method, arg); done: Py_XDECREF(method); return result; } /* append */ static CYTHON_INLINE int __Pyx_PyObject_Append(PyObject* L, PyObject* x) { if (likely(PyList_CheckExact(L))) { if (unlikely(__Pyx_PyList_Append(L, x) < 0)) return -1; } else { PyObject* retval = __Pyx_PyObject_CallMethod1(L, __pyx_n_s_append, x); if (unlikely(!retval)) return -1; Py_DECREF(retval); } return 0; } /* PyObjectCallMethod0 */ static PyObject* __Pyx_PyObject_CallMethod0(PyObject* obj, PyObject* method_name) { PyObject *method, *result = NULL; method = __Pyx_PyObject_GetAttrStr(obj, method_name); if (unlikely(!method)) goto bad; #if CYTHON_UNPACK_METHODS if (likely(PyMethod_Check(method))) { PyObject *self = PyMethod_GET_SELF(method); if (likely(self)) { PyObject *function = PyMethod_GET_FUNCTION(method); result = __Pyx_PyObject_CallOneArg(function, self); Py_DECREF(method); return result; } } #endif result = __Pyx_PyObject_CallNoArg(method); Py_DECREF(method); bad: return result; } /* RaiseNoneIterError */ static CYTHON_INLINE void __Pyx_RaiseNoneNotIterableError(void) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable"); } /* UnpackTupleError */ static void __Pyx_UnpackTupleError(PyObject *t, Py_ssize_t index) { if (t == Py_None) { __Pyx_RaiseNoneNotIterableError(); } else if (PyTuple_GET_SIZE(t) < index) { __Pyx_RaiseNeedMoreValuesError(PyTuple_GET_SIZE(t)); } else { __Pyx_RaiseTooManyValuesError(index); } } /* UnpackTuple2 */ static CYTHON_INLINE int __Pyx_unpack_tuple2(PyObject* tuple, PyObject** pvalue1, PyObject** pvalue2, int is_tuple, int has_known_size, int decref_tuple) { Py_ssize_t index; PyObject *value1 = NULL, *value2 = NULL, *iter = NULL; if (!is_tuple && unlikely(!PyTuple_Check(tuple))) { iternextfunc iternext; iter = PyObject_GetIter(tuple); if (unlikely(!iter)) goto bad; if (decref_tuple) { Py_DECREF(tuple); tuple = NULL; } iternext = Py_TYPE(iter)->tp_iternext; value1 = iternext(iter); if (unlikely(!value1)) { index = 0; goto unpacking_failed; } value2 = iternext(iter); if (unlikely(!value2)) { index = 1; goto unpacking_failed; } if (!has_known_size && unlikely(__Pyx_IternextUnpackEndCheck(iternext(iter), 2))) goto bad; Py_DECREF(iter); } else { if (!has_known_size && unlikely(PyTuple_GET_SIZE(tuple) != 2)) { __Pyx_UnpackTupleError(tuple, 2); goto bad; } #if CYTHON_COMPILING_IN_PYPY value1 = PySequence_ITEM(tuple, 0); if (unlikely(!value1)) goto bad; value2 = PySequence_ITEM(tuple, 1); if (unlikely(!value2)) goto bad; #else value1 = PyTuple_GET_ITEM(tuple, 0); value2 = PyTuple_GET_ITEM(tuple, 1); Py_INCREF(value1); Py_INCREF(value2); #endif if (decref_tuple) { Py_DECREF(tuple); } } *pvalue1 = value1; *pvalue2 = value2; return 0; unpacking_failed: if (!has_known_size && __Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); bad: Py_XDECREF(iter); Py_XDECREF(value1); Py_XDECREF(value2); if (decref_tuple) { Py_XDECREF(tuple); } return -1; } /* dict_iter */ static CYTHON_INLINE PyObject* __Pyx_dict_iterator(PyObject* iterable, int is_dict, PyObject* method_name, Py_ssize_t* p_orig_length, int* p_source_is_dict) { is_dict = is_dict || likely(PyDict_CheckExact(iterable)); *p_source_is_dict = is_dict; #if !CYTHON_COMPILING_IN_PYPY if (is_dict) { *p_orig_length = PyDict_Size(iterable); Py_INCREF(iterable); return iterable; } #endif *p_orig_length = 0; if (method_name) { PyObject* iter; iterable = __Pyx_PyObject_CallMethod0(iterable, method_name); if (!iterable) return NULL; #if !CYTHON_COMPILING_IN_PYPY if (PyTuple_CheckExact(iterable) || PyList_CheckExact(iterable)) return iterable; #endif iter = PyObject_GetIter(iterable); Py_DECREF(iterable); return iter; } return PyObject_GetIter(iterable); } static CYTHON_INLINE int __Pyx_dict_iter_next( PyObject* iter_obj, CYTHON_NCP_UNUSED Py_ssize_t orig_length, CYTHON_NCP_UNUSED Py_ssize_t* ppos, PyObject** pkey, PyObject** pvalue, PyObject** pitem, int source_is_dict) { PyObject* next_item; #if !CYTHON_COMPILING_IN_PYPY if (source_is_dict) { PyObject *key, *value; if (unlikely(orig_length != PyDict_Size(iter_obj))) { PyErr_SetString(PyExc_RuntimeError, "dictionary changed size during iteration"); return -1; } if (unlikely(!PyDict_Next(iter_obj, ppos, &key, &value))) { return 0; } if (pitem) { PyObject* tuple = PyTuple_New(2); if (unlikely(!tuple)) { return -1; } Py_INCREF(key); Py_INCREF(value); PyTuple_SET_ITEM(tuple, 0, key); PyTuple_SET_ITEM(tuple, 1, value); *pitem = tuple; } else { if (pkey) { Py_INCREF(key); *pkey = key; } if (pvalue) { Py_INCREF(value); *pvalue = value; } } return 1; } else if (PyTuple_CheckExact(iter_obj)) { Py_ssize_t pos = *ppos; if (unlikely(pos >= PyTuple_GET_SIZE(iter_obj))) return 0; *ppos = pos + 1; next_item = PyTuple_GET_ITEM(iter_obj, pos); Py_INCREF(next_item); } else if (PyList_CheckExact(iter_obj)) { Py_ssize_t pos = *ppos; if (unlikely(pos >= PyList_GET_SIZE(iter_obj))) return 0; *ppos = pos + 1; next_item = PyList_GET_ITEM(iter_obj, pos); Py_INCREF(next_item); } else #endif { next_item = PyIter_Next(iter_obj); if (unlikely(!next_item)) { return __Pyx_IterFinish(); } } if (pitem) { *pitem = next_item; } else if (pkey && pvalue) { if (__Pyx_unpack_tuple2(next_item, pkey, pvalue, source_is_dict, source_is_dict, 1)) return -1; } else if (pkey) { *pkey = next_item; } else { *pvalue = next_item; } return 1; } /* SetVTable */ static int __Pyx_SetVtable(PyObject *dict, void *vtable) { #if PY_VERSION_HEX >= 0x02070000 PyObject *ob = PyCapsule_New(vtable, 0, 0); #else PyObject *ob = PyCObject_FromVoidPtr(vtable, 0); #endif if (!ob) goto bad; if (PyDict_SetItem(dict, __pyx_n_s_pyx_vtable, ob) < 0) goto bad; Py_DECREF(ob); return 0; bad: Py_XDECREF(ob); return -1; } /* GetVTable */ static void* __Pyx_GetVtable(PyObject *dict) { void* ptr; PyObject *ob = PyObject_GetItem(dict, __pyx_n_s_pyx_vtable); if (!ob) goto bad; #if PY_VERSION_HEX >= 0x02070000 ptr = PyCapsule_GetPointer(ob, 0); #else ptr = PyCObject_AsVoidPtr(ob); #endif if (!ptr && !PyErr_Occurred()) PyErr_SetString(PyExc_RuntimeError, "invalid vtable found for imported type"); Py_DECREF(ob); return ptr; bad: Py_XDECREF(ob); return NULL; } /* Import */ static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list, int level) { PyObject *empty_list = 0; PyObject *module = 0; PyObject *global_dict = 0; PyObject *empty_dict = 0; PyObject *list; #if PY_VERSION_HEX < 0x03030000 PyObject *py_import; py_import = __Pyx_PyObject_GetAttrStr(__pyx_b, __pyx_n_s_import); if (!py_import) goto bad; #endif if (from_list) list = from_list; else { empty_list = PyList_New(0); if (!empty_list) goto bad; list = empty_list; } global_dict = PyModule_GetDict(__pyx_m); if (!global_dict) goto bad; empty_dict = PyDict_New(); if (!empty_dict) goto bad; { #if PY_MAJOR_VERSION >= 3 if (level == -1) { if (strchr(__Pyx_MODULE_NAME, '.')) { #if PY_VERSION_HEX < 0x03030000 PyObject *py_level = PyInt_FromLong(1); if (!py_level) goto bad; module = PyObject_CallFunctionObjArgs(py_import, name, global_dict, empty_dict, list, py_level, NULL); Py_DECREF(py_level); #else module = PyImport_ImportModuleLevelObject( name, global_dict, empty_dict, list, 1); #endif if (!module) { if (!PyErr_ExceptionMatches(PyExc_ImportError)) goto bad; PyErr_Clear(); } } level = 0; } #endif if (!module) { #if PY_VERSION_HEX < 0x03030000 PyObject *py_level = PyInt_FromLong(level); if (!py_level) goto bad; module = PyObject_CallFunctionObjArgs(py_import, name, global_dict, empty_dict, list, py_level, NULL); Py_DECREF(py_level); #else module = PyImport_ImportModuleLevelObject( name, global_dict, empty_dict, list, level); #endif } } bad: #if PY_VERSION_HEX < 0x03030000 Py_XDECREF(py_import); #endif Py_XDECREF(empty_list); Py_XDECREF(empty_dict); return module; } /* ImportFrom */ static PyObject* __Pyx_ImportFrom(PyObject* module, PyObject* name) { PyObject* value = __Pyx_PyObject_GetAttrStr(module, name); if (unlikely(!value) && PyErr_ExceptionMatches(PyExc_AttributeError)) { PyErr_Format(PyExc_ImportError, #if PY_MAJOR_VERSION < 3 "cannot import name %.230s", PyString_AS_STRING(name)); #else "cannot import name %S", name); #endif } return value; } /* CodeObjectCache */ static int __pyx_bisect_code_objects(__Pyx_CodeObjectCacheEntry* entries, int count, int code_line) { int start = 0, mid = 0, end = count - 1; if (end >= 0 && code_line > entries[end].code_line) { return count; } while (start < end) { mid = start + (end - start) / 2; if (code_line < entries[mid].code_line) { end = mid; } else if (code_line > entries[mid].code_line) { start = mid + 1; } else { return mid; } } if (code_line <= entries[mid].code_line) { return mid; } else { return mid + 1; } } static PyCodeObject *__pyx_find_code_object(int code_line) { PyCodeObject* code_object; int pos; if (unlikely(!code_line) || unlikely(!__pyx_code_cache.entries)) { return NULL; } pos = __pyx_bisect_code_objects(__pyx_code_cache.entries, __pyx_code_cache.count, code_line); if (unlikely(pos >= __pyx_code_cache.count) || unlikely(__pyx_code_cache.entries[pos].code_line != code_line)) { return NULL; } code_object = __pyx_code_cache.entries[pos].code_object; Py_INCREF(code_object); return code_object; } static void __pyx_insert_code_object(int code_line, PyCodeObject* code_object) { int pos, i; __Pyx_CodeObjectCacheEntry* entries = __pyx_code_cache.entries; if (unlikely(!code_line)) { return; } if (unlikely(!entries)) { entries = (__Pyx_CodeObjectCacheEntry*)PyMem_Malloc(64*sizeof(__Pyx_CodeObjectCacheEntry)); if (likely(entries)) { __pyx_code_cache.entries = entries; __pyx_code_cache.max_count = 64; __pyx_code_cache.count = 1; entries[0].code_line = code_line; entries[0].code_object = code_object; Py_INCREF(code_object); } return; } pos = __pyx_bisect_code_objects(__pyx_code_cache.entries, __pyx_code_cache.count, code_line); if ((pos < __pyx_code_cache.count) && unlikely(__pyx_code_cache.entries[pos].code_line == code_line)) { PyCodeObject* tmp = entries[pos].code_object; entries[pos].code_object = code_object; Py_DECREF(tmp); return; } if (__pyx_code_cache.count == __pyx_code_cache.max_count) { int new_max = __pyx_code_cache.max_count + 64; entries = (__Pyx_CodeObjectCacheEntry*)PyMem_Realloc( __pyx_code_cache.entries, (size_t)new_max*sizeof(__Pyx_CodeObjectCacheEntry)); if (unlikely(!entries)) { return; } __pyx_code_cache.entries = entries; __pyx_code_cache.max_count = new_max; } for (i=__pyx_code_cache.count; i>pos; i--) { entries[i] = entries[i-1]; } entries[pos].code_line = code_line; entries[pos].code_object = code_object; __pyx_code_cache.count++; Py_INCREF(code_object); } /* AddTraceback */ #include "compile.h" #include "frameobject.h" #include "traceback.h" static PyCodeObject* __Pyx_CreateCodeObjectForTraceback( const char *funcname, int c_line, int py_line, const char *filename) { PyCodeObject *py_code = 0; PyObject *py_srcfile = 0; PyObject *py_funcname = 0; #if PY_MAJOR_VERSION < 3 py_srcfile = PyString_FromString(filename); #else py_srcfile = PyUnicode_FromString(filename); #endif if (!py_srcfile) goto bad; if (c_line) { #if PY_MAJOR_VERSION < 3 py_funcname = PyString_FromFormat( "%s (%s:%d)", funcname, __pyx_cfilenm, c_line); #else py_funcname = PyUnicode_FromFormat( "%s (%s:%d)", funcname, __pyx_cfilenm, c_line); #endif } else { #if PY_MAJOR_VERSION < 3 py_funcname = PyString_FromString(funcname); #else py_funcname = PyUnicode_FromString(funcname); #endif } if (!py_funcname) goto bad; py_code = __Pyx_PyCode_New( 0, 0, 0, 0, 0, __pyx_empty_bytes, /*PyObject *code,*/ __pyx_empty_tuple, /*PyObject *consts,*/ __pyx_empty_tuple, /*PyObject *names,*/ __pyx_empty_tuple, /*PyObject *varnames,*/ __pyx_empty_tuple, /*PyObject *freevars,*/ __pyx_empty_tuple, /*PyObject *cellvars,*/ py_srcfile, /*PyObject *filename,*/ py_funcname, /*PyObject *name,*/ py_line, __pyx_empty_bytes /*PyObject *lnotab*/ ); Py_DECREF(py_srcfile); Py_DECREF(py_funcname); return py_code; bad: Py_XDECREF(py_srcfile); Py_XDECREF(py_funcname); return NULL; } static void __Pyx_AddTraceback(const char *funcname, int c_line, int py_line, const char *filename) { PyCodeObject *py_code = 0; PyFrameObject *py_frame = 0; py_code = __pyx_find_code_object(c_line ? c_line : py_line); if (!py_code) { py_code = __Pyx_CreateCodeObjectForTraceback( funcname, c_line, py_line, filename); if (!py_code) goto bad; __pyx_insert_code_object(c_line ? c_line : py_line, py_code); } py_frame = PyFrame_New( PyThreadState_GET(), /*PyThreadState *tstate,*/ py_code, /*PyCodeObject *code,*/ __pyx_d, /*PyObject *globals,*/ 0 /*PyObject *locals*/ ); if (!py_frame) goto bad; __Pyx_PyFrame_SetLineNumber(py_frame, py_line); PyTraceBack_Here(py_frame); bad: Py_XDECREF(py_code); Py_XDECREF(py_frame); } /* CIntFromPyVerify */ #define __PYX_VERIFY_RETURN_INT(target_type, func_type, func_value)\ __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, 0) #define __PYX_VERIFY_RETURN_INT_EXC(target_type, func_type, func_value)\ __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, 1) #define __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, exc)\ {\ func_type value = func_value;\ if (sizeof(target_type) < sizeof(func_type)) {\ if (unlikely(value != (func_type) (target_type) value)) {\ func_type zero = 0;\ if (exc && unlikely(value == (func_type)-1 && PyErr_Occurred()))\ return (target_type) -1;\ if (is_unsigned && unlikely(value < zero))\ goto raise_neg_overflow;\ else\ goto raise_overflow;\ }\ }\ return (target_type) value;\ } /* CIntToPy */ static CYTHON_INLINE PyObject* __Pyx_PyInt_From_int(int value) { const int neg_one = (int) -1, const_zero = (int) 0; const int is_unsigned = neg_one > const_zero; if (is_unsigned) { if (sizeof(int) < sizeof(long)) { return PyInt_FromLong((long) value); } else if (sizeof(int) <= sizeof(unsigned long)) { return PyLong_FromUnsignedLong((unsigned long) value); #ifdef HAVE_LONG_LONG } else if (sizeof(int) <= sizeof(unsigned PY_LONG_LONG)) { return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value); #endif } } else { if (sizeof(int) <= sizeof(long)) { return PyInt_FromLong((long) value); #ifdef HAVE_LONG_LONG } else if (sizeof(int) <= sizeof(PY_LONG_LONG)) { return PyLong_FromLongLong((PY_LONG_LONG) value); #endif } } { int one = 1; int little = (int)*(unsigned char *)&one; unsigned char *bytes = (unsigned char *)&value; return _PyLong_FromByteArray(bytes, sizeof(int), little, !is_unsigned); } } /* CIntToPy */ static CYTHON_INLINE PyObject* __Pyx_PyInt_From_uint32_t(uint32_t value) { const uint32_t neg_one = (uint32_t) -1, const_zero = (uint32_t) 0; const int is_unsigned = neg_one > const_zero; if (is_unsigned) { if (sizeof(uint32_t) < sizeof(long)) { return PyInt_FromLong((long) value); } else if (sizeof(uint32_t) <= sizeof(unsigned long)) { return PyLong_FromUnsignedLong((unsigned long) value); #ifdef HAVE_LONG_LONG } else if (sizeof(uint32_t) <= sizeof(unsigned PY_LONG_LONG)) { return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value); #endif } } else { if (sizeof(uint32_t) <= sizeof(long)) { return PyInt_FromLong((long) value); #ifdef HAVE_LONG_LONG } else if (sizeof(uint32_t) <= sizeof(PY_LONG_LONG)) { return PyLong_FromLongLong((PY_LONG_LONG) value); #endif } } { int one = 1; int little = (int)*(unsigned char *)&one; unsigned char *bytes = (unsigned char *)&value; return _PyLong_FromByteArray(bytes, sizeof(uint32_t), little, !is_unsigned); } } /* CIntToPy */ static CYTHON_INLINE PyObject* __Pyx_PyInt_From_uint8_t(uint8_t value) { const uint8_t neg_one = (uint8_t) -1, const_zero = (uint8_t) 0; const int is_unsigned = neg_one > const_zero; if (is_unsigned) { if (sizeof(uint8_t) < sizeof(long)) { return PyInt_FromLong((long) value); } else if (sizeof(uint8_t) <= sizeof(unsigned long)) { return PyLong_FromUnsignedLong((unsigned long) value); #ifdef HAVE_LONG_LONG } else if (sizeof(uint8_t) <= sizeof(unsigned PY_LONG_LONG)) { return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value); #endif } } else { if (sizeof(uint8_t) <= sizeof(long)) { return PyInt_FromLong((long) value); #ifdef HAVE_LONG_LONG } else if (sizeof(uint8_t) <= sizeof(PY_LONG_LONG)) { return PyLong_FromLongLong((PY_LONG_LONG) value); #endif } } { int one = 1; int little = (int)*(unsigned char *)&one; unsigned char *bytes = (unsigned char *)&value; return _PyLong_FromByteArray(bytes, sizeof(uint8_t), little, !is_unsigned); } } /* CIntToPy */ static CYTHON_INLINE PyObject* __Pyx_PyInt_From_long(long value) { const long neg_one = (long) -1, const_zero = (long) 0; const int is_unsigned = neg_one > const_zero; if (is_unsigned) { if (sizeof(long) < sizeof(long)) { return PyInt_FromLong((long) value); } else if (sizeof(long) <= sizeof(unsigned long)) { return PyLong_FromUnsignedLong((unsigned long) value); #ifdef HAVE_LONG_LONG } else if (sizeof(long) <= sizeof(unsigned PY_LONG_LONG)) { return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value); #endif } } else { if (sizeof(long) <= sizeof(long)) { return PyInt_FromLong((long) value); #ifdef HAVE_LONG_LONG } else if (sizeof(long) <= sizeof(PY_LONG_LONG)) { return PyLong_FromLongLong((PY_LONG_LONG) value); #endif } } { int one = 1; int little = (int)*(unsigned char *)&one; unsigned char *bytes = (unsigned char *)&value; return _PyLong_FromByteArray(bytes, sizeof(long), little, !is_unsigned); } } /* CIntToPy */ static CYTHON_INLINE PyObject* __Pyx_PyInt_From_uint64_t(uint64_t value) { const uint64_t neg_one = (uint64_t) -1, const_zero = (uint64_t) 0; const int is_unsigned = neg_one > const_zero; if (is_unsigned) { if (sizeof(uint64_t) < sizeof(long)) { return PyInt_FromLong((long) value); } else if (sizeof(uint64_t) <= sizeof(unsigned long)) { return PyLong_FromUnsignedLong((unsigned long) value); #ifdef HAVE_LONG_LONG } else if (sizeof(uint64_t) <= sizeof(unsigned PY_LONG_LONG)) { return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value); #endif } } else { if (sizeof(uint64_t) <= sizeof(long)) { return PyInt_FromLong((long) value); #ifdef HAVE_LONG_LONG } else if (sizeof(uint64_t) <= sizeof(PY_LONG_LONG)) { return PyLong_FromLongLong((PY_LONG_LONG) value); #endif } } { int one = 1; int little = (int)*(unsigned char *)&one; unsigned char *bytes = (unsigned char *)&value; return _PyLong_FromByteArray(bytes, sizeof(uint64_t), little, !is_unsigned); } } /* CIntFromPy */ static CYTHON_INLINE int __Pyx_PyInt_As_int(PyObject *x) { const int neg_one = (int) -1, const_zero = (int) 0; const int is_unsigned = neg_one > const_zero; #if PY_MAJOR_VERSION < 3 if (likely(PyInt_Check(x))) { if (sizeof(int) < sizeof(long)) { __PYX_VERIFY_RETURN_INT(int, long, PyInt_AS_LONG(x)) } else { long val = PyInt_AS_LONG(x); if (is_unsigned && unlikely(val < 0)) { goto raise_neg_overflow; } return (int) val; } } else #endif if (likely(PyLong_Check(x))) { if (is_unsigned) { #if CYTHON_USE_PYLONG_INTERNALS const digit* digits = ((PyLongObject*)x)->ob_digit; switch (Py_SIZE(x)) { case 0: return (int) 0; case 1: __PYX_VERIFY_RETURN_INT(int, digit, digits[0]) case 2: if (8 * sizeof(int) > 1 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(int) >= 2 * PyLong_SHIFT) { return (int) (((((int)digits[1]) << PyLong_SHIFT) | (int)digits[0])); } } break; case 3: if (8 * sizeof(int) > 2 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(int) >= 3 * PyLong_SHIFT) { return (int) (((((((int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0])); } } break; case 4: if (8 * sizeof(int) > 3 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(int) >= 4 * PyLong_SHIFT) { return (int) (((((((((int)digits[3]) << PyLong_SHIFT) | (int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0])); } } break; } #endif #if CYTHON_COMPILING_IN_CPYTHON if (unlikely(Py_SIZE(x) < 0)) { goto raise_neg_overflow; } #else { int result = PyObject_RichCompareBool(x, Py_False, Py_LT); if (unlikely(result < 0)) return (int) -1; if (unlikely(result == 1)) goto raise_neg_overflow; } #endif if (sizeof(int) <= sizeof(unsigned long)) { __PYX_VERIFY_RETURN_INT_EXC(int, unsigned long, PyLong_AsUnsignedLong(x)) #ifdef HAVE_LONG_LONG } else if (sizeof(int) <= sizeof(unsigned PY_LONG_LONG)) { __PYX_VERIFY_RETURN_INT_EXC(int, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x)) #endif } } else { #if CYTHON_USE_PYLONG_INTERNALS const digit* digits = ((PyLongObject*)x)->ob_digit; switch (Py_SIZE(x)) { case 0: return (int) 0; case -1: __PYX_VERIFY_RETURN_INT(int, sdigit, (sdigit) (-(sdigit)digits[0])) case 1: __PYX_VERIFY_RETURN_INT(int, digit, +digits[0]) case -2: if (8 * sizeof(int) - 1 > 1 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(int, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(int) - 1 > 2 * PyLong_SHIFT) { return (int) (((int)-1)*(((((int)digits[1]) << PyLong_SHIFT) | (int)digits[0]))); } } break; case 2: if (8 * sizeof(int) > 1 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(int) - 1 > 2 * PyLong_SHIFT) { return (int) ((((((int)digits[1]) << PyLong_SHIFT) | (int)digits[0]))); } } break; case -3: if (8 * sizeof(int) - 1 > 2 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(int, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(int) - 1 > 3 * PyLong_SHIFT) { return (int) (((int)-1)*(((((((int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0]))); } } break; case 3: if (8 * sizeof(int) > 2 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(int) - 1 > 3 * PyLong_SHIFT) { return (int) ((((((((int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0]))); } } break; case -4: if (8 * sizeof(int) - 1 > 3 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(int, long, -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(int) - 1 > 4 * PyLong_SHIFT) { return (int) (((int)-1)*(((((((((int)digits[3]) << PyLong_SHIFT) | (int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0]))); } } break; case 4: if (8 * sizeof(int) > 3 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(int) - 1 > 4 * PyLong_SHIFT) { return (int) ((((((((((int)digits[3]) << PyLong_SHIFT) | (int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0]))); } } break; } #endif if (sizeof(int) <= sizeof(long)) { __PYX_VERIFY_RETURN_INT_EXC(int, long, PyLong_AsLong(x)) #ifdef HAVE_LONG_LONG } else if (sizeof(int) <= sizeof(PY_LONG_LONG)) { __PYX_VERIFY_RETURN_INT_EXC(int, PY_LONG_LONG, PyLong_AsLongLong(x)) #endif } } { #if CYTHON_COMPILING_IN_PYPY && !defined(_PyLong_AsByteArray) PyErr_SetString(PyExc_RuntimeError, "_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers"); #else int val; PyObject *v = __Pyx_PyNumber_IntOrLong(x); #if PY_MAJOR_VERSION < 3 if (likely(v) && !PyLong_Check(v)) { PyObject *tmp = v; v = PyNumber_Long(tmp); Py_DECREF(tmp); } #endif if (likely(v)) { int one = 1; int is_little = (int)*(unsigned char *)&one; unsigned char *bytes = (unsigned char *)&val; int ret = _PyLong_AsByteArray((PyLongObject *)v, bytes, sizeof(val), is_little, !is_unsigned); Py_DECREF(v); if (likely(!ret)) return val; } #endif return (int) -1; } } else { int val; PyObject *tmp = __Pyx_PyNumber_IntOrLong(x); if (!tmp) return (int) -1; val = __Pyx_PyInt_As_int(tmp); Py_DECREF(tmp); return val; } raise_overflow: PyErr_SetString(PyExc_OverflowError, "value too large to convert to int"); return (int) -1; raise_neg_overflow: PyErr_SetString(PyExc_OverflowError, "can't convert negative value to int"); return (int) -1; } /* CIntFromPy */ static CYTHON_INLINE uint32_t __Pyx_PyInt_As_uint32_t(PyObject *x) { const uint32_t neg_one = (uint32_t) -1, const_zero = (uint32_t) 0; const int is_unsigned = neg_one > const_zero; #if PY_MAJOR_VERSION < 3 if (likely(PyInt_Check(x))) { if (sizeof(uint32_t) < sizeof(long)) { __PYX_VERIFY_RETURN_INT(uint32_t, long, PyInt_AS_LONG(x)) } else { long val = PyInt_AS_LONG(x); if (is_unsigned && unlikely(val < 0)) { goto raise_neg_overflow; } return (uint32_t) val; } } else #endif if (likely(PyLong_Check(x))) { if (is_unsigned) { #if CYTHON_USE_PYLONG_INTERNALS const digit* digits = ((PyLongObject*)x)->ob_digit; switch (Py_SIZE(x)) { case 0: return (uint32_t) 0; case 1: __PYX_VERIFY_RETURN_INT(uint32_t, digit, digits[0]) case 2: if (8 * sizeof(uint32_t) > 1 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(uint32_t, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(uint32_t) >= 2 * PyLong_SHIFT) { return (uint32_t) (((((uint32_t)digits[1]) << PyLong_SHIFT) | (uint32_t)digits[0])); } } break; case 3: if (8 * sizeof(uint32_t) > 2 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(uint32_t, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(uint32_t) >= 3 * PyLong_SHIFT) { return (uint32_t) (((((((uint32_t)digits[2]) << PyLong_SHIFT) | (uint32_t)digits[1]) << PyLong_SHIFT) | (uint32_t)digits[0])); } } break; case 4: if (8 * sizeof(uint32_t) > 3 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(uint32_t, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(uint32_t) >= 4 * PyLong_SHIFT) { return (uint32_t) (((((((((uint32_t)digits[3]) << PyLong_SHIFT) | (uint32_t)digits[2]) << PyLong_SHIFT) | (uint32_t)digits[1]) << PyLong_SHIFT) | (uint32_t)digits[0])); } } break; } #endif #if CYTHON_COMPILING_IN_CPYTHON if (unlikely(Py_SIZE(x) < 0)) { goto raise_neg_overflow; } #else { int result = PyObject_RichCompareBool(x, Py_False, Py_LT); if (unlikely(result < 0)) return (uint32_t) -1; if (unlikely(result == 1)) goto raise_neg_overflow; } #endif if (sizeof(uint32_t) <= sizeof(unsigned long)) { __PYX_VERIFY_RETURN_INT_EXC(uint32_t, unsigned long, PyLong_AsUnsignedLong(x)) #ifdef HAVE_LONG_LONG } else if (sizeof(uint32_t) <= sizeof(unsigned PY_LONG_LONG)) { __PYX_VERIFY_RETURN_INT_EXC(uint32_t, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x)) #endif } } else { #if CYTHON_USE_PYLONG_INTERNALS const digit* digits = ((PyLongObject*)x)->ob_digit; switch (Py_SIZE(x)) { case 0: return (uint32_t) 0; case -1: __PYX_VERIFY_RETURN_INT(uint32_t, sdigit, (sdigit) (-(sdigit)digits[0])) case 1: __PYX_VERIFY_RETURN_INT(uint32_t, digit, +digits[0]) case -2: if (8 * sizeof(uint32_t) - 1 > 1 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(uint32_t, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(uint32_t) - 1 > 2 * PyLong_SHIFT) { return (uint32_t) (((uint32_t)-1)*(((((uint32_t)digits[1]) << PyLong_SHIFT) | (uint32_t)digits[0]))); } } break; case 2: if (8 * sizeof(uint32_t) > 1 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(uint32_t, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(uint32_t) - 1 > 2 * PyLong_SHIFT) { return (uint32_t) ((((((uint32_t)digits[1]) << PyLong_SHIFT) | (uint32_t)digits[0]))); } } break; case -3: if (8 * sizeof(uint32_t) - 1 > 2 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(uint32_t, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(uint32_t) - 1 > 3 * PyLong_SHIFT) { return (uint32_t) (((uint32_t)-1)*(((((((uint32_t)digits[2]) << PyLong_SHIFT) | (uint32_t)digits[1]) << PyLong_SHIFT) | (uint32_t)digits[0]))); } } break; case 3: if (8 * sizeof(uint32_t) > 2 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(uint32_t, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(uint32_t) - 1 > 3 * PyLong_SHIFT) { return (uint32_t) ((((((((uint32_t)digits[2]) << PyLong_SHIFT) | (uint32_t)digits[1]) << PyLong_SHIFT) | (uint32_t)digits[0]))); } } break; case -4: if (8 * sizeof(uint32_t) - 1 > 3 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(uint32_t, long, -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(uint32_t) - 1 > 4 * PyLong_SHIFT) { return (uint32_t) (((uint32_t)-1)*(((((((((uint32_t)digits[3]) << PyLong_SHIFT) | (uint32_t)digits[2]) << PyLong_SHIFT) | (uint32_t)digits[1]) << PyLong_SHIFT) | (uint32_t)digits[0]))); } } break; case 4: if (8 * sizeof(uint32_t) > 3 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(uint32_t, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(uint32_t) - 1 > 4 * PyLong_SHIFT) { return (uint32_t) ((((((((((uint32_t)digits[3]) << PyLong_SHIFT) | (uint32_t)digits[2]) << PyLong_SHIFT) | (uint32_t)digits[1]) << PyLong_SHIFT) | (uint32_t)digits[0]))); } } break; } #endif if (sizeof(uint32_t) <= sizeof(long)) { __PYX_VERIFY_RETURN_INT_EXC(uint32_t, long, PyLong_AsLong(x)) #ifdef HAVE_LONG_LONG } else if (sizeof(uint32_t) <= sizeof(PY_LONG_LONG)) { __PYX_VERIFY_RETURN_INT_EXC(uint32_t, PY_LONG_LONG, PyLong_AsLongLong(x)) #endif } } { #if CYTHON_COMPILING_IN_PYPY && !defined(_PyLong_AsByteArray) PyErr_SetString(PyExc_RuntimeError, "_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers"); #else uint32_t val; PyObject *v = __Pyx_PyNumber_IntOrLong(x); #if PY_MAJOR_VERSION < 3 if (likely(v) && !PyLong_Check(v)) { PyObject *tmp = v; v = PyNumber_Long(tmp); Py_DECREF(tmp); } #endif if (likely(v)) { int one = 1; int is_little = (int)*(unsigned char *)&one; unsigned char *bytes = (unsigned char *)&val; int ret = _PyLong_AsByteArray((PyLongObject *)v, bytes, sizeof(val), is_little, !is_unsigned); Py_DECREF(v); if (likely(!ret)) return val; } #endif return (uint32_t) -1; } } else { uint32_t val; PyObject *tmp = __Pyx_PyNumber_IntOrLong(x); if (!tmp) return (uint32_t) -1; val = __Pyx_PyInt_As_uint32_t(tmp); Py_DECREF(tmp); return val; } raise_overflow: PyErr_SetString(PyExc_OverflowError, "value too large to convert to uint32_t"); return (uint32_t) -1; raise_neg_overflow: PyErr_SetString(PyExc_OverflowError, "can't convert negative value to uint32_t"); return (uint32_t) -1; } /* CIntFromPy */ static CYTHON_INLINE uint8_t __Pyx_PyInt_As_uint8_t(PyObject *x) { const uint8_t neg_one = (uint8_t) -1, const_zero = (uint8_t) 0; const int is_unsigned = neg_one > const_zero; #if PY_MAJOR_VERSION < 3 if (likely(PyInt_Check(x))) { if (sizeof(uint8_t) < sizeof(long)) { __PYX_VERIFY_RETURN_INT(uint8_t, long, PyInt_AS_LONG(x)) } else { long val = PyInt_AS_LONG(x); if (is_unsigned && unlikely(val < 0)) { goto raise_neg_overflow; } return (uint8_t) val; } } else #endif if (likely(PyLong_Check(x))) { if (is_unsigned) { #if CYTHON_USE_PYLONG_INTERNALS const digit* digits = ((PyLongObject*)x)->ob_digit; switch (Py_SIZE(x)) { case 0: return (uint8_t) 0; case 1: __PYX_VERIFY_RETURN_INT(uint8_t, digit, digits[0]) case 2: if (8 * sizeof(uint8_t) > 1 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(uint8_t, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(uint8_t) >= 2 * PyLong_SHIFT) { return (uint8_t) (((((uint8_t)digits[1]) << PyLong_SHIFT) | (uint8_t)digits[0])); } } break; case 3: if (8 * sizeof(uint8_t) > 2 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(uint8_t, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(uint8_t) >= 3 * PyLong_SHIFT) { return (uint8_t) (((((((uint8_t)digits[2]) << PyLong_SHIFT) | (uint8_t)digits[1]) << PyLong_SHIFT) | (uint8_t)digits[0])); } } break; case 4: if (8 * sizeof(uint8_t) > 3 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(uint8_t, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(uint8_t) >= 4 * PyLong_SHIFT) { return (uint8_t) (((((((((uint8_t)digits[3]) << PyLong_SHIFT) | (uint8_t)digits[2]) << PyLong_SHIFT) | (uint8_t)digits[1]) << PyLong_SHIFT) | (uint8_t)digits[0])); } } break; } #endif #if CYTHON_COMPILING_IN_CPYTHON if (unlikely(Py_SIZE(x) < 0)) { goto raise_neg_overflow; } #else { int result = PyObject_RichCompareBool(x, Py_False, Py_LT); if (unlikely(result < 0)) return (uint8_t) -1; if (unlikely(result == 1)) goto raise_neg_overflow; } #endif if (sizeof(uint8_t) <= sizeof(unsigned long)) { __PYX_VERIFY_RETURN_INT_EXC(uint8_t, unsigned long, PyLong_AsUnsignedLong(x)) #ifdef HAVE_LONG_LONG } else if (sizeof(uint8_t) <= sizeof(unsigned PY_LONG_LONG)) { __PYX_VERIFY_RETURN_INT_EXC(uint8_t, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x)) #endif } } else { #if CYTHON_USE_PYLONG_INTERNALS const digit* digits = ((PyLongObject*)x)->ob_digit; switch (Py_SIZE(x)) { case 0: return (uint8_t) 0; case -1: __PYX_VERIFY_RETURN_INT(uint8_t, sdigit, (sdigit) (-(sdigit)digits[0])) case 1: __PYX_VERIFY_RETURN_INT(uint8_t, digit, +digits[0]) case -2: if (8 * sizeof(uint8_t) - 1 > 1 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(uint8_t, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(uint8_t) - 1 > 2 * PyLong_SHIFT) { return (uint8_t) (((uint8_t)-1)*(((((uint8_t)digits[1]) << PyLong_SHIFT) | (uint8_t)digits[0]))); } } break; case 2: if (8 * sizeof(uint8_t) > 1 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(uint8_t, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(uint8_t) - 1 > 2 * PyLong_SHIFT) { return (uint8_t) ((((((uint8_t)digits[1]) << PyLong_SHIFT) | (uint8_t)digits[0]))); } } break; case -3: if (8 * sizeof(uint8_t) - 1 > 2 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(uint8_t, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(uint8_t) - 1 > 3 * PyLong_SHIFT) { return (uint8_t) (((uint8_t)-1)*(((((((uint8_t)digits[2]) << PyLong_SHIFT) | (uint8_t)digits[1]) << PyLong_SHIFT) | (uint8_t)digits[0]))); } } break; case 3: if (8 * sizeof(uint8_t) > 2 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(uint8_t, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(uint8_t) - 1 > 3 * PyLong_SHIFT) { return (uint8_t) ((((((((uint8_t)digits[2]) << PyLong_SHIFT) | (uint8_t)digits[1]) << PyLong_SHIFT) | (uint8_t)digits[0]))); } } break; case -4: if (8 * sizeof(uint8_t) - 1 > 3 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(uint8_t, long, -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(uint8_t) - 1 > 4 * PyLong_SHIFT) { return (uint8_t) (((uint8_t)-1)*(((((((((uint8_t)digits[3]) << PyLong_SHIFT) | (uint8_t)digits[2]) << PyLong_SHIFT) | (uint8_t)digits[1]) << PyLong_SHIFT) | (uint8_t)digits[0]))); } } break; case 4: if (8 * sizeof(uint8_t) > 3 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(uint8_t, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(uint8_t) - 1 > 4 * PyLong_SHIFT) { return (uint8_t) ((((((((((uint8_t)digits[3]) << PyLong_SHIFT) | (uint8_t)digits[2]) << PyLong_SHIFT) | (uint8_t)digits[1]) << PyLong_SHIFT) | (uint8_t)digits[0]))); } } break; } #endif if (sizeof(uint8_t) <= sizeof(long)) { __PYX_VERIFY_RETURN_INT_EXC(uint8_t, long, PyLong_AsLong(x)) #ifdef HAVE_LONG_LONG } else if (sizeof(uint8_t) <= sizeof(PY_LONG_LONG)) { __PYX_VERIFY_RETURN_INT_EXC(uint8_t, PY_LONG_LONG, PyLong_AsLongLong(x)) #endif } } { #if CYTHON_COMPILING_IN_PYPY && !defined(_PyLong_AsByteArray) PyErr_SetString(PyExc_RuntimeError, "_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers"); #else uint8_t val; PyObject *v = __Pyx_PyNumber_IntOrLong(x); #if PY_MAJOR_VERSION < 3 if (likely(v) && !PyLong_Check(v)) { PyObject *tmp = v; v = PyNumber_Long(tmp); Py_DECREF(tmp); } #endif if (likely(v)) { int one = 1; int is_little = (int)*(unsigned char *)&one; unsigned char *bytes = (unsigned char *)&val; int ret = _PyLong_AsByteArray((PyLongObject *)v, bytes, sizeof(val), is_little, !is_unsigned); Py_DECREF(v); if (likely(!ret)) return val; } #endif return (uint8_t) -1; } } else { uint8_t val; PyObject *tmp = __Pyx_PyNumber_IntOrLong(x); if (!tmp) return (uint8_t) -1; val = __Pyx_PyInt_As_uint8_t(tmp); Py_DECREF(tmp); return val; } raise_overflow: PyErr_SetString(PyExc_OverflowError, "value too large to convert to uint8_t"); return (uint8_t) -1; raise_neg_overflow: PyErr_SetString(PyExc_OverflowError, "can't convert negative value to uint8_t"); return (uint8_t) -1; } /* CIntFromPy */ static CYTHON_INLINE long __Pyx_PyInt_As_long(PyObject *x) { const long neg_one = (long) -1, const_zero = (long) 0; const int is_unsigned = neg_one > const_zero; #if PY_MAJOR_VERSION < 3 if (likely(PyInt_Check(x))) { if (sizeof(long) < sizeof(long)) { __PYX_VERIFY_RETURN_INT(long, long, PyInt_AS_LONG(x)) } else { long val = PyInt_AS_LONG(x); if (is_unsigned && unlikely(val < 0)) { goto raise_neg_overflow; } return (long) val; } } else #endif if (likely(PyLong_Check(x))) { if (is_unsigned) { #if CYTHON_USE_PYLONG_INTERNALS const digit* digits = ((PyLongObject*)x)->ob_digit; switch (Py_SIZE(x)) { case 0: return (long) 0; case 1: __PYX_VERIFY_RETURN_INT(long, digit, digits[0]) case 2: if (8 * sizeof(long) > 1 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(long) >= 2 * PyLong_SHIFT) { return (long) (((((long)digits[1]) << PyLong_SHIFT) | (long)digits[0])); } } break; case 3: if (8 * sizeof(long) > 2 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(long) >= 3 * PyLong_SHIFT) { return (long) (((((((long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0])); } } break; case 4: if (8 * sizeof(long) > 3 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(long) >= 4 * PyLong_SHIFT) { return (long) (((((((((long)digits[3]) << PyLong_SHIFT) | (long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0])); } } break; } #endif #if CYTHON_COMPILING_IN_CPYTHON if (unlikely(Py_SIZE(x) < 0)) { goto raise_neg_overflow; } #else { int result = PyObject_RichCompareBool(x, Py_False, Py_LT); if (unlikely(result < 0)) return (long) -1; if (unlikely(result == 1)) goto raise_neg_overflow; } #endif if (sizeof(long) <= sizeof(unsigned long)) { __PYX_VERIFY_RETURN_INT_EXC(long, unsigned long, PyLong_AsUnsignedLong(x)) #ifdef HAVE_LONG_LONG } else if (sizeof(long) <= sizeof(unsigned PY_LONG_LONG)) { __PYX_VERIFY_RETURN_INT_EXC(long, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x)) #endif } } else { #if CYTHON_USE_PYLONG_INTERNALS const digit* digits = ((PyLongObject*)x)->ob_digit; switch (Py_SIZE(x)) { case 0: return (long) 0; case -1: __PYX_VERIFY_RETURN_INT(long, sdigit, (sdigit) (-(sdigit)digits[0])) case 1: __PYX_VERIFY_RETURN_INT(long, digit, +digits[0]) case -2: if (8 * sizeof(long) - 1 > 1 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(long, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) { return (long) (((long)-1)*(((((long)digits[1]) << PyLong_SHIFT) | (long)digits[0]))); } } break; case 2: if (8 * sizeof(long) > 1 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) { return (long) ((((((long)digits[1]) << PyLong_SHIFT) | (long)digits[0]))); } } break; case -3: if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(long, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) { return (long) (((long)-1)*(((((((long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0]))); } } break; case 3: if (8 * sizeof(long) > 2 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) { return (long) ((((((((long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0]))); } } break; case -4: if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(long, long, -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(long) - 1 > 4 * PyLong_SHIFT) { return (long) (((long)-1)*(((((((((long)digits[3]) << PyLong_SHIFT) | (long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0]))); } } break; case 4: if (8 * sizeof(long) > 3 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(long) - 1 > 4 * PyLong_SHIFT) { return (long) ((((((((((long)digits[3]) << PyLong_SHIFT) | (long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0]))); } } break; } #endif if (sizeof(long) <= sizeof(long)) { __PYX_VERIFY_RETURN_INT_EXC(long, long, PyLong_AsLong(x)) #ifdef HAVE_LONG_LONG } else if (sizeof(long) <= sizeof(PY_LONG_LONG)) { __PYX_VERIFY_RETURN_INT_EXC(long, PY_LONG_LONG, PyLong_AsLongLong(x)) #endif } } { #if CYTHON_COMPILING_IN_PYPY && !defined(_PyLong_AsByteArray) PyErr_SetString(PyExc_RuntimeError, "_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers"); #else long val; PyObject *v = __Pyx_PyNumber_IntOrLong(x); #if PY_MAJOR_VERSION < 3 if (likely(v) && !PyLong_Check(v)) { PyObject *tmp = v; v = PyNumber_Long(tmp); Py_DECREF(tmp); } #endif if (likely(v)) { int one = 1; int is_little = (int)*(unsigned char *)&one; unsigned char *bytes = (unsigned char *)&val; int ret = _PyLong_AsByteArray((PyLongObject *)v, bytes, sizeof(val), is_little, !is_unsigned); Py_DECREF(v); if (likely(!ret)) return val; } #endif return (long) -1; } } else { long val; PyObject *tmp = __Pyx_PyNumber_IntOrLong(x); if (!tmp) return (long) -1; val = __Pyx_PyInt_As_long(tmp); Py_DECREF(tmp); return val; } raise_overflow: PyErr_SetString(PyExc_OverflowError, "value too large to convert to long"); return (long) -1; raise_neg_overflow: PyErr_SetString(PyExc_OverflowError, "can't convert negative value to long"); return (long) -1; } /* CheckBinaryVersion */ static int __Pyx_check_binary_version(void) { char ctversion[4], rtversion[4]; PyOS_snprintf(ctversion, 4, "%d.%d", PY_MAJOR_VERSION, PY_MINOR_VERSION); PyOS_snprintf(rtversion, 4, "%s", Py_GetVersion()); if (ctversion[0] != rtversion[0] || ctversion[2] != rtversion[2]) { char message[200]; PyOS_snprintf(message, sizeof(message), "compiletime version %s of module '%.100s' " "does not match runtime version %s", ctversion, __Pyx_MODULE_NAME, rtversion); return PyErr_WarnEx(NULL, message, 1); } return 0; } /* FunctionExport */ static int __Pyx_ExportFunction(const char *name, void (*f)(void), const char *sig) { PyObject *d = 0; PyObject *cobj = 0; union { void (*fp)(void); void *p; } tmp; d = PyObject_GetAttrString(__pyx_m, (char *)"__pyx_capi__"); if (!d) { PyErr_Clear(); d = PyDict_New(); if (!d) goto bad; Py_INCREF(d); if (PyModule_AddObject(__pyx_m, (char *)"__pyx_capi__", d) < 0) goto bad; } tmp.fp = f; #if PY_VERSION_HEX >= 0x02070000 cobj = PyCapsule_New(tmp.p, sig, 0); #else cobj = PyCObject_FromVoidPtrAndDesc(tmp.p, (void *)sig, 0); #endif if (!cobj) goto bad; if (PyDict_SetItemString(d, name, cobj) < 0) goto bad; Py_DECREF(cobj); Py_DECREF(d); return 0; bad: Py_XDECREF(cobj); Py_XDECREF(d); return -1; } /* ModuleImport */ #ifndef __PYX_HAVE_RT_ImportModule #define __PYX_HAVE_RT_ImportModule static PyObject *__Pyx_ImportModule(const char *name) { PyObject *py_name = 0; PyObject *py_module = 0; py_name = __Pyx_PyIdentifier_FromString(name); if (!py_name) goto bad; py_module = PyImport_Import(py_name); Py_DECREF(py_name); return py_module; bad: Py_XDECREF(py_name); return 0; } #endif /* TypeImport */ #ifndef __PYX_HAVE_RT_ImportType #define __PYX_HAVE_RT_ImportType static PyTypeObject *__Pyx_ImportType(const char *module_name, const char *class_name, size_t size, int strict) { PyObject *py_module = 0; PyObject *result = 0; PyObject *py_name = 0; char warning[200]; Py_ssize_t basicsize; #ifdef Py_LIMITED_API PyObject *py_basicsize; #endif py_module = __Pyx_ImportModule(module_name); if (!py_module) goto bad; py_name = __Pyx_PyIdentifier_FromString(class_name); if (!py_name) goto bad; result = PyObject_GetAttr(py_module, py_name); Py_DECREF(py_name); py_name = 0; Py_DECREF(py_module); py_module = 0; if (!result) goto bad; if (!PyType_Check(result)) { PyErr_Format(PyExc_TypeError, "%.200s.%.200s is not a type object", module_name, class_name); goto bad; } #ifndef Py_LIMITED_API basicsize = ((PyTypeObject *)result)->tp_basicsize; #else py_basicsize = PyObject_GetAttrString(result, "__basicsize__"); if (!py_basicsize) goto bad; basicsize = PyLong_AsSsize_t(py_basicsize); Py_DECREF(py_basicsize); py_basicsize = 0; if (basicsize == (Py_ssize_t)-1 && PyErr_Occurred()) goto bad; #endif if (!strict && (size_t)basicsize > size) { PyOS_snprintf(warning, sizeof(warning), "%s.%s size changed, may indicate binary incompatibility. Expected %zd, got %zd", module_name, class_name, basicsize, size); if (PyErr_WarnEx(NULL, warning, 0) < 0) goto bad; } else if ((size_t)basicsize != size) { PyErr_Format(PyExc_ValueError, "%.200s.%.200s has the wrong size, try recompiling. Expected %zd, got %zd", module_name, class_name, basicsize, size); goto bad; } return (PyTypeObject *)result; bad: Py_XDECREF(py_module); Py_XDECREF(result); return NULL; } #endif /* FunctionImport */ #ifndef __PYX_HAVE_RT_ImportFunction #define __PYX_HAVE_RT_ImportFunction static int __Pyx_ImportFunction(PyObject *module, const char *funcname, void (**f)(void), const char *sig) { PyObject *d = 0; PyObject *cobj = 0; union { void (*fp)(void); void *p; } tmp; d = PyObject_GetAttrString(module, (char *)"__pyx_capi__"); if (!d) goto bad; cobj = PyDict_GetItemString(d, funcname); if (!cobj) { PyErr_Format(PyExc_ImportError, "%.200s does not export expected C function %.200s", PyModule_GetName(module), funcname); goto bad; } #if PY_VERSION_HEX >= 0x02070000 if (!PyCapsule_IsValid(cobj, sig)) { PyErr_Format(PyExc_TypeError, "C function %.200s.%.200s has wrong signature (expected %.500s, got %.500s)", PyModule_GetName(module), funcname, sig, PyCapsule_GetName(cobj)); goto bad; } tmp.p = PyCapsule_GetPointer(cobj, sig); #else {const char *desc, *s1, *s2; desc = (const char *)PyCObject_GetDesc(cobj); if (!desc) goto bad; s1 = desc; s2 = sig; while (*s1 != '\0' && *s1 == *s2) { s1++; s2++; } if (*s1 != *s2) { PyErr_Format(PyExc_TypeError, "C function %.200s.%.200s has wrong signature (expected %.500s, got %.500s)", PyModule_GetName(module), funcname, sig, desc); goto bad; } tmp.p = PyCObject_AsVoidPtr(cobj);} #endif *f = tmp.fp; if (!(*f)) goto bad; Py_DECREF(d); return 0; bad: Py_XDECREF(d); return -1; } #endif /* InitStrings */ static int __Pyx_InitStrings(__Pyx_StringTabEntry *t) { while (t->p) { #if PY_MAJOR_VERSION < 3 if (t->is_unicode) { *t->p = PyUnicode_DecodeUTF8(t->s, t->n - 1, NULL); } else if (t->intern) { *t->p = PyString_InternFromString(t->s); } else { *t->p = PyString_FromStringAndSize(t->s, t->n - 1); } #else if (t->is_unicode | t->is_str) { if (t->intern) { *t->p = PyUnicode_InternFromString(t->s); } else if (t->encoding) { *t->p = PyUnicode_Decode(t->s, t->n - 1, t->encoding, NULL); } else { *t->p = PyUnicode_FromStringAndSize(t->s, t->n - 1); } } else { *t->p = PyBytes_FromStringAndSize(t->s, t->n - 1); } #endif if (!*t->p) return -1; ++t; } return 0; } static CYTHON_INLINE PyObject* __Pyx_PyUnicode_FromString(const char* c_str) { return __Pyx_PyUnicode_FromStringAndSize(c_str, (Py_ssize_t)strlen(c_str)); } static CYTHON_INLINE char* __Pyx_PyObject_AsString(PyObject* o) { Py_ssize_t ignore; return __Pyx_PyObject_AsStringAndSize(o, &ignore); } static CYTHON_INLINE char* __Pyx_PyObject_AsStringAndSize(PyObject* o, Py_ssize_t *length) { #if CYTHON_COMPILING_IN_CPYTHON && (__PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT) if ( #if PY_MAJOR_VERSION < 3 && __PYX_DEFAULT_STRING_ENCODING_IS_ASCII __Pyx_sys_getdefaultencoding_not_ascii && #endif PyUnicode_Check(o)) { #if PY_VERSION_HEX < 0x03030000 char* defenc_c; PyObject* defenc = _PyUnicode_AsDefaultEncodedString(o, NULL); if (!defenc) return NULL; defenc_c = PyBytes_AS_STRING(defenc); #if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII { char* end = defenc_c + PyBytes_GET_SIZE(defenc); char* c; for (c = defenc_c; c < end; c++) { if ((unsigned char) (*c) >= 128) { PyUnicode_AsASCIIString(o); return NULL; } } } #endif *length = PyBytes_GET_SIZE(defenc); return defenc_c; #else if (__Pyx_PyUnicode_READY(o) == -1) return NULL; #if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII if (PyUnicode_IS_ASCII(o)) { *length = PyUnicode_GET_LENGTH(o); return PyUnicode_AsUTF8(o); } else { PyUnicode_AsASCIIString(o); return NULL; } #else return PyUnicode_AsUTF8AndSize(o, length); #endif #endif } else #endif #if (!CYTHON_COMPILING_IN_PYPY) || (defined(PyByteArray_AS_STRING) && defined(PyByteArray_GET_SIZE)) if (PyByteArray_Check(o)) { *length = PyByteArray_GET_SIZE(o); return PyByteArray_AS_STRING(o); } else #endif { char* result; int r = PyBytes_AsStringAndSize(o, &result, length); if (unlikely(r < 0)) { return NULL; } else { return result; } } } static CYTHON_INLINE int __Pyx_PyObject_IsTrue(PyObject* x) { int is_true = x == Py_True; if (is_true | (x == Py_False) | (x == Py_None)) return is_true; else return PyObject_IsTrue(x); } static CYTHON_INLINE PyObject* __Pyx_PyNumber_IntOrLong(PyObject* x) { #if CYTHON_USE_TYPE_SLOTS PyNumberMethods *m; #endif const char *name = NULL; PyObject *res = NULL; #if PY_MAJOR_VERSION < 3 if (PyInt_Check(x) || PyLong_Check(x)) #else if (PyLong_Check(x)) #endif return __Pyx_NewRef(x); #if CYTHON_USE_TYPE_SLOTS m = Py_TYPE(x)->tp_as_number; #if PY_MAJOR_VERSION < 3 if (m && m->nb_int) { name = "int"; res = PyNumber_Int(x); } else if (m && m->nb_long) { name = "long"; res = PyNumber_Long(x); } #else if (m && m->nb_int) { name = "int"; res = PyNumber_Long(x); } #endif #else res = PyNumber_Int(x); #endif if (res) { #if PY_MAJOR_VERSION < 3 if (!PyInt_Check(res) && !PyLong_Check(res)) { #else if (!PyLong_Check(res)) { #endif PyErr_Format(PyExc_TypeError, "__%.4s__ returned non-%.4s (type %.200s)", name, name, Py_TYPE(res)->tp_name); Py_DECREF(res); return NULL; } } else if (!PyErr_Occurred()) { PyErr_SetString(PyExc_TypeError, "an integer is required"); } return res; } static CYTHON_INLINE Py_ssize_t __Pyx_PyIndex_AsSsize_t(PyObject* b) { Py_ssize_t ival; PyObject *x; #if PY_MAJOR_VERSION < 3 if (likely(PyInt_CheckExact(b))) { if (sizeof(Py_ssize_t) >= sizeof(long)) return PyInt_AS_LONG(b); else return PyInt_AsSsize_t(x); } #endif if (likely(PyLong_CheckExact(b))) { #if CYTHON_USE_PYLONG_INTERNALS const digit* digits = ((PyLongObject*)b)->ob_digit; const Py_ssize_t size = Py_SIZE(b); if (likely(__Pyx_sst_abs(size) <= 1)) { ival = likely(size) ? digits[0] : 0; if (size == -1) ival = -ival; return ival; } else { switch (size) { case 2: if (8 * sizeof(Py_ssize_t) > 2 * PyLong_SHIFT) { return (Py_ssize_t) (((((size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])); } break; case -2: if (8 * sizeof(Py_ssize_t) > 2 * PyLong_SHIFT) { return -(Py_ssize_t) (((((size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])); } break; case 3: if (8 * sizeof(Py_ssize_t) > 3 * PyLong_SHIFT) { return (Py_ssize_t) (((((((size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])); } break; case -3: if (8 * sizeof(Py_ssize_t) > 3 * PyLong_SHIFT) { return -(Py_ssize_t) (((((((size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])); } break; case 4: if (8 * sizeof(Py_ssize_t) > 4 * PyLong_SHIFT) { return (Py_ssize_t) (((((((((size_t)digits[3]) << PyLong_SHIFT) | (size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])); } break; case -4: if (8 * sizeof(Py_ssize_t) > 4 * PyLong_SHIFT) { return -(Py_ssize_t) (((((((((size_t)digits[3]) << PyLong_SHIFT) | (size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])); } break; } } #endif return PyLong_AsSsize_t(b); } x = PyNumber_Index(b); if (!x) return -1; ival = PyInt_AsSsize_t(x); Py_DECREF(x); return ival; } static CYTHON_INLINE PyObject * __Pyx_PyInt_FromSize_t(size_t ival) { return PyInt_FromSize_t(ival); } #endif /* Py_PYTHON_H */ pygame_sdl2-2.1.0-for-renpy-6.99.14.1/gen3/pygame_sdl2.error.c0000664000175000017500000033717712660744161022635 0ustar tomtom00000000000000/* Generated by Cython 0.20.2 on Tue Feb 16 20:10:09 2016 */ #define PY_SSIZE_T_CLEAN #ifndef CYTHON_USE_PYLONG_INTERNALS #ifdef PYLONG_BITS_IN_DIGIT #define CYTHON_USE_PYLONG_INTERNALS 0 #else #include "pyconfig.h" #ifdef PYLONG_BITS_IN_DIGIT #define CYTHON_USE_PYLONG_INTERNALS 1 #else #define CYTHON_USE_PYLONG_INTERNALS 0 #endif #endif #endif #include "Python.h" #ifndef Py_PYTHON_H #error Python headers needed to compile C extensions, please install development version of Python. #elif PY_VERSION_HEX < 0x02040000 #error Cython requires Python 2.4+. #else #define CYTHON_ABI "0_20_2" #include /* For offsetof */ #ifndef offsetof #define offsetof(type, member) ( (size_t) & ((type*)0) -> member ) #endif #if !defined(WIN32) && !defined(MS_WINDOWS) #ifndef __stdcall #define __stdcall #endif #ifndef __cdecl #define __cdecl #endif #ifndef __fastcall #define __fastcall #endif #endif #ifndef DL_IMPORT #define DL_IMPORT(t) t #endif #ifndef DL_EXPORT #define DL_EXPORT(t) t #endif #ifndef PY_LONG_LONG #define PY_LONG_LONG LONG_LONG #endif #ifndef Py_HUGE_VAL #define Py_HUGE_VAL HUGE_VAL #endif #ifdef PYPY_VERSION #define CYTHON_COMPILING_IN_PYPY 1 #define CYTHON_COMPILING_IN_CPYTHON 0 #else #define CYTHON_COMPILING_IN_PYPY 0 #define CYTHON_COMPILING_IN_CPYTHON 1 #endif #if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX < 0x02070600 #define Py_OptimizeFlag 0 #endif #if PY_VERSION_HEX < 0x02050000 typedef int Py_ssize_t; #define PY_SSIZE_T_MAX INT_MAX #define PY_SSIZE_T_MIN INT_MIN #define PY_FORMAT_SIZE_T "" #define CYTHON_FORMAT_SSIZE_T "" #define PyInt_FromSsize_t(z) PyInt_FromLong(z) #define PyInt_AsSsize_t(o) __Pyx_PyInt_As_int(o) #define PyNumber_Index(o) ((PyNumber_Check(o) && !PyFloat_Check(o)) ? PyNumber_Int(o) : \ (PyErr_Format(PyExc_TypeError, \ "expected index value, got %.200s", Py_TYPE(o)->tp_name), \ (PyObject*)0)) #define __Pyx_PyIndex_Check(o) (PyNumber_Check(o) && !PyFloat_Check(o) && \ !PyComplex_Check(o)) #define PyIndex_Check __Pyx_PyIndex_Check #define PyErr_WarnEx(category, message, stacklevel) PyErr_Warn(category, message) #define __PYX_BUILD_PY_SSIZE_T "i" #else #define __PYX_BUILD_PY_SSIZE_T "n" #define CYTHON_FORMAT_SSIZE_T "z" #define __Pyx_PyIndex_Check PyIndex_Check #endif #if PY_VERSION_HEX < 0x02060000 #define Py_REFCNT(ob) (((PyObject*)(ob))->ob_refcnt) #define Py_TYPE(ob) (((PyObject*)(ob))->ob_type) #define Py_SIZE(ob) (((PyVarObject*)(ob))->ob_size) #define PyVarObject_HEAD_INIT(type, size) \ PyObject_HEAD_INIT(type) size, #define PyType_Modified(t) typedef struct { void *buf; PyObject *obj; Py_ssize_t len; Py_ssize_t itemsize; int readonly; int ndim; char *format; Py_ssize_t *shape; Py_ssize_t *strides; Py_ssize_t *suboffsets; void *internal; } Py_buffer; #define PyBUF_SIMPLE 0 #define PyBUF_WRITABLE 0x0001 #define PyBUF_FORMAT 0x0004 #define PyBUF_ND 0x0008 #define PyBUF_STRIDES (0x0010 | PyBUF_ND) #define PyBUF_C_CONTIGUOUS (0x0020 | PyBUF_STRIDES) #define PyBUF_F_CONTIGUOUS (0x0040 | PyBUF_STRIDES) #define PyBUF_ANY_CONTIGUOUS (0x0080 | PyBUF_STRIDES) #define PyBUF_INDIRECT (0x0100 | PyBUF_STRIDES) #define PyBUF_RECORDS (PyBUF_STRIDES | PyBUF_FORMAT | PyBUF_WRITABLE) #define PyBUF_FULL (PyBUF_INDIRECT | PyBUF_FORMAT | PyBUF_WRITABLE) typedef int (*getbufferproc)(PyObject *, Py_buffer *, int); typedef void (*releasebufferproc)(PyObject *, Py_buffer *); #endif #if PY_MAJOR_VERSION < 3 #define __Pyx_BUILTIN_MODULE_NAME "__builtin__" #define __Pyx_PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos) \ PyCode_New(a+k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos) #define __Pyx_DefaultClassType PyClass_Type #else #define __Pyx_BUILTIN_MODULE_NAME "builtins" #define __Pyx_PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos) \ PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos) #define __Pyx_DefaultClassType PyType_Type #endif #if PY_VERSION_HEX < 0x02060000 #define PyUnicode_FromString(s) PyUnicode_Decode(s, strlen(s), "UTF-8", "strict") #endif #if PY_MAJOR_VERSION >= 3 #define Py_TPFLAGS_CHECKTYPES 0 #define Py_TPFLAGS_HAVE_INDEX 0 #endif #if (PY_VERSION_HEX < 0x02060000) || (PY_MAJOR_VERSION >= 3) #define Py_TPFLAGS_HAVE_NEWBUFFER 0 #endif #if PY_VERSION_HEX < 0x02060000 #define Py_TPFLAGS_HAVE_VERSION_TAG 0 #endif #if PY_VERSION_HEX < 0x02060000 && !defined(Py_TPFLAGS_IS_ABSTRACT) #define Py_TPFLAGS_IS_ABSTRACT 0 #endif #if PY_VERSION_HEX < 0x030400a1 && !defined(Py_TPFLAGS_HAVE_FINALIZE) #define Py_TPFLAGS_HAVE_FINALIZE 0 #endif #if PY_VERSION_HEX > 0x03030000 && defined(PyUnicode_KIND) #define CYTHON_PEP393_ENABLED 1 #define __Pyx_PyUnicode_READY(op) (likely(PyUnicode_IS_READY(op)) ? \ 0 : _PyUnicode_Ready((PyObject *)(op))) #define __Pyx_PyUnicode_GET_LENGTH(u) PyUnicode_GET_LENGTH(u) #define __Pyx_PyUnicode_READ_CHAR(u, i) PyUnicode_READ_CHAR(u, i) #define __Pyx_PyUnicode_KIND(u) PyUnicode_KIND(u) #define __Pyx_PyUnicode_DATA(u) PyUnicode_DATA(u) #define __Pyx_PyUnicode_READ(k, d, i) PyUnicode_READ(k, d, i) #else #define CYTHON_PEP393_ENABLED 0 #define __Pyx_PyUnicode_READY(op) (0) #define __Pyx_PyUnicode_GET_LENGTH(u) PyUnicode_GET_SIZE(u) #define __Pyx_PyUnicode_READ_CHAR(u, i) ((Py_UCS4)(PyUnicode_AS_UNICODE(u)[i])) #define __Pyx_PyUnicode_KIND(u) (sizeof(Py_UNICODE)) #define __Pyx_PyUnicode_DATA(u) ((void*)PyUnicode_AS_UNICODE(u)) #define __Pyx_PyUnicode_READ(k, d, i) ((void)(k), (Py_UCS4)(((Py_UNICODE*)d)[i])) #endif #if CYTHON_COMPILING_IN_PYPY #define __Pyx_PyUnicode_Concat(a, b) PyNumber_Add(a, b) #define __Pyx_PyUnicode_ConcatSafe(a, b) PyNumber_Add(a, b) #else #define __Pyx_PyUnicode_Concat(a, b) PyUnicode_Concat(a, b) #define __Pyx_PyUnicode_ConcatSafe(a, b) ((unlikely((a) == Py_None) || unlikely((b) == Py_None)) ? \ PyNumber_Add(a, b) : __Pyx_PyUnicode_Concat(a, b)) #endif #define __Pyx_PyString_FormatSafe(a, b) ((unlikely((a) == Py_None)) ? PyNumber_Remainder(a, b) : __Pyx_PyString_Format(a, b)) #define __Pyx_PyUnicode_FormatSafe(a, b) ((unlikely((a) == Py_None)) ? PyNumber_Remainder(a, b) : PyUnicode_Format(a, b)) #if PY_MAJOR_VERSION >= 3 #define __Pyx_PyString_Format(a, b) PyUnicode_Format(a, b) #else #define __Pyx_PyString_Format(a, b) PyString_Format(a, b) #endif #if PY_MAJOR_VERSION >= 3 #define PyBaseString_Type PyUnicode_Type #define PyStringObject PyUnicodeObject #define PyString_Type PyUnicode_Type #define PyString_Check PyUnicode_Check #define PyString_CheckExact PyUnicode_CheckExact #endif #if PY_VERSION_HEX < 0x02060000 #define PyBytesObject PyStringObject #define PyBytes_Type PyString_Type #define PyBytes_Check PyString_Check #define PyBytes_CheckExact PyString_CheckExact #define PyBytes_FromString PyString_FromString #define PyBytes_FromStringAndSize PyString_FromStringAndSize #define PyBytes_FromFormat PyString_FromFormat #define PyBytes_DecodeEscape PyString_DecodeEscape #define PyBytes_AsString PyString_AsString #define PyBytes_AsStringAndSize PyString_AsStringAndSize #define PyBytes_Size PyString_Size #define PyBytes_AS_STRING PyString_AS_STRING #define PyBytes_GET_SIZE PyString_GET_SIZE #define PyBytes_Repr PyString_Repr #define PyBytes_Concat PyString_Concat #define PyBytes_ConcatAndDel PyString_ConcatAndDel #endif #if PY_MAJOR_VERSION >= 3 #define __Pyx_PyBaseString_Check(obj) PyUnicode_Check(obj) #define __Pyx_PyBaseString_CheckExact(obj) PyUnicode_CheckExact(obj) #else #define __Pyx_PyBaseString_Check(obj) (PyString_CheckExact(obj) || PyUnicode_CheckExact(obj) || \ PyString_Check(obj) || PyUnicode_Check(obj)) #define __Pyx_PyBaseString_CheckExact(obj) (PyString_CheckExact(obj) || PyUnicode_CheckExact(obj)) #endif #if PY_VERSION_HEX < 0x02060000 #define PySet_Check(obj) PyObject_TypeCheck(obj, &PySet_Type) #define PyFrozenSet_Check(obj) PyObject_TypeCheck(obj, &PyFrozenSet_Type) #endif #ifndef PySet_CheckExact #define PySet_CheckExact(obj) (Py_TYPE(obj) == &PySet_Type) #endif #define __Pyx_TypeCheck(obj, type) PyObject_TypeCheck(obj, (PyTypeObject *)type) #if PY_MAJOR_VERSION >= 3 #define PyIntObject PyLongObject #define PyInt_Type PyLong_Type #define PyInt_Check(op) PyLong_Check(op) #define PyInt_CheckExact(op) PyLong_CheckExact(op) #define PyInt_FromString PyLong_FromString #define PyInt_FromUnicode PyLong_FromUnicode #define PyInt_FromLong PyLong_FromLong #define PyInt_FromSize_t PyLong_FromSize_t #define PyInt_FromSsize_t PyLong_FromSsize_t #define PyInt_AsLong PyLong_AsLong #define PyInt_AS_LONG PyLong_AS_LONG #define PyInt_AsSsize_t PyLong_AsSsize_t #define PyInt_AsUnsignedLongMask PyLong_AsUnsignedLongMask #define PyInt_AsUnsignedLongLongMask PyLong_AsUnsignedLongLongMask #define PyNumber_Int PyNumber_Long #endif #if PY_MAJOR_VERSION >= 3 #define PyBoolObject PyLongObject #endif #if PY_VERSION_HEX < 0x030200A4 typedef long Py_hash_t; #define __Pyx_PyInt_FromHash_t PyInt_FromLong #define __Pyx_PyInt_AsHash_t PyInt_AsLong #else #define __Pyx_PyInt_FromHash_t PyInt_FromSsize_t #define __Pyx_PyInt_AsHash_t PyInt_AsSsize_t #endif #if (PY_MAJOR_VERSION < 3) || (PY_VERSION_HEX >= 0x03010300) #define __Pyx_PySequence_GetSlice(obj, a, b) PySequence_GetSlice(obj, a, b) #define __Pyx_PySequence_SetSlice(obj, a, b, value) PySequence_SetSlice(obj, a, b, value) #define __Pyx_PySequence_DelSlice(obj, a, b) PySequence_DelSlice(obj, a, b) #else #define __Pyx_PySequence_GetSlice(obj, a, b) (unlikely(!(obj)) ? \ (PyErr_SetString(PyExc_SystemError, "null argument to internal routine"), (PyObject*)0) : \ (likely((obj)->ob_type->tp_as_mapping) ? (PySequence_GetSlice(obj, a, b)) : \ (PyErr_Format(PyExc_TypeError, "'%.200s' object is unsliceable", (obj)->ob_type->tp_name), (PyObject*)0))) #define __Pyx_PySequence_SetSlice(obj, a, b, value) (unlikely(!(obj)) ? \ (PyErr_SetString(PyExc_SystemError, "null argument to internal routine"), -1) : \ (likely((obj)->ob_type->tp_as_mapping) ? (PySequence_SetSlice(obj, a, b, value)) : \ (PyErr_Format(PyExc_TypeError, "'%.200s' object doesn't support slice assignment", (obj)->ob_type->tp_name), -1))) #define __Pyx_PySequence_DelSlice(obj, a, b) (unlikely(!(obj)) ? \ (PyErr_SetString(PyExc_SystemError, "null argument to internal routine"), -1) : \ (likely((obj)->ob_type->tp_as_mapping) ? (PySequence_DelSlice(obj, a, b)) : \ (PyErr_Format(PyExc_TypeError, "'%.200s' object doesn't support slice deletion", (obj)->ob_type->tp_name), -1))) #endif #if PY_MAJOR_VERSION >= 3 #define PyMethod_New(func, self, klass) ((self) ? PyMethod_New(func, self) : PyInstanceMethod_New(func)) #endif #if PY_VERSION_HEX < 0x02050000 #define __Pyx_GetAttrString(o,n) PyObject_GetAttrString((o),((char *)(n))) #define __Pyx_SetAttrString(o,n,a) PyObject_SetAttrString((o),((char *)(n)),(a)) #define __Pyx_DelAttrString(o,n) PyObject_DelAttrString((o),((char *)(n))) #else #define __Pyx_GetAttrString(o,n) PyObject_GetAttrString((o),(n)) #define __Pyx_SetAttrString(o,n,a) PyObject_SetAttrString((o),(n),(a)) #define __Pyx_DelAttrString(o,n) PyObject_DelAttrString((o),(n)) #endif #if PY_VERSION_HEX < 0x02050000 #define __Pyx_NAMESTR(n) ((char *)(n)) #define __Pyx_DOCSTR(n) ((char *)(n)) #else #define __Pyx_NAMESTR(n) (n) #define __Pyx_DOCSTR(n) (n) #endif #ifndef CYTHON_INLINE #if defined(__GNUC__) #define CYTHON_INLINE __inline__ #elif defined(_MSC_VER) #define CYTHON_INLINE __inline #elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L #define CYTHON_INLINE inline #else #define CYTHON_INLINE #endif #endif #ifndef CYTHON_RESTRICT #if defined(__GNUC__) #define CYTHON_RESTRICT __restrict__ #elif defined(_MSC_VER) && _MSC_VER >= 1400 #define CYTHON_RESTRICT __restrict #elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L #define CYTHON_RESTRICT restrict #else #define CYTHON_RESTRICT #endif #endif #ifdef NAN #define __PYX_NAN() ((float) NAN) #else static CYTHON_INLINE float __PYX_NAN() { /* Initialize NaN. The sign is irrelevant, an exponent with all bits 1 and a nonzero mantissa means NaN. If the first bit in the mantissa is 1, it is a quiet NaN. */ float value; memset(&value, 0xFF, sizeof(value)); return value; } #endif #ifdef __cplusplus template void __Pyx_call_destructor(T* x) { x->~T(); } #endif #if PY_MAJOR_VERSION >= 3 #define __Pyx_PyNumber_Divide(x,y) PyNumber_TrueDivide(x,y) #define __Pyx_PyNumber_InPlaceDivide(x,y) PyNumber_InPlaceTrueDivide(x,y) #else #define __Pyx_PyNumber_Divide(x,y) PyNumber_Divide(x,y) #define __Pyx_PyNumber_InPlaceDivide(x,y) PyNumber_InPlaceDivide(x,y) #endif #ifndef __PYX_EXTERN_C #ifdef __cplusplus #define __PYX_EXTERN_C extern "C" #else #define __PYX_EXTERN_C extern #endif #endif #if defined(WIN32) || defined(MS_WINDOWS) #define _USE_MATH_DEFINES #endif #include #define __PYX_HAVE__pygame_sdl2__error #define __PYX_HAVE_API__pygame_sdl2__error #include "stdint.h" #include "string.h" #include "stdio.h" #include "stddef.h" #include "SDL.h" #ifdef _OPENMP #include #endif /* _OPENMP */ #ifdef PYREX_WITHOUT_ASSERTIONS #define CYTHON_WITHOUT_ASSERTIONS #endif #ifndef CYTHON_UNUSED # if defined(__GNUC__) # if !(defined(__cplusplus)) || (__GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 4)) # define CYTHON_UNUSED __attribute__ ((__unused__)) # else # define CYTHON_UNUSED # endif # elif defined(__ICC) || (defined(__INTEL_COMPILER) && !defined(_MSC_VER)) # define CYTHON_UNUSED __attribute__ ((__unused__)) # else # define CYTHON_UNUSED # endif #endif typedef struct {PyObject **p; char *s; const Py_ssize_t n; const char* encoding; const char is_unicode; const char is_str; const char intern; } __Pyx_StringTabEntry; /*proto*/ #define __PYX_DEFAULT_STRING_ENCODING_IS_ASCII 0 #define __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT 0 #define __PYX_DEFAULT_STRING_ENCODING "" #define __Pyx_PyObject_FromString __Pyx_PyBytes_FromString #define __Pyx_PyObject_FromStringAndSize __Pyx_PyBytes_FromStringAndSize #define __Pyx_fits_Py_ssize_t(v, type, is_signed) ( \ (sizeof(type) < sizeof(Py_ssize_t)) || \ (sizeof(type) > sizeof(Py_ssize_t) && \ likely(v < (type)PY_SSIZE_T_MAX || \ v == (type)PY_SSIZE_T_MAX) && \ (!is_signed || likely(v > (type)PY_SSIZE_T_MIN || \ v == (type)PY_SSIZE_T_MIN))) || \ (sizeof(type) == sizeof(Py_ssize_t) && \ (is_signed || likely(v < (type)PY_SSIZE_T_MAX || \ v == (type)PY_SSIZE_T_MAX))) ) static CYTHON_INLINE char* __Pyx_PyObject_AsString(PyObject*); static CYTHON_INLINE char* __Pyx_PyObject_AsStringAndSize(PyObject*, Py_ssize_t* length); #define __Pyx_PyByteArray_FromString(s) PyByteArray_FromStringAndSize((const char*)s, strlen((const char*)s)) #define __Pyx_PyByteArray_FromStringAndSize(s, l) PyByteArray_FromStringAndSize((const char*)s, l) #define __Pyx_PyBytes_FromString PyBytes_FromString #define __Pyx_PyBytes_FromStringAndSize PyBytes_FromStringAndSize static CYTHON_INLINE PyObject* __Pyx_PyUnicode_FromString(const char*); #if PY_MAJOR_VERSION < 3 #define __Pyx_PyStr_FromString __Pyx_PyBytes_FromString #define __Pyx_PyStr_FromStringAndSize __Pyx_PyBytes_FromStringAndSize #else #define __Pyx_PyStr_FromString __Pyx_PyUnicode_FromString #define __Pyx_PyStr_FromStringAndSize __Pyx_PyUnicode_FromStringAndSize #endif #define __Pyx_PyObject_AsSString(s) ((signed char*) __Pyx_PyObject_AsString(s)) #define __Pyx_PyObject_AsUString(s) ((unsigned char*) __Pyx_PyObject_AsString(s)) #define __Pyx_PyObject_FromUString(s) __Pyx_PyObject_FromString((const char*)s) #define __Pyx_PyBytes_FromUString(s) __Pyx_PyBytes_FromString((const char*)s) #define __Pyx_PyByteArray_FromUString(s) __Pyx_PyByteArray_FromString((const char*)s) #define __Pyx_PyStr_FromUString(s) __Pyx_PyStr_FromString((const char*)s) #define __Pyx_PyUnicode_FromUString(s) __Pyx_PyUnicode_FromString((const char*)s) #if PY_MAJOR_VERSION < 3 static CYTHON_INLINE size_t __Pyx_Py_UNICODE_strlen(const Py_UNICODE *u) { const Py_UNICODE *u_end = u; while (*u_end++) ; return (size_t)(u_end - u - 1); } #else #define __Pyx_Py_UNICODE_strlen Py_UNICODE_strlen #endif #define __Pyx_PyUnicode_FromUnicode(u) PyUnicode_FromUnicode(u, __Pyx_Py_UNICODE_strlen(u)) #define __Pyx_PyUnicode_FromUnicodeAndLength PyUnicode_FromUnicode #define __Pyx_PyUnicode_AsUnicode PyUnicode_AsUnicode #define __Pyx_Owned_Py_None(b) (Py_INCREF(Py_None), Py_None) #define __Pyx_PyBool_FromLong(b) ((b) ? (Py_INCREF(Py_True), Py_True) : (Py_INCREF(Py_False), Py_False)) static CYTHON_INLINE int __Pyx_PyObject_IsTrue(PyObject*); static CYTHON_INLINE PyObject* __Pyx_PyNumber_Int(PyObject* x); static CYTHON_INLINE Py_ssize_t __Pyx_PyIndex_AsSsize_t(PyObject*); static CYTHON_INLINE PyObject * __Pyx_PyInt_FromSize_t(size_t); #if CYTHON_COMPILING_IN_CPYTHON #define __pyx_PyFloat_AsDouble(x) (PyFloat_CheckExact(x) ? PyFloat_AS_DOUBLE(x) : PyFloat_AsDouble(x)) #else #define __pyx_PyFloat_AsDouble(x) PyFloat_AsDouble(x) #endif #define __pyx_PyFloat_AsFloat(x) ((float) __pyx_PyFloat_AsDouble(x)) #if PY_MAJOR_VERSION < 3 && __PYX_DEFAULT_STRING_ENCODING_IS_ASCII static int __Pyx_sys_getdefaultencoding_not_ascii; static int __Pyx_init_sys_getdefaultencoding_params(void) { PyObject* sys; PyObject* default_encoding = NULL; PyObject* ascii_chars_u = NULL; PyObject* ascii_chars_b = NULL; const char* default_encoding_c; sys = PyImport_ImportModule("sys"); if (!sys) goto bad; default_encoding = PyObject_CallMethod(sys, (char*) (const char*) "getdefaultencoding", NULL); Py_DECREF(sys); if (!default_encoding) goto bad; default_encoding_c = PyBytes_AsString(default_encoding); if (!default_encoding_c) goto bad; if (strcmp(default_encoding_c, "ascii") == 0) { __Pyx_sys_getdefaultencoding_not_ascii = 0; } else { char ascii_chars[128]; int c; for (c = 0; c < 128; c++) { ascii_chars[c] = c; } __Pyx_sys_getdefaultencoding_not_ascii = 1; ascii_chars_u = PyUnicode_DecodeASCII(ascii_chars, 128, NULL); if (!ascii_chars_u) goto bad; ascii_chars_b = PyUnicode_AsEncodedString(ascii_chars_u, default_encoding_c, NULL); if (!ascii_chars_b || !PyBytes_Check(ascii_chars_b) || memcmp(ascii_chars, PyBytes_AS_STRING(ascii_chars_b), 128) != 0) { PyErr_Format( PyExc_ValueError, "This module compiled with c_string_encoding=ascii, but default encoding '%.200s' is not a superset of ascii.", default_encoding_c); goto bad; } Py_DECREF(ascii_chars_u); Py_DECREF(ascii_chars_b); } Py_DECREF(default_encoding); return 0; bad: Py_XDECREF(default_encoding); Py_XDECREF(ascii_chars_u); Py_XDECREF(ascii_chars_b); return -1; } #endif #if __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT && PY_MAJOR_VERSION >= 3 #define __Pyx_PyUnicode_FromStringAndSize(c_str, size) PyUnicode_DecodeUTF8(c_str, size, NULL) #else #define __Pyx_PyUnicode_FromStringAndSize(c_str, size) PyUnicode_Decode(c_str, size, __PYX_DEFAULT_STRING_ENCODING, NULL) #if __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT static char* __PYX_DEFAULT_STRING_ENCODING; static int __Pyx_init_sys_getdefaultencoding_params(void) { PyObject* sys; PyObject* default_encoding = NULL; char* default_encoding_c; sys = PyImport_ImportModule("sys"); if (!sys) goto bad; default_encoding = PyObject_CallMethod(sys, (char*) (const char*) "getdefaultencoding", NULL); Py_DECREF(sys); if (!default_encoding) goto bad; default_encoding_c = PyBytes_AsString(default_encoding); if (!default_encoding_c) goto bad; __PYX_DEFAULT_STRING_ENCODING = (char*) malloc(strlen(default_encoding_c)); if (!__PYX_DEFAULT_STRING_ENCODING) goto bad; strcpy(__PYX_DEFAULT_STRING_ENCODING, default_encoding_c); Py_DECREF(default_encoding); return 0; bad: Py_XDECREF(default_encoding); return -1; } #endif #endif /* Test for GCC > 2.95 */ #if defined(__GNUC__) && (__GNUC__ > 2 || (__GNUC__ == 2 && (__GNUC_MINOR__ > 95))) #define likely(x) __builtin_expect(!!(x), 1) #define unlikely(x) __builtin_expect(!!(x), 0) #else /* !__GNUC__ or GCC < 2.95 */ #define likely(x) (x) #define unlikely(x) (x) #endif /* __GNUC__ */ static PyObject *__pyx_m; static PyObject *__pyx_d; static PyObject *__pyx_b; static PyObject *__pyx_empty_tuple; static PyObject *__pyx_empty_bytes; static int __pyx_lineno; static int __pyx_clineno = 0; static const char * __pyx_cfilenm= __FILE__; static const char *__pyx_filename; static const char *__pyx_f[] = { "error.pyx", }; /*--- Type declarations ---*/ #ifndef CYTHON_REFNANNY #define CYTHON_REFNANNY 0 #endif #if CYTHON_REFNANNY typedef struct { void (*INCREF)(void*, PyObject*, int); void (*DECREF)(void*, PyObject*, int); void (*GOTREF)(void*, PyObject*, int); void (*GIVEREF)(void*, PyObject*, int); void* (*SetupContext)(const char*, int, const char*); void (*FinishContext)(void**); } __Pyx_RefNannyAPIStruct; static __Pyx_RefNannyAPIStruct *__Pyx_RefNanny = NULL; static __Pyx_RefNannyAPIStruct *__Pyx_RefNannyImportAPI(const char *modname); /*proto*/ #define __Pyx_RefNannyDeclarations void *__pyx_refnanny = NULL; #ifdef WITH_THREAD #define __Pyx_RefNannySetupContext(name, acquire_gil) \ if (acquire_gil) { \ PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure(); \ __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), __LINE__, __FILE__); \ PyGILState_Release(__pyx_gilstate_save); \ } else { \ __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), __LINE__, __FILE__); \ } #else #define __Pyx_RefNannySetupContext(name, acquire_gil) \ __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), __LINE__, __FILE__) #endif #define __Pyx_RefNannyFinishContext() \ __Pyx_RefNanny->FinishContext(&__pyx_refnanny) #define __Pyx_INCREF(r) __Pyx_RefNanny->INCREF(__pyx_refnanny, (PyObject *)(r), __LINE__) #define __Pyx_DECREF(r) __Pyx_RefNanny->DECREF(__pyx_refnanny, (PyObject *)(r), __LINE__) #define __Pyx_GOTREF(r) __Pyx_RefNanny->GOTREF(__pyx_refnanny, (PyObject *)(r), __LINE__) #define __Pyx_GIVEREF(r) __Pyx_RefNanny->GIVEREF(__pyx_refnanny, (PyObject *)(r), __LINE__) #define __Pyx_XINCREF(r) do { if((r) != NULL) {__Pyx_INCREF(r); }} while(0) #define __Pyx_XDECREF(r) do { if((r) != NULL) {__Pyx_DECREF(r); }} while(0) #define __Pyx_XGOTREF(r) do { if((r) != NULL) {__Pyx_GOTREF(r); }} while(0) #define __Pyx_XGIVEREF(r) do { if((r) != NULL) {__Pyx_GIVEREF(r);}} while(0) #else #define __Pyx_RefNannyDeclarations #define __Pyx_RefNannySetupContext(name, acquire_gil) #define __Pyx_RefNannyFinishContext() #define __Pyx_INCREF(r) Py_INCREF(r) #define __Pyx_DECREF(r) Py_DECREF(r) #define __Pyx_GOTREF(r) #define __Pyx_GIVEREF(r) #define __Pyx_XINCREF(r) Py_XINCREF(r) #define __Pyx_XDECREF(r) Py_XDECREF(r) #define __Pyx_XGOTREF(r) #define __Pyx_XGIVEREF(r) #endif /* CYTHON_REFNANNY */ #define __Pyx_XDECREF_SET(r, v) do { \ PyObject *tmp = (PyObject *) r; \ r = v; __Pyx_XDECREF(tmp); \ } while (0) #define __Pyx_DECREF_SET(r, v) do { \ PyObject *tmp = (PyObject *) r; \ r = v; __Pyx_DECREF(tmp); \ } while (0) #define __Pyx_CLEAR(r) do { PyObject* tmp = ((PyObject*)(r)); r = NULL; __Pyx_DECREF(tmp);} while(0) #define __Pyx_XCLEAR(r) do { if((r) != NULL) {PyObject* tmp = ((PyObject*)(r)); r = NULL; __Pyx_DECREF(tmp);}} while(0) #if CYTHON_COMPILING_IN_CPYTHON static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStr(PyObject* obj, PyObject* attr_name) { PyTypeObject* tp = Py_TYPE(obj); if (likely(tp->tp_getattro)) return tp->tp_getattro(obj, attr_name); #if PY_MAJOR_VERSION < 3 if (likely(tp->tp_getattr)) return tp->tp_getattr(obj, PyString_AS_STRING(attr_name)); #endif return PyObject_GetAttr(obj, attr_name); } #else #define __Pyx_PyObject_GetAttrStr(o,n) PyObject_GetAttr(o,n) #endif static PyObject *__Pyx_GetBuiltinName(PyObject *name); /*proto*/ static void __Pyx_RaiseDoubleKeywordsError(const char* func_name, PyObject* kw_name); /*proto*/ static int __Pyx_ParseOptionalKeywords(PyObject *kwds, PyObject **argnames[], \ PyObject *kwds2, PyObject *values[], Py_ssize_t num_pos_args, \ const char* function_name); /*proto*/ static void __Pyx_RaiseArgtupleInvalid(const char* func_name, int exact, Py_ssize_t num_min, Py_ssize_t num_max, Py_ssize_t num_found); /*proto*/ #if CYTHON_COMPILING_IN_CPYTHON static CYTHON_INLINE PyObject* __Pyx_PyObject_Call(PyObject *func, PyObject *arg, PyObject *kw); /*proto*/ #else #define __Pyx_PyObject_Call(func, arg, kw) PyObject_Call(func, arg, kw) #endif static PyObject *__Pyx_CalculateMetaclass(PyTypeObject *metaclass, PyObject *bases); static PyTypeObject* __Pyx_FetchCommonType(PyTypeObject* type); #define __Pyx_CyFunction_USED 1 #include #define __Pyx_CYFUNCTION_STATICMETHOD 0x01 #define __Pyx_CYFUNCTION_CLASSMETHOD 0x02 #define __Pyx_CYFUNCTION_CCLASS 0x04 #define __Pyx_CyFunction_GetClosure(f) \ (((__pyx_CyFunctionObject *) (f))->func_closure) #define __Pyx_CyFunction_GetClassObj(f) \ (((__pyx_CyFunctionObject *) (f))->func_classobj) #define __Pyx_CyFunction_Defaults(type, f) \ ((type *)(((__pyx_CyFunctionObject *) (f))->defaults)) #define __Pyx_CyFunction_SetDefaultsGetter(f, g) \ ((__pyx_CyFunctionObject *) (f))->defaults_getter = (g) typedef struct { PyCFunctionObject func; PyObject *func_dict; PyObject *func_weakreflist; PyObject *func_name; PyObject *func_qualname; PyObject *func_doc; PyObject *func_globals; PyObject *func_code; PyObject *func_closure; PyObject *func_classobj; /* No-args super() class cell */ void *defaults; int defaults_pyobjects; int flags; PyObject *defaults_tuple; /* Const defaults tuple */ PyObject *defaults_kwdict; /* Const kwonly defaults dict */ PyObject *(*defaults_getter)(PyObject *); PyObject *func_annotations; /* function annotations dict */ } __pyx_CyFunctionObject; static PyTypeObject *__pyx_CyFunctionType = 0; #define __Pyx_CyFunction_NewEx(ml, flags, qualname, self, module, globals, code) \ __Pyx_CyFunction_New(__pyx_CyFunctionType, ml, flags, qualname, self, module, globals, code) static PyObject *__Pyx_CyFunction_New(PyTypeObject *, PyMethodDef *ml, int flags, PyObject* qualname, PyObject *self, PyObject *module, PyObject *globals, PyObject* code); static CYTHON_INLINE void *__Pyx_CyFunction_InitDefaults(PyObject *m, size_t size, int pyobjects); static CYTHON_INLINE void __Pyx_CyFunction_SetDefaultsTuple(PyObject *m, PyObject *tuple); static CYTHON_INLINE void __Pyx_CyFunction_SetDefaultsKwDict(PyObject *m, PyObject *dict); static CYTHON_INLINE void __Pyx_CyFunction_SetAnnotationsDict(PyObject *m, PyObject *dict); static int __Pyx_CyFunction_init(void); static PyObject *__Pyx_Py3MetaclassPrepare(PyObject *metaclass, PyObject *bases, PyObject *name, PyObject *qualname, PyObject *mkw, PyObject *modname, PyObject *doc); /*proto*/ static PyObject *__Pyx_Py3ClassCreate(PyObject *metaclass, PyObject *name, PyObject *bases, PyObject *dict, PyObject *mkw, int calculate_metaclass, int allow_py2_metaclass); /*proto*/ static CYTHON_INLINE PyObject* __Pyx_PyInt_From_long(long value); static CYTHON_INLINE long __Pyx_PyInt_As_long(PyObject *); static CYTHON_INLINE int __Pyx_PyInt_As_int(PyObject *); static int __Pyx_check_binary_version(void); typedef struct { int code_line; PyCodeObject* code_object; } __Pyx_CodeObjectCacheEntry; struct __Pyx_CodeObjectCache { int count; int max_count; __Pyx_CodeObjectCacheEntry* entries; }; static struct __Pyx_CodeObjectCache __pyx_code_cache = {0,0,NULL}; static int __pyx_bisect_code_objects(__Pyx_CodeObjectCacheEntry* entries, int count, int code_line); static PyCodeObject *__pyx_find_code_object(int code_line); static void __pyx_insert_code_object(int code_line, PyCodeObject* code_object); static void __Pyx_AddTraceback(const char *funcname, int c_line, int py_line, const char *filename); /*proto*/ static int __Pyx_InitStrings(__Pyx_StringTabEntry *t); /*proto*/ /* Module declarations from 'libc.stdint' */ /* Module declarations from 'libc.string' */ /* Module declarations from 'libc.stdio' */ /* Module declarations from 'libc.stddef' */ /* Module declarations from 'sdl2' */ /* Module declarations from 'pygame_sdl2.error' */ #define __Pyx_MODULE_NAME "pygame_sdl2.error" int __pyx_module_is_main_pygame_sdl2__error = 0; /* Implementation of 'pygame_sdl2.error' */ static PyObject *__pyx_builtin_RuntimeError; static PyObject *__pyx_pf_11pygame_sdl2_5error_5error___init__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_message); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_5error_get_error(CYTHON_UNUSED PyObject *__pyx_self); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_5error_2set_error(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_message); /* proto */ static char __pyx_k_[] = ""; static char __pyx_k_s[] = "%s"; static char __pyx_k_doc[] = "__doc__"; static char __pyx_k_init[] = "__init__"; static char __pyx_k_main[] = "__main__"; static char __pyx_k_self[] = "self"; static char __pyx_k_test[] = "__test__"; static char __pyx_k_error[] = "error"; static char __pyx_k_module[] = "__module__"; static char __pyx_k_message[] = "message"; static char __pyx_k_prepare[] = "__prepare__"; static char __pyx_k_qualname[] = "__qualname__"; static char __pyx_k_get_error[] = "get_error"; static char __pyx_k_metaclass[] = "__metaclass__"; static char __pyx_k_set_error[] = "set_error"; static char __pyx_k_RuntimeError[] = "RuntimeError"; static char __pyx_k_error___init[] = "error.__init__"; static char __pyx_k_pygame_sdl2_error[] = "pygame_sdl2.error"; static char __pyx_k_home_tom_ab_pygame_sdl2_src_pyg[] = "/home/tom/ab/pygame_sdl2/src/pygame_sdl2/error.pyx"; static PyObject *__pyx_kp_u_; static PyObject *__pyx_n_s_RuntimeError; static PyObject *__pyx_n_s_doc; static PyObject *__pyx_n_s_error; static PyObject *__pyx_n_s_error___init; static PyObject *__pyx_n_s_get_error; static PyObject *__pyx_kp_s_home_tom_ab_pygame_sdl2_src_pyg; static PyObject *__pyx_n_s_init; static PyObject *__pyx_n_s_main; static PyObject *__pyx_n_s_message; static PyObject *__pyx_n_s_metaclass; static PyObject *__pyx_n_s_module; static PyObject *__pyx_n_s_prepare; static PyObject *__pyx_n_s_pygame_sdl2_error; static PyObject *__pyx_n_s_qualname; static PyObject *__pyx_n_s_self; static PyObject *__pyx_n_s_set_error; static PyObject *__pyx_n_s_test; static PyObject *__pyx_tuple__2; static PyObject *__pyx_tuple__4; static PyObject *__pyx_tuple__5; static PyObject *__pyx_tuple__7; static PyObject *__pyx_codeobj__3; static PyObject *__pyx_codeobj__6; static PyObject *__pyx_codeobj__8; /* "pygame_sdl2/error.pyx":23 * class error(RuntimeError): * * def __init__(self, message=None): # <<<<<<<<<<<<<< * if message is None: * message = str(SDL_GetError()) */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_5error_5error_1__init__(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static PyMethodDef __pyx_mdef_11pygame_sdl2_5error_5error_1__init__ = {__Pyx_NAMESTR("__init__"), (PyCFunction)__pyx_pw_11pygame_sdl2_5error_5error_1__init__, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)}; static PyObject *__pyx_pw_11pygame_sdl2_5error_5error_1__init__(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_self = 0; PyObject *__pyx_v_message = 0; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__init__ (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_message,0}; PyObject* values[2] = {0,0}; values[1] = ((PyObject *)((PyObject *)Py_None)); if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_self)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; case 1: if (kw_args > 0) { PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_message); if (value) { values[1] = value; kw_args--; } } } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__init__") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 23; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } } else { switch (PyTuple_GET_SIZE(__pyx_args)) { case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_self = values[0]; __pyx_v_message = values[1]; } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("__init__", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 23; __pyx_clineno = __LINE__; goto __pyx_L3_error;} __pyx_L3_error:; __Pyx_AddTraceback("pygame_sdl2.error.error.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_11pygame_sdl2_5error_5error___init__(__pyx_self, __pyx_v_self, __pyx_v_message); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_5error_5error___init__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_message) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; int __pyx_t_2; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; PyObject *__pyx_t_5 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__init__", 0); __Pyx_INCREF(__pyx_v_message); /* "pygame_sdl2/error.pyx":24 * * def __init__(self, message=None): * if message is None: # <<<<<<<<<<<<<< * message = str(SDL_GetError()) * */ __pyx_t_1 = (__pyx_v_message == Py_None); __pyx_t_2 = (__pyx_t_1 != 0); if (__pyx_t_2) { /* "pygame_sdl2/error.pyx":25 * def __init__(self, message=None): * if message is None: * message = str(SDL_GetError()) # <<<<<<<<<<<<<< * * RuntimeError.__init__(self, message) */ __pyx_t_3 = __Pyx_PyBytes_FromString(SDL_GetError()); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 25; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 25; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_3); __Pyx_GIVEREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_3 = __Pyx_PyObject_Call(((PyObject *)((PyObject*)(&PyUnicode_Type))), __pyx_t_4, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 25; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF_SET(__pyx_v_message, __pyx_t_3); __pyx_t_3 = 0; goto __pyx_L3; } __pyx_L3:; /* "pygame_sdl2/error.pyx":27 * message = str(SDL_GetError()) * * RuntimeError.__init__(self, message) # <<<<<<<<<<<<<< * * def get_error(): */ __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_builtin_RuntimeError, __pyx_n_s_init); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 27; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 27; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); __Pyx_INCREF(__pyx_v_self); PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_v_self); __Pyx_GIVEREF(__pyx_v_self); __Pyx_INCREF(__pyx_v_message); PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_v_message); __Pyx_GIVEREF(__pyx_v_message); __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_4, NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 27; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; /* "pygame_sdl2/error.pyx":23 * class error(RuntimeError): * * def __init__(self, message=None): # <<<<<<<<<<<<<< * if message is None: * message = str(SDL_GetError()) */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_5); __Pyx_AddTraceback("pygame_sdl2.error.error.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF(__pyx_v_message); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/error.pyx":29 * RuntimeError.__init__(self, message) * * def get_error(): # <<<<<<<<<<<<<< * cdef const char *message = SDL_GetError() * */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_5error_1get_error(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused); /*proto*/ static PyMethodDef __pyx_mdef_11pygame_sdl2_5error_1get_error = {__Pyx_NAMESTR("get_error"), (PyCFunction)__pyx_pw_11pygame_sdl2_5error_1get_error, METH_NOARGS, __Pyx_DOCSTR(0)}; static PyObject *__pyx_pw_11pygame_sdl2_5error_1get_error(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("get_error (wrapper)", 0); __pyx_r = __pyx_pf_11pygame_sdl2_5error_get_error(__pyx_self); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_5error_get_error(CYTHON_UNUSED PyObject *__pyx_self) { char const *__pyx_v_message; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("get_error", 0); /* "pygame_sdl2/error.pyx":30 * * def get_error(): * cdef const char *message = SDL_GetError() # <<<<<<<<<<<<<< * * if message: */ __pyx_v_message = SDL_GetError(); /* "pygame_sdl2/error.pyx":32 * cdef const char *message = SDL_GetError() * * if message: # <<<<<<<<<<<<<< * return str(message) * else: */ __pyx_t_1 = (__pyx_v_message != 0); if (__pyx_t_1) { /* "pygame_sdl2/error.pyx":33 * * if message: * return str(message) # <<<<<<<<<<<<<< * else: * return '' */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __Pyx_PyBytes_FromString(__pyx_v_message); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 33; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 33; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_2); __Pyx_GIVEREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_2 = __Pyx_PyObject_Call(((PyObject *)((PyObject*)(&PyUnicode_Type))), __pyx_t_3, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 33; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; } /*else*/ { /* "pygame_sdl2/error.pyx":35 * return str(message) * else: * return '' # <<<<<<<<<<<<<< * * def set_error(message): */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(__pyx_kp_u_); __pyx_r = __pyx_kp_u_; goto __pyx_L0; } /* "pygame_sdl2/error.pyx":29 * RuntimeError.__init__(self, message) * * def get_error(): # <<<<<<<<<<<<<< * cdef const char *message = SDL_GetError() * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("pygame_sdl2.error.get_error", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/error.pyx":37 * return '' * * def set_error(message): # <<<<<<<<<<<<<< * message = bytes(message) * SDL_SetError("%s", message) */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_5error_3set_error(PyObject *__pyx_self, PyObject *__pyx_v_message); /*proto*/ static PyMethodDef __pyx_mdef_11pygame_sdl2_5error_3set_error = {__Pyx_NAMESTR("set_error"), (PyCFunction)__pyx_pw_11pygame_sdl2_5error_3set_error, METH_O, __Pyx_DOCSTR(0)}; static PyObject *__pyx_pw_11pygame_sdl2_5error_3set_error(PyObject *__pyx_self, PyObject *__pyx_v_message) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("set_error (wrapper)", 0); __pyx_r = __pyx_pf_11pygame_sdl2_5error_2set_error(__pyx_self, ((PyObject *)__pyx_v_message)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_5error_2set_error(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_message) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; char *__pyx_t_3; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("set_error", 0); __Pyx_INCREF(__pyx_v_message); /* "pygame_sdl2/error.pyx":38 * * def set_error(message): * message = bytes(message) # <<<<<<<<<<<<<< * SDL_SetError("%s", message) */ __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 38; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __Pyx_INCREF(__pyx_v_message); PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_message); __Pyx_GIVEREF(__pyx_v_message); __pyx_t_2 = __Pyx_PyObject_Call(((PyObject *)((PyObject*)(&PyBytes_Type))), __pyx_t_1, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 38; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF_SET(__pyx_v_message, __pyx_t_2); __pyx_t_2 = 0; /* "pygame_sdl2/error.pyx":39 * def set_error(message): * message = bytes(message) * SDL_SetError("%s", message) # <<<<<<<<<<<<<< */ __pyx_t_3 = __Pyx_PyObject_AsString(__pyx_v_message); if (unlikely((!__pyx_t_3) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 39; __pyx_clineno = __LINE__; goto __pyx_L1_error;} SDL_SetError(__pyx_k_s, ((char *)__pyx_t_3)); /* "pygame_sdl2/error.pyx":37 * return '' * * def set_error(message): # <<<<<<<<<<<<<< * message = bytes(message) * SDL_SetError("%s", message) */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_AddTraceback("pygame_sdl2.error.set_error", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF(__pyx_v_message); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyMethodDef __pyx_methods[] = { {0, 0, 0, 0} }; #if PY_MAJOR_VERSION >= 3 static struct PyModuleDef __pyx_moduledef = { #if PY_VERSION_HEX < 0x03020000 { PyObject_HEAD_INIT(NULL) NULL, 0, NULL }, #else PyModuleDef_HEAD_INIT, #endif __Pyx_NAMESTR("error"), 0, /* m_doc */ -1, /* m_size */ __pyx_methods /* m_methods */, NULL, /* m_reload */ NULL, /* m_traverse */ NULL, /* m_clear */ NULL /* m_free */ }; #endif static __Pyx_StringTabEntry __pyx_string_tab[] = { {&__pyx_kp_u_, __pyx_k_, sizeof(__pyx_k_), 0, 1, 0, 0}, {&__pyx_n_s_RuntimeError, __pyx_k_RuntimeError, sizeof(__pyx_k_RuntimeError), 0, 0, 1, 1}, {&__pyx_n_s_doc, __pyx_k_doc, sizeof(__pyx_k_doc), 0, 0, 1, 1}, {&__pyx_n_s_error, __pyx_k_error, sizeof(__pyx_k_error), 0, 0, 1, 1}, {&__pyx_n_s_error___init, __pyx_k_error___init, sizeof(__pyx_k_error___init), 0, 0, 1, 1}, {&__pyx_n_s_get_error, __pyx_k_get_error, sizeof(__pyx_k_get_error), 0, 0, 1, 1}, {&__pyx_kp_s_home_tom_ab_pygame_sdl2_src_pyg, __pyx_k_home_tom_ab_pygame_sdl2_src_pyg, sizeof(__pyx_k_home_tom_ab_pygame_sdl2_src_pyg), 0, 0, 1, 0}, {&__pyx_n_s_init, __pyx_k_init, sizeof(__pyx_k_init), 0, 0, 1, 1}, {&__pyx_n_s_main, __pyx_k_main, sizeof(__pyx_k_main), 0, 0, 1, 1}, {&__pyx_n_s_message, __pyx_k_message, sizeof(__pyx_k_message), 0, 0, 1, 1}, {&__pyx_n_s_metaclass, __pyx_k_metaclass, sizeof(__pyx_k_metaclass), 0, 0, 1, 1}, {&__pyx_n_s_module, __pyx_k_module, sizeof(__pyx_k_module), 0, 0, 1, 1}, {&__pyx_n_s_prepare, __pyx_k_prepare, sizeof(__pyx_k_prepare), 0, 0, 1, 1}, {&__pyx_n_s_pygame_sdl2_error, __pyx_k_pygame_sdl2_error, sizeof(__pyx_k_pygame_sdl2_error), 0, 0, 1, 1}, {&__pyx_n_s_qualname, __pyx_k_qualname, sizeof(__pyx_k_qualname), 0, 0, 1, 1}, {&__pyx_n_s_self, __pyx_k_self, sizeof(__pyx_k_self), 0, 0, 1, 1}, {&__pyx_n_s_set_error, __pyx_k_set_error, sizeof(__pyx_k_set_error), 0, 0, 1, 1}, {&__pyx_n_s_test, __pyx_k_test, sizeof(__pyx_k_test), 0, 0, 1, 1}, {0, 0, 0, 0, 0, 0, 0} }; static int __Pyx_InitCachedBuiltins(void) { __pyx_builtin_RuntimeError = __Pyx_GetBuiltinName(__pyx_n_s_RuntimeError); if (!__pyx_builtin_RuntimeError) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 21; __pyx_clineno = __LINE__; goto __pyx_L1_error;} return 0; __pyx_L1_error:; return -1; } static int __Pyx_InitCachedConstants(void) { __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__Pyx_InitCachedConstants", 0); /* "pygame_sdl2/error.pyx":23 * class error(RuntimeError): * * def __init__(self, message=None): # <<<<<<<<<<<<<< * if message is None: * message = str(SDL_GetError()) */ __pyx_tuple__2 = PyTuple_Pack(2, __pyx_n_s_self, __pyx_n_s_message); if (unlikely(!__pyx_tuple__2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 23; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_tuple__2); __Pyx_GIVEREF(__pyx_tuple__2); __pyx_codeobj__3 = (PyObject*)__Pyx_PyCode_New(2, 0, 2, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__2, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_tom_ab_pygame_sdl2_src_pyg, __pyx_n_s_init, 23, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 23; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_tuple__4 = PyTuple_Pack(1, ((PyObject *)Py_None)); if (unlikely(!__pyx_tuple__4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 23; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_tuple__4); __Pyx_GIVEREF(__pyx_tuple__4); /* "pygame_sdl2/error.pyx":29 * RuntimeError.__init__(self, message) * * def get_error(): # <<<<<<<<<<<<<< * cdef const char *message = SDL_GetError() * */ __pyx_tuple__5 = PyTuple_Pack(1, __pyx_n_s_message); if (unlikely(!__pyx_tuple__5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 29; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_tuple__5); __Pyx_GIVEREF(__pyx_tuple__5); __pyx_codeobj__6 = (PyObject*)__Pyx_PyCode_New(0, 0, 1, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__5, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_tom_ab_pygame_sdl2_src_pyg, __pyx_n_s_get_error, 29, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 29; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "pygame_sdl2/error.pyx":37 * return '' * * def set_error(message): # <<<<<<<<<<<<<< * message = bytes(message) * SDL_SetError("%s", message) */ __pyx_tuple__7 = PyTuple_Pack(1, __pyx_n_s_message); if (unlikely(!__pyx_tuple__7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 37; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_tuple__7); __Pyx_GIVEREF(__pyx_tuple__7); __pyx_codeobj__8 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__7, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_tom_ab_pygame_sdl2_src_pyg, __pyx_n_s_set_error, 37, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 37; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_RefNannyFinishContext(); return 0; __pyx_L1_error:; __Pyx_RefNannyFinishContext(); return -1; } static int __Pyx_InitGlobals(void) { if (__Pyx_InitStrings(__pyx_string_tab) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; return 0; __pyx_L1_error:; return -1; } #if PY_MAJOR_VERSION < 3 PyMODINIT_FUNC initerror(void); /*proto*/ PyMODINIT_FUNC initerror(void) #else PyMODINIT_FUNC PyInit_error(void); /*proto*/ PyMODINIT_FUNC PyInit_error(void) #endif { PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannyDeclarations #if CYTHON_REFNANNY __Pyx_RefNanny = __Pyx_RefNannyImportAPI("refnanny"); if (!__Pyx_RefNanny) { PyErr_Clear(); __Pyx_RefNanny = __Pyx_RefNannyImportAPI("Cython.Runtime.refnanny"); if (!__Pyx_RefNanny) Py_FatalError("failed to import 'refnanny' module"); } #endif __Pyx_RefNannySetupContext("PyMODINIT_FUNC PyInit_error(void)", 0); if ( __Pyx_check_binary_version() < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_empty_tuple = PyTuple_New(0); if (unlikely(!__pyx_empty_tuple)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_empty_bytes = PyBytes_FromStringAndSize("", 0); if (unlikely(!__pyx_empty_bytes)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} #ifdef __Pyx_CyFunction_USED if (__Pyx_CyFunction_init() < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} #endif #ifdef __Pyx_FusedFunction_USED if (__pyx_FusedFunction_init() < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} #endif #ifdef __Pyx_Generator_USED if (__pyx_Generator_init() < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} #endif /*--- Library function declarations ---*/ /*--- Threads initialization code ---*/ #if defined(__PYX_FORCE_INIT_THREADS) && __PYX_FORCE_INIT_THREADS #ifdef WITH_THREAD /* Python build with threading support? */ PyEval_InitThreads(); #endif #endif /*--- Module creation code ---*/ #if PY_MAJOR_VERSION < 3 __pyx_m = Py_InitModule4(__Pyx_NAMESTR("error"), __pyx_methods, 0, 0, PYTHON_API_VERSION); Py_XINCREF(__pyx_m); #else __pyx_m = PyModule_Create(&__pyx_moduledef); #endif if (unlikely(!__pyx_m)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_d = PyModule_GetDict(__pyx_m); if (unlikely(!__pyx_d)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} Py_INCREF(__pyx_d); __pyx_b = PyImport_AddModule(__Pyx_NAMESTR(__Pyx_BUILTIN_MODULE_NAME)); if (unlikely(!__pyx_b)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} #if CYTHON_COMPILING_IN_PYPY Py_INCREF(__pyx_b); #endif if (__Pyx_SetAttrString(__pyx_m, "__builtins__", __pyx_b) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; /*--- Initialize various global constants etc. ---*/ if (unlikely(__Pyx_InitGlobals() < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} #if PY_MAJOR_VERSION < 3 && (__PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT) if (__Pyx_init_sys_getdefaultencoding_params() < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} #endif if (__pyx_module_is_main_pygame_sdl2__error) { if (__Pyx_SetAttrString(__pyx_m, "__name__", __pyx_n_s_main) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; } #if PY_MAJOR_VERSION >= 3 { PyObject *modules = PyImport_GetModuleDict(); if (unlikely(!modules)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} if (!PyDict_GetItemString(modules, "pygame_sdl2.error")) { if (unlikely(PyDict_SetItemString(modules, "pygame_sdl2.error", __pyx_m) < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } } #endif /*--- Builtin init code ---*/ if (unlikely(__Pyx_InitCachedBuiltins() < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /*--- Constants init code ---*/ if (unlikely(__Pyx_InitCachedConstants() < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /*--- Global init code ---*/ /*--- Variable export code ---*/ /*--- Function export code ---*/ /*--- Type init code ---*/ /*--- Type import code ---*/ /*--- Variable import code ---*/ /*--- Function import code ---*/ /*--- Execution code ---*/ /* "pygame_sdl2/error.pyx":21 * from sdl2 cimport * * * class error(RuntimeError): # <<<<<<<<<<<<<< * * def __init__(self, message=None): */ __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 21; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __Pyx_INCREF(__pyx_builtin_RuntimeError); PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_builtin_RuntimeError); __Pyx_GIVEREF(__pyx_builtin_RuntimeError); __pyx_t_2 = __Pyx_CalculateMetaclass(NULL, __pyx_t_1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 21; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = __Pyx_Py3MetaclassPrepare(__pyx_t_2, __pyx_t_1, __pyx_n_s_error, __pyx_n_s_error, (PyObject *) NULL, __pyx_n_s_pygame_sdl2_error, (PyObject *) NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 21; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); /* "pygame_sdl2/error.pyx":23 * class error(RuntimeError): * * def __init__(self, message=None): # <<<<<<<<<<<<<< * if message is None: * message = str(SDL_GetError()) */ __pyx_t_4 = __Pyx_CyFunction_NewEx(&__pyx_mdef_11pygame_sdl2_5error_5error_1__init__, 0, __pyx_n_s_error___init, NULL, __pyx_n_s_pygame_sdl2_error, PyModule_GetDict(__pyx_m), ((PyObject *)__pyx_codeobj__3)); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 23; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_4, __pyx_tuple__4); if (PyObject_SetItem(__pyx_t_3, __pyx_n_s_init, __pyx_t_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 23; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; /* "pygame_sdl2/error.pyx":21 * from sdl2 cimport * * * class error(RuntimeError): # <<<<<<<<<<<<<< * * def __init__(self, message=None): */ __pyx_t_4 = __Pyx_Py3ClassCreate(__pyx_t_2, __pyx_n_s_error, __pyx_t_1, __pyx_t_3, NULL, 0, 0); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 21; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); if (PyDict_SetItem(__pyx_d, __pyx_n_s_error, __pyx_t_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 21; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "pygame_sdl2/error.pyx":29 * RuntimeError.__init__(self, message) * * def get_error(): # <<<<<<<<<<<<<< * cdef const char *message = SDL_GetError() * */ __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_11pygame_sdl2_5error_1get_error, NULL, __pyx_n_s_pygame_sdl2_error); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 29; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); if (PyDict_SetItem(__pyx_d, __pyx_n_s_get_error, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 29; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "pygame_sdl2/error.pyx":37 * return '' * * def set_error(message): # <<<<<<<<<<<<<< * message = bytes(message) * SDL_SetError("%s", message) */ __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_11pygame_sdl2_5error_3set_error, NULL, __pyx_n_s_pygame_sdl2_error); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 37; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); if (PyDict_SetItem(__pyx_d, __pyx_n_s_set_error, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 37; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "pygame_sdl2/error.pyx":1 * # Copyright 2014 Tom Rothamel # <<<<<<<<<<<<<< * # * # This software is provided 'as-is', without any express or implied */ __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); if (PyDict_SetItem(__pyx_d, __pyx_n_s_test, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); if (__pyx_m) { __Pyx_AddTraceback("init pygame_sdl2.error", __pyx_clineno, __pyx_lineno, __pyx_filename); Py_DECREF(__pyx_m); __pyx_m = 0; } else if (!PyErr_Occurred()) { PyErr_SetString(PyExc_ImportError, "init pygame_sdl2.error"); } __pyx_L0:; __Pyx_RefNannyFinishContext(); #if PY_MAJOR_VERSION < 3 return; #else return __pyx_m; #endif } /* Runtime support code */ #if CYTHON_REFNANNY static __Pyx_RefNannyAPIStruct *__Pyx_RefNannyImportAPI(const char *modname) { PyObject *m = NULL, *p = NULL; void *r = NULL; m = PyImport_ImportModule((char *)modname); if (!m) goto end; p = PyObject_GetAttrString(m, (char *)"RefNannyAPI"); if (!p) goto end; r = PyLong_AsVoidPtr(p); end: Py_XDECREF(p); Py_XDECREF(m); return (__Pyx_RefNannyAPIStruct *)r; } #endif /* CYTHON_REFNANNY */ static PyObject *__Pyx_GetBuiltinName(PyObject *name) { PyObject* result = __Pyx_PyObject_GetAttrStr(__pyx_b, name); if (unlikely(!result)) { PyErr_Format(PyExc_NameError, #if PY_MAJOR_VERSION >= 3 "name '%U' is not defined", name); #else "name '%.200s' is not defined", PyString_AS_STRING(name)); #endif } return result; } static void __Pyx_RaiseDoubleKeywordsError( const char* func_name, PyObject* kw_name) { PyErr_Format(PyExc_TypeError, #if PY_MAJOR_VERSION >= 3 "%s() got multiple values for keyword argument '%U'", func_name, kw_name); #else "%s() got multiple values for keyword argument '%s'", func_name, PyString_AsString(kw_name)); #endif } static int __Pyx_ParseOptionalKeywords( PyObject *kwds, PyObject **argnames[], PyObject *kwds2, PyObject *values[], Py_ssize_t num_pos_args, const char* function_name) { PyObject *key = 0, *value = 0; Py_ssize_t pos = 0; PyObject*** name; PyObject*** first_kw_arg = argnames + num_pos_args; while (PyDict_Next(kwds, &pos, &key, &value)) { name = first_kw_arg; while (*name && (**name != key)) name++; if (*name) { values[name-argnames] = value; continue; } name = first_kw_arg; #if PY_MAJOR_VERSION < 3 if (likely(PyString_CheckExact(key)) || likely(PyString_Check(key))) { while (*name) { if ((CYTHON_COMPILING_IN_PYPY || PyString_GET_SIZE(**name) == PyString_GET_SIZE(key)) && _PyString_Eq(**name, key)) { values[name-argnames] = value; break; } name++; } if (*name) continue; else { PyObject*** argname = argnames; while (argname != first_kw_arg) { if ((**argname == key) || ( (CYTHON_COMPILING_IN_PYPY || PyString_GET_SIZE(**argname) == PyString_GET_SIZE(key)) && _PyString_Eq(**argname, key))) { goto arg_passed_twice; } argname++; } } } else #endif if (likely(PyUnicode_Check(key))) { while (*name) { int cmp = (**name == key) ? 0 : #if !CYTHON_COMPILING_IN_PYPY && PY_MAJOR_VERSION >= 3 (PyUnicode_GET_SIZE(**name) != PyUnicode_GET_SIZE(key)) ? 1 : #endif PyUnicode_Compare(**name, key); if (cmp < 0 && unlikely(PyErr_Occurred())) goto bad; if (cmp == 0) { values[name-argnames] = value; break; } name++; } if (*name) continue; else { PyObject*** argname = argnames; while (argname != first_kw_arg) { int cmp = (**argname == key) ? 0 : #if !CYTHON_COMPILING_IN_PYPY && PY_MAJOR_VERSION >= 3 (PyUnicode_GET_SIZE(**argname) != PyUnicode_GET_SIZE(key)) ? 1 : #endif PyUnicode_Compare(**argname, key); if (cmp < 0 && unlikely(PyErr_Occurred())) goto bad; if (cmp == 0) goto arg_passed_twice; argname++; } } } else goto invalid_keyword_type; if (kwds2) { if (unlikely(PyDict_SetItem(kwds2, key, value))) goto bad; } else { goto invalid_keyword; } } return 0; arg_passed_twice: __Pyx_RaiseDoubleKeywordsError(function_name, key); goto bad; invalid_keyword_type: PyErr_Format(PyExc_TypeError, "%.200s() keywords must be strings", function_name); goto bad; invalid_keyword: PyErr_Format(PyExc_TypeError, #if PY_MAJOR_VERSION < 3 "%.200s() got an unexpected keyword argument '%.200s'", function_name, PyString_AsString(key)); #else "%s() got an unexpected keyword argument '%U'", function_name, key); #endif bad: return -1; } static void __Pyx_RaiseArgtupleInvalid( const char* func_name, int exact, Py_ssize_t num_min, Py_ssize_t num_max, Py_ssize_t num_found) { Py_ssize_t num_expected; const char *more_or_less; if (num_found < num_min) { num_expected = num_min; more_or_less = "at least"; } else { num_expected = num_max; more_or_less = "at most"; } if (exact) { more_or_less = "exactly"; } PyErr_Format(PyExc_TypeError, "%.200s() takes %.8s %" CYTHON_FORMAT_SSIZE_T "d positional argument%.1s (%" CYTHON_FORMAT_SSIZE_T "d given)", func_name, more_or_less, num_expected, (num_expected == 1) ? "" : "s", num_found); } #if CYTHON_COMPILING_IN_CPYTHON static CYTHON_INLINE PyObject* __Pyx_PyObject_Call(PyObject *func, PyObject *arg, PyObject *kw) { PyObject *result; ternaryfunc call = func->ob_type->tp_call; if (unlikely(!call)) return PyObject_Call(func, arg, kw); #if PY_VERSION_HEX >= 0x02060000 if (unlikely(Py_EnterRecursiveCall((char*)" while calling a Python object"))) return NULL; #endif result = (*call)(func, arg, kw); #if PY_VERSION_HEX >= 0x02060000 Py_LeaveRecursiveCall(); #endif if (unlikely(!result) && unlikely(!PyErr_Occurred())) { PyErr_SetString( PyExc_SystemError, "NULL result without error in PyObject_Call"); } return result; } #endif static PyObject *__Pyx_CalculateMetaclass(PyTypeObject *metaclass, PyObject *bases) { Py_ssize_t i, nbases = PyTuple_GET_SIZE(bases); for (i=0; i < nbases; i++) { PyTypeObject *tmptype; PyObject *tmp = PyTuple_GET_ITEM(bases, i); tmptype = Py_TYPE(tmp); #if PY_MAJOR_VERSION < 3 if (tmptype == &PyClass_Type) continue; #endif if (!metaclass) { metaclass = tmptype; continue; } if (PyType_IsSubtype(metaclass, tmptype)) continue; if (PyType_IsSubtype(tmptype, metaclass)) { metaclass = tmptype; continue; } PyErr_SetString(PyExc_TypeError, "metaclass conflict: " "the metaclass of a derived class " "must be a (non-strict) subclass " "of the metaclasses of all its bases"); return NULL; } if (!metaclass) { #if PY_MAJOR_VERSION < 3 metaclass = &PyClass_Type; #else metaclass = &PyType_Type; #endif } Py_INCREF((PyObject*) metaclass); return (PyObject*) metaclass; } static PyTypeObject* __Pyx_FetchCommonType(PyTypeObject* type) { PyObject* fake_module; PyTypeObject* cached_type = NULL; fake_module = PyImport_AddModule((char*) "_cython_" CYTHON_ABI); if (!fake_module) return NULL; Py_INCREF(fake_module); cached_type = (PyTypeObject*) PyObject_GetAttrString(fake_module, type->tp_name); if (cached_type) { if (!PyType_Check((PyObject*)cached_type)) { PyErr_Format(PyExc_TypeError, "Shared Cython type %.200s is not a type object", type->tp_name); goto bad; } if (cached_type->tp_basicsize != type->tp_basicsize) { PyErr_Format(PyExc_TypeError, "Shared Cython type %.200s has the wrong size, try recompiling", type->tp_name); goto bad; } } else { if (!PyErr_ExceptionMatches(PyExc_AttributeError)) goto bad; PyErr_Clear(); if (PyType_Ready(type) < 0) goto bad; if (PyObject_SetAttrString(fake_module, type->tp_name, (PyObject*) type) < 0) goto bad; Py_INCREF(type); cached_type = type; } done: Py_DECREF(fake_module); return cached_type; bad: Py_XDECREF(cached_type); cached_type = NULL; goto done; } static PyObject * __Pyx_CyFunction_get_doc(__pyx_CyFunctionObject *op, CYTHON_UNUSED void *closure) { if (unlikely(op->func_doc == NULL)) { if (op->func.m_ml->ml_doc) { #if PY_MAJOR_VERSION >= 3 op->func_doc = PyUnicode_FromString(op->func.m_ml->ml_doc); #else op->func_doc = PyString_FromString(op->func.m_ml->ml_doc); #endif if (unlikely(op->func_doc == NULL)) return NULL; } else { Py_INCREF(Py_None); return Py_None; } } Py_INCREF(op->func_doc); return op->func_doc; } static int __Pyx_CyFunction_set_doc(__pyx_CyFunctionObject *op, PyObject *value) { PyObject *tmp = op->func_doc; if (value == NULL) value = Py_None; /* Mark as deleted */ Py_INCREF(value); op->func_doc = value; Py_XDECREF(tmp); return 0; } static PyObject * __Pyx_CyFunction_get_name(__pyx_CyFunctionObject *op) { if (unlikely(op->func_name == NULL)) { #if PY_MAJOR_VERSION >= 3 op->func_name = PyUnicode_InternFromString(op->func.m_ml->ml_name); #else op->func_name = PyString_InternFromString(op->func.m_ml->ml_name); #endif if (unlikely(op->func_name == NULL)) return NULL; } Py_INCREF(op->func_name); return op->func_name; } static int __Pyx_CyFunction_set_name(__pyx_CyFunctionObject *op, PyObject *value) { PyObject *tmp; #if PY_MAJOR_VERSION >= 3 if (unlikely(value == NULL || !PyUnicode_Check(value))) { #else if (unlikely(value == NULL || !PyString_Check(value))) { #endif PyErr_SetString(PyExc_TypeError, "__name__ must be set to a string object"); return -1; } tmp = op->func_name; Py_INCREF(value); op->func_name = value; Py_XDECREF(tmp); return 0; } static PyObject * __Pyx_CyFunction_get_qualname(__pyx_CyFunctionObject *op) { Py_INCREF(op->func_qualname); return op->func_qualname; } static int __Pyx_CyFunction_set_qualname(__pyx_CyFunctionObject *op, PyObject *value) { PyObject *tmp; #if PY_MAJOR_VERSION >= 3 if (unlikely(value == NULL || !PyUnicode_Check(value))) { #else if (unlikely(value == NULL || !PyString_Check(value))) { #endif PyErr_SetString(PyExc_TypeError, "__qualname__ must be set to a string object"); return -1; } tmp = op->func_qualname; Py_INCREF(value); op->func_qualname = value; Py_XDECREF(tmp); return 0; } static PyObject * __Pyx_CyFunction_get_self(__pyx_CyFunctionObject *m, CYTHON_UNUSED void *closure) { PyObject *self; self = m->func_closure; if (self == NULL) self = Py_None; Py_INCREF(self); return self; } static PyObject * __Pyx_CyFunction_get_dict(__pyx_CyFunctionObject *op) { if (unlikely(op->func_dict == NULL)) { op->func_dict = PyDict_New(); if (unlikely(op->func_dict == NULL)) return NULL; } Py_INCREF(op->func_dict); return op->func_dict; } static int __Pyx_CyFunction_set_dict(__pyx_CyFunctionObject *op, PyObject *value) { PyObject *tmp; if (unlikely(value == NULL)) { PyErr_SetString(PyExc_TypeError, "function's dictionary may not be deleted"); return -1; } if (unlikely(!PyDict_Check(value))) { PyErr_SetString(PyExc_TypeError, "setting function's dictionary to a non-dict"); return -1; } tmp = op->func_dict; Py_INCREF(value); op->func_dict = value; Py_XDECREF(tmp); return 0; } static PyObject * __Pyx_CyFunction_get_globals(__pyx_CyFunctionObject *op) { Py_INCREF(op->func_globals); return op->func_globals; } static PyObject * __Pyx_CyFunction_get_closure(CYTHON_UNUSED __pyx_CyFunctionObject *op) { Py_INCREF(Py_None); return Py_None; } static PyObject * __Pyx_CyFunction_get_code(__pyx_CyFunctionObject *op) { PyObject* result = (op->func_code) ? op->func_code : Py_None; Py_INCREF(result); return result; } static int __Pyx_CyFunction_init_defaults(__pyx_CyFunctionObject *op) { PyObject *res = op->defaults_getter((PyObject *) op); if (unlikely(!res)) return -1; op->defaults_tuple = PyTuple_GET_ITEM(res, 0); Py_INCREF(op->defaults_tuple); op->defaults_kwdict = PyTuple_GET_ITEM(res, 1); Py_INCREF(op->defaults_kwdict); Py_DECREF(res); return 0; } static int __Pyx_CyFunction_set_defaults(__pyx_CyFunctionObject *op, PyObject* value) { PyObject* tmp; if (!value) { value = Py_None; } else if (value != Py_None && !PyTuple_Check(value)) { PyErr_SetString(PyExc_TypeError, "__defaults__ must be set to a tuple object"); return -1; } Py_INCREF(value); tmp = op->defaults_tuple; op->defaults_tuple = value; Py_XDECREF(tmp); return 0; } static PyObject * __Pyx_CyFunction_get_defaults(__pyx_CyFunctionObject *op) { PyObject* result = op->defaults_tuple; if (unlikely(!result)) { if (op->defaults_getter) { if (__Pyx_CyFunction_init_defaults(op) < 0) return NULL; result = op->defaults_tuple; } else { result = Py_None; } } Py_INCREF(result); return result; } static int __Pyx_CyFunction_set_kwdefaults(__pyx_CyFunctionObject *op, PyObject* value) { PyObject* tmp; if (!value) { value = Py_None; } else if (value != Py_None && !PyDict_Check(value)) { PyErr_SetString(PyExc_TypeError, "__kwdefaults__ must be set to a dict object"); return -1; } Py_INCREF(value); tmp = op->defaults_kwdict; op->defaults_kwdict = value; Py_XDECREF(tmp); return 0; } static PyObject * __Pyx_CyFunction_get_kwdefaults(__pyx_CyFunctionObject *op) { PyObject* result = op->defaults_kwdict; if (unlikely(!result)) { if (op->defaults_getter) { if (__Pyx_CyFunction_init_defaults(op) < 0) return NULL; result = op->defaults_kwdict; } else { result = Py_None; } } Py_INCREF(result); return result; } static int __Pyx_CyFunction_set_annotations(__pyx_CyFunctionObject *op, PyObject* value) { PyObject* tmp; if (!value || value == Py_None) { value = NULL; } else if (!PyDict_Check(value)) { PyErr_SetString(PyExc_TypeError, "__annotations__ must be set to a dict object"); return -1; } Py_XINCREF(value); tmp = op->func_annotations; op->func_annotations = value; Py_XDECREF(tmp); return 0; } static PyObject * __Pyx_CyFunction_get_annotations(__pyx_CyFunctionObject *op) { PyObject* result = op->func_annotations; if (unlikely(!result)) { result = PyDict_New(); if (unlikely(!result)) return NULL; op->func_annotations = result; } Py_INCREF(result); return result; } static PyGetSetDef __pyx_CyFunction_getsets[] = { {(char *) "func_doc", (getter)__Pyx_CyFunction_get_doc, (setter)__Pyx_CyFunction_set_doc, 0, 0}, {(char *) "__doc__", (getter)__Pyx_CyFunction_get_doc, (setter)__Pyx_CyFunction_set_doc, 0, 0}, {(char *) "func_name", (getter)__Pyx_CyFunction_get_name, (setter)__Pyx_CyFunction_set_name, 0, 0}, {(char *) "__name__", (getter)__Pyx_CyFunction_get_name, (setter)__Pyx_CyFunction_set_name, 0, 0}, {(char *) "__qualname__", (getter)__Pyx_CyFunction_get_qualname, (setter)__Pyx_CyFunction_set_qualname, 0, 0}, {(char *) "__self__", (getter)__Pyx_CyFunction_get_self, 0, 0, 0}, {(char *) "func_dict", (getter)__Pyx_CyFunction_get_dict, (setter)__Pyx_CyFunction_set_dict, 0, 0}, {(char *) "__dict__", (getter)__Pyx_CyFunction_get_dict, (setter)__Pyx_CyFunction_set_dict, 0, 0}, {(char *) "func_globals", (getter)__Pyx_CyFunction_get_globals, 0, 0, 0}, {(char *) "__globals__", (getter)__Pyx_CyFunction_get_globals, 0, 0, 0}, {(char *) "func_closure", (getter)__Pyx_CyFunction_get_closure, 0, 0, 0}, {(char *) "__closure__", (getter)__Pyx_CyFunction_get_closure, 0, 0, 0}, {(char *) "func_code", (getter)__Pyx_CyFunction_get_code, 0, 0, 0}, {(char *) "__code__", (getter)__Pyx_CyFunction_get_code, 0, 0, 0}, {(char *) "func_defaults", (getter)__Pyx_CyFunction_get_defaults, (setter)__Pyx_CyFunction_set_defaults, 0, 0}, {(char *) "__defaults__", (getter)__Pyx_CyFunction_get_defaults, (setter)__Pyx_CyFunction_set_defaults, 0, 0}, {(char *) "__kwdefaults__", (getter)__Pyx_CyFunction_get_kwdefaults, (setter)__Pyx_CyFunction_set_kwdefaults, 0, 0}, {(char *) "__annotations__", (getter)__Pyx_CyFunction_get_annotations, (setter)__Pyx_CyFunction_set_annotations, 0, 0}, {0, 0, 0, 0, 0} }; #ifndef PY_WRITE_RESTRICTED /* < Py2.5 */ #define PY_WRITE_RESTRICTED WRITE_RESTRICTED #endif static PyMemberDef __pyx_CyFunction_members[] = { {(char *) "__module__", T_OBJECT, offsetof(__pyx_CyFunctionObject, func.m_module), PY_WRITE_RESTRICTED, 0}, {0, 0, 0, 0, 0} }; static PyObject * __Pyx_CyFunction_reduce(__pyx_CyFunctionObject *m, CYTHON_UNUSED PyObject *args) { #if PY_MAJOR_VERSION >= 3 return PyUnicode_FromString(m->func.m_ml->ml_name); #else return PyString_FromString(m->func.m_ml->ml_name); #endif } static PyMethodDef __pyx_CyFunction_methods[] = { {__Pyx_NAMESTR("__reduce__"), (PyCFunction)__Pyx_CyFunction_reduce, METH_VARARGS, 0}, {0, 0, 0, 0} }; static PyObject *__Pyx_CyFunction_New(PyTypeObject *type, PyMethodDef *ml, int flags, PyObject* qualname, PyObject *closure, PyObject *module, PyObject* globals, PyObject* code) { __pyx_CyFunctionObject *op = PyObject_GC_New(__pyx_CyFunctionObject, type); if (op == NULL) return NULL; op->flags = flags; op->func_weakreflist = NULL; op->func.m_ml = ml; op->func.m_self = (PyObject *) op; Py_XINCREF(closure); op->func_closure = closure; Py_XINCREF(module); op->func.m_module = module; op->func_dict = NULL; op->func_name = NULL; Py_INCREF(qualname); op->func_qualname = qualname; op->func_doc = NULL; op->func_classobj = NULL; op->func_globals = globals; Py_INCREF(op->func_globals); Py_XINCREF(code); op->func_code = code; op->defaults_pyobjects = 0; op->defaults = NULL; op->defaults_tuple = NULL; op->defaults_kwdict = NULL; op->defaults_getter = NULL; op->func_annotations = NULL; PyObject_GC_Track(op); return (PyObject *) op; } static int __Pyx_CyFunction_clear(__pyx_CyFunctionObject *m) { Py_CLEAR(m->func_closure); Py_CLEAR(m->func.m_module); Py_CLEAR(m->func_dict); Py_CLEAR(m->func_name); Py_CLEAR(m->func_qualname); Py_CLEAR(m->func_doc); Py_CLEAR(m->func_globals); Py_CLEAR(m->func_code); Py_CLEAR(m->func_classobj); Py_CLEAR(m->defaults_tuple); Py_CLEAR(m->defaults_kwdict); Py_CLEAR(m->func_annotations); if (m->defaults) { PyObject **pydefaults = __Pyx_CyFunction_Defaults(PyObject *, m); int i; for (i = 0; i < m->defaults_pyobjects; i++) Py_XDECREF(pydefaults[i]); PyMem_Free(m->defaults); m->defaults = NULL; } return 0; } static void __Pyx_CyFunction_dealloc(__pyx_CyFunctionObject *m) { PyObject_GC_UnTrack(m); if (m->func_weakreflist != NULL) PyObject_ClearWeakRefs((PyObject *) m); __Pyx_CyFunction_clear(m); PyObject_GC_Del(m); } static int __Pyx_CyFunction_traverse(__pyx_CyFunctionObject *m, visitproc visit, void *arg) { Py_VISIT(m->func_closure); Py_VISIT(m->func.m_module); Py_VISIT(m->func_dict); Py_VISIT(m->func_name); Py_VISIT(m->func_qualname); Py_VISIT(m->func_doc); Py_VISIT(m->func_globals); Py_VISIT(m->func_code); Py_VISIT(m->func_classobj); Py_VISIT(m->defaults_tuple); Py_VISIT(m->defaults_kwdict); if (m->defaults) { PyObject **pydefaults = __Pyx_CyFunction_Defaults(PyObject *, m); int i; for (i = 0; i < m->defaults_pyobjects; i++) Py_VISIT(pydefaults[i]); } return 0; } static PyObject *__Pyx_CyFunction_descr_get(PyObject *func, PyObject *obj, PyObject *type) { __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func; if (m->flags & __Pyx_CYFUNCTION_STATICMETHOD) { Py_INCREF(func); return func; } if (m->flags & __Pyx_CYFUNCTION_CLASSMETHOD) { if (type == NULL) type = (PyObject *)(Py_TYPE(obj)); return PyMethod_New(func, type, (PyObject *)(Py_TYPE(type))); } if (obj == Py_None) obj = NULL; return PyMethod_New(func, obj, type); } static PyObject* __Pyx_CyFunction_repr(__pyx_CyFunctionObject *op) { #if PY_MAJOR_VERSION >= 3 return PyUnicode_FromFormat("", op->func_qualname, (void *)op); #else return PyString_FromFormat("", PyString_AsString(op->func_qualname), (void *)op); #endif } #if CYTHON_COMPILING_IN_PYPY static PyObject * __Pyx_CyFunction_Call(PyObject *func, PyObject *arg, PyObject *kw) { PyCFunctionObject* f = (PyCFunctionObject*)func; PyCFunction meth = PyCFunction_GET_FUNCTION(func); PyObject *self = PyCFunction_GET_SELF(func); Py_ssize_t size; switch (PyCFunction_GET_FLAGS(func) & ~(METH_CLASS | METH_STATIC | METH_COEXIST)) { case METH_VARARGS: if (likely(kw == NULL) || PyDict_Size(kw) == 0) return (*meth)(self, arg); break; case METH_VARARGS | METH_KEYWORDS: return (*(PyCFunctionWithKeywords)meth)(self, arg, kw); case METH_NOARGS: if (likely(kw == NULL) || PyDict_Size(kw) == 0) { size = PyTuple_GET_SIZE(arg); if (size == 0) return (*meth)(self, NULL); PyErr_Format(PyExc_TypeError, "%.200s() takes no arguments (%zd given)", f->m_ml->ml_name, size); return NULL; } break; case METH_O: if (likely(kw == NULL) || PyDict_Size(kw) == 0) { size = PyTuple_GET_SIZE(arg); if (size == 1) return (*meth)(self, PyTuple_GET_ITEM(arg, 0)); PyErr_Format(PyExc_TypeError, "%.200s() takes exactly one argument (%zd given)", f->m_ml->ml_name, size); return NULL; } break; default: PyErr_SetString(PyExc_SystemError, "Bad call flags in " "__Pyx_CyFunction_Call. METH_OLDARGS is no " "longer supported!"); return NULL; } PyErr_Format(PyExc_TypeError, "%.200s() takes no keyword arguments", f->m_ml->ml_name); return NULL; } #else static PyObject * __Pyx_CyFunction_Call(PyObject *func, PyObject *arg, PyObject *kw) { return PyCFunction_Call(func, arg, kw); } #endif static PyTypeObject __pyx_CyFunctionType_type = { PyVarObject_HEAD_INIT(0, 0) __Pyx_NAMESTR("cython_function_or_method"), /*tp_name*/ sizeof(__pyx_CyFunctionObject), /*tp_basicsize*/ 0, /*tp_itemsize*/ (destructor) __Pyx_CyFunction_dealloc, /*tp_dealloc*/ 0, /*tp_print*/ 0, /*tp_getattr*/ 0, /*tp_setattr*/ #if PY_MAJOR_VERSION < 3 0, /*tp_compare*/ #else 0, /*reserved*/ #endif (reprfunc) __Pyx_CyFunction_repr, /*tp_repr*/ 0, /*tp_as_number*/ 0, /*tp_as_sequence*/ 0, /*tp_as_mapping*/ 0, /*tp_hash*/ __Pyx_CyFunction_Call, /*tp_call*/ 0, /*tp_str*/ 0, /*tp_getattro*/ 0, /*tp_setattro*/ 0, /*tp_as_buffer*/ Py_TPFLAGS_DEFAULT | Py_TPFLAGS_HAVE_GC, /* tp_flags*/ 0, /*tp_doc*/ (traverseproc) __Pyx_CyFunction_traverse, /*tp_traverse*/ (inquiry) __Pyx_CyFunction_clear, /*tp_clear*/ 0, /*tp_richcompare*/ offsetof(__pyx_CyFunctionObject, func_weakreflist), /* tp_weaklistoffse */ 0, /*tp_iter*/ 0, /*tp_iternext*/ __pyx_CyFunction_methods, /*tp_methods*/ __pyx_CyFunction_members, /*tp_members*/ __pyx_CyFunction_getsets, /*tp_getset*/ 0, /*tp_base*/ 0, /*tp_dict*/ __Pyx_CyFunction_descr_get, /*tp_descr_get*/ 0, /*tp_descr_set*/ offsetof(__pyx_CyFunctionObject, func_dict),/*tp_dictoffset*/ 0, /*tp_init*/ 0, /*tp_alloc*/ 0, /*tp_new*/ 0, /*tp_free*/ 0, /*tp_is_gc*/ 0, /*tp_bases*/ 0, /*tp_mro*/ 0, /*tp_cache*/ 0, /*tp_subclasses*/ 0, /*tp_weaklist*/ 0, /*tp_del*/ #if PY_VERSION_HEX >= 0x02060000 0, /*tp_version_tag*/ #endif #if PY_VERSION_HEX >= 0x030400a1 0, /*tp_finalize*/ #endif }; static int __Pyx_CyFunction_init(void) { #if !CYTHON_COMPILING_IN_PYPY __pyx_CyFunctionType_type.tp_call = PyCFunction_Call; #endif __pyx_CyFunctionType = __Pyx_FetchCommonType(&__pyx_CyFunctionType_type); if (__pyx_CyFunctionType == NULL) { return -1; } return 0; } static CYTHON_INLINE void *__Pyx_CyFunction_InitDefaults(PyObject *func, size_t size, int pyobjects) { __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func; m->defaults = PyMem_Malloc(size); if (!m->defaults) return PyErr_NoMemory(); memset(m->defaults, 0, size); m->defaults_pyobjects = pyobjects; return m->defaults; } static CYTHON_INLINE void __Pyx_CyFunction_SetDefaultsTuple(PyObject *func, PyObject *tuple) { __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func; m->defaults_tuple = tuple; Py_INCREF(tuple); } static CYTHON_INLINE void __Pyx_CyFunction_SetDefaultsKwDict(PyObject *func, PyObject *dict) { __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func; m->defaults_kwdict = dict; Py_INCREF(dict); } static CYTHON_INLINE void __Pyx_CyFunction_SetAnnotationsDict(PyObject *func, PyObject *dict) { __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func; m->func_annotations = dict; Py_INCREF(dict); } static PyObject *__Pyx_Py3MetaclassPrepare(PyObject *metaclass, PyObject *bases, PyObject *name, PyObject *qualname, PyObject *mkw, PyObject *modname, PyObject *doc) { PyObject *ns; if (metaclass) { PyObject *prep = __Pyx_PyObject_GetAttrStr(metaclass, __pyx_n_s_prepare); if (prep) { PyObject *pargs = PyTuple_Pack(2, name, bases); if (unlikely(!pargs)) { Py_DECREF(prep); return NULL; } ns = PyObject_Call(prep, pargs, mkw); Py_DECREF(prep); Py_DECREF(pargs); } else { if (unlikely(!PyErr_ExceptionMatches(PyExc_AttributeError))) return NULL; PyErr_Clear(); ns = PyDict_New(); } } else { ns = PyDict_New(); } if (unlikely(!ns)) return NULL; if (unlikely(PyObject_SetItem(ns, __pyx_n_s_module, modname) < 0)) goto bad; if (unlikely(PyObject_SetItem(ns, __pyx_n_s_qualname, qualname) < 0)) goto bad; if (unlikely(doc && PyObject_SetItem(ns, __pyx_n_s_doc, doc) < 0)) goto bad; return ns; bad: Py_DECREF(ns); return NULL; } static PyObject *__Pyx_Py3ClassCreate(PyObject *metaclass, PyObject *name, PyObject *bases, PyObject *dict, PyObject *mkw, int calculate_metaclass, int allow_py2_metaclass) { PyObject *result, *margs; PyObject *owned_metaclass = NULL; if (allow_py2_metaclass) { owned_metaclass = PyObject_GetItem(dict, __pyx_n_s_metaclass); if (owned_metaclass) { metaclass = owned_metaclass; } else if (likely(PyErr_ExceptionMatches(PyExc_KeyError))) { PyErr_Clear(); } else { return NULL; } } if (calculate_metaclass && (!metaclass || PyType_Check(metaclass))) { metaclass = __Pyx_CalculateMetaclass((PyTypeObject*) metaclass, bases); Py_XDECREF(owned_metaclass); if (unlikely(!metaclass)) return NULL; owned_metaclass = metaclass; } margs = PyTuple_Pack(3, name, bases, dict); if (unlikely(!margs)) { result = NULL; } else { result = PyObject_Call(metaclass, margs, mkw); Py_DECREF(margs); } Py_XDECREF(owned_metaclass); return result; } static CYTHON_INLINE PyObject* __Pyx_PyInt_From_long(long value) { const long neg_one = (long) -1, const_zero = 0; const int is_unsigned = neg_one > const_zero; if (is_unsigned) { if (sizeof(long) < sizeof(long)) { return PyInt_FromLong((long) value); } else if (sizeof(long) <= sizeof(unsigned long)) { return PyLong_FromUnsignedLong((unsigned long) value); } else if (sizeof(long) <= sizeof(unsigned long long)) { return PyLong_FromUnsignedLongLong((unsigned long long) value); } } else { if (sizeof(long) <= sizeof(long)) { return PyInt_FromLong((long) value); } else if (sizeof(long) <= sizeof(long long)) { return PyLong_FromLongLong((long long) value); } } { int one = 1; int little = (int)*(unsigned char *)&one; unsigned char *bytes = (unsigned char *)&value; return _PyLong_FromByteArray(bytes, sizeof(long), little, !is_unsigned); } } #define __PYX_VERIFY_RETURN_INT(target_type, func_type, func) \ { \ func_type value = func(x); \ if (sizeof(target_type) < sizeof(func_type)) { \ if (unlikely(value != (func_type) (target_type) value)) { \ func_type zero = 0; \ PyErr_SetString(PyExc_OverflowError, \ (is_unsigned && unlikely(value < zero)) ? \ "can't convert negative value to " #target_type : \ "value too large to convert to " #target_type); \ return (target_type) -1; \ } \ } \ return (target_type) value; \ } #if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3 #if CYTHON_USE_PYLONG_INTERNALS #include "longintrepr.h" #endif #endif static CYTHON_INLINE long __Pyx_PyInt_As_long(PyObject *x) { const long neg_one = (long) -1, const_zero = 0; const int is_unsigned = neg_one > const_zero; #if PY_MAJOR_VERSION < 3 if (likely(PyInt_Check(x))) { if (sizeof(long) < sizeof(long)) { __PYX_VERIFY_RETURN_INT(long, long, PyInt_AS_LONG) } else { long val = PyInt_AS_LONG(x); if (is_unsigned && unlikely(val < 0)) { PyErr_SetString(PyExc_OverflowError, "can't convert negative value to long"); return (long) -1; } return (long) val; } } else #endif if (likely(PyLong_Check(x))) { if (is_unsigned) { #if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3 #if CYTHON_USE_PYLONG_INTERNALS if (sizeof(digit) <= sizeof(long)) { switch (Py_SIZE(x)) { case 0: return 0; case 1: return (long) ((PyLongObject*)x)->ob_digit[0]; } } #endif #endif if (unlikely(Py_SIZE(x) < 0)) { PyErr_SetString(PyExc_OverflowError, "can't convert negative value to long"); return (long) -1; } if (sizeof(long) <= sizeof(unsigned long)) { __PYX_VERIFY_RETURN_INT(long, unsigned long, PyLong_AsUnsignedLong) } else if (sizeof(long) <= sizeof(unsigned long long)) { __PYX_VERIFY_RETURN_INT(long, unsigned long long, PyLong_AsUnsignedLongLong) } } else { #if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3 #if CYTHON_USE_PYLONG_INTERNALS if (sizeof(digit) <= sizeof(long)) { switch (Py_SIZE(x)) { case 0: return 0; case 1: return +(long) ((PyLongObject*)x)->ob_digit[0]; case -1: return -(long) ((PyLongObject*)x)->ob_digit[0]; } } #endif #endif if (sizeof(long) <= sizeof(long)) { __PYX_VERIFY_RETURN_INT(long, long, PyLong_AsLong) } else if (sizeof(long) <= sizeof(long long)) { __PYX_VERIFY_RETURN_INT(long, long long, PyLong_AsLongLong) } } { #if CYTHON_COMPILING_IN_PYPY && !defined(_PyLong_AsByteArray) PyErr_SetString(PyExc_RuntimeError, "_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers"); #else long val; PyObject *v = __Pyx_PyNumber_Int(x); #if PY_MAJOR_VERSION < 3 if (likely(v) && !PyLong_Check(v)) { PyObject *tmp = v; v = PyNumber_Long(tmp); Py_DECREF(tmp); } #endif if (likely(v)) { int one = 1; int is_little = (int)*(unsigned char *)&one; unsigned char *bytes = (unsigned char *)&val; int ret = _PyLong_AsByteArray((PyLongObject *)v, bytes, sizeof(val), is_little, !is_unsigned); Py_DECREF(v); if (likely(!ret)) return val; } #endif return (long) -1; } } else { long val; PyObject *tmp = __Pyx_PyNumber_Int(x); if (!tmp) return (long) -1; val = __Pyx_PyInt_As_long(tmp); Py_DECREF(tmp); return val; } } #if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3 #if CYTHON_USE_PYLONG_INTERNALS #include "longintrepr.h" #endif #endif static CYTHON_INLINE int __Pyx_PyInt_As_int(PyObject *x) { const int neg_one = (int) -1, const_zero = 0; const int is_unsigned = neg_one > const_zero; #if PY_MAJOR_VERSION < 3 if (likely(PyInt_Check(x))) { if (sizeof(int) < sizeof(long)) { __PYX_VERIFY_RETURN_INT(int, long, PyInt_AS_LONG) } else { long val = PyInt_AS_LONG(x); if (is_unsigned && unlikely(val < 0)) { PyErr_SetString(PyExc_OverflowError, "can't convert negative value to int"); return (int) -1; } return (int) val; } } else #endif if (likely(PyLong_Check(x))) { if (is_unsigned) { #if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3 #if CYTHON_USE_PYLONG_INTERNALS if (sizeof(digit) <= sizeof(int)) { switch (Py_SIZE(x)) { case 0: return 0; case 1: return (int) ((PyLongObject*)x)->ob_digit[0]; } } #endif #endif if (unlikely(Py_SIZE(x) < 0)) { PyErr_SetString(PyExc_OverflowError, "can't convert negative value to int"); return (int) -1; } if (sizeof(int) <= sizeof(unsigned long)) { __PYX_VERIFY_RETURN_INT(int, unsigned long, PyLong_AsUnsignedLong) } else if (sizeof(int) <= sizeof(unsigned long long)) { __PYX_VERIFY_RETURN_INT(int, unsigned long long, PyLong_AsUnsignedLongLong) } } else { #if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3 #if CYTHON_USE_PYLONG_INTERNALS if (sizeof(digit) <= sizeof(int)) { switch (Py_SIZE(x)) { case 0: return 0; case 1: return +(int) ((PyLongObject*)x)->ob_digit[0]; case -1: return -(int) ((PyLongObject*)x)->ob_digit[0]; } } #endif #endif if (sizeof(int) <= sizeof(long)) { __PYX_VERIFY_RETURN_INT(int, long, PyLong_AsLong) } else if (sizeof(int) <= sizeof(long long)) { __PYX_VERIFY_RETURN_INT(int, long long, PyLong_AsLongLong) } } { #if CYTHON_COMPILING_IN_PYPY && !defined(_PyLong_AsByteArray) PyErr_SetString(PyExc_RuntimeError, "_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers"); #else int val; PyObject *v = __Pyx_PyNumber_Int(x); #if PY_MAJOR_VERSION < 3 if (likely(v) && !PyLong_Check(v)) { PyObject *tmp = v; v = PyNumber_Long(tmp); Py_DECREF(tmp); } #endif if (likely(v)) { int one = 1; int is_little = (int)*(unsigned char *)&one; unsigned char *bytes = (unsigned char *)&val; int ret = _PyLong_AsByteArray((PyLongObject *)v, bytes, sizeof(val), is_little, !is_unsigned); Py_DECREF(v); if (likely(!ret)) return val; } #endif return (int) -1; } } else { int val; PyObject *tmp = __Pyx_PyNumber_Int(x); if (!tmp) return (int) -1; val = __Pyx_PyInt_As_int(tmp); Py_DECREF(tmp); return val; } } static int __Pyx_check_binary_version(void) { char ctversion[4], rtversion[4]; PyOS_snprintf(ctversion, 4, "%d.%d", PY_MAJOR_VERSION, PY_MINOR_VERSION); PyOS_snprintf(rtversion, 4, "%s", Py_GetVersion()); if (ctversion[0] != rtversion[0] || ctversion[2] != rtversion[2]) { char message[200]; PyOS_snprintf(message, sizeof(message), "compiletime version %s of module '%.100s' " "does not match runtime version %s", ctversion, __Pyx_MODULE_NAME, rtversion); #if PY_VERSION_HEX < 0x02050000 return PyErr_Warn(NULL, message); #else return PyErr_WarnEx(NULL, message, 1); #endif } return 0; } static int __pyx_bisect_code_objects(__Pyx_CodeObjectCacheEntry* entries, int count, int code_line) { int start = 0, mid = 0, end = count - 1; if (end >= 0 && code_line > entries[end].code_line) { return count; } while (start < end) { mid = (start + end) / 2; if (code_line < entries[mid].code_line) { end = mid; } else if (code_line > entries[mid].code_line) { start = mid + 1; } else { return mid; } } if (code_line <= entries[mid].code_line) { return mid; } else { return mid + 1; } } static PyCodeObject *__pyx_find_code_object(int code_line) { PyCodeObject* code_object; int pos; if (unlikely(!code_line) || unlikely(!__pyx_code_cache.entries)) { return NULL; } pos = __pyx_bisect_code_objects(__pyx_code_cache.entries, __pyx_code_cache.count, code_line); if (unlikely(pos >= __pyx_code_cache.count) || unlikely(__pyx_code_cache.entries[pos].code_line != code_line)) { return NULL; } code_object = __pyx_code_cache.entries[pos].code_object; Py_INCREF(code_object); return code_object; } static void __pyx_insert_code_object(int code_line, PyCodeObject* code_object) { int pos, i; __Pyx_CodeObjectCacheEntry* entries = __pyx_code_cache.entries; if (unlikely(!code_line)) { return; } if (unlikely(!entries)) { entries = (__Pyx_CodeObjectCacheEntry*)PyMem_Malloc(64*sizeof(__Pyx_CodeObjectCacheEntry)); if (likely(entries)) { __pyx_code_cache.entries = entries; __pyx_code_cache.max_count = 64; __pyx_code_cache.count = 1; entries[0].code_line = code_line; entries[0].code_object = code_object; Py_INCREF(code_object); } return; } pos = __pyx_bisect_code_objects(__pyx_code_cache.entries, __pyx_code_cache.count, code_line); if ((pos < __pyx_code_cache.count) && unlikely(__pyx_code_cache.entries[pos].code_line == code_line)) { PyCodeObject* tmp = entries[pos].code_object; entries[pos].code_object = code_object; Py_DECREF(tmp); return; } if (__pyx_code_cache.count == __pyx_code_cache.max_count) { int new_max = __pyx_code_cache.max_count + 64; entries = (__Pyx_CodeObjectCacheEntry*)PyMem_Realloc( __pyx_code_cache.entries, (size_t)new_max*sizeof(__Pyx_CodeObjectCacheEntry)); if (unlikely(!entries)) { return; } __pyx_code_cache.entries = entries; __pyx_code_cache.max_count = new_max; } for (i=__pyx_code_cache.count; i>pos; i--) { entries[i] = entries[i-1]; } entries[pos].code_line = code_line; entries[pos].code_object = code_object; __pyx_code_cache.count++; Py_INCREF(code_object); } #include "compile.h" #include "frameobject.h" #include "traceback.h" static PyCodeObject* __Pyx_CreateCodeObjectForTraceback( const char *funcname, int c_line, int py_line, const char *filename) { PyCodeObject *py_code = 0; PyObject *py_srcfile = 0; PyObject *py_funcname = 0; #if PY_MAJOR_VERSION < 3 py_srcfile = PyString_FromString(filename); #else py_srcfile = PyUnicode_FromString(filename); #endif if (!py_srcfile) goto bad; if (c_line) { #if PY_MAJOR_VERSION < 3 py_funcname = PyString_FromFormat( "%s (%s:%d)", funcname, __pyx_cfilenm, c_line); #else py_funcname = PyUnicode_FromFormat( "%s (%s:%d)", funcname, __pyx_cfilenm, c_line); #endif } else { #if PY_MAJOR_VERSION < 3 py_funcname = PyString_FromString(funcname); #else py_funcname = PyUnicode_FromString(funcname); #endif } if (!py_funcname) goto bad; py_code = __Pyx_PyCode_New( 0, /*int argcount,*/ 0, /*int kwonlyargcount,*/ 0, /*int nlocals,*/ 0, /*int stacksize,*/ 0, /*int flags,*/ __pyx_empty_bytes, /*PyObject *code,*/ __pyx_empty_tuple, /*PyObject *consts,*/ __pyx_empty_tuple, /*PyObject *names,*/ __pyx_empty_tuple, /*PyObject *varnames,*/ __pyx_empty_tuple, /*PyObject *freevars,*/ __pyx_empty_tuple, /*PyObject *cellvars,*/ py_srcfile, /*PyObject *filename,*/ py_funcname, /*PyObject *name,*/ py_line, /*int firstlineno,*/ __pyx_empty_bytes /*PyObject *lnotab*/ ); Py_DECREF(py_srcfile); Py_DECREF(py_funcname); return py_code; bad: Py_XDECREF(py_srcfile); Py_XDECREF(py_funcname); return NULL; } static void __Pyx_AddTraceback(const char *funcname, int c_line, int py_line, const char *filename) { PyCodeObject *py_code = 0; PyObject *py_globals = 0; PyFrameObject *py_frame = 0; py_code = __pyx_find_code_object(c_line ? c_line : py_line); if (!py_code) { py_code = __Pyx_CreateCodeObjectForTraceback( funcname, c_line, py_line, filename); if (!py_code) goto bad; __pyx_insert_code_object(c_line ? c_line : py_line, py_code); } py_globals = PyModule_GetDict(__pyx_m); if (!py_globals) goto bad; py_frame = PyFrame_New( PyThreadState_GET(), /*PyThreadState *tstate,*/ py_code, /*PyCodeObject *code,*/ py_globals, /*PyObject *globals,*/ 0 /*PyObject *locals*/ ); if (!py_frame) goto bad; py_frame->f_lineno = py_line; PyTraceBack_Here(py_frame); bad: Py_XDECREF(py_code); Py_XDECREF(py_frame); } static int __Pyx_InitStrings(__Pyx_StringTabEntry *t) { while (t->p) { #if PY_MAJOR_VERSION < 3 if (t->is_unicode) { *t->p = PyUnicode_DecodeUTF8(t->s, t->n - 1, NULL); } else if (t->intern) { *t->p = PyString_InternFromString(t->s); } else { *t->p = PyString_FromStringAndSize(t->s, t->n - 1); } #else /* Python 3+ has unicode identifiers */ if (t->is_unicode | t->is_str) { if (t->intern) { *t->p = PyUnicode_InternFromString(t->s); } else if (t->encoding) { *t->p = PyUnicode_Decode(t->s, t->n - 1, t->encoding, NULL); } else { *t->p = PyUnicode_FromStringAndSize(t->s, t->n - 1); } } else { *t->p = PyBytes_FromStringAndSize(t->s, t->n - 1); } #endif if (!*t->p) return -1; ++t; } return 0; } static CYTHON_INLINE PyObject* __Pyx_PyUnicode_FromString(const char* c_str) { return __Pyx_PyUnicode_FromStringAndSize(c_str, (Py_ssize_t)strlen(c_str)); } static CYTHON_INLINE char* __Pyx_PyObject_AsString(PyObject* o) { Py_ssize_t ignore; return __Pyx_PyObject_AsStringAndSize(o, &ignore); } static CYTHON_INLINE char* __Pyx_PyObject_AsStringAndSize(PyObject* o, Py_ssize_t *length) { #if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT if ( #if PY_MAJOR_VERSION < 3 && __PYX_DEFAULT_STRING_ENCODING_IS_ASCII __Pyx_sys_getdefaultencoding_not_ascii && #endif PyUnicode_Check(o)) { #if PY_VERSION_HEX < 0x03030000 char* defenc_c; PyObject* defenc = _PyUnicode_AsDefaultEncodedString(o, NULL); if (!defenc) return NULL; defenc_c = PyBytes_AS_STRING(defenc); #if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII { char* end = defenc_c + PyBytes_GET_SIZE(defenc); char* c; for (c = defenc_c; c < end; c++) { if ((unsigned char) (*c) >= 128) { PyUnicode_AsASCIIString(o); return NULL; } } } #endif /*__PYX_DEFAULT_STRING_ENCODING_IS_ASCII*/ *length = PyBytes_GET_SIZE(defenc); return defenc_c; #else /* PY_VERSION_HEX < 0x03030000 */ if (PyUnicode_READY(o) == -1) return NULL; #if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII if (PyUnicode_IS_ASCII(o)) { *length = PyUnicode_GET_LENGTH(o); return PyUnicode_AsUTF8(o); } else { PyUnicode_AsASCIIString(o); return NULL; } #else /* __PYX_DEFAULT_STRING_ENCODING_IS_ASCII */ return PyUnicode_AsUTF8AndSize(o, length); #endif /* __PYX_DEFAULT_STRING_ENCODING_IS_ASCII */ #endif /* PY_VERSION_HEX < 0x03030000 */ } else #endif /* __PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT */ #if !CYTHON_COMPILING_IN_PYPY #if PY_VERSION_HEX >= 0x02060000 if (PyByteArray_Check(o)) { *length = PyByteArray_GET_SIZE(o); return PyByteArray_AS_STRING(o); } else #endif #endif { char* result; int r = PyBytes_AsStringAndSize(o, &result, length); if (unlikely(r < 0)) { return NULL; } else { return result; } } } static CYTHON_INLINE int __Pyx_PyObject_IsTrue(PyObject* x) { int is_true = x == Py_True; if (is_true | (x == Py_False) | (x == Py_None)) return is_true; else return PyObject_IsTrue(x); } static CYTHON_INLINE PyObject* __Pyx_PyNumber_Int(PyObject* x) { PyNumberMethods *m; const char *name = NULL; PyObject *res = NULL; #if PY_MAJOR_VERSION < 3 if (PyInt_Check(x) || PyLong_Check(x)) #else if (PyLong_Check(x)) #endif return Py_INCREF(x), x; m = Py_TYPE(x)->tp_as_number; #if PY_MAJOR_VERSION < 3 if (m && m->nb_int) { name = "int"; res = PyNumber_Int(x); } else if (m && m->nb_long) { name = "long"; res = PyNumber_Long(x); } #else if (m && m->nb_int) { name = "int"; res = PyNumber_Long(x); } #endif if (res) { #if PY_MAJOR_VERSION < 3 if (!PyInt_Check(res) && !PyLong_Check(res)) { #else if (!PyLong_Check(res)) { #endif PyErr_Format(PyExc_TypeError, "__%.4s__ returned non-%.4s (type %.200s)", name, name, Py_TYPE(res)->tp_name); Py_DECREF(res); return NULL; } } else if (!PyErr_Occurred()) { PyErr_SetString(PyExc_TypeError, "an integer is required"); } return res; } #if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3 #if CYTHON_USE_PYLONG_INTERNALS #include "longintrepr.h" #endif #endif static CYTHON_INLINE Py_ssize_t __Pyx_PyIndex_AsSsize_t(PyObject* b) { Py_ssize_t ival; PyObject *x; #if PY_MAJOR_VERSION < 3 if (likely(PyInt_CheckExact(b))) return PyInt_AS_LONG(b); #endif if (likely(PyLong_CheckExact(b))) { #if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3 #if CYTHON_USE_PYLONG_INTERNALS switch (Py_SIZE(b)) { case -1: return -(sdigit)((PyLongObject*)b)->ob_digit[0]; case 0: return 0; case 1: return ((PyLongObject*)b)->ob_digit[0]; } #endif #endif #if PY_VERSION_HEX < 0x02060000 return PyInt_AsSsize_t(b); #else return PyLong_AsSsize_t(b); #endif } x = PyNumber_Index(b); if (!x) return -1; ival = PyInt_AsSsize_t(x); Py_DECREF(x); return ival; } static CYTHON_INLINE PyObject * __Pyx_PyInt_FromSize_t(size_t ival) { #if PY_VERSION_HEX < 0x02050000 if (ival <= LONG_MAX) return PyInt_FromLong((long)ival); else { unsigned char *bytes = (unsigned char *) &ival; int one = 1; int little = (int)*(unsigned char*)&one; return _PyLong_FromByteArray(bytes, sizeof(size_t), little, 0); } #else return PyInt_FromSize_t(ival); #endif } #endif /* Py_PYTHON_H */ pygame_sdl2-2.1.0-for-renpy-6.99.14.1/gen3/pygame_sdl2.render.c0000664000175000017500000163777012665223547022773 0ustar tomtom00000000000000/* Generated by Cython 0.23.3 */ #define PY_SSIZE_T_CLEAN #include "Python.h" #ifndef Py_PYTHON_H #error Python headers needed to compile C extensions, please install development version of Python. #elif PY_VERSION_HEX < 0x02060000 || (0x03000000 <= PY_VERSION_HEX && PY_VERSION_HEX < 0x03020000) #error Cython requires Python 2.6+ or Python 3.2+. #else #define CYTHON_ABI "0_23_3" #include #ifndef offsetof #define offsetof(type, member) ( (size_t) & ((type*)0) -> member ) #endif #if !defined(WIN32) && !defined(MS_WINDOWS) #ifndef __stdcall #define __stdcall #endif #ifndef __cdecl #define __cdecl #endif #ifndef __fastcall #define __fastcall #endif #endif #ifndef DL_IMPORT #define DL_IMPORT(t) t #endif #ifndef DL_EXPORT #define DL_EXPORT(t) t #endif #ifndef PY_LONG_LONG #define PY_LONG_LONG LONG_LONG #endif #ifndef Py_HUGE_VAL #define Py_HUGE_VAL HUGE_VAL #endif #ifdef PYPY_VERSION #define CYTHON_COMPILING_IN_PYPY 1 #define CYTHON_COMPILING_IN_CPYTHON 0 #else #define CYTHON_COMPILING_IN_PYPY 0 #define CYTHON_COMPILING_IN_CPYTHON 1 #endif #if !defined(CYTHON_USE_PYLONG_INTERNALS) && CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x02070000 #define CYTHON_USE_PYLONG_INTERNALS 1 #endif #if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX < 0x02070600 && !defined(Py_OptimizeFlag) #define Py_OptimizeFlag 0 #endif #define __PYX_BUILD_PY_SSIZE_T "n" #define CYTHON_FORMAT_SSIZE_T "z" #if PY_MAJOR_VERSION < 3 #define __Pyx_BUILTIN_MODULE_NAME "__builtin__" #define __Pyx_PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)\ PyCode_New(a+k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos) #define __Pyx_DefaultClassType PyClass_Type #else #define __Pyx_BUILTIN_MODULE_NAME "builtins" #define __Pyx_PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)\ PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos) #define __Pyx_DefaultClassType PyType_Type #endif #ifndef Py_TPFLAGS_CHECKTYPES #define Py_TPFLAGS_CHECKTYPES 0 #endif #ifndef Py_TPFLAGS_HAVE_INDEX #define Py_TPFLAGS_HAVE_INDEX 0 #endif #ifndef Py_TPFLAGS_HAVE_NEWBUFFER #define Py_TPFLAGS_HAVE_NEWBUFFER 0 #endif #ifndef Py_TPFLAGS_HAVE_FINALIZE #define Py_TPFLAGS_HAVE_FINALIZE 0 #endif #if PY_VERSION_HEX > 0x03030000 && defined(PyUnicode_KIND) #define CYTHON_PEP393_ENABLED 1 #define __Pyx_PyUnicode_READY(op) (likely(PyUnicode_IS_READY(op)) ?\ 0 : _PyUnicode_Ready((PyObject *)(op))) #define __Pyx_PyUnicode_GET_LENGTH(u) PyUnicode_GET_LENGTH(u) #define __Pyx_PyUnicode_READ_CHAR(u, i) PyUnicode_READ_CHAR(u, i) #define __Pyx_PyUnicode_KIND(u) PyUnicode_KIND(u) #define __Pyx_PyUnicode_DATA(u) PyUnicode_DATA(u) #define __Pyx_PyUnicode_READ(k, d, i) PyUnicode_READ(k, d, i) #else #define CYTHON_PEP393_ENABLED 0 #define __Pyx_PyUnicode_READY(op) (0) #define __Pyx_PyUnicode_GET_LENGTH(u) PyUnicode_GET_SIZE(u) #define __Pyx_PyUnicode_READ_CHAR(u, i) ((Py_UCS4)(PyUnicode_AS_UNICODE(u)[i])) #define __Pyx_PyUnicode_KIND(u) (sizeof(Py_UNICODE)) #define __Pyx_PyUnicode_DATA(u) ((void*)PyUnicode_AS_UNICODE(u)) #define __Pyx_PyUnicode_READ(k, d, i) ((void)(k), (Py_UCS4)(((Py_UNICODE*)d)[i])) #endif #if CYTHON_COMPILING_IN_PYPY #define __Pyx_PyUnicode_Concat(a, b) PyNumber_Add(a, b) #define __Pyx_PyUnicode_ConcatSafe(a, b) PyNumber_Add(a, b) #else #define __Pyx_PyUnicode_Concat(a, b) PyUnicode_Concat(a, b) #define __Pyx_PyUnicode_ConcatSafe(a, b) ((unlikely((a) == Py_None) || unlikely((b) == Py_None)) ?\ PyNumber_Add(a, b) : __Pyx_PyUnicode_Concat(a, b)) #endif #if CYTHON_COMPILING_IN_PYPY && !defined(PyUnicode_Contains) #define PyUnicode_Contains(u, s) PySequence_Contains(u, s) #endif #define __Pyx_PyString_FormatSafe(a, b) ((unlikely((a) == Py_None)) ? PyNumber_Remainder(a, b) : __Pyx_PyString_Format(a, b)) #define __Pyx_PyUnicode_FormatSafe(a, b) ((unlikely((a) == Py_None)) ? PyNumber_Remainder(a, b) : PyUnicode_Format(a, b)) #if PY_MAJOR_VERSION >= 3 #define __Pyx_PyString_Format(a, b) PyUnicode_Format(a, b) #else #define __Pyx_PyString_Format(a, b) PyString_Format(a, b) #endif #if PY_MAJOR_VERSION >= 3 #define PyBaseString_Type PyUnicode_Type #define PyStringObject PyUnicodeObject #define PyString_Type PyUnicode_Type #define PyString_Check PyUnicode_Check #define PyString_CheckExact PyUnicode_CheckExact #endif #if PY_MAJOR_VERSION >= 3 #define __Pyx_PyBaseString_Check(obj) PyUnicode_Check(obj) #define __Pyx_PyBaseString_CheckExact(obj) PyUnicode_CheckExact(obj) #else #define __Pyx_PyBaseString_Check(obj) (PyString_Check(obj) || PyUnicode_Check(obj)) #define __Pyx_PyBaseString_CheckExact(obj) (PyString_CheckExact(obj) || PyUnicode_CheckExact(obj)) #endif #ifndef PySet_CheckExact #define PySet_CheckExact(obj) (Py_TYPE(obj) == &PySet_Type) #endif #define __Pyx_TypeCheck(obj, type) PyObject_TypeCheck(obj, (PyTypeObject *)type) #if PY_MAJOR_VERSION >= 3 #define PyIntObject PyLongObject #define PyInt_Type PyLong_Type #define PyInt_Check(op) PyLong_Check(op) #define PyInt_CheckExact(op) PyLong_CheckExact(op) #define PyInt_FromString PyLong_FromString #define PyInt_FromUnicode PyLong_FromUnicode #define PyInt_FromLong PyLong_FromLong #define PyInt_FromSize_t PyLong_FromSize_t #define PyInt_FromSsize_t PyLong_FromSsize_t #define PyInt_AsLong PyLong_AsLong #define PyInt_AS_LONG PyLong_AS_LONG #define PyInt_AsSsize_t PyLong_AsSsize_t #define PyInt_AsUnsignedLongMask PyLong_AsUnsignedLongMask #define PyInt_AsUnsignedLongLongMask PyLong_AsUnsignedLongLongMask #define PyNumber_Int PyNumber_Long #endif #if PY_MAJOR_VERSION >= 3 #define PyBoolObject PyLongObject #endif #if PY_MAJOR_VERSION >= 3 && CYTHON_COMPILING_IN_PYPY #ifndef PyUnicode_InternFromString #define PyUnicode_InternFromString(s) PyUnicode_FromString(s) #endif #endif #if PY_VERSION_HEX < 0x030200A4 typedef long Py_hash_t; #define __Pyx_PyInt_FromHash_t PyInt_FromLong #define __Pyx_PyInt_AsHash_t PyInt_AsLong #else #define __Pyx_PyInt_FromHash_t PyInt_FromSsize_t #define __Pyx_PyInt_AsHash_t PyInt_AsSsize_t #endif #if PY_MAJOR_VERSION >= 3 #define __Pyx_PyMethod_New(func, self, klass) ((self) ? PyMethod_New(func, self) : PyInstanceMethod_New(func)) #else #define __Pyx_PyMethod_New(func, self, klass) PyMethod_New(func, self, klass) #endif #if PY_VERSION_HEX >= 0x030500B1 #define __Pyx_PyAsyncMethodsStruct PyAsyncMethods #define __Pyx_PyType_AsAsync(obj) (Py_TYPE(obj)->tp_as_async) #elif CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3 typedef struct { unaryfunc am_await; unaryfunc am_aiter; unaryfunc am_anext; } __Pyx_PyAsyncMethodsStruct; #define __Pyx_PyType_AsAsync(obj) ((__Pyx_PyAsyncMethodsStruct*) (Py_TYPE(obj)->tp_reserved)) #else #define __Pyx_PyType_AsAsync(obj) NULL #endif #ifndef CYTHON_RESTRICT #if defined(__GNUC__) #define CYTHON_RESTRICT __restrict__ #elif defined(_MSC_VER) && _MSC_VER >= 1400 #define CYTHON_RESTRICT __restrict #elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L #define CYTHON_RESTRICT restrict #else #define CYTHON_RESTRICT #endif #endif #define __Pyx_void_to_None(void_result) (void_result, Py_INCREF(Py_None), Py_None) #ifndef CYTHON_INLINE #if defined(__GNUC__) #define CYTHON_INLINE __inline__ #elif defined(_MSC_VER) #define CYTHON_INLINE __inline #elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L #define CYTHON_INLINE inline #else #define CYTHON_INLINE #endif #endif #if defined(WIN32) || defined(MS_WINDOWS) #define _USE_MATH_DEFINES #endif #include #ifdef NAN #define __PYX_NAN() ((float) NAN) #else static CYTHON_INLINE float __PYX_NAN() { float value; memset(&value, 0xFF, sizeof(value)); return value; } #endif #if PY_MAJOR_VERSION >= 3 #define __Pyx_PyNumber_Divide(x,y) PyNumber_TrueDivide(x,y) #define __Pyx_PyNumber_InPlaceDivide(x,y) PyNumber_InPlaceTrueDivide(x,y) #else #define __Pyx_PyNumber_Divide(x,y) PyNumber_TrueDivide(x,y) #define __Pyx_PyNumber_InPlaceDivide(x,y) PyNumber_InPlaceTrueDivide(x,y) #endif #ifndef __PYX_EXTERN_C #ifdef __cplusplus #define __PYX_EXTERN_C extern "C" #else #define __PYX_EXTERN_C extern #endif #endif #define __PYX_HAVE__pygame_sdl2__render #define __PYX_HAVE_API__pygame_sdl2__render #include "stdint.h" #include "string.h" #include "stdio.h" #include "stddef.h" #include "SDL.h" #include "SDL_image.h" #ifdef _OPENMP #include #endif /* _OPENMP */ #ifdef PYREX_WITHOUT_ASSERTIONS #define CYTHON_WITHOUT_ASSERTIONS #endif #ifndef CYTHON_UNUSED # if defined(__GNUC__) # if !(defined(__cplusplus)) || (__GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 4)) # define CYTHON_UNUSED __attribute__ ((__unused__)) # else # define CYTHON_UNUSED # endif # elif defined(__ICC) || (defined(__INTEL_COMPILER) && !defined(_MSC_VER)) # define CYTHON_UNUSED __attribute__ ((__unused__)) # else # define CYTHON_UNUSED # endif #endif #ifndef CYTHON_NCP_UNUSED # if CYTHON_COMPILING_IN_CPYTHON # define CYTHON_NCP_UNUSED # else # define CYTHON_NCP_UNUSED CYTHON_UNUSED # endif #endif typedef struct {PyObject **p; char *s; const Py_ssize_t n; const char* encoding; const char is_unicode; const char is_str; const char intern; } __Pyx_StringTabEntry; #define __PYX_DEFAULT_STRING_ENCODING_IS_ASCII 0 #define __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT 0 #define __PYX_DEFAULT_STRING_ENCODING "" #define __Pyx_PyObject_FromString __Pyx_PyBytes_FromString #define __Pyx_PyObject_FromStringAndSize __Pyx_PyBytes_FromStringAndSize #define __Pyx_uchar_cast(c) ((unsigned char)c) #define __Pyx_long_cast(x) ((long)x) #define __Pyx_fits_Py_ssize_t(v, type, is_signed) (\ (sizeof(type) < sizeof(Py_ssize_t)) ||\ (sizeof(type) > sizeof(Py_ssize_t) &&\ likely(v < (type)PY_SSIZE_T_MAX ||\ v == (type)PY_SSIZE_T_MAX) &&\ (!is_signed || likely(v > (type)PY_SSIZE_T_MIN ||\ v == (type)PY_SSIZE_T_MIN))) ||\ (sizeof(type) == sizeof(Py_ssize_t) &&\ (is_signed || likely(v < (type)PY_SSIZE_T_MAX ||\ v == (type)PY_SSIZE_T_MAX))) ) #if defined (__cplusplus) && __cplusplus >= 201103L #include #define __Pyx_sst_abs(value) std::abs(value) #elif SIZEOF_INT >= SIZEOF_SIZE_T #define __Pyx_sst_abs(value) abs(value) #elif SIZEOF_LONG >= SIZEOF_SIZE_T #define __Pyx_sst_abs(value) labs(value) #elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L #define __Pyx_sst_abs(value) llabs(value) #elif defined (_MSC_VER) && defined (_M_X64) #define __Pyx_sst_abs(value) _abs64(value) #elif defined (__GNUC__) #define __Pyx_sst_abs(value) __builtin_llabs(value) #else #define __Pyx_sst_abs(value) ((value<0) ? -value : value) #endif static CYTHON_INLINE char* __Pyx_PyObject_AsString(PyObject*); static CYTHON_INLINE char* __Pyx_PyObject_AsStringAndSize(PyObject*, Py_ssize_t* length); #define __Pyx_PyByteArray_FromString(s) PyByteArray_FromStringAndSize((const char*)s, strlen((const char*)s)) #define __Pyx_PyByteArray_FromStringAndSize(s, l) PyByteArray_FromStringAndSize((const char*)s, l) #define __Pyx_PyBytes_FromString PyBytes_FromString #define __Pyx_PyBytes_FromStringAndSize PyBytes_FromStringAndSize static CYTHON_INLINE PyObject* __Pyx_PyUnicode_FromString(const char*); #if PY_MAJOR_VERSION < 3 #define __Pyx_PyStr_FromString __Pyx_PyBytes_FromString #define __Pyx_PyStr_FromStringAndSize __Pyx_PyBytes_FromStringAndSize #else #define __Pyx_PyStr_FromString __Pyx_PyUnicode_FromString #define __Pyx_PyStr_FromStringAndSize __Pyx_PyUnicode_FromStringAndSize #endif #define __Pyx_PyObject_AsSString(s) ((signed char*) __Pyx_PyObject_AsString(s)) #define __Pyx_PyObject_AsUString(s) ((unsigned char*) __Pyx_PyObject_AsString(s)) #define __Pyx_PyObject_FromCString(s) __Pyx_PyObject_FromString((const char*)s) #define __Pyx_PyBytes_FromCString(s) __Pyx_PyBytes_FromString((const char*)s) #define __Pyx_PyByteArray_FromCString(s) __Pyx_PyByteArray_FromString((const char*)s) #define __Pyx_PyStr_FromCString(s) __Pyx_PyStr_FromString((const char*)s) #define __Pyx_PyUnicode_FromCString(s) __Pyx_PyUnicode_FromString((const char*)s) #if PY_MAJOR_VERSION < 3 static CYTHON_INLINE size_t __Pyx_Py_UNICODE_strlen(const Py_UNICODE *u) { const Py_UNICODE *u_end = u; while (*u_end++) ; return (size_t)(u_end - u - 1); } #else #define __Pyx_Py_UNICODE_strlen Py_UNICODE_strlen #endif #define __Pyx_PyUnicode_FromUnicode(u) PyUnicode_FromUnicode(u, __Pyx_Py_UNICODE_strlen(u)) #define __Pyx_PyUnicode_FromUnicodeAndLength PyUnicode_FromUnicode #define __Pyx_PyUnicode_AsUnicode PyUnicode_AsUnicode #define __Pyx_NewRef(obj) (Py_INCREF(obj), obj) #define __Pyx_Owned_Py_None(b) __Pyx_NewRef(Py_None) #define __Pyx_PyBool_FromLong(b) ((b) ? __Pyx_NewRef(Py_True) : __Pyx_NewRef(Py_False)) static CYTHON_INLINE int __Pyx_PyObject_IsTrue(PyObject*); static CYTHON_INLINE PyObject* __Pyx_PyNumber_Int(PyObject* x); static CYTHON_INLINE Py_ssize_t __Pyx_PyIndex_AsSsize_t(PyObject*); static CYTHON_INLINE PyObject * __Pyx_PyInt_FromSize_t(size_t); #if CYTHON_COMPILING_IN_CPYTHON #define __pyx_PyFloat_AsDouble(x) (PyFloat_CheckExact(x) ? PyFloat_AS_DOUBLE(x) : PyFloat_AsDouble(x)) #else #define __pyx_PyFloat_AsDouble(x) PyFloat_AsDouble(x) #endif #define __pyx_PyFloat_AsFloat(x) ((float) __pyx_PyFloat_AsDouble(x)) #if PY_MAJOR_VERSION < 3 && __PYX_DEFAULT_STRING_ENCODING_IS_ASCII static int __Pyx_sys_getdefaultencoding_not_ascii; static int __Pyx_init_sys_getdefaultencoding_params(void) { PyObject* sys; PyObject* default_encoding = NULL; PyObject* ascii_chars_u = NULL; PyObject* ascii_chars_b = NULL; const char* default_encoding_c; sys = PyImport_ImportModule("sys"); if (!sys) goto bad; default_encoding = PyObject_CallMethod(sys, (char*) "getdefaultencoding", NULL); Py_DECREF(sys); if (!default_encoding) goto bad; default_encoding_c = PyBytes_AsString(default_encoding); if (!default_encoding_c) goto bad; if (strcmp(default_encoding_c, "ascii") == 0) { __Pyx_sys_getdefaultencoding_not_ascii = 0; } else { char ascii_chars[128]; int c; for (c = 0; c < 128; c++) { ascii_chars[c] = c; } __Pyx_sys_getdefaultencoding_not_ascii = 1; ascii_chars_u = PyUnicode_DecodeASCII(ascii_chars, 128, NULL); if (!ascii_chars_u) goto bad; ascii_chars_b = PyUnicode_AsEncodedString(ascii_chars_u, default_encoding_c, NULL); if (!ascii_chars_b || !PyBytes_Check(ascii_chars_b) || memcmp(ascii_chars, PyBytes_AS_STRING(ascii_chars_b), 128) != 0) { PyErr_Format( PyExc_ValueError, "This module compiled with c_string_encoding=ascii, but default encoding '%.200s' is not a superset of ascii.", default_encoding_c); goto bad; } Py_DECREF(ascii_chars_u); Py_DECREF(ascii_chars_b); } Py_DECREF(default_encoding); return 0; bad: Py_XDECREF(default_encoding); Py_XDECREF(ascii_chars_u); Py_XDECREF(ascii_chars_b); return -1; } #endif #if __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT && PY_MAJOR_VERSION >= 3 #define __Pyx_PyUnicode_FromStringAndSize(c_str, size) PyUnicode_DecodeUTF8(c_str, size, NULL) #else #define __Pyx_PyUnicode_FromStringAndSize(c_str, size) PyUnicode_Decode(c_str, size, __PYX_DEFAULT_STRING_ENCODING, NULL) #if __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT static char* __PYX_DEFAULT_STRING_ENCODING; static int __Pyx_init_sys_getdefaultencoding_params(void) { PyObject* sys; PyObject* default_encoding = NULL; char* default_encoding_c; sys = PyImport_ImportModule("sys"); if (!sys) goto bad; default_encoding = PyObject_CallMethod(sys, (char*) (const char*) "getdefaultencoding", NULL); Py_DECREF(sys); if (!default_encoding) goto bad; default_encoding_c = PyBytes_AsString(default_encoding); if (!default_encoding_c) goto bad; __PYX_DEFAULT_STRING_ENCODING = (char*) malloc(strlen(default_encoding_c)); if (!__PYX_DEFAULT_STRING_ENCODING) goto bad; strcpy(__PYX_DEFAULT_STRING_ENCODING, default_encoding_c); Py_DECREF(default_encoding); return 0; bad: Py_XDECREF(default_encoding); return -1; } #endif #endif /* Test for GCC > 2.95 */ #if defined(__GNUC__) && (__GNUC__ > 2 || (__GNUC__ == 2 && (__GNUC_MINOR__ > 95))) #define likely(x) __builtin_expect(!!(x), 1) #define unlikely(x) __builtin_expect(!!(x), 0) #else /* !__GNUC__ or GCC < 2.95 */ #define likely(x) (x) #define unlikely(x) (x) #endif /* __GNUC__ */ static PyObject *__pyx_m; static PyObject *__pyx_d; static PyObject *__pyx_b; static PyObject *__pyx_empty_tuple; static PyObject *__pyx_empty_bytes; static int __pyx_lineno; static int __pyx_clineno = 0; static const char * __pyx_cfilenm= __FILE__; static const char *__pyx_filename; static const char *__pyx_f[] = { "src/pygame_sdl2/render.pyx", "src/pygame_sdl2/surface.pxd", "src/pygame_sdl2/display.pxd", "src/pygame_sdl2/rect.pxd", }; /*--- Type declarations ---*/ struct __pyx_obj_11pygame_sdl2_7surface_Surface; struct __pyx_obj_11pygame_sdl2_7display_Window; struct __pyx_obj_11pygame_sdl2_4rect_Rect; struct __pyx_obj_11pygame_sdl2_6render_Renderer; struct __pyx_obj_11pygame_sdl2_6render_Texture; struct __pyx_obj_11pygame_sdl2_6render_TextureNode; struct __pyx_obj_11pygame_sdl2_6render_TextureAtlas; struct __pyx_obj_11pygame_sdl2_6render_Sprite; struct __pyx_obj_11pygame_sdl2_6render_Container; struct __pyx_opt_args_11pygame_sdl2_8rwobject_to_rwops; /* "pygame_sdl2/rwobject.pxd":21 * from sdl2 cimport SDL_RWops * * cdef SDL_RWops *to_rwops(filelike, mode=*) except NULL # <<<<<<<<<<<<<< * */ struct __pyx_opt_args_11pygame_sdl2_8rwobject_to_rwops { int __pyx_n; PyObject *mode; }; struct __pyx_opt_args_11pygame_sdl2_4rect_to_sdl_rect; /* "pygame_sdl2/rect.pxd":31 * * * cdef int to_sdl_rect(rectlike, SDL_Rect *rect, argname=*) except -1 # <<<<<<<<<<<<<< */ struct __pyx_opt_args_11pygame_sdl2_4rect_to_sdl_rect { int __pyx_n; PyObject *argname; }; /* "pygame_sdl2/surface.pxd":23 * from sdl2 cimport SDL_Surface * * cdef class Surface: # <<<<<<<<<<<<<< * # Allow weak references. * cdef object __weakref__ */ struct __pyx_obj_11pygame_sdl2_7surface_Surface { PyObject_HEAD struct __pyx_vtabstruct_11pygame_sdl2_7surface_Surface *__pyx_vtab; PyObject *__weakref__; SDL_Surface *surface; int owns_surface; int window_surface; PyObject *locklist; struct __pyx_obj_11pygame_sdl2_7surface_Surface *parent; struct __pyx_obj_11pygame_sdl2_7surface_Surface *root; int offset_x; int offset_y; PyObject *get_window_flags; int has_alpha; }; /* "pygame_sdl2/display.pxd":23 * from pygame_sdl2.surface cimport Surface * * cdef class Window: # <<<<<<<<<<<<<< * # Allow weak references. * cdef object __weakref__ */ struct __pyx_obj_11pygame_sdl2_7display_Window { PyObject_HEAD PyObject *__weakref__; SDL_Window *window; SDL_Surface *window_surface; struct __pyx_obj_11pygame_sdl2_7surface_Surface *surface; SDL_GLContext gl_context; Uint32 create_flags; }; /* "pygame_sdl2/rect.pxd":21 * from sdl2 cimport * * * cdef class Rect: # <<<<<<<<<<<<<< * # Allow weak references. * cdef object __weakref__ */ struct __pyx_obj_11pygame_sdl2_4rect_Rect { PyObject_HEAD PyObject *__weakref__; int x; int y; int w; int h; }; /* "pygame_sdl2/render.pyx":67 * * * cdef class Renderer: # <<<<<<<<<<<<<< * cdef SDL_Renderer *renderer * cdef dict _info */ struct __pyx_obj_11pygame_sdl2_6render_Renderer { PyObject_HEAD struct __pyx_vtabstruct_11pygame_sdl2_6render_Renderer *__pyx_vtab; SDL_Renderer *renderer; PyObject *_info; }; /* "pygame_sdl2/render.pyx":172 * * * cdef class Texture: # <<<<<<<<<<<<<< * """ Mostly for internal use. Users should only see this for RTT. """ * */ struct __pyx_obj_11pygame_sdl2_6render_Texture { PyObject_HEAD struct __pyx_vtabstruct_11pygame_sdl2_6render_Texture *__pyx_vtab; SDL_Renderer *renderer; SDL_Texture *texture; int w; int h; }; /* "pygame_sdl2/render.pyx":200 * * * cdef class TextureNode: # <<<<<<<<<<<<<< * """ A specified area of a texture. """ * */ struct __pyx_obj_11pygame_sdl2_6render_TextureNode { PyObject_HEAD struct __pyx_obj_11pygame_sdl2_6render_Texture *texture; SDL_Rect source_rect; SDL_Rect trimmed_rect; int source_w; int source_h; }; /* "pygame_sdl2/render.pyx":245 * * * cdef class TextureAtlas: # <<<<<<<<<<<<<< * cdef object frames * */ struct __pyx_obj_11pygame_sdl2_6render_TextureAtlas { PyObject_HEAD PyObject *frames; }; /* "pygame_sdl2/render.pyx":278 * * * cdef class Sprite: # <<<<<<<<<<<<<< * """ One or more TextureNodes, with possible transforms applied. """ * */ struct __pyx_obj_11pygame_sdl2_6render_Sprite { PyObject_HEAD struct __pyx_vtabstruct_11pygame_sdl2_6render_Sprite *__pyx_vtab; PyObject *nodes; SDL_Rect _pos; SDL_Rect bounding_box; double _rotation; int _flip; SDL_Color _color; double _scalex; double _scaley; }; /* "pygame_sdl2/render.pyx":434 * * * cdef class Container: # <<<<<<<<<<<<<< * """ Multiple sprites, positioned relative to the container. """ * */ struct __pyx_obj_11pygame_sdl2_6render_Container { PyObject_HEAD SDL_Rect _rect; PyObject *sprites; }; /* "pygame_sdl2/surface.pxd":23 * from sdl2 cimport SDL_Surface * * cdef class Surface: # <<<<<<<<<<<<<< * # Allow weak references. * cdef object __weakref__ */ struct __pyx_vtabstruct_11pygame_sdl2_7surface_Surface { void (*take_surface)(struct __pyx_obj_11pygame_sdl2_7surface_Surface *, SDL_Surface *); }; static struct __pyx_vtabstruct_11pygame_sdl2_7surface_Surface *__pyx_vtabptr_11pygame_sdl2_7surface_Surface; /* "pygame_sdl2/render.pyx":67 * * * cdef class Renderer: # <<<<<<<<<<<<<< * cdef SDL_Renderer *renderer * cdef dict _info */ struct __pyx_vtabstruct_11pygame_sdl2_6render_Renderer { PyObject *(*set_drawcolor)(struct __pyx_obj_11pygame_sdl2_6render_Renderer *, PyObject *); }; static struct __pyx_vtabstruct_11pygame_sdl2_6render_Renderer *__pyx_vtabptr_11pygame_sdl2_6render_Renderer; /* "pygame_sdl2/render.pyx":172 * * * cdef class Texture: # <<<<<<<<<<<<<< * """ Mostly for internal use. Users should only see this for RTT. """ * */ struct __pyx_vtabstruct_11pygame_sdl2_6render_Texture { PyObject *(*set)(struct __pyx_obj_11pygame_sdl2_6render_Texture *, SDL_Renderer *, SDL_Texture *); }; static struct __pyx_vtabstruct_11pygame_sdl2_6render_Texture *__pyx_vtabptr_11pygame_sdl2_6render_Texture; /* "pygame_sdl2/render.pyx":278 * * * cdef class Sprite: # <<<<<<<<<<<<<< * """ One or more TextureNodes, with possible transforms applied. """ * */ struct __pyx_vtabstruct_11pygame_sdl2_6render_Sprite { void (*adjust_rect)(struct __pyx_obj_11pygame_sdl2_6render_Sprite *, SDL_Rect const *, SDL_Rect const *, SDL_Rect *); }; static struct __pyx_vtabstruct_11pygame_sdl2_6render_Sprite *__pyx_vtabptr_11pygame_sdl2_6render_Sprite; /* --- Runtime support code (head) --- */ #ifndef CYTHON_REFNANNY #define CYTHON_REFNANNY 0 #endif #if CYTHON_REFNANNY typedef struct { void (*INCREF)(void*, PyObject*, int); void (*DECREF)(void*, PyObject*, int); void (*GOTREF)(void*, PyObject*, int); void (*GIVEREF)(void*, PyObject*, int); void* (*SetupContext)(const char*, int, const char*); void (*FinishContext)(void**); } __Pyx_RefNannyAPIStruct; static __Pyx_RefNannyAPIStruct *__Pyx_RefNanny = NULL; static __Pyx_RefNannyAPIStruct *__Pyx_RefNannyImportAPI(const char *modname); #define __Pyx_RefNannyDeclarations void *__pyx_refnanny = NULL; #ifdef WITH_THREAD #define __Pyx_RefNannySetupContext(name, acquire_gil)\ if (acquire_gil) {\ PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure();\ __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), __LINE__, __FILE__);\ PyGILState_Release(__pyx_gilstate_save);\ } else {\ __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), __LINE__, __FILE__);\ } #else #define __Pyx_RefNannySetupContext(name, acquire_gil)\ __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), __LINE__, __FILE__) #endif #define __Pyx_RefNannyFinishContext()\ __Pyx_RefNanny->FinishContext(&__pyx_refnanny) #define __Pyx_INCREF(r) __Pyx_RefNanny->INCREF(__pyx_refnanny, (PyObject *)(r), __LINE__) #define __Pyx_DECREF(r) __Pyx_RefNanny->DECREF(__pyx_refnanny, (PyObject *)(r), __LINE__) #define __Pyx_GOTREF(r) __Pyx_RefNanny->GOTREF(__pyx_refnanny, (PyObject *)(r), __LINE__) #define __Pyx_GIVEREF(r) __Pyx_RefNanny->GIVEREF(__pyx_refnanny, (PyObject *)(r), __LINE__) #define __Pyx_XINCREF(r) do { if((r) != NULL) {__Pyx_INCREF(r); }} while(0) #define __Pyx_XDECREF(r) do { if((r) != NULL) {__Pyx_DECREF(r); }} while(0) #define __Pyx_XGOTREF(r) do { if((r) != NULL) {__Pyx_GOTREF(r); }} while(0) #define __Pyx_XGIVEREF(r) do { if((r) != NULL) {__Pyx_GIVEREF(r);}} while(0) #else #define __Pyx_RefNannyDeclarations #define __Pyx_RefNannySetupContext(name, acquire_gil) #define __Pyx_RefNannyFinishContext() #define __Pyx_INCREF(r) Py_INCREF(r) #define __Pyx_DECREF(r) Py_DECREF(r) #define __Pyx_GOTREF(r) #define __Pyx_GIVEREF(r) #define __Pyx_XINCREF(r) Py_XINCREF(r) #define __Pyx_XDECREF(r) Py_XDECREF(r) #define __Pyx_XGOTREF(r) #define __Pyx_XGIVEREF(r) #endif #define __Pyx_XDECREF_SET(r, v) do {\ PyObject *tmp = (PyObject *) r;\ r = v; __Pyx_XDECREF(tmp);\ } while (0) #define __Pyx_DECREF_SET(r, v) do {\ PyObject *tmp = (PyObject *) r;\ r = v; __Pyx_DECREF(tmp);\ } while (0) #define __Pyx_CLEAR(r) do { PyObject* tmp = ((PyObject*)(r)); r = NULL; __Pyx_DECREF(tmp);} while(0) #define __Pyx_XCLEAR(r) do { if((r) != NULL) {PyObject* tmp = ((PyObject*)(r)); r = NULL; __Pyx_DECREF(tmp);}} while(0) #if CYTHON_COMPILING_IN_CPYTHON static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStr(PyObject* obj, PyObject* attr_name) { PyTypeObject* tp = Py_TYPE(obj); if (likely(tp->tp_getattro)) return tp->tp_getattro(obj, attr_name); #if PY_MAJOR_VERSION < 3 if (likely(tp->tp_getattr)) return tp->tp_getattr(obj, PyString_AS_STRING(attr_name)); #endif return PyObject_GetAttr(obj, attr_name); } #else #define __Pyx_PyObject_GetAttrStr(o,n) PyObject_GetAttr(o,n) #endif static PyObject *__Pyx_GetBuiltinName(PyObject *name); static CYTHON_INLINE PyObject *__Pyx_GetModuleGlobalName(PyObject *name); #if CYTHON_COMPILING_IN_CPYTHON static CYTHON_INLINE PyObject* __Pyx_PyObject_Call(PyObject *func, PyObject *arg, PyObject *kw); #else #define __Pyx_PyObject_Call(func, arg, kw) PyObject_Call(func, arg, kw) #endif #if CYTHON_COMPILING_IN_CPYTHON static CYTHON_INLINE PyObject* __Pyx_PyObject_CallMethO(PyObject *func, PyObject *arg); #endif static CYTHON_INLINE PyObject* __Pyx_PyObject_CallOneArg(PyObject *func, PyObject *arg); #if CYTHON_COMPILING_IN_CPYTHON static CYTHON_INLINE PyObject* __Pyx_PyObject_CallNoArg(PyObject *func); #else #define __Pyx_PyObject_CallNoArg(func) __Pyx_PyObject_Call(func, __pyx_empty_tuple, NULL) #endif static CYTHON_INLINE void __Pyx_ErrRestore(PyObject *type, PyObject *value, PyObject *tb); static CYTHON_INLINE void __Pyx_ErrFetch(PyObject **type, PyObject **value, PyObject **tb); static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, PyObject *cause); #if CYTHON_COMPILING_IN_CPYTHON static CYTHON_INLINE int __Pyx_PyList_Append(PyObject* list, PyObject* x) { PyListObject* L = (PyListObject*) list; Py_ssize_t len = Py_SIZE(list); if (likely(L->allocated > len) & likely(len > (L->allocated >> 1))) { Py_INCREF(x); PyList_SET_ITEM(list, len, x); Py_SIZE(list) = len+1; return 0; } return PyList_Append(list, x); } #else #define __Pyx_PyList_Append(L,x) PyList_Append(L,x) #endif static void __Pyx_RaiseArgtupleInvalid(const char* func_name, int exact, Py_ssize_t num_min, Py_ssize_t num_max, Py_ssize_t num_found); static CYTHON_INLINE int __Pyx_CheckKeywordStrings(PyObject *kwdict, const char* function_name, int kw_allowed); static void __Pyx_RaiseDoubleKeywordsError(const char* func_name, PyObject* kw_name); static int __Pyx_ParseOptionalKeywords(PyObject *kwds, PyObject **argnames[],\ PyObject *kwds2, PyObject *values[], Py_ssize_t num_pos_args,\ const char* function_name); static CYTHON_INLINE int __Pyx_ArgTypeTest(PyObject *obj, PyTypeObject *type, int none_allowed, const char *name, int exact); static CYTHON_INLINE int __Pyx_TypeTest(PyObject *obj, PyTypeObject *type); static CYTHON_INLINE int __Pyx_IterFinish(void); static PyObject* __Pyx_PyObject_CallMethod0(PyObject* obj, PyObject* method_name); static CYTHON_INLINE void __Pyx_RaiseNeedMoreValuesError(Py_ssize_t index); static CYTHON_INLINE void __Pyx_RaiseTooManyValuesError(Py_ssize_t expected); static int __Pyx_IternextUnpackEndCheck(PyObject *retval, Py_ssize_t expected); static CYTHON_INLINE void __Pyx_RaiseNoneNotIterableError(void); static void __Pyx_UnpackTupleError(PyObject *, Py_ssize_t index); static CYTHON_INLINE int __Pyx_unpack_tuple2(PyObject* tuple, PyObject** value1, PyObject** value2, int is_tuple, int has_known_size, int decref_tuple); static CYTHON_INLINE PyObject* __Pyx_dict_iterator(PyObject* dict, int is_dict, PyObject* method_name, Py_ssize_t* p_orig_length, int* p_is_dict); static CYTHON_INLINE int __Pyx_dict_iter_next(PyObject* dict_or_iter, Py_ssize_t orig_length, Py_ssize_t* ppos, PyObject** pkey, PyObject** pvalue, PyObject** pitem, int is_dict); #define __Pyx_GetItemInt(o, i, type, is_signed, to_py_func, is_list, wraparound, boundscheck)\ (__Pyx_fits_Py_ssize_t(i, type, is_signed) ?\ __Pyx_GetItemInt_Fast(o, (Py_ssize_t)i, is_list, wraparound, boundscheck) :\ (is_list ? (PyErr_SetString(PyExc_IndexError, "list index out of range"), (PyObject*)NULL) :\ __Pyx_GetItemInt_Generic(o, to_py_func(i)))) #define __Pyx_GetItemInt_List(o, i, type, is_signed, to_py_func, is_list, wraparound, boundscheck)\ (__Pyx_fits_Py_ssize_t(i, type, is_signed) ?\ __Pyx_GetItemInt_List_Fast(o, (Py_ssize_t)i, wraparound, boundscheck) :\ (PyErr_SetString(PyExc_IndexError, "list index out of range"), (PyObject*)NULL)) static CYTHON_INLINE PyObject *__Pyx_GetItemInt_List_Fast(PyObject *o, Py_ssize_t i, int wraparound, int boundscheck); #define __Pyx_GetItemInt_Tuple(o, i, type, is_signed, to_py_func, is_list, wraparound, boundscheck)\ (__Pyx_fits_Py_ssize_t(i, type, is_signed) ?\ __Pyx_GetItemInt_Tuple_Fast(o, (Py_ssize_t)i, wraparound, boundscheck) :\ (PyErr_SetString(PyExc_IndexError, "tuple index out of range"), (PyObject*)NULL)) static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Tuple_Fast(PyObject *o, Py_ssize_t i, int wraparound, int boundscheck); static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Generic(PyObject *o, PyObject* j); static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Fast(PyObject *o, Py_ssize_t i, int is_list, int wraparound, int boundscheck); static int __Pyx_SetVtable(PyObject *dict, void *vtable); static void* __Pyx_GetVtable(PyObject *dict); static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list, int level); static PyObject* __Pyx_ImportFrom(PyObject* module, PyObject* name); typedef struct { int code_line; PyCodeObject* code_object; } __Pyx_CodeObjectCacheEntry; struct __Pyx_CodeObjectCache { int count; int max_count; __Pyx_CodeObjectCacheEntry* entries; }; static struct __Pyx_CodeObjectCache __pyx_code_cache = {0,0,NULL}; static int __pyx_bisect_code_objects(__Pyx_CodeObjectCacheEntry* entries, int count, int code_line); static PyCodeObject *__pyx_find_code_object(int code_line); static void __pyx_insert_code_object(int code_line, PyCodeObject* code_object); static void __Pyx_AddTraceback(const char *funcname, int c_line, int py_line, const char *filename); static CYTHON_INLINE PyObject* __Pyx_PyInt_From_SDL_BlendMode(SDL_BlendMode value); static CYTHON_INLINE PyObject* __Pyx_PyInt_From_int(int value); static CYTHON_INLINE int __Pyx_PyInt_As_int(PyObject *); #ifndef __PYX_FORCE_INIT_THREADS #define __PYX_FORCE_INIT_THREADS 0 #endif static CYTHON_INLINE uint8_t __Pyx_PyInt_As_uint8_t(PyObject *); static CYTHON_INLINE PyObject* __Pyx_PyInt_From_long(long value); static CYTHON_INLINE PyObject* __Pyx_PyInt_From_uint8_t(uint8_t value); static CYTHON_INLINE long __Pyx_PyInt_As_long(PyObject *); static int __Pyx_check_binary_version(void); #if !defined(__Pyx_PyIdentifier_FromString) #if PY_MAJOR_VERSION < 3 #define __Pyx_PyIdentifier_FromString(s) PyString_FromString(s) #else #define __Pyx_PyIdentifier_FromString(s) PyUnicode_FromString(s) #endif #endif static PyObject *__Pyx_ImportModule(const char *name); static PyTypeObject *__Pyx_ImportType(const char *module_name, const char *class_name, size_t size, int strict); static int __Pyx_ImportVoidPtr(PyObject *module, const char *name, void **p, const char *sig); static int __Pyx_ImportFunction(PyObject *module, const char *funcname, void (**f)(void), const char *sig); static int __Pyx_InitStrings(__Pyx_StringTabEntry *t); static PyObject *__pyx_f_11pygame_sdl2_6render_8Renderer_set_drawcolor(struct __pyx_obj_11pygame_sdl2_6render_Renderer *__pyx_v_self, PyObject *__pyx_v_col); /* proto*/ static PyObject *__pyx_f_11pygame_sdl2_6render_7Texture_set(struct __pyx_obj_11pygame_sdl2_6render_Texture *__pyx_v_self, SDL_Renderer *__pyx_v_ren, SDL_Texture *__pyx_v_tex); /* proto*/ static void __pyx_f_11pygame_sdl2_6render_6Sprite_adjust_rect(struct __pyx_obj_11pygame_sdl2_6render_Sprite *__pyx_v_self, SDL_Rect const *__pyx_v_dest, SDL_Rect const *__pyx_v_rin, SDL_Rect *__pyx_v_rout); /* proto*/ /* Module declarations from 'libc.stdint' */ /* Module declarations from 'libc.string' */ /* Module declarations from 'libc.stdio' */ /* Module declarations from 'libc.stddef' */ /* Module declarations from 'sdl2' */ /* Module declarations from 'sdl2_image' */ /* Module declarations from 'pygame_sdl2.surface' */ static PyTypeObject *__pyx_ptype_11pygame_sdl2_7surface_Surface = 0; /* Module declarations from 'pygame_sdl2.display' */ static PyTypeObject *__pyx_ptype_11pygame_sdl2_7display_Window = 0; static struct __pyx_obj_11pygame_sdl2_7display_Window **__pyx_vp_11pygame_sdl2_7display_main_window = 0; #define __pyx_v_11pygame_sdl2_7display_main_window (*__pyx_vp_11pygame_sdl2_7display_main_window) /* Module declarations from 'pygame_sdl2.rwobject' */ static SDL_RWops *(*__pyx_f_11pygame_sdl2_8rwobject_to_rwops)(PyObject *, struct __pyx_opt_args_11pygame_sdl2_8rwobject_to_rwops *__pyx_optional_args); /*proto*/ /* Module declarations from 'pygame_sdl2.rect' */ static PyTypeObject *__pyx_ptype_11pygame_sdl2_4rect_Rect = 0; static int (*__pyx_f_11pygame_sdl2_4rect_to_sdl_rect)(PyObject *, SDL_Rect *, struct __pyx_opt_args_11pygame_sdl2_4rect_to_sdl_rect *__pyx_optional_args); /*proto*/ /* Module declarations from 'pygame_sdl2.render' */ static PyTypeObject *__pyx_ptype_11pygame_sdl2_6render_Renderer = 0; static PyTypeObject *__pyx_ptype_11pygame_sdl2_6render_Texture = 0; static PyTypeObject *__pyx_ptype_11pygame_sdl2_6render_TextureNode = 0; static PyTypeObject *__pyx_ptype_11pygame_sdl2_6render_TextureAtlas = 0; static PyTypeObject *__pyx_ptype_11pygame_sdl2_6render_Sprite = 0; static PyTypeObject *__pyx_ptype_11pygame_sdl2_6render_Container = 0; static int __pyx_v_11pygame_sdl2_6render_DEBUG_DRAW_BBOX; static PyObject *__pyx_f_11pygame_sdl2_6render_rinfo_to_dict(SDL_RendererInfo *); /*proto*/ #define __Pyx_MODULE_NAME "pygame_sdl2.render" int __pyx_module_is_main_pygame_sdl2__render = 0; /* Implementation of 'pygame_sdl2.render' */ static PyObject *__pyx_builtin_range; static PyObject *__pyx_builtin_ValueError; static PyObject *__pyx_builtin_open; static char __pyx_k_a[] = "a"; static char __pyx_k_b[] = "b"; static char __pyx_k_g[] = "g"; static char __pyx_k_h[] = "h"; static char __pyx_k_n[] = "n"; static char __pyx_k_r[] = "r"; static char __pyx_k_w[] = "w"; static char __pyx_k_x[] = "x"; static char __pyx_k_y[] = "y"; static char __pyx_k_fi[] = "fi"; static char __pyx_k_rv[] = "rv"; static char __pyx_k_x1[] = "x1"; static char __pyx_k_x2[] = "x2"; static char __pyx_k_y1[] = "y1"; static char __pyx_k_y2[] = "y2"; static char __pyx_k_pos[] = "pos"; static char __pyx_k_ren[] = "ren"; static char __pyx_k_rtt[] = "rtt"; static char __pyx_k_tex[] = "tex"; static char __pyx_k_Rect[] = "Rect"; static char __pyx_k_dest[] = "dest"; static char __pyx_k_info[] = "info"; static char __pyx_k_json[] = "json"; static char __pyx_k_keys[] = "keys"; static char __pyx_k_load[] = "load"; static char __pyx_k_main[] = "__main__"; static char __pyx_k_meta[] = "meta"; static char __pyx_k_name[] = "name"; static char __pyx_k_open[] = "open"; static char __pyx_k_rect[] = "rect"; static char __pyx_k_test[] = "__test__"; static char __pyx_k_warn[] = "warn"; static char __pyx_k_Color[] = "Color"; static char __pyx_k_color[] = "color"; static char __pyx_k_error[] = "error"; static char __pyx_k_frame[] = "frame"; static char __pyx_k_image[] = "image"; static char __pyx_k_nodes[] = "nodes"; static char __pyx_k_range[] = "range"; static char __pyx_k_rinfo[] = "rinfo"; static char __pyx_k_vsync[] = "vsync"; static char __pyx_k_driver[] = "driver"; static char __pyx_k_frames[] = "frames"; static char __pyx_k_import[] = "__import__"; static char __pyx_k_render[] = "render"; static char __pyx_k_window[] = "window"; static char __pyx_k_rotated[] = "rotated"; static char __pyx_k_software[] = "software"; static char __pyx_k_warnings[] = "warnings"; static char __pyx_k_iteritems[] = "iteritems"; static char __pyx_k_ValueError[] = "ValueError"; static char __pyx_k_pyx_vtable[] = "__pyx_vtable__"; static char __pyx_k_sourceSize[] = "sourceSize"; static char __pyx_k_accelerated[] = "accelerated"; static char __pyx_k_get_drivers[] = "get_drivers"; static char __pyx_k_num_drivers[] = "num_drivers"; static char __pyx_k_load_texture[] = "load_texture"; static char __pyx_k_BLENDMODE_ADD[] = "BLENDMODE_ADD"; static char __pyx_k_BLENDMODE_MOD[] = "BLENDMODE_MOD"; static char __pyx_k_BLENDMODE_NONE[] = "BLENDMODE_NONE"; static char __pyx_k_BLENDMODE_BLEND[] = "BLENDMODE_BLEND"; static char __pyx_k_pygame_sdl2_rect[] = "pygame_sdl2.rect"; static char __pyx_k_spriteSourceSize[] = "spriteSourceSize"; static char __pyx_k_max_texture_width[] = "max_texture_width"; static char __pyx_k_pygame_sdl2_color[] = "pygame_sdl2.color"; static char __pyx_k_pygame_sdl2_error[] = "pygame_sdl2.error"; static char __pyx_k_Invalid_argument_s[] = "Invalid argument: %s"; static char __pyx_k_max_texture_height[] = "max_texture_height"; static char __pyx_k_pygame_sdl2_render[] = "pygame_sdl2.render"; static char __pyx_k_Rotation_not_supported_yet[] = "Rotation not supported yet."; static char __pyx_k_Renderer_is_not_accelerated[] = "Renderer is not accelerated."; static char __pyx_k_home_tom_ab_pygame_sdl2_src_pyg[] = "/home/tom/ab/pygame_sdl2/src/pygame_sdl2/render.pyx"; static PyObject *__pyx_n_s_BLENDMODE_ADD; static PyObject *__pyx_n_s_BLENDMODE_BLEND; static PyObject *__pyx_n_s_BLENDMODE_MOD; static PyObject *__pyx_n_s_BLENDMODE_NONE; static PyObject *__pyx_n_s_Color; static PyObject *__pyx_kp_u_Invalid_argument_s; static PyObject *__pyx_n_s_Rect; static PyObject *__pyx_kp_u_Renderer_is_not_accelerated; static PyObject *__pyx_kp_u_Rotation_not_supported_yet; static PyObject *__pyx_n_s_ValueError; static PyObject *__pyx_n_s_a; static PyObject *__pyx_n_u_accelerated; static PyObject *__pyx_n_s_b; static PyObject *__pyx_n_s_color; static PyObject *__pyx_n_s_dest; static PyObject *__pyx_n_s_driver; static PyObject *__pyx_n_s_error; static PyObject *__pyx_n_s_fi; static PyObject *__pyx_n_u_frame; static PyObject *__pyx_n_u_frames; static PyObject *__pyx_n_s_g; static PyObject *__pyx_n_s_get_drivers; static PyObject *__pyx_n_s_h; static PyObject *__pyx_n_u_h; static PyObject *__pyx_kp_s_home_tom_ab_pygame_sdl2_src_pyg; static PyObject *__pyx_n_u_image; static PyObject *__pyx_n_s_import; static PyObject *__pyx_n_s_info; static PyObject *__pyx_n_s_iteritems; static PyObject *__pyx_n_s_json; static PyObject *__pyx_n_s_keys; static PyObject *__pyx_n_s_load; static PyObject *__pyx_n_s_load_texture; static PyObject *__pyx_n_s_main; static PyObject *__pyx_n_u_max_texture_height; static PyObject *__pyx_n_u_max_texture_width; static PyObject *__pyx_n_u_meta; static PyObject *__pyx_n_s_n; static PyObject *__pyx_n_u_name; static PyObject *__pyx_n_s_nodes; static PyObject *__pyx_n_s_num_drivers; static PyObject *__pyx_n_s_open; static PyObject *__pyx_n_s_pos; static PyObject *__pyx_n_s_pygame_sdl2_color; static PyObject *__pyx_n_s_pygame_sdl2_error; static PyObject *__pyx_n_s_pygame_sdl2_rect; static PyObject *__pyx_n_s_pygame_sdl2_render; static PyObject *__pyx_n_s_pyx_vtable; static PyObject *__pyx_n_s_r; static PyObject *__pyx_n_u_r; static PyObject *__pyx_n_s_range; static PyObject *__pyx_n_s_rect; static PyObject *__pyx_n_s_ren; static PyObject *__pyx_n_s_render; static PyObject *__pyx_n_s_rinfo; static PyObject *__pyx_n_u_rotated; static PyObject *__pyx_n_u_rtt; static PyObject *__pyx_n_s_rv; static PyObject *__pyx_n_u_software; static PyObject *__pyx_n_u_sourceSize; static PyObject *__pyx_n_u_spriteSourceSize; static PyObject *__pyx_n_s_test; static PyObject *__pyx_n_s_tex; static PyObject *__pyx_n_s_vsync; static PyObject *__pyx_n_u_vsync; static PyObject *__pyx_n_s_w; static PyObject *__pyx_n_u_w; static PyObject *__pyx_n_s_warn; static PyObject *__pyx_n_s_warnings; static PyObject *__pyx_n_s_window; static PyObject *__pyx_n_s_x; static PyObject *__pyx_n_u_x; static PyObject *__pyx_n_s_x1; static PyObject *__pyx_n_s_x2; static PyObject *__pyx_n_s_y; static PyObject *__pyx_n_u_y; static PyObject *__pyx_n_s_y1; static PyObject *__pyx_n_s_y2; static PyObject *__pyx_pf_11pygame_sdl2_6render_get_drivers(CYTHON_UNUSED PyObject *__pyx_self); /* proto */ static int __pyx_pf_11pygame_sdl2_6render_8Renderer___cinit__(struct __pyx_obj_11pygame_sdl2_6render_Renderer *__pyx_v_self); /* proto */ static void __pyx_pf_11pygame_sdl2_6render_8Renderer_2__dealloc__(struct __pyx_obj_11pygame_sdl2_6render_Renderer *__pyx_v_self); /* proto */ static int __pyx_pf_11pygame_sdl2_6render_8Renderer_4__init__(struct __pyx_obj_11pygame_sdl2_6render_Renderer *__pyx_v_self, struct __pyx_obj_11pygame_sdl2_7display_Window *__pyx_v_window, PyObject *__pyx_v_vsync, PyObject *__pyx_v_driver); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_6render_8Renderer_6load_texture(struct __pyx_obj_11pygame_sdl2_6render_Renderer *__pyx_v_self, PyObject *__pyx_v_fi); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_6render_8Renderer_8load_atlas(struct __pyx_obj_11pygame_sdl2_6render_Renderer *__pyx_v_self, PyObject *__pyx_v_filename); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_6render_8Renderer_10render_present(struct __pyx_obj_11pygame_sdl2_6render_Renderer *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_6render_8Renderer_12info(struct __pyx_obj_11pygame_sdl2_6render_Renderer *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_6render_8Renderer_14clear(struct __pyx_obj_11pygame_sdl2_6render_Renderer *__pyx_v_self, PyObject *__pyx_v_color); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_6render_8Renderer_16draw_line(struct __pyx_obj_11pygame_sdl2_6render_Renderer *__pyx_v_self, PyObject *__pyx_v_color, PyObject *__pyx_v_x1, PyObject *__pyx_v_y1, PyObject *__pyx_v_x2, PyObject *__pyx_v_y2); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_6render_8Renderer_18draw_point(struct __pyx_obj_11pygame_sdl2_6render_Renderer *__pyx_v_self, PyObject *__pyx_v_color, PyObject *__pyx_v_x, PyObject *__pyx_v_y); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_6render_8Renderer_20draw_rect(struct __pyx_obj_11pygame_sdl2_6render_Renderer *__pyx_v_self, PyObject *__pyx_v_color, PyObject *__pyx_v_rect); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_6render_8Renderer_22fill_rect(struct __pyx_obj_11pygame_sdl2_6render_Renderer *__pyx_v_self, PyObject *__pyx_v_color, PyObject *__pyx_v_rect); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_6render_8Renderer_24set_viewport(struct __pyx_obj_11pygame_sdl2_6render_Renderer *__pyx_v_self, PyObject *__pyx_v_rect); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_6render_8Renderer_26create_texture(struct __pyx_obj_11pygame_sdl2_6render_Renderer *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v_size); /* proto */ static int __pyx_pf_11pygame_sdl2_6render_7Texture___cinit__(struct __pyx_obj_11pygame_sdl2_6render_Texture *__pyx_v_self); /* proto */ static void __pyx_pf_11pygame_sdl2_6render_7Texture_2__dealloc__(struct __pyx_obj_11pygame_sdl2_6render_Texture *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_6render_7Texture_1w___get__(struct __pyx_obj_11pygame_sdl2_6render_Texture *__pyx_v_self); /* proto */ static int __pyx_pf_11pygame_sdl2_6render_7Texture_1w_2__set__(struct __pyx_obj_11pygame_sdl2_6render_Texture *__pyx_v_self, PyObject *__pyx_v_value); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_6render_7Texture_1h___get__(struct __pyx_obj_11pygame_sdl2_6render_Texture *__pyx_v_self); /* proto */ static int __pyx_pf_11pygame_sdl2_6render_7Texture_1h_2__set__(struct __pyx_obj_11pygame_sdl2_6render_Texture *__pyx_v_self, PyObject *__pyx_v_value); /* proto */ static int __pyx_pf_11pygame_sdl2_6render_11TextureNode___init__(struct __pyx_obj_11pygame_sdl2_6render_TextureNode *__pyx_v_self, PyObject *__pyx_v_tex); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_6render_11TextureNode_2render(struct __pyx_obj_11pygame_sdl2_6render_TextureNode *__pyx_v_self, PyObject *__pyx_v_dest); /* proto */ static int __pyx_pf_11pygame_sdl2_6render_12TextureAtlas___init__(struct __pyx_obj_11pygame_sdl2_6render_TextureAtlas *__pyx_v_self, struct __pyx_obj_11pygame_sdl2_6render_Renderer *__pyx_v_ren, PyObject *__pyx_v_fi); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_6render_12TextureAtlas_2__getitem__(struct __pyx_obj_11pygame_sdl2_6render_TextureAtlas *__pyx_v_self, PyObject *__pyx_v_key); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_6render_12TextureAtlas_4keys(struct __pyx_obj_11pygame_sdl2_6render_TextureAtlas *__pyx_v_self); /* proto */ static int __pyx_pf_11pygame_sdl2_6render_6Sprite___init__(struct __pyx_obj_11pygame_sdl2_6render_Sprite *__pyx_v_self, PyObject *__pyx_v_nodes); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_6render_6Sprite_2render(struct __pyx_obj_11pygame_sdl2_6render_Sprite *__pyx_v_self, PyObject *__pyx_v_dest); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_6render_6Sprite_4collides(struct __pyx_obj_11pygame_sdl2_6render_Sprite *__pyx_v_self, struct __pyx_obj_11pygame_sdl2_6render_Sprite *__pyx_v_other); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_6render_6Sprite_3pos___get__(struct __pyx_obj_11pygame_sdl2_6render_Sprite *__pyx_v_self); /* proto */ static int __pyx_pf_11pygame_sdl2_6render_6Sprite_3pos_2__set__(struct __pyx_obj_11pygame_sdl2_6render_Sprite *__pyx_v_self, PyObject *__pyx_v_val); /* proto */ static int __pyx_pf_11pygame_sdl2_6render_6Sprite_5color___set__(struct __pyx_obj_11pygame_sdl2_6render_Sprite *__pyx_v_self, PyObject *__pyx_v_val); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_6render_6Sprite_5alpha___get__(struct __pyx_obj_11pygame_sdl2_6render_Sprite *__pyx_v_self); /* proto */ static int __pyx_pf_11pygame_sdl2_6render_6Sprite_5alpha_2__set__(struct __pyx_obj_11pygame_sdl2_6render_Sprite *__pyx_v_self, PyObject *__pyx_v_val); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_6render_6Sprite_8rotation___get__(struct __pyx_obj_11pygame_sdl2_6render_Sprite *__pyx_v_self); /* proto */ static int __pyx_pf_11pygame_sdl2_6render_6Sprite_8rotation_2__set__(struct __pyx_obj_11pygame_sdl2_6render_Sprite *__pyx_v_self, PyObject *__pyx_v_val); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_6render_6Sprite_5scale___get__(struct __pyx_obj_11pygame_sdl2_6render_Sprite *__pyx_v_self); /* proto */ static int __pyx_pf_11pygame_sdl2_6render_6Sprite_5scale_2__set__(struct __pyx_obj_11pygame_sdl2_6render_Sprite *__pyx_v_self, PyObject *__pyx_v_arg); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_6render_6Sprite_5hflip___get__(struct __pyx_obj_11pygame_sdl2_6render_Sprite *__pyx_v_self); /* proto */ static int __pyx_pf_11pygame_sdl2_6render_6Sprite_5hflip_2__set__(struct __pyx_obj_11pygame_sdl2_6render_Sprite *__pyx_v_self, PyObject *__pyx_v_val); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_6render_6Sprite_5vflip___get__(struct __pyx_obj_11pygame_sdl2_6render_Sprite *__pyx_v_self); /* proto */ static int __pyx_pf_11pygame_sdl2_6render_6Sprite_5vflip_2__set__(struct __pyx_obj_11pygame_sdl2_6render_Sprite *__pyx_v_self, PyObject *__pyx_v_val); /* proto */ static int __pyx_pf_11pygame_sdl2_6render_9Container___init__(struct __pyx_obj_11pygame_sdl2_6render_Container *__pyx_v_self, PyObject *__pyx_v_rect); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_6render_9Container_2add(struct __pyx_obj_11pygame_sdl2_6render_Container *__pyx_v_self, struct __pyx_obj_11pygame_sdl2_6render_Sprite *__pyx_v_sprite); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_6render_9Container_4render(struct __pyx_obj_11pygame_sdl2_6render_Container *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v_dest); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_6render_9Container_3pos___get__(struct __pyx_obj_11pygame_sdl2_6render_Container *__pyx_v_self); /* proto */ static int __pyx_pf_11pygame_sdl2_6render_9Container_3pos_2__set__(struct __pyx_obj_11pygame_sdl2_6render_Container *__pyx_v_self, PyObject *__pyx_v_val); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_6render_9Container_4rect___get__(struct __pyx_obj_11pygame_sdl2_6render_Container *__pyx_v_self); /* proto */ static int __pyx_pf_11pygame_sdl2_6render_9Container_4rect_2__set__(struct __pyx_obj_11pygame_sdl2_6render_Container *__pyx_v_self, PyObject *__pyx_v_val); /* proto */ static PyObject *__pyx_tp_new_11pygame_sdl2_6render_Renderer(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ static PyObject *__pyx_tp_new_11pygame_sdl2_6render_Texture(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ static PyObject *__pyx_tp_new_11pygame_sdl2_6render_TextureNode(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ static PyObject *__pyx_tp_new_11pygame_sdl2_6render_TextureAtlas(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ static PyObject *__pyx_tp_new_11pygame_sdl2_6render_Sprite(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ static PyObject *__pyx_tp_new_11pygame_sdl2_6render_Container(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ static PyObject *__pyx_int_0; static PyObject *__pyx_int_neg_1; static PyObject *__pyx_tuple_; static PyObject *__pyx_tuple__2; static PyObject *__pyx_tuple__3; static PyObject *__pyx_codeobj__4; /* "pygame_sdl2/render.pyx":40 * cdef bint DEBUG_DRAW_BBOX = True * * cdef rinfo_to_dict(SDL_RendererInfo *rinfo): # <<<<<<<<<<<<<< * # Ignore texture_formats for now. * return { */ static PyObject *__pyx_f_11pygame_sdl2_6render_rinfo_to_dict(SDL_RendererInfo *__pyx_v_rinfo) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("rinfo_to_dict", 0); /* "pygame_sdl2/render.pyx":42 * cdef rinfo_to_dict(SDL_RendererInfo *rinfo): * # Ignore texture_formats for now. * return { # <<<<<<<<<<<<<< * "name" : rinfo.name, * "software" : rinfo.flags & SDL_RENDERER_SOFTWARE != 0, */ __Pyx_XDECREF(__pyx_r); /* "pygame_sdl2/render.pyx":43 * # Ignore texture_formats for now. * return { * "name" : rinfo.name, # <<<<<<<<<<<<<< * "software" : rinfo.flags & SDL_RENDERER_SOFTWARE != 0, * "accelerated" : rinfo.flags & SDL_RENDERER_ACCELERATED != 0, */ __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 43; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = __Pyx_PyBytes_FromString(__pyx_v_rinfo->name); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 43; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_t_1, __pyx_n_u_name, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 43; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "pygame_sdl2/render.pyx":44 * return { * "name" : rinfo.name, * "software" : rinfo.flags & SDL_RENDERER_SOFTWARE != 0, # <<<<<<<<<<<<<< * "accelerated" : rinfo.flags & SDL_RENDERER_ACCELERATED != 0, * "vsync" : rinfo.flags & SDL_RENDERER_PRESENTVSYNC != 0, */ __pyx_t_2 = __Pyx_PyBool_FromLong(((__pyx_v_rinfo->flags & SDL_RENDERER_SOFTWARE) != 0)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 44; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_t_1, __pyx_n_u_software, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 43; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "pygame_sdl2/render.pyx":45 * "name" : rinfo.name, * "software" : rinfo.flags & SDL_RENDERER_SOFTWARE != 0, * "accelerated" : rinfo.flags & SDL_RENDERER_ACCELERATED != 0, # <<<<<<<<<<<<<< * "vsync" : rinfo.flags & SDL_RENDERER_PRESENTVSYNC != 0, * "rtt" : rinfo.flags & SDL_RENDERER_TARGETTEXTURE != 0, */ __pyx_t_2 = __Pyx_PyBool_FromLong(((__pyx_v_rinfo->flags & SDL_RENDERER_ACCELERATED) != 0)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 45; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_t_1, __pyx_n_u_accelerated, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 43; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "pygame_sdl2/render.pyx":46 * "software" : rinfo.flags & SDL_RENDERER_SOFTWARE != 0, * "accelerated" : rinfo.flags & SDL_RENDERER_ACCELERATED != 0, * "vsync" : rinfo.flags & SDL_RENDERER_PRESENTVSYNC != 0, # <<<<<<<<<<<<<< * "rtt" : rinfo.flags & SDL_RENDERER_TARGETTEXTURE != 0, * "max_texture_width" : rinfo.max_texture_width, */ __pyx_t_2 = __Pyx_PyBool_FromLong(((__pyx_v_rinfo->flags & SDL_RENDERER_PRESENTVSYNC) != 0)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 46; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_t_1, __pyx_n_u_vsync, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 43; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "pygame_sdl2/render.pyx":47 * "accelerated" : rinfo.flags & SDL_RENDERER_ACCELERATED != 0, * "vsync" : rinfo.flags & SDL_RENDERER_PRESENTVSYNC != 0, * "rtt" : rinfo.flags & SDL_RENDERER_TARGETTEXTURE != 0, # <<<<<<<<<<<<<< * "max_texture_width" : rinfo.max_texture_width, * "max_texture_height" : rinfo.max_texture_height, */ __pyx_t_2 = __Pyx_PyBool_FromLong(((__pyx_v_rinfo->flags & SDL_RENDERER_TARGETTEXTURE) != 0)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 47; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_t_1, __pyx_n_u_rtt, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 43; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "pygame_sdl2/render.pyx":48 * "vsync" : rinfo.flags & SDL_RENDERER_PRESENTVSYNC != 0, * "rtt" : rinfo.flags & SDL_RENDERER_TARGETTEXTURE != 0, * "max_texture_width" : rinfo.max_texture_width, # <<<<<<<<<<<<<< * "max_texture_height" : rinfo.max_texture_height, * } */ __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_v_rinfo->max_texture_width); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 48; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_t_1, __pyx_n_u_max_texture_width, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 43; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "pygame_sdl2/render.pyx":49 * "rtt" : rinfo.flags & SDL_RENDERER_TARGETTEXTURE != 0, * "max_texture_width" : rinfo.max_texture_width, * "max_texture_height" : rinfo.max_texture_height, # <<<<<<<<<<<<<< * } * */ __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_v_rinfo->max_texture_height); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 49; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_t_1, __pyx_n_u_max_texture_height, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 43; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "pygame_sdl2/render.pyx":40 * cdef bint DEBUG_DRAW_BBOX = True * * cdef rinfo_to_dict(SDL_RendererInfo *rinfo): # <<<<<<<<<<<<<< * # Ignore texture_formats for now. * return { */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_AddTraceback("pygame_sdl2.render.rinfo_to_dict", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/render.pyx":52 * } * * def get_drivers(): # <<<<<<<<<<<<<< * cdef SDL_RendererInfo rinfo * cdef int num_drivers */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_6render_1get_drivers(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused); /*proto*/ static PyMethodDef __pyx_mdef_11pygame_sdl2_6render_1get_drivers = {"get_drivers", (PyCFunction)__pyx_pw_11pygame_sdl2_6render_1get_drivers, METH_NOARGS, 0}; static PyObject *__pyx_pw_11pygame_sdl2_6render_1get_drivers(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("get_drivers (wrapper)", 0); __pyx_r = __pyx_pf_11pygame_sdl2_6render_get_drivers(__pyx_self); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_6render_get_drivers(CYTHON_UNUSED PyObject *__pyx_self) { SDL_RendererInfo __pyx_v_rinfo; int __pyx_v_num_drivers; PyObject *__pyx_v_rv = NULL; int __pyx_v_n; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_t_2; int __pyx_t_3; int __pyx_t_4; PyObject *__pyx_t_5 = NULL; PyObject *__pyx_t_6 = NULL; int __pyx_t_7; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("get_drivers", 0); /* "pygame_sdl2/render.pyx":55 * cdef SDL_RendererInfo rinfo * cdef int num_drivers * rv = [] # <<<<<<<<<<<<<< * * num_drivers = SDL_GetNumRenderDrivers() */ __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 55; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_v_rv = ((PyObject*)__pyx_t_1); __pyx_t_1 = 0; /* "pygame_sdl2/render.pyx":57 * rv = [] * * num_drivers = SDL_GetNumRenderDrivers() # <<<<<<<<<<<<<< * for n in range(num_drivers): * if SDL_GetRenderDriverInfo(n, &rinfo) != 0: */ __pyx_v_num_drivers = SDL_GetNumRenderDrivers(); /* "pygame_sdl2/render.pyx":58 * * num_drivers = SDL_GetNumRenderDrivers() * for n in range(num_drivers): # <<<<<<<<<<<<<< * if SDL_GetRenderDriverInfo(n, &rinfo) != 0: * raise error() */ __pyx_t_2 = __pyx_v_num_drivers; for (__pyx_t_3 = 0; __pyx_t_3 < __pyx_t_2; __pyx_t_3+=1) { __pyx_v_n = __pyx_t_3; /* "pygame_sdl2/render.pyx":59 * num_drivers = SDL_GetNumRenderDrivers() * for n in range(num_drivers): * if SDL_GetRenderDriverInfo(n, &rinfo) != 0: # <<<<<<<<<<<<<< * raise error() * */ __pyx_t_4 = ((SDL_GetRenderDriverInfo(__pyx_v_n, (&__pyx_v_rinfo)) != 0) != 0); if (__pyx_t_4) { /* "pygame_sdl2/render.pyx":60 * for n in range(num_drivers): * if SDL_GetRenderDriverInfo(n, &rinfo) != 0: * raise error() # <<<<<<<<<<<<<< * * rv.append(rinfo_to_dict(&rinfo)) */ __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_error); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 60; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); __pyx_t_6 = NULL; if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_5))) { __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_5); if (likely(__pyx_t_6)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5); __Pyx_INCREF(__pyx_t_6); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_5, function); } } if (__pyx_t_6) { __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_t_6); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 60; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; } else { __pyx_t_1 = __Pyx_PyObject_CallNoArg(__pyx_t_5); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 60; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_Raise(__pyx_t_1, 0, 0, 0); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; {__pyx_filename = __pyx_f[0]; __pyx_lineno = 60; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "pygame_sdl2/render.pyx":59 * num_drivers = SDL_GetNumRenderDrivers() * for n in range(num_drivers): * if SDL_GetRenderDriverInfo(n, &rinfo) != 0: # <<<<<<<<<<<<<< * raise error() * */ } /* "pygame_sdl2/render.pyx":62 * raise error() * * rv.append(rinfo_to_dict(&rinfo)) # <<<<<<<<<<<<<< * * return rv */ __pyx_t_1 = __pyx_f_11pygame_sdl2_6render_rinfo_to_dict((&__pyx_v_rinfo)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 62; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_t_7 = __Pyx_PyList_Append(__pyx_v_rv, __pyx_t_1); if (unlikely(__pyx_t_7 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 62; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; } /* "pygame_sdl2/render.pyx":64 * rv.append(rinfo_to_dict(&rinfo)) * * return rv # <<<<<<<<<<<<<< * * */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(__pyx_v_rv); __pyx_r = __pyx_v_rv; goto __pyx_L0; /* "pygame_sdl2/render.pyx":52 * } * * def get_drivers(): # <<<<<<<<<<<<<< * cdef SDL_RendererInfo rinfo * cdef int num_drivers */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_5); __Pyx_XDECREF(__pyx_t_6); __Pyx_AddTraceback("pygame_sdl2.render.get_drivers", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF(__pyx_v_rv); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/render.pyx":71 * cdef dict _info * * def __cinit__(self): # <<<<<<<<<<<<<< * self.renderer = NULL * */ /* Python wrapper */ static int __pyx_pw_11pygame_sdl2_6render_8Renderer_1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static int __pyx_pw_11pygame_sdl2_6render_8Renderer_1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__cinit__ (wrapper)", 0); if (unlikely(PyTuple_GET_SIZE(__pyx_args) > 0)) { __Pyx_RaiseArgtupleInvalid("__cinit__", 1, 0, 0, PyTuple_GET_SIZE(__pyx_args)); return -1;} if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "__cinit__", 0))) return -1; __pyx_r = __pyx_pf_11pygame_sdl2_6render_8Renderer___cinit__(((struct __pyx_obj_11pygame_sdl2_6render_Renderer *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static int __pyx_pf_11pygame_sdl2_6render_8Renderer___cinit__(struct __pyx_obj_11pygame_sdl2_6render_Renderer *__pyx_v_self) { int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__cinit__", 0); /* "pygame_sdl2/render.pyx":72 * * def __cinit__(self): * self.renderer = NULL # <<<<<<<<<<<<<< * * def __dealloc__(self): */ __pyx_v_self->renderer = NULL; /* "pygame_sdl2/render.pyx":71 * cdef dict _info * * def __cinit__(self): # <<<<<<<<<<<<<< * self.renderer = NULL * */ /* function exit code */ __pyx_r = 0; __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/render.pyx":74 * self.renderer = NULL * * def __dealloc__(self): # <<<<<<<<<<<<<< * if self.renderer: * SDL_DestroyRenderer(self.renderer) */ /* Python wrapper */ static void __pyx_pw_11pygame_sdl2_6render_8Renderer_3__dealloc__(PyObject *__pyx_v_self); /*proto*/ static void __pyx_pw_11pygame_sdl2_6render_8Renderer_3__dealloc__(PyObject *__pyx_v_self) { __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__dealloc__ (wrapper)", 0); __pyx_pf_11pygame_sdl2_6render_8Renderer_2__dealloc__(((struct __pyx_obj_11pygame_sdl2_6render_Renderer *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); } static void __pyx_pf_11pygame_sdl2_6render_8Renderer_2__dealloc__(struct __pyx_obj_11pygame_sdl2_6render_Renderer *__pyx_v_self) { __Pyx_RefNannyDeclarations int __pyx_t_1; __Pyx_RefNannySetupContext("__dealloc__", 0); /* "pygame_sdl2/render.pyx":75 * * def __dealloc__(self): * if self.renderer: # <<<<<<<<<<<<<< * SDL_DestroyRenderer(self.renderer) * */ __pyx_t_1 = (__pyx_v_self->renderer != 0); if (__pyx_t_1) { /* "pygame_sdl2/render.pyx":76 * def __dealloc__(self): * if self.renderer: * SDL_DestroyRenderer(self.renderer) # <<<<<<<<<<<<<< * * def __init__(self, Window window=None, vsync=False, driver=-1): */ SDL_DestroyRenderer(__pyx_v_self->renderer); /* "pygame_sdl2/render.pyx":75 * * def __dealloc__(self): * if self.renderer: # <<<<<<<<<<<<<< * SDL_DestroyRenderer(self.renderer) * */ } /* "pygame_sdl2/render.pyx":74 * self.renderer = NULL * * def __dealloc__(self): # <<<<<<<<<<<<<< * if self.renderer: * SDL_DestroyRenderer(self.renderer) */ /* function exit code */ __Pyx_RefNannyFinishContext(); } /* "pygame_sdl2/render.pyx":78 * SDL_DestroyRenderer(self.renderer) * * def __init__(self, Window window=None, vsync=False, driver=-1): # <<<<<<<<<<<<<< * if window is None: * window = main_window */ /* Python wrapper */ static int __pyx_pw_11pygame_sdl2_6render_8Renderer_5__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static int __pyx_pw_11pygame_sdl2_6render_8Renderer_5__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { struct __pyx_obj_11pygame_sdl2_7display_Window *__pyx_v_window = 0; PyObject *__pyx_v_vsync = 0; PyObject *__pyx_v_driver = 0; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__init__ (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_window,&__pyx_n_s_vsync,&__pyx_n_s_driver,0}; PyObject* values[3] = {0,0,0}; values[0] = (PyObject *)((struct __pyx_obj_11pygame_sdl2_7display_Window *)Py_None); values[1] = ((PyObject *)Py_False); values[2] = ((PyObject *)__pyx_int_neg_1); if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (kw_args > 0) { PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_window); if (value) { values[0] = value; kw_args--; } } case 1: if (kw_args > 0) { PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_vsync); if (value) { values[1] = value; kw_args--; } } case 2: if (kw_args > 0) { PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_driver); if (value) { values[2] = value; kw_args--; } } } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__init__") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 78; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } } else { switch (PyTuple_GET_SIZE(__pyx_args)) { case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); case 0: break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_window = ((struct __pyx_obj_11pygame_sdl2_7display_Window *)values[0]); __pyx_v_vsync = values[1]; __pyx_v_driver = values[2]; } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("__init__", 0, 0, 3, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 78; __pyx_clineno = __LINE__; goto __pyx_L3_error;} __pyx_L3_error:; __Pyx_AddTraceback("pygame_sdl2.render.Renderer.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return -1; __pyx_L4_argument_unpacking_done:; if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_window), __pyx_ptype_11pygame_sdl2_7display_Window, 1, "window", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 78; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_r = __pyx_pf_11pygame_sdl2_6render_8Renderer_4__init__(((struct __pyx_obj_11pygame_sdl2_6render_Renderer *)__pyx_v_self), __pyx_v_window, __pyx_v_vsync, __pyx_v_driver); /* function exit code */ goto __pyx_L0; __pyx_L1_error:; __pyx_r = -1; __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; } static int __pyx_pf_11pygame_sdl2_6render_8Renderer_4__init__(struct __pyx_obj_11pygame_sdl2_6render_Renderer *__pyx_v_self, struct __pyx_obj_11pygame_sdl2_7display_Window *__pyx_v_window, PyObject *__pyx_v_vsync, PyObject *__pyx_v_driver) { uint32_t __pyx_v_flags; SDL_RendererInfo __pyx_v_rinfo; int __pyx_r; __Pyx_RefNannyDeclarations int __pyx_t_1; int __pyx_t_2; int __pyx_t_3; PyObject *__pyx_t_4 = NULL; PyObject *__pyx_t_5 = NULL; PyObject *__pyx_t_6 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__init__", 0); __Pyx_INCREF((PyObject *)__pyx_v_window); /* "pygame_sdl2/render.pyx":79 * * def __init__(self, Window window=None, vsync=False, driver=-1): * if window is None: # <<<<<<<<<<<<<< * window = main_window * */ __pyx_t_1 = (((PyObject *)__pyx_v_window) == Py_None); __pyx_t_2 = (__pyx_t_1 != 0); if (__pyx_t_2) { /* "pygame_sdl2/render.pyx":80 * def __init__(self, Window window=None, vsync=False, driver=-1): * if window is None: * window = main_window # <<<<<<<<<<<<<< * * cdef uint32_t flags = SDL_RENDERER_ACCELERATED */ __Pyx_INCREF(((PyObject *)__pyx_v_11pygame_sdl2_7display_main_window)); __Pyx_DECREF_SET(__pyx_v_window, __pyx_v_11pygame_sdl2_7display_main_window); /* "pygame_sdl2/render.pyx":79 * * def __init__(self, Window window=None, vsync=False, driver=-1): * if window is None: # <<<<<<<<<<<<<< * window = main_window * */ } /* "pygame_sdl2/render.pyx":82 * window = main_window * * cdef uint32_t flags = SDL_RENDERER_ACCELERATED # <<<<<<<<<<<<<< * if vsync: * flags |= SDL_RENDERER_PRESENTVSYNC */ __pyx_v_flags = SDL_RENDERER_ACCELERATED; /* "pygame_sdl2/render.pyx":83 * * cdef uint32_t flags = SDL_RENDERER_ACCELERATED * if vsync: # <<<<<<<<<<<<<< * flags |= SDL_RENDERER_PRESENTVSYNC * */ __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_v_vsync); if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 83; __pyx_clineno = __LINE__; goto __pyx_L1_error;} if (__pyx_t_2) { /* "pygame_sdl2/render.pyx":84 * cdef uint32_t flags = SDL_RENDERER_ACCELERATED * if vsync: * flags |= SDL_RENDERER_PRESENTVSYNC # <<<<<<<<<<<<<< * * self.renderer = SDL_CreateRenderer(window.window, driver, flags) */ __pyx_v_flags = (__pyx_v_flags | SDL_RENDERER_PRESENTVSYNC); /* "pygame_sdl2/render.pyx":83 * * cdef uint32_t flags = SDL_RENDERER_ACCELERATED * if vsync: # <<<<<<<<<<<<<< * flags |= SDL_RENDERER_PRESENTVSYNC * */ } /* "pygame_sdl2/render.pyx":86 * flags |= SDL_RENDERER_PRESENTVSYNC * * self.renderer = SDL_CreateRenderer(window.window, driver, flags) # <<<<<<<<<<<<<< * if self.renderer == NULL: * self.renderer = SDL_GetRenderer(window.window) */ __pyx_t_3 = __Pyx_PyInt_As_int(__pyx_v_driver); if (unlikely((__pyx_t_3 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 86; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_v_self->renderer = SDL_CreateRenderer(__pyx_v_window->window, __pyx_t_3, __pyx_v_flags); /* "pygame_sdl2/render.pyx":87 * * self.renderer = SDL_CreateRenderer(window.window, driver, flags) * if self.renderer == NULL: # <<<<<<<<<<<<<< * self.renderer = SDL_GetRenderer(window.window) * if self.renderer == NULL: */ __pyx_t_2 = ((__pyx_v_self->renderer == NULL) != 0); if (__pyx_t_2) { /* "pygame_sdl2/render.pyx":88 * self.renderer = SDL_CreateRenderer(window.window, driver, flags) * if self.renderer == NULL: * self.renderer = SDL_GetRenderer(window.window) # <<<<<<<<<<<<<< * if self.renderer == NULL: * raise error() */ __pyx_v_self->renderer = SDL_GetRenderer(__pyx_v_window->window); /* "pygame_sdl2/render.pyx":89 * if self.renderer == NULL: * self.renderer = SDL_GetRenderer(window.window) * if self.renderer == NULL: # <<<<<<<<<<<<<< * raise error() * */ __pyx_t_2 = ((__pyx_v_self->renderer == NULL) != 0); if (__pyx_t_2) { /* "pygame_sdl2/render.pyx":90 * self.renderer = SDL_GetRenderer(window.window) * if self.renderer == NULL: * raise error() # <<<<<<<<<<<<<< * * cdef SDL_RendererInfo rinfo */ __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_error); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 90; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); __pyx_t_6 = NULL; if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_5))) { __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_5); if (likely(__pyx_t_6)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5); __Pyx_INCREF(__pyx_t_6); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_5, function); } } if (__pyx_t_6) { __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_t_6); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 90; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; } else { __pyx_t_4 = __Pyx_PyObject_CallNoArg(__pyx_t_5); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 90; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_Raise(__pyx_t_4, 0, 0, 0); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; {__pyx_filename = __pyx_f[0]; __pyx_lineno = 90; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "pygame_sdl2/render.pyx":89 * if self.renderer == NULL: * self.renderer = SDL_GetRenderer(window.window) * if self.renderer == NULL: # <<<<<<<<<<<<<< * raise error() * */ } /* "pygame_sdl2/render.pyx":87 * * self.renderer = SDL_CreateRenderer(window.window, driver, flags) * if self.renderer == NULL: # <<<<<<<<<<<<<< * self.renderer = SDL_GetRenderer(window.window) * if self.renderer == NULL: */ } /* "pygame_sdl2/render.pyx":93 * * cdef SDL_RendererInfo rinfo * if SDL_GetRendererInfo(self.renderer, &rinfo) != 0: # <<<<<<<<<<<<<< * raise error() * */ __pyx_t_2 = ((SDL_GetRendererInfo(__pyx_v_self->renderer, (&__pyx_v_rinfo)) != 0) != 0); if (__pyx_t_2) { /* "pygame_sdl2/render.pyx":94 * cdef SDL_RendererInfo rinfo * if SDL_GetRendererInfo(self.renderer, &rinfo) != 0: * raise error() # <<<<<<<<<<<<<< * * self._info = rinfo_to_dict(&rinfo) */ __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_error); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 94; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); __pyx_t_6 = NULL; if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_5))) { __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_5); if (likely(__pyx_t_6)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5); __Pyx_INCREF(__pyx_t_6); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_5, function); } } if (__pyx_t_6) { __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_t_6); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 94; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; } else { __pyx_t_4 = __Pyx_PyObject_CallNoArg(__pyx_t_5); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 94; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_Raise(__pyx_t_4, 0, 0, 0); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; {__pyx_filename = __pyx_f[0]; __pyx_lineno = 94; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "pygame_sdl2/render.pyx":93 * * cdef SDL_RendererInfo rinfo * if SDL_GetRendererInfo(self.renderer, &rinfo) != 0: # <<<<<<<<<<<<<< * raise error() * */ } /* "pygame_sdl2/render.pyx":96 * raise error() * * self._info = rinfo_to_dict(&rinfo) # <<<<<<<<<<<<<< * * if not self.info()["accelerated"]: */ __pyx_t_4 = __pyx_f_11pygame_sdl2_6render_rinfo_to_dict((&__pyx_v_rinfo)); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 96; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); if (!(likely(PyDict_CheckExact(__pyx_t_4))||((__pyx_t_4) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "dict", Py_TYPE(__pyx_t_4)->tp_name), 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 96; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GIVEREF(__pyx_t_4); __Pyx_GOTREF(__pyx_v_self->_info); __Pyx_DECREF(__pyx_v_self->_info); __pyx_v_self->_info = ((PyObject*)__pyx_t_4); __pyx_t_4 = 0; /* "pygame_sdl2/render.pyx":98 * self._info = rinfo_to_dict(&rinfo) * * if not self.info()["accelerated"]: # <<<<<<<<<<<<<< * warnings.warn("Renderer is not accelerated.") * */ __pyx_t_5 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_info); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 98; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); __pyx_t_6 = NULL; if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_5))) { __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_5); if (likely(__pyx_t_6)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5); __Pyx_INCREF(__pyx_t_6); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_5, function); } } if (__pyx_t_6) { __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_t_6); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 98; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; } else { __pyx_t_4 = __Pyx_PyObject_CallNoArg(__pyx_t_5); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 98; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __pyx_t_5 = PyObject_GetItem(__pyx_t_4, __pyx_n_u_accelerated); if (unlikely(__pyx_t_5 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 98; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 98; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __pyx_t_1 = ((!__pyx_t_2) != 0); if (__pyx_t_1) { /* "pygame_sdl2/render.pyx":99 * * if not self.info()["accelerated"]: * warnings.warn("Renderer is not accelerated.") # <<<<<<<<<<<<<< * * def load_texture(self, fi): */ __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_warnings); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 99; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_warn); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 99; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_tuple_, NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 99; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; /* "pygame_sdl2/render.pyx":98 * self._info = rinfo_to_dict(&rinfo) * * if not self.info()["accelerated"]: # <<<<<<<<<<<<<< * warnings.warn("Renderer is not accelerated.") * */ } /* "pygame_sdl2/render.pyx":78 * SDL_DestroyRenderer(self.renderer) * * def __init__(self, Window window=None, vsync=False, driver=-1): # <<<<<<<<<<<<<< * if window is None: * window = main_window */ /* function exit code */ __pyx_r = 0; goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_5); __Pyx_XDECREF(__pyx_t_6); __Pyx_AddTraceback("pygame_sdl2.render.Renderer.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = -1; __pyx_L0:; __Pyx_XDECREF((PyObject *)__pyx_v_window); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/render.pyx":101 * warnings.warn("Renderer is not accelerated.") * * def load_texture(self, fi): # <<<<<<<<<<<<<< * cdef SDL_Texture *tex * cdef Texture t = Texture() */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_6render_8Renderer_7load_texture(PyObject *__pyx_v_self, PyObject *__pyx_v_fi); /*proto*/ static PyObject *__pyx_pw_11pygame_sdl2_6render_8Renderer_7load_texture(PyObject *__pyx_v_self, PyObject *__pyx_v_fi) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("load_texture (wrapper)", 0); __pyx_r = __pyx_pf_11pygame_sdl2_6render_8Renderer_6load_texture(((struct __pyx_obj_11pygame_sdl2_6render_Renderer *)__pyx_v_self), ((PyObject *)__pyx_v_fi)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_6render_8Renderer_6load_texture(struct __pyx_obj_11pygame_sdl2_6render_Renderer *__pyx_v_self, PyObject *__pyx_v_fi) { SDL_Texture *__pyx_v_tex; struct __pyx_obj_11pygame_sdl2_6render_Texture *__pyx_v_t = 0; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_t_2; int __pyx_t_3; SDL_RWops *__pyx_t_4; PyObject *__pyx_t_5 = NULL; PyObject *__pyx_t_6 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("load_texture", 0); /* "pygame_sdl2/render.pyx":103 * def load_texture(self, fi): * cdef SDL_Texture *tex * cdef Texture t = Texture() # <<<<<<<<<<<<<< * * if isinstance(fi, Surface): */ __pyx_t_1 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_11pygame_sdl2_6render_Texture), __pyx_empty_tuple, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 103; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_v_t = ((struct __pyx_obj_11pygame_sdl2_6render_Texture *)__pyx_t_1); __pyx_t_1 = 0; /* "pygame_sdl2/render.pyx":105 * cdef Texture t = Texture() * * if isinstance(fi, Surface): # <<<<<<<<<<<<<< * tex = SDL_CreateTextureFromSurface(self.renderer, (fi).surface) * else: */ __pyx_t_2 = __Pyx_TypeCheck(__pyx_v_fi, __pyx_ptype_11pygame_sdl2_7surface_Surface); __pyx_t_3 = (__pyx_t_2 != 0); if (__pyx_t_3) { /* "pygame_sdl2/render.pyx":106 * * if isinstance(fi, Surface): * tex = SDL_CreateTextureFromSurface(self.renderer, (fi).surface) # <<<<<<<<<<<<<< * else: * tex = IMG_LoadTexture_RW(self.renderer, to_rwops(fi), 1) */ __pyx_v_tex = SDL_CreateTextureFromSurface(__pyx_v_self->renderer, ((struct __pyx_obj_11pygame_sdl2_7surface_Surface *)__pyx_v_fi)->surface); /* "pygame_sdl2/render.pyx":105 * cdef Texture t = Texture() * * if isinstance(fi, Surface): # <<<<<<<<<<<<<< * tex = SDL_CreateTextureFromSurface(self.renderer, (fi).surface) * else: */ goto __pyx_L3; } /* "pygame_sdl2/render.pyx":108 * tex = SDL_CreateTextureFromSurface(self.renderer, (fi).surface) * else: * tex = IMG_LoadTexture_RW(self.renderer, to_rwops(fi), 1) # <<<<<<<<<<<<<< * * if tex == NULL: */ /*else*/ { __pyx_t_4 = __pyx_f_11pygame_sdl2_8rwobject_to_rwops(__pyx_v_fi, NULL); if (unlikely(__pyx_t_4 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 108; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_v_tex = IMG_LoadTexture_RW(__pyx_v_self->renderer, __pyx_t_4, 1); } __pyx_L3:; /* "pygame_sdl2/render.pyx":110 * tex = IMG_LoadTexture_RW(self.renderer, to_rwops(fi), 1) * * if tex == NULL: # <<<<<<<<<<<<<< * raise error() * */ __pyx_t_3 = ((__pyx_v_tex == NULL) != 0); if (__pyx_t_3) { /* "pygame_sdl2/render.pyx":111 * * if tex == NULL: * raise error() # <<<<<<<<<<<<<< * * t.set(self.renderer, tex) */ __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_error); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 111; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); __pyx_t_6 = NULL; if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_5))) { __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_5); if (likely(__pyx_t_6)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5); __Pyx_INCREF(__pyx_t_6); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_5, function); } } if (__pyx_t_6) { __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_t_6); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 111; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; } else { __pyx_t_1 = __Pyx_PyObject_CallNoArg(__pyx_t_5); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 111; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_Raise(__pyx_t_1, 0, 0, 0); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; {__pyx_filename = __pyx_f[0]; __pyx_lineno = 111; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "pygame_sdl2/render.pyx":110 * tex = IMG_LoadTexture_RW(self.renderer, to_rwops(fi), 1) * * if tex == NULL: # <<<<<<<<<<<<<< * raise error() * */ } /* "pygame_sdl2/render.pyx":113 * raise error() * * t.set(self.renderer, tex) # <<<<<<<<<<<<<< * return TextureNode(t) * */ __pyx_t_1 = ((struct __pyx_vtabstruct_11pygame_sdl2_6render_Texture *)__pyx_v_t->__pyx_vtab)->set(__pyx_v_t, __pyx_v_self->renderer, __pyx_v_tex); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 113; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "pygame_sdl2/render.pyx":114 * * t.set(self.renderer, tex) * return TextureNode(t) # <<<<<<<<<<<<<< * * def load_atlas(self, filename): */ __Pyx_XDECREF(__pyx_r); __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 114; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __Pyx_INCREF(((PyObject *)__pyx_v_t)); __Pyx_GIVEREF(((PyObject *)__pyx_v_t)); PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)__pyx_v_t)); __pyx_t_5 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_11pygame_sdl2_6render_TextureNode), __pyx_t_1, NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 114; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_r = __pyx_t_5; __pyx_t_5 = 0; goto __pyx_L0; /* "pygame_sdl2/render.pyx":101 * warnings.warn("Renderer is not accelerated.") * * def load_texture(self, fi): # <<<<<<<<<<<<<< * cdef SDL_Texture *tex * cdef Texture t = Texture() */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_5); __Pyx_XDECREF(__pyx_t_6); __Pyx_AddTraceback("pygame_sdl2.render.Renderer.load_texture", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF((PyObject *)__pyx_v_t); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/render.pyx":116 * return TextureNode(t) * * def load_atlas(self, filename): # <<<<<<<<<<<<<< * """ Loads a file in the popular JSON (Hash) format exported by * TexturePacker and other software. """ */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_6render_8Renderer_9load_atlas(PyObject *__pyx_v_self, PyObject *__pyx_v_filename); /*proto*/ static char __pyx_doc_11pygame_sdl2_6render_8Renderer_8load_atlas[] = " Loads a file in the popular JSON (Hash) format exported by\n TexturePacker and other software. "; static PyObject *__pyx_pw_11pygame_sdl2_6render_8Renderer_9load_atlas(PyObject *__pyx_v_self, PyObject *__pyx_v_filename) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("load_atlas (wrapper)", 0); __pyx_r = __pyx_pf_11pygame_sdl2_6render_8Renderer_8load_atlas(((struct __pyx_obj_11pygame_sdl2_6render_Renderer *)__pyx_v_self), ((PyObject *)__pyx_v_filename)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_6render_8Renderer_8load_atlas(struct __pyx_obj_11pygame_sdl2_6render_Renderer *__pyx_v_self, PyObject *__pyx_v_filename) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("load_atlas", 0); /* "pygame_sdl2/render.pyx":120 * TexturePacker and other software. """ * * return TextureAtlas(self, filename) # <<<<<<<<<<<<<< * * def render_present(self): */ __Pyx_XDECREF(__pyx_r); __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 120; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __Pyx_INCREF(((PyObject *)__pyx_v_self)); __Pyx_GIVEREF(((PyObject *)__pyx_v_self)); PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)__pyx_v_self)); __Pyx_INCREF(__pyx_v_filename); __Pyx_GIVEREF(__pyx_v_filename); PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_v_filename); __pyx_t_2 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_11pygame_sdl2_6render_TextureAtlas), __pyx_t_1, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 120; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; /* "pygame_sdl2/render.pyx":116 * return TextureNode(t) * * def load_atlas(self, filename): # <<<<<<<<<<<<<< * """ Loads a file in the popular JSON (Hash) format exported by * TexturePacker and other software. """ */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_AddTraceback("pygame_sdl2.render.Renderer.load_atlas", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/render.pyx":122 * return TextureAtlas(self, filename) * * def render_present(self): # <<<<<<<<<<<<<< * with nogil: * SDL_RenderPresent(self.renderer) */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_6render_8Renderer_11render_present(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/ static PyObject *__pyx_pw_11pygame_sdl2_6render_8Renderer_11render_present(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("render_present (wrapper)", 0); __pyx_r = __pyx_pf_11pygame_sdl2_6render_8Renderer_10render_present(((struct __pyx_obj_11pygame_sdl2_6render_Renderer *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_6render_8Renderer_10render_present(struct __pyx_obj_11pygame_sdl2_6render_Renderer *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("render_present", 0); /* "pygame_sdl2/render.pyx":123 * * def render_present(self): * with nogil: # <<<<<<<<<<<<<< * SDL_RenderPresent(self.renderer) * */ { #ifdef WITH_THREAD PyThreadState *_save; Py_UNBLOCK_THREADS #endif /*try:*/ { /* "pygame_sdl2/render.pyx":124 * def render_present(self): * with nogil: * SDL_RenderPresent(self.renderer) # <<<<<<<<<<<<<< * * def info(self): */ SDL_RenderPresent(__pyx_v_self->renderer); } /* "pygame_sdl2/render.pyx":123 * * def render_present(self): * with nogil: # <<<<<<<<<<<<<< * SDL_RenderPresent(self.renderer) * */ /*finally:*/ { /*normal exit:*/{ #ifdef WITH_THREAD Py_BLOCK_THREADS #endif goto __pyx_L5; } __pyx_L5:; } } /* "pygame_sdl2/render.pyx":122 * return TextureAtlas(self, filename) * * def render_present(self): # <<<<<<<<<<<<<< * with nogil: * SDL_RenderPresent(self.renderer) */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/render.pyx":126 * SDL_RenderPresent(self.renderer) * * def info(self): # <<<<<<<<<<<<<< * return self._info * */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_6render_8Renderer_13info(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/ static PyObject *__pyx_pw_11pygame_sdl2_6render_8Renderer_13info(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("info (wrapper)", 0); __pyx_r = __pyx_pf_11pygame_sdl2_6render_8Renderer_12info(((struct __pyx_obj_11pygame_sdl2_6render_Renderer *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_6render_8Renderer_12info(struct __pyx_obj_11pygame_sdl2_6render_Renderer *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("info", 0); /* "pygame_sdl2/render.pyx":127 * * def info(self): * return self._info # <<<<<<<<<<<<<< * * cdef set_drawcolor(self, col): */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(__pyx_v_self->_info); __pyx_r = __pyx_v_self->_info; goto __pyx_L0; /* "pygame_sdl2/render.pyx":126 * SDL_RenderPresent(self.renderer) * * def info(self): # <<<<<<<<<<<<<< * return self._info * */ /* function exit code */ __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/render.pyx":129 * return self._info * * cdef set_drawcolor(self, col): # <<<<<<<<<<<<<< * if not isinstance(col, Color): * col = Color(col) */ static PyObject *__pyx_f_11pygame_sdl2_6render_8Renderer_set_drawcolor(struct __pyx_obj_11pygame_sdl2_6render_Renderer *__pyx_v_self, PyObject *__pyx_v_col) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_t_2; int __pyx_t_3; PyObject *__pyx_t_4 = NULL; PyObject *__pyx_t_5 = NULL; PyObject *__pyx_t_6 = NULL; Uint8 __pyx_t_7; Uint8 __pyx_t_8; Uint8 __pyx_t_9; Uint8 __pyx_t_10; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("set_drawcolor", 0); __Pyx_INCREF(__pyx_v_col); /* "pygame_sdl2/render.pyx":130 * * cdef set_drawcolor(self, col): * if not isinstance(col, Color): # <<<<<<<<<<<<<< * col = Color(col) * SDL_SetRenderDrawColor(self.renderer, col.r, col.g, col.b, col.a) */ __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_Color); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 130; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = PyObject_IsInstance(__pyx_v_col, __pyx_t_1); if (unlikely(__pyx_t_2 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 130; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_3 = ((!(__pyx_t_2 != 0)) != 0); if (__pyx_t_3) { /* "pygame_sdl2/render.pyx":131 * cdef set_drawcolor(self, col): * if not isinstance(col, Color): * col = Color(col) # <<<<<<<<<<<<<< * SDL_SetRenderDrawColor(self.renderer, col.r, col.g, col.b, col.a) * */ __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_Color); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 131; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); __pyx_t_5 = NULL; if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_4))) { __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4); if (likely(__pyx_t_5)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4); __Pyx_INCREF(__pyx_t_5); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_4, function); } } if (!__pyx_t_5) { __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_v_col); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 131; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); } else { __pyx_t_6 = PyTuple_New(1+1); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 131; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_6); __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_5); __pyx_t_5 = NULL; __Pyx_INCREF(__pyx_v_col); __Pyx_GIVEREF(__pyx_v_col); PyTuple_SET_ITEM(__pyx_t_6, 0+1, __pyx_v_col); __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_6, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 131; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; } __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF_SET(__pyx_v_col, __pyx_t_1); __pyx_t_1 = 0; /* "pygame_sdl2/render.pyx":130 * * cdef set_drawcolor(self, col): * if not isinstance(col, Color): # <<<<<<<<<<<<<< * col = Color(col) * SDL_SetRenderDrawColor(self.renderer, col.r, col.g, col.b, col.a) */ } /* "pygame_sdl2/render.pyx":132 * if not isinstance(col, Color): * col = Color(col) * SDL_SetRenderDrawColor(self.renderer, col.r, col.g, col.b, col.a) # <<<<<<<<<<<<<< * * def clear(self, color): */ __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_col, __pyx_n_s_r); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 132; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_t_7 = __Pyx_PyInt_As_uint8_t(__pyx_t_1); if (unlikely((__pyx_t_7 == (Uint8)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 132; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_col, __pyx_n_s_g); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 132; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_t_8 = __Pyx_PyInt_As_uint8_t(__pyx_t_1); if (unlikely((__pyx_t_8 == (Uint8)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 132; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_col, __pyx_n_s_b); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 132; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_t_9 = __Pyx_PyInt_As_uint8_t(__pyx_t_1); if (unlikely((__pyx_t_9 == (Uint8)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 132; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_col, __pyx_n_s_a); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 132; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_t_10 = __Pyx_PyInt_As_uint8_t(__pyx_t_1); if (unlikely((__pyx_t_10 == (Uint8)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 132; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; SDL_SetRenderDrawColor(__pyx_v_self->renderer, __pyx_t_7, __pyx_t_8, __pyx_t_9, __pyx_t_10); /* "pygame_sdl2/render.pyx":129 * return self._info * * cdef set_drawcolor(self, col): # <<<<<<<<<<<<<< * if not isinstance(col, Color): * col = Color(col) */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_5); __Pyx_XDECREF(__pyx_t_6); __Pyx_AddTraceback("pygame_sdl2.render.Renderer.set_drawcolor", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XDECREF(__pyx_v_col); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/render.pyx":134 * SDL_SetRenderDrawColor(self.renderer, col.r, col.g, col.b, col.a) * * def clear(self, color): # <<<<<<<<<<<<<< * self.set_drawcolor(color) * SDL_RenderClear(self.renderer) */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_6render_8Renderer_15clear(PyObject *__pyx_v_self, PyObject *__pyx_v_color); /*proto*/ static PyObject *__pyx_pw_11pygame_sdl2_6render_8Renderer_15clear(PyObject *__pyx_v_self, PyObject *__pyx_v_color) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("clear (wrapper)", 0); __pyx_r = __pyx_pf_11pygame_sdl2_6render_8Renderer_14clear(((struct __pyx_obj_11pygame_sdl2_6render_Renderer *)__pyx_v_self), ((PyObject *)__pyx_v_color)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_6render_8Renderer_14clear(struct __pyx_obj_11pygame_sdl2_6render_Renderer *__pyx_v_self, PyObject *__pyx_v_color) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("clear", 0); /* "pygame_sdl2/render.pyx":135 * * def clear(self, color): * self.set_drawcolor(color) # <<<<<<<<<<<<<< * SDL_RenderClear(self.renderer) * */ __pyx_t_1 = ((struct __pyx_vtabstruct_11pygame_sdl2_6render_Renderer *)__pyx_v_self->__pyx_vtab)->set_drawcolor(__pyx_v_self, __pyx_v_color); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 135; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "pygame_sdl2/render.pyx":136 * def clear(self, color): * self.set_drawcolor(color) * SDL_RenderClear(self.renderer) # <<<<<<<<<<<<<< * * def draw_line(self, color not None, x1, y1, x2, y2): */ SDL_RenderClear(__pyx_v_self->renderer); /* "pygame_sdl2/render.pyx":134 * SDL_SetRenderDrawColor(self.renderer, col.r, col.g, col.b, col.a) * * def clear(self, color): # <<<<<<<<<<<<<< * self.set_drawcolor(color) * SDL_RenderClear(self.renderer) */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("pygame_sdl2.render.Renderer.clear", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/render.pyx":138 * SDL_RenderClear(self.renderer) * * def draw_line(self, color not None, x1, y1, x2, y2): # <<<<<<<<<<<<<< * self.set_drawcolor(color) * if SDL_RenderDrawLine(self.renderer, x1, y1, x2, y2) != 0: */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_6render_8Renderer_17draw_line(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static PyObject *__pyx_pw_11pygame_sdl2_6render_8Renderer_17draw_line(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_color = 0; PyObject *__pyx_v_x1 = 0; PyObject *__pyx_v_y1 = 0; PyObject *__pyx_v_x2 = 0; PyObject *__pyx_v_y2 = 0; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("draw_line (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_color,&__pyx_n_s_x1,&__pyx_n_s_y1,&__pyx_n_s_x2,&__pyx_n_s_y2,0}; PyObject* values[5] = {0,0,0,0,0}; if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4); case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_color)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; case 1: if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_x1)) != 0)) kw_args--; else { __Pyx_RaiseArgtupleInvalid("draw_line", 1, 5, 5, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 138; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } case 2: if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_y1)) != 0)) kw_args--; else { __Pyx_RaiseArgtupleInvalid("draw_line", 1, 5, 5, 2); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 138; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } case 3: if (likely((values[3] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_x2)) != 0)) kw_args--; else { __Pyx_RaiseArgtupleInvalid("draw_line", 1, 5, 5, 3); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 138; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } case 4: if (likely((values[4] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_y2)) != 0)) kw_args--; else { __Pyx_RaiseArgtupleInvalid("draw_line", 1, 5, 5, 4); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 138; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "draw_line") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 138; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } } else if (PyTuple_GET_SIZE(__pyx_args) != 5) { goto __pyx_L5_argtuple_error; } else { values[0] = PyTuple_GET_ITEM(__pyx_args, 0); values[1] = PyTuple_GET_ITEM(__pyx_args, 1); values[2] = PyTuple_GET_ITEM(__pyx_args, 2); values[3] = PyTuple_GET_ITEM(__pyx_args, 3); values[4] = PyTuple_GET_ITEM(__pyx_args, 4); } __pyx_v_color = values[0]; __pyx_v_x1 = values[1]; __pyx_v_y1 = values[2]; __pyx_v_x2 = values[3]; __pyx_v_y2 = values[4]; } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("draw_line", 1, 5, 5, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 138; __pyx_clineno = __LINE__; goto __pyx_L3_error;} __pyx_L3_error:; __Pyx_AddTraceback("pygame_sdl2.render.Renderer.draw_line", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; if (unlikely(((PyObject *)__pyx_v_color) == Py_None)) { PyErr_Format(PyExc_TypeError, "Argument '%.200s' must not be None", "color"); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 138; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } __pyx_r = __pyx_pf_11pygame_sdl2_6render_8Renderer_16draw_line(((struct __pyx_obj_11pygame_sdl2_6render_Renderer *)__pyx_v_self), __pyx_v_color, __pyx_v_x1, __pyx_v_y1, __pyx_v_x2, __pyx_v_y2); /* function exit code */ goto __pyx_L0; __pyx_L1_error:; __pyx_r = NULL; __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_6render_8Renderer_16draw_line(struct __pyx_obj_11pygame_sdl2_6render_Renderer *__pyx_v_self, PyObject *__pyx_v_color, PyObject *__pyx_v_x1, PyObject *__pyx_v_y1, PyObject *__pyx_v_x2, PyObject *__pyx_v_y2) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_t_2; int __pyx_t_3; int __pyx_t_4; int __pyx_t_5; int __pyx_t_6; PyObject *__pyx_t_7 = NULL; PyObject *__pyx_t_8 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("draw_line", 0); /* "pygame_sdl2/render.pyx":139 * * def draw_line(self, color not None, x1, y1, x2, y2): * self.set_drawcolor(color) # <<<<<<<<<<<<<< * if SDL_RenderDrawLine(self.renderer, x1, y1, x2, y2) != 0: * raise error() */ __pyx_t_1 = ((struct __pyx_vtabstruct_11pygame_sdl2_6render_Renderer *)__pyx_v_self->__pyx_vtab)->set_drawcolor(__pyx_v_self, __pyx_v_color); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 139; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "pygame_sdl2/render.pyx":140 * def draw_line(self, color not None, x1, y1, x2, y2): * self.set_drawcolor(color) * if SDL_RenderDrawLine(self.renderer, x1, y1, x2, y2) != 0: # <<<<<<<<<<<<<< * raise error() * */ __pyx_t_2 = __Pyx_PyInt_As_int(__pyx_v_x1); if (unlikely((__pyx_t_2 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 140; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_t_3 = __Pyx_PyInt_As_int(__pyx_v_y1); if (unlikely((__pyx_t_3 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 140; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_t_4 = __Pyx_PyInt_As_int(__pyx_v_x2); if (unlikely((__pyx_t_4 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 140; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_t_5 = __Pyx_PyInt_As_int(__pyx_v_y2); if (unlikely((__pyx_t_5 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 140; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_t_6 = ((SDL_RenderDrawLine(__pyx_v_self->renderer, __pyx_t_2, __pyx_t_3, __pyx_t_4, __pyx_t_5) != 0) != 0); if (__pyx_t_6) { /* "pygame_sdl2/render.pyx":141 * self.set_drawcolor(color) * if SDL_RenderDrawLine(self.renderer, x1, y1, x2, y2) != 0: * raise error() # <<<<<<<<<<<<<< * * def draw_point(self, color not None, x, y): */ __pyx_t_7 = __Pyx_GetModuleGlobalName(__pyx_n_s_error); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 141; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_7); __pyx_t_8 = NULL; if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_7))) { __pyx_t_8 = PyMethod_GET_SELF(__pyx_t_7); if (likely(__pyx_t_8)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_7); __Pyx_INCREF(__pyx_t_8); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_7, function); } } if (__pyx_t_8) { __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_7, __pyx_t_8); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 141; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; } else { __pyx_t_1 = __Pyx_PyObject_CallNoArg(__pyx_t_7); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 141; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_Raise(__pyx_t_1, 0, 0, 0); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; {__pyx_filename = __pyx_f[0]; __pyx_lineno = 141; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "pygame_sdl2/render.pyx":140 * def draw_line(self, color not None, x1, y1, x2, y2): * self.set_drawcolor(color) * if SDL_RenderDrawLine(self.renderer, x1, y1, x2, y2) != 0: # <<<<<<<<<<<<<< * raise error() * */ } /* "pygame_sdl2/render.pyx":138 * SDL_RenderClear(self.renderer) * * def draw_line(self, color not None, x1, y1, x2, y2): # <<<<<<<<<<<<<< * self.set_drawcolor(color) * if SDL_RenderDrawLine(self.renderer, x1, y1, x2, y2) != 0: */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_7); __Pyx_XDECREF(__pyx_t_8); __Pyx_AddTraceback("pygame_sdl2.render.Renderer.draw_line", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/render.pyx":143 * raise error() * * def draw_point(self, color not None, x, y): # <<<<<<<<<<<<<< * self.set_drawcolor(color) * SDL_RenderDrawPoint(self.renderer, x, y) */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_6render_8Renderer_19draw_point(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static PyObject *__pyx_pw_11pygame_sdl2_6render_8Renderer_19draw_point(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_color = 0; PyObject *__pyx_v_x = 0; PyObject *__pyx_v_y = 0; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("draw_point (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_color,&__pyx_n_s_x,&__pyx_n_s_y,0}; PyObject* values[3] = {0,0,0}; if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_color)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; case 1: if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_x)) != 0)) kw_args--; else { __Pyx_RaiseArgtupleInvalid("draw_point", 1, 3, 3, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 143; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } case 2: if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_y)) != 0)) kw_args--; else { __Pyx_RaiseArgtupleInvalid("draw_point", 1, 3, 3, 2); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 143; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "draw_point") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 143; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } } else if (PyTuple_GET_SIZE(__pyx_args) != 3) { goto __pyx_L5_argtuple_error; } else { values[0] = PyTuple_GET_ITEM(__pyx_args, 0); values[1] = PyTuple_GET_ITEM(__pyx_args, 1); values[2] = PyTuple_GET_ITEM(__pyx_args, 2); } __pyx_v_color = values[0]; __pyx_v_x = values[1]; __pyx_v_y = values[2]; } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("draw_point", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 143; __pyx_clineno = __LINE__; goto __pyx_L3_error;} __pyx_L3_error:; __Pyx_AddTraceback("pygame_sdl2.render.Renderer.draw_point", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; if (unlikely(((PyObject *)__pyx_v_color) == Py_None)) { PyErr_Format(PyExc_TypeError, "Argument '%.200s' must not be None", "color"); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 143; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } __pyx_r = __pyx_pf_11pygame_sdl2_6render_8Renderer_18draw_point(((struct __pyx_obj_11pygame_sdl2_6render_Renderer *)__pyx_v_self), __pyx_v_color, __pyx_v_x, __pyx_v_y); /* function exit code */ goto __pyx_L0; __pyx_L1_error:; __pyx_r = NULL; __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_6render_8Renderer_18draw_point(struct __pyx_obj_11pygame_sdl2_6render_Renderer *__pyx_v_self, PyObject *__pyx_v_color, PyObject *__pyx_v_x, PyObject *__pyx_v_y) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_t_2; int __pyx_t_3; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("draw_point", 0); /* "pygame_sdl2/render.pyx":144 * * def draw_point(self, color not None, x, y): * self.set_drawcolor(color) # <<<<<<<<<<<<<< * SDL_RenderDrawPoint(self.renderer, x, y) * */ __pyx_t_1 = ((struct __pyx_vtabstruct_11pygame_sdl2_6render_Renderer *)__pyx_v_self->__pyx_vtab)->set_drawcolor(__pyx_v_self, __pyx_v_color); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 144; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "pygame_sdl2/render.pyx":145 * def draw_point(self, color not None, x, y): * self.set_drawcolor(color) * SDL_RenderDrawPoint(self.renderer, x, y) # <<<<<<<<<<<<<< * * def draw_rect(self, color not None, rect): */ __pyx_t_2 = __Pyx_PyInt_As_int(__pyx_v_x); if (unlikely((__pyx_t_2 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 145; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_t_3 = __Pyx_PyInt_As_int(__pyx_v_y); if (unlikely((__pyx_t_3 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 145; __pyx_clineno = __LINE__; goto __pyx_L1_error;} SDL_RenderDrawPoint(__pyx_v_self->renderer, __pyx_t_2, __pyx_t_3); /* "pygame_sdl2/render.pyx":143 * raise error() * * def draw_point(self, color not None, x, y): # <<<<<<<<<<<<<< * self.set_drawcolor(color) * SDL_RenderDrawPoint(self.renderer, x, y) */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("pygame_sdl2.render.Renderer.draw_point", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/render.pyx":147 * SDL_RenderDrawPoint(self.renderer, x, y) * * def draw_rect(self, color not None, rect): # <<<<<<<<<<<<<< * cdef SDL_Rect r * to_sdl_rect(rect, &r) */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_6render_8Renderer_21draw_rect(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static PyObject *__pyx_pw_11pygame_sdl2_6render_8Renderer_21draw_rect(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_color = 0; PyObject *__pyx_v_rect = 0; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("draw_rect (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_color,&__pyx_n_s_rect,0}; PyObject* values[2] = {0,0}; if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_color)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; case 1: if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_rect)) != 0)) kw_args--; else { __Pyx_RaiseArgtupleInvalid("draw_rect", 1, 2, 2, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 147; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "draw_rect") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 147; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } } else if (PyTuple_GET_SIZE(__pyx_args) != 2) { goto __pyx_L5_argtuple_error; } else { values[0] = PyTuple_GET_ITEM(__pyx_args, 0); values[1] = PyTuple_GET_ITEM(__pyx_args, 1); } __pyx_v_color = values[0]; __pyx_v_rect = values[1]; } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("draw_rect", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 147; __pyx_clineno = __LINE__; goto __pyx_L3_error;} __pyx_L3_error:; __Pyx_AddTraceback("pygame_sdl2.render.Renderer.draw_rect", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; if (unlikely(((PyObject *)__pyx_v_color) == Py_None)) { PyErr_Format(PyExc_TypeError, "Argument '%.200s' must not be None", "color"); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 147; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } __pyx_r = __pyx_pf_11pygame_sdl2_6render_8Renderer_20draw_rect(((struct __pyx_obj_11pygame_sdl2_6render_Renderer *)__pyx_v_self), __pyx_v_color, __pyx_v_rect); /* function exit code */ goto __pyx_L0; __pyx_L1_error:; __pyx_r = NULL; __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_6render_8Renderer_20draw_rect(struct __pyx_obj_11pygame_sdl2_6render_Renderer *__pyx_v_self, PyObject *__pyx_v_color, PyObject *__pyx_v_rect) { SDL_Rect __pyx_v_r; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; PyObject *__pyx_t_2 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("draw_rect", 0); /* "pygame_sdl2/render.pyx":149 * def draw_rect(self, color not None, rect): * cdef SDL_Rect r * to_sdl_rect(rect, &r) # <<<<<<<<<<<<<< * self.set_drawcolor(color) * SDL_RenderDrawRect(self.renderer, &r) */ __pyx_t_1 = __pyx_f_11pygame_sdl2_4rect_to_sdl_rect(__pyx_v_rect, (&__pyx_v_r), NULL); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 149; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "pygame_sdl2/render.pyx":150 * cdef SDL_Rect r * to_sdl_rect(rect, &r) * self.set_drawcolor(color) # <<<<<<<<<<<<<< * SDL_RenderDrawRect(self.renderer, &r) * */ __pyx_t_2 = ((struct __pyx_vtabstruct_11pygame_sdl2_6render_Renderer *)__pyx_v_self->__pyx_vtab)->set_drawcolor(__pyx_v_self, __pyx_v_color); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 150; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "pygame_sdl2/render.pyx":151 * to_sdl_rect(rect, &r) * self.set_drawcolor(color) * SDL_RenderDrawRect(self.renderer, &r) # <<<<<<<<<<<<<< * * def fill_rect(self, color not None, rect): */ SDL_RenderDrawRect(__pyx_v_self->renderer, (&__pyx_v_r)); /* "pygame_sdl2/render.pyx":147 * SDL_RenderDrawPoint(self.renderer, x, y) * * def draw_rect(self, color not None, rect): # <<<<<<<<<<<<<< * cdef SDL_Rect r * to_sdl_rect(rect, &r) */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_AddTraceback("pygame_sdl2.render.Renderer.draw_rect", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/render.pyx":153 * SDL_RenderDrawRect(self.renderer, &r) * * def fill_rect(self, color not None, rect): # <<<<<<<<<<<<<< * cdef SDL_Rect r * to_sdl_rect(rect, &r) */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_6render_8Renderer_23fill_rect(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static PyObject *__pyx_pw_11pygame_sdl2_6render_8Renderer_23fill_rect(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_color = 0; PyObject *__pyx_v_rect = 0; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("fill_rect (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_color,&__pyx_n_s_rect,0}; PyObject* values[2] = {0,0}; if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_color)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; case 1: if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_rect)) != 0)) kw_args--; else { __Pyx_RaiseArgtupleInvalid("fill_rect", 1, 2, 2, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 153; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "fill_rect") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 153; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } } else if (PyTuple_GET_SIZE(__pyx_args) != 2) { goto __pyx_L5_argtuple_error; } else { values[0] = PyTuple_GET_ITEM(__pyx_args, 0); values[1] = PyTuple_GET_ITEM(__pyx_args, 1); } __pyx_v_color = values[0]; __pyx_v_rect = values[1]; } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("fill_rect", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 153; __pyx_clineno = __LINE__; goto __pyx_L3_error;} __pyx_L3_error:; __Pyx_AddTraceback("pygame_sdl2.render.Renderer.fill_rect", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; if (unlikely(((PyObject *)__pyx_v_color) == Py_None)) { PyErr_Format(PyExc_TypeError, "Argument '%.200s' must not be None", "color"); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 153; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } __pyx_r = __pyx_pf_11pygame_sdl2_6render_8Renderer_22fill_rect(((struct __pyx_obj_11pygame_sdl2_6render_Renderer *)__pyx_v_self), __pyx_v_color, __pyx_v_rect); /* function exit code */ goto __pyx_L0; __pyx_L1_error:; __pyx_r = NULL; __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_6render_8Renderer_22fill_rect(struct __pyx_obj_11pygame_sdl2_6render_Renderer *__pyx_v_self, PyObject *__pyx_v_color, PyObject *__pyx_v_rect) { SDL_Rect __pyx_v_r; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; PyObject *__pyx_t_2 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("fill_rect", 0); /* "pygame_sdl2/render.pyx":155 * def fill_rect(self, color not None, rect): * cdef SDL_Rect r * to_sdl_rect(rect, &r) # <<<<<<<<<<<<<< * self.set_drawcolor(color) * SDL_RenderFillRect(self.renderer, &r) */ __pyx_t_1 = __pyx_f_11pygame_sdl2_4rect_to_sdl_rect(__pyx_v_rect, (&__pyx_v_r), NULL); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 155; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "pygame_sdl2/render.pyx":156 * cdef SDL_Rect r * to_sdl_rect(rect, &r) * self.set_drawcolor(color) # <<<<<<<<<<<<<< * SDL_RenderFillRect(self.renderer, &r) * */ __pyx_t_2 = ((struct __pyx_vtabstruct_11pygame_sdl2_6render_Renderer *)__pyx_v_self->__pyx_vtab)->set_drawcolor(__pyx_v_self, __pyx_v_color); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 156; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "pygame_sdl2/render.pyx":157 * to_sdl_rect(rect, &r) * self.set_drawcolor(color) * SDL_RenderFillRect(self.renderer, &r) # <<<<<<<<<<<<<< * * def set_viewport(self, rect=None): */ SDL_RenderFillRect(__pyx_v_self->renderer, (&__pyx_v_r)); /* "pygame_sdl2/render.pyx":153 * SDL_RenderDrawRect(self.renderer, &r) * * def fill_rect(self, color not None, rect): # <<<<<<<<<<<<<< * cdef SDL_Rect r * to_sdl_rect(rect, &r) */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_AddTraceback("pygame_sdl2.render.Renderer.fill_rect", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/render.pyx":159 * SDL_RenderFillRect(self.renderer, &r) * * def set_viewport(self, rect=None): # <<<<<<<<<<<<<< * cdef SDL_Rect vprect * if rect is None: */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_6render_8Renderer_25set_viewport(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static PyObject *__pyx_pw_11pygame_sdl2_6render_8Renderer_25set_viewport(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_rect = 0; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("set_viewport (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_rect,0}; PyObject* values[1] = {0}; values[0] = ((PyObject *)Py_None); if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (kw_args > 0) { PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_rect); if (value) { values[0] = value; kw_args--; } } } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "set_viewport") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 159; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } } else { switch (PyTuple_GET_SIZE(__pyx_args)) { case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); case 0: break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_rect = values[0]; } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("set_viewport", 0, 0, 1, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 159; __pyx_clineno = __LINE__; goto __pyx_L3_error;} __pyx_L3_error:; __Pyx_AddTraceback("pygame_sdl2.render.Renderer.set_viewport", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_11pygame_sdl2_6render_8Renderer_24set_viewport(((struct __pyx_obj_11pygame_sdl2_6render_Renderer *)__pyx_v_self), __pyx_v_rect); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_6render_8Renderer_24set_viewport(struct __pyx_obj_11pygame_sdl2_6render_Renderer *__pyx_v_self, PyObject *__pyx_v_rect) { SDL_Rect __pyx_v_vprect; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; int __pyx_t_2; int __pyx_t_3; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("set_viewport", 0); /* "pygame_sdl2/render.pyx":161 * def set_viewport(self, rect=None): * cdef SDL_Rect vprect * if rect is None: # <<<<<<<<<<<<<< * SDL_RenderSetViewport(self.renderer, NULL) * else: */ __pyx_t_1 = (__pyx_v_rect == Py_None); __pyx_t_2 = (__pyx_t_1 != 0); if (__pyx_t_2) { /* "pygame_sdl2/render.pyx":162 * cdef SDL_Rect vprect * if rect is None: * SDL_RenderSetViewport(self.renderer, NULL) # <<<<<<<<<<<<<< * else: * to_sdl_rect(rect, &vprect) */ SDL_RenderSetViewport(__pyx_v_self->renderer, NULL); /* "pygame_sdl2/render.pyx":161 * def set_viewport(self, rect=None): * cdef SDL_Rect vprect * if rect is None: # <<<<<<<<<<<<<< * SDL_RenderSetViewport(self.renderer, NULL) * else: */ goto __pyx_L3; } /* "pygame_sdl2/render.pyx":164 * SDL_RenderSetViewport(self.renderer, NULL) * else: * to_sdl_rect(rect, &vprect) # <<<<<<<<<<<<<< * SDL_RenderSetViewport(self.renderer, &vprect) * */ /*else*/ { __pyx_t_3 = __pyx_f_11pygame_sdl2_4rect_to_sdl_rect(__pyx_v_rect, (&__pyx_v_vprect), NULL); if (unlikely(__pyx_t_3 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 164; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "pygame_sdl2/render.pyx":165 * else: * to_sdl_rect(rect, &vprect) * SDL_RenderSetViewport(self.renderer, &vprect) # <<<<<<<<<<<<<< * * def create_texture(self, size): */ SDL_RenderSetViewport(__pyx_v_self->renderer, (&__pyx_v_vprect)); } __pyx_L3:; /* "pygame_sdl2/render.pyx":159 * SDL_RenderFillRect(self.renderer, &r) * * def set_viewport(self, rect=None): # <<<<<<<<<<<<<< * cdef SDL_Rect vprect * if rect is None: */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("pygame_sdl2.render.Renderer.set_viewport", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/render.pyx":167 * SDL_RenderSetViewport(self.renderer, &vprect) * * def create_texture(self, size): # <<<<<<<<<<<<<< * if SDL_RenderTargetSupported(self.renderer) != SDL_TRUE: * raise error() */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_6render_8Renderer_27create_texture(PyObject *__pyx_v_self, PyObject *__pyx_v_size); /*proto*/ static PyObject *__pyx_pw_11pygame_sdl2_6render_8Renderer_27create_texture(PyObject *__pyx_v_self, PyObject *__pyx_v_size) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("create_texture (wrapper)", 0); __pyx_r = __pyx_pf_11pygame_sdl2_6render_8Renderer_26create_texture(((struct __pyx_obj_11pygame_sdl2_6render_Renderer *)__pyx_v_self), ((PyObject *)__pyx_v_size)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_6render_8Renderer_26create_texture(struct __pyx_obj_11pygame_sdl2_6render_Renderer *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v_size) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("create_texture", 0); /* "pygame_sdl2/render.pyx":168 * * def create_texture(self, size): * if SDL_RenderTargetSupported(self.renderer) != SDL_TRUE: # <<<<<<<<<<<<<< * raise error() * */ __pyx_t_1 = ((SDL_RenderTargetSupported(__pyx_v_self->renderer) != SDL_TRUE) != 0); if (__pyx_t_1) { /* "pygame_sdl2/render.pyx":169 * def create_texture(self, size): * if SDL_RenderTargetSupported(self.renderer) != SDL_TRUE: * raise error() # <<<<<<<<<<<<<< * * */ __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_error); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 169; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = NULL; if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_3))) { __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3); if (likely(__pyx_t_4)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); __Pyx_INCREF(__pyx_t_4); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_3, function); } } if (__pyx_t_4) { __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 169; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; } else { __pyx_t_2 = __Pyx_PyObject_CallNoArg(__pyx_t_3); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 169; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_Raise(__pyx_t_2, 0, 0, 0); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; {__pyx_filename = __pyx_f[0]; __pyx_lineno = 169; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "pygame_sdl2/render.pyx":168 * * def create_texture(self, size): * if SDL_RenderTargetSupported(self.renderer) != SDL_TRUE: # <<<<<<<<<<<<<< * raise error() * */ } /* "pygame_sdl2/render.pyx":167 * SDL_RenderSetViewport(self.renderer, &vprect) * * def create_texture(self, size): # <<<<<<<<<<<<<< * if SDL_RenderTargetSupported(self.renderer) != SDL_TRUE: * raise error() */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_AddTraceback("pygame_sdl2.render.Renderer.create_texture", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/render.pyx":179 * cdef public int w, h * * def __cinit__(self): # <<<<<<<<<<<<<< * self.texture = NULL * */ /* Python wrapper */ static int __pyx_pw_11pygame_sdl2_6render_7Texture_1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static int __pyx_pw_11pygame_sdl2_6render_7Texture_1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__cinit__ (wrapper)", 0); if (unlikely(PyTuple_GET_SIZE(__pyx_args) > 0)) { __Pyx_RaiseArgtupleInvalid("__cinit__", 1, 0, 0, PyTuple_GET_SIZE(__pyx_args)); return -1;} if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "__cinit__", 0))) return -1; __pyx_r = __pyx_pf_11pygame_sdl2_6render_7Texture___cinit__(((struct __pyx_obj_11pygame_sdl2_6render_Texture *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static int __pyx_pf_11pygame_sdl2_6render_7Texture___cinit__(struct __pyx_obj_11pygame_sdl2_6render_Texture *__pyx_v_self) { int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__cinit__", 0); /* "pygame_sdl2/render.pyx":180 * * def __cinit__(self): * self.texture = NULL # <<<<<<<<<<<<<< * * def __dealloc__(self): */ __pyx_v_self->texture = NULL; /* "pygame_sdl2/render.pyx":179 * cdef public int w, h * * def __cinit__(self): # <<<<<<<<<<<<<< * self.texture = NULL * */ /* function exit code */ __pyx_r = 0; __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/render.pyx":182 * self.texture = NULL * * def __dealloc__(self): # <<<<<<<<<<<<<< * if self.texture: * SDL_DestroyTexture(self.texture) */ /* Python wrapper */ static void __pyx_pw_11pygame_sdl2_6render_7Texture_3__dealloc__(PyObject *__pyx_v_self); /*proto*/ static void __pyx_pw_11pygame_sdl2_6render_7Texture_3__dealloc__(PyObject *__pyx_v_self) { __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__dealloc__ (wrapper)", 0); __pyx_pf_11pygame_sdl2_6render_7Texture_2__dealloc__(((struct __pyx_obj_11pygame_sdl2_6render_Texture *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); } static void __pyx_pf_11pygame_sdl2_6render_7Texture_2__dealloc__(struct __pyx_obj_11pygame_sdl2_6render_Texture *__pyx_v_self) { __Pyx_RefNannyDeclarations int __pyx_t_1; __Pyx_RefNannySetupContext("__dealloc__", 0); /* "pygame_sdl2/render.pyx":183 * * def __dealloc__(self): * if self.texture: # <<<<<<<<<<<<<< * SDL_DestroyTexture(self.texture) * */ __pyx_t_1 = (__pyx_v_self->texture != 0); if (__pyx_t_1) { /* "pygame_sdl2/render.pyx":184 * def __dealloc__(self): * if self.texture: * SDL_DestroyTexture(self.texture) # <<<<<<<<<<<<<< * * cdef set(self, SDL_Renderer *ren, SDL_Texture *tex): */ SDL_DestroyTexture(__pyx_v_self->texture); /* "pygame_sdl2/render.pyx":183 * * def __dealloc__(self): * if self.texture: # <<<<<<<<<<<<<< * SDL_DestroyTexture(self.texture) * */ } /* "pygame_sdl2/render.pyx":182 * self.texture = NULL * * def __dealloc__(self): # <<<<<<<<<<<<<< * if self.texture: * SDL_DestroyTexture(self.texture) */ /* function exit code */ __Pyx_RefNannyFinishContext(); } /* "pygame_sdl2/render.pyx":186 * SDL_DestroyTexture(self.texture) * * cdef set(self, SDL_Renderer *ren, SDL_Texture *tex): # <<<<<<<<<<<<<< * cdef Uint32 format * cdef int access, w, h */ static PyObject *__pyx_f_11pygame_sdl2_6render_7Texture_set(struct __pyx_obj_11pygame_sdl2_6render_Texture *__pyx_v_self, SDL_Renderer *__pyx_v_ren, SDL_Texture *__pyx_v_tex) { Uint32 __pyx_v_format; int __pyx_v_access; int __pyx_v_w; int __pyx_v_h; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("set", 0); /* "pygame_sdl2/render.pyx":190 * cdef int access, w, h * * self.renderer = ren # <<<<<<<<<<<<<< * self.texture = tex * */ __pyx_v_self->renderer = __pyx_v_ren; /* "pygame_sdl2/render.pyx":191 * * self.renderer = ren * self.texture = tex # <<<<<<<<<<<<<< * * if SDL_QueryTexture(self.texture, &format, &access, &w, &h) != 0: */ __pyx_v_self->texture = __pyx_v_tex; /* "pygame_sdl2/render.pyx":193 * self.texture = tex * * if SDL_QueryTexture(self.texture, &format, &access, &w, &h) != 0: # <<<<<<<<<<<<<< * raise error() * */ __pyx_t_1 = ((SDL_QueryTexture(__pyx_v_self->texture, (&__pyx_v_format), (&__pyx_v_access), (&__pyx_v_w), (&__pyx_v_h)) != 0) != 0); if (__pyx_t_1) { /* "pygame_sdl2/render.pyx":194 * * if SDL_QueryTexture(self.texture, &format, &access, &w, &h) != 0: * raise error() # <<<<<<<<<<<<<< * * self.w = w */ __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_error); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 194; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = NULL; if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_3))) { __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3); if (likely(__pyx_t_4)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); __Pyx_INCREF(__pyx_t_4); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_3, function); } } if (__pyx_t_4) { __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 194; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; } else { __pyx_t_2 = __Pyx_PyObject_CallNoArg(__pyx_t_3); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 194; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_Raise(__pyx_t_2, 0, 0, 0); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; {__pyx_filename = __pyx_f[0]; __pyx_lineno = 194; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "pygame_sdl2/render.pyx":193 * self.texture = tex * * if SDL_QueryTexture(self.texture, &format, &access, &w, &h) != 0: # <<<<<<<<<<<<<< * raise error() * */ } /* "pygame_sdl2/render.pyx":196 * raise error() * * self.w = w # <<<<<<<<<<<<<< * self.h = h * */ __pyx_v_self->w = __pyx_v_w; /* "pygame_sdl2/render.pyx":197 * * self.w = w * self.h = h # <<<<<<<<<<<<<< * * */ __pyx_v_self->h = __pyx_v_h; /* "pygame_sdl2/render.pyx":186 * SDL_DestroyTexture(self.texture) * * cdef set(self, SDL_Renderer *ren, SDL_Texture *tex): # <<<<<<<<<<<<<< * cdef Uint32 format * cdef int access, w, h */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_AddTraceback("pygame_sdl2.render.Texture.set", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/render.pyx":177 * cdef SDL_Renderer *renderer * cdef SDL_Texture *texture * cdef public int w, h # <<<<<<<<<<<<<< * * def __cinit__(self): */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_6render_7Texture_1w_1__get__(PyObject *__pyx_v_self); /*proto*/ static PyObject *__pyx_pw_11pygame_sdl2_6render_7Texture_1w_1__get__(PyObject *__pyx_v_self) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); __pyx_r = __pyx_pf_11pygame_sdl2_6render_7Texture_1w___get__(((struct __pyx_obj_11pygame_sdl2_6render_Texture *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_6render_7Texture_1w___get__(struct __pyx_obj_11pygame_sdl2_6render_Texture *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__get__", 0); __Pyx_XDECREF(__pyx_r); __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_self->w); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 177; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("pygame_sdl2.render.Texture.w.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* Python wrapper */ static int __pyx_pw_11pygame_sdl2_6render_7Texture_1w_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/ static int __pyx_pw_11pygame_sdl2_6render_7Texture_1w_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) { int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__set__ (wrapper)", 0); __pyx_r = __pyx_pf_11pygame_sdl2_6render_7Texture_1w_2__set__(((struct __pyx_obj_11pygame_sdl2_6render_Texture *)__pyx_v_self), ((PyObject *)__pyx_v_value)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static int __pyx_pf_11pygame_sdl2_6render_7Texture_1w_2__set__(struct __pyx_obj_11pygame_sdl2_6render_Texture *__pyx_v_self, PyObject *__pyx_v_value) { int __pyx_r; __Pyx_RefNannyDeclarations int __pyx_t_1; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__set__", 0); __pyx_t_1 = __Pyx_PyInt_As_int(__pyx_v_value); if (unlikely((__pyx_t_1 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 177; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_v_self->w = __pyx_t_1; /* function exit code */ __pyx_r = 0; goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("pygame_sdl2.render.Texture.w.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = -1; __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; } /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_6render_7Texture_1h_1__get__(PyObject *__pyx_v_self); /*proto*/ static PyObject *__pyx_pw_11pygame_sdl2_6render_7Texture_1h_1__get__(PyObject *__pyx_v_self) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); __pyx_r = __pyx_pf_11pygame_sdl2_6render_7Texture_1h___get__(((struct __pyx_obj_11pygame_sdl2_6render_Texture *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_6render_7Texture_1h___get__(struct __pyx_obj_11pygame_sdl2_6render_Texture *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__get__", 0); __Pyx_XDECREF(__pyx_r); __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_self->h); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 177; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("pygame_sdl2.render.Texture.h.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* Python wrapper */ static int __pyx_pw_11pygame_sdl2_6render_7Texture_1h_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/ static int __pyx_pw_11pygame_sdl2_6render_7Texture_1h_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) { int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__set__ (wrapper)", 0); __pyx_r = __pyx_pf_11pygame_sdl2_6render_7Texture_1h_2__set__(((struct __pyx_obj_11pygame_sdl2_6render_Texture *)__pyx_v_self), ((PyObject *)__pyx_v_value)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static int __pyx_pf_11pygame_sdl2_6render_7Texture_1h_2__set__(struct __pyx_obj_11pygame_sdl2_6render_Texture *__pyx_v_self, PyObject *__pyx_v_value) { int __pyx_r; __Pyx_RefNannyDeclarations int __pyx_t_1; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__set__", 0); __pyx_t_1 = __Pyx_PyInt_As_int(__pyx_v_value); if (unlikely((__pyx_t_1 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 177; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_v_self->h = __pyx_t_1; /* function exit code */ __pyx_r = 0; goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("pygame_sdl2.render.Texture.h.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = -1; __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/render.pyx":215 * cdef int source_h * * def __init__(self, tex): # <<<<<<<<<<<<<< * if isinstance(tex, Texture): * self.texture = tex */ /* Python wrapper */ static int __pyx_pw_11pygame_sdl2_6render_11TextureNode_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static int __pyx_pw_11pygame_sdl2_6render_11TextureNode_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_tex = 0; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__init__ (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_tex,0}; PyObject* values[1] = {0}; if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_tex)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__init__") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 215; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } } else if (PyTuple_GET_SIZE(__pyx_args) != 1) { goto __pyx_L5_argtuple_error; } else { values[0] = PyTuple_GET_ITEM(__pyx_args, 0); } __pyx_v_tex = values[0]; } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("__init__", 1, 1, 1, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 215; __pyx_clineno = __LINE__; goto __pyx_L3_error;} __pyx_L3_error:; __Pyx_AddTraceback("pygame_sdl2.render.TextureNode.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return -1; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_11pygame_sdl2_6render_11TextureNode___init__(((struct __pyx_obj_11pygame_sdl2_6render_TextureNode *)__pyx_v_self), __pyx_v_tex); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static int __pyx_pf_11pygame_sdl2_6render_11TextureNode___init__(struct __pyx_obj_11pygame_sdl2_6render_TextureNode *__pyx_v_self, PyObject *__pyx_v_tex) { int __pyx_r; __Pyx_RefNannyDeclarations int __pyx_t_1; int __pyx_t_2; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; PyObject *__pyx_t_5 = NULL; int __pyx_t_6; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__init__", 0); /* "pygame_sdl2/render.pyx":216 * * def __init__(self, tex): * if isinstance(tex, Texture): # <<<<<<<<<<<<<< * self.texture = tex * to_sdl_rect((0,0,tex.w,tex.h), &self.source_rect) */ __pyx_t_1 = __Pyx_TypeCheck(__pyx_v_tex, __pyx_ptype_11pygame_sdl2_6render_Texture); __pyx_t_2 = (__pyx_t_1 != 0); if (__pyx_t_2) { /* "pygame_sdl2/render.pyx":217 * def __init__(self, tex): * if isinstance(tex, Texture): * self.texture = tex # <<<<<<<<<<<<<< * to_sdl_rect((0,0,tex.w,tex.h), &self.source_rect) * to_sdl_rect((0,0,tex.w,tex.h), &self.trimmed_rect) */ if (!(likely(((__pyx_v_tex) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_tex, __pyx_ptype_11pygame_sdl2_6render_Texture))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 217; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_t_3 = __pyx_v_tex; __Pyx_INCREF(__pyx_t_3); __Pyx_GIVEREF(__pyx_t_3); __Pyx_GOTREF(__pyx_v_self->texture); __Pyx_DECREF(((PyObject *)__pyx_v_self->texture)); __pyx_v_self->texture = ((struct __pyx_obj_11pygame_sdl2_6render_Texture *)__pyx_t_3); __pyx_t_3 = 0; /* "pygame_sdl2/render.pyx":218 * if isinstance(tex, Texture): * self.texture = tex * to_sdl_rect((0,0,tex.w,tex.h), &self.source_rect) # <<<<<<<<<<<<<< * to_sdl_rect((0,0,tex.w,tex.h), &self.trimmed_rect) * self.source_w = tex.w */ __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_tex, __pyx_n_s_w); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 218; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_tex, __pyx_n_s_h); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 218; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); __pyx_t_5 = PyTuple_New(4); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 218; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); __Pyx_INCREF(__pyx_int_0); __Pyx_GIVEREF(__pyx_int_0); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_int_0); __Pyx_INCREF(__pyx_int_0); __Pyx_GIVEREF(__pyx_int_0); PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_int_0); __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_5, 2, __pyx_t_3); __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_5, 3, __pyx_t_4); __pyx_t_3 = 0; __pyx_t_4 = 0; __pyx_t_6 = __pyx_f_11pygame_sdl2_4rect_to_sdl_rect(__pyx_t_5, (&__pyx_v_self->source_rect), NULL); if (unlikely(__pyx_t_6 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 218; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; /* "pygame_sdl2/render.pyx":219 * self.texture = tex * to_sdl_rect((0,0,tex.w,tex.h), &self.source_rect) * to_sdl_rect((0,0,tex.w,tex.h), &self.trimmed_rect) # <<<<<<<<<<<<<< * self.source_w = tex.w * self.source_h = tex.h */ __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_tex, __pyx_n_s_w); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 219; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_tex, __pyx_n_s_h); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 219; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); __pyx_t_3 = PyTuple_New(4); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 219; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __Pyx_INCREF(__pyx_int_0); __Pyx_GIVEREF(__pyx_int_0); PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_int_0); __Pyx_INCREF(__pyx_int_0); __Pyx_GIVEREF(__pyx_int_0); PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_int_0); __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_3, 2, __pyx_t_5); __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_3, 3, __pyx_t_4); __pyx_t_5 = 0; __pyx_t_4 = 0; __pyx_t_6 = __pyx_f_11pygame_sdl2_4rect_to_sdl_rect(__pyx_t_3, (&__pyx_v_self->trimmed_rect), NULL); if (unlikely(__pyx_t_6 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 219; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "pygame_sdl2/render.pyx":220 * to_sdl_rect((0,0,tex.w,tex.h), &self.source_rect) * to_sdl_rect((0,0,tex.w,tex.h), &self.trimmed_rect) * self.source_w = tex.w # <<<<<<<<<<<<<< * self.source_h = tex.h * */ __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_tex, __pyx_n_s_w); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 220; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __pyx_t_6 = __Pyx_PyInt_As_int(__pyx_t_3); if (unlikely((__pyx_t_6 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 220; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_v_self->source_w = __pyx_t_6; /* "pygame_sdl2/render.pyx":221 * to_sdl_rect((0,0,tex.w,tex.h), &self.trimmed_rect) * self.source_w = tex.w * self.source_h = tex.h # <<<<<<<<<<<<<< * * elif isinstance(tex, TextureNode): */ __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_tex, __pyx_n_s_h); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 221; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __pyx_t_6 = __Pyx_PyInt_As_int(__pyx_t_3); if (unlikely((__pyx_t_6 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 221; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_v_self->source_h = __pyx_t_6; /* "pygame_sdl2/render.pyx":216 * * def __init__(self, tex): * if isinstance(tex, Texture): # <<<<<<<<<<<<<< * self.texture = tex * to_sdl_rect((0,0,tex.w,tex.h), &self.source_rect) */ goto __pyx_L3; } /* "pygame_sdl2/render.pyx":223 * self.source_h = tex.h * * elif isinstance(tex, TextureNode): # <<<<<<<<<<<<<< * self.texture = (tex).texture * */ __pyx_t_2 = __Pyx_TypeCheck(__pyx_v_tex, __pyx_ptype_11pygame_sdl2_6render_TextureNode); __pyx_t_1 = (__pyx_t_2 != 0); if (__pyx_t_1) { /* "pygame_sdl2/render.pyx":224 * * elif isinstance(tex, TextureNode): * self.texture = (tex).texture # <<<<<<<<<<<<<< * * else: */ __pyx_t_3 = ((PyObject *)((struct __pyx_obj_11pygame_sdl2_6render_TextureNode *)__pyx_v_tex)->texture); __Pyx_INCREF(__pyx_t_3); __Pyx_GIVEREF(__pyx_t_3); __Pyx_GOTREF(__pyx_v_self->texture); __Pyx_DECREF(((PyObject *)__pyx_v_self->texture)); __pyx_v_self->texture = ((struct __pyx_obj_11pygame_sdl2_6render_Texture *)__pyx_t_3); __pyx_t_3 = 0; /* "pygame_sdl2/render.pyx":223 * self.source_h = tex.h * * elif isinstance(tex, TextureNode): # <<<<<<<<<<<<<< * self.texture = (tex).texture * */ goto __pyx_L3; } /* "pygame_sdl2/render.pyx":227 * * else: * raise ValueError() # <<<<<<<<<<<<<< * * def render(self, dest=None): */ /*else*/ { __pyx_t_3 = __Pyx_PyObject_CallNoArg(__pyx_builtin_ValueError); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 227; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __Pyx_Raise(__pyx_t_3, 0, 0, 0); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; {__pyx_filename = __pyx_f[0]; __pyx_lineno = 227; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } __pyx_L3:; /* "pygame_sdl2/render.pyx":215 * cdef int source_h * * def __init__(self, tex): # <<<<<<<<<<<<<< * if isinstance(tex, Texture): * self.texture = tex */ /* function exit code */ __pyx_r = 0; goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_5); __Pyx_AddTraceback("pygame_sdl2.render.TextureNode.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = -1; __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/render.pyx":229 * raise ValueError() * * def render(self, dest=None): # <<<<<<<<<<<<<< * cdef SDL_Rect dest_rect * */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_6render_11TextureNode_3render(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static PyObject *__pyx_pw_11pygame_sdl2_6render_11TextureNode_3render(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_dest = 0; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("render (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_dest,0}; PyObject* values[1] = {0}; values[0] = ((PyObject *)Py_None); if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (kw_args > 0) { PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_dest); if (value) { values[0] = value; kw_args--; } } } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "render") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 229; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } } else { switch (PyTuple_GET_SIZE(__pyx_args)) { case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); case 0: break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_dest = values[0]; } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("render", 0, 0, 1, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 229; __pyx_clineno = __LINE__; goto __pyx_L3_error;} __pyx_L3_error:; __Pyx_AddTraceback("pygame_sdl2.render.TextureNode.render", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_11pygame_sdl2_6render_11TextureNode_2render(((struct __pyx_obj_11pygame_sdl2_6render_TextureNode *)__pyx_v_self), __pyx_v_dest); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_6render_11TextureNode_2render(struct __pyx_obj_11pygame_sdl2_6render_TextureNode *__pyx_v_self, PyObject *__pyx_v_dest) { SDL_Rect __pyx_v_dest_rect; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; int __pyx_t_2; int __pyx_t_3; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("render", 0); /* "pygame_sdl2/render.pyx":232 * cdef SDL_Rect dest_rect * * if dest is None: # <<<<<<<<<<<<<< * with nogil: * SDL_RenderCopy(self.texture.renderer, self.texture.texture, NULL, NULL) */ __pyx_t_1 = (__pyx_v_dest == Py_None); __pyx_t_2 = (__pyx_t_1 != 0); if (__pyx_t_2) { /* "pygame_sdl2/render.pyx":233 * * if dest is None: * with nogil: # <<<<<<<<<<<<<< * SDL_RenderCopy(self.texture.renderer, self.texture.texture, NULL, NULL) * */ { #ifdef WITH_THREAD PyThreadState *_save; Py_UNBLOCK_THREADS #endif /*try:*/ { /* "pygame_sdl2/render.pyx":234 * if dest is None: * with nogil: * SDL_RenderCopy(self.texture.renderer, self.texture.texture, NULL, NULL) # <<<<<<<<<<<<<< * * else: */ SDL_RenderCopy(__pyx_v_self->texture->renderer, __pyx_v_self->texture->texture, NULL, NULL); } /* "pygame_sdl2/render.pyx":233 * * if dest is None: * with nogil: # <<<<<<<<<<<<<< * SDL_RenderCopy(self.texture.renderer, self.texture.texture, NULL, NULL) * */ /*finally:*/ { /*normal exit:*/{ #ifdef WITH_THREAD Py_BLOCK_THREADS #endif goto __pyx_L6; } __pyx_L6:; } } /* "pygame_sdl2/render.pyx":232 * cdef SDL_Rect dest_rect * * if dest is None: # <<<<<<<<<<<<<< * with nogil: * SDL_RenderCopy(self.texture.renderer, self.texture.texture, NULL, NULL) */ goto __pyx_L3; } /* "pygame_sdl2/render.pyx":237 * * else: * to_sdl_rect(dest, &dest_rect) # <<<<<<<<<<<<<< * with nogil: * if dest_rect.w == 0 or dest_rect.h == 0: */ /*else*/ { __pyx_t_3 = __pyx_f_11pygame_sdl2_4rect_to_sdl_rect(__pyx_v_dest, (&__pyx_v_dest_rect), NULL); if (unlikely(__pyx_t_3 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 237; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "pygame_sdl2/render.pyx":238 * else: * to_sdl_rect(dest, &dest_rect) * with nogil: # <<<<<<<<<<<<<< * if dest_rect.w == 0 or dest_rect.h == 0: * dest_rect.w = self.trimmed_rect.w */ { #ifdef WITH_THREAD PyThreadState *_save; Py_UNBLOCK_THREADS #endif /*try:*/ { /* "pygame_sdl2/render.pyx":239 * to_sdl_rect(dest, &dest_rect) * with nogil: * if dest_rect.w == 0 or dest_rect.h == 0: # <<<<<<<<<<<<<< * dest_rect.w = self.trimmed_rect.w * dest_rect.h = self.trimmed_rect.h */ __pyx_t_1 = ((__pyx_v_dest_rect.w == 0) != 0); if (!__pyx_t_1) { } else { __pyx_t_2 = __pyx_t_1; goto __pyx_L11_bool_binop_done; } __pyx_t_1 = ((__pyx_v_dest_rect.h == 0) != 0); __pyx_t_2 = __pyx_t_1; __pyx_L11_bool_binop_done:; if (__pyx_t_2) { /* "pygame_sdl2/render.pyx":240 * with nogil: * if dest_rect.w == 0 or dest_rect.h == 0: * dest_rect.w = self.trimmed_rect.w # <<<<<<<<<<<<<< * dest_rect.h = self.trimmed_rect.h * SDL_RenderCopy(self.texture.renderer, self.texture.texture, NULL, &dest_rect) */ __pyx_t_3 = __pyx_v_self->trimmed_rect.w; __pyx_v_dest_rect.w = __pyx_t_3; /* "pygame_sdl2/render.pyx":241 * if dest_rect.w == 0 or dest_rect.h == 0: * dest_rect.w = self.trimmed_rect.w * dest_rect.h = self.trimmed_rect.h # <<<<<<<<<<<<<< * SDL_RenderCopy(self.texture.renderer, self.texture.texture, NULL, &dest_rect) * */ __pyx_t_3 = __pyx_v_self->trimmed_rect.h; __pyx_v_dest_rect.h = __pyx_t_3; /* "pygame_sdl2/render.pyx":239 * to_sdl_rect(dest, &dest_rect) * with nogil: * if dest_rect.w == 0 or dest_rect.h == 0: # <<<<<<<<<<<<<< * dest_rect.w = self.trimmed_rect.w * dest_rect.h = self.trimmed_rect.h */ } /* "pygame_sdl2/render.pyx":242 * dest_rect.w = self.trimmed_rect.w * dest_rect.h = self.trimmed_rect.h * SDL_RenderCopy(self.texture.renderer, self.texture.texture, NULL, &dest_rect) # <<<<<<<<<<<<<< * * */ SDL_RenderCopy(__pyx_v_self->texture->renderer, __pyx_v_self->texture->texture, NULL, (&__pyx_v_dest_rect)); } /* "pygame_sdl2/render.pyx":238 * else: * to_sdl_rect(dest, &dest_rect) * with nogil: # <<<<<<<<<<<<<< * if dest_rect.w == 0 or dest_rect.h == 0: * dest_rect.w = self.trimmed_rect.w */ /*finally:*/ { /*normal exit:*/{ #ifdef WITH_THREAD Py_BLOCK_THREADS #endif goto __pyx_L9; } __pyx_L9:; } } } __pyx_L3:; /* "pygame_sdl2/render.pyx":229 * raise ValueError() * * def render(self, dest=None): # <<<<<<<<<<<<<< * cdef SDL_Rect dest_rect * */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("pygame_sdl2.render.TextureNode.render", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/render.pyx":248 * cdef object frames * * def __init__(self, Renderer ren, fi): # <<<<<<<<<<<<<< * jdata = json.load(open(fi, "r")) * image = jdata["meta"]["image"] */ /* Python wrapper */ static int __pyx_pw_11pygame_sdl2_6render_12TextureAtlas_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static int __pyx_pw_11pygame_sdl2_6render_12TextureAtlas_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { struct __pyx_obj_11pygame_sdl2_6render_Renderer *__pyx_v_ren = 0; PyObject *__pyx_v_fi = 0; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__init__ (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_ren,&__pyx_n_s_fi,0}; PyObject* values[2] = {0,0}; if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_ren)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; case 1: if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_fi)) != 0)) kw_args--; else { __Pyx_RaiseArgtupleInvalid("__init__", 1, 2, 2, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 248; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__init__") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 248; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } } else if (PyTuple_GET_SIZE(__pyx_args) != 2) { goto __pyx_L5_argtuple_error; } else { values[0] = PyTuple_GET_ITEM(__pyx_args, 0); values[1] = PyTuple_GET_ITEM(__pyx_args, 1); } __pyx_v_ren = ((struct __pyx_obj_11pygame_sdl2_6render_Renderer *)values[0]); __pyx_v_fi = values[1]; } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("__init__", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 248; __pyx_clineno = __LINE__; goto __pyx_L3_error;} __pyx_L3_error:; __Pyx_AddTraceback("pygame_sdl2.render.TextureAtlas.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return -1; __pyx_L4_argument_unpacking_done:; if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_ren), __pyx_ptype_11pygame_sdl2_6render_Renderer, 1, "ren", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 248; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_r = __pyx_pf_11pygame_sdl2_6render_12TextureAtlas___init__(((struct __pyx_obj_11pygame_sdl2_6render_TextureAtlas *)__pyx_v_self), __pyx_v_ren, __pyx_v_fi); /* function exit code */ goto __pyx_L0; __pyx_L1_error:; __pyx_r = -1; __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; } static int __pyx_pf_11pygame_sdl2_6render_12TextureAtlas___init__(struct __pyx_obj_11pygame_sdl2_6render_TextureAtlas *__pyx_v_self, struct __pyx_obj_11pygame_sdl2_6render_Renderer *__pyx_v_ren, PyObject *__pyx_v_fi) { PyObject *__pyx_v_jdata = NULL; PyObject *__pyx_v_image = NULL; struct __pyx_obj_11pygame_sdl2_6render_TextureNode *__pyx_v_tn = 0; struct __pyx_obj_11pygame_sdl2_6render_TextureNode *__pyx_v_itex = 0; PyObject *__pyx_v_itm = NULL; PyObject *__pyx_v_iname = NULL; PyObject *__pyx_v_idict = NULL; PyObject *__pyx_v_f = NULL; int __pyx_r; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; PyObject *__pyx_t_5 = NULL; Py_ssize_t __pyx_t_6; Py_ssize_t __pyx_t_7; int __pyx_t_8; int __pyx_t_9; PyObject *(*__pyx_t_10)(PyObject *); PyObject *__pyx_t_11 = NULL; struct __pyx_opt_args_11pygame_sdl2_4rect_to_sdl_rect __pyx_t_12; int __pyx_t_13; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__init__", 0); /* "pygame_sdl2/render.pyx":249 * * def __init__(self, Renderer ren, fi): * jdata = json.load(open(fi, "r")) # <<<<<<<<<<<<<< * image = jdata["meta"]["image"] * */ __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_json); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 249; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_load); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 249; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 249; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __Pyx_INCREF(__pyx_v_fi); __Pyx_GIVEREF(__pyx_v_fi); PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_fi); __Pyx_INCREF(__pyx_n_u_r); __Pyx_GIVEREF(__pyx_n_u_r); PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_n_u_r); __pyx_t_4 = __Pyx_PyObject_Call(__pyx_builtin_open, __pyx_t_2, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 249; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_2 = NULL; if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_3))) { __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_3); if (likely(__pyx_t_2)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); __Pyx_INCREF(__pyx_t_2); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_3, function); } } if (!__pyx_t_2) { __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 249; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_GOTREF(__pyx_t_1); } else { __pyx_t_5 = PyTuple_New(1+1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 249; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); __Pyx_GIVEREF(__pyx_t_2); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_2); __pyx_t_2 = NULL; __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_5, 0+1, __pyx_t_4); __pyx_t_4 = 0; __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_5, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 249; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; } __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_v_jdata = __pyx_t_1; __pyx_t_1 = 0; /* "pygame_sdl2/render.pyx":250 * def __init__(self, Renderer ren, fi): * jdata = json.load(open(fi, "r")) * image = jdata["meta"]["image"] # <<<<<<<<<<<<<< * * cdef TextureNode tn = ren.load_texture(image) */ __pyx_t_1 = PyObject_GetItem(__pyx_v_jdata, __pyx_n_u_meta); if (unlikely(__pyx_t_1 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 250; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; __Pyx_GOTREF(__pyx_t_1); __pyx_t_3 = PyObject_GetItem(__pyx_t_1, __pyx_n_u_image); if (unlikely(__pyx_t_3 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 250; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_v_image = __pyx_t_3; __pyx_t_3 = 0; /* "pygame_sdl2/render.pyx":252 * image = jdata["meta"]["image"] * * cdef TextureNode tn = ren.load_texture(image) # <<<<<<<<<<<<<< * * self.frames = {} */ __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_ren), __pyx_n_s_load_texture); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 252; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_t_5 = NULL; if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_1))) { __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_1); if (likely(__pyx_t_5)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1); __Pyx_INCREF(__pyx_t_5); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_1, function); } } if (!__pyx_t_5) { __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_t_1, __pyx_v_image); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 252; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); } else { __pyx_t_4 = PyTuple_New(1+1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 252; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_5); __pyx_t_5 = NULL; __Pyx_INCREF(__pyx_v_image); __Pyx_GIVEREF(__pyx_v_image); PyTuple_SET_ITEM(__pyx_t_4, 0+1, __pyx_v_image); __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_4, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 252; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_ptype_11pygame_sdl2_6render_TextureNode))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 252; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_v_tn = ((struct __pyx_obj_11pygame_sdl2_6render_TextureNode *)__pyx_t_3); __pyx_t_3 = 0; /* "pygame_sdl2/render.pyx":254 * cdef TextureNode tn = ren.load_texture(image) * * self.frames = {} # <<<<<<<<<<<<<< * * cdef TextureNode itex */ __pyx_t_3 = PyDict_New(); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 254; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __Pyx_GIVEREF(__pyx_t_3); __Pyx_GOTREF(__pyx_v_self->frames); __Pyx_DECREF(__pyx_v_self->frames); __pyx_v_self->frames = __pyx_t_3; __pyx_t_3 = 0; /* "pygame_sdl2/render.pyx":257 * * cdef TextureNode itex * for itm in jdata["frames"].iteritems(): # <<<<<<<<<<<<<< * iname, idict = itm * itex = TextureNode(tn) */ __pyx_t_6 = 0; __pyx_t_1 = PyObject_GetItem(__pyx_v_jdata, __pyx_n_u_frames); if (unlikely(__pyx_t_1 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 257; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; __Pyx_GOTREF(__pyx_t_1); if (unlikely(__pyx_t_1 == Py_None)) { PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%s'", "iteritems"); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 257; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } __pyx_t_4 = __Pyx_dict_iterator(__pyx_t_1, 0, __pyx_n_s_iteritems, (&__pyx_t_7), (&__pyx_t_8)); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 257; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = __pyx_t_4; __pyx_t_4 = 0; while (1) { __pyx_t_9 = __Pyx_dict_iter_next(__pyx_t_3, __pyx_t_7, &__pyx_t_6, NULL, NULL, &__pyx_t_4, __pyx_t_8); if (unlikely(__pyx_t_9 == 0)) break; if (unlikely(__pyx_t_9 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 257; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); __Pyx_XDECREF_SET(__pyx_v_itm, __pyx_t_4); __pyx_t_4 = 0; /* "pygame_sdl2/render.pyx":258 * cdef TextureNode itex * for itm in jdata["frames"].iteritems(): * iname, idict = itm # <<<<<<<<<<<<<< * itex = TextureNode(tn) * f = idict["frame"] */ if ((likely(PyTuple_CheckExact(__pyx_v_itm))) || (PyList_CheckExact(__pyx_v_itm))) { PyObject* sequence = __pyx_v_itm; #if CYTHON_COMPILING_IN_CPYTHON Py_ssize_t size = Py_SIZE(sequence); #else Py_ssize_t size = PySequence_Size(sequence); #endif if (unlikely(size != 2)) { if (size > 2) __Pyx_RaiseTooManyValuesError(2); else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 258; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } #if CYTHON_COMPILING_IN_CPYTHON if (likely(PyTuple_CheckExact(sequence))) { __pyx_t_4 = PyTuple_GET_ITEM(sequence, 0); __pyx_t_1 = PyTuple_GET_ITEM(sequence, 1); } else { __pyx_t_4 = PyList_GET_ITEM(sequence, 0); __pyx_t_1 = PyList_GET_ITEM(sequence, 1); } __Pyx_INCREF(__pyx_t_4); __Pyx_INCREF(__pyx_t_1); #else __pyx_t_4 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 258; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); __pyx_t_1 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 258; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); #endif } else { Py_ssize_t index = -1; __pyx_t_5 = PyObject_GetIter(__pyx_v_itm); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 258; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); __pyx_t_10 = Py_TYPE(__pyx_t_5)->tp_iternext; index = 0; __pyx_t_4 = __pyx_t_10(__pyx_t_5); if (unlikely(!__pyx_t_4)) goto __pyx_L5_unpacking_failed; __Pyx_GOTREF(__pyx_t_4); index = 1; __pyx_t_1 = __pyx_t_10(__pyx_t_5); if (unlikely(!__pyx_t_1)) goto __pyx_L5_unpacking_failed; __Pyx_GOTREF(__pyx_t_1); if (__Pyx_IternextUnpackEndCheck(__pyx_t_10(__pyx_t_5), 2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 258; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_t_10 = NULL; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; goto __pyx_L6_unpacking_done; __pyx_L5_unpacking_failed:; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __pyx_t_10 = NULL; if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 258; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_L6_unpacking_done:; } __Pyx_XDECREF_SET(__pyx_v_iname, __pyx_t_4); __pyx_t_4 = 0; __Pyx_XDECREF_SET(__pyx_v_idict, __pyx_t_1); __pyx_t_1 = 0; /* "pygame_sdl2/render.pyx":259 * for itm in jdata["frames"].iteritems(): * iname, idict = itm * itex = TextureNode(tn) # <<<<<<<<<<<<<< * f = idict["frame"] * to_sdl_rect((f['x'], f['y'], f['w'], f['h']), &itex.source_rect, "frame") */ __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 259; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __Pyx_INCREF(((PyObject *)__pyx_v_tn)); __Pyx_GIVEREF(((PyObject *)__pyx_v_tn)); PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)__pyx_v_tn)); __pyx_t_4 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_11pygame_sdl2_6render_TextureNode), __pyx_t_1, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 259; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_XDECREF_SET(__pyx_v_itex, ((struct __pyx_obj_11pygame_sdl2_6render_TextureNode *)__pyx_t_4)); __pyx_t_4 = 0; /* "pygame_sdl2/render.pyx":260 * iname, idict = itm * itex = TextureNode(tn) * f = idict["frame"] # <<<<<<<<<<<<<< * to_sdl_rect((f['x'], f['y'], f['w'], f['h']), &itex.source_rect, "frame") * f = idict["spriteSourceSize"] */ __pyx_t_4 = PyObject_GetItem(__pyx_v_idict, __pyx_n_u_frame); if (unlikely(__pyx_t_4 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 260; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; __Pyx_GOTREF(__pyx_t_4); __Pyx_XDECREF_SET(__pyx_v_f, __pyx_t_4); __pyx_t_4 = 0; /* "pygame_sdl2/render.pyx":261 * itex = TextureNode(tn) * f = idict["frame"] * to_sdl_rect((f['x'], f['y'], f['w'], f['h']), &itex.source_rect, "frame") # <<<<<<<<<<<<<< * f = idict["spriteSourceSize"] * to_sdl_rect((f['x'], f['y'], f['w'], f['h']), &itex.trimmed_rect, "spriteSourceSize") */ __pyx_t_4 = PyObject_GetItem(__pyx_v_f, __pyx_n_u_x); if (unlikely(__pyx_t_4 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 261; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; __Pyx_GOTREF(__pyx_t_4); __pyx_t_1 = PyObject_GetItem(__pyx_v_f, __pyx_n_u_y); if (unlikely(__pyx_t_1 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 261; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; __Pyx_GOTREF(__pyx_t_1); __pyx_t_5 = PyObject_GetItem(__pyx_v_f, __pyx_n_u_w); if (unlikely(__pyx_t_5 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 261; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; __Pyx_GOTREF(__pyx_t_5); __pyx_t_2 = PyObject_GetItem(__pyx_v_f, __pyx_n_u_h); if (unlikely(__pyx_t_2 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 261; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; __Pyx_GOTREF(__pyx_t_2); __pyx_t_11 = PyTuple_New(4); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 261; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_11); __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_11, 0, __pyx_t_4); __Pyx_GIVEREF(__pyx_t_1); PyTuple_SET_ITEM(__pyx_t_11, 1, __pyx_t_1); __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_11, 2, __pyx_t_5); __Pyx_GIVEREF(__pyx_t_2); PyTuple_SET_ITEM(__pyx_t_11, 3, __pyx_t_2); __pyx_t_4 = 0; __pyx_t_1 = 0; __pyx_t_5 = 0; __pyx_t_2 = 0; __pyx_t_12.__pyx_n = 1; __pyx_t_12.argname = __pyx_n_u_frame; __pyx_t_9 = __pyx_f_11pygame_sdl2_4rect_to_sdl_rect(__pyx_t_11, (&__pyx_v_itex->source_rect), &__pyx_t_12); if (unlikely(__pyx_t_9 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 261; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; /* "pygame_sdl2/render.pyx":262 * f = idict["frame"] * to_sdl_rect((f['x'], f['y'], f['w'], f['h']), &itex.source_rect, "frame") * f = idict["spriteSourceSize"] # <<<<<<<<<<<<<< * to_sdl_rect((f['x'], f['y'], f['w'], f['h']), &itex.trimmed_rect, "spriteSourceSize") * if idict["rotated"]: */ __pyx_t_11 = PyObject_GetItem(__pyx_v_idict, __pyx_n_u_spriteSourceSize); if (unlikely(__pyx_t_11 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 262; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; __Pyx_GOTREF(__pyx_t_11); __Pyx_DECREF_SET(__pyx_v_f, __pyx_t_11); __pyx_t_11 = 0; /* "pygame_sdl2/render.pyx":263 * to_sdl_rect((f['x'], f['y'], f['w'], f['h']), &itex.source_rect, "frame") * f = idict["spriteSourceSize"] * to_sdl_rect((f['x'], f['y'], f['w'], f['h']), &itex.trimmed_rect, "spriteSourceSize") # <<<<<<<<<<<<<< * if idict["rotated"]: * raise error("Rotation not supported yet.") */ __pyx_t_11 = PyObject_GetItem(__pyx_v_f, __pyx_n_u_x); if (unlikely(__pyx_t_11 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 263; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; __Pyx_GOTREF(__pyx_t_11); __pyx_t_2 = PyObject_GetItem(__pyx_v_f, __pyx_n_u_y); if (unlikely(__pyx_t_2 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 263; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; __Pyx_GOTREF(__pyx_t_2); __pyx_t_5 = PyObject_GetItem(__pyx_v_f, __pyx_n_u_w); if (unlikely(__pyx_t_5 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 263; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; __Pyx_GOTREF(__pyx_t_5); __pyx_t_1 = PyObject_GetItem(__pyx_v_f, __pyx_n_u_h); if (unlikely(__pyx_t_1 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 263; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; __Pyx_GOTREF(__pyx_t_1); __pyx_t_4 = PyTuple_New(4); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 263; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); __Pyx_GIVEREF(__pyx_t_11); PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_11); __Pyx_GIVEREF(__pyx_t_2); PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_2); __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_4, 2, __pyx_t_5); __Pyx_GIVEREF(__pyx_t_1); PyTuple_SET_ITEM(__pyx_t_4, 3, __pyx_t_1); __pyx_t_11 = 0; __pyx_t_2 = 0; __pyx_t_5 = 0; __pyx_t_1 = 0; __pyx_t_12.__pyx_n = 1; __pyx_t_12.argname = __pyx_n_u_spriteSourceSize; __pyx_t_9 = __pyx_f_11pygame_sdl2_4rect_to_sdl_rect(__pyx_t_4, (&__pyx_v_itex->trimmed_rect), &__pyx_t_12); if (unlikely(__pyx_t_9 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 263; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; /* "pygame_sdl2/render.pyx":264 * f = idict["spriteSourceSize"] * to_sdl_rect((f['x'], f['y'], f['w'], f['h']), &itex.trimmed_rect, "spriteSourceSize") * if idict["rotated"]: # <<<<<<<<<<<<<< * raise error("Rotation not supported yet.") * itex.source_w = idict["sourceSize"]["w"] */ __pyx_t_4 = PyObject_GetItem(__pyx_v_idict, __pyx_n_u_rotated); if (unlikely(__pyx_t_4 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 264; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; __Pyx_GOTREF(__pyx_t_4); __pyx_t_13 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_13 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 264; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; if (__pyx_t_13) { /* "pygame_sdl2/render.pyx":265 * to_sdl_rect((f['x'], f['y'], f['w'], f['h']), &itex.trimmed_rect, "spriteSourceSize") * if idict["rotated"]: * raise error("Rotation not supported yet.") # <<<<<<<<<<<<<< * itex.source_w = idict["sourceSize"]["w"] * itex.source_h = idict["sourceSize"]["h"] */ __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_error); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 265; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_tuple__2, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 265; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_Raise(__pyx_t_1, 0, 0, 0); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; {__pyx_filename = __pyx_f[0]; __pyx_lineno = 265; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "pygame_sdl2/render.pyx":264 * f = idict["spriteSourceSize"] * to_sdl_rect((f['x'], f['y'], f['w'], f['h']), &itex.trimmed_rect, "spriteSourceSize") * if idict["rotated"]: # <<<<<<<<<<<<<< * raise error("Rotation not supported yet.") * itex.source_w = idict["sourceSize"]["w"] */ } /* "pygame_sdl2/render.pyx":266 * if idict["rotated"]: * raise error("Rotation not supported yet.") * itex.source_w = idict["sourceSize"]["w"] # <<<<<<<<<<<<<< * itex.source_h = idict["sourceSize"]["h"] * */ __pyx_t_1 = PyObject_GetItem(__pyx_v_idict, __pyx_n_u_sourceSize); if (unlikely(__pyx_t_1 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 266; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; __Pyx_GOTREF(__pyx_t_1); __pyx_t_4 = PyObject_GetItem(__pyx_t_1, __pyx_n_u_w); if (unlikely(__pyx_t_4 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 266; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_9 = __Pyx_PyInt_As_int(__pyx_t_4); if (unlikely((__pyx_t_9 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 266; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_v_itex->source_w = __pyx_t_9; /* "pygame_sdl2/render.pyx":267 * raise error("Rotation not supported yet.") * itex.source_w = idict["sourceSize"]["w"] * itex.source_h = idict["sourceSize"]["h"] # <<<<<<<<<<<<<< * * self.frames[iname] = itex */ __pyx_t_4 = PyObject_GetItem(__pyx_v_idict, __pyx_n_u_sourceSize); if (unlikely(__pyx_t_4 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 267; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; __Pyx_GOTREF(__pyx_t_4); __pyx_t_1 = PyObject_GetItem(__pyx_t_4, __pyx_n_u_h); if (unlikely(__pyx_t_1 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 267; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_t_9 = __Pyx_PyInt_As_int(__pyx_t_1); if (unlikely((__pyx_t_9 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 267; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_v_itex->source_h = __pyx_t_9; /* "pygame_sdl2/render.pyx":269 * itex.source_h = idict["sourceSize"]["h"] * * self.frames[iname] = itex # <<<<<<<<<<<<<< * * def __getitem__(self, key): */ if (unlikely(PyObject_SetItem(__pyx_v_self->frames, __pyx_v_iname, ((PyObject *)__pyx_v_itex)) < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 269; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "pygame_sdl2/render.pyx":248 * cdef object frames * * def __init__(self, Renderer ren, fi): # <<<<<<<<<<<<<< * jdata = json.load(open(fi, "r")) * image = jdata["meta"]["image"] */ /* function exit code */ __pyx_r = 0; goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_5); __Pyx_XDECREF(__pyx_t_11); __Pyx_AddTraceback("pygame_sdl2.render.TextureAtlas.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = -1; __pyx_L0:; __Pyx_XDECREF(__pyx_v_jdata); __Pyx_XDECREF(__pyx_v_image); __Pyx_XDECREF((PyObject *)__pyx_v_tn); __Pyx_XDECREF((PyObject *)__pyx_v_itex); __Pyx_XDECREF(__pyx_v_itm); __Pyx_XDECREF(__pyx_v_iname); __Pyx_XDECREF(__pyx_v_idict); __Pyx_XDECREF(__pyx_v_f); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/render.pyx":271 * self.frames[iname] = itex * * def __getitem__(self, key): # <<<<<<<<<<<<<< * return self.frames[key] * */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_6render_12TextureAtlas_3__getitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_key); /*proto*/ static PyObject *__pyx_pw_11pygame_sdl2_6render_12TextureAtlas_3__getitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_key) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__getitem__ (wrapper)", 0); __pyx_r = __pyx_pf_11pygame_sdl2_6render_12TextureAtlas_2__getitem__(((struct __pyx_obj_11pygame_sdl2_6render_TextureAtlas *)__pyx_v_self), ((PyObject *)__pyx_v_key)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_6render_12TextureAtlas_2__getitem__(struct __pyx_obj_11pygame_sdl2_6render_TextureAtlas *__pyx_v_self, PyObject *__pyx_v_key) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__getitem__", 0); /* "pygame_sdl2/render.pyx":272 * * def __getitem__(self, key): * return self.frames[key] # <<<<<<<<<<<<<< * * def keys(self): */ __Pyx_XDECREF(__pyx_r); __pyx_t_1 = PyObject_GetItem(__pyx_v_self->frames, __pyx_v_key); if (unlikely(__pyx_t_1 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 272; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "pygame_sdl2/render.pyx":271 * self.frames[iname] = itex * * def __getitem__(self, key): # <<<<<<<<<<<<<< * return self.frames[key] * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("pygame_sdl2.render.TextureAtlas.__getitem__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/render.pyx":274 * return self.frames[key] * * def keys(self): # <<<<<<<<<<<<<< * return self.frames.keys() * */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_6render_12TextureAtlas_5keys(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/ static PyObject *__pyx_pw_11pygame_sdl2_6render_12TextureAtlas_5keys(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("keys (wrapper)", 0); __pyx_r = __pyx_pf_11pygame_sdl2_6render_12TextureAtlas_4keys(((struct __pyx_obj_11pygame_sdl2_6render_TextureAtlas *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_6render_12TextureAtlas_4keys(struct __pyx_obj_11pygame_sdl2_6render_TextureAtlas *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("keys", 0); /* "pygame_sdl2/render.pyx":275 * * def keys(self): * return self.frames.keys() # <<<<<<<<<<<<<< * * */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self->frames, __pyx_n_s_keys); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 275; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = NULL; if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_2))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); if (likely(__pyx_t_3)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); } } if (__pyx_t_3) { __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 275; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } else { __pyx_t_1 = __Pyx_PyObject_CallNoArg(__pyx_t_2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 275; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "pygame_sdl2/render.pyx":274 * return self.frames[key] * * def keys(self): # <<<<<<<<<<<<<< * return self.frames.keys() * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("pygame_sdl2.render.TextureAtlas.keys", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/render.pyx":291 * cdef double _scaley * * def __init__(self, nodes): # <<<<<<<<<<<<<< * self._color.r = 255 * self._color.g = 255 */ /* Python wrapper */ static int __pyx_pw_11pygame_sdl2_6render_6Sprite_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static int __pyx_pw_11pygame_sdl2_6render_6Sprite_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_nodes = 0; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__init__ (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_nodes,0}; PyObject* values[1] = {0}; if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_nodes)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__init__") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 291; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } } else if (PyTuple_GET_SIZE(__pyx_args) != 1) { goto __pyx_L5_argtuple_error; } else { values[0] = PyTuple_GET_ITEM(__pyx_args, 0); } __pyx_v_nodes = values[0]; } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("__init__", 1, 1, 1, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 291; __pyx_clineno = __LINE__; goto __pyx_L3_error;} __pyx_L3_error:; __Pyx_AddTraceback("pygame_sdl2.render.Sprite.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return -1; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_11pygame_sdl2_6render_6Sprite___init__(((struct __pyx_obj_11pygame_sdl2_6render_Sprite *)__pyx_v_self), __pyx_v_nodes); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static int __pyx_pf_11pygame_sdl2_6render_6Sprite___init__(struct __pyx_obj_11pygame_sdl2_6render_Sprite *__pyx_v_self, PyObject *__pyx_v_nodes) { PyObject *__pyx_v_node = NULL; int __pyx_r; __Pyx_RefNannyDeclarations int __pyx_t_1; int __pyx_t_2; PyObject *__pyx_t_3 = NULL; Py_ssize_t __pyx_t_4; PyObject *(*__pyx_t_5)(PyObject *); PyObject *__pyx_t_6 = NULL; PyObject *__pyx_t_7 = NULL; int __pyx_t_8; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__init__", 0); __Pyx_INCREF(__pyx_v_nodes); /* "pygame_sdl2/render.pyx":292 * * def __init__(self, nodes): * self._color.r = 255 # <<<<<<<<<<<<<< * self._color.g = 255 * self._color.b = 255 */ __pyx_v_self->_color.r = 0xFF; /* "pygame_sdl2/render.pyx":293 * def __init__(self, nodes): * self._color.r = 255 * self._color.g = 255 # <<<<<<<<<<<<<< * self._color.b = 255 * self._color.a = 255 */ __pyx_v_self->_color.g = 0xFF; /* "pygame_sdl2/render.pyx":294 * self._color.r = 255 * self._color.g = 255 * self._color.b = 255 # <<<<<<<<<<<<<< * self._color.a = 255 * self._scalex = 1.0 */ __pyx_v_self->_color.b = 0xFF; /* "pygame_sdl2/render.pyx":295 * self._color.g = 255 * self._color.b = 255 * self._color.a = 255 # <<<<<<<<<<<<<< * self._scalex = 1.0 * self._scaley = 1.0 */ __pyx_v_self->_color.a = 0xFF; /* "pygame_sdl2/render.pyx":296 * self._color.b = 255 * self._color.a = 255 * self._scalex = 1.0 # <<<<<<<<<<<<<< * self._scaley = 1.0 * self._flip = SDL_FLIP_NONE */ __pyx_v_self->_scalex = 1.0; /* "pygame_sdl2/render.pyx":297 * self._color.a = 255 * self._scalex = 1.0 * self._scaley = 1.0 # <<<<<<<<<<<<<< * self._flip = SDL_FLIP_NONE * */ __pyx_v_self->_scaley = 1.0; /* "pygame_sdl2/render.pyx":298 * self._scalex = 1.0 * self._scaley = 1.0 * self._flip = SDL_FLIP_NONE # <<<<<<<<<<<<<< * * memset(&self._pos, 0, sizeof(SDL_Rect)) */ __pyx_v_self->_flip = SDL_FLIP_NONE; /* "pygame_sdl2/render.pyx":300 * self._flip = SDL_FLIP_NONE * * memset(&self._pos, 0, sizeof(SDL_Rect)) # <<<<<<<<<<<<<< * memset(&self.bounding_box, 0, sizeof(SDL_Rect)) * */ memset((&__pyx_v_self->_pos), 0, (sizeof(SDL_Rect))); /* "pygame_sdl2/render.pyx":301 * * memset(&self._pos, 0, sizeof(SDL_Rect)) * memset(&self.bounding_box, 0, sizeof(SDL_Rect)) # <<<<<<<<<<<<<< * * if isinstance(nodes, TextureNode): */ memset((&__pyx_v_self->bounding_box), 0, (sizeof(SDL_Rect))); /* "pygame_sdl2/render.pyx":303 * memset(&self.bounding_box, 0, sizeof(SDL_Rect)) * * if isinstance(nodes, TextureNode): # <<<<<<<<<<<<<< * nodes = [nodes] * */ __pyx_t_1 = __Pyx_TypeCheck(__pyx_v_nodes, __pyx_ptype_11pygame_sdl2_6render_TextureNode); __pyx_t_2 = (__pyx_t_1 != 0); if (__pyx_t_2) { /* "pygame_sdl2/render.pyx":304 * * if isinstance(nodes, TextureNode): * nodes = [nodes] # <<<<<<<<<<<<<< * * self.nodes = [] */ __pyx_t_3 = PyList_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 304; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __Pyx_INCREF(__pyx_v_nodes); __Pyx_GIVEREF(__pyx_v_nodes); PyList_SET_ITEM(__pyx_t_3, 0, __pyx_v_nodes); __Pyx_DECREF_SET(__pyx_v_nodes, __pyx_t_3); __pyx_t_3 = 0; /* "pygame_sdl2/render.pyx":303 * memset(&self.bounding_box, 0, sizeof(SDL_Rect)) * * if isinstance(nodes, TextureNode): # <<<<<<<<<<<<<< * nodes = [nodes] * */ } /* "pygame_sdl2/render.pyx":306 * nodes = [nodes] * * self.nodes = [] # <<<<<<<<<<<<<< * # TODO: Check that they're all from the same texture. * for node in nodes: */ __pyx_t_3 = PyList_New(0); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 306; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __Pyx_GIVEREF(__pyx_t_3); __Pyx_GOTREF(__pyx_v_self->nodes); __Pyx_DECREF(__pyx_v_self->nodes); __pyx_v_self->nodes = ((PyObject*)__pyx_t_3); __pyx_t_3 = 0; /* "pygame_sdl2/render.pyx":308 * self.nodes = [] * # TODO: Check that they're all from the same texture. * for node in nodes: # <<<<<<<<<<<<<< * if not isinstance(node, TextureNode): * raise ValueError("Invalid argument: %s" % node) */ if (likely(PyList_CheckExact(__pyx_v_nodes)) || PyTuple_CheckExact(__pyx_v_nodes)) { __pyx_t_3 = __pyx_v_nodes; __Pyx_INCREF(__pyx_t_3); __pyx_t_4 = 0; __pyx_t_5 = NULL; } else { __pyx_t_4 = -1; __pyx_t_3 = PyObject_GetIter(__pyx_v_nodes); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 308; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __pyx_t_5 = Py_TYPE(__pyx_t_3)->tp_iternext; if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 308; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } for (;;) { if (likely(!__pyx_t_5)) { if (likely(PyList_CheckExact(__pyx_t_3))) { if (__pyx_t_4 >= PyList_GET_SIZE(__pyx_t_3)) break; #if CYTHON_COMPILING_IN_CPYTHON __pyx_t_6 = PyList_GET_ITEM(__pyx_t_3, __pyx_t_4); __Pyx_INCREF(__pyx_t_6); __pyx_t_4++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 308; __pyx_clineno = __LINE__; goto __pyx_L1_error;} #else __pyx_t_6 = PySequence_ITEM(__pyx_t_3, __pyx_t_4); __pyx_t_4++; if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 308; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_6); #endif } else { if (__pyx_t_4 >= PyTuple_GET_SIZE(__pyx_t_3)) break; #if CYTHON_COMPILING_IN_CPYTHON __pyx_t_6 = PyTuple_GET_ITEM(__pyx_t_3, __pyx_t_4); __Pyx_INCREF(__pyx_t_6); __pyx_t_4++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 308; __pyx_clineno = __LINE__; goto __pyx_L1_error;} #else __pyx_t_6 = PySequence_ITEM(__pyx_t_3, __pyx_t_4); __pyx_t_4++; if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 308; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_6); #endif } } else { __pyx_t_6 = __pyx_t_5(__pyx_t_3); if (unlikely(!__pyx_t_6)) { PyObject* exc_type = PyErr_Occurred(); if (exc_type) { if (likely(exc_type == PyExc_StopIteration || PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); else {__pyx_filename = __pyx_f[0]; __pyx_lineno = 308; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } break; } __Pyx_GOTREF(__pyx_t_6); } __Pyx_XDECREF_SET(__pyx_v_node, __pyx_t_6); __pyx_t_6 = 0; /* "pygame_sdl2/render.pyx":309 * # TODO: Check that they're all from the same texture. * for node in nodes: * if not isinstance(node, TextureNode): # <<<<<<<<<<<<<< * raise ValueError("Invalid argument: %s" % node) * SDL_UnionRect(&self.bounding_box, &(node).trimmed_rect, */ __pyx_t_2 = __Pyx_TypeCheck(__pyx_v_node, __pyx_ptype_11pygame_sdl2_6render_TextureNode); __pyx_t_1 = ((!(__pyx_t_2 != 0)) != 0); if (__pyx_t_1) { /* "pygame_sdl2/render.pyx":310 * for node in nodes: * if not isinstance(node, TextureNode): * raise ValueError("Invalid argument: %s" % node) # <<<<<<<<<<<<<< * SDL_UnionRect(&self.bounding_box, &(node).trimmed_rect, * &self.bounding_box) */ __pyx_t_6 = PyUnicode_Format(__pyx_kp_u_Invalid_argument_s, __pyx_v_node); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 310; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_6); __pyx_t_7 = PyTuple_New(1); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 310; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_7); __Pyx_GIVEREF(__pyx_t_6); PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_6); __pyx_t_6 = 0; __pyx_t_6 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_t_7, NULL); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 310; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_Raise(__pyx_t_6, 0, 0, 0); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; {__pyx_filename = __pyx_f[0]; __pyx_lineno = 310; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "pygame_sdl2/render.pyx":309 * # TODO: Check that they're all from the same texture. * for node in nodes: * if not isinstance(node, TextureNode): # <<<<<<<<<<<<<< * raise ValueError("Invalid argument: %s" % node) * SDL_UnionRect(&self.bounding_box, &(node).trimmed_rect, */ } /* "pygame_sdl2/render.pyx":311 * if not isinstance(node, TextureNode): * raise ValueError("Invalid argument: %s" % node) * SDL_UnionRect(&self.bounding_box, &(node).trimmed_rect, # <<<<<<<<<<<<<< * &self.bounding_box) * self.nodes.append(node) */ SDL_UnionRect((&__pyx_v_self->bounding_box), (&((struct __pyx_obj_11pygame_sdl2_6render_TextureNode *)__pyx_v_node)->trimmed_rect), (&__pyx_v_self->bounding_box)); /* "pygame_sdl2/render.pyx":313 * SDL_UnionRect(&self.bounding_box, &(node).trimmed_rect, * &self.bounding_box) * self.nodes.append(node) # <<<<<<<<<<<<<< * * cdef void adjust_rect(Sprite self, const SDL_Rect *dest, const SDL_Rect *rin, SDL_Rect *rout) nogil: */ if (unlikely(__pyx_v_self->nodes == Py_None)) { PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%s'", "append"); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 313; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } __pyx_t_8 = __Pyx_PyList_Append(__pyx_v_self->nodes, __pyx_v_node); if (unlikely(__pyx_t_8 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 313; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "pygame_sdl2/render.pyx":308 * self.nodes = [] * # TODO: Check that they're all from the same texture. * for node in nodes: # <<<<<<<<<<<<<< * if not isinstance(node, TextureNode): * raise ValueError("Invalid argument: %s" % node) */ } __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "pygame_sdl2/render.pyx":291 * cdef double _scaley * * def __init__(self, nodes): # <<<<<<<<<<<<<< * self._color.r = 255 * self._color.g = 255 */ /* function exit code */ __pyx_r = 0; goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_6); __Pyx_XDECREF(__pyx_t_7); __Pyx_AddTraceback("pygame_sdl2.render.Sprite.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = -1; __pyx_L0:; __Pyx_XDECREF(__pyx_v_node); __Pyx_XDECREF(__pyx_v_nodes); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/render.pyx":315 * self.nodes.append(node) * * cdef void adjust_rect(Sprite self, const SDL_Rect *dest, const SDL_Rect *rin, SDL_Rect *rout) nogil: # <<<<<<<<<<<<<< * rout.x = dest.x + (self._scalex * rin.x) * rout.y = dest.y + (self._scaley * rin.y) */ static void __pyx_f_11pygame_sdl2_6render_6Sprite_adjust_rect(struct __pyx_obj_11pygame_sdl2_6render_Sprite *__pyx_v_self, SDL_Rect const *__pyx_v_dest, SDL_Rect const *__pyx_v_rin, SDL_Rect *__pyx_v_rout) { /* "pygame_sdl2/render.pyx":316 * * cdef void adjust_rect(Sprite self, const SDL_Rect *dest, const SDL_Rect *rin, SDL_Rect *rout) nogil: * rout.x = dest.x + (self._scalex * rin.x) # <<<<<<<<<<<<<< * rout.y = dest.y + (self._scaley * rin.y) * rout.w = (self._scalex * rin.w) */ __pyx_v_rout->x = (__pyx_v_dest->x + ((int)(__pyx_v_self->_scalex * __pyx_v_rin->x))); /* "pygame_sdl2/render.pyx":317 * cdef void adjust_rect(Sprite self, const SDL_Rect *dest, const SDL_Rect *rin, SDL_Rect *rout) nogil: * rout.x = dest.x + (self._scalex * rin.x) * rout.y = dest.y + (self._scaley * rin.y) # <<<<<<<<<<<<<< * rout.w = (self._scalex * rin.w) * rout.h = (self._scaley * rin.h) */ __pyx_v_rout->y = (__pyx_v_dest->y + ((int)(__pyx_v_self->_scaley * __pyx_v_rin->y))); /* "pygame_sdl2/render.pyx":318 * rout.x = dest.x + (self._scalex * rin.x) * rout.y = dest.y + (self._scaley * rin.y) * rout.w = (self._scalex * rin.w) # <<<<<<<<<<<<<< * rout.h = (self._scaley * rin.h) * */ __pyx_v_rout->w = ((int)(__pyx_v_self->_scalex * __pyx_v_rin->w)); /* "pygame_sdl2/render.pyx":319 * rout.y = dest.y + (self._scaley * rin.y) * rout.w = (self._scalex * rin.w) * rout.h = (self._scaley * rin.h) # <<<<<<<<<<<<<< * * def render(self, dest=None): */ __pyx_v_rout->h = ((int)(__pyx_v_self->_scaley * __pyx_v_rin->h)); /* "pygame_sdl2/render.pyx":315 * self.nodes.append(node) * * cdef void adjust_rect(Sprite self, const SDL_Rect *dest, const SDL_Rect *rin, SDL_Rect *rout) nogil: # <<<<<<<<<<<<<< * rout.x = dest.x + (self._scalex * rin.x) * rout.y = dest.y + (self._scaley * rin.y) */ /* function exit code */ } /* "pygame_sdl2/render.pyx":321 * rout.h = (self._scaley * rin.h) * * def render(self, dest=None): # <<<<<<<<<<<<<< * cdef Texture tex = (self.nodes[0]).texture * cdef SDL_Rect dest_rect */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_6render_6Sprite_3render(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static PyObject *__pyx_pw_11pygame_sdl2_6render_6Sprite_3render(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_dest = 0; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("render (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_dest,0}; PyObject* values[1] = {0}; values[0] = ((PyObject *)Py_None); if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (kw_args > 0) { PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_dest); if (value) { values[0] = value; kw_args--; } } } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "render") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 321; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } } else { switch (PyTuple_GET_SIZE(__pyx_args)) { case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); case 0: break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_dest = values[0]; } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("render", 0, 0, 1, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 321; __pyx_clineno = __LINE__; goto __pyx_L3_error;} __pyx_L3_error:; __Pyx_AddTraceback("pygame_sdl2.render.Sprite.render", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_11pygame_sdl2_6render_6Sprite_2render(((struct __pyx_obj_11pygame_sdl2_6render_Sprite *)__pyx_v_self), __pyx_v_dest); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_6render_6Sprite_2render(struct __pyx_obj_11pygame_sdl2_6render_Sprite *__pyx_v_self, PyObject *__pyx_v_dest) { struct __pyx_obj_11pygame_sdl2_6render_Texture *__pyx_v_tex = 0; SDL_Rect __pyx_v_dest_rect; SDL_Rect __pyx_v_real_dest; SDL_Point __pyx_v_pivot; struct __pyx_obj_11pygame_sdl2_6render_TextureNode *__pyx_v_tn = 0; PyObject *__pyx_v_x = NULL; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; int __pyx_t_3; int __pyx_t_4; int __pyx_t_5; Py_ssize_t __pyx_t_6; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("render", 0); /* "pygame_sdl2/render.pyx":322 * * def render(self, dest=None): * cdef Texture tex = (self.nodes[0]).texture # <<<<<<<<<<<<<< * cdef SDL_Rect dest_rect * cdef SDL_Rect real_dest */ if (unlikely(__pyx_v_self->nodes == Py_None)) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 322; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } __pyx_t_1 = __Pyx_GetItemInt_List(__pyx_v_self->nodes, 0, long, 1, __Pyx_PyInt_From_long, 1, 0, 1); if (unlikely(__pyx_t_1 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 322; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = ((PyObject *)((struct __pyx_obj_11pygame_sdl2_6render_TextureNode *)__pyx_t_1)->texture); __Pyx_INCREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_v_tex = ((struct __pyx_obj_11pygame_sdl2_6render_Texture *)__pyx_t_2); __pyx_t_2 = 0; /* "pygame_sdl2/render.pyx":327 * cdef SDL_Point pivot * * if dest is None: # <<<<<<<<<<<<<< * memcpy(&dest_rect, &self._pos, sizeof(SDL_Rect)) * else: */ __pyx_t_3 = (__pyx_v_dest == Py_None); __pyx_t_4 = (__pyx_t_3 != 0); if (__pyx_t_4) { /* "pygame_sdl2/render.pyx":328 * * if dest is None: * memcpy(&dest_rect, &self._pos, sizeof(SDL_Rect)) # <<<<<<<<<<<<<< * else: * to_sdl_rect(dest, &dest_rect) */ memcpy((&__pyx_v_dest_rect), (&__pyx_v_self->_pos), (sizeof(SDL_Rect))); /* "pygame_sdl2/render.pyx":327 * cdef SDL_Point pivot * * if dest is None: # <<<<<<<<<<<<<< * memcpy(&dest_rect, &self._pos, sizeof(SDL_Rect)) * else: */ goto __pyx_L3; } /* "pygame_sdl2/render.pyx":330 * memcpy(&dest_rect, &self._pos, sizeof(SDL_Rect)) * else: * to_sdl_rect(dest, &dest_rect) # <<<<<<<<<<<<<< * * with nogil: */ /*else*/ { __pyx_t_5 = __pyx_f_11pygame_sdl2_4rect_to_sdl_rect(__pyx_v_dest, (&__pyx_v_dest_rect), NULL); if (unlikely(__pyx_t_5 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 330; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } __pyx_L3:; /* "pygame_sdl2/render.pyx":332 * to_sdl_rect(dest, &dest_rect) * * with nogil: # <<<<<<<<<<<<<< * SDL_SetTextureColorMod(tex.texture, self._color.r, self._color.g, self._color.b) * SDL_SetTextureAlphaMod(tex.texture, self._color.a) */ { #ifdef WITH_THREAD PyThreadState *_save; Py_UNBLOCK_THREADS #endif /*try:*/ { /* "pygame_sdl2/render.pyx":333 * * with nogil: * SDL_SetTextureColorMod(tex.texture, self._color.r, self._color.g, self._color.b) # <<<<<<<<<<<<<< * SDL_SetTextureAlphaMod(tex.texture, self._color.a) * */ SDL_SetTextureColorMod(__pyx_v_tex->texture, __pyx_v_self->_color.r, __pyx_v_self->_color.g, __pyx_v_self->_color.b); /* "pygame_sdl2/render.pyx":334 * with nogil: * SDL_SetTextureColorMod(tex.texture, self._color.r, self._color.g, self._color.b) * SDL_SetTextureAlphaMod(tex.texture, self._color.a) # <<<<<<<<<<<<<< * * if DEBUG_DRAW_BBOX: */ SDL_SetTextureAlphaMod(__pyx_v_tex->texture, __pyx_v_self->_color.a); /* "pygame_sdl2/render.pyx":336 * SDL_SetTextureAlphaMod(tex.texture, self._color.a) * * if DEBUG_DRAW_BBOX: # <<<<<<<<<<<<<< * # TODO: Adjust for rotation. * self.adjust_rect(&dest_rect, &self.bounding_box, &real_dest) */ __pyx_t_4 = (__pyx_v_11pygame_sdl2_6render_DEBUG_DRAW_BBOX != 0); if (__pyx_t_4) { /* "pygame_sdl2/render.pyx":338 * if DEBUG_DRAW_BBOX: * # TODO: Adjust for rotation. * self.adjust_rect(&dest_rect, &self.bounding_box, &real_dest) # <<<<<<<<<<<<<< * * SDL_SetRenderDrawColor(tex.renderer, 0xFF, 0x00, 0xFF, 0xFF) */ ((struct __pyx_vtabstruct_11pygame_sdl2_6render_Sprite *)__pyx_v_self->__pyx_vtab)->adjust_rect(__pyx_v_self, (&__pyx_v_dest_rect), (&__pyx_v_self->bounding_box), (&__pyx_v_real_dest)); /* "pygame_sdl2/render.pyx":340 * self.adjust_rect(&dest_rect, &self.bounding_box, &real_dest) * * SDL_SetRenderDrawColor(tex.renderer, 0xFF, 0x00, 0xFF, 0xFF) # <<<<<<<<<<<<<< * SDL_RenderDrawRect(tex.renderer, &real_dest) * */ SDL_SetRenderDrawColor(__pyx_v_tex->renderer, 0xFF, 0x00, 0xFF, 0xFF); /* "pygame_sdl2/render.pyx":341 * * SDL_SetRenderDrawColor(tex.renderer, 0xFF, 0x00, 0xFF, 0xFF) * SDL_RenderDrawRect(tex.renderer, &real_dest) # <<<<<<<<<<<<<< * * cdef TextureNode tn */ SDL_RenderDrawRect(__pyx_v_tex->renderer, (&__pyx_v_real_dest)); /* "pygame_sdl2/render.pyx":336 * SDL_SetTextureAlphaMod(tex.texture, self._color.a) * * if DEBUG_DRAW_BBOX: # <<<<<<<<<<<<<< * # TODO: Adjust for rotation. * self.adjust_rect(&dest_rect, &self.bounding_box, &real_dest) */ } } /* "pygame_sdl2/render.pyx":332 * to_sdl_rect(dest, &dest_rect) * * with nogil: # <<<<<<<<<<<<<< * SDL_SetTextureColorMod(tex.texture, self._color.r, self._color.g, self._color.b) * SDL_SetTextureAlphaMod(tex.texture, self._color.a) */ /*finally:*/ { /*normal exit:*/{ #ifdef WITH_THREAD Py_BLOCK_THREADS #endif goto __pyx_L6; } __pyx_L6:; } } /* "pygame_sdl2/render.pyx":344 * * cdef TextureNode tn * for x in self.nodes: # <<<<<<<<<<<<<< * tn = x * */ if (unlikely(__pyx_v_self->nodes == Py_None)) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable"); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 344; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } __pyx_t_2 = __pyx_v_self->nodes; __Pyx_INCREF(__pyx_t_2); __pyx_t_6 = 0; for (;;) { if (__pyx_t_6 >= PyList_GET_SIZE(__pyx_t_2)) break; #if CYTHON_COMPILING_IN_CPYTHON __pyx_t_1 = PyList_GET_ITEM(__pyx_t_2, __pyx_t_6); __Pyx_INCREF(__pyx_t_1); __pyx_t_6++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 344; __pyx_clineno = __LINE__; goto __pyx_L1_error;} #else __pyx_t_1 = PySequence_ITEM(__pyx_t_2, __pyx_t_6); __pyx_t_6++; if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 344; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); #endif __Pyx_XDECREF_SET(__pyx_v_x, __pyx_t_1); __pyx_t_1 = 0; /* "pygame_sdl2/render.pyx":345 * cdef TextureNode tn * for x in self.nodes: * tn = x # <<<<<<<<<<<<<< * * with nogil: */ __pyx_t_1 = __pyx_v_x; __Pyx_INCREF(__pyx_t_1); __Pyx_XDECREF_SET(__pyx_v_tn, ((struct __pyx_obj_11pygame_sdl2_6render_TextureNode *)__pyx_t_1)); __pyx_t_1 = 0; /* "pygame_sdl2/render.pyx":347 * tn = x * * with nogil: # <<<<<<<<<<<<<< * pivot.x = (self._scalex * (tn.source_w / 2 - tn.trimmed_rect.x)) * pivot.y = (self._scaley * (tn.source_h / 2 - tn.trimmed_rect.y)) */ { #ifdef WITH_THREAD PyThreadState *_save; Py_UNBLOCK_THREADS #endif /*try:*/ { /* "pygame_sdl2/render.pyx":348 * * with nogil: * pivot.x = (self._scalex * (tn.source_w / 2 - tn.trimmed_rect.x)) # <<<<<<<<<<<<<< * pivot.y = (self._scaley * (tn.source_h / 2 - tn.trimmed_rect.y)) * */ __pyx_v_pivot.x = ((int)(__pyx_v_self->_scalex * ((((double)__pyx_v_tn->source_w) / 2.0) - __pyx_v_tn->trimmed_rect.x))); /* "pygame_sdl2/render.pyx":349 * with nogil: * pivot.x = (self._scalex * (tn.source_w / 2 - tn.trimmed_rect.x)) * pivot.y = (self._scaley * (tn.source_h / 2 - tn.trimmed_rect.y)) # <<<<<<<<<<<<<< * * self.adjust_rect(&dest_rect, &tn.trimmed_rect, &real_dest) */ __pyx_v_pivot.y = ((int)(__pyx_v_self->_scaley * ((((double)__pyx_v_tn->source_h) / 2.0) - __pyx_v_tn->trimmed_rect.y))); /* "pygame_sdl2/render.pyx":351 * pivot.y = (self._scaley * (tn.source_h / 2 - tn.trimmed_rect.y)) * * self.adjust_rect(&dest_rect, &tn.trimmed_rect, &real_dest) # <<<<<<<<<<<<<< * * SDL_RenderCopyEx(tex.renderer, tex.texture, &tn.source_rect, */ ((struct __pyx_vtabstruct_11pygame_sdl2_6render_Sprite *)__pyx_v_self->__pyx_vtab)->adjust_rect(__pyx_v_self, (&__pyx_v_dest_rect), (&__pyx_v_tn->trimmed_rect), (&__pyx_v_real_dest)); /* "pygame_sdl2/render.pyx":353 * self.adjust_rect(&dest_rect, &tn.trimmed_rect, &real_dest) * * SDL_RenderCopyEx(tex.renderer, tex.texture, &tn.source_rect, # <<<<<<<<<<<<<< * &real_dest, self._rotation, &pivot, * self._flip) */ SDL_RenderCopyEx(__pyx_v_tex->renderer, __pyx_v_tex->texture, (&__pyx_v_tn->source_rect), (&__pyx_v_real_dest), __pyx_v_self->_rotation, (&__pyx_v_pivot), ((SDL_RendererFlip)__pyx_v_self->_flip)); } /* "pygame_sdl2/render.pyx":347 * tn = x * * with nogil: # <<<<<<<<<<<<<< * pivot.x = (self._scalex * (tn.source_w / 2 - tn.trimmed_rect.x)) * pivot.y = (self._scaley * (tn.source_h / 2 - tn.trimmed_rect.y)) */ /*finally:*/ { /*normal exit:*/{ #ifdef WITH_THREAD Py_BLOCK_THREADS #endif goto __pyx_L14; } __pyx_L14:; } } /* "pygame_sdl2/render.pyx":344 * * cdef TextureNode tn * for x in self.nodes: # <<<<<<<<<<<<<< * tn = x * */ } __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "pygame_sdl2/render.pyx":321 * rout.h = (self._scaley * rin.h) * * def render(self, dest=None): # <<<<<<<<<<<<<< * cdef Texture tex = (self.nodes[0]).texture * cdef SDL_Rect dest_rect */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_AddTraceback("pygame_sdl2.render.Sprite.render", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF((PyObject *)__pyx_v_tex); __Pyx_XDECREF((PyObject *)__pyx_v_tn); __Pyx_XDECREF(__pyx_v_x); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/render.pyx":357 * self._flip) * * def collides(self, Sprite other not None): # <<<<<<<<<<<<<< * cdef SDL_Rect r1, r2 * */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_6render_6Sprite_5collides(PyObject *__pyx_v_self, PyObject *__pyx_v_other); /*proto*/ static PyObject *__pyx_pw_11pygame_sdl2_6render_6Sprite_5collides(PyObject *__pyx_v_self, PyObject *__pyx_v_other) { CYTHON_UNUSED int __pyx_lineno = 0; CYTHON_UNUSED const char *__pyx_filename = NULL; CYTHON_UNUSED int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("collides (wrapper)", 0); if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_other), __pyx_ptype_11pygame_sdl2_6render_Sprite, 0, "other", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 357; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_r = __pyx_pf_11pygame_sdl2_6render_6Sprite_4collides(((struct __pyx_obj_11pygame_sdl2_6render_Sprite *)__pyx_v_self), ((struct __pyx_obj_11pygame_sdl2_6render_Sprite *)__pyx_v_other)); /* function exit code */ goto __pyx_L0; __pyx_L1_error:; __pyx_r = NULL; __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_6render_6Sprite_4collides(struct __pyx_obj_11pygame_sdl2_6render_Sprite *__pyx_v_self, struct __pyx_obj_11pygame_sdl2_6render_Sprite *__pyx_v_other) { SDL_Rect __pyx_v_r1; SDL_Rect __pyx_v_r2; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("collides", 0); /* "pygame_sdl2/render.pyx":360 * cdef SDL_Rect r1, r2 * * self.adjust_rect(&self._pos, &self.bounding_box, &r1) # <<<<<<<<<<<<<< * other.adjust_rect(&other._pos, &other.bounding_box, &r2) * */ ((struct __pyx_vtabstruct_11pygame_sdl2_6render_Sprite *)__pyx_v_self->__pyx_vtab)->adjust_rect(__pyx_v_self, (&__pyx_v_self->_pos), (&__pyx_v_self->bounding_box), (&__pyx_v_r1)); /* "pygame_sdl2/render.pyx":361 * * self.adjust_rect(&self._pos, &self.bounding_box, &r1) * other.adjust_rect(&other._pos, &other.bounding_box, &r2) # <<<<<<<<<<<<<< * * return SDL_HasIntersection(&r1, &r2) == SDL_TRUE */ ((struct __pyx_vtabstruct_11pygame_sdl2_6render_Sprite *)__pyx_v_other->__pyx_vtab)->adjust_rect(__pyx_v_other, (&__pyx_v_other->_pos), (&__pyx_v_other->bounding_box), (&__pyx_v_r2)); /* "pygame_sdl2/render.pyx":363 * other.adjust_rect(&other._pos, &other.bounding_box, &r2) * * return SDL_HasIntersection(&r1, &r2) == SDL_TRUE # <<<<<<<<<<<<<< * * property pos: */ __Pyx_XDECREF(__pyx_r); __pyx_t_1 = __Pyx_PyBool_FromLong((SDL_HasIntersection((&__pyx_v_r1), (&__pyx_v_r2)) == SDL_TRUE)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 363; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "pygame_sdl2/render.pyx":357 * self._flip) * * def collides(self, Sprite other not None): # <<<<<<<<<<<<<< * cdef SDL_Rect r1, r2 * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("pygame_sdl2.render.Sprite.collides", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/render.pyx":366 * * property pos: * def __get__(self): # <<<<<<<<<<<<<< * return self._pos.x, self._pos.y * */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_6render_6Sprite_3pos_1__get__(PyObject *__pyx_v_self); /*proto*/ static PyObject *__pyx_pw_11pygame_sdl2_6render_6Sprite_3pos_1__get__(PyObject *__pyx_v_self) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); __pyx_r = __pyx_pf_11pygame_sdl2_6render_6Sprite_3pos___get__(((struct __pyx_obj_11pygame_sdl2_6render_Sprite *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_6render_6Sprite_3pos___get__(struct __pyx_obj_11pygame_sdl2_6render_Sprite *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__get__", 0); /* "pygame_sdl2/render.pyx":367 * property pos: * def __get__(self): * return self._pos.x, self._pos.y # <<<<<<<<<<<<<< * * def __set__(self, val): */ __Pyx_XDECREF(__pyx_r); __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_self->_pos.x); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 367; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_v_self->_pos.y); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 367; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 367; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __Pyx_GIVEREF(__pyx_t_1); PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_1); __Pyx_GIVEREF(__pyx_t_2); PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_2); __pyx_t_1 = 0; __pyx_t_2 = 0; __pyx_r = __pyx_t_3; __pyx_t_3 = 0; goto __pyx_L0; /* "pygame_sdl2/render.pyx":366 * * property pos: * def __get__(self): # <<<<<<<<<<<<<< * return self._pos.x, self._pos.y * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("pygame_sdl2.render.Sprite.pos.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/render.pyx":369 * return self._pos.x, self._pos.y * * def __set__(self, val): # <<<<<<<<<<<<<< * self._pos.x = val[0] * self._pos.y = val[1] */ /* Python wrapper */ static int __pyx_pw_11pygame_sdl2_6render_6Sprite_3pos_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_val); /*proto*/ static int __pyx_pw_11pygame_sdl2_6render_6Sprite_3pos_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_val) { int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__set__ (wrapper)", 0); __pyx_r = __pyx_pf_11pygame_sdl2_6render_6Sprite_3pos_2__set__(((struct __pyx_obj_11pygame_sdl2_6render_Sprite *)__pyx_v_self), ((PyObject *)__pyx_v_val)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static int __pyx_pf_11pygame_sdl2_6render_6Sprite_3pos_2__set__(struct __pyx_obj_11pygame_sdl2_6render_Sprite *__pyx_v_self, PyObject *__pyx_v_val) { int __pyx_r; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_t_2; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__set__", 0); /* "pygame_sdl2/render.pyx":370 * * def __set__(self, val): * self._pos.x = val[0] # <<<<<<<<<<<<<< * self._pos.y = val[1] * */ __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_val, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(__pyx_t_1 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 370; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = __Pyx_PyInt_As_int(__pyx_t_1); if (unlikely((__pyx_t_2 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 370; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_v_self->_pos.x = __pyx_t_2; /* "pygame_sdl2/render.pyx":371 * def __set__(self, val): * self._pos.x = val[0] * self._pos.y = val[1] # <<<<<<<<<<<<<< * * property color: */ __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_val, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(__pyx_t_1 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 371; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = __Pyx_PyInt_As_int(__pyx_t_1); if (unlikely((__pyx_t_2 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 371; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_v_self->_pos.y = __pyx_t_2; /* "pygame_sdl2/render.pyx":369 * return self._pos.x, self._pos.y * * def __set__(self, val): # <<<<<<<<<<<<<< * self._pos.x = val[0] * self._pos.y = val[1] */ /* function exit code */ __pyx_r = 0; goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("pygame_sdl2.render.Sprite.pos.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = -1; __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/render.pyx":374 * * property color: * def __set__(self, val): # <<<<<<<<<<<<<< * if not isinstance(val, Color): * val = Color(val) */ /* Python wrapper */ static int __pyx_pw_11pygame_sdl2_6render_6Sprite_5color_1__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_val); /*proto*/ static int __pyx_pw_11pygame_sdl2_6render_6Sprite_5color_1__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_val) { int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__set__ (wrapper)", 0); __pyx_r = __pyx_pf_11pygame_sdl2_6render_6Sprite_5color___set__(((struct __pyx_obj_11pygame_sdl2_6render_Sprite *)__pyx_v_self), ((PyObject *)__pyx_v_val)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static int __pyx_pf_11pygame_sdl2_6render_6Sprite_5color___set__(struct __pyx_obj_11pygame_sdl2_6render_Sprite *__pyx_v_self, PyObject *__pyx_v_val) { int __pyx_r; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_t_2; int __pyx_t_3; PyObject *__pyx_t_4 = NULL; PyObject *__pyx_t_5 = NULL; PyObject *__pyx_t_6 = NULL; Uint8 __pyx_t_7; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__set__", 0); __Pyx_INCREF(__pyx_v_val); /* "pygame_sdl2/render.pyx":375 * property color: * def __set__(self, val): * if not isinstance(val, Color): # <<<<<<<<<<<<<< * val = Color(val) * */ __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_Color); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 375; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = PyObject_IsInstance(__pyx_v_val, __pyx_t_1); if (unlikely(__pyx_t_2 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 375; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_3 = ((!(__pyx_t_2 != 0)) != 0); if (__pyx_t_3) { /* "pygame_sdl2/render.pyx":376 * def __set__(self, val): * if not isinstance(val, Color): * val = Color(val) # <<<<<<<<<<<<<< * * self._color.r = val.r */ __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_Color); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 376; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); __pyx_t_5 = NULL; if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_4))) { __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4); if (likely(__pyx_t_5)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4); __Pyx_INCREF(__pyx_t_5); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_4, function); } } if (!__pyx_t_5) { __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_v_val); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 376; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); } else { __pyx_t_6 = PyTuple_New(1+1); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 376; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_6); __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_5); __pyx_t_5 = NULL; __Pyx_INCREF(__pyx_v_val); __Pyx_GIVEREF(__pyx_v_val); PyTuple_SET_ITEM(__pyx_t_6, 0+1, __pyx_v_val); __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_6, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 376; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; } __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF_SET(__pyx_v_val, __pyx_t_1); __pyx_t_1 = 0; /* "pygame_sdl2/render.pyx":375 * property color: * def __set__(self, val): * if not isinstance(val, Color): # <<<<<<<<<<<<<< * val = Color(val) * */ } /* "pygame_sdl2/render.pyx":378 * val = Color(val) * * self._color.r = val.r # <<<<<<<<<<<<<< * self._color.g = val.g * self._color.b = val.b */ __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_val, __pyx_n_s_r); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 378; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_t_7 = __Pyx_PyInt_As_uint8_t(__pyx_t_1); if (unlikely((__pyx_t_7 == (Uint8)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 378; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_v_self->_color.r = __pyx_t_7; /* "pygame_sdl2/render.pyx":379 * * self._color.r = val.r * self._color.g = val.g # <<<<<<<<<<<<<< * self._color.b = val.b * self._color.a = val.a */ __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_val, __pyx_n_s_g); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 379; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_t_7 = __Pyx_PyInt_As_uint8_t(__pyx_t_1); if (unlikely((__pyx_t_7 == (Uint8)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 379; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_v_self->_color.g = __pyx_t_7; /* "pygame_sdl2/render.pyx":380 * self._color.r = val.r * self._color.g = val.g * self._color.b = val.b # <<<<<<<<<<<<<< * self._color.a = val.a * */ __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_val, __pyx_n_s_b); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 380; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_t_7 = __Pyx_PyInt_As_uint8_t(__pyx_t_1); if (unlikely((__pyx_t_7 == (Uint8)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 380; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_v_self->_color.b = __pyx_t_7; /* "pygame_sdl2/render.pyx":381 * self._color.g = val.g * self._color.b = val.b * self._color.a = val.a # <<<<<<<<<<<<<< * * property alpha: */ __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_val, __pyx_n_s_a); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 381; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_t_7 = __Pyx_PyInt_As_uint8_t(__pyx_t_1); if (unlikely((__pyx_t_7 == (Uint8)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 381; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_v_self->_color.a = __pyx_t_7; /* "pygame_sdl2/render.pyx":374 * * property color: * def __set__(self, val): # <<<<<<<<<<<<<< * if not isinstance(val, Color): * val = Color(val) */ /* function exit code */ __pyx_r = 0; goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_5); __Pyx_XDECREF(__pyx_t_6); __Pyx_AddTraceback("pygame_sdl2.render.Sprite.color.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = -1; __pyx_L0:; __Pyx_XDECREF(__pyx_v_val); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/render.pyx":384 * * property alpha: * def __get__(self): # <<<<<<<<<<<<<< * return self._color.a * */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_6render_6Sprite_5alpha_1__get__(PyObject *__pyx_v_self); /*proto*/ static PyObject *__pyx_pw_11pygame_sdl2_6render_6Sprite_5alpha_1__get__(PyObject *__pyx_v_self) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); __pyx_r = __pyx_pf_11pygame_sdl2_6render_6Sprite_5alpha___get__(((struct __pyx_obj_11pygame_sdl2_6render_Sprite *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_6render_6Sprite_5alpha___get__(struct __pyx_obj_11pygame_sdl2_6render_Sprite *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__get__", 0); /* "pygame_sdl2/render.pyx":385 * property alpha: * def __get__(self): * return self._color.a # <<<<<<<<<<<<<< * * def __set__(self, val): */ __Pyx_XDECREF(__pyx_r); __pyx_t_1 = __Pyx_PyInt_From_uint8_t(__pyx_v_self->_color.a); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 385; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "pygame_sdl2/render.pyx":384 * * property alpha: * def __get__(self): # <<<<<<<<<<<<<< * return self._color.a * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("pygame_sdl2.render.Sprite.alpha.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/render.pyx":387 * return self._color.a * * def __set__(self, val): # <<<<<<<<<<<<<< * self._color.a = val * */ /* Python wrapper */ static int __pyx_pw_11pygame_sdl2_6render_6Sprite_5alpha_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_val); /*proto*/ static int __pyx_pw_11pygame_sdl2_6render_6Sprite_5alpha_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_val) { int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__set__ (wrapper)", 0); __pyx_r = __pyx_pf_11pygame_sdl2_6render_6Sprite_5alpha_2__set__(((struct __pyx_obj_11pygame_sdl2_6render_Sprite *)__pyx_v_self), ((PyObject *)__pyx_v_val)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static int __pyx_pf_11pygame_sdl2_6render_6Sprite_5alpha_2__set__(struct __pyx_obj_11pygame_sdl2_6render_Sprite *__pyx_v_self, PyObject *__pyx_v_val) { int __pyx_r; __Pyx_RefNannyDeclarations Uint8 __pyx_t_1; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__set__", 0); /* "pygame_sdl2/render.pyx":388 * * def __set__(self, val): * self._color.a = val # <<<<<<<<<<<<<< * * property rotation: */ __pyx_t_1 = __Pyx_PyInt_As_uint8_t(__pyx_v_val); if (unlikely((__pyx_t_1 == (Uint8)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 388; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_v_self->_color.a = __pyx_t_1; /* "pygame_sdl2/render.pyx":387 * return self._color.a * * def __set__(self, val): # <<<<<<<<<<<<<< * self._color.a = val * */ /* function exit code */ __pyx_r = 0; goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("pygame_sdl2.render.Sprite.alpha.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = -1; __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/render.pyx":391 * * property rotation: * def __get__(self): # <<<<<<<<<<<<<< * return self._rotation * */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_6render_6Sprite_8rotation_1__get__(PyObject *__pyx_v_self); /*proto*/ static PyObject *__pyx_pw_11pygame_sdl2_6render_6Sprite_8rotation_1__get__(PyObject *__pyx_v_self) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); __pyx_r = __pyx_pf_11pygame_sdl2_6render_6Sprite_8rotation___get__(((struct __pyx_obj_11pygame_sdl2_6render_Sprite *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_6render_6Sprite_8rotation___get__(struct __pyx_obj_11pygame_sdl2_6render_Sprite *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__get__", 0); /* "pygame_sdl2/render.pyx":392 * property rotation: * def __get__(self): * return self._rotation # <<<<<<<<<<<<<< * * def __set__(self, val): */ __Pyx_XDECREF(__pyx_r); __pyx_t_1 = PyFloat_FromDouble(__pyx_v_self->_rotation); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 392; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "pygame_sdl2/render.pyx":391 * * property rotation: * def __get__(self): # <<<<<<<<<<<<<< * return self._rotation * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("pygame_sdl2.render.Sprite.rotation.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/render.pyx":394 * return self._rotation * * def __set__(self, val): # <<<<<<<<<<<<<< * self._rotation = val * */ /* Python wrapper */ static int __pyx_pw_11pygame_sdl2_6render_6Sprite_8rotation_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_val); /*proto*/ static int __pyx_pw_11pygame_sdl2_6render_6Sprite_8rotation_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_val) { int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__set__ (wrapper)", 0); __pyx_r = __pyx_pf_11pygame_sdl2_6render_6Sprite_8rotation_2__set__(((struct __pyx_obj_11pygame_sdl2_6render_Sprite *)__pyx_v_self), ((PyObject *)__pyx_v_val)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static int __pyx_pf_11pygame_sdl2_6render_6Sprite_8rotation_2__set__(struct __pyx_obj_11pygame_sdl2_6render_Sprite *__pyx_v_self, PyObject *__pyx_v_val) { int __pyx_r; __Pyx_RefNannyDeclarations double __pyx_t_1; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__set__", 0); /* "pygame_sdl2/render.pyx":395 * * def __set__(self, val): * self._rotation = val # <<<<<<<<<<<<<< * * property scale: */ __pyx_t_1 = __pyx_PyFloat_AsDouble(__pyx_v_val); if (unlikely((__pyx_t_1 == (double)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 395; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_v_self->_rotation = __pyx_t_1; /* "pygame_sdl2/render.pyx":394 * return self._rotation * * def __set__(self, val): # <<<<<<<<<<<<<< * self._rotation = val * */ /* function exit code */ __pyx_r = 0; goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("pygame_sdl2.render.Sprite.rotation.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = -1; __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/render.pyx":398 * * property scale: * def __get__(self): # <<<<<<<<<<<<<< * if self._scalex == self._scaley: * return self._scalex */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_6render_6Sprite_5scale_1__get__(PyObject *__pyx_v_self); /*proto*/ static PyObject *__pyx_pw_11pygame_sdl2_6render_6Sprite_5scale_1__get__(PyObject *__pyx_v_self) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); __pyx_r = __pyx_pf_11pygame_sdl2_6render_6Sprite_5scale___get__(((struct __pyx_obj_11pygame_sdl2_6render_Sprite *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_6render_6Sprite_5scale___get__(struct __pyx_obj_11pygame_sdl2_6render_Sprite *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__get__", 0); /* "pygame_sdl2/render.pyx":399 * property scale: * def __get__(self): * if self._scalex == self._scaley: # <<<<<<<<<<<<<< * return self._scalex * else: */ __pyx_t_1 = ((__pyx_v_self->_scalex == __pyx_v_self->_scaley) != 0); if (__pyx_t_1) { /* "pygame_sdl2/render.pyx":400 * def __get__(self): * if self._scalex == self._scaley: * return self._scalex # <<<<<<<<<<<<<< * else: * return self._scalex, self._scaley */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = PyFloat_FromDouble(__pyx_v_self->_scalex); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 400; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; /* "pygame_sdl2/render.pyx":399 * property scale: * def __get__(self): * if self._scalex == self._scaley: # <<<<<<<<<<<<<< * return self._scalex * else: */ } /* "pygame_sdl2/render.pyx":402 * return self._scalex * else: * return self._scalex, self._scaley # <<<<<<<<<<<<<< * * def __set__(self, arg): */ /*else*/ { __Pyx_XDECREF(__pyx_r); __pyx_t_2 = PyFloat_FromDouble(__pyx_v_self->_scalex); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 402; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = PyFloat_FromDouble(__pyx_v_self->_scaley); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 402; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 402; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); __Pyx_GIVEREF(__pyx_t_2); PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_2); __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_3); __pyx_t_2 = 0; __pyx_t_3 = 0; __pyx_r = __pyx_t_4; __pyx_t_4 = 0; goto __pyx_L0; } /* "pygame_sdl2/render.pyx":398 * * property scale: * def __get__(self): # <<<<<<<<<<<<<< * if self._scalex == self._scaley: * return self._scalex */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_AddTraceback("pygame_sdl2.render.Sprite.scale.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/render.pyx":404 * return self._scalex, self._scaley * * def __set__(self, arg): # <<<<<<<<<<<<<< * if type(arg) == tuple: * x, y = arg */ /* Python wrapper */ static int __pyx_pw_11pygame_sdl2_6render_6Sprite_5scale_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_arg); /*proto*/ static int __pyx_pw_11pygame_sdl2_6render_6Sprite_5scale_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_arg) { int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__set__ (wrapper)", 0); __pyx_r = __pyx_pf_11pygame_sdl2_6render_6Sprite_5scale_2__set__(((struct __pyx_obj_11pygame_sdl2_6render_Sprite *)__pyx_v_self), ((PyObject *)__pyx_v_arg)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static int __pyx_pf_11pygame_sdl2_6render_6Sprite_5scale_2__set__(struct __pyx_obj_11pygame_sdl2_6render_Sprite *__pyx_v_self, PyObject *__pyx_v_arg) { PyObject *__pyx_v_x = NULL; PyObject *__pyx_v_y = NULL; int __pyx_r; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_t_2; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; PyObject *(*__pyx_t_5)(PyObject *); double __pyx_t_6; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__set__", 0); /* "pygame_sdl2/render.pyx":405 * * def __set__(self, arg): * if type(arg) == tuple: # <<<<<<<<<<<<<< * x, y = arg * else: */ __pyx_t_1 = PyObject_RichCompare(((PyObject *)Py_TYPE(__pyx_v_arg)), ((PyObject *)(&PyTuple_Type)), Py_EQ); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 405; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 405; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (__pyx_t_2) { /* "pygame_sdl2/render.pyx":406 * def __set__(self, arg): * if type(arg) == tuple: * x, y = arg # <<<<<<<<<<<<<< * else: * x = y = arg */ if ((likely(PyTuple_CheckExact(__pyx_v_arg))) || (PyList_CheckExact(__pyx_v_arg))) { PyObject* sequence = __pyx_v_arg; #if CYTHON_COMPILING_IN_CPYTHON Py_ssize_t size = Py_SIZE(sequence); #else Py_ssize_t size = PySequence_Size(sequence); #endif if (unlikely(size != 2)) { if (size > 2) __Pyx_RaiseTooManyValuesError(2); else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 406; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } #if CYTHON_COMPILING_IN_CPYTHON if (likely(PyTuple_CheckExact(sequence))) { __pyx_t_1 = PyTuple_GET_ITEM(sequence, 0); __pyx_t_3 = PyTuple_GET_ITEM(sequence, 1); } else { __pyx_t_1 = PyList_GET_ITEM(sequence, 0); __pyx_t_3 = PyList_GET_ITEM(sequence, 1); } __Pyx_INCREF(__pyx_t_1); __Pyx_INCREF(__pyx_t_3); #else __pyx_t_1 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 406; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_t_3 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 406; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); #endif } else { Py_ssize_t index = -1; __pyx_t_4 = PyObject_GetIter(__pyx_v_arg); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 406; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); __pyx_t_5 = Py_TYPE(__pyx_t_4)->tp_iternext; index = 0; __pyx_t_1 = __pyx_t_5(__pyx_t_4); if (unlikely(!__pyx_t_1)) goto __pyx_L4_unpacking_failed; __Pyx_GOTREF(__pyx_t_1); index = 1; __pyx_t_3 = __pyx_t_5(__pyx_t_4); if (unlikely(!__pyx_t_3)) goto __pyx_L4_unpacking_failed; __Pyx_GOTREF(__pyx_t_3); if (__Pyx_IternextUnpackEndCheck(__pyx_t_5(__pyx_t_4), 2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 406; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_t_5 = NULL; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; goto __pyx_L5_unpacking_done; __pyx_L4_unpacking_failed:; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_t_5 = NULL; if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 406; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_L5_unpacking_done:; } __pyx_v_x = __pyx_t_1; __pyx_t_1 = 0; __pyx_v_y = __pyx_t_3; __pyx_t_3 = 0; /* "pygame_sdl2/render.pyx":405 * * def __set__(self, arg): * if type(arg) == tuple: # <<<<<<<<<<<<<< * x, y = arg * else: */ goto __pyx_L3; } /* "pygame_sdl2/render.pyx":408 * x, y = arg * else: * x = y = arg # <<<<<<<<<<<<<< * * self._scalex = x */ /*else*/ { __Pyx_INCREF(__pyx_v_arg); __pyx_v_x = __pyx_v_arg; __Pyx_INCREF(__pyx_v_arg); __pyx_v_y = __pyx_v_arg; } __pyx_L3:; /* "pygame_sdl2/render.pyx":410 * x = y = arg * * self._scalex = x # <<<<<<<<<<<<<< * self._scaley = y * */ __pyx_t_6 = __pyx_PyFloat_AsDouble(__pyx_v_x); if (unlikely((__pyx_t_6 == (double)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 410; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_v_self->_scalex = __pyx_t_6; /* "pygame_sdl2/render.pyx":411 * * self._scalex = x * self._scaley = y # <<<<<<<<<<<<<< * * property hflip: */ __pyx_t_6 = __pyx_PyFloat_AsDouble(__pyx_v_y); if (unlikely((__pyx_t_6 == (double)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 411; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_v_self->_scaley = __pyx_t_6; /* "pygame_sdl2/render.pyx":404 * return self._scalex, self._scaley * * def __set__(self, arg): # <<<<<<<<<<<<<< * if type(arg) == tuple: * x, y = arg */ /* function exit code */ __pyx_r = 0; goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_AddTraceback("pygame_sdl2.render.Sprite.scale.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = -1; __pyx_L0:; __Pyx_XDECREF(__pyx_v_x); __Pyx_XDECREF(__pyx_v_y); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/render.pyx":414 * * property hflip: * def __get__(self): # <<<<<<<<<<<<<< * return self._flip & SDL_FLIP_HORIZONTAL * */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_6render_6Sprite_5hflip_1__get__(PyObject *__pyx_v_self); /*proto*/ static PyObject *__pyx_pw_11pygame_sdl2_6render_6Sprite_5hflip_1__get__(PyObject *__pyx_v_self) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); __pyx_r = __pyx_pf_11pygame_sdl2_6render_6Sprite_5hflip___get__(((struct __pyx_obj_11pygame_sdl2_6render_Sprite *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_6render_6Sprite_5hflip___get__(struct __pyx_obj_11pygame_sdl2_6render_Sprite *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__get__", 0); /* "pygame_sdl2/render.pyx":415 * property hflip: * def __get__(self): * return self._flip & SDL_FLIP_HORIZONTAL # <<<<<<<<<<<<<< * * def __set__(self, val): */ __Pyx_XDECREF(__pyx_r); __pyx_t_1 = __Pyx_PyInt_From_int((__pyx_v_self->_flip & SDL_FLIP_HORIZONTAL)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 415; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "pygame_sdl2/render.pyx":414 * * property hflip: * def __get__(self): # <<<<<<<<<<<<<< * return self._flip & SDL_FLIP_HORIZONTAL * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("pygame_sdl2.render.Sprite.hflip.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/render.pyx":417 * return self._flip & SDL_FLIP_HORIZONTAL * * def __set__(self, val): # <<<<<<<<<<<<<< * if val: * self._flip |= SDL_FLIP_HORIZONTAL */ /* Python wrapper */ static int __pyx_pw_11pygame_sdl2_6render_6Sprite_5hflip_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_val); /*proto*/ static int __pyx_pw_11pygame_sdl2_6render_6Sprite_5hflip_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_val) { int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__set__ (wrapper)", 0); __pyx_r = __pyx_pf_11pygame_sdl2_6render_6Sprite_5hflip_2__set__(((struct __pyx_obj_11pygame_sdl2_6render_Sprite *)__pyx_v_self), ((PyObject *)__pyx_v_val)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static int __pyx_pf_11pygame_sdl2_6render_6Sprite_5hflip_2__set__(struct __pyx_obj_11pygame_sdl2_6render_Sprite *__pyx_v_self, PyObject *__pyx_v_val) { int __pyx_r; __Pyx_RefNannyDeclarations int __pyx_t_1; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__set__", 0); /* "pygame_sdl2/render.pyx":418 * * def __set__(self, val): * if val: # <<<<<<<<<<<<<< * self._flip |= SDL_FLIP_HORIZONTAL * else: */ __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_val); if (unlikely(__pyx_t_1 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 418; __pyx_clineno = __LINE__; goto __pyx_L1_error;} if (__pyx_t_1) { /* "pygame_sdl2/render.pyx":419 * def __set__(self, val): * if val: * self._flip |= SDL_FLIP_HORIZONTAL # <<<<<<<<<<<<<< * else: * self._flip &= ~SDL_FLIP_HORIZONTAL */ __pyx_v_self->_flip = (__pyx_v_self->_flip | SDL_FLIP_HORIZONTAL); /* "pygame_sdl2/render.pyx":418 * * def __set__(self, val): * if val: # <<<<<<<<<<<<<< * self._flip |= SDL_FLIP_HORIZONTAL * else: */ goto __pyx_L3; } /* "pygame_sdl2/render.pyx":421 * self._flip |= SDL_FLIP_HORIZONTAL * else: * self._flip &= ~SDL_FLIP_HORIZONTAL # <<<<<<<<<<<<<< * * property vflip: */ /*else*/ { __pyx_v_self->_flip = (__pyx_v_self->_flip & (~SDL_FLIP_HORIZONTAL)); } __pyx_L3:; /* "pygame_sdl2/render.pyx":417 * return self._flip & SDL_FLIP_HORIZONTAL * * def __set__(self, val): # <<<<<<<<<<<<<< * if val: * self._flip |= SDL_FLIP_HORIZONTAL */ /* function exit code */ __pyx_r = 0; goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("pygame_sdl2.render.Sprite.hflip.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = -1; __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/render.pyx":424 * * property vflip: * def __get__(self): # <<<<<<<<<<<<<< * return self._flip & SDL_FLIP_VERTICAL * */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_6render_6Sprite_5vflip_1__get__(PyObject *__pyx_v_self); /*proto*/ static PyObject *__pyx_pw_11pygame_sdl2_6render_6Sprite_5vflip_1__get__(PyObject *__pyx_v_self) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); __pyx_r = __pyx_pf_11pygame_sdl2_6render_6Sprite_5vflip___get__(((struct __pyx_obj_11pygame_sdl2_6render_Sprite *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_6render_6Sprite_5vflip___get__(struct __pyx_obj_11pygame_sdl2_6render_Sprite *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__get__", 0); /* "pygame_sdl2/render.pyx":425 * property vflip: * def __get__(self): * return self._flip & SDL_FLIP_VERTICAL # <<<<<<<<<<<<<< * * def __set__(self, val): */ __Pyx_XDECREF(__pyx_r); __pyx_t_1 = __Pyx_PyInt_From_int((__pyx_v_self->_flip & SDL_FLIP_VERTICAL)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 425; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "pygame_sdl2/render.pyx":424 * * property vflip: * def __get__(self): # <<<<<<<<<<<<<< * return self._flip & SDL_FLIP_VERTICAL * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("pygame_sdl2.render.Sprite.vflip.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/render.pyx":427 * return self._flip & SDL_FLIP_VERTICAL * * def __set__(self, val): # <<<<<<<<<<<<<< * if val: * self._flip |= SDL_FLIP_VERTICAL */ /* Python wrapper */ static int __pyx_pw_11pygame_sdl2_6render_6Sprite_5vflip_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_val); /*proto*/ static int __pyx_pw_11pygame_sdl2_6render_6Sprite_5vflip_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_val) { int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__set__ (wrapper)", 0); __pyx_r = __pyx_pf_11pygame_sdl2_6render_6Sprite_5vflip_2__set__(((struct __pyx_obj_11pygame_sdl2_6render_Sprite *)__pyx_v_self), ((PyObject *)__pyx_v_val)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static int __pyx_pf_11pygame_sdl2_6render_6Sprite_5vflip_2__set__(struct __pyx_obj_11pygame_sdl2_6render_Sprite *__pyx_v_self, PyObject *__pyx_v_val) { int __pyx_r; __Pyx_RefNannyDeclarations int __pyx_t_1; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__set__", 0); /* "pygame_sdl2/render.pyx":428 * * def __set__(self, val): * if val: # <<<<<<<<<<<<<< * self._flip |= SDL_FLIP_VERTICAL * else: */ __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_val); if (unlikely(__pyx_t_1 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 428; __pyx_clineno = __LINE__; goto __pyx_L1_error;} if (__pyx_t_1) { /* "pygame_sdl2/render.pyx":429 * def __set__(self, val): * if val: * self._flip |= SDL_FLIP_VERTICAL # <<<<<<<<<<<<<< * else: * self._flip &= ~SDL_FLIP_VERTICAL */ __pyx_v_self->_flip = (__pyx_v_self->_flip | SDL_FLIP_VERTICAL); /* "pygame_sdl2/render.pyx":428 * * def __set__(self, val): * if val: # <<<<<<<<<<<<<< * self._flip |= SDL_FLIP_VERTICAL * else: */ goto __pyx_L3; } /* "pygame_sdl2/render.pyx":431 * self._flip |= SDL_FLIP_VERTICAL * else: * self._flip &= ~SDL_FLIP_VERTICAL # <<<<<<<<<<<<<< * * */ /*else*/ { __pyx_v_self->_flip = (__pyx_v_self->_flip & (~SDL_FLIP_VERTICAL)); } __pyx_L3:; /* "pygame_sdl2/render.pyx":427 * return self._flip & SDL_FLIP_VERTICAL * * def __set__(self, val): # <<<<<<<<<<<<<< * if val: * self._flip |= SDL_FLIP_VERTICAL */ /* function exit code */ __pyx_r = 0; goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("pygame_sdl2.render.Sprite.vflip.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = -1; __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/render.pyx":440 * cdef list sprites * * def __init__(self, rect): # <<<<<<<<<<<<<< * """ Parameter may be a position (no clipping) or a rect (clipped). """ * */ /* Python wrapper */ static int __pyx_pw_11pygame_sdl2_6render_9Container_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_11pygame_sdl2_6render_9Container___init__[] = " Parameter may be a position (no clipping) or a rect (clipped). "; #if CYTHON_COMPILING_IN_CPYTHON struct wrapperbase __pyx_wrapperbase_11pygame_sdl2_6render_9Container___init__; #endif static int __pyx_pw_11pygame_sdl2_6render_9Container_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_rect = 0; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__init__ (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_rect,0}; PyObject* values[1] = {0}; if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_rect)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__init__") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 440; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } } else if (PyTuple_GET_SIZE(__pyx_args) != 1) { goto __pyx_L5_argtuple_error; } else { values[0] = PyTuple_GET_ITEM(__pyx_args, 0); } __pyx_v_rect = values[0]; } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("__init__", 1, 1, 1, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 440; __pyx_clineno = __LINE__; goto __pyx_L3_error;} __pyx_L3_error:; __Pyx_AddTraceback("pygame_sdl2.render.Container.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return -1; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_11pygame_sdl2_6render_9Container___init__(((struct __pyx_obj_11pygame_sdl2_6render_Container *)__pyx_v_self), __pyx_v_rect); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static int __pyx_pf_11pygame_sdl2_6render_9Container___init__(struct __pyx_obj_11pygame_sdl2_6render_Container *__pyx_v_self, PyObject *__pyx_v_rect) { int __pyx_r; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_t_2; Py_ssize_t __pyx_t_3; int __pyx_t_4; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__init__", 0); /* "pygame_sdl2/render.pyx":443 * """ Parameter may be a position (no clipping) or a rect (clipped). """ * * self.sprites = [] # <<<<<<<<<<<<<< * to_sdl_rect(rect, &self._rect) * if len(rect) == 2: */ __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 443; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __Pyx_GIVEREF(__pyx_t_1); __Pyx_GOTREF(__pyx_v_self->sprites); __Pyx_DECREF(__pyx_v_self->sprites); __pyx_v_self->sprites = ((PyObject*)__pyx_t_1); __pyx_t_1 = 0; /* "pygame_sdl2/render.pyx":444 * * self.sprites = [] * to_sdl_rect(rect, &self._rect) # <<<<<<<<<<<<<< * if len(rect) == 2: * self._rect.w = self._rect.h = 0 */ __pyx_t_2 = __pyx_f_11pygame_sdl2_4rect_to_sdl_rect(__pyx_v_rect, (&__pyx_v_self->_rect), NULL); if (unlikely(__pyx_t_2 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 444; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "pygame_sdl2/render.pyx":445 * self.sprites = [] * to_sdl_rect(rect, &self._rect) * if len(rect) == 2: # <<<<<<<<<<<<<< * self._rect.w = self._rect.h = 0 * */ __pyx_t_3 = PyObject_Length(__pyx_v_rect); if (unlikely(__pyx_t_3 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 445; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_t_4 = ((__pyx_t_3 == 2) != 0); if (__pyx_t_4) { /* "pygame_sdl2/render.pyx":446 * to_sdl_rect(rect, &self._rect) * if len(rect) == 2: * self._rect.w = self._rect.h = 0 # <<<<<<<<<<<<<< * * def add(self, Sprite sprite not None): */ __pyx_v_self->_rect.w = 0; __pyx_v_self->_rect.h = 0; /* "pygame_sdl2/render.pyx":445 * self.sprites = [] * to_sdl_rect(rect, &self._rect) * if len(rect) == 2: # <<<<<<<<<<<<<< * self._rect.w = self._rect.h = 0 * */ } /* "pygame_sdl2/render.pyx":440 * cdef list sprites * * def __init__(self, rect): # <<<<<<<<<<<<<< * """ Parameter may be a position (no clipping) or a rect (clipped). """ * */ /* function exit code */ __pyx_r = 0; goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("pygame_sdl2.render.Container.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = -1; __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/render.pyx":448 * self._rect.w = self._rect.h = 0 * * def add(self, Sprite sprite not None): # <<<<<<<<<<<<<< * self.sprites.append(sprite) * */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_6render_9Container_3add(PyObject *__pyx_v_self, PyObject *__pyx_v_sprite); /*proto*/ static PyObject *__pyx_pw_11pygame_sdl2_6render_9Container_3add(PyObject *__pyx_v_self, PyObject *__pyx_v_sprite) { CYTHON_UNUSED int __pyx_lineno = 0; CYTHON_UNUSED const char *__pyx_filename = NULL; CYTHON_UNUSED int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("add (wrapper)", 0); if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_sprite), __pyx_ptype_11pygame_sdl2_6render_Sprite, 0, "sprite", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 448; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_r = __pyx_pf_11pygame_sdl2_6render_9Container_2add(((struct __pyx_obj_11pygame_sdl2_6render_Container *)__pyx_v_self), ((struct __pyx_obj_11pygame_sdl2_6render_Sprite *)__pyx_v_sprite)); /* function exit code */ goto __pyx_L0; __pyx_L1_error:; __pyx_r = NULL; __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_6render_9Container_2add(struct __pyx_obj_11pygame_sdl2_6render_Container *__pyx_v_self, struct __pyx_obj_11pygame_sdl2_6render_Sprite *__pyx_v_sprite) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("add", 0); /* "pygame_sdl2/render.pyx":449 * * def add(self, Sprite sprite not None): * self.sprites.append(sprite) # <<<<<<<<<<<<<< * * def render(self, dest=None): */ if (unlikely(__pyx_v_self->sprites == Py_None)) { PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%s'", "append"); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 449; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } __pyx_t_1 = __Pyx_PyList_Append(__pyx_v_self->sprites, ((PyObject *)__pyx_v_sprite)); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 449; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "pygame_sdl2/render.pyx":448 * self._rect.w = self._rect.h = 0 * * def add(self, Sprite sprite not None): # <<<<<<<<<<<<<< * self.sprites.append(sprite) * */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("pygame_sdl2.render.Container.add", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/render.pyx":451 * self.sprites.append(sprite) * * def render(self, dest=None): # <<<<<<<<<<<<<< * # TODO: Something other than this to get the SDL_Renderer. * cdef SDL_Renderer *ren = ((self.sprites[0]).nodes[0]).texture.renderer */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_6render_9Container_5render(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static PyObject *__pyx_pw_11pygame_sdl2_6render_9Container_5render(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { CYTHON_UNUSED PyObject *__pyx_v_dest = 0; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("render (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_dest,0}; PyObject* values[1] = {0}; values[0] = ((PyObject *)Py_None); if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (kw_args > 0) { PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_dest); if (value) { values[0] = value; kw_args--; } } } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "render") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 451; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } } else { switch (PyTuple_GET_SIZE(__pyx_args)) { case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); case 0: break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_dest = values[0]; } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("render", 0, 0, 1, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 451; __pyx_clineno = __LINE__; goto __pyx_L3_error;} __pyx_L3_error:; __Pyx_AddTraceback("pygame_sdl2.render.Container.render", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_11pygame_sdl2_6render_9Container_4render(((struct __pyx_obj_11pygame_sdl2_6render_Container *)__pyx_v_self), __pyx_v_dest); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_6render_9Container_4render(struct __pyx_obj_11pygame_sdl2_6render_Container *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v_dest) { SDL_Renderer *__pyx_v_ren; PyObject *__pyx_v_s = NULL; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; SDL_Renderer *__pyx_t_3; int __pyx_t_4; int __pyx_t_5; Py_ssize_t __pyx_t_6; PyObject *__pyx_t_7 = NULL; PyObject *__pyx_t_8 = NULL; PyObject *__pyx_t_9 = NULL; PyObject *__pyx_t_10 = NULL; PyObject *__pyx_t_11 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("render", 0); /* "pygame_sdl2/render.pyx":453 * def render(self, dest=None): * # TODO: Something other than this to get the SDL_Renderer. * cdef SDL_Renderer *ren = ((self.sprites[0]).nodes[0]).texture.renderer # <<<<<<<<<<<<<< * * if self._rect.w != 0 and self._rect.h != 0: */ if (unlikely(__pyx_v_self->sprites == Py_None)) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 453; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } __pyx_t_1 = __Pyx_GetItemInt_List(__pyx_v_self->sprites, 0, long, 1, __Pyx_PyInt_From_long, 1, 0, 1); if (unlikely(__pyx_t_1 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 453; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; __Pyx_GOTREF(__pyx_t_1); if (unlikely(((struct __pyx_obj_11pygame_sdl2_6render_Sprite *)__pyx_t_1)->nodes == Py_None)) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 453; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } __pyx_t_2 = __Pyx_GetItemInt_List(((struct __pyx_obj_11pygame_sdl2_6render_Sprite *)__pyx_t_1)->nodes, 0, long, 1, __Pyx_PyInt_From_long, 1, 0, 1); if (unlikely(__pyx_t_2 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 453; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_3 = ((struct __pyx_obj_11pygame_sdl2_6render_TextureNode *)__pyx_t_2)->texture->renderer; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_v_ren = __pyx_t_3; /* "pygame_sdl2/render.pyx":455 * cdef SDL_Renderer *ren = ((self.sprites[0]).nodes[0]).texture.renderer * * if self._rect.w != 0 and self._rect.h != 0: # <<<<<<<<<<<<<< * SDL_RenderSetClipRect(ren, &self._rect) * */ __pyx_t_5 = ((__pyx_v_self->_rect.w != 0) != 0); if (__pyx_t_5) { } else { __pyx_t_4 = __pyx_t_5; goto __pyx_L4_bool_binop_done; } __pyx_t_5 = ((__pyx_v_self->_rect.h != 0) != 0); __pyx_t_4 = __pyx_t_5; __pyx_L4_bool_binop_done:; if (__pyx_t_4) { /* "pygame_sdl2/render.pyx":456 * * if self._rect.w != 0 and self._rect.h != 0: * SDL_RenderSetClipRect(ren, &self._rect) # <<<<<<<<<<<<<< * * for s in self.sprites: */ SDL_RenderSetClipRect(__pyx_v_ren, (&__pyx_v_self->_rect)); /* "pygame_sdl2/render.pyx":455 * cdef SDL_Renderer *ren = ((self.sprites[0]).nodes[0]).texture.renderer * * if self._rect.w != 0 and self._rect.h != 0: # <<<<<<<<<<<<<< * SDL_RenderSetClipRect(ren, &self._rect) * */ } /* "pygame_sdl2/render.pyx":458 * SDL_RenderSetClipRect(ren, &self._rect) * * for s in self.sprites: # <<<<<<<<<<<<<< * s.render((s.pos[0] + self._rect.x, s.pos[1] + self._rect.y)) * */ if (unlikely(__pyx_v_self->sprites == Py_None)) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable"); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 458; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } __pyx_t_2 = __pyx_v_self->sprites; __Pyx_INCREF(__pyx_t_2); __pyx_t_6 = 0; for (;;) { if (__pyx_t_6 >= PyList_GET_SIZE(__pyx_t_2)) break; #if CYTHON_COMPILING_IN_CPYTHON __pyx_t_1 = PyList_GET_ITEM(__pyx_t_2, __pyx_t_6); __Pyx_INCREF(__pyx_t_1); __pyx_t_6++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 458; __pyx_clineno = __LINE__; goto __pyx_L1_error;} #else __pyx_t_1 = PySequence_ITEM(__pyx_t_2, __pyx_t_6); __pyx_t_6++; if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 458; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); #endif __Pyx_XDECREF_SET(__pyx_v_s, __pyx_t_1); __pyx_t_1 = 0; /* "pygame_sdl2/render.pyx":459 * * for s in self.sprites: * s.render((s.pos[0] + self._rect.x, s.pos[1] + self._rect.y)) # <<<<<<<<<<<<<< * * # TODO: Save and restore previous clip rect instead? */ __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_v_s, __pyx_n_s_render); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 459; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_7); __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_v_s, __pyx_n_s_pos); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 459; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_8); __pyx_t_9 = __Pyx_GetItemInt(__pyx_t_8, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(__pyx_t_9 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 459; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; __Pyx_GOTREF(__pyx_t_9); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; __pyx_t_8 = __Pyx_PyInt_From_int(__pyx_v_self->_rect.x); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 459; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_8); __pyx_t_10 = PyNumber_Add(__pyx_t_9, __pyx_t_8); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 459; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_10); __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_v_s, __pyx_n_s_pos); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 459; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_8); __pyx_t_9 = __Pyx_GetItemInt(__pyx_t_8, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(__pyx_t_9 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 459; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; __Pyx_GOTREF(__pyx_t_9); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; __pyx_t_8 = __Pyx_PyInt_From_int(__pyx_v_self->_rect.y); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 459; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_8); __pyx_t_11 = PyNumber_Add(__pyx_t_9, __pyx_t_8); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 459; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_11); __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; __pyx_t_8 = PyTuple_New(2); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 459; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_8); __Pyx_GIVEREF(__pyx_t_10); PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_10); __Pyx_GIVEREF(__pyx_t_11); PyTuple_SET_ITEM(__pyx_t_8, 1, __pyx_t_11); __pyx_t_10 = 0; __pyx_t_11 = 0; __pyx_t_11 = NULL; if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_7))) { __pyx_t_11 = PyMethod_GET_SELF(__pyx_t_7); if (likely(__pyx_t_11)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_7); __Pyx_INCREF(__pyx_t_11); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_7, function); } } if (!__pyx_t_11) { __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_7, __pyx_t_8); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 459; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; __Pyx_GOTREF(__pyx_t_1); } else { __pyx_t_10 = PyTuple_New(1+1); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 459; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_10); __Pyx_GIVEREF(__pyx_t_11); PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_t_11); __pyx_t_11 = NULL; __Pyx_GIVEREF(__pyx_t_8); PyTuple_SET_ITEM(__pyx_t_10, 0+1, __pyx_t_8); __pyx_t_8 = 0; __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_7, __pyx_t_10, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 459; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; } __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "pygame_sdl2/render.pyx":458 * SDL_RenderSetClipRect(ren, &self._rect) * * for s in self.sprites: # <<<<<<<<<<<<<< * s.render((s.pos[0] + self._rect.x, s.pos[1] + self._rect.y)) * */ } __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "pygame_sdl2/render.pyx":462 * * # TODO: Save and restore previous clip rect instead? * SDL_RenderSetClipRect(ren, NULL) # <<<<<<<<<<<<<< * * property pos: */ SDL_RenderSetClipRect(__pyx_v_ren, NULL); /* "pygame_sdl2/render.pyx":451 * self.sprites.append(sprite) * * def render(self, dest=None): # <<<<<<<<<<<<<< * # TODO: Something other than this to get the SDL_Renderer. * cdef SDL_Renderer *ren = ((self.sprites[0]).nodes[0]).texture.renderer */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_7); __Pyx_XDECREF(__pyx_t_8); __Pyx_XDECREF(__pyx_t_9); __Pyx_XDECREF(__pyx_t_10); __Pyx_XDECREF(__pyx_t_11); __Pyx_AddTraceback("pygame_sdl2.render.Container.render", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF(__pyx_v_s); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/render.pyx":465 * * property pos: * def __get__(self): # <<<<<<<<<<<<<< * return self._rect.x, self._rect.y * */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_6render_9Container_3pos_1__get__(PyObject *__pyx_v_self); /*proto*/ static PyObject *__pyx_pw_11pygame_sdl2_6render_9Container_3pos_1__get__(PyObject *__pyx_v_self) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); __pyx_r = __pyx_pf_11pygame_sdl2_6render_9Container_3pos___get__(((struct __pyx_obj_11pygame_sdl2_6render_Container *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_6render_9Container_3pos___get__(struct __pyx_obj_11pygame_sdl2_6render_Container *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__get__", 0); /* "pygame_sdl2/render.pyx":466 * property pos: * def __get__(self): * return self._rect.x, self._rect.y # <<<<<<<<<<<<<< * * def __set__(self, val): */ __Pyx_XDECREF(__pyx_r); __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_self->_rect.x); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 466; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_v_self->_rect.y); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 466; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 466; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __Pyx_GIVEREF(__pyx_t_1); PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_1); __Pyx_GIVEREF(__pyx_t_2); PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_2); __pyx_t_1 = 0; __pyx_t_2 = 0; __pyx_r = __pyx_t_3; __pyx_t_3 = 0; goto __pyx_L0; /* "pygame_sdl2/render.pyx":465 * * property pos: * def __get__(self): # <<<<<<<<<<<<<< * return self._rect.x, self._rect.y * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("pygame_sdl2.render.Container.pos.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/render.pyx":468 * return self._rect.x, self._rect.y * * def __set__(self, val): # <<<<<<<<<<<<<< * self._rect.x = val[0] * self._rect.y = val[1] */ /* Python wrapper */ static int __pyx_pw_11pygame_sdl2_6render_9Container_3pos_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_val); /*proto*/ static int __pyx_pw_11pygame_sdl2_6render_9Container_3pos_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_val) { int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__set__ (wrapper)", 0); __pyx_r = __pyx_pf_11pygame_sdl2_6render_9Container_3pos_2__set__(((struct __pyx_obj_11pygame_sdl2_6render_Container *)__pyx_v_self), ((PyObject *)__pyx_v_val)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static int __pyx_pf_11pygame_sdl2_6render_9Container_3pos_2__set__(struct __pyx_obj_11pygame_sdl2_6render_Container *__pyx_v_self, PyObject *__pyx_v_val) { int __pyx_r; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_t_2; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__set__", 0); /* "pygame_sdl2/render.pyx":469 * * def __set__(self, val): * self._rect.x = val[0] # <<<<<<<<<<<<<< * self._rect.y = val[1] * */ __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_val, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(__pyx_t_1 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 469; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = __Pyx_PyInt_As_int(__pyx_t_1); if (unlikely((__pyx_t_2 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 469; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_v_self->_rect.x = __pyx_t_2; /* "pygame_sdl2/render.pyx":470 * def __set__(self, val): * self._rect.x = val[0] * self._rect.y = val[1] # <<<<<<<<<<<<<< * * property rect: */ __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_val, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(__pyx_t_1 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 470; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = __Pyx_PyInt_As_int(__pyx_t_1); if (unlikely((__pyx_t_2 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 470; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_v_self->_rect.y = __pyx_t_2; /* "pygame_sdl2/render.pyx":468 * return self._rect.x, self._rect.y * * def __set__(self, val): # <<<<<<<<<<<<<< * self._rect.x = val[0] * self._rect.y = val[1] */ /* function exit code */ __pyx_r = 0; goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("pygame_sdl2.render.Container.pos.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = -1; __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/render.pyx":473 * * property rect: * def __get__(self): # <<<<<<<<<<<<<< * return Rect(self._rect.x, self._rect.y, self._rect.w, self._rect.h) * */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_6render_9Container_4rect_1__get__(PyObject *__pyx_v_self); /*proto*/ static PyObject *__pyx_pw_11pygame_sdl2_6render_9Container_4rect_1__get__(PyObject *__pyx_v_self) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); __pyx_r = __pyx_pf_11pygame_sdl2_6render_9Container_4rect___get__(((struct __pyx_obj_11pygame_sdl2_6render_Container *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_6render_9Container_4rect___get__(struct __pyx_obj_11pygame_sdl2_6render_Container *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; PyObject *__pyx_t_5 = NULL; PyObject *__pyx_t_6 = NULL; PyObject *__pyx_t_7 = NULL; Py_ssize_t __pyx_t_8; PyObject *__pyx_t_9 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__get__", 0); /* "pygame_sdl2/render.pyx":474 * property rect: * def __get__(self): * return Rect(self._rect.x, self._rect.y, self._rect.w, self._rect.h) # <<<<<<<<<<<<<< * * def __set__(self, val): */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_Rect); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 474; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = __Pyx_PyInt_From_int(__pyx_v_self->_rect.x); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 474; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = __Pyx_PyInt_From_int(__pyx_v_self->_rect.y); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 474; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); __pyx_t_5 = __Pyx_PyInt_From_int(__pyx_v_self->_rect.w); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 474; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); __pyx_t_6 = __Pyx_PyInt_From_int(__pyx_v_self->_rect.h); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 474; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_6); __pyx_t_7 = NULL; __pyx_t_8 = 0; if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_2))) { __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_2); if (likely(__pyx_t_7)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_7); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); __pyx_t_8 = 1; } } __pyx_t_9 = PyTuple_New(4+__pyx_t_8); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 474; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_9); if (__pyx_t_7) { __Pyx_GIVEREF(__pyx_t_7); PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_t_7); __pyx_t_7 = NULL; } __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_9, 0+__pyx_t_8, __pyx_t_3); __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_9, 1+__pyx_t_8, __pyx_t_4); __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_9, 2+__pyx_t_8, __pyx_t_5); __Pyx_GIVEREF(__pyx_t_6); PyTuple_SET_ITEM(__pyx_t_9, 3+__pyx_t_8, __pyx_t_6); __pyx_t_3 = 0; __pyx_t_4 = 0; __pyx_t_5 = 0; __pyx_t_6 = 0; __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_9, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 474; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "pygame_sdl2/render.pyx":473 * * property rect: * def __get__(self): # <<<<<<<<<<<<<< * return Rect(self._rect.x, self._rect.y, self._rect.w, self._rect.h) * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_5); __Pyx_XDECREF(__pyx_t_6); __Pyx_XDECREF(__pyx_t_7); __Pyx_XDECREF(__pyx_t_9); __Pyx_AddTraceback("pygame_sdl2.render.Container.rect.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/render.pyx":476 * return Rect(self._rect.x, self._rect.y, self._rect.w, self._rect.h) * * def __set__(self, val): # <<<<<<<<<<<<<< * to_sdl_rect(val, &self._rect) * */ /* Python wrapper */ static int __pyx_pw_11pygame_sdl2_6render_9Container_4rect_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_val); /*proto*/ static int __pyx_pw_11pygame_sdl2_6render_9Container_4rect_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_val) { int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__set__ (wrapper)", 0); __pyx_r = __pyx_pf_11pygame_sdl2_6render_9Container_4rect_2__set__(((struct __pyx_obj_11pygame_sdl2_6render_Container *)__pyx_v_self), ((PyObject *)__pyx_v_val)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static int __pyx_pf_11pygame_sdl2_6render_9Container_4rect_2__set__(struct __pyx_obj_11pygame_sdl2_6render_Container *__pyx_v_self, PyObject *__pyx_v_val) { int __pyx_r; __Pyx_RefNannyDeclarations int __pyx_t_1; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__set__", 0); /* "pygame_sdl2/render.pyx":477 * * def __set__(self, val): * to_sdl_rect(val, &self._rect) # <<<<<<<<<<<<<< * */ __pyx_t_1 = __pyx_f_11pygame_sdl2_4rect_to_sdl_rect(__pyx_v_val, (&__pyx_v_self->_rect), NULL); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 477; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "pygame_sdl2/render.pyx":476 * return Rect(self._rect.x, self._rect.y, self._rect.w, self._rect.h) * * def __set__(self, val): # <<<<<<<<<<<<<< * to_sdl_rect(val, &self._rect) * */ /* function exit code */ __pyx_r = 0; goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("pygame_sdl2.render.Container.rect.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = -1; __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; } static struct __pyx_vtabstruct_11pygame_sdl2_6render_Renderer __pyx_vtable_11pygame_sdl2_6render_Renderer; static PyObject *__pyx_tp_new_11pygame_sdl2_6render_Renderer(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) { struct __pyx_obj_11pygame_sdl2_6render_Renderer *p; PyObject *o; if (likely((t->tp_flags & Py_TPFLAGS_IS_ABSTRACT) == 0)) { o = (*t->tp_alloc)(t, 0); } else { o = (PyObject *) PyBaseObject_Type.tp_new(t, __pyx_empty_tuple, 0); } if (unlikely(!o)) return 0; p = ((struct __pyx_obj_11pygame_sdl2_6render_Renderer *)o); p->__pyx_vtab = __pyx_vtabptr_11pygame_sdl2_6render_Renderer; p->_info = ((PyObject*)Py_None); Py_INCREF(Py_None); if (unlikely(__pyx_pw_11pygame_sdl2_6render_8Renderer_1__cinit__(o, __pyx_empty_tuple, NULL) < 0)) { Py_DECREF(o); o = 0; } return o; } static void __pyx_tp_dealloc_11pygame_sdl2_6render_Renderer(PyObject *o) { struct __pyx_obj_11pygame_sdl2_6render_Renderer *p = (struct __pyx_obj_11pygame_sdl2_6render_Renderer *)o; #if PY_VERSION_HEX >= 0x030400a1 if (unlikely(Py_TYPE(o)->tp_finalize) && !_PyGC_FINALIZED(o)) { if (PyObject_CallFinalizerFromDealloc(o)) return; } #endif PyObject_GC_UnTrack(o); { PyObject *etype, *eval, *etb; PyErr_Fetch(&etype, &eval, &etb); ++Py_REFCNT(o); __pyx_pw_11pygame_sdl2_6render_8Renderer_3__dealloc__(o); --Py_REFCNT(o); PyErr_Restore(etype, eval, etb); } Py_CLEAR(p->_info); (*Py_TYPE(o)->tp_free)(o); } static int __pyx_tp_traverse_11pygame_sdl2_6render_Renderer(PyObject *o, visitproc v, void *a) { int e; struct __pyx_obj_11pygame_sdl2_6render_Renderer *p = (struct __pyx_obj_11pygame_sdl2_6render_Renderer *)o; if (p->_info) { e = (*v)(p->_info, a); if (e) return e; } return 0; } static int __pyx_tp_clear_11pygame_sdl2_6render_Renderer(PyObject *o) { PyObject* tmp; struct __pyx_obj_11pygame_sdl2_6render_Renderer *p = (struct __pyx_obj_11pygame_sdl2_6render_Renderer *)o; tmp = ((PyObject*)p->_info); p->_info = ((PyObject*)Py_None); Py_INCREF(Py_None); Py_XDECREF(tmp); return 0; } static PyMethodDef __pyx_methods_11pygame_sdl2_6render_Renderer[] = { {"load_texture", (PyCFunction)__pyx_pw_11pygame_sdl2_6render_8Renderer_7load_texture, METH_O, 0}, {"load_atlas", (PyCFunction)__pyx_pw_11pygame_sdl2_6render_8Renderer_9load_atlas, METH_O, __pyx_doc_11pygame_sdl2_6render_8Renderer_8load_atlas}, {"render_present", (PyCFunction)__pyx_pw_11pygame_sdl2_6render_8Renderer_11render_present, METH_NOARGS, 0}, {"info", (PyCFunction)__pyx_pw_11pygame_sdl2_6render_8Renderer_13info, METH_NOARGS, 0}, {"clear", (PyCFunction)__pyx_pw_11pygame_sdl2_6render_8Renderer_15clear, METH_O, 0}, {"draw_line", (PyCFunction)__pyx_pw_11pygame_sdl2_6render_8Renderer_17draw_line, METH_VARARGS|METH_KEYWORDS, 0}, {"draw_point", (PyCFunction)__pyx_pw_11pygame_sdl2_6render_8Renderer_19draw_point, METH_VARARGS|METH_KEYWORDS, 0}, {"draw_rect", (PyCFunction)__pyx_pw_11pygame_sdl2_6render_8Renderer_21draw_rect, METH_VARARGS|METH_KEYWORDS, 0}, {"fill_rect", (PyCFunction)__pyx_pw_11pygame_sdl2_6render_8Renderer_23fill_rect, METH_VARARGS|METH_KEYWORDS, 0}, {"set_viewport", (PyCFunction)__pyx_pw_11pygame_sdl2_6render_8Renderer_25set_viewport, METH_VARARGS|METH_KEYWORDS, 0}, {"create_texture", (PyCFunction)__pyx_pw_11pygame_sdl2_6render_8Renderer_27create_texture, METH_O, 0}, {0, 0, 0, 0} }; static PyTypeObject __pyx_type_11pygame_sdl2_6render_Renderer = { PyVarObject_HEAD_INIT(0, 0) "pygame_sdl2.render.Renderer", /*tp_name*/ sizeof(struct __pyx_obj_11pygame_sdl2_6render_Renderer), /*tp_basicsize*/ 0, /*tp_itemsize*/ __pyx_tp_dealloc_11pygame_sdl2_6render_Renderer, /*tp_dealloc*/ 0, /*tp_print*/ 0, /*tp_getattr*/ 0, /*tp_setattr*/ #if PY_MAJOR_VERSION < 3 0, /*tp_compare*/ #endif #if PY_MAJOR_VERSION >= 3 0, /*tp_as_async*/ #endif 0, /*tp_repr*/ 0, /*tp_as_number*/ 0, /*tp_as_sequence*/ 0, /*tp_as_mapping*/ 0, /*tp_hash*/ 0, /*tp_call*/ 0, /*tp_str*/ 0, /*tp_getattro*/ 0, /*tp_setattro*/ 0, /*tp_as_buffer*/ Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/ 0, /*tp_doc*/ __pyx_tp_traverse_11pygame_sdl2_6render_Renderer, /*tp_traverse*/ __pyx_tp_clear_11pygame_sdl2_6render_Renderer, /*tp_clear*/ 0, /*tp_richcompare*/ 0, /*tp_weaklistoffset*/ 0, /*tp_iter*/ 0, /*tp_iternext*/ __pyx_methods_11pygame_sdl2_6render_Renderer, /*tp_methods*/ 0, /*tp_members*/ 0, /*tp_getset*/ 0, /*tp_base*/ 0, /*tp_dict*/ 0, /*tp_descr_get*/ 0, /*tp_descr_set*/ 0, /*tp_dictoffset*/ __pyx_pw_11pygame_sdl2_6render_8Renderer_5__init__, /*tp_init*/ 0, /*tp_alloc*/ __pyx_tp_new_11pygame_sdl2_6render_Renderer, /*tp_new*/ 0, /*tp_free*/ 0, /*tp_is_gc*/ 0, /*tp_bases*/ 0, /*tp_mro*/ 0, /*tp_cache*/ 0, /*tp_subclasses*/ 0, /*tp_weaklist*/ 0, /*tp_del*/ 0, /*tp_version_tag*/ #if PY_VERSION_HEX >= 0x030400a1 0, /*tp_finalize*/ #endif }; static struct __pyx_vtabstruct_11pygame_sdl2_6render_Texture __pyx_vtable_11pygame_sdl2_6render_Texture; static PyObject *__pyx_tp_new_11pygame_sdl2_6render_Texture(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) { struct __pyx_obj_11pygame_sdl2_6render_Texture *p; PyObject *o; if (likely((t->tp_flags & Py_TPFLAGS_IS_ABSTRACT) == 0)) { o = (*t->tp_alloc)(t, 0); } else { o = (PyObject *) PyBaseObject_Type.tp_new(t, __pyx_empty_tuple, 0); } if (unlikely(!o)) return 0; p = ((struct __pyx_obj_11pygame_sdl2_6render_Texture *)o); p->__pyx_vtab = __pyx_vtabptr_11pygame_sdl2_6render_Texture; if (unlikely(__pyx_pw_11pygame_sdl2_6render_7Texture_1__cinit__(o, __pyx_empty_tuple, NULL) < 0)) { Py_DECREF(o); o = 0; } return o; } static void __pyx_tp_dealloc_11pygame_sdl2_6render_Texture(PyObject *o) { #if PY_VERSION_HEX >= 0x030400a1 if (unlikely(Py_TYPE(o)->tp_finalize) && (!PyType_IS_GC(Py_TYPE(o)) || !_PyGC_FINALIZED(o))) { if (PyObject_CallFinalizerFromDealloc(o)) return; } #endif { PyObject *etype, *eval, *etb; PyErr_Fetch(&etype, &eval, &etb); ++Py_REFCNT(o); __pyx_pw_11pygame_sdl2_6render_7Texture_3__dealloc__(o); --Py_REFCNT(o); PyErr_Restore(etype, eval, etb); } (*Py_TYPE(o)->tp_free)(o); } static PyObject *__pyx_getprop_11pygame_sdl2_6render_7Texture_w(PyObject *o, CYTHON_UNUSED void *x) { return __pyx_pw_11pygame_sdl2_6render_7Texture_1w_1__get__(o); } static int __pyx_setprop_11pygame_sdl2_6render_7Texture_w(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) { if (v) { return __pyx_pw_11pygame_sdl2_6render_7Texture_1w_3__set__(o, v); } else { PyErr_SetString(PyExc_NotImplementedError, "__del__"); return -1; } } static PyObject *__pyx_getprop_11pygame_sdl2_6render_7Texture_h(PyObject *o, CYTHON_UNUSED void *x) { return __pyx_pw_11pygame_sdl2_6render_7Texture_1h_1__get__(o); } static int __pyx_setprop_11pygame_sdl2_6render_7Texture_h(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) { if (v) { return __pyx_pw_11pygame_sdl2_6render_7Texture_1h_3__set__(o, v); } else { PyErr_SetString(PyExc_NotImplementedError, "__del__"); return -1; } } static PyMethodDef __pyx_methods_11pygame_sdl2_6render_Texture[] = { {0, 0, 0, 0} }; static struct PyGetSetDef __pyx_getsets_11pygame_sdl2_6render_Texture[] = { {(char *)"w", __pyx_getprop_11pygame_sdl2_6render_7Texture_w, __pyx_setprop_11pygame_sdl2_6render_7Texture_w, 0, 0}, {(char *)"h", __pyx_getprop_11pygame_sdl2_6render_7Texture_h, __pyx_setprop_11pygame_sdl2_6render_7Texture_h, 0, 0}, {0, 0, 0, 0, 0} }; static PyTypeObject __pyx_type_11pygame_sdl2_6render_Texture = { PyVarObject_HEAD_INIT(0, 0) "pygame_sdl2.render.Texture", /*tp_name*/ sizeof(struct __pyx_obj_11pygame_sdl2_6render_Texture), /*tp_basicsize*/ 0, /*tp_itemsize*/ __pyx_tp_dealloc_11pygame_sdl2_6render_Texture, /*tp_dealloc*/ 0, /*tp_print*/ 0, /*tp_getattr*/ 0, /*tp_setattr*/ #if PY_MAJOR_VERSION < 3 0, /*tp_compare*/ #endif #if PY_MAJOR_VERSION >= 3 0, /*tp_as_async*/ #endif 0, /*tp_repr*/ 0, /*tp_as_number*/ 0, /*tp_as_sequence*/ 0, /*tp_as_mapping*/ 0, /*tp_hash*/ 0, /*tp_call*/ 0, /*tp_str*/ 0, /*tp_getattro*/ 0, /*tp_setattro*/ 0, /*tp_as_buffer*/ Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE, /*tp_flags*/ " Mostly for internal use. Users should only see this for RTT. ", /*tp_doc*/ 0, /*tp_traverse*/ 0, /*tp_clear*/ 0, /*tp_richcompare*/ 0, /*tp_weaklistoffset*/ 0, /*tp_iter*/ 0, /*tp_iternext*/ __pyx_methods_11pygame_sdl2_6render_Texture, /*tp_methods*/ 0, /*tp_members*/ __pyx_getsets_11pygame_sdl2_6render_Texture, /*tp_getset*/ 0, /*tp_base*/ 0, /*tp_dict*/ 0, /*tp_descr_get*/ 0, /*tp_descr_set*/ 0, /*tp_dictoffset*/ 0, /*tp_init*/ 0, /*tp_alloc*/ __pyx_tp_new_11pygame_sdl2_6render_Texture, /*tp_new*/ 0, /*tp_free*/ 0, /*tp_is_gc*/ 0, /*tp_bases*/ 0, /*tp_mro*/ 0, /*tp_cache*/ 0, /*tp_subclasses*/ 0, /*tp_weaklist*/ 0, /*tp_del*/ 0, /*tp_version_tag*/ #if PY_VERSION_HEX >= 0x030400a1 0, /*tp_finalize*/ #endif }; static PyObject *__pyx_tp_new_11pygame_sdl2_6render_TextureNode(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) { struct __pyx_obj_11pygame_sdl2_6render_TextureNode *p; PyObject *o; if (likely((t->tp_flags & Py_TPFLAGS_IS_ABSTRACT) == 0)) { o = (*t->tp_alloc)(t, 0); } else { o = (PyObject *) PyBaseObject_Type.tp_new(t, __pyx_empty_tuple, 0); } if (unlikely(!o)) return 0; p = ((struct __pyx_obj_11pygame_sdl2_6render_TextureNode *)o); p->texture = ((struct __pyx_obj_11pygame_sdl2_6render_Texture *)Py_None); Py_INCREF(Py_None); return o; } static void __pyx_tp_dealloc_11pygame_sdl2_6render_TextureNode(PyObject *o) { struct __pyx_obj_11pygame_sdl2_6render_TextureNode *p = (struct __pyx_obj_11pygame_sdl2_6render_TextureNode *)o; #if PY_VERSION_HEX >= 0x030400a1 if (unlikely(Py_TYPE(o)->tp_finalize) && !_PyGC_FINALIZED(o)) { if (PyObject_CallFinalizerFromDealloc(o)) return; } #endif PyObject_GC_UnTrack(o); Py_CLEAR(p->texture); (*Py_TYPE(o)->tp_free)(o); } static int __pyx_tp_traverse_11pygame_sdl2_6render_TextureNode(PyObject *o, visitproc v, void *a) { int e; struct __pyx_obj_11pygame_sdl2_6render_TextureNode *p = (struct __pyx_obj_11pygame_sdl2_6render_TextureNode *)o; if (p->texture) { e = (*v)(((PyObject*)p->texture), a); if (e) return e; } return 0; } static int __pyx_tp_clear_11pygame_sdl2_6render_TextureNode(PyObject *o) { PyObject* tmp; struct __pyx_obj_11pygame_sdl2_6render_TextureNode *p = (struct __pyx_obj_11pygame_sdl2_6render_TextureNode *)o; tmp = ((PyObject*)p->texture); p->texture = ((struct __pyx_obj_11pygame_sdl2_6render_Texture *)Py_None); Py_INCREF(Py_None); Py_XDECREF(tmp); return 0; } static PyMethodDef __pyx_methods_11pygame_sdl2_6render_TextureNode[] = { {"render", (PyCFunction)__pyx_pw_11pygame_sdl2_6render_11TextureNode_3render, METH_VARARGS|METH_KEYWORDS, 0}, {0, 0, 0, 0} }; static PyTypeObject __pyx_type_11pygame_sdl2_6render_TextureNode = { PyVarObject_HEAD_INIT(0, 0) "pygame_sdl2.render.TextureNode", /*tp_name*/ sizeof(struct __pyx_obj_11pygame_sdl2_6render_TextureNode), /*tp_basicsize*/ 0, /*tp_itemsize*/ __pyx_tp_dealloc_11pygame_sdl2_6render_TextureNode, /*tp_dealloc*/ 0, /*tp_print*/ 0, /*tp_getattr*/ 0, /*tp_setattr*/ #if PY_MAJOR_VERSION < 3 0, /*tp_compare*/ #endif #if PY_MAJOR_VERSION >= 3 0, /*tp_as_async*/ #endif 0, /*tp_repr*/ 0, /*tp_as_number*/ 0, /*tp_as_sequence*/ 0, /*tp_as_mapping*/ 0, /*tp_hash*/ 0, /*tp_call*/ 0, /*tp_str*/ 0, /*tp_getattro*/ 0, /*tp_setattro*/ 0, /*tp_as_buffer*/ Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/ " A specified area of a texture. ", /*tp_doc*/ __pyx_tp_traverse_11pygame_sdl2_6render_TextureNode, /*tp_traverse*/ __pyx_tp_clear_11pygame_sdl2_6render_TextureNode, /*tp_clear*/ 0, /*tp_richcompare*/ 0, /*tp_weaklistoffset*/ 0, /*tp_iter*/ 0, /*tp_iternext*/ __pyx_methods_11pygame_sdl2_6render_TextureNode, /*tp_methods*/ 0, /*tp_members*/ 0, /*tp_getset*/ 0, /*tp_base*/ 0, /*tp_dict*/ 0, /*tp_descr_get*/ 0, /*tp_descr_set*/ 0, /*tp_dictoffset*/ __pyx_pw_11pygame_sdl2_6render_11TextureNode_1__init__, /*tp_init*/ 0, /*tp_alloc*/ __pyx_tp_new_11pygame_sdl2_6render_TextureNode, /*tp_new*/ 0, /*tp_free*/ 0, /*tp_is_gc*/ 0, /*tp_bases*/ 0, /*tp_mro*/ 0, /*tp_cache*/ 0, /*tp_subclasses*/ 0, /*tp_weaklist*/ 0, /*tp_del*/ 0, /*tp_version_tag*/ #if PY_VERSION_HEX >= 0x030400a1 0, /*tp_finalize*/ #endif }; static PyObject *__pyx_tp_new_11pygame_sdl2_6render_TextureAtlas(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) { struct __pyx_obj_11pygame_sdl2_6render_TextureAtlas *p; PyObject *o; if (likely((t->tp_flags & Py_TPFLAGS_IS_ABSTRACT) == 0)) { o = (*t->tp_alloc)(t, 0); } else { o = (PyObject *) PyBaseObject_Type.tp_new(t, __pyx_empty_tuple, 0); } if (unlikely(!o)) return 0; p = ((struct __pyx_obj_11pygame_sdl2_6render_TextureAtlas *)o); p->frames = Py_None; Py_INCREF(Py_None); return o; } static void __pyx_tp_dealloc_11pygame_sdl2_6render_TextureAtlas(PyObject *o) { struct __pyx_obj_11pygame_sdl2_6render_TextureAtlas *p = (struct __pyx_obj_11pygame_sdl2_6render_TextureAtlas *)o; #if PY_VERSION_HEX >= 0x030400a1 if (unlikely(Py_TYPE(o)->tp_finalize) && !_PyGC_FINALIZED(o)) { if (PyObject_CallFinalizerFromDealloc(o)) return; } #endif PyObject_GC_UnTrack(o); Py_CLEAR(p->frames); (*Py_TYPE(o)->tp_free)(o); } static int __pyx_tp_traverse_11pygame_sdl2_6render_TextureAtlas(PyObject *o, visitproc v, void *a) { int e; struct __pyx_obj_11pygame_sdl2_6render_TextureAtlas *p = (struct __pyx_obj_11pygame_sdl2_6render_TextureAtlas *)o; if (p->frames) { e = (*v)(p->frames, a); if (e) return e; } return 0; } static int __pyx_tp_clear_11pygame_sdl2_6render_TextureAtlas(PyObject *o) { PyObject* tmp; struct __pyx_obj_11pygame_sdl2_6render_TextureAtlas *p = (struct __pyx_obj_11pygame_sdl2_6render_TextureAtlas *)o; tmp = ((PyObject*)p->frames); p->frames = Py_None; Py_INCREF(Py_None); Py_XDECREF(tmp); return 0; } static PyObject *__pyx_sq_item_11pygame_sdl2_6render_TextureAtlas(PyObject *o, Py_ssize_t i) { PyObject *r; PyObject *x = PyInt_FromSsize_t(i); if(!x) return 0; r = Py_TYPE(o)->tp_as_mapping->mp_subscript(o, x); Py_DECREF(x); return r; } static PyMethodDef __pyx_methods_11pygame_sdl2_6render_TextureAtlas[] = { {"keys", (PyCFunction)__pyx_pw_11pygame_sdl2_6render_12TextureAtlas_5keys, METH_NOARGS, 0}, {0, 0, 0, 0} }; static PySequenceMethods __pyx_tp_as_sequence_TextureAtlas = { 0, /*sq_length*/ 0, /*sq_concat*/ 0, /*sq_repeat*/ __pyx_sq_item_11pygame_sdl2_6render_TextureAtlas, /*sq_item*/ 0, /*sq_slice*/ 0, /*sq_ass_item*/ 0, /*sq_ass_slice*/ 0, /*sq_contains*/ 0, /*sq_inplace_concat*/ 0, /*sq_inplace_repeat*/ }; static PyMappingMethods __pyx_tp_as_mapping_TextureAtlas = { 0, /*mp_length*/ __pyx_pw_11pygame_sdl2_6render_12TextureAtlas_3__getitem__, /*mp_subscript*/ 0, /*mp_ass_subscript*/ }; static PyTypeObject __pyx_type_11pygame_sdl2_6render_TextureAtlas = { PyVarObject_HEAD_INIT(0, 0) "pygame_sdl2.render.TextureAtlas", /*tp_name*/ sizeof(struct __pyx_obj_11pygame_sdl2_6render_TextureAtlas), /*tp_basicsize*/ 0, /*tp_itemsize*/ __pyx_tp_dealloc_11pygame_sdl2_6render_TextureAtlas, /*tp_dealloc*/ 0, /*tp_print*/ 0, /*tp_getattr*/ 0, /*tp_setattr*/ #if PY_MAJOR_VERSION < 3 0, /*tp_compare*/ #endif #if PY_MAJOR_VERSION >= 3 0, /*tp_as_async*/ #endif 0, /*tp_repr*/ 0, /*tp_as_number*/ &__pyx_tp_as_sequence_TextureAtlas, /*tp_as_sequence*/ &__pyx_tp_as_mapping_TextureAtlas, /*tp_as_mapping*/ 0, /*tp_hash*/ 0, /*tp_call*/ 0, /*tp_str*/ 0, /*tp_getattro*/ 0, /*tp_setattro*/ 0, /*tp_as_buffer*/ Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/ 0, /*tp_doc*/ __pyx_tp_traverse_11pygame_sdl2_6render_TextureAtlas, /*tp_traverse*/ __pyx_tp_clear_11pygame_sdl2_6render_TextureAtlas, /*tp_clear*/ 0, /*tp_richcompare*/ 0, /*tp_weaklistoffset*/ 0, /*tp_iter*/ 0, /*tp_iternext*/ __pyx_methods_11pygame_sdl2_6render_TextureAtlas, /*tp_methods*/ 0, /*tp_members*/ 0, /*tp_getset*/ 0, /*tp_base*/ 0, /*tp_dict*/ 0, /*tp_descr_get*/ 0, /*tp_descr_set*/ 0, /*tp_dictoffset*/ __pyx_pw_11pygame_sdl2_6render_12TextureAtlas_1__init__, /*tp_init*/ 0, /*tp_alloc*/ __pyx_tp_new_11pygame_sdl2_6render_TextureAtlas, /*tp_new*/ 0, /*tp_free*/ 0, /*tp_is_gc*/ 0, /*tp_bases*/ 0, /*tp_mro*/ 0, /*tp_cache*/ 0, /*tp_subclasses*/ 0, /*tp_weaklist*/ 0, /*tp_del*/ 0, /*tp_version_tag*/ #if PY_VERSION_HEX >= 0x030400a1 0, /*tp_finalize*/ #endif }; static struct __pyx_vtabstruct_11pygame_sdl2_6render_Sprite __pyx_vtable_11pygame_sdl2_6render_Sprite; static PyObject *__pyx_tp_new_11pygame_sdl2_6render_Sprite(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) { struct __pyx_obj_11pygame_sdl2_6render_Sprite *p; PyObject *o; if (likely((t->tp_flags & Py_TPFLAGS_IS_ABSTRACT) == 0)) { o = (*t->tp_alloc)(t, 0); } else { o = (PyObject *) PyBaseObject_Type.tp_new(t, __pyx_empty_tuple, 0); } if (unlikely(!o)) return 0; p = ((struct __pyx_obj_11pygame_sdl2_6render_Sprite *)o); p->__pyx_vtab = __pyx_vtabptr_11pygame_sdl2_6render_Sprite; p->nodes = ((PyObject*)Py_None); Py_INCREF(Py_None); return o; } static void __pyx_tp_dealloc_11pygame_sdl2_6render_Sprite(PyObject *o) { struct __pyx_obj_11pygame_sdl2_6render_Sprite *p = (struct __pyx_obj_11pygame_sdl2_6render_Sprite *)o; #if PY_VERSION_HEX >= 0x030400a1 if (unlikely(Py_TYPE(o)->tp_finalize) && !_PyGC_FINALIZED(o)) { if (PyObject_CallFinalizerFromDealloc(o)) return; } #endif PyObject_GC_UnTrack(o); Py_CLEAR(p->nodes); (*Py_TYPE(o)->tp_free)(o); } static int __pyx_tp_traverse_11pygame_sdl2_6render_Sprite(PyObject *o, visitproc v, void *a) { int e; struct __pyx_obj_11pygame_sdl2_6render_Sprite *p = (struct __pyx_obj_11pygame_sdl2_6render_Sprite *)o; if (p->nodes) { e = (*v)(p->nodes, a); if (e) return e; } return 0; } static int __pyx_tp_clear_11pygame_sdl2_6render_Sprite(PyObject *o) { PyObject* tmp; struct __pyx_obj_11pygame_sdl2_6render_Sprite *p = (struct __pyx_obj_11pygame_sdl2_6render_Sprite *)o; tmp = ((PyObject*)p->nodes); p->nodes = ((PyObject*)Py_None); Py_INCREF(Py_None); Py_XDECREF(tmp); return 0; } static PyObject *__pyx_getprop_11pygame_sdl2_6render_6Sprite_pos(PyObject *o, CYTHON_UNUSED void *x) { return __pyx_pw_11pygame_sdl2_6render_6Sprite_3pos_1__get__(o); } static int __pyx_setprop_11pygame_sdl2_6render_6Sprite_pos(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) { if (v) { return __pyx_pw_11pygame_sdl2_6render_6Sprite_3pos_3__set__(o, v); } else { PyErr_SetString(PyExc_NotImplementedError, "__del__"); return -1; } } static int __pyx_setprop_11pygame_sdl2_6render_6Sprite_color(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) { if (v) { return __pyx_pw_11pygame_sdl2_6render_6Sprite_5color_1__set__(o, v); } else { PyErr_SetString(PyExc_NotImplementedError, "__del__"); return -1; } } static PyObject *__pyx_getprop_11pygame_sdl2_6render_6Sprite_alpha(PyObject *o, CYTHON_UNUSED void *x) { return __pyx_pw_11pygame_sdl2_6render_6Sprite_5alpha_1__get__(o); } static int __pyx_setprop_11pygame_sdl2_6render_6Sprite_alpha(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) { if (v) { return __pyx_pw_11pygame_sdl2_6render_6Sprite_5alpha_3__set__(o, v); } else { PyErr_SetString(PyExc_NotImplementedError, "__del__"); return -1; } } static PyObject *__pyx_getprop_11pygame_sdl2_6render_6Sprite_rotation(PyObject *o, CYTHON_UNUSED void *x) { return __pyx_pw_11pygame_sdl2_6render_6Sprite_8rotation_1__get__(o); } static int __pyx_setprop_11pygame_sdl2_6render_6Sprite_rotation(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) { if (v) { return __pyx_pw_11pygame_sdl2_6render_6Sprite_8rotation_3__set__(o, v); } else { PyErr_SetString(PyExc_NotImplementedError, "__del__"); return -1; } } static PyObject *__pyx_getprop_11pygame_sdl2_6render_6Sprite_scale(PyObject *o, CYTHON_UNUSED void *x) { return __pyx_pw_11pygame_sdl2_6render_6Sprite_5scale_1__get__(o); } static int __pyx_setprop_11pygame_sdl2_6render_6Sprite_scale(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) { if (v) { return __pyx_pw_11pygame_sdl2_6render_6Sprite_5scale_3__set__(o, v); } else { PyErr_SetString(PyExc_NotImplementedError, "__del__"); return -1; } } static PyObject *__pyx_getprop_11pygame_sdl2_6render_6Sprite_hflip(PyObject *o, CYTHON_UNUSED void *x) { return __pyx_pw_11pygame_sdl2_6render_6Sprite_5hflip_1__get__(o); } static int __pyx_setprop_11pygame_sdl2_6render_6Sprite_hflip(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) { if (v) { return __pyx_pw_11pygame_sdl2_6render_6Sprite_5hflip_3__set__(o, v); } else { PyErr_SetString(PyExc_NotImplementedError, "__del__"); return -1; } } static PyObject *__pyx_getprop_11pygame_sdl2_6render_6Sprite_vflip(PyObject *o, CYTHON_UNUSED void *x) { return __pyx_pw_11pygame_sdl2_6render_6Sprite_5vflip_1__get__(o); } static int __pyx_setprop_11pygame_sdl2_6render_6Sprite_vflip(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) { if (v) { return __pyx_pw_11pygame_sdl2_6render_6Sprite_5vflip_3__set__(o, v); } else { PyErr_SetString(PyExc_NotImplementedError, "__del__"); return -1; } } static PyMethodDef __pyx_methods_11pygame_sdl2_6render_Sprite[] = { {"render", (PyCFunction)__pyx_pw_11pygame_sdl2_6render_6Sprite_3render, METH_VARARGS|METH_KEYWORDS, 0}, {"collides", (PyCFunction)__pyx_pw_11pygame_sdl2_6render_6Sprite_5collides, METH_O, 0}, {0, 0, 0, 0} }; static struct PyGetSetDef __pyx_getsets_11pygame_sdl2_6render_Sprite[] = { {(char *)"pos", __pyx_getprop_11pygame_sdl2_6render_6Sprite_pos, __pyx_setprop_11pygame_sdl2_6render_6Sprite_pos, 0, 0}, {(char *)"color", 0, __pyx_setprop_11pygame_sdl2_6render_6Sprite_color, 0, 0}, {(char *)"alpha", __pyx_getprop_11pygame_sdl2_6render_6Sprite_alpha, __pyx_setprop_11pygame_sdl2_6render_6Sprite_alpha, 0, 0}, {(char *)"rotation", __pyx_getprop_11pygame_sdl2_6render_6Sprite_rotation, __pyx_setprop_11pygame_sdl2_6render_6Sprite_rotation, 0, 0}, {(char *)"scale", __pyx_getprop_11pygame_sdl2_6render_6Sprite_scale, __pyx_setprop_11pygame_sdl2_6render_6Sprite_scale, 0, 0}, {(char *)"hflip", __pyx_getprop_11pygame_sdl2_6render_6Sprite_hflip, __pyx_setprop_11pygame_sdl2_6render_6Sprite_hflip, 0, 0}, {(char *)"vflip", __pyx_getprop_11pygame_sdl2_6render_6Sprite_vflip, __pyx_setprop_11pygame_sdl2_6render_6Sprite_vflip, 0, 0}, {0, 0, 0, 0, 0} }; static PyTypeObject __pyx_type_11pygame_sdl2_6render_Sprite = { PyVarObject_HEAD_INIT(0, 0) "pygame_sdl2.render.Sprite", /*tp_name*/ sizeof(struct __pyx_obj_11pygame_sdl2_6render_Sprite), /*tp_basicsize*/ 0, /*tp_itemsize*/ __pyx_tp_dealloc_11pygame_sdl2_6render_Sprite, /*tp_dealloc*/ 0, /*tp_print*/ 0, /*tp_getattr*/ 0, /*tp_setattr*/ #if PY_MAJOR_VERSION < 3 0, /*tp_compare*/ #endif #if PY_MAJOR_VERSION >= 3 0, /*tp_as_async*/ #endif 0, /*tp_repr*/ 0, /*tp_as_number*/ 0, /*tp_as_sequence*/ 0, /*tp_as_mapping*/ 0, /*tp_hash*/ 0, /*tp_call*/ 0, /*tp_str*/ 0, /*tp_getattro*/ 0, /*tp_setattro*/ 0, /*tp_as_buffer*/ Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/ " One or more TextureNodes, with possible transforms applied. ", /*tp_doc*/ __pyx_tp_traverse_11pygame_sdl2_6render_Sprite, /*tp_traverse*/ __pyx_tp_clear_11pygame_sdl2_6render_Sprite, /*tp_clear*/ 0, /*tp_richcompare*/ 0, /*tp_weaklistoffset*/ 0, /*tp_iter*/ 0, /*tp_iternext*/ __pyx_methods_11pygame_sdl2_6render_Sprite, /*tp_methods*/ 0, /*tp_members*/ __pyx_getsets_11pygame_sdl2_6render_Sprite, /*tp_getset*/ 0, /*tp_base*/ 0, /*tp_dict*/ 0, /*tp_descr_get*/ 0, /*tp_descr_set*/ 0, /*tp_dictoffset*/ __pyx_pw_11pygame_sdl2_6render_6Sprite_1__init__, /*tp_init*/ 0, /*tp_alloc*/ __pyx_tp_new_11pygame_sdl2_6render_Sprite, /*tp_new*/ 0, /*tp_free*/ 0, /*tp_is_gc*/ 0, /*tp_bases*/ 0, /*tp_mro*/ 0, /*tp_cache*/ 0, /*tp_subclasses*/ 0, /*tp_weaklist*/ 0, /*tp_del*/ 0, /*tp_version_tag*/ #if PY_VERSION_HEX >= 0x030400a1 0, /*tp_finalize*/ #endif }; static PyObject *__pyx_tp_new_11pygame_sdl2_6render_Container(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) { struct __pyx_obj_11pygame_sdl2_6render_Container *p; PyObject *o; if (likely((t->tp_flags & Py_TPFLAGS_IS_ABSTRACT) == 0)) { o = (*t->tp_alloc)(t, 0); } else { o = (PyObject *) PyBaseObject_Type.tp_new(t, __pyx_empty_tuple, 0); } if (unlikely(!o)) return 0; p = ((struct __pyx_obj_11pygame_sdl2_6render_Container *)o); p->sprites = ((PyObject*)Py_None); Py_INCREF(Py_None); return o; } static void __pyx_tp_dealloc_11pygame_sdl2_6render_Container(PyObject *o) { struct __pyx_obj_11pygame_sdl2_6render_Container *p = (struct __pyx_obj_11pygame_sdl2_6render_Container *)o; #if PY_VERSION_HEX >= 0x030400a1 if (unlikely(Py_TYPE(o)->tp_finalize) && !_PyGC_FINALIZED(o)) { if (PyObject_CallFinalizerFromDealloc(o)) return; } #endif PyObject_GC_UnTrack(o); Py_CLEAR(p->sprites); (*Py_TYPE(o)->tp_free)(o); } static int __pyx_tp_traverse_11pygame_sdl2_6render_Container(PyObject *o, visitproc v, void *a) { int e; struct __pyx_obj_11pygame_sdl2_6render_Container *p = (struct __pyx_obj_11pygame_sdl2_6render_Container *)o; if (p->sprites) { e = (*v)(p->sprites, a); if (e) return e; } return 0; } static int __pyx_tp_clear_11pygame_sdl2_6render_Container(PyObject *o) { PyObject* tmp; struct __pyx_obj_11pygame_sdl2_6render_Container *p = (struct __pyx_obj_11pygame_sdl2_6render_Container *)o; tmp = ((PyObject*)p->sprites); p->sprites = ((PyObject*)Py_None); Py_INCREF(Py_None); Py_XDECREF(tmp); return 0; } static PyObject *__pyx_getprop_11pygame_sdl2_6render_9Container_pos(PyObject *o, CYTHON_UNUSED void *x) { return __pyx_pw_11pygame_sdl2_6render_9Container_3pos_1__get__(o); } static int __pyx_setprop_11pygame_sdl2_6render_9Container_pos(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) { if (v) { return __pyx_pw_11pygame_sdl2_6render_9Container_3pos_3__set__(o, v); } else { PyErr_SetString(PyExc_NotImplementedError, "__del__"); return -1; } } static PyObject *__pyx_getprop_11pygame_sdl2_6render_9Container_rect(PyObject *o, CYTHON_UNUSED void *x) { return __pyx_pw_11pygame_sdl2_6render_9Container_4rect_1__get__(o); } static int __pyx_setprop_11pygame_sdl2_6render_9Container_rect(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) { if (v) { return __pyx_pw_11pygame_sdl2_6render_9Container_4rect_3__set__(o, v); } else { PyErr_SetString(PyExc_NotImplementedError, "__del__"); return -1; } } static PyMethodDef __pyx_methods_11pygame_sdl2_6render_Container[] = { {"add", (PyCFunction)__pyx_pw_11pygame_sdl2_6render_9Container_3add, METH_O, 0}, {"render", (PyCFunction)__pyx_pw_11pygame_sdl2_6render_9Container_5render, METH_VARARGS|METH_KEYWORDS, 0}, {0, 0, 0, 0} }; static struct PyGetSetDef __pyx_getsets_11pygame_sdl2_6render_Container[] = { {(char *)"pos", __pyx_getprop_11pygame_sdl2_6render_9Container_pos, __pyx_setprop_11pygame_sdl2_6render_9Container_pos, 0, 0}, {(char *)"rect", __pyx_getprop_11pygame_sdl2_6render_9Container_rect, __pyx_setprop_11pygame_sdl2_6render_9Container_rect, 0, 0}, {0, 0, 0, 0, 0} }; static PyTypeObject __pyx_type_11pygame_sdl2_6render_Container = { PyVarObject_HEAD_INIT(0, 0) "pygame_sdl2.render.Container", /*tp_name*/ sizeof(struct __pyx_obj_11pygame_sdl2_6render_Container), /*tp_basicsize*/ 0, /*tp_itemsize*/ __pyx_tp_dealloc_11pygame_sdl2_6render_Container, /*tp_dealloc*/ 0, /*tp_print*/ 0, /*tp_getattr*/ 0, /*tp_setattr*/ #if PY_MAJOR_VERSION < 3 0, /*tp_compare*/ #endif #if PY_MAJOR_VERSION >= 3 0, /*tp_as_async*/ #endif 0, /*tp_repr*/ 0, /*tp_as_number*/ 0, /*tp_as_sequence*/ 0, /*tp_as_mapping*/ 0, /*tp_hash*/ 0, /*tp_call*/ 0, /*tp_str*/ 0, /*tp_getattro*/ 0, /*tp_setattro*/ 0, /*tp_as_buffer*/ Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/ " Multiple sprites, positioned relative to the container. ", /*tp_doc*/ __pyx_tp_traverse_11pygame_sdl2_6render_Container, /*tp_traverse*/ __pyx_tp_clear_11pygame_sdl2_6render_Container, /*tp_clear*/ 0, /*tp_richcompare*/ 0, /*tp_weaklistoffset*/ 0, /*tp_iter*/ 0, /*tp_iternext*/ __pyx_methods_11pygame_sdl2_6render_Container, /*tp_methods*/ 0, /*tp_members*/ __pyx_getsets_11pygame_sdl2_6render_Container, /*tp_getset*/ 0, /*tp_base*/ 0, /*tp_dict*/ 0, /*tp_descr_get*/ 0, /*tp_descr_set*/ 0, /*tp_dictoffset*/ __pyx_pw_11pygame_sdl2_6render_9Container_1__init__, /*tp_init*/ 0, /*tp_alloc*/ __pyx_tp_new_11pygame_sdl2_6render_Container, /*tp_new*/ 0, /*tp_free*/ 0, /*tp_is_gc*/ 0, /*tp_bases*/ 0, /*tp_mro*/ 0, /*tp_cache*/ 0, /*tp_subclasses*/ 0, /*tp_weaklist*/ 0, /*tp_del*/ 0, /*tp_version_tag*/ #if PY_VERSION_HEX >= 0x030400a1 0, /*tp_finalize*/ #endif }; static PyMethodDef __pyx_methods[] = { {0, 0, 0, 0} }; #if PY_MAJOR_VERSION >= 3 static struct PyModuleDef __pyx_moduledef = { #if PY_VERSION_HEX < 0x03020000 { PyObject_HEAD_INIT(NULL) NULL, 0, NULL }, #else PyModuleDef_HEAD_INIT, #endif "render", 0, /* m_doc */ -1, /* m_size */ __pyx_methods /* m_methods */, NULL, /* m_reload */ NULL, /* m_traverse */ NULL, /* m_clear */ NULL /* m_free */ }; #endif static __Pyx_StringTabEntry __pyx_string_tab[] = { {&__pyx_n_s_BLENDMODE_ADD, __pyx_k_BLENDMODE_ADD, sizeof(__pyx_k_BLENDMODE_ADD), 0, 0, 1, 1}, {&__pyx_n_s_BLENDMODE_BLEND, __pyx_k_BLENDMODE_BLEND, sizeof(__pyx_k_BLENDMODE_BLEND), 0, 0, 1, 1}, {&__pyx_n_s_BLENDMODE_MOD, __pyx_k_BLENDMODE_MOD, sizeof(__pyx_k_BLENDMODE_MOD), 0, 0, 1, 1}, {&__pyx_n_s_BLENDMODE_NONE, __pyx_k_BLENDMODE_NONE, sizeof(__pyx_k_BLENDMODE_NONE), 0, 0, 1, 1}, {&__pyx_n_s_Color, __pyx_k_Color, sizeof(__pyx_k_Color), 0, 0, 1, 1}, {&__pyx_kp_u_Invalid_argument_s, __pyx_k_Invalid_argument_s, sizeof(__pyx_k_Invalid_argument_s), 0, 1, 0, 0}, {&__pyx_n_s_Rect, __pyx_k_Rect, sizeof(__pyx_k_Rect), 0, 0, 1, 1}, {&__pyx_kp_u_Renderer_is_not_accelerated, __pyx_k_Renderer_is_not_accelerated, sizeof(__pyx_k_Renderer_is_not_accelerated), 0, 1, 0, 0}, {&__pyx_kp_u_Rotation_not_supported_yet, __pyx_k_Rotation_not_supported_yet, sizeof(__pyx_k_Rotation_not_supported_yet), 0, 1, 0, 0}, {&__pyx_n_s_ValueError, __pyx_k_ValueError, sizeof(__pyx_k_ValueError), 0, 0, 1, 1}, {&__pyx_n_s_a, __pyx_k_a, sizeof(__pyx_k_a), 0, 0, 1, 1}, {&__pyx_n_u_accelerated, __pyx_k_accelerated, sizeof(__pyx_k_accelerated), 0, 1, 0, 1}, {&__pyx_n_s_b, __pyx_k_b, sizeof(__pyx_k_b), 0, 0, 1, 1}, {&__pyx_n_s_color, __pyx_k_color, sizeof(__pyx_k_color), 0, 0, 1, 1}, {&__pyx_n_s_dest, __pyx_k_dest, sizeof(__pyx_k_dest), 0, 0, 1, 1}, {&__pyx_n_s_driver, __pyx_k_driver, sizeof(__pyx_k_driver), 0, 0, 1, 1}, {&__pyx_n_s_error, __pyx_k_error, sizeof(__pyx_k_error), 0, 0, 1, 1}, {&__pyx_n_s_fi, __pyx_k_fi, sizeof(__pyx_k_fi), 0, 0, 1, 1}, {&__pyx_n_u_frame, __pyx_k_frame, sizeof(__pyx_k_frame), 0, 1, 0, 1}, {&__pyx_n_u_frames, __pyx_k_frames, sizeof(__pyx_k_frames), 0, 1, 0, 1}, {&__pyx_n_s_g, __pyx_k_g, sizeof(__pyx_k_g), 0, 0, 1, 1}, {&__pyx_n_s_get_drivers, __pyx_k_get_drivers, sizeof(__pyx_k_get_drivers), 0, 0, 1, 1}, {&__pyx_n_s_h, __pyx_k_h, sizeof(__pyx_k_h), 0, 0, 1, 1}, {&__pyx_n_u_h, __pyx_k_h, sizeof(__pyx_k_h), 0, 1, 0, 1}, {&__pyx_kp_s_home_tom_ab_pygame_sdl2_src_pyg, __pyx_k_home_tom_ab_pygame_sdl2_src_pyg, sizeof(__pyx_k_home_tom_ab_pygame_sdl2_src_pyg), 0, 0, 1, 0}, {&__pyx_n_u_image, __pyx_k_image, sizeof(__pyx_k_image), 0, 1, 0, 1}, {&__pyx_n_s_import, __pyx_k_import, sizeof(__pyx_k_import), 0, 0, 1, 1}, {&__pyx_n_s_info, __pyx_k_info, sizeof(__pyx_k_info), 0, 0, 1, 1}, {&__pyx_n_s_iteritems, __pyx_k_iteritems, sizeof(__pyx_k_iteritems), 0, 0, 1, 1}, {&__pyx_n_s_json, __pyx_k_json, sizeof(__pyx_k_json), 0, 0, 1, 1}, {&__pyx_n_s_keys, __pyx_k_keys, sizeof(__pyx_k_keys), 0, 0, 1, 1}, {&__pyx_n_s_load, __pyx_k_load, sizeof(__pyx_k_load), 0, 0, 1, 1}, {&__pyx_n_s_load_texture, __pyx_k_load_texture, sizeof(__pyx_k_load_texture), 0, 0, 1, 1}, {&__pyx_n_s_main, __pyx_k_main, sizeof(__pyx_k_main), 0, 0, 1, 1}, {&__pyx_n_u_max_texture_height, __pyx_k_max_texture_height, sizeof(__pyx_k_max_texture_height), 0, 1, 0, 1}, {&__pyx_n_u_max_texture_width, __pyx_k_max_texture_width, sizeof(__pyx_k_max_texture_width), 0, 1, 0, 1}, {&__pyx_n_u_meta, __pyx_k_meta, sizeof(__pyx_k_meta), 0, 1, 0, 1}, {&__pyx_n_s_n, __pyx_k_n, sizeof(__pyx_k_n), 0, 0, 1, 1}, {&__pyx_n_u_name, __pyx_k_name, sizeof(__pyx_k_name), 0, 1, 0, 1}, {&__pyx_n_s_nodes, __pyx_k_nodes, sizeof(__pyx_k_nodes), 0, 0, 1, 1}, {&__pyx_n_s_num_drivers, __pyx_k_num_drivers, sizeof(__pyx_k_num_drivers), 0, 0, 1, 1}, {&__pyx_n_s_open, __pyx_k_open, sizeof(__pyx_k_open), 0, 0, 1, 1}, {&__pyx_n_s_pos, __pyx_k_pos, sizeof(__pyx_k_pos), 0, 0, 1, 1}, {&__pyx_n_s_pygame_sdl2_color, __pyx_k_pygame_sdl2_color, sizeof(__pyx_k_pygame_sdl2_color), 0, 0, 1, 1}, {&__pyx_n_s_pygame_sdl2_error, __pyx_k_pygame_sdl2_error, sizeof(__pyx_k_pygame_sdl2_error), 0, 0, 1, 1}, {&__pyx_n_s_pygame_sdl2_rect, __pyx_k_pygame_sdl2_rect, sizeof(__pyx_k_pygame_sdl2_rect), 0, 0, 1, 1}, {&__pyx_n_s_pygame_sdl2_render, __pyx_k_pygame_sdl2_render, sizeof(__pyx_k_pygame_sdl2_render), 0, 0, 1, 1}, {&__pyx_n_s_pyx_vtable, __pyx_k_pyx_vtable, sizeof(__pyx_k_pyx_vtable), 0, 0, 1, 1}, {&__pyx_n_s_r, __pyx_k_r, sizeof(__pyx_k_r), 0, 0, 1, 1}, {&__pyx_n_u_r, __pyx_k_r, sizeof(__pyx_k_r), 0, 1, 0, 1}, {&__pyx_n_s_range, __pyx_k_range, sizeof(__pyx_k_range), 0, 0, 1, 1}, {&__pyx_n_s_rect, __pyx_k_rect, sizeof(__pyx_k_rect), 0, 0, 1, 1}, {&__pyx_n_s_ren, __pyx_k_ren, sizeof(__pyx_k_ren), 0, 0, 1, 1}, {&__pyx_n_s_render, __pyx_k_render, sizeof(__pyx_k_render), 0, 0, 1, 1}, {&__pyx_n_s_rinfo, __pyx_k_rinfo, sizeof(__pyx_k_rinfo), 0, 0, 1, 1}, {&__pyx_n_u_rotated, __pyx_k_rotated, sizeof(__pyx_k_rotated), 0, 1, 0, 1}, {&__pyx_n_u_rtt, __pyx_k_rtt, sizeof(__pyx_k_rtt), 0, 1, 0, 1}, {&__pyx_n_s_rv, __pyx_k_rv, sizeof(__pyx_k_rv), 0, 0, 1, 1}, {&__pyx_n_u_software, __pyx_k_software, sizeof(__pyx_k_software), 0, 1, 0, 1}, {&__pyx_n_u_sourceSize, __pyx_k_sourceSize, sizeof(__pyx_k_sourceSize), 0, 1, 0, 1}, {&__pyx_n_u_spriteSourceSize, __pyx_k_spriteSourceSize, sizeof(__pyx_k_spriteSourceSize), 0, 1, 0, 1}, {&__pyx_n_s_test, __pyx_k_test, sizeof(__pyx_k_test), 0, 0, 1, 1}, {&__pyx_n_s_tex, __pyx_k_tex, sizeof(__pyx_k_tex), 0, 0, 1, 1}, {&__pyx_n_s_vsync, __pyx_k_vsync, sizeof(__pyx_k_vsync), 0, 0, 1, 1}, {&__pyx_n_u_vsync, __pyx_k_vsync, sizeof(__pyx_k_vsync), 0, 1, 0, 1}, {&__pyx_n_s_w, __pyx_k_w, sizeof(__pyx_k_w), 0, 0, 1, 1}, {&__pyx_n_u_w, __pyx_k_w, sizeof(__pyx_k_w), 0, 1, 0, 1}, {&__pyx_n_s_warn, __pyx_k_warn, sizeof(__pyx_k_warn), 0, 0, 1, 1}, {&__pyx_n_s_warnings, __pyx_k_warnings, sizeof(__pyx_k_warnings), 0, 0, 1, 1}, {&__pyx_n_s_window, __pyx_k_window, sizeof(__pyx_k_window), 0, 0, 1, 1}, {&__pyx_n_s_x, __pyx_k_x, sizeof(__pyx_k_x), 0, 0, 1, 1}, {&__pyx_n_u_x, __pyx_k_x, sizeof(__pyx_k_x), 0, 1, 0, 1}, {&__pyx_n_s_x1, __pyx_k_x1, sizeof(__pyx_k_x1), 0, 0, 1, 1}, {&__pyx_n_s_x2, __pyx_k_x2, sizeof(__pyx_k_x2), 0, 0, 1, 1}, {&__pyx_n_s_y, __pyx_k_y, sizeof(__pyx_k_y), 0, 0, 1, 1}, {&__pyx_n_u_y, __pyx_k_y, sizeof(__pyx_k_y), 0, 1, 0, 1}, {&__pyx_n_s_y1, __pyx_k_y1, sizeof(__pyx_k_y1), 0, 0, 1, 1}, {&__pyx_n_s_y2, __pyx_k_y2, sizeof(__pyx_k_y2), 0, 0, 1, 1}, {0, 0, 0, 0, 0, 0, 0} }; static int __Pyx_InitCachedBuiltins(void) { __pyx_builtin_range = __Pyx_GetBuiltinName(__pyx_n_s_range); if (!__pyx_builtin_range) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 58; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_builtin_ValueError = __Pyx_GetBuiltinName(__pyx_n_s_ValueError); if (!__pyx_builtin_ValueError) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 227; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_builtin_open = __Pyx_GetBuiltinName(__pyx_n_s_open); if (!__pyx_builtin_open) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 249; __pyx_clineno = __LINE__; goto __pyx_L1_error;} return 0; __pyx_L1_error:; return -1; } static int __Pyx_InitCachedConstants(void) { __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__Pyx_InitCachedConstants", 0); /* "pygame_sdl2/render.pyx":99 * * if not self.info()["accelerated"]: * warnings.warn("Renderer is not accelerated.") # <<<<<<<<<<<<<< * * def load_texture(self, fi): */ __pyx_tuple_ = PyTuple_Pack(1, __pyx_kp_u_Renderer_is_not_accelerated); if (unlikely(!__pyx_tuple_)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 99; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_tuple_); __Pyx_GIVEREF(__pyx_tuple_); /* "pygame_sdl2/render.pyx":265 * to_sdl_rect((f['x'], f['y'], f['w'], f['h']), &itex.trimmed_rect, "spriteSourceSize") * if idict["rotated"]: * raise error("Rotation not supported yet.") # <<<<<<<<<<<<<< * itex.source_w = idict["sourceSize"]["w"] * itex.source_h = idict["sourceSize"]["h"] */ __pyx_tuple__2 = PyTuple_Pack(1, __pyx_kp_u_Rotation_not_supported_yet); if (unlikely(!__pyx_tuple__2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 265; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_tuple__2); __Pyx_GIVEREF(__pyx_tuple__2); /* "pygame_sdl2/render.pyx":52 * } * * def get_drivers(): # <<<<<<<<<<<<<< * cdef SDL_RendererInfo rinfo * cdef int num_drivers */ __pyx_tuple__3 = PyTuple_Pack(4, __pyx_n_s_rinfo, __pyx_n_s_num_drivers, __pyx_n_s_rv, __pyx_n_s_n); if (unlikely(!__pyx_tuple__3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 52; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_tuple__3); __Pyx_GIVEREF(__pyx_tuple__3); __pyx_codeobj__4 = (PyObject*)__Pyx_PyCode_New(0, 0, 4, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__3, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_tom_ab_pygame_sdl2_src_pyg, __pyx_n_s_get_drivers, 52, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 52; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_RefNannyFinishContext(); return 0; __pyx_L1_error:; __Pyx_RefNannyFinishContext(); return -1; } static int __Pyx_InitGlobals(void) { if (__Pyx_InitStrings(__pyx_string_tab) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; __pyx_int_0 = PyInt_FromLong(0); if (unlikely(!__pyx_int_0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_int_neg_1 = PyInt_FromLong(-1); if (unlikely(!__pyx_int_neg_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} return 0; __pyx_L1_error:; return -1; } #if PY_MAJOR_VERSION < 3 PyMODINIT_FUNC initrender(void); /*proto*/ PyMODINIT_FUNC initrender(void) #else PyMODINIT_FUNC PyInit_render(void); /*proto*/ PyMODINIT_FUNC PyInit_render(void) #endif { PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; PyObject *__pyx_t_5 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannyDeclarations #if CYTHON_REFNANNY __Pyx_RefNanny = __Pyx_RefNannyImportAPI("refnanny"); if (!__Pyx_RefNanny) { PyErr_Clear(); __Pyx_RefNanny = __Pyx_RefNannyImportAPI("Cython.Runtime.refnanny"); if (!__Pyx_RefNanny) Py_FatalError("failed to import 'refnanny' module"); } #endif __Pyx_RefNannySetupContext("PyMODINIT_FUNC PyInit_render(void)", 0); if (__Pyx_check_binary_version() < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_empty_tuple = PyTuple_New(0); if (unlikely(!__pyx_empty_tuple)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_empty_bytes = PyBytes_FromStringAndSize("", 0); if (unlikely(!__pyx_empty_bytes)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} #ifdef __Pyx_CyFunction_USED if (__pyx_CyFunction_init() < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} #endif #ifdef __Pyx_FusedFunction_USED if (__pyx_FusedFunction_init() < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} #endif #ifdef __Pyx_Coroutine_USED if (__pyx_Coroutine_init() < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} #endif #ifdef __Pyx_Generator_USED if (__pyx_Generator_init() < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} #endif #ifdef __Pyx_StopAsyncIteration_USED if (__pyx_StopAsyncIteration_init() < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} #endif /*--- Library function declarations ---*/ /*--- Threads initialization code ---*/ #if defined(__PYX_FORCE_INIT_THREADS) && __PYX_FORCE_INIT_THREADS #ifdef WITH_THREAD /* Python build with threading support? */ PyEval_InitThreads(); #endif #endif /*--- Module creation code ---*/ #if PY_MAJOR_VERSION < 3 __pyx_m = Py_InitModule4("render", __pyx_methods, 0, 0, PYTHON_API_VERSION); Py_XINCREF(__pyx_m); #else __pyx_m = PyModule_Create(&__pyx_moduledef); #endif if (unlikely(!__pyx_m)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_d = PyModule_GetDict(__pyx_m); if (unlikely(!__pyx_d)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} Py_INCREF(__pyx_d); __pyx_b = PyImport_AddModule(__Pyx_BUILTIN_MODULE_NAME); if (unlikely(!__pyx_b)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} #if CYTHON_COMPILING_IN_PYPY Py_INCREF(__pyx_b); #endif if (PyObject_SetAttrString(__pyx_m, "__builtins__", __pyx_b) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; /*--- Initialize various global constants etc. ---*/ if (__Pyx_InitGlobals() < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} #if PY_MAJOR_VERSION < 3 && (__PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT) if (__Pyx_init_sys_getdefaultencoding_params() < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} #endif if (__pyx_module_is_main_pygame_sdl2__render) { if (PyObject_SetAttrString(__pyx_m, "__name__", __pyx_n_s_main) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } #if PY_MAJOR_VERSION >= 3 { PyObject *modules = PyImport_GetModuleDict(); if (unlikely(!modules)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} if (!PyDict_GetItemString(modules, "pygame_sdl2.render")) { if (unlikely(PyDict_SetItemString(modules, "pygame_sdl2.render", __pyx_m) < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } } #endif /*--- Builtin init code ---*/ if (__Pyx_InitCachedBuiltins() < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /*--- Constants init code ---*/ if (__Pyx_InitCachedConstants() < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /*--- Global init code ---*/ /*--- Variable export code ---*/ /*--- Function export code ---*/ /*--- Type init code ---*/ __pyx_vtabptr_11pygame_sdl2_6render_Renderer = &__pyx_vtable_11pygame_sdl2_6render_Renderer; __pyx_vtable_11pygame_sdl2_6render_Renderer.set_drawcolor = (PyObject *(*)(struct __pyx_obj_11pygame_sdl2_6render_Renderer *, PyObject *))__pyx_f_11pygame_sdl2_6render_8Renderer_set_drawcolor; if (PyType_Ready(&__pyx_type_11pygame_sdl2_6render_Renderer) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 67; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_type_11pygame_sdl2_6render_Renderer.tp_print = 0; if (__Pyx_SetVtable(__pyx_type_11pygame_sdl2_6render_Renderer.tp_dict, __pyx_vtabptr_11pygame_sdl2_6render_Renderer) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 67; __pyx_clineno = __LINE__; goto __pyx_L1_error;} if (PyObject_SetAttrString(__pyx_m, "Renderer", (PyObject *)&__pyx_type_11pygame_sdl2_6render_Renderer) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 67; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_ptype_11pygame_sdl2_6render_Renderer = &__pyx_type_11pygame_sdl2_6render_Renderer; __pyx_vtabptr_11pygame_sdl2_6render_Texture = &__pyx_vtable_11pygame_sdl2_6render_Texture; __pyx_vtable_11pygame_sdl2_6render_Texture.set = (PyObject *(*)(struct __pyx_obj_11pygame_sdl2_6render_Texture *, SDL_Renderer *, SDL_Texture *))__pyx_f_11pygame_sdl2_6render_7Texture_set; if (PyType_Ready(&__pyx_type_11pygame_sdl2_6render_Texture) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 172; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_type_11pygame_sdl2_6render_Texture.tp_print = 0; if (__Pyx_SetVtable(__pyx_type_11pygame_sdl2_6render_Texture.tp_dict, __pyx_vtabptr_11pygame_sdl2_6render_Texture) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 172; __pyx_clineno = __LINE__; goto __pyx_L1_error;} if (PyObject_SetAttrString(__pyx_m, "Texture", (PyObject *)&__pyx_type_11pygame_sdl2_6render_Texture) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 172; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_ptype_11pygame_sdl2_6render_Texture = &__pyx_type_11pygame_sdl2_6render_Texture; if (PyType_Ready(&__pyx_type_11pygame_sdl2_6render_TextureNode) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 200; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_type_11pygame_sdl2_6render_TextureNode.tp_print = 0; if (PyObject_SetAttrString(__pyx_m, "TextureNode", (PyObject *)&__pyx_type_11pygame_sdl2_6render_TextureNode) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 200; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_ptype_11pygame_sdl2_6render_TextureNode = &__pyx_type_11pygame_sdl2_6render_TextureNode; if (PyType_Ready(&__pyx_type_11pygame_sdl2_6render_TextureAtlas) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 245; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_type_11pygame_sdl2_6render_TextureAtlas.tp_print = 0; if (PyObject_SetAttrString(__pyx_m, "TextureAtlas", (PyObject *)&__pyx_type_11pygame_sdl2_6render_TextureAtlas) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 245; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_ptype_11pygame_sdl2_6render_TextureAtlas = &__pyx_type_11pygame_sdl2_6render_TextureAtlas; __pyx_vtabptr_11pygame_sdl2_6render_Sprite = &__pyx_vtable_11pygame_sdl2_6render_Sprite; __pyx_vtable_11pygame_sdl2_6render_Sprite.adjust_rect = (void (*)(struct __pyx_obj_11pygame_sdl2_6render_Sprite *, SDL_Rect const *, SDL_Rect const *, SDL_Rect *))__pyx_f_11pygame_sdl2_6render_6Sprite_adjust_rect; if (PyType_Ready(&__pyx_type_11pygame_sdl2_6render_Sprite) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 278; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_type_11pygame_sdl2_6render_Sprite.tp_print = 0; if (__Pyx_SetVtable(__pyx_type_11pygame_sdl2_6render_Sprite.tp_dict, __pyx_vtabptr_11pygame_sdl2_6render_Sprite) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 278; __pyx_clineno = __LINE__; goto __pyx_L1_error;} if (PyObject_SetAttrString(__pyx_m, "Sprite", (PyObject *)&__pyx_type_11pygame_sdl2_6render_Sprite) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 278; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_ptype_11pygame_sdl2_6render_Sprite = &__pyx_type_11pygame_sdl2_6render_Sprite; if (PyType_Ready(&__pyx_type_11pygame_sdl2_6render_Container) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 434; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_type_11pygame_sdl2_6render_Container.tp_print = 0; #if CYTHON_COMPILING_IN_CPYTHON { PyObject *wrapper = PyObject_GetAttrString((PyObject *)&__pyx_type_11pygame_sdl2_6render_Container, "__init__"); if (unlikely(!wrapper)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 434; __pyx_clineno = __LINE__; goto __pyx_L1_error;} if (Py_TYPE(wrapper) == &PyWrapperDescr_Type) { __pyx_wrapperbase_11pygame_sdl2_6render_9Container___init__ = *((PyWrapperDescrObject *)wrapper)->d_base; __pyx_wrapperbase_11pygame_sdl2_6render_9Container___init__.doc = __pyx_doc_11pygame_sdl2_6render_9Container___init__; ((PyWrapperDescrObject *)wrapper)->d_base = &__pyx_wrapperbase_11pygame_sdl2_6render_9Container___init__; } } #endif if (PyObject_SetAttrString(__pyx_m, "Container", (PyObject *)&__pyx_type_11pygame_sdl2_6render_Container) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 434; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_ptype_11pygame_sdl2_6render_Container = &__pyx_type_11pygame_sdl2_6render_Container; /*--- Type import code ---*/ __pyx_ptype_11pygame_sdl2_7surface_Surface = __Pyx_ImportType("pygame_sdl2.surface", "Surface", sizeof(struct __pyx_obj_11pygame_sdl2_7surface_Surface), 1); if (unlikely(!__pyx_ptype_11pygame_sdl2_7surface_Surface)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 23; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_vtabptr_11pygame_sdl2_7surface_Surface = (struct __pyx_vtabstruct_11pygame_sdl2_7surface_Surface*)__Pyx_GetVtable(__pyx_ptype_11pygame_sdl2_7surface_Surface->tp_dict); if (unlikely(!__pyx_vtabptr_11pygame_sdl2_7surface_Surface)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 23; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_ptype_11pygame_sdl2_7display_Window = __Pyx_ImportType("pygame_sdl2.display", "Window", sizeof(struct __pyx_obj_11pygame_sdl2_7display_Window), 1); if (unlikely(!__pyx_ptype_11pygame_sdl2_7display_Window)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 23; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_ptype_11pygame_sdl2_4rect_Rect = __Pyx_ImportType("pygame_sdl2.rect", "Rect", sizeof(struct __pyx_obj_11pygame_sdl2_4rect_Rect), 1); if (unlikely(!__pyx_ptype_11pygame_sdl2_4rect_Rect)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 21; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /*--- Variable import code ---*/ __pyx_t_1 = __Pyx_ImportModule("pygame_sdl2.display"); if (!__pyx_t_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} if (__Pyx_ImportVoidPtr(__pyx_t_1, "main_window", (void **)&__pyx_vp_11pygame_sdl2_7display_main_window, "struct __pyx_obj_11pygame_sdl2_7display_Window *") < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} Py_DECREF(__pyx_t_1); __pyx_t_1 = 0; /*--- Function import code ---*/ __pyx_t_2 = __Pyx_ImportModule("pygame_sdl2.rwobject"); if (!__pyx_t_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} if (__Pyx_ImportFunction(__pyx_t_2, "to_rwops", (void (**)(void))&__pyx_f_11pygame_sdl2_8rwobject_to_rwops, "SDL_RWops *(PyObject *, struct __pyx_opt_args_11pygame_sdl2_8rwobject_to_rwops *__pyx_optional_args)") < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} Py_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_3 = __Pyx_ImportModule("pygame_sdl2.rect"); if (!__pyx_t_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} if (__Pyx_ImportFunction(__pyx_t_3, "to_sdl_rect", (void (**)(void))&__pyx_f_11pygame_sdl2_4rect_to_sdl_rect, "int (PyObject *, SDL_Rect *, struct __pyx_opt_args_11pygame_sdl2_4rect_to_sdl_rect *__pyx_optional_args)") < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} Py_DECREF(__pyx_t_3); __pyx_t_3 = 0; /*--- Execution code ---*/ #if defined(__Pyx_Generator_USED) || defined(__Pyx_Coroutine_USED) if (__Pyx_patch_abc() < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} #endif /* "pygame_sdl2/render.pyx":27 * from pygame_sdl2.rect cimport to_sdl_rect * * from pygame_sdl2.rect import Rect # <<<<<<<<<<<<<< * from pygame_sdl2.error import error * from pygame_sdl2.color import Color */ __pyx_t_4 = PyList_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 27; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); __Pyx_INCREF(__pyx_n_s_Rect); __Pyx_GIVEREF(__pyx_n_s_Rect); PyList_SET_ITEM(__pyx_t_4, 0, __pyx_n_s_Rect); __pyx_t_5 = __Pyx_Import(__pyx_n_s_pygame_sdl2_rect, __pyx_t_4, 0); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 27; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_t_4 = __Pyx_ImportFrom(__pyx_t_5, __pyx_n_s_Rect); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 27; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); if (PyDict_SetItem(__pyx_d, __pyx_n_s_Rect, __pyx_t_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 27; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; /* "pygame_sdl2/render.pyx":28 * * from pygame_sdl2.rect import Rect * from pygame_sdl2.error import error # <<<<<<<<<<<<<< * from pygame_sdl2.color import Color * import json */ __pyx_t_5 = PyList_New(1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 28; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); __Pyx_INCREF(__pyx_n_s_error); __Pyx_GIVEREF(__pyx_n_s_error); PyList_SET_ITEM(__pyx_t_5, 0, __pyx_n_s_error); __pyx_t_4 = __Pyx_Import(__pyx_n_s_pygame_sdl2_error, __pyx_t_5, 0); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 28; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __pyx_t_5 = __Pyx_ImportFrom(__pyx_t_4, __pyx_n_s_error); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 28; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); if (PyDict_SetItem(__pyx_d, __pyx_n_s_error, __pyx_t_5) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 28; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; /* "pygame_sdl2/render.pyx":29 * from pygame_sdl2.rect import Rect * from pygame_sdl2.error import error * from pygame_sdl2.color import Color # <<<<<<<<<<<<<< * import json * import warnings */ __pyx_t_4 = PyList_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 29; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); __Pyx_INCREF(__pyx_n_s_Color); __Pyx_GIVEREF(__pyx_n_s_Color); PyList_SET_ITEM(__pyx_t_4, 0, __pyx_n_s_Color); __pyx_t_5 = __Pyx_Import(__pyx_n_s_pygame_sdl2_color, __pyx_t_4, 0); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 29; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_t_4 = __Pyx_ImportFrom(__pyx_t_5, __pyx_n_s_Color); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 29; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); if (PyDict_SetItem(__pyx_d, __pyx_n_s_Color, __pyx_t_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 29; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; /* "pygame_sdl2/render.pyx":30 * from pygame_sdl2.error import error * from pygame_sdl2.color import Color * import json # <<<<<<<<<<<<<< * import warnings * */ __pyx_t_5 = __Pyx_Import(__pyx_n_s_json, 0, 0); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 30; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); if (PyDict_SetItem(__pyx_d, __pyx_n_s_json, __pyx_t_5) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 30; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; /* "pygame_sdl2/render.pyx":31 * from pygame_sdl2.color import Color * import json * import warnings # <<<<<<<<<<<<<< * * BLENDMODE_NONE = SDL_BLENDMODE_NONE */ __pyx_t_5 = __Pyx_Import(__pyx_n_s_warnings, 0, 0); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 31; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); if (PyDict_SetItem(__pyx_d, __pyx_n_s_warnings, __pyx_t_5) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 31; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; /* "pygame_sdl2/render.pyx":33 * import warnings * * BLENDMODE_NONE = SDL_BLENDMODE_NONE # <<<<<<<<<<<<<< * BLENDMODE_BLEND = SDL_BLENDMODE_BLEND * BLENDMODE_ADD = SDL_BLENDMODE_ADD */ __pyx_t_5 = __Pyx_PyInt_From_SDL_BlendMode(SDL_BLENDMODE_NONE); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 33; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); if (PyDict_SetItem(__pyx_d, __pyx_n_s_BLENDMODE_NONE, __pyx_t_5) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 33; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; /* "pygame_sdl2/render.pyx":34 * * BLENDMODE_NONE = SDL_BLENDMODE_NONE * BLENDMODE_BLEND = SDL_BLENDMODE_BLEND # <<<<<<<<<<<<<< * BLENDMODE_ADD = SDL_BLENDMODE_ADD * BLENDMODE_MOD = SDL_BLENDMODE_MOD */ __pyx_t_5 = __Pyx_PyInt_From_SDL_BlendMode(SDL_BLENDMODE_BLEND); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 34; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); if (PyDict_SetItem(__pyx_d, __pyx_n_s_BLENDMODE_BLEND, __pyx_t_5) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 34; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; /* "pygame_sdl2/render.pyx":35 * BLENDMODE_NONE = SDL_BLENDMODE_NONE * BLENDMODE_BLEND = SDL_BLENDMODE_BLEND * BLENDMODE_ADD = SDL_BLENDMODE_ADD # <<<<<<<<<<<<<< * BLENDMODE_MOD = SDL_BLENDMODE_MOD * */ __pyx_t_5 = __Pyx_PyInt_From_SDL_BlendMode(SDL_BLENDMODE_ADD); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 35; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); if (PyDict_SetItem(__pyx_d, __pyx_n_s_BLENDMODE_ADD, __pyx_t_5) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 35; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; /* "pygame_sdl2/render.pyx":36 * BLENDMODE_BLEND = SDL_BLENDMODE_BLEND * BLENDMODE_ADD = SDL_BLENDMODE_ADD * BLENDMODE_MOD = SDL_BLENDMODE_MOD # <<<<<<<<<<<<<< * * cdef bint DEBUG_DRAW_BBOX = True */ __pyx_t_5 = __Pyx_PyInt_From_SDL_BlendMode(SDL_BLENDMODE_MOD); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 36; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); if (PyDict_SetItem(__pyx_d, __pyx_n_s_BLENDMODE_MOD, __pyx_t_5) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 36; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; /* "pygame_sdl2/render.pyx":38 * BLENDMODE_MOD = SDL_BLENDMODE_MOD * * cdef bint DEBUG_DRAW_BBOX = True # <<<<<<<<<<<<<< * * cdef rinfo_to_dict(SDL_RendererInfo *rinfo): */ __pyx_v_11pygame_sdl2_6render_DEBUG_DRAW_BBOX = 1; /* "pygame_sdl2/render.pyx":52 * } * * def get_drivers(): # <<<<<<<<<<<<<< * cdef SDL_RendererInfo rinfo * cdef int num_drivers */ __pyx_t_5 = PyCFunction_NewEx(&__pyx_mdef_11pygame_sdl2_6render_1get_drivers, NULL, __pyx_n_s_pygame_sdl2_render); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 52; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); if (PyDict_SetItem(__pyx_d, __pyx_n_s_get_drivers, __pyx_t_5) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 52; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; /* "pygame_sdl2/render.pyx":1 * # Copyright 2014 Patrick Dawson # <<<<<<<<<<<<<< * # * # This software is provided 'as-is', without any express or implied */ __pyx_t_5 = PyDict_New(); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); if (PyDict_SetItem(__pyx_d, __pyx_n_s_test, __pyx_t_5) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; /*--- Wrapped vars code ---*/ goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_5); if (__pyx_m) { if (__pyx_d) { __Pyx_AddTraceback("init pygame_sdl2.render", __pyx_clineno, __pyx_lineno, __pyx_filename); } Py_DECREF(__pyx_m); __pyx_m = 0; } else if (!PyErr_Occurred()) { PyErr_SetString(PyExc_ImportError, "init pygame_sdl2.render"); } __pyx_L0:; __Pyx_RefNannyFinishContext(); #if PY_MAJOR_VERSION < 3 return; #else return __pyx_m; #endif } /* --- Runtime support code --- */ #if CYTHON_REFNANNY static __Pyx_RefNannyAPIStruct *__Pyx_RefNannyImportAPI(const char *modname) { PyObject *m = NULL, *p = NULL; void *r = NULL; m = PyImport_ImportModule((char *)modname); if (!m) goto end; p = PyObject_GetAttrString(m, (char *)"RefNannyAPI"); if (!p) goto end; r = PyLong_AsVoidPtr(p); end: Py_XDECREF(p); Py_XDECREF(m); return (__Pyx_RefNannyAPIStruct *)r; } #endif static PyObject *__Pyx_GetBuiltinName(PyObject *name) { PyObject* result = __Pyx_PyObject_GetAttrStr(__pyx_b, name); if (unlikely(!result)) { PyErr_Format(PyExc_NameError, #if PY_MAJOR_VERSION >= 3 "name '%U' is not defined", name); #else "name '%.200s' is not defined", PyString_AS_STRING(name)); #endif } return result; } static CYTHON_INLINE PyObject *__Pyx_GetModuleGlobalName(PyObject *name) { PyObject *result; #if CYTHON_COMPILING_IN_CPYTHON result = PyDict_GetItem(__pyx_d, name); if (likely(result)) { Py_INCREF(result); } else { #else result = PyObject_GetItem(__pyx_d, name); if (!result) { PyErr_Clear(); #endif result = __Pyx_GetBuiltinName(name); } return result; } #if CYTHON_COMPILING_IN_CPYTHON static CYTHON_INLINE PyObject* __Pyx_PyObject_Call(PyObject *func, PyObject *arg, PyObject *kw) { PyObject *result; ternaryfunc call = func->ob_type->tp_call; if (unlikely(!call)) return PyObject_Call(func, arg, kw); if (unlikely(Py_EnterRecursiveCall((char*)" while calling a Python object"))) return NULL; result = (*call)(func, arg, kw); Py_LeaveRecursiveCall(); if (unlikely(!result) && unlikely(!PyErr_Occurred())) { PyErr_SetString( PyExc_SystemError, "NULL result without error in PyObject_Call"); } return result; } #endif #if CYTHON_COMPILING_IN_CPYTHON static CYTHON_INLINE PyObject* __Pyx_PyObject_CallMethO(PyObject *func, PyObject *arg) { PyObject *self, *result; PyCFunction cfunc; cfunc = PyCFunction_GET_FUNCTION(func); self = PyCFunction_GET_SELF(func); if (unlikely(Py_EnterRecursiveCall((char*)" while calling a Python object"))) return NULL; result = cfunc(self, arg); Py_LeaveRecursiveCall(); if (unlikely(!result) && unlikely(!PyErr_Occurred())) { PyErr_SetString( PyExc_SystemError, "NULL result without error in PyObject_Call"); } return result; } #endif #if CYTHON_COMPILING_IN_CPYTHON static PyObject* __Pyx__PyObject_CallOneArg(PyObject *func, PyObject *arg) { PyObject *result; PyObject *args = PyTuple_New(1); if (unlikely(!args)) return NULL; Py_INCREF(arg); PyTuple_SET_ITEM(args, 0, arg); result = __Pyx_PyObject_Call(func, args, NULL); Py_DECREF(args); return result; } static CYTHON_INLINE PyObject* __Pyx_PyObject_CallOneArg(PyObject *func, PyObject *arg) { #ifdef __Pyx_CyFunction_USED if (likely(PyCFunction_Check(func) || PyObject_TypeCheck(func, __pyx_CyFunctionType))) { #else if (likely(PyCFunction_Check(func))) { #endif if (likely(PyCFunction_GET_FLAGS(func) & METH_O)) { return __Pyx_PyObject_CallMethO(func, arg); } } return __Pyx__PyObject_CallOneArg(func, arg); } #else static CYTHON_INLINE PyObject* __Pyx_PyObject_CallOneArg(PyObject *func, PyObject *arg) { PyObject* args = PyTuple_Pack(1, arg); return (likely(args)) ? __Pyx_PyObject_Call(func, args, NULL) : NULL; } #endif #if CYTHON_COMPILING_IN_CPYTHON static CYTHON_INLINE PyObject* __Pyx_PyObject_CallNoArg(PyObject *func) { #ifdef __Pyx_CyFunction_USED if (likely(PyCFunction_Check(func) || PyObject_TypeCheck(func, __pyx_CyFunctionType))) { #else if (likely(PyCFunction_Check(func))) { #endif if (likely(PyCFunction_GET_FLAGS(func) & METH_NOARGS)) { return __Pyx_PyObject_CallMethO(func, NULL); } } return __Pyx_PyObject_Call(func, __pyx_empty_tuple, NULL); } #endif static CYTHON_INLINE void __Pyx_ErrRestore(PyObject *type, PyObject *value, PyObject *tb) { #if CYTHON_COMPILING_IN_CPYTHON PyObject *tmp_type, *tmp_value, *tmp_tb; PyThreadState *tstate = PyThreadState_GET(); tmp_type = tstate->curexc_type; tmp_value = tstate->curexc_value; tmp_tb = tstate->curexc_traceback; tstate->curexc_type = type; tstate->curexc_value = value; tstate->curexc_traceback = tb; Py_XDECREF(tmp_type); Py_XDECREF(tmp_value); Py_XDECREF(tmp_tb); #else PyErr_Restore(type, value, tb); #endif } static CYTHON_INLINE void __Pyx_ErrFetch(PyObject **type, PyObject **value, PyObject **tb) { #if CYTHON_COMPILING_IN_CPYTHON PyThreadState *tstate = PyThreadState_GET(); *type = tstate->curexc_type; *value = tstate->curexc_value; *tb = tstate->curexc_traceback; tstate->curexc_type = 0; tstate->curexc_value = 0; tstate->curexc_traceback = 0; #else PyErr_Fetch(type, value, tb); #endif } #if PY_MAJOR_VERSION < 3 static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, CYTHON_UNUSED PyObject *cause) { Py_XINCREF(type); if (!value || value == Py_None) value = NULL; else Py_INCREF(value); if (!tb || tb == Py_None) tb = NULL; else { Py_INCREF(tb); if (!PyTraceBack_Check(tb)) { PyErr_SetString(PyExc_TypeError, "raise: arg 3 must be a traceback or None"); goto raise_error; } } if (PyType_Check(type)) { #if CYTHON_COMPILING_IN_PYPY if (!value) { Py_INCREF(Py_None); value = Py_None; } #endif PyErr_NormalizeException(&type, &value, &tb); } else { if (value) { PyErr_SetString(PyExc_TypeError, "instance exception may not have a separate value"); goto raise_error; } value = type; type = (PyObject*) Py_TYPE(type); Py_INCREF(type); if (!PyType_IsSubtype((PyTypeObject *)type, (PyTypeObject *)PyExc_BaseException)) { PyErr_SetString(PyExc_TypeError, "raise: exception class must be a subclass of BaseException"); goto raise_error; } } __Pyx_ErrRestore(type, value, tb); return; raise_error: Py_XDECREF(value); Py_XDECREF(type); Py_XDECREF(tb); return; } #else static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, PyObject *cause) { PyObject* owned_instance = NULL; if (tb == Py_None) { tb = 0; } else if (tb && !PyTraceBack_Check(tb)) { PyErr_SetString(PyExc_TypeError, "raise: arg 3 must be a traceback or None"); goto bad; } if (value == Py_None) value = 0; if (PyExceptionInstance_Check(type)) { if (value) { PyErr_SetString(PyExc_TypeError, "instance exception may not have a separate value"); goto bad; } value = type; type = (PyObject*) Py_TYPE(value); } else if (PyExceptionClass_Check(type)) { PyObject *instance_class = NULL; if (value && PyExceptionInstance_Check(value)) { instance_class = (PyObject*) Py_TYPE(value); if (instance_class != type) { int is_subclass = PyObject_IsSubclass(instance_class, type); if (!is_subclass) { instance_class = NULL; } else if (unlikely(is_subclass == -1)) { goto bad; } else { type = instance_class; } } } if (!instance_class) { PyObject *args; if (!value) args = PyTuple_New(0); else if (PyTuple_Check(value)) { Py_INCREF(value); args = value; } else args = PyTuple_Pack(1, value); if (!args) goto bad; owned_instance = PyObject_Call(type, args, NULL); Py_DECREF(args); if (!owned_instance) goto bad; value = owned_instance; if (!PyExceptionInstance_Check(value)) { PyErr_Format(PyExc_TypeError, "calling %R should have returned an instance of " "BaseException, not %R", type, Py_TYPE(value)); goto bad; } } } else { PyErr_SetString(PyExc_TypeError, "raise: exception class must be a subclass of BaseException"); goto bad; } #if PY_VERSION_HEX >= 0x03030000 if (cause) { #else if (cause && cause != Py_None) { #endif PyObject *fixed_cause; if (cause == Py_None) { fixed_cause = NULL; } else if (PyExceptionClass_Check(cause)) { fixed_cause = PyObject_CallObject(cause, NULL); if (fixed_cause == NULL) goto bad; } else if (PyExceptionInstance_Check(cause)) { fixed_cause = cause; Py_INCREF(fixed_cause); } else { PyErr_SetString(PyExc_TypeError, "exception causes must derive from " "BaseException"); goto bad; } PyException_SetCause(value, fixed_cause); } PyErr_SetObject(type, value); if (tb) { #if CYTHON_COMPILING_IN_PYPY PyObject *tmp_type, *tmp_value, *tmp_tb; PyErr_Fetch(&tmp_type, &tmp_value, &tmp_tb); Py_INCREF(tb); PyErr_Restore(tmp_type, tmp_value, tb); Py_XDECREF(tmp_tb); #else PyThreadState *tstate = PyThreadState_GET(); PyObject* tmp_tb = tstate->curexc_traceback; if (tb != tmp_tb) { Py_INCREF(tb); tstate->curexc_traceback = tb; Py_XDECREF(tmp_tb); } #endif } bad: Py_XDECREF(owned_instance); return; } #endif static void __Pyx_RaiseArgtupleInvalid( const char* func_name, int exact, Py_ssize_t num_min, Py_ssize_t num_max, Py_ssize_t num_found) { Py_ssize_t num_expected; const char *more_or_less; if (num_found < num_min) { num_expected = num_min; more_or_less = "at least"; } else { num_expected = num_max; more_or_less = "at most"; } if (exact) { more_or_less = "exactly"; } PyErr_Format(PyExc_TypeError, "%.200s() takes %.8s %" CYTHON_FORMAT_SSIZE_T "d positional argument%.1s (%" CYTHON_FORMAT_SSIZE_T "d given)", func_name, more_or_less, num_expected, (num_expected == 1) ? "" : "s", num_found); } static CYTHON_INLINE int __Pyx_CheckKeywordStrings( PyObject *kwdict, const char* function_name, int kw_allowed) { PyObject* key = 0; Py_ssize_t pos = 0; #if CYTHON_COMPILING_IN_PYPY if (!kw_allowed && PyDict_Next(kwdict, &pos, &key, 0)) goto invalid_keyword; return 1; #else while (PyDict_Next(kwdict, &pos, &key, 0)) { #if PY_MAJOR_VERSION < 3 if (unlikely(!PyString_CheckExact(key)) && unlikely(!PyString_Check(key))) #endif if (unlikely(!PyUnicode_Check(key))) goto invalid_keyword_type; } if ((!kw_allowed) && unlikely(key)) goto invalid_keyword; return 1; invalid_keyword_type: PyErr_Format(PyExc_TypeError, "%.200s() keywords must be strings", function_name); return 0; #endif invalid_keyword: PyErr_Format(PyExc_TypeError, #if PY_MAJOR_VERSION < 3 "%.200s() got an unexpected keyword argument '%.200s'", function_name, PyString_AsString(key)); #else "%s() got an unexpected keyword argument '%U'", function_name, key); #endif return 0; } static void __Pyx_RaiseDoubleKeywordsError( const char* func_name, PyObject* kw_name) { PyErr_Format(PyExc_TypeError, #if PY_MAJOR_VERSION >= 3 "%s() got multiple values for keyword argument '%U'", func_name, kw_name); #else "%s() got multiple values for keyword argument '%s'", func_name, PyString_AsString(kw_name)); #endif } static int __Pyx_ParseOptionalKeywords( PyObject *kwds, PyObject **argnames[], PyObject *kwds2, PyObject *values[], Py_ssize_t num_pos_args, const char* function_name) { PyObject *key = 0, *value = 0; Py_ssize_t pos = 0; PyObject*** name; PyObject*** first_kw_arg = argnames + num_pos_args; while (PyDict_Next(kwds, &pos, &key, &value)) { name = first_kw_arg; while (*name && (**name != key)) name++; if (*name) { values[name-argnames] = value; continue; } name = first_kw_arg; #if PY_MAJOR_VERSION < 3 if (likely(PyString_CheckExact(key)) || likely(PyString_Check(key))) { while (*name) { if ((CYTHON_COMPILING_IN_PYPY || PyString_GET_SIZE(**name) == PyString_GET_SIZE(key)) && _PyString_Eq(**name, key)) { values[name-argnames] = value; break; } name++; } if (*name) continue; else { PyObject*** argname = argnames; while (argname != first_kw_arg) { if ((**argname == key) || ( (CYTHON_COMPILING_IN_PYPY || PyString_GET_SIZE(**argname) == PyString_GET_SIZE(key)) && _PyString_Eq(**argname, key))) { goto arg_passed_twice; } argname++; } } } else #endif if (likely(PyUnicode_Check(key))) { while (*name) { int cmp = (**name == key) ? 0 : #if !CYTHON_COMPILING_IN_PYPY && PY_MAJOR_VERSION >= 3 (PyUnicode_GET_SIZE(**name) != PyUnicode_GET_SIZE(key)) ? 1 : #endif PyUnicode_Compare(**name, key); if (cmp < 0 && unlikely(PyErr_Occurred())) goto bad; if (cmp == 0) { values[name-argnames] = value; break; } name++; } if (*name) continue; else { PyObject*** argname = argnames; while (argname != first_kw_arg) { int cmp = (**argname == key) ? 0 : #if !CYTHON_COMPILING_IN_PYPY && PY_MAJOR_VERSION >= 3 (PyUnicode_GET_SIZE(**argname) != PyUnicode_GET_SIZE(key)) ? 1 : #endif PyUnicode_Compare(**argname, key); if (cmp < 0 && unlikely(PyErr_Occurred())) goto bad; if (cmp == 0) goto arg_passed_twice; argname++; } } } else goto invalid_keyword_type; if (kwds2) { if (unlikely(PyDict_SetItem(kwds2, key, value))) goto bad; } else { goto invalid_keyword; } } return 0; arg_passed_twice: __Pyx_RaiseDoubleKeywordsError(function_name, key); goto bad; invalid_keyword_type: PyErr_Format(PyExc_TypeError, "%.200s() keywords must be strings", function_name); goto bad; invalid_keyword: PyErr_Format(PyExc_TypeError, #if PY_MAJOR_VERSION < 3 "%.200s() got an unexpected keyword argument '%.200s'", function_name, PyString_AsString(key)); #else "%s() got an unexpected keyword argument '%U'", function_name, key); #endif bad: return -1; } static void __Pyx_RaiseArgumentTypeInvalid(const char* name, PyObject *obj, PyTypeObject *type) { PyErr_Format(PyExc_TypeError, "Argument '%.200s' has incorrect type (expected %.200s, got %.200s)", name, type->tp_name, Py_TYPE(obj)->tp_name); } static CYTHON_INLINE int __Pyx_ArgTypeTest(PyObject *obj, PyTypeObject *type, int none_allowed, const char *name, int exact) { if (unlikely(!type)) { PyErr_SetString(PyExc_SystemError, "Missing type object"); return 0; } if (none_allowed && obj == Py_None) return 1; else if (exact) { if (likely(Py_TYPE(obj) == type)) return 1; #if PY_MAJOR_VERSION == 2 else if ((type == &PyBaseString_Type) && likely(__Pyx_PyBaseString_CheckExact(obj))) return 1; #endif } else { if (likely(PyObject_TypeCheck(obj, type))) return 1; } __Pyx_RaiseArgumentTypeInvalid(name, obj, type); return 0; } static CYTHON_INLINE int __Pyx_TypeTest(PyObject *obj, PyTypeObject *type) { if (unlikely(!type)) { PyErr_SetString(PyExc_SystemError, "Missing type object"); return 0; } if (likely(PyObject_TypeCheck(obj, type))) return 1; PyErr_Format(PyExc_TypeError, "Cannot convert %.200s to %.200s", Py_TYPE(obj)->tp_name, type->tp_name); return 0; } static CYTHON_INLINE int __Pyx_IterFinish(void) { #if CYTHON_COMPILING_IN_CPYTHON PyThreadState *tstate = PyThreadState_GET(); PyObject* exc_type = tstate->curexc_type; if (unlikely(exc_type)) { if (likely(exc_type == PyExc_StopIteration) || PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration)) { PyObject *exc_value, *exc_tb; exc_value = tstate->curexc_value; exc_tb = tstate->curexc_traceback; tstate->curexc_type = 0; tstate->curexc_value = 0; tstate->curexc_traceback = 0; Py_DECREF(exc_type); Py_XDECREF(exc_value); Py_XDECREF(exc_tb); return 0; } else { return -1; } } return 0; #else if (unlikely(PyErr_Occurred())) { if (likely(PyErr_ExceptionMatches(PyExc_StopIteration))) { PyErr_Clear(); return 0; } else { return -1; } } return 0; #endif } static PyObject* __Pyx_PyObject_CallMethod0(PyObject* obj, PyObject* method_name) { PyObject *method, *result = NULL; method = __Pyx_PyObject_GetAttrStr(obj, method_name); if (unlikely(!method)) goto bad; #if CYTHON_COMPILING_IN_CPYTHON if (likely(PyMethod_Check(method))) { PyObject *self = PyMethod_GET_SELF(method); if (likely(self)) { PyObject *function = PyMethod_GET_FUNCTION(method); result = __Pyx_PyObject_CallOneArg(function, self); Py_DECREF(method); return result; } } #endif result = __Pyx_PyObject_CallNoArg(method); Py_DECREF(method); bad: return result; } static CYTHON_INLINE void __Pyx_RaiseNeedMoreValuesError(Py_ssize_t index) { PyErr_Format(PyExc_ValueError, "need more than %" CYTHON_FORMAT_SSIZE_T "d value%.1s to unpack", index, (index == 1) ? "" : "s"); } static CYTHON_INLINE void __Pyx_RaiseTooManyValuesError(Py_ssize_t expected) { PyErr_Format(PyExc_ValueError, "too many values to unpack (expected %" CYTHON_FORMAT_SSIZE_T "d)", expected); } static int __Pyx_IternextUnpackEndCheck(PyObject *retval, Py_ssize_t expected) { if (unlikely(retval)) { Py_DECREF(retval); __Pyx_RaiseTooManyValuesError(expected); return -1; } else { return __Pyx_IterFinish(); } return 0; } static CYTHON_INLINE void __Pyx_RaiseNoneNotIterableError(void) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable"); } static void __Pyx_UnpackTupleError(PyObject *t, Py_ssize_t index) { if (t == Py_None) { __Pyx_RaiseNoneNotIterableError(); } else if (PyTuple_GET_SIZE(t) < index) { __Pyx_RaiseNeedMoreValuesError(PyTuple_GET_SIZE(t)); } else { __Pyx_RaiseTooManyValuesError(index); } } static CYTHON_INLINE int __Pyx_unpack_tuple2(PyObject* tuple, PyObject** pvalue1, PyObject** pvalue2, int is_tuple, int has_known_size, int decref_tuple) { Py_ssize_t index; PyObject *value1 = NULL, *value2 = NULL, *iter = NULL; if (!is_tuple && unlikely(!PyTuple_Check(tuple))) { iternextfunc iternext; iter = PyObject_GetIter(tuple); if (unlikely(!iter)) goto bad; if (decref_tuple) { Py_DECREF(tuple); tuple = NULL; } iternext = Py_TYPE(iter)->tp_iternext; value1 = iternext(iter); if (unlikely(!value1)) { index = 0; goto unpacking_failed; } value2 = iternext(iter); if (unlikely(!value2)) { index = 1; goto unpacking_failed; } if (!has_known_size && unlikely(__Pyx_IternextUnpackEndCheck(iternext(iter), 2))) goto bad; Py_DECREF(iter); } else { if (!has_known_size && unlikely(PyTuple_GET_SIZE(tuple) != 2)) { __Pyx_UnpackTupleError(tuple, 2); goto bad; } #if CYTHON_COMPILING_IN_PYPY value1 = PySequence_ITEM(tuple, 0); if (unlikely(!value1)) goto bad; value2 = PySequence_ITEM(tuple, 1); if (unlikely(!value2)) goto bad; #else value1 = PyTuple_GET_ITEM(tuple, 0); value2 = PyTuple_GET_ITEM(tuple, 1); Py_INCREF(value1); Py_INCREF(value2); #endif if (decref_tuple) { Py_DECREF(tuple); } } *pvalue1 = value1; *pvalue2 = value2; return 0; unpacking_failed: if (!has_known_size && __Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); bad: Py_XDECREF(iter); Py_XDECREF(value1); Py_XDECREF(value2); if (decref_tuple) { Py_XDECREF(tuple); } return -1; } static CYTHON_INLINE PyObject* __Pyx_dict_iterator(PyObject* iterable, int is_dict, PyObject* method_name, Py_ssize_t* p_orig_length, int* p_source_is_dict) { is_dict = is_dict || likely(PyDict_CheckExact(iterable)); *p_source_is_dict = is_dict; #if !CYTHON_COMPILING_IN_PYPY if (is_dict) { *p_orig_length = PyDict_Size(iterable); Py_INCREF(iterable); return iterable; } #endif *p_orig_length = 0; if (method_name) { PyObject* iter; iterable = __Pyx_PyObject_CallMethod0(iterable, method_name); if (!iterable) return NULL; #if !CYTHON_COMPILING_IN_PYPY if (PyTuple_CheckExact(iterable) || PyList_CheckExact(iterable)) return iterable; #endif iter = PyObject_GetIter(iterable); Py_DECREF(iterable); return iter; } return PyObject_GetIter(iterable); } static CYTHON_INLINE int __Pyx_dict_iter_next( PyObject* iter_obj, CYTHON_NCP_UNUSED Py_ssize_t orig_length, CYTHON_NCP_UNUSED Py_ssize_t* ppos, PyObject** pkey, PyObject** pvalue, PyObject** pitem, int source_is_dict) { PyObject* next_item; #if !CYTHON_COMPILING_IN_PYPY if (source_is_dict) { PyObject *key, *value; if (unlikely(orig_length != PyDict_Size(iter_obj))) { PyErr_SetString(PyExc_RuntimeError, "dictionary changed size during iteration"); return -1; } if (unlikely(!PyDict_Next(iter_obj, ppos, &key, &value))) { return 0; } if (pitem) { PyObject* tuple = PyTuple_New(2); if (unlikely(!tuple)) { return -1; } Py_INCREF(key); Py_INCREF(value); PyTuple_SET_ITEM(tuple, 0, key); PyTuple_SET_ITEM(tuple, 1, value); *pitem = tuple; } else { if (pkey) { Py_INCREF(key); *pkey = key; } if (pvalue) { Py_INCREF(value); *pvalue = value; } } return 1; } else if (PyTuple_CheckExact(iter_obj)) { Py_ssize_t pos = *ppos; if (unlikely(pos >= PyTuple_GET_SIZE(iter_obj))) return 0; *ppos = pos + 1; next_item = PyTuple_GET_ITEM(iter_obj, pos); Py_INCREF(next_item); } else if (PyList_CheckExact(iter_obj)) { Py_ssize_t pos = *ppos; if (unlikely(pos >= PyList_GET_SIZE(iter_obj))) return 0; *ppos = pos + 1; next_item = PyList_GET_ITEM(iter_obj, pos); Py_INCREF(next_item); } else #endif { next_item = PyIter_Next(iter_obj); if (unlikely(!next_item)) { return __Pyx_IterFinish(); } } if (pitem) { *pitem = next_item; } else if (pkey && pvalue) { if (__Pyx_unpack_tuple2(next_item, pkey, pvalue, source_is_dict, source_is_dict, 1)) return -1; } else if (pkey) { *pkey = next_item; } else { *pvalue = next_item; } return 1; } static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Generic(PyObject *o, PyObject* j) { PyObject *r; if (!j) return NULL; r = PyObject_GetItem(o, j); Py_DECREF(j); return r; } static CYTHON_INLINE PyObject *__Pyx_GetItemInt_List_Fast(PyObject *o, Py_ssize_t i, CYTHON_NCP_UNUSED int wraparound, CYTHON_NCP_UNUSED int boundscheck) { #if CYTHON_COMPILING_IN_CPYTHON if (wraparound & unlikely(i < 0)) i += PyList_GET_SIZE(o); if ((!boundscheck) || likely((0 <= i) & (i < PyList_GET_SIZE(o)))) { PyObject *r = PyList_GET_ITEM(o, i); Py_INCREF(r); return r; } return __Pyx_GetItemInt_Generic(o, PyInt_FromSsize_t(i)); #else return PySequence_GetItem(o, i); #endif } static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Tuple_Fast(PyObject *o, Py_ssize_t i, CYTHON_NCP_UNUSED int wraparound, CYTHON_NCP_UNUSED int boundscheck) { #if CYTHON_COMPILING_IN_CPYTHON if (wraparound & unlikely(i < 0)) i += PyTuple_GET_SIZE(o); if ((!boundscheck) || likely((0 <= i) & (i < PyTuple_GET_SIZE(o)))) { PyObject *r = PyTuple_GET_ITEM(o, i); Py_INCREF(r); return r; } return __Pyx_GetItemInt_Generic(o, PyInt_FromSsize_t(i)); #else return PySequence_GetItem(o, i); #endif } static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Fast(PyObject *o, Py_ssize_t i, int is_list, CYTHON_NCP_UNUSED int wraparound, CYTHON_NCP_UNUSED int boundscheck) { #if CYTHON_COMPILING_IN_CPYTHON if (is_list || PyList_CheckExact(o)) { Py_ssize_t n = ((!wraparound) | likely(i >= 0)) ? i : i + PyList_GET_SIZE(o); if ((!boundscheck) || (likely((n >= 0) & (n < PyList_GET_SIZE(o))))) { PyObject *r = PyList_GET_ITEM(o, n); Py_INCREF(r); return r; } } else if (PyTuple_CheckExact(o)) { Py_ssize_t n = ((!wraparound) | likely(i >= 0)) ? i : i + PyTuple_GET_SIZE(o); if ((!boundscheck) || likely((n >= 0) & (n < PyTuple_GET_SIZE(o)))) { PyObject *r = PyTuple_GET_ITEM(o, n); Py_INCREF(r); return r; } } else { PySequenceMethods *m = Py_TYPE(o)->tp_as_sequence; if (likely(m && m->sq_item)) { if (wraparound && unlikely(i < 0) && likely(m->sq_length)) { Py_ssize_t l = m->sq_length(o); if (likely(l >= 0)) { i += l; } else { if (PyErr_ExceptionMatches(PyExc_OverflowError)) PyErr_Clear(); else return NULL; } } return m->sq_item(o, i); } } #else if (is_list || PySequence_Check(o)) { return PySequence_GetItem(o, i); } #endif return __Pyx_GetItemInt_Generic(o, PyInt_FromSsize_t(i)); } static int __Pyx_SetVtable(PyObject *dict, void *vtable) { #if PY_VERSION_HEX >= 0x02070000 PyObject *ob = PyCapsule_New(vtable, 0, 0); #else PyObject *ob = PyCObject_FromVoidPtr(vtable, 0); #endif if (!ob) goto bad; if (PyDict_SetItem(dict, __pyx_n_s_pyx_vtable, ob) < 0) goto bad; Py_DECREF(ob); return 0; bad: Py_XDECREF(ob); return -1; } static void* __Pyx_GetVtable(PyObject *dict) { void* ptr; PyObject *ob = PyObject_GetItem(dict, __pyx_n_s_pyx_vtable); if (!ob) goto bad; #if PY_VERSION_HEX >= 0x02070000 ptr = PyCapsule_GetPointer(ob, 0); #else ptr = PyCObject_AsVoidPtr(ob); #endif if (!ptr && !PyErr_Occurred()) PyErr_SetString(PyExc_RuntimeError, "invalid vtable found for imported type"); Py_DECREF(ob); return ptr; bad: Py_XDECREF(ob); return NULL; } static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list, int level) { PyObject *empty_list = 0; PyObject *module = 0; PyObject *global_dict = 0; PyObject *empty_dict = 0; PyObject *list; #if PY_VERSION_HEX < 0x03030000 PyObject *py_import; py_import = __Pyx_PyObject_GetAttrStr(__pyx_b, __pyx_n_s_import); if (!py_import) goto bad; #endif if (from_list) list = from_list; else { empty_list = PyList_New(0); if (!empty_list) goto bad; list = empty_list; } global_dict = PyModule_GetDict(__pyx_m); if (!global_dict) goto bad; empty_dict = PyDict_New(); if (!empty_dict) goto bad; { #if PY_MAJOR_VERSION >= 3 if (level == -1) { if (strchr(__Pyx_MODULE_NAME, '.')) { #if PY_VERSION_HEX < 0x03030000 PyObject *py_level = PyInt_FromLong(1); if (!py_level) goto bad; module = PyObject_CallFunctionObjArgs(py_import, name, global_dict, empty_dict, list, py_level, NULL); Py_DECREF(py_level); #else module = PyImport_ImportModuleLevelObject( name, global_dict, empty_dict, list, 1); #endif if (!module) { if (!PyErr_ExceptionMatches(PyExc_ImportError)) goto bad; PyErr_Clear(); } } level = 0; } #endif if (!module) { #if PY_VERSION_HEX < 0x03030000 PyObject *py_level = PyInt_FromLong(level); if (!py_level) goto bad; module = PyObject_CallFunctionObjArgs(py_import, name, global_dict, empty_dict, list, py_level, NULL); Py_DECREF(py_level); #else module = PyImport_ImportModuleLevelObject( name, global_dict, empty_dict, list, level); #endif } } bad: #if PY_VERSION_HEX < 0x03030000 Py_XDECREF(py_import); #endif Py_XDECREF(empty_list); Py_XDECREF(empty_dict); return module; } static PyObject* __Pyx_ImportFrom(PyObject* module, PyObject* name) { PyObject* value = __Pyx_PyObject_GetAttrStr(module, name); if (unlikely(!value) && PyErr_ExceptionMatches(PyExc_AttributeError)) { PyErr_Format(PyExc_ImportError, #if PY_MAJOR_VERSION < 3 "cannot import name %.230s", PyString_AS_STRING(name)); #else "cannot import name %S", name); #endif } return value; } static int __pyx_bisect_code_objects(__Pyx_CodeObjectCacheEntry* entries, int count, int code_line) { int start = 0, mid = 0, end = count - 1; if (end >= 0 && code_line > entries[end].code_line) { return count; } while (start < end) { mid = start + (end - start) / 2; if (code_line < entries[mid].code_line) { end = mid; } else if (code_line > entries[mid].code_line) { start = mid + 1; } else { return mid; } } if (code_line <= entries[mid].code_line) { return mid; } else { return mid + 1; } } static PyCodeObject *__pyx_find_code_object(int code_line) { PyCodeObject* code_object; int pos; if (unlikely(!code_line) || unlikely(!__pyx_code_cache.entries)) { return NULL; } pos = __pyx_bisect_code_objects(__pyx_code_cache.entries, __pyx_code_cache.count, code_line); if (unlikely(pos >= __pyx_code_cache.count) || unlikely(__pyx_code_cache.entries[pos].code_line != code_line)) { return NULL; } code_object = __pyx_code_cache.entries[pos].code_object; Py_INCREF(code_object); return code_object; } static void __pyx_insert_code_object(int code_line, PyCodeObject* code_object) { int pos, i; __Pyx_CodeObjectCacheEntry* entries = __pyx_code_cache.entries; if (unlikely(!code_line)) { return; } if (unlikely(!entries)) { entries = (__Pyx_CodeObjectCacheEntry*)PyMem_Malloc(64*sizeof(__Pyx_CodeObjectCacheEntry)); if (likely(entries)) { __pyx_code_cache.entries = entries; __pyx_code_cache.max_count = 64; __pyx_code_cache.count = 1; entries[0].code_line = code_line; entries[0].code_object = code_object; Py_INCREF(code_object); } return; } pos = __pyx_bisect_code_objects(__pyx_code_cache.entries, __pyx_code_cache.count, code_line); if ((pos < __pyx_code_cache.count) && unlikely(__pyx_code_cache.entries[pos].code_line == code_line)) { PyCodeObject* tmp = entries[pos].code_object; entries[pos].code_object = code_object; Py_DECREF(tmp); return; } if (__pyx_code_cache.count == __pyx_code_cache.max_count) { int new_max = __pyx_code_cache.max_count + 64; entries = (__Pyx_CodeObjectCacheEntry*)PyMem_Realloc( __pyx_code_cache.entries, (size_t)new_max*sizeof(__Pyx_CodeObjectCacheEntry)); if (unlikely(!entries)) { return; } __pyx_code_cache.entries = entries; __pyx_code_cache.max_count = new_max; } for (i=__pyx_code_cache.count; i>pos; i--) { entries[i] = entries[i-1]; } entries[pos].code_line = code_line; entries[pos].code_object = code_object; __pyx_code_cache.count++; Py_INCREF(code_object); } #include "compile.h" #include "frameobject.h" #include "traceback.h" static PyCodeObject* __Pyx_CreateCodeObjectForTraceback( const char *funcname, int c_line, int py_line, const char *filename) { PyCodeObject *py_code = 0; PyObject *py_srcfile = 0; PyObject *py_funcname = 0; #if PY_MAJOR_VERSION < 3 py_srcfile = PyString_FromString(filename); #else py_srcfile = PyUnicode_FromString(filename); #endif if (!py_srcfile) goto bad; if (c_line) { #if PY_MAJOR_VERSION < 3 py_funcname = PyString_FromFormat( "%s (%s:%d)", funcname, __pyx_cfilenm, c_line); #else py_funcname = PyUnicode_FromFormat( "%s (%s:%d)", funcname, __pyx_cfilenm, c_line); #endif } else { #if PY_MAJOR_VERSION < 3 py_funcname = PyString_FromString(funcname); #else py_funcname = PyUnicode_FromString(funcname); #endif } if (!py_funcname) goto bad; py_code = __Pyx_PyCode_New( 0, 0, 0, 0, 0, __pyx_empty_bytes, /*PyObject *code,*/ __pyx_empty_tuple, /*PyObject *consts,*/ __pyx_empty_tuple, /*PyObject *names,*/ __pyx_empty_tuple, /*PyObject *varnames,*/ __pyx_empty_tuple, /*PyObject *freevars,*/ __pyx_empty_tuple, /*PyObject *cellvars,*/ py_srcfile, /*PyObject *filename,*/ py_funcname, /*PyObject *name,*/ py_line, __pyx_empty_bytes /*PyObject *lnotab*/ ); Py_DECREF(py_srcfile); Py_DECREF(py_funcname); return py_code; bad: Py_XDECREF(py_srcfile); Py_XDECREF(py_funcname); return NULL; } static void __Pyx_AddTraceback(const char *funcname, int c_line, int py_line, const char *filename) { PyCodeObject *py_code = 0; PyFrameObject *py_frame = 0; py_code = __pyx_find_code_object(c_line ? c_line : py_line); if (!py_code) { py_code = __Pyx_CreateCodeObjectForTraceback( funcname, c_line, py_line, filename); if (!py_code) goto bad; __pyx_insert_code_object(c_line ? c_line : py_line, py_code); } py_frame = PyFrame_New( PyThreadState_GET(), /*PyThreadState *tstate,*/ py_code, /*PyCodeObject *code,*/ __pyx_d, /*PyObject *globals,*/ 0 /*PyObject *locals*/ ); if (!py_frame) goto bad; py_frame->f_lineno = py_line; PyTraceBack_Here(py_frame); bad: Py_XDECREF(py_code); Py_XDECREF(py_frame); } static CYTHON_INLINE PyObject* __Pyx_PyInt_From_SDL_BlendMode(SDL_BlendMode value) { const SDL_BlendMode neg_one = (SDL_BlendMode) -1, const_zero = (SDL_BlendMode) 0; const int is_unsigned = neg_one > const_zero; if (is_unsigned) { if (sizeof(SDL_BlendMode) < sizeof(long)) { return PyInt_FromLong((long) value); } else if (sizeof(SDL_BlendMode) <= sizeof(unsigned long)) { return PyLong_FromUnsignedLong((unsigned long) value); } else if (sizeof(SDL_BlendMode) <= sizeof(unsigned PY_LONG_LONG)) { return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value); } } else { if (sizeof(SDL_BlendMode) <= sizeof(long)) { return PyInt_FromLong((long) value); } else if (sizeof(SDL_BlendMode) <= sizeof(PY_LONG_LONG)) { return PyLong_FromLongLong((PY_LONG_LONG) value); } } { int one = 1; int little = (int)*(unsigned char *)&one; unsigned char *bytes = (unsigned char *)&value; return _PyLong_FromByteArray(bytes, sizeof(SDL_BlendMode), little, !is_unsigned); } } static CYTHON_INLINE PyObject* __Pyx_PyInt_From_int(int value) { const int neg_one = (int) -1, const_zero = (int) 0; const int is_unsigned = neg_one > const_zero; if (is_unsigned) { if (sizeof(int) < sizeof(long)) { return PyInt_FromLong((long) value); } else if (sizeof(int) <= sizeof(unsigned long)) { return PyLong_FromUnsignedLong((unsigned long) value); } else if (sizeof(int) <= sizeof(unsigned PY_LONG_LONG)) { return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value); } } else { if (sizeof(int) <= sizeof(long)) { return PyInt_FromLong((long) value); } else if (sizeof(int) <= sizeof(PY_LONG_LONG)) { return PyLong_FromLongLong((PY_LONG_LONG) value); } } { int one = 1; int little = (int)*(unsigned char *)&one; unsigned char *bytes = (unsigned char *)&value; return _PyLong_FromByteArray(bytes, sizeof(int), little, !is_unsigned); } } #define __PYX_VERIFY_RETURN_INT(target_type, func_type, func_value)\ __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, 0) #define __PYX_VERIFY_RETURN_INT_EXC(target_type, func_type, func_value)\ __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, 1) #define __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, exc)\ {\ func_type value = func_value;\ if (sizeof(target_type) < sizeof(func_type)) {\ if (unlikely(value != (func_type) (target_type) value)) {\ func_type zero = 0;\ if (exc && unlikely(value == (func_type)-1 && PyErr_Occurred()))\ return (target_type) -1;\ if (is_unsigned && unlikely(value < zero))\ goto raise_neg_overflow;\ else\ goto raise_overflow;\ }\ }\ return (target_type) value;\ } #if CYTHON_USE_PYLONG_INTERNALS #include "longintrepr.h" #endif static CYTHON_INLINE int __Pyx_PyInt_As_int(PyObject *x) { const int neg_one = (int) -1, const_zero = (int) 0; const int is_unsigned = neg_one > const_zero; #if PY_MAJOR_VERSION < 3 if (likely(PyInt_Check(x))) { if (sizeof(int) < sizeof(long)) { __PYX_VERIFY_RETURN_INT(int, long, PyInt_AS_LONG(x)) } else { long val = PyInt_AS_LONG(x); if (is_unsigned && unlikely(val < 0)) { goto raise_neg_overflow; } return (int) val; } } else #endif if (likely(PyLong_Check(x))) { if (is_unsigned) { #if CYTHON_USE_PYLONG_INTERNALS const digit* digits = ((PyLongObject*)x)->ob_digit; switch (Py_SIZE(x)) { case 0: return (int) 0; case 1: __PYX_VERIFY_RETURN_INT(int, digit, digits[0]) case 2: if (8 * sizeof(int) > 1 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(int) >= 2 * PyLong_SHIFT) { return (int) (((((int)digits[1]) << PyLong_SHIFT) | (int)digits[0])); } } break; case 3: if (8 * sizeof(int) > 2 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(int) >= 3 * PyLong_SHIFT) { return (int) (((((((int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0])); } } break; case 4: if (8 * sizeof(int) > 3 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(int) >= 4 * PyLong_SHIFT) { return (int) (((((((((int)digits[3]) << PyLong_SHIFT) | (int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0])); } } break; } #endif #if CYTHON_COMPILING_IN_CPYTHON if (unlikely(Py_SIZE(x) < 0)) { goto raise_neg_overflow; } #else { int result = PyObject_RichCompareBool(x, Py_False, Py_LT); if (unlikely(result < 0)) return (int) -1; if (unlikely(result == 1)) goto raise_neg_overflow; } #endif if (sizeof(int) <= sizeof(unsigned long)) { __PYX_VERIFY_RETURN_INT_EXC(int, unsigned long, PyLong_AsUnsignedLong(x)) } else if (sizeof(int) <= sizeof(unsigned PY_LONG_LONG)) { __PYX_VERIFY_RETURN_INT_EXC(int, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x)) } } else { #if CYTHON_USE_PYLONG_INTERNALS const digit* digits = ((PyLongObject*)x)->ob_digit; switch (Py_SIZE(x)) { case 0: return (int) 0; case -1: __PYX_VERIFY_RETURN_INT(int, sdigit, -(sdigit) digits[0]) case 1: __PYX_VERIFY_RETURN_INT(int, digit, +digits[0]) case -2: if (8 * sizeof(int) - 1 > 1 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(int, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(int) - 1 > 2 * PyLong_SHIFT) { return (int) (((int)-1)*(((((int)digits[1]) << PyLong_SHIFT) | (int)digits[0]))); } } break; case 2: if (8 * sizeof(int) > 1 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(int) - 1 > 2 * PyLong_SHIFT) { return (int) ((((((int)digits[1]) << PyLong_SHIFT) | (int)digits[0]))); } } break; case -3: if (8 * sizeof(int) - 1 > 2 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(int, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(int) - 1 > 3 * PyLong_SHIFT) { return (int) (((int)-1)*(((((((int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0]))); } } break; case 3: if (8 * sizeof(int) > 2 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(int) - 1 > 3 * PyLong_SHIFT) { return (int) ((((((((int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0]))); } } break; case -4: if (8 * sizeof(int) - 1 > 3 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(int, long, -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(int) - 1 > 4 * PyLong_SHIFT) { return (int) (((int)-1)*(((((((((int)digits[3]) << PyLong_SHIFT) | (int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0]))); } } break; case 4: if (8 * sizeof(int) > 3 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(int) - 1 > 4 * PyLong_SHIFT) { return (int) ((((((((((int)digits[3]) << PyLong_SHIFT) | (int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0]))); } } break; } #endif if (sizeof(int) <= sizeof(long)) { __PYX_VERIFY_RETURN_INT_EXC(int, long, PyLong_AsLong(x)) } else if (sizeof(int) <= sizeof(PY_LONG_LONG)) { __PYX_VERIFY_RETURN_INT_EXC(int, PY_LONG_LONG, PyLong_AsLongLong(x)) } } { #if CYTHON_COMPILING_IN_PYPY && !defined(_PyLong_AsByteArray) PyErr_SetString(PyExc_RuntimeError, "_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers"); #else int val; PyObject *v = __Pyx_PyNumber_Int(x); #if PY_MAJOR_VERSION < 3 if (likely(v) && !PyLong_Check(v)) { PyObject *tmp = v; v = PyNumber_Long(tmp); Py_DECREF(tmp); } #endif if (likely(v)) { int one = 1; int is_little = (int)*(unsigned char *)&one; unsigned char *bytes = (unsigned char *)&val; int ret = _PyLong_AsByteArray((PyLongObject *)v, bytes, sizeof(val), is_little, !is_unsigned); Py_DECREF(v); if (likely(!ret)) return val; } #endif return (int) -1; } } else { int val; PyObject *tmp = __Pyx_PyNumber_Int(x); if (!tmp) return (int) -1; val = __Pyx_PyInt_As_int(tmp); Py_DECREF(tmp); return val; } raise_overflow: PyErr_SetString(PyExc_OverflowError, "value too large to convert to int"); return (int) -1; raise_neg_overflow: PyErr_SetString(PyExc_OverflowError, "can't convert negative value to int"); return (int) -1; } static CYTHON_INLINE uint8_t __Pyx_PyInt_As_uint8_t(PyObject *x) { const uint8_t neg_one = (uint8_t) -1, const_zero = (uint8_t) 0; const int is_unsigned = neg_one > const_zero; #if PY_MAJOR_VERSION < 3 if (likely(PyInt_Check(x))) { if (sizeof(uint8_t) < sizeof(long)) { __PYX_VERIFY_RETURN_INT(uint8_t, long, PyInt_AS_LONG(x)) } else { long val = PyInt_AS_LONG(x); if (is_unsigned && unlikely(val < 0)) { goto raise_neg_overflow; } return (uint8_t) val; } } else #endif if (likely(PyLong_Check(x))) { if (is_unsigned) { #if CYTHON_USE_PYLONG_INTERNALS const digit* digits = ((PyLongObject*)x)->ob_digit; switch (Py_SIZE(x)) { case 0: return (uint8_t) 0; case 1: __PYX_VERIFY_RETURN_INT(uint8_t, digit, digits[0]) case 2: if (8 * sizeof(uint8_t) > 1 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(uint8_t, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(uint8_t) >= 2 * PyLong_SHIFT) { return (uint8_t) (((((uint8_t)digits[1]) << PyLong_SHIFT) | (uint8_t)digits[0])); } } break; case 3: if (8 * sizeof(uint8_t) > 2 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(uint8_t, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(uint8_t) >= 3 * PyLong_SHIFT) { return (uint8_t) (((((((uint8_t)digits[2]) << PyLong_SHIFT) | (uint8_t)digits[1]) << PyLong_SHIFT) | (uint8_t)digits[0])); } } break; case 4: if (8 * sizeof(uint8_t) > 3 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(uint8_t, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(uint8_t) >= 4 * PyLong_SHIFT) { return (uint8_t) (((((((((uint8_t)digits[3]) << PyLong_SHIFT) | (uint8_t)digits[2]) << PyLong_SHIFT) | (uint8_t)digits[1]) << PyLong_SHIFT) | (uint8_t)digits[0])); } } break; } #endif #if CYTHON_COMPILING_IN_CPYTHON if (unlikely(Py_SIZE(x) < 0)) { goto raise_neg_overflow; } #else { int result = PyObject_RichCompareBool(x, Py_False, Py_LT); if (unlikely(result < 0)) return (uint8_t) -1; if (unlikely(result == 1)) goto raise_neg_overflow; } #endif if (sizeof(uint8_t) <= sizeof(unsigned long)) { __PYX_VERIFY_RETURN_INT_EXC(uint8_t, unsigned long, PyLong_AsUnsignedLong(x)) } else if (sizeof(uint8_t) <= sizeof(unsigned PY_LONG_LONG)) { __PYX_VERIFY_RETURN_INT_EXC(uint8_t, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x)) } } else { #if CYTHON_USE_PYLONG_INTERNALS const digit* digits = ((PyLongObject*)x)->ob_digit; switch (Py_SIZE(x)) { case 0: return (uint8_t) 0; case -1: __PYX_VERIFY_RETURN_INT(uint8_t, sdigit, -(sdigit) digits[0]) case 1: __PYX_VERIFY_RETURN_INT(uint8_t, digit, +digits[0]) case -2: if (8 * sizeof(uint8_t) - 1 > 1 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(uint8_t, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(uint8_t) - 1 > 2 * PyLong_SHIFT) { return (uint8_t) (((uint8_t)-1)*(((((uint8_t)digits[1]) << PyLong_SHIFT) | (uint8_t)digits[0]))); } } break; case 2: if (8 * sizeof(uint8_t) > 1 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(uint8_t, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(uint8_t) - 1 > 2 * PyLong_SHIFT) { return (uint8_t) ((((((uint8_t)digits[1]) << PyLong_SHIFT) | (uint8_t)digits[0]))); } } break; case -3: if (8 * sizeof(uint8_t) - 1 > 2 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(uint8_t, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(uint8_t) - 1 > 3 * PyLong_SHIFT) { return (uint8_t) (((uint8_t)-1)*(((((((uint8_t)digits[2]) << PyLong_SHIFT) | (uint8_t)digits[1]) << PyLong_SHIFT) | (uint8_t)digits[0]))); } } break; case 3: if (8 * sizeof(uint8_t) > 2 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(uint8_t, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(uint8_t) - 1 > 3 * PyLong_SHIFT) { return (uint8_t) ((((((((uint8_t)digits[2]) << PyLong_SHIFT) | (uint8_t)digits[1]) << PyLong_SHIFT) | (uint8_t)digits[0]))); } } break; case -4: if (8 * sizeof(uint8_t) - 1 > 3 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(uint8_t, long, -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(uint8_t) - 1 > 4 * PyLong_SHIFT) { return (uint8_t) (((uint8_t)-1)*(((((((((uint8_t)digits[3]) << PyLong_SHIFT) | (uint8_t)digits[2]) << PyLong_SHIFT) | (uint8_t)digits[1]) << PyLong_SHIFT) | (uint8_t)digits[0]))); } } break; case 4: if (8 * sizeof(uint8_t) > 3 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(uint8_t, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(uint8_t) - 1 > 4 * PyLong_SHIFT) { return (uint8_t) ((((((((((uint8_t)digits[3]) << PyLong_SHIFT) | (uint8_t)digits[2]) << PyLong_SHIFT) | (uint8_t)digits[1]) << PyLong_SHIFT) | (uint8_t)digits[0]))); } } break; } #endif if (sizeof(uint8_t) <= sizeof(long)) { __PYX_VERIFY_RETURN_INT_EXC(uint8_t, long, PyLong_AsLong(x)) } else if (sizeof(uint8_t) <= sizeof(PY_LONG_LONG)) { __PYX_VERIFY_RETURN_INT_EXC(uint8_t, PY_LONG_LONG, PyLong_AsLongLong(x)) } } { #if CYTHON_COMPILING_IN_PYPY && !defined(_PyLong_AsByteArray) PyErr_SetString(PyExc_RuntimeError, "_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers"); #else uint8_t val; PyObject *v = __Pyx_PyNumber_Int(x); #if PY_MAJOR_VERSION < 3 if (likely(v) && !PyLong_Check(v)) { PyObject *tmp = v; v = PyNumber_Long(tmp); Py_DECREF(tmp); } #endif if (likely(v)) { int one = 1; int is_little = (int)*(unsigned char *)&one; unsigned char *bytes = (unsigned char *)&val; int ret = _PyLong_AsByteArray((PyLongObject *)v, bytes, sizeof(val), is_little, !is_unsigned); Py_DECREF(v); if (likely(!ret)) return val; } #endif return (uint8_t) -1; } } else { uint8_t val; PyObject *tmp = __Pyx_PyNumber_Int(x); if (!tmp) return (uint8_t) -1; val = __Pyx_PyInt_As_uint8_t(tmp); Py_DECREF(tmp); return val; } raise_overflow: PyErr_SetString(PyExc_OverflowError, "value too large to convert to uint8_t"); return (uint8_t) -1; raise_neg_overflow: PyErr_SetString(PyExc_OverflowError, "can't convert negative value to uint8_t"); return (uint8_t) -1; } static CYTHON_INLINE PyObject* __Pyx_PyInt_From_long(long value) { const long neg_one = (long) -1, const_zero = (long) 0; const int is_unsigned = neg_one > const_zero; if (is_unsigned) { if (sizeof(long) < sizeof(long)) { return PyInt_FromLong((long) value); } else if (sizeof(long) <= sizeof(unsigned long)) { return PyLong_FromUnsignedLong((unsigned long) value); } else if (sizeof(long) <= sizeof(unsigned PY_LONG_LONG)) { return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value); } } else { if (sizeof(long) <= sizeof(long)) { return PyInt_FromLong((long) value); } else if (sizeof(long) <= sizeof(PY_LONG_LONG)) { return PyLong_FromLongLong((PY_LONG_LONG) value); } } { int one = 1; int little = (int)*(unsigned char *)&one; unsigned char *bytes = (unsigned char *)&value; return _PyLong_FromByteArray(bytes, sizeof(long), little, !is_unsigned); } } static CYTHON_INLINE PyObject* __Pyx_PyInt_From_uint8_t(uint8_t value) { const uint8_t neg_one = (uint8_t) -1, const_zero = (uint8_t) 0; const int is_unsigned = neg_one > const_zero; if (is_unsigned) { if (sizeof(uint8_t) < sizeof(long)) { return PyInt_FromLong((long) value); } else if (sizeof(uint8_t) <= sizeof(unsigned long)) { return PyLong_FromUnsignedLong((unsigned long) value); } else if (sizeof(uint8_t) <= sizeof(unsigned PY_LONG_LONG)) { return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value); } } else { if (sizeof(uint8_t) <= sizeof(long)) { return PyInt_FromLong((long) value); } else if (sizeof(uint8_t) <= sizeof(PY_LONG_LONG)) { return PyLong_FromLongLong((PY_LONG_LONG) value); } } { int one = 1; int little = (int)*(unsigned char *)&one; unsigned char *bytes = (unsigned char *)&value; return _PyLong_FromByteArray(bytes, sizeof(uint8_t), little, !is_unsigned); } } static CYTHON_INLINE long __Pyx_PyInt_As_long(PyObject *x) { const long neg_one = (long) -1, const_zero = (long) 0; const int is_unsigned = neg_one > const_zero; #if PY_MAJOR_VERSION < 3 if (likely(PyInt_Check(x))) { if (sizeof(long) < sizeof(long)) { __PYX_VERIFY_RETURN_INT(long, long, PyInt_AS_LONG(x)) } else { long val = PyInt_AS_LONG(x); if (is_unsigned && unlikely(val < 0)) { goto raise_neg_overflow; } return (long) val; } } else #endif if (likely(PyLong_Check(x))) { if (is_unsigned) { #if CYTHON_USE_PYLONG_INTERNALS const digit* digits = ((PyLongObject*)x)->ob_digit; switch (Py_SIZE(x)) { case 0: return (long) 0; case 1: __PYX_VERIFY_RETURN_INT(long, digit, digits[0]) case 2: if (8 * sizeof(long) > 1 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(long) >= 2 * PyLong_SHIFT) { return (long) (((((long)digits[1]) << PyLong_SHIFT) | (long)digits[0])); } } break; case 3: if (8 * sizeof(long) > 2 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(long) >= 3 * PyLong_SHIFT) { return (long) (((((((long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0])); } } break; case 4: if (8 * sizeof(long) > 3 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(long) >= 4 * PyLong_SHIFT) { return (long) (((((((((long)digits[3]) << PyLong_SHIFT) | (long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0])); } } break; } #endif #if CYTHON_COMPILING_IN_CPYTHON if (unlikely(Py_SIZE(x) < 0)) { goto raise_neg_overflow; } #else { int result = PyObject_RichCompareBool(x, Py_False, Py_LT); if (unlikely(result < 0)) return (long) -1; if (unlikely(result == 1)) goto raise_neg_overflow; } #endif if (sizeof(long) <= sizeof(unsigned long)) { __PYX_VERIFY_RETURN_INT_EXC(long, unsigned long, PyLong_AsUnsignedLong(x)) } else if (sizeof(long) <= sizeof(unsigned PY_LONG_LONG)) { __PYX_VERIFY_RETURN_INT_EXC(long, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x)) } } else { #if CYTHON_USE_PYLONG_INTERNALS const digit* digits = ((PyLongObject*)x)->ob_digit; switch (Py_SIZE(x)) { case 0: return (long) 0; case -1: __PYX_VERIFY_RETURN_INT(long, sdigit, -(sdigit) digits[0]) case 1: __PYX_VERIFY_RETURN_INT(long, digit, +digits[0]) case -2: if (8 * sizeof(long) - 1 > 1 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(long, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) { return (long) (((long)-1)*(((((long)digits[1]) << PyLong_SHIFT) | (long)digits[0]))); } } break; case 2: if (8 * sizeof(long) > 1 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) { return (long) ((((((long)digits[1]) << PyLong_SHIFT) | (long)digits[0]))); } } break; case -3: if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(long, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) { return (long) (((long)-1)*(((((((long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0]))); } } break; case 3: if (8 * sizeof(long) > 2 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) { return (long) ((((((((long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0]))); } } break; case -4: if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(long, long, -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(long) - 1 > 4 * PyLong_SHIFT) { return (long) (((long)-1)*(((((((((long)digits[3]) << PyLong_SHIFT) | (long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0]))); } } break; case 4: if (8 * sizeof(long) > 3 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(long) - 1 > 4 * PyLong_SHIFT) { return (long) ((((((((((long)digits[3]) << PyLong_SHIFT) | (long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0]))); } } break; } #endif if (sizeof(long) <= sizeof(long)) { __PYX_VERIFY_RETURN_INT_EXC(long, long, PyLong_AsLong(x)) } else if (sizeof(long) <= sizeof(PY_LONG_LONG)) { __PYX_VERIFY_RETURN_INT_EXC(long, PY_LONG_LONG, PyLong_AsLongLong(x)) } } { #if CYTHON_COMPILING_IN_PYPY && !defined(_PyLong_AsByteArray) PyErr_SetString(PyExc_RuntimeError, "_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers"); #else long val; PyObject *v = __Pyx_PyNumber_Int(x); #if PY_MAJOR_VERSION < 3 if (likely(v) && !PyLong_Check(v)) { PyObject *tmp = v; v = PyNumber_Long(tmp); Py_DECREF(tmp); } #endif if (likely(v)) { int one = 1; int is_little = (int)*(unsigned char *)&one; unsigned char *bytes = (unsigned char *)&val; int ret = _PyLong_AsByteArray((PyLongObject *)v, bytes, sizeof(val), is_little, !is_unsigned); Py_DECREF(v); if (likely(!ret)) return val; } #endif return (long) -1; } } else { long val; PyObject *tmp = __Pyx_PyNumber_Int(x); if (!tmp) return (long) -1; val = __Pyx_PyInt_As_long(tmp); Py_DECREF(tmp); return val; } raise_overflow: PyErr_SetString(PyExc_OverflowError, "value too large to convert to long"); return (long) -1; raise_neg_overflow: PyErr_SetString(PyExc_OverflowError, "can't convert negative value to long"); return (long) -1; } static int __Pyx_check_binary_version(void) { char ctversion[4], rtversion[4]; PyOS_snprintf(ctversion, 4, "%d.%d", PY_MAJOR_VERSION, PY_MINOR_VERSION); PyOS_snprintf(rtversion, 4, "%s", Py_GetVersion()); if (ctversion[0] != rtversion[0] || ctversion[2] != rtversion[2]) { char message[200]; PyOS_snprintf(message, sizeof(message), "compiletime version %s of module '%.100s' " "does not match runtime version %s", ctversion, __Pyx_MODULE_NAME, rtversion); return PyErr_WarnEx(NULL, message, 1); } return 0; } #ifndef __PYX_HAVE_RT_ImportModule #define __PYX_HAVE_RT_ImportModule static PyObject *__Pyx_ImportModule(const char *name) { PyObject *py_name = 0; PyObject *py_module = 0; py_name = __Pyx_PyIdentifier_FromString(name); if (!py_name) goto bad; py_module = PyImport_Import(py_name); Py_DECREF(py_name); return py_module; bad: Py_XDECREF(py_name); return 0; } #endif #ifndef __PYX_HAVE_RT_ImportType #define __PYX_HAVE_RT_ImportType static PyTypeObject *__Pyx_ImportType(const char *module_name, const char *class_name, size_t size, int strict) { PyObject *py_module = 0; PyObject *result = 0; PyObject *py_name = 0; char warning[200]; Py_ssize_t basicsize; #ifdef Py_LIMITED_API PyObject *py_basicsize; #endif py_module = __Pyx_ImportModule(module_name); if (!py_module) goto bad; py_name = __Pyx_PyIdentifier_FromString(class_name); if (!py_name) goto bad; result = PyObject_GetAttr(py_module, py_name); Py_DECREF(py_name); py_name = 0; Py_DECREF(py_module); py_module = 0; if (!result) goto bad; if (!PyType_Check(result)) { PyErr_Format(PyExc_TypeError, "%.200s.%.200s is not a type object", module_name, class_name); goto bad; } #ifndef Py_LIMITED_API basicsize = ((PyTypeObject *)result)->tp_basicsize; #else py_basicsize = PyObject_GetAttrString(result, "__basicsize__"); if (!py_basicsize) goto bad; basicsize = PyLong_AsSsize_t(py_basicsize); Py_DECREF(py_basicsize); py_basicsize = 0; if (basicsize == (Py_ssize_t)-1 && PyErr_Occurred()) goto bad; #endif if (!strict && (size_t)basicsize > size) { PyOS_snprintf(warning, sizeof(warning), "%s.%s size changed, may indicate binary incompatibility", module_name, class_name); if (PyErr_WarnEx(NULL, warning, 0) < 0) goto bad; } else if ((size_t)basicsize != size) { PyErr_Format(PyExc_ValueError, "%.200s.%.200s has the wrong size, try recompiling", module_name, class_name); goto bad; } return (PyTypeObject *)result; bad: Py_XDECREF(py_module); Py_XDECREF(result); return NULL; } #endif #ifndef __PYX_HAVE_RT_ImportVoidPtr #define __PYX_HAVE_RT_ImportVoidPtr static int __Pyx_ImportVoidPtr(PyObject *module, const char *name, void **p, const char *sig) { PyObject *d = 0; PyObject *cobj = 0; d = PyObject_GetAttrString(module, (char *)"__pyx_capi__"); if (!d) goto bad; cobj = PyDict_GetItemString(d, name); if (!cobj) { PyErr_Format(PyExc_ImportError, "%.200s does not export expected C variable %.200s", PyModule_GetName(module), name); goto bad; } #if PY_VERSION_HEX >= 0x02070000 if (!PyCapsule_IsValid(cobj, sig)) { PyErr_Format(PyExc_TypeError, "C variable %.200s.%.200s has wrong signature (expected %.500s, got %.500s)", PyModule_GetName(module), name, sig, PyCapsule_GetName(cobj)); goto bad; } *p = PyCapsule_GetPointer(cobj, sig); #else {const char *desc, *s1, *s2; desc = (const char *)PyCObject_GetDesc(cobj); if (!desc) goto bad; s1 = desc; s2 = sig; while (*s1 != '\0' && *s1 == *s2) { s1++; s2++; } if (*s1 != *s2) { PyErr_Format(PyExc_TypeError, "C variable %.200s.%.200s has wrong signature (expected %.500s, got %.500s)", PyModule_GetName(module), name, sig, desc); goto bad; } *p = PyCObject_AsVoidPtr(cobj);} #endif if (!(*p)) goto bad; Py_DECREF(d); return 0; bad: Py_XDECREF(d); return -1; } #endif #ifndef __PYX_HAVE_RT_ImportFunction #define __PYX_HAVE_RT_ImportFunction static int __Pyx_ImportFunction(PyObject *module, const char *funcname, void (**f)(void), const char *sig) { PyObject *d = 0; PyObject *cobj = 0; union { void (*fp)(void); void *p; } tmp; d = PyObject_GetAttrString(module, (char *)"__pyx_capi__"); if (!d) goto bad; cobj = PyDict_GetItemString(d, funcname); if (!cobj) { PyErr_Format(PyExc_ImportError, "%.200s does not export expected C function %.200s", PyModule_GetName(module), funcname); goto bad; } #if PY_VERSION_HEX >= 0x02070000 if (!PyCapsule_IsValid(cobj, sig)) { PyErr_Format(PyExc_TypeError, "C function %.200s.%.200s has wrong signature (expected %.500s, got %.500s)", PyModule_GetName(module), funcname, sig, PyCapsule_GetName(cobj)); goto bad; } tmp.p = PyCapsule_GetPointer(cobj, sig); #else {const char *desc, *s1, *s2; desc = (const char *)PyCObject_GetDesc(cobj); if (!desc) goto bad; s1 = desc; s2 = sig; while (*s1 != '\0' && *s1 == *s2) { s1++; s2++; } if (*s1 != *s2) { PyErr_Format(PyExc_TypeError, "C function %.200s.%.200s has wrong signature (expected %.500s, got %.500s)", PyModule_GetName(module), funcname, sig, desc); goto bad; } tmp.p = PyCObject_AsVoidPtr(cobj);} #endif *f = tmp.fp; if (!(*f)) goto bad; Py_DECREF(d); return 0; bad: Py_XDECREF(d); return -1; } #endif static int __Pyx_InitStrings(__Pyx_StringTabEntry *t) { while (t->p) { #if PY_MAJOR_VERSION < 3 if (t->is_unicode) { *t->p = PyUnicode_DecodeUTF8(t->s, t->n - 1, NULL); } else if (t->intern) { *t->p = PyString_InternFromString(t->s); } else { *t->p = PyString_FromStringAndSize(t->s, t->n - 1); } #else if (t->is_unicode | t->is_str) { if (t->intern) { *t->p = PyUnicode_InternFromString(t->s); } else if (t->encoding) { *t->p = PyUnicode_Decode(t->s, t->n - 1, t->encoding, NULL); } else { *t->p = PyUnicode_FromStringAndSize(t->s, t->n - 1); } } else { *t->p = PyBytes_FromStringAndSize(t->s, t->n - 1); } #endif if (!*t->p) return -1; ++t; } return 0; } static CYTHON_INLINE PyObject* __Pyx_PyUnicode_FromString(const char* c_str) { return __Pyx_PyUnicode_FromStringAndSize(c_str, (Py_ssize_t)strlen(c_str)); } static CYTHON_INLINE char* __Pyx_PyObject_AsString(PyObject* o) { Py_ssize_t ignore; return __Pyx_PyObject_AsStringAndSize(o, &ignore); } static CYTHON_INLINE char* __Pyx_PyObject_AsStringAndSize(PyObject* o, Py_ssize_t *length) { #if CYTHON_COMPILING_IN_CPYTHON && (__PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT) if ( #if PY_MAJOR_VERSION < 3 && __PYX_DEFAULT_STRING_ENCODING_IS_ASCII __Pyx_sys_getdefaultencoding_not_ascii && #endif PyUnicode_Check(o)) { #if PY_VERSION_HEX < 0x03030000 char* defenc_c; PyObject* defenc = _PyUnicode_AsDefaultEncodedString(o, NULL); if (!defenc) return NULL; defenc_c = PyBytes_AS_STRING(defenc); #if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII { char* end = defenc_c + PyBytes_GET_SIZE(defenc); char* c; for (c = defenc_c; c < end; c++) { if ((unsigned char) (*c) >= 128) { PyUnicode_AsASCIIString(o); return NULL; } } } #endif *length = PyBytes_GET_SIZE(defenc); return defenc_c; #else if (__Pyx_PyUnicode_READY(o) == -1) return NULL; #if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII if (PyUnicode_IS_ASCII(o)) { *length = PyUnicode_GET_LENGTH(o); return PyUnicode_AsUTF8(o); } else { PyUnicode_AsASCIIString(o); return NULL; } #else return PyUnicode_AsUTF8AndSize(o, length); #endif #endif } else #endif #if (!CYTHON_COMPILING_IN_PYPY) || (defined(PyByteArray_AS_STRING) && defined(PyByteArray_GET_SIZE)) if (PyByteArray_Check(o)) { *length = PyByteArray_GET_SIZE(o); return PyByteArray_AS_STRING(o); } else #endif { char* result; int r = PyBytes_AsStringAndSize(o, &result, length); if (unlikely(r < 0)) { return NULL; } else { return result; } } } static CYTHON_INLINE int __Pyx_PyObject_IsTrue(PyObject* x) { int is_true = x == Py_True; if (is_true | (x == Py_False) | (x == Py_None)) return is_true; else return PyObject_IsTrue(x); } static CYTHON_INLINE PyObject* __Pyx_PyNumber_Int(PyObject* x) { PyNumberMethods *m; const char *name = NULL; PyObject *res = NULL; #if PY_MAJOR_VERSION < 3 if (PyInt_Check(x) || PyLong_Check(x)) #else if (PyLong_Check(x)) #endif return __Pyx_NewRef(x); m = Py_TYPE(x)->tp_as_number; #if PY_MAJOR_VERSION < 3 if (m && m->nb_int) { name = "int"; res = PyNumber_Int(x); } else if (m && m->nb_long) { name = "long"; res = PyNumber_Long(x); } #else if (m && m->nb_int) { name = "int"; res = PyNumber_Long(x); } #endif if (res) { #if PY_MAJOR_VERSION < 3 if (!PyInt_Check(res) && !PyLong_Check(res)) { #else if (!PyLong_Check(res)) { #endif PyErr_Format(PyExc_TypeError, "__%.4s__ returned non-%.4s (type %.200s)", name, name, Py_TYPE(res)->tp_name); Py_DECREF(res); return NULL; } } else if (!PyErr_Occurred()) { PyErr_SetString(PyExc_TypeError, "an integer is required"); } return res; } static CYTHON_INLINE Py_ssize_t __Pyx_PyIndex_AsSsize_t(PyObject* b) { Py_ssize_t ival; PyObject *x; #if PY_MAJOR_VERSION < 3 if (likely(PyInt_CheckExact(b))) { if (sizeof(Py_ssize_t) >= sizeof(long)) return PyInt_AS_LONG(b); else return PyInt_AsSsize_t(x); } #endif if (likely(PyLong_CheckExact(b))) { #if CYTHON_USE_PYLONG_INTERNALS const digit* digits = ((PyLongObject*)b)->ob_digit; const Py_ssize_t size = Py_SIZE(b); if (likely(__Pyx_sst_abs(size) <= 1)) { ival = likely(size) ? digits[0] : 0; if (size == -1) ival = -ival; return ival; } else { switch (size) { case 2: if (8 * sizeof(Py_ssize_t) > 2 * PyLong_SHIFT) { return (Py_ssize_t) (((((size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])); } break; case -2: if (8 * sizeof(Py_ssize_t) > 2 * PyLong_SHIFT) { return -(Py_ssize_t) (((((size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])); } break; case 3: if (8 * sizeof(Py_ssize_t) > 3 * PyLong_SHIFT) { return (Py_ssize_t) (((((((size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])); } break; case -3: if (8 * sizeof(Py_ssize_t) > 3 * PyLong_SHIFT) { return -(Py_ssize_t) (((((((size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])); } break; case 4: if (8 * sizeof(Py_ssize_t) > 4 * PyLong_SHIFT) { return (Py_ssize_t) (((((((((size_t)digits[3]) << PyLong_SHIFT) | (size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])); } break; case -4: if (8 * sizeof(Py_ssize_t) > 4 * PyLong_SHIFT) { return -(Py_ssize_t) (((((((((size_t)digits[3]) << PyLong_SHIFT) | (size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])); } break; } } #endif return PyLong_AsSsize_t(b); } x = PyNumber_Index(b); if (!x) return -1; ival = PyInt_AsSsize_t(x); Py_DECREF(x); return ival; } static CYTHON_INLINE PyObject * __Pyx_PyInt_FromSize_t(size_t ival) { return PyInt_FromSize_t(ival); } #endif /* Py_PYTHON_H */ pygame_sdl2-2.1.0-for-renpy-6.99.14.1/gen3/pygame_sdl2.display.c0000644000175000017500000233731013231553471023133 0ustar tomtom00000000000000/* Generated by Cython 0.25.2 */ #define PY_SSIZE_T_CLEAN #include "Python.h" #ifndef Py_PYTHON_H #error Python headers needed to compile C extensions, please install development version of Python. #elif PY_VERSION_HEX < 0x02060000 || (0x03000000 <= PY_VERSION_HEX && PY_VERSION_HEX < 0x03020000) #error Cython requires Python 2.6+ or Python 3.2+. #else #define CYTHON_ABI "0_25_2" #include #ifndef offsetof #define offsetof(type, member) ( (size_t) & ((type*)0) -> member ) #endif #if !defined(WIN32) && !defined(MS_WINDOWS) #ifndef __stdcall #define __stdcall #endif #ifndef __cdecl #define __cdecl #endif #ifndef __fastcall #define __fastcall #endif #endif #ifndef DL_IMPORT #define DL_IMPORT(t) t #endif #ifndef DL_EXPORT #define DL_EXPORT(t) t #endif #ifndef HAVE_LONG_LONG #if PY_VERSION_HEX >= 0x03030000 || (PY_MAJOR_VERSION == 2 && PY_VERSION_HEX >= 0x02070000) #define HAVE_LONG_LONG #endif #endif #ifndef PY_LONG_LONG #define PY_LONG_LONG LONG_LONG #endif #ifndef Py_HUGE_VAL #define Py_HUGE_VAL HUGE_VAL #endif #ifdef PYPY_VERSION #define CYTHON_COMPILING_IN_PYPY 1 #define CYTHON_COMPILING_IN_PYSTON 0 #define CYTHON_COMPILING_IN_CPYTHON 0 #undef CYTHON_USE_TYPE_SLOTS #define CYTHON_USE_TYPE_SLOTS 0 #undef CYTHON_USE_ASYNC_SLOTS #define CYTHON_USE_ASYNC_SLOTS 0 #undef CYTHON_USE_PYLIST_INTERNALS #define CYTHON_USE_PYLIST_INTERNALS 0 #undef CYTHON_USE_UNICODE_INTERNALS #define CYTHON_USE_UNICODE_INTERNALS 0 #undef CYTHON_USE_UNICODE_WRITER #define CYTHON_USE_UNICODE_WRITER 0 #undef CYTHON_USE_PYLONG_INTERNALS #define CYTHON_USE_PYLONG_INTERNALS 0 #undef CYTHON_AVOID_BORROWED_REFS #define CYTHON_AVOID_BORROWED_REFS 1 #undef CYTHON_ASSUME_SAFE_MACROS #define CYTHON_ASSUME_SAFE_MACROS 0 #undef CYTHON_UNPACK_METHODS #define CYTHON_UNPACK_METHODS 0 #undef CYTHON_FAST_THREAD_STATE #define CYTHON_FAST_THREAD_STATE 0 #undef CYTHON_FAST_PYCALL #define CYTHON_FAST_PYCALL 0 #elif defined(PYSTON_VERSION) #define CYTHON_COMPILING_IN_PYPY 0 #define CYTHON_COMPILING_IN_PYSTON 1 #define CYTHON_COMPILING_IN_CPYTHON 0 #ifndef CYTHON_USE_TYPE_SLOTS #define CYTHON_USE_TYPE_SLOTS 1 #endif #undef CYTHON_USE_ASYNC_SLOTS #define CYTHON_USE_ASYNC_SLOTS 0 #undef CYTHON_USE_PYLIST_INTERNALS #define CYTHON_USE_PYLIST_INTERNALS 0 #ifndef CYTHON_USE_UNICODE_INTERNALS #define CYTHON_USE_UNICODE_INTERNALS 1 #endif #undef CYTHON_USE_UNICODE_WRITER #define CYTHON_USE_UNICODE_WRITER 0 #undef CYTHON_USE_PYLONG_INTERNALS #define CYTHON_USE_PYLONG_INTERNALS 0 #ifndef CYTHON_AVOID_BORROWED_REFS #define CYTHON_AVOID_BORROWED_REFS 0 #endif #ifndef CYTHON_ASSUME_SAFE_MACROS #define CYTHON_ASSUME_SAFE_MACROS 1 #endif #ifndef CYTHON_UNPACK_METHODS #define CYTHON_UNPACK_METHODS 1 #endif #undef CYTHON_FAST_THREAD_STATE #define CYTHON_FAST_THREAD_STATE 0 #undef CYTHON_FAST_PYCALL #define CYTHON_FAST_PYCALL 0 #else #define CYTHON_COMPILING_IN_PYPY 0 #define CYTHON_COMPILING_IN_PYSTON 0 #define CYTHON_COMPILING_IN_CPYTHON 1 #ifndef CYTHON_USE_TYPE_SLOTS #define CYTHON_USE_TYPE_SLOTS 1 #endif #if PY_MAJOR_VERSION < 3 #undef CYTHON_USE_ASYNC_SLOTS #define CYTHON_USE_ASYNC_SLOTS 0 #elif !defined(CYTHON_USE_ASYNC_SLOTS) #define CYTHON_USE_ASYNC_SLOTS 1 #endif #if PY_VERSION_HEX < 0x02070000 #undef CYTHON_USE_PYLONG_INTERNALS #define CYTHON_USE_PYLONG_INTERNALS 0 #elif !defined(CYTHON_USE_PYLONG_INTERNALS) #define CYTHON_USE_PYLONG_INTERNALS 1 #endif #ifndef CYTHON_USE_PYLIST_INTERNALS #define CYTHON_USE_PYLIST_INTERNALS 1 #endif #ifndef CYTHON_USE_UNICODE_INTERNALS #define CYTHON_USE_UNICODE_INTERNALS 1 #endif #if PY_VERSION_HEX < 0x030300F0 #undef CYTHON_USE_UNICODE_WRITER #define CYTHON_USE_UNICODE_WRITER 0 #elif !defined(CYTHON_USE_UNICODE_WRITER) #define CYTHON_USE_UNICODE_WRITER 1 #endif #ifndef CYTHON_AVOID_BORROWED_REFS #define CYTHON_AVOID_BORROWED_REFS 0 #endif #ifndef CYTHON_ASSUME_SAFE_MACROS #define CYTHON_ASSUME_SAFE_MACROS 1 #endif #ifndef CYTHON_UNPACK_METHODS #define CYTHON_UNPACK_METHODS 1 #endif #ifndef CYTHON_FAST_THREAD_STATE #define CYTHON_FAST_THREAD_STATE 1 #endif #ifndef CYTHON_FAST_PYCALL #define CYTHON_FAST_PYCALL 1 #endif #endif #if !defined(CYTHON_FAST_PYCCALL) #define CYTHON_FAST_PYCCALL (CYTHON_FAST_PYCALL && PY_VERSION_HEX >= 0x030600B1) #endif #if CYTHON_USE_PYLONG_INTERNALS #include "longintrepr.h" #undef SHIFT #undef BASE #undef MASK #endif #if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX < 0x02070600 && !defined(Py_OptimizeFlag) #define Py_OptimizeFlag 0 #endif #define __PYX_BUILD_PY_SSIZE_T "n" #define CYTHON_FORMAT_SSIZE_T "z" #if PY_MAJOR_VERSION < 3 #define __Pyx_BUILTIN_MODULE_NAME "__builtin__" #define __Pyx_PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)\ PyCode_New(a+k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos) #define __Pyx_DefaultClassType PyClass_Type #else #define __Pyx_BUILTIN_MODULE_NAME "builtins" #define __Pyx_PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)\ PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos) #define __Pyx_DefaultClassType PyType_Type #endif #ifndef Py_TPFLAGS_CHECKTYPES #define Py_TPFLAGS_CHECKTYPES 0 #endif #ifndef Py_TPFLAGS_HAVE_INDEX #define Py_TPFLAGS_HAVE_INDEX 0 #endif #ifndef Py_TPFLAGS_HAVE_NEWBUFFER #define Py_TPFLAGS_HAVE_NEWBUFFER 0 #endif #ifndef Py_TPFLAGS_HAVE_FINALIZE #define Py_TPFLAGS_HAVE_FINALIZE 0 #endif #ifndef METH_FASTCALL #define METH_FASTCALL 0x80 typedef PyObject *(*__Pyx_PyCFunctionFast) (PyObject *self, PyObject **args, Py_ssize_t nargs, PyObject *kwnames); #else #define __Pyx_PyCFunctionFast _PyCFunctionFast #endif #if CYTHON_FAST_PYCCALL #define __Pyx_PyFastCFunction_Check(func)\ ((PyCFunction_Check(func) && (METH_FASTCALL == (PyCFunction_GET_FLAGS(func) & ~(METH_CLASS | METH_STATIC | METH_COEXIST))))) #else #define __Pyx_PyFastCFunction_Check(func) 0 #endif #if PY_VERSION_HEX > 0x03030000 && defined(PyUnicode_KIND) #define CYTHON_PEP393_ENABLED 1 #define __Pyx_PyUnicode_READY(op) (likely(PyUnicode_IS_READY(op)) ?\ 0 : _PyUnicode_Ready((PyObject *)(op))) #define __Pyx_PyUnicode_GET_LENGTH(u) PyUnicode_GET_LENGTH(u) #define __Pyx_PyUnicode_READ_CHAR(u, i) PyUnicode_READ_CHAR(u, i) #define __Pyx_PyUnicode_MAX_CHAR_VALUE(u) PyUnicode_MAX_CHAR_VALUE(u) #define __Pyx_PyUnicode_KIND(u) PyUnicode_KIND(u) #define __Pyx_PyUnicode_DATA(u) PyUnicode_DATA(u) #define __Pyx_PyUnicode_READ(k, d, i) PyUnicode_READ(k, d, i) #define __Pyx_PyUnicode_WRITE(k, d, i, ch) PyUnicode_WRITE(k, d, i, ch) #define __Pyx_PyUnicode_IS_TRUE(u) (0 != (likely(PyUnicode_IS_READY(u)) ? PyUnicode_GET_LENGTH(u) : PyUnicode_GET_SIZE(u))) #else #define CYTHON_PEP393_ENABLED 0 #define PyUnicode_1BYTE_KIND 1 #define PyUnicode_2BYTE_KIND 2 #define PyUnicode_4BYTE_KIND 4 #define __Pyx_PyUnicode_READY(op) (0) #define __Pyx_PyUnicode_GET_LENGTH(u) PyUnicode_GET_SIZE(u) #define __Pyx_PyUnicode_READ_CHAR(u, i) ((Py_UCS4)(PyUnicode_AS_UNICODE(u)[i])) #define __Pyx_PyUnicode_MAX_CHAR_VALUE(u) ((sizeof(Py_UNICODE) == 2) ? 65535 : 1114111) #define __Pyx_PyUnicode_KIND(u) (sizeof(Py_UNICODE)) #define __Pyx_PyUnicode_DATA(u) ((void*)PyUnicode_AS_UNICODE(u)) #define __Pyx_PyUnicode_READ(k, d, i) ((void)(k), (Py_UCS4)(((Py_UNICODE*)d)[i])) #define __Pyx_PyUnicode_WRITE(k, d, i, ch) (((void)(k)), ((Py_UNICODE*)d)[i] = ch) #define __Pyx_PyUnicode_IS_TRUE(u) (0 != PyUnicode_GET_SIZE(u)) #endif #if CYTHON_COMPILING_IN_PYPY #define __Pyx_PyUnicode_Concat(a, b) PyNumber_Add(a, b) #define __Pyx_PyUnicode_ConcatSafe(a, b) PyNumber_Add(a, b) #else #define __Pyx_PyUnicode_Concat(a, b) PyUnicode_Concat(a, b) #define __Pyx_PyUnicode_ConcatSafe(a, b) ((unlikely((a) == Py_None) || unlikely((b) == Py_None)) ?\ PyNumber_Add(a, b) : __Pyx_PyUnicode_Concat(a, b)) #endif #if CYTHON_COMPILING_IN_PYPY && !defined(PyUnicode_Contains) #define PyUnicode_Contains(u, s) PySequence_Contains(u, s) #endif #if CYTHON_COMPILING_IN_PYPY && !defined(PyByteArray_Check) #define PyByteArray_Check(obj) PyObject_TypeCheck(obj, &PyByteArray_Type) #endif #if CYTHON_COMPILING_IN_PYPY && !defined(PyObject_Format) #define PyObject_Format(obj, fmt) PyObject_CallMethod(obj, "__format__", "O", fmt) #endif #if CYTHON_COMPILING_IN_PYPY && !defined(PyObject_Malloc) #define PyObject_Malloc(s) PyMem_Malloc(s) #define PyObject_Free(p) PyMem_Free(p) #define PyObject_Realloc(p) PyMem_Realloc(p) #endif #if CYTHON_COMPILING_IN_PYSTON #define __Pyx_PyCode_HasFreeVars(co) PyCode_HasFreeVars(co) #define __Pyx_PyFrame_SetLineNumber(frame, lineno) PyFrame_SetLineNumber(frame, lineno) #else #define __Pyx_PyCode_HasFreeVars(co) (PyCode_GetNumFree(co) > 0) #define __Pyx_PyFrame_SetLineNumber(frame, lineno) (frame)->f_lineno = (lineno) #endif #define __Pyx_PyString_FormatSafe(a, b) ((unlikely((a) == Py_None)) ? PyNumber_Remainder(a, b) : __Pyx_PyString_Format(a, b)) #define __Pyx_PyUnicode_FormatSafe(a, b) ((unlikely((a) == Py_None)) ? PyNumber_Remainder(a, b) : PyUnicode_Format(a, b)) #if PY_MAJOR_VERSION >= 3 #define __Pyx_PyString_Format(a, b) PyUnicode_Format(a, b) #else #define __Pyx_PyString_Format(a, b) PyString_Format(a, b) #endif #if PY_MAJOR_VERSION < 3 && !defined(PyObject_ASCII) #define PyObject_ASCII(o) PyObject_Repr(o) #endif #if PY_MAJOR_VERSION >= 3 #define PyBaseString_Type PyUnicode_Type #define PyStringObject PyUnicodeObject #define PyString_Type PyUnicode_Type #define PyString_Check PyUnicode_Check #define PyString_CheckExact PyUnicode_CheckExact #endif #if PY_MAJOR_VERSION >= 3 #define __Pyx_PyBaseString_Check(obj) PyUnicode_Check(obj) #define __Pyx_PyBaseString_CheckExact(obj) PyUnicode_CheckExact(obj) #else #define __Pyx_PyBaseString_Check(obj) (PyString_Check(obj) || PyUnicode_Check(obj)) #define __Pyx_PyBaseString_CheckExact(obj) (PyString_CheckExact(obj) || PyUnicode_CheckExact(obj)) #endif #ifndef PySet_CheckExact #define PySet_CheckExact(obj) (Py_TYPE(obj) == &PySet_Type) #endif #define __Pyx_TypeCheck(obj, type) PyObject_TypeCheck(obj, (PyTypeObject *)type) #define __Pyx_PyException_Check(obj) __Pyx_TypeCheck(obj, PyExc_Exception) #if PY_MAJOR_VERSION >= 3 #define PyIntObject PyLongObject #define PyInt_Type PyLong_Type #define PyInt_Check(op) PyLong_Check(op) #define PyInt_CheckExact(op) PyLong_CheckExact(op) #define PyInt_FromString PyLong_FromString #define PyInt_FromUnicode PyLong_FromUnicode #define PyInt_FromLong PyLong_FromLong #define PyInt_FromSize_t PyLong_FromSize_t #define PyInt_FromSsize_t PyLong_FromSsize_t #define PyInt_AsLong PyLong_AsLong #define PyInt_AS_LONG PyLong_AS_LONG #define PyInt_AsSsize_t PyLong_AsSsize_t #define PyInt_AsUnsignedLongMask PyLong_AsUnsignedLongMask #define PyInt_AsUnsignedLongLongMask PyLong_AsUnsignedLongLongMask #define PyNumber_Int PyNumber_Long #endif #if PY_MAJOR_VERSION >= 3 #define PyBoolObject PyLongObject #endif #if PY_MAJOR_VERSION >= 3 && CYTHON_COMPILING_IN_PYPY #ifndef PyUnicode_InternFromString #define PyUnicode_InternFromString(s) PyUnicode_FromString(s) #endif #endif #if PY_VERSION_HEX < 0x030200A4 typedef long Py_hash_t; #define __Pyx_PyInt_FromHash_t PyInt_FromLong #define __Pyx_PyInt_AsHash_t PyInt_AsLong #else #define __Pyx_PyInt_FromHash_t PyInt_FromSsize_t #define __Pyx_PyInt_AsHash_t PyInt_AsSsize_t #endif #if PY_MAJOR_VERSION >= 3 #define __Pyx_PyMethod_New(func, self, klass) ((self) ? PyMethod_New(func, self) : PyInstanceMethod_New(func)) #else #define __Pyx_PyMethod_New(func, self, klass) PyMethod_New(func, self, klass) #endif #if CYTHON_USE_ASYNC_SLOTS #if PY_VERSION_HEX >= 0x030500B1 #define __Pyx_PyAsyncMethodsStruct PyAsyncMethods #define __Pyx_PyType_AsAsync(obj) (Py_TYPE(obj)->tp_as_async) #else typedef struct { unaryfunc am_await; unaryfunc am_aiter; unaryfunc am_anext; } __Pyx_PyAsyncMethodsStruct; #define __Pyx_PyType_AsAsync(obj) ((__Pyx_PyAsyncMethodsStruct*) (Py_TYPE(obj)->tp_reserved)) #endif #else #define __Pyx_PyType_AsAsync(obj) NULL #endif #ifndef CYTHON_RESTRICT #if defined(__GNUC__) #define CYTHON_RESTRICT __restrict__ #elif defined(_MSC_VER) && _MSC_VER >= 1400 #define CYTHON_RESTRICT __restrict #elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L #define CYTHON_RESTRICT restrict #else #define CYTHON_RESTRICT #endif #endif #ifndef CYTHON_UNUSED # if defined(__GNUC__) # if !(defined(__cplusplus)) || (__GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 4)) # define CYTHON_UNUSED __attribute__ ((__unused__)) # else # define CYTHON_UNUSED # endif # elif defined(__ICC) || (defined(__INTEL_COMPILER) && !defined(_MSC_VER)) # define CYTHON_UNUSED __attribute__ ((__unused__)) # else # define CYTHON_UNUSED # endif #endif #ifndef CYTHON_MAYBE_UNUSED_VAR # if defined(__cplusplus) template void CYTHON_MAYBE_UNUSED_VAR( const T& ) { } # else # define CYTHON_MAYBE_UNUSED_VAR(x) (void)(x) # endif #endif #ifndef CYTHON_NCP_UNUSED # if CYTHON_COMPILING_IN_CPYTHON # define CYTHON_NCP_UNUSED # else # define CYTHON_NCP_UNUSED CYTHON_UNUSED # endif #endif #define __Pyx_void_to_None(void_result) ((void)(void_result), Py_INCREF(Py_None), Py_None) #ifndef CYTHON_INLINE #if defined(__clang__) #define CYTHON_INLINE __inline__ __attribute__ ((__unused__)) #elif defined(__GNUC__) #define CYTHON_INLINE __inline__ #elif defined(_MSC_VER) #define CYTHON_INLINE __inline #elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L #define CYTHON_INLINE inline #else #define CYTHON_INLINE #endif #endif #if defined(WIN32) || defined(MS_WINDOWS) #define _USE_MATH_DEFINES #endif #include #ifdef NAN #define __PYX_NAN() ((float) NAN) #else static CYTHON_INLINE float __PYX_NAN() { float value; memset(&value, 0xFF, sizeof(value)); return value; } #endif #if defined(__CYGWIN__) && defined(_LDBL_EQ_DBL) #define __Pyx_truncl trunc #else #define __Pyx_truncl truncl #endif #define __PYX_ERR(f_index, lineno, Ln_error) \ { \ __pyx_filename = __pyx_f[f_index]; __pyx_lineno = lineno; __pyx_clineno = __LINE__; goto Ln_error; \ } #if PY_MAJOR_VERSION >= 3 #define __Pyx_PyNumber_Divide(x,y) PyNumber_TrueDivide(x,y) #define __Pyx_PyNumber_InPlaceDivide(x,y) PyNumber_InPlaceTrueDivide(x,y) #else #define __Pyx_PyNumber_Divide(x,y) PyNumber_TrueDivide(x,y) #define __Pyx_PyNumber_InPlaceDivide(x,y) PyNumber_InPlaceTrueDivide(x,y) #endif #ifndef __PYX_EXTERN_C #ifdef __cplusplus #define __PYX_EXTERN_C extern "C" #else #define __PYX_EXTERN_C extern #endif #endif #define __PYX_HAVE__pygame_sdl2__display #define __PYX_HAVE_API__pygame_sdl2__display #include #include #include #include #include "SDL.h" #include #ifdef _OPENMP #include #endif /* _OPENMP */ #ifdef PYREX_WITHOUT_ASSERTIONS #define CYTHON_WITHOUT_ASSERTIONS #endif typedef struct {PyObject **p; const char *s; const Py_ssize_t n; const char* encoding; const char is_unicode; const char is_str; const char intern; } __Pyx_StringTabEntry; #define __PYX_DEFAULT_STRING_ENCODING_IS_ASCII 0 #define __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT 0 #define __PYX_DEFAULT_STRING_ENCODING "" #define __Pyx_PyObject_FromString __Pyx_PyBytes_FromString #define __Pyx_PyObject_FromStringAndSize __Pyx_PyBytes_FromStringAndSize #define __Pyx_uchar_cast(c) ((unsigned char)c) #define __Pyx_long_cast(x) ((long)x) #define __Pyx_fits_Py_ssize_t(v, type, is_signed) (\ (sizeof(type) < sizeof(Py_ssize_t)) ||\ (sizeof(type) > sizeof(Py_ssize_t) &&\ likely(v < (type)PY_SSIZE_T_MAX ||\ v == (type)PY_SSIZE_T_MAX) &&\ (!is_signed || likely(v > (type)PY_SSIZE_T_MIN ||\ v == (type)PY_SSIZE_T_MIN))) ||\ (sizeof(type) == sizeof(Py_ssize_t) &&\ (is_signed || likely(v < (type)PY_SSIZE_T_MAX ||\ v == (type)PY_SSIZE_T_MAX))) ) #if defined (__cplusplus) && __cplusplus >= 201103L #include #define __Pyx_sst_abs(value) std::abs(value) #elif SIZEOF_INT >= SIZEOF_SIZE_T #define __Pyx_sst_abs(value) abs(value) #elif SIZEOF_LONG >= SIZEOF_SIZE_T #define __Pyx_sst_abs(value) labs(value) #elif defined (_MSC_VER) && defined (_M_X64) #define __Pyx_sst_abs(value) _abs64(value) #elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L #define __Pyx_sst_abs(value) llabs(value) #elif defined (__GNUC__) #define __Pyx_sst_abs(value) __builtin_llabs(value) #else #define __Pyx_sst_abs(value) ((value<0) ? -value : value) #endif static CYTHON_INLINE char* __Pyx_PyObject_AsString(PyObject*); static CYTHON_INLINE char* __Pyx_PyObject_AsStringAndSize(PyObject*, Py_ssize_t* length); #define __Pyx_PyByteArray_FromString(s) PyByteArray_FromStringAndSize((const char*)s, strlen((const char*)s)) #define __Pyx_PyByteArray_FromStringAndSize(s, l) PyByteArray_FromStringAndSize((const char*)s, l) #define __Pyx_PyBytes_FromString PyBytes_FromString #define __Pyx_PyBytes_FromStringAndSize PyBytes_FromStringAndSize static CYTHON_INLINE PyObject* __Pyx_PyUnicode_FromString(const char*); #if PY_MAJOR_VERSION < 3 #define __Pyx_PyStr_FromString __Pyx_PyBytes_FromString #define __Pyx_PyStr_FromStringAndSize __Pyx_PyBytes_FromStringAndSize #else #define __Pyx_PyStr_FromString __Pyx_PyUnicode_FromString #define __Pyx_PyStr_FromStringAndSize __Pyx_PyUnicode_FromStringAndSize #endif #define __Pyx_PyObject_AsSString(s) ((signed char*) __Pyx_PyObject_AsString(s)) #define __Pyx_PyObject_AsUString(s) ((unsigned char*) __Pyx_PyObject_AsString(s)) #define __Pyx_PyObject_FromCString(s) __Pyx_PyObject_FromString((const char*)s) #define __Pyx_PyBytes_FromCString(s) __Pyx_PyBytes_FromString((const char*)s) #define __Pyx_PyByteArray_FromCString(s) __Pyx_PyByteArray_FromString((const char*)s) #define __Pyx_PyStr_FromCString(s) __Pyx_PyStr_FromString((const char*)s) #define __Pyx_PyUnicode_FromCString(s) __Pyx_PyUnicode_FromString((const char*)s) #if PY_MAJOR_VERSION < 3 static CYTHON_INLINE size_t __Pyx_Py_UNICODE_strlen(const Py_UNICODE *u) { const Py_UNICODE *u_end = u; while (*u_end++) ; return (size_t)(u_end - u - 1); } #else #define __Pyx_Py_UNICODE_strlen Py_UNICODE_strlen #endif #define __Pyx_PyUnicode_FromUnicode(u) PyUnicode_FromUnicode(u, __Pyx_Py_UNICODE_strlen(u)) #define __Pyx_PyUnicode_FromUnicodeAndLength PyUnicode_FromUnicode #define __Pyx_PyUnicode_AsUnicode PyUnicode_AsUnicode #define __Pyx_NewRef(obj) (Py_INCREF(obj), obj) #define __Pyx_Owned_Py_None(b) __Pyx_NewRef(Py_None) #define __Pyx_PyBool_FromLong(b) ((b) ? __Pyx_NewRef(Py_True) : __Pyx_NewRef(Py_False)) static CYTHON_INLINE int __Pyx_PyObject_IsTrue(PyObject*); static CYTHON_INLINE PyObject* __Pyx_PyNumber_IntOrLong(PyObject* x); static CYTHON_INLINE Py_ssize_t __Pyx_PyIndex_AsSsize_t(PyObject*); static CYTHON_INLINE PyObject * __Pyx_PyInt_FromSize_t(size_t); #if CYTHON_ASSUME_SAFE_MACROS #define __pyx_PyFloat_AsDouble(x) (PyFloat_CheckExact(x) ? PyFloat_AS_DOUBLE(x) : PyFloat_AsDouble(x)) #else #define __pyx_PyFloat_AsDouble(x) PyFloat_AsDouble(x) #endif #define __pyx_PyFloat_AsFloat(x) ((float) __pyx_PyFloat_AsDouble(x)) #if PY_MAJOR_VERSION >= 3 #define __Pyx_PyNumber_Int(x) (PyLong_CheckExact(x) ? __Pyx_NewRef(x) : PyNumber_Long(x)) #else #define __Pyx_PyNumber_Int(x) (PyInt_CheckExact(x) ? __Pyx_NewRef(x) : PyNumber_Int(x)) #endif #define __Pyx_PyNumber_Float(x) (PyFloat_CheckExact(x) ? __Pyx_NewRef(x) : PyNumber_Float(x)) #if PY_MAJOR_VERSION < 3 && __PYX_DEFAULT_STRING_ENCODING_IS_ASCII static int __Pyx_sys_getdefaultencoding_not_ascii; static int __Pyx_init_sys_getdefaultencoding_params(void) { PyObject* sys; PyObject* default_encoding = NULL; PyObject* ascii_chars_u = NULL; PyObject* ascii_chars_b = NULL; const char* default_encoding_c; sys = PyImport_ImportModule("sys"); if (!sys) goto bad; default_encoding = PyObject_CallMethod(sys, (char*) "getdefaultencoding", NULL); Py_DECREF(sys); if (!default_encoding) goto bad; default_encoding_c = PyBytes_AsString(default_encoding); if (!default_encoding_c) goto bad; if (strcmp(default_encoding_c, "ascii") == 0) { __Pyx_sys_getdefaultencoding_not_ascii = 0; } else { char ascii_chars[128]; int c; for (c = 0; c < 128; c++) { ascii_chars[c] = c; } __Pyx_sys_getdefaultencoding_not_ascii = 1; ascii_chars_u = PyUnicode_DecodeASCII(ascii_chars, 128, NULL); if (!ascii_chars_u) goto bad; ascii_chars_b = PyUnicode_AsEncodedString(ascii_chars_u, default_encoding_c, NULL); if (!ascii_chars_b || !PyBytes_Check(ascii_chars_b) || memcmp(ascii_chars, PyBytes_AS_STRING(ascii_chars_b), 128) != 0) { PyErr_Format( PyExc_ValueError, "This module compiled with c_string_encoding=ascii, but default encoding '%.200s' is not a superset of ascii.", default_encoding_c); goto bad; } Py_DECREF(ascii_chars_u); Py_DECREF(ascii_chars_b); } Py_DECREF(default_encoding); return 0; bad: Py_XDECREF(default_encoding); Py_XDECREF(ascii_chars_u); Py_XDECREF(ascii_chars_b); return -1; } #endif #if __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT && PY_MAJOR_VERSION >= 3 #define __Pyx_PyUnicode_FromStringAndSize(c_str, size) PyUnicode_DecodeUTF8(c_str, size, NULL) #else #define __Pyx_PyUnicode_FromStringAndSize(c_str, size) PyUnicode_Decode(c_str, size, __PYX_DEFAULT_STRING_ENCODING, NULL) #if __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT static char* __PYX_DEFAULT_STRING_ENCODING; static int __Pyx_init_sys_getdefaultencoding_params(void) { PyObject* sys; PyObject* default_encoding = NULL; char* default_encoding_c; sys = PyImport_ImportModule("sys"); if (!sys) goto bad; default_encoding = PyObject_CallMethod(sys, (char*) (const char*) "getdefaultencoding", NULL); Py_DECREF(sys); if (!default_encoding) goto bad; default_encoding_c = PyBytes_AsString(default_encoding); if (!default_encoding_c) goto bad; __PYX_DEFAULT_STRING_ENCODING = (char*) malloc(strlen(default_encoding_c)); if (!__PYX_DEFAULT_STRING_ENCODING) goto bad; strcpy(__PYX_DEFAULT_STRING_ENCODING, default_encoding_c); Py_DECREF(default_encoding); return 0; bad: Py_XDECREF(default_encoding); return -1; } #endif #endif /* Test for GCC > 2.95 */ #if defined(__GNUC__) && (__GNUC__ > 2 || (__GNUC__ == 2 && (__GNUC_MINOR__ > 95))) #define likely(x) __builtin_expect(!!(x), 1) #define unlikely(x) __builtin_expect(!!(x), 0) #else /* !__GNUC__ or GCC < 2.95 */ #define likely(x) (x) #define unlikely(x) (x) #endif /* __GNUC__ */ static PyObject *__pyx_m; static PyObject *__pyx_d; static PyObject *__pyx_b; static PyObject *__pyx_empty_tuple; static PyObject *__pyx_empty_bytes; static PyObject *__pyx_empty_unicode; static int __pyx_lineno; static int __pyx_clineno = 0; static const char * __pyx_cfilenm= __FILE__; static const char *__pyx_filename; static const char *__pyx_f[] = { "src/pygame_sdl2/display.pyx", "src/pygame_sdl2/display.pxd", "src/pygame_sdl2/surface.pxd", "src/pygame_sdl2/rect.pxd", }; /*--- Type declarations ---*/ struct __pyx_obj_11pygame_sdl2_7surface_Surface; struct __pyx_obj_11pygame_sdl2_4rect_Rect; struct __pyx_obj_11pygame_sdl2_7display_Window; struct __pyx_opt_args_11pygame_sdl2_4rect_to_sdl_rect; /* "pygame_sdl2/rect.pxd":31 * * * cdef int to_sdl_rect(rectlike, SDL_Rect *rect, argname=*) except -1 # <<<<<<<<<<<<<< */ struct __pyx_opt_args_11pygame_sdl2_4rect_to_sdl_rect { int __pyx_n; PyObject *argname; }; /* "pygame_sdl2/surface.pxd":23 * from sdl2 cimport SDL_Surface * * cdef class Surface: # <<<<<<<<<<<<<< * # Allow weak references. * cdef object __weakref__ */ struct __pyx_obj_11pygame_sdl2_7surface_Surface { PyObject_HEAD struct __pyx_vtabstruct_11pygame_sdl2_7surface_Surface *__pyx_vtab; PyObject *__weakref__; SDL_Surface *surface; int owns_surface; int window_surface; PyObject *locklist; struct __pyx_obj_11pygame_sdl2_7surface_Surface *parent; struct __pyx_obj_11pygame_sdl2_7surface_Surface *root; int offset_x; int offset_y; PyObject *get_window_flags; int has_alpha; }; /* "pygame_sdl2/rect.pxd":21 * from sdl2 cimport * * * cdef class Rect: # <<<<<<<<<<<<<< * # Allow weak references. * cdef object __weakref__ */ struct __pyx_obj_11pygame_sdl2_4rect_Rect { PyObject_HEAD PyObject *__weakref__; int x; int y; int w; int h; }; /* "pygame_sdl2/display.pxd":23 * from pygame_sdl2.surface cimport Surface * * cdef class Window: # <<<<<<<<<<<<<< * # Allow weak references. * cdef object __weakref__ */ struct __pyx_obj_11pygame_sdl2_7display_Window { PyObject_HEAD PyObject *__weakref__; SDL_Window *window; SDL_Surface *window_surface; struct __pyx_obj_11pygame_sdl2_7surface_Surface *surface; SDL_GLContext gl_context; Uint32 create_flags; }; /* "pygame_sdl2/surface.pxd":23 * from sdl2 cimport SDL_Surface * * cdef class Surface: # <<<<<<<<<<<<<< * # Allow weak references. * cdef object __weakref__ */ struct __pyx_vtabstruct_11pygame_sdl2_7surface_Surface { void (*take_surface)(struct __pyx_obj_11pygame_sdl2_7surface_Surface *, SDL_Surface *); }; static struct __pyx_vtabstruct_11pygame_sdl2_7surface_Surface *__pyx_vtabptr_11pygame_sdl2_7surface_Surface; /* --- Runtime support code (head) --- */ /* Refnanny.proto */ #ifndef CYTHON_REFNANNY #define CYTHON_REFNANNY 0 #endif #if CYTHON_REFNANNY typedef struct { void (*INCREF)(void*, PyObject*, int); void (*DECREF)(void*, PyObject*, int); void (*GOTREF)(void*, PyObject*, int); void (*GIVEREF)(void*, PyObject*, int); void* (*SetupContext)(const char*, int, const char*); void (*FinishContext)(void**); } __Pyx_RefNannyAPIStruct; static __Pyx_RefNannyAPIStruct *__Pyx_RefNanny = NULL; static __Pyx_RefNannyAPIStruct *__Pyx_RefNannyImportAPI(const char *modname); #define __Pyx_RefNannyDeclarations void *__pyx_refnanny = NULL; #ifdef WITH_THREAD #define __Pyx_RefNannySetupContext(name, acquire_gil)\ if (acquire_gil) {\ PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure();\ __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), __LINE__, __FILE__);\ PyGILState_Release(__pyx_gilstate_save);\ } else {\ __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), __LINE__, __FILE__);\ } #else #define __Pyx_RefNannySetupContext(name, acquire_gil)\ __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), __LINE__, __FILE__) #endif #define __Pyx_RefNannyFinishContext()\ __Pyx_RefNanny->FinishContext(&__pyx_refnanny) #define __Pyx_INCREF(r) __Pyx_RefNanny->INCREF(__pyx_refnanny, (PyObject *)(r), __LINE__) #define __Pyx_DECREF(r) __Pyx_RefNanny->DECREF(__pyx_refnanny, (PyObject *)(r), __LINE__) #define __Pyx_GOTREF(r) __Pyx_RefNanny->GOTREF(__pyx_refnanny, (PyObject *)(r), __LINE__) #define __Pyx_GIVEREF(r) __Pyx_RefNanny->GIVEREF(__pyx_refnanny, (PyObject *)(r), __LINE__) #define __Pyx_XINCREF(r) do { if((r) != NULL) {__Pyx_INCREF(r); }} while(0) #define __Pyx_XDECREF(r) do { if((r) != NULL) {__Pyx_DECREF(r); }} while(0) #define __Pyx_XGOTREF(r) do { if((r) != NULL) {__Pyx_GOTREF(r); }} while(0) #define __Pyx_XGIVEREF(r) do { if((r) != NULL) {__Pyx_GIVEREF(r);}} while(0) #else #define __Pyx_RefNannyDeclarations #define __Pyx_RefNannySetupContext(name, acquire_gil) #define __Pyx_RefNannyFinishContext() #define __Pyx_INCREF(r) Py_INCREF(r) #define __Pyx_DECREF(r) Py_DECREF(r) #define __Pyx_GOTREF(r) #define __Pyx_GIVEREF(r) #define __Pyx_XINCREF(r) Py_XINCREF(r) #define __Pyx_XDECREF(r) Py_XDECREF(r) #define __Pyx_XGOTREF(r) #define __Pyx_XGIVEREF(r) #endif #define __Pyx_XDECREF_SET(r, v) do {\ PyObject *tmp = (PyObject *) r;\ r = v; __Pyx_XDECREF(tmp);\ } while (0) #define __Pyx_DECREF_SET(r, v) do {\ PyObject *tmp = (PyObject *) r;\ r = v; __Pyx_DECREF(tmp);\ } while (0) #define __Pyx_CLEAR(r) do { PyObject* tmp = ((PyObject*)(r)); r = NULL; __Pyx_DECREF(tmp);} while(0) #define __Pyx_XCLEAR(r) do { if((r) != NULL) {PyObject* tmp = ((PyObject*)(r)); r = NULL; __Pyx_DECREF(tmp);}} while(0) /* PyObjectGetAttrStr.proto */ #if CYTHON_USE_TYPE_SLOTS static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStr(PyObject* obj, PyObject* attr_name) { PyTypeObject* tp = Py_TYPE(obj); if (likely(tp->tp_getattro)) return tp->tp_getattro(obj, attr_name); #if PY_MAJOR_VERSION < 3 if (likely(tp->tp_getattr)) return tp->tp_getattr(obj, PyString_AS_STRING(attr_name)); #endif return PyObject_GetAttr(obj, attr_name); } #else #define __Pyx_PyObject_GetAttrStr(o,n) PyObject_GetAttr(o,n) #endif /* GetBuiltinName.proto */ static PyObject *__Pyx_GetBuiltinName(PyObject *name); /* RaiseArgTupleInvalid.proto */ static void __Pyx_RaiseArgtupleInvalid(const char* func_name, int exact, Py_ssize_t num_min, Py_ssize_t num_max, Py_ssize_t num_found); /* RaiseDoubleKeywords.proto */ static void __Pyx_RaiseDoubleKeywordsError(const char* func_name, PyObject* kw_name); /* ParseKeywords.proto */ static int __Pyx_ParseOptionalKeywords(PyObject *kwds, PyObject **argnames[],\ PyObject *kwds2, PyObject *values[], Py_ssize_t num_pos_args,\ const char* function_name); /* unicode_tailmatch.proto */ static int __Pyx_PyUnicode_Tailmatch(PyObject* s, PyObject* substr, Py_ssize_t start, Py_ssize_t end, int direction); /* PyObjectCall.proto */ #if CYTHON_COMPILING_IN_CPYTHON static CYTHON_INLINE PyObject* __Pyx_PyObject_Call(PyObject *func, PyObject *arg, PyObject *kw); #else #define __Pyx_PyObject_Call(func, arg, kw) PyObject_Call(func, arg, kw) #endif /* GetModuleGlobalName.proto */ static CYTHON_INLINE PyObject *__Pyx_GetModuleGlobalName(PyObject *name); /* PySequenceContains.proto */ static CYTHON_INLINE int __Pyx_PySequence_ContainsTF(PyObject* item, PyObject* seq, int eq) { int result = PySequence_Contains(seq, item); return unlikely(result < 0) ? result : (result == (eq == Py_EQ)); } /* PyCFunctionFastCall.proto */ #if CYTHON_FAST_PYCCALL static CYTHON_INLINE PyObject *__Pyx_PyCFunction_FastCall(PyObject *func, PyObject **args, Py_ssize_t nargs); #else #define __Pyx_PyCFunction_FastCall(func, args, nargs) (assert(0), NULL) #endif /* PyFunctionFastCall.proto */ #if CYTHON_FAST_PYCALL #define __Pyx_PyFunction_FastCall(func, args, nargs)\ __Pyx_PyFunction_FastCallDict((func), (args), (nargs), NULL) #if 1 || PY_VERSION_HEX < 0x030600B1 static PyObject *__Pyx_PyFunction_FastCallDict(PyObject *func, PyObject **args, int nargs, PyObject *kwargs); #else #define __Pyx_PyFunction_FastCallDict(func, args, nargs, kwargs) _PyFunction_FastCallDict(func, args, nargs, kwargs) #endif #endif /* PyObjectCallMethO.proto */ #if CYTHON_COMPILING_IN_CPYTHON static CYTHON_INLINE PyObject* __Pyx_PyObject_CallMethO(PyObject *func, PyObject *arg); #endif /* PyObjectCallOneArg.proto */ static CYTHON_INLINE PyObject* __Pyx_PyObject_CallOneArg(PyObject *func, PyObject *arg); /* PyObjectCallNoArg.proto */ #if CYTHON_COMPILING_IN_CPYTHON static CYTHON_INLINE PyObject* __Pyx_PyObject_CallNoArg(PyObject *func); #else #define __Pyx_PyObject_CallNoArg(func) __Pyx_PyObject_Call(func, __pyx_empty_tuple, NULL) #endif /* PyThreadStateGet.proto */ #if CYTHON_FAST_THREAD_STATE #define __Pyx_PyThreadState_declare PyThreadState *__pyx_tstate; #define __Pyx_PyThreadState_assign __pyx_tstate = PyThreadState_GET(); #else #define __Pyx_PyThreadState_declare #define __Pyx_PyThreadState_assign #endif /* PyErrFetchRestore.proto */ #if CYTHON_FAST_THREAD_STATE #define __Pyx_ErrRestoreWithState(type, value, tb) __Pyx_ErrRestoreInState(PyThreadState_GET(), type, value, tb) #define __Pyx_ErrFetchWithState(type, value, tb) __Pyx_ErrFetchInState(PyThreadState_GET(), type, value, tb) #define __Pyx_ErrRestore(type, value, tb) __Pyx_ErrRestoreInState(__pyx_tstate, type, value, tb) #define __Pyx_ErrFetch(type, value, tb) __Pyx_ErrFetchInState(__pyx_tstate, type, value, tb) static CYTHON_INLINE void __Pyx_ErrRestoreInState(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb); static CYTHON_INLINE void __Pyx_ErrFetchInState(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb); #else #define __Pyx_ErrRestoreWithState(type, value, tb) PyErr_Restore(type, value, tb) #define __Pyx_ErrFetchWithState(type, value, tb) PyErr_Fetch(type, value, tb) #define __Pyx_ErrRestore(type, value, tb) PyErr_Restore(type, value, tb) #define __Pyx_ErrFetch(type, value, tb) PyErr_Fetch(type, value, tb) #endif /* RaiseException.proto */ static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, PyObject *cause); /* Import.proto */ static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list, int level); /* SaveResetException.proto */ #if CYTHON_FAST_THREAD_STATE #define __Pyx_ExceptionSave(type, value, tb) __Pyx__ExceptionSave(__pyx_tstate, type, value, tb) static CYTHON_INLINE void __Pyx__ExceptionSave(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb); #define __Pyx_ExceptionReset(type, value, tb) __Pyx__ExceptionReset(__pyx_tstate, type, value, tb) static CYTHON_INLINE void __Pyx__ExceptionReset(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb); #else #define __Pyx_ExceptionSave(type, value, tb) PyErr_GetExcInfo(type, value, tb) #define __Pyx_ExceptionReset(type, value, tb) PyErr_SetExcInfo(type, value, tb) #endif /* PyErrExceptionMatches.proto */ #if CYTHON_FAST_THREAD_STATE #define __Pyx_PyErr_ExceptionMatches(err) __Pyx_PyErr_ExceptionMatchesInState(__pyx_tstate, err) static CYTHON_INLINE int __Pyx_PyErr_ExceptionMatchesInState(PyThreadState* tstate, PyObject* err); #else #define __Pyx_PyErr_ExceptionMatches(err) PyErr_ExceptionMatches(err) #endif /* GetItemInt.proto */ #define __Pyx_GetItemInt(o, i, type, is_signed, to_py_func, is_list, wraparound, boundscheck)\ (__Pyx_fits_Py_ssize_t(i, type, is_signed) ?\ __Pyx_GetItemInt_Fast(o, (Py_ssize_t)i, is_list, wraparound, boundscheck) :\ (is_list ? (PyErr_SetString(PyExc_IndexError, "list index out of range"), (PyObject*)NULL) :\ __Pyx_GetItemInt_Generic(o, to_py_func(i)))) #define __Pyx_GetItemInt_List(o, i, type, is_signed, to_py_func, is_list, wraparound, boundscheck)\ (__Pyx_fits_Py_ssize_t(i, type, is_signed) ?\ __Pyx_GetItemInt_List_Fast(o, (Py_ssize_t)i, wraparound, boundscheck) :\ (PyErr_SetString(PyExc_IndexError, "list index out of range"), (PyObject*)NULL)) static CYTHON_INLINE PyObject *__Pyx_GetItemInt_List_Fast(PyObject *o, Py_ssize_t i, int wraparound, int boundscheck); #define __Pyx_GetItemInt_Tuple(o, i, type, is_signed, to_py_func, is_list, wraparound, boundscheck)\ (__Pyx_fits_Py_ssize_t(i, type, is_signed) ?\ __Pyx_GetItemInt_Tuple_Fast(o, (Py_ssize_t)i, wraparound, boundscheck) :\ (PyErr_SetString(PyExc_IndexError, "tuple index out of range"), (PyObject*)NULL)) static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Tuple_Fast(PyObject *o, Py_ssize_t i, int wraparound, int boundscheck); static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Generic(PyObject *o, PyObject* j); static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Fast(PyObject *o, Py_ssize_t i, int is_list, int wraparound, int boundscheck); /* GetException.proto */ #if CYTHON_FAST_THREAD_STATE #define __Pyx_GetException(type, value, tb) __Pyx__GetException(__pyx_tstate, type, value, tb) static int __Pyx__GetException(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb); #else static int __Pyx_GetException(PyObject **type, PyObject **value, PyObject **tb); #endif /* RaiseTooManyValuesToUnpack.proto */ static CYTHON_INLINE void __Pyx_RaiseTooManyValuesError(Py_ssize_t expected); /* RaiseNeedMoreValuesToUnpack.proto */ static CYTHON_INLINE void __Pyx_RaiseNeedMoreValuesError(Py_ssize_t index); /* IterFinish.proto */ static CYTHON_INLINE int __Pyx_IterFinish(void); /* UnpackItemEndCheck.proto */ static int __Pyx_IternextUnpackEndCheck(PyObject *retval, Py_ssize_t expected); /* SwapException.proto */ #if CYTHON_FAST_THREAD_STATE #define __Pyx_ExceptionSwap(type, value, tb) __Pyx__ExceptionSwap(__pyx_tstate, type, value, tb) static CYTHON_INLINE void __Pyx__ExceptionSwap(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb); #else static CYTHON_INLINE void __Pyx_ExceptionSwap(PyObject **type, PyObject **value, PyObject **tb); #endif /* ArgTypeTest.proto */ static CYTHON_INLINE int __Pyx_ArgTypeTest(PyObject *obj, PyTypeObject *type, int none_allowed, const char *name, int exact); /* ExtTypeTest.proto */ static CYTHON_INLINE int __Pyx_TypeTest(PyObject *obj, PyTypeObject *type); /* PyObjectSetAttrStr.proto */ #if CYTHON_USE_TYPE_SLOTS #define __Pyx_PyObject_DelAttrStr(o,n) __Pyx_PyObject_SetAttrStr(o,n,NULL) static CYTHON_INLINE int __Pyx_PyObject_SetAttrStr(PyObject* obj, PyObject* attr_name, PyObject* value) { PyTypeObject* tp = Py_TYPE(obj); if (likely(tp->tp_setattro)) return tp->tp_setattro(obj, attr_name, value); #if PY_MAJOR_VERSION < 3 if (likely(tp->tp_setattr)) return tp->tp_setattr(obj, PyString_AS_STRING(attr_name), value); #endif return PyObject_SetAttr(obj, attr_name, value); } #else #define __Pyx_PyObject_DelAttrStr(o,n) PyObject_DelAttr(o,n) #define __Pyx_PyObject_SetAttrStr(o,n,v) PyObject_SetAttr(o,n,v) #endif /* ListAppend.proto */ #if CYTHON_USE_PYLIST_INTERNALS && CYTHON_ASSUME_SAFE_MACROS static CYTHON_INLINE int __Pyx_PyList_Append(PyObject* list, PyObject* x) { PyListObject* L = (PyListObject*) list; Py_ssize_t len = Py_SIZE(list); if (likely(L->allocated > len) & likely(len > (L->allocated >> 1))) { Py_INCREF(x); PyList_SET_ITEM(list, len, x); Py_SIZE(list) = len+1; return 0; } return PyList_Append(list, x); } #else #define __Pyx_PyList_Append(L,x) PyList_Append(L,x) #endif /* GetVTable.proto */ static void* __Pyx_GetVtable(PyObject *dict); /* ImportFrom.proto */ static PyObject* __Pyx_ImportFrom(PyObject* module, PyObject* name); /* CalculateMetaclass.proto */ static PyObject *__Pyx_CalculateMetaclass(PyTypeObject *metaclass, PyObject *bases); /* FetchCommonType.proto */ static PyTypeObject* __Pyx_FetchCommonType(PyTypeObject* type); /* CythonFunction.proto */ #define __Pyx_CyFunction_USED 1 #include #define __Pyx_CYFUNCTION_STATICMETHOD 0x01 #define __Pyx_CYFUNCTION_CLASSMETHOD 0x02 #define __Pyx_CYFUNCTION_CCLASS 0x04 #define __Pyx_CyFunction_GetClosure(f)\ (((__pyx_CyFunctionObject *) (f))->func_closure) #define __Pyx_CyFunction_GetClassObj(f)\ (((__pyx_CyFunctionObject *) (f))->func_classobj) #define __Pyx_CyFunction_Defaults(type, f)\ ((type *)(((__pyx_CyFunctionObject *) (f))->defaults)) #define __Pyx_CyFunction_SetDefaultsGetter(f, g)\ ((__pyx_CyFunctionObject *) (f))->defaults_getter = (g) typedef struct { PyCFunctionObject func; #if PY_VERSION_HEX < 0x030500A0 PyObject *func_weakreflist; #endif PyObject *func_dict; PyObject *func_name; PyObject *func_qualname; PyObject *func_doc; PyObject *func_globals; PyObject *func_code; PyObject *func_closure; PyObject *func_classobj; void *defaults; int defaults_pyobjects; int flags; PyObject *defaults_tuple; PyObject *defaults_kwdict; PyObject *(*defaults_getter)(PyObject *); PyObject *func_annotations; } __pyx_CyFunctionObject; static PyTypeObject *__pyx_CyFunctionType = 0; #define __Pyx_CyFunction_NewEx(ml, flags, qualname, self, module, globals, code)\ __Pyx_CyFunction_New(__pyx_CyFunctionType, ml, flags, qualname, self, module, globals, code) static PyObject *__Pyx_CyFunction_New(PyTypeObject *, PyMethodDef *ml, int flags, PyObject* qualname, PyObject *self, PyObject *module, PyObject *globals, PyObject* code); static CYTHON_INLINE void *__Pyx_CyFunction_InitDefaults(PyObject *m, size_t size, int pyobjects); static CYTHON_INLINE void __Pyx_CyFunction_SetDefaultsTuple(PyObject *m, PyObject *tuple); static CYTHON_INLINE void __Pyx_CyFunction_SetDefaultsKwDict(PyObject *m, PyObject *dict); static CYTHON_INLINE void __Pyx_CyFunction_SetAnnotationsDict(PyObject *m, PyObject *dict); static int __pyx_CyFunction_init(void); /* Py3ClassCreate.proto */ static PyObject *__Pyx_Py3MetaclassPrepare(PyObject *metaclass, PyObject *bases, PyObject *name, PyObject *qualname, PyObject *mkw, PyObject *modname, PyObject *doc); static PyObject *__Pyx_Py3ClassCreate(PyObject *metaclass, PyObject *name, PyObject *bases, PyObject *dict, PyObject *mkw, int calculate_metaclass, int allow_py2_metaclass); /* CodeObjectCache.proto */ typedef struct { PyCodeObject* code_object; int code_line; } __Pyx_CodeObjectCacheEntry; struct __Pyx_CodeObjectCache { int count; int max_count; __Pyx_CodeObjectCacheEntry* entries; }; static struct __Pyx_CodeObjectCache __pyx_code_cache = {0,0,NULL}; static int __pyx_bisect_code_objects(__Pyx_CodeObjectCacheEntry* entries, int count, int code_line); static PyCodeObject *__pyx_find_code_object(int code_line); static void __pyx_insert_code_object(int code_line, PyCodeObject* code_object); /* AddTraceback.proto */ static void __Pyx_AddTraceback(const char *funcname, int c_line, int py_line, const char *filename); /* CIntToPy.proto */ static CYTHON_INLINE PyObject* __Pyx_PyInt_From_int(int value); /* CIntToPy.proto */ static CYTHON_INLINE PyObject* __Pyx_PyInt_From_long(long value); /* CIntToPy.proto */ static CYTHON_INLINE PyObject* __Pyx_PyInt_From_SDL_WindowFlags(SDL_WindowFlags value); /* CIntToPy.proto */ static CYTHON_INLINE PyObject* __Pyx_PyInt_From_uint32_t(uint32_t value); /* ForceInitThreads.proto */ #ifndef __PYX_FORCE_INIT_THREADS #define __PYX_FORCE_INIT_THREADS 0 #endif /* CIntToPy.proto */ static CYTHON_INLINE PyObject* __Pyx_PyInt_From_uint8_t(uint8_t value); /* CIntFromPy.proto */ static CYTHON_INLINE uint32_t __Pyx_PyInt_As_uint32_t(PyObject *); /* CIntFromPy.proto */ static CYTHON_INLINE int __Pyx_PyInt_As_int(PyObject *); /* CIntFromPy.proto */ static CYTHON_INLINE long __Pyx_PyInt_As_long(PyObject *); /* CIntFromPy.proto */ static CYTHON_INLINE uint16_t __Pyx_PyInt_As_uint16_t(PyObject *); /* CIntFromPy.proto */ static CYTHON_INLINE SDL_GLattr __Pyx_PyInt_As_SDL_GLattr(PyObject *); /* CheckBinaryVersion.proto */ static int __Pyx_check_binary_version(void); /* VoidPtrExport.proto */ static int __Pyx_ExportVoidPtr(PyObject *name, void *p, const char *sig); /* FunctionExport.proto */ static int __Pyx_ExportFunction(const char *name, void (*f)(void), const char *sig); /* PyIdentifierFromString.proto */ #if !defined(__Pyx_PyIdentifier_FromString) #if PY_MAJOR_VERSION < 3 #define __Pyx_PyIdentifier_FromString(s) PyString_FromString(s) #else #define __Pyx_PyIdentifier_FromString(s) PyUnicode_FromString(s) #endif #endif /* ModuleImport.proto */ static PyObject *__Pyx_ImportModule(const char *name); /* TypeImport.proto */ static PyTypeObject *__Pyx_ImportType(const char *module_name, const char *class_name, size_t size, int strict); /* FunctionImport.proto */ static int __Pyx_ImportFunction(PyObject *module, const char *funcname, void (**f)(void), const char *sig); /* InitStrings.proto */ static int __Pyx_InitStrings(__Pyx_StringTabEntry *t); /* Module declarations from 'libc.stdint' */ /* Module declarations from 'libc.string' */ /* Module declarations from 'libc.stdio' */ /* Module declarations from 'libc.stddef' */ /* Module declarations from 'sdl2' */ /* Module declarations from 'pygame_sdl2.surface' */ static PyTypeObject *__pyx_ptype_11pygame_sdl2_7surface_Surface = 0; /* Module declarations from 'pygame_sdl2.rect' */ static PyTypeObject *__pyx_ptype_11pygame_sdl2_4rect_Rect = 0; static int (*__pyx_f_11pygame_sdl2_4rect_to_sdl_rect)(PyObject *, SDL_Rect *, struct __pyx_opt_args_11pygame_sdl2_4rect_to_sdl_rect *__pyx_optional_args); /*proto*/ /* Module declarations from 'libc.stdlib' */ /* Module declarations from 'pygame_sdl2.display' */ static PyTypeObject *__pyx_ptype_11pygame_sdl2_7display_Window = 0; static struct __pyx_obj_11pygame_sdl2_7display_Window *__pyx_v_11pygame_sdl2_7display_main_window = 0; static SDL_Window *__pyx_f_11pygame_sdl2_7display_PyWindow_AsWindow(PyObject *); /*proto*/ #define __Pyx_MODULE_NAME "pygame_sdl2.display" int __pyx_module_is_main_pygame_sdl2__display = 0; /* Implementation of 'pygame_sdl2.display' */ static PyObject *__pyx_builtin_object; static PyObject *__pyx_builtin_ImportError; static PyObject *__pyx_builtin_MemoryError; static PyObject *__pyx_builtin_range; static const char __pyx_k_0[] = "0"; static const char __pyx_k_i[] = "i"; static const char __pyx_k_t[] = "t"; static const char __pyx_k_dm[] = "dm"; static const char __pyx_k_hw[] = "hw"; static const char __pyx_k_os[] = "os"; static const char __pyx_k_rv[] = "rv"; static const char __pyx_k_wm[] = "wm"; static const char __pyx_k_doc[] = "__doc__"; static const char __pyx_k_ios[] = "ios"; static const char __pyx_k_pos[] = "pos"; static const char __pyx_k_red[] = "red"; static const char __pyx_k_Info[] = "Info"; static const char __pyx_k_blue[] = "blue"; static const char __pyx_k_copy[] = "copy"; static const char __pyx_k_dict[] = "__dict__"; static const char __pyx_k_flag[] = "flag"; static const char __pyx_k_flip[] = "flip"; static const char __pyx_k_hint[] = "hint"; static const char __pyx_k_init[] = "init"; static const char __pyx_k_main[] = "__main__"; static const char __pyx_k_mode[] = "mode"; static const char __pyx_k_path[] = "path"; static const char __pyx_k_quit[] = "quit"; static const char __pyx_k_rect[] = "rect"; static const char __pyx_k_repr[] = "__repr__"; static const char __pyx_k_self[] = "self"; static const char __pyx_k_size[] = "size"; static const char __pyx_k_test[] = "__test__"; static const char __pyx_k_depth[] = "depth"; static const char __pyx_k_error[] = "error"; static const char __pyx_k_event[] = "event"; static const char __pyx_k_flags[] = "flags"; static const char __pyx_k_green[] = "green"; static const char __pyx_k_index[] = "index"; static const char __pyx_k_masks[] = "masks"; static const char __pyx_k_range[] = "range"; static const char __pyx_k_title[] = "title"; static const char __pyx_k_utf_8[] = "utf-8"; static const char __pyx_k_value[] = "value"; static const char __pyx_k_Info_r[] = ""; static const char __pyx_k_driver[] = "driver"; static const char __pyx_k_encode[] = "encode"; static const char __pyx_k_format[] = "format"; static const char __pyx_k_import[] = "__import__"; static const char __pyx_k_init_2[] = "__init__"; static const char __pyx_k_losses[] = "losses"; static const char __pyx_k_module[] = "__module__"; static const char __pyx_k_object[] = "object"; static const char __pyx_k_opengl[] = "opengl"; static const char __pyx_k_resize[] = "resize"; static const char __pyx_k_shifts[] = "shifts"; static const char __pyx_k_update[] = "update"; static const char __pyx_k_bitsize[] = "bitsize"; static const char __pyx_k_blit_hw[] = "blit_hw"; static const char __pyx_k_blit_sw[] = "blit_sw"; static const char __pyx_k_default[] = "default"; static const char __pyx_k_destroy[] = "destroy"; static const char __pyx_k_display[] = "display"; static const char __pyx_k_environ[] = "environ"; static const char __pyx_k_iconify[] = "iconify"; static const char __pyx_k_mode_ok[] = "mode_ok"; static const char __pyx_k_prepare[] = "__prepare__"; static const char __pyx_k_surface[] = "surface"; static const char __pyx_k_SRCALPHA[] = "SRCALPHA"; static const char __pyx_k_bytesize[] = "bytesize"; static const char __pyx_k_get_hint[] = "_get_hint"; static const char __pyx_k_get_init[] = "get_init"; static const char __pyx_k_get_size[] = "get_size"; static const char __pyx_k_pyx_capi[] = "__pyx_capi__"; static const char __pyx_k_qualname[] = "__qualname__"; static const char __pyx_k_set_icon[] = "set_icon"; static const char __pyx_k_set_mode[] = "set_mode"; static const char __pyx_k_warnings[] = "warnings"; static const char __pyx_k_blit_hw_A[] = "blit_hw_A"; static const char __pyx_k_blit_sw_A[] = "blit_sw_A"; static const char __pyx_k_current_h[] = "current_h"; static const char __pyx_k_current_w[] = "current_w"; static const char __pyx_k_icontitle[] = "icontitle"; static const char __pyx_k_init_done[] = "init_done"; static const char __pyx_k_main_done[] = "main_done"; static const char __pyx_k_metaclass[] = "__metaclass__"; static const char __pyx_k_num_modes[] = "num_modes"; static const char __pyx_k_set_gamma[] = "set_gamma"; static const char __pyx_k_video_mem[] = "video_mem"; static const char __pyx_k_PYGAME_IOS[] = "PYGAME_IOS"; static const char __pyx_k_blit_hw_CC[] = "blit_hw_CC"; static const char __pyx_k_blit_sw_CC[] = "blit_sw_CC"; static const char __pyx_k_get_active[] = "get_active"; static const char __pyx_k_get_driver[] = "get_driver"; static const char __pyx_k_get_window[] = "get_window"; static const char __pyx_k_list_modes[] = "list_modes"; static const char __pyx_k_pyx_vtable[] = "__pyx_vtable__"; static const char __pyx_k_rectangles[] = "rectangles"; static const char __pyx_k_resolution[] = "resolution"; static const char __pyx_k_ImportError[] = "ImportError"; static const char __pyx_k_Info___init[] = "Info.__init__"; static const char __pyx_k_Info___repr[] = "Info.__repr__"; static const char __pyx_k_MemoryError[] = "MemoryError"; static const char __pyx_k_PYGAME_SDL2[] = "PYGAME_SDL2"; static const char __pyx_k_get_caption[] = "get_caption"; static const char __pyx_k_get_surface[] = "get_surface"; static const char __pyx_k_get_wm_info[] = "get_wm_info"; static const char __pyx_k_main_window[] = "main_window"; static const char __pyx_k_pygame_sdl2[] = "pygame_sdl2"; static const char __pyx_k_set_caption[] = "set_caption"; static const char __pyx_k_androidembed[] = "androidembed"; static const char __pyx_k_close_window[] = "close_window"; static const char __pyx_k_default_icon[] = "default_icon"; static const char __pyx_k_get_platform[] = "get_platform"; static const char __pyx_k_pygame_hints[] = "_pygame_hints"; static const char __pyx_k_refresh_rate[] = "refresh_rate"; static const char __pyx_k_default_title[] = "default_title"; static const char __pyx_k_pygame_window[] = "pygame window"; static const char __pyx_k_register_init[] = "register_init"; static const char __pyx_k_register_quit[] = "register_quit"; static const char __pyx_k_sdl_main_init[] = "sdl_main_init"; static const char __pyx_k_create_surface[] = "create_surface"; static const char __pyx_k_set_gamma_ramp[] = "set_gamma_ramp"; static const char __pyx_k_GL_SWAP_CONTROL[] = "GL_SWAP_CONTROL"; static const char __pyx_k_gl_load_library[] = "gl_load_library"; static const char __pyx_k_get_window_flags[] = "get_window_flags"; static const char __pyx_k_gl_get_attribute[] = "gl_get_attribute"; static const char __pyx_k_gl_set_attribute[] = "gl_set_attribute"; static const char __pyx_k_get_drawable_size[] = "get_drawable_size"; static const char __pyx_k_gl_unload_library[] = "gl_unload_library"; static const char __pyx_k_pygame_sdl2_error[] = "pygame_sdl2.error"; static const char __pyx_k_toggle_fullscreen[] = "toggle_fullscreen"; static const char __pyx_k_get_display_bounds[] = "get_display_bounds"; static const char __pyx_k_pygame_sdl2_locals[] = "pygame_sdl2.locals"; static const char __pyx_k_shown_first_window[] = "_shown_first_window"; static const char __pyx_k_before_first_window[] = "_before_first_window"; static const char __pyx_k_gl_reset_attributes[] = "gl_reset_attributes"; static const char __pyx_k_pygame_sdl2_display[] = "pygame_sdl2.display"; static const char __pyx_k_PYGAME_SDL2_AVOID_GL[] = "PYGAME_SDL2_AVOID_GL"; static const char __pyx_k_default_swap_control[] = "default_swap_control"; static const char __pyx_k_proxy_window_surface[] = "proxy_window_surface"; static const char __pyx_k_get_num_video_displays[] = "get_num_video_displays"; static const char __pyx_k_Couldn_t_allocate_rectangles[] = "Couldn't allocate rectangles."; static const char __pyx_k_SDL_VIDEO_MAC_FULLSCREEN_SPACES[] = "SDL_VIDEO_MAC_FULLSCREEN_SPACES"; static const char __pyx_k_home_tom_ab_pygame_sdl2_src_pyg[] = "/home/tom/ab/pygame_sdl2/src/pygame_sdl2/display.pyx"; static PyObject *__pyx_kp_u_0; static PyObject *__pyx_kp_u_Couldn_t_allocate_rectangles; static PyObject *__pyx_n_s_GL_SWAP_CONTROL; static PyObject *__pyx_n_s_ImportError; static PyObject *__pyx_n_s_Info; static PyObject *__pyx_n_s_Info___init; static PyObject *__pyx_n_s_Info___repr; static PyObject *__pyx_kp_u_Info_r; static PyObject *__pyx_n_s_MemoryError; static PyObject *__pyx_n_u_PYGAME_IOS; static PyObject *__pyx_n_u_PYGAME_SDL2; static PyObject *__pyx_n_u_PYGAME_SDL2_AVOID_GL; static PyObject *__pyx_n_u_SDL_VIDEO_MAC_FULLSCREEN_SPACES; static PyObject *__pyx_n_s_SRCALPHA; static PyObject *__pyx_n_s_androidembed; static PyObject *__pyx_n_s_before_first_window; static PyObject *__pyx_n_s_bitsize; static PyObject *__pyx_n_s_blit_hw; static PyObject *__pyx_n_s_blit_hw_A; static PyObject *__pyx_n_s_blit_hw_CC; static PyObject *__pyx_n_s_blit_sw; static PyObject *__pyx_n_s_blit_sw_A; static PyObject *__pyx_n_s_blit_sw_CC; static PyObject *__pyx_n_s_blue; static PyObject *__pyx_n_s_bytesize; static PyObject *__pyx_n_s_close_window; static PyObject *__pyx_n_s_copy; static PyObject *__pyx_n_s_create_surface; static PyObject *__pyx_n_s_current_h; static PyObject *__pyx_n_s_current_w; static PyObject *__pyx_n_s_default; static PyObject *__pyx_n_s_default_icon; static PyObject *__pyx_n_s_default_swap_control; static PyObject *__pyx_n_s_default_title; static PyObject *__pyx_n_s_depth; static PyObject *__pyx_n_s_destroy; static PyObject *__pyx_n_s_dict; static PyObject *__pyx_n_s_display; static PyObject *__pyx_n_s_dm; static PyObject *__pyx_n_s_doc; static PyObject *__pyx_n_s_driver; static PyObject *__pyx_n_s_encode; static PyObject *__pyx_n_s_environ; static PyObject *__pyx_n_s_error; static PyObject *__pyx_n_s_event; static PyObject *__pyx_n_s_flag; static PyObject *__pyx_n_s_flags; static PyObject *__pyx_n_s_flip; static PyObject *__pyx_n_s_format; static PyObject *__pyx_n_s_get_active; static PyObject *__pyx_n_s_get_caption; static PyObject *__pyx_n_s_get_display_bounds; static PyObject *__pyx_n_s_get_drawable_size; static PyObject *__pyx_n_s_get_driver; static PyObject *__pyx_n_s_get_hint; static PyObject *__pyx_n_s_get_init; static PyObject *__pyx_n_s_get_num_video_displays; static PyObject *__pyx_n_s_get_platform; static PyObject *__pyx_n_s_get_size; static PyObject *__pyx_n_s_get_surface; static PyObject *__pyx_n_s_get_window; static PyObject *__pyx_n_s_get_window_flags; static PyObject *__pyx_n_s_get_wm_info; static PyObject *__pyx_n_s_gl_get_attribute; static PyObject *__pyx_n_s_gl_load_library; static PyObject *__pyx_n_s_gl_reset_attributes; static PyObject *__pyx_n_s_gl_set_attribute; static PyObject *__pyx_n_s_gl_unload_library; static PyObject *__pyx_n_s_green; static PyObject *__pyx_n_s_hint; static PyObject *__pyx_kp_s_home_tom_ab_pygame_sdl2_src_pyg; static PyObject *__pyx_n_s_hw; static PyObject *__pyx_n_s_i; static PyObject *__pyx_n_s_iconify; static PyObject *__pyx_n_s_icontitle; static PyObject *__pyx_n_s_import; static PyObject *__pyx_n_s_index; static PyObject *__pyx_n_s_init; static PyObject *__pyx_n_s_init_2; static PyObject *__pyx_n_s_init_done; static PyObject *__pyx_n_s_ios; static PyObject *__pyx_n_s_list_modes; static PyObject *__pyx_n_s_losses; static PyObject *__pyx_n_s_main; static PyObject *__pyx_n_s_main_done; static PyObject *__pyx_n_s_main_window; static PyObject *__pyx_n_s_masks; static PyObject *__pyx_n_s_metaclass; static PyObject *__pyx_n_s_mode; static PyObject *__pyx_n_s_mode_ok; static PyObject *__pyx_n_s_module; static PyObject *__pyx_n_s_num_modes; static PyObject *__pyx_n_s_object; static PyObject *__pyx_n_s_opengl; static PyObject *__pyx_n_s_os; static PyObject *__pyx_n_s_path; static PyObject *__pyx_n_s_pos; static PyObject *__pyx_n_s_prepare; static PyObject *__pyx_n_s_proxy_window_surface; static PyObject *__pyx_n_s_pygame_hints; static PyObject *__pyx_n_s_pygame_sdl2; static PyObject *__pyx_n_s_pygame_sdl2_display; static PyObject *__pyx_n_s_pygame_sdl2_error; static PyObject *__pyx_n_s_pygame_sdl2_locals; static PyObject *__pyx_kp_u_pygame_window; static PyObject *__pyx_n_s_pyx_capi; static PyObject *__pyx_n_s_pyx_vtable; static PyObject *__pyx_n_s_qualname; static PyObject *__pyx_n_s_quit; static PyObject *__pyx_n_s_range; static PyObject *__pyx_n_s_rect; static PyObject *__pyx_n_s_rectangles; static PyObject *__pyx_n_s_red; static PyObject *__pyx_n_s_refresh_rate; static PyObject *__pyx_n_s_register_init; static PyObject *__pyx_n_s_register_quit; static PyObject *__pyx_n_s_repr; static PyObject *__pyx_n_s_resize; static PyObject *__pyx_n_s_resolution; static PyObject *__pyx_n_s_rv; static PyObject *__pyx_n_s_sdl_main_init; static PyObject *__pyx_n_s_self; static PyObject *__pyx_n_s_set_caption; static PyObject *__pyx_n_s_set_gamma; static PyObject *__pyx_n_s_set_gamma_ramp; static PyObject *__pyx_n_s_set_icon; static PyObject *__pyx_n_s_set_mode; static PyObject *__pyx_n_s_shifts; static PyObject *__pyx_n_s_shown_first_window; static PyObject *__pyx_n_s_size; static PyObject *__pyx_n_s_surface; static PyObject *__pyx_n_s_t; static PyObject *__pyx_n_s_test; static PyObject *__pyx_n_s_title; static PyObject *__pyx_n_s_toggle_fullscreen; static PyObject *__pyx_n_s_update; static PyObject *__pyx_kp_u_utf_8; static PyObject *__pyx_n_s_value; static PyObject *__pyx_n_s_video_mem; static PyObject *__pyx_n_s_warnings; static PyObject *__pyx_n_s_wm; static PyObject *__pyx_pf_11pygame_sdl2_7display_hint(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_hint, PyObject *__pyx_v_value); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_7display_2_get_hint(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_hint, PyObject *__pyx_v_default); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_7display_4sdl_main_init(CYTHON_UNUSED PyObject *__pyx_self); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_7display_6init(CYTHON_UNUSED PyObject *__pyx_self); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_7display_8quit(CYTHON_UNUSED PyObject *__pyx_self); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_7display_10get_init(CYTHON_UNUSED PyObject *__pyx_self); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_7display_12_before_first_window(CYTHON_UNUSED PyObject *__pyx_self); /* proto */ static int __pyx_pf_11pygame_sdl2_7display_6Window___init__(struct __pyx_obj_11pygame_sdl2_7display_Window *__pyx_v_self, PyObject *__pyx_v_title, PyObject *__pyx_v_resolution, PyObject *__pyx_v_flags, CYTHON_UNUSED PyObject *__pyx_v_depth, PyObject *__pyx_v_pos); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_7display_6Window_2create_surface(struct __pyx_obj_11pygame_sdl2_7display_Window *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_7display_6Window_4destroy(struct __pyx_obj_11pygame_sdl2_7display_Window *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_7display_6Window_6resize(struct __pyx_obj_11pygame_sdl2_7display_Window *__pyx_v_self, PyObject *__pyx_v_size, PyObject *__pyx_v_opengl); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_7display_6Window_8get_window_flags(struct __pyx_obj_11pygame_sdl2_7display_Window *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_7display_6Window_10proxy_window_surface(struct __pyx_obj_11pygame_sdl2_7display_Window *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_7display_6Window_12flip(struct __pyx_obj_11pygame_sdl2_7display_Window *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_7display_6Window_14get_surface(struct __pyx_obj_11pygame_sdl2_7display_Window *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_7display_6Window_16update(struct __pyx_obj_11pygame_sdl2_7display_Window *__pyx_v_self, PyObject *__pyx_v_rectangles); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_7display_6Window_18get_wm_info(CYTHON_UNUSED struct __pyx_obj_11pygame_sdl2_7display_Window *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_7display_6Window_20get_active(struct __pyx_obj_11pygame_sdl2_7display_Window *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_7display_6Window_22iconify(struct __pyx_obj_11pygame_sdl2_7display_Window *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_7display_6Window_24toggle_fullscreen(struct __pyx_obj_11pygame_sdl2_7display_Window *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_7display_6Window_26set_gamma(struct __pyx_obj_11pygame_sdl2_7display_Window *__pyx_v_self, PyObject *__pyx_v_red, PyObject *__pyx_v_green, PyObject *__pyx_v_blue); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_7display_6Window_28set_gamma_ramp(struct __pyx_obj_11pygame_sdl2_7display_Window *__pyx_v_self, PyObject *__pyx_v_red, PyObject *__pyx_v_green, PyObject *__pyx_v_blue); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_7display_6Window_30set_icon(struct __pyx_obj_11pygame_sdl2_7display_Window *__pyx_v_self, struct __pyx_obj_11pygame_sdl2_7surface_Surface *__pyx_v_surface); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_7display_6Window_32set_caption(struct __pyx_obj_11pygame_sdl2_7display_Window *__pyx_v_self, PyObject *__pyx_v_title); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_7display_6Window_34get_drawable_size(struct __pyx_obj_11pygame_sdl2_7display_Window *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_7display_6Window_7surface___get__(struct __pyx_obj_11pygame_sdl2_7display_Window *__pyx_v_self); /* proto */ static int __pyx_pf_11pygame_sdl2_7display_6Window_7surface_2__set__(struct __pyx_obj_11pygame_sdl2_7display_Window *__pyx_v_self, PyObject *__pyx_v_value); /* proto */ static int __pyx_pf_11pygame_sdl2_7display_6Window_7surface_4__del__(struct __pyx_obj_11pygame_sdl2_7display_Window *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_7display_14set_mode(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_resolution, PyObject *__pyx_v_flags, PyObject *__pyx_v_depth, PyObject *__pyx_v_pos); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_7display_16get_surface(CYTHON_UNUSED PyObject *__pyx_self); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_7display_18get_window(CYTHON_UNUSED PyObject *__pyx_self); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_7display_20flip(CYTHON_UNUSED PyObject *__pyx_self); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_7display_22update(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_rectangles); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_7display_24get_driver(CYTHON_UNUSED PyObject *__pyx_self); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_7display_4Info___init__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_7display_4Info_2__repr__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_7display_26get_wm_info(CYTHON_UNUSED PyObject *__pyx_self); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_7display_28get_num_video_displays(CYTHON_UNUSED PyObject *__pyx_self); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_7display_30list_modes(CYTHON_UNUSED PyObject *__pyx_self, CYTHON_UNUSED PyObject *__pyx_v_depth, CYTHON_UNUSED PyObject *__pyx_v_flags, PyObject *__pyx_v_display); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_7display_32mode_ok(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_size, CYTHON_UNUSED PyObject *__pyx_v_flags, CYTHON_UNUSED PyObject *__pyx_v_depth); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_7display_34gl_reset_attributes(CYTHON_UNUSED PyObject *__pyx_self); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_7display_36gl_set_attribute(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_flag, PyObject *__pyx_v_value); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_7display_38gl_get_attribute(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_flag); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_7display_40gl_load_library(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_path); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_7display_42gl_unload_library(CYTHON_UNUSED PyObject *__pyx_self); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_7display_44get_active(CYTHON_UNUSED PyObject *__pyx_self); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_7display_46iconify(CYTHON_UNUSED PyObject *__pyx_self); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_7display_48toggle_fullscreen(CYTHON_UNUSED PyObject *__pyx_self); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_7display_50set_gamma(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_red, PyObject *__pyx_v_green, PyObject *__pyx_v_blue); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_7display_52set_gamma_ramp(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_red, PyObject *__pyx_v_green, PyObject *__pyx_v_blue); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_7display_54set_icon(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_surface); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_7display_56set_caption(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_title, CYTHON_UNUSED PyObject *__pyx_v_icontitle); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_7display_58get_caption(CYTHON_UNUSED PyObject *__pyx_self); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_7display_60get_drawable_size(CYTHON_UNUSED PyObject *__pyx_self); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_7display_62get_num_video_displays(CYTHON_UNUSED PyObject *__pyx_self); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_7display_64get_display_bounds(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_index); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_7display_66get_platform(CYTHON_UNUSED PyObject *__pyx_self); /* proto */ static PyObject *__pyx_tp_new_11pygame_sdl2_7display_Window(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ static PyObject *__pyx_int_0; static PyObject *__pyx_int_1; static PyObject *__pyx_int_32; static PyObject *__pyx_int_268435456; static PyObject *__pyx_k__5; static PyObject *__pyx_k__12; static PyObject *__pyx_tuple_; static PyObject *__pyx_tuple__2; static PyObject *__pyx_tuple__3; static PyObject *__pyx_tuple__4; static PyObject *__pyx_tuple__6; static PyObject *__pyx_tuple__7; static PyObject *__pyx_tuple__8; static PyObject *__pyx_tuple__9; static PyObject *__pyx_tuple__10; static PyObject *__pyx_tuple__11; static PyObject *__pyx_tuple__13; static PyObject *__pyx_tuple__15; static PyObject *__pyx_tuple__21; static PyObject *__pyx_tuple__23; static PyObject *__pyx_tuple__28; static PyObject *__pyx_tuple__30; static PyObject *__pyx_tuple__32; static PyObject *__pyx_tuple__34; static PyObject *__pyx_tuple__37; static PyObject *__pyx_tuple__39; static PyObject *__pyx_tuple__41; static PyObject *__pyx_tuple__44; static PyObject *__pyx_tuple__46; static PyObject *__pyx_tuple__48; static PyObject *__pyx_tuple__54; static PyObject *__pyx_tuple__56; static PyObject *__pyx_tuple__58; static PyObject *__pyx_tuple__60; static PyObject *__pyx_tuple__64; static PyObject *__pyx_tuple__66; static PyObject *__pyx_codeobj__14; static PyObject *__pyx_codeobj__16; static PyObject *__pyx_codeobj__17; static PyObject *__pyx_codeobj__18; static PyObject *__pyx_codeobj__19; static PyObject *__pyx_codeobj__20; static PyObject *__pyx_codeobj__22; static PyObject *__pyx_codeobj__24; static PyObject *__pyx_codeobj__25; static PyObject *__pyx_codeobj__26; static PyObject *__pyx_codeobj__27; static PyObject *__pyx_codeobj__29; static PyObject *__pyx_codeobj__31; static PyObject *__pyx_codeobj__33; static PyObject *__pyx_codeobj__35; static PyObject *__pyx_codeobj__36; static PyObject *__pyx_codeobj__38; static PyObject *__pyx_codeobj__40; static PyObject *__pyx_codeobj__42; static PyObject *__pyx_codeobj__43; static PyObject *__pyx_codeobj__45; static PyObject *__pyx_codeobj__47; static PyObject *__pyx_codeobj__49; static PyObject *__pyx_codeobj__50; static PyObject *__pyx_codeobj__51; static PyObject *__pyx_codeobj__52; static PyObject *__pyx_codeobj__53; static PyObject *__pyx_codeobj__55; static PyObject *__pyx_codeobj__57; static PyObject *__pyx_codeobj__59; static PyObject *__pyx_codeobj__61; static PyObject *__pyx_codeobj__62; static PyObject *__pyx_codeobj__63; static PyObject *__pyx_codeobj__65; static PyObject *__pyx_codeobj__67; static PyObject *__pyx_codeobj__68; /* "pygame_sdl2/display.pyx":40 * _pygame_hints = { } * * def hint(hint, value): # <<<<<<<<<<<<<< * * if str(hint).startswith("PYGAME_SDL2"): */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_7display_1hint(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static PyMethodDef __pyx_mdef_11pygame_sdl2_7display_1hint = {"hint", (PyCFunction)__pyx_pw_11pygame_sdl2_7display_1hint, METH_VARARGS|METH_KEYWORDS, 0}; static PyObject *__pyx_pw_11pygame_sdl2_7display_1hint(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_hint = 0; PyObject *__pyx_v_value = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("hint (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_hint,&__pyx_n_s_value,0}; PyObject* values[2] = {0,0}; if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_hint)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; case 1: if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_value)) != 0)) kw_args--; else { __Pyx_RaiseArgtupleInvalid("hint", 1, 2, 2, 1); __PYX_ERR(0, 40, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "hint") < 0)) __PYX_ERR(0, 40, __pyx_L3_error) } } else if (PyTuple_GET_SIZE(__pyx_args) != 2) { goto __pyx_L5_argtuple_error; } else { values[0] = PyTuple_GET_ITEM(__pyx_args, 0); values[1] = PyTuple_GET_ITEM(__pyx_args, 1); } __pyx_v_hint = values[0]; __pyx_v_value = values[1]; } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("hint", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 40, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("pygame_sdl2.display.hint", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_11pygame_sdl2_7display_hint(__pyx_self, __pyx_v_hint, __pyx_v_value); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_7display_hint(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_hint, PyObject *__pyx_v_value) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; int __pyx_t_3; PyObject *__pyx_t_4 = NULL; PyObject *__pyx_t_5 = NULL; int __pyx_t_6; char const *__pyx_t_7; char const *__pyx_t_8; __Pyx_RefNannySetupContext("hint", 0); __Pyx_INCREF(__pyx_v_hint); __Pyx_INCREF(__pyx_v_value); /* "pygame_sdl2/display.pyx":42 * def hint(hint, value): * * if str(hint).startswith("PYGAME_SDL2"): # <<<<<<<<<<<<<< * _pygame_hints[str(hint)] = str(value) * return */ __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 42, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_INCREF(__pyx_v_hint); __Pyx_GIVEREF(__pyx_v_hint); PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_hint); __pyx_t_2 = __Pyx_PyObject_Call(((PyObject *)(&PyUnicode_Type)), __pyx_t_1, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 42, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_3 = __Pyx_PyUnicode_Tailmatch(__pyx_t_2, __pyx_n_u_PYGAME_SDL2, 0, PY_SSIZE_T_MAX, -1); if (unlikely(__pyx_t_3 == -1)) __PYX_ERR(0, 42, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; if ((__pyx_t_3 != 0)) { /* "pygame_sdl2/display.pyx":43 * * if str(hint).startswith("PYGAME_SDL2"): * _pygame_hints[str(hint)] = str(value) # <<<<<<<<<<<<<< * return * */ __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 43, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_INCREF(__pyx_v_value); __Pyx_GIVEREF(__pyx_v_value); PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_value); __pyx_t_1 = __Pyx_PyObject_Call(((PyObject *)(&PyUnicode_Type)), __pyx_t_2, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 43, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_pygame_hints); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 43, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 43, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_INCREF(__pyx_v_hint); __Pyx_GIVEREF(__pyx_v_hint); PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_v_hint); __pyx_t_5 = __Pyx_PyObject_Call(((PyObject *)(&PyUnicode_Type)), __pyx_t_4, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 43, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; if (unlikely(PyObject_SetItem(__pyx_t_2, __pyx_t_5, __pyx_t_1) < 0)) __PYX_ERR(0, 43, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "pygame_sdl2/display.pyx":44 * if str(hint).startswith("PYGAME_SDL2"): * _pygame_hints[str(hint)] = str(value) * return # <<<<<<<<<<<<<< * * */ __Pyx_XDECREF(__pyx_r); __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; /* "pygame_sdl2/display.pyx":42 * def hint(hint, value): * * if str(hint).startswith("PYGAME_SDL2"): # <<<<<<<<<<<<<< * _pygame_hints[str(hint)] = str(value) * return */ } /* "pygame_sdl2/display.pyx":47 * * * if not isinstance(hint, bytes): # <<<<<<<<<<<<<< * hint = hint.encode("utf-8") * */ __pyx_t_3 = PyBytes_Check(__pyx_v_hint); __pyx_t_6 = ((!(__pyx_t_3 != 0)) != 0); if (__pyx_t_6) { /* "pygame_sdl2/display.pyx":48 * * if not isinstance(hint, bytes): * hint = hint.encode("utf-8") # <<<<<<<<<<<<<< * * if not isinstance(value, bytes): */ __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_hint, __pyx_n_s_encode); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 48, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_tuple_, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 48, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF_SET(__pyx_v_hint, __pyx_t_5); __pyx_t_5 = 0; /* "pygame_sdl2/display.pyx":47 * * * if not isinstance(hint, bytes): # <<<<<<<<<<<<<< * hint = hint.encode("utf-8") * */ } /* "pygame_sdl2/display.pyx":50 * hint = hint.encode("utf-8") * * if not isinstance(value, bytes): # <<<<<<<<<<<<<< * value = value.encode("utf-8") * */ __pyx_t_6 = PyBytes_Check(__pyx_v_value); __pyx_t_3 = ((!(__pyx_t_6 != 0)) != 0); if (__pyx_t_3) { /* "pygame_sdl2/display.pyx":51 * * if not isinstance(value, bytes): * value = value.encode("utf-8") # <<<<<<<<<<<<<< * * SDL_SetHint(hint, value) */ __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_value, __pyx_n_s_encode); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 51, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_tuple__2, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 51, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF_SET(__pyx_v_value, __pyx_t_1); __pyx_t_1 = 0; /* "pygame_sdl2/display.pyx":50 * hint = hint.encode("utf-8") * * if not isinstance(value, bytes): # <<<<<<<<<<<<<< * value = value.encode("utf-8") * */ } /* "pygame_sdl2/display.pyx":53 * value = value.encode("utf-8") * * SDL_SetHint(hint, value) # <<<<<<<<<<<<<< * * def _get_hint(hint, default): */ __pyx_t_7 = __Pyx_PyObject_AsString(__pyx_v_hint); if (unlikely((!__pyx_t_7) && PyErr_Occurred())) __PYX_ERR(0, 53, __pyx_L1_error) __pyx_t_8 = __Pyx_PyObject_AsString(__pyx_v_value); if (unlikely((!__pyx_t_8) && PyErr_Occurred())) __PYX_ERR(0, 53, __pyx_L1_error) SDL_SetHint(__pyx_t_7, __pyx_t_8); /* "pygame_sdl2/display.pyx":40 * _pygame_hints = { } * * def hint(hint, value): # <<<<<<<<<<<<<< * * if str(hint).startswith("PYGAME_SDL2"): */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_5); __Pyx_AddTraceback("pygame_sdl2.display.hint", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF(__pyx_v_hint); __Pyx_XDECREF(__pyx_v_value); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/display.pyx":55 * SDL_SetHint(hint, value) * * def _get_hint(hint, default): # <<<<<<<<<<<<<< * hint = str(hint) * */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_7display_3_get_hint(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static PyMethodDef __pyx_mdef_11pygame_sdl2_7display_3_get_hint = {"_get_hint", (PyCFunction)__pyx_pw_11pygame_sdl2_7display_3_get_hint, METH_VARARGS|METH_KEYWORDS, 0}; static PyObject *__pyx_pw_11pygame_sdl2_7display_3_get_hint(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_hint = 0; PyObject *__pyx_v_default = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("_get_hint (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_hint,&__pyx_n_s_default,0}; PyObject* values[2] = {0,0}; if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_hint)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; case 1: if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_default)) != 0)) kw_args--; else { __Pyx_RaiseArgtupleInvalid("_get_hint", 1, 2, 2, 1); __PYX_ERR(0, 55, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "_get_hint") < 0)) __PYX_ERR(0, 55, __pyx_L3_error) } } else if (PyTuple_GET_SIZE(__pyx_args) != 2) { goto __pyx_L5_argtuple_error; } else { values[0] = PyTuple_GET_ITEM(__pyx_args, 0); values[1] = PyTuple_GET_ITEM(__pyx_args, 1); } __pyx_v_hint = values[0]; __pyx_v_default = values[1]; } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("_get_hint", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 55, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("pygame_sdl2.display._get_hint", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_11pygame_sdl2_7display_2_get_hint(__pyx_self, __pyx_v_hint, __pyx_v_default); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_7display_2_get_hint(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_hint, PyObject *__pyx_v_default) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; int __pyx_t_3; int __pyx_t_4; __Pyx_RefNannySetupContext("_get_hint", 0); __Pyx_INCREF(__pyx_v_hint); /* "pygame_sdl2/display.pyx":56 * * def _get_hint(hint, default): * hint = str(hint) # <<<<<<<<<<<<<< * * if hint in _pygame_hints: */ __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 56, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_INCREF(__pyx_v_hint); __Pyx_GIVEREF(__pyx_v_hint); PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_hint); __pyx_t_2 = __Pyx_PyObject_Call(((PyObject *)(&PyUnicode_Type)), __pyx_t_1, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 56, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF_SET(__pyx_v_hint, __pyx_t_2); __pyx_t_2 = 0; /* "pygame_sdl2/display.pyx":58 * hint = str(hint) * * if hint in _pygame_hints: # <<<<<<<<<<<<<< * return _pygame_hints[hint] * */ __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_pygame_hints); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 58, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = (__Pyx_PySequence_ContainsTF(__pyx_v_hint, __pyx_t_2, Py_EQ)); if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(0, 58, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_4 = (__pyx_t_3 != 0); if (__pyx_t_4) { /* "pygame_sdl2/display.pyx":59 * * if hint in _pygame_hints: * return _pygame_hints[hint] # <<<<<<<<<<<<<< * * if hint in os.environ: */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_pygame_hints); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 59, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_1 = PyObject_GetItem(__pyx_t_2, __pyx_v_hint); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 59, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "pygame_sdl2/display.pyx":58 * hint = str(hint) * * if hint in _pygame_hints: # <<<<<<<<<<<<<< * return _pygame_hints[hint] * */ } /* "pygame_sdl2/display.pyx":61 * return _pygame_hints[hint] * * if hint in os.environ: # <<<<<<<<<<<<<< * return os.environ[hint] * */ __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_os); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 61, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_environ); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 61, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_4 = (__Pyx_PySequence_ContainsTF(__pyx_v_hint, __pyx_t_2, Py_EQ)); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(0, 61, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_3 = (__pyx_t_4 != 0); if (__pyx_t_3) { /* "pygame_sdl2/display.pyx":62 * * if hint in os.environ: * return os.environ[hint] # <<<<<<<<<<<<<< * * return default */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_os); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 62, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_environ); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 62, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_2 = PyObject_GetItem(__pyx_t_1, __pyx_v_hint); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 62, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; /* "pygame_sdl2/display.pyx":61 * return _pygame_hints[hint] * * if hint in os.environ: # <<<<<<<<<<<<<< * return os.environ[hint] * */ } /* "pygame_sdl2/display.pyx":64 * return os.environ[hint] * * return default # <<<<<<<<<<<<<< * * */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(__pyx_v_default); __pyx_r = __pyx_v_default; goto __pyx_L0; /* "pygame_sdl2/display.pyx":55 * SDL_SetHint(hint, value) * * def _get_hint(hint, default): # <<<<<<<<<<<<<< * hint = str(hint) * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_AddTraceback("pygame_sdl2.display._get_hint", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF(__pyx_v_hint); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/display.pyx":69 * main_done = False * * def sdl_main_init(): # <<<<<<<<<<<<<< * global main_done * */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_7display_5sdl_main_init(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused); /*proto*/ static PyMethodDef __pyx_mdef_11pygame_sdl2_7display_5sdl_main_init = {"sdl_main_init", (PyCFunction)__pyx_pw_11pygame_sdl2_7display_5sdl_main_init, METH_NOARGS, 0}; static PyObject *__pyx_pw_11pygame_sdl2_7display_5sdl_main_init(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("sdl_main_init (wrapper)", 0); __pyx_r = __pyx_pf_11pygame_sdl2_7display_4sdl_main_init(__pyx_self); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_7display_4sdl_main_init(CYTHON_UNUSED PyObject *__pyx_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_t_2; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; __Pyx_RefNannySetupContext("sdl_main_init", 0); /* "pygame_sdl2/display.pyx":72 * global main_done * * if main_done: # <<<<<<<<<<<<<< * return * */ __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_main_done); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 72, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 72, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (__pyx_t_2) { /* "pygame_sdl2/display.pyx":73 * * if main_done: * return # <<<<<<<<<<<<<< * * SDL_SetMainReady() */ __Pyx_XDECREF(__pyx_r); __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; /* "pygame_sdl2/display.pyx":72 * global main_done * * if main_done: # <<<<<<<<<<<<<< * return * */ } /* "pygame_sdl2/display.pyx":75 * return * * SDL_SetMainReady() # <<<<<<<<<<<<<< * * if SDL_Init(0): */ SDL_SetMainReady(); /* "pygame_sdl2/display.pyx":77 * SDL_SetMainReady() * * if SDL_Init(0): # <<<<<<<<<<<<<< * raise error() * */ __pyx_t_2 = (SDL_Init(0) != 0); if (__pyx_t_2) { /* "pygame_sdl2/display.pyx":78 * * if SDL_Init(0): * raise error() # <<<<<<<<<<<<<< * * main_done = True */ __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_error); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 78, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = NULL; if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) { __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3); if (likely(__pyx_t_4)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); __Pyx_INCREF(__pyx_t_4); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_3, function); } } if (__pyx_t_4) { __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 78, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; } else { __pyx_t_1 = __Pyx_PyObject_CallNoArg(__pyx_t_3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 78, __pyx_L1_error) } __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_Raise(__pyx_t_1, 0, 0, 0); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __PYX_ERR(0, 78, __pyx_L1_error) /* "pygame_sdl2/display.pyx":77 * SDL_SetMainReady() * * if SDL_Init(0): # <<<<<<<<<<<<<< * raise error() * */ } /* "pygame_sdl2/display.pyx":80 * raise error() * * main_done = True # <<<<<<<<<<<<<< * * # True if init has been called without quit being called. */ if (PyDict_SetItem(__pyx_d, __pyx_n_s_main_done, Py_True) < 0) __PYX_ERR(0, 80, __pyx_L1_error) /* "pygame_sdl2/display.pyx":69 * main_done = False * * def sdl_main_init(): # <<<<<<<<<<<<<< * global main_done * */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_AddTraceback("pygame_sdl2.display.sdl_main_init", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/display.pyx":86 * * @pygame_sdl2.register_init * def init(): # <<<<<<<<<<<<<< * * if init_done: */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_7display_7init(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused); /*proto*/ static PyMethodDef __pyx_mdef_11pygame_sdl2_7display_7init = {"init", (PyCFunction)__pyx_pw_11pygame_sdl2_7display_7init, METH_NOARGS, 0}; static PyObject *__pyx_pw_11pygame_sdl2_7display_7init(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("init (wrapper)", 0); __pyx_r = __pyx_pf_11pygame_sdl2_7display_6init(__pyx_self); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_7display_6init(CYTHON_UNUSED PyObject *__pyx_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_t_2; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; __Pyx_RefNannySetupContext("init", 0); /* "pygame_sdl2/display.pyx":88 * def init(): * * if init_done: # <<<<<<<<<<<<<< * return * */ __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_init_done); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 88, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 88, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (__pyx_t_2) { /* "pygame_sdl2/display.pyx":89 * * if init_done: * return # <<<<<<<<<<<<<< * * sdl_main_init() */ __Pyx_XDECREF(__pyx_r); __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; /* "pygame_sdl2/display.pyx":88 * def init(): * * if init_done: # <<<<<<<<<<<<<< * return * */ } /* "pygame_sdl2/display.pyx":91 * return * * sdl_main_init() # <<<<<<<<<<<<<< * * hint("SDL_VIDEO_MAC_FULLSCREEN_SPACES", "0") */ __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_sdl_main_init); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 91, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = NULL; if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) { __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3); if (likely(__pyx_t_4)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); __Pyx_INCREF(__pyx_t_4); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_3, function); } } if (__pyx_t_4) { __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 91, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; } else { __pyx_t_1 = __Pyx_PyObject_CallNoArg(__pyx_t_3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 91, __pyx_L1_error) } __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "pygame_sdl2/display.pyx":93 * sdl_main_init() * * hint("SDL_VIDEO_MAC_FULLSCREEN_SPACES", "0") # <<<<<<<<<<<<<< * * if SDL_InitSubSystem(SDL_INIT_VIDEO): */ __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_hint); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 93, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_tuple__3, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 93, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "pygame_sdl2/display.pyx":95 * hint("SDL_VIDEO_MAC_FULLSCREEN_SPACES", "0") * * if SDL_InitSubSystem(SDL_INIT_VIDEO): # <<<<<<<<<<<<<< * raise error() * */ __pyx_t_2 = (SDL_InitSubSystem(SDL_INIT_VIDEO) != 0); if (__pyx_t_2) { /* "pygame_sdl2/display.pyx":96 * * if SDL_InitSubSystem(SDL_INIT_VIDEO): * raise error() # <<<<<<<<<<<<<< * * pygame_sdl2.event.init() */ __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_error); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 96, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_4 = NULL; if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_1))) { __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_1); if (likely(__pyx_t_4)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1); __Pyx_INCREF(__pyx_t_4); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_1, function); } } if (__pyx_t_4) { __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_t_1, __pyx_t_4); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 96, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; } else { __pyx_t_3 = __Pyx_PyObject_CallNoArg(__pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 96, __pyx_L1_error) } __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_Raise(__pyx_t_3, 0, 0, 0); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __PYX_ERR(0, 96, __pyx_L1_error) /* "pygame_sdl2/display.pyx":95 * hint("SDL_VIDEO_MAC_FULLSCREEN_SPACES", "0") * * if SDL_InitSubSystem(SDL_INIT_VIDEO): # <<<<<<<<<<<<<< * raise error() * */ } /* "pygame_sdl2/display.pyx":98 * raise error() * * pygame_sdl2.event.init() # <<<<<<<<<<<<<< * * global init_done */ __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_pygame_sdl2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 98, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_event); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 98, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_init); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 98, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_t_4 = NULL; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_1))) { __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_1); if (likely(__pyx_t_4)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1); __Pyx_INCREF(__pyx_t_4); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_1, function); } } if (__pyx_t_4) { __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_t_1, __pyx_t_4); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 98, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; } else { __pyx_t_3 = __Pyx_PyObject_CallNoArg(__pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 98, __pyx_L1_error) } __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "pygame_sdl2/display.pyx":101 * * global init_done * init_done = True # <<<<<<<<<<<<<< * * */ if (PyDict_SetItem(__pyx_d, __pyx_n_s_init_done, Py_True) < 0) __PYX_ERR(0, 101, __pyx_L1_error) /* "pygame_sdl2/display.pyx":86 * * @pygame_sdl2.register_init * def init(): # <<<<<<<<<<<<<< * * if init_done: */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_AddTraceback("pygame_sdl2.display.init", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/display.pyx":106 * * @pygame_sdl2.register_quit * def quit(): # @ReservedAssignment # <<<<<<<<<<<<<< * * global init_done */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_7display_9quit(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused); /*proto*/ static PyMethodDef __pyx_mdef_11pygame_sdl2_7display_9quit = {"quit", (PyCFunction)__pyx_pw_11pygame_sdl2_7display_9quit, METH_NOARGS, 0}; static PyObject *__pyx_pw_11pygame_sdl2_7display_9quit(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("quit (wrapper)", 0); __pyx_r = __pyx_pf_11pygame_sdl2_7display_8quit(__pyx_self); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_7display_8quit(CYTHON_UNUSED PyObject *__pyx_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; __Pyx_RefNannySetupContext("quit", 0); /* "pygame_sdl2/display.pyx":111 * global main_window * * if main_window: # <<<<<<<<<<<<<< * main_window.destroy() * main_window = None */ __pyx_t_1 = __Pyx_PyObject_IsTrue(((PyObject *)__pyx_v_11pygame_sdl2_7display_main_window)); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(0, 111, __pyx_L1_error) if (__pyx_t_1) { /* "pygame_sdl2/display.pyx":112 * * if main_window: * main_window.destroy() # <<<<<<<<<<<<<< * main_window = None * */ __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_11pygame_sdl2_7display_main_window), __pyx_n_s_destroy); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 112, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = NULL; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) { __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3); if (likely(__pyx_t_4)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); __Pyx_INCREF(__pyx_t_4); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_3, function); } } if (__pyx_t_4) { __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 112, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; } else { __pyx_t_2 = __Pyx_PyObject_CallNoArg(__pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 112, __pyx_L1_error) } __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "pygame_sdl2/display.pyx":113 * if main_window: * main_window.destroy() * main_window = None # <<<<<<<<<<<<<< * * init_done = False */ __Pyx_INCREF(Py_None); __Pyx_XGOTREF(((PyObject *)__pyx_v_11pygame_sdl2_7display_main_window)); __Pyx_DECREF_SET(__pyx_v_11pygame_sdl2_7display_main_window, ((struct __pyx_obj_11pygame_sdl2_7display_Window *)Py_None)); __Pyx_GIVEREF(Py_None); /* "pygame_sdl2/display.pyx":111 * global main_window * * if main_window: # <<<<<<<<<<<<<< * main_window.destroy() * main_window = None */ } /* "pygame_sdl2/display.pyx":115 * main_window = None * * init_done = False # <<<<<<<<<<<<<< * * def get_init(): */ if (PyDict_SetItem(__pyx_d, __pyx_n_s_init_done, Py_False) < 0) __PYX_ERR(0, 115, __pyx_L1_error) /* "pygame_sdl2/display.pyx":106 * * @pygame_sdl2.register_quit * def quit(): # @ReservedAssignment # <<<<<<<<<<<<<< * * global init_done */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_AddTraceback("pygame_sdl2.display.quit", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/display.pyx":117 * init_done = False * * def get_init(): # <<<<<<<<<<<<<< * return init_done * */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_7display_11get_init(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused); /*proto*/ static PyMethodDef __pyx_mdef_11pygame_sdl2_7display_11get_init = {"get_init", (PyCFunction)__pyx_pw_11pygame_sdl2_7display_11get_init, METH_NOARGS, 0}; static PyObject *__pyx_pw_11pygame_sdl2_7display_11get_init(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("get_init (wrapper)", 0); __pyx_r = __pyx_pf_11pygame_sdl2_7display_10get_init(__pyx_self); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_7display_10get_init(CYTHON_UNUSED PyObject *__pyx_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; __Pyx_RefNannySetupContext("get_init", 0); /* "pygame_sdl2/display.pyx":118 * * def get_init(): * return init_done # <<<<<<<<<<<<<< * * */ __Pyx_XDECREF(__pyx_r); __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_init_done); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 118, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "pygame_sdl2/display.pyx":117 * init_done = False * * def get_init(): # <<<<<<<<<<<<<< * return init_done * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("pygame_sdl2.display.get_init", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/display.pyx":127 * _shown_first_window = False * * def _before_first_window(): # <<<<<<<<<<<<<< * global _shown_first_window * */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_7display_13_before_first_window(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused); /*proto*/ static PyMethodDef __pyx_mdef_11pygame_sdl2_7display_13_before_first_window = {"_before_first_window", (PyCFunction)__pyx_pw_11pygame_sdl2_7display_13_before_first_window, METH_NOARGS, 0}; static PyObject *__pyx_pw_11pygame_sdl2_7display_13_before_first_window(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("_before_first_window (wrapper)", 0); __pyx_r = __pyx_pf_11pygame_sdl2_7display_12_before_first_window(__pyx_self); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_7display_12_before_first_window(CYTHON_UNUSED PyObject *__pyx_self) { PyObject *__pyx_v_androidembed = NULL; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_t_2; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; PyObject *__pyx_t_5 = NULL; PyObject *__pyx_t_6 = NULL; PyObject *__pyx_t_7 = NULL; int __pyx_t_8; __Pyx_RefNannySetupContext("_before_first_window", 0); /* "pygame_sdl2/display.pyx":130 * global _shown_first_window * * if _shown_first_window: # <<<<<<<<<<<<<< * return * */ __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_shown_first_window); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 130, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 130, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (__pyx_t_2) { /* "pygame_sdl2/display.pyx":131 * * if _shown_first_window: * return # <<<<<<<<<<<<<< * * _shown_first_window = True */ __Pyx_XDECREF(__pyx_r); __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; /* "pygame_sdl2/display.pyx":130 * global _shown_first_window * * if _shown_first_window: # <<<<<<<<<<<<<< * return * */ } /* "pygame_sdl2/display.pyx":133 * return * * _shown_first_window = True # <<<<<<<<<<<<<< * * # If we're on android, we have to close the splash window before opening */ if (PyDict_SetItem(__pyx_d, __pyx_n_s_shown_first_window, Py_True) < 0) __PYX_ERR(0, 133, __pyx_L1_error) /* "pygame_sdl2/display.pyx":137 * # If we're on android, we have to close the splash window before opening * # our window. * try: # <<<<<<<<<<<<<< * import androidembed * androidembed.close_window() */ { __Pyx_PyThreadState_declare __Pyx_PyThreadState_assign __Pyx_ExceptionSave(&__pyx_t_3, &__pyx_t_4, &__pyx_t_5); __Pyx_XGOTREF(__pyx_t_3); __Pyx_XGOTREF(__pyx_t_4); __Pyx_XGOTREF(__pyx_t_5); /*try:*/ { /* "pygame_sdl2/display.pyx":138 * # our window. * try: * import androidembed # <<<<<<<<<<<<<< * androidembed.close_window() * except ImportError: */ __pyx_t_1 = __Pyx_Import(__pyx_n_s_androidembed, 0, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 138, __pyx_L4_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_androidembed = __pyx_t_1; __pyx_t_1 = 0; /* "pygame_sdl2/display.pyx":139 * try: * import androidembed * androidembed.close_window() # <<<<<<<<<<<<<< * except ImportError: * pass */ __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_androidembed, __pyx_n_s_close_window); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 139, __pyx_L4_error) __Pyx_GOTREF(__pyx_t_6); __pyx_t_7 = NULL; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_6))) { __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_6); if (likely(__pyx_t_7)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6); __Pyx_INCREF(__pyx_t_7); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_6, function); } } if (__pyx_t_7) { __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_6, __pyx_t_7); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 139, __pyx_L4_error) __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; } else { __pyx_t_1 = __Pyx_PyObject_CallNoArg(__pyx_t_6); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 139, __pyx_L4_error) } __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "pygame_sdl2/display.pyx":137 * # If we're on android, we have to close the splash window before opening * # our window. * try: # <<<<<<<<<<<<<< * import androidembed * androidembed.close_window() */ } __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; goto __pyx_L11_try_end; __pyx_L4_error:; __Pyx_PyThreadState_assign __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; /* "pygame_sdl2/display.pyx":140 * import androidembed * androidembed.close_window() * except ImportError: # <<<<<<<<<<<<<< * pass * */ __pyx_t_8 = __Pyx_PyErr_ExceptionMatches(__pyx_builtin_ImportError); if (__pyx_t_8) { __Pyx_ErrRestore(0,0,0); goto __pyx_L5_exception_handled; } goto __pyx_L6_except_error; __pyx_L6_except_error:; /* "pygame_sdl2/display.pyx":137 * # If we're on android, we have to close the splash window before opening * # our window. * try: # <<<<<<<<<<<<<< * import androidembed * androidembed.close_window() */ __Pyx_PyThreadState_assign __Pyx_XGIVEREF(__pyx_t_3); __Pyx_XGIVEREF(__pyx_t_4); __Pyx_XGIVEREF(__pyx_t_5); __Pyx_ExceptionReset(__pyx_t_3, __pyx_t_4, __pyx_t_5); goto __pyx_L1_error; __pyx_L5_exception_handled:; __Pyx_PyThreadState_assign __Pyx_XGIVEREF(__pyx_t_3); __Pyx_XGIVEREF(__pyx_t_4); __Pyx_XGIVEREF(__pyx_t_5); __Pyx_ExceptionReset(__pyx_t_3, __pyx_t_4, __pyx_t_5); __pyx_L11_try_end:; } /* "pygame_sdl2/display.pyx":127 * _shown_first_window = False * * def _before_first_window(): # <<<<<<<<<<<<<< * global _shown_first_window * */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_6); __Pyx_XDECREF(__pyx_t_7); __Pyx_AddTraceback("pygame_sdl2.display._before_first_window", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF(__pyx_v_androidembed); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/display.pyx":146 * * cdef class Window: * def __init__(self, title, resolution=(0, 0), flags=0, depth=0, pos=(SDL_WINDOWPOS_UNDEFINED, SDL_WINDOWPOS_UNDEFINED)): # <<<<<<<<<<<<<< * * if not isinstance(title, bytes): */ /* Python wrapper */ static int __pyx_pw_11pygame_sdl2_7display_6Window_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static int __pyx_pw_11pygame_sdl2_7display_6Window_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_title = 0; PyObject *__pyx_v_resolution = 0; PyObject *__pyx_v_flags = 0; CYTHON_UNUSED PyObject *__pyx_v_depth = 0; PyObject *__pyx_v_pos = 0; int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__init__ (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_title,&__pyx_n_s_resolution,&__pyx_n_s_flags,&__pyx_n_s_depth,&__pyx_n_s_pos,0}; PyObject* values[5] = {0,0,0,0,0}; values[1] = ((PyObject *)__pyx_tuple__4); values[2] = ((PyObject *)__pyx_int_0); values[3] = ((PyObject *)__pyx_int_0); values[4] = __pyx_k__5; if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4); case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_title)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; case 1: if (kw_args > 0) { PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_resolution); if (value) { values[1] = value; kw_args--; } } case 2: if (kw_args > 0) { PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_flags); if (value) { values[2] = value; kw_args--; } } case 3: if (kw_args > 0) { PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_depth); if (value) { values[3] = value; kw_args--; } } case 4: if (kw_args > 0) { PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_pos); if (value) { values[4] = value; kw_args--; } } } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__init__") < 0)) __PYX_ERR(0, 146, __pyx_L3_error) } } else { switch (PyTuple_GET_SIZE(__pyx_args)) { case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4); case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_title = values[0]; __pyx_v_resolution = values[1]; __pyx_v_flags = values[2]; __pyx_v_depth = values[3]; __pyx_v_pos = values[4]; } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("__init__", 0, 1, 5, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 146, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("pygame_sdl2.display.Window.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return -1; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_11pygame_sdl2_7display_6Window___init__(((struct __pyx_obj_11pygame_sdl2_7display_Window *)__pyx_v_self), __pyx_v_title, __pyx_v_resolution, __pyx_v_flags, __pyx_v_depth, __pyx_v_pos); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static int __pyx_pf_11pygame_sdl2_7display_6Window___init__(struct __pyx_obj_11pygame_sdl2_7display_Window *__pyx_v_self, PyObject *__pyx_v_title, PyObject *__pyx_v_resolution, PyObject *__pyx_v_flags, CYTHON_UNUSED PyObject *__pyx_v_depth, PyObject *__pyx_v_pos) { long __pyx_v_gl_flag; int __pyx_r; __Pyx_RefNannyDeclarations int __pyx_t_1; int __pyx_t_2; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; PyObject *__pyx_t_5 = NULL; Uint32 __pyx_t_6; char const *__pyx_t_7; int __pyx_t_8; int __pyx_t_9; int __pyx_t_10; int __pyx_t_11; PyObject *__pyx_t_12 = NULL; PyObject *__pyx_t_13 = NULL; PyObject *__pyx_t_14 = NULL; PyObject *__pyx_t_15 = NULL; PyObject *__pyx_t_16 = NULL; PyObject *__pyx_t_17 = NULL; __Pyx_RefNannySetupContext("__init__", 0); __Pyx_INCREF(__pyx_v_title); /* "pygame_sdl2/display.pyx":148 * def __init__(self, title, resolution=(0, 0), flags=0, depth=0, pos=(SDL_WINDOWPOS_UNDEFINED, SDL_WINDOWPOS_UNDEFINED)): * * if not isinstance(title, bytes): # <<<<<<<<<<<<<< * title = title.encode("utf-8") * */ __pyx_t_1 = PyBytes_Check(__pyx_v_title); __pyx_t_2 = ((!(__pyx_t_1 != 0)) != 0); if (__pyx_t_2) { /* "pygame_sdl2/display.pyx":149 * * if not isinstance(title, bytes): * title = title.encode("utf-8") # <<<<<<<<<<<<<< * * _before_first_window() */ __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_title, __pyx_n_s_encode); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 149, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_tuple__6, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 149, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF_SET(__pyx_v_title, __pyx_t_4); __pyx_t_4 = 0; /* "pygame_sdl2/display.pyx":148 * def __init__(self, title, resolution=(0, 0), flags=0, depth=0, pos=(SDL_WINDOWPOS_UNDEFINED, SDL_WINDOWPOS_UNDEFINED)): * * if not isinstance(title, bytes): # <<<<<<<<<<<<<< * title = title.encode("utf-8") * */ } /* "pygame_sdl2/display.pyx":151 * title = title.encode("utf-8") * * _before_first_window() # <<<<<<<<<<<<<< * * self.create_flags = flags */ __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_before_first_window); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 151, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_5 = NULL; if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) { __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_3); if (likely(__pyx_t_5)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); __Pyx_INCREF(__pyx_t_5); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_3, function); } } if (__pyx_t_5) { __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_5); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 151, __pyx_L1_error) __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; } else { __pyx_t_4 = __Pyx_PyObject_CallNoArg(__pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 151, __pyx_L1_error) } __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; /* "pygame_sdl2/display.pyx":153 * _before_first_window() * * self.create_flags = flags # <<<<<<<<<<<<<< * * # If we do not get the AVOID_GL hint, we always create a GL-compatible */ __pyx_t_6 = __Pyx_PyInt_As_uint32_t(__pyx_v_flags); if (unlikely((__pyx_t_6 == ((Uint32)-1)) && PyErr_Occurred())) __PYX_ERR(0, 153, __pyx_L1_error) __pyx_v_self->create_flags = __pyx_t_6; /* "pygame_sdl2/display.pyx":157 * # If we do not get the AVOID_GL hint, we always create a GL-compatible * # window. This lets us change the OPENGL flag later on. * if int(_get_hint("PYGAME_SDL2_AVOID_GL", "0")): # <<<<<<<<<<<<<< * gl_flag = 0 * else: */ __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_get_hint); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 157, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_tuple__7, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 157, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_t_4 = __Pyx_PyNumber_Int(__pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 157, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 157, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; if (__pyx_t_2) { /* "pygame_sdl2/display.pyx":158 * # window. This lets us change the OPENGL flag later on. * if int(_get_hint("PYGAME_SDL2_AVOID_GL", "0")): * gl_flag = 0 # <<<<<<<<<<<<<< * else: * gl_flag = SDL_WINDOW_OPENGL */ __pyx_v_gl_flag = 0; /* "pygame_sdl2/display.pyx":157 * # If we do not get the AVOID_GL hint, we always create a GL-compatible * # window. This lets us change the OPENGL flag later on. * if int(_get_hint("PYGAME_SDL2_AVOID_GL", "0")): # <<<<<<<<<<<<<< * gl_flag = 0 * else: */ goto __pyx_L4; } /* "pygame_sdl2/display.pyx":160 * gl_flag = 0 * else: * gl_flag = SDL_WINDOW_OPENGL # <<<<<<<<<<<<<< * * self.window = SDL_CreateWindow( */ /*else*/ { __pyx_v_gl_flag = SDL_WINDOW_OPENGL; } __pyx_L4:; /* "pygame_sdl2/display.pyx":163 * * self.window = SDL_CreateWindow( * title, # <<<<<<<<<<<<<< * pos[0], pos[1], * resolution[0], resolution[1], flags | gl_flag) */ __pyx_t_7 = __Pyx_PyObject_AsString(__pyx_v_title); if (unlikely((!__pyx_t_7) && PyErr_Occurred())) __PYX_ERR(0, 163, __pyx_L1_error) /* "pygame_sdl2/display.pyx":164 * self.window = SDL_CreateWindow( * title, * pos[0], pos[1], # <<<<<<<<<<<<<< * resolution[0], resolution[1], flags | gl_flag) * */ __pyx_t_4 = __Pyx_GetItemInt(__pyx_v_pos, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 164, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_8 = __Pyx_PyInt_As_int(__pyx_t_4); if (unlikely((__pyx_t_8 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 164, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_t_4 = __Pyx_GetItemInt(__pyx_v_pos, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 164, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_9 = __Pyx_PyInt_As_int(__pyx_t_4); if (unlikely((__pyx_t_9 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 164, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; /* "pygame_sdl2/display.pyx":165 * title, * pos[0], pos[1], * resolution[0], resolution[1], flags | gl_flag) # <<<<<<<<<<<<<< * * if not self.window: */ __pyx_t_4 = __Pyx_GetItemInt(__pyx_v_resolution, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 165, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_10 = __Pyx_PyInt_As_int(__pyx_t_4); if (unlikely((__pyx_t_10 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 165, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_t_4 = __Pyx_GetItemInt(__pyx_v_resolution, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 165, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_11 = __Pyx_PyInt_As_int(__pyx_t_4); if (unlikely((__pyx_t_11 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 165, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_t_4 = __Pyx_PyInt_From_long(__pyx_v_gl_flag); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 165, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_3 = PyNumber_Or(__pyx_v_flags, __pyx_t_4); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 165, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_t_6 = __Pyx_PyInt_As_uint32_t(__pyx_t_3); if (unlikely((__pyx_t_6 == ((Uint32)-1)) && PyErr_Occurred())) __PYX_ERR(0, 165, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "pygame_sdl2/display.pyx":162 * gl_flag = SDL_WINDOW_OPENGL * * self.window = SDL_CreateWindow( # <<<<<<<<<<<<<< * title, * pos[0], pos[1], */ __pyx_v_self->window = SDL_CreateWindow(__pyx_t_7, __pyx_t_8, __pyx_t_9, __pyx_t_10, __pyx_t_11, __pyx_t_6); /* "pygame_sdl2/display.pyx":167 * resolution[0], resolution[1], flags | gl_flag) * * if not self.window: # <<<<<<<<<<<<<< * raise error() * */ __pyx_t_2 = ((!(__pyx_v_self->window != 0)) != 0); if (__pyx_t_2) { /* "pygame_sdl2/display.pyx":168 * * if not self.window: * raise error() # <<<<<<<<<<<<<< * * # From here on, the window exists. So we have to call self.destroy if */ __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_error); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 168, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_5 = NULL; if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_4))) { __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4); if (likely(__pyx_t_5)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4); __Pyx_INCREF(__pyx_t_5); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_4, function); } } if (__pyx_t_5) { __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_5); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 168, __pyx_L1_error) __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; } else { __pyx_t_3 = __Pyx_PyObject_CallNoArg(__pyx_t_4); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 168, __pyx_L1_error) } __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_Raise(__pyx_t_3, 0, 0, 0); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __PYX_ERR(0, 168, __pyx_L1_error) /* "pygame_sdl2/display.pyx":167 * resolution[0], resolution[1], flags | gl_flag) * * if not self.window: # <<<<<<<<<<<<<< * raise error() * */ } /* "pygame_sdl2/display.pyx":173 * # an exception occurs. * * try: # <<<<<<<<<<<<<< * * if flags & SDL_WINDOW_OPENGL: */ { __Pyx_PyThreadState_declare __Pyx_PyThreadState_assign __Pyx_ExceptionSave(&__pyx_t_12, &__pyx_t_13, &__pyx_t_14); __Pyx_XGOTREF(__pyx_t_12); __Pyx_XGOTREF(__pyx_t_13); __Pyx_XGOTREF(__pyx_t_14); /*try:*/ { /* "pygame_sdl2/display.pyx":175 * try: * * if flags & SDL_WINDOW_OPENGL: # <<<<<<<<<<<<<< * * self.gl_context = SDL_GL_CreateContext(self.window) */ __pyx_t_3 = __Pyx_PyInt_From_SDL_WindowFlags(SDL_WINDOW_OPENGL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 175, __pyx_L6_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = PyNumber_And(__pyx_v_flags, __pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 175, __pyx_L6_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 175, __pyx_L6_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; if (__pyx_t_2) { /* "pygame_sdl2/display.pyx":177 * if flags & SDL_WINDOW_OPENGL: * * self.gl_context = SDL_GL_CreateContext(self.window) # <<<<<<<<<<<<<< * * if self.gl_context == NULL: */ __pyx_v_self->gl_context = SDL_GL_CreateContext(__pyx_v_self->window); /* "pygame_sdl2/display.pyx":179 * self.gl_context = SDL_GL_CreateContext(self.window) * * if self.gl_context == NULL: # <<<<<<<<<<<<<< * raise error() * */ __pyx_t_2 = ((__pyx_v_self->gl_context == NULL) != 0); if (__pyx_t_2) { /* "pygame_sdl2/display.pyx":180 * * if self.gl_context == NULL: * raise error() # <<<<<<<<<<<<<< * * if not ios: */ __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_error); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 180, __pyx_L6_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_5 = NULL; if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) { __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_3); if (likely(__pyx_t_5)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); __Pyx_INCREF(__pyx_t_5); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_3, function); } } if (__pyx_t_5) { __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_5); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 180, __pyx_L6_error) __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; } else { __pyx_t_4 = __Pyx_PyObject_CallNoArg(__pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 180, __pyx_L6_error) } __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_Raise(__pyx_t_4, 0, 0, 0); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __PYX_ERR(0, 180, __pyx_L6_error) /* "pygame_sdl2/display.pyx":179 * self.gl_context = SDL_GL_CreateContext(self.window) * * if self.gl_context == NULL: # <<<<<<<<<<<<<< * raise error() * */ } /* "pygame_sdl2/display.pyx":182 * raise error() * * if not ios: # <<<<<<<<<<<<<< * # Try setting the swap interval - first positive, then negated * # to deal with the case where the negative interval isn't */ __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_ios); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 182, __pyx_L6_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 182, __pyx_L6_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_t_1 = ((!__pyx_t_2) != 0); if (__pyx_t_1) { /* "pygame_sdl2/display.pyx":186 * # to deal with the case where the negative interval isn't * # supported. Then give up and carry on. * if SDL_GL_SetSwapInterval(default_swap_control): # <<<<<<<<<<<<<< * SDL_GL_SetSwapInterval(-default_swap_control) * */ __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_default_swap_control); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 186, __pyx_L6_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_11 = __Pyx_PyInt_As_int(__pyx_t_4); if (unlikely((__pyx_t_11 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 186, __pyx_L6_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_t_1 = (SDL_GL_SetSwapInterval(__pyx_t_11) != 0); if (__pyx_t_1) { /* "pygame_sdl2/display.pyx":187 * # supported. Then give up and carry on. * if SDL_GL_SetSwapInterval(default_swap_control): * SDL_GL_SetSwapInterval(-default_swap_control) # <<<<<<<<<<<<<< * * */ __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_default_swap_control); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 187, __pyx_L6_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_3 = PyNumber_Negative(__pyx_t_4); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 187, __pyx_L6_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_t_11 = __Pyx_PyInt_As_int(__pyx_t_3); if (unlikely((__pyx_t_11 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 187, __pyx_L6_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; SDL_GL_SetSwapInterval(__pyx_t_11); /* "pygame_sdl2/display.pyx":186 * # to deal with the case where the negative interval isn't * # supported. Then give up and carry on. * if SDL_GL_SetSwapInterval(default_swap_control): # <<<<<<<<<<<<<< * SDL_GL_SetSwapInterval(-default_swap_control) * */ } /* "pygame_sdl2/display.pyx":182 * raise error() * * if not ios: # <<<<<<<<<<<<<< * # Try setting the swap interval - first positive, then negated * # to deal with the case where the negative interval isn't */ } /* "pygame_sdl2/display.pyx":175 * try: * * if flags & SDL_WINDOW_OPENGL: # <<<<<<<<<<<<<< * * self.gl_context = SDL_GL_CreateContext(self.window) */ } /* "pygame_sdl2/display.pyx":190 * * * self.create_surface() # <<<<<<<<<<<<<< * * except: */ __pyx_t_4 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_create_surface); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 190, __pyx_L6_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_5 = NULL; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_4))) { __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4); if (likely(__pyx_t_5)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4); __Pyx_INCREF(__pyx_t_5); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_4, function); } } if (__pyx_t_5) { __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_5); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 190, __pyx_L6_error) __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; } else { __pyx_t_3 = __Pyx_PyObject_CallNoArg(__pyx_t_4); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 190, __pyx_L6_error) } __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "pygame_sdl2/display.pyx":173 * # an exception occurs. * * try: # <<<<<<<<<<<<<< * * if flags & SDL_WINDOW_OPENGL: */ } __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0; __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0; __Pyx_XDECREF(__pyx_t_14); __pyx_t_14 = 0; goto __pyx_L13_try_end; __pyx_L6_error:; __Pyx_PyThreadState_assign __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; /* "pygame_sdl2/display.pyx":192 * self.create_surface() * * except: # <<<<<<<<<<<<<< * self.destroy() * raise */ /*except:*/ { __Pyx_AddTraceback("pygame_sdl2.display.Window.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename); if (__Pyx_GetException(&__pyx_t_3, &__pyx_t_4, &__pyx_t_5) < 0) __PYX_ERR(0, 192, __pyx_L8_except_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_GOTREF(__pyx_t_4); __Pyx_GOTREF(__pyx_t_5); /* "pygame_sdl2/display.pyx":193 * * except: * self.destroy() # <<<<<<<<<<<<<< * raise * */ __pyx_t_16 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_destroy); if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 193, __pyx_L8_except_error) __Pyx_GOTREF(__pyx_t_16); __pyx_t_17 = NULL; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_16))) { __pyx_t_17 = PyMethod_GET_SELF(__pyx_t_16); if (likely(__pyx_t_17)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_16); __Pyx_INCREF(__pyx_t_17); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_16, function); } } if (__pyx_t_17) { __pyx_t_15 = __Pyx_PyObject_CallOneArg(__pyx_t_16, __pyx_t_17); if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 193, __pyx_L8_except_error) __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0; } else { __pyx_t_15 = __Pyx_PyObject_CallNoArg(__pyx_t_16); if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 193, __pyx_L8_except_error) } __Pyx_GOTREF(__pyx_t_15); __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0; __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0; /* "pygame_sdl2/display.pyx":194 * except: * self.destroy() * raise # <<<<<<<<<<<<<< * * def create_surface(self): */ __Pyx_GIVEREF(__pyx_t_3); __Pyx_GIVEREF(__pyx_t_4); __Pyx_XGIVEREF(__pyx_t_5); __Pyx_ErrRestoreWithState(__pyx_t_3, __pyx_t_4, __pyx_t_5); __pyx_t_3 = 0; __pyx_t_4 = 0; __pyx_t_5 = 0; __PYX_ERR(0, 194, __pyx_L8_except_error) } __pyx_L8_except_error:; /* "pygame_sdl2/display.pyx":173 * # an exception occurs. * * try: # <<<<<<<<<<<<<< * * if flags & SDL_WINDOW_OPENGL: */ __Pyx_PyThreadState_assign __Pyx_XGIVEREF(__pyx_t_12); __Pyx_XGIVEREF(__pyx_t_13); __Pyx_XGIVEREF(__pyx_t_14); __Pyx_ExceptionReset(__pyx_t_12, __pyx_t_13, __pyx_t_14); goto __pyx_L1_error; __pyx_L13_try_end:; } /* "pygame_sdl2/display.pyx":146 * * cdef class Window: * def __init__(self, title, resolution=(0, 0), flags=0, depth=0, pos=(SDL_WINDOWPOS_UNDEFINED, SDL_WINDOWPOS_UNDEFINED)): # <<<<<<<<<<<<<< * * if not isinstance(title, bytes): */ /* function exit code */ __pyx_r = 0; goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_5); __Pyx_XDECREF(__pyx_t_15); __Pyx_XDECREF(__pyx_t_16); __Pyx_XDECREF(__pyx_t_17); __Pyx_AddTraceback("pygame_sdl2.display.Window.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = -1; __pyx_L0:; __Pyx_XDECREF(__pyx_v_title); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/display.pyx":196 * raise * * def create_surface(self): # <<<<<<<<<<<<<< * """ * Creates the surface associated with this window. */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_7display_6Window_3create_surface(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/ static char __pyx_doc_11pygame_sdl2_7display_6Window_2create_surface[] = "\n Creates the surface associated with this window.\n "; static PyObject *__pyx_pw_11pygame_sdl2_7display_6Window_3create_surface(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("create_surface (wrapper)", 0); __pyx_r = __pyx_pf_11pygame_sdl2_7display_6Window_2create_surface(((struct __pyx_obj_11pygame_sdl2_7display_Window *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_7display_6Window_2create_surface(struct __pyx_obj_11pygame_sdl2_7display_Window *__pyx_v_self) { int __pyx_v_w; int __pyx_v_h; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; SDL_Surface *__pyx_t_5; __Pyx_RefNannySetupContext("create_surface", 0); /* "pygame_sdl2/display.pyx":202 * * cdef int w, h * SDL_GetWindowSize(self.window, &w, &h) # <<<<<<<<<<<<<< * * if self.gl_context: */ SDL_GetWindowSize(__pyx_v_self->window, (&__pyx_v_w), (&__pyx_v_h)); /* "pygame_sdl2/display.pyx":204 * SDL_GetWindowSize(self.window, &w, &h) * * if self.gl_context: # <<<<<<<<<<<<<< * * # For now, make this the size of the window so get_size() works. */ __pyx_t_1 = (__pyx_v_self->gl_context != 0); if (__pyx_t_1) { /* "pygame_sdl2/display.pyx":209 * # TODO: Make this a bit less wasteful of memory, even if it means * # we lie about the actual size of the pixel array. * self.surface = Surface((w, h), SRCALPHA, 32) # <<<<<<<<<<<<<< * * else: */ __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_v_w); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 209, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = __Pyx_PyInt_From_int(__pyx_v_h); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 209, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 209, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_GIVEREF(__pyx_t_2); PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_2); __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_3); __pyx_t_2 = 0; __pyx_t_3 = 0; __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_SRCALPHA); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 209, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_2 = PyTuple_New(3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 209, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_4); __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_t_3); __Pyx_INCREF(__pyx_int_32); __Pyx_GIVEREF(__pyx_int_32); PyTuple_SET_ITEM(__pyx_t_2, 2, __pyx_int_32); __pyx_t_4 = 0; __pyx_t_3 = 0; __pyx_t_3 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_11pygame_sdl2_7surface_Surface), __pyx_t_2, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 209, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_GIVEREF(__pyx_t_3); __Pyx_GOTREF(__pyx_v_self->surface); __Pyx_DECREF(((PyObject *)__pyx_v_self->surface)); __pyx_v_self->surface = ((struct __pyx_obj_11pygame_sdl2_7surface_Surface *)__pyx_t_3); __pyx_t_3 = 0; /* "pygame_sdl2/display.pyx":204 * SDL_GetWindowSize(self.window, &w, &h) * * if self.gl_context: # <<<<<<<<<<<<<< * * # For now, make this the size of the window so get_size() works. */ goto __pyx_L3; } /* "pygame_sdl2/display.pyx":213 * else: * * self.window_surface = SDL_GetWindowSurface(self.window) # <<<<<<<<<<<<<< * * # If the surface is 32-bit, we can use it directly. Otherwise, */ /*else*/ { __pyx_v_self->window_surface = SDL_GetWindowSurface(__pyx_v_self->window); /* "pygame_sdl2/display.pyx":217 * # If the surface is 32-bit, we can use it directly. Otherwise, * # we need to create a 32-bit proxy surface. * if self.window_surface.format.BitsPerPixel == 32: # <<<<<<<<<<<<<< * * self.surface = Surface(()) */ __pyx_t_1 = ((__pyx_v_self->window_surface->format->BitsPerPixel == 32) != 0); if (__pyx_t_1) { /* "pygame_sdl2/display.pyx":219 * if self.window_surface.format.BitsPerPixel == 32: * * self.surface = Surface(()) # <<<<<<<<<<<<<< * self.surface.surface = self.window_surface * self.surface.owns_surface = False */ __pyx_t_3 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_11pygame_sdl2_7surface_Surface), __pyx_tuple__8, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 219, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_GIVEREF(__pyx_t_3); __Pyx_GOTREF(__pyx_v_self->surface); __Pyx_DECREF(((PyObject *)__pyx_v_self->surface)); __pyx_v_self->surface = ((struct __pyx_obj_11pygame_sdl2_7surface_Surface *)__pyx_t_3); __pyx_t_3 = 0; /* "pygame_sdl2/display.pyx":220 * * self.surface = Surface(()) * self.surface.surface = self.window_surface # <<<<<<<<<<<<<< * self.surface.owns_surface = False * self.surface.window_surface = True */ __pyx_t_5 = __pyx_v_self->window_surface; __pyx_v_self->surface->surface = __pyx_t_5; /* "pygame_sdl2/display.pyx":221 * self.surface = Surface(()) * self.surface.surface = self.window_surface * self.surface.owns_surface = False # <<<<<<<<<<<<<< * self.surface.window_surface = True * */ __pyx_v_self->surface->owns_surface = 0; /* "pygame_sdl2/display.pyx":222 * self.surface.surface = self.window_surface * self.surface.owns_surface = False * self.surface.window_surface = True # <<<<<<<<<<<<<< * * else: */ __pyx_v_self->surface->window_surface = 1; /* "pygame_sdl2/display.pyx":217 * # If the surface is 32-bit, we can use it directly. Otherwise, * # we need to create a 32-bit proxy surface. * if self.window_surface.format.BitsPerPixel == 32: # <<<<<<<<<<<<<< * * self.surface = Surface(()) */ goto __pyx_L4; } /* "pygame_sdl2/display.pyx":225 * * else: * self.surface = Surface((w, h), 0, 32) # <<<<<<<<<<<<<< * * self.surface.get_window_flags = self.get_window_flags */ /*else*/ { __pyx_t_3 = __Pyx_PyInt_From_int(__pyx_v_w); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 225, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_v_h); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 225, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 225, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_3); __Pyx_GIVEREF(__pyx_t_2); PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_2); __pyx_t_3 = 0; __pyx_t_2 = 0; __pyx_t_2 = PyTuple_New(3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 225, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_4); __Pyx_INCREF(__pyx_int_0); __Pyx_GIVEREF(__pyx_int_0); PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_int_0); __Pyx_INCREF(__pyx_int_32); __Pyx_GIVEREF(__pyx_int_32); PyTuple_SET_ITEM(__pyx_t_2, 2, __pyx_int_32); __pyx_t_4 = 0; __pyx_t_4 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_11pygame_sdl2_7surface_Surface), __pyx_t_2, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 225, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_GIVEREF(__pyx_t_4); __Pyx_GOTREF(__pyx_v_self->surface); __Pyx_DECREF(((PyObject *)__pyx_v_self->surface)); __pyx_v_self->surface = ((struct __pyx_obj_11pygame_sdl2_7surface_Surface *)__pyx_t_4); __pyx_t_4 = 0; } __pyx_L4:; } __pyx_L3:; /* "pygame_sdl2/display.pyx":227 * self.surface = Surface((w, h), 0, 32) * * self.surface.get_window_flags = self.get_window_flags # <<<<<<<<<<<<<< * * */ __pyx_t_4 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_get_window_flags); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 227, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_GIVEREF(__pyx_t_4); __Pyx_GOTREF(__pyx_v_self->surface->get_window_flags); __Pyx_DECREF(__pyx_v_self->surface->get_window_flags); __pyx_v_self->surface->get_window_flags = __pyx_t_4; __pyx_t_4 = 0; /* "pygame_sdl2/display.pyx":196 * raise * * def create_surface(self): # <<<<<<<<<<<<<< * """ * Creates the surface associated with this window. */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_AddTraceback("pygame_sdl2.display.Window.create_surface", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/display.pyx":230 * * * def destroy(self): # <<<<<<<<<<<<<< * """ * This should be called before the window is deleted. */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_7display_6Window_5destroy(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/ static char __pyx_doc_11pygame_sdl2_7display_6Window_4destroy[] = "\n This should be called before the window is deleted.\n "; static PyObject *__pyx_pw_11pygame_sdl2_7display_6Window_5destroy(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("destroy (wrapper)", 0); __pyx_r = __pyx_pf_11pygame_sdl2_7display_6Window_4destroy(((struct __pyx_obj_11pygame_sdl2_7display_Window *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_7display_6Window_4destroy(struct __pyx_obj_11pygame_sdl2_7display_Window *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; __Pyx_RefNannySetupContext("destroy", 0); /* "pygame_sdl2/display.pyx":235 * """ * * if self.gl_context != NULL: # <<<<<<<<<<<<<< * SDL_GL_DeleteContext(self.gl_context) * */ __pyx_t_1 = ((__pyx_v_self->gl_context != NULL) != 0); if (__pyx_t_1) { /* "pygame_sdl2/display.pyx":236 * * if self.gl_context != NULL: * SDL_GL_DeleteContext(self.gl_context) # <<<<<<<<<<<<<< * * if self.surface: */ SDL_GL_DeleteContext(__pyx_v_self->gl_context); /* "pygame_sdl2/display.pyx":235 * """ * * if self.gl_context != NULL: # <<<<<<<<<<<<<< * SDL_GL_DeleteContext(self.gl_context) * */ } /* "pygame_sdl2/display.pyx":238 * SDL_GL_DeleteContext(self.gl_context) * * if self.surface: # <<<<<<<<<<<<<< * * # Break the cycle that prevents refcounting from collecting this */ __pyx_t_1 = __Pyx_PyObject_IsTrue(((PyObject *)__pyx_v_self->surface)); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(0, 238, __pyx_L1_error) if (__pyx_t_1) { /* "pygame_sdl2/display.pyx":242 * # Break the cycle that prevents refcounting from collecting this * # object. * self.surface.get_window_flags = None # <<<<<<<<<<<<<< * * # Necessary to collect the GL surface, doesn't hurt the window surface. */ __Pyx_INCREF(Py_None); __Pyx_GIVEREF(Py_None); __Pyx_GOTREF(__pyx_v_self->surface->get_window_flags); __Pyx_DECREF(__pyx_v_self->surface->get_window_flags); __pyx_v_self->surface->get_window_flags = Py_None; /* "pygame_sdl2/display.pyx":245 * * # Necessary to collect the GL surface, doesn't hurt the window surface. * self.surface = None # <<<<<<<<<<<<<< * * SDL_DestroyWindow(self.window) */ __Pyx_INCREF(Py_None); __Pyx_GIVEREF(Py_None); __Pyx_GOTREF(__pyx_v_self->surface); __Pyx_DECREF(((PyObject *)__pyx_v_self->surface)); __pyx_v_self->surface = ((struct __pyx_obj_11pygame_sdl2_7surface_Surface *)Py_None); /* "pygame_sdl2/display.pyx":238 * SDL_GL_DeleteContext(self.gl_context) * * if self.surface: # <<<<<<<<<<<<<< * * # Break the cycle that prevents refcounting from collecting this */ } /* "pygame_sdl2/display.pyx":247 * self.surface = None * * SDL_DestroyWindow(self.window) # <<<<<<<<<<<<<< * * def resize(self, size, opengl=False): */ SDL_DestroyWindow(__pyx_v_self->window); /* "pygame_sdl2/display.pyx":230 * * * def destroy(self): # <<<<<<<<<<<<<< * """ * This should be called before the window is deleted. */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("pygame_sdl2.display.Window.destroy", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/display.pyx":249 * SDL_DestroyWindow(self.window) * * def resize(self, size, opengl=False): # <<<<<<<<<<<<<< * """ * Resizes the window to `size`, which must be a width, height tuple. If opengl */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_7display_6Window_7resize(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_11pygame_sdl2_7display_6Window_6resize[] = "\n Resizes the window to `size`, which must be a width, height tuple. If opengl\n is true, adds an OpenGL context, if it's missing. Otherwise, removes the\n opengl context if present.\n "; static PyObject *__pyx_pw_11pygame_sdl2_7display_6Window_7resize(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_size = 0; PyObject *__pyx_v_opengl = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("resize (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_size,&__pyx_n_s_opengl,0}; PyObject* values[2] = {0,0}; values[1] = ((PyObject *)Py_False); if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_size)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; case 1: if (kw_args > 0) { PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_opengl); if (value) { values[1] = value; kw_args--; } } } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "resize") < 0)) __PYX_ERR(0, 249, __pyx_L3_error) } } else { switch (PyTuple_GET_SIZE(__pyx_args)) { case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_size = values[0]; __pyx_v_opengl = values[1]; } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("resize", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 249, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("pygame_sdl2.display.Window.resize", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_11pygame_sdl2_7display_6Window_6resize(((struct __pyx_obj_11pygame_sdl2_7display_Window *)__pyx_v_self), __pyx_v_size, __pyx_v_opengl); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_7display_6Window_6resize(struct __pyx_obj_11pygame_sdl2_7display_Window *__pyx_v_self, PyObject *__pyx_v_size, PyObject *__pyx_v_opengl) { int __pyx_v_cur_width; int __pyx_v_cur_height; PyObject *__pyx_v_width = NULL; PyObject *__pyx_v_height = NULL; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; int __pyx_t_2; int __pyx_t_3; PyObject *__pyx_t_4 = NULL; PyObject *__pyx_t_5 = NULL; PyObject *__pyx_t_6 = NULL; PyObject *(*__pyx_t_7)(PyObject *); int __pyx_t_8; int __pyx_t_9; __Pyx_RefNannySetupContext("resize", 0); /* "pygame_sdl2/display.pyx":257 * * # Prevents a loop between the surface and this object. * self.surface.get_window_flags = None # <<<<<<<<<<<<<< * * if self.gl_context and not opengl: */ __Pyx_INCREF(Py_None); __Pyx_GIVEREF(Py_None); __Pyx_GOTREF(__pyx_v_self->surface->get_window_flags); __Pyx_DECREF(__pyx_v_self->surface->get_window_flags); __pyx_v_self->surface->get_window_flags = Py_None; /* "pygame_sdl2/display.pyx":259 * self.surface.get_window_flags = None * * if self.gl_context and not opengl: # <<<<<<<<<<<<<< * SDL_GL_DeleteContext(self.gl_context) * self.gl_context = NULL */ __pyx_t_2 = (__pyx_v_self->gl_context != 0); if (__pyx_t_2) { } else { __pyx_t_1 = __pyx_t_2; goto __pyx_L4_bool_binop_done; } __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_v_opengl); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 259, __pyx_L1_error) __pyx_t_3 = ((!__pyx_t_2) != 0); __pyx_t_1 = __pyx_t_3; __pyx_L4_bool_binop_done:; if (__pyx_t_1) { /* "pygame_sdl2/display.pyx":260 * * if self.gl_context and not opengl: * SDL_GL_DeleteContext(self.gl_context) # <<<<<<<<<<<<<< * self.gl_context = NULL * */ SDL_GL_DeleteContext(__pyx_v_self->gl_context); /* "pygame_sdl2/display.pyx":261 * if self.gl_context and not opengl: * SDL_GL_DeleteContext(self.gl_context) * self.gl_context = NULL # <<<<<<<<<<<<<< * * cdef int cur_width = 0 */ __pyx_v_self->gl_context = NULL; /* "pygame_sdl2/display.pyx":259 * self.surface.get_window_flags = None * * if self.gl_context and not opengl: # <<<<<<<<<<<<<< * SDL_GL_DeleteContext(self.gl_context) * self.gl_context = NULL */ } /* "pygame_sdl2/display.pyx":263 * self.gl_context = NULL * * cdef int cur_width = 0 # <<<<<<<<<<<<<< * cdef int cur_height = 0 * */ __pyx_v_cur_width = 0; /* "pygame_sdl2/display.pyx":264 * * cdef int cur_width = 0 * cdef int cur_height = 0 # <<<<<<<<<<<<<< * * width, height = size */ __pyx_v_cur_height = 0; /* "pygame_sdl2/display.pyx":266 * cdef int cur_height = 0 * * width, height = size # <<<<<<<<<<<<<< * * SDL_GetWindowSize(self.window, &cur_width, &cur_height) */ if ((likely(PyTuple_CheckExact(__pyx_v_size))) || (PyList_CheckExact(__pyx_v_size))) { PyObject* sequence = __pyx_v_size; #if !CYTHON_COMPILING_IN_PYPY Py_ssize_t size = Py_SIZE(sequence); #else Py_ssize_t size = PySequence_Size(sequence); #endif if (unlikely(size != 2)) { if (size > 2) __Pyx_RaiseTooManyValuesError(2); else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); __PYX_ERR(0, 266, __pyx_L1_error) } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS if (likely(PyTuple_CheckExact(sequence))) { __pyx_t_4 = PyTuple_GET_ITEM(sequence, 0); __pyx_t_5 = PyTuple_GET_ITEM(sequence, 1); } else { __pyx_t_4 = PyList_GET_ITEM(sequence, 0); __pyx_t_5 = PyList_GET_ITEM(sequence, 1); } __Pyx_INCREF(__pyx_t_4); __Pyx_INCREF(__pyx_t_5); #else __pyx_t_4 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 266, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_5 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 266, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); #endif } else { Py_ssize_t index = -1; __pyx_t_6 = PyObject_GetIter(__pyx_v_size); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 266, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __pyx_t_7 = Py_TYPE(__pyx_t_6)->tp_iternext; index = 0; __pyx_t_4 = __pyx_t_7(__pyx_t_6); if (unlikely(!__pyx_t_4)) goto __pyx_L6_unpacking_failed; __Pyx_GOTREF(__pyx_t_4); index = 1; __pyx_t_5 = __pyx_t_7(__pyx_t_6); if (unlikely(!__pyx_t_5)) goto __pyx_L6_unpacking_failed; __Pyx_GOTREF(__pyx_t_5); if (__Pyx_IternextUnpackEndCheck(__pyx_t_7(__pyx_t_6), 2) < 0) __PYX_ERR(0, 266, __pyx_L1_error) __pyx_t_7 = NULL; __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; goto __pyx_L7_unpacking_done; __pyx_L6_unpacking_failed:; __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __pyx_t_7 = NULL; if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); __PYX_ERR(0, 266, __pyx_L1_error) __pyx_L7_unpacking_done:; } __pyx_v_width = __pyx_t_4; __pyx_t_4 = 0; __pyx_v_height = __pyx_t_5; __pyx_t_5 = 0; /* "pygame_sdl2/display.pyx":268 * width, height = size * * SDL_GetWindowSize(self.window, &cur_width, &cur_height) # <<<<<<<<<<<<<< * * if (cur_width != width) or (cur_height != height): */ SDL_GetWindowSize(__pyx_v_self->window, (&__pyx_v_cur_width), (&__pyx_v_cur_height)); /* "pygame_sdl2/display.pyx":270 * SDL_GetWindowSize(self.window, &cur_width, &cur_height) * * if (cur_width != width) or (cur_height != height): # <<<<<<<<<<<<<< * SDL_SetWindowSize(self.window, width, height) * */ __pyx_t_5 = __Pyx_PyInt_From_int(__pyx_v_cur_width); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 270, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_4 = PyObject_RichCompare(__pyx_t_5, __pyx_v_width, Py_NE); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 270, __pyx_L1_error) __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(0, 270, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; if (!__pyx_t_3) { } else { __pyx_t_1 = __pyx_t_3; goto __pyx_L9_bool_binop_done; } __pyx_t_4 = __Pyx_PyInt_From_int(__pyx_v_cur_height); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 270, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_5 = PyObject_RichCompare(__pyx_t_4, __pyx_v_height, Py_NE); __Pyx_XGOTREF(__pyx_t_5); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 270, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(0, 270, __pyx_L1_error) __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __pyx_t_1 = __pyx_t_3; __pyx_L9_bool_binop_done:; if (__pyx_t_1) { /* "pygame_sdl2/display.pyx":271 * * if (cur_width != width) or (cur_height != height): * SDL_SetWindowSize(self.window, width, height) # <<<<<<<<<<<<<< * * cdef int w, h */ __pyx_t_8 = __Pyx_PyInt_As_int(__pyx_v_width); if (unlikely((__pyx_t_8 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 271, __pyx_L1_error) __pyx_t_9 = __Pyx_PyInt_As_int(__pyx_v_height); if (unlikely((__pyx_t_9 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 271, __pyx_L1_error) SDL_SetWindowSize(__pyx_v_self->window, __pyx_t_8, __pyx_t_9); /* "pygame_sdl2/display.pyx":270 * SDL_GetWindowSize(self.window, &cur_width, &cur_height) * * if (cur_width != width) or (cur_height != height): # <<<<<<<<<<<<<< * SDL_SetWindowSize(self.window, width, height) * */ } /* "pygame_sdl2/display.pyx":276 * * # Create a missing GL context. * if opengl and not self.gl_context: # <<<<<<<<<<<<<< * self.gl_context = SDL_GL_CreateContext(self.window) * */ __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_v_opengl); if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(0, 276, __pyx_L1_error) if (__pyx_t_3) { } else { __pyx_t_1 = __pyx_t_3; goto __pyx_L12_bool_binop_done; } __pyx_t_3 = ((!(__pyx_v_self->gl_context != 0)) != 0); __pyx_t_1 = __pyx_t_3; __pyx_L12_bool_binop_done:; if (__pyx_t_1) { /* "pygame_sdl2/display.pyx":277 * # Create a missing GL context. * if opengl and not self.gl_context: * self.gl_context = SDL_GL_CreateContext(self.window) # <<<<<<<<<<<<<< * * if self.gl_context == NULL: */ __pyx_v_self->gl_context = SDL_GL_CreateContext(__pyx_v_self->window); /* "pygame_sdl2/display.pyx":279 * self.gl_context = SDL_GL_CreateContext(self.window) * * if self.gl_context == NULL: # <<<<<<<<<<<<<< * raise error() * */ __pyx_t_1 = ((__pyx_v_self->gl_context == NULL) != 0); if (__pyx_t_1) { /* "pygame_sdl2/display.pyx":280 * * if self.gl_context == NULL: * raise error() # <<<<<<<<<<<<<< * * self.create_surface() */ __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_error); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 280, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_6 = NULL; if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_4))) { __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_4); if (likely(__pyx_t_6)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4); __Pyx_INCREF(__pyx_t_6); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_4, function); } } if (__pyx_t_6) { __pyx_t_5 = __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_6); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 280, __pyx_L1_error) __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; } else { __pyx_t_5 = __Pyx_PyObject_CallNoArg(__pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 280, __pyx_L1_error) } __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_Raise(__pyx_t_5, 0, 0, 0); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __PYX_ERR(0, 280, __pyx_L1_error) /* "pygame_sdl2/display.pyx":279 * self.gl_context = SDL_GL_CreateContext(self.window) * * if self.gl_context == NULL: # <<<<<<<<<<<<<< * raise error() * */ } /* "pygame_sdl2/display.pyx":276 * * # Create a missing GL context. * if opengl and not self.gl_context: # <<<<<<<<<<<<<< * self.gl_context = SDL_GL_CreateContext(self.window) * */ } /* "pygame_sdl2/display.pyx":282 * raise error() * * self.create_surface() # <<<<<<<<<<<<<< * * def get_window_flags(self): */ __pyx_t_4 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_create_surface); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 282, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_6 = NULL; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_4))) { __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_4); if (likely(__pyx_t_6)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4); __Pyx_INCREF(__pyx_t_6); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_4, function); } } if (__pyx_t_6) { __pyx_t_5 = __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_6); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 282, __pyx_L1_error) __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; } else { __pyx_t_5 = __Pyx_PyObject_CallNoArg(__pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 282, __pyx_L1_error) } __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; /* "pygame_sdl2/display.pyx":249 * SDL_DestroyWindow(self.window) * * def resize(self, size, opengl=False): # <<<<<<<<<<<<<< * """ * Resizes the window to `size`, which must be a width, height tuple. If opengl */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_5); __Pyx_XDECREF(__pyx_t_6); __Pyx_AddTraceback("pygame_sdl2.display.Window.resize", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF(__pyx_v_width); __Pyx_XDECREF(__pyx_v_height); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/display.pyx":284 * self.create_surface() * * def get_window_flags(self): # <<<<<<<<<<<<<< * rv = SDL_GetWindowFlags(self.window) * */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_7display_6Window_9get_window_flags(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/ static PyObject *__pyx_pw_11pygame_sdl2_7display_6Window_9get_window_flags(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("get_window_flags (wrapper)", 0); __pyx_r = __pyx_pf_11pygame_sdl2_7display_6Window_8get_window_flags(((struct __pyx_obj_11pygame_sdl2_7display_Window *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_7display_6Window_8get_window_flags(struct __pyx_obj_11pygame_sdl2_7display_Window *__pyx_v_self) { PyObject *__pyx_v_rv = NULL; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_t_2; PyObject *__pyx_t_3 = NULL; __Pyx_RefNannySetupContext("get_window_flags", 0); /* "pygame_sdl2/display.pyx":285 * * def get_window_flags(self): * rv = SDL_GetWindowFlags(self.window) # <<<<<<<<<<<<<< * * if self.gl_context: */ __pyx_t_1 = __Pyx_PyInt_From_uint32_t(SDL_GetWindowFlags(__pyx_v_self->window)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 285, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_rv = __pyx_t_1; __pyx_t_1 = 0; /* "pygame_sdl2/display.pyx":287 * rv = SDL_GetWindowFlags(self.window) * * if self.gl_context: # <<<<<<<<<<<<<< * rv |= SDL_WINDOW_OPENGL * else: */ __pyx_t_2 = (__pyx_v_self->gl_context != 0); if (__pyx_t_2) { /* "pygame_sdl2/display.pyx":288 * * if self.gl_context: * rv |= SDL_WINDOW_OPENGL # <<<<<<<<<<<<<< * else: * rv &= ~SDL_WINDOW_OPENGL */ __pyx_t_1 = __Pyx_PyInt_From_SDL_WindowFlags(SDL_WINDOW_OPENGL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 288, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_3 = PyNumber_InPlaceOr(__pyx_v_rv, __pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 288, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF_SET(__pyx_v_rv, __pyx_t_3); __pyx_t_3 = 0; /* "pygame_sdl2/display.pyx":287 * rv = SDL_GetWindowFlags(self.window) * * if self.gl_context: # <<<<<<<<<<<<<< * rv |= SDL_WINDOW_OPENGL * else: */ goto __pyx_L3; } /* "pygame_sdl2/display.pyx":290 * rv |= SDL_WINDOW_OPENGL * else: * rv &= ~SDL_WINDOW_OPENGL # <<<<<<<<<<<<<< * * return rv */ /*else*/ { __pyx_t_3 = __Pyx_PyInt_From_int((~SDL_WINDOW_OPENGL)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 290, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_1 = PyNumber_InPlaceAnd(__pyx_v_rv, __pyx_t_3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 290, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF_SET(__pyx_v_rv, __pyx_t_1); __pyx_t_1 = 0; } __pyx_L3:; /* "pygame_sdl2/display.pyx":292 * rv &= ~SDL_WINDOW_OPENGL * * return rv # <<<<<<<<<<<<<< * * def proxy_window_surface(self): */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(__pyx_v_rv); __pyx_r = __pyx_v_rv; goto __pyx_L0; /* "pygame_sdl2/display.pyx":284 * self.create_surface() * * def get_window_flags(self): # <<<<<<<<<<<<<< * rv = SDL_GetWindowFlags(self.window) * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("pygame_sdl2.display.Window.get_window_flags", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF(__pyx_v_rv); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/display.pyx":294 * return rv * * def proxy_window_surface(self): # <<<<<<<<<<<<<< * SDL_UpperBlit(self.surface.surface, NULL, self.window_surface, NULL) * */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_7display_6Window_11proxy_window_surface(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/ static PyObject *__pyx_pw_11pygame_sdl2_7display_6Window_11proxy_window_surface(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("proxy_window_surface (wrapper)", 0); __pyx_r = __pyx_pf_11pygame_sdl2_7display_6Window_10proxy_window_surface(((struct __pyx_obj_11pygame_sdl2_7display_Window *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_7display_6Window_10proxy_window_surface(struct __pyx_obj_11pygame_sdl2_7display_Window *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("proxy_window_surface", 0); /* "pygame_sdl2/display.pyx":295 * * def proxy_window_surface(self): * SDL_UpperBlit(self.surface.surface, NULL, self.window_surface, NULL) # <<<<<<<<<<<<<< * * def flip(self): */ SDL_UpperBlit(__pyx_v_self->surface->surface, NULL, __pyx_v_self->window_surface, NULL); /* "pygame_sdl2/display.pyx":294 * return rv * * def proxy_window_surface(self): # <<<<<<<<<<<<<< * SDL_UpperBlit(self.surface.surface, NULL, self.window_surface, NULL) * */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/display.pyx":297 * SDL_UpperBlit(self.surface.surface, NULL, self.window_surface, NULL) * * def flip(self): # <<<<<<<<<<<<<< * if self.gl_context != NULL: * with nogil: */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_7display_6Window_13flip(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/ static PyObject *__pyx_pw_11pygame_sdl2_7display_6Window_13flip(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("flip (wrapper)", 0); __pyx_r = __pyx_pf_11pygame_sdl2_7display_6Window_12flip(((struct __pyx_obj_11pygame_sdl2_7display_Window *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_7display_6Window_12flip(struct __pyx_obj_11pygame_sdl2_7display_Window *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; __Pyx_RefNannySetupContext("flip", 0); /* "pygame_sdl2/display.pyx":298 * * def flip(self): * if self.gl_context != NULL: # <<<<<<<<<<<<<< * with nogil: * SDL_GL_SwapWindow(self.window) */ __pyx_t_1 = ((__pyx_v_self->gl_context != NULL) != 0); if (__pyx_t_1) { /* "pygame_sdl2/display.pyx":299 * def flip(self): * if self.gl_context != NULL: * with nogil: # <<<<<<<<<<<<<< * SDL_GL_SwapWindow(self.window) * else: */ { #ifdef WITH_THREAD PyThreadState *_save; Py_UNBLOCK_THREADS #endif /*try:*/ { /* "pygame_sdl2/display.pyx":300 * if self.gl_context != NULL: * with nogil: * SDL_GL_SwapWindow(self.window) # <<<<<<<<<<<<<< * else: * */ SDL_GL_SwapWindow(__pyx_v_self->window); } /* "pygame_sdl2/display.pyx":299 * def flip(self): * if self.gl_context != NULL: * with nogil: # <<<<<<<<<<<<<< * SDL_GL_SwapWindow(self.window) * else: */ /*finally:*/ { /*normal exit:*/{ #ifdef WITH_THREAD Py_BLOCK_THREADS #endif goto __pyx_L6; } __pyx_L6:; } } /* "pygame_sdl2/display.pyx":298 * * def flip(self): * if self.gl_context != NULL: # <<<<<<<<<<<<<< * with nogil: * SDL_GL_SwapWindow(self.window) */ goto __pyx_L3; } /* "pygame_sdl2/display.pyx":303 * else: * * if self.surface.surface != self.window_surface: # <<<<<<<<<<<<<< * self.proxy_window_surface() * */ /*else*/ { __pyx_t_1 = ((__pyx_v_self->surface->surface != __pyx_v_self->window_surface) != 0); if (__pyx_t_1) { /* "pygame_sdl2/display.pyx":304 * * if self.surface.surface != self.window_surface: * self.proxy_window_surface() # <<<<<<<<<<<<<< * * with nogil: */ __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_proxy_window_surface); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 304, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = NULL; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) { __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3); if (likely(__pyx_t_4)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); __Pyx_INCREF(__pyx_t_4); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_3, function); } } if (__pyx_t_4) { __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 304, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; } else { __pyx_t_2 = __Pyx_PyObject_CallNoArg(__pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 304, __pyx_L1_error) } __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "pygame_sdl2/display.pyx":303 * else: * * if self.surface.surface != self.window_surface: # <<<<<<<<<<<<<< * self.proxy_window_surface() * */ } /* "pygame_sdl2/display.pyx":306 * self.proxy_window_surface() * * with nogil: # <<<<<<<<<<<<<< * SDL_UpdateWindowSurface(self.window) * */ { #ifdef WITH_THREAD PyThreadState *_save; Py_UNBLOCK_THREADS #endif /*try:*/ { /* "pygame_sdl2/display.pyx":307 * * with nogil: * SDL_UpdateWindowSurface(self.window) # <<<<<<<<<<<<<< * * def get_surface(self): */ SDL_UpdateWindowSurface(__pyx_v_self->window); } /* "pygame_sdl2/display.pyx":306 * self.proxy_window_surface() * * with nogil: # <<<<<<<<<<<<<< * SDL_UpdateWindowSurface(self.window) * */ /*finally:*/ { /*normal exit:*/{ #ifdef WITH_THREAD Py_BLOCK_THREADS #endif goto __pyx_L10; } __pyx_L10:; } } } __pyx_L3:; /* "pygame_sdl2/display.pyx":297 * SDL_UpperBlit(self.surface.surface, NULL, self.window_surface, NULL) * * def flip(self): # <<<<<<<<<<<<<< * if self.gl_context != NULL: * with nogil: */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_AddTraceback("pygame_sdl2.display.Window.flip", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/display.pyx":309 * SDL_UpdateWindowSurface(self.window) * * def get_surface(self): # <<<<<<<<<<<<<< * return self.surface * */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_7display_6Window_15get_surface(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/ static PyObject *__pyx_pw_11pygame_sdl2_7display_6Window_15get_surface(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("get_surface (wrapper)", 0); __pyx_r = __pyx_pf_11pygame_sdl2_7display_6Window_14get_surface(((struct __pyx_obj_11pygame_sdl2_7display_Window *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_7display_6Window_14get_surface(struct __pyx_obj_11pygame_sdl2_7display_Window *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("get_surface", 0); /* "pygame_sdl2/display.pyx":310 * * def get_surface(self): * return self.surface # <<<<<<<<<<<<<< * * def update(self, rectangles=None): */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(((PyObject *)__pyx_v_self->surface)); __pyx_r = ((PyObject *)__pyx_v_self->surface); goto __pyx_L0; /* "pygame_sdl2/display.pyx":309 * SDL_UpdateWindowSurface(self.window) * * def get_surface(self): # <<<<<<<<<<<<<< * return self.surface * */ /* function exit code */ __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/display.pyx":312 * return self.surface * * def update(self, rectangles=None): # <<<<<<<<<<<<<< * * cdef SDL_Rect *rects */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_7display_6Window_17update(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static PyObject *__pyx_pw_11pygame_sdl2_7display_6Window_17update(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_rectangles = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("update (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_rectangles,0}; PyObject* values[1] = {0}; values[0] = ((PyObject *)Py_None); if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (kw_args > 0) { PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_rectangles); if (value) { values[0] = value; kw_args--; } } } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "update") < 0)) __PYX_ERR(0, 312, __pyx_L3_error) } } else { switch (PyTuple_GET_SIZE(__pyx_args)) { case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); case 0: break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_rectangles = values[0]; } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("update", 0, 0, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 312, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("pygame_sdl2.display.Window.update", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_11pygame_sdl2_7display_6Window_16update(((struct __pyx_obj_11pygame_sdl2_7display_Window *)__pyx_v_self), __pyx_v_rectangles); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_7display_6Window_16update(struct __pyx_obj_11pygame_sdl2_7display_Window *__pyx_v_self, PyObject *__pyx_v_rectangles) { SDL_Rect *__pyx_v_rects; int __pyx_v_count; PyObject *__pyx_v_i = NULL; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; int __pyx_t_2; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; PyObject *__pyx_t_5 = NULL; Py_ssize_t __pyx_t_6; PyObject *(*__pyx_t_7)(PyObject *); int __pyx_t_8; int __pyx_t_9; char const *__pyx_t_10; PyObject *__pyx_t_11 = NULL; PyObject *__pyx_t_12 = NULL; PyObject *__pyx_t_13 = NULL; PyObject *__pyx_t_14 = NULL; PyObject *__pyx_t_15 = NULL; PyObject *__pyx_t_16 = NULL; __Pyx_RefNannySetupContext("update", 0); __Pyx_INCREF(__pyx_v_rectangles); /* "pygame_sdl2/display.pyx":315 * * cdef SDL_Rect *rects * cdef int count = 0 # <<<<<<<<<<<<<< * * if rectangles is None: */ __pyx_v_count = 0; /* "pygame_sdl2/display.pyx":317 * cdef int count = 0 * * if rectangles is None: # <<<<<<<<<<<<<< * self.flip() * return */ __pyx_t_1 = (__pyx_v_rectangles == Py_None); __pyx_t_2 = (__pyx_t_1 != 0); if (__pyx_t_2) { /* "pygame_sdl2/display.pyx":318 * * if rectangles is None: * self.flip() # <<<<<<<<<<<<<< * return * */ __pyx_t_4 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_flip); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 318, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_5 = NULL; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_4))) { __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4); if (likely(__pyx_t_5)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4); __Pyx_INCREF(__pyx_t_5); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_4, function); } } if (__pyx_t_5) { __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_5); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 318, __pyx_L1_error) __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; } else { __pyx_t_3 = __Pyx_PyObject_CallNoArg(__pyx_t_4); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 318, __pyx_L1_error) } __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "pygame_sdl2/display.pyx":319 * if rectangles is None: * self.flip() * return # <<<<<<<<<<<<<< * * if self.surface.surface != self.window_surface: */ __Pyx_XDECREF(__pyx_r); __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; /* "pygame_sdl2/display.pyx":317 * cdef int count = 0 * * if rectangles is None: # <<<<<<<<<<<<<< * self.flip() * return */ } /* "pygame_sdl2/display.pyx":321 * return * * if self.surface.surface != self.window_surface: # <<<<<<<<<<<<<< * self.proxy_window_surface() * */ __pyx_t_2 = ((__pyx_v_self->surface->surface != __pyx_v_self->window_surface) != 0); if (__pyx_t_2) { /* "pygame_sdl2/display.pyx":322 * * if self.surface.surface != self.window_surface: * self.proxy_window_surface() # <<<<<<<<<<<<<< * * if not isinstance(rectangles, list): */ __pyx_t_4 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_proxy_window_surface); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 322, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_5 = NULL; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_4))) { __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4); if (likely(__pyx_t_5)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4); __Pyx_INCREF(__pyx_t_5); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_4, function); } } if (__pyx_t_5) { __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_5); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 322, __pyx_L1_error) __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; } else { __pyx_t_3 = __Pyx_PyObject_CallNoArg(__pyx_t_4); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 322, __pyx_L1_error) } __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "pygame_sdl2/display.pyx":321 * return * * if self.surface.surface != self.window_surface: # <<<<<<<<<<<<<< * self.proxy_window_surface() * */ } /* "pygame_sdl2/display.pyx":324 * self.proxy_window_surface() * * if not isinstance(rectangles, list): # <<<<<<<<<<<<<< * rectangles = [ rectangles ] * */ __pyx_t_2 = PyList_Check(__pyx_v_rectangles); __pyx_t_1 = ((!(__pyx_t_2 != 0)) != 0); if (__pyx_t_1) { /* "pygame_sdl2/display.pyx":325 * * if not isinstance(rectangles, list): * rectangles = [ rectangles ] # <<<<<<<<<<<<<< * * rects = calloc(len(rectangles), sizeof(SDL_Rect)) */ __pyx_t_3 = PyList_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 325, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_INCREF(__pyx_v_rectangles); __Pyx_GIVEREF(__pyx_v_rectangles); PyList_SET_ITEM(__pyx_t_3, 0, __pyx_v_rectangles); __Pyx_DECREF_SET(__pyx_v_rectangles, __pyx_t_3); __pyx_t_3 = 0; /* "pygame_sdl2/display.pyx":324 * self.proxy_window_surface() * * if not isinstance(rectangles, list): # <<<<<<<<<<<<<< * rectangles = [ rectangles ] * */ } /* "pygame_sdl2/display.pyx":327 * rectangles = [ rectangles ] * * rects = calloc(len(rectangles), sizeof(SDL_Rect)) # <<<<<<<<<<<<<< * if rects == NULL: * raise MemoryError("Couldn't allocate rectangles.") */ __pyx_t_6 = PyObject_Length(__pyx_v_rectangles); if (unlikely(__pyx_t_6 == -1)) __PYX_ERR(0, 327, __pyx_L1_error) __pyx_v_rects = ((SDL_Rect *)calloc(__pyx_t_6, (sizeof(SDL_Rect)))); /* "pygame_sdl2/display.pyx":328 * * rects = calloc(len(rectangles), sizeof(SDL_Rect)) * if rects == NULL: # <<<<<<<<<<<<<< * raise MemoryError("Couldn't allocate rectangles.") * */ __pyx_t_1 = ((__pyx_v_rects == NULL) != 0); if (__pyx_t_1) { /* "pygame_sdl2/display.pyx":329 * rects = calloc(len(rectangles), sizeof(SDL_Rect)) * if rects == NULL: * raise MemoryError("Couldn't allocate rectangles.") # <<<<<<<<<<<<<< * * try: */ __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_MemoryError, __pyx_tuple__9, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 329, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_Raise(__pyx_t_3, 0, 0, 0); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __PYX_ERR(0, 329, __pyx_L1_error) /* "pygame_sdl2/display.pyx":328 * * rects = calloc(len(rectangles), sizeof(SDL_Rect)) * if rects == NULL: # <<<<<<<<<<<<<< * raise MemoryError("Couldn't allocate rectangles.") * */ } /* "pygame_sdl2/display.pyx":331 * raise MemoryError("Couldn't allocate rectangles.") * * try: # <<<<<<<<<<<<<< * * for i in rectangles: */ /*try:*/ { /* "pygame_sdl2/display.pyx":333 * try: * * for i in rectangles: # <<<<<<<<<<<<<< * if i is None: * continue */ if (likely(PyList_CheckExact(__pyx_v_rectangles)) || PyTuple_CheckExact(__pyx_v_rectangles)) { __pyx_t_3 = __pyx_v_rectangles; __Pyx_INCREF(__pyx_t_3); __pyx_t_6 = 0; __pyx_t_7 = NULL; } else { __pyx_t_6 = -1; __pyx_t_3 = PyObject_GetIter(__pyx_v_rectangles); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 333, __pyx_L8_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_7 = Py_TYPE(__pyx_t_3)->tp_iternext; if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 333, __pyx_L8_error) } for (;;) { if (likely(!__pyx_t_7)) { if (likely(PyList_CheckExact(__pyx_t_3))) { if (__pyx_t_6 >= PyList_GET_SIZE(__pyx_t_3)) break; #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS __pyx_t_4 = PyList_GET_ITEM(__pyx_t_3, __pyx_t_6); __Pyx_INCREF(__pyx_t_4); __pyx_t_6++; if (unlikely(0 < 0)) __PYX_ERR(0, 333, __pyx_L8_error) #else __pyx_t_4 = PySequence_ITEM(__pyx_t_3, __pyx_t_6); __pyx_t_6++; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 333, __pyx_L8_error) __Pyx_GOTREF(__pyx_t_4); #endif } else { if (__pyx_t_6 >= PyTuple_GET_SIZE(__pyx_t_3)) break; #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS __pyx_t_4 = PyTuple_GET_ITEM(__pyx_t_3, __pyx_t_6); __Pyx_INCREF(__pyx_t_4); __pyx_t_6++; if (unlikely(0 < 0)) __PYX_ERR(0, 333, __pyx_L8_error) #else __pyx_t_4 = PySequence_ITEM(__pyx_t_3, __pyx_t_6); __pyx_t_6++; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 333, __pyx_L8_error) __Pyx_GOTREF(__pyx_t_4); #endif } } else { __pyx_t_4 = __pyx_t_7(__pyx_t_3); if (unlikely(!__pyx_t_4)) { PyObject* exc_type = PyErr_Occurred(); if (exc_type) { if (likely(exc_type == PyExc_StopIteration || PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); else __PYX_ERR(0, 333, __pyx_L8_error) } break; } __Pyx_GOTREF(__pyx_t_4); } __Pyx_XDECREF_SET(__pyx_v_i, __pyx_t_4); __pyx_t_4 = 0; /* "pygame_sdl2/display.pyx":334 * * for i in rectangles: * if i is None: # <<<<<<<<<<<<<< * continue * */ __pyx_t_1 = (__pyx_v_i == Py_None); __pyx_t_2 = (__pyx_t_1 != 0); if (__pyx_t_2) { /* "pygame_sdl2/display.pyx":335 * for i in rectangles: * if i is None: * continue # <<<<<<<<<<<<<< * * to_sdl_rect(i, &rects[count]) */ goto __pyx_L10_continue; /* "pygame_sdl2/display.pyx":334 * * for i in rectangles: * if i is None: # <<<<<<<<<<<<<< * continue * */ } /* "pygame_sdl2/display.pyx":337 * continue * * to_sdl_rect(i, &rects[count]) # <<<<<<<<<<<<<< * count += 1 * */ __pyx_t_8 = __pyx_f_11pygame_sdl2_4rect_to_sdl_rect(__pyx_v_i, (&(__pyx_v_rects[__pyx_v_count])), NULL); if (unlikely(__pyx_t_8 == -1)) __PYX_ERR(0, 337, __pyx_L8_error) /* "pygame_sdl2/display.pyx":338 * * to_sdl_rect(i, &rects[count]) * count += 1 # <<<<<<<<<<<<<< * * SDL_UpdateWindowSurfaceRects(self.window, rects, count) */ __pyx_v_count = (__pyx_v_count + 1); /* "pygame_sdl2/display.pyx":333 * try: * * for i in rectangles: # <<<<<<<<<<<<<< * if i is None: * continue */ __pyx_L10_continue:; } __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "pygame_sdl2/display.pyx":340 * count += 1 * * SDL_UpdateWindowSurfaceRects(self.window, rects, count) # <<<<<<<<<<<<<< * * finally: */ SDL_UpdateWindowSurfaceRects(__pyx_v_self->window, __pyx_v_rects, __pyx_v_count); } /* "pygame_sdl2/display.pyx":343 * * finally: * free(rects) # <<<<<<<<<<<<<< * * def get_wm_info(self): */ /*finally:*/ { /*normal exit:*/{ free(__pyx_v_rects); goto __pyx_L9; } /*exception exit:*/{ __Pyx_PyThreadState_declare __pyx_L8_error:; __pyx_t_11 = 0; __pyx_t_12 = 0; __pyx_t_13 = 0; __pyx_t_14 = 0; __pyx_t_15 = 0; __pyx_t_16 = 0; __Pyx_PyThreadState_assign __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; if (PY_MAJOR_VERSION >= 3) __Pyx_ExceptionSwap(&__pyx_t_14, &__pyx_t_15, &__pyx_t_16); if ((PY_MAJOR_VERSION < 3) || unlikely(__Pyx_GetException(&__pyx_t_11, &__pyx_t_12, &__pyx_t_13) < 0)) __Pyx_ErrFetch(&__pyx_t_11, &__pyx_t_12, &__pyx_t_13); __Pyx_XGOTREF(__pyx_t_11); __Pyx_XGOTREF(__pyx_t_12); __Pyx_XGOTREF(__pyx_t_13); __Pyx_XGOTREF(__pyx_t_14); __Pyx_XGOTREF(__pyx_t_15); __Pyx_XGOTREF(__pyx_t_16); __pyx_t_8 = __pyx_lineno; __pyx_t_9 = __pyx_clineno; __pyx_t_10 = __pyx_filename; { free(__pyx_v_rects); } __Pyx_PyThreadState_assign if (PY_MAJOR_VERSION >= 3) { __Pyx_XGIVEREF(__pyx_t_14); __Pyx_XGIVEREF(__pyx_t_15); __Pyx_XGIVEREF(__pyx_t_16); __Pyx_ExceptionReset(__pyx_t_14, __pyx_t_15, __pyx_t_16); } __Pyx_XGIVEREF(__pyx_t_11); __Pyx_XGIVEREF(__pyx_t_12); __Pyx_XGIVEREF(__pyx_t_13); __Pyx_ErrRestore(__pyx_t_11, __pyx_t_12, __pyx_t_13); __pyx_t_11 = 0; __pyx_t_12 = 0; __pyx_t_13 = 0; __pyx_t_14 = 0; __pyx_t_15 = 0; __pyx_t_16 = 0; __pyx_lineno = __pyx_t_8; __pyx_clineno = __pyx_t_9; __pyx_filename = __pyx_t_10; goto __pyx_L1_error; } __pyx_L9:; } /* "pygame_sdl2/display.pyx":312 * return self.surface * * def update(self, rectangles=None): # <<<<<<<<<<<<<< * * cdef SDL_Rect *rects */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_5); __Pyx_AddTraceback("pygame_sdl2.display.Window.update", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF(__pyx_v_i); __Pyx_XDECREF(__pyx_v_rectangles); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/display.pyx":345 * free(rects) * * def get_wm_info(self): # <<<<<<<<<<<<<< * return { } * */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_7display_6Window_19get_wm_info(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/ static PyObject *__pyx_pw_11pygame_sdl2_7display_6Window_19get_wm_info(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("get_wm_info (wrapper)", 0); __pyx_r = __pyx_pf_11pygame_sdl2_7display_6Window_18get_wm_info(((struct __pyx_obj_11pygame_sdl2_7display_Window *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_7display_6Window_18get_wm_info(CYTHON_UNUSED struct __pyx_obj_11pygame_sdl2_7display_Window *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; __Pyx_RefNannySetupContext("get_wm_info", 0); /* "pygame_sdl2/display.pyx":346 * * def get_wm_info(self): * return { } # <<<<<<<<<<<<<< * * def get_active(self): */ __Pyx_XDECREF(__pyx_r); __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 346, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "pygame_sdl2/display.pyx":345 * free(rects) * * def get_wm_info(self): # <<<<<<<<<<<<<< * return { } * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("pygame_sdl2.display.Window.get_wm_info", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/display.pyx":348 * return { } * * def get_active(self): # <<<<<<<<<<<<<< * if SDL_GetWindowFlags(self.window) & (SDL_WINDOW_HIDDEN | SDL_WINDOW_MINIMIZED): * return False */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_7display_6Window_21get_active(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/ static PyObject *__pyx_pw_11pygame_sdl2_7display_6Window_21get_active(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("get_active (wrapper)", 0); __pyx_r = __pyx_pf_11pygame_sdl2_7display_6Window_20get_active(((struct __pyx_obj_11pygame_sdl2_7display_Window *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_7display_6Window_20get_active(struct __pyx_obj_11pygame_sdl2_7display_Window *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; __Pyx_RefNannySetupContext("get_active", 0); /* "pygame_sdl2/display.pyx":349 * * def get_active(self): * if SDL_GetWindowFlags(self.window) & (SDL_WINDOW_HIDDEN | SDL_WINDOW_MINIMIZED): # <<<<<<<<<<<<<< * return False * else: */ __pyx_t_1 = ((SDL_GetWindowFlags(__pyx_v_self->window) & (SDL_WINDOW_HIDDEN | SDL_WINDOW_MINIMIZED)) != 0); if (__pyx_t_1) { /* "pygame_sdl2/display.pyx":350 * def get_active(self): * if SDL_GetWindowFlags(self.window) & (SDL_WINDOW_HIDDEN | SDL_WINDOW_MINIMIZED): * return False # <<<<<<<<<<<<<< * else: * return True */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(Py_False); __pyx_r = Py_False; goto __pyx_L0; /* "pygame_sdl2/display.pyx":349 * * def get_active(self): * if SDL_GetWindowFlags(self.window) & (SDL_WINDOW_HIDDEN | SDL_WINDOW_MINIMIZED): # <<<<<<<<<<<<<< * return False * else: */ } /* "pygame_sdl2/display.pyx":352 * return False * else: * return True # <<<<<<<<<<<<<< * * def iconify(self): */ /*else*/ { __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(Py_True); __pyx_r = Py_True; goto __pyx_L0; } /* "pygame_sdl2/display.pyx":348 * return { } * * def get_active(self): # <<<<<<<<<<<<<< * if SDL_GetWindowFlags(self.window) & (SDL_WINDOW_HIDDEN | SDL_WINDOW_MINIMIZED): * return False */ /* function exit code */ __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/display.pyx":354 * return True * * def iconify(self): # <<<<<<<<<<<<<< * SDL_MinimizeWindow(self.window) * return True */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_7display_6Window_23iconify(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/ static PyObject *__pyx_pw_11pygame_sdl2_7display_6Window_23iconify(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("iconify (wrapper)", 0); __pyx_r = __pyx_pf_11pygame_sdl2_7display_6Window_22iconify(((struct __pyx_obj_11pygame_sdl2_7display_Window *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_7display_6Window_22iconify(struct __pyx_obj_11pygame_sdl2_7display_Window *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("iconify", 0); /* "pygame_sdl2/display.pyx":355 * * def iconify(self): * SDL_MinimizeWindow(self.window) # <<<<<<<<<<<<<< * return True * */ SDL_MinimizeWindow(__pyx_v_self->window); /* "pygame_sdl2/display.pyx":356 * def iconify(self): * SDL_MinimizeWindow(self.window) * return True # <<<<<<<<<<<<<< * * def toggle_fullscreen(self): */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(Py_True); __pyx_r = Py_True; goto __pyx_L0; /* "pygame_sdl2/display.pyx":354 * return True * * def iconify(self): # <<<<<<<<<<<<<< * SDL_MinimizeWindow(self.window) * return True */ /* function exit code */ __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/display.pyx":358 * return True * * def toggle_fullscreen(self): # <<<<<<<<<<<<<< * if SDL_GetWindowFlags(self.window) & (SDL_WINDOW_FULLSCREEN_DESKTOP): * if SDL_SetWindowFullscreen(self.window, 0): */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_7display_6Window_25toggle_fullscreen(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/ static PyObject *__pyx_pw_11pygame_sdl2_7display_6Window_25toggle_fullscreen(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("toggle_fullscreen (wrapper)", 0); __pyx_r = __pyx_pf_11pygame_sdl2_7display_6Window_24toggle_fullscreen(((struct __pyx_obj_11pygame_sdl2_7display_Window *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_7display_6Window_24toggle_fullscreen(struct __pyx_obj_11pygame_sdl2_7display_Window *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; __Pyx_RefNannySetupContext("toggle_fullscreen", 0); /* "pygame_sdl2/display.pyx":359 * * def toggle_fullscreen(self): * if SDL_GetWindowFlags(self.window) & (SDL_WINDOW_FULLSCREEN_DESKTOP): # <<<<<<<<<<<<<< * if SDL_SetWindowFullscreen(self.window, 0): * raise error() */ __pyx_t_1 = ((SDL_GetWindowFlags(__pyx_v_self->window) & SDL_WINDOW_FULLSCREEN_DESKTOP) != 0); if (__pyx_t_1) { /* "pygame_sdl2/display.pyx":360 * def toggle_fullscreen(self): * if SDL_GetWindowFlags(self.window) & (SDL_WINDOW_FULLSCREEN_DESKTOP): * if SDL_SetWindowFullscreen(self.window, 0): # <<<<<<<<<<<<<< * raise error() * else: */ __pyx_t_1 = (SDL_SetWindowFullscreen(__pyx_v_self->window, 0) != 0); if (__pyx_t_1) { /* "pygame_sdl2/display.pyx":361 * if SDL_GetWindowFlags(self.window) & (SDL_WINDOW_FULLSCREEN_DESKTOP): * if SDL_SetWindowFullscreen(self.window, 0): * raise error() # <<<<<<<<<<<<<< * else: * if SDL_SetWindowFullscreen(self.window, SDL_WINDOW_FULLSCREEN_DESKTOP): */ __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_error); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 361, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = NULL; if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) { __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3); if (likely(__pyx_t_4)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); __Pyx_INCREF(__pyx_t_4); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_3, function); } } if (__pyx_t_4) { __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 361, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; } else { __pyx_t_2 = __Pyx_PyObject_CallNoArg(__pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 361, __pyx_L1_error) } __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_Raise(__pyx_t_2, 0, 0, 0); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __PYX_ERR(0, 361, __pyx_L1_error) /* "pygame_sdl2/display.pyx":360 * def toggle_fullscreen(self): * if SDL_GetWindowFlags(self.window) & (SDL_WINDOW_FULLSCREEN_DESKTOP): * if SDL_SetWindowFullscreen(self.window, 0): # <<<<<<<<<<<<<< * raise error() * else: */ } /* "pygame_sdl2/display.pyx":359 * * def toggle_fullscreen(self): * if SDL_GetWindowFlags(self.window) & (SDL_WINDOW_FULLSCREEN_DESKTOP): # <<<<<<<<<<<<<< * if SDL_SetWindowFullscreen(self.window, 0): * raise error() */ goto __pyx_L3; } /* "pygame_sdl2/display.pyx":363 * raise error() * else: * if SDL_SetWindowFullscreen(self.window, SDL_WINDOW_FULLSCREEN_DESKTOP): # <<<<<<<<<<<<<< * raise error() * */ /*else*/ { __pyx_t_1 = (SDL_SetWindowFullscreen(__pyx_v_self->window, SDL_WINDOW_FULLSCREEN_DESKTOP) != 0); if (__pyx_t_1) { /* "pygame_sdl2/display.pyx":364 * else: * if SDL_SetWindowFullscreen(self.window, SDL_WINDOW_FULLSCREEN_DESKTOP): * raise error() # <<<<<<<<<<<<<< * * return True */ __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_error); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 364, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = NULL; if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) { __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3); if (likely(__pyx_t_4)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); __Pyx_INCREF(__pyx_t_4); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_3, function); } } if (__pyx_t_4) { __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 364, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; } else { __pyx_t_2 = __Pyx_PyObject_CallNoArg(__pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 364, __pyx_L1_error) } __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_Raise(__pyx_t_2, 0, 0, 0); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __PYX_ERR(0, 364, __pyx_L1_error) /* "pygame_sdl2/display.pyx":363 * raise error() * else: * if SDL_SetWindowFullscreen(self.window, SDL_WINDOW_FULLSCREEN_DESKTOP): # <<<<<<<<<<<<<< * raise error() * */ } } __pyx_L3:; /* "pygame_sdl2/display.pyx":366 * raise error() * * return True # <<<<<<<<<<<<<< * * def set_gamma(self, red, green=None, blue=None): */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(Py_True); __pyx_r = Py_True; goto __pyx_L0; /* "pygame_sdl2/display.pyx":358 * return True * * def toggle_fullscreen(self): # <<<<<<<<<<<<<< * if SDL_GetWindowFlags(self.window) & (SDL_WINDOW_FULLSCREEN_DESKTOP): * if SDL_SetWindowFullscreen(self.window, 0): */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_AddTraceback("pygame_sdl2.display.Window.toggle_fullscreen", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/display.pyx":368 * return True * * def set_gamma(self, red, green=None, blue=None): # <<<<<<<<<<<<<< * if green is None: * green = red */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_7display_6Window_27set_gamma(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static PyObject *__pyx_pw_11pygame_sdl2_7display_6Window_27set_gamma(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_red = 0; PyObject *__pyx_v_green = 0; PyObject *__pyx_v_blue = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("set_gamma (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_red,&__pyx_n_s_green,&__pyx_n_s_blue,0}; PyObject* values[3] = {0,0,0}; values[1] = ((PyObject *)Py_None); values[2] = ((PyObject *)Py_None); if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_red)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; case 1: if (kw_args > 0) { PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_green); if (value) { values[1] = value; kw_args--; } } case 2: if (kw_args > 0) { PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_blue); if (value) { values[2] = value; kw_args--; } } } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "set_gamma") < 0)) __PYX_ERR(0, 368, __pyx_L3_error) } } else { switch (PyTuple_GET_SIZE(__pyx_args)) { case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_red = values[0]; __pyx_v_green = values[1]; __pyx_v_blue = values[2]; } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("set_gamma", 0, 1, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 368, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("pygame_sdl2.display.Window.set_gamma", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_11pygame_sdl2_7display_6Window_26set_gamma(((struct __pyx_obj_11pygame_sdl2_7display_Window *)__pyx_v_self), __pyx_v_red, __pyx_v_green, __pyx_v_blue); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_7display_6Window_26set_gamma(struct __pyx_obj_11pygame_sdl2_7display_Window *__pyx_v_self, PyObject *__pyx_v_red, PyObject *__pyx_v_green, PyObject *__pyx_v_blue) { Uint16 __pyx_v_red_gamma[0x100]; Uint16 __pyx_v_green_gamma[0x100]; Uint16 __pyx_v_blue_gamma[0x100]; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; int __pyx_t_2; float __pyx_t_3; __Pyx_RefNannySetupContext("set_gamma", 0); __Pyx_INCREF(__pyx_v_green); __Pyx_INCREF(__pyx_v_blue); /* "pygame_sdl2/display.pyx":369 * * def set_gamma(self, red, green=None, blue=None): * if green is None: # <<<<<<<<<<<<<< * green = red * if blue is None: */ __pyx_t_1 = (__pyx_v_green == Py_None); __pyx_t_2 = (__pyx_t_1 != 0); if (__pyx_t_2) { /* "pygame_sdl2/display.pyx":370 * def set_gamma(self, red, green=None, blue=None): * if green is None: * green = red # <<<<<<<<<<<<<< * if blue is None: * blue = red */ __Pyx_INCREF(__pyx_v_red); __Pyx_DECREF_SET(__pyx_v_green, __pyx_v_red); /* "pygame_sdl2/display.pyx":369 * * def set_gamma(self, red, green=None, blue=None): * if green is None: # <<<<<<<<<<<<<< * green = red * if blue is None: */ } /* "pygame_sdl2/display.pyx":371 * if green is None: * green = red * if blue is None: # <<<<<<<<<<<<<< * blue = red * */ __pyx_t_2 = (__pyx_v_blue == Py_None); __pyx_t_1 = (__pyx_t_2 != 0); if (__pyx_t_1) { /* "pygame_sdl2/display.pyx":372 * green = red * if blue is None: * blue = red # <<<<<<<<<<<<<< * * cdef Uint16 red_gamma[256] */ __Pyx_INCREF(__pyx_v_red); __Pyx_DECREF_SET(__pyx_v_blue, __pyx_v_red); /* "pygame_sdl2/display.pyx":371 * if green is None: * green = red * if blue is None: # <<<<<<<<<<<<<< * blue = red * */ } /* "pygame_sdl2/display.pyx":378 * cdef Uint16 blue_gamma[256] * * SDL_CalculateGammaRamp(red, red_gamma) # <<<<<<<<<<<<<< * SDL_CalculateGammaRamp(green, green_gamma) * SDL_CalculateGammaRamp(blue, blue_gamma) */ __pyx_t_3 = __pyx_PyFloat_AsFloat(__pyx_v_red); if (unlikely((__pyx_t_3 == (float)-1) && PyErr_Occurred())) __PYX_ERR(0, 378, __pyx_L1_error) SDL_CalculateGammaRamp(__pyx_t_3, __pyx_v_red_gamma); /* "pygame_sdl2/display.pyx":379 * * SDL_CalculateGammaRamp(red, red_gamma) * SDL_CalculateGammaRamp(green, green_gamma) # <<<<<<<<<<<<<< * SDL_CalculateGammaRamp(blue, blue_gamma) * */ __pyx_t_3 = __pyx_PyFloat_AsFloat(__pyx_v_green); if (unlikely((__pyx_t_3 == (float)-1) && PyErr_Occurred())) __PYX_ERR(0, 379, __pyx_L1_error) SDL_CalculateGammaRamp(__pyx_t_3, __pyx_v_green_gamma); /* "pygame_sdl2/display.pyx":380 * SDL_CalculateGammaRamp(red, red_gamma) * SDL_CalculateGammaRamp(green, green_gamma) * SDL_CalculateGammaRamp(blue, blue_gamma) # <<<<<<<<<<<<<< * * if SDL_SetWindowGammaRamp(self.window, red_gamma, green_gamma, blue_gamma): */ __pyx_t_3 = __pyx_PyFloat_AsFloat(__pyx_v_blue); if (unlikely((__pyx_t_3 == (float)-1) && PyErr_Occurred())) __PYX_ERR(0, 380, __pyx_L1_error) SDL_CalculateGammaRamp(__pyx_t_3, __pyx_v_blue_gamma); /* "pygame_sdl2/display.pyx":382 * SDL_CalculateGammaRamp(blue, blue_gamma) * * if SDL_SetWindowGammaRamp(self.window, red_gamma, green_gamma, blue_gamma): # <<<<<<<<<<<<<< * return False * */ __pyx_t_1 = (SDL_SetWindowGammaRamp(__pyx_v_self->window, __pyx_v_red_gamma, __pyx_v_green_gamma, __pyx_v_blue_gamma) != 0); if (__pyx_t_1) { /* "pygame_sdl2/display.pyx":383 * * if SDL_SetWindowGammaRamp(self.window, red_gamma, green_gamma, blue_gamma): * return False # <<<<<<<<<<<<<< * * return True */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(Py_False); __pyx_r = Py_False; goto __pyx_L0; /* "pygame_sdl2/display.pyx":382 * SDL_CalculateGammaRamp(blue, blue_gamma) * * if SDL_SetWindowGammaRamp(self.window, red_gamma, green_gamma, blue_gamma): # <<<<<<<<<<<<<< * return False * */ } /* "pygame_sdl2/display.pyx":385 * return False * * return True # <<<<<<<<<<<<<< * * def set_gamma_ramp(self, red, green, blue): */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(Py_True); __pyx_r = Py_True; goto __pyx_L0; /* "pygame_sdl2/display.pyx":368 * return True * * def set_gamma(self, red, green=None, blue=None): # <<<<<<<<<<<<<< * if green is None: * green = red */ /* function exit code */ __pyx_L1_error:; __Pyx_AddTraceback("pygame_sdl2.display.Window.set_gamma", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF(__pyx_v_green); __Pyx_XDECREF(__pyx_v_blue); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/display.pyx":387 * return True * * def set_gamma_ramp(self, red, green, blue): # <<<<<<<<<<<<<< * * cdef Uint16 red_gamma[256] */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_7display_6Window_29set_gamma_ramp(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static PyObject *__pyx_pw_11pygame_sdl2_7display_6Window_29set_gamma_ramp(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_red = 0; PyObject *__pyx_v_green = 0; PyObject *__pyx_v_blue = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("set_gamma_ramp (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_red,&__pyx_n_s_green,&__pyx_n_s_blue,0}; PyObject* values[3] = {0,0,0}; if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_red)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; case 1: if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_green)) != 0)) kw_args--; else { __Pyx_RaiseArgtupleInvalid("set_gamma_ramp", 1, 3, 3, 1); __PYX_ERR(0, 387, __pyx_L3_error) } case 2: if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_blue)) != 0)) kw_args--; else { __Pyx_RaiseArgtupleInvalid("set_gamma_ramp", 1, 3, 3, 2); __PYX_ERR(0, 387, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "set_gamma_ramp") < 0)) __PYX_ERR(0, 387, __pyx_L3_error) } } else if (PyTuple_GET_SIZE(__pyx_args) != 3) { goto __pyx_L5_argtuple_error; } else { values[0] = PyTuple_GET_ITEM(__pyx_args, 0); values[1] = PyTuple_GET_ITEM(__pyx_args, 1); values[2] = PyTuple_GET_ITEM(__pyx_args, 2); } __pyx_v_red = values[0]; __pyx_v_green = values[1]; __pyx_v_blue = values[2]; } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("set_gamma_ramp", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 387, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("pygame_sdl2.display.Window.set_gamma_ramp", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_11pygame_sdl2_7display_6Window_28set_gamma_ramp(((struct __pyx_obj_11pygame_sdl2_7display_Window *)__pyx_v_self), __pyx_v_red, __pyx_v_green, __pyx_v_blue); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_7display_6Window_28set_gamma_ramp(struct __pyx_obj_11pygame_sdl2_7display_Window *__pyx_v_self, PyObject *__pyx_v_red, PyObject *__pyx_v_green, PyObject *__pyx_v_blue) { Uint16 __pyx_v_red_gamma[0x100]; Uint16 __pyx_v_green_gamma[0x100]; Uint16 __pyx_v_blue_gamma[0x100]; long __pyx_v_i; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations long __pyx_t_1; PyObject *__pyx_t_2 = NULL; Uint16 __pyx_t_3; int __pyx_t_4; __Pyx_RefNannySetupContext("set_gamma_ramp", 0); /* "pygame_sdl2/display.pyx":393 * cdef Uint16 blue_gamma[256] * * for i in range(256): # <<<<<<<<<<<<<< * red_gamma[i] = red[i] * green_gamma[i] = green[i] */ for (__pyx_t_1 = 0; __pyx_t_1 < 0x100; __pyx_t_1+=1) { __pyx_v_i = __pyx_t_1; /* "pygame_sdl2/display.pyx":394 * * for i in range(256): * red_gamma[i] = red[i] # <<<<<<<<<<<<<< * green_gamma[i] = green[i] * blue_gamma[i] = blue[i] */ __pyx_t_2 = __Pyx_GetItemInt(__pyx_v_red, __pyx_v_i, long, 1, __Pyx_PyInt_From_long, 0, 1, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 394, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = __Pyx_PyInt_As_uint16_t(__pyx_t_2); if (unlikely((__pyx_t_3 == ((Uint16)-1)) && PyErr_Occurred())) __PYX_ERR(0, 394, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; (__pyx_v_red_gamma[__pyx_v_i]) = __pyx_t_3; /* "pygame_sdl2/display.pyx":395 * for i in range(256): * red_gamma[i] = red[i] * green_gamma[i] = green[i] # <<<<<<<<<<<<<< * blue_gamma[i] = blue[i] * */ __pyx_t_2 = __Pyx_GetItemInt(__pyx_v_green, __pyx_v_i, long, 1, __Pyx_PyInt_From_long, 0, 1, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 395, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = __Pyx_PyInt_As_uint16_t(__pyx_t_2); if (unlikely((__pyx_t_3 == ((Uint16)-1)) && PyErr_Occurred())) __PYX_ERR(0, 395, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; (__pyx_v_green_gamma[__pyx_v_i]) = __pyx_t_3; /* "pygame_sdl2/display.pyx":396 * red_gamma[i] = red[i] * green_gamma[i] = green[i] * blue_gamma[i] = blue[i] # <<<<<<<<<<<<<< * * if SDL_SetWindowGammaRamp(self.window, red_gamma, green_gamma, blue_gamma): */ __pyx_t_2 = __Pyx_GetItemInt(__pyx_v_blue, __pyx_v_i, long, 1, __Pyx_PyInt_From_long, 0, 1, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 396, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = __Pyx_PyInt_As_uint16_t(__pyx_t_2); if (unlikely((__pyx_t_3 == ((Uint16)-1)) && PyErr_Occurred())) __PYX_ERR(0, 396, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; (__pyx_v_blue_gamma[__pyx_v_i]) = __pyx_t_3; } /* "pygame_sdl2/display.pyx":398 * blue_gamma[i] = blue[i] * * if SDL_SetWindowGammaRamp(self.window, red_gamma, green_gamma, blue_gamma): # <<<<<<<<<<<<<< * return False * */ __pyx_t_4 = (SDL_SetWindowGammaRamp(__pyx_v_self->window, __pyx_v_red_gamma, __pyx_v_green_gamma, __pyx_v_blue_gamma) != 0); if (__pyx_t_4) { /* "pygame_sdl2/display.pyx":399 * * if SDL_SetWindowGammaRamp(self.window, red_gamma, green_gamma, blue_gamma): * return False # <<<<<<<<<<<<<< * * return True */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(Py_False); __pyx_r = Py_False; goto __pyx_L0; /* "pygame_sdl2/display.pyx":398 * blue_gamma[i] = blue[i] * * if SDL_SetWindowGammaRamp(self.window, red_gamma, green_gamma, blue_gamma): # <<<<<<<<<<<<<< * return False * */ } /* "pygame_sdl2/display.pyx":401 * return False * * return True # <<<<<<<<<<<<<< * * def set_icon(self, Surface surface): */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(Py_True); __pyx_r = Py_True; goto __pyx_L0; /* "pygame_sdl2/display.pyx":387 * return True * * def set_gamma_ramp(self, red, green, blue): # <<<<<<<<<<<<<< * * cdef Uint16 red_gamma[256] */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_AddTraceback("pygame_sdl2.display.Window.set_gamma_ramp", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/display.pyx":403 * return True * * def set_icon(self, Surface surface): # <<<<<<<<<<<<<< * SDL_SetWindowIcon(self.window, surface.surface) * */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_7display_6Window_31set_icon(PyObject *__pyx_v_self, PyObject *__pyx_v_surface); /*proto*/ static PyObject *__pyx_pw_11pygame_sdl2_7display_6Window_31set_icon(PyObject *__pyx_v_self, PyObject *__pyx_v_surface) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("set_icon (wrapper)", 0); if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_surface), __pyx_ptype_11pygame_sdl2_7surface_Surface, 1, "surface", 0))) __PYX_ERR(0, 403, __pyx_L1_error) __pyx_r = __pyx_pf_11pygame_sdl2_7display_6Window_30set_icon(((struct __pyx_obj_11pygame_sdl2_7display_Window *)__pyx_v_self), ((struct __pyx_obj_11pygame_sdl2_7surface_Surface *)__pyx_v_surface)); /* function exit code */ goto __pyx_L0; __pyx_L1_error:; __pyx_r = NULL; __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_7display_6Window_30set_icon(struct __pyx_obj_11pygame_sdl2_7display_Window *__pyx_v_self, struct __pyx_obj_11pygame_sdl2_7surface_Surface *__pyx_v_surface) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("set_icon", 0); /* "pygame_sdl2/display.pyx":404 * * def set_icon(self, Surface surface): * SDL_SetWindowIcon(self.window, surface.surface) # <<<<<<<<<<<<<< * * def set_caption(self, title): */ SDL_SetWindowIcon(__pyx_v_self->window, __pyx_v_surface->surface); /* "pygame_sdl2/display.pyx":403 * return True * * def set_icon(self, Surface surface): # <<<<<<<<<<<<<< * SDL_SetWindowIcon(self.window, surface.surface) * */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/display.pyx":406 * SDL_SetWindowIcon(self.window, surface.surface) * * def set_caption(self, title): # <<<<<<<<<<<<<< * * if not isinstance(title, bytes): */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_7display_6Window_33set_caption(PyObject *__pyx_v_self, PyObject *__pyx_v_title); /*proto*/ static PyObject *__pyx_pw_11pygame_sdl2_7display_6Window_33set_caption(PyObject *__pyx_v_self, PyObject *__pyx_v_title) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("set_caption (wrapper)", 0); __pyx_r = __pyx_pf_11pygame_sdl2_7display_6Window_32set_caption(((struct __pyx_obj_11pygame_sdl2_7display_Window *)__pyx_v_self), ((PyObject *)__pyx_v_title)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_7display_6Window_32set_caption(struct __pyx_obj_11pygame_sdl2_7display_Window *__pyx_v_self, PyObject *__pyx_v_title) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; int __pyx_t_2; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; char const *__pyx_t_5; __Pyx_RefNannySetupContext("set_caption", 0); __Pyx_INCREF(__pyx_v_title); /* "pygame_sdl2/display.pyx":408 * def set_caption(self, title): * * if not isinstance(title, bytes): # <<<<<<<<<<<<<< * title = title.encode("utf-8") * */ __pyx_t_1 = PyBytes_Check(__pyx_v_title); __pyx_t_2 = ((!(__pyx_t_1 != 0)) != 0); if (__pyx_t_2) { /* "pygame_sdl2/display.pyx":409 * * if not isinstance(title, bytes): * title = title.encode("utf-8") # <<<<<<<<<<<<<< * * SDL_SetWindowTitle(self.window, title) */ __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_title, __pyx_n_s_encode); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 409, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_tuple__10, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 409, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF_SET(__pyx_v_title, __pyx_t_4); __pyx_t_4 = 0; /* "pygame_sdl2/display.pyx":408 * def set_caption(self, title): * * if not isinstance(title, bytes): # <<<<<<<<<<<<<< * title = title.encode("utf-8") * */ } /* "pygame_sdl2/display.pyx":411 * title = title.encode("utf-8") * * SDL_SetWindowTitle(self.window, title) # <<<<<<<<<<<<<< * * def get_drawable_size(self): */ __pyx_t_5 = __Pyx_PyObject_AsString(__pyx_v_title); if (unlikely((!__pyx_t_5) && PyErr_Occurred())) __PYX_ERR(0, 411, __pyx_L1_error) SDL_SetWindowTitle(__pyx_v_self->window, __pyx_t_5); /* "pygame_sdl2/display.pyx":406 * SDL_SetWindowIcon(self.window, surface.surface) * * def set_caption(self, title): # <<<<<<<<<<<<<< * * if not isinstance(title, bytes): */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_AddTraceback("pygame_sdl2.display.Window.set_caption", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF(__pyx_v_title); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/display.pyx":413 * SDL_SetWindowTitle(self.window, title) * * def get_drawable_size(self): # <<<<<<<<<<<<<< * cdef int w, h * */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_7display_6Window_35get_drawable_size(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/ static PyObject *__pyx_pw_11pygame_sdl2_7display_6Window_35get_drawable_size(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("get_drawable_size (wrapper)", 0); __pyx_r = __pyx_pf_11pygame_sdl2_7display_6Window_34get_drawable_size(((struct __pyx_obj_11pygame_sdl2_7display_Window *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_7display_6Window_34get_drawable_size(struct __pyx_obj_11pygame_sdl2_7display_Window *__pyx_v_self) { int __pyx_v_w; int __pyx_v_h; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; __Pyx_RefNannySetupContext("get_drawable_size", 0); /* "pygame_sdl2/display.pyx":416 * cdef int w, h * * SDL_GL_GetDrawableSize(self.window, &w, &h) # <<<<<<<<<<<<<< * return w, h * */ SDL_GL_GetDrawableSize(__pyx_v_self->window, (&__pyx_v_w), (&__pyx_v_h)); /* "pygame_sdl2/display.pyx":417 * * SDL_GL_GetDrawableSize(self.window, &w, &h) * return w, h # <<<<<<<<<<<<<< * * # The icon that's used for new windows. */ __Pyx_XDECREF(__pyx_r); __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_w); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 417, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_v_h); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 417, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 417, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_GIVEREF(__pyx_t_1); PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_1); __Pyx_GIVEREF(__pyx_t_2); PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_2); __pyx_t_1 = 0; __pyx_t_2 = 0; __pyx_r = __pyx_t_3; __pyx_t_3 = 0; goto __pyx_L0; /* "pygame_sdl2/display.pyx":413 * SDL_SetWindowTitle(self.window, title) * * def get_drawable_size(self): # <<<<<<<<<<<<<< * cdef int w, h * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("pygame_sdl2.display.Window.get_drawable_size", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/display.pxd":29 * cdef SDL_Window *window * cdef SDL_Surface *window_surface * cdef public Surface surface # <<<<<<<<<<<<<< * * # The OpenGL context corresponding to this window. */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_7display_6Window_7surface_1__get__(PyObject *__pyx_v_self); /*proto*/ static PyObject *__pyx_pw_11pygame_sdl2_7display_6Window_7surface_1__get__(PyObject *__pyx_v_self) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); __pyx_r = __pyx_pf_11pygame_sdl2_7display_6Window_7surface___get__(((struct __pyx_obj_11pygame_sdl2_7display_Window *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_7display_6Window_7surface___get__(struct __pyx_obj_11pygame_sdl2_7display_Window *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__get__", 0); __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(((PyObject *)__pyx_v_self->surface)); __pyx_r = ((PyObject *)__pyx_v_self->surface); goto __pyx_L0; /* function exit code */ __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* Python wrapper */ static int __pyx_pw_11pygame_sdl2_7display_6Window_7surface_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/ static int __pyx_pw_11pygame_sdl2_7display_6Window_7surface_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) { int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__set__ (wrapper)", 0); __pyx_r = __pyx_pf_11pygame_sdl2_7display_6Window_7surface_2__set__(((struct __pyx_obj_11pygame_sdl2_7display_Window *)__pyx_v_self), ((PyObject *)__pyx_v_value)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static int __pyx_pf_11pygame_sdl2_7display_6Window_7surface_2__set__(struct __pyx_obj_11pygame_sdl2_7display_Window *__pyx_v_self, PyObject *__pyx_v_value) { int __pyx_r; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; __Pyx_RefNannySetupContext("__set__", 0); if (!(likely(((__pyx_v_value) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_value, __pyx_ptype_11pygame_sdl2_7surface_Surface))))) __PYX_ERR(1, 29, __pyx_L1_error) __pyx_t_1 = __pyx_v_value; __Pyx_INCREF(__pyx_t_1); __Pyx_GIVEREF(__pyx_t_1); __Pyx_GOTREF(__pyx_v_self->surface); __Pyx_DECREF(((PyObject *)__pyx_v_self->surface)); __pyx_v_self->surface = ((struct __pyx_obj_11pygame_sdl2_7surface_Surface *)__pyx_t_1); __pyx_t_1 = 0; /* function exit code */ __pyx_r = 0; goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("pygame_sdl2.display.Window.surface.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = -1; __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; } /* Python wrapper */ static int __pyx_pw_11pygame_sdl2_7display_6Window_7surface_5__del__(PyObject *__pyx_v_self); /*proto*/ static int __pyx_pw_11pygame_sdl2_7display_6Window_7surface_5__del__(PyObject *__pyx_v_self) { int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__del__ (wrapper)", 0); __pyx_r = __pyx_pf_11pygame_sdl2_7display_6Window_7surface_4__del__(((struct __pyx_obj_11pygame_sdl2_7display_Window *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static int __pyx_pf_11pygame_sdl2_7display_6Window_7surface_4__del__(struct __pyx_obj_11pygame_sdl2_7display_Window *__pyx_v_self) { int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__del__", 0); __Pyx_INCREF(Py_None); __Pyx_GIVEREF(Py_None); __Pyx_GOTREF(__pyx_v_self->surface); __Pyx_DECREF(((PyObject *)__pyx_v_self->surface)); __pyx_v_self->surface = ((struct __pyx_obj_11pygame_sdl2_7surface_Surface *)Py_None); /* function exit code */ __pyx_r = 0; __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/display.pyx":428 * default_swap_control = 1 * * def set_mode(resolution=(0, 0), flags=0, depth=0, pos=(SDL_WINDOWPOS_UNDEFINED, SDL_WINDOWPOS_UNDEFINED)): # <<<<<<<<<<<<<< * global main_window * */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_7display_15set_mode(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static PyMethodDef __pyx_mdef_11pygame_sdl2_7display_15set_mode = {"set_mode", (PyCFunction)__pyx_pw_11pygame_sdl2_7display_15set_mode, METH_VARARGS|METH_KEYWORDS, 0}; static PyObject *__pyx_pw_11pygame_sdl2_7display_15set_mode(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_resolution = 0; PyObject *__pyx_v_flags = 0; PyObject *__pyx_v_depth = 0; PyObject *__pyx_v_pos = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("set_mode (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_resolution,&__pyx_n_s_flags,&__pyx_n_s_depth,&__pyx_n_s_pos,0}; PyObject* values[4] = {0,0,0,0}; values[0] = ((PyObject *)__pyx_tuple__11); values[1] = ((PyObject *)__pyx_int_0); values[2] = ((PyObject *)__pyx_int_0); values[3] = __pyx_k__12; if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (kw_args > 0) { PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_resolution); if (value) { values[0] = value; kw_args--; } } case 1: if (kw_args > 0) { PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_flags); if (value) { values[1] = value; kw_args--; } } case 2: if (kw_args > 0) { PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_depth); if (value) { values[2] = value; kw_args--; } } case 3: if (kw_args > 0) { PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_pos); if (value) { values[3] = value; kw_args--; } } } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "set_mode") < 0)) __PYX_ERR(0, 428, __pyx_L3_error) } } else { switch (PyTuple_GET_SIZE(__pyx_args)) { case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); case 0: break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_resolution = values[0]; __pyx_v_flags = values[1]; __pyx_v_depth = values[2]; __pyx_v_pos = values[3]; } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("set_mode", 0, 0, 4, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 428, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("pygame_sdl2.display.set_mode", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_11pygame_sdl2_7display_14set_mode(__pyx_self, __pyx_v_resolution, __pyx_v_flags, __pyx_v_depth, __pyx_v_pos); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_7display_14set_mode(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_resolution, PyObject *__pyx_v_flags, PyObject *__pyx_v_depth, PyObject *__pyx_v_pos) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; PyObject *__pyx_t_5 = NULL; int __pyx_t_6; PyObject *__pyx_t_7 = NULL; int __pyx_t_8; __Pyx_RefNannySetupContext("set_mode", 0); /* "pygame_sdl2/display.pyx":431 * global main_window * * if main_window: # <<<<<<<<<<<<<< * * if (flags & ~SDL_WINDOW_OPENGL) == (main_window.create_flags & ~SDL_WINDOW_OPENGL): */ __pyx_t_1 = __Pyx_PyObject_IsTrue(((PyObject *)__pyx_v_11pygame_sdl2_7display_main_window)); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(0, 431, __pyx_L1_error) if (__pyx_t_1) { /* "pygame_sdl2/display.pyx":433 * if main_window: * * if (flags & ~SDL_WINDOW_OPENGL) == (main_window.create_flags & ~SDL_WINDOW_OPENGL): # <<<<<<<<<<<<<< * main_window.resize(resolution, flags & SDL_WINDOW_OPENGL) * return main_window.surface */ __pyx_t_2 = __Pyx_PyInt_From_int((~SDL_WINDOW_OPENGL)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 433, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = PyNumber_And(__pyx_v_flags, __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 433, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_2 = __Pyx_PyInt_From_uint32_t((__pyx_v_11pygame_sdl2_7display_main_window->create_flags & (~SDL_WINDOW_OPENGL))); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 433, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_4 = PyObject_RichCompare(__pyx_t_3, __pyx_t_2, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 433, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(0, 433, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; if (__pyx_t_1) { /* "pygame_sdl2/display.pyx":434 * * if (flags & ~SDL_WINDOW_OPENGL) == (main_window.create_flags & ~SDL_WINDOW_OPENGL): * main_window.resize(resolution, flags & SDL_WINDOW_OPENGL) # <<<<<<<<<<<<<< * return main_window.surface * */ __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_11pygame_sdl2_7display_main_window), __pyx_n_s_resize); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 434, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = __Pyx_PyInt_From_SDL_WindowFlags(SDL_WINDOW_OPENGL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 434, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_5 = PyNumber_And(__pyx_v_flags, __pyx_t_3); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 434, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_3 = NULL; __pyx_t_6 = 0; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); if (likely(__pyx_t_3)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); __pyx_t_6 = 1; } } #if CYTHON_FAST_PYCALL if (PyFunction_Check(__pyx_t_2)) { PyObject *__pyx_temp[3] = {__pyx_t_3, __pyx_v_resolution, __pyx_t_5}; __pyx_t_4 = __Pyx_PyFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_6, 2+__pyx_t_6); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 434, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; } else #endif #if CYTHON_FAST_PYCCALL if (__Pyx_PyFastCFunction_Check(__pyx_t_2)) { PyObject *__pyx_temp[3] = {__pyx_t_3, __pyx_v_resolution, __pyx_t_5}; __pyx_t_4 = __Pyx_PyCFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_6, 2+__pyx_t_6); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 434, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; } else #endif { __pyx_t_7 = PyTuple_New(2+__pyx_t_6); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 434, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); if (__pyx_t_3) { __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_3); __pyx_t_3 = NULL; } __Pyx_INCREF(__pyx_v_resolution); __Pyx_GIVEREF(__pyx_v_resolution); PyTuple_SET_ITEM(__pyx_t_7, 0+__pyx_t_6, __pyx_v_resolution); __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_7, 1+__pyx_t_6, __pyx_t_5); __pyx_t_5 = 0; __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_7, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 434, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; } __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; /* "pygame_sdl2/display.pyx":435 * if (flags & ~SDL_WINDOW_OPENGL) == (main_window.create_flags & ~SDL_WINDOW_OPENGL): * main_window.resize(resolution, flags & SDL_WINDOW_OPENGL) * return main_window.surface # <<<<<<<<<<<<<< * * else: */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(((PyObject *)__pyx_v_11pygame_sdl2_7display_main_window->surface)); __pyx_r = ((PyObject *)__pyx_v_11pygame_sdl2_7display_main_window->surface); goto __pyx_L0; /* "pygame_sdl2/display.pyx":433 * if main_window: * * if (flags & ~SDL_WINDOW_OPENGL) == (main_window.create_flags & ~SDL_WINDOW_OPENGL): # <<<<<<<<<<<<<< * main_window.resize(resolution, flags & SDL_WINDOW_OPENGL) * return main_window.surface */ } /* "pygame_sdl2/display.pyx":438 * * else: * main_window.destroy() # <<<<<<<<<<<<<< * * main_window = Window(default_title, resolution, flags, depth, pos=pos) */ /*else*/ { __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_11pygame_sdl2_7display_main_window), __pyx_n_s_destroy); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 438, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_7 = NULL; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) { __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_2); if (likely(__pyx_t_7)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_7); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); } } if (__pyx_t_7) { __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_7); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 438, __pyx_L1_error) __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; } else { __pyx_t_4 = __Pyx_PyObject_CallNoArg(__pyx_t_2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 438, __pyx_L1_error) } __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; } /* "pygame_sdl2/display.pyx":431 * global main_window * * if main_window: # <<<<<<<<<<<<<< * * if (flags & ~SDL_WINDOW_OPENGL) == (main_window.create_flags & ~SDL_WINDOW_OPENGL): */ } /* "pygame_sdl2/display.pyx":440 * main_window.destroy() * * main_window = Window(default_title, resolution, flags, depth, pos=pos) # <<<<<<<<<<<<<< * * if default_icon is not None: */ __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_default_title); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 440, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_2 = PyTuple_New(4); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 440, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_4); __Pyx_INCREF(__pyx_v_resolution); __Pyx_GIVEREF(__pyx_v_resolution); PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_v_resolution); __Pyx_INCREF(__pyx_v_flags); __Pyx_GIVEREF(__pyx_v_flags); PyTuple_SET_ITEM(__pyx_t_2, 2, __pyx_v_flags); __Pyx_INCREF(__pyx_v_depth); __Pyx_GIVEREF(__pyx_v_depth); PyTuple_SET_ITEM(__pyx_t_2, 3, __pyx_v_depth); __pyx_t_4 = 0; __pyx_t_4 = PyDict_New(); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 440, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_pos, __pyx_v_pos) < 0) __PYX_ERR(0, 440, __pyx_L1_error) __pyx_t_7 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_11pygame_sdl2_7display_Window), __pyx_t_2, __pyx_t_4); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 440, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_XGOTREF(((PyObject *)__pyx_v_11pygame_sdl2_7display_main_window)); __Pyx_DECREF_SET(__pyx_v_11pygame_sdl2_7display_main_window, ((struct __pyx_obj_11pygame_sdl2_7display_Window *)__pyx_t_7)); __Pyx_GIVEREF(__pyx_t_7); __pyx_t_7 = 0; /* "pygame_sdl2/display.pyx":442 * main_window = Window(default_title, resolution, flags, depth, pos=pos) * * if default_icon is not None: # <<<<<<<<<<<<<< * main_window.set_icon(default_icon) * */ __pyx_t_7 = __Pyx_GetModuleGlobalName(__pyx_n_s_default_icon); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 442, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __pyx_t_1 = (__pyx_t_7 != Py_None); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __pyx_t_8 = (__pyx_t_1 != 0); if (__pyx_t_8) { /* "pygame_sdl2/display.pyx":443 * * if default_icon is not None: * main_window.set_icon(default_icon) # <<<<<<<<<<<<<< * * return main_window.surface */ __pyx_t_4 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_11pygame_sdl2_7display_main_window), __pyx_n_s_set_icon); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 443, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_default_icon); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 443, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_5 = NULL; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_4))) { __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4); if (likely(__pyx_t_5)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4); __Pyx_INCREF(__pyx_t_5); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_4, function); } } if (!__pyx_t_5) { __pyx_t_7 = __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_2); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 443, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_GOTREF(__pyx_t_7); } else { #if CYTHON_FAST_PYCALL if (PyFunction_Check(__pyx_t_4)) { PyObject *__pyx_temp[2] = {__pyx_t_5, __pyx_t_2}; __pyx_t_7 = __Pyx_PyFunction_FastCall(__pyx_t_4, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 443, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } else #endif #if CYTHON_FAST_PYCCALL if (__Pyx_PyFastCFunction_Check(__pyx_t_4)) { PyObject *__pyx_temp[2] = {__pyx_t_5, __pyx_t_2}; __pyx_t_7 = __Pyx_PyCFunction_FastCall(__pyx_t_4, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 443, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } else #endif { __pyx_t_3 = PyTuple_New(1+1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 443, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_5); __pyx_t_5 = NULL; __Pyx_GIVEREF(__pyx_t_2); PyTuple_SET_ITEM(__pyx_t_3, 0+1, __pyx_t_2); __pyx_t_2 = 0; __pyx_t_7 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_3, NULL); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 443, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } } __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; /* "pygame_sdl2/display.pyx":442 * main_window = Window(default_title, resolution, flags, depth, pos=pos) * * if default_icon is not None: # <<<<<<<<<<<<<< * main_window.set_icon(default_icon) * */ } /* "pygame_sdl2/display.pyx":445 * main_window.set_icon(default_icon) * * return main_window.surface # <<<<<<<<<<<<<< * * def get_surface(): */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(((PyObject *)__pyx_v_11pygame_sdl2_7display_main_window->surface)); __pyx_r = ((PyObject *)__pyx_v_11pygame_sdl2_7display_main_window->surface); goto __pyx_L0; /* "pygame_sdl2/display.pyx":428 * default_swap_control = 1 * * def set_mode(resolution=(0, 0), flags=0, depth=0, pos=(SDL_WINDOWPOS_UNDEFINED, SDL_WINDOWPOS_UNDEFINED)): # <<<<<<<<<<<<<< * global main_window * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_5); __Pyx_XDECREF(__pyx_t_7); __Pyx_AddTraceback("pygame_sdl2.display.set_mode", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/display.pyx":447 * return main_window.surface * * def get_surface(): # <<<<<<<<<<<<<< * if main_window is None: * return None */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_7display_17get_surface(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused); /*proto*/ static PyMethodDef __pyx_mdef_11pygame_sdl2_7display_17get_surface = {"get_surface", (PyCFunction)__pyx_pw_11pygame_sdl2_7display_17get_surface, METH_NOARGS, 0}; static PyObject *__pyx_pw_11pygame_sdl2_7display_17get_surface(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("get_surface (wrapper)", 0); __pyx_r = __pyx_pf_11pygame_sdl2_7display_16get_surface(__pyx_self); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_7display_16get_surface(CYTHON_UNUSED PyObject *__pyx_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; int __pyx_t_2; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; PyObject *__pyx_t_5 = NULL; __Pyx_RefNannySetupContext("get_surface", 0); /* "pygame_sdl2/display.pyx":448 * * def get_surface(): * if main_window is None: # <<<<<<<<<<<<<< * return None * */ __pyx_t_1 = (((PyObject *)__pyx_v_11pygame_sdl2_7display_main_window) == Py_None); __pyx_t_2 = (__pyx_t_1 != 0); if (__pyx_t_2) { /* "pygame_sdl2/display.pyx":449 * def get_surface(): * if main_window is None: * return None # <<<<<<<<<<<<<< * * return main_window.get_surface() */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(Py_None); __pyx_r = Py_None; goto __pyx_L0; /* "pygame_sdl2/display.pyx":448 * * def get_surface(): * if main_window is None: # <<<<<<<<<<<<<< * return None * */ } /* "pygame_sdl2/display.pyx":451 * return None * * return main_window.get_surface() # <<<<<<<<<<<<<< * * def get_window(): */ __Pyx_XDECREF(__pyx_r); __pyx_t_4 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_11pygame_sdl2_7display_main_window), __pyx_n_s_get_surface); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 451, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_5 = NULL; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_4))) { __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4); if (likely(__pyx_t_5)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4); __Pyx_INCREF(__pyx_t_5); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_4, function); } } if (__pyx_t_5) { __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_5); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 451, __pyx_L1_error) __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; } else { __pyx_t_3 = __Pyx_PyObject_CallNoArg(__pyx_t_4); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 451, __pyx_L1_error) } __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_r = __pyx_t_3; __pyx_t_3 = 0; goto __pyx_L0; /* "pygame_sdl2/display.pyx":447 * return main_window.surface * * def get_surface(): # <<<<<<<<<<<<<< * if main_window is None: * return None */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_5); __Pyx_AddTraceback("pygame_sdl2.display.get_surface", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/display.pyx":453 * return main_window.get_surface() * * def get_window(): # <<<<<<<<<<<<<< * """ * Returns the Window created by set_mode, or None if no such window */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_7display_19get_window(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused); /*proto*/ static char __pyx_doc_11pygame_sdl2_7display_18get_window[] = "\n Returns the Window created by set_mode, or None if no such window\n exists.\n "; static PyMethodDef __pyx_mdef_11pygame_sdl2_7display_19get_window = {"get_window", (PyCFunction)__pyx_pw_11pygame_sdl2_7display_19get_window, METH_NOARGS, __pyx_doc_11pygame_sdl2_7display_18get_window}; static PyObject *__pyx_pw_11pygame_sdl2_7display_19get_window(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("get_window (wrapper)", 0); __pyx_r = __pyx_pf_11pygame_sdl2_7display_18get_window(__pyx_self); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_7display_18get_window(CYTHON_UNUSED PyObject *__pyx_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("get_window", 0); /* "pygame_sdl2/display.pyx":459 * """ * * return main_window # <<<<<<<<<<<<<< * * def flip(): */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(((PyObject *)__pyx_v_11pygame_sdl2_7display_main_window)); __pyx_r = ((PyObject *)__pyx_v_11pygame_sdl2_7display_main_window); goto __pyx_L0; /* "pygame_sdl2/display.pyx":453 * return main_window.get_surface() * * def get_window(): # <<<<<<<<<<<<<< * """ * Returns the Window created by set_mode, or None if no such window */ /* function exit code */ __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/display.pyx":461 * return main_window * * def flip(): # <<<<<<<<<<<<<< * if main_window: * main_window.flip() */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_7display_21flip(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused); /*proto*/ static PyMethodDef __pyx_mdef_11pygame_sdl2_7display_21flip = {"flip", (PyCFunction)__pyx_pw_11pygame_sdl2_7display_21flip, METH_NOARGS, 0}; static PyObject *__pyx_pw_11pygame_sdl2_7display_21flip(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("flip (wrapper)", 0); __pyx_r = __pyx_pf_11pygame_sdl2_7display_20flip(__pyx_self); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_7display_20flip(CYTHON_UNUSED PyObject *__pyx_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; __Pyx_RefNannySetupContext("flip", 0); /* "pygame_sdl2/display.pyx":462 * * def flip(): * if main_window: # <<<<<<<<<<<<<< * main_window.flip() * */ __pyx_t_1 = __Pyx_PyObject_IsTrue(((PyObject *)__pyx_v_11pygame_sdl2_7display_main_window)); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(0, 462, __pyx_L1_error) if (__pyx_t_1) { /* "pygame_sdl2/display.pyx":463 * def flip(): * if main_window: * main_window.flip() # <<<<<<<<<<<<<< * * def update(rectangles=None): */ __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_11pygame_sdl2_7display_main_window), __pyx_n_s_flip); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 463, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = NULL; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) { __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3); if (likely(__pyx_t_4)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); __Pyx_INCREF(__pyx_t_4); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_3, function); } } if (__pyx_t_4) { __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 463, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; } else { __pyx_t_2 = __Pyx_PyObject_CallNoArg(__pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 463, __pyx_L1_error) } __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "pygame_sdl2/display.pyx":462 * * def flip(): * if main_window: # <<<<<<<<<<<<<< * main_window.flip() * */ } /* "pygame_sdl2/display.pyx":461 * return main_window * * def flip(): # <<<<<<<<<<<<<< * if main_window: * main_window.flip() */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_AddTraceback("pygame_sdl2.display.flip", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/display.pyx":465 * main_window.flip() * * def update(rectangles=None): # <<<<<<<<<<<<<< * if main_window: * main_window.update(rectangles) */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_7display_23update(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static PyMethodDef __pyx_mdef_11pygame_sdl2_7display_23update = {"update", (PyCFunction)__pyx_pw_11pygame_sdl2_7display_23update, METH_VARARGS|METH_KEYWORDS, 0}; static PyObject *__pyx_pw_11pygame_sdl2_7display_23update(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_rectangles = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("update (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_rectangles,0}; PyObject* values[1] = {0}; values[0] = ((PyObject *)Py_None); if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (kw_args > 0) { PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_rectangles); if (value) { values[0] = value; kw_args--; } } } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "update") < 0)) __PYX_ERR(0, 465, __pyx_L3_error) } } else { switch (PyTuple_GET_SIZE(__pyx_args)) { case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); case 0: break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_rectangles = values[0]; } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("update", 0, 0, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 465, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("pygame_sdl2.display.update", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_11pygame_sdl2_7display_22update(__pyx_self, __pyx_v_rectangles); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_7display_22update(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_rectangles) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; PyObject *__pyx_t_5 = NULL; __Pyx_RefNannySetupContext("update", 0); /* "pygame_sdl2/display.pyx":466 * * def update(rectangles=None): * if main_window: # <<<<<<<<<<<<<< * main_window.update(rectangles) * */ __pyx_t_1 = __Pyx_PyObject_IsTrue(((PyObject *)__pyx_v_11pygame_sdl2_7display_main_window)); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(0, 466, __pyx_L1_error) if (__pyx_t_1) { /* "pygame_sdl2/display.pyx":467 * def update(rectangles=None): * if main_window: * main_window.update(rectangles) # <<<<<<<<<<<<<< * * def get_driver(): */ __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_11pygame_sdl2_7display_main_window), __pyx_n_s_update); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 467, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = NULL; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) { __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3); if (likely(__pyx_t_4)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); __Pyx_INCREF(__pyx_t_4); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_3, function); } } if (!__pyx_t_4) { __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_v_rectangles); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 467, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); } else { #if CYTHON_FAST_PYCALL if (PyFunction_Check(__pyx_t_3)) { PyObject *__pyx_temp[2] = {__pyx_t_4, __pyx_v_rectangles}; __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_3, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 467, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_GOTREF(__pyx_t_2); } else #endif #if CYTHON_FAST_PYCCALL if (__Pyx_PyFastCFunction_Check(__pyx_t_3)) { PyObject *__pyx_temp[2] = {__pyx_t_4, __pyx_v_rectangles}; __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 467, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_GOTREF(__pyx_t_2); } else #endif { __pyx_t_5 = PyTuple_New(1+1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 467, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_4); __pyx_t_4 = NULL; __Pyx_INCREF(__pyx_v_rectangles); __Pyx_GIVEREF(__pyx_v_rectangles); PyTuple_SET_ITEM(__pyx_t_5, 0+1, __pyx_v_rectangles); __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_5, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 467, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; } } __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "pygame_sdl2/display.pyx":466 * * def update(rectangles=None): * if main_window: # <<<<<<<<<<<<<< * main_window.update(rectangles) * */ } /* "pygame_sdl2/display.pyx":465 * main_window.flip() * * def update(rectangles=None): # <<<<<<<<<<<<<< * if main_window: * main_window.update(rectangles) */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_5); __Pyx_AddTraceback("pygame_sdl2.display.update", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/display.pyx":469 * main_window.update(rectangles) * * def get_driver(): # <<<<<<<<<<<<<< * cdef const char *driver = SDL_GetCurrentVideoDriver() * */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_7display_25get_driver(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused); /*proto*/ static PyMethodDef __pyx_mdef_11pygame_sdl2_7display_25get_driver = {"get_driver", (PyCFunction)__pyx_pw_11pygame_sdl2_7display_25get_driver, METH_NOARGS, 0}; static PyObject *__pyx_pw_11pygame_sdl2_7display_25get_driver(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("get_driver (wrapper)", 0); __pyx_r = __pyx_pf_11pygame_sdl2_7display_24get_driver(__pyx_self); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_7display_24get_driver(CYTHON_UNUSED PyObject *__pyx_self) { char const *__pyx_v_driver; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; __Pyx_RefNannySetupContext("get_driver", 0); /* "pygame_sdl2/display.pyx":470 * * def get_driver(): * cdef const char *driver = SDL_GetCurrentVideoDriver() # <<<<<<<<<<<<<< * * if driver == NULL: */ __pyx_v_driver = SDL_GetCurrentVideoDriver(); /* "pygame_sdl2/display.pyx":472 * cdef const char *driver = SDL_GetCurrentVideoDriver() * * if driver == NULL: # <<<<<<<<<<<<<< * raise error() * */ __pyx_t_1 = ((__pyx_v_driver == NULL) != 0); if (__pyx_t_1) { /* "pygame_sdl2/display.pyx":473 * * if driver == NULL: * raise error() # <<<<<<<<<<<<<< * * return driver */ __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_error); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 473, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = NULL; if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) { __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3); if (likely(__pyx_t_4)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); __Pyx_INCREF(__pyx_t_4); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_3, function); } } if (__pyx_t_4) { __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 473, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; } else { __pyx_t_2 = __Pyx_PyObject_CallNoArg(__pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 473, __pyx_L1_error) } __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_Raise(__pyx_t_2, 0, 0, 0); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __PYX_ERR(0, 473, __pyx_L1_error) /* "pygame_sdl2/display.pyx":472 * cdef const char *driver = SDL_GetCurrentVideoDriver() * * if driver == NULL: # <<<<<<<<<<<<<< * raise error() * */ } /* "pygame_sdl2/display.pyx":475 * raise error() * * return driver # <<<<<<<<<<<<<< * * class Info(object): */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __Pyx_PyBytes_FromString(__pyx_v_driver); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 475, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; /* "pygame_sdl2/display.pyx":469 * main_window.update(rectangles) * * def get_driver(): # <<<<<<<<<<<<<< * cdef const char *driver = SDL_GetCurrentVideoDriver() * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_AddTraceback("pygame_sdl2.display.get_driver", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/display.pyx":479 * class Info(object): * * def __init__(self): # <<<<<<<<<<<<<< * cdef SDL_DisplayMode dm * cdef SDL_PixelFormat *format */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_7display_4Info_1__init__(PyObject *__pyx_self, PyObject *__pyx_v_self); /*proto*/ static PyMethodDef __pyx_mdef_11pygame_sdl2_7display_4Info_1__init__ = {"__init__", (PyCFunction)__pyx_pw_11pygame_sdl2_7display_4Info_1__init__, METH_O, 0}; static PyObject *__pyx_pw_11pygame_sdl2_7display_4Info_1__init__(PyObject *__pyx_self, PyObject *__pyx_v_self) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__init__ (wrapper)", 0); __pyx_r = __pyx_pf_11pygame_sdl2_7display_4Info___init__(__pyx_self, ((PyObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_7display_4Info___init__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self) { SDL_DisplayMode __pyx_v_dm; SDL_PixelFormat *__pyx_v_format; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; PyObject *__pyx_t_5 = NULL; PyObject *__pyx_t_6 = NULL; PyObject *(*__pyx_t_7)(PyObject *); __Pyx_RefNannySetupContext("__init__", 0); /* "pygame_sdl2/display.pyx":483 * cdef SDL_PixelFormat *format * * if SDL_GetCurrentDisplayMode(0, &dm): # <<<<<<<<<<<<<< * raise error() * */ __pyx_t_1 = (SDL_GetCurrentDisplayMode(0, (&__pyx_v_dm)) != 0); if (__pyx_t_1) { /* "pygame_sdl2/display.pyx":484 * * if SDL_GetCurrentDisplayMode(0, &dm): * raise error() # <<<<<<<<<<<<<< * * format = SDL_AllocFormat(dm.format) */ __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_error); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 484, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = NULL; if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) { __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3); if (likely(__pyx_t_4)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); __Pyx_INCREF(__pyx_t_4); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_3, function); } } if (__pyx_t_4) { __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 484, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; } else { __pyx_t_2 = __Pyx_PyObject_CallNoArg(__pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 484, __pyx_L1_error) } __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_Raise(__pyx_t_2, 0, 0, 0); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __PYX_ERR(0, 484, __pyx_L1_error) /* "pygame_sdl2/display.pyx":483 * cdef SDL_PixelFormat *format * * if SDL_GetCurrentDisplayMode(0, &dm): # <<<<<<<<<<<<<< * raise error() * */ } /* "pygame_sdl2/display.pyx":486 * raise error() * * format = SDL_AllocFormat(dm.format) # <<<<<<<<<<<<<< * if format == NULL: * raise error() */ __pyx_v_format = SDL_AllocFormat(__pyx_v_dm.format); /* "pygame_sdl2/display.pyx":487 * * format = SDL_AllocFormat(dm.format) * if format == NULL: # <<<<<<<<<<<<<< * raise error() * */ __pyx_t_1 = ((__pyx_v_format == NULL) != 0); if (__pyx_t_1) { /* "pygame_sdl2/display.pyx":488 * format = SDL_AllocFormat(dm.format) * if format == NULL: * raise error() # <<<<<<<<<<<<<< * * self.bitsize = format.BitsPerPixel */ __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_error); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 488, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = NULL; if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) { __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3); if (likely(__pyx_t_4)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); __Pyx_INCREF(__pyx_t_4); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_3, function); } } if (__pyx_t_4) { __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 488, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; } else { __pyx_t_2 = __Pyx_PyObject_CallNoArg(__pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 488, __pyx_L1_error) } __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_Raise(__pyx_t_2, 0, 0, 0); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __PYX_ERR(0, 488, __pyx_L1_error) /* "pygame_sdl2/display.pyx":487 * * format = SDL_AllocFormat(dm.format) * if format == NULL: # <<<<<<<<<<<<<< * raise error() * */ } /* "pygame_sdl2/display.pyx":490 * raise error() * * self.bitsize = format.BitsPerPixel # <<<<<<<<<<<<<< * self.bytesize = format.BytesPerPixel * */ __pyx_t_2 = __Pyx_PyInt_From_uint8_t(__pyx_v_format->BitsPerPixel); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 490, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_bitsize, __pyx_t_2) < 0) __PYX_ERR(0, 490, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "pygame_sdl2/display.pyx":491 * * self.bitsize = format.BitsPerPixel * self.bytesize = format.BytesPerPixel # <<<<<<<<<<<<<< * * self.masks = ( */ __pyx_t_2 = __Pyx_PyInt_From_uint8_t(__pyx_v_format->BytesPerPixel); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 491, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_bytesize, __pyx_t_2) < 0) __PYX_ERR(0, 491, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "pygame_sdl2/display.pyx":494 * * self.masks = ( * format.Rmask, # <<<<<<<<<<<<<< * format.Gmask, * format.Bmask, */ __pyx_t_2 = __Pyx_PyInt_From_uint32_t(__pyx_v_format->Rmask); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 494, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); /* "pygame_sdl2/display.pyx":495 * self.masks = ( * format.Rmask, * format.Gmask, # <<<<<<<<<<<<<< * format.Bmask, * format.Amask, */ __pyx_t_3 = __Pyx_PyInt_From_uint32_t(__pyx_v_format->Gmask); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 495, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); /* "pygame_sdl2/display.pyx":496 * format.Rmask, * format.Gmask, * format.Bmask, # <<<<<<<<<<<<<< * format.Amask, * ) */ __pyx_t_4 = __Pyx_PyInt_From_uint32_t(__pyx_v_format->Bmask); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 496, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); /* "pygame_sdl2/display.pyx":497 * format.Gmask, * format.Bmask, * format.Amask, # <<<<<<<<<<<<<< * ) * */ __pyx_t_5 = __Pyx_PyInt_From_uint32_t(__pyx_v_format->Amask); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 497, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); /* "pygame_sdl2/display.pyx":494 * * self.masks = ( * format.Rmask, # <<<<<<<<<<<<<< * format.Gmask, * format.Bmask, */ __pyx_t_6 = PyTuple_New(4); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 494, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_GIVEREF(__pyx_t_2); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_2); __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_6, 1, __pyx_t_3); __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_6, 2, __pyx_t_4); __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_6, 3, __pyx_t_5); __pyx_t_2 = 0; __pyx_t_3 = 0; __pyx_t_4 = 0; __pyx_t_5 = 0; /* "pygame_sdl2/display.pyx":493 * self.bytesize = format.BytesPerPixel * * self.masks = ( # <<<<<<<<<<<<<< * format.Rmask, * format.Gmask, */ if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_masks, __pyx_t_6) < 0) __PYX_ERR(0, 493, __pyx_L1_error) __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; /* "pygame_sdl2/display.pyx":501 * * self.shifts = ( * format.Rshift, # <<<<<<<<<<<<<< * format.Gshift, * format.Bshift, */ __pyx_t_6 = __Pyx_PyInt_From_uint8_t(__pyx_v_format->Rshift); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 501, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); /* "pygame_sdl2/display.pyx":502 * self.shifts = ( * format.Rshift, * format.Gshift, # <<<<<<<<<<<<<< * format.Bshift, * format.Ashift, */ __pyx_t_5 = __Pyx_PyInt_From_uint8_t(__pyx_v_format->Gshift); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 502, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); /* "pygame_sdl2/display.pyx":503 * format.Rshift, * format.Gshift, * format.Bshift, # <<<<<<<<<<<<<< * format.Ashift, * ) */ __pyx_t_4 = __Pyx_PyInt_From_uint8_t(__pyx_v_format->Bshift); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 503, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); /* "pygame_sdl2/display.pyx":504 * format.Gshift, * format.Bshift, * format.Ashift, # <<<<<<<<<<<<<< * ) * */ __pyx_t_3 = __Pyx_PyInt_From_uint8_t(__pyx_v_format->Ashift); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 504, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); /* "pygame_sdl2/display.pyx":501 * * self.shifts = ( * format.Rshift, # <<<<<<<<<<<<<< * format.Gshift, * format.Bshift, */ __pyx_t_2 = PyTuple_New(4); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 501, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_GIVEREF(__pyx_t_6); PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_6); __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_t_5); __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_2, 2, __pyx_t_4); __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_2, 3, __pyx_t_3); __pyx_t_6 = 0; __pyx_t_5 = 0; __pyx_t_4 = 0; __pyx_t_3 = 0; /* "pygame_sdl2/display.pyx":500 * ) * * self.shifts = ( # <<<<<<<<<<<<<< * format.Rshift, * format.Gshift, */ if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_shifts, __pyx_t_2) < 0) __PYX_ERR(0, 500, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "pygame_sdl2/display.pyx":508 * * self.losses = ( * format.Rloss, # <<<<<<<<<<<<<< * format.Gloss, * format.Bloss, */ __pyx_t_2 = __Pyx_PyInt_From_uint8_t(__pyx_v_format->Rloss); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 508, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); /* "pygame_sdl2/display.pyx":509 * self.losses = ( * format.Rloss, * format.Gloss, # <<<<<<<<<<<<<< * format.Bloss, * format.Aloss, */ __pyx_t_3 = __Pyx_PyInt_From_uint8_t(__pyx_v_format->Gloss); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 509, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); /* "pygame_sdl2/display.pyx":510 * format.Rloss, * format.Gloss, * format.Bloss, # <<<<<<<<<<<<<< * format.Aloss, * ) */ __pyx_t_4 = __Pyx_PyInt_From_uint8_t(__pyx_v_format->Bloss); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 510, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); /* "pygame_sdl2/display.pyx":511 * format.Gloss, * format.Bloss, * format.Aloss, # <<<<<<<<<<<<<< * ) * */ __pyx_t_5 = __Pyx_PyInt_From_uint8_t(__pyx_v_format->Aloss); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 511, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); /* "pygame_sdl2/display.pyx":508 * * self.losses = ( * format.Rloss, # <<<<<<<<<<<<<< * format.Gloss, * format.Bloss, */ __pyx_t_6 = PyTuple_New(4); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 508, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_GIVEREF(__pyx_t_2); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_2); __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_6, 1, __pyx_t_3); __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_6, 2, __pyx_t_4); __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_6, 3, __pyx_t_5); __pyx_t_2 = 0; __pyx_t_3 = 0; __pyx_t_4 = 0; __pyx_t_5 = 0; /* "pygame_sdl2/display.pyx":507 * ) * * self.losses = ( # <<<<<<<<<<<<<< * format.Rloss, * format.Gloss, */ if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_losses, __pyx_t_6) < 0) __PYX_ERR(0, 507, __pyx_L1_error) __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; /* "pygame_sdl2/display.pyx":514 * ) * * SDL_FreeFormat(format) # <<<<<<<<<<<<<< * * if main_window: */ SDL_FreeFormat(__pyx_v_format); /* "pygame_sdl2/display.pyx":516 * SDL_FreeFormat(format) * * if main_window: # <<<<<<<<<<<<<< * self.current_w, self.current_h = main_window.surface.get_size() * else: */ __pyx_t_1 = __Pyx_PyObject_IsTrue(((PyObject *)__pyx_v_11pygame_sdl2_7display_main_window)); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(0, 516, __pyx_L1_error) if (__pyx_t_1) { /* "pygame_sdl2/display.pyx":517 * * if main_window: * self.current_w, self.current_h = main_window.surface.get_size() # <<<<<<<<<<<<<< * else: * */ __pyx_t_5 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_11pygame_sdl2_7display_main_window->surface), __pyx_n_s_get_size); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 517, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_4 = NULL; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_5))) { __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_5); if (likely(__pyx_t_4)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5); __Pyx_INCREF(__pyx_t_4); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_5, function); } } if (__pyx_t_4) { __pyx_t_6 = __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_t_4); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 517, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; } else { __pyx_t_6 = __Pyx_PyObject_CallNoArg(__pyx_t_5); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 517, __pyx_L1_error) } __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; if ((likely(PyTuple_CheckExact(__pyx_t_6))) || (PyList_CheckExact(__pyx_t_6))) { PyObject* sequence = __pyx_t_6; #if !CYTHON_COMPILING_IN_PYPY Py_ssize_t size = Py_SIZE(sequence); #else Py_ssize_t size = PySequence_Size(sequence); #endif if (unlikely(size != 2)) { if (size > 2) __Pyx_RaiseTooManyValuesError(2); else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); __PYX_ERR(0, 517, __pyx_L1_error) } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS if (likely(PyTuple_CheckExact(sequence))) { __pyx_t_5 = PyTuple_GET_ITEM(sequence, 0); __pyx_t_4 = PyTuple_GET_ITEM(sequence, 1); } else { __pyx_t_5 = PyList_GET_ITEM(sequence, 0); __pyx_t_4 = PyList_GET_ITEM(sequence, 1); } __Pyx_INCREF(__pyx_t_5); __Pyx_INCREF(__pyx_t_4); #else __pyx_t_5 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 517, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_4 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 517, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); #endif __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; } else { Py_ssize_t index = -1; __pyx_t_3 = PyObject_GetIter(__pyx_t_6); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 517, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __pyx_t_7 = Py_TYPE(__pyx_t_3)->tp_iternext; index = 0; __pyx_t_5 = __pyx_t_7(__pyx_t_3); if (unlikely(!__pyx_t_5)) goto __pyx_L6_unpacking_failed; __Pyx_GOTREF(__pyx_t_5); index = 1; __pyx_t_4 = __pyx_t_7(__pyx_t_3); if (unlikely(!__pyx_t_4)) goto __pyx_L6_unpacking_failed; __Pyx_GOTREF(__pyx_t_4); if (__Pyx_IternextUnpackEndCheck(__pyx_t_7(__pyx_t_3), 2) < 0) __PYX_ERR(0, 517, __pyx_L1_error) __pyx_t_7 = NULL; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; goto __pyx_L7_unpacking_done; __pyx_L6_unpacking_failed:; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_7 = NULL; if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); __PYX_ERR(0, 517, __pyx_L1_error) __pyx_L7_unpacking_done:; } if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_current_w, __pyx_t_5) < 0) __PYX_ERR(0, 517, __pyx_L1_error) __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_current_h, __pyx_t_4) < 0) __PYX_ERR(0, 517, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; /* "pygame_sdl2/display.pyx":516 * SDL_FreeFormat(format) * * if main_window: # <<<<<<<<<<<<<< * self.current_w, self.current_h = main_window.surface.get_size() * else: */ goto __pyx_L5; } /* "pygame_sdl2/display.pyx":520 * else: * * self.current_w = dm.w # <<<<<<<<<<<<<< * self.current_h = dm.h * */ /*else*/ { __pyx_t_6 = __Pyx_PyInt_From_int(__pyx_v_dm.w); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 520, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_current_w, __pyx_t_6) < 0) __PYX_ERR(0, 520, __pyx_L1_error) __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; /* "pygame_sdl2/display.pyx":521 * * self.current_w = dm.w * self.current_h = dm.h # <<<<<<<<<<<<<< * * self.refresh_rate = dm.refresh_rate */ __pyx_t_6 = __Pyx_PyInt_From_int(__pyx_v_dm.h); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 521, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_current_h, __pyx_t_6) < 0) __PYX_ERR(0, 521, __pyx_L1_error) __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; } __pyx_L5:; /* "pygame_sdl2/display.pyx":523 * self.current_h = dm.h * * self.refresh_rate = dm.refresh_rate # <<<<<<<<<<<<<< * * # The rest of these are just guesses. */ __pyx_t_6 = __Pyx_PyInt_From_int(__pyx_v_dm.refresh_rate); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 523, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_refresh_rate, __pyx_t_6) < 0) __PYX_ERR(0, 523, __pyx_L1_error) __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; /* "pygame_sdl2/display.pyx":526 * * # The rest of these are just guesses. * self.hw = False # <<<<<<<<<<<<<< * self.wm = True * self.video_mem = 256 * 1024 * 1024 */ if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_hw, Py_False) < 0) __PYX_ERR(0, 526, __pyx_L1_error) /* "pygame_sdl2/display.pyx":527 * # The rest of these are just guesses. * self.hw = False * self.wm = True # <<<<<<<<<<<<<< * self.video_mem = 256 * 1024 * 1024 * */ if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_wm, Py_True) < 0) __PYX_ERR(0, 527, __pyx_L1_error) /* "pygame_sdl2/display.pyx":528 * self.hw = False * self.wm = True * self.video_mem = 256 * 1024 * 1024 # <<<<<<<<<<<<<< * * self.blit_hw = False */ if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_video_mem, __pyx_int_268435456) < 0) __PYX_ERR(0, 528, __pyx_L1_error) /* "pygame_sdl2/display.pyx":530 * self.video_mem = 256 * 1024 * 1024 * * self.blit_hw = False # <<<<<<<<<<<<<< * self.blit_hw_CC = False * self.blit_hw_A = False */ if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_blit_hw, Py_False) < 0) __PYX_ERR(0, 530, __pyx_L1_error) /* "pygame_sdl2/display.pyx":531 * * self.blit_hw = False * self.blit_hw_CC = False # <<<<<<<<<<<<<< * self.blit_hw_A = False * */ if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_blit_hw_CC, Py_False) < 0) __PYX_ERR(0, 531, __pyx_L1_error) /* "pygame_sdl2/display.pyx":532 * self.blit_hw = False * self.blit_hw_CC = False * self.blit_hw_A = False # <<<<<<<<<<<<<< * * self.blit_sw = False */ if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_blit_hw_A, Py_False) < 0) __PYX_ERR(0, 532, __pyx_L1_error) /* "pygame_sdl2/display.pyx":534 * self.blit_hw_A = False * * self.blit_sw = False # <<<<<<<<<<<<<< * self.blit_sw_CC = False * self.blit_sw_A = False */ if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_blit_sw, Py_False) < 0) __PYX_ERR(0, 534, __pyx_L1_error) /* "pygame_sdl2/display.pyx":535 * * self.blit_sw = False * self.blit_sw_CC = False # <<<<<<<<<<<<<< * self.blit_sw_A = False * */ if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_blit_sw_CC, Py_False) < 0) __PYX_ERR(0, 535, __pyx_L1_error) /* "pygame_sdl2/display.pyx":536 * self.blit_sw = False * self.blit_sw_CC = False * self.blit_sw_A = False # <<<<<<<<<<<<<< * * def __repr__(self): */ if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_blit_sw_A, Py_False) < 0) __PYX_ERR(0, 536, __pyx_L1_error) /* "pygame_sdl2/display.pyx":479 * class Info(object): * * def __init__(self): # <<<<<<<<<<<<<< * cdef SDL_DisplayMode dm * cdef SDL_PixelFormat *format */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_5); __Pyx_XDECREF(__pyx_t_6); __Pyx_AddTraceback("pygame_sdl2.display.Info.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/display.pyx":538 * self.blit_sw_A = False * * def __repr__(self): # <<<<<<<<<<<<<< * return "".format(self.__dict__) * */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_7display_4Info_3__repr__(PyObject *__pyx_self, PyObject *__pyx_v_self); /*proto*/ static PyMethodDef __pyx_mdef_11pygame_sdl2_7display_4Info_3__repr__ = {"__repr__", (PyCFunction)__pyx_pw_11pygame_sdl2_7display_4Info_3__repr__, METH_O, 0}; static PyObject *__pyx_pw_11pygame_sdl2_7display_4Info_3__repr__(PyObject *__pyx_self, PyObject *__pyx_v_self) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__repr__ (wrapper)", 0); __pyx_r = __pyx_pf_11pygame_sdl2_7display_4Info_2__repr__(__pyx_self, ((PyObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_7display_4Info_2__repr__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; PyObject *__pyx_t_5 = NULL; __Pyx_RefNannySetupContext("__repr__", 0); /* "pygame_sdl2/display.pyx":539 * * def __repr__(self): * return "".format(self.__dict__) # <<<<<<<<<<<<<< * * */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_kp_u_Info_r, __pyx_n_s_format); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 539, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_dict); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 539, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = NULL; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) { __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_2); if (likely(__pyx_t_4)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_4); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); } } if (!__pyx_t_4) { __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 539, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_GOTREF(__pyx_t_1); } else { #if CYTHON_FAST_PYCALL if (PyFunction_Check(__pyx_t_2)) { PyObject *__pyx_temp[2] = {__pyx_t_4, __pyx_t_3}; __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_2, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 539, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } else #endif #if CYTHON_FAST_PYCCALL if (__Pyx_PyFastCFunction_Check(__pyx_t_2)) { PyObject *__pyx_temp[2] = {__pyx_t_4, __pyx_t_3}; __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_2, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 539, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } else #endif { __pyx_t_5 = PyTuple_New(1+1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 539, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_4); __pyx_t_4 = NULL; __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_5, 0+1, __pyx_t_3); __pyx_t_3 = 0; __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_5, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 539, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; } } __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "pygame_sdl2/display.pyx":538 * self.blit_sw_A = False * * def __repr__(self): # <<<<<<<<<<<<<< * return "".format(self.__dict__) * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_5); __Pyx_AddTraceback("pygame_sdl2.display.Info.__repr__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/display.pyx":542 * * * def get_wm_info(): # <<<<<<<<<<<<<< * if main_window: * return main_window.get_wm_info() */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_7display_27get_wm_info(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused); /*proto*/ static PyMethodDef __pyx_mdef_11pygame_sdl2_7display_27get_wm_info = {"get_wm_info", (PyCFunction)__pyx_pw_11pygame_sdl2_7display_27get_wm_info, METH_NOARGS, 0}; static PyObject *__pyx_pw_11pygame_sdl2_7display_27get_wm_info(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("get_wm_info (wrapper)", 0); __pyx_r = __pyx_pf_11pygame_sdl2_7display_26get_wm_info(__pyx_self); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_7display_26get_wm_info(CYTHON_UNUSED PyObject *__pyx_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; __Pyx_RefNannySetupContext("get_wm_info", 0); /* "pygame_sdl2/display.pyx":543 * * def get_wm_info(): * if main_window: # <<<<<<<<<<<<<< * return main_window.get_wm_info() * */ __pyx_t_1 = __Pyx_PyObject_IsTrue(((PyObject *)__pyx_v_11pygame_sdl2_7display_main_window)); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(0, 543, __pyx_L1_error) if (__pyx_t_1) { /* "pygame_sdl2/display.pyx":544 * def get_wm_info(): * if main_window: * return main_window.get_wm_info() # <<<<<<<<<<<<<< * * return {} */ __Pyx_XDECREF(__pyx_r); __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_11pygame_sdl2_7display_main_window), __pyx_n_s_get_wm_info); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 544, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = NULL; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) { __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3); if (likely(__pyx_t_4)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); __Pyx_INCREF(__pyx_t_4); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_3, function); } } if (__pyx_t_4) { __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 544, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; } else { __pyx_t_2 = __Pyx_PyObject_CallNoArg(__pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 544, __pyx_L1_error) } __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; /* "pygame_sdl2/display.pyx":543 * * def get_wm_info(): * if main_window: # <<<<<<<<<<<<<< * return main_window.get_wm_info() * */ } /* "pygame_sdl2/display.pyx":546 * return main_window.get_wm_info() * * return {} # <<<<<<<<<<<<<< * * */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = PyDict_New(); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 546, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; /* "pygame_sdl2/display.pyx":542 * * * def get_wm_info(): # <<<<<<<<<<<<<< * if main_window: * return main_window.get_wm_info() */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_AddTraceback("pygame_sdl2.display.get_wm_info", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/display.pyx":549 * * * def get_num_video_displays(): # <<<<<<<<<<<<<< * """ * Returns the number of video displays connected to the system. */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_7display_29get_num_video_displays(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused); /*proto*/ static char __pyx_doc_11pygame_sdl2_7display_28get_num_video_displays[] = "\n Returns the number of video displays connected to the system.\n "; static PyMethodDef __pyx_mdef_11pygame_sdl2_7display_29get_num_video_displays = {"get_num_video_displays", (PyCFunction)__pyx_pw_11pygame_sdl2_7display_29get_num_video_displays, METH_NOARGS, __pyx_doc_11pygame_sdl2_7display_28get_num_video_displays}; static PyObject *__pyx_pw_11pygame_sdl2_7display_29get_num_video_displays(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("get_num_video_displays (wrapper)", 0); __pyx_r = __pyx_pf_11pygame_sdl2_7display_28get_num_video_displays(__pyx_self); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_7display_28get_num_video_displays(CYTHON_UNUSED PyObject *__pyx_self) { int __pyx_v_rv; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; __Pyx_RefNannySetupContext("get_num_video_displays", 0); /* "pygame_sdl2/display.pyx":554 * """ * * rv = SDL_GetNumVideoDisplays() # <<<<<<<<<<<<<< * * if rv < 0: */ __pyx_v_rv = SDL_GetNumVideoDisplays(); /* "pygame_sdl2/display.pyx":556 * rv = SDL_GetNumVideoDisplays() * * if rv < 0: # <<<<<<<<<<<<<< * raise error() * */ __pyx_t_1 = ((__pyx_v_rv < 0) != 0); if (__pyx_t_1) { /* "pygame_sdl2/display.pyx":557 * * if rv < 0: * raise error() # <<<<<<<<<<<<<< * * return rv */ __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_error); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 557, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = NULL; if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) { __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3); if (likely(__pyx_t_4)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); __Pyx_INCREF(__pyx_t_4); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_3, function); } } if (__pyx_t_4) { __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 557, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; } else { __pyx_t_2 = __Pyx_PyObject_CallNoArg(__pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 557, __pyx_L1_error) } __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_Raise(__pyx_t_2, 0, 0, 0); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __PYX_ERR(0, 557, __pyx_L1_error) /* "pygame_sdl2/display.pyx":556 * rv = SDL_GetNumVideoDisplays() * * if rv < 0: # <<<<<<<<<<<<<< * raise error() * */ } /* "pygame_sdl2/display.pyx":559 * raise error() * * return rv # <<<<<<<<<<<<<< * * */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_v_rv); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 559, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; /* "pygame_sdl2/display.pyx":549 * * * def get_num_video_displays(): # <<<<<<<<<<<<<< * """ * Returns the number of video displays connected to the system. */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_AddTraceback("pygame_sdl2.display.get_num_video_displays", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/display.pyx":562 * * * def list_modes(depth=0, flags=0, display=0): # <<<<<<<<<<<<<< * """ * Returns a list of possible display modes for the display `display`. */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_7display_31list_modes(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_11pygame_sdl2_7display_30list_modes[] = "\n Returns a list of possible display modes for the display `display`.\n\n `depth` and `flags` are ignored.\n "; static PyMethodDef __pyx_mdef_11pygame_sdl2_7display_31list_modes = {"list_modes", (PyCFunction)__pyx_pw_11pygame_sdl2_7display_31list_modes, METH_VARARGS|METH_KEYWORDS, __pyx_doc_11pygame_sdl2_7display_30list_modes}; static PyObject *__pyx_pw_11pygame_sdl2_7display_31list_modes(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { CYTHON_UNUSED PyObject *__pyx_v_depth = 0; CYTHON_UNUSED PyObject *__pyx_v_flags = 0; PyObject *__pyx_v_display = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("list_modes (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_depth,&__pyx_n_s_flags,&__pyx_n_s_display,0}; PyObject* values[3] = {0,0,0}; values[0] = ((PyObject *)__pyx_int_0); values[1] = ((PyObject *)__pyx_int_0); values[2] = ((PyObject *)__pyx_int_0); if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (kw_args > 0) { PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_depth); if (value) { values[0] = value; kw_args--; } } case 1: if (kw_args > 0) { PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_flags); if (value) { values[1] = value; kw_args--; } } case 2: if (kw_args > 0) { PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_display); if (value) { values[2] = value; kw_args--; } } } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "list_modes") < 0)) __PYX_ERR(0, 562, __pyx_L3_error) } } else { switch (PyTuple_GET_SIZE(__pyx_args)) { case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); case 0: break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_depth = values[0]; __pyx_v_flags = values[1]; __pyx_v_display = values[2]; } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("list_modes", 0, 0, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 562, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("pygame_sdl2.display.list_modes", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_11pygame_sdl2_7display_30list_modes(__pyx_self, __pyx_v_depth, __pyx_v_flags, __pyx_v_display); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_7display_30list_modes(CYTHON_UNUSED PyObject *__pyx_self, CYTHON_UNUSED PyObject *__pyx_v_depth, CYTHON_UNUSED PyObject *__pyx_v_flags, PyObject *__pyx_v_display) { int __pyx_v_num_modes; int __pyx_v_i; SDL_DisplayMode __pyx_v_mode; PyObject *__pyx_v_rv = NULL; PyObject *__pyx_v_t = NULL; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_t_2; int __pyx_t_3; PyObject *__pyx_t_4 = NULL; PyObject *__pyx_t_5 = NULL; int __pyx_t_6; int __pyx_t_7; int __pyx_t_8; __Pyx_RefNannySetupContext("list_modes", 0); /* "pygame_sdl2/display.pyx":572 * cdef SDL_DisplayMode mode * * rv = [ ] # <<<<<<<<<<<<<< * * num_modes = SDL_GetNumDisplayModes(display) */ __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 572, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_rv = ((PyObject*)__pyx_t_1); __pyx_t_1 = 0; /* "pygame_sdl2/display.pyx":574 * rv = [ ] * * num_modes = SDL_GetNumDisplayModes(display) # <<<<<<<<<<<<<< * if num_modes < 0: * raise error() */ __pyx_t_2 = __Pyx_PyInt_As_int(__pyx_v_display); if (unlikely((__pyx_t_2 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 574, __pyx_L1_error) __pyx_v_num_modes = SDL_GetNumDisplayModes(__pyx_t_2); /* "pygame_sdl2/display.pyx":575 * * num_modes = SDL_GetNumDisplayModes(display) * if num_modes < 0: # <<<<<<<<<<<<<< * raise error() * */ __pyx_t_3 = ((__pyx_v_num_modes < 0) != 0); if (__pyx_t_3) { /* "pygame_sdl2/display.pyx":576 * num_modes = SDL_GetNumDisplayModes(display) * if num_modes < 0: * raise error() # <<<<<<<<<<<<<< * * for 0 <= i < num_modes: */ __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_error); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 576, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_5 = NULL; if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_4))) { __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4); if (likely(__pyx_t_5)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4); __Pyx_INCREF(__pyx_t_5); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_4, function); } } if (__pyx_t_5) { __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_5); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 576, __pyx_L1_error) __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; } else { __pyx_t_1 = __Pyx_PyObject_CallNoArg(__pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 576, __pyx_L1_error) } __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_Raise(__pyx_t_1, 0, 0, 0); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __PYX_ERR(0, 576, __pyx_L1_error) /* "pygame_sdl2/display.pyx":575 * * num_modes = SDL_GetNumDisplayModes(display) * if num_modes < 0: # <<<<<<<<<<<<<< * raise error() * */ } /* "pygame_sdl2/display.pyx":578 * raise error() * * for 0 <= i < num_modes: # <<<<<<<<<<<<<< * if SDL_GetDisplayMode(display, i, &mode) == 0: * t = (mode.w, mode.h) */ __pyx_t_2 = __pyx_v_num_modes; for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_2; __pyx_v_i++) { /* "pygame_sdl2/display.pyx":579 * * for 0 <= i < num_modes: * if SDL_GetDisplayMode(display, i, &mode) == 0: # <<<<<<<<<<<<<< * t = (mode.w, mode.h) * if t not in rv: */ __pyx_t_6 = __Pyx_PyInt_As_int(__pyx_v_display); if (unlikely((__pyx_t_6 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 579, __pyx_L1_error) __pyx_t_3 = ((SDL_GetDisplayMode(__pyx_t_6, __pyx_v_i, (&__pyx_v_mode)) == 0) != 0); if (__pyx_t_3) { /* "pygame_sdl2/display.pyx":580 * for 0 <= i < num_modes: * if SDL_GetDisplayMode(display, i, &mode) == 0: * t = (mode.w, mode.h) # <<<<<<<<<<<<<< * if t not in rv: * rv.append(t) */ __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_mode.w); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 580, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_4 = __Pyx_PyInt_From_int(__pyx_v_mode.h); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 580, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_5 = PyTuple_New(2); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 580, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_GIVEREF(__pyx_t_1); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_1); __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_t_4); __pyx_t_1 = 0; __pyx_t_4 = 0; __Pyx_XDECREF_SET(__pyx_v_t, __pyx_t_5); __pyx_t_5 = 0; /* "pygame_sdl2/display.pyx":581 * if SDL_GetDisplayMode(display, i, &mode) == 0: * t = (mode.w, mode.h) * if t not in rv: # <<<<<<<<<<<<<< * rv.append(t) * */ __pyx_t_3 = (__Pyx_PySequence_ContainsTF(__pyx_v_t, __pyx_v_rv, Py_NE)); if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(0, 581, __pyx_L1_error) __pyx_t_7 = (__pyx_t_3 != 0); if (__pyx_t_7) { /* "pygame_sdl2/display.pyx":582 * t = (mode.w, mode.h) * if t not in rv: * rv.append(t) # <<<<<<<<<<<<<< * * return rv */ __pyx_t_8 = __Pyx_PyList_Append(__pyx_v_rv, __pyx_v_t); if (unlikely(__pyx_t_8 == -1)) __PYX_ERR(0, 582, __pyx_L1_error) /* "pygame_sdl2/display.pyx":581 * if SDL_GetDisplayMode(display, i, &mode) == 0: * t = (mode.w, mode.h) * if t not in rv: # <<<<<<<<<<<<<< * rv.append(t) * */ } /* "pygame_sdl2/display.pyx":579 * * for 0 <= i < num_modes: * if SDL_GetDisplayMode(display, i, &mode) == 0: # <<<<<<<<<<<<<< * t = (mode.w, mode.h) * if t not in rv: */ } } /* "pygame_sdl2/display.pyx":584 * rv.append(t) * * return rv # <<<<<<<<<<<<<< * * */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(__pyx_v_rv); __pyx_r = __pyx_v_rv; goto __pyx_L0; /* "pygame_sdl2/display.pyx":562 * * * def list_modes(depth=0, flags=0, display=0): # <<<<<<<<<<<<<< * """ * Returns a list of possible display modes for the display `display`. */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_5); __Pyx_AddTraceback("pygame_sdl2.display.list_modes", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF(__pyx_v_rv); __Pyx_XDECREF(__pyx_v_t); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/display.pyx":587 * * * def mode_ok(size, flags=0, depth=0): # <<<<<<<<<<<<<< * """ * Returns true if size is in the result of list_modes(). */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_7display_33mode_ok(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_11pygame_sdl2_7display_32mode_ok[] = "\n Returns true if size is in the result of list_modes().\n "; static PyMethodDef __pyx_mdef_11pygame_sdl2_7display_33mode_ok = {"mode_ok", (PyCFunction)__pyx_pw_11pygame_sdl2_7display_33mode_ok, METH_VARARGS|METH_KEYWORDS, __pyx_doc_11pygame_sdl2_7display_32mode_ok}; static PyObject *__pyx_pw_11pygame_sdl2_7display_33mode_ok(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_size = 0; CYTHON_UNUSED PyObject *__pyx_v_flags = 0; CYTHON_UNUSED PyObject *__pyx_v_depth = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("mode_ok (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_size,&__pyx_n_s_flags,&__pyx_n_s_depth,0}; PyObject* values[3] = {0,0,0}; values[1] = ((PyObject *)__pyx_int_0); values[2] = ((PyObject *)__pyx_int_0); if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_size)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; case 1: if (kw_args > 0) { PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_flags); if (value) { values[1] = value; kw_args--; } } case 2: if (kw_args > 0) { PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_depth); if (value) { values[2] = value; kw_args--; } } } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "mode_ok") < 0)) __PYX_ERR(0, 587, __pyx_L3_error) } } else { switch (PyTuple_GET_SIZE(__pyx_args)) { case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_size = values[0]; __pyx_v_flags = values[1]; __pyx_v_depth = values[2]; } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("mode_ok", 0, 1, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 587, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("pygame_sdl2.display.mode_ok", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_11pygame_sdl2_7display_32mode_ok(__pyx_self, __pyx_v_size, __pyx_v_flags, __pyx_v_depth); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_7display_32mode_ok(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_size, CYTHON_UNUSED PyObject *__pyx_v_flags, CYTHON_UNUSED PyObject *__pyx_v_depth) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; int __pyx_t_5; __Pyx_RefNannySetupContext("mode_ok", 0); /* "pygame_sdl2/display.pyx":592 * """ * * return tuple(size) in list_modes() # <<<<<<<<<<<<<< * * def gl_reset_attributes(): */ __Pyx_XDECREF(__pyx_r); __pyx_t_1 = PySequence_Tuple(__pyx_v_size); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 592, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_list_modes); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 592, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = NULL; if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) { __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3); if (likely(__pyx_t_4)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); __Pyx_INCREF(__pyx_t_4); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_3, function); } } if (__pyx_t_4) { __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 592, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; } else { __pyx_t_2 = __Pyx_PyObject_CallNoArg(__pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 592, __pyx_L1_error) } __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_5 = (__Pyx_PySequence_ContainsTF(__pyx_t_1, __pyx_t_2, Py_EQ)); if (unlikely(__pyx_t_5 < 0)) __PYX_ERR(0, 592, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_2 = __Pyx_PyBool_FromLong(__pyx_t_5); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 592, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; /* "pygame_sdl2/display.pyx":587 * * * def mode_ok(size, flags=0, depth=0): # <<<<<<<<<<<<<< * """ * Returns true if size is in the result of list_modes(). */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_AddTraceback("pygame_sdl2.display.mode_ok", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/display.pyx":594 * return tuple(size) in list_modes() * * def gl_reset_attributes(): # <<<<<<<<<<<<<< * SDL_GL_ResetAttributes() * */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_7display_35gl_reset_attributes(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused); /*proto*/ static PyMethodDef __pyx_mdef_11pygame_sdl2_7display_35gl_reset_attributes = {"gl_reset_attributes", (PyCFunction)__pyx_pw_11pygame_sdl2_7display_35gl_reset_attributes, METH_NOARGS, 0}; static PyObject *__pyx_pw_11pygame_sdl2_7display_35gl_reset_attributes(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("gl_reset_attributes (wrapper)", 0); __pyx_r = __pyx_pf_11pygame_sdl2_7display_34gl_reset_attributes(__pyx_self); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_7display_34gl_reset_attributes(CYTHON_UNUSED PyObject *__pyx_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("gl_reset_attributes", 0); /* "pygame_sdl2/display.pyx":595 * * def gl_reset_attributes(): * SDL_GL_ResetAttributes() # <<<<<<<<<<<<<< * * def gl_set_attribute(flag, value): */ SDL_GL_ResetAttributes(); /* "pygame_sdl2/display.pyx":594 * return tuple(size) in list_modes() * * def gl_reset_attributes(): # <<<<<<<<<<<<<< * SDL_GL_ResetAttributes() * */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/display.pyx":597 * SDL_GL_ResetAttributes() * * def gl_set_attribute(flag, value): # <<<<<<<<<<<<<< * * if flag == GL_SWAP_CONTROL: */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_7display_37gl_set_attribute(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static PyMethodDef __pyx_mdef_11pygame_sdl2_7display_37gl_set_attribute = {"gl_set_attribute", (PyCFunction)__pyx_pw_11pygame_sdl2_7display_37gl_set_attribute, METH_VARARGS|METH_KEYWORDS, 0}; static PyObject *__pyx_pw_11pygame_sdl2_7display_37gl_set_attribute(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_flag = 0; PyObject *__pyx_v_value = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("gl_set_attribute (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_flag,&__pyx_n_s_value,0}; PyObject* values[2] = {0,0}; if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_flag)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; case 1: if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_value)) != 0)) kw_args--; else { __Pyx_RaiseArgtupleInvalid("gl_set_attribute", 1, 2, 2, 1); __PYX_ERR(0, 597, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "gl_set_attribute") < 0)) __PYX_ERR(0, 597, __pyx_L3_error) } } else if (PyTuple_GET_SIZE(__pyx_args) != 2) { goto __pyx_L5_argtuple_error; } else { values[0] = PyTuple_GET_ITEM(__pyx_args, 0); values[1] = PyTuple_GET_ITEM(__pyx_args, 1); } __pyx_v_flag = values[0]; __pyx_v_value = values[1]; } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("gl_set_attribute", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 597, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("pygame_sdl2.display.gl_set_attribute", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_11pygame_sdl2_7display_36gl_set_attribute(__pyx_self, __pyx_v_flag, __pyx_v_value); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_7display_36gl_set_attribute(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_flag, PyObject *__pyx_v_value) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; int __pyx_t_3; int __pyx_t_4; SDL_GLattr __pyx_t_5; PyObject *__pyx_t_6 = NULL; __Pyx_RefNannySetupContext("gl_set_attribute", 0); /* "pygame_sdl2/display.pyx":599 * def gl_set_attribute(flag, value): * * if flag == GL_SWAP_CONTROL: # <<<<<<<<<<<<<< * if ios: * return */ __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_GL_SWAP_CONTROL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 599, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = PyObject_RichCompare(__pyx_v_flag, __pyx_t_1, Py_EQ); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 599, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(0, 599, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; if (__pyx_t_3) { /* "pygame_sdl2/display.pyx":600 * * if flag == GL_SWAP_CONTROL: * if ios: # <<<<<<<<<<<<<< * return * */ __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_ios); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 600, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(0, 600, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; if (__pyx_t_3) { /* "pygame_sdl2/display.pyx":601 * if flag == GL_SWAP_CONTROL: * if ios: * return # <<<<<<<<<<<<<< * * global default_swap_control */ __Pyx_XDECREF(__pyx_r); __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; /* "pygame_sdl2/display.pyx":600 * * if flag == GL_SWAP_CONTROL: * if ios: # <<<<<<<<<<<<<< * return * */ } /* "pygame_sdl2/display.pyx":608 * # to deal with the case where the negative interval isn't * # supported. Then give up and carry on. * if SDL_GL_SetSwapInterval(value): # <<<<<<<<<<<<<< * SDL_GL_SetSwapInterval(-value) * */ __pyx_t_4 = __Pyx_PyInt_As_int(__pyx_v_value); if (unlikely((__pyx_t_4 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 608, __pyx_L1_error) __pyx_t_3 = (SDL_GL_SetSwapInterval(__pyx_t_4) != 0); if (__pyx_t_3) { /* "pygame_sdl2/display.pyx":609 * # supported. Then give up and carry on. * if SDL_GL_SetSwapInterval(value): * SDL_GL_SetSwapInterval(-value) # <<<<<<<<<<<<<< * * default_swap_control = value */ __pyx_t_2 = PyNumber_Negative(__pyx_v_value); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 609, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_4 = __Pyx_PyInt_As_int(__pyx_t_2); if (unlikely((__pyx_t_4 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 609, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; SDL_GL_SetSwapInterval(__pyx_t_4); /* "pygame_sdl2/display.pyx":608 * # to deal with the case where the negative interval isn't * # supported. Then give up and carry on. * if SDL_GL_SetSwapInterval(value): # <<<<<<<<<<<<<< * SDL_GL_SetSwapInterval(-value) * */ } /* "pygame_sdl2/display.pyx":611 * SDL_GL_SetSwapInterval(-value) * * default_swap_control = value # <<<<<<<<<<<<<< * return * */ if (PyDict_SetItem(__pyx_d, __pyx_n_s_default_swap_control, __pyx_v_value) < 0) __PYX_ERR(0, 611, __pyx_L1_error) /* "pygame_sdl2/display.pyx":612 * * default_swap_control = value * return # <<<<<<<<<<<<<< * * if SDL_GL_SetAttribute(flag, value): */ __Pyx_XDECREF(__pyx_r); __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; /* "pygame_sdl2/display.pyx":599 * def gl_set_attribute(flag, value): * * if flag == GL_SWAP_CONTROL: # <<<<<<<<<<<<<< * if ios: * return */ } /* "pygame_sdl2/display.pyx":614 * return * * if SDL_GL_SetAttribute(flag, value): # <<<<<<<<<<<<<< * raise error() * */ __pyx_t_5 = ((SDL_GLattr)__Pyx_PyInt_As_SDL_GLattr(__pyx_v_flag)); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 614, __pyx_L1_error) __pyx_t_4 = __Pyx_PyInt_As_int(__pyx_v_value); if (unlikely((__pyx_t_4 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 614, __pyx_L1_error) __pyx_t_3 = (SDL_GL_SetAttribute(__pyx_t_5, __pyx_t_4) != 0); if (__pyx_t_3) { /* "pygame_sdl2/display.pyx":615 * * if SDL_GL_SetAttribute(flag, value): * raise error() # <<<<<<<<<<<<<< * * def gl_get_attribute(flag): */ __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_error); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 615, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_6 = NULL; if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_1))) { __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_1); if (likely(__pyx_t_6)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1); __Pyx_INCREF(__pyx_t_6); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_1, function); } } if (__pyx_t_6) { __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_1, __pyx_t_6); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 615, __pyx_L1_error) __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; } else { __pyx_t_2 = __Pyx_PyObject_CallNoArg(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 615, __pyx_L1_error) } __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_Raise(__pyx_t_2, 0, 0, 0); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __PYX_ERR(0, 615, __pyx_L1_error) /* "pygame_sdl2/display.pyx":614 * return * * if SDL_GL_SetAttribute(flag, value): # <<<<<<<<<<<<<< * raise error() * */ } /* "pygame_sdl2/display.pyx":597 * SDL_GL_ResetAttributes() * * def gl_set_attribute(flag, value): # <<<<<<<<<<<<<< * * if flag == GL_SWAP_CONTROL: */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_6); __Pyx_AddTraceback("pygame_sdl2.display.gl_set_attribute", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/display.pyx":617 * raise error() * * def gl_get_attribute(flag): # <<<<<<<<<<<<<< * cdef int rv * */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_7display_39gl_get_attribute(PyObject *__pyx_self, PyObject *__pyx_v_flag); /*proto*/ static PyMethodDef __pyx_mdef_11pygame_sdl2_7display_39gl_get_attribute = {"gl_get_attribute", (PyCFunction)__pyx_pw_11pygame_sdl2_7display_39gl_get_attribute, METH_O, 0}; static PyObject *__pyx_pw_11pygame_sdl2_7display_39gl_get_attribute(PyObject *__pyx_self, PyObject *__pyx_v_flag) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("gl_get_attribute (wrapper)", 0); __pyx_r = __pyx_pf_11pygame_sdl2_7display_38gl_get_attribute(__pyx_self, ((PyObject *)__pyx_v_flag)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_7display_38gl_get_attribute(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_flag) { int __pyx_v_rv; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; int __pyx_t_3; SDL_GLattr __pyx_t_4; PyObject *__pyx_t_5 = NULL; __Pyx_RefNannySetupContext("gl_get_attribute", 0); /* "pygame_sdl2/display.pyx":620 * cdef int rv * * if flag == GL_SWAP_CONTROL: # <<<<<<<<<<<<<< * return SDL_GL_GetSwapInterval() * */ __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_GL_SWAP_CONTROL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 620, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = PyObject_RichCompare(__pyx_v_flag, __pyx_t_1, Py_EQ); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 620, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(0, 620, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; if (__pyx_t_3) { /* "pygame_sdl2/display.pyx":621 * * if flag == GL_SWAP_CONTROL: * return SDL_GL_GetSwapInterval() # <<<<<<<<<<<<<< * * if SDL_GL_GetAttribute(flag, &rv): */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __Pyx_PyInt_From_int(SDL_GL_GetSwapInterval()); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 621, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; /* "pygame_sdl2/display.pyx":620 * cdef int rv * * if flag == GL_SWAP_CONTROL: # <<<<<<<<<<<<<< * return SDL_GL_GetSwapInterval() * */ } /* "pygame_sdl2/display.pyx":623 * return SDL_GL_GetSwapInterval() * * if SDL_GL_GetAttribute(flag, &rv): # <<<<<<<<<<<<<< * raise error() * */ __pyx_t_4 = ((SDL_GLattr)__Pyx_PyInt_As_SDL_GLattr(__pyx_v_flag)); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 623, __pyx_L1_error) __pyx_t_3 = (SDL_GL_GetAttribute(__pyx_t_4, (&__pyx_v_rv)) != 0); if (__pyx_t_3) { /* "pygame_sdl2/display.pyx":624 * * if SDL_GL_GetAttribute(flag, &rv): * raise error() # <<<<<<<<<<<<<< * * return rv */ __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_error); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 624, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_5 = NULL; if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_1))) { __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_1); if (likely(__pyx_t_5)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1); __Pyx_INCREF(__pyx_t_5); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_1, function); } } if (__pyx_t_5) { __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_1, __pyx_t_5); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 624, __pyx_L1_error) __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; } else { __pyx_t_2 = __Pyx_PyObject_CallNoArg(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 624, __pyx_L1_error) } __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_Raise(__pyx_t_2, 0, 0, 0); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __PYX_ERR(0, 624, __pyx_L1_error) /* "pygame_sdl2/display.pyx":623 * return SDL_GL_GetSwapInterval() * * if SDL_GL_GetAttribute(flag, &rv): # <<<<<<<<<<<<<< * raise error() * */ } /* "pygame_sdl2/display.pyx":626 * raise error() * * return rv # <<<<<<<<<<<<<< * * def gl_load_library(path): */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_v_rv); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 626, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; /* "pygame_sdl2/display.pyx":617 * raise error() * * def gl_get_attribute(flag): # <<<<<<<<<<<<<< * cdef int rv * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_5); __Pyx_AddTraceback("pygame_sdl2.display.gl_get_attribute", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/display.pyx":628 * return rv * * def gl_load_library(path): # <<<<<<<<<<<<<< * if path is None: * if SDL_GL_LoadLibrary(NULL): */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_7display_41gl_load_library(PyObject *__pyx_self, PyObject *__pyx_v_path); /*proto*/ static PyMethodDef __pyx_mdef_11pygame_sdl2_7display_41gl_load_library = {"gl_load_library", (PyCFunction)__pyx_pw_11pygame_sdl2_7display_41gl_load_library, METH_O, 0}; static PyObject *__pyx_pw_11pygame_sdl2_7display_41gl_load_library(PyObject *__pyx_self, PyObject *__pyx_v_path) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("gl_load_library (wrapper)", 0); __pyx_r = __pyx_pf_11pygame_sdl2_7display_40gl_load_library(__pyx_self, ((PyObject *)__pyx_v_path)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_7display_40gl_load_library(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_path) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; int __pyx_t_2; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; PyObject *__pyx_t_5 = NULL; char const *__pyx_t_6; __Pyx_RefNannySetupContext("gl_load_library", 0); /* "pygame_sdl2/display.pyx":629 * * def gl_load_library(path): * if path is None: # <<<<<<<<<<<<<< * if SDL_GL_LoadLibrary(NULL): * raise error() */ __pyx_t_1 = (__pyx_v_path == Py_None); __pyx_t_2 = (__pyx_t_1 != 0); if (__pyx_t_2) { /* "pygame_sdl2/display.pyx":630 * def gl_load_library(path): * if path is None: * if SDL_GL_LoadLibrary(NULL): # <<<<<<<<<<<<<< * raise error() * else: */ __pyx_t_2 = (SDL_GL_LoadLibrary(NULL) != 0); if (__pyx_t_2) { /* "pygame_sdl2/display.pyx":631 * if path is None: * if SDL_GL_LoadLibrary(NULL): * raise error() # <<<<<<<<<<<<<< * else: * if SDL_GL_LoadLibrary(path): */ __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_error); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 631, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_5 = NULL; if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_4))) { __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4); if (likely(__pyx_t_5)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4); __Pyx_INCREF(__pyx_t_5); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_4, function); } } if (__pyx_t_5) { __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_5); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 631, __pyx_L1_error) __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; } else { __pyx_t_3 = __Pyx_PyObject_CallNoArg(__pyx_t_4); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 631, __pyx_L1_error) } __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_Raise(__pyx_t_3, 0, 0, 0); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __PYX_ERR(0, 631, __pyx_L1_error) /* "pygame_sdl2/display.pyx":630 * def gl_load_library(path): * if path is None: * if SDL_GL_LoadLibrary(NULL): # <<<<<<<<<<<<<< * raise error() * else: */ } /* "pygame_sdl2/display.pyx":629 * * def gl_load_library(path): * if path is None: # <<<<<<<<<<<<<< * if SDL_GL_LoadLibrary(NULL): * raise error() */ goto __pyx_L3; } /* "pygame_sdl2/display.pyx":633 * raise error() * else: * if SDL_GL_LoadLibrary(path): # <<<<<<<<<<<<<< * raise error() * */ /*else*/ { __pyx_t_6 = __Pyx_PyObject_AsString(__pyx_v_path); if (unlikely((!__pyx_t_6) && PyErr_Occurred())) __PYX_ERR(0, 633, __pyx_L1_error) __pyx_t_2 = (SDL_GL_LoadLibrary(__pyx_t_6) != 0); if (__pyx_t_2) { /* "pygame_sdl2/display.pyx":634 * else: * if SDL_GL_LoadLibrary(path): * raise error() # <<<<<<<<<<<<<< * * def gl_unload_library(): */ __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_error); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 634, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_5 = NULL; if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_4))) { __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4); if (likely(__pyx_t_5)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4); __Pyx_INCREF(__pyx_t_5); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_4, function); } } if (__pyx_t_5) { __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_5); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 634, __pyx_L1_error) __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; } else { __pyx_t_3 = __Pyx_PyObject_CallNoArg(__pyx_t_4); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 634, __pyx_L1_error) } __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_Raise(__pyx_t_3, 0, 0, 0); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __PYX_ERR(0, 634, __pyx_L1_error) /* "pygame_sdl2/display.pyx":633 * raise error() * else: * if SDL_GL_LoadLibrary(path): # <<<<<<<<<<<<<< * raise error() * */ } } __pyx_L3:; /* "pygame_sdl2/display.pyx":628 * return rv * * def gl_load_library(path): # <<<<<<<<<<<<<< * if path is None: * if SDL_GL_LoadLibrary(NULL): */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_5); __Pyx_AddTraceback("pygame_sdl2.display.gl_load_library", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/display.pyx":636 * raise error() * * def gl_unload_library(): # <<<<<<<<<<<<<< * SDL_GL_UnloadLibrary() * */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_7display_43gl_unload_library(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused); /*proto*/ static PyMethodDef __pyx_mdef_11pygame_sdl2_7display_43gl_unload_library = {"gl_unload_library", (PyCFunction)__pyx_pw_11pygame_sdl2_7display_43gl_unload_library, METH_NOARGS, 0}; static PyObject *__pyx_pw_11pygame_sdl2_7display_43gl_unload_library(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("gl_unload_library (wrapper)", 0); __pyx_r = __pyx_pf_11pygame_sdl2_7display_42gl_unload_library(__pyx_self); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_7display_42gl_unload_library(CYTHON_UNUSED PyObject *__pyx_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("gl_unload_library", 0); /* "pygame_sdl2/display.pyx":637 * * def gl_unload_library(): * SDL_GL_UnloadLibrary() # <<<<<<<<<<<<<< * * def get_active(): */ SDL_GL_UnloadLibrary(); /* "pygame_sdl2/display.pyx":636 * raise error() * * def gl_unload_library(): # <<<<<<<<<<<<<< * SDL_GL_UnloadLibrary() * */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/display.pyx":639 * SDL_GL_UnloadLibrary() * * def get_active(): # <<<<<<<<<<<<<< * if main_window: * return main_window.get_active() */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_7display_45get_active(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused); /*proto*/ static PyMethodDef __pyx_mdef_11pygame_sdl2_7display_45get_active = {"get_active", (PyCFunction)__pyx_pw_11pygame_sdl2_7display_45get_active, METH_NOARGS, 0}; static PyObject *__pyx_pw_11pygame_sdl2_7display_45get_active(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("get_active (wrapper)", 0); __pyx_r = __pyx_pf_11pygame_sdl2_7display_44get_active(__pyx_self); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_7display_44get_active(CYTHON_UNUSED PyObject *__pyx_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; __Pyx_RefNannySetupContext("get_active", 0); /* "pygame_sdl2/display.pyx":640 * * def get_active(): * if main_window: # <<<<<<<<<<<<<< * return main_window.get_active() * return False */ __pyx_t_1 = __Pyx_PyObject_IsTrue(((PyObject *)__pyx_v_11pygame_sdl2_7display_main_window)); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(0, 640, __pyx_L1_error) if (__pyx_t_1) { /* "pygame_sdl2/display.pyx":641 * def get_active(): * if main_window: * return main_window.get_active() # <<<<<<<<<<<<<< * return False * */ __Pyx_XDECREF(__pyx_r); __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_11pygame_sdl2_7display_main_window), __pyx_n_s_get_active); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 641, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = NULL; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) { __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3); if (likely(__pyx_t_4)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); __Pyx_INCREF(__pyx_t_4); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_3, function); } } if (__pyx_t_4) { __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 641, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; } else { __pyx_t_2 = __Pyx_PyObject_CallNoArg(__pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 641, __pyx_L1_error) } __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; /* "pygame_sdl2/display.pyx":640 * * def get_active(): * if main_window: # <<<<<<<<<<<<<< * return main_window.get_active() * return False */ } /* "pygame_sdl2/display.pyx":642 * if main_window: * return main_window.get_active() * return False # <<<<<<<<<<<<<< * * def iconify(): */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(Py_False); __pyx_r = Py_False; goto __pyx_L0; /* "pygame_sdl2/display.pyx":639 * SDL_GL_UnloadLibrary() * * def get_active(): # <<<<<<<<<<<<<< * if main_window: * return main_window.get_active() */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_AddTraceback("pygame_sdl2.display.get_active", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/display.pyx":644 * return False * * def iconify(): # <<<<<<<<<<<<<< * if main_window: * return main_window.iconify() */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_7display_47iconify(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused); /*proto*/ static PyMethodDef __pyx_mdef_11pygame_sdl2_7display_47iconify = {"iconify", (PyCFunction)__pyx_pw_11pygame_sdl2_7display_47iconify, METH_NOARGS, 0}; static PyObject *__pyx_pw_11pygame_sdl2_7display_47iconify(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("iconify (wrapper)", 0); __pyx_r = __pyx_pf_11pygame_sdl2_7display_46iconify(__pyx_self); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_7display_46iconify(CYTHON_UNUSED PyObject *__pyx_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; __Pyx_RefNannySetupContext("iconify", 0); /* "pygame_sdl2/display.pyx":645 * * def iconify(): * if main_window: # <<<<<<<<<<<<<< * return main_window.iconify() * */ __pyx_t_1 = __Pyx_PyObject_IsTrue(((PyObject *)__pyx_v_11pygame_sdl2_7display_main_window)); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(0, 645, __pyx_L1_error) if (__pyx_t_1) { /* "pygame_sdl2/display.pyx":646 * def iconify(): * if main_window: * return main_window.iconify() # <<<<<<<<<<<<<< * * return False */ __Pyx_XDECREF(__pyx_r); __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_11pygame_sdl2_7display_main_window), __pyx_n_s_iconify); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 646, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = NULL; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) { __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3); if (likely(__pyx_t_4)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); __Pyx_INCREF(__pyx_t_4); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_3, function); } } if (__pyx_t_4) { __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 646, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; } else { __pyx_t_2 = __Pyx_PyObject_CallNoArg(__pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 646, __pyx_L1_error) } __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; /* "pygame_sdl2/display.pyx":645 * * def iconify(): * if main_window: # <<<<<<<<<<<<<< * return main_window.iconify() * */ } /* "pygame_sdl2/display.pyx":648 * return main_window.iconify() * * return False # <<<<<<<<<<<<<< * * def toggle_fullscreen(): */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(Py_False); __pyx_r = Py_False; goto __pyx_L0; /* "pygame_sdl2/display.pyx":644 * return False * * def iconify(): # <<<<<<<<<<<<<< * if main_window: * return main_window.iconify() */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_AddTraceback("pygame_sdl2.display.iconify", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/display.pyx":650 * return False * * def toggle_fullscreen(): # <<<<<<<<<<<<<< * if main_window: * return main_window.toggle_fullscreen() */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_7display_49toggle_fullscreen(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused); /*proto*/ static PyMethodDef __pyx_mdef_11pygame_sdl2_7display_49toggle_fullscreen = {"toggle_fullscreen", (PyCFunction)__pyx_pw_11pygame_sdl2_7display_49toggle_fullscreen, METH_NOARGS, 0}; static PyObject *__pyx_pw_11pygame_sdl2_7display_49toggle_fullscreen(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("toggle_fullscreen (wrapper)", 0); __pyx_r = __pyx_pf_11pygame_sdl2_7display_48toggle_fullscreen(__pyx_self); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_7display_48toggle_fullscreen(CYTHON_UNUSED PyObject *__pyx_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; __Pyx_RefNannySetupContext("toggle_fullscreen", 0); /* "pygame_sdl2/display.pyx":651 * * def toggle_fullscreen(): * if main_window: # <<<<<<<<<<<<<< * return main_window.toggle_fullscreen() * */ __pyx_t_1 = __Pyx_PyObject_IsTrue(((PyObject *)__pyx_v_11pygame_sdl2_7display_main_window)); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(0, 651, __pyx_L1_error) if (__pyx_t_1) { /* "pygame_sdl2/display.pyx":652 * def toggle_fullscreen(): * if main_window: * return main_window.toggle_fullscreen() # <<<<<<<<<<<<<< * * return True */ __Pyx_XDECREF(__pyx_r); __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_11pygame_sdl2_7display_main_window), __pyx_n_s_toggle_fullscreen); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 652, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = NULL; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) { __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3); if (likely(__pyx_t_4)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); __Pyx_INCREF(__pyx_t_4); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_3, function); } } if (__pyx_t_4) { __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 652, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; } else { __pyx_t_2 = __Pyx_PyObject_CallNoArg(__pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 652, __pyx_L1_error) } __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; /* "pygame_sdl2/display.pyx":651 * * def toggle_fullscreen(): * if main_window: # <<<<<<<<<<<<<< * return main_window.toggle_fullscreen() * */ } /* "pygame_sdl2/display.pyx":654 * return main_window.toggle_fullscreen() * * return True # <<<<<<<<<<<<<< * * def set_gamma(red, green=None, blue=None): */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(Py_True); __pyx_r = Py_True; goto __pyx_L0; /* "pygame_sdl2/display.pyx":650 * return False * * def toggle_fullscreen(): # <<<<<<<<<<<<<< * if main_window: * return main_window.toggle_fullscreen() */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_AddTraceback("pygame_sdl2.display.toggle_fullscreen", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/display.pyx":656 * return True * * def set_gamma(red, green=None, blue=None): # <<<<<<<<<<<<<< * if main_window: * return main_window.set_gamma(red, green, blue) */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_7display_51set_gamma(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static PyMethodDef __pyx_mdef_11pygame_sdl2_7display_51set_gamma = {"set_gamma", (PyCFunction)__pyx_pw_11pygame_sdl2_7display_51set_gamma, METH_VARARGS|METH_KEYWORDS, 0}; static PyObject *__pyx_pw_11pygame_sdl2_7display_51set_gamma(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_red = 0; PyObject *__pyx_v_green = 0; PyObject *__pyx_v_blue = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("set_gamma (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_red,&__pyx_n_s_green,&__pyx_n_s_blue,0}; PyObject* values[3] = {0,0,0}; values[1] = ((PyObject *)Py_None); values[2] = ((PyObject *)Py_None); if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_red)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; case 1: if (kw_args > 0) { PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_green); if (value) { values[1] = value; kw_args--; } } case 2: if (kw_args > 0) { PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_blue); if (value) { values[2] = value; kw_args--; } } } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "set_gamma") < 0)) __PYX_ERR(0, 656, __pyx_L3_error) } } else { switch (PyTuple_GET_SIZE(__pyx_args)) { case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_red = values[0]; __pyx_v_green = values[1]; __pyx_v_blue = values[2]; } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("set_gamma", 0, 1, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 656, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("pygame_sdl2.display.set_gamma", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_11pygame_sdl2_7display_50set_gamma(__pyx_self, __pyx_v_red, __pyx_v_green, __pyx_v_blue); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_7display_50set_gamma(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_red, PyObject *__pyx_v_green, PyObject *__pyx_v_blue) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; int __pyx_t_5; PyObject *__pyx_t_6 = NULL; __Pyx_RefNannySetupContext("set_gamma", 0); /* "pygame_sdl2/display.pyx":657 * * def set_gamma(red, green=None, blue=None): * if main_window: # <<<<<<<<<<<<<< * return main_window.set_gamma(red, green, blue) * return False */ __pyx_t_1 = __Pyx_PyObject_IsTrue(((PyObject *)__pyx_v_11pygame_sdl2_7display_main_window)); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(0, 657, __pyx_L1_error) if (__pyx_t_1) { /* "pygame_sdl2/display.pyx":658 * def set_gamma(red, green=None, blue=None): * if main_window: * return main_window.set_gamma(red, green, blue) # <<<<<<<<<<<<<< * return False * */ __Pyx_XDECREF(__pyx_r); __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_11pygame_sdl2_7display_main_window), __pyx_n_s_set_gamma); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 658, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = NULL; __pyx_t_5 = 0; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) { __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3); if (likely(__pyx_t_4)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); __Pyx_INCREF(__pyx_t_4); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_3, function); __pyx_t_5 = 1; } } #if CYTHON_FAST_PYCALL if (PyFunction_Check(__pyx_t_3)) { PyObject *__pyx_temp[4] = {__pyx_t_4, __pyx_v_red, __pyx_v_green, __pyx_v_blue}; __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_5, 3+__pyx_t_5); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 658, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_GOTREF(__pyx_t_2); } else #endif #if CYTHON_FAST_PYCCALL if (__Pyx_PyFastCFunction_Check(__pyx_t_3)) { PyObject *__pyx_temp[4] = {__pyx_t_4, __pyx_v_red, __pyx_v_green, __pyx_v_blue}; __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_5, 3+__pyx_t_5); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 658, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_GOTREF(__pyx_t_2); } else #endif { __pyx_t_6 = PyTuple_New(3+__pyx_t_5); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 658, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); if (__pyx_t_4) { __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_4); __pyx_t_4 = NULL; } __Pyx_INCREF(__pyx_v_red); __Pyx_GIVEREF(__pyx_v_red); PyTuple_SET_ITEM(__pyx_t_6, 0+__pyx_t_5, __pyx_v_red); __Pyx_INCREF(__pyx_v_green); __Pyx_GIVEREF(__pyx_v_green); PyTuple_SET_ITEM(__pyx_t_6, 1+__pyx_t_5, __pyx_v_green); __Pyx_INCREF(__pyx_v_blue); __Pyx_GIVEREF(__pyx_v_blue); PyTuple_SET_ITEM(__pyx_t_6, 2+__pyx_t_5, __pyx_v_blue); __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_6, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 658, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; } __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; /* "pygame_sdl2/display.pyx":657 * * def set_gamma(red, green=None, blue=None): * if main_window: # <<<<<<<<<<<<<< * return main_window.set_gamma(red, green, blue) * return False */ } /* "pygame_sdl2/display.pyx":659 * if main_window: * return main_window.set_gamma(red, green, blue) * return False # <<<<<<<<<<<<<< * * def set_gamma_ramp(red, green, blue): */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(Py_False); __pyx_r = Py_False; goto __pyx_L0; /* "pygame_sdl2/display.pyx":656 * return True * * def set_gamma(red, green=None, blue=None): # <<<<<<<<<<<<<< * if main_window: * return main_window.set_gamma(red, green, blue) */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_6); __Pyx_AddTraceback("pygame_sdl2.display.set_gamma", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/display.pyx":661 * return False * * def set_gamma_ramp(red, green, blue): # <<<<<<<<<<<<<< * if main_window: * return main_window.set_gamma_ramp(red, green, blue) */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_7display_53set_gamma_ramp(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static PyMethodDef __pyx_mdef_11pygame_sdl2_7display_53set_gamma_ramp = {"set_gamma_ramp", (PyCFunction)__pyx_pw_11pygame_sdl2_7display_53set_gamma_ramp, METH_VARARGS|METH_KEYWORDS, 0}; static PyObject *__pyx_pw_11pygame_sdl2_7display_53set_gamma_ramp(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_red = 0; PyObject *__pyx_v_green = 0; PyObject *__pyx_v_blue = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("set_gamma_ramp (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_red,&__pyx_n_s_green,&__pyx_n_s_blue,0}; PyObject* values[3] = {0,0,0}; if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_red)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; case 1: if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_green)) != 0)) kw_args--; else { __Pyx_RaiseArgtupleInvalid("set_gamma_ramp", 1, 3, 3, 1); __PYX_ERR(0, 661, __pyx_L3_error) } case 2: if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_blue)) != 0)) kw_args--; else { __Pyx_RaiseArgtupleInvalid("set_gamma_ramp", 1, 3, 3, 2); __PYX_ERR(0, 661, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "set_gamma_ramp") < 0)) __PYX_ERR(0, 661, __pyx_L3_error) } } else if (PyTuple_GET_SIZE(__pyx_args) != 3) { goto __pyx_L5_argtuple_error; } else { values[0] = PyTuple_GET_ITEM(__pyx_args, 0); values[1] = PyTuple_GET_ITEM(__pyx_args, 1); values[2] = PyTuple_GET_ITEM(__pyx_args, 2); } __pyx_v_red = values[0]; __pyx_v_green = values[1]; __pyx_v_blue = values[2]; } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("set_gamma_ramp", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 661, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("pygame_sdl2.display.set_gamma_ramp", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_11pygame_sdl2_7display_52set_gamma_ramp(__pyx_self, __pyx_v_red, __pyx_v_green, __pyx_v_blue); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_7display_52set_gamma_ramp(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_red, PyObject *__pyx_v_green, PyObject *__pyx_v_blue) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; int __pyx_t_5; PyObject *__pyx_t_6 = NULL; __Pyx_RefNannySetupContext("set_gamma_ramp", 0); /* "pygame_sdl2/display.pyx":662 * * def set_gamma_ramp(red, green, blue): * if main_window: # <<<<<<<<<<<<<< * return main_window.set_gamma_ramp(red, green, blue) * return False */ __pyx_t_1 = __Pyx_PyObject_IsTrue(((PyObject *)__pyx_v_11pygame_sdl2_7display_main_window)); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(0, 662, __pyx_L1_error) if (__pyx_t_1) { /* "pygame_sdl2/display.pyx":663 * def set_gamma_ramp(red, green, blue): * if main_window: * return main_window.set_gamma_ramp(red, green, blue) # <<<<<<<<<<<<<< * return False * */ __Pyx_XDECREF(__pyx_r); __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_11pygame_sdl2_7display_main_window), __pyx_n_s_set_gamma_ramp); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 663, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = NULL; __pyx_t_5 = 0; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) { __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3); if (likely(__pyx_t_4)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); __Pyx_INCREF(__pyx_t_4); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_3, function); __pyx_t_5 = 1; } } #if CYTHON_FAST_PYCALL if (PyFunction_Check(__pyx_t_3)) { PyObject *__pyx_temp[4] = {__pyx_t_4, __pyx_v_red, __pyx_v_green, __pyx_v_blue}; __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_5, 3+__pyx_t_5); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 663, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_GOTREF(__pyx_t_2); } else #endif #if CYTHON_FAST_PYCCALL if (__Pyx_PyFastCFunction_Check(__pyx_t_3)) { PyObject *__pyx_temp[4] = {__pyx_t_4, __pyx_v_red, __pyx_v_green, __pyx_v_blue}; __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_5, 3+__pyx_t_5); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 663, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_GOTREF(__pyx_t_2); } else #endif { __pyx_t_6 = PyTuple_New(3+__pyx_t_5); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 663, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); if (__pyx_t_4) { __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_4); __pyx_t_4 = NULL; } __Pyx_INCREF(__pyx_v_red); __Pyx_GIVEREF(__pyx_v_red); PyTuple_SET_ITEM(__pyx_t_6, 0+__pyx_t_5, __pyx_v_red); __Pyx_INCREF(__pyx_v_green); __Pyx_GIVEREF(__pyx_v_green); PyTuple_SET_ITEM(__pyx_t_6, 1+__pyx_t_5, __pyx_v_green); __Pyx_INCREF(__pyx_v_blue); __Pyx_GIVEREF(__pyx_v_blue); PyTuple_SET_ITEM(__pyx_t_6, 2+__pyx_t_5, __pyx_v_blue); __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_6, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 663, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; } __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; /* "pygame_sdl2/display.pyx":662 * * def set_gamma_ramp(red, green, blue): * if main_window: # <<<<<<<<<<<<<< * return main_window.set_gamma_ramp(red, green, blue) * return False */ } /* "pygame_sdl2/display.pyx":664 * if main_window: * return main_window.set_gamma_ramp(red, green, blue) * return False # <<<<<<<<<<<<<< * * def set_icon(surface): */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(Py_False); __pyx_r = Py_False; goto __pyx_L0; /* "pygame_sdl2/display.pyx":661 * return False * * def set_gamma_ramp(red, green, blue): # <<<<<<<<<<<<<< * if main_window: * return main_window.set_gamma_ramp(red, green, blue) */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_6); __Pyx_AddTraceback("pygame_sdl2.display.set_gamma_ramp", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/display.pyx":666 * return False * * def set_icon(surface): # <<<<<<<<<<<<<< * global default_icon * */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_7display_55set_icon(PyObject *__pyx_self, PyObject *__pyx_v_surface); /*proto*/ static PyMethodDef __pyx_mdef_11pygame_sdl2_7display_55set_icon = {"set_icon", (PyCFunction)__pyx_pw_11pygame_sdl2_7display_55set_icon, METH_O, 0}; static PyObject *__pyx_pw_11pygame_sdl2_7display_55set_icon(PyObject *__pyx_self, PyObject *__pyx_v_surface) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("set_icon (wrapper)", 0); __pyx_r = __pyx_pf_11pygame_sdl2_7display_54set_icon(__pyx_self, ((PyObject *)__pyx_v_surface)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_7display_54set_icon(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_surface) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; int __pyx_t_4; int __pyx_t_5; PyObject *__pyx_t_6 = NULL; PyObject *__pyx_t_7 = NULL; __Pyx_RefNannySetupContext("set_icon", 0); /* "pygame_sdl2/display.pyx":669 * global default_icon * * default_icon = surface.copy() # <<<<<<<<<<<<<< * * if main_window is not None: */ __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_surface, __pyx_n_s_copy); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 669, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = NULL; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); if (likely(__pyx_t_3)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); } } if (__pyx_t_3) { __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 669, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } else { __pyx_t_1 = __Pyx_PyObject_CallNoArg(__pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 669, __pyx_L1_error) } __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; if (PyDict_SetItem(__pyx_d, __pyx_n_s_default_icon, __pyx_t_1) < 0) __PYX_ERR(0, 669, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "pygame_sdl2/display.pyx":671 * default_icon = surface.copy() * * if main_window is not None: # <<<<<<<<<<<<<< * main_window.set_icon(default_icon) * */ __pyx_t_4 = (((PyObject *)__pyx_v_11pygame_sdl2_7display_main_window) != Py_None); __pyx_t_5 = (__pyx_t_4 != 0); if (__pyx_t_5) { /* "pygame_sdl2/display.pyx":672 * * if main_window is not None: * main_window.set_icon(default_icon) # <<<<<<<<<<<<<< * * def set_caption(title, icontitle = None): */ __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_11pygame_sdl2_7display_main_window), __pyx_n_s_set_icon); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 672, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_default_icon); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 672, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_6 = NULL; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) { __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_2); if (likely(__pyx_t_6)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_6); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); } } if (!__pyx_t_6) { __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 672, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_GOTREF(__pyx_t_1); } else { #if CYTHON_FAST_PYCALL if (PyFunction_Check(__pyx_t_2)) { PyObject *__pyx_temp[2] = {__pyx_t_6, __pyx_t_3}; __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_2, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 672, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } else #endif #if CYTHON_FAST_PYCCALL if (__Pyx_PyFastCFunction_Check(__pyx_t_2)) { PyObject *__pyx_temp[2] = {__pyx_t_6, __pyx_t_3}; __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_2, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 672, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } else #endif { __pyx_t_7 = PyTuple_New(1+1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 672, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_GIVEREF(__pyx_t_6); PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_6); __pyx_t_6 = NULL; __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_7, 0+1, __pyx_t_3); __pyx_t_3 = 0; __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_7, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 672, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; } } __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "pygame_sdl2/display.pyx":671 * default_icon = surface.copy() * * if main_window is not None: # <<<<<<<<<<<<<< * main_window.set_icon(default_icon) * */ } /* "pygame_sdl2/display.pyx":666 * return False * * def set_icon(surface): # <<<<<<<<<<<<<< * global default_icon * */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_6); __Pyx_XDECREF(__pyx_t_7); __Pyx_AddTraceback("pygame_sdl2.display.set_icon", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/display.pyx":674 * main_window.set_icon(default_icon) * * def set_caption(title, icontitle = None): # <<<<<<<<<<<<<< * global default_title * */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_7display_57set_caption(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static PyMethodDef __pyx_mdef_11pygame_sdl2_7display_57set_caption = {"set_caption", (PyCFunction)__pyx_pw_11pygame_sdl2_7display_57set_caption, METH_VARARGS|METH_KEYWORDS, 0}; static PyObject *__pyx_pw_11pygame_sdl2_7display_57set_caption(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_title = 0; CYTHON_UNUSED PyObject *__pyx_v_icontitle = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("set_caption (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_title,&__pyx_n_s_icontitle,0}; PyObject* values[2] = {0,0}; values[1] = ((PyObject *)Py_None); if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_title)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; case 1: if (kw_args > 0) { PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_icontitle); if (value) { values[1] = value; kw_args--; } } } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "set_caption") < 0)) __PYX_ERR(0, 674, __pyx_L3_error) } } else { switch (PyTuple_GET_SIZE(__pyx_args)) { case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_title = values[0]; __pyx_v_icontitle = values[1]; } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("set_caption", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 674, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("pygame_sdl2.display.set_caption", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_11pygame_sdl2_7display_56set_caption(__pyx_self, __pyx_v_title, __pyx_v_icontitle); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_7display_56set_caption(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_title, CYTHON_UNUSED PyObject *__pyx_v_icontitle) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; PyObject *__pyx_t_5 = NULL; PyObject *__pyx_t_6 = NULL; __Pyx_RefNannySetupContext("set_caption", 0); /* "pygame_sdl2/display.pyx":677 * global default_title * * default_title = title # <<<<<<<<<<<<<< * * if main_window: */ if (PyDict_SetItem(__pyx_d, __pyx_n_s_default_title, __pyx_v_title) < 0) __PYX_ERR(0, 677, __pyx_L1_error) /* "pygame_sdl2/display.pyx":679 * default_title = title * * if main_window: # <<<<<<<<<<<<<< * main_window.set_caption(default_title) * */ __pyx_t_1 = __Pyx_PyObject_IsTrue(((PyObject *)__pyx_v_11pygame_sdl2_7display_main_window)); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(0, 679, __pyx_L1_error) if (__pyx_t_1) { /* "pygame_sdl2/display.pyx":680 * * if main_window: * main_window.set_caption(default_title) # <<<<<<<<<<<<<< * * def get_caption(): */ __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_11pygame_sdl2_7display_main_window), __pyx_n_s_set_caption); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 680, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_default_title); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 680, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_5 = NULL; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) { __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_3); if (likely(__pyx_t_5)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); __Pyx_INCREF(__pyx_t_5); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_3, function); } } if (!__pyx_t_5) { __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 680, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_GOTREF(__pyx_t_2); } else { #if CYTHON_FAST_PYCALL if (PyFunction_Check(__pyx_t_3)) { PyObject *__pyx_temp[2] = {__pyx_t_5, __pyx_t_4}; __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_3, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 680, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; } else #endif #if CYTHON_FAST_PYCCALL if (__Pyx_PyFastCFunction_Check(__pyx_t_3)) { PyObject *__pyx_temp[2] = {__pyx_t_5, __pyx_t_4}; __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 680, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; } else #endif { __pyx_t_6 = PyTuple_New(1+1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 680, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_5); __pyx_t_5 = NULL; __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_6, 0+1, __pyx_t_4); __pyx_t_4 = 0; __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_6, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 680, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; } } __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "pygame_sdl2/display.pyx":679 * default_title = title * * if main_window: # <<<<<<<<<<<<<< * main_window.set_caption(default_title) * */ } /* "pygame_sdl2/display.pyx":674 * main_window.set_icon(default_icon) * * def set_caption(title, icontitle = None): # <<<<<<<<<<<<<< * global default_title * */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_5); __Pyx_XDECREF(__pyx_t_6); __Pyx_AddTraceback("pygame_sdl2.display.set_caption", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/display.pyx":682 * main_window.set_caption(default_title) * * def get_caption(): # <<<<<<<<<<<<<< * return default_title * */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_7display_59get_caption(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused); /*proto*/ static PyMethodDef __pyx_mdef_11pygame_sdl2_7display_59get_caption = {"get_caption", (PyCFunction)__pyx_pw_11pygame_sdl2_7display_59get_caption, METH_NOARGS, 0}; static PyObject *__pyx_pw_11pygame_sdl2_7display_59get_caption(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("get_caption (wrapper)", 0); __pyx_r = __pyx_pf_11pygame_sdl2_7display_58get_caption(__pyx_self); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_7display_58get_caption(CYTHON_UNUSED PyObject *__pyx_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; __Pyx_RefNannySetupContext("get_caption", 0); /* "pygame_sdl2/display.pyx":683 * * def get_caption(): * return default_title # <<<<<<<<<<<<<< * * def get_drawable_size(): */ __Pyx_XDECREF(__pyx_r); __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_default_title); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 683, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "pygame_sdl2/display.pyx":682 * main_window.set_caption(default_title) * * def get_caption(): # <<<<<<<<<<<<<< * return default_title * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("pygame_sdl2.display.get_caption", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/display.pyx":685 * return default_title * * def get_drawable_size(): # <<<<<<<<<<<<<< * if main_window: * return main_window.get_drawable_size() */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_7display_61get_drawable_size(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused); /*proto*/ static PyMethodDef __pyx_mdef_11pygame_sdl2_7display_61get_drawable_size = {"get_drawable_size", (PyCFunction)__pyx_pw_11pygame_sdl2_7display_61get_drawable_size, METH_NOARGS, 0}; static PyObject *__pyx_pw_11pygame_sdl2_7display_61get_drawable_size(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("get_drawable_size (wrapper)", 0); __pyx_r = __pyx_pf_11pygame_sdl2_7display_60get_drawable_size(__pyx_self); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_7display_60get_drawable_size(CYTHON_UNUSED PyObject *__pyx_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; __Pyx_RefNannySetupContext("get_drawable_size", 0); /* "pygame_sdl2/display.pyx":686 * * def get_drawable_size(): * if main_window: # <<<<<<<<<<<<<< * return main_window.get_drawable_size() * return None */ __pyx_t_1 = __Pyx_PyObject_IsTrue(((PyObject *)__pyx_v_11pygame_sdl2_7display_main_window)); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(0, 686, __pyx_L1_error) if (__pyx_t_1) { /* "pygame_sdl2/display.pyx":687 * def get_drawable_size(): * if main_window: * return main_window.get_drawable_size() # <<<<<<<<<<<<<< * return None * */ __Pyx_XDECREF(__pyx_r); __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_11pygame_sdl2_7display_main_window), __pyx_n_s_get_drawable_size); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 687, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = NULL; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) { __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3); if (likely(__pyx_t_4)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); __Pyx_INCREF(__pyx_t_4); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_3, function); } } if (__pyx_t_4) { __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 687, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; } else { __pyx_t_2 = __Pyx_PyObject_CallNoArg(__pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 687, __pyx_L1_error) } __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; /* "pygame_sdl2/display.pyx":686 * * def get_drawable_size(): * if main_window: # <<<<<<<<<<<<<< * return main_window.get_drawable_size() * return None */ } /* "pygame_sdl2/display.pyx":688 * if main_window: * return main_window.get_drawable_size() * return None # <<<<<<<<<<<<<< * * def get_num_video_displays(): */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(Py_None); __pyx_r = Py_None; goto __pyx_L0; /* "pygame_sdl2/display.pyx":685 * return default_title * * def get_drawable_size(): # <<<<<<<<<<<<<< * if main_window: * return main_window.get_drawable_size() */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_AddTraceback("pygame_sdl2.display.get_drawable_size", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/display.pyx":690 * return None * * def get_num_video_displays(): # <<<<<<<<<<<<<< * rv = SDL_GetNumVideoDisplays() * if rv < 0: */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_7display_63get_num_video_displays(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused); /*proto*/ static PyMethodDef __pyx_mdef_11pygame_sdl2_7display_63get_num_video_displays = {"get_num_video_displays", (PyCFunction)__pyx_pw_11pygame_sdl2_7display_63get_num_video_displays, METH_NOARGS, 0}; static PyObject *__pyx_pw_11pygame_sdl2_7display_63get_num_video_displays(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("get_num_video_displays (wrapper)", 0); __pyx_r = __pyx_pf_11pygame_sdl2_7display_62get_num_video_displays(__pyx_self); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_7display_62get_num_video_displays(CYTHON_UNUSED PyObject *__pyx_self) { int __pyx_v_rv; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; __Pyx_RefNannySetupContext("get_num_video_displays", 0); /* "pygame_sdl2/display.pyx":691 * * def get_num_video_displays(): * rv = SDL_GetNumVideoDisplays() # <<<<<<<<<<<<<< * if rv < 0: * raise error() */ __pyx_v_rv = SDL_GetNumVideoDisplays(); /* "pygame_sdl2/display.pyx":692 * def get_num_video_displays(): * rv = SDL_GetNumVideoDisplays() * if rv < 0: # <<<<<<<<<<<<<< * raise error() * */ __pyx_t_1 = ((__pyx_v_rv < 0) != 0); if (__pyx_t_1) { /* "pygame_sdl2/display.pyx":693 * rv = SDL_GetNumVideoDisplays() * if rv < 0: * raise error() # <<<<<<<<<<<<<< * * return rv */ __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_error); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 693, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = NULL; if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) { __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3); if (likely(__pyx_t_4)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); __Pyx_INCREF(__pyx_t_4); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_3, function); } } if (__pyx_t_4) { __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 693, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; } else { __pyx_t_2 = __Pyx_PyObject_CallNoArg(__pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 693, __pyx_L1_error) } __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_Raise(__pyx_t_2, 0, 0, 0); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __PYX_ERR(0, 693, __pyx_L1_error) /* "pygame_sdl2/display.pyx":692 * def get_num_video_displays(): * rv = SDL_GetNumVideoDisplays() * if rv < 0: # <<<<<<<<<<<<<< * raise error() * */ } /* "pygame_sdl2/display.pyx":695 * raise error() * * return rv # <<<<<<<<<<<<<< * * def get_display_bounds(index): */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_v_rv); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 695, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; /* "pygame_sdl2/display.pyx":690 * return None * * def get_num_video_displays(): # <<<<<<<<<<<<<< * rv = SDL_GetNumVideoDisplays() * if rv < 0: */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_AddTraceback("pygame_sdl2.display.get_num_video_displays", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/display.pyx":697 * return rv * * def get_display_bounds(index): # <<<<<<<<<<<<<< * cdef SDL_Rect rect * rv = SDL_GetDisplayBounds(index, &rect) */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_7display_65get_display_bounds(PyObject *__pyx_self, PyObject *__pyx_v_index); /*proto*/ static PyMethodDef __pyx_mdef_11pygame_sdl2_7display_65get_display_bounds = {"get_display_bounds", (PyCFunction)__pyx_pw_11pygame_sdl2_7display_65get_display_bounds, METH_O, 0}; static PyObject *__pyx_pw_11pygame_sdl2_7display_65get_display_bounds(PyObject *__pyx_self, PyObject *__pyx_v_index) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("get_display_bounds (wrapper)", 0); __pyx_r = __pyx_pf_11pygame_sdl2_7display_64get_display_bounds(__pyx_self, ((PyObject *)__pyx_v_index)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_7display_64get_display_bounds(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_index) { SDL_Rect __pyx_v_rect; CYTHON_UNUSED int __pyx_v_rv; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; PyObject *__pyx_t_5 = NULL; PyObject *__pyx_t_6 = NULL; __Pyx_RefNannySetupContext("get_display_bounds", 0); /* "pygame_sdl2/display.pyx":699 * def get_display_bounds(index): * cdef SDL_Rect rect * rv = SDL_GetDisplayBounds(index, &rect) # <<<<<<<<<<<<<< * * return (rect.x, rect.y, rect.w, rect.h) */ __pyx_t_1 = __Pyx_PyInt_As_int(__pyx_v_index); if (unlikely((__pyx_t_1 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 699, __pyx_L1_error) __pyx_v_rv = SDL_GetDisplayBounds(__pyx_t_1, (&__pyx_v_rect)); /* "pygame_sdl2/display.pyx":701 * rv = SDL_GetDisplayBounds(index, &rect) * * return (rect.x, rect.y, rect.w, rect.h) # <<<<<<<<<<<<<< * * def get_platform(): */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_v_rect.x); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 701, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = __Pyx_PyInt_From_int(__pyx_v_rect.y); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 701, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = __Pyx_PyInt_From_int(__pyx_v_rect.w); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 701, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_5 = __Pyx_PyInt_From_int(__pyx_v_rect.h); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 701, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_6 = PyTuple_New(4); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 701, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_GIVEREF(__pyx_t_2); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_2); __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_6, 1, __pyx_t_3); __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_6, 2, __pyx_t_4); __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_6, 3, __pyx_t_5); __pyx_t_2 = 0; __pyx_t_3 = 0; __pyx_t_4 = 0; __pyx_t_5 = 0; __pyx_r = __pyx_t_6; __pyx_t_6 = 0; goto __pyx_L0; /* "pygame_sdl2/display.pyx":697 * return rv * * def get_display_bounds(index): # <<<<<<<<<<<<<< * cdef SDL_Rect rect * rv = SDL_GetDisplayBounds(index, &rect) */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_5); __Pyx_XDECREF(__pyx_t_6); __Pyx_AddTraceback("pygame_sdl2.display.get_display_bounds", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/display.pyx":703 * return (rect.x, rect.y, rect.w, rect.h) * * def get_platform(): # <<<<<<<<<<<<<< * return SDL_GetPlatform() * */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_7display_67get_platform(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused); /*proto*/ static PyMethodDef __pyx_mdef_11pygame_sdl2_7display_67get_platform = {"get_platform", (PyCFunction)__pyx_pw_11pygame_sdl2_7display_67get_platform, METH_NOARGS, 0}; static PyObject *__pyx_pw_11pygame_sdl2_7display_67get_platform(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("get_platform (wrapper)", 0); __pyx_r = __pyx_pf_11pygame_sdl2_7display_66get_platform(__pyx_self); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_7display_66get_platform(CYTHON_UNUSED PyObject *__pyx_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; __Pyx_RefNannySetupContext("get_platform", 0); /* "pygame_sdl2/display.pyx":704 * * def get_platform(): * return SDL_GetPlatform() # <<<<<<<<<<<<<< * * cdef api SDL_Window *PyWindow_AsWindow(window): */ __Pyx_XDECREF(__pyx_r); __pyx_t_1 = __Pyx_PyBytes_FromString(SDL_GetPlatform()); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 704, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "pygame_sdl2/display.pyx":703 * return (rect.x, rect.y, rect.w, rect.h) * * def get_platform(): # <<<<<<<<<<<<<< * return SDL_GetPlatform() * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("pygame_sdl2.display.get_platform", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/display.pyx":706 * return SDL_GetPlatform() * * cdef api SDL_Window *PyWindow_AsWindow(window): # <<<<<<<<<<<<<< * """ * Returns a pointer to the SDL_Window corresponding to `window`. If `window` */ static SDL_Window *__pyx_f_11pygame_sdl2_7display_PyWindow_AsWindow(PyObject *__pyx_v_window) { SDL_Window *__pyx_r; __Pyx_RefNannyDeclarations int __pyx_t_1; int __pyx_t_2; __Pyx_RefNannySetupContext("PyWindow_AsWindow", 0); __Pyx_INCREF(__pyx_v_window); /* "pygame_sdl2/display.pyx":713 * """ * * if window is None: # <<<<<<<<<<<<<< * window = main_window * */ __pyx_t_1 = (__pyx_v_window == Py_None); __pyx_t_2 = (__pyx_t_1 != 0); if (__pyx_t_2) { /* "pygame_sdl2/display.pyx":714 * * if window is None: * window = main_window # <<<<<<<<<<<<<< * * if window is None: */ __Pyx_INCREF(((PyObject *)__pyx_v_11pygame_sdl2_7display_main_window)); __Pyx_DECREF_SET(__pyx_v_window, ((PyObject *)__pyx_v_11pygame_sdl2_7display_main_window)); /* "pygame_sdl2/display.pyx":713 * """ * * if window is None: # <<<<<<<<<<<<<< * window = main_window * */ } /* "pygame_sdl2/display.pyx":716 * window = main_window * * if window is None: # <<<<<<<<<<<<<< * return NULL * */ __pyx_t_2 = (__pyx_v_window == Py_None); __pyx_t_1 = (__pyx_t_2 != 0); if (__pyx_t_1) { /* "pygame_sdl2/display.pyx":717 * * if window is None: * return NULL # <<<<<<<<<<<<<< * * return ( window).window */ __pyx_r = NULL; goto __pyx_L0; /* "pygame_sdl2/display.pyx":716 * window = main_window * * if window is None: # <<<<<<<<<<<<<< * return NULL * */ } /* "pygame_sdl2/display.pyx":719 * return NULL * * return ( window).window # <<<<<<<<<<<<<< */ __pyx_r = ((struct __pyx_obj_11pygame_sdl2_7display_Window *)__pyx_v_window)->window; goto __pyx_L0; /* "pygame_sdl2/display.pyx":706 * return SDL_GetPlatform() * * cdef api SDL_Window *PyWindow_AsWindow(window): # <<<<<<<<<<<<<< * """ * Returns a pointer to the SDL_Window corresponding to `window`. If `window` */ /* function exit code */ __pyx_L0:; __Pyx_XDECREF(__pyx_v_window); __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_tp_new_11pygame_sdl2_7display_Window(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) { struct __pyx_obj_11pygame_sdl2_7display_Window *p; PyObject *o; if (likely((t->tp_flags & Py_TPFLAGS_IS_ABSTRACT) == 0)) { o = (*t->tp_alloc)(t, 0); } else { o = (PyObject *) PyBaseObject_Type.tp_new(t, __pyx_empty_tuple, 0); } if (unlikely(!o)) return 0; p = ((struct __pyx_obj_11pygame_sdl2_7display_Window *)o); p->surface = ((struct __pyx_obj_11pygame_sdl2_7surface_Surface *)Py_None); Py_INCREF(Py_None); return o; } static void __pyx_tp_dealloc_11pygame_sdl2_7display_Window(PyObject *o) { struct __pyx_obj_11pygame_sdl2_7display_Window *p = (struct __pyx_obj_11pygame_sdl2_7display_Window *)o; #if PY_VERSION_HEX >= 0x030400a1 if (unlikely(Py_TYPE(o)->tp_finalize) && !_PyGC_FINALIZED(o)) { if (PyObject_CallFinalizerFromDealloc(o)) return; } #endif PyObject_GC_UnTrack(o); if (p->__weakref__) PyObject_ClearWeakRefs(o); Py_CLEAR(p->surface); (*Py_TYPE(o)->tp_free)(o); } static int __pyx_tp_traverse_11pygame_sdl2_7display_Window(PyObject *o, visitproc v, void *a) { int e; struct __pyx_obj_11pygame_sdl2_7display_Window *p = (struct __pyx_obj_11pygame_sdl2_7display_Window *)o; if (p->surface) { e = (*v)(((PyObject*)p->surface), a); if (e) return e; } return 0; } static int __pyx_tp_clear_11pygame_sdl2_7display_Window(PyObject *o) { PyObject* tmp; struct __pyx_obj_11pygame_sdl2_7display_Window *p = (struct __pyx_obj_11pygame_sdl2_7display_Window *)o; tmp = ((PyObject*)p->surface); p->surface = ((struct __pyx_obj_11pygame_sdl2_7surface_Surface *)Py_None); Py_INCREF(Py_None); Py_XDECREF(tmp); return 0; } static PyObject *__pyx_getprop_11pygame_sdl2_7display_6Window_surface(PyObject *o, CYTHON_UNUSED void *x) { return __pyx_pw_11pygame_sdl2_7display_6Window_7surface_1__get__(o); } static int __pyx_setprop_11pygame_sdl2_7display_6Window_surface(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) { if (v) { return __pyx_pw_11pygame_sdl2_7display_6Window_7surface_3__set__(o, v); } else { return __pyx_pw_11pygame_sdl2_7display_6Window_7surface_5__del__(o); } } static PyMethodDef __pyx_methods_11pygame_sdl2_7display_Window[] = { {"create_surface", (PyCFunction)__pyx_pw_11pygame_sdl2_7display_6Window_3create_surface, METH_NOARGS, __pyx_doc_11pygame_sdl2_7display_6Window_2create_surface}, {"destroy", (PyCFunction)__pyx_pw_11pygame_sdl2_7display_6Window_5destroy, METH_NOARGS, __pyx_doc_11pygame_sdl2_7display_6Window_4destroy}, {"resize", (PyCFunction)__pyx_pw_11pygame_sdl2_7display_6Window_7resize, METH_VARARGS|METH_KEYWORDS, __pyx_doc_11pygame_sdl2_7display_6Window_6resize}, {"get_window_flags", (PyCFunction)__pyx_pw_11pygame_sdl2_7display_6Window_9get_window_flags, METH_NOARGS, 0}, {"proxy_window_surface", (PyCFunction)__pyx_pw_11pygame_sdl2_7display_6Window_11proxy_window_surface, METH_NOARGS, 0}, {"flip", (PyCFunction)__pyx_pw_11pygame_sdl2_7display_6Window_13flip, METH_NOARGS, 0}, {"get_surface", (PyCFunction)__pyx_pw_11pygame_sdl2_7display_6Window_15get_surface, METH_NOARGS, 0}, {"update", (PyCFunction)__pyx_pw_11pygame_sdl2_7display_6Window_17update, METH_VARARGS|METH_KEYWORDS, 0}, {"get_wm_info", (PyCFunction)__pyx_pw_11pygame_sdl2_7display_6Window_19get_wm_info, METH_NOARGS, 0}, {"get_active", (PyCFunction)__pyx_pw_11pygame_sdl2_7display_6Window_21get_active, METH_NOARGS, 0}, {"iconify", (PyCFunction)__pyx_pw_11pygame_sdl2_7display_6Window_23iconify, METH_NOARGS, 0}, {"toggle_fullscreen", (PyCFunction)__pyx_pw_11pygame_sdl2_7display_6Window_25toggle_fullscreen, METH_NOARGS, 0}, {"set_gamma", (PyCFunction)__pyx_pw_11pygame_sdl2_7display_6Window_27set_gamma, METH_VARARGS|METH_KEYWORDS, 0}, {"set_gamma_ramp", (PyCFunction)__pyx_pw_11pygame_sdl2_7display_6Window_29set_gamma_ramp, METH_VARARGS|METH_KEYWORDS, 0}, {"set_icon", (PyCFunction)__pyx_pw_11pygame_sdl2_7display_6Window_31set_icon, METH_O, 0}, {"set_caption", (PyCFunction)__pyx_pw_11pygame_sdl2_7display_6Window_33set_caption, METH_O, 0}, {"get_drawable_size", (PyCFunction)__pyx_pw_11pygame_sdl2_7display_6Window_35get_drawable_size, METH_NOARGS, 0}, {0, 0, 0, 0} }; static struct PyGetSetDef __pyx_getsets_11pygame_sdl2_7display_Window[] = { {(char *)"surface", __pyx_getprop_11pygame_sdl2_7display_6Window_surface, __pyx_setprop_11pygame_sdl2_7display_6Window_surface, (char *)0, 0}, {0, 0, 0, 0, 0} }; static PyTypeObject __pyx_type_11pygame_sdl2_7display_Window = { PyVarObject_HEAD_INIT(0, 0) "pygame_sdl2.display.Window", /*tp_name*/ sizeof(struct __pyx_obj_11pygame_sdl2_7display_Window), /*tp_basicsize*/ 0, /*tp_itemsize*/ __pyx_tp_dealloc_11pygame_sdl2_7display_Window, /*tp_dealloc*/ 0, /*tp_print*/ 0, /*tp_getattr*/ 0, /*tp_setattr*/ #if PY_MAJOR_VERSION < 3 0, /*tp_compare*/ #endif #if PY_MAJOR_VERSION >= 3 0, /*tp_as_async*/ #endif 0, /*tp_repr*/ 0, /*tp_as_number*/ 0, /*tp_as_sequence*/ 0, /*tp_as_mapping*/ 0, /*tp_hash*/ 0, /*tp_call*/ 0, /*tp_str*/ 0, /*tp_getattro*/ 0, /*tp_setattro*/ 0, /*tp_as_buffer*/ Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/ 0, /*tp_doc*/ __pyx_tp_traverse_11pygame_sdl2_7display_Window, /*tp_traverse*/ __pyx_tp_clear_11pygame_sdl2_7display_Window, /*tp_clear*/ 0, /*tp_richcompare*/ 0, /*tp_weaklistoffset*/ 0, /*tp_iter*/ 0, /*tp_iternext*/ __pyx_methods_11pygame_sdl2_7display_Window, /*tp_methods*/ 0, /*tp_members*/ __pyx_getsets_11pygame_sdl2_7display_Window, /*tp_getset*/ 0, /*tp_base*/ 0, /*tp_dict*/ 0, /*tp_descr_get*/ 0, /*tp_descr_set*/ 0, /*tp_dictoffset*/ __pyx_pw_11pygame_sdl2_7display_6Window_1__init__, /*tp_init*/ 0, /*tp_alloc*/ __pyx_tp_new_11pygame_sdl2_7display_Window, /*tp_new*/ 0, /*tp_free*/ 0, /*tp_is_gc*/ 0, /*tp_bases*/ 0, /*tp_mro*/ 0, /*tp_cache*/ 0, /*tp_subclasses*/ 0, /*tp_weaklist*/ 0, /*tp_del*/ 0, /*tp_version_tag*/ #if PY_VERSION_HEX >= 0x030400a1 0, /*tp_finalize*/ #endif }; static PyMethodDef __pyx_methods[] = { {0, 0, 0, 0} }; #if PY_MAJOR_VERSION >= 3 static struct PyModuleDef __pyx_moduledef = { #if PY_VERSION_HEX < 0x03020000 { PyObject_HEAD_INIT(NULL) NULL, 0, NULL }, #else PyModuleDef_HEAD_INIT, #endif "display", 0, /* m_doc */ -1, /* m_size */ __pyx_methods /* m_methods */, NULL, /* m_reload */ NULL, /* m_traverse */ NULL, /* m_clear */ NULL /* m_free */ }; #endif static __Pyx_StringTabEntry __pyx_string_tab[] = { {&__pyx_kp_u_0, __pyx_k_0, sizeof(__pyx_k_0), 0, 1, 0, 0}, {&__pyx_kp_u_Couldn_t_allocate_rectangles, __pyx_k_Couldn_t_allocate_rectangles, sizeof(__pyx_k_Couldn_t_allocate_rectangles), 0, 1, 0, 0}, {&__pyx_n_s_GL_SWAP_CONTROL, __pyx_k_GL_SWAP_CONTROL, sizeof(__pyx_k_GL_SWAP_CONTROL), 0, 0, 1, 1}, {&__pyx_n_s_ImportError, __pyx_k_ImportError, sizeof(__pyx_k_ImportError), 0, 0, 1, 1}, {&__pyx_n_s_Info, __pyx_k_Info, sizeof(__pyx_k_Info), 0, 0, 1, 1}, {&__pyx_n_s_Info___init, __pyx_k_Info___init, sizeof(__pyx_k_Info___init), 0, 0, 1, 1}, {&__pyx_n_s_Info___repr, __pyx_k_Info___repr, sizeof(__pyx_k_Info___repr), 0, 0, 1, 1}, {&__pyx_kp_u_Info_r, __pyx_k_Info_r, sizeof(__pyx_k_Info_r), 0, 1, 0, 0}, {&__pyx_n_s_MemoryError, __pyx_k_MemoryError, sizeof(__pyx_k_MemoryError), 0, 0, 1, 1}, {&__pyx_n_u_PYGAME_IOS, __pyx_k_PYGAME_IOS, sizeof(__pyx_k_PYGAME_IOS), 0, 1, 0, 1}, {&__pyx_n_u_PYGAME_SDL2, __pyx_k_PYGAME_SDL2, sizeof(__pyx_k_PYGAME_SDL2), 0, 1, 0, 1}, {&__pyx_n_u_PYGAME_SDL2_AVOID_GL, __pyx_k_PYGAME_SDL2_AVOID_GL, sizeof(__pyx_k_PYGAME_SDL2_AVOID_GL), 0, 1, 0, 1}, {&__pyx_n_u_SDL_VIDEO_MAC_FULLSCREEN_SPACES, __pyx_k_SDL_VIDEO_MAC_FULLSCREEN_SPACES, sizeof(__pyx_k_SDL_VIDEO_MAC_FULLSCREEN_SPACES), 0, 1, 0, 1}, {&__pyx_n_s_SRCALPHA, __pyx_k_SRCALPHA, sizeof(__pyx_k_SRCALPHA), 0, 0, 1, 1}, {&__pyx_n_s_androidembed, __pyx_k_androidembed, sizeof(__pyx_k_androidembed), 0, 0, 1, 1}, {&__pyx_n_s_before_first_window, __pyx_k_before_first_window, sizeof(__pyx_k_before_first_window), 0, 0, 1, 1}, {&__pyx_n_s_bitsize, __pyx_k_bitsize, sizeof(__pyx_k_bitsize), 0, 0, 1, 1}, {&__pyx_n_s_blit_hw, __pyx_k_blit_hw, sizeof(__pyx_k_blit_hw), 0, 0, 1, 1}, {&__pyx_n_s_blit_hw_A, __pyx_k_blit_hw_A, sizeof(__pyx_k_blit_hw_A), 0, 0, 1, 1}, {&__pyx_n_s_blit_hw_CC, __pyx_k_blit_hw_CC, sizeof(__pyx_k_blit_hw_CC), 0, 0, 1, 1}, {&__pyx_n_s_blit_sw, __pyx_k_blit_sw, sizeof(__pyx_k_blit_sw), 0, 0, 1, 1}, {&__pyx_n_s_blit_sw_A, __pyx_k_blit_sw_A, sizeof(__pyx_k_blit_sw_A), 0, 0, 1, 1}, {&__pyx_n_s_blit_sw_CC, __pyx_k_blit_sw_CC, sizeof(__pyx_k_blit_sw_CC), 0, 0, 1, 1}, {&__pyx_n_s_blue, __pyx_k_blue, sizeof(__pyx_k_blue), 0, 0, 1, 1}, {&__pyx_n_s_bytesize, __pyx_k_bytesize, sizeof(__pyx_k_bytesize), 0, 0, 1, 1}, {&__pyx_n_s_close_window, __pyx_k_close_window, sizeof(__pyx_k_close_window), 0, 0, 1, 1}, {&__pyx_n_s_copy, __pyx_k_copy, sizeof(__pyx_k_copy), 0, 0, 1, 1}, {&__pyx_n_s_create_surface, __pyx_k_create_surface, sizeof(__pyx_k_create_surface), 0, 0, 1, 1}, {&__pyx_n_s_current_h, __pyx_k_current_h, sizeof(__pyx_k_current_h), 0, 0, 1, 1}, {&__pyx_n_s_current_w, __pyx_k_current_w, sizeof(__pyx_k_current_w), 0, 0, 1, 1}, {&__pyx_n_s_default, __pyx_k_default, sizeof(__pyx_k_default), 0, 0, 1, 1}, {&__pyx_n_s_default_icon, __pyx_k_default_icon, sizeof(__pyx_k_default_icon), 0, 0, 1, 1}, {&__pyx_n_s_default_swap_control, __pyx_k_default_swap_control, sizeof(__pyx_k_default_swap_control), 0, 0, 1, 1}, {&__pyx_n_s_default_title, __pyx_k_default_title, sizeof(__pyx_k_default_title), 0, 0, 1, 1}, {&__pyx_n_s_depth, __pyx_k_depth, sizeof(__pyx_k_depth), 0, 0, 1, 1}, {&__pyx_n_s_destroy, __pyx_k_destroy, sizeof(__pyx_k_destroy), 0, 0, 1, 1}, {&__pyx_n_s_dict, __pyx_k_dict, sizeof(__pyx_k_dict), 0, 0, 1, 1}, {&__pyx_n_s_display, __pyx_k_display, sizeof(__pyx_k_display), 0, 0, 1, 1}, {&__pyx_n_s_dm, __pyx_k_dm, sizeof(__pyx_k_dm), 0, 0, 1, 1}, {&__pyx_n_s_doc, __pyx_k_doc, sizeof(__pyx_k_doc), 0, 0, 1, 1}, {&__pyx_n_s_driver, __pyx_k_driver, sizeof(__pyx_k_driver), 0, 0, 1, 1}, {&__pyx_n_s_encode, __pyx_k_encode, sizeof(__pyx_k_encode), 0, 0, 1, 1}, {&__pyx_n_s_environ, __pyx_k_environ, sizeof(__pyx_k_environ), 0, 0, 1, 1}, {&__pyx_n_s_error, __pyx_k_error, sizeof(__pyx_k_error), 0, 0, 1, 1}, {&__pyx_n_s_event, __pyx_k_event, sizeof(__pyx_k_event), 0, 0, 1, 1}, {&__pyx_n_s_flag, __pyx_k_flag, sizeof(__pyx_k_flag), 0, 0, 1, 1}, {&__pyx_n_s_flags, __pyx_k_flags, sizeof(__pyx_k_flags), 0, 0, 1, 1}, {&__pyx_n_s_flip, __pyx_k_flip, sizeof(__pyx_k_flip), 0, 0, 1, 1}, {&__pyx_n_s_format, __pyx_k_format, sizeof(__pyx_k_format), 0, 0, 1, 1}, {&__pyx_n_s_get_active, __pyx_k_get_active, sizeof(__pyx_k_get_active), 0, 0, 1, 1}, {&__pyx_n_s_get_caption, __pyx_k_get_caption, sizeof(__pyx_k_get_caption), 0, 0, 1, 1}, {&__pyx_n_s_get_display_bounds, __pyx_k_get_display_bounds, sizeof(__pyx_k_get_display_bounds), 0, 0, 1, 1}, {&__pyx_n_s_get_drawable_size, __pyx_k_get_drawable_size, sizeof(__pyx_k_get_drawable_size), 0, 0, 1, 1}, {&__pyx_n_s_get_driver, __pyx_k_get_driver, sizeof(__pyx_k_get_driver), 0, 0, 1, 1}, {&__pyx_n_s_get_hint, __pyx_k_get_hint, sizeof(__pyx_k_get_hint), 0, 0, 1, 1}, {&__pyx_n_s_get_init, __pyx_k_get_init, sizeof(__pyx_k_get_init), 0, 0, 1, 1}, {&__pyx_n_s_get_num_video_displays, __pyx_k_get_num_video_displays, sizeof(__pyx_k_get_num_video_displays), 0, 0, 1, 1}, {&__pyx_n_s_get_platform, __pyx_k_get_platform, sizeof(__pyx_k_get_platform), 0, 0, 1, 1}, {&__pyx_n_s_get_size, __pyx_k_get_size, sizeof(__pyx_k_get_size), 0, 0, 1, 1}, {&__pyx_n_s_get_surface, __pyx_k_get_surface, sizeof(__pyx_k_get_surface), 0, 0, 1, 1}, {&__pyx_n_s_get_window, __pyx_k_get_window, sizeof(__pyx_k_get_window), 0, 0, 1, 1}, {&__pyx_n_s_get_window_flags, __pyx_k_get_window_flags, sizeof(__pyx_k_get_window_flags), 0, 0, 1, 1}, {&__pyx_n_s_get_wm_info, __pyx_k_get_wm_info, sizeof(__pyx_k_get_wm_info), 0, 0, 1, 1}, {&__pyx_n_s_gl_get_attribute, __pyx_k_gl_get_attribute, sizeof(__pyx_k_gl_get_attribute), 0, 0, 1, 1}, {&__pyx_n_s_gl_load_library, __pyx_k_gl_load_library, sizeof(__pyx_k_gl_load_library), 0, 0, 1, 1}, {&__pyx_n_s_gl_reset_attributes, __pyx_k_gl_reset_attributes, sizeof(__pyx_k_gl_reset_attributes), 0, 0, 1, 1}, {&__pyx_n_s_gl_set_attribute, __pyx_k_gl_set_attribute, sizeof(__pyx_k_gl_set_attribute), 0, 0, 1, 1}, {&__pyx_n_s_gl_unload_library, __pyx_k_gl_unload_library, sizeof(__pyx_k_gl_unload_library), 0, 0, 1, 1}, {&__pyx_n_s_green, __pyx_k_green, sizeof(__pyx_k_green), 0, 0, 1, 1}, {&__pyx_n_s_hint, __pyx_k_hint, sizeof(__pyx_k_hint), 0, 0, 1, 1}, {&__pyx_kp_s_home_tom_ab_pygame_sdl2_src_pyg, __pyx_k_home_tom_ab_pygame_sdl2_src_pyg, sizeof(__pyx_k_home_tom_ab_pygame_sdl2_src_pyg), 0, 0, 1, 0}, {&__pyx_n_s_hw, __pyx_k_hw, sizeof(__pyx_k_hw), 0, 0, 1, 1}, {&__pyx_n_s_i, __pyx_k_i, sizeof(__pyx_k_i), 0, 0, 1, 1}, {&__pyx_n_s_iconify, __pyx_k_iconify, sizeof(__pyx_k_iconify), 0, 0, 1, 1}, {&__pyx_n_s_icontitle, __pyx_k_icontitle, sizeof(__pyx_k_icontitle), 0, 0, 1, 1}, {&__pyx_n_s_import, __pyx_k_import, sizeof(__pyx_k_import), 0, 0, 1, 1}, {&__pyx_n_s_index, __pyx_k_index, sizeof(__pyx_k_index), 0, 0, 1, 1}, {&__pyx_n_s_init, __pyx_k_init, sizeof(__pyx_k_init), 0, 0, 1, 1}, {&__pyx_n_s_init_2, __pyx_k_init_2, sizeof(__pyx_k_init_2), 0, 0, 1, 1}, {&__pyx_n_s_init_done, __pyx_k_init_done, sizeof(__pyx_k_init_done), 0, 0, 1, 1}, {&__pyx_n_s_ios, __pyx_k_ios, sizeof(__pyx_k_ios), 0, 0, 1, 1}, {&__pyx_n_s_list_modes, __pyx_k_list_modes, sizeof(__pyx_k_list_modes), 0, 0, 1, 1}, {&__pyx_n_s_losses, __pyx_k_losses, sizeof(__pyx_k_losses), 0, 0, 1, 1}, {&__pyx_n_s_main, __pyx_k_main, sizeof(__pyx_k_main), 0, 0, 1, 1}, {&__pyx_n_s_main_done, __pyx_k_main_done, sizeof(__pyx_k_main_done), 0, 0, 1, 1}, {&__pyx_n_s_main_window, __pyx_k_main_window, sizeof(__pyx_k_main_window), 0, 0, 1, 1}, {&__pyx_n_s_masks, __pyx_k_masks, sizeof(__pyx_k_masks), 0, 0, 1, 1}, {&__pyx_n_s_metaclass, __pyx_k_metaclass, sizeof(__pyx_k_metaclass), 0, 0, 1, 1}, {&__pyx_n_s_mode, __pyx_k_mode, sizeof(__pyx_k_mode), 0, 0, 1, 1}, {&__pyx_n_s_mode_ok, __pyx_k_mode_ok, sizeof(__pyx_k_mode_ok), 0, 0, 1, 1}, {&__pyx_n_s_module, __pyx_k_module, sizeof(__pyx_k_module), 0, 0, 1, 1}, {&__pyx_n_s_num_modes, __pyx_k_num_modes, sizeof(__pyx_k_num_modes), 0, 0, 1, 1}, {&__pyx_n_s_object, __pyx_k_object, sizeof(__pyx_k_object), 0, 0, 1, 1}, {&__pyx_n_s_opengl, __pyx_k_opengl, sizeof(__pyx_k_opengl), 0, 0, 1, 1}, {&__pyx_n_s_os, __pyx_k_os, sizeof(__pyx_k_os), 0, 0, 1, 1}, {&__pyx_n_s_path, __pyx_k_path, sizeof(__pyx_k_path), 0, 0, 1, 1}, {&__pyx_n_s_pos, __pyx_k_pos, sizeof(__pyx_k_pos), 0, 0, 1, 1}, {&__pyx_n_s_prepare, __pyx_k_prepare, sizeof(__pyx_k_prepare), 0, 0, 1, 1}, {&__pyx_n_s_proxy_window_surface, __pyx_k_proxy_window_surface, sizeof(__pyx_k_proxy_window_surface), 0, 0, 1, 1}, {&__pyx_n_s_pygame_hints, __pyx_k_pygame_hints, sizeof(__pyx_k_pygame_hints), 0, 0, 1, 1}, {&__pyx_n_s_pygame_sdl2, __pyx_k_pygame_sdl2, sizeof(__pyx_k_pygame_sdl2), 0, 0, 1, 1}, {&__pyx_n_s_pygame_sdl2_display, __pyx_k_pygame_sdl2_display, sizeof(__pyx_k_pygame_sdl2_display), 0, 0, 1, 1}, {&__pyx_n_s_pygame_sdl2_error, __pyx_k_pygame_sdl2_error, sizeof(__pyx_k_pygame_sdl2_error), 0, 0, 1, 1}, {&__pyx_n_s_pygame_sdl2_locals, __pyx_k_pygame_sdl2_locals, sizeof(__pyx_k_pygame_sdl2_locals), 0, 0, 1, 1}, {&__pyx_kp_u_pygame_window, __pyx_k_pygame_window, sizeof(__pyx_k_pygame_window), 0, 1, 0, 0}, {&__pyx_n_s_pyx_capi, __pyx_k_pyx_capi, sizeof(__pyx_k_pyx_capi), 0, 0, 1, 1}, {&__pyx_n_s_pyx_vtable, __pyx_k_pyx_vtable, sizeof(__pyx_k_pyx_vtable), 0, 0, 1, 1}, {&__pyx_n_s_qualname, __pyx_k_qualname, sizeof(__pyx_k_qualname), 0, 0, 1, 1}, {&__pyx_n_s_quit, __pyx_k_quit, sizeof(__pyx_k_quit), 0, 0, 1, 1}, {&__pyx_n_s_range, __pyx_k_range, sizeof(__pyx_k_range), 0, 0, 1, 1}, {&__pyx_n_s_rect, __pyx_k_rect, sizeof(__pyx_k_rect), 0, 0, 1, 1}, {&__pyx_n_s_rectangles, __pyx_k_rectangles, sizeof(__pyx_k_rectangles), 0, 0, 1, 1}, {&__pyx_n_s_red, __pyx_k_red, sizeof(__pyx_k_red), 0, 0, 1, 1}, {&__pyx_n_s_refresh_rate, __pyx_k_refresh_rate, sizeof(__pyx_k_refresh_rate), 0, 0, 1, 1}, {&__pyx_n_s_register_init, __pyx_k_register_init, sizeof(__pyx_k_register_init), 0, 0, 1, 1}, {&__pyx_n_s_register_quit, __pyx_k_register_quit, sizeof(__pyx_k_register_quit), 0, 0, 1, 1}, {&__pyx_n_s_repr, __pyx_k_repr, sizeof(__pyx_k_repr), 0, 0, 1, 1}, {&__pyx_n_s_resize, __pyx_k_resize, sizeof(__pyx_k_resize), 0, 0, 1, 1}, {&__pyx_n_s_resolution, __pyx_k_resolution, sizeof(__pyx_k_resolution), 0, 0, 1, 1}, {&__pyx_n_s_rv, __pyx_k_rv, sizeof(__pyx_k_rv), 0, 0, 1, 1}, {&__pyx_n_s_sdl_main_init, __pyx_k_sdl_main_init, sizeof(__pyx_k_sdl_main_init), 0, 0, 1, 1}, {&__pyx_n_s_self, __pyx_k_self, sizeof(__pyx_k_self), 0, 0, 1, 1}, {&__pyx_n_s_set_caption, __pyx_k_set_caption, sizeof(__pyx_k_set_caption), 0, 0, 1, 1}, {&__pyx_n_s_set_gamma, __pyx_k_set_gamma, sizeof(__pyx_k_set_gamma), 0, 0, 1, 1}, {&__pyx_n_s_set_gamma_ramp, __pyx_k_set_gamma_ramp, sizeof(__pyx_k_set_gamma_ramp), 0, 0, 1, 1}, {&__pyx_n_s_set_icon, __pyx_k_set_icon, sizeof(__pyx_k_set_icon), 0, 0, 1, 1}, {&__pyx_n_s_set_mode, __pyx_k_set_mode, sizeof(__pyx_k_set_mode), 0, 0, 1, 1}, {&__pyx_n_s_shifts, __pyx_k_shifts, sizeof(__pyx_k_shifts), 0, 0, 1, 1}, {&__pyx_n_s_shown_first_window, __pyx_k_shown_first_window, sizeof(__pyx_k_shown_first_window), 0, 0, 1, 1}, {&__pyx_n_s_size, __pyx_k_size, sizeof(__pyx_k_size), 0, 0, 1, 1}, {&__pyx_n_s_surface, __pyx_k_surface, sizeof(__pyx_k_surface), 0, 0, 1, 1}, {&__pyx_n_s_t, __pyx_k_t, sizeof(__pyx_k_t), 0, 0, 1, 1}, {&__pyx_n_s_test, __pyx_k_test, sizeof(__pyx_k_test), 0, 0, 1, 1}, {&__pyx_n_s_title, __pyx_k_title, sizeof(__pyx_k_title), 0, 0, 1, 1}, {&__pyx_n_s_toggle_fullscreen, __pyx_k_toggle_fullscreen, sizeof(__pyx_k_toggle_fullscreen), 0, 0, 1, 1}, {&__pyx_n_s_update, __pyx_k_update, sizeof(__pyx_k_update), 0, 0, 1, 1}, {&__pyx_kp_u_utf_8, __pyx_k_utf_8, sizeof(__pyx_k_utf_8), 0, 1, 0, 0}, {&__pyx_n_s_value, __pyx_k_value, sizeof(__pyx_k_value), 0, 0, 1, 1}, {&__pyx_n_s_video_mem, __pyx_k_video_mem, sizeof(__pyx_k_video_mem), 0, 0, 1, 1}, {&__pyx_n_s_warnings, __pyx_k_warnings, sizeof(__pyx_k_warnings), 0, 0, 1, 1}, {&__pyx_n_s_wm, __pyx_k_wm, sizeof(__pyx_k_wm), 0, 0, 1, 1}, {0, 0, 0, 0, 0, 0, 0} }; static int __Pyx_InitCachedBuiltins(void) { __pyx_builtin_object = __Pyx_GetBuiltinName(__pyx_n_s_object); if (!__pyx_builtin_object) __PYX_ERR(0, 477, __pyx_L1_error) __pyx_builtin_ImportError = __Pyx_GetBuiltinName(__pyx_n_s_ImportError); if (!__pyx_builtin_ImportError) __PYX_ERR(0, 140, __pyx_L1_error) __pyx_builtin_MemoryError = __Pyx_GetBuiltinName(__pyx_n_s_MemoryError); if (!__pyx_builtin_MemoryError) __PYX_ERR(0, 329, __pyx_L1_error) __pyx_builtin_range = __Pyx_GetBuiltinName(__pyx_n_s_range); if (!__pyx_builtin_range) __PYX_ERR(0, 393, __pyx_L1_error) return 0; __pyx_L1_error:; return -1; } static int __Pyx_InitCachedConstants(void) { __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__Pyx_InitCachedConstants", 0); /* "pygame_sdl2/display.pyx":48 * * if not isinstance(hint, bytes): * hint = hint.encode("utf-8") # <<<<<<<<<<<<<< * * if not isinstance(value, bytes): */ __pyx_tuple_ = PyTuple_Pack(1, __pyx_kp_u_utf_8); if (unlikely(!__pyx_tuple_)) __PYX_ERR(0, 48, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple_); __Pyx_GIVEREF(__pyx_tuple_); /* "pygame_sdl2/display.pyx":51 * * if not isinstance(value, bytes): * value = value.encode("utf-8") # <<<<<<<<<<<<<< * * SDL_SetHint(hint, value) */ __pyx_tuple__2 = PyTuple_Pack(1, __pyx_kp_u_utf_8); if (unlikely(!__pyx_tuple__2)) __PYX_ERR(0, 51, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__2); __Pyx_GIVEREF(__pyx_tuple__2); /* "pygame_sdl2/display.pyx":93 * sdl_main_init() * * hint("SDL_VIDEO_MAC_FULLSCREEN_SPACES", "0") # <<<<<<<<<<<<<< * * if SDL_InitSubSystem(SDL_INIT_VIDEO): */ __pyx_tuple__3 = PyTuple_Pack(2, __pyx_n_u_SDL_VIDEO_MAC_FULLSCREEN_SPACES, __pyx_kp_u_0); if (unlikely(!__pyx_tuple__3)) __PYX_ERR(0, 93, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__3); __Pyx_GIVEREF(__pyx_tuple__3); /* "pygame_sdl2/display.pyx":146 * * cdef class Window: * def __init__(self, title, resolution=(0, 0), flags=0, depth=0, pos=(SDL_WINDOWPOS_UNDEFINED, SDL_WINDOWPOS_UNDEFINED)): # <<<<<<<<<<<<<< * * if not isinstance(title, bytes): */ __pyx_tuple__4 = PyTuple_Pack(2, __pyx_int_0, __pyx_int_0); if (unlikely(!__pyx_tuple__4)) __PYX_ERR(0, 146, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__4); __Pyx_GIVEREF(__pyx_tuple__4); /* "pygame_sdl2/display.pyx":149 * * if not isinstance(title, bytes): * title = title.encode("utf-8") # <<<<<<<<<<<<<< * * _before_first_window() */ __pyx_tuple__6 = PyTuple_Pack(1, __pyx_kp_u_utf_8); if (unlikely(!__pyx_tuple__6)) __PYX_ERR(0, 149, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__6); __Pyx_GIVEREF(__pyx_tuple__6); /* "pygame_sdl2/display.pyx":157 * # If we do not get the AVOID_GL hint, we always create a GL-compatible * # window. This lets us change the OPENGL flag later on. * if int(_get_hint("PYGAME_SDL2_AVOID_GL", "0")): # <<<<<<<<<<<<<< * gl_flag = 0 * else: */ __pyx_tuple__7 = PyTuple_Pack(2, __pyx_n_u_PYGAME_SDL2_AVOID_GL, __pyx_kp_u_0); if (unlikely(!__pyx_tuple__7)) __PYX_ERR(0, 157, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__7); __Pyx_GIVEREF(__pyx_tuple__7); /* "pygame_sdl2/display.pyx":219 * if self.window_surface.format.BitsPerPixel == 32: * * self.surface = Surface(()) # <<<<<<<<<<<<<< * self.surface.surface = self.window_surface * self.surface.owns_surface = False */ __pyx_tuple__8 = PyTuple_Pack(1, __pyx_empty_tuple); if (unlikely(!__pyx_tuple__8)) __PYX_ERR(0, 219, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__8); __Pyx_GIVEREF(__pyx_tuple__8); /* "pygame_sdl2/display.pyx":329 * rects = calloc(len(rectangles), sizeof(SDL_Rect)) * if rects == NULL: * raise MemoryError("Couldn't allocate rectangles.") # <<<<<<<<<<<<<< * * try: */ __pyx_tuple__9 = PyTuple_Pack(1, __pyx_kp_u_Couldn_t_allocate_rectangles); if (unlikely(!__pyx_tuple__9)) __PYX_ERR(0, 329, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__9); __Pyx_GIVEREF(__pyx_tuple__9); /* "pygame_sdl2/display.pyx":409 * * if not isinstance(title, bytes): * title = title.encode("utf-8") # <<<<<<<<<<<<<< * * SDL_SetWindowTitle(self.window, title) */ __pyx_tuple__10 = PyTuple_Pack(1, __pyx_kp_u_utf_8); if (unlikely(!__pyx_tuple__10)) __PYX_ERR(0, 409, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__10); __Pyx_GIVEREF(__pyx_tuple__10); /* "pygame_sdl2/display.pyx":428 * default_swap_control = 1 * * def set_mode(resolution=(0, 0), flags=0, depth=0, pos=(SDL_WINDOWPOS_UNDEFINED, SDL_WINDOWPOS_UNDEFINED)): # <<<<<<<<<<<<<< * global main_window * */ __pyx_tuple__11 = PyTuple_Pack(2, __pyx_int_0, __pyx_int_0); if (unlikely(!__pyx_tuple__11)) __PYX_ERR(0, 428, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__11); __Pyx_GIVEREF(__pyx_tuple__11); /* "pygame_sdl2/display.pyx":40 * _pygame_hints = { } * * def hint(hint, value): # <<<<<<<<<<<<<< * * if str(hint).startswith("PYGAME_SDL2"): */ __pyx_tuple__13 = PyTuple_Pack(2, __pyx_n_s_hint, __pyx_n_s_value); if (unlikely(!__pyx_tuple__13)) __PYX_ERR(0, 40, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__13); __Pyx_GIVEREF(__pyx_tuple__13); __pyx_codeobj__14 = (PyObject*)__Pyx_PyCode_New(2, 0, 2, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__13, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_tom_ab_pygame_sdl2_src_pyg, __pyx_n_s_hint, 40, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__14)) __PYX_ERR(0, 40, __pyx_L1_error) /* "pygame_sdl2/display.pyx":55 * SDL_SetHint(hint, value) * * def _get_hint(hint, default): # <<<<<<<<<<<<<< * hint = str(hint) * */ __pyx_tuple__15 = PyTuple_Pack(2, __pyx_n_s_hint, __pyx_n_s_default); if (unlikely(!__pyx_tuple__15)) __PYX_ERR(0, 55, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__15); __Pyx_GIVEREF(__pyx_tuple__15); __pyx_codeobj__16 = (PyObject*)__Pyx_PyCode_New(2, 0, 2, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__15, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_tom_ab_pygame_sdl2_src_pyg, __pyx_n_s_get_hint, 55, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__16)) __PYX_ERR(0, 55, __pyx_L1_error) /* "pygame_sdl2/display.pyx":69 * main_done = False * * def sdl_main_init(): # <<<<<<<<<<<<<< * global main_done * */ __pyx_codeobj__17 = (PyObject*)__Pyx_PyCode_New(0, 0, 0, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_tom_ab_pygame_sdl2_src_pyg, __pyx_n_s_sdl_main_init, 69, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__17)) __PYX_ERR(0, 69, __pyx_L1_error) /* "pygame_sdl2/display.pyx":86 * * @pygame_sdl2.register_init * def init(): # <<<<<<<<<<<<<< * * if init_done: */ __pyx_codeobj__18 = (PyObject*)__Pyx_PyCode_New(0, 0, 0, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_tom_ab_pygame_sdl2_src_pyg, __pyx_n_s_init, 86, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__18)) __PYX_ERR(0, 86, __pyx_L1_error) /* "pygame_sdl2/display.pyx":106 * * @pygame_sdl2.register_quit * def quit(): # @ReservedAssignment # <<<<<<<<<<<<<< * * global init_done */ __pyx_codeobj__19 = (PyObject*)__Pyx_PyCode_New(0, 0, 0, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_tom_ab_pygame_sdl2_src_pyg, __pyx_n_s_quit, 106, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__19)) __PYX_ERR(0, 106, __pyx_L1_error) /* "pygame_sdl2/display.pyx":117 * init_done = False * * def get_init(): # <<<<<<<<<<<<<< * return init_done * */ __pyx_codeobj__20 = (PyObject*)__Pyx_PyCode_New(0, 0, 0, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_tom_ab_pygame_sdl2_src_pyg, __pyx_n_s_get_init, 117, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__20)) __PYX_ERR(0, 117, __pyx_L1_error) /* "pygame_sdl2/display.pyx":127 * _shown_first_window = False * * def _before_first_window(): # <<<<<<<<<<<<<< * global _shown_first_window * */ __pyx_tuple__21 = PyTuple_Pack(1, __pyx_n_s_androidembed); if (unlikely(!__pyx_tuple__21)) __PYX_ERR(0, 127, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__21); __Pyx_GIVEREF(__pyx_tuple__21); __pyx_codeobj__22 = (PyObject*)__Pyx_PyCode_New(0, 0, 1, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__21, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_tom_ab_pygame_sdl2_src_pyg, __pyx_n_s_before_first_window, 127, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__22)) __PYX_ERR(0, 127, __pyx_L1_error) /* "pygame_sdl2/display.pyx":428 * default_swap_control = 1 * * def set_mode(resolution=(0, 0), flags=0, depth=0, pos=(SDL_WINDOWPOS_UNDEFINED, SDL_WINDOWPOS_UNDEFINED)): # <<<<<<<<<<<<<< * global main_window * */ __pyx_tuple__23 = PyTuple_Pack(4, __pyx_n_s_resolution, __pyx_n_s_flags, __pyx_n_s_depth, __pyx_n_s_pos); if (unlikely(!__pyx_tuple__23)) __PYX_ERR(0, 428, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__23); __Pyx_GIVEREF(__pyx_tuple__23); __pyx_codeobj__24 = (PyObject*)__Pyx_PyCode_New(4, 0, 4, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__23, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_tom_ab_pygame_sdl2_src_pyg, __pyx_n_s_set_mode, 428, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__24)) __PYX_ERR(0, 428, __pyx_L1_error) /* "pygame_sdl2/display.pyx":447 * return main_window.surface * * def get_surface(): # <<<<<<<<<<<<<< * if main_window is None: * return None */ __pyx_codeobj__25 = (PyObject*)__Pyx_PyCode_New(0, 0, 0, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_tom_ab_pygame_sdl2_src_pyg, __pyx_n_s_get_surface, 447, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__25)) __PYX_ERR(0, 447, __pyx_L1_error) /* "pygame_sdl2/display.pyx":453 * return main_window.get_surface() * * def get_window(): # <<<<<<<<<<<<<< * """ * Returns the Window created by set_mode, or None if no such window */ __pyx_codeobj__26 = (PyObject*)__Pyx_PyCode_New(0, 0, 0, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_tom_ab_pygame_sdl2_src_pyg, __pyx_n_s_get_window, 453, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__26)) __PYX_ERR(0, 453, __pyx_L1_error) /* "pygame_sdl2/display.pyx":461 * return main_window * * def flip(): # <<<<<<<<<<<<<< * if main_window: * main_window.flip() */ __pyx_codeobj__27 = (PyObject*)__Pyx_PyCode_New(0, 0, 0, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_tom_ab_pygame_sdl2_src_pyg, __pyx_n_s_flip, 461, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__27)) __PYX_ERR(0, 461, __pyx_L1_error) /* "pygame_sdl2/display.pyx":465 * main_window.flip() * * def update(rectangles=None): # <<<<<<<<<<<<<< * if main_window: * main_window.update(rectangles) */ __pyx_tuple__28 = PyTuple_Pack(1, __pyx_n_s_rectangles); if (unlikely(!__pyx_tuple__28)) __PYX_ERR(0, 465, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__28); __Pyx_GIVEREF(__pyx_tuple__28); __pyx_codeobj__29 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__28, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_tom_ab_pygame_sdl2_src_pyg, __pyx_n_s_update, 465, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__29)) __PYX_ERR(0, 465, __pyx_L1_error) /* "pygame_sdl2/display.pyx":469 * main_window.update(rectangles) * * def get_driver(): # <<<<<<<<<<<<<< * cdef const char *driver = SDL_GetCurrentVideoDriver() * */ __pyx_tuple__30 = PyTuple_Pack(1, __pyx_n_s_driver); if (unlikely(!__pyx_tuple__30)) __PYX_ERR(0, 469, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__30); __Pyx_GIVEREF(__pyx_tuple__30); __pyx_codeobj__31 = (PyObject*)__Pyx_PyCode_New(0, 0, 1, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__30, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_tom_ab_pygame_sdl2_src_pyg, __pyx_n_s_get_driver, 469, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__31)) __PYX_ERR(0, 469, __pyx_L1_error) /* "pygame_sdl2/display.pyx":479 * class Info(object): * * def __init__(self): # <<<<<<<<<<<<<< * cdef SDL_DisplayMode dm * cdef SDL_PixelFormat *format */ __pyx_tuple__32 = PyTuple_Pack(3, __pyx_n_s_self, __pyx_n_s_dm, __pyx_n_s_format); if (unlikely(!__pyx_tuple__32)) __PYX_ERR(0, 479, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__32); __Pyx_GIVEREF(__pyx_tuple__32); __pyx_codeobj__33 = (PyObject*)__Pyx_PyCode_New(1, 0, 3, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__32, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_tom_ab_pygame_sdl2_src_pyg, __pyx_n_s_init_2, 479, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__33)) __PYX_ERR(0, 479, __pyx_L1_error) /* "pygame_sdl2/display.pyx":538 * self.blit_sw_A = False * * def __repr__(self): # <<<<<<<<<<<<<< * return "".format(self.__dict__) * */ __pyx_tuple__34 = PyTuple_Pack(1, __pyx_n_s_self); if (unlikely(!__pyx_tuple__34)) __PYX_ERR(0, 538, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__34); __Pyx_GIVEREF(__pyx_tuple__34); __pyx_codeobj__35 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__34, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_tom_ab_pygame_sdl2_src_pyg, __pyx_n_s_repr, 538, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__35)) __PYX_ERR(0, 538, __pyx_L1_error) /* "pygame_sdl2/display.pyx":542 * * * def get_wm_info(): # <<<<<<<<<<<<<< * if main_window: * return main_window.get_wm_info() */ __pyx_codeobj__36 = (PyObject*)__Pyx_PyCode_New(0, 0, 0, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_tom_ab_pygame_sdl2_src_pyg, __pyx_n_s_get_wm_info, 542, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__36)) __PYX_ERR(0, 542, __pyx_L1_error) /* "pygame_sdl2/display.pyx":549 * * * def get_num_video_displays(): # <<<<<<<<<<<<<< * """ * Returns the number of video displays connected to the system. */ __pyx_tuple__37 = PyTuple_Pack(1, __pyx_n_s_rv); if (unlikely(!__pyx_tuple__37)) __PYX_ERR(0, 549, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__37); __Pyx_GIVEREF(__pyx_tuple__37); __pyx_codeobj__38 = (PyObject*)__Pyx_PyCode_New(0, 0, 1, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__37, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_tom_ab_pygame_sdl2_src_pyg, __pyx_n_s_get_num_video_displays, 549, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__38)) __PYX_ERR(0, 549, __pyx_L1_error) /* "pygame_sdl2/display.pyx":562 * * * def list_modes(depth=0, flags=0, display=0): # <<<<<<<<<<<<<< * """ * Returns a list of possible display modes for the display `display`. */ __pyx_tuple__39 = PyTuple_Pack(8, __pyx_n_s_depth, __pyx_n_s_flags, __pyx_n_s_display, __pyx_n_s_num_modes, __pyx_n_s_i, __pyx_n_s_mode, __pyx_n_s_rv, __pyx_n_s_t); if (unlikely(!__pyx_tuple__39)) __PYX_ERR(0, 562, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__39); __Pyx_GIVEREF(__pyx_tuple__39); __pyx_codeobj__40 = (PyObject*)__Pyx_PyCode_New(3, 0, 8, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__39, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_tom_ab_pygame_sdl2_src_pyg, __pyx_n_s_list_modes, 562, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__40)) __PYX_ERR(0, 562, __pyx_L1_error) /* "pygame_sdl2/display.pyx":587 * * * def mode_ok(size, flags=0, depth=0): # <<<<<<<<<<<<<< * """ * Returns true if size is in the result of list_modes(). */ __pyx_tuple__41 = PyTuple_Pack(3, __pyx_n_s_size, __pyx_n_s_flags, __pyx_n_s_depth); if (unlikely(!__pyx_tuple__41)) __PYX_ERR(0, 587, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__41); __Pyx_GIVEREF(__pyx_tuple__41); __pyx_codeobj__42 = (PyObject*)__Pyx_PyCode_New(3, 0, 3, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__41, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_tom_ab_pygame_sdl2_src_pyg, __pyx_n_s_mode_ok, 587, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__42)) __PYX_ERR(0, 587, __pyx_L1_error) /* "pygame_sdl2/display.pyx":594 * return tuple(size) in list_modes() * * def gl_reset_attributes(): # <<<<<<<<<<<<<< * SDL_GL_ResetAttributes() * */ __pyx_codeobj__43 = (PyObject*)__Pyx_PyCode_New(0, 0, 0, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_tom_ab_pygame_sdl2_src_pyg, __pyx_n_s_gl_reset_attributes, 594, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__43)) __PYX_ERR(0, 594, __pyx_L1_error) /* "pygame_sdl2/display.pyx":597 * SDL_GL_ResetAttributes() * * def gl_set_attribute(flag, value): # <<<<<<<<<<<<<< * * if flag == GL_SWAP_CONTROL: */ __pyx_tuple__44 = PyTuple_Pack(2, __pyx_n_s_flag, __pyx_n_s_value); if (unlikely(!__pyx_tuple__44)) __PYX_ERR(0, 597, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__44); __Pyx_GIVEREF(__pyx_tuple__44); __pyx_codeobj__45 = (PyObject*)__Pyx_PyCode_New(2, 0, 2, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__44, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_tom_ab_pygame_sdl2_src_pyg, __pyx_n_s_gl_set_attribute, 597, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__45)) __PYX_ERR(0, 597, __pyx_L1_error) /* "pygame_sdl2/display.pyx":617 * raise error() * * def gl_get_attribute(flag): # <<<<<<<<<<<<<< * cdef int rv * */ __pyx_tuple__46 = PyTuple_Pack(2, __pyx_n_s_flag, __pyx_n_s_rv); if (unlikely(!__pyx_tuple__46)) __PYX_ERR(0, 617, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__46); __Pyx_GIVEREF(__pyx_tuple__46); __pyx_codeobj__47 = (PyObject*)__Pyx_PyCode_New(1, 0, 2, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__46, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_tom_ab_pygame_sdl2_src_pyg, __pyx_n_s_gl_get_attribute, 617, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__47)) __PYX_ERR(0, 617, __pyx_L1_error) /* "pygame_sdl2/display.pyx":628 * return rv * * def gl_load_library(path): # <<<<<<<<<<<<<< * if path is None: * if SDL_GL_LoadLibrary(NULL): */ __pyx_tuple__48 = PyTuple_Pack(1, __pyx_n_s_path); if (unlikely(!__pyx_tuple__48)) __PYX_ERR(0, 628, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__48); __Pyx_GIVEREF(__pyx_tuple__48); __pyx_codeobj__49 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__48, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_tom_ab_pygame_sdl2_src_pyg, __pyx_n_s_gl_load_library, 628, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__49)) __PYX_ERR(0, 628, __pyx_L1_error) /* "pygame_sdl2/display.pyx":636 * raise error() * * def gl_unload_library(): # <<<<<<<<<<<<<< * SDL_GL_UnloadLibrary() * */ __pyx_codeobj__50 = (PyObject*)__Pyx_PyCode_New(0, 0, 0, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_tom_ab_pygame_sdl2_src_pyg, __pyx_n_s_gl_unload_library, 636, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__50)) __PYX_ERR(0, 636, __pyx_L1_error) /* "pygame_sdl2/display.pyx":639 * SDL_GL_UnloadLibrary() * * def get_active(): # <<<<<<<<<<<<<< * if main_window: * return main_window.get_active() */ __pyx_codeobj__51 = (PyObject*)__Pyx_PyCode_New(0, 0, 0, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_tom_ab_pygame_sdl2_src_pyg, __pyx_n_s_get_active, 639, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__51)) __PYX_ERR(0, 639, __pyx_L1_error) /* "pygame_sdl2/display.pyx":644 * return False * * def iconify(): # <<<<<<<<<<<<<< * if main_window: * return main_window.iconify() */ __pyx_codeobj__52 = (PyObject*)__Pyx_PyCode_New(0, 0, 0, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_tom_ab_pygame_sdl2_src_pyg, __pyx_n_s_iconify, 644, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__52)) __PYX_ERR(0, 644, __pyx_L1_error) /* "pygame_sdl2/display.pyx":650 * return False * * def toggle_fullscreen(): # <<<<<<<<<<<<<< * if main_window: * return main_window.toggle_fullscreen() */ __pyx_codeobj__53 = (PyObject*)__Pyx_PyCode_New(0, 0, 0, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_tom_ab_pygame_sdl2_src_pyg, __pyx_n_s_toggle_fullscreen, 650, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__53)) __PYX_ERR(0, 650, __pyx_L1_error) /* "pygame_sdl2/display.pyx":656 * return True * * def set_gamma(red, green=None, blue=None): # <<<<<<<<<<<<<< * if main_window: * return main_window.set_gamma(red, green, blue) */ __pyx_tuple__54 = PyTuple_Pack(3, __pyx_n_s_red, __pyx_n_s_green, __pyx_n_s_blue); if (unlikely(!__pyx_tuple__54)) __PYX_ERR(0, 656, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__54); __Pyx_GIVEREF(__pyx_tuple__54); __pyx_codeobj__55 = (PyObject*)__Pyx_PyCode_New(3, 0, 3, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__54, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_tom_ab_pygame_sdl2_src_pyg, __pyx_n_s_set_gamma, 656, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__55)) __PYX_ERR(0, 656, __pyx_L1_error) /* "pygame_sdl2/display.pyx":661 * return False * * def set_gamma_ramp(red, green, blue): # <<<<<<<<<<<<<< * if main_window: * return main_window.set_gamma_ramp(red, green, blue) */ __pyx_tuple__56 = PyTuple_Pack(3, __pyx_n_s_red, __pyx_n_s_green, __pyx_n_s_blue); if (unlikely(!__pyx_tuple__56)) __PYX_ERR(0, 661, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__56); __Pyx_GIVEREF(__pyx_tuple__56); __pyx_codeobj__57 = (PyObject*)__Pyx_PyCode_New(3, 0, 3, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__56, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_tom_ab_pygame_sdl2_src_pyg, __pyx_n_s_set_gamma_ramp, 661, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__57)) __PYX_ERR(0, 661, __pyx_L1_error) /* "pygame_sdl2/display.pyx":666 * return False * * def set_icon(surface): # <<<<<<<<<<<<<< * global default_icon * */ __pyx_tuple__58 = PyTuple_Pack(1, __pyx_n_s_surface); if (unlikely(!__pyx_tuple__58)) __PYX_ERR(0, 666, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__58); __Pyx_GIVEREF(__pyx_tuple__58); __pyx_codeobj__59 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__58, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_tom_ab_pygame_sdl2_src_pyg, __pyx_n_s_set_icon, 666, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__59)) __PYX_ERR(0, 666, __pyx_L1_error) /* "pygame_sdl2/display.pyx":674 * main_window.set_icon(default_icon) * * def set_caption(title, icontitle = None): # <<<<<<<<<<<<<< * global default_title * */ __pyx_tuple__60 = PyTuple_Pack(2, __pyx_n_s_title, __pyx_n_s_icontitle); if (unlikely(!__pyx_tuple__60)) __PYX_ERR(0, 674, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__60); __Pyx_GIVEREF(__pyx_tuple__60); __pyx_codeobj__61 = (PyObject*)__Pyx_PyCode_New(2, 0, 2, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__60, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_tom_ab_pygame_sdl2_src_pyg, __pyx_n_s_set_caption, 674, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__61)) __PYX_ERR(0, 674, __pyx_L1_error) /* "pygame_sdl2/display.pyx":682 * main_window.set_caption(default_title) * * def get_caption(): # <<<<<<<<<<<<<< * return default_title * */ __pyx_codeobj__62 = (PyObject*)__Pyx_PyCode_New(0, 0, 0, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_tom_ab_pygame_sdl2_src_pyg, __pyx_n_s_get_caption, 682, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__62)) __PYX_ERR(0, 682, __pyx_L1_error) /* "pygame_sdl2/display.pyx":685 * return default_title * * def get_drawable_size(): # <<<<<<<<<<<<<< * if main_window: * return main_window.get_drawable_size() */ __pyx_codeobj__63 = (PyObject*)__Pyx_PyCode_New(0, 0, 0, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_tom_ab_pygame_sdl2_src_pyg, __pyx_n_s_get_drawable_size, 685, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__63)) __PYX_ERR(0, 685, __pyx_L1_error) /* "pygame_sdl2/display.pyx":690 * return None * * def get_num_video_displays(): # <<<<<<<<<<<<<< * rv = SDL_GetNumVideoDisplays() * if rv < 0: */ __pyx_tuple__64 = PyTuple_Pack(1, __pyx_n_s_rv); if (unlikely(!__pyx_tuple__64)) __PYX_ERR(0, 690, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__64); __Pyx_GIVEREF(__pyx_tuple__64); __pyx_codeobj__65 = (PyObject*)__Pyx_PyCode_New(0, 0, 1, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__64, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_tom_ab_pygame_sdl2_src_pyg, __pyx_n_s_get_num_video_displays, 690, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__65)) __PYX_ERR(0, 690, __pyx_L1_error) /* "pygame_sdl2/display.pyx":697 * return rv * * def get_display_bounds(index): # <<<<<<<<<<<<<< * cdef SDL_Rect rect * rv = SDL_GetDisplayBounds(index, &rect) */ __pyx_tuple__66 = PyTuple_Pack(3, __pyx_n_s_index, __pyx_n_s_rect, __pyx_n_s_rv); if (unlikely(!__pyx_tuple__66)) __PYX_ERR(0, 697, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__66); __Pyx_GIVEREF(__pyx_tuple__66); __pyx_codeobj__67 = (PyObject*)__Pyx_PyCode_New(1, 0, 3, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__66, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_tom_ab_pygame_sdl2_src_pyg, __pyx_n_s_get_display_bounds, 697, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__67)) __PYX_ERR(0, 697, __pyx_L1_error) /* "pygame_sdl2/display.pyx":703 * return (rect.x, rect.y, rect.w, rect.h) * * def get_platform(): # <<<<<<<<<<<<<< * return SDL_GetPlatform() * */ __pyx_codeobj__68 = (PyObject*)__Pyx_PyCode_New(0, 0, 0, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_tom_ab_pygame_sdl2_src_pyg, __pyx_n_s_get_platform, 703, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__68)) __PYX_ERR(0, 703, __pyx_L1_error) __Pyx_RefNannyFinishContext(); return 0; __pyx_L1_error:; __Pyx_RefNannyFinishContext(); return -1; } static int __Pyx_InitGlobals(void) { if (__Pyx_InitStrings(__pyx_string_tab) < 0) __PYX_ERR(0, 1, __pyx_L1_error); __pyx_int_0 = PyInt_FromLong(0); if (unlikely(!__pyx_int_0)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_int_1 = PyInt_FromLong(1); if (unlikely(!__pyx_int_1)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_int_32 = PyInt_FromLong(32); if (unlikely(!__pyx_int_32)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_int_268435456 = PyInt_FromLong(268435456L); if (unlikely(!__pyx_int_268435456)) __PYX_ERR(0, 1, __pyx_L1_error) return 0; __pyx_L1_error:; return -1; } #if PY_MAJOR_VERSION < 3 PyMODINIT_FUNC initdisplay(void); /*proto*/ PyMODINIT_FUNC initdisplay(void) #else PyMODINIT_FUNC PyInit_display(void); /*proto*/ PyMODINIT_FUNC PyInit_display(void) #endif { PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; int __pyx_t_4; PyObject *__pyx_t_5 = NULL; PyObject *__pyx_t_6 = NULL; PyObject *__pyx_t_7 = NULL; __Pyx_RefNannyDeclarations #if CYTHON_REFNANNY __Pyx_RefNanny = __Pyx_RefNannyImportAPI("refnanny"); if (!__Pyx_RefNanny) { PyErr_Clear(); __Pyx_RefNanny = __Pyx_RefNannyImportAPI("Cython.Runtime.refnanny"); if (!__Pyx_RefNanny) Py_FatalError("failed to import 'refnanny' module"); } #endif __Pyx_RefNannySetupContext("PyMODINIT_FUNC PyInit_display(void)", 0); if (__Pyx_check_binary_version() < 0) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_empty_tuple = PyTuple_New(0); if (unlikely(!__pyx_empty_tuple)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_empty_bytes = PyBytes_FromStringAndSize("", 0); if (unlikely(!__pyx_empty_bytes)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_empty_unicode = PyUnicode_FromStringAndSize("", 0); if (unlikely(!__pyx_empty_unicode)) __PYX_ERR(0, 1, __pyx_L1_error) #ifdef __Pyx_CyFunction_USED if (__pyx_CyFunction_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error) #endif #ifdef __Pyx_FusedFunction_USED if (__pyx_FusedFunction_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error) #endif #ifdef __Pyx_Coroutine_USED if (__pyx_Coroutine_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error) #endif #ifdef __Pyx_Generator_USED if (__pyx_Generator_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error) #endif #ifdef __Pyx_StopAsyncIteration_USED if (__pyx_StopAsyncIteration_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error) #endif /*--- Library function declarations ---*/ /*--- Threads initialization code ---*/ #if defined(__PYX_FORCE_INIT_THREADS) && __PYX_FORCE_INIT_THREADS #ifdef WITH_THREAD /* Python build with threading support? */ PyEval_InitThreads(); #endif #endif /*--- Module creation code ---*/ #if PY_MAJOR_VERSION < 3 __pyx_m = Py_InitModule4("display", __pyx_methods, 0, 0, PYTHON_API_VERSION); Py_XINCREF(__pyx_m); #else __pyx_m = PyModule_Create(&__pyx_moduledef); #endif if (unlikely(!__pyx_m)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_d = PyModule_GetDict(__pyx_m); if (unlikely(!__pyx_d)) __PYX_ERR(0, 1, __pyx_L1_error) Py_INCREF(__pyx_d); __pyx_b = PyImport_AddModule(__Pyx_BUILTIN_MODULE_NAME); if (unlikely(!__pyx_b)) __PYX_ERR(0, 1, __pyx_L1_error) #if CYTHON_COMPILING_IN_PYPY Py_INCREF(__pyx_b); #endif if (PyObject_SetAttrString(__pyx_m, "__builtins__", __pyx_b) < 0) __PYX_ERR(0, 1, __pyx_L1_error); /*--- Initialize various global constants etc. ---*/ if (__Pyx_InitGlobals() < 0) __PYX_ERR(0, 1, __pyx_L1_error) #if PY_MAJOR_VERSION < 3 && (__PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT) if (__Pyx_init_sys_getdefaultencoding_params() < 0) __PYX_ERR(0, 1, __pyx_L1_error) #endif if (__pyx_module_is_main_pygame_sdl2__display) { if (PyObject_SetAttrString(__pyx_m, "__name__", __pyx_n_s_main) < 0) __PYX_ERR(0, 1, __pyx_L1_error) } #if PY_MAJOR_VERSION >= 3 { PyObject *modules = PyImport_GetModuleDict(); if (unlikely(!modules)) __PYX_ERR(0, 1, __pyx_L1_error) if (!PyDict_GetItemString(modules, "pygame_sdl2.display")) { if (unlikely(PyDict_SetItemString(modules, "pygame_sdl2.display", __pyx_m) < 0)) __PYX_ERR(0, 1, __pyx_L1_error) } } #endif /*--- Builtin init code ---*/ if (__Pyx_InitCachedBuiltins() < 0) __PYX_ERR(0, 1, __pyx_L1_error) /*--- Constants init code ---*/ if (__Pyx_InitCachedConstants() < 0) __PYX_ERR(0, 1, __pyx_L1_error) /*--- Global init code ---*/ __pyx_v_11pygame_sdl2_7display_main_window = ((struct __pyx_obj_11pygame_sdl2_7display_Window *)Py_None); Py_INCREF(Py_None); /*--- Variable export code ---*/ if (__Pyx_ExportVoidPtr(__pyx_n_s_main_window, (void *)&__pyx_v_11pygame_sdl2_7display_main_window, "struct __pyx_obj_11pygame_sdl2_7display_Window *") < 0) __PYX_ERR(0, 1, __pyx_L1_error) /*--- Function export code ---*/ if (__Pyx_ExportFunction("PyWindow_AsWindow", (void (*)(void))__pyx_f_11pygame_sdl2_7display_PyWindow_AsWindow, "SDL_Window *(PyObject *)") < 0) __PYX_ERR(0, 1, __pyx_L1_error) /*--- Type init code ---*/ if (PyType_Ready(&__pyx_type_11pygame_sdl2_7display_Window) < 0) __PYX_ERR(0, 145, __pyx_L1_error) __pyx_type_11pygame_sdl2_7display_Window.tp_print = 0; if (PyObject_SetAttrString(__pyx_m, "Window", (PyObject *)&__pyx_type_11pygame_sdl2_7display_Window) < 0) __PYX_ERR(0, 145, __pyx_L1_error) if (__pyx_type_11pygame_sdl2_7display_Window.tp_weaklistoffset == 0) __pyx_type_11pygame_sdl2_7display_Window.tp_weaklistoffset = offsetof(struct __pyx_obj_11pygame_sdl2_7display_Window, __weakref__); __pyx_ptype_11pygame_sdl2_7display_Window = &__pyx_type_11pygame_sdl2_7display_Window; /*--- Type import code ---*/ __pyx_ptype_11pygame_sdl2_7surface_Surface = __Pyx_ImportType("pygame_sdl2.surface", "Surface", sizeof(struct __pyx_obj_11pygame_sdl2_7surface_Surface), 1); if (unlikely(!__pyx_ptype_11pygame_sdl2_7surface_Surface)) __PYX_ERR(2, 23, __pyx_L1_error) __pyx_vtabptr_11pygame_sdl2_7surface_Surface = (struct __pyx_vtabstruct_11pygame_sdl2_7surface_Surface*)__Pyx_GetVtable(__pyx_ptype_11pygame_sdl2_7surface_Surface->tp_dict); if (unlikely(!__pyx_vtabptr_11pygame_sdl2_7surface_Surface)) __PYX_ERR(2, 23, __pyx_L1_error) __pyx_ptype_11pygame_sdl2_4rect_Rect = __Pyx_ImportType("pygame_sdl2.rect", "Rect", sizeof(struct __pyx_obj_11pygame_sdl2_4rect_Rect), 1); if (unlikely(!__pyx_ptype_11pygame_sdl2_4rect_Rect)) __PYX_ERR(3, 21, __pyx_L1_error) /*--- Variable import code ---*/ /*--- Function import code ---*/ __pyx_t_1 = __Pyx_ImportModule("pygame_sdl2.rect"); if (!__pyx_t_1) __PYX_ERR(0, 1, __pyx_L1_error) if (__Pyx_ImportFunction(__pyx_t_1, "to_sdl_rect", (void (**)(void))&__pyx_f_11pygame_sdl2_4rect_to_sdl_rect, "int (PyObject *, SDL_Rect *, struct __pyx_opt_args_11pygame_sdl2_4rect_to_sdl_rect *__pyx_optional_args)") < 0) __PYX_ERR(0, 1, __pyx_L1_error) Py_DECREF(__pyx_t_1); __pyx_t_1 = 0; /*--- Execution code ---*/ #if defined(__Pyx_Generator_USED) || defined(__Pyx_Coroutine_USED) if (__Pyx_patch_abc() < 0) __PYX_ERR(0, 1, __pyx_L1_error) #endif /* "pygame_sdl2/display.pyx":25 * * from libc.stdlib cimport calloc, free * from pygame_sdl2.locals import SRCALPHA, GL_SWAP_CONTROL # <<<<<<<<<<<<<< * from pygame_sdl2.error import error * import pygame_sdl2 */ __pyx_t_2 = PyList_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 25, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_INCREF(__pyx_n_s_SRCALPHA); __Pyx_GIVEREF(__pyx_n_s_SRCALPHA); PyList_SET_ITEM(__pyx_t_2, 0, __pyx_n_s_SRCALPHA); __Pyx_INCREF(__pyx_n_s_GL_SWAP_CONTROL); __Pyx_GIVEREF(__pyx_n_s_GL_SWAP_CONTROL); PyList_SET_ITEM(__pyx_t_2, 1, __pyx_n_s_GL_SWAP_CONTROL); __pyx_t_3 = __Pyx_Import(__pyx_n_s_pygame_sdl2_locals, __pyx_t_2, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 25, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_2 = __Pyx_ImportFrom(__pyx_t_3, __pyx_n_s_SRCALPHA); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 25, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_SRCALPHA, __pyx_t_2) < 0) __PYX_ERR(0, 25, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_2 = __Pyx_ImportFrom(__pyx_t_3, __pyx_n_s_GL_SWAP_CONTROL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 25, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_GL_SWAP_CONTROL, __pyx_t_2) < 0) __PYX_ERR(0, 25, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "pygame_sdl2/display.pyx":26 * from libc.stdlib cimport calloc, free * from pygame_sdl2.locals import SRCALPHA, GL_SWAP_CONTROL * from pygame_sdl2.error import error # <<<<<<<<<<<<<< * import pygame_sdl2 * */ __pyx_t_3 = PyList_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 26, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_INCREF(__pyx_n_s_error); __Pyx_GIVEREF(__pyx_n_s_error); PyList_SET_ITEM(__pyx_t_3, 0, __pyx_n_s_error); __pyx_t_2 = __Pyx_Import(__pyx_n_s_pygame_sdl2_error, __pyx_t_3, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 26, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_3 = __Pyx_ImportFrom(__pyx_t_2, __pyx_n_s_error); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 26, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); if (PyDict_SetItem(__pyx_d, __pyx_n_s_error, __pyx_t_3) < 0) __PYX_ERR(0, 26, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "pygame_sdl2/display.pyx":27 * from pygame_sdl2.locals import SRCALPHA, GL_SWAP_CONTROL * from pygame_sdl2.error import error * import pygame_sdl2 # <<<<<<<<<<<<<< * * import warnings */ __pyx_t_2 = __Pyx_Import(__pyx_n_s_pygame_sdl2, 0, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 27, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_pygame_sdl2, __pyx_t_2) < 0) __PYX_ERR(0, 27, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "pygame_sdl2/display.pyx":29 * import pygame_sdl2 * * import warnings # <<<<<<<<<<<<<< * import os * */ __pyx_t_2 = __Pyx_Import(__pyx_n_s_warnings, 0, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 29, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_warnings, __pyx_t_2) < 0) __PYX_ERR(0, 29, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "pygame_sdl2/display.pyx":30 * * import warnings * import os # <<<<<<<<<<<<<< * * # True if we are on ios. */ __pyx_t_2 = __Pyx_Import(__pyx_n_s_os, 0, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 30, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_os, __pyx_t_2) < 0) __PYX_ERR(0, 30, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "pygame_sdl2/display.pyx":33 * * # True if we are on ios. * ios = ("PYGAME_IOS" in os.environ) # <<<<<<<<<<<<<< * * # This inits SDL proper, and should be called by the other init methods. */ __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_os); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 33, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_environ); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 33, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_4 = (__Pyx_PySequence_ContainsTF(__pyx_n_u_PYGAME_IOS, __pyx_t_3, Py_EQ)); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(0, 33, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_3 = __Pyx_PyBool_FromLong(__pyx_t_4); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 33, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); if (PyDict_SetItem(__pyx_d, __pyx_n_s_ios, __pyx_t_3) < 0) __PYX_ERR(0, 33, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "pygame_sdl2/display.pyx":38 * * # A map from a PYGAME_SDL2 hint to what it was set to. * _pygame_hints = { } # <<<<<<<<<<<<<< * * def hint(hint, value): */ __pyx_t_3 = PyDict_New(); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 38, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); if (PyDict_SetItem(__pyx_d, __pyx_n_s_pygame_hints, __pyx_t_3) < 0) __PYX_ERR(0, 38, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "pygame_sdl2/display.pyx":40 * _pygame_hints = { } * * def hint(hint, value): # <<<<<<<<<<<<<< * * if str(hint).startswith("PYGAME_SDL2"): */ __pyx_t_3 = PyCFunction_NewEx(&__pyx_mdef_11pygame_sdl2_7display_1hint, NULL, __pyx_n_s_pygame_sdl2_display); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 40, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); if (PyDict_SetItem(__pyx_d, __pyx_n_s_hint, __pyx_t_3) < 0) __PYX_ERR(0, 40, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "pygame_sdl2/display.pyx":55 * SDL_SetHint(hint, value) * * def _get_hint(hint, default): # <<<<<<<<<<<<<< * hint = str(hint) * */ __pyx_t_3 = PyCFunction_NewEx(&__pyx_mdef_11pygame_sdl2_7display_3_get_hint, NULL, __pyx_n_s_pygame_sdl2_display); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 55, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); if (PyDict_SetItem(__pyx_d, __pyx_n_s_get_hint, __pyx_t_3) < 0) __PYX_ERR(0, 55, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "pygame_sdl2/display.pyx":67 * * * main_done = False # <<<<<<<<<<<<<< * * def sdl_main_init(): */ if (PyDict_SetItem(__pyx_d, __pyx_n_s_main_done, Py_False) < 0) __PYX_ERR(0, 67, __pyx_L1_error) /* "pygame_sdl2/display.pyx":69 * main_done = False * * def sdl_main_init(): # <<<<<<<<<<<<<< * global main_done * */ __pyx_t_3 = PyCFunction_NewEx(&__pyx_mdef_11pygame_sdl2_7display_5sdl_main_init, NULL, __pyx_n_s_pygame_sdl2_display); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 69, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); if (PyDict_SetItem(__pyx_d, __pyx_n_s_sdl_main_init, __pyx_t_3) < 0) __PYX_ERR(0, 69, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "pygame_sdl2/display.pyx":83 * * # True if init has been called without quit being called. * init_done = False # <<<<<<<<<<<<<< * * @pygame_sdl2.register_init */ if (PyDict_SetItem(__pyx_d, __pyx_n_s_init_done, Py_False) < 0) __PYX_ERR(0, 83, __pyx_L1_error) /* "pygame_sdl2/display.pyx":85 * init_done = False * * @pygame_sdl2.register_init # <<<<<<<<<<<<<< * def init(): * */ __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_pygame_sdl2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 85, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_register_init); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 85, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "pygame_sdl2/display.pyx":86 * * @pygame_sdl2.register_init * def init(): # <<<<<<<<<<<<<< * * if init_done: */ __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_11pygame_sdl2_7display_7init, NULL, __pyx_n_s_pygame_sdl2_display); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 86, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_6 = NULL; if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_5))) { __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_5); if (likely(__pyx_t_6)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5); __Pyx_INCREF(__pyx_t_6); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_5, function); } } if (!__pyx_t_6) { __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 85, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_GOTREF(__pyx_t_3); } else { #if CYTHON_FAST_PYCALL if (PyFunction_Check(__pyx_t_5)) { PyObject *__pyx_temp[2] = {__pyx_t_6, __pyx_t_2}; __pyx_t_3 = __Pyx_PyFunction_FastCall(__pyx_t_5, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 85, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } else #endif #if CYTHON_FAST_PYCCALL if (__Pyx_PyFastCFunction_Check(__pyx_t_5)) { PyObject *__pyx_temp[2] = {__pyx_t_6, __pyx_t_2}; __pyx_t_3 = __Pyx_PyCFunction_FastCall(__pyx_t_5, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 85, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } else #endif { __pyx_t_7 = PyTuple_New(1+1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 85, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_GIVEREF(__pyx_t_6); PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_6); __pyx_t_6 = NULL; __Pyx_GIVEREF(__pyx_t_2); PyTuple_SET_ITEM(__pyx_t_7, 0+1, __pyx_t_2); __pyx_t_2 = 0; __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_7, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 85, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; } } __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; if (PyDict_SetItem(__pyx_d, __pyx_n_s_init, __pyx_t_3) < 0) __PYX_ERR(0, 86, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "pygame_sdl2/display.pyx":105 * * * @pygame_sdl2.register_quit # <<<<<<<<<<<<<< * def quit(): # @ReservedAssignment * */ __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_pygame_sdl2); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 105, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_register_quit); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 105, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; /* "pygame_sdl2/display.pyx":106 * * @pygame_sdl2.register_quit * def quit(): # @ReservedAssignment # <<<<<<<<<<<<<< * * global init_done */ __pyx_t_5 = PyCFunction_NewEx(&__pyx_mdef_11pygame_sdl2_7display_9quit, NULL, __pyx_n_s_pygame_sdl2_display); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 106, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_2 = NULL; if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_7))) { __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_7); if (likely(__pyx_t_2)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_7); __Pyx_INCREF(__pyx_t_2); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_7, function); } } if (!__pyx_t_2) { __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_t_7, __pyx_t_5); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 105, __pyx_L1_error) __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_GOTREF(__pyx_t_3); } else { #if CYTHON_FAST_PYCALL if (PyFunction_Check(__pyx_t_7)) { PyObject *__pyx_temp[2] = {__pyx_t_2, __pyx_t_5}; __pyx_t_3 = __Pyx_PyFunction_FastCall(__pyx_t_7, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 105, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; } else #endif #if CYTHON_FAST_PYCCALL if (__Pyx_PyFastCFunction_Check(__pyx_t_7)) { PyObject *__pyx_temp[2] = {__pyx_t_2, __pyx_t_5}; __pyx_t_3 = __Pyx_PyCFunction_FastCall(__pyx_t_7, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 105, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; } else #endif { __pyx_t_6 = PyTuple_New(1+1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 105, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_GIVEREF(__pyx_t_2); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_2); __pyx_t_2 = NULL; __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_6, 0+1, __pyx_t_5); __pyx_t_5 = 0; __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_7, __pyx_t_6, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 105, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; } } __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; if (PyDict_SetItem(__pyx_d, __pyx_n_s_quit, __pyx_t_3) < 0) __PYX_ERR(0, 106, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "pygame_sdl2/display.pyx":117 * init_done = False * * def get_init(): # <<<<<<<<<<<<<< * return init_done * */ __pyx_t_3 = PyCFunction_NewEx(&__pyx_mdef_11pygame_sdl2_7display_11get_init, NULL, __pyx_n_s_pygame_sdl2_display); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 117, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); if (PyDict_SetItem(__pyx_d, __pyx_n_s_get_init, __pyx_t_3) < 0) __PYX_ERR(0, 117, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "pygame_sdl2/display.pyx":122 * * # The window that is used by the various module globals. * main_window = None # <<<<<<<<<<<<<< * * # Have we shown the first window? */ __Pyx_INCREF(Py_None); __Pyx_XGOTREF(((PyObject *)__pyx_v_11pygame_sdl2_7display_main_window)); __Pyx_DECREF_SET(__pyx_v_11pygame_sdl2_7display_main_window, ((struct __pyx_obj_11pygame_sdl2_7display_Window *)Py_None)); __Pyx_GIVEREF(Py_None); /* "pygame_sdl2/display.pyx":125 * * # Have we shown the first window? * _shown_first_window = False # <<<<<<<<<<<<<< * * def _before_first_window(): */ if (PyDict_SetItem(__pyx_d, __pyx_n_s_shown_first_window, Py_False) < 0) __PYX_ERR(0, 125, __pyx_L1_error) /* "pygame_sdl2/display.pyx":127 * _shown_first_window = False * * def _before_first_window(): # <<<<<<<<<<<<<< * global _shown_first_window * */ __pyx_t_3 = PyCFunction_NewEx(&__pyx_mdef_11pygame_sdl2_7display_13_before_first_window, NULL, __pyx_n_s_pygame_sdl2_display); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 127, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); if (PyDict_SetItem(__pyx_d, __pyx_n_s_before_first_window, __pyx_t_3) < 0) __PYX_ERR(0, 127, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "pygame_sdl2/display.pyx":146 * * cdef class Window: * def __init__(self, title, resolution=(0, 0), flags=0, depth=0, pos=(SDL_WINDOWPOS_UNDEFINED, SDL_WINDOWPOS_UNDEFINED)): # <<<<<<<<<<<<<< * * if not isinstance(title, bytes): */ __pyx_t_3 = __Pyx_PyInt_From_int(SDL_WINDOWPOS_UNDEFINED); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 146, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_7 = __Pyx_PyInt_From_int(SDL_WINDOWPOS_UNDEFINED); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 146, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __pyx_t_6 = PyTuple_New(2); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 146, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_3); __Pyx_GIVEREF(__pyx_t_7); PyTuple_SET_ITEM(__pyx_t_6, 1, __pyx_t_7); __pyx_t_3 = 0; __pyx_t_7 = 0; __pyx_k__5 = __pyx_t_6; __Pyx_GIVEREF(__pyx_t_6); __pyx_t_6 = 0; /* "pygame_sdl2/display.pyx":420 * * # The icon that's used for new windows. * default_icon = None # <<<<<<<<<<<<<< * * # The title that's used for new windows. */ if (PyDict_SetItem(__pyx_d, __pyx_n_s_default_icon, Py_None) < 0) __PYX_ERR(0, 420, __pyx_L1_error) /* "pygame_sdl2/display.pyx":423 * * # The title that's used for new windows. * default_title = "pygame window" # <<<<<<<<<<<<<< * * # The default gl_swap_control */ if (PyDict_SetItem(__pyx_d, __pyx_n_s_default_title, __pyx_kp_u_pygame_window) < 0) __PYX_ERR(0, 423, __pyx_L1_error) /* "pygame_sdl2/display.pyx":426 * * # The default gl_swap_control * default_swap_control = 1 # <<<<<<<<<<<<<< * * def set_mode(resolution=(0, 0), flags=0, depth=0, pos=(SDL_WINDOWPOS_UNDEFINED, SDL_WINDOWPOS_UNDEFINED)): */ if (PyDict_SetItem(__pyx_d, __pyx_n_s_default_swap_control, __pyx_int_1) < 0) __PYX_ERR(0, 426, __pyx_L1_error) /* "pygame_sdl2/display.pyx":428 * default_swap_control = 1 * * def set_mode(resolution=(0, 0), flags=0, depth=0, pos=(SDL_WINDOWPOS_UNDEFINED, SDL_WINDOWPOS_UNDEFINED)): # <<<<<<<<<<<<<< * global main_window * */ __pyx_t_6 = __Pyx_PyInt_From_int(SDL_WINDOWPOS_UNDEFINED); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 428, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __pyx_t_7 = __Pyx_PyInt_From_int(SDL_WINDOWPOS_UNDEFINED); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 428, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 428, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_GIVEREF(__pyx_t_6); PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_6); __Pyx_GIVEREF(__pyx_t_7); PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_7); __pyx_t_6 = 0; __pyx_t_7 = 0; __pyx_k__12 = __pyx_t_3; __Pyx_GIVEREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_3 = PyCFunction_NewEx(&__pyx_mdef_11pygame_sdl2_7display_15set_mode, NULL, __pyx_n_s_pygame_sdl2_display); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 428, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); if (PyDict_SetItem(__pyx_d, __pyx_n_s_set_mode, __pyx_t_3) < 0) __PYX_ERR(0, 428, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "pygame_sdl2/display.pyx":447 * return main_window.surface * * def get_surface(): # <<<<<<<<<<<<<< * if main_window is None: * return None */ __pyx_t_3 = PyCFunction_NewEx(&__pyx_mdef_11pygame_sdl2_7display_17get_surface, NULL, __pyx_n_s_pygame_sdl2_display); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 447, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); if (PyDict_SetItem(__pyx_d, __pyx_n_s_get_surface, __pyx_t_3) < 0) __PYX_ERR(0, 447, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "pygame_sdl2/display.pyx":453 * return main_window.get_surface() * * def get_window(): # <<<<<<<<<<<<<< * """ * Returns the Window created by set_mode, or None if no such window */ __pyx_t_3 = PyCFunction_NewEx(&__pyx_mdef_11pygame_sdl2_7display_19get_window, NULL, __pyx_n_s_pygame_sdl2_display); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 453, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); if (PyDict_SetItem(__pyx_d, __pyx_n_s_get_window, __pyx_t_3) < 0) __PYX_ERR(0, 453, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "pygame_sdl2/display.pyx":461 * return main_window * * def flip(): # <<<<<<<<<<<<<< * if main_window: * main_window.flip() */ __pyx_t_3 = PyCFunction_NewEx(&__pyx_mdef_11pygame_sdl2_7display_21flip, NULL, __pyx_n_s_pygame_sdl2_display); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 461, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); if (PyDict_SetItem(__pyx_d, __pyx_n_s_flip, __pyx_t_3) < 0) __PYX_ERR(0, 461, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "pygame_sdl2/display.pyx":465 * main_window.flip() * * def update(rectangles=None): # <<<<<<<<<<<<<< * if main_window: * main_window.update(rectangles) */ __pyx_t_3 = PyCFunction_NewEx(&__pyx_mdef_11pygame_sdl2_7display_23update, NULL, __pyx_n_s_pygame_sdl2_display); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 465, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); if (PyDict_SetItem(__pyx_d, __pyx_n_s_update, __pyx_t_3) < 0) __PYX_ERR(0, 465, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "pygame_sdl2/display.pyx":469 * main_window.update(rectangles) * * def get_driver(): # <<<<<<<<<<<<<< * cdef const char *driver = SDL_GetCurrentVideoDriver() * */ __pyx_t_3 = PyCFunction_NewEx(&__pyx_mdef_11pygame_sdl2_7display_25get_driver, NULL, __pyx_n_s_pygame_sdl2_display); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 469, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); if (PyDict_SetItem(__pyx_d, __pyx_n_s_get_driver, __pyx_t_3) < 0) __PYX_ERR(0, 469, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "pygame_sdl2/display.pyx":477 * return driver * * class Info(object): # <<<<<<<<<<<<<< * * def __init__(self): */ __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 477, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_INCREF(__pyx_builtin_object); __Pyx_GIVEREF(__pyx_builtin_object); PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_builtin_object); __pyx_t_7 = __Pyx_CalculateMetaclass(NULL, __pyx_t_3); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 477, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __pyx_t_6 = __Pyx_Py3MetaclassPrepare(__pyx_t_7, __pyx_t_3, __pyx_n_s_Info, __pyx_n_s_Info, (PyObject *) NULL, __pyx_n_s_pygame_sdl2_display, (PyObject *) NULL); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 477, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); /* "pygame_sdl2/display.pyx":479 * class Info(object): * * def __init__(self): # <<<<<<<<<<<<<< * cdef SDL_DisplayMode dm * cdef SDL_PixelFormat *format */ __pyx_t_5 = __Pyx_CyFunction_NewEx(&__pyx_mdef_11pygame_sdl2_7display_4Info_1__init__, 0, __pyx_n_s_Info___init, NULL, __pyx_n_s_pygame_sdl2_display, __pyx_d, ((PyObject *)__pyx_codeobj__33)); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 479, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); if (PyObject_SetItem(__pyx_t_6, __pyx_n_s_init_2, __pyx_t_5) < 0) __PYX_ERR(0, 479, __pyx_L1_error) __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; /* "pygame_sdl2/display.pyx":538 * self.blit_sw_A = False * * def __repr__(self): # <<<<<<<<<<<<<< * return "".format(self.__dict__) * */ __pyx_t_5 = __Pyx_CyFunction_NewEx(&__pyx_mdef_11pygame_sdl2_7display_4Info_3__repr__, 0, __pyx_n_s_Info___repr, NULL, __pyx_n_s_pygame_sdl2_display, __pyx_d, ((PyObject *)__pyx_codeobj__35)); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 538, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); if (PyObject_SetItem(__pyx_t_6, __pyx_n_s_repr, __pyx_t_5) < 0) __PYX_ERR(0, 538, __pyx_L1_error) __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; /* "pygame_sdl2/display.pyx":477 * return driver * * class Info(object): # <<<<<<<<<<<<<< * * def __init__(self): */ __pyx_t_5 = __Pyx_Py3ClassCreate(__pyx_t_7, __pyx_n_s_Info, __pyx_t_3, __pyx_t_6, NULL, 0, 0); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 477, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); if (PyDict_SetItem(__pyx_d, __pyx_n_s_Info, __pyx_t_5) < 0) __PYX_ERR(0, 477, __pyx_L1_error) __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "pygame_sdl2/display.pyx":542 * * * def get_wm_info(): # <<<<<<<<<<<<<< * if main_window: * return main_window.get_wm_info() */ __pyx_t_3 = PyCFunction_NewEx(&__pyx_mdef_11pygame_sdl2_7display_27get_wm_info, NULL, __pyx_n_s_pygame_sdl2_display); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 542, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); if (PyDict_SetItem(__pyx_d, __pyx_n_s_get_wm_info, __pyx_t_3) < 0) __PYX_ERR(0, 542, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "pygame_sdl2/display.pyx":549 * * * def get_num_video_displays(): # <<<<<<<<<<<<<< * """ * Returns the number of video displays connected to the system. */ __pyx_t_3 = PyCFunction_NewEx(&__pyx_mdef_11pygame_sdl2_7display_29get_num_video_displays, NULL, __pyx_n_s_pygame_sdl2_display); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 549, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); if (PyDict_SetItem(__pyx_d, __pyx_n_s_get_num_video_displays, __pyx_t_3) < 0) __PYX_ERR(0, 549, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "pygame_sdl2/display.pyx":562 * * * def list_modes(depth=0, flags=0, display=0): # <<<<<<<<<<<<<< * """ * Returns a list of possible display modes for the display `display`. */ __pyx_t_3 = PyCFunction_NewEx(&__pyx_mdef_11pygame_sdl2_7display_31list_modes, NULL, __pyx_n_s_pygame_sdl2_display); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 562, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); if (PyDict_SetItem(__pyx_d, __pyx_n_s_list_modes, __pyx_t_3) < 0) __PYX_ERR(0, 562, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "pygame_sdl2/display.pyx":587 * * * def mode_ok(size, flags=0, depth=0): # <<<<<<<<<<<<<< * """ * Returns true if size is in the result of list_modes(). */ __pyx_t_3 = PyCFunction_NewEx(&__pyx_mdef_11pygame_sdl2_7display_33mode_ok, NULL, __pyx_n_s_pygame_sdl2_display); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 587, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); if (PyDict_SetItem(__pyx_d, __pyx_n_s_mode_ok, __pyx_t_3) < 0) __PYX_ERR(0, 587, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "pygame_sdl2/display.pyx":594 * return tuple(size) in list_modes() * * def gl_reset_attributes(): # <<<<<<<<<<<<<< * SDL_GL_ResetAttributes() * */ __pyx_t_3 = PyCFunction_NewEx(&__pyx_mdef_11pygame_sdl2_7display_35gl_reset_attributes, NULL, __pyx_n_s_pygame_sdl2_display); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 594, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); if (PyDict_SetItem(__pyx_d, __pyx_n_s_gl_reset_attributes, __pyx_t_3) < 0) __PYX_ERR(0, 594, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "pygame_sdl2/display.pyx":597 * SDL_GL_ResetAttributes() * * def gl_set_attribute(flag, value): # <<<<<<<<<<<<<< * * if flag == GL_SWAP_CONTROL: */ __pyx_t_3 = PyCFunction_NewEx(&__pyx_mdef_11pygame_sdl2_7display_37gl_set_attribute, NULL, __pyx_n_s_pygame_sdl2_display); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 597, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); if (PyDict_SetItem(__pyx_d, __pyx_n_s_gl_set_attribute, __pyx_t_3) < 0) __PYX_ERR(0, 597, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "pygame_sdl2/display.pyx":617 * raise error() * * def gl_get_attribute(flag): # <<<<<<<<<<<<<< * cdef int rv * */ __pyx_t_3 = PyCFunction_NewEx(&__pyx_mdef_11pygame_sdl2_7display_39gl_get_attribute, NULL, __pyx_n_s_pygame_sdl2_display); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 617, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); if (PyDict_SetItem(__pyx_d, __pyx_n_s_gl_get_attribute, __pyx_t_3) < 0) __PYX_ERR(0, 617, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "pygame_sdl2/display.pyx":628 * return rv * * def gl_load_library(path): # <<<<<<<<<<<<<< * if path is None: * if SDL_GL_LoadLibrary(NULL): */ __pyx_t_3 = PyCFunction_NewEx(&__pyx_mdef_11pygame_sdl2_7display_41gl_load_library, NULL, __pyx_n_s_pygame_sdl2_display); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 628, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); if (PyDict_SetItem(__pyx_d, __pyx_n_s_gl_load_library, __pyx_t_3) < 0) __PYX_ERR(0, 628, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "pygame_sdl2/display.pyx":636 * raise error() * * def gl_unload_library(): # <<<<<<<<<<<<<< * SDL_GL_UnloadLibrary() * */ __pyx_t_3 = PyCFunction_NewEx(&__pyx_mdef_11pygame_sdl2_7display_43gl_unload_library, NULL, __pyx_n_s_pygame_sdl2_display); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 636, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); if (PyDict_SetItem(__pyx_d, __pyx_n_s_gl_unload_library, __pyx_t_3) < 0) __PYX_ERR(0, 636, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "pygame_sdl2/display.pyx":639 * SDL_GL_UnloadLibrary() * * def get_active(): # <<<<<<<<<<<<<< * if main_window: * return main_window.get_active() */ __pyx_t_3 = PyCFunction_NewEx(&__pyx_mdef_11pygame_sdl2_7display_45get_active, NULL, __pyx_n_s_pygame_sdl2_display); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 639, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); if (PyDict_SetItem(__pyx_d, __pyx_n_s_get_active, __pyx_t_3) < 0) __PYX_ERR(0, 639, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "pygame_sdl2/display.pyx":644 * return False * * def iconify(): # <<<<<<<<<<<<<< * if main_window: * return main_window.iconify() */ __pyx_t_3 = PyCFunction_NewEx(&__pyx_mdef_11pygame_sdl2_7display_47iconify, NULL, __pyx_n_s_pygame_sdl2_display); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 644, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); if (PyDict_SetItem(__pyx_d, __pyx_n_s_iconify, __pyx_t_3) < 0) __PYX_ERR(0, 644, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "pygame_sdl2/display.pyx":650 * return False * * def toggle_fullscreen(): # <<<<<<<<<<<<<< * if main_window: * return main_window.toggle_fullscreen() */ __pyx_t_3 = PyCFunction_NewEx(&__pyx_mdef_11pygame_sdl2_7display_49toggle_fullscreen, NULL, __pyx_n_s_pygame_sdl2_display); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 650, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); if (PyDict_SetItem(__pyx_d, __pyx_n_s_toggle_fullscreen, __pyx_t_3) < 0) __PYX_ERR(0, 650, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "pygame_sdl2/display.pyx":656 * return True * * def set_gamma(red, green=None, blue=None): # <<<<<<<<<<<<<< * if main_window: * return main_window.set_gamma(red, green, blue) */ __pyx_t_3 = PyCFunction_NewEx(&__pyx_mdef_11pygame_sdl2_7display_51set_gamma, NULL, __pyx_n_s_pygame_sdl2_display); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 656, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); if (PyDict_SetItem(__pyx_d, __pyx_n_s_set_gamma, __pyx_t_3) < 0) __PYX_ERR(0, 656, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "pygame_sdl2/display.pyx":661 * return False * * def set_gamma_ramp(red, green, blue): # <<<<<<<<<<<<<< * if main_window: * return main_window.set_gamma_ramp(red, green, blue) */ __pyx_t_3 = PyCFunction_NewEx(&__pyx_mdef_11pygame_sdl2_7display_53set_gamma_ramp, NULL, __pyx_n_s_pygame_sdl2_display); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 661, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); if (PyDict_SetItem(__pyx_d, __pyx_n_s_set_gamma_ramp, __pyx_t_3) < 0) __PYX_ERR(0, 661, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "pygame_sdl2/display.pyx":666 * return False * * def set_icon(surface): # <<<<<<<<<<<<<< * global default_icon * */ __pyx_t_3 = PyCFunction_NewEx(&__pyx_mdef_11pygame_sdl2_7display_55set_icon, NULL, __pyx_n_s_pygame_sdl2_display); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 666, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); if (PyDict_SetItem(__pyx_d, __pyx_n_s_set_icon, __pyx_t_3) < 0) __PYX_ERR(0, 666, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "pygame_sdl2/display.pyx":674 * main_window.set_icon(default_icon) * * def set_caption(title, icontitle = None): # <<<<<<<<<<<<<< * global default_title * */ __pyx_t_3 = PyCFunction_NewEx(&__pyx_mdef_11pygame_sdl2_7display_57set_caption, NULL, __pyx_n_s_pygame_sdl2_display); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 674, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); if (PyDict_SetItem(__pyx_d, __pyx_n_s_set_caption, __pyx_t_3) < 0) __PYX_ERR(0, 674, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "pygame_sdl2/display.pyx":682 * main_window.set_caption(default_title) * * def get_caption(): # <<<<<<<<<<<<<< * return default_title * */ __pyx_t_3 = PyCFunction_NewEx(&__pyx_mdef_11pygame_sdl2_7display_59get_caption, NULL, __pyx_n_s_pygame_sdl2_display); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 682, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); if (PyDict_SetItem(__pyx_d, __pyx_n_s_get_caption, __pyx_t_3) < 0) __PYX_ERR(0, 682, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "pygame_sdl2/display.pyx":685 * return default_title * * def get_drawable_size(): # <<<<<<<<<<<<<< * if main_window: * return main_window.get_drawable_size() */ __pyx_t_3 = PyCFunction_NewEx(&__pyx_mdef_11pygame_sdl2_7display_61get_drawable_size, NULL, __pyx_n_s_pygame_sdl2_display); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 685, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); if (PyDict_SetItem(__pyx_d, __pyx_n_s_get_drawable_size, __pyx_t_3) < 0) __PYX_ERR(0, 685, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "pygame_sdl2/display.pyx":690 * return None * * def get_num_video_displays(): # <<<<<<<<<<<<<< * rv = SDL_GetNumVideoDisplays() * if rv < 0: */ __pyx_t_3 = PyCFunction_NewEx(&__pyx_mdef_11pygame_sdl2_7display_63get_num_video_displays, NULL, __pyx_n_s_pygame_sdl2_display); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 690, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); if (PyDict_SetItem(__pyx_d, __pyx_n_s_get_num_video_displays, __pyx_t_3) < 0) __PYX_ERR(0, 690, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "pygame_sdl2/display.pyx":697 * return rv * * def get_display_bounds(index): # <<<<<<<<<<<<<< * cdef SDL_Rect rect * rv = SDL_GetDisplayBounds(index, &rect) */ __pyx_t_3 = PyCFunction_NewEx(&__pyx_mdef_11pygame_sdl2_7display_65get_display_bounds, NULL, __pyx_n_s_pygame_sdl2_display); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 697, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); if (PyDict_SetItem(__pyx_d, __pyx_n_s_get_display_bounds, __pyx_t_3) < 0) __PYX_ERR(0, 697, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "pygame_sdl2/display.pyx":703 * return (rect.x, rect.y, rect.w, rect.h) * * def get_platform(): # <<<<<<<<<<<<<< * return SDL_GetPlatform() * */ __pyx_t_3 = PyCFunction_NewEx(&__pyx_mdef_11pygame_sdl2_7display_67get_platform, NULL, __pyx_n_s_pygame_sdl2_display); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 703, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); if (PyDict_SetItem(__pyx_d, __pyx_n_s_get_platform, __pyx_t_3) < 0) __PYX_ERR(0, 703, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "pygame_sdl2/display.pyx":1 * # Copyright 2014 Patrick Dawson # <<<<<<<<<<<<<< * # Copyright 2014 Tom Rothamel * # */ __pyx_t_3 = PyDict_New(); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); if (PyDict_SetItem(__pyx_d, __pyx_n_s_test, __pyx_t_3) < 0) __PYX_ERR(0, 1, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /*--- Wrapped vars code ---*/ goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_5); __Pyx_XDECREF(__pyx_t_6); __Pyx_XDECREF(__pyx_t_7); if (__pyx_m) { if (__pyx_d) { __Pyx_AddTraceback("init pygame_sdl2.display", __pyx_clineno, __pyx_lineno, __pyx_filename); } Py_DECREF(__pyx_m); __pyx_m = 0; } else if (!PyErr_Occurred()) { PyErr_SetString(PyExc_ImportError, "init pygame_sdl2.display"); } __pyx_L0:; __Pyx_RefNannyFinishContext(); #if PY_MAJOR_VERSION < 3 return; #else return __pyx_m; #endif } /* --- Runtime support code --- */ /* Refnanny */ #if CYTHON_REFNANNY static __Pyx_RefNannyAPIStruct *__Pyx_RefNannyImportAPI(const char *modname) { PyObject *m = NULL, *p = NULL; void *r = NULL; m = PyImport_ImportModule((char *)modname); if (!m) goto end; p = PyObject_GetAttrString(m, (char *)"RefNannyAPI"); if (!p) goto end; r = PyLong_AsVoidPtr(p); end: Py_XDECREF(p); Py_XDECREF(m); return (__Pyx_RefNannyAPIStruct *)r; } #endif /* GetBuiltinName */ static PyObject *__Pyx_GetBuiltinName(PyObject *name) { PyObject* result = __Pyx_PyObject_GetAttrStr(__pyx_b, name); if (unlikely(!result)) { PyErr_Format(PyExc_NameError, #if PY_MAJOR_VERSION >= 3 "name '%U' is not defined", name); #else "name '%.200s' is not defined", PyString_AS_STRING(name)); #endif } return result; } /* RaiseArgTupleInvalid */ static void __Pyx_RaiseArgtupleInvalid( const char* func_name, int exact, Py_ssize_t num_min, Py_ssize_t num_max, Py_ssize_t num_found) { Py_ssize_t num_expected; const char *more_or_less; if (num_found < num_min) { num_expected = num_min; more_or_less = "at least"; } else { num_expected = num_max; more_or_less = "at most"; } if (exact) { more_or_less = "exactly"; } PyErr_Format(PyExc_TypeError, "%.200s() takes %.8s %" CYTHON_FORMAT_SSIZE_T "d positional argument%.1s (%" CYTHON_FORMAT_SSIZE_T "d given)", func_name, more_or_less, num_expected, (num_expected == 1) ? "" : "s", num_found); } /* RaiseDoubleKeywords */ static void __Pyx_RaiseDoubleKeywordsError( const char* func_name, PyObject* kw_name) { PyErr_Format(PyExc_TypeError, #if PY_MAJOR_VERSION >= 3 "%s() got multiple values for keyword argument '%U'", func_name, kw_name); #else "%s() got multiple values for keyword argument '%s'", func_name, PyString_AsString(kw_name)); #endif } /* ParseKeywords */ static int __Pyx_ParseOptionalKeywords( PyObject *kwds, PyObject **argnames[], PyObject *kwds2, PyObject *values[], Py_ssize_t num_pos_args, const char* function_name) { PyObject *key = 0, *value = 0; Py_ssize_t pos = 0; PyObject*** name; PyObject*** first_kw_arg = argnames + num_pos_args; while (PyDict_Next(kwds, &pos, &key, &value)) { name = first_kw_arg; while (*name && (**name != key)) name++; if (*name) { values[name-argnames] = value; continue; } name = first_kw_arg; #if PY_MAJOR_VERSION < 3 if (likely(PyString_CheckExact(key)) || likely(PyString_Check(key))) { while (*name) { if ((CYTHON_COMPILING_IN_PYPY || PyString_GET_SIZE(**name) == PyString_GET_SIZE(key)) && _PyString_Eq(**name, key)) { values[name-argnames] = value; break; } name++; } if (*name) continue; else { PyObject*** argname = argnames; while (argname != first_kw_arg) { if ((**argname == key) || ( (CYTHON_COMPILING_IN_PYPY || PyString_GET_SIZE(**argname) == PyString_GET_SIZE(key)) && _PyString_Eq(**argname, key))) { goto arg_passed_twice; } argname++; } } } else #endif if (likely(PyUnicode_Check(key))) { while (*name) { int cmp = (**name == key) ? 0 : #if !CYTHON_COMPILING_IN_PYPY && PY_MAJOR_VERSION >= 3 (PyUnicode_GET_SIZE(**name) != PyUnicode_GET_SIZE(key)) ? 1 : #endif PyUnicode_Compare(**name, key); if (cmp < 0 && unlikely(PyErr_Occurred())) goto bad; if (cmp == 0) { values[name-argnames] = value; break; } name++; } if (*name) continue; else { PyObject*** argname = argnames; while (argname != first_kw_arg) { int cmp = (**argname == key) ? 0 : #if !CYTHON_COMPILING_IN_PYPY && PY_MAJOR_VERSION >= 3 (PyUnicode_GET_SIZE(**argname) != PyUnicode_GET_SIZE(key)) ? 1 : #endif PyUnicode_Compare(**argname, key); if (cmp < 0 && unlikely(PyErr_Occurred())) goto bad; if (cmp == 0) goto arg_passed_twice; argname++; } } } else goto invalid_keyword_type; if (kwds2) { if (unlikely(PyDict_SetItem(kwds2, key, value))) goto bad; } else { goto invalid_keyword; } } return 0; arg_passed_twice: __Pyx_RaiseDoubleKeywordsError(function_name, key); goto bad; invalid_keyword_type: PyErr_Format(PyExc_TypeError, "%.200s() keywords must be strings", function_name); goto bad; invalid_keyword: PyErr_Format(PyExc_TypeError, #if PY_MAJOR_VERSION < 3 "%.200s() got an unexpected keyword argument '%.200s'", function_name, PyString_AsString(key)); #else "%s() got an unexpected keyword argument '%U'", function_name, key); #endif bad: return -1; } /* unicode_tailmatch */ static int __Pyx_PyUnicode_Tailmatch(PyObject* s, PyObject* substr, Py_ssize_t start, Py_ssize_t end, int direction) { if (unlikely(PyTuple_Check(substr))) { Py_ssize_t i, count = PyTuple_GET_SIZE(substr); for (i = 0; i < count; i++) { Py_ssize_t result; #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS result = PyUnicode_Tailmatch(s, PyTuple_GET_ITEM(substr, i), start, end, direction); #else PyObject* sub = PySequence_ITEM(substr, i); if (unlikely(!sub)) return -1; result = PyUnicode_Tailmatch(s, sub, start, end, direction); Py_DECREF(sub); #endif if (result) { return (int) result; } } return 0; } return (int) PyUnicode_Tailmatch(s, substr, start, end, direction); } /* PyObjectCall */ #if CYTHON_COMPILING_IN_CPYTHON static CYTHON_INLINE PyObject* __Pyx_PyObject_Call(PyObject *func, PyObject *arg, PyObject *kw) { PyObject *result; ternaryfunc call = func->ob_type->tp_call; if (unlikely(!call)) return PyObject_Call(func, arg, kw); if (unlikely(Py_EnterRecursiveCall((char*)" while calling a Python object"))) return NULL; result = (*call)(func, arg, kw); Py_LeaveRecursiveCall(); if (unlikely(!result) && unlikely(!PyErr_Occurred())) { PyErr_SetString( PyExc_SystemError, "NULL result without error in PyObject_Call"); } return result; } #endif /* GetModuleGlobalName */ static CYTHON_INLINE PyObject *__Pyx_GetModuleGlobalName(PyObject *name) { PyObject *result; #if !CYTHON_AVOID_BORROWED_REFS result = PyDict_GetItem(__pyx_d, name); if (likely(result)) { Py_INCREF(result); } else { #else result = PyObject_GetItem(__pyx_d, name); if (!result) { PyErr_Clear(); #endif result = __Pyx_GetBuiltinName(name); } return result; } /* PyCFunctionFastCall */ #if CYTHON_FAST_PYCCALL static CYTHON_INLINE PyObject * __Pyx_PyCFunction_FastCall(PyObject *func_obj, PyObject **args, Py_ssize_t nargs) { PyCFunctionObject *func = (PyCFunctionObject*)func_obj; PyCFunction meth = PyCFunction_GET_FUNCTION(func); PyObject *self = PyCFunction_GET_SELF(func); assert(PyCFunction_Check(func)); assert(METH_FASTCALL == (PyCFunction_GET_FLAGS(func) & ~(METH_CLASS | METH_STATIC | METH_COEXIST))); assert(nargs >= 0); assert(nargs == 0 || args != NULL); /* _PyCFunction_FastCallDict() must not be called with an exception set, because it may clear it (directly or indirectly) and so the caller loses its exception */ assert(!PyErr_Occurred()); return (*((__Pyx_PyCFunctionFast)meth)) (self, args, nargs, NULL); } #endif // CYTHON_FAST_PYCCALL /* PyFunctionFastCall */ #if CYTHON_FAST_PYCALL #include "frameobject.h" static PyObject* __Pyx_PyFunction_FastCallNoKw(PyCodeObject *co, PyObject **args, Py_ssize_t na, PyObject *globals) { PyFrameObject *f; PyThreadState *tstate = PyThreadState_GET(); PyObject **fastlocals; Py_ssize_t i; PyObject *result; assert(globals != NULL); /* XXX Perhaps we should create a specialized PyFrame_New() that doesn't take locals, but does take builtins without sanity checking them. */ assert(tstate != NULL); f = PyFrame_New(tstate, co, globals, NULL); if (f == NULL) { return NULL; } fastlocals = f->f_localsplus; for (i = 0; i < na; i++) { Py_INCREF(*args); fastlocals[i] = *args++; } result = PyEval_EvalFrameEx(f,0); ++tstate->recursion_depth; Py_DECREF(f); --tstate->recursion_depth; return result; } #if 1 || PY_VERSION_HEX < 0x030600B1 static PyObject *__Pyx_PyFunction_FastCallDict(PyObject *func, PyObject **args, int nargs, PyObject *kwargs) { PyCodeObject *co = (PyCodeObject *)PyFunction_GET_CODE(func); PyObject *globals = PyFunction_GET_GLOBALS(func); PyObject *argdefs = PyFunction_GET_DEFAULTS(func); PyObject *closure; #if PY_MAJOR_VERSION >= 3 PyObject *kwdefs; #endif PyObject *kwtuple, **k; PyObject **d; Py_ssize_t nd; Py_ssize_t nk; PyObject *result; assert(kwargs == NULL || PyDict_Check(kwargs)); nk = kwargs ? PyDict_Size(kwargs) : 0; if (Py_EnterRecursiveCall((char*)" while calling a Python object")) { return NULL; } if ( #if PY_MAJOR_VERSION >= 3 co->co_kwonlyargcount == 0 && #endif likely(kwargs == NULL || nk == 0) && co->co_flags == (CO_OPTIMIZED | CO_NEWLOCALS | CO_NOFREE)) { if (argdefs == NULL && co->co_argcount == nargs) { result = __Pyx_PyFunction_FastCallNoKw(co, args, nargs, globals); goto done; } else if (nargs == 0 && argdefs != NULL && co->co_argcount == Py_SIZE(argdefs)) { /* function called with no arguments, but all parameters have a default value: use default values as arguments .*/ args = &PyTuple_GET_ITEM(argdefs, 0); result =__Pyx_PyFunction_FastCallNoKw(co, args, Py_SIZE(argdefs), globals); goto done; } } if (kwargs != NULL) { Py_ssize_t pos, i; kwtuple = PyTuple_New(2 * nk); if (kwtuple == NULL) { result = NULL; goto done; } k = &PyTuple_GET_ITEM(kwtuple, 0); pos = i = 0; while (PyDict_Next(kwargs, &pos, &k[i], &k[i+1])) { Py_INCREF(k[i]); Py_INCREF(k[i+1]); i += 2; } nk = i / 2; } else { kwtuple = NULL; k = NULL; } closure = PyFunction_GET_CLOSURE(func); #if PY_MAJOR_VERSION >= 3 kwdefs = PyFunction_GET_KW_DEFAULTS(func); #endif if (argdefs != NULL) { d = &PyTuple_GET_ITEM(argdefs, 0); nd = Py_SIZE(argdefs); } else { d = NULL; nd = 0; } #if PY_MAJOR_VERSION >= 3 result = PyEval_EvalCodeEx((PyObject*)co, globals, (PyObject *)NULL, args, nargs, k, (int)nk, d, (int)nd, kwdefs, closure); #else result = PyEval_EvalCodeEx(co, globals, (PyObject *)NULL, args, nargs, k, (int)nk, d, (int)nd, closure); #endif Py_XDECREF(kwtuple); done: Py_LeaveRecursiveCall(); return result; } #endif // CPython < 3.6 #endif // CYTHON_FAST_PYCALL /* PyObjectCallMethO */ #if CYTHON_COMPILING_IN_CPYTHON static CYTHON_INLINE PyObject* __Pyx_PyObject_CallMethO(PyObject *func, PyObject *arg) { PyObject *self, *result; PyCFunction cfunc; cfunc = PyCFunction_GET_FUNCTION(func); self = PyCFunction_GET_SELF(func); if (unlikely(Py_EnterRecursiveCall((char*)" while calling a Python object"))) return NULL; result = cfunc(self, arg); Py_LeaveRecursiveCall(); if (unlikely(!result) && unlikely(!PyErr_Occurred())) { PyErr_SetString( PyExc_SystemError, "NULL result without error in PyObject_Call"); } return result; } #endif /* PyObjectCallOneArg */ #if CYTHON_COMPILING_IN_CPYTHON static PyObject* __Pyx__PyObject_CallOneArg(PyObject *func, PyObject *arg) { PyObject *result; PyObject *args = PyTuple_New(1); if (unlikely(!args)) return NULL; Py_INCREF(arg); PyTuple_SET_ITEM(args, 0, arg); result = __Pyx_PyObject_Call(func, args, NULL); Py_DECREF(args); return result; } static CYTHON_INLINE PyObject* __Pyx_PyObject_CallOneArg(PyObject *func, PyObject *arg) { #if CYTHON_FAST_PYCALL if (PyFunction_Check(func)) { return __Pyx_PyFunction_FastCall(func, &arg, 1); } #endif #ifdef __Pyx_CyFunction_USED if (likely(PyCFunction_Check(func) || PyObject_TypeCheck(func, __pyx_CyFunctionType))) { #else if (likely(PyCFunction_Check(func))) { #endif if (likely(PyCFunction_GET_FLAGS(func) & METH_O)) { return __Pyx_PyObject_CallMethO(func, arg); #if CYTHON_FAST_PYCCALL } else if (PyCFunction_GET_FLAGS(func) & METH_FASTCALL) { return __Pyx_PyCFunction_FastCall(func, &arg, 1); #endif } } return __Pyx__PyObject_CallOneArg(func, arg); } #else static CYTHON_INLINE PyObject* __Pyx_PyObject_CallOneArg(PyObject *func, PyObject *arg) { PyObject *result; PyObject *args = PyTuple_Pack(1, arg); if (unlikely(!args)) return NULL; result = __Pyx_PyObject_Call(func, args, NULL); Py_DECREF(args); return result; } #endif /* PyObjectCallNoArg */ #if CYTHON_COMPILING_IN_CPYTHON static CYTHON_INLINE PyObject* __Pyx_PyObject_CallNoArg(PyObject *func) { #if CYTHON_FAST_PYCALL if (PyFunction_Check(func)) { return __Pyx_PyFunction_FastCall(func, NULL, 0); } #endif #ifdef __Pyx_CyFunction_USED if (likely(PyCFunction_Check(func) || PyObject_TypeCheck(func, __pyx_CyFunctionType))) { #else if (likely(PyCFunction_Check(func))) { #endif if (likely(PyCFunction_GET_FLAGS(func) & METH_NOARGS)) { return __Pyx_PyObject_CallMethO(func, NULL); } } return __Pyx_PyObject_Call(func, __pyx_empty_tuple, NULL); } #endif /* PyErrFetchRestore */ #if CYTHON_FAST_THREAD_STATE static CYTHON_INLINE void __Pyx_ErrRestoreInState(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb) { PyObject *tmp_type, *tmp_value, *tmp_tb; tmp_type = tstate->curexc_type; tmp_value = tstate->curexc_value; tmp_tb = tstate->curexc_traceback; tstate->curexc_type = type; tstate->curexc_value = value; tstate->curexc_traceback = tb; Py_XDECREF(tmp_type); Py_XDECREF(tmp_value); Py_XDECREF(tmp_tb); } static CYTHON_INLINE void __Pyx_ErrFetchInState(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb) { *type = tstate->curexc_type; *value = tstate->curexc_value; *tb = tstate->curexc_traceback; tstate->curexc_type = 0; tstate->curexc_value = 0; tstate->curexc_traceback = 0; } #endif /* RaiseException */ #if PY_MAJOR_VERSION < 3 static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, CYTHON_UNUSED PyObject *cause) { __Pyx_PyThreadState_declare Py_XINCREF(type); if (!value || value == Py_None) value = NULL; else Py_INCREF(value); if (!tb || tb == Py_None) tb = NULL; else { Py_INCREF(tb); if (!PyTraceBack_Check(tb)) { PyErr_SetString(PyExc_TypeError, "raise: arg 3 must be a traceback or None"); goto raise_error; } } if (PyType_Check(type)) { #if CYTHON_COMPILING_IN_PYPY if (!value) { Py_INCREF(Py_None); value = Py_None; } #endif PyErr_NormalizeException(&type, &value, &tb); } else { if (value) { PyErr_SetString(PyExc_TypeError, "instance exception may not have a separate value"); goto raise_error; } value = type; type = (PyObject*) Py_TYPE(type); Py_INCREF(type); if (!PyType_IsSubtype((PyTypeObject *)type, (PyTypeObject *)PyExc_BaseException)) { PyErr_SetString(PyExc_TypeError, "raise: exception class must be a subclass of BaseException"); goto raise_error; } } __Pyx_PyThreadState_assign __Pyx_ErrRestore(type, value, tb); return; raise_error: Py_XDECREF(value); Py_XDECREF(type); Py_XDECREF(tb); return; } #else static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, PyObject *cause) { PyObject* owned_instance = NULL; if (tb == Py_None) { tb = 0; } else if (tb && !PyTraceBack_Check(tb)) { PyErr_SetString(PyExc_TypeError, "raise: arg 3 must be a traceback or None"); goto bad; } if (value == Py_None) value = 0; if (PyExceptionInstance_Check(type)) { if (value) { PyErr_SetString(PyExc_TypeError, "instance exception may not have a separate value"); goto bad; } value = type; type = (PyObject*) Py_TYPE(value); } else if (PyExceptionClass_Check(type)) { PyObject *instance_class = NULL; if (value && PyExceptionInstance_Check(value)) { instance_class = (PyObject*) Py_TYPE(value); if (instance_class != type) { int is_subclass = PyObject_IsSubclass(instance_class, type); if (!is_subclass) { instance_class = NULL; } else if (unlikely(is_subclass == -1)) { goto bad; } else { type = instance_class; } } } if (!instance_class) { PyObject *args; if (!value) args = PyTuple_New(0); else if (PyTuple_Check(value)) { Py_INCREF(value); args = value; } else args = PyTuple_Pack(1, value); if (!args) goto bad; owned_instance = PyObject_Call(type, args, NULL); Py_DECREF(args); if (!owned_instance) goto bad; value = owned_instance; if (!PyExceptionInstance_Check(value)) { PyErr_Format(PyExc_TypeError, "calling %R should have returned an instance of " "BaseException, not %R", type, Py_TYPE(value)); goto bad; } } } else { PyErr_SetString(PyExc_TypeError, "raise: exception class must be a subclass of BaseException"); goto bad; } #if PY_VERSION_HEX >= 0x03030000 if (cause) { #else if (cause && cause != Py_None) { #endif PyObject *fixed_cause; if (cause == Py_None) { fixed_cause = NULL; } else if (PyExceptionClass_Check(cause)) { fixed_cause = PyObject_CallObject(cause, NULL); if (fixed_cause == NULL) goto bad; } else if (PyExceptionInstance_Check(cause)) { fixed_cause = cause; Py_INCREF(fixed_cause); } else { PyErr_SetString(PyExc_TypeError, "exception causes must derive from " "BaseException"); goto bad; } PyException_SetCause(value, fixed_cause); } PyErr_SetObject(type, value); if (tb) { #if CYTHON_COMPILING_IN_PYPY PyObject *tmp_type, *tmp_value, *tmp_tb; PyErr_Fetch(&tmp_type, &tmp_value, &tmp_tb); Py_INCREF(tb); PyErr_Restore(tmp_type, tmp_value, tb); Py_XDECREF(tmp_tb); #else PyThreadState *tstate = PyThreadState_GET(); PyObject* tmp_tb = tstate->curexc_traceback; if (tb != tmp_tb) { Py_INCREF(tb); tstate->curexc_traceback = tb; Py_XDECREF(tmp_tb); } #endif } bad: Py_XDECREF(owned_instance); return; } #endif /* Import */ static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list, int level) { PyObject *empty_list = 0; PyObject *module = 0; PyObject *global_dict = 0; PyObject *empty_dict = 0; PyObject *list; #if PY_VERSION_HEX < 0x03030000 PyObject *py_import; py_import = __Pyx_PyObject_GetAttrStr(__pyx_b, __pyx_n_s_import); if (!py_import) goto bad; #endif if (from_list) list = from_list; else { empty_list = PyList_New(0); if (!empty_list) goto bad; list = empty_list; } global_dict = PyModule_GetDict(__pyx_m); if (!global_dict) goto bad; empty_dict = PyDict_New(); if (!empty_dict) goto bad; { #if PY_MAJOR_VERSION >= 3 if (level == -1) { if (strchr(__Pyx_MODULE_NAME, '.')) { #if PY_VERSION_HEX < 0x03030000 PyObject *py_level = PyInt_FromLong(1); if (!py_level) goto bad; module = PyObject_CallFunctionObjArgs(py_import, name, global_dict, empty_dict, list, py_level, NULL); Py_DECREF(py_level); #else module = PyImport_ImportModuleLevelObject( name, global_dict, empty_dict, list, 1); #endif if (!module) { if (!PyErr_ExceptionMatches(PyExc_ImportError)) goto bad; PyErr_Clear(); } } level = 0; } #endif if (!module) { #if PY_VERSION_HEX < 0x03030000 PyObject *py_level = PyInt_FromLong(level); if (!py_level) goto bad; module = PyObject_CallFunctionObjArgs(py_import, name, global_dict, empty_dict, list, py_level, NULL); Py_DECREF(py_level); #else module = PyImport_ImportModuleLevelObject( name, global_dict, empty_dict, list, level); #endif } } bad: #if PY_VERSION_HEX < 0x03030000 Py_XDECREF(py_import); #endif Py_XDECREF(empty_list); Py_XDECREF(empty_dict); return module; } /* SaveResetException */ #if CYTHON_FAST_THREAD_STATE static CYTHON_INLINE void __Pyx__ExceptionSave(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb) { *type = tstate->exc_type; *value = tstate->exc_value; *tb = tstate->exc_traceback; Py_XINCREF(*type); Py_XINCREF(*value); Py_XINCREF(*tb); } static CYTHON_INLINE void __Pyx__ExceptionReset(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb) { PyObject *tmp_type, *tmp_value, *tmp_tb; tmp_type = tstate->exc_type; tmp_value = tstate->exc_value; tmp_tb = tstate->exc_traceback; tstate->exc_type = type; tstate->exc_value = value; tstate->exc_traceback = tb; Py_XDECREF(tmp_type); Py_XDECREF(tmp_value); Py_XDECREF(tmp_tb); } #endif /* PyErrExceptionMatches */ #if CYTHON_FAST_THREAD_STATE static CYTHON_INLINE int __Pyx_PyErr_ExceptionMatchesInState(PyThreadState* tstate, PyObject* err) { PyObject *exc_type = tstate->curexc_type; if (exc_type == err) return 1; if (unlikely(!exc_type)) return 0; return PyErr_GivenExceptionMatches(exc_type, err); } #endif /* GetItemInt */ static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Generic(PyObject *o, PyObject* j) { PyObject *r; if (!j) return NULL; r = PyObject_GetItem(o, j); Py_DECREF(j); return r; } static CYTHON_INLINE PyObject *__Pyx_GetItemInt_List_Fast(PyObject *o, Py_ssize_t i, CYTHON_NCP_UNUSED int wraparound, CYTHON_NCP_UNUSED int boundscheck) { #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS if (wraparound & unlikely(i < 0)) i += PyList_GET_SIZE(o); if ((!boundscheck) || likely((0 <= i) & (i < PyList_GET_SIZE(o)))) { PyObject *r = PyList_GET_ITEM(o, i); Py_INCREF(r); return r; } return __Pyx_GetItemInt_Generic(o, PyInt_FromSsize_t(i)); #else return PySequence_GetItem(o, i); #endif } static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Tuple_Fast(PyObject *o, Py_ssize_t i, CYTHON_NCP_UNUSED int wraparound, CYTHON_NCP_UNUSED int boundscheck) { #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS if (wraparound & unlikely(i < 0)) i += PyTuple_GET_SIZE(o); if ((!boundscheck) || likely((0 <= i) & (i < PyTuple_GET_SIZE(o)))) { PyObject *r = PyTuple_GET_ITEM(o, i); Py_INCREF(r); return r; } return __Pyx_GetItemInt_Generic(o, PyInt_FromSsize_t(i)); #else return PySequence_GetItem(o, i); #endif } static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Fast(PyObject *o, Py_ssize_t i, int is_list, CYTHON_NCP_UNUSED int wraparound, CYTHON_NCP_UNUSED int boundscheck) { #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS && CYTHON_USE_TYPE_SLOTS if (is_list || PyList_CheckExact(o)) { Py_ssize_t n = ((!wraparound) | likely(i >= 0)) ? i : i + PyList_GET_SIZE(o); if ((!boundscheck) || (likely((n >= 0) & (n < PyList_GET_SIZE(o))))) { PyObject *r = PyList_GET_ITEM(o, n); Py_INCREF(r); return r; } } else if (PyTuple_CheckExact(o)) { Py_ssize_t n = ((!wraparound) | likely(i >= 0)) ? i : i + PyTuple_GET_SIZE(o); if ((!boundscheck) || likely((n >= 0) & (n < PyTuple_GET_SIZE(o)))) { PyObject *r = PyTuple_GET_ITEM(o, n); Py_INCREF(r); return r; } } else { PySequenceMethods *m = Py_TYPE(o)->tp_as_sequence; if (likely(m && m->sq_item)) { if (wraparound && unlikely(i < 0) && likely(m->sq_length)) { Py_ssize_t l = m->sq_length(o); if (likely(l >= 0)) { i += l; } else { if (!PyErr_ExceptionMatches(PyExc_OverflowError)) return NULL; PyErr_Clear(); } } return m->sq_item(o, i); } } #else if (is_list || PySequence_Check(o)) { return PySequence_GetItem(o, i); } #endif return __Pyx_GetItemInt_Generic(o, PyInt_FromSsize_t(i)); } /* GetException */ #if CYTHON_FAST_THREAD_STATE static int __Pyx__GetException(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb) { #else static int __Pyx_GetException(PyObject **type, PyObject **value, PyObject **tb) { #endif PyObject *local_type, *local_value, *local_tb; #if CYTHON_FAST_THREAD_STATE PyObject *tmp_type, *tmp_value, *tmp_tb; local_type = tstate->curexc_type; local_value = tstate->curexc_value; local_tb = tstate->curexc_traceback; tstate->curexc_type = 0; tstate->curexc_value = 0; tstate->curexc_traceback = 0; #else PyErr_Fetch(&local_type, &local_value, &local_tb); #endif PyErr_NormalizeException(&local_type, &local_value, &local_tb); #if CYTHON_FAST_THREAD_STATE if (unlikely(tstate->curexc_type)) #else if (unlikely(PyErr_Occurred())) #endif goto bad; #if PY_MAJOR_VERSION >= 3 if (local_tb) { if (unlikely(PyException_SetTraceback(local_value, local_tb) < 0)) goto bad; } #endif Py_XINCREF(local_tb); Py_XINCREF(local_type); Py_XINCREF(local_value); *type = local_type; *value = local_value; *tb = local_tb; #if CYTHON_FAST_THREAD_STATE tmp_type = tstate->exc_type; tmp_value = tstate->exc_value; tmp_tb = tstate->exc_traceback; tstate->exc_type = local_type; tstate->exc_value = local_value; tstate->exc_traceback = local_tb; Py_XDECREF(tmp_type); Py_XDECREF(tmp_value); Py_XDECREF(tmp_tb); #else PyErr_SetExcInfo(local_type, local_value, local_tb); #endif return 0; bad: *type = 0; *value = 0; *tb = 0; Py_XDECREF(local_type); Py_XDECREF(local_value); Py_XDECREF(local_tb); return -1; } /* RaiseTooManyValuesToUnpack */ static CYTHON_INLINE void __Pyx_RaiseTooManyValuesError(Py_ssize_t expected) { PyErr_Format(PyExc_ValueError, "too many values to unpack (expected %" CYTHON_FORMAT_SSIZE_T "d)", expected); } /* RaiseNeedMoreValuesToUnpack */ static CYTHON_INLINE void __Pyx_RaiseNeedMoreValuesError(Py_ssize_t index) { PyErr_Format(PyExc_ValueError, "need more than %" CYTHON_FORMAT_SSIZE_T "d value%.1s to unpack", index, (index == 1) ? "" : "s"); } /* IterFinish */ static CYTHON_INLINE int __Pyx_IterFinish(void) { #if CYTHON_FAST_THREAD_STATE PyThreadState *tstate = PyThreadState_GET(); PyObject* exc_type = tstate->curexc_type; if (unlikely(exc_type)) { if (likely(exc_type == PyExc_StopIteration) || PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration)) { PyObject *exc_value, *exc_tb; exc_value = tstate->curexc_value; exc_tb = tstate->curexc_traceback; tstate->curexc_type = 0; tstate->curexc_value = 0; tstate->curexc_traceback = 0; Py_DECREF(exc_type); Py_XDECREF(exc_value); Py_XDECREF(exc_tb); return 0; } else { return -1; } } return 0; #else if (unlikely(PyErr_Occurred())) { if (likely(PyErr_ExceptionMatches(PyExc_StopIteration))) { PyErr_Clear(); return 0; } else { return -1; } } return 0; #endif } /* UnpackItemEndCheck */ static int __Pyx_IternextUnpackEndCheck(PyObject *retval, Py_ssize_t expected) { if (unlikely(retval)) { Py_DECREF(retval); __Pyx_RaiseTooManyValuesError(expected); return -1; } else { return __Pyx_IterFinish(); } return 0; } /* SwapException */ #if CYTHON_FAST_THREAD_STATE static CYTHON_INLINE void __Pyx__ExceptionSwap(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb) { PyObject *tmp_type, *tmp_value, *tmp_tb; tmp_type = tstate->exc_type; tmp_value = tstate->exc_value; tmp_tb = tstate->exc_traceback; tstate->exc_type = *type; tstate->exc_value = *value; tstate->exc_traceback = *tb; *type = tmp_type; *value = tmp_value; *tb = tmp_tb; } #else static CYTHON_INLINE void __Pyx_ExceptionSwap(PyObject **type, PyObject **value, PyObject **tb) { PyObject *tmp_type, *tmp_value, *tmp_tb; PyErr_GetExcInfo(&tmp_type, &tmp_value, &tmp_tb); PyErr_SetExcInfo(*type, *value, *tb); *type = tmp_type; *value = tmp_value; *tb = tmp_tb; } #endif /* ArgTypeTest */ static void __Pyx_RaiseArgumentTypeInvalid(const char* name, PyObject *obj, PyTypeObject *type) { PyErr_Format(PyExc_TypeError, "Argument '%.200s' has incorrect type (expected %.200s, got %.200s)", name, type->tp_name, Py_TYPE(obj)->tp_name); } static CYTHON_INLINE int __Pyx_ArgTypeTest(PyObject *obj, PyTypeObject *type, int none_allowed, const char *name, int exact) { if (unlikely(!type)) { PyErr_SetString(PyExc_SystemError, "Missing type object"); return 0; } if (none_allowed && obj == Py_None) return 1; else if (exact) { if (likely(Py_TYPE(obj) == type)) return 1; #if PY_MAJOR_VERSION == 2 else if ((type == &PyBaseString_Type) && likely(__Pyx_PyBaseString_CheckExact(obj))) return 1; #endif } else { if (likely(PyObject_TypeCheck(obj, type))) return 1; } __Pyx_RaiseArgumentTypeInvalid(name, obj, type); return 0; } /* ExtTypeTest */ static CYTHON_INLINE int __Pyx_TypeTest(PyObject *obj, PyTypeObject *type) { if (unlikely(!type)) { PyErr_SetString(PyExc_SystemError, "Missing type object"); return 0; } if (likely(PyObject_TypeCheck(obj, type))) return 1; PyErr_Format(PyExc_TypeError, "Cannot convert %.200s to %.200s", Py_TYPE(obj)->tp_name, type->tp_name); return 0; } /* GetVTable */ static void* __Pyx_GetVtable(PyObject *dict) { void* ptr; PyObject *ob = PyObject_GetItem(dict, __pyx_n_s_pyx_vtable); if (!ob) goto bad; #if PY_VERSION_HEX >= 0x02070000 ptr = PyCapsule_GetPointer(ob, 0); #else ptr = PyCObject_AsVoidPtr(ob); #endif if (!ptr && !PyErr_Occurred()) PyErr_SetString(PyExc_RuntimeError, "invalid vtable found for imported type"); Py_DECREF(ob); return ptr; bad: Py_XDECREF(ob); return NULL; } /* ImportFrom */ static PyObject* __Pyx_ImportFrom(PyObject* module, PyObject* name) { PyObject* value = __Pyx_PyObject_GetAttrStr(module, name); if (unlikely(!value) && PyErr_ExceptionMatches(PyExc_AttributeError)) { PyErr_Format(PyExc_ImportError, #if PY_MAJOR_VERSION < 3 "cannot import name %.230s", PyString_AS_STRING(name)); #else "cannot import name %S", name); #endif } return value; } /* CalculateMetaclass */ static PyObject *__Pyx_CalculateMetaclass(PyTypeObject *metaclass, PyObject *bases) { Py_ssize_t i, nbases = PyTuple_GET_SIZE(bases); for (i=0; i < nbases; i++) { PyTypeObject *tmptype; PyObject *tmp = PyTuple_GET_ITEM(bases, i); tmptype = Py_TYPE(tmp); #if PY_MAJOR_VERSION < 3 if (tmptype == &PyClass_Type) continue; #endif if (!metaclass) { metaclass = tmptype; continue; } if (PyType_IsSubtype(metaclass, tmptype)) continue; if (PyType_IsSubtype(tmptype, metaclass)) { metaclass = tmptype; continue; } PyErr_SetString(PyExc_TypeError, "metaclass conflict: " "the metaclass of a derived class " "must be a (non-strict) subclass " "of the metaclasses of all its bases"); return NULL; } if (!metaclass) { #if PY_MAJOR_VERSION < 3 metaclass = &PyClass_Type; #else metaclass = &PyType_Type; #endif } Py_INCREF((PyObject*) metaclass); return (PyObject*) metaclass; } /* FetchCommonType */ static PyTypeObject* __Pyx_FetchCommonType(PyTypeObject* type) { PyObject* fake_module; PyTypeObject* cached_type = NULL; fake_module = PyImport_AddModule((char*) "_cython_" CYTHON_ABI); if (!fake_module) return NULL; Py_INCREF(fake_module); cached_type = (PyTypeObject*) PyObject_GetAttrString(fake_module, type->tp_name); if (cached_type) { if (!PyType_Check((PyObject*)cached_type)) { PyErr_Format(PyExc_TypeError, "Shared Cython type %.200s is not a type object", type->tp_name); goto bad; } if (cached_type->tp_basicsize != type->tp_basicsize) { PyErr_Format(PyExc_TypeError, "Shared Cython type %.200s has the wrong size, try recompiling", type->tp_name); goto bad; } } else { if (!PyErr_ExceptionMatches(PyExc_AttributeError)) goto bad; PyErr_Clear(); if (PyType_Ready(type) < 0) goto bad; if (PyObject_SetAttrString(fake_module, type->tp_name, (PyObject*) type) < 0) goto bad; Py_INCREF(type); cached_type = type; } done: Py_DECREF(fake_module); return cached_type; bad: Py_XDECREF(cached_type); cached_type = NULL; goto done; } /* CythonFunction */ static PyObject * __Pyx_CyFunction_get_doc(__pyx_CyFunctionObject *op, CYTHON_UNUSED void *closure) { if (unlikely(op->func_doc == NULL)) { if (op->func.m_ml->ml_doc) { #if PY_MAJOR_VERSION >= 3 op->func_doc = PyUnicode_FromString(op->func.m_ml->ml_doc); #else op->func_doc = PyString_FromString(op->func.m_ml->ml_doc); #endif if (unlikely(op->func_doc == NULL)) return NULL; } else { Py_INCREF(Py_None); return Py_None; } } Py_INCREF(op->func_doc); return op->func_doc; } static int __Pyx_CyFunction_set_doc(__pyx_CyFunctionObject *op, PyObject *value) { PyObject *tmp = op->func_doc; if (value == NULL) { value = Py_None; } Py_INCREF(value); op->func_doc = value; Py_XDECREF(tmp); return 0; } static PyObject * __Pyx_CyFunction_get_name(__pyx_CyFunctionObject *op) { if (unlikely(op->func_name == NULL)) { #if PY_MAJOR_VERSION >= 3 op->func_name = PyUnicode_InternFromString(op->func.m_ml->ml_name); #else op->func_name = PyString_InternFromString(op->func.m_ml->ml_name); #endif if (unlikely(op->func_name == NULL)) return NULL; } Py_INCREF(op->func_name); return op->func_name; } static int __Pyx_CyFunction_set_name(__pyx_CyFunctionObject *op, PyObject *value) { PyObject *tmp; #if PY_MAJOR_VERSION >= 3 if (unlikely(value == NULL || !PyUnicode_Check(value))) { #else if (unlikely(value == NULL || !PyString_Check(value))) { #endif PyErr_SetString(PyExc_TypeError, "__name__ must be set to a string object"); return -1; } tmp = op->func_name; Py_INCREF(value); op->func_name = value; Py_XDECREF(tmp); return 0; } static PyObject * __Pyx_CyFunction_get_qualname(__pyx_CyFunctionObject *op) { Py_INCREF(op->func_qualname); return op->func_qualname; } static int __Pyx_CyFunction_set_qualname(__pyx_CyFunctionObject *op, PyObject *value) { PyObject *tmp; #if PY_MAJOR_VERSION >= 3 if (unlikely(value == NULL || !PyUnicode_Check(value))) { #else if (unlikely(value == NULL || !PyString_Check(value))) { #endif PyErr_SetString(PyExc_TypeError, "__qualname__ must be set to a string object"); return -1; } tmp = op->func_qualname; Py_INCREF(value); op->func_qualname = value; Py_XDECREF(tmp); return 0; } static PyObject * __Pyx_CyFunction_get_self(__pyx_CyFunctionObject *m, CYTHON_UNUSED void *closure) { PyObject *self; self = m->func_closure; if (self == NULL) self = Py_None; Py_INCREF(self); return self; } static PyObject * __Pyx_CyFunction_get_dict(__pyx_CyFunctionObject *op) { if (unlikely(op->func_dict == NULL)) { op->func_dict = PyDict_New(); if (unlikely(op->func_dict == NULL)) return NULL; } Py_INCREF(op->func_dict); return op->func_dict; } static int __Pyx_CyFunction_set_dict(__pyx_CyFunctionObject *op, PyObject *value) { PyObject *tmp; if (unlikely(value == NULL)) { PyErr_SetString(PyExc_TypeError, "function's dictionary may not be deleted"); return -1; } if (unlikely(!PyDict_Check(value))) { PyErr_SetString(PyExc_TypeError, "setting function's dictionary to a non-dict"); return -1; } tmp = op->func_dict; Py_INCREF(value); op->func_dict = value; Py_XDECREF(tmp); return 0; } static PyObject * __Pyx_CyFunction_get_globals(__pyx_CyFunctionObject *op) { Py_INCREF(op->func_globals); return op->func_globals; } static PyObject * __Pyx_CyFunction_get_closure(CYTHON_UNUSED __pyx_CyFunctionObject *op) { Py_INCREF(Py_None); return Py_None; } static PyObject * __Pyx_CyFunction_get_code(__pyx_CyFunctionObject *op) { PyObject* result = (op->func_code) ? op->func_code : Py_None; Py_INCREF(result); return result; } static int __Pyx_CyFunction_init_defaults(__pyx_CyFunctionObject *op) { int result = 0; PyObject *res = op->defaults_getter((PyObject *) op); if (unlikely(!res)) return -1; #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS op->defaults_tuple = PyTuple_GET_ITEM(res, 0); Py_INCREF(op->defaults_tuple); op->defaults_kwdict = PyTuple_GET_ITEM(res, 1); Py_INCREF(op->defaults_kwdict); #else op->defaults_tuple = PySequence_ITEM(res, 0); if (unlikely(!op->defaults_tuple)) result = -1; else { op->defaults_kwdict = PySequence_ITEM(res, 1); if (unlikely(!op->defaults_kwdict)) result = -1; } #endif Py_DECREF(res); return result; } static int __Pyx_CyFunction_set_defaults(__pyx_CyFunctionObject *op, PyObject* value) { PyObject* tmp; if (!value) { value = Py_None; } else if (value != Py_None && !PyTuple_Check(value)) { PyErr_SetString(PyExc_TypeError, "__defaults__ must be set to a tuple object"); return -1; } Py_INCREF(value); tmp = op->defaults_tuple; op->defaults_tuple = value; Py_XDECREF(tmp); return 0; } static PyObject * __Pyx_CyFunction_get_defaults(__pyx_CyFunctionObject *op) { PyObject* result = op->defaults_tuple; if (unlikely(!result)) { if (op->defaults_getter) { if (__Pyx_CyFunction_init_defaults(op) < 0) return NULL; result = op->defaults_tuple; } else { result = Py_None; } } Py_INCREF(result); return result; } static int __Pyx_CyFunction_set_kwdefaults(__pyx_CyFunctionObject *op, PyObject* value) { PyObject* tmp; if (!value) { value = Py_None; } else if (value != Py_None && !PyDict_Check(value)) { PyErr_SetString(PyExc_TypeError, "__kwdefaults__ must be set to a dict object"); return -1; } Py_INCREF(value); tmp = op->defaults_kwdict; op->defaults_kwdict = value; Py_XDECREF(tmp); return 0; } static PyObject * __Pyx_CyFunction_get_kwdefaults(__pyx_CyFunctionObject *op) { PyObject* result = op->defaults_kwdict; if (unlikely(!result)) { if (op->defaults_getter) { if (__Pyx_CyFunction_init_defaults(op) < 0) return NULL; result = op->defaults_kwdict; } else { result = Py_None; } } Py_INCREF(result); return result; } static int __Pyx_CyFunction_set_annotations(__pyx_CyFunctionObject *op, PyObject* value) { PyObject* tmp; if (!value || value == Py_None) { value = NULL; } else if (!PyDict_Check(value)) { PyErr_SetString(PyExc_TypeError, "__annotations__ must be set to a dict object"); return -1; } Py_XINCREF(value); tmp = op->func_annotations; op->func_annotations = value; Py_XDECREF(tmp); return 0; } static PyObject * __Pyx_CyFunction_get_annotations(__pyx_CyFunctionObject *op) { PyObject* result = op->func_annotations; if (unlikely(!result)) { result = PyDict_New(); if (unlikely(!result)) return NULL; op->func_annotations = result; } Py_INCREF(result); return result; } static PyGetSetDef __pyx_CyFunction_getsets[] = { {(char *) "func_doc", (getter)__Pyx_CyFunction_get_doc, (setter)__Pyx_CyFunction_set_doc, 0, 0}, {(char *) "__doc__", (getter)__Pyx_CyFunction_get_doc, (setter)__Pyx_CyFunction_set_doc, 0, 0}, {(char *) "func_name", (getter)__Pyx_CyFunction_get_name, (setter)__Pyx_CyFunction_set_name, 0, 0}, {(char *) "__name__", (getter)__Pyx_CyFunction_get_name, (setter)__Pyx_CyFunction_set_name, 0, 0}, {(char *) "__qualname__", (getter)__Pyx_CyFunction_get_qualname, (setter)__Pyx_CyFunction_set_qualname, 0, 0}, {(char *) "__self__", (getter)__Pyx_CyFunction_get_self, 0, 0, 0}, {(char *) "func_dict", (getter)__Pyx_CyFunction_get_dict, (setter)__Pyx_CyFunction_set_dict, 0, 0}, {(char *) "__dict__", (getter)__Pyx_CyFunction_get_dict, (setter)__Pyx_CyFunction_set_dict, 0, 0}, {(char *) "func_globals", (getter)__Pyx_CyFunction_get_globals, 0, 0, 0}, {(char *) "__globals__", (getter)__Pyx_CyFunction_get_globals, 0, 0, 0}, {(char *) "func_closure", (getter)__Pyx_CyFunction_get_closure, 0, 0, 0}, {(char *) "__closure__", (getter)__Pyx_CyFunction_get_closure, 0, 0, 0}, {(char *) "func_code", (getter)__Pyx_CyFunction_get_code, 0, 0, 0}, {(char *) "__code__", (getter)__Pyx_CyFunction_get_code, 0, 0, 0}, {(char *) "func_defaults", (getter)__Pyx_CyFunction_get_defaults, (setter)__Pyx_CyFunction_set_defaults, 0, 0}, {(char *) "__defaults__", (getter)__Pyx_CyFunction_get_defaults, (setter)__Pyx_CyFunction_set_defaults, 0, 0}, {(char *) "__kwdefaults__", (getter)__Pyx_CyFunction_get_kwdefaults, (setter)__Pyx_CyFunction_set_kwdefaults, 0, 0}, {(char *) "__annotations__", (getter)__Pyx_CyFunction_get_annotations, (setter)__Pyx_CyFunction_set_annotations, 0, 0}, {0, 0, 0, 0, 0} }; static PyMemberDef __pyx_CyFunction_members[] = { {(char *) "__module__", T_OBJECT, offsetof(__pyx_CyFunctionObject, func.m_module), PY_WRITE_RESTRICTED, 0}, {0, 0, 0, 0, 0} }; static PyObject * __Pyx_CyFunction_reduce(__pyx_CyFunctionObject *m, CYTHON_UNUSED PyObject *args) { #if PY_MAJOR_VERSION >= 3 return PyUnicode_FromString(m->func.m_ml->ml_name); #else return PyString_FromString(m->func.m_ml->ml_name); #endif } static PyMethodDef __pyx_CyFunction_methods[] = { {"__reduce__", (PyCFunction)__Pyx_CyFunction_reduce, METH_VARARGS, 0}, {0, 0, 0, 0} }; #if PY_VERSION_HEX < 0x030500A0 #define __Pyx_CyFunction_weakreflist(cyfunc) ((cyfunc)->func_weakreflist) #else #define __Pyx_CyFunction_weakreflist(cyfunc) ((cyfunc)->func.m_weakreflist) #endif static PyObject *__Pyx_CyFunction_New(PyTypeObject *type, PyMethodDef *ml, int flags, PyObject* qualname, PyObject *closure, PyObject *module, PyObject* globals, PyObject* code) { __pyx_CyFunctionObject *op = PyObject_GC_New(__pyx_CyFunctionObject, type); if (op == NULL) return NULL; op->flags = flags; __Pyx_CyFunction_weakreflist(op) = NULL; op->func.m_ml = ml; op->func.m_self = (PyObject *) op; Py_XINCREF(closure); op->func_closure = closure; Py_XINCREF(module); op->func.m_module = module; op->func_dict = NULL; op->func_name = NULL; Py_INCREF(qualname); op->func_qualname = qualname; op->func_doc = NULL; op->func_classobj = NULL; op->func_globals = globals; Py_INCREF(op->func_globals); Py_XINCREF(code); op->func_code = code; op->defaults_pyobjects = 0; op->defaults = NULL; op->defaults_tuple = NULL; op->defaults_kwdict = NULL; op->defaults_getter = NULL; op->func_annotations = NULL; PyObject_GC_Track(op); return (PyObject *) op; } static int __Pyx_CyFunction_clear(__pyx_CyFunctionObject *m) { Py_CLEAR(m->func_closure); Py_CLEAR(m->func.m_module); Py_CLEAR(m->func_dict); Py_CLEAR(m->func_name); Py_CLEAR(m->func_qualname); Py_CLEAR(m->func_doc); Py_CLEAR(m->func_globals); Py_CLEAR(m->func_code); Py_CLEAR(m->func_classobj); Py_CLEAR(m->defaults_tuple); Py_CLEAR(m->defaults_kwdict); Py_CLEAR(m->func_annotations); if (m->defaults) { PyObject **pydefaults = __Pyx_CyFunction_Defaults(PyObject *, m); int i; for (i = 0; i < m->defaults_pyobjects; i++) Py_XDECREF(pydefaults[i]); PyObject_Free(m->defaults); m->defaults = NULL; } return 0; } static void __Pyx_CyFunction_dealloc(__pyx_CyFunctionObject *m) { PyObject_GC_UnTrack(m); if (__Pyx_CyFunction_weakreflist(m) != NULL) PyObject_ClearWeakRefs((PyObject *) m); __Pyx_CyFunction_clear(m); PyObject_GC_Del(m); } static int __Pyx_CyFunction_traverse(__pyx_CyFunctionObject *m, visitproc visit, void *arg) { Py_VISIT(m->func_closure); Py_VISIT(m->func.m_module); Py_VISIT(m->func_dict); Py_VISIT(m->func_name); Py_VISIT(m->func_qualname); Py_VISIT(m->func_doc); Py_VISIT(m->func_globals); Py_VISIT(m->func_code); Py_VISIT(m->func_classobj); Py_VISIT(m->defaults_tuple); Py_VISIT(m->defaults_kwdict); if (m->defaults) { PyObject **pydefaults = __Pyx_CyFunction_Defaults(PyObject *, m); int i; for (i = 0; i < m->defaults_pyobjects; i++) Py_VISIT(pydefaults[i]); } return 0; } static PyObject *__Pyx_CyFunction_descr_get(PyObject *func, PyObject *obj, PyObject *type) { __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func; if (m->flags & __Pyx_CYFUNCTION_STATICMETHOD) { Py_INCREF(func); return func; } if (m->flags & __Pyx_CYFUNCTION_CLASSMETHOD) { if (type == NULL) type = (PyObject *)(Py_TYPE(obj)); return __Pyx_PyMethod_New(func, type, (PyObject *)(Py_TYPE(type))); } if (obj == Py_None) obj = NULL; return __Pyx_PyMethod_New(func, obj, type); } static PyObject* __Pyx_CyFunction_repr(__pyx_CyFunctionObject *op) { #if PY_MAJOR_VERSION >= 3 return PyUnicode_FromFormat("", op->func_qualname, (void *)op); #else return PyString_FromFormat("", PyString_AsString(op->func_qualname), (void *)op); #endif } static PyObject * __Pyx_CyFunction_CallMethod(PyObject *func, PyObject *self, PyObject *arg, PyObject *kw) { PyCFunctionObject* f = (PyCFunctionObject*)func; PyCFunction meth = f->m_ml->ml_meth; Py_ssize_t size; switch (f->m_ml->ml_flags & (METH_VARARGS | METH_KEYWORDS | METH_NOARGS | METH_O)) { case METH_VARARGS: if (likely(kw == NULL || PyDict_Size(kw) == 0)) return (*meth)(self, arg); break; case METH_VARARGS | METH_KEYWORDS: return (*(PyCFunctionWithKeywords)meth)(self, arg, kw); case METH_NOARGS: if (likely(kw == NULL || PyDict_Size(kw) == 0)) { size = PyTuple_GET_SIZE(arg); if (likely(size == 0)) return (*meth)(self, NULL); PyErr_Format(PyExc_TypeError, "%.200s() takes no arguments (%" CYTHON_FORMAT_SSIZE_T "d given)", f->m_ml->ml_name, size); return NULL; } break; case METH_O: if (likely(kw == NULL || PyDict_Size(kw) == 0)) { size = PyTuple_GET_SIZE(arg); if (likely(size == 1)) { PyObject *result, *arg0 = PySequence_ITEM(arg, 0); if (unlikely(!arg0)) return NULL; result = (*meth)(self, arg0); Py_DECREF(arg0); return result; } PyErr_Format(PyExc_TypeError, "%.200s() takes exactly one argument (%" CYTHON_FORMAT_SSIZE_T "d given)", f->m_ml->ml_name, size); return NULL; } break; default: PyErr_SetString(PyExc_SystemError, "Bad call flags in " "__Pyx_CyFunction_Call. METH_OLDARGS is no " "longer supported!"); return NULL; } PyErr_Format(PyExc_TypeError, "%.200s() takes no keyword arguments", f->m_ml->ml_name); return NULL; } static CYTHON_INLINE PyObject *__Pyx_CyFunction_Call(PyObject *func, PyObject *arg, PyObject *kw) { return __Pyx_CyFunction_CallMethod(func, ((PyCFunctionObject*)func)->m_self, arg, kw); } static PyObject *__Pyx_CyFunction_CallAsMethod(PyObject *func, PyObject *args, PyObject *kw) { PyObject *result; __pyx_CyFunctionObject *cyfunc = (__pyx_CyFunctionObject *) func; if ((cyfunc->flags & __Pyx_CYFUNCTION_CCLASS) && !(cyfunc->flags & __Pyx_CYFUNCTION_STATICMETHOD)) { Py_ssize_t argc; PyObject *new_args; PyObject *self; argc = PyTuple_GET_SIZE(args); new_args = PyTuple_GetSlice(args, 1, argc); if (unlikely(!new_args)) return NULL; self = PyTuple_GetItem(args, 0); if (unlikely(!self)) { Py_DECREF(new_args); return NULL; } result = __Pyx_CyFunction_CallMethod(func, self, new_args, kw); Py_DECREF(new_args); } else { result = __Pyx_CyFunction_Call(func, args, kw); } return result; } static PyTypeObject __pyx_CyFunctionType_type = { PyVarObject_HEAD_INIT(0, 0) "cython_function_or_method", sizeof(__pyx_CyFunctionObject), 0, (destructor) __Pyx_CyFunction_dealloc, 0, 0, 0, #if PY_MAJOR_VERSION < 3 0, #else 0, #endif (reprfunc) __Pyx_CyFunction_repr, 0, 0, 0, 0, __Pyx_CyFunction_CallAsMethod, 0, 0, 0, 0, Py_TPFLAGS_DEFAULT | Py_TPFLAGS_HAVE_GC, 0, (traverseproc) __Pyx_CyFunction_traverse, (inquiry) __Pyx_CyFunction_clear, 0, #if PY_VERSION_HEX < 0x030500A0 offsetof(__pyx_CyFunctionObject, func_weakreflist), #else offsetof(PyCFunctionObject, m_weakreflist), #endif 0, 0, __pyx_CyFunction_methods, __pyx_CyFunction_members, __pyx_CyFunction_getsets, 0, 0, __Pyx_CyFunction_descr_get, 0, offsetof(__pyx_CyFunctionObject, func_dict), 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, #if PY_VERSION_HEX >= 0x030400a1 0, #endif }; static int __pyx_CyFunction_init(void) { __pyx_CyFunctionType = __Pyx_FetchCommonType(&__pyx_CyFunctionType_type); if (__pyx_CyFunctionType == NULL) { return -1; } return 0; } static CYTHON_INLINE void *__Pyx_CyFunction_InitDefaults(PyObject *func, size_t size, int pyobjects) { __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func; m->defaults = PyObject_Malloc(size); if (!m->defaults) return PyErr_NoMemory(); memset(m->defaults, 0, size); m->defaults_pyobjects = pyobjects; return m->defaults; } static CYTHON_INLINE void __Pyx_CyFunction_SetDefaultsTuple(PyObject *func, PyObject *tuple) { __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func; m->defaults_tuple = tuple; Py_INCREF(tuple); } static CYTHON_INLINE void __Pyx_CyFunction_SetDefaultsKwDict(PyObject *func, PyObject *dict) { __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func; m->defaults_kwdict = dict; Py_INCREF(dict); } static CYTHON_INLINE void __Pyx_CyFunction_SetAnnotationsDict(PyObject *func, PyObject *dict) { __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func; m->func_annotations = dict; Py_INCREF(dict); } /* Py3ClassCreate */ static PyObject *__Pyx_Py3MetaclassPrepare(PyObject *metaclass, PyObject *bases, PyObject *name, PyObject *qualname, PyObject *mkw, PyObject *modname, PyObject *doc) { PyObject *ns; if (metaclass) { PyObject *prep = __Pyx_PyObject_GetAttrStr(metaclass, __pyx_n_s_prepare); if (prep) { PyObject *pargs = PyTuple_Pack(2, name, bases); if (unlikely(!pargs)) { Py_DECREF(prep); return NULL; } ns = PyObject_Call(prep, pargs, mkw); Py_DECREF(prep); Py_DECREF(pargs); } else { if (unlikely(!PyErr_ExceptionMatches(PyExc_AttributeError))) return NULL; PyErr_Clear(); ns = PyDict_New(); } } else { ns = PyDict_New(); } if (unlikely(!ns)) return NULL; if (unlikely(PyObject_SetItem(ns, __pyx_n_s_module, modname) < 0)) goto bad; if (unlikely(PyObject_SetItem(ns, __pyx_n_s_qualname, qualname) < 0)) goto bad; if (unlikely(doc && PyObject_SetItem(ns, __pyx_n_s_doc, doc) < 0)) goto bad; return ns; bad: Py_DECREF(ns); return NULL; } static PyObject *__Pyx_Py3ClassCreate(PyObject *metaclass, PyObject *name, PyObject *bases, PyObject *dict, PyObject *mkw, int calculate_metaclass, int allow_py2_metaclass) { PyObject *result, *margs; PyObject *owned_metaclass = NULL; if (allow_py2_metaclass) { owned_metaclass = PyObject_GetItem(dict, __pyx_n_s_metaclass); if (owned_metaclass) { metaclass = owned_metaclass; } else if (likely(PyErr_ExceptionMatches(PyExc_KeyError))) { PyErr_Clear(); } else { return NULL; } } if (calculate_metaclass && (!metaclass || PyType_Check(metaclass))) { metaclass = __Pyx_CalculateMetaclass((PyTypeObject*) metaclass, bases); Py_XDECREF(owned_metaclass); if (unlikely(!metaclass)) return NULL; owned_metaclass = metaclass; } margs = PyTuple_Pack(3, name, bases, dict); if (unlikely(!margs)) { result = NULL; } else { result = PyObject_Call(metaclass, margs, mkw); Py_DECREF(margs); } Py_XDECREF(owned_metaclass); return result; } /* CodeObjectCache */ static int __pyx_bisect_code_objects(__Pyx_CodeObjectCacheEntry* entries, int count, int code_line) { int start = 0, mid = 0, end = count - 1; if (end >= 0 && code_line > entries[end].code_line) { return count; } while (start < end) { mid = start + (end - start) / 2; if (code_line < entries[mid].code_line) { end = mid; } else if (code_line > entries[mid].code_line) { start = mid + 1; } else { return mid; } } if (code_line <= entries[mid].code_line) { return mid; } else { return mid + 1; } } static PyCodeObject *__pyx_find_code_object(int code_line) { PyCodeObject* code_object; int pos; if (unlikely(!code_line) || unlikely(!__pyx_code_cache.entries)) { return NULL; } pos = __pyx_bisect_code_objects(__pyx_code_cache.entries, __pyx_code_cache.count, code_line); if (unlikely(pos >= __pyx_code_cache.count) || unlikely(__pyx_code_cache.entries[pos].code_line != code_line)) { return NULL; } code_object = __pyx_code_cache.entries[pos].code_object; Py_INCREF(code_object); return code_object; } static void __pyx_insert_code_object(int code_line, PyCodeObject* code_object) { int pos, i; __Pyx_CodeObjectCacheEntry* entries = __pyx_code_cache.entries; if (unlikely(!code_line)) { return; } if (unlikely(!entries)) { entries = (__Pyx_CodeObjectCacheEntry*)PyMem_Malloc(64*sizeof(__Pyx_CodeObjectCacheEntry)); if (likely(entries)) { __pyx_code_cache.entries = entries; __pyx_code_cache.max_count = 64; __pyx_code_cache.count = 1; entries[0].code_line = code_line; entries[0].code_object = code_object; Py_INCREF(code_object); } return; } pos = __pyx_bisect_code_objects(__pyx_code_cache.entries, __pyx_code_cache.count, code_line); if ((pos < __pyx_code_cache.count) && unlikely(__pyx_code_cache.entries[pos].code_line == code_line)) { PyCodeObject* tmp = entries[pos].code_object; entries[pos].code_object = code_object; Py_DECREF(tmp); return; } if (__pyx_code_cache.count == __pyx_code_cache.max_count) { int new_max = __pyx_code_cache.max_count + 64; entries = (__Pyx_CodeObjectCacheEntry*)PyMem_Realloc( __pyx_code_cache.entries, (size_t)new_max*sizeof(__Pyx_CodeObjectCacheEntry)); if (unlikely(!entries)) { return; } __pyx_code_cache.entries = entries; __pyx_code_cache.max_count = new_max; } for (i=__pyx_code_cache.count; i>pos; i--) { entries[i] = entries[i-1]; } entries[pos].code_line = code_line; entries[pos].code_object = code_object; __pyx_code_cache.count++; Py_INCREF(code_object); } /* AddTraceback */ #include "compile.h" #include "frameobject.h" #include "traceback.h" static PyCodeObject* __Pyx_CreateCodeObjectForTraceback( const char *funcname, int c_line, int py_line, const char *filename) { PyCodeObject *py_code = 0; PyObject *py_srcfile = 0; PyObject *py_funcname = 0; #if PY_MAJOR_VERSION < 3 py_srcfile = PyString_FromString(filename); #else py_srcfile = PyUnicode_FromString(filename); #endif if (!py_srcfile) goto bad; if (c_line) { #if PY_MAJOR_VERSION < 3 py_funcname = PyString_FromFormat( "%s (%s:%d)", funcname, __pyx_cfilenm, c_line); #else py_funcname = PyUnicode_FromFormat( "%s (%s:%d)", funcname, __pyx_cfilenm, c_line); #endif } else { #if PY_MAJOR_VERSION < 3 py_funcname = PyString_FromString(funcname); #else py_funcname = PyUnicode_FromString(funcname); #endif } if (!py_funcname) goto bad; py_code = __Pyx_PyCode_New( 0, 0, 0, 0, 0, __pyx_empty_bytes, /*PyObject *code,*/ __pyx_empty_tuple, /*PyObject *consts,*/ __pyx_empty_tuple, /*PyObject *names,*/ __pyx_empty_tuple, /*PyObject *varnames,*/ __pyx_empty_tuple, /*PyObject *freevars,*/ __pyx_empty_tuple, /*PyObject *cellvars,*/ py_srcfile, /*PyObject *filename,*/ py_funcname, /*PyObject *name,*/ py_line, __pyx_empty_bytes /*PyObject *lnotab*/ ); Py_DECREF(py_srcfile); Py_DECREF(py_funcname); return py_code; bad: Py_XDECREF(py_srcfile); Py_XDECREF(py_funcname); return NULL; } static void __Pyx_AddTraceback(const char *funcname, int c_line, int py_line, const char *filename) { PyCodeObject *py_code = 0; PyFrameObject *py_frame = 0; py_code = __pyx_find_code_object(c_line ? c_line : py_line); if (!py_code) { py_code = __Pyx_CreateCodeObjectForTraceback( funcname, c_line, py_line, filename); if (!py_code) goto bad; __pyx_insert_code_object(c_line ? c_line : py_line, py_code); } py_frame = PyFrame_New( PyThreadState_GET(), /*PyThreadState *tstate,*/ py_code, /*PyCodeObject *code,*/ __pyx_d, /*PyObject *globals,*/ 0 /*PyObject *locals*/ ); if (!py_frame) goto bad; __Pyx_PyFrame_SetLineNumber(py_frame, py_line); PyTraceBack_Here(py_frame); bad: Py_XDECREF(py_code); Py_XDECREF(py_frame); } /* CIntToPy */ static CYTHON_INLINE PyObject* __Pyx_PyInt_From_int(int value) { const int neg_one = (int) -1, const_zero = (int) 0; const int is_unsigned = neg_one > const_zero; if (is_unsigned) { if (sizeof(int) < sizeof(long)) { return PyInt_FromLong((long) value); } else if (sizeof(int) <= sizeof(unsigned long)) { return PyLong_FromUnsignedLong((unsigned long) value); #ifdef HAVE_LONG_LONG } else if (sizeof(int) <= sizeof(unsigned PY_LONG_LONG)) { return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value); #endif } } else { if (sizeof(int) <= sizeof(long)) { return PyInt_FromLong((long) value); #ifdef HAVE_LONG_LONG } else if (sizeof(int) <= sizeof(PY_LONG_LONG)) { return PyLong_FromLongLong((PY_LONG_LONG) value); #endif } } { int one = 1; int little = (int)*(unsigned char *)&one; unsigned char *bytes = (unsigned char *)&value; return _PyLong_FromByteArray(bytes, sizeof(int), little, !is_unsigned); } } /* CIntFromPyVerify */ #define __PYX_VERIFY_RETURN_INT(target_type, func_type, func_value)\ __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, 0) #define __PYX_VERIFY_RETURN_INT_EXC(target_type, func_type, func_value)\ __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, 1) #define __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, exc)\ {\ func_type value = func_value;\ if (sizeof(target_type) < sizeof(func_type)) {\ if (unlikely(value != (func_type) (target_type) value)) {\ func_type zero = 0;\ if (exc && unlikely(value == (func_type)-1 && PyErr_Occurred()))\ return (target_type) -1;\ if (is_unsigned && unlikely(value < zero))\ goto raise_neg_overflow;\ else\ goto raise_overflow;\ }\ }\ return (target_type) value;\ } /* CIntToPy */ static CYTHON_INLINE PyObject* __Pyx_PyInt_From_long(long value) { const long neg_one = (long) -1, const_zero = (long) 0; const int is_unsigned = neg_one > const_zero; if (is_unsigned) { if (sizeof(long) < sizeof(long)) { return PyInt_FromLong((long) value); } else if (sizeof(long) <= sizeof(unsigned long)) { return PyLong_FromUnsignedLong((unsigned long) value); #ifdef HAVE_LONG_LONG } else if (sizeof(long) <= sizeof(unsigned PY_LONG_LONG)) { return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value); #endif } } else { if (sizeof(long) <= sizeof(long)) { return PyInt_FromLong((long) value); #ifdef HAVE_LONG_LONG } else if (sizeof(long) <= sizeof(PY_LONG_LONG)) { return PyLong_FromLongLong((PY_LONG_LONG) value); #endif } } { int one = 1; int little = (int)*(unsigned char *)&one; unsigned char *bytes = (unsigned char *)&value; return _PyLong_FromByteArray(bytes, sizeof(long), little, !is_unsigned); } } /* CIntToPy */ static CYTHON_INLINE PyObject* __Pyx_PyInt_From_SDL_WindowFlags(SDL_WindowFlags value) { const SDL_WindowFlags neg_one = (SDL_WindowFlags) -1, const_zero = (SDL_WindowFlags) 0; const int is_unsigned = neg_one > const_zero; if (is_unsigned) { if (sizeof(SDL_WindowFlags) < sizeof(long)) { return PyInt_FromLong((long) value); } else if (sizeof(SDL_WindowFlags) <= sizeof(unsigned long)) { return PyLong_FromUnsignedLong((unsigned long) value); #ifdef HAVE_LONG_LONG } else if (sizeof(SDL_WindowFlags) <= sizeof(unsigned PY_LONG_LONG)) { return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value); #endif } } else { if (sizeof(SDL_WindowFlags) <= sizeof(long)) { return PyInt_FromLong((long) value); #ifdef HAVE_LONG_LONG } else if (sizeof(SDL_WindowFlags) <= sizeof(PY_LONG_LONG)) { return PyLong_FromLongLong((PY_LONG_LONG) value); #endif } } { int one = 1; int little = (int)*(unsigned char *)&one; unsigned char *bytes = (unsigned char *)&value; return _PyLong_FromByteArray(bytes, sizeof(SDL_WindowFlags), little, !is_unsigned); } } /* CIntToPy */ static CYTHON_INLINE PyObject* __Pyx_PyInt_From_uint32_t(uint32_t value) { const uint32_t neg_one = (uint32_t) -1, const_zero = (uint32_t) 0; const int is_unsigned = neg_one > const_zero; if (is_unsigned) { if (sizeof(uint32_t) < sizeof(long)) { return PyInt_FromLong((long) value); } else if (sizeof(uint32_t) <= sizeof(unsigned long)) { return PyLong_FromUnsignedLong((unsigned long) value); #ifdef HAVE_LONG_LONG } else if (sizeof(uint32_t) <= sizeof(unsigned PY_LONG_LONG)) { return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value); #endif } } else { if (sizeof(uint32_t) <= sizeof(long)) { return PyInt_FromLong((long) value); #ifdef HAVE_LONG_LONG } else if (sizeof(uint32_t) <= sizeof(PY_LONG_LONG)) { return PyLong_FromLongLong((PY_LONG_LONG) value); #endif } } { int one = 1; int little = (int)*(unsigned char *)&one; unsigned char *bytes = (unsigned char *)&value; return _PyLong_FromByteArray(bytes, sizeof(uint32_t), little, !is_unsigned); } } /* CIntToPy */ static CYTHON_INLINE PyObject* __Pyx_PyInt_From_uint8_t(uint8_t value) { const uint8_t neg_one = (uint8_t) -1, const_zero = (uint8_t) 0; const int is_unsigned = neg_one > const_zero; if (is_unsigned) { if (sizeof(uint8_t) < sizeof(long)) { return PyInt_FromLong((long) value); } else if (sizeof(uint8_t) <= sizeof(unsigned long)) { return PyLong_FromUnsignedLong((unsigned long) value); #ifdef HAVE_LONG_LONG } else if (sizeof(uint8_t) <= sizeof(unsigned PY_LONG_LONG)) { return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value); #endif } } else { if (sizeof(uint8_t) <= sizeof(long)) { return PyInt_FromLong((long) value); #ifdef HAVE_LONG_LONG } else if (sizeof(uint8_t) <= sizeof(PY_LONG_LONG)) { return PyLong_FromLongLong((PY_LONG_LONG) value); #endif } } { int one = 1; int little = (int)*(unsigned char *)&one; unsigned char *bytes = (unsigned char *)&value; return _PyLong_FromByteArray(bytes, sizeof(uint8_t), little, !is_unsigned); } } /* CIntFromPy */ static CYTHON_INLINE uint32_t __Pyx_PyInt_As_uint32_t(PyObject *x) { const uint32_t neg_one = (uint32_t) -1, const_zero = (uint32_t) 0; const int is_unsigned = neg_one > const_zero; #if PY_MAJOR_VERSION < 3 if (likely(PyInt_Check(x))) { if (sizeof(uint32_t) < sizeof(long)) { __PYX_VERIFY_RETURN_INT(uint32_t, long, PyInt_AS_LONG(x)) } else { long val = PyInt_AS_LONG(x); if (is_unsigned && unlikely(val < 0)) { goto raise_neg_overflow; } return (uint32_t) val; } } else #endif if (likely(PyLong_Check(x))) { if (is_unsigned) { #if CYTHON_USE_PYLONG_INTERNALS const digit* digits = ((PyLongObject*)x)->ob_digit; switch (Py_SIZE(x)) { case 0: return (uint32_t) 0; case 1: __PYX_VERIFY_RETURN_INT(uint32_t, digit, digits[0]) case 2: if (8 * sizeof(uint32_t) > 1 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(uint32_t, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(uint32_t) >= 2 * PyLong_SHIFT) { return (uint32_t) (((((uint32_t)digits[1]) << PyLong_SHIFT) | (uint32_t)digits[0])); } } break; case 3: if (8 * sizeof(uint32_t) > 2 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(uint32_t, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(uint32_t) >= 3 * PyLong_SHIFT) { return (uint32_t) (((((((uint32_t)digits[2]) << PyLong_SHIFT) | (uint32_t)digits[1]) << PyLong_SHIFT) | (uint32_t)digits[0])); } } break; case 4: if (8 * sizeof(uint32_t) > 3 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(uint32_t, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(uint32_t) >= 4 * PyLong_SHIFT) { return (uint32_t) (((((((((uint32_t)digits[3]) << PyLong_SHIFT) | (uint32_t)digits[2]) << PyLong_SHIFT) | (uint32_t)digits[1]) << PyLong_SHIFT) | (uint32_t)digits[0])); } } break; } #endif #if CYTHON_COMPILING_IN_CPYTHON if (unlikely(Py_SIZE(x) < 0)) { goto raise_neg_overflow; } #else { int result = PyObject_RichCompareBool(x, Py_False, Py_LT); if (unlikely(result < 0)) return (uint32_t) -1; if (unlikely(result == 1)) goto raise_neg_overflow; } #endif if (sizeof(uint32_t) <= sizeof(unsigned long)) { __PYX_VERIFY_RETURN_INT_EXC(uint32_t, unsigned long, PyLong_AsUnsignedLong(x)) #ifdef HAVE_LONG_LONG } else if (sizeof(uint32_t) <= sizeof(unsigned PY_LONG_LONG)) { __PYX_VERIFY_RETURN_INT_EXC(uint32_t, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x)) #endif } } else { #if CYTHON_USE_PYLONG_INTERNALS const digit* digits = ((PyLongObject*)x)->ob_digit; switch (Py_SIZE(x)) { case 0: return (uint32_t) 0; case -1: __PYX_VERIFY_RETURN_INT(uint32_t, sdigit, (sdigit) (-(sdigit)digits[0])) case 1: __PYX_VERIFY_RETURN_INT(uint32_t, digit, +digits[0]) case -2: if (8 * sizeof(uint32_t) - 1 > 1 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(uint32_t, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(uint32_t) - 1 > 2 * PyLong_SHIFT) { return (uint32_t) (((uint32_t)-1)*(((((uint32_t)digits[1]) << PyLong_SHIFT) | (uint32_t)digits[0]))); } } break; case 2: if (8 * sizeof(uint32_t) > 1 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(uint32_t, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(uint32_t) - 1 > 2 * PyLong_SHIFT) { return (uint32_t) ((((((uint32_t)digits[1]) << PyLong_SHIFT) | (uint32_t)digits[0]))); } } break; case -3: if (8 * sizeof(uint32_t) - 1 > 2 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(uint32_t, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(uint32_t) - 1 > 3 * PyLong_SHIFT) { return (uint32_t) (((uint32_t)-1)*(((((((uint32_t)digits[2]) << PyLong_SHIFT) | (uint32_t)digits[1]) << PyLong_SHIFT) | (uint32_t)digits[0]))); } } break; case 3: if (8 * sizeof(uint32_t) > 2 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(uint32_t, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(uint32_t) - 1 > 3 * PyLong_SHIFT) { return (uint32_t) ((((((((uint32_t)digits[2]) << PyLong_SHIFT) | (uint32_t)digits[1]) << PyLong_SHIFT) | (uint32_t)digits[0]))); } } break; case -4: if (8 * sizeof(uint32_t) - 1 > 3 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(uint32_t, long, -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(uint32_t) - 1 > 4 * PyLong_SHIFT) { return (uint32_t) (((uint32_t)-1)*(((((((((uint32_t)digits[3]) << PyLong_SHIFT) | (uint32_t)digits[2]) << PyLong_SHIFT) | (uint32_t)digits[1]) << PyLong_SHIFT) | (uint32_t)digits[0]))); } } break; case 4: if (8 * sizeof(uint32_t) > 3 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(uint32_t, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(uint32_t) - 1 > 4 * PyLong_SHIFT) { return (uint32_t) ((((((((((uint32_t)digits[3]) << PyLong_SHIFT) | (uint32_t)digits[2]) << PyLong_SHIFT) | (uint32_t)digits[1]) << PyLong_SHIFT) | (uint32_t)digits[0]))); } } break; } #endif if (sizeof(uint32_t) <= sizeof(long)) { __PYX_VERIFY_RETURN_INT_EXC(uint32_t, long, PyLong_AsLong(x)) #ifdef HAVE_LONG_LONG } else if (sizeof(uint32_t) <= sizeof(PY_LONG_LONG)) { __PYX_VERIFY_RETURN_INT_EXC(uint32_t, PY_LONG_LONG, PyLong_AsLongLong(x)) #endif } } { #if CYTHON_COMPILING_IN_PYPY && !defined(_PyLong_AsByteArray) PyErr_SetString(PyExc_RuntimeError, "_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers"); #else uint32_t val; PyObject *v = __Pyx_PyNumber_IntOrLong(x); #if PY_MAJOR_VERSION < 3 if (likely(v) && !PyLong_Check(v)) { PyObject *tmp = v; v = PyNumber_Long(tmp); Py_DECREF(tmp); } #endif if (likely(v)) { int one = 1; int is_little = (int)*(unsigned char *)&one; unsigned char *bytes = (unsigned char *)&val; int ret = _PyLong_AsByteArray((PyLongObject *)v, bytes, sizeof(val), is_little, !is_unsigned); Py_DECREF(v); if (likely(!ret)) return val; } #endif return (uint32_t) -1; } } else { uint32_t val; PyObject *tmp = __Pyx_PyNumber_IntOrLong(x); if (!tmp) return (uint32_t) -1; val = __Pyx_PyInt_As_uint32_t(tmp); Py_DECREF(tmp); return val; } raise_overflow: PyErr_SetString(PyExc_OverflowError, "value too large to convert to uint32_t"); return (uint32_t) -1; raise_neg_overflow: PyErr_SetString(PyExc_OverflowError, "can't convert negative value to uint32_t"); return (uint32_t) -1; } /* CIntFromPy */ static CYTHON_INLINE int __Pyx_PyInt_As_int(PyObject *x) { const int neg_one = (int) -1, const_zero = (int) 0; const int is_unsigned = neg_one > const_zero; #if PY_MAJOR_VERSION < 3 if (likely(PyInt_Check(x))) { if (sizeof(int) < sizeof(long)) { __PYX_VERIFY_RETURN_INT(int, long, PyInt_AS_LONG(x)) } else { long val = PyInt_AS_LONG(x); if (is_unsigned && unlikely(val < 0)) { goto raise_neg_overflow; } return (int) val; } } else #endif if (likely(PyLong_Check(x))) { if (is_unsigned) { #if CYTHON_USE_PYLONG_INTERNALS const digit* digits = ((PyLongObject*)x)->ob_digit; switch (Py_SIZE(x)) { case 0: return (int) 0; case 1: __PYX_VERIFY_RETURN_INT(int, digit, digits[0]) case 2: if (8 * sizeof(int) > 1 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(int) >= 2 * PyLong_SHIFT) { return (int) (((((int)digits[1]) << PyLong_SHIFT) | (int)digits[0])); } } break; case 3: if (8 * sizeof(int) > 2 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(int) >= 3 * PyLong_SHIFT) { return (int) (((((((int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0])); } } break; case 4: if (8 * sizeof(int) > 3 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(int) >= 4 * PyLong_SHIFT) { return (int) (((((((((int)digits[3]) << PyLong_SHIFT) | (int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0])); } } break; } #endif #if CYTHON_COMPILING_IN_CPYTHON if (unlikely(Py_SIZE(x) < 0)) { goto raise_neg_overflow; } #else { int result = PyObject_RichCompareBool(x, Py_False, Py_LT); if (unlikely(result < 0)) return (int) -1; if (unlikely(result == 1)) goto raise_neg_overflow; } #endif if (sizeof(int) <= sizeof(unsigned long)) { __PYX_VERIFY_RETURN_INT_EXC(int, unsigned long, PyLong_AsUnsignedLong(x)) #ifdef HAVE_LONG_LONG } else if (sizeof(int) <= sizeof(unsigned PY_LONG_LONG)) { __PYX_VERIFY_RETURN_INT_EXC(int, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x)) #endif } } else { #if CYTHON_USE_PYLONG_INTERNALS const digit* digits = ((PyLongObject*)x)->ob_digit; switch (Py_SIZE(x)) { case 0: return (int) 0; case -1: __PYX_VERIFY_RETURN_INT(int, sdigit, (sdigit) (-(sdigit)digits[0])) case 1: __PYX_VERIFY_RETURN_INT(int, digit, +digits[0]) case -2: if (8 * sizeof(int) - 1 > 1 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(int, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(int) - 1 > 2 * PyLong_SHIFT) { return (int) (((int)-1)*(((((int)digits[1]) << PyLong_SHIFT) | (int)digits[0]))); } } break; case 2: if (8 * sizeof(int) > 1 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(int) - 1 > 2 * PyLong_SHIFT) { return (int) ((((((int)digits[1]) << PyLong_SHIFT) | (int)digits[0]))); } } break; case -3: if (8 * sizeof(int) - 1 > 2 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(int, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(int) - 1 > 3 * PyLong_SHIFT) { return (int) (((int)-1)*(((((((int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0]))); } } break; case 3: if (8 * sizeof(int) > 2 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(int) - 1 > 3 * PyLong_SHIFT) { return (int) ((((((((int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0]))); } } break; case -4: if (8 * sizeof(int) - 1 > 3 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(int, long, -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(int) - 1 > 4 * PyLong_SHIFT) { return (int) (((int)-1)*(((((((((int)digits[3]) << PyLong_SHIFT) | (int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0]))); } } break; case 4: if (8 * sizeof(int) > 3 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(int) - 1 > 4 * PyLong_SHIFT) { return (int) ((((((((((int)digits[3]) << PyLong_SHIFT) | (int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0]))); } } break; } #endif if (sizeof(int) <= sizeof(long)) { __PYX_VERIFY_RETURN_INT_EXC(int, long, PyLong_AsLong(x)) #ifdef HAVE_LONG_LONG } else if (sizeof(int) <= sizeof(PY_LONG_LONG)) { __PYX_VERIFY_RETURN_INT_EXC(int, PY_LONG_LONG, PyLong_AsLongLong(x)) #endif } } { #if CYTHON_COMPILING_IN_PYPY && !defined(_PyLong_AsByteArray) PyErr_SetString(PyExc_RuntimeError, "_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers"); #else int val; PyObject *v = __Pyx_PyNumber_IntOrLong(x); #if PY_MAJOR_VERSION < 3 if (likely(v) && !PyLong_Check(v)) { PyObject *tmp = v; v = PyNumber_Long(tmp); Py_DECREF(tmp); } #endif if (likely(v)) { int one = 1; int is_little = (int)*(unsigned char *)&one; unsigned char *bytes = (unsigned char *)&val; int ret = _PyLong_AsByteArray((PyLongObject *)v, bytes, sizeof(val), is_little, !is_unsigned); Py_DECREF(v); if (likely(!ret)) return val; } #endif return (int) -1; } } else { int val; PyObject *tmp = __Pyx_PyNumber_IntOrLong(x); if (!tmp) return (int) -1; val = __Pyx_PyInt_As_int(tmp); Py_DECREF(tmp); return val; } raise_overflow: PyErr_SetString(PyExc_OverflowError, "value too large to convert to int"); return (int) -1; raise_neg_overflow: PyErr_SetString(PyExc_OverflowError, "can't convert negative value to int"); return (int) -1; } /* CIntFromPy */ static CYTHON_INLINE long __Pyx_PyInt_As_long(PyObject *x) { const long neg_one = (long) -1, const_zero = (long) 0; const int is_unsigned = neg_one > const_zero; #if PY_MAJOR_VERSION < 3 if (likely(PyInt_Check(x))) { if (sizeof(long) < sizeof(long)) { __PYX_VERIFY_RETURN_INT(long, long, PyInt_AS_LONG(x)) } else { long val = PyInt_AS_LONG(x); if (is_unsigned && unlikely(val < 0)) { goto raise_neg_overflow; } return (long) val; } } else #endif if (likely(PyLong_Check(x))) { if (is_unsigned) { #if CYTHON_USE_PYLONG_INTERNALS const digit* digits = ((PyLongObject*)x)->ob_digit; switch (Py_SIZE(x)) { case 0: return (long) 0; case 1: __PYX_VERIFY_RETURN_INT(long, digit, digits[0]) case 2: if (8 * sizeof(long) > 1 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(long) >= 2 * PyLong_SHIFT) { return (long) (((((long)digits[1]) << PyLong_SHIFT) | (long)digits[0])); } } break; case 3: if (8 * sizeof(long) > 2 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(long) >= 3 * PyLong_SHIFT) { return (long) (((((((long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0])); } } break; case 4: if (8 * sizeof(long) > 3 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(long) >= 4 * PyLong_SHIFT) { return (long) (((((((((long)digits[3]) << PyLong_SHIFT) | (long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0])); } } break; } #endif #if CYTHON_COMPILING_IN_CPYTHON if (unlikely(Py_SIZE(x) < 0)) { goto raise_neg_overflow; } #else { int result = PyObject_RichCompareBool(x, Py_False, Py_LT); if (unlikely(result < 0)) return (long) -1; if (unlikely(result == 1)) goto raise_neg_overflow; } #endif if (sizeof(long) <= sizeof(unsigned long)) { __PYX_VERIFY_RETURN_INT_EXC(long, unsigned long, PyLong_AsUnsignedLong(x)) #ifdef HAVE_LONG_LONG } else if (sizeof(long) <= sizeof(unsigned PY_LONG_LONG)) { __PYX_VERIFY_RETURN_INT_EXC(long, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x)) #endif } } else { #if CYTHON_USE_PYLONG_INTERNALS const digit* digits = ((PyLongObject*)x)->ob_digit; switch (Py_SIZE(x)) { case 0: return (long) 0; case -1: __PYX_VERIFY_RETURN_INT(long, sdigit, (sdigit) (-(sdigit)digits[0])) case 1: __PYX_VERIFY_RETURN_INT(long, digit, +digits[0]) case -2: if (8 * sizeof(long) - 1 > 1 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(long, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) { return (long) (((long)-1)*(((((long)digits[1]) << PyLong_SHIFT) | (long)digits[0]))); } } break; case 2: if (8 * sizeof(long) > 1 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) { return (long) ((((((long)digits[1]) << PyLong_SHIFT) | (long)digits[0]))); } } break; case -3: if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(long, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) { return (long) (((long)-1)*(((((((long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0]))); } } break; case 3: if (8 * sizeof(long) > 2 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) { return (long) ((((((((long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0]))); } } break; case -4: if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(long, long, -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(long) - 1 > 4 * PyLong_SHIFT) { return (long) (((long)-1)*(((((((((long)digits[3]) << PyLong_SHIFT) | (long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0]))); } } break; case 4: if (8 * sizeof(long) > 3 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(long) - 1 > 4 * PyLong_SHIFT) { return (long) ((((((((((long)digits[3]) << PyLong_SHIFT) | (long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0]))); } } break; } #endif if (sizeof(long) <= sizeof(long)) { __PYX_VERIFY_RETURN_INT_EXC(long, long, PyLong_AsLong(x)) #ifdef HAVE_LONG_LONG } else if (sizeof(long) <= sizeof(PY_LONG_LONG)) { __PYX_VERIFY_RETURN_INT_EXC(long, PY_LONG_LONG, PyLong_AsLongLong(x)) #endif } } { #if CYTHON_COMPILING_IN_PYPY && !defined(_PyLong_AsByteArray) PyErr_SetString(PyExc_RuntimeError, "_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers"); #else long val; PyObject *v = __Pyx_PyNumber_IntOrLong(x); #if PY_MAJOR_VERSION < 3 if (likely(v) && !PyLong_Check(v)) { PyObject *tmp = v; v = PyNumber_Long(tmp); Py_DECREF(tmp); } #endif if (likely(v)) { int one = 1; int is_little = (int)*(unsigned char *)&one; unsigned char *bytes = (unsigned char *)&val; int ret = _PyLong_AsByteArray((PyLongObject *)v, bytes, sizeof(val), is_little, !is_unsigned); Py_DECREF(v); if (likely(!ret)) return val; } #endif return (long) -1; } } else { long val; PyObject *tmp = __Pyx_PyNumber_IntOrLong(x); if (!tmp) return (long) -1; val = __Pyx_PyInt_As_long(tmp); Py_DECREF(tmp); return val; } raise_overflow: PyErr_SetString(PyExc_OverflowError, "value too large to convert to long"); return (long) -1; raise_neg_overflow: PyErr_SetString(PyExc_OverflowError, "can't convert negative value to long"); return (long) -1; } /* CIntFromPy */ static CYTHON_INLINE uint16_t __Pyx_PyInt_As_uint16_t(PyObject *x) { const uint16_t neg_one = (uint16_t) -1, const_zero = (uint16_t) 0; const int is_unsigned = neg_one > const_zero; #if PY_MAJOR_VERSION < 3 if (likely(PyInt_Check(x))) { if (sizeof(uint16_t) < sizeof(long)) { __PYX_VERIFY_RETURN_INT(uint16_t, long, PyInt_AS_LONG(x)) } else { long val = PyInt_AS_LONG(x); if (is_unsigned && unlikely(val < 0)) { goto raise_neg_overflow; } return (uint16_t) val; } } else #endif if (likely(PyLong_Check(x))) { if (is_unsigned) { #if CYTHON_USE_PYLONG_INTERNALS const digit* digits = ((PyLongObject*)x)->ob_digit; switch (Py_SIZE(x)) { case 0: return (uint16_t) 0; case 1: __PYX_VERIFY_RETURN_INT(uint16_t, digit, digits[0]) case 2: if (8 * sizeof(uint16_t) > 1 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(uint16_t, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(uint16_t) >= 2 * PyLong_SHIFT) { return (uint16_t) (((((uint16_t)digits[1]) << PyLong_SHIFT) | (uint16_t)digits[0])); } } break; case 3: if (8 * sizeof(uint16_t) > 2 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(uint16_t, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(uint16_t) >= 3 * PyLong_SHIFT) { return (uint16_t) (((((((uint16_t)digits[2]) << PyLong_SHIFT) | (uint16_t)digits[1]) << PyLong_SHIFT) | (uint16_t)digits[0])); } } break; case 4: if (8 * sizeof(uint16_t) > 3 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(uint16_t, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(uint16_t) >= 4 * PyLong_SHIFT) { return (uint16_t) (((((((((uint16_t)digits[3]) << PyLong_SHIFT) | (uint16_t)digits[2]) << PyLong_SHIFT) | (uint16_t)digits[1]) << PyLong_SHIFT) | (uint16_t)digits[0])); } } break; } #endif #if CYTHON_COMPILING_IN_CPYTHON if (unlikely(Py_SIZE(x) < 0)) { goto raise_neg_overflow; } #else { int result = PyObject_RichCompareBool(x, Py_False, Py_LT); if (unlikely(result < 0)) return (uint16_t) -1; if (unlikely(result == 1)) goto raise_neg_overflow; } #endif if (sizeof(uint16_t) <= sizeof(unsigned long)) { __PYX_VERIFY_RETURN_INT_EXC(uint16_t, unsigned long, PyLong_AsUnsignedLong(x)) #ifdef HAVE_LONG_LONG } else if (sizeof(uint16_t) <= sizeof(unsigned PY_LONG_LONG)) { __PYX_VERIFY_RETURN_INT_EXC(uint16_t, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x)) #endif } } else { #if CYTHON_USE_PYLONG_INTERNALS const digit* digits = ((PyLongObject*)x)->ob_digit; switch (Py_SIZE(x)) { case 0: return (uint16_t) 0; case -1: __PYX_VERIFY_RETURN_INT(uint16_t, sdigit, (sdigit) (-(sdigit)digits[0])) case 1: __PYX_VERIFY_RETURN_INT(uint16_t, digit, +digits[0]) case -2: if (8 * sizeof(uint16_t) - 1 > 1 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(uint16_t, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(uint16_t) - 1 > 2 * PyLong_SHIFT) { return (uint16_t) (((uint16_t)-1)*(((((uint16_t)digits[1]) << PyLong_SHIFT) | (uint16_t)digits[0]))); } } break; case 2: if (8 * sizeof(uint16_t) > 1 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(uint16_t, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(uint16_t) - 1 > 2 * PyLong_SHIFT) { return (uint16_t) ((((((uint16_t)digits[1]) << PyLong_SHIFT) | (uint16_t)digits[0]))); } } break; case -3: if (8 * sizeof(uint16_t) - 1 > 2 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(uint16_t, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(uint16_t) - 1 > 3 * PyLong_SHIFT) { return (uint16_t) (((uint16_t)-1)*(((((((uint16_t)digits[2]) << PyLong_SHIFT) | (uint16_t)digits[1]) << PyLong_SHIFT) | (uint16_t)digits[0]))); } } break; case 3: if (8 * sizeof(uint16_t) > 2 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(uint16_t, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(uint16_t) - 1 > 3 * PyLong_SHIFT) { return (uint16_t) ((((((((uint16_t)digits[2]) << PyLong_SHIFT) | (uint16_t)digits[1]) << PyLong_SHIFT) | (uint16_t)digits[0]))); } } break; case -4: if (8 * sizeof(uint16_t) - 1 > 3 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(uint16_t, long, -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(uint16_t) - 1 > 4 * PyLong_SHIFT) { return (uint16_t) (((uint16_t)-1)*(((((((((uint16_t)digits[3]) << PyLong_SHIFT) | (uint16_t)digits[2]) << PyLong_SHIFT) | (uint16_t)digits[1]) << PyLong_SHIFT) | (uint16_t)digits[0]))); } } break; case 4: if (8 * sizeof(uint16_t) > 3 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(uint16_t, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(uint16_t) - 1 > 4 * PyLong_SHIFT) { return (uint16_t) ((((((((((uint16_t)digits[3]) << PyLong_SHIFT) | (uint16_t)digits[2]) << PyLong_SHIFT) | (uint16_t)digits[1]) << PyLong_SHIFT) | (uint16_t)digits[0]))); } } break; } #endif if (sizeof(uint16_t) <= sizeof(long)) { __PYX_VERIFY_RETURN_INT_EXC(uint16_t, long, PyLong_AsLong(x)) #ifdef HAVE_LONG_LONG } else if (sizeof(uint16_t) <= sizeof(PY_LONG_LONG)) { __PYX_VERIFY_RETURN_INT_EXC(uint16_t, PY_LONG_LONG, PyLong_AsLongLong(x)) #endif } } { #if CYTHON_COMPILING_IN_PYPY && !defined(_PyLong_AsByteArray) PyErr_SetString(PyExc_RuntimeError, "_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers"); #else uint16_t val; PyObject *v = __Pyx_PyNumber_IntOrLong(x); #if PY_MAJOR_VERSION < 3 if (likely(v) && !PyLong_Check(v)) { PyObject *tmp = v; v = PyNumber_Long(tmp); Py_DECREF(tmp); } #endif if (likely(v)) { int one = 1; int is_little = (int)*(unsigned char *)&one; unsigned char *bytes = (unsigned char *)&val; int ret = _PyLong_AsByteArray((PyLongObject *)v, bytes, sizeof(val), is_little, !is_unsigned); Py_DECREF(v); if (likely(!ret)) return val; } #endif return (uint16_t) -1; } } else { uint16_t val; PyObject *tmp = __Pyx_PyNumber_IntOrLong(x); if (!tmp) return (uint16_t) -1; val = __Pyx_PyInt_As_uint16_t(tmp); Py_DECREF(tmp); return val; } raise_overflow: PyErr_SetString(PyExc_OverflowError, "value too large to convert to uint16_t"); return (uint16_t) -1; raise_neg_overflow: PyErr_SetString(PyExc_OverflowError, "can't convert negative value to uint16_t"); return (uint16_t) -1; } /* CIntFromPy */ static CYTHON_INLINE SDL_GLattr __Pyx_PyInt_As_SDL_GLattr(PyObject *x) { const SDL_GLattr neg_one = (SDL_GLattr) -1, const_zero = (SDL_GLattr) 0; const int is_unsigned = neg_one > const_zero; #if PY_MAJOR_VERSION < 3 if (likely(PyInt_Check(x))) { if (sizeof(SDL_GLattr) < sizeof(long)) { __PYX_VERIFY_RETURN_INT(SDL_GLattr, long, PyInt_AS_LONG(x)) } else { long val = PyInt_AS_LONG(x); if (is_unsigned && unlikely(val < 0)) { goto raise_neg_overflow; } return (SDL_GLattr) val; } } else #endif if (likely(PyLong_Check(x))) { if (is_unsigned) { #if CYTHON_USE_PYLONG_INTERNALS const digit* digits = ((PyLongObject*)x)->ob_digit; switch (Py_SIZE(x)) { case 0: return (SDL_GLattr) 0; case 1: __PYX_VERIFY_RETURN_INT(SDL_GLattr, digit, digits[0]) case 2: if (8 * sizeof(SDL_GLattr) > 1 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(SDL_GLattr, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(SDL_GLattr) >= 2 * PyLong_SHIFT) { return (SDL_GLattr) (((((SDL_GLattr)digits[1]) << PyLong_SHIFT) | (SDL_GLattr)digits[0])); } } break; case 3: if (8 * sizeof(SDL_GLattr) > 2 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(SDL_GLattr, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(SDL_GLattr) >= 3 * PyLong_SHIFT) { return (SDL_GLattr) (((((((SDL_GLattr)digits[2]) << PyLong_SHIFT) | (SDL_GLattr)digits[1]) << PyLong_SHIFT) | (SDL_GLattr)digits[0])); } } break; case 4: if (8 * sizeof(SDL_GLattr) > 3 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(SDL_GLattr, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(SDL_GLattr) >= 4 * PyLong_SHIFT) { return (SDL_GLattr) (((((((((SDL_GLattr)digits[3]) << PyLong_SHIFT) | (SDL_GLattr)digits[2]) << PyLong_SHIFT) | (SDL_GLattr)digits[1]) << PyLong_SHIFT) | (SDL_GLattr)digits[0])); } } break; } #endif #if CYTHON_COMPILING_IN_CPYTHON if (unlikely(Py_SIZE(x) < 0)) { goto raise_neg_overflow; } #else { int result = PyObject_RichCompareBool(x, Py_False, Py_LT); if (unlikely(result < 0)) return (SDL_GLattr) -1; if (unlikely(result == 1)) goto raise_neg_overflow; } #endif if (sizeof(SDL_GLattr) <= sizeof(unsigned long)) { __PYX_VERIFY_RETURN_INT_EXC(SDL_GLattr, unsigned long, PyLong_AsUnsignedLong(x)) #ifdef HAVE_LONG_LONG } else if (sizeof(SDL_GLattr) <= sizeof(unsigned PY_LONG_LONG)) { __PYX_VERIFY_RETURN_INT_EXC(SDL_GLattr, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x)) #endif } } else { #if CYTHON_USE_PYLONG_INTERNALS const digit* digits = ((PyLongObject*)x)->ob_digit; switch (Py_SIZE(x)) { case 0: return (SDL_GLattr) 0; case -1: __PYX_VERIFY_RETURN_INT(SDL_GLattr, sdigit, (sdigit) (-(sdigit)digits[0])) case 1: __PYX_VERIFY_RETURN_INT(SDL_GLattr, digit, +digits[0]) case -2: if (8 * sizeof(SDL_GLattr) - 1 > 1 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(SDL_GLattr, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(SDL_GLattr) - 1 > 2 * PyLong_SHIFT) { return (SDL_GLattr) (((SDL_GLattr)-1)*(((((SDL_GLattr)digits[1]) << PyLong_SHIFT) | (SDL_GLattr)digits[0]))); } } break; case 2: if (8 * sizeof(SDL_GLattr) > 1 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(SDL_GLattr, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(SDL_GLattr) - 1 > 2 * PyLong_SHIFT) { return (SDL_GLattr) ((((((SDL_GLattr)digits[1]) << PyLong_SHIFT) | (SDL_GLattr)digits[0]))); } } break; case -3: if (8 * sizeof(SDL_GLattr) - 1 > 2 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(SDL_GLattr, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(SDL_GLattr) - 1 > 3 * PyLong_SHIFT) { return (SDL_GLattr) (((SDL_GLattr)-1)*(((((((SDL_GLattr)digits[2]) << PyLong_SHIFT) | (SDL_GLattr)digits[1]) << PyLong_SHIFT) | (SDL_GLattr)digits[0]))); } } break; case 3: if (8 * sizeof(SDL_GLattr) > 2 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(SDL_GLattr, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(SDL_GLattr) - 1 > 3 * PyLong_SHIFT) { return (SDL_GLattr) ((((((((SDL_GLattr)digits[2]) << PyLong_SHIFT) | (SDL_GLattr)digits[1]) << PyLong_SHIFT) | (SDL_GLattr)digits[0]))); } } break; case -4: if (8 * sizeof(SDL_GLattr) - 1 > 3 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(SDL_GLattr, long, -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(SDL_GLattr) - 1 > 4 * PyLong_SHIFT) { return (SDL_GLattr) (((SDL_GLattr)-1)*(((((((((SDL_GLattr)digits[3]) << PyLong_SHIFT) | (SDL_GLattr)digits[2]) << PyLong_SHIFT) | (SDL_GLattr)digits[1]) << PyLong_SHIFT) | (SDL_GLattr)digits[0]))); } } break; case 4: if (8 * sizeof(SDL_GLattr) > 3 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(SDL_GLattr, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(SDL_GLattr) - 1 > 4 * PyLong_SHIFT) { return (SDL_GLattr) ((((((((((SDL_GLattr)digits[3]) << PyLong_SHIFT) | (SDL_GLattr)digits[2]) << PyLong_SHIFT) | (SDL_GLattr)digits[1]) << PyLong_SHIFT) | (SDL_GLattr)digits[0]))); } } break; } #endif if (sizeof(SDL_GLattr) <= sizeof(long)) { __PYX_VERIFY_RETURN_INT_EXC(SDL_GLattr, long, PyLong_AsLong(x)) #ifdef HAVE_LONG_LONG } else if (sizeof(SDL_GLattr) <= sizeof(PY_LONG_LONG)) { __PYX_VERIFY_RETURN_INT_EXC(SDL_GLattr, PY_LONG_LONG, PyLong_AsLongLong(x)) #endif } } { #if CYTHON_COMPILING_IN_PYPY && !defined(_PyLong_AsByteArray) PyErr_SetString(PyExc_RuntimeError, "_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers"); #else SDL_GLattr val; PyObject *v = __Pyx_PyNumber_IntOrLong(x); #if PY_MAJOR_VERSION < 3 if (likely(v) && !PyLong_Check(v)) { PyObject *tmp = v; v = PyNumber_Long(tmp); Py_DECREF(tmp); } #endif if (likely(v)) { int one = 1; int is_little = (int)*(unsigned char *)&one; unsigned char *bytes = (unsigned char *)&val; int ret = _PyLong_AsByteArray((PyLongObject *)v, bytes, sizeof(val), is_little, !is_unsigned); Py_DECREF(v); if (likely(!ret)) return val; } #endif return (SDL_GLattr) -1; } } else { SDL_GLattr val; PyObject *tmp = __Pyx_PyNumber_IntOrLong(x); if (!tmp) return (SDL_GLattr) -1; val = __Pyx_PyInt_As_SDL_GLattr(tmp); Py_DECREF(tmp); return val; } raise_overflow: PyErr_SetString(PyExc_OverflowError, "value too large to convert to SDL_GLattr"); return (SDL_GLattr) -1; raise_neg_overflow: PyErr_SetString(PyExc_OverflowError, "can't convert negative value to SDL_GLattr"); return (SDL_GLattr) -1; } /* CheckBinaryVersion */ static int __Pyx_check_binary_version(void) { char ctversion[4], rtversion[4]; PyOS_snprintf(ctversion, 4, "%d.%d", PY_MAJOR_VERSION, PY_MINOR_VERSION); PyOS_snprintf(rtversion, 4, "%s", Py_GetVersion()); if (ctversion[0] != rtversion[0] || ctversion[2] != rtversion[2]) { char message[200]; PyOS_snprintf(message, sizeof(message), "compiletime version %s of module '%.100s' " "does not match runtime version %s", ctversion, __Pyx_MODULE_NAME, rtversion); return PyErr_WarnEx(NULL, message, 1); } return 0; } /* VoidPtrExport */ static int __Pyx_ExportVoidPtr(PyObject *name, void *p, const char *sig) { PyObject *d; PyObject *cobj = 0; d = PyDict_GetItem(__pyx_d, __pyx_n_s_pyx_capi); Py_XINCREF(d); if (!d) { d = PyDict_New(); if (!d) goto bad; if (__Pyx_PyObject_SetAttrStr(__pyx_m, __pyx_n_s_pyx_capi, d) < 0) goto bad; } #if PY_VERSION_HEX >= 0x02070000 cobj = PyCapsule_New(p, sig, 0); #else cobj = PyCObject_FromVoidPtrAndDesc(p, (void *)sig, 0); #endif if (!cobj) goto bad; if (PyDict_SetItem(d, name, cobj) < 0) goto bad; Py_DECREF(cobj); Py_DECREF(d); return 0; bad: Py_XDECREF(cobj); Py_XDECREF(d); return -1; } /* FunctionExport */ static int __Pyx_ExportFunction(const char *name, void (*f)(void), const char *sig) { PyObject *d = 0; PyObject *cobj = 0; union { void (*fp)(void); void *p; } tmp; d = PyObject_GetAttrString(__pyx_m, (char *)"__pyx_capi__"); if (!d) { PyErr_Clear(); d = PyDict_New(); if (!d) goto bad; Py_INCREF(d); if (PyModule_AddObject(__pyx_m, (char *)"__pyx_capi__", d) < 0) goto bad; } tmp.fp = f; #if PY_VERSION_HEX >= 0x02070000 cobj = PyCapsule_New(tmp.p, sig, 0); #else cobj = PyCObject_FromVoidPtrAndDesc(tmp.p, (void *)sig, 0); #endif if (!cobj) goto bad; if (PyDict_SetItemString(d, name, cobj) < 0) goto bad; Py_DECREF(cobj); Py_DECREF(d); return 0; bad: Py_XDECREF(cobj); Py_XDECREF(d); return -1; } /* ModuleImport */ #ifndef __PYX_HAVE_RT_ImportModule #define __PYX_HAVE_RT_ImportModule static PyObject *__Pyx_ImportModule(const char *name) { PyObject *py_name = 0; PyObject *py_module = 0; py_name = __Pyx_PyIdentifier_FromString(name); if (!py_name) goto bad; py_module = PyImport_Import(py_name); Py_DECREF(py_name); return py_module; bad: Py_XDECREF(py_name); return 0; } #endif /* TypeImport */ #ifndef __PYX_HAVE_RT_ImportType #define __PYX_HAVE_RT_ImportType static PyTypeObject *__Pyx_ImportType(const char *module_name, const char *class_name, size_t size, int strict) { PyObject *py_module = 0; PyObject *result = 0; PyObject *py_name = 0; char warning[200]; Py_ssize_t basicsize; #ifdef Py_LIMITED_API PyObject *py_basicsize; #endif py_module = __Pyx_ImportModule(module_name); if (!py_module) goto bad; py_name = __Pyx_PyIdentifier_FromString(class_name); if (!py_name) goto bad; result = PyObject_GetAttr(py_module, py_name); Py_DECREF(py_name); py_name = 0; Py_DECREF(py_module); py_module = 0; if (!result) goto bad; if (!PyType_Check(result)) { PyErr_Format(PyExc_TypeError, "%.200s.%.200s is not a type object", module_name, class_name); goto bad; } #ifndef Py_LIMITED_API basicsize = ((PyTypeObject *)result)->tp_basicsize; #else py_basicsize = PyObject_GetAttrString(result, "__basicsize__"); if (!py_basicsize) goto bad; basicsize = PyLong_AsSsize_t(py_basicsize); Py_DECREF(py_basicsize); py_basicsize = 0; if (basicsize == (Py_ssize_t)-1 && PyErr_Occurred()) goto bad; #endif if (!strict && (size_t)basicsize > size) { PyOS_snprintf(warning, sizeof(warning), "%s.%s size changed, may indicate binary incompatibility. Expected %zd, got %zd", module_name, class_name, basicsize, size); if (PyErr_WarnEx(NULL, warning, 0) < 0) goto bad; } else if ((size_t)basicsize != size) { PyErr_Format(PyExc_ValueError, "%.200s.%.200s has the wrong size, try recompiling. Expected %zd, got %zd", module_name, class_name, basicsize, size); goto bad; } return (PyTypeObject *)result; bad: Py_XDECREF(py_module); Py_XDECREF(result); return NULL; } #endif /* FunctionImport */ #ifndef __PYX_HAVE_RT_ImportFunction #define __PYX_HAVE_RT_ImportFunction static int __Pyx_ImportFunction(PyObject *module, const char *funcname, void (**f)(void), const char *sig) { PyObject *d = 0; PyObject *cobj = 0; union { void (*fp)(void); void *p; } tmp; d = PyObject_GetAttrString(module, (char *)"__pyx_capi__"); if (!d) goto bad; cobj = PyDict_GetItemString(d, funcname); if (!cobj) { PyErr_Format(PyExc_ImportError, "%.200s does not export expected C function %.200s", PyModule_GetName(module), funcname); goto bad; } #if PY_VERSION_HEX >= 0x02070000 if (!PyCapsule_IsValid(cobj, sig)) { PyErr_Format(PyExc_TypeError, "C function %.200s.%.200s has wrong signature (expected %.500s, got %.500s)", PyModule_GetName(module), funcname, sig, PyCapsule_GetName(cobj)); goto bad; } tmp.p = PyCapsule_GetPointer(cobj, sig); #else {const char *desc, *s1, *s2; desc = (const char *)PyCObject_GetDesc(cobj); if (!desc) goto bad; s1 = desc; s2 = sig; while (*s1 != '\0' && *s1 == *s2) { s1++; s2++; } if (*s1 != *s2) { PyErr_Format(PyExc_TypeError, "C function %.200s.%.200s has wrong signature (expected %.500s, got %.500s)", PyModule_GetName(module), funcname, sig, desc); goto bad; } tmp.p = PyCObject_AsVoidPtr(cobj);} #endif *f = tmp.fp; if (!(*f)) goto bad; Py_DECREF(d); return 0; bad: Py_XDECREF(d); return -1; } #endif /* InitStrings */ static int __Pyx_InitStrings(__Pyx_StringTabEntry *t) { while (t->p) { #if PY_MAJOR_VERSION < 3 if (t->is_unicode) { *t->p = PyUnicode_DecodeUTF8(t->s, t->n - 1, NULL); } else if (t->intern) { *t->p = PyString_InternFromString(t->s); } else { *t->p = PyString_FromStringAndSize(t->s, t->n - 1); } #else if (t->is_unicode | t->is_str) { if (t->intern) { *t->p = PyUnicode_InternFromString(t->s); } else if (t->encoding) { *t->p = PyUnicode_Decode(t->s, t->n - 1, t->encoding, NULL); } else { *t->p = PyUnicode_FromStringAndSize(t->s, t->n - 1); } } else { *t->p = PyBytes_FromStringAndSize(t->s, t->n - 1); } #endif if (!*t->p) return -1; ++t; } return 0; } static CYTHON_INLINE PyObject* __Pyx_PyUnicode_FromString(const char* c_str) { return __Pyx_PyUnicode_FromStringAndSize(c_str, (Py_ssize_t)strlen(c_str)); } static CYTHON_INLINE char* __Pyx_PyObject_AsString(PyObject* o) { Py_ssize_t ignore; return __Pyx_PyObject_AsStringAndSize(o, &ignore); } static CYTHON_INLINE char* __Pyx_PyObject_AsStringAndSize(PyObject* o, Py_ssize_t *length) { #if CYTHON_COMPILING_IN_CPYTHON && (__PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT) if ( #if PY_MAJOR_VERSION < 3 && __PYX_DEFAULT_STRING_ENCODING_IS_ASCII __Pyx_sys_getdefaultencoding_not_ascii && #endif PyUnicode_Check(o)) { #if PY_VERSION_HEX < 0x03030000 char* defenc_c; PyObject* defenc = _PyUnicode_AsDefaultEncodedString(o, NULL); if (!defenc) return NULL; defenc_c = PyBytes_AS_STRING(defenc); #if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII { char* end = defenc_c + PyBytes_GET_SIZE(defenc); char* c; for (c = defenc_c; c < end; c++) { if ((unsigned char) (*c) >= 128) { PyUnicode_AsASCIIString(o); return NULL; } } } #endif *length = PyBytes_GET_SIZE(defenc); return defenc_c; #else if (__Pyx_PyUnicode_READY(o) == -1) return NULL; #if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII if (PyUnicode_IS_ASCII(o)) { *length = PyUnicode_GET_LENGTH(o); return PyUnicode_AsUTF8(o); } else { PyUnicode_AsASCIIString(o); return NULL; } #else return PyUnicode_AsUTF8AndSize(o, length); #endif #endif } else #endif #if (!CYTHON_COMPILING_IN_PYPY) || (defined(PyByteArray_AS_STRING) && defined(PyByteArray_GET_SIZE)) if (PyByteArray_Check(o)) { *length = PyByteArray_GET_SIZE(o); return PyByteArray_AS_STRING(o); } else #endif { char* result; int r = PyBytes_AsStringAndSize(o, &result, length); if (unlikely(r < 0)) { return NULL; } else { return result; } } } static CYTHON_INLINE int __Pyx_PyObject_IsTrue(PyObject* x) { int is_true = x == Py_True; if (is_true | (x == Py_False) | (x == Py_None)) return is_true; else return PyObject_IsTrue(x); } static CYTHON_INLINE PyObject* __Pyx_PyNumber_IntOrLong(PyObject* x) { #if CYTHON_USE_TYPE_SLOTS PyNumberMethods *m; #endif const char *name = NULL; PyObject *res = NULL; #if PY_MAJOR_VERSION < 3 if (PyInt_Check(x) || PyLong_Check(x)) #else if (PyLong_Check(x)) #endif return __Pyx_NewRef(x); #if CYTHON_USE_TYPE_SLOTS m = Py_TYPE(x)->tp_as_number; #if PY_MAJOR_VERSION < 3 if (m && m->nb_int) { name = "int"; res = PyNumber_Int(x); } else if (m && m->nb_long) { name = "long"; res = PyNumber_Long(x); } #else if (m && m->nb_int) { name = "int"; res = PyNumber_Long(x); } #endif #else res = PyNumber_Int(x); #endif if (res) { #if PY_MAJOR_VERSION < 3 if (!PyInt_Check(res) && !PyLong_Check(res)) { #else if (!PyLong_Check(res)) { #endif PyErr_Format(PyExc_TypeError, "__%.4s__ returned non-%.4s (type %.200s)", name, name, Py_TYPE(res)->tp_name); Py_DECREF(res); return NULL; } } else if (!PyErr_Occurred()) { PyErr_SetString(PyExc_TypeError, "an integer is required"); } return res; } static CYTHON_INLINE Py_ssize_t __Pyx_PyIndex_AsSsize_t(PyObject* b) { Py_ssize_t ival; PyObject *x; #if PY_MAJOR_VERSION < 3 if (likely(PyInt_CheckExact(b))) { if (sizeof(Py_ssize_t) >= sizeof(long)) return PyInt_AS_LONG(b); else return PyInt_AsSsize_t(x); } #endif if (likely(PyLong_CheckExact(b))) { #if CYTHON_USE_PYLONG_INTERNALS const digit* digits = ((PyLongObject*)b)->ob_digit; const Py_ssize_t size = Py_SIZE(b); if (likely(__Pyx_sst_abs(size) <= 1)) { ival = likely(size) ? digits[0] : 0; if (size == -1) ival = -ival; return ival; } else { switch (size) { case 2: if (8 * sizeof(Py_ssize_t) > 2 * PyLong_SHIFT) { return (Py_ssize_t) (((((size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])); } break; case -2: if (8 * sizeof(Py_ssize_t) > 2 * PyLong_SHIFT) { return -(Py_ssize_t) (((((size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])); } break; case 3: if (8 * sizeof(Py_ssize_t) > 3 * PyLong_SHIFT) { return (Py_ssize_t) (((((((size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])); } break; case -3: if (8 * sizeof(Py_ssize_t) > 3 * PyLong_SHIFT) { return -(Py_ssize_t) (((((((size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])); } break; case 4: if (8 * sizeof(Py_ssize_t) > 4 * PyLong_SHIFT) { return (Py_ssize_t) (((((((((size_t)digits[3]) << PyLong_SHIFT) | (size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])); } break; case -4: if (8 * sizeof(Py_ssize_t) > 4 * PyLong_SHIFT) { return -(Py_ssize_t) (((((((((size_t)digits[3]) << PyLong_SHIFT) | (size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])); } break; } } #endif return PyLong_AsSsize_t(b); } x = PyNumber_Index(b); if (!x) return -1; ival = PyInt_AsSsize_t(x); Py_DECREF(x); return ival; } static CYTHON_INLINE PyObject * __Pyx_PyInt_FromSize_t(size_t ival) { return PyInt_FromSize_t(ival); } #endif /* Py_PYTHON_H */ pygame_sdl2-2.1.0-for-renpy-6.99.14.1/gen3/pygame_sdl2.mixer_music.c0000664000175000017500000051257612665223546024032 0ustar tomtom00000000000000/* Generated by Cython 0.23.3 */ #define PY_SSIZE_T_CLEAN #include "Python.h" #ifndef Py_PYTHON_H #error Python headers needed to compile C extensions, please install development version of Python. #elif PY_VERSION_HEX < 0x02060000 || (0x03000000 <= PY_VERSION_HEX && PY_VERSION_HEX < 0x03020000) #error Cython requires Python 2.6+ or Python 3.2+. #else #define CYTHON_ABI "0_23_3" #include #ifndef offsetof #define offsetof(type, member) ( (size_t) & ((type*)0) -> member ) #endif #if !defined(WIN32) && !defined(MS_WINDOWS) #ifndef __stdcall #define __stdcall #endif #ifndef __cdecl #define __cdecl #endif #ifndef __fastcall #define __fastcall #endif #endif #ifndef DL_IMPORT #define DL_IMPORT(t) t #endif #ifndef DL_EXPORT #define DL_EXPORT(t) t #endif #ifndef PY_LONG_LONG #define PY_LONG_LONG LONG_LONG #endif #ifndef Py_HUGE_VAL #define Py_HUGE_VAL HUGE_VAL #endif #ifdef PYPY_VERSION #define CYTHON_COMPILING_IN_PYPY 1 #define CYTHON_COMPILING_IN_CPYTHON 0 #else #define CYTHON_COMPILING_IN_PYPY 0 #define CYTHON_COMPILING_IN_CPYTHON 1 #endif #if !defined(CYTHON_USE_PYLONG_INTERNALS) && CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x02070000 #define CYTHON_USE_PYLONG_INTERNALS 1 #endif #if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX < 0x02070600 && !defined(Py_OptimizeFlag) #define Py_OptimizeFlag 0 #endif #define __PYX_BUILD_PY_SSIZE_T "n" #define CYTHON_FORMAT_SSIZE_T "z" #if PY_MAJOR_VERSION < 3 #define __Pyx_BUILTIN_MODULE_NAME "__builtin__" #define __Pyx_PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)\ PyCode_New(a+k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos) #define __Pyx_DefaultClassType PyClass_Type #else #define __Pyx_BUILTIN_MODULE_NAME "builtins" #define __Pyx_PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)\ PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos) #define __Pyx_DefaultClassType PyType_Type #endif #ifndef Py_TPFLAGS_CHECKTYPES #define Py_TPFLAGS_CHECKTYPES 0 #endif #ifndef Py_TPFLAGS_HAVE_INDEX #define Py_TPFLAGS_HAVE_INDEX 0 #endif #ifndef Py_TPFLAGS_HAVE_NEWBUFFER #define Py_TPFLAGS_HAVE_NEWBUFFER 0 #endif #ifndef Py_TPFLAGS_HAVE_FINALIZE #define Py_TPFLAGS_HAVE_FINALIZE 0 #endif #if PY_VERSION_HEX > 0x03030000 && defined(PyUnicode_KIND) #define CYTHON_PEP393_ENABLED 1 #define __Pyx_PyUnicode_READY(op) (likely(PyUnicode_IS_READY(op)) ?\ 0 : _PyUnicode_Ready((PyObject *)(op))) #define __Pyx_PyUnicode_GET_LENGTH(u) PyUnicode_GET_LENGTH(u) #define __Pyx_PyUnicode_READ_CHAR(u, i) PyUnicode_READ_CHAR(u, i) #define __Pyx_PyUnicode_KIND(u) PyUnicode_KIND(u) #define __Pyx_PyUnicode_DATA(u) PyUnicode_DATA(u) #define __Pyx_PyUnicode_READ(k, d, i) PyUnicode_READ(k, d, i) #else #define CYTHON_PEP393_ENABLED 0 #define __Pyx_PyUnicode_READY(op) (0) #define __Pyx_PyUnicode_GET_LENGTH(u) PyUnicode_GET_SIZE(u) #define __Pyx_PyUnicode_READ_CHAR(u, i) ((Py_UCS4)(PyUnicode_AS_UNICODE(u)[i])) #define __Pyx_PyUnicode_KIND(u) (sizeof(Py_UNICODE)) #define __Pyx_PyUnicode_DATA(u) ((void*)PyUnicode_AS_UNICODE(u)) #define __Pyx_PyUnicode_READ(k, d, i) ((void)(k), (Py_UCS4)(((Py_UNICODE*)d)[i])) #endif #if CYTHON_COMPILING_IN_PYPY #define __Pyx_PyUnicode_Concat(a, b) PyNumber_Add(a, b) #define __Pyx_PyUnicode_ConcatSafe(a, b) PyNumber_Add(a, b) #else #define __Pyx_PyUnicode_Concat(a, b) PyUnicode_Concat(a, b) #define __Pyx_PyUnicode_ConcatSafe(a, b) ((unlikely((a) == Py_None) || unlikely((b) == Py_None)) ?\ PyNumber_Add(a, b) : __Pyx_PyUnicode_Concat(a, b)) #endif #if CYTHON_COMPILING_IN_PYPY && !defined(PyUnicode_Contains) #define PyUnicode_Contains(u, s) PySequence_Contains(u, s) #endif #define __Pyx_PyString_FormatSafe(a, b) ((unlikely((a) == Py_None)) ? PyNumber_Remainder(a, b) : __Pyx_PyString_Format(a, b)) #define __Pyx_PyUnicode_FormatSafe(a, b) ((unlikely((a) == Py_None)) ? PyNumber_Remainder(a, b) : PyUnicode_Format(a, b)) #if PY_MAJOR_VERSION >= 3 #define __Pyx_PyString_Format(a, b) PyUnicode_Format(a, b) #else #define __Pyx_PyString_Format(a, b) PyString_Format(a, b) #endif #if PY_MAJOR_VERSION >= 3 #define PyBaseString_Type PyUnicode_Type #define PyStringObject PyUnicodeObject #define PyString_Type PyUnicode_Type #define PyString_Check PyUnicode_Check #define PyString_CheckExact PyUnicode_CheckExact #endif #if PY_MAJOR_VERSION >= 3 #define __Pyx_PyBaseString_Check(obj) PyUnicode_Check(obj) #define __Pyx_PyBaseString_CheckExact(obj) PyUnicode_CheckExact(obj) #else #define __Pyx_PyBaseString_Check(obj) (PyString_Check(obj) || PyUnicode_Check(obj)) #define __Pyx_PyBaseString_CheckExact(obj) (PyString_CheckExact(obj) || PyUnicode_CheckExact(obj)) #endif #ifndef PySet_CheckExact #define PySet_CheckExact(obj) (Py_TYPE(obj) == &PySet_Type) #endif #define __Pyx_TypeCheck(obj, type) PyObject_TypeCheck(obj, (PyTypeObject *)type) #if PY_MAJOR_VERSION >= 3 #define PyIntObject PyLongObject #define PyInt_Type PyLong_Type #define PyInt_Check(op) PyLong_Check(op) #define PyInt_CheckExact(op) PyLong_CheckExact(op) #define PyInt_FromString PyLong_FromString #define PyInt_FromUnicode PyLong_FromUnicode #define PyInt_FromLong PyLong_FromLong #define PyInt_FromSize_t PyLong_FromSize_t #define PyInt_FromSsize_t PyLong_FromSsize_t #define PyInt_AsLong PyLong_AsLong #define PyInt_AS_LONG PyLong_AS_LONG #define PyInt_AsSsize_t PyLong_AsSsize_t #define PyInt_AsUnsignedLongMask PyLong_AsUnsignedLongMask #define PyInt_AsUnsignedLongLongMask PyLong_AsUnsignedLongLongMask #define PyNumber_Int PyNumber_Long #endif #if PY_MAJOR_VERSION >= 3 #define PyBoolObject PyLongObject #endif #if PY_MAJOR_VERSION >= 3 && CYTHON_COMPILING_IN_PYPY #ifndef PyUnicode_InternFromString #define PyUnicode_InternFromString(s) PyUnicode_FromString(s) #endif #endif #if PY_VERSION_HEX < 0x030200A4 typedef long Py_hash_t; #define __Pyx_PyInt_FromHash_t PyInt_FromLong #define __Pyx_PyInt_AsHash_t PyInt_AsLong #else #define __Pyx_PyInt_FromHash_t PyInt_FromSsize_t #define __Pyx_PyInt_AsHash_t PyInt_AsSsize_t #endif #if PY_MAJOR_VERSION >= 3 #define __Pyx_PyMethod_New(func, self, klass) ((self) ? PyMethod_New(func, self) : PyInstanceMethod_New(func)) #else #define __Pyx_PyMethod_New(func, self, klass) PyMethod_New(func, self, klass) #endif #if PY_VERSION_HEX >= 0x030500B1 #define __Pyx_PyAsyncMethodsStruct PyAsyncMethods #define __Pyx_PyType_AsAsync(obj) (Py_TYPE(obj)->tp_as_async) #elif CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3 typedef struct { unaryfunc am_await; unaryfunc am_aiter; unaryfunc am_anext; } __Pyx_PyAsyncMethodsStruct; #define __Pyx_PyType_AsAsync(obj) ((__Pyx_PyAsyncMethodsStruct*) (Py_TYPE(obj)->tp_reserved)) #else #define __Pyx_PyType_AsAsync(obj) NULL #endif #ifndef CYTHON_RESTRICT #if defined(__GNUC__) #define CYTHON_RESTRICT __restrict__ #elif defined(_MSC_VER) && _MSC_VER >= 1400 #define CYTHON_RESTRICT __restrict #elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L #define CYTHON_RESTRICT restrict #else #define CYTHON_RESTRICT #endif #endif #define __Pyx_void_to_None(void_result) (void_result, Py_INCREF(Py_None), Py_None) #ifndef CYTHON_INLINE #if defined(__GNUC__) #define CYTHON_INLINE __inline__ #elif defined(_MSC_VER) #define CYTHON_INLINE __inline #elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L #define CYTHON_INLINE inline #else #define CYTHON_INLINE #endif #endif #if defined(WIN32) || defined(MS_WINDOWS) #define _USE_MATH_DEFINES #endif #include #ifdef NAN #define __PYX_NAN() ((float) NAN) #else static CYTHON_INLINE float __PYX_NAN() { float value; memset(&value, 0xFF, sizeof(value)); return value; } #endif #if PY_MAJOR_VERSION >= 3 #define __Pyx_PyNumber_Divide(x,y) PyNumber_TrueDivide(x,y) #define __Pyx_PyNumber_InPlaceDivide(x,y) PyNumber_InPlaceTrueDivide(x,y) #else #define __Pyx_PyNumber_Divide(x,y) PyNumber_TrueDivide(x,y) #define __Pyx_PyNumber_InPlaceDivide(x,y) PyNumber_InPlaceTrueDivide(x,y) #endif #ifndef __PYX_EXTERN_C #ifdef __cplusplus #define __PYX_EXTERN_C extern "C" #else #define __PYX_EXTERN_C extern #endif #endif #define __PYX_HAVE__pygame_sdl2__mixer_music #define __PYX_HAVE_API__pygame_sdl2__mixer_music #include "stdint.h" #include "string.h" #include "stdio.h" #include "stddef.h" #include "SDL.h" #include "SDL_mixer.h" #ifdef _OPENMP #include #endif /* _OPENMP */ #ifdef PYREX_WITHOUT_ASSERTIONS #define CYTHON_WITHOUT_ASSERTIONS #endif #ifndef CYTHON_UNUSED # if defined(__GNUC__) # if !(defined(__cplusplus)) || (__GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 4)) # define CYTHON_UNUSED __attribute__ ((__unused__)) # else # define CYTHON_UNUSED # endif # elif defined(__ICC) || (defined(__INTEL_COMPILER) && !defined(_MSC_VER)) # define CYTHON_UNUSED __attribute__ ((__unused__)) # else # define CYTHON_UNUSED # endif #endif #ifndef CYTHON_NCP_UNUSED # if CYTHON_COMPILING_IN_CPYTHON # define CYTHON_NCP_UNUSED # else # define CYTHON_NCP_UNUSED CYTHON_UNUSED # endif #endif typedef struct {PyObject **p; char *s; const Py_ssize_t n; const char* encoding; const char is_unicode; const char is_str; const char intern; } __Pyx_StringTabEntry; #define __PYX_DEFAULT_STRING_ENCODING_IS_ASCII 0 #define __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT 0 #define __PYX_DEFAULT_STRING_ENCODING "" #define __Pyx_PyObject_FromString __Pyx_PyBytes_FromString #define __Pyx_PyObject_FromStringAndSize __Pyx_PyBytes_FromStringAndSize #define __Pyx_uchar_cast(c) ((unsigned char)c) #define __Pyx_long_cast(x) ((long)x) #define __Pyx_fits_Py_ssize_t(v, type, is_signed) (\ (sizeof(type) < sizeof(Py_ssize_t)) ||\ (sizeof(type) > sizeof(Py_ssize_t) &&\ likely(v < (type)PY_SSIZE_T_MAX ||\ v == (type)PY_SSIZE_T_MAX) &&\ (!is_signed || likely(v > (type)PY_SSIZE_T_MIN ||\ v == (type)PY_SSIZE_T_MIN))) ||\ (sizeof(type) == sizeof(Py_ssize_t) &&\ (is_signed || likely(v < (type)PY_SSIZE_T_MAX ||\ v == (type)PY_SSIZE_T_MAX))) ) #if defined (__cplusplus) && __cplusplus >= 201103L #include #define __Pyx_sst_abs(value) std::abs(value) #elif SIZEOF_INT >= SIZEOF_SIZE_T #define __Pyx_sst_abs(value) abs(value) #elif SIZEOF_LONG >= SIZEOF_SIZE_T #define __Pyx_sst_abs(value) labs(value) #elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L #define __Pyx_sst_abs(value) llabs(value) #elif defined (_MSC_VER) && defined (_M_X64) #define __Pyx_sst_abs(value) _abs64(value) #elif defined (__GNUC__) #define __Pyx_sst_abs(value) __builtin_llabs(value) #else #define __Pyx_sst_abs(value) ((value<0) ? -value : value) #endif static CYTHON_INLINE char* __Pyx_PyObject_AsString(PyObject*); static CYTHON_INLINE char* __Pyx_PyObject_AsStringAndSize(PyObject*, Py_ssize_t* length); #define __Pyx_PyByteArray_FromString(s) PyByteArray_FromStringAndSize((const char*)s, strlen((const char*)s)) #define __Pyx_PyByteArray_FromStringAndSize(s, l) PyByteArray_FromStringAndSize((const char*)s, l) #define __Pyx_PyBytes_FromString PyBytes_FromString #define __Pyx_PyBytes_FromStringAndSize PyBytes_FromStringAndSize static CYTHON_INLINE PyObject* __Pyx_PyUnicode_FromString(const char*); #if PY_MAJOR_VERSION < 3 #define __Pyx_PyStr_FromString __Pyx_PyBytes_FromString #define __Pyx_PyStr_FromStringAndSize __Pyx_PyBytes_FromStringAndSize #else #define __Pyx_PyStr_FromString __Pyx_PyUnicode_FromString #define __Pyx_PyStr_FromStringAndSize __Pyx_PyUnicode_FromStringAndSize #endif #define __Pyx_PyObject_AsSString(s) ((signed char*) __Pyx_PyObject_AsString(s)) #define __Pyx_PyObject_AsUString(s) ((unsigned char*) __Pyx_PyObject_AsString(s)) #define __Pyx_PyObject_FromCString(s) __Pyx_PyObject_FromString((const char*)s) #define __Pyx_PyBytes_FromCString(s) __Pyx_PyBytes_FromString((const char*)s) #define __Pyx_PyByteArray_FromCString(s) __Pyx_PyByteArray_FromString((const char*)s) #define __Pyx_PyStr_FromCString(s) __Pyx_PyStr_FromString((const char*)s) #define __Pyx_PyUnicode_FromCString(s) __Pyx_PyUnicode_FromString((const char*)s) #if PY_MAJOR_VERSION < 3 static CYTHON_INLINE size_t __Pyx_Py_UNICODE_strlen(const Py_UNICODE *u) { const Py_UNICODE *u_end = u; while (*u_end++) ; return (size_t)(u_end - u - 1); } #else #define __Pyx_Py_UNICODE_strlen Py_UNICODE_strlen #endif #define __Pyx_PyUnicode_FromUnicode(u) PyUnicode_FromUnicode(u, __Pyx_Py_UNICODE_strlen(u)) #define __Pyx_PyUnicode_FromUnicodeAndLength PyUnicode_FromUnicode #define __Pyx_PyUnicode_AsUnicode PyUnicode_AsUnicode #define __Pyx_NewRef(obj) (Py_INCREF(obj), obj) #define __Pyx_Owned_Py_None(b) __Pyx_NewRef(Py_None) #define __Pyx_PyBool_FromLong(b) ((b) ? __Pyx_NewRef(Py_True) : __Pyx_NewRef(Py_False)) static CYTHON_INLINE int __Pyx_PyObject_IsTrue(PyObject*); static CYTHON_INLINE PyObject* __Pyx_PyNumber_Int(PyObject* x); static CYTHON_INLINE Py_ssize_t __Pyx_PyIndex_AsSsize_t(PyObject*); static CYTHON_INLINE PyObject * __Pyx_PyInt_FromSize_t(size_t); #if CYTHON_COMPILING_IN_CPYTHON #define __pyx_PyFloat_AsDouble(x) (PyFloat_CheckExact(x) ? PyFloat_AS_DOUBLE(x) : PyFloat_AsDouble(x)) #else #define __pyx_PyFloat_AsDouble(x) PyFloat_AsDouble(x) #endif #define __pyx_PyFloat_AsFloat(x) ((float) __pyx_PyFloat_AsDouble(x)) #if PY_MAJOR_VERSION < 3 && __PYX_DEFAULT_STRING_ENCODING_IS_ASCII static int __Pyx_sys_getdefaultencoding_not_ascii; static int __Pyx_init_sys_getdefaultencoding_params(void) { PyObject* sys; PyObject* default_encoding = NULL; PyObject* ascii_chars_u = NULL; PyObject* ascii_chars_b = NULL; const char* default_encoding_c; sys = PyImport_ImportModule("sys"); if (!sys) goto bad; default_encoding = PyObject_CallMethod(sys, (char*) "getdefaultencoding", NULL); Py_DECREF(sys); if (!default_encoding) goto bad; default_encoding_c = PyBytes_AsString(default_encoding); if (!default_encoding_c) goto bad; if (strcmp(default_encoding_c, "ascii") == 0) { __Pyx_sys_getdefaultencoding_not_ascii = 0; } else { char ascii_chars[128]; int c; for (c = 0; c < 128; c++) { ascii_chars[c] = c; } __Pyx_sys_getdefaultencoding_not_ascii = 1; ascii_chars_u = PyUnicode_DecodeASCII(ascii_chars, 128, NULL); if (!ascii_chars_u) goto bad; ascii_chars_b = PyUnicode_AsEncodedString(ascii_chars_u, default_encoding_c, NULL); if (!ascii_chars_b || !PyBytes_Check(ascii_chars_b) || memcmp(ascii_chars, PyBytes_AS_STRING(ascii_chars_b), 128) != 0) { PyErr_Format( PyExc_ValueError, "This module compiled with c_string_encoding=ascii, but default encoding '%.200s' is not a superset of ascii.", default_encoding_c); goto bad; } Py_DECREF(ascii_chars_u); Py_DECREF(ascii_chars_b); } Py_DECREF(default_encoding); return 0; bad: Py_XDECREF(default_encoding); Py_XDECREF(ascii_chars_u); Py_XDECREF(ascii_chars_b); return -1; } #endif #if __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT && PY_MAJOR_VERSION >= 3 #define __Pyx_PyUnicode_FromStringAndSize(c_str, size) PyUnicode_DecodeUTF8(c_str, size, NULL) #else #define __Pyx_PyUnicode_FromStringAndSize(c_str, size) PyUnicode_Decode(c_str, size, __PYX_DEFAULT_STRING_ENCODING, NULL) #if __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT static char* __PYX_DEFAULT_STRING_ENCODING; static int __Pyx_init_sys_getdefaultencoding_params(void) { PyObject* sys; PyObject* default_encoding = NULL; char* default_encoding_c; sys = PyImport_ImportModule("sys"); if (!sys) goto bad; default_encoding = PyObject_CallMethod(sys, (char*) (const char*) "getdefaultencoding", NULL); Py_DECREF(sys); if (!default_encoding) goto bad; default_encoding_c = PyBytes_AsString(default_encoding); if (!default_encoding_c) goto bad; __PYX_DEFAULT_STRING_ENCODING = (char*) malloc(strlen(default_encoding_c)); if (!__PYX_DEFAULT_STRING_ENCODING) goto bad; strcpy(__PYX_DEFAULT_STRING_ENCODING, default_encoding_c); Py_DECREF(default_encoding); return 0; bad: Py_XDECREF(default_encoding); return -1; } #endif #endif /* Test for GCC > 2.95 */ #if defined(__GNUC__) && (__GNUC__ > 2 || (__GNUC__ == 2 && (__GNUC_MINOR__ > 95))) #define likely(x) __builtin_expect(!!(x), 1) #define unlikely(x) __builtin_expect(!!(x), 0) #else /* !__GNUC__ or GCC < 2.95 */ #define likely(x) (x) #define unlikely(x) (x) #endif /* __GNUC__ */ static PyObject *__pyx_m; static PyObject *__pyx_d; static PyObject *__pyx_b; static PyObject *__pyx_empty_tuple; static PyObject *__pyx_empty_bytes; static int __pyx_lineno; static int __pyx_clineno = 0; static const char * __pyx_cfilenm= __FILE__; static const char *__pyx_filename; static const char *__pyx_f[] = { "src/pygame_sdl2/mixer_music.pyx", }; /*--- Type declarations ---*/ struct __pyx_opt_args_11pygame_sdl2_8rwobject_to_rwops; /* "pygame_sdl2/rwobject.pxd":21 * from sdl2 cimport SDL_RWops * * cdef SDL_RWops *to_rwops(filelike, mode=*) except NULL # <<<<<<<<<<<<<< * */ struct __pyx_opt_args_11pygame_sdl2_8rwobject_to_rwops { int __pyx_n; PyObject *mode; }; /* --- Runtime support code (head) --- */ #ifndef CYTHON_REFNANNY #define CYTHON_REFNANNY 0 #endif #if CYTHON_REFNANNY typedef struct { void (*INCREF)(void*, PyObject*, int); void (*DECREF)(void*, PyObject*, int); void (*GOTREF)(void*, PyObject*, int); void (*GIVEREF)(void*, PyObject*, int); void* (*SetupContext)(const char*, int, const char*); void (*FinishContext)(void**); } __Pyx_RefNannyAPIStruct; static __Pyx_RefNannyAPIStruct *__Pyx_RefNanny = NULL; static __Pyx_RefNannyAPIStruct *__Pyx_RefNannyImportAPI(const char *modname); #define __Pyx_RefNannyDeclarations void *__pyx_refnanny = NULL; #ifdef WITH_THREAD #define __Pyx_RefNannySetupContext(name, acquire_gil)\ if (acquire_gil) {\ PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure();\ __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), __LINE__, __FILE__);\ PyGILState_Release(__pyx_gilstate_save);\ } else {\ __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), __LINE__, __FILE__);\ } #else #define __Pyx_RefNannySetupContext(name, acquire_gil)\ __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), __LINE__, __FILE__) #endif #define __Pyx_RefNannyFinishContext()\ __Pyx_RefNanny->FinishContext(&__pyx_refnanny) #define __Pyx_INCREF(r) __Pyx_RefNanny->INCREF(__pyx_refnanny, (PyObject *)(r), __LINE__) #define __Pyx_DECREF(r) __Pyx_RefNanny->DECREF(__pyx_refnanny, (PyObject *)(r), __LINE__) #define __Pyx_GOTREF(r) __Pyx_RefNanny->GOTREF(__pyx_refnanny, (PyObject *)(r), __LINE__) #define __Pyx_GIVEREF(r) __Pyx_RefNanny->GIVEREF(__pyx_refnanny, (PyObject *)(r), __LINE__) #define __Pyx_XINCREF(r) do { if((r) != NULL) {__Pyx_INCREF(r); }} while(0) #define __Pyx_XDECREF(r) do { if((r) != NULL) {__Pyx_DECREF(r); }} while(0) #define __Pyx_XGOTREF(r) do { if((r) != NULL) {__Pyx_GOTREF(r); }} while(0) #define __Pyx_XGIVEREF(r) do { if((r) != NULL) {__Pyx_GIVEREF(r);}} while(0) #else #define __Pyx_RefNannyDeclarations #define __Pyx_RefNannySetupContext(name, acquire_gil) #define __Pyx_RefNannyFinishContext() #define __Pyx_INCREF(r) Py_INCREF(r) #define __Pyx_DECREF(r) Py_DECREF(r) #define __Pyx_GOTREF(r) #define __Pyx_GIVEREF(r) #define __Pyx_XINCREF(r) Py_XINCREF(r) #define __Pyx_XDECREF(r) Py_XDECREF(r) #define __Pyx_XGOTREF(r) #define __Pyx_XGIVEREF(r) #endif #define __Pyx_XDECREF_SET(r, v) do {\ PyObject *tmp = (PyObject *) r;\ r = v; __Pyx_XDECREF(tmp);\ } while (0) #define __Pyx_DECREF_SET(r, v) do {\ PyObject *tmp = (PyObject *) r;\ r = v; __Pyx_DECREF(tmp);\ } while (0) #define __Pyx_CLEAR(r) do { PyObject* tmp = ((PyObject*)(r)); r = NULL; __Pyx_DECREF(tmp);} while(0) #define __Pyx_XCLEAR(r) do { if((r) != NULL) {PyObject* tmp = ((PyObject*)(r)); r = NULL; __Pyx_DECREF(tmp);}} while(0) #if CYTHON_COMPILING_IN_CPYTHON static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStr(PyObject* obj, PyObject* attr_name) { PyTypeObject* tp = Py_TYPE(obj); if (likely(tp->tp_getattro)) return tp->tp_getattro(obj, attr_name); #if PY_MAJOR_VERSION < 3 if (likely(tp->tp_getattr)) return tp->tp_getattr(obj, PyString_AS_STRING(attr_name)); #endif return PyObject_GetAttr(obj, attr_name); } #else #define __Pyx_PyObject_GetAttrStr(o,n) PyObject_GetAttr(o,n) #endif static PyObject *__Pyx_GetBuiltinName(PyObject *name); static CYTHON_INLINE PyObject *__Pyx_GetModuleGlobalName(PyObject *name); #if CYTHON_COMPILING_IN_CPYTHON static CYTHON_INLINE PyObject* __Pyx_PyObject_Call(PyObject *func, PyObject *arg, PyObject *kw); #else #define __Pyx_PyObject_Call(func, arg, kw) PyObject_Call(func, arg, kw) #endif #if CYTHON_COMPILING_IN_CPYTHON static CYTHON_INLINE PyObject* __Pyx_PyObject_CallMethO(PyObject *func, PyObject *arg); #endif static CYTHON_INLINE PyObject* __Pyx_PyObject_CallOneArg(PyObject *func, PyObject *arg); #if CYTHON_COMPILING_IN_CPYTHON static CYTHON_INLINE PyObject* __Pyx_PyObject_CallNoArg(PyObject *func); #else #define __Pyx_PyObject_CallNoArg(func) __Pyx_PyObject_Call(func, __pyx_empty_tuple, NULL) #endif static CYTHON_INLINE void __Pyx_ErrRestore(PyObject *type, PyObject *value, PyObject *tb); static CYTHON_INLINE void __Pyx_ErrFetch(PyObject **type, PyObject **value, PyObject **tb); static void __Pyx_WriteUnraisable(const char *name, int clineno, int lineno, const char *filename, int full_traceback, int nogil); static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, PyObject *cause); static void __Pyx_RaiseDoubleKeywordsError(const char* func_name, PyObject* kw_name); static int __Pyx_ParseOptionalKeywords(PyObject *kwds, PyObject **argnames[],\ PyObject *kwds2, PyObject *values[], Py_ssize_t num_pos_args,\ const char* function_name); static void __Pyx_RaiseArgtupleInvalid(const char* func_name, int exact, Py_ssize_t num_min, Py_ssize_t num_max, Py_ssize_t num_found); static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list, int level); static PyObject* __Pyx_ImportFrom(PyObject* module, PyObject* name); typedef struct { int code_line; PyCodeObject* code_object; } __Pyx_CodeObjectCacheEntry; struct __Pyx_CodeObjectCache { int count; int max_count; __Pyx_CodeObjectCacheEntry* entries; }; static struct __Pyx_CodeObjectCache __pyx_code_cache = {0,0,NULL}; static int __pyx_bisect_code_objects(__Pyx_CodeObjectCacheEntry* entries, int count, int code_line); static PyCodeObject *__pyx_find_code_object(int code_line); static void __pyx_insert_code_object(int code_line, PyCodeObject* code_object); static void __Pyx_AddTraceback(const char *funcname, int c_line, int py_line, const char *filename); static CYTHON_INLINE int __Pyx_PyInt_As_int(PyObject *); static CYTHON_INLINE PyObject* __Pyx_PyInt_From_int(int value); static CYTHON_INLINE PyObject* __Pyx_PyInt_From_long(long value); static CYTHON_INLINE long __Pyx_PyInt_As_long(PyObject *); static int __Pyx_check_binary_version(void); #if !defined(__Pyx_PyIdentifier_FromString) #if PY_MAJOR_VERSION < 3 #define __Pyx_PyIdentifier_FromString(s) PyString_FromString(s) #else #define __Pyx_PyIdentifier_FromString(s) PyUnicode_FromString(s) #endif #endif static PyObject *__Pyx_ImportModule(const char *name); static int __Pyx_ImportFunction(PyObject *module, const char *funcname, void (**f)(void), const char *sig); static int __Pyx_InitStrings(__Pyx_StringTabEntry *t); /* Module declarations from 'libc.stdint' */ /* Module declarations from 'libc.string' */ /* Module declarations from 'libc.stdio' */ /* Module declarations from 'libc.stddef' */ /* Module declarations from 'sdl2' */ /* Module declarations from 'sdl2_mixer' */ /* Module declarations from 'pygame_sdl2.rwobject' */ static SDL_RWops *(*__pyx_f_11pygame_sdl2_8rwobject_to_rwops)(PyObject *, struct __pyx_opt_args_11pygame_sdl2_8rwobject_to_rwops *__pyx_optional_args); /*proto*/ /* Module declarations from 'pygame_sdl2.mixer_music' */ static Mix_Music *__pyx_v_11pygame_sdl2_11mixer_music_current_music; static PyObject *__pyx_v_11pygame_sdl2_11mixer_music_queued_music = 0; static int __pyx_v_11pygame_sdl2_11mixer_music_endevent; static void __pyx_f_11pygame_sdl2_11mixer_music_music_finished(void); /*proto*/ #define __Pyx_MODULE_NAME "pygame_sdl2.mixer_music" int __pyx_module_is_main_pygame_sdl2__mixer_music = 0; /* Implementation of 'pygame_sdl2.mixer_music' */ static char __pyx_k_fi[] = "fi"; static char __pyx_k_pos[] = "pos"; static char __pyx_k_load[] = "load"; static char __pyx_k_main[] = "__main__"; static char __pyx_k_play[] = "play"; static char __pyx_k_stop[] = "stop"; static char __pyx_k_test[] = "__test__"; static char __pyx_k_time[] = "time"; static char __pyx_k_type[] = "type"; static char __pyx_k_error[] = "error"; static char __pyx_k_loops[] = "loops"; static char __pyx_k_pause[] = "pause"; static char __pyx_k_queue[] = "queue"; static char __pyx_k_start[] = "start"; static char __pyx_k_value[] = "value"; static char __pyx_k_import[] = "__import__"; static char __pyx_k_fadeout[] = "fadeout"; static char __pyx_k_get_pos[] = "get_pos"; static char __pyx_k_set_pos[] = "set_pos"; static char __pyx_k_unpause[] = "unpause"; static char __pyx_k_get_busy[] = "get_busy"; static char __pyx_k_get_volume[] = "get_volume"; static char __pyx_k_set_volume[] = "set_volume"; static char __pyx_k_get_endevent[] = "get_endevent"; static char __pyx_k_set_endevent[] = "set_endevent"; static char __pyx_k_Not_implemented[] = "Not implemented."; static char __pyx_k_pygame_sdl2_error[] = "pygame_sdl2.error"; static char __pyx_k_pygame_sdl2_mixer_music[] = "pygame_sdl2.mixer_music"; static char __pyx_k_home_tom_ab_pygame_sdl2_src_pyg[] = "/home/tom/ab/pygame_sdl2/src/pygame_sdl2/mixer_music.pyx"; static PyObject *__pyx_kp_u_Not_implemented; static PyObject *__pyx_n_s_error; static PyObject *__pyx_n_s_fadeout; static PyObject *__pyx_n_s_fi; static PyObject *__pyx_n_s_get_busy; static PyObject *__pyx_n_s_get_endevent; static PyObject *__pyx_n_s_get_pos; static PyObject *__pyx_n_s_get_volume; static PyObject *__pyx_kp_s_home_tom_ab_pygame_sdl2_src_pyg; static PyObject *__pyx_n_s_import; static PyObject *__pyx_n_s_load; static PyObject *__pyx_n_s_loops; static PyObject *__pyx_n_s_main; static PyObject *__pyx_n_s_pause; static PyObject *__pyx_n_s_play; static PyObject *__pyx_n_s_pos; static PyObject *__pyx_n_s_pygame_sdl2_error; static PyObject *__pyx_n_s_pygame_sdl2_mixer_music; static PyObject *__pyx_n_s_queue; static PyObject *__pyx_n_s_set_endevent; static PyObject *__pyx_n_s_set_pos; static PyObject *__pyx_n_s_set_volume; static PyObject *__pyx_n_s_start; static PyObject *__pyx_n_s_stop; static PyObject *__pyx_n_s_test; static PyObject *__pyx_n_s_time; static PyObject *__pyx_n_s_type; static PyObject *__pyx_n_s_unpause; static PyObject *__pyx_n_s_value; static PyObject *__pyx_pf_11pygame_sdl2_11mixer_music_load(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_fi); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_11mixer_music_2play(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_loops, double __pyx_v_start); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_11mixer_music_4rewind(CYTHON_UNUSED PyObject *__pyx_self); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_11mixer_music_6stop(CYTHON_UNUSED PyObject *__pyx_self); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_11mixer_music_8pause(CYTHON_UNUSED PyObject *__pyx_self); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_11mixer_music_10unpause(CYTHON_UNUSED PyObject *__pyx_self); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_11mixer_music_12fadeout(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_time); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_11mixer_music_14set_volume(CYTHON_UNUSED PyObject *__pyx_self, double __pyx_v_value); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_11mixer_music_16get_volume(CYTHON_UNUSED PyObject *__pyx_self); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_11mixer_music_18get_busy(CYTHON_UNUSED PyObject *__pyx_self); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_11mixer_music_20set_pos(CYTHON_UNUSED PyObject *__pyx_self, double __pyx_v_pos); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_11mixer_music_22get_pos(CYTHON_UNUSED PyObject *__pyx_self); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_11mixer_music_24queue(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_fi); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_11mixer_music_26set_endevent(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_type); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_11mixer_music_28get_endevent(CYTHON_UNUSED PyObject *__pyx_self); /* proto */ static PyObject *__pyx_int_0; static PyObject *__pyx_tuple_; static PyObject *__pyx_tuple__2; static PyObject *__pyx_tuple__4; static PyObject *__pyx_tuple__9; static PyObject *__pyx_tuple__11; static PyObject *__pyx_tuple__15; static PyObject *__pyx_tuple__18; static PyObject *__pyx_tuple__20; static PyObject *__pyx_codeobj__3; static PyObject *__pyx_codeobj__5; static PyObject *__pyx_codeobj__6; static PyObject *__pyx_codeobj__7; static PyObject *__pyx_codeobj__8; static PyObject *__pyx_codeobj__10; static PyObject *__pyx_codeobj__12; static PyObject *__pyx_codeobj__13; static PyObject *__pyx_codeobj__14; static PyObject *__pyx_codeobj__16; static PyObject *__pyx_codeobj__17; static PyObject *__pyx_codeobj__19; static PyObject *__pyx_codeobj__21; static PyObject *__pyx_codeobj__22; /* "pygame_sdl2/mixer_music.pyx":30 * cdef int endevent = 0 * * cdef void music_finished(): # <<<<<<<<<<<<<< * global queued_music * if queued_music: */ static void __pyx_f_11pygame_sdl2_11mixer_music_music_finished(void) { SDL_Event __pyx_v_e; __Pyx_RefNannyDeclarations int __pyx_t_1; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; PyObject *__pyx_t_5 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("music_finished", 0); /* "pygame_sdl2/mixer_music.pyx":32 * cdef void music_finished(): * global queued_music * if queued_music: # <<<<<<<<<<<<<< * load(queued_music) * play() */ __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_11pygame_sdl2_11mixer_music_queued_music); if (unlikely(__pyx_t_1 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 32; __pyx_clineno = __LINE__; goto __pyx_L1_error;} if (__pyx_t_1) { /* "pygame_sdl2/mixer_music.pyx":33 * global queued_music * if queued_music: * load(queued_music) # <<<<<<<<<<<<<< * play() * queued_music = None */ __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_load); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 33; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = NULL; if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_3))) { __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3); if (likely(__pyx_t_4)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); __Pyx_INCREF(__pyx_t_4); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_3, function); } } if (!__pyx_t_4) { __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_v_11pygame_sdl2_11mixer_music_queued_music); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 33; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); } else { __pyx_t_5 = PyTuple_New(1+1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 33; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_4); __pyx_t_4 = NULL; __Pyx_INCREF(__pyx_v_11pygame_sdl2_11mixer_music_queued_music); __Pyx_GIVEREF(__pyx_v_11pygame_sdl2_11mixer_music_queued_music); PyTuple_SET_ITEM(__pyx_t_5, 0+1, __pyx_v_11pygame_sdl2_11mixer_music_queued_music); __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_5, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 33; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; } __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "pygame_sdl2/mixer_music.pyx":34 * if queued_music: * load(queued_music) * play() # <<<<<<<<<<<<<< * queued_music = None * */ __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_play); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 34; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __pyx_t_5 = NULL; if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_3))) { __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_3); if (likely(__pyx_t_5)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); __Pyx_INCREF(__pyx_t_5); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_3, function); } } if (__pyx_t_5) { __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_5); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 34; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; } else { __pyx_t_2 = __Pyx_PyObject_CallNoArg(__pyx_t_3); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 34; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "pygame_sdl2/mixer_music.pyx":35 * load(queued_music) * play() * queued_music = None # <<<<<<<<<<<<<< * * cdef SDL_Event e */ __Pyx_INCREF(Py_None); __Pyx_XGOTREF(__pyx_v_11pygame_sdl2_11mixer_music_queued_music); __Pyx_DECREF_SET(__pyx_v_11pygame_sdl2_11mixer_music_queued_music, Py_None); __Pyx_GIVEREF(Py_None); /* "pygame_sdl2/mixer_music.pyx":32 * cdef void music_finished(): * global queued_music * if queued_music: # <<<<<<<<<<<<<< * load(queued_music) * play() */ } /* "pygame_sdl2/mixer_music.pyx":38 * * cdef SDL_Event e * if endevent != 0: # <<<<<<<<<<<<<< * memset(&e, 0, sizeof(SDL_Event)) * e.type = endevent */ __pyx_t_1 = ((__pyx_v_11pygame_sdl2_11mixer_music_endevent != 0) != 0); if (__pyx_t_1) { /* "pygame_sdl2/mixer_music.pyx":39 * cdef SDL_Event e * if endevent != 0: * memset(&e, 0, sizeof(SDL_Event)) # <<<<<<<<<<<<<< * e.type = endevent * SDL_PushEvent(&e) */ memset((&__pyx_v_e), 0, (sizeof(SDL_Event))); /* "pygame_sdl2/mixer_music.pyx":40 * if endevent != 0: * memset(&e, 0, sizeof(SDL_Event)) * e.type = endevent # <<<<<<<<<<<<<< * SDL_PushEvent(&e) * */ __pyx_v_e.type = __pyx_v_11pygame_sdl2_11mixer_music_endevent; /* "pygame_sdl2/mixer_music.pyx":41 * memset(&e, 0, sizeof(SDL_Event)) * e.type = endevent * SDL_PushEvent(&e) # <<<<<<<<<<<<<< * * */ SDL_PushEvent((&__pyx_v_e)); /* "pygame_sdl2/mixer_music.pyx":38 * * cdef SDL_Event e * if endevent != 0: # <<<<<<<<<<<<<< * memset(&e, 0, sizeof(SDL_Event)) * e.type = endevent */ } /* "pygame_sdl2/mixer_music.pyx":30 * cdef int endevent = 0 * * cdef void music_finished(): # <<<<<<<<<<<<<< * global queued_music * if queued_music: */ /* function exit code */ goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_5); __Pyx_WriteUnraisable("pygame_sdl2.mixer_music.music_finished", __pyx_clineno, __pyx_lineno, __pyx_filename, 0, 0); __pyx_L0:; __Pyx_RefNannyFinishContext(); } /* "pygame_sdl2/mixer_music.pyx":44 * * * def load(fi): # <<<<<<<<<<<<<< * global current_music * */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_11mixer_music_1load(PyObject *__pyx_self, PyObject *__pyx_v_fi); /*proto*/ static PyMethodDef __pyx_mdef_11pygame_sdl2_11mixer_music_1load = {"load", (PyCFunction)__pyx_pw_11pygame_sdl2_11mixer_music_1load, METH_O, 0}; static PyObject *__pyx_pw_11pygame_sdl2_11mixer_music_1load(PyObject *__pyx_self, PyObject *__pyx_v_fi) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("load (wrapper)", 0); __pyx_r = __pyx_pf_11pygame_sdl2_11mixer_music_load(__pyx_self, ((PyObject *)__pyx_v_fi)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_11mixer_music_load(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_fi) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; SDL_RWops *__pyx_t_2; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; PyObject *__pyx_t_5 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("load", 0); /* "pygame_sdl2/mixer_music.pyx":48 * * # Free any previously loaded music. * if current_music != NULL: # <<<<<<<<<<<<<< * Mix_FreeMusic(current_music) * */ __pyx_t_1 = ((__pyx_v_11pygame_sdl2_11mixer_music_current_music != NULL) != 0); if (__pyx_t_1) { /* "pygame_sdl2/mixer_music.pyx":49 * # Free any previously loaded music. * if current_music != NULL: * Mix_FreeMusic(current_music) # <<<<<<<<<<<<<< * * current_music = Mix_LoadMUS_RW(to_rwops(fi), 1) */ Mix_FreeMusic(__pyx_v_11pygame_sdl2_11mixer_music_current_music); /* "pygame_sdl2/mixer_music.pyx":48 * * # Free any previously loaded music. * if current_music != NULL: # <<<<<<<<<<<<<< * Mix_FreeMusic(current_music) * */ } /* "pygame_sdl2/mixer_music.pyx":51 * Mix_FreeMusic(current_music) * * current_music = Mix_LoadMUS_RW(to_rwops(fi), 1) # <<<<<<<<<<<<<< * if current_music == NULL: * raise error() */ __pyx_t_2 = __pyx_f_11pygame_sdl2_8rwobject_to_rwops(__pyx_v_fi, NULL); if (unlikely(__pyx_t_2 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 51; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_v_11pygame_sdl2_11mixer_music_current_music = Mix_LoadMUS_RW(__pyx_t_2, 1); /* "pygame_sdl2/mixer_music.pyx":52 * * current_music = Mix_LoadMUS_RW(to_rwops(fi), 1) * if current_music == NULL: # <<<<<<<<<<<<<< * raise error() * */ __pyx_t_1 = ((__pyx_v_11pygame_sdl2_11mixer_music_current_music == NULL) != 0); if (__pyx_t_1) { /* "pygame_sdl2/mixer_music.pyx":53 * current_music = Mix_LoadMUS_RW(to_rwops(fi), 1) * if current_music == NULL: * raise error() # <<<<<<<<<<<<<< * * def play(loops=0, double start=0.0): */ __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_error); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 53; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); __pyx_t_5 = NULL; if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_4))) { __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4); if (likely(__pyx_t_5)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4); __Pyx_INCREF(__pyx_t_5); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_4, function); } } if (__pyx_t_5) { __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_5); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 53; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; } else { __pyx_t_3 = __Pyx_PyObject_CallNoArg(__pyx_t_4); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 53; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_Raise(__pyx_t_3, 0, 0, 0); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; {__pyx_filename = __pyx_f[0]; __pyx_lineno = 53; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "pygame_sdl2/mixer_music.pyx":52 * * current_music = Mix_LoadMUS_RW(to_rwops(fi), 1) * if current_music == NULL: # <<<<<<<<<<<<<< * raise error() * */ } /* "pygame_sdl2/mixer_music.pyx":44 * * * def load(fi): # <<<<<<<<<<<<<< * global current_music * */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_5); __Pyx_AddTraceback("pygame_sdl2.mixer_music.load", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/mixer_music.pyx":55 * raise error() * * def play(loops=0, double start=0.0): # <<<<<<<<<<<<<< * Mix_FadeInMusicPos(current_music, loops, 0, start) * */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_11mixer_music_3play(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static PyMethodDef __pyx_mdef_11pygame_sdl2_11mixer_music_3play = {"play", (PyCFunction)__pyx_pw_11pygame_sdl2_11mixer_music_3play, METH_VARARGS|METH_KEYWORDS, 0}; static PyObject *__pyx_pw_11pygame_sdl2_11mixer_music_3play(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_loops = 0; double __pyx_v_start; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("play (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_loops,&__pyx_n_s_start,0}; PyObject* values[2] = {0,0}; values[0] = ((PyObject *)__pyx_int_0); if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (kw_args > 0) { PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_loops); if (value) { values[0] = value; kw_args--; } } case 1: if (kw_args > 0) { PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_start); if (value) { values[1] = value; kw_args--; } } } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "play") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 55; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } } else { switch (PyTuple_GET_SIZE(__pyx_args)) { case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); case 0: break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_loops = values[0]; if (values[1]) { __pyx_v_start = __pyx_PyFloat_AsDouble(values[1]); if (unlikely((__pyx_v_start == (double)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 55; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } else { __pyx_v_start = ((double)0.0); } } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("play", 0, 0, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 55; __pyx_clineno = __LINE__; goto __pyx_L3_error;} __pyx_L3_error:; __Pyx_AddTraceback("pygame_sdl2.mixer_music.play", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_11pygame_sdl2_11mixer_music_2play(__pyx_self, __pyx_v_loops, __pyx_v_start); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_11mixer_music_2play(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_loops, double __pyx_v_start) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("play", 0); /* "pygame_sdl2/mixer_music.pyx":56 * * def play(loops=0, double start=0.0): * Mix_FadeInMusicPos(current_music, loops, 0, start) # <<<<<<<<<<<<<< * * def rewind(): */ __pyx_t_1 = __Pyx_PyInt_As_int(__pyx_v_loops); if (unlikely((__pyx_t_1 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 56; __pyx_clineno = __LINE__; goto __pyx_L1_error;} Mix_FadeInMusicPos(__pyx_v_11pygame_sdl2_11mixer_music_current_music, __pyx_t_1, 0, __pyx_v_start); /* "pygame_sdl2/mixer_music.pyx":55 * raise error() * * def play(loops=0, double start=0.0): # <<<<<<<<<<<<<< * Mix_FadeInMusicPos(current_music, loops, 0, start) * */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("pygame_sdl2.mixer_music.play", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/mixer_music.pyx":58 * Mix_FadeInMusicPos(current_music, loops, 0, start) * * def rewind(): # <<<<<<<<<<<<<< * Mix_RewindMusic() * */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_11mixer_music_5rewind(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused); /*proto*/ static PyObject *__pyx_pw_11pygame_sdl2_11mixer_music_5rewind(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("rewind (wrapper)", 0); __pyx_r = __pyx_pf_11pygame_sdl2_11mixer_music_4rewind(__pyx_self); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_11mixer_music_4rewind(CYTHON_UNUSED PyObject *__pyx_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("rewind", 0); /* "pygame_sdl2/mixer_music.pyx":59 * * def rewind(): * Mix_RewindMusic() # <<<<<<<<<<<<<< * * def stop(): */ Mix_RewindMusic(); /* "pygame_sdl2/mixer_music.pyx":58 * Mix_FadeInMusicPos(current_music, loops, 0, start) * * def rewind(): # <<<<<<<<<<<<<< * Mix_RewindMusic() * */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/mixer_music.pyx":61 * Mix_RewindMusic() * * def stop(): # <<<<<<<<<<<<<< * Mix_HaltMusic() * */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_11mixer_music_7stop(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused); /*proto*/ static PyMethodDef __pyx_mdef_11pygame_sdl2_11mixer_music_7stop = {"stop", (PyCFunction)__pyx_pw_11pygame_sdl2_11mixer_music_7stop, METH_NOARGS, 0}; static PyObject *__pyx_pw_11pygame_sdl2_11mixer_music_7stop(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("stop (wrapper)", 0); __pyx_r = __pyx_pf_11pygame_sdl2_11mixer_music_6stop(__pyx_self); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_11mixer_music_6stop(CYTHON_UNUSED PyObject *__pyx_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("stop", 0); /* "pygame_sdl2/mixer_music.pyx":62 * * def stop(): * Mix_HaltMusic() # <<<<<<<<<<<<<< * * def pause(): */ Mix_HaltMusic(); /* "pygame_sdl2/mixer_music.pyx":61 * Mix_RewindMusic() * * def stop(): # <<<<<<<<<<<<<< * Mix_HaltMusic() * */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/mixer_music.pyx":64 * Mix_HaltMusic() * * def pause(): # <<<<<<<<<<<<<< * Mix_PauseMusic() * */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_11mixer_music_9pause(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused); /*proto*/ static PyMethodDef __pyx_mdef_11pygame_sdl2_11mixer_music_9pause = {"pause", (PyCFunction)__pyx_pw_11pygame_sdl2_11mixer_music_9pause, METH_NOARGS, 0}; static PyObject *__pyx_pw_11pygame_sdl2_11mixer_music_9pause(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("pause (wrapper)", 0); __pyx_r = __pyx_pf_11pygame_sdl2_11mixer_music_8pause(__pyx_self); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_11mixer_music_8pause(CYTHON_UNUSED PyObject *__pyx_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("pause", 0); /* "pygame_sdl2/mixer_music.pyx":65 * * def pause(): * Mix_PauseMusic() # <<<<<<<<<<<<<< * * def unpause(): */ Mix_PauseMusic(); /* "pygame_sdl2/mixer_music.pyx":64 * Mix_HaltMusic() * * def pause(): # <<<<<<<<<<<<<< * Mix_PauseMusic() * */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/mixer_music.pyx":67 * Mix_PauseMusic() * * def unpause(): # <<<<<<<<<<<<<< * Mix_ResumeMusic() * */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_11mixer_music_11unpause(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused); /*proto*/ static PyMethodDef __pyx_mdef_11pygame_sdl2_11mixer_music_11unpause = {"unpause", (PyCFunction)__pyx_pw_11pygame_sdl2_11mixer_music_11unpause, METH_NOARGS, 0}; static PyObject *__pyx_pw_11pygame_sdl2_11mixer_music_11unpause(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("unpause (wrapper)", 0); __pyx_r = __pyx_pf_11pygame_sdl2_11mixer_music_10unpause(__pyx_self); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_11mixer_music_10unpause(CYTHON_UNUSED PyObject *__pyx_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("unpause", 0); /* "pygame_sdl2/mixer_music.pyx":68 * * def unpause(): * Mix_ResumeMusic() # <<<<<<<<<<<<<< * * def fadeout(time): */ Mix_ResumeMusic(); /* "pygame_sdl2/mixer_music.pyx":67 * Mix_PauseMusic() * * def unpause(): # <<<<<<<<<<<<<< * Mix_ResumeMusic() * */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/mixer_music.pyx":70 * Mix_ResumeMusic() * * def fadeout(time): # <<<<<<<<<<<<<< * Mix_FadeOutMusic(time) * */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_11mixer_music_13fadeout(PyObject *__pyx_self, PyObject *__pyx_v_time); /*proto*/ static PyMethodDef __pyx_mdef_11pygame_sdl2_11mixer_music_13fadeout = {"fadeout", (PyCFunction)__pyx_pw_11pygame_sdl2_11mixer_music_13fadeout, METH_O, 0}; static PyObject *__pyx_pw_11pygame_sdl2_11mixer_music_13fadeout(PyObject *__pyx_self, PyObject *__pyx_v_time) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("fadeout (wrapper)", 0); __pyx_r = __pyx_pf_11pygame_sdl2_11mixer_music_12fadeout(__pyx_self, ((PyObject *)__pyx_v_time)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_11mixer_music_12fadeout(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_time) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("fadeout", 0); /* "pygame_sdl2/mixer_music.pyx":71 * * def fadeout(time): * Mix_FadeOutMusic(time) # <<<<<<<<<<<<<< * * def set_volume(double value): */ __pyx_t_1 = __Pyx_PyInt_As_int(__pyx_v_time); if (unlikely((__pyx_t_1 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 71; __pyx_clineno = __LINE__; goto __pyx_L1_error;} Mix_FadeOutMusic(__pyx_t_1); /* "pygame_sdl2/mixer_music.pyx":70 * Mix_ResumeMusic() * * def fadeout(time): # <<<<<<<<<<<<<< * Mix_FadeOutMusic(time) * */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("pygame_sdl2.mixer_music.fadeout", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/mixer_music.pyx":73 * Mix_FadeOutMusic(time) * * def set_volume(double value): # <<<<<<<<<<<<<< * Mix_VolumeMusic((MIX_MAX_VOLUME * value)) * */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_11mixer_music_15set_volume(PyObject *__pyx_self, PyObject *__pyx_arg_value); /*proto*/ static PyMethodDef __pyx_mdef_11pygame_sdl2_11mixer_music_15set_volume = {"set_volume", (PyCFunction)__pyx_pw_11pygame_sdl2_11mixer_music_15set_volume, METH_O, 0}; static PyObject *__pyx_pw_11pygame_sdl2_11mixer_music_15set_volume(PyObject *__pyx_self, PyObject *__pyx_arg_value) { double __pyx_v_value; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("set_volume (wrapper)", 0); assert(__pyx_arg_value); { __pyx_v_value = __pyx_PyFloat_AsDouble(__pyx_arg_value); if (unlikely((__pyx_v_value == (double)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 73; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; __Pyx_AddTraceback("pygame_sdl2.mixer_music.set_volume", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_11pygame_sdl2_11mixer_music_14set_volume(__pyx_self, ((double)__pyx_v_value)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_11mixer_music_14set_volume(CYTHON_UNUSED PyObject *__pyx_self, double __pyx_v_value) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("set_volume", 0); /* "pygame_sdl2/mixer_music.pyx":74 * * def set_volume(double value): * Mix_VolumeMusic((MIX_MAX_VOLUME * value)) # <<<<<<<<<<<<<< * * def get_volume(): */ Mix_VolumeMusic(((int)(MIX_MAX_VOLUME * __pyx_v_value))); /* "pygame_sdl2/mixer_music.pyx":73 * Mix_FadeOutMusic(time) * * def set_volume(double value): # <<<<<<<<<<<<<< * Mix_VolumeMusic((MIX_MAX_VOLUME * value)) * */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/mixer_music.pyx":76 * Mix_VolumeMusic((MIX_MAX_VOLUME * value)) * * def get_volume(): # <<<<<<<<<<<<<< * return Mix_VolumeMusic(-1) / MIX_MAX_VOLUME * */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_11mixer_music_17get_volume(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused); /*proto*/ static PyMethodDef __pyx_mdef_11pygame_sdl2_11mixer_music_17get_volume = {"get_volume", (PyCFunction)__pyx_pw_11pygame_sdl2_11mixer_music_17get_volume, METH_NOARGS, 0}; static PyObject *__pyx_pw_11pygame_sdl2_11mixer_music_17get_volume(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("get_volume (wrapper)", 0); __pyx_r = __pyx_pf_11pygame_sdl2_11mixer_music_16get_volume(__pyx_self); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_11mixer_music_16get_volume(CYTHON_UNUSED PyObject *__pyx_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; PyObject *__pyx_t_2 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("get_volume", 0); /* "pygame_sdl2/mixer_music.pyx":77 * * def get_volume(): * return Mix_VolumeMusic(-1) / MIX_MAX_VOLUME # <<<<<<<<<<<<<< * * def get_busy(): */ __Pyx_XDECREF(__pyx_r); __pyx_t_1 = Mix_VolumeMusic(-1); if (unlikely(((double)MIX_MAX_VOLUME) == 0)) { PyErr_SetString(PyExc_ZeroDivisionError, "float division"); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 77; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } __pyx_t_2 = PyFloat_FromDouble((((double)__pyx_t_1) / ((double)MIX_MAX_VOLUME))); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 77; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; /* "pygame_sdl2/mixer_music.pyx":76 * Mix_VolumeMusic((MIX_MAX_VOLUME * value)) * * def get_volume(): # <<<<<<<<<<<<<< * return Mix_VolumeMusic(-1) / MIX_MAX_VOLUME * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_AddTraceback("pygame_sdl2.mixer_music.get_volume", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/mixer_music.pyx":79 * return Mix_VolumeMusic(-1) / MIX_MAX_VOLUME * * def get_busy(): # <<<<<<<<<<<<<< * return Mix_PlayingMusic() * */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_11mixer_music_19get_busy(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused); /*proto*/ static PyMethodDef __pyx_mdef_11pygame_sdl2_11mixer_music_19get_busy = {"get_busy", (PyCFunction)__pyx_pw_11pygame_sdl2_11mixer_music_19get_busy, METH_NOARGS, 0}; static PyObject *__pyx_pw_11pygame_sdl2_11mixer_music_19get_busy(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("get_busy (wrapper)", 0); __pyx_r = __pyx_pf_11pygame_sdl2_11mixer_music_18get_busy(__pyx_self); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_11mixer_music_18get_busy(CYTHON_UNUSED PyObject *__pyx_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("get_busy", 0); /* "pygame_sdl2/mixer_music.pyx":80 * * def get_busy(): * return Mix_PlayingMusic() # <<<<<<<<<<<<<< * * def set_pos(double pos): */ __Pyx_XDECREF(__pyx_r); __pyx_t_1 = __Pyx_PyInt_From_int(Mix_PlayingMusic()); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 80; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "pygame_sdl2/mixer_music.pyx":79 * return Mix_VolumeMusic(-1) / MIX_MAX_VOLUME * * def get_busy(): # <<<<<<<<<<<<<< * return Mix_PlayingMusic() * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("pygame_sdl2.mixer_music.get_busy", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/mixer_music.pyx":82 * return Mix_PlayingMusic() * * def set_pos(double pos): # <<<<<<<<<<<<<< * Mix_SetMusicPosition(pos) * */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_11mixer_music_21set_pos(PyObject *__pyx_self, PyObject *__pyx_arg_pos); /*proto*/ static PyMethodDef __pyx_mdef_11pygame_sdl2_11mixer_music_21set_pos = {"set_pos", (PyCFunction)__pyx_pw_11pygame_sdl2_11mixer_music_21set_pos, METH_O, 0}; static PyObject *__pyx_pw_11pygame_sdl2_11mixer_music_21set_pos(PyObject *__pyx_self, PyObject *__pyx_arg_pos) { double __pyx_v_pos; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("set_pos (wrapper)", 0); assert(__pyx_arg_pos); { __pyx_v_pos = __pyx_PyFloat_AsDouble(__pyx_arg_pos); if (unlikely((__pyx_v_pos == (double)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 82; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; __Pyx_AddTraceback("pygame_sdl2.mixer_music.set_pos", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_11pygame_sdl2_11mixer_music_20set_pos(__pyx_self, ((double)__pyx_v_pos)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_11mixer_music_20set_pos(CYTHON_UNUSED PyObject *__pyx_self, double __pyx_v_pos) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("set_pos", 0); /* "pygame_sdl2/mixer_music.pyx":83 * * def set_pos(double pos): * Mix_SetMusicPosition(pos) # <<<<<<<<<<<<<< * * def get_pos(): */ Mix_SetMusicPosition(__pyx_v_pos); /* "pygame_sdl2/mixer_music.pyx":82 * return Mix_PlayingMusic() * * def set_pos(double pos): # <<<<<<<<<<<<<< * Mix_SetMusicPosition(pos) * */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/mixer_music.pyx":85 * Mix_SetMusicPosition(pos) * * def get_pos(): # <<<<<<<<<<<<<< * # TODO: Use a Mix_SetPostMix callback to track position. * raise error("Not implemented.") */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_11mixer_music_23get_pos(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused); /*proto*/ static PyMethodDef __pyx_mdef_11pygame_sdl2_11mixer_music_23get_pos = {"get_pos", (PyCFunction)__pyx_pw_11pygame_sdl2_11mixer_music_23get_pos, METH_NOARGS, 0}; static PyObject *__pyx_pw_11pygame_sdl2_11mixer_music_23get_pos(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("get_pos (wrapper)", 0); __pyx_r = __pyx_pf_11pygame_sdl2_11mixer_music_22get_pos(__pyx_self); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_11mixer_music_22get_pos(CYTHON_UNUSED PyObject *__pyx_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("get_pos", 0); /* "pygame_sdl2/mixer_music.pyx":87 * def get_pos(): * # TODO: Use a Mix_SetPostMix callback to track position. * raise error("Not implemented.") # <<<<<<<<<<<<<< * * def queue(fi): */ __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_error); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 87; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_tuple_, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 87; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_Raise(__pyx_t_2, 0, 0, 0); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; {__pyx_filename = __pyx_f[0]; __pyx_lineno = 87; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "pygame_sdl2/mixer_music.pyx":85 * Mix_SetMusicPosition(pos) * * def get_pos(): # <<<<<<<<<<<<<< * # TODO: Use a Mix_SetPostMix callback to track position. * raise error("Not implemented.") */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_AddTraceback("pygame_sdl2.mixer_music.get_pos", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/mixer_music.pyx":89 * raise error("Not implemented.") * * def queue(fi): # <<<<<<<<<<<<<< * Mix_HookMusicFinished(music_finished) * if get_busy(): */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_11mixer_music_25queue(PyObject *__pyx_self, PyObject *__pyx_v_fi); /*proto*/ static PyMethodDef __pyx_mdef_11pygame_sdl2_11mixer_music_25queue = {"queue", (PyCFunction)__pyx_pw_11pygame_sdl2_11mixer_music_25queue, METH_O, 0}; static PyObject *__pyx_pw_11pygame_sdl2_11mixer_music_25queue(PyObject *__pyx_self, PyObject *__pyx_v_fi) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("queue (wrapper)", 0); __pyx_r = __pyx_pf_11pygame_sdl2_11mixer_music_24queue(__pyx_self, ((PyObject *)__pyx_v_fi)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_11mixer_music_24queue(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_fi) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; int __pyx_t_4; PyObject *__pyx_t_5 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("queue", 0); /* "pygame_sdl2/mixer_music.pyx":90 * * def queue(fi): * Mix_HookMusicFinished(music_finished) # <<<<<<<<<<<<<< * if get_busy(): * global queued_music */ Mix_HookMusicFinished(__pyx_f_11pygame_sdl2_11mixer_music_music_finished); /* "pygame_sdl2/mixer_music.pyx":91 * def queue(fi): * Mix_HookMusicFinished(music_finished) * if get_busy(): # <<<<<<<<<<<<<< * global queued_music * queued_music = fi */ __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_get_busy); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 91; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = NULL; if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_2))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); if (likely(__pyx_t_3)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); } } if (__pyx_t_3) { __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 91; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } else { __pyx_t_1 = __Pyx_PyObject_CallNoArg(__pyx_t_2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 91; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_4 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 91; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (__pyx_t_4) { /* "pygame_sdl2/mixer_music.pyx":93 * if get_busy(): * global queued_music * queued_music = fi # <<<<<<<<<<<<<< * else: * load(fi) */ __Pyx_INCREF(__pyx_v_fi); __Pyx_XGOTREF(__pyx_v_11pygame_sdl2_11mixer_music_queued_music); __Pyx_DECREF_SET(__pyx_v_11pygame_sdl2_11mixer_music_queued_music, __pyx_v_fi); __Pyx_GIVEREF(__pyx_v_fi); /* "pygame_sdl2/mixer_music.pyx":91 * def queue(fi): * Mix_HookMusicFinished(music_finished) * if get_busy(): # <<<<<<<<<<<<<< * global queued_music * queued_music = fi */ goto __pyx_L3; } /* "pygame_sdl2/mixer_music.pyx":95 * queued_music = fi * else: * load(fi) # <<<<<<<<<<<<<< * play() * */ /*else*/ { __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_load); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 95; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = NULL; if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_2))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); if (likely(__pyx_t_3)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); } } if (!__pyx_t_3) { __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_v_fi); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 95; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); } else { __pyx_t_5 = PyTuple_New(1+1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 95; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_3); __pyx_t_3 = NULL; __Pyx_INCREF(__pyx_v_fi); __Pyx_GIVEREF(__pyx_v_fi); PyTuple_SET_ITEM(__pyx_t_5, 0+1, __pyx_v_fi); __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_5, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 95; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; } __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "pygame_sdl2/mixer_music.pyx":96 * else: * load(fi) * play() # <<<<<<<<<<<<<< * * def set_endevent(type=None): */ __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_play); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 96; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __pyx_t_5 = NULL; if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_2))) { __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_2); if (likely(__pyx_t_5)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_5); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); } } if (__pyx_t_5) { __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_5); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 96; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; } else { __pyx_t_1 = __Pyx_PyObject_CallNoArg(__pyx_t_2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 96; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; } __pyx_L3:; /* "pygame_sdl2/mixer_music.pyx":89 * raise error("Not implemented.") * * def queue(fi): # <<<<<<<<<<<<<< * Mix_HookMusicFinished(music_finished) * if get_busy(): */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_5); __Pyx_AddTraceback("pygame_sdl2.mixer_music.queue", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/mixer_music.pyx":98 * play() * * def set_endevent(type=None): # <<<<<<<<<<<<<< * Mix_HookMusicFinished(music_finished) * global endevent */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_11mixer_music_27set_endevent(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static PyMethodDef __pyx_mdef_11pygame_sdl2_11mixer_music_27set_endevent = {"set_endevent", (PyCFunction)__pyx_pw_11pygame_sdl2_11mixer_music_27set_endevent, METH_VARARGS|METH_KEYWORDS, 0}; static PyObject *__pyx_pw_11pygame_sdl2_11mixer_music_27set_endevent(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_type = 0; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("set_endevent (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_type,0}; PyObject* values[1] = {0}; values[0] = ((PyObject *)Py_None); if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (kw_args > 0) { PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_type); if (value) { values[0] = value; kw_args--; } } } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "set_endevent") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 98; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } } else { switch (PyTuple_GET_SIZE(__pyx_args)) { case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); case 0: break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_type = values[0]; } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("set_endevent", 0, 0, 1, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 98; __pyx_clineno = __LINE__; goto __pyx_L3_error;} __pyx_L3_error:; __Pyx_AddTraceback("pygame_sdl2.mixer_music.set_endevent", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_11pygame_sdl2_11mixer_music_26set_endevent(__pyx_self, __pyx_v_type); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_11mixer_music_26set_endevent(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_type) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; int __pyx_t_2; int __pyx_t_3; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("set_endevent", 0); /* "pygame_sdl2/mixer_music.pyx":99 * * def set_endevent(type=None): * Mix_HookMusicFinished(music_finished) # <<<<<<<<<<<<<< * global endevent * endevent = type or 0 */ Mix_HookMusicFinished(__pyx_f_11pygame_sdl2_11mixer_music_music_finished); /* "pygame_sdl2/mixer_music.pyx":101 * Mix_HookMusicFinished(music_finished) * global endevent * endevent = type or 0 # <<<<<<<<<<<<<< * * def get_endevent(): */ __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_v_type); if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 101; __pyx_clineno = __LINE__; goto __pyx_L1_error;} if (!__pyx_t_2) { } else { __pyx_t_3 = __Pyx_PyInt_As_int(__pyx_v_type); if (unlikely((__pyx_t_3 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 101; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_t_1 = __pyx_t_3; goto __pyx_L3_bool_binop_done; } __pyx_t_1 = 0; __pyx_L3_bool_binop_done:; __pyx_v_11pygame_sdl2_11mixer_music_endevent = __pyx_t_1; /* "pygame_sdl2/mixer_music.pyx":98 * play() * * def set_endevent(type=None): # <<<<<<<<<<<<<< * Mix_HookMusicFinished(music_finished) * global endevent */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("pygame_sdl2.mixer_music.set_endevent", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/mixer_music.pyx":103 * endevent = type or 0 * * def get_endevent(): # <<<<<<<<<<<<<< * return endevent */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_11mixer_music_29get_endevent(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused); /*proto*/ static PyMethodDef __pyx_mdef_11pygame_sdl2_11mixer_music_29get_endevent = {"get_endevent", (PyCFunction)__pyx_pw_11pygame_sdl2_11mixer_music_29get_endevent, METH_NOARGS, 0}; static PyObject *__pyx_pw_11pygame_sdl2_11mixer_music_29get_endevent(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("get_endevent (wrapper)", 0); __pyx_r = __pyx_pf_11pygame_sdl2_11mixer_music_28get_endevent(__pyx_self); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_11mixer_music_28get_endevent(CYTHON_UNUSED PyObject *__pyx_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("get_endevent", 0); /* "pygame_sdl2/mixer_music.pyx":104 * * def get_endevent(): * return endevent # <<<<<<<<<<<<<< */ __Pyx_XDECREF(__pyx_r); __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_11pygame_sdl2_11mixer_music_endevent); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 104; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "pygame_sdl2/mixer_music.pyx":103 * endevent = type or 0 * * def get_endevent(): # <<<<<<<<<<<<<< * return endevent */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("pygame_sdl2.mixer_music.get_endevent", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyMethodDef __pyx_methods[] = { {"rewind", (PyCFunction)__pyx_pw_11pygame_sdl2_11mixer_music_5rewind, METH_NOARGS, 0}, {0, 0, 0, 0} }; #if PY_MAJOR_VERSION >= 3 static struct PyModuleDef __pyx_moduledef = { #if PY_VERSION_HEX < 0x03020000 { PyObject_HEAD_INIT(NULL) NULL, 0, NULL }, #else PyModuleDef_HEAD_INIT, #endif "mixer_music", 0, /* m_doc */ -1, /* m_size */ __pyx_methods /* m_methods */, NULL, /* m_reload */ NULL, /* m_traverse */ NULL, /* m_clear */ NULL /* m_free */ }; #endif static __Pyx_StringTabEntry __pyx_string_tab[] = { {&__pyx_kp_u_Not_implemented, __pyx_k_Not_implemented, sizeof(__pyx_k_Not_implemented), 0, 1, 0, 0}, {&__pyx_n_s_error, __pyx_k_error, sizeof(__pyx_k_error), 0, 0, 1, 1}, {&__pyx_n_s_fadeout, __pyx_k_fadeout, sizeof(__pyx_k_fadeout), 0, 0, 1, 1}, {&__pyx_n_s_fi, __pyx_k_fi, sizeof(__pyx_k_fi), 0, 0, 1, 1}, {&__pyx_n_s_get_busy, __pyx_k_get_busy, sizeof(__pyx_k_get_busy), 0, 0, 1, 1}, {&__pyx_n_s_get_endevent, __pyx_k_get_endevent, sizeof(__pyx_k_get_endevent), 0, 0, 1, 1}, {&__pyx_n_s_get_pos, __pyx_k_get_pos, sizeof(__pyx_k_get_pos), 0, 0, 1, 1}, {&__pyx_n_s_get_volume, __pyx_k_get_volume, sizeof(__pyx_k_get_volume), 0, 0, 1, 1}, {&__pyx_kp_s_home_tom_ab_pygame_sdl2_src_pyg, __pyx_k_home_tom_ab_pygame_sdl2_src_pyg, sizeof(__pyx_k_home_tom_ab_pygame_sdl2_src_pyg), 0, 0, 1, 0}, {&__pyx_n_s_import, __pyx_k_import, sizeof(__pyx_k_import), 0, 0, 1, 1}, {&__pyx_n_s_load, __pyx_k_load, sizeof(__pyx_k_load), 0, 0, 1, 1}, {&__pyx_n_s_loops, __pyx_k_loops, sizeof(__pyx_k_loops), 0, 0, 1, 1}, {&__pyx_n_s_main, __pyx_k_main, sizeof(__pyx_k_main), 0, 0, 1, 1}, {&__pyx_n_s_pause, __pyx_k_pause, sizeof(__pyx_k_pause), 0, 0, 1, 1}, {&__pyx_n_s_play, __pyx_k_play, sizeof(__pyx_k_play), 0, 0, 1, 1}, {&__pyx_n_s_pos, __pyx_k_pos, sizeof(__pyx_k_pos), 0, 0, 1, 1}, {&__pyx_n_s_pygame_sdl2_error, __pyx_k_pygame_sdl2_error, sizeof(__pyx_k_pygame_sdl2_error), 0, 0, 1, 1}, {&__pyx_n_s_pygame_sdl2_mixer_music, __pyx_k_pygame_sdl2_mixer_music, sizeof(__pyx_k_pygame_sdl2_mixer_music), 0, 0, 1, 1}, {&__pyx_n_s_queue, __pyx_k_queue, sizeof(__pyx_k_queue), 0, 0, 1, 1}, {&__pyx_n_s_set_endevent, __pyx_k_set_endevent, sizeof(__pyx_k_set_endevent), 0, 0, 1, 1}, {&__pyx_n_s_set_pos, __pyx_k_set_pos, sizeof(__pyx_k_set_pos), 0, 0, 1, 1}, {&__pyx_n_s_set_volume, __pyx_k_set_volume, sizeof(__pyx_k_set_volume), 0, 0, 1, 1}, {&__pyx_n_s_start, __pyx_k_start, sizeof(__pyx_k_start), 0, 0, 1, 1}, {&__pyx_n_s_stop, __pyx_k_stop, sizeof(__pyx_k_stop), 0, 0, 1, 1}, {&__pyx_n_s_test, __pyx_k_test, sizeof(__pyx_k_test), 0, 0, 1, 1}, {&__pyx_n_s_time, __pyx_k_time, sizeof(__pyx_k_time), 0, 0, 1, 1}, {&__pyx_n_s_type, __pyx_k_type, sizeof(__pyx_k_type), 0, 0, 1, 1}, {&__pyx_n_s_unpause, __pyx_k_unpause, sizeof(__pyx_k_unpause), 0, 0, 1, 1}, {&__pyx_n_s_value, __pyx_k_value, sizeof(__pyx_k_value), 0, 0, 1, 1}, {0, 0, 0, 0, 0, 0, 0} }; static int __Pyx_InitCachedBuiltins(void) { return 0; } static int __Pyx_InitCachedConstants(void) { __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__Pyx_InitCachedConstants", 0); /* "pygame_sdl2/mixer_music.pyx":87 * def get_pos(): * # TODO: Use a Mix_SetPostMix callback to track position. * raise error("Not implemented.") # <<<<<<<<<<<<<< * * def queue(fi): */ __pyx_tuple_ = PyTuple_Pack(1, __pyx_kp_u_Not_implemented); if (unlikely(!__pyx_tuple_)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 87; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_tuple_); __Pyx_GIVEREF(__pyx_tuple_); /* "pygame_sdl2/mixer_music.pyx":44 * * * def load(fi): # <<<<<<<<<<<<<< * global current_music * */ __pyx_tuple__2 = PyTuple_Pack(1, __pyx_n_s_fi); if (unlikely(!__pyx_tuple__2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 44; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_tuple__2); __Pyx_GIVEREF(__pyx_tuple__2); __pyx_codeobj__3 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__2, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_tom_ab_pygame_sdl2_src_pyg, __pyx_n_s_load, 44, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 44; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "pygame_sdl2/mixer_music.pyx":55 * raise error() * * def play(loops=0, double start=0.0): # <<<<<<<<<<<<<< * Mix_FadeInMusicPos(current_music, loops, 0, start) * */ __pyx_tuple__4 = PyTuple_Pack(2, __pyx_n_s_loops, __pyx_n_s_start); if (unlikely(!__pyx_tuple__4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 55; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_tuple__4); __Pyx_GIVEREF(__pyx_tuple__4); __pyx_codeobj__5 = (PyObject*)__Pyx_PyCode_New(2, 0, 2, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__4, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_tom_ab_pygame_sdl2_src_pyg, __pyx_n_s_play, 55, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 55; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "pygame_sdl2/mixer_music.pyx":61 * Mix_RewindMusic() * * def stop(): # <<<<<<<<<<<<<< * Mix_HaltMusic() * */ __pyx_codeobj__6 = (PyObject*)__Pyx_PyCode_New(0, 0, 0, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_tom_ab_pygame_sdl2_src_pyg, __pyx_n_s_stop, 61, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 61; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "pygame_sdl2/mixer_music.pyx":64 * Mix_HaltMusic() * * def pause(): # <<<<<<<<<<<<<< * Mix_PauseMusic() * */ __pyx_codeobj__7 = (PyObject*)__Pyx_PyCode_New(0, 0, 0, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_tom_ab_pygame_sdl2_src_pyg, __pyx_n_s_pause, 64, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 64; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "pygame_sdl2/mixer_music.pyx":67 * Mix_PauseMusic() * * def unpause(): # <<<<<<<<<<<<<< * Mix_ResumeMusic() * */ __pyx_codeobj__8 = (PyObject*)__Pyx_PyCode_New(0, 0, 0, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_tom_ab_pygame_sdl2_src_pyg, __pyx_n_s_unpause, 67, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 67; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "pygame_sdl2/mixer_music.pyx":70 * Mix_ResumeMusic() * * def fadeout(time): # <<<<<<<<<<<<<< * Mix_FadeOutMusic(time) * */ __pyx_tuple__9 = PyTuple_Pack(1, __pyx_n_s_time); if (unlikely(!__pyx_tuple__9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 70; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_tuple__9); __Pyx_GIVEREF(__pyx_tuple__9); __pyx_codeobj__10 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__9, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_tom_ab_pygame_sdl2_src_pyg, __pyx_n_s_fadeout, 70, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 70; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "pygame_sdl2/mixer_music.pyx":73 * Mix_FadeOutMusic(time) * * def set_volume(double value): # <<<<<<<<<<<<<< * Mix_VolumeMusic((MIX_MAX_VOLUME * value)) * */ __pyx_tuple__11 = PyTuple_Pack(2, __pyx_n_s_value, __pyx_n_s_value); if (unlikely(!__pyx_tuple__11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 73; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_tuple__11); __Pyx_GIVEREF(__pyx_tuple__11); __pyx_codeobj__12 = (PyObject*)__Pyx_PyCode_New(1, 0, 2, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__11, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_tom_ab_pygame_sdl2_src_pyg, __pyx_n_s_set_volume, 73, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__12)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 73; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "pygame_sdl2/mixer_music.pyx":76 * Mix_VolumeMusic((MIX_MAX_VOLUME * value)) * * def get_volume(): # <<<<<<<<<<<<<< * return Mix_VolumeMusic(-1) / MIX_MAX_VOLUME * */ __pyx_codeobj__13 = (PyObject*)__Pyx_PyCode_New(0, 0, 0, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_tom_ab_pygame_sdl2_src_pyg, __pyx_n_s_get_volume, 76, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__13)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 76; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "pygame_sdl2/mixer_music.pyx":79 * return Mix_VolumeMusic(-1) / MIX_MAX_VOLUME * * def get_busy(): # <<<<<<<<<<<<<< * return Mix_PlayingMusic() * */ __pyx_codeobj__14 = (PyObject*)__Pyx_PyCode_New(0, 0, 0, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_tom_ab_pygame_sdl2_src_pyg, __pyx_n_s_get_busy, 79, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__14)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 79; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "pygame_sdl2/mixer_music.pyx":82 * return Mix_PlayingMusic() * * def set_pos(double pos): # <<<<<<<<<<<<<< * Mix_SetMusicPosition(pos) * */ __pyx_tuple__15 = PyTuple_Pack(2, __pyx_n_s_pos, __pyx_n_s_pos); if (unlikely(!__pyx_tuple__15)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 82; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_tuple__15); __Pyx_GIVEREF(__pyx_tuple__15); __pyx_codeobj__16 = (PyObject*)__Pyx_PyCode_New(1, 0, 2, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__15, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_tom_ab_pygame_sdl2_src_pyg, __pyx_n_s_set_pos, 82, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__16)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 82; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "pygame_sdl2/mixer_music.pyx":85 * Mix_SetMusicPosition(pos) * * def get_pos(): # <<<<<<<<<<<<<< * # TODO: Use a Mix_SetPostMix callback to track position. * raise error("Not implemented.") */ __pyx_codeobj__17 = (PyObject*)__Pyx_PyCode_New(0, 0, 0, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_tom_ab_pygame_sdl2_src_pyg, __pyx_n_s_get_pos, 85, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__17)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 85; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "pygame_sdl2/mixer_music.pyx":89 * raise error("Not implemented.") * * def queue(fi): # <<<<<<<<<<<<<< * Mix_HookMusicFinished(music_finished) * if get_busy(): */ __pyx_tuple__18 = PyTuple_Pack(1, __pyx_n_s_fi); if (unlikely(!__pyx_tuple__18)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 89; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_tuple__18); __Pyx_GIVEREF(__pyx_tuple__18); __pyx_codeobj__19 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__18, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_tom_ab_pygame_sdl2_src_pyg, __pyx_n_s_queue, 89, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__19)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 89; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "pygame_sdl2/mixer_music.pyx":98 * play() * * def set_endevent(type=None): # <<<<<<<<<<<<<< * Mix_HookMusicFinished(music_finished) * global endevent */ __pyx_tuple__20 = PyTuple_Pack(1, __pyx_n_s_type); if (unlikely(!__pyx_tuple__20)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 98; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_tuple__20); __Pyx_GIVEREF(__pyx_tuple__20); __pyx_codeobj__21 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__20, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_tom_ab_pygame_sdl2_src_pyg, __pyx_n_s_set_endevent, 98, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__21)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 98; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "pygame_sdl2/mixer_music.pyx":103 * endevent = type or 0 * * def get_endevent(): # <<<<<<<<<<<<<< * return endevent */ __pyx_codeobj__22 = (PyObject*)__Pyx_PyCode_New(0, 0, 0, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_tom_ab_pygame_sdl2_src_pyg, __pyx_n_s_get_endevent, 103, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__22)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 103; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_RefNannyFinishContext(); return 0; __pyx_L1_error:; __Pyx_RefNannyFinishContext(); return -1; } static int __Pyx_InitGlobals(void) { if (__Pyx_InitStrings(__pyx_string_tab) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; __pyx_int_0 = PyInt_FromLong(0); if (unlikely(!__pyx_int_0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} return 0; __pyx_L1_error:; return -1; } #if PY_MAJOR_VERSION < 3 PyMODINIT_FUNC initmixer_music(void); /*proto*/ PyMODINIT_FUNC initmixer_music(void) #else PyMODINIT_FUNC PyInit_mixer_music(void); /*proto*/ PyMODINIT_FUNC PyInit_mixer_music(void) #endif { PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannyDeclarations #if CYTHON_REFNANNY __Pyx_RefNanny = __Pyx_RefNannyImportAPI("refnanny"); if (!__Pyx_RefNanny) { PyErr_Clear(); __Pyx_RefNanny = __Pyx_RefNannyImportAPI("Cython.Runtime.refnanny"); if (!__Pyx_RefNanny) Py_FatalError("failed to import 'refnanny' module"); } #endif __Pyx_RefNannySetupContext("PyMODINIT_FUNC PyInit_mixer_music(void)", 0); if (__Pyx_check_binary_version() < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_empty_tuple = PyTuple_New(0); if (unlikely(!__pyx_empty_tuple)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_empty_bytes = PyBytes_FromStringAndSize("", 0); if (unlikely(!__pyx_empty_bytes)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} #ifdef __Pyx_CyFunction_USED if (__pyx_CyFunction_init() < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} #endif #ifdef __Pyx_FusedFunction_USED if (__pyx_FusedFunction_init() < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} #endif #ifdef __Pyx_Coroutine_USED if (__pyx_Coroutine_init() < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} #endif #ifdef __Pyx_Generator_USED if (__pyx_Generator_init() < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} #endif #ifdef __Pyx_StopAsyncIteration_USED if (__pyx_StopAsyncIteration_init() < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} #endif /*--- Library function declarations ---*/ /*--- Threads initialization code ---*/ #if defined(__PYX_FORCE_INIT_THREADS) && __PYX_FORCE_INIT_THREADS #ifdef WITH_THREAD /* Python build with threading support? */ PyEval_InitThreads(); #endif #endif /*--- Module creation code ---*/ #if PY_MAJOR_VERSION < 3 __pyx_m = Py_InitModule4("mixer_music", __pyx_methods, 0, 0, PYTHON_API_VERSION); Py_XINCREF(__pyx_m); #else __pyx_m = PyModule_Create(&__pyx_moduledef); #endif if (unlikely(!__pyx_m)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_d = PyModule_GetDict(__pyx_m); if (unlikely(!__pyx_d)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} Py_INCREF(__pyx_d); __pyx_b = PyImport_AddModule(__Pyx_BUILTIN_MODULE_NAME); if (unlikely(!__pyx_b)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} #if CYTHON_COMPILING_IN_PYPY Py_INCREF(__pyx_b); #endif if (PyObject_SetAttrString(__pyx_m, "__builtins__", __pyx_b) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; /*--- Initialize various global constants etc. ---*/ if (__Pyx_InitGlobals() < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} #if PY_MAJOR_VERSION < 3 && (__PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT) if (__Pyx_init_sys_getdefaultencoding_params() < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} #endif if (__pyx_module_is_main_pygame_sdl2__mixer_music) { if (PyObject_SetAttrString(__pyx_m, "__name__", __pyx_n_s_main) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } #if PY_MAJOR_VERSION >= 3 { PyObject *modules = PyImport_GetModuleDict(); if (unlikely(!modules)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} if (!PyDict_GetItemString(modules, "pygame_sdl2.mixer_music")) { if (unlikely(PyDict_SetItemString(modules, "pygame_sdl2.mixer_music", __pyx_m) < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } } #endif /*--- Builtin init code ---*/ if (__Pyx_InitCachedBuiltins() < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /*--- Constants init code ---*/ if (__Pyx_InitCachedConstants() < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /*--- Global init code ---*/ __pyx_v_11pygame_sdl2_11mixer_music_queued_music = Py_None; Py_INCREF(Py_None); /*--- Variable export code ---*/ /*--- Function export code ---*/ /*--- Type init code ---*/ /*--- Type import code ---*/ /*--- Variable import code ---*/ /*--- Function import code ---*/ __pyx_t_1 = __Pyx_ImportModule("pygame_sdl2.rwobject"); if (!__pyx_t_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} if (__Pyx_ImportFunction(__pyx_t_1, "to_rwops", (void (**)(void))&__pyx_f_11pygame_sdl2_8rwobject_to_rwops, "SDL_RWops *(PyObject *, struct __pyx_opt_args_11pygame_sdl2_8rwobject_to_rwops *__pyx_optional_args)") < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} Py_DECREF(__pyx_t_1); __pyx_t_1 = 0; /*--- Execution code ---*/ #if defined(__Pyx_Generator_USED) || defined(__Pyx_Coroutine_USED) if (__Pyx_patch_abc() < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} #endif /* "pygame_sdl2/mixer_music.pyx":24 * from libc.string cimport memset * * from pygame_sdl2.error import error # <<<<<<<<<<<<<< * * cdef Mix_Music *current_music = NULL */ __pyx_t_2 = PyList_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 24; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __Pyx_INCREF(__pyx_n_s_error); __Pyx_GIVEREF(__pyx_n_s_error); PyList_SET_ITEM(__pyx_t_2, 0, __pyx_n_s_error); __pyx_t_3 = __Pyx_Import(__pyx_n_s_pygame_sdl2_error, __pyx_t_2, 0); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 24; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_2 = __Pyx_ImportFrom(__pyx_t_3, __pyx_n_s_error); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 24; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_error, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 24; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "pygame_sdl2/mixer_music.pyx":26 * from pygame_sdl2.error import error * * cdef Mix_Music *current_music = NULL # <<<<<<<<<<<<<< * cdef object queued_music = None * cdef int endevent = 0 */ __pyx_v_11pygame_sdl2_11mixer_music_current_music = NULL; /* "pygame_sdl2/mixer_music.pyx":27 * * cdef Mix_Music *current_music = NULL * cdef object queued_music = None # <<<<<<<<<<<<<< * cdef int endevent = 0 * */ __Pyx_INCREF(Py_None); __Pyx_XGOTREF(__pyx_v_11pygame_sdl2_11mixer_music_queued_music); __Pyx_DECREF_SET(__pyx_v_11pygame_sdl2_11mixer_music_queued_music, Py_None); __Pyx_GIVEREF(Py_None); /* "pygame_sdl2/mixer_music.pyx":28 * cdef Mix_Music *current_music = NULL * cdef object queued_music = None * cdef int endevent = 0 # <<<<<<<<<<<<<< * * cdef void music_finished(): */ __pyx_v_11pygame_sdl2_11mixer_music_endevent = 0; /* "pygame_sdl2/mixer_music.pyx":44 * * * def load(fi): # <<<<<<<<<<<<<< * global current_music * */ __pyx_t_3 = PyCFunction_NewEx(&__pyx_mdef_11pygame_sdl2_11mixer_music_1load, NULL, __pyx_n_s_pygame_sdl2_mixer_music); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 44; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); if (PyDict_SetItem(__pyx_d, __pyx_n_s_load, __pyx_t_3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 44; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "pygame_sdl2/mixer_music.pyx":55 * raise error() * * def play(loops=0, double start=0.0): # <<<<<<<<<<<<<< * Mix_FadeInMusicPos(current_music, loops, 0, start) * */ __pyx_t_3 = PyCFunction_NewEx(&__pyx_mdef_11pygame_sdl2_11mixer_music_3play, NULL, __pyx_n_s_pygame_sdl2_mixer_music); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 55; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); if (PyDict_SetItem(__pyx_d, __pyx_n_s_play, __pyx_t_3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 55; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "pygame_sdl2/mixer_music.pyx":61 * Mix_RewindMusic() * * def stop(): # <<<<<<<<<<<<<< * Mix_HaltMusic() * */ __pyx_t_3 = PyCFunction_NewEx(&__pyx_mdef_11pygame_sdl2_11mixer_music_7stop, NULL, __pyx_n_s_pygame_sdl2_mixer_music); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 61; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); if (PyDict_SetItem(__pyx_d, __pyx_n_s_stop, __pyx_t_3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 61; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "pygame_sdl2/mixer_music.pyx":64 * Mix_HaltMusic() * * def pause(): # <<<<<<<<<<<<<< * Mix_PauseMusic() * */ __pyx_t_3 = PyCFunction_NewEx(&__pyx_mdef_11pygame_sdl2_11mixer_music_9pause, NULL, __pyx_n_s_pygame_sdl2_mixer_music); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 64; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); if (PyDict_SetItem(__pyx_d, __pyx_n_s_pause, __pyx_t_3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 64; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "pygame_sdl2/mixer_music.pyx":67 * Mix_PauseMusic() * * def unpause(): # <<<<<<<<<<<<<< * Mix_ResumeMusic() * */ __pyx_t_3 = PyCFunction_NewEx(&__pyx_mdef_11pygame_sdl2_11mixer_music_11unpause, NULL, __pyx_n_s_pygame_sdl2_mixer_music); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 67; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); if (PyDict_SetItem(__pyx_d, __pyx_n_s_unpause, __pyx_t_3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 67; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "pygame_sdl2/mixer_music.pyx":70 * Mix_ResumeMusic() * * def fadeout(time): # <<<<<<<<<<<<<< * Mix_FadeOutMusic(time) * */ __pyx_t_3 = PyCFunction_NewEx(&__pyx_mdef_11pygame_sdl2_11mixer_music_13fadeout, NULL, __pyx_n_s_pygame_sdl2_mixer_music); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 70; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); if (PyDict_SetItem(__pyx_d, __pyx_n_s_fadeout, __pyx_t_3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 70; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "pygame_sdl2/mixer_music.pyx":73 * Mix_FadeOutMusic(time) * * def set_volume(double value): # <<<<<<<<<<<<<< * Mix_VolumeMusic((MIX_MAX_VOLUME * value)) * */ __pyx_t_3 = PyCFunction_NewEx(&__pyx_mdef_11pygame_sdl2_11mixer_music_15set_volume, NULL, __pyx_n_s_pygame_sdl2_mixer_music); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 73; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); if (PyDict_SetItem(__pyx_d, __pyx_n_s_set_volume, __pyx_t_3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 73; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "pygame_sdl2/mixer_music.pyx":76 * Mix_VolumeMusic((MIX_MAX_VOLUME * value)) * * def get_volume(): # <<<<<<<<<<<<<< * return Mix_VolumeMusic(-1) / MIX_MAX_VOLUME * */ __pyx_t_3 = PyCFunction_NewEx(&__pyx_mdef_11pygame_sdl2_11mixer_music_17get_volume, NULL, __pyx_n_s_pygame_sdl2_mixer_music); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 76; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); if (PyDict_SetItem(__pyx_d, __pyx_n_s_get_volume, __pyx_t_3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 76; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "pygame_sdl2/mixer_music.pyx":79 * return Mix_VolumeMusic(-1) / MIX_MAX_VOLUME * * def get_busy(): # <<<<<<<<<<<<<< * return Mix_PlayingMusic() * */ __pyx_t_3 = PyCFunction_NewEx(&__pyx_mdef_11pygame_sdl2_11mixer_music_19get_busy, NULL, __pyx_n_s_pygame_sdl2_mixer_music); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 79; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); if (PyDict_SetItem(__pyx_d, __pyx_n_s_get_busy, __pyx_t_3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 79; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "pygame_sdl2/mixer_music.pyx":82 * return Mix_PlayingMusic() * * def set_pos(double pos): # <<<<<<<<<<<<<< * Mix_SetMusicPosition(pos) * */ __pyx_t_3 = PyCFunction_NewEx(&__pyx_mdef_11pygame_sdl2_11mixer_music_21set_pos, NULL, __pyx_n_s_pygame_sdl2_mixer_music); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 82; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); if (PyDict_SetItem(__pyx_d, __pyx_n_s_set_pos, __pyx_t_3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 82; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "pygame_sdl2/mixer_music.pyx":85 * Mix_SetMusicPosition(pos) * * def get_pos(): # <<<<<<<<<<<<<< * # TODO: Use a Mix_SetPostMix callback to track position. * raise error("Not implemented.") */ __pyx_t_3 = PyCFunction_NewEx(&__pyx_mdef_11pygame_sdl2_11mixer_music_23get_pos, NULL, __pyx_n_s_pygame_sdl2_mixer_music); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 85; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); if (PyDict_SetItem(__pyx_d, __pyx_n_s_get_pos, __pyx_t_3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 85; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "pygame_sdl2/mixer_music.pyx":89 * raise error("Not implemented.") * * def queue(fi): # <<<<<<<<<<<<<< * Mix_HookMusicFinished(music_finished) * if get_busy(): */ __pyx_t_3 = PyCFunction_NewEx(&__pyx_mdef_11pygame_sdl2_11mixer_music_25queue, NULL, __pyx_n_s_pygame_sdl2_mixer_music); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 89; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); if (PyDict_SetItem(__pyx_d, __pyx_n_s_queue, __pyx_t_3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 89; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "pygame_sdl2/mixer_music.pyx":98 * play() * * def set_endevent(type=None): # <<<<<<<<<<<<<< * Mix_HookMusicFinished(music_finished) * global endevent */ __pyx_t_3 = PyCFunction_NewEx(&__pyx_mdef_11pygame_sdl2_11mixer_music_27set_endevent, NULL, __pyx_n_s_pygame_sdl2_mixer_music); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 98; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); if (PyDict_SetItem(__pyx_d, __pyx_n_s_set_endevent, __pyx_t_3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 98; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "pygame_sdl2/mixer_music.pyx":103 * endevent = type or 0 * * def get_endevent(): # <<<<<<<<<<<<<< * return endevent */ __pyx_t_3 = PyCFunction_NewEx(&__pyx_mdef_11pygame_sdl2_11mixer_music_29get_endevent, NULL, __pyx_n_s_pygame_sdl2_mixer_music); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 103; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); if (PyDict_SetItem(__pyx_d, __pyx_n_s_get_endevent, __pyx_t_3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 103; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "pygame_sdl2/mixer_music.pyx":1 * # Copyright 2014 Patrick Dawson # <<<<<<<<<<<<<< * # * # This software is provided 'as-is', without any express or implied */ __pyx_t_3 = PyDict_New(); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); if (PyDict_SetItem(__pyx_d, __pyx_n_s_test, __pyx_t_3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /*--- Wrapped vars code ---*/ goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); if (__pyx_m) { if (__pyx_d) { __Pyx_AddTraceback("init pygame_sdl2.mixer_music", __pyx_clineno, __pyx_lineno, __pyx_filename); } Py_DECREF(__pyx_m); __pyx_m = 0; } else if (!PyErr_Occurred()) { PyErr_SetString(PyExc_ImportError, "init pygame_sdl2.mixer_music"); } __pyx_L0:; __Pyx_RefNannyFinishContext(); #if PY_MAJOR_VERSION < 3 return; #else return __pyx_m; #endif } /* --- Runtime support code --- */ #if CYTHON_REFNANNY static __Pyx_RefNannyAPIStruct *__Pyx_RefNannyImportAPI(const char *modname) { PyObject *m = NULL, *p = NULL; void *r = NULL; m = PyImport_ImportModule((char *)modname); if (!m) goto end; p = PyObject_GetAttrString(m, (char *)"RefNannyAPI"); if (!p) goto end; r = PyLong_AsVoidPtr(p); end: Py_XDECREF(p); Py_XDECREF(m); return (__Pyx_RefNannyAPIStruct *)r; } #endif static PyObject *__Pyx_GetBuiltinName(PyObject *name) { PyObject* result = __Pyx_PyObject_GetAttrStr(__pyx_b, name); if (unlikely(!result)) { PyErr_Format(PyExc_NameError, #if PY_MAJOR_VERSION >= 3 "name '%U' is not defined", name); #else "name '%.200s' is not defined", PyString_AS_STRING(name)); #endif } return result; } static CYTHON_INLINE PyObject *__Pyx_GetModuleGlobalName(PyObject *name) { PyObject *result; #if CYTHON_COMPILING_IN_CPYTHON result = PyDict_GetItem(__pyx_d, name); if (likely(result)) { Py_INCREF(result); } else { #else result = PyObject_GetItem(__pyx_d, name); if (!result) { PyErr_Clear(); #endif result = __Pyx_GetBuiltinName(name); } return result; } #if CYTHON_COMPILING_IN_CPYTHON static CYTHON_INLINE PyObject* __Pyx_PyObject_Call(PyObject *func, PyObject *arg, PyObject *kw) { PyObject *result; ternaryfunc call = func->ob_type->tp_call; if (unlikely(!call)) return PyObject_Call(func, arg, kw); if (unlikely(Py_EnterRecursiveCall((char*)" while calling a Python object"))) return NULL; result = (*call)(func, arg, kw); Py_LeaveRecursiveCall(); if (unlikely(!result) && unlikely(!PyErr_Occurred())) { PyErr_SetString( PyExc_SystemError, "NULL result without error in PyObject_Call"); } return result; } #endif #if CYTHON_COMPILING_IN_CPYTHON static CYTHON_INLINE PyObject* __Pyx_PyObject_CallMethO(PyObject *func, PyObject *arg) { PyObject *self, *result; PyCFunction cfunc; cfunc = PyCFunction_GET_FUNCTION(func); self = PyCFunction_GET_SELF(func); if (unlikely(Py_EnterRecursiveCall((char*)" while calling a Python object"))) return NULL; result = cfunc(self, arg); Py_LeaveRecursiveCall(); if (unlikely(!result) && unlikely(!PyErr_Occurred())) { PyErr_SetString( PyExc_SystemError, "NULL result without error in PyObject_Call"); } return result; } #endif #if CYTHON_COMPILING_IN_CPYTHON static PyObject* __Pyx__PyObject_CallOneArg(PyObject *func, PyObject *arg) { PyObject *result; PyObject *args = PyTuple_New(1); if (unlikely(!args)) return NULL; Py_INCREF(arg); PyTuple_SET_ITEM(args, 0, arg); result = __Pyx_PyObject_Call(func, args, NULL); Py_DECREF(args); return result; } static CYTHON_INLINE PyObject* __Pyx_PyObject_CallOneArg(PyObject *func, PyObject *arg) { #ifdef __Pyx_CyFunction_USED if (likely(PyCFunction_Check(func) || PyObject_TypeCheck(func, __pyx_CyFunctionType))) { #else if (likely(PyCFunction_Check(func))) { #endif if (likely(PyCFunction_GET_FLAGS(func) & METH_O)) { return __Pyx_PyObject_CallMethO(func, arg); } } return __Pyx__PyObject_CallOneArg(func, arg); } #else static CYTHON_INLINE PyObject* __Pyx_PyObject_CallOneArg(PyObject *func, PyObject *arg) { PyObject* args = PyTuple_Pack(1, arg); return (likely(args)) ? __Pyx_PyObject_Call(func, args, NULL) : NULL; } #endif #if CYTHON_COMPILING_IN_CPYTHON static CYTHON_INLINE PyObject* __Pyx_PyObject_CallNoArg(PyObject *func) { #ifdef __Pyx_CyFunction_USED if (likely(PyCFunction_Check(func) || PyObject_TypeCheck(func, __pyx_CyFunctionType))) { #else if (likely(PyCFunction_Check(func))) { #endif if (likely(PyCFunction_GET_FLAGS(func) & METH_NOARGS)) { return __Pyx_PyObject_CallMethO(func, NULL); } } return __Pyx_PyObject_Call(func, __pyx_empty_tuple, NULL); } #endif static CYTHON_INLINE void __Pyx_ErrRestore(PyObject *type, PyObject *value, PyObject *tb) { #if CYTHON_COMPILING_IN_CPYTHON PyObject *tmp_type, *tmp_value, *tmp_tb; PyThreadState *tstate = PyThreadState_GET(); tmp_type = tstate->curexc_type; tmp_value = tstate->curexc_value; tmp_tb = tstate->curexc_traceback; tstate->curexc_type = type; tstate->curexc_value = value; tstate->curexc_traceback = tb; Py_XDECREF(tmp_type); Py_XDECREF(tmp_value); Py_XDECREF(tmp_tb); #else PyErr_Restore(type, value, tb); #endif } static CYTHON_INLINE void __Pyx_ErrFetch(PyObject **type, PyObject **value, PyObject **tb) { #if CYTHON_COMPILING_IN_CPYTHON PyThreadState *tstate = PyThreadState_GET(); *type = tstate->curexc_type; *value = tstate->curexc_value; *tb = tstate->curexc_traceback; tstate->curexc_type = 0; tstate->curexc_value = 0; tstate->curexc_traceback = 0; #else PyErr_Fetch(type, value, tb); #endif } static void __Pyx_WriteUnraisable(const char *name, CYTHON_UNUSED int clineno, CYTHON_UNUSED int lineno, CYTHON_UNUSED const char *filename, int full_traceback, CYTHON_UNUSED int nogil) { PyObject *old_exc, *old_val, *old_tb; PyObject *ctx; #ifdef WITH_THREAD PyGILState_STATE state; if (nogil) state = PyGILState_Ensure(); #endif __Pyx_ErrFetch(&old_exc, &old_val, &old_tb); if (full_traceback) { Py_XINCREF(old_exc); Py_XINCREF(old_val); Py_XINCREF(old_tb); __Pyx_ErrRestore(old_exc, old_val, old_tb); PyErr_PrintEx(1); } #if PY_MAJOR_VERSION < 3 ctx = PyString_FromString(name); #else ctx = PyUnicode_FromString(name); #endif __Pyx_ErrRestore(old_exc, old_val, old_tb); if (!ctx) { PyErr_WriteUnraisable(Py_None); } else { PyErr_WriteUnraisable(ctx); Py_DECREF(ctx); } #ifdef WITH_THREAD if (nogil) PyGILState_Release(state); #endif } #if PY_MAJOR_VERSION < 3 static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, CYTHON_UNUSED PyObject *cause) { Py_XINCREF(type); if (!value || value == Py_None) value = NULL; else Py_INCREF(value); if (!tb || tb == Py_None) tb = NULL; else { Py_INCREF(tb); if (!PyTraceBack_Check(tb)) { PyErr_SetString(PyExc_TypeError, "raise: arg 3 must be a traceback or None"); goto raise_error; } } if (PyType_Check(type)) { #if CYTHON_COMPILING_IN_PYPY if (!value) { Py_INCREF(Py_None); value = Py_None; } #endif PyErr_NormalizeException(&type, &value, &tb); } else { if (value) { PyErr_SetString(PyExc_TypeError, "instance exception may not have a separate value"); goto raise_error; } value = type; type = (PyObject*) Py_TYPE(type); Py_INCREF(type); if (!PyType_IsSubtype((PyTypeObject *)type, (PyTypeObject *)PyExc_BaseException)) { PyErr_SetString(PyExc_TypeError, "raise: exception class must be a subclass of BaseException"); goto raise_error; } } __Pyx_ErrRestore(type, value, tb); return; raise_error: Py_XDECREF(value); Py_XDECREF(type); Py_XDECREF(tb); return; } #else static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, PyObject *cause) { PyObject* owned_instance = NULL; if (tb == Py_None) { tb = 0; } else if (tb && !PyTraceBack_Check(tb)) { PyErr_SetString(PyExc_TypeError, "raise: arg 3 must be a traceback or None"); goto bad; } if (value == Py_None) value = 0; if (PyExceptionInstance_Check(type)) { if (value) { PyErr_SetString(PyExc_TypeError, "instance exception may not have a separate value"); goto bad; } value = type; type = (PyObject*) Py_TYPE(value); } else if (PyExceptionClass_Check(type)) { PyObject *instance_class = NULL; if (value && PyExceptionInstance_Check(value)) { instance_class = (PyObject*) Py_TYPE(value); if (instance_class != type) { int is_subclass = PyObject_IsSubclass(instance_class, type); if (!is_subclass) { instance_class = NULL; } else if (unlikely(is_subclass == -1)) { goto bad; } else { type = instance_class; } } } if (!instance_class) { PyObject *args; if (!value) args = PyTuple_New(0); else if (PyTuple_Check(value)) { Py_INCREF(value); args = value; } else args = PyTuple_Pack(1, value); if (!args) goto bad; owned_instance = PyObject_Call(type, args, NULL); Py_DECREF(args); if (!owned_instance) goto bad; value = owned_instance; if (!PyExceptionInstance_Check(value)) { PyErr_Format(PyExc_TypeError, "calling %R should have returned an instance of " "BaseException, not %R", type, Py_TYPE(value)); goto bad; } } } else { PyErr_SetString(PyExc_TypeError, "raise: exception class must be a subclass of BaseException"); goto bad; } #if PY_VERSION_HEX >= 0x03030000 if (cause) { #else if (cause && cause != Py_None) { #endif PyObject *fixed_cause; if (cause == Py_None) { fixed_cause = NULL; } else if (PyExceptionClass_Check(cause)) { fixed_cause = PyObject_CallObject(cause, NULL); if (fixed_cause == NULL) goto bad; } else if (PyExceptionInstance_Check(cause)) { fixed_cause = cause; Py_INCREF(fixed_cause); } else { PyErr_SetString(PyExc_TypeError, "exception causes must derive from " "BaseException"); goto bad; } PyException_SetCause(value, fixed_cause); } PyErr_SetObject(type, value); if (tb) { #if CYTHON_COMPILING_IN_PYPY PyObject *tmp_type, *tmp_value, *tmp_tb; PyErr_Fetch(&tmp_type, &tmp_value, &tmp_tb); Py_INCREF(tb); PyErr_Restore(tmp_type, tmp_value, tb); Py_XDECREF(tmp_tb); #else PyThreadState *tstate = PyThreadState_GET(); PyObject* tmp_tb = tstate->curexc_traceback; if (tb != tmp_tb) { Py_INCREF(tb); tstate->curexc_traceback = tb; Py_XDECREF(tmp_tb); } #endif } bad: Py_XDECREF(owned_instance); return; } #endif static void __Pyx_RaiseDoubleKeywordsError( const char* func_name, PyObject* kw_name) { PyErr_Format(PyExc_TypeError, #if PY_MAJOR_VERSION >= 3 "%s() got multiple values for keyword argument '%U'", func_name, kw_name); #else "%s() got multiple values for keyword argument '%s'", func_name, PyString_AsString(kw_name)); #endif } static int __Pyx_ParseOptionalKeywords( PyObject *kwds, PyObject **argnames[], PyObject *kwds2, PyObject *values[], Py_ssize_t num_pos_args, const char* function_name) { PyObject *key = 0, *value = 0; Py_ssize_t pos = 0; PyObject*** name; PyObject*** first_kw_arg = argnames + num_pos_args; while (PyDict_Next(kwds, &pos, &key, &value)) { name = first_kw_arg; while (*name && (**name != key)) name++; if (*name) { values[name-argnames] = value; continue; } name = first_kw_arg; #if PY_MAJOR_VERSION < 3 if (likely(PyString_CheckExact(key)) || likely(PyString_Check(key))) { while (*name) { if ((CYTHON_COMPILING_IN_PYPY || PyString_GET_SIZE(**name) == PyString_GET_SIZE(key)) && _PyString_Eq(**name, key)) { values[name-argnames] = value; break; } name++; } if (*name) continue; else { PyObject*** argname = argnames; while (argname != first_kw_arg) { if ((**argname == key) || ( (CYTHON_COMPILING_IN_PYPY || PyString_GET_SIZE(**argname) == PyString_GET_SIZE(key)) && _PyString_Eq(**argname, key))) { goto arg_passed_twice; } argname++; } } } else #endif if (likely(PyUnicode_Check(key))) { while (*name) { int cmp = (**name == key) ? 0 : #if !CYTHON_COMPILING_IN_PYPY && PY_MAJOR_VERSION >= 3 (PyUnicode_GET_SIZE(**name) != PyUnicode_GET_SIZE(key)) ? 1 : #endif PyUnicode_Compare(**name, key); if (cmp < 0 && unlikely(PyErr_Occurred())) goto bad; if (cmp == 0) { values[name-argnames] = value; break; } name++; } if (*name) continue; else { PyObject*** argname = argnames; while (argname != first_kw_arg) { int cmp = (**argname == key) ? 0 : #if !CYTHON_COMPILING_IN_PYPY && PY_MAJOR_VERSION >= 3 (PyUnicode_GET_SIZE(**argname) != PyUnicode_GET_SIZE(key)) ? 1 : #endif PyUnicode_Compare(**argname, key); if (cmp < 0 && unlikely(PyErr_Occurred())) goto bad; if (cmp == 0) goto arg_passed_twice; argname++; } } } else goto invalid_keyword_type; if (kwds2) { if (unlikely(PyDict_SetItem(kwds2, key, value))) goto bad; } else { goto invalid_keyword; } } return 0; arg_passed_twice: __Pyx_RaiseDoubleKeywordsError(function_name, key); goto bad; invalid_keyword_type: PyErr_Format(PyExc_TypeError, "%.200s() keywords must be strings", function_name); goto bad; invalid_keyword: PyErr_Format(PyExc_TypeError, #if PY_MAJOR_VERSION < 3 "%.200s() got an unexpected keyword argument '%.200s'", function_name, PyString_AsString(key)); #else "%s() got an unexpected keyword argument '%U'", function_name, key); #endif bad: return -1; } static void __Pyx_RaiseArgtupleInvalid( const char* func_name, int exact, Py_ssize_t num_min, Py_ssize_t num_max, Py_ssize_t num_found) { Py_ssize_t num_expected; const char *more_or_less; if (num_found < num_min) { num_expected = num_min; more_or_less = "at least"; } else { num_expected = num_max; more_or_less = "at most"; } if (exact) { more_or_less = "exactly"; } PyErr_Format(PyExc_TypeError, "%.200s() takes %.8s %" CYTHON_FORMAT_SSIZE_T "d positional argument%.1s (%" CYTHON_FORMAT_SSIZE_T "d given)", func_name, more_or_less, num_expected, (num_expected == 1) ? "" : "s", num_found); } static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list, int level) { PyObject *empty_list = 0; PyObject *module = 0; PyObject *global_dict = 0; PyObject *empty_dict = 0; PyObject *list; #if PY_VERSION_HEX < 0x03030000 PyObject *py_import; py_import = __Pyx_PyObject_GetAttrStr(__pyx_b, __pyx_n_s_import); if (!py_import) goto bad; #endif if (from_list) list = from_list; else { empty_list = PyList_New(0); if (!empty_list) goto bad; list = empty_list; } global_dict = PyModule_GetDict(__pyx_m); if (!global_dict) goto bad; empty_dict = PyDict_New(); if (!empty_dict) goto bad; { #if PY_MAJOR_VERSION >= 3 if (level == -1) { if (strchr(__Pyx_MODULE_NAME, '.')) { #if PY_VERSION_HEX < 0x03030000 PyObject *py_level = PyInt_FromLong(1); if (!py_level) goto bad; module = PyObject_CallFunctionObjArgs(py_import, name, global_dict, empty_dict, list, py_level, NULL); Py_DECREF(py_level); #else module = PyImport_ImportModuleLevelObject( name, global_dict, empty_dict, list, 1); #endif if (!module) { if (!PyErr_ExceptionMatches(PyExc_ImportError)) goto bad; PyErr_Clear(); } } level = 0; } #endif if (!module) { #if PY_VERSION_HEX < 0x03030000 PyObject *py_level = PyInt_FromLong(level); if (!py_level) goto bad; module = PyObject_CallFunctionObjArgs(py_import, name, global_dict, empty_dict, list, py_level, NULL); Py_DECREF(py_level); #else module = PyImport_ImportModuleLevelObject( name, global_dict, empty_dict, list, level); #endif } } bad: #if PY_VERSION_HEX < 0x03030000 Py_XDECREF(py_import); #endif Py_XDECREF(empty_list); Py_XDECREF(empty_dict); return module; } static PyObject* __Pyx_ImportFrom(PyObject* module, PyObject* name) { PyObject* value = __Pyx_PyObject_GetAttrStr(module, name); if (unlikely(!value) && PyErr_ExceptionMatches(PyExc_AttributeError)) { PyErr_Format(PyExc_ImportError, #if PY_MAJOR_VERSION < 3 "cannot import name %.230s", PyString_AS_STRING(name)); #else "cannot import name %S", name); #endif } return value; } static int __pyx_bisect_code_objects(__Pyx_CodeObjectCacheEntry* entries, int count, int code_line) { int start = 0, mid = 0, end = count - 1; if (end >= 0 && code_line > entries[end].code_line) { return count; } while (start < end) { mid = start + (end - start) / 2; if (code_line < entries[mid].code_line) { end = mid; } else if (code_line > entries[mid].code_line) { start = mid + 1; } else { return mid; } } if (code_line <= entries[mid].code_line) { return mid; } else { return mid + 1; } } static PyCodeObject *__pyx_find_code_object(int code_line) { PyCodeObject* code_object; int pos; if (unlikely(!code_line) || unlikely(!__pyx_code_cache.entries)) { return NULL; } pos = __pyx_bisect_code_objects(__pyx_code_cache.entries, __pyx_code_cache.count, code_line); if (unlikely(pos >= __pyx_code_cache.count) || unlikely(__pyx_code_cache.entries[pos].code_line != code_line)) { return NULL; } code_object = __pyx_code_cache.entries[pos].code_object; Py_INCREF(code_object); return code_object; } static void __pyx_insert_code_object(int code_line, PyCodeObject* code_object) { int pos, i; __Pyx_CodeObjectCacheEntry* entries = __pyx_code_cache.entries; if (unlikely(!code_line)) { return; } if (unlikely(!entries)) { entries = (__Pyx_CodeObjectCacheEntry*)PyMem_Malloc(64*sizeof(__Pyx_CodeObjectCacheEntry)); if (likely(entries)) { __pyx_code_cache.entries = entries; __pyx_code_cache.max_count = 64; __pyx_code_cache.count = 1; entries[0].code_line = code_line; entries[0].code_object = code_object; Py_INCREF(code_object); } return; } pos = __pyx_bisect_code_objects(__pyx_code_cache.entries, __pyx_code_cache.count, code_line); if ((pos < __pyx_code_cache.count) && unlikely(__pyx_code_cache.entries[pos].code_line == code_line)) { PyCodeObject* tmp = entries[pos].code_object; entries[pos].code_object = code_object; Py_DECREF(tmp); return; } if (__pyx_code_cache.count == __pyx_code_cache.max_count) { int new_max = __pyx_code_cache.max_count + 64; entries = (__Pyx_CodeObjectCacheEntry*)PyMem_Realloc( __pyx_code_cache.entries, (size_t)new_max*sizeof(__Pyx_CodeObjectCacheEntry)); if (unlikely(!entries)) { return; } __pyx_code_cache.entries = entries; __pyx_code_cache.max_count = new_max; } for (i=__pyx_code_cache.count; i>pos; i--) { entries[i] = entries[i-1]; } entries[pos].code_line = code_line; entries[pos].code_object = code_object; __pyx_code_cache.count++; Py_INCREF(code_object); } #include "compile.h" #include "frameobject.h" #include "traceback.h" static PyCodeObject* __Pyx_CreateCodeObjectForTraceback( const char *funcname, int c_line, int py_line, const char *filename) { PyCodeObject *py_code = 0; PyObject *py_srcfile = 0; PyObject *py_funcname = 0; #if PY_MAJOR_VERSION < 3 py_srcfile = PyString_FromString(filename); #else py_srcfile = PyUnicode_FromString(filename); #endif if (!py_srcfile) goto bad; if (c_line) { #if PY_MAJOR_VERSION < 3 py_funcname = PyString_FromFormat( "%s (%s:%d)", funcname, __pyx_cfilenm, c_line); #else py_funcname = PyUnicode_FromFormat( "%s (%s:%d)", funcname, __pyx_cfilenm, c_line); #endif } else { #if PY_MAJOR_VERSION < 3 py_funcname = PyString_FromString(funcname); #else py_funcname = PyUnicode_FromString(funcname); #endif } if (!py_funcname) goto bad; py_code = __Pyx_PyCode_New( 0, 0, 0, 0, 0, __pyx_empty_bytes, /*PyObject *code,*/ __pyx_empty_tuple, /*PyObject *consts,*/ __pyx_empty_tuple, /*PyObject *names,*/ __pyx_empty_tuple, /*PyObject *varnames,*/ __pyx_empty_tuple, /*PyObject *freevars,*/ __pyx_empty_tuple, /*PyObject *cellvars,*/ py_srcfile, /*PyObject *filename,*/ py_funcname, /*PyObject *name,*/ py_line, __pyx_empty_bytes /*PyObject *lnotab*/ ); Py_DECREF(py_srcfile); Py_DECREF(py_funcname); return py_code; bad: Py_XDECREF(py_srcfile); Py_XDECREF(py_funcname); return NULL; } static void __Pyx_AddTraceback(const char *funcname, int c_line, int py_line, const char *filename) { PyCodeObject *py_code = 0; PyFrameObject *py_frame = 0; py_code = __pyx_find_code_object(c_line ? c_line : py_line); if (!py_code) { py_code = __Pyx_CreateCodeObjectForTraceback( funcname, c_line, py_line, filename); if (!py_code) goto bad; __pyx_insert_code_object(c_line ? c_line : py_line, py_code); } py_frame = PyFrame_New( PyThreadState_GET(), /*PyThreadState *tstate,*/ py_code, /*PyCodeObject *code,*/ __pyx_d, /*PyObject *globals,*/ 0 /*PyObject *locals*/ ); if (!py_frame) goto bad; py_frame->f_lineno = py_line; PyTraceBack_Here(py_frame); bad: Py_XDECREF(py_code); Py_XDECREF(py_frame); } #define __PYX_VERIFY_RETURN_INT(target_type, func_type, func_value)\ __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, 0) #define __PYX_VERIFY_RETURN_INT_EXC(target_type, func_type, func_value)\ __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, 1) #define __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, exc)\ {\ func_type value = func_value;\ if (sizeof(target_type) < sizeof(func_type)) {\ if (unlikely(value != (func_type) (target_type) value)) {\ func_type zero = 0;\ if (exc && unlikely(value == (func_type)-1 && PyErr_Occurred()))\ return (target_type) -1;\ if (is_unsigned && unlikely(value < zero))\ goto raise_neg_overflow;\ else\ goto raise_overflow;\ }\ }\ return (target_type) value;\ } #if CYTHON_USE_PYLONG_INTERNALS #include "longintrepr.h" #endif static CYTHON_INLINE int __Pyx_PyInt_As_int(PyObject *x) { const int neg_one = (int) -1, const_zero = (int) 0; const int is_unsigned = neg_one > const_zero; #if PY_MAJOR_VERSION < 3 if (likely(PyInt_Check(x))) { if (sizeof(int) < sizeof(long)) { __PYX_VERIFY_RETURN_INT(int, long, PyInt_AS_LONG(x)) } else { long val = PyInt_AS_LONG(x); if (is_unsigned && unlikely(val < 0)) { goto raise_neg_overflow; } return (int) val; } } else #endif if (likely(PyLong_Check(x))) { if (is_unsigned) { #if CYTHON_USE_PYLONG_INTERNALS const digit* digits = ((PyLongObject*)x)->ob_digit; switch (Py_SIZE(x)) { case 0: return (int) 0; case 1: __PYX_VERIFY_RETURN_INT(int, digit, digits[0]) case 2: if (8 * sizeof(int) > 1 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(int) >= 2 * PyLong_SHIFT) { return (int) (((((int)digits[1]) << PyLong_SHIFT) | (int)digits[0])); } } break; case 3: if (8 * sizeof(int) > 2 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(int) >= 3 * PyLong_SHIFT) { return (int) (((((((int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0])); } } break; case 4: if (8 * sizeof(int) > 3 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(int) >= 4 * PyLong_SHIFT) { return (int) (((((((((int)digits[3]) << PyLong_SHIFT) | (int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0])); } } break; } #endif #if CYTHON_COMPILING_IN_CPYTHON if (unlikely(Py_SIZE(x) < 0)) { goto raise_neg_overflow; } #else { int result = PyObject_RichCompareBool(x, Py_False, Py_LT); if (unlikely(result < 0)) return (int) -1; if (unlikely(result == 1)) goto raise_neg_overflow; } #endif if (sizeof(int) <= sizeof(unsigned long)) { __PYX_VERIFY_RETURN_INT_EXC(int, unsigned long, PyLong_AsUnsignedLong(x)) } else if (sizeof(int) <= sizeof(unsigned PY_LONG_LONG)) { __PYX_VERIFY_RETURN_INT_EXC(int, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x)) } } else { #if CYTHON_USE_PYLONG_INTERNALS const digit* digits = ((PyLongObject*)x)->ob_digit; switch (Py_SIZE(x)) { case 0: return (int) 0; case -1: __PYX_VERIFY_RETURN_INT(int, sdigit, -(sdigit) digits[0]) case 1: __PYX_VERIFY_RETURN_INT(int, digit, +digits[0]) case -2: if (8 * sizeof(int) - 1 > 1 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(int, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(int) - 1 > 2 * PyLong_SHIFT) { return (int) (((int)-1)*(((((int)digits[1]) << PyLong_SHIFT) | (int)digits[0]))); } } break; case 2: if (8 * sizeof(int) > 1 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(int) - 1 > 2 * PyLong_SHIFT) { return (int) ((((((int)digits[1]) << PyLong_SHIFT) | (int)digits[0]))); } } break; case -3: if (8 * sizeof(int) - 1 > 2 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(int, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(int) - 1 > 3 * PyLong_SHIFT) { return (int) (((int)-1)*(((((((int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0]))); } } break; case 3: if (8 * sizeof(int) > 2 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(int) - 1 > 3 * PyLong_SHIFT) { return (int) ((((((((int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0]))); } } break; case -4: if (8 * sizeof(int) - 1 > 3 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(int, long, -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(int) - 1 > 4 * PyLong_SHIFT) { return (int) (((int)-1)*(((((((((int)digits[3]) << PyLong_SHIFT) | (int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0]))); } } break; case 4: if (8 * sizeof(int) > 3 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(int) - 1 > 4 * PyLong_SHIFT) { return (int) ((((((((((int)digits[3]) << PyLong_SHIFT) | (int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0]))); } } break; } #endif if (sizeof(int) <= sizeof(long)) { __PYX_VERIFY_RETURN_INT_EXC(int, long, PyLong_AsLong(x)) } else if (sizeof(int) <= sizeof(PY_LONG_LONG)) { __PYX_VERIFY_RETURN_INT_EXC(int, PY_LONG_LONG, PyLong_AsLongLong(x)) } } { #if CYTHON_COMPILING_IN_PYPY && !defined(_PyLong_AsByteArray) PyErr_SetString(PyExc_RuntimeError, "_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers"); #else int val; PyObject *v = __Pyx_PyNumber_Int(x); #if PY_MAJOR_VERSION < 3 if (likely(v) && !PyLong_Check(v)) { PyObject *tmp = v; v = PyNumber_Long(tmp); Py_DECREF(tmp); } #endif if (likely(v)) { int one = 1; int is_little = (int)*(unsigned char *)&one; unsigned char *bytes = (unsigned char *)&val; int ret = _PyLong_AsByteArray((PyLongObject *)v, bytes, sizeof(val), is_little, !is_unsigned); Py_DECREF(v); if (likely(!ret)) return val; } #endif return (int) -1; } } else { int val; PyObject *tmp = __Pyx_PyNumber_Int(x); if (!tmp) return (int) -1; val = __Pyx_PyInt_As_int(tmp); Py_DECREF(tmp); return val; } raise_overflow: PyErr_SetString(PyExc_OverflowError, "value too large to convert to int"); return (int) -1; raise_neg_overflow: PyErr_SetString(PyExc_OverflowError, "can't convert negative value to int"); return (int) -1; } static CYTHON_INLINE PyObject* __Pyx_PyInt_From_int(int value) { const int neg_one = (int) -1, const_zero = (int) 0; const int is_unsigned = neg_one > const_zero; if (is_unsigned) { if (sizeof(int) < sizeof(long)) { return PyInt_FromLong((long) value); } else if (sizeof(int) <= sizeof(unsigned long)) { return PyLong_FromUnsignedLong((unsigned long) value); } else if (sizeof(int) <= sizeof(unsigned PY_LONG_LONG)) { return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value); } } else { if (sizeof(int) <= sizeof(long)) { return PyInt_FromLong((long) value); } else if (sizeof(int) <= sizeof(PY_LONG_LONG)) { return PyLong_FromLongLong((PY_LONG_LONG) value); } } { int one = 1; int little = (int)*(unsigned char *)&one; unsigned char *bytes = (unsigned char *)&value; return _PyLong_FromByteArray(bytes, sizeof(int), little, !is_unsigned); } } static CYTHON_INLINE PyObject* __Pyx_PyInt_From_long(long value) { const long neg_one = (long) -1, const_zero = (long) 0; const int is_unsigned = neg_one > const_zero; if (is_unsigned) { if (sizeof(long) < sizeof(long)) { return PyInt_FromLong((long) value); } else if (sizeof(long) <= sizeof(unsigned long)) { return PyLong_FromUnsignedLong((unsigned long) value); } else if (sizeof(long) <= sizeof(unsigned PY_LONG_LONG)) { return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value); } } else { if (sizeof(long) <= sizeof(long)) { return PyInt_FromLong((long) value); } else if (sizeof(long) <= sizeof(PY_LONG_LONG)) { return PyLong_FromLongLong((PY_LONG_LONG) value); } } { int one = 1; int little = (int)*(unsigned char *)&one; unsigned char *bytes = (unsigned char *)&value; return _PyLong_FromByteArray(bytes, sizeof(long), little, !is_unsigned); } } static CYTHON_INLINE long __Pyx_PyInt_As_long(PyObject *x) { const long neg_one = (long) -1, const_zero = (long) 0; const int is_unsigned = neg_one > const_zero; #if PY_MAJOR_VERSION < 3 if (likely(PyInt_Check(x))) { if (sizeof(long) < sizeof(long)) { __PYX_VERIFY_RETURN_INT(long, long, PyInt_AS_LONG(x)) } else { long val = PyInt_AS_LONG(x); if (is_unsigned && unlikely(val < 0)) { goto raise_neg_overflow; } return (long) val; } } else #endif if (likely(PyLong_Check(x))) { if (is_unsigned) { #if CYTHON_USE_PYLONG_INTERNALS const digit* digits = ((PyLongObject*)x)->ob_digit; switch (Py_SIZE(x)) { case 0: return (long) 0; case 1: __PYX_VERIFY_RETURN_INT(long, digit, digits[0]) case 2: if (8 * sizeof(long) > 1 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(long) >= 2 * PyLong_SHIFT) { return (long) (((((long)digits[1]) << PyLong_SHIFT) | (long)digits[0])); } } break; case 3: if (8 * sizeof(long) > 2 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(long) >= 3 * PyLong_SHIFT) { return (long) (((((((long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0])); } } break; case 4: if (8 * sizeof(long) > 3 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(long) >= 4 * PyLong_SHIFT) { return (long) (((((((((long)digits[3]) << PyLong_SHIFT) | (long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0])); } } break; } #endif #if CYTHON_COMPILING_IN_CPYTHON if (unlikely(Py_SIZE(x) < 0)) { goto raise_neg_overflow; } #else { int result = PyObject_RichCompareBool(x, Py_False, Py_LT); if (unlikely(result < 0)) return (long) -1; if (unlikely(result == 1)) goto raise_neg_overflow; } #endif if (sizeof(long) <= sizeof(unsigned long)) { __PYX_VERIFY_RETURN_INT_EXC(long, unsigned long, PyLong_AsUnsignedLong(x)) } else if (sizeof(long) <= sizeof(unsigned PY_LONG_LONG)) { __PYX_VERIFY_RETURN_INT_EXC(long, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x)) } } else { #if CYTHON_USE_PYLONG_INTERNALS const digit* digits = ((PyLongObject*)x)->ob_digit; switch (Py_SIZE(x)) { case 0: return (long) 0; case -1: __PYX_VERIFY_RETURN_INT(long, sdigit, -(sdigit) digits[0]) case 1: __PYX_VERIFY_RETURN_INT(long, digit, +digits[0]) case -2: if (8 * sizeof(long) - 1 > 1 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(long, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) { return (long) (((long)-1)*(((((long)digits[1]) << PyLong_SHIFT) | (long)digits[0]))); } } break; case 2: if (8 * sizeof(long) > 1 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) { return (long) ((((((long)digits[1]) << PyLong_SHIFT) | (long)digits[0]))); } } break; case -3: if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(long, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) { return (long) (((long)-1)*(((((((long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0]))); } } break; case 3: if (8 * sizeof(long) > 2 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) { return (long) ((((((((long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0]))); } } break; case -4: if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(long, long, -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(long) - 1 > 4 * PyLong_SHIFT) { return (long) (((long)-1)*(((((((((long)digits[3]) << PyLong_SHIFT) | (long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0]))); } } break; case 4: if (8 * sizeof(long) > 3 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(long) - 1 > 4 * PyLong_SHIFT) { return (long) ((((((((((long)digits[3]) << PyLong_SHIFT) | (long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0]))); } } break; } #endif if (sizeof(long) <= sizeof(long)) { __PYX_VERIFY_RETURN_INT_EXC(long, long, PyLong_AsLong(x)) } else if (sizeof(long) <= sizeof(PY_LONG_LONG)) { __PYX_VERIFY_RETURN_INT_EXC(long, PY_LONG_LONG, PyLong_AsLongLong(x)) } } { #if CYTHON_COMPILING_IN_PYPY && !defined(_PyLong_AsByteArray) PyErr_SetString(PyExc_RuntimeError, "_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers"); #else long val; PyObject *v = __Pyx_PyNumber_Int(x); #if PY_MAJOR_VERSION < 3 if (likely(v) && !PyLong_Check(v)) { PyObject *tmp = v; v = PyNumber_Long(tmp); Py_DECREF(tmp); } #endif if (likely(v)) { int one = 1; int is_little = (int)*(unsigned char *)&one; unsigned char *bytes = (unsigned char *)&val; int ret = _PyLong_AsByteArray((PyLongObject *)v, bytes, sizeof(val), is_little, !is_unsigned); Py_DECREF(v); if (likely(!ret)) return val; } #endif return (long) -1; } } else { long val; PyObject *tmp = __Pyx_PyNumber_Int(x); if (!tmp) return (long) -1; val = __Pyx_PyInt_As_long(tmp); Py_DECREF(tmp); return val; } raise_overflow: PyErr_SetString(PyExc_OverflowError, "value too large to convert to long"); return (long) -1; raise_neg_overflow: PyErr_SetString(PyExc_OverflowError, "can't convert negative value to long"); return (long) -1; } static int __Pyx_check_binary_version(void) { char ctversion[4], rtversion[4]; PyOS_snprintf(ctversion, 4, "%d.%d", PY_MAJOR_VERSION, PY_MINOR_VERSION); PyOS_snprintf(rtversion, 4, "%s", Py_GetVersion()); if (ctversion[0] != rtversion[0] || ctversion[2] != rtversion[2]) { char message[200]; PyOS_snprintf(message, sizeof(message), "compiletime version %s of module '%.100s' " "does not match runtime version %s", ctversion, __Pyx_MODULE_NAME, rtversion); return PyErr_WarnEx(NULL, message, 1); } return 0; } #ifndef __PYX_HAVE_RT_ImportModule #define __PYX_HAVE_RT_ImportModule static PyObject *__Pyx_ImportModule(const char *name) { PyObject *py_name = 0; PyObject *py_module = 0; py_name = __Pyx_PyIdentifier_FromString(name); if (!py_name) goto bad; py_module = PyImport_Import(py_name); Py_DECREF(py_name); return py_module; bad: Py_XDECREF(py_name); return 0; } #endif #ifndef __PYX_HAVE_RT_ImportFunction #define __PYX_HAVE_RT_ImportFunction static int __Pyx_ImportFunction(PyObject *module, const char *funcname, void (**f)(void), const char *sig) { PyObject *d = 0; PyObject *cobj = 0; union { void (*fp)(void); void *p; } tmp; d = PyObject_GetAttrString(module, (char *)"__pyx_capi__"); if (!d) goto bad; cobj = PyDict_GetItemString(d, funcname); if (!cobj) { PyErr_Format(PyExc_ImportError, "%.200s does not export expected C function %.200s", PyModule_GetName(module), funcname); goto bad; } #if PY_VERSION_HEX >= 0x02070000 if (!PyCapsule_IsValid(cobj, sig)) { PyErr_Format(PyExc_TypeError, "C function %.200s.%.200s has wrong signature (expected %.500s, got %.500s)", PyModule_GetName(module), funcname, sig, PyCapsule_GetName(cobj)); goto bad; } tmp.p = PyCapsule_GetPointer(cobj, sig); #else {const char *desc, *s1, *s2; desc = (const char *)PyCObject_GetDesc(cobj); if (!desc) goto bad; s1 = desc; s2 = sig; while (*s1 != '\0' && *s1 == *s2) { s1++; s2++; } if (*s1 != *s2) { PyErr_Format(PyExc_TypeError, "C function %.200s.%.200s has wrong signature (expected %.500s, got %.500s)", PyModule_GetName(module), funcname, sig, desc); goto bad; } tmp.p = PyCObject_AsVoidPtr(cobj);} #endif *f = tmp.fp; if (!(*f)) goto bad; Py_DECREF(d); return 0; bad: Py_XDECREF(d); return -1; } #endif static int __Pyx_InitStrings(__Pyx_StringTabEntry *t) { while (t->p) { #if PY_MAJOR_VERSION < 3 if (t->is_unicode) { *t->p = PyUnicode_DecodeUTF8(t->s, t->n - 1, NULL); } else if (t->intern) { *t->p = PyString_InternFromString(t->s); } else { *t->p = PyString_FromStringAndSize(t->s, t->n - 1); } #else if (t->is_unicode | t->is_str) { if (t->intern) { *t->p = PyUnicode_InternFromString(t->s); } else if (t->encoding) { *t->p = PyUnicode_Decode(t->s, t->n - 1, t->encoding, NULL); } else { *t->p = PyUnicode_FromStringAndSize(t->s, t->n - 1); } } else { *t->p = PyBytes_FromStringAndSize(t->s, t->n - 1); } #endif if (!*t->p) return -1; ++t; } return 0; } static CYTHON_INLINE PyObject* __Pyx_PyUnicode_FromString(const char* c_str) { return __Pyx_PyUnicode_FromStringAndSize(c_str, (Py_ssize_t)strlen(c_str)); } static CYTHON_INLINE char* __Pyx_PyObject_AsString(PyObject* o) { Py_ssize_t ignore; return __Pyx_PyObject_AsStringAndSize(o, &ignore); } static CYTHON_INLINE char* __Pyx_PyObject_AsStringAndSize(PyObject* o, Py_ssize_t *length) { #if CYTHON_COMPILING_IN_CPYTHON && (__PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT) if ( #if PY_MAJOR_VERSION < 3 && __PYX_DEFAULT_STRING_ENCODING_IS_ASCII __Pyx_sys_getdefaultencoding_not_ascii && #endif PyUnicode_Check(o)) { #if PY_VERSION_HEX < 0x03030000 char* defenc_c; PyObject* defenc = _PyUnicode_AsDefaultEncodedString(o, NULL); if (!defenc) return NULL; defenc_c = PyBytes_AS_STRING(defenc); #if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII { char* end = defenc_c + PyBytes_GET_SIZE(defenc); char* c; for (c = defenc_c; c < end; c++) { if ((unsigned char) (*c) >= 128) { PyUnicode_AsASCIIString(o); return NULL; } } } #endif *length = PyBytes_GET_SIZE(defenc); return defenc_c; #else if (__Pyx_PyUnicode_READY(o) == -1) return NULL; #if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII if (PyUnicode_IS_ASCII(o)) { *length = PyUnicode_GET_LENGTH(o); return PyUnicode_AsUTF8(o); } else { PyUnicode_AsASCIIString(o); return NULL; } #else return PyUnicode_AsUTF8AndSize(o, length); #endif #endif } else #endif #if (!CYTHON_COMPILING_IN_PYPY) || (defined(PyByteArray_AS_STRING) && defined(PyByteArray_GET_SIZE)) if (PyByteArray_Check(o)) { *length = PyByteArray_GET_SIZE(o); return PyByteArray_AS_STRING(o); } else #endif { char* result; int r = PyBytes_AsStringAndSize(o, &result, length); if (unlikely(r < 0)) { return NULL; } else { return result; } } } static CYTHON_INLINE int __Pyx_PyObject_IsTrue(PyObject* x) { int is_true = x == Py_True; if (is_true | (x == Py_False) | (x == Py_None)) return is_true; else return PyObject_IsTrue(x); } static CYTHON_INLINE PyObject* __Pyx_PyNumber_Int(PyObject* x) { PyNumberMethods *m; const char *name = NULL; PyObject *res = NULL; #if PY_MAJOR_VERSION < 3 if (PyInt_Check(x) || PyLong_Check(x)) #else if (PyLong_Check(x)) #endif return __Pyx_NewRef(x); m = Py_TYPE(x)->tp_as_number; #if PY_MAJOR_VERSION < 3 if (m && m->nb_int) { name = "int"; res = PyNumber_Int(x); } else if (m && m->nb_long) { name = "long"; res = PyNumber_Long(x); } #else if (m && m->nb_int) { name = "int"; res = PyNumber_Long(x); } #endif if (res) { #if PY_MAJOR_VERSION < 3 if (!PyInt_Check(res) && !PyLong_Check(res)) { #else if (!PyLong_Check(res)) { #endif PyErr_Format(PyExc_TypeError, "__%.4s__ returned non-%.4s (type %.200s)", name, name, Py_TYPE(res)->tp_name); Py_DECREF(res); return NULL; } } else if (!PyErr_Occurred()) { PyErr_SetString(PyExc_TypeError, "an integer is required"); } return res; } static CYTHON_INLINE Py_ssize_t __Pyx_PyIndex_AsSsize_t(PyObject* b) { Py_ssize_t ival; PyObject *x; #if PY_MAJOR_VERSION < 3 if (likely(PyInt_CheckExact(b))) { if (sizeof(Py_ssize_t) >= sizeof(long)) return PyInt_AS_LONG(b); else return PyInt_AsSsize_t(x); } #endif if (likely(PyLong_CheckExact(b))) { #if CYTHON_USE_PYLONG_INTERNALS const digit* digits = ((PyLongObject*)b)->ob_digit; const Py_ssize_t size = Py_SIZE(b); if (likely(__Pyx_sst_abs(size) <= 1)) { ival = likely(size) ? digits[0] : 0; if (size == -1) ival = -ival; return ival; } else { switch (size) { case 2: if (8 * sizeof(Py_ssize_t) > 2 * PyLong_SHIFT) { return (Py_ssize_t) (((((size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])); } break; case -2: if (8 * sizeof(Py_ssize_t) > 2 * PyLong_SHIFT) { return -(Py_ssize_t) (((((size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])); } break; case 3: if (8 * sizeof(Py_ssize_t) > 3 * PyLong_SHIFT) { return (Py_ssize_t) (((((((size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])); } break; case -3: if (8 * sizeof(Py_ssize_t) > 3 * PyLong_SHIFT) { return -(Py_ssize_t) (((((((size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])); } break; case 4: if (8 * sizeof(Py_ssize_t) > 4 * PyLong_SHIFT) { return (Py_ssize_t) (((((((((size_t)digits[3]) << PyLong_SHIFT) | (size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])); } break; case -4: if (8 * sizeof(Py_ssize_t) > 4 * PyLong_SHIFT) { return -(Py_ssize_t) (((((((((size_t)digits[3]) << PyLong_SHIFT) | (size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])); } break; } } #endif return PyLong_AsSsize_t(b); } x = PyNumber_Index(b); if (!x) return -1; ival = PyInt_AsSsize_t(x); Py_DECREF(x); return ival; } static CYTHON_INLINE PyObject * __Pyx_PyInt_FromSize_t(size_t ival) { return PyInt_FromSize_t(ival); } #endif /* Py_PYTHON_H */ pygame_sdl2-2.1.0-for-renpy-6.99.14.1/gen3/pygame_sdl2.draw.c0000664000175000017500000123134612665223544022433 0ustar tomtom00000000000000/* Generated by Cython 0.23.3 */ #define PY_SSIZE_T_CLEAN #include "Python.h" #ifndef Py_PYTHON_H #error Python headers needed to compile C extensions, please install development version of Python. #elif PY_VERSION_HEX < 0x02060000 || (0x03000000 <= PY_VERSION_HEX && PY_VERSION_HEX < 0x03020000) #error Cython requires Python 2.6+ or Python 3.2+. #else #define CYTHON_ABI "0_23_3" #include #ifndef offsetof #define offsetof(type, member) ( (size_t) & ((type*)0) -> member ) #endif #if !defined(WIN32) && !defined(MS_WINDOWS) #ifndef __stdcall #define __stdcall #endif #ifndef __cdecl #define __cdecl #endif #ifndef __fastcall #define __fastcall #endif #endif #ifndef DL_IMPORT #define DL_IMPORT(t) t #endif #ifndef DL_EXPORT #define DL_EXPORT(t) t #endif #ifndef PY_LONG_LONG #define PY_LONG_LONG LONG_LONG #endif #ifndef Py_HUGE_VAL #define Py_HUGE_VAL HUGE_VAL #endif #ifdef PYPY_VERSION #define CYTHON_COMPILING_IN_PYPY 1 #define CYTHON_COMPILING_IN_CPYTHON 0 #else #define CYTHON_COMPILING_IN_PYPY 0 #define CYTHON_COMPILING_IN_CPYTHON 1 #endif #if !defined(CYTHON_USE_PYLONG_INTERNALS) && CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x02070000 #define CYTHON_USE_PYLONG_INTERNALS 1 #endif #if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX < 0x02070600 && !defined(Py_OptimizeFlag) #define Py_OptimizeFlag 0 #endif #define __PYX_BUILD_PY_SSIZE_T "n" #define CYTHON_FORMAT_SSIZE_T "z" #if PY_MAJOR_VERSION < 3 #define __Pyx_BUILTIN_MODULE_NAME "__builtin__" #define __Pyx_PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)\ PyCode_New(a+k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos) #define __Pyx_DefaultClassType PyClass_Type #else #define __Pyx_BUILTIN_MODULE_NAME "builtins" #define __Pyx_PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)\ PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos) #define __Pyx_DefaultClassType PyType_Type #endif #ifndef Py_TPFLAGS_CHECKTYPES #define Py_TPFLAGS_CHECKTYPES 0 #endif #ifndef Py_TPFLAGS_HAVE_INDEX #define Py_TPFLAGS_HAVE_INDEX 0 #endif #ifndef Py_TPFLAGS_HAVE_NEWBUFFER #define Py_TPFLAGS_HAVE_NEWBUFFER 0 #endif #ifndef Py_TPFLAGS_HAVE_FINALIZE #define Py_TPFLAGS_HAVE_FINALIZE 0 #endif #if PY_VERSION_HEX > 0x03030000 && defined(PyUnicode_KIND) #define CYTHON_PEP393_ENABLED 1 #define __Pyx_PyUnicode_READY(op) (likely(PyUnicode_IS_READY(op)) ?\ 0 : _PyUnicode_Ready((PyObject *)(op))) #define __Pyx_PyUnicode_GET_LENGTH(u) PyUnicode_GET_LENGTH(u) #define __Pyx_PyUnicode_READ_CHAR(u, i) PyUnicode_READ_CHAR(u, i) #define __Pyx_PyUnicode_KIND(u) PyUnicode_KIND(u) #define __Pyx_PyUnicode_DATA(u) PyUnicode_DATA(u) #define __Pyx_PyUnicode_READ(k, d, i) PyUnicode_READ(k, d, i) #else #define CYTHON_PEP393_ENABLED 0 #define __Pyx_PyUnicode_READY(op) (0) #define __Pyx_PyUnicode_GET_LENGTH(u) PyUnicode_GET_SIZE(u) #define __Pyx_PyUnicode_READ_CHAR(u, i) ((Py_UCS4)(PyUnicode_AS_UNICODE(u)[i])) #define __Pyx_PyUnicode_KIND(u) (sizeof(Py_UNICODE)) #define __Pyx_PyUnicode_DATA(u) ((void*)PyUnicode_AS_UNICODE(u)) #define __Pyx_PyUnicode_READ(k, d, i) ((void)(k), (Py_UCS4)(((Py_UNICODE*)d)[i])) #endif #if CYTHON_COMPILING_IN_PYPY #define __Pyx_PyUnicode_Concat(a, b) PyNumber_Add(a, b) #define __Pyx_PyUnicode_ConcatSafe(a, b) PyNumber_Add(a, b) #else #define __Pyx_PyUnicode_Concat(a, b) PyUnicode_Concat(a, b) #define __Pyx_PyUnicode_ConcatSafe(a, b) ((unlikely((a) == Py_None) || unlikely((b) == Py_None)) ?\ PyNumber_Add(a, b) : __Pyx_PyUnicode_Concat(a, b)) #endif #if CYTHON_COMPILING_IN_PYPY && !defined(PyUnicode_Contains) #define PyUnicode_Contains(u, s) PySequence_Contains(u, s) #endif #define __Pyx_PyString_FormatSafe(a, b) ((unlikely((a) == Py_None)) ? PyNumber_Remainder(a, b) : __Pyx_PyString_Format(a, b)) #define __Pyx_PyUnicode_FormatSafe(a, b) ((unlikely((a) == Py_None)) ? PyNumber_Remainder(a, b) : PyUnicode_Format(a, b)) #if PY_MAJOR_VERSION >= 3 #define __Pyx_PyString_Format(a, b) PyUnicode_Format(a, b) #else #define __Pyx_PyString_Format(a, b) PyString_Format(a, b) #endif #if PY_MAJOR_VERSION >= 3 #define PyBaseString_Type PyUnicode_Type #define PyStringObject PyUnicodeObject #define PyString_Type PyUnicode_Type #define PyString_Check PyUnicode_Check #define PyString_CheckExact PyUnicode_CheckExact #endif #if PY_MAJOR_VERSION >= 3 #define __Pyx_PyBaseString_Check(obj) PyUnicode_Check(obj) #define __Pyx_PyBaseString_CheckExact(obj) PyUnicode_CheckExact(obj) #else #define __Pyx_PyBaseString_Check(obj) (PyString_Check(obj) || PyUnicode_Check(obj)) #define __Pyx_PyBaseString_CheckExact(obj) (PyString_CheckExact(obj) || PyUnicode_CheckExact(obj)) #endif #ifndef PySet_CheckExact #define PySet_CheckExact(obj) (Py_TYPE(obj) == &PySet_Type) #endif #define __Pyx_TypeCheck(obj, type) PyObject_TypeCheck(obj, (PyTypeObject *)type) #if PY_MAJOR_VERSION >= 3 #define PyIntObject PyLongObject #define PyInt_Type PyLong_Type #define PyInt_Check(op) PyLong_Check(op) #define PyInt_CheckExact(op) PyLong_CheckExact(op) #define PyInt_FromString PyLong_FromString #define PyInt_FromUnicode PyLong_FromUnicode #define PyInt_FromLong PyLong_FromLong #define PyInt_FromSize_t PyLong_FromSize_t #define PyInt_FromSsize_t PyLong_FromSsize_t #define PyInt_AsLong PyLong_AsLong #define PyInt_AS_LONG PyLong_AS_LONG #define PyInt_AsSsize_t PyLong_AsSsize_t #define PyInt_AsUnsignedLongMask PyLong_AsUnsignedLongMask #define PyInt_AsUnsignedLongLongMask PyLong_AsUnsignedLongLongMask #define PyNumber_Int PyNumber_Long #endif #if PY_MAJOR_VERSION >= 3 #define PyBoolObject PyLongObject #endif #if PY_MAJOR_VERSION >= 3 && CYTHON_COMPILING_IN_PYPY #ifndef PyUnicode_InternFromString #define PyUnicode_InternFromString(s) PyUnicode_FromString(s) #endif #endif #if PY_VERSION_HEX < 0x030200A4 typedef long Py_hash_t; #define __Pyx_PyInt_FromHash_t PyInt_FromLong #define __Pyx_PyInt_AsHash_t PyInt_AsLong #else #define __Pyx_PyInt_FromHash_t PyInt_FromSsize_t #define __Pyx_PyInt_AsHash_t PyInt_AsSsize_t #endif #if PY_MAJOR_VERSION >= 3 #define __Pyx_PyMethod_New(func, self, klass) ((self) ? PyMethod_New(func, self) : PyInstanceMethod_New(func)) #else #define __Pyx_PyMethod_New(func, self, klass) PyMethod_New(func, self, klass) #endif #if PY_VERSION_HEX >= 0x030500B1 #define __Pyx_PyAsyncMethodsStruct PyAsyncMethods #define __Pyx_PyType_AsAsync(obj) (Py_TYPE(obj)->tp_as_async) #elif CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3 typedef struct { unaryfunc am_await; unaryfunc am_aiter; unaryfunc am_anext; } __Pyx_PyAsyncMethodsStruct; #define __Pyx_PyType_AsAsync(obj) ((__Pyx_PyAsyncMethodsStruct*) (Py_TYPE(obj)->tp_reserved)) #else #define __Pyx_PyType_AsAsync(obj) NULL #endif #ifndef CYTHON_RESTRICT #if defined(__GNUC__) #define CYTHON_RESTRICT __restrict__ #elif defined(_MSC_VER) && _MSC_VER >= 1400 #define CYTHON_RESTRICT __restrict #elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L #define CYTHON_RESTRICT restrict #else #define CYTHON_RESTRICT #endif #endif #define __Pyx_void_to_None(void_result) (void_result, Py_INCREF(Py_None), Py_None) #ifndef CYTHON_INLINE #if defined(__GNUC__) #define CYTHON_INLINE __inline__ #elif defined(_MSC_VER) #define CYTHON_INLINE __inline #elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L #define CYTHON_INLINE inline #else #define CYTHON_INLINE #endif #endif #if defined(WIN32) || defined(MS_WINDOWS) #define _USE_MATH_DEFINES #endif #include #ifdef NAN #define __PYX_NAN() ((float) NAN) #else static CYTHON_INLINE float __PYX_NAN() { float value; memset(&value, 0xFF, sizeof(value)); return value; } #endif #if PY_MAJOR_VERSION >= 3 #define __Pyx_PyNumber_Divide(x,y) PyNumber_TrueDivide(x,y) #define __Pyx_PyNumber_InPlaceDivide(x,y) PyNumber_InPlaceTrueDivide(x,y) #else #define __Pyx_PyNumber_Divide(x,y) PyNumber_TrueDivide(x,y) #define __Pyx_PyNumber_InPlaceDivide(x,y) PyNumber_InPlaceTrueDivide(x,y) #endif #ifndef __PYX_EXTERN_C #ifdef __cplusplus #define __PYX_EXTERN_C extern "C" #else #define __PYX_EXTERN_C extern #endif #endif #define __PYX_HAVE__pygame_sdl2__draw #define __PYX_HAVE_API__pygame_sdl2__draw #include "stdint.h" #include "string.h" #include "stdio.h" #include "stddef.h" #include "SDL.h" #ifdef _OPENMP #include #endif /* _OPENMP */ #ifdef PYREX_WITHOUT_ASSERTIONS #define CYTHON_WITHOUT_ASSERTIONS #endif #ifndef CYTHON_UNUSED # if defined(__GNUC__) # if !(defined(__cplusplus)) || (__GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 4)) # define CYTHON_UNUSED __attribute__ ((__unused__)) # else # define CYTHON_UNUSED # endif # elif defined(__ICC) || (defined(__INTEL_COMPILER) && !defined(_MSC_VER)) # define CYTHON_UNUSED __attribute__ ((__unused__)) # else # define CYTHON_UNUSED # endif #endif #ifndef CYTHON_NCP_UNUSED # if CYTHON_COMPILING_IN_CPYTHON # define CYTHON_NCP_UNUSED # else # define CYTHON_NCP_UNUSED CYTHON_UNUSED # endif #endif typedef struct {PyObject **p; char *s; const Py_ssize_t n; const char* encoding; const char is_unicode; const char is_str; const char intern; } __Pyx_StringTabEntry; #define __PYX_DEFAULT_STRING_ENCODING_IS_ASCII 0 #define __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT 0 #define __PYX_DEFAULT_STRING_ENCODING "" #define __Pyx_PyObject_FromString __Pyx_PyBytes_FromString #define __Pyx_PyObject_FromStringAndSize __Pyx_PyBytes_FromStringAndSize #define __Pyx_uchar_cast(c) ((unsigned char)c) #define __Pyx_long_cast(x) ((long)x) #define __Pyx_fits_Py_ssize_t(v, type, is_signed) (\ (sizeof(type) < sizeof(Py_ssize_t)) ||\ (sizeof(type) > sizeof(Py_ssize_t) &&\ likely(v < (type)PY_SSIZE_T_MAX ||\ v == (type)PY_SSIZE_T_MAX) &&\ (!is_signed || likely(v > (type)PY_SSIZE_T_MIN ||\ v == (type)PY_SSIZE_T_MIN))) ||\ (sizeof(type) == sizeof(Py_ssize_t) &&\ (is_signed || likely(v < (type)PY_SSIZE_T_MAX ||\ v == (type)PY_SSIZE_T_MAX))) ) #if defined (__cplusplus) && __cplusplus >= 201103L #include #define __Pyx_sst_abs(value) std::abs(value) #elif SIZEOF_INT >= SIZEOF_SIZE_T #define __Pyx_sst_abs(value) abs(value) #elif SIZEOF_LONG >= SIZEOF_SIZE_T #define __Pyx_sst_abs(value) labs(value) #elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L #define __Pyx_sst_abs(value) llabs(value) #elif defined (_MSC_VER) && defined (_M_X64) #define __Pyx_sst_abs(value) _abs64(value) #elif defined (__GNUC__) #define __Pyx_sst_abs(value) __builtin_llabs(value) #else #define __Pyx_sst_abs(value) ((value<0) ? -value : value) #endif static CYTHON_INLINE char* __Pyx_PyObject_AsString(PyObject*); static CYTHON_INLINE char* __Pyx_PyObject_AsStringAndSize(PyObject*, Py_ssize_t* length); #define __Pyx_PyByteArray_FromString(s) PyByteArray_FromStringAndSize((const char*)s, strlen((const char*)s)) #define __Pyx_PyByteArray_FromStringAndSize(s, l) PyByteArray_FromStringAndSize((const char*)s, l) #define __Pyx_PyBytes_FromString PyBytes_FromString #define __Pyx_PyBytes_FromStringAndSize PyBytes_FromStringAndSize static CYTHON_INLINE PyObject* __Pyx_PyUnicode_FromString(const char*); #if PY_MAJOR_VERSION < 3 #define __Pyx_PyStr_FromString __Pyx_PyBytes_FromString #define __Pyx_PyStr_FromStringAndSize __Pyx_PyBytes_FromStringAndSize #else #define __Pyx_PyStr_FromString __Pyx_PyUnicode_FromString #define __Pyx_PyStr_FromStringAndSize __Pyx_PyUnicode_FromStringAndSize #endif #define __Pyx_PyObject_AsSString(s) ((signed char*) __Pyx_PyObject_AsString(s)) #define __Pyx_PyObject_AsUString(s) ((unsigned char*) __Pyx_PyObject_AsString(s)) #define __Pyx_PyObject_FromCString(s) __Pyx_PyObject_FromString((const char*)s) #define __Pyx_PyBytes_FromCString(s) __Pyx_PyBytes_FromString((const char*)s) #define __Pyx_PyByteArray_FromCString(s) __Pyx_PyByteArray_FromString((const char*)s) #define __Pyx_PyStr_FromCString(s) __Pyx_PyStr_FromString((const char*)s) #define __Pyx_PyUnicode_FromCString(s) __Pyx_PyUnicode_FromString((const char*)s) #if PY_MAJOR_VERSION < 3 static CYTHON_INLINE size_t __Pyx_Py_UNICODE_strlen(const Py_UNICODE *u) { const Py_UNICODE *u_end = u; while (*u_end++) ; return (size_t)(u_end - u - 1); } #else #define __Pyx_Py_UNICODE_strlen Py_UNICODE_strlen #endif #define __Pyx_PyUnicode_FromUnicode(u) PyUnicode_FromUnicode(u, __Pyx_Py_UNICODE_strlen(u)) #define __Pyx_PyUnicode_FromUnicodeAndLength PyUnicode_FromUnicode #define __Pyx_PyUnicode_AsUnicode PyUnicode_AsUnicode #define __Pyx_NewRef(obj) (Py_INCREF(obj), obj) #define __Pyx_Owned_Py_None(b) __Pyx_NewRef(Py_None) #define __Pyx_PyBool_FromLong(b) ((b) ? __Pyx_NewRef(Py_True) : __Pyx_NewRef(Py_False)) static CYTHON_INLINE int __Pyx_PyObject_IsTrue(PyObject*); static CYTHON_INLINE PyObject* __Pyx_PyNumber_Int(PyObject* x); static CYTHON_INLINE Py_ssize_t __Pyx_PyIndex_AsSsize_t(PyObject*); static CYTHON_INLINE PyObject * __Pyx_PyInt_FromSize_t(size_t); #if CYTHON_COMPILING_IN_CPYTHON #define __pyx_PyFloat_AsDouble(x) (PyFloat_CheckExact(x) ? PyFloat_AS_DOUBLE(x) : PyFloat_AsDouble(x)) #else #define __pyx_PyFloat_AsDouble(x) PyFloat_AsDouble(x) #endif #define __pyx_PyFloat_AsFloat(x) ((float) __pyx_PyFloat_AsDouble(x)) #if PY_MAJOR_VERSION < 3 && __PYX_DEFAULT_STRING_ENCODING_IS_ASCII static int __Pyx_sys_getdefaultencoding_not_ascii; static int __Pyx_init_sys_getdefaultencoding_params(void) { PyObject* sys; PyObject* default_encoding = NULL; PyObject* ascii_chars_u = NULL; PyObject* ascii_chars_b = NULL; const char* default_encoding_c; sys = PyImport_ImportModule("sys"); if (!sys) goto bad; default_encoding = PyObject_CallMethod(sys, (char*) "getdefaultencoding", NULL); Py_DECREF(sys); if (!default_encoding) goto bad; default_encoding_c = PyBytes_AsString(default_encoding); if (!default_encoding_c) goto bad; if (strcmp(default_encoding_c, "ascii") == 0) { __Pyx_sys_getdefaultencoding_not_ascii = 0; } else { char ascii_chars[128]; int c; for (c = 0; c < 128; c++) { ascii_chars[c] = c; } __Pyx_sys_getdefaultencoding_not_ascii = 1; ascii_chars_u = PyUnicode_DecodeASCII(ascii_chars, 128, NULL); if (!ascii_chars_u) goto bad; ascii_chars_b = PyUnicode_AsEncodedString(ascii_chars_u, default_encoding_c, NULL); if (!ascii_chars_b || !PyBytes_Check(ascii_chars_b) || memcmp(ascii_chars, PyBytes_AS_STRING(ascii_chars_b), 128) != 0) { PyErr_Format( PyExc_ValueError, "This module compiled with c_string_encoding=ascii, but default encoding '%.200s' is not a superset of ascii.", default_encoding_c); goto bad; } Py_DECREF(ascii_chars_u); Py_DECREF(ascii_chars_b); } Py_DECREF(default_encoding); return 0; bad: Py_XDECREF(default_encoding); Py_XDECREF(ascii_chars_u); Py_XDECREF(ascii_chars_b); return -1; } #endif #if __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT && PY_MAJOR_VERSION >= 3 #define __Pyx_PyUnicode_FromStringAndSize(c_str, size) PyUnicode_DecodeUTF8(c_str, size, NULL) #else #define __Pyx_PyUnicode_FromStringAndSize(c_str, size) PyUnicode_Decode(c_str, size, __PYX_DEFAULT_STRING_ENCODING, NULL) #if __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT static char* __PYX_DEFAULT_STRING_ENCODING; static int __Pyx_init_sys_getdefaultencoding_params(void) { PyObject* sys; PyObject* default_encoding = NULL; char* default_encoding_c; sys = PyImport_ImportModule("sys"); if (!sys) goto bad; default_encoding = PyObject_CallMethod(sys, (char*) (const char*) "getdefaultencoding", NULL); Py_DECREF(sys); if (!default_encoding) goto bad; default_encoding_c = PyBytes_AsString(default_encoding); if (!default_encoding_c) goto bad; __PYX_DEFAULT_STRING_ENCODING = (char*) malloc(strlen(default_encoding_c)); if (!__PYX_DEFAULT_STRING_ENCODING) goto bad; strcpy(__PYX_DEFAULT_STRING_ENCODING, default_encoding_c); Py_DECREF(default_encoding); return 0; bad: Py_XDECREF(default_encoding); return -1; } #endif #endif /* Test for GCC > 2.95 */ #if defined(__GNUC__) && (__GNUC__ > 2 || (__GNUC__ == 2 && (__GNUC_MINOR__ > 95))) #define likely(x) __builtin_expect(!!(x), 1) #define unlikely(x) __builtin_expect(!!(x), 0) #else /* !__GNUC__ or GCC < 2.95 */ #define likely(x) (x) #define unlikely(x) (x) #endif /* __GNUC__ */ static PyObject *__pyx_m; static PyObject *__pyx_d; static PyObject *__pyx_b; static PyObject *__pyx_empty_tuple; static PyObject *__pyx_empty_bytes; static int __pyx_lineno; static int __pyx_clineno = 0; static const char * __pyx_cfilenm= __FILE__; static const char *__pyx_filename; static const char *__pyx_f[] = { "src/pygame_sdl2/draw.pyx", "src/pygame_sdl2/surface.pxd", }; /*--- Type declarations ---*/ struct __pyx_obj_11pygame_sdl2_7surface_Surface; /* "pygame_sdl2/surface.pxd":23 * from sdl2 cimport SDL_Surface * * cdef class Surface: # <<<<<<<<<<<<<< * # Allow weak references. * cdef object __weakref__ */ struct __pyx_obj_11pygame_sdl2_7surface_Surface { PyObject_HEAD struct __pyx_vtabstruct_11pygame_sdl2_7surface_Surface *__pyx_vtab; PyObject *__weakref__; SDL_Surface *surface; int owns_surface; int window_surface; PyObject *locklist; struct __pyx_obj_11pygame_sdl2_7surface_Surface *parent; struct __pyx_obj_11pygame_sdl2_7surface_Surface *root; int offset_x; int offset_y; PyObject *get_window_flags; int has_alpha; }; struct __pyx_vtabstruct_11pygame_sdl2_7surface_Surface { void (*take_surface)(struct __pyx_obj_11pygame_sdl2_7surface_Surface *, SDL_Surface *); }; static struct __pyx_vtabstruct_11pygame_sdl2_7surface_Surface *__pyx_vtabptr_11pygame_sdl2_7surface_Surface; /* --- Runtime support code (head) --- */ #ifndef CYTHON_REFNANNY #define CYTHON_REFNANNY 0 #endif #if CYTHON_REFNANNY typedef struct { void (*INCREF)(void*, PyObject*, int); void (*DECREF)(void*, PyObject*, int); void (*GOTREF)(void*, PyObject*, int); void (*GIVEREF)(void*, PyObject*, int); void* (*SetupContext)(const char*, int, const char*); void (*FinishContext)(void**); } __Pyx_RefNannyAPIStruct; static __Pyx_RefNannyAPIStruct *__Pyx_RefNanny = NULL; static __Pyx_RefNannyAPIStruct *__Pyx_RefNannyImportAPI(const char *modname); #define __Pyx_RefNannyDeclarations void *__pyx_refnanny = NULL; #ifdef WITH_THREAD #define __Pyx_RefNannySetupContext(name, acquire_gil)\ if (acquire_gil) {\ PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure();\ __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), __LINE__, __FILE__);\ PyGILState_Release(__pyx_gilstate_save);\ } else {\ __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), __LINE__, __FILE__);\ } #else #define __Pyx_RefNannySetupContext(name, acquire_gil)\ __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), __LINE__, __FILE__) #endif #define __Pyx_RefNannyFinishContext()\ __Pyx_RefNanny->FinishContext(&__pyx_refnanny) #define __Pyx_INCREF(r) __Pyx_RefNanny->INCREF(__pyx_refnanny, (PyObject *)(r), __LINE__) #define __Pyx_DECREF(r) __Pyx_RefNanny->DECREF(__pyx_refnanny, (PyObject *)(r), __LINE__) #define __Pyx_GOTREF(r) __Pyx_RefNanny->GOTREF(__pyx_refnanny, (PyObject *)(r), __LINE__) #define __Pyx_GIVEREF(r) __Pyx_RefNanny->GIVEREF(__pyx_refnanny, (PyObject *)(r), __LINE__) #define __Pyx_XINCREF(r) do { if((r) != NULL) {__Pyx_INCREF(r); }} while(0) #define __Pyx_XDECREF(r) do { if((r) != NULL) {__Pyx_DECREF(r); }} while(0) #define __Pyx_XGOTREF(r) do { if((r) != NULL) {__Pyx_GOTREF(r); }} while(0) #define __Pyx_XGIVEREF(r) do { if((r) != NULL) {__Pyx_GIVEREF(r);}} while(0) #else #define __Pyx_RefNannyDeclarations #define __Pyx_RefNannySetupContext(name, acquire_gil) #define __Pyx_RefNannyFinishContext() #define __Pyx_INCREF(r) Py_INCREF(r) #define __Pyx_DECREF(r) Py_DECREF(r) #define __Pyx_GOTREF(r) #define __Pyx_GIVEREF(r) #define __Pyx_XINCREF(r) Py_XINCREF(r) #define __Pyx_XDECREF(r) Py_XDECREF(r) #define __Pyx_XGOTREF(r) #define __Pyx_XGIVEREF(r) #endif #define __Pyx_XDECREF_SET(r, v) do {\ PyObject *tmp = (PyObject *) r;\ r = v; __Pyx_XDECREF(tmp);\ } while (0) #define __Pyx_DECREF_SET(r, v) do {\ PyObject *tmp = (PyObject *) r;\ r = v; __Pyx_DECREF(tmp);\ } while (0) #define __Pyx_CLEAR(r) do { PyObject* tmp = ((PyObject*)(r)); r = NULL; __Pyx_DECREF(tmp);} while(0) #define __Pyx_XCLEAR(r) do { if((r) != NULL) {PyObject* tmp = ((PyObject*)(r)); r = NULL; __Pyx_DECREF(tmp);}} while(0) static void __Pyx_RaiseArgtupleInvalid(const char* func_name, int exact, Py_ssize_t num_min, Py_ssize_t num_max, Py_ssize_t num_found); static void __Pyx_RaiseDoubleKeywordsError(const char* func_name, PyObject* kw_name); static int __Pyx_ParseOptionalKeywords(PyObject *kwds, PyObject **argnames[],\ PyObject *kwds2, PyObject *values[], Py_ssize_t num_pos_args,\ const char* function_name); static CYTHON_INLINE int __Pyx_ArgTypeTest(PyObject *obj, PyTypeObject *type, int none_allowed, const char *name, int exact); #if CYTHON_COMPILING_IN_CPYTHON static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStr(PyObject* obj, PyObject* attr_name) { PyTypeObject* tp = Py_TYPE(obj); if (likely(tp->tp_getattro)) return tp->tp_getattro(obj, attr_name); #if PY_MAJOR_VERSION < 3 if (likely(tp->tp_getattr)) return tp->tp_getattr(obj, PyString_AS_STRING(attr_name)); #endif return PyObject_GetAttr(obj, attr_name); } #else #define __Pyx_PyObject_GetAttrStr(o,n) PyObject_GetAttr(o,n) #endif static PyObject *__Pyx_GetBuiltinName(PyObject *name); static CYTHON_INLINE PyObject *__Pyx_GetModuleGlobalName(PyObject *name); #if CYTHON_COMPILING_IN_CPYTHON static CYTHON_INLINE PyObject* __Pyx_PyObject_Call(PyObject *func, PyObject *arg, PyObject *kw); #else #define __Pyx_PyObject_Call(func, arg, kw) PyObject_Call(func, arg, kw) #endif #if CYTHON_COMPILING_IN_CPYTHON static CYTHON_INLINE PyObject* __Pyx_PyObject_CallMethO(PyObject *func, PyObject *arg); #endif static CYTHON_INLINE PyObject* __Pyx_PyObject_CallOneArg(PyObject *func, PyObject *arg); #if CYTHON_COMPILING_IN_CPYTHON static PyObject* __Pyx_PyInt_EqObjC(PyObject *op1, PyObject *op2, long intval, int inplace); #else #define __Pyx_PyInt_EqObjC(op1, op2, intval, inplace)\ PyObject_RichCompare(op1, op2, Py_EQ) #endif #if CYTHON_COMPILING_IN_CPYTHON static PyObject* __Pyx_PyInt_AddObjC(PyObject *op1, PyObject *op2, long intval, int inplace); #else #define __Pyx_PyInt_AddObjC(op1, op2, intval, inplace)\ (inplace ? PyNumber_InPlaceAdd(op1, op2) : PyNumber_Add(op1, op2)) #endif #if CYTHON_COMPILING_IN_CPYTHON static CYTHON_INLINE PyObject* __Pyx_PyObject_CallNoArg(PyObject *func); #else #define __Pyx_PyObject_CallNoArg(func) __Pyx_PyObject_Call(func, __pyx_empty_tuple, NULL) #endif #define __Pyx_GetItemInt(o, i, type, is_signed, to_py_func, is_list, wraparound, boundscheck)\ (__Pyx_fits_Py_ssize_t(i, type, is_signed) ?\ __Pyx_GetItemInt_Fast(o, (Py_ssize_t)i, is_list, wraparound, boundscheck) :\ (is_list ? (PyErr_SetString(PyExc_IndexError, "list index out of range"), (PyObject*)NULL) :\ __Pyx_GetItemInt_Generic(o, to_py_func(i)))) #define __Pyx_GetItemInt_List(o, i, type, is_signed, to_py_func, is_list, wraparound, boundscheck)\ (__Pyx_fits_Py_ssize_t(i, type, is_signed) ?\ __Pyx_GetItemInt_List_Fast(o, (Py_ssize_t)i, wraparound, boundscheck) :\ (PyErr_SetString(PyExc_IndexError, "list index out of range"), (PyObject*)NULL)) static CYTHON_INLINE PyObject *__Pyx_GetItemInt_List_Fast(PyObject *o, Py_ssize_t i, int wraparound, int boundscheck); #define __Pyx_GetItemInt_Tuple(o, i, type, is_signed, to_py_func, is_list, wraparound, boundscheck)\ (__Pyx_fits_Py_ssize_t(i, type, is_signed) ?\ __Pyx_GetItemInt_Tuple_Fast(o, (Py_ssize_t)i, wraparound, boundscheck) :\ (PyErr_SetString(PyExc_IndexError, "tuple index out of range"), (PyObject*)NULL)) static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Tuple_Fast(PyObject *o, Py_ssize_t i, int wraparound, int boundscheck); static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Generic(PyObject *o, PyObject* j); static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Fast(PyObject *o, Py_ssize_t i, int is_list, int wraparound, int boundscheck); static CYTHON_INLINE void __Pyx_RaiseTooManyValuesError(Py_ssize_t expected); static CYTHON_INLINE void __Pyx_RaiseNeedMoreValuesError(Py_ssize_t index); static CYTHON_INLINE int __Pyx_IterFinish(void); static int __Pyx_IternextUnpackEndCheck(PyObject *retval, Py_ssize_t expected); #if CYTHON_COMPILING_IN_CPYTHON static PyObject* __Pyx_PyInt_SubtractObjC(PyObject *op1, PyObject *op2, long intval, int inplace); #else #define __Pyx_PyInt_SubtractObjC(op1, op2, intval, inplace)\ (inplace ? PyNumber_InPlaceSubtract(op1, op2) : PyNumber_Subtract(op1, op2)) #endif static CYTHON_INLINE void __Pyx_ErrRestore(PyObject *type, PyObject *value, PyObject *tb); static CYTHON_INLINE void __Pyx_ErrFetch(PyObject **type, PyObject **value, PyObject **tb); static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, PyObject *cause); static void* __Pyx_GetVtable(PyObject *dict); static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list, int level); static PyObject* __Pyx_ImportFrom(PyObject* module, PyObject* name); typedef struct { int code_line; PyCodeObject* code_object; } __Pyx_CodeObjectCacheEntry; struct __Pyx_CodeObjectCache { int count; int max_count; __Pyx_CodeObjectCacheEntry* entries; }; static struct __Pyx_CodeObjectCache __pyx_code_cache = {0,0,NULL}; static int __pyx_bisect_code_objects(__Pyx_CodeObjectCacheEntry* entries, int count, int code_line); static PyCodeObject *__pyx_find_code_object(int code_line); static void __pyx_insert_code_object(int code_line, PyCodeObject* code_object); static void __Pyx_AddTraceback(const char *funcname, int c_line, int py_line, const char *filename); static CYTHON_INLINE PyObject* __Pyx_PyInt_From_long(long value); static CYTHON_INLINE long __Pyx_PyInt_As_long(PyObject *); static CYTHON_INLINE int __Pyx_PyInt_As_int(PyObject *); static int __Pyx_check_binary_version(void); #if !defined(__Pyx_PyIdentifier_FromString) #if PY_MAJOR_VERSION < 3 #define __Pyx_PyIdentifier_FromString(s) PyString_FromString(s) #else #define __Pyx_PyIdentifier_FromString(s) PyUnicode_FromString(s) #endif #endif static PyObject *__Pyx_ImportModule(const char *name); static PyTypeObject *__Pyx_ImportType(const char *module_name, const char *class_name, size_t size, int strict); static int __Pyx_InitStrings(__Pyx_StringTabEntry *t); /* Module declarations from 'libc.stdint' */ /* Module declarations from 'libc.string' */ /* Module declarations from 'libc.stdio' */ /* Module declarations from 'libc.stddef' */ /* Module declarations from 'sdl2' */ /* Module declarations from 'pygame_sdl2.surface' */ static PyTypeObject *__pyx_ptype_11pygame_sdl2_7surface_Surface = 0; /* Module declarations from 'pygame_sdl2.draw' */ #define __Pyx_MODULE_NAME "pygame_sdl2.draw" int __pyx_module_is_main_pygame_sdl2__draw = 0; /* Implementation of 'pygame_sdl2.draw' */ static char __pyx_k_h[] = "h"; static char __pyx_k_n[] = "n"; static char __pyx_k_r[] = "r"; static char __pyx_k_w[] = "w"; static char __pyx_k_x[] = "x"; static char __pyx_k_y[] = "y"; static char __pyx_k__6[] = "*"; static char __pyx_k_x1[] = "x1"; static char __pyx_k_x2[] = "x2"; static char __pyx_k_y1[] = "y1"; static char __pyx_k_y2[] = "y2"; static char __pyx_k_arc[] = "arc"; static char __pyx_k_box[] = "box"; static char __pyx_k_pos[] = "pos"; static char __pyx_k_Rect[] = "Rect"; static char __pyx_k_clip[] = "clip"; static char __pyx_k_line[] = "line"; static char __pyx_k_main[] = "__main__"; static char __pyx_k_rect[] = "rect"; static char __pyx_k_test[] = "__test__"; static char __pyx_k_blend[] = "blend"; static char __pyx_k_color[] = "color"; static char __pyx_k_dirty[] = "dirty"; static char __pyx_k_error[] = "error"; static char __pyx_k_lines[] = "lines"; static char __pyx_k_width[] = "width"; static char __pyx_k_aaline[] = "aaline"; static char __pyx_k_circle[] = "circle"; static char __pyx_k_closed[] = "closed"; static char __pyx_k_endpos[] = "endpos"; static char __pyx_k_import[] = "__import__"; static char __pyx_k_radius[] = "radius"; static char __pyx_k_aalines[] = "aalines"; static char __pyx_k_ellipse[] = "ellipse"; static char __pyx_k_end_pos[] = "end_pos"; static char __pyx_k_gfxdraw[] = "gfxdraw"; static char __pyx_k_polygon[] = "polygon"; static char __pyx_k_surface[] = "surface"; static char __pyx_k_get_rect[] = "get_rect"; static char __pyx_k_startpos[] = "startpos"; static char __pyx_k_union_ip[] = "union_ip"; static char __pyx_k_pointlist[] = "pointlist"; static char __pyx_k_rectangle[] = "rectangle"; static char __pyx_k_start_pos[] = "start_pos"; static char __pyx_k_pyx_vtable[] = "__pyx_vtable__"; static char __pyx_k_stop_angle[] = "stop_angle"; static char __pyx_k_thick_line[] = "thick_line"; static char __pyx_k_start_angle[] = "start_angle"; static char __pyx_k_filled_circle[] = "filled_circle"; static char __pyx_k_filled_polygon[] = "filled_polygon"; static char __pyx_k_Not_implemented[] = "Not implemented."; static char __pyx_k_pygame_sdl2_draw[] = "pygame_sdl2.draw"; static char __pyx_k_pygame_sdl2_rect[] = "pygame_sdl2.rect"; static char __pyx_k_pygame_sdl2_error[] = "pygame_sdl2.error"; static char __pyx_k_pygame_sdl2_gfxdraw[] = "pygame_sdl2.gfxdraw"; static char __pyx_k_home_tom_ab_pygame_sdl2_src_pyg[] = "/home/tom/ab/pygame_sdl2/src/pygame_sdl2/draw.pyx"; static PyObject *__pyx_kp_u_Not_implemented; static PyObject *__pyx_n_s_Rect; static PyObject *__pyx_n_s__6; static PyObject *__pyx_n_s_aaline; static PyObject *__pyx_n_s_aalines; static PyObject *__pyx_n_s_arc; static PyObject *__pyx_n_s_blend; static PyObject *__pyx_n_s_box; static PyObject *__pyx_n_s_circle; static PyObject *__pyx_n_s_clip; static PyObject *__pyx_n_s_closed; static PyObject *__pyx_n_s_color; static PyObject *__pyx_n_s_dirty; static PyObject *__pyx_n_s_ellipse; static PyObject *__pyx_n_s_end_pos; static PyObject *__pyx_n_s_endpos; static PyObject *__pyx_n_s_error; static PyObject *__pyx_n_s_filled_circle; static PyObject *__pyx_n_s_filled_polygon; static PyObject *__pyx_n_s_get_rect; static PyObject *__pyx_n_s_gfxdraw; static PyObject *__pyx_n_s_h; static PyObject *__pyx_kp_s_home_tom_ab_pygame_sdl2_src_pyg; static PyObject *__pyx_n_s_import; static PyObject *__pyx_n_s_line; static PyObject *__pyx_n_s_lines; static PyObject *__pyx_n_s_main; static PyObject *__pyx_n_s_n; static PyObject *__pyx_n_s_pointlist; static PyObject *__pyx_n_s_polygon; static PyObject *__pyx_n_s_pos; static PyObject *__pyx_n_s_pygame_sdl2_draw; static PyObject *__pyx_n_s_pygame_sdl2_error; static PyObject *__pyx_n_s_pygame_sdl2_gfxdraw; static PyObject *__pyx_n_s_pygame_sdl2_rect; static PyObject *__pyx_n_s_pyx_vtable; static PyObject *__pyx_n_s_r; static PyObject *__pyx_n_s_radius; static PyObject *__pyx_n_s_rect; static PyObject *__pyx_n_s_rectangle; static PyObject *__pyx_n_s_start_angle; static PyObject *__pyx_n_s_start_pos; static PyObject *__pyx_n_s_startpos; static PyObject *__pyx_n_s_stop_angle; static PyObject *__pyx_n_s_surface; static PyObject *__pyx_n_s_test; static PyObject *__pyx_n_s_thick_line; static PyObject *__pyx_n_s_union_ip; static PyObject *__pyx_n_s_w; static PyObject *__pyx_n_s_width; static PyObject *__pyx_n_s_x; static PyObject *__pyx_n_s_x1; static PyObject *__pyx_n_s_x2; static PyObject *__pyx_n_s_y; static PyObject *__pyx_n_s_y1; static PyObject *__pyx_n_s_y2; static PyObject *__pyx_pf_11pygame_sdl2_4draw_rect(CYTHON_UNUSED PyObject *__pyx_self, struct __pyx_obj_11pygame_sdl2_7surface_Surface *__pyx_v_surface, PyObject *__pyx_v_color, PyObject *__pyx_v_rect, PyObject *__pyx_v_width); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_4draw_2polygon(CYTHON_UNUSED PyObject *__pyx_self, struct __pyx_obj_11pygame_sdl2_7surface_Surface *__pyx_v_surface, PyObject *__pyx_v_color, PyObject *__pyx_v_pointlist, PyObject *__pyx_v_width); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_4draw_4circle(CYTHON_UNUSED PyObject *__pyx_self, struct __pyx_obj_11pygame_sdl2_7surface_Surface *__pyx_v_surface, PyObject *__pyx_v_color, PyObject *__pyx_v_pos, PyObject *__pyx_v_radius, PyObject *__pyx_v_width); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_4draw_6ellipse(CYTHON_UNUSED PyObject *__pyx_self, CYTHON_UNUSED struct __pyx_obj_11pygame_sdl2_7surface_Surface *__pyx_v_surface, CYTHON_UNUSED PyObject *__pyx_v_color, CYTHON_UNUSED PyObject *__pyx_v_rect, CYTHON_UNUSED PyObject *__pyx_v_width); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_4draw_8arc(CYTHON_UNUSED PyObject *__pyx_self, CYTHON_UNUSED struct __pyx_obj_11pygame_sdl2_7surface_Surface *__pyx_v_surface, CYTHON_UNUSED PyObject *__pyx_v_color, CYTHON_UNUSED PyObject *__pyx_v_rect, CYTHON_UNUSED PyObject *__pyx_v_start_angle, CYTHON_UNUSED PyObject *__pyx_v_stop_angle, CYTHON_UNUSED PyObject *__pyx_v_width); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_4draw_10line(CYTHON_UNUSED PyObject *__pyx_self, struct __pyx_obj_11pygame_sdl2_7surface_Surface *__pyx_v_surface, PyObject *__pyx_v_color, PyObject *__pyx_v_start_pos, PyObject *__pyx_v_end_pos, PyObject *__pyx_v_width); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_4draw_12lines(CYTHON_UNUSED PyObject *__pyx_self, struct __pyx_obj_11pygame_sdl2_7surface_Surface *__pyx_v_surface, PyObject *__pyx_v_color, PyObject *__pyx_v_closed, PyObject *__pyx_v_pointlist, PyObject *__pyx_v_width); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_4draw_14aaline(CYTHON_UNUSED PyObject *__pyx_self, struct __pyx_obj_11pygame_sdl2_7surface_Surface *__pyx_v_surface, PyObject *__pyx_v_color, PyObject *__pyx_v_startpos, PyObject *__pyx_v_endpos, CYTHON_UNUSED PyObject *__pyx_v_blend); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_4draw_16aalines(CYTHON_UNUSED PyObject *__pyx_self, struct __pyx_obj_11pygame_sdl2_7surface_Surface *__pyx_v_surface, PyObject *__pyx_v_color, PyObject *__pyx_v_closed, PyObject *__pyx_v_pointlist, CYTHON_UNUSED PyObject *__pyx_v_blend); /* proto */ static PyObject *__pyx_int_0; static PyObject *__pyx_int_1; static PyObject *__pyx_int_2; static PyObject *__pyx_tuple_; static PyObject *__pyx_tuple__2; static PyObject *__pyx_tuple__3; static PyObject *__pyx_tuple__4; static PyObject *__pyx_tuple__5; static PyObject *__pyx_tuple__7; static PyObject *__pyx_tuple__9; static PyObject *__pyx_tuple__11; static PyObject *__pyx_tuple__13; static PyObject *__pyx_tuple__15; static PyObject *__pyx_tuple__17; static PyObject *__pyx_tuple__19; static PyObject *__pyx_tuple__21; static PyObject *__pyx_tuple__23; static PyObject *__pyx_codeobj__8; static PyObject *__pyx_codeobj__10; static PyObject *__pyx_codeobj__12; static PyObject *__pyx_codeobj__14; static PyObject *__pyx_codeobj__16; static PyObject *__pyx_codeobj__18; static PyObject *__pyx_codeobj__20; static PyObject *__pyx_codeobj__22; static PyObject *__pyx_codeobj__24; /* "pygame_sdl2/draw.pyx":26 * from pygame_sdl2.error import error * * def rect(Surface surface, color, rect, width=0): # <<<<<<<<<<<<<< * if not isinstance(rect, Rect): * rect = Rect(rect) */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_4draw_1rect(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static PyMethodDef __pyx_mdef_11pygame_sdl2_4draw_1rect = {"rect", (PyCFunction)__pyx_pw_11pygame_sdl2_4draw_1rect, METH_VARARGS|METH_KEYWORDS, 0}; static PyObject *__pyx_pw_11pygame_sdl2_4draw_1rect(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { struct __pyx_obj_11pygame_sdl2_7surface_Surface *__pyx_v_surface = 0; PyObject *__pyx_v_color = 0; PyObject *__pyx_v_rect = 0; PyObject *__pyx_v_width = 0; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("rect (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_surface,&__pyx_n_s_color,&__pyx_n_s_rect,&__pyx_n_s_width,0}; PyObject* values[4] = {0,0,0,0}; values[3] = ((PyObject *)__pyx_int_0); if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_surface)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; case 1: if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_color)) != 0)) kw_args--; else { __Pyx_RaiseArgtupleInvalid("rect", 0, 3, 4, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 26; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } case 2: if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_rect)) != 0)) kw_args--; else { __Pyx_RaiseArgtupleInvalid("rect", 0, 3, 4, 2); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 26; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } case 3: if (kw_args > 0) { PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_width); if (value) { values[3] = value; kw_args--; } } } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "rect") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 26; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } } else { switch (PyTuple_GET_SIZE(__pyx_args)) { case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); values[1] = PyTuple_GET_ITEM(__pyx_args, 1); values[0] = PyTuple_GET_ITEM(__pyx_args, 0); break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_surface = ((struct __pyx_obj_11pygame_sdl2_7surface_Surface *)values[0]); __pyx_v_color = values[1]; __pyx_v_rect = values[2]; __pyx_v_width = values[3]; } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("rect", 0, 3, 4, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 26; __pyx_clineno = __LINE__; goto __pyx_L3_error;} __pyx_L3_error:; __Pyx_AddTraceback("pygame_sdl2.draw.rect", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_surface), __pyx_ptype_11pygame_sdl2_7surface_Surface, 1, "surface", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 26; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_r = __pyx_pf_11pygame_sdl2_4draw_rect(__pyx_self, __pyx_v_surface, __pyx_v_color, __pyx_v_rect, __pyx_v_width); /* function exit code */ goto __pyx_L0; __pyx_L1_error:; __pyx_r = NULL; __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_4draw_rect(CYTHON_UNUSED PyObject *__pyx_self, struct __pyx_obj_11pygame_sdl2_7surface_Surface *__pyx_v_surface, PyObject *__pyx_v_color, PyObject *__pyx_v_rect, PyObject *__pyx_v_width) { PyObject *__pyx_v_n = NULL; PyObject *__pyx_v_r = NULL; PyObject *__pyx_v_dirty = NULL; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_t_2; int __pyx_t_3; PyObject *__pyx_t_4 = NULL; PyObject *__pyx_t_5 = NULL; PyObject *__pyx_t_6 = NULL; Py_ssize_t __pyx_t_7; PyObject *__pyx_t_8 = NULL; PyObject *__pyx_t_9 = NULL; PyObject *__pyx_t_10 = NULL; PyObject *__pyx_t_11 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("rect", 0); __Pyx_INCREF(__pyx_v_rect); /* "pygame_sdl2/draw.pyx":27 * * def rect(Surface surface, color, rect, width=0): * if not isinstance(rect, Rect): # <<<<<<<<<<<<<< * rect = Rect(rect) * */ __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_Rect); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 27; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = PyObject_IsInstance(__pyx_v_rect, __pyx_t_1); if (unlikely(__pyx_t_2 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 27; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_3 = ((!(__pyx_t_2 != 0)) != 0); if (__pyx_t_3) { /* "pygame_sdl2/draw.pyx":28 * def rect(Surface surface, color, rect, width=0): * if not isinstance(rect, Rect): * rect = Rect(rect) # <<<<<<<<<<<<<< * * if width == 0: */ __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_Rect); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 28; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); __pyx_t_5 = NULL; if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_4))) { __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4); if (likely(__pyx_t_5)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4); __Pyx_INCREF(__pyx_t_5); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_4, function); } } if (!__pyx_t_5) { __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_v_rect); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 28; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); } else { __pyx_t_6 = PyTuple_New(1+1); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 28; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_6); __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_5); __pyx_t_5 = NULL; __Pyx_INCREF(__pyx_v_rect); __Pyx_GIVEREF(__pyx_v_rect); PyTuple_SET_ITEM(__pyx_t_6, 0+1, __pyx_v_rect); __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_6, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 28; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; } __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF_SET(__pyx_v_rect, __pyx_t_1); __pyx_t_1 = 0; /* "pygame_sdl2/draw.pyx":27 * * def rect(Surface surface, color, rect, width=0): * if not isinstance(rect, Rect): # <<<<<<<<<<<<<< * rect = Rect(rect) * */ } /* "pygame_sdl2/draw.pyx":30 * rect = Rect(rect) * * if width == 0: # <<<<<<<<<<<<<< * gfxdraw.box(surface, rect, color) * else: */ __pyx_t_1 = __Pyx_PyInt_EqObjC(__pyx_v_width, __pyx_int_0, 0, 0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 30; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 30; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (__pyx_t_3) { /* "pygame_sdl2/draw.pyx":31 * * if width == 0: * gfxdraw.box(surface, rect, color) # <<<<<<<<<<<<<< * else: * gfxdraw.rectangle(surface, rect, color) */ __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_gfxdraw); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 31; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_box); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 31; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_t_4 = NULL; __pyx_t_7 = 0; if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_6))) { __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_6); if (likely(__pyx_t_4)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6); __Pyx_INCREF(__pyx_t_4); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_6, function); __pyx_t_7 = 1; } } __pyx_t_5 = PyTuple_New(3+__pyx_t_7); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 31; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); if (__pyx_t_4) { __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_4); __pyx_t_4 = NULL; } __Pyx_INCREF(((PyObject *)__pyx_v_surface)); __Pyx_GIVEREF(((PyObject *)__pyx_v_surface)); PyTuple_SET_ITEM(__pyx_t_5, 0+__pyx_t_7, ((PyObject *)__pyx_v_surface)); __Pyx_INCREF(__pyx_v_rect); __Pyx_GIVEREF(__pyx_v_rect); PyTuple_SET_ITEM(__pyx_t_5, 1+__pyx_t_7, __pyx_v_rect); __Pyx_INCREF(__pyx_v_color); __Pyx_GIVEREF(__pyx_v_color); PyTuple_SET_ITEM(__pyx_t_5, 2+__pyx_t_7, __pyx_v_color); __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_5, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 31; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "pygame_sdl2/draw.pyx":30 * rect = Rect(rect) * * if width == 0: # <<<<<<<<<<<<<< * gfxdraw.box(surface, rect, color) * else: */ goto __pyx_L4; } /* "pygame_sdl2/draw.pyx":33 * gfxdraw.box(surface, rect, color) * else: * gfxdraw.rectangle(surface, rect, color) # <<<<<<<<<<<<<< * n = 1 * while n < width: */ /*else*/ { __pyx_t_6 = __Pyx_GetModuleGlobalName(__pyx_n_s_gfxdraw); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 33; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_6); __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_rectangle); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 33; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __pyx_t_6 = NULL; __pyx_t_7 = 0; if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_5))) { __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_5); if (likely(__pyx_t_6)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5); __Pyx_INCREF(__pyx_t_6); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_5, function); __pyx_t_7 = 1; } } __pyx_t_4 = PyTuple_New(3+__pyx_t_7); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 33; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); if (__pyx_t_6) { __Pyx_GIVEREF(__pyx_t_6); PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_6); __pyx_t_6 = NULL; } __Pyx_INCREF(((PyObject *)__pyx_v_surface)); __Pyx_GIVEREF(((PyObject *)__pyx_v_surface)); PyTuple_SET_ITEM(__pyx_t_4, 0+__pyx_t_7, ((PyObject *)__pyx_v_surface)); __Pyx_INCREF(__pyx_v_rect); __Pyx_GIVEREF(__pyx_v_rect); PyTuple_SET_ITEM(__pyx_t_4, 1+__pyx_t_7, __pyx_v_rect); __Pyx_INCREF(__pyx_v_color); __Pyx_GIVEREF(__pyx_v_color); PyTuple_SET_ITEM(__pyx_t_4, 2+__pyx_t_7, __pyx_v_color); __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_4, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 33; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "pygame_sdl2/draw.pyx":34 * else: * gfxdraw.rectangle(surface, rect, color) * n = 1 # <<<<<<<<<<<<<< * while n < width: * r = Rect(rect.x - n, rect.y - n, rect.w + (n*2), rect.h + (n*2)) */ __Pyx_INCREF(__pyx_int_1); __pyx_v_n = __pyx_int_1; /* "pygame_sdl2/draw.pyx":35 * gfxdraw.rectangle(surface, rect, color) * n = 1 * while n < width: # <<<<<<<<<<<<<< * r = Rect(rect.x - n, rect.y - n, rect.w + (n*2), rect.h + (n*2)) * gfxdraw.rectangle(surface, r, color) */ while (1) { __pyx_t_1 = PyObject_RichCompare(__pyx_v_n, __pyx_v_width, Py_LT); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 35; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 35; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (!__pyx_t_3) break; /* "pygame_sdl2/draw.pyx":36 * n = 1 * while n < width: * r = Rect(rect.x - n, rect.y - n, rect.w + (n*2), rect.h + (n*2)) # <<<<<<<<<<<<<< * gfxdraw.rectangle(surface, r, color) * r = Rect(rect.x + n, rect.y + n, rect.w - (n*2), rect.h - (n*2)) */ __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_Rect); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 36; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_rect, __pyx_n_s_x); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 36; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); __pyx_t_6 = PyNumber_Subtract(__pyx_t_4, __pyx_v_n); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 36; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_rect, __pyx_n_s_y); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 36; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); __pyx_t_8 = PyNumber_Subtract(__pyx_t_4, __pyx_v_n); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 36; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_8); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_rect, __pyx_n_s_w); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 36; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); __pyx_t_9 = PyNumber_Multiply(__pyx_v_n, __pyx_int_2); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 36; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_9); __pyx_t_10 = PyNumber_Add(__pyx_t_4, __pyx_t_9); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 36; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_10); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_rect, __pyx_n_s_h); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 36; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_9); __pyx_t_4 = PyNumber_Multiply(__pyx_v_n, __pyx_int_2); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 36; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); __pyx_t_11 = PyNumber_Add(__pyx_t_9, __pyx_t_4); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 36; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_11); __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_t_4 = NULL; __pyx_t_7 = 0; if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_5))) { __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_5); if (likely(__pyx_t_4)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5); __Pyx_INCREF(__pyx_t_4); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_5, function); __pyx_t_7 = 1; } } __pyx_t_9 = PyTuple_New(4+__pyx_t_7); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 36; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_9); if (__pyx_t_4) { __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_t_4); __pyx_t_4 = NULL; } __Pyx_GIVEREF(__pyx_t_6); PyTuple_SET_ITEM(__pyx_t_9, 0+__pyx_t_7, __pyx_t_6); __Pyx_GIVEREF(__pyx_t_8); PyTuple_SET_ITEM(__pyx_t_9, 1+__pyx_t_7, __pyx_t_8); __Pyx_GIVEREF(__pyx_t_10); PyTuple_SET_ITEM(__pyx_t_9, 2+__pyx_t_7, __pyx_t_10); __Pyx_GIVEREF(__pyx_t_11); PyTuple_SET_ITEM(__pyx_t_9, 3+__pyx_t_7, __pyx_t_11); __pyx_t_6 = 0; __pyx_t_8 = 0; __pyx_t_10 = 0; __pyx_t_11 = 0; __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_9, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 36; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_XDECREF_SET(__pyx_v_r, __pyx_t_1); __pyx_t_1 = 0; /* "pygame_sdl2/draw.pyx":37 * while n < width: * r = Rect(rect.x - n, rect.y - n, rect.w + (n*2), rect.h + (n*2)) * gfxdraw.rectangle(surface, r, color) # <<<<<<<<<<<<<< * r = Rect(rect.x + n, rect.y + n, rect.w - (n*2), rect.h - (n*2)) * gfxdraw.rectangle(surface, r, color) */ __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_gfxdraw); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 37; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_rectangle); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 37; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_9); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __pyx_t_5 = NULL; __pyx_t_7 = 0; if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_9))) { __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_9); if (likely(__pyx_t_5)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_9); __Pyx_INCREF(__pyx_t_5); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_9, function); __pyx_t_7 = 1; } } __pyx_t_11 = PyTuple_New(3+__pyx_t_7); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 37; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_11); if (__pyx_t_5) { __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_11, 0, __pyx_t_5); __pyx_t_5 = NULL; } __Pyx_INCREF(((PyObject *)__pyx_v_surface)); __Pyx_GIVEREF(((PyObject *)__pyx_v_surface)); PyTuple_SET_ITEM(__pyx_t_11, 0+__pyx_t_7, ((PyObject *)__pyx_v_surface)); __Pyx_INCREF(__pyx_v_r); __Pyx_GIVEREF(__pyx_v_r); PyTuple_SET_ITEM(__pyx_t_11, 1+__pyx_t_7, __pyx_v_r); __Pyx_INCREF(__pyx_v_color); __Pyx_GIVEREF(__pyx_v_color); PyTuple_SET_ITEM(__pyx_t_11, 2+__pyx_t_7, __pyx_v_color); __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_9, __pyx_t_11, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 37; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "pygame_sdl2/draw.pyx":38 * r = Rect(rect.x - n, rect.y - n, rect.w + (n*2), rect.h + (n*2)) * gfxdraw.rectangle(surface, r, color) * r = Rect(rect.x + n, rect.y + n, rect.w - (n*2), rect.h - (n*2)) # <<<<<<<<<<<<<< * gfxdraw.rectangle(surface, r, color) * n += 1 */ __pyx_t_9 = __Pyx_GetModuleGlobalName(__pyx_n_s_Rect); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 38; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_9); __pyx_t_11 = __Pyx_PyObject_GetAttrStr(__pyx_v_rect, __pyx_n_s_x); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 38; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_11); __pyx_t_5 = PyNumber_Add(__pyx_t_11, __pyx_v_n); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 38; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; __pyx_t_11 = __Pyx_PyObject_GetAttrStr(__pyx_v_rect, __pyx_n_s_y); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 38; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_11); __pyx_t_10 = PyNumber_Add(__pyx_t_11, __pyx_v_n); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 38; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_10); __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; __pyx_t_11 = __Pyx_PyObject_GetAttrStr(__pyx_v_rect, __pyx_n_s_w); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 38; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_11); __pyx_t_8 = PyNumber_Multiply(__pyx_v_n, __pyx_int_2); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 38; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_8); __pyx_t_6 = PyNumber_Subtract(__pyx_t_11, __pyx_t_8); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 38; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_v_rect, __pyx_n_s_h); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 38; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_8); __pyx_t_11 = PyNumber_Multiply(__pyx_v_n, __pyx_int_2); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 38; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_11); __pyx_t_4 = PyNumber_Subtract(__pyx_t_8, __pyx_t_11); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 38; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; __pyx_t_11 = NULL; __pyx_t_7 = 0; if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_9))) { __pyx_t_11 = PyMethod_GET_SELF(__pyx_t_9); if (likely(__pyx_t_11)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_9); __Pyx_INCREF(__pyx_t_11); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_9, function); __pyx_t_7 = 1; } } __pyx_t_8 = PyTuple_New(4+__pyx_t_7); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 38; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_8); if (__pyx_t_11) { __Pyx_GIVEREF(__pyx_t_11); PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_11); __pyx_t_11 = NULL; } __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_8, 0+__pyx_t_7, __pyx_t_5); __Pyx_GIVEREF(__pyx_t_10); PyTuple_SET_ITEM(__pyx_t_8, 1+__pyx_t_7, __pyx_t_10); __Pyx_GIVEREF(__pyx_t_6); PyTuple_SET_ITEM(__pyx_t_8, 2+__pyx_t_7, __pyx_t_6); __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_8, 3+__pyx_t_7, __pyx_t_4); __pyx_t_5 = 0; __pyx_t_10 = 0; __pyx_t_6 = 0; __pyx_t_4 = 0; __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_9, __pyx_t_8, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 38; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; __Pyx_DECREF_SET(__pyx_v_r, __pyx_t_1); __pyx_t_1 = 0; /* "pygame_sdl2/draw.pyx":39 * gfxdraw.rectangle(surface, r, color) * r = Rect(rect.x + n, rect.y + n, rect.w - (n*2), rect.h - (n*2)) * gfxdraw.rectangle(surface, r, color) # <<<<<<<<<<<<<< * n += 1 * dirty = Rect(rect.x - width, rect.y - width, rect.w + (width*2), rect.h + (width*2)) */ __pyx_t_9 = __Pyx_GetModuleGlobalName(__pyx_n_s_gfxdraw); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 39; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_9); __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_9, __pyx_n_s_rectangle); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 39; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_8); __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; __pyx_t_9 = NULL; __pyx_t_7 = 0; if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_8))) { __pyx_t_9 = PyMethod_GET_SELF(__pyx_t_8); if (likely(__pyx_t_9)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_8); __Pyx_INCREF(__pyx_t_9); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_8, function); __pyx_t_7 = 1; } } __pyx_t_4 = PyTuple_New(3+__pyx_t_7); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 39; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); if (__pyx_t_9) { __Pyx_GIVEREF(__pyx_t_9); PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_9); __pyx_t_9 = NULL; } __Pyx_INCREF(((PyObject *)__pyx_v_surface)); __Pyx_GIVEREF(((PyObject *)__pyx_v_surface)); PyTuple_SET_ITEM(__pyx_t_4, 0+__pyx_t_7, ((PyObject *)__pyx_v_surface)); __Pyx_INCREF(__pyx_v_r); __Pyx_GIVEREF(__pyx_v_r); PyTuple_SET_ITEM(__pyx_t_4, 1+__pyx_t_7, __pyx_v_r); __Pyx_INCREF(__pyx_v_color); __Pyx_GIVEREF(__pyx_v_color); PyTuple_SET_ITEM(__pyx_t_4, 2+__pyx_t_7, __pyx_v_color); __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_8, __pyx_t_4, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 39; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "pygame_sdl2/draw.pyx":40 * r = Rect(rect.x + n, rect.y + n, rect.w - (n*2), rect.h - (n*2)) * gfxdraw.rectangle(surface, r, color) * n += 1 # <<<<<<<<<<<<<< * dirty = Rect(rect.x - width, rect.y - width, rect.w + (width*2), rect.h + (width*2)) * return dirty.clip(surface.get_rect()) */ __pyx_t_1 = __Pyx_PyInt_AddObjC(__pyx_v_n, __pyx_int_1, 1, 1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 40; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF_SET(__pyx_v_n, __pyx_t_1); __pyx_t_1 = 0; } } __pyx_L4:; /* "pygame_sdl2/draw.pyx":41 * gfxdraw.rectangle(surface, r, color) * n += 1 * dirty = Rect(rect.x - width, rect.y - width, rect.w + (width*2), rect.h + (width*2)) # <<<<<<<<<<<<<< * return dirty.clip(surface.get_rect()) * */ __pyx_t_8 = __Pyx_GetModuleGlobalName(__pyx_n_s_Rect); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 41; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_8); __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_rect, __pyx_n_s_x); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 41; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); __pyx_t_9 = PyNumber_Subtract(__pyx_t_4, __pyx_v_width); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 41; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_9); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_rect, __pyx_n_s_y); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 41; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); __pyx_t_6 = PyNumber_Subtract(__pyx_t_4, __pyx_v_width); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 41; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_rect, __pyx_n_s_w); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 41; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); __pyx_t_10 = PyNumber_Multiply(__pyx_v_width, __pyx_int_2); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 41; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_10); __pyx_t_5 = PyNumber_Add(__pyx_t_4, __pyx_t_10); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 41; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_v_rect, __pyx_n_s_h); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 41; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_10); __pyx_t_4 = PyNumber_Multiply(__pyx_v_width, __pyx_int_2); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 41; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); __pyx_t_11 = PyNumber_Add(__pyx_t_10, __pyx_t_4); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 41; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_11); __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_t_4 = NULL; __pyx_t_7 = 0; if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_8))) { __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_8); if (likely(__pyx_t_4)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_8); __Pyx_INCREF(__pyx_t_4); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_8, function); __pyx_t_7 = 1; } } __pyx_t_10 = PyTuple_New(4+__pyx_t_7); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 41; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_10); if (__pyx_t_4) { __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_t_4); __pyx_t_4 = NULL; } __Pyx_GIVEREF(__pyx_t_9); PyTuple_SET_ITEM(__pyx_t_10, 0+__pyx_t_7, __pyx_t_9); __Pyx_GIVEREF(__pyx_t_6); PyTuple_SET_ITEM(__pyx_t_10, 1+__pyx_t_7, __pyx_t_6); __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_10, 2+__pyx_t_7, __pyx_t_5); __Pyx_GIVEREF(__pyx_t_11); PyTuple_SET_ITEM(__pyx_t_10, 3+__pyx_t_7, __pyx_t_11); __pyx_t_9 = 0; __pyx_t_6 = 0; __pyx_t_5 = 0; __pyx_t_11 = 0; __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_8, __pyx_t_10, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 41; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; __pyx_v_dirty = __pyx_t_1; __pyx_t_1 = 0; /* "pygame_sdl2/draw.pyx":42 * n += 1 * dirty = Rect(rect.x - width, rect.y - width, rect.w + (width*2), rect.h + (width*2)) * return dirty.clip(surface.get_rect()) # <<<<<<<<<<<<<< * * def polygon(Surface surface, color, pointlist, width=0): */ __Pyx_XDECREF(__pyx_r); __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_v_dirty, __pyx_n_s_clip); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 42; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_8); __pyx_t_11 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_surface), __pyx_n_s_get_rect); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 42; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_11); __pyx_t_5 = NULL; if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_11))) { __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_11); if (likely(__pyx_t_5)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_11); __Pyx_INCREF(__pyx_t_5); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_11, function); } } if (__pyx_t_5) { __pyx_t_10 = __Pyx_PyObject_CallOneArg(__pyx_t_11, __pyx_t_5); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 42; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; } else { __pyx_t_10 = __Pyx_PyObject_CallNoArg(__pyx_t_11); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 42; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } __Pyx_GOTREF(__pyx_t_10); __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; __pyx_t_11 = NULL; if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_8))) { __pyx_t_11 = PyMethod_GET_SELF(__pyx_t_8); if (likely(__pyx_t_11)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_8); __Pyx_INCREF(__pyx_t_11); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_8, function); } } if (!__pyx_t_11) { __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_8, __pyx_t_10); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 42; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; __Pyx_GOTREF(__pyx_t_1); } else { __pyx_t_5 = PyTuple_New(1+1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 42; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); __Pyx_GIVEREF(__pyx_t_11); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_11); __pyx_t_11 = NULL; __Pyx_GIVEREF(__pyx_t_10); PyTuple_SET_ITEM(__pyx_t_5, 0+1, __pyx_t_10); __pyx_t_10 = 0; __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_8, __pyx_t_5, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 42; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; } __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "pygame_sdl2/draw.pyx":26 * from pygame_sdl2.error import error * * def rect(Surface surface, color, rect, width=0): # <<<<<<<<<<<<<< * if not isinstance(rect, Rect): * rect = Rect(rect) */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_5); __Pyx_XDECREF(__pyx_t_6); __Pyx_XDECREF(__pyx_t_8); __Pyx_XDECREF(__pyx_t_9); __Pyx_XDECREF(__pyx_t_10); __Pyx_XDECREF(__pyx_t_11); __Pyx_AddTraceback("pygame_sdl2.draw.rect", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF(__pyx_v_n); __Pyx_XDECREF(__pyx_v_r); __Pyx_XDECREF(__pyx_v_dirty); __Pyx_XDECREF(__pyx_v_rect); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/draw.pyx":44 * return dirty.clip(surface.get_rect()) * * def polygon(Surface surface, color, pointlist, width=0): # <<<<<<<<<<<<<< * if width == 0: * gfxdraw.filled_polygon(surface, pointlist, color) */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_4draw_3polygon(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static PyMethodDef __pyx_mdef_11pygame_sdl2_4draw_3polygon = {"polygon", (PyCFunction)__pyx_pw_11pygame_sdl2_4draw_3polygon, METH_VARARGS|METH_KEYWORDS, 0}; static PyObject *__pyx_pw_11pygame_sdl2_4draw_3polygon(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { struct __pyx_obj_11pygame_sdl2_7surface_Surface *__pyx_v_surface = 0; PyObject *__pyx_v_color = 0; PyObject *__pyx_v_pointlist = 0; PyObject *__pyx_v_width = 0; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("polygon (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_surface,&__pyx_n_s_color,&__pyx_n_s_pointlist,&__pyx_n_s_width,0}; PyObject* values[4] = {0,0,0,0}; values[3] = ((PyObject *)__pyx_int_0); if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_surface)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; case 1: if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_color)) != 0)) kw_args--; else { __Pyx_RaiseArgtupleInvalid("polygon", 0, 3, 4, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 44; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } case 2: if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_pointlist)) != 0)) kw_args--; else { __Pyx_RaiseArgtupleInvalid("polygon", 0, 3, 4, 2); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 44; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } case 3: if (kw_args > 0) { PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_width); if (value) { values[3] = value; kw_args--; } } } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "polygon") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 44; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } } else { switch (PyTuple_GET_SIZE(__pyx_args)) { case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); values[1] = PyTuple_GET_ITEM(__pyx_args, 1); values[0] = PyTuple_GET_ITEM(__pyx_args, 0); break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_surface = ((struct __pyx_obj_11pygame_sdl2_7surface_Surface *)values[0]); __pyx_v_color = values[1]; __pyx_v_pointlist = values[2]; __pyx_v_width = values[3]; } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("polygon", 0, 3, 4, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 44; __pyx_clineno = __LINE__; goto __pyx_L3_error;} __pyx_L3_error:; __Pyx_AddTraceback("pygame_sdl2.draw.polygon", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_surface), __pyx_ptype_11pygame_sdl2_7surface_Surface, 1, "surface", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 44; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_r = __pyx_pf_11pygame_sdl2_4draw_2polygon(__pyx_self, __pyx_v_surface, __pyx_v_color, __pyx_v_pointlist, __pyx_v_width); /* function exit code */ goto __pyx_L0; __pyx_L1_error:; __pyx_r = NULL; __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_4draw_2polygon(CYTHON_UNUSED PyObject *__pyx_self, struct __pyx_obj_11pygame_sdl2_7surface_Surface *__pyx_v_surface, PyObject *__pyx_v_color, PyObject *__pyx_v_pointlist, PyObject *__pyx_v_width) { PyObject *__pyx_v_dirty = NULL; PyObject *__pyx_v_n = NULL; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_t_2; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; Py_ssize_t __pyx_t_5; PyObject *__pyx_t_6 = NULL; PyObject *__pyx_t_7 = NULL; PyObject *__pyx_t_8 = NULL; PyObject *__pyx_t_9 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("polygon", 0); /* "pygame_sdl2/draw.pyx":45 * * def polygon(Surface surface, color, pointlist, width=0): * if width == 0: # <<<<<<<<<<<<<< * gfxdraw.filled_polygon(surface, pointlist, color) * dirty = Rect(pointlist[0], (1, 1)) */ __pyx_t_1 = __Pyx_PyInt_EqObjC(__pyx_v_width, __pyx_int_0, 0, 0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 45; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 45; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (__pyx_t_2) { /* "pygame_sdl2/draw.pyx":46 * def polygon(Surface surface, color, pointlist, width=0): * if width == 0: * gfxdraw.filled_polygon(surface, pointlist, color) # <<<<<<<<<<<<<< * dirty = Rect(pointlist[0], (1, 1)) * n = 1 */ __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_gfxdraw); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 46; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_filled_polygon); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 46; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_3 = NULL; __pyx_t_5 = 0; if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_4))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_4); if (likely(__pyx_t_3)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_4, function); __pyx_t_5 = 1; } } __pyx_t_6 = PyTuple_New(3+__pyx_t_5); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 46; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_6); if (__pyx_t_3) { __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_3); __pyx_t_3 = NULL; } __Pyx_INCREF(((PyObject *)__pyx_v_surface)); __Pyx_GIVEREF(((PyObject *)__pyx_v_surface)); PyTuple_SET_ITEM(__pyx_t_6, 0+__pyx_t_5, ((PyObject *)__pyx_v_surface)); __Pyx_INCREF(__pyx_v_pointlist); __Pyx_GIVEREF(__pyx_v_pointlist); PyTuple_SET_ITEM(__pyx_t_6, 1+__pyx_t_5, __pyx_v_pointlist); __Pyx_INCREF(__pyx_v_color); __Pyx_GIVEREF(__pyx_v_color); PyTuple_SET_ITEM(__pyx_t_6, 2+__pyx_t_5, __pyx_v_color); __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_6, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 46; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "pygame_sdl2/draw.pyx":47 * if width == 0: * gfxdraw.filled_polygon(surface, pointlist, color) * dirty = Rect(pointlist[0], (1, 1)) # <<<<<<<<<<<<<< * n = 1 * while n < len(pointlist): */ __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_Rect); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 47; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); __pyx_t_6 = __Pyx_GetItemInt(__pyx_v_pointlist, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(__pyx_t_6 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 47; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; __Pyx_GOTREF(__pyx_t_6); __pyx_t_3 = NULL; __pyx_t_5 = 0; if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_4))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_4); if (likely(__pyx_t_3)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_4, function); __pyx_t_5 = 1; } } __pyx_t_7 = PyTuple_New(2+__pyx_t_5); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 47; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_7); if (__pyx_t_3) { __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_3); __pyx_t_3 = NULL; } __Pyx_GIVEREF(__pyx_t_6); PyTuple_SET_ITEM(__pyx_t_7, 0+__pyx_t_5, __pyx_t_6); __Pyx_INCREF(__pyx_tuple_); __Pyx_GIVEREF(__pyx_tuple_); PyTuple_SET_ITEM(__pyx_t_7, 1+__pyx_t_5, __pyx_tuple_); __pyx_t_6 = 0; __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_7, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 47; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_v_dirty = __pyx_t_1; __pyx_t_1 = 0; /* "pygame_sdl2/draw.pyx":48 * gfxdraw.filled_polygon(surface, pointlist, color) * dirty = Rect(pointlist[0], (1, 1)) * n = 1 # <<<<<<<<<<<<<< * while n < len(pointlist): * dirty.union_ip(Rect(pointlist[n], (1,1))) */ __Pyx_INCREF(__pyx_int_1); __pyx_v_n = __pyx_int_1; /* "pygame_sdl2/draw.pyx":49 * dirty = Rect(pointlist[0], (1, 1)) * n = 1 * while n < len(pointlist): # <<<<<<<<<<<<<< * dirty.union_ip(Rect(pointlist[n], (1,1))) * n += 1 */ while (1) { __pyx_t_5 = PyObject_Length(__pyx_v_pointlist); if (unlikely(__pyx_t_5 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 49; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_t_1 = PyInt_FromSsize_t(__pyx_t_5); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 49; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_t_4 = PyObject_RichCompare(__pyx_v_n, __pyx_t_1, Py_LT); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 49; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 49; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; if (!__pyx_t_2) break; /* "pygame_sdl2/draw.pyx":50 * n = 1 * while n < len(pointlist): * dirty.union_ip(Rect(pointlist[n], (1,1))) # <<<<<<<<<<<<<< * n += 1 * return dirty.clip(surface.get_rect()) */ __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_dirty, __pyx_n_s_union_ip); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 50; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_t_6 = __Pyx_GetModuleGlobalName(__pyx_n_s_Rect); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 50; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_6); __pyx_t_3 = PyObject_GetItem(__pyx_v_pointlist, __pyx_v_n); if (unlikely(__pyx_t_3 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 50; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; __Pyx_GOTREF(__pyx_t_3); __pyx_t_8 = NULL; __pyx_t_5 = 0; if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_6))) { __pyx_t_8 = PyMethod_GET_SELF(__pyx_t_6); if (likely(__pyx_t_8)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6); __Pyx_INCREF(__pyx_t_8); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_6, function); __pyx_t_5 = 1; } } __pyx_t_9 = PyTuple_New(2+__pyx_t_5); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 50; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_9); if (__pyx_t_8) { __Pyx_GIVEREF(__pyx_t_8); PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_t_8); __pyx_t_8 = NULL; } __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_9, 0+__pyx_t_5, __pyx_t_3); __Pyx_INCREF(__pyx_tuple__2); __Pyx_GIVEREF(__pyx_tuple__2); PyTuple_SET_ITEM(__pyx_t_9, 1+__pyx_t_5, __pyx_tuple__2); __pyx_t_3 = 0; __pyx_t_7 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_9, NULL); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 50; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __pyx_t_6 = NULL; if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_1))) { __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_1); if (likely(__pyx_t_6)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1); __Pyx_INCREF(__pyx_t_6); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_1, function); } } if (!__pyx_t_6) { __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_t_1, __pyx_t_7); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 50; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_GOTREF(__pyx_t_4); } else { __pyx_t_9 = PyTuple_New(1+1); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 50; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_9); __Pyx_GIVEREF(__pyx_t_6); PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_t_6); __pyx_t_6 = NULL; __Pyx_GIVEREF(__pyx_t_7); PyTuple_SET_ITEM(__pyx_t_9, 0+1, __pyx_t_7); __pyx_t_7 = 0; __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_9, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 50; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; /* "pygame_sdl2/draw.pyx":51 * while n < len(pointlist): * dirty.union_ip(Rect(pointlist[n], (1,1))) * n += 1 # <<<<<<<<<<<<<< * return dirty.clip(surface.get_rect()) * else: */ __pyx_t_4 = __Pyx_PyInt_AddObjC(__pyx_v_n, __pyx_int_1, 1, 1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 51; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF_SET(__pyx_v_n, __pyx_t_4); __pyx_t_4 = 0; } /* "pygame_sdl2/draw.pyx":52 * dirty.union_ip(Rect(pointlist[n], (1,1))) * n += 1 * return dirty.clip(surface.get_rect()) # <<<<<<<<<<<<<< * else: * return lines(surface, color, True, pointlist, width) */ __Pyx_XDECREF(__pyx_r); __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_dirty, __pyx_n_s_clip); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 52; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_t_7 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_surface), __pyx_n_s_get_rect); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 52; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_7); __pyx_t_6 = NULL; if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_7))) { __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_7); if (likely(__pyx_t_6)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_7); __Pyx_INCREF(__pyx_t_6); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_7, function); } } if (__pyx_t_6) { __pyx_t_9 = __Pyx_PyObject_CallOneArg(__pyx_t_7, __pyx_t_6); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 52; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; } else { __pyx_t_9 = __Pyx_PyObject_CallNoArg(__pyx_t_7); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 52; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } __Pyx_GOTREF(__pyx_t_9); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __pyx_t_7 = NULL; if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_1))) { __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_1); if (likely(__pyx_t_7)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1); __Pyx_INCREF(__pyx_t_7); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_1, function); } } if (!__pyx_t_7) { __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_t_1, __pyx_t_9); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 52; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; __Pyx_GOTREF(__pyx_t_4); } else { __pyx_t_6 = PyTuple_New(1+1); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 52; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_6); __Pyx_GIVEREF(__pyx_t_7); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_7); __pyx_t_7 = NULL; __Pyx_GIVEREF(__pyx_t_9); PyTuple_SET_ITEM(__pyx_t_6, 0+1, __pyx_t_9); __pyx_t_9 = 0; __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_6, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 52; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_r = __pyx_t_4; __pyx_t_4 = 0; goto __pyx_L0; /* "pygame_sdl2/draw.pyx":45 * * def polygon(Surface surface, color, pointlist, width=0): * if width == 0: # <<<<<<<<<<<<<< * gfxdraw.filled_polygon(surface, pointlist, color) * dirty = Rect(pointlist[0], (1, 1)) */ } /* "pygame_sdl2/draw.pyx":54 * return dirty.clip(surface.get_rect()) * else: * return lines(surface, color, True, pointlist, width) # <<<<<<<<<<<<<< * * def circle(Surface surface, color, pos, radius, width=0): */ /*else*/ { __Pyx_XDECREF(__pyx_r); __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_lines); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 54; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_t_6 = NULL; __pyx_t_5 = 0; if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_1))) { __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_1); if (likely(__pyx_t_6)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1); __Pyx_INCREF(__pyx_t_6); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_1, function); __pyx_t_5 = 1; } } __pyx_t_9 = PyTuple_New(5+__pyx_t_5); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 54; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_9); if (__pyx_t_6) { __Pyx_GIVEREF(__pyx_t_6); PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_t_6); __pyx_t_6 = NULL; } __Pyx_INCREF(((PyObject *)__pyx_v_surface)); __Pyx_GIVEREF(((PyObject *)__pyx_v_surface)); PyTuple_SET_ITEM(__pyx_t_9, 0+__pyx_t_5, ((PyObject *)__pyx_v_surface)); __Pyx_INCREF(__pyx_v_color); __Pyx_GIVEREF(__pyx_v_color); PyTuple_SET_ITEM(__pyx_t_9, 1+__pyx_t_5, __pyx_v_color); __Pyx_INCREF(Py_True); __Pyx_GIVEREF(Py_True); PyTuple_SET_ITEM(__pyx_t_9, 2+__pyx_t_5, Py_True); __Pyx_INCREF(__pyx_v_pointlist); __Pyx_GIVEREF(__pyx_v_pointlist); PyTuple_SET_ITEM(__pyx_t_9, 3+__pyx_t_5, __pyx_v_pointlist); __Pyx_INCREF(__pyx_v_width); __Pyx_GIVEREF(__pyx_v_width); PyTuple_SET_ITEM(__pyx_t_9, 4+__pyx_t_5, __pyx_v_width); __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_9, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 54; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_r = __pyx_t_4; __pyx_t_4 = 0; goto __pyx_L0; } /* "pygame_sdl2/draw.pyx":44 * return dirty.clip(surface.get_rect()) * * def polygon(Surface surface, color, pointlist, width=0): # <<<<<<<<<<<<<< * if width == 0: * gfxdraw.filled_polygon(surface, pointlist, color) */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_6); __Pyx_XDECREF(__pyx_t_7); __Pyx_XDECREF(__pyx_t_8); __Pyx_XDECREF(__pyx_t_9); __Pyx_AddTraceback("pygame_sdl2.draw.polygon", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF(__pyx_v_dirty); __Pyx_XDECREF(__pyx_v_n); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/draw.pyx":56 * return lines(surface, color, True, pointlist, width) * * def circle(Surface surface, color, pos, radius, width=0): # <<<<<<<<<<<<<< * x, y = pos * if width == 0: */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_4draw_5circle(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static PyMethodDef __pyx_mdef_11pygame_sdl2_4draw_5circle = {"circle", (PyCFunction)__pyx_pw_11pygame_sdl2_4draw_5circle, METH_VARARGS|METH_KEYWORDS, 0}; static PyObject *__pyx_pw_11pygame_sdl2_4draw_5circle(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { struct __pyx_obj_11pygame_sdl2_7surface_Surface *__pyx_v_surface = 0; PyObject *__pyx_v_color = 0; PyObject *__pyx_v_pos = 0; PyObject *__pyx_v_radius = 0; PyObject *__pyx_v_width = 0; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("circle (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_surface,&__pyx_n_s_color,&__pyx_n_s_pos,&__pyx_n_s_radius,&__pyx_n_s_width,0}; PyObject* values[5] = {0,0,0,0,0}; values[4] = ((PyObject *)__pyx_int_0); if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4); case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_surface)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; case 1: if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_color)) != 0)) kw_args--; else { __Pyx_RaiseArgtupleInvalid("circle", 0, 4, 5, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 56; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } case 2: if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_pos)) != 0)) kw_args--; else { __Pyx_RaiseArgtupleInvalid("circle", 0, 4, 5, 2); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 56; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } case 3: if (likely((values[3] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_radius)) != 0)) kw_args--; else { __Pyx_RaiseArgtupleInvalid("circle", 0, 4, 5, 3); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 56; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } case 4: if (kw_args > 0) { PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_width); if (value) { values[4] = value; kw_args--; } } } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "circle") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 56; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } } else { switch (PyTuple_GET_SIZE(__pyx_args)) { case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4); case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); values[2] = PyTuple_GET_ITEM(__pyx_args, 2); values[1] = PyTuple_GET_ITEM(__pyx_args, 1); values[0] = PyTuple_GET_ITEM(__pyx_args, 0); break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_surface = ((struct __pyx_obj_11pygame_sdl2_7surface_Surface *)values[0]); __pyx_v_color = values[1]; __pyx_v_pos = values[2]; __pyx_v_radius = values[3]; __pyx_v_width = values[4]; } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("circle", 0, 4, 5, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 56; __pyx_clineno = __LINE__; goto __pyx_L3_error;} __pyx_L3_error:; __Pyx_AddTraceback("pygame_sdl2.draw.circle", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_surface), __pyx_ptype_11pygame_sdl2_7surface_Surface, 1, "surface", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 56; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_r = __pyx_pf_11pygame_sdl2_4draw_4circle(__pyx_self, __pyx_v_surface, __pyx_v_color, __pyx_v_pos, __pyx_v_radius, __pyx_v_width); /* function exit code */ goto __pyx_L0; __pyx_L1_error:; __pyx_r = NULL; __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_4draw_4circle(CYTHON_UNUSED PyObject *__pyx_self, struct __pyx_obj_11pygame_sdl2_7surface_Surface *__pyx_v_surface, PyObject *__pyx_v_color, PyObject *__pyx_v_pos, PyObject *__pyx_v_radius, PyObject *__pyx_v_width) { PyObject *__pyx_v_x = NULL; PyObject *__pyx_v_y = NULL; PyObject *__pyx_v_dirty = NULL; PyObject *__pyx_v_n = NULL; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; PyObject *(*__pyx_t_4)(PyObject *); int __pyx_t_5; Py_ssize_t __pyx_t_6; PyObject *__pyx_t_7 = NULL; PyObject *__pyx_t_8 = NULL; PyObject *__pyx_t_9 = NULL; PyObject *__pyx_t_10 = NULL; PyObject *__pyx_t_11 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("circle", 0); /* "pygame_sdl2/draw.pyx":57 * * def circle(Surface surface, color, pos, radius, width=0): * x, y = pos # <<<<<<<<<<<<<< * if width == 0: * gfxdraw.filled_circle(surface, x, y, radius, color) */ if ((likely(PyTuple_CheckExact(__pyx_v_pos))) || (PyList_CheckExact(__pyx_v_pos))) { PyObject* sequence = __pyx_v_pos; #if CYTHON_COMPILING_IN_CPYTHON Py_ssize_t size = Py_SIZE(sequence); #else Py_ssize_t size = PySequence_Size(sequence); #endif if (unlikely(size != 2)) { if (size > 2) __Pyx_RaiseTooManyValuesError(2); else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 57; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } #if CYTHON_COMPILING_IN_CPYTHON if (likely(PyTuple_CheckExact(sequence))) { __pyx_t_1 = PyTuple_GET_ITEM(sequence, 0); __pyx_t_2 = PyTuple_GET_ITEM(sequence, 1); } else { __pyx_t_1 = PyList_GET_ITEM(sequence, 0); __pyx_t_2 = PyList_GET_ITEM(sequence, 1); } __Pyx_INCREF(__pyx_t_1); __Pyx_INCREF(__pyx_t_2); #else __pyx_t_1 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 57; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 57; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); #endif } else { Py_ssize_t index = -1; __pyx_t_3 = PyObject_GetIter(__pyx_v_pos); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 57; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = Py_TYPE(__pyx_t_3)->tp_iternext; index = 0; __pyx_t_1 = __pyx_t_4(__pyx_t_3); if (unlikely(!__pyx_t_1)) goto __pyx_L3_unpacking_failed; __Pyx_GOTREF(__pyx_t_1); index = 1; __pyx_t_2 = __pyx_t_4(__pyx_t_3); if (unlikely(!__pyx_t_2)) goto __pyx_L3_unpacking_failed; __Pyx_GOTREF(__pyx_t_2); if (__Pyx_IternextUnpackEndCheck(__pyx_t_4(__pyx_t_3), 2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 57; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_t_4 = NULL; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; goto __pyx_L4_unpacking_done; __pyx_L3_unpacking_failed:; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_4 = NULL; if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 57; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_L4_unpacking_done:; } __pyx_v_x = __pyx_t_1; __pyx_t_1 = 0; __pyx_v_y = __pyx_t_2; __pyx_t_2 = 0; /* "pygame_sdl2/draw.pyx":58 * def circle(Surface surface, color, pos, radius, width=0): * x, y = pos * if width == 0: # <<<<<<<<<<<<<< * gfxdraw.filled_circle(surface, x, y, radius, color) * dirty = Rect((x - radius, y - radius), (radius*2, radius*2)) */ __pyx_t_2 = __Pyx_PyInt_EqObjC(__pyx_v_width, __pyx_int_0, 0, 0); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 58; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_5 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 58; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; if (__pyx_t_5) { /* "pygame_sdl2/draw.pyx":59 * x, y = pos * if width == 0: * gfxdraw.filled_circle(surface, x, y, radius, color) # <<<<<<<<<<<<<< * dirty = Rect((x - radius, y - radius), (radius*2, radius*2)) * return dirty.clip(surface.get_rect()) */ __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_gfxdraw); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 59; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_filled_circle); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 59; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_1 = NULL; __pyx_t_6 = 0; if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_3))) { __pyx_t_1 = PyMethod_GET_SELF(__pyx_t_3); if (likely(__pyx_t_1)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); __Pyx_INCREF(__pyx_t_1); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_3, function); __pyx_t_6 = 1; } } __pyx_t_7 = PyTuple_New(5+__pyx_t_6); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 59; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_7); if (__pyx_t_1) { __Pyx_GIVEREF(__pyx_t_1); PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_1); __pyx_t_1 = NULL; } __Pyx_INCREF(((PyObject *)__pyx_v_surface)); __Pyx_GIVEREF(((PyObject *)__pyx_v_surface)); PyTuple_SET_ITEM(__pyx_t_7, 0+__pyx_t_6, ((PyObject *)__pyx_v_surface)); __Pyx_INCREF(__pyx_v_x); __Pyx_GIVEREF(__pyx_v_x); PyTuple_SET_ITEM(__pyx_t_7, 1+__pyx_t_6, __pyx_v_x); __Pyx_INCREF(__pyx_v_y); __Pyx_GIVEREF(__pyx_v_y); PyTuple_SET_ITEM(__pyx_t_7, 2+__pyx_t_6, __pyx_v_y); __Pyx_INCREF(__pyx_v_radius); __Pyx_GIVEREF(__pyx_v_radius); PyTuple_SET_ITEM(__pyx_t_7, 3+__pyx_t_6, __pyx_v_radius); __Pyx_INCREF(__pyx_v_color); __Pyx_GIVEREF(__pyx_v_color); PyTuple_SET_ITEM(__pyx_t_7, 4+__pyx_t_6, __pyx_v_color); __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_7, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 59; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "pygame_sdl2/draw.pyx":60 * if width == 0: * gfxdraw.filled_circle(surface, x, y, radius, color) * dirty = Rect((x - radius, y - radius), (radius*2, radius*2)) # <<<<<<<<<<<<<< * return dirty.clip(surface.get_rect()) * else: */ __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_Rect); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 60; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __pyx_t_7 = PyNumber_Subtract(__pyx_v_x, __pyx_v_radius); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 60; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_7); __pyx_t_1 = PyNumber_Subtract(__pyx_v_y, __pyx_v_radius); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 60; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_t_8 = PyTuple_New(2); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 60; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_8); __Pyx_GIVEREF(__pyx_t_7); PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_7); __Pyx_GIVEREF(__pyx_t_1); PyTuple_SET_ITEM(__pyx_t_8, 1, __pyx_t_1); __pyx_t_7 = 0; __pyx_t_1 = 0; __pyx_t_1 = PyNumber_Multiply(__pyx_v_radius, __pyx_int_2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 60; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_t_7 = PyNumber_Multiply(__pyx_v_radius, __pyx_int_2); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 60; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_7); __pyx_t_9 = PyTuple_New(2); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 60; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_9); __Pyx_GIVEREF(__pyx_t_1); PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_t_1); __Pyx_GIVEREF(__pyx_t_7); PyTuple_SET_ITEM(__pyx_t_9, 1, __pyx_t_7); __pyx_t_1 = 0; __pyx_t_7 = 0; __pyx_t_7 = NULL; __pyx_t_6 = 0; if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_3))) { __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_3); if (likely(__pyx_t_7)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); __Pyx_INCREF(__pyx_t_7); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_3, function); __pyx_t_6 = 1; } } __pyx_t_1 = PyTuple_New(2+__pyx_t_6); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 60; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); if (__pyx_t_7) { __Pyx_GIVEREF(__pyx_t_7); PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_7); __pyx_t_7 = NULL; } __Pyx_GIVEREF(__pyx_t_8); PyTuple_SET_ITEM(__pyx_t_1, 0+__pyx_t_6, __pyx_t_8); __Pyx_GIVEREF(__pyx_t_9); PyTuple_SET_ITEM(__pyx_t_1, 1+__pyx_t_6, __pyx_t_9); __pyx_t_8 = 0; __pyx_t_9 = 0; __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_1, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 60; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_v_dirty = __pyx_t_2; __pyx_t_2 = 0; /* "pygame_sdl2/draw.pyx":61 * gfxdraw.filled_circle(surface, x, y, radius, color) * dirty = Rect((x - radius, y - radius), (radius*2, radius*2)) * return dirty.clip(surface.get_rect()) # <<<<<<<<<<<<<< * else: * gfxdraw.circle(surface, x, y, radius, color) */ __Pyx_XDECREF(__pyx_r); __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_dirty, __pyx_n_s_clip); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 61; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __pyx_t_9 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_surface), __pyx_n_s_get_rect); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 61; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_9); __pyx_t_8 = NULL; if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_9))) { __pyx_t_8 = PyMethod_GET_SELF(__pyx_t_9); if (likely(__pyx_t_8)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_9); __Pyx_INCREF(__pyx_t_8); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_9, function); } } if (__pyx_t_8) { __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_9, __pyx_t_8); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 61; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; } else { __pyx_t_1 = __Pyx_PyObject_CallNoArg(__pyx_t_9); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 61; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; __pyx_t_9 = NULL; if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_3))) { __pyx_t_9 = PyMethod_GET_SELF(__pyx_t_3); if (likely(__pyx_t_9)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); __Pyx_INCREF(__pyx_t_9); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_3, function); } } if (!__pyx_t_9) { __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 61; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_GOTREF(__pyx_t_2); } else { __pyx_t_8 = PyTuple_New(1+1); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 61; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_8); __Pyx_GIVEREF(__pyx_t_9); PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_9); __pyx_t_9 = NULL; __Pyx_GIVEREF(__pyx_t_1); PyTuple_SET_ITEM(__pyx_t_8, 0+1, __pyx_t_1); __pyx_t_1 = 0; __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_8, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 61; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; } __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; /* "pygame_sdl2/draw.pyx":58 * def circle(Surface surface, color, pos, radius, width=0): * x, y = pos * if width == 0: # <<<<<<<<<<<<<< * gfxdraw.filled_circle(surface, x, y, radius, color) * dirty = Rect((x - radius, y - radius), (radius*2, radius*2)) */ } /* "pygame_sdl2/draw.pyx":63 * return dirty.clip(surface.get_rect()) * else: * gfxdraw.circle(surface, x, y, radius, color) # <<<<<<<<<<<<<< * n = 1 * while n < width: */ /*else*/ { __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_gfxdraw); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 63; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_circle); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 63; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_8); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_3 = NULL; __pyx_t_6 = 0; if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_8))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_8); if (likely(__pyx_t_3)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_8); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_8, function); __pyx_t_6 = 1; } } __pyx_t_1 = PyTuple_New(5+__pyx_t_6); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 63; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); if (__pyx_t_3) { __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_3); __pyx_t_3 = NULL; } __Pyx_INCREF(((PyObject *)__pyx_v_surface)); __Pyx_GIVEREF(((PyObject *)__pyx_v_surface)); PyTuple_SET_ITEM(__pyx_t_1, 0+__pyx_t_6, ((PyObject *)__pyx_v_surface)); __Pyx_INCREF(__pyx_v_x); __Pyx_GIVEREF(__pyx_v_x); PyTuple_SET_ITEM(__pyx_t_1, 1+__pyx_t_6, __pyx_v_x); __Pyx_INCREF(__pyx_v_y); __Pyx_GIVEREF(__pyx_v_y); PyTuple_SET_ITEM(__pyx_t_1, 2+__pyx_t_6, __pyx_v_y); __Pyx_INCREF(__pyx_v_radius); __Pyx_GIVEREF(__pyx_v_radius); PyTuple_SET_ITEM(__pyx_t_1, 3+__pyx_t_6, __pyx_v_radius); __Pyx_INCREF(__pyx_v_color); __Pyx_GIVEREF(__pyx_v_color); PyTuple_SET_ITEM(__pyx_t_1, 4+__pyx_t_6, __pyx_v_color); __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_8, __pyx_t_1, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 63; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "pygame_sdl2/draw.pyx":64 * else: * gfxdraw.circle(surface, x, y, radius, color) * n = 1 # <<<<<<<<<<<<<< * while n < width: * gfxdraw.circle(surface, x, y, radius - 1, color) */ __Pyx_INCREF(__pyx_int_1); __pyx_v_n = __pyx_int_1; /* "pygame_sdl2/draw.pyx":65 * gfxdraw.circle(surface, x, y, radius, color) * n = 1 * while n < width: # <<<<<<<<<<<<<< * gfxdraw.circle(surface, x, y, radius - 1, color) * gfxdraw.circle(surface, x, y, radius + 1, color) */ while (1) { __pyx_t_2 = PyObject_RichCompare(__pyx_v_n, __pyx_v_width, Py_LT); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 65; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_5 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 65; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; if (!__pyx_t_5) break; /* "pygame_sdl2/draw.pyx":66 * n = 1 * while n < width: * gfxdraw.circle(surface, x, y, radius - 1, color) # <<<<<<<<<<<<<< * gfxdraw.circle(surface, x, y, radius + 1, color) * n += 1 */ __pyx_t_8 = __Pyx_GetModuleGlobalName(__pyx_n_s_gfxdraw); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 66; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_8); __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_8, __pyx_n_s_circle); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 66; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; __pyx_t_8 = __Pyx_PyInt_SubtractObjC(__pyx_v_radius, __pyx_int_1, 1, 0); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 66; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_8); __pyx_t_3 = NULL; __pyx_t_6 = 0; if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_1))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_1); if (likely(__pyx_t_3)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_1, function); __pyx_t_6 = 1; } } __pyx_t_9 = PyTuple_New(5+__pyx_t_6); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 66; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_9); if (__pyx_t_3) { __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_t_3); __pyx_t_3 = NULL; } __Pyx_INCREF(((PyObject *)__pyx_v_surface)); __Pyx_GIVEREF(((PyObject *)__pyx_v_surface)); PyTuple_SET_ITEM(__pyx_t_9, 0+__pyx_t_6, ((PyObject *)__pyx_v_surface)); __Pyx_INCREF(__pyx_v_x); __Pyx_GIVEREF(__pyx_v_x); PyTuple_SET_ITEM(__pyx_t_9, 1+__pyx_t_6, __pyx_v_x); __Pyx_INCREF(__pyx_v_y); __Pyx_GIVEREF(__pyx_v_y); PyTuple_SET_ITEM(__pyx_t_9, 2+__pyx_t_6, __pyx_v_y); __Pyx_GIVEREF(__pyx_t_8); PyTuple_SET_ITEM(__pyx_t_9, 3+__pyx_t_6, __pyx_t_8); __Pyx_INCREF(__pyx_v_color); __Pyx_GIVEREF(__pyx_v_color); PyTuple_SET_ITEM(__pyx_t_9, 4+__pyx_t_6, __pyx_v_color); __pyx_t_8 = 0; __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_9, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 66; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "pygame_sdl2/draw.pyx":67 * while n < width: * gfxdraw.circle(surface, x, y, radius - 1, color) * gfxdraw.circle(surface, x, y, radius + 1, color) # <<<<<<<<<<<<<< * n += 1 * dirty = Rect(x - radius - width, y - radius - width, (radius*2) + width, (radius*2) + width) */ __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_gfxdraw); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 67; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_circle); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 67; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_9); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_1 = __Pyx_PyInt_AddObjC(__pyx_v_radius, __pyx_int_1, 1, 0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 67; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_t_8 = NULL; __pyx_t_6 = 0; if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_9))) { __pyx_t_8 = PyMethod_GET_SELF(__pyx_t_9); if (likely(__pyx_t_8)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_9); __Pyx_INCREF(__pyx_t_8); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_9, function); __pyx_t_6 = 1; } } __pyx_t_3 = PyTuple_New(5+__pyx_t_6); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 67; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); if (__pyx_t_8) { __Pyx_GIVEREF(__pyx_t_8); PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_8); __pyx_t_8 = NULL; } __Pyx_INCREF(((PyObject *)__pyx_v_surface)); __Pyx_GIVEREF(((PyObject *)__pyx_v_surface)); PyTuple_SET_ITEM(__pyx_t_3, 0+__pyx_t_6, ((PyObject *)__pyx_v_surface)); __Pyx_INCREF(__pyx_v_x); __Pyx_GIVEREF(__pyx_v_x); PyTuple_SET_ITEM(__pyx_t_3, 1+__pyx_t_6, __pyx_v_x); __Pyx_INCREF(__pyx_v_y); __Pyx_GIVEREF(__pyx_v_y); PyTuple_SET_ITEM(__pyx_t_3, 2+__pyx_t_6, __pyx_v_y); __Pyx_GIVEREF(__pyx_t_1); PyTuple_SET_ITEM(__pyx_t_3, 3+__pyx_t_6, __pyx_t_1); __Pyx_INCREF(__pyx_v_color); __Pyx_GIVEREF(__pyx_v_color); PyTuple_SET_ITEM(__pyx_t_3, 4+__pyx_t_6, __pyx_v_color); __pyx_t_1 = 0; __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_9, __pyx_t_3, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 67; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "pygame_sdl2/draw.pyx":68 * gfxdraw.circle(surface, x, y, radius - 1, color) * gfxdraw.circle(surface, x, y, radius + 1, color) * n += 1 # <<<<<<<<<<<<<< * dirty = Rect(x - radius - width, y - radius - width, (radius*2) + width, (radius*2) + width) * return dirty.clip(surface.get_rect()) */ __pyx_t_2 = __Pyx_PyInt_AddObjC(__pyx_v_n, __pyx_int_1, 1, 1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 68; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF_SET(__pyx_v_n, __pyx_t_2); __pyx_t_2 = 0; } /* "pygame_sdl2/draw.pyx":69 * gfxdraw.circle(surface, x, y, radius + 1, color) * n += 1 * dirty = Rect(x - radius - width, y - radius - width, (radius*2) + width, (radius*2) + width) # <<<<<<<<<<<<<< * return dirty.clip(surface.get_rect()) * */ __pyx_t_9 = __Pyx_GetModuleGlobalName(__pyx_n_s_Rect); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 69; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_9); __pyx_t_3 = PyNumber_Subtract(__pyx_v_x, __pyx_v_radius); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 69; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __pyx_t_1 = PyNumber_Subtract(__pyx_t_3, __pyx_v_width); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 69; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_3 = PyNumber_Subtract(__pyx_v_y, __pyx_v_radius); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 69; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __pyx_t_8 = PyNumber_Subtract(__pyx_t_3, __pyx_v_width); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 69; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_8); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_3 = PyNumber_Multiply(__pyx_v_radius, __pyx_int_2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 69; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __pyx_t_7 = PyNumber_Add(__pyx_t_3, __pyx_v_width); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 69; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_3 = PyNumber_Multiply(__pyx_v_radius, __pyx_int_2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 69; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __pyx_t_10 = PyNumber_Add(__pyx_t_3, __pyx_v_width); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 69; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_10); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_3 = NULL; __pyx_t_6 = 0; if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_9))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_9); if (likely(__pyx_t_3)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_9); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_9, function); __pyx_t_6 = 1; } } __pyx_t_11 = PyTuple_New(4+__pyx_t_6); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 69; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_11); if (__pyx_t_3) { __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_11, 0, __pyx_t_3); __pyx_t_3 = NULL; } __Pyx_GIVEREF(__pyx_t_1); PyTuple_SET_ITEM(__pyx_t_11, 0+__pyx_t_6, __pyx_t_1); __Pyx_GIVEREF(__pyx_t_8); PyTuple_SET_ITEM(__pyx_t_11, 1+__pyx_t_6, __pyx_t_8); __Pyx_GIVEREF(__pyx_t_7); PyTuple_SET_ITEM(__pyx_t_11, 2+__pyx_t_6, __pyx_t_7); __Pyx_GIVEREF(__pyx_t_10); PyTuple_SET_ITEM(__pyx_t_11, 3+__pyx_t_6, __pyx_t_10); __pyx_t_1 = 0; __pyx_t_8 = 0; __pyx_t_7 = 0; __pyx_t_10 = 0; __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_9, __pyx_t_11, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 69; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; __pyx_v_dirty = __pyx_t_2; __pyx_t_2 = 0; /* "pygame_sdl2/draw.pyx":70 * n += 1 * dirty = Rect(x - radius - width, y - radius - width, (radius*2) + width, (radius*2) + width) * return dirty.clip(surface.get_rect()) # <<<<<<<<<<<<<< * * def ellipse(Surface surface, color, rect, width=0): */ __Pyx_XDECREF(__pyx_r); __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_dirty, __pyx_n_s_clip); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 70; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_9); __pyx_t_10 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_surface), __pyx_n_s_get_rect); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 70; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_10); __pyx_t_7 = NULL; if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_10))) { __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_10); if (likely(__pyx_t_7)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_10); __Pyx_INCREF(__pyx_t_7); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_10, function); } } if (__pyx_t_7) { __pyx_t_11 = __Pyx_PyObject_CallOneArg(__pyx_t_10, __pyx_t_7); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 70; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; } else { __pyx_t_11 = __Pyx_PyObject_CallNoArg(__pyx_t_10); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 70; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } __Pyx_GOTREF(__pyx_t_11); __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; __pyx_t_10 = NULL; if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_9))) { __pyx_t_10 = PyMethod_GET_SELF(__pyx_t_9); if (likely(__pyx_t_10)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_9); __Pyx_INCREF(__pyx_t_10); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_9, function); } } if (!__pyx_t_10) { __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_9, __pyx_t_11); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 70; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; __Pyx_GOTREF(__pyx_t_2); } else { __pyx_t_7 = PyTuple_New(1+1); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 70; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_7); __Pyx_GIVEREF(__pyx_t_10); PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_10); __pyx_t_10 = NULL; __Pyx_GIVEREF(__pyx_t_11); PyTuple_SET_ITEM(__pyx_t_7, 0+1, __pyx_t_11); __pyx_t_11 = 0; __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_9, __pyx_t_7, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 70; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; } __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; } /* "pygame_sdl2/draw.pyx":56 * return lines(surface, color, True, pointlist, width) * * def circle(Surface surface, color, pos, radius, width=0): # <<<<<<<<<<<<<< * x, y = pos * if width == 0: */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_7); __Pyx_XDECREF(__pyx_t_8); __Pyx_XDECREF(__pyx_t_9); __Pyx_XDECREF(__pyx_t_10); __Pyx_XDECREF(__pyx_t_11); __Pyx_AddTraceback("pygame_sdl2.draw.circle", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF(__pyx_v_x); __Pyx_XDECREF(__pyx_v_y); __Pyx_XDECREF(__pyx_v_dirty); __Pyx_XDECREF(__pyx_v_n); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/draw.pyx":72 * return dirty.clip(surface.get_rect()) * * def ellipse(Surface surface, color, rect, width=0): # <<<<<<<<<<<<<< * raise error("Not implemented.") * */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_4draw_7ellipse(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static PyMethodDef __pyx_mdef_11pygame_sdl2_4draw_7ellipse = {"ellipse", (PyCFunction)__pyx_pw_11pygame_sdl2_4draw_7ellipse, METH_VARARGS|METH_KEYWORDS, 0}; static PyObject *__pyx_pw_11pygame_sdl2_4draw_7ellipse(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { CYTHON_UNUSED struct __pyx_obj_11pygame_sdl2_7surface_Surface *__pyx_v_surface = 0; CYTHON_UNUSED PyObject *__pyx_v_color = 0; CYTHON_UNUSED PyObject *__pyx_v_rect = 0; CYTHON_UNUSED PyObject *__pyx_v_width = 0; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("ellipse (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_surface,&__pyx_n_s_color,&__pyx_n_s_rect,&__pyx_n_s_width,0}; PyObject* values[4] = {0,0,0,0}; values[3] = ((PyObject *)__pyx_int_0); if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_surface)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; case 1: if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_color)) != 0)) kw_args--; else { __Pyx_RaiseArgtupleInvalid("ellipse", 0, 3, 4, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 72; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } case 2: if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_rect)) != 0)) kw_args--; else { __Pyx_RaiseArgtupleInvalid("ellipse", 0, 3, 4, 2); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 72; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } case 3: if (kw_args > 0) { PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_width); if (value) { values[3] = value; kw_args--; } } } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "ellipse") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 72; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } } else { switch (PyTuple_GET_SIZE(__pyx_args)) { case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); values[1] = PyTuple_GET_ITEM(__pyx_args, 1); values[0] = PyTuple_GET_ITEM(__pyx_args, 0); break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_surface = ((struct __pyx_obj_11pygame_sdl2_7surface_Surface *)values[0]); __pyx_v_color = values[1]; __pyx_v_rect = values[2]; __pyx_v_width = values[3]; } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("ellipse", 0, 3, 4, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 72; __pyx_clineno = __LINE__; goto __pyx_L3_error;} __pyx_L3_error:; __Pyx_AddTraceback("pygame_sdl2.draw.ellipse", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_surface), __pyx_ptype_11pygame_sdl2_7surface_Surface, 1, "surface", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 72; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_r = __pyx_pf_11pygame_sdl2_4draw_6ellipse(__pyx_self, __pyx_v_surface, __pyx_v_color, __pyx_v_rect, __pyx_v_width); /* function exit code */ goto __pyx_L0; __pyx_L1_error:; __pyx_r = NULL; __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_4draw_6ellipse(CYTHON_UNUSED PyObject *__pyx_self, CYTHON_UNUSED struct __pyx_obj_11pygame_sdl2_7surface_Surface *__pyx_v_surface, CYTHON_UNUSED PyObject *__pyx_v_color, CYTHON_UNUSED PyObject *__pyx_v_rect, CYTHON_UNUSED PyObject *__pyx_v_width) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("ellipse", 0); /* "pygame_sdl2/draw.pyx":73 * * def ellipse(Surface surface, color, rect, width=0): * raise error("Not implemented.") # <<<<<<<<<<<<<< * * def arc(Surface surface, color, rect, start_angle, stop_angle, width=1): */ __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_error); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 73; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_tuple__3, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 73; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_Raise(__pyx_t_2, 0, 0, 0); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; {__pyx_filename = __pyx_f[0]; __pyx_lineno = 73; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "pygame_sdl2/draw.pyx":72 * return dirty.clip(surface.get_rect()) * * def ellipse(Surface surface, color, rect, width=0): # <<<<<<<<<<<<<< * raise error("Not implemented.") * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_AddTraceback("pygame_sdl2.draw.ellipse", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/draw.pyx":75 * raise error("Not implemented.") * * def arc(Surface surface, color, rect, start_angle, stop_angle, width=1): # <<<<<<<<<<<<<< * raise error("Not implemented.") * */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_4draw_9arc(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static PyMethodDef __pyx_mdef_11pygame_sdl2_4draw_9arc = {"arc", (PyCFunction)__pyx_pw_11pygame_sdl2_4draw_9arc, METH_VARARGS|METH_KEYWORDS, 0}; static PyObject *__pyx_pw_11pygame_sdl2_4draw_9arc(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { CYTHON_UNUSED struct __pyx_obj_11pygame_sdl2_7surface_Surface *__pyx_v_surface = 0; CYTHON_UNUSED PyObject *__pyx_v_color = 0; CYTHON_UNUSED PyObject *__pyx_v_rect = 0; CYTHON_UNUSED PyObject *__pyx_v_start_angle = 0; CYTHON_UNUSED PyObject *__pyx_v_stop_angle = 0; CYTHON_UNUSED PyObject *__pyx_v_width = 0; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("arc (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_surface,&__pyx_n_s_color,&__pyx_n_s_rect,&__pyx_n_s_start_angle,&__pyx_n_s_stop_angle,&__pyx_n_s_width,0}; PyObject* values[6] = {0,0,0,0,0,0}; values[5] = ((PyObject *)__pyx_int_1); if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5); case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4); case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_surface)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; case 1: if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_color)) != 0)) kw_args--; else { __Pyx_RaiseArgtupleInvalid("arc", 0, 5, 6, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 75; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } case 2: if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_rect)) != 0)) kw_args--; else { __Pyx_RaiseArgtupleInvalid("arc", 0, 5, 6, 2); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 75; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } case 3: if (likely((values[3] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_start_angle)) != 0)) kw_args--; else { __Pyx_RaiseArgtupleInvalid("arc", 0, 5, 6, 3); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 75; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } case 4: if (likely((values[4] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_stop_angle)) != 0)) kw_args--; else { __Pyx_RaiseArgtupleInvalid("arc", 0, 5, 6, 4); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 75; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } case 5: if (kw_args > 0) { PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_width); if (value) { values[5] = value; kw_args--; } } } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "arc") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 75; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } } else { switch (PyTuple_GET_SIZE(__pyx_args)) { case 6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5); case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4); values[3] = PyTuple_GET_ITEM(__pyx_args, 3); values[2] = PyTuple_GET_ITEM(__pyx_args, 2); values[1] = PyTuple_GET_ITEM(__pyx_args, 1); values[0] = PyTuple_GET_ITEM(__pyx_args, 0); break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_surface = ((struct __pyx_obj_11pygame_sdl2_7surface_Surface *)values[0]); __pyx_v_color = values[1]; __pyx_v_rect = values[2]; __pyx_v_start_angle = values[3]; __pyx_v_stop_angle = values[4]; __pyx_v_width = values[5]; } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("arc", 0, 5, 6, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 75; __pyx_clineno = __LINE__; goto __pyx_L3_error;} __pyx_L3_error:; __Pyx_AddTraceback("pygame_sdl2.draw.arc", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_surface), __pyx_ptype_11pygame_sdl2_7surface_Surface, 1, "surface", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 75; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_r = __pyx_pf_11pygame_sdl2_4draw_8arc(__pyx_self, __pyx_v_surface, __pyx_v_color, __pyx_v_rect, __pyx_v_start_angle, __pyx_v_stop_angle, __pyx_v_width); /* function exit code */ goto __pyx_L0; __pyx_L1_error:; __pyx_r = NULL; __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_4draw_8arc(CYTHON_UNUSED PyObject *__pyx_self, CYTHON_UNUSED struct __pyx_obj_11pygame_sdl2_7surface_Surface *__pyx_v_surface, CYTHON_UNUSED PyObject *__pyx_v_color, CYTHON_UNUSED PyObject *__pyx_v_rect, CYTHON_UNUSED PyObject *__pyx_v_start_angle, CYTHON_UNUSED PyObject *__pyx_v_stop_angle, CYTHON_UNUSED PyObject *__pyx_v_width) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("arc", 0); /* "pygame_sdl2/draw.pyx":76 * * def arc(Surface surface, color, rect, start_angle, stop_angle, width=1): * raise error("Not implemented.") # <<<<<<<<<<<<<< * * def line(Surface surface, color, start_pos, end_pos, width=1): */ __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_error); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 76; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_tuple__4, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 76; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_Raise(__pyx_t_2, 0, 0, 0); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; {__pyx_filename = __pyx_f[0]; __pyx_lineno = 76; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "pygame_sdl2/draw.pyx":75 * raise error("Not implemented.") * * def arc(Surface surface, color, rect, start_angle, stop_angle, width=1): # <<<<<<<<<<<<<< * raise error("Not implemented.") * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_AddTraceback("pygame_sdl2.draw.arc", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/draw.pyx":78 * raise error("Not implemented.") * * def line(Surface surface, color, start_pos, end_pos, width=1): # <<<<<<<<<<<<<< * gfxdraw.thick_line(surface, start_pos[0], start_pos[1], * end_pos[0], end_pos[1], width, color) */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_4draw_11line(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static PyMethodDef __pyx_mdef_11pygame_sdl2_4draw_11line = {"line", (PyCFunction)__pyx_pw_11pygame_sdl2_4draw_11line, METH_VARARGS|METH_KEYWORDS, 0}; static PyObject *__pyx_pw_11pygame_sdl2_4draw_11line(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { struct __pyx_obj_11pygame_sdl2_7surface_Surface *__pyx_v_surface = 0; PyObject *__pyx_v_color = 0; PyObject *__pyx_v_start_pos = 0; PyObject *__pyx_v_end_pos = 0; PyObject *__pyx_v_width = 0; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("line (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_surface,&__pyx_n_s_color,&__pyx_n_s_start_pos,&__pyx_n_s_end_pos,&__pyx_n_s_width,0}; PyObject* values[5] = {0,0,0,0,0}; values[4] = ((PyObject *)__pyx_int_1); if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4); case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_surface)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; case 1: if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_color)) != 0)) kw_args--; else { __Pyx_RaiseArgtupleInvalid("line", 0, 4, 5, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 78; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } case 2: if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_start_pos)) != 0)) kw_args--; else { __Pyx_RaiseArgtupleInvalid("line", 0, 4, 5, 2); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 78; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } case 3: if (likely((values[3] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_end_pos)) != 0)) kw_args--; else { __Pyx_RaiseArgtupleInvalid("line", 0, 4, 5, 3); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 78; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } case 4: if (kw_args > 0) { PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_width); if (value) { values[4] = value; kw_args--; } } } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "line") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 78; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } } else { switch (PyTuple_GET_SIZE(__pyx_args)) { case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4); case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); values[2] = PyTuple_GET_ITEM(__pyx_args, 2); values[1] = PyTuple_GET_ITEM(__pyx_args, 1); values[0] = PyTuple_GET_ITEM(__pyx_args, 0); break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_surface = ((struct __pyx_obj_11pygame_sdl2_7surface_Surface *)values[0]); __pyx_v_color = values[1]; __pyx_v_start_pos = values[2]; __pyx_v_end_pos = values[3]; __pyx_v_width = values[4]; } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("line", 0, 4, 5, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 78; __pyx_clineno = __LINE__; goto __pyx_L3_error;} __pyx_L3_error:; __Pyx_AddTraceback("pygame_sdl2.draw.line", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_surface), __pyx_ptype_11pygame_sdl2_7surface_Surface, 1, "surface", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 78; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_r = __pyx_pf_11pygame_sdl2_4draw_10line(__pyx_self, __pyx_v_surface, __pyx_v_color, __pyx_v_start_pos, __pyx_v_end_pos, __pyx_v_width); /* function exit code */ goto __pyx_L0; __pyx_L1_error:; __pyx_r = NULL; __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_4draw_10line(CYTHON_UNUSED PyObject *__pyx_self, struct __pyx_obj_11pygame_sdl2_7surface_Surface *__pyx_v_surface, PyObject *__pyx_v_color, PyObject *__pyx_v_start_pos, PyObject *__pyx_v_end_pos, PyObject *__pyx_v_width) { PyObject *__pyx_v_dirty = NULL; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; PyObject *__pyx_t_5 = NULL; PyObject *__pyx_t_6 = NULL; PyObject *__pyx_t_7 = NULL; Py_ssize_t __pyx_t_8; PyObject *__pyx_t_9 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("line", 0); /* "pygame_sdl2/draw.pyx":79 * * def line(Surface surface, color, start_pos, end_pos, width=1): * gfxdraw.thick_line(surface, start_pos[0], start_pos[1], # <<<<<<<<<<<<<< * end_pos[0], end_pos[1], width, color) * dirty = Rect(start_pos, (width, width)) */ __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_gfxdraw); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 79; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_thick_line); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 79; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_2 = __Pyx_GetItemInt(__pyx_v_start_pos, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(__pyx_t_2 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 79; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; __Pyx_GOTREF(__pyx_t_2); __pyx_t_4 = __Pyx_GetItemInt(__pyx_v_start_pos, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(__pyx_t_4 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 79; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; __Pyx_GOTREF(__pyx_t_4); /* "pygame_sdl2/draw.pyx":80 * def line(Surface surface, color, start_pos, end_pos, width=1): * gfxdraw.thick_line(surface, start_pos[0], start_pos[1], * end_pos[0], end_pos[1], width, color) # <<<<<<<<<<<<<< * dirty = Rect(start_pos, (width, width)) * dirty.union_ip(Rect(end_pos, (width, width))) */ __pyx_t_5 = __Pyx_GetItemInt(__pyx_v_end_pos, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(__pyx_t_5 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 80; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; __Pyx_GOTREF(__pyx_t_5); __pyx_t_6 = __Pyx_GetItemInt(__pyx_v_end_pos, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(__pyx_t_6 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 80; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; __Pyx_GOTREF(__pyx_t_6); __pyx_t_7 = NULL; __pyx_t_8 = 0; if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_3))) { __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_3); if (likely(__pyx_t_7)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); __Pyx_INCREF(__pyx_t_7); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_3, function); __pyx_t_8 = 1; } } __pyx_t_9 = PyTuple_New(7+__pyx_t_8); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 79; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_9); if (__pyx_t_7) { __Pyx_GIVEREF(__pyx_t_7); PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_t_7); __pyx_t_7 = NULL; } __Pyx_INCREF(((PyObject *)__pyx_v_surface)); __Pyx_GIVEREF(((PyObject *)__pyx_v_surface)); PyTuple_SET_ITEM(__pyx_t_9, 0+__pyx_t_8, ((PyObject *)__pyx_v_surface)); __Pyx_GIVEREF(__pyx_t_2); PyTuple_SET_ITEM(__pyx_t_9, 1+__pyx_t_8, __pyx_t_2); __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_9, 2+__pyx_t_8, __pyx_t_4); __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_9, 3+__pyx_t_8, __pyx_t_5); __Pyx_GIVEREF(__pyx_t_6); PyTuple_SET_ITEM(__pyx_t_9, 4+__pyx_t_8, __pyx_t_6); __Pyx_INCREF(__pyx_v_width); __Pyx_GIVEREF(__pyx_v_width); PyTuple_SET_ITEM(__pyx_t_9, 5+__pyx_t_8, __pyx_v_width); __Pyx_INCREF(__pyx_v_color); __Pyx_GIVEREF(__pyx_v_color); PyTuple_SET_ITEM(__pyx_t_9, 6+__pyx_t_8, __pyx_v_color); __pyx_t_2 = 0; __pyx_t_4 = 0; __pyx_t_5 = 0; __pyx_t_6 = 0; __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_9, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 79; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "pygame_sdl2/draw.pyx":81 * gfxdraw.thick_line(surface, start_pos[0], start_pos[1], * end_pos[0], end_pos[1], width, color) * dirty = Rect(start_pos, (width, width)) # <<<<<<<<<<<<<< * dirty.union_ip(Rect(end_pos, (width, width))) * return dirty.clip(surface.get_rect()) */ __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_Rect); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 81; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __pyx_t_9 = PyTuple_New(2); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 81; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_9); __Pyx_INCREF(__pyx_v_width); __Pyx_GIVEREF(__pyx_v_width); PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_v_width); __Pyx_INCREF(__pyx_v_width); __Pyx_GIVEREF(__pyx_v_width); PyTuple_SET_ITEM(__pyx_t_9, 1, __pyx_v_width); __pyx_t_6 = NULL; __pyx_t_8 = 0; if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_3))) { __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_3); if (likely(__pyx_t_6)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); __Pyx_INCREF(__pyx_t_6); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_3, function); __pyx_t_8 = 1; } } __pyx_t_5 = PyTuple_New(2+__pyx_t_8); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 81; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); if (__pyx_t_6) { __Pyx_GIVEREF(__pyx_t_6); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_6); __pyx_t_6 = NULL; } __Pyx_INCREF(__pyx_v_start_pos); __Pyx_GIVEREF(__pyx_v_start_pos); PyTuple_SET_ITEM(__pyx_t_5, 0+__pyx_t_8, __pyx_v_start_pos); __Pyx_GIVEREF(__pyx_t_9); PyTuple_SET_ITEM(__pyx_t_5, 1+__pyx_t_8, __pyx_t_9); __pyx_t_9 = 0; __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_5, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 81; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_v_dirty = __pyx_t_1; __pyx_t_1 = 0; /* "pygame_sdl2/draw.pyx":82 * end_pos[0], end_pos[1], width, color) * dirty = Rect(start_pos, (width, width)) * dirty.union_ip(Rect(end_pos, (width, width))) # <<<<<<<<<<<<<< * return dirty.clip(surface.get_rect()) * */ __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_dirty, __pyx_n_s_union_ip); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 82; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __pyx_t_9 = __Pyx_GetModuleGlobalName(__pyx_n_s_Rect); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 82; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_9); __pyx_t_6 = PyTuple_New(2); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 82; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_6); __Pyx_INCREF(__pyx_v_width); __Pyx_GIVEREF(__pyx_v_width); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_v_width); __Pyx_INCREF(__pyx_v_width); __Pyx_GIVEREF(__pyx_v_width); PyTuple_SET_ITEM(__pyx_t_6, 1, __pyx_v_width); __pyx_t_4 = NULL; __pyx_t_8 = 0; if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_9))) { __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_9); if (likely(__pyx_t_4)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_9); __Pyx_INCREF(__pyx_t_4); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_9, function); __pyx_t_8 = 1; } } __pyx_t_2 = PyTuple_New(2+__pyx_t_8); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 82; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); if (__pyx_t_4) { __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_4); __pyx_t_4 = NULL; } __Pyx_INCREF(__pyx_v_end_pos); __Pyx_GIVEREF(__pyx_v_end_pos); PyTuple_SET_ITEM(__pyx_t_2, 0+__pyx_t_8, __pyx_v_end_pos); __Pyx_GIVEREF(__pyx_t_6); PyTuple_SET_ITEM(__pyx_t_2, 1+__pyx_t_8, __pyx_t_6); __pyx_t_6 = 0; __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_9, __pyx_t_2, NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 82; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; __pyx_t_9 = NULL; if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_3))) { __pyx_t_9 = PyMethod_GET_SELF(__pyx_t_3); if (likely(__pyx_t_9)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); __Pyx_INCREF(__pyx_t_9); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_3, function); } } if (!__pyx_t_9) { __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_5); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 82; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_GOTREF(__pyx_t_1); } else { __pyx_t_2 = PyTuple_New(1+1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 82; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __Pyx_GIVEREF(__pyx_t_9); PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_9); __pyx_t_9 = NULL; __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_2, 0+1, __pyx_t_5); __pyx_t_5 = 0; __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_2, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 82; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "pygame_sdl2/draw.pyx":83 * dirty = Rect(start_pos, (width, width)) * dirty.union_ip(Rect(end_pos, (width, width))) * return dirty.clip(surface.get_rect()) # <<<<<<<<<<<<<< * * def lines(Surface surface, color, closed, pointlist, width=1): */ __Pyx_XDECREF(__pyx_r); __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_dirty, __pyx_n_s_clip); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 83; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __pyx_t_5 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_surface), __pyx_n_s_get_rect); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 83; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); __pyx_t_9 = NULL; if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_5))) { __pyx_t_9 = PyMethod_GET_SELF(__pyx_t_5); if (likely(__pyx_t_9)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5); __Pyx_INCREF(__pyx_t_9); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_5, function); } } if (__pyx_t_9) { __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_t_9); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 83; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; } else { __pyx_t_2 = __Pyx_PyObject_CallNoArg(__pyx_t_5); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 83; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __pyx_t_5 = NULL; if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_3))) { __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_3); if (likely(__pyx_t_5)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); __Pyx_INCREF(__pyx_t_5); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_3, function); } } if (!__pyx_t_5) { __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 83; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_GOTREF(__pyx_t_1); } else { __pyx_t_9 = PyTuple_New(1+1); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 83; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_9); __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_t_5); __pyx_t_5 = NULL; __Pyx_GIVEREF(__pyx_t_2); PyTuple_SET_ITEM(__pyx_t_9, 0+1, __pyx_t_2); __pyx_t_2 = 0; __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_9, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 83; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; } __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "pygame_sdl2/draw.pyx":78 * raise error("Not implemented.") * * def line(Surface surface, color, start_pos, end_pos, width=1): # <<<<<<<<<<<<<< * gfxdraw.thick_line(surface, start_pos[0], start_pos[1], * end_pos[0], end_pos[1], width, color) */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_5); __Pyx_XDECREF(__pyx_t_6); __Pyx_XDECREF(__pyx_t_7); __Pyx_XDECREF(__pyx_t_9); __Pyx_AddTraceback("pygame_sdl2.draw.line", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF(__pyx_v_dirty); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/draw.pyx":85 * return dirty.clip(surface.get_rect()) * * def lines(Surface surface, color, closed, pointlist, width=1): # <<<<<<<<<<<<<< * n = 0 * dirty = Rect(pointlist[0], (width, width)) */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_4draw_13lines(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static PyMethodDef __pyx_mdef_11pygame_sdl2_4draw_13lines = {"lines", (PyCFunction)__pyx_pw_11pygame_sdl2_4draw_13lines, METH_VARARGS|METH_KEYWORDS, 0}; static PyObject *__pyx_pw_11pygame_sdl2_4draw_13lines(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { struct __pyx_obj_11pygame_sdl2_7surface_Surface *__pyx_v_surface = 0; PyObject *__pyx_v_color = 0; PyObject *__pyx_v_closed = 0; PyObject *__pyx_v_pointlist = 0; PyObject *__pyx_v_width = 0; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("lines (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_surface,&__pyx_n_s_color,&__pyx_n_s_closed,&__pyx_n_s_pointlist,&__pyx_n_s_width,0}; PyObject* values[5] = {0,0,0,0,0}; values[4] = ((PyObject *)__pyx_int_1); if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4); case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_surface)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; case 1: if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_color)) != 0)) kw_args--; else { __Pyx_RaiseArgtupleInvalid("lines", 0, 4, 5, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 85; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } case 2: if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_closed)) != 0)) kw_args--; else { __Pyx_RaiseArgtupleInvalid("lines", 0, 4, 5, 2); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 85; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } case 3: if (likely((values[3] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_pointlist)) != 0)) kw_args--; else { __Pyx_RaiseArgtupleInvalid("lines", 0, 4, 5, 3); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 85; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } case 4: if (kw_args > 0) { PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_width); if (value) { values[4] = value; kw_args--; } } } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "lines") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 85; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } } else { switch (PyTuple_GET_SIZE(__pyx_args)) { case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4); case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); values[2] = PyTuple_GET_ITEM(__pyx_args, 2); values[1] = PyTuple_GET_ITEM(__pyx_args, 1); values[0] = PyTuple_GET_ITEM(__pyx_args, 0); break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_surface = ((struct __pyx_obj_11pygame_sdl2_7surface_Surface *)values[0]); __pyx_v_color = values[1]; __pyx_v_closed = values[2]; __pyx_v_pointlist = values[3]; __pyx_v_width = values[4]; } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("lines", 0, 4, 5, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 85; __pyx_clineno = __LINE__; goto __pyx_L3_error;} __pyx_L3_error:; __Pyx_AddTraceback("pygame_sdl2.draw.lines", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_surface), __pyx_ptype_11pygame_sdl2_7surface_Surface, 1, "surface", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 85; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_r = __pyx_pf_11pygame_sdl2_4draw_12lines(__pyx_self, __pyx_v_surface, __pyx_v_color, __pyx_v_closed, __pyx_v_pointlist, __pyx_v_width); /* function exit code */ goto __pyx_L0; __pyx_L1_error:; __pyx_r = NULL; __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_4draw_12lines(CYTHON_UNUSED PyObject *__pyx_self, struct __pyx_obj_11pygame_sdl2_7surface_Surface *__pyx_v_surface, PyObject *__pyx_v_color, PyObject *__pyx_v_closed, PyObject *__pyx_v_pointlist, PyObject *__pyx_v_width) { PyObject *__pyx_v_n = NULL; PyObject *__pyx_v_dirty = NULL; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; PyObject *__pyx_t_5 = NULL; Py_ssize_t __pyx_t_6; PyObject *__pyx_t_7 = NULL; int __pyx_t_8; PyObject *__pyx_t_9 = NULL; PyObject *__pyx_t_10 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("lines", 0); /* "pygame_sdl2/draw.pyx":86 * * def lines(Surface surface, color, closed, pointlist, width=1): * n = 0 # <<<<<<<<<<<<<< * dirty = Rect(pointlist[0], (width, width)) * while n < len(pointlist) - 1: */ __Pyx_INCREF(__pyx_int_0); __pyx_v_n = __pyx_int_0; /* "pygame_sdl2/draw.pyx":87 * def lines(Surface surface, color, closed, pointlist, width=1): * n = 0 * dirty = Rect(pointlist[0], (width, width)) # <<<<<<<<<<<<<< * while n < len(pointlist) - 1: * line(surface, color, pointlist[n], pointlist[n+1], width) */ __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_Rect); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 87; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = __Pyx_GetItemInt(__pyx_v_pointlist, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(__pyx_t_3 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 87; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 87; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); __Pyx_INCREF(__pyx_v_width); __Pyx_GIVEREF(__pyx_v_width); PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_v_width); __Pyx_INCREF(__pyx_v_width); __Pyx_GIVEREF(__pyx_v_width); PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_v_width); __pyx_t_5 = NULL; __pyx_t_6 = 0; if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_2))) { __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_2); if (likely(__pyx_t_5)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_5); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); __pyx_t_6 = 1; } } __pyx_t_7 = PyTuple_New(2+__pyx_t_6); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 87; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_7); if (__pyx_t_5) { __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_5); __pyx_t_5 = NULL; } __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_7, 0+__pyx_t_6, __pyx_t_3); __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_7, 1+__pyx_t_6, __pyx_t_4); __pyx_t_3 = 0; __pyx_t_4 = 0; __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_7, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 87; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_v_dirty = __pyx_t_1; __pyx_t_1 = 0; /* "pygame_sdl2/draw.pyx":88 * n = 0 * dirty = Rect(pointlist[0], (width, width)) * while n < len(pointlist) - 1: # <<<<<<<<<<<<<< * line(surface, color, pointlist[n], pointlist[n+1], width) * dirty.union_ip(Rect(pointlist[n+1], (width, width))) */ while (1) { __pyx_t_6 = PyObject_Length(__pyx_v_pointlist); if (unlikely(__pyx_t_6 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 88; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_t_1 = PyInt_FromSsize_t((__pyx_t_6 - 1)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 88; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = PyObject_RichCompare(__pyx_v_n, __pyx_t_1, Py_LT); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 88; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_8 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_8 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 88; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; if (!__pyx_t_8) break; /* "pygame_sdl2/draw.pyx":89 * dirty = Rect(pointlist[0], (width, width)) * while n < len(pointlist) - 1: * line(surface, color, pointlist[n], pointlist[n+1], width) # <<<<<<<<<<<<<< * dirty.union_ip(Rect(pointlist[n+1], (width, width))) * n += 1 */ __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_line); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 89; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_t_7 = PyObject_GetItem(__pyx_v_pointlist, __pyx_v_n); if (unlikely(__pyx_t_7 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 89; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; __Pyx_GOTREF(__pyx_t_7); __pyx_t_4 = __Pyx_PyInt_AddObjC(__pyx_v_n, __pyx_int_1, 1, 0); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 89; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); __pyx_t_3 = PyObject_GetItem(__pyx_v_pointlist, __pyx_t_4); if (unlikely(__pyx_t_3 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 89; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_t_4 = NULL; __pyx_t_6 = 0; if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_1))) { __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_1); if (likely(__pyx_t_4)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1); __Pyx_INCREF(__pyx_t_4); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_1, function); __pyx_t_6 = 1; } } __pyx_t_5 = PyTuple_New(5+__pyx_t_6); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 89; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); if (__pyx_t_4) { __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_4); __pyx_t_4 = NULL; } __Pyx_INCREF(((PyObject *)__pyx_v_surface)); __Pyx_GIVEREF(((PyObject *)__pyx_v_surface)); PyTuple_SET_ITEM(__pyx_t_5, 0+__pyx_t_6, ((PyObject *)__pyx_v_surface)); __Pyx_INCREF(__pyx_v_color); __Pyx_GIVEREF(__pyx_v_color); PyTuple_SET_ITEM(__pyx_t_5, 1+__pyx_t_6, __pyx_v_color); __Pyx_GIVEREF(__pyx_t_7); PyTuple_SET_ITEM(__pyx_t_5, 2+__pyx_t_6, __pyx_t_7); __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_5, 3+__pyx_t_6, __pyx_t_3); __Pyx_INCREF(__pyx_v_width); __Pyx_GIVEREF(__pyx_v_width); PyTuple_SET_ITEM(__pyx_t_5, 4+__pyx_t_6, __pyx_v_width); __pyx_t_7 = 0; __pyx_t_3 = 0; __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_5, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 89; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "pygame_sdl2/draw.pyx":90 * while n < len(pointlist) - 1: * line(surface, color, pointlist[n], pointlist[n+1], width) * dirty.union_ip(Rect(pointlist[n+1], (width, width))) # <<<<<<<<<<<<<< * n += 1 * if closed: */ __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_dirty, __pyx_n_s_union_ip); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 90; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_Rect); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 90; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __pyx_t_7 = __Pyx_PyInt_AddObjC(__pyx_v_n, __pyx_int_1, 1, 0); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 90; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_7); __pyx_t_4 = PyObject_GetItem(__pyx_v_pointlist, __pyx_t_7); if (unlikely(__pyx_t_4 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 90; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __pyx_t_7 = PyTuple_New(2); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 90; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_7); __Pyx_INCREF(__pyx_v_width); __Pyx_GIVEREF(__pyx_v_width); PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_v_width); __Pyx_INCREF(__pyx_v_width); __Pyx_GIVEREF(__pyx_v_width); PyTuple_SET_ITEM(__pyx_t_7, 1, __pyx_v_width); __pyx_t_9 = NULL; __pyx_t_6 = 0; if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_3))) { __pyx_t_9 = PyMethod_GET_SELF(__pyx_t_3); if (likely(__pyx_t_9)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); __Pyx_INCREF(__pyx_t_9); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_3, function); __pyx_t_6 = 1; } } __pyx_t_10 = PyTuple_New(2+__pyx_t_6); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 90; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_10); if (__pyx_t_9) { __Pyx_GIVEREF(__pyx_t_9); PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_t_9); __pyx_t_9 = NULL; } __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_10, 0+__pyx_t_6, __pyx_t_4); __Pyx_GIVEREF(__pyx_t_7); PyTuple_SET_ITEM(__pyx_t_10, 1+__pyx_t_6, __pyx_t_7); __pyx_t_4 = 0; __pyx_t_7 = 0; __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_10, NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 90; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_3 = NULL; if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_1))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_1); if (likely(__pyx_t_3)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_1, function); } } if (!__pyx_t_3) { __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_1, __pyx_t_5); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 90; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_GOTREF(__pyx_t_2); } else { __pyx_t_10 = PyTuple_New(1+1); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 90; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_10); __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_t_3); __pyx_t_3 = NULL; __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_10, 0+1, __pyx_t_5); __pyx_t_5 = 0; __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_10, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 90; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "pygame_sdl2/draw.pyx":91 * line(surface, color, pointlist[n], pointlist[n+1], width) * dirty.union_ip(Rect(pointlist[n+1], (width, width))) * n += 1 # <<<<<<<<<<<<<< * if closed: * line(surface, color, pointlist[n], pointlist[0], width) */ __pyx_t_2 = __Pyx_PyInt_AddObjC(__pyx_v_n, __pyx_int_1, 1, 1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 91; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF_SET(__pyx_v_n, __pyx_t_2); __pyx_t_2 = 0; } /* "pygame_sdl2/draw.pyx":92 * dirty.union_ip(Rect(pointlist[n+1], (width, width))) * n += 1 * if closed: # <<<<<<<<<<<<<< * line(surface, color, pointlist[n], pointlist[0], width) * return dirty.clip(surface.get_rect()) */ __pyx_t_8 = __Pyx_PyObject_IsTrue(__pyx_v_closed); if (unlikely(__pyx_t_8 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 92; __pyx_clineno = __LINE__; goto __pyx_L1_error;} if (__pyx_t_8) { /* "pygame_sdl2/draw.pyx":93 * n += 1 * if closed: * line(surface, color, pointlist[n], pointlist[0], width) # <<<<<<<<<<<<<< * return dirty.clip(surface.get_rect()) * */ __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_line); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 93; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_t_10 = PyObject_GetItem(__pyx_v_pointlist, __pyx_v_n); if (unlikely(__pyx_t_10 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 93; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; __Pyx_GOTREF(__pyx_t_10); __pyx_t_5 = __Pyx_GetItemInt(__pyx_v_pointlist, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(__pyx_t_5 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 93; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; __Pyx_GOTREF(__pyx_t_5); __pyx_t_3 = NULL; __pyx_t_6 = 0; if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_1))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_1); if (likely(__pyx_t_3)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_1, function); __pyx_t_6 = 1; } } __pyx_t_7 = PyTuple_New(5+__pyx_t_6); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 93; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_7); if (__pyx_t_3) { __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_3); __pyx_t_3 = NULL; } __Pyx_INCREF(((PyObject *)__pyx_v_surface)); __Pyx_GIVEREF(((PyObject *)__pyx_v_surface)); PyTuple_SET_ITEM(__pyx_t_7, 0+__pyx_t_6, ((PyObject *)__pyx_v_surface)); __Pyx_INCREF(__pyx_v_color); __Pyx_GIVEREF(__pyx_v_color); PyTuple_SET_ITEM(__pyx_t_7, 1+__pyx_t_6, __pyx_v_color); __Pyx_GIVEREF(__pyx_t_10); PyTuple_SET_ITEM(__pyx_t_7, 2+__pyx_t_6, __pyx_t_10); __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_7, 3+__pyx_t_6, __pyx_t_5); __Pyx_INCREF(__pyx_v_width); __Pyx_GIVEREF(__pyx_v_width); PyTuple_SET_ITEM(__pyx_t_7, 4+__pyx_t_6, __pyx_v_width); __pyx_t_10 = 0; __pyx_t_5 = 0; __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_7, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 93; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "pygame_sdl2/draw.pyx":92 * dirty.union_ip(Rect(pointlist[n+1], (width, width))) * n += 1 * if closed: # <<<<<<<<<<<<<< * line(surface, color, pointlist[n], pointlist[0], width) * return dirty.clip(surface.get_rect()) */ } /* "pygame_sdl2/draw.pyx":94 * if closed: * line(surface, color, pointlist[n], pointlist[0], width) * return dirty.clip(surface.get_rect()) # <<<<<<<<<<<<<< * * def aaline(Surface surface, color, startpos, endpos, blend=1): */ __Pyx_XDECREF(__pyx_r); __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_dirty, __pyx_n_s_clip); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 94; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_t_5 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_surface), __pyx_n_s_get_rect); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 94; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); __pyx_t_10 = NULL; if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_5))) { __pyx_t_10 = PyMethod_GET_SELF(__pyx_t_5); if (likely(__pyx_t_10)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5); __Pyx_INCREF(__pyx_t_10); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_5, function); } } if (__pyx_t_10) { __pyx_t_7 = __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_t_10); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 94; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; } else { __pyx_t_7 = __Pyx_PyObject_CallNoArg(__pyx_t_5); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 94; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __pyx_t_5 = NULL; if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_1))) { __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_1); if (likely(__pyx_t_5)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1); __Pyx_INCREF(__pyx_t_5); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_1, function); } } if (!__pyx_t_5) { __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_1, __pyx_t_7); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 94; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_GOTREF(__pyx_t_2); } else { __pyx_t_10 = PyTuple_New(1+1); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 94; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_10); __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_t_5); __pyx_t_5 = NULL; __Pyx_GIVEREF(__pyx_t_7); PyTuple_SET_ITEM(__pyx_t_10, 0+1, __pyx_t_7); __pyx_t_7 = 0; __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_10, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 94; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; /* "pygame_sdl2/draw.pyx":85 * return dirty.clip(surface.get_rect()) * * def lines(Surface surface, color, closed, pointlist, width=1): # <<<<<<<<<<<<<< * n = 0 * dirty = Rect(pointlist[0], (width, width)) */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_5); __Pyx_XDECREF(__pyx_t_7); __Pyx_XDECREF(__pyx_t_9); __Pyx_XDECREF(__pyx_t_10); __Pyx_AddTraceback("pygame_sdl2.draw.lines", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF(__pyx_v_n); __Pyx_XDECREF(__pyx_v_dirty); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/draw.pyx":96 * return dirty.clip(surface.get_rect()) * * def aaline(Surface surface, color, startpos, endpos, blend=1): # <<<<<<<<<<<<<< * x1, y1 = startpos * x2, y2 = endpos */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_4draw_15aaline(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static PyMethodDef __pyx_mdef_11pygame_sdl2_4draw_15aaline = {"aaline", (PyCFunction)__pyx_pw_11pygame_sdl2_4draw_15aaline, METH_VARARGS|METH_KEYWORDS, 0}; static PyObject *__pyx_pw_11pygame_sdl2_4draw_15aaline(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { struct __pyx_obj_11pygame_sdl2_7surface_Surface *__pyx_v_surface = 0; PyObject *__pyx_v_color = 0; PyObject *__pyx_v_startpos = 0; PyObject *__pyx_v_endpos = 0; CYTHON_UNUSED PyObject *__pyx_v_blend = 0; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("aaline (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_surface,&__pyx_n_s_color,&__pyx_n_s_startpos,&__pyx_n_s_endpos,&__pyx_n_s_blend,0}; PyObject* values[5] = {0,0,0,0,0}; values[4] = ((PyObject *)__pyx_int_1); if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4); case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_surface)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; case 1: if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_color)) != 0)) kw_args--; else { __Pyx_RaiseArgtupleInvalid("aaline", 0, 4, 5, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 96; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } case 2: if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_startpos)) != 0)) kw_args--; else { __Pyx_RaiseArgtupleInvalid("aaline", 0, 4, 5, 2); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 96; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } case 3: if (likely((values[3] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_endpos)) != 0)) kw_args--; else { __Pyx_RaiseArgtupleInvalid("aaline", 0, 4, 5, 3); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 96; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } case 4: if (kw_args > 0) { PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_blend); if (value) { values[4] = value; kw_args--; } } } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "aaline") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 96; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } } else { switch (PyTuple_GET_SIZE(__pyx_args)) { case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4); case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); values[2] = PyTuple_GET_ITEM(__pyx_args, 2); values[1] = PyTuple_GET_ITEM(__pyx_args, 1); values[0] = PyTuple_GET_ITEM(__pyx_args, 0); break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_surface = ((struct __pyx_obj_11pygame_sdl2_7surface_Surface *)values[0]); __pyx_v_color = values[1]; __pyx_v_startpos = values[2]; __pyx_v_endpos = values[3]; __pyx_v_blend = values[4]; } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("aaline", 0, 4, 5, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 96; __pyx_clineno = __LINE__; goto __pyx_L3_error;} __pyx_L3_error:; __Pyx_AddTraceback("pygame_sdl2.draw.aaline", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_surface), __pyx_ptype_11pygame_sdl2_7surface_Surface, 1, "surface", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 96; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_r = __pyx_pf_11pygame_sdl2_4draw_14aaline(__pyx_self, __pyx_v_surface, __pyx_v_color, __pyx_v_startpos, __pyx_v_endpos, __pyx_v_blend); /* function exit code */ goto __pyx_L0; __pyx_L1_error:; __pyx_r = NULL; __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_4draw_14aaline(CYTHON_UNUSED PyObject *__pyx_self, struct __pyx_obj_11pygame_sdl2_7surface_Surface *__pyx_v_surface, PyObject *__pyx_v_color, PyObject *__pyx_v_startpos, PyObject *__pyx_v_endpos, CYTHON_UNUSED PyObject *__pyx_v_blend) { PyObject *__pyx_v_x1 = NULL; PyObject *__pyx_v_y1 = NULL; PyObject *__pyx_v_x2 = NULL; PyObject *__pyx_v_y2 = NULL; PyObject *__pyx_v_dirty = NULL; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; PyObject *(*__pyx_t_4)(PyObject *); Py_ssize_t __pyx_t_5; PyObject *__pyx_t_6 = NULL; PyObject *__pyx_t_7 = NULL; PyObject *__pyx_t_8 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("aaline", 0); /* "pygame_sdl2/draw.pyx":97 * * def aaline(Surface surface, color, startpos, endpos, blend=1): * x1, y1 = startpos # <<<<<<<<<<<<<< * x2, y2 = endpos * gfxdraw.aaline(surface, x1, y1, x2, y2, color) */ if ((likely(PyTuple_CheckExact(__pyx_v_startpos))) || (PyList_CheckExact(__pyx_v_startpos))) { PyObject* sequence = __pyx_v_startpos; #if CYTHON_COMPILING_IN_CPYTHON Py_ssize_t size = Py_SIZE(sequence); #else Py_ssize_t size = PySequence_Size(sequence); #endif if (unlikely(size != 2)) { if (size > 2) __Pyx_RaiseTooManyValuesError(2); else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 97; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } #if CYTHON_COMPILING_IN_CPYTHON if (likely(PyTuple_CheckExact(sequence))) { __pyx_t_1 = PyTuple_GET_ITEM(sequence, 0); __pyx_t_2 = PyTuple_GET_ITEM(sequence, 1); } else { __pyx_t_1 = PyList_GET_ITEM(sequence, 0); __pyx_t_2 = PyList_GET_ITEM(sequence, 1); } __Pyx_INCREF(__pyx_t_1); __Pyx_INCREF(__pyx_t_2); #else __pyx_t_1 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 97; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 97; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); #endif } else { Py_ssize_t index = -1; __pyx_t_3 = PyObject_GetIter(__pyx_v_startpos); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 97; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = Py_TYPE(__pyx_t_3)->tp_iternext; index = 0; __pyx_t_1 = __pyx_t_4(__pyx_t_3); if (unlikely(!__pyx_t_1)) goto __pyx_L3_unpacking_failed; __Pyx_GOTREF(__pyx_t_1); index = 1; __pyx_t_2 = __pyx_t_4(__pyx_t_3); if (unlikely(!__pyx_t_2)) goto __pyx_L3_unpacking_failed; __Pyx_GOTREF(__pyx_t_2); if (__Pyx_IternextUnpackEndCheck(__pyx_t_4(__pyx_t_3), 2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 97; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_t_4 = NULL; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; goto __pyx_L4_unpacking_done; __pyx_L3_unpacking_failed:; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_4 = NULL; if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 97; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_L4_unpacking_done:; } __pyx_v_x1 = __pyx_t_1; __pyx_t_1 = 0; __pyx_v_y1 = __pyx_t_2; __pyx_t_2 = 0; /* "pygame_sdl2/draw.pyx":98 * def aaline(Surface surface, color, startpos, endpos, blend=1): * x1, y1 = startpos * x2, y2 = endpos # <<<<<<<<<<<<<< * gfxdraw.aaline(surface, x1, y1, x2, y2, color) * dirty = Rect(x1, y1, x2 - x1, y2 - y1) */ if ((likely(PyTuple_CheckExact(__pyx_v_endpos))) || (PyList_CheckExact(__pyx_v_endpos))) { PyObject* sequence = __pyx_v_endpos; #if CYTHON_COMPILING_IN_CPYTHON Py_ssize_t size = Py_SIZE(sequence); #else Py_ssize_t size = PySequence_Size(sequence); #endif if (unlikely(size != 2)) { if (size > 2) __Pyx_RaiseTooManyValuesError(2); else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 98; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } #if CYTHON_COMPILING_IN_CPYTHON if (likely(PyTuple_CheckExact(sequence))) { __pyx_t_2 = PyTuple_GET_ITEM(sequence, 0); __pyx_t_1 = PyTuple_GET_ITEM(sequence, 1); } else { __pyx_t_2 = PyList_GET_ITEM(sequence, 0); __pyx_t_1 = PyList_GET_ITEM(sequence, 1); } __Pyx_INCREF(__pyx_t_2); __Pyx_INCREF(__pyx_t_1); #else __pyx_t_2 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 98; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __pyx_t_1 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 98; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); #endif } else { Py_ssize_t index = -1; __pyx_t_3 = PyObject_GetIter(__pyx_v_endpos); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 98; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = Py_TYPE(__pyx_t_3)->tp_iternext; index = 0; __pyx_t_2 = __pyx_t_4(__pyx_t_3); if (unlikely(!__pyx_t_2)) goto __pyx_L5_unpacking_failed; __Pyx_GOTREF(__pyx_t_2); index = 1; __pyx_t_1 = __pyx_t_4(__pyx_t_3); if (unlikely(!__pyx_t_1)) goto __pyx_L5_unpacking_failed; __Pyx_GOTREF(__pyx_t_1); if (__Pyx_IternextUnpackEndCheck(__pyx_t_4(__pyx_t_3), 2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 98; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_t_4 = NULL; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; goto __pyx_L6_unpacking_done; __pyx_L5_unpacking_failed:; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_4 = NULL; if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 98; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_L6_unpacking_done:; } __pyx_v_x2 = __pyx_t_2; __pyx_t_2 = 0; __pyx_v_y2 = __pyx_t_1; __pyx_t_1 = 0; /* "pygame_sdl2/draw.pyx":99 * x1, y1 = startpos * x2, y2 = endpos * gfxdraw.aaline(surface, x1, y1, x2, y2, color) # <<<<<<<<<<<<<< * dirty = Rect(x1, y1, x2 - x1, y2 - y1) * return dirty.clip(surface.get_rect()) */ __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_gfxdraw); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 99; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_aaline); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 99; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_2 = NULL; __pyx_t_5 = 0; if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_3))) { __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_3); if (likely(__pyx_t_2)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); __Pyx_INCREF(__pyx_t_2); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_3, function); __pyx_t_5 = 1; } } __pyx_t_6 = PyTuple_New(6+__pyx_t_5); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 99; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_6); if (__pyx_t_2) { __Pyx_GIVEREF(__pyx_t_2); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_2); __pyx_t_2 = NULL; } __Pyx_INCREF(((PyObject *)__pyx_v_surface)); __Pyx_GIVEREF(((PyObject *)__pyx_v_surface)); PyTuple_SET_ITEM(__pyx_t_6, 0+__pyx_t_5, ((PyObject *)__pyx_v_surface)); __Pyx_INCREF(__pyx_v_x1); __Pyx_GIVEREF(__pyx_v_x1); PyTuple_SET_ITEM(__pyx_t_6, 1+__pyx_t_5, __pyx_v_x1); __Pyx_INCREF(__pyx_v_y1); __Pyx_GIVEREF(__pyx_v_y1); PyTuple_SET_ITEM(__pyx_t_6, 2+__pyx_t_5, __pyx_v_y1); __Pyx_INCREF(__pyx_v_x2); __Pyx_GIVEREF(__pyx_v_x2); PyTuple_SET_ITEM(__pyx_t_6, 3+__pyx_t_5, __pyx_v_x2); __Pyx_INCREF(__pyx_v_y2); __Pyx_GIVEREF(__pyx_v_y2); PyTuple_SET_ITEM(__pyx_t_6, 4+__pyx_t_5, __pyx_v_y2); __Pyx_INCREF(__pyx_v_color); __Pyx_GIVEREF(__pyx_v_color); PyTuple_SET_ITEM(__pyx_t_6, 5+__pyx_t_5, __pyx_v_color); __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_6, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 99; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "pygame_sdl2/draw.pyx":100 * x2, y2 = endpos * gfxdraw.aaline(surface, x1, y1, x2, y2, color) * dirty = Rect(x1, y1, x2 - x1, y2 - y1) # <<<<<<<<<<<<<< * return dirty.clip(surface.get_rect()) * */ __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_Rect); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 100; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __pyx_t_6 = PyNumber_Subtract(__pyx_v_x2, __pyx_v_x1); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 100; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_6); __pyx_t_2 = PyNumber_Subtract(__pyx_v_y2, __pyx_v_y1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 100; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __pyx_t_7 = NULL; __pyx_t_5 = 0; if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_3))) { __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_3); if (likely(__pyx_t_7)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); __Pyx_INCREF(__pyx_t_7); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_3, function); __pyx_t_5 = 1; } } __pyx_t_8 = PyTuple_New(4+__pyx_t_5); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 100; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_8); if (__pyx_t_7) { __Pyx_GIVEREF(__pyx_t_7); PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_7); __pyx_t_7 = NULL; } __Pyx_INCREF(__pyx_v_x1); __Pyx_GIVEREF(__pyx_v_x1); PyTuple_SET_ITEM(__pyx_t_8, 0+__pyx_t_5, __pyx_v_x1); __Pyx_INCREF(__pyx_v_y1); __Pyx_GIVEREF(__pyx_v_y1); PyTuple_SET_ITEM(__pyx_t_8, 1+__pyx_t_5, __pyx_v_y1); __Pyx_GIVEREF(__pyx_t_6); PyTuple_SET_ITEM(__pyx_t_8, 2+__pyx_t_5, __pyx_t_6); __Pyx_GIVEREF(__pyx_t_2); PyTuple_SET_ITEM(__pyx_t_8, 3+__pyx_t_5, __pyx_t_2); __pyx_t_6 = 0; __pyx_t_2 = 0; __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_8, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 100; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_v_dirty = __pyx_t_1; __pyx_t_1 = 0; /* "pygame_sdl2/draw.pyx":101 * gfxdraw.aaline(surface, x1, y1, x2, y2, color) * dirty = Rect(x1, y1, x2 - x1, y2 - y1) * return dirty.clip(surface.get_rect()) # <<<<<<<<<<<<<< * * def aalines(Surface surface, color, closed, pointlist, blend=1): */ __Pyx_XDECREF(__pyx_r); __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_dirty, __pyx_n_s_clip); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 101; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_surface), __pyx_n_s_get_rect); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 101; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __pyx_t_6 = NULL; if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_2))) { __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_2); if (likely(__pyx_t_6)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_6); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); } } if (__pyx_t_6) { __pyx_t_8 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_6); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 101; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; } else { __pyx_t_8 = __Pyx_PyObject_CallNoArg(__pyx_t_2); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 101; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } __Pyx_GOTREF(__pyx_t_8); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_2 = NULL; if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_3))) { __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_3); if (likely(__pyx_t_2)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); __Pyx_INCREF(__pyx_t_2); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_3, function); } } if (!__pyx_t_2) { __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_8); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 101; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; __Pyx_GOTREF(__pyx_t_1); } else { __pyx_t_6 = PyTuple_New(1+1); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 101; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_6); __Pyx_GIVEREF(__pyx_t_2); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_2); __pyx_t_2 = NULL; __Pyx_GIVEREF(__pyx_t_8); PyTuple_SET_ITEM(__pyx_t_6, 0+1, __pyx_t_8); __pyx_t_8 = 0; __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_6, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 101; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; } __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "pygame_sdl2/draw.pyx":96 * return dirty.clip(surface.get_rect()) * * def aaline(Surface surface, color, startpos, endpos, blend=1): # <<<<<<<<<<<<<< * x1, y1 = startpos * x2, y2 = endpos */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_6); __Pyx_XDECREF(__pyx_t_7); __Pyx_XDECREF(__pyx_t_8); __Pyx_AddTraceback("pygame_sdl2.draw.aaline", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF(__pyx_v_x1); __Pyx_XDECREF(__pyx_v_y1); __Pyx_XDECREF(__pyx_v_x2); __Pyx_XDECREF(__pyx_v_y2); __Pyx_XDECREF(__pyx_v_dirty); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/draw.pyx":103 * return dirty.clip(surface.get_rect()) * * def aalines(Surface surface, color, closed, pointlist, blend=1): # <<<<<<<<<<<<<< * n = 0 * dirty = Rect(pointlist[0], (1,1)) */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_4draw_17aalines(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static PyMethodDef __pyx_mdef_11pygame_sdl2_4draw_17aalines = {"aalines", (PyCFunction)__pyx_pw_11pygame_sdl2_4draw_17aalines, METH_VARARGS|METH_KEYWORDS, 0}; static PyObject *__pyx_pw_11pygame_sdl2_4draw_17aalines(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { struct __pyx_obj_11pygame_sdl2_7surface_Surface *__pyx_v_surface = 0; PyObject *__pyx_v_color = 0; PyObject *__pyx_v_closed = 0; PyObject *__pyx_v_pointlist = 0; CYTHON_UNUSED PyObject *__pyx_v_blend = 0; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("aalines (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_surface,&__pyx_n_s_color,&__pyx_n_s_closed,&__pyx_n_s_pointlist,&__pyx_n_s_blend,0}; PyObject* values[5] = {0,0,0,0,0}; values[4] = ((PyObject *)__pyx_int_1); if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4); case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_surface)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; case 1: if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_color)) != 0)) kw_args--; else { __Pyx_RaiseArgtupleInvalid("aalines", 0, 4, 5, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 103; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } case 2: if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_closed)) != 0)) kw_args--; else { __Pyx_RaiseArgtupleInvalid("aalines", 0, 4, 5, 2); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 103; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } case 3: if (likely((values[3] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_pointlist)) != 0)) kw_args--; else { __Pyx_RaiseArgtupleInvalid("aalines", 0, 4, 5, 3); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 103; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } case 4: if (kw_args > 0) { PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_blend); if (value) { values[4] = value; kw_args--; } } } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "aalines") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 103; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } } else { switch (PyTuple_GET_SIZE(__pyx_args)) { case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4); case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); values[2] = PyTuple_GET_ITEM(__pyx_args, 2); values[1] = PyTuple_GET_ITEM(__pyx_args, 1); values[0] = PyTuple_GET_ITEM(__pyx_args, 0); break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_surface = ((struct __pyx_obj_11pygame_sdl2_7surface_Surface *)values[0]); __pyx_v_color = values[1]; __pyx_v_closed = values[2]; __pyx_v_pointlist = values[3]; __pyx_v_blend = values[4]; } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("aalines", 0, 4, 5, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 103; __pyx_clineno = __LINE__; goto __pyx_L3_error;} __pyx_L3_error:; __Pyx_AddTraceback("pygame_sdl2.draw.aalines", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_surface), __pyx_ptype_11pygame_sdl2_7surface_Surface, 1, "surface", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 103; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_r = __pyx_pf_11pygame_sdl2_4draw_16aalines(__pyx_self, __pyx_v_surface, __pyx_v_color, __pyx_v_closed, __pyx_v_pointlist, __pyx_v_blend); /* function exit code */ goto __pyx_L0; __pyx_L1_error:; __pyx_r = NULL; __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_4draw_16aalines(CYTHON_UNUSED PyObject *__pyx_self, struct __pyx_obj_11pygame_sdl2_7surface_Surface *__pyx_v_surface, PyObject *__pyx_v_color, PyObject *__pyx_v_closed, PyObject *__pyx_v_pointlist, CYTHON_UNUSED PyObject *__pyx_v_blend) { PyObject *__pyx_v_n = NULL; PyObject *__pyx_v_dirty = NULL; PyObject *__pyx_v_r = NULL; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; Py_ssize_t __pyx_t_5; PyObject *__pyx_t_6 = NULL; int __pyx_t_7; PyObject *__pyx_t_8 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("aalines", 0); /* "pygame_sdl2/draw.pyx":104 * * def aalines(Surface surface, color, closed, pointlist, blend=1): * n = 0 # <<<<<<<<<<<<<< * dirty = Rect(pointlist[0], (1,1)) * while n < len(pointlist) - 1: */ __Pyx_INCREF(__pyx_int_0); __pyx_v_n = __pyx_int_0; /* "pygame_sdl2/draw.pyx":105 * def aalines(Surface surface, color, closed, pointlist, blend=1): * n = 0 * dirty = Rect(pointlist[0], (1,1)) # <<<<<<<<<<<<<< * while n < len(pointlist) - 1: * r = aaline(surface, color, pointlist[n], pointlist[n+1]) */ __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_Rect); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 105; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = __Pyx_GetItemInt(__pyx_v_pointlist, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(__pyx_t_3 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 105; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = NULL; __pyx_t_5 = 0; if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_2))) { __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_2); if (likely(__pyx_t_4)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_4); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); __pyx_t_5 = 1; } } __pyx_t_6 = PyTuple_New(2+__pyx_t_5); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 105; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_6); if (__pyx_t_4) { __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_4); __pyx_t_4 = NULL; } __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_6, 0+__pyx_t_5, __pyx_t_3); __Pyx_INCREF(__pyx_tuple__5); __Pyx_GIVEREF(__pyx_tuple__5); PyTuple_SET_ITEM(__pyx_t_6, 1+__pyx_t_5, __pyx_tuple__5); __pyx_t_3 = 0; __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_6, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 105; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_v_dirty = __pyx_t_1; __pyx_t_1 = 0; /* "pygame_sdl2/draw.pyx":106 * n = 0 * dirty = Rect(pointlist[0], (1,1)) * while n < len(pointlist) - 1: # <<<<<<<<<<<<<< * r = aaline(surface, color, pointlist[n], pointlist[n+1]) * dirty.union_ip(r) */ while (1) { __pyx_t_5 = PyObject_Length(__pyx_v_pointlist); if (unlikely(__pyx_t_5 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 106; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_t_1 = PyInt_FromSsize_t((__pyx_t_5 - 1)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 106; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = PyObject_RichCompare(__pyx_v_n, __pyx_t_1, Py_LT); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 106; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_7 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 106; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; if (!__pyx_t_7) break; /* "pygame_sdl2/draw.pyx":107 * dirty = Rect(pointlist[0], (1,1)) * while n < len(pointlist) - 1: * r = aaline(surface, color, pointlist[n], pointlist[n+1]) # <<<<<<<<<<<<<< * dirty.union_ip(r) * n += 1 */ __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_aaline); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 107; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_t_6 = PyObject_GetItem(__pyx_v_pointlist, __pyx_v_n); if (unlikely(__pyx_t_6 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 107; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; __Pyx_GOTREF(__pyx_t_6); __pyx_t_3 = __Pyx_PyInt_AddObjC(__pyx_v_n, __pyx_int_1, 1, 0); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 107; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = PyObject_GetItem(__pyx_v_pointlist, __pyx_t_3); if (unlikely(__pyx_t_4 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 107; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_3 = NULL; __pyx_t_5 = 0; if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_1))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_1); if (likely(__pyx_t_3)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_1, function); __pyx_t_5 = 1; } } __pyx_t_8 = PyTuple_New(4+__pyx_t_5); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 107; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_8); if (__pyx_t_3) { __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_3); __pyx_t_3 = NULL; } __Pyx_INCREF(((PyObject *)__pyx_v_surface)); __Pyx_GIVEREF(((PyObject *)__pyx_v_surface)); PyTuple_SET_ITEM(__pyx_t_8, 0+__pyx_t_5, ((PyObject *)__pyx_v_surface)); __Pyx_INCREF(__pyx_v_color); __Pyx_GIVEREF(__pyx_v_color); PyTuple_SET_ITEM(__pyx_t_8, 1+__pyx_t_5, __pyx_v_color); __Pyx_GIVEREF(__pyx_t_6); PyTuple_SET_ITEM(__pyx_t_8, 2+__pyx_t_5, __pyx_t_6); __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_8, 3+__pyx_t_5, __pyx_t_4); __pyx_t_6 = 0; __pyx_t_4 = 0; __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_8, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 107; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_XDECREF_SET(__pyx_v_r, __pyx_t_2); __pyx_t_2 = 0; /* "pygame_sdl2/draw.pyx":108 * while n < len(pointlist) - 1: * r = aaline(surface, color, pointlist[n], pointlist[n+1]) * dirty.union_ip(r) # <<<<<<<<<<<<<< * n += 1 * if closed: */ __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_dirty, __pyx_n_s_union_ip); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 108; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_t_8 = NULL; if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_1))) { __pyx_t_8 = PyMethod_GET_SELF(__pyx_t_1); if (likely(__pyx_t_8)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1); __Pyx_INCREF(__pyx_t_8); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_1, function); } } if (!__pyx_t_8) { __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_1, __pyx_v_r); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 108; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); } else { __pyx_t_4 = PyTuple_New(1+1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 108; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); __Pyx_GIVEREF(__pyx_t_8); PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_8); __pyx_t_8 = NULL; __Pyx_INCREF(__pyx_v_r); __Pyx_GIVEREF(__pyx_v_r); PyTuple_SET_ITEM(__pyx_t_4, 0+1, __pyx_v_r); __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_4, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 108; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "pygame_sdl2/draw.pyx":109 * r = aaline(surface, color, pointlist[n], pointlist[n+1]) * dirty.union_ip(r) * n += 1 # <<<<<<<<<<<<<< * if closed: * aaline(surface, color, pointlist[n], pointlist[0]) */ __pyx_t_2 = __Pyx_PyInt_AddObjC(__pyx_v_n, __pyx_int_1, 1, 1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 109; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF_SET(__pyx_v_n, __pyx_t_2); __pyx_t_2 = 0; } /* "pygame_sdl2/draw.pyx":110 * dirty.union_ip(r) * n += 1 * if closed: # <<<<<<<<<<<<<< * aaline(surface, color, pointlist[n], pointlist[0]) * return dirty.clip(surface.get_rect()) */ __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_v_closed); if (unlikely(__pyx_t_7 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 110; __pyx_clineno = __LINE__; goto __pyx_L1_error;} if (__pyx_t_7) { /* "pygame_sdl2/draw.pyx":111 * n += 1 * if closed: * aaline(surface, color, pointlist[n], pointlist[0]) # <<<<<<<<<<<<<< * return dirty.clip(surface.get_rect()) */ __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_aaline); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 111; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_t_4 = PyObject_GetItem(__pyx_v_pointlist, __pyx_v_n); if (unlikely(__pyx_t_4 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 111; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; __Pyx_GOTREF(__pyx_t_4); __pyx_t_8 = __Pyx_GetItemInt(__pyx_v_pointlist, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(__pyx_t_8 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 111; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; __Pyx_GOTREF(__pyx_t_8); __pyx_t_6 = NULL; __pyx_t_5 = 0; if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_1))) { __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_1); if (likely(__pyx_t_6)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1); __Pyx_INCREF(__pyx_t_6); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_1, function); __pyx_t_5 = 1; } } __pyx_t_3 = PyTuple_New(4+__pyx_t_5); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 111; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); if (__pyx_t_6) { __Pyx_GIVEREF(__pyx_t_6); PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_6); __pyx_t_6 = NULL; } __Pyx_INCREF(((PyObject *)__pyx_v_surface)); __Pyx_GIVEREF(((PyObject *)__pyx_v_surface)); PyTuple_SET_ITEM(__pyx_t_3, 0+__pyx_t_5, ((PyObject *)__pyx_v_surface)); __Pyx_INCREF(__pyx_v_color); __Pyx_GIVEREF(__pyx_v_color); PyTuple_SET_ITEM(__pyx_t_3, 1+__pyx_t_5, __pyx_v_color); __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_3, 2+__pyx_t_5, __pyx_t_4); __Pyx_GIVEREF(__pyx_t_8); PyTuple_SET_ITEM(__pyx_t_3, 3+__pyx_t_5, __pyx_t_8); __pyx_t_4 = 0; __pyx_t_8 = 0; __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_3, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 111; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "pygame_sdl2/draw.pyx":110 * dirty.union_ip(r) * n += 1 * if closed: # <<<<<<<<<<<<<< * aaline(surface, color, pointlist[n], pointlist[0]) * return dirty.clip(surface.get_rect()) */ } /* "pygame_sdl2/draw.pyx":112 * if closed: * aaline(surface, color, pointlist[n], pointlist[0]) * return dirty.clip(surface.get_rect()) # <<<<<<<<<<<<<< */ __Pyx_XDECREF(__pyx_r); __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_dirty, __pyx_n_s_clip); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 112; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_t_8 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_surface), __pyx_n_s_get_rect); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 112; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_8); __pyx_t_4 = NULL; if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_8))) { __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_8); if (likely(__pyx_t_4)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_8); __Pyx_INCREF(__pyx_t_4); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_8, function); } } if (__pyx_t_4) { __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_t_8, __pyx_t_4); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 112; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; } else { __pyx_t_3 = __Pyx_PyObject_CallNoArg(__pyx_t_8); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 112; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; __pyx_t_8 = NULL; if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_1))) { __pyx_t_8 = PyMethod_GET_SELF(__pyx_t_1); if (likely(__pyx_t_8)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1); __Pyx_INCREF(__pyx_t_8); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_1, function); } } if (!__pyx_t_8) { __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_1, __pyx_t_3); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 112; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_GOTREF(__pyx_t_2); } else { __pyx_t_4 = PyTuple_New(1+1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 112; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); __Pyx_GIVEREF(__pyx_t_8); PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_8); __pyx_t_8 = NULL; __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_4, 0+1, __pyx_t_3); __pyx_t_3 = 0; __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_4, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 112; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; /* "pygame_sdl2/draw.pyx":103 * return dirty.clip(surface.get_rect()) * * def aalines(Surface surface, color, closed, pointlist, blend=1): # <<<<<<<<<<<<<< * n = 0 * dirty = Rect(pointlist[0], (1,1)) */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_6); __Pyx_XDECREF(__pyx_t_8); __Pyx_AddTraceback("pygame_sdl2.draw.aalines", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF(__pyx_v_n); __Pyx_XDECREF(__pyx_v_dirty); __Pyx_XDECREF(__pyx_v_r); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyMethodDef __pyx_methods[] = { {0, 0, 0, 0} }; #if PY_MAJOR_VERSION >= 3 static struct PyModuleDef __pyx_moduledef = { #if PY_VERSION_HEX < 0x03020000 { PyObject_HEAD_INIT(NULL) NULL, 0, NULL }, #else PyModuleDef_HEAD_INIT, #endif "draw", 0, /* m_doc */ -1, /* m_size */ __pyx_methods /* m_methods */, NULL, /* m_reload */ NULL, /* m_traverse */ NULL, /* m_clear */ NULL /* m_free */ }; #endif static __Pyx_StringTabEntry __pyx_string_tab[] = { {&__pyx_kp_u_Not_implemented, __pyx_k_Not_implemented, sizeof(__pyx_k_Not_implemented), 0, 1, 0, 0}, {&__pyx_n_s_Rect, __pyx_k_Rect, sizeof(__pyx_k_Rect), 0, 0, 1, 1}, {&__pyx_n_s__6, __pyx_k__6, sizeof(__pyx_k__6), 0, 0, 1, 1}, {&__pyx_n_s_aaline, __pyx_k_aaline, sizeof(__pyx_k_aaline), 0, 0, 1, 1}, {&__pyx_n_s_aalines, __pyx_k_aalines, sizeof(__pyx_k_aalines), 0, 0, 1, 1}, {&__pyx_n_s_arc, __pyx_k_arc, sizeof(__pyx_k_arc), 0, 0, 1, 1}, {&__pyx_n_s_blend, __pyx_k_blend, sizeof(__pyx_k_blend), 0, 0, 1, 1}, {&__pyx_n_s_box, __pyx_k_box, sizeof(__pyx_k_box), 0, 0, 1, 1}, {&__pyx_n_s_circle, __pyx_k_circle, sizeof(__pyx_k_circle), 0, 0, 1, 1}, {&__pyx_n_s_clip, __pyx_k_clip, sizeof(__pyx_k_clip), 0, 0, 1, 1}, {&__pyx_n_s_closed, __pyx_k_closed, sizeof(__pyx_k_closed), 0, 0, 1, 1}, {&__pyx_n_s_color, __pyx_k_color, sizeof(__pyx_k_color), 0, 0, 1, 1}, {&__pyx_n_s_dirty, __pyx_k_dirty, sizeof(__pyx_k_dirty), 0, 0, 1, 1}, {&__pyx_n_s_ellipse, __pyx_k_ellipse, sizeof(__pyx_k_ellipse), 0, 0, 1, 1}, {&__pyx_n_s_end_pos, __pyx_k_end_pos, sizeof(__pyx_k_end_pos), 0, 0, 1, 1}, {&__pyx_n_s_endpos, __pyx_k_endpos, sizeof(__pyx_k_endpos), 0, 0, 1, 1}, {&__pyx_n_s_error, __pyx_k_error, sizeof(__pyx_k_error), 0, 0, 1, 1}, {&__pyx_n_s_filled_circle, __pyx_k_filled_circle, sizeof(__pyx_k_filled_circle), 0, 0, 1, 1}, {&__pyx_n_s_filled_polygon, __pyx_k_filled_polygon, sizeof(__pyx_k_filled_polygon), 0, 0, 1, 1}, {&__pyx_n_s_get_rect, __pyx_k_get_rect, sizeof(__pyx_k_get_rect), 0, 0, 1, 1}, {&__pyx_n_s_gfxdraw, __pyx_k_gfxdraw, sizeof(__pyx_k_gfxdraw), 0, 0, 1, 1}, {&__pyx_n_s_h, __pyx_k_h, sizeof(__pyx_k_h), 0, 0, 1, 1}, {&__pyx_kp_s_home_tom_ab_pygame_sdl2_src_pyg, __pyx_k_home_tom_ab_pygame_sdl2_src_pyg, sizeof(__pyx_k_home_tom_ab_pygame_sdl2_src_pyg), 0, 0, 1, 0}, {&__pyx_n_s_import, __pyx_k_import, sizeof(__pyx_k_import), 0, 0, 1, 1}, {&__pyx_n_s_line, __pyx_k_line, sizeof(__pyx_k_line), 0, 0, 1, 1}, {&__pyx_n_s_lines, __pyx_k_lines, sizeof(__pyx_k_lines), 0, 0, 1, 1}, {&__pyx_n_s_main, __pyx_k_main, sizeof(__pyx_k_main), 0, 0, 1, 1}, {&__pyx_n_s_n, __pyx_k_n, sizeof(__pyx_k_n), 0, 0, 1, 1}, {&__pyx_n_s_pointlist, __pyx_k_pointlist, sizeof(__pyx_k_pointlist), 0, 0, 1, 1}, {&__pyx_n_s_polygon, __pyx_k_polygon, sizeof(__pyx_k_polygon), 0, 0, 1, 1}, {&__pyx_n_s_pos, __pyx_k_pos, sizeof(__pyx_k_pos), 0, 0, 1, 1}, {&__pyx_n_s_pygame_sdl2_draw, __pyx_k_pygame_sdl2_draw, sizeof(__pyx_k_pygame_sdl2_draw), 0, 0, 1, 1}, {&__pyx_n_s_pygame_sdl2_error, __pyx_k_pygame_sdl2_error, sizeof(__pyx_k_pygame_sdl2_error), 0, 0, 1, 1}, {&__pyx_n_s_pygame_sdl2_gfxdraw, __pyx_k_pygame_sdl2_gfxdraw, sizeof(__pyx_k_pygame_sdl2_gfxdraw), 0, 0, 1, 1}, {&__pyx_n_s_pygame_sdl2_rect, __pyx_k_pygame_sdl2_rect, sizeof(__pyx_k_pygame_sdl2_rect), 0, 0, 1, 1}, {&__pyx_n_s_pyx_vtable, __pyx_k_pyx_vtable, sizeof(__pyx_k_pyx_vtable), 0, 0, 1, 1}, {&__pyx_n_s_r, __pyx_k_r, sizeof(__pyx_k_r), 0, 0, 1, 1}, {&__pyx_n_s_radius, __pyx_k_radius, sizeof(__pyx_k_radius), 0, 0, 1, 1}, {&__pyx_n_s_rect, __pyx_k_rect, sizeof(__pyx_k_rect), 0, 0, 1, 1}, {&__pyx_n_s_rectangle, __pyx_k_rectangle, sizeof(__pyx_k_rectangle), 0, 0, 1, 1}, {&__pyx_n_s_start_angle, __pyx_k_start_angle, sizeof(__pyx_k_start_angle), 0, 0, 1, 1}, {&__pyx_n_s_start_pos, __pyx_k_start_pos, sizeof(__pyx_k_start_pos), 0, 0, 1, 1}, {&__pyx_n_s_startpos, __pyx_k_startpos, sizeof(__pyx_k_startpos), 0, 0, 1, 1}, {&__pyx_n_s_stop_angle, __pyx_k_stop_angle, sizeof(__pyx_k_stop_angle), 0, 0, 1, 1}, {&__pyx_n_s_surface, __pyx_k_surface, sizeof(__pyx_k_surface), 0, 0, 1, 1}, {&__pyx_n_s_test, __pyx_k_test, sizeof(__pyx_k_test), 0, 0, 1, 1}, {&__pyx_n_s_thick_line, __pyx_k_thick_line, sizeof(__pyx_k_thick_line), 0, 0, 1, 1}, {&__pyx_n_s_union_ip, __pyx_k_union_ip, sizeof(__pyx_k_union_ip), 0, 0, 1, 1}, {&__pyx_n_s_w, __pyx_k_w, sizeof(__pyx_k_w), 0, 0, 1, 1}, {&__pyx_n_s_width, __pyx_k_width, sizeof(__pyx_k_width), 0, 0, 1, 1}, {&__pyx_n_s_x, __pyx_k_x, sizeof(__pyx_k_x), 0, 0, 1, 1}, {&__pyx_n_s_x1, __pyx_k_x1, sizeof(__pyx_k_x1), 0, 0, 1, 1}, {&__pyx_n_s_x2, __pyx_k_x2, sizeof(__pyx_k_x2), 0, 0, 1, 1}, {&__pyx_n_s_y, __pyx_k_y, sizeof(__pyx_k_y), 0, 0, 1, 1}, {&__pyx_n_s_y1, __pyx_k_y1, sizeof(__pyx_k_y1), 0, 0, 1, 1}, {&__pyx_n_s_y2, __pyx_k_y2, sizeof(__pyx_k_y2), 0, 0, 1, 1}, {0, 0, 0, 0, 0, 0, 0} }; static int __Pyx_InitCachedBuiltins(void) { return 0; } static int __Pyx_InitCachedConstants(void) { __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__Pyx_InitCachedConstants", 0); /* "pygame_sdl2/draw.pyx":47 * if width == 0: * gfxdraw.filled_polygon(surface, pointlist, color) * dirty = Rect(pointlist[0], (1, 1)) # <<<<<<<<<<<<<< * n = 1 * while n < len(pointlist): */ __pyx_tuple_ = PyTuple_Pack(2, __pyx_int_1, __pyx_int_1); if (unlikely(!__pyx_tuple_)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 47; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_tuple_); __Pyx_GIVEREF(__pyx_tuple_); /* "pygame_sdl2/draw.pyx":50 * n = 1 * while n < len(pointlist): * dirty.union_ip(Rect(pointlist[n], (1,1))) # <<<<<<<<<<<<<< * n += 1 * return dirty.clip(surface.get_rect()) */ __pyx_tuple__2 = PyTuple_Pack(2, __pyx_int_1, __pyx_int_1); if (unlikely(!__pyx_tuple__2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 50; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_tuple__2); __Pyx_GIVEREF(__pyx_tuple__2); /* "pygame_sdl2/draw.pyx":73 * * def ellipse(Surface surface, color, rect, width=0): * raise error("Not implemented.") # <<<<<<<<<<<<<< * * def arc(Surface surface, color, rect, start_angle, stop_angle, width=1): */ __pyx_tuple__3 = PyTuple_Pack(1, __pyx_kp_u_Not_implemented); if (unlikely(!__pyx_tuple__3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 73; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_tuple__3); __Pyx_GIVEREF(__pyx_tuple__3); /* "pygame_sdl2/draw.pyx":76 * * def arc(Surface surface, color, rect, start_angle, stop_angle, width=1): * raise error("Not implemented.") # <<<<<<<<<<<<<< * * def line(Surface surface, color, start_pos, end_pos, width=1): */ __pyx_tuple__4 = PyTuple_Pack(1, __pyx_kp_u_Not_implemented); if (unlikely(!__pyx_tuple__4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 76; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_tuple__4); __Pyx_GIVEREF(__pyx_tuple__4); /* "pygame_sdl2/draw.pyx":105 * def aalines(Surface surface, color, closed, pointlist, blend=1): * n = 0 * dirty = Rect(pointlist[0], (1,1)) # <<<<<<<<<<<<<< * while n < len(pointlist) - 1: * r = aaline(surface, color, pointlist[n], pointlist[n+1]) */ __pyx_tuple__5 = PyTuple_Pack(2, __pyx_int_1, __pyx_int_1); if (unlikely(!__pyx_tuple__5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 105; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_tuple__5); __Pyx_GIVEREF(__pyx_tuple__5); /* "pygame_sdl2/draw.pyx":26 * from pygame_sdl2.error import error * * def rect(Surface surface, color, rect, width=0): # <<<<<<<<<<<<<< * if not isinstance(rect, Rect): * rect = Rect(rect) */ __pyx_tuple__7 = PyTuple_Pack(7, __pyx_n_s_surface, __pyx_n_s_color, __pyx_n_s_rect, __pyx_n_s_width, __pyx_n_s_n, __pyx_n_s_r, __pyx_n_s_dirty); if (unlikely(!__pyx_tuple__7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 26; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_tuple__7); __Pyx_GIVEREF(__pyx_tuple__7); __pyx_codeobj__8 = (PyObject*)__Pyx_PyCode_New(4, 0, 7, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__7, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_tom_ab_pygame_sdl2_src_pyg, __pyx_n_s_rect, 26, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 26; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "pygame_sdl2/draw.pyx":44 * return dirty.clip(surface.get_rect()) * * def polygon(Surface surface, color, pointlist, width=0): # <<<<<<<<<<<<<< * if width == 0: * gfxdraw.filled_polygon(surface, pointlist, color) */ __pyx_tuple__9 = PyTuple_Pack(6, __pyx_n_s_surface, __pyx_n_s_color, __pyx_n_s_pointlist, __pyx_n_s_width, __pyx_n_s_dirty, __pyx_n_s_n); if (unlikely(!__pyx_tuple__9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 44; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_tuple__9); __Pyx_GIVEREF(__pyx_tuple__9); __pyx_codeobj__10 = (PyObject*)__Pyx_PyCode_New(4, 0, 6, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__9, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_tom_ab_pygame_sdl2_src_pyg, __pyx_n_s_polygon, 44, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 44; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "pygame_sdl2/draw.pyx":56 * return lines(surface, color, True, pointlist, width) * * def circle(Surface surface, color, pos, radius, width=0): # <<<<<<<<<<<<<< * x, y = pos * if width == 0: */ __pyx_tuple__11 = PyTuple_Pack(9, __pyx_n_s_surface, __pyx_n_s_color, __pyx_n_s_pos, __pyx_n_s_radius, __pyx_n_s_width, __pyx_n_s_x, __pyx_n_s_y, __pyx_n_s_dirty, __pyx_n_s_n); if (unlikely(!__pyx_tuple__11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 56; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_tuple__11); __Pyx_GIVEREF(__pyx_tuple__11); __pyx_codeobj__12 = (PyObject*)__Pyx_PyCode_New(5, 0, 9, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__11, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_tom_ab_pygame_sdl2_src_pyg, __pyx_n_s_circle, 56, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__12)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 56; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "pygame_sdl2/draw.pyx":72 * return dirty.clip(surface.get_rect()) * * def ellipse(Surface surface, color, rect, width=0): # <<<<<<<<<<<<<< * raise error("Not implemented.") * */ __pyx_tuple__13 = PyTuple_Pack(4, __pyx_n_s_surface, __pyx_n_s_color, __pyx_n_s_rect, __pyx_n_s_width); if (unlikely(!__pyx_tuple__13)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 72; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_tuple__13); __Pyx_GIVEREF(__pyx_tuple__13); __pyx_codeobj__14 = (PyObject*)__Pyx_PyCode_New(4, 0, 4, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__13, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_tom_ab_pygame_sdl2_src_pyg, __pyx_n_s_ellipse, 72, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__14)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 72; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "pygame_sdl2/draw.pyx":75 * raise error("Not implemented.") * * def arc(Surface surface, color, rect, start_angle, stop_angle, width=1): # <<<<<<<<<<<<<< * raise error("Not implemented.") * */ __pyx_tuple__15 = PyTuple_Pack(6, __pyx_n_s_surface, __pyx_n_s_color, __pyx_n_s_rect, __pyx_n_s_start_angle, __pyx_n_s_stop_angle, __pyx_n_s_width); if (unlikely(!__pyx_tuple__15)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 75; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_tuple__15); __Pyx_GIVEREF(__pyx_tuple__15); __pyx_codeobj__16 = (PyObject*)__Pyx_PyCode_New(6, 0, 6, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__15, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_tom_ab_pygame_sdl2_src_pyg, __pyx_n_s_arc, 75, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__16)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 75; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "pygame_sdl2/draw.pyx":78 * raise error("Not implemented.") * * def line(Surface surface, color, start_pos, end_pos, width=1): # <<<<<<<<<<<<<< * gfxdraw.thick_line(surface, start_pos[0], start_pos[1], * end_pos[0], end_pos[1], width, color) */ __pyx_tuple__17 = PyTuple_Pack(6, __pyx_n_s_surface, __pyx_n_s_color, __pyx_n_s_start_pos, __pyx_n_s_end_pos, __pyx_n_s_width, __pyx_n_s_dirty); if (unlikely(!__pyx_tuple__17)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 78; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_tuple__17); __Pyx_GIVEREF(__pyx_tuple__17); __pyx_codeobj__18 = (PyObject*)__Pyx_PyCode_New(5, 0, 6, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__17, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_tom_ab_pygame_sdl2_src_pyg, __pyx_n_s_line, 78, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__18)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 78; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "pygame_sdl2/draw.pyx":85 * return dirty.clip(surface.get_rect()) * * def lines(Surface surface, color, closed, pointlist, width=1): # <<<<<<<<<<<<<< * n = 0 * dirty = Rect(pointlist[0], (width, width)) */ __pyx_tuple__19 = PyTuple_Pack(7, __pyx_n_s_surface, __pyx_n_s_color, __pyx_n_s_closed, __pyx_n_s_pointlist, __pyx_n_s_width, __pyx_n_s_n, __pyx_n_s_dirty); if (unlikely(!__pyx_tuple__19)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 85; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_tuple__19); __Pyx_GIVEREF(__pyx_tuple__19); __pyx_codeobj__20 = (PyObject*)__Pyx_PyCode_New(5, 0, 7, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__19, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_tom_ab_pygame_sdl2_src_pyg, __pyx_n_s_lines, 85, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__20)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 85; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "pygame_sdl2/draw.pyx":96 * return dirty.clip(surface.get_rect()) * * def aaline(Surface surface, color, startpos, endpos, blend=1): # <<<<<<<<<<<<<< * x1, y1 = startpos * x2, y2 = endpos */ __pyx_tuple__21 = PyTuple_Pack(10, __pyx_n_s_surface, __pyx_n_s_color, __pyx_n_s_startpos, __pyx_n_s_endpos, __pyx_n_s_blend, __pyx_n_s_x1, __pyx_n_s_y1, __pyx_n_s_x2, __pyx_n_s_y2, __pyx_n_s_dirty); if (unlikely(!__pyx_tuple__21)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 96; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_tuple__21); __Pyx_GIVEREF(__pyx_tuple__21); __pyx_codeobj__22 = (PyObject*)__Pyx_PyCode_New(5, 0, 10, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__21, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_tom_ab_pygame_sdl2_src_pyg, __pyx_n_s_aaline, 96, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__22)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 96; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "pygame_sdl2/draw.pyx":103 * return dirty.clip(surface.get_rect()) * * def aalines(Surface surface, color, closed, pointlist, blend=1): # <<<<<<<<<<<<<< * n = 0 * dirty = Rect(pointlist[0], (1,1)) */ __pyx_tuple__23 = PyTuple_Pack(8, __pyx_n_s_surface, __pyx_n_s_color, __pyx_n_s_closed, __pyx_n_s_pointlist, __pyx_n_s_blend, __pyx_n_s_n, __pyx_n_s_dirty, __pyx_n_s_r); if (unlikely(!__pyx_tuple__23)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 103; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_tuple__23); __Pyx_GIVEREF(__pyx_tuple__23); __pyx_codeobj__24 = (PyObject*)__Pyx_PyCode_New(5, 0, 8, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__23, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_tom_ab_pygame_sdl2_src_pyg, __pyx_n_s_aalines, 103, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__24)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 103; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_RefNannyFinishContext(); return 0; __pyx_L1_error:; __Pyx_RefNannyFinishContext(); return -1; } static int __Pyx_InitGlobals(void) { if (__Pyx_InitStrings(__pyx_string_tab) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; __pyx_int_0 = PyInt_FromLong(0); if (unlikely(!__pyx_int_0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_int_1 = PyInt_FromLong(1); if (unlikely(!__pyx_int_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_int_2 = PyInt_FromLong(2); if (unlikely(!__pyx_int_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} return 0; __pyx_L1_error:; return -1; } #if PY_MAJOR_VERSION < 3 PyMODINIT_FUNC initdraw(void); /*proto*/ PyMODINIT_FUNC initdraw(void) #else PyMODINIT_FUNC PyInit_draw(void); /*proto*/ PyMODINIT_FUNC PyInit_draw(void) #endif { PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannyDeclarations #if CYTHON_REFNANNY __Pyx_RefNanny = __Pyx_RefNannyImportAPI("refnanny"); if (!__Pyx_RefNanny) { PyErr_Clear(); __Pyx_RefNanny = __Pyx_RefNannyImportAPI("Cython.Runtime.refnanny"); if (!__Pyx_RefNanny) Py_FatalError("failed to import 'refnanny' module"); } #endif __Pyx_RefNannySetupContext("PyMODINIT_FUNC PyInit_draw(void)", 0); if (__Pyx_check_binary_version() < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_empty_tuple = PyTuple_New(0); if (unlikely(!__pyx_empty_tuple)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_empty_bytes = PyBytes_FromStringAndSize("", 0); if (unlikely(!__pyx_empty_bytes)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} #ifdef __Pyx_CyFunction_USED if (__pyx_CyFunction_init() < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} #endif #ifdef __Pyx_FusedFunction_USED if (__pyx_FusedFunction_init() < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} #endif #ifdef __Pyx_Coroutine_USED if (__pyx_Coroutine_init() < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} #endif #ifdef __Pyx_Generator_USED if (__pyx_Generator_init() < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} #endif #ifdef __Pyx_StopAsyncIteration_USED if (__pyx_StopAsyncIteration_init() < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} #endif /*--- Library function declarations ---*/ /*--- Threads initialization code ---*/ #if defined(__PYX_FORCE_INIT_THREADS) && __PYX_FORCE_INIT_THREADS #ifdef WITH_THREAD /* Python build with threading support? */ PyEval_InitThreads(); #endif #endif /*--- Module creation code ---*/ #if PY_MAJOR_VERSION < 3 __pyx_m = Py_InitModule4("draw", __pyx_methods, 0, 0, PYTHON_API_VERSION); Py_XINCREF(__pyx_m); #else __pyx_m = PyModule_Create(&__pyx_moduledef); #endif if (unlikely(!__pyx_m)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_d = PyModule_GetDict(__pyx_m); if (unlikely(!__pyx_d)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} Py_INCREF(__pyx_d); __pyx_b = PyImport_AddModule(__Pyx_BUILTIN_MODULE_NAME); if (unlikely(!__pyx_b)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} #if CYTHON_COMPILING_IN_PYPY Py_INCREF(__pyx_b); #endif if (PyObject_SetAttrString(__pyx_m, "__builtins__", __pyx_b) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; /*--- Initialize various global constants etc. ---*/ if (__Pyx_InitGlobals() < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} #if PY_MAJOR_VERSION < 3 && (__PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT) if (__Pyx_init_sys_getdefaultencoding_params() < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} #endif if (__pyx_module_is_main_pygame_sdl2__draw) { if (PyObject_SetAttrString(__pyx_m, "__name__", __pyx_n_s_main) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } #if PY_MAJOR_VERSION >= 3 { PyObject *modules = PyImport_GetModuleDict(); if (unlikely(!modules)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} if (!PyDict_GetItemString(modules, "pygame_sdl2.draw")) { if (unlikely(PyDict_SetItemString(modules, "pygame_sdl2.draw", __pyx_m) < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } } #endif /*--- Builtin init code ---*/ if (__Pyx_InitCachedBuiltins() < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /*--- Constants init code ---*/ if (__Pyx_InitCachedConstants() < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /*--- Global init code ---*/ /*--- Variable export code ---*/ /*--- Function export code ---*/ /*--- Type init code ---*/ /*--- Type import code ---*/ __pyx_ptype_11pygame_sdl2_7surface_Surface = __Pyx_ImportType("pygame_sdl2.surface", "Surface", sizeof(struct __pyx_obj_11pygame_sdl2_7surface_Surface), 1); if (unlikely(!__pyx_ptype_11pygame_sdl2_7surface_Surface)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 23; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_vtabptr_11pygame_sdl2_7surface_Surface = (struct __pyx_vtabstruct_11pygame_sdl2_7surface_Surface*)__Pyx_GetVtable(__pyx_ptype_11pygame_sdl2_7surface_Surface->tp_dict); if (unlikely(!__pyx_vtabptr_11pygame_sdl2_7surface_Surface)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 23; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /*--- Variable import code ---*/ /*--- Function import code ---*/ /*--- Execution code ---*/ #if defined(__Pyx_Generator_USED) || defined(__Pyx_Coroutine_USED) if (__Pyx_patch_abc() < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} #endif /* "pygame_sdl2/draw.pyx":22 * from pygame_sdl2.surface cimport Surface * * import pygame_sdl2.gfxdraw as gfxdraw # <<<<<<<<<<<<<< * from pygame_sdl2.rect import Rect * from pygame_sdl2.error import error */ __pyx_t_1 = PyList_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 22; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __Pyx_INCREF(__pyx_n_s__6); __Pyx_GIVEREF(__pyx_n_s__6); PyList_SET_ITEM(__pyx_t_1, 0, __pyx_n_s__6); __pyx_t_2 = __Pyx_Import(__pyx_n_s_pygame_sdl2_gfxdraw, __pyx_t_1, 0); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 22; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (PyDict_SetItem(__pyx_d, __pyx_n_s_gfxdraw, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 22; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "pygame_sdl2/draw.pyx":23 * * import pygame_sdl2.gfxdraw as gfxdraw * from pygame_sdl2.rect import Rect # <<<<<<<<<<<<<< * from pygame_sdl2.error import error * */ __pyx_t_2 = PyList_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 23; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __Pyx_INCREF(__pyx_n_s_Rect); __Pyx_GIVEREF(__pyx_n_s_Rect); PyList_SET_ITEM(__pyx_t_2, 0, __pyx_n_s_Rect); __pyx_t_1 = __Pyx_Import(__pyx_n_s_pygame_sdl2_rect, __pyx_t_2, 0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 23; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_2 = __Pyx_ImportFrom(__pyx_t_1, __pyx_n_s_Rect); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 23; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_Rect, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 23; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "pygame_sdl2/draw.pyx":24 * import pygame_sdl2.gfxdraw as gfxdraw * from pygame_sdl2.rect import Rect * from pygame_sdl2.error import error # <<<<<<<<<<<<<< * * def rect(Surface surface, color, rect, width=0): */ __pyx_t_1 = PyList_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 24; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __Pyx_INCREF(__pyx_n_s_error); __Pyx_GIVEREF(__pyx_n_s_error); PyList_SET_ITEM(__pyx_t_1, 0, __pyx_n_s_error); __pyx_t_2 = __Pyx_Import(__pyx_n_s_pygame_sdl2_error, __pyx_t_1, 0); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 24; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_1 = __Pyx_ImportFrom(__pyx_t_2, __pyx_n_s_error); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 24; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); if (PyDict_SetItem(__pyx_d, __pyx_n_s_error, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 24; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "pygame_sdl2/draw.pyx":26 * from pygame_sdl2.error import error * * def rect(Surface surface, color, rect, width=0): # <<<<<<<<<<<<<< * if not isinstance(rect, Rect): * rect = Rect(rect) */ __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_11pygame_sdl2_4draw_1rect, NULL, __pyx_n_s_pygame_sdl2_draw); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 26; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_rect, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 26; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "pygame_sdl2/draw.pyx":44 * return dirty.clip(surface.get_rect()) * * def polygon(Surface surface, color, pointlist, width=0): # <<<<<<<<<<<<<< * if width == 0: * gfxdraw.filled_polygon(surface, pointlist, color) */ __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_11pygame_sdl2_4draw_3polygon, NULL, __pyx_n_s_pygame_sdl2_draw); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 44; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_polygon, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 44; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "pygame_sdl2/draw.pyx":56 * return lines(surface, color, True, pointlist, width) * * def circle(Surface surface, color, pos, radius, width=0): # <<<<<<<<<<<<<< * x, y = pos * if width == 0: */ __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_11pygame_sdl2_4draw_5circle, NULL, __pyx_n_s_pygame_sdl2_draw); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 56; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_circle, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 56; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "pygame_sdl2/draw.pyx":72 * return dirty.clip(surface.get_rect()) * * def ellipse(Surface surface, color, rect, width=0): # <<<<<<<<<<<<<< * raise error("Not implemented.") * */ __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_11pygame_sdl2_4draw_7ellipse, NULL, __pyx_n_s_pygame_sdl2_draw); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 72; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_ellipse, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 72; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "pygame_sdl2/draw.pyx":75 * raise error("Not implemented.") * * def arc(Surface surface, color, rect, start_angle, stop_angle, width=1): # <<<<<<<<<<<<<< * raise error("Not implemented.") * */ __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_11pygame_sdl2_4draw_9arc, NULL, __pyx_n_s_pygame_sdl2_draw); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 75; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_arc, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 75; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "pygame_sdl2/draw.pyx":78 * raise error("Not implemented.") * * def line(Surface surface, color, start_pos, end_pos, width=1): # <<<<<<<<<<<<<< * gfxdraw.thick_line(surface, start_pos[0], start_pos[1], * end_pos[0], end_pos[1], width, color) */ __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_11pygame_sdl2_4draw_11line, NULL, __pyx_n_s_pygame_sdl2_draw); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 78; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_line, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 78; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "pygame_sdl2/draw.pyx":85 * return dirty.clip(surface.get_rect()) * * def lines(Surface surface, color, closed, pointlist, width=1): # <<<<<<<<<<<<<< * n = 0 * dirty = Rect(pointlist[0], (width, width)) */ __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_11pygame_sdl2_4draw_13lines, NULL, __pyx_n_s_pygame_sdl2_draw); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 85; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_lines, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 85; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "pygame_sdl2/draw.pyx":96 * return dirty.clip(surface.get_rect()) * * def aaline(Surface surface, color, startpos, endpos, blend=1): # <<<<<<<<<<<<<< * x1, y1 = startpos * x2, y2 = endpos */ __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_11pygame_sdl2_4draw_15aaline, NULL, __pyx_n_s_pygame_sdl2_draw); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 96; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_aaline, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 96; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "pygame_sdl2/draw.pyx":103 * return dirty.clip(surface.get_rect()) * * def aalines(Surface surface, color, closed, pointlist, blend=1): # <<<<<<<<<<<<<< * n = 0 * dirty = Rect(pointlist[0], (1,1)) */ __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_11pygame_sdl2_4draw_17aalines, NULL, __pyx_n_s_pygame_sdl2_draw); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 103; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_aalines, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 103; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "pygame_sdl2/draw.pyx":1 * # Copyright 2014 Patrick Dawson # <<<<<<<<<<<<<< * # * # This software is provided 'as-is', without any express or implied */ __pyx_t_2 = PyDict_New(); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_test, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /*--- Wrapped vars code ---*/ goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); if (__pyx_m) { if (__pyx_d) { __Pyx_AddTraceback("init pygame_sdl2.draw", __pyx_clineno, __pyx_lineno, __pyx_filename); } Py_DECREF(__pyx_m); __pyx_m = 0; } else if (!PyErr_Occurred()) { PyErr_SetString(PyExc_ImportError, "init pygame_sdl2.draw"); } __pyx_L0:; __Pyx_RefNannyFinishContext(); #if PY_MAJOR_VERSION < 3 return; #else return __pyx_m; #endif } /* --- Runtime support code --- */ #if CYTHON_REFNANNY static __Pyx_RefNannyAPIStruct *__Pyx_RefNannyImportAPI(const char *modname) { PyObject *m = NULL, *p = NULL; void *r = NULL; m = PyImport_ImportModule((char *)modname); if (!m) goto end; p = PyObject_GetAttrString(m, (char *)"RefNannyAPI"); if (!p) goto end; r = PyLong_AsVoidPtr(p); end: Py_XDECREF(p); Py_XDECREF(m); return (__Pyx_RefNannyAPIStruct *)r; } #endif static void __Pyx_RaiseArgtupleInvalid( const char* func_name, int exact, Py_ssize_t num_min, Py_ssize_t num_max, Py_ssize_t num_found) { Py_ssize_t num_expected; const char *more_or_less; if (num_found < num_min) { num_expected = num_min; more_or_less = "at least"; } else { num_expected = num_max; more_or_less = "at most"; } if (exact) { more_or_less = "exactly"; } PyErr_Format(PyExc_TypeError, "%.200s() takes %.8s %" CYTHON_FORMAT_SSIZE_T "d positional argument%.1s (%" CYTHON_FORMAT_SSIZE_T "d given)", func_name, more_or_less, num_expected, (num_expected == 1) ? "" : "s", num_found); } static void __Pyx_RaiseDoubleKeywordsError( const char* func_name, PyObject* kw_name) { PyErr_Format(PyExc_TypeError, #if PY_MAJOR_VERSION >= 3 "%s() got multiple values for keyword argument '%U'", func_name, kw_name); #else "%s() got multiple values for keyword argument '%s'", func_name, PyString_AsString(kw_name)); #endif } static int __Pyx_ParseOptionalKeywords( PyObject *kwds, PyObject **argnames[], PyObject *kwds2, PyObject *values[], Py_ssize_t num_pos_args, const char* function_name) { PyObject *key = 0, *value = 0; Py_ssize_t pos = 0; PyObject*** name; PyObject*** first_kw_arg = argnames + num_pos_args; while (PyDict_Next(kwds, &pos, &key, &value)) { name = first_kw_arg; while (*name && (**name != key)) name++; if (*name) { values[name-argnames] = value; continue; } name = first_kw_arg; #if PY_MAJOR_VERSION < 3 if (likely(PyString_CheckExact(key)) || likely(PyString_Check(key))) { while (*name) { if ((CYTHON_COMPILING_IN_PYPY || PyString_GET_SIZE(**name) == PyString_GET_SIZE(key)) && _PyString_Eq(**name, key)) { values[name-argnames] = value; break; } name++; } if (*name) continue; else { PyObject*** argname = argnames; while (argname != first_kw_arg) { if ((**argname == key) || ( (CYTHON_COMPILING_IN_PYPY || PyString_GET_SIZE(**argname) == PyString_GET_SIZE(key)) && _PyString_Eq(**argname, key))) { goto arg_passed_twice; } argname++; } } } else #endif if (likely(PyUnicode_Check(key))) { while (*name) { int cmp = (**name == key) ? 0 : #if !CYTHON_COMPILING_IN_PYPY && PY_MAJOR_VERSION >= 3 (PyUnicode_GET_SIZE(**name) != PyUnicode_GET_SIZE(key)) ? 1 : #endif PyUnicode_Compare(**name, key); if (cmp < 0 && unlikely(PyErr_Occurred())) goto bad; if (cmp == 0) { values[name-argnames] = value; break; } name++; } if (*name) continue; else { PyObject*** argname = argnames; while (argname != first_kw_arg) { int cmp = (**argname == key) ? 0 : #if !CYTHON_COMPILING_IN_PYPY && PY_MAJOR_VERSION >= 3 (PyUnicode_GET_SIZE(**argname) != PyUnicode_GET_SIZE(key)) ? 1 : #endif PyUnicode_Compare(**argname, key); if (cmp < 0 && unlikely(PyErr_Occurred())) goto bad; if (cmp == 0) goto arg_passed_twice; argname++; } } } else goto invalid_keyword_type; if (kwds2) { if (unlikely(PyDict_SetItem(kwds2, key, value))) goto bad; } else { goto invalid_keyword; } } return 0; arg_passed_twice: __Pyx_RaiseDoubleKeywordsError(function_name, key); goto bad; invalid_keyword_type: PyErr_Format(PyExc_TypeError, "%.200s() keywords must be strings", function_name); goto bad; invalid_keyword: PyErr_Format(PyExc_TypeError, #if PY_MAJOR_VERSION < 3 "%.200s() got an unexpected keyword argument '%.200s'", function_name, PyString_AsString(key)); #else "%s() got an unexpected keyword argument '%U'", function_name, key); #endif bad: return -1; } static void __Pyx_RaiseArgumentTypeInvalid(const char* name, PyObject *obj, PyTypeObject *type) { PyErr_Format(PyExc_TypeError, "Argument '%.200s' has incorrect type (expected %.200s, got %.200s)", name, type->tp_name, Py_TYPE(obj)->tp_name); } static CYTHON_INLINE int __Pyx_ArgTypeTest(PyObject *obj, PyTypeObject *type, int none_allowed, const char *name, int exact) { if (unlikely(!type)) { PyErr_SetString(PyExc_SystemError, "Missing type object"); return 0; } if (none_allowed && obj == Py_None) return 1; else if (exact) { if (likely(Py_TYPE(obj) == type)) return 1; #if PY_MAJOR_VERSION == 2 else if ((type == &PyBaseString_Type) && likely(__Pyx_PyBaseString_CheckExact(obj))) return 1; #endif } else { if (likely(PyObject_TypeCheck(obj, type))) return 1; } __Pyx_RaiseArgumentTypeInvalid(name, obj, type); return 0; } static PyObject *__Pyx_GetBuiltinName(PyObject *name) { PyObject* result = __Pyx_PyObject_GetAttrStr(__pyx_b, name); if (unlikely(!result)) { PyErr_Format(PyExc_NameError, #if PY_MAJOR_VERSION >= 3 "name '%U' is not defined", name); #else "name '%.200s' is not defined", PyString_AS_STRING(name)); #endif } return result; } static CYTHON_INLINE PyObject *__Pyx_GetModuleGlobalName(PyObject *name) { PyObject *result; #if CYTHON_COMPILING_IN_CPYTHON result = PyDict_GetItem(__pyx_d, name); if (likely(result)) { Py_INCREF(result); } else { #else result = PyObject_GetItem(__pyx_d, name); if (!result) { PyErr_Clear(); #endif result = __Pyx_GetBuiltinName(name); } return result; } #if CYTHON_COMPILING_IN_CPYTHON static CYTHON_INLINE PyObject* __Pyx_PyObject_Call(PyObject *func, PyObject *arg, PyObject *kw) { PyObject *result; ternaryfunc call = func->ob_type->tp_call; if (unlikely(!call)) return PyObject_Call(func, arg, kw); if (unlikely(Py_EnterRecursiveCall((char*)" while calling a Python object"))) return NULL; result = (*call)(func, arg, kw); Py_LeaveRecursiveCall(); if (unlikely(!result) && unlikely(!PyErr_Occurred())) { PyErr_SetString( PyExc_SystemError, "NULL result without error in PyObject_Call"); } return result; } #endif #if CYTHON_COMPILING_IN_CPYTHON static CYTHON_INLINE PyObject* __Pyx_PyObject_CallMethO(PyObject *func, PyObject *arg) { PyObject *self, *result; PyCFunction cfunc; cfunc = PyCFunction_GET_FUNCTION(func); self = PyCFunction_GET_SELF(func); if (unlikely(Py_EnterRecursiveCall((char*)" while calling a Python object"))) return NULL; result = cfunc(self, arg); Py_LeaveRecursiveCall(); if (unlikely(!result) && unlikely(!PyErr_Occurred())) { PyErr_SetString( PyExc_SystemError, "NULL result without error in PyObject_Call"); } return result; } #endif #if CYTHON_COMPILING_IN_CPYTHON static PyObject* __Pyx__PyObject_CallOneArg(PyObject *func, PyObject *arg) { PyObject *result; PyObject *args = PyTuple_New(1); if (unlikely(!args)) return NULL; Py_INCREF(arg); PyTuple_SET_ITEM(args, 0, arg); result = __Pyx_PyObject_Call(func, args, NULL); Py_DECREF(args); return result; } static CYTHON_INLINE PyObject* __Pyx_PyObject_CallOneArg(PyObject *func, PyObject *arg) { #ifdef __Pyx_CyFunction_USED if (likely(PyCFunction_Check(func) || PyObject_TypeCheck(func, __pyx_CyFunctionType))) { #else if (likely(PyCFunction_Check(func))) { #endif if (likely(PyCFunction_GET_FLAGS(func) & METH_O)) { return __Pyx_PyObject_CallMethO(func, arg); } } return __Pyx__PyObject_CallOneArg(func, arg); } #else static CYTHON_INLINE PyObject* __Pyx_PyObject_CallOneArg(PyObject *func, PyObject *arg) { PyObject* args = PyTuple_Pack(1, arg); return (likely(args)) ? __Pyx_PyObject_Call(func, args, NULL) : NULL; } #endif #if CYTHON_USE_PYLONG_INTERNALS #include "longintrepr.h" #endif #if CYTHON_COMPILING_IN_CPYTHON static PyObject* __Pyx_PyInt_EqObjC(PyObject *op1, PyObject *op2, CYTHON_UNUSED long intval, CYTHON_UNUSED int inplace) { if (op1 == op2) { Py_RETURN_TRUE; } #if PY_MAJOR_VERSION < 3 if (likely(PyInt_CheckExact(op1))) { const long b = intval; long a = PyInt_AS_LONG(op1); if (a == b) { Py_RETURN_TRUE; } else { Py_RETURN_FALSE; } } #endif #if CYTHON_USE_PYLONG_INTERNALS && PY_MAJOR_VERSION >= 3 if (likely(PyLong_CheckExact(op1))) { const long b = intval; long a; const digit* digits = ((PyLongObject*)op1)->ob_digit; const Py_ssize_t size = Py_SIZE(op1); if (likely(__Pyx_sst_abs(size) <= 1)) { a = likely(size) ? digits[0] : 0; if (size == -1) a = -a; } else { switch (size) { case -2: if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) { a = -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])); break; } case 2: if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) { a = (long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])); break; } case -3: if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) { a = -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])); break; } case 3: if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) { a = (long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])); break; } case -4: if (8 * sizeof(long) - 1 > 4 * PyLong_SHIFT) { a = -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])); break; } case 4: if (8 * sizeof(long) - 1 > 4 * PyLong_SHIFT) { a = (long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])); break; } #if PyLong_SHIFT < 30 && PyLong_SHIFT != 15 default: return PyLong_Type.tp_richcompare(op1, op2, Py_EQ); #else default: Py_RETURN_FALSE; #endif } } if (a == b) { Py_RETURN_TRUE; } else { Py_RETURN_FALSE; } } #endif if (PyFloat_CheckExact(op1)) { const long b = intval; double a = PyFloat_AS_DOUBLE(op1); if ((double)a == (double)b) { Py_RETURN_TRUE; } else { Py_RETURN_FALSE; } } return PyObject_RichCompare(op1, op2, Py_EQ); } #endif #if CYTHON_COMPILING_IN_CPYTHON static PyObject* __Pyx_PyInt_AddObjC(PyObject *op1, PyObject *op2, CYTHON_UNUSED long intval, CYTHON_UNUSED int inplace) { #if PY_MAJOR_VERSION < 3 if (likely(PyInt_CheckExact(op1))) { const long b = intval; long x; long a = PyInt_AS_LONG(op1); x = (long)((unsigned long)a + b); if (likely((x^a) >= 0 || (x^b) >= 0)) return PyInt_FromLong(x); return PyLong_Type.tp_as_number->nb_add(op1, op2); } #endif #if CYTHON_USE_PYLONG_INTERNALS && PY_MAJOR_VERSION >= 3 if (likely(PyLong_CheckExact(op1))) { const long b = intval; long a, x; const PY_LONG_LONG llb = intval; PY_LONG_LONG lla, llx; const digit* digits = ((PyLongObject*)op1)->ob_digit; const Py_ssize_t size = Py_SIZE(op1); if (likely(__Pyx_sst_abs(size) <= 1)) { a = likely(size) ? digits[0] : 0; if (size == -1) a = -a; } else { switch (size) { case -2: if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) { a = -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])); break; } else if (8 * sizeof(PY_LONG_LONG) - 1 > 2 * PyLong_SHIFT) { lla = -(PY_LONG_LONG) (((((unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0])); goto long_long; } case 2: if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) { a = (long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])); break; } else if (8 * sizeof(PY_LONG_LONG) - 1 > 2 * PyLong_SHIFT) { lla = (PY_LONG_LONG) (((((unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0])); goto long_long; } case -3: if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) { a = -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])); break; } else if (8 * sizeof(PY_LONG_LONG) - 1 > 3 * PyLong_SHIFT) { lla = -(PY_LONG_LONG) (((((((unsigned PY_LONG_LONG)digits[2]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0])); goto long_long; } case 3: if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) { a = (long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])); break; } else if (8 * sizeof(PY_LONG_LONG) - 1 > 3 * PyLong_SHIFT) { lla = (PY_LONG_LONG) (((((((unsigned PY_LONG_LONG)digits[2]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0])); goto long_long; } case -4: if (8 * sizeof(long) - 1 > 4 * PyLong_SHIFT) { a = -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])); break; } else if (8 * sizeof(PY_LONG_LONG) - 1 > 4 * PyLong_SHIFT) { lla = -(PY_LONG_LONG) (((((((((unsigned PY_LONG_LONG)digits[3]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[2]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0])); goto long_long; } case 4: if (8 * sizeof(long) - 1 > 4 * PyLong_SHIFT) { a = (long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])); break; } else if (8 * sizeof(PY_LONG_LONG) - 1 > 4 * PyLong_SHIFT) { lla = (PY_LONG_LONG) (((((((((unsigned PY_LONG_LONG)digits[3]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[2]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0])); goto long_long; } default: return PyLong_Type.tp_as_number->nb_add(op1, op2); } } x = a + b; return PyLong_FromLong(x); long_long: llx = lla + llb; return PyLong_FromLongLong(llx); } #endif if (PyFloat_CheckExact(op1)) { const long b = intval; double a = PyFloat_AS_DOUBLE(op1); double result; PyFPE_START_PROTECT("add", return NULL) result = ((double)a) + (double)b; PyFPE_END_PROTECT(result) return PyFloat_FromDouble(result); } return (inplace ? PyNumber_InPlaceAdd : PyNumber_Add)(op1, op2); } #endif #if CYTHON_COMPILING_IN_CPYTHON static CYTHON_INLINE PyObject* __Pyx_PyObject_CallNoArg(PyObject *func) { #ifdef __Pyx_CyFunction_USED if (likely(PyCFunction_Check(func) || PyObject_TypeCheck(func, __pyx_CyFunctionType))) { #else if (likely(PyCFunction_Check(func))) { #endif if (likely(PyCFunction_GET_FLAGS(func) & METH_NOARGS)) { return __Pyx_PyObject_CallMethO(func, NULL); } } return __Pyx_PyObject_Call(func, __pyx_empty_tuple, NULL); } #endif static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Generic(PyObject *o, PyObject* j) { PyObject *r; if (!j) return NULL; r = PyObject_GetItem(o, j); Py_DECREF(j); return r; } static CYTHON_INLINE PyObject *__Pyx_GetItemInt_List_Fast(PyObject *o, Py_ssize_t i, CYTHON_NCP_UNUSED int wraparound, CYTHON_NCP_UNUSED int boundscheck) { #if CYTHON_COMPILING_IN_CPYTHON if (wraparound & unlikely(i < 0)) i += PyList_GET_SIZE(o); if ((!boundscheck) || likely((0 <= i) & (i < PyList_GET_SIZE(o)))) { PyObject *r = PyList_GET_ITEM(o, i); Py_INCREF(r); return r; } return __Pyx_GetItemInt_Generic(o, PyInt_FromSsize_t(i)); #else return PySequence_GetItem(o, i); #endif } static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Tuple_Fast(PyObject *o, Py_ssize_t i, CYTHON_NCP_UNUSED int wraparound, CYTHON_NCP_UNUSED int boundscheck) { #if CYTHON_COMPILING_IN_CPYTHON if (wraparound & unlikely(i < 0)) i += PyTuple_GET_SIZE(o); if ((!boundscheck) || likely((0 <= i) & (i < PyTuple_GET_SIZE(o)))) { PyObject *r = PyTuple_GET_ITEM(o, i); Py_INCREF(r); return r; } return __Pyx_GetItemInt_Generic(o, PyInt_FromSsize_t(i)); #else return PySequence_GetItem(o, i); #endif } static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Fast(PyObject *o, Py_ssize_t i, int is_list, CYTHON_NCP_UNUSED int wraparound, CYTHON_NCP_UNUSED int boundscheck) { #if CYTHON_COMPILING_IN_CPYTHON if (is_list || PyList_CheckExact(o)) { Py_ssize_t n = ((!wraparound) | likely(i >= 0)) ? i : i + PyList_GET_SIZE(o); if ((!boundscheck) || (likely((n >= 0) & (n < PyList_GET_SIZE(o))))) { PyObject *r = PyList_GET_ITEM(o, n); Py_INCREF(r); return r; } } else if (PyTuple_CheckExact(o)) { Py_ssize_t n = ((!wraparound) | likely(i >= 0)) ? i : i + PyTuple_GET_SIZE(o); if ((!boundscheck) || likely((n >= 0) & (n < PyTuple_GET_SIZE(o)))) { PyObject *r = PyTuple_GET_ITEM(o, n); Py_INCREF(r); return r; } } else { PySequenceMethods *m = Py_TYPE(o)->tp_as_sequence; if (likely(m && m->sq_item)) { if (wraparound && unlikely(i < 0) && likely(m->sq_length)) { Py_ssize_t l = m->sq_length(o); if (likely(l >= 0)) { i += l; } else { if (PyErr_ExceptionMatches(PyExc_OverflowError)) PyErr_Clear(); else return NULL; } } return m->sq_item(o, i); } } #else if (is_list || PySequence_Check(o)) { return PySequence_GetItem(o, i); } #endif return __Pyx_GetItemInt_Generic(o, PyInt_FromSsize_t(i)); } static CYTHON_INLINE void __Pyx_RaiseTooManyValuesError(Py_ssize_t expected) { PyErr_Format(PyExc_ValueError, "too many values to unpack (expected %" CYTHON_FORMAT_SSIZE_T "d)", expected); } static CYTHON_INLINE void __Pyx_RaiseNeedMoreValuesError(Py_ssize_t index) { PyErr_Format(PyExc_ValueError, "need more than %" CYTHON_FORMAT_SSIZE_T "d value%.1s to unpack", index, (index == 1) ? "" : "s"); } static CYTHON_INLINE int __Pyx_IterFinish(void) { #if CYTHON_COMPILING_IN_CPYTHON PyThreadState *tstate = PyThreadState_GET(); PyObject* exc_type = tstate->curexc_type; if (unlikely(exc_type)) { if (likely(exc_type == PyExc_StopIteration) || PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration)) { PyObject *exc_value, *exc_tb; exc_value = tstate->curexc_value; exc_tb = tstate->curexc_traceback; tstate->curexc_type = 0; tstate->curexc_value = 0; tstate->curexc_traceback = 0; Py_DECREF(exc_type); Py_XDECREF(exc_value); Py_XDECREF(exc_tb); return 0; } else { return -1; } } return 0; #else if (unlikely(PyErr_Occurred())) { if (likely(PyErr_ExceptionMatches(PyExc_StopIteration))) { PyErr_Clear(); return 0; } else { return -1; } } return 0; #endif } static int __Pyx_IternextUnpackEndCheck(PyObject *retval, Py_ssize_t expected) { if (unlikely(retval)) { Py_DECREF(retval); __Pyx_RaiseTooManyValuesError(expected); return -1; } else { return __Pyx_IterFinish(); } return 0; } #if CYTHON_COMPILING_IN_CPYTHON static PyObject* __Pyx_PyInt_SubtractObjC(PyObject *op1, PyObject *op2, CYTHON_UNUSED long intval, CYTHON_UNUSED int inplace) { #if PY_MAJOR_VERSION < 3 if (likely(PyInt_CheckExact(op1))) { const long b = intval; long x; long a = PyInt_AS_LONG(op1); x = (long)((unsigned long)a - b); if (likely((x^a) >= 0 || (x^~b) >= 0)) return PyInt_FromLong(x); return PyLong_Type.tp_as_number->nb_subtract(op1, op2); } #endif #if CYTHON_USE_PYLONG_INTERNALS && PY_MAJOR_VERSION >= 3 if (likely(PyLong_CheckExact(op1))) { const long b = intval; long a, x; const PY_LONG_LONG llb = intval; PY_LONG_LONG lla, llx; const digit* digits = ((PyLongObject*)op1)->ob_digit; const Py_ssize_t size = Py_SIZE(op1); if (likely(__Pyx_sst_abs(size) <= 1)) { a = likely(size) ? digits[0] : 0; if (size == -1) a = -a; } else { switch (size) { case -2: if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) { a = -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])); break; } else if (8 * sizeof(PY_LONG_LONG) - 1 > 2 * PyLong_SHIFT) { lla = -(PY_LONG_LONG) (((((unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0])); goto long_long; } case 2: if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) { a = (long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])); break; } else if (8 * sizeof(PY_LONG_LONG) - 1 > 2 * PyLong_SHIFT) { lla = (PY_LONG_LONG) (((((unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0])); goto long_long; } case -3: if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) { a = -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])); break; } else if (8 * sizeof(PY_LONG_LONG) - 1 > 3 * PyLong_SHIFT) { lla = -(PY_LONG_LONG) (((((((unsigned PY_LONG_LONG)digits[2]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0])); goto long_long; } case 3: if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) { a = (long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])); break; } else if (8 * sizeof(PY_LONG_LONG) - 1 > 3 * PyLong_SHIFT) { lla = (PY_LONG_LONG) (((((((unsigned PY_LONG_LONG)digits[2]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0])); goto long_long; } case -4: if (8 * sizeof(long) - 1 > 4 * PyLong_SHIFT) { a = -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])); break; } else if (8 * sizeof(PY_LONG_LONG) - 1 > 4 * PyLong_SHIFT) { lla = -(PY_LONG_LONG) (((((((((unsigned PY_LONG_LONG)digits[3]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[2]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0])); goto long_long; } case 4: if (8 * sizeof(long) - 1 > 4 * PyLong_SHIFT) { a = (long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])); break; } else if (8 * sizeof(PY_LONG_LONG) - 1 > 4 * PyLong_SHIFT) { lla = (PY_LONG_LONG) (((((((((unsigned PY_LONG_LONG)digits[3]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[2]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0])); goto long_long; } default: return PyLong_Type.tp_as_number->nb_subtract(op1, op2); } } x = a - b; return PyLong_FromLong(x); long_long: llx = lla - llb; return PyLong_FromLongLong(llx); } #endif if (PyFloat_CheckExact(op1)) { const long b = intval; double a = PyFloat_AS_DOUBLE(op1); double result; PyFPE_START_PROTECT("subtract", return NULL) result = ((double)a) - (double)b; PyFPE_END_PROTECT(result) return PyFloat_FromDouble(result); } return (inplace ? PyNumber_InPlaceSubtract : PyNumber_Subtract)(op1, op2); } #endif static CYTHON_INLINE void __Pyx_ErrRestore(PyObject *type, PyObject *value, PyObject *tb) { #if CYTHON_COMPILING_IN_CPYTHON PyObject *tmp_type, *tmp_value, *tmp_tb; PyThreadState *tstate = PyThreadState_GET(); tmp_type = tstate->curexc_type; tmp_value = tstate->curexc_value; tmp_tb = tstate->curexc_traceback; tstate->curexc_type = type; tstate->curexc_value = value; tstate->curexc_traceback = tb; Py_XDECREF(tmp_type); Py_XDECREF(tmp_value); Py_XDECREF(tmp_tb); #else PyErr_Restore(type, value, tb); #endif } static CYTHON_INLINE void __Pyx_ErrFetch(PyObject **type, PyObject **value, PyObject **tb) { #if CYTHON_COMPILING_IN_CPYTHON PyThreadState *tstate = PyThreadState_GET(); *type = tstate->curexc_type; *value = tstate->curexc_value; *tb = tstate->curexc_traceback; tstate->curexc_type = 0; tstate->curexc_value = 0; tstate->curexc_traceback = 0; #else PyErr_Fetch(type, value, tb); #endif } #if PY_MAJOR_VERSION < 3 static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, CYTHON_UNUSED PyObject *cause) { Py_XINCREF(type); if (!value || value == Py_None) value = NULL; else Py_INCREF(value); if (!tb || tb == Py_None) tb = NULL; else { Py_INCREF(tb); if (!PyTraceBack_Check(tb)) { PyErr_SetString(PyExc_TypeError, "raise: arg 3 must be a traceback or None"); goto raise_error; } } if (PyType_Check(type)) { #if CYTHON_COMPILING_IN_PYPY if (!value) { Py_INCREF(Py_None); value = Py_None; } #endif PyErr_NormalizeException(&type, &value, &tb); } else { if (value) { PyErr_SetString(PyExc_TypeError, "instance exception may not have a separate value"); goto raise_error; } value = type; type = (PyObject*) Py_TYPE(type); Py_INCREF(type); if (!PyType_IsSubtype((PyTypeObject *)type, (PyTypeObject *)PyExc_BaseException)) { PyErr_SetString(PyExc_TypeError, "raise: exception class must be a subclass of BaseException"); goto raise_error; } } __Pyx_ErrRestore(type, value, tb); return; raise_error: Py_XDECREF(value); Py_XDECREF(type); Py_XDECREF(tb); return; } #else static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, PyObject *cause) { PyObject* owned_instance = NULL; if (tb == Py_None) { tb = 0; } else if (tb && !PyTraceBack_Check(tb)) { PyErr_SetString(PyExc_TypeError, "raise: arg 3 must be a traceback or None"); goto bad; } if (value == Py_None) value = 0; if (PyExceptionInstance_Check(type)) { if (value) { PyErr_SetString(PyExc_TypeError, "instance exception may not have a separate value"); goto bad; } value = type; type = (PyObject*) Py_TYPE(value); } else if (PyExceptionClass_Check(type)) { PyObject *instance_class = NULL; if (value && PyExceptionInstance_Check(value)) { instance_class = (PyObject*) Py_TYPE(value); if (instance_class != type) { int is_subclass = PyObject_IsSubclass(instance_class, type); if (!is_subclass) { instance_class = NULL; } else if (unlikely(is_subclass == -1)) { goto bad; } else { type = instance_class; } } } if (!instance_class) { PyObject *args; if (!value) args = PyTuple_New(0); else if (PyTuple_Check(value)) { Py_INCREF(value); args = value; } else args = PyTuple_Pack(1, value); if (!args) goto bad; owned_instance = PyObject_Call(type, args, NULL); Py_DECREF(args); if (!owned_instance) goto bad; value = owned_instance; if (!PyExceptionInstance_Check(value)) { PyErr_Format(PyExc_TypeError, "calling %R should have returned an instance of " "BaseException, not %R", type, Py_TYPE(value)); goto bad; } } } else { PyErr_SetString(PyExc_TypeError, "raise: exception class must be a subclass of BaseException"); goto bad; } #if PY_VERSION_HEX >= 0x03030000 if (cause) { #else if (cause && cause != Py_None) { #endif PyObject *fixed_cause; if (cause == Py_None) { fixed_cause = NULL; } else if (PyExceptionClass_Check(cause)) { fixed_cause = PyObject_CallObject(cause, NULL); if (fixed_cause == NULL) goto bad; } else if (PyExceptionInstance_Check(cause)) { fixed_cause = cause; Py_INCREF(fixed_cause); } else { PyErr_SetString(PyExc_TypeError, "exception causes must derive from " "BaseException"); goto bad; } PyException_SetCause(value, fixed_cause); } PyErr_SetObject(type, value); if (tb) { #if CYTHON_COMPILING_IN_PYPY PyObject *tmp_type, *tmp_value, *tmp_tb; PyErr_Fetch(&tmp_type, &tmp_value, &tmp_tb); Py_INCREF(tb); PyErr_Restore(tmp_type, tmp_value, tb); Py_XDECREF(tmp_tb); #else PyThreadState *tstate = PyThreadState_GET(); PyObject* tmp_tb = tstate->curexc_traceback; if (tb != tmp_tb) { Py_INCREF(tb); tstate->curexc_traceback = tb; Py_XDECREF(tmp_tb); } #endif } bad: Py_XDECREF(owned_instance); return; } #endif static void* __Pyx_GetVtable(PyObject *dict) { void* ptr; PyObject *ob = PyObject_GetItem(dict, __pyx_n_s_pyx_vtable); if (!ob) goto bad; #if PY_VERSION_HEX >= 0x02070000 ptr = PyCapsule_GetPointer(ob, 0); #else ptr = PyCObject_AsVoidPtr(ob); #endif if (!ptr && !PyErr_Occurred()) PyErr_SetString(PyExc_RuntimeError, "invalid vtable found for imported type"); Py_DECREF(ob); return ptr; bad: Py_XDECREF(ob); return NULL; } static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list, int level) { PyObject *empty_list = 0; PyObject *module = 0; PyObject *global_dict = 0; PyObject *empty_dict = 0; PyObject *list; #if PY_VERSION_HEX < 0x03030000 PyObject *py_import; py_import = __Pyx_PyObject_GetAttrStr(__pyx_b, __pyx_n_s_import); if (!py_import) goto bad; #endif if (from_list) list = from_list; else { empty_list = PyList_New(0); if (!empty_list) goto bad; list = empty_list; } global_dict = PyModule_GetDict(__pyx_m); if (!global_dict) goto bad; empty_dict = PyDict_New(); if (!empty_dict) goto bad; { #if PY_MAJOR_VERSION >= 3 if (level == -1) { if (strchr(__Pyx_MODULE_NAME, '.')) { #if PY_VERSION_HEX < 0x03030000 PyObject *py_level = PyInt_FromLong(1); if (!py_level) goto bad; module = PyObject_CallFunctionObjArgs(py_import, name, global_dict, empty_dict, list, py_level, NULL); Py_DECREF(py_level); #else module = PyImport_ImportModuleLevelObject( name, global_dict, empty_dict, list, 1); #endif if (!module) { if (!PyErr_ExceptionMatches(PyExc_ImportError)) goto bad; PyErr_Clear(); } } level = 0; } #endif if (!module) { #if PY_VERSION_HEX < 0x03030000 PyObject *py_level = PyInt_FromLong(level); if (!py_level) goto bad; module = PyObject_CallFunctionObjArgs(py_import, name, global_dict, empty_dict, list, py_level, NULL); Py_DECREF(py_level); #else module = PyImport_ImportModuleLevelObject( name, global_dict, empty_dict, list, level); #endif } } bad: #if PY_VERSION_HEX < 0x03030000 Py_XDECREF(py_import); #endif Py_XDECREF(empty_list); Py_XDECREF(empty_dict); return module; } static PyObject* __Pyx_ImportFrom(PyObject* module, PyObject* name) { PyObject* value = __Pyx_PyObject_GetAttrStr(module, name); if (unlikely(!value) && PyErr_ExceptionMatches(PyExc_AttributeError)) { PyErr_Format(PyExc_ImportError, #if PY_MAJOR_VERSION < 3 "cannot import name %.230s", PyString_AS_STRING(name)); #else "cannot import name %S", name); #endif } return value; } static int __pyx_bisect_code_objects(__Pyx_CodeObjectCacheEntry* entries, int count, int code_line) { int start = 0, mid = 0, end = count - 1; if (end >= 0 && code_line > entries[end].code_line) { return count; } while (start < end) { mid = start + (end - start) / 2; if (code_line < entries[mid].code_line) { end = mid; } else if (code_line > entries[mid].code_line) { start = mid + 1; } else { return mid; } } if (code_line <= entries[mid].code_line) { return mid; } else { return mid + 1; } } static PyCodeObject *__pyx_find_code_object(int code_line) { PyCodeObject* code_object; int pos; if (unlikely(!code_line) || unlikely(!__pyx_code_cache.entries)) { return NULL; } pos = __pyx_bisect_code_objects(__pyx_code_cache.entries, __pyx_code_cache.count, code_line); if (unlikely(pos >= __pyx_code_cache.count) || unlikely(__pyx_code_cache.entries[pos].code_line != code_line)) { return NULL; } code_object = __pyx_code_cache.entries[pos].code_object; Py_INCREF(code_object); return code_object; } static void __pyx_insert_code_object(int code_line, PyCodeObject* code_object) { int pos, i; __Pyx_CodeObjectCacheEntry* entries = __pyx_code_cache.entries; if (unlikely(!code_line)) { return; } if (unlikely(!entries)) { entries = (__Pyx_CodeObjectCacheEntry*)PyMem_Malloc(64*sizeof(__Pyx_CodeObjectCacheEntry)); if (likely(entries)) { __pyx_code_cache.entries = entries; __pyx_code_cache.max_count = 64; __pyx_code_cache.count = 1; entries[0].code_line = code_line; entries[0].code_object = code_object; Py_INCREF(code_object); } return; } pos = __pyx_bisect_code_objects(__pyx_code_cache.entries, __pyx_code_cache.count, code_line); if ((pos < __pyx_code_cache.count) && unlikely(__pyx_code_cache.entries[pos].code_line == code_line)) { PyCodeObject* tmp = entries[pos].code_object; entries[pos].code_object = code_object; Py_DECREF(tmp); return; } if (__pyx_code_cache.count == __pyx_code_cache.max_count) { int new_max = __pyx_code_cache.max_count + 64; entries = (__Pyx_CodeObjectCacheEntry*)PyMem_Realloc( __pyx_code_cache.entries, (size_t)new_max*sizeof(__Pyx_CodeObjectCacheEntry)); if (unlikely(!entries)) { return; } __pyx_code_cache.entries = entries; __pyx_code_cache.max_count = new_max; } for (i=__pyx_code_cache.count; i>pos; i--) { entries[i] = entries[i-1]; } entries[pos].code_line = code_line; entries[pos].code_object = code_object; __pyx_code_cache.count++; Py_INCREF(code_object); } #include "compile.h" #include "frameobject.h" #include "traceback.h" static PyCodeObject* __Pyx_CreateCodeObjectForTraceback( const char *funcname, int c_line, int py_line, const char *filename) { PyCodeObject *py_code = 0; PyObject *py_srcfile = 0; PyObject *py_funcname = 0; #if PY_MAJOR_VERSION < 3 py_srcfile = PyString_FromString(filename); #else py_srcfile = PyUnicode_FromString(filename); #endif if (!py_srcfile) goto bad; if (c_line) { #if PY_MAJOR_VERSION < 3 py_funcname = PyString_FromFormat( "%s (%s:%d)", funcname, __pyx_cfilenm, c_line); #else py_funcname = PyUnicode_FromFormat( "%s (%s:%d)", funcname, __pyx_cfilenm, c_line); #endif } else { #if PY_MAJOR_VERSION < 3 py_funcname = PyString_FromString(funcname); #else py_funcname = PyUnicode_FromString(funcname); #endif } if (!py_funcname) goto bad; py_code = __Pyx_PyCode_New( 0, 0, 0, 0, 0, __pyx_empty_bytes, /*PyObject *code,*/ __pyx_empty_tuple, /*PyObject *consts,*/ __pyx_empty_tuple, /*PyObject *names,*/ __pyx_empty_tuple, /*PyObject *varnames,*/ __pyx_empty_tuple, /*PyObject *freevars,*/ __pyx_empty_tuple, /*PyObject *cellvars,*/ py_srcfile, /*PyObject *filename,*/ py_funcname, /*PyObject *name,*/ py_line, __pyx_empty_bytes /*PyObject *lnotab*/ ); Py_DECREF(py_srcfile); Py_DECREF(py_funcname); return py_code; bad: Py_XDECREF(py_srcfile); Py_XDECREF(py_funcname); return NULL; } static void __Pyx_AddTraceback(const char *funcname, int c_line, int py_line, const char *filename) { PyCodeObject *py_code = 0; PyFrameObject *py_frame = 0; py_code = __pyx_find_code_object(c_line ? c_line : py_line); if (!py_code) { py_code = __Pyx_CreateCodeObjectForTraceback( funcname, c_line, py_line, filename); if (!py_code) goto bad; __pyx_insert_code_object(c_line ? c_line : py_line, py_code); } py_frame = PyFrame_New( PyThreadState_GET(), /*PyThreadState *tstate,*/ py_code, /*PyCodeObject *code,*/ __pyx_d, /*PyObject *globals,*/ 0 /*PyObject *locals*/ ); if (!py_frame) goto bad; py_frame->f_lineno = py_line; PyTraceBack_Here(py_frame); bad: Py_XDECREF(py_code); Py_XDECREF(py_frame); } static CYTHON_INLINE PyObject* __Pyx_PyInt_From_long(long value) { const long neg_one = (long) -1, const_zero = (long) 0; const int is_unsigned = neg_one > const_zero; if (is_unsigned) { if (sizeof(long) < sizeof(long)) { return PyInt_FromLong((long) value); } else if (sizeof(long) <= sizeof(unsigned long)) { return PyLong_FromUnsignedLong((unsigned long) value); } else if (sizeof(long) <= sizeof(unsigned PY_LONG_LONG)) { return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value); } } else { if (sizeof(long) <= sizeof(long)) { return PyInt_FromLong((long) value); } else if (sizeof(long) <= sizeof(PY_LONG_LONG)) { return PyLong_FromLongLong((PY_LONG_LONG) value); } } { int one = 1; int little = (int)*(unsigned char *)&one; unsigned char *bytes = (unsigned char *)&value; return _PyLong_FromByteArray(bytes, sizeof(long), little, !is_unsigned); } } #define __PYX_VERIFY_RETURN_INT(target_type, func_type, func_value)\ __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, 0) #define __PYX_VERIFY_RETURN_INT_EXC(target_type, func_type, func_value)\ __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, 1) #define __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, exc)\ {\ func_type value = func_value;\ if (sizeof(target_type) < sizeof(func_type)) {\ if (unlikely(value != (func_type) (target_type) value)) {\ func_type zero = 0;\ if (exc && unlikely(value == (func_type)-1 && PyErr_Occurred()))\ return (target_type) -1;\ if (is_unsigned && unlikely(value < zero))\ goto raise_neg_overflow;\ else\ goto raise_overflow;\ }\ }\ return (target_type) value;\ } static CYTHON_INLINE long __Pyx_PyInt_As_long(PyObject *x) { const long neg_one = (long) -1, const_zero = (long) 0; const int is_unsigned = neg_one > const_zero; #if PY_MAJOR_VERSION < 3 if (likely(PyInt_Check(x))) { if (sizeof(long) < sizeof(long)) { __PYX_VERIFY_RETURN_INT(long, long, PyInt_AS_LONG(x)) } else { long val = PyInt_AS_LONG(x); if (is_unsigned && unlikely(val < 0)) { goto raise_neg_overflow; } return (long) val; } } else #endif if (likely(PyLong_Check(x))) { if (is_unsigned) { #if CYTHON_USE_PYLONG_INTERNALS const digit* digits = ((PyLongObject*)x)->ob_digit; switch (Py_SIZE(x)) { case 0: return (long) 0; case 1: __PYX_VERIFY_RETURN_INT(long, digit, digits[0]) case 2: if (8 * sizeof(long) > 1 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(long) >= 2 * PyLong_SHIFT) { return (long) (((((long)digits[1]) << PyLong_SHIFT) | (long)digits[0])); } } break; case 3: if (8 * sizeof(long) > 2 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(long) >= 3 * PyLong_SHIFT) { return (long) (((((((long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0])); } } break; case 4: if (8 * sizeof(long) > 3 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(long) >= 4 * PyLong_SHIFT) { return (long) (((((((((long)digits[3]) << PyLong_SHIFT) | (long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0])); } } break; } #endif #if CYTHON_COMPILING_IN_CPYTHON if (unlikely(Py_SIZE(x) < 0)) { goto raise_neg_overflow; } #else { int result = PyObject_RichCompareBool(x, Py_False, Py_LT); if (unlikely(result < 0)) return (long) -1; if (unlikely(result == 1)) goto raise_neg_overflow; } #endif if (sizeof(long) <= sizeof(unsigned long)) { __PYX_VERIFY_RETURN_INT_EXC(long, unsigned long, PyLong_AsUnsignedLong(x)) } else if (sizeof(long) <= sizeof(unsigned PY_LONG_LONG)) { __PYX_VERIFY_RETURN_INT_EXC(long, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x)) } } else { #if CYTHON_USE_PYLONG_INTERNALS const digit* digits = ((PyLongObject*)x)->ob_digit; switch (Py_SIZE(x)) { case 0: return (long) 0; case -1: __PYX_VERIFY_RETURN_INT(long, sdigit, -(sdigit) digits[0]) case 1: __PYX_VERIFY_RETURN_INT(long, digit, +digits[0]) case -2: if (8 * sizeof(long) - 1 > 1 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(long, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) { return (long) (((long)-1)*(((((long)digits[1]) << PyLong_SHIFT) | (long)digits[0]))); } } break; case 2: if (8 * sizeof(long) > 1 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) { return (long) ((((((long)digits[1]) << PyLong_SHIFT) | (long)digits[0]))); } } break; case -3: if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(long, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) { return (long) (((long)-1)*(((((((long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0]))); } } break; case 3: if (8 * sizeof(long) > 2 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) { return (long) ((((((((long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0]))); } } break; case -4: if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(long, long, -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(long) - 1 > 4 * PyLong_SHIFT) { return (long) (((long)-1)*(((((((((long)digits[3]) << PyLong_SHIFT) | (long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0]))); } } break; case 4: if (8 * sizeof(long) > 3 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(long) - 1 > 4 * PyLong_SHIFT) { return (long) ((((((((((long)digits[3]) << PyLong_SHIFT) | (long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0]))); } } break; } #endif if (sizeof(long) <= sizeof(long)) { __PYX_VERIFY_RETURN_INT_EXC(long, long, PyLong_AsLong(x)) } else if (sizeof(long) <= sizeof(PY_LONG_LONG)) { __PYX_VERIFY_RETURN_INT_EXC(long, PY_LONG_LONG, PyLong_AsLongLong(x)) } } { #if CYTHON_COMPILING_IN_PYPY && !defined(_PyLong_AsByteArray) PyErr_SetString(PyExc_RuntimeError, "_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers"); #else long val; PyObject *v = __Pyx_PyNumber_Int(x); #if PY_MAJOR_VERSION < 3 if (likely(v) && !PyLong_Check(v)) { PyObject *tmp = v; v = PyNumber_Long(tmp); Py_DECREF(tmp); } #endif if (likely(v)) { int one = 1; int is_little = (int)*(unsigned char *)&one; unsigned char *bytes = (unsigned char *)&val; int ret = _PyLong_AsByteArray((PyLongObject *)v, bytes, sizeof(val), is_little, !is_unsigned); Py_DECREF(v); if (likely(!ret)) return val; } #endif return (long) -1; } } else { long val; PyObject *tmp = __Pyx_PyNumber_Int(x); if (!tmp) return (long) -1; val = __Pyx_PyInt_As_long(tmp); Py_DECREF(tmp); return val; } raise_overflow: PyErr_SetString(PyExc_OverflowError, "value too large to convert to long"); return (long) -1; raise_neg_overflow: PyErr_SetString(PyExc_OverflowError, "can't convert negative value to long"); return (long) -1; } static CYTHON_INLINE int __Pyx_PyInt_As_int(PyObject *x) { const int neg_one = (int) -1, const_zero = (int) 0; const int is_unsigned = neg_one > const_zero; #if PY_MAJOR_VERSION < 3 if (likely(PyInt_Check(x))) { if (sizeof(int) < sizeof(long)) { __PYX_VERIFY_RETURN_INT(int, long, PyInt_AS_LONG(x)) } else { long val = PyInt_AS_LONG(x); if (is_unsigned && unlikely(val < 0)) { goto raise_neg_overflow; } return (int) val; } } else #endif if (likely(PyLong_Check(x))) { if (is_unsigned) { #if CYTHON_USE_PYLONG_INTERNALS const digit* digits = ((PyLongObject*)x)->ob_digit; switch (Py_SIZE(x)) { case 0: return (int) 0; case 1: __PYX_VERIFY_RETURN_INT(int, digit, digits[0]) case 2: if (8 * sizeof(int) > 1 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(int) >= 2 * PyLong_SHIFT) { return (int) (((((int)digits[1]) << PyLong_SHIFT) | (int)digits[0])); } } break; case 3: if (8 * sizeof(int) > 2 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(int) >= 3 * PyLong_SHIFT) { return (int) (((((((int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0])); } } break; case 4: if (8 * sizeof(int) > 3 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(int) >= 4 * PyLong_SHIFT) { return (int) (((((((((int)digits[3]) << PyLong_SHIFT) | (int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0])); } } break; } #endif #if CYTHON_COMPILING_IN_CPYTHON if (unlikely(Py_SIZE(x) < 0)) { goto raise_neg_overflow; } #else { int result = PyObject_RichCompareBool(x, Py_False, Py_LT); if (unlikely(result < 0)) return (int) -1; if (unlikely(result == 1)) goto raise_neg_overflow; } #endif if (sizeof(int) <= sizeof(unsigned long)) { __PYX_VERIFY_RETURN_INT_EXC(int, unsigned long, PyLong_AsUnsignedLong(x)) } else if (sizeof(int) <= sizeof(unsigned PY_LONG_LONG)) { __PYX_VERIFY_RETURN_INT_EXC(int, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x)) } } else { #if CYTHON_USE_PYLONG_INTERNALS const digit* digits = ((PyLongObject*)x)->ob_digit; switch (Py_SIZE(x)) { case 0: return (int) 0; case -1: __PYX_VERIFY_RETURN_INT(int, sdigit, -(sdigit) digits[0]) case 1: __PYX_VERIFY_RETURN_INT(int, digit, +digits[0]) case -2: if (8 * sizeof(int) - 1 > 1 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(int, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(int) - 1 > 2 * PyLong_SHIFT) { return (int) (((int)-1)*(((((int)digits[1]) << PyLong_SHIFT) | (int)digits[0]))); } } break; case 2: if (8 * sizeof(int) > 1 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(int) - 1 > 2 * PyLong_SHIFT) { return (int) ((((((int)digits[1]) << PyLong_SHIFT) | (int)digits[0]))); } } break; case -3: if (8 * sizeof(int) - 1 > 2 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(int, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(int) - 1 > 3 * PyLong_SHIFT) { return (int) (((int)-1)*(((((((int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0]))); } } break; case 3: if (8 * sizeof(int) > 2 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(int) - 1 > 3 * PyLong_SHIFT) { return (int) ((((((((int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0]))); } } break; case -4: if (8 * sizeof(int) - 1 > 3 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(int, long, -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(int) - 1 > 4 * PyLong_SHIFT) { return (int) (((int)-1)*(((((((((int)digits[3]) << PyLong_SHIFT) | (int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0]))); } } break; case 4: if (8 * sizeof(int) > 3 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(int) - 1 > 4 * PyLong_SHIFT) { return (int) ((((((((((int)digits[3]) << PyLong_SHIFT) | (int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0]))); } } break; } #endif if (sizeof(int) <= sizeof(long)) { __PYX_VERIFY_RETURN_INT_EXC(int, long, PyLong_AsLong(x)) } else if (sizeof(int) <= sizeof(PY_LONG_LONG)) { __PYX_VERIFY_RETURN_INT_EXC(int, PY_LONG_LONG, PyLong_AsLongLong(x)) } } { #if CYTHON_COMPILING_IN_PYPY && !defined(_PyLong_AsByteArray) PyErr_SetString(PyExc_RuntimeError, "_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers"); #else int val; PyObject *v = __Pyx_PyNumber_Int(x); #if PY_MAJOR_VERSION < 3 if (likely(v) && !PyLong_Check(v)) { PyObject *tmp = v; v = PyNumber_Long(tmp); Py_DECREF(tmp); } #endif if (likely(v)) { int one = 1; int is_little = (int)*(unsigned char *)&one; unsigned char *bytes = (unsigned char *)&val; int ret = _PyLong_AsByteArray((PyLongObject *)v, bytes, sizeof(val), is_little, !is_unsigned); Py_DECREF(v); if (likely(!ret)) return val; } #endif return (int) -1; } } else { int val; PyObject *tmp = __Pyx_PyNumber_Int(x); if (!tmp) return (int) -1; val = __Pyx_PyInt_As_int(tmp); Py_DECREF(tmp); return val; } raise_overflow: PyErr_SetString(PyExc_OverflowError, "value too large to convert to int"); return (int) -1; raise_neg_overflow: PyErr_SetString(PyExc_OverflowError, "can't convert negative value to int"); return (int) -1; } static int __Pyx_check_binary_version(void) { char ctversion[4], rtversion[4]; PyOS_snprintf(ctversion, 4, "%d.%d", PY_MAJOR_VERSION, PY_MINOR_VERSION); PyOS_snprintf(rtversion, 4, "%s", Py_GetVersion()); if (ctversion[0] != rtversion[0] || ctversion[2] != rtversion[2]) { char message[200]; PyOS_snprintf(message, sizeof(message), "compiletime version %s of module '%.100s' " "does not match runtime version %s", ctversion, __Pyx_MODULE_NAME, rtversion); return PyErr_WarnEx(NULL, message, 1); } return 0; } #ifndef __PYX_HAVE_RT_ImportModule #define __PYX_HAVE_RT_ImportModule static PyObject *__Pyx_ImportModule(const char *name) { PyObject *py_name = 0; PyObject *py_module = 0; py_name = __Pyx_PyIdentifier_FromString(name); if (!py_name) goto bad; py_module = PyImport_Import(py_name); Py_DECREF(py_name); return py_module; bad: Py_XDECREF(py_name); return 0; } #endif #ifndef __PYX_HAVE_RT_ImportType #define __PYX_HAVE_RT_ImportType static PyTypeObject *__Pyx_ImportType(const char *module_name, const char *class_name, size_t size, int strict) { PyObject *py_module = 0; PyObject *result = 0; PyObject *py_name = 0; char warning[200]; Py_ssize_t basicsize; #ifdef Py_LIMITED_API PyObject *py_basicsize; #endif py_module = __Pyx_ImportModule(module_name); if (!py_module) goto bad; py_name = __Pyx_PyIdentifier_FromString(class_name); if (!py_name) goto bad; result = PyObject_GetAttr(py_module, py_name); Py_DECREF(py_name); py_name = 0; Py_DECREF(py_module); py_module = 0; if (!result) goto bad; if (!PyType_Check(result)) { PyErr_Format(PyExc_TypeError, "%.200s.%.200s is not a type object", module_name, class_name); goto bad; } #ifndef Py_LIMITED_API basicsize = ((PyTypeObject *)result)->tp_basicsize; #else py_basicsize = PyObject_GetAttrString(result, "__basicsize__"); if (!py_basicsize) goto bad; basicsize = PyLong_AsSsize_t(py_basicsize); Py_DECREF(py_basicsize); py_basicsize = 0; if (basicsize == (Py_ssize_t)-1 && PyErr_Occurred()) goto bad; #endif if (!strict && (size_t)basicsize > size) { PyOS_snprintf(warning, sizeof(warning), "%s.%s size changed, may indicate binary incompatibility", module_name, class_name); if (PyErr_WarnEx(NULL, warning, 0) < 0) goto bad; } else if ((size_t)basicsize != size) { PyErr_Format(PyExc_ValueError, "%.200s.%.200s has the wrong size, try recompiling", module_name, class_name); goto bad; } return (PyTypeObject *)result; bad: Py_XDECREF(py_module); Py_XDECREF(result); return NULL; } #endif static int __Pyx_InitStrings(__Pyx_StringTabEntry *t) { while (t->p) { #if PY_MAJOR_VERSION < 3 if (t->is_unicode) { *t->p = PyUnicode_DecodeUTF8(t->s, t->n - 1, NULL); } else if (t->intern) { *t->p = PyString_InternFromString(t->s); } else { *t->p = PyString_FromStringAndSize(t->s, t->n - 1); } #else if (t->is_unicode | t->is_str) { if (t->intern) { *t->p = PyUnicode_InternFromString(t->s); } else if (t->encoding) { *t->p = PyUnicode_Decode(t->s, t->n - 1, t->encoding, NULL); } else { *t->p = PyUnicode_FromStringAndSize(t->s, t->n - 1); } } else { *t->p = PyBytes_FromStringAndSize(t->s, t->n - 1); } #endif if (!*t->p) return -1; ++t; } return 0; } static CYTHON_INLINE PyObject* __Pyx_PyUnicode_FromString(const char* c_str) { return __Pyx_PyUnicode_FromStringAndSize(c_str, (Py_ssize_t)strlen(c_str)); } static CYTHON_INLINE char* __Pyx_PyObject_AsString(PyObject* o) { Py_ssize_t ignore; return __Pyx_PyObject_AsStringAndSize(o, &ignore); } static CYTHON_INLINE char* __Pyx_PyObject_AsStringAndSize(PyObject* o, Py_ssize_t *length) { #if CYTHON_COMPILING_IN_CPYTHON && (__PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT) if ( #if PY_MAJOR_VERSION < 3 && __PYX_DEFAULT_STRING_ENCODING_IS_ASCII __Pyx_sys_getdefaultencoding_not_ascii && #endif PyUnicode_Check(o)) { #if PY_VERSION_HEX < 0x03030000 char* defenc_c; PyObject* defenc = _PyUnicode_AsDefaultEncodedString(o, NULL); if (!defenc) return NULL; defenc_c = PyBytes_AS_STRING(defenc); #if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII { char* end = defenc_c + PyBytes_GET_SIZE(defenc); char* c; for (c = defenc_c; c < end; c++) { if ((unsigned char) (*c) >= 128) { PyUnicode_AsASCIIString(o); return NULL; } } } #endif *length = PyBytes_GET_SIZE(defenc); return defenc_c; #else if (__Pyx_PyUnicode_READY(o) == -1) return NULL; #if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII if (PyUnicode_IS_ASCII(o)) { *length = PyUnicode_GET_LENGTH(o); return PyUnicode_AsUTF8(o); } else { PyUnicode_AsASCIIString(o); return NULL; } #else return PyUnicode_AsUTF8AndSize(o, length); #endif #endif } else #endif #if (!CYTHON_COMPILING_IN_PYPY) || (defined(PyByteArray_AS_STRING) && defined(PyByteArray_GET_SIZE)) if (PyByteArray_Check(o)) { *length = PyByteArray_GET_SIZE(o); return PyByteArray_AS_STRING(o); } else #endif { char* result; int r = PyBytes_AsStringAndSize(o, &result, length); if (unlikely(r < 0)) { return NULL; } else { return result; } } } static CYTHON_INLINE int __Pyx_PyObject_IsTrue(PyObject* x) { int is_true = x == Py_True; if (is_true | (x == Py_False) | (x == Py_None)) return is_true; else return PyObject_IsTrue(x); } static CYTHON_INLINE PyObject* __Pyx_PyNumber_Int(PyObject* x) { PyNumberMethods *m; const char *name = NULL; PyObject *res = NULL; #if PY_MAJOR_VERSION < 3 if (PyInt_Check(x) || PyLong_Check(x)) #else if (PyLong_Check(x)) #endif return __Pyx_NewRef(x); m = Py_TYPE(x)->tp_as_number; #if PY_MAJOR_VERSION < 3 if (m && m->nb_int) { name = "int"; res = PyNumber_Int(x); } else if (m && m->nb_long) { name = "long"; res = PyNumber_Long(x); } #else if (m && m->nb_int) { name = "int"; res = PyNumber_Long(x); } #endif if (res) { #if PY_MAJOR_VERSION < 3 if (!PyInt_Check(res) && !PyLong_Check(res)) { #else if (!PyLong_Check(res)) { #endif PyErr_Format(PyExc_TypeError, "__%.4s__ returned non-%.4s (type %.200s)", name, name, Py_TYPE(res)->tp_name); Py_DECREF(res); return NULL; } } else if (!PyErr_Occurred()) { PyErr_SetString(PyExc_TypeError, "an integer is required"); } return res; } static CYTHON_INLINE Py_ssize_t __Pyx_PyIndex_AsSsize_t(PyObject* b) { Py_ssize_t ival; PyObject *x; #if PY_MAJOR_VERSION < 3 if (likely(PyInt_CheckExact(b))) { if (sizeof(Py_ssize_t) >= sizeof(long)) return PyInt_AS_LONG(b); else return PyInt_AsSsize_t(x); } #endif if (likely(PyLong_CheckExact(b))) { #if CYTHON_USE_PYLONG_INTERNALS const digit* digits = ((PyLongObject*)b)->ob_digit; const Py_ssize_t size = Py_SIZE(b); if (likely(__Pyx_sst_abs(size) <= 1)) { ival = likely(size) ? digits[0] : 0; if (size == -1) ival = -ival; return ival; } else { switch (size) { case 2: if (8 * sizeof(Py_ssize_t) > 2 * PyLong_SHIFT) { return (Py_ssize_t) (((((size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])); } break; case -2: if (8 * sizeof(Py_ssize_t) > 2 * PyLong_SHIFT) { return -(Py_ssize_t) (((((size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])); } break; case 3: if (8 * sizeof(Py_ssize_t) > 3 * PyLong_SHIFT) { return (Py_ssize_t) (((((((size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])); } break; case -3: if (8 * sizeof(Py_ssize_t) > 3 * PyLong_SHIFT) { return -(Py_ssize_t) (((((((size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])); } break; case 4: if (8 * sizeof(Py_ssize_t) > 4 * PyLong_SHIFT) { return (Py_ssize_t) (((((((((size_t)digits[3]) << PyLong_SHIFT) | (size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])); } break; case -4: if (8 * sizeof(Py_ssize_t) > 4 * PyLong_SHIFT) { return -(Py_ssize_t) (((((((((size_t)digits[3]) << PyLong_SHIFT) | (size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])); } break; } } #endif return PyLong_AsSsize_t(b); } x = PyNumber_Index(b); if (!x) return -1; ival = PyInt_AsSsize_t(x); Py_DECREF(x); return ival; } static CYTHON_INLINE PyObject * __Pyx_PyInt_FromSize_t(size_t ival) { return PyInt_FromSize_t(ival); } #endif /* Py_PYTHON_H */ pygame_sdl2-2.1.0-for-renpy-6.99.14.1/gen3/pygame_sdl2.locals.c0000644000175000017500000134421613204610605022736 0ustar tomtom00000000000000/* Generated by Cython 0.24 */ #define PY_SSIZE_T_CLEAN #include "Python.h" #ifndef Py_PYTHON_H #error Python headers needed to compile C extensions, please install development version of Python. #elif PY_VERSION_HEX < 0x02060000 || (0x03000000 <= PY_VERSION_HEX && PY_VERSION_HEX < 0x03020000) #error Cython requires Python 2.6+ or Python 3.2+. #else #define CYTHON_ABI "0_24" #include #ifndef offsetof #define offsetof(type, member) ( (size_t) & ((type*)0) -> member ) #endif #if !defined(WIN32) && !defined(MS_WINDOWS) #ifndef __stdcall #define __stdcall #endif #ifndef __cdecl #define __cdecl #endif #ifndef __fastcall #define __fastcall #endif #endif #ifndef DL_IMPORT #define DL_IMPORT(t) t #endif #ifndef DL_EXPORT #define DL_EXPORT(t) t #endif #ifndef PY_LONG_LONG #define PY_LONG_LONG LONG_LONG #endif #ifndef Py_HUGE_VAL #define Py_HUGE_VAL HUGE_VAL #endif #ifdef PYPY_VERSION #define CYTHON_COMPILING_IN_PYPY 1 #define CYTHON_COMPILING_IN_CPYTHON 0 #else #define CYTHON_COMPILING_IN_PYPY 0 #define CYTHON_COMPILING_IN_CPYTHON 1 #endif #if !defined(CYTHON_USE_PYLONG_INTERNALS) && CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x02070000 #define CYTHON_USE_PYLONG_INTERNALS 1 #endif #if CYTHON_USE_PYLONG_INTERNALS #include "longintrepr.h" #undef SHIFT #undef BASE #undef MASK #endif #if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX < 0x02070600 && !defined(Py_OptimizeFlag) #define Py_OptimizeFlag 0 #endif #define __PYX_BUILD_PY_SSIZE_T "n" #define CYTHON_FORMAT_SSIZE_T "z" #if PY_MAJOR_VERSION < 3 #define __Pyx_BUILTIN_MODULE_NAME "__builtin__" #define __Pyx_PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)\ PyCode_New(a+k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos) #define __Pyx_DefaultClassType PyClass_Type #else #define __Pyx_BUILTIN_MODULE_NAME "builtins" #define __Pyx_PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)\ PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos) #define __Pyx_DefaultClassType PyType_Type #endif #ifndef Py_TPFLAGS_CHECKTYPES #define Py_TPFLAGS_CHECKTYPES 0 #endif #ifndef Py_TPFLAGS_HAVE_INDEX #define Py_TPFLAGS_HAVE_INDEX 0 #endif #ifndef Py_TPFLAGS_HAVE_NEWBUFFER #define Py_TPFLAGS_HAVE_NEWBUFFER 0 #endif #ifndef Py_TPFLAGS_HAVE_FINALIZE #define Py_TPFLAGS_HAVE_FINALIZE 0 #endif #if PY_VERSION_HEX > 0x03030000 && defined(PyUnicode_KIND) #define CYTHON_PEP393_ENABLED 1 #define __Pyx_PyUnicode_READY(op) (likely(PyUnicode_IS_READY(op)) ?\ 0 : _PyUnicode_Ready((PyObject *)(op))) #define __Pyx_PyUnicode_GET_LENGTH(u) PyUnicode_GET_LENGTH(u) #define __Pyx_PyUnicode_READ_CHAR(u, i) PyUnicode_READ_CHAR(u, i) #define __Pyx_PyUnicode_KIND(u) PyUnicode_KIND(u) #define __Pyx_PyUnicode_DATA(u) PyUnicode_DATA(u) #define __Pyx_PyUnicode_READ(k, d, i) PyUnicode_READ(k, d, i) #define __Pyx_PyUnicode_IS_TRUE(u) (0 != (likely(PyUnicode_IS_READY(u)) ? PyUnicode_GET_LENGTH(u) : PyUnicode_GET_SIZE(u))) #else #define CYTHON_PEP393_ENABLED 0 #define __Pyx_PyUnicode_READY(op) (0) #define __Pyx_PyUnicode_GET_LENGTH(u) PyUnicode_GET_SIZE(u) #define __Pyx_PyUnicode_READ_CHAR(u, i) ((Py_UCS4)(PyUnicode_AS_UNICODE(u)[i])) #define __Pyx_PyUnicode_KIND(u) (sizeof(Py_UNICODE)) #define __Pyx_PyUnicode_DATA(u) ((void*)PyUnicode_AS_UNICODE(u)) #define __Pyx_PyUnicode_READ(k, d, i) ((void)(k), (Py_UCS4)(((Py_UNICODE*)d)[i])) #define __Pyx_PyUnicode_IS_TRUE(u) (0 != PyUnicode_GET_SIZE(u)) #endif #if CYTHON_COMPILING_IN_PYPY #define __Pyx_PyUnicode_Concat(a, b) PyNumber_Add(a, b) #define __Pyx_PyUnicode_ConcatSafe(a, b) PyNumber_Add(a, b) #else #define __Pyx_PyUnicode_Concat(a, b) PyUnicode_Concat(a, b) #define __Pyx_PyUnicode_ConcatSafe(a, b) ((unlikely((a) == Py_None) || unlikely((b) == Py_None)) ?\ PyNumber_Add(a, b) : __Pyx_PyUnicode_Concat(a, b)) #endif #if CYTHON_COMPILING_IN_PYPY && !defined(PyUnicode_Contains) #define PyUnicode_Contains(u, s) PySequence_Contains(u, s) #endif #if CYTHON_COMPILING_IN_PYPY && !defined(PyObject_Format) #define PyObject_Format(obj, fmt) PyObject_CallMethod(obj, "__format__", "O", fmt) #endif #if CYTHON_COMPILING_IN_PYPY && !defined(PyObject_Malloc) #define PyObject_Malloc(s) PyMem_Malloc(s) #define PyObject_Free(p) PyMem_Free(p) #define PyObject_Realloc(p) PyMem_Realloc(p) #endif #define __Pyx_PyString_FormatSafe(a, b) ((unlikely((a) == Py_None)) ? PyNumber_Remainder(a, b) : __Pyx_PyString_Format(a, b)) #define __Pyx_PyUnicode_FormatSafe(a, b) ((unlikely((a) == Py_None)) ? PyNumber_Remainder(a, b) : PyUnicode_Format(a, b)) #if PY_MAJOR_VERSION >= 3 #define __Pyx_PyString_Format(a, b) PyUnicode_Format(a, b) #else #define __Pyx_PyString_Format(a, b) PyString_Format(a, b) #endif #if PY_MAJOR_VERSION < 3 && !defined(PyObject_ASCII) #define PyObject_ASCII(o) PyObject_Repr(o) #endif #if PY_MAJOR_VERSION >= 3 #define PyBaseString_Type PyUnicode_Type #define PyStringObject PyUnicodeObject #define PyString_Type PyUnicode_Type #define PyString_Check PyUnicode_Check #define PyString_CheckExact PyUnicode_CheckExact #endif #if PY_MAJOR_VERSION >= 3 #define __Pyx_PyBaseString_Check(obj) PyUnicode_Check(obj) #define __Pyx_PyBaseString_CheckExact(obj) PyUnicode_CheckExact(obj) #else #define __Pyx_PyBaseString_Check(obj) (PyString_Check(obj) || PyUnicode_Check(obj)) #define __Pyx_PyBaseString_CheckExact(obj) (PyString_CheckExact(obj) || PyUnicode_CheckExact(obj)) #endif #ifndef PySet_CheckExact #define PySet_CheckExact(obj) (Py_TYPE(obj) == &PySet_Type) #endif #define __Pyx_TypeCheck(obj, type) PyObject_TypeCheck(obj, (PyTypeObject *)type) #if PY_MAJOR_VERSION >= 3 #define PyIntObject PyLongObject #define PyInt_Type PyLong_Type #define PyInt_Check(op) PyLong_Check(op) #define PyInt_CheckExact(op) PyLong_CheckExact(op) #define PyInt_FromString PyLong_FromString #define PyInt_FromUnicode PyLong_FromUnicode #define PyInt_FromLong PyLong_FromLong #define PyInt_FromSize_t PyLong_FromSize_t #define PyInt_FromSsize_t PyLong_FromSsize_t #define PyInt_AsLong PyLong_AsLong #define PyInt_AS_LONG PyLong_AS_LONG #define PyInt_AsSsize_t PyLong_AsSsize_t #define PyInt_AsUnsignedLongMask PyLong_AsUnsignedLongMask #define PyInt_AsUnsignedLongLongMask PyLong_AsUnsignedLongLongMask #define PyNumber_Int PyNumber_Long #endif #if PY_MAJOR_VERSION >= 3 #define PyBoolObject PyLongObject #endif #if PY_MAJOR_VERSION >= 3 && CYTHON_COMPILING_IN_PYPY #ifndef PyUnicode_InternFromString #define PyUnicode_InternFromString(s) PyUnicode_FromString(s) #endif #endif #if PY_VERSION_HEX < 0x030200A4 typedef long Py_hash_t; #define __Pyx_PyInt_FromHash_t PyInt_FromLong #define __Pyx_PyInt_AsHash_t PyInt_AsLong #else #define __Pyx_PyInt_FromHash_t PyInt_FromSsize_t #define __Pyx_PyInt_AsHash_t PyInt_AsSsize_t #endif #if PY_MAJOR_VERSION >= 3 #define __Pyx_PyMethod_New(func, self, klass) ((self) ? PyMethod_New(func, self) : PyInstanceMethod_New(func)) #else #define __Pyx_PyMethod_New(func, self, klass) PyMethod_New(func, self, klass) #endif #if PY_VERSION_HEX >= 0x030500B1 #define __Pyx_PyAsyncMethodsStruct PyAsyncMethods #define __Pyx_PyType_AsAsync(obj) (Py_TYPE(obj)->tp_as_async) #elif CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3 typedef struct { unaryfunc am_await; unaryfunc am_aiter; unaryfunc am_anext; } __Pyx_PyAsyncMethodsStruct; #define __Pyx_PyType_AsAsync(obj) ((__Pyx_PyAsyncMethodsStruct*) (Py_TYPE(obj)->tp_reserved)) #else #define __Pyx_PyType_AsAsync(obj) NULL #endif #ifndef CYTHON_RESTRICT #if defined(__GNUC__) #define CYTHON_RESTRICT __restrict__ #elif defined(_MSC_VER) && _MSC_VER >= 1400 #define CYTHON_RESTRICT __restrict #elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L #define CYTHON_RESTRICT restrict #else #define CYTHON_RESTRICT #endif #endif #define __Pyx_void_to_None(void_result) ((void)(void_result), Py_INCREF(Py_None), Py_None) #ifndef CYTHON_INLINE #if defined(__GNUC__) #define CYTHON_INLINE __inline__ #elif defined(_MSC_VER) #define CYTHON_INLINE __inline #elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L #define CYTHON_INLINE inline #else #define CYTHON_INLINE #endif #endif #if defined(WIN32) || defined(MS_WINDOWS) #define _USE_MATH_DEFINES #endif #include #ifdef NAN #define __PYX_NAN() ((float) NAN) #else static CYTHON_INLINE float __PYX_NAN() { float value; memset(&value, 0xFF, sizeof(value)); return value; } #endif #define __PYX_ERR(f_index, lineno, Ln_error) \ { \ __pyx_filename = __pyx_f[f_index]; __pyx_lineno = lineno; __pyx_clineno = __LINE__; goto Ln_error; \ } #if PY_MAJOR_VERSION >= 3 #define __Pyx_PyNumber_Divide(x,y) PyNumber_TrueDivide(x,y) #define __Pyx_PyNumber_InPlaceDivide(x,y) PyNumber_InPlaceTrueDivide(x,y) #else #define __Pyx_PyNumber_Divide(x,y) PyNumber_TrueDivide(x,y) #define __Pyx_PyNumber_InPlaceDivide(x,y) PyNumber_InPlaceTrueDivide(x,y) #endif #ifndef __PYX_EXTERN_C #ifdef __cplusplus #define __PYX_EXTERN_C extern "C" #else #define __PYX_EXTERN_C extern #endif #endif #define __PYX_HAVE__pygame_sdl2__locals #define __PYX_HAVE_API__pygame_sdl2__locals #include "stdint.h" #include "string.h" #include "stdio.h" #include "stddef.h" #include "SDL.h" #ifdef _OPENMP #include #endif /* _OPENMP */ #ifdef PYREX_WITHOUT_ASSERTIONS #define CYTHON_WITHOUT_ASSERTIONS #endif #ifndef CYTHON_UNUSED # if defined(__GNUC__) # if !(defined(__cplusplus)) || (__GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 4)) # define CYTHON_UNUSED __attribute__ ((__unused__)) # else # define CYTHON_UNUSED # endif # elif defined(__ICC) || (defined(__INTEL_COMPILER) && !defined(_MSC_VER)) # define CYTHON_UNUSED __attribute__ ((__unused__)) # else # define CYTHON_UNUSED # endif #endif #ifndef CYTHON_NCP_UNUSED # if CYTHON_COMPILING_IN_CPYTHON # define CYTHON_NCP_UNUSED # else # define CYTHON_NCP_UNUSED CYTHON_UNUSED # endif #endif typedef struct {PyObject **p; const char *s; const Py_ssize_t n; const char* encoding; const char is_unicode; const char is_str; const char intern; } __Pyx_StringTabEntry; #define __PYX_DEFAULT_STRING_ENCODING_IS_ASCII 0 #define __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT 0 #define __PYX_DEFAULT_STRING_ENCODING "" #define __Pyx_PyObject_FromString __Pyx_PyBytes_FromString #define __Pyx_PyObject_FromStringAndSize __Pyx_PyBytes_FromStringAndSize #define __Pyx_uchar_cast(c) ((unsigned char)c) #define __Pyx_long_cast(x) ((long)x) #define __Pyx_fits_Py_ssize_t(v, type, is_signed) (\ (sizeof(type) < sizeof(Py_ssize_t)) ||\ (sizeof(type) > sizeof(Py_ssize_t) &&\ likely(v < (type)PY_SSIZE_T_MAX ||\ v == (type)PY_SSIZE_T_MAX) &&\ (!is_signed || likely(v > (type)PY_SSIZE_T_MIN ||\ v == (type)PY_SSIZE_T_MIN))) ||\ (sizeof(type) == sizeof(Py_ssize_t) &&\ (is_signed || likely(v < (type)PY_SSIZE_T_MAX ||\ v == (type)PY_SSIZE_T_MAX))) ) #if defined (__cplusplus) && __cplusplus >= 201103L #include #define __Pyx_sst_abs(value) std::abs(value) #elif SIZEOF_INT >= SIZEOF_SIZE_T #define __Pyx_sst_abs(value) abs(value) #elif SIZEOF_LONG >= SIZEOF_SIZE_T #define __Pyx_sst_abs(value) labs(value) #elif defined (_MSC_VER) && defined (_M_X64) #define __Pyx_sst_abs(value) _abs64(value) #elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L #define __Pyx_sst_abs(value) llabs(value) #elif defined (__GNUC__) #define __Pyx_sst_abs(value) __builtin_llabs(value) #else #define __Pyx_sst_abs(value) ((value<0) ? -value : value) #endif static CYTHON_INLINE char* __Pyx_PyObject_AsString(PyObject*); static CYTHON_INLINE char* __Pyx_PyObject_AsStringAndSize(PyObject*, Py_ssize_t* length); #define __Pyx_PyByteArray_FromString(s) PyByteArray_FromStringAndSize((const char*)s, strlen((const char*)s)) #define __Pyx_PyByteArray_FromStringAndSize(s, l) PyByteArray_FromStringAndSize((const char*)s, l) #define __Pyx_PyBytes_FromString PyBytes_FromString #define __Pyx_PyBytes_FromStringAndSize PyBytes_FromStringAndSize static CYTHON_INLINE PyObject* __Pyx_PyUnicode_FromString(const char*); #if PY_MAJOR_VERSION < 3 #define __Pyx_PyStr_FromString __Pyx_PyBytes_FromString #define __Pyx_PyStr_FromStringAndSize __Pyx_PyBytes_FromStringAndSize #else #define __Pyx_PyStr_FromString __Pyx_PyUnicode_FromString #define __Pyx_PyStr_FromStringAndSize __Pyx_PyUnicode_FromStringAndSize #endif #define __Pyx_PyObject_AsSString(s) ((signed char*) __Pyx_PyObject_AsString(s)) #define __Pyx_PyObject_AsUString(s) ((unsigned char*) __Pyx_PyObject_AsString(s)) #define __Pyx_PyObject_FromCString(s) __Pyx_PyObject_FromString((const char*)s) #define __Pyx_PyBytes_FromCString(s) __Pyx_PyBytes_FromString((const char*)s) #define __Pyx_PyByteArray_FromCString(s) __Pyx_PyByteArray_FromString((const char*)s) #define __Pyx_PyStr_FromCString(s) __Pyx_PyStr_FromString((const char*)s) #define __Pyx_PyUnicode_FromCString(s) __Pyx_PyUnicode_FromString((const char*)s) #if PY_MAJOR_VERSION < 3 static CYTHON_INLINE size_t __Pyx_Py_UNICODE_strlen(const Py_UNICODE *u) { const Py_UNICODE *u_end = u; while (*u_end++) ; return (size_t)(u_end - u - 1); } #else #define __Pyx_Py_UNICODE_strlen Py_UNICODE_strlen #endif #define __Pyx_PyUnicode_FromUnicode(u) PyUnicode_FromUnicode(u, __Pyx_Py_UNICODE_strlen(u)) #define __Pyx_PyUnicode_FromUnicodeAndLength PyUnicode_FromUnicode #define __Pyx_PyUnicode_AsUnicode PyUnicode_AsUnicode #define __Pyx_NewRef(obj) (Py_INCREF(obj), obj) #define __Pyx_Owned_Py_None(b) __Pyx_NewRef(Py_None) #define __Pyx_PyBool_FromLong(b) ((b) ? __Pyx_NewRef(Py_True) : __Pyx_NewRef(Py_False)) static CYTHON_INLINE int __Pyx_PyObject_IsTrue(PyObject*); static CYTHON_INLINE PyObject* __Pyx_PyNumber_IntOrLong(PyObject* x); static CYTHON_INLINE Py_ssize_t __Pyx_PyIndex_AsSsize_t(PyObject*); static CYTHON_INLINE PyObject * __Pyx_PyInt_FromSize_t(size_t); #if CYTHON_COMPILING_IN_CPYTHON #define __pyx_PyFloat_AsDouble(x) (PyFloat_CheckExact(x) ? PyFloat_AS_DOUBLE(x) : PyFloat_AsDouble(x)) #else #define __pyx_PyFloat_AsDouble(x) PyFloat_AsDouble(x) #endif #define __pyx_PyFloat_AsFloat(x) ((float) __pyx_PyFloat_AsDouble(x)) #if PY_MAJOR_VERSION >= 3 #define __Pyx_PyNumber_Int(x) (PyLong_CheckExact(x) ? __Pyx_NewRef(x) : PyNumber_Long(x)) #else #define __Pyx_PyNumber_Int(x) (PyInt_CheckExact(x) ? __Pyx_NewRef(x) : PyNumber_Int(x)) #endif #define __Pyx_PyNumber_Float(x) (PyFloat_CheckExact(x) ? __Pyx_NewRef(x) : PyNumber_Float(x)) #if PY_MAJOR_VERSION < 3 && __PYX_DEFAULT_STRING_ENCODING_IS_ASCII static int __Pyx_sys_getdefaultencoding_not_ascii; static int __Pyx_init_sys_getdefaultencoding_params(void) { PyObject* sys; PyObject* default_encoding = NULL; PyObject* ascii_chars_u = NULL; PyObject* ascii_chars_b = NULL; const char* default_encoding_c; sys = PyImport_ImportModule("sys"); if (!sys) goto bad; default_encoding = PyObject_CallMethod(sys, (char*) "getdefaultencoding", NULL); Py_DECREF(sys); if (!default_encoding) goto bad; default_encoding_c = PyBytes_AsString(default_encoding); if (!default_encoding_c) goto bad; if (strcmp(default_encoding_c, "ascii") == 0) { __Pyx_sys_getdefaultencoding_not_ascii = 0; } else { char ascii_chars[128]; int c; for (c = 0; c < 128; c++) { ascii_chars[c] = c; } __Pyx_sys_getdefaultencoding_not_ascii = 1; ascii_chars_u = PyUnicode_DecodeASCII(ascii_chars, 128, NULL); if (!ascii_chars_u) goto bad; ascii_chars_b = PyUnicode_AsEncodedString(ascii_chars_u, default_encoding_c, NULL); if (!ascii_chars_b || !PyBytes_Check(ascii_chars_b) || memcmp(ascii_chars, PyBytes_AS_STRING(ascii_chars_b), 128) != 0) { PyErr_Format( PyExc_ValueError, "This module compiled with c_string_encoding=ascii, but default encoding '%.200s' is not a superset of ascii.", default_encoding_c); goto bad; } Py_DECREF(ascii_chars_u); Py_DECREF(ascii_chars_b); } Py_DECREF(default_encoding); return 0; bad: Py_XDECREF(default_encoding); Py_XDECREF(ascii_chars_u); Py_XDECREF(ascii_chars_b); return -1; } #endif #if __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT && PY_MAJOR_VERSION >= 3 #define __Pyx_PyUnicode_FromStringAndSize(c_str, size) PyUnicode_DecodeUTF8(c_str, size, NULL) #else #define __Pyx_PyUnicode_FromStringAndSize(c_str, size) PyUnicode_Decode(c_str, size, __PYX_DEFAULT_STRING_ENCODING, NULL) #if __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT static char* __PYX_DEFAULT_STRING_ENCODING; static int __Pyx_init_sys_getdefaultencoding_params(void) { PyObject* sys; PyObject* default_encoding = NULL; char* default_encoding_c; sys = PyImport_ImportModule("sys"); if (!sys) goto bad; default_encoding = PyObject_CallMethod(sys, (char*) (const char*) "getdefaultencoding", NULL); Py_DECREF(sys); if (!default_encoding) goto bad; default_encoding_c = PyBytes_AsString(default_encoding); if (!default_encoding_c) goto bad; __PYX_DEFAULT_STRING_ENCODING = (char*) malloc(strlen(default_encoding_c)); if (!__PYX_DEFAULT_STRING_ENCODING) goto bad; strcpy(__PYX_DEFAULT_STRING_ENCODING, default_encoding_c); Py_DECREF(default_encoding); return 0; bad: Py_XDECREF(default_encoding); return -1; } #endif #endif /* Test for GCC > 2.95 */ #if defined(__GNUC__) && (__GNUC__ > 2 || (__GNUC__ == 2 && (__GNUC_MINOR__ > 95))) #define likely(x) __builtin_expect(!!(x), 1) #define unlikely(x) __builtin_expect(!!(x), 0) #else /* !__GNUC__ or GCC < 2.95 */ #define likely(x) (x) #define unlikely(x) (x) #endif /* __GNUC__ */ static PyObject *__pyx_m; static PyObject *__pyx_d; static PyObject *__pyx_b; static PyObject *__pyx_empty_tuple; static PyObject *__pyx_empty_bytes; static PyObject *__pyx_empty_unicode; static int __pyx_lineno; static int __pyx_clineno = 0; static const char * __pyx_cfilenm= __FILE__; static const char *__pyx_filename; static const char *__pyx_f[] = { "src/pygame_sdl2/locals.pyx", "include/event_list.pxi", "include/keycode_list.pxi", "include/glattr.pxi", "include/controller.pxi", }; /*--- Type declarations ---*/ /* --- Runtime support code (head) --- */ /* Refnanny.proto */ #ifndef CYTHON_REFNANNY #define CYTHON_REFNANNY 0 #endif #if CYTHON_REFNANNY typedef struct { void (*INCREF)(void*, PyObject*, int); void (*DECREF)(void*, PyObject*, int); void (*GOTREF)(void*, PyObject*, int); void (*GIVEREF)(void*, PyObject*, int); void* (*SetupContext)(const char*, int, const char*); void (*FinishContext)(void**); } __Pyx_RefNannyAPIStruct; static __Pyx_RefNannyAPIStruct *__Pyx_RefNanny = NULL; static __Pyx_RefNannyAPIStruct *__Pyx_RefNannyImportAPI(const char *modname); #define __Pyx_RefNannyDeclarations void *__pyx_refnanny = NULL; #ifdef WITH_THREAD #define __Pyx_RefNannySetupContext(name, acquire_gil)\ if (acquire_gil) {\ PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure();\ __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), __LINE__, __FILE__);\ PyGILState_Release(__pyx_gilstate_save);\ } else {\ __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), __LINE__, __FILE__);\ } #else #define __Pyx_RefNannySetupContext(name, acquire_gil)\ __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), __LINE__, __FILE__) #endif #define __Pyx_RefNannyFinishContext()\ __Pyx_RefNanny->FinishContext(&__pyx_refnanny) #define __Pyx_INCREF(r) __Pyx_RefNanny->INCREF(__pyx_refnanny, (PyObject *)(r), __LINE__) #define __Pyx_DECREF(r) __Pyx_RefNanny->DECREF(__pyx_refnanny, (PyObject *)(r), __LINE__) #define __Pyx_GOTREF(r) __Pyx_RefNanny->GOTREF(__pyx_refnanny, (PyObject *)(r), __LINE__) #define __Pyx_GIVEREF(r) __Pyx_RefNanny->GIVEREF(__pyx_refnanny, (PyObject *)(r), __LINE__) #define __Pyx_XINCREF(r) do { if((r) != NULL) {__Pyx_INCREF(r); }} while(0) #define __Pyx_XDECREF(r) do { if((r) != NULL) {__Pyx_DECREF(r); }} while(0) #define __Pyx_XGOTREF(r) do { if((r) != NULL) {__Pyx_GOTREF(r); }} while(0) #define __Pyx_XGIVEREF(r) do { if((r) != NULL) {__Pyx_GIVEREF(r);}} while(0) #else #define __Pyx_RefNannyDeclarations #define __Pyx_RefNannySetupContext(name, acquire_gil) #define __Pyx_RefNannyFinishContext() #define __Pyx_INCREF(r) Py_INCREF(r) #define __Pyx_DECREF(r) Py_DECREF(r) #define __Pyx_GOTREF(r) #define __Pyx_GIVEREF(r) #define __Pyx_XINCREF(r) Py_XINCREF(r) #define __Pyx_XDECREF(r) Py_XDECREF(r) #define __Pyx_XGOTREF(r) #define __Pyx_XGIVEREF(r) #endif #define __Pyx_XDECREF_SET(r, v) do {\ PyObject *tmp = (PyObject *) r;\ r = v; __Pyx_XDECREF(tmp);\ } while (0) #define __Pyx_DECREF_SET(r, v) do {\ PyObject *tmp = (PyObject *) r;\ r = v; __Pyx_DECREF(tmp);\ } while (0) #define __Pyx_CLEAR(r) do { PyObject* tmp = ((PyObject*)(r)); r = NULL; __Pyx_DECREF(tmp);} while(0) #define __Pyx_XCLEAR(r) do { if((r) != NULL) {PyObject* tmp = ((PyObject*)(r)); r = NULL; __Pyx_DECREF(tmp);}} while(0) /* PyObjectGetAttrStr.proto */ #if CYTHON_COMPILING_IN_CPYTHON static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStr(PyObject* obj, PyObject* attr_name) { PyTypeObject* tp = Py_TYPE(obj); if (likely(tp->tp_getattro)) return tp->tp_getattro(obj, attr_name); #if PY_MAJOR_VERSION < 3 if (likely(tp->tp_getattr)) return tp->tp_getattr(obj, PyString_AS_STRING(attr_name)); #endif return PyObject_GetAttr(obj, attr_name); } #else #define __Pyx_PyObject_GetAttrStr(o,n) PyObject_GetAttr(o,n) #endif /* Import.proto */ static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list, int level); /* ImportFrom.proto */ static PyObject* __Pyx_ImportFrom(PyObject* module, PyObject* name); /* GetAttr.proto */ static CYTHON_INLINE PyObject *__Pyx_GetAttr(PyObject *, PyObject *); /* Globals.proto */ static PyObject* __Pyx_Globals(void); /* PyObjectCall.proto */ #if CYTHON_COMPILING_IN_CPYTHON static CYTHON_INLINE PyObject* __Pyx_PyObject_Call(PyObject *func, PyObject *arg, PyObject *kw); #else #define __Pyx_PyObject_Call(func, arg, kw) PyObject_Call(func, arg, kw) #endif /* PyObjectCallMethO.proto */ #if CYTHON_COMPILING_IN_CPYTHON static CYTHON_INLINE PyObject* __Pyx_PyObject_CallMethO(PyObject *func, PyObject *arg); #endif /* PyObjectCallOneArg.proto */ static CYTHON_INLINE PyObject* __Pyx_PyObject_CallOneArg(PyObject *func, PyObject *arg); /* CodeObjectCache.proto */ typedef struct { PyCodeObject* code_object; int code_line; } __Pyx_CodeObjectCacheEntry; struct __Pyx_CodeObjectCache { int count; int max_count; __Pyx_CodeObjectCacheEntry* entries; }; static struct __Pyx_CodeObjectCache __pyx_code_cache = {0,0,NULL}; static int __pyx_bisect_code_objects(__Pyx_CodeObjectCacheEntry* entries, int count, int code_line); static PyCodeObject *__pyx_find_code_object(int code_line); static void __pyx_insert_code_object(int code_line, PyCodeObject* code_object); /* AddTraceback.proto */ static void __Pyx_AddTraceback(const char *funcname, int c_line, int py_line, const char *filename); /* CIntToPy.proto */ static CYTHON_INLINE PyObject* __Pyx_PyInt_From_SDL_EventType(SDL_EventType value); /* CIntToPy.proto */ static CYTHON_INLINE PyObject* __Pyx_PyInt_From_long(long value); /* CIntToPy.proto */ static CYTHON_INLINE PyObject* __Pyx_PyInt_From_int(int value); /* CIntToPy.proto */ static CYTHON_INLINE PyObject* __Pyx_PyInt_From_SDL_GLattr(SDL_GLattr value); /* CIntToPy.proto */ static CYTHON_INLINE PyObject* __Pyx_PyInt_From_SDL_WindowFlags(SDL_WindowFlags value); /* CIntToPy.proto */ static CYTHON_INLINE PyObject* __Pyx_PyInt_From_SDL_Keymod(SDL_Keymod value); /* CIntToPy.proto */ static CYTHON_INLINE PyObject* __Pyx_PyInt_From_SDL_GameControllerButton(SDL_GameControllerButton value); /* CIntToPy.proto */ static CYTHON_INLINE PyObject* __Pyx_PyInt_From_SDL_GameControllerAxis(SDL_GameControllerAxis value); /* CIntToPy.proto */ static CYTHON_INLINE PyObject* __Pyx_PyInt_From_SDL_PowerState(SDL_PowerState value); /* CIntFromPy.proto */ static CYTHON_INLINE long __Pyx_PyInt_As_long(PyObject *); /* CIntFromPy.proto */ static CYTHON_INLINE int __Pyx_PyInt_As_int(PyObject *); /* CheckBinaryVersion.proto */ static int __Pyx_check_binary_version(void); /* InitStrings.proto */ static int __Pyx_InitStrings(__Pyx_StringTabEntry *t); /* Module declarations from 'libc.stdint' */ /* Module declarations from 'libc.string' */ /* Module declarations from 'libc.stdio' */ /* Module declarations from 'libc.stddef' */ /* Module declarations from 'sdl2' */ /* Module declarations from 'pygame_sdl2.locals' */ #define __Pyx_MODULE_NAME "pygame_sdl2.locals" int __pyx_module_is_main_pygame_sdl2__locals = 0; /* Implementation of 'pygame_sdl2.locals' */ static const char __pyx_k_K_0[] = "K_0"; static const char __pyx_k_K_1[] = "K_1"; static const char __pyx_k_K_2[] = "K_2"; static const char __pyx_k_K_3[] = "K_3"; static const char __pyx_k_K_4[] = "K_4"; static const char __pyx_k_K_5[] = "K_5"; static const char __pyx_k_K_6[] = "K_6"; static const char __pyx_k_K_7[] = "K_7"; static const char __pyx_k_K_8[] = "K_8"; static const char __pyx_k_K_9[] = "K_9"; static const char __pyx_k_K_a[] = "K_a"; static const char __pyx_k_K_b[] = "K_b"; static const char __pyx_k_K_c[] = "K_c"; static const char __pyx_k_K_d[] = "K_d"; static const char __pyx_k_K_e[] = "K_e"; static const char __pyx_k_K_f[] = "K_f"; static const char __pyx_k_K_g[] = "K_g"; static const char __pyx_k_K_h[] = "K_h"; static const char __pyx_k_K_i[] = "K_i"; static const char __pyx_k_K_j[] = "K_j"; static const char __pyx_k_K_k[] = "K_k"; static const char __pyx_k_K_l[] = "K_l"; static const char __pyx_k_K_m[] = "K_m"; static const char __pyx_k_K_n[] = "K_n"; static const char __pyx_k_K_o[] = "K_o"; static const char __pyx_k_K_p[] = "K_p"; static const char __pyx_k_K_q[] = "K_q"; static const char __pyx_k_K_r[] = "K_r"; static const char __pyx_k_K_s[] = "K_s"; static const char __pyx_k_K_t[] = "K_t"; static const char __pyx_k_K_u[] = "K_u"; static const char __pyx_k_K_v[] = "K_v"; static const char __pyx_k_K_w[] = "K_w"; static const char __pyx_k_K_x[] = "K_x"; static const char __pyx_k_K_y[] = "K_y"; static const char __pyx_k_K_z[] = "K_z"; static const char __pyx_k_K_AT[] = "K_AT"; static const char __pyx_k_K_F1[] = "K_F1"; static const char __pyx_k_K_F2[] = "K_F2"; static const char __pyx_k_K_F3[] = "K_F3"; static const char __pyx_k_K_F4[] = "K_F4"; static const char __pyx_k_K_F5[] = "K_F5"; static const char __pyx_k_K_F6[] = "K_F6"; static const char __pyx_k_K_F7[] = "K_F7"; static const char __pyx_k_K_F8[] = "K_F8"; static const char __pyx_k_K_F9[] = "K_F9"; static const char __pyx_k_K_UP[] = "K_UP"; static const char __pyx_k_QUIT[] = "QUIT"; static const char __pyx_k_Rect[] = "Rect"; static const char __pyx_k_main[] = "__main__"; static const char __pyx_k_test[] = "__test__"; static const char __pyx_k_Color[] = "Color"; static const char __pyx_k_KEYUP[] = "KEYUP"; static const char __pyx_k_K_CUT[] = "K_CUT"; static const char __pyx_k_K_END[] = "K_END"; static const char __pyx_k_K_F10[] = "K_F10"; static const char __pyx_k_K_F11[] = "K_F11"; static const char __pyx_k_K_F12[] = "K_F12"; static const char __pyx_k_K_F13[] = "K_F13"; static const char __pyx_k_K_F14[] = "K_F14"; static const char __pyx_k_K_F15[] = "K_F15"; static const char __pyx_k_K_F16[] = "K_F16"; static const char __pyx_k_K_F17[] = "K_F17"; static const char __pyx_k_K_F18[] = "K_F18"; static const char __pyx_k_K_F19[] = "K_F19"; static const char __pyx_k_K_F20[] = "K_F20"; static const char __pyx_k_K_F21[] = "K_F21"; static const char __pyx_k_K_F22[] = "K_F22"; static const char __pyx_k_K_F23[] = "K_F23"; static const char __pyx_k_K_F24[] = "K_F24"; static const char __pyx_k_K_KP0[] = "K_KP0"; static const char __pyx_k_K_KP1[] = "K_KP1"; static const char __pyx_k_K_KP2[] = "K_KP2"; static const char __pyx_k_K_KP3[] = "K_KP3"; static const char __pyx_k_K_KP4[] = "K_KP4"; static const char __pyx_k_K_KP5[] = "K_KP5"; static const char __pyx_k_K_KP6[] = "K_KP6"; static const char __pyx_k_K_KP7[] = "K_KP7"; static const char __pyx_k_K_KP8[] = "K_KP8"; static const char __pyx_k_K_KP9[] = "K_KP9"; static const char __pyx_k_K_OUT[] = "K_OUT"; static const char __pyx_k_K_TAB[] = "K_TAB"; static const char __pyx_k_K_WWW[] = "K_WWW"; static const char __pyx_k_K_COPY[] = "K_COPY"; static const char __pyx_k_K_DOWN[] = "K_DOWN"; static const char __pyx_k_K_EURO[] = "K_EURO"; static const char __pyx_k_K_FIND[] = "K_FIND"; static const char __pyx_k_K_HASH[] = "K_HASH"; static const char __pyx_k_K_HELP[] = "K_HELP"; static const char __pyx_k_K_HOME[] = "K_HOME"; static const char __pyx_k_K_KP_0[] = "K_KP_0"; static const char __pyx_k_K_KP_1[] = "K_KP_1"; static const char __pyx_k_K_KP_2[] = "K_KP_2"; static const char __pyx_k_K_KP_3[] = "K_KP_3"; static const char __pyx_k_K_KP_4[] = "K_KP_4"; static const char __pyx_k_K_KP_5[] = "K_KP_5"; static const char __pyx_k_K_KP_6[] = "K_KP_6"; static const char __pyx_k_K_KP_7[] = "K_KP_7"; static const char __pyx_k_K_KP_8[] = "K_KP_8"; static const char __pyx_k_K_KP_9[] = "K_KP_9"; static const char __pyx_k_K_KP_A[] = "K_KP_A"; static const char __pyx_k_K_KP_B[] = "K_KP_B"; static const char __pyx_k_K_KP_C[] = "K_KP_C"; static const char __pyx_k_K_KP_D[] = "K_KP_D"; static const char __pyx_k_K_KP_E[] = "K_KP_E"; static const char __pyx_k_K_KP_F[] = "K_KP_F"; static const char __pyx_k_K_LALT[] = "K_LALT"; static const char __pyx_k_K_LAST[] = "K_LAST"; static const char __pyx_k_K_LEFT[] = "K_LEFT"; static const char __pyx_k_K_LESS[] = "K_LESS"; static const char __pyx_k_K_LGUI[] = "K_LGUI"; static const char __pyx_k_K_MAIL[] = "K_MAIL"; static const char __pyx_k_K_MENU[] = "K_MENU"; static const char __pyx_k_K_MODE[] = "K_MODE"; static const char __pyx_k_K_MUTE[] = "K_MUTE"; static const char __pyx_k_K_OPER[] = "K_OPER"; static const char __pyx_k_K_PLUS[] = "K_PLUS"; static const char __pyx_k_K_RALT[] = "K_RALT"; static const char __pyx_k_K_RGUI[] = "K_RGUI"; static const char __pyx_k_K_STOP[] = "K_STOP"; static const char __pyx_k_K_UNDO[] = "K_UNDO"; static const char __pyx_k_OPENGL[] = "OPENGL"; static const char __pyx_k_import[] = "__import__"; static const char __pyx_k_update[] = "update"; static const char __pyx_k_KEYDOWN[] = "KEYDOWN"; static const char __pyx_k_K_AGAIN[] = "K_AGAIN"; static const char __pyx_k_K_BREAK[] = "K_BREAK"; static const char __pyx_k_K_CARET[] = "K_CARET"; static const char __pyx_k_K_CLEAR[] = "K_CLEAR"; static const char __pyx_k_K_COLON[] = "K_COLON"; static const char __pyx_k_K_COMMA[] = "K_COMMA"; static const char __pyx_k_K_CRSEL[] = "K_CRSEL"; static const char __pyx_k_K_EJECT[] = "K_EJECT"; static const char __pyx_k_K_EXSEL[] = "K_EXSEL"; static const char __pyx_k_K_FIRST[] = "K_FIRST"; static const char __pyx_k_K_KP_00[] = "K_KP_00"; static const char __pyx_k_K_KP_AT[] = "K_KP_AT"; static const char __pyx_k_K_LCTRL[] = "K_LCTRL"; static const char __pyx_k_K_LMETA[] = "K_LMETA"; static const char __pyx_k_K_MINUS[] = "K_MINUS"; static const char __pyx_k_K_PASTE[] = "K_PASTE"; static const char __pyx_k_K_PAUSE[] = "K_PAUSE"; static const char __pyx_k_K_POWER[] = "K_POWER"; static const char __pyx_k_K_PRINT[] = "K_PRINT"; static const char __pyx_k_K_PRIOR[] = "K_PRIOR"; static const char __pyx_k_K_QUOTE[] = "K_QUOTE"; static const char __pyx_k_K_RCTRL[] = "K_RCTRL"; static const char __pyx_k_K_RIGHT[] = "K_RIGHT"; static const char __pyx_k_K_RMETA[] = "K_RMETA"; static const char __pyx_k_K_SLASH[] = "K_SLASH"; static const char __pyx_k_K_SLEEP[] = "K_SLEEP"; static const char __pyx_k_K_SPACE[] = "K_SPACE"; static const char __pyx_k_NOEVENT[] = "NOEVENT"; static const char __pyx_k_NOFRAME[] = "NOFRAME"; static const char __pyx_k_DROPFILE[] = "DROPFILE"; static const char __pyx_k_FINGERUP[] = "FINGERUP"; static const char __pyx_k_KMOD_ALT[] = "KMOD_ALT"; static const char __pyx_k_KMOD_GUI[] = "KMOD_GUI"; static const char __pyx_k_KMOD_NUM[] = "KMOD_NUM"; static const char __pyx_k_K_CANCEL[] = "K_CANCEL"; static const char __pyx_k_K_DELETE[] = "K_DELETE"; static const char __pyx_k_K_DOLLAR[] = "K_DOLLAR"; static const char __pyx_k_K_EQUALS[] = "K_EQUALS"; static const char __pyx_k_K_ESCAPE[] = "K_ESCAPE"; static const char __pyx_k_K_INSERT[] = "K_INSERT"; static const char __pyx_k_K_KP_000[] = "K_KP_000"; static const char __pyx_k_K_KP_TAB[] = "K_KP_TAB"; static const char __pyx_k_K_KP_XOR[] = "K_KP_XOR"; static const char __pyx_k_K_LSHIFT[] = "K_LSHIFT"; static const char __pyx_k_K_LSUPER[] = "K_LSUPER"; static const char __pyx_k_K_PAGEUP[] = "K_PAGEUP"; static const char __pyx_k_K_PERIOD[] = "K_PERIOD"; static const char __pyx_k_K_RETURN[] = "K_RETURN"; static const char __pyx_k_K_RSHIFT[] = "K_RSHIFT"; static const char __pyx_k_K_RSUPER[] = "K_RSUPER"; static const char __pyx_k_K_SELECT[] = "K_SELECT"; static const char __pyx_k_K_SYSREQ[] = "K_SYSREQ"; static const char __pyx_k_RLEACCEL[] = "RLEACCEL"; static const char __pyx_k_SRCALPHA[] = "SRCALPHA"; static const char __pyx_k_BLEND_ADD[] = "BLEND_ADD"; static const char __pyx_k_BLEND_MAX[] = "BLEND_MAX"; static const char __pyx_k_BLEND_MIN[] = "BLEND_MIN"; static const char __pyx_k_BLEND_SUB[] = "BLEND_SUB"; static const char __pyx_k_BYTEORDER[] = "BYTEORDER"; static const char __pyx_k_DOUBLEBUF[] = "DOUBLEBUF"; static const char __pyx_k_GL_STEREO[] = "GL_STEREO"; static const char __pyx_k_HWSURFACE[] = "HWSURFACE"; static const char __pyx_k_KMOD_CAPS[] = "KMOD_CAPS"; static const char __pyx_k_KMOD_CTRL[] = "KMOD_CTRL"; static const char __pyx_k_KMOD_LALT[] = "KMOD_LALT"; static const char __pyx_k_KMOD_LGUI[] = "KMOD_LGUI"; static const char __pyx_k_KMOD_META[] = "KMOD_META"; static const char __pyx_k_KMOD_MODE[] = "KMOD_MODE"; static const char __pyx_k_KMOD_NONE[] = "KMOD_NONE"; static const char __pyx_k_KMOD_RALT[] = "KMOD_RALT"; static const char __pyx_k_KMOD_RGUI[] = "KMOD_RGUI"; static const char __pyx_k_K_AC_BACK[] = "K_AC_BACK"; static const char __pyx_k_K_AC_HOME[] = "K_AC_HOME"; static const char __pyx_k_K_AC_STOP[] = "K_AC_STOP"; static const char __pyx_k_K_EXCLAIM[] = "K_EXCLAIM"; static const char __pyx_k_K_EXECUTE[] = "K_EXECUTE"; static const char __pyx_k_K_GREATER[] = "K_GREATER"; static const char __pyx_k_K_KP_HASH[] = "K_KP_HASH"; static const char __pyx_k_K_KP_LESS[] = "K_KP_LESS"; static const char __pyx_k_K_KP_PLUS[] = "K_KP_PLUS"; static const char __pyx_k_K_NUMLOCK[] = "K_NUMLOCK"; static const char __pyx_k_K_PERCENT[] = "K_PERCENT"; static const char __pyx_k_K_RETURN2[] = "K_RETURN2"; static const char __pyx_k_K_UNKNOWN[] = "K_UNKNOWN"; static const char __pyx_k_LASTEVENT[] = "LASTEVENT"; static const char __pyx_k_RESIZABLE[] = "RESIZABLE"; static const char __pyx_k_SWSURFACE[] = "SWSURFACE"; static const char __pyx_k_TEXTINPUT[] = "TEXTINPUT"; static const char __pyx_k_USEREVENT[] = "USEREVENT"; static const char __pyx_k_BIG_ENDIAN[] = "BIG_ENDIAN"; static const char __pyx_k_BLEND_MULT[] = "BLEND_MULT"; static const char __pyx_k_FINGERDOWN[] = "FINGERDOWN"; static const char __pyx_k_FULLSCREEN[] = "FULLSCREEN"; static const char __pyx_k_KMOD_LCTRL[] = "KMOD_LCTRL"; static const char __pyx_k_KMOD_LMETA[] = "KMOD_LMETA"; static const char __pyx_k_KMOD_RCTRL[] = "KMOD_RCTRL"; static const char __pyx_k_KMOD_RMETA[] = "KMOD_RMETA"; static const char __pyx_k_KMOD_SHIFT[] = "KMOD_SHIFT"; static const char __pyx_k_K_ALTERASE[] = "K_ALTERASE"; static const char __pyx_k_K_ASTERISK[] = "K_ASTERISK"; static const char __pyx_k_K_CAPSLOCK[] = "K_CAPSLOCK"; static const char __pyx_k_K_COMPUTER[] = "K_COMPUTER"; static const char __pyx_k_K_KP_CLEAR[] = "K_KP_CLEAR"; static const char __pyx_k_K_KP_COLON[] = "K_KP_COLON"; static const char __pyx_k_K_KP_COMMA[] = "K_KP_COMMA"; static const char __pyx_k_K_KP_ENTER[] = "K_KP_ENTER"; static const char __pyx_k_K_KP_MINUS[] = "K_KP_MINUS"; static const char __pyx_k_K_KP_OCTAL[] = "K_KP_OCTAL"; static const char __pyx_k_K_KP_POWER[] = "K_KP_POWER"; static const char __pyx_k_K_KP_SPACE[] = "K_KP_SPACE"; static const char __pyx_k_K_PAGEDOWN[] = "K_PAGEDOWN"; static const char __pyx_k_K_QUESTION[] = "K_QUESTION"; static const char __pyx_k_K_QUOTEDBL[] = "K_QUOTEDBL"; static const char __pyx_k_K_VOLUMEUP[] = "K_VOLUMEUP"; static const char __pyx_k_LIL_ENDIAN[] = "LIL_ENDIAN"; static const char __pyx_k_MOUSEWHEEL[] = "MOUSEWHEEL"; static const char __pyx_k_SCRAP_TEXT[] = "SCRAP_TEXT"; static const char __pyx_k_SYSWMEVENT[] = "SYSWMEVENT"; static const char __pyx_k_text_plain[] = "text/plain"; static const char __pyx_k_ACTIVEEVENT[] = "ACTIVEEVENT"; static const char __pyx_k_GL_RED_SIZE[] = "GL_RED_SIZE"; static const char __pyx_k_JOYBUTTONUP[] = "JOYBUTTONUP"; static const char __pyx_k_KMOD_LSHIFT[] = "KMOD_LSHIFT"; static const char __pyx_k_KMOD_RSHIFT[] = "KMOD_RSHIFT"; static const char __pyx_k_K_AC_SEARCH[] = "K_AC_SEARCH"; static const char __pyx_k_K_AMPERSAND[] = "K_AMPERSAND"; static const char __pyx_k_K_AUDIOMUTE[] = "K_AUDIOMUTE"; static const char __pyx_k_K_AUDIONEXT[] = "K_AUDIONEXT"; static const char __pyx_k_K_AUDIOPLAY[] = "K_AUDIOPLAY"; static const char __pyx_k_K_AUDIOPREV[] = "K_AUDIOPREV"; static const char __pyx_k_K_AUDIOSTOP[] = "K_AUDIOSTOP"; static const char __pyx_k_K_BACKQUOTE[] = "K_BACKQUOTE"; static const char __pyx_k_K_BACKSLASH[] = "K_BACKSLASH"; static const char __pyx_k_K_BACKSPACE[] = "K_BACKSPACE"; static const char __pyx_k_K_KP_BINARY[] = "K_KP_BINARY"; static const char __pyx_k_K_KP_DIVIDE[] = "K_KP_DIVIDE"; static const char __pyx_k_K_KP_EQUALS[] = "K_KP_EQUALS"; static const char __pyx_k_K_KP_EXCLAM[] = "K_KP_EXCLAM"; static const char __pyx_k_K_KP_MEMADD[] = "K_KP_MEMADD"; static const char __pyx_k_K_KP_PERIOD[] = "K_KP_PERIOD"; static const char __pyx_k_K_LEFTPAREN[] = "K_LEFTPAREN"; static const char __pyx_k_K_SCROLLOCK[] = "K_SCROLLOCK"; static const char __pyx_k_K_SEMICOLON[] = "K_SEMICOLON"; static const char __pyx_k_K_SEPARATOR[] = "K_SEPARATOR"; static const char __pyx_k_MOUSEMOTION[] = "MOUSEMOTION"; static const char __pyx_k_SRCCOLORKEY[] = "SRCCOLORKEY"; static const char __pyx_k_TEXTEDITING[] = "TEXTEDITING"; static const char __pyx_k_VIDEOEXPOSE[] = "VIDEOEXPOSE"; static const char __pyx_k_VIDEORESIZE[] = "VIDEORESIZE"; static const char __pyx_k_WINDOWEVENT[] = "WINDOWEVENT"; static const char __pyx_k_DOLLARRECORD[] = "DOLLARRECORD"; static const char __pyx_k_FINGERMOTION[] = "FINGERMOTION"; static const char __pyx_k_GL_BLUE_SIZE[] = "GL_BLUE_SIZE"; static const char __pyx_k_JOYHATMOTION[] = "JOYHATMOTION"; static const char __pyx_k_K_AC_FORWARD[] = "K_AC_FORWARD"; static const char __pyx_k_K_AC_REFRESH[] = "K_AC_REFRESH"; static const char __pyx_k_K_CALCULATOR[] = "K_CALCULATOR"; static const char __pyx_k_K_CLEARAGAIN[] = "K_CLEARAGAIN"; static const char __pyx_k_K_KBDILLUMUP[] = "K_KBDILLUMUP"; static const char __pyx_k_K_KP_DECIMAL[] = "K_KP_DECIMAL"; static const char __pyx_k_K_KP_GREATER[] = "K_KP_GREATER"; static const char __pyx_k_K_KP_PERCENT[] = "K_KP_PERCENT"; static const char __pyx_k_K_RIGHTPAREN[] = "K_RIGHTPAREN"; static const char __pyx_k_K_SCROLLLOCK[] = "K_SCROLLLOCK"; static const char __pyx_k_K_UNDERSCORE[] = "K_UNDERSCORE"; static const char __pyx_k_K_VOLUMEDOWN[] = "K_VOLUMEDOWN"; static const char __pyx_k_MULTIGESTURE[] = "MULTIGESTURE"; static const char __pyx_k_WINDOW_SHOWN[] = "WINDOW_SHOWN"; static const char __pyx_k_APP_LOWMEMORY[] = "APP_LOWMEMORY"; static const char __pyx_k_BLEND_RGB_ADD[] = "BLEND_RGB_ADD"; static const char __pyx_k_BLEND_RGB_MAX[] = "BLEND_RGB_MAX"; static const char __pyx_k_BLEND_RGB_MIN[] = "BLEND_RGB_MIN"; static const char __pyx_k_BLEND_RGB_SUB[] = "BLEND_RGB_SUB"; static const char __pyx_k_DOLLARGESTURE[] = "DOLLARGESTURE"; static const char __pyx_k_GL_ALPHA_SIZE[] = "GL_ALPHA_SIZE"; static const char __pyx_k_GL_DEPTH_SIZE[] = "GL_DEPTH_SIZE"; static const char __pyx_k_GL_GREEN_SIZE[] = "GL_GREEN_SIZE"; static const char __pyx_k_JOYAXISMOTION[] = "JOYAXISMOTION"; static const char __pyx_k_JOYBALLMOTION[] = "JOYBALLMOTION"; static const char __pyx_k_JOYBUTTONDOWN[] = "JOYBUTTONDOWN"; static const char __pyx_k_K_APPLICATION[] = "K_APPLICATION"; static const char __pyx_k_K_KP_MEMCLEAR[] = "K_KP_MEMCLEAR"; static const char __pyx_k_K_KP_MEMSTORE[] = "K_KP_MEMSTORE"; static const char __pyx_k_K_KP_MULTIPLY[] = "K_KP_MULTIPLY"; static const char __pyx_k_K_LEFTBRACKET[] = "K_LEFTBRACKET"; static const char __pyx_k_K_MEDIASELECT[] = "K_MEDIASELECT"; static const char __pyx_k_K_PRINTSCREEN[] = "K_PRINTSCREEN"; static const char __pyx_k_MOUSEBUTTONUP[] = "MOUSEBUTTONUP"; static const char __pyx_k_TOUCH_MOUSEID[] = "TOUCH_MOUSEID"; static const char __pyx_k_WINDOW_HIDDEN[] = "WINDOW_HIDDEN"; static const char __pyx_k_WINDOW_OPENGL[] = "WINDOW_OPENGL"; static const char __pyx_k_BLEND_RGBA_ADD[] = "BLEND_RGBA_ADD"; static const char __pyx_k_BLEND_RGBA_MAX[] = "BLEND_RGBA_MAX"; static const char __pyx_k_BLEND_RGBA_MIN[] = "BLEND_RGBA_MIN"; static const char __pyx_k_BLEND_RGBA_SUB[] = "BLEND_RGBA_SUB"; static const char __pyx_k_BLEND_RGB_MULT[] = "BLEND_RGB_MULT"; static const char __pyx_k_GL_BUFFER_SIZE[] = "GL_BUFFER_SIZE"; static const char __pyx_k_GL_CONTEXT_EGL[] = "GL_CONTEXT_EGL"; static const char __pyx_k_JOYDEVICEADDED[] = "JOYDEVICEADDED"; static const char __pyx_k_K_AC_BOOKMARKS[] = "K_AC_BOOKMARKS"; static const char __pyx_k_K_BRIGHTNESSUP[] = "K_BRIGHTNESSUP"; static const char __pyx_k_K_CURRENCYUNIT[] = "K_CURRENCYUNIT"; static const char __pyx_k_K_KBDILLUMDOWN[] = "K_KBDILLUMDOWN"; static const char __pyx_k_K_KP_AMPERSAND[] = "K_KP_AMPERSAND"; static const char __pyx_k_K_KP_BACKSPACE[] = "K_KP_BACKSPACE"; static const char __pyx_k_K_KP_LEFTBRACE[] = "K_KP_LEFTBRACE"; static const char __pyx_k_K_KP_LEFTPAREN[] = "K_KP_LEFTPAREN"; static const char __pyx_k_K_KP_MEMDIVIDE[] = "K_KP_MEMDIVIDE"; static const char __pyx_k_K_KP_MEMRECALL[] = "K_KP_MEMRECALL"; static const char __pyx_k_K_KP_PLUSMINUS[] = "K_KP_PLUSMINUS"; static const char __pyx_k_K_NUMLOCKCLEAR[] = "K_NUMLOCKCLEAR"; static const char __pyx_k_K_RIGHTBRACKET[] = "K_RIGHTBRACKET"; static const char __pyx_k_WINDOW_FOREIGN[] = "WINDOW_FOREIGN"; static const char __pyx_k_WINDOW_NOFRAME[] = "WINDOW_NOFRAME"; static const char __pyx_k_APP_TERMINATING[] = "APP_TERMINATING"; static const char __pyx_k_BLEND_RGBA_MULT[] = "BLEND_RGBA_MULT"; static const char __pyx_k_CLIPBOARDUPDATE[] = "CLIPBOARDUPDATE"; static const char __pyx_k_GL_DOUBLEBUFFER[] = "GL_DOUBLEBUFFER"; static const char __pyx_k_GL_STENCIL_SIZE[] = "GL_STENCIL_SIZE"; static const char __pyx_k_GL_SWAP_CONTROL[] = "GL_SWAP_CONTROL"; static const char __pyx_k_K_DISPLAYSWITCH[] = "K_DISPLAYSWITCH"; static const char __pyx_k_K_KP_CLEARENTRY[] = "K_KP_CLEARENTRY"; static const char __pyx_k_K_KP_RIGHTBRACE[] = "K_KP_RIGHTBRACE"; static const char __pyx_k_K_KP_RIGHTPAREN[] = "K_KP_RIGHTPAREN"; static const char __pyx_k_MOUSEBUTTONDOWN[] = "MOUSEBUTTONDOWN"; static const char __pyx_k_GL_CONTEXT_FLAGS[] = "GL_CONTEXT_FLAGS"; static const char __pyx_k_JOYDEVICEREMOVED[] = "JOYDEVICEREMOVED"; static const char __pyx_k_K_BRIGHTNESSDOWN[] = "K_BRIGHTNESSDOWN"; static const char __pyx_k_K_KBDILLUMTOGGLE[] = "K_KBDILLUMTOGGLE"; static const char __pyx_k_K_KP_EQUALSAS400[] = "K_KP_EQUALSAS400"; static const char __pyx_k_K_KP_HEXADECIMAL[] = "K_KP_HEXADECIMAL"; static const char __pyx_k_K_KP_MEMMULTIPLY[] = "K_KP_MEMMULTIPLY"; static const char __pyx_k_K_KP_MEMSUBTRACT[] = "K_KP_MEMSUBTRACT"; static const char __pyx_k_K_KP_VERTICALBAR[] = "K_KP_VERTICALBAR"; static const char __pyx_k_WINDOW_MAXIMIZED[] = "WINDOW_MAXIMIZED"; static const char __pyx_k_WINDOW_MINIMIZED[] = "WINDOW_MINIMIZED"; static const char __pyx_k_WINDOW_RESIZABLE[] = "WINDOW_RESIZABLE"; static const char __pyx_k_pygame_sdl2_rect[] = "pygame_sdl2.rect"; static const char __pyx_k_GL_ACCUM_RED_SIZE[] = "GL_ACCUM_RED_SIZE"; static const char __pyx_k_K_CURRENCYSUBUNIT[] = "K_CURRENCYSUBUNIT"; static const char __pyx_k_K_KP_DBLAMPERSAND[] = "K_KP_DBLAMPERSAND"; static const char __pyx_k_SDL_VERSION_TUPLE[] = "SDL_VERSION_TUPLE"; static const char __pyx_k_WINDOW_BORDERLESS[] = "WINDOW_BORDERLESS"; static const char __pyx_k_WINDOW_FULLSCREEN[] = "WINDOW_FULLSCREEN"; static const char __pyx_k_pygame_sdl2_color[] = "pygame_sdl2.color"; static const char __pyx_k_CONTROLLERBUTTONUP[] = "CONTROLLERBUTTONUP"; static const char __pyx_k_GL_ACCUM_BLUE_SIZE[] = "GL_ACCUM_BLUE_SIZE"; static const char __pyx_k_K_DECIMALSEPARATOR[] = "K_DECIMALSEPARATOR"; static const char __pyx_k_POWERSTATE_CHARGED[] = "POWERSTATE_CHARGED"; static const char __pyx_k_POWERSTATE_UNKNOWN[] = "POWERSTATE_UNKNOWN"; static const char __pyx_k_WINDOWPOS_CENTERED[] = "WINDOWPOS_CENTERED"; static const char __pyx_k_WINDOW_INPUT_FOCUS[] = "WINDOW_INPUT_FOCUS"; static const char __pyx_k_BLEND_PREMULTIPLIED[] = "BLEND_PREMULTIPLIED"; static const char __pyx_k_CONTROLLER_AXIS_MAX[] = "CONTROLLER_AXIS_MAX"; static const char __pyx_k_CONTROLLER_BUTTON_A[] = "CONTROLLER_BUTTON_A"; static const char __pyx_k_CONTROLLER_BUTTON_B[] = "CONTROLLER_BUTTON_B"; static const char __pyx_k_CONTROLLER_BUTTON_X[] = "CONTROLLER_BUTTON_X"; static const char __pyx_k_CONTROLLER_BUTTON_Y[] = "CONTROLLER_BUTTON_Y"; static const char __pyx_k_GL_ACCUM_ALPHA_SIZE[] = "GL_ACCUM_ALPHA_SIZE"; static const char __pyx_k_GL_ACCUM_GREEN_SIZE[] = "GL_ACCUM_GREEN_SIZE"; static const char __pyx_k_GL_RETAINED_BACKING[] = "GL_RETAINED_BACKING"; static const char __pyx_k_K_KP_DBLVERTICALBAR[] = "K_KP_DBLVERTICALBAR"; static const char __pyx_k_POWERSTATE_CHARGING[] = "POWERSTATE_CHARGING"; static const char __pyx_k_WINDOWPOS_UNDEFINED[] = "WINDOWPOS_UNDEFINED"; static const char __pyx_k_CONTROLLERAXISMOTION[] = "CONTROLLERAXISMOTION"; static const char __pyx_k_CONTROLLERBUTTONDOWN[] = "CONTROLLERBUTTONDOWN"; static const char __pyx_k_K_THOUSANDSSEPARATOR[] = "K_THOUSANDSSEPARATOR"; static const char __pyx_k_RENDER_TARGETS_RESET[] = "RENDER_TARGETS_RESET"; static const char __pyx_k_WINDOW_ALLOW_HIGHDPI[] = "WINDOW_ALLOW_HIGHDPI"; static const char __pyx_k_WINDOW_INPUT_GRABBED[] = "WINDOW_INPUT_GRABBED"; static const char __pyx_k_CONTROLLERDEVICEADDED[] = "CONTROLLERDEVICEADDED"; static const char __pyx_k_CONTROLLER_AXIS_LEFTX[] = "CONTROLLER_AXIS_LEFTX"; static const char __pyx_k_CONTROLLER_AXIS_LEFTY[] = "CONTROLLER_AXIS_LEFTY"; static const char __pyx_k_CONTROLLER_BUTTON_MAX[] = "CONTROLLER_BUTTON_MAX"; static const char __pyx_k_GL_ACCELERATED_VISUAL[] = "GL_ACCELERATED_VISUAL"; static const char __pyx_k_GL_MULTISAMPLEBUFFERS[] = "GL_MULTISAMPLEBUFFERS"; static const char __pyx_k_GL_MULTISAMPLESAMPLES[] = "GL_MULTISAMPLESAMPLES"; static const char __pyx_k_POWERSTATE_NO_BATTERY[] = "POWERSTATE_NO_BATTERY"; static const char __pyx_k_POWERSTATE_ON_BATTERY[] = "POWERSTATE_ON_BATTERY"; static const char __pyx_k_APP_DIDENTERBACKGROUND[] = "APP_DIDENTERBACKGROUND"; static const char __pyx_k_APP_DIDENTERFOREGROUND[] = "APP_DIDENTERFOREGROUND"; static const char __pyx_k_CONTROLLER_AXIS_RIGHTX[] = "CONTROLLER_AXIS_RIGHTX"; static const char __pyx_k_CONTROLLER_AXIS_RIGHTY[] = "CONTROLLER_AXIS_RIGHTY"; static const char __pyx_k_CONTROLLER_BUTTON_BACK[] = "CONTROLLER_BUTTON_BACK"; static const char __pyx_k_APP_WILLENTERBACKGROUND[] = "APP_WILLENTERBACKGROUND"; static const char __pyx_k_APP_WILLENTERFOREGROUND[] = "APP_WILLENTERFOREGROUND"; static const char __pyx_k_CONTROLLERDEVICEREMOVED[] = "CONTROLLERDEVICEREMOVED"; static const char __pyx_k_CONTROLLER_AXIS_INVALID[] = "CONTROLLER_AXIS_INVALID"; static const char __pyx_k_CONTROLLER_BUTTON_GUIDE[] = "CONTROLLER_BUTTON_GUIDE"; static const char __pyx_k_CONTROLLER_BUTTON_START[] = "CONTROLLER_BUTTON_START"; static const char __pyx_k_GL_CONTEXT_PROFILE_MASK[] = "GL_CONTEXT_PROFILE_MASK"; static const char __pyx_k_CONTROLLERDEVICEREMAPPED[] = "CONTROLLERDEVICEREMAPPED"; static const char __pyx_k_GL_CONTEXT_MAJOR_VERSION[] = "GL_CONTEXT_MAJOR_VERSION"; static const char __pyx_k_GL_CONTEXT_MINOR_VERSION[] = "GL_CONTEXT_MINOR_VERSION"; static const char __pyx_k_CONTROLLER_BUTTON_DPAD_UP[] = "CONTROLLER_BUTTON_DPAD_UP"; static const char __pyx_k_CONTROLLER_BUTTON_INVALID[] = "CONTROLLER_BUTTON_INVALID"; static const char __pyx_k_WINDOW_FULLSCREEN_DESKTOP[] = "WINDOW_FULLSCREEN_DESKTOP"; static const char __pyx_k_CONTROLLER_AXIS_TRIGGERLEFT[] = "CONTROLLER_AXIS_TRIGGERLEFT"; static const char __pyx_k_CONTROLLER_BUTTON_DPAD_DOWN[] = "CONTROLLER_BUTTON_DPAD_DOWN"; static const char __pyx_k_CONTROLLER_BUTTON_DPAD_LEFT[] = "CONTROLLER_BUTTON_DPAD_LEFT"; static const char __pyx_k_CONTROLLER_BUTTON_LEFTSTICK[] = "CONTROLLER_BUTTON_LEFTSTICK"; static const char __pyx_k_GL_FRAMEBUFFER_SRGB_CAPABLE[] = "GL_FRAMEBUFFER_SRGB_CAPABLE"; static const char __pyx_k_CONTROLLER_AXIS_TRIGGERRIGHT[] = "CONTROLLER_AXIS_TRIGGERRIGHT"; static const char __pyx_k_CONTROLLER_BUTTON_DPAD_RIGHT[] = "CONTROLLER_BUTTON_DPAD_RIGHT"; static const char __pyx_k_CONTROLLER_BUTTON_RIGHTSTICK[] = "CONTROLLER_BUTTON_RIGHTSTICK"; static const char __pyx_k_GL_SHARE_WITH_CURRENT_CONTEXT[] = "GL_SHARE_WITH_CURRENT_CONTEXT"; static const char __pyx_k_CONTROLLER_BUTTON_LEFTSHOULDER[] = "CONTROLLER_BUTTON_LEFTSHOULDER"; static const char __pyx_k_CONTROLLER_BUTTON_RIGHTSHOULDER[] = "CONTROLLER_BUTTON_RIGHTSHOULDER"; static PyObject *__pyx_n_s_ACTIVEEVENT; static PyObject *__pyx_n_s_APP_DIDENTERBACKGROUND; static PyObject *__pyx_n_s_APP_DIDENTERFOREGROUND; static PyObject *__pyx_n_s_APP_LOWMEMORY; static PyObject *__pyx_n_s_APP_TERMINATING; static PyObject *__pyx_n_s_APP_WILLENTERBACKGROUND; static PyObject *__pyx_n_s_APP_WILLENTERFOREGROUND; static PyObject *__pyx_n_s_BIG_ENDIAN; static PyObject *__pyx_n_s_BLEND_ADD; static PyObject *__pyx_n_s_BLEND_MAX; static PyObject *__pyx_n_s_BLEND_MIN; static PyObject *__pyx_n_s_BLEND_MULT; static PyObject *__pyx_n_s_BLEND_PREMULTIPLIED; static PyObject *__pyx_n_s_BLEND_RGBA_ADD; static PyObject *__pyx_n_s_BLEND_RGBA_MAX; static PyObject *__pyx_n_s_BLEND_RGBA_MIN; static PyObject *__pyx_n_s_BLEND_RGBA_MULT; static PyObject *__pyx_n_s_BLEND_RGBA_SUB; static PyObject *__pyx_n_s_BLEND_RGB_ADD; static PyObject *__pyx_n_s_BLEND_RGB_MAX; static PyObject *__pyx_n_s_BLEND_RGB_MIN; static PyObject *__pyx_n_s_BLEND_RGB_MULT; static PyObject *__pyx_n_s_BLEND_RGB_SUB; static PyObject *__pyx_n_s_BLEND_SUB; static PyObject *__pyx_n_s_BYTEORDER; static PyObject *__pyx_n_s_CLIPBOARDUPDATE; static PyObject *__pyx_n_s_CONTROLLERAXISMOTION; static PyObject *__pyx_n_s_CONTROLLERBUTTONDOWN; static PyObject *__pyx_n_s_CONTROLLERBUTTONUP; static PyObject *__pyx_n_s_CONTROLLERDEVICEADDED; static PyObject *__pyx_n_s_CONTROLLERDEVICEREMAPPED; static PyObject *__pyx_n_s_CONTROLLERDEVICEREMOVED; static PyObject *__pyx_n_s_CONTROLLER_AXIS_INVALID; static PyObject *__pyx_n_s_CONTROLLER_AXIS_LEFTX; static PyObject *__pyx_n_s_CONTROLLER_AXIS_LEFTY; static PyObject *__pyx_n_s_CONTROLLER_AXIS_MAX; static PyObject *__pyx_n_s_CONTROLLER_AXIS_RIGHTX; static PyObject *__pyx_n_s_CONTROLLER_AXIS_RIGHTY; static PyObject *__pyx_n_s_CONTROLLER_AXIS_TRIGGERLEFT; static PyObject *__pyx_n_s_CONTROLLER_AXIS_TRIGGERRIGHT; static PyObject *__pyx_n_s_CONTROLLER_BUTTON_A; static PyObject *__pyx_n_s_CONTROLLER_BUTTON_B; static PyObject *__pyx_n_s_CONTROLLER_BUTTON_BACK; static PyObject *__pyx_n_s_CONTROLLER_BUTTON_DPAD_DOWN; static PyObject *__pyx_n_s_CONTROLLER_BUTTON_DPAD_LEFT; static PyObject *__pyx_n_s_CONTROLLER_BUTTON_DPAD_RIGHT; static PyObject *__pyx_n_s_CONTROLLER_BUTTON_DPAD_UP; static PyObject *__pyx_n_s_CONTROLLER_BUTTON_GUIDE; static PyObject *__pyx_n_s_CONTROLLER_BUTTON_INVALID; static PyObject *__pyx_n_s_CONTROLLER_BUTTON_LEFTSHOULDER; static PyObject *__pyx_n_s_CONTROLLER_BUTTON_LEFTSTICK; static PyObject *__pyx_n_s_CONTROLLER_BUTTON_MAX; static PyObject *__pyx_n_s_CONTROLLER_BUTTON_RIGHTSHOULDER; static PyObject *__pyx_n_s_CONTROLLER_BUTTON_RIGHTSTICK; static PyObject *__pyx_n_s_CONTROLLER_BUTTON_START; static PyObject *__pyx_n_s_CONTROLLER_BUTTON_X; static PyObject *__pyx_n_s_CONTROLLER_BUTTON_Y; static PyObject *__pyx_n_s_Color; static PyObject *__pyx_n_s_DOLLARGESTURE; static PyObject *__pyx_n_s_DOLLARRECORD; static PyObject *__pyx_n_s_DOUBLEBUF; static PyObject *__pyx_n_s_DROPFILE; static PyObject *__pyx_n_s_FINGERDOWN; static PyObject *__pyx_n_s_FINGERMOTION; static PyObject *__pyx_n_s_FINGERUP; static PyObject *__pyx_n_s_FULLSCREEN; static PyObject *__pyx_n_s_GL_ACCELERATED_VISUAL; static PyObject *__pyx_n_s_GL_ACCUM_ALPHA_SIZE; static PyObject *__pyx_n_s_GL_ACCUM_BLUE_SIZE; static PyObject *__pyx_n_s_GL_ACCUM_GREEN_SIZE; static PyObject *__pyx_n_s_GL_ACCUM_RED_SIZE; static PyObject *__pyx_n_s_GL_ALPHA_SIZE; static PyObject *__pyx_n_s_GL_BLUE_SIZE; static PyObject *__pyx_n_s_GL_BUFFER_SIZE; static PyObject *__pyx_n_s_GL_CONTEXT_EGL; static PyObject *__pyx_n_s_GL_CONTEXT_FLAGS; static PyObject *__pyx_n_s_GL_CONTEXT_MAJOR_VERSION; static PyObject *__pyx_n_s_GL_CONTEXT_MINOR_VERSION; static PyObject *__pyx_n_s_GL_CONTEXT_PROFILE_MASK; static PyObject *__pyx_n_s_GL_DEPTH_SIZE; static PyObject *__pyx_n_s_GL_DOUBLEBUFFER; static PyObject *__pyx_n_s_GL_FRAMEBUFFER_SRGB_CAPABLE; static PyObject *__pyx_n_s_GL_GREEN_SIZE; static PyObject *__pyx_n_s_GL_MULTISAMPLEBUFFERS; static PyObject *__pyx_n_s_GL_MULTISAMPLESAMPLES; static PyObject *__pyx_n_s_GL_RED_SIZE; static PyObject *__pyx_n_s_GL_RETAINED_BACKING; static PyObject *__pyx_n_s_GL_SHARE_WITH_CURRENT_CONTEXT; static PyObject *__pyx_n_s_GL_STENCIL_SIZE; static PyObject *__pyx_n_s_GL_STEREO; static PyObject *__pyx_n_s_GL_SWAP_CONTROL; static PyObject *__pyx_n_s_HWSURFACE; static PyObject *__pyx_n_s_JOYAXISMOTION; static PyObject *__pyx_n_s_JOYBALLMOTION; static PyObject *__pyx_n_s_JOYBUTTONDOWN; static PyObject *__pyx_n_s_JOYBUTTONUP; static PyObject *__pyx_n_s_JOYDEVICEADDED; static PyObject *__pyx_n_s_JOYDEVICEREMOVED; static PyObject *__pyx_n_s_JOYHATMOTION; static PyObject *__pyx_n_s_KEYDOWN; static PyObject *__pyx_n_s_KEYUP; static PyObject *__pyx_n_s_KMOD_ALT; static PyObject *__pyx_n_s_KMOD_CAPS; static PyObject *__pyx_n_s_KMOD_CTRL; static PyObject *__pyx_n_s_KMOD_GUI; static PyObject *__pyx_n_s_KMOD_LALT; static PyObject *__pyx_n_s_KMOD_LCTRL; static PyObject *__pyx_n_s_KMOD_LGUI; static PyObject *__pyx_n_s_KMOD_LMETA; static PyObject *__pyx_n_s_KMOD_LSHIFT; static PyObject *__pyx_n_s_KMOD_META; static PyObject *__pyx_n_s_KMOD_MODE; static PyObject *__pyx_n_s_KMOD_NONE; static PyObject *__pyx_n_s_KMOD_NUM; static PyObject *__pyx_n_s_KMOD_RALT; static PyObject *__pyx_n_s_KMOD_RCTRL; static PyObject *__pyx_n_s_KMOD_RGUI; static PyObject *__pyx_n_s_KMOD_RMETA; static PyObject *__pyx_n_s_KMOD_RSHIFT; static PyObject *__pyx_n_s_KMOD_SHIFT; static PyObject *__pyx_n_s_K_0; static PyObject *__pyx_n_s_K_1; static PyObject *__pyx_n_s_K_2; static PyObject *__pyx_n_s_K_3; static PyObject *__pyx_n_s_K_4; static PyObject *__pyx_n_s_K_5; static PyObject *__pyx_n_s_K_6; static PyObject *__pyx_n_s_K_7; static PyObject *__pyx_n_s_K_8; static PyObject *__pyx_n_s_K_9; static PyObject *__pyx_n_s_K_AC_BACK; static PyObject *__pyx_n_s_K_AC_BOOKMARKS; static PyObject *__pyx_n_s_K_AC_FORWARD; static PyObject *__pyx_n_s_K_AC_HOME; static PyObject *__pyx_n_s_K_AC_REFRESH; static PyObject *__pyx_n_s_K_AC_SEARCH; static PyObject *__pyx_n_s_K_AC_STOP; static PyObject *__pyx_n_s_K_AGAIN; static PyObject *__pyx_n_s_K_ALTERASE; static PyObject *__pyx_n_s_K_AMPERSAND; static PyObject *__pyx_n_s_K_APPLICATION; static PyObject *__pyx_n_s_K_ASTERISK; static PyObject *__pyx_n_s_K_AT; static PyObject *__pyx_n_s_K_AUDIOMUTE; static PyObject *__pyx_n_s_K_AUDIONEXT; static PyObject *__pyx_n_s_K_AUDIOPLAY; static PyObject *__pyx_n_s_K_AUDIOPREV; static PyObject *__pyx_n_s_K_AUDIOSTOP; static PyObject *__pyx_n_s_K_BACKQUOTE; static PyObject *__pyx_n_s_K_BACKSLASH; static PyObject *__pyx_n_s_K_BACKSPACE; static PyObject *__pyx_n_s_K_BREAK; static PyObject *__pyx_n_s_K_BRIGHTNESSDOWN; static PyObject *__pyx_n_s_K_BRIGHTNESSUP; static PyObject *__pyx_n_s_K_CALCULATOR; static PyObject *__pyx_n_s_K_CANCEL; static PyObject *__pyx_n_s_K_CAPSLOCK; static PyObject *__pyx_n_s_K_CARET; static PyObject *__pyx_n_s_K_CLEAR; static PyObject *__pyx_n_s_K_CLEARAGAIN; static PyObject *__pyx_n_s_K_COLON; static PyObject *__pyx_n_s_K_COMMA; static PyObject *__pyx_n_s_K_COMPUTER; static PyObject *__pyx_n_s_K_COPY; static PyObject *__pyx_n_s_K_CRSEL; static PyObject *__pyx_n_s_K_CURRENCYSUBUNIT; static PyObject *__pyx_n_s_K_CURRENCYUNIT; static PyObject *__pyx_n_s_K_CUT; static PyObject *__pyx_n_s_K_DECIMALSEPARATOR; static PyObject *__pyx_n_s_K_DELETE; static PyObject *__pyx_n_s_K_DISPLAYSWITCH; static PyObject *__pyx_n_s_K_DOLLAR; static PyObject *__pyx_n_s_K_DOWN; static PyObject *__pyx_n_s_K_EJECT; static PyObject *__pyx_n_s_K_END; static PyObject *__pyx_n_s_K_EQUALS; static PyObject *__pyx_n_s_K_ESCAPE; static PyObject *__pyx_n_s_K_EURO; static PyObject *__pyx_n_s_K_EXCLAIM; static PyObject *__pyx_n_s_K_EXECUTE; static PyObject *__pyx_n_s_K_EXSEL; static PyObject *__pyx_n_s_K_F1; static PyObject *__pyx_n_s_K_F10; static PyObject *__pyx_n_s_K_F11; static PyObject *__pyx_n_s_K_F12; static PyObject *__pyx_n_s_K_F13; static PyObject *__pyx_n_s_K_F14; static PyObject *__pyx_n_s_K_F15; static PyObject *__pyx_n_s_K_F16; static PyObject *__pyx_n_s_K_F17; static PyObject *__pyx_n_s_K_F18; static PyObject *__pyx_n_s_K_F19; static PyObject *__pyx_n_s_K_F2; static PyObject *__pyx_n_s_K_F20; static PyObject *__pyx_n_s_K_F21; static PyObject *__pyx_n_s_K_F22; static PyObject *__pyx_n_s_K_F23; static PyObject *__pyx_n_s_K_F24; static PyObject *__pyx_n_s_K_F3; static PyObject *__pyx_n_s_K_F4; static PyObject *__pyx_n_s_K_F5; static PyObject *__pyx_n_s_K_F6; static PyObject *__pyx_n_s_K_F7; static PyObject *__pyx_n_s_K_F8; static PyObject *__pyx_n_s_K_F9; static PyObject *__pyx_n_s_K_FIND; static PyObject *__pyx_n_s_K_FIRST; static PyObject *__pyx_n_s_K_GREATER; static PyObject *__pyx_n_s_K_HASH; static PyObject *__pyx_n_s_K_HELP; static PyObject *__pyx_n_s_K_HOME; static PyObject *__pyx_n_s_K_INSERT; static PyObject *__pyx_n_s_K_KBDILLUMDOWN; static PyObject *__pyx_n_s_K_KBDILLUMTOGGLE; static PyObject *__pyx_n_s_K_KBDILLUMUP; static PyObject *__pyx_n_s_K_KP0; static PyObject *__pyx_n_s_K_KP1; static PyObject *__pyx_n_s_K_KP2; static PyObject *__pyx_n_s_K_KP3; static PyObject *__pyx_n_s_K_KP4; static PyObject *__pyx_n_s_K_KP5; static PyObject *__pyx_n_s_K_KP6; static PyObject *__pyx_n_s_K_KP7; static PyObject *__pyx_n_s_K_KP8; static PyObject *__pyx_n_s_K_KP9; static PyObject *__pyx_n_s_K_KP_0; static PyObject *__pyx_n_s_K_KP_00; static PyObject *__pyx_n_s_K_KP_000; static PyObject *__pyx_n_s_K_KP_1; static PyObject *__pyx_n_s_K_KP_2; static PyObject *__pyx_n_s_K_KP_3; static PyObject *__pyx_n_s_K_KP_4; static PyObject *__pyx_n_s_K_KP_5; static PyObject *__pyx_n_s_K_KP_6; static PyObject *__pyx_n_s_K_KP_7; static PyObject *__pyx_n_s_K_KP_8; static PyObject *__pyx_n_s_K_KP_9; static PyObject *__pyx_n_s_K_KP_A; static PyObject *__pyx_n_s_K_KP_AMPERSAND; static PyObject *__pyx_n_s_K_KP_AT; static PyObject *__pyx_n_s_K_KP_B; static PyObject *__pyx_n_s_K_KP_BACKSPACE; static PyObject *__pyx_n_s_K_KP_BINARY; static PyObject *__pyx_n_s_K_KP_C; static PyObject *__pyx_n_s_K_KP_CLEAR; static PyObject *__pyx_n_s_K_KP_CLEARENTRY; static PyObject *__pyx_n_s_K_KP_COLON; static PyObject *__pyx_n_s_K_KP_COMMA; static PyObject *__pyx_n_s_K_KP_D; static PyObject *__pyx_n_s_K_KP_DBLAMPERSAND; static PyObject *__pyx_n_s_K_KP_DBLVERTICALBAR; static PyObject *__pyx_n_s_K_KP_DECIMAL; static PyObject *__pyx_n_s_K_KP_DIVIDE; static PyObject *__pyx_n_s_K_KP_E; static PyObject *__pyx_n_s_K_KP_ENTER; static PyObject *__pyx_n_s_K_KP_EQUALS; static PyObject *__pyx_n_s_K_KP_EQUALSAS400; static PyObject *__pyx_n_s_K_KP_EXCLAM; static PyObject *__pyx_n_s_K_KP_F; static PyObject *__pyx_n_s_K_KP_GREATER; static PyObject *__pyx_n_s_K_KP_HASH; static PyObject *__pyx_n_s_K_KP_HEXADECIMAL; static PyObject *__pyx_n_s_K_KP_LEFTBRACE; static PyObject *__pyx_n_s_K_KP_LEFTPAREN; static PyObject *__pyx_n_s_K_KP_LESS; static PyObject *__pyx_n_s_K_KP_MEMADD; static PyObject *__pyx_n_s_K_KP_MEMCLEAR; static PyObject *__pyx_n_s_K_KP_MEMDIVIDE; static PyObject *__pyx_n_s_K_KP_MEMMULTIPLY; static PyObject *__pyx_n_s_K_KP_MEMRECALL; static PyObject *__pyx_n_s_K_KP_MEMSTORE; static PyObject *__pyx_n_s_K_KP_MEMSUBTRACT; static PyObject *__pyx_n_s_K_KP_MINUS; static PyObject *__pyx_n_s_K_KP_MULTIPLY; static PyObject *__pyx_n_s_K_KP_OCTAL; static PyObject *__pyx_n_s_K_KP_PERCENT; static PyObject *__pyx_n_s_K_KP_PERIOD; static PyObject *__pyx_n_s_K_KP_PLUS; static PyObject *__pyx_n_s_K_KP_PLUSMINUS; static PyObject *__pyx_n_s_K_KP_POWER; static PyObject *__pyx_n_s_K_KP_RIGHTBRACE; static PyObject *__pyx_n_s_K_KP_RIGHTPAREN; static PyObject *__pyx_n_s_K_KP_SPACE; static PyObject *__pyx_n_s_K_KP_TAB; static PyObject *__pyx_n_s_K_KP_VERTICALBAR; static PyObject *__pyx_n_s_K_KP_XOR; static PyObject *__pyx_n_s_K_LALT; static PyObject *__pyx_n_s_K_LAST; static PyObject *__pyx_n_s_K_LCTRL; static PyObject *__pyx_n_s_K_LEFT; static PyObject *__pyx_n_s_K_LEFTBRACKET; static PyObject *__pyx_n_s_K_LEFTPAREN; static PyObject *__pyx_n_s_K_LESS; static PyObject *__pyx_n_s_K_LGUI; static PyObject *__pyx_n_s_K_LMETA; static PyObject *__pyx_n_s_K_LSHIFT; static PyObject *__pyx_n_s_K_LSUPER; static PyObject *__pyx_n_s_K_MAIL; static PyObject *__pyx_n_s_K_MEDIASELECT; static PyObject *__pyx_n_s_K_MENU; static PyObject *__pyx_n_s_K_MINUS; static PyObject *__pyx_n_s_K_MODE; static PyObject *__pyx_n_s_K_MUTE; static PyObject *__pyx_n_s_K_NUMLOCK; static PyObject *__pyx_n_s_K_NUMLOCKCLEAR; static PyObject *__pyx_n_s_K_OPER; static PyObject *__pyx_n_s_K_OUT; static PyObject *__pyx_n_s_K_PAGEDOWN; static PyObject *__pyx_n_s_K_PAGEUP; static PyObject *__pyx_n_s_K_PASTE; static PyObject *__pyx_n_s_K_PAUSE; static PyObject *__pyx_n_s_K_PERCENT; static PyObject *__pyx_n_s_K_PERIOD; static PyObject *__pyx_n_s_K_PLUS; static PyObject *__pyx_n_s_K_POWER; static PyObject *__pyx_n_s_K_PRINT; static PyObject *__pyx_n_s_K_PRINTSCREEN; static PyObject *__pyx_n_s_K_PRIOR; static PyObject *__pyx_n_s_K_QUESTION; static PyObject *__pyx_n_s_K_QUOTE; static PyObject *__pyx_n_s_K_QUOTEDBL; static PyObject *__pyx_n_s_K_RALT; static PyObject *__pyx_n_s_K_RCTRL; static PyObject *__pyx_n_s_K_RETURN; static PyObject *__pyx_n_s_K_RETURN2; static PyObject *__pyx_n_s_K_RGUI; static PyObject *__pyx_n_s_K_RIGHT; static PyObject *__pyx_n_s_K_RIGHTBRACKET; static PyObject *__pyx_n_s_K_RIGHTPAREN; static PyObject *__pyx_n_s_K_RMETA; static PyObject *__pyx_n_s_K_RSHIFT; static PyObject *__pyx_n_s_K_RSUPER; static PyObject *__pyx_n_s_K_SCROLLLOCK; static PyObject *__pyx_n_s_K_SCROLLOCK; static PyObject *__pyx_n_s_K_SELECT; static PyObject *__pyx_n_s_K_SEMICOLON; static PyObject *__pyx_n_s_K_SEPARATOR; static PyObject *__pyx_n_s_K_SLASH; static PyObject *__pyx_n_s_K_SLEEP; static PyObject *__pyx_n_s_K_SPACE; static PyObject *__pyx_n_s_K_STOP; static PyObject *__pyx_n_s_K_SYSREQ; static PyObject *__pyx_n_s_K_TAB; static PyObject *__pyx_n_s_K_THOUSANDSSEPARATOR; static PyObject *__pyx_n_s_K_UNDERSCORE; static PyObject *__pyx_n_s_K_UNDO; static PyObject *__pyx_n_s_K_UNKNOWN; static PyObject *__pyx_n_s_K_UP; static PyObject *__pyx_n_s_K_VOLUMEDOWN; static PyObject *__pyx_n_s_K_VOLUMEUP; static PyObject *__pyx_n_s_K_WWW; static PyObject *__pyx_n_s_K_a; static PyObject *__pyx_n_s_K_b; static PyObject *__pyx_n_s_K_c; static PyObject *__pyx_n_s_K_d; static PyObject *__pyx_n_s_K_e; static PyObject *__pyx_n_s_K_f; static PyObject *__pyx_n_s_K_g; static PyObject *__pyx_n_s_K_h; static PyObject *__pyx_n_s_K_i; static PyObject *__pyx_n_s_K_j; static PyObject *__pyx_n_s_K_k; static PyObject *__pyx_n_s_K_l; static PyObject *__pyx_n_s_K_m; static PyObject *__pyx_n_s_K_n; static PyObject *__pyx_n_s_K_o; static PyObject *__pyx_n_s_K_p; static PyObject *__pyx_n_s_K_q; static PyObject *__pyx_n_s_K_r; static PyObject *__pyx_n_s_K_s; static PyObject *__pyx_n_s_K_t; static PyObject *__pyx_n_s_K_u; static PyObject *__pyx_n_s_K_v; static PyObject *__pyx_n_s_K_w; static PyObject *__pyx_n_s_K_x; static PyObject *__pyx_n_s_K_y; static PyObject *__pyx_n_s_K_z; static PyObject *__pyx_n_s_LASTEVENT; static PyObject *__pyx_n_s_LIL_ENDIAN; static PyObject *__pyx_n_s_MOUSEBUTTONDOWN; static PyObject *__pyx_n_s_MOUSEBUTTONUP; static PyObject *__pyx_n_s_MOUSEMOTION; static PyObject *__pyx_n_s_MOUSEWHEEL; static PyObject *__pyx_n_s_MULTIGESTURE; static PyObject *__pyx_n_s_NOEVENT; static PyObject *__pyx_n_s_NOFRAME; static PyObject *__pyx_n_s_OPENGL; static PyObject *__pyx_n_s_POWERSTATE_CHARGED; static PyObject *__pyx_n_s_POWERSTATE_CHARGING; static PyObject *__pyx_n_s_POWERSTATE_NO_BATTERY; static PyObject *__pyx_n_s_POWERSTATE_ON_BATTERY; static PyObject *__pyx_n_s_POWERSTATE_UNKNOWN; static PyObject *__pyx_n_s_QUIT; static PyObject *__pyx_n_s_RENDER_TARGETS_RESET; static PyObject *__pyx_n_s_RESIZABLE; static PyObject *__pyx_n_s_RLEACCEL; static PyObject *__pyx_n_s_Rect; static PyObject *__pyx_n_s_SCRAP_TEXT; static PyObject *__pyx_n_s_SDL_VERSION_TUPLE; static PyObject *__pyx_n_s_SRCALPHA; static PyObject *__pyx_n_s_SRCCOLORKEY; static PyObject *__pyx_n_s_SWSURFACE; static PyObject *__pyx_n_s_SYSWMEVENT; static PyObject *__pyx_n_s_TEXTEDITING; static PyObject *__pyx_n_s_TEXTINPUT; static PyObject *__pyx_n_s_TOUCH_MOUSEID; static PyObject *__pyx_n_s_USEREVENT; static PyObject *__pyx_n_s_VIDEOEXPOSE; static PyObject *__pyx_n_s_VIDEORESIZE; static PyObject *__pyx_n_s_WINDOWEVENT; static PyObject *__pyx_n_s_WINDOWPOS_CENTERED; static PyObject *__pyx_n_s_WINDOWPOS_UNDEFINED; static PyObject *__pyx_n_s_WINDOW_ALLOW_HIGHDPI; static PyObject *__pyx_n_s_WINDOW_BORDERLESS; static PyObject *__pyx_n_s_WINDOW_FOREIGN; static PyObject *__pyx_n_s_WINDOW_FULLSCREEN; static PyObject *__pyx_n_s_WINDOW_FULLSCREEN_DESKTOP; static PyObject *__pyx_n_s_WINDOW_HIDDEN; static PyObject *__pyx_n_s_WINDOW_INPUT_FOCUS; static PyObject *__pyx_n_s_WINDOW_INPUT_GRABBED; static PyObject *__pyx_n_s_WINDOW_MAXIMIZED; static PyObject *__pyx_n_s_WINDOW_MINIMIZED; static PyObject *__pyx_n_s_WINDOW_NOFRAME; static PyObject *__pyx_n_s_WINDOW_OPENGL; static PyObject *__pyx_n_s_WINDOW_RESIZABLE; static PyObject *__pyx_n_s_WINDOW_SHOWN; static PyObject *__pyx_n_s_import; static PyObject *__pyx_n_s_main; static PyObject *__pyx_n_s_pygame_sdl2_color; static PyObject *__pyx_n_s_pygame_sdl2_rect; static PyObject *__pyx_n_s_test; static PyObject *__pyx_kp_u_text_plain; static PyObject *__pyx_n_s_update; static PyObject *__pyx_int_0; static PyObject *__pyx_int_1; static PyObject *__pyx_int_2; static PyObject *__pyx_int_3; static PyObject *__pyx_int_4; static PyObject *__pyx_int_5; static PyObject *__pyx_int_6; static PyObject *__pyx_int_7; static PyObject *__pyx_int_8; static PyObject *__pyx_int_9; static PyObject *__pyx_int_16; static PyObject *__pyx_int_17; static PyObject *__pyx_int_1073741824; static PyObject *__pyx_int_2147483648; static PyObject *__pyx_int_neg_1; static PyMethodDef __pyx_methods[] = { {0, 0, 0, 0} }; #if PY_MAJOR_VERSION >= 3 static struct PyModuleDef __pyx_moduledef = { #if PY_VERSION_HEX < 0x03020000 { PyObject_HEAD_INIT(NULL) NULL, 0, NULL }, #else PyModuleDef_HEAD_INIT, #endif "locals", 0, /* m_doc */ -1, /* m_size */ __pyx_methods /* m_methods */, NULL, /* m_reload */ NULL, /* m_traverse */ NULL, /* m_clear */ NULL /* m_free */ }; #endif static __Pyx_StringTabEntry __pyx_string_tab[] = { {&__pyx_n_s_ACTIVEEVENT, __pyx_k_ACTIVEEVENT, sizeof(__pyx_k_ACTIVEEVENT), 0, 0, 1, 1}, {&__pyx_n_s_APP_DIDENTERBACKGROUND, __pyx_k_APP_DIDENTERBACKGROUND, sizeof(__pyx_k_APP_DIDENTERBACKGROUND), 0, 0, 1, 1}, {&__pyx_n_s_APP_DIDENTERFOREGROUND, __pyx_k_APP_DIDENTERFOREGROUND, sizeof(__pyx_k_APP_DIDENTERFOREGROUND), 0, 0, 1, 1}, {&__pyx_n_s_APP_LOWMEMORY, __pyx_k_APP_LOWMEMORY, sizeof(__pyx_k_APP_LOWMEMORY), 0, 0, 1, 1}, {&__pyx_n_s_APP_TERMINATING, __pyx_k_APP_TERMINATING, sizeof(__pyx_k_APP_TERMINATING), 0, 0, 1, 1}, {&__pyx_n_s_APP_WILLENTERBACKGROUND, __pyx_k_APP_WILLENTERBACKGROUND, sizeof(__pyx_k_APP_WILLENTERBACKGROUND), 0, 0, 1, 1}, {&__pyx_n_s_APP_WILLENTERFOREGROUND, __pyx_k_APP_WILLENTERFOREGROUND, sizeof(__pyx_k_APP_WILLENTERFOREGROUND), 0, 0, 1, 1}, {&__pyx_n_s_BIG_ENDIAN, __pyx_k_BIG_ENDIAN, sizeof(__pyx_k_BIG_ENDIAN), 0, 0, 1, 1}, {&__pyx_n_s_BLEND_ADD, __pyx_k_BLEND_ADD, sizeof(__pyx_k_BLEND_ADD), 0, 0, 1, 1}, {&__pyx_n_s_BLEND_MAX, __pyx_k_BLEND_MAX, sizeof(__pyx_k_BLEND_MAX), 0, 0, 1, 1}, {&__pyx_n_s_BLEND_MIN, __pyx_k_BLEND_MIN, sizeof(__pyx_k_BLEND_MIN), 0, 0, 1, 1}, {&__pyx_n_s_BLEND_MULT, __pyx_k_BLEND_MULT, sizeof(__pyx_k_BLEND_MULT), 0, 0, 1, 1}, {&__pyx_n_s_BLEND_PREMULTIPLIED, __pyx_k_BLEND_PREMULTIPLIED, sizeof(__pyx_k_BLEND_PREMULTIPLIED), 0, 0, 1, 1}, {&__pyx_n_s_BLEND_RGBA_ADD, __pyx_k_BLEND_RGBA_ADD, sizeof(__pyx_k_BLEND_RGBA_ADD), 0, 0, 1, 1}, {&__pyx_n_s_BLEND_RGBA_MAX, __pyx_k_BLEND_RGBA_MAX, sizeof(__pyx_k_BLEND_RGBA_MAX), 0, 0, 1, 1}, {&__pyx_n_s_BLEND_RGBA_MIN, __pyx_k_BLEND_RGBA_MIN, sizeof(__pyx_k_BLEND_RGBA_MIN), 0, 0, 1, 1}, {&__pyx_n_s_BLEND_RGBA_MULT, __pyx_k_BLEND_RGBA_MULT, sizeof(__pyx_k_BLEND_RGBA_MULT), 0, 0, 1, 1}, {&__pyx_n_s_BLEND_RGBA_SUB, __pyx_k_BLEND_RGBA_SUB, sizeof(__pyx_k_BLEND_RGBA_SUB), 0, 0, 1, 1}, {&__pyx_n_s_BLEND_RGB_ADD, __pyx_k_BLEND_RGB_ADD, sizeof(__pyx_k_BLEND_RGB_ADD), 0, 0, 1, 1}, {&__pyx_n_s_BLEND_RGB_MAX, __pyx_k_BLEND_RGB_MAX, sizeof(__pyx_k_BLEND_RGB_MAX), 0, 0, 1, 1}, {&__pyx_n_s_BLEND_RGB_MIN, __pyx_k_BLEND_RGB_MIN, sizeof(__pyx_k_BLEND_RGB_MIN), 0, 0, 1, 1}, {&__pyx_n_s_BLEND_RGB_MULT, __pyx_k_BLEND_RGB_MULT, sizeof(__pyx_k_BLEND_RGB_MULT), 0, 0, 1, 1}, {&__pyx_n_s_BLEND_RGB_SUB, __pyx_k_BLEND_RGB_SUB, sizeof(__pyx_k_BLEND_RGB_SUB), 0, 0, 1, 1}, {&__pyx_n_s_BLEND_SUB, __pyx_k_BLEND_SUB, sizeof(__pyx_k_BLEND_SUB), 0, 0, 1, 1}, {&__pyx_n_s_BYTEORDER, __pyx_k_BYTEORDER, sizeof(__pyx_k_BYTEORDER), 0, 0, 1, 1}, {&__pyx_n_s_CLIPBOARDUPDATE, __pyx_k_CLIPBOARDUPDATE, sizeof(__pyx_k_CLIPBOARDUPDATE), 0, 0, 1, 1}, {&__pyx_n_s_CONTROLLERAXISMOTION, __pyx_k_CONTROLLERAXISMOTION, sizeof(__pyx_k_CONTROLLERAXISMOTION), 0, 0, 1, 1}, {&__pyx_n_s_CONTROLLERBUTTONDOWN, __pyx_k_CONTROLLERBUTTONDOWN, sizeof(__pyx_k_CONTROLLERBUTTONDOWN), 0, 0, 1, 1}, {&__pyx_n_s_CONTROLLERBUTTONUP, __pyx_k_CONTROLLERBUTTONUP, sizeof(__pyx_k_CONTROLLERBUTTONUP), 0, 0, 1, 1}, {&__pyx_n_s_CONTROLLERDEVICEADDED, __pyx_k_CONTROLLERDEVICEADDED, sizeof(__pyx_k_CONTROLLERDEVICEADDED), 0, 0, 1, 1}, {&__pyx_n_s_CONTROLLERDEVICEREMAPPED, __pyx_k_CONTROLLERDEVICEREMAPPED, sizeof(__pyx_k_CONTROLLERDEVICEREMAPPED), 0, 0, 1, 1}, {&__pyx_n_s_CONTROLLERDEVICEREMOVED, __pyx_k_CONTROLLERDEVICEREMOVED, sizeof(__pyx_k_CONTROLLERDEVICEREMOVED), 0, 0, 1, 1}, {&__pyx_n_s_CONTROLLER_AXIS_INVALID, __pyx_k_CONTROLLER_AXIS_INVALID, sizeof(__pyx_k_CONTROLLER_AXIS_INVALID), 0, 0, 1, 1}, {&__pyx_n_s_CONTROLLER_AXIS_LEFTX, __pyx_k_CONTROLLER_AXIS_LEFTX, sizeof(__pyx_k_CONTROLLER_AXIS_LEFTX), 0, 0, 1, 1}, {&__pyx_n_s_CONTROLLER_AXIS_LEFTY, __pyx_k_CONTROLLER_AXIS_LEFTY, sizeof(__pyx_k_CONTROLLER_AXIS_LEFTY), 0, 0, 1, 1}, {&__pyx_n_s_CONTROLLER_AXIS_MAX, __pyx_k_CONTROLLER_AXIS_MAX, sizeof(__pyx_k_CONTROLLER_AXIS_MAX), 0, 0, 1, 1}, {&__pyx_n_s_CONTROLLER_AXIS_RIGHTX, __pyx_k_CONTROLLER_AXIS_RIGHTX, sizeof(__pyx_k_CONTROLLER_AXIS_RIGHTX), 0, 0, 1, 1}, {&__pyx_n_s_CONTROLLER_AXIS_RIGHTY, __pyx_k_CONTROLLER_AXIS_RIGHTY, sizeof(__pyx_k_CONTROLLER_AXIS_RIGHTY), 0, 0, 1, 1}, {&__pyx_n_s_CONTROLLER_AXIS_TRIGGERLEFT, __pyx_k_CONTROLLER_AXIS_TRIGGERLEFT, sizeof(__pyx_k_CONTROLLER_AXIS_TRIGGERLEFT), 0, 0, 1, 1}, {&__pyx_n_s_CONTROLLER_AXIS_TRIGGERRIGHT, __pyx_k_CONTROLLER_AXIS_TRIGGERRIGHT, sizeof(__pyx_k_CONTROLLER_AXIS_TRIGGERRIGHT), 0, 0, 1, 1}, {&__pyx_n_s_CONTROLLER_BUTTON_A, __pyx_k_CONTROLLER_BUTTON_A, sizeof(__pyx_k_CONTROLLER_BUTTON_A), 0, 0, 1, 1}, {&__pyx_n_s_CONTROLLER_BUTTON_B, __pyx_k_CONTROLLER_BUTTON_B, sizeof(__pyx_k_CONTROLLER_BUTTON_B), 0, 0, 1, 1}, {&__pyx_n_s_CONTROLLER_BUTTON_BACK, __pyx_k_CONTROLLER_BUTTON_BACK, sizeof(__pyx_k_CONTROLLER_BUTTON_BACK), 0, 0, 1, 1}, {&__pyx_n_s_CONTROLLER_BUTTON_DPAD_DOWN, __pyx_k_CONTROLLER_BUTTON_DPAD_DOWN, sizeof(__pyx_k_CONTROLLER_BUTTON_DPAD_DOWN), 0, 0, 1, 1}, {&__pyx_n_s_CONTROLLER_BUTTON_DPAD_LEFT, __pyx_k_CONTROLLER_BUTTON_DPAD_LEFT, sizeof(__pyx_k_CONTROLLER_BUTTON_DPAD_LEFT), 0, 0, 1, 1}, {&__pyx_n_s_CONTROLLER_BUTTON_DPAD_RIGHT, __pyx_k_CONTROLLER_BUTTON_DPAD_RIGHT, sizeof(__pyx_k_CONTROLLER_BUTTON_DPAD_RIGHT), 0, 0, 1, 1}, {&__pyx_n_s_CONTROLLER_BUTTON_DPAD_UP, __pyx_k_CONTROLLER_BUTTON_DPAD_UP, sizeof(__pyx_k_CONTROLLER_BUTTON_DPAD_UP), 0, 0, 1, 1}, {&__pyx_n_s_CONTROLLER_BUTTON_GUIDE, __pyx_k_CONTROLLER_BUTTON_GUIDE, sizeof(__pyx_k_CONTROLLER_BUTTON_GUIDE), 0, 0, 1, 1}, {&__pyx_n_s_CONTROLLER_BUTTON_INVALID, __pyx_k_CONTROLLER_BUTTON_INVALID, sizeof(__pyx_k_CONTROLLER_BUTTON_INVALID), 0, 0, 1, 1}, {&__pyx_n_s_CONTROLLER_BUTTON_LEFTSHOULDER, __pyx_k_CONTROLLER_BUTTON_LEFTSHOULDER, sizeof(__pyx_k_CONTROLLER_BUTTON_LEFTSHOULDER), 0, 0, 1, 1}, {&__pyx_n_s_CONTROLLER_BUTTON_LEFTSTICK, __pyx_k_CONTROLLER_BUTTON_LEFTSTICK, sizeof(__pyx_k_CONTROLLER_BUTTON_LEFTSTICK), 0, 0, 1, 1}, {&__pyx_n_s_CONTROLLER_BUTTON_MAX, __pyx_k_CONTROLLER_BUTTON_MAX, sizeof(__pyx_k_CONTROLLER_BUTTON_MAX), 0, 0, 1, 1}, {&__pyx_n_s_CONTROLLER_BUTTON_RIGHTSHOULDER, __pyx_k_CONTROLLER_BUTTON_RIGHTSHOULDER, sizeof(__pyx_k_CONTROLLER_BUTTON_RIGHTSHOULDER), 0, 0, 1, 1}, {&__pyx_n_s_CONTROLLER_BUTTON_RIGHTSTICK, __pyx_k_CONTROLLER_BUTTON_RIGHTSTICK, sizeof(__pyx_k_CONTROLLER_BUTTON_RIGHTSTICK), 0, 0, 1, 1}, {&__pyx_n_s_CONTROLLER_BUTTON_START, __pyx_k_CONTROLLER_BUTTON_START, sizeof(__pyx_k_CONTROLLER_BUTTON_START), 0, 0, 1, 1}, {&__pyx_n_s_CONTROLLER_BUTTON_X, __pyx_k_CONTROLLER_BUTTON_X, sizeof(__pyx_k_CONTROLLER_BUTTON_X), 0, 0, 1, 1}, {&__pyx_n_s_CONTROLLER_BUTTON_Y, __pyx_k_CONTROLLER_BUTTON_Y, sizeof(__pyx_k_CONTROLLER_BUTTON_Y), 0, 0, 1, 1}, {&__pyx_n_s_Color, __pyx_k_Color, sizeof(__pyx_k_Color), 0, 0, 1, 1}, {&__pyx_n_s_DOLLARGESTURE, __pyx_k_DOLLARGESTURE, sizeof(__pyx_k_DOLLARGESTURE), 0, 0, 1, 1}, {&__pyx_n_s_DOLLARRECORD, __pyx_k_DOLLARRECORD, sizeof(__pyx_k_DOLLARRECORD), 0, 0, 1, 1}, {&__pyx_n_s_DOUBLEBUF, __pyx_k_DOUBLEBUF, sizeof(__pyx_k_DOUBLEBUF), 0, 0, 1, 1}, {&__pyx_n_s_DROPFILE, __pyx_k_DROPFILE, sizeof(__pyx_k_DROPFILE), 0, 0, 1, 1}, {&__pyx_n_s_FINGERDOWN, __pyx_k_FINGERDOWN, sizeof(__pyx_k_FINGERDOWN), 0, 0, 1, 1}, {&__pyx_n_s_FINGERMOTION, __pyx_k_FINGERMOTION, sizeof(__pyx_k_FINGERMOTION), 0, 0, 1, 1}, {&__pyx_n_s_FINGERUP, __pyx_k_FINGERUP, sizeof(__pyx_k_FINGERUP), 0, 0, 1, 1}, {&__pyx_n_s_FULLSCREEN, __pyx_k_FULLSCREEN, sizeof(__pyx_k_FULLSCREEN), 0, 0, 1, 1}, {&__pyx_n_s_GL_ACCELERATED_VISUAL, __pyx_k_GL_ACCELERATED_VISUAL, sizeof(__pyx_k_GL_ACCELERATED_VISUAL), 0, 0, 1, 1}, {&__pyx_n_s_GL_ACCUM_ALPHA_SIZE, __pyx_k_GL_ACCUM_ALPHA_SIZE, sizeof(__pyx_k_GL_ACCUM_ALPHA_SIZE), 0, 0, 1, 1}, {&__pyx_n_s_GL_ACCUM_BLUE_SIZE, __pyx_k_GL_ACCUM_BLUE_SIZE, sizeof(__pyx_k_GL_ACCUM_BLUE_SIZE), 0, 0, 1, 1}, {&__pyx_n_s_GL_ACCUM_GREEN_SIZE, __pyx_k_GL_ACCUM_GREEN_SIZE, sizeof(__pyx_k_GL_ACCUM_GREEN_SIZE), 0, 0, 1, 1}, {&__pyx_n_s_GL_ACCUM_RED_SIZE, __pyx_k_GL_ACCUM_RED_SIZE, sizeof(__pyx_k_GL_ACCUM_RED_SIZE), 0, 0, 1, 1}, {&__pyx_n_s_GL_ALPHA_SIZE, __pyx_k_GL_ALPHA_SIZE, sizeof(__pyx_k_GL_ALPHA_SIZE), 0, 0, 1, 1}, {&__pyx_n_s_GL_BLUE_SIZE, __pyx_k_GL_BLUE_SIZE, sizeof(__pyx_k_GL_BLUE_SIZE), 0, 0, 1, 1}, {&__pyx_n_s_GL_BUFFER_SIZE, __pyx_k_GL_BUFFER_SIZE, sizeof(__pyx_k_GL_BUFFER_SIZE), 0, 0, 1, 1}, {&__pyx_n_s_GL_CONTEXT_EGL, __pyx_k_GL_CONTEXT_EGL, sizeof(__pyx_k_GL_CONTEXT_EGL), 0, 0, 1, 1}, {&__pyx_n_s_GL_CONTEXT_FLAGS, __pyx_k_GL_CONTEXT_FLAGS, sizeof(__pyx_k_GL_CONTEXT_FLAGS), 0, 0, 1, 1}, {&__pyx_n_s_GL_CONTEXT_MAJOR_VERSION, __pyx_k_GL_CONTEXT_MAJOR_VERSION, sizeof(__pyx_k_GL_CONTEXT_MAJOR_VERSION), 0, 0, 1, 1}, {&__pyx_n_s_GL_CONTEXT_MINOR_VERSION, __pyx_k_GL_CONTEXT_MINOR_VERSION, sizeof(__pyx_k_GL_CONTEXT_MINOR_VERSION), 0, 0, 1, 1}, {&__pyx_n_s_GL_CONTEXT_PROFILE_MASK, __pyx_k_GL_CONTEXT_PROFILE_MASK, sizeof(__pyx_k_GL_CONTEXT_PROFILE_MASK), 0, 0, 1, 1}, {&__pyx_n_s_GL_DEPTH_SIZE, __pyx_k_GL_DEPTH_SIZE, sizeof(__pyx_k_GL_DEPTH_SIZE), 0, 0, 1, 1}, {&__pyx_n_s_GL_DOUBLEBUFFER, __pyx_k_GL_DOUBLEBUFFER, sizeof(__pyx_k_GL_DOUBLEBUFFER), 0, 0, 1, 1}, {&__pyx_n_s_GL_FRAMEBUFFER_SRGB_CAPABLE, __pyx_k_GL_FRAMEBUFFER_SRGB_CAPABLE, sizeof(__pyx_k_GL_FRAMEBUFFER_SRGB_CAPABLE), 0, 0, 1, 1}, {&__pyx_n_s_GL_GREEN_SIZE, __pyx_k_GL_GREEN_SIZE, sizeof(__pyx_k_GL_GREEN_SIZE), 0, 0, 1, 1}, {&__pyx_n_s_GL_MULTISAMPLEBUFFERS, __pyx_k_GL_MULTISAMPLEBUFFERS, sizeof(__pyx_k_GL_MULTISAMPLEBUFFERS), 0, 0, 1, 1}, {&__pyx_n_s_GL_MULTISAMPLESAMPLES, __pyx_k_GL_MULTISAMPLESAMPLES, sizeof(__pyx_k_GL_MULTISAMPLESAMPLES), 0, 0, 1, 1}, {&__pyx_n_s_GL_RED_SIZE, __pyx_k_GL_RED_SIZE, sizeof(__pyx_k_GL_RED_SIZE), 0, 0, 1, 1}, {&__pyx_n_s_GL_RETAINED_BACKING, __pyx_k_GL_RETAINED_BACKING, sizeof(__pyx_k_GL_RETAINED_BACKING), 0, 0, 1, 1}, {&__pyx_n_s_GL_SHARE_WITH_CURRENT_CONTEXT, __pyx_k_GL_SHARE_WITH_CURRENT_CONTEXT, sizeof(__pyx_k_GL_SHARE_WITH_CURRENT_CONTEXT), 0, 0, 1, 1}, {&__pyx_n_s_GL_STENCIL_SIZE, __pyx_k_GL_STENCIL_SIZE, sizeof(__pyx_k_GL_STENCIL_SIZE), 0, 0, 1, 1}, {&__pyx_n_s_GL_STEREO, __pyx_k_GL_STEREO, sizeof(__pyx_k_GL_STEREO), 0, 0, 1, 1}, {&__pyx_n_s_GL_SWAP_CONTROL, __pyx_k_GL_SWAP_CONTROL, sizeof(__pyx_k_GL_SWAP_CONTROL), 0, 0, 1, 1}, {&__pyx_n_s_HWSURFACE, __pyx_k_HWSURFACE, sizeof(__pyx_k_HWSURFACE), 0, 0, 1, 1}, {&__pyx_n_s_JOYAXISMOTION, __pyx_k_JOYAXISMOTION, sizeof(__pyx_k_JOYAXISMOTION), 0, 0, 1, 1}, {&__pyx_n_s_JOYBALLMOTION, __pyx_k_JOYBALLMOTION, sizeof(__pyx_k_JOYBALLMOTION), 0, 0, 1, 1}, {&__pyx_n_s_JOYBUTTONDOWN, __pyx_k_JOYBUTTONDOWN, sizeof(__pyx_k_JOYBUTTONDOWN), 0, 0, 1, 1}, {&__pyx_n_s_JOYBUTTONUP, __pyx_k_JOYBUTTONUP, sizeof(__pyx_k_JOYBUTTONUP), 0, 0, 1, 1}, {&__pyx_n_s_JOYDEVICEADDED, __pyx_k_JOYDEVICEADDED, sizeof(__pyx_k_JOYDEVICEADDED), 0, 0, 1, 1}, {&__pyx_n_s_JOYDEVICEREMOVED, __pyx_k_JOYDEVICEREMOVED, sizeof(__pyx_k_JOYDEVICEREMOVED), 0, 0, 1, 1}, {&__pyx_n_s_JOYHATMOTION, __pyx_k_JOYHATMOTION, sizeof(__pyx_k_JOYHATMOTION), 0, 0, 1, 1}, {&__pyx_n_s_KEYDOWN, __pyx_k_KEYDOWN, sizeof(__pyx_k_KEYDOWN), 0, 0, 1, 1}, {&__pyx_n_s_KEYUP, __pyx_k_KEYUP, sizeof(__pyx_k_KEYUP), 0, 0, 1, 1}, {&__pyx_n_s_KMOD_ALT, __pyx_k_KMOD_ALT, sizeof(__pyx_k_KMOD_ALT), 0, 0, 1, 1}, {&__pyx_n_s_KMOD_CAPS, __pyx_k_KMOD_CAPS, sizeof(__pyx_k_KMOD_CAPS), 0, 0, 1, 1}, {&__pyx_n_s_KMOD_CTRL, __pyx_k_KMOD_CTRL, sizeof(__pyx_k_KMOD_CTRL), 0, 0, 1, 1}, {&__pyx_n_s_KMOD_GUI, __pyx_k_KMOD_GUI, sizeof(__pyx_k_KMOD_GUI), 0, 0, 1, 1}, {&__pyx_n_s_KMOD_LALT, __pyx_k_KMOD_LALT, sizeof(__pyx_k_KMOD_LALT), 0, 0, 1, 1}, {&__pyx_n_s_KMOD_LCTRL, __pyx_k_KMOD_LCTRL, sizeof(__pyx_k_KMOD_LCTRL), 0, 0, 1, 1}, {&__pyx_n_s_KMOD_LGUI, __pyx_k_KMOD_LGUI, sizeof(__pyx_k_KMOD_LGUI), 0, 0, 1, 1}, {&__pyx_n_s_KMOD_LMETA, __pyx_k_KMOD_LMETA, sizeof(__pyx_k_KMOD_LMETA), 0, 0, 1, 1}, {&__pyx_n_s_KMOD_LSHIFT, __pyx_k_KMOD_LSHIFT, sizeof(__pyx_k_KMOD_LSHIFT), 0, 0, 1, 1}, {&__pyx_n_s_KMOD_META, __pyx_k_KMOD_META, sizeof(__pyx_k_KMOD_META), 0, 0, 1, 1}, {&__pyx_n_s_KMOD_MODE, __pyx_k_KMOD_MODE, sizeof(__pyx_k_KMOD_MODE), 0, 0, 1, 1}, {&__pyx_n_s_KMOD_NONE, __pyx_k_KMOD_NONE, sizeof(__pyx_k_KMOD_NONE), 0, 0, 1, 1}, {&__pyx_n_s_KMOD_NUM, __pyx_k_KMOD_NUM, sizeof(__pyx_k_KMOD_NUM), 0, 0, 1, 1}, {&__pyx_n_s_KMOD_RALT, __pyx_k_KMOD_RALT, sizeof(__pyx_k_KMOD_RALT), 0, 0, 1, 1}, {&__pyx_n_s_KMOD_RCTRL, __pyx_k_KMOD_RCTRL, sizeof(__pyx_k_KMOD_RCTRL), 0, 0, 1, 1}, {&__pyx_n_s_KMOD_RGUI, __pyx_k_KMOD_RGUI, sizeof(__pyx_k_KMOD_RGUI), 0, 0, 1, 1}, {&__pyx_n_s_KMOD_RMETA, __pyx_k_KMOD_RMETA, sizeof(__pyx_k_KMOD_RMETA), 0, 0, 1, 1}, {&__pyx_n_s_KMOD_RSHIFT, __pyx_k_KMOD_RSHIFT, sizeof(__pyx_k_KMOD_RSHIFT), 0, 0, 1, 1}, {&__pyx_n_s_KMOD_SHIFT, __pyx_k_KMOD_SHIFT, sizeof(__pyx_k_KMOD_SHIFT), 0, 0, 1, 1}, {&__pyx_n_s_K_0, __pyx_k_K_0, sizeof(__pyx_k_K_0), 0, 0, 1, 1}, {&__pyx_n_s_K_1, __pyx_k_K_1, sizeof(__pyx_k_K_1), 0, 0, 1, 1}, {&__pyx_n_s_K_2, __pyx_k_K_2, sizeof(__pyx_k_K_2), 0, 0, 1, 1}, {&__pyx_n_s_K_3, __pyx_k_K_3, sizeof(__pyx_k_K_3), 0, 0, 1, 1}, {&__pyx_n_s_K_4, __pyx_k_K_4, sizeof(__pyx_k_K_4), 0, 0, 1, 1}, {&__pyx_n_s_K_5, __pyx_k_K_5, sizeof(__pyx_k_K_5), 0, 0, 1, 1}, {&__pyx_n_s_K_6, __pyx_k_K_6, sizeof(__pyx_k_K_6), 0, 0, 1, 1}, {&__pyx_n_s_K_7, __pyx_k_K_7, sizeof(__pyx_k_K_7), 0, 0, 1, 1}, {&__pyx_n_s_K_8, __pyx_k_K_8, sizeof(__pyx_k_K_8), 0, 0, 1, 1}, {&__pyx_n_s_K_9, __pyx_k_K_9, sizeof(__pyx_k_K_9), 0, 0, 1, 1}, {&__pyx_n_s_K_AC_BACK, __pyx_k_K_AC_BACK, sizeof(__pyx_k_K_AC_BACK), 0, 0, 1, 1}, {&__pyx_n_s_K_AC_BOOKMARKS, __pyx_k_K_AC_BOOKMARKS, sizeof(__pyx_k_K_AC_BOOKMARKS), 0, 0, 1, 1}, {&__pyx_n_s_K_AC_FORWARD, __pyx_k_K_AC_FORWARD, sizeof(__pyx_k_K_AC_FORWARD), 0, 0, 1, 1}, {&__pyx_n_s_K_AC_HOME, __pyx_k_K_AC_HOME, sizeof(__pyx_k_K_AC_HOME), 0, 0, 1, 1}, {&__pyx_n_s_K_AC_REFRESH, __pyx_k_K_AC_REFRESH, sizeof(__pyx_k_K_AC_REFRESH), 0, 0, 1, 1}, {&__pyx_n_s_K_AC_SEARCH, __pyx_k_K_AC_SEARCH, sizeof(__pyx_k_K_AC_SEARCH), 0, 0, 1, 1}, {&__pyx_n_s_K_AC_STOP, __pyx_k_K_AC_STOP, sizeof(__pyx_k_K_AC_STOP), 0, 0, 1, 1}, {&__pyx_n_s_K_AGAIN, __pyx_k_K_AGAIN, sizeof(__pyx_k_K_AGAIN), 0, 0, 1, 1}, {&__pyx_n_s_K_ALTERASE, __pyx_k_K_ALTERASE, sizeof(__pyx_k_K_ALTERASE), 0, 0, 1, 1}, {&__pyx_n_s_K_AMPERSAND, __pyx_k_K_AMPERSAND, sizeof(__pyx_k_K_AMPERSAND), 0, 0, 1, 1}, {&__pyx_n_s_K_APPLICATION, __pyx_k_K_APPLICATION, sizeof(__pyx_k_K_APPLICATION), 0, 0, 1, 1}, {&__pyx_n_s_K_ASTERISK, __pyx_k_K_ASTERISK, sizeof(__pyx_k_K_ASTERISK), 0, 0, 1, 1}, {&__pyx_n_s_K_AT, __pyx_k_K_AT, sizeof(__pyx_k_K_AT), 0, 0, 1, 1}, {&__pyx_n_s_K_AUDIOMUTE, __pyx_k_K_AUDIOMUTE, sizeof(__pyx_k_K_AUDIOMUTE), 0, 0, 1, 1}, {&__pyx_n_s_K_AUDIONEXT, __pyx_k_K_AUDIONEXT, sizeof(__pyx_k_K_AUDIONEXT), 0, 0, 1, 1}, {&__pyx_n_s_K_AUDIOPLAY, __pyx_k_K_AUDIOPLAY, sizeof(__pyx_k_K_AUDIOPLAY), 0, 0, 1, 1}, {&__pyx_n_s_K_AUDIOPREV, __pyx_k_K_AUDIOPREV, sizeof(__pyx_k_K_AUDIOPREV), 0, 0, 1, 1}, {&__pyx_n_s_K_AUDIOSTOP, __pyx_k_K_AUDIOSTOP, sizeof(__pyx_k_K_AUDIOSTOP), 0, 0, 1, 1}, {&__pyx_n_s_K_BACKQUOTE, __pyx_k_K_BACKQUOTE, sizeof(__pyx_k_K_BACKQUOTE), 0, 0, 1, 1}, {&__pyx_n_s_K_BACKSLASH, __pyx_k_K_BACKSLASH, sizeof(__pyx_k_K_BACKSLASH), 0, 0, 1, 1}, {&__pyx_n_s_K_BACKSPACE, __pyx_k_K_BACKSPACE, sizeof(__pyx_k_K_BACKSPACE), 0, 0, 1, 1}, {&__pyx_n_s_K_BREAK, __pyx_k_K_BREAK, sizeof(__pyx_k_K_BREAK), 0, 0, 1, 1}, {&__pyx_n_s_K_BRIGHTNESSDOWN, __pyx_k_K_BRIGHTNESSDOWN, sizeof(__pyx_k_K_BRIGHTNESSDOWN), 0, 0, 1, 1}, {&__pyx_n_s_K_BRIGHTNESSUP, __pyx_k_K_BRIGHTNESSUP, sizeof(__pyx_k_K_BRIGHTNESSUP), 0, 0, 1, 1}, {&__pyx_n_s_K_CALCULATOR, __pyx_k_K_CALCULATOR, sizeof(__pyx_k_K_CALCULATOR), 0, 0, 1, 1}, {&__pyx_n_s_K_CANCEL, __pyx_k_K_CANCEL, sizeof(__pyx_k_K_CANCEL), 0, 0, 1, 1}, {&__pyx_n_s_K_CAPSLOCK, __pyx_k_K_CAPSLOCK, sizeof(__pyx_k_K_CAPSLOCK), 0, 0, 1, 1}, {&__pyx_n_s_K_CARET, __pyx_k_K_CARET, sizeof(__pyx_k_K_CARET), 0, 0, 1, 1}, {&__pyx_n_s_K_CLEAR, __pyx_k_K_CLEAR, sizeof(__pyx_k_K_CLEAR), 0, 0, 1, 1}, {&__pyx_n_s_K_CLEARAGAIN, __pyx_k_K_CLEARAGAIN, sizeof(__pyx_k_K_CLEARAGAIN), 0, 0, 1, 1}, {&__pyx_n_s_K_COLON, __pyx_k_K_COLON, sizeof(__pyx_k_K_COLON), 0, 0, 1, 1}, {&__pyx_n_s_K_COMMA, __pyx_k_K_COMMA, sizeof(__pyx_k_K_COMMA), 0, 0, 1, 1}, {&__pyx_n_s_K_COMPUTER, __pyx_k_K_COMPUTER, sizeof(__pyx_k_K_COMPUTER), 0, 0, 1, 1}, {&__pyx_n_s_K_COPY, __pyx_k_K_COPY, sizeof(__pyx_k_K_COPY), 0, 0, 1, 1}, {&__pyx_n_s_K_CRSEL, __pyx_k_K_CRSEL, sizeof(__pyx_k_K_CRSEL), 0, 0, 1, 1}, {&__pyx_n_s_K_CURRENCYSUBUNIT, __pyx_k_K_CURRENCYSUBUNIT, sizeof(__pyx_k_K_CURRENCYSUBUNIT), 0, 0, 1, 1}, {&__pyx_n_s_K_CURRENCYUNIT, __pyx_k_K_CURRENCYUNIT, sizeof(__pyx_k_K_CURRENCYUNIT), 0, 0, 1, 1}, {&__pyx_n_s_K_CUT, __pyx_k_K_CUT, sizeof(__pyx_k_K_CUT), 0, 0, 1, 1}, {&__pyx_n_s_K_DECIMALSEPARATOR, __pyx_k_K_DECIMALSEPARATOR, sizeof(__pyx_k_K_DECIMALSEPARATOR), 0, 0, 1, 1}, {&__pyx_n_s_K_DELETE, __pyx_k_K_DELETE, sizeof(__pyx_k_K_DELETE), 0, 0, 1, 1}, {&__pyx_n_s_K_DISPLAYSWITCH, __pyx_k_K_DISPLAYSWITCH, sizeof(__pyx_k_K_DISPLAYSWITCH), 0, 0, 1, 1}, {&__pyx_n_s_K_DOLLAR, __pyx_k_K_DOLLAR, sizeof(__pyx_k_K_DOLLAR), 0, 0, 1, 1}, {&__pyx_n_s_K_DOWN, __pyx_k_K_DOWN, sizeof(__pyx_k_K_DOWN), 0, 0, 1, 1}, {&__pyx_n_s_K_EJECT, __pyx_k_K_EJECT, sizeof(__pyx_k_K_EJECT), 0, 0, 1, 1}, {&__pyx_n_s_K_END, __pyx_k_K_END, sizeof(__pyx_k_K_END), 0, 0, 1, 1}, {&__pyx_n_s_K_EQUALS, __pyx_k_K_EQUALS, sizeof(__pyx_k_K_EQUALS), 0, 0, 1, 1}, {&__pyx_n_s_K_ESCAPE, __pyx_k_K_ESCAPE, sizeof(__pyx_k_K_ESCAPE), 0, 0, 1, 1}, {&__pyx_n_s_K_EURO, __pyx_k_K_EURO, sizeof(__pyx_k_K_EURO), 0, 0, 1, 1}, {&__pyx_n_s_K_EXCLAIM, __pyx_k_K_EXCLAIM, sizeof(__pyx_k_K_EXCLAIM), 0, 0, 1, 1}, {&__pyx_n_s_K_EXECUTE, __pyx_k_K_EXECUTE, sizeof(__pyx_k_K_EXECUTE), 0, 0, 1, 1}, {&__pyx_n_s_K_EXSEL, __pyx_k_K_EXSEL, sizeof(__pyx_k_K_EXSEL), 0, 0, 1, 1}, {&__pyx_n_s_K_F1, __pyx_k_K_F1, sizeof(__pyx_k_K_F1), 0, 0, 1, 1}, {&__pyx_n_s_K_F10, __pyx_k_K_F10, sizeof(__pyx_k_K_F10), 0, 0, 1, 1}, {&__pyx_n_s_K_F11, __pyx_k_K_F11, sizeof(__pyx_k_K_F11), 0, 0, 1, 1}, {&__pyx_n_s_K_F12, __pyx_k_K_F12, sizeof(__pyx_k_K_F12), 0, 0, 1, 1}, {&__pyx_n_s_K_F13, __pyx_k_K_F13, sizeof(__pyx_k_K_F13), 0, 0, 1, 1}, {&__pyx_n_s_K_F14, __pyx_k_K_F14, sizeof(__pyx_k_K_F14), 0, 0, 1, 1}, {&__pyx_n_s_K_F15, __pyx_k_K_F15, sizeof(__pyx_k_K_F15), 0, 0, 1, 1}, {&__pyx_n_s_K_F16, __pyx_k_K_F16, sizeof(__pyx_k_K_F16), 0, 0, 1, 1}, {&__pyx_n_s_K_F17, __pyx_k_K_F17, sizeof(__pyx_k_K_F17), 0, 0, 1, 1}, {&__pyx_n_s_K_F18, __pyx_k_K_F18, sizeof(__pyx_k_K_F18), 0, 0, 1, 1}, {&__pyx_n_s_K_F19, __pyx_k_K_F19, sizeof(__pyx_k_K_F19), 0, 0, 1, 1}, {&__pyx_n_s_K_F2, __pyx_k_K_F2, sizeof(__pyx_k_K_F2), 0, 0, 1, 1}, {&__pyx_n_s_K_F20, __pyx_k_K_F20, sizeof(__pyx_k_K_F20), 0, 0, 1, 1}, {&__pyx_n_s_K_F21, __pyx_k_K_F21, sizeof(__pyx_k_K_F21), 0, 0, 1, 1}, {&__pyx_n_s_K_F22, __pyx_k_K_F22, sizeof(__pyx_k_K_F22), 0, 0, 1, 1}, {&__pyx_n_s_K_F23, __pyx_k_K_F23, sizeof(__pyx_k_K_F23), 0, 0, 1, 1}, {&__pyx_n_s_K_F24, __pyx_k_K_F24, sizeof(__pyx_k_K_F24), 0, 0, 1, 1}, {&__pyx_n_s_K_F3, __pyx_k_K_F3, sizeof(__pyx_k_K_F3), 0, 0, 1, 1}, {&__pyx_n_s_K_F4, __pyx_k_K_F4, sizeof(__pyx_k_K_F4), 0, 0, 1, 1}, {&__pyx_n_s_K_F5, __pyx_k_K_F5, sizeof(__pyx_k_K_F5), 0, 0, 1, 1}, {&__pyx_n_s_K_F6, __pyx_k_K_F6, sizeof(__pyx_k_K_F6), 0, 0, 1, 1}, {&__pyx_n_s_K_F7, __pyx_k_K_F7, sizeof(__pyx_k_K_F7), 0, 0, 1, 1}, {&__pyx_n_s_K_F8, __pyx_k_K_F8, sizeof(__pyx_k_K_F8), 0, 0, 1, 1}, {&__pyx_n_s_K_F9, __pyx_k_K_F9, sizeof(__pyx_k_K_F9), 0, 0, 1, 1}, {&__pyx_n_s_K_FIND, __pyx_k_K_FIND, sizeof(__pyx_k_K_FIND), 0, 0, 1, 1}, {&__pyx_n_s_K_FIRST, __pyx_k_K_FIRST, sizeof(__pyx_k_K_FIRST), 0, 0, 1, 1}, {&__pyx_n_s_K_GREATER, __pyx_k_K_GREATER, sizeof(__pyx_k_K_GREATER), 0, 0, 1, 1}, {&__pyx_n_s_K_HASH, __pyx_k_K_HASH, sizeof(__pyx_k_K_HASH), 0, 0, 1, 1}, {&__pyx_n_s_K_HELP, __pyx_k_K_HELP, sizeof(__pyx_k_K_HELP), 0, 0, 1, 1}, {&__pyx_n_s_K_HOME, __pyx_k_K_HOME, sizeof(__pyx_k_K_HOME), 0, 0, 1, 1}, {&__pyx_n_s_K_INSERT, __pyx_k_K_INSERT, sizeof(__pyx_k_K_INSERT), 0, 0, 1, 1}, {&__pyx_n_s_K_KBDILLUMDOWN, __pyx_k_K_KBDILLUMDOWN, sizeof(__pyx_k_K_KBDILLUMDOWN), 0, 0, 1, 1}, {&__pyx_n_s_K_KBDILLUMTOGGLE, __pyx_k_K_KBDILLUMTOGGLE, sizeof(__pyx_k_K_KBDILLUMTOGGLE), 0, 0, 1, 1}, {&__pyx_n_s_K_KBDILLUMUP, __pyx_k_K_KBDILLUMUP, sizeof(__pyx_k_K_KBDILLUMUP), 0, 0, 1, 1}, {&__pyx_n_s_K_KP0, __pyx_k_K_KP0, sizeof(__pyx_k_K_KP0), 0, 0, 1, 1}, {&__pyx_n_s_K_KP1, __pyx_k_K_KP1, sizeof(__pyx_k_K_KP1), 0, 0, 1, 1}, {&__pyx_n_s_K_KP2, __pyx_k_K_KP2, sizeof(__pyx_k_K_KP2), 0, 0, 1, 1}, {&__pyx_n_s_K_KP3, __pyx_k_K_KP3, sizeof(__pyx_k_K_KP3), 0, 0, 1, 1}, {&__pyx_n_s_K_KP4, __pyx_k_K_KP4, sizeof(__pyx_k_K_KP4), 0, 0, 1, 1}, {&__pyx_n_s_K_KP5, __pyx_k_K_KP5, sizeof(__pyx_k_K_KP5), 0, 0, 1, 1}, {&__pyx_n_s_K_KP6, __pyx_k_K_KP6, sizeof(__pyx_k_K_KP6), 0, 0, 1, 1}, {&__pyx_n_s_K_KP7, __pyx_k_K_KP7, sizeof(__pyx_k_K_KP7), 0, 0, 1, 1}, {&__pyx_n_s_K_KP8, __pyx_k_K_KP8, sizeof(__pyx_k_K_KP8), 0, 0, 1, 1}, {&__pyx_n_s_K_KP9, __pyx_k_K_KP9, sizeof(__pyx_k_K_KP9), 0, 0, 1, 1}, {&__pyx_n_s_K_KP_0, __pyx_k_K_KP_0, sizeof(__pyx_k_K_KP_0), 0, 0, 1, 1}, {&__pyx_n_s_K_KP_00, __pyx_k_K_KP_00, sizeof(__pyx_k_K_KP_00), 0, 0, 1, 1}, {&__pyx_n_s_K_KP_000, __pyx_k_K_KP_000, sizeof(__pyx_k_K_KP_000), 0, 0, 1, 1}, {&__pyx_n_s_K_KP_1, __pyx_k_K_KP_1, sizeof(__pyx_k_K_KP_1), 0, 0, 1, 1}, {&__pyx_n_s_K_KP_2, __pyx_k_K_KP_2, sizeof(__pyx_k_K_KP_2), 0, 0, 1, 1}, {&__pyx_n_s_K_KP_3, __pyx_k_K_KP_3, sizeof(__pyx_k_K_KP_3), 0, 0, 1, 1}, {&__pyx_n_s_K_KP_4, __pyx_k_K_KP_4, sizeof(__pyx_k_K_KP_4), 0, 0, 1, 1}, {&__pyx_n_s_K_KP_5, __pyx_k_K_KP_5, sizeof(__pyx_k_K_KP_5), 0, 0, 1, 1}, {&__pyx_n_s_K_KP_6, __pyx_k_K_KP_6, sizeof(__pyx_k_K_KP_6), 0, 0, 1, 1}, {&__pyx_n_s_K_KP_7, __pyx_k_K_KP_7, sizeof(__pyx_k_K_KP_7), 0, 0, 1, 1}, {&__pyx_n_s_K_KP_8, __pyx_k_K_KP_8, sizeof(__pyx_k_K_KP_8), 0, 0, 1, 1}, {&__pyx_n_s_K_KP_9, __pyx_k_K_KP_9, sizeof(__pyx_k_K_KP_9), 0, 0, 1, 1}, {&__pyx_n_s_K_KP_A, __pyx_k_K_KP_A, sizeof(__pyx_k_K_KP_A), 0, 0, 1, 1}, {&__pyx_n_s_K_KP_AMPERSAND, __pyx_k_K_KP_AMPERSAND, sizeof(__pyx_k_K_KP_AMPERSAND), 0, 0, 1, 1}, {&__pyx_n_s_K_KP_AT, __pyx_k_K_KP_AT, sizeof(__pyx_k_K_KP_AT), 0, 0, 1, 1}, {&__pyx_n_s_K_KP_B, __pyx_k_K_KP_B, sizeof(__pyx_k_K_KP_B), 0, 0, 1, 1}, {&__pyx_n_s_K_KP_BACKSPACE, __pyx_k_K_KP_BACKSPACE, sizeof(__pyx_k_K_KP_BACKSPACE), 0, 0, 1, 1}, {&__pyx_n_s_K_KP_BINARY, __pyx_k_K_KP_BINARY, sizeof(__pyx_k_K_KP_BINARY), 0, 0, 1, 1}, {&__pyx_n_s_K_KP_C, __pyx_k_K_KP_C, sizeof(__pyx_k_K_KP_C), 0, 0, 1, 1}, {&__pyx_n_s_K_KP_CLEAR, __pyx_k_K_KP_CLEAR, sizeof(__pyx_k_K_KP_CLEAR), 0, 0, 1, 1}, {&__pyx_n_s_K_KP_CLEARENTRY, __pyx_k_K_KP_CLEARENTRY, sizeof(__pyx_k_K_KP_CLEARENTRY), 0, 0, 1, 1}, {&__pyx_n_s_K_KP_COLON, __pyx_k_K_KP_COLON, sizeof(__pyx_k_K_KP_COLON), 0, 0, 1, 1}, {&__pyx_n_s_K_KP_COMMA, __pyx_k_K_KP_COMMA, sizeof(__pyx_k_K_KP_COMMA), 0, 0, 1, 1}, {&__pyx_n_s_K_KP_D, __pyx_k_K_KP_D, sizeof(__pyx_k_K_KP_D), 0, 0, 1, 1}, {&__pyx_n_s_K_KP_DBLAMPERSAND, __pyx_k_K_KP_DBLAMPERSAND, sizeof(__pyx_k_K_KP_DBLAMPERSAND), 0, 0, 1, 1}, {&__pyx_n_s_K_KP_DBLVERTICALBAR, __pyx_k_K_KP_DBLVERTICALBAR, sizeof(__pyx_k_K_KP_DBLVERTICALBAR), 0, 0, 1, 1}, {&__pyx_n_s_K_KP_DECIMAL, __pyx_k_K_KP_DECIMAL, sizeof(__pyx_k_K_KP_DECIMAL), 0, 0, 1, 1}, {&__pyx_n_s_K_KP_DIVIDE, __pyx_k_K_KP_DIVIDE, sizeof(__pyx_k_K_KP_DIVIDE), 0, 0, 1, 1}, {&__pyx_n_s_K_KP_E, __pyx_k_K_KP_E, sizeof(__pyx_k_K_KP_E), 0, 0, 1, 1}, {&__pyx_n_s_K_KP_ENTER, __pyx_k_K_KP_ENTER, sizeof(__pyx_k_K_KP_ENTER), 0, 0, 1, 1}, {&__pyx_n_s_K_KP_EQUALS, __pyx_k_K_KP_EQUALS, sizeof(__pyx_k_K_KP_EQUALS), 0, 0, 1, 1}, {&__pyx_n_s_K_KP_EQUALSAS400, __pyx_k_K_KP_EQUALSAS400, sizeof(__pyx_k_K_KP_EQUALSAS400), 0, 0, 1, 1}, {&__pyx_n_s_K_KP_EXCLAM, __pyx_k_K_KP_EXCLAM, sizeof(__pyx_k_K_KP_EXCLAM), 0, 0, 1, 1}, {&__pyx_n_s_K_KP_F, __pyx_k_K_KP_F, sizeof(__pyx_k_K_KP_F), 0, 0, 1, 1}, {&__pyx_n_s_K_KP_GREATER, __pyx_k_K_KP_GREATER, sizeof(__pyx_k_K_KP_GREATER), 0, 0, 1, 1}, {&__pyx_n_s_K_KP_HASH, __pyx_k_K_KP_HASH, sizeof(__pyx_k_K_KP_HASH), 0, 0, 1, 1}, {&__pyx_n_s_K_KP_HEXADECIMAL, __pyx_k_K_KP_HEXADECIMAL, sizeof(__pyx_k_K_KP_HEXADECIMAL), 0, 0, 1, 1}, {&__pyx_n_s_K_KP_LEFTBRACE, __pyx_k_K_KP_LEFTBRACE, sizeof(__pyx_k_K_KP_LEFTBRACE), 0, 0, 1, 1}, {&__pyx_n_s_K_KP_LEFTPAREN, __pyx_k_K_KP_LEFTPAREN, sizeof(__pyx_k_K_KP_LEFTPAREN), 0, 0, 1, 1}, {&__pyx_n_s_K_KP_LESS, __pyx_k_K_KP_LESS, sizeof(__pyx_k_K_KP_LESS), 0, 0, 1, 1}, {&__pyx_n_s_K_KP_MEMADD, __pyx_k_K_KP_MEMADD, sizeof(__pyx_k_K_KP_MEMADD), 0, 0, 1, 1}, {&__pyx_n_s_K_KP_MEMCLEAR, __pyx_k_K_KP_MEMCLEAR, sizeof(__pyx_k_K_KP_MEMCLEAR), 0, 0, 1, 1}, {&__pyx_n_s_K_KP_MEMDIVIDE, __pyx_k_K_KP_MEMDIVIDE, sizeof(__pyx_k_K_KP_MEMDIVIDE), 0, 0, 1, 1}, {&__pyx_n_s_K_KP_MEMMULTIPLY, __pyx_k_K_KP_MEMMULTIPLY, sizeof(__pyx_k_K_KP_MEMMULTIPLY), 0, 0, 1, 1}, {&__pyx_n_s_K_KP_MEMRECALL, __pyx_k_K_KP_MEMRECALL, sizeof(__pyx_k_K_KP_MEMRECALL), 0, 0, 1, 1}, {&__pyx_n_s_K_KP_MEMSTORE, __pyx_k_K_KP_MEMSTORE, sizeof(__pyx_k_K_KP_MEMSTORE), 0, 0, 1, 1}, {&__pyx_n_s_K_KP_MEMSUBTRACT, __pyx_k_K_KP_MEMSUBTRACT, sizeof(__pyx_k_K_KP_MEMSUBTRACT), 0, 0, 1, 1}, {&__pyx_n_s_K_KP_MINUS, __pyx_k_K_KP_MINUS, sizeof(__pyx_k_K_KP_MINUS), 0, 0, 1, 1}, {&__pyx_n_s_K_KP_MULTIPLY, __pyx_k_K_KP_MULTIPLY, sizeof(__pyx_k_K_KP_MULTIPLY), 0, 0, 1, 1}, {&__pyx_n_s_K_KP_OCTAL, __pyx_k_K_KP_OCTAL, sizeof(__pyx_k_K_KP_OCTAL), 0, 0, 1, 1}, {&__pyx_n_s_K_KP_PERCENT, __pyx_k_K_KP_PERCENT, sizeof(__pyx_k_K_KP_PERCENT), 0, 0, 1, 1}, {&__pyx_n_s_K_KP_PERIOD, __pyx_k_K_KP_PERIOD, sizeof(__pyx_k_K_KP_PERIOD), 0, 0, 1, 1}, {&__pyx_n_s_K_KP_PLUS, __pyx_k_K_KP_PLUS, sizeof(__pyx_k_K_KP_PLUS), 0, 0, 1, 1}, {&__pyx_n_s_K_KP_PLUSMINUS, __pyx_k_K_KP_PLUSMINUS, sizeof(__pyx_k_K_KP_PLUSMINUS), 0, 0, 1, 1}, {&__pyx_n_s_K_KP_POWER, __pyx_k_K_KP_POWER, sizeof(__pyx_k_K_KP_POWER), 0, 0, 1, 1}, {&__pyx_n_s_K_KP_RIGHTBRACE, __pyx_k_K_KP_RIGHTBRACE, sizeof(__pyx_k_K_KP_RIGHTBRACE), 0, 0, 1, 1}, {&__pyx_n_s_K_KP_RIGHTPAREN, __pyx_k_K_KP_RIGHTPAREN, sizeof(__pyx_k_K_KP_RIGHTPAREN), 0, 0, 1, 1}, {&__pyx_n_s_K_KP_SPACE, __pyx_k_K_KP_SPACE, sizeof(__pyx_k_K_KP_SPACE), 0, 0, 1, 1}, {&__pyx_n_s_K_KP_TAB, __pyx_k_K_KP_TAB, sizeof(__pyx_k_K_KP_TAB), 0, 0, 1, 1}, {&__pyx_n_s_K_KP_VERTICALBAR, __pyx_k_K_KP_VERTICALBAR, sizeof(__pyx_k_K_KP_VERTICALBAR), 0, 0, 1, 1}, {&__pyx_n_s_K_KP_XOR, __pyx_k_K_KP_XOR, sizeof(__pyx_k_K_KP_XOR), 0, 0, 1, 1}, {&__pyx_n_s_K_LALT, __pyx_k_K_LALT, sizeof(__pyx_k_K_LALT), 0, 0, 1, 1}, {&__pyx_n_s_K_LAST, __pyx_k_K_LAST, sizeof(__pyx_k_K_LAST), 0, 0, 1, 1}, {&__pyx_n_s_K_LCTRL, __pyx_k_K_LCTRL, sizeof(__pyx_k_K_LCTRL), 0, 0, 1, 1}, {&__pyx_n_s_K_LEFT, __pyx_k_K_LEFT, sizeof(__pyx_k_K_LEFT), 0, 0, 1, 1}, {&__pyx_n_s_K_LEFTBRACKET, __pyx_k_K_LEFTBRACKET, sizeof(__pyx_k_K_LEFTBRACKET), 0, 0, 1, 1}, {&__pyx_n_s_K_LEFTPAREN, __pyx_k_K_LEFTPAREN, sizeof(__pyx_k_K_LEFTPAREN), 0, 0, 1, 1}, {&__pyx_n_s_K_LESS, __pyx_k_K_LESS, sizeof(__pyx_k_K_LESS), 0, 0, 1, 1}, {&__pyx_n_s_K_LGUI, __pyx_k_K_LGUI, sizeof(__pyx_k_K_LGUI), 0, 0, 1, 1}, {&__pyx_n_s_K_LMETA, __pyx_k_K_LMETA, sizeof(__pyx_k_K_LMETA), 0, 0, 1, 1}, {&__pyx_n_s_K_LSHIFT, __pyx_k_K_LSHIFT, sizeof(__pyx_k_K_LSHIFT), 0, 0, 1, 1}, {&__pyx_n_s_K_LSUPER, __pyx_k_K_LSUPER, sizeof(__pyx_k_K_LSUPER), 0, 0, 1, 1}, {&__pyx_n_s_K_MAIL, __pyx_k_K_MAIL, sizeof(__pyx_k_K_MAIL), 0, 0, 1, 1}, {&__pyx_n_s_K_MEDIASELECT, __pyx_k_K_MEDIASELECT, sizeof(__pyx_k_K_MEDIASELECT), 0, 0, 1, 1}, {&__pyx_n_s_K_MENU, __pyx_k_K_MENU, sizeof(__pyx_k_K_MENU), 0, 0, 1, 1}, {&__pyx_n_s_K_MINUS, __pyx_k_K_MINUS, sizeof(__pyx_k_K_MINUS), 0, 0, 1, 1}, {&__pyx_n_s_K_MODE, __pyx_k_K_MODE, sizeof(__pyx_k_K_MODE), 0, 0, 1, 1}, {&__pyx_n_s_K_MUTE, __pyx_k_K_MUTE, sizeof(__pyx_k_K_MUTE), 0, 0, 1, 1}, {&__pyx_n_s_K_NUMLOCK, __pyx_k_K_NUMLOCK, sizeof(__pyx_k_K_NUMLOCK), 0, 0, 1, 1}, {&__pyx_n_s_K_NUMLOCKCLEAR, __pyx_k_K_NUMLOCKCLEAR, sizeof(__pyx_k_K_NUMLOCKCLEAR), 0, 0, 1, 1}, {&__pyx_n_s_K_OPER, __pyx_k_K_OPER, sizeof(__pyx_k_K_OPER), 0, 0, 1, 1}, {&__pyx_n_s_K_OUT, __pyx_k_K_OUT, sizeof(__pyx_k_K_OUT), 0, 0, 1, 1}, {&__pyx_n_s_K_PAGEDOWN, __pyx_k_K_PAGEDOWN, sizeof(__pyx_k_K_PAGEDOWN), 0, 0, 1, 1}, {&__pyx_n_s_K_PAGEUP, __pyx_k_K_PAGEUP, sizeof(__pyx_k_K_PAGEUP), 0, 0, 1, 1}, {&__pyx_n_s_K_PASTE, __pyx_k_K_PASTE, sizeof(__pyx_k_K_PASTE), 0, 0, 1, 1}, {&__pyx_n_s_K_PAUSE, __pyx_k_K_PAUSE, sizeof(__pyx_k_K_PAUSE), 0, 0, 1, 1}, {&__pyx_n_s_K_PERCENT, __pyx_k_K_PERCENT, sizeof(__pyx_k_K_PERCENT), 0, 0, 1, 1}, {&__pyx_n_s_K_PERIOD, __pyx_k_K_PERIOD, sizeof(__pyx_k_K_PERIOD), 0, 0, 1, 1}, {&__pyx_n_s_K_PLUS, __pyx_k_K_PLUS, sizeof(__pyx_k_K_PLUS), 0, 0, 1, 1}, {&__pyx_n_s_K_POWER, __pyx_k_K_POWER, sizeof(__pyx_k_K_POWER), 0, 0, 1, 1}, {&__pyx_n_s_K_PRINT, __pyx_k_K_PRINT, sizeof(__pyx_k_K_PRINT), 0, 0, 1, 1}, {&__pyx_n_s_K_PRINTSCREEN, __pyx_k_K_PRINTSCREEN, sizeof(__pyx_k_K_PRINTSCREEN), 0, 0, 1, 1}, {&__pyx_n_s_K_PRIOR, __pyx_k_K_PRIOR, sizeof(__pyx_k_K_PRIOR), 0, 0, 1, 1}, {&__pyx_n_s_K_QUESTION, __pyx_k_K_QUESTION, sizeof(__pyx_k_K_QUESTION), 0, 0, 1, 1}, {&__pyx_n_s_K_QUOTE, __pyx_k_K_QUOTE, sizeof(__pyx_k_K_QUOTE), 0, 0, 1, 1}, {&__pyx_n_s_K_QUOTEDBL, __pyx_k_K_QUOTEDBL, sizeof(__pyx_k_K_QUOTEDBL), 0, 0, 1, 1}, {&__pyx_n_s_K_RALT, __pyx_k_K_RALT, sizeof(__pyx_k_K_RALT), 0, 0, 1, 1}, {&__pyx_n_s_K_RCTRL, __pyx_k_K_RCTRL, sizeof(__pyx_k_K_RCTRL), 0, 0, 1, 1}, {&__pyx_n_s_K_RETURN, __pyx_k_K_RETURN, sizeof(__pyx_k_K_RETURN), 0, 0, 1, 1}, {&__pyx_n_s_K_RETURN2, __pyx_k_K_RETURN2, sizeof(__pyx_k_K_RETURN2), 0, 0, 1, 1}, {&__pyx_n_s_K_RGUI, __pyx_k_K_RGUI, sizeof(__pyx_k_K_RGUI), 0, 0, 1, 1}, {&__pyx_n_s_K_RIGHT, __pyx_k_K_RIGHT, sizeof(__pyx_k_K_RIGHT), 0, 0, 1, 1}, {&__pyx_n_s_K_RIGHTBRACKET, __pyx_k_K_RIGHTBRACKET, sizeof(__pyx_k_K_RIGHTBRACKET), 0, 0, 1, 1}, {&__pyx_n_s_K_RIGHTPAREN, __pyx_k_K_RIGHTPAREN, sizeof(__pyx_k_K_RIGHTPAREN), 0, 0, 1, 1}, {&__pyx_n_s_K_RMETA, __pyx_k_K_RMETA, sizeof(__pyx_k_K_RMETA), 0, 0, 1, 1}, {&__pyx_n_s_K_RSHIFT, __pyx_k_K_RSHIFT, sizeof(__pyx_k_K_RSHIFT), 0, 0, 1, 1}, {&__pyx_n_s_K_RSUPER, __pyx_k_K_RSUPER, sizeof(__pyx_k_K_RSUPER), 0, 0, 1, 1}, {&__pyx_n_s_K_SCROLLLOCK, __pyx_k_K_SCROLLLOCK, sizeof(__pyx_k_K_SCROLLLOCK), 0, 0, 1, 1}, {&__pyx_n_s_K_SCROLLOCK, __pyx_k_K_SCROLLOCK, sizeof(__pyx_k_K_SCROLLOCK), 0, 0, 1, 1}, {&__pyx_n_s_K_SELECT, __pyx_k_K_SELECT, sizeof(__pyx_k_K_SELECT), 0, 0, 1, 1}, {&__pyx_n_s_K_SEMICOLON, __pyx_k_K_SEMICOLON, sizeof(__pyx_k_K_SEMICOLON), 0, 0, 1, 1}, {&__pyx_n_s_K_SEPARATOR, __pyx_k_K_SEPARATOR, sizeof(__pyx_k_K_SEPARATOR), 0, 0, 1, 1}, {&__pyx_n_s_K_SLASH, __pyx_k_K_SLASH, sizeof(__pyx_k_K_SLASH), 0, 0, 1, 1}, {&__pyx_n_s_K_SLEEP, __pyx_k_K_SLEEP, sizeof(__pyx_k_K_SLEEP), 0, 0, 1, 1}, {&__pyx_n_s_K_SPACE, __pyx_k_K_SPACE, sizeof(__pyx_k_K_SPACE), 0, 0, 1, 1}, {&__pyx_n_s_K_STOP, __pyx_k_K_STOP, sizeof(__pyx_k_K_STOP), 0, 0, 1, 1}, {&__pyx_n_s_K_SYSREQ, __pyx_k_K_SYSREQ, sizeof(__pyx_k_K_SYSREQ), 0, 0, 1, 1}, {&__pyx_n_s_K_TAB, __pyx_k_K_TAB, sizeof(__pyx_k_K_TAB), 0, 0, 1, 1}, {&__pyx_n_s_K_THOUSANDSSEPARATOR, __pyx_k_K_THOUSANDSSEPARATOR, sizeof(__pyx_k_K_THOUSANDSSEPARATOR), 0, 0, 1, 1}, {&__pyx_n_s_K_UNDERSCORE, __pyx_k_K_UNDERSCORE, sizeof(__pyx_k_K_UNDERSCORE), 0, 0, 1, 1}, {&__pyx_n_s_K_UNDO, __pyx_k_K_UNDO, sizeof(__pyx_k_K_UNDO), 0, 0, 1, 1}, {&__pyx_n_s_K_UNKNOWN, __pyx_k_K_UNKNOWN, sizeof(__pyx_k_K_UNKNOWN), 0, 0, 1, 1}, {&__pyx_n_s_K_UP, __pyx_k_K_UP, sizeof(__pyx_k_K_UP), 0, 0, 1, 1}, {&__pyx_n_s_K_VOLUMEDOWN, __pyx_k_K_VOLUMEDOWN, sizeof(__pyx_k_K_VOLUMEDOWN), 0, 0, 1, 1}, {&__pyx_n_s_K_VOLUMEUP, __pyx_k_K_VOLUMEUP, sizeof(__pyx_k_K_VOLUMEUP), 0, 0, 1, 1}, {&__pyx_n_s_K_WWW, __pyx_k_K_WWW, sizeof(__pyx_k_K_WWW), 0, 0, 1, 1}, {&__pyx_n_s_K_a, __pyx_k_K_a, sizeof(__pyx_k_K_a), 0, 0, 1, 1}, {&__pyx_n_s_K_b, __pyx_k_K_b, sizeof(__pyx_k_K_b), 0, 0, 1, 1}, {&__pyx_n_s_K_c, __pyx_k_K_c, sizeof(__pyx_k_K_c), 0, 0, 1, 1}, {&__pyx_n_s_K_d, __pyx_k_K_d, sizeof(__pyx_k_K_d), 0, 0, 1, 1}, {&__pyx_n_s_K_e, __pyx_k_K_e, sizeof(__pyx_k_K_e), 0, 0, 1, 1}, {&__pyx_n_s_K_f, __pyx_k_K_f, sizeof(__pyx_k_K_f), 0, 0, 1, 1}, {&__pyx_n_s_K_g, __pyx_k_K_g, sizeof(__pyx_k_K_g), 0, 0, 1, 1}, {&__pyx_n_s_K_h, __pyx_k_K_h, sizeof(__pyx_k_K_h), 0, 0, 1, 1}, {&__pyx_n_s_K_i, __pyx_k_K_i, sizeof(__pyx_k_K_i), 0, 0, 1, 1}, {&__pyx_n_s_K_j, __pyx_k_K_j, sizeof(__pyx_k_K_j), 0, 0, 1, 1}, {&__pyx_n_s_K_k, __pyx_k_K_k, sizeof(__pyx_k_K_k), 0, 0, 1, 1}, {&__pyx_n_s_K_l, __pyx_k_K_l, sizeof(__pyx_k_K_l), 0, 0, 1, 1}, {&__pyx_n_s_K_m, __pyx_k_K_m, sizeof(__pyx_k_K_m), 0, 0, 1, 1}, {&__pyx_n_s_K_n, __pyx_k_K_n, sizeof(__pyx_k_K_n), 0, 0, 1, 1}, {&__pyx_n_s_K_o, __pyx_k_K_o, sizeof(__pyx_k_K_o), 0, 0, 1, 1}, {&__pyx_n_s_K_p, __pyx_k_K_p, sizeof(__pyx_k_K_p), 0, 0, 1, 1}, {&__pyx_n_s_K_q, __pyx_k_K_q, sizeof(__pyx_k_K_q), 0, 0, 1, 1}, {&__pyx_n_s_K_r, __pyx_k_K_r, sizeof(__pyx_k_K_r), 0, 0, 1, 1}, {&__pyx_n_s_K_s, __pyx_k_K_s, sizeof(__pyx_k_K_s), 0, 0, 1, 1}, {&__pyx_n_s_K_t, __pyx_k_K_t, sizeof(__pyx_k_K_t), 0, 0, 1, 1}, {&__pyx_n_s_K_u, __pyx_k_K_u, sizeof(__pyx_k_K_u), 0, 0, 1, 1}, {&__pyx_n_s_K_v, __pyx_k_K_v, sizeof(__pyx_k_K_v), 0, 0, 1, 1}, {&__pyx_n_s_K_w, __pyx_k_K_w, sizeof(__pyx_k_K_w), 0, 0, 1, 1}, {&__pyx_n_s_K_x, __pyx_k_K_x, sizeof(__pyx_k_K_x), 0, 0, 1, 1}, {&__pyx_n_s_K_y, __pyx_k_K_y, sizeof(__pyx_k_K_y), 0, 0, 1, 1}, {&__pyx_n_s_K_z, __pyx_k_K_z, sizeof(__pyx_k_K_z), 0, 0, 1, 1}, {&__pyx_n_s_LASTEVENT, __pyx_k_LASTEVENT, sizeof(__pyx_k_LASTEVENT), 0, 0, 1, 1}, {&__pyx_n_s_LIL_ENDIAN, __pyx_k_LIL_ENDIAN, sizeof(__pyx_k_LIL_ENDIAN), 0, 0, 1, 1}, {&__pyx_n_s_MOUSEBUTTONDOWN, __pyx_k_MOUSEBUTTONDOWN, sizeof(__pyx_k_MOUSEBUTTONDOWN), 0, 0, 1, 1}, {&__pyx_n_s_MOUSEBUTTONUP, __pyx_k_MOUSEBUTTONUP, sizeof(__pyx_k_MOUSEBUTTONUP), 0, 0, 1, 1}, {&__pyx_n_s_MOUSEMOTION, __pyx_k_MOUSEMOTION, sizeof(__pyx_k_MOUSEMOTION), 0, 0, 1, 1}, {&__pyx_n_s_MOUSEWHEEL, __pyx_k_MOUSEWHEEL, sizeof(__pyx_k_MOUSEWHEEL), 0, 0, 1, 1}, {&__pyx_n_s_MULTIGESTURE, __pyx_k_MULTIGESTURE, sizeof(__pyx_k_MULTIGESTURE), 0, 0, 1, 1}, {&__pyx_n_s_NOEVENT, __pyx_k_NOEVENT, sizeof(__pyx_k_NOEVENT), 0, 0, 1, 1}, {&__pyx_n_s_NOFRAME, __pyx_k_NOFRAME, sizeof(__pyx_k_NOFRAME), 0, 0, 1, 1}, {&__pyx_n_s_OPENGL, __pyx_k_OPENGL, sizeof(__pyx_k_OPENGL), 0, 0, 1, 1}, {&__pyx_n_s_POWERSTATE_CHARGED, __pyx_k_POWERSTATE_CHARGED, sizeof(__pyx_k_POWERSTATE_CHARGED), 0, 0, 1, 1}, {&__pyx_n_s_POWERSTATE_CHARGING, __pyx_k_POWERSTATE_CHARGING, sizeof(__pyx_k_POWERSTATE_CHARGING), 0, 0, 1, 1}, {&__pyx_n_s_POWERSTATE_NO_BATTERY, __pyx_k_POWERSTATE_NO_BATTERY, sizeof(__pyx_k_POWERSTATE_NO_BATTERY), 0, 0, 1, 1}, {&__pyx_n_s_POWERSTATE_ON_BATTERY, __pyx_k_POWERSTATE_ON_BATTERY, sizeof(__pyx_k_POWERSTATE_ON_BATTERY), 0, 0, 1, 1}, {&__pyx_n_s_POWERSTATE_UNKNOWN, __pyx_k_POWERSTATE_UNKNOWN, sizeof(__pyx_k_POWERSTATE_UNKNOWN), 0, 0, 1, 1}, {&__pyx_n_s_QUIT, __pyx_k_QUIT, sizeof(__pyx_k_QUIT), 0, 0, 1, 1}, {&__pyx_n_s_RENDER_TARGETS_RESET, __pyx_k_RENDER_TARGETS_RESET, sizeof(__pyx_k_RENDER_TARGETS_RESET), 0, 0, 1, 1}, {&__pyx_n_s_RESIZABLE, __pyx_k_RESIZABLE, sizeof(__pyx_k_RESIZABLE), 0, 0, 1, 1}, {&__pyx_n_s_RLEACCEL, __pyx_k_RLEACCEL, sizeof(__pyx_k_RLEACCEL), 0, 0, 1, 1}, {&__pyx_n_s_Rect, __pyx_k_Rect, sizeof(__pyx_k_Rect), 0, 0, 1, 1}, {&__pyx_n_s_SCRAP_TEXT, __pyx_k_SCRAP_TEXT, sizeof(__pyx_k_SCRAP_TEXT), 0, 0, 1, 1}, {&__pyx_n_s_SDL_VERSION_TUPLE, __pyx_k_SDL_VERSION_TUPLE, sizeof(__pyx_k_SDL_VERSION_TUPLE), 0, 0, 1, 1}, {&__pyx_n_s_SRCALPHA, __pyx_k_SRCALPHA, sizeof(__pyx_k_SRCALPHA), 0, 0, 1, 1}, {&__pyx_n_s_SRCCOLORKEY, __pyx_k_SRCCOLORKEY, sizeof(__pyx_k_SRCCOLORKEY), 0, 0, 1, 1}, {&__pyx_n_s_SWSURFACE, __pyx_k_SWSURFACE, sizeof(__pyx_k_SWSURFACE), 0, 0, 1, 1}, {&__pyx_n_s_SYSWMEVENT, __pyx_k_SYSWMEVENT, sizeof(__pyx_k_SYSWMEVENT), 0, 0, 1, 1}, {&__pyx_n_s_TEXTEDITING, __pyx_k_TEXTEDITING, sizeof(__pyx_k_TEXTEDITING), 0, 0, 1, 1}, {&__pyx_n_s_TEXTINPUT, __pyx_k_TEXTINPUT, sizeof(__pyx_k_TEXTINPUT), 0, 0, 1, 1}, {&__pyx_n_s_TOUCH_MOUSEID, __pyx_k_TOUCH_MOUSEID, sizeof(__pyx_k_TOUCH_MOUSEID), 0, 0, 1, 1}, {&__pyx_n_s_USEREVENT, __pyx_k_USEREVENT, sizeof(__pyx_k_USEREVENT), 0, 0, 1, 1}, {&__pyx_n_s_VIDEOEXPOSE, __pyx_k_VIDEOEXPOSE, sizeof(__pyx_k_VIDEOEXPOSE), 0, 0, 1, 1}, {&__pyx_n_s_VIDEORESIZE, __pyx_k_VIDEORESIZE, sizeof(__pyx_k_VIDEORESIZE), 0, 0, 1, 1}, {&__pyx_n_s_WINDOWEVENT, __pyx_k_WINDOWEVENT, sizeof(__pyx_k_WINDOWEVENT), 0, 0, 1, 1}, {&__pyx_n_s_WINDOWPOS_CENTERED, __pyx_k_WINDOWPOS_CENTERED, sizeof(__pyx_k_WINDOWPOS_CENTERED), 0, 0, 1, 1}, {&__pyx_n_s_WINDOWPOS_UNDEFINED, __pyx_k_WINDOWPOS_UNDEFINED, sizeof(__pyx_k_WINDOWPOS_UNDEFINED), 0, 0, 1, 1}, {&__pyx_n_s_WINDOW_ALLOW_HIGHDPI, __pyx_k_WINDOW_ALLOW_HIGHDPI, sizeof(__pyx_k_WINDOW_ALLOW_HIGHDPI), 0, 0, 1, 1}, {&__pyx_n_s_WINDOW_BORDERLESS, __pyx_k_WINDOW_BORDERLESS, sizeof(__pyx_k_WINDOW_BORDERLESS), 0, 0, 1, 1}, {&__pyx_n_s_WINDOW_FOREIGN, __pyx_k_WINDOW_FOREIGN, sizeof(__pyx_k_WINDOW_FOREIGN), 0, 0, 1, 1}, {&__pyx_n_s_WINDOW_FULLSCREEN, __pyx_k_WINDOW_FULLSCREEN, sizeof(__pyx_k_WINDOW_FULLSCREEN), 0, 0, 1, 1}, {&__pyx_n_s_WINDOW_FULLSCREEN_DESKTOP, __pyx_k_WINDOW_FULLSCREEN_DESKTOP, sizeof(__pyx_k_WINDOW_FULLSCREEN_DESKTOP), 0, 0, 1, 1}, {&__pyx_n_s_WINDOW_HIDDEN, __pyx_k_WINDOW_HIDDEN, sizeof(__pyx_k_WINDOW_HIDDEN), 0, 0, 1, 1}, {&__pyx_n_s_WINDOW_INPUT_FOCUS, __pyx_k_WINDOW_INPUT_FOCUS, sizeof(__pyx_k_WINDOW_INPUT_FOCUS), 0, 0, 1, 1}, {&__pyx_n_s_WINDOW_INPUT_GRABBED, __pyx_k_WINDOW_INPUT_GRABBED, sizeof(__pyx_k_WINDOW_INPUT_GRABBED), 0, 0, 1, 1}, {&__pyx_n_s_WINDOW_MAXIMIZED, __pyx_k_WINDOW_MAXIMIZED, sizeof(__pyx_k_WINDOW_MAXIMIZED), 0, 0, 1, 1}, {&__pyx_n_s_WINDOW_MINIMIZED, __pyx_k_WINDOW_MINIMIZED, sizeof(__pyx_k_WINDOW_MINIMIZED), 0, 0, 1, 1}, {&__pyx_n_s_WINDOW_NOFRAME, __pyx_k_WINDOW_NOFRAME, sizeof(__pyx_k_WINDOW_NOFRAME), 0, 0, 1, 1}, {&__pyx_n_s_WINDOW_OPENGL, __pyx_k_WINDOW_OPENGL, sizeof(__pyx_k_WINDOW_OPENGL), 0, 0, 1, 1}, {&__pyx_n_s_WINDOW_RESIZABLE, __pyx_k_WINDOW_RESIZABLE, sizeof(__pyx_k_WINDOW_RESIZABLE), 0, 0, 1, 1}, {&__pyx_n_s_WINDOW_SHOWN, __pyx_k_WINDOW_SHOWN, sizeof(__pyx_k_WINDOW_SHOWN), 0, 0, 1, 1}, {&__pyx_n_s_import, __pyx_k_import, sizeof(__pyx_k_import), 0, 0, 1, 1}, {&__pyx_n_s_main, __pyx_k_main, sizeof(__pyx_k_main), 0, 0, 1, 1}, {&__pyx_n_s_pygame_sdl2_color, __pyx_k_pygame_sdl2_color, sizeof(__pyx_k_pygame_sdl2_color), 0, 0, 1, 1}, {&__pyx_n_s_pygame_sdl2_rect, __pyx_k_pygame_sdl2_rect, sizeof(__pyx_k_pygame_sdl2_rect), 0, 0, 1, 1}, {&__pyx_n_s_test, __pyx_k_test, sizeof(__pyx_k_test), 0, 0, 1, 1}, {&__pyx_kp_u_text_plain, __pyx_k_text_plain, sizeof(__pyx_k_text_plain), 0, 1, 0, 0}, {&__pyx_n_s_update, __pyx_k_update, sizeof(__pyx_k_update), 0, 0, 1, 1}, {0, 0, 0, 0, 0, 0, 0} }; static int __Pyx_InitCachedBuiltins(void) { return 0; } static int __Pyx_InitCachedConstants(void) { __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__Pyx_InitCachedConstants", 0); __Pyx_RefNannyFinishContext(); return 0; } static int __Pyx_InitGlobals(void) { if (__Pyx_InitStrings(__pyx_string_tab) < 0) __PYX_ERR(0, 1, __pyx_L1_error); __pyx_int_0 = PyInt_FromLong(0); if (unlikely(!__pyx_int_0)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_int_1 = PyInt_FromLong(1); if (unlikely(!__pyx_int_1)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_int_2 = PyInt_FromLong(2); if (unlikely(!__pyx_int_2)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_int_3 = PyInt_FromLong(3); if (unlikely(!__pyx_int_3)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_int_4 = PyInt_FromLong(4); if (unlikely(!__pyx_int_4)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_int_5 = PyInt_FromLong(5); if (unlikely(!__pyx_int_5)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_int_6 = PyInt_FromLong(6); if (unlikely(!__pyx_int_6)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_int_7 = PyInt_FromLong(7); if (unlikely(!__pyx_int_7)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_int_8 = PyInt_FromLong(8); if (unlikely(!__pyx_int_8)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_int_9 = PyInt_FromLong(9); if (unlikely(!__pyx_int_9)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_int_16 = PyInt_FromLong(16); if (unlikely(!__pyx_int_16)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_int_17 = PyInt_FromLong(17); if (unlikely(!__pyx_int_17)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_int_1073741824 = PyInt_FromLong(1073741824L); if (unlikely(!__pyx_int_1073741824)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_int_2147483648 = PyInt_FromString((char *)"2147483648", 0, 0); if (unlikely(!__pyx_int_2147483648)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_int_neg_1 = PyInt_FromLong(-1); if (unlikely(!__pyx_int_neg_1)) __PYX_ERR(0, 1, __pyx_L1_error) return 0; __pyx_L1_error:; return -1; } #if PY_MAJOR_VERSION < 3 PyMODINIT_FUNC initlocals(void); /*proto*/ PyMODINIT_FUNC initlocals(void) #else PyMODINIT_FUNC PyInit_locals(void); /*proto*/ PyMODINIT_FUNC PyInit_locals(void) #endif { PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; PyObject *__pyx_t_5 = NULL; __Pyx_RefNannyDeclarations #if CYTHON_REFNANNY __Pyx_RefNanny = __Pyx_RefNannyImportAPI("refnanny"); if (!__Pyx_RefNanny) { PyErr_Clear(); __Pyx_RefNanny = __Pyx_RefNannyImportAPI("Cython.Runtime.refnanny"); if (!__Pyx_RefNanny) Py_FatalError("failed to import 'refnanny' module"); } #endif __Pyx_RefNannySetupContext("PyMODINIT_FUNC PyInit_locals(void)", 0); if (__Pyx_check_binary_version() < 0) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_empty_tuple = PyTuple_New(0); if (unlikely(!__pyx_empty_tuple)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_empty_bytes = PyBytes_FromStringAndSize("", 0); if (unlikely(!__pyx_empty_bytes)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_empty_unicode = PyUnicode_FromStringAndSize("", 0); if (unlikely(!__pyx_empty_unicode)) __PYX_ERR(0, 1, __pyx_L1_error) #ifdef __Pyx_CyFunction_USED if (__pyx_CyFunction_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error) #endif #ifdef __Pyx_FusedFunction_USED if (__pyx_FusedFunction_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error) #endif #ifdef __Pyx_Coroutine_USED if (__pyx_Coroutine_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error) #endif #ifdef __Pyx_Generator_USED if (__pyx_Generator_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error) #endif #ifdef __Pyx_StopAsyncIteration_USED if (__pyx_StopAsyncIteration_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error) #endif /*--- Library function declarations ---*/ /*--- Threads initialization code ---*/ #if defined(__PYX_FORCE_INIT_THREADS) && __PYX_FORCE_INIT_THREADS #ifdef WITH_THREAD /* Python build with threading support? */ PyEval_InitThreads(); #endif #endif /*--- Module creation code ---*/ #if PY_MAJOR_VERSION < 3 __pyx_m = Py_InitModule4("locals", __pyx_methods, 0, 0, PYTHON_API_VERSION); Py_XINCREF(__pyx_m); #else __pyx_m = PyModule_Create(&__pyx_moduledef); #endif if (unlikely(!__pyx_m)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_d = PyModule_GetDict(__pyx_m); if (unlikely(!__pyx_d)) __PYX_ERR(0, 1, __pyx_L1_error) Py_INCREF(__pyx_d); __pyx_b = PyImport_AddModule(__Pyx_BUILTIN_MODULE_NAME); if (unlikely(!__pyx_b)) __PYX_ERR(0, 1, __pyx_L1_error) #if CYTHON_COMPILING_IN_PYPY Py_INCREF(__pyx_b); #endif if (PyObject_SetAttrString(__pyx_m, "__builtins__", __pyx_b) < 0) __PYX_ERR(0, 1, __pyx_L1_error); /*--- Initialize various global constants etc. ---*/ if (__Pyx_InitGlobals() < 0) __PYX_ERR(0, 1, __pyx_L1_error) #if PY_MAJOR_VERSION < 3 && (__PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT) if (__Pyx_init_sys_getdefaultencoding_params() < 0) __PYX_ERR(0, 1, __pyx_L1_error) #endif if (__pyx_module_is_main_pygame_sdl2__locals) { if (PyObject_SetAttrString(__pyx_m, "__name__", __pyx_n_s_main) < 0) __PYX_ERR(0, 1, __pyx_L1_error) } #if PY_MAJOR_VERSION >= 3 { PyObject *modules = PyImport_GetModuleDict(); if (unlikely(!modules)) __PYX_ERR(0, 1, __pyx_L1_error) if (!PyDict_GetItemString(modules, "pygame_sdl2.locals")) { if (unlikely(PyDict_SetItemString(modules, "pygame_sdl2.locals", __pyx_m) < 0)) __PYX_ERR(0, 1, __pyx_L1_error) } } #endif /*--- Builtin init code ---*/ if (__Pyx_InitCachedBuiltins() < 0) __PYX_ERR(0, 1, __pyx_L1_error) /*--- Constants init code ---*/ if (__Pyx_InitCachedConstants() < 0) __PYX_ERR(0, 1, __pyx_L1_error) /*--- Global init code ---*/ /*--- Variable export code ---*/ /*--- Function export code ---*/ /*--- Type init code ---*/ /*--- Type import code ---*/ /*--- Variable import code ---*/ /*--- Function import code ---*/ /*--- Execution code ---*/ #if defined(__Pyx_Generator_USED) || defined(__Pyx_Coroutine_USED) if (__Pyx_patch_abc() < 0) __PYX_ERR(0, 1, __pyx_L1_error) #endif /* "pygame_sdl2/locals.pyx":4 * cimport sdl2 * * from pygame_sdl2.rect import Rect # <<<<<<<<<<<<<< * from pygame_sdl2.color import Color * */ __pyx_t_1 = PyList_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_INCREF(__pyx_n_s_Rect); __Pyx_GIVEREF(__pyx_n_s_Rect); PyList_SET_ITEM(__pyx_t_1, 0, __pyx_n_s_Rect); __pyx_t_2 = __Pyx_Import(__pyx_n_s_pygame_sdl2_rect, __pyx_t_1, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_1 = __Pyx_ImportFrom(__pyx_t_2, __pyx_n_s_Rect); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (PyDict_SetItem(__pyx_d, __pyx_n_s_Rect, __pyx_t_1) < 0) __PYX_ERR(0, 4, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "pygame_sdl2/locals.pyx":5 * * from pygame_sdl2.rect import Rect * from pygame_sdl2.color import Color # <<<<<<<<<<<<<< * * include "event_list.pxi" */ __pyx_t_2 = PyList_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 5, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_INCREF(__pyx_n_s_Color); __Pyx_GIVEREF(__pyx_n_s_Color); PyList_SET_ITEM(__pyx_t_2, 0, __pyx_n_s_Color); __pyx_t_1 = __Pyx_Import(__pyx_n_s_pygame_sdl2_color, __pyx_t_2, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 5, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_2 = __Pyx_ImportFrom(__pyx_t_1, __pyx_n_s_Color); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 5, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_Color, __pyx_t_2) < 0) __PYX_ERR(0, 5, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "include/event_list.pxi":4 * # Do not edit! * * NOEVENT = SDL_FIRSTEVENT # <<<<<<<<<<<<<< * QUIT = SDL_QUIT * APP_TERMINATING = SDL_APP_TERMINATING */ __pyx_t_1 = __Pyx_PyInt_From_SDL_EventType(SDL_FIRSTEVENT); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 4, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (PyDict_SetItem(__pyx_d, __pyx_n_s_NOEVENT, __pyx_t_1) < 0) __PYX_ERR(1, 4, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "include/event_list.pxi":5 * * NOEVENT = SDL_FIRSTEVENT * QUIT = SDL_QUIT # <<<<<<<<<<<<<< * APP_TERMINATING = SDL_APP_TERMINATING * APP_LOWMEMORY = SDL_APP_LOWMEMORY */ __pyx_t_1 = __Pyx_PyInt_From_SDL_EventType(SDL_QUIT); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 5, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (PyDict_SetItem(__pyx_d, __pyx_n_s_QUIT, __pyx_t_1) < 0) __PYX_ERR(1, 5, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "include/event_list.pxi":6 * NOEVENT = SDL_FIRSTEVENT * QUIT = SDL_QUIT * APP_TERMINATING = SDL_APP_TERMINATING # <<<<<<<<<<<<<< * APP_LOWMEMORY = SDL_APP_LOWMEMORY * APP_WILLENTERBACKGROUND = SDL_APP_WILLENTERBACKGROUND */ __pyx_t_1 = __Pyx_PyInt_From_SDL_EventType(SDL_APP_TERMINATING); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 6, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (PyDict_SetItem(__pyx_d, __pyx_n_s_APP_TERMINATING, __pyx_t_1) < 0) __PYX_ERR(1, 6, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "include/event_list.pxi":7 * QUIT = SDL_QUIT * APP_TERMINATING = SDL_APP_TERMINATING * APP_LOWMEMORY = SDL_APP_LOWMEMORY # <<<<<<<<<<<<<< * APP_WILLENTERBACKGROUND = SDL_APP_WILLENTERBACKGROUND * APP_DIDENTERBACKGROUND = SDL_APP_DIDENTERBACKGROUND */ __pyx_t_1 = __Pyx_PyInt_From_SDL_EventType(SDL_APP_LOWMEMORY); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 7, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (PyDict_SetItem(__pyx_d, __pyx_n_s_APP_LOWMEMORY, __pyx_t_1) < 0) __PYX_ERR(1, 7, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "include/event_list.pxi":8 * APP_TERMINATING = SDL_APP_TERMINATING * APP_LOWMEMORY = SDL_APP_LOWMEMORY * APP_WILLENTERBACKGROUND = SDL_APP_WILLENTERBACKGROUND # <<<<<<<<<<<<<< * APP_DIDENTERBACKGROUND = SDL_APP_DIDENTERBACKGROUND * APP_WILLENTERFOREGROUND = SDL_APP_WILLENTERFOREGROUND */ __pyx_t_1 = __Pyx_PyInt_From_SDL_EventType(SDL_APP_WILLENTERBACKGROUND); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 8, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (PyDict_SetItem(__pyx_d, __pyx_n_s_APP_WILLENTERBACKGROUND, __pyx_t_1) < 0) __PYX_ERR(1, 8, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "include/event_list.pxi":9 * APP_LOWMEMORY = SDL_APP_LOWMEMORY * APP_WILLENTERBACKGROUND = SDL_APP_WILLENTERBACKGROUND * APP_DIDENTERBACKGROUND = SDL_APP_DIDENTERBACKGROUND # <<<<<<<<<<<<<< * APP_WILLENTERFOREGROUND = SDL_APP_WILLENTERFOREGROUND * APP_DIDENTERFOREGROUND = SDL_APP_DIDENTERFOREGROUND */ __pyx_t_1 = __Pyx_PyInt_From_SDL_EventType(SDL_APP_DIDENTERBACKGROUND); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 9, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (PyDict_SetItem(__pyx_d, __pyx_n_s_APP_DIDENTERBACKGROUND, __pyx_t_1) < 0) __PYX_ERR(1, 9, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "include/event_list.pxi":10 * APP_WILLENTERBACKGROUND = SDL_APP_WILLENTERBACKGROUND * APP_DIDENTERBACKGROUND = SDL_APP_DIDENTERBACKGROUND * APP_WILLENTERFOREGROUND = SDL_APP_WILLENTERFOREGROUND # <<<<<<<<<<<<<< * APP_DIDENTERFOREGROUND = SDL_APP_DIDENTERFOREGROUND * WINDOWEVENT = SDL_WINDOWEVENT */ __pyx_t_1 = __Pyx_PyInt_From_SDL_EventType(SDL_APP_WILLENTERFOREGROUND); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 10, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (PyDict_SetItem(__pyx_d, __pyx_n_s_APP_WILLENTERFOREGROUND, __pyx_t_1) < 0) __PYX_ERR(1, 10, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "include/event_list.pxi":11 * APP_DIDENTERBACKGROUND = SDL_APP_DIDENTERBACKGROUND * APP_WILLENTERFOREGROUND = SDL_APP_WILLENTERFOREGROUND * APP_DIDENTERFOREGROUND = SDL_APP_DIDENTERFOREGROUND # <<<<<<<<<<<<<< * WINDOWEVENT = SDL_WINDOWEVENT * SYSWMEVENT = SDL_SYSWMEVENT */ __pyx_t_1 = __Pyx_PyInt_From_SDL_EventType(SDL_APP_DIDENTERFOREGROUND); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 11, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (PyDict_SetItem(__pyx_d, __pyx_n_s_APP_DIDENTERFOREGROUND, __pyx_t_1) < 0) __PYX_ERR(1, 11, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "include/event_list.pxi":12 * APP_WILLENTERFOREGROUND = SDL_APP_WILLENTERFOREGROUND * APP_DIDENTERFOREGROUND = SDL_APP_DIDENTERFOREGROUND * WINDOWEVENT = SDL_WINDOWEVENT # <<<<<<<<<<<<<< * SYSWMEVENT = SDL_SYSWMEVENT * KEYDOWN = SDL_KEYDOWN */ __pyx_t_1 = __Pyx_PyInt_From_SDL_EventType(SDL_WINDOWEVENT); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 12, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (PyDict_SetItem(__pyx_d, __pyx_n_s_WINDOWEVENT, __pyx_t_1) < 0) __PYX_ERR(1, 12, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "include/event_list.pxi":13 * APP_DIDENTERFOREGROUND = SDL_APP_DIDENTERFOREGROUND * WINDOWEVENT = SDL_WINDOWEVENT * SYSWMEVENT = SDL_SYSWMEVENT # <<<<<<<<<<<<<< * KEYDOWN = SDL_KEYDOWN * KEYUP = SDL_KEYUP */ __pyx_t_1 = __Pyx_PyInt_From_SDL_EventType(SDL_SYSWMEVENT); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 13, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (PyDict_SetItem(__pyx_d, __pyx_n_s_SYSWMEVENT, __pyx_t_1) < 0) __PYX_ERR(1, 13, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "include/event_list.pxi":14 * WINDOWEVENT = SDL_WINDOWEVENT * SYSWMEVENT = SDL_SYSWMEVENT * KEYDOWN = SDL_KEYDOWN # <<<<<<<<<<<<<< * KEYUP = SDL_KEYUP * TEXTEDITING = SDL_TEXTEDITING */ __pyx_t_1 = __Pyx_PyInt_From_SDL_EventType(SDL_KEYDOWN); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 14, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (PyDict_SetItem(__pyx_d, __pyx_n_s_KEYDOWN, __pyx_t_1) < 0) __PYX_ERR(1, 14, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "include/event_list.pxi":15 * SYSWMEVENT = SDL_SYSWMEVENT * KEYDOWN = SDL_KEYDOWN * KEYUP = SDL_KEYUP # <<<<<<<<<<<<<< * TEXTEDITING = SDL_TEXTEDITING * TEXTINPUT = SDL_TEXTINPUT */ __pyx_t_1 = __Pyx_PyInt_From_SDL_EventType(SDL_KEYUP); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 15, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (PyDict_SetItem(__pyx_d, __pyx_n_s_KEYUP, __pyx_t_1) < 0) __PYX_ERR(1, 15, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "include/event_list.pxi":16 * KEYDOWN = SDL_KEYDOWN * KEYUP = SDL_KEYUP * TEXTEDITING = SDL_TEXTEDITING # <<<<<<<<<<<<<< * TEXTINPUT = SDL_TEXTINPUT * MOUSEMOTION = SDL_MOUSEMOTION */ __pyx_t_1 = __Pyx_PyInt_From_SDL_EventType(SDL_TEXTEDITING); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 16, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (PyDict_SetItem(__pyx_d, __pyx_n_s_TEXTEDITING, __pyx_t_1) < 0) __PYX_ERR(1, 16, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "include/event_list.pxi":17 * KEYUP = SDL_KEYUP * TEXTEDITING = SDL_TEXTEDITING * TEXTINPUT = SDL_TEXTINPUT # <<<<<<<<<<<<<< * MOUSEMOTION = SDL_MOUSEMOTION * MOUSEBUTTONDOWN = SDL_MOUSEBUTTONDOWN */ __pyx_t_1 = __Pyx_PyInt_From_SDL_EventType(SDL_TEXTINPUT); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 17, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (PyDict_SetItem(__pyx_d, __pyx_n_s_TEXTINPUT, __pyx_t_1) < 0) __PYX_ERR(1, 17, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "include/event_list.pxi":18 * TEXTEDITING = SDL_TEXTEDITING * TEXTINPUT = SDL_TEXTINPUT * MOUSEMOTION = SDL_MOUSEMOTION # <<<<<<<<<<<<<< * MOUSEBUTTONDOWN = SDL_MOUSEBUTTONDOWN * MOUSEBUTTONUP = SDL_MOUSEBUTTONUP */ __pyx_t_1 = __Pyx_PyInt_From_SDL_EventType(SDL_MOUSEMOTION); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 18, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (PyDict_SetItem(__pyx_d, __pyx_n_s_MOUSEMOTION, __pyx_t_1) < 0) __PYX_ERR(1, 18, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "include/event_list.pxi":19 * TEXTINPUT = SDL_TEXTINPUT * MOUSEMOTION = SDL_MOUSEMOTION * MOUSEBUTTONDOWN = SDL_MOUSEBUTTONDOWN # <<<<<<<<<<<<<< * MOUSEBUTTONUP = SDL_MOUSEBUTTONUP * MOUSEWHEEL = SDL_MOUSEWHEEL */ __pyx_t_1 = __Pyx_PyInt_From_SDL_EventType(SDL_MOUSEBUTTONDOWN); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 19, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (PyDict_SetItem(__pyx_d, __pyx_n_s_MOUSEBUTTONDOWN, __pyx_t_1) < 0) __PYX_ERR(1, 19, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "include/event_list.pxi":20 * MOUSEMOTION = SDL_MOUSEMOTION * MOUSEBUTTONDOWN = SDL_MOUSEBUTTONDOWN * MOUSEBUTTONUP = SDL_MOUSEBUTTONUP # <<<<<<<<<<<<<< * MOUSEWHEEL = SDL_MOUSEWHEEL * JOYAXISMOTION = SDL_JOYAXISMOTION */ __pyx_t_1 = __Pyx_PyInt_From_SDL_EventType(SDL_MOUSEBUTTONUP); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 20, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (PyDict_SetItem(__pyx_d, __pyx_n_s_MOUSEBUTTONUP, __pyx_t_1) < 0) __PYX_ERR(1, 20, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "include/event_list.pxi":21 * MOUSEBUTTONDOWN = SDL_MOUSEBUTTONDOWN * MOUSEBUTTONUP = SDL_MOUSEBUTTONUP * MOUSEWHEEL = SDL_MOUSEWHEEL # <<<<<<<<<<<<<< * JOYAXISMOTION = SDL_JOYAXISMOTION * JOYBALLMOTION = SDL_JOYBALLMOTION */ __pyx_t_1 = __Pyx_PyInt_From_SDL_EventType(SDL_MOUSEWHEEL); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 21, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (PyDict_SetItem(__pyx_d, __pyx_n_s_MOUSEWHEEL, __pyx_t_1) < 0) __PYX_ERR(1, 21, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "include/event_list.pxi":22 * MOUSEBUTTONUP = SDL_MOUSEBUTTONUP * MOUSEWHEEL = SDL_MOUSEWHEEL * JOYAXISMOTION = SDL_JOYAXISMOTION # <<<<<<<<<<<<<< * JOYBALLMOTION = SDL_JOYBALLMOTION * JOYHATMOTION = SDL_JOYHATMOTION */ __pyx_t_1 = __Pyx_PyInt_From_SDL_EventType(SDL_JOYAXISMOTION); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 22, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (PyDict_SetItem(__pyx_d, __pyx_n_s_JOYAXISMOTION, __pyx_t_1) < 0) __PYX_ERR(1, 22, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "include/event_list.pxi":23 * MOUSEWHEEL = SDL_MOUSEWHEEL * JOYAXISMOTION = SDL_JOYAXISMOTION * JOYBALLMOTION = SDL_JOYBALLMOTION # <<<<<<<<<<<<<< * JOYHATMOTION = SDL_JOYHATMOTION * JOYBUTTONDOWN = SDL_JOYBUTTONDOWN */ __pyx_t_1 = __Pyx_PyInt_From_SDL_EventType(SDL_JOYBALLMOTION); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 23, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (PyDict_SetItem(__pyx_d, __pyx_n_s_JOYBALLMOTION, __pyx_t_1) < 0) __PYX_ERR(1, 23, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "include/event_list.pxi":24 * JOYAXISMOTION = SDL_JOYAXISMOTION * JOYBALLMOTION = SDL_JOYBALLMOTION * JOYHATMOTION = SDL_JOYHATMOTION # <<<<<<<<<<<<<< * JOYBUTTONDOWN = SDL_JOYBUTTONDOWN * JOYBUTTONUP = SDL_JOYBUTTONUP */ __pyx_t_1 = __Pyx_PyInt_From_SDL_EventType(SDL_JOYHATMOTION); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 24, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (PyDict_SetItem(__pyx_d, __pyx_n_s_JOYHATMOTION, __pyx_t_1) < 0) __PYX_ERR(1, 24, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "include/event_list.pxi":25 * JOYBALLMOTION = SDL_JOYBALLMOTION * JOYHATMOTION = SDL_JOYHATMOTION * JOYBUTTONDOWN = SDL_JOYBUTTONDOWN # <<<<<<<<<<<<<< * JOYBUTTONUP = SDL_JOYBUTTONUP * JOYDEVICEADDED = SDL_JOYDEVICEADDED */ __pyx_t_1 = __Pyx_PyInt_From_SDL_EventType(SDL_JOYBUTTONDOWN); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 25, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (PyDict_SetItem(__pyx_d, __pyx_n_s_JOYBUTTONDOWN, __pyx_t_1) < 0) __PYX_ERR(1, 25, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "include/event_list.pxi":26 * JOYHATMOTION = SDL_JOYHATMOTION * JOYBUTTONDOWN = SDL_JOYBUTTONDOWN * JOYBUTTONUP = SDL_JOYBUTTONUP # <<<<<<<<<<<<<< * JOYDEVICEADDED = SDL_JOYDEVICEADDED * JOYDEVICEREMOVED = SDL_JOYDEVICEREMOVED */ __pyx_t_1 = __Pyx_PyInt_From_SDL_EventType(SDL_JOYBUTTONUP); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 26, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (PyDict_SetItem(__pyx_d, __pyx_n_s_JOYBUTTONUP, __pyx_t_1) < 0) __PYX_ERR(1, 26, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "include/event_list.pxi":27 * JOYBUTTONDOWN = SDL_JOYBUTTONDOWN * JOYBUTTONUP = SDL_JOYBUTTONUP * JOYDEVICEADDED = SDL_JOYDEVICEADDED # <<<<<<<<<<<<<< * JOYDEVICEREMOVED = SDL_JOYDEVICEREMOVED * CONTROLLERAXISMOTION = SDL_CONTROLLERAXISMOTION */ __pyx_t_1 = __Pyx_PyInt_From_SDL_EventType(SDL_JOYDEVICEADDED); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 27, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (PyDict_SetItem(__pyx_d, __pyx_n_s_JOYDEVICEADDED, __pyx_t_1) < 0) __PYX_ERR(1, 27, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "include/event_list.pxi":28 * JOYBUTTONUP = SDL_JOYBUTTONUP * JOYDEVICEADDED = SDL_JOYDEVICEADDED * JOYDEVICEREMOVED = SDL_JOYDEVICEREMOVED # <<<<<<<<<<<<<< * CONTROLLERAXISMOTION = SDL_CONTROLLERAXISMOTION * CONTROLLERBUTTONDOWN = SDL_CONTROLLERBUTTONDOWN */ __pyx_t_1 = __Pyx_PyInt_From_SDL_EventType(SDL_JOYDEVICEREMOVED); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 28, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (PyDict_SetItem(__pyx_d, __pyx_n_s_JOYDEVICEREMOVED, __pyx_t_1) < 0) __PYX_ERR(1, 28, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "include/event_list.pxi":29 * JOYDEVICEADDED = SDL_JOYDEVICEADDED * JOYDEVICEREMOVED = SDL_JOYDEVICEREMOVED * CONTROLLERAXISMOTION = SDL_CONTROLLERAXISMOTION # <<<<<<<<<<<<<< * CONTROLLERBUTTONDOWN = SDL_CONTROLLERBUTTONDOWN * CONTROLLERBUTTONUP = SDL_CONTROLLERBUTTONUP */ __pyx_t_1 = __Pyx_PyInt_From_SDL_EventType(SDL_CONTROLLERAXISMOTION); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 29, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (PyDict_SetItem(__pyx_d, __pyx_n_s_CONTROLLERAXISMOTION, __pyx_t_1) < 0) __PYX_ERR(1, 29, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "include/event_list.pxi":30 * JOYDEVICEREMOVED = SDL_JOYDEVICEREMOVED * CONTROLLERAXISMOTION = SDL_CONTROLLERAXISMOTION * CONTROLLERBUTTONDOWN = SDL_CONTROLLERBUTTONDOWN # <<<<<<<<<<<<<< * CONTROLLERBUTTONUP = SDL_CONTROLLERBUTTONUP * CONTROLLERDEVICEADDED = SDL_CONTROLLERDEVICEADDED */ __pyx_t_1 = __Pyx_PyInt_From_SDL_EventType(SDL_CONTROLLERBUTTONDOWN); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 30, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (PyDict_SetItem(__pyx_d, __pyx_n_s_CONTROLLERBUTTONDOWN, __pyx_t_1) < 0) __PYX_ERR(1, 30, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "include/event_list.pxi":31 * CONTROLLERAXISMOTION = SDL_CONTROLLERAXISMOTION * CONTROLLERBUTTONDOWN = SDL_CONTROLLERBUTTONDOWN * CONTROLLERBUTTONUP = SDL_CONTROLLERBUTTONUP # <<<<<<<<<<<<<< * CONTROLLERDEVICEADDED = SDL_CONTROLLERDEVICEADDED * CONTROLLERDEVICEREMOVED = SDL_CONTROLLERDEVICEREMOVED */ __pyx_t_1 = __Pyx_PyInt_From_SDL_EventType(SDL_CONTROLLERBUTTONUP); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 31, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (PyDict_SetItem(__pyx_d, __pyx_n_s_CONTROLLERBUTTONUP, __pyx_t_1) < 0) __PYX_ERR(1, 31, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "include/event_list.pxi":32 * CONTROLLERBUTTONDOWN = SDL_CONTROLLERBUTTONDOWN * CONTROLLERBUTTONUP = SDL_CONTROLLERBUTTONUP * CONTROLLERDEVICEADDED = SDL_CONTROLLERDEVICEADDED # <<<<<<<<<<<<<< * CONTROLLERDEVICEREMOVED = SDL_CONTROLLERDEVICEREMOVED * CONTROLLERDEVICEREMAPPED = SDL_CONTROLLERDEVICEREMAPPED */ __pyx_t_1 = __Pyx_PyInt_From_SDL_EventType(SDL_CONTROLLERDEVICEADDED); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 32, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (PyDict_SetItem(__pyx_d, __pyx_n_s_CONTROLLERDEVICEADDED, __pyx_t_1) < 0) __PYX_ERR(1, 32, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "include/event_list.pxi":33 * CONTROLLERBUTTONUP = SDL_CONTROLLERBUTTONUP * CONTROLLERDEVICEADDED = SDL_CONTROLLERDEVICEADDED * CONTROLLERDEVICEREMOVED = SDL_CONTROLLERDEVICEREMOVED # <<<<<<<<<<<<<< * CONTROLLERDEVICEREMAPPED = SDL_CONTROLLERDEVICEREMAPPED * FINGERDOWN = SDL_FINGERDOWN */ __pyx_t_1 = __Pyx_PyInt_From_SDL_EventType(SDL_CONTROLLERDEVICEREMOVED); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 33, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (PyDict_SetItem(__pyx_d, __pyx_n_s_CONTROLLERDEVICEREMOVED, __pyx_t_1) < 0) __PYX_ERR(1, 33, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "include/event_list.pxi":34 * CONTROLLERDEVICEADDED = SDL_CONTROLLERDEVICEADDED * CONTROLLERDEVICEREMOVED = SDL_CONTROLLERDEVICEREMOVED * CONTROLLERDEVICEREMAPPED = SDL_CONTROLLERDEVICEREMAPPED # <<<<<<<<<<<<<< * FINGERDOWN = SDL_FINGERDOWN * FINGERUP = SDL_FINGERUP */ __pyx_t_1 = __Pyx_PyInt_From_SDL_EventType(SDL_CONTROLLERDEVICEREMAPPED); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 34, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (PyDict_SetItem(__pyx_d, __pyx_n_s_CONTROLLERDEVICEREMAPPED, __pyx_t_1) < 0) __PYX_ERR(1, 34, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "include/event_list.pxi":35 * CONTROLLERDEVICEREMOVED = SDL_CONTROLLERDEVICEREMOVED * CONTROLLERDEVICEREMAPPED = SDL_CONTROLLERDEVICEREMAPPED * FINGERDOWN = SDL_FINGERDOWN # <<<<<<<<<<<<<< * FINGERUP = SDL_FINGERUP * FINGERMOTION = SDL_FINGERMOTION */ __pyx_t_1 = __Pyx_PyInt_From_SDL_EventType(SDL_FINGERDOWN); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 35, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (PyDict_SetItem(__pyx_d, __pyx_n_s_FINGERDOWN, __pyx_t_1) < 0) __PYX_ERR(1, 35, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "include/event_list.pxi":36 * CONTROLLERDEVICEREMAPPED = SDL_CONTROLLERDEVICEREMAPPED * FINGERDOWN = SDL_FINGERDOWN * FINGERUP = SDL_FINGERUP # <<<<<<<<<<<<<< * FINGERMOTION = SDL_FINGERMOTION * DOLLARGESTURE = SDL_DOLLARGESTURE */ __pyx_t_1 = __Pyx_PyInt_From_SDL_EventType(SDL_FINGERUP); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 36, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (PyDict_SetItem(__pyx_d, __pyx_n_s_FINGERUP, __pyx_t_1) < 0) __PYX_ERR(1, 36, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "include/event_list.pxi":37 * FINGERDOWN = SDL_FINGERDOWN * FINGERUP = SDL_FINGERUP * FINGERMOTION = SDL_FINGERMOTION # <<<<<<<<<<<<<< * DOLLARGESTURE = SDL_DOLLARGESTURE * DOLLARRECORD = SDL_DOLLARRECORD */ __pyx_t_1 = __Pyx_PyInt_From_SDL_EventType(SDL_FINGERMOTION); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 37, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (PyDict_SetItem(__pyx_d, __pyx_n_s_FINGERMOTION, __pyx_t_1) < 0) __PYX_ERR(1, 37, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "include/event_list.pxi":38 * FINGERUP = SDL_FINGERUP * FINGERMOTION = SDL_FINGERMOTION * DOLLARGESTURE = SDL_DOLLARGESTURE # <<<<<<<<<<<<<< * DOLLARRECORD = SDL_DOLLARRECORD * MULTIGESTURE = SDL_MULTIGESTURE */ __pyx_t_1 = __Pyx_PyInt_From_SDL_EventType(SDL_DOLLARGESTURE); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 38, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (PyDict_SetItem(__pyx_d, __pyx_n_s_DOLLARGESTURE, __pyx_t_1) < 0) __PYX_ERR(1, 38, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "include/event_list.pxi":39 * FINGERMOTION = SDL_FINGERMOTION * DOLLARGESTURE = SDL_DOLLARGESTURE * DOLLARRECORD = SDL_DOLLARRECORD # <<<<<<<<<<<<<< * MULTIGESTURE = SDL_MULTIGESTURE * CLIPBOARDUPDATE = SDL_CLIPBOARDUPDATE */ __pyx_t_1 = __Pyx_PyInt_From_SDL_EventType(SDL_DOLLARRECORD); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 39, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (PyDict_SetItem(__pyx_d, __pyx_n_s_DOLLARRECORD, __pyx_t_1) < 0) __PYX_ERR(1, 39, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "include/event_list.pxi":40 * DOLLARGESTURE = SDL_DOLLARGESTURE * DOLLARRECORD = SDL_DOLLARRECORD * MULTIGESTURE = SDL_MULTIGESTURE # <<<<<<<<<<<<<< * CLIPBOARDUPDATE = SDL_CLIPBOARDUPDATE * DROPFILE = SDL_DROPFILE */ __pyx_t_1 = __Pyx_PyInt_From_SDL_EventType(SDL_MULTIGESTURE); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 40, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (PyDict_SetItem(__pyx_d, __pyx_n_s_MULTIGESTURE, __pyx_t_1) < 0) __PYX_ERR(1, 40, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "include/event_list.pxi":41 * DOLLARRECORD = SDL_DOLLARRECORD * MULTIGESTURE = SDL_MULTIGESTURE * CLIPBOARDUPDATE = SDL_CLIPBOARDUPDATE # <<<<<<<<<<<<<< * DROPFILE = SDL_DROPFILE * RENDER_TARGETS_RESET = SDL_RENDER_TARGETS_RESET */ __pyx_t_1 = __Pyx_PyInt_From_SDL_EventType(SDL_CLIPBOARDUPDATE); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 41, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (PyDict_SetItem(__pyx_d, __pyx_n_s_CLIPBOARDUPDATE, __pyx_t_1) < 0) __PYX_ERR(1, 41, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "include/event_list.pxi":42 * MULTIGESTURE = SDL_MULTIGESTURE * CLIPBOARDUPDATE = SDL_CLIPBOARDUPDATE * DROPFILE = SDL_DROPFILE # <<<<<<<<<<<<<< * RENDER_TARGETS_RESET = SDL_RENDER_TARGETS_RESET * USEREVENT = SDL_USEREVENT */ __pyx_t_1 = __Pyx_PyInt_From_SDL_EventType(SDL_DROPFILE); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 42, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (PyDict_SetItem(__pyx_d, __pyx_n_s_DROPFILE, __pyx_t_1) < 0) __PYX_ERR(1, 42, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "include/event_list.pxi":43 * CLIPBOARDUPDATE = SDL_CLIPBOARDUPDATE * DROPFILE = SDL_DROPFILE * RENDER_TARGETS_RESET = SDL_RENDER_TARGETS_RESET # <<<<<<<<<<<<<< * USEREVENT = SDL_USEREVENT * LASTEVENT = SDL_LASTEVENT */ __pyx_t_1 = __Pyx_PyInt_From_SDL_EventType(SDL_RENDER_TARGETS_RESET); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 43, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (PyDict_SetItem(__pyx_d, __pyx_n_s_RENDER_TARGETS_RESET, __pyx_t_1) < 0) __PYX_ERR(1, 43, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "include/event_list.pxi":44 * DROPFILE = SDL_DROPFILE * RENDER_TARGETS_RESET = SDL_RENDER_TARGETS_RESET * USEREVENT = SDL_USEREVENT # <<<<<<<<<<<<<< * LASTEVENT = SDL_LASTEVENT */ __pyx_t_1 = __Pyx_PyInt_From_SDL_EventType(SDL_USEREVENT); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 44, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (PyDict_SetItem(__pyx_d, __pyx_n_s_USEREVENT, __pyx_t_1) < 0) __PYX_ERR(1, 44, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "include/event_list.pxi":45 * RENDER_TARGETS_RESET = SDL_RENDER_TARGETS_RESET * USEREVENT = SDL_USEREVENT * LASTEVENT = SDL_LASTEVENT # <<<<<<<<<<<<<< */ __pyx_t_1 = __Pyx_PyInt_From_SDL_EventType(SDL_LASTEVENT); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 45, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (PyDict_SetItem(__pyx_d, __pyx_n_s_LASTEVENT, __pyx_t_1) < 0) __PYX_ERR(1, 45, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "pygame_sdl2/locals.pyx":8 * * include "event_list.pxi" * ACTIVEEVENT = SDL_LASTEVENT - 1 # <<<<<<<<<<<<<< * VIDEORESIZE = SDL_LASTEVENT - 2 * VIDEOEXPOSE = SDL_LASTEVENT - 3 */ __pyx_t_1 = __Pyx_PyInt_From_long((SDL_LASTEVENT - 1)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 8, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (PyDict_SetItem(__pyx_d, __pyx_n_s_ACTIVEEVENT, __pyx_t_1) < 0) __PYX_ERR(0, 8, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "pygame_sdl2/locals.pyx":9 * include "event_list.pxi" * ACTIVEEVENT = SDL_LASTEVENT - 1 * VIDEORESIZE = SDL_LASTEVENT - 2 # <<<<<<<<<<<<<< * VIDEOEXPOSE = SDL_LASTEVENT - 3 * */ __pyx_t_1 = __Pyx_PyInt_From_long((SDL_LASTEVENT - 2)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 9, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (PyDict_SetItem(__pyx_d, __pyx_n_s_VIDEORESIZE, __pyx_t_1) < 0) __PYX_ERR(0, 9, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "pygame_sdl2/locals.pyx":10 * ACTIVEEVENT = SDL_LASTEVENT - 1 * VIDEORESIZE = SDL_LASTEVENT - 2 * VIDEOEXPOSE = SDL_LASTEVENT - 3 # <<<<<<<<<<<<<< * * include "keycode_list.pxi" */ __pyx_t_1 = __Pyx_PyInt_From_long((SDL_LASTEVENT - 3)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 10, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (PyDict_SetItem(__pyx_d, __pyx_n_s_VIDEOEXPOSE, __pyx_t_1) < 0) __PYX_ERR(0, 10, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "include/keycode_list.pxi":4 * # Do not edit! * * K_UNKNOWN = SDLK_UNKNOWN # <<<<<<<<<<<<<< * K_RETURN = SDLK_RETURN * K_ESCAPE = SDLK_ESCAPE */ __pyx_t_1 = __Pyx_PyInt_From_int(SDLK_UNKNOWN); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 4, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (PyDict_SetItem(__pyx_d, __pyx_n_s_K_UNKNOWN, __pyx_t_1) < 0) __PYX_ERR(2, 4, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "include/keycode_list.pxi":5 * * K_UNKNOWN = SDLK_UNKNOWN * K_RETURN = SDLK_RETURN # <<<<<<<<<<<<<< * K_ESCAPE = SDLK_ESCAPE * K_BACKSPACE = SDLK_BACKSPACE */ __pyx_t_1 = __Pyx_PyInt_From_int(SDLK_RETURN); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 5, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (PyDict_SetItem(__pyx_d, __pyx_n_s_K_RETURN, __pyx_t_1) < 0) __PYX_ERR(2, 5, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "include/keycode_list.pxi":6 * K_UNKNOWN = SDLK_UNKNOWN * K_RETURN = SDLK_RETURN * K_ESCAPE = SDLK_ESCAPE # <<<<<<<<<<<<<< * K_BACKSPACE = SDLK_BACKSPACE * K_TAB = SDLK_TAB */ __pyx_t_1 = __Pyx_PyInt_From_int(SDLK_ESCAPE); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 6, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (PyDict_SetItem(__pyx_d, __pyx_n_s_K_ESCAPE, __pyx_t_1) < 0) __PYX_ERR(2, 6, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "include/keycode_list.pxi":7 * K_RETURN = SDLK_RETURN * K_ESCAPE = SDLK_ESCAPE * K_BACKSPACE = SDLK_BACKSPACE # <<<<<<<<<<<<<< * K_TAB = SDLK_TAB * K_SPACE = SDLK_SPACE */ __pyx_t_1 = __Pyx_PyInt_From_int(SDLK_BACKSPACE); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 7, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (PyDict_SetItem(__pyx_d, __pyx_n_s_K_BACKSPACE, __pyx_t_1) < 0) __PYX_ERR(2, 7, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "include/keycode_list.pxi":8 * K_ESCAPE = SDLK_ESCAPE * K_BACKSPACE = SDLK_BACKSPACE * K_TAB = SDLK_TAB # <<<<<<<<<<<<<< * K_SPACE = SDLK_SPACE * K_EXCLAIM = SDLK_EXCLAIM */ __pyx_t_1 = __Pyx_PyInt_From_int(SDLK_TAB); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 8, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (PyDict_SetItem(__pyx_d, __pyx_n_s_K_TAB, __pyx_t_1) < 0) __PYX_ERR(2, 8, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "include/keycode_list.pxi":9 * K_BACKSPACE = SDLK_BACKSPACE * K_TAB = SDLK_TAB * K_SPACE = SDLK_SPACE # <<<<<<<<<<<<<< * K_EXCLAIM = SDLK_EXCLAIM * K_QUOTEDBL = SDLK_QUOTEDBL */ __pyx_t_1 = __Pyx_PyInt_From_int(SDLK_SPACE); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 9, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (PyDict_SetItem(__pyx_d, __pyx_n_s_K_SPACE, __pyx_t_1) < 0) __PYX_ERR(2, 9, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "include/keycode_list.pxi":10 * K_TAB = SDLK_TAB * K_SPACE = SDLK_SPACE * K_EXCLAIM = SDLK_EXCLAIM # <<<<<<<<<<<<<< * K_QUOTEDBL = SDLK_QUOTEDBL * K_HASH = SDLK_HASH */ __pyx_t_1 = __Pyx_PyInt_From_int(SDLK_EXCLAIM); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 10, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (PyDict_SetItem(__pyx_d, __pyx_n_s_K_EXCLAIM, __pyx_t_1) < 0) __PYX_ERR(2, 10, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "include/keycode_list.pxi":11 * K_SPACE = SDLK_SPACE * K_EXCLAIM = SDLK_EXCLAIM * K_QUOTEDBL = SDLK_QUOTEDBL # <<<<<<<<<<<<<< * K_HASH = SDLK_HASH * K_PERCENT = SDLK_PERCENT */ __pyx_t_1 = __Pyx_PyInt_From_int(SDLK_QUOTEDBL); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 11, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (PyDict_SetItem(__pyx_d, __pyx_n_s_K_QUOTEDBL, __pyx_t_1) < 0) __PYX_ERR(2, 11, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "include/keycode_list.pxi":12 * K_EXCLAIM = SDLK_EXCLAIM * K_QUOTEDBL = SDLK_QUOTEDBL * K_HASH = SDLK_HASH # <<<<<<<<<<<<<< * K_PERCENT = SDLK_PERCENT * K_DOLLAR = SDLK_DOLLAR */ __pyx_t_1 = __Pyx_PyInt_From_int(SDLK_HASH); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 12, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (PyDict_SetItem(__pyx_d, __pyx_n_s_K_HASH, __pyx_t_1) < 0) __PYX_ERR(2, 12, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "include/keycode_list.pxi":13 * K_QUOTEDBL = SDLK_QUOTEDBL * K_HASH = SDLK_HASH * K_PERCENT = SDLK_PERCENT # <<<<<<<<<<<<<< * K_DOLLAR = SDLK_DOLLAR * K_AMPERSAND = SDLK_AMPERSAND */ __pyx_t_1 = __Pyx_PyInt_From_int(SDLK_PERCENT); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 13, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (PyDict_SetItem(__pyx_d, __pyx_n_s_K_PERCENT, __pyx_t_1) < 0) __PYX_ERR(2, 13, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "include/keycode_list.pxi":14 * K_HASH = SDLK_HASH * K_PERCENT = SDLK_PERCENT * K_DOLLAR = SDLK_DOLLAR # <<<<<<<<<<<<<< * K_AMPERSAND = SDLK_AMPERSAND * K_QUOTE = SDLK_QUOTE */ __pyx_t_1 = __Pyx_PyInt_From_int(SDLK_DOLLAR); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 14, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (PyDict_SetItem(__pyx_d, __pyx_n_s_K_DOLLAR, __pyx_t_1) < 0) __PYX_ERR(2, 14, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "include/keycode_list.pxi":15 * K_PERCENT = SDLK_PERCENT * K_DOLLAR = SDLK_DOLLAR * K_AMPERSAND = SDLK_AMPERSAND # <<<<<<<<<<<<<< * K_QUOTE = SDLK_QUOTE * K_LEFTPAREN = SDLK_LEFTPAREN */ __pyx_t_1 = __Pyx_PyInt_From_int(SDLK_AMPERSAND); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 15, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (PyDict_SetItem(__pyx_d, __pyx_n_s_K_AMPERSAND, __pyx_t_1) < 0) __PYX_ERR(2, 15, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "include/keycode_list.pxi":16 * K_DOLLAR = SDLK_DOLLAR * K_AMPERSAND = SDLK_AMPERSAND * K_QUOTE = SDLK_QUOTE # <<<<<<<<<<<<<< * K_LEFTPAREN = SDLK_LEFTPAREN * K_RIGHTPAREN = SDLK_RIGHTPAREN */ __pyx_t_1 = __Pyx_PyInt_From_int(SDLK_QUOTE); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 16, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (PyDict_SetItem(__pyx_d, __pyx_n_s_K_QUOTE, __pyx_t_1) < 0) __PYX_ERR(2, 16, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "include/keycode_list.pxi":17 * K_AMPERSAND = SDLK_AMPERSAND * K_QUOTE = SDLK_QUOTE * K_LEFTPAREN = SDLK_LEFTPAREN # <<<<<<<<<<<<<< * K_RIGHTPAREN = SDLK_RIGHTPAREN * K_ASTERISK = SDLK_ASTERISK */ __pyx_t_1 = __Pyx_PyInt_From_int(SDLK_LEFTPAREN); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 17, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (PyDict_SetItem(__pyx_d, __pyx_n_s_K_LEFTPAREN, __pyx_t_1) < 0) __PYX_ERR(2, 17, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "include/keycode_list.pxi":18 * K_QUOTE = SDLK_QUOTE * K_LEFTPAREN = SDLK_LEFTPAREN * K_RIGHTPAREN = SDLK_RIGHTPAREN # <<<<<<<<<<<<<< * K_ASTERISK = SDLK_ASTERISK * K_PLUS = SDLK_PLUS */ __pyx_t_1 = __Pyx_PyInt_From_int(SDLK_RIGHTPAREN); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 18, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (PyDict_SetItem(__pyx_d, __pyx_n_s_K_RIGHTPAREN, __pyx_t_1) < 0) __PYX_ERR(2, 18, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "include/keycode_list.pxi":19 * K_LEFTPAREN = SDLK_LEFTPAREN * K_RIGHTPAREN = SDLK_RIGHTPAREN * K_ASTERISK = SDLK_ASTERISK # <<<<<<<<<<<<<< * K_PLUS = SDLK_PLUS * K_COMMA = SDLK_COMMA */ __pyx_t_1 = __Pyx_PyInt_From_int(SDLK_ASTERISK); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 19, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (PyDict_SetItem(__pyx_d, __pyx_n_s_K_ASTERISK, __pyx_t_1) < 0) __PYX_ERR(2, 19, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "include/keycode_list.pxi":20 * K_RIGHTPAREN = SDLK_RIGHTPAREN * K_ASTERISK = SDLK_ASTERISK * K_PLUS = SDLK_PLUS # <<<<<<<<<<<<<< * K_COMMA = SDLK_COMMA * K_MINUS = SDLK_MINUS */ __pyx_t_1 = __Pyx_PyInt_From_int(SDLK_PLUS); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 20, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (PyDict_SetItem(__pyx_d, __pyx_n_s_K_PLUS, __pyx_t_1) < 0) __PYX_ERR(2, 20, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "include/keycode_list.pxi":21 * K_ASTERISK = SDLK_ASTERISK * K_PLUS = SDLK_PLUS * K_COMMA = SDLK_COMMA # <<<<<<<<<<<<<< * K_MINUS = SDLK_MINUS * K_PERIOD = SDLK_PERIOD */ __pyx_t_1 = __Pyx_PyInt_From_int(SDLK_COMMA); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 21, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (PyDict_SetItem(__pyx_d, __pyx_n_s_K_COMMA, __pyx_t_1) < 0) __PYX_ERR(2, 21, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "include/keycode_list.pxi":22 * K_PLUS = SDLK_PLUS * K_COMMA = SDLK_COMMA * K_MINUS = SDLK_MINUS # <<<<<<<<<<<<<< * K_PERIOD = SDLK_PERIOD * K_SLASH = SDLK_SLASH */ __pyx_t_1 = __Pyx_PyInt_From_int(SDLK_MINUS); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 22, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (PyDict_SetItem(__pyx_d, __pyx_n_s_K_MINUS, __pyx_t_1) < 0) __PYX_ERR(2, 22, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "include/keycode_list.pxi":23 * K_COMMA = SDLK_COMMA * K_MINUS = SDLK_MINUS * K_PERIOD = SDLK_PERIOD # <<<<<<<<<<<<<< * K_SLASH = SDLK_SLASH * K_0 = SDLK_0 */ __pyx_t_1 = __Pyx_PyInt_From_int(SDLK_PERIOD); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 23, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (PyDict_SetItem(__pyx_d, __pyx_n_s_K_PERIOD, __pyx_t_1) < 0) __PYX_ERR(2, 23, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "include/keycode_list.pxi":24 * K_MINUS = SDLK_MINUS * K_PERIOD = SDLK_PERIOD * K_SLASH = SDLK_SLASH # <<<<<<<<<<<<<< * K_0 = SDLK_0 * K_1 = SDLK_1 */ __pyx_t_1 = __Pyx_PyInt_From_int(SDLK_SLASH); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 24, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (PyDict_SetItem(__pyx_d, __pyx_n_s_K_SLASH, __pyx_t_1) < 0) __PYX_ERR(2, 24, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "include/keycode_list.pxi":25 * K_PERIOD = SDLK_PERIOD * K_SLASH = SDLK_SLASH * K_0 = SDLK_0 # <<<<<<<<<<<<<< * K_1 = SDLK_1 * K_2 = SDLK_2 */ __pyx_t_1 = __Pyx_PyInt_From_int(SDLK_0); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 25, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (PyDict_SetItem(__pyx_d, __pyx_n_s_K_0, __pyx_t_1) < 0) __PYX_ERR(2, 25, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "include/keycode_list.pxi":26 * K_SLASH = SDLK_SLASH * K_0 = SDLK_0 * K_1 = SDLK_1 # <<<<<<<<<<<<<< * K_2 = SDLK_2 * K_3 = SDLK_3 */ __pyx_t_1 = __Pyx_PyInt_From_int(SDLK_1); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 26, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (PyDict_SetItem(__pyx_d, __pyx_n_s_K_1, __pyx_t_1) < 0) __PYX_ERR(2, 26, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "include/keycode_list.pxi":27 * K_0 = SDLK_0 * K_1 = SDLK_1 * K_2 = SDLK_2 # <<<<<<<<<<<<<< * K_3 = SDLK_3 * K_4 = SDLK_4 */ __pyx_t_1 = __Pyx_PyInt_From_int(SDLK_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 27, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (PyDict_SetItem(__pyx_d, __pyx_n_s_K_2, __pyx_t_1) < 0) __PYX_ERR(2, 27, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "include/keycode_list.pxi":28 * K_1 = SDLK_1 * K_2 = SDLK_2 * K_3 = SDLK_3 # <<<<<<<<<<<<<< * K_4 = SDLK_4 * K_5 = SDLK_5 */ __pyx_t_1 = __Pyx_PyInt_From_int(SDLK_3); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 28, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (PyDict_SetItem(__pyx_d, __pyx_n_s_K_3, __pyx_t_1) < 0) __PYX_ERR(2, 28, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "include/keycode_list.pxi":29 * K_2 = SDLK_2 * K_3 = SDLK_3 * K_4 = SDLK_4 # <<<<<<<<<<<<<< * K_5 = SDLK_5 * K_6 = SDLK_6 */ __pyx_t_1 = __Pyx_PyInt_From_int(SDLK_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 29, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (PyDict_SetItem(__pyx_d, __pyx_n_s_K_4, __pyx_t_1) < 0) __PYX_ERR(2, 29, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "include/keycode_list.pxi":30 * K_3 = SDLK_3 * K_4 = SDLK_4 * K_5 = SDLK_5 # <<<<<<<<<<<<<< * K_6 = SDLK_6 * K_7 = SDLK_7 */ __pyx_t_1 = __Pyx_PyInt_From_int(SDLK_5); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 30, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (PyDict_SetItem(__pyx_d, __pyx_n_s_K_5, __pyx_t_1) < 0) __PYX_ERR(2, 30, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "include/keycode_list.pxi":31 * K_4 = SDLK_4 * K_5 = SDLK_5 * K_6 = SDLK_6 # <<<<<<<<<<<<<< * K_7 = SDLK_7 * K_8 = SDLK_8 */ __pyx_t_1 = __Pyx_PyInt_From_int(SDLK_6); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 31, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (PyDict_SetItem(__pyx_d, __pyx_n_s_K_6, __pyx_t_1) < 0) __PYX_ERR(2, 31, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "include/keycode_list.pxi":32 * K_5 = SDLK_5 * K_6 = SDLK_6 * K_7 = SDLK_7 # <<<<<<<<<<<<<< * K_8 = SDLK_8 * K_9 = SDLK_9 */ __pyx_t_1 = __Pyx_PyInt_From_int(SDLK_7); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 32, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (PyDict_SetItem(__pyx_d, __pyx_n_s_K_7, __pyx_t_1) < 0) __PYX_ERR(2, 32, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "include/keycode_list.pxi":33 * K_6 = SDLK_6 * K_7 = SDLK_7 * K_8 = SDLK_8 # <<<<<<<<<<<<<< * K_9 = SDLK_9 * K_COLON = SDLK_COLON */ __pyx_t_1 = __Pyx_PyInt_From_int(SDLK_8); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 33, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (PyDict_SetItem(__pyx_d, __pyx_n_s_K_8, __pyx_t_1) < 0) __PYX_ERR(2, 33, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "include/keycode_list.pxi":34 * K_7 = SDLK_7 * K_8 = SDLK_8 * K_9 = SDLK_9 # <<<<<<<<<<<<<< * K_COLON = SDLK_COLON * K_SEMICOLON = SDLK_SEMICOLON */ __pyx_t_1 = __Pyx_PyInt_From_int(SDLK_9); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 34, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (PyDict_SetItem(__pyx_d, __pyx_n_s_K_9, __pyx_t_1) < 0) __PYX_ERR(2, 34, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "include/keycode_list.pxi":35 * K_8 = SDLK_8 * K_9 = SDLK_9 * K_COLON = SDLK_COLON # <<<<<<<<<<<<<< * K_SEMICOLON = SDLK_SEMICOLON * K_LESS = SDLK_LESS */ __pyx_t_1 = __Pyx_PyInt_From_int(SDLK_COLON); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 35, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (PyDict_SetItem(__pyx_d, __pyx_n_s_K_COLON, __pyx_t_1) < 0) __PYX_ERR(2, 35, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "include/keycode_list.pxi":36 * K_9 = SDLK_9 * K_COLON = SDLK_COLON * K_SEMICOLON = SDLK_SEMICOLON # <<<<<<<<<<<<<< * K_LESS = SDLK_LESS * K_EQUALS = SDLK_EQUALS */ __pyx_t_1 = __Pyx_PyInt_From_int(SDLK_SEMICOLON); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 36, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (PyDict_SetItem(__pyx_d, __pyx_n_s_K_SEMICOLON, __pyx_t_1) < 0) __PYX_ERR(2, 36, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "include/keycode_list.pxi":37 * K_COLON = SDLK_COLON * K_SEMICOLON = SDLK_SEMICOLON * K_LESS = SDLK_LESS # <<<<<<<<<<<<<< * K_EQUALS = SDLK_EQUALS * K_GREATER = SDLK_GREATER */ __pyx_t_1 = __Pyx_PyInt_From_int(SDLK_LESS); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 37, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (PyDict_SetItem(__pyx_d, __pyx_n_s_K_LESS, __pyx_t_1) < 0) __PYX_ERR(2, 37, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "include/keycode_list.pxi":38 * K_SEMICOLON = SDLK_SEMICOLON * K_LESS = SDLK_LESS * K_EQUALS = SDLK_EQUALS # <<<<<<<<<<<<<< * K_GREATER = SDLK_GREATER * K_QUESTION = SDLK_QUESTION */ __pyx_t_1 = __Pyx_PyInt_From_int(SDLK_EQUALS); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 38, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (PyDict_SetItem(__pyx_d, __pyx_n_s_K_EQUALS, __pyx_t_1) < 0) __PYX_ERR(2, 38, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "include/keycode_list.pxi":39 * K_LESS = SDLK_LESS * K_EQUALS = SDLK_EQUALS * K_GREATER = SDLK_GREATER # <<<<<<<<<<<<<< * K_QUESTION = SDLK_QUESTION * K_AT = SDLK_AT */ __pyx_t_1 = __Pyx_PyInt_From_int(SDLK_GREATER); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 39, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (PyDict_SetItem(__pyx_d, __pyx_n_s_K_GREATER, __pyx_t_1) < 0) __PYX_ERR(2, 39, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "include/keycode_list.pxi":40 * K_EQUALS = SDLK_EQUALS * K_GREATER = SDLK_GREATER * K_QUESTION = SDLK_QUESTION # <<<<<<<<<<<<<< * K_AT = SDLK_AT * K_LEFTBRACKET = SDLK_LEFTBRACKET */ __pyx_t_1 = __Pyx_PyInt_From_int(SDLK_QUESTION); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 40, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (PyDict_SetItem(__pyx_d, __pyx_n_s_K_QUESTION, __pyx_t_1) < 0) __PYX_ERR(2, 40, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "include/keycode_list.pxi":41 * K_GREATER = SDLK_GREATER * K_QUESTION = SDLK_QUESTION * K_AT = SDLK_AT # <<<<<<<<<<<<<< * K_LEFTBRACKET = SDLK_LEFTBRACKET * K_BACKSLASH = SDLK_BACKSLASH */ __pyx_t_1 = __Pyx_PyInt_From_int(SDLK_AT); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 41, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (PyDict_SetItem(__pyx_d, __pyx_n_s_K_AT, __pyx_t_1) < 0) __PYX_ERR(2, 41, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "include/keycode_list.pxi":42 * K_QUESTION = SDLK_QUESTION * K_AT = SDLK_AT * K_LEFTBRACKET = SDLK_LEFTBRACKET # <<<<<<<<<<<<<< * K_BACKSLASH = SDLK_BACKSLASH * K_RIGHTBRACKET = SDLK_RIGHTBRACKET */ __pyx_t_1 = __Pyx_PyInt_From_int(SDLK_LEFTBRACKET); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 42, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (PyDict_SetItem(__pyx_d, __pyx_n_s_K_LEFTBRACKET, __pyx_t_1) < 0) __PYX_ERR(2, 42, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "include/keycode_list.pxi":43 * K_AT = SDLK_AT * K_LEFTBRACKET = SDLK_LEFTBRACKET * K_BACKSLASH = SDLK_BACKSLASH # <<<<<<<<<<<<<< * K_RIGHTBRACKET = SDLK_RIGHTBRACKET * K_CARET = SDLK_CARET */ __pyx_t_1 = __Pyx_PyInt_From_int(SDLK_BACKSLASH); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 43, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (PyDict_SetItem(__pyx_d, __pyx_n_s_K_BACKSLASH, __pyx_t_1) < 0) __PYX_ERR(2, 43, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "include/keycode_list.pxi":44 * K_LEFTBRACKET = SDLK_LEFTBRACKET * K_BACKSLASH = SDLK_BACKSLASH * K_RIGHTBRACKET = SDLK_RIGHTBRACKET # <<<<<<<<<<<<<< * K_CARET = SDLK_CARET * K_UNDERSCORE = SDLK_UNDERSCORE */ __pyx_t_1 = __Pyx_PyInt_From_int(SDLK_RIGHTBRACKET); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 44, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (PyDict_SetItem(__pyx_d, __pyx_n_s_K_RIGHTBRACKET, __pyx_t_1) < 0) __PYX_ERR(2, 44, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "include/keycode_list.pxi":45 * K_BACKSLASH = SDLK_BACKSLASH * K_RIGHTBRACKET = SDLK_RIGHTBRACKET * K_CARET = SDLK_CARET # <<<<<<<<<<<<<< * K_UNDERSCORE = SDLK_UNDERSCORE * K_BACKQUOTE = SDLK_BACKQUOTE */ __pyx_t_1 = __Pyx_PyInt_From_int(SDLK_CARET); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 45, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (PyDict_SetItem(__pyx_d, __pyx_n_s_K_CARET, __pyx_t_1) < 0) __PYX_ERR(2, 45, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "include/keycode_list.pxi":46 * K_RIGHTBRACKET = SDLK_RIGHTBRACKET * K_CARET = SDLK_CARET * K_UNDERSCORE = SDLK_UNDERSCORE # <<<<<<<<<<<<<< * K_BACKQUOTE = SDLK_BACKQUOTE * K_a = SDLK_a */ __pyx_t_1 = __Pyx_PyInt_From_int(SDLK_UNDERSCORE); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 46, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (PyDict_SetItem(__pyx_d, __pyx_n_s_K_UNDERSCORE, __pyx_t_1) < 0) __PYX_ERR(2, 46, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "include/keycode_list.pxi":47 * K_CARET = SDLK_CARET * K_UNDERSCORE = SDLK_UNDERSCORE * K_BACKQUOTE = SDLK_BACKQUOTE # <<<<<<<<<<<<<< * K_a = SDLK_a * K_b = SDLK_b */ __pyx_t_1 = __Pyx_PyInt_From_int(SDLK_BACKQUOTE); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 47, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (PyDict_SetItem(__pyx_d, __pyx_n_s_K_BACKQUOTE, __pyx_t_1) < 0) __PYX_ERR(2, 47, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "include/keycode_list.pxi":48 * K_UNDERSCORE = SDLK_UNDERSCORE * K_BACKQUOTE = SDLK_BACKQUOTE * K_a = SDLK_a # <<<<<<<<<<<<<< * K_b = SDLK_b * K_c = SDLK_c */ __pyx_t_1 = __Pyx_PyInt_From_int(SDLK_a); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 48, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (PyDict_SetItem(__pyx_d, __pyx_n_s_K_a, __pyx_t_1) < 0) __PYX_ERR(2, 48, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "include/keycode_list.pxi":49 * K_BACKQUOTE = SDLK_BACKQUOTE * K_a = SDLK_a * K_b = SDLK_b # <<<<<<<<<<<<<< * K_c = SDLK_c * K_d = SDLK_d */ __pyx_t_1 = __Pyx_PyInt_From_int(SDLK_b); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 49, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (PyDict_SetItem(__pyx_d, __pyx_n_s_K_b, __pyx_t_1) < 0) __PYX_ERR(2, 49, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "include/keycode_list.pxi":50 * K_a = SDLK_a * K_b = SDLK_b * K_c = SDLK_c # <<<<<<<<<<<<<< * K_d = SDLK_d * K_e = SDLK_e */ __pyx_t_1 = __Pyx_PyInt_From_int(SDLK_c); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 50, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (PyDict_SetItem(__pyx_d, __pyx_n_s_K_c, __pyx_t_1) < 0) __PYX_ERR(2, 50, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "include/keycode_list.pxi":51 * K_b = SDLK_b * K_c = SDLK_c * K_d = SDLK_d # <<<<<<<<<<<<<< * K_e = SDLK_e * K_f = SDLK_f */ __pyx_t_1 = __Pyx_PyInt_From_int(SDLK_d); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 51, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (PyDict_SetItem(__pyx_d, __pyx_n_s_K_d, __pyx_t_1) < 0) __PYX_ERR(2, 51, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "include/keycode_list.pxi":52 * K_c = SDLK_c * K_d = SDLK_d * K_e = SDLK_e # <<<<<<<<<<<<<< * K_f = SDLK_f * K_g = SDLK_g */ __pyx_t_1 = __Pyx_PyInt_From_int(SDLK_e); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 52, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (PyDict_SetItem(__pyx_d, __pyx_n_s_K_e, __pyx_t_1) < 0) __PYX_ERR(2, 52, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "include/keycode_list.pxi":53 * K_d = SDLK_d * K_e = SDLK_e * K_f = SDLK_f # <<<<<<<<<<<<<< * K_g = SDLK_g * K_h = SDLK_h */ __pyx_t_1 = __Pyx_PyInt_From_int(SDLK_f); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 53, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (PyDict_SetItem(__pyx_d, __pyx_n_s_K_f, __pyx_t_1) < 0) __PYX_ERR(2, 53, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "include/keycode_list.pxi":54 * K_e = SDLK_e * K_f = SDLK_f * K_g = SDLK_g # <<<<<<<<<<<<<< * K_h = SDLK_h * K_i = SDLK_i */ __pyx_t_1 = __Pyx_PyInt_From_int(SDLK_g); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 54, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (PyDict_SetItem(__pyx_d, __pyx_n_s_K_g, __pyx_t_1) < 0) __PYX_ERR(2, 54, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "include/keycode_list.pxi":55 * K_f = SDLK_f * K_g = SDLK_g * K_h = SDLK_h # <<<<<<<<<<<<<< * K_i = SDLK_i * K_j = SDLK_j */ __pyx_t_1 = __Pyx_PyInt_From_int(SDLK_h); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 55, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (PyDict_SetItem(__pyx_d, __pyx_n_s_K_h, __pyx_t_1) < 0) __PYX_ERR(2, 55, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "include/keycode_list.pxi":56 * K_g = SDLK_g * K_h = SDLK_h * K_i = SDLK_i # <<<<<<<<<<<<<< * K_j = SDLK_j * K_k = SDLK_k */ __pyx_t_1 = __Pyx_PyInt_From_int(SDLK_i); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 56, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (PyDict_SetItem(__pyx_d, __pyx_n_s_K_i, __pyx_t_1) < 0) __PYX_ERR(2, 56, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "include/keycode_list.pxi":57 * K_h = SDLK_h * K_i = SDLK_i * K_j = SDLK_j # <<<<<<<<<<<<<< * K_k = SDLK_k * K_l = SDLK_l */ __pyx_t_1 = __Pyx_PyInt_From_int(SDLK_j); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 57, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (PyDict_SetItem(__pyx_d, __pyx_n_s_K_j, __pyx_t_1) < 0) __PYX_ERR(2, 57, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "include/keycode_list.pxi":58 * K_i = SDLK_i * K_j = SDLK_j * K_k = SDLK_k # <<<<<<<<<<<<<< * K_l = SDLK_l * K_m = SDLK_m */ __pyx_t_1 = __Pyx_PyInt_From_int(SDLK_k); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 58, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (PyDict_SetItem(__pyx_d, __pyx_n_s_K_k, __pyx_t_1) < 0) __PYX_ERR(2, 58, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "include/keycode_list.pxi":59 * K_j = SDLK_j * K_k = SDLK_k * K_l = SDLK_l # <<<<<<<<<<<<<< * K_m = SDLK_m * K_n = SDLK_n */ __pyx_t_1 = __Pyx_PyInt_From_int(SDLK_l); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 59, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (PyDict_SetItem(__pyx_d, __pyx_n_s_K_l, __pyx_t_1) < 0) __PYX_ERR(2, 59, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "include/keycode_list.pxi":60 * K_k = SDLK_k * K_l = SDLK_l * K_m = SDLK_m # <<<<<<<<<<<<<< * K_n = SDLK_n * K_o = SDLK_o */ __pyx_t_1 = __Pyx_PyInt_From_int(SDLK_m); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 60, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (PyDict_SetItem(__pyx_d, __pyx_n_s_K_m, __pyx_t_1) < 0) __PYX_ERR(2, 60, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "include/keycode_list.pxi":61 * K_l = SDLK_l * K_m = SDLK_m * K_n = SDLK_n # <<<<<<<<<<<<<< * K_o = SDLK_o * K_p = SDLK_p */ __pyx_t_1 = __Pyx_PyInt_From_int(SDLK_n); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 61, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (PyDict_SetItem(__pyx_d, __pyx_n_s_K_n, __pyx_t_1) < 0) __PYX_ERR(2, 61, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "include/keycode_list.pxi":62 * K_m = SDLK_m * K_n = SDLK_n * K_o = SDLK_o # <<<<<<<<<<<<<< * K_p = SDLK_p * K_q = SDLK_q */ __pyx_t_1 = __Pyx_PyInt_From_int(SDLK_o); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 62, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (PyDict_SetItem(__pyx_d, __pyx_n_s_K_o, __pyx_t_1) < 0) __PYX_ERR(2, 62, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "include/keycode_list.pxi":63 * K_n = SDLK_n * K_o = SDLK_o * K_p = SDLK_p # <<<<<<<<<<<<<< * K_q = SDLK_q * K_r = SDLK_r */ __pyx_t_1 = __Pyx_PyInt_From_int(SDLK_p); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 63, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (PyDict_SetItem(__pyx_d, __pyx_n_s_K_p, __pyx_t_1) < 0) __PYX_ERR(2, 63, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "include/keycode_list.pxi":64 * K_o = SDLK_o * K_p = SDLK_p * K_q = SDLK_q # <<<<<<<<<<<<<< * K_r = SDLK_r * K_s = SDLK_s */ __pyx_t_1 = __Pyx_PyInt_From_int(SDLK_q); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 64, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (PyDict_SetItem(__pyx_d, __pyx_n_s_K_q, __pyx_t_1) < 0) __PYX_ERR(2, 64, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "include/keycode_list.pxi":65 * K_p = SDLK_p * K_q = SDLK_q * K_r = SDLK_r # <<<<<<<<<<<<<< * K_s = SDLK_s * K_t = SDLK_t */ __pyx_t_1 = __Pyx_PyInt_From_int(SDLK_r); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 65, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (PyDict_SetItem(__pyx_d, __pyx_n_s_K_r, __pyx_t_1) < 0) __PYX_ERR(2, 65, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "include/keycode_list.pxi":66 * K_q = SDLK_q * K_r = SDLK_r * K_s = SDLK_s # <<<<<<<<<<<<<< * K_t = SDLK_t * K_u = SDLK_u */ __pyx_t_1 = __Pyx_PyInt_From_int(SDLK_s); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 66, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (PyDict_SetItem(__pyx_d, __pyx_n_s_K_s, __pyx_t_1) < 0) __PYX_ERR(2, 66, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "include/keycode_list.pxi":67 * K_r = SDLK_r * K_s = SDLK_s * K_t = SDLK_t # <<<<<<<<<<<<<< * K_u = SDLK_u * K_v = SDLK_v */ __pyx_t_1 = __Pyx_PyInt_From_int(SDLK_t); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 67, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (PyDict_SetItem(__pyx_d, __pyx_n_s_K_t, __pyx_t_1) < 0) __PYX_ERR(2, 67, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "include/keycode_list.pxi":68 * K_s = SDLK_s * K_t = SDLK_t * K_u = SDLK_u # <<<<<<<<<<<<<< * K_v = SDLK_v * K_w = SDLK_w */ __pyx_t_1 = __Pyx_PyInt_From_int(SDLK_u); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 68, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (PyDict_SetItem(__pyx_d, __pyx_n_s_K_u, __pyx_t_1) < 0) __PYX_ERR(2, 68, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "include/keycode_list.pxi":69 * K_t = SDLK_t * K_u = SDLK_u * K_v = SDLK_v # <<<<<<<<<<<<<< * K_w = SDLK_w * K_x = SDLK_x */ __pyx_t_1 = __Pyx_PyInt_From_int(SDLK_v); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 69, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (PyDict_SetItem(__pyx_d, __pyx_n_s_K_v, __pyx_t_1) < 0) __PYX_ERR(2, 69, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "include/keycode_list.pxi":70 * K_u = SDLK_u * K_v = SDLK_v * K_w = SDLK_w # <<<<<<<<<<<<<< * K_x = SDLK_x * K_y = SDLK_y */ __pyx_t_1 = __Pyx_PyInt_From_int(SDLK_w); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 70, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (PyDict_SetItem(__pyx_d, __pyx_n_s_K_w, __pyx_t_1) < 0) __PYX_ERR(2, 70, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "include/keycode_list.pxi":71 * K_v = SDLK_v * K_w = SDLK_w * K_x = SDLK_x # <<<<<<<<<<<<<< * K_y = SDLK_y * K_z = SDLK_z */ __pyx_t_1 = __Pyx_PyInt_From_int(SDLK_x); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 71, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (PyDict_SetItem(__pyx_d, __pyx_n_s_K_x, __pyx_t_1) < 0) __PYX_ERR(2, 71, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "include/keycode_list.pxi":72 * K_w = SDLK_w * K_x = SDLK_x * K_y = SDLK_y # <<<<<<<<<<<<<< * K_z = SDLK_z * K_CAPSLOCK = SDLK_CAPSLOCK */ __pyx_t_1 = __Pyx_PyInt_From_int(SDLK_y); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 72, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (PyDict_SetItem(__pyx_d, __pyx_n_s_K_y, __pyx_t_1) < 0) __PYX_ERR(2, 72, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "include/keycode_list.pxi":73 * K_x = SDLK_x * K_y = SDLK_y * K_z = SDLK_z # <<<<<<<<<<<<<< * K_CAPSLOCK = SDLK_CAPSLOCK * K_F1 = SDLK_F1 */ __pyx_t_1 = __Pyx_PyInt_From_int(SDLK_z); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 73, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (PyDict_SetItem(__pyx_d, __pyx_n_s_K_z, __pyx_t_1) < 0) __PYX_ERR(2, 73, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "include/keycode_list.pxi":74 * K_y = SDLK_y * K_z = SDLK_z * K_CAPSLOCK = SDLK_CAPSLOCK # <<<<<<<<<<<<<< * K_F1 = SDLK_F1 * K_F2 = SDLK_F2 */ __pyx_t_1 = __Pyx_PyInt_From_int(SDLK_CAPSLOCK); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 74, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (PyDict_SetItem(__pyx_d, __pyx_n_s_K_CAPSLOCK, __pyx_t_1) < 0) __PYX_ERR(2, 74, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "include/keycode_list.pxi":75 * K_z = SDLK_z * K_CAPSLOCK = SDLK_CAPSLOCK * K_F1 = SDLK_F1 # <<<<<<<<<<<<<< * K_F2 = SDLK_F2 * K_F3 = SDLK_F3 */ __pyx_t_1 = __Pyx_PyInt_From_int(SDLK_F1); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 75, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (PyDict_SetItem(__pyx_d, __pyx_n_s_K_F1, __pyx_t_1) < 0) __PYX_ERR(2, 75, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "include/keycode_list.pxi":76 * K_CAPSLOCK = SDLK_CAPSLOCK * K_F1 = SDLK_F1 * K_F2 = SDLK_F2 # <<<<<<<<<<<<<< * K_F3 = SDLK_F3 * K_F4 = SDLK_F4 */ __pyx_t_1 = __Pyx_PyInt_From_int(SDLK_F2); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 76, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (PyDict_SetItem(__pyx_d, __pyx_n_s_K_F2, __pyx_t_1) < 0) __PYX_ERR(2, 76, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "include/keycode_list.pxi":77 * K_F1 = SDLK_F1 * K_F2 = SDLK_F2 * K_F3 = SDLK_F3 # <<<<<<<<<<<<<< * K_F4 = SDLK_F4 * K_F5 = SDLK_F5 */ __pyx_t_1 = __Pyx_PyInt_From_int(SDLK_F3); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 77, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (PyDict_SetItem(__pyx_d, __pyx_n_s_K_F3, __pyx_t_1) < 0) __PYX_ERR(2, 77, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "include/keycode_list.pxi":78 * K_F2 = SDLK_F2 * K_F3 = SDLK_F3 * K_F4 = SDLK_F4 # <<<<<<<<<<<<<< * K_F5 = SDLK_F5 * K_F6 = SDLK_F6 */ __pyx_t_1 = __Pyx_PyInt_From_int(SDLK_F4); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 78, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (PyDict_SetItem(__pyx_d, __pyx_n_s_K_F4, __pyx_t_1) < 0) __PYX_ERR(2, 78, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "include/keycode_list.pxi":79 * K_F3 = SDLK_F3 * K_F4 = SDLK_F4 * K_F5 = SDLK_F5 # <<<<<<<<<<<<<< * K_F6 = SDLK_F6 * K_F7 = SDLK_F7 */ __pyx_t_1 = __Pyx_PyInt_From_int(SDLK_F5); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 79, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (PyDict_SetItem(__pyx_d, __pyx_n_s_K_F5, __pyx_t_1) < 0) __PYX_ERR(2, 79, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "include/keycode_list.pxi":80 * K_F4 = SDLK_F4 * K_F5 = SDLK_F5 * K_F6 = SDLK_F6 # <<<<<<<<<<<<<< * K_F7 = SDLK_F7 * K_F8 = SDLK_F8 */ __pyx_t_1 = __Pyx_PyInt_From_int(SDLK_F6); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 80, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (PyDict_SetItem(__pyx_d, __pyx_n_s_K_F6, __pyx_t_1) < 0) __PYX_ERR(2, 80, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "include/keycode_list.pxi":81 * K_F5 = SDLK_F5 * K_F6 = SDLK_F6 * K_F7 = SDLK_F7 # <<<<<<<<<<<<<< * K_F8 = SDLK_F8 * K_F9 = SDLK_F9 */ __pyx_t_1 = __Pyx_PyInt_From_int(SDLK_F7); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 81, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (PyDict_SetItem(__pyx_d, __pyx_n_s_K_F7, __pyx_t_1) < 0) __PYX_ERR(2, 81, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "include/keycode_list.pxi":82 * K_F6 = SDLK_F6 * K_F7 = SDLK_F7 * K_F8 = SDLK_F8 # <<<<<<<<<<<<<< * K_F9 = SDLK_F9 * K_F10 = SDLK_F10 */ __pyx_t_1 = __Pyx_PyInt_From_int(SDLK_F8); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 82, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (PyDict_SetItem(__pyx_d, __pyx_n_s_K_F8, __pyx_t_1) < 0) __PYX_ERR(2, 82, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "include/keycode_list.pxi":83 * K_F7 = SDLK_F7 * K_F8 = SDLK_F8 * K_F9 = SDLK_F9 # <<<<<<<<<<<<<< * K_F10 = SDLK_F10 * K_F11 = SDLK_F11 */ __pyx_t_1 = __Pyx_PyInt_From_int(SDLK_F9); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 83, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (PyDict_SetItem(__pyx_d, __pyx_n_s_K_F9, __pyx_t_1) < 0) __PYX_ERR(2, 83, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "include/keycode_list.pxi":84 * K_F8 = SDLK_F8 * K_F9 = SDLK_F9 * K_F10 = SDLK_F10 # <<<<<<<<<<<<<< * K_F11 = SDLK_F11 * K_F12 = SDLK_F12 */ __pyx_t_1 = __Pyx_PyInt_From_int(SDLK_F10); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 84, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (PyDict_SetItem(__pyx_d, __pyx_n_s_K_F10, __pyx_t_1) < 0) __PYX_ERR(2, 84, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "include/keycode_list.pxi":85 * K_F9 = SDLK_F9 * K_F10 = SDLK_F10 * K_F11 = SDLK_F11 # <<<<<<<<<<<<<< * K_F12 = SDLK_F12 * K_PRINTSCREEN = SDLK_PRINTSCREEN */ __pyx_t_1 = __Pyx_PyInt_From_int(SDLK_F11); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 85, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (PyDict_SetItem(__pyx_d, __pyx_n_s_K_F11, __pyx_t_1) < 0) __PYX_ERR(2, 85, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "include/keycode_list.pxi":86 * K_F10 = SDLK_F10 * K_F11 = SDLK_F11 * K_F12 = SDLK_F12 # <<<<<<<<<<<<<< * K_PRINTSCREEN = SDLK_PRINTSCREEN * K_SCROLLLOCK = SDLK_SCROLLLOCK */ __pyx_t_1 = __Pyx_PyInt_From_int(SDLK_F12); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 86, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (PyDict_SetItem(__pyx_d, __pyx_n_s_K_F12, __pyx_t_1) < 0) __PYX_ERR(2, 86, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "include/keycode_list.pxi":87 * K_F11 = SDLK_F11 * K_F12 = SDLK_F12 * K_PRINTSCREEN = SDLK_PRINTSCREEN # <<<<<<<<<<<<<< * K_SCROLLLOCK = SDLK_SCROLLLOCK * K_PAUSE = SDLK_PAUSE */ __pyx_t_1 = __Pyx_PyInt_From_int(SDLK_PRINTSCREEN); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 87, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (PyDict_SetItem(__pyx_d, __pyx_n_s_K_PRINTSCREEN, __pyx_t_1) < 0) __PYX_ERR(2, 87, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "include/keycode_list.pxi":88 * K_F12 = SDLK_F12 * K_PRINTSCREEN = SDLK_PRINTSCREEN * K_SCROLLLOCK = SDLK_SCROLLLOCK # <<<<<<<<<<<<<< * K_PAUSE = SDLK_PAUSE * K_INSERT = SDLK_INSERT */ __pyx_t_1 = __Pyx_PyInt_From_int(SDLK_SCROLLLOCK); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 88, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (PyDict_SetItem(__pyx_d, __pyx_n_s_K_SCROLLLOCK, __pyx_t_1) < 0) __PYX_ERR(2, 88, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "include/keycode_list.pxi":89 * K_PRINTSCREEN = SDLK_PRINTSCREEN * K_SCROLLLOCK = SDLK_SCROLLLOCK * K_PAUSE = SDLK_PAUSE # <<<<<<<<<<<<<< * K_INSERT = SDLK_INSERT * K_HOME = SDLK_HOME */ __pyx_t_1 = __Pyx_PyInt_From_int(SDLK_PAUSE); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 89, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (PyDict_SetItem(__pyx_d, __pyx_n_s_K_PAUSE, __pyx_t_1) < 0) __PYX_ERR(2, 89, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "include/keycode_list.pxi":90 * K_SCROLLLOCK = SDLK_SCROLLLOCK * K_PAUSE = SDLK_PAUSE * K_INSERT = SDLK_INSERT # <<<<<<<<<<<<<< * K_HOME = SDLK_HOME * K_PAGEUP = SDLK_PAGEUP */ __pyx_t_1 = __Pyx_PyInt_From_int(SDLK_INSERT); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 90, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (PyDict_SetItem(__pyx_d, __pyx_n_s_K_INSERT, __pyx_t_1) < 0) __PYX_ERR(2, 90, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "include/keycode_list.pxi":91 * K_PAUSE = SDLK_PAUSE * K_INSERT = SDLK_INSERT * K_HOME = SDLK_HOME # <<<<<<<<<<<<<< * K_PAGEUP = SDLK_PAGEUP * K_DELETE = SDLK_DELETE */ __pyx_t_1 = __Pyx_PyInt_From_int(SDLK_HOME); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 91, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (PyDict_SetItem(__pyx_d, __pyx_n_s_K_HOME, __pyx_t_1) < 0) __PYX_ERR(2, 91, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "include/keycode_list.pxi":92 * K_INSERT = SDLK_INSERT * K_HOME = SDLK_HOME * K_PAGEUP = SDLK_PAGEUP # <<<<<<<<<<<<<< * K_DELETE = SDLK_DELETE * K_END = SDLK_END */ __pyx_t_1 = __Pyx_PyInt_From_int(SDLK_PAGEUP); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 92, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (PyDict_SetItem(__pyx_d, __pyx_n_s_K_PAGEUP, __pyx_t_1) < 0) __PYX_ERR(2, 92, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "include/keycode_list.pxi":93 * K_HOME = SDLK_HOME * K_PAGEUP = SDLK_PAGEUP * K_DELETE = SDLK_DELETE # <<<<<<<<<<<<<< * K_END = SDLK_END * K_PAGEDOWN = SDLK_PAGEDOWN */ __pyx_t_1 = __Pyx_PyInt_From_int(SDLK_DELETE); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 93, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (PyDict_SetItem(__pyx_d, __pyx_n_s_K_DELETE, __pyx_t_1) < 0) __PYX_ERR(2, 93, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "include/keycode_list.pxi":94 * K_PAGEUP = SDLK_PAGEUP * K_DELETE = SDLK_DELETE * K_END = SDLK_END # <<<<<<<<<<<<<< * K_PAGEDOWN = SDLK_PAGEDOWN * K_RIGHT = SDLK_RIGHT */ __pyx_t_1 = __Pyx_PyInt_From_int(SDLK_END); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 94, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (PyDict_SetItem(__pyx_d, __pyx_n_s_K_END, __pyx_t_1) < 0) __PYX_ERR(2, 94, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "include/keycode_list.pxi":95 * K_DELETE = SDLK_DELETE * K_END = SDLK_END * K_PAGEDOWN = SDLK_PAGEDOWN # <<<<<<<<<<<<<< * K_RIGHT = SDLK_RIGHT * K_LEFT = SDLK_LEFT */ __pyx_t_1 = __Pyx_PyInt_From_int(SDLK_PAGEDOWN); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 95, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (PyDict_SetItem(__pyx_d, __pyx_n_s_K_PAGEDOWN, __pyx_t_1) < 0) __PYX_ERR(2, 95, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "include/keycode_list.pxi":96 * K_END = SDLK_END * K_PAGEDOWN = SDLK_PAGEDOWN * K_RIGHT = SDLK_RIGHT # <<<<<<<<<<<<<< * K_LEFT = SDLK_LEFT * K_DOWN = SDLK_DOWN */ __pyx_t_1 = __Pyx_PyInt_From_int(SDLK_RIGHT); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 96, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (PyDict_SetItem(__pyx_d, __pyx_n_s_K_RIGHT, __pyx_t_1) < 0) __PYX_ERR(2, 96, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "include/keycode_list.pxi":97 * K_PAGEDOWN = SDLK_PAGEDOWN * K_RIGHT = SDLK_RIGHT * K_LEFT = SDLK_LEFT # <<<<<<<<<<<<<< * K_DOWN = SDLK_DOWN * K_UP = SDLK_UP */ __pyx_t_1 = __Pyx_PyInt_From_int(SDLK_LEFT); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 97, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (PyDict_SetItem(__pyx_d, __pyx_n_s_K_LEFT, __pyx_t_1) < 0) __PYX_ERR(2, 97, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "include/keycode_list.pxi":98 * K_RIGHT = SDLK_RIGHT * K_LEFT = SDLK_LEFT * K_DOWN = SDLK_DOWN # <<<<<<<<<<<<<< * K_UP = SDLK_UP * K_NUMLOCKCLEAR = SDLK_NUMLOCKCLEAR */ __pyx_t_1 = __Pyx_PyInt_From_int(SDLK_DOWN); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 98, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (PyDict_SetItem(__pyx_d, __pyx_n_s_K_DOWN, __pyx_t_1) < 0) __PYX_ERR(2, 98, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "include/keycode_list.pxi":99 * K_LEFT = SDLK_LEFT * K_DOWN = SDLK_DOWN * K_UP = SDLK_UP # <<<<<<<<<<<<<< * K_NUMLOCKCLEAR = SDLK_NUMLOCKCLEAR * K_KP_DIVIDE = SDLK_KP_DIVIDE */ __pyx_t_1 = __Pyx_PyInt_From_int(SDLK_UP); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 99, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (PyDict_SetItem(__pyx_d, __pyx_n_s_K_UP, __pyx_t_1) < 0) __PYX_ERR(2, 99, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "include/keycode_list.pxi":100 * K_DOWN = SDLK_DOWN * K_UP = SDLK_UP * K_NUMLOCKCLEAR = SDLK_NUMLOCKCLEAR # <<<<<<<<<<<<<< * K_KP_DIVIDE = SDLK_KP_DIVIDE * K_KP_MULTIPLY = SDLK_KP_MULTIPLY */ __pyx_t_1 = __Pyx_PyInt_From_int(SDLK_NUMLOCKCLEAR); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 100, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (PyDict_SetItem(__pyx_d, __pyx_n_s_K_NUMLOCKCLEAR, __pyx_t_1) < 0) __PYX_ERR(2, 100, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "include/keycode_list.pxi":101 * K_UP = SDLK_UP * K_NUMLOCKCLEAR = SDLK_NUMLOCKCLEAR * K_KP_DIVIDE = SDLK_KP_DIVIDE # <<<<<<<<<<<<<< * K_KP_MULTIPLY = SDLK_KP_MULTIPLY * K_KP_MINUS = SDLK_KP_MINUS */ __pyx_t_1 = __Pyx_PyInt_From_int(SDLK_KP_DIVIDE); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 101, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (PyDict_SetItem(__pyx_d, __pyx_n_s_K_KP_DIVIDE, __pyx_t_1) < 0) __PYX_ERR(2, 101, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "include/keycode_list.pxi":102 * K_NUMLOCKCLEAR = SDLK_NUMLOCKCLEAR * K_KP_DIVIDE = SDLK_KP_DIVIDE * K_KP_MULTIPLY = SDLK_KP_MULTIPLY # <<<<<<<<<<<<<< * K_KP_MINUS = SDLK_KP_MINUS * K_KP_PLUS = SDLK_KP_PLUS */ __pyx_t_1 = __Pyx_PyInt_From_int(SDLK_KP_MULTIPLY); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 102, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (PyDict_SetItem(__pyx_d, __pyx_n_s_K_KP_MULTIPLY, __pyx_t_1) < 0) __PYX_ERR(2, 102, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "include/keycode_list.pxi":103 * K_KP_DIVIDE = SDLK_KP_DIVIDE * K_KP_MULTIPLY = SDLK_KP_MULTIPLY * K_KP_MINUS = SDLK_KP_MINUS # <<<<<<<<<<<<<< * K_KP_PLUS = SDLK_KP_PLUS * K_KP_ENTER = SDLK_KP_ENTER */ __pyx_t_1 = __Pyx_PyInt_From_int(SDLK_KP_MINUS); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 103, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (PyDict_SetItem(__pyx_d, __pyx_n_s_K_KP_MINUS, __pyx_t_1) < 0) __PYX_ERR(2, 103, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "include/keycode_list.pxi":104 * K_KP_MULTIPLY = SDLK_KP_MULTIPLY * K_KP_MINUS = SDLK_KP_MINUS * K_KP_PLUS = SDLK_KP_PLUS # <<<<<<<<<<<<<< * K_KP_ENTER = SDLK_KP_ENTER * K_KP_1 = SDLK_KP_1 */ __pyx_t_1 = __Pyx_PyInt_From_int(SDLK_KP_PLUS); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 104, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (PyDict_SetItem(__pyx_d, __pyx_n_s_K_KP_PLUS, __pyx_t_1) < 0) __PYX_ERR(2, 104, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "include/keycode_list.pxi":105 * K_KP_MINUS = SDLK_KP_MINUS * K_KP_PLUS = SDLK_KP_PLUS * K_KP_ENTER = SDLK_KP_ENTER # <<<<<<<<<<<<<< * K_KP_1 = SDLK_KP_1 * K_KP_2 = SDLK_KP_2 */ __pyx_t_1 = __Pyx_PyInt_From_int(SDLK_KP_ENTER); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 105, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (PyDict_SetItem(__pyx_d, __pyx_n_s_K_KP_ENTER, __pyx_t_1) < 0) __PYX_ERR(2, 105, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "include/keycode_list.pxi":106 * K_KP_PLUS = SDLK_KP_PLUS * K_KP_ENTER = SDLK_KP_ENTER * K_KP_1 = SDLK_KP_1 # <<<<<<<<<<<<<< * K_KP_2 = SDLK_KP_2 * K_KP_3 = SDLK_KP_3 */ __pyx_t_1 = __Pyx_PyInt_From_int(SDLK_KP_1); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 106, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (PyDict_SetItem(__pyx_d, __pyx_n_s_K_KP_1, __pyx_t_1) < 0) __PYX_ERR(2, 106, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "include/keycode_list.pxi":107 * K_KP_ENTER = SDLK_KP_ENTER * K_KP_1 = SDLK_KP_1 * K_KP_2 = SDLK_KP_2 # <<<<<<<<<<<<<< * K_KP_3 = SDLK_KP_3 * K_KP_4 = SDLK_KP_4 */ __pyx_t_1 = __Pyx_PyInt_From_int(SDLK_KP_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 107, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (PyDict_SetItem(__pyx_d, __pyx_n_s_K_KP_2, __pyx_t_1) < 0) __PYX_ERR(2, 107, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "include/keycode_list.pxi":108 * K_KP_1 = SDLK_KP_1 * K_KP_2 = SDLK_KP_2 * K_KP_3 = SDLK_KP_3 # <<<<<<<<<<<<<< * K_KP_4 = SDLK_KP_4 * K_KP_5 = SDLK_KP_5 */ __pyx_t_1 = __Pyx_PyInt_From_int(SDLK_KP_3); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 108, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (PyDict_SetItem(__pyx_d, __pyx_n_s_K_KP_3, __pyx_t_1) < 0) __PYX_ERR(2, 108, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "include/keycode_list.pxi":109 * K_KP_2 = SDLK_KP_2 * K_KP_3 = SDLK_KP_3 * K_KP_4 = SDLK_KP_4 # <<<<<<<<<<<<<< * K_KP_5 = SDLK_KP_5 * K_KP_6 = SDLK_KP_6 */ __pyx_t_1 = __Pyx_PyInt_From_int(SDLK_KP_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 109, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (PyDict_SetItem(__pyx_d, __pyx_n_s_K_KP_4, __pyx_t_1) < 0) __PYX_ERR(2, 109, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "include/keycode_list.pxi":110 * K_KP_3 = SDLK_KP_3 * K_KP_4 = SDLK_KP_4 * K_KP_5 = SDLK_KP_5 # <<<<<<<<<<<<<< * K_KP_6 = SDLK_KP_6 * K_KP_7 = SDLK_KP_7 */ __pyx_t_1 = __Pyx_PyInt_From_int(SDLK_KP_5); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 110, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (PyDict_SetItem(__pyx_d, __pyx_n_s_K_KP_5, __pyx_t_1) < 0) __PYX_ERR(2, 110, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "include/keycode_list.pxi":111 * K_KP_4 = SDLK_KP_4 * K_KP_5 = SDLK_KP_5 * K_KP_6 = SDLK_KP_6 # <<<<<<<<<<<<<< * K_KP_7 = SDLK_KP_7 * K_KP_8 = SDLK_KP_8 */ __pyx_t_1 = __Pyx_PyInt_From_int(SDLK_KP_6); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 111, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (PyDict_SetItem(__pyx_d, __pyx_n_s_K_KP_6, __pyx_t_1) < 0) __PYX_ERR(2, 111, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "include/keycode_list.pxi":112 * K_KP_5 = SDLK_KP_5 * K_KP_6 = SDLK_KP_6 * K_KP_7 = SDLK_KP_7 # <<<<<<<<<<<<<< * K_KP_8 = SDLK_KP_8 * K_KP_9 = SDLK_KP_9 */ __pyx_t_1 = __Pyx_PyInt_From_int(SDLK_KP_7); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 112, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (PyDict_SetItem(__pyx_d, __pyx_n_s_K_KP_7, __pyx_t_1) < 0) __PYX_ERR(2, 112, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "include/keycode_list.pxi":113 * K_KP_6 = SDLK_KP_6 * K_KP_7 = SDLK_KP_7 * K_KP_8 = SDLK_KP_8 # <<<<<<<<<<<<<< * K_KP_9 = SDLK_KP_9 * K_KP_0 = SDLK_KP_0 */ __pyx_t_1 = __Pyx_PyInt_From_int(SDLK_KP_8); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 113, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (PyDict_SetItem(__pyx_d, __pyx_n_s_K_KP_8, __pyx_t_1) < 0) __PYX_ERR(2, 113, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "include/keycode_list.pxi":114 * K_KP_7 = SDLK_KP_7 * K_KP_8 = SDLK_KP_8 * K_KP_9 = SDLK_KP_9 # <<<<<<<<<<<<<< * K_KP_0 = SDLK_KP_0 * K_KP_PERIOD = SDLK_KP_PERIOD */ __pyx_t_1 = __Pyx_PyInt_From_int(SDLK_KP_9); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 114, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (PyDict_SetItem(__pyx_d, __pyx_n_s_K_KP_9, __pyx_t_1) < 0) __PYX_ERR(2, 114, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "include/keycode_list.pxi":115 * K_KP_8 = SDLK_KP_8 * K_KP_9 = SDLK_KP_9 * K_KP_0 = SDLK_KP_0 # <<<<<<<<<<<<<< * K_KP_PERIOD = SDLK_KP_PERIOD * K_APPLICATION = SDLK_APPLICATION */ __pyx_t_1 = __Pyx_PyInt_From_int(SDLK_KP_0); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 115, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (PyDict_SetItem(__pyx_d, __pyx_n_s_K_KP_0, __pyx_t_1) < 0) __PYX_ERR(2, 115, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "include/keycode_list.pxi":116 * K_KP_9 = SDLK_KP_9 * K_KP_0 = SDLK_KP_0 * K_KP_PERIOD = SDLK_KP_PERIOD # <<<<<<<<<<<<<< * K_APPLICATION = SDLK_APPLICATION * K_POWER = SDLK_POWER */ __pyx_t_1 = __Pyx_PyInt_From_int(SDLK_KP_PERIOD); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 116, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (PyDict_SetItem(__pyx_d, __pyx_n_s_K_KP_PERIOD, __pyx_t_1) < 0) __PYX_ERR(2, 116, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "include/keycode_list.pxi":117 * K_KP_0 = SDLK_KP_0 * K_KP_PERIOD = SDLK_KP_PERIOD * K_APPLICATION = SDLK_APPLICATION # <<<<<<<<<<<<<< * K_POWER = SDLK_POWER * K_KP_EQUALS = SDLK_KP_EQUALS */ __pyx_t_1 = __Pyx_PyInt_From_int(SDLK_APPLICATION); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 117, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (PyDict_SetItem(__pyx_d, __pyx_n_s_K_APPLICATION, __pyx_t_1) < 0) __PYX_ERR(2, 117, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "include/keycode_list.pxi":118 * K_KP_PERIOD = SDLK_KP_PERIOD * K_APPLICATION = SDLK_APPLICATION * K_POWER = SDLK_POWER # <<<<<<<<<<<<<< * K_KP_EQUALS = SDLK_KP_EQUALS * K_F13 = SDLK_F13 */ __pyx_t_1 = __Pyx_PyInt_From_int(SDLK_POWER); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 118, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (PyDict_SetItem(__pyx_d, __pyx_n_s_K_POWER, __pyx_t_1) < 0) __PYX_ERR(2, 118, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "include/keycode_list.pxi":119 * K_APPLICATION = SDLK_APPLICATION * K_POWER = SDLK_POWER * K_KP_EQUALS = SDLK_KP_EQUALS # <<<<<<<<<<<<<< * K_F13 = SDLK_F13 * K_F14 = SDLK_F14 */ __pyx_t_1 = __Pyx_PyInt_From_int(SDLK_KP_EQUALS); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 119, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (PyDict_SetItem(__pyx_d, __pyx_n_s_K_KP_EQUALS, __pyx_t_1) < 0) __PYX_ERR(2, 119, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "include/keycode_list.pxi":120 * K_POWER = SDLK_POWER * K_KP_EQUALS = SDLK_KP_EQUALS * K_F13 = SDLK_F13 # <<<<<<<<<<<<<< * K_F14 = SDLK_F14 * K_F15 = SDLK_F15 */ __pyx_t_1 = __Pyx_PyInt_From_int(SDLK_F13); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 120, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (PyDict_SetItem(__pyx_d, __pyx_n_s_K_F13, __pyx_t_1) < 0) __PYX_ERR(2, 120, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "include/keycode_list.pxi":121 * K_KP_EQUALS = SDLK_KP_EQUALS * K_F13 = SDLK_F13 * K_F14 = SDLK_F14 # <<<<<<<<<<<<<< * K_F15 = SDLK_F15 * K_F16 = SDLK_F16 */ __pyx_t_1 = __Pyx_PyInt_From_int(SDLK_F14); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 121, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (PyDict_SetItem(__pyx_d, __pyx_n_s_K_F14, __pyx_t_1) < 0) __PYX_ERR(2, 121, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "include/keycode_list.pxi":122 * K_F13 = SDLK_F13 * K_F14 = SDLK_F14 * K_F15 = SDLK_F15 # <<<<<<<<<<<<<< * K_F16 = SDLK_F16 * K_F17 = SDLK_F17 */ __pyx_t_1 = __Pyx_PyInt_From_int(SDLK_F15); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 122, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (PyDict_SetItem(__pyx_d, __pyx_n_s_K_F15, __pyx_t_1) < 0) __PYX_ERR(2, 122, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "include/keycode_list.pxi":123 * K_F14 = SDLK_F14 * K_F15 = SDLK_F15 * K_F16 = SDLK_F16 # <<<<<<<<<<<<<< * K_F17 = SDLK_F17 * K_F18 = SDLK_F18 */ __pyx_t_1 = __Pyx_PyInt_From_int(SDLK_F16); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 123, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (PyDict_SetItem(__pyx_d, __pyx_n_s_K_F16, __pyx_t_1) < 0) __PYX_ERR(2, 123, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "include/keycode_list.pxi":124 * K_F15 = SDLK_F15 * K_F16 = SDLK_F16 * K_F17 = SDLK_F17 # <<<<<<<<<<<<<< * K_F18 = SDLK_F18 * K_F19 = SDLK_F19 */ __pyx_t_1 = __Pyx_PyInt_From_int(SDLK_F17); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 124, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (PyDict_SetItem(__pyx_d, __pyx_n_s_K_F17, __pyx_t_1) < 0) __PYX_ERR(2, 124, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "include/keycode_list.pxi":125 * K_F16 = SDLK_F16 * K_F17 = SDLK_F17 * K_F18 = SDLK_F18 # <<<<<<<<<<<<<< * K_F19 = SDLK_F19 * K_F20 = SDLK_F20 */ __pyx_t_1 = __Pyx_PyInt_From_int(SDLK_F18); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 125, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (PyDict_SetItem(__pyx_d, __pyx_n_s_K_F18, __pyx_t_1) < 0) __PYX_ERR(2, 125, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "include/keycode_list.pxi":126 * K_F17 = SDLK_F17 * K_F18 = SDLK_F18 * K_F19 = SDLK_F19 # <<<<<<<<<<<<<< * K_F20 = SDLK_F20 * K_F21 = SDLK_F21 */ __pyx_t_1 = __Pyx_PyInt_From_int(SDLK_F19); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 126, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (PyDict_SetItem(__pyx_d, __pyx_n_s_K_F19, __pyx_t_1) < 0) __PYX_ERR(2, 126, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "include/keycode_list.pxi":127 * K_F18 = SDLK_F18 * K_F19 = SDLK_F19 * K_F20 = SDLK_F20 # <<<<<<<<<<<<<< * K_F21 = SDLK_F21 * K_F22 = SDLK_F22 */ __pyx_t_1 = __Pyx_PyInt_From_int(SDLK_F20); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 127, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (PyDict_SetItem(__pyx_d, __pyx_n_s_K_F20, __pyx_t_1) < 0) __PYX_ERR(2, 127, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "include/keycode_list.pxi":128 * K_F19 = SDLK_F19 * K_F20 = SDLK_F20 * K_F21 = SDLK_F21 # <<<<<<<<<<<<<< * K_F22 = SDLK_F22 * K_F23 = SDLK_F23 */ __pyx_t_1 = __Pyx_PyInt_From_int(SDLK_F21); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 128, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (PyDict_SetItem(__pyx_d, __pyx_n_s_K_F21, __pyx_t_1) < 0) __PYX_ERR(2, 128, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "include/keycode_list.pxi":129 * K_F20 = SDLK_F20 * K_F21 = SDLK_F21 * K_F22 = SDLK_F22 # <<<<<<<<<<<<<< * K_F23 = SDLK_F23 * K_F24 = SDLK_F24 */ __pyx_t_1 = __Pyx_PyInt_From_int(SDLK_F22); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 129, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (PyDict_SetItem(__pyx_d, __pyx_n_s_K_F22, __pyx_t_1) < 0) __PYX_ERR(2, 129, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "include/keycode_list.pxi":130 * K_F21 = SDLK_F21 * K_F22 = SDLK_F22 * K_F23 = SDLK_F23 # <<<<<<<<<<<<<< * K_F24 = SDLK_F24 * K_EXECUTE = SDLK_EXECUTE */ __pyx_t_1 = __Pyx_PyInt_From_int(SDLK_F23); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 130, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (PyDict_SetItem(__pyx_d, __pyx_n_s_K_F23, __pyx_t_1) < 0) __PYX_ERR(2, 130, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "include/keycode_list.pxi":131 * K_F22 = SDLK_F22 * K_F23 = SDLK_F23 * K_F24 = SDLK_F24 # <<<<<<<<<<<<<< * K_EXECUTE = SDLK_EXECUTE * K_HELP = SDLK_HELP */ __pyx_t_1 = __Pyx_PyInt_From_int(SDLK_F24); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 131, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (PyDict_SetItem(__pyx_d, __pyx_n_s_K_F24, __pyx_t_1) < 0) __PYX_ERR(2, 131, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "include/keycode_list.pxi":132 * K_F23 = SDLK_F23 * K_F24 = SDLK_F24 * K_EXECUTE = SDLK_EXECUTE # <<<<<<<<<<<<<< * K_HELP = SDLK_HELP * K_MENU = SDLK_MENU */ __pyx_t_1 = __Pyx_PyInt_From_int(SDLK_EXECUTE); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 132, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (PyDict_SetItem(__pyx_d, __pyx_n_s_K_EXECUTE, __pyx_t_1) < 0) __PYX_ERR(2, 132, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "include/keycode_list.pxi":133 * K_F24 = SDLK_F24 * K_EXECUTE = SDLK_EXECUTE * K_HELP = SDLK_HELP # <<<<<<<<<<<<<< * K_MENU = SDLK_MENU * K_SELECT = SDLK_SELECT */ __pyx_t_1 = __Pyx_PyInt_From_int(SDLK_HELP); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 133, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (PyDict_SetItem(__pyx_d, __pyx_n_s_K_HELP, __pyx_t_1) < 0) __PYX_ERR(2, 133, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "include/keycode_list.pxi":134 * K_EXECUTE = SDLK_EXECUTE * K_HELP = SDLK_HELP * K_MENU = SDLK_MENU # <<<<<<<<<<<<<< * K_SELECT = SDLK_SELECT * K_STOP = SDLK_STOP */ __pyx_t_1 = __Pyx_PyInt_From_int(SDLK_MENU); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 134, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (PyDict_SetItem(__pyx_d, __pyx_n_s_K_MENU, __pyx_t_1) < 0) __PYX_ERR(2, 134, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "include/keycode_list.pxi":135 * K_HELP = SDLK_HELP * K_MENU = SDLK_MENU * K_SELECT = SDLK_SELECT # <<<<<<<<<<<<<< * K_STOP = SDLK_STOP * K_AGAIN = SDLK_AGAIN */ __pyx_t_1 = __Pyx_PyInt_From_int(SDLK_SELECT); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 135, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (PyDict_SetItem(__pyx_d, __pyx_n_s_K_SELECT, __pyx_t_1) < 0) __PYX_ERR(2, 135, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "include/keycode_list.pxi":136 * K_MENU = SDLK_MENU * K_SELECT = SDLK_SELECT * K_STOP = SDLK_STOP # <<<<<<<<<<<<<< * K_AGAIN = SDLK_AGAIN * K_UNDO = SDLK_UNDO */ __pyx_t_1 = __Pyx_PyInt_From_int(SDLK_STOP); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 136, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (PyDict_SetItem(__pyx_d, __pyx_n_s_K_STOP, __pyx_t_1) < 0) __PYX_ERR(2, 136, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "include/keycode_list.pxi":137 * K_SELECT = SDLK_SELECT * K_STOP = SDLK_STOP * K_AGAIN = SDLK_AGAIN # <<<<<<<<<<<<<< * K_UNDO = SDLK_UNDO * K_CUT = SDLK_CUT */ __pyx_t_1 = __Pyx_PyInt_From_int(SDLK_AGAIN); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 137, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (PyDict_SetItem(__pyx_d, __pyx_n_s_K_AGAIN, __pyx_t_1) < 0) __PYX_ERR(2, 137, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "include/keycode_list.pxi":138 * K_STOP = SDLK_STOP * K_AGAIN = SDLK_AGAIN * K_UNDO = SDLK_UNDO # <<<<<<<<<<<<<< * K_CUT = SDLK_CUT * K_COPY = SDLK_COPY */ __pyx_t_1 = __Pyx_PyInt_From_int(SDLK_UNDO); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 138, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (PyDict_SetItem(__pyx_d, __pyx_n_s_K_UNDO, __pyx_t_1) < 0) __PYX_ERR(2, 138, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "include/keycode_list.pxi":139 * K_AGAIN = SDLK_AGAIN * K_UNDO = SDLK_UNDO * K_CUT = SDLK_CUT # <<<<<<<<<<<<<< * K_COPY = SDLK_COPY * K_PASTE = SDLK_PASTE */ __pyx_t_1 = __Pyx_PyInt_From_int(SDLK_CUT); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 139, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (PyDict_SetItem(__pyx_d, __pyx_n_s_K_CUT, __pyx_t_1) < 0) __PYX_ERR(2, 139, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "include/keycode_list.pxi":140 * K_UNDO = SDLK_UNDO * K_CUT = SDLK_CUT * K_COPY = SDLK_COPY # <<<<<<<<<<<<<< * K_PASTE = SDLK_PASTE * K_FIND = SDLK_FIND */ __pyx_t_1 = __Pyx_PyInt_From_int(SDLK_COPY); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 140, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (PyDict_SetItem(__pyx_d, __pyx_n_s_K_COPY, __pyx_t_1) < 0) __PYX_ERR(2, 140, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "include/keycode_list.pxi":141 * K_CUT = SDLK_CUT * K_COPY = SDLK_COPY * K_PASTE = SDLK_PASTE # <<<<<<<<<<<<<< * K_FIND = SDLK_FIND * K_MUTE = SDLK_MUTE */ __pyx_t_1 = __Pyx_PyInt_From_int(SDLK_PASTE); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 141, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (PyDict_SetItem(__pyx_d, __pyx_n_s_K_PASTE, __pyx_t_1) < 0) __PYX_ERR(2, 141, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "include/keycode_list.pxi":142 * K_COPY = SDLK_COPY * K_PASTE = SDLK_PASTE * K_FIND = SDLK_FIND # <<<<<<<<<<<<<< * K_MUTE = SDLK_MUTE * K_VOLUMEUP = SDLK_VOLUMEUP */ __pyx_t_1 = __Pyx_PyInt_From_int(SDLK_FIND); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 142, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (PyDict_SetItem(__pyx_d, __pyx_n_s_K_FIND, __pyx_t_1) < 0) __PYX_ERR(2, 142, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "include/keycode_list.pxi":143 * K_PASTE = SDLK_PASTE * K_FIND = SDLK_FIND * K_MUTE = SDLK_MUTE # <<<<<<<<<<<<<< * K_VOLUMEUP = SDLK_VOLUMEUP * K_VOLUMEDOWN = SDLK_VOLUMEDOWN */ __pyx_t_1 = __Pyx_PyInt_From_int(SDLK_MUTE); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 143, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (PyDict_SetItem(__pyx_d, __pyx_n_s_K_MUTE, __pyx_t_1) < 0) __PYX_ERR(2, 143, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "include/keycode_list.pxi":144 * K_FIND = SDLK_FIND * K_MUTE = SDLK_MUTE * K_VOLUMEUP = SDLK_VOLUMEUP # <<<<<<<<<<<<<< * K_VOLUMEDOWN = SDLK_VOLUMEDOWN * K_KP_COMMA = SDLK_KP_COMMA */ __pyx_t_1 = __Pyx_PyInt_From_int(SDLK_VOLUMEUP); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 144, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (PyDict_SetItem(__pyx_d, __pyx_n_s_K_VOLUMEUP, __pyx_t_1) < 0) __PYX_ERR(2, 144, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "include/keycode_list.pxi":145 * K_MUTE = SDLK_MUTE * K_VOLUMEUP = SDLK_VOLUMEUP * K_VOLUMEDOWN = SDLK_VOLUMEDOWN # <<<<<<<<<<<<<< * K_KP_COMMA = SDLK_KP_COMMA * K_KP_EQUALSAS400 = SDLK_KP_EQUALSAS400 */ __pyx_t_1 = __Pyx_PyInt_From_int(SDLK_VOLUMEDOWN); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 145, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (PyDict_SetItem(__pyx_d, __pyx_n_s_K_VOLUMEDOWN, __pyx_t_1) < 0) __PYX_ERR(2, 145, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "include/keycode_list.pxi":146 * K_VOLUMEUP = SDLK_VOLUMEUP * K_VOLUMEDOWN = SDLK_VOLUMEDOWN * K_KP_COMMA = SDLK_KP_COMMA # <<<<<<<<<<<<<< * K_KP_EQUALSAS400 = SDLK_KP_EQUALSAS400 * K_ALTERASE = SDLK_ALTERASE */ __pyx_t_1 = __Pyx_PyInt_From_int(SDLK_KP_COMMA); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 146, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (PyDict_SetItem(__pyx_d, __pyx_n_s_K_KP_COMMA, __pyx_t_1) < 0) __PYX_ERR(2, 146, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "include/keycode_list.pxi":147 * K_VOLUMEDOWN = SDLK_VOLUMEDOWN * K_KP_COMMA = SDLK_KP_COMMA * K_KP_EQUALSAS400 = SDLK_KP_EQUALSAS400 # <<<<<<<<<<<<<< * K_ALTERASE = SDLK_ALTERASE * K_SYSREQ = SDLK_SYSREQ */ __pyx_t_1 = __Pyx_PyInt_From_int(SDLK_KP_EQUALSAS400); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 147, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (PyDict_SetItem(__pyx_d, __pyx_n_s_K_KP_EQUALSAS400, __pyx_t_1) < 0) __PYX_ERR(2, 147, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "include/keycode_list.pxi":148 * K_KP_COMMA = SDLK_KP_COMMA * K_KP_EQUALSAS400 = SDLK_KP_EQUALSAS400 * K_ALTERASE = SDLK_ALTERASE # <<<<<<<<<<<<<< * K_SYSREQ = SDLK_SYSREQ * K_CANCEL = SDLK_CANCEL */ __pyx_t_1 = __Pyx_PyInt_From_int(SDLK_ALTERASE); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 148, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (PyDict_SetItem(__pyx_d, __pyx_n_s_K_ALTERASE, __pyx_t_1) < 0) __PYX_ERR(2, 148, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "include/keycode_list.pxi":149 * K_KP_EQUALSAS400 = SDLK_KP_EQUALSAS400 * K_ALTERASE = SDLK_ALTERASE * K_SYSREQ = SDLK_SYSREQ # <<<<<<<<<<<<<< * K_CANCEL = SDLK_CANCEL * K_CLEAR = SDLK_CLEAR */ __pyx_t_1 = __Pyx_PyInt_From_int(SDLK_SYSREQ); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 149, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (PyDict_SetItem(__pyx_d, __pyx_n_s_K_SYSREQ, __pyx_t_1) < 0) __PYX_ERR(2, 149, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "include/keycode_list.pxi":150 * K_ALTERASE = SDLK_ALTERASE * K_SYSREQ = SDLK_SYSREQ * K_CANCEL = SDLK_CANCEL # <<<<<<<<<<<<<< * K_CLEAR = SDLK_CLEAR * K_PRIOR = SDLK_PRIOR */ __pyx_t_1 = __Pyx_PyInt_From_int(SDLK_CANCEL); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 150, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (PyDict_SetItem(__pyx_d, __pyx_n_s_K_CANCEL, __pyx_t_1) < 0) __PYX_ERR(2, 150, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "include/keycode_list.pxi":151 * K_SYSREQ = SDLK_SYSREQ * K_CANCEL = SDLK_CANCEL * K_CLEAR = SDLK_CLEAR # <<<<<<<<<<<<<< * K_PRIOR = SDLK_PRIOR * K_RETURN2 = SDLK_RETURN2 */ __pyx_t_1 = __Pyx_PyInt_From_int(SDLK_CLEAR); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 151, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (PyDict_SetItem(__pyx_d, __pyx_n_s_K_CLEAR, __pyx_t_1) < 0) __PYX_ERR(2, 151, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "include/keycode_list.pxi":152 * K_CANCEL = SDLK_CANCEL * K_CLEAR = SDLK_CLEAR * K_PRIOR = SDLK_PRIOR # <<<<<<<<<<<<<< * K_RETURN2 = SDLK_RETURN2 * K_SEPARATOR = SDLK_SEPARATOR */ __pyx_t_1 = __Pyx_PyInt_From_int(SDLK_PRIOR); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 152, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (PyDict_SetItem(__pyx_d, __pyx_n_s_K_PRIOR, __pyx_t_1) < 0) __PYX_ERR(2, 152, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "include/keycode_list.pxi":153 * K_CLEAR = SDLK_CLEAR * K_PRIOR = SDLK_PRIOR * K_RETURN2 = SDLK_RETURN2 # <<<<<<<<<<<<<< * K_SEPARATOR = SDLK_SEPARATOR * K_OUT = SDLK_OUT */ __pyx_t_1 = __Pyx_PyInt_From_int(SDLK_RETURN2); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 153, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (PyDict_SetItem(__pyx_d, __pyx_n_s_K_RETURN2, __pyx_t_1) < 0) __PYX_ERR(2, 153, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "include/keycode_list.pxi":154 * K_PRIOR = SDLK_PRIOR * K_RETURN2 = SDLK_RETURN2 * K_SEPARATOR = SDLK_SEPARATOR # <<<<<<<<<<<<<< * K_OUT = SDLK_OUT * K_OPER = SDLK_OPER */ __pyx_t_1 = __Pyx_PyInt_From_int(SDLK_SEPARATOR); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 154, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (PyDict_SetItem(__pyx_d, __pyx_n_s_K_SEPARATOR, __pyx_t_1) < 0) __PYX_ERR(2, 154, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "include/keycode_list.pxi":155 * K_RETURN2 = SDLK_RETURN2 * K_SEPARATOR = SDLK_SEPARATOR * K_OUT = SDLK_OUT # <<<<<<<<<<<<<< * K_OPER = SDLK_OPER * K_CLEARAGAIN = SDLK_CLEARAGAIN */ __pyx_t_1 = __Pyx_PyInt_From_int(SDLK_OUT); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 155, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (PyDict_SetItem(__pyx_d, __pyx_n_s_K_OUT, __pyx_t_1) < 0) __PYX_ERR(2, 155, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "include/keycode_list.pxi":156 * K_SEPARATOR = SDLK_SEPARATOR * K_OUT = SDLK_OUT * K_OPER = SDLK_OPER # <<<<<<<<<<<<<< * K_CLEARAGAIN = SDLK_CLEARAGAIN * K_CRSEL = SDLK_CRSEL */ __pyx_t_1 = __Pyx_PyInt_From_int(SDLK_OPER); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 156, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (PyDict_SetItem(__pyx_d, __pyx_n_s_K_OPER, __pyx_t_1) < 0) __PYX_ERR(2, 156, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "include/keycode_list.pxi":157 * K_OUT = SDLK_OUT * K_OPER = SDLK_OPER * K_CLEARAGAIN = SDLK_CLEARAGAIN # <<<<<<<<<<<<<< * K_CRSEL = SDLK_CRSEL * K_EXSEL = SDLK_EXSEL */ __pyx_t_1 = __Pyx_PyInt_From_int(SDLK_CLEARAGAIN); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 157, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (PyDict_SetItem(__pyx_d, __pyx_n_s_K_CLEARAGAIN, __pyx_t_1) < 0) __PYX_ERR(2, 157, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "include/keycode_list.pxi":158 * K_OPER = SDLK_OPER * K_CLEARAGAIN = SDLK_CLEARAGAIN * K_CRSEL = SDLK_CRSEL # <<<<<<<<<<<<<< * K_EXSEL = SDLK_EXSEL * K_KP_00 = SDLK_KP_00 */ __pyx_t_1 = __Pyx_PyInt_From_int(SDLK_CRSEL); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 158, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (PyDict_SetItem(__pyx_d, __pyx_n_s_K_CRSEL, __pyx_t_1) < 0) __PYX_ERR(2, 158, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "include/keycode_list.pxi":159 * K_CLEARAGAIN = SDLK_CLEARAGAIN * K_CRSEL = SDLK_CRSEL * K_EXSEL = SDLK_EXSEL # <<<<<<<<<<<<<< * K_KP_00 = SDLK_KP_00 * K_KP_000 = SDLK_KP_000 */ __pyx_t_1 = __Pyx_PyInt_From_int(SDLK_EXSEL); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 159, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (PyDict_SetItem(__pyx_d, __pyx_n_s_K_EXSEL, __pyx_t_1) < 0) __PYX_ERR(2, 159, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "include/keycode_list.pxi":160 * K_CRSEL = SDLK_CRSEL * K_EXSEL = SDLK_EXSEL * K_KP_00 = SDLK_KP_00 # <<<<<<<<<<<<<< * K_KP_000 = SDLK_KP_000 * K_THOUSANDSSEPARATOR = SDLK_THOUSANDSSEPARATOR */ __pyx_t_1 = __Pyx_PyInt_From_int(SDLK_KP_00); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 160, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (PyDict_SetItem(__pyx_d, __pyx_n_s_K_KP_00, __pyx_t_1) < 0) __PYX_ERR(2, 160, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "include/keycode_list.pxi":161 * K_EXSEL = SDLK_EXSEL * K_KP_00 = SDLK_KP_00 * K_KP_000 = SDLK_KP_000 # <<<<<<<<<<<<<< * K_THOUSANDSSEPARATOR = SDLK_THOUSANDSSEPARATOR * K_DECIMALSEPARATOR = SDLK_DECIMALSEPARATOR */ __pyx_t_1 = __Pyx_PyInt_From_int(SDLK_KP_000); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 161, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (PyDict_SetItem(__pyx_d, __pyx_n_s_K_KP_000, __pyx_t_1) < 0) __PYX_ERR(2, 161, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "include/keycode_list.pxi":162 * K_KP_00 = SDLK_KP_00 * K_KP_000 = SDLK_KP_000 * K_THOUSANDSSEPARATOR = SDLK_THOUSANDSSEPARATOR # <<<<<<<<<<<<<< * K_DECIMALSEPARATOR = SDLK_DECIMALSEPARATOR * K_CURRENCYUNIT = SDLK_CURRENCYUNIT */ __pyx_t_1 = __Pyx_PyInt_From_int(SDLK_THOUSANDSSEPARATOR); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 162, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (PyDict_SetItem(__pyx_d, __pyx_n_s_K_THOUSANDSSEPARATOR, __pyx_t_1) < 0) __PYX_ERR(2, 162, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "include/keycode_list.pxi":163 * K_KP_000 = SDLK_KP_000 * K_THOUSANDSSEPARATOR = SDLK_THOUSANDSSEPARATOR * K_DECIMALSEPARATOR = SDLK_DECIMALSEPARATOR # <<<<<<<<<<<<<< * K_CURRENCYUNIT = SDLK_CURRENCYUNIT * K_CURRENCYSUBUNIT = SDLK_CURRENCYSUBUNIT */ __pyx_t_1 = __Pyx_PyInt_From_int(SDLK_DECIMALSEPARATOR); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 163, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (PyDict_SetItem(__pyx_d, __pyx_n_s_K_DECIMALSEPARATOR, __pyx_t_1) < 0) __PYX_ERR(2, 163, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "include/keycode_list.pxi":164 * K_THOUSANDSSEPARATOR = SDLK_THOUSANDSSEPARATOR * K_DECIMALSEPARATOR = SDLK_DECIMALSEPARATOR * K_CURRENCYUNIT = SDLK_CURRENCYUNIT # <<<<<<<<<<<<<< * K_CURRENCYSUBUNIT = SDLK_CURRENCYSUBUNIT * K_KP_LEFTPAREN = SDLK_KP_LEFTPAREN */ __pyx_t_1 = __Pyx_PyInt_From_int(SDLK_CURRENCYUNIT); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 164, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (PyDict_SetItem(__pyx_d, __pyx_n_s_K_CURRENCYUNIT, __pyx_t_1) < 0) __PYX_ERR(2, 164, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "include/keycode_list.pxi":165 * K_DECIMALSEPARATOR = SDLK_DECIMALSEPARATOR * K_CURRENCYUNIT = SDLK_CURRENCYUNIT * K_CURRENCYSUBUNIT = SDLK_CURRENCYSUBUNIT # <<<<<<<<<<<<<< * K_KP_LEFTPAREN = SDLK_KP_LEFTPAREN * K_KP_RIGHTPAREN = SDLK_KP_RIGHTPAREN */ __pyx_t_1 = __Pyx_PyInt_From_int(SDLK_CURRENCYSUBUNIT); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 165, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (PyDict_SetItem(__pyx_d, __pyx_n_s_K_CURRENCYSUBUNIT, __pyx_t_1) < 0) __PYX_ERR(2, 165, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "include/keycode_list.pxi":166 * K_CURRENCYUNIT = SDLK_CURRENCYUNIT * K_CURRENCYSUBUNIT = SDLK_CURRENCYSUBUNIT * K_KP_LEFTPAREN = SDLK_KP_LEFTPAREN # <<<<<<<<<<<<<< * K_KP_RIGHTPAREN = SDLK_KP_RIGHTPAREN * K_KP_LEFTBRACE = SDLK_KP_LEFTBRACE */ __pyx_t_1 = __Pyx_PyInt_From_int(SDLK_KP_LEFTPAREN); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 166, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (PyDict_SetItem(__pyx_d, __pyx_n_s_K_KP_LEFTPAREN, __pyx_t_1) < 0) __PYX_ERR(2, 166, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "include/keycode_list.pxi":167 * K_CURRENCYSUBUNIT = SDLK_CURRENCYSUBUNIT * K_KP_LEFTPAREN = SDLK_KP_LEFTPAREN * K_KP_RIGHTPAREN = SDLK_KP_RIGHTPAREN # <<<<<<<<<<<<<< * K_KP_LEFTBRACE = SDLK_KP_LEFTBRACE * K_KP_RIGHTBRACE = SDLK_KP_RIGHTBRACE */ __pyx_t_1 = __Pyx_PyInt_From_int(SDLK_KP_RIGHTPAREN); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 167, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (PyDict_SetItem(__pyx_d, __pyx_n_s_K_KP_RIGHTPAREN, __pyx_t_1) < 0) __PYX_ERR(2, 167, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "include/keycode_list.pxi":168 * K_KP_LEFTPAREN = SDLK_KP_LEFTPAREN * K_KP_RIGHTPAREN = SDLK_KP_RIGHTPAREN * K_KP_LEFTBRACE = SDLK_KP_LEFTBRACE # <<<<<<<<<<<<<< * K_KP_RIGHTBRACE = SDLK_KP_RIGHTBRACE * K_KP_TAB = SDLK_KP_TAB */ __pyx_t_1 = __Pyx_PyInt_From_int(SDLK_KP_LEFTBRACE); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 168, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (PyDict_SetItem(__pyx_d, __pyx_n_s_K_KP_LEFTBRACE, __pyx_t_1) < 0) __PYX_ERR(2, 168, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "include/keycode_list.pxi":169 * K_KP_RIGHTPAREN = SDLK_KP_RIGHTPAREN * K_KP_LEFTBRACE = SDLK_KP_LEFTBRACE * K_KP_RIGHTBRACE = SDLK_KP_RIGHTBRACE # <<<<<<<<<<<<<< * K_KP_TAB = SDLK_KP_TAB * K_KP_BACKSPACE = SDLK_KP_BACKSPACE */ __pyx_t_1 = __Pyx_PyInt_From_int(SDLK_KP_RIGHTBRACE); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 169, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (PyDict_SetItem(__pyx_d, __pyx_n_s_K_KP_RIGHTBRACE, __pyx_t_1) < 0) __PYX_ERR(2, 169, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "include/keycode_list.pxi":170 * K_KP_LEFTBRACE = SDLK_KP_LEFTBRACE * K_KP_RIGHTBRACE = SDLK_KP_RIGHTBRACE * K_KP_TAB = SDLK_KP_TAB # <<<<<<<<<<<<<< * K_KP_BACKSPACE = SDLK_KP_BACKSPACE * K_KP_A = SDLK_KP_A */ __pyx_t_1 = __Pyx_PyInt_From_int(SDLK_KP_TAB); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 170, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (PyDict_SetItem(__pyx_d, __pyx_n_s_K_KP_TAB, __pyx_t_1) < 0) __PYX_ERR(2, 170, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "include/keycode_list.pxi":171 * K_KP_RIGHTBRACE = SDLK_KP_RIGHTBRACE * K_KP_TAB = SDLK_KP_TAB * K_KP_BACKSPACE = SDLK_KP_BACKSPACE # <<<<<<<<<<<<<< * K_KP_A = SDLK_KP_A * K_KP_B = SDLK_KP_B */ __pyx_t_1 = __Pyx_PyInt_From_int(SDLK_KP_BACKSPACE); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 171, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (PyDict_SetItem(__pyx_d, __pyx_n_s_K_KP_BACKSPACE, __pyx_t_1) < 0) __PYX_ERR(2, 171, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "include/keycode_list.pxi":172 * K_KP_TAB = SDLK_KP_TAB * K_KP_BACKSPACE = SDLK_KP_BACKSPACE * K_KP_A = SDLK_KP_A # <<<<<<<<<<<<<< * K_KP_B = SDLK_KP_B * K_KP_C = SDLK_KP_C */ __pyx_t_1 = __Pyx_PyInt_From_int(SDLK_KP_A); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 172, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (PyDict_SetItem(__pyx_d, __pyx_n_s_K_KP_A, __pyx_t_1) < 0) __PYX_ERR(2, 172, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "include/keycode_list.pxi":173 * K_KP_BACKSPACE = SDLK_KP_BACKSPACE * K_KP_A = SDLK_KP_A * K_KP_B = SDLK_KP_B # <<<<<<<<<<<<<< * K_KP_C = SDLK_KP_C * K_KP_D = SDLK_KP_D */ __pyx_t_1 = __Pyx_PyInt_From_int(SDLK_KP_B); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 173, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (PyDict_SetItem(__pyx_d, __pyx_n_s_K_KP_B, __pyx_t_1) < 0) __PYX_ERR(2, 173, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "include/keycode_list.pxi":174 * K_KP_A = SDLK_KP_A * K_KP_B = SDLK_KP_B * K_KP_C = SDLK_KP_C # <<<<<<<<<<<<<< * K_KP_D = SDLK_KP_D * K_KP_E = SDLK_KP_E */ __pyx_t_1 = __Pyx_PyInt_From_int(SDLK_KP_C); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 174, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (PyDict_SetItem(__pyx_d, __pyx_n_s_K_KP_C, __pyx_t_1) < 0) __PYX_ERR(2, 174, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "include/keycode_list.pxi":175 * K_KP_B = SDLK_KP_B * K_KP_C = SDLK_KP_C * K_KP_D = SDLK_KP_D # <<<<<<<<<<<<<< * K_KP_E = SDLK_KP_E * K_KP_F = SDLK_KP_F */ __pyx_t_1 = __Pyx_PyInt_From_int(SDLK_KP_D); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 175, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (PyDict_SetItem(__pyx_d, __pyx_n_s_K_KP_D, __pyx_t_1) < 0) __PYX_ERR(2, 175, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "include/keycode_list.pxi":176 * K_KP_C = SDLK_KP_C * K_KP_D = SDLK_KP_D * K_KP_E = SDLK_KP_E # <<<<<<<<<<<<<< * K_KP_F = SDLK_KP_F * K_KP_XOR = SDLK_KP_XOR */ __pyx_t_1 = __Pyx_PyInt_From_int(SDLK_KP_E); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 176, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (PyDict_SetItem(__pyx_d, __pyx_n_s_K_KP_E, __pyx_t_1) < 0) __PYX_ERR(2, 176, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "include/keycode_list.pxi":177 * K_KP_D = SDLK_KP_D * K_KP_E = SDLK_KP_E * K_KP_F = SDLK_KP_F # <<<<<<<<<<<<<< * K_KP_XOR = SDLK_KP_XOR * K_KP_POWER = SDLK_KP_POWER */ __pyx_t_1 = __Pyx_PyInt_From_int(SDLK_KP_F); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 177, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (PyDict_SetItem(__pyx_d, __pyx_n_s_K_KP_F, __pyx_t_1) < 0) __PYX_ERR(2, 177, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "include/keycode_list.pxi":178 * K_KP_E = SDLK_KP_E * K_KP_F = SDLK_KP_F * K_KP_XOR = SDLK_KP_XOR # <<<<<<<<<<<<<< * K_KP_POWER = SDLK_KP_POWER * K_KP_PERCENT = SDLK_KP_PERCENT */ __pyx_t_1 = __Pyx_PyInt_From_int(SDLK_KP_XOR); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 178, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (PyDict_SetItem(__pyx_d, __pyx_n_s_K_KP_XOR, __pyx_t_1) < 0) __PYX_ERR(2, 178, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "include/keycode_list.pxi":179 * K_KP_F = SDLK_KP_F * K_KP_XOR = SDLK_KP_XOR * K_KP_POWER = SDLK_KP_POWER # <<<<<<<<<<<<<< * K_KP_PERCENT = SDLK_KP_PERCENT * K_KP_LESS = SDLK_KP_LESS */ __pyx_t_1 = __Pyx_PyInt_From_int(SDLK_KP_POWER); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 179, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (PyDict_SetItem(__pyx_d, __pyx_n_s_K_KP_POWER, __pyx_t_1) < 0) __PYX_ERR(2, 179, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "include/keycode_list.pxi":180 * K_KP_XOR = SDLK_KP_XOR * K_KP_POWER = SDLK_KP_POWER * K_KP_PERCENT = SDLK_KP_PERCENT # <<<<<<<<<<<<<< * K_KP_LESS = SDLK_KP_LESS * K_KP_GREATER = SDLK_KP_GREATER */ __pyx_t_1 = __Pyx_PyInt_From_int(SDLK_KP_PERCENT); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 180, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (PyDict_SetItem(__pyx_d, __pyx_n_s_K_KP_PERCENT, __pyx_t_1) < 0) __PYX_ERR(2, 180, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "include/keycode_list.pxi":181 * K_KP_POWER = SDLK_KP_POWER * K_KP_PERCENT = SDLK_KP_PERCENT * K_KP_LESS = SDLK_KP_LESS # <<<<<<<<<<<<<< * K_KP_GREATER = SDLK_KP_GREATER * K_KP_AMPERSAND = SDLK_KP_AMPERSAND */ __pyx_t_1 = __Pyx_PyInt_From_int(SDLK_KP_LESS); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 181, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (PyDict_SetItem(__pyx_d, __pyx_n_s_K_KP_LESS, __pyx_t_1) < 0) __PYX_ERR(2, 181, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "include/keycode_list.pxi":182 * K_KP_PERCENT = SDLK_KP_PERCENT * K_KP_LESS = SDLK_KP_LESS * K_KP_GREATER = SDLK_KP_GREATER # <<<<<<<<<<<<<< * K_KP_AMPERSAND = SDLK_KP_AMPERSAND * K_KP_DBLAMPERSAND = SDLK_KP_DBLAMPERSAND */ __pyx_t_1 = __Pyx_PyInt_From_int(SDLK_KP_GREATER); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 182, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (PyDict_SetItem(__pyx_d, __pyx_n_s_K_KP_GREATER, __pyx_t_1) < 0) __PYX_ERR(2, 182, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "include/keycode_list.pxi":183 * K_KP_LESS = SDLK_KP_LESS * K_KP_GREATER = SDLK_KP_GREATER * K_KP_AMPERSAND = SDLK_KP_AMPERSAND # <<<<<<<<<<<<<< * K_KP_DBLAMPERSAND = SDLK_KP_DBLAMPERSAND * K_KP_VERTICALBAR = SDLK_KP_VERTICALBAR */ __pyx_t_1 = __Pyx_PyInt_From_int(SDLK_KP_AMPERSAND); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 183, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (PyDict_SetItem(__pyx_d, __pyx_n_s_K_KP_AMPERSAND, __pyx_t_1) < 0) __PYX_ERR(2, 183, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "include/keycode_list.pxi":184 * K_KP_GREATER = SDLK_KP_GREATER * K_KP_AMPERSAND = SDLK_KP_AMPERSAND * K_KP_DBLAMPERSAND = SDLK_KP_DBLAMPERSAND # <<<<<<<<<<<<<< * K_KP_VERTICALBAR = SDLK_KP_VERTICALBAR * K_KP_DBLVERTICALBAR = SDLK_KP_DBLVERTICALBAR */ __pyx_t_1 = __Pyx_PyInt_From_int(SDLK_KP_DBLAMPERSAND); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 184, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (PyDict_SetItem(__pyx_d, __pyx_n_s_K_KP_DBLAMPERSAND, __pyx_t_1) < 0) __PYX_ERR(2, 184, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "include/keycode_list.pxi":185 * K_KP_AMPERSAND = SDLK_KP_AMPERSAND * K_KP_DBLAMPERSAND = SDLK_KP_DBLAMPERSAND * K_KP_VERTICALBAR = SDLK_KP_VERTICALBAR # <<<<<<<<<<<<<< * K_KP_DBLVERTICALBAR = SDLK_KP_DBLVERTICALBAR * K_KP_COLON = SDLK_KP_COLON */ __pyx_t_1 = __Pyx_PyInt_From_int(SDLK_KP_VERTICALBAR); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 185, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (PyDict_SetItem(__pyx_d, __pyx_n_s_K_KP_VERTICALBAR, __pyx_t_1) < 0) __PYX_ERR(2, 185, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "include/keycode_list.pxi":186 * K_KP_DBLAMPERSAND = SDLK_KP_DBLAMPERSAND * K_KP_VERTICALBAR = SDLK_KP_VERTICALBAR * K_KP_DBLVERTICALBAR = SDLK_KP_DBLVERTICALBAR # <<<<<<<<<<<<<< * K_KP_COLON = SDLK_KP_COLON * K_KP_HASH = SDLK_KP_HASH */ __pyx_t_1 = __Pyx_PyInt_From_int(SDLK_KP_DBLVERTICALBAR); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 186, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (PyDict_SetItem(__pyx_d, __pyx_n_s_K_KP_DBLVERTICALBAR, __pyx_t_1) < 0) __PYX_ERR(2, 186, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "include/keycode_list.pxi":187 * K_KP_VERTICALBAR = SDLK_KP_VERTICALBAR * K_KP_DBLVERTICALBAR = SDLK_KP_DBLVERTICALBAR * K_KP_COLON = SDLK_KP_COLON # <<<<<<<<<<<<<< * K_KP_HASH = SDLK_KP_HASH * K_KP_SPACE = SDLK_KP_SPACE */ __pyx_t_1 = __Pyx_PyInt_From_int(SDLK_KP_COLON); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 187, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (PyDict_SetItem(__pyx_d, __pyx_n_s_K_KP_COLON, __pyx_t_1) < 0) __PYX_ERR(2, 187, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "include/keycode_list.pxi":188 * K_KP_DBLVERTICALBAR = SDLK_KP_DBLVERTICALBAR * K_KP_COLON = SDLK_KP_COLON * K_KP_HASH = SDLK_KP_HASH # <<<<<<<<<<<<<< * K_KP_SPACE = SDLK_KP_SPACE * K_KP_AT = SDLK_KP_AT */ __pyx_t_1 = __Pyx_PyInt_From_int(SDLK_KP_HASH); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 188, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (PyDict_SetItem(__pyx_d, __pyx_n_s_K_KP_HASH, __pyx_t_1) < 0) __PYX_ERR(2, 188, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "include/keycode_list.pxi":189 * K_KP_COLON = SDLK_KP_COLON * K_KP_HASH = SDLK_KP_HASH * K_KP_SPACE = SDLK_KP_SPACE # <<<<<<<<<<<<<< * K_KP_AT = SDLK_KP_AT * K_KP_EXCLAM = SDLK_KP_EXCLAM */ __pyx_t_1 = __Pyx_PyInt_From_int(SDLK_KP_SPACE); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 189, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (PyDict_SetItem(__pyx_d, __pyx_n_s_K_KP_SPACE, __pyx_t_1) < 0) __PYX_ERR(2, 189, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "include/keycode_list.pxi":190 * K_KP_HASH = SDLK_KP_HASH * K_KP_SPACE = SDLK_KP_SPACE * K_KP_AT = SDLK_KP_AT # <<<<<<<<<<<<<< * K_KP_EXCLAM = SDLK_KP_EXCLAM * K_KP_MEMSTORE = SDLK_KP_MEMSTORE */ __pyx_t_1 = __Pyx_PyInt_From_int(SDLK_KP_AT); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 190, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (PyDict_SetItem(__pyx_d, __pyx_n_s_K_KP_AT, __pyx_t_1) < 0) __PYX_ERR(2, 190, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "include/keycode_list.pxi":191 * K_KP_SPACE = SDLK_KP_SPACE * K_KP_AT = SDLK_KP_AT * K_KP_EXCLAM = SDLK_KP_EXCLAM # <<<<<<<<<<<<<< * K_KP_MEMSTORE = SDLK_KP_MEMSTORE * K_KP_MEMRECALL = SDLK_KP_MEMRECALL */ __pyx_t_1 = __Pyx_PyInt_From_int(SDLK_KP_EXCLAM); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 191, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (PyDict_SetItem(__pyx_d, __pyx_n_s_K_KP_EXCLAM, __pyx_t_1) < 0) __PYX_ERR(2, 191, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "include/keycode_list.pxi":192 * K_KP_AT = SDLK_KP_AT * K_KP_EXCLAM = SDLK_KP_EXCLAM * K_KP_MEMSTORE = SDLK_KP_MEMSTORE # <<<<<<<<<<<<<< * K_KP_MEMRECALL = SDLK_KP_MEMRECALL * K_KP_MEMCLEAR = SDLK_KP_MEMCLEAR */ __pyx_t_1 = __Pyx_PyInt_From_int(SDLK_KP_MEMSTORE); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 192, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (PyDict_SetItem(__pyx_d, __pyx_n_s_K_KP_MEMSTORE, __pyx_t_1) < 0) __PYX_ERR(2, 192, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "include/keycode_list.pxi":193 * K_KP_EXCLAM = SDLK_KP_EXCLAM * K_KP_MEMSTORE = SDLK_KP_MEMSTORE * K_KP_MEMRECALL = SDLK_KP_MEMRECALL # <<<<<<<<<<<<<< * K_KP_MEMCLEAR = SDLK_KP_MEMCLEAR * K_KP_MEMADD = SDLK_KP_MEMADD */ __pyx_t_1 = __Pyx_PyInt_From_int(SDLK_KP_MEMRECALL); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 193, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (PyDict_SetItem(__pyx_d, __pyx_n_s_K_KP_MEMRECALL, __pyx_t_1) < 0) __PYX_ERR(2, 193, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "include/keycode_list.pxi":194 * K_KP_MEMSTORE = SDLK_KP_MEMSTORE * K_KP_MEMRECALL = SDLK_KP_MEMRECALL * K_KP_MEMCLEAR = SDLK_KP_MEMCLEAR # <<<<<<<<<<<<<< * K_KP_MEMADD = SDLK_KP_MEMADD * K_KP_MEMSUBTRACT = SDLK_KP_MEMSUBTRACT */ __pyx_t_1 = __Pyx_PyInt_From_int(SDLK_KP_MEMCLEAR); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 194, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (PyDict_SetItem(__pyx_d, __pyx_n_s_K_KP_MEMCLEAR, __pyx_t_1) < 0) __PYX_ERR(2, 194, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "include/keycode_list.pxi":195 * K_KP_MEMRECALL = SDLK_KP_MEMRECALL * K_KP_MEMCLEAR = SDLK_KP_MEMCLEAR * K_KP_MEMADD = SDLK_KP_MEMADD # <<<<<<<<<<<<<< * K_KP_MEMSUBTRACT = SDLK_KP_MEMSUBTRACT * K_KP_MEMMULTIPLY = SDLK_KP_MEMMULTIPLY */ __pyx_t_1 = __Pyx_PyInt_From_int(SDLK_KP_MEMADD); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 195, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (PyDict_SetItem(__pyx_d, __pyx_n_s_K_KP_MEMADD, __pyx_t_1) < 0) __PYX_ERR(2, 195, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "include/keycode_list.pxi":196 * K_KP_MEMCLEAR = SDLK_KP_MEMCLEAR * K_KP_MEMADD = SDLK_KP_MEMADD * K_KP_MEMSUBTRACT = SDLK_KP_MEMSUBTRACT # <<<<<<<<<<<<<< * K_KP_MEMMULTIPLY = SDLK_KP_MEMMULTIPLY * K_KP_MEMDIVIDE = SDLK_KP_MEMDIVIDE */ __pyx_t_1 = __Pyx_PyInt_From_int(SDLK_KP_MEMSUBTRACT); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 196, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (PyDict_SetItem(__pyx_d, __pyx_n_s_K_KP_MEMSUBTRACT, __pyx_t_1) < 0) __PYX_ERR(2, 196, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "include/keycode_list.pxi":197 * K_KP_MEMADD = SDLK_KP_MEMADD * K_KP_MEMSUBTRACT = SDLK_KP_MEMSUBTRACT * K_KP_MEMMULTIPLY = SDLK_KP_MEMMULTIPLY # <<<<<<<<<<<<<< * K_KP_MEMDIVIDE = SDLK_KP_MEMDIVIDE * K_KP_PLUSMINUS = SDLK_KP_PLUSMINUS */ __pyx_t_1 = __Pyx_PyInt_From_int(SDLK_KP_MEMMULTIPLY); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 197, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (PyDict_SetItem(__pyx_d, __pyx_n_s_K_KP_MEMMULTIPLY, __pyx_t_1) < 0) __PYX_ERR(2, 197, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "include/keycode_list.pxi":198 * K_KP_MEMSUBTRACT = SDLK_KP_MEMSUBTRACT * K_KP_MEMMULTIPLY = SDLK_KP_MEMMULTIPLY * K_KP_MEMDIVIDE = SDLK_KP_MEMDIVIDE # <<<<<<<<<<<<<< * K_KP_PLUSMINUS = SDLK_KP_PLUSMINUS * K_KP_CLEAR = SDLK_KP_CLEAR */ __pyx_t_1 = __Pyx_PyInt_From_int(SDLK_KP_MEMDIVIDE); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 198, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (PyDict_SetItem(__pyx_d, __pyx_n_s_K_KP_MEMDIVIDE, __pyx_t_1) < 0) __PYX_ERR(2, 198, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "include/keycode_list.pxi":199 * K_KP_MEMMULTIPLY = SDLK_KP_MEMMULTIPLY * K_KP_MEMDIVIDE = SDLK_KP_MEMDIVIDE * K_KP_PLUSMINUS = SDLK_KP_PLUSMINUS # <<<<<<<<<<<<<< * K_KP_CLEAR = SDLK_KP_CLEAR * K_KP_CLEARENTRY = SDLK_KP_CLEARENTRY */ __pyx_t_1 = __Pyx_PyInt_From_int(SDLK_KP_PLUSMINUS); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 199, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (PyDict_SetItem(__pyx_d, __pyx_n_s_K_KP_PLUSMINUS, __pyx_t_1) < 0) __PYX_ERR(2, 199, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "include/keycode_list.pxi":200 * K_KP_MEMDIVIDE = SDLK_KP_MEMDIVIDE * K_KP_PLUSMINUS = SDLK_KP_PLUSMINUS * K_KP_CLEAR = SDLK_KP_CLEAR # <<<<<<<<<<<<<< * K_KP_CLEARENTRY = SDLK_KP_CLEARENTRY * K_KP_BINARY = SDLK_KP_BINARY */ __pyx_t_1 = __Pyx_PyInt_From_int(SDLK_KP_CLEAR); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 200, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (PyDict_SetItem(__pyx_d, __pyx_n_s_K_KP_CLEAR, __pyx_t_1) < 0) __PYX_ERR(2, 200, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "include/keycode_list.pxi":201 * K_KP_PLUSMINUS = SDLK_KP_PLUSMINUS * K_KP_CLEAR = SDLK_KP_CLEAR * K_KP_CLEARENTRY = SDLK_KP_CLEARENTRY # <<<<<<<<<<<<<< * K_KP_BINARY = SDLK_KP_BINARY * K_KP_OCTAL = SDLK_KP_OCTAL */ __pyx_t_1 = __Pyx_PyInt_From_int(SDLK_KP_CLEARENTRY); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 201, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (PyDict_SetItem(__pyx_d, __pyx_n_s_K_KP_CLEARENTRY, __pyx_t_1) < 0) __PYX_ERR(2, 201, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "include/keycode_list.pxi":202 * K_KP_CLEAR = SDLK_KP_CLEAR * K_KP_CLEARENTRY = SDLK_KP_CLEARENTRY * K_KP_BINARY = SDLK_KP_BINARY # <<<<<<<<<<<<<< * K_KP_OCTAL = SDLK_KP_OCTAL * K_KP_DECIMAL = SDLK_KP_DECIMAL */ __pyx_t_1 = __Pyx_PyInt_From_int(SDLK_KP_BINARY); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 202, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (PyDict_SetItem(__pyx_d, __pyx_n_s_K_KP_BINARY, __pyx_t_1) < 0) __PYX_ERR(2, 202, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "include/keycode_list.pxi":203 * K_KP_CLEARENTRY = SDLK_KP_CLEARENTRY * K_KP_BINARY = SDLK_KP_BINARY * K_KP_OCTAL = SDLK_KP_OCTAL # <<<<<<<<<<<<<< * K_KP_DECIMAL = SDLK_KP_DECIMAL * K_KP_HEXADECIMAL = SDLK_KP_HEXADECIMAL */ __pyx_t_1 = __Pyx_PyInt_From_int(SDLK_KP_OCTAL); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 203, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (PyDict_SetItem(__pyx_d, __pyx_n_s_K_KP_OCTAL, __pyx_t_1) < 0) __PYX_ERR(2, 203, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "include/keycode_list.pxi":204 * K_KP_BINARY = SDLK_KP_BINARY * K_KP_OCTAL = SDLK_KP_OCTAL * K_KP_DECIMAL = SDLK_KP_DECIMAL # <<<<<<<<<<<<<< * K_KP_HEXADECIMAL = SDLK_KP_HEXADECIMAL * K_LCTRL = SDLK_LCTRL */ __pyx_t_1 = __Pyx_PyInt_From_int(SDLK_KP_DECIMAL); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 204, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (PyDict_SetItem(__pyx_d, __pyx_n_s_K_KP_DECIMAL, __pyx_t_1) < 0) __PYX_ERR(2, 204, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "include/keycode_list.pxi":205 * K_KP_OCTAL = SDLK_KP_OCTAL * K_KP_DECIMAL = SDLK_KP_DECIMAL * K_KP_HEXADECIMAL = SDLK_KP_HEXADECIMAL # <<<<<<<<<<<<<< * K_LCTRL = SDLK_LCTRL * K_LSHIFT = SDLK_LSHIFT */ __pyx_t_1 = __Pyx_PyInt_From_int(SDLK_KP_HEXADECIMAL); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 205, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (PyDict_SetItem(__pyx_d, __pyx_n_s_K_KP_HEXADECIMAL, __pyx_t_1) < 0) __PYX_ERR(2, 205, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "include/keycode_list.pxi":206 * K_KP_DECIMAL = SDLK_KP_DECIMAL * K_KP_HEXADECIMAL = SDLK_KP_HEXADECIMAL * K_LCTRL = SDLK_LCTRL # <<<<<<<<<<<<<< * K_LSHIFT = SDLK_LSHIFT * K_LALT = SDLK_LALT */ __pyx_t_1 = __Pyx_PyInt_From_int(SDLK_LCTRL); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 206, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (PyDict_SetItem(__pyx_d, __pyx_n_s_K_LCTRL, __pyx_t_1) < 0) __PYX_ERR(2, 206, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "include/keycode_list.pxi":207 * K_KP_HEXADECIMAL = SDLK_KP_HEXADECIMAL * K_LCTRL = SDLK_LCTRL * K_LSHIFT = SDLK_LSHIFT # <<<<<<<<<<<<<< * K_LALT = SDLK_LALT * K_LGUI = SDLK_LGUI */ __pyx_t_1 = __Pyx_PyInt_From_int(SDLK_LSHIFT); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 207, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (PyDict_SetItem(__pyx_d, __pyx_n_s_K_LSHIFT, __pyx_t_1) < 0) __PYX_ERR(2, 207, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "include/keycode_list.pxi":208 * K_LCTRL = SDLK_LCTRL * K_LSHIFT = SDLK_LSHIFT * K_LALT = SDLK_LALT # <<<<<<<<<<<<<< * K_LGUI = SDLK_LGUI * K_RCTRL = SDLK_RCTRL */ __pyx_t_1 = __Pyx_PyInt_From_int(SDLK_LALT); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 208, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (PyDict_SetItem(__pyx_d, __pyx_n_s_K_LALT, __pyx_t_1) < 0) __PYX_ERR(2, 208, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "include/keycode_list.pxi":209 * K_LSHIFT = SDLK_LSHIFT * K_LALT = SDLK_LALT * K_LGUI = SDLK_LGUI # <<<<<<<<<<<<<< * K_RCTRL = SDLK_RCTRL * K_RSHIFT = SDLK_RSHIFT */ __pyx_t_1 = __Pyx_PyInt_From_int(SDLK_LGUI); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 209, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (PyDict_SetItem(__pyx_d, __pyx_n_s_K_LGUI, __pyx_t_1) < 0) __PYX_ERR(2, 209, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "include/keycode_list.pxi":210 * K_LALT = SDLK_LALT * K_LGUI = SDLK_LGUI * K_RCTRL = SDLK_RCTRL # <<<<<<<<<<<<<< * K_RSHIFT = SDLK_RSHIFT * K_RALT = SDLK_RALT */ __pyx_t_1 = __Pyx_PyInt_From_int(SDLK_RCTRL); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 210, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (PyDict_SetItem(__pyx_d, __pyx_n_s_K_RCTRL, __pyx_t_1) < 0) __PYX_ERR(2, 210, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "include/keycode_list.pxi":211 * K_LGUI = SDLK_LGUI * K_RCTRL = SDLK_RCTRL * K_RSHIFT = SDLK_RSHIFT # <<<<<<<<<<<<<< * K_RALT = SDLK_RALT * K_RGUI = SDLK_RGUI */ __pyx_t_1 = __Pyx_PyInt_From_int(SDLK_RSHIFT); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 211, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (PyDict_SetItem(__pyx_d, __pyx_n_s_K_RSHIFT, __pyx_t_1) < 0) __PYX_ERR(2, 211, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "include/keycode_list.pxi":212 * K_RCTRL = SDLK_RCTRL * K_RSHIFT = SDLK_RSHIFT * K_RALT = SDLK_RALT # <<<<<<<<<<<<<< * K_RGUI = SDLK_RGUI * K_MODE = SDLK_MODE */ __pyx_t_1 = __Pyx_PyInt_From_int(SDLK_RALT); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 212, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (PyDict_SetItem(__pyx_d, __pyx_n_s_K_RALT, __pyx_t_1) < 0) __PYX_ERR(2, 212, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "include/keycode_list.pxi":213 * K_RSHIFT = SDLK_RSHIFT * K_RALT = SDLK_RALT * K_RGUI = SDLK_RGUI # <<<<<<<<<<<<<< * K_MODE = SDLK_MODE * K_AUDIONEXT = SDLK_AUDIONEXT */ __pyx_t_1 = __Pyx_PyInt_From_int(SDLK_RGUI); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 213, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (PyDict_SetItem(__pyx_d, __pyx_n_s_K_RGUI, __pyx_t_1) < 0) __PYX_ERR(2, 213, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "include/keycode_list.pxi":214 * K_RALT = SDLK_RALT * K_RGUI = SDLK_RGUI * K_MODE = SDLK_MODE # <<<<<<<<<<<<<< * K_AUDIONEXT = SDLK_AUDIONEXT * K_AUDIOPREV = SDLK_AUDIOPREV */ __pyx_t_1 = __Pyx_PyInt_From_int(SDLK_MODE); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 214, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (PyDict_SetItem(__pyx_d, __pyx_n_s_K_MODE, __pyx_t_1) < 0) __PYX_ERR(2, 214, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "include/keycode_list.pxi":215 * K_RGUI = SDLK_RGUI * K_MODE = SDLK_MODE * K_AUDIONEXT = SDLK_AUDIONEXT # <<<<<<<<<<<<<< * K_AUDIOPREV = SDLK_AUDIOPREV * K_AUDIOSTOP = SDLK_AUDIOSTOP */ __pyx_t_1 = __Pyx_PyInt_From_int(SDLK_AUDIONEXT); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 215, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (PyDict_SetItem(__pyx_d, __pyx_n_s_K_AUDIONEXT, __pyx_t_1) < 0) __PYX_ERR(2, 215, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "include/keycode_list.pxi":216 * K_MODE = SDLK_MODE * K_AUDIONEXT = SDLK_AUDIONEXT * K_AUDIOPREV = SDLK_AUDIOPREV # <<<<<<<<<<<<<< * K_AUDIOSTOP = SDLK_AUDIOSTOP * K_AUDIOPLAY = SDLK_AUDIOPLAY */ __pyx_t_1 = __Pyx_PyInt_From_int(SDLK_AUDIOPREV); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 216, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (PyDict_SetItem(__pyx_d, __pyx_n_s_K_AUDIOPREV, __pyx_t_1) < 0) __PYX_ERR(2, 216, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "include/keycode_list.pxi":217 * K_AUDIONEXT = SDLK_AUDIONEXT * K_AUDIOPREV = SDLK_AUDIOPREV * K_AUDIOSTOP = SDLK_AUDIOSTOP # <<<<<<<<<<<<<< * K_AUDIOPLAY = SDLK_AUDIOPLAY * K_AUDIOMUTE = SDLK_AUDIOMUTE */ __pyx_t_1 = __Pyx_PyInt_From_int(SDLK_AUDIOSTOP); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 217, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (PyDict_SetItem(__pyx_d, __pyx_n_s_K_AUDIOSTOP, __pyx_t_1) < 0) __PYX_ERR(2, 217, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "include/keycode_list.pxi":218 * K_AUDIOPREV = SDLK_AUDIOPREV * K_AUDIOSTOP = SDLK_AUDIOSTOP * K_AUDIOPLAY = SDLK_AUDIOPLAY # <<<<<<<<<<<<<< * K_AUDIOMUTE = SDLK_AUDIOMUTE * K_MEDIASELECT = SDLK_MEDIASELECT */ __pyx_t_1 = __Pyx_PyInt_From_int(SDLK_AUDIOPLAY); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 218, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (PyDict_SetItem(__pyx_d, __pyx_n_s_K_AUDIOPLAY, __pyx_t_1) < 0) __PYX_ERR(2, 218, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "include/keycode_list.pxi":219 * K_AUDIOSTOP = SDLK_AUDIOSTOP * K_AUDIOPLAY = SDLK_AUDIOPLAY * K_AUDIOMUTE = SDLK_AUDIOMUTE # <<<<<<<<<<<<<< * K_MEDIASELECT = SDLK_MEDIASELECT * K_WWW = SDLK_WWW */ __pyx_t_1 = __Pyx_PyInt_From_int(SDLK_AUDIOMUTE); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 219, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (PyDict_SetItem(__pyx_d, __pyx_n_s_K_AUDIOMUTE, __pyx_t_1) < 0) __PYX_ERR(2, 219, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "include/keycode_list.pxi":220 * K_AUDIOPLAY = SDLK_AUDIOPLAY * K_AUDIOMUTE = SDLK_AUDIOMUTE * K_MEDIASELECT = SDLK_MEDIASELECT # <<<<<<<<<<<<<< * K_WWW = SDLK_WWW * K_MAIL = SDLK_MAIL */ __pyx_t_1 = __Pyx_PyInt_From_int(SDLK_MEDIASELECT); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 220, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (PyDict_SetItem(__pyx_d, __pyx_n_s_K_MEDIASELECT, __pyx_t_1) < 0) __PYX_ERR(2, 220, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "include/keycode_list.pxi":221 * K_AUDIOMUTE = SDLK_AUDIOMUTE * K_MEDIASELECT = SDLK_MEDIASELECT * K_WWW = SDLK_WWW # <<<<<<<<<<<<<< * K_MAIL = SDLK_MAIL * K_CALCULATOR = SDLK_CALCULATOR */ __pyx_t_1 = __Pyx_PyInt_From_int(SDLK_WWW); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 221, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (PyDict_SetItem(__pyx_d, __pyx_n_s_K_WWW, __pyx_t_1) < 0) __PYX_ERR(2, 221, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "include/keycode_list.pxi":222 * K_MEDIASELECT = SDLK_MEDIASELECT * K_WWW = SDLK_WWW * K_MAIL = SDLK_MAIL # <<<<<<<<<<<<<< * K_CALCULATOR = SDLK_CALCULATOR * K_COMPUTER = SDLK_COMPUTER */ __pyx_t_1 = __Pyx_PyInt_From_int(SDLK_MAIL); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 222, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (PyDict_SetItem(__pyx_d, __pyx_n_s_K_MAIL, __pyx_t_1) < 0) __PYX_ERR(2, 222, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "include/keycode_list.pxi":223 * K_WWW = SDLK_WWW * K_MAIL = SDLK_MAIL * K_CALCULATOR = SDLK_CALCULATOR # <<<<<<<<<<<<<< * K_COMPUTER = SDLK_COMPUTER * K_AC_SEARCH = SDLK_AC_SEARCH */ __pyx_t_1 = __Pyx_PyInt_From_int(SDLK_CALCULATOR); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 223, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (PyDict_SetItem(__pyx_d, __pyx_n_s_K_CALCULATOR, __pyx_t_1) < 0) __PYX_ERR(2, 223, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "include/keycode_list.pxi":224 * K_MAIL = SDLK_MAIL * K_CALCULATOR = SDLK_CALCULATOR * K_COMPUTER = SDLK_COMPUTER # <<<<<<<<<<<<<< * K_AC_SEARCH = SDLK_AC_SEARCH * K_AC_HOME = SDLK_AC_HOME */ __pyx_t_1 = __Pyx_PyInt_From_int(SDLK_COMPUTER); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 224, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (PyDict_SetItem(__pyx_d, __pyx_n_s_K_COMPUTER, __pyx_t_1) < 0) __PYX_ERR(2, 224, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "include/keycode_list.pxi":225 * K_CALCULATOR = SDLK_CALCULATOR * K_COMPUTER = SDLK_COMPUTER * K_AC_SEARCH = SDLK_AC_SEARCH # <<<<<<<<<<<<<< * K_AC_HOME = SDLK_AC_HOME * K_AC_BACK = SDLK_AC_BACK */ __pyx_t_1 = __Pyx_PyInt_From_int(SDLK_AC_SEARCH); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 225, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (PyDict_SetItem(__pyx_d, __pyx_n_s_K_AC_SEARCH, __pyx_t_1) < 0) __PYX_ERR(2, 225, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "include/keycode_list.pxi":226 * K_COMPUTER = SDLK_COMPUTER * K_AC_SEARCH = SDLK_AC_SEARCH * K_AC_HOME = SDLK_AC_HOME # <<<<<<<<<<<<<< * K_AC_BACK = SDLK_AC_BACK * K_AC_FORWARD = SDLK_AC_FORWARD */ __pyx_t_1 = __Pyx_PyInt_From_int(SDLK_AC_HOME); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 226, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (PyDict_SetItem(__pyx_d, __pyx_n_s_K_AC_HOME, __pyx_t_1) < 0) __PYX_ERR(2, 226, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "include/keycode_list.pxi":227 * K_AC_SEARCH = SDLK_AC_SEARCH * K_AC_HOME = SDLK_AC_HOME * K_AC_BACK = SDLK_AC_BACK # <<<<<<<<<<<<<< * K_AC_FORWARD = SDLK_AC_FORWARD * K_AC_STOP = SDLK_AC_STOP */ __pyx_t_1 = __Pyx_PyInt_From_int(SDLK_AC_BACK); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 227, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (PyDict_SetItem(__pyx_d, __pyx_n_s_K_AC_BACK, __pyx_t_1) < 0) __PYX_ERR(2, 227, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "include/keycode_list.pxi":228 * K_AC_HOME = SDLK_AC_HOME * K_AC_BACK = SDLK_AC_BACK * K_AC_FORWARD = SDLK_AC_FORWARD # <<<<<<<<<<<<<< * K_AC_STOP = SDLK_AC_STOP * K_AC_REFRESH = SDLK_AC_REFRESH */ __pyx_t_1 = __Pyx_PyInt_From_int(SDLK_AC_FORWARD); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 228, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (PyDict_SetItem(__pyx_d, __pyx_n_s_K_AC_FORWARD, __pyx_t_1) < 0) __PYX_ERR(2, 228, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "include/keycode_list.pxi":229 * K_AC_BACK = SDLK_AC_BACK * K_AC_FORWARD = SDLK_AC_FORWARD * K_AC_STOP = SDLK_AC_STOP # <<<<<<<<<<<<<< * K_AC_REFRESH = SDLK_AC_REFRESH * K_AC_BOOKMARKS = SDLK_AC_BOOKMARKS */ __pyx_t_1 = __Pyx_PyInt_From_int(SDLK_AC_STOP); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 229, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (PyDict_SetItem(__pyx_d, __pyx_n_s_K_AC_STOP, __pyx_t_1) < 0) __PYX_ERR(2, 229, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "include/keycode_list.pxi":230 * K_AC_FORWARD = SDLK_AC_FORWARD * K_AC_STOP = SDLK_AC_STOP * K_AC_REFRESH = SDLK_AC_REFRESH # <<<<<<<<<<<<<< * K_AC_BOOKMARKS = SDLK_AC_BOOKMARKS * K_BRIGHTNESSDOWN = SDLK_BRIGHTNESSDOWN */ __pyx_t_1 = __Pyx_PyInt_From_int(SDLK_AC_REFRESH); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 230, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (PyDict_SetItem(__pyx_d, __pyx_n_s_K_AC_REFRESH, __pyx_t_1) < 0) __PYX_ERR(2, 230, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "include/keycode_list.pxi":231 * K_AC_STOP = SDLK_AC_STOP * K_AC_REFRESH = SDLK_AC_REFRESH * K_AC_BOOKMARKS = SDLK_AC_BOOKMARKS # <<<<<<<<<<<<<< * K_BRIGHTNESSDOWN = SDLK_BRIGHTNESSDOWN * K_BRIGHTNESSUP = SDLK_BRIGHTNESSUP */ __pyx_t_1 = __Pyx_PyInt_From_int(SDLK_AC_BOOKMARKS); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 231, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (PyDict_SetItem(__pyx_d, __pyx_n_s_K_AC_BOOKMARKS, __pyx_t_1) < 0) __PYX_ERR(2, 231, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "include/keycode_list.pxi":232 * K_AC_REFRESH = SDLK_AC_REFRESH * K_AC_BOOKMARKS = SDLK_AC_BOOKMARKS * K_BRIGHTNESSDOWN = SDLK_BRIGHTNESSDOWN # <<<<<<<<<<<<<< * K_BRIGHTNESSUP = SDLK_BRIGHTNESSUP * K_DISPLAYSWITCH = SDLK_DISPLAYSWITCH */ __pyx_t_1 = __Pyx_PyInt_From_int(SDLK_BRIGHTNESSDOWN); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 232, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (PyDict_SetItem(__pyx_d, __pyx_n_s_K_BRIGHTNESSDOWN, __pyx_t_1) < 0) __PYX_ERR(2, 232, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "include/keycode_list.pxi":233 * K_AC_BOOKMARKS = SDLK_AC_BOOKMARKS * K_BRIGHTNESSDOWN = SDLK_BRIGHTNESSDOWN * K_BRIGHTNESSUP = SDLK_BRIGHTNESSUP # <<<<<<<<<<<<<< * K_DISPLAYSWITCH = SDLK_DISPLAYSWITCH * K_KBDILLUMTOGGLE = SDLK_KBDILLUMTOGGLE */ __pyx_t_1 = __Pyx_PyInt_From_int(SDLK_BRIGHTNESSUP); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 233, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (PyDict_SetItem(__pyx_d, __pyx_n_s_K_BRIGHTNESSUP, __pyx_t_1) < 0) __PYX_ERR(2, 233, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "include/keycode_list.pxi":234 * K_BRIGHTNESSDOWN = SDLK_BRIGHTNESSDOWN * K_BRIGHTNESSUP = SDLK_BRIGHTNESSUP * K_DISPLAYSWITCH = SDLK_DISPLAYSWITCH # <<<<<<<<<<<<<< * K_KBDILLUMTOGGLE = SDLK_KBDILLUMTOGGLE * K_KBDILLUMDOWN = SDLK_KBDILLUMDOWN */ __pyx_t_1 = __Pyx_PyInt_From_int(SDLK_DISPLAYSWITCH); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 234, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (PyDict_SetItem(__pyx_d, __pyx_n_s_K_DISPLAYSWITCH, __pyx_t_1) < 0) __PYX_ERR(2, 234, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "include/keycode_list.pxi":235 * K_BRIGHTNESSUP = SDLK_BRIGHTNESSUP * K_DISPLAYSWITCH = SDLK_DISPLAYSWITCH * K_KBDILLUMTOGGLE = SDLK_KBDILLUMTOGGLE # <<<<<<<<<<<<<< * K_KBDILLUMDOWN = SDLK_KBDILLUMDOWN * K_KBDILLUMUP = SDLK_KBDILLUMUP */ __pyx_t_1 = __Pyx_PyInt_From_int(SDLK_KBDILLUMTOGGLE); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 235, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (PyDict_SetItem(__pyx_d, __pyx_n_s_K_KBDILLUMTOGGLE, __pyx_t_1) < 0) __PYX_ERR(2, 235, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "include/keycode_list.pxi":236 * K_DISPLAYSWITCH = SDLK_DISPLAYSWITCH * K_KBDILLUMTOGGLE = SDLK_KBDILLUMTOGGLE * K_KBDILLUMDOWN = SDLK_KBDILLUMDOWN # <<<<<<<<<<<<<< * K_KBDILLUMUP = SDLK_KBDILLUMUP * K_EJECT = SDLK_EJECT */ __pyx_t_1 = __Pyx_PyInt_From_int(SDLK_KBDILLUMDOWN); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 236, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (PyDict_SetItem(__pyx_d, __pyx_n_s_K_KBDILLUMDOWN, __pyx_t_1) < 0) __PYX_ERR(2, 236, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "include/keycode_list.pxi":237 * K_KBDILLUMTOGGLE = SDLK_KBDILLUMTOGGLE * K_KBDILLUMDOWN = SDLK_KBDILLUMDOWN * K_KBDILLUMUP = SDLK_KBDILLUMUP # <<<<<<<<<<<<<< * K_EJECT = SDLK_EJECT * K_SLEEP = SDLK_SLEEP */ __pyx_t_1 = __Pyx_PyInt_From_int(SDLK_KBDILLUMUP); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 237, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (PyDict_SetItem(__pyx_d, __pyx_n_s_K_KBDILLUMUP, __pyx_t_1) < 0) __PYX_ERR(2, 237, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "include/keycode_list.pxi":238 * K_KBDILLUMDOWN = SDLK_KBDILLUMDOWN * K_KBDILLUMUP = SDLK_KBDILLUMUP * K_EJECT = SDLK_EJECT # <<<<<<<<<<<<<< * K_SLEEP = SDLK_SLEEP */ __pyx_t_1 = __Pyx_PyInt_From_int(SDLK_EJECT); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 238, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (PyDict_SetItem(__pyx_d, __pyx_n_s_K_EJECT, __pyx_t_1) < 0) __PYX_ERR(2, 238, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "include/keycode_list.pxi":239 * K_KBDILLUMUP = SDLK_KBDILLUMUP * K_EJECT = SDLK_EJECT * K_SLEEP = SDLK_SLEEP # <<<<<<<<<<<<<< */ __pyx_t_1 = __Pyx_PyInt_From_int(SDLK_SLEEP); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 239, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (PyDict_SetItem(__pyx_d, __pyx_n_s_K_SLEEP, __pyx_t_1) < 0) __PYX_ERR(2, 239, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "include/glattr.pxi":1 * GL_RED_SIZE = SDL_GL_RED_SIZE # <<<<<<<<<<<<<< * GL_GREEN_SIZE = SDL_GL_GREEN_SIZE * GL_BLUE_SIZE = SDL_GL_BLUE_SIZE */ __pyx_t_1 = __Pyx_PyInt_From_SDL_GLattr(SDL_GL_RED_SIZE); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 1, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (PyDict_SetItem(__pyx_d, __pyx_n_s_GL_RED_SIZE, __pyx_t_1) < 0) __PYX_ERR(3, 1, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "include/glattr.pxi":2 * GL_RED_SIZE = SDL_GL_RED_SIZE * GL_GREEN_SIZE = SDL_GL_GREEN_SIZE # <<<<<<<<<<<<<< * GL_BLUE_SIZE = SDL_GL_BLUE_SIZE * GL_ALPHA_SIZE = SDL_GL_ALPHA_SIZE */ __pyx_t_1 = __Pyx_PyInt_From_SDL_GLattr(SDL_GL_GREEN_SIZE); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 2, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (PyDict_SetItem(__pyx_d, __pyx_n_s_GL_GREEN_SIZE, __pyx_t_1) < 0) __PYX_ERR(3, 2, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "include/glattr.pxi":3 * GL_RED_SIZE = SDL_GL_RED_SIZE * GL_GREEN_SIZE = SDL_GL_GREEN_SIZE * GL_BLUE_SIZE = SDL_GL_BLUE_SIZE # <<<<<<<<<<<<<< * GL_ALPHA_SIZE = SDL_GL_ALPHA_SIZE * GL_BUFFER_SIZE = SDL_GL_BUFFER_SIZE */ __pyx_t_1 = __Pyx_PyInt_From_SDL_GLattr(SDL_GL_BLUE_SIZE); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 3, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (PyDict_SetItem(__pyx_d, __pyx_n_s_GL_BLUE_SIZE, __pyx_t_1) < 0) __PYX_ERR(3, 3, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "include/glattr.pxi":4 * GL_GREEN_SIZE = SDL_GL_GREEN_SIZE * GL_BLUE_SIZE = SDL_GL_BLUE_SIZE * GL_ALPHA_SIZE = SDL_GL_ALPHA_SIZE # <<<<<<<<<<<<<< * GL_BUFFER_SIZE = SDL_GL_BUFFER_SIZE * GL_DOUBLEBUFFER = SDL_GL_DOUBLEBUFFER */ __pyx_t_1 = __Pyx_PyInt_From_SDL_GLattr(SDL_GL_ALPHA_SIZE); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 4, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (PyDict_SetItem(__pyx_d, __pyx_n_s_GL_ALPHA_SIZE, __pyx_t_1) < 0) __PYX_ERR(3, 4, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "include/glattr.pxi":5 * GL_BLUE_SIZE = SDL_GL_BLUE_SIZE * GL_ALPHA_SIZE = SDL_GL_ALPHA_SIZE * GL_BUFFER_SIZE = SDL_GL_BUFFER_SIZE # <<<<<<<<<<<<<< * GL_DOUBLEBUFFER = SDL_GL_DOUBLEBUFFER * GL_DEPTH_SIZE = SDL_GL_DEPTH_SIZE */ __pyx_t_1 = __Pyx_PyInt_From_SDL_GLattr(SDL_GL_BUFFER_SIZE); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 5, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (PyDict_SetItem(__pyx_d, __pyx_n_s_GL_BUFFER_SIZE, __pyx_t_1) < 0) __PYX_ERR(3, 5, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "include/glattr.pxi":6 * GL_ALPHA_SIZE = SDL_GL_ALPHA_SIZE * GL_BUFFER_SIZE = SDL_GL_BUFFER_SIZE * GL_DOUBLEBUFFER = SDL_GL_DOUBLEBUFFER # <<<<<<<<<<<<<< * GL_DEPTH_SIZE = SDL_GL_DEPTH_SIZE * GL_STENCIL_SIZE = SDL_GL_STENCIL_SIZE */ __pyx_t_1 = __Pyx_PyInt_From_SDL_GLattr(SDL_GL_DOUBLEBUFFER); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 6, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (PyDict_SetItem(__pyx_d, __pyx_n_s_GL_DOUBLEBUFFER, __pyx_t_1) < 0) __PYX_ERR(3, 6, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "include/glattr.pxi":7 * GL_BUFFER_SIZE = SDL_GL_BUFFER_SIZE * GL_DOUBLEBUFFER = SDL_GL_DOUBLEBUFFER * GL_DEPTH_SIZE = SDL_GL_DEPTH_SIZE # <<<<<<<<<<<<<< * GL_STENCIL_SIZE = SDL_GL_STENCIL_SIZE * GL_ACCUM_RED_SIZE = SDL_GL_ACCUM_RED_SIZE */ __pyx_t_1 = __Pyx_PyInt_From_SDL_GLattr(SDL_GL_DEPTH_SIZE); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 7, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (PyDict_SetItem(__pyx_d, __pyx_n_s_GL_DEPTH_SIZE, __pyx_t_1) < 0) __PYX_ERR(3, 7, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "include/glattr.pxi":8 * GL_DOUBLEBUFFER = SDL_GL_DOUBLEBUFFER * GL_DEPTH_SIZE = SDL_GL_DEPTH_SIZE * GL_STENCIL_SIZE = SDL_GL_STENCIL_SIZE # <<<<<<<<<<<<<< * GL_ACCUM_RED_SIZE = SDL_GL_ACCUM_RED_SIZE * GL_ACCUM_GREEN_SIZE = SDL_GL_ACCUM_GREEN_SIZE */ __pyx_t_1 = __Pyx_PyInt_From_SDL_GLattr(SDL_GL_STENCIL_SIZE); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 8, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (PyDict_SetItem(__pyx_d, __pyx_n_s_GL_STENCIL_SIZE, __pyx_t_1) < 0) __PYX_ERR(3, 8, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "include/glattr.pxi":9 * GL_DEPTH_SIZE = SDL_GL_DEPTH_SIZE * GL_STENCIL_SIZE = SDL_GL_STENCIL_SIZE * GL_ACCUM_RED_SIZE = SDL_GL_ACCUM_RED_SIZE # <<<<<<<<<<<<<< * GL_ACCUM_GREEN_SIZE = SDL_GL_ACCUM_GREEN_SIZE * GL_ACCUM_BLUE_SIZE = SDL_GL_ACCUM_BLUE_SIZE */ __pyx_t_1 = __Pyx_PyInt_From_SDL_GLattr(SDL_GL_ACCUM_RED_SIZE); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 9, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (PyDict_SetItem(__pyx_d, __pyx_n_s_GL_ACCUM_RED_SIZE, __pyx_t_1) < 0) __PYX_ERR(3, 9, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "include/glattr.pxi":10 * GL_STENCIL_SIZE = SDL_GL_STENCIL_SIZE * GL_ACCUM_RED_SIZE = SDL_GL_ACCUM_RED_SIZE * GL_ACCUM_GREEN_SIZE = SDL_GL_ACCUM_GREEN_SIZE # <<<<<<<<<<<<<< * GL_ACCUM_BLUE_SIZE = SDL_GL_ACCUM_BLUE_SIZE * GL_ACCUM_ALPHA_SIZE = SDL_GL_ACCUM_ALPHA_SIZE */ __pyx_t_1 = __Pyx_PyInt_From_SDL_GLattr(SDL_GL_ACCUM_GREEN_SIZE); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 10, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (PyDict_SetItem(__pyx_d, __pyx_n_s_GL_ACCUM_GREEN_SIZE, __pyx_t_1) < 0) __PYX_ERR(3, 10, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "include/glattr.pxi":11 * GL_ACCUM_RED_SIZE = SDL_GL_ACCUM_RED_SIZE * GL_ACCUM_GREEN_SIZE = SDL_GL_ACCUM_GREEN_SIZE * GL_ACCUM_BLUE_SIZE = SDL_GL_ACCUM_BLUE_SIZE # <<<<<<<<<<<<<< * GL_ACCUM_ALPHA_SIZE = SDL_GL_ACCUM_ALPHA_SIZE * GL_STEREO = SDL_GL_STEREO */ __pyx_t_1 = __Pyx_PyInt_From_SDL_GLattr(SDL_GL_ACCUM_BLUE_SIZE); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 11, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (PyDict_SetItem(__pyx_d, __pyx_n_s_GL_ACCUM_BLUE_SIZE, __pyx_t_1) < 0) __PYX_ERR(3, 11, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "include/glattr.pxi":12 * GL_ACCUM_GREEN_SIZE = SDL_GL_ACCUM_GREEN_SIZE * GL_ACCUM_BLUE_SIZE = SDL_GL_ACCUM_BLUE_SIZE * GL_ACCUM_ALPHA_SIZE = SDL_GL_ACCUM_ALPHA_SIZE # <<<<<<<<<<<<<< * GL_STEREO = SDL_GL_STEREO * GL_MULTISAMPLEBUFFERS = SDL_GL_MULTISAMPLEBUFFERS */ __pyx_t_1 = __Pyx_PyInt_From_SDL_GLattr(SDL_GL_ACCUM_ALPHA_SIZE); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 12, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (PyDict_SetItem(__pyx_d, __pyx_n_s_GL_ACCUM_ALPHA_SIZE, __pyx_t_1) < 0) __PYX_ERR(3, 12, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "include/glattr.pxi":13 * GL_ACCUM_BLUE_SIZE = SDL_GL_ACCUM_BLUE_SIZE * GL_ACCUM_ALPHA_SIZE = SDL_GL_ACCUM_ALPHA_SIZE * GL_STEREO = SDL_GL_STEREO # <<<<<<<<<<<<<< * GL_MULTISAMPLEBUFFERS = SDL_GL_MULTISAMPLEBUFFERS * GL_MULTISAMPLESAMPLES = SDL_GL_MULTISAMPLESAMPLES */ __pyx_t_1 = __Pyx_PyInt_From_SDL_GLattr(SDL_GL_STEREO); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 13, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (PyDict_SetItem(__pyx_d, __pyx_n_s_GL_STEREO, __pyx_t_1) < 0) __PYX_ERR(3, 13, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "include/glattr.pxi":14 * GL_ACCUM_ALPHA_SIZE = SDL_GL_ACCUM_ALPHA_SIZE * GL_STEREO = SDL_GL_STEREO * GL_MULTISAMPLEBUFFERS = SDL_GL_MULTISAMPLEBUFFERS # <<<<<<<<<<<<<< * GL_MULTISAMPLESAMPLES = SDL_GL_MULTISAMPLESAMPLES * GL_ACCELERATED_VISUAL = SDL_GL_ACCELERATED_VISUAL */ __pyx_t_1 = __Pyx_PyInt_From_SDL_GLattr(SDL_GL_MULTISAMPLEBUFFERS); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 14, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (PyDict_SetItem(__pyx_d, __pyx_n_s_GL_MULTISAMPLEBUFFERS, __pyx_t_1) < 0) __PYX_ERR(3, 14, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "include/glattr.pxi":15 * GL_STEREO = SDL_GL_STEREO * GL_MULTISAMPLEBUFFERS = SDL_GL_MULTISAMPLEBUFFERS * GL_MULTISAMPLESAMPLES = SDL_GL_MULTISAMPLESAMPLES # <<<<<<<<<<<<<< * GL_ACCELERATED_VISUAL = SDL_GL_ACCELERATED_VISUAL * GL_RETAINED_BACKING = SDL_GL_RETAINED_BACKING */ __pyx_t_1 = __Pyx_PyInt_From_SDL_GLattr(SDL_GL_MULTISAMPLESAMPLES); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 15, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (PyDict_SetItem(__pyx_d, __pyx_n_s_GL_MULTISAMPLESAMPLES, __pyx_t_1) < 0) __PYX_ERR(3, 15, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "include/glattr.pxi":16 * GL_MULTISAMPLEBUFFERS = SDL_GL_MULTISAMPLEBUFFERS * GL_MULTISAMPLESAMPLES = SDL_GL_MULTISAMPLESAMPLES * GL_ACCELERATED_VISUAL = SDL_GL_ACCELERATED_VISUAL # <<<<<<<<<<<<<< * GL_RETAINED_BACKING = SDL_GL_RETAINED_BACKING * GL_CONTEXT_MAJOR_VERSION = SDL_GL_CONTEXT_MAJOR_VERSION */ __pyx_t_1 = __Pyx_PyInt_From_SDL_GLattr(SDL_GL_ACCELERATED_VISUAL); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 16, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (PyDict_SetItem(__pyx_d, __pyx_n_s_GL_ACCELERATED_VISUAL, __pyx_t_1) < 0) __PYX_ERR(3, 16, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "include/glattr.pxi":17 * GL_MULTISAMPLESAMPLES = SDL_GL_MULTISAMPLESAMPLES * GL_ACCELERATED_VISUAL = SDL_GL_ACCELERATED_VISUAL * GL_RETAINED_BACKING = SDL_GL_RETAINED_BACKING # <<<<<<<<<<<<<< * GL_CONTEXT_MAJOR_VERSION = SDL_GL_CONTEXT_MAJOR_VERSION * GL_CONTEXT_MINOR_VERSION = SDL_GL_CONTEXT_MINOR_VERSION */ __pyx_t_1 = __Pyx_PyInt_From_SDL_GLattr(SDL_GL_RETAINED_BACKING); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 17, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (PyDict_SetItem(__pyx_d, __pyx_n_s_GL_RETAINED_BACKING, __pyx_t_1) < 0) __PYX_ERR(3, 17, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "include/glattr.pxi":18 * GL_ACCELERATED_VISUAL = SDL_GL_ACCELERATED_VISUAL * GL_RETAINED_BACKING = SDL_GL_RETAINED_BACKING * GL_CONTEXT_MAJOR_VERSION = SDL_GL_CONTEXT_MAJOR_VERSION # <<<<<<<<<<<<<< * GL_CONTEXT_MINOR_VERSION = SDL_GL_CONTEXT_MINOR_VERSION * GL_CONTEXT_EGL = SDL_GL_CONTEXT_EGL */ __pyx_t_1 = __Pyx_PyInt_From_SDL_GLattr(SDL_GL_CONTEXT_MAJOR_VERSION); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 18, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (PyDict_SetItem(__pyx_d, __pyx_n_s_GL_CONTEXT_MAJOR_VERSION, __pyx_t_1) < 0) __PYX_ERR(3, 18, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "include/glattr.pxi":19 * GL_RETAINED_BACKING = SDL_GL_RETAINED_BACKING * GL_CONTEXT_MAJOR_VERSION = SDL_GL_CONTEXT_MAJOR_VERSION * GL_CONTEXT_MINOR_VERSION = SDL_GL_CONTEXT_MINOR_VERSION # <<<<<<<<<<<<<< * GL_CONTEXT_EGL = SDL_GL_CONTEXT_EGL * GL_CONTEXT_FLAGS = SDL_GL_CONTEXT_FLAGS */ __pyx_t_1 = __Pyx_PyInt_From_SDL_GLattr(SDL_GL_CONTEXT_MINOR_VERSION); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 19, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (PyDict_SetItem(__pyx_d, __pyx_n_s_GL_CONTEXT_MINOR_VERSION, __pyx_t_1) < 0) __PYX_ERR(3, 19, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "include/glattr.pxi":20 * GL_CONTEXT_MAJOR_VERSION = SDL_GL_CONTEXT_MAJOR_VERSION * GL_CONTEXT_MINOR_VERSION = SDL_GL_CONTEXT_MINOR_VERSION * GL_CONTEXT_EGL = SDL_GL_CONTEXT_EGL # <<<<<<<<<<<<<< * GL_CONTEXT_FLAGS = SDL_GL_CONTEXT_FLAGS * GL_CONTEXT_PROFILE_MASK = SDL_GL_CONTEXT_PROFILE_MASK */ __pyx_t_1 = __Pyx_PyInt_From_SDL_GLattr(SDL_GL_CONTEXT_EGL); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 20, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (PyDict_SetItem(__pyx_d, __pyx_n_s_GL_CONTEXT_EGL, __pyx_t_1) < 0) __PYX_ERR(3, 20, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "include/glattr.pxi":21 * GL_CONTEXT_MINOR_VERSION = SDL_GL_CONTEXT_MINOR_VERSION * GL_CONTEXT_EGL = SDL_GL_CONTEXT_EGL * GL_CONTEXT_FLAGS = SDL_GL_CONTEXT_FLAGS # <<<<<<<<<<<<<< * GL_CONTEXT_PROFILE_MASK = SDL_GL_CONTEXT_PROFILE_MASK * GL_SHARE_WITH_CURRENT_CONTEXT = SDL_GL_SHARE_WITH_CURRENT_CONTEXT */ __pyx_t_1 = __Pyx_PyInt_From_SDL_GLattr(SDL_GL_CONTEXT_FLAGS); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 21, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (PyDict_SetItem(__pyx_d, __pyx_n_s_GL_CONTEXT_FLAGS, __pyx_t_1) < 0) __PYX_ERR(3, 21, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "include/glattr.pxi":22 * GL_CONTEXT_EGL = SDL_GL_CONTEXT_EGL * GL_CONTEXT_FLAGS = SDL_GL_CONTEXT_FLAGS * GL_CONTEXT_PROFILE_MASK = SDL_GL_CONTEXT_PROFILE_MASK # <<<<<<<<<<<<<< * GL_SHARE_WITH_CURRENT_CONTEXT = SDL_GL_SHARE_WITH_CURRENT_CONTEXT * GL_FRAMEBUFFER_SRGB_CAPABLE = SDL_GL_FRAMEBUFFER_SRGB_CAPABLE */ __pyx_t_1 = __Pyx_PyInt_From_SDL_GLattr(SDL_GL_CONTEXT_PROFILE_MASK); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 22, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (PyDict_SetItem(__pyx_d, __pyx_n_s_GL_CONTEXT_PROFILE_MASK, __pyx_t_1) < 0) __PYX_ERR(3, 22, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "include/glattr.pxi":23 * GL_CONTEXT_FLAGS = SDL_GL_CONTEXT_FLAGS * GL_CONTEXT_PROFILE_MASK = SDL_GL_CONTEXT_PROFILE_MASK * GL_SHARE_WITH_CURRENT_CONTEXT = SDL_GL_SHARE_WITH_CURRENT_CONTEXT # <<<<<<<<<<<<<< * GL_FRAMEBUFFER_SRGB_CAPABLE = SDL_GL_FRAMEBUFFER_SRGB_CAPABLE */ __pyx_t_1 = __Pyx_PyInt_From_SDL_GLattr(SDL_GL_SHARE_WITH_CURRENT_CONTEXT); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 23, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (PyDict_SetItem(__pyx_d, __pyx_n_s_GL_SHARE_WITH_CURRENT_CONTEXT, __pyx_t_1) < 0) __PYX_ERR(3, 23, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "include/glattr.pxi":24 * GL_CONTEXT_PROFILE_MASK = SDL_GL_CONTEXT_PROFILE_MASK * GL_SHARE_WITH_CURRENT_CONTEXT = SDL_GL_SHARE_WITH_CURRENT_CONTEXT * GL_FRAMEBUFFER_SRGB_CAPABLE = SDL_GL_FRAMEBUFFER_SRGB_CAPABLE # <<<<<<<<<<<<<< */ __pyx_t_1 = __Pyx_PyInt_From_SDL_GLattr(SDL_GL_FRAMEBUFFER_SRGB_CAPABLE); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 24, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (PyDict_SetItem(__pyx_d, __pyx_n_s_GL_FRAMEBUFFER_SRGB_CAPABLE, __pyx_t_1) < 0) __PYX_ERR(3, 24, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "pygame_sdl2/locals.pyx":15 * * include "glattr.pxi" * GL_SWAP_CONTROL = -1 # <<<<<<<<<<<<<< * * RLEACCEL = SDL_RLEACCEL */ if (PyDict_SetItem(__pyx_d, __pyx_n_s_GL_SWAP_CONTROL, __pyx_int_neg_1) < 0) __PYX_ERR(0, 15, __pyx_L1_error) /* "pygame_sdl2/locals.pyx":17 * GL_SWAP_CONTROL = -1 * * RLEACCEL = SDL_RLEACCEL # <<<<<<<<<<<<<< * SRCCOLORKEY = 0 * */ __pyx_t_1 = __Pyx_PyInt_From_int(SDL_RLEACCEL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 17, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (PyDict_SetItem(__pyx_d, __pyx_n_s_RLEACCEL, __pyx_t_1) < 0) __PYX_ERR(0, 17, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "pygame_sdl2/locals.pyx":18 * * RLEACCEL = SDL_RLEACCEL * SRCCOLORKEY = 0 # <<<<<<<<<<<<<< * * # Surface flags. */ if (PyDict_SetItem(__pyx_d, __pyx_n_s_SRCCOLORKEY, __pyx_int_0) < 0) __PYX_ERR(0, 18, __pyx_L1_error) /* "pygame_sdl2/locals.pyx":21 * * # Surface flags. * SRCALPHA = 0x80000000 # <<<<<<<<<<<<<< * HWSURFACE = 0x40000000 * SWSURFACE = 0 */ if (PyDict_SetItem(__pyx_d, __pyx_n_s_SRCALPHA, __pyx_int_2147483648) < 0) __PYX_ERR(0, 21, __pyx_L1_error) /* "pygame_sdl2/locals.pyx":22 * # Surface flags. * SRCALPHA = 0x80000000 * HWSURFACE = 0x40000000 # <<<<<<<<<<<<<< * SWSURFACE = 0 * */ if (PyDict_SetItem(__pyx_d, __pyx_n_s_HWSURFACE, __pyx_int_1073741824) < 0) __PYX_ERR(0, 22, __pyx_L1_error) /* "pygame_sdl2/locals.pyx":23 * SRCALPHA = 0x80000000 * HWSURFACE = 0x40000000 * SWSURFACE = 0 # <<<<<<<<<<<<<< * * # Window flags. */ if (PyDict_SetItem(__pyx_d, __pyx_n_s_SWSURFACE, __pyx_int_0) < 0) __PYX_ERR(0, 23, __pyx_L1_error) /* "pygame_sdl2/locals.pyx":26 * * # Window flags. * FULLSCREEN = SDL_WINDOW_FULLSCREEN # <<<<<<<<<<<<<< * OPENGL = SDL_WINDOW_OPENGL * NOFRAME = SDL_WINDOW_BORDERLESS */ __pyx_t_1 = __Pyx_PyInt_From_SDL_WindowFlags(SDL_WINDOW_FULLSCREEN); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 26, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (PyDict_SetItem(__pyx_d, __pyx_n_s_FULLSCREEN, __pyx_t_1) < 0) __PYX_ERR(0, 26, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "pygame_sdl2/locals.pyx":27 * # Window flags. * FULLSCREEN = SDL_WINDOW_FULLSCREEN * OPENGL = SDL_WINDOW_OPENGL # <<<<<<<<<<<<<< * NOFRAME = SDL_WINDOW_BORDERLESS * RESIZABLE = SDL_WINDOW_RESIZABLE */ __pyx_t_1 = __Pyx_PyInt_From_SDL_WindowFlags(SDL_WINDOW_OPENGL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 27, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (PyDict_SetItem(__pyx_d, __pyx_n_s_OPENGL, __pyx_t_1) < 0) __PYX_ERR(0, 27, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "pygame_sdl2/locals.pyx":28 * FULLSCREEN = SDL_WINDOW_FULLSCREEN * OPENGL = SDL_WINDOW_OPENGL * NOFRAME = SDL_WINDOW_BORDERLESS # <<<<<<<<<<<<<< * RESIZABLE = SDL_WINDOW_RESIZABLE * DOUBLEBUF = 0 */ __pyx_t_1 = __Pyx_PyInt_From_SDL_WindowFlags(SDL_WINDOW_BORDERLESS); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 28, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (PyDict_SetItem(__pyx_d, __pyx_n_s_NOFRAME, __pyx_t_1) < 0) __PYX_ERR(0, 28, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "pygame_sdl2/locals.pyx":29 * OPENGL = SDL_WINDOW_OPENGL * NOFRAME = SDL_WINDOW_BORDERLESS * RESIZABLE = SDL_WINDOW_RESIZABLE # <<<<<<<<<<<<<< * DOUBLEBUF = 0 * */ __pyx_t_1 = __Pyx_PyInt_From_SDL_WindowFlags(SDL_WINDOW_RESIZABLE); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 29, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (PyDict_SetItem(__pyx_d, __pyx_n_s_RESIZABLE, __pyx_t_1) < 0) __PYX_ERR(0, 29, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "pygame_sdl2/locals.pyx":30 * NOFRAME = SDL_WINDOW_BORDERLESS * RESIZABLE = SDL_WINDOW_RESIZABLE * DOUBLEBUF = 0 # <<<<<<<<<<<<<< * * WINDOW_FULLSCREEN = SDL_WINDOW_FULLSCREEN */ if (PyDict_SetItem(__pyx_d, __pyx_n_s_DOUBLEBUF, __pyx_int_0) < 0) __PYX_ERR(0, 30, __pyx_L1_error) /* "pygame_sdl2/locals.pyx":32 * DOUBLEBUF = 0 * * WINDOW_FULLSCREEN = SDL_WINDOW_FULLSCREEN # <<<<<<<<<<<<<< * WINDOW_SHOWN = SDL_WINDOW_SHOWN * WINDOW_HIDDEN = SDL_WINDOW_HIDDEN */ __pyx_t_1 = __Pyx_PyInt_From_SDL_WindowFlags(SDL_WINDOW_FULLSCREEN); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 32, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (PyDict_SetItem(__pyx_d, __pyx_n_s_WINDOW_FULLSCREEN, __pyx_t_1) < 0) __PYX_ERR(0, 32, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "pygame_sdl2/locals.pyx":33 * * WINDOW_FULLSCREEN = SDL_WINDOW_FULLSCREEN * WINDOW_SHOWN = SDL_WINDOW_SHOWN # <<<<<<<<<<<<<< * WINDOW_HIDDEN = SDL_WINDOW_HIDDEN * WINDOW_OPENGL = SDL_WINDOW_OPENGL */ __pyx_t_1 = __Pyx_PyInt_From_SDL_WindowFlags(SDL_WINDOW_SHOWN); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 33, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (PyDict_SetItem(__pyx_d, __pyx_n_s_WINDOW_SHOWN, __pyx_t_1) < 0) __PYX_ERR(0, 33, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "pygame_sdl2/locals.pyx":34 * WINDOW_FULLSCREEN = SDL_WINDOW_FULLSCREEN * WINDOW_SHOWN = SDL_WINDOW_SHOWN * WINDOW_HIDDEN = SDL_WINDOW_HIDDEN # <<<<<<<<<<<<<< * WINDOW_OPENGL = SDL_WINDOW_OPENGL * WINDOW_NOFRAME = SDL_WINDOW_BORDERLESS */ __pyx_t_1 = __Pyx_PyInt_From_SDL_WindowFlags(SDL_WINDOW_HIDDEN); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 34, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (PyDict_SetItem(__pyx_d, __pyx_n_s_WINDOW_HIDDEN, __pyx_t_1) < 0) __PYX_ERR(0, 34, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "pygame_sdl2/locals.pyx":35 * WINDOW_SHOWN = SDL_WINDOW_SHOWN * WINDOW_HIDDEN = SDL_WINDOW_HIDDEN * WINDOW_OPENGL = SDL_WINDOW_OPENGL # <<<<<<<<<<<<<< * WINDOW_NOFRAME = SDL_WINDOW_BORDERLESS * WINDOW_BORDERLESS = SDL_WINDOW_BORDERLESS */ __pyx_t_1 = __Pyx_PyInt_From_SDL_WindowFlags(SDL_WINDOW_OPENGL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 35, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (PyDict_SetItem(__pyx_d, __pyx_n_s_WINDOW_OPENGL, __pyx_t_1) < 0) __PYX_ERR(0, 35, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "pygame_sdl2/locals.pyx":36 * WINDOW_HIDDEN = SDL_WINDOW_HIDDEN * WINDOW_OPENGL = SDL_WINDOW_OPENGL * WINDOW_NOFRAME = SDL_WINDOW_BORDERLESS # <<<<<<<<<<<<<< * WINDOW_BORDERLESS = SDL_WINDOW_BORDERLESS * WINDOW_RESIZABLE = SDL_WINDOW_RESIZABLE */ __pyx_t_1 = __Pyx_PyInt_From_SDL_WindowFlags(SDL_WINDOW_BORDERLESS); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 36, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (PyDict_SetItem(__pyx_d, __pyx_n_s_WINDOW_NOFRAME, __pyx_t_1) < 0) __PYX_ERR(0, 36, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "pygame_sdl2/locals.pyx":37 * WINDOW_OPENGL = SDL_WINDOW_OPENGL * WINDOW_NOFRAME = SDL_WINDOW_BORDERLESS * WINDOW_BORDERLESS = SDL_WINDOW_BORDERLESS # <<<<<<<<<<<<<< * WINDOW_RESIZABLE = SDL_WINDOW_RESIZABLE * WINDOW_MINIMIZED = SDL_WINDOW_MINIMIZED */ __pyx_t_1 = __Pyx_PyInt_From_SDL_WindowFlags(SDL_WINDOW_BORDERLESS); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 37, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (PyDict_SetItem(__pyx_d, __pyx_n_s_WINDOW_BORDERLESS, __pyx_t_1) < 0) __PYX_ERR(0, 37, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "pygame_sdl2/locals.pyx":38 * WINDOW_NOFRAME = SDL_WINDOW_BORDERLESS * WINDOW_BORDERLESS = SDL_WINDOW_BORDERLESS * WINDOW_RESIZABLE = SDL_WINDOW_RESIZABLE # <<<<<<<<<<<<<< * WINDOW_MINIMIZED = SDL_WINDOW_MINIMIZED * WINDOW_MAXIMIZED = SDL_WINDOW_MAXIMIZED */ __pyx_t_1 = __Pyx_PyInt_From_SDL_WindowFlags(SDL_WINDOW_RESIZABLE); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 38, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (PyDict_SetItem(__pyx_d, __pyx_n_s_WINDOW_RESIZABLE, __pyx_t_1) < 0) __PYX_ERR(0, 38, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "pygame_sdl2/locals.pyx":39 * WINDOW_BORDERLESS = SDL_WINDOW_BORDERLESS * WINDOW_RESIZABLE = SDL_WINDOW_RESIZABLE * WINDOW_MINIMIZED = SDL_WINDOW_MINIMIZED # <<<<<<<<<<<<<< * WINDOW_MAXIMIZED = SDL_WINDOW_MAXIMIZED * WINDOW_INPUT_GRABBED = SDL_WINDOW_INPUT_GRABBED */ __pyx_t_1 = __Pyx_PyInt_From_SDL_WindowFlags(SDL_WINDOW_MINIMIZED); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 39, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (PyDict_SetItem(__pyx_d, __pyx_n_s_WINDOW_MINIMIZED, __pyx_t_1) < 0) __PYX_ERR(0, 39, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "pygame_sdl2/locals.pyx":40 * WINDOW_RESIZABLE = SDL_WINDOW_RESIZABLE * WINDOW_MINIMIZED = SDL_WINDOW_MINIMIZED * WINDOW_MAXIMIZED = SDL_WINDOW_MAXIMIZED # <<<<<<<<<<<<<< * WINDOW_INPUT_GRABBED = SDL_WINDOW_INPUT_GRABBED * WINDOW_INPUT_FOCUS = SDL_WINDOW_MOUSE_FOCUS */ __pyx_t_1 = __Pyx_PyInt_From_SDL_WindowFlags(SDL_WINDOW_MAXIMIZED); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 40, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (PyDict_SetItem(__pyx_d, __pyx_n_s_WINDOW_MAXIMIZED, __pyx_t_1) < 0) __PYX_ERR(0, 40, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "pygame_sdl2/locals.pyx":41 * WINDOW_MINIMIZED = SDL_WINDOW_MINIMIZED * WINDOW_MAXIMIZED = SDL_WINDOW_MAXIMIZED * WINDOW_INPUT_GRABBED = SDL_WINDOW_INPUT_GRABBED # <<<<<<<<<<<<<< * WINDOW_INPUT_FOCUS = SDL_WINDOW_MOUSE_FOCUS * WINDOW_FULLSCREEN_DESKTOP = SDL_WINDOW_FULLSCREEN_DESKTOP */ __pyx_t_1 = __Pyx_PyInt_From_SDL_WindowFlags(SDL_WINDOW_INPUT_GRABBED); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 41, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (PyDict_SetItem(__pyx_d, __pyx_n_s_WINDOW_INPUT_GRABBED, __pyx_t_1) < 0) __PYX_ERR(0, 41, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "pygame_sdl2/locals.pyx":42 * WINDOW_MAXIMIZED = SDL_WINDOW_MAXIMIZED * WINDOW_INPUT_GRABBED = SDL_WINDOW_INPUT_GRABBED * WINDOW_INPUT_FOCUS = SDL_WINDOW_MOUSE_FOCUS # <<<<<<<<<<<<<< * WINDOW_FULLSCREEN_DESKTOP = SDL_WINDOW_FULLSCREEN_DESKTOP * WINDOW_FOREIGN = SDL_WINDOW_FOREIGN */ __pyx_t_1 = __Pyx_PyInt_From_SDL_WindowFlags(SDL_WINDOW_MOUSE_FOCUS); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 42, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (PyDict_SetItem(__pyx_d, __pyx_n_s_WINDOW_INPUT_FOCUS, __pyx_t_1) < 0) __PYX_ERR(0, 42, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "pygame_sdl2/locals.pyx":43 * WINDOW_INPUT_GRABBED = SDL_WINDOW_INPUT_GRABBED * WINDOW_INPUT_FOCUS = SDL_WINDOW_MOUSE_FOCUS * WINDOW_FULLSCREEN_DESKTOP = SDL_WINDOW_FULLSCREEN_DESKTOP # <<<<<<<<<<<<<< * WINDOW_FOREIGN = SDL_WINDOW_FOREIGN * WINDOW_ALLOW_HIGHDPI = SDL_WINDOW_ALLOW_HIGHDPI */ __pyx_t_1 = __Pyx_PyInt_From_SDL_WindowFlags(SDL_WINDOW_FULLSCREEN_DESKTOP); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 43, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (PyDict_SetItem(__pyx_d, __pyx_n_s_WINDOW_FULLSCREEN_DESKTOP, __pyx_t_1) < 0) __PYX_ERR(0, 43, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "pygame_sdl2/locals.pyx":44 * WINDOW_INPUT_FOCUS = SDL_WINDOW_MOUSE_FOCUS * WINDOW_FULLSCREEN_DESKTOP = SDL_WINDOW_FULLSCREEN_DESKTOP * WINDOW_FOREIGN = SDL_WINDOW_FOREIGN # <<<<<<<<<<<<<< * WINDOW_ALLOW_HIGHDPI = SDL_WINDOW_ALLOW_HIGHDPI * */ __pyx_t_1 = __Pyx_PyInt_From_SDL_WindowFlags(SDL_WINDOW_FOREIGN); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 44, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (PyDict_SetItem(__pyx_d, __pyx_n_s_WINDOW_FOREIGN, __pyx_t_1) < 0) __PYX_ERR(0, 44, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "pygame_sdl2/locals.pyx":45 * WINDOW_FULLSCREEN_DESKTOP = SDL_WINDOW_FULLSCREEN_DESKTOP * WINDOW_FOREIGN = SDL_WINDOW_FOREIGN * WINDOW_ALLOW_HIGHDPI = SDL_WINDOW_ALLOW_HIGHDPI # <<<<<<<<<<<<<< * * WINDOWPOS_CENTERED = SDL_WINDOWPOS_CENTERED */ __pyx_t_1 = __Pyx_PyInt_From_SDL_WindowFlags(SDL_WINDOW_ALLOW_HIGHDPI); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 45, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (PyDict_SetItem(__pyx_d, __pyx_n_s_WINDOW_ALLOW_HIGHDPI, __pyx_t_1) < 0) __PYX_ERR(0, 45, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "pygame_sdl2/locals.pyx":47 * WINDOW_ALLOW_HIGHDPI = SDL_WINDOW_ALLOW_HIGHDPI * * WINDOWPOS_CENTERED = SDL_WINDOWPOS_CENTERED # <<<<<<<<<<<<<< * WINDOWPOS_UNDEFINED = SDL_WINDOWPOS_UNDEFINED * */ __pyx_t_1 = __Pyx_PyInt_From_int(SDL_WINDOWPOS_CENTERED); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 47, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (PyDict_SetItem(__pyx_d, __pyx_n_s_WINDOWPOS_CENTERED, __pyx_t_1) < 0) __PYX_ERR(0, 47, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "pygame_sdl2/locals.pyx":48 * * WINDOWPOS_CENTERED = SDL_WINDOWPOS_CENTERED * WINDOWPOS_UNDEFINED = SDL_WINDOWPOS_UNDEFINED # <<<<<<<<<<<<<< * * # Blend modes */ __pyx_t_1 = __Pyx_PyInt_From_int(SDL_WINDOWPOS_UNDEFINED); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 48, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (PyDict_SetItem(__pyx_d, __pyx_n_s_WINDOWPOS_UNDEFINED, __pyx_t_1) < 0) __PYX_ERR(0, 48, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "pygame_sdl2/locals.pyx":51 * * # Blend modes * BLEND_RGB_ADD = BLEND_ADD = 0x1 # <<<<<<<<<<<<<< * BLEND_RGB_SUB = BLEND_SUB = 0x2 * BLEND_RGB_MULT = BLEND_MULT = 0x3 */ if (PyDict_SetItem(__pyx_d, __pyx_n_s_BLEND_RGB_ADD, __pyx_int_1) < 0) __PYX_ERR(0, 51, __pyx_L1_error) if (PyDict_SetItem(__pyx_d, __pyx_n_s_BLEND_ADD, __pyx_int_1) < 0) __PYX_ERR(0, 51, __pyx_L1_error) /* "pygame_sdl2/locals.pyx":52 * # Blend modes * BLEND_RGB_ADD = BLEND_ADD = 0x1 * BLEND_RGB_SUB = BLEND_SUB = 0x2 # <<<<<<<<<<<<<< * BLEND_RGB_MULT = BLEND_MULT = 0x3 * BLEND_RGB_MIN = BLEND_MIN = 0x4 */ if (PyDict_SetItem(__pyx_d, __pyx_n_s_BLEND_RGB_SUB, __pyx_int_2) < 0) __PYX_ERR(0, 52, __pyx_L1_error) if (PyDict_SetItem(__pyx_d, __pyx_n_s_BLEND_SUB, __pyx_int_2) < 0) __PYX_ERR(0, 52, __pyx_L1_error) /* "pygame_sdl2/locals.pyx":53 * BLEND_RGB_ADD = BLEND_ADD = 0x1 * BLEND_RGB_SUB = BLEND_SUB = 0x2 * BLEND_RGB_MULT = BLEND_MULT = 0x3 # <<<<<<<<<<<<<< * BLEND_RGB_MIN = BLEND_MIN = 0x4 * BLEND_RGB_MAX = BLEND_MAX = 0x5 */ if (PyDict_SetItem(__pyx_d, __pyx_n_s_BLEND_RGB_MULT, __pyx_int_3) < 0) __PYX_ERR(0, 53, __pyx_L1_error) if (PyDict_SetItem(__pyx_d, __pyx_n_s_BLEND_MULT, __pyx_int_3) < 0) __PYX_ERR(0, 53, __pyx_L1_error) /* "pygame_sdl2/locals.pyx":54 * BLEND_RGB_SUB = BLEND_SUB = 0x2 * BLEND_RGB_MULT = BLEND_MULT = 0x3 * BLEND_RGB_MIN = BLEND_MIN = 0x4 # <<<<<<<<<<<<<< * BLEND_RGB_MAX = BLEND_MAX = 0x5 * */ if (PyDict_SetItem(__pyx_d, __pyx_n_s_BLEND_RGB_MIN, __pyx_int_4) < 0) __PYX_ERR(0, 54, __pyx_L1_error) if (PyDict_SetItem(__pyx_d, __pyx_n_s_BLEND_MIN, __pyx_int_4) < 0) __PYX_ERR(0, 54, __pyx_L1_error) /* "pygame_sdl2/locals.pyx":55 * BLEND_RGB_MULT = BLEND_MULT = 0x3 * BLEND_RGB_MIN = BLEND_MIN = 0x4 * BLEND_RGB_MAX = BLEND_MAX = 0x5 # <<<<<<<<<<<<<< * * BLEND_RGBA_ADD = 0x6 */ if (PyDict_SetItem(__pyx_d, __pyx_n_s_BLEND_RGB_MAX, __pyx_int_5) < 0) __PYX_ERR(0, 55, __pyx_L1_error) if (PyDict_SetItem(__pyx_d, __pyx_n_s_BLEND_MAX, __pyx_int_5) < 0) __PYX_ERR(0, 55, __pyx_L1_error) /* "pygame_sdl2/locals.pyx":57 * BLEND_RGB_MAX = BLEND_MAX = 0x5 * * BLEND_RGBA_ADD = 0x6 # <<<<<<<<<<<<<< * BLEND_RGBA_SUB = 0x7 * BLEND_RGBA_MULT = 0x8 */ if (PyDict_SetItem(__pyx_d, __pyx_n_s_BLEND_RGBA_ADD, __pyx_int_6) < 0) __PYX_ERR(0, 57, __pyx_L1_error) /* "pygame_sdl2/locals.pyx":58 * * BLEND_RGBA_ADD = 0x6 * BLEND_RGBA_SUB = 0x7 # <<<<<<<<<<<<<< * BLEND_RGBA_MULT = 0x8 * BLEND_RGBA_MIN = 0x9 */ if (PyDict_SetItem(__pyx_d, __pyx_n_s_BLEND_RGBA_SUB, __pyx_int_7) < 0) __PYX_ERR(0, 58, __pyx_L1_error) /* "pygame_sdl2/locals.pyx":59 * BLEND_RGBA_ADD = 0x6 * BLEND_RGBA_SUB = 0x7 * BLEND_RGBA_MULT = 0x8 # <<<<<<<<<<<<<< * BLEND_RGBA_MIN = 0x9 * BLEND_RGBA_MAX = 0x10 */ if (PyDict_SetItem(__pyx_d, __pyx_n_s_BLEND_RGBA_MULT, __pyx_int_8) < 0) __PYX_ERR(0, 59, __pyx_L1_error) /* "pygame_sdl2/locals.pyx":60 * BLEND_RGBA_SUB = 0x7 * BLEND_RGBA_MULT = 0x8 * BLEND_RGBA_MIN = 0x9 # <<<<<<<<<<<<<< * BLEND_RGBA_MAX = 0x10 * */ if (PyDict_SetItem(__pyx_d, __pyx_n_s_BLEND_RGBA_MIN, __pyx_int_9) < 0) __PYX_ERR(0, 60, __pyx_L1_error) /* "pygame_sdl2/locals.pyx":61 * BLEND_RGBA_MULT = 0x8 * BLEND_RGBA_MIN = 0x9 * BLEND_RGBA_MAX = 0x10 # <<<<<<<<<<<<<< * * BLEND_PREMULTIPLIED = 0x11 */ if (PyDict_SetItem(__pyx_d, __pyx_n_s_BLEND_RGBA_MAX, __pyx_int_16) < 0) __PYX_ERR(0, 61, __pyx_L1_error) /* "pygame_sdl2/locals.pyx":63 * BLEND_RGBA_MAX = 0x10 * * BLEND_PREMULTIPLIED = 0x11 # <<<<<<<<<<<<<< * * # Scrap types. */ if (PyDict_SetItem(__pyx_d, __pyx_n_s_BLEND_PREMULTIPLIED, __pyx_int_17) < 0) __PYX_ERR(0, 63, __pyx_L1_error) /* "pygame_sdl2/locals.pyx":66 * * # Scrap types. * SCRAP_TEXT = "text/plain" # <<<<<<<<<<<<<< * * BYTEORDER = SDL_BYTEORDER */ if (PyDict_SetItem(__pyx_d, __pyx_n_s_SCRAP_TEXT, __pyx_kp_u_text_plain) < 0) __PYX_ERR(0, 66, __pyx_L1_error) /* "pygame_sdl2/locals.pyx":68 * SCRAP_TEXT = "text/plain" * * BYTEORDER = SDL_BYTEORDER # <<<<<<<<<<<<<< * LIL_ENDIAN = SDL_LIL_ENDIAN * BIG_ENDIAN = SDL_BIG_ENDIAN */ __pyx_t_1 = __Pyx_PyInt_From_int(SDL_BYTEORDER); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 68, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (PyDict_SetItem(__pyx_d, __pyx_n_s_BYTEORDER, __pyx_t_1) < 0) __PYX_ERR(0, 68, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "pygame_sdl2/locals.pyx":69 * * BYTEORDER = SDL_BYTEORDER * LIL_ENDIAN = SDL_LIL_ENDIAN # <<<<<<<<<<<<<< * BIG_ENDIAN = SDL_BIG_ENDIAN * */ __pyx_t_1 = __Pyx_PyInt_From_int(SDL_LIL_ENDIAN); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 69, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (PyDict_SetItem(__pyx_d, __pyx_n_s_LIL_ENDIAN, __pyx_t_1) < 0) __PYX_ERR(0, 69, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "pygame_sdl2/locals.pyx":70 * BYTEORDER = SDL_BYTEORDER * LIL_ENDIAN = SDL_LIL_ENDIAN * BIG_ENDIAN = SDL_BIG_ENDIAN # <<<<<<<<<<<<<< * * SDL_VERSION_TUPLE = (SDL_MAJOR_VERSION, SDL_MINOR_VERSION, SDL_PATCHLEVEL) */ __pyx_t_1 = __Pyx_PyInt_From_int(SDL_BIG_ENDIAN); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 70, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (PyDict_SetItem(__pyx_d, __pyx_n_s_BIG_ENDIAN, __pyx_t_1) < 0) __PYX_ERR(0, 70, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "pygame_sdl2/locals.pyx":72 * BIG_ENDIAN = SDL_BIG_ENDIAN * * SDL_VERSION_TUPLE = (SDL_MAJOR_VERSION, SDL_MINOR_VERSION, SDL_PATCHLEVEL) # <<<<<<<<<<<<<< * * globals().update(dict( */ __pyx_t_1 = __Pyx_PyInt_From_int(SDL_MAJOR_VERSION); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 72, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = __Pyx_PyInt_From_int(SDL_MINOR_VERSION); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 72, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = __Pyx_PyInt_From_int(SDL_PATCHLEVEL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 72, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = PyTuple_New(3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 72, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_GIVEREF(__pyx_t_1); PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_1); __Pyx_GIVEREF(__pyx_t_2); PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_2); __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_4, 2, __pyx_t_3); __pyx_t_1 = 0; __pyx_t_2 = 0; __pyx_t_3 = 0; if (PyDict_SetItem(__pyx_d, __pyx_n_s_SDL_VERSION_TUPLE, __pyx_t_4) < 0) __PYX_ERR(0, 72, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; /* "pygame_sdl2/locals.pyx":74 * SDL_VERSION_TUPLE = (SDL_MAJOR_VERSION, SDL_MINOR_VERSION, SDL_PATCHLEVEL) * * globals().update(dict( # <<<<<<<<<<<<<< * KMOD_NONE = sdl2.KMOD_NONE, * */ __pyx_t_3 = __Pyx_Globals(); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 74, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_update); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 74, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "pygame_sdl2/locals.pyx":75 * * globals().update(dict( * KMOD_NONE = sdl2.KMOD_NONE, # <<<<<<<<<<<<<< * * KMOD_LSHIFT = sdl2.KMOD_LSHIFT, */ __pyx_t_3 = PyDict_New(); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 75, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_1 = __Pyx_PyInt_From_SDL_Keymod(KMOD_NONE); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 75, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_KMOD_NONE, __pyx_t_1) < 0) __PYX_ERR(0, 75, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "pygame_sdl2/locals.pyx":77 * KMOD_NONE = sdl2.KMOD_NONE, * * KMOD_LSHIFT = sdl2.KMOD_LSHIFT, # <<<<<<<<<<<<<< * KMOD_RSHIFT = sdl2.KMOD_RSHIFT, * KMOD_SHIFT = sdl2.KMOD_SHIFT, */ __pyx_t_1 = __Pyx_PyInt_From_SDL_Keymod(KMOD_LSHIFT); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 77, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_KMOD_LSHIFT, __pyx_t_1) < 0) __PYX_ERR(0, 75, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "pygame_sdl2/locals.pyx":78 * * KMOD_LSHIFT = sdl2.KMOD_LSHIFT, * KMOD_RSHIFT = sdl2.KMOD_RSHIFT, # <<<<<<<<<<<<<< * KMOD_SHIFT = sdl2.KMOD_SHIFT, * */ __pyx_t_1 = __Pyx_PyInt_From_SDL_Keymod(KMOD_RSHIFT); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 78, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_KMOD_RSHIFT, __pyx_t_1) < 0) __PYX_ERR(0, 75, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "pygame_sdl2/locals.pyx":79 * KMOD_LSHIFT = sdl2.KMOD_LSHIFT, * KMOD_RSHIFT = sdl2.KMOD_RSHIFT, * KMOD_SHIFT = sdl2.KMOD_SHIFT, # <<<<<<<<<<<<<< * * KMOD_LCTRL = sdl2.KMOD_LCTRL, */ __pyx_t_1 = __Pyx_PyInt_From_int(KMOD_SHIFT); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 79, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_KMOD_SHIFT, __pyx_t_1) < 0) __PYX_ERR(0, 75, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "pygame_sdl2/locals.pyx":81 * KMOD_SHIFT = sdl2.KMOD_SHIFT, * * KMOD_LCTRL = sdl2.KMOD_LCTRL, # <<<<<<<<<<<<<< * KMOD_RCTRL = sdl2.KMOD_RCTRL, * KMOD_CTRL = sdl2.KMOD_CTRL, */ __pyx_t_1 = __Pyx_PyInt_From_SDL_Keymod(KMOD_LCTRL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 81, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_KMOD_LCTRL, __pyx_t_1) < 0) __PYX_ERR(0, 75, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "pygame_sdl2/locals.pyx":82 * * KMOD_LCTRL = sdl2.KMOD_LCTRL, * KMOD_RCTRL = sdl2.KMOD_RCTRL, # <<<<<<<<<<<<<< * KMOD_CTRL = sdl2.KMOD_CTRL, * */ __pyx_t_1 = __Pyx_PyInt_From_SDL_Keymod(KMOD_RCTRL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 82, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_KMOD_RCTRL, __pyx_t_1) < 0) __PYX_ERR(0, 75, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "pygame_sdl2/locals.pyx":83 * KMOD_LCTRL = sdl2.KMOD_LCTRL, * KMOD_RCTRL = sdl2.KMOD_RCTRL, * KMOD_CTRL = sdl2.KMOD_CTRL, # <<<<<<<<<<<<<< * * KMOD_LALT = sdl2.KMOD_LALT, */ __pyx_t_1 = __Pyx_PyInt_From_int(KMOD_CTRL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 83, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_KMOD_CTRL, __pyx_t_1) < 0) __PYX_ERR(0, 75, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "pygame_sdl2/locals.pyx":85 * KMOD_CTRL = sdl2.KMOD_CTRL, * * KMOD_LALT = sdl2.KMOD_LALT, # <<<<<<<<<<<<<< * KMOD_RALT = sdl2.KMOD_RALT, * KMOD_ALT = sdl2.KMOD_ALT, */ __pyx_t_1 = __Pyx_PyInt_From_SDL_Keymod(KMOD_LALT); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 85, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_KMOD_LALT, __pyx_t_1) < 0) __PYX_ERR(0, 75, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "pygame_sdl2/locals.pyx":86 * * KMOD_LALT = sdl2.KMOD_LALT, * KMOD_RALT = sdl2.KMOD_RALT, # <<<<<<<<<<<<<< * KMOD_ALT = sdl2.KMOD_ALT, * */ __pyx_t_1 = __Pyx_PyInt_From_SDL_Keymod(KMOD_RALT); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 86, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_KMOD_RALT, __pyx_t_1) < 0) __PYX_ERR(0, 75, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "pygame_sdl2/locals.pyx":87 * KMOD_LALT = sdl2.KMOD_LALT, * KMOD_RALT = sdl2.KMOD_RALT, * KMOD_ALT = sdl2.KMOD_ALT, # <<<<<<<<<<<<<< * * KMOD_LGUI = sdl2.KMOD_LGUI, */ __pyx_t_1 = __Pyx_PyInt_From_int(KMOD_ALT); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 87, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_KMOD_ALT, __pyx_t_1) < 0) __PYX_ERR(0, 75, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "pygame_sdl2/locals.pyx":89 * KMOD_ALT = sdl2.KMOD_ALT, * * KMOD_LGUI = sdl2.KMOD_LGUI, # <<<<<<<<<<<<<< * KMOD_RGUI = sdl2.KMOD_RGUI, * KMOD_GUI = sdl2.KMOD_GUI, */ __pyx_t_1 = __Pyx_PyInt_From_SDL_Keymod(KMOD_LGUI); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 89, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_KMOD_LGUI, __pyx_t_1) < 0) __PYX_ERR(0, 75, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "pygame_sdl2/locals.pyx":90 * * KMOD_LGUI = sdl2.KMOD_LGUI, * KMOD_RGUI = sdl2.KMOD_RGUI, # <<<<<<<<<<<<<< * KMOD_GUI = sdl2.KMOD_GUI, * */ __pyx_t_1 = __Pyx_PyInt_From_SDL_Keymod(KMOD_RGUI); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 90, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_KMOD_RGUI, __pyx_t_1) < 0) __PYX_ERR(0, 75, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "pygame_sdl2/locals.pyx":91 * KMOD_LGUI = sdl2.KMOD_LGUI, * KMOD_RGUI = sdl2.KMOD_RGUI, * KMOD_GUI = sdl2.KMOD_GUI, # <<<<<<<<<<<<<< * * KMOD_LMETA = sdl2.KMOD_LGUI, */ __pyx_t_1 = __Pyx_PyInt_From_int(KMOD_GUI); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 91, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_KMOD_GUI, __pyx_t_1) < 0) __PYX_ERR(0, 75, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "pygame_sdl2/locals.pyx":93 * KMOD_GUI = sdl2.KMOD_GUI, * * KMOD_LMETA = sdl2.KMOD_LGUI, # <<<<<<<<<<<<<< * KMOD_RMETA = sdl2.KMOD_RGUI, * KMOD_META = sdl2.KMOD_GUI, */ __pyx_t_1 = __Pyx_PyInt_From_SDL_Keymod(KMOD_LGUI); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 93, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_KMOD_LMETA, __pyx_t_1) < 0) __PYX_ERR(0, 75, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "pygame_sdl2/locals.pyx":94 * * KMOD_LMETA = sdl2.KMOD_LGUI, * KMOD_RMETA = sdl2.KMOD_RGUI, # <<<<<<<<<<<<<< * KMOD_META = sdl2.KMOD_GUI, * */ __pyx_t_1 = __Pyx_PyInt_From_SDL_Keymod(KMOD_RGUI); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 94, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_KMOD_RMETA, __pyx_t_1) < 0) __PYX_ERR(0, 75, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "pygame_sdl2/locals.pyx":95 * KMOD_LMETA = sdl2.KMOD_LGUI, * KMOD_RMETA = sdl2.KMOD_RGUI, * KMOD_META = sdl2.KMOD_GUI, # <<<<<<<<<<<<<< * * KMOD_NUM = sdl2.KMOD_NUM, */ __pyx_t_1 = __Pyx_PyInt_From_int(KMOD_GUI); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 95, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_KMOD_META, __pyx_t_1) < 0) __PYX_ERR(0, 75, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "pygame_sdl2/locals.pyx":97 * KMOD_META = sdl2.KMOD_GUI, * * KMOD_NUM = sdl2.KMOD_NUM, # <<<<<<<<<<<<<< * KMOD_CAPS = sdl2.KMOD_CAPS, * */ __pyx_t_1 = __Pyx_PyInt_From_SDL_Keymod(KMOD_NUM); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 97, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_KMOD_NUM, __pyx_t_1) < 0) __PYX_ERR(0, 75, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "pygame_sdl2/locals.pyx":98 * * KMOD_NUM = sdl2.KMOD_NUM, * KMOD_CAPS = sdl2.KMOD_CAPS, # <<<<<<<<<<<<<< * * KMOD_MODE = sdl2.KMOD_MODE, */ __pyx_t_1 = __Pyx_PyInt_From_SDL_Keymod(KMOD_CAPS); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 98, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_KMOD_CAPS, __pyx_t_1) < 0) __PYX_ERR(0, 75, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "pygame_sdl2/locals.pyx":100 * KMOD_CAPS = sdl2.KMOD_CAPS, * * KMOD_MODE = sdl2.KMOD_MODE, # <<<<<<<<<<<<<< * * K_FIRST = 0, */ __pyx_t_1 = __Pyx_PyInt_From_SDL_Keymod(KMOD_MODE); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 100, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_KMOD_MODE, __pyx_t_1) < 0) __PYX_ERR(0, 75, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_K_FIRST, __pyx_int_0) < 0) __PYX_ERR(0, 75, __pyx_L1_error) /* "pygame_sdl2/locals.pyx":103 * * K_FIRST = 0, * K_LAST = sdl2.SDLK_SLEEP, # <<<<<<<<<<<<<< * * K_BREAK = sdl2.SDLK_PAUSE, */ __pyx_t_1 = __Pyx_PyInt_From_int(SDLK_SLEEP); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 103, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_K_LAST, __pyx_t_1) < 0) __PYX_ERR(0, 75, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "pygame_sdl2/locals.pyx":105 * K_LAST = sdl2.SDLK_SLEEP, * * K_BREAK = sdl2.SDLK_PAUSE, # <<<<<<<<<<<<<< * K_EURO = sdl2.SDLK_CURRENCYUNIT, * */ __pyx_t_1 = __Pyx_PyInt_From_int(SDLK_PAUSE); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 105, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_K_BREAK, __pyx_t_1) < 0) __PYX_ERR(0, 75, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "pygame_sdl2/locals.pyx":106 * * K_BREAK = sdl2.SDLK_PAUSE, * K_EURO = sdl2.SDLK_CURRENCYUNIT, # <<<<<<<<<<<<<< * * K_KP0 = sdl2.SDLK_KP_0, */ __pyx_t_1 = __Pyx_PyInt_From_int(SDLK_CURRENCYUNIT); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 106, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_K_EURO, __pyx_t_1) < 0) __PYX_ERR(0, 75, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "pygame_sdl2/locals.pyx":108 * K_EURO = sdl2.SDLK_CURRENCYUNIT, * * K_KP0 = sdl2.SDLK_KP_0, # <<<<<<<<<<<<<< * K_KP1 = sdl2.SDLK_KP_1, * K_KP2 = sdl2.SDLK_KP_2, */ __pyx_t_1 = __Pyx_PyInt_From_int(SDLK_KP_0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 108, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_K_KP0, __pyx_t_1) < 0) __PYX_ERR(0, 75, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "pygame_sdl2/locals.pyx":109 * * K_KP0 = sdl2.SDLK_KP_0, * K_KP1 = sdl2.SDLK_KP_1, # <<<<<<<<<<<<<< * K_KP2 = sdl2.SDLK_KP_2, * K_KP3 = sdl2.SDLK_KP_3, */ __pyx_t_1 = __Pyx_PyInt_From_int(SDLK_KP_1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 109, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_K_KP1, __pyx_t_1) < 0) __PYX_ERR(0, 75, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "pygame_sdl2/locals.pyx":110 * K_KP0 = sdl2.SDLK_KP_0, * K_KP1 = sdl2.SDLK_KP_1, * K_KP2 = sdl2.SDLK_KP_2, # <<<<<<<<<<<<<< * K_KP3 = sdl2.SDLK_KP_3, * K_KP4 = sdl2.SDLK_KP_4, */ __pyx_t_1 = __Pyx_PyInt_From_int(SDLK_KP_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 110, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_K_KP2, __pyx_t_1) < 0) __PYX_ERR(0, 75, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "pygame_sdl2/locals.pyx":111 * K_KP1 = sdl2.SDLK_KP_1, * K_KP2 = sdl2.SDLK_KP_2, * K_KP3 = sdl2.SDLK_KP_3, # <<<<<<<<<<<<<< * K_KP4 = sdl2.SDLK_KP_4, * K_KP5 = sdl2.SDLK_KP_5, */ __pyx_t_1 = __Pyx_PyInt_From_int(SDLK_KP_3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 111, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_K_KP3, __pyx_t_1) < 0) __PYX_ERR(0, 75, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "pygame_sdl2/locals.pyx":112 * K_KP2 = sdl2.SDLK_KP_2, * K_KP3 = sdl2.SDLK_KP_3, * K_KP4 = sdl2.SDLK_KP_4, # <<<<<<<<<<<<<< * K_KP5 = sdl2.SDLK_KP_5, * K_KP6 = sdl2.SDLK_KP_6, */ __pyx_t_1 = __Pyx_PyInt_From_int(SDLK_KP_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 112, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_K_KP4, __pyx_t_1) < 0) __PYX_ERR(0, 75, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "pygame_sdl2/locals.pyx":113 * K_KP3 = sdl2.SDLK_KP_3, * K_KP4 = sdl2.SDLK_KP_4, * K_KP5 = sdl2.SDLK_KP_5, # <<<<<<<<<<<<<< * K_KP6 = sdl2.SDLK_KP_6, * K_KP7 = sdl2.SDLK_KP_7, */ __pyx_t_1 = __Pyx_PyInt_From_int(SDLK_KP_5); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 113, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_K_KP5, __pyx_t_1) < 0) __PYX_ERR(0, 75, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "pygame_sdl2/locals.pyx":114 * K_KP4 = sdl2.SDLK_KP_4, * K_KP5 = sdl2.SDLK_KP_5, * K_KP6 = sdl2.SDLK_KP_6, # <<<<<<<<<<<<<< * K_KP7 = sdl2.SDLK_KP_7, * K_KP8 = sdl2.SDLK_KP_8, */ __pyx_t_1 = __Pyx_PyInt_From_int(SDLK_KP_6); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 114, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_K_KP6, __pyx_t_1) < 0) __PYX_ERR(0, 75, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "pygame_sdl2/locals.pyx":115 * K_KP5 = sdl2.SDLK_KP_5, * K_KP6 = sdl2.SDLK_KP_6, * K_KP7 = sdl2.SDLK_KP_7, # <<<<<<<<<<<<<< * K_KP8 = sdl2.SDLK_KP_8, * K_KP9 = sdl2.SDLK_KP_9, */ __pyx_t_1 = __Pyx_PyInt_From_int(SDLK_KP_7); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 115, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_K_KP7, __pyx_t_1) < 0) __PYX_ERR(0, 75, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "pygame_sdl2/locals.pyx":116 * K_KP6 = sdl2.SDLK_KP_6, * K_KP7 = sdl2.SDLK_KP_7, * K_KP8 = sdl2.SDLK_KP_8, # <<<<<<<<<<<<<< * K_KP9 = sdl2.SDLK_KP_9, * */ __pyx_t_1 = __Pyx_PyInt_From_int(SDLK_KP_8); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 116, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_K_KP8, __pyx_t_1) < 0) __PYX_ERR(0, 75, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "pygame_sdl2/locals.pyx":117 * K_KP7 = sdl2.SDLK_KP_7, * K_KP8 = sdl2.SDLK_KP_8, * K_KP9 = sdl2.SDLK_KP_9, # <<<<<<<<<<<<<< * * K_LMETA = sdl2.SDLK_LGUI, */ __pyx_t_1 = __Pyx_PyInt_From_int(SDLK_KP_9); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 117, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_K_KP9, __pyx_t_1) < 0) __PYX_ERR(0, 75, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "pygame_sdl2/locals.pyx":119 * K_KP9 = sdl2.SDLK_KP_9, * * K_LMETA = sdl2.SDLK_LGUI, # <<<<<<<<<<<<<< * K_LSUPER = sdl2.SDLK_LGUI, * K_RMETA = sdl2.SDLK_RGUI, */ __pyx_t_1 = __Pyx_PyInt_From_int(SDLK_LGUI); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 119, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_K_LMETA, __pyx_t_1) < 0) __PYX_ERR(0, 75, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "pygame_sdl2/locals.pyx":120 * * K_LMETA = sdl2.SDLK_LGUI, * K_LSUPER = sdl2.SDLK_LGUI, # <<<<<<<<<<<<<< * K_RMETA = sdl2.SDLK_RGUI, * K_RSUPER = sdl2.SDLK_RGUI, */ __pyx_t_1 = __Pyx_PyInt_From_int(SDLK_LGUI); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 120, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_K_LSUPER, __pyx_t_1) < 0) __PYX_ERR(0, 75, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "pygame_sdl2/locals.pyx":121 * K_LMETA = sdl2.SDLK_LGUI, * K_LSUPER = sdl2.SDLK_LGUI, * K_RMETA = sdl2.SDLK_RGUI, # <<<<<<<<<<<<<< * K_RSUPER = sdl2.SDLK_RGUI, * */ __pyx_t_1 = __Pyx_PyInt_From_int(SDLK_RGUI); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 121, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_K_RMETA, __pyx_t_1) < 0) __PYX_ERR(0, 75, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "pygame_sdl2/locals.pyx":122 * K_LSUPER = sdl2.SDLK_LGUI, * K_RMETA = sdl2.SDLK_RGUI, * K_RSUPER = sdl2.SDLK_RGUI, # <<<<<<<<<<<<<< * * K_NUMLOCK = sdl2.SDLK_NUMLOCKCLEAR, */ __pyx_t_1 = __Pyx_PyInt_From_int(SDLK_RGUI); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 122, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_K_RSUPER, __pyx_t_1) < 0) __PYX_ERR(0, 75, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "pygame_sdl2/locals.pyx":124 * K_RSUPER = sdl2.SDLK_RGUI, * * K_NUMLOCK = sdl2.SDLK_NUMLOCKCLEAR, # <<<<<<<<<<<<<< * K_SCROLLOCK = sdl2.SDLK_SCROLLLOCK, * K_PRINT = sdl2.SDLK_PRINTSCREEN, */ __pyx_t_1 = __Pyx_PyInt_From_int(SDLK_NUMLOCKCLEAR); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 124, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_K_NUMLOCK, __pyx_t_1) < 0) __PYX_ERR(0, 75, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "pygame_sdl2/locals.pyx":125 * * K_NUMLOCK = sdl2.SDLK_NUMLOCKCLEAR, * K_SCROLLOCK = sdl2.SDLK_SCROLLLOCK, # <<<<<<<<<<<<<< * K_PRINT = sdl2.SDLK_PRINTSCREEN, * )) */ __pyx_t_1 = __Pyx_PyInt_From_int(SDLK_SCROLLLOCK); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 125, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_K_SCROLLOCK, __pyx_t_1) < 0) __PYX_ERR(0, 75, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "pygame_sdl2/locals.pyx":126 * K_NUMLOCK = sdl2.SDLK_NUMLOCKCLEAR, * K_SCROLLOCK = sdl2.SDLK_SCROLLLOCK, * K_PRINT = sdl2.SDLK_PRINTSCREEN, # <<<<<<<<<<<<<< * )) * */ __pyx_t_1 = __Pyx_PyInt_From_int(SDLK_PRINTSCREEN); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 126, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_K_PRINT, __pyx_t_1) < 0) __PYX_ERR(0, 75, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_1 = NULL; if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_2))) { __pyx_t_1 = PyMethod_GET_SELF(__pyx_t_2); if (likely(__pyx_t_1)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_1); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); } } if (!__pyx_t_1) { __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 74, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_GOTREF(__pyx_t_4); } else { __pyx_t_5 = PyTuple_New(1+1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 74, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_GIVEREF(__pyx_t_1); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_1); __pyx_t_1 = NULL; __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_5, 0+1, __pyx_t_3); __pyx_t_3 = 0; __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_5, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 74, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; } __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; /* "pygame_sdl2/locals.pyx":129 * )) * * TOUCH_MOUSEID = -1 # <<<<<<<<<<<<<< * * include "controller.pxi" */ if (PyDict_SetItem(__pyx_d, __pyx_n_s_TOUCH_MOUSEID, __pyx_int_neg_1) < 0) __PYX_ERR(0, 129, __pyx_L1_error) /* "include/controller.pxi":1 * CONTROLLER_BUTTON_INVALID = SDL_CONTROLLER_BUTTON_INVALID # <<<<<<<<<<<<<< * CONTROLLER_BUTTON_A = SDL_CONTROLLER_BUTTON_A * CONTROLLER_BUTTON_B = SDL_CONTROLLER_BUTTON_B */ __pyx_t_4 = __Pyx_PyInt_From_SDL_GameControllerButton(SDL_CONTROLLER_BUTTON_INVALID); if (unlikely(!__pyx_t_4)) __PYX_ERR(4, 1, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); if (PyDict_SetItem(__pyx_d, __pyx_n_s_CONTROLLER_BUTTON_INVALID, __pyx_t_4) < 0) __PYX_ERR(4, 1, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; /* "include/controller.pxi":2 * CONTROLLER_BUTTON_INVALID = SDL_CONTROLLER_BUTTON_INVALID * CONTROLLER_BUTTON_A = SDL_CONTROLLER_BUTTON_A # <<<<<<<<<<<<<< * CONTROLLER_BUTTON_B = SDL_CONTROLLER_BUTTON_B * CONTROLLER_BUTTON_X = SDL_CONTROLLER_BUTTON_X */ __pyx_t_4 = __Pyx_PyInt_From_SDL_GameControllerButton(SDL_CONTROLLER_BUTTON_A); if (unlikely(!__pyx_t_4)) __PYX_ERR(4, 2, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); if (PyDict_SetItem(__pyx_d, __pyx_n_s_CONTROLLER_BUTTON_A, __pyx_t_4) < 0) __PYX_ERR(4, 2, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; /* "include/controller.pxi":3 * CONTROLLER_BUTTON_INVALID = SDL_CONTROLLER_BUTTON_INVALID * CONTROLLER_BUTTON_A = SDL_CONTROLLER_BUTTON_A * CONTROLLER_BUTTON_B = SDL_CONTROLLER_BUTTON_B # <<<<<<<<<<<<<< * CONTROLLER_BUTTON_X = SDL_CONTROLLER_BUTTON_X * CONTROLLER_BUTTON_Y = SDL_CONTROLLER_BUTTON_Y */ __pyx_t_4 = __Pyx_PyInt_From_SDL_GameControllerButton(SDL_CONTROLLER_BUTTON_B); if (unlikely(!__pyx_t_4)) __PYX_ERR(4, 3, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); if (PyDict_SetItem(__pyx_d, __pyx_n_s_CONTROLLER_BUTTON_B, __pyx_t_4) < 0) __PYX_ERR(4, 3, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; /* "include/controller.pxi":4 * CONTROLLER_BUTTON_A = SDL_CONTROLLER_BUTTON_A * CONTROLLER_BUTTON_B = SDL_CONTROLLER_BUTTON_B * CONTROLLER_BUTTON_X = SDL_CONTROLLER_BUTTON_X # <<<<<<<<<<<<<< * CONTROLLER_BUTTON_Y = SDL_CONTROLLER_BUTTON_Y * CONTROLLER_BUTTON_BACK = SDL_CONTROLLER_BUTTON_BACK */ __pyx_t_4 = __Pyx_PyInt_From_SDL_GameControllerButton(SDL_CONTROLLER_BUTTON_X); if (unlikely(!__pyx_t_4)) __PYX_ERR(4, 4, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); if (PyDict_SetItem(__pyx_d, __pyx_n_s_CONTROLLER_BUTTON_X, __pyx_t_4) < 0) __PYX_ERR(4, 4, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; /* "include/controller.pxi":5 * CONTROLLER_BUTTON_B = SDL_CONTROLLER_BUTTON_B * CONTROLLER_BUTTON_X = SDL_CONTROLLER_BUTTON_X * CONTROLLER_BUTTON_Y = SDL_CONTROLLER_BUTTON_Y # <<<<<<<<<<<<<< * CONTROLLER_BUTTON_BACK = SDL_CONTROLLER_BUTTON_BACK * CONTROLLER_BUTTON_GUIDE = SDL_CONTROLLER_BUTTON_GUIDE */ __pyx_t_4 = __Pyx_PyInt_From_SDL_GameControllerButton(SDL_CONTROLLER_BUTTON_Y); if (unlikely(!__pyx_t_4)) __PYX_ERR(4, 5, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); if (PyDict_SetItem(__pyx_d, __pyx_n_s_CONTROLLER_BUTTON_Y, __pyx_t_4) < 0) __PYX_ERR(4, 5, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; /* "include/controller.pxi":6 * CONTROLLER_BUTTON_X = SDL_CONTROLLER_BUTTON_X * CONTROLLER_BUTTON_Y = SDL_CONTROLLER_BUTTON_Y * CONTROLLER_BUTTON_BACK = SDL_CONTROLLER_BUTTON_BACK # <<<<<<<<<<<<<< * CONTROLLER_BUTTON_GUIDE = SDL_CONTROLLER_BUTTON_GUIDE * CONTROLLER_BUTTON_START = SDL_CONTROLLER_BUTTON_START */ __pyx_t_4 = __Pyx_PyInt_From_SDL_GameControllerButton(SDL_CONTROLLER_BUTTON_BACK); if (unlikely(!__pyx_t_4)) __PYX_ERR(4, 6, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); if (PyDict_SetItem(__pyx_d, __pyx_n_s_CONTROLLER_BUTTON_BACK, __pyx_t_4) < 0) __PYX_ERR(4, 6, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; /* "include/controller.pxi":7 * CONTROLLER_BUTTON_Y = SDL_CONTROLLER_BUTTON_Y * CONTROLLER_BUTTON_BACK = SDL_CONTROLLER_BUTTON_BACK * CONTROLLER_BUTTON_GUIDE = SDL_CONTROLLER_BUTTON_GUIDE # <<<<<<<<<<<<<< * CONTROLLER_BUTTON_START = SDL_CONTROLLER_BUTTON_START * CONTROLLER_BUTTON_LEFTSTICK = SDL_CONTROLLER_BUTTON_LEFTSTICK */ __pyx_t_4 = __Pyx_PyInt_From_SDL_GameControllerButton(SDL_CONTROLLER_BUTTON_GUIDE); if (unlikely(!__pyx_t_4)) __PYX_ERR(4, 7, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); if (PyDict_SetItem(__pyx_d, __pyx_n_s_CONTROLLER_BUTTON_GUIDE, __pyx_t_4) < 0) __PYX_ERR(4, 7, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; /* "include/controller.pxi":8 * CONTROLLER_BUTTON_BACK = SDL_CONTROLLER_BUTTON_BACK * CONTROLLER_BUTTON_GUIDE = SDL_CONTROLLER_BUTTON_GUIDE * CONTROLLER_BUTTON_START = SDL_CONTROLLER_BUTTON_START # <<<<<<<<<<<<<< * CONTROLLER_BUTTON_LEFTSTICK = SDL_CONTROLLER_BUTTON_LEFTSTICK * CONTROLLER_BUTTON_RIGHTSTICK = SDL_CONTROLLER_BUTTON_RIGHTSTICK */ __pyx_t_4 = __Pyx_PyInt_From_SDL_GameControllerButton(SDL_CONTROLLER_BUTTON_START); if (unlikely(!__pyx_t_4)) __PYX_ERR(4, 8, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); if (PyDict_SetItem(__pyx_d, __pyx_n_s_CONTROLLER_BUTTON_START, __pyx_t_4) < 0) __PYX_ERR(4, 8, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; /* "include/controller.pxi":9 * CONTROLLER_BUTTON_GUIDE = SDL_CONTROLLER_BUTTON_GUIDE * CONTROLLER_BUTTON_START = SDL_CONTROLLER_BUTTON_START * CONTROLLER_BUTTON_LEFTSTICK = SDL_CONTROLLER_BUTTON_LEFTSTICK # <<<<<<<<<<<<<< * CONTROLLER_BUTTON_RIGHTSTICK = SDL_CONTROLLER_BUTTON_RIGHTSTICK * CONTROLLER_BUTTON_LEFTSHOULDER = SDL_CONTROLLER_BUTTON_LEFTSHOULDER */ __pyx_t_4 = __Pyx_PyInt_From_SDL_GameControllerButton(SDL_CONTROLLER_BUTTON_LEFTSTICK); if (unlikely(!__pyx_t_4)) __PYX_ERR(4, 9, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); if (PyDict_SetItem(__pyx_d, __pyx_n_s_CONTROLLER_BUTTON_LEFTSTICK, __pyx_t_4) < 0) __PYX_ERR(4, 9, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; /* "include/controller.pxi":10 * CONTROLLER_BUTTON_START = SDL_CONTROLLER_BUTTON_START * CONTROLLER_BUTTON_LEFTSTICK = SDL_CONTROLLER_BUTTON_LEFTSTICK * CONTROLLER_BUTTON_RIGHTSTICK = SDL_CONTROLLER_BUTTON_RIGHTSTICK # <<<<<<<<<<<<<< * CONTROLLER_BUTTON_LEFTSHOULDER = SDL_CONTROLLER_BUTTON_LEFTSHOULDER * CONTROLLER_BUTTON_RIGHTSHOULDER = SDL_CONTROLLER_BUTTON_RIGHTSHOULDER */ __pyx_t_4 = __Pyx_PyInt_From_SDL_GameControllerButton(SDL_CONTROLLER_BUTTON_RIGHTSTICK); if (unlikely(!__pyx_t_4)) __PYX_ERR(4, 10, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); if (PyDict_SetItem(__pyx_d, __pyx_n_s_CONTROLLER_BUTTON_RIGHTSTICK, __pyx_t_4) < 0) __PYX_ERR(4, 10, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; /* "include/controller.pxi":11 * CONTROLLER_BUTTON_LEFTSTICK = SDL_CONTROLLER_BUTTON_LEFTSTICK * CONTROLLER_BUTTON_RIGHTSTICK = SDL_CONTROLLER_BUTTON_RIGHTSTICK * CONTROLLER_BUTTON_LEFTSHOULDER = SDL_CONTROLLER_BUTTON_LEFTSHOULDER # <<<<<<<<<<<<<< * CONTROLLER_BUTTON_RIGHTSHOULDER = SDL_CONTROLLER_BUTTON_RIGHTSHOULDER * CONTROLLER_BUTTON_DPAD_UP = SDL_CONTROLLER_BUTTON_DPAD_UP */ __pyx_t_4 = __Pyx_PyInt_From_SDL_GameControllerButton(SDL_CONTROLLER_BUTTON_LEFTSHOULDER); if (unlikely(!__pyx_t_4)) __PYX_ERR(4, 11, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); if (PyDict_SetItem(__pyx_d, __pyx_n_s_CONTROLLER_BUTTON_LEFTSHOULDER, __pyx_t_4) < 0) __PYX_ERR(4, 11, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; /* "include/controller.pxi":12 * CONTROLLER_BUTTON_RIGHTSTICK = SDL_CONTROLLER_BUTTON_RIGHTSTICK * CONTROLLER_BUTTON_LEFTSHOULDER = SDL_CONTROLLER_BUTTON_LEFTSHOULDER * CONTROLLER_BUTTON_RIGHTSHOULDER = SDL_CONTROLLER_BUTTON_RIGHTSHOULDER # <<<<<<<<<<<<<< * CONTROLLER_BUTTON_DPAD_UP = SDL_CONTROLLER_BUTTON_DPAD_UP * CONTROLLER_BUTTON_DPAD_DOWN = SDL_CONTROLLER_BUTTON_DPAD_DOWN */ __pyx_t_4 = __Pyx_PyInt_From_SDL_GameControllerButton(SDL_CONTROLLER_BUTTON_RIGHTSHOULDER); if (unlikely(!__pyx_t_4)) __PYX_ERR(4, 12, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); if (PyDict_SetItem(__pyx_d, __pyx_n_s_CONTROLLER_BUTTON_RIGHTSHOULDER, __pyx_t_4) < 0) __PYX_ERR(4, 12, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; /* "include/controller.pxi":13 * CONTROLLER_BUTTON_LEFTSHOULDER = SDL_CONTROLLER_BUTTON_LEFTSHOULDER * CONTROLLER_BUTTON_RIGHTSHOULDER = SDL_CONTROLLER_BUTTON_RIGHTSHOULDER * CONTROLLER_BUTTON_DPAD_UP = SDL_CONTROLLER_BUTTON_DPAD_UP # <<<<<<<<<<<<<< * CONTROLLER_BUTTON_DPAD_DOWN = SDL_CONTROLLER_BUTTON_DPAD_DOWN * CONTROLLER_BUTTON_DPAD_LEFT = SDL_CONTROLLER_BUTTON_DPAD_LEFT */ __pyx_t_4 = __Pyx_PyInt_From_SDL_GameControllerButton(SDL_CONTROLLER_BUTTON_DPAD_UP); if (unlikely(!__pyx_t_4)) __PYX_ERR(4, 13, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); if (PyDict_SetItem(__pyx_d, __pyx_n_s_CONTROLLER_BUTTON_DPAD_UP, __pyx_t_4) < 0) __PYX_ERR(4, 13, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; /* "include/controller.pxi":14 * CONTROLLER_BUTTON_RIGHTSHOULDER = SDL_CONTROLLER_BUTTON_RIGHTSHOULDER * CONTROLLER_BUTTON_DPAD_UP = SDL_CONTROLLER_BUTTON_DPAD_UP * CONTROLLER_BUTTON_DPAD_DOWN = SDL_CONTROLLER_BUTTON_DPAD_DOWN # <<<<<<<<<<<<<< * CONTROLLER_BUTTON_DPAD_LEFT = SDL_CONTROLLER_BUTTON_DPAD_LEFT * CONTROLLER_BUTTON_DPAD_RIGHT = SDL_CONTROLLER_BUTTON_DPAD_RIGHT */ __pyx_t_4 = __Pyx_PyInt_From_SDL_GameControllerButton(SDL_CONTROLLER_BUTTON_DPAD_DOWN); if (unlikely(!__pyx_t_4)) __PYX_ERR(4, 14, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); if (PyDict_SetItem(__pyx_d, __pyx_n_s_CONTROLLER_BUTTON_DPAD_DOWN, __pyx_t_4) < 0) __PYX_ERR(4, 14, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; /* "include/controller.pxi":15 * CONTROLLER_BUTTON_DPAD_UP = SDL_CONTROLLER_BUTTON_DPAD_UP * CONTROLLER_BUTTON_DPAD_DOWN = SDL_CONTROLLER_BUTTON_DPAD_DOWN * CONTROLLER_BUTTON_DPAD_LEFT = SDL_CONTROLLER_BUTTON_DPAD_LEFT # <<<<<<<<<<<<<< * CONTROLLER_BUTTON_DPAD_RIGHT = SDL_CONTROLLER_BUTTON_DPAD_RIGHT * CONTROLLER_BUTTON_MAX = SDL_CONTROLLER_BUTTON_MAX */ __pyx_t_4 = __Pyx_PyInt_From_SDL_GameControllerButton(SDL_CONTROLLER_BUTTON_DPAD_LEFT); if (unlikely(!__pyx_t_4)) __PYX_ERR(4, 15, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); if (PyDict_SetItem(__pyx_d, __pyx_n_s_CONTROLLER_BUTTON_DPAD_LEFT, __pyx_t_4) < 0) __PYX_ERR(4, 15, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; /* "include/controller.pxi":16 * CONTROLLER_BUTTON_DPAD_DOWN = SDL_CONTROLLER_BUTTON_DPAD_DOWN * CONTROLLER_BUTTON_DPAD_LEFT = SDL_CONTROLLER_BUTTON_DPAD_LEFT * CONTROLLER_BUTTON_DPAD_RIGHT = SDL_CONTROLLER_BUTTON_DPAD_RIGHT # <<<<<<<<<<<<<< * CONTROLLER_BUTTON_MAX = SDL_CONTROLLER_BUTTON_MAX * CONTROLLER_AXIS_INVALID = SDL_CONTROLLER_AXIS_INVALID */ __pyx_t_4 = __Pyx_PyInt_From_SDL_GameControllerButton(SDL_CONTROLLER_BUTTON_DPAD_RIGHT); if (unlikely(!__pyx_t_4)) __PYX_ERR(4, 16, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); if (PyDict_SetItem(__pyx_d, __pyx_n_s_CONTROLLER_BUTTON_DPAD_RIGHT, __pyx_t_4) < 0) __PYX_ERR(4, 16, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; /* "include/controller.pxi":17 * CONTROLLER_BUTTON_DPAD_LEFT = SDL_CONTROLLER_BUTTON_DPAD_LEFT * CONTROLLER_BUTTON_DPAD_RIGHT = SDL_CONTROLLER_BUTTON_DPAD_RIGHT * CONTROLLER_BUTTON_MAX = SDL_CONTROLLER_BUTTON_MAX # <<<<<<<<<<<<<< * CONTROLLER_AXIS_INVALID = SDL_CONTROLLER_AXIS_INVALID * CONTROLLER_AXIS_LEFTX = SDL_CONTROLLER_AXIS_LEFTX */ __pyx_t_4 = __Pyx_PyInt_From_SDL_GameControllerButton(SDL_CONTROLLER_BUTTON_MAX); if (unlikely(!__pyx_t_4)) __PYX_ERR(4, 17, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); if (PyDict_SetItem(__pyx_d, __pyx_n_s_CONTROLLER_BUTTON_MAX, __pyx_t_4) < 0) __PYX_ERR(4, 17, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; /* "include/controller.pxi":18 * CONTROLLER_BUTTON_DPAD_RIGHT = SDL_CONTROLLER_BUTTON_DPAD_RIGHT * CONTROLLER_BUTTON_MAX = SDL_CONTROLLER_BUTTON_MAX * CONTROLLER_AXIS_INVALID = SDL_CONTROLLER_AXIS_INVALID # <<<<<<<<<<<<<< * CONTROLLER_AXIS_LEFTX = SDL_CONTROLLER_AXIS_LEFTX * CONTROLLER_AXIS_LEFTY = SDL_CONTROLLER_AXIS_LEFTY */ __pyx_t_4 = __Pyx_PyInt_From_SDL_GameControllerAxis(SDL_CONTROLLER_AXIS_INVALID); if (unlikely(!__pyx_t_4)) __PYX_ERR(4, 18, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); if (PyDict_SetItem(__pyx_d, __pyx_n_s_CONTROLLER_AXIS_INVALID, __pyx_t_4) < 0) __PYX_ERR(4, 18, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; /* "include/controller.pxi":19 * CONTROLLER_BUTTON_MAX = SDL_CONTROLLER_BUTTON_MAX * CONTROLLER_AXIS_INVALID = SDL_CONTROLLER_AXIS_INVALID * CONTROLLER_AXIS_LEFTX = SDL_CONTROLLER_AXIS_LEFTX # <<<<<<<<<<<<<< * CONTROLLER_AXIS_LEFTY = SDL_CONTROLLER_AXIS_LEFTY * CONTROLLER_AXIS_RIGHTX = SDL_CONTROLLER_AXIS_RIGHTX */ __pyx_t_4 = __Pyx_PyInt_From_SDL_GameControllerAxis(SDL_CONTROLLER_AXIS_LEFTX); if (unlikely(!__pyx_t_4)) __PYX_ERR(4, 19, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); if (PyDict_SetItem(__pyx_d, __pyx_n_s_CONTROLLER_AXIS_LEFTX, __pyx_t_4) < 0) __PYX_ERR(4, 19, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; /* "include/controller.pxi":20 * CONTROLLER_AXIS_INVALID = SDL_CONTROLLER_AXIS_INVALID * CONTROLLER_AXIS_LEFTX = SDL_CONTROLLER_AXIS_LEFTX * CONTROLLER_AXIS_LEFTY = SDL_CONTROLLER_AXIS_LEFTY # <<<<<<<<<<<<<< * CONTROLLER_AXIS_RIGHTX = SDL_CONTROLLER_AXIS_RIGHTX * CONTROLLER_AXIS_RIGHTY = SDL_CONTROLLER_AXIS_RIGHTY */ __pyx_t_4 = __Pyx_PyInt_From_SDL_GameControllerAxis(SDL_CONTROLLER_AXIS_LEFTY); if (unlikely(!__pyx_t_4)) __PYX_ERR(4, 20, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); if (PyDict_SetItem(__pyx_d, __pyx_n_s_CONTROLLER_AXIS_LEFTY, __pyx_t_4) < 0) __PYX_ERR(4, 20, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; /* "include/controller.pxi":21 * CONTROLLER_AXIS_LEFTX = SDL_CONTROLLER_AXIS_LEFTX * CONTROLLER_AXIS_LEFTY = SDL_CONTROLLER_AXIS_LEFTY * CONTROLLER_AXIS_RIGHTX = SDL_CONTROLLER_AXIS_RIGHTX # <<<<<<<<<<<<<< * CONTROLLER_AXIS_RIGHTY = SDL_CONTROLLER_AXIS_RIGHTY * CONTROLLER_AXIS_TRIGGERLEFT = SDL_CONTROLLER_AXIS_TRIGGERLEFT */ __pyx_t_4 = __Pyx_PyInt_From_SDL_GameControllerAxis(SDL_CONTROLLER_AXIS_RIGHTX); if (unlikely(!__pyx_t_4)) __PYX_ERR(4, 21, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); if (PyDict_SetItem(__pyx_d, __pyx_n_s_CONTROLLER_AXIS_RIGHTX, __pyx_t_4) < 0) __PYX_ERR(4, 21, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; /* "include/controller.pxi":22 * CONTROLLER_AXIS_LEFTY = SDL_CONTROLLER_AXIS_LEFTY * CONTROLLER_AXIS_RIGHTX = SDL_CONTROLLER_AXIS_RIGHTX * CONTROLLER_AXIS_RIGHTY = SDL_CONTROLLER_AXIS_RIGHTY # <<<<<<<<<<<<<< * CONTROLLER_AXIS_TRIGGERLEFT = SDL_CONTROLLER_AXIS_TRIGGERLEFT * CONTROLLER_AXIS_TRIGGERRIGHT = SDL_CONTROLLER_AXIS_TRIGGERRIGHT */ __pyx_t_4 = __Pyx_PyInt_From_SDL_GameControllerAxis(SDL_CONTROLLER_AXIS_RIGHTY); if (unlikely(!__pyx_t_4)) __PYX_ERR(4, 22, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); if (PyDict_SetItem(__pyx_d, __pyx_n_s_CONTROLLER_AXIS_RIGHTY, __pyx_t_4) < 0) __PYX_ERR(4, 22, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; /* "include/controller.pxi":23 * CONTROLLER_AXIS_RIGHTX = SDL_CONTROLLER_AXIS_RIGHTX * CONTROLLER_AXIS_RIGHTY = SDL_CONTROLLER_AXIS_RIGHTY * CONTROLLER_AXIS_TRIGGERLEFT = SDL_CONTROLLER_AXIS_TRIGGERLEFT # <<<<<<<<<<<<<< * CONTROLLER_AXIS_TRIGGERRIGHT = SDL_CONTROLLER_AXIS_TRIGGERRIGHT * CONTROLLER_AXIS_MAX = SDL_CONTROLLER_AXIS_MAX */ __pyx_t_4 = __Pyx_PyInt_From_SDL_GameControllerAxis(SDL_CONTROLLER_AXIS_TRIGGERLEFT); if (unlikely(!__pyx_t_4)) __PYX_ERR(4, 23, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); if (PyDict_SetItem(__pyx_d, __pyx_n_s_CONTROLLER_AXIS_TRIGGERLEFT, __pyx_t_4) < 0) __PYX_ERR(4, 23, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; /* "include/controller.pxi":24 * CONTROLLER_AXIS_RIGHTY = SDL_CONTROLLER_AXIS_RIGHTY * CONTROLLER_AXIS_TRIGGERLEFT = SDL_CONTROLLER_AXIS_TRIGGERLEFT * CONTROLLER_AXIS_TRIGGERRIGHT = SDL_CONTROLLER_AXIS_TRIGGERRIGHT # <<<<<<<<<<<<<< * CONTROLLER_AXIS_MAX = SDL_CONTROLLER_AXIS_MAX */ __pyx_t_4 = __Pyx_PyInt_From_SDL_GameControllerAxis(SDL_CONTROLLER_AXIS_TRIGGERRIGHT); if (unlikely(!__pyx_t_4)) __PYX_ERR(4, 24, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); if (PyDict_SetItem(__pyx_d, __pyx_n_s_CONTROLLER_AXIS_TRIGGERRIGHT, __pyx_t_4) < 0) __PYX_ERR(4, 24, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; /* "include/controller.pxi":25 * CONTROLLER_AXIS_TRIGGERLEFT = SDL_CONTROLLER_AXIS_TRIGGERLEFT * CONTROLLER_AXIS_TRIGGERRIGHT = SDL_CONTROLLER_AXIS_TRIGGERRIGHT * CONTROLLER_AXIS_MAX = SDL_CONTROLLER_AXIS_MAX # <<<<<<<<<<<<<< */ __pyx_t_4 = __Pyx_PyInt_From_SDL_GameControllerAxis(SDL_CONTROLLER_AXIS_MAX); if (unlikely(!__pyx_t_4)) __PYX_ERR(4, 25, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); if (PyDict_SetItem(__pyx_d, __pyx_n_s_CONTROLLER_AXIS_MAX, __pyx_t_4) < 0) __PYX_ERR(4, 25, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; /* "pygame_sdl2/locals.pyx":133 * include "controller.pxi" * * POWERSTATE_UNKNOWN = SDL_POWERSTATE_UNKNOWN # <<<<<<<<<<<<<< * POWERSTATE_ON_BATTERY = SDL_POWERSTATE_ON_BATTERY * POWERSTATE_NO_BATTERY = SDL_POWERSTATE_NO_BATTERY */ __pyx_t_4 = __Pyx_PyInt_From_SDL_PowerState(SDL_POWERSTATE_UNKNOWN); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 133, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); if (PyDict_SetItem(__pyx_d, __pyx_n_s_POWERSTATE_UNKNOWN, __pyx_t_4) < 0) __PYX_ERR(0, 133, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; /* "pygame_sdl2/locals.pyx":134 * * POWERSTATE_UNKNOWN = SDL_POWERSTATE_UNKNOWN * POWERSTATE_ON_BATTERY = SDL_POWERSTATE_ON_BATTERY # <<<<<<<<<<<<<< * POWERSTATE_NO_BATTERY = SDL_POWERSTATE_NO_BATTERY * POWERSTATE_CHARGING = SDL_POWERSTATE_CHARGING */ __pyx_t_4 = __Pyx_PyInt_From_SDL_PowerState(SDL_POWERSTATE_ON_BATTERY); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 134, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); if (PyDict_SetItem(__pyx_d, __pyx_n_s_POWERSTATE_ON_BATTERY, __pyx_t_4) < 0) __PYX_ERR(0, 134, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; /* "pygame_sdl2/locals.pyx":135 * POWERSTATE_UNKNOWN = SDL_POWERSTATE_UNKNOWN * POWERSTATE_ON_BATTERY = SDL_POWERSTATE_ON_BATTERY * POWERSTATE_NO_BATTERY = SDL_POWERSTATE_NO_BATTERY # <<<<<<<<<<<<<< * POWERSTATE_CHARGING = SDL_POWERSTATE_CHARGING * POWERSTATE_CHARGED = SDL_POWERSTATE_CHARGED */ __pyx_t_4 = __Pyx_PyInt_From_SDL_PowerState(SDL_POWERSTATE_NO_BATTERY); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 135, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); if (PyDict_SetItem(__pyx_d, __pyx_n_s_POWERSTATE_NO_BATTERY, __pyx_t_4) < 0) __PYX_ERR(0, 135, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; /* "pygame_sdl2/locals.pyx":136 * POWERSTATE_ON_BATTERY = SDL_POWERSTATE_ON_BATTERY * POWERSTATE_NO_BATTERY = SDL_POWERSTATE_NO_BATTERY * POWERSTATE_CHARGING = SDL_POWERSTATE_CHARGING # <<<<<<<<<<<<<< * POWERSTATE_CHARGED = SDL_POWERSTATE_CHARGED * */ __pyx_t_4 = __Pyx_PyInt_From_SDL_PowerState(SDL_POWERSTATE_CHARGING); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 136, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); if (PyDict_SetItem(__pyx_d, __pyx_n_s_POWERSTATE_CHARGING, __pyx_t_4) < 0) __PYX_ERR(0, 136, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; /* "pygame_sdl2/locals.pyx":137 * POWERSTATE_NO_BATTERY = SDL_POWERSTATE_NO_BATTERY * POWERSTATE_CHARGING = SDL_POWERSTATE_CHARGING * POWERSTATE_CHARGED = SDL_POWERSTATE_CHARGED # <<<<<<<<<<<<<< * */ __pyx_t_4 = __Pyx_PyInt_From_SDL_PowerState(SDL_POWERSTATE_CHARGED); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 137, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); if (PyDict_SetItem(__pyx_d, __pyx_n_s_POWERSTATE_CHARGED, __pyx_t_4) < 0) __PYX_ERR(0, 137, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; /* "pygame_sdl2/locals.pyx":1 * from sdl2 cimport * # <<<<<<<<<<<<<< * cimport sdl2 * */ __pyx_t_4 = PyDict_New(); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); if (PyDict_SetItem(__pyx_d, __pyx_n_s_test, __pyx_t_4) < 0) __PYX_ERR(0, 1, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; /*--- Wrapped vars code ---*/ goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_5); if (__pyx_m) { if (__pyx_d) { __Pyx_AddTraceback("init pygame_sdl2.locals", __pyx_clineno, __pyx_lineno, __pyx_filename); } Py_DECREF(__pyx_m); __pyx_m = 0; } else if (!PyErr_Occurred()) { PyErr_SetString(PyExc_ImportError, "init pygame_sdl2.locals"); } __pyx_L0:; __Pyx_RefNannyFinishContext(); #if PY_MAJOR_VERSION < 3 return; #else return __pyx_m; #endif } /* --- Runtime support code --- */ /* Refnanny */ #if CYTHON_REFNANNY static __Pyx_RefNannyAPIStruct *__Pyx_RefNannyImportAPI(const char *modname) { PyObject *m = NULL, *p = NULL; void *r = NULL; m = PyImport_ImportModule((char *)modname); if (!m) goto end; p = PyObject_GetAttrString(m, (char *)"RefNannyAPI"); if (!p) goto end; r = PyLong_AsVoidPtr(p); end: Py_XDECREF(p); Py_XDECREF(m); return (__Pyx_RefNannyAPIStruct *)r; } #endif /* Import */ static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list, int level) { PyObject *empty_list = 0; PyObject *module = 0; PyObject *global_dict = 0; PyObject *empty_dict = 0; PyObject *list; #if PY_VERSION_HEX < 0x03030000 PyObject *py_import; py_import = __Pyx_PyObject_GetAttrStr(__pyx_b, __pyx_n_s_import); if (!py_import) goto bad; #endif if (from_list) list = from_list; else { empty_list = PyList_New(0); if (!empty_list) goto bad; list = empty_list; } global_dict = PyModule_GetDict(__pyx_m); if (!global_dict) goto bad; empty_dict = PyDict_New(); if (!empty_dict) goto bad; { #if PY_MAJOR_VERSION >= 3 if (level == -1) { if (strchr(__Pyx_MODULE_NAME, '.')) { #if PY_VERSION_HEX < 0x03030000 PyObject *py_level = PyInt_FromLong(1); if (!py_level) goto bad; module = PyObject_CallFunctionObjArgs(py_import, name, global_dict, empty_dict, list, py_level, NULL); Py_DECREF(py_level); #else module = PyImport_ImportModuleLevelObject( name, global_dict, empty_dict, list, 1); #endif if (!module) { if (!PyErr_ExceptionMatches(PyExc_ImportError)) goto bad; PyErr_Clear(); } } level = 0; } #endif if (!module) { #if PY_VERSION_HEX < 0x03030000 PyObject *py_level = PyInt_FromLong(level); if (!py_level) goto bad; module = PyObject_CallFunctionObjArgs(py_import, name, global_dict, empty_dict, list, py_level, NULL); Py_DECREF(py_level); #else module = PyImport_ImportModuleLevelObject( name, global_dict, empty_dict, list, level); #endif } } bad: #if PY_VERSION_HEX < 0x03030000 Py_XDECREF(py_import); #endif Py_XDECREF(empty_list); Py_XDECREF(empty_dict); return module; } /* ImportFrom */ static PyObject* __Pyx_ImportFrom(PyObject* module, PyObject* name) { PyObject* value = __Pyx_PyObject_GetAttrStr(module, name); if (unlikely(!value) && PyErr_ExceptionMatches(PyExc_AttributeError)) { PyErr_Format(PyExc_ImportError, #if PY_MAJOR_VERSION < 3 "cannot import name %.230s", PyString_AS_STRING(name)); #else "cannot import name %S", name); #endif } return value; } /* GetAttr */ static CYTHON_INLINE PyObject *__Pyx_GetAttr(PyObject *o, PyObject *n) { #if CYTHON_COMPILING_IN_CPYTHON #if PY_MAJOR_VERSION >= 3 if (likely(PyUnicode_Check(n))) #else if (likely(PyString_Check(n))) #endif return __Pyx_PyObject_GetAttrStr(o, n); #endif return PyObject_GetAttr(o, n); } /* Globals */ static PyObject* __Pyx_Globals(void) { Py_ssize_t i; PyObject *names; PyObject *globals = __pyx_d; Py_INCREF(globals); names = PyObject_Dir(__pyx_m); if (!names) goto bad; for (i = PyList_GET_SIZE(names)-1; i >= 0; i--) { #if CYTHON_COMPILING_IN_PYPY PyObject* name = PySequence_ITEM(names, i); if (!name) goto bad; #else PyObject* name = PyList_GET_ITEM(names, i); #endif if (!PyDict_Contains(globals, name)) { PyObject* value = __Pyx_GetAttr(__pyx_m, name); if (!value) { #if CYTHON_COMPILING_IN_PYPY Py_DECREF(name); #endif goto bad; } if (PyDict_SetItem(globals, name, value) < 0) { #if CYTHON_COMPILING_IN_PYPY Py_DECREF(name); #endif Py_DECREF(value); goto bad; } } #if CYTHON_COMPILING_IN_PYPY Py_DECREF(name); #endif } Py_DECREF(names); return globals; bad: Py_XDECREF(names); Py_XDECREF(globals); return NULL; } /* PyObjectCall */ #if CYTHON_COMPILING_IN_CPYTHON static CYTHON_INLINE PyObject* __Pyx_PyObject_Call(PyObject *func, PyObject *arg, PyObject *kw) { PyObject *result; ternaryfunc call = func->ob_type->tp_call; if (unlikely(!call)) return PyObject_Call(func, arg, kw); if (unlikely(Py_EnterRecursiveCall((char*)" while calling a Python object"))) return NULL; result = (*call)(func, arg, kw); Py_LeaveRecursiveCall(); if (unlikely(!result) && unlikely(!PyErr_Occurred())) { PyErr_SetString( PyExc_SystemError, "NULL result without error in PyObject_Call"); } return result; } #endif /* PyObjectCallMethO */ #if CYTHON_COMPILING_IN_CPYTHON static CYTHON_INLINE PyObject* __Pyx_PyObject_CallMethO(PyObject *func, PyObject *arg) { PyObject *self, *result; PyCFunction cfunc; cfunc = PyCFunction_GET_FUNCTION(func); self = PyCFunction_GET_SELF(func); if (unlikely(Py_EnterRecursiveCall((char*)" while calling a Python object"))) return NULL; result = cfunc(self, arg); Py_LeaveRecursiveCall(); if (unlikely(!result) && unlikely(!PyErr_Occurred())) { PyErr_SetString( PyExc_SystemError, "NULL result without error in PyObject_Call"); } return result; } #endif /* PyObjectCallOneArg */ #if CYTHON_COMPILING_IN_CPYTHON static PyObject* __Pyx__PyObject_CallOneArg(PyObject *func, PyObject *arg) { PyObject *result; PyObject *args = PyTuple_New(1); if (unlikely(!args)) return NULL; Py_INCREF(arg); PyTuple_SET_ITEM(args, 0, arg); result = __Pyx_PyObject_Call(func, args, NULL); Py_DECREF(args); return result; } static CYTHON_INLINE PyObject* __Pyx_PyObject_CallOneArg(PyObject *func, PyObject *arg) { #ifdef __Pyx_CyFunction_USED if (likely(PyCFunction_Check(func) || PyObject_TypeCheck(func, __pyx_CyFunctionType))) { #else if (likely(PyCFunction_Check(func))) { #endif if (likely(PyCFunction_GET_FLAGS(func) & METH_O)) { return __Pyx_PyObject_CallMethO(func, arg); } } return __Pyx__PyObject_CallOneArg(func, arg); } #else static CYTHON_INLINE PyObject* __Pyx_PyObject_CallOneArg(PyObject *func, PyObject *arg) { PyObject *result; PyObject *args = PyTuple_Pack(1, arg); if (unlikely(!args)) return NULL; result = __Pyx_PyObject_Call(func, args, NULL); Py_DECREF(args); return result; } #endif /* CodeObjectCache */ static int __pyx_bisect_code_objects(__Pyx_CodeObjectCacheEntry* entries, int count, int code_line) { int start = 0, mid = 0, end = count - 1; if (end >= 0 && code_line > entries[end].code_line) { return count; } while (start < end) { mid = start + (end - start) / 2; if (code_line < entries[mid].code_line) { end = mid; } else if (code_line > entries[mid].code_line) { start = mid + 1; } else { return mid; } } if (code_line <= entries[mid].code_line) { return mid; } else { return mid + 1; } } static PyCodeObject *__pyx_find_code_object(int code_line) { PyCodeObject* code_object; int pos; if (unlikely(!code_line) || unlikely(!__pyx_code_cache.entries)) { return NULL; } pos = __pyx_bisect_code_objects(__pyx_code_cache.entries, __pyx_code_cache.count, code_line); if (unlikely(pos >= __pyx_code_cache.count) || unlikely(__pyx_code_cache.entries[pos].code_line != code_line)) { return NULL; } code_object = __pyx_code_cache.entries[pos].code_object; Py_INCREF(code_object); return code_object; } static void __pyx_insert_code_object(int code_line, PyCodeObject* code_object) { int pos, i; __Pyx_CodeObjectCacheEntry* entries = __pyx_code_cache.entries; if (unlikely(!code_line)) { return; } if (unlikely(!entries)) { entries = (__Pyx_CodeObjectCacheEntry*)PyMem_Malloc(64*sizeof(__Pyx_CodeObjectCacheEntry)); if (likely(entries)) { __pyx_code_cache.entries = entries; __pyx_code_cache.max_count = 64; __pyx_code_cache.count = 1; entries[0].code_line = code_line; entries[0].code_object = code_object; Py_INCREF(code_object); } return; } pos = __pyx_bisect_code_objects(__pyx_code_cache.entries, __pyx_code_cache.count, code_line); if ((pos < __pyx_code_cache.count) && unlikely(__pyx_code_cache.entries[pos].code_line == code_line)) { PyCodeObject* tmp = entries[pos].code_object; entries[pos].code_object = code_object; Py_DECREF(tmp); return; } if (__pyx_code_cache.count == __pyx_code_cache.max_count) { int new_max = __pyx_code_cache.max_count + 64; entries = (__Pyx_CodeObjectCacheEntry*)PyMem_Realloc( __pyx_code_cache.entries, (size_t)new_max*sizeof(__Pyx_CodeObjectCacheEntry)); if (unlikely(!entries)) { return; } __pyx_code_cache.entries = entries; __pyx_code_cache.max_count = new_max; } for (i=__pyx_code_cache.count; i>pos; i--) { entries[i] = entries[i-1]; } entries[pos].code_line = code_line; entries[pos].code_object = code_object; __pyx_code_cache.count++; Py_INCREF(code_object); } /* AddTraceback */ #include "compile.h" #include "frameobject.h" #include "traceback.h" static PyCodeObject* __Pyx_CreateCodeObjectForTraceback( const char *funcname, int c_line, int py_line, const char *filename) { PyCodeObject *py_code = 0; PyObject *py_srcfile = 0; PyObject *py_funcname = 0; #if PY_MAJOR_VERSION < 3 py_srcfile = PyString_FromString(filename); #else py_srcfile = PyUnicode_FromString(filename); #endif if (!py_srcfile) goto bad; if (c_line) { #if PY_MAJOR_VERSION < 3 py_funcname = PyString_FromFormat( "%s (%s:%d)", funcname, __pyx_cfilenm, c_line); #else py_funcname = PyUnicode_FromFormat( "%s (%s:%d)", funcname, __pyx_cfilenm, c_line); #endif } else { #if PY_MAJOR_VERSION < 3 py_funcname = PyString_FromString(funcname); #else py_funcname = PyUnicode_FromString(funcname); #endif } if (!py_funcname) goto bad; py_code = __Pyx_PyCode_New( 0, 0, 0, 0, 0, __pyx_empty_bytes, /*PyObject *code,*/ __pyx_empty_tuple, /*PyObject *consts,*/ __pyx_empty_tuple, /*PyObject *names,*/ __pyx_empty_tuple, /*PyObject *varnames,*/ __pyx_empty_tuple, /*PyObject *freevars,*/ __pyx_empty_tuple, /*PyObject *cellvars,*/ py_srcfile, /*PyObject *filename,*/ py_funcname, /*PyObject *name,*/ py_line, __pyx_empty_bytes /*PyObject *lnotab*/ ); Py_DECREF(py_srcfile); Py_DECREF(py_funcname); return py_code; bad: Py_XDECREF(py_srcfile); Py_XDECREF(py_funcname); return NULL; } static void __Pyx_AddTraceback(const char *funcname, int c_line, int py_line, const char *filename) { PyCodeObject *py_code = 0; PyFrameObject *py_frame = 0; py_code = __pyx_find_code_object(c_line ? c_line : py_line); if (!py_code) { py_code = __Pyx_CreateCodeObjectForTraceback( funcname, c_line, py_line, filename); if (!py_code) goto bad; __pyx_insert_code_object(c_line ? c_line : py_line, py_code); } py_frame = PyFrame_New( PyThreadState_GET(), /*PyThreadState *tstate,*/ py_code, /*PyCodeObject *code,*/ __pyx_d, /*PyObject *globals,*/ 0 /*PyObject *locals*/ ); if (!py_frame) goto bad; py_frame->f_lineno = py_line; PyTraceBack_Here(py_frame); bad: Py_XDECREF(py_code); Py_XDECREF(py_frame); } /* CIntToPy */ static CYTHON_INLINE PyObject* __Pyx_PyInt_From_SDL_EventType(SDL_EventType value) { const SDL_EventType neg_one = (SDL_EventType) -1, const_zero = (SDL_EventType) 0; const int is_unsigned = neg_one > const_zero; if (is_unsigned) { if (sizeof(SDL_EventType) < sizeof(long)) { return PyInt_FromLong((long) value); } else if (sizeof(SDL_EventType) <= sizeof(unsigned long)) { return PyLong_FromUnsignedLong((unsigned long) value); } else if (sizeof(SDL_EventType) <= sizeof(unsigned PY_LONG_LONG)) { return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value); } } else { if (sizeof(SDL_EventType) <= sizeof(long)) { return PyInt_FromLong((long) value); } else if (sizeof(SDL_EventType) <= sizeof(PY_LONG_LONG)) { return PyLong_FromLongLong((PY_LONG_LONG) value); } } { int one = 1; int little = (int)*(unsigned char *)&one; unsigned char *bytes = (unsigned char *)&value; return _PyLong_FromByteArray(bytes, sizeof(SDL_EventType), little, !is_unsigned); } } /* CIntToPy */ static CYTHON_INLINE PyObject* __Pyx_PyInt_From_long(long value) { const long neg_one = (long) -1, const_zero = (long) 0; const int is_unsigned = neg_one > const_zero; if (is_unsigned) { if (sizeof(long) < sizeof(long)) { return PyInt_FromLong((long) value); } else if (sizeof(long) <= sizeof(unsigned long)) { return PyLong_FromUnsignedLong((unsigned long) value); } else if (sizeof(long) <= sizeof(unsigned PY_LONG_LONG)) { return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value); } } else { if (sizeof(long) <= sizeof(long)) { return PyInt_FromLong((long) value); } else if (sizeof(long) <= sizeof(PY_LONG_LONG)) { return PyLong_FromLongLong((PY_LONG_LONG) value); } } { int one = 1; int little = (int)*(unsigned char *)&one; unsigned char *bytes = (unsigned char *)&value; return _PyLong_FromByteArray(bytes, sizeof(long), little, !is_unsigned); } } /* CIntToPy */ static CYTHON_INLINE PyObject* __Pyx_PyInt_From_int(int value) { const int neg_one = (int) -1, const_zero = (int) 0; const int is_unsigned = neg_one > const_zero; if (is_unsigned) { if (sizeof(int) < sizeof(long)) { return PyInt_FromLong((long) value); } else if (sizeof(int) <= sizeof(unsigned long)) { return PyLong_FromUnsignedLong((unsigned long) value); } else if (sizeof(int) <= sizeof(unsigned PY_LONG_LONG)) { return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value); } } else { if (sizeof(int) <= sizeof(long)) { return PyInt_FromLong((long) value); } else if (sizeof(int) <= sizeof(PY_LONG_LONG)) { return PyLong_FromLongLong((PY_LONG_LONG) value); } } { int one = 1; int little = (int)*(unsigned char *)&one; unsigned char *bytes = (unsigned char *)&value; return _PyLong_FromByteArray(bytes, sizeof(int), little, !is_unsigned); } } /* CIntToPy */ static CYTHON_INLINE PyObject* __Pyx_PyInt_From_SDL_GLattr(SDL_GLattr value) { const SDL_GLattr neg_one = (SDL_GLattr) -1, const_zero = (SDL_GLattr) 0; const int is_unsigned = neg_one > const_zero; if (is_unsigned) { if (sizeof(SDL_GLattr) < sizeof(long)) { return PyInt_FromLong((long) value); } else if (sizeof(SDL_GLattr) <= sizeof(unsigned long)) { return PyLong_FromUnsignedLong((unsigned long) value); } else if (sizeof(SDL_GLattr) <= sizeof(unsigned PY_LONG_LONG)) { return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value); } } else { if (sizeof(SDL_GLattr) <= sizeof(long)) { return PyInt_FromLong((long) value); } else if (sizeof(SDL_GLattr) <= sizeof(PY_LONG_LONG)) { return PyLong_FromLongLong((PY_LONG_LONG) value); } } { int one = 1; int little = (int)*(unsigned char *)&one; unsigned char *bytes = (unsigned char *)&value; return _PyLong_FromByteArray(bytes, sizeof(SDL_GLattr), little, !is_unsigned); } } /* CIntToPy */ static CYTHON_INLINE PyObject* __Pyx_PyInt_From_SDL_WindowFlags(SDL_WindowFlags value) { const SDL_WindowFlags neg_one = (SDL_WindowFlags) -1, const_zero = (SDL_WindowFlags) 0; const int is_unsigned = neg_one > const_zero; if (is_unsigned) { if (sizeof(SDL_WindowFlags) < sizeof(long)) { return PyInt_FromLong((long) value); } else if (sizeof(SDL_WindowFlags) <= sizeof(unsigned long)) { return PyLong_FromUnsignedLong((unsigned long) value); } else if (sizeof(SDL_WindowFlags) <= sizeof(unsigned PY_LONG_LONG)) { return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value); } } else { if (sizeof(SDL_WindowFlags) <= sizeof(long)) { return PyInt_FromLong((long) value); } else if (sizeof(SDL_WindowFlags) <= sizeof(PY_LONG_LONG)) { return PyLong_FromLongLong((PY_LONG_LONG) value); } } { int one = 1; int little = (int)*(unsigned char *)&one; unsigned char *bytes = (unsigned char *)&value; return _PyLong_FromByteArray(bytes, sizeof(SDL_WindowFlags), little, !is_unsigned); } } /* CIntToPy */ static CYTHON_INLINE PyObject* __Pyx_PyInt_From_SDL_Keymod(SDL_Keymod value) { const SDL_Keymod neg_one = (SDL_Keymod) -1, const_zero = (SDL_Keymod) 0; const int is_unsigned = neg_one > const_zero; if (is_unsigned) { if (sizeof(SDL_Keymod) < sizeof(long)) { return PyInt_FromLong((long) value); } else if (sizeof(SDL_Keymod) <= sizeof(unsigned long)) { return PyLong_FromUnsignedLong((unsigned long) value); } else if (sizeof(SDL_Keymod) <= sizeof(unsigned PY_LONG_LONG)) { return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value); } } else { if (sizeof(SDL_Keymod) <= sizeof(long)) { return PyInt_FromLong((long) value); } else if (sizeof(SDL_Keymod) <= sizeof(PY_LONG_LONG)) { return PyLong_FromLongLong((PY_LONG_LONG) value); } } { int one = 1; int little = (int)*(unsigned char *)&one; unsigned char *bytes = (unsigned char *)&value; return _PyLong_FromByteArray(bytes, sizeof(SDL_Keymod), little, !is_unsigned); } } /* CIntToPy */ static CYTHON_INLINE PyObject* __Pyx_PyInt_From_SDL_GameControllerButton(SDL_GameControllerButton value) { const SDL_GameControllerButton neg_one = (SDL_GameControllerButton) -1, const_zero = (SDL_GameControllerButton) 0; const int is_unsigned = neg_one > const_zero; if (is_unsigned) { if (sizeof(SDL_GameControllerButton) < sizeof(long)) { return PyInt_FromLong((long) value); } else if (sizeof(SDL_GameControllerButton) <= sizeof(unsigned long)) { return PyLong_FromUnsignedLong((unsigned long) value); } else if (sizeof(SDL_GameControllerButton) <= sizeof(unsigned PY_LONG_LONG)) { return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value); } } else { if (sizeof(SDL_GameControllerButton) <= sizeof(long)) { return PyInt_FromLong((long) value); } else if (sizeof(SDL_GameControllerButton) <= sizeof(PY_LONG_LONG)) { return PyLong_FromLongLong((PY_LONG_LONG) value); } } { int one = 1; int little = (int)*(unsigned char *)&one; unsigned char *bytes = (unsigned char *)&value; return _PyLong_FromByteArray(bytes, sizeof(SDL_GameControllerButton), little, !is_unsigned); } } /* CIntToPy */ static CYTHON_INLINE PyObject* __Pyx_PyInt_From_SDL_GameControllerAxis(SDL_GameControllerAxis value) { const SDL_GameControllerAxis neg_one = (SDL_GameControllerAxis) -1, const_zero = (SDL_GameControllerAxis) 0; const int is_unsigned = neg_one > const_zero; if (is_unsigned) { if (sizeof(SDL_GameControllerAxis) < sizeof(long)) { return PyInt_FromLong((long) value); } else if (sizeof(SDL_GameControllerAxis) <= sizeof(unsigned long)) { return PyLong_FromUnsignedLong((unsigned long) value); } else if (sizeof(SDL_GameControllerAxis) <= sizeof(unsigned PY_LONG_LONG)) { return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value); } } else { if (sizeof(SDL_GameControllerAxis) <= sizeof(long)) { return PyInt_FromLong((long) value); } else if (sizeof(SDL_GameControllerAxis) <= sizeof(PY_LONG_LONG)) { return PyLong_FromLongLong((PY_LONG_LONG) value); } } { int one = 1; int little = (int)*(unsigned char *)&one; unsigned char *bytes = (unsigned char *)&value; return _PyLong_FromByteArray(bytes, sizeof(SDL_GameControllerAxis), little, !is_unsigned); } } /* CIntToPy */ static CYTHON_INLINE PyObject* __Pyx_PyInt_From_SDL_PowerState(SDL_PowerState value) { const SDL_PowerState neg_one = (SDL_PowerState) -1, const_zero = (SDL_PowerState) 0; const int is_unsigned = neg_one > const_zero; if (is_unsigned) { if (sizeof(SDL_PowerState) < sizeof(long)) { return PyInt_FromLong((long) value); } else if (sizeof(SDL_PowerState) <= sizeof(unsigned long)) { return PyLong_FromUnsignedLong((unsigned long) value); } else if (sizeof(SDL_PowerState) <= sizeof(unsigned PY_LONG_LONG)) { return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value); } } else { if (sizeof(SDL_PowerState) <= sizeof(long)) { return PyInt_FromLong((long) value); } else if (sizeof(SDL_PowerState) <= sizeof(PY_LONG_LONG)) { return PyLong_FromLongLong((PY_LONG_LONG) value); } } { int one = 1; int little = (int)*(unsigned char *)&one; unsigned char *bytes = (unsigned char *)&value; return _PyLong_FromByteArray(bytes, sizeof(SDL_PowerState), little, !is_unsigned); } } /* CIntFromPyVerify */ #define __PYX_VERIFY_RETURN_INT(target_type, func_type, func_value)\ __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, 0) #define __PYX_VERIFY_RETURN_INT_EXC(target_type, func_type, func_value)\ __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, 1) #define __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, exc)\ {\ func_type value = func_value;\ if (sizeof(target_type) < sizeof(func_type)) {\ if (unlikely(value != (func_type) (target_type) value)) {\ func_type zero = 0;\ if (exc && unlikely(value == (func_type)-1 && PyErr_Occurred()))\ return (target_type) -1;\ if (is_unsigned && unlikely(value < zero))\ goto raise_neg_overflow;\ else\ goto raise_overflow;\ }\ }\ return (target_type) value;\ } /* CIntFromPy */ static CYTHON_INLINE long __Pyx_PyInt_As_long(PyObject *x) { const long neg_one = (long) -1, const_zero = (long) 0; const int is_unsigned = neg_one > const_zero; #if PY_MAJOR_VERSION < 3 if (likely(PyInt_Check(x))) { if (sizeof(long) < sizeof(long)) { __PYX_VERIFY_RETURN_INT(long, long, PyInt_AS_LONG(x)) } else { long val = PyInt_AS_LONG(x); if (is_unsigned && unlikely(val < 0)) { goto raise_neg_overflow; } return (long) val; } } else #endif if (likely(PyLong_Check(x))) { if (is_unsigned) { #if CYTHON_USE_PYLONG_INTERNALS const digit* digits = ((PyLongObject*)x)->ob_digit; switch (Py_SIZE(x)) { case 0: return (long) 0; case 1: __PYX_VERIFY_RETURN_INT(long, digit, digits[0]) case 2: if (8 * sizeof(long) > 1 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(long) >= 2 * PyLong_SHIFT) { return (long) (((((long)digits[1]) << PyLong_SHIFT) | (long)digits[0])); } } break; case 3: if (8 * sizeof(long) > 2 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(long) >= 3 * PyLong_SHIFT) { return (long) (((((((long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0])); } } break; case 4: if (8 * sizeof(long) > 3 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(long) >= 4 * PyLong_SHIFT) { return (long) (((((((((long)digits[3]) << PyLong_SHIFT) | (long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0])); } } break; } #endif #if CYTHON_COMPILING_IN_CPYTHON if (unlikely(Py_SIZE(x) < 0)) { goto raise_neg_overflow; } #else { int result = PyObject_RichCompareBool(x, Py_False, Py_LT); if (unlikely(result < 0)) return (long) -1; if (unlikely(result == 1)) goto raise_neg_overflow; } #endif if (sizeof(long) <= sizeof(unsigned long)) { __PYX_VERIFY_RETURN_INT_EXC(long, unsigned long, PyLong_AsUnsignedLong(x)) } else if (sizeof(long) <= sizeof(unsigned PY_LONG_LONG)) { __PYX_VERIFY_RETURN_INT_EXC(long, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x)) } } else { #if CYTHON_USE_PYLONG_INTERNALS const digit* digits = ((PyLongObject*)x)->ob_digit; switch (Py_SIZE(x)) { case 0: return (long) 0; case -1: __PYX_VERIFY_RETURN_INT(long, sdigit, (sdigit) (-(sdigit)digits[0])) case 1: __PYX_VERIFY_RETURN_INT(long, digit, +digits[0]) case -2: if (8 * sizeof(long) - 1 > 1 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(long, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) { return (long) (((long)-1)*(((((long)digits[1]) << PyLong_SHIFT) | (long)digits[0]))); } } break; case 2: if (8 * sizeof(long) > 1 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) { return (long) ((((((long)digits[1]) << PyLong_SHIFT) | (long)digits[0]))); } } break; case -3: if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(long, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) { return (long) (((long)-1)*(((((((long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0]))); } } break; case 3: if (8 * sizeof(long) > 2 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) { return (long) ((((((((long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0]))); } } break; case -4: if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(long, long, -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(long) - 1 > 4 * PyLong_SHIFT) { return (long) (((long)-1)*(((((((((long)digits[3]) << PyLong_SHIFT) | (long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0]))); } } break; case 4: if (8 * sizeof(long) > 3 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(long) - 1 > 4 * PyLong_SHIFT) { return (long) ((((((((((long)digits[3]) << PyLong_SHIFT) | (long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0]))); } } break; } #endif if (sizeof(long) <= sizeof(long)) { __PYX_VERIFY_RETURN_INT_EXC(long, long, PyLong_AsLong(x)) } else if (sizeof(long) <= sizeof(PY_LONG_LONG)) { __PYX_VERIFY_RETURN_INT_EXC(long, PY_LONG_LONG, PyLong_AsLongLong(x)) } } { #if CYTHON_COMPILING_IN_PYPY && !defined(_PyLong_AsByteArray) PyErr_SetString(PyExc_RuntimeError, "_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers"); #else long val; PyObject *v = __Pyx_PyNumber_IntOrLong(x); #if PY_MAJOR_VERSION < 3 if (likely(v) && !PyLong_Check(v)) { PyObject *tmp = v; v = PyNumber_Long(tmp); Py_DECREF(tmp); } #endif if (likely(v)) { int one = 1; int is_little = (int)*(unsigned char *)&one; unsigned char *bytes = (unsigned char *)&val; int ret = _PyLong_AsByteArray((PyLongObject *)v, bytes, sizeof(val), is_little, !is_unsigned); Py_DECREF(v); if (likely(!ret)) return val; } #endif return (long) -1; } } else { long val; PyObject *tmp = __Pyx_PyNumber_IntOrLong(x); if (!tmp) return (long) -1; val = __Pyx_PyInt_As_long(tmp); Py_DECREF(tmp); return val; } raise_overflow: PyErr_SetString(PyExc_OverflowError, "value too large to convert to long"); return (long) -1; raise_neg_overflow: PyErr_SetString(PyExc_OverflowError, "can't convert negative value to long"); return (long) -1; } /* CIntFromPy */ static CYTHON_INLINE int __Pyx_PyInt_As_int(PyObject *x) { const int neg_one = (int) -1, const_zero = (int) 0; const int is_unsigned = neg_one > const_zero; #if PY_MAJOR_VERSION < 3 if (likely(PyInt_Check(x))) { if (sizeof(int) < sizeof(long)) { __PYX_VERIFY_RETURN_INT(int, long, PyInt_AS_LONG(x)) } else { long val = PyInt_AS_LONG(x); if (is_unsigned && unlikely(val < 0)) { goto raise_neg_overflow; } return (int) val; } } else #endif if (likely(PyLong_Check(x))) { if (is_unsigned) { #if CYTHON_USE_PYLONG_INTERNALS const digit* digits = ((PyLongObject*)x)->ob_digit; switch (Py_SIZE(x)) { case 0: return (int) 0; case 1: __PYX_VERIFY_RETURN_INT(int, digit, digits[0]) case 2: if (8 * sizeof(int) > 1 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(int) >= 2 * PyLong_SHIFT) { return (int) (((((int)digits[1]) << PyLong_SHIFT) | (int)digits[0])); } } break; case 3: if (8 * sizeof(int) > 2 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(int) >= 3 * PyLong_SHIFT) { return (int) (((((((int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0])); } } break; case 4: if (8 * sizeof(int) > 3 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(int) >= 4 * PyLong_SHIFT) { return (int) (((((((((int)digits[3]) << PyLong_SHIFT) | (int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0])); } } break; } #endif #if CYTHON_COMPILING_IN_CPYTHON if (unlikely(Py_SIZE(x) < 0)) { goto raise_neg_overflow; } #else { int result = PyObject_RichCompareBool(x, Py_False, Py_LT); if (unlikely(result < 0)) return (int) -1; if (unlikely(result == 1)) goto raise_neg_overflow; } #endif if (sizeof(int) <= sizeof(unsigned long)) { __PYX_VERIFY_RETURN_INT_EXC(int, unsigned long, PyLong_AsUnsignedLong(x)) } else if (sizeof(int) <= sizeof(unsigned PY_LONG_LONG)) { __PYX_VERIFY_RETURN_INT_EXC(int, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x)) } } else { #if CYTHON_USE_PYLONG_INTERNALS const digit* digits = ((PyLongObject*)x)->ob_digit; switch (Py_SIZE(x)) { case 0: return (int) 0; case -1: __PYX_VERIFY_RETURN_INT(int, sdigit, (sdigit) (-(sdigit)digits[0])) case 1: __PYX_VERIFY_RETURN_INT(int, digit, +digits[0]) case -2: if (8 * sizeof(int) - 1 > 1 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(int, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(int) - 1 > 2 * PyLong_SHIFT) { return (int) (((int)-1)*(((((int)digits[1]) << PyLong_SHIFT) | (int)digits[0]))); } } break; case 2: if (8 * sizeof(int) > 1 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(int) - 1 > 2 * PyLong_SHIFT) { return (int) ((((((int)digits[1]) << PyLong_SHIFT) | (int)digits[0]))); } } break; case -3: if (8 * sizeof(int) - 1 > 2 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(int, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(int) - 1 > 3 * PyLong_SHIFT) { return (int) (((int)-1)*(((((((int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0]))); } } break; case 3: if (8 * sizeof(int) > 2 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(int) - 1 > 3 * PyLong_SHIFT) { return (int) ((((((((int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0]))); } } break; case -4: if (8 * sizeof(int) - 1 > 3 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(int, long, -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(int) - 1 > 4 * PyLong_SHIFT) { return (int) (((int)-1)*(((((((((int)digits[3]) << PyLong_SHIFT) | (int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0]))); } } break; case 4: if (8 * sizeof(int) > 3 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(int) - 1 > 4 * PyLong_SHIFT) { return (int) ((((((((((int)digits[3]) << PyLong_SHIFT) | (int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0]))); } } break; } #endif if (sizeof(int) <= sizeof(long)) { __PYX_VERIFY_RETURN_INT_EXC(int, long, PyLong_AsLong(x)) } else if (sizeof(int) <= sizeof(PY_LONG_LONG)) { __PYX_VERIFY_RETURN_INT_EXC(int, PY_LONG_LONG, PyLong_AsLongLong(x)) } } { #if CYTHON_COMPILING_IN_PYPY && !defined(_PyLong_AsByteArray) PyErr_SetString(PyExc_RuntimeError, "_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers"); #else int val; PyObject *v = __Pyx_PyNumber_IntOrLong(x); #if PY_MAJOR_VERSION < 3 if (likely(v) && !PyLong_Check(v)) { PyObject *tmp = v; v = PyNumber_Long(tmp); Py_DECREF(tmp); } #endif if (likely(v)) { int one = 1; int is_little = (int)*(unsigned char *)&one; unsigned char *bytes = (unsigned char *)&val; int ret = _PyLong_AsByteArray((PyLongObject *)v, bytes, sizeof(val), is_little, !is_unsigned); Py_DECREF(v); if (likely(!ret)) return val; } #endif return (int) -1; } } else { int val; PyObject *tmp = __Pyx_PyNumber_IntOrLong(x); if (!tmp) return (int) -1; val = __Pyx_PyInt_As_int(tmp); Py_DECREF(tmp); return val; } raise_overflow: PyErr_SetString(PyExc_OverflowError, "value too large to convert to int"); return (int) -1; raise_neg_overflow: PyErr_SetString(PyExc_OverflowError, "can't convert negative value to int"); return (int) -1; } /* CheckBinaryVersion */ static int __Pyx_check_binary_version(void) { char ctversion[4], rtversion[4]; PyOS_snprintf(ctversion, 4, "%d.%d", PY_MAJOR_VERSION, PY_MINOR_VERSION); PyOS_snprintf(rtversion, 4, "%s", Py_GetVersion()); if (ctversion[0] != rtversion[0] || ctversion[2] != rtversion[2]) { char message[200]; PyOS_snprintf(message, sizeof(message), "compiletime version %s of module '%.100s' " "does not match runtime version %s", ctversion, __Pyx_MODULE_NAME, rtversion); return PyErr_WarnEx(NULL, message, 1); } return 0; } /* InitStrings */ static int __Pyx_InitStrings(__Pyx_StringTabEntry *t) { while (t->p) { #if PY_MAJOR_VERSION < 3 if (t->is_unicode) { *t->p = PyUnicode_DecodeUTF8(t->s, t->n - 1, NULL); } else if (t->intern) { *t->p = PyString_InternFromString(t->s); } else { *t->p = PyString_FromStringAndSize(t->s, t->n - 1); } #else if (t->is_unicode | t->is_str) { if (t->intern) { *t->p = PyUnicode_InternFromString(t->s); } else if (t->encoding) { *t->p = PyUnicode_Decode(t->s, t->n - 1, t->encoding, NULL); } else { *t->p = PyUnicode_FromStringAndSize(t->s, t->n - 1); } } else { *t->p = PyBytes_FromStringAndSize(t->s, t->n - 1); } #endif if (!*t->p) return -1; ++t; } return 0; } static CYTHON_INLINE PyObject* __Pyx_PyUnicode_FromString(const char* c_str) { return __Pyx_PyUnicode_FromStringAndSize(c_str, (Py_ssize_t)strlen(c_str)); } static CYTHON_INLINE char* __Pyx_PyObject_AsString(PyObject* o) { Py_ssize_t ignore; return __Pyx_PyObject_AsStringAndSize(o, &ignore); } static CYTHON_INLINE char* __Pyx_PyObject_AsStringAndSize(PyObject* o, Py_ssize_t *length) { #if CYTHON_COMPILING_IN_CPYTHON && (__PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT) if ( #if PY_MAJOR_VERSION < 3 && __PYX_DEFAULT_STRING_ENCODING_IS_ASCII __Pyx_sys_getdefaultencoding_not_ascii && #endif PyUnicode_Check(o)) { #if PY_VERSION_HEX < 0x03030000 char* defenc_c; PyObject* defenc = _PyUnicode_AsDefaultEncodedString(o, NULL); if (!defenc) return NULL; defenc_c = PyBytes_AS_STRING(defenc); #if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII { char* end = defenc_c + PyBytes_GET_SIZE(defenc); char* c; for (c = defenc_c; c < end; c++) { if ((unsigned char) (*c) >= 128) { PyUnicode_AsASCIIString(o); return NULL; } } } #endif *length = PyBytes_GET_SIZE(defenc); return defenc_c; #else if (__Pyx_PyUnicode_READY(o) == -1) return NULL; #if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII if (PyUnicode_IS_ASCII(o)) { *length = PyUnicode_GET_LENGTH(o); return PyUnicode_AsUTF8(o); } else { PyUnicode_AsASCIIString(o); return NULL; } #else return PyUnicode_AsUTF8AndSize(o, length); #endif #endif } else #endif #if (!CYTHON_COMPILING_IN_PYPY) || (defined(PyByteArray_AS_STRING) && defined(PyByteArray_GET_SIZE)) if (PyByteArray_Check(o)) { *length = PyByteArray_GET_SIZE(o); return PyByteArray_AS_STRING(o); } else #endif { char* result; int r = PyBytes_AsStringAndSize(o, &result, length); if (unlikely(r < 0)) { return NULL; } else { return result; } } } static CYTHON_INLINE int __Pyx_PyObject_IsTrue(PyObject* x) { int is_true = x == Py_True; if (is_true | (x == Py_False) | (x == Py_None)) return is_true; else return PyObject_IsTrue(x); } static CYTHON_INLINE PyObject* __Pyx_PyNumber_IntOrLong(PyObject* x) { PyNumberMethods *m; const char *name = NULL; PyObject *res = NULL; #if PY_MAJOR_VERSION < 3 if (PyInt_Check(x) || PyLong_Check(x)) #else if (PyLong_Check(x)) #endif return __Pyx_NewRef(x); m = Py_TYPE(x)->tp_as_number; #if PY_MAJOR_VERSION < 3 if (m && m->nb_int) { name = "int"; res = PyNumber_Int(x); } else if (m && m->nb_long) { name = "long"; res = PyNumber_Long(x); } #else if (m && m->nb_int) { name = "int"; res = PyNumber_Long(x); } #endif if (res) { #if PY_MAJOR_VERSION < 3 if (!PyInt_Check(res) && !PyLong_Check(res)) { #else if (!PyLong_Check(res)) { #endif PyErr_Format(PyExc_TypeError, "__%.4s__ returned non-%.4s (type %.200s)", name, name, Py_TYPE(res)->tp_name); Py_DECREF(res); return NULL; } } else if (!PyErr_Occurred()) { PyErr_SetString(PyExc_TypeError, "an integer is required"); } return res; } static CYTHON_INLINE Py_ssize_t __Pyx_PyIndex_AsSsize_t(PyObject* b) { Py_ssize_t ival; PyObject *x; #if PY_MAJOR_VERSION < 3 if (likely(PyInt_CheckExact(b))) { if (sizeof(Py_ssize_t) >= sizeof(long)) return PyInt_AS_LONG(b); else return PyInt_AsSsize_t(x); } #endif if (likely(PyLong_CheckExact(b))) { #if CYTHON_USE_PYLONG_INTERNALS const digit* digits = ((PyLongObject*)b)->ob_digit; const Py_ssize_t size = Py_SIZE(b); if (likely(__Pyx_sst_abs(size) <= 1)) { ival = likely(size) ? digits[0] : 0; if (size == -1) ival = -ival; return ival; } else { switch (size) { case 2: if (8 * sizeof(Py_ssize_t) > 2 * PyLong_SHIFT) { return (Py_ssize_t) (((((size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])); } break; case -2: if (8 * sizeof(Py_ssize_t) > 2 * PyLong_SHIFT) { return -(Py_ssize_t) (((((size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])); } break; case 3: if (8 * sizeof(Py_ssize_t) > 3 * PyLong_SHIFT) { return (Py_ssize_t) (((((((size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])); } break; case -3: if (8 * sizeof(Py_ssize_t) > 3 * PyLong_SHIFT) { return -(Py_ssize_t) (((((((size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])); } break; case 4: if (8 * sizeof(Py_ssize_t) > 4 * PyLong_SHIFT) { return (Py_ssize_t) (((((((((size_t)digits[3]) << PyLong_SHIFT) | (size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])); } break; case -4: if (8 * sizeof(Py_ssize_t) > 4 * PyLong_SHIFT) { return -(Py_ssize_t) (((((((((size_t)digits[3]) << PyLong_SHIFT) | (size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])); } break; } } #endif return PyLong_AsSsize_t(b); } x = PyNumber_Index(b); if (!x) return -1; ival = PyInt_AsSsize_t(x); Py_DECREF(x); return ival; } static CYTHON_INLINE PyObject * __Pyx_PyInt_FromSize_t(size_t ival) { return PyInt_FromSize_t(ival); } #endif /* Py_PYTHON_H */ pygame_sdl2-2.1.0-for-renpy-6.99.14.1/MANIFEST.in0000664000175000017500000000065512651176771020027 0ustar tomtom00000000000000include gen/*.c include gen3/*.c include fix_virtualenv.py include COPYING.* include setup.py include setuplib.py include include/*.pxi include include/*.pxd include src/*.h include src/*.c include src/pygame_sdl2/*.h include src/pygame_sdl2/*.py include src/pygame_sdl2/*.pyx include src/pygame_sdl2/*.pxd include src/pygame_sdl2/*.txt include src/pygame_sdl2/*.ttf include src/pygame_sdl2/threads/*.py exclude test/* pygame_sdl2-2.1.0-for-renpy-6.99.14.1/fix_virtualenv.py0000664000175000017500000000130612507767763021711 0ustar tomtom00000000000000from __future__ import unicode_literals, print_function import os import argparse import sys import shutil import sysconfig def main(): target = os.path.dirname(sysconfig.get_config_h_filename()) try: source = os.readlink(target) except: print(target, "is not a symlink. Perhaps this script has already been run.") sys.exit(1) tmp = target + ".tmp" if os.path.exists(tmp): shutil.rmtree(tmp) os.mkdir(tmp) for i in os.listdir(source): if i == "pygame_sdl2": continue os.symlink(os.path.join(source, i), os.path.join(tmp, i)) os.unlink(target) os.rename(tmp, target) if __name__ == "__main__": main() pygame_sdl2-2.1.0-for-renpy-6.99.14.1/gen/0000755000175000017500000000000013235720531017016 5ustar tomtom00000000000000pygame_sdl2-2.1.0-for-renpy-6.99.14.1/gen/pygame_sdl2.event.c0000644000175000017500000240234213203750743022522 0ustar tomtom00000000000000/* Generated by Cython 0.23.5 */ #define PY_SSIZE_T_CLEAN #include "Python.h" #ifndef Py_PYTHON_H #error Python headers needed to compile C extensions, please install development version of Python. #elif PY_VERSION_HEX < 0x02060000 || (0x03000000 <= PY_VERSION_HEX && PY_VERSION_HEX < 0x03020000) #error Cython requires Python 2.6+ or Python 3.2+. #else #define CYTHON_ABI "0_23_5" #include #ifndef offsetof #define offsetof(type, member) ( (size_t) & ((type*)0) -> member ) #endif #if !defined(WIN32) && !defined(MS_WINDOWS) #ifndef __stdcall #define __stdcall #endif #ifndef __cdecl #define __cdecl #endif #ifndef __fastcall #define __fastcall #endif #endif #ifndef DL_IMPORT #define DL_IMPORT(t) t #endif #ifndef DL_EXPORT #define DL_EXPORT(t) t #endif #ifndef PY_LONG_LONG #define PY_LONG_LONG LONG_LONG #endif #ifndef Py_HUGE_VAL #define Py_HUGE_VAL HUGE_VAL #endif #ifdef PYPY_VERSION #define CYTHON_COMPILING_IN_PYPY 1 #define CYTHON_COMPILING_IN_CPYTHON 0 #else #define CYTHON_COMPILING_IN_PYPY 0 #define CYTHON_COMPILING_IN_CPYTHON 1 #endif #if !defined(CYTHON_USE_PYLONG_INTERNALS) && CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x02070000 #define CYTHON_USE_PYLONG_INTERNALS 1 #endif #if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX < 0x02070600 && !defined(Py_OptimizeFlag) #define Py_OptimizeFlag 0 #endif #define __PYX_BUILD_PY_SSIZE_T "n" #define CYTHON_FORMAT_SSIZE_T "z" #if PY_MAJOR_VERSION < 3 #define __Pyx_BUILTIN_MODULE_NAME "__builtin__" #define __Pyx_PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)\ PyCode_New(a+k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos) #define __Pyx_DefaultClassType PyClass_Type #else #define __Pyx_BUILTIN_MODULE_NAME "builtins" #define __Pyx_PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)\ PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos) #define __Pyx_DefaultClassType PyType_Type #endif #ifndef Py_TPFLAGS_CHECKTYPES #define Py_TPFLAGS_CHECKTYPES 0 #endif #ifndef Py_TPFLAGS_HAVE_INDEX #define Py_TPFLAGS_HAVE_INDEX 0 #endif #ifndef Py_TPFLAGS_HAVE_NEWBUFFER #define Py_TPFLAGS_HAVE_NEWBUFFER 0 #endif #ifndef Py_TPFLAGS_HAVE_FINALIZE #define Py_TPFLAGS_HAVE_FINALIZE 0 #endif #if PY_VERSION_HEX > 0x03030000 && defined(PyUnicode_KIND) #define CYTHON_PEP393_ENABLED 1 #define __Pyx_PyUnicode_READY(op) (likely(PyUnicode_IS_READY(op)) ?\ 0 : _PyUnicode_Ready((PyObject *)(op))) #define __Pyx_PyUnicode_GET_LENGTH(u) PyUnicode_GET_LENGTH(u) #define __Pyx_PyUnicode_READ_CHAR(u, i) PyUnicode_READ_CHAR(u, i) #define __Pyx_PyUnicode_KIND(u) PyUnicode_KIND(u) #define __Pyx_PyUnicode_DATA(u) PyUnicode_DATA(u) #define __Pyx_PyUnicode_READ(k, d, i) PyUnicode_READ(k, d, i) #else #define CYTHON_PEP393_ENABLED 0 #define __Pyx_PyUnicode_READY(op) (0) #define __Pyx_PyUnicode_GET_LENGTH(u) PyUnicode_GET_SIZE(u) #define __Pyx_PyUnicode_READ_CHAR(u, i) ((Py_UCS4)(PyUnicode_AS_UNICODE(u)[i])) #define __Pyx_PyUnicode_KIND(u) (sizeof(Py_UNICODE)) #define __Pyx_PyUnicode_DATA(u) ((void*)PyUnicode_AS_UNICODE(u)) #define __Pyx_PyUnicode_READ(k, d, i) ((void)(k), (Py_UCS4)(((Py_UNICODE*)d)[i])) #endif #if CYTHON_COMPILING_IN_PYPY #define __Pyx_PyUnicode_Concat(a, b) PyNumber_Add(a, b) #define __Pyx_PyUnicode_ConcatSafe(a, b) PyNumber_Add(a, b) #else #define __Pyx_PyUnicode_Concat(a, b) PyUnicode_Concat(a, b) #define __Pyx_PyUnicode_ConcatSafe(a, b) ((unlikely((a) == Py_None) || unlikely((b) == Py_None)) ?\ PyNumber_Add(a, b) : __Pyx_PyUnicode_Concat(a, b)) #endif #if CYTHON_COMPILING_IN_PYPY && !defined(PyUnicode_Contains) #define PyUnicode_Contains(u, s) PySequence_Contains(u, s) #endif #define __Pyx_PyString_FormatSafe(a, b) ((unlikely((a) == Py_None)) ? PyNumber_Remainder(a, b) : __Pyx_PyString_Format(a, b)) #define __Pyx_PyUnicode_FormatSafe(a, b) ((unlikely((a) == Py_None)) ? PyNumber_Remainder(a, b) : PyUnicode_Format(a, b)) #if PY_MAJOR_VERSION >= 3 #define __Pyx_PyString_Format(a, b) PyUnicode_Format(a, b) #else #define __Pyx_PyString_Format(a, b) PyString_Format(a, b) #endif #if PY_MAJOR_VERSION >= 3 #define PyBaseString_Type PyUnicode_Type #define PyStringObject PyUnicodeObject #define PyString_Type PyUnicode_Type #define PyString_Check PyUnicode_Check #define PyString_CheckExact PyUnicode_CheckExact #endif #if PY_MAJOR_VERSION >= 3 #define __Pyx_PyBaseString_Check(obj) PyUnicode_Check(obj) #define __Pyx_PyBaseString_CheckExact(obj) PyUnicode_CheckExact(obj) #else #define __Pyx_PyBaseString_Check(obj) (PyString_Check(obj) || PyUnicode_Check(obj)) #define __Pyx_PyBaseString_CheckExact(obj) (PyString_CheckExact(obj) || PyUnicode_CheckExact(obj)) #endif #ifndef PySet_CheckExact #define PySet_CheckExact(obj) (Py_TYPE(obj) == &PySet_Type) #endif #define __Pyx_TypeCheck(obj, type) PyObject_TypeCheck(obj, (PyTypeObject *)type) #if PY_MAJOR_VERSION >= 3 #define PyIntObject PyLongObject #define PyInt_Type PyLong_Type #define PyInt_Check(op) PyLong_Check(op) #define PyInt_CheckExact(op) PyLong_CheckExact(op) #define PyInt_FromString PyLong_FromString #define PyInt_FromUnicode PyLong_FromUnicode #define PyInt_FromLong PyLong_FromLong #define PyInt_FromSize_t PyLong_FromSize_t #define PyInt_FromSsize_t PyLong_FromSsize_t #define PyInt_AsLong PyLong_AsLong #define PyInt_AS_LONG PyLong_AS_LONG #define PyInt_AsSsize_t PyLong_AsSsize_t #define PyInt_AsUnsignedLongMask PyLong_AsUnsignedLongMask #define PyInt_AsUnsignedLongLongMask PyLong_AsUnsignedLongLongMask #define PyNumber_Int PyNumber_Long #endif #if PY_MAJOR_VERSION >= 3 #define PyBoolObject PyLongObject #endif #if PY_MAJOR_VERSION >= 3 && CYTHON_COMPILING_IN_PYPY #ifndef PyUnicode_InternFromString #define PyUnicode_InternFromString(s) PyUnicode_FromString(s) #endif #endif #if PY_VERSION_HEX < 0x030200A4 typedef long Py_hash_t; #define __Pyx_PyInt_FromHash_t PyInt_FromLong #define __Pyx_PyInt_AsHash_t PyInt_AsLong #else #define __Pyx_PyInt_FromHash_t PyInt_FromSsize_t #define __Pyx_PyInt_AsHash_t PyInt_AsSsize_t #endif #if PY_MAJOR_VERSION >= 3 #define __Pyx_PyMethod_New(func, self, klass) ((self) ? PyMethod_New(func, self) : PyInstanceMethod_New(func)) #else #define __Pyx_PyMethod_New(func, self, klass) PyMethod_New(func, self, klass) #endif #if PY_VERSION_HEX >= 0x030500B1 #define __Pyx_PyAsyncMethodsStruct PyAsyncMethods #define __Pyx_PyType_AsAsync(obj) (Py_TYPE(obj)->tp_as_async) #elif CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3 typedef struct { unaryfunc am_await; unaryfunc am_aiter; unaryfunc am_anext; } __Pyx_PyAsyncMethodsStruct; #define __Pyx_PyType_AsAsync(obj) ((__Pyx_PyAsyncMethodsStruct*) (Py_TYPE(obj)->tp_reserved)) #else #define __Pyx_PyType_AsAsync(obj) NULL #endif #ifndef CYTHON_RESTRICT #if defined(__GNUC__) #define CYTHON_RESTRICT __restrict__ #elif defined(_MSC_VER) && _MSC_VER >= 1400 #define CYTHON_RESTRICT __restrict #elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L #define CYTHON_RESTRICT restrict #else #define CYTHON_RESTRICT #endif #endif #define __Pyx_void_to_None(void_result) ((void)(void_result), Py_INCREF(Py_None), Py_None) #ifndef CYTHON_INLINE #if defined(__GNUC__) #define CYTHON_INLINE __inline__ #elif defined(_MSC_VER) #define CYTHON_INLINE __inline #elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L #define CYTHON_INLINE inline #else #define CYTHON_INLINE #endif #endif #if defined(WIN32) || defined(MS_WINDOWS) #define _USE_MATH_DEFINES #endif #include #ifdef NAN #define __PYX_NAN() ((float) NAN) #else static CYTHON_INLINE float __PYX_NAN() { float value; memset(&value, 0xFF, sizeof(value)); return value; } #endif #if PY_MAJOR_VERSION >= 3 #define __Pyx_PyNumber_Divide(x,y) PyNumber_TrueDivide(x,y) #define __Pyx_PyNumber_InPlaceDivide(x,y) PyNumber_InPlaceTrueDivide(x,y) #else #define __Pyx_PyNumber_Divide(x,y) PyNumber_Divide(x,y) #define __Pyx_PyNumber_InPlaceDivide(x,y) PyNumber_InPlaceDivide(x,y) #endif #ifndef __PYX_EXTERN_C #ifdef __cplusplus #define __PYX_EXTERN_C extern "C" #else #define __PYX_EXTERN_C extern #endif #endif #define __PYX_HAVE__pygame_sdl2__event #define __PYX_HAVE_API__pygame_sdl2__event #include "string.h" #include "stdio.h" #include "stdint.h" #include "stddef.h" #include "SDL.h" #ifdef _OPENMP #include #endif /* _OPENMP */ #ifdef PYREX_WITHOUT_ASSERTIONS #define CYTHON_WITHOUT_ASSERTIONS #endif #ifndef CYTHON_UNUSED # if defined(__GNUC__) # if !(defined(__cplusplus)) || (__GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 4)) # define CYTHON_UNUSED __attribute__ ((__unused__)) # else # define CYTHON_UNUSED # endif # elif defined(__ICC) || (defined(__INTEL_COMPILER) && !defined(_MSC_VER)) # define CYTHON_UNUSED __attribute__ ((__unused__)) # else # define CYTHON_UNUSED # endif #endif #ifndef CYTHON_NCP_UNUSED # if CYTHON_COMPILING_IN_CPYTHON # define CYTHON_NCP_UNUSED # else # define CYTHON_NCP_UNUSED CYTHON_UNUSED # endif #endif typedef struct {PyObject **p; char *s; const Py_ssize_t n; const char* encoding; const char is_unicode; const char is_str; const char intern; } __Pyx_StringTabEntry; #define __PYX_DEFAULT_STRING_ENCODING_IS_ASCII 0 #define __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT 0 #define __PYX_DEFAULT_STRING_ENCODING "" #define __Pyx_PyObject_FromString __Pyx_PyBytes_FromString #define __Pyx_PyObject_FromStringAndSize __Pyx_PyBytes_FromStringAndSize #define __Pyx_uchar_cast(c) ((unsigned char)c) #define __Pyx_long_cast(x) ((long)x) #define __Pyx_fits_Py_ssize_t(v, type, is_signed) (\ (sizeof(type) < sizeof(Py_ssize_t)) ||\ (sizeof(type) > sizeof(Py_ssize_t) &&\ likely(v < (type)PY_SSIZE_T_MAX ||\ v == (type)PY_SSIZE_T_MAX) &&\ (!is_signed || likely(v > (type)PY_SSIZE_T_MIN ||\ v == (type)PY_SSIZE_T_MIN))) ||\ (sizeof(type) == sizeof(Py_ssize_t) &&\ (is_signed || likely(v < (type)PY_SSIZE_T_MAX ||\ v == (type)PY_SSIZE_T_MAX))) ) #if defined (__cplusplus) && __cplusplus >= 201103L #include #define __Pyx_sst_abs(value) std::abs(value) #elif SIZEOF_INT >= SIZEOF_SIZE_T #define __Pyx_sst_abs(value) abs(value) #elif SIZEOF_LONG >= SIZEOF_SIZE_T #define __Pyx_sst_abs(value) labs(value) #elif defined (_MSC_VER) && defined (_M_X64) #define __Pyx_sst_abs(value) _abs64(value) #elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L #define __Pyx_sst_abs(value) llabs(value) #elif defined (__GNUC__) #define __Pyx_sst_abs(value) __builtin_llabs(value) #else #define __Pyx_sst_abs(value) ((value<0) ? -value : value) #endif static CYTHON_INLINE char* __Pyx_PyObject_AsString(PyObject*); static CYTHON_INLINE char* __Pyx_PyObject_AsStringAndSize(PyObject*, Py_ssize_t* length); #define __Pyx_PyByteArray_FromString(s) PyByteArray_FromStringAndSize((const char*)s, strlen((const char*)s)) #define __Pyx_PyByteArray_FromStringAndSize(s, l) PyByteArray_FromStringAndSize((const char*)s, l) #define __Pyx_PyBytes_FromString PyBytes_FromString #define __Pyx_PyBytes_FromStringAndSize PyBytes_FromStringAndSize static CYTHON_INLINE PyObject* __Pyx_PyUnicode_FromString(const char*); #if PY_MAJOR_VERSION < 3 #define __Pyx_PyStr_FromString __Pyx_PyBytes_FromString #define __Pyx_PyStr_FromStringAndSize __Pyx_PyBytes_FromStringAndSize #else #define __Pyx_PyStr_FromString __Pyx_PyUnicode_FromString #define __Pyx_PyStr_FromStringAndSize __Pyx_PyUnicode_FromStringAndSize #endif #define __Pyx_PyObject_AsSString(s) ((signed char*) __Pyx_PyObject_AsString(s)) #define __Pyx_PyObject_AsUString(s) ((unsigned char*) __Pyx_PyObject_AsString(s)) #define __Pyx_PyObject_FromCString(s) __Pyx_PyObject_FromString((const char*)s) #define __Pyx_PyBytes_FromCString(s) __Pyx_PyBytes_FromString((const char*)s) #define __Pyx_PyByteArray_FromCString(s) __Pyx_PyByteArray_FromString((const char*)s) #define __Pyx_PyStr_FromCString(s) __Pyx_PyStr_FromString((const char*)s) #define __Pyx_PyUnicode_FromCString(s) __Pyx_PyUnicode_FromString((const char*)s) #if PY_MAJOR_VERSION < 3 static CYTHON_INLINE size_t __Pyx_Py_UNICODE_strlen(const Py_UNICODE *u) { const Py_UNICODE *u_end = u; while (*u_end++) ; return (size_t)(u_end - u - 1); } #else #define __Pyx_Py_UNICODE_strlen Py_UNICODE_strlen #endif #define __Pyx_PyUnicode_FromUnicode(u) PyUnicode_FromUnicode(u, __Pyx_Py_UNICODE_strlen(u)) #define __Pyx_PyUnicode_FromUnicodeAndLength PyUnicode_FromUnicode #define __Pyx_PyUnicode_AsUnicode PyUnicode_AsUnicode #define __Pyx_NewRef(obj) (Py_INCREF(obj), obj) #define __Pyx_Owned_Py_None(b) __Pyx_NewRef(Py_None) #define __Pyx_PyBool_FromLong(b) ((b) ? __Pyx_NewRef(Py_True) : __Pyx_NewRef(Py_False)) static CYTHON_INLINE int __Pyx_PyObject_IsTrue(PyObject*); static CYTHON_INLINE PyObject* __Pyx_PyNumber_Int(PyObject* x); static CYTHON_INLINE Py_ssize_t __Pyx_PyIndex_AsSsize_t(PyObject*); static CYTHON_INLINE PyObject * __Pyx_PyInt_FromSize_t(size_t); #if CYTHON_COMPILING_IN_CPYTHON #define __pyx_PyFloat_AsDouble(x) (PyFloat_CheckExact(x) ? PyFloat_AS_DOUBLE(x) : PyFloat_AsDouble(x)) #else #define __pyx_PyFloat_AsDouble(x) PyFloat_AsDouble(x) #endif #define __pyx_PyFloat_AsFloat(x) ((float) __pyx_PyFloat_AsDouble(x)) #if PY_MAJOR_VERSION < 3 && __PYX_DEFAULT_STRING_ENCODING_IS_ASCII static int __Pyx_sys_getdefaultencoding_not_ascii; static int __Pyx_init_sys_getdefaultencoding_params(void) { PyObject* sys; PyObject* default_encoding = NULL; PyObject* ascii_chars_u = NULL; PyObject* ascii_chars_b = NULL; const char* default_encoding_c; sys = PyImport_ImportModule("sys"); if (!sys) goto bad; default_encoding = PyObject_CallMethod(sys, (char*) "getdefaultencoding", NULL); Py_DECREF(sys); if (!default_encoding) goto bad; default_encoding_c = PyBytes_AsString(default_encoding); if (!default_encoding_c) goto bad; if (strcmp(default_encoding_c, "ascii") == 0) { __Pyx_sys_getdefaultencoding_not_ascii = 0; } else { char ascii_chars[128]; int c; for (c = 0; c < 128; c++) { ascii_chars[c] = c; } __Pyx_sys_getdefaultencoding_not_ascii = 1; ascii_chars_u = PyUnicode_DecodeASCII(ascii_chars, 128, NULL); if (!ascii_chars_u) goto bad; ascii_chars_b = PyUnicode_AsEncodedString(ascii_chars_u, default_encoding_c, NULL); if (!ascii_chars_b || !PyBytes_Check(ascii_chars_b) || memcmp(ascii_chars, PyBytes_AS_STRING(ascii_chars_b), 128) != 0) { PyErr_Format( PyExc_ValueError, "This module compiled with c_string_encoding=ascii, but default encoding '%.200s' is not a superset of ascii.", default_encoding_c); goto bad; } Py_DECREF(ascii_chars_u); Py_DECREF(ascii_chars_b); } Py_DECREF(default_encoding); return 0; bad: Py_XDECREF(default_encoding); Py_XDECREF(ascii_chars_u); Py_XDECREF(ascii_chars_b); return -1; } #endif #if __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT && PY_MAJOR_VERSION >= 3 #define __Pyx_PyUnicode_FromStringAndSize(c_str, size) PyUnicode_DecodeUTF8(c_str, size, NULL) #else #define __Pyx_PyUnicode_FromStringAndSize(c_str, size) PyUnicode_Decode(c_str, size, __PYX_DEFAULT_STRING_ENCODING, NULL) #if __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT static char* __PYX_DEFAULT_STRING_ENCODING; static int __Pyx_init_sys_getdefaultencoding_params(void) { PyObject* sys; PyObject* default_encoding = NULL; char* default_encoding_c; sys = PyImport_ImportModule("sys"); if (!sys) goto bad; default_encoding = PyObject_CallMethod(sys, (char*) (const char*) "getdefaultencoding", NULL); Py_DECREF(sys); if (!default_encoding) goto bad; default_encoding_c = PyBytes_AsString(default_encoding); if (!default_encoding_c) goto bad; __PYX_DEFAULT_STRING_ENCODING = (char*) malloc(strlen(default_encoding_c)); if (!__PYX_DEFAULT_STRING_ENCODING) goto bad; strcpy(__PYX_DEFAULT_STRING_ENCODING, default_encoding_c); Py_DECREF(default_encoding); return 0; bad: Py_XDECREF(default_encoding); return -1; } #endif #endif /* Test for GCC > 2.95 */ #if defined(__GNUC__) && (__GNUC__ > 2 || (__GNUC__ == 2 && (__GNUC_MINOR__ > 95))) #define likely(x) __builtin_expect(!!(x), 1) #define unlikely(x) __builtin_expect(!!(x), 0) #else /* !__GNUC__ or GCC < 2.95 */ #define likely(x) (x) #define unlikely(x) (x) #endif /* __GNUC__ */ static PyObject *__pyx_m; static PyObject *__pyx_d; static PyObject *__pyx_b; static PyObject *__pyx_empty_tuple; static PyObject *__pyx_empty_bytes; static int __pyx_lineno; static int __pyx_clineno = 0; static const char * __pyx_cfilenm= __FILE__; static const char *__pyx_filename; static const char *__pyx_f[] = { "src/pygame_sdl2/event.pyx", "type.pxd", "src/pygame_sdl2/surface.pxd", "src/pygame_sdl2/display.pxd", "include/event_names.pxi", }; /*--- Type declarations ---*/ struct __pyx_obj_11pygame_sdl2_7surface_Surface; struct __pyx_obj_11pygame_sdl2_7display_Window; /* "pygame_sdl2/surface.pxd":23 * from sdl2 cimport SDL_Surface * * cdef class Surface: # <<<<<<<<<<<<<< * # Allow weak references. * cdef object __weakref__ */ struct __pyx_obj_11pygame_sdl2_7surface_Surface { PyObject_HEAD struct __pyx_vtabstruct_11pygame_sdl2_7surface_Surface *__pyx_vtab; PyObject *__weakref__; SDL_Surface *surface; int owns_surface; int window_surface; PyObject *locklist; struct __pyx_obj_11pygame_sdl2_7surface_Surface *parent; struct __pyx_obj_11pygame_sdl2_7surface_Surface *root; int offset_x; int offset_y; PyObject *get_window_flags; int has_alpha; }; /* "pygame_sdl2/display.pxd":23 * from pygame_sdl2.surface cimport Surface * * cdef class Window: # <<<<<<<<<<<<<< * # Allow weak references. * cdef object __weakref__ */ struct __pyx_obj_11pygame_sdl2_7display_Window { PyObject_HEAD PyObject *__weakref__; SDL_Window *window; SDL_Surface *window_surface; struct __pyx_obj_11pygame_sdl2_7surface_Surface *surface; SDL_GLContext gl_context; Uint32 create_flags; }; /* "pygame_sdl2/surface.pxd":23 * from sdl2 cimport SDL_Surface * * cdef class Surface: # <<<<<<<<<<<<<< * # Allow weak references. * cdef object __weakref__ */ struct __pyx_vtabstruct_11pygame_sdl2_7surface_Surface { void (*take_surface)(struct __pyx_obj_11pygame_sdl2_7surface_Surface *, SDL_Surface *); }; static struct __pyx_vtabstruct_11pygame_sdl2_7surface_Surface *__pyx_vtabptr_11pygame_sdl2_7surface_Surface; /* --- Runtime support code (head) --- */ #ifndef CYTHON_REFNANNY #define CYTHON_REFNANNY 0 #endif #if CYTHON_REFNANNY typedef struct { void (*INCREF)(void*, PyObject*, int); void (*DECREF)(void*, PyObject*, int); void (*GOTREF)(void*, PyObject*, int); void (*GIVEREF)(void*, PyObject*, int); void* (*SetupContext)(const char*, int, const char*); void (*FinishContext)(void**); } __Pyx_RefNannyAPIStruct; static __Pyx_RefNannyAPIStruct *__Pyx_RefNanny = NULL; static __Pyx_RefNannyAPIStruct *__Pyx_RefNannyImportAPI(const char *modname); #define __Pyx_RefNannyDeclarations void *__pyx_refnanny = NULL; #ifdef WITH_THREAD #define __Pyx_RefNannySetupContext(name, acquire_gil)\ if (acquire_gil) {\ PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure();\ __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), __LINE__, __FILE__);\ PyGILState_Release(__pyx_gilstate_save);\ } else {\ __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), __LINE__, __FILE__);\ } #else #define __Pyx_RefNannySetupContext(name, acquire_gil)\ __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), __LINE__, __FILE__) #endif #define __Pyx_RefNannyFinishContext()\ __Pyx_RefNanny->FinishContext(&__pyx_refnanny) #define __Pyx_INCREF(r) __Pyx_RefNanny->INCREF(__pyx_refnanny, (PyObject *)(r), __LINE__) #define __Pyx_DECREF(r) __Pyx_RefNanny->DECREF(__pyx_refnanny, (PyObject *)(r), __LINE__) #define __Pyx_GOTREF(r) __Pyx_RefNanny->GOTREF(__pyx_refnanny, (PyObject *)(r), __LINE__) #define __Pyx_GIVEREF(r) __Pyx_RefNanny->GIVEREF(__pyx_refnanny, (PyObject *)(r), __LINE__) #define __Pyx_XINCREF(r) do { if((r) != NULL) {__Pyx_INCREF(r); }} while(0) #define __Pyx_XDECREF(r) do { if((r) != NULL) {__Pyx_DECREF(r); }} while(0) #define __Pyx_XGOTREF(r) do { if((r) != NULL) {__Pyx_GOTREF(r); }} while(0) #define __Pyx_XGIVEREF(r) do { if((r) != NULL) {__Pyx_GIVEREF(r);}} while(0) #else #define __Pyx_RefNannyDeclarations #define __Pyx_RefNannySetupContext(name, acquire_gil) #define __Pyx_RefNannyFinishContext() #define __Pyx_INCREF(r) Py_INCREF(r) #define __Pyx_DECREF(r) Py_DECREF(r) #define __Pyx_GOTREF(r) #define __Pyx_GIVEREF(r) #define __Pyx_XINCREF(r) Py_XINCREF(r) #define __Pyx_XDECREF(r) Py_XDECREF(r) #define __Pyx_XGOTREF(r) #define __Pyx_XGIVEREF(r) #endif #define __Pyx_XDECREF_SET(r, v) do {\ PyObject *tmp = (PyObject *) r;\ r = v; __Pyx_XDECREF(tmp);\ } while (0) #define __Pyx_DECREF_SET(r, v) do {\ PyObject *tmp = (PyObject *) r;\ r = v; __Pyx_DECREF(tmp);\ } while (0) #define __Pyx_CLEAR(r) do { PyObject* tmp = ((PyObject*)(r)); r = NULL; __Pyx_DECREF(tmp);} while(0) #define __Pyx_XCLEAR(r) do { if((r) != NULL) {PyObject* tmp = ((PyObject*)(r)); r = NULL; __Pyx_DECREF(tmp);}} while(0) #if CYTHON_COMPILING_IN_CPYTHON static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStr(PyObject* obj, PyObject* attr_name) { PyTypeObject* tp = Py_TYPE(obj); if (likely(tp->tp_getattro)) return tp->tp_getattro(obj, attr_name); #if PY_MAJOR_VERSION < 3 if (likely(tp->tp_getattr)) return tp->tp_getattr(obj, PyString_AS_STRING(attr_name)); #endif return PyObject_GetAttr(obj, attr_name); } #else #define __Pyx_PyObject_GetAttrStr(o,n) PyObject_GetAttr(o,n) #endif static PyObject *__Pyx_GetBuiltinName(PyObject *name); static void __Pyx_RaiseArgtupleInvalid(const char* func_name, int exact, Py_ssize_t num_min, Py_ssize_t num_max, Py_ssize_t num_found); static void __Pyx_RaiseDoubleKeywordsError(const char* func_name, PyObject* kw_name); static int __Pyx_ParseOptionalKeywords(PyObject *kwds, PyObject **argnames[],\ PyObject *kwds2, PyObject *values[], Py_ssize_t num_pos_args,\ const char* function_name); #if CYTHON_COMPILING_IN_CPYTHON #define __Pyx_PyObject_DelAttrStr(o,n) __Pyx_PyObject_SetAttrStr(o,n,NULL) static CYTHON_INLINE int __Pyx_PyObject_SetAttrStr(PyObject* obj, PyObject* attr_name, PyObject* value) { PyTypeObject* tp = Py_TYPE(obj); if (likely(tp->tp_setattro)) return tp->tp_setattro(obj, attr_name, value); #if PY_MAJOR_VERSION < 3 if (likely(tp->tp_setattr)) return tp->tp_setattr(obj, PyString_AS_STRING(attr_name), value); #endif return PyObject_SetAttr(obj, attr_name, value); } #else #define __Pyx_PyObject_DelAttrStr(o,n) PyObject_DelAttr(o,n) #define __Pyx_PyObject_SetAttrStr(o,n,v) PyObject_SetAttr(o,n,v) #endif #if CYTHON_COMPILING_IN_CPYTHON static CYTHON_INLINE PyObject* __Pyx_PyObject_Call(PyObject *func, PyObject *arg, PyObject *kw); #else #define __Pyx_PyObject_Call(func, arg, kw) PyObject_Call(func, arg, kw) #endif #if CYTHON_COMPILING_IN_CPYTHON static CYTHON_INLINE PyObject* __Pyx_PyObject_CallMethO(PyObject *func, PyObject *arg); #endif static CYTHON_INLINE PyObject* __Pyx_PyObject_CallOneArg(PyObject *func, PyObject *arg); static CYTHON_INLINE PyObject *__Pyx_GetModuleGlobalName(PyObject *name); static CYTHON_INLINE void __Pyx_ExceptionSave(PyObject **type, PyObject **value, PyObject **tb); static void __Pyx_ExceptionReset(PyObject *type, PyObject *value, PyObject *tb); static int __Pyx_GetException(PyObject **type, PyObject **value, PyObject **tb); #if CYTHON_COMPILING_IN_CPYTHON static CYTHON_INLINE PyObject* __Pyx_PyObject_CallNoArg(PyObject *func); #else #define __Pyx_PyObject_CallNoArg(func) __Pyx_PyObject_Call(func, __pyx_empty_tuple, NULL) #endif #include static CYTHON_INLINE PyObject* __Pyx_decode_c_string( const char* cstring, Py_ssize_t start, Py_ssize_t stop, const char* encoding, const char* errors, PyObject* (*decode_func)(const char *s, Py_ssize_t size, const char *errors)); #if CYTHON_COMPILING_IN_CPYTHON static PyObject* __Pyx_PyInt_AddObjC(PyObject *op1, PyObject *op2, long intval, int inplace); #else #define __Pyx_PyInt_AddObjC(op1, op2, intval, inplace)\ (inplace ? PyNumber_InPlaceAdd(op1, op2) : PyNumber_Add(op1, op2)) #endif static CYTHON_INLINE int __Pyx_PySequence_ContainsTF(PyObject* item, PyObject* seq, int eq) { int result = PySequence_Contains(seq, item); return unlikely(result < 0) ? result : (result == (eq == Py_EQ)); } static CYTHON_INLINE void __Pyx_ErrRestore(PyObject *type, PyObject *value, PyObject *tb); static CYTHON_INLINE void __Pyx_ErrFetch(PyObject **type, PyObject **value, PyObject **tb); static void __Pyx_WriteUnraisable(const char *name, int clineno, int lineno, const char *filename, int full_traceback, int nogil); #if CYTHON_COMPILING_IN_CPYTHON static CYTHON_INLINE int __Pyx_PyList_Append(PyObject* list, PyObject* x) { PyListObject* L = (PyListObject*) list; Py_ssize_t len = Py_SIZE(list); if (likely(L->allocated > len) & likely(len > (L->allocated >> 1))) { Py_INCREF(x); PyList_SET_ITEM(list, len, x); Py_SIZE(list) = len+1; return 0; } return PyList_Append(list, x); } #else #define __Pyx_PyList_Append(L,x) PyList_Append(L,x) #endif #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x02070000 static CYTHON_INLINE PyObject* __Pyx_PyObject_LookupSpecial(PyObject* obj, PyObject* attr_name) { PyObject *res; PyTypeObject *tp = Py_TYPE(obj); #if PY_MAJOR_VERSION < 3 if (unlikely(PyInstance_Check(obj))) return __Pyx_PyObject_GetAttrStr(obj, attr_name); #endif res = _PyType_Lookup(tp, attr_name); if (likely(res)) { descrgetfunc f = Py_TYPE(res)->tp_descr_get; if (!f) { Py_INCREF(res); } else { res = f(res, obj, (PyObject *)tp); } } else { PyErr_SetObject(PyExc_AttributeError, attr_name); } return res; } #else #define __Pyx_PyObject_LookupSpecial(o,n) __Pyx_PyObject_GetAttrStr(o,n) #endif static PyObject* __Pyx_PyObject_CallMethod1(PyObject* obj, PyObject* method_name, PyObject* arg); static CYTHON_INLINE int __Pyx_PyObject_Append(PyObject* L, PyObject* x); static CYTHON_INLINE void __Pyx_RaiseUnboundLocalError(const char *varname); static PyObject* __Pyx__PyObject_PopNewIndex(PyObject* L, PyObject* py_ix); static PyObject* __Pyx__PyObject_PopIndex(PyObject* L, PyObject* py_ix); #if CYTHON_COMPILING_IN_CPYTHON static PyObject* __Pyx__PyList_PopIndex(PyObject* L, PyObject* py_ix, Py_ssize_t ix); #define __Pyx_PyObject_PopIndex(L, py_ix, ix, is_signed, type, to_py_func) (\ (likely(PyList_CheckExact(L) && __Pyx_fits_Py_ssize_t(ix, type, is_signed))) ?\ __Pyx__PyList_PopIndex(L, py_ix, ix) : (\ (unlikely(py_ix == Py_None)) ? __Pyx__PyObject_PopNewIndex(L, to_py_func(ix)) :\ __Pyx__PyObject_PopIndex(L, py_ix))) #define __Pyx_PyList_PopIndex(L, py_ix, ix, is_signed, type, to_py_func) (\ __Pyx_fits_Py_ssize_t(ix, type, is_signed) ?\ __Pyx__PyList_PopIndex(L, py_ix, ix) : (\ (unlikely(py_ix == Py_None)) ? __Pyx__PyObject_PopNewIndex(L, to_py_func(ix)) :\ __Pyx__PyObject_PopIndex(L, py_ix))) #else #define __Pyx_PyList_PopIndex(L, py_ix, ix, is_signed, type, to_py_func)\ __Pyx_PyObject_PopIndex(L, py_ix, ix, is_signed, type, to_py_func) #define __Pyx_PyObject_PopIndex(L, py_ix, ix, is_signed, type, to_py_func) (\ (unlikely(py_ix == Py_None)) ? __Pyx__PyObject_PopNewIndex(L, to_py_func(ix)) :\ __Pyx__PyObject_PopIndex(L, py_ix)) #endif #if CYTHON_COMPILING_IN_CPYTHON static CYTHON_INLINE int __Pyx_ListComp_Append(PyObject* list, PyObject* x) { PyListObject* L = (PyListObject*) list; Py_ssize_t len = Py_SIZE(list); if (likely(L->allocated > len)) { Py_INCREF(x); PyList_SET_ITEM(list, len, x); Py_SIZE(list) = len+1; return 0; } return PyList_Append(list, x); } #else #define __Pyx_ListComp_Append(L,x) PyList_Append(L,x) #endif static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, PyObject *cause); #define __Pyx_SetItemInt(o, i, v, type, is_signed, to_py_func, is_list, wraparound, boundscheck)\ (__Pyx_fits_Py_ssize_t(i, type, is_signed) ?\ __Pyx_SetItemInt_Fast(o, (Py_ssize_t)i, v, is_list, wraparound, boundscheck) :\ (is_list ? (PyErr_SetString(PyExc_IndexError, "list assignment index out of range"), -1) :\ __Pyx_SetItemInt_Generic(o, to_py_func(i), v))) static CYTHON_INLINE int __Pyx_SetItemInt_Generic(PyObject *o, PyObject *j, PyObject *v); static CYTHON_INLINE int __Pyx_SetItemInt_Fast(PyObject *o, Py_ssize_t i, PyObject *v, int is_list, int wraparound, int boundscheck); static CYTHON_INLINE PyObject* __Pyx_PyObject_GetSlice( PyObject* obj, Py_ssize_t cstart, Py_ssize_t cstop, PyObject** py_start, PyObject** py_stop, PyObject** py_slice, int has_cstart, int has_cstop, int wraparound); static void* __Pyx_GetVtable(PyObject *dict); static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list, int level); #define __Pyx_GetItemInt(o, i, type, is_signed, to_py_func, is_list, wraparound, boundscheck)\ (__Pyx_fits_Py_ssize_t(i, type, is_signed) ?\ __Pyx_GetItemInt_Fast(o, (Py_ssize_t)i, is_list, wraparound, boundscheck) :\ (is_list ? (PyErr_SetString(PyExc_IndexError, "list index out of range"), (PyObject*)NULL) :\ __Pyx_GetItemInt_Generic(o, to_py_func(i)))) #define __Pyx_GetItemInt_List(o, i, type, is_signed, to_py_func, is_list, wraparound, boundscheck)\ (__Pyx_fits_Py_ssize_t(i, type, is_signed) ?\ __Pyx_GetItemInt_List_Fast(o, (Py_ssize_t)i, wraparound, boundscheck) :\ (PyErr_SetString(PyExc_IndexError, "list index out of range"), (PyObject*)NULL)) static CYTHON_INLINE PyObject *__Pyx_GetItemInt_List_Fast(PyObject *o, Py_ssize_t i, int wraparound, int boundscheck); #define __Pyx_GetItemInt_Tuple(o, i, type, is_signed, to_py_func, is_list, wraparound, boundscheck)\ (__Pyx_fits_Py_ssize_t(i, type, is_signed) ?\ __Pyx_GetItemInt_Tuple_Fast(o, (Py_ssize_t)i, wraparound, boundscheck) :\ (PyErr_SetString(PyExc_IndexError, "tuple index out of range"), (PyObject*)NULL)) static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Tuple_Fast(PyObject *o, Py_ssize_t i, int wraparound, int boundscheck); static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Generic(PyObject *o, PyObject* j); static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Fast(PyObject *o, Py_ssize_t i, int is_list, int wraparound, int boundscheck); static PyObject *__Pyx_CalculateMetaclass(PyTypeObject *metaclass, PyObject *bases); static PyTypeObject* __Pyx_FetchCommonType(PyTypeObject* type); #define __Pyx_CyFunction_USED 1 #include #define __Pyx_CYFUNCTION_STATICMETHOD 0x01 #define __Pyx_CYFUNCTION_CLASSMETHOD 0x02 #define __Pyx_CYFUNCTION_CCLASS 0x04 #define __Pyx_CyFunction_GetClosure(f)\ (((__pyx_CyFunctionObject *) (f))->func_closure) #define __Pyx_CyFunction_GetClassObj(f)\ (((__pyx_CyFunctionObject *) (f))->func_classobj) #define __Pyx_CyFunction_Defaults(type, f)\ ((type *)(((__pyx_CyFunctionObject *) (f))->defaults)) #define __Pyx_CyFunction_SetDefaultsGetter(f, g)\ ((__pyx_CyFunctionObject *) (f))->defaults_getter = (g) typedef struct { PyCFunctionObject func; #if PY_VERSION_HEX < 0x030500A0 PyObject *func_weakreflist; #endif PyObject *func_dict; PyObject *func_name; PyObject *func_qualname; PyObject *func_doc; PyObject *func_globals; PyObject *func_code; PyObject *func_closure; PyObject *func_classobj; void *defaults; int defaults_pyobjects; int flags; PyObject *defaults_tuple; PyObject *defaults_kwdict; PyObject *(*defaults_getter)(PyObject *); PyObject *func_annotations; } __pyx_CyFunctionObject; static PyTypeObject *__pyx_CyFunctionType = 0; #define __Pyx_CyFunction_NewEx(ml, flags, qualname, self, module, globals, code)\ __Pyx_CyFunction_New(__pyx_CyFunctionType, ml, flags, qualname, self, module, globals, code) static PyObject *__Pyx_CyFunction_New(PyTypeObject *, PyMethodDef *ml, int flags, PyObject* qualname, PyObject *self, PyObject *module, PyObject *globals, PyObject* code); static CYTHON_INLINE void *__Pyx_CyFunction_InitDefaults(PyObject *m, size_t size, int pyobjects); static CYTHON_INLINE void __Pyx_CyFunction_SetDefaultsTuple(PyObject *m, PyObject *tuple); static CYTHON_INLINE void __Pyx_CyFunction_SetDefaultsKwDict(PyObject *m, PyObject *dict); static CYTHON_INLINE void __Pyx_CyFunction_SetAnnotationsDict(PyObject *m, PyObject *dict); static int __pyx_CyFunction_init(void); static PyObject *__Pyx_Py3MetaclassPrepare(PyObject *metaclass, PyObject *bases, PyObject *name, PyObject *qualname, PyObject *mkw, PyObject *modname, PyObject *doc); static PyObject *__Pyx_Py3ClassCreate(PyObject *metaclass, PyObject *name, PyObject *bases, PyObject *dict, PyObject *mkw, int calculate_metaclass, int allow_py2_metaclass); typedef struct { int code_line; PyCodeObject* code_object; } __Pyx_CodeObjectCacheEntry; struct __Pyx_CodeObjectCache { int count; int max_count; __Pyx_CodeObjectCacheEntry* entries; }; static struct __Pyx_CodeObjectCache __pyx_code_cache = {0,0,NULL}; static int __pyx_bisect_code_objects(__Pyx_CodeObjectCacheEntry* entries, int count, int code_line); static PyCodeObject *__pyx_find_code_object(int code_line); static void __pyx_insert_code_object(int code_line, PyCodeObject* code_object); static void __Pyx_AddTraceback(const char *funcname, int c_line, int py_line, const char *filename); static CYTHON_INLINE PyObject* __Pyx_PyInt_From_long(long value); static CYTHON_INLINE PyObject* __Pyx_PyInt_From_SDL_EventType(SDL_EventType value); static CYTHON_INLINE PyObject* __Pyx_PyInt_From_SDL_Scancode(SDL_Scancode value); static CYTHON_INLINE PyObject* __Pyx_PyInt_From_int32_t(int32_t value); static CYTHON_INLINE PyObject* __Pyx_PyInt_From_uint16_t(uint16_t value); static CYTHON_INLINE PyObject* __Pyx_PyInt_From_uint8_t(uint8_t value); static CYTHON_INLINE PyObject* __Pyx_PyInt_From_uint32_t(uint32_t value); static CYTHON_INLINE PyObject* __Pyx_PyInt_From_int(int value); static CYTHON_INLINE PyObject* __Pyx_PyInt_From_int16_t(int16_t value); static CYTHON_INLINE PyObject* __Pyx_PyInt_From_int64_t(int64_t value); #ifndef __PYX_FORCE_INIT_THREADS #define __PYX_FORCE_INIT_THREADS 0 #endif static CYTHON_INLINE uint32_t __Pyx_PyInt_As_uint32_t(PyObject *); static CYTHON_INLINE SDL_bool __Pyx_PyInt_As_SDL_bool(PyObject *); static CYTHON_INLINE PyObject* __Pyx_PyInt_From_SDL_bool(SDL_bool value); static CYTHON_INLINE long __Pyx_PyInt_As_long(PyObject *); static CYTHON_INLINE int __Pyx_PyInt_As_int(PyObject *); static int __Pyx_check_binary_version(void); #if !defined(__Pyx_PyIdentifier_FromString) #if PY_MAJOR_VERSION < 3 #define __Pyx_PyIdentifier_FromString(s) PyString_FromString(s) #else #define __Pyx_PyIdentifier_FromString(s) PyUnicode_FromString(s) #endif #endif static PyObject *__Pyx_ImportModule(const char *name); static PyTypeObject *__Pyx_ImportType(const char *module_name, const char *class_name, size_t size, int strict); static int __Pyx_ImportVoidPtr(PyObject *module, const char *name, void **p, const char *sig); static int __Pyx_InitStrings(__Pyx_StringTabEntry *t); /* Module declarations from 'libc.string' */ /* Module declarations from 'libc.stdio' */ /* Module declarations from '__builtin__' */ /* Module declarations from 'cpython.type' */ static PyTypeObject *__pyx_ptype_7cpython_4type_type = 0; /* Module declarations from 'cpython' */ /* Module declarations from 'cpython.object' */ /* Module declarations from 'cpython.ref' */ /* Module declarations from 'libc.stdint' */ /* Module declarations from 'libc.stddef' */ /* Module declarations from 'sdl2' */ /* Module declarations from 'pygame_sdl2.surface' */ static PyTypeObject *__pyx_ptype_11pygame_sdl2_7surface_Surface = 0; /* Module declarations from 'pygame_sdl2.display' */ static PyTypeObject *__pyx_ptype_11pygame_sdl2_7display_Window = 0; static struct __pyx_obj_11pygame_sdl2_7display_Window **__pyx_vp_11pygame_sdl2_7display_main_window = 0; #define __pyx_v_11pygame_sdl2_7display_main_window (*__pyx_vp_11pygame_sdl2_7display_main_window) /* Module declarations from 'pygame_sdl2.event' */ static int __pyx_v_11pygame_sdl2_5event_POSTEDEVENT; static int __pyx_v_11pygame_sdl2_5event_mousewheel_buttons; __PYX_EXTERN_C DL_EXPORT(PyObject) *event_queue; static PyObject *__pyx_f_11pygame_sdl2_5event_get_textinput(void); /*proto*/ static PyObject *__pyx_f_11pygame_sdl2_5event_make_keyboard_event(SDL_KeyboardEvent *); /*proto*/ static PyObject *__pyx_f_11pygame_sdl2_5event_make_mousemotion_event(SDL_MouseMotionEvent *); /*proto*/ static PyObject *__pyx_f_11pygame_sdl2_5event_make_mousebtn_event(SDL_MouseButtonEvent *); /*proto*/ static PyObject *__pyx_f_11pygame_sdl2_5event_make_mousewheel_event(SDL_MouseWheelEvent *); /*proto*/ static PyObject *__pyx_f_11pygame_sdl2_5event_make_joyaxis_event(SDL_JoyAxisEvent *); /*proto*/ static PyObject *__pyx_f_11pygame_sdl2_5event_make_joyball_event(SDL_JoyBallEvent *); /*proto*/ static PyObject *__pyx_f_11pygame_sdl2_5event_make_joyhat_event(SDL_JoyHatEvent *); /*proto*/ static PyObject *__pyx_f_11pygame_sdl2_5event_make_joybtn_event(SDL_JoyButtonEvent *); /*proto*/ static PyObject *__pyx_f_11pygame_sdl2_5event_make_textinput_event(SDL_TextInputEvent *); /*proto*/ static PyObject *__pyx_f_11pygame_sdl2_5event_make_textediting_event(SDL_TextEditingEvent *); /*proto*/ static PyObject *__pyx_f_11pygame_sdl2_5event_make_window_event(SDL_WindowEvent *); /*proto*/ static PyObject *__pyx_f_11pygame_sdl2_5event_make_event(SDL_Event *); /*proto*/ static int __pyx_f_11pygame_sdl2_5event_has_event(PyObject *); /*proto*/ static PyObject *__pyx_f_11pygame_sdl2_5event_get_events(PyObject *); /*proto*/ static int __pyx_f_11pygame_sdl2_5event_poll_sdl(void); /*proto*/ #define __Pyx_MODULE_NAME "pygame_sdl2.event" int __pyx_module_is_main_pygame_sdl2__event = 0; /* Implementation of 'pygame_sdl2.event' */ static PyObject *__pyx_builtin_chr; static PyObject *__pyx_builtin_object; static PyObject *__pyx_builtin_property; static PyObject *__pyx_builtin_KeyError; static char __pyx_k_[] = ""; static char __pyx_k_d[] = "d"; static char __pyx_k_e[] = "e"; static char __pyx_k_h[] = "h"; static char __pyx_k_i[] = "i"; static char __pyx_k_t[] = "t"; static char __pyx_k_w[] = "w"; static char __pyx_k_x[] = "x"; static char __pyx_k_y[] = "y"; static char __pyx_k_dx[] = "dx"; static char __pyx_k_dy[] = "dy"; static char __pyx_k_eq[] = "__eq__"; static char __pyx_k_et[] = "et"; static char __pyx_k_ne[] = "__ne__"; static char __pyx_k_on[] = "on"; static char __pyx_k_rv[] = "rv"; static char __pyx_k_chr[] = "chr"; static char __pyx_k_doc[] = "__doc__"; static char __pyx_k_evt[] = "evt"; static char __pyx_k_get[] = "get"; static char __pyx_k_hat[] = "hat"; static char __pyx_k_joy[] = "joy"; static char __pyx_k_key[] = "key"; static char __pyx_k_mod[] = "mod"; static char __pyx_k_pop[] = "pop"; static char __pyx_k_pos[] = "pos"; static char __pyx_k_rel[] = "rel"; static char __pyx_k_sys[] = "sys"; static char __pyx_k_QUIT[] = "QUIT"; static char __pyx_k_axis[] = "axis"; static char __pyx_k_ball[] = "ball"; static char __pyx_k_code[] = "code"; static char __pyx_k_copy[] = "copy"; static char __pyx_k_dict[] = "dict"; static char __pyx_k_exit[] = "__exit__"; static char __pyx_k_flag[] = "flag"; static char __pyx_k_gain[] = "gain"; static char __pyx_k_init[] = "__init__"; static char __pyx_k_keys[] = "keys"; static char __pyx_k_lock[] = "lock"; static char __pyx_k_main[] = "__main__"; static char __pyx_k_name[] = "name"; static char __pyx_k_peek[] = "peek"; static char __pyx_k_poll[] = "poll"; static char __pyx_k_post[] = "post"; static char __pyx_k_pump[] = "pump"; static char __pyx_k_repr[] = "__repr__"; static char __pyx_k_self[] = "self"; static char __pyx_k_size[] = "size"; static char __pyx_k_test[] = "__test__"; static char __pyx_k_text[] = "text"; static char __pyx_k_type[] = "type"; static char __pyx_k_wait[] = "wait"; static char __pyx_k_Event[] = "Event"; static char __pyx_k_KEYUP[] = "KEYUP"; static char __pyx_k_RLock[] = "RLock"; static char __pyx_k_clear[] = "clear"; static char __pyx_k_dDist[] = "dDist"; static char __pyx_k_data1[] = "data1"; static char __pyx_k_data2[] = "data2"; static char __pyx_k_ename[] = "ename"; static char __pyx_k_enter[] = "__enter__"; static char __pyx_k_error[] = "error"; static char __pyx_k_event[] = "event"; static char __pyx_k_other[] = "other"; static char __pyx_k_start[] = "start"; static char __pyx_k_state[] = "state"; static char __pyx_k_value[] = "value"; static char __pyx_k_which[] = "which"; static char __pyx_k_append[] = "append"; static char __pyx_k_button[] = "button"; static char __pyx_k_dTheta[] = "dTheta"; static char __pyx_k_dict_2[] = "__dict__"; static char __pyx_k_import[] = "__import__"; static char __pyx_k_init_2[] = "init"; static char __pyx_k_insert[] = "insert"; static char __pyx_k_kwargs[] = "kwargs"; static char __pyx_k_length[] = "length"; static char __pyx_k_module[] = "__module__"; static char __pyx_k_object[] = "object"; static char __pyx_k_repeat[] = "repeat"; static char __pyx_k_result[] = "result"; static char __pyx_k_type_2[] = "_type"; static char __pyx_k_unichr[] = "unichr"; static char __pyx_k_update[] = "update"; static char __pyx_k_KEYDOWN[] = "KEYDOWN"; static char __pyx_k_NOEVENT[] = "NOEVENT"; static char __pyx_k_UNKNOWN[] = "UNKNOWN"; static char __pyx_k_buttons[] = "buttons"; static char __pyx_k_display[] = "display"; static char __pyx_k_nonzero[] = "__nonzero__"; static char __pyx_k_prepare[] = "__prepare__"; static char __pyx_k_touchId[] = "touchId"; static char __pyx_k_unicode[] = "unicode"; static char __pyx_k_DROPFILE[] = "DROPFILE"; static char __pyx_k_FINGERUP[] = "FINGERUP"; static char __pyx_k_KeyError[] = "KeyError"; static char __pyx_k_fingerId[] = "fingerId"; static char __pyx_k_get_grab[] = "get_grab"; static char __pyx_k_pressure[] = "pressure"; static char __pyx_k_property[] = "property"; static char __pyx_k_qualname[] = "__qualname__"; static char __pyx_k_register[] = "register"; static char __pyx_k_scancode[] = "scancode"; static char __pyx_k_set_grab[] = "set_grab"; static char __pyx_k_EventType[] = "EventType"; static char __pyx_k_LASTEVENT[] = "LASTEVENT"; static char __pyx_k_TEXTINPUT[] = "TEXTINPUT"; static char __pyx_k_USEREVENT[] = "USEREVENT"; static char __pyx_k_metaclass[] = "__metaclass__"; static char __pyx_k_threading[] = "threading"; static char __pyx_k_FINGERDOWN[] = "FINGERDOWN"; static char __pyx_k_MOUSEWHEEL[] = "MOUSEWHEEL"; static char __pyx_k_SYSWMEVENT[] = "SYSWMEVENT"; static char __pyx_k_event_name[] = "event_name"; static char __pyx_k_numFingers[] = "numFingers"; static char __pyx_k_pyx_vtable[] = "__pyx_vtable__"; static char __pyx_k_text_input[] = "text_input"; static char __pyx_k_ACTIVEEVENT[] = "ACTIVEEVENT"; static char __pyx_k_Event_d_s_s[] = ""; static char __pyx_k_JOYBUTTONUP[] = "JOYBUTTONUP"; static char __pyx_k_MOUSEMOTION[] = "MOUSEMOTION"; static char __pyx_k_TEXTEDITING[] = "TEXTEDITING"; static char __pyx_k_UserEvent_d[] = "UserEvent%d"; static char __pyx_k_VIDEOEXPOSE[] = "VIDEOEXPOSE"; static char __pyx_k_VIDEORESIZE[] = "VIDEORESIZE"; static char __pyx_k_WINDOWEVENT[] = "WINDOWEVENT"; static char __pyx_k_event_names[] = "event_names"; static char __pyx_k_get_blocked[] = "get_blocked"; static char __pyx_k_pygame_sdl2[] = "pygame_sdl2"; static char __pyx_k_set_allowed[] = "set_allowed"; static char __pyx_k_set_blocked[] = "set_blocked"; static char __pyx_k_DOLLARRECORD[] = "DOLLARRECORD"; static char __pyx_k_FINGERMOTION[] = "FINGERMOTION"; static char __pyx_k_JOYHATMOTION[] = "JOYHATMOTION"; static char __pyx_k_MULTIGESTURE[] = "MULTIGESTURE"; static char __pyx_k_version_info[] = "version_info"; static char __pyx_k_APP_LOWMEMORY[] = "APP_LOWMEMORY"; static char __pyx_k_DOLLARGESTURE[] = "DOLLARGESTURE"; static char __pyx_k_JOYAXISMOTION[] = "JOYAXISMOTION"; static char __pyx_k_JOYBALLMOTION[] = "JOYBALLMOTION"; static char __pyx_k_JOYBUTTONDOWN[] = "JOYBUTTONDOWN"; static char __pyx_k_MOUSEBUTTONUP[] = "MOUSEBUTTONUP"; static char __pyx_k_NOEVENT_EVENT[] = "NOEVENT_EVENT"; static char __pyx_k_USEREVENT_MAX[] = "USEREVENT_MAX"; static char __pyx_k_sdl_main_init[] = "sdl_main_init"; static char __pyx_k_EventType___eq[] = "EventType.__eq__"; static char __pyx_k_EventType___ne[] = "EventType.__ne__"; static char __pyx_k_EventType_dict[] = "EventType.dict"; static char __pyx_k_EventType_type[] = "EventType.type"; static char __pyx_k_JOYDEVICEADDED[] = "JOYDEVICEADDED"; static char __pyx_k_APP_TERMINATING[] = "APP_TERMINATING"; static char __pyx_k_CLIPBOARDUPDATE[] = "CLIPBOARDUPDATE"; static char __pyx_k_MOUSEBUTTONDOWN[] = "MOUSEBUTTONDOWN"; static char __pyx_k_EventType___init[] = "EventType.__init__"; static char __pyx_k_EventType___repr[] = "EventType.__repr__"; static char __pyx_k_JOYDEVICEREMOVED[] = "JOYDEVICEREMOVED"; static char __pyx_k_copy_event_queue[] = "copy_event_queue"; static char __pyx_k_pygame_sdl2_event[] = "pygame_sdl2.event"; static char __pyx_k_CONTROLLERBUTTONUP[] = "CONTROLLERBUTTONUP"; static char __pyx_k_EventType___nonzero[] = "EventType.__nonzero__"; static char __pyx_k_get_standard_events[] = "get_standard_events"; static char __pyx_k_CONTROLLERAXISMOTION[] = "CONTROLLERAXISMOTION"; static char __pyx_k_CONTROLLERBUTTONDOWN[] = "CONTROLLERBUTTONDOWN"; static char __pyx_k_RENDER_TARGETS_RESET[] = "RENDER_TARGETS_RESET"; static char __pyx_k_CONTROLLERDEVICEADDED[] = "CONTROLLERDEVICEADDED"; static char __pyx_k_APP_DIDENTERBACKGROUND[] = "APP_DIDENTERBACKGROUND"; static char __pyx_k_APP_DIDENTERFOREGROUND[] = "APP_DIDENTERFOREGROUND"; static char __pyx_k_get_mousewheel_buttons[] = "get_mousewheel_buttons"; static char __pyx_k_set_mousewheel_buttons[] = "set_mousewheel_buttons"; static char __pyx_k_APP_WILLENTERBACKGROUND[] = "APP_WILLENTERBACKGROUND"; static char __pyx_k_APP_WILLENTERFOREGROUND[] = "APP_WILLENTERFOREGROUND"; static char __pyx_k_CONTROLLERDEVICEREMOVED[] = "CONTROLLERDEVICEREMOVED"; static char __pyx_k_CONTROLLERDEVICEREMAPPED[] = "CONTROLLERDEVICEREMAPPED"; static char __pyx_k_home_tom_ab_pygame_sdl2_src_pyg[] = "/home/tom/ab/pygame_sdl2/src/pygame_sdl2/event.pyx"; static char __pyx_k_event_post_must_be_called_with_a[] = "event.post must be called with an Event."; static PyObject *__pyx_kp_s_; static PyObject *__pyx_kp_u_; static PyObject *__pyx_n_s_ACTIVEEVENT; static PyObject *__pyx_n_s_APP_DIDENTERBACKGROUND; static PyObject *__pyx_n_s_APP_DIDENTERFOREGROUND; static PyObject *__pyx_n_s_APP_LOWMEMORY; static PyObject *__pyx_n_s_APP_TERMINATING; static PyObject *__pyx_n_s_APP_WILLENTERBACKGROUND; static PyObject *__pyx_n_s_APP_WILLENTERFOREGROUND; static PyObject *__pyx_n_s_CLIPBOARDUPDATE; static PyObject *__pyx_n_s_CONTROLLERAXISMOTION; static PyObject *__pyx_n_s_CONTROLLERBUTTONDOWN; static PyObject *__pyx_n_s_CONTROLLERBUTTONUP; static PyObject *__pyx_n_s_CONTROLLERDEVICEADDED; static PyObject *__pyx_n_s_CONTROLLERDEVICEREMAPPED; static PyObject *__pyx_n_s_CONTROLLERDEVICEREMOVED; static PyObject *__pyx_n_s_DOLLARGESTURE; static PyObject *__pyx_n_s_DOLLARRECORD; static PyObject *__pyx_n_s_DROPFILE; static PyObject *__pyx_n_s_Event; static PyObject *__pyx_n_s_EventType; static PyObject *__pyx_n_s_EventType___eq; static PyObject *__pyx_n_s_EventType___init; static PyObject *__pyx_n_s_EventType___ne; static PyObject *__pyx_n_s_EventType___nonzero; static PyObject *__pyx_n_s_EventType___repr; static PyObject *__pyx_n_s_EventType_dict; static PyObject *__pyx_n_s_EventType_type; static PyObject *__pyx_kp_s_Event_d_s_s; static PyObject *__pyx_n_s_FINGERDOWN; static PyObject *__pyx_n_s_FINGERMOTION; static PyObject *__pyx_n_s_FINGERUP; static PyObject *__pyx_n_s_JOYAXISMOTION; static PyObject *__pyx_n_s_JOYBALLMOTION; static PyObject *__pyx_n_s_JOYBUTTONDOWN; static PyObject *__pyx_n_s_JOYBUTTONUP; static PyObject *__pyx_n_s_JOYDEVICEADDED; static PyObject *__pyx_n_s_JOYDEVICEREMOVED; static PyObject *__pyx_n_s_JOYHATMOTION; static PyObject *__pyx_n_s_KEYDOWN; static PyObject *__pyx_n_s_KEYUP; static PyObject *__pyx_n_s_KeyError; static PyObject *__pyx_n_s_LASTEVENT; static PyObject *__pyx_n_s_MOUSEBUTTONDOWN; static PyObject *__pyx_n_s_MOUSEBUTTONUP; static PyObject *__pyx_n_s_MOUSEMOTION; static PyObject *__pyx_n_s_MOUSEWHEEL; static PyObject *__pyx_n_s_MULTIGESTURE; static PyObject *__pyx_n_u_NOEVENT; static PyObject *__pyx_n_s_NOEVENT_EVENT; static PyObject *__pyx_n_s_QUIT; static PyObject *__pyx_n_s_RENDER_TARGETS_RESET; static PyObject *__pyx_n_s_RLock; static PyObject *__pyx_n_s_SYSWMEVENT; static PyObject *__pyx_n_s_TEXTEDITING; static PyObject *__pyx_n_s_TEXTINPUT; static PyObject *__pyx_n_s_UNKNOWN; static PyObject *__pyx_n_s_USEREVENT; static PyObject *__pyx_n_s_USEREVENT_MAX; static PyObject *__pyx_kp_s_UserEvent_d; static PyObject *__pyx_n_s_VIDEOEXPOSE; static PyObject *__pyx_n_s_VIDEORESIZE; static PyObject *__pyx_n_s_WINDOWEVENT; static PyObject *__pyx_n_s_append; static PyObject *__pyx_n_s_axis; static PyObject *__pyx_n_s_ball; static PyObject *__pyx_n_s_button; static PyObject *__pyx_n_s_buttons; static PyObject *__pyx_n_s_chr; static PyObject *__pyx_n_s_clear; static PyObject *__pyx_n_s_code; static PyObject *__pyx_n_s_copy; static PyObject *__pyx_n_s_copy_event_queue; static PyObject *__pyx_n_s_d; static PyObject *__pyx_n_s_dDist; static PyObject *__pyx_n_s_dTheta; static PyObject *__pyx_n_s_data1; static PyObject *__pyx_n_s_data2; static PyObject *__pyx_n_s_dict; static PyObject *__pyx_n_s_dict_2; static PyObject *__pyx_n_s_display; static PyObject *__pyx_n_s_doc; static PyObject *__pyx_n_s_dx; static PyObject *__pyx_n_s_dy; static PyObject *__pyx_n_s_e; static PyObject *__pyx_n_s_ename; static PyObject *__pyx_n_s_enter; static PyObject *__pyx_n_s_eq; static PyObject *__pyx_n_s_error; static PyObject *__pyx_n_s_et; static PyObject *__pyx_n_s_event; static PyObject *__pyx_n_s_event_name; static PyObject *__pyx_n_s_event_names; static PyObject *__pyx_kp_s_event_post_must_be_called_with_a; static PyObject *__pyx_n_s_evt; static PyObject *__pyx_n_s_exit; static PyObject *__pyx_n_s_fingerId; static PyObject *__pyx_n_s_flag; static PyObject *__pyx_n_s_gain; static PyObject *__pyx_n_s_get; static PyObject *__pyx_n_s_get_blocked; static PyObject *__pyx_n_s_get_grab; static PyObject *__pyx_n_s_get_mousewheel_buttons; static PyObject *__pyx_n_s_get_standard_events; static PyObject *__pyx_n_s_h; static PyObject *__pyx_n_s_hat; static PyObject *__pyx_kp_s_home_tom_ab_pygame_sdl2_src_pyg; static PyObject *__pyx_n_s_i; static PyObject *__pyx_n_s_import; static PyObject *__pyx_n_s_init; static PyObject *__pyx_n_s_init_2; static PyObject *__pyx_n_s_insert; static PyObject *__pyx_n_s_joy; static PyObject *__pyx_n_s_key; static PyObject *__pyx_n_s_keys; static PyObject *__pyx_n_s_kwargs; static PyObject *__pyx_n_s_length; static PyObject *__pyx_n_s_lock; static PyObject *__pyx_n_s_main; static PyObject *__pyx_n_s_metaclass; static PyObject *__pyx_n_s_mod; static PyObject *__pyx_n_s_module; static PyObject *__pyx_n_s_name; static PyObject *__pyx_n_s_ne; static PyObject *__pyx_n_s_nonzero; static PyObject *__pyx_n_s_numFingers; static PyObject *__pyx_n_s_object; static PyObject *__pyx_n_s_on; static PyObject *__pyx_n_s_other; static PyObject *__pyx_n_s_peek; static PyObject *__pyx_n_s_poll; static PyObject *__pyx_n_s_pop; static PyObject *__pyx_n_s_pos; static PyObject *__pyx_n_s_post; static PyObject *__pyx_n_s_prepare; static PyObject *__pyx_n_s_pressure; static PyObject *__pyx_n_s_property; static PyObject *__pyx_n_s_pump; static PyObject *__pyx_n_s_pygame_sdl2; static PyObject *__pyx_n_s_pygame_sdl2_event; static PyObject *__pyx_n_s_pyx_vtable; static PyObject *__pyx_n_s_qualname; static PyObject *__pyx_n_s_register; static PyObject *__pyx_n_s_rel; static PyObject *__pyx_n_s_repeat; static PyObject *__pyx_n_s_repr; static PyObject *__pyx_n_s_result; static PyObject *__pyx_n_s_rv; static PyObject *__pyx_n_s_scancode; static PyObject *__pyx_n_s_sdl_main_init; static PyObject *__pyx_n_s_self; static PyObject *__pyx_n_s_set_allowed; static PyObject *__pyx_n_s_set_blocked; static PyObject *__pyx_n_s_set_grab; static PyObject *__pyx_n_s_set_mousewheel_buttons; static PyObject *__pyx_n_s_size; static PyObject *__pyx_n_s_start; static PyObject *__pyx_n_s_state; static PyObject *__pyx_n_s_sys; static PyObject *__pyx_n_s_t; static PyObject *__pyx_n_s_test; static PyObject *__pyx_n_s_text; static PyObject *__pyx_n_s_text_input; static PyObject *__pyx_n_s_threading; static PyObject *__pyx_n_s_touchId; static PyObject *__pyx_n_s_type; static PyObject *__pyx_n_s_type_2; static PyObject *__pyx_n_s_unichr; static PyObject *__pyx_n_s_unicode; static PyObject *__pyx_n_s_update; static PyObject *__pyx_n_s_value; static PyObject *__pyx_n_s_version_info; static PyObject *__pyx_n_s_w; static PyObject *__pyx_n_s_wait; static PyObject *__pyx_n_s_which; static PyObject *__pyx_n_s_x; static PyObject *__pyx_n_s_y; static PyObject *__pyx_pf_11pygame_sdl2_5event_9EventType___init__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_type, PyObject *__pyx_v_dict, PyObject *__pyx_v_kwargs); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_5event_9EventType_2__repr__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_5event_9EventType_4dict(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_5event_9EventType_6type(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_5event_9EventType_8__eq__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_other); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_5event_9EventType_10__ne__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_other); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_5event_9EventType_12__nonzero__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_5event_pump(CYTHON_UNUSED PyObject *__pyx_self); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_5event_2get(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_t); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_5event_4poll(CYTHON_UNUSED PyObject *__pyx_self); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_5event_6wait(CYTHON_UNUSED PyObject *__pyx_self); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_5event_8peek(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_t); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_5event_10clear(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_t); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_5event_12get_standard_events(CYTHON_UNUSED PyObject *__pyx_self); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_5event_14event_name(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_t); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_5event_16set_blocked(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_t); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_5event_18set_allowed(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_t); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_5event_20get_blocked(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_t); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_5event_22set_grab(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_on); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_5event_24get_grab(CYTHON_UNUSED PyObject *__pyx_self); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_5event_26set_mousewheel_buttons(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_flag); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_5event_28get_mousewheel_buttons(CYTHON_UNUSED PyObject *__pyx_self); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_5event_30post(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_e); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_5event_32register(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_name); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_5event_34copy_event_queue(CYTHON_UNUSED PyObject *__pyx_self); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_5event_36init(CYTHON_UNUSED PyObject *__pyx_self); /* proto */ static PyObject *__pyx_int_0; static PyObject *__pyx_int_1; static PyObject *__pyx_int_2; static PyObject *__pyx_int_3; static PyObject *__pyx_int_4; static PyObject *__pyx_tuple__2; static PyObject *__pyx_tuple__3; static PyObject *__pyx_tuple__4; static PyObject *__pyx_tuple__5; static PyObject *__pyx_tuple__6; static PyObject *__pyx_tuple__7; static PyObject *__pyx_tuple__8; static PyObject *__pyx_tuple__9; static PyObject *__pyx_slice__13; static PyObject *__pyx_tuple__10; static PyObject *__pyx_tuple__11; static PyObject *__pyx_tuple__12; static PyObject *__pyx_tuple__14; static PyObject *__pyx_tuple__16; static PyObject *__pyx_tuple__17; static PyObject *__pyx_tuple__19; static PyObject *__pyx_tuple__21; static PyObject *__pyx_tuple__23; static PyObject *__pyx_tuple__25; static PyObject *__pyx_tuple__27; static PyObject *__pyx_tuple__29; static PyObject *__pyx_tuple__31; static PyObject *__pyx_tuple__34; static PyObject *__pyx_tuple__36; static PyObject *__pyx_tuple__38; static PyObject *__pyx_tuple__40; static PyObject *__pyx_tuple__42; static PyObject *__pyx_tuple__44; static PyObject *__pyx_tuple__46; static PyObject *__pyx_tuple__48; static PyObject *__pyx_tuple__50; static PyObject *__pyx_tuple__53; static PyObject *__pyx_tuple__56; static PyObject *__pyx_tuple__58; static PyObject *__pyx_codeobj__15; static PyObject *__pyx_codeobj__18; static PyObject *__pyx_codeobj__20; static PyObject *__pyx_codeobj__22; static PyObject *__pyx_codeobj__24; static PyObject *__pyx_codeobj__26; static PyObject *__pyx_codeobj__28; static PyObject *__pyx_codeobj__30; static PyObject *__pyx_codeobj__32; static PyObject *__pyx_codeobj__33; static PyObject *__pyx_codeobj__35; static PyObject *__pyx_codeobj__37; static PyObject *__pyx_codeobj__39; static PyObject *__pyx_codeobj__41; static PyObject *__pyx_codeobj__43; static PyObject *__pyx_codeobj__45; static PyObject *__pyx_codeobj__47; static PyObject *__pyx_codeobj__49; static PyObject *__pyx_codeobj__51; static PyObject *__pyx_codeobj__52; static PyObject *__pyx_codeobj__54; static PyObject *__pyx_codeobj__55; static PyObject *__pyx_codeobj__57; static PyObject *__pyx_codeobj__59; static PyObject *__pyx_codeobj__60; static PyObject *__pyx_codeobj__61; PyObject *event_queue = 0; /* "pygame_sdl2/event.pyx":57 * class EventType(object): * * def __init__(self, type, dict=None, **kwargs): # <<<<<<<<<<<<<< * self._type = type * */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_5event_9EventType_1__init__(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static PyMethodDef __pyx_mdef_11pygame_sdl2_5event_9EventType_1__init__ = {"__init__", (PyCFunction)__pyx_pw_11pygame_sdl2_5event_9EventType_1__init__, METH_VARARGS|METH_KEYWORDS, 0}; static PyObject *__pyx_pw_11pygame_sdl2_5event_9EventType_1__init__(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_self = 0; PyObject *__pyx_v_type = 0; PyObject *__pyx_v_dict = 0; PyObject *__pyx_v_kwargs = 0; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__init__ (wrapper)", 0); __pyx_v_kwargs = PyDict_New(); if (unlikely(!__pyx_v_kwargs)) return NULL; __Pyx_GOTREF(__pyx_v_kwargs); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_type,&__pyx_n_s_dict,0}; PyObject* values[3] = {0,0,0}; values[2] = ((PyObject *)((PyObject *)Py_None)); if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_self)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; case 1: if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_type)) != 0)) kw_args--; else { __Pyx_RaiseArgtupleInvalid("__init__", 0, 2, 3, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 57; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } case 2: if (kw_args > 0) { PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_dict); if (value) { values[2] = value; kw_args--; } } } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, __pyx_v_kwargs, values, pos_args, "__init__") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 57; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } } else { switch (PyTuple_GET_SIZE(__pyx_args)) { case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); values[0] = PyTuple_GET_ITEM(__pyx_args, 0); break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_self = values[0]; __pyx_v_type = values[1]; __pyx_v_dict = values[2]; } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("__init__", 0, 2, 3, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 57; __pyx_clineno = __LINE__; goto __pyx_L3_error;} __pyx_L3_error:; __Pyx_DECREF(__pyx_v_kwargs); __pyx_v_kwargs = 0; __Pyx_AddTraceback("pygame_sdl2.event.EventType.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_11pygame_sdl2_5event_9EventType___init__(__pyx_self, __pyx_v_self, __pyx_v_type, __pyx_v_dict, __pyx_v_kwargs); /* function exit code */ __Pyx_XDECREF(__pyx_v_kwargs); __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_5event_9EventType___init__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_type, PyObject *__pyx_v_dict, PyObject *__pyx_v_kwargs) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; PyObject *__pyx_t_5 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__init__", 0); /* "pygame_sdl2/event.pyx":58 * * def __init__(self, type, dict=None, **kwargs): * self._type = type # <<<<<<<<<<<<<< * * if dict: */ if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_type_2, __pyx_v_type) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 58; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "pygame_sdl2/event.pyx":60 * self._type = type * * if dict: # <<<<<<<<<<<<<< * self.__dict__.update(dict) * */ __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_dict); if (unlikely(__pyx_t_1 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 60; __pyx_clineno = __LINE__; goto __pyx_L1_error;} if (__pyx_t_1) { /* "pygame_sdl2/event.pyx":61 * * if dict: * self.__dict__.update(dict) # <<<<<<<<<<<<<< * * self.__dict__.update(kwargs) */ __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_dict_2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 61; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_update); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 61; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_3 = NULL; if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_4))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_4); if (likely(__pyx_t_3)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_4, function); } } if (!__pyx_t_3) { __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_v_dict); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 61; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); } else { __pyx_t_5 = PyTuple_New(1+1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 61; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_3); __pyx_t_3 = NULL; __Pyx_INCREF(__pyx_v_dict); __Pyx_GIVEREF(__pyx_v_dict); PyTuple_SET_ITEM(__pyx_t_5, 0+1, __pyx_v_dict); __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_5, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 61; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; } __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "pygame_sdl2/event.pyx":60 * self._type = type * * if dict: # <<<<<<<<<<<<<< * self.__dict__.update(dict) * */ } /* "pygame_sdl2/event.pyx":63 * self.__dict__.update(dict) * * self.__dict__.update(kwargs) # <<<<<<<<<<<<<< * * def __repr__(self): */ __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_dict_2); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 63; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_update); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 63; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_t_4 = NULL; if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_5))) { __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_5); if (likely(__pyx_t_4)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5); __Pyx_INCREF(__pyx_t_4); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_5, function); } } if (!__pyx_t_4) { __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_v_kwargs); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 63; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); } else { __pyx_t_3 = PyTuple_New(1+1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 63; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_4); __pyx_t_4 = NULL; __Pyx_INCREF(__pyx_v_kwargs); __Pyx_GIVEREF(__pyx_v_kwargs); PyTuple_SET_ITEM(__pyx_t_3, 0+1, __pyx_v_kwargs); __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_3, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 63; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "pygame_sdl2/event.pyx":57 * class EventType(object): * * def __init__(self, type, dict=None, **kwargs): # <<<<<<<<<<<<<< * self._type = type * */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_5); __Pyx_AddTraceback("pygame_sdl2.event.EventType.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/event.pyx":65 * self.__dict__.update(kwargs) * * def __repr__(self): # <<<<<<<<<<<<<< * if SDL_USEREVENT <= self.type < VIDEOEXPOSE: * ename = "UserEvent%d" % (self.type - SDL_USEREVENT) */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_5event_9EventType_3__repr__(PyObject *__pyx_self, PyObject *__pyx_v_self); /*proto*/ static PyMethodDef __pyx_mdef_11pygame_sdl2_5event_9EventType_3__repr__ = {"__repr__", (PyCFunction)__pyx_pw_11pygame_sdl2_5event_9EventType_3__repr__, METH_O, 0}; static PyObject *__pyx_pw_11pygame_sdl2_5event_9EventType_3__repr__(PyObject *__pyx_self, PyObject *__pyx_v_self) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__repr__ (wrapper)", 0); __pyx_r = __pyx_pf_11pygame_sdl2_5event_9EventType_2__repr__(__pyx_self, ((PyObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_5event_9EventType_2__repr__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self) { PyObject *__pyx_v_ename = NULL; PyObject *__pyx_v_d = NULL; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; int __pyx_t_5; PyObject *__pyx_t_6 = NULL; PyObject *__pyx_t_7 = NULL; PyObject *__pyx_t_8 = NULL; int __pyx_t_9; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__repr__", 0); /* "pygame_sdl2/event.pyx":66 * * def __repr__(self): * if SDL_USEREVENT <= self.type < VIDEOEXPOSE: # <<<<<<<<<<<<<< * ename = "UserEvent%d" % (self.type - SDL_USEREVENT) * else: */ __pyx_t_1 = __Pyx_PyInt_From_SDL_EventType(SDL_USEREVENT); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 66; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_type); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 66; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = PyObject_RichCompare(__pyx_t_1, __pyx_t_2, Py_LE); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 66; __pyx_clineno = __LINE__; goto __pyx_L1_error;} if (__Pyx_PyObject_IsTrue(__pyx_t_3)) { __Pyx_DECREF(__pyx_t_3); __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_VIDEOEXPOSE); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 66; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); __pyx_t_3 = PyObject_RichCompare(__pyx_t_2, __pyx_t_4, Py_LT); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 66; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_5 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 66; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; if (__pyx_t_5) { /* "pygame_sdl2/event.pyx":67 * def __repr__(self): * if SDL_USEREVENT <= self.type < VIDEOEXPOSE: * ename = "UserEvent%d" % (self.type - SDL_USEREVENT) # <<<<<<<<<<<<<< * else: * try: */ __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_type); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 67; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __pyx_t_2 = __Pyx_PyInt_From_SDL_EventType(SDL_USEREVENT); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 67; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __pyx_t_1 = PyNumber_Subtract(__pyx_t_3, __pyx_t_2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 67; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_2 = __Pyx_PyString_Format(__pyx_kp_s_UserEvent_d, __pyx_t_1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 67; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_v_ename = __pyx_t_2; __pyx_t_2 = 0; /* "pygame_sdl2/event.pyx":66 * * def __repr__(self): * if SDL_USEREVENT <= self.type < VIDEOEXPOSE: # <<<<<<<<<<<<<< * ename = "UserEvent%d" % (self.type - SDL_USEREVENT) * else: */ goto __pyx_L3; } /* "pygame_sdl2/event.pyx":69 * ename = "UserEvent%d" % (self.type - SDL_USEREVENT) * else: * try: # <<<<<<<<<<<<<< * ename = event_names[self.type] * except KeyError: */ /*else*/ { { __Pyx_ExceptionSave(&__pyx_t_6, &__pyx_t_7, &__pyx_t_8); __Pyx_XGOTREF(__pyx_t_6); __Pyx_XGOTREF(__pyx_t_7); __Pyx_XGOTREF(__pyx_t_8); /*try:*/ { /* "pygame_sdl2/event.pyx":70 * else: * try: * ename = event_names[self.type] # <<<<<<<<<<<<<< * except KeyError: * ename = "UNKNOWN" */ __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_event_names); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 70; __pyx_clineno = __LINE__; goto __pyx_L4_error;} __Pyx_GOTREF(__pyx_t_2); __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_type); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 70; __pyx_clineno = __LINE__; goto __pyx_L4_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_t_3 = PyObject_GetItem(__pyx_t_2, __pyx_t_1); if (unlikely(__pyx_t_3 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 70; __pyx_clineno = __LINE__; goto __pyx_L4_error;}; __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_v_ename = __pyx_t_3; __pyx_t_3 = 0; /* "pygame_sdl2/event.pyx":69 * ename = "UserEvent%d" % (self.type - SDL_USEREVENT) * else: * try: # <<<<<<<<<<<<<< * ename = event_names[self.type] * except KeyError: */ } __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0; goto __pyx_L11_try_end; __pyx_L4_error:; __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; /* "pygame_sdl2/event.pyx":71 * try: * ename = event_names[self.type] * except KeyError: # <<<<<<<<<<<<<< * ename = "UNKNOWN" * */ __pyx_t_9 = PyErr_ExceptionMatches(__pyx_builtin_KeyError); if (__pyx_t_9) { __Pyx_AddTraceback("pygame_sdl2.event.EventType.__repr__", __pyx_clineno, __pyx_lineno, __pyx_filename); if (__Pyx_GetException(&__pyx_t_3, &__pyx_t_1, &__pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 71; __pyx_clineno = __LINE__; goto __pyx_L6_except_error;} __Pyx_GOTREF(__pyx_t_3); __Pyx_GOTREF(__pyx_t_1); __Pyx_GOTREF(__pyx_t_2); /* "pygame_sdl2/event.pyx":72 * ename = event_names[self.type] * except KeyError: * ename = "UNKNOWN" # <<<<<<<<<<<<<< * * d = self.__dict__.copy() */ __Pyx_INCREF(__pyx_n_s_UNKNOWN); __Pyx_XDECREF_SET(__pyx_v_ename, __pyx_n_s_UNKNOWN); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; goto __pyx_L5_exception_handled; } goto __pyx_L6_except_error; __pyx_L6_except_error:; /* "pygame_sdl2/event.pyx":69 * ename = "UserEvent%d" % (self.type - SDL_USEREVENT) * else: * try: # <<<<<<<<<<<<<< * ename = event_names[self.type] * except KeyError: */ __Pyx_XGIVEREF(__pyx_t_6); __Pyx_XGIVEREF(__pyx_t_7); __Pyx_XGIVEREF(__pyx_t_8); __Pyx_ExceptionReset(__pyx_t_6, __pyx_t_7, __pyx_t_8); goto __pyx_L1_error; __pyx_L5_exception_handled:; __Pyx_XGIVEREF(__pyx_t_6); __Pyx_XGIVEREF(__pyx_t_7); __Pyx_XGIVEREF(__pyx_t_8); __Pyx_ExceptionReset(__pyx_t_6, __pyx_t_7, __pyx_t_8); __pyx_L11_try_end:; } } __pyx_L3:; /* "pygame_sdl2/event.pyx":74 * ename = "UNKNOWN" * * d = self.__dict__.copy() # <<<<<<<<<<<<<< * del d['_type'] * return '' % (self.type, ename, d) */ __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_dict_2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 74; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_copy); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 74; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_1 = NULL; if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_3))) { __pyx_t_1 = PyMethod_GET_SELF(__pyx_t_3); if (likely(__pyx_t_1)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); __Pyx_INCREF(__pyx_t_1); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_3, function); } } if (__pyx_t_1) { __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 74; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; } else { __pyx_t_2 = __Pyx_PyObject_CallNoArg(__pyx_t_3); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 74; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_v_d = __pyx_t_2; __pyx_t_2 = 0; /* "pygame_sdl2/event.pyx":75 * * d = self.__dict__.copy() * del d['_type'] # <<<<<<<<<<<<<< * return '' % (self.type, ename, d) * */ if (PyObject_DelItem(__pyx_v_d, __pyx_n_s_type_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 75; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "pygame_sdl2/event.pyx":76 * d = self.__dict__.copy() * del d['_type'] * return '' % (self.type, ename, d) # <<<<<<<<<<<<<< * * @property */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_type); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 76; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = PyTuple_New(3); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 76; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __Pyx_GIVEREF(__pyx_t_2); PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_2); __Pyx_INCREF(__pyx_v_ename); __Pyx_GIVEREF(__pyx_v_ename); PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_v_ename); __Pyx_INCREF(__pyx_v_d); __Pyx_GIVEREF(__pyx_v_d); PyTuple_SET_ITEM(__pyx_t_3, 2, __pyx_v_d); __pyx_t_2 = 0; __pyx_t_2 = __Pyx_PyString_Format(__pyx_kp_s_Event_d_s_s, __pyx_t_3); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 76; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; /* "pygame_sdl2/event.pyx":65 * self.__dict__.update(kwargs) * * def __repr__(self): # <<<<<<<<<<<<<< * if SDL_USEREVENT <= self.type < VIDEOEXPOSE: * ename = "UserEvent%d" % (self.type - SDL_USEREVENT) */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_AddTraceback("pygame_sdl2.event.EventType.__repr__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF(__pyx_v_ename); __Pyx_XDECREF(__pyx_v_d); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/event.pyx":79 * * @property * def dict(self): # <<<<<<<<<<<<<< * return self.__dict__ * */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_5event_9EventType_5dict(PyObject *__pyx_self, PyObject *__pyx_v_self); /*proto*/ static PyMethodDef __pyx_mdef_11pygame_sdl2_5event_9EventType_5dict = {"dict", (PyCFunction)__pyx_pw_11pygame_sdl2_5event_9EventType_5dict, METH_O, 0}; static PyObject *__pyx_pw_11pygame_sdl2_5event_9EventType_5dict(PyObject *__pyx_self, PyObject *__pyx_v_self) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("dict (wrapper)", 0); __pyx_r = __pyx_pf_11pygame_sdl2_5event_9EventType_4dict(__pyx_self, ((PyObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_5event_9EventType_4dict(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("dict", 0); /* "pygame_sdl2/event.pyx":80 * @property * def dict(self): * return self.__dict__ # <<<<<<<<<<<<<< * * @property */ __Pyx_XDECREF(__pyx_r); __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_dict_2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 80; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "pygame_sdl2/event.pyx":79 * * @property * def dict(self): # <<<<<<<<<<<<<< * return self.__dict__ * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("pygame_sdl2.event.EventType.dict", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/event.pyx":83 * * @property * def type(self): # <<<<<<<<<<<<<< * return self._type * */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_5event_9EventType_7type(PyObject *__pyx_self, PyObject *__pyx_v_self); /*proto*/ static PyMethodDef __pyx_mdef_11pygame_sdl2_5event_9EventType_7type = {"type", (PyCFunction)__pyx_pw_11pygame_sdl2_5event_9EventType_7type, METH_O, 0}; static PyObject *__pyx_pw_11pygame_sdl2_5event_9EventType_7type(PyObject *__pyx_self, PyObject *__pyx_v_self) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("type (wrapper)", 0); __pyx_r = __pyx_pf_11pygame_sdl2_5event_9EventType_6type(__pyx_self, ((PyObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_5event_9EventType_6type(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("type", 0); /* "pygame_sdl2/event.pyx":84 * @property * def type(self): * return self._type # <<<<<<<<<<<<<< * * def __eq__(self, other): */ __Pyx_XDECREF(__pyx_r); __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_type_2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 84; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "pygame_sdl2/event.pyx":83 * * @property * def type(self): # <<<<<<<<<<<<<< * return self._type * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("pygame_sdl2.event.EventType.type", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/event.pyx":86 * return self._type * * def __eq__(self, other): # <<<<<<<<<<<<<< * return self.__dict__ == other.__dict__ * */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_5event_9EventType_9__eq__(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static PyMethodDef __pyx_mdef_11pygame_sdl2_5event_9EventType_9__eq__ = {"__eq__", (PyCFunction)__pyx_pw_11pygame_sdl2_5event_9EventType_9__eq__, METH_VARARGS|METH_KEYWORDS, 0}; static PyObject *__pyx_pw_11pygame_sdl2_5event_9EventType_9__eq__(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_self = 0; PyObject *__pyx_v_other = 0; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__eq__ (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_other,0}; PyObject* values[2] = {0,0}; if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_self)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; case 1: if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_other)) != 0)) kw_args--; else { __Pyx_RaiseArgtupleInvalid("__eq__", 1, 2, 2, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 86; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__eq__") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 86; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } } else if (PyTuple_GET_SIZE(__pyx_args) != 2) { goto __pyx_L5_argtuple_error; } else { values[0] = PyTuple_GET_ITEM(__pyx_args, 0); values[1] = PyTuple_GET_ITEM(__pyx_args, 1); } __pyx_v_self = values[0]; __pyx_v_other = values[1]; } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("__eq__", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 86; __pyx_clineno = __LINE__; goto __pyx_L3_error;} __pyx_L3_error:; __Pyx_AddTraceback("pygame_sdl2.event.EventType.__eq__", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_11pygame_sdl2_5event_9EventType_8__eq__(__pyx_self, __pyx_v_self, __pyx_v_other); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_5event_9EventType_8__eq__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_other) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__eq__", 0); /* "pygame_sdl2/event.pyx":87 * * def __eq__(self, other): * return self.__dict__ == other.__dict__ # <<<<<<<<<<<<<< * * def __ne__(self, other): */ __Pyx_XDECREF(__pyx_r); __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_dict_2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 87; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_other, __pyx_n_s_dict_2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 87; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = PyObject_RichCompare(__pyx_t_1, __pyx_t_2, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 87; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_r = __pyx_t_3; __pyx_t_3 = 0; goto __pyx_L0; /* "pygame_sdl2/event.pyx":86 * return self._type * * def __eq__(self, other): # <<<<<<<<<<<<<< * return self.__dict__ == other.__dict__ * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("pygame_sdl2.event.EventType.__eq__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/event.pyx":89 * return self.__dict__ == other.__dict__ * * def __ne__(self, other): # <<<<<<<<<<<<<< * return not (self == other) * */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_5event_9EventType_11__ne__(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static PyMethodDef __pyx_mdef_11pygame_sdl2_5event_9EventType_11__ne__ = {"__ne__", (PyCFunction)__pyx_pw_11pygame_sdl2_5event_9EventType_11__ne__, METH_VARARGS|METH_KEYWORDS, 0}; static PyObject *__pyx_pw_11pygame_sdl2_5event_9EventType_11__ne__(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_self = 0; PyObject *__pyx_v_other = 0; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__ne__ (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_other,0}; PyObject* values[2] = {0,0}; if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_self)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; case 1: if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_other)) != 0)) kw_args--; else { __Pyx_RaiseArgtupleInvalid("__ne__", 1, 2, 2, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 89; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__ne__") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 89; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } } else if (PyTuple_GET_SIZE(__pyx_args) != 2) { goto __pyx_L5_argtuple_error; } else { values[0] = PyTuple_GET_ITEM(__pyx_args, 0); values[1] = PyTuple_GET_ITEM(__pyx_args, 1); } __pyx_v_self = values[0]; __pyx_v_other = values[1]; } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("__ne__", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 89; __pyx_clineno = __LINE__; goto __pyx_L3_error;} __pyx_L3_error:; __Pyx_AddTraceback("pygame_sdl2.event.EventType.__ne__", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_11pygame_sdl2_5event_9EventType_10__ne__(__pyx_self, __pyx_v_self, __pyx_v_other); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_5event_9EventType_10__ne__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_other) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_t_2; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__ne__", 0); /* "pygame_sdl2/event.pyx":90 * * def __ne__(self, other): * return not (self == other) # <<<<<<<<<<<<<< * * def __nonzero__(self): */ __Pyx_XDECREF(__pyx_r); __pyx_t_1 = PyObject_RichCompare(__pyx_v_self, __pyx_v_other, Py_EQ); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 90; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 90; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_1 = __Pyx_PyBool_FromLong((!__pyx_t_2)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 90; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "pygame_sdl2/event.pyx":89 * return self.__dict__ == other.__dict__ * * def __ne__(self, other): # <<<<<<<<<<<<<< * return not (self == other) * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("pygame_sdl2.event.EventType.__ne__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/event.pyx":92 * return not (self == other) * * def __nonzero__(self): # <<<<<<<<<<<<<< * return self.type != 0 * */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_5event_9EventType_13__nonzero__(PyObject *__pyx_self, PyObject *__pyx_v_self); /*proto*/ static PyMethodDef __pyx_mdef_11pygame_sdl2_5event_9EventType_13__nonzero__ = {"__nonzero__", (PyCFunction)__pyx_pw_11pygame_sdl2_5event_9EventType_13__nonzero__, METH_O, 0}; static PyObject *__pyx_pw_11pygame_sdl2_5event_9EventType_13__nonzero__(PyObject *__pyx_self, PyObject *__pyx_v_self) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__nonzero__ (wrapper)", 0); __pyx_r = __pyx_pf_11pygame_sdl2_5event_9EventType_12__nonzero__(__pyx_self, ((PyObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_5event_9EventType_12__nonzero__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__nonzero__", 0); /* "pygame_sdl2/event.pyx":93 * * def __nonzero__(self): * return self.type != 0 # <<<<<<<<<<<<<< * * Event = EventType */ __Pyx_XDECREF(__pyx_r); __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_type); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 93; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = PyObject_RichCompare(__pyx_t_1, __pyx_int_0, Py_NE); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 93; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; /* "pygame_sdl2/event.pyx":92 * return not (self == other) * * def __nonzero__(self): # <<<<<<<<<<<<<< * return self.type != 0 * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_AddTraceback("pygame_sdl2.event.EventType.__nonzero__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/event.pyx":97 * Event = EventType * * cdef get_textinput(): # <<<<<<<<<<<<<< * cdef SDL_Event evt * */ static PyObject *__pyx_f_11pygame_sdl2_5event_get_textinput(void) { SDL_Event __pyx_v_evt; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; char *__pyx_t_2; PyObject *__pyx_t_3 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("get_textinput", 0); /* "pygame_sdl2/event.pyx":100 * cdef SDL_Event evt * * SDL_PumpEvents() # <<<<<<<<<<<<<< * * if SDL_PeepEvents(&evt, 1, SDL_GETEVENT, SDL_TEXTINPUT, SDL_TEXTINPUT) > 0: */ SDL_PumpEvents(); /* "pygame_sdl2/event.pyx":102 * SDL_PumpEvents() * * if SDL_PeepEvents(&evt, 1, SDL_GETEVENT, SDL_TEXTINPUT, SDL_TEXTINPUT) > 0: # <<<<<<<<<<<<<< * return evt.text.text.decode('utf-8') * return u'' */ __pyx_t_1 = ((SDL_PeepEvents((&__pyx_v_evt), 1, SDL_GETEVENT, SDL_TEXTINPUT, SDL_TEXTINPUT) > 0) != 0); if (__pyx_t_1) { /* "pygame_sdl2/event.pyx":103 * * if SDL_PeepEvents(&evt, 1, SDL_GETEVENT, SDL_TEXTINPUT, SDL_TEXTINPUT) > 0: * return evt.text.text.decode('utf-8') # <<<<<<<<<<<<<< * return u'' * */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __pyx_v_evt.text.text; __pyx_t_3 = __Pyx_decode_c_string(__pyx_t_2, 0, strlen(__pyx_t_2), NULL, NULL, PyUnicode_DecodeUTF8); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 103; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __Pyx_INCREF(__pyx_t_3); __pyx_r = __pyx_t_3; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; goto __pyx_L0; /* "pygame_sdl2/event.pyx":102 * SDL_PumpEvents() * * if SDL_PeepEvents(&evt, 1, SDL_GETEVENT, SDL_TEXTINPUT, SDL_TEXTINPUT) > 0: # <<<<<<<<<<<<<< * return evt.text.text.decode('utf-8') * return u'' */ } /* "pygame_sdl2/event.pyx":104 * if SDL_PeepEvents(&evt, 1, SDL_GETEVENT, SDL_TEXTINPUT, SDL_TEXTINPUT) > 0: * return evt.text.text.decode('utf-8') * return u'' # <<<<<<<<<<<<<< * * cdef make_keyboard_event(SDL_KeyboardEvent *e): */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(__pyx_kp_u_); __pyx_r = __pyx_kp_u_; goto __pyx_L0; /* "pygame_sdl2/event.pyx":97 * Event = EventType * * cdef get_textinput(): # <<<<<<<<<<<<<< * cdef SDL_Event evt * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("pygame_sdl2.event.get_textinput", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/event.pyx":106 * return u'' * * cdef make_keyboard_event(SDL_KeyboardEvent *e): # <<<<<<<<<<<<<< * dargs = { 'scancode' : e.keysym.scancode, * 'key' : e.keysym.sym, */ static PyObject *__pyx_f_11pygame_sdl2_5event_make_keyboard_event(SDL_KeyboardEvent *__pyx_v_e) { PyObject *__pyx_v_dargs = NULL; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; int __pyx_t_3; int __pyx_t_4; PyObject *__pyx_t_5 = NULL; PyObject *__pyx_t_6 = NULL; PyObject *__pyx_t_7 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("make_keyboard_event", 0); /* "pygame_sdl2/event.pyx":107 * * cdef make_keyboard_event(SDL_KeyboardEvent *e): * dargs = { 'scancode' : e.keysym.scancode, # <<<<<<<<<<<<<< * 'key' : e.keysym.sym, * 'mod' : e.keysym.mod, */ __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 107; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = __Pyx_PyInt_From_SDL_Scancode(__pyx_v_e->keysym.scancode); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 107; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_scancode, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 107; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "pygame_sdl2/event.pyx":108 * cdef make_keyboard_event(SDL_KeyboardEvent *e): * dargs = { 'scancode' : e.keysym.scancode, * 'key' : e.keysym.sym, # <<<<<<<<<<<<<< * 'mod' : e.keysym.mod, * 'unicode' : '', */ __pyx_t_2 = __Pyx_PyInt_From_int32_t(__pyx_v_e->keysym.sym); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 108; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_key, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 107; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "pygame_sdl2/event.pyx":109 * dargs = { 'scancode' : e.keysym.scancode, * 'key' : e.keysym.sym, * 'mod' : e.keysym.mod, # <<<<<<<<<<<<<< * 'unicode' : '', * 'repeat' : e.repeat, */ __pyx_t_2 = __Pyx_PyInt_From_uint16_t(__pyx_v_e->keysym.mod); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 109; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_mod, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 107; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_unicode, __pyx_kp_s_) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 107; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "pygame_sdl2/event.pyx":111 * 'mod' : e.keysym.mod, * 'unicode' : '', * 'repeat' : e.repeat, # <<<<<<<<<<<<<< * } * */ __pyx_t_2 = __Pyx_PyInt_From_uint8_t(__pyx_v_e->repeat); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 111; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_repeat, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 107; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_v_dargs = ((PyObject*)__pyx_t_1); __pyx_t_1 = 0; /* "pygame_sdl2/event.pyx":114 * } * * if not pygame_sdl2.key.text_input: # <<<<<<<<<<<<<< * * if e.type == SDL_KEYDOWN: */ __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_pygame_sdl2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 114; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_key); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 114; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_text_input); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 114; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 114; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_4 = ((!__pyx_t_3) != 0); if (__pyx_t_4) { /* "pygame_sdl2/event.pyx":116 * if not pygame_sdl2.key.text_input: * * if e.type == SDL_KEYDOWN: # <<<<<<<<<<<<<< * # Be careful to only check for a TEXTINPUT event when you know that * # there will be one associated with this KEYDOWN event. */ __pyx_t_4 = ((__pyx_v_e->type == SDL_KEYDOWN) != 0); if (__pyx_t_4) { /* "pygame_sdl2/event.pyx":119 * # Be careful to only check for a TEXTINPUT event when you know that * # there will be one associated with this KEYDOWN event. * if e.keysym.sym < 0x20: # <<<<<<<<<<<<<< * dargs['unicode'] = unichr(e.keysym.sym) * elif e.keysym.sym <= 0xFFFF: */ __pyx_t_4 = ((__pyx_v_e->keysym.sym < 0x20) != 0); if (__pyx_t_4) { /* "pygame_sdl2/event.pyx":120 * # there will be one associated with this KEYDOWN event. * if e.keysym.sym < 0x20: * dargs['unicode'] = unichr(e.keysym.sym) # <<<<<<<<<<<<<< * elif e.keysym.sym <= 0xFFFF: * dargs['unicode'] = get_textinput() */ __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_unichr); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 120; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __pyx_t_5 = __Pyx_PyInt_From_int32_t(__pyx_v_e->keysym.sym); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 120; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); __pyx_t_6 = NULL; if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_2))) { __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_2); if (likely(__pyx_t_6)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_6); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); } } if (!__pyx_t_6) { __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_5); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 120; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_GOTREF(__pyx_t_1); } else { __pyx_t_7 = PyTuple_New(1+1); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 120; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_7); __Pyx_GIVEREF(__pyx_t_6); PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_6); __pyx_t_6 = NULL; __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_7, 0+1, __pyx_t_5); __pyx_t_5 = 0; __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_7, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 120; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; } __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; if (unlikely(PyDict_SetItem(__pyx_v_dargs, __pyx_n_s_unicode, __pyx_t_1) < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 120; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "pygame_sdl2/event.pyx":119 * # Be careful to only check for a TEXTINPUT event when you know that * # there will be one associated with this KEYDOWN event. * if e.keysym.sym < 0x20: # <<<<<<<<<<<<<< * dargs['unicode'] = unichr(e.keysym.sym) * elif e.keysym.sym <= 0xFFFF: */ goto __pyx_L5; } /* "pygame_sdl2/event.pyx":121 * if e.keysym.sym < 0x20: * dargs['unicode'] = unichr(e.keysym.sym) * elif e.keysym.sym <= 0xFFFF: # <<<<<<<<<<<<<< * dargs['unicode'] = get_textinput() * */ __pyx_t_4 = ((__pyx_v_e->keysym.sym <= 0xFFFF) != 0); if (__pyx_t_4) { /* "pygame_sdl2/event.pyx":122 * dargs['unicode'] = unichr(e.keysym.sym) * elif e.keysym.sym <= 0xFFFF: * dargs['unicode'] = get_textinput() # <<<<<<<<<<<<<< * * return EventType(e.type, dict=dargs, repeat=e.repeat) */ __pyx_t_1 = __pyx_f_11pygame_sdl2_5event_get_textinput(); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 122; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); if (unlikely(PyDict_SetItem(__pyx_v_dargs, __pyx_n_s_unicode, __pyx_t_1) < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 122; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "pygame_sdl2/event.pyx":121 * if e.keysym.sym < 0x20: * dargs['unicode'] = unichr(e.keysym.sym) * elif e.keysym.sym <= 0xFFFF: # <<<<<<<<<<<<<< * dargs['unicode'] = get_textinput() * */ } __pyx_L5:; /* "pygame_sdl2/event.pyx":116 * if not pygame_sdl2.key.text_input: * * if e.type == SDL_KEYDOWN: # <<<<<<<<<<<<<< * # Be careful to only check for a TEXTINPUT event when you know that * # there will be one associated with this KEYDOWN event. */ } /* "pygame_sdl2/event.pyx":114 * } * * if not pygame_sdl2.key.text_input: # <<<<<<<<<<<<<< * * if e.type == SDL_KEYDOWN: */ } /* "pygame_sdl2/event.pyx":124 * dargs['unicode'] = get_textinput() * * return EventType(e.type, dict=dargs, repeat=e.repeat) # <<<<<<<<<<<<<< * * cdef make_mousemotion_event(SDL_MouseMotionEvent *e): */ __Pyx_XDECREF(__pyx_r); __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_EventType); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 124; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = __Pyx_PyInt_From_uint32_t(__pyx_v_e->type); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 124; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __pyx_t_7 = PyTuple_New(1); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 124; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_7); __Pyx_GIVEREF(__pyx_t_2); PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_2); __pyx_t_2 = 0; __pyx_t_2 = PyDict_New(); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 124; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_dict, __pyx_v_dargs) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 124; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_t_5 = __Pyx_PyInt_From_uint8_t(__pyx_v_e->repeat); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 124; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_repeat, __pyx_t_5) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 124; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_7, __pyx_t_2); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 124; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_r = __pyx_t_5; __pyx_t_5 = 0; goto __pyx_L0; /* "pygame_sdl2/event.pyx":106 * return u'' * * cdef make_keyboard_event(SDL_KeyboardEvent *e): # <<<<<<<<<<<<<< * dargs = { 'scancode' : e.keysym.scancode, * 'key' : e.keysym.sym, */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_5); __Pyx_XDECREF(__pyx_t_6); __Pyx_XDECREF(__pyx_t_7); __Pyx_AddTraceback("pygame_sdl2.event.make_keyboard_event", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XDECREF(__pyx_v_dargs); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/event.pyx":126 * return EventType(e.type, dict=dargs, repeat=e.repeat) * * cdef make_mousemotion_event(SDL_MouseMotionEvent *e): # <<<<<<<<<<<<<< * buttons = (1 if e.state & SDL_BUTTON_LMASK else 0, * 1 if e.state & SDL_BUTTON_MMASK else 0, */ static PyObject *__pyx_f_11pygame_sdl2_5event_make_mousemotion_event(SDL_MouseMotionEvent *__pyx_v_e) { PyObject *__pyx_v_buttons = NULL; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; PyObject *__pyx_t_5 = NULL; PyObject *__pyx_t_6 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("make_mousemotion_event", 0); /* "pygame_sdl2/event.pyx":127 * * cdef make_mousemotion_event(SDL_MouseMotionEvent *e): * buttons = (1 if e.state & SDL_BUTTON_LMASK else 0, # <<<<<<<<<<<<<< * 1 if e.state & SDL_BUTTON_MMASK else 0, * 1 if e.state & SDL_BUTTON_RMASK else 0) */ if (((__pyx_v_e->state & SDL_BUTTON_LMASK) != 0)) { __Pyx_INCREF(__pyx_int_1); __pyx_t_1 = __pyx_int_1; } else { __Pyx_INCREF(__pyx_int_0); __pyx_t_1 = __pyx_int_0; } /* "pygame_sdl2/event.pyx":128 * cdef make_mousemotion_event(SDL_MouseMotionEvent *e): * buttons = (1 if e.state & SDL_BUTTON_LMASK else 0, * 1 if e.state & SDL_BUTTON_MMASK else 0, # <<<<<<<<<<<<<< * 1 if e.state & SDL_BUTTON_RMASK else 0) * return EventType(e.type, pos=(e.x, e.y), rel=(e.xrel, e.yrel), which=e.which, buttons=buttons) */ if (((__pyx_v_e->state & SDL_BUTTON_MMASK) != 0)) { __Pyx_INCREF(__pyx_int_1); __pyx_t_2 = __pyx_int_1; } else { __Pyx_INCREF(__pyx_int_0); __pyx_t_2 = __pyx_int_0; } /* "pygame_sdl2/event.pyx":129 * buttons = (1 if e.state & SDL_BUTTON_LMASK else 0, * 1 if e.state & SDL_BUTTON_MMASK else 0, * 1 if e.state & SDL_BUTTON_RMASK else 0) # <<<<<<<<<<<<<< * return EventType(e.type, pos=(e.x, e.y), rel=(e.xrel, e.yrel), which=e.which, buttons=buttons) * */ if (((__pyx_v_e->state & SDL_BUTTON_RMASK) != 0)) { __Pyx_INCREF(__pyx_int_1); __pyx_t_3 = __pyx_int_1; } else { __Pyx_INCREF(__pyx_int_0); __pyx_t_3 = __pyx_int_0; } /* "pygame_sdl2/event.pyx":127 * * cdef make_mousemotion_event(SDL_MouseMotionEvent *e): * buttons = (1 if e.state & SDL_BUTTON_LMASK else 0, # <<<<<<<<<<<<<< * 1 if e.state & SDL_BUTTON_MMASK else 0, * 1 if e.state & SDL_BUTTON_RMASK else 0) */ __pyx_t_4 = PyTuple_New(3); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 127; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); __Pyx_GIVEREF(__pyx_t_1); PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_1); __Pyx_GIVEREF(__pyx_t_2); PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_2); __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_4, 2, __pyx_t_3); __pyx_t_1 = 0; __pyx_t_2 = 0; __pyx_t_3 = 0; __pyx_v_buttons = __pyx_t_4; __pyx_t_4 = 0; /* "pygame_sdl2/event.pyx":130 * 1 if e.state & SDL_BUTTON_MMASK else 0, * 1 if e.state & SDL_BUTTON_RMASK else 0) * return EventType(e.type, pos=(e.x, e.y), rel=(e.xrel, e.yrel), which=e.which, buttons=buttons) # <<<<<<<<<<<<<< * * cdef make_mousebtn_event(SDL_MouseButtonEvent *e): */ __Pyx_XDECREF(__pyx_r); __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_EventType); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 130; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); __pyx_t_3 = __Pyx_PyInt_From_uint32_t(__pyx_v_e->type); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 130; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 130; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_3); __pyx_t_3 = 0; __pyx_t_3 = PyDict_New(); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 130; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __pyx_t_1 = __Pyx_PyInt_From_int32_t(__pyx_v_e->x); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 130; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_t_5 = __Pyx_PyInt_From_int32_t(__pyx_v_e->y); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 130; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); __pyx_t_6 = PyTuple_New(2); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 130; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_6); __Pyx_GIVEREF(__pyx_t_1); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_1); __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_6, 1, __pyx_t_5); __pyx_t_1 = 0; __pyx_t_5 = 0; if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_pos, __pyx_t_6) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 130; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __pyx_t_6 = __Pyx_PyInt_From_int32_t(__pyx_v_e->xrel); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 130; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_6); __pyx_t_5 = __Pyx_PyInt_From_int32_t(__pyx_v_e->yrel); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 130; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 130; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __Pyx_GIVEREF(__pyx_t_6); PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_6); __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_t_5); __pyx_t_6 = 0; __pyx_t_5 = 0; if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_rel, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 130; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_1 = __Pyx_PyInt_From_uint32_t(__pyx_v_e->which); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 130; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_which, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 130; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_buttons, __pyx_v_buttons) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 130; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 130; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "pygame_sdl2/event.pyx":126 * return EventType(e.type, dict=dargs, repeat=e.repeat) * * cdef make_mousemotion_event(SDL_MouseMotionEvent *e): # <<<<<<<<<<<<<< * buttons = (1 if e.state & SDL_BUTTON_LMASK else 0, * 1 if e.state & SDL_BUTTON_MMASK else 0, */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_5); __Pyx_XDECREF(__pyx_t_6); __Pyx_AddTraceback("pygame_sdl2.event.make_mousemotion_event", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XDECREF(__pyx_v_buttons); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/event.pyx":132 * return EventType(e.type, pos=(e.x, e.y), rel=(e.xrel, e.yrel), which=e.which, buttons=buttons) * * cdef make_mousebtn_event(SDL_MouseButtonEvent *e): # <<<<<<<<<<<<<< * btn = e.button * */ static PyObject *__pyx_f_11pygame_sdl2_5event_make_mousebtn_event(SDL_MouseButtonEvent *__pyx_v_e) { PyObject *__pyx_v_btn = NULL; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_t_2; int __pyx_t_3; PyObject *__pyx_t_4 = NULL; PyObject *__pyx_t_5 = NULL; PyObject *__pyx_t_6 = NULL; PyObject *__pyx_t_7 = NULL; PyObject *__pyx_t_8 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("make_mousebtn_event", 0); /* "pygame_sdl2/event.pyx":133 * * cdef make_mousebtn_event(SDL_MouseButtonEvent *e): * btn = e.button # <<<<<<<<<<<<<< * * # SDL 1.x maps wheel to buttons 4/5 */ __pyx_t_1 = __Pyx_PyInt_From_uint8_t(__pyx_v_e->button); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 133; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_v_btn = __pyx_t_1; __pyx_t_1 = 0; /* "pygame_sdl2/event.pyx":136 * * # SDL 1.x maps wheel to buttons 4/5 * if mousewheel_buttons and btn >= 4: # <<<<<<<<<<<<<< * btn += 2 * */ __pyx_t_3 = (__pyx_v_11pygame_sdl2_5event_mousewheel_buttons != 0); if (__pyx_t_3) { } else { __pyx_t_2 = __pyx_t_3; goto __pyx_L4_bool_binop_done; } __pyx_t_1 = PyObject_RichCompare(__pyx_v_btn, __pyx_int_4, Py_GE); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 136; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 136; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_2 = __pyx_t_3; __pyx_L4_bool_binop_done:; if (__pyx_t_2) { /* "pygame_sdl2/event.pyx":137 * # SDL 1.x maps wheel to buttons 4/5 * if mousewheel_buttons and btn >= 4: * btn += 2 # <<<<<<<<<<<<<< * * return EventType(e.type, button=btn, pos=(e.x, e.y), which=e.which) */ __pyx_t_1 = __Pyx_PyInt_AddObjC(__pyx_v_btn, __pyx_int_2, 2, 1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 137; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF_SET(__pyx_v_btn, __pyx_t_1); __pyx_t_1 = 0; /* "pygame_sdl2/event.pyx":136 * * # SDL 1.x maps wheel to buttons 4/5 * if mousewheel_buttons and btn >= 4: # <<<<<<<<<<<<<< * btn += 2 * */ } /* "pygame_sdl2/event.pyx":139 * btn += 2 * * return EventType(e.type, button=btn, pos=(e.x, e.y), which=e.which) # <<<<<<<<<<<<<< * * cdef make_mousewheel_event(SDL_MouseWheelEvent *e): */ __Pyx_XDECREF(__pyx_r); __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_EventType); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 139; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_t_4 = __Pyx_PyInt_From_uint32_t(__pyx_v_e->type); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 139; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 139; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_4); __pyx_t_4 = 0; __pyx_t_4 = PyDict_New(); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 139; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_button, __pyx_v_btn) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 139; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_t_6 = __Pyx_PyInt_From_int32_t(__pyx_v_e->x); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 139; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_6); __pyx_t_7 = __Pyx_PyInt_From_int32_t(__pyx_v_e->y); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 139; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_7); __pyx_t_8 = PyTuple_New(2); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 139; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_8); __Pyx_GIVEREF(__pyx_t_6); PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_6); __Pyx_GIVEREF(__pyx_t_7); PyTuple_SET_ITEM(__pyx_t_8, 1, __pyx_t_7); __pyx_t_6 = 0; __pyx_t_7 = 0; if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_pos, __pyx_t_8) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 139; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; __pyx_t_8 = __Pyx_PyInt_From_uint32_t(__pyx_v_e->which); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 139; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_8); if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_which, __pyx_t_8) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 139; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; __pyx_t_8 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_5, __pyx_t_4); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 139; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_8); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_r = __pyx_t_8; __pyx_t_8 = 0; goto __pyx_L0; /* "pygame_sdl2/event.pyx":132 * return EventType(e.type, pos=(e.x, e.y), rel=(e.xrel, e.yrel), which=e.which, buttons=buttons) * * cdef make_mousebtn_event(SDL_MouseButtonEvent *e): # <<<<<<<<<<<<<< * btn = e.button * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_5); __Pyx_XDECREF(__pyx_t_6); __Pyx_XDECREF(__pyx_t_7); __Pyx_XDECREF(__pyx_t_8); __Pyx_AddTraceback("pygame_sdl2.event.make_mousebtn_event", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XDECREF(__pyx_v_btn); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/event.pyx":141 * return EventType(e.type, button=btn, pos=(e.x, e.y), which=e.which) * * cdef make_mousewheel_event(SDL_MouseWheelEvent *e): # <<<<<<<<<<<<<< * * cdef int x, y */ static PyObject *__pyx_f_11pygame_sdl2_5event_make_mousewheel_event(SDL_MouseWheelEvent *__pyx_v_e) { int __pyx_v_x; int __pyx_v_y; long __pyx_v_btn; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; PyObject *__pyx_t_5 = NULL; Sint32 __pyx_t_6; PyObject *__pyx_t_7 = NULL; PyObject *__pyx_t_8 = NULL; PyObject *__pyx_t_9 = NULL; PyObject *__pyx_t_10 = NULL; Py_ssize_t __pyx_t_11; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("make_mousewheel_event", 0); /* "pygame_sdl2/event.pyx":146 * * # SDL2-style, if the user has opted-in. * if not mousewheel_buttons: # <<<<<<<<<<<<<< * return EventType(e.type, which=e.which, x=e.x, y=e.y) * */ __pyx_t_1 = ((!(__pyx_v_11pygame_sdl2_5event_mousewheel_buttons != 0)) != 0); if (__pyx_t_1) { /* "pygame_sdl2/event.pyx":147 * # SDL2-style, if the user has opted-in. * if not mousewheel_buttons: * return EventType(e.type, which=e.which, x=e.x, y=e.y) # <<<<<<<<<<<<<< * * # Otherwise, follow the SDL1 approach. */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_EventType); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 147; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = __Pyx_PyInt_From_uint32_t(__pyx_v_e->type); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 147; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 147; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_3); __pyx_t_3 = 0; __pyx_t_3 = PyDict_New(); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 147; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __pyx_t_5 = __Pyx_PyInt_From_uint32_t(__pyx_v_e->which); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 147; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_which, __pyx_t_5) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 147; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __pyx_t_5 = __Pyx_PyInt_From_int32_t(__pyx_v_e->x); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 147; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_x, __pyx_t_5) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 147; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __pyx_t_5 = __Pyx_PyInt_From_int32_t(__pyx_v_e->y); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 147; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_y, __pyx_t_5) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 147; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_4, __pyx_t_3); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 147; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_r = __pyx_t_5; __pyx_t_5 = 0; goto __pyx_L0; /* "pygame_sdl2/event.pyx":146 * * # SDL2-style, if the user has opted-in. * if not mousewheel_buttons: # <<<<<<<<<<<<<< * return EventType(e.type, which=e.which, x=e.x, y=e.y) * */ } /* "pygame_sdl2/event.pyx":151 * # Otherwise, follow the SDL1 approach. * * y = e.y # <<<<<<<<<<<<<< * * # TODO: Implement when 2.0.4 becomes widespread. */ __pyx_t_6 = __pyx_v_e->y; __pyx_v_y = __pyx_t_6; /* "pygame_sdl2/event.pyx":157 * # y = -y * * if y > 0: # <<<<<<<<<<<<<< * btn = 4 * elif y < 0: */ __pyx_t_1 = ((__pyx_v_y > 0) != 0); if (__pyx_t_1) { /* "pygame_sdl2/event.pyx":158 * * if y > 0: * btn = 4 # <<<<<<<<<<<<<< * elif y < 0: * btn = 5 */ __pyx_v_btn = 4; /* "pygame_sdl2/event.pyx":157 * # y = -y * * if y > 0: # <<<<<<<<<<<<<< * btn = 4 * elif y < 0: */ goto __pyx_L4; } /* "pygame_sdl2/event.pyx":159 * if y > 0: * btn = 4 * elif y < 0: # <<<<<<<<<<<<<< * btn = 5 * else: */ __pyx_t_1 = ((__pyx_v_y < 0) != 0); if (__pyx_t_1) { /* "pygame_sdl2/event.pyx":160 * btn = 4 * elif y < 0: * btn = 5 # <<<<<<<<<<<<<< * else: * return EventType(0) # x axis scrolling produces no event in pygame */ __pyx_v_btn = 5; /* "pygame_sdl2/event.pyx":159 * if y > 0: * btn = 4 * elif y < 0: # <<<<<<<<<<<<<< * btn = 5 * else: */ goto __pyx_L4; } /* "pygame_sdl2/event.pyx":162 * btn = 5 * else: * return EventType(0) # x axis scrolling produces no event in pygame # <<<<<<<<<<<<<< * * # This is not the mouse position at the time of the event */ /*else*/ { __Pyx_XDECREF(__pyx_r); __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_EventType); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 162; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_tuple__2, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 162; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __pyx_r = __pyx_t_3; __pyx_t_3 = 0; goto __pyx_L0; } __pyx_L4:; /* "pygame_sdl2/event.pyx":165 * * # This is not the mouse position at the time of the event * SDL_GetMouseState(&x, &y) # <<<<<<<<<<<<<< * * # MOUSEBUTTONUP event should follow immediately after */ SDL_GetMouseState((&__pyx_v_x), (&__pyx_v_y)); /* "pygame_sdl2/event.pyx":168 * * # MOUSEBUTTONUP event should follow immediately after * event_queue.insert(0, EventType(SDL_MOUSEBUTTONUP, button=btn, pos=(x,y))) # <<<<<<<<<<<<<< * return EventType(SDL_MOUSEBUTTONDOWN, button=btn, pos=(x,y)) * */ __pyx_t_5 = __Pyx_PyObject_GetAttrStr(event_queue, __pyx_n_s_insert); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 168; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_EventType); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 168; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); __pyx_t_2 = __Pyx_PyInt_From_SDL_EventType(SDL_MOUSEBUTTONUP); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 168; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __pyx_t_7 = PyTuple_New(1); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 168; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_7); __Pyx_GIVEREF(__pyx_t_2); PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_2); __pyx_t_2 = 0; __pyx_t_2 = PyDict_New(); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 168; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __pyx_t_8 = __Pyx_PyInt_From_long(__pyx_v_btn); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 168; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_8); if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_button, __pyx_t_8) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 168; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; __pyx_t_8 = __Pyx_PyInt_From_int(__pyx_v_x); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 168; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_8); __pyx_t_9 = __Pyx_PyInt_From_int(__pyx_v_y); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 168; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_9); __pyx_t_10 = PyTuple_New(2); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 168; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_10); __Pyx_GIVEREF(__pyx_t_8); PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_t_8); __Pyx_GIVEREF(__pyx_t_9); PyTuple_SET_ITEM(__pyx_t_10, 1, __pyx_t_9); __pyx_t_8 = 0; __pyx_t_9 = 0; if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_pos, __pyx_t_10) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 168; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; __pyx_t_10 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_7, __pyx_t_2); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 168; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_10); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_2 = NULL; __pyx_t_11 = 0; if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_5))) { __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_5); if (likely(__pyx_t_2)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5); __Pyx_INCREF(__pyx_t_2); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_5, function); __pyx_t_11 = 1; } } __pyx_t_7 = PyTuple_New(2+__pyx_t_11); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 168; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_7); if (__pyx_t_2) { __Pyx_GIVEREF(__pyx_t_2); PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_2); __pyx_t_2 = NULL; } __Pyx_INCREF(__pyx_int_0); __Pyx_GIVEREF(__pyx_int_0); PyTuple_SET_ITEM(__pyx_t_7, 0+__pyx_t_11, __pyx_int_0); __Pyx_GIVEREF(__pyx_t_10); PyTuple_SET_ITEM(__pyx_t_7, 1+__pyx_t_11, __pyx_t_10); __pyx_t_10 = 0; __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_7, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 168; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "pygame_sdl2/event.pyx":169 * # MOUSEBUTTONUP event should follow immediately after * event_queue.insert(0, EventType(SDL_MOUSEBUTTONUP, button=btn, pos=(x,y))) * return EventType(SDL_MOUSEBUTTONDOWN, button=btn, pos=(x,y)) # <<<<<<<<<<<<<< * * cdef make_mousewheel_event_sdl2(SDL_MouseWheelEvent *e): */ __Pyx_XDECREF(__pyx_r); __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_EventType); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 169; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __pyx_t_5 = __Pyx_PyInt_From_SDL_EventType(SDL_MOUSEBUTTONDOWN); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 169; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); __pyx_t_7 = PyTuple_New(1); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 169; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_7); __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_5); __pyx_t_5 = 0; __pyx_t_5 = PyDict_New(); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 169; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); __pyx_t_10 = __Pyx_PyInt_From_long(__pyx_v_btn); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 169; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_10); if (PyDict_SetItem(__pyx_t_5, __pyx_n_s_button, __pyx_t_10) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 169; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; __pyx_t_10 = __Pyx_PyInt_From_int(__pyx_v_x); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 169; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_10); __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_v_y); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 169; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 169; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); __Pyx_GIVEREF(__pyx_t_10); PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_10); __Pyx_GIVEREF(__pyx_t_2); PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_2); __pyx_t_10 = 0; __pyx_t_2 = 0; if (PyDict_SetItem(__pyx_t_5, __pyx_n_s_pos, __pyx_t_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 169; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_7, __pyx_t_5); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 169; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __pyx_r = __pyx_t_4; __pyx_t_4 = 0; goto __pyx_L0; /* "pygame_sdl2/event.pyx":141 * return EventType(e.type, button=btn, pos=(e.x, e.y), which=e.which) * * cdef make_mousewheel_event(SDL_MouseWheelEvent *e): # <<<<<<<<<<<<<< * * cdef int x, y */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_5); __Pyx_XDECREF(__pyx_t_7); __Pyx_XDECREF(__pyx_t_8); __Pyx_XDECREF(__pyx_t_9); __Pyx_XDECREF(__pyx_t_10); __Pyx_AddTraceback("pygame_sdl2.event.make_mousewheel_event", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/event.pyx":171 * return EventType(SDL_MOUSEBUTTONDOWN, button=btn, pos=(x,y)) * * cdef make_mousewheel_event_sdl2(SDL_MouseWheelEvent *e): # <<<<<<<<<<<<<< * return EventType(e.type, x=e.x, y=e.y) * */ static PyObject *__pyx_f_11pygame_sdl2_5event_make_mousewheel_event_sdl2(SDL_MouseWheelEvent *__pyx_v_e) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("make_mousewheel_event_sdl2", 0); /* "pygame_sdl2/event.pyx":172 * * cdef make_mousewheel_event_sdl2(SDL_MouseWheelEvent *e): * return EventType(e.type, x=e.x, y=e.y) # <<<<<<<<<<<<<< * * cdef make_joyaxis_event(SDL_JoyAxisEvent *e): */ __Pyx_XDECREF(__pyx_r); __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_EventType); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 172; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = __Pyx_PyInt_From_uint32_t(__pyx_v_e->type); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 172; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 172; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __Pyx_GIVEREF(__pyx_t_2); PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_2); __pyx_t_2 = 0; __pyx_t_2 = PyDict_New(); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 172; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __pyx_t_4 = __Pyx_PyInt_From_int32_t(__pyx_v_e->x); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 172; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_x, __pyx_t_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 172; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_t_4 = __Pyx_PyInt_From_int32_t(__pyx_v_e->y); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 172; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_y, __pyx_t_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 172; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_3, __pyx_t_2); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 172; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_r = __pyx_t_4; __pyx_t_4 = 0; goto __pyx_L0; /* "pygame_sdl2/event.pyx":171 * return EventType(SDL_MOUSEBUTTONDOWN, button=btn, pos=(x,y)) * * cdef make_mousewheel_event_sdl2(SDL_MouseWheelEvent *e): # <<<<<<<<<<<<<< * return EventType(e.type, x=e.x, y=e.y) * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_AddTraceback("pygame_sdl2.event.make_mousewheel_event_sdl2", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/event.pyx":174 * return EventType(e.type, x=e.x, y=e.y) * * cdef make_joyaxis_event(SDL_JoyAxisEvent *e): # <<<<<<<<<<<<<< * return EventType(e.type, joy=e.which, axis=e.axis, value=e.value/32768.0) * */ static PyObject *__pyx_f_11pygame_sdl2_5event_make_joyaxis_event(SDL_JoyAxisEvent *__pyx_v_e) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("make_joyaxis_event", 0); /* "pygame_sdl2/event.pyx":175 * * cdef make_joyaxis_event(SDL_JoyAxisEvent *e): * return EventType(e.type, joy=e.which, axis=e.axis, value=e.value/32768.0) # <<<<<<<<<<<<<< * * cdef make_joyball_event(SDL_JoyBallEvent *e): */ __Pyx_XDECREF(__pyx_r); __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_EventType); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 175; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = __Pyx_PyInt_From_uint32_t(__pyx_v_e->type); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 175; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 175; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __Pyx_GIVEREF(__pyx_t_2); PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_2); __pyx_t_2 = 0; __pyx_t_2 = PyDict_New(); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 175; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __pyx_t_4 = __Pyx_PyInt_From_int32_t(__pyx_v_e->which); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 175; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_joy, __pyx_t_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 175; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_t_4 = __Pyx_PyInt_From_uint8_t(__pyx_v_e->axis); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 175; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_axis, __pyx_t_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 175; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_t_4 = PyFloat_FromDouble((__pyx_v_e->value / 32768.0)); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 175; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_value, __pyx_t_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 175; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_3, __pyx_t_2); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 175; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_r = __pyx_t_4; __pyx_t_4 = 0; goto __pyx_L0; /* "pygame_sdl2/event.pyx":174 * return EventType(e.type, x=e.x, y=e.y) * * cdef make_joyaxis_event(SDL_JoyAxisEvent *e): # <<<<<<<<<<<<<< * return EventType(e.type, joy=e.which, axis=e.axis, value=e.value/32768.0) * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_AddTraceback("pygame_sdl2.event.make_joyaxis_event", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/event.pyx":177 * return EventType(e.type, joy=e.which, axis=e.axis, value=e.value/32768.0) * * cdef make_joyball_event(SDL_JoyBallEvent *e): # <<<<<<<<<<<<<< * return EventType(e.type, joy=e.which, ball=e.ball, rel=(e.xrel, e.yrel)) * */ static PyObject *__pyx_f_11pygame_sdl2_5event_make_joyball_event(SDL_JoyBallEvent *__pyx_v_e) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; PyObject *__pyx_t_5 = NULL; PyObject *__pyx_t_6 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("make_joyball_event", 0); /* "pygame_sdl2/event.pyx":178 * * cdef make_joyball_event(SDL_JoyBallEvent *e): * return EventType(e.type, joy=e.which, ball=e.ball, rel=(e.xrel, e.yrel)) # <<<<<<<<<<<<<< * * cdef make_joyhat_event(SDL_JoyHatEvent *e): */ __Pyx_XDECREF(__pyx_r); __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_EventType); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 178; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = __Pyx_PyInt_From_uint32_t(__pyx_v_e->type); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 178; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 178; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __Pyx_GIVEREF(__pyx_t_2); PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_2); __pyx_t_2 = 0; __pyx_t_2 = PyDict_New(); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 178; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __pyx_t_4 = __Pyx_PyInt_From_int32_t(__pyx_v_e->which); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 178; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_joy, __pyx_t_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 178; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_t_4 = __Pyx_PyInt_From_uint8_t(__pyx_v_e->ball); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 178; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_ball, __pyx_t_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 178; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_t_4 = __Pyx_PyInt_From_int16_t(__pyx_v_e->xrel); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 178; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); __pyx_t_5 = __Pyx_PyInt_From_int16_t(__pyx_v_e->yrel); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 178; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); __pyx_t_6 = PyTuple_New(2); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 178; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_6); __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_4); __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_6, 1, __pyx_t_5); __pyx_t_4 = 0; __pyx_t_5 = 0; if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_rel, __pyx_t_6) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 178; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_3, __pyx_t_2); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 178; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_r = __pyx_t_6; __pyx_t_6 = 0; goto __pyx_L0; /* "pygame_sdl2/event.pyx":177 * return EventType(e.type, joy=e.which, axis=e.axis, value=e.value/32768.0) * * cdef make_joyball_event(SDL_JoyBallEvent *e): # <<<<<<<<<<<<<< * return EventType(e.type, joy=e.which, ball=e.ball, rel=(e.xrel, e.yrel)) * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_5); __Pyx_XDECREF(__pyx_t_6); __Pyx_AddTraceback("pygame_sdl2.event.make_joyball_event", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/event.pyx":180 * return EventType(e.type, joy=e.which, ball=e.ball, rel=(e.xrel, e.yrel)) * * cdef make_joyhat_event(SDL_JoyHatEvent *e): # <<<<<<<<<<<<<< * return EventType(e.type, joy=e.which, hat=e.hat, value=e.value) * */ static PyObject *__pyx_f_11pygame_sdl2_5event_make_joyhat_event(SDL_JoyHatEvent *__pyx_v_e) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("make_joyhat_event", 0); /* "pygame_sdl2/event.pyx":181 * * cdef make_joyhat_event(SDL_JoyHatEvent *e): * return EventType(e.type, joy=e.which, hat=e.hat, value=e.value) # <<<<<<<<<<<<<< * * cdef make_joybtn_event(SDL_JoyButtonEvent *e): */ __Pyx_XDECREF(__pyx_r); __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_EventType); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 181; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = __Pyx_PyInt_From_uint32_t(__pyx_v_e->type); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 181; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 181; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __Pyx_GIVEREF(__pyx_t_2); PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_2); __pyx_t_2 = 0; __pyx_t_2 = PyDict_New(); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 181; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __pyx_t_4 = __Pyx_PyInt_From_int32_t(__pyx_v_e->which); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 181; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_joy, __pyx_t_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 181; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_t_4 = __Pyx_PyInt_From_uint8_t(__pyx_v_e->hat); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 181; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_hat, __pyx_t_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 181; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_t_4 = __Pyx_PyInt_From_uint8_t(__pyx_v_e->value); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 181; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_value, __pyx_t_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 181; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_3, __pyx_t_2); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 181; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_r = __pyx_t_4; __pyx_t_4 = 0; goto __pyx_L0; /* "pygame_sdl2/event.pyx":180 * return EventType(e.type, joy=e.which, ball=e.ball, rel=(e.xrel, e.yrel)) * * cdef make_joyhat_event(SDL_JoyHatEvent *e): # <<<<<<<<<<<<<< * return EventType(e.type, joy=e.which, hat=e.hat, value=e.value) * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_AddTraceback("pygame_sdl2.event.make_joyhat_event", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/event.pyx":183 * return EventType(e.type, joy=e.which, hat=e.hat, value=e.value) * * cdef make_joybtn_event(SDL_JoyButtonEvent *e): # <<<<<<<<<<<<<< * return EventType(e.type, joy=e.which, button=e.button) * */ static PyObject *__pyx_f_11pygame_sdl2_5event_make_joybtn_event(SDL_JoyButtonEvent *__pyx_v_e) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("make_joybtn_event", 0); /* "pygame_sdl2/event.pyx":184 * * cdef make_joybtn_event(SDL_JoyButtonEvent *e): * return EventType(e.type, joy=e.which, button=e.button) # <<<<<<<<<<<<<< * * cdef make_textinput_event(SDL_TextInputEvent *e): */ __Pyx_XDECREF(__pyx_r); __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_EventType); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 184; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = __Pyx_PyInt_From_uint32_t(__pyx_v_e->type); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 184; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 184; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __Pyx_GIVEREF(__pyx_t_2); PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_2); __pyx_t_2 = 0; __pyx_t_2 = PyDict_New(); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 184; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __pyx_t_4 = __Pyx_PyInt_From_int32_t(__pyx_v_e->which); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 184; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_joy, __pyx_t_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 184; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_t_4 = __Pyx_PyInt_From_uint8_t(__pyx_v_e->button); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 184; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_button, __pyx_t_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 184; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_3, __pyx_t_2); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 184; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_r = __pyx_t_4; __pyx_t_4 = 0; goto __pyx_L0; /* "pygame_sdl2/event.pyx":183 * return EventType(e.type, joy=e.which, hat=e.hat, value=e.value) * * cdef make_joybtn_event(SDL_JoyButtonEvent *e): # <<<<<<<<<<<<<< * return EventType(e.type, joy=e.which, button=e.button) * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_AddTraceback("pygame_sdl2.event.make_joybtn_event", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/event.pyx":186 * return EventType(e.type, joy=e.which, button=e.button) * * cdef make_textinput_event(SDL_TextInputEvent *e): # <<<<<<<<<<<<<< * return EventType(e.type, text=e.text.decode("utf-8")) * */ static PyObject *__pyx_f_11pygame_sdl2_5event_make_textinput_event(SDL_TextInputEvent *__pyx_v_e) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; char *__pyx_t_4; PyObject *__pyx_t_5 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("make_textinput_event", 0); /* "pygame_sdl2/event.pyx":187 * * cdef make_textinput_event(SDL_TextInputEvent *e): * return EventType(e.type, text=e.text.decode("utf-8")) # <<<<<<<<<<<<<< * * cdef make_textediting_event(SDL_TextEditingEvent *e): */ __Pyx_XDECREF(__pyx_r); __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_EventType); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 187; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = __Pyx_PyInt_From_uint32_t(__pyx_v_e->type); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 187; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 187; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __Pyx_GIVEREF(__pyx_t_2); PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_2); __pyx_t_2 = 0; __pyx_t_2 = PyDict_New(); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 187; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __pyx_t_4 = __pyx_v_e->text; __pyx_t_5 = __Pyx_decode_c_string(__pyx_t_4, 0, strlen(__pyx_t_4), NULL, NULL, PyUnicode_DecodeUTF8); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 187; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_text, __pyx_t_5) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 187; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_3, __pyx_t_2); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 187; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_r = __pyx_t_5; __pyx_t_5 = 0; goto __pyx_L0; /* "pygame_sdl2/event.pyx":186 * return EventType(e.type, joy=e.which, button=e.button) * * cdef make_textinput_event(SDL_TextInputEvent *e): # <<<<<<<<<<<<<< * return EventType(e.type, text=e.text.decode("utf-8")) * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_5); __Pyx_AddTraceback("pygame_sdl2.event.make_textinput_event", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/event.pyx":189 * return EventType(e.type, text=e.text.decode("utf-8")) * * cdef make_textediting_event(SDL_TextEditingEvent *e): # <<<<<<<<<<<<<< * return EventType(e.type, text=e.text.decode("utf-8"), start=e.start, length=e.length) * */ static PyObject *__pyx_f_11pygame_sdl2_5event_make_textediting_event(SDL_TextEditingEvent *__pyx_v_e) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; char *__pyx_t_4; PyObject *__pyx_t_5 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("make_textediting_event", 0); /* "pygame_sdl2/event.pyx":190 * * cdef make_textediting_event(SDL_TextEditingEvent *e): * return EventType(e.type, text=e.text.decode("utf-8"), start=e.start, length=e.length) # <<<<<<<<<<<<<< * * cdef make_window_event(SDL_WindowEvent *e): */ __Pyx_XDECREF(__pyx_r); __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_EventType); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 190; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = __Pyx_PyInt_From_uint32_t(__pyx_v_e->type); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 190; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 190; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __Pyx_GIVEREF(__pyx_t_2); PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_2); __pyx_t_2 = 0; __pyx_t_2 = PyDict_New(); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 190; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __pyx_t_4 = __pyx_v_e->text; __pyx_t_5 = __Pyx_decode_c_string(__pyx_t_4, 0, strlen(__pyx_t_4), NULL, NULL, PyUnicode_DecodeUTF8); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 190; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_text, __pyx_t_5) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 190; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __pyx_t_5 = __Pyx_PyInt_From_int32_t(__pyx_v_e->start); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 190; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_start, __pyx_t_5) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 190; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __pyx_t_5 = __Pyx_PyInt_From_int32_t(__pyx_v_e->length); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 190; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_length, __pyx_t_5) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 190; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_3, __pyx_t_2); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 190; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_r = __pyx_t_5; __pyx_t_5 = 0; goto __pyx_L0; /* "pygame_sdl2/event.pyx":189 * return EventType(e.type, text=e.text.decode("utf-8")) * * cdef make_textediting_event(SDL_TextEditingEvent *e): # <<<<<<<<<<<<<< * return EventType(e.type, text=e.text.decode("utf-8"), start=e.start, length=e.length) * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_5); __Pyx_AddTraceback("pygame_sdl2.event.make_textediting_event", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/event.pyx":192 * return EventType(e.type, text=e.text.decode("utf-8"), start=e.start, length=e.length) * * cdef make_window_event(SDL_WindowEvent *e): # <<<<<<<<<<<<<< * # SDL_APPMOUSEFOCUS * if e.event == SDL_WINDOWEVENT_ENTER: */ static PyObject *__pyx_f_11pygame_sdl2_5event_make_window_event(SDL_WindowEvent *__pyx_v_e) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; PyObject *__pyx_t_5 = NULL; PyObject *__pyx_t_6 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("make_window_event", 0); /* "pygame_sdl2/event.pyx":194 * cdef make_window_event(SDL_WindowEvent *e): * # SDL_APPMOUSEFOCUS * if e.event == SDL_WINDOWEVENT_ENTER: # <<<<<<<<<<<<<< * return EventType(ACTIVEEVENT, state=1, gain=1) * elif e.event == SDL_WINDOWEVENT_LEAVE: */ switch (__pyx_v_e->event) { case SDL_WINDOWEVENT_ENTER: /* "pygame_sdl2/event.pyx":195 * # SDL_APPMOUSEFOCUS * if e.event == SDL_WINDOWEVENT_ENTER: * return EventType(ACTIVEEVENT, state=1, gain=1) # <<<<<<<<<<<<<< * elif e.event == SDL_WINDOWEVENT_LEAVE: * return EventType(ACTIVEEVENT, state=1, gain=0) */ __Pyx_XDECREF(__pyx_r); __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_EventType); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 195; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_ACTIVEEVENT); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 195; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 195; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __Pyx_GIVEREF(__pyx_t_2); PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_2); __pyx_t_2 = 0; __pyx_t_2 = PyDict_New(); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 195; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_state, __pyx_int_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 195; __pyx_clineno = __LINE__; goto __pyx_L1_error;} if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_gain, __pyx_int_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 195; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_3, __pyx_t_2); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 195; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_r = __pyx_t_4; __pyx_t_4 = 0; goto __pyx_L0; /* "pygame_sdl2/event.pyx":194 * cdef make_window_event(SDL_WindowEvent *e): * # SDL_APPMOUSEFOCUS * if e.event == SDL_WINDOWEVENT_ENTER: # <<<<<<<<<<<<<< * return EventType(ACTIVEEVENT, state=1, gain=1) * elif e.event == SDL_WINDOWEVENT_LEAVE: */ break; /* "pygame_sdl2/event.pyx":196 * if e.event == SDL_WINDOWEVENT_ENTER: * return EventType(ACTIVEEVENT, state=1, gain=1) * elif e.event == SDL_WINDOWEVENT_LEAVE: # <<<<<<<<<<<<<< * return EventType(ACTIVEEVENT, state=1, gain=0) * */ case SDL_WINDOWEVENT_LEAVE: /* "pygame_sdl2/event.pyx":197 * return EventType(ACTIVEEVENT, state=1, gain=1) * elif e.event == SDL_WINDOWEVENT_LEAVE: * return EventType(ACTIVEEVENT, state=1, gain=0) # <<<<<<<<<<<<<< * * # SDL_APPINPUTFOCUS */ __Pyx_XDECREF(__pyx_r); __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_EventType); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 197; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_ACTIVEEVENT); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 197; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 197; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __Pyx_GIVEREF(__pyx_t_2); PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_2); __pyx_t_2 = 0; __pyx_t_2 = PyDict_New(); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 197; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_state, __pyx_int_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 197; __pyx_clineno = __LINE__; goto __pyx_L1_error;} if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_gain, __pyx_int_0) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 197; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_3, __pyx_t_2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 197; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "pygame_sdl2/event.pyx":196 * if e.event == SDL_WINDOWEVENT_ENTER: * return EventType(ACTIVEEVENT, state=1, gain=1) * elif e.event == SDL_WINDOWEVENT_LEAVE: # <<<<<<<<<<<<<< * return EventType(ACTIVEEVENT, state=1, gain=0) * */ break; /* "pygame_sdl2/event.pyx":200 * * # SDL_APPINPUTFOCUS * elif e.event == SDL_WINDOWEVENT_FOCUS_GAINED: # <<<<<<<<<<<<<< * return EventType(ACTIVEEVENT, state=2, gain=1) * elif e.event == SDL_WINDOWEVENT_FOCUS_LOST: */ case SDL_WINDOWEVENT_FOCUS_GAINED: /* "pygame_sdl2/event.pyx":201 * # SDL_APPINPUTFOCUS * elif e.event == SDL_WINDOWEVENT_FOCUS_GAINED: * return EventType(ACTIVEEVENT, state=2, gain=1) # <<<<<<<<<<<<<< * elif e.event == SDL_WINDOWEVENT_FOCUS_LOST: * return EventType(ACTIVEEVENT, state=2, gain=0) */ __Pyx_XDECREF(__pyx_r); __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_EventType); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 201; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_ACTIVEEVENT); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 201; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 201; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __Pyx_GIVEREF(__pyx_t_2); PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_2); __pyx_t_2 = 0; __pyx_t_2 = PyDict_New(); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 201; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_state, __pyx_int_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 201; __pyx_clineno = __LINE__; goto __pyx_L1_error;} if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_gain, __pyx_int_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 201; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_3, __pyx_t_2); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 201; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_r = __pyx_t_4; __pyx_t_4 = 0; goto __pyx_L0; /* "pygame_sdl2/event.pyx":200 * * # SDL_APPINPUTFOCUS * elif e.event == SDL_WINDOWEVENT_FOCUS_GAINED: # <<<<<<<<<<<<<< * return EventType(ACTIVEEVENT, state=2, gain=1) * elif e.event == SDL_WINDOWEVENT_FOCUS_LOST: */ break; /* "pygame_sdl2/event.pyx":202 * elif e.event == SDL_WINDOWEVENT_FOCUS_GAINED: * return EventType(ACTIVEEVENT, state=2, gain=1) * elif e.event == SDL_WINDOWEVENT_FOCUS_LOST: # <<<<<<<<<<<<<< * return EventType(ACTIVEEVENT, state=2, gain=0) * */ case SDL_WINDOWEVENT_FOCUS_LOST: /* "pygame_sdl2/event.pyx":203 * return EventType(ACTIVEEVENT, state=2, gain=1) * elif e.event == SDL_WINDOWEVENT_FOCUS_LOST: * return EventType(ACTIVEEVENT, state=2, gain=0) # <<<<<<<<<<<<<< * * # SDL_APPACTIVE */ __Pyx_XDECREF(__pyx_r); __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_EventType); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 203; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_ACTIVEEVENT); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 203; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 203; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __Pyx_GIVEREF(__pyx_t_2); PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_2); __pyx_t_2 = 0; __pyx_t_2 = PyDict_New(); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 203; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_state, __pyx_int_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 203; __pyx_clineno = __LINE__; goto __pyx_L1_error;} if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_gain, __pyx_int_0) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 203; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_3, __pyx_t_2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 203; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "pygame_sdl2/event.pyx":202 * elif e.event == SDL_WINDOWEVENT_FOCUS_GAINED: * return EventType(ACTIVEEVENT, state=2, gain=1) * elif e.event == SDL_WINDOWEVENT_FOCUS_LOST: # <<<<<<<<<<<<<< * return EventType(ACTIVEEVENT, state=2, gain=0) * */ break; /* "pygame_sdl2/event.pyx":206 * * # SDL_APPACTIVE * elif e.event == SDL_WINDOWEVENT_RESTORED: # <<<<<<<<<<<<<< * return EventType(ACTIVEEVENT, state=4, gain=1) * elif e.event == SDL_WINDOWEVENT_MINIMIZED: */ case SDL_WINDOWEVENT_RESTORED: /* "pygame_sdl2/event.pyx":207 * # SDL_APPACTIVE * elif e.event == SDL_WINDOWEVENT_RESTORED: * return EventType(ACTIVEEVENT, state=4, gain=1) # <<<<<<<<<<<<<< * elif e.event == SDL_WINDOWEVENT_MINIMIZED: * return EventType(ACTIVEEVENT, state=4, gain=0) */ __Pyx_XDECREF(__pyx_r); __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_EventType); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 207; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_ACTIVEEVENT); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 207; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 207; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __Pyx_GIVEREF(__pyx_t_2); PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_2); __pyx_t_2 = 0; __pyx_t_2 = PyDict_New(); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 207; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_state, __pyx_int_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 207; __pyx_clineno = __LINE__; goto __pyx_L1_error;} if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_gain, __pyx_int_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 207; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_3, __pyx_t_2); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 207; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_r = __pyx_t_4; __pyx_t_4 = 0; goto __pyx_L0; /* "pygame_sdl2/event.pyx":206 * * # SDL_APPACTIVE * elif e.event == SDL_WINDOWEVENT_RESTORED: # <<<<<<<<<<<<<< * return EventType(ACTIVEEVENT, state=4, gain=1) * elif e.event == SDL_WINDOWEVENT_MINIMIZED: */ break; /* "pygame_sdl2/event.pyx":208 * elif e.event == SDL_WINDOWEVENT_RESTORED: * return EventType(ACTIVEEVENT, state=4, gain=1) * elif e.event == SDL_WINDOWEVENT_MINIMIZED: # <<<<<<<<<<<<<< * return EventType(ACTIVEEVENT, state=4, gain=0) * */ case SDL_WINDOWEVENT_MINIMIZED: /* "pygame_sdl2/event.pyx":209 * return EventType(ACTIVEEVENT, state=4, gain=1) * elif e.event == SDL_WINDOWEVENT_MINIMIZED: * return EventType(ACTIVEEVENT, state=4, gain=0) # <<<<<<<<<<<<<< * * elif e.event == SDL_WINDOWEVENT_RESIZED: */ __Pyx_XDECREF(__pyx_r); __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_EventType); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 209; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_ACTIVEEVENT); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 209; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 209; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __Pyx_GIVEREF(__pyx_t_2); PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_2); __pyx_t_2 = 0; __pyx_t_2 = PyDict_New(); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 209; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_state, __pyx_int_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 209; __pyx_clineno = __LINE__; goto __pyx_L1_error;} if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_gain, __pyx_int_0) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 209; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_3, __pyx_t_2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 209; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "pygame_sdl2/event.pyx":208 * elif e.event == SDL_WINDOWEVENT_RESTORED: * return EventType(ACTIVEEVENT, state=4, gain=1) * elif e.event == SDL_WINDOWEVENT_MINIMIZED: # <<<<<<<<<<<<<< * return EventType(ACTIVEEVENT, state=4, gain=0) * */ break; /* "pygame_sdl2/event.pyx":211 * return EventType(ACTIVEEVENT, state=4, gain=0) * * elif e.event == SDL_WINDOWEVENT_RESIZED: # <<<<<<<<<<<<<< * return EventType(VIDEORESIZE, size=(e.data1, e.data2), w=e.data1, h=e.data2) * */ case SDL_WINDOWEVENT_RESIZED: /* "pygame_sdl2/event.pyx":212 * * elif e.event == SDL_WINDOWEVENT_RESIZED: * return EventType(VIDEORESIZE, size=(e.data1, e.data2), w=e.data1, h=e.data2) # <<<<<<<<<<<<<< * * elif e.event == SDL_WINDOWEVENT_EXPOSED: */ __Pyx_XDECREF(__pyx_r); __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_EventType); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 212; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_VIDEORESIZE); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 212; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 212; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __Pyx_GIVEREF(__pyx_t_2); PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_2); __pyx_t_2 = 0; __pyx_t_2 = PyDict_New(); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 212; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __pyx_t_4 = __Pyx_PyInt_From_int32_t(__pyx_v_e->data1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 212; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); __pyx_t_5 = __Pyx_PyInt_From_int32_t(__pyx_v_e->data2); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 212; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); __pyx_t_6 = PyTuple_New(2); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 212; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_6); __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_4); __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_6, 1, __pyx_t_5); __pyx_t_4 = 0; __pyx_t_5 = 0; if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_size, __pyx_t_6) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 212; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __pyx_t_6 = __Pyx_PyInt_From_int32_t(__pyx_v_e->data1); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 212; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_6); if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_w, __pyx_t_6) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 212; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __pyx_t_6 = __Pyx_PyInt_From_int32_t(__pyx_v_e->data2); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 212; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_6); if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_h, __pyx_t_6) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 212; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_3, __pyx_t_2); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 212; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_r = __pyx_t_6; __pyx_t_6 = 0; goto __pyx_L0; /* "pygame_sdl2/event.pyx":211 * return EventType(ACTIVEEVENT, state=4, gain=0) * * elif e.event == SDL_WINDOWEVENT_RESIZED: # <<<<<<<<<<<<<< * return EventType(VIDEORESIZE, size=(e.data1, e.data2), w=e.data1, h=e.data2) * */ break; /* "pygame_sdl2/event.pyx":214 * return EventType(VIDEORESIZE, size=(e.data1, e.data2), w=e.data1, h=e.data2) * * elif e.event == SDL_WINDOWEVENT_EXPOSED: # <<<<<<<<<<<<<< * return EventType(VIDEOEXPOSE) * */ case SDL_WINDOWEVENT_EXPOSED: /* "pygame_sdl2/event.pyx":215 * * elif e.event == SDL_WINDOWEVENT_EXPOSED: * return EventType(VIDEOEXPOSE) # <<<<<<<<<<<<<< * * return EventType(SDL_WINDOWEVENT, event=e.event, data1=e.data1, data2=e.data2) */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_EventType); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 215; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_VIDEOEXPOSE); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 215; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __pyx_t_1 = NULL; if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_2))) { __pyx_t_1 = PyMethod_GET_SELF(__pyx_t_2); if (likely(__pyx_t_1)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_1); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); } } if (!__pyx_t_1) { __pyx_t_6 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 215; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_GOTREF(__pyx_t_6); } else { __pyx_t_5 = PyTuple_New(1+1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 215; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); __Pyx_GIVEREF(__pyx_t_1); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_1); __pyx_t_1 = NULL; __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_5, 0+1, __pyx_t_3); __pyx_t_3 = 0; __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_5, NULL); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 215; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; } __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_r = __pyx_t_6; __pyx_t_6 = 0; goto __pyx_L0; /* "pygame_sdl2/event.pyx":214 * return EventType(VIDEORESIZE, size=(e.data1, e.data2), w=e.data1, h=e.data2) * * elif e.event == SDL_WINDOWEVENT_EXPOSED: # <<<<<<<<<<<<<< * return EventType(VIDEOEXPOSE) * */ break; default: break; } /* "pygame_sdl2/event.pyx":217 * return EventType(VIDEOEXPOSE) * * return EventType(SDL_WINDOWEVENT, event=e.event, data1=e.data1, data2=e.data2) # <<<<<<<<<<<<<< * * cdef make_event(SDL_Event *e): */ __Pyx_XDECREF(__pyx_r); __pyx_t_6 = __Pyx_GetModuleGlobalName(__pyx_n_s_EventType); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 217; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_6); __pyx_t_2 = __Pyx_PyInt_From_SDL_EventType(SDL_WINDOWEVENT); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 217; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 217; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); __Pyx_GIVEREF(__pyx_t_2); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_2); __pyx_t_2 = 0; __pyx_t_2 = PyDict_New(); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 217; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = __Pyx_PyInt_From_uint8_t(__pyx_v_e->event); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 217; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_event, __pyx_t_3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 217; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_3 = __Pyx_PyInt_From_int32_t(__pyx_v_e->data1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 217; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_data1, __pyx_t_3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 217; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_3 = __Pyx_PyInt_From_int32_t(__pyx_v_e->data2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 217; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_data2, __pyx_t_3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 217; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_5, __pyx_t_2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 217; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_r = __pyx_t_3; __pyx_t_3 = 0; goto __pyx_L0; /* "pygame_sdl2/event.pyx":192 * return EventType(e.type, text=e.text.decode("utf-8"), start=e.start, length=e.length) * * cdef make_window_event(SDL_WindowEvent *e): # <<<<<<<<<<<<<< * # SDL_APPMOUSEFOCUS * if e.event == SDL_WINDOWEVENT_ENTER: */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_5); __Pyx_XDECREF(__pyx_t_6); __Pyx_AddTraceback("pygame_sdl2.event.make_window_event", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/event.pyx":219 * return EventType(SDL_WINDOWEVENT, event=e.event, data1=e.data1, data2=e.data2) * * cdef make_event(SDL_Event *e): # <<<<<<<<<<<<<< * cdef object o * */ static PyObject *__pyx_f_11pygame_sdl2_5event_make_event(SDL_Event *__pyx_v_e) { PyObject *__pyx_v_o = 0; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; PyObject *__pyx_t_2 = NULL; int __pyx_t_3; PyObject *__pyx_t_4 = NULL; PyObject *__pyx_t_5 = NULL; PyObject *__pyx_t_6 = NULL; PyObject *__pyx_t_7 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("make_event", 0); /* "pygame_sdl2/event.pyx":222 * cdef object o * * if e.type == SDL_MOUSEMOTION: # <<<<<<<<<<<<<< * return make_mousemotion_event(e) * elif e.type in (SDL_MOUSEBUTTONDOWN, SDL_MOUSEBUTTONUP): */ __pyx_t_1 = ((__pyx_v_e->type == SDL_MOUSEMOTION) != 0); if (__pyx_t_1) { /* "pygame_sdl2/event.pyx":223 * * if e.type == SDL_MOUSEMOTION: * return make_mousemotion_event(e) # <<<<<<<<<<<<<< * elif e.type in (SDL_MOUSEBUTTONDOWN, SDL_MOUSEBUTTONUP): * return make_mousebtn_event(e) */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __pyx_f_11pygame_sdl2_5event_make_mousemotion_event(((SDL_MouseMotionEvent *)__pyx_v_e)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 223; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; /* "pygame_sdl2/event.pyx":222 * cdef object o * * if e.type == SDL_MOUSEMOTION: # <<<<<<<<<<<<<< * return make_mousemotion_event(e) * elif e.type in (SDL_MOUSEBUTTONDOWN, SDL_MOUSEBUTTONUP): */ } /* "pygame_sdl2/event.pyx":224 * if e.type == SDL_MOUSEMOTION: * return make_mousemotion_event(e) * elif e.type in (SDL_MOUSEBUTTONDOWN, SDL_MOUSEBUTTONUP): # <<<<<<<<<<<<<< * return make_mousebtn_event(e) * */ switch (__pyx_v_e->type) { case SDL_MOUSEBUTTONDOWN: case SDL_MOUSEBUTTONUP: __pyx_t_1 = 1; break; default: __pyx_t_1 = 0; break; } __pyx_t_3 = (__pyx_t_1 != 0); if (__pyx_t_3) { /* "pygame_sdl2/event.pyx":225 * return make_mousemotion_event(e) * elif e.type in (SDL_MOUSEBUTTONDOWN, SDL_MOUSEBUTTONUP): * return make_mousebtn_event(e) # <<<<<<<<<<<<<< * * elif e.type == SDL_MOUSEWHEEL: */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __pyx_f_11pygame_sdl2_5event_make_mousebtn_event(((SDL_MouseButtonEvent *)__pyx_v_e)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 225; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; /* "pygame_sdl2/event.pyx":224 * if e.type == SDL_MOUSEMOTION: * return make_mousemotion_event(e) * elif e.type in (SDL_MOUSEBUTTONDOWN, SDL_MOUSEBUTTONUP): # <<<<<<<<<<<<<< * return make_mousebtn_event(e) * */ } /* "pygame_sdl2/event.pyx":227 * return make_mousebtn_event(e) * * elif e.type == SDL_MOUSEWHEEL: # <<<<<<<<<<<<<< * return make_mousewheel_event(e) * elif e.type in (SDL_KEYDOWN, SDL_KEYUP): */ __pyx_t_3 = ((__pyx_v_e->type == SDL_MOUSEWHEEL) != 0); if (__pyx_t_3) { /* "pygame_sdl2/event.pyx":228 * * elif e.type == SDL_MOUSEWHEEL: * return make_mousewheel_event(e) # <<<<<<<<<<<<<< * elif e.type in (SDL_KEYDOWN, SDL_KEYUP): * return make_keyboard_event(e) */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __pyx_f_11pygame_sdl2_5event_make_mousewheel_event(((SDL_MouseWheelEvent *)__pyx_v_e)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 228; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; /* "pygame_sdl2/event.pyx":227 * return make_mousebtn_event(e) * * elif e.type == SDL_MOUSEWHEEL: # <<<<<<<<<<<<<< * return make_mousewheel_event(e) * elif e.type in (SDL_KEYDOWN, SDL_KEYUP): */ } /* "pygame_sdl2/event.pyx":229 * elif e.type == SDL_MOUSEWHEEL: * return make_mousewheel_event(e) * elif e.type in (SDL_KEYDOWN, SDL_KEYUP): # <<<<<<<<<<<<<< * return make_keyboard_event(e) * elif e.type == SDL_JOYAXISMOTION: */ switch (__pyx_v_e->type) { case SDL_KEYDOWN: case SDL_KEYUP: __pyx_t_3 = 1; break; default: __pyx_t_3 = 0; break; } __pyx_t_1 = (__pyx_t_3 != 0); if (__pyx_t_1) { /* "pygame_sdl2/event.pyx":230 * return make_mousewheel_event(e) * elif e.type in (SDL_KEYDOWN, SDL_KEYUP): * return make_keyboard_event(e) # <<<<<<<<<<<<<< * elif e.type == SDL_JOYAXISMOTION: * return make_joyaxis_event(e) */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __pyx_f_11pygame_sdl2_5event_make_keyboard_event(((SDL_KeyboardEvent *)__pyx_v_e)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 230; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; /* "pygame_sdl2/event.pyx":229 * elif e.type == SDL_MOUSEWHEEL: * return make_mousewheel_event(e) * elif e.type in (SDL_KEYDOWN, SDL_KEYUP): # <<<<<<<<<<<<<< * return make_keyboard_event(e) * elif e.type == SDL_JOYAXISMOTION: */ } /* "pygame_sdl2/event.pyx":231 * elif e.type in (SDL_KEYDOWN, SDL_KEYUP): * return make_keyboard_event(e) * elif e.type == SDL_JOYAXISMOTION: # <<<<<<<<<<<<<< * return make_joyaxis_event(e) * elif e.type == SDL_JOYBALLMOTION: */ __pyx_t_1 = ((__pyx_v_e->type == SDL_JOYAXISMOTION) != 0); if (__pyx_t_1) { /* "pygame_sdl2/event.pyx":232 * return make_keyboard_event(e) * elif e.type == SDL_JOYAXISMOTION: * return make_joyaxis_event(e) # <<<<<<<<<<<<<< * elif e.type == SDL_JOYBALLMOTION: * return make_joyball_event(e) */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __pyx_f_11pygame_sdl2_5event_make_joyaxis_event(((SDL_JoyAxisEvent *)__pyx_v_e)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 232; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; /* "pygame_sdl2/event.pyx":231 * elif e.type in (SDL_KEYDOWN, SDL_KEYUP): * return make_keyboard_event(e) * elif e.type == SDL_JOYAXISMOTION: # <<<<<<<<<<<<<< * return make_joyaxis_event(e) * elif e.type == SDL_JOYBALLMOTION: */ } /* "pygame_sdl2/event.pyx":233 * elif e.type == SDL_JOYAXISMOTION: * return make_joyaxis_event(e) * elif e.type == SDL_JOYBALLMOTION: # <<<<<<<<<<<<<< * return make_joyball_event(e) * elif e.type == SDL_JOYHATMOTION: */ __pyx_t_1 = ((__pyx_v_e->type == SDL_JOYBALLMOTION) != 0); if (__pyx_t_1) { /* "pygame_sdl2/event.pyx":234 * return make_joyaxis_event(e) * elif e.type == SDL_JOYBALLMOTION: * return make_joyball_event(e) # <<<<<<<<<<<<<< * elif e.type == SDL_JOYHATMOTION: * return make_joyhat_event(e) */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __pyx_f_11pygame_sdl2_5event_make_joyball_event(((SDL_JoyBallEvent *)__pyx_v_e)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 234; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; /* "pygame_sdl2/event.pyx":233 * elif e.type == SDL_JOYAXISMOTION: * return make_joyaxis_event(e) * elif e.type == SDL_JOYBALLMOTION: # <<<<<<<<<<<<<< * return make_joyball_event(e) * elif e.type == SDL_JOYHATMOTION: */ } /* "pygame_sdl2/event.pyx":235 * elif e.type == SDL_JOYBALLMOTION: * return make_joyball_event(e) * elif e.type == SDL_JOYHATMOTION: # <<<<<<<<<<<<<< * return make_joyhat_event(e) * elif e.type in (SDL_JOYBUTTONDOWN, SDL_JOYBUTTONUP): */ __pyx_t_1 = ((__pyx_v_e->type == SDL_JOYHATMOTION) != 0); if (__pyx_t_1) { /* "pygame_sdl2/event.pyx":236 * return make_joyball_event(e) * elif e.type == SDL_JOYHATMOTION: * return make_joyhat_event(e) # <<<<<<<<<<<<<< * elif e.type in (SDL_JOYBUTTONDOWN, SDL_JOYBUTTONUP): * return make_joybtn_event(e) */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __pyx_f_11pygame_sdl2_5event_make_joyhat_event(((SDL_JoyHatEvent *)__pyx_v_e)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 236; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; /* "pygame_sdl2/event.pyx":235 * elif e.type == SDL_JOYBALLMOTION: * return make_joyball_event(e) * elif e.type == SDL_JOYHATMOTION: # <<<<<<<<<<<<<< * return make_joyhat_event(e) * elif e.type in (SDL_JOYBUTTONDOWN, SDL_JOYBUTTONUP): */ } /* "pygame_sdl2/event.pyx":237 * elif e.type == SDL_JOYHATMOTION: * return make_joyhat_event(e) * elif e.type in (SDL_JOYBUTTONDOWN, SDL_JOYBUTTONUP): # <<<<<<<<<<<<<< * return make_joybtn_event(e) * elif e.type in (SDL_JOYDEVICEADDED, SDL_JOYDEVICEREMOVED): */ switch (__pyx_v_e->type) { case SDL_JOYBUTTONDOWN: case SDL_JOYBUTTONUP: __pyx_t_1 = 1; break; default: __pyx_t_1 = 0; break; } __pyx_t_3 = (__pyx_t_1 != 0); if (__pyx_t_3) { /* "pygame_sdl2/event.pyx":238 * return make_joyhat_event(e) * elif e.type in (SDL_JOYBUTTONDOWN, SDL_JOYBUTTONUP): * return make_joybtn_event(e) # <<<<<<<<<<<<<< * elif e.type in (SDL_JOYDEVICEADDED, SDL_JOYDEVICEREMOVED): * return EventType(e.type, which=e.jdevice.which) */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __pyx_f_11pygame_sdl2_5event_make_joybtn_event(((SDL_JoyButtonEvent *)__pyx_v_e)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 238; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; /* "pygame_sdl2/event.pyx":237 * elif e.type == SDL_JOYHATMOTION: * return make_joyhat_event(e) * elif e.type in (SDL_JOYBUTTONDOWN, SDL_JOYBUTTONUP): # <<<<<<<<<<<<<< * return make_joybtn_event(e) * elif e.type in (SDL_JOYDEVICEADDED, SDL_JOYDEVICEREMOVED): */ } /* "pygame_sdl2/event.pyx":239 * elif e.type in (SDL_JOYBUTTONDOWN, SDL_JOYBUTTONUP): * return make_joybtn_event(e) * elif e.type in (SDL_JOYDEVICEADDED, SDL_JOYDEVICEREMOVED): # <<<<<<<<<<<<<< * return EventType(e.type, which=e.jdevice.which) * elif e.type == SDL_WINDOWEVENT: */ switch (__pyx_v_e->type) { case SDL_JOYDEVICEADDED: case SDL_JOYDEVICEREMOVED: __pyx_t_3 = 1; break; default: __pyx_t_3 = 0; break; } __pyx_t_1 = (__pyx_t_3 != 0); if (__pyx_t_1) { /* "pygame_sdl2/event.pyx":240 * return make_joybtn_event(e) * elif e.type in (SDL_JOYDEVICEADDED, SDL_JOYDEVICEREMOVED): * return EventType(e.type, which=e.jdevice.which) # <<<<<<<<<<<<<< * elif e.type == SDL_WINDOWEVENT: * return make_window_event(e) */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_EventType); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 240; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __pyx_t_4 = __Pyx_PyInt_From_uint32_t(__pyx_v_e->type); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 240; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 240; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_4); __pyx_t_4 = 0; __pyx_t_4 = PyDict_New(); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 240; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); __pyx_t_6 = __Pyx_PyInt_From_int32_t(__pyx_v_e->jdevice.which); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 240; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_6); if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_which, __pyx_t_6) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 240; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_5, __pyx_t_4); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 240; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_r = __pyx_t_6; __pyx_t_6 = 0; goto __pyx_L0; /* "pygame_sdl2/event.pyx":239 * elif e.type in (SDL_JOYBUTTONDOWN, SDL_JOYBUTTONUP): * return make_joybtn_event(e) * elif e.type in (SDL_JOYDEVICEADDED, SDL_JOYDEVICEREMOVED): # <<<<<<<<<<<<<< * return EventType(e.type, which=e.jdevice.which) * elif e.type == SDL_WINDOWEVENT: */ } /* "pygame_sdl2/event.pyx":241 * elif e.type in (SDL_JOYDEVICEADDED, SDL_JOYDEVICEREMOVED): * return EventType(e.type, which=e.jdevice.which) * elif e.type == SDL_WINDOWEVENT: # <<<<<<<<<<<<<< * return make_window_event(e) * elif e.type == SDL_TEXTINPUT: */ __pyx_t_1 = ((__pyx_v_e->type == SDL_WINDOWEVENT) != 0); if (__pyx_t_1) { /* "pygame_sdl2/event.pyx":242 * return EventType(e.type, which=e.jdevice.which) * elif e.type == SDL_WINDOWEVENT: * return make_window_event(e) # <<<<<<<<<<<<<< * elif e.type == SDL_TEXTINPUT: * return make_textinput_event( e) */ __Pyx_XDECREF(__pyx_r); __pyx_t_6 = __pyx_f_11pygame_sdl2_5event_make_window_event(((SDL_WindowEvent *)__pyx_v_e)); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 242; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_6); __pyx_r = __pyx_t_6; __pyx_t_6 = 0; goto __pyx_L0; /* "pygame_sdl2/event.pyx":241 * elif e.type in (SDL_JOYDEVICEADDED, SDL_JOYDEVICEREMOVED): * return EventType(e.type, which=e.jdevice.which) * elif e.type == SDL_WINDOWEVENT: # <<<<<<<<<<<<<< * return make_window_event(e) * elif e.type == SDL_TEXTINPUT: */ } /* "pygame_sdl2/event.pyx":243 * elif e.type == SDL_WINDOWEVENT: * return make_window_event(e) * elif e.type == SDL_TEXTINPUT: # <<<<<<<<<<<<<< * return make_textinput_event( e) * elif e.type == SDL_TEXTEDITING: */ __pyx_t_1 = ((__pyx_v_e->type == SDL_TEXTINPUT) != 0); if (__pyx_t_1) { /* "pygame_sdl2/event.pyx":244 * return make_window_event(e) * elif e.type == SDL_TEXTINPUT: * return make_textinput_event( e) # <<<<<<<<<<<<<< * elif e.type == SDL_TEXTEDITING: * return make_textediting_event( e) */ __Pyx_XDECREF(__pyx_r); __pyx_t_6 = __pyx_f_11pygame_sdl2_5event_make_textinput_event(((SDL_TextInputEvent *)__pyx_v_e)); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 244; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_6); __pyx_r = __pyx_t_6; __pyx_t_6 = 0; goto __pyx_L0; /* "pygame_sdl2/event.pyx":243 * elif e.type == SDL_WINDOWEVENT: * return make_window_event(e) * elif e.type == SDL_TEXTINPUT: # <<<<<<<<<<<<<< * return make_textinput_event( e) * elif e.type == SDL_TEXTEDITING: */ } /* "pygame_sdl2/event.pyx":245 * elif e.type == SDL_TEXTINPUT: * return make_textinput_event( e) * elif e.type == SDL_TEXTEDITING: # <<<<<<<<<<<<<< * return make_textediting_event( e) * elif e.type == SDL_CONTROLLERAXISMOTION: */ __pyx_t_1 = ((__pyx_v_e->type == SDL_TEXTEDITING) != 0); if (__pyx_t_1) { /* "pygame_sdl2/event.pyx":246 * return make_textinput_event( e) * elif e.type == SDL_TEXTEDITING: * return make_textediting_event( e) # <<<<<<<<<<<<<< * elif e.type == SDL_CONTROLLERAXISMOTION: * return EventType(e.type, which=e.caxis.which, axis=e.caxis.axis, value=e.caxis.value) */ __Pyx_XDECREF(__pyx_r); __pyx_t_6 = __pyx_f_11pygame_sdl2_5event_make_textediting_event(((SDL_TextEditingEvent *)__pyx_v_e)); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 246; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_6); __pyx_r = __pyx_t_6; __pyx_t_6 = 0; goto __pyx_L0; /* "pygame_sdl2/event.pyx":245 * elif e.type == SDL_TEXTINPUT: * return make_textinput_event( e) * elif e.type == SDL_TEXTEDITING: # <<<<<<<<<<<<<< * return make_textediting_event( e) * elif e.type == SDL_CONTROLLERAXISMOTION: */ } /* "pygame_sdl2/event.pyx":247 * elif e.type == SDL_TEXTEDITING: * return make_textediting_event( e) * elif e.type == SDL_CONTROLLERAXISMOTION: # <<<<<<<<<<<<<< * return EventType(e.type, which=e.caxis.which, axis=e.caxis.axis, value=e.caxis.value) * elif e.type in (SDL_CONTROLLERBUTTONDOWN, SDL_CONTROLLERBUTTONUP): */ __pyx_t_1 = ((__pyx_v_e->type == SDL_CONTROLLERAXISMOTION) != 0); if (__pyx_t_1) { /* "pygame_sdl2/event.pyx":248 * return make_textediting_event( e) * elif e.type == SDL_CONTROLLERAXISMOTION: * return EventType(e.type, which=e.caxis.which, axis=e.caxis.axis, value=e.caxis.value) # <<<<<<<<<<<<<< * elif e.type in (SDL_CONTROLLERBUTTONDOWN, SDL_CONTROLLERBUTTONUP): * return EventType(e.type, which=e.cbutton.which, button=e.cbutton.button, state=e.cbutton.state) */ __Pyx_XDECREF(__pyx_r); __pyx_t_6 = __Pyx_GetModuleGlobalName(__pyx_n_s_EventType); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 248; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_6); __pyx_t_4 = __Pyx_PyInt_From_uint32_t(__pyx_v_e->type); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 248; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 248; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_4); __pyx_t_4 = 0; __pyx_t_4 = PyDict_New(); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 248; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); __pyx_t_2 = __Pyx_PyInt_From_int32_t(__pyx_v_e->caxis.which); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 248; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_which, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 248; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_2 = __Pyx_PyInt_From_uint8_t(__pyx_v_e->caxis.axis); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 248; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_axis, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 248; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_2 = __Pyx_PyInt_From_int16_t(__pyx_v_e->caxis.value); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 248; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_value, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 248; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_5, __pyx_t_4); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 248; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; /* "pygame_sdl2/event.pyx":247 * elif e.type == SDL_TEXTEDITING: * return make_textediting_event( e) * elif e.type == SDL_CONTROLLERAXISMOTION: # <<<<<<<<<<<<<< * return EventType(e.type, which=e.caxis.which, axis=e.caxis.axis, value=e.caxis.value) * elif e.type in (SDL_CONTROLLERBUTTONDOWN, SDL_CONTROLLERBUTTONUP): */ } /* "pygame_sdl2/event.pyx":249 * elif e.type == SDL_CONTROLLERAXISMOTION: * return EventType(e.type, which=e.caxis.which, axis=e.caxis.axis, value=e.caxis.value) * elif e.type in (SDL_CONTROLLERBUTTONDOWN, SDL_CONTROLLERBUTTONUP): # <<<<<<<<<<<<<< * return EventType(e.type, which=e.cbutton.which, button=e.cbutton.button, state=e.cbutton.state) * elif e.type in (SDL_CONTROLLERDEVICEADDED, SDL_CONTROLLERDEVICEREMOVED, SDL_CONTROLLERDEVICEREMAPPED): */ switch (__pyx_v_e->type) { case SDL_CONTROLLERBUTTONDOWN: case SDL_CONTROLLERBUTTONUP: __pyx_t_1 = 1; break; default: __pyx_t_1 = 0; break; } __pyx_t_3 = (__pyx_t_1 != 0); if (__pyx_t_3) { /* "pygame_sdl2/event.pyx":250 * return EventType(e.type, which=e.caxis.which, axis=e.caxis.axis, value=e.caxis.value) * elif e.type in (SDL_CONTROLLERBUTTONDOWN, SDL_CONTROLLERBUTTONUP): * return EventType(e.type, which=e.cbutton.which, button=e.cbutton.button, state=e.cbutton.state) # <<<<<<<<<<<<<< * elif e.type in (SDL_CONTROLLERDEVICEADDED, SDL_CONTROLLERDEVICEREMOVED, SDL_CONTROLLERDEVICEREMAPPED): * return EventType(e.type, which=e.cdevice.which) */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_EventType); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 250; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __pyx_t_4 = __Pyx_PyInt_From_uint32_t(__pyx_v_e->type); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 250; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 250; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_4); __pyx_t_4 = 0; __pyx_t_4 = PyDict_New(); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 250; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); __pyx_t_6 = __Pyx_PyInt_From_int32_t(__pyx_v_e->cbutton.which); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 250; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_6); if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_which, __pyx_t_6) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 250; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __pyx_t_6 = __Pyx_PyInt_From_uint8_t(__pyx_v_e->cbutton.button); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 250; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_6); if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_button, __pyx_t_6) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 250; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __pyx_t_6 = __Pyx_PyInt_From_uint8_t(__pyx_v_e->cbutton.state); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 250; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_6); if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_state, __pyx_t_6) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 250; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_5, __pyx_t_4); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 250; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_r = __pyx_t_6; __pyx_t_6 = 0; goto __pyx_L0; /* "pygame_sdl2/event.pyx":249 * elif e.type == SDL_CONTROLLERAXISMOTION: * return EventType(e.type, which=e.caxis.which, axis=e.caxis.axis, value=e.caxis.value) * elif e.type in (SDL_CONTROLLERBUTTONDOWN, SDL_CONTROLLERBUTTONUP): # <<<<<<<<<<<<<< * return EventType(e.type, which=e.cbutton.which, button=e.cbutton.button, state=e.cbutton.state) * elif e.type in (SDL_CONTROLLERDEVICEADDED, SDL_CONTROLLERDEVICEREMOVED, SDL_CONTROLLERDEVICEREMAPPED): */ } /* "pygame_sdl2/event.pyx":251 * elif e.type in (SDL_CONTROLLERBUTTONDOWN, SDL_CONTROLLERBUTTONUP): * return EventType(e.type, which=e.cbutton.which, button=e.cbutton.button, state=e.cbutton.state) * elif e.type in (SDL_CONTROLLERDEVICEADDED, SDL_CONTROLLERDEVICEREMOVED, SDL_CONTROLLERDEVICEREMAPPED): # <<<<<<<<<<<<<< * return EventType(e.type, which=e.cdevice.which) * elif e.type in (SDL_FINGERMOTION, SDL_FINGERDOWN, SDL_FINGERUP): */ switch (__pyx_v_e->type) { case SDL_CONTROLLERDEVICEADDED: case SDL_CONTROLLERDEVICEREMOVED: case SDL_CONTROLLERDEVICEREMAPPED: __pyx_t_3 = 1; break; default: __pyx_t_3 = 0; break; } __pyx_t_1 = (__pyx_t_3 != 0); if (__pyx_t_1) { /* "pygame_sdl2/event.pyx":252 * return EventType(e.type, which=e.cbutton.which, button=e.cbutton.button, state=e.cbutton.state) * elif e.type in (SDL_CONTROLLERDEVICEADDED, SDL_CONTROLLERDEVICEREMOVED, SDL_CONTROLLERDEVICEREMAPPED): * return EventType(e.type, which=e.cdevice.which) # <<<<<<<<<<<<<< * elif e.type in (SDL_FINGERMOTION, SDL_FINGERDOWN, SDL_FINGERUP): * return EventType(e.type, touchId=e.tfinger.touchId, fingerId=e.tfinger.fingerId, x=e.tfinger.x, y=e.tfinger.y, dx=e.tfinger.dx, dy=e.tfinger.dy, pressure=e.tfinger.pressure) */ __Pyx_XDECREF(__pyx_r); __pyx_t_6 = __Pyx_GetModuleGlobalName(__pyx_n_s_EventType); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 252; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_6); __pyx_t_4 = __Pyx_PyInt_From_uint32_t(__pyx_v_e->type); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 252; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 252; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_4); __pyx_t_4 = 0; __pyx_t_4 = PyDict_New(); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 252; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); __pyx_t_2 = __Pyx_PyInt_From_int32_t(__pyx_v_e->cdevice.which); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 252; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_which, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 252; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_5, __pyx_t_4); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 252; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; /* "pygame_sdl2/event.pyx":251 * elif e.type in (SDL_CONTROLLERBUTTONDOWN, SDL_CONTROLLERBUTTONUP): * return EventType(e.type, which=e.cbutton.which, button=e.cbutton.button, state=e.cbutton.state) * elif e.type in (SDL_CONTROLLERDEVICEADDED, SDL_CONTROLLERDEVICEREMOVED, SDL_CONTROLLERDEVICEREMAPPED): # <<<<<<<<<<<<<< * return EventType(e.type, which=e.cdevice.which) * elif e.type in (SDL_FINGERMOTION, SDL_FINGERDOWN, SDL_FINGERUP): */ } /* "pygame_sdl2/event.pyx":253 * elif e.type in (SDL_CONTROLLERDEVICEADDED, SDL_CONTROLLERDEVICEREMOVED, SDL_CONTROLLERDEVICEREMAPPED): * return EventType(e.type, which=e.cdevice.which) * elif e.type in (SDL_FINGERMOTION, SDL_FINGERDOWN, SDL_FINGERUP): # <<<<<<<<<<<<<< * return EventType(e.type, touchId=e.tfinger.touchId, fingerId=e.tfinger.fingerId, x=e.tfinger.x, y=e.tfinger.y, dx=e.tfinger.dx, dy=e.tfinger.dy, pressure=e.tfinger.pressure) * elif e.type == SDL_MULTIGESTURE: */ switch (__pyx_v_e->type) { case SDL_FINGERMOTION: case SDL_FINGERDOWN: case SDL_FINGERUP: __pyx_t_1 = 1; break; default: __pyx_t_1 = 0; break; } __pyx_t_3 = (__pyx_t_1 != 0); if (__pyx_t_3) { /* "pygame_sdl2/event.pyx":254 * return EventType(e.type, which=e.cdevice.which) * elif e.type in (SDL_FINGERMOTION, SDL_FINGERDOWN, SDL_FINGERUP): * return EventType(e.type, touchId=e.tfinger.touchId, fingerId=e.tfinger.fingerId, x=e.tfinger.x, y=e.tfinger.y, dx=e.tfinger.dx, dy=e.tfinger.dy, pressure=e.tfinger.pressure) # <<<<<<<<<<<<<< * elif e.type == SDL_MULTIGESTURE: * return EventType(e.type, touchId=e.mgesture.touchId, dTheta=e.mgesture.dTheta, dDist=e.mgesture.dDist, x=e.mgesture.x, y=e.mgesture.y, numFingers=e.mgesture.numFingers) */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_EventType); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 254; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __pyx_t_4 = __Pyx_PyInt_From_uint32_t(__pyx_v_e->type); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 254; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 254; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_4); __pyx_t_4 = 0; __pyx_t_4 = PyDict_New(); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 254; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); __pyx_t_6 = __Pyx_PyInt_From_int64_t(__pyx_v_e->tfinger.touchId); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 254; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_6); if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_touchId, __pyx_t_6) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 254; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __pyx_t_6 = __Pyx_PyInt_From_int64_t(__pyx_v_e->tfinger.fingerId); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 254; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_6); if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_fingerId, __pyx_t_6) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 254; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __pyx_t_6 = PyFloat_FromDouble(__pyx_v_e->tfinger.x); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 254; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_6); if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_x, __pyx_t_6) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 254; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __pyx_t_6 = PyFloat_FromDouble(__pyx_v_e->tfinger.y); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 254; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_6); if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_y, __pyx_t_6) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 254; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __pyx_t_6 = PyFloat_FromDouble(__pyx_v_e->tfinger.dx); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 254; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_6); if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_dx, __pyx_t_6) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 254; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __pyx_t_6 = PyFloat_FromDouble(__pyx_v_e->tfinger.dy); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 254; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_6); if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_dy, __pyx_t_6) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 254; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __pyx_t_6 = PyFloat_FromDouble(__pyx_v_e->tfinger.pressure); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 254; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_6); if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_pressure, __pyx_t_6) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 254; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_5, __pyx_t_4); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 254; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_r = __pyx_t_6; __pyx_t_6 = 0; goto __pyx_L0; /* "pygame_sdl2/event.pyx":253 * elif e.type in (SDL_CONTROLLERDEVICEADDED, SDL_CONTROLLERDEVICEREMOVED, SDL_CONTROLLERDEVICEREMAPPED): * return EventType(e.type, which=e.cdevice.which) * elif e.type in (SDL_FINGERMOTION, SDL_FINGERDOWN, SDL_FINGERUP): # <<<<<<<<<<<<<< * return EventType(e.type, touchId=e.tfinger.touchId, fingerId=e.tfinger.fingerId, x=e.tfinger.x, y=e.tfinger.y, dx=e.tfinger.dx, dy=e.tfinger.dy, pressure=e.tfinger.pressure) * elif e.type == SDL_MULTIGESTURE: */ } /* "pygame_sdl2/event.pyx":255 * elif e.type in (SDL_FINGERMOTION, SDL_FINGERDOWN, SDL_FINGERUP): * return EventType(e.type, touchId=e.tfinger.touchId, fingerId=e.tfinger.fingerId, x=e.tfinger.x, y=e.tfinger.y, dx=e.tfinger.dx, dy=e.tfinger.dy, pressure=e.tfinger.pressure) * elif e.type == SDL_MULTIGESTURE: # <<<<<<<<<<<<<< * return EventType(e.type, touchId=e.mgesture.touchId, dTheta=e.mgesture.dTheta, dDist=e.mgesture.dDist, x=e.mgesture.x, y=e.mgesture.y, numFingers=e.mgesture.numFingers) * elif e.type == POSTEDEVENT: */ __pyx_t_3 = ((__pyx_v_e->type == SDL_MULTIGESTURE) != 0); if (__pyx_t_3) { /* "pygame_sdl2/event.pyx":256 * return EventType(e.type, touchId=e.tfinger.touchId, fingerId=e.tfinger.fingerId, x=e.tfinger.x, y=e.tfinger.y, dx=e.tfinger.dx, dy=e.tfinger.dy, pressure=e.tfinger.pressure) * elif e.type == SDL_MULTIGESTURE: * return EventType(e.type, touchId=e.mgesture.touchId, dTheta=e.mgesture.dTheta, dDist=e.mgesture.dDist, x=e.mgesture.x, y=e.mgesture.y, numFingers=e.mgesture.numFingers) # <<<<<<<<<<<<<< * elif e.type == POSTEDEVENT: * o = e.user.data1 */ __Pyx_XDECREF(__pyx_r); __pyx_t_6 = __Pyx_GetModuleGlobalName(__pyx_n_s_EventType); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 256; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_6); __pyx_t_4 = __Pyx_PyInt_From_uint32_t(__pyx_v_e->type); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 256; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 256; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_4); __pyx_t_4 = 0; __pyx_t_4 = PyDict_New(); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 256; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); __pyx_t_2 = __Pyx_PyInt_From_int64_t(__pyx_v_e->mgesture.touchId); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 256; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_touchId, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 256; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_2 = PyFloat_FromDouble(__pyx_v_e->mgesture.dTheta); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 256; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_dTheta, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 256; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_2 = PyFloat_FromDouble(__pyx_v_e->mgesture.dDist); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 256; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_dDist, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 256; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_2 = PyFloat_FromDouble(__pyx_v_e->mgesture.x); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 256; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_x, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 256; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_2 = PyFloat_FromDouble(__pyx_v_e->mgesture.y); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 256; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_y, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 256; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_2 = __Pyx_PyInt_From_uint16_t(__pyx_v_e->mgesture.numFingers); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 256; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_numFingers, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 256; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_5, __pyx_t_4); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 256; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; /* "pygame_sdl2/event.pyx":255 * elif e.type in (SDL_FINGERMOTION, SDL_FINGERDOWN, SDL_FINGERUP): * return EventType(e.type, touchId=e.tfinger.touchId, fingerId=e.tfinger.fingerId, x=e.tfinger.x, y=e.tfinger.y, dx=e.tfinger.dx, dy=e.tfinger.dy, pressure=e.tfinger.pressure) * elif e.type == SDL_MULTIGESTURE: # <<<<<<<<<<<<<< * return EventType(e.type, touchId=e.mgesture.touchId, dTheta=e.mgesture.dTheta, dDist=e.mgesture.dDist, x=e.mgesture.x, y=e.mgesture.y, numFingers=e.mgesture.numFingers) * elif e.type == POSTEDEVENT: */ } /* "pygame_sdl2/event.pyx":257 * elif e.type == SDL_MULTIGESTURE: * return EventType(e.type, touchId=e.mgesture.touchId, dTheta=e.mgesture.dTheta, dDist=e.mgesture.dDist, x=e.mgesture.x, y=e.mgesture.y, numFingers=e.mgesture.numFingers) * elif e.type == POSTEDEVENT: # <<<<<<<<<<<<<< * o = e.user.data1 * Py_DECREF(o) */ __pyx_t_3 = ((__pyx_v_e->type == __pyx_v_11pygame_sdl2_5event_POSTEDEVENT) != 0); if (__pyx_t_3) { /* "pygame_sdl2/event.pyx":258 * return EventType(e.type, touchId=e.mgesture.touchId, dTheta=e.mgesture.dTheta, dDist=e.mgesture.dDist, x=e.mgesture.x, y=e.mgesture.y, numFingers=e.mgesture.numFingers) * elif e.type == POSTEDEVENT: * o = e.user.data1 # <<<<<<<<<<<<<< * Py_DECREF(o) * return o */ __pyx_t_2 = ((PyObject *)__pyx_v_e->user.data1); __Pyx_INCREF(__pyx_t_2); __pyx_v_o = __pyx_t_2; __pyx_t_2 = 0; /* "pygame_sdl2/event.pyx":259 * elif e.type == POSTEDEVENT: * o = e.user.data1 * Py_DECREF(o) # <<<<<<<<<<<<<< * return o * elif e.type >= SDL_USEREVENT: */ Py_DECREF(__pyx_v_o); /* "pygame_sdl2/event.pyx":260 * o = e.user.data1 * Py_DECREF(o) * return o # <<<<<<<<<<<<<< * elif e.type >= SDL_USEREVENT: * # Can't do anything useful with data1 and data2 here. */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(__pyx_v_o); __pyx_r = __pyx_v_o; goto __pyx_L0; /* "pygame_sdl2/event.pyx":257 * elif e.type == SDL_MULTIGESTURE: * return EventType(e.type, touchId=e.mgesture.touchId, dTheta=e.mgesture.dTheta, dDist=e.mgesture.dDist, x=e.mgesture.x, y=e.mgesture.y, numFingers=e.mgesture.numFingers) * elif e.type == POSTEDEVENT: # <<<<<<<<<<<<<< * o = e.user.data1 * Py_DECREF(o) */ } /* "pygame_sdl2/event.pyx":261 * Py_DECREF(o) * return o * elif e.type >= SDL_USEREVENT: # <<<<<<<<<<<<<< * # Can't do anything useful with data1 and data2 here. * return EventType(e.type, code=e.user.code) */ __pyx_t_3 = ((__pyx_v_e->type >= SDL_USEREVENT) != 0); if (__pyx_t_3) { /* "pygame_sdl2/event.pyx":263 * elif e.type >= SDL_USEREVENT: * # Can't do anything useful with data1 and data2 here. * return EventType(e.type, code=e.user.code) # <<<<<<<<<<<<<< * * return EventType(e.type) */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_EventType); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 263; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __pyx_t_4 = __Pyx_PyInt_From_uint32_t(__pyx_v_e->type); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 263; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 263; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_4); __pyx_t_4 = 0; __pyx_t_4 = PyDict_New(); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 263; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); __pyx_t_6 = __Pyx_PyInt_From_int32_t(__pyx_v_e->user.code); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 263; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_6); if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_code, __pyx_t_6) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 263; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_5, __pyx_t_4); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 263; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_r = __pyx_t_6; __pyx_t_6 = 0; goto __pyx_L0; /* "pygame_sdl2/event.pyx":261 * Py_DECREF(o) * return o * elif e.type >= SDL_USEREVENT: # <<<<<<<<<<<<<< * # Can't do anything useful with data1 and data2 here. * return EventType(e.type, code=e.user.code) */ } /* "pygame_sdl2/event.pyx":265 * return EventType(e.type, code=e.user.code) * * return EventType(e.type) # <<<<<<<<<<<<<< * * */ __Pyx_XDECREF(__pyx_r); __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_EventType); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 265; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); __pyx_t_5 = __Pyx_PyInt_From_uint32_t(__pyx_v_e->type); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 265; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); __pyx_t_2 = NULL; if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_4))) { __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_4); if (likely(__pyx_t_2)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4); __Pyx_INCREF(__pyx_t_2); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_4, function); } } if (!__pyx_t_2) { __pyx_t_6 = __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_5); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 265; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_GOTREF(__pyx_t_6); } else { __pyx_t_7 = PyTuple_New(1+1); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 265; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_7); __Pyx_GIVEREF(__pyx_t_2); PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_2); __pyx_t_2 = NULL; __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_7, 0+1, __pyx_t_5); __pyx_t_5 = 0; __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_7, NULL); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 265; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; } __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_r = __pyx_t_6; __pyx_t_6 = 0; goto __pyx_L0; /* "pygame_sdl2/event.pyx":219 * return EventType(SDL_WINDOWEVENT, event=e.event, data1=e.data1, data2=e.data2) * * cdef make_event(SDL_Event *e): # <<<<<<<<<<<<<< * cdef object o * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_5); __Pyx_XDECREF(__pyx_t_6); __Pyx_XDECREF(__pyx_t_7); __Pyx_AddTraceback("pygame_sdl2.event.make_event", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XDECREF(__pyx_v_o); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/event.pyx":278 * * * cdef bint has_event(kinds): # <<<<<<<<<<<<<< * """ * Returns true if at least one event in the queue has a type in `kinds`, */ static int __pyx_f_11pygame_sdl2_5event_has_event(PyObject *__pyx_v_kinds) { PyObject *__pyx_v_i = NULL; int __pyx_r; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; Py_ssize_t __pyx_t_2; PyObject *(*__pyx_t_3)(PyObject *); PyObject *__pyx_t_4 = NULL; int __pyx_t_5; int __pyx_t_6; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("has_event", 0); /* "pygame_sdl2/event.pyx":286 * """ * * for i in event_queue: # <<<<<<<<<<<<<< * if i._type in kinds: * return True */ if (likely(PyList_CheckExact(event_queue)) || PyTuple_CheckExact(event_queue)) { __pyx_t_1 = event_queue; __Pyx_INCREF(__pyx_t_1); __pyx_t_2 = 0; __pyx_t_3 = NULL; } else { __pyx_t_2 = -1; __pyx_t_1 = PyObject_GetIter(event_queue); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 286; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_t_3 = Py_TYPE(__pyx_t_1)->tp_iternext; if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 286; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } for (;;) { if (likely(!__pyx_t_3)) { if (likely(PyList_CheckExact(__pyx_t_1))) { if (__pyx_t_2 >= PyList_GET_SIZE(__pyx_t_1)) break; #if CYTHON_COMPILING_IN_CPYTHON __pyx_t_4 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_2); __Pyx_INCREF(__pyx_t_4); __pyx_t_2++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 286; __pyx_clineno = __LINE__; goto __pyx_L1_error;} #else __pyx_t_4 = PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 286; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); #endif } else { if (__pyx_t_2 >= PyTuple_GET_SIZE(__pyx_t_1)) break; #if CYTHON_COMPILING_IN_CPYTHON __pyx_t_4 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_2); __Pyx_INCREF(__pyx_t_4); __pyx_t_2++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 286; __pyx_clineno = __LINE__; goto __pyx_L1_error;} #else __pyx_t_4 = PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 286; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); #endif } } else { __pyx_t_4 = __pyx_t_3(__pyx_t_1); if (unlikely(!__pyx_t_4)) { PyObject* exc_type = PyErr_Occurred(); if (exc_type) { if (likely(exc_type == PyExc_StopIteration || PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); else {__pyx_filename = __pyx_f[0]; __pyx_lineno = 286; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } break; } __Pyx_GOTREF(__pyx_t_4); } __Pyx_XDECREF_SET(__pyx_v_i, __pyx_t_4); __pyx_t_4 = 0; /* "pygame_sdl2/event.pyx":287 * * for i in event_queue: * if i._type in kinds: # <<<<<<<<<<<<<< * return True * */ __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_i, __pyx_n_s_type_2); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 287; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); __pyx_t_5 = (__Pyx_PySequence_ContainsTF(__pyx_t_4, __pyx_v_kinds, Py_EQ)); if (unlikely(__pyx_t_5 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 287; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_t_6 = (__pyx_t_5 != 0); if (__pyx_t_6) { /* "pygame_sdl2/event.pyx":288 * for i in event_queue: * if i._type in kinds: * return True # <<<<<<<<<<<<<< * * */ __pyx_r = 1; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; goto __pyx_L0; /* "pygame_sdl2/event.pyx":287 * * for i in event_queue: * if i._type in kinds: # <<<<<<<<<<<<<< * return True * */ } /* "pygame_sdl2/event.pyx":286 * """ * * for i in event_queue: # <<<<<<<<<<<<<< * if i._type in kinds: * return True */ } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "pygame_sdl2/event.pyx":278 * * * cdef bint has_event(kinds): # <<<<<<<<<<<<<< * """ * Returns true if at least one event in the queue has a type in `kinds`, */ /* function exit code */ __pyx_r = 0; goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_4); __Pyx_WriteUnraisable("pygame_sdl2.event.has_event", __pyx_clineno, __pyx_lineno, __pyx_filename, 0, 0); __pyx_r = 0; __pyx_L0:; __Pyx_XDECREF(__pyx_v_i); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/event.pyx":291 * * * cdef object get_events(kinds): # <<<<<<<<<<<<<< * """ * Returns a list containing all events in the event queue with type `kinds`. */ static PyObject *__pyx_f_11pygame_sdl2_5event_get_events(PyObject *__pyx_v_kinds) { PyObject *__pyx_v_rv = 0; PyObject *__pyx_v_new_queue = 0; PyObject *__pyx_v_i = NULL; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; int __pyx_t_2; int __pyx_t_3; PyObject *__pyx_t_4 = NULL; Py_ssize_t __pyx_t_5; PyObject *(*__pyx_t_6)(PyObject *); PyObject *__pyx_t_7 = NULL; int __pyx_t_8; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("get_events", 0); __Pyx_INCREF(__pyx_v_kinds); /* "pygame_sdl2/event.pyx":299 * """ * * if isinstance(kinds, (int, long)): # <<<<<<<<<<<<<< * kinds = [ kinds ] * */ __pyx_t_2 = PyInt_Check(__pyx_v_kinds); __pyx_t_3 = (__pyx_t_2 != 0); if (!__pyx_t_3) { } else { __pyx_t_1 = __pyx_t_3; goto __pyx_L4_bool_binop_done; } __pyx_t_3 = PyLong_Check(__pyx_v_kinds); __pyx_t_2 = (__pyx_t_3 != 0); __pyx_t_1 = __pyx_t_2; __pyx_L4_bool_binop_done:; __pyx_t_2 = (__pyx_t_1 != 0); if (__pyx_t_2) { /* "pygame_sdl2/event.pyx":300 * * if isinstance(kinds, (int, long)): * kinds = [ kinds ] # <<<<<<<<<<<<<< * * global event_queue */ __pyx_t_4 = PyList_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 300; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); __Pyx_INCREF(__pyx_v_kinds); __Pyx_GIVEREF(__pyx_v_kinds); PyList_SET_ITEM(__pyx_t_4, 0, __pyx_v_kinds); __Pyx_DECREF_SET(__pyx_v_kinds, __pyx_t_4); __pyx_t_4 = 0; /* "pygame_sdl2/event.pyx":299 * """ * * if isinstance(kinds, (int, long)): # <<<<<<<<<<<<<< * kinds = [ kinds ] * */ } /* "pygame_sdl2/event.pyx":304 * global event_queue * * cdef list rv = [ ] # <<<<<<<<<<<<<< * cdef list new_queue = [ ] * */ __pyx_t_4 = PyList_New(0); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 304; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); __pyx_v_rv = ((PyObject*)__pyx_t_4); __pyx_t_4 = 0; /* "pygame_sdl2/event.pyx":305 * * cdef list rv = [ ] * cdef list new_queue = [ ] # <<<<<<<<<<<<<< * * for i in event_queue: */ __pyx_t_4 = PyList_New(0); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 305; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); __pyx_v_new_queue = ((PyObject*)__pyx_t_4); __pyx_t_4 = 0; /* "pygame_sdl2/event.pyx":307 * cdef list new_queue = [ ] * * for i in event_queue: # <<<<<<<<<<<<<< * if i._type in kinds: * rv.append(i) */ if (likely(PyList_CheckExact(event_queue)) || PyTuple_CheckExact(event_queue)) { __pyx_t_4 = event_queue; __Pyx_INCREF(__pyx_t_4); __pyx_t_5 = 0; __pyx_t_6 = NULL; } else { __pyx_t_5 = -1; __pyx_t_4 = PyObject_GetIter(event_queue); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 307; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); __pyx_t_6 = Py_TYPE(__pyx_t_4)->tp_iternext; if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 307; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } for (;;) { if (likely(!__pyx_t_6)) { if (likely(PyList_CheckExact(__pyx_t_4))) { if (__pyx_t_5 >= PyList_GET_SIZE(__pyx_t_4)) break; #if CYTHON_COMPILING_IN_CPYTHON __pyx_t_7 = PyList_GET_ITEM(__pyx_t_4, __pyx_t_5); __Pyx_INCREF(__pyx_t_7); __pyx_t_5++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 307; __pyx_clineno = __LINE__; goto __pyx_L1_error;} #else __pyx_t_7 = PySequence_ITEM(__pyx_t_4, __pyx_t_5); __pyx_t_5++; if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 307; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_7); #endif } else { if (__pyx_t_5 >= PyTuple_GET_SIZE(__pyx_t_4)) break; #if CYTHON_COMPILING_IN_CPYTHON __pyx_t_7 = PyTuple_GET_ITEM(__pyx_t_4, __pyx_t_5); __Pyx_INCREF(__pyx_t_7); __pyx_t_5++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 307; __pyx_clineno = __LINE__; goto __pyx_L1_error;} #else __pyx_t_7 = PySequence_ITEM(__pyx_t_4, __pyx_t_5); __pyx_t_5++; if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 307; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_7); #endif } } else { __pyx_t_7 = __pyx_t_6(__pyx_t_4); if (unlikely(!__pyx_t_7)) { PyObject* exc_type = PyErr_Occurred(); if (exc_type) { if (likely(exc_type == PyExc_StopIteration || PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); else {__pyx_filename = __pyx_f[0]; __pyx_lineno = 307; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } break; } __Pyx_GOTREF(__pyx_t_7); } __Pyx_XDECREF_SET(__pyx_v_i, __pyx_t_7); __pyx_t_7 = 0; /* "pygame_sdl2/event.pyx":308 * * for i in event_queue: * if i._type in kinds: # <<<<<<<<<<<<<< * rv.append(i) * else: */ __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_v_i, __pyx_n_s_type_2); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 308; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_7); __pyx_t_2 = (__Pyx_PySequence_ContainsTF(__pyx_t_7, __pyx_v_kinds, Py_EQ)); if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 308; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __pyx_t_1 = (__pyx_t_2 != 0); if (__pyx_t_1) { /* "pygame_sdl2/event.pyx":309 * for i in event_queue: * if i._type in kinds: * rv.append(i) # <<<<<<<<<<<<<< * else: * new_queue.append(i) */ __pyx_t_8 = __Pyx_PyList_Append(__pyx_v_rv, __pyx_v_i); if (unlikely(__pyx_t_8 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 309; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "pygame_sdl2/event.pyx":308 * * for i in event_queue: * if i._type in kinds: # <<<<<<<<<<<<<< * rv.append(i) * else: */ goto __pyx_L8; } /* "pygame_sdl2/event.pyx":311 * rv.append(i) * else: * new_queue.append(i) # <<<<<<<<<<<<<< * * event_queue = new_queue */ /*else*/ { __pyx_t_8 = __Pyx_PyList_Append(__pyx_v_new_queue, __pyx_v_i); if (unlikely(__pyx_t_8 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 311; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } __pyx_L8:; /* "pygame_sdl2/event.pyx":307 * cdef list new_queue = [ ] * * for i in event_queue: # <<<<<<<<<<<<<< * if i._type in kinds: * rv.append(i) */ } __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; /* "pygame_sdl2/event.pyx":313 * new_queue.append(i) * * event_queue = new_queue # <<<<<<<<<<<<<< * * return rv */ __Pyx_INCREF(__pyx_v_new_queue); __Pyx_XGOTREF(event_queue); __Pyx_DECREF_SET(event_queue, __pyx_v_new_queue); __Pyx_GIVEREF(__pyx_v_new_queue); /* "pygame_sdl2/event.pyx":315 * event_queue = new_queue * * return rv # <<<<<<<<<<<<<< * * */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(__pyx_v_rv); __pyx_r = __pyx_v_rv; goto __pyx_L0; /* "pygame_sdl2/event.pyx":291 * * * cdef object get_events(kinds): # <<<<<<<<<<<<<< * """ * Returns a list containing all events in the event queue with type `kinds`. */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_7); __Pyx_AddTraceback("pygame_sdl2.event.get_events", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XDECREF(__pyx_v_rv); __Pyx_XDECREF(__pyx_v_new_queue); __Pyx_XDECREF(__pyx_v_i); __Pyx_XDECREF(__pyx_v_kinds); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/event.pyx":318 * * * cdef int poll_sdl() except 1: # <<<<<<<<<<<<<< * """ * Polls SDL for pending events, and places those events onto the event q */ static int __pyx_f_11pygame_sdl2_5event_poll_sdl(void) { SDL_Event __pyx_v_evt; int __pyx_r; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; PyObject *__pyx_t_5 = NULL; PyObject *__pyx_t_6 = NULL; PyObject *__pyx_t_7 = NULL; PyObject *__pyx_t_8 = NULL; int __pyx_t_9; int __pyx_t_10; PyObject *__pyx_t_11 = NULL; int __pyx_t_12; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("poll_sdl", 0); /* "pygame_sdl2/event.pyx":326 * cdef SDL_Event evt * * with lock: # <<<<<<<<<<<<<< * while SDL_PollEvent(&evt): * event_queue.append(make_event(&evt)) */ /*with:*/ { __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_lock); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 326; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = __Pyx_PyObject_LookupSpecial(__pyx_t_1, __pyx_n_s_exit); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 326; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __pyx_t_4 = __Pyx_PyObject_LookupSpecial(__pyx_t_1, __pyx_n_s_enter); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 326; __pyx_clineno = __LINE__; goto __pyx_L3_error;} __Pyx_GOTREF(__pyx_t_4); __pyx_t_5 = NULL; if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_4))) { __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4); if (likely(__pyx_t_5)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4); __Pyx_INCREF(__pyx_t_5); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_4, function); } } if (__pyx_t_5) { __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_5); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 326; __pyx_clineno = __LINE__; goto __pyx_L3_error;} __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; } else { __pyx_t_3 = __Pyx_PyObject_CallNoArg(__pyx_t_4); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 326; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /*try:*/ { { __Pyx_ExceptionSave(&__pyx_t_6, &__pyx_t_7, &__pyx_t_8); __Pyx_XGOTREF(__pyx_t_6); __Pyx_XGOTREF(__pyx_t_7); __Pyx_XGOTREF(__pyx_t_8); /*try:*/ { /* "pygame_sdl2/event.pyx":327 * * with lock: * while SDL_PollEvent(&evt): # <<<<<<<<<<<<<< * event_queue.append(make_event(&evt)) * */ while (1) { __pyx_t_9 = (SDL_PollEvent((&__pyx_v_evt)) != 0); if (!__pyx_t_9) break; /* "pygame_sdl2/event.pyx":328 * with lock: * while SDL_PollEvent(&evt): * event_queue.append(make_event(&evt)) # <<<<<<<<<<<<<< * * return 0 */ __pyx_t_1 = __pyx_f_11pygame_sdl2_5event_make_event((&__pyx_v_evt)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 328; __pyx_clineno = __LINE__; goto __pyx_L7_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_t_10 = __Pyx_PyObject_Append(event_queue, __pyx_t_1); if (unlikely(__pyx_t_10 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 328; __pyx_clineno = __LINE__; goto __pyx_L7_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; } /* "pygame_sdl2/event.pyx":326 * cdef SDL_Event evt * * with lock: # <<<<<<<<<<<<<< * while SDL_PollEvent(&evt): * event_queue.append(make_event(&evt)) */ } __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0; goto __pyx_L14_try_end; __pyx_L7_error:; __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; /*except:*/ { __Pyx_AddTraceback("pygame_sdl2.event.poll_sdl", __pyx_clineno, __pyx_lineno, __pyx_filename); if (__Pyx_GetException(&__pyx_t_1, &__pyx_t_3, &__pyx_t_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 326; __pyx_clineno = __LINE__; goto __pyx_L9_except_error;} __Pyx_GOTREF(__pyx_t_1); __Pyx_GOTREF(__pyx_t_3); __Pyx_GOTREF(__pyx_t_4); __pyx_t_5 = PyTuple_Pack(3, __pyx_t_1, __pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 326; __pyx_clineno = __LINE__; goto __pyx_L9_except_error;} __Pyx_GOTREF(__pyx_t_5); __pyx_t_11 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_5, NULL); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 326; __pyx_clineno = __LINE__; goto __pyx_L9_except_error;} __Pyx_GOTREF(__pyx_t_11); __pyx_t_9 = __Pyx_PyObject_IsTrue(__pyx_t_11); __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; if (__pyx_t_9 < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 326; __pyx_clineno = __LINE__; goto __pyx_L9_except_error;} __pyx_t_12 = ((!(__pyx_t_9 != 0)) != 0); if (__pyx_t_12) { __Pyx_GIVEREF(__pyx_t_1); __Pyx_GIVEREF(__pyx_t_3); __Pyx_XGIVEREF(__pyx_t_4); __Pyx_ErrRestore(__pyx_t_1, __pyx_t_3, __pyx_t_4); __pyx_t_1 = 0; __pyx_t_3 = 0; __pyx_t_4 = 0; {__pyx_filename = __pyx_f[0]; __pyx_lineno = 326; __pyx_clineno = __LINE__; goto __pyx_L9_except_error;} } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; goto __pyx_L8_exception_handled; } __pyx_L9_except_error:; __Pyx_XGIVEREF(__pyx_t_6); __Pyx_XGIVEREF(__pyx_t_7); __Pyx_XGIVEREF(__pyx_t_8); __Pyx_ExceptionReset(__pyx_t_6, __pyx_t_7, __pyx_t_8); goto __pyx_L1_error; __pyx_L8_exception_handled:; __Pyx_XGIVEREF(__pyx_t_6); __Pyx_XGIVEREF(__pyx_t_7); __Pyx_XGIVEREF(__pyx_t_8); __Pyx_ExceptionReset(__pyx_t_6, __pyx_t_7, __pyx_t_8); __pyx_L14_try_end:; } } /*finally:*/ { /*normal exit:*/{ if (__pyx_t_2) { __pyx_t_8 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_tuple__3, NULL); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 326; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_8); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; } goto __pyx_L6; } __pyx_L6:; } goto __pyx_L20; __pyx_L3_error:; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; goto __pyx_L1_error; __pyx_L20:; } /* "pygame_sdl2/event.pyx":330 * event_queue.append(make_event(&evt)) * * return 0 # <<<<<<<<<<<<<< * * */ __pyx_r = 0; goto __pyx_L0; /* "pygame_sdl2/event.pyx":318 * * * cdef int poll_sdl() except 1: # <<<<<<<<<<<<<< * """ * Polls SDL for pending events, and places those events onto the event q */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_5); __Pyx_AddTraceback("pygame_sdl2.event.poll_sdl", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 1; __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/event.pyx":333 * * * def pump(): # <<<<<<<<<<<<<< * with lock: * poll_sdl() */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_5event_1pump(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused); /*proto*/ static PyMethodDef __pyx_mdef_11pygame_sdl2_5event_1pump = {"pump", (PyCFunction)__pyx_pw_11pygame_sdl2_5event_1pump, METH_NOARGS, 0}; static PyObject *__pyx_pw_11pygame_sdl2_5event_1pump(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("pump (wrapper)", 0); __pyx_r = __pyx_pf_11pygame_sdl2_5event_pump(__pyx_self); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_5event_pump(CYTHON_UNUSED PyObject *__pyx_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; PyObject *__pyx_t_5 = NULL; PyObject *__pyx_t_6 = NULL; PyObject *__pyx_t_7 = NULL; PyObject *__pyx_t_8 = NULL; int __pyx_t_9; PyObject *__pyx_t_10 = NULL; int __pyx_t_11; int __pyx_t_12; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("pump", 0); /* "pygame_sdl2/event.pyx":334 * * def pump(): * with lock: # <<<<<<<<<<<<<< * poll_sdl() * */ /*with:*/ { __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_lock); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 334; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = __Pyx_PyObject_LookupSpecial(__pyx_t_1, __pyx_n_s_exit); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 334; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __pyx_t_4 = __Pyx_PyObject_LookupSpecial(__pyx_t_1, __pyx_n_s_enter); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 334; __pyx_clineno = __LINE__; goto __pyx_L3_error;} __Pyx_GOTREF(__pyx_t_4); __pyx_t_5 = NULL; if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_4))) { __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4); if (likely(__pyx_t_5)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4); __Pyx_INCREF(__pyx_t_5); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_4, function); } } if (__pyx_t_5) { __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_5); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 334; __pyx_clineno = __LINE__; goto __pyx_L3_error;} __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; } else { __pyx_t_3 = __Pyx_PyObject_CallNoArg(__pyx_t_4); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 334; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /*try:*/ { { __Pyx_ExceptionSave(&__pyx_t_6, &__pyx_t_7, &__pyx_t_8); __Pyx_XGOTREF(__pyx_t_6); __Pyx_XGOTREF(__pyx_t_7); __Pyx_XGOTREF(__pyx_t_8); /*try:*/ { /* "pygame_sdl2/event.pyx":335 * def pump(): * with lock: * poll_sdl() # <<<<<<<<<<<<<< * * */ __pyx_t_9 = __pyx_f_11pygame_sdl2_5event_poll_sdl(); if (unlikely(__pyx_t_9 == 1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 335; __pyx_clineno = __LINE__; goto __pyx_L7_error;} /* "pygame_sdl2/event.pyx":334 * * def pump(): * with lock: # <<<<<<<<<<<<<< * poll_sdl() * */ } __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0; goto __pyx_L14_try_end; __pyx_L7_error:; __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; /*except:*/ { __Pyx_AddTraceback("pygame_sdl2.event.pump", __pyx_clineno, __pyx_lineno, __pyx_filename); if (__Pyx_GetException(&__pyx_t_1, &__pyx_t_3, &__pyx_t_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 334; __pyx_clineno = __LINE__; goto __pyx_L9_except_error;} __Pyx_GOTREF(__pyx_t_1); __Pyx_GOTREF(__pyx_t_3); __Pyx_GOTREF(__pyx_t_4); __pyx_t_5 = PyTuple_Pack(3, __pyx_t_1, __pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 334; __pyx_clineno = __LINE__; goto __pyx_L9_except_error;} __Pyx_GOTREF(__pyx_t_5); __pyx_t_10 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_5, NULL); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 334; __pyx_clineno = __LINE__; goto __pyx_L9_except_error;} __Pyx_GOTREF(__pyx_t_10); __pyx_t_11 = __Pyx_PyObject_IsTrue(__pyx_t_10); __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; if (__pyx_t_11 < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 334; __pyx_clineno = __LINE__; goto __pyx_L9_except_error;} __pyx_t_12 = ((!(__pyx_t_11 != 0)) != 0); if (__pyx_t_12) { __Pyx_GIVEREF(__pyx_t_1); __Pyx_GIVEREF(__pyx_t_3); __Pyx_XGIVEREF(__pyx_t_4); __Pyx_ErrRestore(__pyx_t_1, __pyx_t_3, __pyx_t_4); __pyx_t_1 = 0; __pyx_t_3 = 0; __pyx_t_4 = 0; {__pyx_filename = __pyx_f[0]; __pyx_lineno = 334; __pyx_clineno = __LINE__; goto __pyx_L9_except_error;} } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; goto __pyx_L8_exception_handled; } __pyx_L9_except_error:; __Pyx_XGIVEREF(__pyx_t_6); __Pyx_XGIVEREF(__pyx_t_7); __Pyx_XGIVEREF(__pyx_t_8); __Pyx_ExceptionReset(__pyx_t_6, __pyx_t_7, __pyx_t_8); goto __pyx_L1_error; __pyx_L8_exception_handled:; __Pyx_XGIVEREF(__pyx_t_6); __Pyx_XGIVEREF(__pyx_t_7); __Pyx_XGIVEREF(__pyx_t_8); __Pyx_ExceptionReset(__pyx_t_6, __pyx_t_7, __pyx_t_8); __pyx_L14_try_end:; } } /*finally:*/ { /*normal exit:*/{ if (__pyx_t_2) { __pyx_t_8 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_tuple__4, NULL); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 334; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_8); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; } goto __pyx_L6; } __pyx_L6:; } goto __pyx_L18; __pyx_L3_error:; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; goto __pyx_L1_error; __pyx_L18:; } /* "pygame_sdl2/event.pyx":333 * * * def pump(): # <<<<<<<<<<<<<< * with lock: * poll_sdl() */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_5); __Pyx_AddTraceback("pygame_sdl2.event.pump", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/event.pyx":338 * * * def get(t=None): # <<<<<<<<<<<<<< * * global event_queue */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_5event_3get(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static PyMethodDef __pyx_mdef_11pygame_sdl2_5event_3get = {"get", (PyCFunction)__pyx_pw_11pygame_sdl2_5event_3get, METH_VARARGS|METH_KEYWORDS, 0}; static PyObject *__pyx_pw_11pygame_sdl2_5event_3get(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_t = 0; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("get (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_t,0}; PyObject* values[1] = {0}; values[0] = ((PyObject *)Py_None); if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (kw_args > 0) { PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_t); if (value) { values[0] = value; kw_args--; } } } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "get") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 338; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } } else { switch (PyTuple_GET_SIZE(__pyx_args)) { case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); case 0: break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_t = values[0]; } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("get", 0, 0, 1, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 338; __pyx_clineno = __LINE__; goto __pyx_L3_error;} __pyx_L3_error:; __Pyx_AddTraceback("pygame_sdl2.event.get", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_11pygame_sdl2_5event_2get(__pyx_self, __pyx_v_t); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_5event_2get(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_t) { PyObject *__pyx_v_rv = NULL; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; PyObject *__pyx_t_5 = NULL; PyObject *__pyx_t_6 = NULL; PyObject *__pyx_t_7 = NULL; PyObject *__pyx_t_8 = NULL; int __pyx_t_9; int __pyx_t_10; int __pyx_t_11; PyObject *__pyx_t_12 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("get", 0); /* "pygame_sdl2/event.pyx":342 * global event_queue * * with lock: # <<<<<<<<<<<<<< * poll_sdl() * */ /*with:*/ { __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_lock); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 342; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = __Pyx_PyObject_LookupSpecial(__pyx_t_1, __pyx_n_s_exit); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 342; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __pyx_t_4 = __Pyx_PyObject_LookupSpecial(__pyx_t_1, __pyx_n_s_enter); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 342; __pyx_clineno = __LINE__; goto __pyx_L3_error;} __Pyx_GOTREF(__pyx_t_4); __pyx_t_5 = NULL; if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_4))) { __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4); if (likely(__pyx_t_5)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4); __Pyx_INCREF(__pyx_t_5); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_4, function); } } if (__pyx_t_5) { __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_5); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 342; __pyx_clineno = __LINE__; goto __pyx_L3_error;} __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; } else { __pyx_t_3 = __Pyx_PyObject_CallNoArg(__pyx_t_4); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 342; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /*try:*/ { { __Pyx_ExceptionSave(&__pyx_t_6, &__pyx_t_7, &__pyx_t_8); __Pyx_XGOTREF(__pyx_t_6); __Pyx_XGOTREF(__pyx_t_7); __Pyx_XGOTREF(__pyx_t_8); /*try:*/ { /* "pygame_sdl2/event.pyx":343 * * with lock: * poll_sdl() # <<<<<<<<<<<<<< * * if t is None: */ __pyx_t_9 = __pyx_f_11pygame_sdl2_5event_poll_sdl(); if (unlikely(__pyx_t_9 == 1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 343; __pyx_clineno = __LINE__; goto __pyx_L7_error;} /* "pygame_sdl2/event.pyx":345 * poll_sdl() * * if t is None: # <<<<<<<<<<<<<< * rv = event_queue * event_queue = [ ] */ __pyx_t_10 = (__pyx_v_t == Py_None); __pyx_t_11 = (__pyx_t_10 != 0); if (__pyx_t_11) { /* "pygame_sdl2/event.pyx":346 * * if t is None: * rv = event_queue # <<<<<<<<<<<<<< * event_queue = [ ] * */ __Pyx_INCREF(event_queue); __pyx_v_rv = event_queue; /* "pygame_sdl2/event.pyx":347 * if t is None: * rv = event_queue * event_queue = [ ] # <<<<<<<<<<<<<< * * elif isinstance(t, int): */ __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 347; __pyx_clineno = __LINE__; goto __pyx_L7_error;} __Pyx_GOTREF(__pyx_t_1); __Pyx_XGOTREF(event_queue); __Pyx_DECREF_SET(event_queue, __pyx_t_1); __Pyx_GIVEREF(__pyx_t_1); __pyx_t_1 = 0; /* "pygame_sdl2/event.pyx":345 * poll_sdl() * * if t is None: # <<<<<<<<<<<<<< * rv = event_queue * event_queue = [ ] */ goto __pyx_L15; } /* "pygame_sdl2/event.pyx":349 * event_queue = [ ] * * elif isinstance(t, int): # <<<<<<<<<<<<<< * rv = get_events(( t, )) * */ __pyx_t_11 = PyInt_Check(__pyx_v_t); __pyx_t_10 = (__pyx_t_11 != 0); if (__pyx_t_10) { /* "pygame_sdl2/event.pyx":350 * * elif isinstance(t, int): * rv = get_events(( t, )) # <<<<<<<<<<<<<< * * else: */ __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 350; __pyx_clineno = __LINE__; goto __pyx_L7_error;} __Pyx_GOTREF(__pyx_t_1); __Pyx_INCREF(__pyx_v_t); __Pyx_GIVEREF(__pyx_v_t); PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_t); __pyx_t_3 = __pyx_f_11pygame_sdl2_5event_get_events(__pyx_t_1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 350; __pyx_clineno = __LINE__; goto __pyx_L7_error;} __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_v_rv = __pyx_t_3; __pyx_t_3 = 0; /* "pygame_sdl2/event.pyx":349 * event_queue = [ ] * * elif isinstance(t, int): # <<<<<<<<<<<<<< * rv = get_events(( t, )) * */ goto __pyx_L15; } /* "pygame_sdl2/event.pyx":353 * * else: * rv = get_events(t) # <<<<<<<<<<<<<< * * return rv */ /*else*/ { __pyx_t_3 = __pyx_f_11pygame_sdl2_5event_get_events(__pyx_v_t); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 353; __pyx_clineno = __LINE__; goto __pyx_L7_error;} __Pyx_GOTREF(__pyx_t_3); __pyx_v_rv = __pyx_t_3; __pyx_t_3 = 0; } __pyx_L15:; /* "pygame_sdl2/event.pyx":342 * global event_queue * * with lock: # <<<<<<<<<<<<<< * poll_sdl() * */ } __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0; goto __pyx_L14_try_end; __pyx_L7_error:; __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; /*except:*/ { __Pyx_AddTraceback("pygame_sdl2.event.get", __pyx_clineno, __pyx_lineno, __pyx_filename); if (__Pyx_GetException(&__pyx_t_3, &__pyx_t_1, &__pyx_t_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 342; __pyx_clineno = __LINE__; goto __pyx_L9_except_error;} __Pyx_GOTREF(__pyx_t_3); __Pyx_GOTREF(__pyx_t_1); __Pyx_GOTREF(__pyx_t_4); __pyx_t_5 = PyTuple_Pack(3, __pyx_t_3, __pyx_t_1, __pyx_t_4); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 342; __pyx_clineno = __LINE__; goto __pyx_L9_except_error;} __Pyx_GOTREF(__pyx_t_5); __pyx_t_12 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_5, NULL); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 342; __pyx_clineno = __LINE__; goto __pyx_L9_except_error;} __Pyx_GOTREF(__pyx_t_12); __pyx_t_10 = __Pyx_PyObject_IsTrue(__pyx_t_12); __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; if (__pyx_t_10 < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 342; __pyx_clineno = __LINE__; goto __pyx_L9_except_error;} __pyx_t_11 = ((!(__pyx_t_10 != 0)) != 0); if (__pyx_t_11) { __Pyx_GIVEREF(__pyx_t_3); __Pyx_GIVEREF(__pyx_t_1); __Pyx_XGIVEREF(__pyx_t_4); __Pyx_ErrRestore(__pyx_t_3, __pyx_t_1, __pyx_t_4); __pyx_t_3 = 0; __pyx_t_1 = 0; __pyx_t_4 = 0; {__pyx_filename = __pyx_f[0]; __pyx_lineno = 342; __pyx_clineno = __LINE__; goto __pyx_L9_except_error;} } __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; goto __pyx_L8_exception_handled; } __pyx_L9_except_error:; __Pyx_XGIVEREF(__pyx_t_6); __Pyx_XGIVEREF(__pyx_t_7); __Pyx_XGIVEREF(__pyx_t_8); __Pyx_ExceptionReset(__pyx_t_6, __pyx_t_7, __pyx_t_8); goto __pyx_L1_error; __pyx_L8_exception_handled:; __Pyx_XGIVEREF(__pyx_t_6); __Pyx_XGIVEREF(__pyx_t_7); __Pyx_XGIVEREF(__pyx_t_8); __Pyx_ExceptionReset(__pyx_t_6, __pyx_t_7, __pyx_t_8); __pyx_L14_try_end:; } } /*finally:*/ { /*normal exit:*/{ if (__pyx_t_2) { __pyx_t_8 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_tuple__5, NULL); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 342; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_8); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; } goto __pyx_L6; } __pyx_L6:; } goto __pyx_L19; __pyx_L3_error:; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; goto __pyx_L1_error; __pyx_L19:; } /* "pygame_sdl2/event.pyx":355 * rv = get_events(t) * * return rv # <<<<<<<<<<<<<< * * */ __Pyx_XDECREF(__pyx_r); if (unlikely(!__pyx_v_rv)) { __Pyx_RaiseUnboundLocalError("rv"); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 355; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } __Pyx_INCREF(__pyx_v_rv); __pyx_r = __pyx_v_rv; goto __pyx_L0; /* "pygame_sdl2/event.pyx":338 * * * def get(t=None): # <<<<<<<<<<<<<< * * global event_queue */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_5); __Pyx_AddTraceback("pygame_sdl2.event.get", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF(__pyx_v_rv); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/event.pyx":358 * * * def poll(): # <<<<<<<<<<<<<< * * with lock: */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_5event_5poll(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused); /*proto*/ static PyMethodDef __pyx_mdef_11pygame_sdl2_5event_5poll = {"poll", (PyCFunction)__pyx_pw_11pygame_sdl2_5event_5poll, METH_NOARGS, 0}; static PyObject *__pyx_pw_11pygame_sdl2_5event_5poll(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("poll (wrapper)", 0); __pyx_r = __pyx_pf_11pygame_sdl2_5event_4poll(__pyx_self); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_5event_4poll(CYTHON_UNUSED PyObject *__pyx_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; PyObject *__pyx_t_5 = NULL; PyObject *__pyx_t_6 = NULL; PyObject *__pyx_t_7 = NULL; PyObject *__pyx_t_8 = NULL; int __pyx_t_9; int __pyx_t_10; PyObject *__pyx_t_11 = NULL; int __pyx_t_12; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("poll", 0); /* "pygame_sdl2/event.pyx":360 * def poll(): * * with lock: # <<<<<<<<<<<<<< * poll_sdl() * */ /*with:*/ { __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_lock); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 360; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = __Pyx_PyObject_LookupSpecial(__pyx_t_1, __pyx_n_s_exit); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 360; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __pyx_t_4 = __Pyx_PyObject_LookupSpecial(__pyx_t_1, __pyx_n_s_enter); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 360; __pyx_clineno = __LINE__; goto __pyx_L3_error;} __Pyx_GOTREF(__pyx_t_4); __pyx_t_5 = NULL; if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_4))) { __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4); if (likely(__pyx_t_5)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4); __Pyx_INCREF(__pyx_t_5); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_4, function); } } if (__pyx_t_5) { __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_5); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 360; __pyx_clineno = __LINE__; goto __pyx_L3_error;} __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; } else { __pyx_t_3 = __Pyx_PyObject_CallNoArg(__pyx_t_4); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 360; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /*try:*/ { { __Pyx_ExceptionSave(&__pyx_t_6, &__pyx_t_7, &__pyx_t_8); __Pyx_XGOTREF(__pyx_t_6); __Pyx_XGOTREF(__pyx_t_7); __Pyx_XGOTREF(__pyx_t_8); /*try:*/ { /* "pygame_sdl2/event.pyx":361 * * with lock: * poll_sdl() # <<<<<<<<<<<<<< * * if event_queue: */ __pyx_t_9 = __pyx_f_11pygame_sdl2_5event_poll_sdl(); if (unlikely(__pyx_t_9 == 1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 361; __pyx_clineno = __LINE__; goto __pyx_L7_error;} /* "pygame_sdl2/event.pyx":363 * poll_sdl() * * if event_queue: # <<<<<<<<<<<<<< * return event_queue.pop(0) * */ __pyx_t_10 = __Pyx_PyObject_IsTrue(event_queue); if (unlikely(__pyx_t_10 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 363; __pyx_clineno = __LINE__; goto __pyx_L7_error;} if (__pyx_t_10) { /* "pygame_sdl2/event.pyx":364 * * if event_queue: * return event_queue.pop(0) # <<<<<<<<<<<<<< * * return NOEVENT_EVENT */ __Pyx_XDECREF(__pyx_r); __pyx_t_1 = __Pyx_PyObject_PopIndex(event_queue, __pyx_int_0, 0, 1, Py_ssize_t, PyInt_FromSsize_t); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 364; __pyx_clineno = __LINE__; goto __pyx_L7_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L11_try_return; /* "pygame_sdl2/event.pyx":363 * poll_sdl() * * if event_queue: # <<<<<<<<<<<<<< * return event_queue.pop(0) * */ } /* "pygame_sdl2/event.pyx":366 * return event_queue.pop(0) * * return NOEVENT_EVENT # <<<<<<<<<<<<<< * * */ __Pyx_XDECREF(__pyx_r); __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_NOEVENT_EVENT); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 366; __pyx_clineno = __LINE__; goto __pyx_L7_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L11_try_return; /* "pygame_sdl2/event.pyx":360 * def poll(): * * with lock: # <<<<<<<<<<<<<< * poll_sdl() * */ } __pyx_L7_error:; __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; /*except:*/ { __Pyx_AddTraceback("pygame_sdl2.event.poll", __pyx_clineno, __pyx_lineno, __pyx_filename); if (__Pyx_GetException(&__pyx_t_1, &__pyx_t_3, &__pyx_t_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 360; __pyx_clineno = __LINE__; goto __pyx_L9_except_error;} __Pyx_GOTREF(__pyx_t_1); __Pyx_GOTREF(__pyx_t_3); __Pyx_GOTREF(__pyx_t_4); __pyx_t_5 = PyTuple_Pack(3, __pyx_t_1, __pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 360; __pyx_clineno = __LINE__; goto __pyx_L9_except_error;} __Pyx_GOTREF(__pyx_t_5); __pyx_t_11 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_5, NULL); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 360; __pyx_clineno = __LINE__; goto __pyx_L9_except_error;} __Pyx_GOTREF(__pyx_t_11); __pyx_t_10 = __Pyx_PyObject_IsTrue(__pyx_t_11); __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; if (__pyx_t_10 < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 360; __pyx_clineno = __LINE__; goto __pyx_L9_except_error;} __pyx_t_12 = ((!(__pyx_t_10 != 0)) != 0); if (__pyx_t_12) { __Pyx_GIVEREF(__pyx_t_1); __Pyx_GIVEREF(__pyx_t_3); __Pyx_XGIVEREF(__pyx_t_4); __Pyx_ErrRestore(__pyx_t_1, __pyx_t_3, __pyx_t_4); __pyx_t_1 = 0; __pyx_t_3 = 0; __pyx_t_4 = 0; {__pyx_filename = __pyx_f[0]; __pyx_lineno = 360; __pyx_clineno = __LINE__; goto __pyx_L9_except_error;} } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; goto __pyx_L8_exception_handled; } __pyx_L9_except_error:; __Pyx_XGIVEREF(__pyx_t_6); __Pyx_XGIVEREF(__pyx_t_7); __Pyx_XGIVEREF(__pyx_t_8); __Pyx_ExceptionReset(__pyx_t_6, __pyx_t_7, __pyx_t_8); goto __pyx_L1_error; __pyx_L11_try_return:; __Pyx_XGIVEREF(__pyx_t_6); __Pyx_XGIVEREF(__pyx_t_7); __Pyx_XGIVEREF(__pyx_t_8); __Pyx_ExceptionReset(__pyx_t_6, __pyx_t_7, __pyx_t_8); goto __pyx_L4_return; __pyx_L8_exception_handled:; __Pyx_XGIVEREF(__pyx_t_6); __Pyx_XGIVEREF(__pyx_t_7); __Pyx_XGIVEREF(__pyx_t_8); __Pyx_ExceptionReset(__pyx_t_6, __pyx_t_7, __pyx_t_8); } } /*finally:*/ { /*normal exit:*/{ if (__pyx_t_2) { __pyx_t_8 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_tuple__6, NULL); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 360; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_8); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; } goto __pyx_L6; } __pyx_L4_return: { __pyx_t_8 = __pyx_r; __pyx_r = 0; if (__pyx_t_2) { __pyx_t_7 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_tuple__7, NULL); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 360; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; } __pyx_r = __pyx_t_8; __pyx_t_8 = 0; goto __pyx_L0; } __pyx_L6:; } goto __pyx_L19; __pyx_L3_error:; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; goto __pyx_L1_error; __pyx_L19:; } /* "pygame_sdl2/event.pyx":358 * * * def poll(): # <<<<<<<<<<<<<< * * with lock: */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_5); __Pyx_AddTraceback("pygame_sdl2.event.poll", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/event.pyx":369 * * * def wait(): # <<<<<<<<<<<<<< * * cdef SDL_Event evt */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_5event_7wait(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused); /*proto*/ static PyMethodDef __pyx_mdef_11pygame_sdl2_5event_7wait = {"wait", (PyCFunction)__pyx_pw_11pygame_sdl2_5event_7wait, METH_NOARGS, 0}; static PyObject *__pyx_pw_11pygame_sdl2_5event_7wait(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("wait (wrapper)", 0); __pyx_r = __pyx_pf_11pygame_sdl2_5event_6wait(__pyx_self); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_5event_6wait(CYTHON_UNUSED PyObject *__pyx_self) { SDL_Event __pyx_v_evt; int __pyx_v_result; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; PyObject *__pyx_t_5 = NULL; PyObject *__pyx_t_6 = NULL; PyObject *__pyx_t_7 = NULL; PyObject *__pyx_t_8 = NULL; int __pyx_t_9; int __pyx_t_10; PyObject *__pyx_t_11 = NULL; int __pyx_t_12; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("wait", 0); /* "pygame_sdl2/event.pyx":374 * cdef int result * * with lock: # <<<<<<<<<<<<<< * poll_sdl() * */ /*with:*/ { __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_lock); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 374; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = __Pyx_PyObject_LookupSpecial(__pyx_t_1, __pyx_n_s_exit); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 374; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __pyx_t_4 = __Pyx_PyObject_LookupSpecial(__pyx_t_1, __pyx_n_s_enter); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 374; __pyx_clineno = __LINE__; goto __pyx_L3_error;} __Pyx_GOTREF(__pyx_t_4); __pyx_t_5 = NULL; if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_4))) { __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4); if (likely(__pyx_t_5)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4); __Pyx_INCREF(__pyx_t_5); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_4, function); } } if (__pyx_t_5) { __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_5); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 374; __pyx_clineno = __LINE__; goto __pyx_L3_error;} __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; } else { __pyx_t_3 = __Pyx_PyObject_CallNoArg(__pyx_t_4); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 374; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /*try:*/ { { __Pyx_ExceptionSave(&__pyx_t_6, &__pyx_t_7, &__pyx_t_8); __Pyx_XGOTREF(__pyx_t_6); __Pyx_XGOTREF(__pyx_t_7); __Pyx_XGOTREF(__pyx_t_8); /*try:*/ { /* "pygame_sdl2/event.pyx":375 * * with lock: * poll_sdl() # <<<<<<<<<<<<<< * * if event_queue: */ __pyx_t_9 = __pyx_f_11pygame_sdl2_5event_poll_sdl(); if (unlikely(__pyx_t_9 == 1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 375; __pyx_clineno = __LINE__; goto __pyx_L7_error;} /* "pygame_sdl2/event.pyx":377 * poll_sdl() * * if event_queue: # <<<<<<<<<<<<<< * return event_queue.pop(0) * */ __pyx_t_10 = __Pyx_PyObject_IsTrue(event_queue); if (unlikely(__pyx_t_10 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 377; __pyx_clineno = __LINE__; goto __pyx_L7_error;} if (__pyx_t_10) { /* "pygame_sdl2/event.pyx":378 * * if event_queue: * return event_queue.pop(0) # <<<<<<<<<<<<<< * * with nogil: */ __Pyx_XDECREF(__pyx_r); __pyx_t_1 = __Pyx_PyObject_PopIndex(event_queue, __pyx_int_0, 0, 1, Py_ssize_t, PyInt_FromSsize_t); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 378; __pyx_clineno = __LINE__; goto __pyx_L7_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L11_try_return; /* "pygame_sdl2/event.pyx":377 * poll_sdl() * * if event_queue: # <<<<<<<<<<<<<< * return event_queue.pop(0) * */ } /* "pygame_sdl2/event.pyx":374 * cdef int result * * with lock: # <<<<<<<<<<<<<< * poll_sdl() * */ } __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0; goto __pyx_L14_try_end; __pyx_L7_error:; __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; /*except:*/ { __Pyx_AddTraceback("pygame_sdl2.event.wait", __pyx_clineno, __pyx_lineno, __pyx_filename); if (__Pyx_GetException(&__pyx_t_1, &__pyx_t_3, &__pyx_t_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 374; __pyx_clineno = __LINE__; goto __pyx_L9_except_error;} __Pyx_GOTREF(__pyx_t_1); __Pyx_GOTREF(__pyx_t_3); __Pyx_GOTREF(__pyx_t_4); __pyx_t_5 = PyTuple_Pack(3, __pyx_t_1, __pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 374; __pyx_clineno = __LINE__; goto __pyx_L9_except_error;} __Pyx_GOTREF(__pyx_t_5); __pyx_t_11 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_5, NULL); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 374; __pyx_clineno = __LINE__; goto __pyx_L9_except_error;} __Pyx_GOTREF(__pyx_t_11); __pyx_t_10 = __Pyx_PyObject_IsTrue(__pyx_t_11); __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; if (__pyx_t_10 < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 374; __pyx_clineno = __LINE__; goto __pyx_L9_except_error;} __pyx_t_12 = ((!(__pyx_t_10 != 0)) != 0); if (__pyx_t_12) { __Pyx_GIVEREF(__pyx_t_1); __Pyx_GIVEREF(__pyx_t_3); __Pyx_XGIVEREF(__pyx_t_4); __Pyx_ErrRestore(__pyx_t_1, __pyx_t_3, __pyx_t_4); __pyx_t_1 = 0; __pyx_t_3 = 0; __pyx_t_4 = 0; {__pyx_filename = __pyx_f[0]; __pyx_lineno = 374; __pyx_clineno = __LINE__; goto __pyx_L9_except_error;} } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; goto __pyx_L8_exception_handled; } __pyx_L9_except_error:; __Pyx_XGIVEREF(__pyx_t_6); __Pyx_XGIVEREF(__pyx_t_7); __Pyx_XGIVEREF(__pyx_t_8); __Pyx_ExceptionReset(__pyx_t_6, __pyx_t_7, __pyx_t_8); goto __pyx_L1_error; __pyx_L11_try_return:; __Pyx_XGIVEREF(__pyx_t_6); __Pyx_XGIVEREF(__pyx_t_7); __Pyx_XGIVEREF(__pyx_t_8); __Pyx_ExceptionReset(__pyx_t_6, __pyx_t_7, __pyx_t_8); goto __pyx_L4_return; __pyx_L8_exception_handled:; __Pyx_XGIVEREF(__pyx_t_6); __Pyx_XGIVEREF(__pyx_t_7); __Pyx_XGIVEREF(__pyx_t_8); __Pyx_ExceptionReset(__pyx_t_6, __pyx_t_7, __pyx_t_8); __pyx_L14_try_end:; } } /*finally:*/ { /*normal exit:*/{ if (__pyx_t_2) { __pyx_t_8 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_tuple__8, NULL); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 374; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_8); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; } goto __pyx_L6; } __pyx_L4_return: { __pyx_t_8 = __pyx_r; __pyx_r = 0; if (__pyx_t_2) { __pyx_t_7 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_tuple__9, NULL); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 374; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; } __pyx_r = __pyx_t_8; __pyx_t_8 = 0; goto __pyx_L0; } __pyx_L6:; } goto __pyx_L19; __pyx_L3_error:; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; goto __pyx_L1_error; __pyx_L19:; } /* "pygame_sdl2/event.pyx":380 * return event_queue.pop(0) * * with nogil: # <<<<<<<<<<<<<< * result = SDL_WaitEvent(&evt) * */ { #ifdef WITH_THREAD PyThreadState *_save; Py_UNBLOCK_THREADS #endif /*try:*/ { /* "pygame_sdl2/event.pyx":381 * * with nogil: * result = SDL_WaitEvent(&evt) # <<<<<<<<<<<<<< * * if result: */ __pyx_v_result = SDL_WaitEvent((&__pyx_v_evt)); } /* "pygame_sdl2/event.pyx":380 * return event_queue.pop(0) * * with nogil: # <<<<<<<<<<<<<< * result = SDL_WaitEvent(&evt) * */ /*finally:*/ { /*normal exit:*/{ #ifdef WITH_THREAD Py_BLOCK_THREADS #endif goto __pyx_L22; } __pyx_L22:; } } /* "pygame_sdl2/event.pyx":383 * result = SDL_WaitEvent(&evt) * * if result: # <<<<<<<<<<<<<< * return make_event(&evt) * else: */ __pyx_t_12 = (__pyx_v_result != 0); if (__pyx_t_12) { /* "pygame_sdl2/event.pyx":384 * * if result: * return make_event(&evt) # <<<<<<<<<<<<<< * else: * return NOEVENT_EVENT */ __Pyx_XDECREF(__pyx_r); __pyx_t_4 = __pyx_f_11pygame_sdl2_5event_make_event((&__pyx_v_evt)); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 384; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); __pyx_r = __pyx_t_4; __pyx_t_4 = 0; goto __pyx_L0; /* "pygame_sdl2/event.pyx":383 * result = SDL_WaitEvent(&evt) * * if result: # <<<<<<<<<<<<<< * return make_event(&evt) * else: */ } /* "pygame_sdl2/event.pyx":386 * return make_event(&evt) * else: * return NOEVENT_EVENT # <<<<<<<<<<<<<< * * */ /*else*/ { __Pyx_XDECREF(__pyx_r); __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_NOEVENT_EVENT); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 386; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); __pyx_r = __pyx_t_4; __pyx_t_4 = 0; goto __pyx_L0; } /* "pygame_sdl2/event.pyx":369 * * * def wait(): # <<<<<<<<<<<<<< * * cdef SDL_Event evt */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_5); __Pyx_AddTraceback("pygame_sdl2.event.wait", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/event.pyx":389 * * * def peek(t=None): # <<<<<<<<<<<<<< * * with lock: */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_5event_9peek(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static PyMethodDef __pyx_mdef_11pygame_sdl2_5event_9peek = {"peek", (PyCFunction)__pyx_pw_11pygame_sdl2_5event_9peek, METH_VARARGS|METH_KEYWORDS, 0}; static PyObject *__pyx_pw_11pygame_sdl2_5event_9peek(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_t = 0; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("peek (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_t,0}; PyObject* values[1] = {0}; values[0] = ((PyObject *)Py_None); if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (kw_args > 0) { PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_t); if (value) { values[0] = value; kw_args--; } } } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "peek") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 389; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } } else { switch (PyTuple_GET_SIZE(__pyx_args)) { case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); case 0: break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_t = values[0]; } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("peek", 0, 0, 1, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 389; __pyx_clineno = __LINE__; goto __pyx_L3_error;} __pyx_L3_error:; __Pyx_AddTraceback("pygame_sdl2.event.peek", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_11pygame_sdl2_5event_8peek(__pyx_self, __pyx_v_t); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_5event_8peek(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_t) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; PyObject *__pyx_t_5 = NULL; PyObject *__pyx_t_6 = NULL; PyObject *__pyx_t_7 = NULL; PyObject *__pyx_t_8 = NULL; int __pyx_t_9; int __pyx_t_10; int __pyx_t_11; Py_ssize_t __pyx_t_12; PyObject *__pyx_t_13 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("peek", 0); /* "pygame_sdl2/event.pyx":391 * def peek(t=None): * * with lock: # <<<<<<<<<<<<<< * poll_sdl() * */ /*with:*/ { __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_lock); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 391; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = __Pyx_PyObject_LookupSpecial(__pyx_t_1, __pyx_n_s_exit); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 391; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __pyx_t_4 = __Pyx_PyObject_LookupSpecial(__pyx_t_1, __pyx_n_s_enter); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 391; __pyx_clineno = __LINE__; goto __pyx_L3_error;} __Pyx_GOTREF(__pyx_t_4); __pyx_t_5 = NULL; if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_4))) { __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4); if (likely(__pyx_t_5)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4); __Pyx_INCREF(__pyx_t_5); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_4, function); } } if (__pyx_t_5) { __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_5); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 391; __pyx_clineno = __LINE__; goto __pyx_L3_error;} __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; } else { __pyx_t_3 = __Pyx_PyObject_CallNoArg(__pyx_t_4); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 391; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /*try:*/ { { __Pyx_ExceptionSave(&__pyx_t_6, &__pyx_t_7, &__pyx_t_8); __Pyx_XGOTREF(__pyx_t_6); __Pyx_XGOTREF(__pyx_t_7); __Pyx_XGOTREF(__pyx_t_8); /*try:*/ { /* "pygame_sdl2/event.pyx":392 * * with lock: * poll_sdl() # <<<<<<<<<<<<<< * * if t is None: */ __pyx_t_9 = __pyx_f_11pygame_sdl2_5event_poll_sdl(); if (unlikely(__pyx_t_9 == 1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 392; __pyx_clineno = __LINE__; goto __pyx_L7_error;} /* "pygame_sdl2/event.pyx":394 * poll_sdl() * * if t is None: # <<<<<<<<<<<<<< * return len(event_queue) != 0 * elif isinstance(t, int): */ __pyx_t_10 = (__pyx_v_t == Py_None); __pyx_t_11 = (__pyx_t_10 != 0); if (__pyx_t_11) { /* "pygame_sdl2/event.pyx":395 * * if t is None: * return len(event_queue) != 0 # <<<<<<<<<<<<<< * elif isinstance(t, int): * return has_event(( t, )) */ __Pyx_XDECREF(__pyx_r); __pyx_t_1 = event_queue; __Pyx_INCREF(__pyx_t_1); __pyx_t_12 = PyObject_Length(__pyx_t_1); if (unlikely(__pyx_t_12 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 395; __pyx_clineno = __LINE__; goto __pyx_L7_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_1 = __Pyx_PyBool_FromLong((__pyx_t_12 != 0)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 395; __pyx_clineno = __LINE__; goto __pyx_L7_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L11_try_return; /* "pygame_sdl2/event.pyx":394 * poll_sdl() * * if t is None: # <<<<<<<<<<<<<< * return len(event_queue) != 0 * elif isinstance(t, int): */ } /* "pygame_sdl2/event.pyx":396 * if t is None: * return len(event_queue) != 0 * elif isinstance(t, int): # <<<<<<<<<<<<<< * return has_event(( t, )) * else: */ __pyx_t_11 = PyInt_Check(__pyx_v_t); __pyx_t_10 = (__pyx_t_11 != 0); if (__pyx_t_10) { /* "pygame_sdl2/event.pyx":397 * return len(event_queue) != 0 * elif isinstance(t, int): * return has_event(( t, )) # <<<<<<<<<<<<<< * else: * return has_event(t) */ __Pyx_XDECREF(__pyx_r); __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 397; __pyx_clineno = __LINE__; goto __pyx_L7_error;} __Pyx_GOTREF(__pyx_t_1); __Pyx_INCREF(__pyx_v_t); __Pyx_GIVEREF(__pyx_v_t); PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_t); __pyx_t_3 = __Pyx_PyBool_FromLong(__pyx_f_11pygame_sdl2_5event_has_event(__pyx_t_1)); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 397; __pyx_clineno = __LINE__; goto __pyx_L7_error;} __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_r = __pyx_t_3; __pyx_t_3 = 0; goto __pyx_L11_try_return; /* "pygame_sdl2/event.pyx":396 * if t is None: * return len(event_queue) != 0 * elif isinstance(t, int): # <<<<<<<<<<<<<< * return has_event(( t, )) * else: */ } /* "pygame_sdl2/event.pyx":399 * return has_event(( t, )) * else: * return has_event(t) # <<<<<<<<<<<<<< * * */ /*else*/ { __Pyx_XDECREF(__pyx_r); __pyx_t_3 = __Pyx_PyBool_FromLong(__pyx_f_11pygame_sdl2_5event_has_event(__pyx_v_t)); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 399; __pyx_clineno = __LINE__; goto __pyx_L7_error;} __Pyx_GOTREF(__pyx_t_3); __pyx_r = __pyx_t_3; __pyx_t_3 = 0; goto __pyx_L11_try_return; } /* "pygame_sdl2/event.pyx":391 * def peek(t=None): * * with lock: # <<<<<<<<<<<<<< * poll_sdl() * */ } __pyx_L7_error:; __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; /*except:*/ { __Pyx_AddTraceback("pygame_sdl2.event.peek", __pyx_clineno, __pyx_lineno, __pyx_filename); if (__Pyx_GetException(&__pyx_t_3, &__pyx_t_1, &__pyx_t_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 391; __pyx_clineno = __LINE__; goto __pyx_L9_except_error;} __Pyx_GOTREF(__pyx_t_3); __Pyx_GOTREF(__pyx_t_1); __Pyx_GOTREF(__pyx_t_4); __pyx_t_5 = PyTuple_Pack(3, __pyx_t_3, __pyx_t_1, __pyx_t_4); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 391; __pyx_clineno = __LINE__; goto __pyx_L9_except_error;} __Pyx_GOTREF(__pyx_t_5); __pyx_t_13 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_5, NULL); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 391; __pyx_clineno = __LINE__; goto __pyx_L9_except_error;} __Pyx_GOTREF(__pyx_t_13); __pyx_t_10 = __Pyx_PyObject_IsTrue(__pyx_t_13); __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; if (__pyx_t_10 < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 391; __pyx_clineno = __LINE__; goto __pyx_L9_except_error;} __pyx_t_11 = ((!(__pyx_t_10 != 0)) != 0); if (__pyx_t_11) { __Pyx_GIVEREF(__pyx_t_3); __Pyx_GIVEREF(__pyx_t_1); __Pyx_XGIVEREF(__pyx_t_4); __Pyx_ErrRestore(__pyx_t_3, __pyx_t_1, __pyx_t_4); __pyx_t_3 = 0; __pyx_t_1 = 0; __pyx_t_4 = 0; {__pyx_filename = __pyx_f[0]; __pyx_lineno = 391; __pyx_clineno = __LINE__; goto __pyx_L9_except_error;} } __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; goto __pyx_L8_exception_handled; } __pyx_L9_except_error:; __Pyx_XGIVEREF(__pyx_t_6); __Pyx_XGIVEREF(__pyx_t_7); __Pyx_XGIVEREF(__pyx_t_8); __Pyx_ExceptionReset(__pyx_t_6, __pyx_t_7, __pyx_t_8); goto __pyx_L1_error; __pyx_L11_try_return:; __Pyx_XGIVEREF(__pyx_t_6); __Pyx_XGIVEREF(__pyx_t_7); __Pyx_XGIVEREF(__pyx_t_8); __Pyx_ExceptionReset(__pyx_t_6, __pyx_t_7, __pyx_t_8); goto __pyx_L4_return; __pyx_L8_exception_handled:; __Pyx_XGIVEREF(__pyx_t_6); __Pyx_XGIVEREF(__pyx_t_7); __Pyx_XGIVEREF(__pyx_t_8); __Pyx_ExceptionReset(__pyx_t_6, __pyx_t_7, __pyx_t_8); } } /*finally:*/ { /*normal exit:*/{ if (__pyx_t_2) { __pyx_t_8 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_tuple__10, NULL); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 391; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_8); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; } goto __pyx_L6; } __pyx_L4_return: { __pyx_t_8 = __pyx_r; __pyx_r = 0; if (__pyx_t_2) { __pyx_t_7 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_tuple__11, NULL); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 391; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; } __pyx_r = __pyx_t_8; __pyx_t_8 = 0; goto __pyx_L0; } __pyx_L6:; } goto __pyx_L19; __pyx_L3_error:; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; goto __pyx_L1_error; __pyx_L19:; } /* "pygame_sdl2/event.pyx":389 * * * def peek(t=None): # <<<<<<<<<<<<<< * * with lock: */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_5); __Pyx_AddTraceback("pygame_sdl2.event.peek", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/event.pyx":402 * * * def clear(t=None): # <<<<<<<<<<<<<< * * # Clear is implemented in terms of get. */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_5event_11clear(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static PyMethodDef __pyx_mdef_11pygame_sdl2_5event_11clear = {"clear", (PyCFunction)__pyx_pw_11pygame_sdl2_5event_11clear, METH_VARARGS|METH_KEYWORDS, 0}; static PyObject *__pyx_pw_11pygame_sdl2_5event_11clear(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_t = 0; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("clear (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_t,0}; PyObject* values[1] = {0}; values[0] = ((PyObject *)Py_None); if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (kw_args > 0) { PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_t); if (value) { values[0] = value; kw_args--; } } } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "clear") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 402; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } } else { switch (PyTuple_GET_SIZE(__pyx_args)) { case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); case 0: break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_t = values[0]; } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("clear", 0, 0, 1, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 402; __pyx_clineno = __LINE__; goto __pyx_L3_error;} __pyx_L3_error:; __Pyx_AddTraceback("pygame_sdl2.event.clear", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_11pygame_sdl2_5event_10clear(__pyx_self, __pyx_v_t); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_5event_10clear(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_t) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("clear", 0); /* "pygame_sdl2/event.pyx":405 * * # Clear is implemented in terms of get. * get(t) # <<<<<<<<<<<<<< * * def get_standard_events(): */ __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_get); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 405; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = NULL; if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_2))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); if (likely(__pyx_t_3)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); } } if (!__pyx_t_3) { __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_v_t); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 405; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); } else { __pyx_t_4 = PyTuple_New(1+1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 405; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_3); __pyx_t_3 = NULL; __Pyx_INCREF(__pyx_v_t); __Pyx_GIVEREF(__pyx_v_t); PyTuple_SET_ITEM(__pyx_t_4, 0+1, __pyx_v_t); __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_4, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 405; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; } __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "pygame_sdl2/event.pyx":402 * * * def clear(t=None): # <<<<<<<<<<<<<< * * # Clear is implemented in terms of get. */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_AddTraceback("pygame_sdl2.event.clear", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/event.pyx":407 * get(t) * * def get_standard_events(): # <<<<<<<<<<<<<< * """ * Returns a list of standard events that pygame_sdl2 knows about. */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_5event_13get_standard_events(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused); /*proto*/ static char __pyx_doc_11pygame_sdl2_5event_12get_standard_events[] = "\n Returns a list of standard events that pygame_sdl2 knows about.\n "; static PyMethodDef __pyx_mdef_11pygame_sdl2_5event_13get_standard_events = {"get_standard_events", (PyCFunction)__pyx_pw_11pygame_sdl2_5event_13get_standard_events, METH_NOARGS, __pyx_doc_11pygame_sdl2_5event_12get_standard_events}; static PyObject *__pyx_pw_11pygame_sdl2_5event_13get_standard_events(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("get_standard_events (wrapper)", 0); __pyx_r = __pyx_pf_11pygame_sdl2_5event_12get_standard_events(__pyx_self); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_5event_12get_standard_events(CYTHON_UNUSED PyObject *__pyx_self) { PyObject *__pyx_v_i = NULL; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; Py_ssize_t __pyx_t_5; PyObject *(*__pyx_t_6)(PyObject *); int __pyx_t_7; int __pyx_t_8; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("get_standard_events", 0); /* "pygame_sdl2/event.pyx":412 * """ * * return [ i for i in event_names.keys() if (i < SDL_USEREVENT) or (i > USEREVENT_MAX) ] # <<<<<<<<<<<<<< * * def event_name(t): */ __Pyx_XDECREF(__pyx_r); __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 412; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_event_names); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 412; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_keys); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 412; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_3 = NULL; if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_4))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_4); if (likely(__pyx_t_3)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_4, function); } } if (__pyx_t_3) { __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_3); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 412; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } else { __pyx_t_2 = __Pyx_PyObject_CallNoArg(__pyx_t_4); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 412; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; if (likely(PyList_CheckExact(__pyx_t_2)) || PyTuple_CheckExact(__pyx_t_2)) { __pyx_t_4 = __pyx_t_2; __Pyx_INCREF(__pyx_t_4); __pyx_t_5 = 0; __pyx_t_6 = NULL; } else { __pyx_t_5 = -1; __pyx_t_4 = PyObject_GetIter(__pyx_t_2); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 412; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); __pyx_t_6 = Py_TYPE(__pyx_t_4)->tp_iternext; if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 412; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; for (;;) { if (likely(!__pyx_t_6)) { if (likely(PyList_CheckExact(__pyx_t_4))) { if (__pyx_t_5 >= PyList_GET_SIZE(__pyx_t_4)) break; #if CYTHON_COMPILING_IN_CPYTHON __pyx_t_2 = PyList_GET_ITEM(__pyx_t_4, __pyx_t_5); __Pyx_INCREF(__pyx_t_2); __pyx_t_5++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 412; __pyx_clineno = __LINE__; goto __pyx_L1_error;} #else __pyx_t_2 = PySequence_ITEM(__pyx_t_4, __pyx_t_5); __pyx_t_5++; if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 412; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); #endif } else { if (__pyx_t_5 >= PyTuple_GET_SIZE(__pyx_t_4)) break; #if CYTHON_COMPILING_IN_CPYTHON __pyx_t_2 = PyTuple_GET_ITEM(__pyx_t_4, __pyx_t_5); __Pyx_INCREF(__pyx_t_2); __pyx_t_5++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 412; __pyx_clineno = __LINE__; goto __pyx_L1_error;} #else __pyx_t_2 = PySequence_ITEM(__pyx_t_4, __pyx_t_5); __pyx_t_5++; if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 412; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); #endif } } else { __pyx_t_2 = __pyx_t_6(__pyx_t_4); if (unlikely(!__pyx_t_2)) { PyObject* exc_type = PyErr_Occurred(); if (exc_type) { if (likely(exc_type == PyExc_StopIteration || PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); else {__pyx_filename = __pyx_f[0]; __pyx_lineno = 412; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } break; } __Pyx_GOTREF(__pyx_t_2); } __Pyx_XDECREF_SET(__pyx_v_i, __pyx_t_2); __pyx_t_2 = 0; __pyx_t_2 = __Pyx_PyInt_From_SDL_EventType(SDL_USEREVENT); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 412; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = PyObject_RichCompare(__pyx_v_i, __pyx_t_2, Py_LT); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 412; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_8 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_8 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 412; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; if (!__pyx_t_8) { } else { __pyx_t_7 = __pyx_t_8; goto __pyx_L6_bool_binop_done; } __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_USEREVENT_MAX); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 412; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __pyx_t_2 = PyObject_RichCompare(__pyx_v_i, __pyx_t_3, Py_GT); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 412; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_8 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_8 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 412; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_7 = __pyx_t_8; __pyx_L6_bool_binop_done:; if (__pyx_t_7) { if (unlikely(__Pyx_ListComp_Append(__pyx_t_1, (PyObject*)__pyx_v_i))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 412; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } } __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "pygame_sdl2/event.pyx":407 * get(t) * * def get_standard_events(): # <<<<<<<<<<<<<< * """ * Returns a list of standard events that pygame_sdl2 knows about. */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_AddTraceback("pygame_sdl2.event.get_standard_events", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF(__pyx_v_i); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/event.pyx":414 * return [ i for i in event_names.keys() if (i < SDL_USEREVENT) or (i > USEREVENT_MAX) ] * * def event_name(t): # <<<<<<<<<<<<<< * try: * return event_names[t] */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_5event_15event_name(PyObject *__pyx_self, PyObject *__pyx_v_t); /*proto*/ static PyMethodDef __pyx_mdef_11pygame_sdl2_5event_15event_name = {"event_name", (PyCFunction)__pyx_pw_11pygame_sdl2_5event_15event_name, METH_O, 0}; static PyObject *__pyx_pw_11pygame_sdl2_5event_15event_name(PyObject *__pyx_self, PyObject *__pyx_v_t) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("event_name (wrapper)", 0); __pyx_r = __pyx_pf_11pygame_sdl2_5event_14event_name(__pyx_self, ((PyObject *)__pyx_v_t)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_5event_14event_name(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_t) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; PyObject *__pyx_t_5 = NULL; int __pyx_t_6; PyObject *__pyx_t_7 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("event_name", 0); /* "pygame_sdl2/event.pyx":415 * * def event_name(t): * try: # <<<<<<<<<<<<<< * return event_names[t] * except KeyError: */ { __Pyx_ExceptionSave(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3); __Pyx_XGOTREF(__pyx_t_1); __Pyx_XGOTREF(__pyx_t_2); __Pyx_XGOTREF(__pyx_t_3); /*try:*/ { /* "pygame_sdl2/event.pyx":416 * def event_name(t): * try: * return event_names[t] # <<<<<<<<<<<<<< * except KeyError: * return "UNKNOWN" */ __Pyx_XDECREF(__pyx_r); __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_event_names); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 416; __pyx_clineno = __LINE__; goto __pyx_L3_error;} __Pyx_GOTREF(__pyx_t_4); __pyx_t_5 = PyObject_GetItem(__pyx_t_4, __pyx_v_t); if (unlikely(__pyx_t_5 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 416; __pyx_clineno = __LINE__; goto __pyx_L3_error;}; __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_r = __pyx_t_5; __pyx_t_5 = 0; goto __pyx_L7_try_return; /* "pygame_sdl2/event.pyx":415 * * def event_name(t): * try: # <<<<<<<<<<<<<< * return event_names[t] * except KeyError: */ } __pyx_L3_error:; __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; /* "pygame_sdl2/event.pyx":417 * try: * return event_names[t] * except KeyError: # <<<<<<<<<<<<<< * return "UNKNOWN" * */ __pyx_t_6 = PyErr_ExceptionMatches(__pyx_builtin_KeyError); if (__pyx_t_6) { __Pyx_AddTraceback("pygame_sdl2.event.event_name", __pyx_clineno, __pyx_lineno, __pyx_filename); if (__Pyx_GetException(&__pyx_t_5, &__pyx_t_4, &__pyx_t_7) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 417; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} __Pyx_GOTREF(__pyx_t_5); __Pyx_GOTREF(__pyx_t_4); __Pyx_GOTREF(__pyx_t_7); /* "pygame_sdl2/event.pyx":418 * return event_names[t] * except KeyError: * return "UNKNOWN" # <<<<<<<<<<<<<< * * def set_blocked(t=None): */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(__pyx_n_s_UNKNOWN); __pyx_r = __pyx_n_s_UNKNOWN; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; goto __pyx_L6_except_return; } goto __pyx_L5_except_error; __pyx_L5_except_error:; /* "pygame_sdl2/event.pyx":415 * * def event_name(t): * try: # <<<<<<<<<<<<<< * return event_names[t] * except KeyError: */ __Pyx_XGIVEREF(__pyx_t_1); __Pyx_XGIVEREF(__pyx_t_2); __Pyx_XGIVEREF(__pyx_t_3); __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3); goto __pyx_L1_error; __pyx_L7_try_return:; __Pyx_XGIVEREF(__pyx_t_1); __Pyx_XGIVEREF(__pyx_t_2); __Pyx_XGIVEREF(__pyx_t_3); __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3); goto __pyx_L0; __pyx_L6_except_return:; __Pyx_XGIVEREF(__pyx_t_1); __Pyx_XGIVEREF(__pyx_t_2); __Pyx_XGIVEREF(__pyx_t_3); __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3); goto __pyx_L0; } /* "pygame_sdl2/event.pyx":414 * return [ i for i in event_names.keys() if (i < SDL_USEREVENT) or (i > USEREVENT_MAX) ] * * def event_name(t): # <<<<<<<<<<<<<< * try: * return event_names[t] */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_5); __Pyx_XDECREF(__pyx_t_7); __Pyx_AddTraceback("pygame_sdl2.event.event_name", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/event.pyx":420 * return "UNKNOWN" * * def set_blocked(t=None): # <<<<<<<<<<<<<< * if t == None: * for et in event_names.keys(): */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_5event_17set_blocked(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static PyMethodDef __pyx_mdef_11pygame_sdl2_5event_17set_blocked = {"set_blocked", (PyCFunction)__pyx_pw_11pygame_sdl2_5event_17set_blocked, METH_VARARGS|METH_KEYWORDS, 0}; static PyObject *__pyx_pw_11pygame_sdl2_5event_17set_blocked(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_t = 0; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("set_blocked (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_t,0}; PyObject* values[1] = {0}; values[0] = ((PyObject *)Py_None); if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (kw_args > 0) { PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_t); if (value) { values[0] = value; kw_args--; } } } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "set_blocked") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 420; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } } else { switch (PyTuple_GET_SIZE(__pyx_args)) { case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); case 0: break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_t = values[0]; } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("set_blocked", 0, 0, 1, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 420; __pyx_clineno = __LINE__; goto __pyx_L3_error;} __pyx_L3_error:; __Pyx_AddTraceback("pygame_sdl2.event.set_blocked", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_11pygame_sdl2_5event_16set_blocked(__pyx_self, __pyx_v_t); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_5event_16set_blocked(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_t) { PyObject *__pyx_v_et = NULL; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_t_2; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; Py_ssize_t __pyx_t_5; PyObject *(*__pyx_t_6)(PyObject *); Uint32 __pyx_t_7; int __pyx_t_8; int __pyx_t_9; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("set_blocked", 0); /* "pygame_sdl2/event.pyx":421 * * def set_blocked(t=None): * if t == None: # <<<<<<<<<<<<<< * for et in event_names.keys(): * SDL_EventState(et, SDL_ENABLE) */ __pyx_t_1 = PyObject_RichCompare(__pyx_v_t, Py_None, Py_EQ); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 421; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 421; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (__pyx_t_2) { /* "pygame_sdl2/event.pyx":422 * def set_blocked(t=None): * if t == None: * for et in event_names.keys(): # <<<<<<<<<<<<<< * SDL_EventState(et, SDL_ENABLE) * elif isinstance(t, (int, long)): */ __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_event_names); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 422; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_keys); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 422; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_3 = NULL; if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_4))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_4); if (likely(__pyx_t_3)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_4, function); } } if (__pyx_t_3) { __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_3); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 422; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } else { __pyx_t_1 = __Pyx_PyObject_CallNoArg(__pyx_t_4); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 422; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; if (likely(PyList_CheckExact(__pyx_t_1)) || PyTuple_CheckExact(__pyx_t_1)) { __pyx_t_4 = __pyx_t_1; __Pyx_INCREF(__pyx_t_4); __pyx_t_5 = 0; __pyx_t_6 = NULL; } else { __pyx_t_5 = -1; __pyx_t_4 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 422; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); __pyx_t_6 = Py_TYPE(__pyx_t_4)->tp_iternext; if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 422; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; for (;;) { if (likely(!__pyx_t_6)) { if (likely(PyList_CheckExact(__pyx_t_4))) { if (__pyx_t_5 >= PyList_GET_SIZE(__pyx_t_4)) break; #if CYTHON_COMPILING_IN_CPYTHON __pyx_t_1 = PyList_GET_ITEM(__pyx_t_4, __pyx_t_5); __Pyx_INCREF(__pyx_t_1); __pyx_t_5++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 422; __pyx_clineno = __LINE__; goto __pyx_L1_error;} #else __pyx_t_1 = PySequence_ITEM(__pyx_t_4, __pyx_t_5); __pyx_t_5++; if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 422; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); #endif } else { if (__pyx_t_5 >= PyTuple_GET_SIZE(__pyx_t_4)) break; #if CYTHON_COMPILING_IN_CPYTHON __pyx_t_1 = PyTuple_GET_ITEM(__pyx_t_4, __pyx_t_5); __Pyx_INCREF(__pyx_t_1); __pyx_t_5++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 422; __pyx_clineno = __LINE__; goto __pyx_L1_error;} #else __pyx_t_1 = PySequence_ITEM(__pyx_t_4, __pyx_t_5); __pyx_t_5++; if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 422; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); #endif } } else { __pyx_t_1 = __pyx_t_6(__pyx_t_4); if (unlikely(!__pyx_t_1)) { PyObject* exc_type = PyErr_Occurred(); if (exc_type) { if (likely(exc_type == PyExc_StopIteration || PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); else {__pyx_filename = __pyx_f[0]; __pyx_lineno = 422; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } break; } __Pyx_GOTREF(__pyx_t_1); } __Pyx_XDECREF_SET(__pyx_v_et, __pyx_t_1); __pyx_t_1 = 0; /* "pygame_sdl2/event.pyx":423 * if t == None: * for et in event_names.keys(): * SDL_EventState(et, SDL_ENABLE) # <<<<<<<<<<<<<< * elif isinstance(t, (int, long)): * SDL_EventState(t, SDL_IGNORE) */ __pyx_t_7 = __Pyx_PyInt_As_uint32_t(__pyx_v_et); if (unlikely((__pyx_t_7 == (Uint32)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 423; __pyx_clineno = __LINE__; goto __pyx_L1_error;} SDL_EventState(__pyx_t_7, SDL_ENABLE); /* "pygame_sdl2/event.pyx":422 * def set_blocked(t=None): * if t == None: * for et in event_names.keys(): # <<<<<<<<<<<<<< * SDL_EventState(et, SDL_ENABLE) * elif isinstance(t, (int, long)): */ } __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; /* "pygame_sdl2/event.pyx":421 * * def set_blocked(t=None): * if t == None: # <<<<<<<<<<<<<< * for et in event_names.keys(): * SDL_EventState(et, SDL_ENABLE) */ goto __pyx_L3; } /* "pygame_sdl2/event.pyx":424 * for et in event_names.keys(): * SDL_EventState(et, SDL_ENABLE) * elif isinstance(t, (int, long)): # <<<<<<<<<<<<<< * SDL_EventState(t, SDL_IGNORE) * else: */ __pyx_t_8 = PyInt_Check(__pyx_v_t); __pyx_t_9 = (__pyx_t_8 != 0); if (!__pyx_t_9) { } else { __pyx_t_2 = __pyx_t_9; goto __pyx_L6_bool_binop_done; } __pyx_t_9 = PyLong_Check(__pyx_v_t); __pyx_t_8 = (__pyx_t_9 != 0); __pyx_t_2 = __pyx_t_8; __pyx_L6_bool_binop_done:; __pyx_t_8 = (__pyx_t_2 != 0); if (__pyx_t_8) { /* "pygame_sdl2/event.pyx":425 * SDL_EventState(et, SDL_ENABLE) * elif isinstance(t, (int, long)): * SDL_EventState(t, SDL_IGNORE) # <<<<<<<<<<<<<< * else: * for et in t: */ __pyx_t_7 = __Pyx_PyInt_As_uint32_t(__pyx_v_t); if (unlikely((__pyx_t_7 == (Uint32)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 425; __pyx_clineno = __LINE__; goto __pyx_L1_error;} SDL_EventState(__pyx_t_7, SDL_IGNORE); /* "pygame_sdl2/event.pyx":424 * for et in event_names.keys(): * SDL_EventState(et, SDL_ENABLE) * elif isinstance(t, (int, long)): # <<<<<<<<<<<<<< * SDL_EventState(t, SDL_IGNORE) * else: */ goto __pyx_L3; } /* "pygame_sdl2/event.pyx":427 * SDL_EventState(t, SDL_IGNORE) * else: * for et in t: # <<<<<<<<<<<<<< * SDL_EventState(et, SDL_IGNORE) * */ /*else*/ { if (likely(PyList_CheckExact(__pyx_v_t)) || PyTuple_CheckExact(__pyx_v_t)) { __pyx_t_4 = __pyx_v_t; __Pyx_INCREF(__pyx_t_4); __pyx_t_5 = 0; __pyx_t_6 = NULL; } else { __pyx_t_5 = -1; __pyx_t_4 = PyObject_GetIter(__pyx_v_t); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 427; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); __pyx_t_6 = Py_TYPE(__pyx_t_4)->tp_iternext; if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 427; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } for (;;) { if (likely(!__pyx_t_6)) { if (likely(PyList_CheckExact(__pyx_t_4))) { if (__pyx_t_5 >= PyList_GET_SIZE(__pyx_t_4)) break; #if CYTHON_COMPILING_IN_CPYTHON __pyx_t_1 = PyList_GET_ITEM(__pyx_t_4, __pyx_t_5); __Pyx_INCREF(__pyx_t_1); __pyx_t_5++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 427; __pyx_clineno = __LINE__; goto __pyx_L1_error;} #else __pyx_t_1 = PySequence_ITEM(__pyx_t_4, __pyx_t_5); __pyx_t_5++; if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 427; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); #endif } else { if (__pyx_t_5 >= PyTuple_GET_SIZE(__pyx_t_4)) break; #if CYTHON_COMPILING_IN_CPYTHON __pyx_t_1 = PyTuple_GET_ITEM(__pyx_t_4, __pyx_t_5); __Pyx_INCREF(__pyx_t_1); __pyx_t_5++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 427; __pyx_clineno = __LINE__; goto __pyx_L1_error;} #else __pyx_t_1 = PySequence_ITEM(__pyx_t_4, __pyx_t_5); __pyx_t_5++; if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 427; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); #endif } } else { __pyx_t_1 = __pyx_t_6(__pyx_t_4); if (unlikely(!__pyx_t_1)) { PyObject* exc_type = PyErr_Occurred(); if (exc_type) { if (likely(exc_type == PyExc_StopIteration || PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); else {__pyx_filename = __pyx_f[0]; __pyx_lineno = 427; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } break; } __Pyx_GOTREF(__pyx_t_1); } __Pyx_XDECREF_SET(__pyx_v_et, __pyx_t_1); __pyx_t_1 = 0; /* "pygame_sdl2/event.pyx":428 * else: * for et in t: * SDL_EventState(et, SDL_IGNORE) # <<<<<<<<<<<<<< * * def set_allowed(t=None): */ __pyx_t_7 = __Pyx_PyInt_As_uint32_t(__pyx_v_et); if (unlikely((__pyx_t_7 == (Uint32)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 428; __pyx_clineno = __LINE__; goto __pyx_L1_error;} SDL_EventState(__pyx_t_7, SDL_IGNORE); /* "pygame_sdl2/event.pyx":427 * SDL_EventState(t, SDL_IGNORE) * else: * for et in t: # <<<<<<<<<<<<<< * SDL_EventState(et, SDL_IGNORE) * */ } __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; } __pyx_L3:; /* "pygame_sdl2/event.pyx":420 * return "UNKNOWN" * * def set_blocked(t=None): # <<<<<<<<<<<<<< * if t == None: * for et in event_names.keys(): */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_AddTraceback("pygame_sdl2.event.set_blocked", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF(__pyx_v_et); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/event.pyx":430 * SDL_EventState(et, SDL_IGNORE) * * def set_allowed(t=None): # <<<<<<<<<<<<<< * if t == None: * for et in event_names.keys(): */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_5event_19set_allowed(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static PyMethodDef __pyx_mdef_11pygame_sdl2_5event_19set_allowed = {"set_allowed", (PyCFunction)__pyx_pw_11pygame_sdl2_5event_19set_allowed, METH_VARARGS|METH_KEYWORDS, 0}; static PyObject *__pyx_pw_11pygame_sdl2_5event_19set_allowed(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_t = 0; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("set_allowed (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_t,0}; PyObject* values[1] = {0}; values[0] = ((PyObject *)Py_None); if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (kw_args > 0) { PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_t); if (value) { values[0] = value; kw_args--; } } } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "set_allowed") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 430; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } } else { switch (PyTuple_GET_SIZE(__pyx_args)) { case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); case 0: break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_t = values[0]; } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("set_allowed", 0, 0, 1, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 430; __pyx_clineno = __LINE__; goto __pyx_L3_error;} __pyx_L3_error:; __Pyx_AddTraceback("pygame_sdl2.event.set_allowed", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_11pygame_sdl2_5event_18set_allowed(__pyx_self, __pyx_v_t); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_5event_18set_allowed(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_t) { PyObject *__pyx_v_et = NULL; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_t_2; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; Py_ssize_t __pyx_t_5; PyObject *(*__pyx_t_6)(PyObject *); Uint32 __pyx_t_7; int __pyx_t_8; int __pyx_t_9; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("set_allowed", 0); /* "pygame_sdl2/event.pyx":431 * * def set_allowed(t=None): * if t == None: # <<<<<<<<<<<<<< * for et in event_names.keys(): * SDL_EventState(et, SDL_IGNORE) */ __pyx_t_1 = PyObject_RichCompare(__pyx_v_t, Py_None, Py_EQ); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 431; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 431; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (__pyx_t_2) { /* "pygame_sdl2/event.pyx":432 * def set_allowed(t=None): * if t == None: * for et in event_names.keys(): # <<<<<<<<<<<<<< * SDL_EventState(et, SDL_IGNORE) * elif isinstance(t, (int, long)): */ __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_event_names); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 432; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_keys); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 432; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_3 = NULL; if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_4))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_4); if (likely(__pyx_t_3)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_4, function); } } if (__pyx_t_3) { __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_3); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 432; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } else { __pyx_t_1 = __Pyx_PyObject_CallNoArg(__pyx_t_4); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 432; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; if (likely(PyList_CheckExact(__pyx_t_1)) || PyTuple_CheckExact(__pyx_t_1)) { __pyx_t_4 = __pyx_t_1; __Pyx_INCREF(__pyx_t_4); __pyx_t_5 = 0; __pyx_t_6 = NULL; } else { __pyx_t_5 = -1; __pyx_t_4 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 432; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); __pyx_t_6 = Py_TYPE(__pyx_t_4)->tp_iternext; if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 432; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; for (;;) { if (likely(!__pyx_t_6)) { if (likely(PyList_CheckExact(__pyx_t_4))) { if (__pyx_t_5 >= PyList_GET_SIZE(__pyx_t_4)) break; #if CYTHON_COMPILING_IN_CPYTHON __pyx_t_1 = PyList_GET_ITEM(__pyx_t_4, __pyx_t_5); __Pyx_INCREF(__pyx_t_1); __pyx_t_5++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 432; __pyx_clineno = __LINE__; goto __pyx_L1_error;} #else __pyx_t_1 = PySequence_ITEM(__pyx_t_4, __pyx_t_5); __pyx_t_5++; if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 432; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); #endif } else { if (__pyx_t_5 >= PyTuple_GET_SIZE(__pyx_t_4)) break; #if CYTHON_COMPILING_IN_CPYTHON __pyx_t_1 = PyTuple_GET_ITEM(__pyx_t_4, __pyx_t_5); __Pyx_INCREF(__pyx_t_1); __pyx_t_5++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 432; __pyx_clineno = __LINE__; goto __pyx_L1_error;} #else __pyx_t_1 = PySequence_ITEM(__pyx_t_4, __pyx_t_5); __pyx_t_5++; if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 432; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); #endif } } else { __pyx_t_1 = __pyx_t_6(__pyx_t_4); if (unlikely(!__pyx_t_1)) { PyObject* exc_type = PyErr_Occurred(); if (exc_type) { if (likely(exc_type == PyExc_StopIteration || PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); else {__pyx_filename = __pyx_f[0]; __pyx_lineno = 432; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } break; } __Pyx_GOTREF(__pyx_t_1); } __Pyx_XDECREF_SET(__pyx_v_et, __pyx_t_1); __pyx_t_1 = 0; /* "pygame_sdl2/event.pyx":433 * if t == None: * for et in event_names.keys(): * SDL_EventState(et, SDL_IGNORE) # <<<<<<<<<<<<<< * elif isinstance(t, (int, long)): * SDL_EventState(t, SDL_ENABLE) */ __pyx_t_7 = __Pyx_PyInt_As_uint32_t(__pyx_v_et); if (unlikely((__pyx_t_7 == (Uint32)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 433; __pyx_clineno = __LINE__; goto __pyx_L1_error;} SDL_EventState(__pyx_t_7, SDL_IGNORE); /* "pygame_sdl2/event.pyx":432 * def set_allowed(t=None): * if t == None: * for et in event_names.keys(): # <<<<<<<<<<<<<< * SDL_EventState(et, SDL_IGNORE) * elif isinstance(t, (int, long)): */ } __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; /* "pygame_sdl2/event.pyx":431 * * def set_allowed(t=None): * if t == None: # <<<<<<<<<<<<<< * for et in event_names.keys(): * SDL_EventState(et, SDL_IGNORE) */ goto __pyx_L3; } /* "pygame_sdl2/event.pyx":434 * for et in event_names.keys(): * SDL_EventState(et, SDL_IGNORE) * elif isinstance(t, (int, long)): # <<<<<<<<<<<<<< * SDL_EventState(t, SDL_ENABLE) * else: */ __pyx_t_8 = PyInt_Check(__pyx_v_t); __pyx_t_9 = (__pyx_t_8 != 0); if (!__pyx_t_9) { } else { __pyx_t_2 = __pyx_t_9; goto __pyx_L6_bool_binop_done; } __pyx_t_9 = PyLong_Check(__pyx_v_t); __pyx_t_8 = (__pyx_t_9 != 0); __pyx_t_2 = __pyx_t_8; __pyx_L6_bool_binop_done:; __pyx_t_8 = (__pyx_t_2 != 0); if (__pyx_t_8) { /* "pygame_sdl2/event.pyx":435 * SDL_EventState(et, SDL_IGNORE) * elif isinstance(t, (int, long)): * SDL_EventState(t, SDL_ENABLE) # <<<<<<<<<<<<<< * else: * for et in t: */ __pyx_t_7 = __Pyx_PyInt_As_uint32_t(__pyx_v_t); if (unlikely((__pyx_t_7 == (Uint32)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 435; __pyx_clineno = __LINE__; goto __pyx_L1_error;} SDL_EventState(__pyx_t_7, SDL_ENABLE); /* "pygame_sdl2/event.pyx":434 * for et in event_names.keys(): * SDL_EventState(et, SDL_IGNORE) * elif isinstance(t, (int, long)): # <<<<<<<<<<<<<< * SDL_EventState(t, SDL_ENABLE) * else: */ goto __pyx_L3; } /* "pygame_sdl2/event.pyx":437 * SDL_EventState(t, SDL_ENABLE) * else: * for et in t: # <<<<<<<<<<<<<< * SDL_EventState(et, SDL_ENABLE) * */ /*else*/ { if (likely(PyList_CheckExact(__pyx_v_t)) || PyTuple_CheckExact(__pyx_v_t)) { __pyx_t_4 = __pyx_v_t; __Pyx_INCREF(__pyx_t_4); __pyx_t_5 = 0; __pyx_t_6 = NULL; } else { __pyx_t_5 = -1; __pyx_t_4 = PyObject_GetIter(__pyx_v_t); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 437; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); __pyx_t_6 = Py_TYPE(__pyx_t_4)->tp_iternext; if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 437; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } for (;;) { if (likely(!__pyx_t_6)) { if (likely(PyList_CheckExact(__pyx_t_4))) { if (__pyx_t_5 >= PyList_GET_SIZE(__pyx_t_4)) break; #if CYTHON_COMPILING_IN_CPYTHON __pyx_t_1 = PyList_GET_ITEM(__pyx_t_4, __pyx_t_5); __Pyx_INCREF(__pyx_t_1); __pyx_t_5++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 437; __pyx_clineno = __LINE__; goto __pyx_L1_error;} #else __pyx_t_1 = PySequence_ITEM(__pyx_t_4, __pyx_t_5); __pyx_t_5++; if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 437; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); #endif } else { if (__pyx_t_5 >= PyTuple_GET_SIZE(__pyx_t_4)) break; #if CYTHON_COMPILING_IN_CPYTHON __pyx_t_1 = PyTuple_GET_ITEM(__pyx_t_4, __pyx_t_5); __Pyx_INCREF(__pyx_t_1); __pyx_t_5++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 437; __pyx_clineno = __LINE__; goto __pyx_L1_error;} #else __pyx_t_1 = PySequence_ITEM(__pyx_t_4, __pyx_t_5); __pyx_t_5++; if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 437; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); #endif } } else { __pyx_t_1 = __pyx_t_6(__pyx_t_4); if (unlikely(!__pyx_t_1)) { PyObject* exc_type = PyErr_Occurred(); if (exc_type) { if (likely(exc_type == PyExc_StopIteration || PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); else {__pyx_filename = __pyx_f[0]; __pyx_lineno = 437; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } break; } __Pyx_GOTREF(__pyx_t_1); } __Pyx_XDECREF_SET(__pyx_v_et, __pyx_t_1); __pyx_t_1 = 0; /* "pygame_sdl2/event.pyx":438 * else: * for et in t: * SDL_EventState(et, SDL_ENABLE) # <<<<<<<<<<<<<< * * def get_blocked(t): */ __pyx_t_7 = __Pyx_PyInt_As_uint32_t(__pyx_v_et); if (unlikely((__pyx_t_7 == (Uint32)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 438; __pyx_clineno = __LINE__; goto __pyx_L1_error;} SDL_EventState(__pyx_t_7, SDL_ENABLE); /* "pygame_sdl2/event.pyx":437 * SDL_EventState(t, SDL_ENABLE) * else: * for et in t: # <<<<<<<<<<<<<< * SDL_EventState(et, SDL_ENABLE) * */ } __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; } __pyx_L3:; /* "pygame_sdl2/event.pyx":430 * SDL_EventState(et, SDL_IGNORE) * * def set_allowed(t=None): # <<<<<<<<<<<<<< * if t == None: * for et in event_names.keys(): */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_AddTraceback("pygame_sdl2.event.set_allowed", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF(__pyx_v_et); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/event.pyx":440 * SDL_EventState(et, SDL_ENABLE) * * def get_blocked(t): # <<<<<<<<<<<<<< * return SDL_EventState(t, SDL_QUERY) == SDL_IGNORE * */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_5event_21get_blocked(PyObject *__pyx_self, PyObject *__pyx_v_t); /*proto*/ static PyMethodDef __pyx_mdef_11pygame_sdl2_5event_21get_blocked = {"get_blocked", (PyCFunction)__pyx_pw_11pygame_sdl2_5event_21get_blocked, METH_O, 0}; static PyObject *__pyx_pw_11pygame_sdl2_5event_21get_blocked(PyObject *__pyx_self, PyObject *__pyx_v_t) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("get_blocked (wrapper)", 0); __pyx_r = __pyx_pf_11pygame_sdl2_5event_20get_blocked(__pyx_self, ((PyObject *)__pyx_v_t)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_5event_20get_blocked(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_t) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations Uint32 __pyx_t_1; PyObject *__pyx_t_2 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("get_blocked", 0); /* "pygame_sdl2/event.pyx":441 * * def get_blocked(t): * return SDL_EventState(t, SDL_QUERY) == SDL_IGNORE # <<<<<<<<<<<<<< * * def set_grab(on): */ __Pyx_XDECREF(__pyx_r); __pyx_t_1 = __Pyx_PyInt_As_uint32_t(__pyx_v_t); if (unlikely((__pyx_t_1 == (Uint32)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 441; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_t_2 = __Pyx_PyBool_FromLong((SDL_EventState(__pyx_t_1, SDL_QUERY) == SDL_IGNORE)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 441; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; /* "pygame_sdl2/event.pyx":440 * SDL_EventState(et, SDL_ENABLE) * * def get_blocked(t): # <<<<<<<<<<<<<< * return SDL_EventState(t, SDL_QUERY) == SDL_IGNORE * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_AddTraceback("pygame_sdl2.event.get_blocked", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/event.pyx":443 * return SDL_EventState(t, SDL_QUERY) == SDL_IGNORE * * def set_grab(on): # <<<<<<<<<<<<<< * SDL_SetWindowGrab(main_window.window, on) * */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_5event_23set_grab(PyObject *__pyx_self, PyObject *__pyx_v_on); /*proto*/ static PyMethodDef __pyx_mdef_11pygame_sdl2_5event_23set_grab = {"set_grab", (PyCFunction)__pyx_pw_11pygame_sdl2_5event_23set_grab, METH_O, 0}; static PyObject *__pyx_pw_11pygame_sdl2_5event_23set_grab(PyObject *__pyx_self, PyObject *__pyx_v_on) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("set_grab (wrapper)", 0); __pyx_r = __pyx_pf_11pygame_sdl2_5event_22set_grab(__pyx_self, ((PyObject *)__pyx_v_on)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_5event_22set_grab(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_on) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations SDL_bool __pyx_t_1; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("set_grab", 0); /* "pygame_sdl2/event.pyx":444 * * def set_grab(on): * SDL_SetWindowGrab(main_window.window, on) # <<<<<<<<<<<<<< * * def get_grab(): */ __pyx_t_1 = ((SDL_bool)__Pyx_PyInt_As_SDL_bool(__pyx_v_on)); if (unlikely(PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 444; __pyx_clineno = __LINE__; goto __pyx_L1_error;} SDL_SetWindowGrab(__pyx_v_11pygame_sdl2_7display_main_window->window, __pyx_t_1); /* "pygame_sdl2/event.pyx":443 * return SDL_EventState(t, SDL_QUERY) == SDL_IGNORE * * def set_grab(on): # <<<<<<<<<<<<<< * SDL_SetWindowGrab(main_window.window, on) * */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("pygame_sdl2.event.set_grab", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/event.pyx":446 * SDL_SetWindowGrab(main_window.window, on) * * def get_grab(): # <<<<<<<<<<<<<< * return SDL_GetWindowGrab(main_window.window) * */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_5event_25get_grab(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused); /*proto*/ static PyMethodDef __pyx_mdef_11pygame_sdl2_5event_25get_grab = {"get_grab", (PyCFunction)__pyx_pw_11pygame_sdl2_5event_25get_grab, METH_NOARGS, 0}; static PyObject *__pyx_pw_11pygame_sdl2_5event_25get_grab(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("get_grab (wrapper)", 0); __pyx_r = __pyx_pf_11pygame_sdl2_5event_24get_grab(__pyx_self); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_5event_24get_grab(CYTHON_UNUSED PyObject *__pyx_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("get_grab", 0); /* "pygame_sdl2/event.pyx":447 * * def get_grab(): * return SDL_GetWindowGrab(main_window.window) # <<<<<<<<<<<<<< * * def set_mousewheel_buttons(flag): */ __Pyx_XDECREF(__pyx_r); __pyx_t_1 = __Pyx_PyInt_From_SDL_bool(SDL_GetWindowGrab(__pyx_v_11pygame_sdl2_7display_main_window->window)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 447; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "pygame_sdl2/event.pyx":446 * SDL_SetWindowGrab(main_window.window, on) * * def get_grab(): # <<<<<<<<<<<<<< * return SDL_GetWindowGrab(main_window.window) * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("pygame_sdl2.event.get_grab", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/event.pyx":449 * return SDL_GetWindowGrab(main_window.window) * * def set_mousewheel_buttons(flag): # <<<<<<<<<<<<<< * """ * If true (the default), the mousewheel will generate events involving */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_5event_27set_mousewheel_buttons(PyObject *__pyx_self, PyObject *__pyx_v_flag); /*proto*/ static char __pyx_doc_11pygame_sdl2_5event_26set_mousewheel_buttons[] = "\n If true (the default), the mousewheel will generate events involving\n mouse buttons 4 and 5, and mousebuttons 4 and higher will be mapped to 6 and higher.\n\n If false, MOUSEWHEEL events are generated, and the mousebuttons are\n not remapped.\n "; static PyMethodDef __pyx_mdef_11pygame_sdl2_5event_27set_mousewheel_buttons = {"set_mousewheel_buttons", (PyCFunction)__pyx_pw_11pygame_sdl2_5event_27set_mousewheel_buttons, METH_O, __pyx_doc_11pygame_sdl2_5event_26set_mousewheel_buttons}; static PyObject *__pyx_pw_11pygame_sdl2_5event_27set_mousewheel_buttons(PyObject *__pyx_self, PyObject *__pyx_v_flag) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("set_mousewheel_buttons (wrapper)", 0); __pyx_r = __pyx_pf_11pygame_sdl2_5event_26set_mousewheel_buttons(__pyx_self, ((PyObject *)__pyx_v_flag)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_5event_26set_mousewheel_buttons(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_flag) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("set_mousewheel_buttons", 0); /* "pygame_sdl2/event.pyx":459 * * global mousewheel_buttons * mousewheel_buttons = flag # <<<<<<<<<<<<<< * * def get_mousewheel_buttons(): */ __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_flag); if (unlikely((__pyx_t_1 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 459; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_v_11pygame_sdl2_5event_mousewheel_buttons = __pyx_t_1; /* "pygame_sdl2/event.pyx":449 * return SDL_GetWindowGrab(main_window.window) * * def set_mousewheel_buttons(flag): # <<<<<<<<<<<<<< * """ * If true (the default), the mousewheel will generate events involving */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("pygame_sdl2.event.set_mousewheel_buttons", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/event.pyx":461 * mousewheel_buttons = flag * * def get_mousewheel_buttons(): # <<<<<<<<<<<<<< * """ * Returns the value set by mousehweel buttons,. */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_5event_29get_mousewheel_buttons(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused); /*proto*/ static char __pyx_doc_11pygame_sdl2_5event_28get_mousewheel_buttons[] = "\n Returns the value set by mousehweel buttons,.\n "; static PyMethodDef __pyx_mdef_11pygame_sdl2_5event_29get_mousewheel_buttons = {"get_mousewheel_buttons", (PyCFunction)__pyx_pw_11pygame_sdl2_5event_29get_mousewheel_buttons, METH_NOARGS, __pyx_doc_11pygame_sdl2_5event_28get_mousewheel_buttons}; static PyObject *__pyx_pw_11pygame_sdl2_5event_29get_mousewheel_buttons(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("get_mousewheel_buttons (wrapper)", 0); __pyx_r = __pyx_pf_11pygame_sdl2_5event_28get_mousewheel_buttons(__pyx_self); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_5event_28get_mousewheel_buttons(CYTHON_UNUSED PyObject *__pyx_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("get_mousewheel_buttons", 0); /* "pygame_sdl2/event.pyx":466 * """ * * return mousewheel_buttons # <<<<<<<<<<<<<< * * def post(e): */ __Pyx_XDECREF(__pyx_r); __pyx_t_1 = __Pyx_PyBool_FromLong(__pyx_v_11pygame_sdl2_5event_mousewheel_buttons); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 466; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "pygame_sdl2/event.pyx":461 * mousewheel_buttons = flag * * def get_mousewheel_buttons(): # <<<<<<<<<<<<<< * """ * Returns the value set by mousehweel buttons,. */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("pygame_sdl2.event.get_mousewheel_buttons", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/event.pyx":468 * return mousewheel_buttons * * def post(e): # <<<<<<<<<<<<<< * """ * Posts event object `e` to the event queue. */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_5event_31post(PyObject *__pyx_self, PyObject *__pyx_v_e); /*proto*/ static char __pyx_doc_11pygame_sdl2_5event_30post[] = "\n Posts event object `e` to the event queue.\n "; static PyMethodDef __pyx_mdef_11pygame_sdl2_5event_31post = {"post", (PyCFunction)__pyx_pw_11pygame_sdl2_5event_31post, METH_O, __pyx_doc_11pygame_sdl2_5event_30post}; static PyObject *__pyx_pw_11pygame_sdl2_5event_31post(PyObject *__pyx_self, PyObject *__pyx_v_e) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("post (wrapper)", 0); __pyx_r = __pyx_pf_11pygame_sdl2_5event_30post(__pyx_self, ((PyObject *)__pyx_v_e)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_5event_30post(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_e) { SDL_Event __pyx_v_event; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_t_2; int __pyx_t_3; PyObject *__pyx_t_4 = NULL; PyObject *__pyx_t_5 = NULL; PyObject *__pyx_t_6 = NULL; PyObject *__pyx_t_7 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("post", 0); /* "pygame_sdl2/event.pyx":475 * cdef SDL_Event event; * * if not isinstance(e, EventType): # <<<<<<<<<<<<<< * raise pygame_sdl2.error("event.post must be called with an Event.") * */ __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_EventType); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 475; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = PyObject_IsInstance(__pyx_v_e, __pyx_t_1); if (unlikely(__pyx_t_2 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 475; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_3 = ((!(__pyx_t_2 != 0)) != 0); if (__pyx_t_3) { /* "pygame_sdl2/event.pyx":476 * * if not isinstance(e, EventType): * raise pygame_sdl2.error("event.post must be called with an Event.") # <<<<<<<<<<<<<< * * if get_blocked(e.type): */ __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_pygame_sdl2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 476; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_error); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 476; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_tuple__12, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 476; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_Raise(__pyx_t_1, 0, 0, 0); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; {__pyx_filename = __pyx_f[0]; __pyx_lineno = 476; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "pygame_sdl2/event.pyx":475 * cdef SDL_Event event; * * if not isinstance(e, EventType): # <<<<<<<<<<<<<< * raise pygame_sdl2.error("event.post must be called with an Event.") * */ } /* "pygame_sdl2/event.pyx":478 * raise pygame_sdl2.error("event.post must be called with an Event.") * * if get_blocked(e.type): # <<<<<<<<<<<<<< * return * */ __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_get_blocked); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 478; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_e, __pyx_n_s_type); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 478; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); __pyx_t_6 = NULL; if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_4))) { __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_4); if (likely(__pyx_t_6)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4); __Pyx_INCREF(__pyx_t_6); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_4, function); } } if (!__pyx_t_6) { __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_5); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 478; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_GOTREF(__pyx_t_1); } else { __pyx_t_7 = PyTuple_New(1+1); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 478; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_7); __Pyx_GIVEREF(__pyx_t_6); PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_6); __pyx_t_6 = NULL; __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_7, 0+1, __pyx_t_5); __pyx_t_5 = 0; __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_7, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 478; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; } __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 478; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (__pyx_t_3) { /* "pygame_sdl2/event.pyx":479 * * if get_blocked(e.type): * return # <<<<<<<<<<<<<< * * Py_INCREF(e) */ __Pyx_XDECREF(__pyx_r); __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; /* "pygame_sdl2/event.pyx":478 * raise pygame_sdl2.error("event.post must be called with an Event.") * * if get_blocked(e.type): # <<<<<<<<<<<<<< * return * */ } /* "pygame_sdl2/event.pyx":481 * return * * Py_INCREF(e) # <<<<<<<<<<<<<< * * event.type = POSTEDEVENT */ Py_INCREF(__pyx_v_e); /* "pygame_sdl2/event.pyx":483 * Py_INCREF(e) * * event.type = POSTEDEVENT # <<<<<<<<<<<<<< * event.user.data1 = e * */ __pyx_v_event.type = __pyx_v_11pygame_sdl2_5event_POSTEDEVENT; /* "pygame_sdl2/event.pyx":484 * * event.type = POSTEDEVENT * event.user.data1 = e # <<<<<<<<<<<<<< * * SDL_PushEvent(&event) */ __pyx_v_event.user.data1 = ((void *)__pyx_v_e); /* "pygame_sdl2/event.pyx":486 * event.user.data1 = e * * SDL_PushEvent(&event) # <<<<<<<<<<<<<< * * def register(name): */ SDL_PushEvent((&__pyx_v_event)); /* "pygame_sdl2/event.pyx":468 * return mousewheel_buttons * * def post(e): # <<<<<<<<<<<<<< * """ * Posts event object `e` to the event queue. */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_5); __Pyx_XDECREF(__pyx_t_6); __Pyx_XDECREF(__pyx_t_7); __Pyx_AddTraceback("pygame_sdl2.event.post", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/event.pyx":488 * SDL_PushEvent(&event) * * def register(name): # <<<<<<<<<<<<<< * """ * Registers a unique event number and returns that number. */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_5event_33register(PyObject *__pyx_self, PyObject *__pyx_v_name); /*proto*/ static char __pyx_doc_11pygame_sdl2_5event_32register[] = "\n Registers a unique event number and returns that number.\n\n `name`\n A string name for the event. This is used when calling `repr` on\n the event.\n "; static PyMethodDef __pyx_mdef_11pygame_sdl2_5event_33register = {"register", (PyCFunction)__pyx_pw_11pygame_sdl2_5event_33register, METH_O, __pyx_doc_11pygame_sdl2_5event_32register}; static PyObject *__pyx_pw_11pygame_sdl2_5event_33register(PyObject *__pyx_self, PyObject *__pyx_v_name) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("register (wrapper)", 0); __pyx_r = __pyx_pf_11pygame_sdl2_5event_32register(__pyx_self, ((PyObject *)__pyx_v_name)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_5event_32register(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_name) { Uint32 __pyx_v_rv; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("register", 0); /* "pygame_sdl2/event.pyx":497 * """ * * rv = SDL_RegisterEvents(1) # <<<<<<<<<<<<<< * * event_names[rv] = name */ __pyx_v_rv = SDL_RegisterEvents(1); /* "pygame_sdl2/event.pyx":499 * rv = SDL_RegisterEvents(1) * * event_names[rv] = name # <<<<<<<<<<<<<< * return rv * */ __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_event_names); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 499; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); if (unlikely(__Pyx_SetItemInt(__pyx_t_1, __pyx_v_rv, __pyx_v_name, Uint32, 0, __Pyx_PyInt_From_uint32_t, 0, 0, 1) < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 499; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "pygame_sdl2/event.pyx":500 * * event_names[rv] = name * return rv # <<<<<<<<<<<<<< * * def copy_event_queue(): */ __Pyx_XDECREF(__pyx_r); __pyx_t_1 = __Pyx_PyInt_From_uint32_t(__pyx_v_rv); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 500; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "pygame_sdl2/event.pyx":488 * SDL_PushEvent(&event) * * def register(name): # <<<<<<<<<<<<<< * """ * Registers a unique event number and returns that number. */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("pygame_sdl2.event.register", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/event.pyx":502 * return rv * * def copy_event_queue(): # <<<<<<<<<<<<<< * """ * Returns a copy of the event queue. The copy cannot be used for modifying */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_5event_35copy_event_queue(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused); /*proto*/ static char __pyx_doc_11pygame_sdl2_5event_34copy_event_queue[] = "\n Returns a copy of the event queue. The copy cannot be used for modifying\n the event queue.\n "; static PyMethodDef __pyx_mdef_11pygame_sdl2_5event_35copy_event_queue = {"copy_event_queue", (PyCFunction)__pyx_pw_11pygame_sdl2_5event_35copy_event_queue, METH_NOARGS, __pyx_doc_11pygame_sdl2_5event_34copy_event_queue}; static PyObject *__pyx_pw_11pygame_sdl2_5event_35copy_event_queue(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("copy_event_queue (wrapper)", 0); __pyx_r = __pyx_pf_11pygame_sdl2_5event_34copy_event_queue(__pyx_self); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_5event_34copy_event_queue(CYTHON_UNUSED PyObject *__pyx_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("copy_event_queue", 0); /* "pygame_sdl2/event.pyx":508 * """ * * return event_queue[:] # <<<<<<<<<<<<<< * * # Usually called by display.init. */ __Pyx_XDECREF(__pyx_r); __pyx_t_1 = __Pyx_PyObject_GetSlice(event_queue, 0, 0, NULL, NULL, &__pyx_slice__13, 0, 0, 1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 508; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "pygame_sdl2/event.pyx":502 * return rv * * def copy_event_queue(): # <<<<<<<<<<<<<< * """ * Returns a copy of the event queue. The copy cannot be used for modifying */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("pygame_sdl2.event.copy_event_queue", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/event.pyx":511 * * # Usually called by display.init. * def init(): # <<<<<<<<<<<<<< * if not SDL_WasInit(SDL_INIT_EVENTS): * */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_5event_37init(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused); /*proto*/ static PyMethodDef __pyx_mdef_11pygame_sdl2_5event_37init = {"init", (PyCFunction)__pyx_pw_11pygame_sdl2_5event_37init, METH_NOARGS, 0}; static PyObject *__pyx_pw_11pygame_sdl2_5event_37init(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("init (wrapper)", 0); __pyx_r = __pyx_pf_11pygame_sdl2_5event_36init(__pyx_self); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_5event_36init(CYTHON_UNUSED PyObject *__pyx_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("init", 0); /* "pygame_sdl2/event.pyx":512 * # Usually called by display.init. * def init(): * if not SDL_WasInit(SDL_INIT_EVENTS): # <<<<<<<<<<<<<< * * pygame_sdl2.display.sdl_main_init() */ __pyx_t_1 = ((!(SDL_WasInit(SDL_INIT_EVENTS) != 0)) != 0); if (__pyx_t_1) { /* "pygame_sdl2/event.pyx":514 * if not SDL_WasInit(SDL_INIT_EVENTS): * * pygame_sdl2.display.sdl_main_init() # <<<<<<<<<<<<<< * * if SDL_InitSubSystem(SDL_INIT_EVENTS): */ __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_pygame_sdl2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 514; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_display); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 514; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_sdl_main_init); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 514; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_t_4 = NULL; if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_3))) { __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3); if (likely(__pyx_t_4)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); __Pyx_INCREF(__pyx_t_4); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_3, function); } } if (__pyx_t_4) { __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 514; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; } else { __pyx_t_2 = __Pyx_PyObject_CallNoArg(__pyx_t_3); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 514; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "pygame_sdl2/event.pyx":516 * pygame_sdl2.display.sdl_main_init() * * if SDL_InitSubSystem(SDL_INIT_EVENTS): # <<<<<<<<<<<<<< * raise pygame_sdl2.error.error() */ __pyx_t_1 = (SDL_InitSubSystem(SDL_INIT_EVENTS) != 0); if (__pyx_t_1) { /* "pygame_sdl2/event.pyx":517 * * if SDL_InitSubSystem(SDL_INIT_EVENTS): * raise pygame_sdl2.error.error() # <<<<<<<<<<<<<< */ __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_pygame_sdl2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 517; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_error); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 517; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_error); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 517; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_t_4 = NULL; if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_3))) { __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3); if (likely(__pyx_t_4)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); __Pyx_INCREF(__pyx_t_4); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_3, function); } } if (__pyx_t_4) { __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 517; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; } else { __pyx_t_2 = __Pyx_PyObject_CallNoArg(__pyx_t_3); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 517; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_Raise(__pyx_t_2, 0, 0, 0); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; {__pyx_filename = __pyx_f[0]; __pyx_lineno = 517; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "pygame_sdl2/event.pyx":516 * pygame_sdl2.display.sdl_main_init() * * if SDL_InitSubSystem(SDL_INIT_EVENTS): # <<<<<<<<<<<<<< * raise pygame_sdl2.error.error() */ } /* "pygame_sdl2/event.pyx":512 * # Usually called by display.init. * def init(): * if not SDL_WasInit(SDL_INIT_EVENTS): # <<<<<<<<<<<<<< * * pygame_sdl2.display.sdl_main_init() */ } /* "pygame_sdl2/event.pyx":511 * * # Usually called by display.init. * def init(): # <<<<<<<<<<<<<< * if not SDL_WasInit(SDL_INIT_EVENTS): * */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_AddTraceback("pygame_sdl2.event.init", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyMethodDef __pyx_methods[] = { {0, 0, 0, 0} }; #if PY_MAJOR_VERSION >= 3 static struct PyModuleDef __pyx_moduledef = { #if PY_VERSION_HEX < 0x03020000 { PyObject_HEAD_INIT(NULL) NULL, 0, NULL }, #else PyModuleDef_HEAD_INIT, #endif "event", 0, /* m_doc */ -1, /* m_size */ __pyx_methods /* m_methods */, NULL, /* m_reload */ NULL, /* m_traverse */ NULL, /* m_clear */ NULL /* m_free */ }; #endif static __Pyx_StringTabEntry __pyx_string_tab[] = { {&__pyx_kp_s_, __pyx_k_, sizeof(__pyx_k_), 0, 0, 1, 0}, {&__pyx_kp_u_, __pyx_k_, sizeof(__pyx_k_), 0, 1, 0, 0}, {&__pyx_n_s_ACTIVEEVENT, __pyx_k_ACTIVEEVENT, sizeof(__pyx_k_ACTIVEEVENT), 0, 0, 1, 1}, {&__pyx_n_s_APP_DIDENTERBACKGROUND, __pyx_k_APP_DIDENTERBACKGROUND, sizeof(__pyx_k_APP_DIDENTERBACKGROUND), 0, 0, 1, 1}, {&__pyx_n_s_APP_DIDENTERFOREGROUND, __pyx_k_APP_DIDENTERFOREGROUND, sizeof(__pyx_k_APP_DIDENTERFOREGROUND), 0, 0, 1, 1}, {&__pyx_n_s_APP_LOWMEMORY, __pyx_k_APP_LOWMEMORY, sizeof(__pyx_k_APP_LOWMEMORY), 0, 0, 1, 1}, {&__pyx_n_s_APP_TERMINATING, __pyx_k_APP_TERMINATING, sizeof(__pyx_k_APP_TERMINATING), 0, 0, 1, 1}, {&__pyx_n_s_APP_WILLENTERBACKGROUND, __pyx_k_APP_WILLENTERBACKGROUND, sizeof(__pyx_k_APP_WILLENTERBACKGROUND), 0, 0, 1, 1}, {&__pyx_n_s_APP_WILLENTERFOREGROUND, __pyx_k_APP_WILLENTERFOREGROUND, sizeof(__pyx_k_APP_WILLENTERFOREGROUND), 0, 0, 1, 1}, {&__pyx_n_s_CLIPBOARDUPDATE, __pyx_k_CLIPBOARDUPDATE, sizeof(__pyx_k_CLIPBOARDUPDATE), 0, 0, 1, 1}, {&__pyx_n_s_CONTROLLERAXISMOTION, __pyx_k_CONTROLLERAXISMOTION, sizeof(__pyx_k_CONTROLLERAXISMOTION), 0, 0, 1, 1}, {&__pyx_n_s_CONTROLLERBUTTONDOWN, __pyx_k_CONTROLLERBUTTONDOWN, sizeof(__pyx_k_CONTROLLERBUTTONDOWN), 0, 0, 1, 1}, {&__pyx_n_s_CONTROLLERBUTTONUP, __pyx_k_CONTROLLERBUTTONUP, sizeof(__pyx_k_CONTROLLERBUTTONUP), 0, 0, 1, 1}, {&__pyx_n_s_CONTROLLERDEVICEADDED, __pyx_k_CONTROLLERDEVICEADDED, sizeof(__pyx_k_CONTROLLERDEVICEADDED), 0, 0, 1, 1}, {&__pyx_n_s_CONTROLLERDEVICEREMAPPED, __pyx_k_CONTROLLERDEVICEREMAPPED, sizeof(__pyx_k_CONTROLLERDEVICEREMAPPED), 0, 0, 1, 1}, {&__pyx_n_s_CONTROLLERDEVICEREMOVED, __pyx_k_CONTROLLERDEVICEREMOVED, sizeof(__pyx_k_CONTROLLERDEVICEREMOVED), 0, 0, 1, 1}, {&__pyx_n_s_DOLLARGESTURE, __pyx_k_DOLLARGESTURE, sizeof(__pyx_k_DOLLARGESTURE), 0, 0, 1, 1}, {&__pyx_n_s_DOLLARRECORD, __pyx_k_DOLLARRECORD, sizeof(__pyx_k_DOLLARRECORD), 0, 0, 1, 1}, {&__pyx_n_s_DROPFILE, __pyx_k_DROPFILE, sizeof(__pyx_k_DROPFILE), 0, 0, 1, 1}, {&__pyx_n_s_Event, __pyx_k_Event, sizeof(__pyx_k_Event), 0, 0, 1, 1}, {&__pyx_n_s_EventType, __pyx_k_EventType, sizeof(__pyx_k_EventType), 0, 0, 1, 1}, {&__pyx_n_s_EventType___eq, __pyx_k_EventType___eq, sizeof(__pyx_k_EventType___eq), 0, 0, 1, 1}, {&__pyx_n_s_EventType___init, __pyx_k_EventType___init, sizeof(__pyx_k_EventType___init), 0, 0, 1, 1}, {&__pyx_n_s_EventType___ne, __pyx_k_EventType___ne, sizeof(__pyx_k_EventType___ne), 0, 0, 1, 1}, {&__pyx_n_s_EventType___nonzero, __pyx_k_EventType___nonzero, sizeof(__pyx_k_EventType___nonzero), 0, 0, 1, 1}, {&__pyx_n_s_EventType___repr, __pyx_k_EventType___repr, sizeof(__pyx_k_EventType___repr), 0, 0, 1, 1}, {&__pyx_n_s_EventType_dict, __pyx_k_EventType_dict, sizeof(__pyx_k_EventType_dict), 0, 0, 1, 1}, {&__pyx_n_s_EventType_type, __pyx_k_EventType_type, sizeof(__pyx_k_EventType_type), 0, 0, 1, 1}, {&__pyx_kp_s_Event_d_s_s, __pyx_k_Event_d_s_s, sizeof(__pyx_k_Event_d_s_s), 0, 0, 1, 0}, {&__pyx_n_s_FINGERDOWN, __pyx_k_FINGERDOWN, sizeof(__pyx_k_FINGERDOWN), 0, 0, 1, 1}, {&__pyx_n_s_FINGERMOTION, __pyx_k_FINGERMOTION, sizeof(__pyx_k_FINGERMOTION), 0, 0, 1, 1}, {&__pyx_n_s_FINGERUP, __pyx_k_FINGERUP, sizeof(__pyx_k_FINGERUP), 0, 0, 1, 1}, {&__pyx_n_s_JOYAXISMOTION, __pyx_k_JOYAXISMOTION, sizeof(__pyx_k_JOYAXISMOTION), 0, 0, 1, 1}, {&__pyx_n_s_JOYBALLMOTION, __pyx_k_JOYBALLMOTION, sizeof(__pyx_k_JOYBALLMOTION), 0, 0, 1, 1}, {&__pyx_n_s_JOYBUTTONDOWN, __pyx_k_JOYBUTTONDOWN, sizeof(__pyx_k_JOYBUTTONDOWN), 0, 0, 1, 1}, {&__pyx_n_s_JOYBUTTONUP, __pyx_k_JOYBUTTONUP, sizeof(__pyx_k_JOYBUTTONUP), 0, 0, 1, 1}, {&__pyx_n_s_JOYDEVICEADDED, __pyx_k_JOYDEVICEADDED, sizeof(__pyx_k_JOYDEVICEADDED), 0, 0, 1, 1}, {&__pyx_n_s_JOYDEVICEREMOVED, __pyx_k_JOYDEVICEREMOVED, sizeof(__pyx_k_JOYDEVICEREMOVED), 0, 0, 1, 1}, {&__pyx_n_s_JOYHATMOTION, __pyx_k_JOYHATMOTION, sizeof(__pyx_k_JOYHATMOTION), 0, 0, 1, 1}, {&__pyx_n_s_KEYDOWN, __pyx_k_KEYDOWN, sizeof(__pyx_k_KEYDOWN), 0, 0, 1, 1}, {&__pyx_n_s_KEYUP, __pyx_k_KEYUP, sizeof(__pyx_k_KEYUP), 0, 0, 1, 1}, {&__pyx_n_s_KeyError, __pyx_k_KeyError, sizeof(__pyx_k_KeyError), 0, 0, 1, 1}, {&__pyx_n_s_LASTEVENT, __pyx_k_LASTEVENT, sizeof(__pyx_k_LASTEVENT), 0, 0, 1, 1}, {&__pyx_n_s_MOUSEBUTTONDOWN, __pyx_k_MOUSEBUTTONDOWN, sizeof(__pyx_k_MOUSEBUTTONDOWN), 0, 0, 1, 1}, {&__pyx_n_s_MOUSEBUTTONUP, __pyx_k_MOUSEBUTTONUP, sizeof(__pyx_k_MOUSEBUTTONUP), 0, 0, 1, 1}, {&__pyx_n_s_MOUSEMOTION, __pyx_k_MOUSEMOTION, sizeof(__pyx_k_MOUSEMOTION), 0, 0, 1, 1}, {&__pyx_n_s_MOUSEWHEEL, __pyx_k_MOUSEWHEEL, sizeof(__pyx_k_MOUSEWHEEL), 0, 0, 1, 1}, {&__pyx_n_s_MULTIGESTURE, __pyx_k_MULTIGESTURE, sizeof(__pyx_k_MULTIGESTURE), 0, 0, 1, 1}, {&__pyx_n_u_NOEVENT, __pyx_k_NOEVENT, sizeof(__pyx_k_NOEVENT), 0, 1, 0, 1}, {&__pyx_n_s_NOEVENT_EVENT, __pyx_k_NOEVENT_EVENT, sizeof(__pyx_k_NOEVENT_EVENT), 0, 0, 1, 1}, {&__pyx_n_s_QUIT, __pyx_k_QUIT, sizeof(__pyx_k_QUIT), 0, 0, 1, 1}, {&__pyx_n_s_RENDER_TARGETS_RESET, __pyx_k_RENDER_TARGETS_RESET, sizeof(__pyx_k_RENDER_TARGETS_RESET), 0, 0, 1, 1}, {&__pyx_n_s_RLock, __pyx_k_RLock, sizeof(__pyx_k_RLock), 0, 0, 1, 1}, {&__pyx_n_s_SYSWMEVENT, __pyx_k_SYSWMEVENT, sizeof(__pyx_k_SYSWMEVENT), 0, 0, 1, 1}, {&__pyx_n_s_TEXTEDITING, __pyx_k_TEXTEDITING, sizeof(__pyx_k_TEXTEDITING), 0, 0, 1, 1}, {&__pyx_n_s_TEXTINPUT, __pyx_k_TEXTINPUT, sizeof(__pyx_k_TEXTINPUT), 0, 0, 1, 1}, {&__pyx_n_s_UNKNOWN, __pyx_k_UNKNOWN, sizeof(__pyx_k_UNKNOWN), 0, 0, 1, 1}, {&__pyx_n_s_USEREVENT, __pyx_k_USEREVENT, sizeof(__pyx_k_USEREVENT), 0, 0, 1, 1}, {&__pyx_n_s_USEREVENT_MAX, __pyx_k_USEREVENT_MAX, sizeof(__pyx_k_USEREVENT_MAX), 0, 0, 1, 1}, {&__pyx_kp_s_UserEvent_d, __pyx_k_UserEvent_d, sizeof(__pyx_k_UserEvent_d), 0, 0, 1, 0}, {&__pyx_n_s_VIDEOEXPOSE, __pyx_k_VIDEOEXPOSE, sizeof(__pyx_k_VIDEOEXPOSE), 0, 0, 1, 1}, {&__pyx_n_s_VIDEORESIZE, __pyx_k_VIDEORESIZE, sizeof(__pyx_k_VIDEORESIZE), 0, 0, 1, 1}, {&__pyx_n_s_WINDOWEVENT, __pyx_k_WINDOWEVENT, sizeof(__pyx_k_WINDOWEVENT), 0, 0, 1, 1}, {&__pyx_n_s_append, __pyx_k_append, sizeof(__pyx_k_append), 0, 0, 1, 1}, {&__pyx_n_s_axis, __pyx_k_axis, sizeof(__pyx_k_axis), 0, 0, 1, 1}, {&__pyx_n_s_ball, __pyx_k_ball, sizeof(__pyx_k_ball), 0, 0, 1, 1}, {&__pyx_n_s_button, __pyx_k_button, sizeof(__pyx_k_button), 0, 0, 1, 1}, {&__pyx_n_s_buttons, __pyx_k_buttons, sizeof(__pyx_k_buttons), 0, 0, 1, 1}, {&__pyx_n_s_chr, __pyx_k_chr, sizeof(__pyx_k_chr), 0, 0, 1, 1}, {&__pyx_n_s_clear, __pyx_k_clear, sizeof(__pyx_k_clear), 0, 0, 1, 1}, {&__pyx_n_s_code, __pyx_k_code, sizeof(__pyx_k_code), 0, 0, 1, 1}, {&__pyx_n_s_copy, __pyx_k_copy, sizeof(__pyx_k_copy), 0, 0, 1, 1}, {&__pyx_n_s_copy_event_queue, __pyx_k_copy_event_queue, sizeof(__pyx_k_copy_event_queue), 0, 0, 1, 1}, {&__pyx_n_s_d, __pyx_k_d, sizeof(__pyx_k_d), 0, 0, 1, 1}, {&__pyx_n_s_dDist, __pyx_k_dDist, sizeof(__pyx_k_dDist), 0, 0, 1, 1}, {&__pyx_n_s_dTheta, __pyx_k_dTheta, sizeof(__pyx_k_dTheta), 0, 0, 1, 1}, {&__pyx_n_s_data1, __pyx_k_data1, sizeof(__pyx_k_data1), 0, 0, 1, 1}, {&__pyx_n_s_data2, __pyx_k_data2, sizeof(__pyx_k_data2), 0, 0, 1, 1}, {&__pyx_n_s_dict, __pyx_k_dict, sizeof(__pyx_k_dict), 0, 0, 1, 1}, {&__pyx_n_s_dict_2, __pyx_k_dict_2, sizeof(__pyx_k_dict_2), 0, 0, 1, 1}, {&__pyx_n_s_display, __pyx_k_display, sizeof(__pyx_k_display), 0, 0, 1, 1}, {&__pyx_n_s_doc, __pyx_k_doc, sizeof(__pyx_k_doc), 0, 0, 1, 1}, {&__pyx_n_s_dx, __pyx_k_dx, sizeof(__pyx_k_dx), 0, 0, 1, 1}, {&__pyx_n_s_dy, __pyx_k_dy, sizeof(__pyx_k_dy), 0, 0, 1, 1}, {&__pyx_n_s_e, __pyx_k_e, sizeof(__pyx_k_e), 0, 0, 1, 1}, {&__pyx_n_s_ename, __pyx_k_ename, sizeof(__pyx_k_ename), 0, 0, 1, 1}, {&__pyx_n_s_enter, __pyx_k_enter, sizeof(__pyx_k_enter), 0, 0, 1, 1}, {&__pyx_n_s_eq, __pyx_k_eq, sizeof(__pyx_k_eq), 0, 0, 1, 1}, {&__pyx_n_s_error, __pyx_k_error, sizeof(__pyx_k_error), 0, 0, 1, 1}, {&__pyx_n_s_et, __pyx_k_et, sizeof(__pyx_k_et), 0, 0, 1, 1}, {&__pyx_n_s_event, __pyx_k_event, sizeof(__pyx_k_event), 0, 0, 1, 1}, {&__pyx_n_s_event_name, __pyx_k_event_name, sizeof(__pyx_k_event_name), 0, 0, 1, 1}, {&__pyx_n_s_event_names, __pyx_k_event_names, sizeof(__pyx_k_event_names), 0, 0, 1, 1}, {&__pyx_kp_s_event_post_must_be_called_with_a, __pyx_k_event_post_must_be_called_with_a, sizeof(__pyx_k_event_post_must_be_called_with_a), 0, 0, 1, 0}, {&__pyx_n_s_evt, __pyx_k_evt, sizeof(__pyx_k_evt), 0, 0, 1, 1}, {&__pyx_n_s_exit, __pyx_k_exit, sizeof(__pyx_k_exit), 0, 0, 1, 1}, {&__pyx_n_s_fingerId, __pyx_k_fingerId, sizeof(__pyx_k_fingerId), 0, 0, 1, 1}, {&__pyx_n_s_flag, __pyx_k_flag, sizeof(__pyx_k_flag), 0, 0, 1, 1}, {&__pyx_n_s_gain, __pyx_k_gain, sizeof(__pyx_k_gain), 0, 0, 1, 1}, {&__pyx_n_s_get, __pyx_k_get, sizeof(__pyx_k_get), 0, 0, 1, 1}, {&__pyx_n_s_get_blocked, __pyx_k_get_blocked, sizeof(__pyx_k_get_blocked), 0, 0, 1, 1}, {&__pyx_n_s_get_grab, __pyx_k_get_grab, sizeof(__pyx_k_get_grab), 0, 0, 1, 1}, {&__pyx_n_s_get_mousewheel_buttons, __pyx_k_get_mousewheel_buttons, sizeof(__pyx_k_get_mousewheel_buttons), 0, 0, 1, 1}, {&__pyx_n_s_get_standard_events, __pyx_k_get_standard_events, sizeof(__pyx_k_get_standard_events), 0, 0, 1, 1}, {&__pyx_n_s_h, __pyx_k_h, sizeof(__pyx_k_h), 0, 0, 1, 1}, {&__pyx_n_s_hat, __pyx_k_hat, sizeof(__pyx_k_hat), 0, 0, 1, 1}, {&__pyx_kp_s_home_tom_ab_pygame_sdl2_src_pyg, __pyx_k_home_tom_ab_pygame_sdl2_src_pyg, sizeof(__pyx_k_home_tom_ab_pygame_sdl2_src_pyg), 0, 0, 1, 0}, {&__pyx_n_s_i, __pyx_k_i, sizeof(__pyx_k_i), 0, 0, 1, 1}, {&__pyx_n_s_import, __pyx_k_import, sizeof(__pyx_k_import), 0, 0, 1, 1}, {&__pyx_n_s_init, __pyx_k_init, sizeof(__pyx_k_init), 0, 0, 1, 1}, {&__pyx_n_s_init_2, __pyx_k_init_2, sizeof(__pyx_k_init_2), 0, 0, 1, 1}, {&__pyx_n_s_insert, __pyx_k_insert, sizeof(__pyx_k_insert), 0, 0, 1, 1}, {&__pyx_n_s_joy, __pyx_k_joy, sizeof(__pyx_k_joy), 0, 0, 1, 1}, {&__pyx_n_s_key, __pyx_k_key, sizeof(__pyx_k_key), 0, 0, 1, 1}, {&__pyx_n_s_keys, __pyx_k_keys, sizeof(__pyx_k_keys), 0, 0, 1, 1}, {&__pyx_n_s_kwargs, __pyx_k_kwargs, sizeof(__pyx_k_kwargs), 0, 0, 1, 1}, {&__pyx_n_s_length, __pyx_k_length, sizeof(__pyx_k_length), 0, 0, 1, 1}, {&__pyx_n_s_lock, __pyx_k_lock, sizeof(__pyx_k_lock), 0, 0, 1, 1}, {&__pyx_n_s_main, __pyx_k_main, sizeof(__pyx_k_main), 0, 0, 1, 1}, {&__pyx_n_s_metaclass, __pyx_k_metaclass, sizeof(__pyx_k_metaclass), 0, 0, 1, 1}, {&__pyx_n_s_mod, __pyx_k_mod, sizeof(__pyx_k_mod), 0, 0, 1, 1}, {&__pyx_n_s_module, __pyx_k_module, sizeof(__pyx_k_module), 0, 0, 1, 1}, {&__pyx_n_s_name, __pyx_k_name, sizeof(__pyx_k_name), 0, 0, 1, 1}, {&__pyx_n_s_ne, __pyx_k_ne, sizeof(__pyx_k_ne), 0, 0, 1, 1}, {&__pyx_n_s_nonzero, __pyx_k_nonzero, sizeof(__pyx_k_nonzero), 0, 0, 1, 1}, {&__pyx_n_s_numFingers, __pyx_k_numFingers, sizeof(__pyx_k_numFingers), 0, 0, 1, 1}, {&__pyx_n_s_object, __pyx_k_object, sizeof(__pyx_k_object), 0, 0, 1, 1}, {&__pyx_n_s_on, __pyx_k_on, sizeof(__pyx_k_on), 0, 0, 1, 1}, {&__pyx_n_s_other, __pyx_k_other, sizeof(__pyx_k_other), 0, 0, 1, 1}, {&__pyx_n_s_peek, __pyx_k_peek, sizeof(__pyx_k_peek), 0, 0, 1, 1}, {&__pyx_n_s_poll, __pyx_k_poll, sizeof(__pyx_k_poll), 0, 0, 1, 1}, {&__pyx_n_s_pop, __pyx_k_pop, sizeof(__pyx_k_pop), 0, 0, 1, 1}, {&__pyx_n_s_pos, __pyx_k_pos, sizeof(__pyx_k_pos), 0, 0, 1, 1}, {&__pyx_n_s_post, __pyx_k_post, sizeof(__pyx_k_post), 0, 0, 1, 1}, {&__pyx_n_s_prepare, __pyx_k_prepare, sizeof(__pyx_k_prepare), 0, 0, 1, 1}, {&__pyx_n_s_pressure, __pyx_k_pressure, sizeof(__pyx_k_pressure), 0, 0, 1, 1}, {&__pyx_n_s_property, __pyx_k_property, sizeof(__pyx_k_property), 0, 0, 1, 1}, {&__pyx_n_s_pump, __pyx_k_pump, sizeof(__pyx_k_pump), 0, 0, 1, 1}, {&__pyx_n_s_pygame_sdl2, __pyx_k_pygame_sdl2, sizeof(__pyx_k_pygame_sdl2), 0, 0, 1, 1}, {&__pyx_n_s_pygame_sdl2_event, __pyx_k_pygame_sdl2_event, sizeof(__pyx_k_pygame_sdl2_event), 0, 0, 1, 1}, {&__pyx_n_s_pyx_vtable, __pyx_k_pyx_vtable, sizeof(__pyx_k_pyx_vtable), 0, 0, 1, 1}, {&__pyx_n_s_qualname, __pyx_k_qualname, sizeof(__pyx_k_qualname), 0, 0, 1, 1}, {&__pyx_n_s_register, __pyx_k_register, sizeof(__pyx_k_register), 0, 0, 1, 1}, {&__pyx_n_s_rel, __pyx_k_rel, sizeof(__pyx_k_rel), 0, 0, 1, 1}, {&__pyx_n_s_repeat, __pyx_k_repeat, sizeof(__pyx_k_repeat), 0, 0, 1, 1}, {&__pyx_n_s_repr, __pyx_k_repr, sizeof(__pyx_k_repr), 0, 0, 1, 1}, {&__pyx_n_s_result, __pyx_k_result, sizeof(__pyx_k_result), 0, 0, 1, 1}, {&__pyx_n_s_rv, __pyx_k_rv, sizeof(__pyx_k_rv), 0, 0, 1, 1}, {&__pyx_n_s_scancode, __pyx_k_scancode, sizeof(__pyx_k_scancode), 0, 0, 1, 1}, {&__pyx_n_s_sdl_main_init, __pyx_k_sdl_main_init, sizeof(__pyx_k_sdl_main_init), 0, 0, 1, 1}, {&__pyx_n_s_self, __pyx_k_self, sizeof(__pyx_k_self), 0, 0, 1, 1}, {&__pyx_n_s_set_allowed, __pyx_k_set_allowed, sizeof(__pyx_k_set_allowed), 0, 0, 1, 1}, {&__pyx_n_s_set_blocked, __pyx_k_set_blocked, sizeof(__pyx_k_set_blocked), 0, 0, 1, 1}, {&__pyx_n_s_set_grab, __pyx_k_set_grab, sizeof(__pyx_k_set_grab), 0, 0, 1, 1}, {&__pyx_n_s_set_mousewheel_buttons, __pyx_k_set_mousewheel_buttons, sizeof(__pyx_k_set_mousewheel_buttons), 0, 0, 1, 1}, {&__pyx_n_s_size, __pyx_k_size, sizeof(__pyx_k_size), 0, 0, 1, 1}, {&__pyx_n_s_start, __pyx_k_start, sizeof(__pyx_k_start), 0, 0, 1, 1}, {&__pyx_n_s_state, __pyx_k_state, sizeof(__pyx_k_state), 0, 0, 1, 1}, {&__pyx_n_s_sys, __pyx_k_sys, sizeof(__pyx_k_sys), 0, 0, 1, 1}, {&__pyx_n_s_t, __pyx_k_t, sizeof(__pyx_k_t), 0, 0, 1, 1}, {&__pyx_n_s_test, __pyx_k_test, sizeof(__pyx_k_test), 0, 0, 1, 1}, {&__pyx_n_s_text, __pyx_k_text, sizeof(__pyx_k_text), 0, 0, 1, 1}, {&__pyx_n_s_text_input, __pyx_k_text_input, sizeof(__pyx_k_text_input), 0, 0, 1, 1}, {&__pyx_n_s_threading, __pyx_k_threading, sizeof(__pyx_k_threading), 0, 0, 1, 1}, {&__pyx_n_s_touchId, __pyx_k_touchId, sizeof(__pyx_k_touchId), 0, 0, 1, 1}, {&__pyx_n_s_type, __pyx_k_type, sizeof(__pyx_k_type), 0, 0, 1, 1}, {&__pyx_n_s_type_2, __pyx_k_type_2, sizeof(__pyx_k_type_2), 0, 0, 1, 1}, {&__pyx_n_s_unichr, __pyx_k_unichr, sizeof(__pyx_k_unichr), 0, 0, 1, 1}, {&__pyx_n_s_unicode, __pyx_k_unicode, sizeof(__pyx_k_unicode), 0, 0, 1, 1}, {&__pyx_n_s_update, __pyx_k_update, sizeof(__pyx_k_update), 0, 0, 1, 1}, {&__pyx_n_s_value, __pyx_k_value, sizeof(__pyx_k_value), 0, 0, 1, 1}, {&__pyx_n_s_version_info, __pyx_k_version_info, sizeof(__pyx_k_version_info), 0, 0, 1, 1}, {&__pyx_n_s_w, __pyx_k_w, sizeof(__pyx_k_w), 0, 0, 1, 1}, {&__pyx_n_s_wait, __pyx_k_wait, sizeof(__pyx_k_wait), 0, 0, 1, 1}, {&__pyx_n_s_which, __pyx_k_which, sizeof(__pyx_k_which), 0, 0, 1, 1}, {&__pyx_n_s_x, __pyx_k_x, sizeof(__pyx_k_x), 0, 0, 1, 1}, {&__pyx_n_s_y, __pyx_k_y, sizeof(__pyx_k_y), 0, 0, 1, 1}, {0, 0, 0, 0, 0, 0, 0} }; static int __Pyx_InitCachedBuiltins(void) { __pyx_builtin_chr = __Pyx_GetBuiltinName(__pyx_n_s_chr); if (!__pyx_builtin_chr) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 29; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_builtin_object = __Pyx_GetBuiltinName(__pyx_n_s_object); if (!__pyx_builtin_object) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 55; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_builtin_property = __Pyx_GetBuiltinName(__pyx_n_s_property); if (!__pyx_builtin_property) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 78; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_builtin_KeyError = __Pyx_GetBuiltinName(__pyx_n_s_KeyError); if (!__pyx_builtin_KeyError) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 71; __pyx_clineno = __LINE__; goto __pyx_L1_error;} return 0; __pyx_L1_error:; return -1; } static int __Pyx_InitCachedConstants(void) { __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__Pyx_InitCachedConstants", 0); /* "pygame_sdl2/event.pyx":162 * btn = 5 * else: * return EventType(0) # x axis scrolling produces no event in pygame # <<<<<<<<<<<<<< * * # This is not the mouse position at the time of the event */ __pyx_tuple__2 = PyTuple_Pack(1, __pyx_int_0); if (unlikely(!__pyx_tuple__2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 162; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_tuple__2); __Pyx_GIVEREF(__pyx_tuple__2); /* "pygame_sdl2/event.pyx":326 * cdef SDL_Event evt * * with lock: # <<<<<<<<<<<<<< * while SDL_PollEvent(&evt): * event_queue.append(make_event(&evt)) */ __pyx_tuple__3 = PyTuple_Pack(3, Py_None, Py_None, Py_None); if (unlikely(!__pyx_tuple__3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 326; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_tuple__3); __Pyx_GIVEREF(__pyx_tuple__3); /* "pygame_sdl2/event.pyx":334 * * def pump(): * with lock: # <<<<<<<<<<<<<< * poll_sdl() * */ __pyx_tuple__4 = PyTuple_Pack(3, Py_None, Py_None, Py_None); if (unlikely(!__pyx_tuple__4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 334; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_tuple__4); __Pyx_GIVEREF(__pyx_tuple__4); /* "pygame_sdl2/event.pyx":342 * global event_queue * * with lock: # <<<<<<<<<<<<<< * poll_sdl() * */ __pyx_tuple__5 = PyTuple_Pack(3, Py_None, Py_None, Py_None); if (unlikely(!__pyx_tuple__5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 342; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_tuple__5); __Pyx_GIVEREF(__pyx_tuple__5); /* "pygame_sdl2/event.pyx":360 * def poll(): * * with lock: # <<<<<<<<<<<<<< * poll_sdl() * */ __pyx_tuple__6 = PyTuple_Pack(3, Py_None, Py_None, Py_None); if (unlikely(!__pyx_tuple__6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 360; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_tuple__6); __Pyx_GIVEREF(__pyx_tuple__6); __pyx_tuple__7 = PyTuple_Pack(3, Py_None, Py_None, Py_None); if (unlikely(!__pyx_tuple__7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 360; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_tuple__7); __Pyx_GIVEREF(__pyx_tuple__7); /* "pygame_sdl2/event.pyx":374 * cdef int result * * with lock: # <<<<<<<<<<<<<< * poll_sdl() * */ __pyx_tuple__8 = PyTuple_Pack(3, Py_None, Py_None, Py_None); if (unlikely(!__pyx_tuple__8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 374; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_tuple__8); __Pyx_GIVEREF(__pyx_tuple__8); __pyx_tuple__9 = PyTuple_Pack(3, Py_None, Py_None, Py_None); if (unlikely(!__pyx_tuple__9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 374; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_tuple__9); __Pyx_GIVEREF(__pyx_tuple__9); /* "pygame_sdl2/event.pyx":391 * def peek(t=None): * * with lock: # <<<<<<<<<<<<<< * poll_sdl() * */ __pyx_tuple__10 = PyTuple_Pack(3, Py_None, Py_None, Py_None); if (unlikely(!__pyx_tuple__10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 391; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_tuple__10); __Pyx_GIVEREF(__pyx_tuple__10); __pyx_tuple__11 = PyTuple_Pack(3, Py_None, Py_None, Py_None); if (unlikely(!__pyx_tuple__11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 391; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_tuple__11); __Pyx_GIVEREF(__pyx_tuple__11); /* "pygame_sdl2/event.pyx":476 * * if not isinstance(e, EventType): * raise pygame_sdl2.error("event.post must be called with an Event.") # <<<<<<<<<<<<<< * * if get_blocked(e.type): */ __pyx_tuple__12 = PyTuple_Pack(1, __pyx_kp_s_event_post_must_be_called_with_a); if (unlikely(!__pyx_tuple__12)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 476; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_tuple__12); __Pyx_GIVEREF(__pyx_tuple__12); /* "pygame_sdl2/event.pyx":508 * """ * * return event_queue[:] # <<<<<<<<<<<<<< * * # Usually called by display.init. */ __pyx_slice__13 = PySlice_New(Py_None, Py_None, Py_None); if (unlikely(!__pyx_slice__13)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 508; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_slice__13); __Pyx_GIVEREF(__pyx_slice__13); /* "pygame_sdl2/event.pyx":57 * class EventType(object): * * def __init__(self, type, dict=None, **kwargs): # <<<<<<<<<<<<<< * self._type = type * */ __pyx_tuple__14 = PyTuple_Pack(4, __pyx_n_s_self, __pyx_n_s_type, __pyx_n_s_dict, __pyx_n_s_kwargs); if (unlikely(!__pyx_tuple__14)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 57; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_tuple__14); __Pyx_GIVEREF(__pyx_tuple__14); __pyx_codeobj__15 = (PyObject*)__Pyx_PyCode_New(3, 0, 4, 0, CO_VARKEYWORDS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__14, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_tom_ab_pygame_sdl2_src_pyg, __pyx_n_s_init, 57, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__15)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 57; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_tuple__16 = PyTuple_Pack(1, ((PyObject *)Py_None)); if (unlikely(!__pyx_tuple__16)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 57; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_tuple__16); __Pyx_GIVEREF(__pyx_tuple__16); /* "pygame_sdl2/event.pyx":65 * self.__dict__.update(kwargs) * * def __repr__(self): # <<<<<<<<<<<<<< * if SDL_USEREVENT <= self.type < VIDEOEXPOSE: * ename = "UserEvent%d" % (self.type - SDL_USEREVENT) */ __pyx_tuple__17 = PyTuple_Pack(3, __pyx_n_s_self, __pyx_n_s_ename, __pyx_n_s_d); if (unlikely(!__pyx_tuple__17)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 65; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_tuple__17); __Pyx_GIVEREF(__pyx_tuple__17); __pyx_codeobj__18 = (PyObject*)__Pyx_PyCode_New(1, 0, 3, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__17, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_tom_ab_pygame_sdl2_src_pyg, __pyx_n_s_repr, 65, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__18)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 65; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "pygame_sdl2/event.pyx":79 * * @property * def dict(self): # <<<<<<<<<<<<<< * return self.__dict__ * */ __pyx_tuple__19 = PyTuple_Pack(1, __pyx_n_s_self); if (unlikely(!__pyx_tuple__19)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 79; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_tuple__19); __Pyx_GIVEREF(__pyx_tuple__19); __pyx_codeobj__20 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__19, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_tom_ab_pygame_sdl2_src_pyg, __pyx_n_s_dict, 79, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__20)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 79; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "pygame_sdl2/event.pyx":83 * * @property * def type(self): # <<<<<<<<<<<<<< * return self._type * */ __pyx_tuple__21 = PyTuple_Pack(1, __pyx_n_s_self); if (unlikely(!__pyx_tuple__21)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 83; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_tuple__21); __Pyx_GIVEREF(__pyx_tuple__21); __pyx_codeobj__22 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__21, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_tom_ab_pygame_sdl2_src_pyg, __pyx_n_s_type, 83, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__22)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 83; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "pygame_sdl2/event.pyx":86 * return self._type * * def __eq__(self, other): # <<<<<<<<<<<<<< * return self.__dict__ == other.__dict__ * */ __pyx_tuple__23 = PyTuple_Pack(2, __pyx_n_s_self, __pyx_n_s_other); if (unlikely(!__pyx_tuple__23)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 86; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_tuple__23); __Pyx_GIVEREF(__pyx_tuple__23); __pyx_codeobj__24 = (PyObject*)__Pyx_PyCode_New(2, 0, 2, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__23, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_tom_ab_pygame_sdl2_src_pyg, __pyx_n_s_eq, 86, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__24)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 86; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "pygame_sdl2/event.pyx":89 * return self.__dict__ == other.__dict__ * * def __ne__(self, other): # <<<<<<<<<<<<<< * return not (self == other) * */ __pyx_tuple__25 = PyTuple_Pack(2, __pyx_n_s_self, __pyx_n_s_other); if (unlikely(!__pyx_tuple__25)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 89; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_tuple__25); __Pyx_GIVEREF(__pyx_tuple__25); __pyx_codeobj__26 = (PyObject*)__Pyx_PyCode_New(2, 0, 2, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__25, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_tom_ab_pygame_sdl2_src_pyg, __pyx_n_s_ne, 89, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__26)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 89; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "pygame_sdl2/event.pyx":92 * return not (self == other) * * def __nonzero__(self): # <<<<<<<<<<<<<< * return self.type != 0 * */ __pyx_tuple__27 = PyTuple_Pack(1, __pyx_n_s_self); if (unlikely(!__pyx_tuple__27)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 92; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_tuple__27); __Pyx_GIVEREF(__pyx_tuple__27); __pyx_codeobj__28 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__27, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_tom_ab_pygame_sdl2_src_pyg, __pyx_n_s_nonzero, 92, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__28)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 92; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "pygame_sdl2/event.pyx":275 * * # This is the object that is returned when no event exists. * NOEVENT_EVENT = EventType(0) # <<<<<<<<<<<<<< * * */ __pyx_tuple__29 = PyTuple_Pack(1, __pyx_int_0); if (unlikely(!__pyx_tuple__29)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 275; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_tuple__29); __Pyx_GIVEREF(__pyx_tuple__29); /* "pygame_sdl2/event.pyx":333 * * * def pump(): # <<<<<<<<<<<<<< * with lock: * poll_sdl() */ __pyx_codeobj__30 = (PyObject*)__Pyx_PyCode_New(0, 0, 0, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_tom_ab_pygame_sdl2_src_pyg, __pyx_n_s_pump, 333, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__30)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 333; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "pygame_sdl2/event.pyx":338 * * * def get(t=None): # <<<<<<<<<<<<<< * * global event_queue */ __pyx_tuple__31 = PyTuple_Pack(2, __pyx_n_s_t, __pyx_n_s_rv); if (unlikely(!__pyx_tuple__31)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 338; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_tuple__31); __Pyx_GIVEREF(__pyx_tuple__31); __pyx_codeobj__32 = (PyObject*)__Pyx_PyCode_New(1, 0, 2, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__31, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_tom_ab_pygame_sdl2_src_pyg, __pyx_n_s_get, 338, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__32)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 338; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "pygame_sdl2/event.pyx":358 * * * def poll(): # <<<<<<<<<<<<<< * * with lock: */ __pyx_codeobj__33 = (PyObject*)__Pyx_PyCode_New(0, 0, 0, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_tom_ab_pygame_sdl2_src_pyg, __pyx_n_s_poll, 358, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__33)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 358; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "pygame_sdl2/event.pyx":369 * * * def wait(): # <<<<<<<<<<<<<< * * cdef SDL_Event evt */ __pyx_tuple__34 = PyTuple_Pack(2, __pyx_n_s_evt, __pyx_n_s_result); if (unlikely(!__pyx_tuple__34)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 369; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_tuple__34); __Pyx_GIVEREF(__pyx_tuple__34); __pyx_codeobj__35 = (PyObject*)__Pyx_PyCode_New(0, 0, 2, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__34, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_tom_ab_pygame_sdl2_src_pyg, __pyx_n_s_wait, 369, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__35)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 369; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "pygame_sdl2/event.pyx":389 * * * def peek(t=None): # <<<<<<<<<<<<<< * * with lock: */ __pyx_tuple__36 = PyTuple_Pack(1, __pyx_n_s_t); if (unlikely(!__pyx_tuple__36)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 389; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_tuple__36); __Pyx_GIVEREF(__pyx_tuple__36); __pyx_codeobj__37 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__36, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_tom_ab_pygame_sdl2_src_pyg, __pyx_n_s_peek, 389, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__37)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 389; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "pygame_sdl2/event.pyx":402 * * * def clear(t=None): # <<<<<<<<<<<<<< * * # Clear is implemented in terms of get. */ __pyx_tuple__38 = PyTuple_Pack(1, __pyx_n_s_t); if (unlikely(!__pyx_tuple__38)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 402; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_tuple__38); __Pyx_GIVEREF(__pyx_tuple__38); __pyx_codeobj__39 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__38, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_tom_ab_pygame_sdl2_src_pyg, __pyx_n_s_clear, 402, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__39)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 402; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "pygame_sdl2/event.pyx":407 * get(t) * * def get_standard_events(): # <<<<<<<<<<<<<< * """ * Returns a list of standard events that pygame_sdl2 knows about. */ __pyx_tuple__40 = PyTuple_Pack(1, __pyx_n_s_i); if (unlikely(!__pyx_tuple__40)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 407; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_tuple__40); __Pyx_GIVEREF(__pyx_tuple__40); __pyx_codeobj__41 = (PyObject*)__Pyx_PyCode_New(0, 0, 1, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__40, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_tom_ab_pygame_sdl2_src_pyg, __pyx_n_s_get_standard_events, 407, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__41)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 407; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "pygame_sdl2/event.pyx":414 * return [ i for i in event_names.keys() if (i < SDL_USEREVENT) or (i > USEREVENT_MAX) ] * * def event_name(t): # <<<<<<<<<<<<<< * try: * return event_names[t] */ __pyx_tuple__42 = PyTuple_Pack(1, __pyx_n_s_t); if (unlikely(!__pyx_tuple__42)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 414; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_tuple__42); __Pyx_GIVEREF(__pyx_tuple__42); __pyx_codeobj__43 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__42, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_tom_ab_pygame_sdl2_src_pyg, __pyx_n_s_event_name, 414, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__43)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 414; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "pygame_sdl2/event.pyx":420 * return "UNKNOWN" * * def set_blocked(t=None): # <<<<<<<<<<<<<< * if t == None: * for et in event_names.keys(): */ __pyx_tuple__44 = PyTuple_Pack(2, __pyx_n_s_t, __pyx_n_s_et); if (unlikely(!__pyx_tuple__44)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 420; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_tuple__44); __Pyx_GIVEREF(__pyx_tuple__44); __pyx_codeobj__45 = (PyObject*)__Pyx_PyCode_New(1, 0, 2, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__44, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_tom_ab_pygame_sdl2_src_pyg, __pyx_n_s_set_blocked, 420, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__45)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 420; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "pygame_sdl2/event.pyx":430 * SDL_EventState(et, SDL_IGNORE) * * def set_allowed(t=None): # <<<<<<<<<<<<<< * if t == None: * for et in event_names.keys(): */ __pyx_tuple__46 = PyTuple_Pack(2, __pyx_n_s_t, __pyx_n_s_et); if (unlikely(!__pyx_tuple__46)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 430; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_tuple__46); __Pyx_GIVEREF(__pyx_tuple__46); __pyx_codeobj__47 = (PyObject*)__Pyx_PyCode_New(1, 0, 2, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__46, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_tom_ab_pygame_sdl2_src_pyg, __pyx_n_s_set_allowed, 430, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__47)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 430; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "pygame_sdl2/event.pyx":440 * SDL_EventState(et, SDL_ENABLE) * * def get_blocked(t): # <<<<<<<<<<<<<< * return SDL_EventState(t, SDL_QUERY) == SDL_IGNORE * */ __pyx_tuple__48 = PyTuple_Pack(1, __pyx_n_s_t); if (unlikely(!__pyx_tuple__48)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 440; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_tuple__48); __Pyx_GIVEREF(__pyx_tuple__48); __pyx_codeobj__49 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__48, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_tom_ab_pygame_sdl2_src_pyg, __pyx_n_s_get_blocked, 440, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__49)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 440; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "pygame_sdl2/event.pyx":443 * return SDL_EventState(t, SDL_QUERY) == SDL_IGNORE * * def set_grab(on): # <<<<<<<<<<<<<< * SDL_SetWindowGrab(main_window.window, on) * */ __pyx_tuple__50 = PyTuple_Pack(1, __pyx_n_s_on); if (unlikely(!__pyx_tuple__50)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 443; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_tuple__50); __Pyx_GIVEREF(__pyx_tuple__50); __pyx_codeobj__51 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__50, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_tom_ab_pygame_sdl2_src_pyg, __pyx_n_s_set_grab, 443, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__51)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 443; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "pygame_sdl2/event.pyx":446 * SDL_SetWindowGrab(main_window.window, on) * * def get_grab(): # <<<<<<<<<<<<<< * return SDL_GetWindowGrab(main_window.window) * */ __pyx_codeobj__52 = (PyObject*)__Pyx_PyCode_New(0, 0, 0, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_tom_ab_pygame_sdl2_src_pyg, __pyx_n_s_get_grab, 446, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__52)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 446; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "pygame_sdl2/event.pyx":449 * return SDL_GetWindowGrab(main_window.window) * * def set_mousewheel_buttons(flag): # <<<<<<<<<<<<<< * """ * If true (the default), the mousewheel will generate events involving */ __pyx_tuple__53 = PyTuple_Pack(1, __pyx_n_s_flag); if (unlikely(!__pyx_tuple__53)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 449; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_tuple__53); __Pyx_GIVEREF(__pyx_tuple__53); __pyx_codeobj__54 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__53, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_tom_ab_pygame_sdl2_src_pyg, __pyx_n_s_set_mousewheel_buttons, 449, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__54)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 449; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "pygame_sdl2/event.pyx":461 * mousewheel_buttons = flag * * def get_mousewheel_buttons(): # <<<<<<<<<<<<<< * """ * Returns the value set by mousehweel buttons,. */ __pyx_codeobj__55 = (PyObject*)__Pyx_PyCode_New(0, 0, 0, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_tom_ab_pygame_sdl2_src_pyg, __pyx_n_s_get_mousewheel_buttons, 461, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__55)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 461; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "pygame_sdl2/event.pyx":468 * return mousewheel_buttons * * def post(e): # <<<<<<<<<<<<<< * """ * Posts event object `e` to the event queue. */ __pyx_tuple__56 = PyTuple_Pack(2, __pyx_n_s_e, __pyx_n_s_event); if (unlikely(!__pyx_tuple__56)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 468; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_tuple__56); __Pyx_GIVEREF(__pyx_tuple__56); __pyx_codeobj__57 = (PyObject*)__Pyx_PyCode_New(1, 0, 2, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__56, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_tom_ab_pygame_sdl2_src_pyg, __pyx_n_s_post, 468, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__57)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 468; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "pygame_sdl2/event.pyx":488 * SDL_PushEvent(&event) * * def register(name): # <<<<<<<<<<<<<< * """ * Registers a unique event number and returns that number. */ __pyx_tuple__58 = PyTuple_Pack(2, __pyx_n_s_name, __pyx_n_s_rv); if (unlikely(!__pyx_tuple__58)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 488; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_tuple__58); __Pyx_GIVEREF(__pyx_tuple__58); __pyx_codeobj__59 = (PyObject*)__Pyx_PyCode_New(1, 0, 2, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__58, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_tom_ab_pygame_sdl2_src_pyg, __pyx_n_s_register, 488, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__59)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 488; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "pygame_sdl2/event.pyx":502 * return rv * * def copy_event_queue(): # <<<<<<<<<<<<<< * """ * Returns a copy of the event queue. The copy cannot be used for modifying */ __pyx_codeobj__60 = (PyObject*)__Pyx_PyCode_New(0, 0, 0, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_tom_ab_pygame_sdl2_src_pyg, __pyx_n_s_copy_event_queue, 502, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__60)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 502; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "pygame_sdl2/event.pyx":511 * * # Usually called by display.init. * def init(): # <<<<<<<<<<<<<< * if not SDL_WasInit(SDL_INIT_EVENTS): * */ __pyx_codeobj__61 = (PyObject*)__Pyx_PyCode_New(0, 0, 0, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_tom_ab_pygame_sdl2_src_pyg, __pyx_n_s_init_2, 511, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__61)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 511; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_RefNannyFinishContext(); return 0; __pyx_L1_error:; __Pyx_RefNannyFinishContext(); return -1; } static int __Pyx_InitGlobals(void) { if (__Pyx_InitStrings(__pyx_string_tab) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; __pyx_int_0 = PyInt_FromLong(0); if (unlikely(!__pyx_int_0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_int_1 = PyInt_FromLong(1); if (unlikely(!__pyx_int_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_int_2 = PyInt_FromLong(2); if (unlikely(!__pyx_int_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_int_3 = PyInt_FromLong(3); if (unlikely(!__pyx_int_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_int_4 = PyInt_FromLong(4); if (unlikely(!__pyx_int_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} return 0; __pyx_L1_error:; return -1; } #if PY_MAJOR_VERSION < 3 PyMODINIT_FUNC initevent(void); /*proto*/ PyMODINIT_FUNC initevent(void) #else PyMODINIT_FUNC PyInit_event(void); /*proto*/ PyMODINIT_FUNC PyInit_event(void) #endif { PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; int __pyx_t_4; PyObject *__pyx_t_5 = NULL; PyObject *__pyx_t_6 = NULL; PyObject *__pyx_t_7 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannyDeclarations #if CYTHON_REFNANNY __Pyx_RefNanny = __Pyx_RefNannyImportAPI("refnanny"); if (!__Pyx_RefNanny) { PyErr_Clear(); __Pyx_RefNanny = __Pyx_RefNannyImportAPI("Cython.Runtime.refnanny"); if (!__Pyx_RefNanny) Py_FatalError("failed to import 'refnanny' module"); } #endif __Pyx_RefNannySetupContext("PyMODINIT_FUNC PyInit_event(void)", 0); if (__Pyx_check_binary_version() < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_empty_tuple = PyTuple_New(0); if (unlikely(!__pyx_empty_tuple)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_empty_bytes = PyBytes_FromStringAndSize("", 0); if (unlikely(!__pyx_empty_bytes)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} #ifdef __Pyx_CyFunction_USED if (__pyx_CyFunction_init() < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} #endif #ifdef __Pyx_FusedFunction_USED if (__pyx_FusedFunction_init() < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} #endif #ifdef __Pyx_Coroutine_USED if (__pyx_Coroutine_init() < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} #endif #ifdef __Pyx_Generator_USED if (__pyx_Generator_init() < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} #endif #ifdef __Pyx_StopAsyncIteration_USED if (__pyx_StopAsyncIteration_init() < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} #endif /*--- Library function declarations ---*/ /*--- Threads initialization code ---*/ #if defined(__PYX_FORCE_INIT_THREADS) && __PYX_FORCE_INIT_THREADS #ifdef WITH_THREAD /* Python build with threading support? */ PyEval_InitThreads(); #endif #endif /*--- Module creation code ---*/ #if PY_MAJOR_VERSION < 3 __pyx_m = Py_InitModule4("event", __pyx_methods, 0, 0, PYTHON_API_VERSION); Py_XINCREF(__pyx_m); #else __pyx_m = PyModule_Create(&__pyx_moduledef); #endif if (unlikely(!__pyx_m)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_d = PyModule_GetDict(__pyx_m); if (unlikely(!__pyx_d)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} Py_INCREF(__pyx_d); __pyx_b = PyImport_AddModule(__Pyx_BUILTIN_MODULE_NAME); if (unlikely(!__pyx_b)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} #if CYTHON_COMPILING_IN_PYPY Py_INCREF(__pyx_b); #endif if (PyObject_SetAttrString(__pyx_m, "__builtins__", __pyx_b) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; /*--- Initialize various global constants etc. ---*/ if (__Pyx_InitGlobals() < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} #if PY_MAJOR_VERSION < 3 && (__PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT) if (__Pyx_init_sys_getdefaultencoding_params() < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} #endif if (__pyx_module_is_main_pygame_sdl2__event) { if (PyObject_SetAttrString(__pyx_m, "__name__", __pyx_n_s_main) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } #if PY_MAJOR_VERSION >= 3 { PyObject *modules = PyImport_GetModuleDict(); if (unlikely(!modules)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} if (!PyDict_GetItemString(modules, "pygame_sdl2.event")) { if (unlikely(PyDict_SetItemString(modules, "pygame_sdl2.event", __pyx_m) < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } } #endif /*--- Builtin init code ---*/ if (__Pyx_InitCachedBuiltins() < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /*--- Constants init code ---*/ if (__Pyx_InitCachedConstants() < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /*--- Global init code ---*/ event_queue = Py_None; Py_INCREF(Py_None); /*--- Variable export code ---*/ /*--- Function export code ---*/ /*--- Type init code ---*/ /*--- Type import code ---*/ __pyx_ptype_7cpython_4type_type = __Pyx_ImportType(__Pyx_BUILTIN_MODULE_NAME, "type", #if CYTHON_COMPILING_IN_PYPY sizeof(PyTypeObject), #else sizeof(PyHeapTypeObject), #endif 0); if (unlikely(!__pyx_ptype_7cpython_4type_type)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 9; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_ptype_11pygame_sdl2_7surface_Surface = __Pyx_ImportType("pygame_sdl2.surface", "Surface", sizeof(struct __pyx_obj_11pygame_sdl2_7surface_Surface), 1); if (unlikely(!__pyx_ptype_11pygame_sdl2_7surface_Surface)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 23; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_vtabptr_11pygame_sdl2_7surface_Surface = (struct __pyx_vtabstruct_11pygame_sdl2_7surface_Surface*)__Pyx_GetVtable(__pyx_ptype_11pygame_sdl2_7surface_Surface->tp_dict); if (unlikely(!__pyx_vtabptr_11pygame_sdl2_7surface_Surface)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 23; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_ptype_11pygame_sdl2_7display_Window = __Pyx_ImportType("pygame_sdl2.display", "Window", sizeof(struct __pyx_obj_11pygame_sdl2_7display_Window), 1); if (unlikely(!__pyx_ptype_11pygame_sdl2_7display_Window)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 23; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /*--- Variable import code ---*/ __pyx_t_1 = __Pyx_ImportModule("pygame_sdl2.display"); if (!__pyx_t_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} if (__Pyx_ImportVoidPtr(__pyx_t_1, "main_window", (void **)&__pyx_vp_11pygame_sdl2_7display_main_window, "struct __pyx_obj_11pygame_sdl2_7display_Window *") < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} Py_DECREF(__pyx_t_1); __pyx_t_1 = 0; /*--- Function import code ---*/ /*--- Execution code ---*/ #if defined(__Pyx_Generator_USED) || defined(__Pyx_Coroutine_USED) if (__Pyx_patch_abc() < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} #endif /* "pygame_sdl2/event.pyx":24 * from sdl2 cimport * * from pygame_sdl2.display cimport Window, main_window * import threading # <<<<<<<<<<<<<< * import pygame_sdl2 * import sys */ __pyx_t_2 = __Pyx_Import(__pyx_n_s_threading, 0, -1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 24; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_threading, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 24; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "pygame_sdl2/event.pyx":25 * from pygame_sdl2.display cimport Window, main_window * import threading * import pygame_sdl2 # <<<<<<<<<<<<<< * import sys * */ __pyx_t_2 = __Pyx_Import(__pyx_n_s_pygame_sdl2, 0, -1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 25; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_pygame_sdl2, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 25; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "pygame_sdl2/event.pyx":26 * import threading * import pygame_sdl2 * import sys # <<<<<<<<<<<<<< * * if sys.version_info[0] >= 3: */ __pyx_t_2 = __Pyx_Import(__pyx_n_s_sys, 0, -1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 26; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_sys, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 26; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "pygame_sdl2/event.pyx":28 * import sys * * if sys.version_info[0] >= 3: # <<<<<<<<<<<<<< * unichr = chr * */ __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_sys); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 28; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_version_info); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 28; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_2 = __Pyx_GetItemInt(__pyx_t_3, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(__pyx_t_2 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 28; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_3 = PyObject_RichCompare(__pyx_t_2, __pyx_int_3, Py_GE); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 28; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_4 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 28; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; if (__pyx_t_4) { /* "pygame_sdl2/event.pyx":29 * * if sys.version_info[0] >= 3: * unichr = chr # <<<<<<<<<<<<<< * * include "event_names.pxi" */ if (PyDict_SetItem(__pyx_d, __pyx_n_s_unichr, __pyx_builtin_chr) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 29; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "pygame_sdl2/event.pyx":28 * import sys * * if sys.version_info[0] >= 3: # <<<<<<<<<<<<<< * unichr = chr * */ } /* "include/event_names.pxi":5 * * event_names = { * SDL_FIRSTEVENT : u'NOEVENT', # <<<<<<<<<<<<<< * SDL_QUIT : 'QUIT', * SDL_APP_TERMINATING : 'APP_TERMINATING', */ __pyx_t_3 = PyDict_New(); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 5; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __pyx_t_2 = __Pyx_PyInt_From_SDL_EventType(SDL_FIRSTEVENT); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 5; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_t_3, __pyx_t_2, __pyx_n_u_NOEVENT) < 0) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 5; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "include/event_names.pxi":6 * event_names = { * SDL_FIRSTEVENT : u'NOEVENT', * SDL_QUIT : 'QUIT', # <<<<<<<<<<<<<< * SDL_APP_TERMINATING : 'APP_TERMINATING', * SDL_APP_LOWMEMORY : 'APP_LOWMEMORY', */ __pyx_t_2 = __Pyx_PyInt_From_SDL_EventType(SDL_QUIT); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 6; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_t_3, __pyx_t_2, __pyx_n_s_QUIT) < 0) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 5; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "include/event_names.pxi":7 * SDL_FIRSTEVENT : u'NOEVENT', * SDL_QUIT : 'QUIT', * SDL_APP_TERMINATING : 'APP_TERMINATING', # <<<<<<<<<<<<<< * SDL_APP_LOWMEMORY : 'APP_LOWMEMORY', * SDL_APP_WILLENTERBACKGROUND : 'APP_WILLENTERBACKGROUND', */ __pyx_t_2 = __Pyx_PyInt_From_SDL_EventType(SDL_APP_TERMINATING); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 7; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_t_3, __pyx_t_2, __pyx_n_s_APP_TERMINATING) < 0) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 5; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "include/event_names.pxi":8 * SDL_QUIT : 'QUIT', * SDL_APP_TERMINATING : 'APP_TERMINATING', * SDL_APP_LOWMEMORY : 'APP_LOWMEMORY', # <<<<<<<<<<<<<< * SDL_APP_WILLENTERBACKGROUND : 'APP_WILLENTERBACKGROUND', * SDL_APP_DIDENTERBACKGROUND : 'APP_DIDENTERBACKGROUND', */ __pyx_t_2 = __Pyx_PyInt_From_SDL_EventType(SDL_APP_LOWMEMORY); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 8; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_t_3, __pyx_t_2, __pyx_n_s_APP_LOWMEMORY) < 0) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 5; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "include/event_names.pxi":9 * SDL_APP_TERMINATING : 'APP_TERMINATING', * SDL_APP_LOWMEMORY : 'APP_LOWMEMORY', * SDL_APP_WILLENTERBACKGROUND : 'APP_WILLENTERBACKGROUND', # <<<<<<<<<<<<<< * SDL_APP_DIDENTERBACKGROUND : 'APP_DIDENTERBACKGROUND', * SDL_APP_WILLENTERFOREGROUND : 'APP_WILLENTERFOREGROUND', */ __pyx_t_2 = __Pyx_PyInt_From_SDL_EventType(SDL_APP_WILLENTERBACKGROUND); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 9; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_t_3, __pyx_t_2, __pyx_n_s_APP_WILLENTERBACKGROUND) < 0) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 5; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "include/event_names.pxi":10 * SDL_APP_LOWMEMORY : 'APP_LOWMEMORY', * SDL_APP_WILLENTERBACKGROUND : 'APP_WILLENTERBACKGROUND', * SDL_APP_DIDENTERBACKGROUND : 'APP_DIDENTERBACKGROUND', # <<<<<<<<<<<<<< * SDL_APP_WILLENTERFOREGROUND : 'APP_WILLENTERFOREGROUND', * SDL_APP_DIDENTERFOREGROUND : 'APP_DIDENTERFOREGROUND', */ __pyx_t_2 = __Pyx_PyInt_From_SDL_EventType(SDL_APP_DIDENTERBACKGROUND); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 10; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_t_3, __pyx_t_2, __pyx_n_s_APP_DIDENTERBACKGROUND) < 0) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 5; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "include/event_names.pxi":11 * SDL_APP_WILLENTERBACKGROUND : 'APP_WILLENTERBACKGROUND', * SDL_APP_DIDENTERBACKGROUND : 'APP_DIDENTERBACKGROUND', * SDL_APP_WILLENTERFOREGROUND : 'APP_WILLENTERFOREGROUND', # <<<<<<<<<<<<<< * SDL_APP_DIDENTERFOREGROUND : 'APP_DIDENTERFOREGROUND', * SDL_WINDOWEVENT : 'WINDOWEVENT', */ __pyx_t_2 = __Pyx_PyInt_From_SDL_EventType(SDL_APP_WILLENTERFOREGROUND); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 11; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_t_3, __pyx_t_2, __pyx_n_s_APP_WILLENTERFOREGROUND) < 0) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 5; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "include/event_names.pxi":12 * SDL_APP_DIDENTERBACKGROUND : 'APP_DIDENTERBACKGROUND', * SDL_APP_WILLENTERFOREGROUND : 'APP_WILLENTERFOREGROUND', * SDL_APP_DIDENTERFOREGROUND : 'APP_DIDENTERFOREGROUND', # <<<<<<<<<<<<<< * SDL_WINDOWEVENT : 'WINDOWEVENT', * SDL_SYSWMEVENT : 'SYSWMEVENT', */ __pyx_t_2 = __Pyx_PyInt_From_SDL_EventType(SDL_APP_DIDENTERFOREGROUND); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 12; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_t_3, __pyx_t_2, __pyx_n_s_APP_DIDENTERFOREGROUND) < 0) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 5; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "include/event_names.pxi":13 * SDL_APP_WILLENTERFOREGROUND : 'APP_WILLENTERFOREGROUND', * SDL_APP_DIDENTERFOREGROUND : 'APP_DIDENTERFOREGROUND', * SDL_WINDOWEVENT : 'WINDOWEVENT', # <<<<<<<<<<<<<< * SDL_SYSWMEVENT : 'SYSWMEVENT', * SDL_KEYDOWN : 'KEYDOWN', */ __pyx_t_2 = __Pyx_PyInt_From_SDL_EventType(SDL_WINDOWEVENT); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 13; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_t_3, __pyx_t_2, __pyx_n_s_WINDOWEVENT) < 0) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 5; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "include/event_names.pxi":14 * SDL_APP_DIDENTERFOREGROUND : 'APP_DIDENTERFOREGROUND', * SDL_WINDOWEVENT : 'WINDOWEVENT', * SDL_SYSWMEVENT : 'SYSWMEVENT', # <<<<<<<<<<<<<< * SDL_KEYDOWN : 'KEYDOWN', * SDL_KEYUP : 'KEYUP', */ __pyx_t_2 = __Pyx_PyInt_From_SDL_EventType(SDL_SYSWMEVENT); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 14; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_t_3, __pyx_t_2, __pyx_n_s_SYSWMEVENT) < 0) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 5; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "include/event_names.pxi":15 * SDL_WINDOWEVENT : 'WINDOWEVENT', * SDL_SYSWMEVENT : 'SYSWMEVENT', * SDL_KEYDOWN : 'KEYDOWN', # <<<<<<<<<<<<<< * SDL_KEYUP : 'KEYUP', * SDL_TEXTEDITING : 'TEXTEDITING', */ __pyx_t_2 = __Pyx_PyInt_From_SDL_EventType(SDL_KEYDOWN); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 15; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_t_3, __pyx_t_2, __pyx_n_s_KEYDOWN) < 0) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 5; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "include/event_names.pxi":16 * SDL_SYSWMEVENT : 'SYSWMEVENT', * SDL_KEYDOWN : 'KEYDOWN', * SDL_KEYUP : 'KEYUP', # <<<<<<<<<<<<<< * SDL_TEXTEDITING : 'TEXTEDITING', * SDL_TEXTINPUT : 'TEXTINPUT', */ __pyx_t_2 = __Pyx_PyInt_From_SDL_EventType(SDL_KEYUP); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 16; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_t_3, __pyx_t_2, __pyx_n_s_KEYUP) < 0) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 5; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "include/event_names.pxi":17 * SDL_KEYDOWN : 'KEYDOWN', * SDL_KEYUP : 'KEYUP', * SDL_TEXTEDITING : 'TEXTEDITING', # <<<<<<<<<<<<<< * SDL_TEXTINPUT : 'TEXTINPUT', * SDL_MOUSEMOTION : 'MOUSEMOTION', */ __pyx_t_2 = __Pyx_PyInt_From_SDL_EventType(SDL_TEXTEDITING); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 17; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_t_3, __pyx_t_2, __pyx_n_s_TEXTEDITING) < 0) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 5; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "include/event_names.pxi":18 * SDL_KEYUP : 'KEYUP', * SDL_TEXTEDITING : 'TEXTEDITING', * SDL_TEXTINPUT : 'TEXTINPUT', # <<<<<<<<<<<<<< * SDL_MOUSEMOTION : 'MOUSEMOTION', * SDL_MOUSEBUTTONDOWN : 'MOUSEBUTTONDOWN', */ __pyx_t_2 = __Pyx_PyInt_From_SDL_EventType(SDL_TEXTINPUT); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 18; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_t_3, __pyx_t_2, __pyx_n_s_TEXTINPUT) < 0) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 5; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "include/event_names.pxi":19 * SDL_TEXTEDITING : 'TEXTEDITING', * SDL_TEXTINPUT : 'TEXTINPUT', * SDL_MOUSEMOTION : 'MOUSEMOTION', # <<<<<<<<<<<<<< * SDL_MOUSEBUTTONDOWN : 'MOUSEBUTTONDOWN', * SDL_MOUSEBUTTONUP : 'MOUSEBUTTONUP', */ __pyx_t_2 = __Pyx_PyInt_From_SDL_EventType(SDL_MOUSEMOTION); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 19; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_t_3, __pyx_t_2, __pyx_n_s_MOUSEMOTION) < 0) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 5; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "include/event_names.pxi":20 * SDL_TEXTINPUT : 'TEXTINPUT', * SDL_MOUSEMOTION : 'MOUSEMOTION', * SDL_MOUSEBUTTONDOWN : 'MOUSEBUTTONDOWN', # <<<<<<<<<<<<<< * SDL_MOUSEBUTTONUP : 'MOUSEBUTTONUP', * SDL_MOUSEWHEEL : 'MOUSEWHEEL', */ __pyx_t_2 = __Pyx_PyInt_From_SDL_EventType(SDL_MOUSEBUTTONDOWN); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 20; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_t_3, __pyx_t_2, __pyx_n_s_MOUSEBUTTONDOWN) < 0) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 5; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "include/event_names.pxi":21 * SDL_MOUSEMOTION : 'MOUSEMOTION', * SDL_MOUSEBUTTONDOWN : 'MOUSEBUTTONDOWN', * SDL_MOUSEBUTTONUP : 'MOUSEBUTTONUP', # <<<<<<<<<<<<<< * SDL_MOUSEWHEEL : 'MOUSEWHEEL', * SDL_JOYAXISMOTION : 'JOYAXISMOTION', */ __pyx_t_2 = __Pyx_PyInt_From_SDL_EventType(SDL_MOUSEBUTTONUP); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 21; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_t_3, __pyx_t_2, __pyx_n_s_MOUSEBUTTONUP) < 0) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 5; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "include/event_names.pxi":22 * SDL_MOUSEBUTTONDOWN : 'MOUSEBUTTONDOWN', * SDL_MOUSEBUTTONUP : 'MOUSEBUTTONUP', * SDL_MOUSEWHEEL : 'MOUSEWHEEL', # <<<<<<<<<<<<<< * SDL_JOYAXISMOTION : 'JOYAXISMOTION', * SDL_JOYBALLMOTION : 'JOYBALLMOTION', */ __pyx_t_2 = __Pyx_PyInt_From_SDL_EventType(SDL_MOUSEWHEEL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 22; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_t_3, __pyx_t_2, __pyx_n_s_MOUSEWHEEL) < 0) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 5; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "include/event_names.pxi":23 * SDL_MOUSEBUTTONUP : 'MOUSEBUTTONUP', * SDL_MOUSEWHEEL : 'MOUSEWHEEL', * SDL_JOYAXISMOTION : 'JOYAXISMOTION', # <<<<<<<<<<<<<< * SDL_JOYBALLMOTION : 'JOYBALLMOTION', * SDL_JOYHATMOTION : 'JOYHATMOTION', */ __pyx_t_2 = __Pyx_PyInt_From_SDL_EventType(SDL_JOYAXISMOTION); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 23; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_t_3, __pyx_t_2, __pyx_n_s_JOYAXISMOTION) < 0) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 5; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "include/event_names.pxi":24 * SDL_MOUSEWHEEL : 'MOUSEWHEEL', * SDL_JOYAXISMOTION : 'JOYAXISMOTION', * SDL_JOYBALLMOTION : 'JOYBALLMOTION', # <<<<<<<<<<<<<< * SDL_JOYHATMOTION : 'JOYHATMOTION', * SDL_JOYBUTTONDOWN : 'JOYBUTTONDOWN', */ __pyx_t_2 = __Pyx_PyInt_From_SDL_EventType(SDL_JOYBALLMOTION); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 24; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_t_3, __pyx_t_2, __pyx_n_s_JOYBALLMOTION) < 0) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 5; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "include/event_names.pxi":25 * SDL_JOYAXISMOTION : 'JOYAXISMOTION', * SDL_JOYBALLMOTION : 'JOYBALLMOTION', * SDL_JOYHATMOTION : 'JOYHATMOTION', # <<<<<<<<<<<<<< * SDL_JOYBUTTONDOWN : 'JOYBUTTONDOWN', * SDL_JOYBUTTONUP : 'JOYBUTTONUP', */ __pyx_t_2 = __Pyx_PyInt_From_SDL_EventType(SDL_JOYHATMOTION); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 25; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_t_3, __pyx_t_2, __pyx_n_s_JOYHATMOTION) < 0) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 5; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "include/event_names.pxi":26 * SDL_JOYBALLMOTION : 'JOYBALLMOTION', * SDL_JOYHATMOTION : 'JOYHATMOTION', * SDL_JOYBUTTONDOWN : 'JOYBUTTONDOWN', # <<<<<<<<<<<<<< * SDL_JOYBUTTONUP : 'JOYBUTTONUP', * SDL_JOYDEVICEADDED : 'JOYDEVICEADDED', */ __pyx_t_2 = __Pyx_PyInt_From_SDL_EventType(SDL_JOYBUTTONDOWN); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 26; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_t_3, __pyx_t_2, __pyx_n_s_JOYBUTTONDOWN) < 0) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 5; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "include/event_names.pxi":27 * SDL_JOYHATMOTION : 'JOYHATMOTION', * SDL_JOYBUTTONDOWN : 'JOYBUTTONDOWN', * SDL_JOYBUTTONUP : 'JOYBUTTONUP', # <<<<<<<<<<<<<< * SDL_JOYDEVICEADDED : 'JOYDEVICEADDED', * SDL_JOYDEVICEREMOVED : 'JOYDEVICEREMOVED', */ __pyx_t_2 = __Pyx_PyInt_From_SDL_EventType(SDL_JOYBUTTONUP); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 27; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_t_3, __pyx_t_2, __pyx_n_s_JOYBUTTONUP) < 0) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 5; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "include/event_names.pxi":28 * SDL_JOYBUTTONDOWN : 'JOYBUTTONDOWN', * SDL_JOYBUTTONUP : 'JOYBUTTONUP', * SDL_JOYDEVICEADDED : 'JOYDEVICEADDED', # <<<<<<<<<<<<<< * SDL_JOYDEVICEREMOVED : 'JOYDEVICEREMOVED', * SDL_CONTROLLERAXISMOTION : 'CONTROLLERAXISMOTION', */ __pyx_t_2 = __Pyx_PyInt_From_SDL_EventType(SDL_JOYDEVICEADDED); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 28; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_t_3, __pyx_t_2, __pyx_n_s_JOYDEVICEADDED) < 0) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 5; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "include/event_names.pxi":29 * SDL_JOYBUTTONUP : 'JOYBUTTONUP', * SDL_JOYDEVICEADDED : 'JOYDEVICEADDED', * SDL_JOYDEVICEREMOVED : 'JOYDEVICEREMOVED', # <<<<<<<<<<<<<< * SDL_CONTROLLERAXISMOTION : 'CONTROLLERAXISMOTION', * SDL_CONTROLLERBUTTONDOWN : 'CONTROLLERBUTTONDOWN', */ __pyx_t_2 = __Pyx_PyInt_From_SDL_EventType(SDL_JOYDEVICEREMOVED); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 29; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_t_3, __pyx_t_2, __pyx_n_s_JOYDEVICEREMOVED) < 0) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 5; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "include/event_names.pxi":30 * SDL_JOYDEVICEADDED : 'JOYDEVICEADDED', * SDL_JOYDEVICEREMOVED : 'JOYDEVICEREMOVED', * SDL_CONTROLLERAXISMOTION : 'CONTROLLERAXISMOTION', # <<<<<<<<<<<<<< * SDL_CONTROLLERBUTTONDOWN : 'CONTROLLERBUTTONDOWN', * SDL_CONTROLLERBUTTONUP : 'CONTROLLERBUTTONUP', */ __pyx_t_2 = __Pyx_PyInt_From_SDL_EventType(SDL_CONTROLLERAXISMOTION); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 30; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_t_3, __pyx_t_2, __pyx_n_s_CONTROLLERAXISMOTION) < 0) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 5; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "include/event_names.pxi":31 * SDL_JOYDEVICEREMOVED : 'JOYDEVICEREMOVED', * SDL_CONTROLLERAXISMOTION : 'CONTROLLERAXISMOTION', * SDL_CONTROLLERBUTTONDOWN : 'CONTROLLERBUTTONDOWN', # <<<<<<<<<<<<<< * SDL_CONTROLLERBUTTONUP : 'CONTROLLERBUTTONUP', * SDL_CONTROLLERDEVICEADDED : 'CONTROLLERDEVICEADDED', */ __pyx_t_2 = __Pyx_PyInt_From_SDL_EventType(SDL_CONTROLLERBUTTONDOWN); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 31; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_t_3, __pyx_t_2, __pyx_n_s_CONTROLLERBUTTONDOWN) < 0) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 5; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "include/event_names.pxi":32 * SDL_CONTROLLERAXISMOTION : 'CONTROLLERAXISMOTION', * SDL_CONTROLLERBUTTONDOWN : 'CONTROLLERBUTTONDOWN', * SDL_CONTROLLERBUTTONUP : 'CONTROLLERBUTTONUP', # <<<<<<<<<<<<<< * SDL_CONTROLLERDEVICEADDED : 'CONTROLLERDEVICEADDED', * SDL_CONTROLLERDEVICEREMOVED : 'CONTROLLERDEVICEREMOVED', */ __pyx_t_2 = __Pyx_PyInt_From_SDL_EventType(SDL_CONTROLLERBUTTONUP); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 32; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_t_3, __pyx_t_2, __pyx_n_s_CONTROLLERBUTTONUP) < 0) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 5; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "include/event_names.pxi":33 * SDL_CONTROLLERBUTTONDOWN : 'CONTROLLERBUTTONDOWN', * SDL_CONTROLLERBUTTONUP : 'CONTROLLERBUTTONUP', * SDL_CONTROLLERDEVICEADDED : 'CONTROLLERDEVICEADDED', # <<<<<<<<<<<<<< * SDL_CONTROLLERDEVICEREMOVED : 'CONTROLLERDEVICEREMOVED', * SDL_CONTROLLERDEVICEREMAPPED : 'CONTROLLERDEVICEREMAPPED', */ __pyx_t_2 = __Pyx_PyInt_From_SDL_EventType(SDL_CONTROLLERDEVICEADDED); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 33; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_t_3, __pyx_t_2, __pyx_n_s_CONTROLLERDEVICEADDED) < 0) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 5; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "include/event_names.pxi":34 * SDL_CONTROLLERBUTTONUP : 'CONTROLLERBUTTONUP', * SDL_CONTROLLERDEVICEADDED : 'CONTROLLERDEVICEADDED', * SDL_CONTROLLERDEVICEREMOVED : 'CONTROLLERDEVICEREMOVED', # <<<<<<<<<<<<<< * SDL_CONTROLLERDEVICEREMAPPED : 'CONTROLLERDEVICEREMAPPED', * SDL_FINGERDOWN : 'FINGERDOWN', */ __pyx_t_2 = __Pyx_PyInt_From_SDL_EventType(SDL_CONTROLLERDEVICEREMOVED); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 34; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_t_3, __pyx_t_2, __pyx_n_s_CONTROLLERDEVICEREMOVED) < 0) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 5; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "include/event_names.pxi":35 * SDL_CONTROLLERDEVICEADDED : 'CONTROLLERDEVICEADDED', * SDL_CONTROLLERDEVICEREMOVED : 'CONTROLLERDEVICEREMOVED', * SDL_CONTROLLERDEVICEREMAPPED : 'CONTROLLERDEVICEREMAPPED', # <<<<<<<<<<<<<< * SDL_FINGERDOWN : 'FINGERDOWN', * SDL_FINGERUP : 'FINGERUP', */ __pyx_t_2 = __Pyx_PyInt_From_SDL_EventType(SDL_CONTROLLERDEVICEREMAPPED); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 35; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_t_3, __pyx_t_2, __pyx_n_s_CONTROLLERDEVICEREMAPPED) < 0) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 5; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "include/event_names.pxi":36 * SDL_CONTROLLERDEVICEREMOVED : 'CONTROLLERDEVICEREMOVED', * SDL_CONTROLLERDEVICEREMAPPED : 'CONTROLLERDEVICEREMAPPED', * SDL_FINGERDOWN : 'FINGERDOWN', # <<<<<<<<<<<<<< * SDL_FINGERUP : 'FINGERUP', * SDL_FINGERMOTION : 'FINGERMOTION', */ __pyx_t_2 = __Pyx_PyInt_From_SDL_EventType(SDL_FINGERDOWN); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 36; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_t_3, __pyx_t_2, __pyx_n_s_FINGERDOWN) < 0) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 5; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "include/event_names.pxi":37 * SDL_CONTROLLERDEVICEREMAPPED : 'CONTROLLERDEVICEREMAPPED', * SDL_FINGERDOWN : 'FINGERDOWN', * SDL_FINGERUP : 'FINGERUP', # <<<<<<<<<<<<<< * SDL_FINGERMOTION : 'FINGERMOTION', * SDL_DOLLARGESTURE : 'DOLLARGESTURE', */ __pyx_t_2 = __Pyx_PyInt_From_SDL_EventType(SDL_FINGERUP); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 37; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_t_3, __pyx_t_2, __pyx_n_s_FINGERUP) < 0) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 5; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "include/event_names.pxi":38 * SDL_FINGERDOWN : 'FINGERDOWN', * SDL_FINGERUP : 'FINGERUP', * SDL_FINGERMOTION : 'FINGERMOTION', # <<<<<<<<<<<<<< * SDL_DOLLARGESTURE : 'DOLLARGESTURE', * SDL_DOLLARRECORD : 'DOLLARRECORD', */ __pyx_t_2 = __Pyx_PyInt_From_SDL_EventType(SDL_FINGERMOTION); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 38; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_t_3, __pyx_t_2, __pyx_n_s_FINGERMOTION) < 0) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 5; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "include/event_names.pxi":39 * SDL_FINGERUP : 'FINGERUP', * SDL_FINGERMOTION : 'FINGERMOTION', * SDL_DOLLARGESTURE : 'DOLLARGESTURE', # <<<<<<<<<<<<<< * SDL_DOLLARRECORD : 'DOLLARRECORD', * SDL_MULTIGESTURE : 'MULTIGESTURE', */ __pyx_t_2 = __Pyx_PyInt_From_SDL_EventType(SDL_DOLLARGESTURE); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 39; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_t_3, __pyx_t_2, __pyx_n_s_DOLLARGESTURE) < 0) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 5; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "include/event_names.pxi":40 * SDL_FINGERMOTION : 'FINGERMOTION', * SDL_DOLLARGESTURE : 'DOLLARGESTURE', * SDL_DOLLARRECORD : 'DOLLARRECORD', # <<<<<<<<<<<<<< * SDL_MULTIGESTURE : 'MULTIGESTURE', * SDL_CLIPBOARDUPDATE : 'CLIPBOARDUPDATE', */ __pyx_t_2 = __Pyx_PyInt_From_SDL_EventType(SDL_DOLLARRECORD); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 40; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_t_3, __pyx_t_2, __pyx_n_s_DOLLARRECORD) < 0) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 5; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "include/event_names.pxi":41 * SDL_DOLLARGESTURE : 'DOLLARGESTURE', * SDL_DOLLARRECORD : 'DOLLARRECORD', * SDL_MULTIGESTURE : 'MULTIGESTURE', # <<<<<<<<<<<<<< * SDL_CLIPBOARDUPDATE : 'CLIPBOARDUPDATE', * SDL_DROPFILE : 'DROPFILE', */ __pyx_t_2 = __Pyx_PyInt_From_SDL_EventType(SDL_MULTIGESTURE); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 41; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_t_3, __pyx_t_2, __pyx_n_s_MULTIGESTURE) < 0) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 5; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "include/event_names.pxi":42 * SDL_DOLLARRECORD : 'DOLLARRECORD', * SDL_MULTIGESTURE : 'MULTIGESTURE', * SDL_CLIPBOARDUPDATE : 'CLIPBOARDUPDATE', # <<<<<<<<<<<<<< * SDL_DROPFILE : 'DROPFILE', * SDL_RENDER_TARGETS_RESET : 'RENDER_TARGETS_RESET', */ __pyx_t_2 = __Pyx_PyInt_From_SDL_EventType(SDL_CLIPBOARDUPDATE); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 42; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_t_3, __pyx_t_2, __pyx_n_s_CLIPBOARDUPDATE) < 0) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 5; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "include/event_names.pxi":43 * SDL_MULTIGESTURE : 'MULTIGESTURE', * SDL_CLIPBOARDUPDATE : 'CLIPBOARDUPDATE', * SDL_DROPFILE : 'DROPFILE', # <<<<<<<<<<<<<< * SDL_RENDER_TARGETS_RESET : 'RENDER_TARGETS_RESET', * SDL_USEREVENT : 'USEREVENT', */ __pyx_t_2 = __Pyx_PyInt_From_SDL_EventType(SDL_DROPFILE); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 43; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_t_3, __pyx_t_2, __pyx_n_s_DROPFILE) < 0) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 5; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "include/event_names.pxi":44 * SDL_CLIPBOARDUPDATE : 'CLIPBOARDUPDATE', * SDL_DROPFILE : 'DROPFILE', * SDL_RENDER_TARGETS_RESET : 'RENDER_TARGETS_RESET', # <<<<<<<<<<<<<< * SDL_USEREVENT : 'USEREVENT', * SDL_LASTEVENT : 'LASTEVENT', */ __pyx_t_2 = __Pyx_PyInt_From_SDL_EventType(SDL_RENDER_TARGETS_RESET); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 44; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_t_3, __pyx_t_2, __pyx_n_s_RENDER_TARGETS_RESET) < 0) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 5; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "include/event_names.pxi":45 * SDL_DROPFILE : 'DROPFILE', * SDL_RENDER_TARGETS_RESET : 'RENDER_TARGETS_RESET', * SDL_USEREVENT : 'USEREVENT', # <<<<<<<<<<<<<< * SDL_LASTEVENT : 'LASTEVENT', * } */ __pyx_t_2 = __Pyx_PyInt_From_SDL_EventType(SDL_USEREVENT); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 45; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_t_3, __pyx_t_2, __pyx_n_s_USEREVENT) < 0) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 5; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "include/event_names.pxi":46 * SDL_RENDER_TARGETS_RESET : 'RENDER_TARGETS_RESET', * SDL_USEREVENT : 'USEREVENT', * SDL_LASTEVENT : 'LASTEVENT', # <<<<<<<<<<<<<< * } */ __pyx_t_2 = __Pyx_PyInt_From_SDL_EventType(SDL_LASTEVENT); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 46; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_t_3, __pyx_t_2, __pyx_n_s_LASTEVENT) < 0) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 5; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; if (PyDict_SetItem(__pyx_d, __pyx_n_s_event_names, __pyx_t_3) < 0) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 4; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "pygame_sdl2/event.pyx":34 * * # Add events to emulate SDL 1.2. These also need to be added in locals. * ACTIVEEVENT = SDL_LASTEVENT - 1 # <<<<<<<<<<<<<< * VIDEORESIZE = SDL_LASTEVENT - 2 * VIDEOEXPOSE = SDL_LASTEVENT - 3 */ __pyx_t_3 = __Pyx_PyInt_From_long((SDL_LASTEVENT - 1)); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 34; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); if (PyDict_SetItem(__pyx_d, __pyx_n_s_ACTIVEEVENT, __pyx_t_3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 34; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "pygame_sdl2/event.pyx":35 * # Add events to emulate SDL 1.2. These also need to be added in locals. * ACTIVEEVENT = SDL_LASTEVENT - 1 * VIDEORESIZE = SDL_LASTEVENT - 2 # <<<<<<<<<<<<<< * VIDEOEXPOSE = SDL_LASTEVENT - 3 * */ __pyx_t_3 = __Pyx_PyInt_From_long((SDL_LASTEVENT - 2)); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 35; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); if (PyDict_SetItem(__pyx_d, __pyx_n_s_VIDEORESIZE, __pyx_t_3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 35; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "pygame_sdl2/event.pyx":36 * ACTIVEEVENT = SDL_LASTEVENT - 1 * VIDEORESIZE = SDL_LASTEVENT - 2 * VIDEOEXPOSE = SDL_LASTEVENT - 3 # <<<<<<<<<<<<<< * * event_names[ACTIVEEVENT] = "ACTIVEEVENT" */ __pyx_t_3 = __Pyx_PyInt_From_long((SDL_LASTEVENT - 3)); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 36; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); if (PyDict_SetItem(__pyx_d, __pyx_n_s_VIDEOEXPOSE, __pyx_t_3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 36; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "pygame_sdl2/event.pyx":38 * VIDEOEXPOSE = SDL_LASTEVENT - 3 * * event_names[ACTIVEEVENT] = "ACTIVEEVENT" # <<<<<<<<<<<<<< * event_names[VIDEORESIZE] = "VIDEORESIZE" * event_names[VIDEOEXPOSE] = "VIDEOEXPOSE" */ __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_event_names); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 38; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_ACTIVEEVENT); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 38; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); if (unlikely(PyObject_SetItem(__pyx_t_3, __pyx_t_2, __pyx_n_s_ACTIVEEVENT) < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 38; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "pygame_sdl2/event.pyx":39 * * event_names[ACTIVEEVENT] = "ACTIVEEVENT" * event_names[VIDEORESIZE] = "VIDEORESIZE" # <<<<<<<<<<<<<< * event_names[VIDEOEXPOSE] = "VIDEOEXPOSE" * */ __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_event_names); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 39; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_VIDEORESIZE); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 39; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); if (unlikely(PyObject_SetItem(__pyx_t_2, __pyx_t_3, __pyx_n_s_VIDEORESIZE) < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 39; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "pygame_sdl2/event.pyx":40 * event_names[ACTIVEEVENT] = "ACTIVEEVENT" * event_names[VIDEORESIZE] = "VIDEORESIZE" * event_names[VIDEOEXPOSE] = "VIDEOEXPOSE" # <<<<<<<<<<<<<< * * # This is used for events posted to the event queue. This won't be returned */ __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_event_names); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 40; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_VIDEOEXPOSE); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 40; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); if (unlikely(PyObject_SetItem(__pyx_t_3, __pyx_t_2, __pyx_n_s_VIDEOEXPOSE) < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 40; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "pygame_sdl2/event.pyx":46 * # giving the type. * cdef int POSTEDEVENT * POSTEDEVENT = SDL_LASTEVENT - 4 # <<<<<<<<<<<<<< * * # The maximum number of a user-defined event. */ __pyx_v_11pygame_sdl2_5event_POSTEDEVENT = (SDL_LASTEVENT - 4); /* "pygame_sdl2/event.pyx":49 * * # The maximum number of a user-defined event. * USEREVENT_MAX = SDL_LASTEVENT - 5 # <<<<<<<<<<<<<< * * # If true, the mousewheel is mapped to buttons 4 and 5. Otherwise, a */ __pyx_t_2 = __Pyx_PyInt_From_long((SDL_LASTEVENT - 5)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 49; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_USEREVENT_MAX, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 49; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "pygame_sdl2/event.pyx":53 * # If true, the mousewheel is mapped to buttons 4 and 5. Otherwise, a * # MOUSEWHEEL event is created. * cdef bint mousewheel_buttons = 1 # <<<<<<<<<<<<<< * * class EventType(object): */ __pyx_v_11pygame_sdl2_5event_mousewheel_buttons = 1; /* "pygame_sdl2/event.pyx":55 * cdef bint mousewheel_buttons = 1 * * class EventType(object): # <<<<<<<<<<<<<< * * def __init__(self, type, dict=None, **kwargs): */ __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 55; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __Pyx_INCREF(__pyx_builtin_object); __Pyx_GIVEREF(__pyx_builtin_object); PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_builtin_object); __pyx_t_3 = __Pyx_CalculateMetaclass(NULL, __pyx_t_2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 55; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __pyx_t_5 = __Pyx_Py3MetaclassPrepare(__pyx_t_3, __pyx_t_2, __pyx_n_s_EventType, __pyx_n_s_EventType, (PyObject *) NULL, __pyx_n_s_pygame_sdl2_event, (PyObject *) NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 55; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); /* "pygame_sdl2/event.pyx":57 * class EventType(object): * * def __init__(self, type, dict=None, **kwargs): # <<<<<<<<<<<<<< * self._type = type * */ __pyx_t_6 = __Pyx_CyFunction_NewEx(&__pyx_mdef_11pygame_sdl2_5event_9EventType_1__init__, 0, __pyx_n_s_EventType___init, NULL, __pyx_n_s_pygame_sdl2_event, __pyx_d, ((PyObject *)__pyx_codeobj__15)); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 57; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_6); __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_6, __pyx_tuple__16); if (PyObject_SetItem(__pyx_t_5, __pyx_n_s_init, __pyx_t_6) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 57; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; /* "pygame_sdl2/event.pyx":65 * self.__dict__.update(kwargs) * * def __repr__(self): # <<<<<<<<<<<<<< * if SDL_USEREVENT <= self.type < VIDEOEXPOSE: * ename = "UserEvent%d" % (self.type - SDL_USEREVENT) */ __pyx_t_6 = __Pyx_CyFunction_NewEx(&__pyx_mdef_11pygame_sdl2_5event_9EventType_3__repr__, 0, __pyx_n_s_EventType___repr, NULL, __pyx_n_s_pygame_sdl2_event, __pyx_d, ((PyObject *)__pyx_codeobj__18)); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 65; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_6); if (PyObject_SetItem(__pyx_t_5, __pyx_n_s_repr, __pyx_t_6) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 65; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; /* "pygame_sdl2/event.pyx":79 * * @property * def dict(self): # <<<<<<<<<<<<<< * return self.__dict__ * */ __pyx_t_6 = __Pyx_CyFunction_NewEx(&__pyx_mdef_11pygame_sdl2_5event_9EventType_5dict, 0, __pyx_n_s_EventType_dict, NULL, __pyx_n_s_pygame_sdl2_event, __pyx_d, ((PyObject *)__pyx_codeobj__20)); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 79; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_6); /* "pygame_sdl2/event.pyx":78 * return '' % (self.type, ename, d) * * @property # <<<<<<<<<<<<<< * def dict(self): * return self.__dict__ */ __pyx_t_7 = PyTuple_New(1); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 78; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_7); __Pyx_GIVEREF(__pyx_t_6); PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_6); __pyx_t_6 = 0; __pyx_t_6 = __Pyx_PyObject_Call(__pyx_builtin_property, __pyx_t_7, NULL); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 78; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; if (PyObject_SetItem(__pyx_t_5, __pyx_n_s_dict, __pyx_t_6) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 79; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; /* "pygame_sdl2/event.pyx":83 * * @property * def type(self): # <<<<<<<<<<<<<< * return self._type * */ __pyx_t_6 = __Pyx_CyFunction_NewEx(&__pyx_mdef_11pygame_sdl2_5event_9EventType_7type, 0, __pyx_n_s_EventType_type, NULL, __pyx_n_s_pygame_sdl2_event, __pyx_d, ((PyObject *)__pyx_codeobj__22)); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 83; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_6); /* "pygame_sdl2/event.pyx":82 * return self.__dict__ * * @property # <<<<<<<<<<<<<< * def type(self): * return self._type */ __pyx_t_7 = PyTuple_New(1); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 82; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_7); __Pyx_GIVEREF(__pyx_t_6); PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_6); __pyx_t_6 = 0; __pyx_t_6 = __Pyx_PyObject_Call(__pyx_builtin_property, __pyx_t_7, NULL); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 82; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; if (PyObject_SetItem(__pyx_t_5, __pyx_n_s_type, __pyx_t_6) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 83; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; /* "pygame_sdl2/event.pyx":86 * return self._type * * def __eq__(self, other): # <<<<<<<<<<<<<< * return self.__dict__ == other.__dict__ * */ __pyx_t_6 = __Pyx_CyFunction_NewEx(&__pyx_mdef_11pygame_sdl2_5event_9EventType_9__eq__, 0, __pyx_n_s_EventType___eq, NULL, __pyx_n_s_pygame_sdl2_event, __pyx_d, ((PyObject *)__pyx_codeobj__24)); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 86; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_6); if (PyObject_SetItem(__pyx_t_5, __pyx_n_s_eq, __pyx_t_6) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 86; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; /* "pygame_sdl2/event.pyx":89 * return self.__dict__ == other.__dict__ * * def __ne__(self, other): # <<<<<<<<<<<<<< * return not (self == other) * */ __pyx_t_6 = __Pyx_CyFunction_NewEx(&__pyx_mdef_11pygame_sdl2_5event_9EventType_11__ne__, 0, __pyx_n_s_EventType___ne, NULL, __pyx_n_s_pygame_sdl2_event, __pyx_d, ((PyObject *)__pyx_codeobj__26)); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 89; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_6); if (PyObject_SetItem(__pyx_t_5, __pyx_n_s_ne, __pyx_t_6) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 89; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; /* "pygame_sdl2/event.pyx":92 * return not (self == other) * * def __nonzero__(self): # <<<<<<<<<<<<<< * return self.type != 0 * */ __pyx_t_6 = __Pyx_CyFunction_NewEx(&__pyx_mdef_11pygame_sdl2_5event_9EventType_13__nonzero__, 0, __pyx_n_s_EventType___nonzero, NULL, __pyx_n_s_pygame_sdl2_event, __pyx_d, ((PyObject *)__pyx_codeobj__28)); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 92; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_6); if (PyObject_SetItem(__pyx_t_5, __pyx_n_s_nonzero, __pyx_t_6) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 92; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; /* "pygame_sdl2/event.pyx":55 * cdef bint mousewheel_buttons = 1 * * class EventType(object): # <<<<<<<<<<<<<< * * def __init__(self, type, dict=None, **kwargs): */ __pyx_t_6 = __Pyx_Py3ClassCreate(__pyx_t_3, __pyx_n_s_EventType, __pyx_t_2, __pyx_t_5, NULL, 0, 1); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 55; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_6); if (PyDict_SetItem(__pyx_d, __pyx_n_s_EventType, __pyx_t_6) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 55; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "pygame_sdl2/event.pyx":95 * return self.type != 0 * * Event = EventType # <<<<<<<<<<<<<< * * cdef get_textinput(): */ __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_EventType); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 95; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_Event, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 95; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "pygame_sdl2/event.pyx":269 * * # The event queue - a list of pending events from oldest to newest. * cdef public event_queue = list() # <<<<<<<<<<<<<< * * # The lock that protects the event queue. */ __pyx_t_2 = PyList_New(0); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 269; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __Pyx_XGOTREF(event_queue); __Pyx_DECREF_SET(event_queue, __pyx_t_2); __Pyx_GIVEREF(__pyx_t_2); __pyx_t_2 = 0; /* "pygame_sdl2/event.pyx":272 * * # The lock that protects the event queue. * lock = threading.RLock() # <<<<<<<<<<<<<< * * # This is the object that is returned when no event exists. */ __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_threading); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 272; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_RLock); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 272; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_3 = NULL; if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_5))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_5); if (likely(__pyx_t_3)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_5, function); } } if (__pyx_t_3) { __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_t_3); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 272; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } else { __pyx_t_2 = __Pyx_PyObject_CallNoArg(__pyx_t_5); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 272; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; if (PyDict_SetItem(__pyx_d, __pyx_n_s_lock, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 272; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "pygame_sdl2/event.pyx":275 * * # This is the object that is returned when no event exists. * NOEVENT_EVENT = EventType(0) # <<<<<<<<<<<<<< * * */ __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_EventType); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 275; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_tuple__29, NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 275; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; if (PyDict_SetItem(__pyx_d, __pyx_n_s_NOEVENT_EVENT, __pyx_t_5) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 275; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; /* "pygame_sdl2/event.pyx":333 * * * def pump(): # <<<<<<<<<<<<<< * with lock: * poll_sdl() */ __pyx_t_5 = PyCFunction_NewEx(&__pyx_mdef_11pygame_sdl2_5event_1pump, NULL, __pyx_n_s_pygame_sdl2_event); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 333; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); if (PyDict_SetItem(__pyx_d, __pyx_n_s_pump, __pyx_t_5) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 333; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; /* "pygame_sdl2/event.pyx":338 * * * def get(t=None): # <<<<<<<<<<<<<< * * global event_queue */ __pyx_t_5 = PyCFunction_NewEx(&__pyx_mdef_11pygame_sdl2_5event_3get, NULL, __pyx_n_s_pygame_sdl2_event); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 338; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); if (PyDict_SetItem(__pyx_d, __pyx_n_s_get, __pyx_t_5) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 338; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; /* "pygame_sdl2/event.pyx":358 * * * def poll(): # <<<<<<<<<<<<<< * * with lock: */ __pyx_t_5 = PyCFunction_NewEx(&__pyx_mdef_11pygame_sdl2_5event_5poll, NULL, __pyx_n_s_pygame_sdl2_event); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 358; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); if (PyDict_SetItem(__pyx_d, __pyx_n_s_poll, __pyx_t_5) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 358; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; /* "pygame_sdl2/event.pyx":369 * * * def wait(): # <<<<<<<<<<<<<< * * cdef SDL_Event evt */ __pyx_t_5 = PyCFunction_NewEx(&__pyx_mdef_11pygame_sdl2_5event_7wait, NULL, __pyx_n_s_pygame_sdl2_event); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 369; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); if (PyDict_SetItem(__pyx_d, __pyx_n_s_wait, __pyx_t_5) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 369; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; /* "pygame_sdl2/event.pyx":389 * * * def peek(t=None): # <<<<<<<<<<<<<< * * with lock: */ __pyx_t_5 = PyCFunction_NewEx(&__pyx_mdef_11pygame_sdl2_5event_9peek, NULL, __pyx_n_s_pygame_sdl2_event); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 389; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); if (PyDict_SetItem(__pyx_d, __pyx_n_s_peek, __pyx_t_5) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 389; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; /* "pygame_sdl2/event.pyx":402 * * * def clear(t=None): # <<<<<<<<<<<<<< * * # Clear is implemented in terms of get. */ __pyx_t_5 = PyCFunction_NewEx(&__pyx_mdef_11pygame_sdl2_5event_11clear, NULL, __pyx_n_s_pygame_sdl2_event); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 402; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); if (PyDict_SetItem(__pyx_d, __pyx_n_s_clear, __pyx_t_5) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 402; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; /* "pygame_sdl2/event.pyx":407 * get(t) * * def get_standard_events(): # <<<<<<<<<<<<<< * """ * Returns a list of standard events that pygame_sdl2 knows about. */ __pyx_t_5 = PyCFunction_NewEx(&__pyx_mdef_11pygame_sdl2_5event_13get_standard_events, NULL, __pyx_n_s_pygame_sdl2_event); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 407; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); if (PyDict_SetItem(__pyx_d, __pyx_n_s_get_standard_events, __pyx_t_5) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 407; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; /* "pygame_sdl2/event.pyx":414 * return [ i for i in event_names.keys() if (i < SDL_USEREVENT) or (i > USEREVENT_MAX) ] * * def event_name(t): # <<<<<<<<<<<<<< * try: * return event_names[t] */ __pyx_t_5 = PyCFunction_NewEx(&__pyx_mdef_11pygame_sdl2_5event_15event_name, NULL, __pyx_n_s_pygame_sdl2_event); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 414; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); if (PyDict_SetItem(__pyx_d, __pyx_n_s_event_name, __pyx_t_5) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 414; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; /* "pygame_sdl2/event.pyx":420 * return "UNKNOWN" * * def set_blocked(t=None): # <<<<<<<<<<<<<< * if t == None: * for et in event_names.keys(): */ __pyx_t_5 = PyCFunction_NewEx(&__pyx_mdef_11pygame_sdl2_5event_17set_blocked, NULL, __pyx_n_s_pygame_sdl2_event); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 420; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); if (PyDict_SetItem(__pyx_d, __pyx_n_s_set_blocked, __pyx_t_5) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 420; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; /* "pygame_sdl2/event.pyx":430 * SDL_EventState(et, SDL_IGNORE) * * def set_allowed(t=None): # <<<<<<<<<<<<<< * if t == None: * for et in event_names.keys(): */ __pyx_t_5 = PyCFunction_NewEx(&__pyx_mdef_11pygame_sdl2_5event_19set_allowed, NULL, __pyx_n_s_pygame_sdl2_event); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 430; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); if (PyDict_SetItem(__pyx_d, __pyx_n_s_set_allowed, __pyx_t_5) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 430; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; /* "pygame_sdl2/event.pyx":440 * SDL_EventState(et, SDL_ENABLE) * * def get_blocked(t): # <<<<<<<<<<<<<< * return SDL_EventState(t, SDL_QUERY) == SDL_IGNORE * */ __pyx_t_5 = PyCFunction_NewEx(&__pyx_mdef_11pygame_sdl2_5event_21get_blocked, NULL, __pyx_n_s_pygame_sdl2_event); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 440; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); if (PyDict_SetItem(__pyx_d, __pyx_n_s_get_blocked, __pyx_t_5) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 440; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; /* "pygame_sdl2/event.pyx":443 * return SDL_EventState(t, SDL_QUERY) == SDL_IGNORE * * def set_grab(on): # <<<<<<<<<<<<<< * SDL_SetWindowGrab(main_window.window, on) * */ __pyx_t_5 = PyCFunction_NewEx(&__pyx_mdef_11pygame_sdl2_5event_23set_grab, NULL, __pyx_n_s_pygame_sdl2_event); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 443; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); if (PyDict_SetItem(__pyx_d, __pyx_n_s_set_grab, __pyx_t_5) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 443; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; /* "pygame_sdl2/event.pyx":446 * SDL_SetWindowGrab(main_window.window, on) * * def get_grab(): # <<<<<<<<<<<<<< * return SDL_GetWindowGrab(main_window.window) * */ __pyx_t_5 = PyCFunction_NewEx(&__pyx_mdef_11pygame_sdl2_5event_25get_grab, NULL, __pyx_n_s_pygame_sdl2_event); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 446; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); if (PyDict_SetItem(__pyx_d, __pyx_n_s_get_grab, __pyx_t_5) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 446; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; /* "pygame_sdl2/event.pyx":449 * return SDL_GetWindowGrab(main_window.window) * * def set_mousewheel_buttons(flag): # <<<<<<<<<<<<<< * """ * If true (the default), the mousewheel will generate events involving */ __pyx_t_5 = PyCFunction_NewEx(&__pyx_mdef_11pygame_sdl2_5event_27set_mousewheel_buttons, NULL, __pyx_n_s_pygame_sdl2_event); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 449; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); if (PyDict_SetItem(__pyx_d, __pyx_n_s_set_mousewheel_buttons, __pyx_t_5) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 449; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; /* "pygame_sdl2/event.pyx":461 * mousewheel_buttons = flag * * def get_mousewheel_buttons(): # <<<<<<<<<<<<<< * """ * Returns the value set by mousehweel buttons,. */ __pyx_t_5 = PyCFunction_NewEx(&__pyx_mdef_11pygame_sdl2_5event_29get_mousewheel_buttons, NULL, __pyx_n_s_pygame_sdl2_event); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 461; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); if (PyDict_SetItem(__pyx_d, __pyx_n_s_get_mousewheel_buttons, __pyx_t_5) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 461; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; /* "pygame_sdl2/event.pyx":468 * return mousewheel_buttons * * def post(e): # <<<<<<<<<<<<<< * """ * Posts event object `e` to the event queue. */ __pyx_t_5 = PyCFunction_NewEx(&__pyx_mdef_11pygame_sdl2_5event_31post, NULL, __pyx_n_s_pygame_sdl2_event); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 468; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); if (PyDict_SetItem(__pyx_d, __pyx_n_s_post, __pyx_t_5) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 468; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; /* "pygame_sdl2/event.pyx":488 * SDL_PushEvent(&event) * * def register(name): # <<<<<<<<<<<<<< * """ * Registers a unique event number and returns that number. */ __pyx_t_5 = PyCFunction_NewEx(&__pyx_mdef_11pygame_sdl2_5event_33register, NULL, __pyx_n_s_pygame_sdl2_event); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 488; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); if (PyDict_SetItem(__pyx_d, __pyx_n_s_register, __pyx_t_5) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 488; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; /* "pygame_sdl2/event.pyx":502 * return rv * * def copy_event_queue(): # <<<<<<<<<<<<<< * """ * Returns a copy of the event queue. The copy cannot be used for modifying */ __pyx_t_5 = PyCFunction_NewEx(&__pyx_mdef_11pygame_sdl2_5event_35copy_event_queue, NULL, __pyx_n_s_pygame_sdl2_event); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 502; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); if (PyDict_SetItem(__pyx_d, __pyx_n_s_copy_event_queue, __pyx_t_5) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 502; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; /* "pygame_sdl2/event.pyx":511 * * # Usually called by display.init. * def init(): # <<<<<<<<<<<<<< * if not SDL_WasInit(SDL_INIT_EVENTS): * */ __pyx_t_5 = PyCFunction_NewEx(&__pyx_mdef_11pygame_sdl2_5event_37init, NULL, __pyx_n_s_pygame_sdl2_event); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 511; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); if (PyDict_SetItem(__pyx_d, __pyx_n_s_init_2, __pyx_t_5) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 511; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; /* "pygame_sdl2/event.pyx":1 * # Copyright 2014 Patrick Dawson # <<<<<<<<<<<<<< * # Copyright 2014 Tom Rothamel * # */ __pyx_t_5 = PyDict_New(); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); if (PyDict_SetItem(__pyx_d, __pyx_n_s_test, __pyx_t_5) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; /*--- Wrapped vars code ---*/ goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_5); __Pyx_XDECREF(__pyx_t_6); __Pyx_XDECREF(__pyx_t_7); if (__pyx_m) { if (__pyx_d) { __Pyx_AddTraceback("init pygame_sdl2.event", __pyx_clineno, __pyx_lineno, __pyx_filename); } Py_DECREF(__pyx_m); __pyx_m = 0; } else if (!PyErr_Occurred()) { PyErr_SetString(PyExc_ImportError, "init pygame_sdl2.event"); } __pyx_L0:; __Pyx_RefNannyFinishContext(); #if PY_MAJOR_VERSION < 3 return; #else return __pyx_m; #endif } /* --- Runtime support code --- */ #if CYTHON_REFNANNY static __Pyx_RefNannyAPIStruct *__Pyx_RefNannyImportAPI(const char *modname) { PyObject *m = NULL, *p = NULL; void *r = NULL; m = PyImport_ImportModule((char *)modname); if (!m) goto end; p = PyObject_GetAttrString(m, (char *)"RefNannyAPI"); if (!p) goto end; r = PyLong_AsVoidPtr(p); end: Py_XDECREF(p); Py_XDECREF(m); return (__Pyx_RefNannyAPIStruct *)r; } #endif static PyObject *__Pyx_GetBuiltinName(PyObject *name) { PyObject* result = __Pyx_PyObject_GetAttrStr(__pyx_b, name); if (unlikely(!result)) { PyErr_Format(PyExc_NameError, #if PY_MAJOR_VERSION >= 3 "name '%U' is not defined", name); #else "name '%.200s' is not defined", PyString_AS_STRING(name)); #endif } return result; } static void __Pyx_RaiseArgtupleInvalid( const char* func_name, int exact, Py_ssize_t num_min, Py_ssize_t num_max, Py_ssize_t num_found) { Py_ssize_t num_expected; const char *more_or_less; if (num_found < num_min) { num_expected = num_min; more_or_less = "at least"; } else { num_expected = num_max; more_or_less = "at most"; } if (exact) { more_or_less = "exactly"; } PyErr_Format(PyExc_TypeError, "%.200s() takes %.8s %" CYTHON_FORMAT_SSIZE_T "d positional argument%.1s (%" CYTHON_FORMAT_SSIZE_T "d given)", func_name, more_or_less, num_expected, (num_expected == 1) ? "" : "s", num_found); } static void __Pyx_RaiseDoubleKeywordsError( const char* func_name, PyObject* kw_name) { PyErr_Format(PyExc_TypeError, #if PY_MAJOR_VERSION >= 3 "%s() got multiple values for keyword argument '%U'", func_name, kw_name); #else "%s() got multiple values for keyword argument '%s'", func_name, PyString_AsString(kw_name)); #endif } static int __Pyx_ParseOptionalKeywords( PyObject *kwds, PyObject **argnames[], PyObject *kwds2, PyObject *values[], Py_ssize_t num_pos_args, const char* function_name) { PyObject *key = 0, *value = 0; Py_ssize_t pos = 0; PyObject*** name; PyObject*** first_kw_arg = argnames + num_pos_args; while (PyDict_Next(kwds, &pos, &key, &value)) { name = first_kw_arg; while (*name && (**name != key)) name++; if (*name) { values[name-argnames] = value; continue; } name = first_kw_arg; #if PY_MAJOR_VERSION < 3 if (likely(PyString_CheckExact(key)) || likely(PyString_Check(key))) { while (*name) { if ((CYTHON_COMPILING_IN_PYPY || PyString_GET_SIZE(**name) == PyString_GET_SIZE(key)) && _PyString_Eq(**name, key)) { values[name-argnames] = value; break; } name++; } if (*name) continue; else { PyObject*** argname = argnames; while (argname != first_kw_arg) { if ((**argname == key) || ( (CYTHON_COMPILING_IN_PYPY || PyString_GET_SIZE(**argname) == PyString_GET_SIZE(key)) && _PyString_Eq(**argname, key))) { goto arg_passed_twice; } argname++; } } } else #endif if (likely(PyUnicode_Check(key))) { while (*name) { int cmp = (**name == key) ? 0 : #if !CYTHON_COMPILING_IN_PYPY && PY_MAJOR_VERSION >= 3 (PyUnicode_GET_SIZE(**name) != PyUnicode_GET_SIZE(key)) ? 1 : #endif PyUnicode_Compare(**name, key); if (cmp < 0 && unlikely(PyErr_Occurred())) goto bad; if (cmp == 0) { values[name-argnames] = value; break; } name++; } if (*name) continue; else { PyObject*** argname = argnames; while (argname != first_kw_arg) { int cmp = (**argname == key) ? 0 : #if !CYTHON_COMPILING_IN_PYPY && PY_MAJOR_VERSION >= 3 (PyUnicode_GET_SIZE(**argname) != PyUnicode_GET_SIZE(key)) ? 1 : #endif PyUnicode_Compare(**argname, key); if (cmp < 0 && unlikely(PyErr_Occurred())) goto bad; if (cmp == 0) goto arg_passed_twice; argname++; } } } else goto invalid_keyword_type; if (kwds2) { if (unlikely(PyDict_SetItem(kwds2, key, value))) goto bad; } else { goto invalid_keyword; } } return 0; arg_passed_twice: __Pyx_RaiseDoubleKeywordsError(function_name, key); goto bad; invalid_keyword_type: PyErr_Format(PyExc_TypeError, "%.200s() keywords must be strings", function_name); goto bad; invalid_keyword: PyErr_Format(PyExc_TypeError, #if PY_MAJOR_VERSION < 3 "%.200s() got an unexpected keyword argument '%.200s'", function_name, PyString_AsString(key)); #else "%s() got an unexpected keyword argument '%U'", function_name, key); #endif bad: return -1; } #if CYTHON_COMPILING_IN_CPYTHON static CYTHON_INLINE PyObject* __Pyx_PyObject_Call(PyObject *func, PyObject *arg, PyObject *kw) { PyObject *result; ternaryfunc call = func->ob_type->tp_call; if (unlikely(!call)) return PyObject_Call(func, arg, kw); if (unlikely(Py_EnterRecursiveCall((char*)" while calling a Python object"))) return NULL; result = (*call)(func, arg, kw); Py_LeaveRecursiveCall(); if (unlikely(!result) && unlikely(!PyErr_Occurred())) { PyErr_SetString( PyExc_SystemError, "NULL result without error in PyObject_Call"); } return result; } #endif #if CYTHON_COMPILING_IN_CPYTHON static CYTHON_INLINE PyObject* __Pyx_PyObject_CallMethO(PyObject *func, PyObject *arg) { PyObject *self, *result; PyCFunction cfunc; cfunc = PyCFunction_GET_FUNCTION(func); self = PyCFunction_GET_SELF(func); if (unlikely(Py_EnterRecursiveCall((char*)" while calling a Python object"))) return NULL; result = cfunc(self, arg); Py_LeaveRecursiveCall(); if (unlikely(!result) && unlikely(!PyErr_Occurred())) { PyErr_SetString( PyExc_SystemError, "NULL result without error in PyObject_Call"); } return result; } #endif #if CYTHON_COMPILING_IN_CPYTHON static PyObject* __Pyx__PyObject_CallOneArg(PyObject *func, PyObject *arg) { PyObject *result; PyObject *args = PyTuple_New(1); if (unlikely(!args)) return NULL; Py_INCREF(arg); PyTuple_SET_ITEM(args, 0, arg); result = __Pyx_PyObject_Call(func, args, NULL); Py_DECREF(args); return result; } static CYTHON_INLINE PyObject* __Pyx_PyObject_CallOneArg(PyObject *func, PyObject *arg) { #ifdef __Pyx_CyFunction_USED if (likely(PyCFunction_Check(func) || PyObject_TypeCheck(func, __pyx_CyFunctionType))) { #else if (likely(PyCFunction_Check(func))) { #endif if (likely(PyCFunction_GET_FLAGS(func) & METH_O)) { return __Pyx_PyObject_CallMethO(func, arg); } } return __Pyx__PyObject_CallOneArg(func, arg); } #else static CYTHON_INLINE PyObject* __Pyx_PyObject_CallOneArg(PyObject *func, PyObject *arg) { PyObject *result; PyObject *args = PyTuple_Pack(1, arg); if (unlikely(!args)) return NULL; result = __Pyx_PyObject_Call(func, args, NULL); Py_DECREF(args); return result; } #endif static CYTHON_INLINE PyObject *__Pyx_GetModuleGlobalName(PyObject *name) { PyObject *result; #if CYTHON_COMPILING_IN_CPYTHON result = PyDict_GetItem(__pyx_d, name); if (likely(result)) { Py_INCREF(result); } else { #else result = PyObject_GetItem(__pyx_d, name); if (!result) { PyErr_Clear(); #endif result = __Pyx_GetBuiltinName(name); } return result; } static CYTHON_INLINE void __Pyx_ExceptionSave(PyObject **type, PyObject **value, PyObject **tb) { #if CYTHON_COMPILING_IN_CPYTHON PyThreadState *tstate = PyThreadState_GET(); *type = tstate->exc_type; *value = tstate->exc_value; *tb = tstate->exc_traceback; Py_XINCREF(*type); Py_XINCREF(*value); Py_XINCREF(*tb); #else PyErr_GetExcInfo(type, value, tb); #endif } static void __Pyx_ExceptionReset(PyObject *type, PyObject *value, PyObject *tb) { #if CYTHON_COMPILING_IN_CPYTHON PyObject *tmp_type, *tmp_value, *tmp_tb; PyThreadState *tstate = PyThreadState_GET(); tmp_type = tstate->exc_type; tmp_value = tstate->exc_value; tmp_tb = tstate->exc_traceback; tstate->exc_type = type; tstate->exc_value = value; tstate->exc_traceback = tb; Py_XDECREF(tmp_type); Py_XDECREF(tmp_value); Py_XDECREF(tmp_tb); #else PyErr_SetExcInfo(type, value, tb); #endif } static int __Pyx_GetException(PyObject **type, PyObject **value, PyObject **tb) { PyObject *local_type, *local_value, *local_tb; #if CYTHON_COMPILING_IN_CPYTHON PyObject *tmp_type, *tmp_value, *tmp_tb; PyThreadState *tstate = PyThreadState_GET(); local_type = tstate->curexc_type; local_value = tstate->curexc_value; local_tb = tstate->curexc_traceback; tstate->curexc_type = 0; tstate->curexc_value = 0; tstate->curexc_traceback = 0; #else PyErr_Fetch(&local_type, &local_value, &local_tb); #endif PyErr_NormalizeException(&local_type, &local_value, &local_tb); #if CYTHON_COMPILING_IN_CPYTHON if (unlikely(tstate->curexc_type)) #else if (unlikely(PyErr_Occurred())) #endif goto bad; #if PY_MAJOR_VERSION >= 3 if (local_tb) { if (unlikely(PyException_SetTraceback(local_value, local_tb) < 0)) goto bad; } #endif Py_XINCREF(local_tb); Py_XINCREF(local_type); Py_XINCREF(local_value); *type = local_type; *value = local_value; *tb = local_tb; #if CYTHON_COMPILING_IN_CPYTHON tmp_type = tstate->exc_type; tmp_value = tstate->exc_value; tmp_tb = tstate->exc_traceback; tstate->exc_type = local_type; tstate->exc_value = local_value; tstate->exc_traceback = local_tb; Py_XDECREF(tmp_type); Py_XDECREF(tmp_value); Py_XDECREF(tmp_tb); #else PyErr_SetExcInfo(local_type, local_value, local_tb); #endif return 0; bad: *type = 0; *value = 0; *tb = 0; Py_XDECREF(local_type); Py_XDECREF(local_value); Py_XDECREF(local_tb); return -1; } #if CYTHON_COMPILING_IN_CPYTHON static CYTHON_INLINE PyObject* __Pyx_PyObject_CallNoArg(PyObject *func) { #ifdef __Pyx_CyFunction_USED if (likely(PyCFunction_Check(func) || PyObject_TypeCheck(func, __pyx_CyFunctionType))) { #else if (likely(PyCFunction_Check(func))) { #endif if (likely(PyCFunction_GET_FLAGS(func) & METH_NOARGS)) { return __Pyx_PyObject_CallMethO(func, NULL); } } return __Pyx_PyObject_Call(func, __pyx_empty_tuple, NULL); } #endif static CYTHON_INLINE PyObject* __Pyx_decode_c_string( const char* cstring, Py_ssize_t start, Py_ssize_t stop, const char* encoding, const char* errors, PyObject* (*decode_func)(const char *s, Py_ssize_t size, const char *errors)) { Py_ssize_t length; if (unlikely((start < 0) | (stop < 0))) { size_t slen = strlen(cstring); if (unlikely(slen > (size_t) PY_SSIZE_T_MAX)) { PyErr_SetString(PyExc_OverflowError, "c-string too long to convert to Python"); return NULL; } length = (Py_ssize_t) slen; if (start < 0) { start += length; if (start < 0) start = 0; } if (stop < 0) stop += length; } length = stop - start; if (unlikely(length <= 0)) return PyUnicode_FromUnicode(NULL, 0); cstring += start; if (decode_func) { return decode_func(cstring, length, errors); } else { return PyUnicode_Decode(cstring, length, encoding, errors); } } #if CYTHON_USE_PYLONG_INTERNALS #include "longintrepr.h" #endif #if CYTHON_COMPILING_IN_CPYTHON static PyObject* __Pyx_PyInt_AddObjC(PyObject *op1, PyObject *op2, CYTHON_UNUSED long intval, CYTHON_UNUSED int inplace) { #if PY_MAJOR_VERSION < 3 if (likely(PyInt_CheckExact(op1))) { const long b = intval; long x; long a = PyInt_AS_LONG(op1); x = (long)((unsigned long)a + b); if (likely((x^a) >= 0 || (x^b) >= 0)) return PyInt_FromLong(x); return PyLong_Type.tp_as_number->nb_add(op1, op2); } #endif #if CYTHON_USE_PYLONG_INTERNALS && PY_MAJOR_VERSION >= 3 if (likely(PyLong_CheckExact(op1))) { const long b = intval; long a, x; const PY_LONG_LONG llb = intval; PY_LONG_LONG lla, llx; const digit* digits = ((PyLongObject*)op1)->ob_digit; const Py_ssize_t size = Py_SIZE(op1); if (likely(__Pyx_sst_abs(size) <= 1)) { a = likely(size) ? digits[0] : 0; if (size == -1) a = -a; } else { switch (size) { case -2: if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) { a = -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])); break; } else if (8 * sizeof(PY_LONG_LONG) - 1 > 2 * PyLong_SHIFT) { lla = -(PY_LONG_LONG) (((((unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0])); goto long_long; } case 2: if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) { a = (long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])); break; } else if (8 * sizeof(PY_LONG_LONG) - 1 > 2 * PyLong_SHIFT) { lla = (PY_LONG_LONG) (((((unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0])); goto long_long; } case -3: if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) { a = -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])); break; } else if (8 * sizeof(PY_LONG_LONG) - 1 > 3 * PyLong_SHIFT) { lla = -(PY_LONG_LONG) (((((((unsigned PY_LONG_LONG)digits[2]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0])); goto long_long; } case 3: if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) { a = (long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])); break; } else if (8 * sizeof(PY_LONG_LONG) - 1 > 3 * PyLong_SHIFT) { lla = (PY_LONG_LONG) (((((((unsigned PY_LONG_LONG)digits[2]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0])); goto long_long; } case -4: if (8 * sizeof(long) - 1 > 4 * PyLong_SHIFT) { a = -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])); break; } else if (8 * sizeof(PY_LONG_LONG) - 1 > 4 * PyLong_SHIFT) { lla = -(PY_LONG_LONG) (((((((((unsigned PY_LONG_LONG)digits[3]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[2]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0])); goto long_long; } case 4: if (8 * sizeof(long) - 1 > 4 * PyLong_SHIFT) { a = (long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])); break; } else if (8 * sizeof(PY_LONG_LONG) - 1 > 4 * PyLong_SHIFT) { lla = (PY_LONG_LONG) (((((((((unsigned PY_LONG_LONG)digits[3]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[2]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0])); goto long_long; } default: return PyLong_Type.tp_as_number->nb_add(op1, op2); } } x = a + b; return PyLong_FromLong(x); long_long: llx = lla + llb; return PyLong_FromLongLong(llx); } #endif if (PyFloat_CheckExact(op1)) { const long b = intval; double a = PyFloat_AS_DOUBLE(op1); double result; PyFPE_START_PROTECT("add", return NULL) result = ((double)a) + (double)b; PyFPE_END_PROTECT(result) return PyFloat_FromDouble(result); } return (inplace ? PyNumber_InPlaceAdd : PyNumber_Add)(op1, op2); } #endif static CYTHON_INLINE void __Pyx_ErrRestore(PyObject *type, PyObject *value, PyObject *tb) { #if CYTHON_COMPILING_IN_CPYTHON PyObject *tmp_type, *tmp_value, *tmp_tb; PyThreadState *tstate = PyThreadState_GET(); tmp_type = tstate->curexc_type; tmp_value = tstate->curexc_value; tmp_tb = tstate->curexc_traceback; tstate->curexc_type = type; tstate->curexc_value = value; tstate->curexc_traceback = tb; Py_XDECREF(tmp_type); Py_XDECREF(tmp_value); Py_XDECREF(tmp_tb); #else PyErr_Restore(type, value, tb); #endif } static CYTHON_INLINE void __Pyx_ErrFetch(PyObject **type, PyObject **value, PyObject **tb) { #if CYTHON_COMPILING_IN_CPYTHON PyThreadState *tstate = PyThreadState_GET(); *type = tstate->curexc_type; *value = tstate->curexc_value; *tb = tstate->curexc_traceback; tstate->curexc_type = 0; tstate->curexc_value = 0; tstate->curexc_traceback = 0; #else PyErr_Fetch(type, value, tb); #endif } static void __Pyx_WriteUnraisable(const char *name, CYTHON_UNUSED int clineno, CYTHON_UNUSED int lineno, CYTHON_UNUSED const char *filename, int full_traceback, CYTHON_UNUSED int nogil) { PyObject *old_exc, *old_val, *old_tb; PyObject *ctx; #ifdef WITH_THREAD PyGILState_STATE state; if (nogil) state = PyGILState_Ensure(); #endif __Pyx_ErrFetch(&old_exc, &old_val, &old_tb); if (full_traceback) { Py_XINCREF(old_exc); Py_XINCREF(old_val); Py_XINCREF(old_tb); __Pyx_ErrRestore(old_exc, old_val, old_tb); PyErr_PrintEx(1); } #if PY_MAJOR_VERSION < 3 ctx = PyString_FromString(name); #else ctx = PyUnicode_FromString(name); #endif __Pyx_ErrRestore(old_exc, old_val, old_tb); if (!ctx) { PyErr_WriteUnraisable(Py_None); } else { PyErr_WriteUnraisable(ctx); Py_DECREF(ctx); } #ifdef WITH_THREAD if (nogil) PyGILState_Release(state); #endif } static PyObject* __Pyx_PyObject_CallMethod1(PyObject* obj, PyObject* method_name, PyObject* arg) { PyObject *method, *result = NULL; method = __Pyx_PyObject_GetAttrStr(obj, method_name); if (unlikely(!method)) goto bad; #if CYTHON_COMPILING_IN_CPYTHON if (likely(PyMethod_Check(method))) { PyObject *self = PyMethod_GET_SELF(method); if (likely(self)) { PyObject *args; PyObject *function = PyMethod_GET_FUNCTION(method); args = PyTuple_New(2); if (unlikely(!args)) goto bad; Py_INCREF(self); PyTuple_SET_ITEM(args, 0, self); Py_INCREF(arg); PyTuple_SET_ITEM(args, 1, arg); Py_INCREF(function); Py_DECREF(method); method = NULL; result = __Pyx_PyObject_Call(function, args, NULL); Py_DECREF(args); Py_DECREF(function); return result; } } #endif result = __Pyx_PyObject_CallOneArg(method, arg); bad: Py_XDECREF(method); return result; } static CYTHON_INLINE int __Pyx_PyObject_Append(PyObject* L, PyObject* x) { if (likely(PyList_CheckExact(L))) { if (unlikely(__Pyx_PyList_Append(L, x) < 0)) return -1; } else { PyObject* retval = __Pyx_PyObject_CallMethod1(L, __pyx_n_s_append, x); if (unlikely(!retval)) return -1; Py_DECREF(retval); } return 0; } static CYTHON_INLINE void __Pyx_RaiseUnboundLocalError(const char *varname) { PyErr_Format(PyExc_UnboundLocalError, "local variable '%s' referenced before assignment", varname); } static PyObject* __Pyx__PyObject_PopNewIndex(PyObject* L, PyObject* py_ix) { PyObject *r; if (unlikely(!py_ix)) return NULL; r = __Pyx__PyObject_PopIndex(L, py_ix); Py_DECREF(py_ix); return r; } static PyObject* __Pyx__PyObject_PopIndex(PyObject* L, PyObject* py_ix) { return __Pyx_PyObject_CallMethod1(L, __pyx_n_s_pop, py_ix); } #if CYTHON_COMPILING_IN_CPYTHON static PyObject* __Pyx__PyList_PopIndex(PyObject* L, PyObject* py_ix, Py_ssize_t ix) { Py_ssize_t size = PyList_GET_SIZE(L); if (likely(size > (((PyListObject*)L)->allocated >> 1))) { Py_ssize_t cix = ix; if (cix < 0) { cix += size; } if (likely(0 <= cix && cix < size)) { PyObject* v = PyList_GET_ITEM(L, cix); Py_SIZE(L) -= 1; size -= 1; memmove(&PyList_GET_ITEM(L, cix), &PyList_GET_ITEM(L, cix+1), (size_t)(size-cix)*sizeof(PyObject*)); return v; } } if (py_ix == Py_None) { return __Pyx__PyObject_PopNewIndex(L, PyInt_FromSsize_t(ix)); } else { return __Pyx__PyObject_PopIndex(L, py_ix); } } #endif #if PY_MAJOR_VERSION < 3 static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, CYTHON_UNUSED PyObject *cause) { Py_XINCREF(type); if (!value || value == Py_None) value = NULL; else Py_INCREF(value); if (!tb || tb == Py_None) tb = NULL; else { Py_INCREF(tb); if (!PyTraceBack_Check(tb)) { PyErr_SetString(PyExc_TypeError, "raise: arg 3 must be a traceback or None"); goto raise_error; } } if (PyType_Check(type)) { #if CYTHON_COMPILING_IN_PYPY if (!value) { Py_INCREF(Py_None); value = Py_None; } #endif PyErr_NormalizeException(&type, &value, &tb); } else { if (value) { PyErr_SetString(PyExc_TypeError, "instance exception may not have a separate value"); goto raise_error; } value = type; type = (PyObject*) Py_TYPE(type); Py_INCREF(type); if (!PyType_IsSubtype((PyTypeObject *)type, (PyTypeObject *)PyExc_BaseException)) { PyErr_SetString(PyExc_TypeError, "raise: exception class must be a subclass of BaseException"); goto raise_error; } } __Pyx_ErrRestore(type, value, tb); return; raise_error: Py_XDECREF(value); Py_XDECREF(type); Py_XDECREF(tb); return; } #else static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, PyObject *cause) { PyObject* owned_instance = NULL; if (tb == Py_None) { tb = 0; } else if (tb && !PyTraceBack_Check(tb)) { PyErr_SetString(PyExc_TypeError, "raise: arg 3 must be a traceback or None"); goto bad; } if (value == Py_None) value = 0; if (PyExceptionInstance_Check(type)) { if (value) { PyErr_SetString(PyExc_TypeError, "instance exception may not have a separate value"); goto bad; } value = type; type = (PyObject*) Py_TYPE(value); } else if (PyExceptionClass_Check(type)) { PyObject *instance_class = NULL; if (value && PyExceptionInstance_Check(value)) { instance_class = (PyObject*) Py_TYPE(value); if (instance_class != type) { int is_subclass = PyObject_IsSubclass(instance_class, type); if (!is_subclass) { instance_class = NULL; } else if (unlikely(is_subclass == -1)) { goto bad; } else { type = instance_class; } } } if (!instance_class) { PyObject *args; if (!value) args = PyTuple_New(0); else if (PyTuple_Check(value)) { Py_INCREF(value); args = value; } else args = PyTuple_Pack(1, value); if (!args) goto bad; owned_instance = PyObject_Call(type, args, NULL); Py_DECREF(args); if (!owned_instance) goto bad; value = owned_instance; if (!PyExceptionInstance_Check(value)) { PyErr_Format(PyExc_TypeError, "calling %R should have returned an instance of " "BaseException, not %R", type, Py_TYPE(value)); goto bad; } } } else { PyErr_SetString(PyExc_TypeError, "raise: exception class must be a subclass of BaseException"); goto bad; } #if PY_VERSION_HEX >= 0x03030000 if (cause) { #else if (cause && cause != Py_None) { #endif PyObject *fixed_cause; if (cause == Py_None) { fixed_cause = NULL; } else if (PyExceptionClass_Check(cause)) { fixed_cause = PyObject_CallObject(cause, NULL); if (fixed_cause == NULL) goto bad; } else if (PyExceptionInstance_Check(cause)) { fixed_cause = cause; Py_INCREF(fixed_cause); } else { PyErr_SetString(PyExc_TypeError, "exception causes must derive from " "BaseException"); goto bad; } PyException_SetCause(value, fixed_cause); } PyErr_SetObject(type, value); if (tb) { #if CYTHON_COMPILING_IN_PYPY PyObject *tmp_type, *tmp_value, *tmp_tb; PyErr_Fetch(&tmp_type, &tmp_value, &tmp_tb); Py_INCREF(tb); PyErr_Restore(tmp_type, tmp_value, tb); Py_XDECREF(tmp_tb); #else PyThreadState *tstate = PyThreadState_GET(); PyObject* tmp_tb = tstate->curexc_traceback; if (tb != tmp_tb) { Py_INCREF(tb); tstate->curexc_traceback = tb; Py_XDECREF(tmp_tb); } #endif } bad: Py_XDECREF(owned_instance); return; } #endif static CYTHON_INLINE int __Pyx_SetItemInt_Generic(PyObject *o, PyObject *j, PyObject *v) { int r; if (!j) return -1; r = PyObject_SetItem(o, j, v); Py_DECREF(j); return r; } static CYTHON_INLINE int __Pyx_SetItemInt_Fast(PyObject *o, Py_ssize_t i, PyObject *v, int is_list, CYTHON_NCP_UNUSED int wraparound, CYTHON_NCP_UNUSED int boundscheck) { #if CYTHON_COMPILING_IN_CPYTHON if (is_list || PyList_CheckExact(o)) { Py_ssize_t n = (!wraparound) ? i : ((likely(i >= 0)) ? i : i + PyList_GET_SIZE(o)); if ((!boundscheck) || likely((n >= 0) & (n < PyList_GET_SIZE(o)))) { PyObject* old = PyList_GET_ITEM(o, n); Py_INCREF(v); PyList_SET_ITEM(o, n, v); Py_DECREF(old); return 1; } } else { PySequenceMethods *m = Py_TYPE(o)->tp_as_sequence; if (likely(m && m->sq_ass_item)) { if (wraparound && unlikely(i < 0) && likely(m->sq_length)) { Py_ssize_t l = m->sq_length(o); if (likely(l >= 0)) { i += l; } else { if (PyErr_ExceptionMatches(PyExc_OverflowError)) PyErr_Clear(); else return -1; } } return m->sq_ass_item(o, i, v); } } #else #if CYTHON_COMPILING_IN_PYPY if (is_list || (PySequence_Check(o) && !PyDict_Check(o))) { #else if (is_list || PySequence_Check(o)) { #endif return PySequence_SetItem(o, i, v); } #endif return __Pyx_SetItemInt_Generic(o, PyInt_FromSsize_t(i), v); } static CYTHON_INLINE PyObject* __Pyx_PyObject_GetSlice(PyObject* obj, Py_ssize_t cstart, Py_ssize_t cstop, PyObject** _py_start, PyObject** _py_stop, PyObject** _py_slice, int has_cstart, int has_cstop, CYTHON_UNUSED int wraparound) { #if CYTHON_COMPILING_IN_CPYTHON PyMappingMethods* mp; #if PY_MAJOR_VERSION < 3 PySequenceMethods* ms = Py_TYPE(obj)->tp_as_sequence; if (likely(ms && ms->sq_slice)) { if (!has_cstart) { if (_py_start && (*_py_start != Py_None)) { cstart = __Pyx_PyIndex_AsSsize_t(*_py_start); if ((cstart == (Py_ssize_t)-1) && PyErr_Occurred()) goto bad; } else cstart = 0; } if (!has_cstop) { if (_py_stop && (*_py_stop != Py_None)) { cstop = __Pyx_PyIndex_AsSsize_t(*_py_stop); if ((cstop == (Py_ssize_t)-1) && PyErr_Occurred()) goto bad; } else cstop = PY_SSIZE_T_MAX; } if (wraparound && unlikely((cstart < 0) | (cstop < 0)) && likely(ms->sq_length)) { Py_ssize_t l = ms->sq_length(obj); if (likely(l >= 0)) { if (cstop < 0) { cstop += l; if (cstop < 0) cstop = 0; } if (cstart < 0) { cstart += l; if (cstart < 0) cstart = 0; } } else { if (PyErr_ExceptionMatches(PyExc_OverflowError)) PyErr_Clear(); else goto bad; } } return ms->sq_slice(obj, cstart, cstop); } #endif mp = Py_TYPE(obj)->tp_as_mapping; if (likely(mp && mp->mp_subscript)) #endif { PyObject* result; PyObject *py_slice, *py_start, *py_stop; if (_py_slice) { py_slice = *_py_slice; } else { PyObject* owned_start = NULL; PyObject* owned_stop = NULL; if (_py_start) { py_start = *_py_start; } else { if (has_cstart) { owned_start = py_start = PyInt_FromSsize_t(cstart); if (unlikely(!py_start)) goto bad; } else py_start = Py_None; } if (_py_stop) { py_stop = *_py_stop; } else { if (has_cstop) { owned_stop = py_stop = PyInt_FromSsize_t(cstop); if (unlikely(!py_stop)) { Py_XDECREF(owned_start); goto bad; } } else py_stop = Py_None; } py_slice = PySlice_New(py_start, py_stop, Py_None); Py_XDECREF(owned_start); Py_XDECREF(owned_stop); if (unlikely(!py_slice)) goto bad; } #if CYTHON_COMPILING_IN_CPYTHON result = mp->mp_subscript(obj, py_slice); #else result = PyObject_GetItem(obj, py_slice); #endif if (!_py_slice) { Py_DECREF(py_slice); } return result; } PyErr_Format(PyExc_TypeError, "'%.200s' object is unsliceable", Py_TYPE(obj)->tp_name); bad: return NULL; } static void* __Pyx_GetVtable(PyObject *dict) { void* ptr; PyObject *ob = PyObject_GetItem(dict, __pyx_n_s_pyx_vtable); if (!ob) goto bad; #if PY_VERSION_HEX >= 0x02070000 ptr = PyCapsule_GetPointer(ob, 0); #else ptr = PyCObject_AsVoidPtr(ob); #endif if (!ptr && !PyErr_Occurred()) PyErr_SetString(PyExc_RuntimeError, "invalid vtable found for imported type"); Py_DECREF(ob); return ptr; bad: Py_XDECREF(ob); return NULL; } static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list, int level) { PyObject *empty_list = 0; PyObject *module = 0; PyObject *global_dict = 0; PyObject *empty_dict = 0; PyObject *list; #if PY_VERSION_HEX < 0x03030000 PyObject *py_import; py_import = __Pyx_PyObject_GetAttrStr(__pyx_b, __pyx_n_s_import); if (!py_import) goto bad; #endif if (from_list) list = from_list; else { empty_list = PyList_New(0); if (!empty_list) goto bad; list = empty_list; } global_dict = PyModule_GetDict(__pyx_m); if (!global_dict) goto bad; empty_dict = PyDict_New(); if (!empty_dict) goto bad; { #if PY_MAJOR_VERSION >= 3 if (level == -1) { if (strchr(__Pyx_MODULE_NAME, '.')) { #if PY_VERSION_HEX < 0x03030000 PyObject *py_level = PyInt_FromLong(1); if (!py_level) goto bad; module = PyObject_CallFunctionObjArgs(py_import, name, global_dict, empty_dict, list, py_level, NULL); Py_DECREF(py_level); #else module = PyImport_ImportModuleLevelObject( name, global_dict, empty_dict, list, 1); #endif if (!module) { if (!PyErr_ExceptionMatches(PyExc_ImportError)) goto bad; PyErr_Clear(); } } level = 0; } #endif if (!module) { #if PY_VERSION_HEX < 0x03030000 PyObject *py_level = PyInt_FromLong(level); if (!py_level) goto bad; module = PyObject_CallFunctionObjArgs(py_import, name, global_dict, empty_dict, list, py_level, NULL); Py_DECREF(py_level); #else module = PyImport_ImportModuleLevelObject( name, global_dict, empty_dict, list, level); #endif } } bad: #if PY_VERSION_HEX < 0x03030000 Py_XDECREF(py_import); #endif Py_XDECREF(empty_list); Py_XDECREF(empty_dict); return module; } static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Generic(PyObject *o, PyObject* j) { PyObject *r; if (!j) return NULL; r = PyObject_GetItem(o, j); Py_DECREF(j); return r; } static CYTHON_INLINE PyObject *__Pyx_GetItemInt_List_Fast(PyObject *o, Py_ssize_t i, CYTHON_NCP_UNUSED int wraparound, CYTHON_NCP_UNUSED int boundscheck) { #if CYTHON_COMPILING_IN_CPYTHON if (wraparound & unlikely(i < 0)) i += PyList_GET_SIZE(o); if ((!boundscheck) || likely((0 <= i) & (i < PyList_GET_SIZE(o)))) { PyObject *r = PyList_GET_ITEM(o, i); Py_INCREF(r); return r; } return __Pyx_GetItemInt_Generic(o, PyInt_FromSsize_t(i)); #else return PySequence_GetItem(o, i); #endif } static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Tuple_Fast(PyObject *o, Py_ssize_t i, CYTHON_NCP_UNUSED int wraparound, CYTHON_NCP_UNUSED int boundscheck) { #if CYTHON_COMPILING_IN_CPYTHON if (wraparound & unlikely(i < 0)) i += PyTuple_GET_SIZE(o); if ((!boundscheck) || likely((0 <= i) & (i < PyTuple_GET_SIZE(o)))) { PyObject *r = PyTuple_GET_ITEM(o, i); Py_INCREF(r); return r; } return __Pyx_GetItemInt_Generic(o, PyInt_FromSsize_t(i)); #else return PySequence_GetItem(o, i); #endif } static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Fast(PyObject *o, Py_ssize_t i, int is_list, CYTHON_NCP_UNUSED int wraparound, CYTHON_NCP_UNUSED int boundscheck) { #if CYTHON_COMPILING_IN_CPYTHON if (is_list || PyList_CheckExact(o)) { Py_ssize_t n = ((!wraparound) | likely(i >= 0)) ? i : i + PyList_GET_SIZE(o); if ((!boundscheck) || (likely((n >= 0) & (n < PyList_GET_SIZE(o))))) { PyObject *r = PyList_GET_ITEM(o, n); Py_INCREF(r); return r; } } else if (PyTuple_CheckExact(o)) { Py_ssize_t n = ((!wraparound) | likely(i >= 0)) ? i : i + PyTuple_GET_SIZE(o); if ((!boundscheck) || likely((n >= 0) & (n < PyTuple_GET_SIZE(o)))) { PyObject *r = PyTuple_GET_ITEM(o, n); Py_INCREF(r); return r; } } else { PySequenceMethods *m = Py_TYPE(o)->tp_as_sequence; if (likely(m && m->sq_item)) { if (wraparound && unlikely(i < 0) && likely(m->sq_length)) { Py_ssize_t l = m->sq_length(o); if (likely(l >= 0)) { i += l; } else { if (PyErr_ExceptionMatches(PyExc_OverflowError)) PyErr_Clear(); else return NULL; } } return m->sq_item(o, i); } } #else if (is_list || PySequence_Check(o)) { return PySequence_GetItem(o, i); } #endif return __Pyx_GetItemInt_Generic(o, PyInt_FromSsize_t(i)); } static PyObject *__Pyx_CalculateMetaclass(PyTypeObject *metaclass, PyObject *bases) { Py_ssize_t i, nbases = PyTuple_GET_SIZE(bases); for (i=0; i < nbases; i++) { PyTypeObject *tmptype; PyObject *tmp = PyTuple_GET_ITEM(bases, i); tmptype = Py_TYPE(tmp); #if PY_MAJOR_VERSION < 3 if (tmptype == &PyClass_Type) continue; #endif if (!metaclass) { metaclass = tmptype; continue; } if (PyType_IsSubtype(metaclass, tmptype)) continue; if (PyType_IsSubtype(tmptype, metaclass)) { metaclass = tmptype; continue; } PyErr_SetString(PyExc_TypeError, "metaclass conflict: " "the metaclass of a derived class " "must be a (non-strict) subclass " "of the metaclasses of all its bases"); return NULL; } if (!metaclass) { #if PY_MAJOR_VERSION < 3 metaclass = &PyClass_Type; #else metaclass = &PyType_Type; #endif } Py_INCREF((PyObject*) metaclass); return (PyObject*) metaclass; } static PyTypeObject* __Pyx_FetchCommonType(PyTypeObject* type) { PyObject* fake_module; PyTypeObject* cached_type = NULL; fake_module = PyImport_AddModule((char*) "_cython_" CYTHON_ABI); if (!fake_module) return NULL; Py_INCREF(fake_module); cached_type = (PyTypeObject*) PyObject_GetAttrString(fake_module, type->tp_name); if (cached_type) { if (!PyType_Check((PyObject*)cached_type)) { PyErr_Format(PyExc_TypeError, "Shared Cython type %.200s is not a type object", type->tp_name); goto bad; } if (cached_type->tp_basicsize != type->tp_basicsize) { PyErr_Format(PyExc_TypeError, "Shared Cython type %.200s has the wrong size, try recompiling", type->tp_name); goto bad; } } else { if (!PyErr_ExceptionMatches(PyExc_AttributeError)) goto bad; PyErr_Clear(); if (PyType_Ready(type) < 0) goto bad; if (PyObject_SetAttrString(fake_module, type->tp_name, (PyObject*) type) < 0) goto bad; Py_INCREF(type); cached_type = type; } done: Py_DECREF(fake_module); return cached_type; bad: Py_XDECREF(cached_type); cached_type = NULL; goto done; } static PyObject * __Pyx_CyFunction_get_doc(__pyx_CyFunctionObject *op, CYTHON_UNUSED void *closure) { if (unlikely(op->func_doc == NULL)) { if (op->func.m_ml->ml_doc) { #if PY_MAJOR_VERSION >= 3 op->func_doc = PyUnicode_FromString(op->func.m_ml->ml_doc); #else op->func_doc = PyString_FromString(op->func.m_ml->ml_doc); #endif if (unlikely(op->func_doc == NULL)) return NULL; } else { Py_INCREF(Py_None); return Py_None; } } Py_INCREF(op->func_doc); return op->func_doc; } static int __Pyx_CyFunction_set_doc(__pyx_CyFunctionObject *op, PyObject *value) { PyObject *tmp = op->func_doc; if (value == NULL) { value = Py_None; } Py_INCREF(value); op->func_doc = value; Py_XDECREF(tmp); return 0; } static PyObject * __Pyx_CyFunction_get_name(__pyx_CyFunctionObject *op) { if (unlikely(op->func_name == NULL)) { #if PY_MAJOR_VERSION >= 3 op->func_name = PyUnicode_InternFromString(op->func.m_ml->ml_name); #else op->func_name = PyString_InternFromString(op->func.m_ml->ml_name); #endif if (unlikely(op->func_name == NULL)) return NULL; } Py_INCREF(op->func_name); return op->func_name; } static int __Pyx_CyFunction_set_name(__pyx_CyFunctionObject *op, PyObject *value) { PyObject *tmp; #if PY_MAJOR_VERSION >= 3 if (unlikely(value == NULL || !PyUnicode_Check(value))) { #else if (unlikely(value == NULL || !PyString_Check(value))) { #endif PyErr_SetString(PyExc_TypeError, "__name__ must be set to a string object"); return -1; } tmp = op->func_name; Py_INCREF(value); op->func_name = value; Py_XDECREF(tmp); return 0; } static PyObject * __Pyx_CyFunction_get_qualname(__pyx_CyFunctionObject *op) { Py_INCREF(op->func_qualname); return op->func_qualname; } static int __Pyx_CyFunction_set_qualname(__pyx_CyFunctionObject *op, PyObject *value) { PyObject *tmp; #if PY_MAJOR_VERSION >= 3 if (unlikely(value == NULL || !PyUnicode_Check(value))) { #else if (unlikely(value == NULL || !PyString_Check(value))) { #endif PyErr_SetString(PyExc_TypeError, "__qualname__ must be set to a string object"); return -1; } tmp = op->func_qualname; Py_INCREF(value); op->func_qualname = value; Py_XDECREF(tmp); return 0; } static PyObject * __Pyx_CyFunction_get_self(__pyx_CyFunctionObject *m, CYTHON_UNUSED void *closure) { PyObject *self; self = m->func_closure; if (self == NULL) self = Py_None; Py_INCREF(self); return self; } static PyObject * __Pyx_CyFunction_get_dict(__pyx_CyFunctionObject *op) { if (unlikely(op->func_dict == NULL)) { op->func_dict = PyDict_New(); if (unlikely(op->func_dict == NULL)) return NULL; } Py_INCREF(op->func_dict); return op->func_dict; } static int __Pyx_CyFunction_set_dict(__pyx_CyFunctionObject *op, PyObject *value) { PyObject *tmp; if (unlikely(value == NULL)) { PyErr_SetString(PyExc_TypeError, "function's dictionary may not be deleted"); return -1; } if (unlikely(!PyDict_Check(value))) { PyErr_SetString(PyExc_TypeError, "setting function's dictionary to a non-dict"); return -1; } tmp = op->func_dict; Py_INCREF(value); op->func_dict = value; Py_XDECREF(tmp); return 0; } static PyObject * __Pyx_CyFunction_get_globals(__pyx_CyFunctionObject *op) { Py_INCREF(op->func_globals); return op->func_globals; } static PyObject * __Pyx_CyFunction_get_closure(CYTHON_UNUSED __pyx_CyFunctionObject *op) { Py_INCREF(Py_None); return Py_None; } static PyObject * __Pyx_CyFunction_get_code(__pyx_CyFunctionObject *op) { PyObject* result = (op->func_code) ? op->func_code : Py_None; Py_INCREF(result); return result; } static int __Pyx_CyFunction_init_defaults(__pyx_CyFunctionObject *op) { int result = 0; PyObject *res = op->defaults_getter((PyObject *) op); if (unlikely(!res)) return -1; #if CYTHON_COMPILING_IN_CPYTHON op->defaults_tuple = PyTuple_GET_ITEM(res, 0); Py_INCREF(op->defaults_tuple); op->defaults_kwdict = PyTuple_GET_ITEM(res, 1); Py_INCREF(op->defaults_kwdict); #else op->defaults_tuple = PySequence_ITEM(res, 0); if (unlikely(!op->defaults_tuple)) result = -1; else { op->defaults_kwdict = PySequence_ITEM(res, 1); if (unlikely(!op->defaults_kwdict)) result = -1; } #endif Py_DECREF(res); return result; } static int __Pyx_CyFunction_set_defaults(__pyx_CyFunctionObject *op, PyObject* value) { PyObject* tmp; if (!value) { value = Py_None; } else if (value != Py_None && !PyTuple_Check(value)) { PyErr_SetString(PyExc_TypeError, "__defaults__ must be set to a tuple object"); return -1; } Py_INCREF(value); tmp = op->defaults_tuple; op->defaults_tuple = value; Py_XDECREF(tmp); return 0; } static PyObject * __Pyx_CyFunction_get_defaults(__pyx_CyFunctionObject *op) { PyObject* result = op->defaults_tuple; if (unlikely(!result)) { if (op->defaults_getter) { if (__Pyx_CyFunction_init_defaults(op) < 0) return NULL; result = op->defaults_tuple; } else { result = Py_None; } } Py_INCREF(result); return result; } static int __Pyx_CyFunction_set_kwdefaults(__pyx_CyFunctionObject *op, PyObject* value) { PyObject* tmp; if (!value) { value = Py_None; } else if (value != Py_None && !PyDict_Check(value)) { PyErr_SetString(PyExc_TypeError, "__kwdefaults__ must be set to a dict object"); return -1; } Py_INCREF(value); tmp = op->defaults_kwdict; op->defaults_kwdict = value; Py_XDECREF(tmp); return 0; } static PyObject * __Pyx_CyFunction_get_kwdefaults(__pyx_CyFunctionObject *op) { PyObject* result = op->defaults_kwdict; if (unlikely(!result)) { if (op->defaults_getter) { if (__Pyx_CyFunction_init_defaults(op) < 0) return NULL; result = op->defaults_kwdict; } else { result = Py_None; } } Py_INCREF(result); return result; } static int __Pyx_CyFunction_set_annotations(__pyx_CyFunctionObject *op, PyObject* value) { PyObject* tmp; if (!value || value == Py_None) { value = NULL; } else if (!PyDict_Check(value)) { PyErr_SetString(PyExc_TypeError, "__annotations__ must be set to a dict object"); return -1; } Py_XINCREF(value); tmp = op->func_annotations; op->func_annotations = value; Py_XDECREF(tmp); return 0; } static PyObject * __Pyx_CyFunction_get_annotations(__pyx_CyFunctionObject *op) { PyObject* result = op->func_annotations; if (unlikely(!result)) { result = PyDict_New(); if (unlikely(!result)) return NULL; op->func_annotations = result; } Py_INCREF(result); return result; } static PyGetSetDef __pyx_CyFunction_getsets[] = { {(char *) "func_doc", (getter)__Pyx_CyFunction_get_doc, (setter)__Pyx_CyFunction_set_doc, 0, 0}, {(char *) "__doc__", (getter)__Pyx_CyFunction_get_doc, (setter)__Pyx_CyFunction_set_doc, 0, 0}, {(char *) "func_name", (getter)__Pyx_CyFunction_get_name, (setter)__Pyx_CyFunction_set_name, 0, 0}, {(char *) "__name__", (getter)__Pyx_CyFunction_get_name, (setter)__Pyx_CyFunction_set_name, 0, 0}, {(char *) "__qualname__", (getter)__Pyx_CyFunction_get_qualname, (setter)__Pyx_CyFunction_set_qualname, 0, 0}, {(char *) "__self__", (getter)__Pyx_CyFunction_get_self, 0, 0, 0}, {(char *) "func_dict", (getter)__Pyx_CyFunction_get_dict, (setter)__Pyx_CyFunction_set_dict, 0, 0}, {(char *) "__dict__", (getter)__Pyx_CyFunction_get_dict, (setter)__Pyx_CyFunction_set_dict, 0, 0}, {(char *) "func_globals", (getter)__Pyx_CyFunction_get_globals, 0, 0, 0}, {(char *) "__globals__", (getter)__Pyx_CyFunction_get_globals, 0, 0, 0}, {(char *) "func_closure", (getter)__Pyx_CyFunction_get_closure, 0, 0, 0}, {(char *) "__closure__", (getter)__Pyx_CyFunction_get_closure, 0, 0, 0}, {(char *) "func_code", (getter)__Pyx_CyFunction_get_code, 0, 0, 0}, {(char *) "__code__", (getter)__Pyx_CyFunction_get_code, 0, 0, 0}, {(char *) "func_defaults", (getter)__Pyx_CyFunction_get_defaults, (setter)__Pyx_CyFunction_set_defaults, 0, 0}, {(char *) "__defaults__", (getter)__Pyx_CyFunction_get_defaults, (setter)__Pyx_CyFunction_set_defaults, 0, 0}, {(char *) "__kwdefaults__", (getter)__Pyx_CyFunction_get_kwdefaults, (setter)__Pyx_CyFunction_set_kwdefaults, 0, 0}, {(char *) "__annotations__", (getter)__Pyx_CyFunction_get_annotations, (setter)__Pyx_CyFunction_set_annotations, 0, 0}, {0, 0, 0, 0, 0} }; static PyMemberDef __pyx_CyFunction_members[] = { {(char *) "__module__", T_OBJECT, offsetof(__pyx_CyFunctionObject, func.m_module), PY_WRITE_RESTRICTED, 0}, {0, 0, 0, 0, 0} }; static PyObject * __Pyx_CyFunction_reduce(__pyx_CyFunctionObject *m, CYTHON_UNUSED PyObject *args) { #if PY_MAJOR_VERSION >= 3 return PyUnicode_FromString(m->func.m_ml->ml_name); #else return PyString_FromString(m->func.m_ml->ml_name); #endif } static PyMethodDef __pyx_CyFunction_methods[] = { {"__reduce__", (PyCFunction)__Pyx_CyFunction_reduce, METH_VARARGS, 0}, {0, 0, 0, 0} }; #if PY_VERSION_HEX < 0x030500A0 #define __Pyx_CyFunction_weakreflist(cyfunc) ((cyfunc)->func_weakreflist) #else #define __Pyx_CyFunction_weakreflist(cyfunc) ((cyfunc)->func.m_weakreflist) #endif static PyObject *__Pyx_CyFunction_New(PyTypeObject *type, PyMethodDef *ml, int flags, PyObject* qualname, PyObject *closure, PyObject *module, PyObject* globals, PyObject* code) { __pyx_CyFunctionObject *op = PyObject_GC_New(__pyx_CyFunctionObject, type); if (op == NULL) return NULL; op->flags = flags; __Pyx_CyFunction_weakreflist(op) = NULL; op->func.m_ml = ml; op->func.m_self = (PyObject *) op; Py_XINCREF(closure); op->func_closure = closure; Py_XINCREF(module); op->func.m_module = module; op->func_dict = NULL; op->func_name = NULL; Py_INCREF(qualname); op->func_qualname = qualname; op->func_doc = NULL; op->func_classobj = NULL; op->func_globals = globals; Py_INCREF(op->func_globals); Py_XINCREF(code); op->func_code = code; op->defaults_pyobjects = 0; op->defaults = NULL; op->defaults_tuple = NULL; op->defaults_kwdict = NULL; op->defaults_getter = NULL; op->func_annotations = NULL; PyObject_GC_Track(op); return (PyObject *) op; } static int __Pyx_CyFunction_clear(__pyx_CyFunctionObject *m) { Py_CLEAR(m->func_closure); Py_CLEAR(m->func.m_module); Py_CLEAR(m->func_dict); Py_CLEAR(m->func_name); Py_CLEAR(m->func_qualname); Py_CLEAR(m->func_doc); Py_CLEAR(m->func_globals); Py_CLEAR(m->func_code); Py_CLEAR(m->func_classobj); Py_CLEAR(m->defaults_tuple); Py_CLEAR(m->defaults_kwdict); Py_CLEAR(m->func_annotations); if (m->defaults) { PyObject **pydefaults = __Pyx_CyFunction_Defaults(PyObject *, m); int i; for (i = 0; i < m->defaults_pyobjects; i++) Py_XDECREF(pydefaults[i]); PyMem_Free(m->defaults); m->defaults = NULL; } return 0; } static void __Pyx_CyFunction_dealloc(__pyx_CyFunctionObject *m) { PyObject_GC_UnTrack(m); if (__Pyx_CyFunction_weakreflist(m) != NULL) PyObject_ClearWeakRefs((PyObject *) m); __Pyx_CyFunction_clear(m); PyObject_GC_Del(m); } static int __Pyx_CyFunction_traverse(__pyx_CyFunctionObject *m, visitproc visit, void *arg) { Py_VISIT(m->func_closure); Py_VISIT(m->func.m_module); Py_VISIT(m->func_dict); Py_VISIT(m->func_name); Py_VISIT(m->func_qualname); Py_VISIT(m->func_doc); Py_VISIT(m->func_globals); Py_VISIT(m->func_code); Py_VISIT(m->func_classobj); Py_VISIT(m->defaults_tuple); Py_VISIT(m->defaults_kwdict); if (m->defaults) { PyObject **pydefaults = __Pyx_CyFunction_Defaults(PyObject *, m); int i; for (i = 0; i < m->defaults_pyobjects; i++) Py_VISIT(pydefaults[i]); } return 0; } static PyObject *__Pyx_CyFunction_descr_get(PyObject *func, PyObject *obj, PyObject *type) { __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func; if (m->flags & __Pyx_CYFUNCTION_STATICMETHOD) { Py_INCREF(func); return func; } if (m->flags & __Pyx_CYFUNCTION_CLASSMETHOD) { if (type == NULL) type = (PyObject *)(Py_TYPE(obj)); return __Pyx_PyMethod_New(func, type, (PyObject *)(Py_TYPE(type))); } if (obj == Py_None) obj = NULL; return __Pyx_PyMethod_New(func, obj, type); } static PyObject* __Pyx_CyFunction_repr(__pyx_CyFunctionObject *op) { #if PY_MAJOR_VERSION >= 3 return PyUnicode_FromFormat("", op->func_qualname, (void *)op); #else return PyString_FromFormat("", PyString_AsString(op->func_qualname), (void *)op); #endif } #if CYTHON_COMPILING_IN_PYPY static PyObject * __Pyx_CyFunction_Call(PyObject *func, PyObject *arg, PyObject *kw) { PyCFunctionObject* f = (PyCFunctionObject*)func; PyCFunction meth = f->m_ml->ml_meth; PyObject *self = f->m_self; Py_ssize_t size; switch (f->m_ml->ml_flags & (METH_VARARGS | METH_KEYWORDS | METH_NOARGS | METH_O)) { case METH_VARARGS: if (likely(kw == NULL || PyDict_Size(kw) == 0)) return (*meth)(self, arg); break; case METH_VARARGS | METH_KEYWORDS: return (*(PyCFunctionWithKeywords)meth)(self, arg, kw); case METH_NOARGS: if (likely(kw == NULL || PyDict_Size(kw) == 0)) { size = PyTuple_GET_SIZE(arg); if (likely(size == 0)) return (*meth)(self, NULL); PyErr_Format(PyExc_TypeError, "%.200s() takes no arguments (%" CYTHON_FORMAT_SSIZE_T "d given)", f->m_ml->ml_name, size); return NULL; } break; case METH_O: if (likely(kw == NULL || PyDict_Size(kw) == 0)) { size = PyTuple_GET_SIZE(arg); if (likely(size == 1)) { PyObject *result, *arg0 = PySequence_ITEM(arg, 0); if (unlikely(!arg0)) return NULL; result = (*meth)(self, arg0); Py_DECREF(arg0); return result; } PyErr_Format(PyExc_TypeError, "%.200s() takes exactly one argument (%" CYTHON_FORMAT_SSIZE_T "d given)", f->m_ml->ml_name, size); return NULL; } break; default: PyErr_SetString(PyExc_SystemError, "Bad call flags in " "__Pyx_CyFunction_Call. METH_OLDARGS is no " "longer supported!"); return NULL; } PyErr_Format(PyExc_TypeError, "%.200s() takes no keyword arguments", f->m_ml->ml_name); return NULL; } #else static PyObject * __Pyx_CyFunction_Call(PyObject *func, PyObject *arg, PyObject *kw) { return PyCFunction_Call(func, arg, kw); } #endif static PyTypeObject __pyx_CyFunctionType_type = { PyVarObject_HEAD_INIT(0, 0) "cython_function_or_method", sizeof(__pyx_CyFunctionObject), 0, (destructor) __Pyx_CyFunction_dealloc, 0, 0, 0, #if PY_MAJOR_VERSION < 3 0, #else 0, #endif (reprfunc) __Pyx_CyFunction_repr, 0, 0, 0, 0, __Pyx_CyFunction_Call, 0, 0, 0, 0, Py_TPFLAGS_DEFAULT | Py_TPFLAGS_HAVE_GC, 0, (traverseproc) __Pyx_CyFunction_traverse, (inquiry) __Pyx_CyFunction_clear, 0, #if PY_VERSION_HEX < 0x030500A0 offsetof(__pyx_CyFunctionObject, func_weakreflist), #else offsetof(PyCFunctionObject, m_weakreflist), #endif 0, 0, __pyx_CyFunction_methods, __pyx_CyFunction_members, __pyx_CyFunction_getsets, 0, 0, __Pyx_CyFunction_descr_get, 0, offsetof(__pyx_CyFunctionObject, func_dict), 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, #if PY_VERSION_HEX >= 0x030400a1 0, #endif }; static int __pyx_CyFunction_init(void) { #if !CYTHON_COMPILING_IN_PYPY __pyx_CyFunctionType_type.tp_call = PyCFunction_Call; #endif __pyx_CyFunctionType = __Pyx_FetchCommonType(&__pyx_CyFunctionType_type); if (__pyx_CyFunctionType == NULL) { return -1; } return 0; } static CYTHON_INLINE void *__Pyx_CyFunction_InitDefaults(PyObject *func, size_t size, int pyobjects) { __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func; m->defaults = PyMem_Malloc(size); if (!m->defaults) return PyErr_NoMemory(); memset(m->defaults, 0, size); m->defaults_pyobjects = pyobjects; return m->defaults; } static CYTHON_INLINE void __Pyx_CyFunction_SetDefaultsTuple(PyObject *func, PyObject *tuple) { __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func; m->defaults_tuple = tuple; Py_INCREF(tuple); } static CYTHON_INLINE void __Pyx_CyFunction_SetDefaultsKwDict(PyObject *func, PyObject *dict) { __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func; m->defaults_kwdict = dict; Py_INCREF(dict); } static CYTHON_INLINE void __Pyx_CyFunction_SetAnnotationsDict(PyObject *func, PyObject *dict) { __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func; m->func_annotations = dict; Py_INCREF(dict); } static PyObject *__Pyx_Py3MetaclassPrepare(PyObject *metaclass, PyObject *bases, PyObject *name, PyObject *qualname, PyObject *mkw, PyObject *modname, PyObject *doc) { PyObject *ns; if (metaclass) { PyObject *prep = __Pyx_PyObject_GetAttrStr(metaclass, __pyx_n_s_prepare); if (prep) { PyObject *pargs = PyTuple_Pack(2, name, bases); if (unlikely(!pargs)) { Py_DECREF(prep); return NULL; } ns = PyObject_Call(prep, pargs, mkw); Py_DECREF(prep); Py_DECREF(pargs); } else { if (unlikely(!PyErr_ExceptionMatches(PyExc_AttributeError))) return NULL; PyErr_Clear(); ns = PyDict_New(); } } else { ns = PyDict_New(); } if (unlikely(!ns)) return NULL; if (unlikely(PyObject_SetItem(ns, __pyx_n_s_module, modname) < 0)) goto bad; if (unlikely(PyObject_SetItem(ns, __pyx_n_s_qualname, qualname) < 0)) goto bad; if (unlikely(doc && PyObject_SetItem(ns, __pyx_n_s_doc, doc) < 0)) goto bad; return ns; bad: Py_DECREF(ns); return NULL; } static PyObject *__Pyx_Py3ClassCreate(PyObject *metaclass, PyObject *name, PyObject *bases, PyObject *dict, PyObject *mkw, int calculate_metaclass, int allow_py2_metaclass) { PyObject *result, *margs; PyObject *owned_metaclass = NULL; if (allow_py2_metaclass) { owned_metaclass = PyObject_GetItem(dict, __pyx_n_s_metaclass); if (owned_metaclass) { metaclass = owned_metaclass; } else if (likely(PyErr_ExceptionMatches(PyExc_KeyError))) { PyErr_Clear(); } else { return NULL; } } if (calculate_metaclass && (!metaclass || PyType_Check(metaclass))) { metaclass = __Pyx_CalculateMetaclass((PyTypeObject*) metaclass, bases); Py_XDECREF(owned_metaclass); if (unlikely(!metaclass)) return NULL; owned_metaclass = metaclass; } margs = PyTuple_Pack(3, name, bases, dict); if (unlikely(!margs)) { result = NULL; } else { result = PyObject_Call(metaclass, margs, mkw); Py_DECREF(margs); } Py_XDECREF(owned_metaclass); return result; } static int __pyx_bisect_code_objects(__Pyx_CodeObjectCacheEntry* entries, int count, int code_line) { int start = 0, mid = 0, end = count - 1; if (end >= 0 && code_line > entries[end].code_line) { return count; } while (start < end) { mid = start + (end - start) / 2; if (code_line < entries[mid].code_line) { end = mid; } else if (code_line > entries[mid].code_line) { start = mid + 1; } else { return mid; } } if (code_line <= entries[mid].code_line) { return mid; } else { return mid + 1; } } static PyCodeObject *__pyx_find_code_object(int code_line) { PyCodeObject* code_object; int pos; if (unlikely(!code_line) || unlikely(!__pyx_code_cache.entries)) { return NULL; } pos = __pyx_bisect_code_objects(__pyx_code_cache.entries, __pyx_code_cache.count, code_line); if (unlikely(pos >= __pyx_code_cache.count) || unlikely(__pyx_code_cache.entries[pos].code_line != code_line)) { return NULL; } code_object = __pyx_code_cache.entries[pos].code_object; Py_INCREF(code_object); return code_object; } static void __pyx_insert_code_object(int code_line, PyCodeObject* code_object) { int pos, i; __Pyx_CodeObjectCacheEntry* entries = __pyx_code_cache.entries; if (unlikely(!code_line)) { return; } if (unlikely(!entries)) { entries = (__Pyx_CodeObjectCacheEntry*)PyMem_Malloc(64*sizeof(__Pyx_CodeObjectCacheEntry)); if (likely(entries)) { __pyx_code_cache.entries = entries; __pyx_code_cache.max_count = 64; __pyx_code_cache.count = 1; entries[0].code_line = code_line; entries[0].code_object = code_object; Py_INCREF(code_object); } return; } pos = __pyx_bisect_code_objects(__pyx_code_cache.entries, __pyx_code_cache.count, code_line); if ((pos < __pyx_code_cache.count) && unlikely(__pyx_code_cache.entries[pos].code_line == code_line)) { PyCodeObject* tmp = entries[pos].code_object; entries[pos].code_object = code_object; Py_DECREF(tmp); return; } if (__pyx_code_cache.count == __pyx_code_cache.max_count) { int new_max = __pyx_code_cache.max_count + 64; entries = (__Pyx_CodeObjectCacheEntry*)PyMem_Realloc( __pyx_code_cache.entries, (size_t)new_max*sizeof(__Pyx_CodeObjectCacheEntry)); if (unlikely(!entries)) { return; } __pyx_code_cache.entries = entries; __pyx_code_cache.max_count = new_max; } for (i=__pyx_code_cache.count; i>pos; i--) { entries[i] = entries[i-1]; } entries[pos].code_line = code_line; entries[pos].code_object = code_object; __pyx_code_cache.count++; Py_INCREF(code_object); } #include "compile.h" #include "frameobject.h" #include "traceback.h" static PyCodeObject* __Pyx_CreateCodeObjectForTraceback( const char *funcname, int c_line, int py_line, const char *filename) { PyCodeObject *py_code = 0; PyObject *py_srcfile = 0; PyObject *py_funcname = 0; #if PY_MAJOR_VERSION < 3 py_srcfile = PyString_FromString(filename); #else py_srcfile = PyUnicode_FromString(filename); #endif if (!py_srcfile) goto bad; if (c_line) { #if PY_MAJOR_VERSION < 3 py_funcname = PyString_FromFormat( "%s (%s:%d)", funcname, __pyx_cfilenm, c_line); #else py_funcname = PyUnicode_FromFormat( "%s (%s:%d)", funcname, __pyx_cfilenm, c_line); #endif } else { #if PY_MAJOR_VERSION < 3 py_funcname = PyString_FromString(funcname); #else py_funcname = PyUnicode_FromString(funcname); #endif } if (!py_funcname) goto bad; py_code = __Pyx_PyCode_New( 0, 0, 0, 0, 0, __pyx_empty_bytes, /*PyObject *code,*/ __pyx_empty_tuple, /*PyObject *consts,*/ __pyx_empty_tuple, /*PyObject *names,*/ __pyx_empty_tuple, /*PyObject *varnames,*/ __pyx_empty_tuple, /*PyObject *freevars,*/ __pyx_empty_tuple, /*PyObject *cellvars,*/ py_srcfile, /*PyObject *filename,*/ py_funcname, /*PyObject *name,*/ py_line, __pyx_empty_bytes /*PyObject *lnotab*/ ); Py_DECREF(py_srcfile); Py_DECREF(py_funcname); return py_code; bad: Py_XDECREF(py_srcfile); Py_XDECREF(py_funcname); return NULL; } static void __Pyx_AddTraceback(const char *funcname, int c_line, int py_line, const char *filename) { PyCodeObject *py_code = 0; PyFrameObject *py_frame = 0; py_code = __pyx_find_code_object(c_line ? c_line : py_line); if (!py_code) { py_code = __Pyx_CreateCodeObjectForTraceback( funcname, c_line, py_line, filename); if (!py_code) goto bad; __pyx_insert_code_object(c_line ? c_line : py_line, py_code); } py_frame = PyFrame_New( PyThreadState_GET(), /*PyThreadState *tstate,*/ py_code, /*PyCodeObject *code,*/ __pyx_d, /*PyObject *globals,*/ 0 /*PyObject *locals*/ ); if (!py_frame) goto bad; py_frame->f_lineno = py_line; PyTraceBack_Here(py_frame); bad: Py_XDECREF(py_code); Py_XDECREF(py_frame); } static CYTHON_INLINE PyObject* __Pyx_PyInt_From_long(long value) { const long neg_one = (long) -1, const_zero = (long) 0; const int is_unsigned = neg_one > const_zero; if (is_unsigned) { if (sizeof(long) < sizeof(long)) { return PyInt_FromLong((long) value); } else if (sizeof(long) <= sizeof(unsigned long)) { return PyLong_FromUnsignedLong((unsigned long) value); } else if (sizeof(long) <= sizeof(unsigned PY_LONG_LONG)) { return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value); } } else { if (sizeof(long) <= sizeof(long)) { return PyInt_FromLong((long) value); } else if (sizeof(long) <= sizeof(PY_LONG_LONG)) { return PyLong_FromLongLong((PY_LONG_LONG) value); } } { int one = 1; int little = (int)*(unsigned char *)&one; unsigned char *bytes = (unsigned char *)&value; return _PyLong_FromByteArray(bytes, sizeof(long), little, !is_unsigned); } } static CYTHON_INLINE PyObject* __Pyx_PyInt_From_SDL_EventType(SDL_EventType value) { const SDL_EventType neg_one = (SDL_EventType) -1, const_zero = (SDL_EventType) 0; const int is_unsigned = neg_one > const_zero; if (is_unsigned) { if (sizeof(SDL_EventType) < sizeof(long)) { return PyInt_FromLong((long) value); } else if (sizeof(SDL_EventType) <= sizeof(unsigned long)) { return PyLong_FromUnsignedLong((unsigned long) value); } else if (sizeof(SDL_EventType) <= sizeof(unsigned PY_LONG_LONG)) { return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value); } } else { if (sizeof(SDL_EventType) <= sizeof(long)) { return PyInt_FromLong((long) value); } else if (sizeof(SDL_EventType) <= sizeof(PY_LONG_LONG)) { return PyLong_FromLongLong((PY_LONG_LONG) value); } } { int one = 1; int little = (int)*(unsigned char *)&one; unsigned char *bytes = (unsigned char *)&value; return _PyLong_FromByteArray(bytes, sizeof(SDL_EventType), little, !is_unsigned); } } static CYTHON_INLINE PyObject* __Pyx_PyInt_From_SDL_Scancode(SDL_Scancode value) { const SDL_Scancode neg_one = (SDL_Scancode) -1, const_zero = (SDL_Scancode) 0; const int is_unsigned = neg_one > const_zero; if (is_unsigned) { if (sizeof(SDL_Scancode) < sizeof(long)) { return PyInt_FromLong((long) value); } else if (sizeof(SDL_Scancode) <= sizeof(unsigned long)) { return PyLong_FromUnsignedLong((unsigned long) value); } else if (sizeof(SDL_Scancode) <= sizeof(unsigned PY_LONG_LONG)) { return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value); } } else { if (sizeof(SDL_Scancode) <= sizeof(long)) { return PyInt_FromLong((long) value); } else if (sizeof(SDL_Scancode) <= sizeof(PY_LONG_LONG)) { return PyLong_FromLongLong((PY_LONG_LONG) value); } } { int one = 1; int little = (int)*(unsigned char *)&one; unsigned char *bytes = (unsigned char *)&value; return _PyLong_FromByteArray(bytes, sizeof(SDL_Scancode), little, !is_unsigned); } } static CYTHON_INLINE PyObject* __Pyx_PyInt_From_int32_t(int32_t value) { const int32_t neg_one = (int32_t) -1, const_zero = (int32_t) 0; const int is_unsigned = neg_one > const_zero; if (is_unsigned) { if (sizeof(int32_t) < sizeof(long)) { return PyInt_FromLong((long) value); } else if (sizeof(int32_t) <= sizeof(unsigned long)) { return PyLong_FromUnsignedLong((unsigned long) value); } else if (sizeof(int32_t) <= sizeof(unsigned PY_LONG_LONG)) { return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value); } } else { if (sizeof(int32_t) <= sizeof(long)) { return PyInt_FromLong((long) value); } else if (sizeof(int32_t) <= sizeof(PY_LONG_LONG)) { return PyLong_FromLongLong((PY_LONG_LONG) value); } } { int one = 1; int little = (int)*(unsigned char *)&one; unsigned char *bytes = (unsigned char *)&value; return _PyLong_FromByteArray(bytes, sizeof(int32_t), little, !is_unsigned); } } static CYTHON_INLINE PyObject* __Pyx_PyInt_From_uint16_t(uint16_t value) { const uint16_t neg_one = (uint16_t) -1, const_zero = (uint16_t) 0; const int is_unsigned = neg_one > const_zero; if (is_unsigned) { if (sizeof(uint16_t) < sizeof(long)) { return PyInt_FromLong((long) value); } else if (sizeof(uint16_t) <= sizeof(unsigned long)) { return PyLong_FromUnsignedLong((unsigned long) value); } else if (sizeof(uint16_t) <= sizeof(unsigned PY_LONG_LONG)) { return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value); } } else { if (sizeof(uint16_t) <= sizeof(long)) { return PyInt_FromLong((long) value); } else if (sizeof(uint16_t) <= sizeof(PY_LONG_LONG)) { return PyLong_FromLongLong((PY_LONG_LONG) value); } } { int one = 1; int little = (int)*(unsigned char *)&one; unsigned char *bytes = (unsigned char *)&value; return _PyLong_FromByteArray(bytes, sizeof(uint16_t), little, !is_unsigned); } } static CYTHON_INLINE PyObject* __Pyx_PyInt_From_uint8_t(uint8_t value) { const uint8_t neg_one = (uint8_t) -1, const_zero = (uint8_t) 0; const int is_unsigned = neg_one > const_zero; if (is_unsigned) { if (sizeof(uint8_t) < sizeof(long)) { return PyInt_FromLong((long) value); } else if (sizeof(uint8_t) <= sizeof(unsigned long)) { return PyLong_FromUnsignedLong((unsigned long) value); } else if (sizeof(uint8_t) <= sizeof(unsigned PY_LONG_LONG)) { return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value); } } else { if (sizeof(uint8_t) <= sizeof(long)) { return PyInt_FromLong((long) value); } else if (sizeof(uint8_t) <= sizeof(PY_LONG_LONG)) { return PyLong_FromLongLong((PY_LONG_LONG) value); } } { int one = 1; int little = (int)*(unsigned char *)&one; unsigned char *bytes = (unsigned char *)&value; return _PyLong_FromByteArray(bytes, sizeof(uint8_t), little, !is_unsigned); } } static CYTHON_INLINE PyObject* __Pyx_PyInt_From_uint32_t(uint32_t value) { const uint32_t neg_one = (uint32_t) -1, const_zero = (uint32_t) 0; const int is_unsigned = neg_one > const_zero; if (is_unsigned) { if (sizeof(uint32_t) < sizeof(long)) { return PyInt_FromLong((long) value); } else if (sizeof(uint32_t) <= sizeof(unsigned long)) { return PyLong_FromUnsignedLong((unsigned long) value); } else if (sizeof(uint32_t) <= sizeof(unsigned PY_LONG_LONG)) { return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value); } } else { if (sizeof(uint32_t) <= sizeof(long)) { return PyInt_FromLong((long) value); } else if (sizeof(uint32_t) <= sizeof(PY_LONG_LONG)) { return PyLong_FromLongLong((PY_LONG_LONG) value); } } { int one = 1; int little = (int)*(unsigned char *)&one; unsigned char *bytes = (unsigned char *)&value; return _PyLong_FromByteArray(bytes, sizeof(uint32_t), little, !is_unsigned); } } static CYTHON_INLINE PyObject* __Pyx_PyInt_From_int(int value) { const int neg_one = (int) -1, const_zero = (int) 0; const int is_unsigned = neg_one > const_zero; if (is_unsigned) { if (sizeof(int) < sizeof(long)) { return PyInt_FromLong((long) value); } else if (sizeof(int) <= sizeof(unsigned long)) { return PyLong_FromUnsignedLong((unsigned long) value); } else if (sizeof(int) <= sizeof(unsigned PY_LONG_LONG)) { return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value); } } else { if (sizeof(int) <= sizeof(long)) { return PyInt_FromLong((long) value); } else if (sizeof(int) <= sizeof(PY_LONG_LONG)) { return PyLong_FromLongLong((PY_LONG_LONG) value); } } { int one = 1; int little = (int)*(unsigned char *)&one; unsigned char *bytes = (unsigned char *)&value; return _PyLong_FromByteArray(bytes, sizeof(int), little, !is_unsigned); } } static CYTHON_INLINE PyObject* __Pyx_PyInt_From_int16_t(int16_t value) { const int16_t neg_one = (int16_t) -1, const_zero = (int16_t) 0; const int is_unsigned = neg_one > const_zero; if (is_unsigned) { if (sizeof(int16_t) < sizeof(long)) { return PyInt_FromLong((long) value); } else if (sizeof(int16_t) <= sizeof(unsigned long)) { return PyLong_FromUnsignedLong((unsigned long) value); } else if (sizeof(int16_t) <= sizeof(unsigned PY_LONG_LONG)) { return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value); } } else { if (sizeof(int16_t) <= sizeof(long)) { return PyInt_FromLong((long) value); } else if (sizeof(int16_t) <= sizeof(PY_LONG_LONG)) { return PyLong_FromLongLong((PY_LONG_LONG) value); } } { int one = 1; int little = (int)*(unsigned char *)&one; unsigned char *bytes = (unsigned char *)&value; return _PyLong_FromByteArray(bytes, sizeof(int16_t), little, !is_unsigned); } } static CYTHON_INLINE PyObject* __Pyx_PyInt_From_int64_t(int64_t value) { const int64_t neg_one = (int64_t) -1, const_zero = (int64_t) 0; const int is_unsigned = neg_one > const_zero; if (is_unsigned) { if (sizeof(int64_t) < sizeof(long)) { return PyInt_FromLong((long) value); } else if (sizeof(int64_t) <= sizeof(unsigned long)) { return PyLong_FromUnsignedLong((unsigned long) value); } else if (sizeof(int64_t) <= sizeof(unsigned PY_LONG_LONG)) { return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value); } } else { if (sizeof(int64_t) <= sizeof(long)) { return PyInt_FromLong((long) value); } else if (sizeof(int64_t) <= sizeof(PY_LONG_LONG)) { return PyLong_FromLongLong((PY_LONG_LONG) value); } } { int one = 1; int little = (int)*(unsigned char *)&one; unsigned char *bytes = (unsigned char *)&value; return _PyLong_FromByteArray(bytes, sizeof(int64_t), little, !is_unsigned); } } #define __PYX_VERIFY_RETURN_INT(target_type, func_type, func_value)\ __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, 0) #define __PYX_VERIFY_RETURN_INT_EXC(target_type, func_type, func_value)\ __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, 1) #define __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, exc)\ {\ func_type value = func_value;\ if (sizeof(target_type) < sizeof(func_type)) {\ if (unlikely(value != (func_type) (target_type) value)) {\ func_type zero = 0;\ if (exc && unlikely(value == (func_type)-1 && PyErr_Occurred()))\ return (target_type) -1;\ if (is_unsigned && unlikely(value < zero))\ goto raise_neg_overflow;\ else\ goto raise_overflow;\ }\ }\ return (target_type) value;\ } static CYTHON_INLINE uint32_t __Pyx_PyInt_As_uint32_t(PyObject *x) { const uint32_t neg_one = (uint32_t) -1, const_zero = (uint32_t) 0; const int is_unsigned = neg_one > const_zero; #if PY_MAJOR_VERSION < 3 if (likely(PyInt_Check(x))) { if (sizeof(uint32_t) < sizeof(long)) { __PYX_VERIFY_RETURN_INT(uint32_t, long, PyInt_AS_LONG(x)) } else { long val = PyInt_AS_LONG(x); if (is_unsigned && unlikely(val < 0)) { goto raise_neg_overflow; } return (uint32_t) val; } } else #endif if (likely(PyLong_Check(x))) { if (is_unsigned) { #if CYTHON_USE_PYLONG_INTERNALS const digit* digits = ((PyLongObject*)x)->ob_digit; switch (Py_SIZE(x)) { case 0: return (uint32_t) 0; case 1: __PYX_VERIFY_RETURN_INT(uint32_t, digit, digits[0]) case 2: if (8 * sizeof(uint32_t) > 1 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(uint32_t, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(uint32_t) >= 2 * PyLong_SHIFT) { return (uint32_t) (((((uint32_t)digits[1]) << PyLong_SHIFT) | (uint32_t)digits[0])); } } break; case 3: if (8 * sizeof(uint32_t) > 2 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(uint32_t, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(uint32_t) >= 3 * PyLong_SHIFT) { return (uint32_t) (((((((uint32_t)digits[2]) << PyLong_SHIFT) | (uint32_t)digits[1]) << PyLong_SHIFT) | (uint32_t)digits[0])); } } break; case 4: if (8 * sizeof(uint32_t) > 3 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(uint32_t, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(uint32_t) >= 4 * PyLong_SHIFT) { return (uint32_t) (((((((((uint32_t)digits[3]) << PyLong_SHIFT) | (uint32_t)digits[2]) << PyLong_SHIFT) | (uint32_t)digits[1]) << PyLong_SHIFT) | (uint32_t)digits[0])); } } break; } #endif #if CYTHON_COMPILING_IN_CPYTHON if (unlikely(Py_SIZE(x) < 0)) { goto raise_neg_overflow; } #else { int result = PyObject_RichCompareBool(x, Py_False, Py_LT); if (unlikely(result < 0)) return (uint32_t) -1; if (unlikely(result == 1)) goto raise_neg_overflow; } #endif if (sizeof(uint32_t) <= sizeof(unsigned long)) { __PYX_VERIFY_RETURN_INT_EXC(uint32_t, unsigned long, PyLong_AsUnsignedLong(x)) } else if (sizeof(uint32_t) <= sizeof(unsigned PY_LONG_LONG)) { __PYX_VERIFY_RETURN_INT_EXC(uint32_t, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x)) } } else { #if CYTHON_USE_PYLONG_INTERNALS const digit* digits = ((PyLongObject*)x)->ob_digit; switch (Py_SIZE(x)) { case 0: return (uint32_t) 0; case -1: __PYX_VERIFY_RETURN_INT(uint32_t, sdigit, (sdigit) (-(sdigit)digits[0])) case 1: __PYX_VERIFY_RETURN_INT(uint32_t, digit, +digits[0]) case -2: if (8 * sizeof(uint32_t) - 1 > 1 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(uint32_t, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(uint32_t) - 1 > 2 * PyLong_SHIFT) { return (uint32_t) (((uint32_t)-1)*(((((uint32_t)digits[1]) << PyLong_SHIFT) | (uint32_t)digits[0]))); } } break; case 2: if (8 * sizeof(uint32_t) > 1 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(uint32_t, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(uint32_t) - 1 > 2 * PyLong_SHIFT) { return (uint32_t) ((((((uint32_t)digits[1]) << PyLong_SHIFT) | (uint32_t)digits[0]))); } } break; case -3: if (8 * sizeof(uint32_t) - 1 > 2 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(uint32_t, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(uint32_t) - 1 > 3 * PyLong_SHIFT) { return (uint32_t) (((uint32_t)-1)*(((((((uint32_t)digits[2]) << PyLong_SHIFT) | (uint32_t)digits[1]) << PyLong_SHIFT) | (uint32_t)digits[0]))); } } break; case 3: if (8 * sizeof(uint32_t) > 2 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(uint32_t, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(uint32_t) - 1 > 3 * PyLong_SHIFT) { return (uint32_t) ((((((((uint32_t)digits[2]) << PyLong_SHIFT) | (uint32_t)digits[1]) << PyLong_SHIFT) | (uint32_t)digits[0]))); } } break; case -4: if (8 * sizeof(uint32_t) - 1 > 3 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(uint32_t, long, -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(uint32_t) - 1 > 4 * PyLong_SHIFT) { return (uint32_t) (((uint32_t)-1)*(((((((((uint32_t)digits[3]) << PyLong_SHIFT) | (uint32_t)digits[2]) << PyLong_SHIFT) | (uint32_t)digits[1]) << PyLong_SHIFT) | (uint32_t)digits[0]))); } } break; case 4: if (8 * sizeof(uint32_t) > 3 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(uint32_t, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(uint32_t) - 1 > 4 * PyLong_SHIFT) { return (uint32_t) ((((((((((uint32_t)digits[3]) << PyLong_SHIFT) | (uint32_t)digits[2]) << PyLong_SHIFT) | (uint32_t)digits[1]) << PyLong_SHIFT) | (uint32_t)digits[0]))); } } break; } #endif if (sizeof(uint32_t) <= sizeof(long)) { __PYX_VERIFY_RETURN_INT_EXC(uint32_t, long, PyLong_AsLong(x)) } else if (sizeof(uint32_t) <= sizeof(PY_LONG_LONG)) { __PYX_VERIFY_RETURN_INT_EXC(uint32_t, PY_LONG_LONG, PyLong_AsLongLong(x)) } } { #if CYTHON_COMPILING_IN_PYPY && !defined(_PyLong_AsByteArray) PyErr_SetString(PyExc_RuntimeError, "_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers"); #else uint32_t val; PyObject *v = __Pyx_PyNumber_Int(x); #if PY_MAJOR_VERSION < 3 if (likely(v) && !PyLong_Check(v)) { PyObject *tmp = v; v = PyNumber_Long(tmp); Py_DECREF(tmp); } #endif if (likely(v)) { int one = 1; int is_little = (int)*(unsigned char *)&one; unsigned char *bytes = (unsigned char *)&val; int ret = _PyLong_AsByteArray((PyLongObject *)v, bytes, sizeof(val), is_little, !is_unsigned); Py_DECREF(v); if (likely(!ret)) return val; } #endif return (uint32_t) -1; } } else { uint32_t val; PyObject *tmp = __Pyx_PyNumber_Int(x); if (!tmp) return (uint32_t) -1; val = __Pyx_PyInt_As_uint32_t(tmp); Py_DECREF(tmp); return val; } raise_overflow: PyErr_SetString(PyExc_OverflowError, "value too large to convert to uint32_t"); return (uint32_t) -1; raise_neg_overflow: PyErr_SetString(PyExc_OverflowError, "can't convert negative value to uint32_t"); return (uint32_t) -1; } static CYTHON_INLINE SDL_bool __Pyx_PyInt_As_SDL_bool(PyObject *x) { const SDL_bool neg_one = (SDL_bool) -1, const_zero = (SDL_bool) 0; const int is_unsigned = neg_one > const_zero; #if PY_MAJOR_VERSION < 3 if (likely(PyInt_Check(x))) { if (sizeof(SDL_bool) < sizeof(long)) { __PYX_VERIFY_RETURN_INT(SDL_bool, long, PyInt_AS_LONG(x)) } else { long val = PyInt_AS_LONG(x); if (is_unsigned && unlikely(val < 0)) { goto raise_neg_overflow; } return (SDL_bool) val; } } else #endif if (likely(PyLong_Check(x))) { if (is_unsigned) { #if CYTHON_USE_PYLONG_INTERNALS const digit* digits = ((PyLongObject*)x)->ob_digit; switch (Py_SIZE(x)) { case 0: return (SDL_bool) 0; case 1: __PYX_VERIFY_RETURN_INT(SDL_bool, digit, digits[0]) case 2: if (8 * sizeof(SDL_bool) > 1 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(SDL_bool, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(SDL_bool) >= 2 * PyLong_SHIFT) { return (SDL_bool) (((((SDL_bool)digits[1]) << PyLong_SHIFT) | (SDL_bool)digits[0])); } } break; case 3: if (8 * sizeof(SDL_bool) > 2 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(SDL_bool, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(SDL_bool) >= 3 * PyLong_SHIFT) { return (SDL_bool) (((((((SDL_bool)digits[2]) << PyLong_SHIFT) | (SDL_bool)digits[1]) << PyLong_SHIFT) | (SDL_bool)digits[0])); } } break; case 4: if (8 * sizeof(SDL_bool) > 3 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(SDL_bool, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(SDL_bool) >= 4 * PyLong_SHIFT) { return (SDL_bool) (((((((((SDL_bool)digits[3]) << PyLong_SHIFT) | (SDL_bool)digits[2]) << PyLong_SHIFT) | (SDL_bool)digits[1]) << PyLong_SHIFT) | (SDL_bool)digits[0])); } } break; } #endif #if CYTHON_COMPILING_IN_CPYTHON if (unlikely(Py_SIZE(x) < 0)) { goto raise_neg_overflow; } #else { int result = PyObject_RichCompareBool(x, Py_False, Py_LT); if (unlikely(result < 0)) return (SDL_bool) -1; if (unlikely(result == 1)) goto raise_neg_overflow; } #endif if (sizeof(SDL_bool) <= sizeof(unsigned long)) { __PYX_VERIFY_RETURN_INT_EXC(SDL_bool, unsigned long, PyLong_AsUnsignedLong(x)) } else if (sizeof(SDL_bool) <= sizeof(unsigned PY_LONG_LONG)) { __PYX_VERIFY_RETURN_INT_EXC(SDL_bool, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x)) } } else { #if CYTHON_USE_PYLONG_INTERNALS const digit* digits = ((PyLongObject*)x)->ob_digit; switch (Py_SIZE(x)) { case 0: return (SDL_bool) 0; case -1: __PYX_VERIFY_RETURN_INT(SDL_bool, sdigit, (sdigit) (-(sdigit)digits[0])) case 1: __PYX_VERIFY_RETURN_INT(SDL_bool, digit, +digits[0]) case -2: if (8 * sizeof(SDL_bool) - 1 > 1 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(SDL_bool, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(SDL_bool) - 1 > 2 * PyLong_SHIFT) { return (SDL_bool) (((SDL_bool)-1)*(((((SDL_bool)digits[1]) << PyLong_SHIFT) | (SDL_bool)digits[0]))); } } break; case 2: if (8 * sizeof(SDL_bool) > 1 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(SDL_bool, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(SDL_bool) - 1 > 2 * PyLong_SHIFT) { return (SDL_bool) ((((((SDL_bool)digits[1]) << PyLong_SHIFT) | (SDL_bool)digits[0]))); } } break; case -3: if (8 * sizeof(SDL_bool) - 1 > 2 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(SDL_bool, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(SDL_bool) - 1 > 3 * PyLong_SHIFT) { return (SDL_bool) (((SDL_bool)-1)*(((((((SDL_bool)digits[2]) << PyLong_SHIFT) | (SDL_bool)digits[1]) << PyLong_SHIFT) | (SDL_bool)digits[0]))); } } break; case 3: if (8 * sizeof(SDL_bool) > 2 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(SDL_bool, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(SDL_bool) - 1 > 3 * PyLong_SHIFT) { return (SDL_bool) ((((((((SDL_bool)digits[2]) << PyLong_SHIFT) | (SDL_bool)digits[1]) << PyLong_SHIFT) | (SDL_bool)digits[0]))); } } break; case -4: if (8 * sizeof(SDL_bool) - 1 > 3 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(SDL_bool, long, -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(SDL_bool) - 1 > 4 * PyLong_SHIFT) { return (SDL_bool) (((SDL_bool)-1)*(((((((((SDL_bool)digits[3]) << PyLong_SHIFT) | (SDL_bool)digits[2]) << PyLong_SHIFT) | (SDL_bool)digits[1]) << PyLong_SHIFT) | (SDL_bool)digits[0]))); } } break; case 4: if (8 * sizeof(SDL_bool) > 3 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(SDL_bool, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(SDL_bool) - 1 > 4 * PyLong_SHIFT) { return (SDL_bool) ((((((((((SDL_bool)digits[3]) << PyLong_SHIFT) | (SDL_bool)digits[2]) << PyLong_SHIFT) | (SDL_bool)digits[1]) << PyLong_SHIFT) | (SDL_bool)digits[0]))); } } break; } #endif if (sizeof(SDL_bool) <= sizeof(long)) { __PYX_VERIFY_RETURN_INT_EXC(SDL_bool, long, PyLong_AsLong(x)) } else if (sizeof(SDL_bool) <= sizeof(PY_LONG_LONG)) { __PYX_VERIFY_RETURN_INT_EXC(SDL_bool, PY_LONG_LONG, PyLong_AsLongLong(x)) } } { #if CYTHON_COMPILING_IN_PYPY && !defined(_PyLong_AsByteArray) PyErr_SetString(PyExc_RuntimeError, "_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers"); #else SDL_bool val; PyObject *v = __Pyx_PyNumber_Int(x); #if PY_MAJOR_VERSION < 3 if (likely(v) && !PyLong_Check(v)) { PyObject *tmp = v; v = PyNumber_Long(tmp); Py_DECREF(tmp); } #endif if (likely(v)) { int one = 1; int is_little = (int)*(unsigned char *)&one; unsigned char *bytes = (unsigned char *)&val; int ret = _PyLong_AsByteArray((PyLongObject *)v, bytes, sizeof(val), is_little, !is_unsigned); Py_DECREF(v); if (likely(!ret)) return val; } #endif return (SDL_bool) -1; } } else { SDL_bool val; PyObject *tmp = __Pyx_PyNumber_Int(x); if (!tmp) return (SDL_bool) -1; val = __Pyx_PyInt_As_SDL_bool(tmp); Py_DECREF(tmp); return val; } raise_overflow: PyErr_SetString(PyExc_OverflowError, "value too large to convert to SDL_bool"); return (SDL_bool) -1; raise_neg_overflow: PyErr_SetString(PyExc_OverflowError, "can't convert negative value to SDL_bool"); return (SDL_bool) -1; } static CYTHON_INLINE PyObject* __Pyx_PyInt_From_SDL_bool(SDL_bool value) { const SDL_bool neg_one = (SDL_bool) -1, const_zero = (SDL_bool) 0; const int is_unsigned = neg_one > const_zero; if (is_unsigned) { if (sizeof(SDL_bool) < sizeof(long)) { return PyInt_FromLong((long) value); } else if (sizeof(SDL_bool) <= sizeof(unsigned long)) { return PyLong_FromUnsignedLong((unsigned long) value); } else if (sizeof(SDL_bool) <= sizeof(unsigned PY_LONG_LONG)) { return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value); } } else { if (sizeof(SDL_bool) <= sizeof(long)) { return PyInt_FromLong((long) value); } else if (sizeof(SDL_bool) <= sizeof(PY_LONG_LONG)) { return PyLong_FromLongLong((PY_LONG_LONG) value); } } { int one = 1; int little = (int)*(unsigned char *)&one; unsigned char *bytes = (unsigned char *)&value; return _PyLong_FromByteArray(bytes, sizeof(SDL_bool), little, !is_unsigned); } } static CYTHON_INLINE long __Pyx_PyInt_As_long(PyObject *x) { const long neg_one = (long) -1, const_zero = (long) 0; const int is_unsigned = neg_one > const_zero; #if PY_MAJOR_VERSION < 3 if (likely(PyInt_Check(x))) { if (sizeof(long) < sizeof(long)) { __PYX_VERIFY_RETURN_INT(long, long, PyInt_AS_LONG(x)) } else { long val = PyInt_AS_LONG(x); if (is_unsigned && unlikely(val < 0)) { goto raise_neg_overflow; } return (long) val; } } else #endif if (likely(PyLong_Check(x))) { if (is_unsigned) { #if CYTHON_USE_PYLONG_INTERNALS const digit* digits = ((PyLongObject*)x)->ob_digit; switch (Py_SIZE(x)) { case 0: return (long) 0; case 1: __PYX_VERIFY_RETURN_INT(long, digit, digits[0]) case 2: if (8 * sizeof(long) > 1 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(long) >= 2 * PyLong_SHIFT) { return (long) (((((long)digits[1]) << PyLong_SHIFT) | (long)digits[0])); } } break; case 3: if (8 * sizeof(long) > 2 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(long) >= 3 * PyLong_SHIFT) { return (long) (((((((long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0])); } } break; case 4: if (8 * sizeof(long) > 3 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(long) >= 4 * PyLong_SHIFT) { return (long) (((((((((long)digits[3]) << PyLong_SHIFT) | (long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0])); } } break; } #endif #if CYTHON_COMPILING_IN_CPYTHON if (unlikely(Py_SIZE(x) < 0)) { goto raise_neg_overflow; } #else { int result = PyObject_RichCompareBool(x, Py_False, Py_LT); if (unlikely(result < 0)) return (long) -1; if (unlikely(result == 1)) goto raise_neg_overflow; } #endif if (sizeof(long) <= sizeof(unsigned long)) { __PYX_VERIFY_RETURN_INT_EXC(long, unsigned long, PyLong_AsUnsignedLong(x)) } else if (sizeof(long) <= sizeof(unsigned PY_LONG_LONG)) { __PYX_VERIFY_RETURN_INT_EXC(long, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x)) } } else { #if CYTHON_USE_PYLONG_INTERNALS const digit* digits = ((PyLongObject*)x)->ob_digit; switch (Py_SIZE(x)) { case 0: return (long) 0; case -1: __PYX_VERIFY_RETURN_INT(long, sdigit, (sdigit) (-(sdigit)digits[0])) case 1: __PYX_VERIFY_RETURN_INT(long, digit, +digits[0]) case -2: if (8 * sizeof(long) - 1 > 1 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(long, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) { return (long) (((long)-1)*(((((long)digits[1]) << PyLong_SHIFT) | (long)digits[0]))); } } break; case 2: if (8 * sizeof(long) > 1 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) { return (long) ((((((long)digits[1]) << PyLong_SHIFT) | (long)digits[0]))); } } break; case -3: if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(long, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) { return (long) (((long)-1)*(((((((long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0]))); } } break; case 3: if (8 * sizeof(long) > 2 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) { return (long) ((((((((long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0]))); } } break; case -4: if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(long, long, -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(long) - 1 > 4 * PyLong_SHIFT) { return (long) (((long)-1)*(((((((((long)digits[3]) << PyLong_SHIFT) | (long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0]))); } } break; case 4: if (8 * sizeof(long) > 3 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(long) - 1 > 4 * PyLong_SHIFT) { return (long) ((((((((((long)digits[3]) << PyLong_SHIFT) | (long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0]))); } } break; } #endif if (sizeof(long) <= sizeof(long)) { __PYX_VERIFY_RETURN_INT_EXC(long, long, PyLong_AsLong(x)) } else if (sizeof(long) <= sizeof(PY_LONG_LONG)) { __PYX_VERIFY_RETURN_INT_EXC(long, PY_LONG_LONG, PyLong_AsLongLong(x)) } } { #if CYTHON_COMPILING_IN_PYPY && !defined(_PyLong_AsByteArray) PyErr_SetString(PyExc_RuntimeError, "_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers"); #else long val; PyObject *v = __Pyx_PyNumber_Int(x); #if PY_MAJOR_VERSION < 3 if (likely(v) && !PyLong_Check(v)) { PyObject *tmp = v; v = PyNumber_Long(tmp); Py_DECREF(tmp); } #endif if (likely(v)) { int one = 1; int is_little = (int)*(unsigned char *)&one; unsigned char *bytes = (unsigned char *)&val; int ret = _PyLong_AsByteArray((PyLongObject *)v, bytes, sizeof(val), is_little, !is_unsigned); Py_DECREF(v); if (likely(!ret)) return val; } #endif return (long) -1; } } else { long val; PyObject *tmp = __Pyx_PyNumber_Int(x); if (!tmp) return (long) -1; val = __Pyx_PyInt_As_long(tmp); Py_DECREF(tmp); return val; } raise_overflow: PyErr_SetString(PyExc_OverflowError, "value too large to convert to long"); return (long) -1; raise_neg_overflow: PyErr_SetString(PyExc_OverflowError, "can't convert negative value to long"); return (long) -1; } static CYTHON_INLINE int __Pyx_PyInt_As_int(PyObject *x) { const int neg_one = (int) -1, const_zero = (int) 0; const int is_unsigned = neg_one > const_zero; #if PY_MAJOR_VERSION < 3 if (likely(PyInt_Check(x))) { if (sizeof(int) < sizeof(long)) { __PYX_VERIFY_RETURN_INT(int, long, PyInt_AS_LONG(x)) } else { long val = PyInt_AS_LONG(x); if (is_unsigned && unlikely(val < 0)) { goto raise_neg_overflow; } return (int) val; } } else #endif if (likely(PyLong_Check(x))) { if (is_unsigned) { #if CYTHON_USE_PYLONG_INTERNALS const digit* digits = ((PyLongObject*)x)->ob_digit; switch (Py_SIZE(x)) { case 0: return (int) 0; case 1: __PYX_VERIFY_RETURN_INT(int, digit, digits[0]) case 2: if (8 * sizeof(int) > 1 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(int) >= 2 * PyLong_SHIFT) { return (int) (((((int)digits[1]) << PyLong_SHIFT) | (int)digits[0])); } } break; case 3: if (8 * sizeof(int) > 2 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(int) >= 3 * PyLong_SHIFT) { return (int) (((((((int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0])); } } break; case 4: if (8 * sizeof(int) > 3 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(int) >= 4 * PyLong_SHIFT) { return (int) (((((((((int)digits[3]) << PyLong_SHIFT) | (int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0])); } } break; } #endif #if CYTHON_COMPILING_IN_CPYTHON if (unlikely(Py_SIZE(x) < 0)) { goto raise_neg_overflow; } #else { int result = PyObject_RichCompareBool(x, Py_False, Py_LT); if (unlikely(result < 0)) return (int) -1; if (unlikely(result == 1)) goto raise_neg_overflow; } #endif if (sizeof(int) <= sizeof(unsigned long)) { __PYX_VERIFY_RETURN_INT_EXC(int, unsigned long, PyLong_AsUnsignedLong(x)) } else if (sizeof(int) <= sizeof(unsigned PY_LONG_LONG)) { __PYX_VERIFY_RETURN_INT_EXC(int, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x)) } } else { #if CYTHON_USE_PYLONG_INTERNALS const digit* digits = ((PyLongObject*)x)->ob_digit; switch (Py_SIZE(x)) { case 0: return (int) 0; case -1: __PYX_VERIFY_RETURN_INT(int, sdigit, (sdigit) (-(sdigit)digits[0])) case 1: __PYX_VERIFY_RETURN_INT(int, digit, +digits[0]) case -2: if (8 * sizeof(int) - 1 > 1 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(int, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(int) - 1 > 2 * PyLong_SHIFT) { return (int) (((int)-1)*(((((int)digits[1]) << PyLong_SHIFT) | (int)digits[0]))); } } break; case 2: if (8 * sizeof(int) > 1 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(int) - 1 > 2 * PyLong_SHIFT) { return (int) ((((((int)digits[1]) << PyLong_SHIFT) | (int)digits[0]))); } } break; case -3: if (8 * sizeof(int) - 1 > 2 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(int, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(int) - 1 > 3 * PyLong_SHIFT) { return (int) (((int)-1)*(((((((int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0]))); } } break; case 3: if (8 * sizeof(int) > 2 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(int) - 1 > 3 * PyLong_SHIFT) { return (int) ((((((((int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0]))); } } break; case -4: if (8 * sizeof(int) - 1 > 3 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(int, long, -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(int) - 1 > 4 * PyLong_SHIFT) { return (int) (((int)-1)*(((((((((int)digits[3]) << PyLong_SHIFT) | (int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0]))); } } break; case 4: if (8 * sizeof(int) > 3 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(int) - 1 > 4 * PyLong_SHIFT) { return (int) ((((((((((int)digits[3]) << PyLong_SHIFT) | (int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0]))); } } break; } #endif if (sizeof(int) <= sizeof(long)) { __PYX_VERIFY_RETURN_INT_EXC(int, long, PyLong_AsLong(x)) } else if (sizeof(int) <= sizeof(PY_LONG_LONG)) { __PYX_VERIFY_RETURN_INT_EXC(int, PY_LONG_LONG, PyLong_AsLongLong(x)) } } { #if CYTHON_COMPILING_IN_PYPY && !defined(_PyLong_AsByteArray) PyErr_SetString(PyExc_RuntimeError, "_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers"); #else int val; PyObject *v = __Pyx_PyNumber_Int(x); #if PY_MAJOR_VERSION < 3 if (likely(v) && !PyLong_Check(v)) { PyObject *tmp = v; v = PyNumber_Long(tmp); Py_DECREF(tmp); } #endif if (likely(v)) { int one = 1; int is_little = (int)*(unsigned char *)&one; unsigned char *bytes = (unsigned char *)&val; int ret = _PyLong_AsByteArray((PyLongObject *)v, bytes, sizeof(val), is_little, !is_unsigned); Py_DECREF(v); if (likely(!ret)) return val; } #endif return (int) -1; } } else { int val; PyObject *tmp = __Pyx_PyNumber_Int(x); if (!tmp) return (int) -1; val = __Pyx_PyInt_As_int(tmp); Py_DECREF(tmp); return val; } raise_overflow: PyErr_SetString(PyExc_OverflowError, "value too large to convert to int"); return (int) -1; raise_neg_overflow: PyErr_SetString(PyExc_OverflowError, "can't convert negative value to int"); return (int) -1; } static int __Pyx_check_binary_version(void) { char ctversion[4], rtversion[4]; PyOS_snprintf(ctversion, 4, "%d.%d", PY_MAJOR_VERSION, PY_MINOR_VERSION); PyOS_snprintf(rtversion, 4, "%s", Py_GetVersion()); if (ctversion[0] != rtversion[0] || ctversion[2] != rtversion[2]) { char message[200]; PyOS_snprintf(message, sizeof(message), "compiletime version %s of module '%.100s' " "does not match runtime version %s", ctversion, __Pyx_MODULE_NAME, rtversion); return PyErr_WarnEx(NULL, message, 1); } return 0; } #ifndef __PYX_HAVE_RT_ImportModule #define __PYX_HAVE_RT_ImportModule static PyObject *__Pyx_ImportModule(const char *name) { PyObject *py_name = 0; PyObject *py_module = 0; py_name = __Pyx_PyIdentifier_FromString(name); if (!py_name) goto bad; py_module = PyImport_Import(py_name); Py_DECREF(py_name); return py_module; bad: Py_XDECREF(py_name); return 0; } #endif #ifndef __PYX_HAVE_RT_ImportType #define __PYX_HAVE_RT_ImportType static PyTypeObject *__Pyx_ImportType(const char *module_name, const char *class_name, size_t size, int strict) { PyObject *py_module = 0; PyObject *result = 0; PyObject *py_name = 0; char warning[200]; Py_ssize_t basicsize; #ifdef Py_LIMITED_API PyObject *py_basicsize; #endif py_module = __Pyx_ImportModule(module_name); if (!py_module) goto bad; py_name = __Pyx_PyIdentifier_FromString(class_name); if (!py_name) goto bad; result = PyObject_GetAttr(py_module, py_name); Py_DECREF(py_name); py_name = 0; Py_DECREF(py_module); py_module = 0; if (!result) goto bad; if (!PyType_Check(result)) { PyErr_Format(PyExc_TypeError, "%.200s.%.200s is not a type object", module_name, class_name); goto bad; } #ifndef Py_LIMITED_API basicsize = ((PyTypeObject *)result)->tp_basicsize; #else py_basicsize = PyObject_GetAttrString(result, "__basicsize__"); if (!py_basicsize) goto bad; basicsize = PyLong_AsSsize_t(py_basicsize); Py_DECREF(py_basicsize); py_basicsize = 0; if (basicsize == (Py_ssize_t)-1 && PyErr_Occurred()) goto bad; #endif if (!strict && (size_t)basicsize > size) { PyOS_snprintf(warning, sizeof(warning), "%s.%s size changed, may indicate binary incompatibility", module_name, class_name); if (PyErr_WarnEx(NULL, warning, 0) < 0) goto bad; } else if ((size_t)basicsize != size) { PyErr_Format(PyExc_ValueError, "%.200s.%.200s has the wrong size, try recompiling", module_name, class_name); goto bad; } return (PyTypeObject *)result; bad: Py_XDECREF(py_module); Py_XDECREF(result); return NULL; } #endif #ifndef __PYX_HAVE_RT_ImportVoidPtr #define __PYX_HAVE_RT_ImportVoidPtr static int __Pyx_ImportVoidPtr(PyObject *module, const char *name, void **p, const char *sig) { PyObject *d = 0; PyObject *cobj = 0; d = PyObject_GetAttrString(module, (char *)"__pyx_capi__"); if (!d) goto bad; cobj = PyDict_GetItemString(d, name); if (!cobj) { PyErr_Format(PyExc_ImportError, "%.200s does not export expected C variable %.200s", PyModule_GetName(module), name); goto bad; } #if PY_VERSION_HEX >= 0x02070000 if (!PyCapsule_IsValid(cobj, sig)) { PyErr_Format(PyExc_TypeError, "C variable %.200s.%.200s has wrong signature (expected %.500s, got %.500s)", PyModule_GetName(module), name, sig, PyCapsule_GetName(cobj)); goto bad; } *p = PyCapsule_GetPointer(cobj, sig); #else {const char *desc, *s1, *s2; desc = (const char *)PyCObject_GetDesc(cobj); if (!desc) goto bad; s1 = desc; s2 = sig; while (*s1 != '\0' && *s1 == *s2) { s1++; s2++; } if (*s1 != *s2) { PyErr_Format(PyExc_TypeError, "C variable %.200s.%.200s has wrong signature (expected %.500s, got %.500s)", PyModule_GetName(module), name, sig, desc); goto bad; } *p = PyCObject_AsVoidPtr(cobj);} #endif if (!(*p)) goto bad; Py_DECREF(d); return 0; bad: Py_XDECREF(d); return -1; } #endif static int __Pyx_InitStrings(__Pyx_StringTabEntry *t) { while (t->p) { #if PY_MAJOR_VERSION < 3 if (t->is_unicode) { *t->p = PyUnicode_DecodeUTF8(t->s, t->n - 1, NULL); } else if (t->intern) { *t->p = PyString_InternFromString(t->s); } else { *t->p = PyString_FromStringAndSize(t->s, t->n - 1); } #else if (t->is_unicode | t->is_str) { if (t->intern) { *t->p = PyUnicode_InternFromString(t->s); } else if (t->encoding) { *t->p = PyUnicode_Decode(t->s, t->n - 1, t->encoding, NULL); } else { *t->p = PyUnicode_FromStringAndSize(t->s, t->n - 1); } } else { *t->p = PyBytes_FromStringAndSize(t->s, t->n - 1); } #endif if (!*t->p) return -1; ++t; } return 0; } static CYTHON_INLINE PyObject* __Pyx_PyUnicode_FromString(const char* c_str) { return __Pyx_PyUnicode_FromStringAndSize(c_str, (Py_ssize_t)strlen(c_str)); } static CYTHON_INLINE char* __Pyx_PyObject_AsString(PyObject* o) { Py_ssize_t ignore; return __Pyx_PyObject_AsStringAndSize(o, &ignore); } static CYTHON_INLINE char* __Pyx_PyObject_AsStringAndSize(PyObject* o, Py_ssize_t *length) { #if CYTHON_COMPILING_IN_CPYTHON && (__PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT) if ( #if PY_MAJOR_VERSION < 3 && __PYX_DEFAULT_STRING_ENCODING_IS_ASCII __Pyx_sys_getdefaultencoding_not_ascii && #endif PyUnicode_Check(o)) { #if PY_VERSION_HEX < 0x03030000 char* defenc_c; PyObject* defenc = _PyUnicode_AsDefaultEncodedString(o, NULL); if (!defenc) return NULL; defenc_c = PyBytes_AS_STRING(defenc); #if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII { char* end = defenc_c + PyBytes_GET_SIZE(defenc); char* c; for (c = defenc_c; c < end; c++) { if ((unsigned char) (*c) >= 128) { PyUnicode_AsASCIIString(o); return NULL; } } } #endif *length = PyBytes_GET_SIZE(defenc); return defenc_c; #else if (__Pyx_PyUnicode_READY(o) == -1) return NULL; #if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII if (PyUnicode_IS_ASCII(o)) { *length = PyUnicode_GET_LENGTH(o); return PyUnicode_AsUTF8(o); } else { PyUnicode_AsASCIIString(o); return NULL; } #else return PyUnicode_AsUTF8AndSize(o, length); #endif #endif } else #endif #if (!CYTHON_COMPILING_IN_PYPY) || (defined(PyByteArray_AS_STRING) && defined(PyByteArray_GET_SIZE)) if (PyByteArray_Check(o)) { *length = PyByteArray_GET_SIZE(o); return PyByteArray_AS_STRING(o); } else #endif { char* result; int r = PyBytes_AsStringAndSize(o, &result, length); if (unlikely(r < 0)) { return NULL; } else { return result; } } } static CYTHON_INLINE int __Pyx_PyObject_IsTrue(PyObject* x) { int is_true = x == Py_True; if (is_true | (x == Py_False) | (x == Py_None)) return is_true; else return PyObject_IsTrue(x); } static CYTHON_INLINE PyObject* __Pyx_PyNumber_Int(PyObject* x) { PyNumberMethods *m; const char *name = NULL; PyObject *res = NULL; #if PY_MAJOR_VERSION < 3 if (PyInt_Check(x) || PyLong_Check(x)) #else if (PyLong_Check(x)) #endif return __Pyx_NewRef(x); m = Py_TYPE(x)->tp_as_number; #if PY_MAJOR_VERSION < 3 if (m && m->nb_int) { name = "int"; res = PyNumber_Int(x); } else if (m && m->nb_long) { name = "long"; res = PyNumber_Long(x); } #else if (m && m->nb_int) { name = "int"; res = PyNumber_Long(x); } #endif if (res) { #if PY_MAJOR_VERSION < 3 if (!PyInt_Check(res) && !PyLong_Check(res)) { #else if (!PyLong_Check(res)) { #endif PyErr_Format(PyExc_TypeError, "__%.4s__ returned non-%.4s (type %.200s)", name, name, Py_TYPE(res)->tp_name); Py_DECREF(res); return NULL; } } else if (!PyErr_Occurred()) { PyErr_SetString(PyExc_TypeError, "an integer is required"); } return res; } static CYTHON_INLINE Py_ssize_t __Pyx_PyIndex_AsSsize_t(PyObject* b) { Py_ssize_t ival; PyObject *x; #if PY_MAJOR_VERSION < 3 if (likely(PyInt_CheckExact(b))) { if (sizeof(Py_ssize_t) >= sizeof(long)) return PyInt_AS_LONG(b); else return PyInt_AsSsize_t(x); } #endif if (likely(PyLong_CheckExact(b))) { #if CYTHON_USE_PYLONG_INTERNALS const digit* digits = ((PyLongObject*)b)->ob_digit; const Py_ssize_t size = Py_SIZE(b); if (likely(__Pyx_sst_abs(size) <= 1)) { ival = likely(size) ? digits[0] : 0; if (size == -1) ival = -ival; return ival; } else { switch (size) { case 2: if (8 * sizeof(Py_ssize_t) > 2 * PyLong_SHIFT) { return (Py_ssize_t) (((((size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])); } break; case -2: if (8 * sizeof(Py_ssize_t) > 2 * PyLong_SHIFT) { return -(Py_ssize_t) (((((size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])); } break; case 3: if (8 * sizeof(Py_ssize_t) > 3 * PyLong_SHIFT) { return (Py_ssize_t) (((((((size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])); } break; case -3: if (8 * sizeof(Py_ssize_t) > 3 * PyLong_SHIFT) { return -(Py_ssize_t) (((((((size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])); } break; case 4: if (8 * sizeof(Py_ssize_t) > 4 * PyLong_SHIFT) { return (Py_ssize_t) (((((((((size_t)digits[3]) << PyLong_SHIFT) | (size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])); } break; case -4: if (8 * sizeof(Py_ssize_t) > 4 * PyLong_SHIFT) { return -(Py_ssize_t) (((((((((size_t)digits[3]) << PyLong_SHIFT) | (size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])); } break; } } #endif return PyLong_AsSsize_t(b); } x = PyNumber_Index(b); if (!x) return -1; ival = PyInt_AsSsize_t(x); Py_DECREF(x); return ival; } static CYTHON_INLINE PyObject * __Pyx_PyInt_FromSize_t(size_t ival) { return PyInt_FromSize_t(ival); } #endif /* Py_PYTHON_H */ pygame_sdl2-2.1.0-for-renpy-6.99.14.1/gen/pygame_sdl2.mixer.c0000644000175000017500000134753513026054116022532 0ustar tomtom00000000000000/* Generated by Cython 0.21.1 */ #define PY_SSIZE_T_CLEAN #ifndef CYTHON_USE_PYLONG_INTERNALS #ifdef PYLONG_BITS_IN_DIGIT #define CYTHON_USE_PYLONG_INTERNALS 0 #else #include "pyconfig.h" #ifdef PYLONG_BITS_IN_DIGIT #define CYTHON_USE_PYLONG_INTERNALS 1 #else #define CYTHON_USE_PYLONG_INTERNALS 0 #endif #endif #endif #include "Python.h" #ifndef Py_PYTHON_H #error Python headers needed to compile C extensions, please install development version of Python. #elif PY_VERSION_HEX < 0x02060000 || (0x03000000 <= PY_VERSION_HEX && PY_VERSION_HEX < 0x03020000) #error Cython requires Python 2.6+ or Python 3.2+. #else #define CYTHON_ABI "0_21_1" #include #ifndef offsetof #define offsetof(type, member) ( (size_t) & ((type*)0) -> member ) #endif #if !defined(WIN32) && !defined(MS_WINDOWS) #ifndef __stdcall #define __stdcall #endif #ifndef __cdecl #define __cdecl #endif #ifndef __fastcall #define __fastcall #endif #endif #ifndef DL_IMPORT #define DL_IMPORT(t) t #endif #ifndef DL_EXPORT #define DL_EXPORT(t) t #endif #ifndef PY_LONG_LONG #define PY_LONG_LONG LONG_LONG #endif #ifndef Py_HUGE_VAL #define Py_HUGE_VAL HUGE_VAL #endif #ifdef PYPY_VERSION #define CYTHON_COMPILING_IN_PYPY 1 #define CYTHON_COMPILING_IN_CPYTHON 0 #else #define CYTHON_COMPILING_IN_PYPY 0 #define CYTHON_COMPILING_IN_CPYTHON 1 #endif #if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX < 0x02070600 #define Py_OptimizeFlag 0 #endif #define __PYX_BUILD_PY_SSIZE_T "n" #define CYTHON_FORMAT_SSIZE_T "z" #if PY_MAJOR_VERSION < 3 #define __Pyx_BUILTIN_MODULE_NAME "__builtin__" #define __Pyx_PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos) \ PyCode_New(a+k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos) #define __Pyx_DefaultClassType PyClass_Type #else #define __Pyx_BUILTIN_MODULE_NAME "builtins" #define __Pyx_PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos) \ PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos) #define __Pyx_DefaultClassType PyType_Type #endif #if PY_MAJOR_VERSION >= 3 #define Py_TPFLAGS_CHECKTYPES 0 #define Py_TPFLAGS_HAVE_INDEX 0 #define Py_TPFLAGS_HAVE_NEWBUFFER 0 #endif #if PY_VERSION_HEX < 0x030400a1 && !defined(Py_TPFLAGS_HAVE_FINALIZE) #define Py_TPFLAGS_HAVE_FINALIZE 0 #endif #if PY_VERSION_HEX > 0x03030000 && defined(PyUnicode_KIND) #define CYTHON_PEP393_ENABLED 1 #define __Pyx_PyUnicode_READY(op) (likely(PyUnicode_IS_READY(op)) ? \ 0 : _PyUnicode_Ready((PyObject *)(op))) #define __Pyx_PyUnicode_GET_LENGTH(u) PyUnicode_GET_LENGTH(u) #define __Pyx_PyUnicode_READ_CHAR(u, i) PyUnicode_READ_CHAR(u, i) #define __Pyx_PyUnicode_KIND(u) PyUnicode_KIND(u) #define __Pyx_PyUnicode_DATA(u) PyUnicode_DATA(u) #define __Pyx_PyUnicode_READ(k, d, i) PyUnicode_READ(k, d, i) #else #define CYTHON_PEP393_ENABLED 0 #define __Pyx_PyUnicode_READY(op) (0) #define __Pyx_PyUnicode_GET_LENGTH(u) PyUnicode_GET_SIZE(u) #define __Pyx_PyUnicode_READ_CHAR(u, i) ((Py_UCS4)(PyUnicode_AS_UNICODE(u)[i])) #define __Pyx_PyUnicode_KIND(u) (sizeof(Py_UNICODE)) #define __Pyx_PyUnicode_DATA(u) ((void*)PyUnicode_AS_UNICODE(u)) #define __Pyx_PyUnicode_READ(k, d, i) ((void)(k), (Py_UCS4)(((Py_UNICODE*)d)[i])) #endif #if CYTHON_COMPILING_IN_PYPY #define __Pyx_PyUnicode_Concat(a, b) PyNumber_Add(a, b) #define __Pyx_PyUnicode_ConcatSafe(a, b) PyNumber_Add(a, b) #define __Pyx_PyFrozenSet_Size(s) PyObject_Size(s) #else #define __Pyx_PyUnicode_Concat(a, b) PyUnicode_Concat(a, b) #define __Pyx_PyUnicode_ConcatSafe(a, b) ((unlikely((a) == Py_None) || unlikely((b) == Py_None)) ? \ PyNumber_Add(a, b) : __Pyx_PyUnicode_Concat(a, b)) #define __Pyx_PyFrozenSet_Size(s) PySet_Size(s) #endif #define __Pyx_PyString_FormatSafe(a, b) ((unlikely((a) == Py_None)) ? PyNumber_Remainder(a, b) : __Pyx_PyString_Format(a, b)) #define __Pyx_PyUnicode_FormatSafe(a, b) ((unlikely((a) == Py_None)) ? PyNumber_Remainder(a, b) : PyUnicode_Format(a, b)) #if PY_MAJOR_VERSION >= 3 #define __Pyx_PyString_Format(a, b) PyUnicode_Format(a, b) #else #define __Pyx_PyString_Format(a, b) PyString_Format(a, b) #endif #if PY_MAJOR_VERSION >= 3 #define PyBaseString_Type PyUnicode_Type #define PyStringObject PyUnicodeObject #define PyString_Type PyUnicode_Type #define PyString_Check PyUnicode_Check #define PyString_CheckExact PyUnicode_CheckExact #endif #if PY_MAJOR_VERSION >= 3 #define __Pyx_PyBaseString_Check(obj) PyUnicode_Check(obj) #define __Pyx_PyBaseString_CheckExact(obj) PyUnicode_CheckExact(obj) #else #define __Pyx_PyBaseString_Check(obj) (PyString_Check(obj) || PyUnicode_Check(obj)) #define __Pyx_PyBaseString_CheckExact(obj) (PyString_CheckExact(obj) || PyUnicode_CheckExact(obj)) #endif #ifndef PySet_CheckExact #define PySet_CheckExact(obj) (Py_TYPE(obj) == &PySet_Type) #endif #define __Pyx_TypeCheck(obj, type) PyObject_TypeCheck(obj, (PyTypeObject *)type) #if PY_MAJOR_VERSION >= 3 #define PyIntObject PyLongObject #define PyInt_Type PyLong_Type #define PyInt_Check(op) PyLong_Check(op) #define PyInt_CheckExact(op) PyLong_CheckExact(op) #define PyInt_FromString PyLong_FromString #define PyInt_FromUnicode PyLong_FromUnicode #define PyInt_FromLong PyLong_FromLong #define PyInt_FromSize_t PyLong_FromSize_t #define PyInt_FromSsize_t PyLong_FromSsize_t #define PyInt_AsLong PyLong_AsLong #define PyInt_AS_LONG PyLong_AS_LONG #define PyInt_AsSsize_t PyLong_AsSsize_t #define PyInt_AsUnsignedLongMask PyLong_AsUnsignedLongMask #define PyInt_AsUnsignedLongLongMask PyLong_AsUnsignedLongLongMask #define PyNumber_Int PyNumber_Long #endif #if PY_MAJOR_VERSION >= 3 #define PyBoolObject PyLongObject #endif #if PY_MAJOR_VERSION >= 3 && CYTHON_COMPILING_IN_PYPY #ifndef PyUnicode_InternFromString #define PyUnicode_InternFromString(s) PyUnicode_FromString(s) #endif #endif #if PY_VERSION_HEX < 0x030200A4 typedef long Py_hash_t; #define __Pyx_PyInt_FromHash_t PyInt_FromLong #define __Pyx_PyInt_AsHash_t PyInt_AsLong #else #define __Pyx_PyInt_FromHash_t PyInt_FromSsize_t #define __Pyx_PyInt_AsHash_t PyInt_AsSsize_t #endif #if PY_MAJOR_VERSION >= 3 #define __Pyx_PyMethod_New(func, self, klass) ((self) ? PyMethod_New(func, self) : PyInstanceMethod_New(func)) #else #define __Pyx_PyMethod_New(func, self, klass) PyMethod_New(func, self, klass) #endif #ifndef CYTHON_INLINE #if defined(__GNUC__) #define CYTHON_INLINE __inline__ #elif defined(_MSC_VER) #define CYTHON_INLINE __inline #elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L #define CYTHON_INLINE inline #else #define CYTHON_INLINE #endif #endif #ifndef CYTHON_RESTRICT #if defined(__GNUC__) #define CYTHON_RESTRICT __restrict__ #elif defined(_MSC_VER) && _MSC_VER >= 1400 #define CYTHON_RESTRICT __restrict #elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L #define CYTHON_RESTRICT restrict #else #define CYTHON_RESTRICT #endif #endif #ifdef NAN #define __PYX_NAN() ((float) NAN) #else static CYTHON_INLINE float __PYX_NAN() { /* Initialize NaN. The sign is irrelevant, an exponent with all bits 1 and a nonzero mantissa means NaN. If the first bit in the mantissa is 1, it is a quiet NaN. */ float value; memset(&value, 0xFF, sizeof(value)); return value; } #endif #ifdef __cplusplus template void __Pyx_call_destructor(T* x) { x->~T(); } #endif #if PY_MAJOR_VERSION >= 3 #define __Pyx_PyNumber_Divide(x,y) PyNumber_TrueDivide(x,y) #define __Pyx_PyNumber_InPlaceDivide(x,y) PyNumber_InPlaceTrueDivide(x,y) #else #define __Pyx_PyNumber_Divide(x,y) PyNumber_Divide(x,y) #define __Pyx_PyNumber_InPlaceDivide(x,y) PyNumber_InPlaceDivide(x,y) #endif #ifndef __PYX_EXTERN_C #ifdef __cplusplus #define __PYX_EXTERN_C extern "C" #else #define __PYX_EXTERN_C extern #endif #endif #if defined(WIN32) || defined(MS_WINDOWS) #define _USE_MATH_DEFINES #endif #include #define __PYX_HAVE__pygame_sdl2__mixer #define __PYX_HAVE_API__pygame_sdl2__mixer #include "stdint.h" #include "string.h" #include "stdio.h" #include "stddef.h" #include "SDL.h" #include "SDL_mixer.h" #ifdef _OPENMP #include #endif /* _OPENMP */ #ifdef PYREX_WITHOUT_ASSERTIONS #define CYTHON_WITHOUT_ASSERTIONS #endif #ifndef CYTHON_UNUSED # if defined(__GNUC__) # if !(defined(__cplusplus)) || (__GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 4)) # define CYTHON_UNUSED __attribute__ ((__unused__)) # else # define CYTHON_UNUSED # endif # elif defined(__ICC) || (defined(__INTEL_COMPILER) && !defined(_MSC_VER)) # define CYTHON_UNUSED __attribute__ ((__unused__)) # else # define CYTHON_UNUSED # endif #endif typedef struct {PyObject **p; char *s; const Py_ssize_t n; const char* encoding; const char is_unicode; const char is_str; const char intern; } __Pyx_StringTabEntry; #define __PYX_DEFAULT_STRING_ENCODING_IS_ASCII 0 #define __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT 0 #define __PYX_DEFAULT_STRING_ENCODING "" #define __Pyx_PyObject_FromString __Pyx_PyBytes_FromString #define __Pyx_PyObject_FromStringAndSize __Pyx_PyBytes_FromStringAndSize #define __Pyx_fits_Py_ssize_t(v, type, is_signed) ( \ (sizeof(type) < sizeof(Py_ssize_t)) || \ (sizeof(type) > sizeof(Py_ssize_t) && \ likely(v < (type)PY_SSIZE_T_MAX || \ v == (type)PY_SSIZE_T_MAX) && \ (!is_signed || likely(v > (type)PY_SSIZE_T_MIN || \ v == (type)PY_SSIZE_T_MIN))) || \ (sizeof(type) == sizeof(Py_ssize_t) && \ (is_signed || likely(v < (type)PY_SSIZE_T_MAX || \ v == (type)PY_SSIZE_T_MAX))) ) static CYTHON_INLINE char* __Pyx_PyObject_AsString(PyObject*); static CYTHON_INLINE char* __Pyx_PyObject_AsStringAndSize(PyObject*, Py_ssize_t* length); #define __Pyx_PyByteArray_FromString(s) PyByteArray_FromStringAndSize((const char*)s, strlen((const char*)s)) #define __Pyx_PyByteArray_FromStringAndSize(s, l) PyByteArray_FromStringAndSize((const char*)s, l) #define __Pyx_PyBytes_FromString PyBytes_FromString #define __Pyx_PyBytes_FromStringAndSize PyBytes_FromStringAndSize static CYTHON_INLINE PyObject* __Pyx_PyUnicode_FromString(const char*); #if PY_MAJOR_VERSION < 3 #define __Pyx_PyStr_FromString __Pyx_PyBytes_FromString #define __Pyx_PyStr_FromStringAndSize __Pyx_PyBytes_FromStringAndSize #else #define __Pyx_PyStr_FromString __Pyx_PyUnicode_FromString #define __Pyx_PyStr_FromStringAndSize __Pyx_PyUnicode_FromStringAndSize #endif #define __Pyx_PyObject_AsSString(s) ((signed char*) __Pyx_PyObject_AsString(s)) #define __Pyx_PyObject_AsUString(s) ((unsigned char*) __Pyx_PyObject_AsString(s)) #define __Pyx_PyObject_FromUString(s) __Pyx_PyObject_FromString((const char*)s) #define __Pyx_PyBytes_FromUString(s) __Pyx_PyBytes_FromString((const char*)s) #define __Pyx_PyByteArray_FromUString(s) __Pyx_PyByteArray_FromString((const char*)s) #define __Pyx_PyStr_FromUString(s) __Pyx_PyStr_FromString((const char*)s) #define __Pyx_PyUnicode_FromUString(s) __Pyx_PyUnicode_FromString((const char*)s) #if PY_MAJOR_VERSION < 3 static CYTHON_INLINE size_t __Pyx_Py_UNICODE_strlen(const Py_UNICODE *u) { const Py_UNICODE *u_end = u; while (*u_end++) ; return (size_t)(u_end - u - 1); } #else #define __Pyx_Py_UNICODE_strlen Py_UNICODE_strlen #endif #define __Pyx_PyUnicode_FromUnicode(u) PyUnicode_FromUnicode(u, __Pyx_Py_UNICODE_strlen(u)) #define __Pyx_PyUnicode_FromUnicodeAndLength PyUnicode_FromUnicode #define __Pyx_PyUnicode_AsUnicode PyUnicode_AsUnicode #define __Pyx_Owned_Py_None(b) (Py_INCREF(Py_None), Py_None) #define __Pyx_PyBool_FromLong(b) ((b) ? (Py_INCREF(Py_True), Py_True) : (Py_INCREF(Py_False), Py_False)) static CYTHON_INLINE int __Pyx_PyObject_IsTrue(PyObject*); static CYTHON_INLINE PyObject* __Pyx_PyNumber_Int(PyObject* x); static CYTHON_INLINE Py_ssize_t __Pyx_PyIndex_AsSsize_t(PyObject*); static CYTHON_INLINE PyObject * __Pyx_PyInt_FromSize_t(size_t); #if CYTHON_COMPILING_IN_CPYTHON #define __pyx_PyFloat_AsDouble(x) (PyFloat_CheckExact(x) ? PyFloat_AS_DOUBLE(x) : PyFloat_AsDouble(x)) #else #define __pyx_PyFloat_AsDouble(x) PyFloat_AsDouble(x) #endif #define __pyx_PyFloat_AsFloat(x) ((float) __pyx_PyFloat_AsDouble(x)) #if PY_MAJOR_VERSION < 3 && __PYX_DEFAULT_STRING_ENCODING_IS_ASCII static int __Pyx_sys_getdefaultencoding_not_ascii; static int __Pyx_init_sys_getdefaultencoding_params(void) { PyObject* sys; PyObject* default_encoding = NULL; PyObject* ascii_chars_u = NULL; PyObject* ascii_chars_b = NULL; const char* default_encoding_c; sys = PyImport_ImportModule("sys"); if (!sys) goto bad; default_encoding = PyObject_CallMethod(sys, (char*) (const char*) "getdefaultencoding", NULL); Py_DECREF(sys); if (!default_encoding) goto bad; default_encoding_c = PyBytes_AsString(default_encoding); if (!default_encoding_c) goto bad; if (strcmp(default_encoding_c, "ascii") == 0) { __Pyx_sys_getdefaultencoding_not_ascii = 0; } else { char ascii_chars[128]; int c; for (c = 0; c < 128; c++) { ascii_chars[c] = c; } __Pyx_sys_getdefaultencoding_not_ascii = 1; ascii_chars_u = PyUnicode_DecodeASCII(ascii_chars, 128, NULL); if (!ascii_chars_u) goto bad; ascii_chars_b = PyUnicode_AsEncodedString(ascii_chars_u, default_encoding_c, NULL); if (!ascii_chars_b || !PyBytes_Check(ascii_chars_b) || memcmp(ascii_chars, PyBytes_AS_STRING(ascii_chars_b), 128) != 0) { PyErr_Format( PyExc_ValueError, "This module compiled with c_string_encoding=ascii, but default encoding '%.200s' is not a superset of ascii.", default_encoding_c); goto bad; } Py_DECREF(ascii_chars_u); Py_DECREF(ascii_chars_b); } Py_DECREF(default_encoding); return 0; bad: Py_XDECREF(default_encoding); Py_XDECREF(ascii_chars_u); Py_XDECREF(ascii_chars_b); return -1; } #endif #if __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT && PY_MAJOR_VERSION >= 3 #define __Pyx_PyUnicode_FromStringAndSize(c_str, size) PyUnicode_DecodeUTF8(c_str, size, NULL) #else #define __Pyx_PyUnicode_FromStringAndSize(c_str, size) PyUnicode_Decode(c_str, size, __PYX_DEFAULT_STRING_ENCODING, NULL) #if __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT static char* __PYX_DEFAULT_STRING_ENCODING; static int __Pyx_init_sys_getdefaultencoding_params(void) { PyObject* sys; PyObject* default_encoding = NULL; char* default_encoding_c; sys = PyImport_ImportModule("sys"); if (!sys) goto bad; default_encoding = PyObject_CallMethod(sys, (char*) (const char*) "getdefaultencoding", NULL); Py_DECREF(sys); if (!default_encoding) goto bad; default_encoding_c = PyBytes_AsString(default_encoding); if (!default_encoding_c) goto bad; __PYX_DEFAULT_STRING_ENCODING = (char*) malloc(strlen(default_encoding_c)); if (!__PYX_DEFAULT_STRING_ENCODING) goto bad; strcpy(__PYX_DEFAULT_STRING_ENCODING, default_encoding_c); Py_DECREF(default_encoding); return 0; bad: Py_XDECREF(default_encoding); return -1; } #endif #endif /* Test for GCC > 2.95 */ #if defined(__GNUC__) && (__GNUC__ > 2 || (__GNUC__ == 2 && (__GNUC_MINOR__ > 95))) #define likely(x) __builtin_expect(!!(x), 1) #define unlikely(x) __builtin_expect(!!(x), 0) #else /* !__GNUC__ or GCC < 2.95 */ #define likely(x) (x) #define unlikely(x) (x) #endif /* __GNUC__ */ static PyObject *__pyx_m; static PyObject *__pyx_d; static PyObject *__pyx_b; static PyObject *__pyx_empty_tuple; static PyObject *__pyx_empty_bytes; static int __pyx_lineno; static int __pyx_clineno = 0; static const char * __pyx_cfilenm= __FILE__; static const char *__pyx_filename; static const char *__pyx_f[] = { "pygame_sdl2/mixer.pyx", }; /*--- Type declarations ---*/ struct __pyx_obj_11pygame_sdl2_5mixer_Sound; struct __pyx_obj_11pygame_sdl2_5mixer_Channel; struct __pyx_opt_args_11pygame_sdl2_8rwobject_to_rwops; /* "pygame_sdl2/rwobject.pxd":21 * from sdl2 cimport SDL_RWops * * cdef SDL_RWops *to_rwops(filelike, mode=*) except NULL # <<<<<<<<<<<<<< * */ struct __pyx_opt_args_11pygame_sdl2_8rwobject_to_rwops { int __pyx_n; PyObject *mode; }; /* "pygame_sdl2/mixer.pyx":161 * * * cdef class Sound: # <<<<<<<<<<<<<< * cdef Mix_Chunk *chunk * */ struct __pyx_obj_11pygame_sdl2_5mixer_Sound { PyObject_HEAD Mix_Chunk *chunk; }; /* "pygame_sdl2/mixer.pyx":249 * * * cdef class Channel(object): # <<<<<<<<<<<<<< * cdef int cid * */ struct __pyx_obj_11pygame_sdl2_5mixer_Channel { PyObject_HEAD int cid; }; #ifndef CYTHON_REFNANNY #define CYTHON_REFNANNY 0 #endif #if CYTHON_REFNANNY typedef struct { void (*INCREF)(void*, PyObject*, int); void (*DECREF)(void*, PyObject*, int); void (*GOTREF)(void*, PyObject*, int); void (*GIVEREF)(void*, PyObject*, int); void* (*SetupContext)(const char*, int, const char*); void (*FinishContext)(void**); } __Pyx_RefNannyAPIStruct; static __Pyx_RefNannyAPIStruct *__Pyx_RefNanny = NULL; static __Pyx_RefNannyAPIStruct *__Pyx_RefNannyImportAPI(const char *modname); #define __Pyx_RefNannyDeclarations void *__pyx_refnanny = NULL; #ifdef WITH_THREAD #define __Pyx_RefNannySetupContext(name, acquire_gil) \ if (acquire_gil) { \ PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure(); \ __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), __LINE__, __FILE__); \ PyGILState_Release(__pyx_gilstate_save); \ } else { \ __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), __LINE__, __FILE__); \ } #else #define __Pyx_RefNannySetupContext(name, acquire_gil) \ __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), __LINE__, __FILE__) #endif #define __Pyx_RefNannyFinishContext() \ __Pyx_RefNanny->FinishContext(&__pyx_refnanny) #define __Pyx_INCREF(r) __Pyx_RefNanny->INCREF(__pyx_refnanny, (PyObject *)(r), __LINE__) #define __Pyx_DECREF(r) __Pyx_RefNanny->DECREF(__pyx_refnanny, (PyObject *)(r), __LINE__) #define __Pyx_GOTREF(r) __Pyx_RefNanny->GOTREF(__pyx_refnanny, (PyObject *)(r), __LINE__) #define __Pyx_GIVEREF(r) __Pyx_RefNanny->GIVEREF(__pyx_refnanny, (PyObject *)(r), __LINE__) #define __Pyx_XINCREF(r) do { if((r) != NULL) {__Pyx_INCREF(r); }} while(0) #define __Pyx_XDECREF(r) do { if((r) != NULL) {__Pyx_DECREF(r); }} while(0) #define __Pyx_XGOTREF(r) do { if((r) != NULL) {__Pyx_GOTREF(r); }} while(0) #define __Pyx_XGIVEREF(r) do { if((r) != NULL) {__Pyx_GIVEREF(r);}} while(0) #else #define __Pyx_RefNannyDeclarations #define __Pyx_RefNannySetupContext(name, acquire_gil) #define __Pyx_RefNannyFinishContext() #define __Pyx_INCREF(r) Py_INCREF(r) #define __Pyx_DECREF(r) Py_DECREF(r) #define __Pyx_GOTREF(r) #define __Pyx_GIVEREF(r) #define __Pyx_XINCREF(r) Py_XINCREF(r) #define __Pyx_XDECREF(r) Py_XDECREF(r) #define __Pyx_XGOTREF(r) #define __Pyx_XGIVEREF(r) #endif #define __Pyx_XDECREF_SET(r, v) do { \ PyObject *tmp = (PyObject *) r; \ r = v; __Pyx_XDECREF(tmp); \ } while (0) #define __Pyx_DECREF_SET(r, v) do { \ PyObject *tmp = (PyObject *) r; \ r = v; __Pyx_DECREF(tmp); \ } while (0) #define __Pyx_CLEAR(r) do { PyObject* tmp = ((PyObject*)(r)); r = NULL; __Pyx_DECREF(tmp);} while(0) #define __Pyx_XCLEAR(r) do { if((r) != NULL) {PyObject* tmp = ((PyObject*)(r)); r = NULL; __Pyx_DECREF(tmp);}} while(0) #if CYTHON_COMPILING_IN_CPYTHON static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStr(PyObject* obj, PyObject* attr_name) { PyTypeObject* tp = Py_TYPE(obj); if (likely(tp->tp_getattro)) return tp->tp_getattro(obj, attr_name); #if PY_MAJOR_VERSION < 3 if (likely(tp->tp_getattr)) return tp->tp_getattr(obj, PyString_AS_STRING(attr_name)); #endif return PyObject_GetAttr(obj, attr_name); } #else #define __Pyx_PyObject_GetAttrStr(o,n) PyObject_GetAttr(o,n) #endif static PyObject *__Pyx_GetBuiltinName(PyObject *name); static CYTHON_INLINE PyObject *__Pyx_GetModuleGlobalName(PyObject *name); #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x02070000 static CYTHON_INLINE PyObject* __Pyx_PyObject_LookupSpecial(PyObject* obj, PyObject* attr_name) { PyObject *res; PyTypeObject *tp = Py_TYPE(obj); #if PY_MAJOR_VERSION < 3 if (unlikely(PyInstance_Check(obj))) return __Pyx_PyObject_GetAttrStr(obj, attr_name); #endif res = _PyType_Lookup(tp, attr_name); if (likely(res)) { descrgetfunc f = Py_TYPE(res)->tp_descr_get; if (!f) { Py_INCREF(res); } else { res = f(res, obj, (PyObject *)tp); } } else { PyErr_SetObject(PyExc_AttributeError, attr_name); } return res; } #else #define __Pyx_PyObject_LookupSpecial(o,n) __Pyx_PyObject_GetAttrStr(o,n) #endif #if CYTHON_COMPILING_IN_CPYTHON static CYTHON_INLINE PyObject* __Pyx_PyObject_Call(PyObject *func, PyObject *arg, PyObject *kw); #else #define __Pyx_PyObject_Call(func, arg, kw) PyObject_Call(func, arg, kw) #endif #if CYTHON_COMPILING_IN_CPYTHON static CYTHON_INLINE PyObject* __Pyx_PyObject_CallMethO(PyObject *func, PyObject *arg); #endif static CYTHON_INLINE PyObject* __Pyx_PyObject_CallOneArg(PyObject *func, PyObject *arg); #if CYTHON_COMPILING_IN_CPYTHON static CYTHON_INLINE PyObject* __Pyx_PyObject_CallNoArg(PyObject *func); #else #define __Pyx_PyObject_CallNoArg(func) __Pyx_PyObject_Call(func, __pyx_empty_tuple, NULL) #endif #if PY_MAJOR_VERSION >= 3 static PyObject *__Pyx_PyDict_GetItem(PyObject *d, PyObject* key) { PyObject *value; value = PyDict_GetItemWithError(d, key); if (unlikely(!value)) { if (!PyErr_Occurred()) { PyObject* args = PyTuple_Pack(1, key); if (likely(args)) PyErr_SetObject(PyExc_KeyError, args); Py_XDECREF(args); } return NULL; } Py_INCREF(value); return value; } #else #define __Pyx_PyDict_GetItem(d, key) PyObject_GetItem(d, key) #endif static CYTHON_INLINE int __Pyx_TypeTest(PyObject *obj, PyTypeObject *type); static CYTHON_INLINE void __Pyx_ExceptionSave(PyObject **type, PyObject **value, PyObject **tb); static void __Pyx_ExceptionReset(PyObject *type, PyObject *value, PyObject *tb); static int __Pyx_GetException(PyObject **type, PyObject **value, PyObject **tb); static CYTHON_INLINE void __Pyx_ErrRestore(PyObject *type, PyObject *value, PyObject *tb); static CYTHON_INLINE void __Pyx_ErrFetch(PyObject **type, PyObject **value, PyObject **tb); static CYTHON_INLINE void __Pyx_RaiseUnboundLocalError(const char *varname); #ifndef __PYX_FORCE_INIT_THREADS #define __PYX_FORCE_INIT_THREADS 0 #endif static PyObject* __Pyx_PyDict_GetItemDefault(PyObject* d, PyObject* key, PyObject* default_value); static void __Pyx_WriteUnraisable(const char *name, int clineno, int lineno, const char *filename, int full_traceback); static void __Pyx_RaiseDoubleKeywordsError(const char* func_name, PyObject* kw_name); static int __Pyx_ParseOptionalKeywords(PyObject *kwds, PyObject **argnames[], \ PyObject *kwds2, PyObject *values[], Py_ssize_t num_pos_args, \ const char* function_name); static void __Pyx_RaiseArgtupleInvalid(const char* func_name, int exact, Py_ssize_t num_min, Py_ssize_t num_max, Py_ssize_t num_found); #if CYTHON_COMPILING_IN_CPYTHON static CYTHON_INLINE int __Pyx_PyList_Append(PyObject* list, PyObject* x) { PyListObject* L = (PyListObject*) list; Py_ssize_t len = Py_SIZE(list); if (likely(L->allocated > len) & likely(len > (L->allocated >> 1))) { Py_INCREF(x); PyList_SET_ITEM(list, len, x); Py_SIZE(list) = len+1; return 0; } return PyList_Append(list, x); } #else #define __Pyx_PyList_Append(L,x) PyList_Append(L,x) #endif static PyObject* __Pyx_PyObject_CallMethod1(PyObject* obj, PyObject* method_name, PyObject* arg); static CYTHON_INLINE int __Pyx_PyObject_Append(PyObject* L, PyObject* x); static CYTHON_INLINE void __Pyx_RaiseTooManyValuesError(Py_ssize_t expected); static CYTHON_INLINE void __Pyx_RaiseNeedMoreValuesError(Py_ssize_t index); static CYTHON_INLINE int __Pyx_IterFinish(void); static int __Pyx_IternextUnpackEndCheck(PyObject *retval, Py_ssize_t expected); static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, PyObject *cause); static CYTHON_INLINE int __Pyx_CheckKeywordStrings(PyObject *kwdict, const char* function_name, int kw_allowed); #define __Pyx_GetItemInt(o, i, type, is_signed, to_py_func, is_list, wraparound, boundscheck) \ (__Pyx_fits_Py_ssize_t(i, type, is_signed) ? \ __Pyx_GetItemInt_Fast(o, (Py_ssize_t)i, is_list, wraparound, boundscheck) : \ (is_list ? (PyErr_SetString(PyExc_IndexError, "list index out of range"), (PyObject*)NULL) : \ __Pyx_GetItemInt_Generic(o, to_py_func(i)))) #define __Pyx_GetItemInt_List(o, i, type, is_signed, to_py_func, is_list, wraparound, boundscheck) \ (__Pyx_fits_Py_ssize_t(i, type, is_signed) ? \ __Pyx_GetItemInt_List_Fast(o, (Py_ssize_t)i, wraparound, boundscheck) : \ (PyErr_SetString(PyExc_IndexError, "list index out of range"), (PyObject*)NULL)) static CYTHON_INLINE PyObject *__Pyx_GetItemInt_List_Fast(PyObject *o, Py_ssize_t i, int wraparound, int boundscheck); #define __Pyx_GetItemInt_Tuple(o, i, type, is_signed, to_py_func, is_list, wraparound, boundscheck) \ (__Pyx_fits_Py_ssize_t(i, type, is_signed) ? \ __Pyx_GetItemInt_Tuple_Fast(o, (Py_ssize_t)i, wraparound, boundscheck) : \ (PyErr_SetString(PyExc_IndexError, "tuple index out of range"), (PyObject*)NULL)) static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Tuple_Fast(PyObject *o, Py_ssize_t i, int wraparound, int boundscheck); static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Generic(PyObject *o, PyObject* j); static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Fast(PyObject *o, Py_ssize_t i, int is_list, int wraparound, int boundscheck); static CYTHON_INLINE int __Pyx_ArgTypeTest(PyObject *obj, PyTypeObject *type, int none_allowed, const char *name, int exact); static PyObject* __Pyx_ImportFrom(PyObject* module, PyObject* name); typedef struct { int code_line; PyCodeObject* code_object; } __Pyx_CodeObjectCacheEntry; struct __Pyx_CodeObjectCache { int count; int max_count; __Pyx_CodeObjectCacheEntry* entries; }; static struct __Pyx_CodeObjectCache __pyx_code_cache = {0,0,NULL}; static int __pyx_bisect_code_objects(__Pyx_CodeObjectCacheEntry* entries, int count, int code_line); static PyCodeObject *__pyx_find_code_object(int code_line); static void __pyx_insert_code_object(int code_line, PyCodeObject* code_object); static void __Pyx_AddTraceback(const char *funcname, int c_line, int py_line, const char *filename); static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list, int level); static CYTHON_INLINE int __Pyx_PyInt_As_int(PyObject *); static CYTHON_INLINE PyObject* __Pyx_PyInt_From_int(int value); static CYTHON_INLINE uint16_t __Pyx_PyInt_As_uint16_t(PyObject *); static CYTHON_INLINE PyObject* __Pyx_PyInt_From_uint16_t(uint16_t value); static CYTHON_INLINE PyObject* __Pyx_PyInt_From_long(long value); static CYTHON_INLINE long __Pyx_PyInt_As_long(PyObject *); static int __Pyx_check_binary_version(void); #if !defined(__Pyx_PyIdentifier_FromString) #if PY_MAJOR_VERSION < 3 #define __Pyx_PyIdentifier_FromString(s) PyString_FromString(s) #else #define __Pyx_PyIdentifier_FromString(s) PyUnicode_FromString(s) #endif #endif static PyObject *__Pyx_ImportModule(const char *name); static int __Pyx_ImportFunction(PyObject *module, const char *funcname, void (**f)(void), const char *sig); static int __Pyx_InitStrings(__Pyx_StringTabEntry *t); /* Module declarations from 'libc.stdint' */ /* Module declarations from 'libc.string' */ /* Module declarations from 'libc.stdio' */ /* Module declarations from 'libc.stddef' */ /* Module declarations from 'sdl2' */ /* Module declarations from 'sdl2_mixer' */ /* Module declarations from 'pygame_sdl2.rwobject' */ static SDL_RWops *(*__pyx_f_11pygame_sdl2_8rwobject_to_rwops)(PyObject *, struct __pyx_opt_args_11pygame_sdl2_8rwobject_to_rwops *__pyx_optional_args); /*proto*/ /* Module declarations from 'pygame_sdl2.mixer' */ static PyTypeObject *__pyx_ptype_11pygame_sdl2_5mixer_Sound = 0; static PyTypeObject *__pyx_ptype_11pygame_sdl2_5mixer_Channel = 0; static PyObject *__pyx_v_11pygame_sdl2_5mixer_preinit_args = 0; static PyObject *__pyx_v_11pygame_sdl2_5mixer_output_spec = 0; static PyObject *__pyx_v_11pygame_sdl2_5mixer_channel_events = 0; static PyObject *__pyx_v_11pygame_sdl2_5mixer_channel_queued = 0; static PyObject *__pyx_v_11pygame_sdl2_5mixer_current_sounds = 0; static void __pyx_f_11pygame_sdl2_5mixer_channel_callback(int); /*proto*/ #define __Pyx_MODULE_NAME "pygame_sdl2.mixer" int __pyx_module_is_main_pygame_sdl2__mixer = 0; /* Implementation of 'pygame_sdl2.mixer' */ static PyObject *__pyx_pf_11pygame_sdl2_5mixer__play_current(CYTHON_UNUSED PyObject *__pyx_self, int __pyx_v_channel); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_5mixer_2init(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_frequency, PyObject *__pyx_v_size, PyObject *__pyx_v_channels, PyObject *__pyx_v_buffer); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_5mixer_4pre_init(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_frequency, PyObject *__pyx_v_size, PyObject *__pyx_v_channels, PyObject *__pyx_v_buffersize); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_5mixer_6quit(CYTHON_UNUSED PyObject *__pyx_self); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_5mixer_8get_init(CYTHON_UNUSED PyObject *__pyx_self); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_5mixer_10stop(CYTHON_UNUSED PyObject *__pyx_self); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_5mixer_12pause(CYTHON_UNUSED PyObject *__pyx_self); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_5mixer_14unpause(CYTHON_UNUSED PyObject *__pyx_self); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_5mixer_16fadeout(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_time); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_5mixer_18set_num_channels(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_count); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_5mixer_20get_num_channels(CYTHON_UNUSED PyObject *__pyx_self); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_5mixer_22set_reserved(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_count); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_5mixer_24find_channel(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_force); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_5mixer_26get_busy(CYTHON_UNUSED PyObject *__pyx_self); /* proto */ static int __pyx_pf_11pygame_sdl2_5mixer_5Sound___cinit__(struct __pyx_obj_11pygame_sdl2_5mixer_Sound *__pyx_v_self); /* proto */ static void __pyx_pf_11pygame_sdl2_5mixer_5Sound_2__dealloc__(struct __pyx_obj_11pygame_sdl2_5mixer_Sound *__pyx_v_self); /* proto */ static int __pyx_pf_11pygame_sdl2_5mixer_5Sound_4__init__(struct __pyx_obj_11pygame_sdl2_5mixer_Sound *__pyx_v_self, PyObject *__pyx_v_fi); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_5mixer_5Sound_6play(struct __pyx_obj_11pygame_sdl2_5mixer_Sound *__pyx_v_self, PyObject *__pyx_v_loops, PyObject *__pyx_v_maxtime, PyObject *__pyx_v_fade_ms); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_5mixer_5Sound_8stop(struct __pyx_obj_11pygame_sdl2_5mixer_Sound *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_5mixer_5Sound_10pause(struct __pyx_obj_11pygame_sdl2_5mixer_Sound *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_5mixer_5Sound_12unpause(struct __pyx_obj_11pygame_sdl2_5mixer_Sound *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_5mixer_5Sound_14fadeout(struct __pyx_obj_11pygame_sdl2_5mixer_Sound *__pyx_v_self, PyObject *__pyx_v_time); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_5mixer_5Sound_16set_volume(struct __pyx_obj_11pygame_sdl2_5mixer_Sound *__pyx_v_self, PyObject *__pyx_v_value); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_5mixer_5Sound_18get_volume(struct __pyx_obj_11pygame_sdl2_5mixer_Sound *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_5mixer_5Sound_20get_num_channels(struct __pyx_obj_11pygame_sdl2_5mixer_Sound *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_5mixer_5Sound_22get_length(struct __pyx_obj_11pygame_sdl2_5mixer_Sound *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_5mixer_5Sound_24get_raw(CYTHON_UNUSED struct __pyx_obj_11pygame_sdl2_5mixer_Sound *__pyx_v_self); /* proto */ static int __pyx_pf_11pygame_sdl2_5mixer_7Channel___init__(struct __pyx_obj_11pygame_sdl2_5mixer_Channel *__pyx_v_self, PyObject *__pyx_v_cid); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_5mixer_7Channel_2play(struct __pyx_obj_11pygame_sdl2_5mixer_Channel *__pyx_v_self, struct __pyx_obj_11pygame_sdl2_5mixer_Sound *__pyx_v_sound, PyObject *__pyx_v_loops, PyObject *__pyx_v_maxtime, PyObject *__pyx_v_fade_ms); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_5mixer_7Channel_4stop(struct __pyx_obj_11pygame_sdl2_5mixer_Channel *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_5mixer_7Channel_6pause(struct __pyx_obj_11pygame_sdl2_5mixer_Channel *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_5mixer_7Channel_8unpause(struct __pyx_obj_11pygame_sdl2_5mixer_Channel *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_5mixer_7Channel_10fadeout(struct __pyx_obj_11pygame_sdl2_5mixer_Channel *__pyx_v_self, PyObject *__pyx_v_time); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_5mixer_7Channel_12set_volume(struct __pyx_obj_11pygame_sdl2_5mixer_Channel *__pyx_v_self, PyObject *__pyx_v_volume); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_5mixer_7Channel_14get_volume(struct __pyx_obj_11pygame_sdl2_5mixer_Channel *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_5mixer_7Channel_16get_busy(struct __pyx_obj_11pygame_sdl2_5mixer_Channel *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_5mixer_7Channel_18get_sound(struct __pyx_obj_11pygame_sdl2_5mixer_Channel *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_5mixer_7Channel_20queue(struct __pyx_obj_11pygame_sdl2_5mixer_Channel *__pyx_v_self, struct __pyx_obj_11pygame_sdl2_5mixer_Sound *__pyx_v_sound); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_5mixer_7Channel_22get_queue(struct __pyx_obj_11pygame_sdl2_5mixer_Channel *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_5mixer_7Channel_24set_endevent(struct __pyx_obj_11pygame_sdl2_5mixer_Channel *__pyx_v_self, PyObject *__pyx_v_type); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_5mixer_7Channel_26get_endevent(struct __pyx_obj_11pygame_sdl2_5mixer_Channel *__pyx_v_self); /* proto */ static PyObject *__pyx_tp_new_11pygame_sdl2_5mixer_Sound(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ static PyObject *__pyx_tp_new_11pygame_sdl2_5mixer_Channel(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ static char __pyx_k__4[] = "{}\n"; static char __pyx_k_fi[] = "fi"; static char __pyx_k_ms[] = "ms"; static char __pyx_k__13[] = "*"; static char __pyx_k_cid[] = "cid"; static char __pyx_k_get[] = "get"; static char __pyx_k_sys[] = "sys"; static char __pyx_k_Lock[] = "Lock"; static char __pyx_k_args[] = "args"; static char __pyx_k_chan[] = "chan"; static char __pyx_k_exit[] = "__exit__"; static char __pyx_k_flag[] = "flag"; static char __pyx_k_init[] = "init"; static char __pyx_k_lock[] = "_lock"; static char __pyx_k_main[] = "__main__"; static char __pyx_k_play[] = "play"; static char __pyx_k_quit[] = "quit"; static char __pyx_k_size[] = "size"; static char __pyx_k_stop[] = "stop"; static char __pyx_k_test[] = "__test__"; static char __pyx_k_time[] = "time"; static char __pyx_k_type[] = "type"; static char __pyx_k_count[] = "count"; static char __pyx_k_enter[] = "__enter__"; static char __pyx_k_error[] = "error"; static char __pyx_k_force[] = "force"; static char __pyx_k_loops[] = "loops"; static char __pyx_k_music[] = "music"; static char __pyx_k_pause[] = "pause"; static char __pyx_k_sound[] = "sound"; static char __pyx_k_start[] = "start"; static char __pyx_k_Thread[] = "Thread"; static char __pyx_k_append[] = "append"; static char __pyx_k_buffer[] = "buffer"; static char __pyx_k_errors[] = "errors"; static char __pyx_k_format[] = "format"; static char __pyx_k_import[] = "__import__"; static char __pyx_k_target[] = "target"; static char __pyx_k_channel[] = "channel"; static char __pyx_k_fade_ms[] = "fade_ms"; static char __pyx_k_fadeout[] = "fadeout"; static char __pyx_k_maxtime[] = "maxtime"; static char __pyx_k_unpause[] = "unpause"; static char __pyx_k_channels[] = "channels"; static char __pyx_k_get_busy[] = "get_busy"; static char __pyx_k_get_init[] = "get_init"; static char __pyx_k_pre_init[] = "pre_init"; static char __pyx_k_frequency[] = "frequency"; static char __pyx_k_threading[] = "threading"; static char __pyx_k_buffersize[] = "buffersize"; static char __pyx_k_next_sound[] = "next_sound"; static char __pyx_k_pygame_sdl2[] = "pygame_sdl2"; static char __pyx_k_find_channel[] = "find_channel"; static char __pyx_k_play_current[] = "_play_current"; static char __pyx_k_set_reserved[] = "set_reserved"; static char __pyx_k_register_init[] = "register_init"; static char __pyx_k_register_quit[] = "register_quit"; static char __pyx_k_Not_implemented[] = "Not implemented."; static char __pyx_k_get_num_channels[] = "get_num_channels"; static char __pyx_k_set_num_channels[] = "set_num_channels"; static char __pyx_k_pygame_sdl2_error[] = "pygame_sdl2.error"; static char __pyx_k_pygame_sdl2_mixer[] = "pygame_sdl2.mixer"; static char __pyx_k_pygame_sdl2_mixer_music[] = "pygame_sdl2.mixer_music"; static char __pyx_k_Users_tom_ab_pygame_sdl2_src_py[] = "/Users/tom/ab/pygame_sdl2/src/pygame_sdl2/mixer.pyx"; static PyObject *__pyx_n_s_Lock; static PyObject *__pyx_kp_s_Not_implemented; static PyObject *__pyx_n_s_Thread; static PyObject *__pyx_kp_s_Users_tom_ab_pygame_sdl2_src_py; static PyObject *__pyx_n_s__13; static PyObject *__pyx_kp_s__4; static PyObject *__pyx_n_s_append; static PyObject *__pyx_n_s_args; static PyObject *__pyx_n_s_buffer; static PyObject *__pyx_n_s_buffersize; static PyObject *__pyx_n_s_chan; static PyObject *__pyx_n_s_channel; static PyObject *__pyx_n_s_channels; static PyObject *__pyx_n_s_cid; static PyObject *__pyx_n_s_count; static PyObject *__pyx_n_s_enter; static PyObject *__pyx_n_s_error; static PyObject *__pyx_n_s_errors; static PyObject *__pyx_n_s_exit; static PyObject *__pyx_n_s_fade_ms; static PyObject *__pyx_n_s_fadeout; static PyObject *__pyx_n_s_fi; static PyObject *__pyx_n_s_find_channel; static PyObject *__pyx_n_s_flag; static PyObject *__pyx_n_s_force; static PyObject *__pyx_n_s_format; static PyObject *__pyx_n_s_frequency; static PyObject *__pyx_n_s_get; static PyObject *__pyx_n_s_get_busy; static PyObject *__pyx_n_s_get_init; static PyObject *__pyx_n_s_get_num_channels; static PyObject *__pyx_n_s_import; static PyObject *__pyx_n_s_init; static PyObject *__pyx_n_s_lock; static PyObject *__pyx_n_s_loops; static PyObject *__pyx_n_s_main; static PyObject *__pyx_n_s_maxtime; static PyObject *__pyx_n_s_ms; static PyObject *__pyx_n_s_music; static PyObject *__pyx_n_s_next_sound; static PyObject *__pyx_n_s_pause; static PyObject *__pyx_n_s_play; static PyObject *__pyx_n_s_play_current; static PyObject *__pyx_n_s_pre_init; static PyObject *__pyx_n_s_pygame_sdl2; static PyObject *__pyx_n_s_pygame_sdl2_error; static PyObject *__pyx_n_s_pygame_sdl2_mixer; static PyObject *__pyx_n_s_pygame_sdl2_mixer_music; static PyObject *__pyx_n_s_quit; static PyObject *__pyx_n_s_register_init; static PyObject *__pyx_n_s_register_quit; static PyObject *__pyx_n_s_set_num_channels; static PyObject *__pyx_n_s_set_reserved; static PyObject *__pyx_n_s_size; static PyObject *__pyx_n_s_sound; static PyObject *__pyx_n_s_start; static PyObject *__pyx_n_s_stop; static PyObject *__pyx_n_s_sys; static PyObject *__pyx_n_s_target; static PyObject *__pyx_n_s_test; static PyObject *__pyx_n_s_threading; static PyObject *__pyx_n_s_time; static PyObject *__pyx_n_s_type; static PyObject *__pyx_n_s_unpause; static PyObject *__pyx_int_0; static PyObject *__pyx_int_2; static PyObject *__pyx_int_4096; static PyObject *__pyx_int_22050; static PyObject *__pyx_int_neg_1; static PyObject *__pyx_k__3; static PyObject *__pyx_k__5; static PyObject *__pyx_tuple_; static PyObject *__pyx_tuple__2; static PyObject *__pyx_tuple__6; static PyObject *__pyx_tuple__7; static PyObject *__pyx_tuple__8; static PyObject *__pyx_tuple__9; static PyObject *__pyx_tuple__10; static PyObject *__pyx_tuple__11; static PyObject *__pyx_tuple__12; static PyObject *__pyx_tuple__14; static PyObject *__pyx_tuple__16; static PyObject *__pyx_tuple__18; static PyObject *__pyx_tuple__21; static PyObject *__pyx_tuple__26; static PyObject *__pyx_tuple__28; static PyObject *__pyx_tuple__31; static PyObject *__pyx_tuple__33; static PyObject *__pyx_codeobj__15; static PyObject *__pyx_codeobj__17; static PyObject *__pyx_codeobj__19; static PyObject *__pyx_codeobj__20; static PyObject *__pyx_codeobj__22; static PyObject *__pyx_codeobj__23; static PyObject *__pyx_codeobj__24; static PyObject *__pyx_codeobj__25; static PyObject *__pyx_codeobj__27; static PyObject *__pyx_codeobj__29; static PyObject *__pyx_codeobj__30; static PyObject *__pyx_codeobj__32; static PyObject *__pyx_codeobj__34; static PyObject *__pyx_codeobj__35; /* "pygame_sdl2/mixer.pyx":41 * _lock = threading.Lock() * * def _play_current(int channel): # <<<<<<<<<<<<<< * """ * Caled by channel_callback to play the next sound. This has to be called */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_5mixer_1_play_current(PyObject *__pyx_self, PyObject *__pyx_arg_channel); /*proto*/ static char __pyx_doc_11pygame_sdl2_5mixer__play_current[] = "\n Caled by channel_callback to play the next sound. This has to be called\n from a different thread, as the channel callback isn't allowed to call\n MIX functions.\n "; static PyMethodDef __pyx_mdef_11pygame_sdl2_5mixer_1_play_current = {"_play_current", (PyCFunction)__pyx_pw_11pygame_sdl2_5mixer_1_play_current, METH_O, __pyx_doc_11pygame_sdl2_5mixer__play_current}; static PyObject *__pyx_pw_11pygame_sdl2_5mixer_1_play_current(PyObject *__pyx_self, PyObject *__pyx_arg_channel) { int __pyx_v_channel; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("_play_current (wrapper)", 0); assert(__pyx_arg_channel); { __pyx_v_channel = __Pyx_PyInt_As_int(__pyx_arg_channel); if (unlikely((__pyx_v_channel == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 41; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; __Pyx_AddTraceback("pygame_sdl2.mixer._play_current", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_11pygame_sdl2_5mixer__play_current(__pyx_self, ((int)__pyx_v_channel)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_5mixer__play_current(CYTHON_UNUSED PyObject *__pyx_self, int __pyx_v_channel) { struct __pyx_obj_11pygame_sdl2_5mixer_Sound *__pyx_v_next_sound = 0; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; PyObject *__pyx_t_5 = NULL; PyObject *__pyx_t_6 = NULL; PyObject *__pyx_t_7 = NULL; PyObject *__pyx_t_8 = NULL; PyObject *__pyx_t_9 = NULL; int __pyx_t_10; int __pyx_t_11; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("_play_current", 0); /* "pygame_sdl2/mixer.pyx":50 * cdef Sound next_sound * * with _lock: # <<<<<<<<<<<<<< * next_sound = channel_queued[channel] * current_sounds[channel] = next_sound */ /*with:*/ { __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_lock); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 50; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = __Pyx_PyObject_LookupSpecial(__pyx_t_1, __pyx_n_s_exit); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 50; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __pyx_t_4 = __Pyx_PyObject_LookupSpecial(__pyx_t_1, __pyx_n_s_enter); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 50; __pyx_clineno = __LINE__; goto __pyx_L3_error;} __Pyx_GOTREF(__pyx_t_4); __pyx_t_5 = NULL; if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_4))) { __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4); if (likely(__pyx_t_5)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4); __Pyx_INCREF(__pyx_t_5); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_4, function); } } if (__pyx_t_5) { __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_5); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 50; __pyx_clineno = __LINE__; goto __pyx_L3_error;} __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; } else { __pyx_t_3 = __Pyx_PyObject_CallNoArg(__pyx_t_4); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 50; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /*try:*/ { { __Pyx_ExceptionSave(&__pyx_t_6, &__pyx_t_7, &__pyx_t_8); __Pyx_XGOTREF(__pyx_t_6); __Pyx_XGOTREF(__pyx_t_7); __Pyx_XGOTREF(__pyx_t_8); /*try:*/ { /* "pygame_sdl2/mixer.pyx":51 * * with _lock: * next_sound = channel_queued[channel] # <<<<<<<<<<<<<< * current_sounds[channel] = next_sound * channel_queued[channel] = None */ if (unlikely(__pyx_v_11pygame_sdl2_5mixer_channel_queued == Py_None)) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 51; __pyx_clineno = __LINE__; goto __pyx_L7_error;} } __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_channel); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 51; __pyx_clineno = __LINE__; goto __pyx_L7_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_t_3 = __Pyx_PyDict_GetItem(__pyx_v_11pygame_sdl2_5mixer_channel_queued, __pyx_t_1); if (unlikely(__pyx_t_3 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 51; __pyx_clineno = __LINE__; goto __pyx_L7_error;}; __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_ptype_11pygame_sdl2_5mixer_Sound))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 51; __pyx_clineno = __LINE__; goto __pyx_L7_error;} __pyx_v_next_sound = ((struct __pyx_obj_11pygame_sdl2_5mixer_Sound *)__pyx_t_3); __pyx_t_3 = 0; /* "pygame_sdl2/mixer.pyx":52 * with _lock: * next_sound = channel_queued[channel] * current_sounds[channel] = next_sound # <<<<<<<<<<<<<< * channel_queued[channel] = None * */ if (unlikely(__pyx_v_11pygame_sdl2_5mixer_current_sounds == Py_None)) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 52; __pyx_clineno = __LINE__; goto __pyx_L7_error;} } __pyx_t_3 = __Pyx_PyInt_From_int(__pyx_v_channel); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 52; __pyx_clineno = __LINE__; goto __pyx_L7_error;} __Pyx_GOTREF(__pyx_t_3); if (unlikely(PyDict_SetItem(__pyx_v_11pygame_sdl2_5mixer_current_sounds, __pyx_t_3, ((PyObject *)__pyx_v_next_sound)) < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 52; __pyx_clineno = __LINE__; goto __pyx_L7_error;} __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "pygame_sdl2/mixer.pyx":53 * next_sound = channel_queued[channel] * current_sounds[channel] = next_sound * channel_queued[channel] = None # <<<<<<<<<<<<<< * * if next_sound: */ if (unlikely(__pyx_v_11pygame_sdl2_5mixer_channel_queued == Py_None)) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 53; __pyx_clineno = __LINE__; goto __pyx_L7_error;} } __pyx_t_3 = __Pyx_PyInt_From_int(__pyx_v_channel); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 53; __pyx_clineno = __LINE__; goto __pyx_L7_error;} __Pyx_GOTREF(__pyx_t_3); if (unlikely(PyDict_SetItem(__pyx_v_11pygame_sdl2_5mixer_channel_queued, __pyx_t_3, Py_None) < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 53; __pyx_clineno = __LINE__; goto __pyx_L7_error;} __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0; goto __pyx_L14_try_end; __pyx_L7_error:; __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; /* "pygame_sdl2/mixer.pyx":50 * cdef Sound next_sound * * with _lock: # <<<<<<<<<<<<<< * next_sound = channel_queued[channel] * current_sounds[channel] = next_sound */ /*except:*/ { __Pyx_AddTraceback("pygame_sdl2.mixer._play_current", __pyx_clineno, __pyx_lineno, __pyx_filename); if (__Pyx_GetException(&__pyx_t_3, &__pyx_t_1, &__pyx_t_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 50; __pyx_clineno = __LINE__; goto __pyx_L9_except_error;} __Pyx_GOTREF(__pyx_t_3); __Pyx_GOTREF(__pyx_t_1); __Pyx_GOTREF(__pyx_t_4); __pyx_t_5 = PyTuple_Pack(3, __pyx_t_3, __pyx_t_1, __pyx_t_4); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 50; __pyx_clineno = __LINE__; goto __pyx_L9_except_error;} __Pyx_GOTREF(__pyx_t_5); __pyx_t_9 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_5, NULL); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 50; __pyx_clineno = __LINE__; goto __pyx_L9_except_error;} __Pyx_GOTREF(__pyx_t_9); __pyx_t_10 = __Pyx_PyObject_IsTrue(__pyx_t_9); __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; if (__pyx_t_10 < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 50; __pyx_clineno = __LINE__; goto __pyx_L9_except_error;} __pyx_t_11 = ((!(__pyx_t_10 != 0)) != 0); if (__pyx_t_11) { __Pyx_GIVEREF(__pyx_t_3); __Pyx_GIVEREF(__pyx_t_1); __Pyx_XGIVEREF(__pyx_t_4); __Pyx_ErrRestore(__pyx_t_3, __pyx_t_1, __pyx_t_4); __pyx_t_3 = 0; __pyx_t_1 = 0; __pyx_t_4 = 0; {__pyx_filename = __pyx_f[0]; __pyx_lineno = 50; __pyx_clineno = __LINE__; goto __pyx_L9_except_error;} } __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; goto __pyx_L8_exception_handled; } __pyx_L9_except_error:; __Pyx_XGIVEREF(__pyx_t_6); __Pyx_XGIVEREF(__pyx_t_7); __Pyx_XGIVEREF(__pyx_t_8); __Pyx_ExceptionReset(__pyx_t_6, __pyx_t_7, __pyx_t_8); goto __pyx_L1_error; __pyx_L8_exception_handled:; __Pyx_XGIVEREF(__pyx_t_6); __Pyx_XGIVEREF(__pyx_t_7); __Pyx_XGIVEREF(__pyx_t_8); __Pyx_ExceptionReset(__pyx_t_6, __pyx_t_7, __pyx_t_8); __pyx_L14_try_end:; } } /*finally:*/ { /*normal exit:*/{ if (__pyx_t_2) { __pyx_t_8 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_tuple_, NULL); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 50; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_8); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; } goto __pyx_L6; } __pyx_L6:; } goto __pyx_L18; __pyx_L3_error:; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; goto __pyx_L1_error; __pyx_L18:; } /* "pygame_sdl2/mixer.pyx":55 * channel_queued[channel] = None * * if next_sound: # <<<<<<<<<<<<<< * with nogil: * Mix_PlayChannelTimed(channel, next_sound.chunk, 0, -1) */ if (unlikely(!__pyx_v_next_sound)) { __Pyx_RaiseUnboundLocalError("next_sound"); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 55; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } __pyx_t_11 = __Pyx_PyObject_IsTrue(((PyObject *)__pyx_v_next_sound)); if (unlikely(__pyx_t_11 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 55; __pyx_clineno = __LINE__; goto __pyx_L1_error;} if (__pyx_t_11) { /* "pygame_sdl2/mixer.pyx":56 * * if next_sound: * with nogil: # <<<<<<<<<<<<<< * Mix_PlayChannelTimed(channel, next_sound.chunk, 0, -1) * */ { #ifdef WITH_THREAD PyThreadState *_save; Py_UNBLOCK_THREADS #endif /*try:*/ { /* "pygame_sdl2/mixer.pyx":57 * if next_sound: * with nogil: * Mix_PlayChannelTimed(channel, next_sound.chunk, 0, -1) # <<<<<<<<<<<<<< * * */ if (unlikely(!__pyx_v_next_sound)) { __Pyx_RaiseUnboundLocalError("next_sound"); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 57; __pyx_clineno = __LINE__; goto __pyx_L21_error;} } Mix_PlayChannelTimed(__pyx_v_channel, __pyx_v_next_sound->chunk, 0, -1); } /* "pygame_sdl2/mixer.pyx":56 * * if next_sound: * with nogil: # <<<<<<<<<<<<<< * Mix_PlayChannelTimed(channel, next_sound.chunk, 0, -1) * */ /*finally:*/ { /*normal exit:*/{ #ifdef WITH_THREAD Py_BLOCK_THREADS #endif goto __pyx_L22; } __pyx_L21_error: { #ifdef WITH_THREAD Py_BLOCK_THREADS #endif goto __pyx_L1_error; } __pyx_L22:; } } goto __pyx_L19; } __pyx_L19:; /* "pygame_sdl2/mixer.pyx":41 * _lock = threading.Lock() * * def _play_current(int channel): # <<<<<<<<<<<<<< * """ * Caled by channel_callback to play the next sound. This has to be called */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_5); __Pyx_AddTraceback("pygame_sdl2.mixer._play_current", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF((PyObject *)__pyx_v_next_sound); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/mixer.pyx":60 * * * cdef void channel_callback(int channel) with gil: # <<<<<<<<<<<<<< * * cdef int etype = 0 */ static void __pyx_f_11pygame_sdl2_5mixer_channel_callback(int __pyx_v_channel) { int __pyx_v_etype; SDL_Event __pyx_v_e; PyObject *__pyx_v_next_sound = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; int __pyx_t_3; int __pyx_t_4; PyObject *__pyx_t_5 = NULL; PyObject *__pyx_t_6 = NULL; PyObject *__pyx_t_7 = NULL; PyObject *__pyx_t_8 = NULL; PyObject *__pyx_t_9 = NULL; PyObject *__pyx_t_10 = NULL; PyObject *__pyx_t_11 = NULL; PyObject *__pyx_t_12 = NULL; int __pyx_t_13; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; #ifdef WITH_THREAD PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure(); #endif __Pyx_RefNannySetupContext("channel_callback", 0); /* "pygame_sdl2/mixer.pyx":62 * cdef void channel_callback(int channel) with gil: * * cdef int etype = 0 # <<<<<<<<<<<<<< * cdef SDL_Event e * */ __pyx_v_etype = 0; /* "pygame_sdl2/mixer.pyx":65 * cdef SDL_Event e * * etype = channel_events.get(channel, 0) # <<<<<<<<<<<<<< * if etype != 0: * memset(&e, 0, sizeof(SDL_Event)) */ if (unlikely(__pyx_v_11pygame_sdl2_5mixer_channel_events == Py_None)) { PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%s'", "get"); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 65; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_channel); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 65; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = __Pyx_PyDict_GetItemDefault(__pyx_v_11pygame_sdl2_5mixer_channel_events, __pyx_t_1, __pyx_int_0); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 65; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_3 = __Pyx_PyInt_As_int(__pyx_t_2); if (unlikely((__pyx_t_3 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 65; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_v_etype = __pyx_t_3; /* "pygame_sdl2/mixer.pyx":66 * * etype = channel_events.get(channel, 0) * if etype != 0: # <<<<<<<<<<<<<< * memset(&e, 0, sizeof(SDL_Event)) * e.type = etype */ __pyx_t_4 = ((__pyx_v_etype != 0) != 0); if (__pyx_t_4) { /* "pygame_sdl2/mixer.pyx":67 * etype = channel_events.get(channel, 0) * if etype != 0: * memset(&e, 0, sizeof(SDL_Event)) # <<<<<<<<<<<<<< * e.type = etype * SDL_PushEvent(&e) */ memset((&__pyx_v_e), 0, (sizeof(SDL_Event))); /* "pygame_sdl2/mixer.pyx":68 * if etype != 0: * memset(&e, 0, sizeof(SDL_Event)) * e.type = etype # <<<<<<<<<<<<<< * SDL_PushEvent(&e) * */ __pyx_v_e.type = __pyx_v_etype; /* "pygame_sdl2/mixer.pyx":69 * memset(&e, 0, sizeof(SDL_Event)) * e.type = etype * SDL_PushEvent(&e) # <<<<<<<<<<<<<< * * with _lock: */ SDL_PushEvent((&__pyx_v_e)); goto __pyx_L3; } __pyx_L3:; /* "pygame_sdl2/mixer.pyx":71 * SDL_PushEvent(&e) * * with _lock: # <<<<<<<<<<<<<< * next_sound = channel_queued.get(channel) * if next_sound: */ /*with:*/ { __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_lock); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 71; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __pyx_t_5 = __Pyx_PyObject_LookupSpecial(__pyx_t_2, __pyx_n_s_exit); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 71; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); __pyx_t_6 = __Pyx_PyObject_LookupSpecial(__pyx_t_2, __pyx_n_s_enter); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 71; __pyx_clineno = __LINE__; goto __pyx_L4_error;} __Pyx_GOTREF(__pyx_t_6); __pyx_t_7 = NULL; if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_6))) { __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_6); if (likely(__pyx_t_7)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6); __Pyx_INCREF(__pyx_t_7); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_6, function); } } if (__pyx_t_7) { __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_6, __pyx_t_7); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 71; __pyx_clineno = __LINE__; goto __pyx_L4_error;} __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; } else { __pyx_t_1 = __Pyx_PyObject_CallNoArg(__pyx_t_6); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 71; __pyx_clineno = __LINE__; goto __pyx_L4_error;} } __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /*try:*/ { { __Pyx_ExceptionSave(&__pyx_t_8, &__pyx_t_9, &__pyx_t_10); __Pyx_XGOTREF(__pyx_t_8); __Pyx_XGOTREF(__pyx_t_9); __Pyx_XGOTREF(__pyx_t_10); /*try:*/ { /* "pygame_sdl2/mixer.pyx":72 * * with _lock: * next_sound = channel_queued.get(channel) # <<<<<<<<<<<<<< * if next_sound: * threading.Thread(target=_play_current, args=(channel,)).start() */ if (unlikely(__pyx_v_11pygame_sdl2_5mixer_channel_queued == Py_None)) { PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%s'", "get"); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 72; __pyx_clineno = __LINE__; goto __pyx_L8_error;} } __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_v_channel); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 72; __pyx_clineno = __LINE__; goto __pyx_L8_error;} __Pyx_GOTREF(__pyx_t_2); __pyx_t_1 = __Pyx_PyDict_GetItemDefault(__pyx_v_11pygame_sdl2_5mixer_channel_queued, __pyx_t_2, Py_None); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 72; __pyx_clineno = __LINE__; goto __pyx_L8_error;} __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_v_next_sound = __pyx_t_1; __pyx_t_1 = 0; /* "pygame_sdl2/mixer.pyx":73 * with _lock: * next_sound = channel_queued.get(channel) * if next_sound: # <<<<<<<<<<<<<< * threading.Thread(target=_play_current, args=(channel,)).start() * */ __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_v_next_sound); if (unlikely(__pyx_t_4 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 73; __pyx_clineno = __LINE__; goto __pyx_L8_error;} if (__pyx_t_4) { /* "pygame_sdl2/mixer.pyx":74 * next_sound = channel_queued.get(channel) * if next_sound: * threading.Thread(target=_play_current, args=(channel,)).start() # <<<<<<<<<<<<<< * * # A list of errors that occured during mixer initialization. */ __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_threading); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 74; __pyx_clineno = __LINE__; goto __pyx_L8_error;} __Pyx_GOTREF(__pyx_t_2); __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_Thread); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 74; __pyx_clineno = __LINE__; goto __pyx_L8_error;} __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_2 = PyDict_New(); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 74; __pyx_clineno = __LINE__; goto __pyx_L8_error;} __Pyx_GOTREF(__pyx_t_2); __pyx_t_7 = __Pyx_GetModuleGlobalName(__pyx_n_s_play_current); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 74; __pyx_clineno = __LINE__; goto __pyx_L8_error;} __Pyx_GOTREF(__pyx_t_7); if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_target, __pyx_t_7) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 74; __pyx_clineno = __LINE__; goto __pyx_L8_error;} __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __pyx_t_7 = __Pyx_PyInt_From_int(__pyx_v_channel); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 74; __pyx_clineno = __LINE__; goto __pyx_L8_error;} __Pyx_GOTREF(__pyx_t_7); __pyx_t_11 = PyTuple_New(1); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 74; __pyx_clineno = __LINE__; goto __pyx_L8_error;} __Pyx_GOTREF(__pyx_t_11); PyTuple_SET_ITEM(__pyx_t_11, 0, __pyx_t_7); __Pyx_GIVEREF(__pyx_t_7); __pyx_t_7 = 0; if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_args, __pyx_t_11) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 74; __pyx_clineno = __LINE__; goto __pyx_L8_error;} __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; __pyx_t_11 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_empty_tuple, __pyx_t_2); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 74; __pyx_clineno = __LINE__; goto __pyx_L8_error;} __Pyx_GOTREF(__pyx_t_11); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_11, __pyx_n_s_start); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 74; __pyx_clineno = __LINE__; goto __pyx_L8_error;} __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; __pyx_t_11 = NULL; if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_2))) { __pyx_t_11 = PyMethod_GET_SELF(__pyx_t_2); if (likely(__pyx_t_11)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_11); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); } } if (__pyx_t_11) { __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_11); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 74; __pyx_clineno = __LINE__; goto __pyx_L8_error;} __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; } else { __pyx_t_1 = __Pyx_PyObject_CallNoArg(__pyx_t_2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 74; __pyx_clineno = __LINE__; goto __pyx_L8_error;} } __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; goto __pyx_L16; } __pyx_L16:; } __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0; __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0; __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0; goto __pyx_L15_try_end; __pyx_L8_error:; __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0; __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; /* "pygame_sdl2/mixer.pyx":71 * SDL_PushEvent(&e) * * with _lock: # <<<<<<<<<<<<<< * next_sound = channel_queued.get(channel) * if next_sound: */ /*except:*/ { __Pyx_AddTraceback("pygame_sdl2.mixer.channel_callback", __pyx_clineno, __pyx_lineno, __pyx_filename); if (__Pyx_GetException(&__pyx_t_1, &__pyx_t_2, &__pyx_t_11) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 71; __pyx_clineno = __LINE__; goto __pyx_L10_except_error;} __Pyx_GOTREF(__pyx_t_1); __Pyx_GOTREF(__pyx_t_2); __Pyx_GOTREF(__pyx_t_11); __pyx_t_6 = PyTuple_Pack(3, __pyx_t_1, __pyx_t_2, __pyx_t_11); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 71; __pyx_clineno = __LINE__; goto __pyx_L10_except_error;} __Pyx_GOTREF(__pyx_t_6); __pyx_t_12 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_6, NULL); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 71; __pyx_clineno = __LINE__; goto __pyx_L10_except_error;} __Pyx_GOTREF(__pyx_t_12); __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_12); __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; if (__pyx_t_4 < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 71; __pyx_clineno = __LINE__; goto __pyx_L10_except_error;} __pyx_t_13 = ((!(__pyx_t_4 != 0)) != 0); if (__pyx_t_13) { __Pyx_GIVEREF(__pyx_t_1); __Pyx_GIVEREF(__pyx_t_2); __Pyx_XGIVEREF(__pyx_t_11); __Pyx_ErrRestore(__pyx_t_1, __pyx_t_2, __pyx_t_11); __pyx_t_1 = 0; __pyx_t_2 = 0; __pyx_t_11 = 0; {__pyx_filename = __pyx_f[0]; __pyx_lineno = 71; __pyx_clineno = __LINE__; goto __pyx_L10_except_error;} } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; goto __pyx_L9_exception_handled; } __pyx_L10_except_error:; __Pyx_XGIVEREF(__pyx_t_8); __Pyx_XGIVEREF(__pyx_t_9); __Pyx_XGIVEREF(__pyx_t_10); __Pyx_ExceptionReset(__pyx_t_8, __pyx_t_9, __pyx_t_10); goto __pyx_L1_error; __pyx_L9_exception_handled:; __Pyx_XGIVEREF(__pyx_t_8); __Pyx_XGIVEREF(__pyx_t_9); __Pyx_XGIVEREF(__pyx_t_10); __Pyx_ExceptionReset(__pyx_t_8, __pyx_t_9, __pyx_t_10); __pyx_L15_try_end:; } } /*finally:*/ { /*normal exit:*/{ if (__pyx_t_5) { __pyx_t_10 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_tuple__2, NULL); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 71; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_10); __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; } goto __pyx_L7; } __pyx_L7:; } goto __pyx_L20; __pyx_L4_error:; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; goto __pyx_L1_error; __pyx_L20:; } /* "pygame_sdl2/mixer.pyx":60 * * * cdef void channel_callback(int channel) with gil: # <<<<<<<<<<<<<< * * cdef int etype = 0 */ /* function exit code */ goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_6); __Pyx_XDECREF(__pyx_t_7); __Pyx_XDECREF(__pyx_t_11); __Pyx_WriteUnraisable("pygame_sdl2.mixer.channel_callback", __pyx_clineno, __pyx_lineno, __pyx_filename, 0); __pyx_L0:; __Pyx_XDECREF(__pyx_v_next_sound); __Pyx_RefNannyFinishContext(); #ifdef WITH_THREAD PyGILState_Release(__pyx_gilstate_save); #endif } /* "pygame_sdl2/mixer.pyx":80 * * @pygame_sdl2.register_init * def init(frequency=22050, size=MIX_DEFAULT_FORMAT, channels=2, buffer=4096): # <<<<<<<<<<<<<< * if get_init() is not None: * return */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_5mixer_3init(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static PyMethodDef __pyx_mdef_11pygame_sdl2_5mixer_3init = {"init", (PyCFunction)__pyx_pw_11pygame_sdl2_5mixer_3init, METH_VARARGS|METH_KEYWORDS, 0}; static PyObject *__pyx_pw_11pygame_sdl2_5mixer_3init(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_frequency = 0; PyObject *__pyx_v_size = 0; PyObject *__pyx_v_channels = 0; PyObject *__pyx_v_buffer = 0; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("init (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_frequency,&__pyx_n_s_size,&__pyx_n_s_channels,&__pyx_n_s_buffer,0}; PyObject* values[4] = {0,0,0,0}; values[0] = ((PyObject *)__pyx_int_22050); values[1] = __pyx_k__3; values[2] = ((PyObject *)__pyx_int_2); values[3] = ((PyObject *)__pyx_int_4096); if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (kw_args > 0) { PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_frequency); if (value) { values[0] = value; kw_args--; } } case 1: if (kw_args > 0) { PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_size); if (value) { values[1] = value; kw_args--; } } case 2: if (kw_args > 0) { PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_channels); if (value) { values[2] = value; kw_args--; } } case 3: if (kw_args > 0) { PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_buffer); if (value) { values[3] = value; kw_args--; } } } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "init") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 80; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } } else { switch (PyTuple_GET_SIZE(__pyx_args)) { case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); case 0: break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_frequency = values[0]; __pyx_v_size = values[1]; __pyx_v_channels = values[2]; __pyx_v_buffer = values[3]; } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("init", 0, 0, 4, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 80; __pyx_clineno = __LINE__; goto __pyx_L3_error;} __pyx_L3_error:; __Pyx_AddTraceback("pygame_sdl2.mixer.init", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_11pygame_sdl2_5mixer_2init(__pyx_self, __pyx_v_frequency, __pyx_v_size, __pyx_v_channels, __pyx_v_buffer); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_5mixer_2init(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_frequency, PyObject *__pyx_v_size, PyObject *__pyx_v_channels, PyObject *__pyx_v_buffer) { MIX_InitFlags __pyx_v_flag; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; int __pyx_t_4; int __pyx_t_5; PyObject *__pyx_t_6 = NULL; PyObject *__pyx_t_7 = NULL; PyObject *__pyx_t_8 = NULL; PyObject *__pyx_t_9 = NULL; Py_ssize_t __pyx_t_10; MIX_InitFlags __pyx_t_11; int __pyx_t_12; PyObject *(*__pyx_t_13)(PyObject *); int __pyx_t_14; Uint16 __pyx_t_15; int __pyx_t_16; int __pyx_t_17; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("init", 0); __Pyx_INCREF(__pyx_v_frequency); __Pyx_INCREF(__pyx_v_size); __Pyx_INCREF(__pyx_v_channels); __Pyx_INCREF(__pyx_v_buffer); /* "pygame_sdl2/mixer.pyx":81 * @pygame_sdl2.register_init * def init(frequency=22050, size=MIX_DEFAULT_FORMAT, channels=2, buffer=4096): * if get_init() is not None: # <<<<<<<<<<<<<< * return * */ __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_get_init); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 81; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = NULL; if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_2))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); if (likely(__pyx_t_3)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); } } if (__pyx_t_3) { __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 81; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } else { __pyx_t_1 = __Pyx_PyObject_CallNoArg(__pyx_t_2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 81; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_4 = (__pyx_t_1 != Py_None); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_5 = (__pyx_t_4 != 0); if (__pyx_t_5) { /* "pygame_sdl2/mixer.pyx":82 * def init(frequency=22050, size=MIX_DEFAULT_FORMAT, channels=2, buffer=4096): * if get_init() is not None: * return # <<<<<<<<<<<<<< * * for flag in (MIX_INIT_FLAC, MIX_INIT_MOD, MIX_INIT_MODPLUG, */ __Pyx_XDECREF(__pyx_r); __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; } /* "pygame_sdl2/mixer.pyx":84 * return * * for flag in (MIX_INIT_FLAC, MIX_INIT_MOD, MIX_INIT_MODPLUG, # <<<<<<<<<<<<<< * MIX_INIT_MP3, MIX_INIT_OGG, MIX_INIT_FLUIDSYNTH): * */ __pyx_t_1 = PyInt_FromLong(MIX_INIT_FLAC); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 84; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = PyInt_FromLong(MIX_INIT_MOD); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 84; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = PyInt_FromLong(MIX_INIT_MODPLUG); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 84; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); /* "pygame_sdl2/mixer.pyx":85 * * for flag in (MIX_INIT_FLAC, MIX_INIT_MOD, MIX_INIT_MODPLUG, * MIX_INIT_MP3, MIX_INIT_OGG, MIX_INIT_FLUIDSYNTH): # <<<<<<<<<<<<<< * * if Mix_Init(flag) != flag: */ __pyx_t_6 = PyInt_FromLong(MIX_INIT_MP3); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 85; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_6); __pyx_t_7 = PyInt_FromLong(MIX_INIT_OGG); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 85; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_7); __pyx_t_8 = PyInt_FromLong(MIX_INIT_FLUIDSYNTH); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 85; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_8); /* "pygame_sdl2/mixer.pyx":84 * return * * for flag in (MIX_INIT_FLAC, MIX_INIT_MOD, MIX_INIT_MODPLUG, # <<<<<<<<<<<<<< * MIX_INIT_MP3, MIX_INIT_OGG, MIX_INIT_FLUIDSYNTH): * */ __pyx_t_9 = PyTuple_New(6); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 84; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_9); PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_t_1); __Pyx_GIVEREF(__pyx_t_1); PyTuple_SET_ITEM(__pyx_t_9, 1, __pyx_t_2); __Pyx_GIVEREF(__pyx_t_2); PyTuple_SET_ITEM(__pyx_t_9, 2, __pyx_t_3); __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_9, 3, __pyx_t_6); __Pyx_GIVEREF(__pyx_t_6); PyTuple_SET_ITEM(__pyx_t_9, 4, __pyx_t_7); __Pyx_GIVEREF(__pyx_t_7); PyTuple_SET_ITEM(__pyx_t_9, 5, __pyx_t_8); __Pyx_GIVEREF(__pyx_t_8); __pyx_t_1 = 0; __pyx_t_2 = 0; __pyx_t_3 = 0; __pyx_t_6 = 0; __pyx_t_7 = 0; __pyx_t_8 = 0; __pyx_t_8 = __pyx_t_9; __Pyx_INCREF(__pyx_t_8); __pyx_t_10 = 0; __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; for (;;) { if (__pyx_t_10 >= 6) break; #if CYTHON_COMPILING_IN_CPYTHON __pyx_t_9 = PyTuple_GET_ITEM(__pyx_t_8, __pyx_t_10); __Pyx_INCREF(__pyx_t_9); __pyx_t_10++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 84; __pyx_clineno = __LINE__; goto __pyx_L1_error;} #else __pyx_t_9 = PySequence_ITEM(__pyx_t_8, __pyx_t_10); __pyx_t_10++; if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 84; __pyx_clineno = __LINE__; goto __pyx_L1_error;} #endif __pyx_t_11 = ((MIX_InitFlags)PyInt_AsLong(__pyx_t_9)); if (unlikely(PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 84; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; __pyx_v_flag = __pyx_t_11; /* "pygame_sdl2/mixer.pyx":87 * MIX_INIT_MP3, MIX_INIT_OGG, MIX_INIT_FLUIDSYNTH): * * if Mix_Init(flag) != flag: # <<<<<<<<<<<<<< * errors.append("{}\n".format(SDL_GetError())) * */ __pyx_t_5 = ((Mix_Init(__pyx_v_flag) != __pyx_v_flag) != 0); if (__pyx_t_5) { /* "pygame_sdl2/mixer.pyx":88 * * if Mix_Init(flag) != flag: * errors.append("{}\n".format(SDL_GetError())) # <<<<<<<<<<<<<< * * if preinit_args: */ __pyx_t_9 = __Pyx_GetModuleGlobalName(__pyx_n_s_errors); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 88; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_9); __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_kp_s__4, __pyx_n_s_format); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 88; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_6); __pyx_t_3 = __Pyx_PyBytes_FromString(SDL_GetError()); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 88; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __pyx_t_2 = NULL; if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_6))) { __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_6); if (likely(__pyx_t_2)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6); __Pyx_INCREF(__pyx_t_2); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_6, function); } } if (!__pyx_t_2) { __pyx_t_7 = __Pyx_PyObject_CallOneArg(__pyx_t_6, __pyx_t_3); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 88; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_GOTREF(__pyx_t_7); } else { __pyx_t_1 = PyTuple_New(1+1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 88; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_2); __Pyx_GIVEREF(__pyx_t_2); __pyx_t_2 = NULL; PyTuple_SET_ITEM(__pyx_t_1, 0+1, __pyx_t_3); __Pyx_GIVEREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_7 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_1, NULL); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 88; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; } __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __pyx_t_12 = __Pyx_PyObject_Append(__pyx_t_9, __pyx_t_7); if (unlikely(__pyx_t_12 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 88; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; goto __pyx_L6; } __pyx_L6:; /* "pygame_sdl2/mixer.pyx":84 * return * * for flag in (MIX_INIT_FLAC, MIX_INIT_MOD, MIX_INIT_MODPLUG, # <<<<<<<<<<<<<< * MIX_INIT_MP3, MIX_INIT_OGG, MIX_INIT_FLUIDSYNTH): * */ } __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; /* "pygame_sdl2/mixer.pyx":90 * errors.append("{}\n".format(SDL_GetError())) * * if preinit_args: # <<<<<<<<<<<<<< * frequency, size, channels, buffer = preinit_args * */ __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_v_11pygame_sdl2_5mixer_preinit_args); if (unlikely(__pyx_t_5 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 90; __pyx_clineno = __LINE__; goto __pyx_L1_error;} if (__pyx_t_5) { /* "pygame_sdl2/mixer.pyx":91 * * if preinit_args: * frequency, size, channels, buffer = preinit_args # <<<<<<<<<<<<<< * * if Mix_OpenAudio(frequency, size, channels, buffer) != 0: */ if ((likely(PyTuple_CheckExact(__pyx_v_11pygame_sdl2_5mixer_preinit_args))) || (PyList_CheckExact(__pyx_v_11pygame_sdl2_5mixer_preinit_args))) { PyObject* sequence = __pyx_v_11pygame_sdl2_5mixer_preinit_args; #if CYTHON_COMPILING_IN_CPYTHON Py_ssize_t size = Py_SIZE(sequence); #else Py_ssize_t size = PySequence_Size(sequence); #endif if (unlikely(size != 4)) { if (size > 4) __Pyx_RaiseTooManyValuesError(4); else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 91; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } #if CYTHON_COMPILING_IN_CPYTHON if (likely(PyTuple_CheckExact(sequence))) { __pyx_t_8 = PyTuple_GET_ITEM(sequence, 0); __pyx_t_7 = PyTuple_GET_ITEM(sequence, 1); __pyx_t_9 = PyTuple_GET_ITEM(sequence, 2); __pyx_t_6 = PyTuple_GET_ITEM(sequence, 3); } else { __pyx_t_8 = PyList_GET_ITEM(sequence, 0); __pyx_t_7 = PyList_GET_ITEM(sequence, 1); __pyx_t_9 = PyList_GET_ITEM(sequence, 2); __pyx_t_6 = PyList_GET_ITEM(sequence, 3); } __Pyx_INCREF(__pyx_t_8); __Pyx_INCREF(__pyx_t_7); __Pyx_INCREF(__pyx_t_9); __Pyx_INCREF(__pyx_t_6); #else { Py_ssize_t i; PyObject** temps[4] = {&__pyx_t_8,&__pyx_t_7,&__pyx_t_9,&__pyx_t_6}; for (i=0; i < 4; i++) { PyObject* item = PySequence_ITEM(sequence, i); if (unlikely(!item)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 91; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(item); *(temps[i]) = item; } } #endif } else { Py_ssize_t index = -1; PyObject** temps[4] = {&__pyx_t_8,&__pyx_t_7,&__pyx_t_9,&__pyx_t_6}; __pyx_t_1 = PyObject_GetIter(__pyx_v_11pygame_sdl2_5mixer_preinit_args); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 91; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_t_13 = Py_TYPE(__pyx_t_1)->tp_iternext; for (index=0; index < 4; index++) { PyObject* item = __pyx_t_13(__pyx_t_1); if (unlikely(!item)) goto __pyx_L8_unpacking_failed; __Pyx_GOTREF(item); *(temps[index]) = item; } if (__Pyx_IternextUnpackEndCheck(__pyx_t_13(__pyx_t_1), 4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 91; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_t_13 = NULL; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; goto __pyx_L9_unpacking_done; __pyx_L8_unpacking_failed:; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_13 = NULL; if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 91; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_L9_unpacking_done:; } __Pyx_DECREF_SET(__pyx_v_frequency, __pyx_t_8); __pyx_t_8 = 0; __Pyx_DECREF_SET(__pyx_v_size, __pyx_t_7); __pyx_t_7 = 0; __Pyx_DECREF_SET(__pyx_v_channels, __pyx_t_9); __pyx_t_9 = 0; __Pyx_DECREF_SET(__pyx_v_buffer, __pyx_t_6); __pyx_t_6 = 0; goto __pyx_L7; } __pyx_L7:; /* "pygame_sdl2/mixer.pyx":93 * frequency, size, channels, buffer = preinit_args * * if Mix_OpenAudio(frequency, size, channels, buffer) != 0: # <<<<<<<<<<<<<< * raise error() * */ __pyx_t_14 = __Pyx_PyInt_As_int(__pyx_v_frequency); if (unlikely((__pyx_t_14 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 93; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_t_15 = __Pyx_PyInt_As_uint16_t(__pyx_v_size); if (unlikely((__pyx_t_15 == (Uint16)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 93; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_t_16 = __Pyx_PyInt_As_int(__pyx_v_channels); if (unlikely((__pyx_t_16 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 93; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_t_17 = __Pyx_PyInt_As_int(__pyx_v_buffer); if (unlikely((__pyx_t_17 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 93; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_t_5 = ((Mix_OpenAudio(__pyx_t_14, __pyx_t_15, __pyx_t_16, __pyx_t_17) != 0) != 0); if (__pyx_t_5) { /* "pygame_sdl2/mixer.pyx":94 * * if Mix_OpenAudio(frequency, size, channels, buffer) != 0: * raise error() # <<<<<<<<<<<<<< * * global output_spec */ __pyx_t_9 = __Pyx_GetModuleGlobalName(__pyx_n_s_error); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 94; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_9); __pyx_t_7 = NULL; if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_9))) { __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_9); if (likely(__pyx_t_7)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_9); __Pyx_INCREF(__pyx_t_7); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_9, function); } } if (__pyx_t_7) { __pyx_t_6 = __Pyx_PyObject_CallOneArg(__pyx_t_9, __pyx_t_7); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 94; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; } else { __pyx_t_6 = __Pyx_PyObject_CallNoArg(__pyx_t_9); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 94; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; __Pyx_Raise(__pyx_t_6, 0, 0, 0); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; {__pyx_filename = __pyx_f[0]; __pyx_lineno = 94; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } /* "pygame_sdl2/mixer.pyx":97 * * global output_spec * output_spec = get_init() # <<<<<<<<<<<<<< * * Mix_ChannelFinished(channel_callback) */ __pyx_t_9 = __Pyx_GetModuleGlobalName(__pyx_n_s_get_init); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 97; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_9); __pyx_t_7 = NULL; if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_9))) { __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_9); if (likely(__pyx_t_7)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_9); __Pyx_INCREF(__pyx_t_7); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_9, function); } } if (__pyx_t_7) { __pyx_t_6 = __Pyx_PyObject_CallOneArg(__pyx_t_9, __pyx_t_7); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 97; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; } else { __pyx_t_6 = __Pyx_PyObject_CallNoArg(__pyx_t_9); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 97; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; __Pyx_XGOTREF(__pyx_v_11pygame_sdl2_5mixer_output_spec); __Pyx_DECREF_SET(__pyx_v_11pygame_sdl2_5mixer_output_spec, __pyx_t_6); __Pyx_GIVEREF(__pyx_t_6); __pyx_t_6 = 0; /* "pygame_sdl2/mixer.pyx":99 * output_spec = get_init() * * Mix_ChannelFinished(channel_callback) # <<<<<<<<<<<<<< * * def pre_init(frequency=22050, size=MIX_DEFAULT_FORMAT, channels=2, buffersize=4096): */ Mix_ChannelFinished(__pyx_f_11pygame_sdl2_5mixer_channel_callback); /* "pygame_sdl2/mixer.pyx":80 * * @pygame_sdl2.register_init * def init(frequency=22050, size=MIX_DEFAULT_FORMAT, channels=2, buffer=4096): # <<<<<<<<<<<<<< * if get_init() is not None: * return */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_6); __Pyx_XDECREF(__pyx_t_7); __Pyx_XDECREF(__pyx_t_8); __Pyx_XDECREF(__pyx_t_9); __Pyx_AddTraceback("pygame_sdl2.mixer.init", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF(__pyx_v_frequency); __Pyx_XDECREF(__pyx_v_size); __Pyx_XDECREF(__pyx_v_channels); __Pyx_XDECREF(__pyx_v_buffer); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/mixer.pyx":101 * Mix_ChannelFinished(channel_callback) * * def pre_init(frequency=22050, size=MIX_DEFAULT_FORMAT, channels=2, buffersize=4096): # <<<<<<<<<<<<<< * global preinit_args * preinit_args = (frequency, size, channels, buffersize) */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_5mixer_5pre_init(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static PyMethodDef __pyx_mdef_11pygame_sdl2_5mixer_5pre_init = {"pre_init", (PyCFunction)__pyx_pw_11pygame_sdl2_5mixer_5pre_init, METH_VARARGS|METH_KEYWORDS, 0}; static PyObject *__pyx_pw_11pygame_sdl2_5mixer_5pre_init(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_frequency = 0; PyObject *__pyx_v_size = 0; PyObject *__pyx_v_channels = 0; PyObject *__pyx_v_buffersize = 0; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("pre_init (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_frequency,&__pyx_n_s_size,&__pyx_n_s_channels,&__pyx_n_s_buffersize,0}; PyObject* values[4] = {0,0,0,0}; values[0] = ((PyObject *)__pyx_int_22050); values[1] = __pyx_k__5; values[2] = ((PyObject *)__pyx_int_2); values[3] = ((PyObject *)__pyx_int_4096); if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (kw_args > 0) { PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_frequency); if (value) { values[0] = value; kw_args--; } } case 1: if (kw_args > 0) { PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_size); if (value) { values[1] = value; kw_args--; } } case 2: if (kw_args > 0) { PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_channels); if (value) { values[2] = value; kw_args--; } } case 3: if (kw_args > 0) { PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_buffersize); if (value) { values[3] = value; kw_args--; } } } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "pre_init") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 101; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } } else { switch (PyTuple_GET_SIZE(__pyx_args)) { case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); case 0: break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_frequency = values[0]; __pyx_v_size = values[1]; __pyx_v_channels = values[2]; __pyx_v_buffersize = values[3]; } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("pre_init", 0, 0, 4, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 101; __pyx_clineno = __LINE__; goto __pyx_L3_error;} __pyx_L3_error:; __Pyx_AddTraceback("pygame_sdl2.mixer.pre_init", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_11pygame_sdl2_5mixer_4pre_init(__pyx_self, __pyx_v_frequency, __pyx_v_size, __pyx_v_channels, __pyx_v_buffersize); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_5mixer_4pre_init(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_frequency, PyObject *__pyx_v_size, PyObject *__pyx_v_channels, PyObject *__pyx_v_buffersize) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("pre_init", 0); /* "pygame_sdl2/mixer.pyx":103 * def pre_init(frequency=22050, size=MIX_DEFAULT_FORMAT, channels=2, buffersize=4096): * global preinit_args * preinit_args = (frequency, size, channels, buffersize) # <<<<<<<<<<<<<< * * @pygame_sdl2.register_quit */ __pyx_t_1 = PyTuple_New(4); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 103; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __Pyx_INCREF(__pyx_v_frequency); PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_frequency); __Pyx_GIVEREF(__pyx_v_frequency); __Pyx_INCREF(__pyx_v_size); PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_v_size); __Pyx_GIVEREF(__pyx_v_size); __Pyx_INCREF(__pyx_v_channels); PyTuple_SET_ITEM(__pyx_t_1, 2, __pyx_v_channels); __Pyx_GIVEREF(__pyx_v_channels); __Pyx_INCREF(__pyx_v_buffersize); PyTuple_SET_ITEM(__pyx_t_1, 3, __pyx_v_buffersize); __Pyx_GIVEREF(__pyx_v_buffersize); __Pyx_XGOTREF(__pyx_v_11pygame_sdl2_5mixer_preinit_args); __Pyx_DECREF_SET(__pyx_v_11pygame_sdl2_5mixer_preinit_args, __pyx_t_1); __Pyx_GIVEREF(__pyx_t_1); __pyx_t_1 = 0; /* "pygame_sdl2/mixer.pyx":101 * Mix_ChannelFinished(channel_callback) * * def pre_init(frequency=22050, size=MIX_DEFAULT_FORMAT, channels=2, buffersize=4096): # <<<<<<<<<<<<<< * global preinit_args * preinit_args = (frequency, size, channels, buffersize) */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("pygame_sdl2.mixer.pre_init", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/mixer.pyx":106 * * @pygame_sdl2.register_quit * def quit(): # @ReservedAssignment # <<<<<<<<<<<<<< * Mix_CloseAudio() * Mix_Quit() */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_5mixer_7quit(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused); /*proto*/ static PyMethodDef __pyx_mdef_11pygame_sdl2_5mixer_7quit = {"quit", (PyCFunction)__pyx_pw_11pygame_sdl2_5mixer_7quit, METH_NOARGS, 0}; static PyObject *__pyx_pw_11pygame_sdl2_5mixer_7quit(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("quit (wrapper)", 0); __pyx_r = __pyx_pf_11pygame_sdl2_5mixer_6quit(__pyx_self); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_5mixer_6quit(CYTHON_UNUSED PyObject *__pyx_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("quit", 0); /* "pygame_sdl2/mixer.pyx":107 * @pygame_sdl2.register_quit * def quit(): # @ReservedAssignment * Mix_CloseAudio() # <<<<<<<<<<<<<< * Mix_Quit() * */ Mix_CloseAudio(); /* "pygame_sdl2/mixer.pyx":108 * def quit(): # @ReservedAssignment * Mix_CloseAudio() * Mix_Quit() # <<<<<<<<<<<<<< * * def get_init(): */ Mix_Quit(); /* "pygame_sdl2/mixer.pyx":106 * * @pygame_sdl2.register_quit * def quit(): # @ReservedAssignment # <<<<<<<<<<<<<< * Mix_CloseAudio() * Mix_Quit() */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/mixer.pyx":110 * Mix_Quit() * * def get_init(): # <<<<<<<<<<<<<< * cdef int frequency * cdef Uint16 format */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_5mixer_9get_init(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused); /*proto*/ static PyMethodDef __pyx_mdef_11pygame_sdl2_5mixer_9get_init = {"get_init", (PyCFunction)__pyx_pw_11pygame_sdl2_5mixer_9get_init, METH_NOARGS, 0}; static PyObject *__pyx_pw_11pygame_sdl2_5mixer_9get_init(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("get_init (wrapper)", 0); __pyx_r = __pyx_pf_11pygame_sdl2_5mixer_8get_init(__pyx_self); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_5mixer_8get_init(CYTHON_UNUSED PyObject *__pyx_self) { int __pyx_v_frequency; Uint16 __pyx_v_format; int __pyx_v_channels; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; PyObject *__pyx_t_5 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("get_init", 0); /* "pygame_sdl2/mixer.pyx":115 * cdef int channels * * if Mix_QuerySpec(&frequency, &format, &channels) == 0: # <<<<<<<<<<<<<< * return None * else: */ __pyx_t_1 = ((Mix_QuerySpec((&__pyx_v_frequency), (&__pyx_v_format), (&__pyx_v_channels)) == 0) != 0); if (__pyx_t_1) { /* "pygame_sdl2/mixer.pyx":116 * * if Mix_QuerySpec(&frequency, &format, &channels) == 0: * return None # <<<<<<<<<<<<<< * else: * return frequency, format, channels */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(Py_None); __pyx_r = Py_None; goto __pyx_L0; } /*else*/ { /* "pygame_sdl2/mixer.pyx":118 * return None * else: * return frequency, format, channels # <<<<<<<<<<<<<< * * def stop(): */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_v_frequency); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 118; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = __Pyx_PyInt_From_uint16_t(__pyx_v_format); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 118; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = __Pyx_PyInt_From_int(__pyx_v_channels); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 118; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); __pyx_t_5 = PyTuple_New(3); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 118; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_2); __Pyx_GIVEREF(__pyx_t_2); PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_t_3); __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_5, 2, __pyx_t_4); __Pyx_GIVEREF(__pyx_t_4); __pyx_t_2 = 0; __pyx_t_3 = 0; __pyx_t_4 = 0; __pyx_r = __pyx_t_5; __pyx_t_5 = 0; goto __pyx_L0; } /* "pygame_sdl2/mixer.pyx":110 * Mix_Quit() * * def get_init(): # <<<<<<<<<<<<<< * cdef int frequency * cdef Uint16 format */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_5); __Pyx_AddTraceback("pygame_sdl2.mixer.get_init", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/mixer.pyx":120 * return frequency, format, channels * * def stop(): # <<<<<<<<<<<<<< * with nogil: * Mix_HaltChannel(-1) */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_5mixer_11stop(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused); /*proto*/ static PyMethodDef __pyx_mdef_11pygame_sdl2_5mixer_11stop = {"stop", (PyCFunction)__pyx_pw_11pygame_sdl2_5mixer_11stop, METH_NOARGS, 0}; static PyObject *__pyx_pw_11pygame_sdl2_5mixer_11stop(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("stop (wrapper)", 0); __pyx_r = __pyx_pf_11pygame_sdl2_5mixer_10stop(__pyx_self); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_5mixer_10stop(CYTHON_UNUSED PyObject *__pyx_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("stop", 0); /* "pygame_sdl2/mixer.pyx":121 * * def stop(): * with nogil: # <<<<<<<<<<<<<< * Mix_HaltChannel(-1) * */ { #ifdef WITH_THREAD PyThreadState *_save; Py_UNBLOCK_THREADS #endif /*try:*/ { /* "pygame_sdl2/mixer.pyx":122 * def stop(): * with nogil: * Mix_HaltChannel(-1) # <<<<<<<<<<<<<< * * def pause(): */ Mix_HaltChannel(-1); } /* "pygame_sdl2/mixer.pyx":121 * * def stop(): * with nogil: # <<<<<<<<<<<<<< * Mix_HaltChannel(-1) * */ /*finally:*/ { /*normal exit:*/{ #ifdef WITH_THREAD Py_BLOCK_THREADS #endif goto __pyx_L5; } __pyx_L5:; } } /* "pygame_sdl2/mixer.pyx":120 * return frequency, format, channels * * def stop(): # <<<<<<<<<<<<<< * with nogil: * Mix_HaltChannel(-1) */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/mixer.pyx":124 * Mix_HaltChannel(-1) * * def pause(): # <<<<<<<<<<<<<< * with nogil: * Mix_Pause(-1) */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_5mixer_13pause(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused); /*proto*/ static PyMethodDef __pyx_mdef_11pygame_sdl2_5mixer_13pause = {"pause", (PyCFunction)__pyx_pw_11pygame_sdl2_5mixer_13pause, METH_NOARGS, 0}; static PyObject *__pyx_pw_11pygame_sdl2_5mixer_13pause(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("pause (wrapper)", 0); __pyx_r = __pyx_pf_11pygame_sdl2_5mixer_12pause(__pyx_self); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_5mixer_12pause(CYTHON_UNUSED PyObject *__pyx_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("pause", 0); /* "pygame_sdl2/mixer.pyx":125 * * def pause(): * with nogil: # <<<<<<<<<<<<<< * Mix_Pause(-1) * */ { #ifdef WITH_THREAD PyThreadState *_save; Py_UNBLOCK_THREADS #endif /*try:*/ { /* "pygame_sdl2/mixer.pyx":126 * def pause(): * with nogil: * Mix_Pause(-1) # <<<<<<<<<<<<<< * * def unpause(): */ Mix_Pause(-1); } /* "pygame_sdl2/mixer.pyx":125 * * def pause(): * with nogil: # <<<<<<<<<<<<<< * Mix_Pause(-1) * */ /*finally:*/ { /*normal exit:*/{ #ifdef WITH_THREAD Py_BLOCK_THREADS #endif goto __pyx_L5; } __pyx_L5:; } } /* "pygame_sdl2/mixer.pyx":124 * Mix_HaltChannel(-1) * * def pause(): # <<<<<<<<<<<<<< * with nogil: * Mix_Pause(-1) */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/mixer.pyx":128 * Mix_Pause(-1) * * def unpause(): # <<<<<<<<<<<<<< * with nogil: * Mix_Resume(-1) */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_5mixer_15unpause(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused); /*proto*/ static PyMethodDef __pyx_mdef_11pygame_sdl2_5mixer_15unpause = {"unpause", (PyCFunction)__pyx_pw_11pygame_sdl2_5mixer_15unpause, METH_NOARGS, 0}; static PyObject *__pyx_pw_11pygame_sdl2_5mixer_15unpause(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("unpause (wrapper)", 0); __pyx_r = __pyx_pf_11pygame_sdl2_5mixer_14unpause(__pyx_self); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_5mixer_14unpause(CYTHON_UNUSED PyObject *__pyx_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("unpause", 0); /* "pygame_sdl2/mixer.pyx":129 * * def unpause(): * with nogil: # <<<<<<<<<<<<<< * Mix_Resume(-1) * */ { #ifdef WITH_THREAD PyThreadState *_save; Py_UNBLOCK_THREADS #endif /*try:*/ { /* "pygame_sdl2/mixer.pyx":130 * def unpause(): * with nogil: * Mix_Resume(-1) # <<<<<<<<<<<<<< * * def fadeout(time): */ Mix_Resume(-1); } /* "pygame_sdl2/mixer.pyx":129 * * def unpause(): * with nogil: # <<<<<<<<<<<<<< * Mix_Resume(-1) * */ /*finally:*/ { /*normal exit:*/{ #ifdef WITH_THREAD Py_BLOCK_THREADS #endif goto __pyx_L5; } __pyx_L5:; } } /* "pygame_sdl2/mixer.pyx":128 * Mix_Pause(-1) * * def unpause(): # <<<<<<<<<<<<<< * with nogil: * Mix_Resume(-1) */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/mixer.pyx":132 * Mix_Resume(-1) * * def fadeout(time): # <<<<<<<<<<<<<< * cdef int ms = time * with nogil: */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_5mixer_17fadeout(PyObject *__pyx_self, PyObject *__pyx_v_time); /*proto*/ static PyMethodDef __pyx_mdef_11pygame_sdl2_5mixer_17fadeout = {"fadeout", (PyCFunction)__pyx_pw_11pygame_sdl2_5mixer_17fadeout, METH_O, 0}; static PyObject *__pyx_pw_11pygame_sdl2_5mixer_17fadeout(PyObject *__pyx_self, PyObject *__pyx_v_time) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("fadeout (wrapper)", 0); __pyx_r = __pyx_pf_11pygame_sdl2_5mixer_16fadeout(__pyx_self, ((PyObject *)__pyx_v_time)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_5mixer_16fadeout(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_time) { int __pyx_v_ms; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("fadeout", 0); /* "pygame_sdl2/mixer.pyx":133 * * def fadeout(time): * cdef int ms = time # <<<<<<<<<<<<<< * with nogil: * Mix_FadeOutChannel(-1, ms) */ __pyx_t_1 = __Pyx_PyInt_As_int(__pyx_v_time); if (unlikely((__pyx_t_1 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 133; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_v_ms = __pyx_t_1; /* "pygame_sdl2/mixer.pyx":134 * def fadeout(time): * cdef int ms = time * with nogil: # <<<<<<<<<<<<<< * Mix_FadeOutChannel(-1, ms) * */ { #ifdef WITH_THREAD PyThreadState *_save; Py_UNBLOCK_THREADS #endif /*try:*/ { /* "pygame_sdl2/mixer.pyx":135 * cdef int ms = time * with nogil: * Mix_FadeOutChannel(-1, ms) # <<<<<<<<<<<<<< * * def set_num_channels(count): */ Mix_FadeOutChannel(-1, __pyx_v_ms); } /* "pygame_sdl2/mixer.pyx":134 * def fadeout(time): * cdef int ms = time * with nogil: # <<<<<<<<<<<<<< * Mix_FadeOutChannel(-1, ms) * */ /*finally:*/ { /*normal exit:*/{ #ifdef WITH_THREAD Py_BLOCK_THREADS #endif goto __pyx_L5; } __pyx_L5:; } } /* "pygame_sdl2/mixer.pyx":132 * Mix_Resume(-1) * * def fadeout(time): # <<<<<<<<<<<<<< * cdef int ms = time * with nogil: */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("pygame_sdl2.mixer.fadeout", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/mixer.pyx":137 * Mix_FadeOutChannel(-1, ms) * * def set_num_channels(count): # <<<<<<<<<<<<<< * Mix_AllocateChannels(count) * */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_5mixer_19set_num_channels(PyObject *__pyx_self, PyObject *__pyx_v_count); /*proto*/ static PyMethodDef __pyx_mdef_11pygame_sdl2_5mixer_19set_num_channels = {"set_num_channels", (PyCFunction)__pyx_pw_11pygame_sdl2_5mixer_19set_num_channels, METH_O, 0}; static PyObject *__pyx_pw_11pygame_sdl2_5mixer_19set_num_channels(PyObject *__pyx_self, PyObject *__pyx_v_count) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("set_num_channels (wrapper)", 0); __pyx_r = __pyx_pf_11pygame_sdl2_5mixer_18set_num_channels(__pyx_self, ((PyObject *)__pyx_v_count)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_5mixer_18set_num_channels(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_count) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("set_num_channels", 0); /* "pygame_sdl2/mixer.pyx":138 * * def set_num_channels(count): * Mix_AllocateChannels(count) # <<<<<<<<<<<<<< * * def get_num_channels(): */ __pyx_t_1 = __Pyx_PyInt_As_int(__pyx_v_count); if (unlikely((__pyx_t_1 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 138; __pyx_clineno = __LINE__; goto __pyx_L1_error;} Mix_AllocateChannels(__pyx_t_1); /* "pygame_sdl2/mixer.pyx":137 * Mix_FadeOutChannel(-1, ms) * * def set_num_channels(count): # <<<<<<<<<<<<<< * Mix_AllocateChannels(count) * */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("pygame_sdl2.mixer.set_num_channels", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/mixer.pyx":140 * Mix_AllocateChannels(count) * * def get_num_channels(): # <<<<<<<<<<<<<< * return Mix_AllocateChannels(-1) * */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_5mixer_21get_num_channels(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused); /*proto*/ static PyMethodDef __pyx_mdef_11pygame_sdl2_5mixer_21get_num_channels = {"get_num_channels", (PyCFunction)__pyx_pw_11pygame_sdl2_5mixer_21get_num_channels, METH_NOARGS, 0}; static PyObject *__pyx_pw_11pygame_sdl2_5mixer_21get_num_channels(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("get_num_channels (wrapper)", 0); __pyx_r = __pyx_pf_11pygame_sdl2_5mixer_20get_num_channels(__pyx_self); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_5mixer_20get_num_channels(CYTHON_UNUSED PyObject *__pyx_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("get_num_channels", 0); /* "pygame_sdl2/mixer.pyx":141 * * def get_num_channels(): * return Mix_AllocateChannels(-1) # <<<<<<<<<<<<<< * * def set_reserved(count): */ __Pyx_XDECREF(__pyx_r); __pyx_t_1 = __Pyx_PyInt_From_int(Mix_AllocateChannels(-1)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 141; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "pygame_sdl2/mixer.pyx":140 * Mix_AllocateChannels(count) * * def get_num_channels(): # <<<<<<<<<<<<<< * return Mix_AllocateChannels(-1) * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("pygame_sdl2.mixer.get_num_channels", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/mixer.pyx":143 * return Mix_AllocateChannels(-1) * * def set_reserved(count): # <<<<<<<<<<<<<< * Mix_ReserveChannels(count) * */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_5mixer_23set_reserved(PyObject *__pyx_self, PyObject *__pyx_v_count); /*proto*/ static PyMethodDef __pyx_mdef_11pygame_sdl2_5mixer_23set_reserved = {"set_reserved", (PyCFunction)__pyx_pw_11pygame_sdl2_5mixer_23set_reserved, METH_O, 0}; static PyObject *__pyx_pw_11pygame_sdl2_5mixer_23set_reserved(PyObject *__pyx_self, PyObject *__pyx_v_count) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("set_reserved (wrapper)", 0); __pyx_r = __pyx_pf_11pygame_sdl2_5mixer_22set_reserved(__pyx_self, ((PyObject *)__pyx_v_count)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_5mixer_22set_reserved(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_count) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("set_reserved", 0); /* "pygame_sdl2/mixer.pyx":144 * * def set_reserved(count): * Mix_ReserveChannels(count) # <<<<<<<<<<<<<< * * def find_channel(force=False): */ __pyx_t_1 = __Pyx_PyInt_As_int(__pyx_v_count); if (unlikely((__pyx_t_1 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 144; __pyx_clineno = __LINE__; goto __pyx_L1_error;} Mix_ReserveChannels(__pyx_t_1); /* "pygame_sdl2/mixer.pyx":143 * return Mix_AllocateChannels(-1) * * def set_reserved(count): # <<<<<<<<<<<<<< * Mix_ReserveChannels(count) * */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("pygame_sdl2.mixer.set_reserved", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/mixer.pyx":146 * Mix_ReserveChannels(count) * * def find_channel(force=False): # <<<<<<<<<<<<<< * cdef int chan * chan = Mix_GroupAvailable(-1) */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_5mixer_25find_channel(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static PyMethodDef __pyx_mdef_11pygame_sdl2_5mixer_25find_channel = {"find_channel", (PyCFunction)__pyx_pw_11pygame_sdl2_5mixer_25find_channel, METH_VARARGS|METH_KEYWORDS, 0}; static PyObject *__pyx_pw_11pygame_sdl2_5mixer_25find_channel(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_force = 0; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("find_channel (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_force,0}; PyObject* values[1] = {0}; values[0] = ((PyObject *)Py_False); if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (kw_args > 0) { PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_force); if (value) { values[0] = value; kw_args--; } } } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "find_channel") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 146; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } } else { switch (PyTuple_GET_SIZE(__pyx_args)) { case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); case 0: break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_force = values[0]; } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("find_channel", 0, 0, 1, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 146; __pyx_clineno = __LINE__; goto __pyx_L3_error;} __pyx_L3_error:; __Pyx_AddTraceback("pygame_sdl2.mixer.find_channel", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_11pygame_sdl2_5mixer_24find_channel(__pyx_self, __pyx_v_force); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_5mixer_24find_channel(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_force) { int __pyx_v_chan; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; int __pyx_t_2; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; PyObject *__pyx_t_5 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("find_channel", 0); /* "pygame_sdl2/mixer.pyx":148 * def find_channel(force=False): * cdef int chan * chan = Mix_GroupAvailable(-1) # <<<<<<<<<<<<<< * if chan == -1: * if not force: */ __pyx_v_chan = Mix_GroupAvailable(-1); /* "pygame_sdl2/mixer.pyx":149 * cdef int chan * chan = Mix_GroupAvailable(-1) * if chan == -1: # <<<<<<<<<<<<<< * if not force: * return None */ __pyx_t_1 = ((__pyx_v_chan == -1) != 0); if (__pyx_t_1) { /* "pygame_sdl2/mixer.pyx":150 * chan = Mix_GroupAvailable(-1) * if chan == -1: * if not force: # <<<<<<<<<<<<<< * return None * chan = Mix_GroupOldest(-1) */ __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_force); if (unlikely(__pyx_t_1 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 150; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_t_2 = ((!__pyx_t_1) != 0); if (__pyx_t_2) { /* "pygame_sdl2/mixer.pyx":151 * if chan == -1: * if not force: * return None # <<<<<<<<<<<<<< * chan = Mix_GroupOldest(-1) * if chan == -1: */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(Py_None); __pyx_r = Py_None; goto __pyx_L0; } /* "pygame_sdl2/mixer.pyx":152 * if not force: * return None * chan = Mix_GroupOldest(-1) # <<<<<<<<<<<<<< * if chan == -1: * raise error() */ __pyx_v_chan = Mix_GroupOldest(-1); /* "pygame_sdl2/mixer.pyx":153 * return None * chan = Mix_GroupOldest(-1) * if chan == -1: # <<<<<<<<<<<<<< * raise error() * return Channel(chan) */ __pyx_t_2 = ((__pyx_v_chan == -1) != 0); if (__pyx_t_2) { /* "pygame_sdl2/mixer.pyx":154 * chan = Mix_GroupOldest(-1) * if chan == -1: * raise error() # <<<<<<<<<<<<<< * return Channel(chan) * */ __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_error); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 154; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); __pyx_t_5 = NULL; if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_4))) { __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4); if (likely(__pyx_t_5)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4); __Pyx_INCREF(__pyx_t_5); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_4, function); } } if (__pyx_t_5) { __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_5); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 154; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; } else { __pyx_t_3 = __Pyx_PyObject_CallNoArg(__pyx_t_4); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 154; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_Raise(__pyx_t_3, 0, 0, 0); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; {__pyx_filename = __pyx_f[0]; __pyx_lineno = 154; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } goto __pyx_L3; } __pyx_L3:; /* "pygame_sdl2/mixer.pyx":155 * if chan == -1: * raise error() * return Channel(chan) # <<<<<<<<<<<<<< * * def get_busy(): */ __Pyx_XDECREF(__pyx_r); __pyx_t_3 = __Pyx_PyInt_From_int(__pyx_v_chan); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 155; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 155; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_3); __Pyx_GIVEREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_3 = __Pyx_PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_11pygame_sdl2_5mixer_Channel)), __pyx_t_4, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 155; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_r = __pyx_t_3; __pyx_t_3 = 0; goto __pyx_L0; /* "pygame_sdl2/mixer.pyx":146 * Mix_ReserveChannels(count) * * def find_channel(force=False): # <<<<<<<<<<<<<< * cdef int chan * chan = Mix_GroupAvailable(-1) */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_5); __Pyx_AddTraceback("pygame_sdl2.mixer.find_channel", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/mixer.pyx":157 * return Channel(chan) * * def get_busy(): # <<<<<<<<<<<<<< * return Mix_GroupNewer(-1) != -1 * */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_5mixer_27get_busy(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused); /*proto*/ static PyMethodDef __pyx_mdef_11pygame_sdl2_5mixer_27get_busy = {"get_busy", (PyCFunction)__pyx_pw_11pygame_sdl2_5mixer_27get_busy, METH_NOARGS, 0}; static PyObject *__pyx_pw_11pygame_sdl2_5mixer_27get_busy(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("get_busy (wrapper)", 0); __pyx_r = __pyx_pf_11pygame_sdl2_5mixer_26get_busy(__pyx_self); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_5mixer_26get_busy(CYTHON_UNUSED PyObject *__pyx_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("get_busy", 0); /* "pygame_sdl2/mixer.pyx":158 * * def get_busy(): * return Mix_GroupNewer(-1) != -1 # <<<<<<<<<<<<<< * * */ __Pyx_XDECREF(__pyx_r); __pyx_t_1 = __Pyx_PyBool_FromLong((Mix_GroupNewer(-1) != -1)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 158; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "pygame_sdl2/mixer.pyx":157 * return Channel(chan) * * def get_busy(): # <<<<<<<<<<<<<< * return Mix_GroupNewer(-1) != -1 * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("pygame_sdl2.mixer.get_busy", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/mixer.pyx":164 * cdef Mix_Chunk *chunk * * def __cinit__(self): # <<<<<<<<<<<<<< * self.chunk = NULL * */ /* Python wrapper */ static int __pyx_pw_11pygame_sdl2_5mixer_5Sound_1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static int __pyx_pw_11pygame_sdl2_5mixer_5Sound_1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__cinit__ (wrapper)", 0); if (unlikely(PyTuple_GET_SIZE(__pyx_args) > 0)) { __Pyx_RaiseArgtupleInvalid("__cinit__", 1, 0, 0, PyTuple_GET_SIZE(__pyx_args)); return -1;} if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "__cinit__", 0))) return -1; __pyx_r = __pyx_pf_11pygame_sdl2_5mixer_5Sound___cinit__(((struct __pyx_obj_11pygame_sdl2_5mixer_Sound *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static int __pyx_pf_11pygame_sdl2_5mixer_5Sound___cinit__(struct __pyx_obj_11pygame_sdl2_5mixer_Sound *__pyx_v_self) { int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__cinit__", 0); /* "pygame_sdl2/mixer.pyx":165 * * def __cinit__(self): * self.chunk = NULL # <<<<<<<<<<<<<< * * def __dealloc__(self): */ __pyx_v_self->chunk = NULL; /* "pygame_sdl2/mixer.pyx":164 * cdef Mix_Chunk *chunk * * def __cinit__(self): # <<<<<<<<<<<<<< * self.chunk = NULL * */ /* function exit code */ __pyx_r = 0; __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/mixer.pyx":167 * self.chunk = NULL * * def __dealloc__(self): # <<<<<<<<<<<<<< * if self.chunk: * Mix_FreeChunk(self.chunk) */ /* Python wrapper */ static void __pyx_pw_11pygame_sdl2_5mixer_5Sound_3__dealloc__(PyObject *__pyx_v_self); /*proto*/ static void __pyx_pw_11pygame_sdl2_5mixer_5Sound_3__dealloc__(PyObject *__pyx_v_self) { __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__dealloc__ (wrapper)", 0); __pyx_pf_11pygame_sdl2_5mixer_5Sound_2__dealloc__(((struct __pyx_obj_11pygame_sdl2_5mixer_Sound *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); } static void __pyx_pf_11pygame_sdl2_5mixer_5Sound_2__dealloc__(struct __pyx_obj_11pygame_sdl2_5mixer_Sound *__pyx_v_self) { __Pyx_RefNannyDeclarations int __pyx_t_1; __Pyx_RefNannySetupContext("__dealloc__", 0); /* "pygame_sdl2/mixer.pyx":168 * * def __dealloc__(self): * if self.chunk: # <<<<<<<<<<<<<< * Mix_FreeChunk(self.chunk) * */ __pyx_t_1 = (__pyx_v_self->chunk != 0); if (__pyx_t_1) { /* "pygame_sdl2/mixer.pyx":169 * def __dealloc__(self): * if self.chunk: * Mix_FreeChunk(self.chunk) # <<<<<<<<<<<<<< * * def __init__(self, fi): */ Mix_FreeChunk(__pyx_v_self->chunk); goto __pyx_L3; } __pyx_L3:; /* "pygame_sdl2/mixer.pyx":167 * self.chunk = NULL * * def __dealloc__(self): # <<<<<<<<<<<<<< * if self.chunk: * Mix_FreeChunk(self.chunk) */ /* function exit code */ __Pyx_RefNannyFinishContext(); } /* "pygame_sdl2/mixer.pyx":171 * Mix_FreeChunk(self.chunk) * * def __init__(self, fi): # <<<<<<<<<<<<<< * self.chunk = Mix_LoadWAV_RW(to_rwops(fi), 1) * if self.chunk == NULL: */ /* Python wrapper */ static int __pyx_pw_11pygame_sdl2_5mixer_5Sound_5__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static int __pyx_pw_11pygame_sdl2_5mixer_5Sound_5__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_fi = 0; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__init__ (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_fi,0}; PyObject* values[1] = {0}; if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_fi)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__init__") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 171; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } } else if (PyTuple_GET_SIZE(__pyx_args) != 1) { goto __pyx_L5_argtuple_error; } else { values[0] = PyTuple_GET_ITEM(__pyx_args, 0); } __pyx_v_fi = values[0]; } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("__init__", 1, 1, 1, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 171; __pyx_clineno = __LINE__; goto __pyx_L3_error;} __pyx_L3_error:; __Pyx_AddTraceback("pygame_sdl2.mixer.Sound.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return -1; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_11pygame_sdl2_5mixer_5Sound_4__init__(((struct __pyx_obj_11pygame_sdl2_5mixer_Sound *)__pyx_v_self), __pyx_v_fi); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static int __pyx_pf_11pygame_sdl2_5mixer_5Sound_4__init__(struct __pyx_obj_11pygame_sdl2_5mixer_Sound *__pyx_v_self, PyObject *__pyx_v_fi) { int __pyx_r; __Pyx_RefNannyDeclarations SDL_RWops *__pyx_t_1; int __pyx_t_2; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; PyObject *__pyx_t_5 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__init__", 0); /* "pygame_sdl2/mixer.pyx":172 * * def __init__(self, fi): * self.chunk = Mix_LoadWAV_RW(to_rwops(fi), 1) # <<<<<<<<<<<<<< * if self.chunk == NULL: * raise error() */ __pyx_t_1 = __pyx_f_11pygame_sdl2_8rwobject_to_rwops(__pyx_v_fi, NULL); if (unlikely(__pyx_t_1 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 172; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_v_self->chunk = Mix_LoadWAV_RW(__pyx_t_1, 1); /* "pygame_sdl2/mixer.pyx":173 * def __init__(self, fi): * self.chunk = Mix_LoadWAV_RW(to_rwops(fi), 1) * if self.chunk == NULL: # <<<<<<<<<<<<<< * raise error() * */ __pyx_t_2 = ((__pyx_v_self->chunk == NULL) != 0); if (__pyx_t_2) { /* "pygame_sdl2/mixer.pyx":174 * self.chunk = Mix_LoadWAV_RW(to_rwops(fi), 1) * if self.chunk == NULL: * raise error() # <<<<<<<<<<<<<< * * def play(self, loops=0, maxtime=-1, fade_ms=0): */ __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_error); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 174; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); __pyx_t_5 = NULL; if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_4))) { __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4); if (likely(__pyx_t_5)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4); __Pyx_INCREF(__pyx_t_5); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_4, function); } } if (__pyx_t_5) { __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_5); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 174; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; } else { __pyx_t_3 = __Pyx_PyObject_CallNoArg(__pyx_t_4); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 174; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_Raise(__pyx_t_3, 0, 0, 0); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; {__pyx_filename = __pyx_f[0]; __pyx_lineno = 174; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } /* "pygame_sdl2/mixer.pyx":171 * Mix_FreeChunk(self.chunk) * * def __init__(self, fi): # <<<<<<<<<<<<<< * self.chunk = Mix_LoadWAV_RW(to_rwops(fi), 1) * if self.chunk == NULL: */ /* function exit code */ __pyx_r = 0; goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_5); __Pyx_AddTraceback("pygame_sdl2.mixer.Sound.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = -1; __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/mixer.pyx":176 * raise error() * * def play(self, loops=0, maxtime=-1, fade_ms=0): # <<<<<<<<<<<<<< * cdef int cid * cdef int _loops = loops */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_5mixer_5Sound_7play(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static PyObject *__pyx_pw_11pygame_sdl2_5mixer_5Sound_7play(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_loops = 0; PyObject *__pyx_v_maxtime = 0; PyObject *__pyx_v_fade_ms = 0; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("play (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_loops,&__pyx_n_s_maxtime,&__pyx_n_s_fade_ms,0}; PyObject* values[3] = {0,0,0}; values[0] = ((PyObject *)__pyx_int_0); values[1] = ((PyObject *)__pyx_int_neg_1); values[2] = ((PyObject *)__pyx_int_0); if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (kw_args > 0) { PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_loops); if (value) { values[0] = value; kw_args--; } } case 1: if (kw_args > 0) { PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_maxtime); if (value) { values[1] = value; kw_args--; } } case 2: if (kw_args > 0) { PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_fade_ms); if (value) { values[2] = value; kw_args--; } } } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "play") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 176; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } } else { switch (PyTuple_GET_SIZE(__pyx_args)) { case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); case 0: break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_loops = values[0]; __pyx_v_maxtime = values[1]; __pyx_v_fade_ms = values[2]; } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("play", 0, 0, 3, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 176; __pyx_clineno = __LINE__; goto __pyx_L3_error;} __pyx_L3_error:; __Pyx_AddTraceback("pygame_sdl2.mixer.Sound.play", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_11pygame_sdl2_5mixer_5Sound_6play(((struct __pyx_obj_11pygame_sdl2_5mixer_Sound *)__pyx_v_self), __pyx_v_loops, __pyx_v_maxtime, __pyx_v_fade_ms); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_5mixer_5Sound_6play(struct __pyx_obj_11pygame_sdl2_5mixer_Sound *__pyx_v_self, PyObject *__pyx_v_loops, PyObject *__pyx_v_maxtime, PyObject *__pyx_v_fade_ms) { int __pyx_v_cid; int __pyx_v__loops; int __pyx_v__maxtime; int __pyx_v__fade_ms; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; int __pyx_t_2; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; PyObject *__pyx_t_5 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("play", 0); /* "pygame_sdl2/mixer.pyx":178 * def play(self, loops=0, maxtime=-1, fade_ms=0): * cdef int cid * cdef int _loops = loops # <<<<<<<<<<<<<< * cdef int _maxtime = maxtime * cdef int _fade_ms = fade_ms */ __pyx_t_1 = __Pyx_PyInt_As_int(__pyx_v_loops); if (unlikely((__pyx_t_1 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 178; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_v__loops = __pyx_t_1; /* "pygame_sdl2/mixer.pyx":179 * cdef int cid * cdef int _loops = loops * cdef int _maxtime = maxtime # <<<<<<<<<<<<<< * cdef int _fade_ms = fade_ms * */ __pyx_t_1 = __Pyx_PyInt_As_int(__pyx_v_maxtime); if (unlikely((__pyx_t_1 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 179; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_v__maxtime = __pyx_t_1; /* "pygame_sdl2/mixer.pyx":180 * cdef int _loops = loops * cdef int _maxtime = maxtime * cdef int _fade_ms = fade_ms # <<<<<<<<<<<<<< * * with nogil: */ __pyx_t_1 = __Pyx_PyInt_As_int(__pyx_v_fade_ms); if (unlikely((__pyx_t_1 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 180; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_v__fade_ms = __pyx_t_1; /* "pygame_sdl2/mixer.pyx":182 * cdef int _fade_ms = fade_ms * * with nogil: # <<<<<<<<<<<<<< * if _fade_ms != 0: * cid = Mix_FadeInChannelTimed(-1, self.chunk, _loops, _fade_ms, _maxtime) */ { #ifdef WITH_THREAD PyThreadState *_save; Py_UNBLOCK_THREADS #endif /*try:*/ { /* "pygame_sdl2/mixer.pyx":183 * * with nogil: * if _fade_ms != 0: # <<<<<<<<<<<<<< * cid = Mix_FadeInChannelTimed(-1, self.chunk, _loops, _fade_ms, _maxtime) * else: */ __pyx_t_2 = ((__pyx_v__fade_ms != 0) != 0); if (__pyx_t_2) { /* "pygame_sdl2/mixer.pyx":184 * with nogil: * if _fade_ms != 0: * cid = Mix_FadeInChannelTimed(-1, self.chunk, _loops, _fade_ms, _maxtime) # <<<<<<<<<<<<<< * else: * cid = Mix_PlayChannelTimed(-1, self.chunk, _loops, _maxtime) */ __pyx_v_cid = Mix_FadeInChannelTimed(-1, __pyx_v_self->chunk, __pyx_v__loops, __pyx_v__fade_ms, __pyx_v__maxtime); goto __pyx_L6; } /*else*/ { /* "pygame_sdl2/mixer.pyx":186 * cid = Mix_FadeInChannelTimed(-1, self.chunk, _loops, _fade_ms, _maxtime) * else: * cid = Mix_PlayChannelTimed(-1, self.chunk, _loops, _maxtime) # <<<<<<<<<<<<<< * * if cid == -1: */ __pyx_v_cid = Mix_PlayChannelTimed(-1, __pyx_v_self->chunk, __pyx_v__loops, __pyx_v__maxtime); } __pyx_L6:; } /* "pygame_sdl2/mixer.pyx":182 * cdef int _fade_ms = fade_ms * * with nogil: # <<<<<<<<<<<<<< * if _fade_ms != 0: * cid = Mix_FadeInChannelTimed(-1, self.chunk, _loops, _fade_ms, _maxtime) */ /*finally:*/ { /*normal exit:*/{ #ifdef WITH_THREAD Py_BLOCK_THREADS #endif goto __pyx_L5; } __pyx_L5:; } } /* "pygame_sdl2/mixer.pyx":188 * cid = Mix_PlayChannelTimed(-1, self.chunk, _loops, _maxtime) * * if cid == -1: # <<<<<<<<<<<<<< * raise error() * return Channel(cid) */ __pyx_t_2 = ((__pyx_v_cid == -1) != 0); if (__pyx_t_2) { /* "pygame_sdl2/mixer.pyx":189 * * if cid == -1: * raise error() # <<<<<<<<<<<<<< * return Channel(cid) * */ __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_error); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 189; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); __pyx_t_5 = NULL; if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_4))) { __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4); if (likely(__pyx_t_5)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4); __Pyx_INCREF(__pyx_t_5); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_4, function); } } if (__pyx_t_5) { __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_5); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 189; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; } else { __pyx_t_3 = __Pyx_PyObject_CallNoArg(__pyx_t_4); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 189; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_Raise(__pyx_t_3, 0, 0, 0); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; {__pyx_filename = __pyx_f[0]; __pyx_lineno = 189; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } /* "pygame_sdl2/mixer.pyx":190 * if cid == -1: * raise error() * return Channel(cid) # <<<<<<<<<<<<<< * * def stop(self): */ __Pyx_XDECREF(__pyx_r); __pyx_t_3 = __Pyx_PyInt_From_int(__pyx_v_cid); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 190; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 190; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_3); __Pyx_GIVEREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_3 = __Pyx_PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_11pygame_sdl2_5mixer_Channel)), __pyx_t_4, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 190; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_r = __pyx_t_3; __pyx_t_3 = 0; goto __pyx_L0; /* "pygame_sdl2/mixer.pyx":176 * raise error() * * def play(self, loops=0, maxtime=-1, fade_ms=0): # <<<<<<<<<<<<<< * cdef int cid * cdef int _loops = loops */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_5); __Pyx_AddTraceback("pygame_sdl2.mixer.Sound.play", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/mixer.pyx":192 * return Channel(cid) * * def stop(self): # <<<<<<<<<<<<<< * cdef int i = 0 * while i < Mix_AllocateChannels(-1): */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_5mixer_5Sound_9stop(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/ static PyObject *__pyx_pw_11pygame_sdl2_5mixer_5Sound_9stop(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("stop (wrapper)", 0); __pyx_r = __pyx_pf_11pygame_sdl2_5mixer_5Sound_8stop(((struct __pyx_obj_11pygame_sdl2_5mixer_Sound *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_5mixer_5Sound_8stop(struct __pyx_obj_11pygame_sdl2_5mixer_Sound *__pyx_v_self) { int __pyx_v_i; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; __Pyx_RefNannySetupContext("stop", 0); /* "pygame_sdl2/mixer.pyx":193 * * def stop(self): * cdef int i = 0 # <<<<<<<<<<<<<< * while i < Mix_AllocateChannels(-1): * if Mix_GetChunk(i) == self.chunk: */ __pyx_v_i = 0; /* "pygame_sdl2/mixer.pyx":194 * def stop(self): * cdef int i = 0 * while i < Mix_AllocateChannels(-1): # <<<<<<<<<<<<<< * if Mix_GetChunk(i) == self.chunk: * with nogil: */ while (1) { __pyx_t_1 = ((__pyx_v_i < Mix_AllocateChannels(-1)) != 0); if (!__pyx_t_1) break; /* "pygame_sdl2/mixer.pyx":195 * cdef int i = 0 * while i < Mix_AllocateChannels(-1): * if Mix_GetChunk(i) == self.chunk: # <<<<<<<<<<<<<< * with nogil: * Mix_HaltChannel(i) */ __pyx_t_1 = ((Mix_GetChunk(__pyx_v_i) == __pyx_v_self->chunk) != 0); if (__pyx_t_1) { /* "pygame_sdl2/mixer.pyx":196 * while i < Mix_AllocateChannels(-1): * if Mix_GetChunk(i) == self.chunk: * with nogil: # <<<<<<<<<<<<<< * Mix_HaltChannel(i) * i += 1 */ { #ifdef WITH_THREAD PyThreadState *_save; Py_UNBLOCK_THREADS #endif /*try:*/ { /* "pygame_sdl2/mixer.pyx":197 * if Mix_GetChunk(i) == self.chunk: * with nogil: * Mix_HaltChannel(i) # <<<<<<<<<<<<<< * i += 1 * */ Mix_HaltChannel(__pyx_v_i); } /* "pygame_sdl2/mixer.pyx":196 * while i < Mix_AllocateChannels(-1): * if Mix_GetChunk(i) == self.chunk: * with nogil: # <<<<<<<<<<<<<< * Mix_HaltChannel(i) * i += 1 */ /*finally:*/ { /*normal exit:*/{ #ifdef WITH_THREAD Py_BLOCK_THREADS #endif goto __pyx_L10; } __pyx_L10:; } } goto __pyx_L5; } __pyx_L5:; /* "pygame_sdl2/mixer.pyx":198 * with nogil: * Mix_HaltChannel(i) * i += 1 # <<<<<<<<<<<<<< * * def pause(self): */ __pyx_v_i = (__pyx_v_i + 1); } /* "pygame_sdl2/mixer.pyx":192 * return Channel(cid) * * def stop(self): # <<<<<<<<<<<<<< * cdef int i = 0 * while i < Mix_AllocateChannels(-1): */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/mixer.pyx":200 * i += 1 * * def pause(self): # <<<<<<<<<<<<<< * cdef int i = 0 * while i < Mix_AllocateChannels(-1): */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_5mixer_5Sound_11pause(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/ static PyObject *__pyx_pw_11pygame_sdl2_5mixer_5Sound_11pause(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("pause (wrapper)", 0); __pyx_r = __pyx_pf_11pygame_sdl2_5mixer_5Sound_10pause(((struct __pyx_obj_11pygame_sdl2_5mixer_Sound *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_5mixer_5Sound_10pause(struct __pyx_obj_11pygame_sdl2_5mixer_Sound *__pyx_v_self) { int __pyx_v_i; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; __Pyx_RefNannySetupContext("pause", 0); /* "pygame_sdl2/mixer.pyx":201 * * def pause(self): * cdef int i = 0 # <<<<<<<<<<<<<< * while i < Mix_AllocateChannels(-1): * if Mix_GetChunk(i) == self.chunk: */ __pyx_v_i = 0; /* "pygame_sdl2/mixer.pyx":202 * def pause(self): * cdef int i = 0 * while i < Mix_AllocateChannels(-1): # <<<<<<<<<<<<<< * if Mix_GetChunk(i) == self.chunk: * with nogil: */ while (1) { __pyx_t_1 = ((__pyx_v_i < Mix_AllocateChannels(-1)) != 0); if (!__pyx_t_1) break; /* "pygame_sdl2/mixer.pyx":203 * cdef int i = 0 * while i < Mix_AllocateChannels(-1): * if Mix_GetChunk(i) == self.chunk: # <<<<<<<<<<<<<< * with nogil: * Mix_Pause(i) */ __pyx_t_1 = ((Mix_GetChunk(__pyx_v_i) == __pyx_v_self->chunk) != 0); if (__pyx_t_1) { /* "pygame_sdl2/mixer.pyx":204 * while i < Mix_AllocateChannels(-1): * if Mix_GetChunk(i) == self.chunk: * with nogil: # <<<<<<<<<<<<<< * Mix_Pause(i) * i += 1 */ { #ifdef WITH_THREAD PyThreadState *_save; Py_UNBLOCK_THREADS #endif /*try:*/ { /* "pygame_sdl2/mixer.pyx":205 * if Mix_GetChunk(i) == self.chunk: * with nogil: * Mix_Pause(i) # <<<<<<<<<<<<<< * i += 1 * */ Mix_Pause(__pyx_v_i); } /* "pygame_sdl2/mixer.pyx":204 * while i < Mix_AllocateChannels(-1): * if Mix_GetChunk(i) == self.chunk: * with nogil: # <<<<<<<<<<<<<< * Mix_Pause(i) * i += 1 */ /*finally:*/ { /*normal exit:*/{ #ifdef WITH_THREAD Py_BLOCK_THREADS #endif goto __pyx_L10; } __pyx_L10:; } } goto __pyx_L5; } __pyx_L5:; /* "pygame_sdl2/mixer.pyx":206 * with nogil: * Mix_Pause(i) * i += 1 # <<<<<<<<<<<<<< * * def unpause(self): */ __pyx_v_i = (__pyx_v_i + 1); } /* "pygame_sdl2/mixer.pyx":200 * i += 1 * * def pause(self): # <<<<<<<<<<<<<< * cdef int i = 0 * while i < Mix_AllocateChannels(-1): */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/mixer.pyx":208 * i += 1 * * def unpause(self): # <<<<<<<<<<<<<< * cdef int i = 0 * while i < Mix_AllocateChannels(-1): */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_5mixer_5Sound_13unpause(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/ static PyObject *__pyx_pw_11pygame_sdl2_5mixer_5Sound_13unpause(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("unpause (wrapper)", 0); __pyx_r = __pyx_pf_11pygame_sdl2_5mixer_5Sound_12unpause(((struct __pyx_obj_11pygame_sdl2_5mixer_Sound *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_5mixer_5Sound_12unpause(struct __pyx_obj_11pygame_sdl2_5mixer_Sound *__pyx_v_self) { int __pyx_v_i; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; __Pyx_RefNannySetupContext("unpause", 0); /* "pygame_sdl2/mixer.pyx":209 * * def unpause(self): * cdef int i = 0 # <<<<<<<<<<<<<< * while i < Mix_AllocateChannels(-1): * if Mix_GetChunk(i) == self.chunk: */ __pyx_v_i = 0; /* "pygame_sdl2/mixer.pyx":210 * def unpause(self): * cdef int i = 0 * while i < Mix_AllocateChannels(-1): # <<<<<<<<<<<<<< * if Mix_GetChunk(i) == self.chunk: * with nogil: */ while (1) { __pyx_t_1 = ((__pyx_v_i < Mix_AllocateChannels(-1)) != 0); if (!__pyx_t_1) break; /* "pygame_sdl2/mixer.pyx":211 * cdef int i = 0 * while i < Mix_AllocateChannels(-1): * if Mix_GetChunk(i) == self.chunk: # <<<<<<<<<<<<<< * with nogil: * Mix_Resume(i) */ __pyx_t_1 = ((Mix_GetChunk(__pyx_v_i) == __pyx_v_self->chunk) != 0); if (__pyx_t_1) { /* "pygame_sdl2/mixer.pyx":212 * while i < Mix_AllocateChannels(-1): * if Mix_GetChunk(i) == self.chunk: * with nogil: # <<<<<<<<<<<<<< * Mix_Resume(i) * i += 1 */ { #ifdef WITH_THREAD PyThreadState *_save; Py_UNBLOCK_THREADS #endif /*try:*/ { /* "pygame_sdl2/mixer.pyx":213 * if Mix_GetChunk(i) == self.chunk: * with nogil: * Mix_Resume(i) # <<<<<<<<<<<<<< * i += 1 * */ Mix_Resume(__pyx_v_i); } /* "pygame_sdl2/mixer.pyx":212 * while i < Mix_AllocateChannels(-1): * if Mix_GetChunk(i) == self.chunk: * with nogil: # <<<<<<<<<<<<<< * Mix_Resume(i) * i += 1 */ /*finally:*/ { /*normal exit:*/{ #ifdef WITH_THREAD Py_BLOCK_THREADS #endif goto __pyx_L10; } __pyx_L10:; } } goto __pyx_L5; } __pyx_L5:; /* "pygame_sdl2/mixer.pyx":214 * with nogil: * Mix_Resume(i) * i += 1 # <<<<<<<<<<<<<< * * def fadeout(self, time): */ __pyx_v_i = (__pyx_v_i + 1); } /* "pygame_sdl2/mixer.pyx":208 * i += 1 * * def unpause(self): # <<<<<<<<<<<<<< * cdef int i = 0 * while i < Mix_AllocateChannels(-1): */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/mixer.pyx":216 * i += 1 * * def fadeout(self, time): # <<<<<<<<<<<<<< * cdef int i = 0 * cdef int ms = time */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_5mixer_5Sound_15fadeout(PyObject *__pyx_v_self, PyObject *__pyx_v_time); /*proto*/ static PyObject *__pyx_pw_11pygame_sdl2_5mixer_5Sound_15fadeout(PyObject *__pyx_v_self, PyObject *__pyx_v_time) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("fadeout (wrapper)", 0); __pyx_r = __pyx_pf_11pygame_sdl2_5mixer_5Sound_14fadeout(((struct __pyx_obj_11pygame_sdl2_5mixer_Sound *)__pyx_v_self), ((PyObject *)__pyx_v_time)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_5mixer_5Sound_14fadeout(struct __pyx_obj_11pygame_sdl2_5mixer_Sound *__pyx_v_self, PyObject *__pyx_v_time) { int __pyx_v_i; int __pyx_v_ms; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; int __pyx_t_2; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("fadeout", 0); /* "pygame_sdl2/mixer.pyx":217 * * def fadeout(self, time): * cdef int i = 0 # <<<<<<<<<<<<<< * cdef int ms = time * while i < Mix_AllocateChannels(-1): */ __pyx_v_i = 0; /* "pygame_sdl2/mixer.pyx":218 * def fadeout(self, time): * cdef int i = 0 * cdef int ms = time # <<<<<<<<<<<<<< * while i < Mix_AllocateChannels(-1): * if Mix_GetChunk(i) == self.chunk: */ __pyx_t_1 = __Pyx_PyInt_As_int(__pyx_v_time); if (unlikely((__pyx_t_1 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 218; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_v_ms = __pyx_t_1; /* "pygame_sdl2/mixer.pyx":219 * cdef int i = 0 * cdef int ms = time * while i < Mix_AllocateChannels(-1): # <<<<<<<<<<<<<< * if Mix_GetChunk(i) == self.chunk: * with nogil: */ while (1) { __pyx_t_2 = ((__pyx_v_i < Mix_AllocateChannels(-1)) != 0); if (!__pyx_t_2) break; /* "pygame_sdl2/mixer.pyx":220 * cdef int ms = time * while i < Mix_AllocateChannels(-1): * if Mix_GetChunk(i) == self.chunk: # <<<<<<<<<<<<<< * with nogil: * Mix_FadeOutChannel(i, ms) */ __pyx_t_2 = ((Mix_GetChunk(__pyx_v_i) == __pyx_v_self->chunk) != 0); if (__pyx_t_2) { /* "pygame_sdl2/mixer.pyx":221 * while i < Mix_AllocateChannels(-1): * if Mix_GetChunk(i) == self.chunk: * with nogil: # <<<<<<<<<<<<<< * Mix_FadeOutChannel(i, ms) * i += 1 */ { #ifdef WITH_THREAD PyThreadState *_save; Py_UNBLOCK_THREADS #endif /*try:*/ { /* "pygame_sdl2/mixer.pyx":222 * if Mix_GetChunk(i) == self.chunk: * with nogil: * Mix_FadeOutChannel(i, ms) # <<<<<<<<<<<<<< * i += 1 * */ Mix_FadeOutChannel(__pyx_v_i, __pyx_v_ms); } /* "pygame_sdl2/mixer.pyx":221 * while i < Mix_AllocateChannels(-1): * if Mix_GetChunk(i) == self.chunk: * with nogil: # <<<<<<<<<<<<<< * Mix_FadeOutChannel(i, ms) * i += 1 */ /*finally:*/ { /*normal exit:*/{ #ifdef WITH_THREAD Py_BLOCK_THREADS #endif goto __pyx_L10; } __pyx_L10:; } } goto __pyx_L5; } __pyx_L5:; /* "pygame_sdl2/mixer.pyx":223 * with nogil: * Mix_FadeOutChannel(i, ms) * i += 1 # <<<<<<<<<<<<<< * * def set_volume(self, value): */ __pyx_v_i = (__pyx_v_i + 1); } /* "pygame_sdl2/mixer.pyx":216 * i += 1 * * def fadeout(self, time): # <<<<<<<<<<<<<< * cdef int i = 0 * cdef int ms = time */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("pygame_sdl2.mixer.Sound.fadeout", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/mixer.pyx":225 * i += 1 * * def set_volume(self, value): # <<<<<<<<<<<<<< * Mix_VolumeChunk(self.chunk, MIX_MAX_VOLUME * value) * */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_5mixer_5Sound_17set_volume(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/ static PyObject *__pyx_pw_11pygame_sdl2_5mixer_5Sound_17set_volume(PyObject *__pyx_v_self, PyObject *__pyx_v_value) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("set_volume (wrapper)", 0); __pyx_r = __pyx_pf_11pygame_sdl2_5mixer_5Sound_16set_volume(((struct __pyx_obj_11pygame_sdl2_5mixer_Sound *)__pyx_v_self), ((PyObject *)__pyx_v_value)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_5mixer_5Sound_16set_volume(struct __pyx_obj_11pygame_sdl2_5mixer_Sound *__pyx_v_self, PyObject *__pyx_v_value) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; int __pyx_t_3; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("set_volume", 0); /* "pygame_sdl2/mixer.pyx":226 * * def set_volume(self, value): * Mix_VolumeChunk(self.chunk, MIX_MAX_VOLUME * value) # <<<<<<<<<<<<<< * * def get_volume(self): */ __pyx_t_1 = __Pyx_PyInt_From_int(MIX_MAX_VOLUME); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 226; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = PyNumber_Multiply(__pyx_t_1, __pyx_v_value); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 226; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_3 = __Pyx_PyInt_As_int(__pyx_t_2); if (unlikely((__pyx_t_3 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 226; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; Mix_VolumeChunk(__pyx_v_self->chunk, __pyx_t_3); /* "pygame_sdl2/mixer.pyx":225 * i += 1 * * def set_volume(self, value): # <<<<<<<<<<<<<< * Mix_VolumeChunk(self.chunk, MIX_MAX_VOLUME * value) * */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_AddTraceback("pygame_sdl2.mixer.Sound.set_volume", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/mixer.pyx":228 * Mix_VolumeChunk(self.chunk, MIX_MAX_VOLUME * value) * * def get_volume(self): # <<<<<<<<<<<<<< * return Mix_VolumeChunk(self.chunk, -1) * */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_5mixer_5Sound_19get_volume(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/ static PyObject *__pyx_pw_11pygame_sdl2_5mixer_5Sound_19get_volume(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("get_volume (wrapper)", 0); __pyx_r = __pyx_pf_11pygame_sdl2_5mixer_5Sound_18get_volume(((struct __pyx_obj_11pygame_sdl2_5mixer_Sound *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_5mixer_5Sound_18get_volume(struct __pyx_obj_11pygame_sdl2_5mixer_Sound *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("get_volume", 0); /* "pygame_sdl2/mixer.pyx":229 * * def get_volume(self): * return Mix_VolumeChunk(self.chunk, -1) # <<<<<<<<<<<<<< * * def get_num_channels(self): */ __Pyx_XDECREF(__pyx_r); __pyx_t_1 = __Pyx_PyInt_From_int(Mix_VolumeChunk(__pyx_v_self->chunk, -1)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 229; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "pygame_sdl2/mixer.pyx":228 * Mix_VolumeChunk(self.chunk, MIX_MAX_VOLUME * value) * * def get_volume(self): # <<<<<<<<<<<<<< * return Mix_VolumeChunk(self.chunk, -1) * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("pygame_sdl2.mixer.Sound.get_volume", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/mixer.pyx":231 * return Mix_VolumeChunk(self.chunk, -1) * * def get_num_channels(self): # <<<<<<<<<<<<<< * cdef int i = 0 * cdef int n = 0 */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_5mixer_5Sound_21get_num_channels(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/ static PyObject *__pyx_pw_11pygame_sdl2_5mixer_5Sound_21get_num_channels(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("get_num_channels (wrapper)", 0); __pyx_r = __pyx_pf_11pygame_sdl2_5mixer_5Sound_20get_num_channels(((struct __pyx_obj_11pygame_sdl2_5mixer_Sound *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_5mixer_5Sound_20get_num_channels(struct __pyx_obj_11pygame_sdl2_5mixer_Sound *__pyx_v_self) { int __pyx_v_i; int __pyx_v_n; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; PyObject *__pyx_t_2 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("get_num_channels", 0); /* "pygame_sdl2/mixer.pyx":232 * * def get_num_channels(self): * cdef int i = 0 # <<<<<<<<<<<<<< * cdef int n = 0 * while i < Mix_AllocateChannels(-1): */ __pyx_v_i = 0; /* "pygame_sdl2/mixer.pyx":233 * def get_num_channels(self): * cdef int i = 0 * cdef int n = 0 # <<<<<<<<<<<<<< * while i < Mix_AllocateChannels(-1): * if Mix_GetChunk(i) == self.chunk: */ __pyx_v_n = 0; /* "pygame_sdl2/mixer.pyx":234 * cdef int i = 0 * cdef int n = 0 * while i < Mix_AllocateChannels(-1): # <<<<<<<<<<<<<< * if Mix_GetChunk(i) == self.chunk: * n += 1 */ while (1) { __pyx_t_1 = ((__pyx_v_i < Mix_AllocateChannels(-1)) != 0); if (!__pyx_t_1) break; /* "pygame_sdl2/mixer.pyx":235 * cdef int n = 0 * while i < Mix_AllocateChannels(-1): * if Mix_GetChunk(i) == self.chunk: # <<<<<<<<<<<<<< * n += 1 * i += 1 */ __pyx_t_1 = ((Mix_GetChunk(__pyx_v_i) == __pyx_v_self->chunk) != 0); if (__pyx_t_1) { /* "pygame_sdl2/mixer.pyx":236 * while i < Mix_AllocateChannels(-1): * if Mix_GetChunk(i) == self.chunk: * n += 1 # <<<<<<<<<<<<<< * i += 1 * return n */ __pyx_v_n = (__pyx_v_n + 1); goto __pyx_L5; } __pyx_L5:; /* "pygame_sdl2/mixer.pyx":237 * if Mix_GetChunk(i) == self.chunk: * n += 1 * i += 1 # <<<<<<<<<<<<<< * return n * */ __pyx_v_i = (__pyx_v_i + 1); } /* "pygame_sdl2/mixer.pyx":238 * n += 1 * i += 1 * return n # <<<<<<<<<<<<<< * * def get_length(self): */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_v_n); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 238; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; /* "pygame_sdl2/mixer.pyx":231 * return Mix_VolumeChunk(self.chunk, -1) * * def get_num_channels(self): # <<<<<<<<<<<<<< * cdef int i = 0 * cdef int n = 0 */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_AddTraceback("pygame_sdl2.mixer.Sound.get_num_channels", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/mixer.pyx":240 * return n * * def get_length(self): # <<<<<<<<<<<<<< * # TODO: Adjust for actual format, rather than assuming 16-bit. * return self.chunk.alen / output_spec[0] / 2 / output_spec[2] */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_5mixer_5Sound_23get_length(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/ static PyObject *__pyx_pw_11pygame_sdl2_5mixer_5Sound_23get_length(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("get_length (wrapper)", 0); __pyx_r = __pyx_pf_11pygame_sdl2_5mixer_5Sound_22get_length(((struct __pyx_obj_11pygame_sdl2_5mixer_Sound *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_5mixer_5Sound_22get_length(struct __pyx_obj_11pygame_sdl2_5mixer_Sound *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("get_length", 0); /* "pygame_sdl2/mixer.pyx":242 * def get_length(self): * # TODO: Adjust for actual format, rather than assuming 16-bit. * return self.chunk.alen / output_spec[0] / 2 / output_spec[2] # <<<<<<<<<<<<<< * * def get_raw(self): */ __Pyx_XDECREF(__pyx_r); __pyx_t_1 = PyFloat_FromDouble(((double)__pyx_v_self->chunk->alen)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 242; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = __Pyx_GetItemInt(__pyx_v_11pygame_sdl2_5mixer_output_spec, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(__pyx_t_2 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 242; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = __Pyx_PyNumber_Divide(__pyx_t_1, __pyx_t_2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 242; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_2 = __Pyx_PyNumber_Divide(__pyx_t_3, __pyx_int_2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 242; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_3 = __Pyx_GetItemInt(__pyx_v_11pygame_sdl2_5mixer_output_spec, 2, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(__pyx_t_3 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 242; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; __Pyx_GOTREF(__pyx_t_3); __pyx_t_1 = __Pyx_PyNumber_Divide(__pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 242; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "pygame_sdl2/mixer.pyx":240 * return n * * def get_length(self): # <<<<<<<<<<<<<< * # TODO: Adjust for actual format, rather than assuming 16-bit. * return self.chunk.alen / output_spec[0] / 2 / output_spec[2] */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("pygame_sdl2.mixer.Sound.get_length", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/mixer.pyx":244 * return self.chunk.alen / output_spec[0] / 2 / output_spec[2] * * def get_raw(self): # <<<<<<<<<<<<<< * # return self.chunk.abuf * raise error("Not implemented.") */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_5mixer_5Sound_25get_raw(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/ static PyObject *__pyx_pw_11pygame_sdl2_5mixer_5Sound_25get_raw(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("get_raw (wrapper)", 0); __pyx_r = __pyx_pf_11pygame_sdl2_5mixer_5Sound_24get_raw(((struct __pyx_obj_11pygame_sdl2_5mixer_Sound *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_5mixer_5Sound_24get_raw(CYTHON_UNUSED struct __pyx_obj_11pygame_sdl2_5mixer_Sound *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("get_raw", 0); /* "pygame_sdl2/mixer.pyx":246 * def get_raw(self): * # return self.chunk.abuf * raise error("Not implemented.") # <<<<<<<<<<<<<< * * */ __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_error); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 246; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_tuple__6, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 246; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_Raise(__pyx_t_2, 0, 0, 0); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; {__pyx_filename = __pyx_f[0]; __pyx_lineno = 246; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "pygame_sdl2/mixer.pyx":244 * return self.chunk.alen / output_spec[0] / 2 / output_spec[2] * * def get_raw(self): # <<<<<<<<<<<<<< * # return self.chunk.abuf * raise error("Not implemented.") */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_AddTraceback("pygame_sdl2.mixer.Sound.get_raw", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/mixer.pyx":252 * cdef int cid * * def __init__(self, cid): # <<<<<<<<<<<<<< * self.cid = cid * */ /* Python wrapper */ static int __pyx_pw_11pygame_sdl2_5mixer_7Channel_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static int __pyx_pw_11pygame_sdl2_5mixer_7Channel_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_cid = 0; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__init__ (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_cid,0}; PyObject* values[1] = {0}; if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_cid)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__init__") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 252; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } } else if (PyTuple_GET_SIZE(__pyx_args) != 1) { goto __pyx_L5_argtuple_error; } else { values[0] = PyTuple_GET_ITEM(__pyx_args, 0); } __pyx_v_cid = values[0]; } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("__init__", 1, 1, 1, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 252; __pyx_clineno = __LINE__; goto __pyx_L3_error;} __pyx_L3_error:; __Pyx_AddTraceback("pygame_sdl2.mixer.Channel.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return -1; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_11pygame_sdl2_5mixer_7Channel___init__(((struct __pyx_obj_11pygame_sdl2_5mixer_Channel *)__pyx_v_self), __pyx_v_cid); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static int __pyx_pf_11pygame_sdl2_5mixer_7Channel___init__(struct __pyx_obj_11pygame_sdl2_5mixer_Channel *__pyx_v_self, PyObject *__pyx_v_cid) { int __pyx_r; __Pyx_RefNannyDeclarations int __pyx_t_1; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__init__", 0); /* "pygame_sdl2/mixer.pyx":253 * * def __init__(self, cid): * self.cid = cid # <<<<<<<<<<<<<< * * def play(self, Sound sound not None, loops=0, maxtime=-1, fade_ms=0): */ __pyx_t_1 = __Pyx_PyInt_As_int(__pyx_v_cid); if (unlikely((__pyx_t_1 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 253; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_v_self->cid = __pyx_t_1; /* "pygame_sdl2/mixer.pyx":252 * cdef int cid * * def __init__(self, cid): # <<<<<<<<<<<<<< * self.cid = cid * */ /* function exit code */ __pyx_r = 0; goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("pygame_sdl2.mixer.Channel.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = -1; __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/mixer.pyx":255 * self.cid = cid * * def play(self, Sound sound not None, loops=0, maxtime=-1, fade_ms=0): # <<<<<<<<<<<<<< * cdef int _loops = loops * cdef int _maxtime = maxtime */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_5mixer_7Channel_3play(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static PyObject *__pyx_pw_11pygame_sdl2_5mixer_7Channel_3play(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { struct __pyx_obj_11pygame_sdl2_5mixer_Sound *__pyx_v_sound = 0; PyObject *__pyx_v_loops = 0; PyObject *__pyx_v_maxtime = 0; PyObject *__pyx_v_fade_ms = 0; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("play (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_sound,&__pyx_n_s_loops,&__pyx_n_s_maxtime,&__pyx_n_s_fade_ms,0}; PyObject* values[4] = {0,0,0,0}; values[1] = ((PyObject *)__pyx_int_0); values[2] = ((PyObject *)__pyx_int_neg_1); values[3] = ((PyObject *)__pyx_int_0); if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_sound)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; case 1: if (kw_args > 0) { PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_loops); if (value) { values[1] = value; kw_args--; } } case 2: if (kw_args > 0) { PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_maxtime); if (value) { values[2] = value; kw_args--; } } case 3: if (kw_args > 0) { PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_fade_ms); if (value) { values[3] = value; kw_args--; } } } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "play") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 255; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } } else { switch (PyTuple_GET_SIZE(__pyx_args)) { case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_sound = ((struct __pyx_obj_11pygame_sdl2_5mixer_Sound *)values[0]); __pyx_v_loops = values[1]; __pyx_v_maxtime = values[2]; __pyx_v_fade_ms = values[3]; } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("play", 0, 1, 4, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 255; __pyx_clineno = __LINE__; goto __pyx_L3_error;} __pyx_L3_error:; __Pyx_AddTraceback("pygame_sdl2.mixer.Channel.play", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_sound), __pyx_ptype_11pygame_sdl2_5mixer_Sound, 0, "sound", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 255; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_r = __pyx_pf_11pygame_sdl2_5mixer_7Channel_2play(((struct __pyx_obj_11pygame_sdl2_5mixer_Channel *)__pyx_v_self), __pyx_v_sound, __pyx_v_loops, __pyx_v_maxtime, __pyx_v_fade_ms); /* function exit code */ goto __pyx_L0; __pyx_L1_error:; __pyx_r = NULL; __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_5mixer_7Channel_2play(struct __pyx_obj_11pygame_sdl2_5mixer_Channel *__pyx_v_self, struct __pyx_obj_11pygame_sdl2_5mixer_Sound *__pyx_v_sound, PyObject *__pyx_v_loops, PyObject *__pyx_v_maxtime, PyObject *__pyx_v_fade_ms) { int __pyx_v__loops; int __pyx_v__maxtime; int __pyx_v__fade_ms; int __pyx_v_cid; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; int __pyx_t_2; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; PyObject *__pyx_t_5 = NULL; PyObject *__pyx_t_6 = NULL; PyObject *__pyx_t_7 = NULL; PyObject *__pyx_t_8 = NULL; PyObject *__pyx_t_9 = NULL; PyObject *__pyx_t_10 = NULL; PyObject *__pyx_t_11 = NULL; int __pyx_t_12; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("play", 0); /* "pygame_sdl2/mixer.pyx":256 * * def play(self, Sound sound not None, loops=0, maxtime=-1, fade_ms=0): * cdef int _loops = loops # <<<<<<<<<<<<<< * cdef int _maxtime = maxtime * cdef int _fade_ms = fade_ms */ __pyx_t_1 = __Pyx_PyInt_As_int(__pyx_v_loops); if (unlikely((__pyx_t_1 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 256; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_v__loops = __pyx_t_1; /* "pygame_sdl2/mixer.pyx":257 * def play(self, Sound sound not None, loops=0, maxtime=-1, fade_ms=0): * cdef int _loops = loops * cdef int _maxtime = maxtime # <<<<<<<<<<<<<< * cdef int _fade_ms = fade_ms * */ __pyx_t_1 = __Pyx_PyInt_As_int(__pyx_v_maxtime); if (unlikely((__pyx_t_1 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 257; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_v__maxtime = __pyx_t_1; /* "pygame_sdl2/mixer.pyx":258 * cdef int _loops = loops * cdef int _maxtime = maxtime * cdef int _fade_ms = fade_ms # <<<<<<<<<<<<<< * * with nogil: */ __pyx_t_1 = __Pyx_PyInt_As_int(__pyx_v_fade_ms); if (unlikely((__pyx_t_1 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 258; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_v__fade_ms = __pyx_t_1; /* "pygame_sdl2/mixer.pyx":260 * cdef int _fade_ms = fade_ms * * with nogil: # <<<<<<<<<<<<<< * if _fade_ms != 0: * cid = Mix_FadeInChannelTimed(self.cid, sound.chunk, _loops, _fade_ms, _maxtime) */ { #ifdef WITH_THREAD PyThreadState *_save; Py_UNBLOCK_THREADS #endif /*try:*/ { /* "pygame_sdl2/mixer.pyx":261 * * with nogil: * if _fade_ms != 0: # <<<<<<<<<<<<<< * cid = Mix_FadeInChannelTimed(self.cid, sound.chunk, _loops, _fade_ms, _maxtime) * else: */ __pyx_t_2 = ((__pyx_v__fade_ms != 0) != 0); if (__pyx_t_2) { /* "pygame_sdl2/mixer.pyx":262 * with nogil: * if _fade_ms != 0: * cid = Mix_FadeInChannelTimed(self.cid, sound.chunk, _loops, _fade_ms, _maxtime) # <<<<<<<<<<<<<< * else: * cid = Mix_PlayChannelTimed(self.cid, sound.chunk, _loops, _maxtime) */ __pyx_v_cid = Mix_FadeInChannelTimed(__pyx_v_self->cid, __pyx_v_sound->chunk, __pyx_v__loops, __pyx_v__fade_ms, __pyx_v__maxtime); goto __pyx_L6; } /*else*/ { /* "pygame_sdl2/mixer.pyx":264 * cid = Mix_FadeInChannelTimed(self.cid, sound.chunk, _loops, _fade_ms, _maxtime) * else: * cid = Mix_PlayChannelTimed(self.cid, sound.chunk, _loops, _maxtime) # <<<<<<<<<<<<<< * * if cid == -1: */ __pyx_v_cid = Mix_PlayChannelTimed(__pyx_v_self->cid, __pyx_v_sound->chunk, __pyx_v__loops, __pyx_v__maxtime); } __pyx_L6:; } /* "pygame_sdl2/mixer.pyx":260 * cdef int _fade_ms = fade_ms * * with nogil: # <<<<<<<<<<<<<< * if _fade_ms != 0: * cid = Mix_FadeInChannelTimed(self.cid, sound.chunk, _loops, _fade_ms, _maxtime) */ /*finally:*/ { /*normal exit:*/{ #ifdef WITH_THREAD Py_BLOCK_THREADS #endif goto __pyx_L5; } __pyx_L5:; } } /* "pygame_sdl2/mixer.pyx":266 * cid = Mix_PlayChannelTimed(self.cid, sound.chunk, _loops, _maxtime) * * if cid == -1: # <<<<<<<<<<<<<< * raise error() * */ __pyx_t_2 = ((__pyx_v_cid == -1) != 0); if (__pyx_t_2) { /* "pygame_sdl2/mixer.pyx":267 * * if cid == -1: * raise error() # <<<<<<<<<<<<<< * * with _lock: */ __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_error); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 267; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); __pyx_t_5 = NULL; if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_4))) { __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4); if (likely(__pyx_t_5)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4); __Pyx_INCREF(__pyx_t_5); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_4, function); } } if (__pyx_t_5) { __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_5); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 267; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; } else { __pyx_t_3 = __Pyx_PyObject_CallNoArg(__pyx_t_4); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 267; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_Raise(__pyx_t_3, 0, 0, 0); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; {__pyx_filename = __pyx_f[0]; __pyx_lineno = 267; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } /* "pygame_sdl2/mixer.pyx":269 * raise error() * * with _lock: # <<<<<<<<<<<<<< * current_sounds[self.cid] = sound * */ /*with:*/ { __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_lock); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 269; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __pyx_t_6 = __Pyx_PyObject_LookupSpecial(__pyx_t_3, __pyx_n_s_exit); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 269; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_6); __pyx_t_5 = __Pyx_PyObject_LookupSpecial(__pyx_t_3, __pyx_n_s_enter); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 269; __pyx_clineno = __LINE__; goto __pyx_L8_error;} __Pyx_GOTREF(__pyx_t_5); __pyx_t_7 = NULL; if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_5))) { __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_5); if (likely(__pyx_t_7)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5); __Pyx_INCREF(__pyx_t_7); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_5, function); } } if (__pyx_t_7) { __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_t_7); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 269; __pyx_clineno = __LINE__; goto __pyx_L8_error;} __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; } else { __pyx_t_4 = __Pyx_PyObject_CallNoArg(__pyx_t_5); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 269; __pyx_clineno = __LINE__; goto __pyx_L8_error;} } __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /*try:*/ { { __Pyx_ExceptionSave(&__pyx_t_8, &__pyx_t_9, &__pyx_t_10); __Pyx_XGOTREF(__pyx_t_8); __Pyx_XGOTREF(__pyx_t_9); __Pyx_XGOTREF(__pyx_t_10); /*try:*/ { /* "pygame_sdl2/mixer.pyx":270 * * with _lock: * current_sounds[self.cid] = sound # <<<<<<<<<<<<<< * * def stop(self): */ if (unlikely(__pyx_v_11pygame_sdl2_5mixer_current_sounds == Py_None)) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 270; __pyx_clineno = __LINE__; goto __pyx_L12_error;} } __pyx_t_3 = __Pyx_PyInt_From_int(__pyx_v_self->cid); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 270; __pyx_clineno = __LINE__; goto __pyx_L12_error;} __Pyx_GOTREF(__pyx_t_3); if (unlikely(PyDict_SetItem(__pyx_v_11pygame_sdl2_5mixer_current_sounds, __pyx_t_3, ((PyObject *)__pyx_v_sound)) < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 270; __pyx_clineno = __LINE__; goto __pyx_L12_error;} __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0; __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0; __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0; goto __pyx_L19_try_end; __pyx_L12_error:; __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; /* "pygame_sdl2/mixer.pyx":269 * raise error() * * with _lock: # <<<<<<<<<<<<<< * current_sounds[self.cid] = sound * */ /*except:*/ { __Pyx_AddTraceback("pygame_sdl2.mixer.Channel.play", __pyx_clineno, __pyx_lineno, __pyx_filename); if (__Pyx_GetException(&__pyx_t_3, &__pyx_t_4, &__pyx_t_5) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 269; __pyx_clineno = __LINE__; goto __pyx_L14_except_error;} __Pyx_GOTREF(__pyx_t_3); __Pyx_GOTREF(__pyx_t_4); __Pyx_GOTREF(__pyx_t_5); __pyx_t_7 = PyTuple_Pack(3, __pyx_t_3, __pyx_t_4, __pyx_t_5); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 269; __pyx_clineno = __LINE__; goto __pyx_L14_except_error;} __Pyx_GOTREF(__pyx_t_7); __pyx_t_11 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_7, NULL); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 269; __pyx_clineno = __LINE__; goto __pyx_L14_except_error;} __Pyx_GOTREF(__pyx_t_11); __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_11); __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; if (__pyx_t_2 < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 269; __pyx_clineno = __LINE__; goto __pyx_L14_except_error;} __pyx_t_12 = ((!(__pyx_t_2 != 0)) != 0); if (__pyx_t_12) { __Pyx_GIVEREF(__pyx_t_3); __Pyx_GIVEREF(__pyx_t_4); __Pyx_XGIVEREF(__pyx_t_5); __Pyx_ErrRestore(__pyx_t_3, __pyx_t_4, __pyx_t_5); __pyx_t_3 = 0; __pyx_t_4 = 0; __pyx_t_5 = 0; {__pyx_filename = __pyx_f[0]; __pyx_lineno = 269; __pyx_clineno = __LINE__; goto __pyx_L14_except_error;} } __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; goto __pyx_L13_exception_handled; } __pyx_L14_except_error:; __Pyx_XGIVEREF(__pyx_t_8); __Pyx_XGIVEREF(__pyx_t_9); __Pyx_XGIVEREF(__pyx_t_10); __Pyx_ExceptionReset(__pyx_t_8, __pyx_t_9, __pyx_t_10); goto __pyx_L1_error; __pyx_L13_exception_handled:; __Pyx_XGIVEREF(__pyx_t_8); __Pyx_XGIVEREF(__pyx_t_9); __Pyx_XGIVEREF(__pyx_t_10); __Pyx_ExceptionReset(__pyx_t_8, __pyx_t_9, __pyx_t_10); __pyx_L19_try_end:; } } /*finally:*/ { /*normal exit:*/{ if (__pyx_t_6) { __pyx_t_10 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_tuple__7, NULL); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 269; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_10); __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; } goto __pyx_L11; } __pyx_L11:; } goto __pyx_L23; __pyx_L8_error:; __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; goto __pyx_L1_error; __pyx_L23:; } /* "pygame_sdl2/mixer.pyx":255 * self.cid = cid * * def play(self, Sound sound not None, loops=0, maxtime=-1, fade_ms=0): # <<<<<<<<<<<<<< * cdef int _loops = loops * cdef int _maxtime = maxtime */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_5); __Pyx_XDECREF(__pyx_t_7); __Pyx_AddTraceback("pygame_sdl2.mixer.Channel.play", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/mixer.pyx":272 * current_sounds[self.cid] = sound * * def stop(self): # <<<<<<<<<<<<<< * with nogil: * Mix_HaltChannel(self.cid) */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_5mixer_7Channel_5stop(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/ static PyObject *__pyx_pw_11pygame_sdl2_5mixer_7Channel_5stop(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("stop (wrapper)", 0); __pyx_r = __pyx_pf_11pygame_sdl2_5mixer_7Channel_4stop(((struct __pyx_obj_11pygame_sdl2_5mixer_Channel *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_5mixer_7Channel_4stop(struct __pyx_obj_11pygame_sdl2_5mixer_Channel *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("stop", 0); /* "pygame_sdl2/mixer.pyx":273 * * def stop(self): * with nogil: # <<<<<<<<<<<<<< * Mix_HaltChannel(self.cid) * */ { #ifdef WITH_THREAD PyThreadState *_save; Py_UNBLOCK_THREADS #endif /*try:*/ { /* "pygame_sdl2/mixer.pyx":274 * def stop(self): * with nogil: * Mix_HaltChannel(self.cid) # <<<<<<<<<<<<<< * * def pause(self): */ Mix_HaltChannel(__pyx_v_self->cid); } /* "pygame_sdl2/mixer.pyx":273 * * def stop(self): * with nogil: # <<<<<<<<<<<<<< * Mix_HaltChannel(self.cid) * */ /*finally:*/ { /*normal exit:*/{ #ifdef WITH_THREAD Py_BLOCK_THREADS #endif goto __pyx_L5; } __pyx_L5:; } } /* "pygame_sdl2/mixer.pyx":272 * current_sounds[self.cid] = sound * * def stop(self): # <<<<<<<<<<<<<< * with nogil: * Mix_HaltChannel(self.cid) */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/mixer.pyx":276 * Mix_HaltChannel(self.cid) * * def pause(self): # <<<<<<<<<<<<<< * with nogil: * Mix_Pause(self.cid) */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_5mixer_7Channel_7pause(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/ static PyObject *__pyx_pw_11pygame_sdl2_5mixer_7Channel_7pause(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("pause (wrapper)", 0); __pyx_r = __pyx_pf_11pygame_sdl2_5mixer_7Channel_6pause(((struct __pyx_obj_11pygame_sdl2_5mixer_Channel *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_5mixer_7Channel_6pause(struct __pyx_obj_11pygame_sdl2_5mixer_Channel *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("pause", 0); /* "pygame_sdl2/mixer.pyx":277 * * def pause(self): * with nogil: # <<<<<<<<<<<<<< * Mix_Pause(self.cid) * */ { #ifdef WITH_THREAD PyThreadState *_save; Py_UNBLOCK_THREADS #endif /*try:*/ { /* "pygame_sdl2/mixer.pyx":278 * def pause(self): * with nogil: * Mix_Pause(self.cid) # <<<<<<<<<<<<<< * * def unpause(self): */ Mix_Pause(__pyx_v_self->cid); } /* "pygame_sdl2/mixer.pyx":277 * * def pause(self): * with nogil: # <<<<<<<<<<<<<< * Mix_Pause(self.cid) * */ /*finally:*/ { /*normal exit:*/{ #ifdef WITH_THREAD Py_BLOCK_THREADS #endif goto __pyx_L5; } __pyx_L5:; } } /* "pygame_sdl2/mixer.pyx":276 * Mix_HaltChannel(self.cid) * * def pause(self): # <<<<<<<<<<<<<< * with nogil: * Mix_Pause(self.cid) */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/mixer.pyx":280 * Mix_Pause(self.cid) * * def unpause(self): # <<<<<<<<<<<<<< * with nogil: * Mix_Resume(self.cid) */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_5mixer_7Channel_9unpause(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/ static PyObject *__pyx_pw_11pygame_sdl2_5mixer_7Channel_9unpause(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("unpause (wrapper)", 0); __pyx_r = __pyx_pf_11pygame_sdl2_5mixer_7Channel_8unpause(((struct __pyx_obj_11pygame_sdl2_5mixer_Channel *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_5mixer_7Channel_8unpause(struct __pyx_obj_11pygame_sdl2_5mixer_Channel *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("unpause", 0); /* "pygame_sdl2/mixer.pyx":281 * * def unpause(self): * with nogil: # <<<<<<<<<<<<<< * Mix_Resume(self.cid) * */ { #ifdef WITH_THREAD PyThreadState *_save; Py_UNBLOCK_THREADS #endif /*try:*/ { /* "pygame_sdl2/mixer.pyx":282 * def unpause(self): * with nogil: * Mix_Resume(self.cid) # <<<<<<<<<<<<<< * * def fadeout(self, time): */ Mix_Resume(__pyx_v_self->cid); } /* "pygame_sdl2/mixer.pyx":281 * * def unpause(self): * with nogil: # <<<<<<<<<<<<<< * Mix_Resume(self.cid) * */ /*finally:*/ { /*normal exit:*/{ #ifdef WITH_THREAD Py_BLOCK_THREADS #endif goto __pyx_L5; } __pyx_L5:; } } /* "pygame_sdl2/mixer.pyx":280 * Mix_Pause(self.cid) * * def unpause(self): # <<<<<<<<<<<<<< * with nogil: * Mix_Resume(self.cid) */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/mixer.pyx":284 * Mix_Resume(self.cid) * * def fadeout(self, time): # <<<<<<<<<<<<<< * cdef int ms = time * with nogil: */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_5mixer_7Channel_11fadeout(PyObject *__pyx_v_self, PyObject *__pyx_v_time); /*proto*/ static PyObject *__pyx_pw_11pygame_sdl2_5mixer_7Channel_11fadeout(PyObject *__pyx_v_self, PyObject *__pyx_v_time) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("fadeout (wrapper)", 0); __pyx_r = __pyx_pf_11pygame_sdl2_5mixer_7Channel_10fadeout(((struct __pyx_obj_11pygame_sdl2_5mixer_Channel *)__pyx_v_self), ((PyObject *)__pyx_v_time)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_5mixer_7Channel_10fadeout(struct __pyx_obj_11pygame_sdl2_5mixer_Channel *__pyx_v_self, PyObject *__pyx_v_time) { int __pyx_v_ms; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("fadeout", 0); /* "pygame_sdl2/mixer.pyx":285 * * def fadeout(self, time): * cdef int ms = time # <<<<<<<<<<<<<< * with nogil: * Mix_FadeOutChannel(self.cid, ms) */ __pyx_t_1 = __Pyx_PyInt_As_int(__pyx_v_time); if (unlikely((__pyx_t_1 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 285; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_v_ms = __pyx_t_1; /* "pygame_sdl2/mixer.pyx":286 * def fadeout(self, time): * cdef int ms = time * with nogil: # <<<<<<<<<<<<<< * Mix_FadeOutChannel(self.cid, ms) * */ { #ifdef WITH_THREAD PyThreadState *_save; Py_UNBLOCK_THREADS #endif /*try:*/ { /* "pygame_sdl2/mixer.pyx":287 * cdef int ms = time * with nogil: * Mix_FadeOutChannel(self.cid, ms) # <<<<<<<<<<<<<< * * def set_volume(self, volume): */ Mix_FadeOutChannel(__pyx_v_self->cid, __pyx_v_ms); } /* "pygame_sdl2/mixer.pyx":286 * def fadeout(self, time): * cdef int ms = time * with nogil: # <<<<<<<<<<<<<< * Mix_FadeOutChannel(self.cid, ms) * */ /*finally:*/ { /*normal exit:*/{ #ifdef WITH_THREAD Py_BLOCK_THREADS #endif goto __pyx_L5; } __pyx_L5:; } } /* "pygame_sdl2/mixer.pyx":284 * Mix_Resume(self.cid) * * def fadeout(self, time): # <<<<<<<<<<<<<< * cdef int ms = time * with nogil: */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("pygame_sdl2.mixer.Channel.fadeout", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/mixer.pyx":289 * Mix_FadeOutChannel(self.cid, ms) * * def set_volume(self, volume): # <<<<<<<<<<<<<< * Mix_Volume(self.cid, int(MIX_MAX_VOLUME * volume)) * */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_5mixer_7Channel_13set_volume(PyObject *__pyx_v_self, PyObject *__pyx_v_volume); /*proto*/ static PyObject *__pyx_pw_11pygame_sdl2_5mixer_7Channel_13set_volume(PyObject *__pyx_v_self, PyObject *__pyx_v_volume) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("set_volume (wrapper)", 0); __pyx_r = __pyx_pf_11pygame_sdl2_5mixer_7Channel_12set_volume(((struct __pyx_obj_11pygame_sdl2_5mixer_Channel *)__pyx_v_self), ((PyObject *)__pyx_v_volume)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_5mixer_7Channel_12set_volume(struct __pyx_obj_11pygame_sdl2_5mixer_Channel *__pyx_v_self, PyObject *__pyx_v_volume) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; int __pyx_t_3; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("set_volume", 0); /* "pygame_sdl2/mixer.pyx":290 * * def set_volume(self, volume): * Mix_Volume(self.cid, int(MIX_MAX_VOLUME * volume)) # <<<<<<<<<<<<<< * * def get_volume(self): */ __pyx_t_1 = __Pyx_PyInt_From_int(MIX_MAX_VOLUME); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 290; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = PyNumber_Multiply(__pyx_t_1, __pyx_v_volume); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 290; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_1 = PyNumber_Int(__pyx_t_2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 290; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_3 = __Pyx_PyInt_As_int(__pyx_t_1); if (unlikely((__pyx_t_3 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 290; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; Mix_Volume(__pyx_v_self->cid, __pyx_t_3); /* "pygame_sdl2/mixer.pyx":289 * Mix_FadeOutChannel(self.cid, ms) * * def set_volume(self, volume): # <<<<<<<<<<<<<< * Mix_Volume(self.cid, int(MIX_MAX_VOLUME * volume)) * */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_AddTraceback("pygame_sdl2.mixer.Channel.set_volume", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/mixer.pyx":292 * Mix_Volume(self.cid, int(MIX_MAX_VOLUME * volume)) * * def get_volume(self): # <<<<<<<<<<<<<< * cdef int vol = Mix_Volume(self.cid, -1) * return vol / MIX_MAX_VOLUME */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_5mixer_7Channel_15get_volume(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/ static PyObject *__pyx_pw_11pygame_sdl2_5mixer_7Channel_15get_volume(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("get_volume (wrapper)", 0); __pyx_r = __pyx_pf_11pygame_sdl2_5mixer_7Channel_14get_volume(((struct __pyx_obj_11pygame_sdl2_5mixer_Channel *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_5mixer_7Channel_14get_volume(struct __pyx_obj_11pygame_sdl2_5mixer_Channel *__pyx_v_self) { int __pyx_v_vol; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("get_volume", 0); /* "pygame_sdl2/mixer.pyx":293 * * def get_volume(self): * cdef int vol = Mix_Volume(self.cid, -1) # <<<<<<<<<<<<<< * return vol / MIX_MAX_VOLUME * */ __pyx_v_vol = Mix_Volume(__pyx_v_self->cid, -1); /* "pygame_sdl2/mixer.pyx":294 * def get_volume(self): * cdef int vol = Mix_Volume(self.cid, -1) * return vol / MIX_MAX_VOLUME # <<<<<<<<<<<<<< * * def get_busy(self): */ __Pyx_XDECREF(__pyx_r); if (unlikely(((double)MIX_MAX_VOLUME) == 0)) { #ifdef WITH_THREAD PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure(); #endif PyErr_SetString(PyExc_ZeroDivisionError, "float division"); #ifdef WITH_THREAD PyGILState_Release(__pyx_gilstate_save); #endif {__pyx_filename = __pyx_f[0]; __pyx_lineno = 294; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } __pyx_t_1 = PyFloat_FromDouble((__pyx_v_vol / ((double)MIX_MAX_VOLUME))); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 294; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "pygame_sdl2/mixer.pyx":292 * Mix_Volume(self.cid, int(MIX_MAX_VOLUME * volume)) * * def get_volume(self): # <<<<<<<<<<<<<< * cdef int vol = Mix_Volume(self.cid, -1) * return vol / MIX_MAX_VOLUME */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("pygame_sdl2.mixer.Channel.get_volume", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/mixer.pyx":296 * return vol / MIX_MAX_VOLUME * * def get_busy(self): # <<<<<<<<<<<<<< * return Mix_Playing(self.cid) != 0 * */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_5mixer_7Channel_17get_busy(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/ static PyObject *__pyx_pw_11pygame_sdl2_5mixer_7Channel_17get_busy(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("get_busy (wrapper)", 0); __pyx_r = __pyx_pf_11pygame_sdl2_5mixer_7Channel_16get_busy(((struct __pyx_obj_11pygame_sdl2_5mixer_Channel *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_5mixer_7Channel_16get_busy(struct __pyx_obj_11pygame_sdl2_5mixer_Channel *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("get_busy", 0); /* "pygame_sdl2/mixer.pyx":297 * * def get_busy(self): * return Mix_Playing(self.cid) != 0 # <<<<<<<<<<<<<< * * def get_sound(self): */ __Pyx_XDECREF(__pyx_r); __pyx_t_1 = __Pyx_PyBool_FromLong((Mix_Playing(__pyx_v_self->cid) != 0)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 297; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "pygame_sdl2/mixer.pyx":296 * return vol / MIX_MAX_VOLUME * * def get_busy(self): # <<<<<<<<<<<<<< * return Mix_Playing(self.cid) != 0 * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("pygame_sdl2.mixer.Channel.get_busy", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/mixer.pyx":299 * return Mix_Playing(self.cid) != 0 * * def get_sound(self): # <<<<<<<<<<<<<< * with _lock: * return current_sounds.get(self.cid) */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_5mixer_7Channel_19get_sound(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/ static PyObject *__pyx_pw_11pygame_sdl2_5mixer_7Channel_19get_sound(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("get_sound (wrapper)", 0); __pyx_r = __pyx_pf_11pygame_sdl2_5mixer_7Channel_18get_sound(((struct __pyx_obj_11pygame_sdl2_5mixer_Channel *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_5mixer_7Channel_18get_sound(struct __pyx_obj_11pygame_sdl2_5mixer_Channel *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; PyObject *__pyx_t_5 = NULL; PyObject *__pyx_t_6 = NULL; PyObject *__pyx_t_7 = NULL; PyObject *__pyx_t_8 = NULL; PyObject *__pyx_t_9 = NULL; int __pyx_t_10; int __pyx_t_11; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("get_sound", 0); /* "pygame_sdl2/mixer.pyx":300 * * def get_sound(self): * with _lock: # <<<<<<<<<<<<<< * return current_sounds.get(self.cid) * */ /*with:*/ { __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_lock); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 300; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = __Pyx_PyObject_LookupSpecial(__pyx_t_1, __pyx_n_s_exit); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 300; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __pyx_t_4 = __Pyx_PyObject_LookupSpecial(__pyx_t_1, __pyx_n_s_enter); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 300; __pyx_clineno = __LINE__; goto __pyx_L3_error;} __Pyx_GOTREF(__pyx_t_4); __pyx_t_5 = NULL; if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_4))) { __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4); if (likely(__pyx_t_5)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4); __Pyx_INCREF(__pyx_t_5); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_4, function); } } if (__pyx_t_5) { __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_5); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 300; __pyx_clineno = __LINE__; goto __pyx_L3_error;} __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; } else { __pyx_t_3 = __Pyx_PyObject_CallNoArg(__pyx_t_4); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 300; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /*try:*/ { { __Pyx_ExceptionSave(&__pyx_t_6, &__pyx_t_7, &__pyx_t_8); __Pyx_XGOTREF(__pyx_t_6); __Pyx_XGOTREF(__pyx_t_7); __Pyx_XGOTREF(__pyx_t_8); /*try:*/ { /* "pygame_sdl2/mixer.pyx":301 * def get_sound(self): * with _lock: * return current_sounds.get(self.cid) # <<<<<<<<<<<<<< * * def queue(self, Sound sound): */ __Pyx_XDECREF(__pyx_r); if (unlikely(__pyx_v_11pygame_sdl2_5mixer_current_sounds == Py_None)) { PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%s'", "get"); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 301; __pyx_clineno = __LINE__; goto __pyx_L7_error;} } __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_self->cid); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 301; __pyx_clineno = __LINE__; goto __pyx_L7_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_t_3 = __Pyx_PyDict_GetItemDefault(__pyx_v_11pygame_sdl2_5mixer_current_sounds, __pyx_t_1, Py_None); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 301; __pyx_clineno = __LINE__; goto __pyx_L7_error;} __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_r = __pyx_t_3; __pyx_t_3 = 0; goto __pyx_L11_try_return; } __pyx_L7_error:; __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; /* "pygame_sdl2/mixer.pyx":300 * * def get_sound(self): * with _lock: # <<<<<<<<<<<<<< * return current_sounds.get(self.cid) * */ /*except:*/ { __Pyx_AddTraceback("pygame_sdl2.mixer.Channel.get_sound", __pyx_clineno, __pyx_lineno, __pyx_filename); if (__Pyx_GetException(&__pyx_t_3, &__pyx_t_1, &__pyx_t_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 300; __pyx_clineno = __LINE__; goto __pyx_L9_except_error;} __Pyx_GOTREF(__pyx_t_3); __Pyx_GOTREF(__pyx_t_1); __Pyx_GOTREF(__pyx_t_4); __pyx_t_5 = PyTuple_Pack(3, __pyx_t_3, __pyx_t_1, __pyx_t_4); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 300; __pyx_clineno = __LINE__; goto __pyx_L9_except_error;} __Pyx_GOTREF(__pyx_t_5); __pyx_t_9 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_5, NULL); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 300; __pyx_clineno = __LINE__; goto __pyx_L9_except_error;} __Pyx_GOTREF(__pyx_t_9); __pyx_t_10 = __Pyx_PyObject_IsTrue(__pyx_t_9); __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; if (__pyx_t_10 < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 300; __pyx_clineno = __LINE__; goto __pyx_L9_except_error;} __pyx_t_11 = ((!(__pyx_t_10 != 0)) != 0); if (__pyx_t_11) { __Pyx_GIVEREF(__pyx_t_3); __Pyx_GIVEREF(__pyx_t_1); __Pyx_XGIVEREF(__pyx_t_4); __Pyx_ErrRestore(__pyx_t_3, __pyx_t_1, __pyx_t_4); __pyx_t_3 = 0; __pyx_t_1 = 0; __pyx_t_4 = 0; {__pyx_filename = __pyx_f[0]; __pyx_lineno = 300; __pyx_clineno = __LINE__; goto __pyx_L9_except_error;} } __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; goto __pyx_L8_exception_handled; } __pyx_L9_except_error:; __Pyx_XGIVEREF(__pyx_t_6); __Pyx_XGIVEREF(__pyx_t_7); __Pyx_XGIVEREF(__pyx_t_8); __Pyx_ExceptionReset(__pyx_t_6, __pyx_t_7, __pyx_t_8); goto __pyx_L1_error; __pyx_L11_try_return:; __Pyx_XGIVEREF(__pyx_t_6); __Pyx_XGIVEREF(__pyx_t_7); __Pyx_XGIVEREF(__pyx_t_8); __Pyx_ExceptionReset(__pyx_t_6, __pyx_t_7, __pyx_t_8); goto __pyx_L4_return; __pyx_L8_exception_handled:; __Pyx_XGIVEREF(__pyx_t_6); __Pyx_XGIVEREF(__pyx_t_7); __Pyx_XGIVEREF(__pyx_t_8); __Pyx_ExceptionReset(__pyx_t_6, __pyx_t_7, __pyx_t_8); } } /*finally:*/ { /*normal exit:*/{ if (__pyx_t_2) { __pyx_t_8 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_tuple__8, NULL); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 300; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_8); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; } goto __pyx_L6; } __pyx_L4_return: { __pyx_t_8 = __pyx_r; __pyx_r = 0; if (__pyx_t_2) { __pyx_t_7 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_tuple__9, NULL); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 300; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; } __pyx_r = __pyx_t_8; __pyx_t_8 = 0; goto __pyx_L0; } __pyx_L6:; } goto __pyx_L18; __pyx_L3_error:; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; goto __pyx_L1_error; __pyx_L18:; } /* "pygame_sdl2/mixer.pyx":299 * return Mix_Playing(self.cid) != 0 * * def get_sound(self): # <<<<<<<<<<<<<< * with _lock: * return current_sounds.get(self.cid) */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_5); __Pyx_AddTraceback("pygame_sdl2.mixer.Channel.get_sound", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/mixer.pyx":303 * return current_sounds.get(self.cid) * * def queue(self, Sound sound): # <<<<<<<<<<<<<< * if self.get_busy(): * with _lock: */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_5mixer_7Channel_21queue(PyObject *__pyx_v_self, PyObject *__pyx_v_sound); /*proto*/ static PyObject *__pyx_pw_11pygame_sdl2_5mixer_7Channel_21queue(PyObject *__pyx_v_self, PyObject *__pyx_v_sound) { CYTHON_UNUSED int __pyx_lineno = 0; CYTHON_UNUSED const char *__pyx_filename = NULL; CYTHON_UNUSED int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("queue (wrapper)", 0); if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_sound), __pyx_ptype_11pygame_sdl2_5mixer_Sound, 1, "sound", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 303; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_r = __pyx_pf_11pygame_sdl2_5mixer_7Channel_20queue(((struct __pyx_obj_11pygame_sdl2_5mixer_Channel *)__pyx_v_self), ((struct __pyx_obj_11pygame_sdl2_5mixer_Sound *)__pyx_v_sound)); /* function exit code */ goto __pyx_L0; __pyx_L1_error:; __pyx_r = NULL; __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_5mixer_7Channel_20queue(struct __pyx_obj_11pygame_sdl2_5mixer_Channel *__pyx_v_self, struct __pyx_obj_11pygame_sdl2_5mixer_Sound *__pyx_v_sound) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; int __pyx_t_4; PyObject *__pyx_t_5 = NULL; PyObject *__pyx_t_6 = NULL; PyObject *__pyx_t_7 = NULL; PyObject *__pyx_t_8 = NULL; PyObject *__pyx_t_9 = NULL; PyObject *__pyx_t_10 = NULL; int __pyx_t_11; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("queue", 0); /* "pygame_sdl2/mixer.pyx":304 * * def queue(self, Sound sound): * if self.get_busy(): # <<<<<<<<<<<<<< * with _lock: * channel_queued[self.cid] = sound */ __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_get_busy); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 304; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = NULL; if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_2))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); if (likely(__pyx_t_3)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); } } if (__pyx_t_3) { __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 304; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } else { __pyx_t_1 = __Pyx_PyObject_CallNoArg(__pyx_t_2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 304; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_4 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 304; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (__pyx_t_4) { /* "pygame_sdl2/mixer.pyx":305 * def queue(self, Sound sound): * if self.get_busy(): * with _lock: # <<<<<<<<<<<<<< * channel_queued[self.cid] = sound * else: */ /*with:*/ { __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_lock); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 305; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_t_5 = __Pyx_PyObject_LookupSpecial(__pyx_t_1, __pyx_n_s_exit); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 305; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); __pyx_t_3 = __Pyx_PyObject_LookupSpecial(__pyx_t_1, __pyx_n_s_enter); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 305; __pyx_clineno = __LINE__; goto __pyx_L4_error;} __Pyx_GOTREF(__pyx_t_3); __pyx_t_6 = NULL; if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_3))) { __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_3); if (likely(__pyx_t_6)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); __Pyx_INCREF(__pyx_t_6); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_3, function); } } if (__pyx_t_6) { __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_6); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 305; __pyx_clineno = __LINE__; goto __pyx_L4_error;} __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; } else { __pyx_t_2 = __Pyx_PyObject_CallNoArg(__pyx_t_3); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 305; __pyx_clineno = __LINE__; goto __pyx_L4_error;} } __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /*try:*/ { { __Pyx_ExceptionSave(&__pyx_t_7, &__pyx_t_8, &__pyx_t_9); __Pyx_XGOTREF(__pyx_t_7); __Pyx_XGOTREF(__pyx_t_8); __Pyx_XGOTREF(__pyx_t_9); /*try:*/ { /* "pygame_sdl2/mixer.pyx":306 * if self.get_busy(): * with _lock: * channel_queued[self.cid] = sound # <<<<<<<<<<<<<< * else: * self.play(sound) */ if (unlikely(__pyx_v_11pygame_sdl2_5mixer_channel_queued == Py_None)) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 306; __pyx_clineno = __LINE__; goto __pyx_L8_error;} } __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_self->cid); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 306; __pyx_clineno = __LINE__; goto __pyx_L8_error;} __Pyx_GOTREF(__pyx_t_1); if (unlikely(PyDict_SetItem(__pyx_v_11pygame_sdl2_5mixer_channel_queued, __pyx_t_1, ((PyObject *)__pyx_v_sound)) < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 306; __pyx_clineno = __LINE__; goto __pyx_L8_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; } __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0; __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0; goto __pyx_L15_try_end; __pyx_L8_error:; __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; /* "pygame_sdl2/mixer.pyx":305 * def queue(self, Sound sound): * if self.get_busy(): * with _lock: # <<<<<<<<<<<<<< * channel_queued[self.cid] = sound * else: */ /*except:*/ { __Pyx_AddTraceback("pygame_sdl2.mixer.Channel.queue", __pyx_clineno, __pyx_lineno, __pyx_filename); if (__Pyx_GetException(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 305; __pyx_clineno = __LINE__; goto __pyx_L10_except_error;} __Pyx_GOTREF(__pyx_t_1); __Pyx_GOTREF(__pyx_t_2); __Pyx_GOTREF(__pyx_t_3); __pyx_t_6 = PyTuple_Pack(3, __pyx_t_1, __pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 305; __pyx_clineno = __LINE__; goto __pyx_L10_except_error;} __Pyx_GOTREF(__pyx_t_6); __pyx_t_10 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_6, NULL); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 305; __pyx_clineno = __LINE__; goto __pyx_L10_except_error;} __Pyx_GOTREF(__pyx_t_10); __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_10); __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; if (__pyx_t_4 < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 305; __pyx_clineno = __LINE__; goto __pyx_L10_except_error;} __pyx_t_11 = ((!(__pyx_t_4 != 0)) != 0); if (__pyx_t_11) { __Pyx_GIVEREF(__pyx_t_1); __Pyx_GIVEREF(__pyx_t_2); __Pyx_XGIVEREF(__pyx_t_3); __Pyx_ErrRestore(__pyx_t_1, __pyx_t_2, __pyx_t_3); __pyx_t_1 = 0; __pyx_t_2 = 0; __pyx_t_3 = 0; {__pyx_filename = __pyx_f[0]; __pyx_lineno = 305; __pyx_clineno = __LINE__; goto __pyx_L10_except_error;} } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; goto __pyx_L9_exception_handled; } __pyx_L10_except_error:; __Pyx_XGIVEREF(__pyx_t_7); __Pyx_XGIVEREF(__pyx_t_8); __Pyx_XGIVEREF(__pyx_t_9); __Pyx_ExceptionReset(__pyx_t_7, __pyx_t_8, __pyx_t_9); goto __pyx_L1_error; __pyx_L9_exception_handled:; __Pyx_XGIVEREF(__pyx_t_7); __Pyx_XGIVEREF(__pyx_t_8); __Pyx_XGIVEREF(__pyx_t_9); __Pyx_ExceptionReset(__pyx_t_7, __pyx_t_8, __pyx_t_9); __pyx_L15_try_end:; } } /*finally:*/ { /*normal exit:*/{ if (__pyx_t_5) { __pyx_t_9 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_tuple__10, NULL); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 305; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_9); __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; } goto __pyx_L7; } __pyx_L7:; } goto __pyx_L19; __pyx_L4_error:; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; goto __pyx_L1_error; __pyx_L19:; } goto __pyx_L3; } /*else*/ { /* "pygame_sdl2/mixer.pyx":308 * channel_queued[self.cid] = sound * else: * self.play(sound) # <<<<<<<<<<<<<< * * def get_queue(self): */ __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_play); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 308; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __pyx_t_1 = NULL; if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_2))) { __pyx_t_1 = PyMethod_GET_SELF(__pyx_t_2); if (likely(__pyx_t_1)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_1); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); } } if (!__pyx_t_1) { __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_t_2, ((PyObject *)__pyx_v_sound)); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 308; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); } else { __pyx_t_6 = PyTuple_New(1+1); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 308; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_6); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_1); __Pyx_GIVEREF(__pyx_t_1); __pyx_t_1 = NULL; __Pyx_INCREF(((PyObject *)__pyx_v_sound)); PyTuple_SET_ITEM(__pyx_t_6, 0+1, ((PyObject *)__pyx_v_sound)); __Pyx_GIVEREF(((PyObject *)__pyx_v_sound)); __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_6, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 308; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; } __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } __pyx_L3:; /* "pygame_sdl2/mixer.pyx":303 * return current_sounds.get(self.cid) * * def queue(self, Sound sound): # <<<<<<<<<<<<<< * if self.get_busy(): * with _lock: */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_6); __Pyx_AddTraceback("pygame_sdl2.mixer.Channel.queue", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/mixer.pyx":310 * self.play(sound) * * def get_queue(self): # <<<<<<<<<<<<<< * with _lock: * return channel_queued.get(self.cid) */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_5mixer_7Channel_23get_queue(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/ static PyObject *__pyx_pw_11pygame_sdl2_5mixer_7Channel_23get_queue(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("get_queue (wrapper)", 0); __pyx_r = __pyx_pf_11pygame_sdl2_5mixer_7Channel_22get_queue(((struct __pyx_obj_11pygame_sdl2_5mixer_Channel *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_5mixer_7Channel_22get_queue(struct __pyx_obj_11pygame_sdl2_5mixer_Channel *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; PyObject *__pyx_t_5 = NULL; PyObject *__pyx_t_6 = NULL; PyObject *__pyx_t_7 = NULL; PyObject *__pyx_t_8 = NULL; PyObject *__pyx_t_9 = NULL; int __pyx_t_10; int __pyx_t_11; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("get_queue", 0); /* "pygame_sdl2/mixer.pyx":311 * * def get_queue(self): * with _lock: # <<<<<<<<<<<<<< * return channel_queued.get(self.cid) * */ /*with:*/ { __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_lock); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 311; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = __Pyx_PyObject_LookupSpecial(__pyx_t_1, __pyx_n_s_exit); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 311; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __pyx_t_4 = __Pyx_PyObject_LookupSpecial(__pyx_t_1, __pyx_n_s_enter); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 311; __pyx_clineno = __LINE__; goto __pyx_L3_error;} __Pyx_GOTREF(__pyx_t_4); __pyx_t_5 = NULL; if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_4))) { __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4); if (likely(__pyx_t_5)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4); __Pyx_INCREF(__pyx_t_5); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_4, function); } } if (__pyx_t_5) { __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_5); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 311; __pyx_clineno = __LINE__; goto __pyx_L3_error;} __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; } else { __pyx_t_3 = __Pyx_PyObject_CallNoArg(__pyx_t_4); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 311; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /*try:*/ { { __Pyx_ExceptionSave(&__pyx_t_6, &__pyx_t_7, &__pyx_t_8); __Pyx_XGOTREF(__pyx_t_6); __Pyx_XGOTREF(__pyx_t_7); __Pyx_XGOTREF(__pyx_t_8); /*try:*/ { /* "pygame_sdl2/mixer.pyx":312 * def get_queue(self): * with _lock: * return channel_queued.get(self.cid) # <<<<<<<<<<<<<< * * def set_endevent(self, type=None): */ __Pyx_XDECREF(__pyx_r); if (unlikely(__pyx_v_11pygame_sdl2_5mixer_channel_queued == Py_None)) { PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%s'", "get"); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 312; __pyx_clineno = __LINE__; goto __pyx_L7_error;} } __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_self->cid); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 312; __pyx_clineno = __LINE__; goto __pyx_L7_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_t_3 = __Pyx_PyDict_GetItemDefault(__pyx_v_11pygame_sdl2_5mixer_channel_queued, __pyx_t_1, Py_None); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 312; __pyx_clineno = __LINE__; goto __pyx_L7_error;} __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_r = __pyx_t_3; __pyx_t_3 = 0; goto __pyx_L11_try_return; } __pyx_L7_error:; __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; /* "pygame_sdl2/mixer.pyx":311 * * def get_queue(self): * with _lock: # <<<<<<<<<<<<<< * return channel_queued.get(self.cid) * */ /*except:*/ { __Pyx_AddTraceback("pygame_sdl2.mixer.Channel.get_queue", __pyx_clineno, __pyx_lineno, __pyx_filename); if (__Pyx_GetException(&__pyx_t_3, &__pyx_t_1, &__pyx_t_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 311; __pyx_clineno = __LINE__; goto __pyx_L9_except_error;} __Pyx_GOTREF(__pyx_t_3); __Pyx_GOTREF(__pyx_t_1); __Pyx_GOTREF(__pyx_t_4); __pyx_t_5 = PyTuple_Pack(3, __pyx_t_3, __pyx_t_1, __pyx_t_4); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 311; __pyx_clineno = __LINE__; goto __pyx_L9_except_error;} __Pyx_GOTREF(__pyx_t_5); __pyx_t_9 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_5, NULL); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 311; __pyx_clineno = __LINE__; goto __pyx_L9_except_error;} __Pyx_GOTREF(__pyx_t_9); __pyx_t_10 = __Pyx_PyObject_IsTrue(__pyx_t_9); __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; if (__pyx_t_10 < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 311; __pyx_clineno = __LINE__; goto __pyx_L9_except_error;} __pyx_t_11 = ((!(__pyx_t_10 != 0)) != 0); if (__pyx_t_11) { __Pyx_GIVEREF(__pyx_t_3); __Pyx_GIVEREF(__pyx_t_1); __Pyx_XGIVEREF(__pyx_t_4); __Pyx_ErrRestore(__pyx_t_3, __pyx_t_1, __pyx_t_4); __pyx_t_3 = 0; __pyx_t_1 = 0; __pyx_t_4 = 0; {__pyx_filename = __pyx_f[0]; __pyx_lineno = 311; __pyx_clineno = __LINE__; goto __pyx_L9_except_error;} } __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; goto __pyx_L8_exception_handled; } __pyx_L9_except_error:; __Pyx_XGIVEREF(__pyx_t_6); __Pyx_XGIVEREF(__pyx_t_7); __Pyx_XGIVEREF(__pyx_t_8); __Pyx_ExceptionReset(__pyx_t_6, __pyx_t_7, __pyx_t_8); goto __pyx_L1_error; __pyx_L11_try_return:; __Pyx_XGIVEREF(__pyx_t_6); __Pyx_XGIVEREF(__pyx_t_7); __Pyx_XGIVEREF(__pyx_t_8); __Pyx_ExceptionReset(__pyx_t_6, __pyx_t_7, __pyx_t_8); goto __pyx_L4_return; __pyx_L8_exception_handled:; __Pyx_XGIVEREF(__pyx_t_6); __Pyx_XGIVEREF(__pyx_t_7); __Pyx_XGIVEREF(__pyx_t_8); __Pyx_ExceptionReset(__pyx_t_6, __pyx_t_7, __pyx_t_8); } } /*finally:*/ { /*normal exit:*/{ if (__pyx_t_2) { __pyx_t_8 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_tuple__11, NULL); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 311; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_8); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; } goto __pyx_L6; } __pyx_L4_return: { __pyx_t_8 = __pyx_r; __pyx_r = 0; if (__pyx_t_2) { __pyx_t_7 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_tuple__12, NULL); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 311; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; } __pyx_r = __pyx_t_8; __pyx_t_8 = 0; goto __pyx_L0; } __pyx_L6:; } goto __pyx_L18; __pyx_L3_error:; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; goto __pyx_L1_error; __pyx_L18:; } /* "pygame_sdl2/mixer.pyx":310 * self.play(sound) * * def get_queue(self): # <<<<<<<<<<<<<< * with _lock: * return channel_queued.get(self.cid) */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_5); __Pyx_AddTraceback("pygame_sdl2.mixer.Channel.get_queue", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/mixer.pyx":314 * return channel_queued.get(self.cid) * * def set_endevent(self, type=None): # <<<<<<<<<<<<<< * channel_events[self.cid] = type or 0 * */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_5mixer_7Channel_25set_endevent(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static PyObject *__pyx_pw_11pygame_sdl2_5mixer_7Channel_25set_endevent(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_type = 0; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("set_endevent (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_type,0}; PyObject* values[1] = {0}; values[0] = ((PyObject *)Py_None); if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (kw_args > 0) { PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_type); if (value) { values[0] = value; kw_args--; } } } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "set_endevent") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 314; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } } else { switch (PyTuple_GET_SIZE(__pyx_args)) { case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); case 0: break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_type = values[0]; } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("set_endevent", 0, 0, 1, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 314; __pyx_clineno = __LINE__; goto __pyx_L3_error;} __pyx_L3_error:; __Pyx_AddTraceback("pygame_sdl2.mixer.Channel.set_endevent", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_11pygame_sdl2_5mixer_7Channel_24set_endevent(((struct __pyx_obj_11pygame_sdl2_5mixer_Channel *)__pyx_v_self), __pyx_v_type); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_5mixer_7Channel_24set_endevent(struct __pyx_obj_11pygame_sdl2_5mixer_Channel *__pyx_v_self, PyObject *__pyx_v_type) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_t_2; PyObject *__pyx_t_3 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("set_endevent", 0); /* "pygame_sdl2/mixer.pyx":315 * * def set_endevent(self, type=None): * channel_events[self.cid] = type or 0 # <<<<<<<<<<<<<< * * def get_endevent(self): */ __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_v_type); if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 315; __pyx_clineno = __LINE__; goto __pyx_L1_error;} if (!__pyx_t_2) { } else { __Pyx_INCREF(__pyx_v_type); __pyx_t_1 = __pyx_v_type; goto __pyx_L3_bool_binop_done; } __pyx_t_3 = __Pyx_PyInt_From_long(0); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 315; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __pyx_t_1 = __pyx_t_3; __pyx_t_3 = 0; __pyx_L3_bool_binop_done:; if (unlikely(__pyx_v_11pygame_sdl2_5mixer_channel_events == Py_None)) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 315; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } __pyx_t_3 = __Pyx_PyInt_From_int(__pyx_v_self->cid); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 315; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); if (unlikely(PyDict_SetItem(__pyx_v_11pygame_sdl2_5mixer_channel_events, __pyx_t_3, __pyx_t_1) < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 315; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "pygame_sdl2/mixer.pyx":314 * return channel_queued.get(self.cid) * * def set_endevent(self, type=None): # <<<<<<<<<<<<<< * channel_events[self.cid] = type or 0 * */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("pygame_sdl2.mixer.Channel.set_endevent", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/mixer.pyx":317 * channel_events[self.cid] = type or 0 * * def get_endevent(self): # <<<<<<<<<<<<<< * return channel_events.get(self.cid, 0) */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_5mixer_7Channel_27get_endevent(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/ static PyObject *__pyx_pw_11pygame_sdl2_5mixer_7Channel_27get_endevent(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("get_endevent (wrapper)", 0); __pyx_r = __pyx_pf_11pygame_sdl2_5mixer_7Channel_26get_endevent(((struct __pyx_obj_11pygame_sdl2_5mixer_Channel *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_5mixer_7Channel_26get_endevent(struct __pyx_obj_11pygame_sdl2_5mixer_Channel *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("get_endevent", 0); /* "pygame_sdl2/mixer.pyx":318 * * def get_endevent(self): * return channel_events.get(self.cid, 0) # <<<<<<<<<<<<<< */ __Pyx_XDECREF(__pyx_r); if (unlikely(__pyx_v_11pygame_sdl2_5mixer_channel_events == Py_None)) { PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%s'", "get"); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 318; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_self->cid); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 318; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = __Pyx_PyDict_GetItemDefault(__pyx_v_11pygame_sdl2_5mixer_channel_events, __pyx_t_1, __pyx_int_0); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 318; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; /* "pygame_sdl2/mixer.pyx":317 * channel_events[self.cid] = type or 0 * * def get_endevent(self): # <<<<<<<<<<<<<< * return channel_events.get(self.cid, 0) */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_AddTraceback("pygame_sdl2.mixer.Channel.get_endevent", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_tp_new_11pygame_sdl2_5mixer_Sound(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) { PyObject *o; if (likely((t->tp_flags & Py_TPFLAGS_IS_ABSTRACT) == 0)) { o = (*t->tp_alloc)(t, 0); } else { o = (PyObject *) PyBaseObject_Type.tp_new(t, __pyx_empty_tuple, 0); } if (unlikely(!o)) return 0; if (unlikely(__pyx_pw_11pygame_sdl2_5mixer_5Sound_1__cinit__(o, __pyx_empty_tuple, NULL) < 0)) { Py_DECREF(o); o = 0; } return o; } static void __pyx_tp_dealloc_11pygame_sdl2_5mixer_Sound(PyObject *o) { #if PY_VERSION_HEX >= 0x030400a1 if (unlikely(Py_TYPE(o)->tp_finalize) && (!PyType_IS_GC(Py_TYPE(o)) || !_PyGC_FINALIZED(o))) { if (PyObject_CallFinalizerFromDealloc(o)) return; } #endif { PyObject *etype, *eval, *etb; PyErr_Fetch(&etype, &eval, &etb); ++Py_REFCNT(o); __pyx_pw_11pygame_sdl2_5mixer_5Sound_3__dealloc__(o); --Py_REFCNT(o); PyErr_Restore(etype, eval, etb); } (*Py_TYPE(o)->tp_free)(o); } static PyMethodDef __pyx_methods_11pygame_sdl2_5mixer_Sound[] = { {"play", (PyCFunction)__pyx_pw_11pygame_sdl2_5mixer_5Sound_7play, METH_VARARGS|METH_KEYWORDS, 0}, {"stop", (PyCFunction)__pyx_pw_11pygame_sdl2_5mixer_5Sound_9stop, METH_NOARGS, 0}, {"pause", (PyCFunction)__pyx_pw_11pygame_sdl2_5mixer_5Sound_11pause, METH_NOARGS, 0}, {"unpause", (PyCFunction)__pyx_pw_11pygame_sdl2_5mixer_5Sound_13unpause, METH_NOARGS, 0}, {"fadeout", (PyCFunction)__pyx_pw_11pygame_sdl2_5mixer_5Sound_15fadeout, METH_O, 0}, {"set_volume", (PyCFunction)__pyx_pw_11pygame_sdl2_5mixer_5Sound_17set_volume, METH_O, 0}, {"get_volume", (PyCFunction)__pyx_pw_11pygame_sdl2_5mixer_5Sound_19get_volume, METH_NOARGS, 0}, {"get_num_channels", (PyCFunction)__pyx_pw_11pygame_sdl2_5mixer_5Sound_21get_num_channels, METH_NOARGS, 0}, {"get_length", (PyCFunction)__pyx_pw_11pygame_sdl2_5mixer_5Sound_23get_length, METH_NOARGS, 0}, {"get_raw", (PyCFunction)__pyx_pw_11pygame_sdl2_5mixer_5Sound_25get_raw, METH_NOARGS, 0}, {0, 0, 0, 0} }; static PyTypeObject __pyx_type_11pygame_sdl2_5mixer_Sound = { PyVarObject_HEAD_INIT(0, 0) "pygame_sdl2.mixer.Sound", /*tp_name*/ sizeof(struct __pyx_obj_11pygame_sdl2_5mixer_Sound), /*tp_basicsize*/ 0, /*tp_itemsize*/ __pyx_tp_dealloc_11pygame_sdl2_5mixer_Sound, /*tp_dealloc*/ 0, /*tp_print*/ 0, /*tp_getattr*/ 0, /*tp_setattr*/ #if PY_MAJOR_VERSION < 3 0, /*tp_compare*/ #else 0, /*reserved*/ #endif 0, /*tp_repr*/ 0, /*tp_as_number*/ 0, /*tp_as_sequence*/ 0, /*tp_as_mapping*/ 0, /*tp_hash*/ 0, /*tp_call*/ 0, /*tp_str*/ 0, /*tp_getattro*/ 0, /*tp_setattro*/ 0, /*tp_as_buffer*/ Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE, /*tp_flags*/ 0, /*tp_doc*/ 0, /*tp_traverse*/ 0, /*tp_clear*/ 0, /*tp_richcompare*/ 0, /*tp_weaklistoffset*/ 0, /*tp_iter*/ 0, /*tp_iternext*/ __pyx_methods_11pygame_sdl2_5mixer_Sound, /*tp_methods*/ 0, /*tp_members*/ 0, /*tp_getset*/ 0, /*tp_base*/ 0, /*tp_dict*/ 0, /*tp_descr_get*/ 0, /*tp_descr_set*/ 0, /*tp_dictoffset*/ __pyx_pw_11pygame_sdl2_5mixer_5Sound_5__init__, /*tp_init*/ 0, /*tp_alloc*/ __pyx_tp_new_11pygame_sdl2_5mixer_Sound, /*tp_new*/ 0, /*tp_free*/ 0, /*tp_is_gc*/ 0, /*tp_bases*/ 0, /*tp_mro*/ 0, /*tp_cache*/ 0, /*tp_subclasses*/ 0, /*tp_weaklist*/ 0, /*tp_del*/ 0, /*tp_version_tag*/ #if PY_VERSION_HEX >= 0x030400a1 0, /*tp_finalize*/ #endif }; static PyObject *__pyx_tp_new_11pygame_sdl2_5mixer_Channel(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) { PyObject *o; if (likely((t->tp_flags & Py_TPFLAGS_IS_ABSTRACT) == 0)) { o = (*t->tp_alloc)(t, 0); } else { o = (PyObject *) PyBaseObject_Type.tp_new(t, __pyx_empty_tuple, 0); } if (unlikely(!o)) return 0; return o; } static void __pyx_tp_dealloc_11pygame_sdl2_5mixer_Channel(PyObject *o) { #if PY_VERSION_HEX >= 0x030400a1 if (unlikely(Py_TYPE(o)->tp_finalize) && (!PyType_IS_GC(Py_TYPE(o)) || !_PyGC_FINALIZED(o))) { if (PyObject_CallFinalizerFromDealloc(o)) return; } #endif (*Py_TYPE(o)->tp_free)(o); } static PyMethodDef __pyx_methods_11pygame_sdl2_5mixer_Channel[] = { {"play", (PyCFunction)__pyx_pw_11pygame_sdl2_5mixer_7Channel_3play, METH_VARARGS|METH_KEYWORDS, 0}, {"stop", (PyCFunction)__pyx_pw_11pygame_sdl2_5mixer_7Channel_5stop, METH_NOARGS, 0}, {"pause", (PyCFunction)__pyx_pw_11pygame_sdl2_5mixer_7Channel_7pause, METH_NOARGS, 0}, {"unpause", (PyCFunction)__pyx_pw_11pygame_sdl2_5mixer_7Channel_9unpause, METH_NOARGS, 0}, {"fadeout", (PyCFunction)__pyx_pw_11pygame_sdl2_5mixer_7Channel_11fadeout, METH_O, 0}, {"set_volume", (PyCFunction)__pyx_pw_11pygame_sdl2_5mixer_7Channel_13set_volume, METH_O, 0}, {"get_volume", (PyCFunction)__pyx_pw_11pygame_sdl2_5mixer_7Channel_15get_volume, METH_NOARGS, 0}, {"get_busy", (PyCFunction)__pyx_pw_11pygame_sdl2_5mixer_7Channel_17get_busy, METH_NOARGS, 0}, {"get_sound", (PyCFunction)__pyx_pw_11pygame_sdl2_5mixer_7Channel_19get_sound, METH_NOARGS, 0}, {"queue", (PyCFunction)__pyx_pw_11pygame_sdl2_5mixer_7Channel_21queue, METH_O, 0}, {"get_queue", (PyCFunction)__pyx_pw_11pygame_sdl2_5mixer_7Channel_23get_queue, METH_NOARGS, 0}, {"set_endevent", (PyCFunction)__pyx_pw_11pygame_sdl2_5mixer_7Channel_25set_endevent, METH_VARARGS|METH_KEYWORDS, 0}, {"get_endevent", (PyCFunction)__pyx_pw_11pygame_sdl2_5mixer_7Channel_27get_endevent, METH_NOARGS, 0}, {0, 0, 0, 0} }; static PyTypeObject __pyx_type_11pygame_sdl2_5mixer_Channel = { PyVarObject_HEAD_INIT(0, 0) "pygame_sdl2.mixer.Channel", /*tp_name*/ sizeof(struct __pyx_obj_11pygame_sdl2_5mixer_Channel), /*tp_basicsize*/ 0, /*tp_itemsize*/ __pyx_tp_dealloc_11pygame_sdl2_5mixer_Channel, /*tp_dealloc*/ 0, /*tp_print*/ 0, /*tp_getattr*/ 0, /*tp_setattr*/ #if PY_MAJOR_VERSION < 3 0, /*tp_compare*/ #else 0, /*reserved*/ #endif 0, /*tp_repr*/ 0, /*tp_as_number*/ 0, /*tp_as_sequence*/ 0, /*tp_as_mapping*/ 0, /*tp_hash*/ 0, /*tp_call*/ 0, /*tp_str*/ 0, /*tp_getattro*/ 0, /*tp_setattro*/ 0, /*tp_as_buffer*/ Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE, /*tp_flags*/ 0, /*tp_doc*/ 0, /*tp_traverse*/ 0, /*tp_clear*/ 0, /*tp_richcompare*/ 0, /*tp_weaklistoffset*/ 0, /*tp_iter*/ 0, /*tp_iternext*/ __pyx_methods_11pygame_sdl2_5mixer_Channel, /*tp_methods*/ 0, /*tp_members*/ 0, /*tp_getset*/ 0, /*tp_base*/ 0, /*tp_dict*/ 0, /*tp_descr_get*/ 0, /*tp_descr_set*/ 0, /*tp_dictoffset*/ __pyx_pw_11pygame_sdl2_5mixer_7Channel_1__init__, /*tp_init*/ 0, /*tp_alloc*/ __pyx_tp_new_11pygame_sdl2_5mixer_Channel, /*tp_new*/ 0, /*tp_free*/ 0, /*tp_is_gc*/ 0, /*tp_bases*/ 0, /*tp_mro*/ 0, /*tp_cache*/ 0, /*tp_subclasses*/ 0, /*tp_weaklist*/ 0, /*tp_del*/ 0, /*tp_version_tag*/ #if PY_VERSION_HEX >= 0x030400a1 0, /*tp_finalize*/ #endif }; static PyMethodDef __pyx_methods[] = { {0, 0, 0, 0} }; #if PY_MAJOR_VERSION >= 3 static struct PyModuleDef __pyx_moduledef = { #if PY_VERSION_HEX < 0x03020000 { PyObject_HEAD_INIT(NULL) NULL, 0, NULL }, #else PyModuleDef_HEAD_INIT, #endif "mixer", 0, /* m_doc */ -1, /* m_size */ __pyx_methods /* m_methods */, NULL, /* m_reload */ NULL, /* m_traverse */ NULL, /* m_clear */ NULL /* m_free */ }; #endif static __Pyx_StringTabEntry __pyx_string_tab[] = { {&__pyx_n_s_Lock, __pyx_k_Lock, sizeof(__pyx_k_Lock), 0, 0, 1, 1}, {&__pyx_kp_s_Not_implemented, __pyx_k_Not_implemented, sizeof(__pyx_k_Not_implemented), 0, 0, 1, 0}, {&__pyx_n_s_Thread, __pyx_k_Thread, sizeof(__pyx_k_Thread), 0, 0, 1, 1}, {&__pyx_kp_s_Users_tom_ab_pygame_sdl2_src_py, __pyx_k_Users_tom_ab_pygame_sdl2_src_py, sizeof(__pyx_k_Users_tom_ab_pygame_sdl2_src_py), 0, 0, 1, 0}, {&__pyx_n_s__13, __pyx_k__13, sizeof(__pyx_k__13), 0, 0, 1, 1}, {&__pyx_kp_s__4, __pyx_k__4, sizeof(__pyx_k__4), 0, 0, 1, 0}, {&__pyx_n_s_append, __pyx_k_append, sizeof(__pyx_k_append), 0, 0, 1, 1}, {&__pyx_n_s_args, __pyx_k_args, sizeof(__pyx_k_args), 0, 0, 1, 1}, {&__pyx_n_s_buffer, __pyx_k_buffer, sizeof(__pyx_k_buffer), 0, 0, 1, 1}, {&__pyx_n_s_buffersize, __pyx_k_buffersize, sizeof(__pyx_k_buffersize), 0, 0, 1, 1}, {&__pyx_n_s_chan, __pyx_k_chan, sizeof(__pyx_k_chan), 0, 0, 1, 1}, {&__pyx_n_s_channel, __pyx_k_channel, sizeof(__pyx_k_channel), 0, 0, 1, 1}, {&__pyx_n_s_channels, __pyx_k_channels, sizeof(__pyx_k_channels), 0, 0, 1, 1}, {&__pyx_n_s_cid, __pyx_k_cid, sizeof(__pyx_k_cid), 0, 0, 1, 1}, {&__pyx_n_s_count, __pyx_k_count, sizeof(__pyx_k_count), 0, 0, 1, 1}, {&__pyx_n_s_enter, __pyx_k_enter, sizeof(__pyx_k_enter), 0, 0, 1, 1}, {&__pyx_n_s_error, __pyx_k_error, sizeof(__pyx_k_error), 0, 0, 1, 1}, {&__pyx_n_s_errors, __pyx_k_errors, sizeof(__pyx_k_errors), 0, 0, 1, 1}, {&__pyx_n_s_exit, __pyx_k_exit, sizeof(__pyx_k_exit), 0, 0, 1, 1}, {&__pyx_n_s_fade_ms, __pyx_k_fade_ms, sizeof(__pyx_k_fade_ms), 0, 0, 1, 1}, {&__pyx_n_s_fadeout, __pyx_k_fadeout, sizeof(__pyx_k_fadeout), 0, 0, 1, 1}, {&__pyx_n_s_fi, __pyx_k_fi, sizeof(__pyx_k_fi), 0, 0, 1, 1}, {&__pyx_n_s_find_channel, __pyx_k_find_channel, sizeof(__pyx_k_find_channel), 0, 0, 1, 1}, {&__pyx_n_s_flag, __pyx_k_flag, sizeof(__pyx_k_flag), 0, 0, 1, 1}, {&__pyx_n_s_force, __pyx_k_force, sizeof(__pyx_k_force), 0, 0, 1, 1}, {&__pyx_n_s_format, __pyx_k_format, sizeof(__pyx_k_format), 0, 0, 1, 1}, {&__pyx_n_s_frequency, __pyx_k_frequency, sizeof(__pyx_k_frequency), 0, 0, 1, 1}, {&__pyx_n_s_get, __pyx_k_get, sizeof(__pyx_k_get), 0, 0, 1, 1}, {&__pyx_n_s_get_busy, __pyx_k_get_busy, sizeof(__pyx_k_get_busy), 0, 0, 1, 1}, {&__pyx_n_s_get_init, __pyx_k_get_init, sizeof(__pyx_k_get_init), 0, 0, 1, 1}, {&__pyx_n_s_get_num_channels, __pyx_k_get_num_channels, sizeof(__pyx_k_get_num_channels), 0, 0, 1, 1}, {&__pyx_n_s_import, __pyx_k_import, sizeof(__pyx_k_import), 0, 0, 1, 1}, {&__pyx_n_s_init, __pyx_k_init, sizeof(__pyx_k_init), 0, 0, 1, 1}, {&__pyx_n_s_lock, __pyx_k_lock, sizeof(__pyx_k_lock), 0, 0, 1, 1}, {&__pyx_n_s_loops, __pyx_k_loops, sizeof(__pyx_k_loops), 0, 0, 1, 1}, {&__pyx_n_s_main, __pyx_k_main, sizeof(__pyx_k_main), 0, 0, 1, 1}, {&__pyx_n_s_maxtime, __pyx_k_maxtime, sizeof(__pyx_k_maxtime), 0, 0, 1, 1}, {&__pyx_n_s_ms, __pyx_k_ms, sizeof(__pyx_k_ms), 0, 0, 1, 1}, {&__pyx_n_s_music, __pyx_k_music, sizeof(__pyx_k_music), 0, 0, 1, 1}, {&__pyx_n_s_next_sound, __pyx_k_next_sound, sizeof(__pyx_k_next_sound), 0, 0, 1, 1}, {&__pyx_n_s_pause, __pyx_k_pause, sizeof(__pyx_k_pause), 0, 0, 1, 1}, {&__pyx_n_s_play, __pyx_k_play, sizeof(__pyx_k_play), 0, 0, 1, 1}, {&__pyx_n_s_play_current, __pyx_k_play_current, sizeof(__pyx_k_play_current), 0, 0, 1, 1}, {&__pyx_n_s_pre_init, __pyx_k_pre_init, sizeof(__pyx_k_pre_init), 0, 0, 1, 1}, {&__pyx_n_s_pygame_sdl2, __pyx_k_pygame_sdl2, sizeof(__pyx_k_pygame_sdl2), 0, 0, 1, 1}, {&__pyx_n_s_pygame_sdl2_error, __pyx_k_pygame_sdl2_error, sizeof(__pyx_k_pygame_sdl2_error), 0, 0, 1, 1}, {&__pyx_n_s_pygame_sdl2_mixer, __pyx_k_pygame_sdl2_mixer, sizeof(__pyx_k_pygame_sdl2_mixer), 0, 0, 1, 1}, {&__pyx_n_s_pygame_sdl2_mixer_music, __pyx_k_pygame_sdl2_mixer_music, sizeof(__pyx_k_pygame_sdl2_mixer_music), 0, 0, 1, 1}, {&__pyx_n_s_quit, __pyx_k_quit, sizeof(__pyx_k_quit), 0, 0, 1, 1}, {&__pyx_n_s_register_init, __pyx_k_register_init, sizeof(__pyx_k_register_init), 0, 0, 1, 1}, {&__pyx_n_s_register_quit, __pyx_k_register_quit, sizeof(__pyx_k_register_quit), 0, 0, 1, 1}, {&__pyx_n_s_set_num_channels, __pyx_k_set_num_channels, sizeof(__pyx_k_set_num_channels), 0, 0, 1, 1}, {&__pyx_n_s_set_reserved, __pyx_k_set_reserved, sizeof(__pyx_k_set_reserved), 0, 0, 1, 1}, {&__pyx_n_s_size, __pyx_k_size, sizeof(__pyx_k_size), 0, 0, 1, 1}, {&__pyx_n_s_sound, __pyx_k_sound, sizeof(__pyx_k_sound), 0, 0, 1, 1}, {&__pyx_n_s_start, __pyx_k_start, sizeof(__pyx_k_start), 0, 0, 1, 1}, {&__pyx_n_s_stop, __pyx_k_stop, sizeof(__pyx_k_stop), 0, 0, 1, 1}, {&__pyx_n_s_sys, __pyx_k_sys, sizeof(__pyx_k_sys), 0, 0, 1, 1}, {&__pyx_n_s_target, __pyx_k_target, sizeof(__pyx_k_target), 0, 0, 1, 1}, {&__pyx_n_s_test, __pyx_k_test, sizeof(__pyx_k_test), 0, 0, 1, 1}, {&__pyx_n_s_threading, __pyx_k_threading, sizeof(__pyx_k_threading), 0, 0, 1, 1}, {&__pyx_n_s_time, __pyx_k_time, sizeof(__pyx_k_time), 0, 0, 1, 1}, {&__pyx_n_s_type, __pyx_k_type, sizeof(__pyx_k_type), 0, 0, 1, 1}, {&__pyx_n_s_unpause, __pyx_k_unpause, sizeof(__pyx_k_unpause), 0, 0, 1, 1}, {0, 0, 0, 0, 0, 0, 0} }; static int __Pyx_InitCachedBuiltins(void) { return 0; } static int __Pyx_InitCachedConstants(void) { __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__Pyx_InitCachedConstants", 0); /* "pygame_sdl2/mixer.pyx":50 * cdef Sound next_sound * * with _lock: # <<<<<<<<<<<<<< * next_sound = channel_queued[channel] * current_sounds[channel] = next_sound */ __pyx_tuple_ = PyTuple_Pack(3, Py_None, Py_None, Py_None); if (unlikely(!__pyx_tuple_)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 50; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_tuple_); __Pyx_GIVEREF(__pyx_tuple_); /* "pygame_sdl2/mixer.pyx":71 * SDL_PushEvent(&e) * * with _lock: # <<<<<<<<<<<<<< * next_sound = channel_queued.get(channel) * if next_sound: */ __pyx_tuple__2 = PyTuple_Pack(3, Py_None, Py_None, Py_None); if (unlikely(!__pyx_tuple__2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 71; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_tuple__2); __Pyx_GIVEREF(__pyx_tuple__2); /* "pygame_sdl2/mixer.pyx":246 * def get_raw(self): * # return self.chunk.abuf * raise error("Not implemented.") # <<<<<<<<<<<<<< * * */ __pyx_tuple__6 = PyTuple_Pack(1, __pyx_kp_s_Not_implemented); if (unlikely(!__pyx_tuple__6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 246; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_tuple__6); __Pyx_GIVEREF(__pyx_tuple__6); /* "pygame_sdl2/mixer.pyx":269 * raise error() * * with _lock: # <<<<<<<<<<<<<< * current_sounds[self.cid] = sound * */ __pyx_tuple__7 = PyTuple_Pack(3, Py_None, Py_None, Py_None); if (unlikely(!__pyx_tuple__7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 269; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_tuple__7); __Pyx_GIVEREF(__pyx_tuple__7); /* "pygame_sdl2/mixer.pyx":300 * * def get_sound(self): * with _lock: # <<<<<<<<<<<<<< * return current_sounds.get(self.cid) * */ __pyx_tuple__8 = PyTuple_Pack(3, Py_None, Py_None, Py_None); if (unlikely(!__pyx_tuple__8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 300; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_tuple__8); __Pyx_GIVEREF(__pyx_tuple__8); __pyx_tuple__9 = PyTuple_Pack(3, Py_None, Py_None, Py_None); if (unlikely(!__pyx_tuple__9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 300; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_tuple__9); __Pyx_GIVEREF(__pyx_tuple__9); /* "pygame_sdl2/mixer.pyx":305 * def queue(self, Sound sound): * if self.get_busy(): * with _lock: # <<<<<<<<<<<<<< * channel_queued[self.cid] = sound * else: */ __pyx_tuple__10 = PyTuple_Pack(3, Py_None, Py_None, Py_None); if (unlikely(!__pyx_tuple__10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 305; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_tuple__10); __Pyx_GIVEREF(__pyx_tuple__10); /* "pygame_sdl2/mixer.pyx":311 * * def get_queue(self): * with _lock: # <<<<<<<<<<<<<< * return channel_queued.get(self.cid) * */ __pyx_tuple__11 = PyTuple_Pack(3, Py_None, Py_None, Py_None); if (unlikely(!__pyx_tuple__11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 311; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_tuple__11); __Pyx_GIVEREF(__pyx_tuple__11); __pyx_tuple__12 = PyTuple_Pack(3, Py_None, Py_None, Py_None); if (unlikely(!__pyx_tuple__12)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 311; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_tuple__12); __Pyx_GIVEREF(__pyx_tuple__12); /* "pygame_sdl2/mixer.pyx":41 * _lock = threading.Lock() * * def _play_current(int channel): # <<<<<<<<<<<<<< * """ * Caled by channel_callback to play the next sound. This has to be called */ __pyx_tuple__14 = PyTuple_Pack(3, __pyx_n_s_channel, __pyx_n_s_channel, __pyx_n_s_next_sound); if (unlikely(!__pyx_tuple__14)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 41; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_tuple__14); __Pyx_GIVEREF(__pyx_tuple__14); __pyx_codeobj__15 = (PyObject*)__Pyx_PyCode_New(1, 0, 3, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__14, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_tom_ab_pygame_sdl2_src_py, __pyx_n_s_play_current, 41, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__15)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 41; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "pygame_sdl2/mixer.pyx":80 * * @pygame_sdl2.register_init * def init(frequency=22050, size=MIX_DEFAULT_FORMAT, channels=2, buffer=4096): # <<<<<<<<<<<<<< * if get_init() is not None: * return */ __pyx_tuple__16 = PyTuple_Pack(5, __pyx_n_s_frequency, __pyx_n_s_size, __pyx_n_s_channels, __pyx_n_s_buffer, __pyx_n_s_flag); if (unlikely(!__pyx_tuple__16)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 80; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_tuple__16); __Pyx_GIVEREF(__pyx_tuple__16); __pyx_codeobj__17 = (PyObject*)__Pyx_PyCode_New(4, 0, 5, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__16, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_tom_ab_pygame_sdl2_src_py, __pyx_n_s_init, 80, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__17)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 80; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "pygame_sdl2/mixer.pyx":101 * Mix_ChannelFinished(channel_callback) * * def pre_init(frequency=22050, size=MIX_DEFAULT_FORMAT, channels=2, buffersize=4096): # <<<<<<<<<<<<<< * global preinit_args * preinit_args = (frequency, size, channels, buffersize) */ __pyx_tuple__18 = PyTuple_Pack(4, __pyx_n_s_frequency, __pyx_n_s_size, __pyx_n_s_channels, __pyx_n_s_buffersize); if (unlikely(!__pyx_tuple__18)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 101; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_tuple__18); __Pyx_GIVEREF(__pyx_tuple__18); __pyx_codeobj__19 = (PyObject*)__Pyx_PyCode_New(4, 0, 4, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__18, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_tom_ab_pygame_sdl2_src_py, __pyx_n_s_pre_init, 101, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__19)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 101; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "pygame_sdl2/mixer.pyx":106 * * @pygame_sdl2.register_quit * def quit(): # @ReservedAssignment # <<<<<<<<<<<<<< * Mix_CloseAudio() * Mix_Quit() */ __pyx_codeobj__20 = (PyObject*)__Pyx_PyCode_New(0, 0, 0, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_tom_ab_pygame_sdl2_src_py, __pyx_n_s_quit, 106, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__20)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 106; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "pygame_sdl2/mixer.pyx":110 * Mix_Quit() * * def get_init(): # <<<<<<<<<<<<<< * cdef int frequency * cdef Uint16 format */ __pyx_tuple__21 = PyTuple_Pack(3, __pyx_n_s_frequency, __pyx_n_s_format, __pyx_n_s_channels); if (unlikely(!__pyx_tuple__21)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 110; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_tuple__21); __Pyx_GIVEREF(__pyx_tuple__21); __pyx_codeobj__22 = (PyObject*)__Pyx_PyCode_New(0, 0, 3, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__21, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_tom_ab_pygame_sdl2_src_py, __pyx_n_s_get_init, 110, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__22)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 110; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "pygame_sdl2/mixer.pyx":120 * return frequency, format, channels * * def stop(): # <<<<<<<<<<<<<< * with nogil: * Mix_HaltChannel(-1) */ __pyx_codeobj__23 = (PyObject*)__Pyx_PyCode_New(0, 0, 0, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_tom_ab_pygame_sdl2_src_py, __pyx_n_s_stop, 120, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__23)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 120; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "pygame_sdl2/mixer.pyx":124 * Mix_HaltChannel(-1) * * def pause(): # <<<<<<<<<<<<<< * with nogil: * Mix_Pause(-1) */ __pyx_codeobj__24 = (PyObject*)__Pyx_PyCode_New(0, 0, 0, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_tom_ab_pygame_sdl2_src_py, __pyx_n_s_pause, 124, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__24)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 124; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "pygame_sdl2/mixer.pyx":128 * Mix_Pause(-1) * * def unpause(): # <<<<<<<<<<<<<< * with nogil: * Mix_Resume(-1) */ __pyx_codeobj__25 = (PyObject*)__Pyx_PyCode_New(0, 0, 0, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_tom_ab_pygame_sdl2_src_py, __pyx_n_s_unpause, 128, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__25)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 128; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "pygame_sdl2/mixer.pyx":132 * Mix_Resume(-1) * * def fadeout(time): # <<<<<<<<<<<<<< * cdef int ms = time * with nogil: */ __pyx_tuple__26 = PyTuple_Pack(2, __pyx_n_s_time, __pyx_n_s_ms); if (unlikely(!__pyx_tuple__26)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 132; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_tuple__26); __Pyx_GIVEREF(__pyx_tuple__26); __pyx_codeobj__27 = (PyObject*)__Pyx_PyCode_New(1, 0, 2, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__26, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_tom_ab_pygame_sdl2_src_py, __pyx_n_s_fadeout, 132, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__27)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 132; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "pygame_sdl2/mixer.pyx":137 * Mix_FadeOutChannel(-1, ms) * * def set_num_channels(count): # <<<<<<<<<<<<<< * Mix_AllocateChannels(count) * */ __pyx_tuple__28 = PyTuple_Pack(1, __pyx_n_s_count); if (unlikely(!__pyx_tuple__28)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 137; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_tuple__28); __Pyx_GIVEREF(__pyx_tuple__28); __pyx_codeobj__29 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__28, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_tom_ab_pygame_sdl2_src_py, __pyx_n_s_set_num_channels, 137, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__29)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 137; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "pygame_sdl2/mixer.pyx":140 * Mix_AllocateChannels(count) * * def get_num_channels(): # <<<<<<<<<<<<<< * return Mix_AllocateChannels(-1) * */ __pyx_codeobj__30 = (PyObject*)__Pyx_PyCode_New(0, 0, 0, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_tom_ab_pygame_sdl2_src_py, __pyx_n_s_get_num_channels, 140, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__30)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 140; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "pygame_sdl2/mixer.pyx":143 * return Mix_AllocateChannels(-1) * * def set_reserved(count): # <<<<<<<<<<<<<< * Mix_ReserveChannels(count) * */ __pyx_tuple__31 = PyTuple_Pack(1, __pyx_n_s_count); if (unlikely(!__pyx_tuple__31)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 143; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_tuple__31); __Pyx_GIVEREF(__pyx_tuple__31); __pyx_codeobj__32 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__31, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_tom_ab_pygame_sdl2_src_py, __pyx_n_s_set_reserved, 143, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__32)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 143; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "pygame_sdl2/mixer.pyx":146 * Mix_ReserveChannels(count) * * def find_channel(force=False): # <<<<<<<<<<<<<< * cdef int chan * chan = Mix_GroupAvailable(-1) */ __pyx_tuple__33 = PyTuple_Pack(2, __pyx_n_s_force, __pyx_n_s_chan); if (unlikely(!__pyx_tuple__33)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 146; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_tuple__33); __Pyx_GIVEREF(__pyx_tuple__33); __pyx_codeobj__34 = (PyObject*)__Pyx_PyCode_New(1, 0, 2, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__33, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_tom_ab_pygame_sdl2_src_py, __pyx_n_s_find_channel, 146, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__34)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 146; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "pygame_sdl2/mixer.pyx":157 * return Channel(chan) * * def get_busy(): # <<<<<<<<<<<<<< * return Mix_GroupNewer(-1) != -1 * */ __pyx_codeobj__35 = (PyObject*)__Pyx_PyCode_New(0, 0, 0, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_tom_ab_pygame_sdl2_src_py, __pyx_n_s_get_busy, 157, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__35)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 157; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_RefNannyFinishContext(); return 0; __pyx_L1_error:; __Pyx_RefNannyFinishContext(); return -1; } static int __Pyx_InitGlobals(void) { if (__Pyx_InitStrings(__pyx_string_tab) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; __pyx_int_0 = PyInt_FromLong(0); if (unlikely(!__pyx_int_0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_int_2 = PyInt_FromLong(2); if (unlikely(!__pyx_int_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_int_4096 = PyInt_FromLong(4096); if (unlikely(!__pyx_int_4096)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_int_22050 = PyInt_FromLong(22050L); if (unlikely(!__pyx_int_22050)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_int_neg_1 = PyInt_FromLong(-1); if (unlikely(!__pyx_int_neg_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} return 0; __pyx_L1_error:; return -1; } #if PY_MAJOR_VERSION < 3 PyMODINIT_FUNC initmixer(void); /*proto*/ PyMODINIT_FUNC initmixer(void) #else PyMODINIT_FUNC PyInit_mixer(void); /*proto*/ PyMODINIT_FUNC PyInit_mixer(void) #endif { PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; PyObject *__pyx_t_5 = NULL; PyObject *__pyx_t_6 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannyDeclarations #if CYTHON_REFNANNY __Pyx_RefNanny = __Pyx_RefNannyImportAPI("refnanny"); if (!__Pyx_RefNanny) { PyErr_Clear(); __Pyx_RefNanny = __Pyx_RefNannyImportAPI("Cython.Runtime.refnanny"); if (!__Pyx_RefNanny) Py_FatalError("failed to import 'refnanny' module"); } #endif __Pyx_RefNannySetupContext("PyMODINIT_FUNC PyInit_mixer(void)", 0); if ( __Pyx_check_binary_version() < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_empty_tuple = PyTuple_New(0); if (unlikely(!__pyx_empty_tuple)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_empty_bytes = PyBytes_FromStringAndSize("", 0); if (unlikely(!__pyx_empty_bytes)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} #ifdef __Pyx_CyFunction_USED if (__Pyx_CyFunction_init() < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} #endif #ifdef __Pyx_FusedFunction_USED if (__pyx_FusedFunction_init() < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} #endif #ifdef __Pyx_Generator_USED if (__pyx_Generator_init() < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} #endif /*--- Library function declarations ---*/ /*--- Threads initialization code ---*/ #if defined(__PYX_FORCE_INIT_THREADS) && __PYX_FORCE_INIT_THREADS #ifdef WITH_THREAD /* Python build with threading support? */ PyEval_InitThreads(); #endif #endif /*--- Module creation code ---*/ #if PY_MAJOR_VERSION < 3 __pyx_m = Py_InitModule4("mixer", __pyx_methods, 0, 0, PYTHON_API_VERSION); Py_XINCREF(__pyx_m); #else __pyx_m = PyModule_Create(&__pyx_moduledef); #endif if (unlikely(!__pyx_m)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_d = PyModule_GetDict(__pyx_m); if (unlikely(!__pyx_d)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} Py_INCREF(__pyx_d); __pyx_b = PyImport_AddModule(__Pyx_BUILTIN_MODULE_NAME); if (unlikely(!__pyx_b)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} #if CYTHON_COMPILING_IN_PYPY Py_INCREF(__pyx_b); #endif if (PyObject_SetAttrString(__pyx_m, "__builtins__", __pyx_b) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; /*--- Initialize various global constants etc. ---*/ if (unlikely(__Pyx_InitGlobals() < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} #if PY_MAJOR_VERSION < 3 && (__PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT) if (__Pyx_init_sys_getdefaultencoding_params() < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} #endif if (__pyx_module_is_main_pygame_sdl2__mixer) { if (PyObject_SetAttrString(__pyx_m, "__name__", __pyx_n_s_main) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; } #if PY_MAJOR_VERSION >= 3 { PyObject *modules = PyImport_GetModuleDict(); if (unlikely(!modules)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} if (!PyDict_GetItemString(modules, "pygame_sdl2.mixer")) { if (unlikely(PyDict_SetItemString(modules, "pygame_sdl2.mixer", __pyx_m) < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } } #endif /*--- Builtin init code ---*/ if (unlikely(__Pyx_InitCachedBuiltins() < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /*--- Constants init code ---*/ if (unlikely(__Pyx_InitCachedConstants() < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /*--- Global init code ---*/ __pyx_v_11pygame_sdl2_5mixer_preinit_args = Py_None; Py_INCREF(Py_None); __pyx_v_11pygame_sdl2_5mixer_output_spec = Py_None; Py_INCREF(Py_None); __pyx_v_11pygame_sdl2_5mixer_channel_events = ((PyObject*)Py_None); Py_INCREF(Py_None); __pyx_v_11pygame_sdl2_5mixer_channel_queued = ((PyObject*)Py_None); Py_INCREF(Py_None); __pyx_v_11pygame_sdl2_5mixer_current_sounds = ((PyObject*)Py_None); Py_INCREF(Py_None); /*--- Variable export code ---*/ /*--- Function export code ---*/ /*--- Type init code ---*/ if (PyType_Ready(&__pyx_type_11pygame_sdl2_5mixer_Sound) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 161; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_type_11pygame_sdl2_5mixer_Sound.tp_print = 0; if (PyObject_SetAttrString(__pyx_m, "Sound", (PyObject *)&__pyx_type_11pygame_sdl2_5mixer_Sound) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 161; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_ptype_11pygame_sdl2_5mixer_Sound = &__pyx_type_11pygame_sdl2_5mixer_Sound; if (PyType_Ready(&__pyx_type_11pygame_sdl2_5mixer_Channel) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 249; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_type_11pygame_sdl2_5mixer_Channel.tp_print = 0; if (PyObject_SetAttrString(__pyx_m, "Channel", (PyObject *)&__pyx_type_11pygame_sdl2_5mixer_Channel) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 249; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_ptype_11pygame_sdl2_5mixer_Channel = &__pyx_type_11pygame_sdl2_5mixer_Channel; /*--- Type import code ---*/ /*--- Variable import code ---*/ /*--- Function import code ---*/ __pyx_t_1 = __Pyx_ImportModule("pygame_sdl2.rwobject"); if (!__pyx_t_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} if (__Pyx_ImportFunction(__pyx_t_1, "to_rwops", (void (**)(void))&__pyx_f_11pygame_sdl2_8rwobject_to_rwops, "SDL_RWops *(PyObject *, struct __pyx_opt_args_11pygame_sdl2_8rwobject_to_rwops *__pyx_optional_args)") < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} Py_DECREF(__pyx_t_1); __pyx_t_1 = 0; /*--- Execution code ---*/ /* "pygame_sdl2/mixer.pyx":24 * from libc.string cimport memset * * import sys # <<<<<<<<<<<<<< * import threading * from pygame_sdl2.error import error */ __pyx_t_2 = __Pyx_Import(__pyx_n_s_sys, 0, -1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 24; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_sys, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 24; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "pygame_sdl2/mixer.pyx":25 * * import sys * import threading # <<<<<<<<<<<<<< * from pygame_sdl2.error import error * */ __pyx_t_2 = __Pyx_Import(__pyx_n_s_threading, 0, -1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 25; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_threading, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 25; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "pygame_sdl2/mixer.pyx":26 * import sys * import threading * from pygame_sdl2.error import error # <<<<<<<<<<<<<< * * import pygame_sdl2.mixer_music as music */ __pyx_t_2 = PyList_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 26; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __Pyx_INCREF(__pyx_n_s_error); PyList_SET_ITEM(__pyx_t_2, 0, __pyx_n_s_error); __Pyx_GIVEREF(__pyx_n_s_error); __pyx_t_3 = __Pyx_Import(__pyx_n_s_pygame_sdl2_error, __pyx_t_2, -1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 26; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_2 = __Pyx_ImportFrom(__pyx_t_3, __pyx_n_s_error); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 26; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_error, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 26; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "pygame_sdl2/mixer.pyx":28 * from pygame_sdl2.error import error * * import pygame_sdl2.mixer_music as music # <<<<<<<<<<<<<< * import pygame_sdl2 * */ __pyx_t_3 = PyList_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 28; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __Pyx_INCREF(__pyx_n_s__13); PyList_SET_ITEM(__pyx_t_3, 0, __pyx_n_s__13); __Pyx_GIVEREF(__pyx_n_s__13); __pyx_t_2 = __Pyx_Import(__pyx_n_s_pygame_sdl2_mixer_music, __pyx_t_3, -1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 28; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; if (PyDict_SetItem(__pyx_d, __pyx_n_s_music, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 28; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "pygame_sdl2/mixer.pyx":29 * * import pygame_sdl2.mixer_music as music * import pygame_sdl2 # <<<<<<<<<<<<<< * * cdef object preinit_args = None */ __pyx_t_2 = __Pyx_Import(__pyx_n_s_pygame_sdl2, 0, -1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 29; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_pygame_sdl2, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 29; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "pygame_sdl2/mixer.pyx":31 * import pygame_sdl2 * * cdef object preinit_args = None # <<<<<<<<<<<<<< * cdef object output_spec = None * */ __Pyx_INCREF(Py_None); __Pyx_XGOTREF(__pyx_v_11pygame_sdl2_5mixer_preinit_args); __Pyx_DECREF_SET(__pyx_v_11pygame_sdl2_5mixer_preinit_args, Py_None); __Pyx_GIVEREF(Py_None); /* "pygame_sdl2/mixer.pyx":32 * * cdef object preinit_args = None * cdef object output_spec = None # <<<<<<<<<<<<<< * * cdef dict channel_events = {} */ __Pyx_INCREF(Py_None); __Pyx_XGOTREF(__pyx_v_11pygame_sdl2_5mixer_output_spec); __Pyx_DECREF_SET(__pyx_v_11pygame_sdl2_5mixer_output_spec, Py_None); __Pyx_GIVEREF(Py_None); /* "pygame_sdl2/mixer.pyx":34 * cdef object output_spec = None * * cdef dict channel_events = {} # <<<<<<<<<<<<<< * cdef dict channel_queued = {} * cdef dict current_sounds = {} */ __pyx_t_2 = PyDict_New(); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 34; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __Pyx_XGOTREF(__pyx_v_11pygame_sdl2_5mixer_channel_events); __Pyx_DECREF_SET(__pyx_v_11pygame_sdl2_5mixer_channel_events, ((PyObject*)__pyx_t_2)); __Pyx_GIVEREF(__pyx_t_2); __pyx_t_2 = 0; /* "pygame_sdl2/mixer.pyx":35 * * cdef dict channel_events = {} * cdef dict channel_queued = {} # <<<<<<<<<<<<<< * cdef dict current_sounds = {} * */ __pyx_t_2 = PyDict_New(); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 35; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __Pyx_XGOTREF(__pyx_v_11pygame_sdl2_5mixer_channel_queued); __Pyx_DECREF_SET(__pyx_v_11pygame_sdl2_5mixer_channel_queued, ((PyObject*)__pyx_t_2)); __Pyx_GIVEREF(__pyx_t_2); __pyx_t_2 = 0; /* "pygame_sdl2/mixer.pyx":36 * cdef dict channel_events = {} * cdef dict channel_queued = {} * cdef dict current_sounds = {} # <<<<<<<<<<<<<< * * # The lock protects channel_queued and current_sounds. */ __pyx_t_2 = PyDict_New(); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 36; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __Pyx_XGOTREF(__pyx_v_11pygame_sdl2_5mixer_current_sounds); __Pyx_DECREF_SET(__pyx_v_11pygame_sdl2_5mixer_current_sounds, ((PyObject*)__pyx_t_2)); __Pyx_GIVEREF(__pyx_t_2); __pyx_t_2 = 0; /* "pygame_sdl2/mixer.pyx":39 * * # The lock protects channel_queued and current_sounds. * _lock = threading.Lock() # <<<<<<<<<<<<<< * * def _play_current(int channel): */ __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_threading); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 39; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_Lock); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 39; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_3 = NULL; if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_4))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_4); if (likely(__pyx_t_3)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_4, function); } } if (__pyx_t_3) { __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_3); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 39; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } else { __pyx_t_2 = __Pyx_PyObject_CallNoArg(__pyx_t_4); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 39; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; if (PyDict_SetItem(__pyx_d, __pyx_n_s_lock, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 39; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "pygame_sdl2/mixer.pyx":41 * _lock = threading.Lock() * * def _play_current(int channel): # <<<<<<<<<<<<<< * """ * Caled by channel_callback to play the next sound. This has to be called */ __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_11pygame_sdl2_5mixer_1_play_current, NULL, __pyx_n_s_pygame_sdl2_mixer); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 41; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_play_current, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 41; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "pygame_sdl2/mixer.pyx":77 * * # A list of errors that occured during mixer initialization. * errors = [ ] # <<<<<<<<<<<<<< * * @pygame_sdl2.register_init */ __pyx_t_2 = PyList_New(0); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 77; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_errors, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 77; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "pygame_sdl2/mixer.pyx":80 * * @pygame_sdl2.register_init * def init(frequency=22050, size=MIX_DEFAULT_FORMAT, channels=2, buffer=4096): # <<<<<<<<<<<<<< * if get_init() is not None: * return */ __pyx_t_2 = __Pyx_PyInt_From_int(MIX_DEFAULT_FORMAT); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 80; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __pyx_k__3 = __pyx_t_2; __Pyx_GIVEREF(__pyx_t_2); __pyx_t_2 = 0; /* "pygame_sdl2/mixer.pyx":79 * errors = [ ] * * @pygame_sdl2.register_init # <<<<<<<<<<<<<< * def init(frequency=22050, size=MIX_DEFAULT_FORMAT, channels=2, buffer=4096): * if get_init() is not None: */ __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_pygame_sdl2); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 79; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_register_init); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 79; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; /* "pygame_sdl2/mixer.pyx":80 * * @pygame_sdl2.register_init * def init(frequency=22050, size=MIX_DEFAULT_FORMAT, channels=2, buffer=4096): # <<<<<<<<<<<<<< * if get_init() is not None: * return */ __pyx_t_4 = PyCFunction_NewEx(&__pyx_mdef_11pygame_sdl2_5mixer_3init, NULL, __pyx_n_s_pygame_sdl2_mixer); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 80; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); __pyx_t_5 = NULL; if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_3))) { __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_3); if (likely(__pyx_t_5)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); __Pyx_INCREF(__pyx_t_5); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_3, function); } } if (!__pyx_t_5) { __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 79; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_GOTREF(__pyx_t_2); } else { __pyx_t_6 = PyTuple_New(1+1); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 79; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_6); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_5); __Pyx_GIVEREF(__pyx_t_5); __pyx_t_5 = NULL; PyTuple_SET_ITEM(__pyx_t_6, 0+1, __pyx_t_4); __Pyx_GIVEREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_6, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 79; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; } __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; if (PyDict_SetItem(__pyx_d, __pyx_n_s_init, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 80; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "pygame_sdl2/mixer.pyx":101 * Mix_ChannelFinished(channel_callback) * * def pre_init(frequency=22050, size=MIX_DEFAULT_FORMAT, channels=2, buffersize=4096): # <<<<<<<<<<<<<< * global preinit_args * preinit_args = (frequency, size, channels, buffersize) */ __pyx_t_2 = __Pyx_PyInt_From_int(MIX_DEFAULT_FORMAT); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 101; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __pyx_k__5 = __pyx_t_2; __Pyx_GIVEREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_11pygame_sdl2_5mixer_5pre_init, NULL, __pyx_n_s_pygame_sdl2_mixer); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 101; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_pre_init, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 101; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "pygame_sdl2/mixer.pyx":105 * preinit_args = (frequency, size, channels, buffersize) * * @pygame_sdl2.register_quit # <<<<<<<<<<<<<< * def quit(): # @ReservedAssignment * Mix_CloseAudio() */ __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_pygame_sdl2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 105; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_register_quit); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 105; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "pygame_sdl2/mixer.pyx":106 * * @pygame_sdl2.register_quit * def quit(): # @ReservedAssignment # <<<<<<<<<<<<<< * Mix_CloseAudio() * Mix_Quit() */ __pyx_t_3 = PyCFunction_NewEx(&__pyx_mdef_11pygame_sdl2_5mixer_7quit, NULL, __pyx_n_s_pygame_sdl2_mixer); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 106; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = NULL; if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_6))) { __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_6); if (likely(__pyx_t_4)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6); __Pyx_INCREF(__pyx_t_4); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_6, function); } } if (!__pyx_t_4) { __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_6, __pyx_t_3); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 105; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_GOTREF(__pyx_t_2); } else { __pyx_t_5 = PyTuple_New(1+1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 105; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_4); __Pyx_GIVEREF(__pyx_t_4); __pyx_t_4 = NULL; PyTuple_SET_ITEM(__pyx_t_5, 0+1, __pyx_t_3); __Pyx_GIVEREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_5, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 105; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; } __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; if (PyDict_SetItem(__pyx_d, __pyx_n_s_quit, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 106; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "pygame_sdl2/mixer.pyx":110 * Mix_Quit() * * def get_init(): # <<<<<<<<<<<<<< * cdef int frequency * cdef Uint16 format */ __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_11pygame_sdl2_5mixer_9get_init, NULL, __pyx_n_s_pygame_sdl2_mixer); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 110; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_get_init, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 110; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "pygame_sdl2/mixer.pyx":120 * return frequency, format, channels * * def stop(): # <<<<<<<<<<<<<< * with nogil: * Mix_HaltChannel(-1) */ __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_11pygame_sdl2_5mixer_11stop, NULL, __pyx_n_s_pygame_sdl2_mixer); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 120; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_stop, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 120; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "pygame_sdl2/mixer.pyx":124 * Mix_HaltChannel(-1) * * def pause(): # <<<<<<<<<<<<<< * with nogil: * Mix_Pause(-1) */ __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_11pygame_sdl2_5mixer_13pause, NULL, __pyx_n_s_pygame_sdl2_mixer); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 124; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_pause, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 124; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "pygame_sdl2/mixer.pyx":128 * Mix_Pause(-1) * * def unpause(): # <<<<<<<<<<<<<< * with nogil: * Mix_Resume(-1) */ __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_11pygame_sdl2_5mixer_15unpause, NULL, __pyx_n_s_pygame_sdl2_mixer); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 128; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_unpause, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 128; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "pygame_sdl2/mixer.pyx":132 * Mix_Resume(-1) * * def fadeout(time): # <<<<<<<<<<<<<< * cdef int ms = time * with nogil: */ __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_11pygame_sdl2_5mixer_17fadeout, NULL, __pyx_n_s_pygame_sdl2_mixer); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 132; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_fadeout, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 132; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "pygame_sdl2/mixer.pyx":137 * Mix_FadeOutChannel(-1, ms) * * def set_num_channels(count): # <<<<<<<<<<<<<< * Mix_AllocateChannels(count) * */ __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_11pygame_sdl2_5mixer_19set_num_channels, NULL, __pyx_n_s_pygame_sdl2_mixer); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 137; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_set_num_channels, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 137; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "pygame_sdl2/mixer.pyx":140 * Mix_AllocateChannels(count) * * def get_num_channels(): # <<<<<<<<<<<<<< * return Mix_AllocateChannels(-1) * */ __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_11pygame_sdl2_5mixer_21get_num_channels, NULL, __pyx_n_s_pygame_sdl2_mixer); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 140; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_get_num_channels, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 140; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "pygame_sdl2/mixer.pyx":143 * return Mix_AllocateChannels(-1) * * def set_reserved(count): # <<<<<<<<<<<<<< * Mix_ReserveChannels(count) * */ __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_11pygame_sdl2_5mixer_23set_reserved, NULL, __pyx_n_s_pygame_sdl2_mixer); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 143; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_set_reserved, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 143; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "pygame_sdl2/mixer.pyx":146 * Mix_ReserveChannels(count) * * def find_channel(force=False): # <<<<<<<<<<<<<< * cdef int chan * chan = Mix_GroupAvailable(-1) */ __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_11pygame_sdl2_5mixer_25find_channel, NULL, __pyx_n_s_pygame_sdl2_mixer); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 146; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_find_channel, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 146; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "pygame_sdl2/mixer.pyx":157 * return Channel(chan) * * def get_busy(): # <<<<<<<<<<<<<< * return Mix_GroupNewer(-1) != -1 * */ __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_11pygame_sdl2_5mixer_27get_busy, NULL, __pyx_n_s_pygame_sdl2_mixer); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 157; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_get_busy, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 157; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "pygame_sdl2/mixer.pyx":1 * # Copyright 2014 Patrick Dawson # <<<<<<<<<<<<<< * # * # This software is provided 'as-is', without any express or implied */ __pyx_t_2 = PyDict_New(); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_test, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /*--- Wrapped vars code ---*/ goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_5); __Pyx_XDECREF(__pyx_t_6); if (__pyx_m) { if (__pyx_d) { __Pyx_AddTraceback("init pygame_sdl2.mixer", __pyx_clineno, __pyx_lineno, __pyx_filename); } Py_DECREF(__pyx_m); __pyx_m = 0; } else if (!PyErr_Occurred()) { PyErr_SetString(PyExc_ImportError, "init pygame_sdl2.mixer"); } __pyx_L0:; __Pyx_RefNannyFinishContext(); #if PY_MAJOR_VERSION < 3 return; #else return __pyx_m; #endif } /* Runtime support code */ #if CYTHON_REFNANNY static __Pyx_RefNannyAPIStruct *__Pyx_RefNannyImportAPI(const char *modname) { PyObject *m = NULL, *p = NULL; void *r = NULL; m = PyImport_ImportModule((char *)modname); if (!m) goto end; p = PyObject_GetAttrString(m, (char *)"RefNannyAPI"); if (!p) goto end; r = PyLong_AsVoidPtr(p); end: Py_XDECREF(p); Py_XDECREF(m); return (__Pyx_RefNannyAPIStruct *)r; } #endif static PyObject *__Pyx_GetBuiltinName(PyObject *name) { PyObject* result = __Pyx_PyObject_GetAttrStr(__pyx_b, name); if (unlikely(!result)) { PyErr_Format(PyExc_NameError, #if PY_MAJOR_VERSION >= 3 "name '%U' is not defined", name); #else "name '%.200s' is not defined", PyString_AS_STRING(name)); #endif } return result; } static CYTHON_INLINE PyObject *__Pyx_GetModuleGlobalName(PyObject *name) { PyObject *result; #if CYTHON_COMPILING_IN_CPYTHON result = PyDict_GetItem(__pyx_d, name); if (likely(result)) { Py_INCREF(result); } else { #else result = PyObject_GetItem(__pyx_d, name); if (!result) { PyErr_Clear(); #endif result = __Pyx_GetBuiltinName(name); } return result; } #if CYTHON_COMPILING_IN_CPYTHON static CYTHON_INLINE PyObject* __Pyx_PyObject_Call(PyObject *func, PyObject *arg, PyObject *kw) { PyObject *result; ternaryfunc call = func->ob_type->tp_call; if (unlikely(!call)) return PyObject_Call(func, arg, kw); if (unlikely(Py_EnterRecursiveCall((char*)" while calling a Python object"))) return NULL; result = (*call)(func, arg, kw); Py_LeaveRecursiveCall(); if (unlikely(!result) && unlikely(!PyErr_Occurred())) { PyErr_SetString( PyExc_SystemError, "NULL result without error in PyObject_Call"); } return result; } #endif #if CYTHON_COMPILING_IN_CPYTHON static CYTHON_INLINE PyObject* __Pyx_PyObject_CallMethO(PyObject *func, PyObject *arg) { PyObject *self, *result; PyCFunction cfunc; cfunc = PyCFunction_GET_FUNCTION(func); self = PyCFunction_GET_SELF(func); if (unlikely(Py_EnterRecursiveCall((char*)" while calling a Python object"))) return NULL; result = cfunc(self, arg); Py_LeaveRecursiveCall(); if (unlikely(!result) && unlikely(!PyErr_Occurred())) { PyErr_SetString( PyExc_SystemError, "NULL result without error in PyObject_Call"); } return result; } #endif #if CYTHON_COMPILING_IN_CPYTHON static PyObject* __Pyx__PyObject_CallOneArg(PyObject *func, PyObject *arg) { PyObject *result; PyObject *args = PyTuple_New(1); if (unlikely(!args)) return NULL; Py_INCREF(arg); PyTuple_SET_ITEM(args, 0, arg); result = __Pyx_PyObject_Call(func, args, NULL); Py_DECREF(args); return result; } static CYTHON_INLINE PyObject* __Pyx_PyObject_CallOneArg(PyObject *func, PyObject *arg) { #ifdef __Pyx_CyFunction_USED if (likely(PyCFunction_Check(func) || PyObject_TypeCheck(func, __pyx_CyFunctionType))) { #else if (likely(PyCFunction_Check(func))) { #endif if (likely(PyCFunction_GET_FLAGS(func) & METH_O)) { return __Pyx_PyObject_CallMethO(func, arg); } } return __Pyx__PyObject_CallOneArg(func, arg); } #else static CYTHON_INLINE PyObject* __Pyx_PyObject_CallOneArg(PyObject *func, PyObject *arg) { PyObject* args = PyTuple_Pack(1, arg); return (likely(args)) ? __Pyx_PyObject_Call(func, args, NULL) : NULL; } #endif #if CYTHON_COMPILING_IN_CPYTHON static CYTHON_INLINE PyObject* __Pyx_PyObject_CallNoArg(PyObject *func) { #ifdef __Pyx_CyFunction_USED if (likely(PyCFunction_Check(func) || PyObject_TypeCheck(func, __pyx_CyFunctionType))) { #else if (likely(PyCFunction_Check(func))) { #endif if (likely(PyCFunction_GET_FLAGS(func) & METH_NOARGS)) { return __Pyx_PyObject_CallMethO(func, NULL); } } return __Pyx_PyObject_Call(func, __pyx_empty_tuple, NULL); } #endif static CYTHON_INLINE int __Pyx_TypeTest(PyObject *obj, PyTypeObject *type) { if (unlikely(!type)) { PyErr_SetString(PyExc_SystemError, "Missing type object"); return 0; } if (likely(PyObject_TypeCheck(obj, type))) return 1; PyErr_Format(PyExc_TypeError, "Cannot convert %.200s to %.200s", Py_TYPE(obj)->tp_name, type->tp_name); return 0; } static CYTHON_INLINE void __Pyx_ExceptionSave(PyObject **type, PyObject **value, PyObject **tb) { #if CYTHON_COMPILING_IN_CPYTHON PyThreadState *tstate = PyThreadState_GET(); *type = tstate->exc_type; *value = tstate->exc_value; *tb = tstate->exc_traceback; Py_XINCREF(*type); Py_XINCREF(*value); Py_XINCREF(*tb); #else PyErr_GetExcInfo(type, value, tb); #endif } static void __Pyx_ExceptionReset(PyObject *type, PyObject *value, PyObject *tb) { #if CYTHON_COMPILING_IN_CPYTHON PyObject *tmp_type, *tmp_value, *tmp_tb; PyThreadState *tstate = PyThreadState_GET(); tmp_type = tstate->exc_type; tmp_value = tstate->exc_value; tmp_tb = tstate->exc_traceback; tstate->exc_type = type; tstate->exc_value = value; tstate->exc_traceback = tb; Py_XDECREF(tmp_type); Py_XDECREF(tmp_value); Py_XDECREF(tmp_tb); #else PyErr_SetExcInfo(type, value, tb); #endif } static int __Pyx_GetException(PyObject **type, PyObject **value, PyObject **tb) { PyObject *local_type, *local_value, *local_tb; #if CYTHON_COMPILING_IN_CPYTHON PyObject *tmp_type, *tmp_value, *tmp_tb; PyThreadState *tstate = PyThreadState_GET(); local_type = tstate->curexc_type; local_value = tstate->curexc_value; local_tb = tstate->curexc_traceback; tstate->curexc_type = 0; tstate->curexc_value = 0; tstate->curexc_traceback = 0; #else PyErr_Fetch(&local_type, &local_value, &local_tb); #endif PyErr_NormalizeException(&local_type, &local_value, &local_tb); #if CYTHON_COMPILING_IN_CPYTHON if (unlikely(tstate->curexc_type)) #else if (unlikely(PyErr_Occurred())) #endif goto bad; #if PY_MAJOR_VERSION >= 3 if (local_tb) { if (unlikely(PyException_SetTraceback(local_value, local_tb) < 0)) goto bad; } #endif Py_XINCREF(local_tb); Py_XINCREF(local_type); Py_XINCREF(local_value); *type = local_type; *value = local_value; *tb = local_tb; #if CYTHON_COMPILING_IN_CPYTHON tmp_type = tstate->exc_type; tmp_value = tstate->exc_value; tmp_tb = tstate->exc_traceback; tstate->exc_type = local_type; tstate->exc_value = local_value; tstate->exc_traceback = local_tb; Py_XDECREF(tmp_type); Py_XDECREF(tmp_value); Py_XDECREF(tmp_tb); #else PyErr_SetExcInfo(local_type, local_value, local_tb); #endif return 0; bad: *type = 0; *value = 0; *tb = 0; Py_XDECREF(local_type); Py_XDECREF(local_value); Py_XDECREF(local_tb); return -1; } static CYTHON_INLINE void __Pyx_ErrRestore(PyObject *type, PyObject *value, PyObject *tb) { #if CYTHON_COMPILING_IN_CPYTHON PyObject *tmp_type, *tmp_value, *tmp_tb; PyThreadState *tstate = PyThreadState_GET(); tmp_type = tstate->curexc_type; tmp_value = tstate->curexc_value; tmp_tb = tstate->curexc_traceback; tstate->curexc_type = type; tstate->curexc_value = value; tstate->curexc_traceback = tb; Py_XDECREF(tmp_type); Py_XDECREF(tmp_value); Py_XDECREF(tmp_tb); #else PyErr_Restore(type, value, tb); #endif } static CYTHON_INLINE void __Pyx_ErrFetch(PyObject **type, PyObject **value, PyObject **tb) { #if CYTHON_COMPILING_IN_CPYTHON PyThreadState *tstate = PyThreadState_GET(); *type = tstate->curexc_type; *value = tstate->curexc_value; *tb = tstate->curexc_traceback; tstate->curexc_type = 0; tstate->curexc_value = 0; tstate->curexc_traceback = 0; #else PyErr_Fetch(type, value, tb); #endif } static CYTHON_INLINE void __Pyx_RaiseUnboundLocalError(const char *varname) { PyErr_Format(PyExc_UnboundLocalError, "local variable '%s' referenced before assignment", varname); } static PyObject* __Pyx_PyDict_GetItemDefault(PyObject* d, PyObject* key, PyObject* default_value) { PyObject* value; #if PY_MAJOR_VERSION >= 3 value = PyDict_GetItemWithError(d, key); if (unlikely(!value)) { if (unlikely(PyErr_Occurred())) return NULL; value = default_value; } Py_INCREF(value); #else if (PyString_CheckExact(key) || PyUnicode_CheckExact(key) || PyInt_CheckExact(key)) { value = PyDict_GetItem(d, key); if (unlikely(!value)) { value = default_value; } Py_INCREF(value); } else { if (default_value == Py_None) default_value = NULL; value = PyObject_CallMethodObjArgs( d, __pyx_n_s_get, key, default_value, NULL); } #endif return value; } static void __Pyx_WriteUnraisable(const char *name, CYTHON_UNUSED int clineno, CYTHON_UNUSED int lineno, CYTHON_UNUSED const char *filename, int full_traceback) { PyObject *old_exc, *old_val, *old_tb; PyObject *ctx; __Pyx_ErrFetch(&old_exc, &old_val, &old_tb); if (full_traceback) { Py_XINCREF(old_exc); Py_XINCREF(old_val); Py_XINCREF(old_tb); __Pyx_ErrRestore(old_exc, old_val, old_tb); PyErr_PrintEx(1); } #if PY_MAJOR_VERSION < 3 ctx = PyString_FromString(name); #else ctx = PyUnicode_FromString(name); #endif __Pyx_ErrRestore(old_exc, old_val, old_tb); if (!ctx) { PyErr_WriteUnraisable(Py_None); } else { PyErr_WriteUnraisable(ctx); Py_DECREF(ctx); } } static void __Pyx_RaiseDoubleKeywordsError( const char* func_name, PyObject* kw_name) { PyErr_Format(PyExc_TypeError, #if PY_MAJOR_VERSION >= 3 "%s() got multiple values for keyword argument '%U'", func_name, kw_name); #else "%s() got multiple values for keyword argument '%s'", func_name, PyString_AsString(kw_name)); #endif } static int __Pyx_ParseOptionalKeywords( PyObject *kwds, PyObject **argnames[], PyObject *kwds2, PyObject *values[], Py_ssize_t num_pos_args, const char* function_name) { PyObject *key = 0, *value = 0; Py_ssize_t pos = 0; PyObject*** name; PyObject*** first_kw_arg = argnames + num_pos_args; while (PyDict_Next(kwds, &pos, &key, &value)) { name = first_kw_arg; while (*name && (**name != key)) name++; if (*name) { values[name-argnames] = value; continue; } name = first_kw_arg; #if PY_MAJOR_VERSION < 3 if (likely(PyString_CheckExact(key)) || likely(PyString_Check(key))) { while (*name) { if ((CYTHON_COMPILING_IN_PYPY || PyString_GET_SIZE(**name) == PyString_GET_SIZE(key)) && _PyString_Eq(**name, key)) { values[name-argnames] = value; break; } name++; } if (*name) continue; else { PyObject*** argname = argnames; while (argname != first_kw_arg) { if ((**argname == key) || ( (CYTHON_COMPILING_IN_PYPY || PyString_GET_SIZE(**argname) == PyString_GET_SIZE(key)) && _PyString_Eq(**argname, key))) { goto arg_passed_twice; } argname++; } } } else #endif if (likely(PyUnicode_Check(key))) { while (*name) { int cmp = (**name == key) ? 0 : #if !CYTHON_COMPILING_IN_PYPY && PY_MAJOR_VERSION >= 3 (PyUnicode_GET_SIZE(**name) != PyUnicode_GET_SIZE(key)) ? 1 : #endif PyUnicode_Compare(**name, key); if (cmp < 0 && unlikely(PyErr_Occurred())) goto bad; if (cmp == 0) { values[name-argnames] = value; break; } name++; } if (*name) continue; else { PyObject*** argname = argnames; while (argname != first_kw_arg) { int cmp = (**argname == key) ? 0 : #if !CYTHON_COMPILING_IN_PYPY && PY_MAJOR_VERSION >= 3 (PyUnicode_GET_SIZE(**argname) != PyUnicode_GET_SIZE(key)) ? 1 : #endif PyUnicode_Compare(**argname, key); if (cmp < 0 && unlikely(PyErr_Occurred())) goto bad; if (cmp == 0) goto arg_passed_twice; argname++; } } } else goto invalid_keyword_type; if (kwds2) { if (unlikely(PyDict_SetItem(kwds2, key, value))) goto bad; } else { goto invalid_keyword; } } return 0; arg_passed_twice: __Pyx_RaiseDoubleKeywordsError(function_name, key); goto bad; invalid_keyword_type: PyErr_Format(PyExc_TypeError, "%.200s() keywords must be strings", function_name); goto bad; invalid_keyword: PyErr_Format(PyExc_TypeError, #if PY_MAJOR_VERSION < 3 "%.200s() got an unexpected keyword argument '%.200s'", function_name, PyString_AsString(key)); #else "%s() got an unexpected keyword argument '%U'", function_name, key); #endif bad: return -1; } static void __Pyx_RaiseArgtupleInvalid( const char* func_name, int exact, Py_ssize_t num_min, Py_ssize_t num_max, Py_ssize_t num_found) { Py_ssize_t num_expected; const char *more_or_less; if (num_found < num_min) { num_expected = num_min; more_or_less = "at least"; } else { num_expected = num_max; more_or_less = "at most"; } if (exact) { more_or_less = "exactly"; } PyErr_Format(PyExc_TypeError, "%.200s() takes %.8s %" CYTHON_FORMAT_SSIZE_T "d positional argument%.1s (%" CYTHON_FORMAT_SSIZE_T "d given)", func_name, more_or_less, num_expected, (num_expected == 1) ? "" : "s", num_found); } static PyObject* __Pyx_PyObject_CallMethod1(PyObject* obj, PyObject* method_name, PyObject* arg) { PyObject *method, *result = NULL; method = __Pyx_PyObject_GetAttrStr(obj, method_name); if (unlikely(!method)) goto bad; #if CYTHON_COMPILING_IN_CPYTHON if (likely(PyMethod_Check(method))) { PyObject *self = PyMethod_GET_SELF(method); if (likely(self)) { PyObject *args; PyObject *function = PyMethod_GET_FUNCTION(method); args = PyTuple_New(2); if (unlikely(!args)) goto bad; Py_INCREF(self); PyTuple_SET_ITEM(args, 0, self); Py_INCREF(arg); PyTuple_SET_ITEM(args, 1, arg); Py_INCREF(function); Py_DECREF(method); method = NULL; result = __Pyx_PyObject_Call(function, args, NULL); Py_DECREF(args); Py_DECREF(function); return result; } } #endif result = __Pyx_PyObject_CallOneArg(method, arg); bad: Py_XDECREF(method); return result; } static CYTHON_INLINE int __Pyx_PyObject_Append(PyObject* L, PyObject* x) { if (likely(PyList_CheckExact(L))) { if (unlikely(__Pyx_PyList_Append(L, x) < 0)) return -1; } else { PyObject* retval = __Pyx_PyObject_CallMethod1(L, __pyx_n_s_append, x); if (unlikely(!retval)) return -1; Py_DECREF(retval); } return 0; } static CYTHON_INLINE void __Pyx_RaiseTooManyValuesError(Py_ssize_t expected) { PyErr_Format(PyExc_ValueError, "too many values to unpack (expected %" CYTHON_FORMAT_SSIZE_T "d)", expected); } static CYTHON_INLINE void __Pyx_RaiseNeedMoreValuesError(Py_ssize_t index) { PyErr_Format(PyExc_ValueError, "need more than %" CYTHON_FORMAT_SSIZE_T "d value%.1s to unpack", index, (index == 1) ? "" : "s"); } static CYTHON_INLINE int __Pyx_IterFinish(void) { #if CYTHON_COMPILING_IN_CPYTHON PyThreadState *tstate = PyThreadState_GET(); PyObject* exc_type = tstate->curexc_type; if (unlikely(exc_type)) { if (likely(exc_type == PyExc_StopIteration) || PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration)) { PyObject *exc_value, *exc_tb; exc_value = tstate->curexc_value; exc_tb = tstate->curexc_traceback; tstate->curexc_type = 0; tstate->curexc_value = 0; tstate->curexc_traceback = 0; Py_DECREF(exc_type); Py_XDECREF(exc_value); Py_XDECREF(exc_tb); return 0; } else { return -1; } } return 0; #else if (unlikely(PyErr_Occurred())) { if (likely(PyErr_ExceptionMatches(PyExc_StopIteration))) { PyErr_Clear(); return 0; } else { return -1; } } return 0; #endif } static int __Pyx_IternextUnpackEndCheck(PyObject *retval, Py_ssize_t expected) { if (unlikely(retval)) { Py_DECREF(retval); __Pyx_RaiseTooManyValuesError(expected); return -1; } else { return __Pyx_IterFinish(); } return 0; } #if PY_MAJOR_VERSION < 3 static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, CYTHON_UNUSED PyObject *cause) { Py_XINCREF(type); if (!value || value == Py_None) value = NULL; else Py_INCREF(value); if (!tb || tb == Py_None) tb = NULL; else { Py_INCREF(tb); if (!PyTraceBack_Check(tb)) { PyErr_SetString(PyExc_TypeError, "raise: arg 3 must be a traceback or None"); goto raise_error; } } if (PyType_Check(type)) { #if CYTHON_COMPILING_IN_PYPY if (!value) { Py_INCREF(Py_None); value = Py_None; } #endif PyErr_NormalizeException(&type, &value, &tb); } else { if (value) { PyErr_SetString(PyExc_TypeError, "instance exception may not have a separate value"); goto raise_error; } value = type; type = (PyObject*) Py_TYPE(type); Py_INCREF(type); if (!PyType_IsSubtype((PyTypeObject *)type, (PyTypeObject *)PyExc_BaseException)) { PyErr_SetString(PyExc_TypeError, "raise: exception class must be a subclass of BaseException"); goto raise_error; } } __Pyx_ErrRestore(type, value, tb); return; raise_error: Py_XDECREF(value); Py_XDECREF(type); Py_XDECREF(tb); return; } #else static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, PyObject *cause) { PyObject* owned_instance = NULL; if (tb == Py_None) { tb = 0; } else if (tb && !PyTraceBack_Check(tb)) { PyErr_SetString(PyExc_TypeError, "raise: arg 3 must be a traceback or None"); goto bad; } if (value == Py_None) value = 0; if (PyExceptionInstance_Check(type)) { if (value) { PyErr_SetString(PyExc_TypeError, "instance exception may not have a separate value"); goto bad; } value = type; type = (PyObject*) Py_TYPE(value); } else if (PyExceptionClass_Check(type)) { PyObject *instance_class = NULL; if (value && PyExceptionInstance_Check(value)) { instance_class = (PyObject*) Py_TYPE(value); if (instance_class != type) { if (PyObject_IsSubclass(instance_class, type)) { type = instance_class; } else { instance_class = NULL; } } } if (!instance_class) { PyObject *args; if (!value) args = PyTuple_New(0); else if (PyTuple_Check(value)) { Py_INCREF(value); args = value; } else args = PyTuple_Pack(1, value); if (!args) goto bad; owned_instance = PyObject_Call(type, args, NULL); Py_DECREF(args); if (!owned_instance) goto bad; value = owned_instance; if (!PyExceptionInstance_Check(value)) { PyErr_Format(PyExc_TypeError, "calling %R should have returned an instance of " "BaseException, not %R", type, Py_TYPE(value)); goto bad; } } } else { PyErr_SetString(PyExc_TypeError, "raise: exception class must be a subclass of BaseException"); goto bad; } #if PY_VERSION_HEX >= 0x03030000 if (cause) { #else if (cause && cause != Py_None) { #endif PyObject *fixed_cause; if (cause == Py_None) { fixed_cause = NULL; } else if (PyExceptionClass_Check(cause)) { fixed_cause = PyObject_CallObject(cause, NULL); if (fixed_cause == NULL) goto bad; } else if (PyExceptionInstance_Check(cause)) { fixed_cause = cause; Py_INCREF(fixed_cause); } else { PyErr_SetString(PyExc_TypeError, "exception causes must derive from " "BaseException"); goto bad; } PyException_SetCause(value, fixed_cause); } PyErr_SetObject(type, value); if (tb) { #if CYTHON_COMPILING_IN_PYPY PyObject *tmp_type, *tmp_value, *tmp_tb; PyErr_Fetch(tmp_type, tmp_value, tmp_tb); Py_INCREF(tb); PyErr_Restore(tmp_type, tmp_value, tb); Py_XDECREF(tmp_tb); #else PyThreadState *tstate = PyThreadState_GET(); PyObject* tmp_tb = tstate->curexc_traceback; if (tb != tmp_tb) { Py_INCREF(tb); tstate->curexc_traceback = tb; Py_XDECREF(tmp_tb); } #endif } bad: Py_XDECREF(owned_instance); return; } #endif static CYTHON_INLINE int __Pyx_CheckKeywordStrings( PyObject *kwdict, const char* function_name, int kw_allowed) { PyObject* key = 0; Py_ssize_t pos = 0; #if CYTHON_COMPILING_IN_PYPY if (!kw_allowed && PyDict_Next(kwdict, &pos, &key, 0)) goto invalid_keyword; return 1; #else while (PyDict_Next(kwdict, &pos, &key, 0)) { #if PY_MAJOR_VERSION < 3 if (unlikely(!PyString_CheckExact(key)) && unlikely(!PyString_Check(key))) #endif if (unlikely(!PyUnicode_Check(key))) goto invalid_keyword_type; } if ((!kw_allowed) && unlikely(key)) goto invalid_keyword; return 1; invalid_keyword_type: PyErr_Format(PyExc_TypeError, "%.200s() keywords must be strings", function_name); return 0; #endif invalid_keyword: PyErr_Format(PyExc_TypeError, #if PY_MAJOR_VERSION < 3 "%.200s() got an unexpected keyword argument '%.200s'", function_name, PyString_AsString(key)); #else "%s() got an unexpected keyword argument '%U'", function_name, key); #endif return 0; } static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Generic(PyObject *o, PyObject* j) { PyObject *r; if (!j) return NULL; r = PyObject_GetItem(o, j); Py_DECREF(j); return r; } static CYTHON_INLINE PyObject *__Pyx_GetItemInt_List_Fast(PyObject *o, Py_ssize_t i, int wraparound, int boundscheck) { #if CYTHON_COMPILING_IN_CPYTHON if (wraparound & unlikely(i < 0)) i += PyList_GET_SIZE(o); if ((!boundscheck) || likely((0 <= i) & (i < PyList_GET_SIZE(o)))) { PyObject *r = PyList_GET_ITEM(o, i); Py_INCREF(r); return r; } return __Pyx_GetItemInt_Generic(o, PyInt_FromSsize_t(i)); #else return PySequence_GetItem(o, i); #endif } static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Tuple_Fast(PyObject *o, Py_ssize_t i, int wraparound, int boundscheck) { #if CYTHON_COMPILING_IN_CPYTHON if (wraparound & unlikely(i < 0)) i += PyTuple_GET_SIZE(o); if ((!boundscheck) || likely((0 <= i) & (i < PyTuple_GET_SIZE(o)))) { PyObject *r = PyTuple_GET_ITEM(o, i); Py_INCREF(r); return r; } return __Pyx_GetItemInt_Generic(o, PyInt_FromSsize_t(i)); #else return PySequence_GetItem(o, i); #endif } static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Fast(PyObject *o, Py_ssize_t i, int is_list, int wraparound, int boundscheck) { #if CYTHON_COMPILING_IN_CPYTHON if (is_list || PyList_CheckExact(o)) { Py_ssize_t n = ((!wraparound) | likely(i >= 0)) ? i : i + PyList_GET_SIZE(o); if ((!boundscheck) || (likely((n >= 0) & (n < PyList_GET_SIZE(o))))) { PyObject *r = PyList_GET_ITEM(o, n); Py_INCREF(r); return r; } } else if (PyTuple_CheckExact(o)) { Py_ssize_t n = ((!wraparound) | likely(i >= 0)) ? i : i + PyTuple_GET_SIZE(o); if ((!boundscheck) || likely((n >= 0) & (n < PyTuple_GET_SIZE(o)))) { PyObject *r = PyTuple_GET_ITEM(o, n); Py_INCREF(r); return r; } } else { PySequenceMethods *m = Py_TYPE(o)->tp_as_sequence; if (likely(m && m->sq_item)) { if (wraparound && unlikely(i < 0) && likely(m->sq_length)) { Py_ssize_t l = m->sq_length(o); if (likely(l >= 0)) { i += l; } else { if (PyErr_ExceptionMatches(PyExc_OverflowError)) PyErr_Clear(); else return NULL; } } return m->sq_item(o, i); } } #else if (is_list || PySequence_Check(o)) { return PySequence_GetItem(o, i); } #endif return __Pyx_GetItemInt_Generic(o, PyInt_FromSsize_t(i)); } static void __Pyx_RaiseArgumentTypeInvalid(const char* name, PyObject *obj, PyTypeObject *type) { PyErr_Format(PyExc_TypeError, "Argument '%.200s' has incorrect type (expected %.200s, got %.200s)", name, type->tp_name, Py_TYPE(obj)->tp_name); } static CYTHON_INLINE int __Pyx_ArgTypeTest(PyObject *obj, PyTypeObject *type, int none_allowed, const char *name, int exact) { if (unlikely(!type)) { PyErr_SetString(PyExc_SystemError, "Missing type object"); return 0; } if (none_allowed && obj == Py_None) return 1; else if (exact) { if (likely(Py_TYPE(obj) == type)) return 1; #if PY_MAJOR_VERSION == 2 else if ((type == &PyBaseString_Type) && likely(__Pyx_PyBaseString_CheckExact(obj))) return 1; #endif } else { if (likely(PyObject_TypeCheck(obj, type))) return 1; } __Pyx_RaiseArgumentTypeInvalid(name, obj, type); return 0; } static PyObject* __Pyx_ImportFrom(PyObject* module, PyObject* name) { PyObject* value = __Pyx_PyObject_GetAttrStr(module, name); if (unlikely(!value) && PyErr_ExceptionMatches(PyExc_AttributeError)) { PyErr_Format(PyExc_ImportError, #if PY_MAJOR_VERSION < 3 "cannot import name %.230s", PyString_AS_STRING(name)); #else "cannot import name %S", name); #endif } return value; } static int __pyx_bisect_code_objects(__Pyx_CodeObjectCacheEntry* entries, int count, int code_line) { int start = 0, mid = 0, end = count - 1; if (end >= 0 && code_line > entries[end].code_line) { return count; } while (start < end) { mid = (start + end) / 2; if (code_line < entries[mid].code_line) { end = mid; } else if (code_line > entries[mid].code_line) { start = mid + 1; } else { return mid; } } if (code_line <= entries[mid].code_line) { return mid; } else { return mid + 1; } } static PyCodeObject *__pyx_find_code_object(int code_line) { PyCodeObject* code_object; int pos; if (unlikely(!code_line) || unlikely(!__pyx_code_cache.entries)) { return NULL; } pos = __pyx_bisect_code_objects(__pyx_code_cache.entries, __pyx_code_cache.count, code_line); if (unlikely(pos >= __pyx_code_cache.count) || unlikely(__pyx_code_cache.entries[pos].code_line != code_line)) { return NULL; } code_object = __pyx_code_cache.entries[pos].code_object; Py_INCREF(code_object); return code_object; } static void __pyx_insert_code_object(int code_line, PyCodeObject* code_object) { int pos, i; __Pyx_CodeObjectCacheEntry* entries = __pyx_code_cache.entries; if (unlikely(!code_line)) { return; } if (unlikely(!entries)) { entries = (__Pyx_CodeObjectCacheEntry*)PyMem_Malloc(64*sizeof(__Pyx_CodeObjectCacheEntry)); if (likely(entries)) { __pyx_code_cache.entries = entries; __pyx_code_cache.max_count = 64; __pyx_code_cache.count = 1; entries[0].code_line = code_line; entries[0].code_object = code_object; Py_INCREF(code_object); } return; } pos = __pyx_bisect_code_objects(__pyx_code_cache.entries, __pyx_code_cache.count, code_line); if ((pos < __pyx_code_cache.count) && unlikely(__pyx_code_cache.entries[pos].code_line == code_line)) { PyCodeObject* tmp = entries[pos].code_object; entries[pos].code_object = code_object; Py_DECREF(tmp); return; } if (__pyx_code_cache.count == __pyx_code_cache.max_count) { int new_max = __pyx_code_cache.max_count + 64; entries = (__Pyx_CodeObjectCacheEntry*)PyMem_Realloc( __pyx_code_cache.entries, (size_t)new_max*sizeof(__Pyx_CodeObjectCacheEntry)); if (unlikely(!entries)) { return; } __pyx_code_cache.entries = entries; __pyx_code_cache.max_count = new_max; } for (i=__pyx_code_cache.count; i>pos; i--) { entries[i] = entries[i-1]; } entries[pos].code_line = code_line; entries[pos].code_object = code_object; __pyx_code_cache.count++; Py_INCREF(code_object); } #include "compile.h" #include "frameobject.h" #include "traceback.h" static PyCodeObject* __Pyx_CreateCodeObjectForTraceback( const char *funcname, int c_line, int py_line, const char *filename) { PyCodeObject *py_code = 0; PyObject *py_srcfile = 0; PyObject *py_funcname = 0; #if PY_MAJOR_VERSION < 3 py_srcfile = PyString_FromString(filename); #else py_srcfile = PyUnicode_FromString(filename); #endif if (!py_srcfile) goto bad; if (c_line) { #if PY_MAJOR_VERSION < 3 py_funcname = PyString_FromFormat( "%s (%s:%d)", funcname, __pyx_cfilenm, c_line); #else py_funcname = PyUnicode_FromFormat( "%s (%s:%d)", funcname, __pyx_cfilenm, c_line); #endif } else { #if PY_MAJOR_VERSION < 3 py_funcname = PyString_FromString(funcname); #else py_funcname = PyUnicode_FromString(funcname); #endif } if (!py_funcname) goto bad; py_code = __Pyx_PyCode_New( 0, 0, 0, 0, 0, __pyx_empty_bytes, /*PyObject *code,*/ __pyx_empty_tuple, /*PyObject *consts,*/ __pyx_empty_tuple, /*PyObject *names,*/ __pyx_empty_tuple, /*PyObject *varnames,*/ __pyx_empty_tuple, /*PyObject *freevars,*/ __pyx_empty_tuple, /*PyObject *cellvars,*/ py_srcfile, /*PyObject *filename,*/ py_funcname, /*PyObject *name,*/ py_line, __pyx_empty_bytes /*PyObject *lnotab*/ ); Py_DECREF(py_srcfile); Py_DECREF(py_funcname); return py_code; bad: Py_XDECREF(py_srcfile); Py_XDECREF(py_funcname); return NULL; } static void __Pyx_AddTraceback(const char *funcname, int c_line, int py_line, const char *filename) { PyCodeObject *py_code = 0; PyFrameObject *py_frame = 0; py_code = __pyx_find_code_object(c_line ? c_line : py_line); if (!py_code) { py_code = __Pyx_CreateCodeObjectForTraceback( funcname, c_line, py_line, filename); if (!py_code) goto bad; __pyx_insert_code_object(c_line ? c_line : py_line, py_code); } py_frame = PyFrame_New( PyThreadState_GET(), /*PyThreadState *tstate,*/ py_code, /*PyCodeObject *code,*/ __pyx_d, /*PyObject *globals,*/ 0 /*PyObject *locals*/ ); if (!py_frame) goto bad; py_frame->f_lineno = py_line; PyTraceBack_Here(py_frame); bad: Py_XDECREF(py_code); Py_XDECREF(py_frame); } static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list, int level) { PyObject *empty_list = 0; PyObject *module = 0; PyObject *global_dict = 0; PyObject *empty_dict = 0; PyObject *list; #if PY_VERSION_HEX < 0x03030000 PyObject *py_import; py_import = __Pyx_PyObject_GetAttrStr(__pyx_b, __pyx_n_s_import); if (!py_import) goto bad; #endif if (from_list) list = from_list; else { empty_list = PyList_New(0); if (!empty_list) goto bad; list = empty_list; } global_dict = PyModule_GetDict(__pyx_m); if (!global_dict) goto bad; empty_dict = PyDict_New(); if (!empty_dict) goto bad; { #if PY_MAJOR_VERSION >= 3 if (level == -1) { if (strchr(__Pyx_MODULE_NAME, '.')) { #if PY_VERSION_HEX < 0x03030000 PyObject *py_level = PyInt_FromLong(1); if (!py_level) goto bad; module = PyObject_CallFunctionObjArgs(py_import, name, global_dict, empty_dict, list, py_level, NULL); Py_DECREF(py_level); #else module = PyImport_ImportModuleLevelObject( name, global_dict, empty_dict, list, 1); #endif if (!module) { if (!PyErr_ExceptionMatches(PyExc_ImportError)) goto bad; PyErr_Clear(); } } level = 0; } #endif if (!module) { #if PY_VERSION_HEX < 0x03030000 PyObject *py_level = PyInt_FromLong(level); if (!py_level) goto bad; module = PyObject_CallFunctionObjArgs(py_import, name, global_dict, empty_dict, list, py_level, NULL); Py_DECREF(py_level); #else module = PyImport_ImportModuleLevelObject( name, global_dict, empty_dict, list, level); #endif } } bad: #if PY_VERSION_HEX < 0x03030000 Py_XDECREF(py_import); #endif Py_XDECREF(empty_list); Py_XDECREF(empty_dict); return module; } #define __PYX_VERIFY_RETURN_INT(target_type, func_type, func_value) \ { \ func_type value = func_value; \ if (sizeof(target_type) < sizeof(func_type)) { \ if (unlikely(value != (func_type) (target_type) value)) { \ func_type zero = 0; \ if (is_unsigned && unlikely(value < zero)) \ goto raise_neg_overflow; \ else \ goto raise_overflow; \ } \ } \ return (target_type) value; \ } #if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3 #if CYTHON_USE_PYLONG_INTERNALS #include "longintrepr.h" #endif #endif static CYTHON_INLINE int __Pyx_PyInt_As_int(PyObject *x) { const int neg_one = (int) -1, const_zero = 0; const int is_unsigned = neg_one > const_zero; #if PY_MAJOR_VERSION < 3 if (likely(PyInt_Check(x))) { if (sizeof(int) < sizeof(long)) { __PYX_VERIFY_RETURN_INT(int, long, PyInt_AS_LONG(x)) } else { long val = PyInt_AS_LONG(x); if (is_unsigned && unlikely(val < 0)) { goto raise_neg_overflow; } return (int) val; } } else #endif if (likely(PyLong_Check(x))) { if (is_unsigned) { #if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3 #if CYTHON_USE_PYLONG_INTERNALS switch (Py_SIZE(x)) { case 0: return 0; case 1: __PYX_VERIFY_RETURN_INT(int, digit, ((PyLongObject*)x)->ob_digit[0]); } #endif #endif if (unlikely(Py_SIZE(x) < 0)) { goto raise_neg_overflow; } if (sizeof(int) <= sizeof(unsigned long)) { __PYX_VERIFY_RETURN_INT(int, unsigned long, PyLong_AsUnsignedLong(x)) } else if (sizeof(int) <= sizeof(unsigned long long)) { __PYX_VERIFY_RETURN_INT(int, unsigned long long, PyLong_AsUnsignedLongLong(x)) } } else { #if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3 #if CYTHON_USE_PYLONG_INTERNALS switch (Py_SIZE(x)) { case 0: return 0; case 1: __PYX_VERIFY_RETURN_INT(int, digit, +(((PyLongObject*)x)->ob_digit[0])); case -1: __PYX_VERIFY_RETURN_INT(int, sdigit, -(sdigit) ((PyLongObject*)x)->ob_digit[0]); } #endif #endif if (sizeof(int) <= sizeof(long)) { __PYX_VERIFY_RETURN_INT(int, long, PyLong_AsLong(x)) } else if (sizeof(int) <= sizeof(long long)) { __PYX_VERIFY_RETURN_INT(int, long long, PyLong_AsLongLong(x)) } } { #if CYTHON_COMPILING_IN_PYPY && !defined(_PyLong_AsByteArray) PyErr_SetString(PyExc_RuntimeError, "_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers"); #else int val; PyObject *v = __Pyx_PyNumber_Int(x); #if PY_MAJOR_VERSION < 3 if (likely(v) && !PyLong_Check(v)) { PyObject *tmp = v; v = PyNumber_Long(tmp); Py_DECREF(tmp); } #endif if (likely(v)) { int one = 1; int is_little = (int)*(unsigned char *)&one; unsigned char *bytes = (unsigned char *)&val; int ret = _PyLong_AsByteArray((PyLongObject *)v, bytes, sizeof(val), is_little, !is_unsigned); Py_DECREF(v); if (likely(!ret)) return val; } #endif return (int) -1; } } else { int val; PyObject *tmp = __Pyx_PyNumber_Int(x); if (!tmp) return (int) -1; val = __Pyx_PyInt_As_int(tmp); Py_DECREF(tmp); return val; } raise_overflow: PyErr_SetString(PyExc_OverflowError, "value too large to convert to int"); return (int) -1; raise_neg_overflow: PyErr_SetString(PyExc_OverflowError, "can't convert negative value to int"); return (int) -1; } static CYTHON_INLINE PyObject* __Pyx_PyInt_From_int(int value) { const int neg_one = (int) -1, const_zero = 0; const int is_unsigned = neg_one > const_zero; if (is_unsigned) { if (sizeof(int) < sizeof(long)) { return PyInt_FromLong((long) value); } else if (sizeof(int) <= sizeof(unsigned long)) { return PyLong_FromUnsignedLong((unsigned long) value); } else if (sizeof(int) <= sizeof(unsigned long long)) { return PyLong_FromUnsignedLongLong((unsigned long long) value); } } else { if (sizeof(int) <= sizeof(long)) { return PyInt_FromLong((long) value); } else if (sizeof(int) <= sizeof(long long)) { return PyLong_FromLongLong((long long) value); } } { int one = 1; int little = (int)*(unsigned char *)&one; unsigned char *bytes = (unsigned char *)&value; return _PyLong_FromByteArray(bytes, sizeof(int), little, !is_unsigned); } } static CYTHON_INLINE uint16_t __Pyx_PyInt_As_uint16_t(PyObject *x) { const uint16_t neg_one = (uint16_t) -1, const_zero = 0; const int is_unsigned = neg_one > const_zero; #if PY_MAJOR_VERSION < 3 if (likely(PyInt_Check(x))) { if (sizeof(uint16_t) < sizeof(long)) { __PYX_VERIFY_RETURN_INT(uint16_t, long, PyInt_AS_LONG(x)) } else { long val = PyInt_AS_LONG(x); if (is_unsigned && unlikely(val < 0)) { goto raise_neg_overflow; } return (uint16_t) val; } } else #endif if (likely(PyLong_Check(x))) { if (is_unsigned) { #if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3 #if CYTHON_USE_PYLONG_INTERNALS switch (Py_SIZE(x)) { case 0: return 0; case 1: __PYX_VERIFY_RETURN_INT(uint16_t, digit, ((PyLongObject*)x)->ob_digit[0]); } #endif #endif if (unlikely(Py_SIZE(x) < 0)) { goto raise_neg_overflow; } if (sizeof(uint16_t) <= sizeof(unsigned long)) { __PYX_VERIFY_RETURN_INT(uint16_t, unsigned long, PyLong_AsUnsignedLong(x)) } else if (sizeof(uint16_t) <= sizeof(unsigned long long)) { __PYX_VERIFY_RETURN_INT(uint16_t, unsigned long long, PyLong_AsUnsignedLongLong(x)) } } else { #if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3 #if CYTHON_USE_PYLONG_INTERNALS switch (Py_SIZE(x)) { case 0: return 0; case 1: __PYX_VERIFY_RETURN_INT(uint16_t, digit, +(((PyLongObject*)x)->ob_digit[0])); case -1: __PYX_VERIFY_RETURN_INT(uint16_t, sdigit, -(sdigit) ((PyLongObject*)x)->ob_digit[0]); } #endif #endif if (sizeof(uint16_t) <= sizeof(long)) { __PYX_VERIFY_RETURN_INT(uint16_t, long, PyLong_AsLong(x)) } else if (sizeof(uint16_t) <= sizeof(long long)) { __PYX_VERIFY_RETURN_INT(uint16_t, long long, PyLong_AsLongLong(x)) } } { #if CYTHON_COMPILING_IN_PYPY && !defined(_PyLong_AsByteArray) PyErr_SetString(PyExc_RuntimeError, "_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers"); #else uint16_t val; PyObject *v = __Pyx_PyNumber_Int(x); #if PY_MAJOR_VERSION < 3 if (likely(v) && !PyLong_Check(v)) { PyObject *tmp = v; v = PyNumber_Long(tmp); Py_DECREF(tmp); } #endif if (likely(v)) { int one = 1; int is_little = (int)*(unsigned char *)&one; unsigned char *bytes = (unsigned char *)&val; int ret = _PyLong_AsByteArray((PyLongObject *)v, bytes, sizeof(val), is_little, !is_unsigned); Py_DECREF(v); if (likely(!ret)) return val; } #endif return (uint16_t) -1; } } else { uint16_t val; PyObject *tmp = __Pyx_PyNumber_Int(x); if (!tmp) return (uint16_t) -1; val = __Pyx_PyInt_As_uint16_t(tmp); Py_DECREF(tmp); return val; } raise_overflow: PyErr_SetString(PyExc_OverflowError, "value too large to convert to uint16_t"); return (uint16_t) -1; raise_neg_overflow: PyErr_SetString(PyExc_OverflowError, "can't convert negative value to uint16_t"); return (uint16_t) -1; } static CYTHON_INLINE PyObject* __Pyx_PyInt_From_uint16_t(uint16_t value) { const uint16_t neg_one = (uint16_t) -1, const_zero = 0; const int is_unsigned = neg_one > const_zero; if (is_unsigned) { if (sizeof(uint16_t) < sizeof(long)) { return PyInt_FromLong((long) value); } else if (sizeof(uint16_t) <= sizeof(unsigned long)) { return PyLong_FromUnsignedLong((unsigned long) value); } else if (sizeof(uint16_t) <= sizeof(unsigned long long)) { return PyLong_FromUnsignedLongLong((unsigned long long) value); } } else { if (sizeof(uint16_t) <= sizeof(long)) { return PyInt_FromLong((long) value); } else if (sizeof(uint16_t) <= sizeof(long long)) { return PyLong_FromLongLong((long long) value); } } { int one = 1; int little = (int)*(unsigned char *)&one; unsigned char *bytes = (unsigned char *)&value; return _PyLong_FromByteArray(bytes, sizeof(uint16_t), little, !is_unsigned); } } static CYTHON_INLINE PyObject* __Pyx_PyInt_From_long(long value) { const long neg_one = (long) -1, const_zero = 0; const int is_unsigned = neg_one > const_zero; if (is_unsigned) { if (sizeof(long) < sizeof(long)) { return PyInt_FromLong((long) value); } else if (sizeof(long) <= sizeof(unsigned long)) { return PyLong_FromUnsignedLong((unsigned long) value); } else if (sizeof(long) <= sizeof(unsigned long long)) { return PyLong_FromUnsignedLongLong((unsigned long long) value); } } else { if (sizeof(long) <= sizeof(long)) { return PyInt_FromLong((long) value); } else if (sizeof(long) <= sizeof(long long)) { return PyLong_FromLongLong((long long) value); } } { int one = 1; int little = (int)*(unsigned char *)&one; unsigned char *bytes = (unsigned char *)&value; return _PyLong_FromByteArray(bytes, sizeof(long), little, !is_unsigned); } } static CYTHON_INLINE long __Pyx_PyInt_As_long(PyObject *x) { const long neg_one = (long) -1, const_zero = 0; const int is_unsigned = neg_one > const_zero; #if PY_MAJOR_VERSION < 3 if (likely(PyInt_Check(x))) { if (sizeof(long) < sizeof(long)) { __PYX_VERIFY_RETURN_INT(long, long, PyInt_AS_LONG(x)) } else { long val = PyInt_AS_LONG(x); if (is_unsigned && unlikely(val < 0)) { goto raise_neg_overflow; } return (long) val; } } else #endif if (likely(PyLong_Check(x))) { if (is_unsigned) { #if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3 #if CYTHON_USE_PYLONG_INTERNALS switch (Py_SIZE(x)) { case 0: return 0; case 1: __PYX_VERIFY_RETURN_INT(long, digit, ((PyLongObject*)x)->ob_digit[0]); } #endif #endif if (unlikely(Py_SIZE(x) < 0)) { goto raise_neg_overflow; } if (sizeof(long) <= sizeof(unsigned long)) { __PYX_VERIFY_RETURN_INT(long, unsigned long, PyLong_AsUnsignedLong(x)) } else if (sizeof(long) <= sizeof(unsigned long long)) { __PYX_VERIFY_RETURN_INT(long, unsigned long long, PyLong_AsUnsignedLongLong(x)) } } else { #if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3 #if CYTHON_USE_PYLONG_INTERNALS switch (Py_SIZE(x)) { case 0: return 0; case 1: __PYX_VERIFY_RETURN_INT(long, digit, +(((PyLongObject*)x)->ob_digit[0])); case -1: __PYX_VERIFY_RETURN_INT(long, sdigit, -(sdigit) ((PyLongObject*)x)->ob_digit[0]); } #endif #endif if (sizeof(long) <= sizeof(long)) { __PYX_VERIFY_RETURN_INT(long, long, PyLong_AsLong(x)) } else if (sizeof(long) <= sizeof(long long)) { __PYX_VERIFY_RETURN_INT(long, long long, PyLong_AsLongLong(x)) } } { #if CYTHON_COMPILING_IN_PYPY && !defined(_PyLong_AsByteArray) PyErr_SetString(PyExc_RuntimeError, "_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers"); #else long val; PyObject *v = __Pyx_PyNumber_Int(x); #if PY_MAJOR_VERSION < 3 if (likely(v) && !PyLong_Check(v)) { PyObject *tmp = v; v = PyNumber_Long(tmp); Py_DECREF(tmp); } #endif if (likely(v)) { int one = 1; int is_little = (int)*(unsigned char *)&one; unsigned char *bytes = (unsigned char *)&val; int ret = _PyLong_AsByteArray((PyLongObject *)v, bytes, sizeof(val), is_little, !is_unsigned); Py_DECREF(v); if (likely(!ret)) return val; } #endif return (long) -1; } } else { long val; PyObject *tmp = __Pyx_PyNumber_Int(x); if (!tmp) return (long) -1; val = __Pyx_PyInt_As_long(tmp); Py_DECREF(tmp); return val; } raise_overflow: PyErr_SetString(PyExc_OverflowError, "value too large to convert to long"); return (long) -1; raise_neg_overflow: PyErr_SetString(PyExc_OverflowError, "can't convert negative value to long"); return (long) -1; } static int __Pyx_check_binary_version(void) { char ctversion[4], rtversion[4]; PyOS_snprintf(ctversion, 4, "%d.%d", PY_MAJOR_VERSION, PY_MINOR_VERSION); PyOS_snprintf(rtversion, 4, "%s", Py_GetVersion()); if (ctversion[0] != rtversion[0] || ctversion[2] != rtversion[2]) { char message[200]; PyOS_snprintf(message, sizeof(message), "compiletime version %s of module '%.100s' " "does not match runtime version %s", ctversion, __Pyx_MODULE_NAME, rtversion); return PyErr_WarnEx(NULL, message, 1); } return 0; } #ifndef __PYX_HAVE_RT_ImportModule #define __PYX_HAVE_RT_ImportModule static PyObject *__Pyx_ImportModule(const char *name) { PyObject *py_name = 0; PyObject *py_module = 0; py_name = __Pyx_PyIdentifier_FromString(name); if (!py_name) goto bad; py_module = PyImport_Import(py_name); Py_DECREF(py_name); return py_module; bad: Py_XDECREF(py_name); return 0; } #endif #ifndef __PYX_HAVE_RT_ImportFunction #define __PYX_HAVE_RT_ImportFunction static int __Pyx_ImportFunction(PyObject *module, const char *funcname, void (**f)(void), const char *sig) { PyObject *d = 0; PyObject *cobj = 0; union { void (*fp)(void); void *p; } tmp; d = PyObject_GetAttrString(module, (char *)"__pyx_capi__"); if (!d) goto bad; cobj = PyDict_GetItemString(d, funcname); if (!cobj) { PyErr_Format(PyExc_ImportError, "%.200s does not export expected C function %.200s", PyModule_GetName(module), funcname); goto bad; } #if PY_VERSION_HEX >= 0x02070000 if (!PyCapsule_IsValid(cobj, sig)) { PyErr_Format(PyExc_TypeError, "C function %.200s.%.200s has wrong signature (expected %.500s, got %.500s)", PyModule_GetName(module), funcname, sig, PyCapsule_GetName(cobj)); goto bad; } tmp.p = PyCapsule_GetPointer(cobj, sig); #else {const char *desc, *s1, *s2; desc = (const char *)PyCObject_GetDesc(cobj); if (!desc) goto bad; s1 = desc; s2 = sig; while (*s1 != '\0' && *s1 == *s2) { s1++; s2++; } if (*s1 != *s2) { PyErr_Format(PyExc_TypeError, "C function %.200s.%.200s has wrong signature (expected %.500s, got %.500s)", PyModule_GetName(module), funcname, sig, desc); goto bad; } tmp.p = PyCObject_AsVoidPtr(cobj);} #endif *f = tmp.fp; if (!(*f)) goto bad; Py_DECREF(d); return 0; bad: Py_XDECREF(d); return -1; } #endif static int __Pyx_InitStrings(__Pyx_StringTabEntry *t) { while (t->p) { #if PY_MAJOR_VERSION < 3 if (t->is_unicode) { *t->p = PyUnicode_DecodeUTF8(t->s, t->n - 1, NULL); } else if (t->intern) { *t->p = PyString_InternFromString(t->s); } else { *t->p = PyString_FromStringAndSize(t->s, t->n - 1); } #else if (t->is_unicode | t->is_str) { if (t->intern) { *t->p = PyUnicode_InternFromString(t->s); } else if (t->encoding) { *t->p = PyUnicode_Decode(t->s, t->n - 1, t->encoding, NULL); } else { *t->p = PyUnicode_FromStringAndSize(t->s, t->n - 1); } } else { *t->p = PyBytes_FromStringAndSize(t->s, t->n - 1); } #endif if (!*t->p) return -1; ++t; } return 0; } static CYTHON_INLINE PyObject* __Pyx_PyUnicode_FromString(const char* c_str) { return __Pyx_PyUnicode_FromStringAndSize(c_str, (Py_ssize_t)strlen(c_str)); } static CYTHON_INLINE char* __Pyx_PyObject_AsString(PyObject* o) { Py_ssize_t ignore; return __Pyx_PyObject_AsStringAndSize(o, &ignore); } static CYTHON_INLINE char* __Pyx_PyObject_AsStringAndSize(PyObject* o, Py_ssize_t *length) { #if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT if ( #if PY_MAJOR_VERSION < 3 && __PYX_DEFAULT_STRING_ENCODING_IS_ASCII __Pyx_sys_getdefaultencoding_not_ascii && #endif PyUnicode_Check(o)) { #if PY_VERSION_HEX < 0x03030000 char* defenc_c; PyObject* defenc = _PyUnicode_AsDefaultEncodedString(o, NULL); if (!defenc) return NULL; defenc_c = PyBytes_AS_STRING(defenc); #if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII { char* end = defenc_c + PyBytes_GET_SIZE(defenc); char* c; for (c = defenc_c; c < end; c++) { if ((unsigned char) (*c) >= 128) { PyUnicode_AsASCIIString(o); return NULL; } } } #endif *length = PyBytes_GET_SIZE(defenc); return defenc_c; #else if (__Pyx_PyUnicode_READY(o) == -1) return NULL; #if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII if (PyUnicode_IS_ASCII(o)) { *length = PyUnicode_GET_LENGTH(o); return PyUnicode_AsUTF8(o); } else { PyUnicode_AsASCIIString(o); return NULL; } #else return PyUnicode_AsUTF8AndSize(o, length); #endif #endif } else #endif #if !CYTHON_COMPILING_IN_PYPY if (PyByteArray_Check(o)) { *length = PyByteArray_GET_SIZE(o); return PyByteArray_AS_STRING(o); } else #endif { char* result; int r = PyBytes_AsStringAndSize(o, &result, length); if (unlikely(r < 0)) { return NULL; } else { return result; } } } static CYTHON_INLINE int __Pyx_PyObject_IsTrue(PyObject* x) { int is_true = x == Py_True; if (is_true | (x == Py_False) | (x == Py_None)) return is_true; else return PyObject_IsTrue(x); } static CYTHON_INLINE PyObject* __Pyx_PyNumber_Int(PyObject* x) { PyNumberMethods *m; const char *name = NULL; PyObject *res = NULL; #if PY_MAJOR_VERSION < 3 if (PyInt_Check(x) || PyLong_Check(x)) #else if (PyLong_Check(x)) #endif return Py_INCREF(x), x; m = Py_TYPE(x)->tp_as_number; #if PY_MAJOR_VERSION < 3 if (m && m->nb_int) { name = "int"; res = PyNumber_Int(x); } else if (m && m->nb_long) { name = "long"; res = PyNumber_Long(x); } #else if (m && m->nb_int) { name = "int"; res = PyNumber_Long(x); } #endif if (res) { #if PY_MAJOR_VERSION < 3 if (!PyInt_Check(res) && !PyLong_Check(res)) { #else if (!PyLong_Check(res)) { #endif PyErr_Format(PyExc_TypeError, "__%.4s__ returned non-%.4s (type %.200s)", name, name, Py_TYPE(res)->tp_name); Py_DECREF(res); return NULL; } } else if (!PyErr_Occurred()) { PyErr_SetString(PyExc_TypeError, "an integer is required"); } return res; } static CYTHON_INLINE Py_ssize_t __Pyx_PyIndex_AsSsize_t(PyObject* b) { Py_ssize_t ival; PyObject *x; #if PY_MAJOR_VERSION < 3 if (likely(PyInt_CheckExact(b))) return PyInt_AS_LONG(b); #endif if (likely(PyLong_CheckExact(b))) { #if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3 #if CYTHON_USE_PYLONG_INTERNALS switch (Py_SIZE(b)) { case -1: return -(sdigit)((PyLongObject*)b)->ob_digit[0]; case 0: return 0; case 1: return ((PyLongObject*)b)->ob_digit[0]; } #endif #endif return PyLong_AsSsize_t(b); } x = PyNumber_Index(b); if (!x) return -1; ival = PyInt_AsSsize_t(x); Py_DECREF(x); return ival; } static CYTHON_INLINE PyObject * __Pyx_PyInt_FromSize_t(size_t ival) { return PyInt_FromSize_t(ival); } #endif /* Py_PYTHON_H */ pygame_sdl2-2.1.0-for-renpy-6.99.14.1/gen/pygame_sdl2.joystick.c0000664000175000017500000055652512660477773023274 0ustar tomtom00000000000000/* Generated by Cython 0.23.4 */ #define PY_SSIZE_T_CLEAN #include "Python.h" #ifndef Py_PYTHON_H #error Python headers needed to compile C extensions, please install development version of Python. #elif PY_VERSION_HEX < 0x02060000 || (0x03000000 <= PY_VERSION_HEX && PY_VERSION_HEX < 0x03020000) #error Cython requires Python 2.6+ or Python 3.2+. #else #define CYTHON_ABI "0_23_4" #include #ifndef offsetof #define offsetof(type, member) ( (size_t) & ((type*)0) -> member ) #endif #if !defined(WIN32) && !defined(MS_WINDOWS) #ifndef __stdcall #define __stdcall #endif #ifndef __cdecl #define __cdecl #endif #ifndef __fastcall #define __fastcall #endif #endif #ifndef DL_IMPORT #define DL_IMPORT(t) t #endif #ifndef DL_EXPORT #define DL_EXPORT(t) t #endif #ifndef PY_LONG_LONG #define PY_LONG_LONG LONG_LONG #endif #ifndef Py_HUGE_VAL #define Py_HUGE_VAL HUGE_VAL #endif #ifdef PYPY_VERSION #define CYTHON_COMPILING_IN_PYPY 1 #define CYTHON_COMPILING_IN_CPYTHON 0 #else #define CYTHON_COMPILING_IN_PYPY 0 #define CYTHON_COMPILING_IN_CPYTHON 1 #endif #if !defined(CYTHON_USE_PYLONG_INTERNALS) && CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x02070000 #define CYTHON_USE_PYLONG_INTERNALS 1 #endif #if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX < 0x02070600 && !defined(Py_OptimizeFlag) #define Py_OptimizeFlag 0 #endif #define __PYX_BUILD_PY_SSIZE_T "n" #define CYTHON_FORMAT_SSIZE_T "z" #if PY_MAJOR_VERSION < 3 #define __Pyx_BUILTIN_MODULE_NAME "__builtin__" #define __Pyx_PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)\ PyCode_New(a+k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos) #define __Pyx_DefaultClassType PyClass_Type #else #define __Pyx_BUILTIN_MODULE_NAME "builtins" #define __Pyx_PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)\ PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos) #define __Pyx_DefaultClassType PyType_Type #endif #ifndef Py_TPFLAGS_CHECKTYPES #define Py_TPFLAGS_CHECKTYPES 0 #endif #ifndef Py_TPFLAGS_HAVE_INDEX #define Py_TPFLAGS_HAVE_INDEX 0 #endif #ifndef Py_TPFLAGS_HAVE_NEWBUFFER #define Py_TPFLAGS_HAVE_NEWBUFFER 0 #endif #ifndef Py_TPFLAGS_HAVE_FINALIZE #define Py_TPFLAGS_HAVE_FINALIZE 0 #endif #if PY_VERSION_HEX > 0x03030000 && defined(PyUnicode_KIND) #define CYTHON_PEP393_ENABLED 1 #define __Pyx_PyUnicode_READY(op) (likely(PyUnicode_IS_READY(op)) ?\ 0 : _PyUnicode_Ready((PyObject *)(op))) #define __Pyx_PyUnicode_GET_LENGTH(u) PyUnicode_GET_LENGTH(u) #define __Pyx_PyUnicode_READ_CHAR(u, i) PyUnicode_READ_CHAR(u, i) #define __Pyx_PyUnicode_KIND(u) PyUnicode_KIND(u) #define __Pyx_PyUnicode_DATA(u) PyUnicode_DATA(u) #define __Pyx_PyUnicode_READ(k, d, i) PyUnicode_READ(k, d, i) #else #define CYTHON_PEP393_ENABLED 0 #define __Pyx_PyUnicode_READY(op) (0) #define __Pyx_PyUnicode_GET_LENGTH(u) PyUnicode_GET_SIZE(u) #define __Pyx_PyUnicode_READ_CHAR(u, i) ((Py_UCS4)(PyUnicode_AS_UNICODE(u)[i])) #define __Pyx_PyUnicode_KIND(u) (sizeof(Py_UNICODE)) #define __Pyx_PyUnicode_DATA(u) ((void*)PyUnicode_AS_UNICODE(u)) #define __Pyx_PyUnicode_READ(k, d, i) ((void)(k), (Py_UCS4)(((Py_UNICODE*)d)[i])) #endif #if CYTHON_COMPILING_IN_PYPY #define __Pyx_PyUnicode_Concat(a, b) PyNumber_Add(a, b) #define __Pyx_PyUnicode_ConcatSafe(a, b) PyNumber_Add(a, b) #else #define __Pyx_PyUnicode_Concat(a, b) PyUnicode_Concat(a, b) #define __Pyx_PyUnicode_ConcatSafe(a, b) ((unlikely((a) == Py_None) || unlikely((b) == Py_None)) ?\ PyNumber_Add(a, b) : __Pyx_PyUnicode_Concat(a, b)) #endif #if CYTHON_COMPILING_IN_PYPY && !defined(PyUnicode_Contains) #define PyUnicode_Contains(u, s) PySequence_Contains(u, s) #endif #define __Pyx_PyString_FormatSafe(a, b) ((unlikely((a) == Py_None)) ? PyNumber_Remainder(a, b) : __Pyx_PyString_Format(a, b)) #define __Pyx_PyUnicode_FormatSafe(a, b) ((unlikely((a) == Py_None)) ? PyNumber_Remainder(a, b) : PyUnicode_Format(a, b)) #if PY_MAJOR_VERSION >= 3 #define __Pyx_PyString_Format(a, b) PyUnicode_Format(a, b) #else #define __Pyx_PyString_Format(a, b) PyString_Format(a, b) #endif #if PY_MAJOR_VERSION >= 3 #define PyBaseString_Type PyUnicode_Type #define PyStringObject PyUnicodeObject #define PyString_Type PyUnicode_Type #define PyString_Check PyUnicode_Check #define PyString_CheckExact PyUnicode_CheckExact #endif #if PY_MAJOR_VERSION >= 3 #define __Pyx_PyBaseString_Check(obj) PyUnicode_Check(obj) #define __Pyx_PyBaseString_CheckExact(obj) PyUnicode_CheckExact(obj) #else #define __Pyx_PyBaseString_Check(obj) (PyString_Check(obj) || PyUnicode_Check(obj)) #define __Pyx_PyBaseString_CheckExact(obj) (PyString_CheckExact(obj) || PyUnicode_CheckExact(obj)) #endif #ifndef PySet_CheckExact #define PySet_CheckExact(obj) (Py_TYPE(obj) == &PySet_Type) #endif #define __Pyx_TypeCheck(obj, type) PyObject_TypeCheck(obj, (PyTypeObject *)type) #if PY_MAJOR_VERSION >= 3 #define PyIntObject PyLongObject #define PyInt_Type PyLong_Type #define PyInt_Check(op) PyLong_Check(op) #define PyInt_CheckExact(op) PyLong_CheckExact(op) #define PyInt_FromString PyLong_FromString #define PyInt_FromUnicode PyLong_FromUnicode #define PyInt_FromLong PyLong_FromLong #define PyInt_FromSize_t PyLong_FromSize_t #define PyInt_FromSsize_t PyLong_FromSsize_t #define PyInt_AsLong PyLong_AsLong #define PyInt_AS_LONG PyLong_AS_LONG #define PyInt_AsSsize_t PyLong_AsSsize_t #define PyInt_AsUnsignedLongMask PyLong_AsUnsignedLongMask #define PyInt_AsUnsignedLongLongMask PyLong_AsUnsignedLongLongMask #define PyNumber_Int PyNumber_Long #endif #if PY_MAJOR_VERSION >= 3 #define PyBoolObject PyLongObject #endif #if PY_MAJOR_VERSION >= 3 && CYTHON_COMPILING_IN_PYPY #ifndef PyUnicode_InternFromString #define PyUnicode_InternFromString(s) PyUnicode_FromString(s) #endif #endif #if PY_VERSION_HEX < 0x030200A4 typedef long Py_hash_t; #define __Pyx_PyInt_FromHash_t PyInt_FromLong #define __Pyx_PyInt_AsHash_t PyInt_AsLong #else #define __Pyx_PyInt_FromHash_t PyInt_FromSsize_t #define __Pyx_PyInt_AsHash_t PyInt_AsSsize_t #endif #if PY_MAJOR_VERSION >= 3 #define __Pyx_PyMethod_New(func, self, klass) ((self) ? PyMethod_New(func, self) : PyInstanceMethod_New(func)) #else #define __Pyx_PyMethod_New(func, self, klass) PyMethod_New(func, self, klass) #endif #if PY_VERSION_HEX >= 0x030500B1 #define __Pyx_PyAsyncMethodsStruct PyAsyncMethods #define __Pyx_PyType_AsAsync(obj) (Py_TYPE(obj)->tp_as_async) #elif CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3 typedef struct { unaryfunc am_await; unaryfunc am_aiter; unaryfunc am_anext; } __Pyx_PyAsyncMethodsStruct; #define __Pyx_PyType_AsAsync(obj) ((__Pyx_PyAsyncMethodsStruct*) (Py_TYPE(obj)->tp_reserved)) #else #define __Pyx_PyType_AsAsync(obj) NULL #endif #ifndef CYTHON_RESTRICT #if defined(__GNUC__) #define CYTHON_RESTRICT __restrict__ #elif defined(_MSC_VER) && _MSC_VER >= 1400 #define CYTHON_RESTRICT __restrict #elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L #define CYTHON_RESTRICT restrict #else #define CYTHON_RESTRICT #endif #endif #define __Pyx_void_to_None(void_result) ((void)(void_result), Py_INCREF(Py_None), Py_None) #ifndef CYTHON_INLINE #if defined(__GNUC__) #define CYTHON_INLINE __inline__ #elif defined(_MSC_VER) #define CYTHON_INLINE __inline #elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L #define CYTHON_INLINE inline #else #define CYTHON_INLINE #endif #endif #if defined(WIN32) || defined(MS_WINDOWS) #define _USE_MATH_DEFINES #endif #include #ifdef NAN #define __PYX_NAN() ((float) NAN) #else static CYTHON_INLINE float __PYX_NAN() { float value; memset(&value, 0xFF, sizeof(value)); return value; } #endif #if PY_MAJOR_VERSION >= 3 #define __Pyx_PyNumber_Divide(x,y) PyNumber_TrueDivide(x,y) #define __Pyx_PyNumber_InPlaceDivide(x,y) PyNumber_InPlaceTrueDivide(x,y) #else #define __Pyx_PyNumber_Divide(x,y) PyNumber_Divide(x,y) #define __Pyx_PyNumber_InPlaceDivide(x,y) PyNumber_InPlaceDivide(x,y) #endif #ifndef __PYX_EXTERN_C #ifdef __cplusplus #define __PYX_EXTERN_C extern "C" #else #define __PYX_EXTERN_C extern #endif #endif #define __PYX_HAVE__pygame_sdl2__joystick #define __PYX_HAVE_API__pygame_sdl2__joystick #include "stdint.h" #include "string.h" #include "stdio.h" #include "stddef.h" #include "SDL.h" #ifdef _OPENMP #include #endif /* _OPENMP */ #ifdef PYREX_WITHOUT_ASSERTIONS #define CYTHON_WITHOUT_ASSERTIONS #endif #ifndef CYTHON_UNUSED # if defined(__GNUC__) # if !(defined(__cplusplus)) || (__GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 4)) # define CYTHON_UNUSED __attribute__ ((__unused__)) # else # define CYTHON_UNUSED # endif # elif defined(__ICC) || (defined(__INTEL_COMPILER) && !defined(_MSC_VER)) # define CYTHON_UNUSED __attribute__ ((__unused__)) # else # define CYTHON_UNUSED # endif #endif #ifndef CYTHON_NCP_UNUSED # if CYTHON_COMPILING_IN_CPYTHON # define CYTHON_NCP_UNUSED # else # define CYTHON_NCP_UNUSED CYTHON_UNUSED # endif #endif typedef struct {PyObject **p; char *s; const Py_ssize_t n; const char* encoding; const char is_unicode; const char is_str; const char intern; } __Pyx_StringTabEntry; #define __PYX_DEFAULT_STRING_ENCODING_IS_ASCII 0 #define __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT 0 #define __PYX_DEFAULT_STRING_ENCODING "" #define __Pyx_PyObject_FromString __Pyx_PyBytes_FromString #define __Pyx_PyObject_FromStringAndSize __Pyx_PyBytes_FromStringAndSize #define __Pyx_uchar_cast(c) ((unsigned char)c) #define __Pyx_long_cast(x) ((long)x) #define __Pyx_fits_Py_ssize_t(v, type, is_signed) (\ (sizeof(type) < sizeof(Py_ssize_t)) ||\ (sizeof(type) > sizeof(Py_ssize_t) &&\ likely(v < (type)PY_SSIZE_T_MAX ||\ v == (type)PY_SSIZE_T_MAX) &&\ (!is_signed || likely(v > (type)PY_SSIZE_T_MIN ||\ v == (type)PY_SSIZE_T_MIN))) ||\ (sizeof(type) == sizeof(Py_ssize_t) &&\ (is_signed || likely(v < (type)PY_SSIZE_T_MAX ||\ v == (type)PY_SSIZE_T_MAX))) ) #if defined (__cplusplus) && __cplusplus >= 201103L #include #define __Pyx_sst_abs(value) std::abs(value) #elif SIZEOF_INT >= SIZEOF_SIZE_T #define __Pyx_sst_abs(value) abs(value) #elif SIZEOF_LONG >= SIZEOF_SIZE_T #define __Pyx_sst_abs(value) labs(value) #elif defined (_MSC_VER) && defined (_M_X64) #define __Pyx_sst_abs(value) _abs64(value) #elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L #define __Pyx_sst_abs(value) llabs(value) #elif defined (__GNUC__) #define __Pyx_sst_abs(value) __builtin_llabs(value) #else #define __Pyx_sst_abs(value) ((value<0) ? -value : value) #endif static CYTHON_INLINE char* __Pyx_PyObject_AsString(PyObject*); static CYTHON_INLINE char* __Pyx_PyObject_AsStringAndSize(PyObject*, Py_ssize_t* length); #define __Pyx_PyByteArray_FromString(s) PyByteArray_FromStringAndSize((const char*)s, strlen((const char*)s)) #define __Pyx_PyByteArray_FromStringAndSize(s, l) PyByteArray_FromStringAndSize((const char*)s, l) #define __Pyx_PyBytes_FromString PyBytes_FromString #define __Pyx_PyBytes_FromStringAndSize PyBytes_FromStringAndSize static CYTHON_INLINE PyObject* __Pyx_PyUnicode_FromString(const char*); #if PY_MAJOR_VERSION < 3 #define __Pyx_PyStr_FromString __Pyx_PyBytes_FromString #define __Pyx_PyStr_FromStringAndSize __Pyx_PyBytes_FromStringAndSize #else #define __Pyx_PyStr_FromString __Pyx_PyUnicode_FromString #define __Pyx_PyStr_FromStringAndSize __Pyx_PyUnicode_FromStringAndSize #endif #define __Pyx_PyObject_AsSString(s) ((signed char*) __Pyx_PyObject_AsString(s)) #define __Pyx_PyObject_AsUString(s) ((unsigned char*) __Pyx_PyObject_AsString(s)) #define __Pyx_PyObject_FromCString(s) __Pyx_PyObject_FromString((const char*)s) #define __Pyx_PyBytes_FromCString(s) __Pyx_PyBytes_FromString((const char*)s) #define __Pyx_PyByteArray_FromCString(s) __Pyx_PyByteArray_FromString((const char*)s) #define __Pyx_PyStr_FromCString(s) __Pyx_PyStr_FromString((const char*)s) #define __Pyx_PyUnicode_FromCString(s) __Pyx_PyUnicode_FromString((const char*)s) #if PY_MAJOR_VERSION < 3 static CYTHON_INLINE size_t __Pyx_Py_UNICODE_strlen(const Py_UNICODE *u) { const Py_UNICODE *u_end = u; while (*u_end++) ; return (size_t)(u_end - u - 1); } #else #define __Pyx_Py_UNICODE_strlen Py_UNICODE_strlen #endif #define __Pyx_PyUnicode_FromUnicode(u) PyUnicode_FromUnicode(u, __Pyx_Py_UNICODE_strlen(u)) #define __Pyx_PyUnicode_FromUnicodeAndLength PyUnicode_FromUnicode #define __Pyx_PyUnicode_AsUnicode PyUnicode_AsUnicode #define __Pyx_NewRef(obj) (Py_INCREF(obj), obj) #define __Pyx_Owned_Py_None(b) __Pyx_NewRef(Py_None) #define __Pyx_PyBool_FromLong(b) ((b) ? __Pyx_NewRef(Py_True) : __Pyx_NewRef(Py_False)) static CYTHON_INLINE int __Pyx_PyObject_IsTrue(PyObject*); static CYTHON_INLINE PyObject* __Pyx_PyNumber_Int(PyObject* x); static CYTHON_INLINE Py_ssize_t __Pyx_PyIndex_AsSsize_t(PyObject*); static CYTHON_INLINE PyObject * __Pyx_PyInt_FromSize_t(size_t); #if CYTHON_COMPILING_IN_CPYTHON #define __pyx_PyFloat_AsDouble(x) (PyFloat_CheckExact(x) ? PyFloat_AS_DOUBLE(x) : PyFloat_AsDouble(x)) #else #define __pyx_PyFloat_AsDouble(x) PyFloat_AsDouble(x) #endif #define __pyx_PyFloat_AsFloat(x) ((float) __pyx_PyFloat_AsDouble(x)) #if PY_MAJOR_VERSION < 3 && __PYX_DEFAULT_STRING_ENCODING_IS_ASCII static int __Pyx_sys_getdefaultencoding_not_ascii; static int __Pyx_init_sys_getdefaultencoding_params(void) { PyObject* sys; PyObject* default_encoding = NULL; PyObject* ascii_chars_u = NULL; PyObject* ascii_chars_b = NULL; const char* default_encoding_c; sys = PyImport_ImportModule("sys"); if (!sys) goto bad; default_encoding = PyObject_CallMethod(sys, (char*) "getdefaultencoding", NULL); Py_DECREF(sys); if (!default_encoding) goto bad; default_encoding_c = PyBytes_AsString(default_encoding); if (!default_encoding_c) goto bad; if (strcmp(default_encoding_c, "ascii") == 0) { __Pyx_sys_getdefaultencoding_not_ascii = 0; } else { char ascii_chars[128]; int c; for (c = 0; c < 128; c++) { ascii_chars[c] = c; } __Pyx_sys_getdefaultencoding_not_ascii = 1; ascii_chars_u = PyUnicode_DecodeASCII(ascii_chars, 128, NULL); if (!ascii_chars_u) goto bad; ascii_chars_b = PyUnicode_AsEncodedString(ascii_chars_u, default_encoding_c, NULL); if (!ascii_chars_b || !PyBytes_Check(ascii_chars_b) || memcmp(ascii_chars, PyBytes_AS_STRING(ascii_chars_b), 128) != 0) { PyErr_Format( PyExc_ValueError, "This module compiled with c_string_encoding=ascii, but default encoding '%.200s' is not a superset of ascii.", default_encoding_c); goto bad; } Py_DECREF(ascii_chars_u); Py_DECREF(ascii_chars_b); } Py_DECREF(default_encoding); return 0; bad: Py_XDECREF(default_encoding); Py_XDECREF(ascii_chars_u); Py_XDECREF(ascii_chars_b); return -1; } #endif #if __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT && PY_MAJOR_VERSION >= 3 #define __Pyx_PyUnicode_FromStringAndSize(c_str, size) PyUnicode_DecodeUTF8(c_str, size, NULL) #else #define __Pyx_PyUnicode_FromStringAndSize(c_str, size) PyUnicode_Decode(c_str, size, __PYX_DEFAULT_STRING_ENCODING, NULL) #if __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT static char* __PYX_DEFAULT_STRING_ENCODING; static int __Pyx_init_sys_getdefaultencoding_params(void) { PyObject* sys; PyObject* default_encoding = NULL; char* default_encoding_c; sys = PyImport_ImportModule("sys"); if (!sys) goto bad; default_encoding = PyObject_CallMethod(sys, (char*) (const char*) "getdefaultencoding", NULL); Py_DECREF(sys); if (!default_encoding) goto bad; default_encoding_c = PyBytes_AsString(default_encoding); if (!default_encoding_c) goto bad; __PYX_DEFAULT_STRING_ENCODING = (char*) malloc(strlen(default_encoding_c)); if (!__PYX_DEFAULT_STRING_ENCODING) goto bad; strcpy(__PYX_DEFAULT_STRING_ENCODING, default_encoding_c); Py_DECREF(default_encoding); return 0; bad: Py_XDECREF(default_encoding); return -1; } #endif #endif /* Test for GCC > 2.95 */ #if defined(__GNUC__) && (__GNUC__ > 2 || (__GNUC__ == 2 && (__GNUC_MINOR__ > 95))) #define likely(x) __builtin_expect(!!(x), 1) #define unlikely(x) __builtin_expect(!!(x), 0) #else /* !__GNUC__ or GCC < 2.95 */ #define likely(x) (x) #define unlikely(x) (x) #endif /* __GNUC__ */ static PyObject *__pyx_m; static PyObject *__pyx_d; static PyObject *__pyx_b; static PyObject *__pyx_empty_tuple; static PyObject *__pyx_empty_bytes; static int __pyx_lineno; static int __pyx_clineno = 0; static const char * __pyx_cfilenm= __FILE__; static const char *__pyx_filename; static const char *__pyx_f[] = { "src/pygame_sdl2/joystick.pyx", }; /*--- Type declarations ---*/ struct __pyx_obj_11pygame_sdl2_8joystick_Joystick; /* "pygame_sdl2/joystick.pyx":41 * * * cdef class Joystick: # <<<<<<<<<<<<<< * # Allow weak references. * cdef object __weakref__ */ struct __pyx_obj_11pygame_sdl2_8joystick_Joystick { PyObject_HEAD PyObject *__weakref__; SDL_Joystick *joystick; int joyid; }; /* --- Runtime support code (head) --- */ #ifndef CYTHON_REFNANNY #define CYTHON_REFNANNY 0 #endif #if CYTHON_REFNANNY typedef struct { void (*INCREF)(void*, PyObject*, int); void (*DECREF)(void*, PyObject*, int); void (*GOTREF)(void*, PyObject*, int); void (*GIVEREF)(void*, PyObject*, int); void* (*SetupContext)(const char*, int, const char*); void (*FinishContext)(void**); } __Pyx_RefNannyAPIStruct; static __Pyx_RefNannyAPIStruct *__Pyx_RefNanny = NULL; static __Pyx_RefNannyAPIStruct *__Pyx_RefNannyImportAPI(const char *modname); #define __Pyx_RefNannyDeclarations void *__pyx_refnanny = NULL; #ifdef WITH_THREAD #define __Pyx_RefNannySetupContext(name, acquire_gil)\ if (acquire_gil) {\ PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure();\ __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), __LINE__, __FILE__);\ PyGILState_Release(__pyx_gilstate_save);\ } else {\ __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), __LINE__, __FILE__);\ } #else #define __Pyx_RefNannySetupContext(name, acquire_gil)\ __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), __LINE__, __FILE__) #endif #define __Pyx_RefNannyFinishContext()\ __Pyx_RefNanny->FinishContext(&__pyx_refnanny) #define __Pyx_INCREF(r) __Pyx_RefNanny->INCREF(__pyx_refnanny, (PyObject *)(r), __LINE__) #define __Pyx_DECREF(r) __Pyx_RefNanny->DECREF(__pyx_refnanny, (PyObject *)(r), __LINE__) #define __Pyx_GOTREF(r) __Pyx_RefNanny->GOTREF(__pyx_refnanny, (PyObject *)(r), __LINE__) #define __Pyx_GIVEREF(r) __Pyx_RefNanny->GIVEREF(__pyx_refnanny, (PyObject *)(r), __LINE__) #define __Pyx_XINCREF(r) do { if((r) != NULL) {__Pyx_INCREF(r); }} while(0) #define __Pyx_XDECREF(r) do { if((r) != NULL) {__Pyx_DECREF(r); }} while(0) #define __Pyx_XGOTREF(r) do { if((r) != NULL) {__Pyx_GOTREF(r); }} while(0) #define __Pyx_XGIVEREF(r) do { if((r) != NULL) {__Pyx_GIVEREF(r);}} while(0) #else #define __Pyx_RefNannyDeclarations #define __Pyx_RefNannySetupContext(name, acquire_gil) #define __Pyx_RefNannyFinishContext() #define __Pyx_INCREF(r) Py_INCREF(r) #define __Pyx_DECREF(r) Py_DECREF(r) #define __Pyx_GOTREF(r) #define __Pyx_GIVEREF(r) #define __Pyx_XINCREF(r) Py_XINCREF(r) #define __Pyx_XDECREF(r) Py_XDECREF(r) #define __Pyx_XGOTREF(r) #define __Pyx_XGIVEREF(r) #endif #define __Pyx_XDECREF_SET(r, v) do {\ PyObject *tmp = (PyObject *) r;\ r = v; __Pyx_XDECREF(tmp);\ } while (0) #define __Pyx_DECREF_SET(r, v) do {\ PyObject *tmp = (PyObject *) r;\ r = v; __Pyx_DECREF(tmp);\ } while (0) #define __Pyx_CLEAR(r) do { PyObject* tmp = ((PyObject*)(r)); r = NULL; __Pyx_DECREF(tmp);} while(0) #define __Pyx_XCLEAR(r) do { if((r) != NULL) {PyObject* tmp = ((PyObject*)(r)); r = NULL; __Pyx_DECREF(tmp);}} while(0) #if CYTHON_COMPILING_IN_CPYTHON static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStr(PyObject* obj, PyObject* attr_name) { PyTypeObject* tp = Py_TYPE(obj); if (likely(tp->tp_getattro)) return tp->tp_getattro(obj, attr_name); #if PY_MAJOR_VERSION < 3 if (likely(tp->tp_getattr)) return tp->tp_getattr(obj, PyString_AS_STRING(attr_name)); #endif return PyObject_GetAttr(obj, attr_name); } #else #define __Pyx_PyObject_GetAttrStr(o,n) PyObject_GetAttr(o,n) #endif static PyObject *__Pyx_GetBuiltinName(PyObject *name); static CYTHON_INLINE PyObject *__Pyx_GetModuleGlobalName(PyObject *name); #if CYTHON_COMPILING_IN_CPYTHON static CYTHON_INLINE PyObject* __Pyx_PyObject_Call(PyObject *func, PyObject *arg, PyObject *kw); #else #define __Pyx_PyObject_Call(func, arg, kw) PyObject_Call(func, arg, kw) #endif #if CYTHON_COMPILING_IN_CPYTHON static CYTHON_INLINE PyObject* __Pyx_PyObject_CallMethO(PyObject *func, PyObject *arg); #endif static CYTHON_INLINE PyObject* __Pyx_PyObject_CallOneArg(PyObject *func, PyObject *arg); #if CYTHON_COMPILING_IN_CPYTHON static CYTHON_INLINE PyObject* __Pyx_PyObject_CallNoArg(PyObject *func); #else #define __Pyx_PyObject_CallNoArg(func) __Pyx_PyObject_Call(func, __pyx_empty_tuple, NULL) #endif static CYTHON_INLINE void __Pyx_ErrRestore(PyObject *type, PyObject *value, PyObject *tb); static CYTHON_INLINE void __Pyx_ErrFetch(PyObject **type, PyObject **value, PyObject **tb); static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, PyObject *cause); static void __Pyx_RaiseArgtupleInvalid(const char* func_name, int exact, Py_ssize_t num_min, Py_ssize_t num_max, Py_ssize_t num_found); static CYTHON_INLINE int __Pyx_CheckKeywordStrings(PyObject *kwdict, const char* function_name, int kw_allowed); static void __Pyx_RaiseDoubleKeywordsError(const char* func_name, PyObject* kw_name); static int __Pyx_ParseOptionalKeywords(PyObject *kwds, PyObject **argnames[],\ PyObject *kwds2, PyObject *values[], Py_ssize_t num_pos_args,\ const char* function_name); static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list, int level); static PyObject* __Pyx_ImportFrom(PyObject* module, PyObject* name); typedef struct { int code_line; PyCodeObject* code_object; } __Pyx_CodeObjectCacheEntry; struct __Pyx_CodeObjectCache { int count; int max_count; __Pyx_CodeObjectCacheEntry* entries; }; static struct __Pyx_CodeObjectCache __pyx_code_cache = {0,0,NULL}; static int __pyx_bisect_code_objects(__Pyx_CodeObjectCacheEntry* entries, int count, int code_line); static PyCodeObject *__pyx_find_code_object(int code_line); static void __pyx_insert_code_object(int code_line, PyCodeObject* code_object); static void __Pyx_AddTraceback(const char *funcname, int c_line, int py_line, const char *filename); static CYTHON_INLINE PyObject* __Pyx_PyInt_From_int(int value); static CYTHON_INLINE int __Pyx_PyInt_As_int(PyObject *); static CYTHON_INLINE PyObject* __Pyx_PyInt_From_int32_t(int32_t value); static CYTHON_INLINE PyObject* __Pyx_PyInt_From_long(long value); static CYTHON_INLINE long __Pyx_PyInt_As_long(PyObject *); static int __Pyx_check_binary_version(void); static int __Pyx_InitStrings(__Pyx_StringTabEntry *t); /* Module declarations from 'libc.stdint' */ /* Module declarations from 'libc.string' */ /* Module declarations from 'libc.stdio' */ /* Module declarations from 'libc.stddef' */ /* Module declarations from 'sdl2' */ /* Module declarations from 'pygame_sdl2.joystick' */ static PyTypeObject *__pyx_ptype_11pygame_sdl2_8joystick_Joystick = 0; #define __Pyx_MODULE_NAME "pygame_sdl2.joystick" int __pyx_module_is_main_pygame_sdl2__joystick = 0; /* Implementation of 'pygame_sdl2.joystick' */ static char __pyx_k_id[] = "id"; static char __pyx_k_init[] = "init"; static char __pyx_k_main[] = "__main__"; static char __pyx_k_quit[] = "quit"; static char __pyx_k_test[] = "__test__"; static char __pyx_k_error[] = "error"; static char __pyx_k_import[] = "__import__"; static char __pyx_k_display[] = "display"; static char __pyx_k_get_init[] = "get_init"; static char __pyx_k_get_count[] = "get_count"; static char __pyx_k_pygame_sdl2[] = "pygame_sdl2"; static char __pyx_k_register_init[] = "register_init"; static char __pyx_k_register_quit[] = "register_quit"; static char __pyx_k_sdl_main_init[] = "sdl_main_init"; static char __pyx_k_pygame_sdl2_error[] = "pygame_sdl2.error"; static char __pyx_k_pygame_sdl2_joystick[] = "pygame_sdl2.joystick"; static char __pyx_k_joystick_not_initialized[] = "joystick not initialized"; static char __pyx_k_home_tom_ab_pygame_sdl2_src_pyg[] = "/home/tom/ab/pygame_sdl2/src/pygame_sdl2/joystick.pyx"; static PyObject *__pyx_n_s_display; static PyObject *__pyx_n_s_error; static PyObject *__pyx_n_s_get_count; static PyObject *__pyx_n_s_get_init; static PyObject *__pyx_kp_s_home_tom_ab_pygame_sdl2_src_pyg; static PyObject *__pyx_n_s_id; static PyObject *__pyx_n_s_import; static PyObject *__pyx_n_s_init; static PyObject *__pyx_kp_s_joystick_not_initialized; static PyObject *__pyx_n_s_main; static PyObject *__pyx_n_s_pygame_sdl2; static PyObject *__pyx_n_s_pygame_sdl2_error; static PyObject *__pyx_n_s_pygame_sdl2_joystick; static PyObject *__pyx_n_s_quit; static PyObject *__pyx_n_s_register_init; static PyObject *__pyx_n_s_register_quit; static PyObject *__pyx_n_s_sdl_main_init; static PyObject *__pyx_n_s_test; static PyObject *__pyx_pf_11pygame_sdl2_8joystick_init(CYTHON_UNUSED PyObject *__pyx_self); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_8joystick_2quit(CYTHON_UNUSED PyObject *__pyx_self); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_8joystick_4get_init(CYTHON_UNUSED PyObject *__pyx_self); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_8joystick_6get_count(CYTHON_UNUSED PyObject *__pyx_self); /* proto */ static int __pyx_pf_11pygame_sdl2_8joystick_8Joystick___cinit__(struct __pyx_obj_11pygame_sdl2_8joystick_Joystick *__pyx_v_self); /* proto */ static int __pyx_pf_11pygame_sdl2_8joystick_8Joystick_2__init__(struct __pyx_obj_11pygame_sdl2_8joystick_Joystick *__pyx_v_self, PyObject *__pyx_v_id); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_8joystick_8Joystick_4init(struct __pyx_obj_11pygame_sdl2_8joystick_Joystick *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_8joystick_8Joystick_6quit(struct __pyx_obj_11pygame_sdl2_8joystick_Joystick *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_8joystick_8Joystick_8get_init(struct __pyx_obj_11pygame_sdl2_8joystick_Joystick *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_8joystick_8Joystick_10get_id(struct __pyx_obj_11pygame_sdl2_8joystick_Joystick *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_8joystick_8Joystick_12get_name(struct __pyx_obj_11pygame_sdl2_8joystick_Joystick *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_8joystick_8Joystick_14get_numaxes(struct __pyx_obj_11pygame_sdl2_8joystick_Joystick *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_8joystick_8Joystick_16get_numballs(struct __pyx_obj_11pygame_sdl2_8joystick_Joystick *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_8joystick_8Joystick_18get_numbuttons(struct __pyx_obj_11pygame_sdl2_8joystick_Joystick *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_8joystick_8Joystick_20get_numhats(struct __pyx_obj_11pygame_sdl2_8joystick_Joystick *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_8joystick_8Joystick_22get_axis(struct __pyx_obj_11pygame_sdl2_8joystick_Joystick *__pyx_v_self, PyObject *__pyx_v_axis_number); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_8joystick_8Joystick_24get_ball(struct __pyx_obj_11pygame_sdl2_8joystick_Joystick *__pyx_v_self, PyObject *__pyx_v_ball_number); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_8joystick_8Joystick_26get_button(struct __pyx_obj_11pygame_sdl2_8joystick_Joystick *__pyx_v_self, PyObject *__pyx_v_button); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_8joystick_8Joystick_28get_hat(struct __pyx_obj_11pygame_sdl2_8joystick_Joystick *__pyx_v_self, PyObject *__pyx_v_hat_number); /* proto */ static PyObject *__pyx_tp_new_11pygame_sdl2_8joystick_Joystick(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ static PyObject *__pyx_tuple_; static PyObject *__pyx_tuple__2; static PyObject *__pyx_tuple__3; static PyObject *__pyx_tuple__4; static PyObject *__pyx_tuple__5; static PyObject *__pyx_tuple__6; static PyObject *__pyx_tuple__7; static PyObject *__pyx_tuple__8; static PyObject *__pyx_tuple__9; static PyObject *__pyx_tuple__10; static PyObject *__pyx_codeobj__11; static PyObject *__pyx_codeobj__12; static PyObject *__pyx_codeobj__13; static PyObject *__pyx_codeobj__14; /* "pygame_sdl2/joystick.pyx":24 * * @pygame_sdl2.register_init * def init(): # <<<<<<<<<<<<<< * pygame_sdl2.display.sdl_main_init() * */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_8joystick_1init(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused); /*proto*/ static PyMethodDef __pyx_mdef_11pygame_sdl2_8joystick_1init = {"init", (PyCFunction)__pyx_pw_11pygame_sdl2_8joystick_1init, METH_NOARGS, 0}; static PyObject *__pyx_pw_11pygame_sdl2_8joystick_1init(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("init (wrapper)", 0); __pyx_r = __pyx_pf_11pygame_sdl2_8joystick_init(__pyx_self); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_8joystick_init(CYTHON_UNUSED PyObject *__pyx_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; int __pyx_t_4; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("init", 0); /* "pygame_sdl2/joystick.pyx":25 * @pygame_sdl2.register_init * def init(): * pygame_sdl2.display.sdl_main_init() # <<<<<<<<<<<<<< * * if SDL_InitSubSystem(SDL_INIT_JOYSTICK): */ __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_pygame_sdl2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 25; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_display); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 25; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_sdl_main_init); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 25; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_3 = NULL; if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_2))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); if (likely(__pyx_t_3)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); } } if (__pyx_t_3) { __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 25; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } else { __pyx_t_1 = __Pyx_PyObject_CallNoArg(__pyx_t_2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 25; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "pygame_sdl2/joystick.pyx":27 * pygame_sdl2.display.sdl_main_init() * * if SDL_InitSubSystem(SDL_INIT_JOYSTICK): # <<<<<<<<<<<<<< * raise error() * */ __pyx_t_4 = (SDL_InitSubSystem(SDL_INIT_JOYSTICK) != 0); if (__pyx_t_4) { /* "pygame_sdl2/joystick.pyx":28 * * if SDL_InitSubSystem(SDL_INIT_JOYSTICK): * raise error() # <<<<<<<<<<<<<< * * @pygame_sdl2.register_quit */ __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_error); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 28; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = NULL; if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_2))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); if (likely(__pyx_t_3)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); } } if (__pyx_t_3) { __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 28; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } else { __pyx_t_1 = __Pyx_PyObject_CallNoArg(__pyx_t_2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 28; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_Raise(__pyx_t_1, 0, 0, 0); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; {__pyx_filename = __pyx_f[0]; __pyx_lineno = 28; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "pygame_sdl2/joystick.pyx":27 * pygame_sdl2.display.sdl_main_init() * * if SDL_InitSubSystem(SDL_INIT_JOYSTICK): # <<<<<<<<<<<<<< * raise error() * */ } /* "pygame_sdl2/joystick.pyx":24 * * @pygame_sdl2.register_init * def init(): # <<<<<<<<<<<<<< * pygame_sdl2.display.sdl_main_init() * */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("pygame_sdl2.joystick.init", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/joystick.pyx":31 * * @pygame_sdl2.register_quit * def quit(): # @ReservedAssignment # <<<<<<<<<<<<<< * SDL_QuitSubSystem(SDL_INIT_JOYSTICK) * */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_8joystick_3quit(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused); /*proto*/ static PyMethodDef __pyx_mdef_11pygame_sdl2_8joystick_3quit = {"quit", (PyCFunction)__pyx_pw_11pygame_sdl2_8joystick_3quit, METH_NOARGS, 0}; static PyObject *__pyx_pw_11pygame_sdl2_8joystick_3quit(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("quit (wrapper)", 0); __pyx_r = __pyx_pf_11pygame_sdl2_8joystick_2quit(__pyx_self); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_8joystick_2quit(CYTHON_UNUSED PyObject *__pyx_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("quit", 0); /* "pygame_sdl2/joystick.pyx":32 * @pygame_sdl2.register_quit * def quit(): # @ReservedAssignment * SDL_QuitSubSystem(SDL_INIT_JOYSTICK) # <<<<<<<<<<<<<< * * def get_init(): */ SDL_QuitSubSystem(SDL_INIT_JOYSTICK); /* "pygame_sdl2/joystick.pyx":31 * * @pygame_sdl2.register_quit * def quit(): # @ReservedAssignment # <<<<<<<<<<<<<< * SDL_QuitSubSystem(SDL_INIT_JOYSTICK) * */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/joystick.pyx":34 * SDL_QuitSubSystem(SDL_INIT_JOYSTICK) * * def get_init(): # <<<<<<<<<<<<<< * return SDL_WasInit(SDL_INIT_JOYSTICK) != 0 * */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_8joystick_5get_init(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused); /*proto*/ static PyMethodDef __pyx_mdef_11pygame_sdl2_8joystick_5get_init = {"get_init", (PyCFunction)__pyx_pw_11pygame_sdl2_8joystick_5get_init, METH_NOARGS, 0}; static PyObject *__pyx_pw_11pygame_sdl2_8joystick_5get_init(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("get_init (wrapper)", 0); __pyx_r = __pyx_pf_11pygame_sdl2_8joystick_4get_init(__pyx_self); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_8joystick_4get_init(CYTHON_UNUSED PyObject *__pyx_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("get_init", 0); /* "pygame_sdl2/joystick.pyx":35 * * def get_init(): * return SDL_WasInit(SDL_INIT_JOYSTICK) != 0 # <<<<<<<<<<<<<< * * def get_count(): */ __Pyx_XDECREF(__pyx_r); __pyx_t_1 = __Pyx_PyBool_FromLong((SDL_WasInit(SDL_INIT_JOYSTICK) != 0)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 35; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "pygame_sdl2/joystick.pyx":34 * SDL_QuitSubSystem(SDL_INIT_JOYSTICK) * * def get_init(): # <<<<<<<<<<<<<< * return SDL_WasInit(SDL_INIT_JOYSTICK) != 0 * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("pygame_sdl2.joystick.get_init", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/joystick.pyx":37 * return SDL_WasInit(SDL_INIT_JOYSTICK) != 0 * * def get_count(): # <<<<<<<<<<<<<< * return SDL_NumJoysticks() * */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_8joystick_7get_count(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused); /*proto*/ static PyMethodDef __pyx_mdef_11pygame_sdl2_8joystick_7get_count = {"get_count", (PyCFunction)__pyx_pw_11pygame_sdl2_8joystick_7get_count, METH_NOARGS, 0}; static PyObject *__pyx_pw_11pygame_sdl2_8joystick_7get_count(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("get_count (wrapper)", 0); __pyx_r = __pyx_pf_11pygame_sdl2_8joystick_6get_count(__pyx_self); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_8joystick_6get_count(CYTHON_UNUSED PyObject *__pyx_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("get_count", 0); /* "pygame_sdl2/joystick.pyx":38 * * def get_count(): * return SDL_NumJoysticks() # <<<<<<<<<<<<<< * * */ __Pyx_XDECREF(__pyx_r); __pyx_t_1 = __Pyx_PyInt_From_int(SDL_NumJoysticks()); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 38; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "pygame_sdl2/joystick.pyx":37 * return SDL_WasInit(SDL_INIT_JOYSTICK) != 0 * * def get_count(): # <<<<<<<<<<<<<< * return SDL_NumJoysticks() * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("pygame_sdl2.joystick.get_count", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/joystick.pyx":48 * cdef int joyid * * def __cinit__(self): # <<<<<<<<<<<<<< * self.joystick = NULL * */ /* Python wrapper */ static int __pyx_pw_11pygame_sdl2_8joystick_8Joystick_1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static int __pyx_pw_11pygame_sdl2_8joystick_8Joystick_1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__cinit__ (wrapper)", 0); if (unlikely(PyTuple_GET_SIZE(__pyx_args) > 0)) { __Pyx_RaiseArgtupleInvalid("__cinit__", 1, 0, 0, PyTuple_GET_SIZE(__pyx_args)); return -1;} if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "__cinit__", 0))) return -1; __pyx_r = __pyx_pf_11pygame_sdl2_8joystick_8Joystick___cinit__(((struct __pyx_obj_11pygame_sdl2_8joystick_Joystick *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static int __pyx_pf_11pygame_sdl2_8joystick_8Joystick___cinit__(struct __pyx_obj_11pygame_sdl2_8joystick_Joystick *__pyx_v_self) { int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__cinit__", 0); /* "pygame_sdl2/joystick.pyx":49 * * def __cinit__(self): * self.joystick = NULL # <<<<<<<<<<<<<< * * def __init__(self, id): */ __pyx_v_self->joystick = NULL; /* "pygame_sdl2/joystick.pyx":48 * cdef int joyid * * def __cinit__(self): # <<<<<<<<<<<<<< * self.joystick = NULL * */ /* function exit code */ __pyx_r = 0; __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/joystick.pyx":51 * self.joystick = NULL * * def __init__(self, id): # <<<<<<<<<<<<<< * self.joyid = id * */ /* Python wrapper */ static int __pyx_pw_11pygame_sdl2_8joystick_8Joystick_3__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static int __pyx_pw_11pygame_sdl2_8joystick_8Joystick_3__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_id = 0; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__init__ (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_id,0}; PyObject* values[1] = {0}; if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_id)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__init__") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 51; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } } else if (PyTuple_GET_SIZE(__pyx_args) != 1) { goto __pyx_L5_argtuple_error; } else { values[0] = PyTuple_GET_ITEM(__pyx_args, 0); } __pyx_v_id = values[0]; } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("__init__", 1, 1, 1, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 51; __pyx_clineno = __LINE__; goto __pyx_L3_error;} __pyx_L3_error:; __Pyx_AddTraceback("pygame_sdl2.joystick.Joystick.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return -1; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_11pygame_sdl2_8joystick_8Joystick_2__init__(((struct __pyx_obj_11pygame_sdl2_8joystick_Joystick *)__pyx_v_self), __pyx_v_id); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static int __pyx_pf_11pygame_sdl2_8joystick_8Joystick_2__init__(struct __pyx_obj_11pygame_sdl2_8joystick_Joystick *__pyx_v_self, PyObject *__pyx_v_id) { int __pyx_r; __Pyx_RefNannyDeclarations int __pyx_t_1; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__init__", 0); /* "pygame_sdl2/joystick.pyx":52 * * def __init__(self, id): * self.joyid = id # <<<<<<<<<<<<<< * * def init(self): */ __pyx_t_1 = __Pyx_PyInt_As_int(__pyx_v_id); if (unlikely((__pyx_t_1 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 52; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_v_self->joyid = __pyx_t_1; /* "pygame_sdl2/joystick.pyx":51 * self.joystick = NULL * * def __init__(self, id): # <<<<<<<<<<<<<< * self.joyid = id * */ /* function exit code */ __pyx_r = 0; goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("pygame_sdl2.joystick.Joystick.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = -1; __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/joystick.pyx":54 * self.joyid = id * * def init(self): # <<<<<<<<<<<<<< * if self.joystick == NULL: * self.joystick = SDL_JoystickOpen(self.joyid) */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_8joystick_8Joystick_5init(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/ static PyObject *__pyx_pw_11pygame_sdl2_8joystick_8Joystick_5init(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("init (wrapper)", 0); __pyx_r = __pyx_pf_11pygame_sdl2_8joystick_8Joystick_4init(((struct __pyx_obj_11pygame_sdl2_8joystick_Joystick *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_8joystick_8Joystick_4init(struct __pyx_obj_11pygame_sdl2_8joystick_Joystick *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("init", 0); /* "pygame_sdl2/joystick.pyx":55 * * def init(self): * if self.joystick == NULL: # <<<<<<<<<<<<<< * self.joystick = SDL_JoystickOpen(self.joyid) * if self.joystick == NULL: */ __pyx_t_1 = ((__pyx_v_self->joystick == NULL) != 0); if (__pyx_t_1) { /* "pygame_sdl2/joystick.pyx":56 * def init(self): * if self.joystick == NULL: * self.joystick = SDL_JoystickOpen(self.joyid) # <<<<<<<<<<<<<< * if self.joystick == NULL: * raise error() */ __pyx_v_self->joystick = SDL_JoystickOpen(__pyx_v_self->joyid); /* "pygame_sdl2/joystick.pyx":57 * if self.joystick == NULL: * self.joystick = SDL_JoystickOpen(self.joyid) * if self.joystick == NULL: # <<<<<<<<<<<<<< * raise error() * */ __pyx_t_1 = ((__pyx_v_self->joystick == NULL) != 0); if (__pyx_t_1) { /* "pygame_sdl2/joystick.pyx":58 * self.joystick = SDL_JoystickOpen(self.joyid) * if self.joystick == NULL: * raise error() # <<<<<<<<<<<<<< * * def quit(self): # @ReservedAssignment */ __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_error); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 58; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = NULL; if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_3))) { __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3); if (likely(__pyx_t_4)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); __Pyx_INCREF(__pyx_t_4); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_3, function); } } if (__pyx_t_4) { __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 58; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; } else { __pyx_t_2 = __Pyx_PyObject_CallNoArg(__pyx_t_3); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 58; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_Raise(__pyx_t_2, 0, 0, 0); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; {__pyx_filename = __pyx_f[0]; __pyx_lineno = 58; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "pygame_sdl2/joystick.pyx":57 * if self.joystick == NULL: * self.joystick = SDL_JoystickOpen(self.joyid) * if self.joystick == NULL: # <<<<<<<<<<<<<< * raise error() * */ } /* "pygame_sdl2/joystick.pyx":55 * * def init(self): * if self.joystick == NULL: # <<<<<<<<<<<<<< * self.joystick = SDL_JoystickOpen(self.joyid) * if self.joystick == NULL: */ } /* "pygame_sdl2/joystick.pyx":54 * self.joyid = id * * def init(self): # <<<<<<<<<<<<<< * if self.joystick == NULL: * self.joystick = SDL_JoystickOpen(self.joyid) */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_AddTraceback("pygame_sdl2.joystick.Joystick.init", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/joystick.pyx":60 * raise error() * * def quit(self): # @ReservedAssignment # <<<<<<<<<<<<<< * if self.joystick != NULL: * SDL_JoystickClose(self.joystick) */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_8joystick_8Joystick_7quit(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/ static PyObject *__pyx_pw_11pygame_sdl2_8joystick_8Joystick_7quit(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("quit (wrapper)", 0); __pyx_r = __pyx_pf_11pygame_sdl2_8joystick_8Joystick_6quit(((struct __pyx_obj_11pygame_sdl2_8joystick_Joystick *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_8joystick_8Joystick_6quit(struct __pyx_obj_11pygame_sdl2_8joystick_Joystick *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; __Pyx_RefNannySetupContext("quit", 0); /* "pygame_sdl2/joystick.pyx":61 * * def quit(self): # @ReservedAssignment * if self.joystick != NULL: # <<<<<<<<<<<<<< * SDL_JoystickClose(self.joystick) * self.joystick = NULL */ __pyx_t_1 = ((__pyx_v_self->joystick != NULL) != 0); if (__pyx_t_1) { /* "pygame_sdl2/joystick.pyx":62 * def quit(self): # @ReservedAssignment * if self.joystick != NULL: * SDL_JoystickClose(self.joystick) # <<<<<<<<<<<<<< * self.joystick = NULL * */ SDL_JoystickClose(__pyx_v_self->joystick); /* "pygame_sdl2/joystick.pyx":63 * if self.joystick != NULL: * SDL_JoystickClose(self.joystick) * self.joystick = NULL # <<<<<<<<<<<<<< * * def get_init(self): */ __pyx_v_self->joystick = NULL; /* "pygame_sdl2/joystick.pyx":61 * * def quit(self): # @ReservedAssignment * if self.joystick != NULL: # <<<<<<<<<<<<<< * SDL_JoystickClose(self.joystick) * self.joystick = NULL */ } /* "pygame_sdl2/joystick.pyx":60 * raise error() * * def quit(self): # @ReservedAssignment # <<<<<<<<<<<<<< * if self.joystick != NULL: * SDL_JoystickClose(self.joystick) */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/joystick.pyx":65 * self.joystick = NULL * * def get_init(self): # <<<<<<<<<<<<<< * if self.joystick: * return True */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_8joystick_8Joystick_9get_init(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/ static PyObject *__pyx_pw_11pygame_sdl2_8joystick_8Joystick_9get_init(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("get_init (wrapper)", 0); __pyx_r = __pyx_pf_11pygame_sdl2_8joystick_8Joystick_8get_init(((struct __pyx_obj_11pygame_sdl2_8joystick_Joystick *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_8joystick_8Joystick_8get_init(struct __pyx_obj_11pygame_sdl2_8joystick_Joystick *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; __Pyx_RefNannySetupContext("get_init", 0); /* "pygame_sdl2/joystick.pyx":66 * * def get_init(self): * if self.joystick: # <<<<<<<<<<<<<< * return True * else: */ __pyx_t_1 = (__pyx_v_self->joystick != 0); if (__pyx_t_1) { /* "pygame_sdl2/joystick.pyx":67 * def get_init(self): * if self.joystick: * return True # <<<<<<<<<<<<<< * else: * return False */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(Py_True); __pyx_r = Py_True; goto __pyx_L0; /* "pygame_sdl2/joystick.pyx":66 * * def get_init(self): * if self.joystick: # <<<<<<<<<<<<<< * return True * else: */ } /* "pygame_sdl2/joystick.pyx":69 * return True * else: * return False # <<<<<<<<<<<<<< * * def get_id(self): */ /*else*/ { __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(Py_False); __pyx_r = Py_False; goto __pyx_L0; } /* "pygame_sdl2/joystick.pyx":65 * self.joystick = NULL * * def get_init(self): # <<<<<<<<<<<<<< * if self.joystick: * return True */ /* function exit code */ __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/joystick.pyx":71 * return False * * def get_id(self): # <<<<<<<<<<<<<< * if self.joystick == NULL: * raise error("joystick not initialized") */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_8joystick_8Joystick_11get_id(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/ static PyObject *__pyx_pw_11pygame_sdl2_8joystick_8Joystick_11get_id(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("get_id (wrapper)", 0); __pyx_r = __pyx_pf_11pygame_sdl2_8joystick_8Joystick_10get_id(((struct __pyx_obj_11pygame_sdl2_8joystick_Joystick *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_8joystick_8Joystick_10get_id(struct __pyx_obj_11pygame_sdl2_8joystick_Joystick *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("get_id", 0); /* "pygame_sdl2/joystick.pyx":72 * * def get_id(self): * if self.joystick == NULL: # <<<<<<<<<<<<<< * raise error("joystick not initialized") * */ __pyx_t_1 = ((__pyx_v_self->joystick == NULL) != 0); if (__pyx_t_1) { /* "pygame_sdl2/joystick.pyx":73 * def get_id(self): * if self.joystick == NULL: * raise error("joystick not initialized") # <<<<<<<<<<<<<< * * return SDL_JoystickInstanceID(self.joystick) */ __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_error); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 73; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_tuple_, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 73; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_Raise(__pyx_t_3, 0, 0, 0); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; {__pyx_filename = __pyx_f[0]; __pyx_lineno = 73; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "pygame_sdl2/joystick.pyx":72 * * def get_id(self): * if self.joystick == NULL: # <<<<<<<<<<<<<< * raise error("joystick not initialized") * */ } /* "pygame_sdl2/joystick.pyx":75 * raise error("joystick not initialized") * * return SDL_JoystickInstanceID(self.joystick) # <<<<<<<<<<<<<< * * def get_name(self): */ __Pyx_XDECREF(__pyx_r); __pyx_t_3 = __Pyx_PyInt_From_int32_t(SDL_JoystickInstanceID(__pyx_v_self->joystick)); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 75; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __pyx_r = __pyx_t_3; __pyx_t_3 = 0; goto __pyx_L0; /* "pygame_sdl2/joystick.pyx":71 * return False * * def get_id(self): # <<<<<<<<<<<<<< * if self.joystick == NULL: * raise error("joystick not initialized") */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("pygame_sdl2.joystick.Joystick.get_id", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/joystick.pyx":77 * return SDL_JoystickInstanceID(self.joystick) * * def get_name(self): # <<<<<<<<<<<<<< * cdef char *rv * */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_8joystick_8Joystick_13get_name(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/ static PyObject *__pyx_pw_11pygame_sdl2_8joystick_8Joystick_13get_name(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("get_name (wrapper)", 0); __pyx_r = __pyx_pf_11pygame_sdl2_8joystick_8Joystick_12get_name(((struct __pyx_obj_11pygame_sdl2_8joystick_Joystick *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_8joystick_8Joystick_12get_name(struct __pyx_obj_11pygame_sdl2_8joystick_Joystick *__pyx_v_self) { char *__pyx_v_rv; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("get_name", 0); /* "pygame_sdl2/joystick.pyx":80 * cdef char *rv * * if self.joystick == NULL: # <<<<<<<<<<<<<< * raise error("joystick not initialized") * */ __pyx_t_1 = ((__pyx_v_self->joystick == NULL) != 0); if (__pyx_t_1) { /* "pygame_sdl2/joystick.pyx":81 * * if self.joystick == NULL: * raise error("joystick not initialized") # <<<<<<<<<<<<<< * * rv = SDL_JoystickName(self.joystick) */ __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_error); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 81; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_tuple__2, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 81; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_Raise(__pyx_t_3, 0, 0, 0); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; {__pyx_filename = __pyx_f[0]; __pyx_lineno = 81; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "pygame_sdl2/joystick.pyx":80 * cdef char *rv * * if self.joystick == NULL: # <<<<<<<<<<<<<< * raise error("joystick not initialized") * */ } /* "pygame_sdl2/joystick.pyx":83 * raise error("joystick not initialized") * * rv = SDL_JoystickName(self.joystick) # <<<<<<<<<<<<<< * * if rv: */ __pyx_v_rv = SDL_JoystickName(__pyx_v_self->joystick); /* "pygame_sdl2/joystick.pyx":85 * rv = SDL_JoystickName(self.joystick) * * if rv: # <<<<<<<<<<<<<< * return rv * else: */ __pyx_t_1 = (__pyx_v_rv != 0); if (__pyx_t_1) { /* "pygame_sdl2/joystick.pyx":86 * * if rv: * return rv # <<<<<<<<<<<<<< * else: * return None */ __Pyx_XDECREF(__pyx_r); __pyx_t_3 = __Pyx_PyBytes_FromString(__pyx_v_rv); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 86; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __pyx_r = __pyx_t_3; __pyx_t_3 = 0; goto __pyx_L0; /* "pygame_sdl2/joystick.pyx":85 * rv = SDL_JoystickName(self.joystick) * * if rv: # <<<<<<<<<<<<<< * return rv * else: */ } /* "pygame_sdl2/joystick.pyx":88 * return rv * else: * return None # <<<<<<<<<<<<<< * * def get_numaxes(self): */ /*else*/ { __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(Py_None); __pyx_r = Py_None; goto __pyx_L0; } /* "pygame_sdl2/joystick.pyx":77 * return SDL_JoystickInstanceID(self.joystick) * * def get_name(self): # <<<<<<<<<<<<<< * cdef char *rv * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("pygame_sdl2.joystick.Joystick.get_name", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/joystick.pyx":90 * return None * * def get_numaxes(self): # <<<<<<<<<<<<<< * if self.joystick == NULL: * raise error("joystick not initialized") */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_8joystick_8Joystick_15get_numaxes(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/ static PyObject *__pyx_pw_11pygame_sdl2_8joystick_8Joystick_15get_numaxes(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("get_numaxes (wrapper)", 0); __pyx_r = __pyx_pf_11pygame_sdl2_8joystick_8Joystick_14get_numaxes(((struct __pyx_obj_11pygame_sdl2_8joystick_Joystick *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_8joystick_8Joystick_14get_numaxes(struct __pyx_obj_11pygame_sdl2_8joystick_Joystick *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("get_numaxes", 0); /* "pygame_sdl2/joystick.pyx":91 * * def get_numaxes(self): * if self.joystick == NULL: # <<<<<<<<<<<<<< * raise error("joystick not initialized") * */ __pyx_t_1 = ((__pyx_v_self->joystick == NULL) != 0); if (__pyx_t_1) { /* "pygame_sdl2/joystick.pyx":92 * def get_numaxes(self): * if self.joystick == NULL: * raise error("joystick not initialized") # <<<<<<<<<<<<<< * * return SDL_JoystickNumAxes(self.joystick) */ __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_error); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 92; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_tuple__3, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 92; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_Raise(__pyx_t_3, 0, 0, 0); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; {__pyx_filename = __pyx_f[0]; __pyx_lineno = 92; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "pygame_sdl2/joystick.pyx":91 * * def get_numaxes(self): * if self.joystick == NULL: # <<<<<<<<<<<<<< * raise error("joystick not initialized") * */ } /* "pygame_sdl2/joystick.pyx":94 * raise error("joystick not initialized") * * return SDL_JoystickNumAxes(self.joystick) # <<<<<<<<<<<<<< * * def get_numballs(self): */ __Pyx_XDECREF(__pyx_r); __pyx_t_3 = __Pyx_PyInt_From_int(SDL_JoystickNumAxes(__pyx_v_self->joystick)); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 94; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __pyx_r = __pyx_t_3; __pyx_t_3 = 0; goto __pyx_L0; /* "pygame_sdl2/joystick.pyx":90 * return None * * def get_numaxes(self): # <<<<<<<<<<<<<< * if self.joystick == NULL: * raise error("joystick not initialized") */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("pygame_sdl2.joystick.Joystick.get_numaxes", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/joystick.pyx":96 * return SDL_JoystickNumAxes(self.joystick) * * def get_numballs(self): # <<<<<<<<<<<<<< * if self.joystick == NULL: * raise error("joystick not initialized") */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_8joystick_8Joystick_17get_numballs(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/ static PyObject *__pyx_pw_11pygame_sdl2_8joystick_8Joystick_17get_numballs(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("get_numballs (wrapper)", 0); __pyx_r = __pyx_pf_11pygame_sdl2_8joystick_8Joystick_16get_numballs(((struct __pyx_obj_11pygame_sdl2_8joystick_Joystick *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_8joystick_8Joystick_16get_numballs(struct __pyx_obj_11pygame_sdl2_8joystick_Joystick *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("get_numballs", 0); /* "pygame_sdl2/joystick.pyx":97 * * def get_numballs(self): * if self.joystick == NULL: # <<<<<<<<<<<<<< * raise error("joystick not initialized") * */ __pyx_t_1 = ((__pyx_v_self->joystick == NULL) != 0); if (__pyx_t_1) { /* "pygame_sdl2/joystick.pyx":98 * def get_numballs(self): * if self.joystick == NULL: * raise error("joystick not initialized") # <<<<<<<<<<<<<< * * return SDL_JoystickNumBalls(self.joystick) */ __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_error); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 98; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_tuple__4, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 98; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_Raise(__pyx_t_3, 0, 0, 0); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; {__pyx_filename = __pyx_f[0]; __pyx_lineno = 98; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "pygame_sdl2/joystick.pyx":97 * * def get_numballs(self): * if self.joystick == NULL: # <<<<<<<<<<<<<< * raise error("joystick not initialized") * */ } /* "pygame_sdl2/joystick.pyx":100 * raise error("joystick not initialized") * * return SDL_JoystickNumBalls(self.joystick) # <<<<<<<<<<<<<< * * def get_numbuttons(self): */ __Pyx_XDECREF(__pyx_r); __pyx_t_3 = __Pyx_PyInt_From_int(SDL_JoystickNumBalls(__pyx_v_self->joystick)); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 100; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __pyx_r = __pyx_t_3; __pyx_t_3 = 0; goto __pyx_L0; /* "pygame_sdl2/joystick.pyx":96 * return SDL_JoystickNumAxes(self.joystick) * * def get_numballs(self): # <<<<<<<<<<<<<< * if self.joystick == NULL: * raise error("joystick not initialized") */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("pygame_sdl2.joystick.Joystick.get_numballs", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/joystick.pyx":102 * return SDL_JoystickNumBalls(self.joystick) * * def get_numbuttons(self): # <<<<<<<<<<<<<< * if self.joystick == NULL: * raise error("joystick not initialized") */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_8joystick_8Joystick_19get_numbuttons(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/ static PyObject *__pyx_pw_11pygame_sdl2_8joystick_8Joystick_19get_numbuttons(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("get_numbuttons (wrapper)", 0); __pyx_r = __pyx_pf_11pygame_sdl2_8joystick_8Joystick_18get_numbuttons(((struct __pyx_obj_11pygame_sdl2_8joystick_Joystick *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_8joystick_8Joystick_18get_numbuttons(struct __pyx_obj_11pygame_sdl2_8joystick_Joystick *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("get_numbuttons", 0); /* "pygame_sdl2/joystick.pyx":103 * * def get_numbuttons(self): * if self.joystick == NULL: # <<<<<<<<<<<<<< * raise error("joystick not initialized") * */ __pyx_t_1 = ((__pyx_v_self->joystick == NULL) != 0); if (__pyx_t_1) { /* "pygame_sdl2/joystick.pyx":104 * def get_numbuttons(self): * if self.joystick == NULL: * raise error("joystick not initialized") # <<<<<<<<<<<<<< * * return SDL_JoystickNumButtons(self.joystick) */ __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_error); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 104; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_tuple__5, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 104; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_Raise(__pyx_t_3, 0, 0, 0); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; {__pyx_filename = __pyx_f[0]; __pyx_lineno = 104; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "pygame_sdl2/joystick.pyx":103 * * def get_numbuttons(self): * if self.joystick == NULL: # <<<<<<<<<<<<<< * raise error("joystick not initialized") * */ } /* "pygame_sdl2/joystick.pyx":106 * raise error("joystick not initialized") * * return SDL_JoystickNumButtons(self.joystick) # <<<<<<<<<<<<<< * * def get_numhats(self): */ __Pyx_XDECREF(__pyx_r); __pyx_t_3 = __Pyx_PyInt_From_int(SDL_JoystickNumButtons(__pyx_v_self->joystick)); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 106; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __pyx_r = __pyx_t_3; __pyx_t_3 = 0; goto __pyx_L0; /* "pygame_sdl2/joystick.pyx":102 * return SDL_JoystickNumBalls(self.joystick) * * def get_numbuttons(self): # <<<<<<<<<<<<<< * if self.joystick == NULL: * raise error("joystick not initialized") */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("pygame_sdl2.joystick.Joystick.get_numbuttons", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/joystick.pyx":108 * return SDL_JoystickNumButtons(self.joystick) * * def get_numhats(self): # <<<<<<<<<<<<<< * if self.joystick == NULL: * raise error("joystick not initialized") */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_8joystick_8Joystick_21get_numhats(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/ static PyObject *__pyx_pw_11pygame_sdl2_8joystick_8Joystick_21get_numhats(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("get_numhats (wrapper)", 0); __pyx_r = __pyx_pf_11pygame_sdl2_8joystick_8Joystick_20get_numhats(((struct __pyx_obj_11pygame_sdl2_8joystick_Joystick *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_8joystick_8Joystick_20get_numhats(struct __pyx_obj_11pygame_sdl2_8joystick_Joystick *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("get_numhats", 0); /* "pygame_sdl2/joystick.pyx":109 * * def get_numhats(self): * if self.joystick == NULL: # <<<<<<<<<<<<<< * raise error("joystick not initialized") * */ __pyx_t_1 = ((__pyx_v_self->joystick == NULL) != 0); if (__pyx_t_1) { /* "pygame_sdl2/joystick.pyx":110 * def get_numhats(self): * if self.joystick == NULL: * raise error("joystick not initialized") # <<<<<<<<<<<<<< * * return SDL_JoystickNumHats(self.joystick) */ __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_error); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 110; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_tuple__6, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 110; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_Raise(__pyx_t_3, 0, 0, 0); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; {__pyx_filename = __pyx_f[0]; __pyx_lineno = 110; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "pygame_sdl2/joystick.pyx":109 * * def get_numhats(self): * if self.joystick == NULL: # <<<<<<<<<<<<<< * raise error("joystick not initialized") * */ } /* "pygame_sdl2/joystick.pyx":112 * raise error("joystick not initialized") * * return SDL_JoystickNumHats(self.joystick) # <<<<<<<<<<<<<< * * def get_axis(self, axis_number): */ __Pyx_XDECREF(__pyx_r); __pyx_t_3 = __Pyx_PyInt_From_int(SDL_JoystickNumHats(__pyx_v_self->joystick)); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 112; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __pyx_r = __pyx_t_3; __pyx_t_3 = 0; goto __pyx_L0; /* "pygame_sdl2/joystick.pyx":108 * return SDL_JoystickNumButtons(self.joystick) * * def get_numhats(self): # <<<<<<<<<<<<<< * if self.joystick == NULL: * raise error("joystick not initialized") */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("pygame_sdl2.joystick.Joystick.get_numhats", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/joystick.pyx":114 * return SDL_JoystickNumHats(self.joystick) * * def get_axis(self, axis_number): # <<<<<<<<<<<<<< * if self.joystick == NULL: * raise error("joystick not initialized") */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_8joystick_8Joystick_23get_axis(PyObject *__pyx_v_self, PyObject *__pyx_v_axis_number); /*proto*/ static PyObject *__pyx_pw_11pygame_sdl2_8joystick_8Joystick_23get_axis(PyObject *__pyx_v_self, PyObject *__pyx_v_axis_number) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("get_axis (wrapper)", 0); __pyx_r = __pyx_pf_11pygame_sdl2_8joystick_8Joystick_22get_axis(((struct __pyx_obj_11pygame_sdl2_8joystick_Joystick *)__pyx_v_self), ((PyObject *)__pyx_v_axis_number)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_8joystick_8Joystick_22get_axis(struct __pyx_obj_11pygame_sdl2_8joystick_Joystick *__pyx_v_self, PyObject *__pyx_v_axis_number) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; int __pyx_t_4; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("get_axis", 0); /* "pygame_sdl2/joystick.pyx":115 * * def get_axis(self, axis_number): * if self.joystick == NULL: # <<<<<<<<<<<<<< * raise error("joystick not initialized") * */ __pyx_t_1 = ((__pyx_v_self->joystick == NULL) != 0); if (__pyx_t_1) { /* "pygame_sdl2/joystick.pyx":116 * def get_axis(self, axis_number): * if self.joystick == NULL: * raise error("joystick not initialized") # <<<<<<<<<<<<<< * * return SDL_JoystickGetAxis(self.joystick, axis_number) / 32768.0 */ __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_error); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 116; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_tuple__7, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 116; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_Raise(__pyx_t_3, 0, 0, 0); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; {__pyx_filename = __pyx_f[0]; __pyx_lineno = 116; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "pygame_sdl2/joystick.pyx":115 * * def get_axis(self, axis_number): * if self.joystick == NULL: # <<<<<<<<<<<<<< * raise error("joystick not initialized") * */ } /* "pygame_sdl2/joystick.pyx":118 * raise error("joystick not initialized") * * return SDL_JoystickGetAxis(self.joystick, axis_number) / 32768.0 # <<<<<<<<<<<<<< * * def get_ball(self, ball_number): */ __Pyx_XDECREF(__pyx_r); __pyx_t_4 = __Pyx_PyInt_As_int(__pyx_v_axis_number); if (unlikely((__pyx_t_4 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 118; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_t_3 = PyFloat_FromDouble((SDL_JoystickGetAxis(__pyx_v_self->joystick, __pyx_t_4) / 32768.0)); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 118; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __pyx_r = __pyx_t_3; __pyx_t_3 = 0; goto __pyx_L0; /* "pygame_sdl2/joystick.pyx":114 * return SDL_JoystickNumHats(self.joystick) * * def get_axis(self, axis_number): # <<<<<<<<<<<<<< * if self.joystick == NULL: * raise error("joystick not initialized") */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("pygame_sdl2.joystick.Joystick.get_axis", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/joystick.pyx":120 * return SDL_JoystickGetAxis(self.joystick, axis_number) / 32768.0 * * def get_ball(self, ball_number): # <<<<<<<<<<<<<< * cdef int dx, dy * */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_8joystick_8Joystick_25get_ball(PyObject *__pyx_v_self, PyObject *__pyx_v_ball_number); /*proto*/ static PyObject *__pyx_pw_11pygame_sdl2_8joystick_8Joystick_25get_ball(PyObject *__pyx_v_self, PyObject *__pyx_v_ball_number) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("get_ball (wrapper)", 0); __pyx_r = __pyx_pf_11pygame_sdl2_8joystick_8Joystick_24get_ball(((struct __pyx_obj_11pygame_sdl2_8joystick_Joystick *)__pyx_v_self), ((PyObject *)__pyx_v_ball_number)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_8joystick_8Joystick_24get_ball(struct __pyx_obj_11pygame_sdl2_8joystick_Joystick *__pyx_v_self, PyObject *__pyx_v_ball_number) { int __pyx_v_dx; int __pyx_v_dy; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; int __pyx_t_4; PyObject *__pyx_t_5 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("get_ball", 0); /* "pygame_sdl2/joystick.pyx":123 * cdef int dx, dy * * if self.joystick == NULL: # <<<<<<<<<<<<<< * raise error("joystick not initialized") * */ __pyx_t_1 = ((__pyx_v_self->joystick == NULL) != 0); if (__pyx_t_1) { /* "pygame_sdl2/joystick.pyx":124 * * if self.joystick == NULL: * raise error("joystick not initialized") # <<<<<<<<<<<<<< * * if SDL_JoystickGetBall(self.joystick, ball_number, &dx, &dy) == 0: */ __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_error); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 124; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_tuple__8, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 124; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_Raise(__pyx_t_3, 0, 0, 0); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; {__pyx_filename = __pyx_f[0]; __pyx_lineno = 124; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "pygame_sdl2/joystick.pyx":123 * cdef int dx, dy * * if self.joystick == NULL: # <<<<<<<<<<<<<< * raise error("joystick not initialized") * */ } /* "pygame_sdl2/joystick.pyx":126 * raise error("joystick not initialized") * * if SDL_JoystickGetBall(self.joystick, ball_number, &dx, &dy) == 0: # <<<<<<<<<<<<<< * return (dx, dy) * else: */ __pyx_t_4 = __Pyx_PyInt_As_int(__pyx_v_ball_number); if (unlikely((__pyx_t_4 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 126; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_t_1 = ((SDL_JoystickGetBall(__pyx_v_self->joystick, __pyx_t_4, (&__pyx_v_dx), (&__pyx_v_dy)) == 0) != 0); if (__pyx_t_1) { /* "pygame_sdl2/joystick.pyx":127 * * if SDL_JoystickGetBall(self.joystick, ball_number, &dx, &dy) == 0: * return (dx, dy) # <<<<<<<<<<<<<< * else: * raise error() */ __Pyx_XDECREF(__pyx_r); __pyx_t_3 = __Pyx_PyInt_From_int(__pyx_v_dx); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 127; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_v_dy); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 127; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __pyx_t_5 = PyTuple_New(2); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 127; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_3); __Pyx_GIVEREF(__pyx_t_2); PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_t_2); __pyx_t_3 = 0; __pyx_t_2 = 0; __pyx_r = __pyx_t_5; __pyx_t_5 = 0; goto __pyx_L0; /* "pygame_sdl2/joystick.pyx":126 * raise error("joystick not initialized") * * if SDL_JoystickGetBall(self.joystick, ball_number, &dx, &dy) == 0: # <<<<<<<<<<<<<< * return (dx, dy) * else: */ } /* "pygame_sdl2/joystick.pyx":129 * return (dx, dy) * else: * raise error() # <<<<<<<<<<<<<< * * def get_button(self, button): */ /*else*/ { __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_error); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 129; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = NULL; if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_2))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); if (likely(__pyx_t_3)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); } } if (__pyx_t_3) { __pyx_t_5 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 129; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } else { __pyx_t_5 = __Pyx_PyObject_CallNoArg(__pyx_t_2); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 129; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_Raise(__pyx_t_5, 0, 0, 0); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; {__pyx_filename = __pyx_f[0]; __pyx_lineno = 129; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } /* "pygame_sdl2/joystick.pyx":120 * return SDL_JoystickGetAxis(self.joystick, axis_number) / 32768.0 * * def get_ball(self, ball_number): # <<<<<<<<<<<<<< * cdef int dx, dy * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_5); __Pyx_AddTraceback("pygame_sdl2.joystick.Joystick.get_ball", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/joystick.pyx":131 * raise error() * * def get_button(self, button): # <<<<<<<<<<<<<< * if self.joystick == NULL: * raise error("joystick not initialized") */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_8joystick_8Joystick_27get_button(PyObject *__pyx_v_self, PyObject *__pyx_v_button); /*proto*/ static PyObject *__pyx_pw_11pygame_sdl2_8joystick_8Joystick_27get_button(PyObject *__pyx_v_self, PyObject *__pyx_v_button) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("get_button (wrapper)", 0); __pyx_r = __pyx_pf_11pygame_sdl2_8joystick_8Joystick_26get_button(((struct __pyx_obj_11pygame_sdl2_8joystick_Joystick *)__pyx_v_self), ((PyObject *)__pyx_v_button)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_8joystick_8Joystick_26get_button(struct __pyx_obj_11pygame_sdl2_8joystick_Joystick *__pyx_v_self, PyObject *__pyx_v_button) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; int __pyx_t_4; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("get_button", 0); /* "pygame_sdl2/joystick.pyx":132 * * def get_button(self, button): * if self.joystick == NULL: # <<<<<<<<<<<<<< * raise error("joystick not initialized") * */ __pyx_t_1 = ((__pyx_v_self->joystick == NULL) != 0); if (__pyx_t_1) { /* "pygame_sdl2/joystick.pyx":133 * def get_button(self, button): * if self.joystick == NULL: * raise error("joystick not initialized") # <<<<<<<<<<<<<< * * return SDL_JoystickGetButton(self.joystick, button) == 1 */ __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_error); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 133; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_tuple__9, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 133; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_Raise(__pyx_t_3, 0, 0, 0); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; {__pyx_filename = __pyx_f[0]; __pyx_lineno = 133; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "pygame_sdl2/joystick.pyx":132 * * def get_button(self, button): * if self.joystick == NULL: # <<<<<<<<<<<<<< * raise error("joystick not initialized") * */ } /* "pygame_sdl2/joystick.pyx":135 * raise error("joystick not initialized") * * return SDL_JoystickGetButton(self.joystick, button) == 1 # <<<<<<<<<<<<<< * * def get_hat(self, hat_number): */ __Pyx_XDECREF(__pyx_r); __pyx_t_4 = __Pyx_PyInt_As_int(__pyx_v_button); if (unlikely((__pyx_t_4 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 135; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_t_3 = __Pyx_PyBool_FromLong((SDL_JoystickGetButton(__pyx_v_self->joystick, __pyx_t_4) == 1)); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 135; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __pyx_r = __pyx_t_3; __pyx_t_3 = 0; goto __pyx_L0; /* "pygame_sdl2/joystick.pyx":131 * raise error() * * def get_button(self, button): # <<<<<<<<<<<<<< * if self.joystick == NULL: * raise error("joystick not initialized") */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("pygame_sdl2.joystick.Joystick.get_button", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/joystick.pyx":137 * return SDL_JoystickGetButton(self.joystick, button) == 1 * * def get_hat(self, hat_number): # <<<<<<<<<<<<<< * if self.joystick == NULL: * raise error("joystick not initialized") */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_8joystick_8Joystick_29get_hat(PyObject *__pyx_v_self, PyObject *__pyx_v_hat_number); /*proto*/ static PyObject *__pyx_pw_11pygame_sdl2_8joystick_8Joystick_29get_hat(PyObject *__pyx_v_self, PyObject *__pyx_v_hat_number) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("get_hat (wrapper)", 0); __pyx_r = __pyx_pf_11pygame_sdl2_8joystick_8Joystick_28get_hat(((struct __pyx_obj_11pygame_sdl2_8joystick_Joystick *)__pyx_v_self), ((PyObject *)__pyx_v_hat_number)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_8joystick_8Joystick_28get_hat(struct __pyx_obj_11pygame_sdl2_8joystick_Joystick *__pyx_v_self, PyObject *__pyx_v_hat_number) { Uint8 __pyx_v_state; long __pyx_v_hx; long __pyx_v_hy; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; int __pyx_t_4; PyObject *__pyx_t_5 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("get_hat", 0); /* "pygame_sdl2/joystick.pyx":138 * * def get_hat(self, hat_number): * if self.joystick == NULL: # <<<<<<<<<<<<<< * raise error("joystick not initialized") * */ __pyx_t_1 = ((__pyx_v_self->joystick == NULL) != 0); if (__pyx_t_1) { /* "pygame_sdl2/joystick.pyx":139 * def get_hat(self, hat_number): * if self.joystick == NULL: * raise error("joystick not initialized") # <<<<<<<<<<<<<< * * state = SDL_JoystickGetHat(self.joystick, hat_number) */ __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_error); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 139; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_tuple__10, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 139; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_Raise(__pyx_t_3, 0, 0, 0); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; {__pyx_filename = __pyx_f[0]; __pyx_lineno = 139; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "pygame_sdl2/joystick.pyx":138 * * def get_hat(self, hat_number): * if self.joystick == NULL: # <<<<<<<<<<<<<< * raise error("joystick not initialized") * */ } /* "pygame_sdl2/joystick.pyx":141 * raise error("joystick not initialized") * * state = SDL_JoystickGetHat(self.joystick, hat_number) # <<<<<<<<<<<<<< * hx = hy = 0 * if state & SDL_HAT_LEFT: */ __pyx_t_4 = __Pyx_PyInt_As_int(__pyx_v_hat_number); if (unlikely((__pyx_t_4 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 141; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_v_state = SDL_JoystickGetHat(__pyx_v_self->joystick, __pyx_t_4); /* "pygame_sdl2/joystick.pyx":142 * * state = SDL_JoystickGetHat(self.joystick, hat_number) * hx = hy = 0 # <<<<<<<<<<<<<< * if state & SDL_HAT_LEFT: * hx = -1 */ __pyx_v_hx = 0; __pyx_v_hy = 0; /* "pygame_sdl2/joystick.pyx":143 * state = SDL_JoystickGetHat(self.joystick, hat_number) * hx = hy = 0 * if state & SDL_HAT_LEFT: # <<<<<<<<<<<<<< * hx = -1 * elif state & SDL_HAT_RIGHT: */ __pyx_t_1 = ((__pyx_v_state & SDL_HAT_LEFT) != 0); if (__pyx_t_1) { /* "pygame_sdl2/joystick.pyx":144 * hx = hy = 0 * if state & SDL_HAT_LEFT: * hx = -1 # <<<<<<<<<<<<<< * elif state & SDL_HAT_RIGHT: * hx = 1 */ __pyx_v_hx = -1L; /* "pygame_sdl2/joystick.pyx":143 * state = SDL_JoystickGetHat(self.joystick, hat_number) * hx = hy = 0 * if state & SDL_HAT_LEFT: # <<<<<<<<<<<<<< * hx = -1 * elif state & SDL_HAT_RIGHT: */ goto __pyx_L4; } /* "pygame_sdl2/joystick.pyx":145 * if state & SDL_HAT_LEFT: * hx = -1 * elif state & SDL_HAT_RIGHT: # <<<<<<<<<<<<<< * hx = 1 * */ __pyx_t_1 = ((__pyx_v_state & SDL_HAT_RIGHT) != 0); if (__pyx_t_1) { /* "pygame_sdl2/joystick.pyx":146 * hx = -1 * elif state & SDL_HAT_RIGHT: * hx = 1 # <<<<<<<<<<<<<< * * if state & SDL_HAT_UP: */ __pyx_v_hx = 1; /* "pygame_sdl2/joystick.pyx":145 * if state & SDL_HAT_LEFT: * hx = -1 * elif state & SDL_HAT_RIGHT: # <<<<<<<<<<<<<< * hx = 1 * */ } __pyx_L4:; /* "pygame_sdl2/joystick.pyx":148 * hx = 1 * * if state & SDL_HAT_UP: # <<<<<<<<<<<<<< * hy = 1 * elif state & SDL_HAT_DOWN: */ __pyx_t_1 = ((__pyx_v_state & SDL_HAT_UP) != 0); if (__pyx_t_1) { /* "pygame_sdl2/joystick.pyx":149 * * if state & SDL_HAT_UP: * hy = 1 # <<<<<<<<<<<<<< * elif state & SDL_HAT_DOWN: * hy = -1 */ __pyx_v_hy = 1; /* "pygame_sdl2/joystick.pyx":148 * hx = 1 * * if state & SDL_HAT_UP: # <<<<<<<<<<<<<< * hy = 1 * elif state & SDL_HAT_DOWN: */ goto __pyx_L5; } /* "pygame_sdl2/joystick.pyx":150 * if state & SDL_HAT_UP: * hy = 1 * elif state & SDL_HAT_DOWN: # <<<<<<<<<<<<<< * hy = -1 * */ __pyx_t_1 = ((__pyx_v_state & SDL_HAT_DOWN) != 0); if (__pyx_t_1) { /* "pygame_sdl2/joystick.pyx":151 * hy = 1 * elif state & SDL_HAT_DOWN: * hy = -1 # <<<<<<<<<<<<<< * * return (hx, hy) */ __pyx_v_hy = -1L; /* "pygame_sdl2/joystick.pyx":150 * if state & SDL_HAT_UP: * hy = 1 * elif state & SDL_HAT_DOWN: # <<<<<<<<<<<<<< * hy = -1 * */ } __pyx_L5:; /* "pygame_sdl2/joystick.pyx":153 * hy = -1 * * return (hx, hy) # <<<<<<<<<<<<<< */ __Pyx_XDECREF(__pyx_r); __pyx_t_3 = __Pyx_PyInt_From_long(__pyx_v_hx); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 153; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __pyx_t_2 = __Pyx_PyInt_From_long(__pyx_v_hy); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 153; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __pyx_t_5 = PyTuple_New(2); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 153; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_3); __Pyx_GIVEREF(__pyx_t_2); PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_t_2); __pyx_t_3 = 0; __pyx_t_2 = 0; __pyx_r = __pyx_t_5; __pyx_t_5 = 0; goto __pyx_L0; /* "pygame_sdl2/joystick.pyx":137 * return SDL_JoystickGetButton(self.joystick, button) == 1 * * def get_hat(self, hat_number): # <<<<<<<<<<<<<< * if self.joystick == NULL: * raise error("joystick not initialized") */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_5); __Pyx_AddTraceback("pygame_sdl2.joystick.Joystick.get_hat", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_tp_new_11pygame_sdl2_8joystick_Joystick(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) { PyObject *o; if (likely((t->tp_flags & Py_TPFLAGS_IS_ABSTRACT) == 0)) { o = (*t->tp_alloc)(t, 0); } else { o = (PyObject *) PyBaseObject_Type.tp_new(t, __pyx_empty_tuple, 0); } if (unlikely(!o)) return 0; if (unlikely(__pyx_pw_11pygame_sdl2_8joystick_8Joystick_1__cinit__(o, __pyx_empty_tuple, NULL) < 0)) { Py_DECREF(o); o = 0; } return o; } static void __pyx_tp_dealloc_11pygame_sdl2_8joystick_Joystick(PyObject *o) { struct __pyx_obj_11pygame_sdl2_8joystick_Joystick *p = (struct __pyx_obj_11pygame_sdl2_8joystick_Joystick *)o; #if PY_VERSION_HEX >= 0x030400a1 if (unlikely(Py_TYPE(o)->tp_finalize) && (!PyType_IS_GC(Py_TYPE(o)) || !_PyGC_FINALIZED(o))) { if (PyObject_CallFinalizerFromDealloc(o)) return; } #endif if (p->__weakref__) PyObject_ClearWeakRefs(o); (*Py_TYPE(o)->tp_free)(o); } static PyMethodDef __pyx_methods_11pygame_sdl2_8joystick_Joystick[] = { {"init", (PyCFunction)__pyx_pw_11pygame_sdl2_8joystick_8Joystick_5init, METH_NOARGS, 0}, {"quit", (PyCFunction)__pyx_pw_11pygame_sdl2_8joystick_8Joystick_7quit, METH_NOARGS, 0}, {"get_init", (PyCFunction)__pyx_pw_11pygame_sdl2_8joystick_8Joystick_9get_init, METH_NOARGS, 0}, {"get_id", (PyCFunction)__pyx_pw_11pygame_sdl2_8joystick_8Joystick_11get_id, METH_NOARGS, 0}, {"get_name", (PyCFunction)__pyx_pw_11pygame_sdl2_8joystick_8Joystick_13get_name, METH_NOARGS, 0}, {"get_numaxes", (PyCFunction)__pyx_pw_11pygame_sdl2_8joystick_8Joystick_15get_numaxes, METH_NOARGS, 0}, {"get_numballs", (PyCFunction)__pyx_pw_11pygame_sdl2_8joystick_8Joystick_17get_numballs, METH_NOARGS, 0}, {"get_numbuttons", (PyCFunction)__pyx_pw_11pygame_sdl2_8joystick_8Joystick_19get_numbuttons, METH_NOARGS, 0}, {"get_numhats", (PyCFunction)__pyx_pw_11pygame_sdl2_8joystick_8Joystick_21get_numhats, METH_NOARGS, 0}, {"get_axis", (PyCFunction)__pyx_pw_11pygame_sdl2_8joystick_8Joystick_23get_axis, METH_O, 0}, {"get_ball", (PyCFunction)__pyx_pw_11pygame_sdl2_8joystick_8Joystick_25get_ball, METH_O, 0}, {"get_button", (PyCFunction)__pyx_pw_11pygame_sdl2_8joystick_8Joystick_27get_button, METH_O, 0}, {"get_hat", (PyCFunction)__pyx_pw_11pygame_sdl2_8joystick_8Joystick_29get_hat, METH_O, 0}, {0, 0, 0, 0} }; static PyTypeObject __pyx_type_11pygame_sdl2_8joystick_Joystick = { PyVarObject_HEAD_INIT(0, 0) "pygame_sdl2.joystick.Joystick", /*tp_name*/ sizeof(struct __pyx_obj_11pygame_sdl2_8joystick_Joystick), /*tp_basicsize*/ 0, /*tp_itemsize*/ __pyx_tp_dealloc_11pygame_sdl2_8joystick_Joystick, /*tp_dealloc*/ 0, /*tp_print*/ 0, /*tp_getattr*/ 0, /*tp_setattr*/ #if PY_MAJOR_VERSION < 3 0, /*tp_compare*/ #endif #if PY_MAJOR_VERSION >= 3 0, /*tp_as_async*/ #endif 0, /*tp_repr*/ 0, /*tp_as_number*/ 0, /*tp_as_sequence*/ 0, /*tp_as_mapping*/ 0, /*tp_hash*/ 0, /*tp_call*/ 0, /*tp_str*/ 0, /*tp_getattro*/ 0, /*tp_setattro*/ 0, /*tp_as_buffer*/ Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE, /*tp_flags*/ 0, /*tp_doc*/ 0, /*tp_traverse*/ 0, /*tp_clear*/ 0, /*tp_richcompare*/ 0, /*tp_weaklistoffset*/ 0, /*tp_iter*/ 0, /*tp_iternext*/ __pyx_methods_11pygame_sdl2_8joystick_Joystick, /*tp_methods*/ 0, /*tp_members*/ 0, /*tp_getset*/ 0, /*tp_base*/ 0, /*tp_dict*/ 0, /*tp_descr_get*/ 0, /*tp_descr_set*/ 0, /*tp_dictoffset*/ __pyx_pw_11pygame_sdl2_8joystick_8Joystick_3__init__, /*tp_init*/ 0, /*tp_alloc*/ __pyx_tp_new_11pygame_sdl2_8joystick_Joystick, /*tp_new*/ 0, /*tp_free*/ 0, /*tp_is_gc*/ 0, /*tp_bases*/ 0, /*tp_mro*/ 0, /*tp_cache*/ 0, /*tp_subclasses*/ 0, /*tp_weaklist*/ 0, /*tp_del*/ 0, /*tp_version_tag*/ #if PY_VERSION_HEX >= 0x030400a1 0, /*tp_finalize*/ #endif }; static PyMethodDef __pyx_methods[] = { {0, 0, 0, 0} }; #if PY_MAJOR_VERSION >= 3 static struct PyModuleDef __pyx_moduledef = { #if PY_VERSION_HEX < 0x03020000 { PyObject_HEAD_INIT(NULL) NULL, 0, NULL }, #else PyModuleDef_HEAD_INIT, #endif "joystick", 0, /* m_doc */ -1, /* m_size */ __pyx_methods /* m_methods */, NULL, /* m_reload */ NULL, /* m_traverse */ NULL, /* m_clear */ NULL /* m_free */ }; #endif static __Pyx_StringTabEntry __pyx_string_tab[] = { {&__pyx_n_s_display, __pyx_k_display, sizeof(__pyx_k_display), 0, 0, 1, 1}, {&__pyx_n_s_error, __pyx_k_error, sizeof(__pyx_k_error), 0, 0, 1, 1}, {&__pyx_n_s_get_count, __pyx_k_get_count, sizeof(__pyx_k_get_count), 0, 0, 1, 1}, {&__pyx_n_s_get_init, __pyx_k_get_init, sizeof(__pyx_k_get_init), 0, 0, 1, 1}, {&__pyx_kp_s_home_tom_ab_pygame_sdl2_src_pyg, __pyx_k_home_tom_ab_pygame_sdl2_src_pyg, sizeof(__pyx_k_home_tom_ab_pygame_sdl2_src_pyg), 0, 0, 1, 0}, {&__pyx_n_s_id, __pyx_k_id, sizeof(__pyx_k_id), 0, 0, 1, 1}, {&__pyx_n_s_import, __pyx_k_import, sizeof(__pyx_k_import), 0, 0, 1, 1}, {&__pyx_n_s_init, __pyx_k_init, sizeof(__pyx_k_init), 0, 0, 1, 1}, {&__pyx_kp_s_joystick_not_initialized, __pyx_k_joystick_not_initialized, sizeof(__pyx_k_joystick_not_initialized), 0, 0, 1, 0}, {&__pyx_n_s_main, __pyx_k_main, sizeof(__pyx_k_main), 0, 0, 1, 1}, {&__pyx_n_s_pygame_sdl2, __pyx_k_pygame_sdl2, sizeof(__pyx_k_pygame_sdl2), 0, 0, 1, 1}, {&__pyx_n_s_pygame_sdl2_error, __pyx_k_pygame_sdl2_error, sizeof(__pyx_k_pygame_sdl2_error), 0, 0, 1, 1}, {&__pyx_n_s_pygame_sdl2_joystick, __pyx_k_pygame_sdl2_joystick, sizeof(__pyx_k_pygame_sdl2_joystick), 0, 0, 1, 1}, {&__pyx_n_s_quit, __pyx_k_quit, sizeof(__pyx_k_quit), 0, 0, 1, 1}, {&__pyx_n_s_register_init, __pyx_k_register_init, sizeof(__pyx_k_register_init), 0, 0, 1, 1}, {&__pyx_n_s_register_quit, __pyx_k_register_quit, sizeof(__pyx_k_register_quit), 0, 0, 1, 1}, {&__pyx_n_s_sdl_main_init, __pyx_k_sdl_main_init, sizeof(__pyx_k_sdl_main_init), 0, 0, 1, 1}, {&__pyx_n_s_test, __pyx_k_test, sizeof(__pyx_k_test), 0, 0, 1, 1}, {0, 0, 0, 0, 0, 0, 0} }; static int __Pyx_InitCachedBuiltins(void) { return 0; } static int __Pyx_InitCachedConstants(void) { __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__Pyx_InitCachedConstants", 0); /* "pygame_sdl2/joystick.pyx":73 * def get_id(self): * if self.joystick == NULL: * raise error("joystick not initialized") # <<<<<<<<<<<<<< * * return SDL_JoystickInstanceID(self.joystick) */ __pyx_tuple_ = PyTuple_Pack(1, __pyx_kp_s_joystick_not_initialized); if (unlikely(!__pyx_tuple_)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 73; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_tuple_); __Pyx_GIVEREF(__pyx_tuple_); /* "pygame_sdl2/joystick.pyx":81 * * if self.joystick == NULL: * raise error("joystick not initialized") # <<<<<<<<<<<<<< * * rv = SDL_JoystickName(self.joystick) */ __pyx_tuple__2 = PyTuple_Pack(1, __pyx_kp_s_joystick_not_initialized); if (unlikely(!__pyx_tuple__2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 81; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_tuple__2); __Pyx_GIVEREF(__pyx_tuple__2); /* "pygame_sdl2/joystick.pyx":92 * def get_numaxes(self): * if self.joystick == NULL: * raise error("joystick not initialized") # <<<<<<<<<<<<<< * * return SDL_JoystickNumAxes(self.joystick) */ __pyx_tuple__3 = PyTuple_Pack(1, __pyx_kp_s_joystick_not_initialized); if (unlikely(!__pyx_tuple__3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 92; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_tuple__3); __Pyx_GIVEREF(__pyx_tuple__3); /* "pygame_sdl2/joystick.pyx":98 * def get_numballs(self): * if self.joystick == NULL: * raise error("joystick not initialized") # <<<<<<<<<<<<<< * * return SDL_JoystickNumBalls(self.joystick) */ __pyx_tuple__4 = PyTuple_Pack(1, __pyx_kp_s_joystick_not_initialized); if (unlikely(!__pyx_tuple__4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 98; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_tuple__4); __Pyx_GIVEREF(__pyx_tuple__4); /* "pygame_sdl2/joystick.pyx":104 * def get_numbuttons(self): * if self.joystick == NULL: * raise error("joystick not initialized") # <<<<<<<<<<<<<< * * return SDL_JoystickNumButtons(self.joystick) */ __pyx_tuple__5 = PyTuple_Pack(1, __pyx_kp_s_joystick_not_initialized); if (unlikely(!__pyx_tuple__5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 104; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_tuple__5); __Pyx_GIVEREF(__pyx_tuple__5); /* "pygame_sdl2/joystick.pyx":110 * def get_numhats(self): * if self.joystick == NULL: * raise error("joystick not initialized") # <<<<<<<<<<<<<< * * return SDL_JoystickNumHats(self.joystick) */ __pyx_tuple__6 = PyTuple_Pack(1, __pyx_kp_s_joystick_not_initialized); if (unlikely(!__pyx_tuple__6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 110; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_tuple__6); __Pyx_GIVEREF(__pyx_tuple__6); /* "pygame_sdl2/joystick.pyx":116 * def get_axis(self, axis_number): * if self.joystick == NULL: * raise error("joystick not initialized") # <<<<<<<<<<<<<< * * return SDL_JoystickGetAxis(self.joystick, axis_number) / 32768.0 */ __pyx_tuple__7 = PyTuple_Pack(1, __pyx_kp_s_joystick_not_initialized); if (unlikely(!__pyx_tuple__7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 116; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_tuple__7); __Pyx_GIVEREF(__pyx_tuple__7); /* "pygame_sdl2/joystick.pyx":124 * * if self.joystick == NULL: * raise error("joystick not initialized") # <<<<<<<<<<<<<< * * if SDL_JoystickGetBall(self.joystick, ball_number, &dx, &dy) == 0: */ __pyx_tuple__8 = PyTuple_Pack(1, __pyx_kp_s_joystick_not_initialized); if (unlikely(!__pyx_tuple__8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 124; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_tuple__8); __Pyx_GIVEREF(__pyx_tuple__8); /* "pygame_sdl2/joystick.pyx":133 * def get_button(self, button): * if self.joystick == NULL: * raise error("joystick not initialized") # <<<<<<<<<<<<<< * * return SDL_JoystickGetButton(self.joystick, button) == 1 */ __pyx_tuple__9 = PyTuple_Pack(1, __pyx_kp_s_joystick_not_initialized); if (unlikely(!__pyx_tuple__9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 133; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_tuple__9); __Pyx_GIVEREF(__pyx_tuple__9); /* "pygame_sdl2/joystick.pyx":139 * def get_hat(self, hat_number): * if self.joystick == NULL: * raise error("joystick not initialized") # <<<<<<<<<<<<<< * * state = SDL_JoystickGetHat(self.joystick, hat_number) */ __pyx_tuple__10 = PyTuple_Pack(1, __pyx_kp_s_joystick_not_initialized); if (unlikely(!__pyx_tuple__10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 139; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_tuple__10); __Pyx_GIVEREF(__pyx_tuple__10); /* "pygame_sdl2/joystick.pyx":24 * * @pygame_sdl2.register_init * def init(): # <<<<<<<<<<<<<< * pygame_sdl2.display.sdl_main_init() * */ __pyx_codeobj__11 = (PyObject*)__Pyx_PyCode_New(0, 0, 0, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_tom_ab_pygame_sdl2_src_pyg, __pyx_n_s_init, 24, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 24; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "pygame_sdl2/joystick.pyx":31 * * @pygame_sdl2.register_quit * def quit(): # @ReservedAssignment # <<<<<<<<<<<<<< * SDL_QuitSubSystem(SDL_INIT_JOYSTICK) * */ __pyx_codeobj__12 = (PyObject*)__Pyx_PyCode_New(0, 0, 0, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_tom_ab_pygame_sdl2_src_pyg, __pyx_n_s_quit, 31, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__12)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 31; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "pygame_sdl2/joystick.pyx":34 * SDL_QuitSubSystem(SDL_INIT_JOYSTICK) * * def get_init(): # <<<<<<<<<<<<<< * return SDL_WasInit(SDL_INIT_JOYSTICK) != 0 * */ __pyx_codeobj__13 = (PyObject*)__Pyx_PyCode_New(0, 0, 0, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_tom_ab_pygame_sdl2_src_pyg, __pyx_n_s_get_init, 34, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__13)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 34; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "pygame_sdl2/joystick.pyx":37 * return SDL_WasInit(SDL_INIT_JOYSTICK) != 0 * * def get_count(): # <<<<<<<<<<<<<< * return SDL_NumJoysticks() * */ __pyx_codeobj__14 = (PyObject*)__Pyx_PyCode_New(0, 0, 0, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_tom_ab_pygame_sdl2_src_pyg, __pyx_n_s_get_count, 37, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__14)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 37; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_RefNannyFinishContext(); return 0; __pyx_L1_error:; __Pyx_RefNannyFinishContext(); return -1; } static int __Pyx_InitGlobals(void) { if (__Pyx_InitStrings(__pyx_string_tab) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; return 0; __pyx_L1_error:; return -1; } #if PY_MAJOR_VERSION < 3 PyMODINIT_FUNC initjoystick(void); /*proto*/ PyMODINIT_FUNC initjoystick(void) #else PyMODINIT_FUNC PyInit_joystick(void); /*proto*/ PyMODINIT_FUNC PyInit_joystick(void) #endif { PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; PyObject *__pyx_t_5 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannyDeclarations #if CYTHON_REFNANNY __Pyx_RefNanny = __Pyx_RefNannyImportAPI("refnanny"); if (!__Pyx_RefNanny) { PyErr_Clear(); __Pyx_RefNanny = __Pyx_RefNannyImportAPI("Cython.Runtime.refnanny"); if (!__Pyx_RefNanny) Py_FatalError("failed to import 'refnanny' module"); } #endif __Pyx_RefNannySetupContext("PyMODINIT_FUNC PyInit_joystick(void)", 0); if (__Pyx_check_binary_version() < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_empty_tuple = PyTuple_New(0); if (unlikely(!__pyx_empty_tuple)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_empty_bytes = PyBytes_FromStringAndSize("", 0); if (unlikely(!__pyx_empty_bytes)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} #ifdef __Pyx_CyFunction_USED if (__pyx_CyFunction_init() < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} #endif #ifdef __Pyx_FusedFunction_USED if (__pyx_FusedFunction_init() < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} #endif #ifdef __Pyx_Coroutine_USED if (__pyx_Coroutine_init() < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} #endif #ifdef __Pyx_Generator_USED if (__pyx_Generator_init() < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} #endif #ifdef __Pyx_StopAsyncIteration_USED if (__pyx_StopAsyncIteration_init() < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} #endif /*--- Library function declarations ---*/ /*--- Threads initialization code ---*/ #if defined(__PYX_FORCE_INIT_THREADS) && __PYX_FORCE_INIT_THREADS #ifdef WITH_THREAD /* Python build with threading support? */ PyEval_InitThreads(); #endif #endif /*--- Module creation code ---*/ #if PY_MAJOR_VERSION < 3 __pyx_m = Py_InitModule4("joystick", __pyx_methods, 0, 0, PYTHON_API_VERSION); Py_XINCREF(__pyx_m); #else __pyx_m = PyModule_Create(&__pyx_moduledef); #endif if (unlikely(!__pyx_m)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_d = PyModule_GetDict(__pyx_m); if (unlikely(!__pyx_d)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} Py_INCREF(__pyx_d); __pyx_b = PyImport_AddModule(__Pyx_BUILTIN_MODULE_NAME); if (unlikely(!__pyx_b)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} #if CYTHON_COMPILING_IN_PYPY Py_INCREF(__pyx_b); #endif if (PyObject_SetAttrString(__pyx_m, "__builtins__", __pyx_b) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; /*--- Initialize various global constants etc. ---*/ if (__Pyx_InitGlobals() < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} #if PY_MAJOR_VERSION < 3 && (__PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT) if (__Pyx_init_sys_getdefaultencoding_params() < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} #endif if (__pyx_module_is_main_pygame_sdl2__joystick) { if (PyObject_SetAttrString(__pyx_m, "__name__", __pyx_n_s_main) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } #if PY_MAJOR_VERSION >= 3 { PyObject *modules = PyImport_GetModuleDict(); if (unlikely(!modules)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} if (!PyDict_GetItemString(modules, "pygame_sdl2.joystick")) { if (unlikely(PyDict_SetItemString(modules, "pygame_sdl2.joystick", __pyx_m) < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } } #endif /*--- Builtin init code ---*/ if (__Pyx_InitCachedBuiltins() < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /*--- Constants init code ---*/ if (__Pyx_InitCachedConstants() < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /*--- Global init code ---*/ /*--- Variable export code ---*/ /*--- Function export code ---*/ /*--- Type init code ---*/ if (PyType_Ready(&__pyx_type_11pygame_sdl2_8joystick_Joystick) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 41; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_type_11pygame_sdl2_8joystick_Joystick.tp_print = 0; if (PyObject_SetAttrString(__pyx_m, "Joystick", (PyObject *)&__pyx_type_11pygame_sdl2_8joystick_Joystick) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 41; __pyx_clineno = __LINE__; goto __pyx_L1_error;} if (__pyx_type_11pygame_sdl2_8joystick_Joystick.tp_weaklistoffset == 0) __pyx_type_11pygame_sdl2_8joystick_Joystick.tp_weaklistoffset = offsetof(struct __pyx_obj_11pygame_sdl2_8joystick_Joystick, __weakref__); __pyx_ptype_11pygame_sdl2_8joystick_Joystick = &__pyx_type_11pygame_sdl2_8joystick_Joystick; /*--- Type import code ---*/ /*--- Variable import code ---*/ /*--- Function import code ---*/ /*--- Execution code ---*/ #if defined(__Pyx_Generator_USED) || defined(__Pyx_Coroutine_USED) if (__Pyx_patch_abc() < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} #endif /* "pygame_sdl2/joystick.pyx":20 * * from sdl2 cimport * * from pygame_sdl2.error import error # <<<<<<<<<<<<<< * import pygame_sdl2 * */ __pyx_t_1 = PyList_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 20; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __Pyx_INCREF(__pyx_n_s_error); __Pyx_GIVEREF(__pyx_n_s_error); PyList_SET_ITEM(__pyx_t_1, 0, __pyx_n_s_error); __pyx_t_2 = __Pyx_Import(__pyx_n_s_pygame_sdl2_error, __pyx_t_1, -1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 20; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_1 = __Pyx_ImportFrom(__pyx_t_2, __pyx_n_s_error); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 20; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); if (PyDict_SetItem(__pyx_d, __pyx_n_s_error, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 20; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "pygame_sdl2/joystick.pyx":21 * from sdl2 cimport * * from pygame_sdl2.error import error * import pygame_sdl2 # <<<<<<<<<<<<<< * * @pygame_sdl2.register_init */ __pyx_t_2 = __Pyx_Import(__pyx_n_s_pygame_sdl2, 0, -1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 21; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_pygame_sdl2, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 21; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "pygame_sdl2/joystick.pyx":23 * import pygame_sdl2 * * @pygame_sdl2.register_init # <<<<<<<<<<<<<< * def init(): * pygame_sdl2.display.sdl_main_init() */ __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_pygame_sdl2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 23; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_register_init); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 23; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "pygame_sdl2/joystick.pyx":24 * * @pygame_sdl2.register_init * def init(): # <<<<<<<<<<<<<< * pygame_sdl2.display.sdl_main_init() * */ __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_11pygame_sdl2_8joystick_1init, NULL, __pyx_n_s_pygame_sdl2_joystick); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 24; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_t_4 = NULL; if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_3))) { __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3); if (likely(__pyx_t_4)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); __Pyx_INCREF(__pyx_t_4); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_3, function); } } if (!__pyx_t_4) { __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 23; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_GOTREF(__pyx_t_2); } else { __pyx_t_5 = PyTuple_New(1+1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 23; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_4); __pyx_t_4 = NULL; __Pyx_GIVEREF(__pyx_t_1); PyTuple_SET_ITEM(__pyx_t_5, 0+1, __pyx_t_1); __pyx_t_1 = 0; __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_5, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 23; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; } __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; if (PyDict_SetItem(__pyx_d, __pyx_n_s_init, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 24; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "pygame_sdl2/joystick.pyx":30 * raise error() * * @pygame_sdl2.register_quit # <<<<<<<<<<<<<< * def quit(): # @ReservedAssignment * SDL_QuitSubSystem(SDL_INIT_JOYSTICK) */ __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_pygame_sdl2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 30; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_register_quit); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 30; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "pygame_sdl2/joystick.pyx":31 * * @pygame_sdl2.register_quit * def quit(): # @ReservedAssignment # <<<<<<<<<<<<<< * SDL_QuitSubSystem(SDL_INIT_JOYSTICK) * */ __pyx_t_3 = PyCFunction_NewEx(&__pyx_mdef_11pygame_sdl2_8joystick_3quit, NULL, __pyx_n_s_pygame_sdl2_joystick); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 31; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __pyx_t_1 = NULL; if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_5))) { __pyx_t_1 = PyMethod_GET_SELF(__pyx_t_5); if (likely(__pyx_t_1)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5); __Pyx_INCREF(__pyx_t_1); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_5, function); } } if (!__pyx_t_1) { __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_t_3); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 30; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_GOTREF(__pyx_t_2); } else { __pyx_t_4 = PyTuple_New(1+1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 30; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); __Pyx_GIVEREF(__pyx_t_1); PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_1); __pyx_t_1 = NULL; __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_4, 0+1, __pyx_t_3); __pyx_t_3 = 0; __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_4, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 30; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; } __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; if (PyDict_SetItem(__pyx_d, __pyx_n_s_quit, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 31; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "pygame_sdl2/joystick.pyx":34 * SDL_QuitSubSystem(SDL_INIT_JOYSTICK) * * def get_init(): # <<<<<<<<<<<<<< * return SDL_WasInit(SDL_INIT_JOYSTICK) != 0 * */ __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_11pygame_sdl2_8joystick_5get_init, NULL, __pyx_n_s_pygame_sdl2_joystick); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 34; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_get_init, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 34; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "pygame_sdl2/joystick.pyx":37 * return SDL_WasInit(SDL_INIT_JOYSTICK) != 0 * * def get_count(): # <<<<<<<<<<<<<< * return SDL_NumJoysticks() * */ __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_11pygame_sdl2_8joystick_7get_count, NULL, __pyx_n_s_pygame_sdl2_joystick); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 37; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_get_count, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 37; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "pygame_sdl2/joystick.pyx":1 * # Copyright 2014 Patrick Dawson # <<<<<<<<<<<<<< * # * # This software is provided 'as-is', without any express or implied */ __pyx_t_2 = PyDict_New(); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_test, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /*--- Wrapped vars code ---*/ goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_5); if (__pyx_m) { if (__pyx_d) { __Pyx_AddTraceback("init pygame_sdl2.joystick", __pyx_clineno, __pyx_lineno, __pyx_filename); } Py_DECREF(__pyx_m); __pyx_m = 0; } else if (!PyErr_Occurred()) { PyErr_SetString(PyExc_ImportError, "init pygame_sdl2.joystick"); } __pyx_L0:; __Pyx_RefNannyFinishContext(); #if PY_MAJOR_VERSION < 3 return; #else return __pyx_m; #endif } /* --- Runtime support code --- */ #if CYTHON_REFNANNY static __Pyx_RefNannyAPIStruct *__Pyx_RefNannyImportAPI(const char *modname) { PyObject *m = NULL, *p = NULL; void *r = NULL; m = PyImport_ImportModule((char *)modname); if (!m) goto end; p = PyObject_GetAttrString(m, (char *)"RefNannyAPI"); if (!p) goto end; r = PyLong_AsVoidPtr(p); end: Py_XDECREF(p); Py_XDECREF(m); return (__Pyx_RefNannyAPIStruct *)r; } #endif static PyObject *__Pyx_GetBuiltinName(PyObject *name) { PyObject* result = __Pyx_PyObject_GetAttrStr(__pyx_b, name); if (unlikely(!result)) { PyErr_Format(PyExc_NameError, #if PY_MAJOR_VERSION >= 3 "name '%U' is not defined", name); #else "name '%.200s' is not defined", PyString_AS_STRING(name)); #endif } return result; } static CYTHON_INLINE PyObject *__Pyx_GetModuleGlobalName(PyObject *name) { PyObject *result; #if CYTHON_COMPILING_IN_CPYTHON result = PyDict_GetItem(__pyx_d, name); if (likely(result)) { Py_INCREF(result); } else { #else result = PyObject_GetItem(__pyx_d, name); if (!result) { PyErr_Clear(); #endif result = __Pyx_GetBuiltinName(name); } return result; } #if CYTHON_COMPILING_IN_CPYTHON static CYTHON_INLINE PyObject* __Pyx_PyObject_Call(PyObject *func, PyObject *arg, PyObject *kw) { PyObject *result; ternaryfunc call = func->ob_type->tp_call; if (unlikely(!call)) return PyObject_Call(func, arg, kw); if (unlikely(Py_EnterRecursiveCall((char*)" while calling a Python object"))) return NULL; result = (*call)(func, arg, kw); Py_LeaveRecursiveCall(); if (unlikely(!result) && unlikely(!PyErr_Occurred())) { PyErr_SetString( PyExc_SystemError, "NULL result without error in PyObject_Call"); } return result; } #endif #if CYTHON_COMPILING_IN_CPYTHON static CYTHON_INLINE PyObject* __Pyx_PyObject_CallMethO(PyObject *func, PyObject *arg) { PyObject *self, *result; PyCFunction cfunc; cfunc = PyCFunction_GET_FUNCTION(func); self = PyCFunction_GET_SELF(func); if (unlikely(Py_EnterRecursiveCall((char*)" while calling a Python object"))) return NULL; result = cfunc(self, arg); Py_LeaveRecursiveCall(); if (unlikely(!result) && unlikely(!PyErr_Occurred())) { PyErr_SetString( PyExc_SystemError, "NULL result without error in PyObject_Call"); } return result; } #endif #if CYTHON_COMPILING_IN_CPYTHON static PyObject* __Pyx__PyObject_CallOneArg(PyObject *func, PyObject *arg) { PyObject *result; PyObject *args = PyTuple_New(1); if (unlikely(!args)) return NULL; Py_INCREF(arg); PyTuple_SET_ITEM(args, 0, arg); result = __Pyx_PyObject_Call(func, args, NULL); Py_DECREF(args); return result; } static CYTHON_INLINE PyObject* __Pyx_PyObject_CallOneArg(PyObject *func, PyObject *arg) { #ifdef __Pyx_CyFunction_USED if (likely(PyCFunction_Check(func) || PyObject_TypeCheck(func, __pyx_CyFunctionType))) { #else if (likely(PyCFunction_Check(func))) { #endif if (likely(PyCFunction_GET_FLAGS(func) & METH_O)) { return __Pyx_PyObject_CallMethO(func, arg); } } return __Pyx__PyObject_CallOneArg(func, arg); } #else static CYTHON_INLINE PyObject* __Pyx_PyObject_CallOneArg(PyObject *func, PyObject *arg) { PyObject *result; PyObject *args = PyTuple_Pack(1, arg); if (unlikely(!args)) return NULL; result = __Pyx_PyObject_Call(func, args, NULL); Py_DECREF(args); return result; } #endif #if CYTHON_COMPILING_IN_CPYTHON static CYTHON_INLINE PyObject* __Pyx_PyObject_CallNoArg(PyObject *func) { #ifdef __Pyx_CyFunction_USED if (likely(PyCFunction_Check(func) || PyObject_TypeCheck(func, __pyx_CyFunctionType))) { #else if (likely(PyCFunction_Check(func))) { #endif if (likely(PyCFunction_GET_FLAGS(func) & METH_NOARGS)) { return __Pyx_PyObject_CallMethO(func, NULL); } } return __Pyx_PyObject_Call(func, __pyx_empty_tuple, NULL); } #endif static CYTHON_INLINE void __Pyx_ErrRestore(PyObject *type, PyObject *value, PyObject *tb) { #if CYTHON_COMPILING_IN_CPYTHON PyObject *tmp_type, *tmp_value, *tmp_tb; PyThreadState *tstate = PyThreadState_GET(); tmp_type = tstate->curexc_type; tmp_value = tstate->curexc_value; tmp_tb = tstate->curexc_traceback; tstate->curexc_type = type; tstate->curexc_value = value; tstate->curexc_traceback = tb; Py_XDECREF(tmp_type); Py_XDECREF(tmp_value); Py_XDECREF(tmp_tb); #else PyErr_Restore(type, value, tb); #endif } static CYTHON_INLINE void __Pyx_ErrFetch(PyObject **type, PyObject **value, PyObject **tb) { #if CYTHON_COMPILING_IN_CPYTHON PyThreadState *tstate = PyThreadState_GET(); *type = tstate->curexc_type; *value = tstate->curexc_value; *tb = tstate->curexc_traceback; tstate->curexc_type = 0; tstate->curexc_value = 0; tstate->curexc_traceback = 0; #else PyErr_Fetch(type, value, tb); #endif } #if PY_MAJOR_VERSION < 3 static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, CYTHON_UNUSED PyObject *cause) { Py_XINCREF(type); if (!value || value == Py_None) value = NULL; else Py_INCREF(value); if (!tb || tb == Py_None) tb = NULL; else { Py_INCREF(tb); if (!PyTraceBack_Check(tb)) { PyErr_SetString(PyExc_TypeError, "raise: arg 3 must be a traceback or None"); goto raise_error; } } if (PyType_Check(type)) { #if CYTHON_COMPILING_IN_PYPY if (!value) { Py_INCREF(Py_None); value = Py_None; } #endif PyErr_NormalizeException(&type, &value, &tb); } else { if (value) { PyErr_SetString(PyExc_TypeError, "instance exception may not have a separate value"); goto raise_error; } value = type; type = (PyObject*) Py_TYPE(type); Py_INCREF(type); if (!PyType_IsSubtype((PyTypeObject *)type, (PyTypeObject *)PyExc_BaseException)) { PyErr_SetString(PyExc_TypeError, "raise: exception class must be a subclass of BaseException"); goto raise_error; } } __Pyx_ErrRestore(type, value, tb); return; raise_error: Py_XDECREF(value); Py_XDECREF(type); Py_XDECREF(tb); return; } #else static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, PyObject *cause) { PyObject* owned_instance = NULL; if (tb == Py_None) { tb = 0; } else if (tb && !PyTraceBack_Check(tb)) { PyErr_SetString(PyExc_TypeError, "raise: arg 3 must be a traceback or None"); goto bad; } if (value == Py_None) value = 0; if (PyExceptionInstance_Check(type)) { if (value) { PyErr_SetString(PyExc_TypeError, "instance exception may not have a separate value"); goto bad; } value = type; type = (PyObject*) Py_TYPE(value); } else if (PyExceptionClass_Check(type)) { PyObject *instance_class = NULL; if (value && PyExceptionInstance_Check(value)) { instance_class = (PyObject*) Py_TYPE(value); if (instance_class != type) { int is_subclass = PyObject_IsSubclass(instance_class, type); if (!is_subclass) { instance_class = NULL; } else if (unlikely(is_subclass == -1)) { goto bad; } else { type = instance_class; } } } if (!instance_class) { PyObject *args; if (!value) args = PyTuple_New(0); else if (PyTuple_Check(value)) { Py_INCREF(value); args = value; } else args = PyTuple_Pack(1, value); if (!args) goto bad; owned_instance = PyObject_Call(type, args, NULL); Py_DECREF(args); if (!owned_instance) goto bad; value = owned_instance; if (!PyExceptionInstance_Check(value)) { PyErr_Format(PyExc_TypeError, "calling %R should have returned an instance of " "BaseException, not %R", type, Py_TYPE(value)); goto bad; } } } else { PyErr_SetString(PyExc_TypeError, "raise: exception class must be a subclass of BaseException"); goto bad; } #if PY_VERSION_HEX >= 0x03030000 if (cause) { #else if (cause && cause != Py_None) { #endif PyObject *fixed_cause; if (cause == Py_None) { fixed_cause = NULL; } else if (PyExceptionClass_Check(cause)) { fixed_cause = PyObject_CallObject(cause, NULL); if (fixed_cause == NULL) goto bad; } else if (PyExceptionInstance_Check(cause)) { fixed_cause = cause; Py_INCREF(fixed_cause); } else { PyErr_SetString(PyExc_TypeError, "exception causes must derive from " "BaseException"); goto bad; } PyException_SetCause(value, fixed_cause); } PyErr_SetObject(type, value); if (tb) { #if CYTHON_COMPILING_IN_PYPY PyObject *tmp_type, *tmp_value, *tmp_tb; PyErr_Fetch(&tmp_type, &tmp_value, &tmp_tb); Py_INCREF(tb); PyErr_Restore(tmp_type, tmp_value, tb); Py_XDECREF(tmp_tb); #else PyThreadState *tstate = PyThreadState_GET(); PyObject* tmp_tb = tstate->curexc_traceback; if (tb != tmp_tb) { Py_INCREF(tb); tstate->curexc_traceback = tb; Py_XDECREF(tmp_tb); } #endif } bad: Py_XDECREF(owned_instance); return; } #endif static void __Pyx_RaiseArgtupleInvalid( const char* func_name, int exact, Py_ssize_t num_min, Py_ssize_t num_max, Py_ssize_t num_found) { Py_ssize_t num_expected; const char *more_or_less; if (num_found < num_min) { num_expected = num_min; more_or_less = "at least"; } else { num_expected = num_max; more_or_less = "at most"; } if (exact) { more_or_less = "exactly"; } PyErr_Format(PyExc_TypeError, "%.200s() takes %.8s %" CYTHON_FORMAT_SSIZE_T "d positional argument%.1s (%" CYTHON_FORMAT_SSIZE_T "d given)", func_name, more_or_less, num_expected, (num_expected == 1) ? "" : "s", num_found); } static CYTHON_INLINE int __Pyx_CheckKeywordStrings( PyObject *kwdict, const char* function_name, int kw_allowed) { PyObject* key = 0; Py_ssize_t pos = 0; #if CYTHON_COMPILING_IN_PYPY if (!kw_allowed && PyDict_Next(kwdict, &pos, &key, 0)) goto invalid_keyword; return 1; #else while (PyDict_Next(kwdict, &pos, &key, 0)) { #if PY_MAJOR_VERSION < 3 if (unlikely(!PyString_CheckExact(key)) && unlikely(!PyString_Check(key))) #endif if (unlikely(!PyUnicode_Check(key))) goto invalid_keyword_type; } if ((!kw_allowed) && unlikely(key)) goto invalid_keyword; return 1; invalid_keyword_type: PyErr_Format(PyExc_TypeError, "%.200s() keywords must be strings", function_name); return 0; #endif invalid_keyword: PyErr_Format(PyExc_TypeError, #if PY_MAJOR_VERSION < 3 "%.200s() got an unexpected keyword argument '%.200s'", function_name, PyString_AsString(key)); #else "%s() got an unexpected keyword argument '%U'", function_name, key); #endif return 0; } static void __Pyx_RaiseDoubleKeywordsError( const char* func_name, PyObject* kw_name) { PyErr_Format(PyExc_TypeError, #if PY_MAJOR_VERSION >= 3 "%s() got multiple values for keyword argument '%U'", func_name, kw_name); #else "%s() got multiple values for keyword argument '%s'", func_name, PyString_AsString(kw_name)); #endif } static int __Pyx_ParseOptionalKeywords( PyObject *kwds, PyObject **argnames[], PyObject *kwds2, PyObject *values[], Py_ssize_t num_pos_args, const char* function_name) { PyObject *key = 0, *value = 0; Py_ssize_t pos = 0; PyObject*** name; PyObject*** first_kw_arg = argnames + num_pos_args; while (PyDict_Next(kwds, &pos, &key, &value)) { name = first_kw_arg; while (*name && (**name != key)) name++; if (*name) { values[name-argnames] = value; continue; } name = first_kw_arg; #if PY_MAJOR_VERSION < 3 if (likely(PyString_CheckExact(key)) || likely(PyString_Check(key))) { while (*name) { if ((CYTHON_COMPILING_IN_PYPY || PyString_GET_SIZE(**name) == PyString_GET_SIZE(key)) && _PyString_Eq(**name, key)) { values[name-argnames] = value; break; } name++; } if (*name) continue; else { PyObject*** argname = argnames; while (argname != first_kw_arg) { if ((**argname == key) || ( (CYTHON_COMPILING_IN_PYPY || PyString_GET_SIZE(**argname) == PyString_GET_SIZE(key)) && _PyString_Eq(**argname, key))) { goto arg_passed_twice; } argname++; } } } else #endif if (likely(PyUnicode_Check(key))) { while (*name) { int cmp = (**name == key) ? 0 : #if !CYTHON_COMPILING_IN_PYPY && PY_MAJOR_VERSION >= 3 (PyUnicode_GET_SIZE(**name) != PyUnicode_GET_SIZE(key)) ? 1 : #endif PyUnicode_Compare(**name, key); if (cmp < 0 && unlikely(PyErr_Occurred())) goto bad; if (cmp == 0) { values[name-argnames] = value; break; } name++; } if (*name) continue; else { PyObject*** argname = argnames; while (argname != first_kw_arg) { int cmp = (**argname == key) ? 0 : #if !CYTHON_COMPILING_IN_PYPY && PY_MAJOR_VERSION >= 3 (PyUnicode_GET_SIZE(**argname) != PyUnicode_GET_SIZE(key)) ? 1 : #endif PyUnicode_Compare(**argname, key); if (cmp < 0 && unlikely(PyErr_Occurred())) goto bad; if (cmp == 0) goto arg_passed_twice; argname++; } } } else goto invalid_keyword_type; if (kwds2) { if (unlikely(PyDict_SetItem(kwds2, key, value))) goto bad; } else { goto invalid_keyword; } } return 0; arg_passed_twice: __Pyx_RaiseDoubleKeywordsError(function_name, key); goto bad; invalid_keyword_type: PyErr_Format(PyExc_TypeError, "%.200s() keywords must be strings", function_name); goto bad; invalid_keyword: PyErr_Format(PyExc_TypeError, #if PY_MAJOR_VERSION < 3 "%.200s() got an unexpected keyword argument '%.200s'", function_name, PyString_AsString(key)); #else "%s() got an unexpected keyword argument '%U'", function_name, key); #endif bad: return -1; } static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list, int level) { PyObject *empty_list = 0; PyObject *module = 0; PyObject *global_dict = 0; PyObject *empty_dict = 0; PyObject *list; #if PY_VERSION_HEX < 0x03030000 PyObject *py_import; py_import = __Pyx_PyObject_GetAttrStr(__pyx_b, __pyx_n_s_import); if (!py_import) goto bad; #endif if (from_list) list = from_list; else { empty_list = PyList_New(0); if (!empty_list) goto bad; list = empty_list; } global_dict = PyModule_GetDict(__pyx_m); if (!global_dict) goto bad; empty_dict = PyDict_New(); if (!empty_dict) goto bad; { #if PY_MAJOR_VERSION >= 3 if (level == -1) { if (strchr(__Pyx_MODULE_NAME, '.')) { #if PY_VERSION_HEX < 0x03030000 PyObject *py_level = PyInt_FromLong(1); if (!py_level) goto bad; module = PyObject_CallFunctionObjArgs(py_import, name, global_dict, empty_dict, list, py_level, NULL); Py_DECREF(py_level); #else module = PyImport_ImportModuleLevelObject( name, global_dict, empty_dict, list, 1); #endif if (!module) { if (!PyErr_ExceptionMatches(PyExc_ImportError)) goto bad; PyErr_Clear(); } } level = 0; } #endif if (!module) { #if PY_VERSION_HEX < 0x03030000 PyObject *py_level = PyInt_FromLong(level); if (!py_level) goto bad; module = PyObject_CallFunctionObjArgs(py_import, name, global_dict, empty_dict, list, py_level, NULL); Py_DECREF(py_level); #else module = PyImport_ImportModuleLevelObject( name, global_dict, empty_dict, list, level); #endif } } bad: #if PY_VERSION_HEX < 0x03030000 Py_XDECREF(py_import); #endif Py_XDECREF(empty_list); Py_XDECREF(empty_dict); return module; } static PyObject* __Pyx_ImportFrom(PyObject* module, PyObject* name) { PyObject* value = __Pyx_PyObject_GetAttrStr(module, name); if (unlikely(!value) && PyErr_ExceptionMatches(PyExc_AttributeError)) { PyErr_Format(PyExc_ImportError, #if PY_MAJOR_VERSION < 3 "cannot import name %.230s", PyString_AS_STRING(name)); #else "cannot import name %S", name); #endif } return value; } static int __pyx_bisect_code_objects(__Pyx_CodeObjectCacheEntry* entries, int count, int code_line) { int start = 0, mid = 0, end = count - 1; if (end >= 0 && code_line > entries[end].code_line) { return count; } while (start < end) { mid = start + (end - start) / 2; if (code_line < entries[mid].code_line) { end = mid; } else if (code_line > entries[mid].code_line) { start = mid + 1; } else { return mid; } } if (code_line <= entries[mid].code_line) { return mid; } else { return mid + 1; } } static PyCodeObject *__pyx_find_code_object(int code_line) { PyCodeObject* code_object; int pos; if (unlikely(!code_line) || unlikely(!__pyx_code_cache.entries)) { return NULL; } pos = __pyx_bisect_code_objects(__pyx_code_cache.entries, __pyx_code_cache.count, code_line); if (unlikely(pos >= __pyx_code_cache.count) || unlikely(__pyx_code_cache.entries[pos].code_line != code_line)) { return NULL; } code_object = __pyx_code_cache.entries[pos].code_object; Py_INCREF(code_object); return code_object; } static void __pyx_insert_code_object(int code_line, PyCodeObject* code_object) { int pos, i; __Pyx_CodeObjectCacheEntry* entries = __pyx_code_cache.entries; if (unlikely(!code_line)) { return; } if (unlikely(!entries)) { entries = (__Pyx_CodeObjectCacheEntry*)PyMem_Malloc(64*sizeof(__Pyx_CodeObjectCacheEntry)); if (likely(entries)) { __pyx_code_cache.entries = entries; __pyx_code_cache.max_count = 64; __pyx_code_cache.count = 1; entries[0].code_line = code_line; entries[0].code_object = code_object; Py_INCREF(code_object); } return; } pos = __pyx_bisect_code_objects(__pyx_code_cache.entries, __pyx_code_cache.count, code_line); if ((pos < __pyx_code_cache.count) && unlikely(__pyx_code_cache.entries[pos].code_line == code_line)) { PyCodeObject* tmp = entries[pos].code_object; entries[pos].code_object = code_object; Py_DECREF(tmp); return; } if (__pyx_code_cache.count == __pyx_code_cache.max_count) { int new_max = __pyx_code_cache.max_count + 64; entries = (__Pyx_CodeObjectCacheEntry*)PyMem_Realloc( __pyx_code_cache.entries, (size_t)new_max*sizeof(__Pyx_CodeObjectCacheEntry)); if (unlikely(!entries)) { return; } __pyx_code_cache.entries = entries; __pyx_code_cache.max_count = new_max; } for (i=__pyx_code_cache.count; i>pos; i--) { entries[i] = entries[i-1]; } entries[pos].code_line = code_line; entries[pos].code_object = code_object; __pyx_code_cache.count++; Py_INCREF(code_object); } #include "compile.h" #include "frameobject.h" #include "traceback.h" static PyCodeObject* __Pyx_CreateCodeObjectForTraceback( const char *funcname, int c_line, int py_line, const char *filename) { PyCodeObject *py_code = 0; PyObject *py_srcfile = 0; PyObject *py_funcname = 0; #if PY_MAJOR_VERSION < 3 py_srcfile = PyString_FromString(filename); #else py_srcfile = PyUnicode_FromString(filename); #endif if (!py_srcfile) goto bad; if (c_line) { #if PY_MAJOR_VERSION < 3 py_funcname = PyString_FromFormat( "%s (%s:%d)", funcname, __pyx_cfilenm, c_line); #else py_funcname = PyUnicode_FromFormat( "%s (%s:%d)", funcname, __pyx_cfilenm, c_line); #endif } else { #if PY_MAJOR_VERSION < 3 py_funcname = PyString_FromString(funcname); #else py_funcname = PyUnicode_FromString(funcname); #endif } if (!py_funcname) goto bad; py_code = __Pyx_PyCode_New( 0, 0, 0, 0, 0, __pyx_empty_bytes, /*PyObject *code,*/ __pyx_empty_tuple, /*PyObject *consts,*/ __pyx_empty_tuple, /*PyObject *names,*/ __pyx_empty_tuple, /*PyObject *varnames,*/ __pyx_empty_tuple, /*PyObject *freevars,*/ __pyx_empty_tuple, /*PyObject *cellvars,*/ py_srcfile, /*PyObject *filename,*/ py_funcname, /*PyObject *name,*/ py_line, __pyx_empty_bytes /*PyObject *lnotab*/ ); Py_DECREF(py_srcfile); Py_DECREF(py_funcname); return py_code; bad: Py_XDECREF(py_srcfile); Py_XDECREF(py_funcname); return NULL; } static void __Pyx_AddTraceback(const char *funcname, int c_line, int py_line, const char *filename) { PyCodeObject *py_code = 0; PyFrameObject *py_frame = 0; py_code = __pyx_find_code_object(c_line ? c_line : py_line); if (!py_code) { py_code = __Pyx_CreateCodeObjectForTraceback( funcname, c_line, py_line, filename); if (!py_code) goto bad; __pyx_insert_code_object(c_line ? c_line : py_line, py_code); } py_frame = PyFrame_New( PyThreadState_GET(), /*PyThreadState *tstate,*/ py_code, /*PyCodeObject *code,*/ __pyx_d, /*PyObject *globals,*/ 0 /*PyObject *locals*/ ); if (!py_frame) goto bad; py_frame->f_lineno = py_line; PyTraceBack_Here(py_frame); bad: Py_XDECREF(py_code); Py_XDECREF(py_frame); } static CYTHON_INLINE PyObject* __Pyx_PyInt_From_int(int value) { const int neg_one = (int) -1, const_zero = (int) 0; const int is_unsigned = neg_one > const_zero; if (is_unsigned) { if (sizeof(int) < sizeof(long)) { return PyInt_FromLong((long) value); } else if (sizeof(int) <= sizeof(unsigned long)) { return PyLong_FromUnsignedLong((unsigned long) value); } else if (sizeof(int) <= sizeof(unsigned PY_LONG_LONG)) { return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value); } } else { if (sizeof(int) <= sizeof(long)) { return PyInt_FromLong((long) value); } else if (sizeof(int) <= sizeof(PY_LONG_LONG)) { return PyLong_FromLongLong((PY_LONG_LONG) value); } } { int one = 1; int little = (int)*(unsigned char *)&one; unsigned char *bytes = (unsigned char *)&value; return _PyLong_FromByteArray(bytes, sizeof(int), little, !is_unsigned); } } #define __PYX_VERIFY_RETURN_INT(target_type, func_type, func_value)\ __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, 0) #define __PYX_VERIFY_RETURN_INT_EXC(target_type, func_type, func_value)\ __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, 1) #define __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, exc)\ {\ func_type value = func_value;\ if (sizeof(target_type) < sizeof(func_type)) {\ if (unlikely(value != (func_type) (target_type) value)) {\ func_type zero = 0;\ if (exc && unlikely(value == (func_type)-1 && PyErr_Occurred()))\ return (target_type) -1;\ if (is_unsigned && unlikely(value < zero))\ goto raise_neg_overflow;\ else\ goto raise_overflow;\ }\ }\ return (target_type) value;\ } #if CYTHON_USE_PYLONG_INTERNALS #include "longintrepr.h" #endif static CYTHON_INLINE int __Pyx_PyInt_As_int(PyObject *x) { const int neg_one = (int) -1, const_zero = (int) 0; const int is_unsigned = neg_one > const_zero; #if PY_MAJOR_VERSION < 3 if (likely(PyInt_Check(x))) { if (sizeof(int) < sizeof(long)) { __PYX_VERIFY_RETURN_INT(int, long, PyInt_AS_LONG(x)) } else { long val = PyInt_AS_LONG(x); if (is_unsigned && unlikely(val < 0)) { goto raise_neg_overflow; } return (int) val; } } else #endif if (likely(PyLong_Check(x))) { if (is_unsigned) { #if CYTHON_USE_PYLONG_INTERNALS const digit* digits = ((PyLongObject*)x)->ob_digit; switch (Py_SIZE(x)) { case 0: return (int) 0; case 1: __PYX_VERIFY_RETURN_INT(int, digit, digits[0]) case 2: if (8 * sizeof(int) > 1 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(int) >= 2 * PyLong_SHIFT) { return (int) (((((int)digits[1]) << PyLong_SHIFT) | (int)digits[0])); } } break; case 3: if (8 * sizeof(int) > 2 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(int) >= 3 * PyLong_SHIFT) { return (int) (((((((int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0])); } } break; case 4: if (8 * sizeof(int) > 3 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(int) >= 4 * PyLong_SHIFT) { return (int) (((((((((int)digits[3]) << PyLong_SHIFT) | (int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0])); } } break; } #endif #if CYTHON_COMPILING_IN_CPYTHON if (unlikely(Py_SIZE(x) < 0)) { goto raise_neg_overflow; } #else { int result = PyObject_RichCompareBool(x, Py_False, Py_LT); if (unlikely(result < 0)) return (int) -1; if (unlikely(result == 1)) goto raise_neg_overflow; } #endif if (sizeof(int) <= sizeof(unsigned long)) { __PYX_VERIFY_RETURN_INT_EXC(int, unsigned long, PyLong_AsUnsignedLong(x)) } else if (sizeof(int) <= sizeof(unsigned PY_LONG_LONG)) { __PYX_VERIFY_RETURN_INT_EXC(int, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x)) } } else { #if CYTHON_USE_PYLONG_INTERNALS const digit* digits = ((PyLongObject*)x)->ob_digit; switch (Py_SIZE(x)) { case 0: return (int) 0; case -1: __PYX_VERIFY_RETURN_INT(int, sdigit, -(sdigit) digits[0]) case 1: __PYX_VERIFY_RETURN_INT(int, digit, +digits[0]) case -2: if (8 * sizeof(int) - 1 > 1 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(int, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(int) - 1 > 2 * PyLong_SHIFT) { return (int) (((int)-1)*(((((int)digits[1]) << PyLong_SHIFT) | (int)digits[0]))); } } break; case 2: if (8 * sizeof(int) > 1 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(int) - 1 > 2 * PyLong_SHIFT) { return (int) ((((((int)digits[1]) << PyLong_SHIFT) | (int)digits[0]))); } } break; case -3: if (8 * sizeof(int) - 1 > 2 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(int, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(int) - 1 > 3 * PyLong_SHIFT) { return (int) (((int)-1)*(((((((int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0]))); } } break; case 3: if (8 * sizeof(int) > 2 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(int) - 1 > 3 * PyLong_SHIFT) { return (int) ((((((((int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0]))); } } break; case -4: if (8 * sizeof(int) - 1 > 3 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(int, long, -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(int) - 1 > 4 * PyLong_SHIFT) { return (int) (((int)-1)*(((((((((int)digits[3]) << PyLong_SHIFT) | (int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0]))); } } break; case 4: if (8 * sizeof(int) > 3 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(int) - 1 > 4 * PyLong_SHIFT) { return (int) ((((((((((int)digits[3]) << PyLong_SHIFT) | (int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0]))); } } break; } #endif if (sizeof(int) <= sizeof(long)) { __PYX_VERIFY_RETURN_INT_EXC(int, long, PyLong_AsLong(x)) } else if (sizeof(int) <= sizeof(PY_LONG_LONG)) { __PYX_VERIFY_RETURN_INT_EXC(int, PY_LONG_LONG, PyLong_AsLongLong(x)) } } { #if CYTHON_COMPILING_IN_PYPY && !defined(_PyLong_AsByteArray) PyErr_SetString(PyExc_RuntimeError, "_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers"); #else int val; PyObject *v = __Pyx_PyNumber_Int(x); #if PY_MAJOR_VERSION < 3 if (likely(v) && !PyLong_Check(v)) { PyObject *tmp = v; v = PyNumber_Long(tmp); Py_DECREF(tmp); } #endif if (likely(v)) { int one = 1; int is_little = (int)*(unsigned char *)&one; unsigned char *bytes = (unsigned char *)&val; int ret = _PyLong_AsByteArray((PyLongObject *)v, bytes, sizeof(val), is_little, !is_unsigned); Py_DECREF(v); if (likely(!ret)) return val; } #endif return (int) -1; } } else { int val; PyObject *tmp = __Pyx_PyNumber_Int(x); if (!tmp) return (int) -1; val = __Pyx_PyInt_As_int(tmp); Py_DECREF(tmp); return val; } raise_overflow: PyErr_SetString(PyExc_OverflowError, "value too large to convert to int"); return (int) -1; raise_neg_overflow: PyErr_SetString(PyExc_OverflowError, "can't convert negative value to int"); return (int) -1; } static CYTHON_INLINE PyObject* __Pyx_PyInt_From_int32_t(int32_t value) { const int32_t neg_one = (int32_t) -1, const_zero = (int32_t) 0; const int is_unsigned = neg_one > const_zero; if (is_unsigned) { if (sizeof(int32_t) < sizeof(long)) { return PyInt_FromLong((long) value); } else if (sizeof(int32_t) <= sizeof(unsigned long)) { return PyLong_FromUnsignedLong((unsigned long) value); } else if (sizeof(int32_t) <= sizeof(unsigned PY_LONG_LONG)) { return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value); } } else { if (sizeof(int32_t) <= sizeof(long)) { return PyInt_FromLong((long) value); } else if (sizeof(int32_t) <= sizeof(PY_LONG_LONG)) { return PyLong_FromLongLong((PY_LONG_LONG) value); } } { int one = 1; int little = (int)*(unsigned char *)&one; unsigned char *bytes = (unsigned char *)&value; return _PyLong_FromByteArray(bytes, sizeof(int32_t), little, !is_unsigned); } } static CYTHON_INLINE PyObject* __Pyx_PyInt_From_long(long value) { const long neg_one = (long) -1, const_zero = (long) 0; const int is_unsigned = neg_one > const_zero; if (is_unsigned) { if (sizeof(long) < sizeof(long)) { return PyInt_FromLong((long) value); } else if (sizeof(long) <= sizeof(unsigned long)) { return PyLong_FromUnsignedLong((unsigned long) value); } else if (sizeof(long) <= sizeof(unsigned PY_LONG_LONG)) { return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value); } } else { if (sizeof(long) <= sizeof(long)) { return PyInt_FromLong((long) value); } else if (sizeof(long) <= sizeof(PY_LONG_LONG)) { return PyLong_FromLongLong((PY_LONG_LONG) value); } } { int one = 1; int little = (int)*(unsigned char *)&one; unsigned char *bytes = (unsigned char *)&value; return _PyLong_FromByteArray(bytes, sizeof(long), little, !is_unsigned); } } static CYTHON_INLINE long __Pyx_PyInt_As_long(PyObject *x) { const long neg_one = (long) -1, const_zero = (long) 0; const int is_unsigned = neg_one > const_zero; #if PY_MAJOR_VERSION < 3 if (likely(PyInt_Check(x))) { if (sizeof(long) < sizeof(long)) { __PYX_VERIFY_RETURN_INT(long, long, PyInt_AS_LONG(x)) } else { long val = PyInt_AS_LONG(x); if (is_unsigned && unlikely(val < 0)) { goto raise_neg_overflow; } return (long) val; } } else #endif if (likely(PyLong_Check(x))) { if (is_unsigned) { #if CYTHON_USE_PYLONG_INTERNALS const digit* digits = ((PyLongObject*)x)->ob_digit; switch (Py_SIZE(x)) { case 0: return (long) 0; case 1: __PYX_VERIFY_RETURN_INT(long, digit, digits[0]) case 2: if (8 * sizeof(long) > 1 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(long) >= 2 * PyLong_SHIFT) { return (long) (((((long)digits[1]) << PyLong_SHIFT) | (long)digits[0])); } } break; case 3: if (8 * sizeof(long) > 2 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(long) >= 3 * PyLong_SHIFT) { return (long) (((((((long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0])); } } break; case 4: if (8 * sizeof(long) > 3 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(long) >= 4 * PyLong_SHIFT) { return (long) (((((((((long)digits[3]) << PyLong_SHIFT) | (long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0])); } } break; } #endif #if CYTHON_COMPILING_IN_CPYTHON if (unlikely(Py_SIZE(x) < 0)) { goto raise_neg_overflow; } #else { int result = PyObject_RichCompareBool(x, Py_False, Py_LT); if (unlikely(result < 0)) return (long) -1; if (unlikely(result == 1)) goto raise_neg_overflow; } #endif if (sizeof(long) <= sizeof(unsigned long)) { __PYX_VERIFY_RETURN_INT_EXC(long, unsigned long, PyLong_AsUnsignedLong(x)) } else if (sizeof(long) <= sizeof(unsigned PY_LONG_LONG)) { __PYX_VERIFY_RETURN_INT_EXC(long, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x)) } } else { #if CYTHON_USE_PYLONG_INTERNALS const digit* digits = ((PyLongObject*)x)->ob_digit; switch (Py_SIZE(x)) { case 0: return (long) 0; case -1: __PYX_VERIFY_RETURN_INT(long, sdigit, -(sdigit) digits[0]) case 1: __PYX_VERIFY_RETURN_INT(long, digit, +digits[0]) case -2: if (8 * sizeof(long) - 1 > 1 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(long, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) { return (long) (((long)-1)*(((((long)digits[1]) << PyLong_SHIFT) | (long)digits[0]))); } } break; case 2: if (8 * sizeof(long) > 1 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) { return (long) ((((((long)digits[1]) << PyLong_SHIFT) | (long)digits[0]))); } } break; case -3: if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(long, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) { return (long) (((long)-1)*(((((((long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0]))); } } break; case 3: if (8 * sizeof(long) > 2 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) { return (long) ((((((((long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0]))); } } break; case -4: if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(long, long, -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(long) - 1 > 4 * PyLong_SHIFT) { return (long) (((long)-1)*(((((((((long)digits[3]) << PyLong_SHIFT) | (long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0]))); } } break; case 4: if (8 * sizeof(long) > 3 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(long) - 1 > 4 * PyLong_SHIFT) { return (long) ((((((((((long)digits[3]) << PyLong_SHIFT) | (long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0]))); } } break; } #endif if (sizeof(long) <= sizeof(long)) { __PYX_VERIFY_RETURN_INT_EXC(long, long, PyLong_AsLong(x)) } else if (sizeof(long) <= sizeof(PY_LONG_LONG)) { __PYX_VERIFY_RETURN_INT_EXC(long, PY_LONG_LONG, PyLong_AsLongLong(x)) } } { #if CYTHON_COMPILING_IN_PYPY && !defined(_PyLong_AsByteArray) PyErr_SetString(PyExc_RuntimeError, "_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers"); #else long val; PyObject *v = __Pyx_PyNumber_Int(x); #if PY_MAJOR_VERSION < 3 if (likely(v) && !PyLong_Check(v)) { PyObject *tmp = v; v = PyNumber_Long(tmp); Py_DECREF(tmp); } #endif if (likely(v)) { int one = 1; int is_little = (int)*(unsigned char *)&one; unsigned char *bytes = (unsigned char *)&val; int ret = _PyLong_AsByteArray((PyLongObject *)v, bytes, sizeof(val), is_little, !is_unsigned); Py_DECREF(v); if (likely(!ret)) return val; } #endif return (long) -1; } } else { long val; PyObject *tmp = __Pyx_PyNumber_Int(x); if (!tmp) return (long) -1; val = __Pyx_PyInt_As_long(tmp); Py_DECREF(tmp); return val; } raise_overflow: PyErr_SetString(PyExc_OverflowError, "value too large to convert to long"); return (long) -1; raise_neg_overflow: PyErr_SetString(PyExc_OverflowError, "can't convert negative value to long"); return (long) -1; } static int __Pyx_check_binary_version(void) { char ctversion[4], rtversion[4]; PyOS_snprintf(ctversion, 4, "%d.%d", PY_MAJOR_VERSION, PY_MINOR_VERSION); PyOS_snprintf(rtversion, 4, "%s", Py_GetVersion()); if (ctversion[0] != rtversion[0] || ctversion[2] != rtversion[2]) { char message[200]; PyOS_snprintf(message, sizeof(message), "compiletime version %s of module '%.100s' " "does not match runtime version %s", ctversion, __Pyx_MODULE_NAME, rtversion); return PyErr_WarnEx(NULL, message, 1); } return 0; } static int __Pyx_InitStrings(__Pyx_StringTabEntry *t) { while (t->p) { #if PY_MAJOR_VERSION < 3 if (t->is_unicode) { *t->p = PyUnicode_DecodeUTF8(t->s, t->n - 1, NULL); } else if (t->intern) { *t->p = PyString_InternFromString(t->s); } else { *t->p = PyString_FromStringAndSize(t->s, t->n - 1); } #else if (t->is_unicode | t->is_str) { if (t->intern) { *t->p = PyUnicode_InternFromString(t->s); } else if (t->encoding) { *t->p = PyUnicode_Decode(t->s, t->n - 1, t->encoding, NULL); } else { *t->p = PyUnicode_FromStringAndSize(t->s, t->n - 1); } } else { *t->p = PyBytes_FromStringAndSize(t->s, t->n - 1); } #endif if (!*t->p) return -1; ++t; } return 0; } static CYTHON_INLINE PyObject* __Pyx_PyUnicode_FromString(const char* c_str) { return __Pyx_PyUnicode_FromStringAndSize(c_str, (Py_ssize_t)strlen(c_str)); } static CYTHON_INLINE char* __Pyx_PyObject_AsString(PyObject* o) { Py_ssize_t ignore; return __Pyx_PyObject_AsStringAndSize(o, &ignore); } static CYTHON_INLINE char* __Pyx_PyObject_AsStringAndSize(PyObject* o, Py_ssize_t *length) { #if CYTHON_COMPILING_IN_CPYTHON && (__PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT) if ( #if PY_MAJOR_VERSION < 3 && __PYX_DEFAULT_STRING_ENCODING_IS_ASCII __Pyx_sys_getdefaultencoding_not_ascii && #endif PyUnicode_Check(o)) { #if PY_VERSION_HEX < 0x03030000 char* defenc_c; PyObject* defenc = _PyUnicode_AsDefaultEncodedString(o, NULL); if (!defenc) return NULL; defenc_c = PyBytes_AS_STRING(defenc); #if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII { char* end = defenc_c + PyBytes_GET_SIZE(defenc); char* c; for (c = defenc_c; c < end; c++) { if ((unsigned char) (*c) >= 128) { PyUnicode_AsASCIIString(o); return NULL; } } } #endif *length = PyBytes_GET_SIZE(defenc); return defenc_c; #else if (__Pyx_PyUnicode_READY(o) == -1) return NULL; #if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII if (PyUnicode_IS_ASCII(o)) { *length = PyUnicode_GET_LENGTH(o); return PyUnicode_AsUTF8(o); } else { PyUnicode_AsASCIIString(o); return NULL; } #else return PyUnicode_AsUTF8AndSize(o, length); #endif #endif } else #endif #if (!CYTHON_COMPILING_IN_PYPY) || (defined(PyByteArray_AS_STRING) && defined(PyByteArray_GET_SIZE)) if (PyByteArray_Check(o)) { *length = PyByteArray_GET_SIZE(o); return PyByteArray_AS_STRING(o); } else #endif { char* result; int r = PyBytes_AsStringAndSize(o, &result, length); if (unlikely(r < 0)) { return NULL; } else { return result; } } } static CYTHON_INLINE int __Pyx_PyObject_IsTrue(PyObject* x) { int is_true = x == Py_True; if (is_true | (x == Py_False) | (x == Py_None)) return is_true; else return PyObject_IsTrue(x); } static CYTHON_INLINE PyObject* __Pyx_PyNumber_Int(PyObject* x) { PyNumberMethods *m; const char *name = NULL; PyObject *res = NULL; #if PY_MAJOR_VERSION < 3 if (PyInt_Check(x) || PyLong_Check(x)) #else if (PyLong_Check(x)) #endif return __Pyx_NewRef(x); m = Py_TYPE(x)->tp_as_number; #if PY_MAJOR_VERSION < 3 if (m && m->nb_int) { name = "int"; res = PyNumber_Int(x); } else if (m && m->nb_long) { name = "long"; res = PyNumber_Long(x); } #else if (m && m->nb_int) { name = "int"; res = PyNumber_Long(x); } #endif if (res) { #if PY_MAJOR_VERSION < 3 if (!PyInt_Check(res) && !PyLong_Check(res)) { #else if (!PyLong_Check(res)) { #endif PyErr_Format(PyExc_TypeError, "__%.4s__ returned non-%.4s (type %.200s)", name, name, Py_TYPE(res)->tp_name); Py_DECREF(res); return NULL; } } else if (!PyErr_Occurred()) { PyErr_SetString(PyExc_TypeError, "an integer is required"); } return res; } static CYTHON_INLINE Py_ssize_t __Pyx_PyIndex_AsSsize_t(PyObject* b) { Py_ssize_t ival; PyObject *x; #if PY_MAJOR_VERSION < 3 if (likely(PyInt_CheckExact(b))) { if (sizeof(Py_ssize_t) >= sizeof(long)) return PyInt_AS_LONG(b); else return PyInt_AsSsize_t(x); } #endif if (likely(PyLong_CheckExact(b))) { #if CYTHON_USE_PYLONG_INTERNALS const digit* digits = ((PyLongObject*)b)->ob_digit; const Py_ssize_t size = Py_SIZE(b); if (likely(__Pyx_sst_abs(size) <= 1)) { ival = likely(size) ? digits[0] : 0; if (size == -1) ival = -ival; return ival; } else { switch (size) { case 2: if (8 * sizeof(Py_ssize_t) > 2 * PyLong_SHIFT) { return (Py_ssize_t) (((((size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])); } break; case -2: if (8 * sizeof(Py_ssize_t) > 2 * PyLong_SHIFT) { return -(Py_ssize_t) (((((size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])); } break; case 3: if (8 * sizeof(Py_ssize_t) > 3 * PyLong_SHIFT) { return (Py_ssize_t) (((((((size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])); } break; case -3: if (8 * sizeof(Py_ssize_t) > 3 * PyLong_SHIFT) { return -(Py_ssize_t) (((((((size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])); } break; case 4: if (8 * sizeof(Py_ssize_t) > 4 * PyLong_SHIFT) { return (Py_ssize_t) (((((((((size_t)digits[3]) << PyLong_SHIFT) | (size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])); } break; case -4: if (8 * sizeof(Py_ssize_t) > 4 * PyLong_SHIFT) { return -(Py_ssize_t) (((((((((size_t)digits[3]) << PyLong_SHIFT) | (size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])); } break; } } #endif return PyLong_AsSsize_t(b); } x = PyNumber_Index(b); if (!x) return -1; ival = PyInt_AsSsize_t(x); Py_DECREF(x); return ival; } static CYTHON_INLINE PyObject * __Pyx_PyInt_FromSize_t(size_t ival) { return PyInt_FromSize_t(ival); } #endif /* Py_PYTHON_H */ pygame_sdl2-2.1.0-for-renpy-6.99.14.1/gen/pygame_sdl2.gfxdraw.c0000664000175000017500000172405113053465755023061 0ustar tomtom00000000000000/* Generated by Cython 0.23.5 */ #define PY_SSIZE_T_CLEAN #include "Python.h" #ifndef Py_PYTHON_H #error Python headers needed to compile C extensions, please install development version of Python. #elif PY_VERSION_HEX < 0x02060000 || (0x03000000 <= PY_VERSION_HEX && PY_VERSION_HEX < 0x03020000) #error Cython requires Python 2.6+ or Python 3.2+. #else #define CYTHON_ABI "0_23_5" #include #ifndef offsetof #define offsetof(type, member) ( (size_t) & ((type*)0) -> member ) #endif #if !defined(WIN32) && !defined(MS_WINDOWS) #ifndef __stdcall #define __stdcall #endif #ifndef __cdecl #define __cdecl #endif #ifndef __fastcall #define __fastcall #endif #endif #ifndef DL_IMPORT #define DL_IMPORT(t) t #endif #ifndef DL_EXPORT #define DL_EXPORT(t) t #endif #ifndef PY_LONG_LONG #define PY_LONG_LONG LONG_LONG #endif #ifndef Py_HUGE_VAL #define Py_HUGE_VAL HUGE_VAL #endif #ifdef PYPY_VERSION #define CYTHON_COMPILING_IN_PYPY 1 #define CYTHON_COMPILING_IN_CPYTHON 0 #else #define CYTHON_COMPILING_IN_PYPY 0 #define CYTHON_COMPILING_IN_CPYTHON 1 #endif #if !defined(CYTHON_USE_PYLONG_INTERNALS) && CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x02070000 #define CYTHON_USE_PYLONG_INTERNALS 1 #endif #if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX < 0x02070600 && !defined(Py_OptimizeFlag) #define Py_OptimizeFlag 0 #endif #define __PYX_BUILD_PY_SSIZE_T "n" #define CYTHON_FORMAT_SSIZE_T "z" #if PY_MAJOR_VERSION < 3 #define __Pyx_BUILTIN_MODULE_NAME "__builtin__" #define __Pyx_PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)\ PyCode_New(a+k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos) #define __Pyx_DefaultClassType PyClass_Type #else #define __Pyx_BUILTIN_MODULE_NAME "builtins" #define __Pyx_PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)\ PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos) #define __Pyx_DefaultClassType PyType_Type #endif #ifndef Py_TPFLAGS_CHECKTYPES #define Py_TPFLAGS_CHECKTYPES 0 #endif #ifndef Py_TPFLAGS_HAVE_INDEX #define Py_TPFLAGS_HAVE_INDEX 0 #endif #ifndef Py_TPFLAGS_HAVE_NEWBUFFER #define Py_TPFLAGS_HAVE_NEWBUFFER 0 #endif #ifndef Py_TPFLAGS_HAVE_FINALIZE #define Py_TPFLAGS_HAVE_FINALIZE 0 #endif #if PY_VERSION_HEX > 0x03030000 && defined(PyUnicode_KIND) #define CYTHON_PEP393_ENABLED 1 #define __Pyx_PyUnicode_READY(op) (likely(PyUnicode_IS_READY(op)) ?\ 0 : _PyUnicode_Ready((PyObject *)(op))) #define __Pyx_PyUnicode_GET_LENGTH(u) PyUnicode_GET_LENGTH(u) #define __Pyx_PyUnicode_READ_CHAR(u, i) PyUnicode_READ_CHAR(u, i) #define __Pyx_PyUnicode_KIND(u) PyUnicode_KIND(u) #define __Pyx_PyUnicode_DATA(u) PyUnicode_DATA(u) #define __Pyx_PyUnicode_READ(k, d, i) PyUnicode_READ(k, d, i) #else #define CYTHON_PEP393_ENABLED 0 #define __Pyx_PyUnicode_READY(op) (0) #define __Pyx_PyUnicode_GET_LENGTH(u) PyUnicode_GET_SIZE(u) #define __Pyx_PyUnicode_READ_CHAR(u, i) ((Py_UCS4)(PyUnicode_AS_UNICODE(u)[i])) #define __Pyx_PyUnicode_KIND(u) (sizeof(Py_UNICODE)) #define __Pyx_PyUnicode_DATA(u) ((void*)PyUnicode_AS_UNICODE(u)) #define __Pyx_PyUnicode_READ(k, d, i) ((void)(k), (Py_UCS4)(((Py_UNICODE*)d)[i])) #endif #if CYTHON_COMPILING_IN_PYPY #define __Pyx_PyUnicode_Concat(a, b) PyNumber_Add(a, b) #define __Pyx_PyUnicode_ConcatSafe(a, b) PyNumber_Add(a, b) #else #define __Pyx_PyUnicode_Concat(a, b) PyUnicode_Concat(a, b) #define __Pyx_PyUnicode_ConcatSafe(a, b) ((unlikely((a) == Py_None) || unlikely((b) == Py_None)) ?\ PyNumber_Add(a, b) : __Pyx_PyUnicode_Concat(a, b)) #endif #if CYTHON_COMPILING_IN_PYPY && !defined(PyUnicode_Contains) #define PyUnicode_Contains(u, s) PySequence_Contains(u, s) #endif #define __Pyx_PyString_FormatSafe(a, b) ((unlikely((a) == Py_None)) ? PyNumber_Remainder(a, b) : __Pyx_PyString_Format(a, b)) #define __Pyx_PyUnicode_FormatSafe(a, b) ((unlikely((a) == Py_None)) ? PyNumber_Remainder(a, b) : PyUnicode_Format(a, b)) #if PY_MAJOR_VERSION >= 3 #define __Pyx_PyString_Format(a, b) PyUnicode_Format(a, b) #else #define __Pyx_PyString_Format(a, b) PyString_Format(a, b) #endif #if PY_MAJOR_VERSION >= 3 #define PyBaseString_Type PyUnicode_Type #define PyStringObject PyUnicodeObject #define PyString_Type PyUnicode_Type #define PyString_Check PyUnicode_Check #define PyString_CheckExact PyUnicode_CheckExact #endif #if PY_MAJOR_VERSION >= 3 #define __Pyx_PyBaseString_Check(obj) PyUnicode_Check(obj) #define __Pyx_PyBaseString_CheckExact(obj) PyUnicode_CheckExact(obj) #else #define __Pyx_PyBaseString_Check(obj) (PyString_Check(obj) || PyUnicode_Check(obj)) #define __Pyx_PyBaseString_CheckExact(obj) (PyString_CheckExact(obj) || PyUnicode_CheckExact(obj)) #endif #ifndef PySet_CheckExact #define PySet_CheckExact(obj) (Py_TYPE(obj) == &PySet_Type) #endif #define __Pyx_TypeCheck(obj, type) PyObject_TypeCheck(obj, (PyTypeObject *)type) #if PY_MAJOR_VERSION >= 3 #define PyIntObject PyLongObject #define PyInt_Type PyLong_Type #define PyInt_Check(op) PyLong_Check(op) #define PyInt_CheckExact(op) PyLong_CheckExact(op) #define PyInt_FromString PyLong_FromString #define PyInt_FromUnicode PyLong_FromUnicode #define PyInt_FromLong PyLong_FromLong #define PyInt_FromSize_t PyLong_FromSize_t #define PyInt_FromSsize_t PyLong_FromSsize_t #define PyInt_AsLong PyLong_AsLong #define PyInt_AS_LONG PyLong_AS_LONG #define PyInt_AsSsize_t PyLong_AsSsize_t #define PyInt_AsUnsignedLongMask PyLong_AsUnsignedLongMask #define PyInt_AsUnsignedLongLongMask PyLong_AsUnsignedLongLongMask #define PyNumber_Int PyNumber_Long #endif #if PY_MAJOR_VERSION >= 3 #define PyBoolObject PyLongObject #endif #if PY_MAJOR_VERSION >= 3 && CYTHON_COMPILING_IN_PYPY #ifndef PyUnicode_InternFromString #define PyUnicode_InternFromString(s) PyUnicode_FromString(s) #endif #endif #if PY_VERSION_HEX < 0x030200A4 typedef long Py_hash_t; #define __Pyx_PyInt_FromHash_t PyInt_FromLong #define __Pyx_PyInt_AsHash_t PyInt_AsLong #else #define __Pyx_PyInt_FromHash_t PyInt_FromSsize_t #define __Pyx_PyInt_AsHash_t PyInt_AsSsize_t #endif #if PY_MAJOR_VERSION >= 3 #define __Pyx_PyMethod_New(func, self, klass) ((self) ? PyMethod_New(func, self) : PyInstanceMethod_New(func)) #else #define __Pyx_PyMethod_New(func, self, klass) PyMethod_New(func, self, klass) #endif #if PY_VERSION_HEX >= 0x030500B1 #define __Pyx_PyAsyncMethodsStruct PyAsyncMethods #define __Pyx_PyType_AsAsync(obj) (Py_TYPE(obj)->tp_as_async) #elif CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3 typedef struct { unaryfunc am_await; unaryfunc am_aiter; unaryfunc am_anext; } __Pyx_PyAsyncMethodsStruct; #define __Pyx_PyType_AsAsync(obj) ((__Pyx_PyAsyncMethodsStruct*) (Py_TYPE(obj)->tp_reserved)) #else #define __Pyx_PyType_AsAsync(obj) NULL #endif #ifndef CYTHON_RESTRICT #if defined(__GNUC__) #define CYTHON_RESTRICT __restrict__ #elif defined(_MSC_VER) && _MSC_VER >= 1400 #define CYTHON_RESTRICT __restrict #elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L #define CYTHON_RESTRICT restrict #else #define CYTHON_RESTRICT #endif #endif #define __Pyx_void_to_None(void_result) ((void)(void_result), Py_INCREF(Py_None), Py_None) #ifndef CYTHON_INLINE #if defined(__GNUC__) #define CYTHON_INLINE __inline__ #elif defined(_MSC_VER) #define CYTHON_INLINE __inline #elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L #define CYTHON_INLINE inline #else #define CYTHON_INLINE #endif #endif #if defined(WIN32) || defined(MS_WINDOWS) #define _USE_MATH_DEFINES #endif #include #ifdef NAN #define __PYX_NAN() ((float) NAN) #else static CYTHON_INLINE float __PYX_NAN() { float value; memset(&value, 0xFF, sizeof(value)); return value; } #endif #if PY_MAJOR_VERSION >= 3 #define __Pyx_PyNumber_Divide(x,y) PyNumber_TrueDivide(x,y) #define __Pyx_PyNumber_InPlaceDivide(x,y) PyNumber_InPlaceTrueDivide(x,y) #else #define __Pyx_PyNumber_Divide(x,y) PyNumber_Divide(x,y) #define __Pyx_PyNumber_InPlaceDivide(x,y) PyNumber_InPlaceDivide(x,y) #endif #ifndef __PYX_EXTERN_C #ifdef __cplusplus #define __PYX_EXTERN_C extern "C" #else #define __PYX_EXTERN_C extern #endif #endif #define __PYX_HAVE__pygame_sdl2__gfxdraw #define __PYX_HAVE_API__pygame_sdl2__gfxdraw #include "stdint.h" #include "string.h" #include "stdio.h" #include "stddef.h" #include "SDL.h" #include "SDL2_rotozoom.h" #include "SDL_gfxPrimitives.h" #include "stdlib.h" #ifdef _OPENMP #include #endif /* _OPENMP */ #ifdef PYREX_WITHOUT_ASSERTIONS #define CYTHON_WITHOUT_ASSERTIONS #endif #ifndef CYTHON_UNUSED # if defined(__GNUC__) # if !(defined(__cplusplus)) || (__GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 4)) # define CYTHON_UNUSED __attribute__ ((__unused__)) # else # define CYTHON_UNUSED # endif # elif defined(__ICC) || (defined(__INTEL_COMPILER) && !defined(_MSC_VER)) # define CYTHON_UNUSED __attribute__ ((__unused__)) # else # define CYTHON_UNUSED # endif #endif #ifndef CYTHON_NCP_UNUSED # if CYTHON_COMPILING_IN_CPYTHON # define CYTHON_NCP_UNUSED # else # define CYTHON_NCP_UNUSED CYTHON_UNUSED # endif #endif typedef struct {PyObject **p; char *s; const Py_ssize_t n; const char* encoding; const char is_unicode; const char is_str; const char intern; } __Pyx_StringTabEntry; #define __PYX_DEFAULT_STRING_ENCODING_IS_ASCII 0 #define __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT 0 #define __PYX_DEFAULT_STRING_ENCODING "" #define __Pyx_PyObject_FromString __Pyx_PyBytes_FromString #define __Pyx_PyObject_FromStringAndSize __Pyx_PyBytes_FromStringAndSize #define __Pyx_uchar_cast(c) ((unsigned char)c) #define __Pyx_long_cast(x) ((long)x) #define __Pyx_fits_Py_ssize_t(v, type, is_signed) (\ (sizeof(type) < sizeof(Py_ssize_t)) ||\ (sizeof(type) > sizeof(Py_ssize_t) &&\ likely(v < (type)PY_SSIZE_T_MAX ||\ v == (type)PY_SSIZE_T_MAX) &&\ (!is_signed || likely(v > (type)PY_SSIZE_T_MIN ||\ v == (type)PY_SSIZE_T_MIN))) ||\ (sizeof(type) == sizeof(Py_ssize_t) &&\ (is_signed || likely(v < (type)PY_SSIZE_T_MAX ||\ v == (type)PY_SSIZE_T_MAX))) ) #if defined (__cplusplus) && __cplusplus >= 201103L #include #define __Pyx_sst_abs(value) std::abs(value) #elif SIZEOF_INT >= SIZEOF_SIZE_T #define __Pyx_sst_abs(value) abs(value) #elif SIZEOF_LONG >= SIZEOF_SIZE_T #define __Pyx_sst_abs(value) labs(value) #elif defined (_MSC_VER) && defined (_M_X64) #define __Pyx_sst_abs(value) _abs64(value) #elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L #define __Pyx_sst_abs(value) llabs(value) #elif defined (__GNUC__) #define __Pyx_sst_abs(value) __builtin_llabs(value) #else #define __Pyx_sst_abs(value) ((value<0) ? -value : value) #endif static CYTHON_INLINE char* __Pyx_PyObject_AsString(PyObject*); static CYTHON_INLINE char* __Pyx_PyObject_AsStringAndSize(PyObject*, Py_ssize_t* length); #define __Pyx_PyByteArray_FromString(s) PyByteArray_FromStringAndSize((const char*)s, strlen((const char*)s)) #define __Pyx_PyByteArray_FromStringAndSize(s, l) PyByteArray_FromStringAndSize((const char*)s, l) #define __Pyx_PyBytes_FromString PyBytes_FromString #define __Pyx_PyBytes_FromStringAndSize PyBytes_FromStringAndSize static CYTHON_INLINE PyObject* __Pyx_PyUnicode_FromString(const char*); #if PY_MAJOR_VERSION < 3 #define __Pyx_PyStr_FromString __Pyx_PyBytes_FromString #define __Pyx_PyStr_FromStringAndSize __Pyx_PyBytes_FromStringAndSize #else #define __Pyx_PyStr_FromString __Pyx_PyUnicode_FromString #define __Pyx_PyStr_FromStringAndSize __Pyx_PyUnicode_FromStringAndSize #endif #define __Pyx_PyObject_AsSString(s) ((signed char*) __Pyx_PyObject_AsString(s)) #define __Pyx_PyObject_AsUString(s) ((unsigned char*) __Pyx_PyObject_AsString(s)) #define __Pyx_PyObject_FromCString(s) __Pyx_PyObject_FromString((const char*)s) #define __Pyx_PyBytes_FromCString(s) __Pyx_PyBytes_FromString((const char*)s) #define __Pyx_PyByteArray_FromCString(s) __Pyx_PyByteArray_FromString((const char*)s) #define __Pyx_PyStr_FromCString(s) __Pyx_PyStr_FromString((const char*)s) #define __Pyx_PyUnicode_FromCString(s) __Pyx_PyUnicode_FromString((const char*)s) #if PY_MAJOR_VERSION < 3 static CYTHON_INLINE size_t __Pyx_Py_UNICODE_strlen(const Py_UNICODE *u) { const Py_UNICODE *u_end = u; while (*u_end++) ; return (size_t)(u_end - u - 1); } #else #define __Pyx_Py_UNICODE_strlen Py_UNICODE_strlen #endif #define __Pyx_PyUnicode_FromUnicode(u) PyUnicode_FromUnicode(u, __Pyx_Py_UNICODE_strlen(u)) #define __Pyx_PyUnicode_FromUnicodeAndLength PyUnicode_FromUnicode #define __Pyx_PyUnicode_AsUnicode PyUnicode_AsUnicode #define __Pyx_NewRef(obj) (Py_INCREF(obj), obj) #define __Pyx_Owned_Py_None(b) __Pyx_NewRef(Py_None) #define __Pyx_PyBool_FromLong(b) ((b) ? __Pyx_NewRef(Py_True) : __Pyx_NewRef(Py_False)) static CYTHON_INLINE int __Pyx_PyObject_IsTrue(PyObject*); static CYTHON_INLINE PyObject* __Pyx_PyNumber_Int(PyObject* x); static CYTHON_INLINE Py_ssize_t __Pyx_PyIndex_AsSsize_t(PyObject*); static CYTHON_INLINE PyObject * __Pyx_PyInt_FromSize_t(size_t); #if CYTHON_COMPILING_IN_CPYTHON #define __pyx_PyFloat_AsDouble(x) (PyFloat_CheckExact(x) ? PyFloat_AS_DOUBLE(x) : PyFloat_AsDouble(x)) #else #define __pyx_PyFloat_AsDouble(x) PyFloat_AsDouble(x) #endif #define __pyx_PyFloat_AsFloat(x) ((float) __pyx_PyFloat_AsDouble(x)) #if PY_MAJOR_VERSION < 3 && __PYX_DEFAULT_STRING_ENCODING_IS_ASCII static int __Pyx_sys_getdefaultencoding_not_ascii; static int __Pyx_init_sys_getdefaultencoding_params(void) { PyObject* sys; PyObject* default_encoding = NULL; PyObject* ascii_chars_u = NULL; PyObject* ascii_chars_b = NULL; const char* default_encoding_c; sys = PyImport_ImportModule("sys"); if (!sys) goto bad; default_encoding = PyObject_CallMethod(sys, (char*) "getdefaultencoding", NULL); Py_DECREF(sys); if (!default_encoding) goto bad; default_encoding_c = PyBytes_AsString(default_encoding); if (!default_encoding_c) goto bad; if (strcmp(default_encoding_c, "ascii") == 0) { __Pyx_sys_getdefaultencoding_not_ascii = 0; } else { char ascii_chars[128]; int c; for (c = 0; c < 128; c++) { ascii_chars[c] = c; } __Pyx_sys_getdefaultencoding_not_ascii = 1; ascii_chars_u = PyUnicode_DecodeASCII(ascii_chars, 128, NULL); if (!ascii_chars_u) goto bad; ascii_chars_b = PyUnicode_AsEncodedString(ascii_chars_u, default_encoding_c, NULL); if (!ascii_chars_b || !PyBytes_Check(ascii_chars_b) || memcmp(ascii_chars, PyBytes_AS_STRING(ascii_chars_b), 128) != 0) { PyErr_Format( PyExc_ValueError, "This module compiled with c_string_encoding=ascii, but default encoding '%.200s' is not a superset of ascii.", default_encoding_c); goto bad; } Py_DECREF(ascii_chars_u); Py_DECREF(ascii_chars_b); } Py_DECREF(default_encoding); return 0; bad: Py_XDECREF(default_encoding); Py_XDECREF(ascii_chars_u); Py_XDECREF(ascii_chars_b); return -1; } #endif #if __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT && PY_MAJOR_VERSION >= 3 #define __Pyx_PyUnicode_FromStringAndSize(c_str, size) PyUnicode_DecodeUTF8(c_str, size, NULL) #else #define __Pyx_PyUnicode_FromStringAndSize(c_str, size) PyUnicode_Decode(c_str, size, __PYX_DEFAULT_STRING_ENCODING, NULL) #if __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT static char* __PYX_DEFAULT_STRING_ENCODING; static int __Pyx_init_sys_getdefaultencoding_params(void) { PyObject* sys; PyObject* default_encoding = NULL; char* default_encoding_c; sys = PyImport_ImportModule("sys"); if (!sys) goto bad; default_encoding = PyObject_CallMethod(sys, (char*) (const char*) "getdefaultencoding", NULL); Py_DECREF(sys); if (!default_encoding) goto bad; default_encoding_c = PyBytes_AsString(default_encoding); if (!default_encoding_c) goto bad; __PYX_DEFAULT_STRING_ENCODING = (char*) malloc(strlen(default_encoding_c)); if (!__PYX_DEFAULT_STRING_ENCODING) goto bad; strcpy(__PYX_DEFAULT_STRING_ENCODING, default_encoding_c); Py_DECREF(default_encoding); return 0; bad: Py_XDECREF(default_encoding); return -1; } #endif #endif /* Test for GCC > 2.95 */ #if defined(__GNUC__) && (__GNUC__ > 2 || (__GNUC__ == 2 && (__GNUC_MINOR__ > 95))) #define likely(x) __builtin_expect(!!(x), 1) #define unlikely(x) __builtin_expect(!!(x), 0) #else /* !__GNUC__ or GCC < 2.95 */ #define likely(x) (x) #define unlikely(x) (x) #endif /* __GNUC__ */ static PyObject *__pyx_m; static PyObject *__pyx_d; static PyObject *__pyx_b; static PyObject *__pyx_empty_tuple; static PyObject *__pyx_empty_bytes; static int __pyx_lineno; static int __pyx_clineno = 0; static const char * __pyx_cfilenm= __FILE__; static const char *__pyx_filename; static const char *__pyx_f[] = { "src/pygame_sdl2/gfxdraw.pyx", "src/pygame_sdl2/surface.pxd", "src/pygame_sdl2/color.pxd", }; /*--- Type declarations ---*/ struct __pyx_obj_11pygame_sdl2_7surface_Surface; struct __pyx_obj_11pygame_sdl2_5color_Color; /* "pygame_sdl2/surface.pxd":23 * from sdl2 cimport SDL_Surface * * cdef class Surface: # <<<<<<<<<<<<<< * # Allow weak references. * cdef object __weakref__ */ struct __pyx_obj_11pygame_sdl2_7surface_Surface { PyObject_HEAD struct __pyx_vtabstruct_11pygame_sdl2_7surface_Surface *__pyx_vtab; PyObject *__weakref__; SDL_Surface *surface; int owns_surface; int window_surface; PyObject *locklist; struct __pyx_obj_11pygame_sdl2_7surface_Surface *parent; struct __pyx_obj_11pygame_sdl2_7surface_Surface *root; int offset_x; int offset_y; PyObject *get_window_flags; int has_alpha; }; /* "pygame_sdl2/color.pxd":26 * cdef to_sdl_color(color, SDL_Color *out) * * cdef class Color: # <<<<<<<<<<<<<< * # Allow weak references. * cdef object __weakref__ */ struct __pyx_obj_11pygame_sdl2_5color_Color { PyObject_HEAD struct __pyx_vtabstruct_11pygame_sdl2_5color_Color *__pyx_vtab; PyObject *__weakref__; Uint8 r; Uint8 g; Uint8 b; Uint8 a; uint8_t length; }; /* "pygame_sdl2/surface.pxd":23 * from sdl2 cimport SDL_Surface * * cdef class Surface: # <<<<<<<<<<<<<< * # Allow weak references. * cdef object __weakref__ */ struct __pyx_vtabstruct_11pygame_sdl2_7surface_Surface { void (*take_surface)(struct __pyx_obj_11pygame_sdl2_7surface_Surface *, SDL_Surface *); }; static struct __pyx_vtabstruct_11pygame_sdl2_7surface_Surface *__pyx_vtabptr_11pygame_sdl2_7surface_Surface; /* "pygame_sdl2/color.pxd":26 * cdef to_sdl_color(color, SDL_Color *out) * * cdef class Color: # <<<<<<<<<<<<<< * # Allow weak references. * cdef object __weakref__ */ struct __pyx_vtabstruct_11pygame_sdl2_5color_Color { PyObject *(*from_rgba)(struct __pyx_obj_11pygame_sdl2_5color_Color *, Uint8, Uint8, Uint8, Uint8); PyObject *(*from_name)(struct __pyx_obj_11pygame_sdl2_5color_Color *, PyObject *); PyObject *(*from_hex)(struct __pyx_obj_11pygame_sdl2_5color_Color *, PyObject *); }; static struct __pyx_vtabstruct_11pygame_sdl2_5color_Color *__pyx_vtabptr_11pygame_sdl2_5color_Color; /* --- Runtime support code (head) --- */ #ifndef CYTHON_REFNANNY #define CYTHON_REFNANNY 0 #endif #if CYTHON_REFNANNY typedef struct { void (*INCREF)(void*, PyObject*, int); void (*DECREF)(void*, PyObject*, int); void (*GOTREF)(void*, PyObject*, int); void (*GIVEREF)(void*, PyObject*, int); void* (*SetupContext)(const char*, int, const char*); void (*FinishContext)(void**); } __Pyx_RefNannyAPIStruct; static __Pyx_RefNannyAPIStruct *__Pyx_RefNanny = NULL; static __Pyx_RefNannyAPIStruct *__Pyx_RefNannyImportAPI(const char *modname); #define __Pyx_RefNannyDeclarations void *__pyx_refnanny = NULL; #ifdef WITH_THREAD #define __Pyx_RefNannySetupContext(name, acquire_gil)\ if (acquire_gil) {\ PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure();\ __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), __LINE__, __FILE__);\ PyGILState_Release(__pyx_gilstate_save);\ } else {\ __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), __LINE__, __FILE__);\ } #else #define __Pyx_RefNannySetupContext(name, acquire_gil)\ __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), __LINE__, __FILE__) #endif #define __Pyx_RefNannyFinishContext()\ __Pyx_RefNanny->FinishContext(&__pyx_refnanny) #define __Pyx_INCREF(r) __Pyx_RefNanny->INCREF(__pyx_refnanny, (PyObject *)(r), __LINE__) #define __Pyx_DECREF(r) __Pyx_RefNanny->DECREF(__pyx_refnanny, (PyObject *)(r), __LINE__) #define __Pyx_GOTREF(r) __Pyx_RefNanny->GOTREF(__pyx_refnanny, (PyObject *)(r), __LINE__) #define __Pyx_GIVEREF(r) __Pyx_RefNanny->GIVEREF(__pyx_refnanny, (PyObject *)(r), __LINE__) #define __Pyx_XINCREF(r) do { if((r) != NULL) {__Pyx_INCREF(r); }} while(0) #define __Pyx_XDECREF(r) do { if((r) != NULL) {__Pyx_DECREF(r); }} while(0) #define __Pyx_XGOTREF(r) do { if((r) != NULL) {__Pyx_GOTREF(r); }} while(0) #define __Pyx_XGIVEREF(r) do { if((r) != NULL) {__Pyx_GIVEREF(r);}} while(0) #else #define __Pyx_RefNannyDeclarations #define __Pyx_RefNannySetupContext(name, acquire_gil) #define __Pyx_RefNannyFinishContext() #define __Pyx_INCREF(r) Py_INCREF(r) #define __Pyx_DECREF(r) Py_DECREF(r) #define __Pyx_GOTREF(r) #define __Pyx_GIVEREF(r) #define __Pyx_XINCREF(r) Py_XINCREF(r) #define __Pyx_XDECREF(r) Py_XDECREF(r) #define __Pyx_XGOTREF(r) #define __Pyx_XGIVEREF(r) #endif #define __Pyx_XDECREF_SET(r, v) do {\ PyObject *tmp = (PyObject *) r;\ r = v; __Pyx_XDECREF(tmp);\ } while (0) #define __Pyx_DECREF_SET(r, v) do {\ PyObject *tmp = (PyObject *) r;\ r = v; __Pyx_DECREF(tmp);\ } while (0) #define __Pyx_CLEAR(r) do { PyObject* tmp = ((PyObject*)(r)); r = NULL; __Pyx_DECREF(tmp);} while(0) #define __Pyx_XCLEAR(r) do { if((r) != NULL) {PyObject* tmp = ((PyObject*)(r)); r = NULL; __Pyx_DECREF(tmp);}} while(0) #if CYTHON_COMPILING_IN_CPYTHON static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStr(PyObject* obj, PyObject* attr_name) { PyTypeObject* tp = Py_TYPE(obj); if (likely(tp->tp_getattro)) return tp->tp_getattro(obj, attr_name); #if PY_MAJOR_VERSION < 3 if (likely(tp->tp_getattr)) return tp->tp_getattr(obj, PyString_AS_STRING(attr_name)); #endif return PyObject_GetAttr(obj, attr_name); } #else #define __Pyx_PyObject_GetAttrStr(o,n) PyObject_GetAttr(o,n) #endif static PyObject *__Pyx_GetBuiltinName(PyObject *name); static void __Pyx_RaiseArgtupleInvalid(const char* func_name, int exact, Py_ssize_t num_min, Py_ssize_t num_max, Py_ssize_t num_found); static void __Pyx_RaiseDoubleKeywordsError(const char* func_name, PyObject* kw_name); static int __Pyx_ParseOptionalKeywords(PyObject *kwds, PyObject **argnames[],\ PyObject *kwds2, PyObject *values[], Py_ssize_t num_pos_args,\ const char* function_name); static CYTHON_INLINE int __Pyx_ArgTypeTest(PyObject *obj, PyTypeObject *type, int none_allowed, const char *name, int exact); #if CYTHON_COMPILING_IN_CPYTHON static CYTHON_INLINE PyObject* __Pyx_PyObject_Call(PyObject *func, PyObject *arg, PyObject *kw); #else #define __Pyx_PyObject_Call(func, arg, kw) PyObject_Call(func, arg, kw) #endif static CYTHON_INLINE PyObject *__Pyx_GetModuleGlobalName(PyObject *name); #if CYTHON_COMPILING_IN_CPYTHON static CYTHON_INLINE PyObject* __Pyx_PyObject_CallMethO(PyObject *func, PyObject *arg); #endif static CYTHON_INLINE PyObject* __Pyx_PyObject_CallOneArg(PyObject *func, PyObject *arg); static CYTHON_INLINE void __Pyx_RaiseTooManyValuesError(Py_ssize_t expected); static CYTHON_INLINE void __Pyx_RaiseNeedMoreValuesError(Py_ssize_t index); static CYTHON_INLINE int __Pyx_IterFinish(void); static int __Pyx_IternextUnpackEndCheck(PyObject *retval, Py_ssize_t expected); static void* __Pyx_GetVtable(PyObject *dict); static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list, int level); static PyObject* __Pyx_ImportFrom(PyObject* module, PyObject* name); typedef struct { int code_line; PyCodeObject* code_object; } __Pyx_CodeObjectCacheEntry; struct __Pyx_CodeObjectCache { int count; int max_count; __Pyx_CodeObjectCacheEntry* entries; }; static struct __Pyx_CodeObjectCache __pyx_code_cache = {0,0,NULL}; static int __pyx_bisect_code_objects(__Pyx_CodeObjectCacheEntry* entries, int count, int code_line); static PyCodeObject *__pyx_find_code_object(int code_line); static void __pyx_insert_code_object(int code_line, PyCodeObject* code_object); static void __Pyx_AddTraceback(const char *funcname, int c_line, int py_line, const char *filename); static CYTHON_INLINE int16_t __Pyx_PyInt_As_int16_t(PyObject *); static CYTHON_INLINE int __Pyx_PyInt_As_int(PyObject *); static CYTHON_INLINE uint8_t __Pyx_PyInt_As_uint8_t(PyObject *); static CYTHON_INLINE PyObject* __Pyx_PyInt_From_long(long value); static CYTHON_INLINE long __Pyx_PyInt_As_long(PyObject *); static int __Pyx_check_binary_version(void); #if !defined(__Pyx_PyIdentifier_FromString) #if PY_MAJOR_VERSION < 3 #define __Pyx_PyIdentifier_FromString(s) PyString_FromString(s) #else #define __Pyx_PyIdentifier_FromString(s) PyUnicode_FromString(s) #endif #endif static PyObject *__Pyx_ImportModule(const char *name); static PyTypeObject *__Pyx_ImportType(const char *module_name, const char *class_name, size_t size, int strict); static int __Pyx_InitStrings(__Pyx_StringTabEntry *t); /* Module declarations from 'libc.stdint' */ /* Module declarations from 'libc.string' */ /* Module declarations from 'libc.stdio' */ /* Module declarations from 'libc.stddef' */ /* Module declarations from 'sdl2' */ /* Module declarations from 'sdl2_gfx' */ /* Module declarations from 'libc.stdlib' */ /* Module declarations from 'pygame_sdl2.surface' */ static PyTypeObject *__pyx_ptype_11pygame_sdl2_7surface_Surface = 0; /* Module declarations from 'pygame_sdl2.color' */ static PyTypeObject *__pyx_ptype_11pygame_sdl2_5color_Color = 0; /* Module declarations from 'pygame_sdl2.gfxdraw' */ #define __Pyx_MODULE_NAME "pygame_sdl2.gfxdraw" int __pyx_module_is_main_pygame_sdl2__gfxdraw = 0; /* Implementation of 'pygame_sdl2.gfxdraw' */ static PyObject *__pyx_builtin_zip; static PyObject *__pyx_builtin_range; static char __pyx_k_c[] = "c"; static char __pyx_k_h[] = "h"; static char __pyx_k_n[] = "n"; static char __pyx_k_r[] = "r"; static char __pyx_k_w[] = "w"; static char __pyx_k_x[] = "x"; static char __pyx_k_y[] = "y"; static char __pyx_k_pt[] = "pt"; static char __pyx_k_rx[] = "rx"; static char __pyx_k_ry[] = "ry"; static char __pyx_k_tx[] = "tx"; static char __pyx_k_ty[] = "ty"; static char __pyx_k_vx[] = "vx"; static char __pyx_k_vy[] = "vy"; static char __pyx_k_x1[] = "x1"; static char __pyx_k_x2[] = "x2"; static char __pyx_k_x3[] = "x3"; static char __pyx_k_y1[] = "y1"; static char __pyx_k_y2[] = "y2"; static char __pyx_k_y3[] = "y3"; static char __pyx_k_arc[] = "arc"; static char __pyx_k_box[] = "box"; static char __pyx_k_end[] = "end"; static char __pyx_k_pie[] = "pie"; static char __pyx_k_rad[] = "rad"; static char __pyx_k_zip[] = "zip"; static char __pyx_k_Rect[] = "Rect"; static char __pyx_k_line[] = "line"; static char __pyx_k_main[] = "__main__"; static char __pyx_k_rect[] = "rect"; static char __pyx_k_test[] = "__test__"; static char __pyx_k_color[] = "color"; static char __pyx_k_error[] = "error"; static char __pyx_k_hline[] = "hline"; static char __pyx_k_pixel[] = "pixel"; static char __pyx_k_range[] = "range"; static char __pyx_k_start[] = "start"; static char __pyx_k_steps[] = "steps"; static char __pyx_k_vline[] = "vline"; static char __pyx_k_width[] = "width"; static char __pyx_k_x1int[] = "x1int"; static char __pyx_k_x2int[] = "x2int"; static char __pyx_k_y1int[] = "y1int"; static char __pyx_k_y2int[] = "y2int"; static char __pyx_k_aaline[] = "aaline"; static char __pyx_k_bezier[] = "bezier"; static char __pyx_k_circle[] = "circle"; static char __pyx_k_import[] = "__import__"; static char __pyx_k_points[] = "points"; static char __pyx_k_trigon[] = "trigon"; static char __pyx_k_ellipse[] = "ellipse"; static char __pyx_k_polygon[] = "polygon"; static char __pyx_k_surface[] = "surface"; static char __pyx_k_texture[] = "texture"; static char __pyx_k_aacircle[] = "aacircle"; static char __pyx_k_aatrigon[] = "aatrigon"; static char __pyx_k_aaellipse[] = "aaellipse"; static char __pyx_k_aapolygon[] = "aapolygon"; static char __pyx_k_rectangle[] = "rectangle"; static char __pyx_k_filled_pie[] = "filled_pie"; static char __pyx_k_num_points[] = "num_points"; static char __pyx_k_pyx_vtable[] = "__pyx_vtable__"; static char __pyx_k_thick_line[] = "thick_line"; static char __pyx_k_rounded_box[] = "rounded_box"; static char __pyx_k_filled_circle[] = "filled_circle"; static char __pyx_k_filled_trigon[] = "filled_trigon"; static char __pyx_k_filled_ellipse[] = "filled_ellipse"; static char __pyx_k_filled_polygon[] = "filled_polygon"; static char __pyx_k_pygame_sdl2_rect[] = "pygame_sdl2.rect"; static char __pyx_k_textured_polygon[] = "textured_polygon"; static char __pyx_k_pygame_sdl2_error[] = "pygame_sdl2.error"; static char __pyx_k_rounded_rectangle[] = "rounded_rectangle"; static char __pyx_k_pygame_sdl2_gfxdraw[] = "pygame_sdl2.gfxdraw"; static char __pyx_k_home_tom_ab_pygame_sdl2_src_pyg[] = "/home/tom/ab/pygame_sdl2/src/pygame_sdl2/gfxdraw.pyx"; static PyObject *__pyx_n_s_Rect; static PyObject *__pyx_n_s_aacircle; static PyObject *__pyx_n_s_aaellipse; static PyObject *__pyx_n_s_aaline; static PyObject *__pyx_n_s_aapolygon; static PyObject *__pyx_n_s_aatrigon; static PyObject *__pyx_n_s_arc; static PyObject *__pyx_n_s_bezier; static PyObject *__pyx_n_s_box; static PyObject *__pyx_n_s_c; static PyObject *__pyx_n_s_circle; static PyObject *__pyx_n_s_color; static PyObject *__pyx_n_s_ellipse; static PyObject *__pyx_n_s_end; static PyObject *__pyx_n_s_error; static PyObject *__pyx_n_s_filled_circle; static PyObject *__pyx_n_s_filled_ellipse; static PyObject *__pyx_n_s_filled_pie; static PyObject *__pyx_n_s_filled_polygon; static PyObject *__pyx_n_s_filled_trigon; static PyObject *__pyx_n_s_h; static PyObject *__pyx_n_s_hline; static PyObject *__pyx_kp_s_home_tom_ab_pygame_sdl2_src_pyg; static PyObject *__pyx_n_s_import; static PyObject *__pyx_n_s_line; static PyObject *__pyx_n_s_main; static PyObject *__pyx_n_s_n; static PyObject *__pyx_n_s_num_points; static PyObject *__pyx_n_s_pie; static PyObject *__pyx_n_s_pixel; static PyObject *__pyx_n_s_points; static PyObject *__pyx_n_s_polygon; static PyObject *__pyx_n_s_pt; static PyObject *__pyx_n_s_pygame_sdl2_error; static PyObject *__pyx_n_s_pygame_sdl2_gfxdraw; static PyObject *__pyx_n_s_pygame_sdl2_rect; static PyObject *__pyx_n_s_pyx_vtable; static PyObject *__pyx_n_s_r; static PyObject *__pyx_n_s_rad; static PyObject *__pyx_n_s_range; static PyObject *__pyx_n_s_rect; static PyObject *__pyx_n_s_rectangle; static PyObject *__pyx_n_s_rounded_box; static PyObject *__pyx_n_s_rounded_rectangle; static PyObject *__pyx_n_s_rx; static PyObject *__pyx_n_s_ry; static PyObject *__pyx_n_s_start; static PyObject *__pyx_n_s_steps; static PyObject *__pyx_n_s_surface; static PyObject *__pyx_n_s_test; static PyObject *__pyx_n_s_texture; static PyObject *__pyx_n_s_textured_polygon; static PyObject *__pyx_n_s_thick_line; static PyObject *__pyx_n_s_trigon; static PyObject *__pyx_n_s_tx; static PyObject *__pyx_n_s_ty; static PyObject *__pyx_n_s_vline; static PyObject *__pyx_n_s_vx; static PyObject *__pyx_n_s_vy; static PyObject *__pyx_n_s_w; static PyObject *__pyx_n_s_width; static PyObject *__pyx_n_s_x; static PyObject *__pyx_n_s_x1; static PyObject *__pyx_n_s_x1int; static PyObject *__pyx_n_s_x2; static PyObject *__pyx_n_s_x2int; static PyObject *__pyx_n_s_x3; static PyObject *__pyx_n_s_y; static PyObject *__pyx_n_s_y1; static PyObject *__pyx_n_s_y1int; static PyObject *__pyx_n_s_y2; static PyObject *__pyx_n_s_y2int; static PyObject *__pyx_n_s_y3; static PyObject *__pyx_n_s_zip; static PyObject *__pyx_pf_11pygame_sdl2_7gfxdraw_pixel(CYTHON_UNUSED PyObject *__pyx_self, struct __pyx_obj_11pygame_sdl2_7surface_Surface *__pyx_v_surface, PyObject *__pyx_v_x, PyObject *__pyx_v_y, PyObject *__pyx_v_color); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_7gfxdraw_2hline(CYTHON_UNUSED PyObject *__pyx_self, struct __pyx_obj_11pygame_sdl2_7surface_Surface *__pyx_v_surface, PyObject *__pyx_v_x1, PyObject *__pyx_v_x2, PyObject *__pyx_v_y, PyObject *__pyx_v_color); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_7gfxdraw_4vline(CYTHON_UNUSED PyObject *__pyx_self, struct __pyx_obj_11pygame_sdl2_7surface_Surface *__pyx_v_surface, PyObject *__pyx_v_x, PyObject *__pyx_v_y1, PyObject *__pyx_v_y2, PyObject *__pyx_v_color); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_7gfxdraw_6rectangle(CYTHON_UNUSED PyObject *__pyx_self, struct __pyx_obj_11pygame_sdl2_7surface_Surface *__pyx_v_surface, PyObject *__pyx_v_rect, PyObject *__pyx_v_color); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_7gfxdraw_8rounded_rectangle(CYTHON_UNUSED PyObject *__pyx_self, struct __pyx_obj_11pygame_sdl2_7surface_Surface *__pyx_v_surface, PyObject *__pyx_v_rect, PyObject *__pyx_v_rad, PyObject *__pyx_v_color); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_7gfxdraw_10box(CYTHON_UNUSED PyObject *__pyx_self, struct __pyx_obj_11pygame_sdl2_7surface_Surface *__pyx_v_surface, PyObject *__pyx_v_rect, PyObject *__pyx_v_color); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_7gfxdraw_12rounded_box(CYTHON_UNUSED PyObject *__pyx_self, struct __pyx_obj_11pygame_sdl2_7surface_Surface *__pyx_v_surface, PyObject *__pyx_v_rect, PyObject *__pyx_v_rad, PyObject *__pyx_v_color); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_7gfxdraw_14line(CYTHON_UNUSED PyObject *__pyx_self, struct __pyx_obj_11pygame_sdl2_7surface_Surface *__pyx_v_surface, PyObject *__pyx_v_x1, PyObject *__pyx_v_y1, PyObject *__pyx_v_x2, PyObject *__pyx_v_y2, PyObject *__pyx_v_color); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_7gfxdraw_16aaline(CYTHON_UNUSED PyObject *__pyx_self, struct __pyx_obj_11pygame_sdl2_7surface_Surface *__pyx_v_surface, PyObject *__pyx_v_x1, PyObject *__pyx_v_y1, PyObject *__pyx_v_x2, PyObject *__pyx_v_y2, PyObject *__pyx_v_color); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_7gfxdraw_18thick_line(CYTHON_UNUSED PyObject *__pyx_self, struct __pyx_obj_11pygame_sdl2_7surface_Surface *__pyx_v_surface, PyObject *__pyx_v_x1, PyObject *__pyx_v_y1, PyObject *__pyx_v_x2, PyObject *__pyx_v_y2, PyObject *__pyx_v_width, PyObject *__pyx_v_color); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_7gfxdraw_20circle(CYTHON_UNUSED PyObject *__pyx_self, struct __pyx_obj_11pygame_sdl2_7surface_Surface *__pyx_v_surface, PyObject *__pyx_v_x, PyObject *__pyx_v_y, PyObject *__pyx_v_r, PyObject *__pyx_v_color); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_7gfxdraw_22arc(CYTHON_UNUSED PyObject *__pyx_self, struct __pyx_obj_11pygame_sdl2_7surface_Surface *__pyx_v_surface, PyObject *__pyx_v_x, PyObject *__pyx_v_y, PyObject *__pyx_v_r, PyObject *__pyx_v_start, PyObject *__pyx_v_end, PyObject *__pyx_v_color); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_7gfxdraw_24aacircle(CYTHON_UNUSED PyObject *__pyx_self, struct __pyx_obj_11pygame_sdl2_7surface_Surface *__pyx_v_surface, PyObject *__pyx_v_x, PyObject *__pyx_v_y, PyObject *__pyx_v_r, PyObject *__pyx_v_color); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_7gfxdraw_26filled_circle(CYTHON_UNUSED PyObject *__pyx_self, struct __pyx_obj_11pygame_sdl2_7surface_Surface *__pyx_v_surface, PyObject *__pyx_v_x, PyObject *__pyx_v_y, PyObject *__pyx_v_r, PyObject *__pyx_v_color); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_7gfxdraw_28ellipse(CYTHON_UNUSED PyObject *__pyx_self, struct __pyx_obj_11pygame_sdl2_7surface_Surface *__pyx_v_surface, PyObject *__pyx_v_x, PyObject *__pyx_v_y, PyObject *__pyx_v_rx, PyObject *__pyx_v_ry, PyObject *__pyx_v_color); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_7gfxdraw_30aaellipse(CYTHON_UNUSED PyObject *__pyx_self, struct __pyx_obj_11pygame_sdl2_7surface_Surface *__pyx_v_surface, PyObject *__pyx_v_x, PyObject *__pyx_v_y, PyObject *__pyx_v_rx, PyObject *__pyx_v_ry, PyObject *__pyx_v_color); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_7gfxdraw_32filled_ellipse(CYTHON_UNUSED PyObject *__pyx_self, struct __pyx_obj_11pygame_sdl2_7surface_Surface *__pyx_v_surface, PyObject *__pyx_v_x, PyObject *__pyx_v_y, PyObject *__pyx_v_rx, PyObject *__pyx_v_ry, PyObject *__pyx_v_color); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_7gfxdraw_34pie(CYTHON_UNUSED PyObject *__pyx_self, struct __pyx_obj_11pygame_sdl2_7surface_Surface *__pyx_v_surface, PyObject *__pyx_v_x, PyObject *__pyx_v_y, PyObject *__pyx_v_r, PyObject *__pyx_v_start, PyObject *__pyx_v_end, PyObject *__pyx_v_color); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_7gfxdraw_36filled_pie(CYTHON_UNUSED PyObject *__pyx_self, struct __pyx_obj_11pygame_sdl2_7surface_Surface *__pyx_v_surface, PyObject *__pyx_v_x, PyObject *__pyx_v_y, PyObject *__pyx_v_r, PyObject *__pyx_v_start, PyObject *__pyx_v_end, PyObject *__pyx_v_color); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_7gfxdraw_38trigon(CYTHON_UNUSED PyObject *__pyx_self, struct __pyx_obj_11pygame_sdl2_7surface_Surface *__pyx_v_surface, PyObject *__pyx_v_x1, PyObject *__pyx_v_y1, PyObject *__pyx_v_x2, PyObject *__pyx_v_y2, PyObject *__pyx_v_x3, PyObject *__pyx_v_y3, PyObject *__pyx_v_color); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_7gfxdraw_40aatrigon(CYTHON_UNUSED PyObject *__pyx_self, struct __pyx_obj_11pygame_sdl2_7surface_Surface *__pyx_v_surface, PyObject *__pyx_v_x1, PyObject *__pyx_v_y1, PyObject *__pyx_v_x2, PyObject *__pyx_v_y2, PyObject *__pyx_v_x3, PyObject *__pyx_v_y3, PyObject *__pyx_v_color); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_7gfxdraw_42filled_trigon(CYTHON_UNUSED PyObject *__pyx_self, struct __pyx_obj_11pygame_sdl2_7surface_Surface *__pyx_v_surface, PyObject *__pyx_v_x1, PyObject *__pyx_v_y1, PyObject *__pyx_v_x2, PyObject *__pyx_v_y2, PyObject *__pyx_v_x3, PyObject *__pyx_v_y3, PyObject *__pyx_v_color); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_7gfxdraw_44polygon(CYTHON_UNUSED PyObject *__pyx_self, struct __pyx_obj_11pygame_sdl2_7surface_Surface *__pyx_v_surface, PyObject *__pyx_v_points, PyObject *__pyx_v_color); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_7gfxdraw_46aapolygon(CYTHON_UNUSED PyObject *__pyx_self, struct __pyx_obj_11pygame_sdl2_7surface_Surface *__pyx_v_surface, PyObject *__pyx_v_points, PyObject *__pyx_v_color); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_7gfxdraw_48filled_polygon(CYTHON_UNUSED PyObject *__pyx_self, struct __pyx_obj_11pygame_sdl2_7surface_Surface *__pyx_v_surface, PyObject *__pyx_v_points, PyObject *__pyx_v_color); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_7gfxdraw_50textured_polygon(CYTHON_UNUSED PyObject *__pyx_self, struct __pyx_obj_11pygame_sdl2_7surface_Surface *__pyx_v_surface, PyObject *__pyx_v_points, struct __pyx_obj_11pygame_sdl2_7surface_Surface *__pyx_v_texture, PyObject *__pyx_v_tx, PyObject *__pyx_v_ty); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_7gfxdraw_52bezier(CYTHON_UNUSED PyObject *__pyx_self, struct __pyx_obj_11pygame_sdl2_7surface_Surface *__pyx_v_surface, PyObject *__pyx_v_points, PyObject *__pyx_v_steps, PyObject *__pyx_v_color); /* proto */ static PyObject *__pyx_tuple_; static PyObject *__pyx_tuple__3; static PyObject *__pyx_tuple__5; static PyObject *__pyx_tuple__7; static PyObject *__pyx_tuple__9; static PyObject *__pyx_tuple__11; static PyObject *__pyx_tuple__13; static PyObject *__pyx_tuple__15; static PyObject *__pyx_tuple__17; static PyObject *__pyx_tuple__19; static PyObject *__pyx_tuple__21; static PyObject *__pyx_tuple__23; static PyObject *__pyx_tuple__25; static PyObject *__pyx_tuple__27; static PyObject *__pyx_tuple__29; static PyObject *__pyx_tuple__31; static PyObject *__pyx_tuple__33; static PyObject *__pyx_tuple__35; static PyObject *__pyx_tuple__37; static PyObject *__pyx_tuple__39; static PyObject *__pyx_tuple__41; static PyObject *__pyx_tuple__43; static PyObject *__pyx_tuple__45; static PyObject *__pyx_tuple__47; static PyObject *__pyx_tuple__49; static PyObject *__pyx_tuple__51; static PyObject *__pyx_tuple__53; static PyObject *__pyx_codeobj__2; static PyObject *__pyx_codeobj__4; static PyObject *__pyx_codeobj__6; static PyObject *__pyx_codeobj__8; static PyObject *__pyx_codeobj__10; static PyObject *__pyx_codeobj__12; static PyObject *__pyx_codeobj__14; static PyObject *__pyx_codeobj__16; static PyObject *__pyx_codeobj__18; static PyObject *__pyx_codeobj__20; static PyObject *__pyx_codeobj__22; static PyObject *__pyx_codeobj__24; static PyObject *__pyx_codeobj__26; static PyObject *__pyx_codeobj__28; static PyObject *__pyx_codeobj__30; static PyObject *__pyx_codeobj__32; static PyObject *__pyx_codeobj__34; static PyObject *__pyx_codeobj__36; static PyObject *__pyx_codeobj__38; static PyObject *__pyx_codeobj__40; static PyObject *__pyx_codeobj__42; static PyObject *__pyx_codeobj__44; static PyObject *__pyx_codeobj__46; static PyObject *__pyx_codeobj__48; static PyObject *__pyx_codeobj__50; static PyObject *__pyx_codeobj__52; static PyObject *__pyx_codeobj__54; /* "pygame_sdl2/gfxdraw.pyx":29 * * * def pixel(Surface surface, x, y, color): # <<<<<<<<<<<<<< * cdef Color c = Color(color) * pixelRGBA(surface.surface, x, y, c.r, c.g, c.b, c.a) */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_7gfxdraw_1pixel(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static PyMethodDef __pyx_mdef_11pygame_sdl2_7gfxdraw_1pixel = {"pixel", (PyCFunction)__pyx_pw_11pygame_sdl2_7gfxdraw_1pixel, METH_VARARGS|METH_KEYWORDS, 0}; static PyObject *__pyx_pw_11pygame_sdl2_7gfxdraw_1pixel(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { struct __pyx_obj_11pygame_sdl2_7surface_Surface *__pyx_v_surface = 0; PyObject *__pyx_v_x = 0; PyObject *__pyx_v_y = 0; PyObject *__pyx_v_color = 0; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("pixel (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_surface,&__pyx_n_s_x,&__pyx_n_s_y,&__pyx_n_s_color,0}; PyObject* values[4] = {0,0,0,0}; if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_surface)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; case 1: if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_x)) != 0)) kw_args--; else { __Pyx_RaiseArgtupleInvalid("pixel", 1, 4, 4, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 29; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } case 2: if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_y)) != 0)) kw_args--; else { __Pyx_RaiseArgtupleInvalid("pixel", 1, 4, 4, 2); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 29; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } case 3: if (likely((values[3] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_color)) != 0)) kw_args--; else { __Pyx_RaiseArgtupleInvalid("pixel", 1, 4, 4, 3); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 29; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "pixel") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 29; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } } else if (PyTuple_GET_SIZE(__pyx_args) != 4) { goto __pyx_L5_argtuple_error; } else { values[0] = PyTuple_GET_ITEM(__pyx_args, 0); values[1] = PyTuple_GET_ITEM(__pyx_args, 1); values[2] = PyTuple_GET_ITEM(__pyx_args, 2); values[3] = PyTuple_GET_ITEM(__pyx_args, 3); } __pyx_v_surface = ((struct __pyx_obj_11pygame_sdl2_7surface_Surface *)values[0]); __pyx_v_x = values[1]; __pyx_v_y = values[2]; __pyx_v_color = values[3]; } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("pixel", 1, 4, 4, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 29; __pyx_clineno = __LINE__; goto __pyx_L3_error;} __pyx_L3_error:; __Pyx_AddTraceback("pygame_sdl2.gfxdraw.pixel", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_surface), __pyx_ptype_11pygame_sdl2_7surface_Surface, 1, "surface", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 29; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_r = __pyx_pf_11pygame_sdl2_7gfxdraw_pixel(__pyx_self, __pyx_v_surface, __pyx_v_x, __pyx_v_y, __pyx_v_color); /* function exit code */ goto __pyx_L0; __pyx_L1_error:; __pyx_r = NULL; __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_7gfxdraw_pixel(CYTHON_UNUSED PyObject *__pyx_self, struct __pyx_obj_11pygame_sdl2_7surface_Surface *__pyx_v_surface, PyObject *__pyx_v_x, PyObject *__pyx_v_y, PyObject *__pyx_v_color) { struct __pyx_obj_11pygame_sdl2_5color_Color *__pyx_v_c = 0; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; Sint16 __pyx_t_3; Sint16 __pyx_t_4; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("pixel", 0); /* "pygame_sdl2/gfxdraw.pyx":30 * * def pixel(Surface surface, x, y, color): * cdef Color c = Color(color) # <<<<<<<<<<<<<< * pixelRGBA(surface.surface, x, y, c.r, c.g, c.b, c.a) * */ __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 30; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __Pyx_INCREF(__pyx_v_color); __Pyx_GIVEREF(__pyx_v_color); PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_color); __pyx_t_2 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_11pygame_sdl2_5color_Color), __pyx_t_1, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 30; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_v_c = ((struct __pyx_obj_11pygame_sdl2_5color_Color *)__pyx_t_2); __pyx_t_2 = 0; /* "pygame_sdl2/gfxdraw.pyx":31 * def pixel(Surface surface, x, y, color): * cdef Color c = Color(color) * pixelRGBA(surface.surface, x, y, c.r, c.g, c.b, c.a) # <<<<<<<<<<<<<< * * def hline(Surface surface, x1, x2, y, color): */ __pyx_t_3 = __Pyx_PyInt_As_int16_t(__pyx_v_x); if (unlikely((__pyx_t_3 == (Sint16)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 31; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_t_4 = __Pyx_PyInt_As_int16_t(__pyx_v_y); if (unlikely((__pyx_t_4 == (Sint16)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 31; __pyx_clineno = __LINE__; goto __pyx_L1_error;} pixelRGBA(__pyx_v_surface->surface, __pyx_t_3, __pyx_t_4, __pyx_v_c->r, __pyx_v_c->g, __pyx_v_c->b, __pyx_v_c->a); /* "pygame_sdl2/gfxdraw.pyx":29 * * * def pixel(Surface surface, x, y, color): # <<<<<<<<<<<<<< * cdef Color c = Color(color) * pixelRGBA(surface.surface, x, y, c.r, c.g, c.b, c.a) */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_AddTraceback("pygame_sdl2.gfxdraw.pixel", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF((PyObject *)__pyx_v_c); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/gfxdraw.pyx":33 * pixelRGBA(surface.surface, x, y, c.r, c.g, c.b, c.a) * * def hline(Surface surface, x1, x2, y, color): # <<<<<<<<<<<<<< * cdef Color c = Color(color) * hlineRGBA(surface.surface, x1, x2, y, c.r, c.g, c.b, c.a) */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_7gfxdraw_3hline(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static PyMethodDef __pyx_mdef_11pygame_sdl2_7gfxdraw_3hline = {"hline", (PyCFunction)__pyx_pw_11pygame_sdl2_7gfxdraw_3hline, METH_VARARGS|METH_KEYWORDS, 0}; static PyObject *__pyx_pw_11pygame_sdl2_7gfxdraw_3hline(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { struct __pyx_obj_11pygame_sdl2_7surface_Surface *__pyx_v_surface = 0; PyObject *__pyx_v_x1 = 0; PyObject *__pyx_v_x2 = 0; PyObject *__pyx_v_y = 0; PyObject *__pyx_v_color = 0; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("hline (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_surface,&__pyx_n_s_x1,&__pyx_n_s_x2,&__pyx_n_s_y,&__pyx_n_s_color,0}; PyObject* values[5] = {0,0,0,0,0}; if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4); case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_surface)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; case 1: if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_x1)) != 0)) kw_args--; else { __Pyx_RaiseArgtupleInvalid("hline", 1, 5, 5, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 33; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } case 2: if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_x2)) != 0)) kw_args--; else { __Pyx_RaiseArgtupleInvalid("hline", 1, 5, 5, 2); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 33; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } case 3: if (likely((values[3] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_y)) != 0)) kw_args--; else { __Pyx_RaiseArgtupleInvalid("hline", 1, 5, 5, 3); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 33; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } case 4: if (likely((values[4] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_color)) != 0)) kw_args--; else { __Pyx_RaiseArgtupleInvalid("hline", 1, 5, 5, 4); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 33; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "hline") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 33; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } } else if (PyTuple_GET_SIZE(__pyx_args) != 5) { goto __pyx_L5_argtuple_error; } else { values[0] = PyTuple_GET_ITEM(__pyx_args, 0); values[1] = PyTuple_GET_ITEM(__pyx_args, 1); values[2] = PyTuple_GET_ITEM(__pyx_args, 2); values[3] = PyTuple_GET_ITEM(__pyx_args, 3); values[4] = PyTuple_GET_ITEM(__pyx_args, 4); } __pyx_v_surface = ((struct __pyx_obj_11pygame_sdl2_7surface_Surface *)values[0]); __pyx_v_x1 = values[1]; __pyx_v_x2 = values[2]; __pyx_v_y = values[3]; __pyx_v_color = values[4]; } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("hline", 1, 5, 5, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 33; __pyx_clineno = __LINE__; goto __pyx_L3_error;} __pyx_L3_error:; __Pyx_AddTraceback("pygame_sdl2.gfxdraw.hline", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_surface), __pyx_ptype_11pygame_sdl2_7surface_Surface, 1, "surface", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 33; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_r = __pyx_pf_11pygame_sdl2_7gfxdraw_2hline(__pyx_self, __pyx_v_surface, __pyx_v_x1, __pyx_v_x2, __pyx_v_y, __pyx_v_color); /* function exit code */ goto __pyx_L0; __pyx_L1_error:; __pyx_r = NULL; __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_7gfxdraw_2hline(CYTHON_UNUSED PyObject *__pyx_self, struct __pyx_obj_11pygame_sdl2_7surface_Surface *__pyx_v_surface, PyObject *__pyx_v_x1, PyObject *__pyx_v_x2, PyObject *__pyx_v_y, PyObject *__pyx_v_color) { struct __pyx_obj_11pygame_sdl2_5color_Color *__pyx_v_c = 0; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; Sint16 __pyx_t_3; Sint16 __pyx_t_4; Sint16 __pyx_t_5; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("hline", 0); /* "pygame_sdl2/gfxdraw.pyx":34 * * def hline(Surface surface, x1, x2, y, color): * cdef Color c = Color(color) # <<<<<<<<<<<<<< * hlineRGBA(surface.surface, x1, x2, y, c.r, c.g, c.b, c.a) * */ __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 34; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __Pyx_INCREF(__pyx_v_color); __Pyx_GIVEREF(__pyx_v_color); PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_color); __pyx_t_2 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_11pygame_sdl2_5color_Color), __pyx_t_1, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 34; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_v_c = ((struct __pyx_obj_11pygame_sdl2_5color_Color *)__pyx_t_2); __pyx_t_2 = 0; /* "pygame_sdl2/gfxdraw.pyx":35 * def hline(Surface surface, x1, x2, y, color): * cdef Color c = Color(color) * hlineRGBA(surface.surface, x1, x2, y, c.r, c.g, c.b, c.a) # <<<<<<<<<<<<<< * * def vline(Surface surface, x, y1, y2, color): */ __pyx_t_3 = __Pyx_PyInt_As_int16_t(__pyx_v_x1); if (unlikely((__pyx_t_3 == (Sint16)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 35; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_t_4 = __Pyx_PyInt_As_int16_t(__pyx_v_x2); if (unlikely((__pyx_t_4 == (Sint16)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 35; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_t_5 = __Pyx_PyInt_As_int16_t(__pyx_v_y); if (unlikely((__pyx_t_5 == (Sint16)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 35; __pyx_clineno = __LINE__; goto __pyx_L1_error;} hlineRGBA(__pyx_v_surface->surface, __pyx_t_3, __pyx_t_4, __pyx_t_5, __pyx_v_c->r, __pyx_v_c->g, __pyx_v_c->b, __pyx_v_c->a); /* "pygame_sdl2/gfxdraw.pyx":33 * pixelRGBA(surface.surface, x, y, c.r, c.g, c.b, c.a) * * def hline(Surface surface, x1, x2, y, color): # <<<<<<<<<<<<<< * cdef Color c = Color(color) * hlineRGBA(surface.surface, x1, x2, y, c.r, c.g, c.b, c.a) */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_AddTraceback("pygame_sdl2.gfxdraw.hline", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF((PyObject *)__pyx_v_c); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/gfxdraw.pyx":37 * hlineRGBA(surface.surface, x1, x2, y, c.r, c.g, c.b, c.a) * * def vline(Surface surface, x, y1, y2, color): # <<<<<<<<<<<<<< * cdef Color c = Color(color) * vlineRGBA(surface.surface, x, y1, y2, c.r, c.g, c.b, c.a) */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_7gfxdraw_5vline(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static PyMethodDef __pyx_mdef_11pygame_sdl2_7gfxdraw_5vline = {"vline", (PyCFunction)__pyx_pw_11pygame_sdl2_7gfxdraw_5vline, METH_VARARGS|METH_KEYWORDS, 0}; static PyObject *__pyx_pw_11pygame_sdl2_7gfxdraw_5vline(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { struct __pyx_obj_11pygame_sdl2_7surface_Surface *__pyx_v_surface = 0; PyObject *__pyx_v_x = 0; PyObject *__pyx_v_y1 = 0; PyObject *__pyx_v_y2 = 0; PyObject *__pyx_v_color = 0; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("vline (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_surface,&__pyx_n_s_x,&__pyx_n_s_y1,&__pyx_n_s_y2,&__pyx_n_s_color,0}; PyObject* values[5] = {0,0,0,0,0}; if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4); case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_surface)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; case 1: if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_x)) != 0)) kw_args--; else { __Pyx_RaiseArgtupleInvalid("vline", 1, 5, 5, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 37; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } case 2: if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_y1)) != 0)) kw_args--; else { __Pyx_RaiseArgtupleInvalid("vline", 1, 5, 5, 2); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 37; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } case 3: if (likely((values[3] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_y2)) != 0)) kw_args--; else { __Pyx_RaiseArgtupleInvalid("vline", 1, 5, 5, 3); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 37; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } case 4: if (likely((values[4] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_color)) != 0)) kw_args--; else { __Pyx_RaiseArgtupleInvalid("vline", 1, 5, 5, 4); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 37; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "vline") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 37; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } } else if (PyTuple_GET_SIZE(__pyx_args) != 5) { goto __pyx_L5_argtuple_error; } else { values[0] = PyTuple_GET_ITEM(__pyx_args, 0); values[1] = PyTuple_GET_ITEM(__pyx_args, 1); values[2] = PyTuple_GET_ITEM(__pyx_args, 2); values[3] = PyTuple_GET_ITEM(__pyx_args, 3); values[4] = PyTuple_GET_ITEM(__pyx_args, 4); } __pyx_v_surface = ((struct __pyx_obj_11pygame_sdl2_7surface_Surface *)values[0]); __pyx_v_x = values[1]; __pyx_v_y1 = values[2]; __pyx_v_y2 = values[3]; __pyx_v_color = values[4]; } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("vline", 1, 5, 5, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 37; __pyx_clineno = __LINE__; goto __pyx_L3_error;} __pyx_L3_error:; __Pyx_AddTraceback("pygame_sdl2.gfxdraw.vline", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_surface), __pyx_ptype_11pygame_sdl2_7surface_Surface, 1, "surface", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 37; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_r = __pyx_pf_11pygame_sdl2_7gfxdraw_4vline(__pyx_self, __pyx_v_surface, __pyx_v_x, __pyx_v_y1, __pyx_v_y2, __pyx_v_color); /* function exit code */ goto __pyx_L0; __pyx_L1_error:; __pyx_r = NULL; __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_7gfxdraw_4vline(CYTHON_UNUSED PyObject *__pyx_self, struct __pyx_obj_11pygame_sdl2_7surface_Surface *__pyx_v_surface, PyObject *__pyx_v_x, PyObject *__pyx_v_y1, PyObject *__pyx_v_y2, PyObject *__pyx_v_color) { struct __pyx_obj_11pygame_sdl2_5color_Color *__pyx_v_c = 0; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; Sint16 __pyx_t_3; Sint16 __pyx_t_4; Sint16 __pyx_t_5; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("vline", 0); /* "pygame_sdl2/gfxdraw.pyx":38 * * def vline(Surface surface, x, y1, y2, color): * cdef Color c = Color(color) # <<<<<<<<<<<<<< * vlineRGBA(surface.surface, x, y1, y2, c.r, c.g, c.b, c.a) * */ __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 38; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __Pyx_INCREF(__pyx_v_color); __Pyx_GIVEREF(__pyx_v_color); PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_color); __pyx_t_2 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_11pygame_sdl2_5color_Color), __pyx_t_1, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 38; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_v_c = ((struct __pyx_obj_11pygame_sdl2_5color_Color *)__pyx_t_2); __pyx_t_2 = 0; /* "pygame_sdl2/gfxdraw.pyx":39 * def vline(Surface surface, x, y1, y2, color): * cdef Color c = Color(color) * vlineRGBA(surface.surface, x, y1, y2, c.r, c.g, c.b, c.a) # <<<<<<<<<<<<<< * * def rectangle(Surface surface, rect, color): */ __pyx_t_3 = __Pyx_PyInt_As_int16_t(__pyx_v_x); if (unlikely((__pyx_t_3 == (Sint16)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 39; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_t_4 = __Pyx_PyInt_As_int16_t(__pyx_v_y1); if (unlikely((__pyx_t_4 == (Sint16)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 39; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_t_5 = __Pyx_PyInt_As_int16_t(__pyx_v_y2); if (unlikely((__pyx_t_5 == (Sint16)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 39; __pyx_clineno = __LINE__; goto __pyx_L1_error;} vlineRGBA(__pyx_v_surface->surface, __pyx_t_3, __pyx_t_4, __pyx_t_5, __pyx_v_c->r, __pyx_v_c->g, __pyx_v_c->b, __pyx_v_c->a); /* "pygame_sdl2/gfxdraw.pyx":37 * hlineRGBA(surface.surface, x1, x2, y, c.r, c.g, c.b, c.a) * * def vline(Surface surface, x, y1, y2, color): # <<<<<<<<<<<<<< * cdef Color c = Color(color) * vlineRGBA(surface.surface, x, y1, y2, c.r, c.g, c.b, c.a) */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_AddTraceback("pygame_sdl2.gfxdraw.vline", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF((PyObject *)__pyx_v_c); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/gfxdraw.pyx":41 * vlineRGBA(surface.surface, x, y1, y2, c.r, c.g, c.b, c.a) * * def rectangle(Surface surface, rect, color): # <<<<<<<<<<<<<< * cdef Color c = Color(color) * if not isinstance(rect, Rect): */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_7gfxdraw_7rectangle(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static PyMethodDef __pyx_mdef_11pygame_sdl2_7gfxdraw_7rectangle = {"rectangle", (PyCFunction)__pyx_pw_11pygame_sdl2_7gfxdraw_7rectangle, METH_VARARGS|METH_KEYWORDS, 0}; static PyObject *__pyx_pw_11pygame_sdl2_7gfxdraw_7rectangle(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { struct __pyx_obj_11pygame_sdl2_7surface_Surface *__pyx_v_surface = 0; PyObject *__pyx_v_rect = 0; PyObject *__pyx_v_color = 0; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("rectangle (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_surface,&__pyx_n_s_rect,&__pyx_n_s_color,0}; PyObject* values[3] = {0,0,0}; if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_surface)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; case 1: if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_rect)) != 0)) kw_args--; else { __Pyx_RaiseArgtupleInvalid("rectangle", 1, 3, 3, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 41; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } case 2: if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_color)) != 0)) kw_args--; else { __Pyx_RaiseArgtupleInvalid("rectangle", 1, 3, 3, 2); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 41; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "rectangle") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 41; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } } else if (PyTuple_GET_SIZE(__pyx_args) != 3) { goto __pyx_L5_argtuple_error; } else { values[0] = PyTuple_GET_ITEM(__pyx_args, 0); values[1] = PyTuple_GET_ITEM(__pyx_args, 1); values[2] = PyTuple_GET_ITEM(__pyx_args, 2); } __pyx_v_surface = ((struct __pyx_obj_11pygame_sdl2_7surface_Surface *)values[0]); __pyx_v_rect = values[1]; __pyx_v_color = values[2]; } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("rectangle", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 41; __pyx_clineno = __LINE__; goto __pyx_L3_error;} __pyx_L3_error:; __Pyx_AddTraceback("pygame_sdl2.gfxdraw.rectangle", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_surface), __pyx_ptype_11pygame_sdl2_7surface_Surface, 1, "surface", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 41; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_r = __pyx_pf_11pygame_sdl2_7gfxdraw_6rectangle(__pyx_self, __pyx_v_surface, __pyx_v_rect, __pyx_v_color); /* function exit code */ goto __pyx_L0; __pyx_L1_error:; __pyx_r = NULL; __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_7gfxdraw_6rectangle(CYTHON_UNUSED PyObject *__pyx_self, struct __pyx_obj_11pygame_sdl2_7surface_Surface *__pyx_v_surface, PyObject *__pyx_v_rect, PyObject *__pyx_v_color) { struct __pyx_obj_11pygame_sdl2_5color_Color *__pyx_v_c = 0; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; int __pyx_t_3; int __pyx_t_4; PyObject *__pyx_t_5 = NULL; PyObject *__pyx_t_6 = NULL; Sint16 __pyx_t_7; Sint16 __pyx_t_8; Sint16 __pyx_t_9; Sint16 __pyx_t_10; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("rectangle", 0); __Pyx_INCREF(__pyx_v_rect); /* "pygame_sdl2/gfxdraw.pyx":42 * * def rectangle(Surface surface, rect, color): * cdef Color c = Color(color) # <<<<<<<<<<<<<< * if not isinstance(rect, Rect): * rect = Rect(rect) */ __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 42; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __Pyx_INCREF(__pyx_v_color); __Pyx_GIVEREF(__pyx_v_color); PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_color); __pyx_t_2 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_11pygame_sdl2_5color_Color), __pyx_t_1, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 42; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_v_c = ((struct __pyx_obj_11pygame_sdl2_5color_Color *)__pyx_t_2); __pyx_t_2 = 0; /* "pygame_sdl2/gfxdraw.pyx":43 * def rectangle(Surface surface, rect, color): * cdef Color c = Color(color) * if not isinstance(rect, Rect): # <<<<<<<<<<<<<< * rect = Rect(rect) * rectangleRGBA(surface.surface, rect.x, rect.y, rect.x + rect.w, rect.y + rect.h, c.r, c.g, c.b, c.a) */ __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_Rect); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 43; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = PyObject_IsInstance(__pyx_v_rect, __pyx_t_2); if (unlikely(__pyx_t_3 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 43; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_4 = ((!(__pyx_t_3 != 0)) != 0); if (__pyx_t_4) { /* "pygame_sdl2/gfxdraw.pyx":44 * cdef Color c = Color(color) * if not isinstance(rect, Rect): * rect = Rect(rect) # <<<<<<<<<<<<<< * rectangleRGBA(surface.surface, rect.x, rect.y, rect.x + rect.w, rect.y + rect.h, c.r, c.g, c.b, c.a) * */ __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_Rect); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 44; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_t_5 = NULL; if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_1))) { __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_1); if (likely(__pyx_t_5)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1); __Pyx_INCREF(__pyx_t_5); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_1, function); } } if (!__pyx_t_5) { __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_1, __pyx_v_rect); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 44; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); } else { __pyx_t_6 = PyTuple_New(1+1); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 44; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_6); __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_5); __pyx_t_5 = NULL; __Pyx_INCREF(__pyx_v_rect); __Pyx_GIVEREF(__pyx_v_rect); PyTuple_SET_ITEM(__pyx_t_6, 0+1, __pyx_v_rect); __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_6, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 44; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF_SET(__pyx_v_rect, __pyx_t_2); __pyx_t_2 = 0; /* "pygame_sdl2/gfxdraw.pyx":43 * def rectangle(Surface surface, rect, color): * cdef Color c = Color(color) * if not isinstance(rect, Rect): # <<<<<<<<<<<<<< * rect = Rect(rect) * rectangleRGBA(surface.surface, rect.x, rect.y, rect.x + rect.w, rect.y + rect.h, c.r, c.g, c.b, c.a) */ } /* "pygame_sdl2/gfxdraw.pyx":45 * if not isinstance(rect, Rect): * rect = Rect(rect) * rectangleRGBA(surface.surface, rect.x, rect.y, rect.x + rect.w, rect.y + rect.h, c.r, c.g, c.b, c.a) # <<<<<<<<<<<<<< * * def rounded_rectangle(Surface surface, rect, rad, color): */ __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_rect, __pyx_n_s_x); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 45; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __pyx_t_7 = __Pyx_PyInt_As_int16_t(__pyx_t_2); if (unlikely((__pyx_t_7 == (Sint16)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 45; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_rect, __pyx_n_s_y); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 45; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __pyx_t_8 = __Pyx_PyInt_As_int16_t(__pyx_t_2); if (unlikely((__pyx_t_8 == (Sint16)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 45; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_rect, __pyx_n_s_x); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 45; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_rect, __pyx_n_s_w); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 45; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_t_6 = PyNumber_Add(__pyx_t_2, __pyx_t_1); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 45; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_9 = __Pyx_PyInt_As_int16_t(__pyx_t_6); if (unlikely((__pyx_t_9 == (Sint16)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 45; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_rect, __pyx_n_s_y); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 45; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_6); __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_rect, __pyx_n_s_h); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 45; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = PyNumber_Add(__pyx_t_6, __pyx_t_1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 45; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_10 = __Pyx_PyInt_As_int16_t(__pyx_t_2); if (unlikely((__pyx_t_10 == (Sint16)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 45; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; rectangleRGBA(__pyx_v_surface->surface, __pyx_t_7, __pyx_t_8, __pyx_t_9, __pyx_t_10, __pyx_v_c->r, __pyx_v_c->g, __pyx_v_c->b, __pyx_v_c->a); /* "pygame_sdl2/gfxdraw.pyx":41 * vlineRGBA(surface.surface, x, y1, y2, c.r, c.g, c.b, c.a) * * def rectangle(Surface surface, rect, color): # <<<<<<<<<<<<<< * cdef Color c = Color(color) * if not isinstance(rect, Rect): */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_5); __Pyx_XDECREF(__pyx_t_6); __Pyx_AddTraceback("pygame_sdl2.gfxdraw.rectangle", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF((PyObject *)__pyx_v_c); __Pyx_XDECREF(__pyx_v_rect); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/gfxdraw.pyx":47 * rectangleRGBA(surface.surface, rect.x, rect.y, rect.x + rect.w, rect.y + rect.h, c.r, c.g, c.b, c.a) * * def rounded_rectangle(Surface surface, rect, rad, color): # <<<<<<<<<<<<<< * cdef Color c = Color(color) * if not isinstance(rect, Rect): */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_7gfxdraw_9rounded_rectangle(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static PyMethodDef __pyx_mdef_11pygame_sdl2_7gfxdraw_9rounded_rectangle = {"rounded_rectangle", (PyCFunction)__pyx_pw_11pygame_sdl2_7gfxdraw_9rounded_rectangle, METH_VARARGS|METH_KEYWORDS, 0}; static PyObject *__pyx_pw_11pygame_sdl2_7gfxdraw_9rounded_rectangle(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { struct __pyx_obj_11pygame_sdl2_7surface_Surface *__pyx_v_surface = 0; PyObject *__pyx_v_rect = 0; PyObject *__pyx_v_rad = 0; PyObject *__pyx_v_color = 0; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("rounded_rectangle (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_surface,&__pyx_n_s_rect,&__pyx_n_s_rad,&__pyx_n_s_color,0}; PyObject* values[4] = {0,0,0,0}; if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_surface)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; case 1: if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_rect)) != 0)) kw_args--; else { __Pyx_RaiseArgtupleInvalid("rounded_rectangle", 1, 4, 4, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 47; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } case 2: if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_rad)) != 0)) kw_args--; else { __Pyx_RaiseArgtupleInvalid("rounded_rectangle", 1, 4, 4, 2); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 47; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } case 3: if (likely((values[3] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_color)) != 0)) kw_args--; else { __Pyx_RaiseArgtupleInvalid("rounded_rectangle", 1, 4, 4, 3); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 47; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "rounded_rectangle") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 47; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } } else if (PyTuple_GET_SIZE(__pyx_args) != 4) { goto __pyx_L5_argtuple_error; } else { values[0] = PyTuple_GET_ITEM(__pyx_args, 0); values[1] = PyTuple_GET_ITEM(__pyx_args, 1); values[2] = PyTuple_GET_ITEM(__pyx_args, 2); values[3] = PyTuple_GET_ITEM(__pyx_args, 3); } __pyx_v_surface = ((struct __pyx_obj_11pygame_sdl2_7surface_Surface *)values[0]); __pyx_v_rect = values[1]; __pyx_v_rad = values[2]; __pyx_v_color = values[3]; } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("rounded_rectangle", 1, 4, 4, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 47; __pyx_clineno = __LINE__; goto __pyx_L3_error;} __pyx_L3_error:; __Pyx_AddTraceback("pygame_sdl2.gfxdraw.rounded_rectangle", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_surface), __pyx_ptype_11pygame_sdl2_7surface_Surface, 1, "surface", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 47; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_r = __pyx_pf_11pygame_sdl2_7gfxdraw_8rounded_rectangle(__pyx_self, __pyx_v_surface, __pyx_v_rect, __pyx_v_rad, __pyx_v_color); /* function exit code */ goto __pyx_L0; __pyx_L1_error:; __pyx_r = NULL; __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_7gfxdraw_8rounded_rectangle(CYTHON_UNUSED PyObject *__pyx_self, struct __pyx_obj_11pygame_sdl2_7surface_Surface *__pyx_v_surface, PyObject *__pyx_v_rect, PyObject *__pyx_v_rad, PyObject *__pyx_v_color) { struct __pyx_obj_11pygame_sdl2_5color_Color *__pyx_v_c = 0; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; int __pyx_t_3; int __pyx_t_4; PyObject *__pyx_t_5 = NULL; PyObject *__pyx_t_6 = NULL; Sint16 __pyx_t_7; Sint16 __pyx_t_8; Sint16 __pyx_t_9; Sint16 __pyx_t_10; Sint16 __pyx_t_11; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("rounded_rectangle", 0); __Pyx_INCREF(__pyx_v_rect); /* "pygame_sdl2/gfxdraw.pyx":48 * * def rounded_rectangle(Surface surface, rect, rad, color): * cdef Color c = Color(color) # <<<<<<<<<<<<<< * if not isinstance(rect, Rect): * rect = Rect(rect) */ __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 48; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __Pyx_INCREF(__pyx_v_color); __Pyx_GIVEREF(__pyx_v_color); PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_color); __pyx_t_2 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_11pygame_sdl2_5color_Color), __pyx_t_1, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 48; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_v_c = ((struct __pyx_obj_11pygame_sdl2_5color_Color *)__pyx_t_2); __pyx_t_2 = 0; /* "pygame_sdl2/gfxdraw.pyx":49 * def rounded_rectangle(Surface surface, rect, rad, color): * cdef Color c = Color(color) * if not isinstance(rect, Rect): # <<<<<<<<<<<<<< * rect = Rect(rect) * roundedRectangleRGBA(surface.surface, rect.x, rect.y, rect.x + rect.w, rect.y + rect.h, rad, c.r, c.g, c.b, c.a) */ __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_Rect); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 49; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = PyObject_IsInstance(__pyx_v_rect, __pyx_t_2); if (unlikely(__pyx_t_3 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 49; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_4 = ((!(__pyx_t_3 != 0)) != 0); if (__pyx_t_4) { /* "pygame_sdl2/gfxdraw.pyx":50 * cdef Color c = Color(color) * if not isinstance(rect, Rect): * rect = Rect(rect) # <<<<<<<<<<<<<< * roundedRectangleRGBA(surface.surface, rect.x, rect.y, rect.x + rect.w, rect.y + rect.h, rad, c.r, c.g, c.b, c.a) * */ __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_Rect); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 50; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_t_5 = NULL; if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_1))) { __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_1); if (likely(__pyx_t_5)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1); __Pyx_INCREF(__pyx_t_5); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_1, function); } } if (!__pyx_t_5) { __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_1, __pyx_v_rect); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 50; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); } else { __pyx_t_6 = PyTuple_New(1+1); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 50; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_6); __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_5); __pyx_t_5 = NULL; __Pyx_INCREF(__pyx_v_rect); __Pyx_GIVEREF(__pyx_v_rect); PyTuple_SET_ITEM(__pyx_t_6, 0+1, __pyx_v_rect); __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_6, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 50; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF_SET(__pyx_v_rect, __pyx_t_2); __pyx_t_2 = 0; /* "pygame_sdl2/gfxdraw.pyx":49 * def rounded_rectangle(Surface surface, rect, rad, color): * cdef Color c = Color(color) * if not isinstance(rect, Rect): # <<<<<<<<<<<<<< * rect = Rect(rect) * roundedRectangleRGBA(surface.surface, rect.x, rect.y, rect.x + rect.w, rect.y + rect.h, rad, c.r, c.g, c.b, c.a) */ } /* "pygame_sdl2/gfxdraw.pyx":51 * if not isinstance(rect, Rect): * rect = Rect(rect) * roundedRectangleRGBA(surface.surface, rect.x, rect.y, rect.x + rect.w, rect.y + rect.h, rad, c.r, c.g, c.b, c.a) # <<<<<<<<<<<<<< * * def box(Surface surface, rect, color): */ __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_rect, __pyx_n_s_x); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 51; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __pyx_t_7 = __Pyx_PyInt_As_int16_t(__pyx_t_2); if (unlikely((__pyx_t_7 == (Sint16)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 51; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_rect, __pyx_n_s_y); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 51; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __pyx_t_8 = __Pyx_PyInt_As_int16_t(__pyx_t_2); if (unlikely((__pyx_t_8 == (Sint16)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 51; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_rect, __pyx_n_s_x); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 51; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_rect, __pyx_n_s_w); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 51; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_t_6 = PyNumber_Add(__pyx_t_2, __pyx_t_1); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 51; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_9 = __Pyx_PyInt_As_int16_t(__pyx_t_6); if (unlikely((__pyx_t_9 == (Sint16)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 51; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_rect, __pyx_n_s_y); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 51; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_6); __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_rect, __pyx_n_s_h); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 51; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = PyNumber_Add(__pyx_t_6, __pyx_t_1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 51; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_10 = __Pyx_PyInt_As_int16_t(__pyx_t_2); if (unlikely((__pyx_t_10 == (Sint16)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 51; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_11 = __Pyx_PyInt_As_int16_t(__pyx_v_rad); if (unlikely((__pyx_t_11 == (Sint16)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 51; __pyx_clineno = __LINE__; goto __pyx_L1_error;} roundedRectangleRGBA(__pyx_v_surface->surface, __pyx_t_7, __pyx_t_8, __pyx_t_9, __pyx_t_10, __pyx_t_11, __pyx_v_c->r, __pyx_v_c->g, __pyx_v_c->b, __pyx_v_c->a); /* "pygame_sdl2/gfxdraw.pyx":47 * rectangleRGBA(surface.surface, rect.x, rect.y, rect.x + rect.w, rect.y + rect.h, c.r, c.g, c.b, c.a) * * def rounded_rectangle(Surface surface, rect, rad, color): # <<<<<<<<<<<<<< * cdef Color c = Color(color) * if not isinstance(rect, Rect): */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_5); __Pyx_XDECREF(__pyx_t_6); __Pyx_AddTraceback("pygame_sdl2.gfxdraw.rounded_rectangle", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF((PyObject *)__pyx_v_c); __Pyx_XDECREF(__pyx_v_rect); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/gfxdraw.pyx":53 * roundedRectangleRGBA(surface.surface, rect.x, rect.y, rect.x + rect.w, rect.y + rect.h, rad, c.r, c.g, c.b, c.a) * * def box(Surface surface, rect, color): # <<<<<<<<<<<<<< * cdef Color c = Color(color) * if not isinstance(rect, Rect): */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_7gfxdraw_11box(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static PyMethodDef __pyx_mdef_11pygame_sdl2_7gfxdraw_11box = {"box", (PyCFunction)__pyx_pw_11pygame_sdl2_7gfxdraw_11box, METH_VARARGS|METH_KEYWORDS, 0}; static PyObject *__pyx_pw_11pygame_sdl2_7gfxdraw_11box(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { struct __pyx_obj_11pygame_sdl2_7surface_Surface *__pyx_v_surface = 0; PyObject *__pyx_v_rect = 0; PyObject *__pyx_v_color = 0; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("box (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_surface,&__pyx_n_s_rect,&__pyx_n_s_color,0}; PyObject* values[3] = {0,0,0}; if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_surface)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; case 1: if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_rect)) != 0)) kw_args--; else { __Pyx_RaiseArgtupleInvalid("box", 1, 3, 3, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 53; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } case 2: if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_color)) != 0)) kw_args--; else { __Pyx_RaiseArgtupleInvalid("box", 1, 3, 3, 2); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 53; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "box") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 53; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } } else if (PyTuple_GET_SIZE(__pyx_args) != 3) { goto __pyx_L5_argtuple_error; } else { values[0] = PyTuple_GET_ITEM(__pyx_args, 0); values[1] = PyTuple_GET_ITEM(__pyx_args, 1); values[2] = PyTuple_GET_ITEM(__pyx_args, 2); } __pyx_v_surface = ((struct __pyx_obj_11pygame_sdl2_7surface_Surface *)values[0]); __pyx_v_rect = values[1]; __pyx_v_color = values[2]; } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("box", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 53; __pyx_clineno = __LINE__; goto __pyx_L3_error;} __pyx_L3_error:; __Pyx_AddTraceback("pygame_sdl2.gfxdraw.box", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_surface), __pyx_ptype_11pygame_sdl2_7surface_Surface, 1, "surface", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 53; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_r = __pyx_pf_11pygame_sdl2_7gfxdraw_10box(__pyx_self, __pyx_v_surface, __pyx_v_rect, __pyx_v_color); /* function exit code */ goto __pyx_L0; __pyx_L1_error:; __pyx_r = NULL; __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_7gfxdraw_10box(CYTHON_UNUSED PyObject *__pyx_self, struct __pyx_obj_11pygame_sdl2_7surface_Surface *__pyx_v_surface, PyObject *__pyx_v_rect, PyObject *__pyx_v_color) { struct __pyx_obj_11pygame_sdl2_5color_Color *__pyx_v_c = 0; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; int __pyx_t_3; int __pyx_t_4; PyObject *__pyx_t_5 = NULL; PyObject *__pyx_t_6 = NULL; Sint16 __pyx_t_7; Sint16 __pyx_t_8; Sint16 __pyx_t_9; Sint16 __pyx_t_10; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("box", 0); __Pyx_INCREF(__pyx_v_rect); /* "pygame_sdl2/gfxdraw.pyx":54 * * def box(Surface surface, rect, color): * cdef Color c = Color(color) # <<<<<<<<<<<<<< * if not isinstance(rect, Rect): * rect = Rect(rect) */ __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 54; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __Pyx_INCREF(__pyx_v_color); __Pyx_GIVEREF(__pyx_v_color); PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_color); __pyx_t_2 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_11pygame_sdl2_5color_Color), __pyx_t_1, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 54; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_v_c = ((struct __pyx_obj_11pygame_sdl2_5color_Color *)__pyx_t_2); __pyx_t_2 = 0; /* "pygame_sdl2/gfxdraw.pyx":55 * def box(Surface surface, rect, color): * cdef Color c = Color(color) * if not isinstance(rect, Rect): # <<<<<<<<<<<<<< * rect = Rect(rect) * boxRGBA(surface.surface, rect.x, rect.y, rect.x + rect.w, rect.y + rect.h, c.r, c.g, c.b, c.a) */ __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_Rect); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 55; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = PyObject_IsInstance(__pyx_v_rect, __pyx_t_2); if (unlikely(__pyx_t_3 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 55; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_4 = ((!(__pyx_t_3 != 0)) != 0); if (__pyx_t_4) { /* "pygame_sdl2/gfxdraw.pyx":56 * cdef Color c = Color(color) * if not isinstance(rect, Rect): * rect = Rect(rect) # <<<<<<<<<<<<<< * boxRGBA(surface.surface, rect.x, rect.y, rect.x + rect.w, rect.y + rect.h, c.r, c.g, c.b, c.a) * */ __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_Rect); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 56; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_t_5 = NULL; if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_1))) { __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_1); if (likely(__pyx_t_5)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1); __Pyx_INCREF(__pyx_t_5); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_1, function); } } if (!__pyx_t_5) { __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_1, __pyx_v_rect); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 56; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); } else { __pyx_t_6 = PyTuple_New(1+1); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 56; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_6); __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_5); __pyx_t_5 = NULL; __Pyx_INCREF(__pyx_v_rect); __Pyx_GIVEREF(__pyx_v_rect); PyTuple_SET_ITEM(__pyx_t_6, 0+1, __pyx_v_rect); __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_6, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 56; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF_SET(__pyx_v_rect, __pyx_t_2); __pyx_t_2 = 0; /* "pygame_sdl2/gfxdraw.pyx":55 * def box(Surface surface, rect, color): * cdef Color c = Color(color) * if not isinstance(rect, Rect): # <<<<<<<<<<<<<< * rect = Rect(rect) * boxRGBA(surface.surface, rect.x, rect.y, rect.x + rect.w, rect.y + rect.h, c.r, c.g, c.b, c.a) */ } /* "pygame_sdl2/gfxdraw.pyx":57 * if not isinstance(rect, Rect): * rect = Rect(rect) * boxRGBA(surface.surface, rect.x, rect.y, rect.x + rect.w, rect.y + rect.h, c.r, c.g, c.b, c.a) # <<<<<<<<<<<<<< * * def rounded_box(Surface surface, rect, rad, color): */ __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_rect, __pyx_n_s_x); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 57; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __pyx_t_7 = __Pyx_PyInt_As_int16_t(__pyx_t_2); if (unlikely((__pyx_t_7 == (Sint16)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 57; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_rect, __pyx_n_s_y); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 57; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __pyx_t_8 = __Pyx_PyInt_As_int16_t(__pyx_t_2); if (unlikely((__pyx_t_8 == (Sint16)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 57; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_rect, __pyx_n_s_x); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 57; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_rect, __pyx_n_s_w); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 57; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_t_6 = PyNumber_Add(__pyx_t_2, __pyx_t_1); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 57; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_9 = __Pyx_PyInt_As_int16_t(__pyx_t_6); if (unlikely((__pyx_t_9 == (Sint16)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 57; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_rect, __pyx_n_s_y); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 57; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_6); __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_rect, __pyx_n_s_h); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 57; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = PyNumber_Add(__pyx_t_6, __pyx_t_1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 57; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_10 = __Pyx_PyInt_As_int16_t(__pyx_t_2); if (unlikely((__pyx_t_10 == (Sint16)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 57; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; boxRGBA(__pyx_v_surface->surface, __pyx_t_7, __pyx_t_8, __pyx_t_9, __pyx_t_10, __pyx_v_c->r, __pyx_v_c->g, __pyx_v_c->b, __pyx_v_c->a); /* "pygame_sdl2/gfxdraw.pyx":53 * roundedRectangleRGBA(surface.surface, rect.x, rect.y, rect.x + rect.w, rect.y + rect.h, rad, c.r, c.g, c.b, c.a) * * def box(Surface surface, rect, color): # <<<<<<<<<<<<<< * cdef Color c = Color(color) * if not isinstance(rect, Rect): */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_5); __Pyx_XDECREF(__pyx_t_6); __Pyx_AddTraceback("pygame_sdl2.gfxdraw.box", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF((PyObject *)__pyx_v_c); __Pyx_XDECREF(__pyx_v_rect); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/gfxdraw.pyx":59 * boxRGBA(surface.surface, rect.x, rect.y, rect.x + rect.w, rect.y + rect.h, c.r, c.g, c.b, c.a) * * def rounded_box(Surface surface, rect, rad, color): # <<<<<<<<<<<<<< * cdef Color c = Color(color) * if not isinstance(rect, Rect): */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_7gfxdraw_13rounded_box(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static PyMethodDef __pyx_mdef_11pygame_sdl2_7gfxdraw_13rounded_box = {"rounded_box", (PyCFunction)__pyx_pw_11pygame_sdl2_7gfxdraw_13rounded_box, METH_VARARGS|METH_KEYWORDS, 0}; static PyObject *__pyx_pw_11pygame_sdl2_7gfxdraw_13rounded_box(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { struct __pyx_obj_11pygame_sdl2_7surface_Surface *__pyx_v_surface = 0; PyObject *__pyx_v_rect = 0; PyObject *__pyx_v_rad = 0; PyObject *__pyx_v_color = 0; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("rounded_box (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_surface,&__pyx_n_s_rect,&__pyx_n_s_rad,&__pyx_n_s_color,0}; PyObject* values[4] = {0,0,0,0}; if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_surface)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; case 1: if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_rect)) != 0)) kw_args--; else { __Pyx_RaiseArgtupleInvalid("rounded_box", 1, 4, 4, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 59; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } case 2: if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_rad)) != 0)) kw_args--; else { __Pyx_RaiseArgtupleInvalid("rounded_box", 1, 4, 4, 2); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 59; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } case 3: if (likely((values[3] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_color)) != 0)) kw_args--; else { __Pyx_RaiseArgtupleInvalid("rounded_box", 1, 4, 4, 3); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 59; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "rounded_box") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 59; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } } else if (PyTuple_GET_SIZE(__pyx_args) != 4) { goto __pyx_L5_argtuple_error; } else { values[0] = PyTuple_GET_ITEM(__pyx_args, 0); values[1] = PyTuple_GET_ITEM(__pyx_args, 1); values[2] = PyTuple_GET_ITEM(__pyx_args, 2); values[3] = PyTuple_GET_ITEM(__pyx_args, 3); } __pyx_v_surface = ((struct __pyx_obj_11pygame_sdl2_7surface_Surface *)values[0]); __pyx_v_rect = values[1]; __pyx_v_rad = values[2]; __pyx_v_color = values[3]; } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("rounded_box", 1, 4, 4, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 59; __pyx_clineno = __LINE__; goto __pyx_L3_error;} __pyx_L3_error:; __Pyx_AddTraceback("pygame_sdl2.gfxdraw.rounded_box", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_surface), __pyx_ptype_11pygame_sdl2_7surface_Surface, 1, "surface", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 59; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_r = __pyx_pf_11pygame_sdl2_7gfxdraw_12rounded_box(__pyx_self, __pyx_v_surface, __pyx_v_rect, __pyx_v_rad, __pyx_v_color); /* function exit code */ goto __pyx_L0; __pyx_L1_error:; __pyx_r = NULL; __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_7gfxdraw_12rounded_box(CYTHON_UNUSED PyObject *__pyx_self, struct __pyx_obj_11pygame_sdl2_7surface_Surface *__pyx_v_surface, PyObject *__pyx_v_rect, PyObject *__pyx_v_rad, PyObject *__pyx_v_color) { struct __pyx_obj_11pygame_sdl2_5color_Color *__pyx_v_c = 0; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; int __pyx_t_3; int __pyx_t_4; PyObject *__pyx_t_5 = NULL; PyObject *__pyx_t_6 = NULL; Sint16 __pyx_t_7; Sint16 __pyx_t_8; Sint16 __pyx_t_9; Sint16 __pyx_t_10; Sint16 __pyx_t_11; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("rounded_box", 0); __Pyx_INCREF(__pyx_v_rect); /* "pygame_sdl2/gfxdraw.pyx":60 * * def rounded_box(Surface surface, rect, rad, color): * cdef Color c = Color(color) # <<<<<<<<<<<<<< * if not isinstance(rect, Rect): * rect = Rect(rect) */ __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 60; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __Pyx_INCREF(__pyx_v_color); __Pyx_GIVEREF(__pyx_v_color); PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_color); __pyx_t_2 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_11pygame_sdl2_5color_Color), __pyx_t_1, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 60; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_v_c = ((struct __pyx_obj_11pygame_sdl2_5color_Color *)__pyx_t_2); __pyx_t_2 = 0; /* "pygame_sdl2/gfxdraw.pyx":61 * def rounded_box(Surface surface, rect, rad, color): * cdef Color c = Color(color) * if not isinstance(rect, Rect): # <<<<<<<<<<<<<< * rect = Rect(rect) * roundedBoxRGBA(surface.surface, rect.x, rect.y, rect.x + rect.w, rect.y + rect.h, rad, c.r, c.g, c.b, c.a) */ __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_Rect); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 61; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = PyObject_IsInstance(__pyx_v_rect, __pyx_t_2); if (unlikely(__pyx_t_3 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 61; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_4 = ((!(__pyx_t_3 != 0)) != 0); if (__pyx_t_4) { /* "pygame_sdl2/gfxdraw.pyx":62 * cdef Color c = Color(color) * if not isinstance(rect, Rect): * rect = Rect(rect) # <<<<<<<<<<<<<< * roundedBoxRGBA(surface.surface, rect.x, rect.y, rect.x + rect.w, rect.y + rect.h, rad, c.r, c.g, c.b, c.a) * */ __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_Rect); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 62; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_t_5 = NULL; if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_1))) { __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_1); if (likely(__pyx_t_5)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1); __Pyx_INCREF(__pyx_t_5); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_1, function); } } if (!__pyx_t_5) { __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_1, __pyx_v_rect); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 62; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); } else { __pyx_t_6 = PyTuple_New(1+1); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 62; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_6); __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_5); __pyx_t_5 = NULL; __Pyx_INCREF(__pyx_v_rect); __Pyx_GIVEREF(__pyx_v_rect); PyTuple_SET_ITEM(__pyx_t_6, 0+1, __pyx_v_rect); __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_6, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 62; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF_SET(__pyx_v_rect, __pyx_t_2); __pyx_t_2 = 0; /* "pygame_sdl2/gfxdraw.pyx":61 * def rounded_box(Surface surface, rect, rad, color): * cdef Color c = Color(color) * if not isinstance(rect, Rect): # <<<<<<<<<<<<<< * rect = Rect(rect) * roundedBoxRGBA(surface.surface, rect.x, rect.y, rect.x + rect.w, rect.y + rect.h, rad, c.r, c.g, c.b, c.a) */ } /* "pygame_sdl2/gfxdraw.pyx":63 * if not isinstance(rect, Rect): * rect = Rect(rect) * roundedBoxRGBA(surface.surface, rect.x, rect.y, rect.x + rect.w, rect.y + rect.h, rad, c.r, c.g, c.b, c.a) # <<<<<<<<<<<<<< * * def line(Surface surface, x1, y1, x2, y2, color): */ __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_rect, __pyx_n_s_x); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 63; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __pyx_t_7 = __Pyx_PyInt_As_int16_t(__pyx_t_2); if (unlikely((__pyx_t_7 == (Sint16)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 63; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_rect, __pyx_n_s_y); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 63; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __pyx_t_8 = __Pyx_PyInt_As_int16_t(__pyx_t_2); if (unlikely((__pyx_t_8 == (Sint16)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 63; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_rect, __pyx_n_s_x); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 63; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_rect, __pyx_n_s_w); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 63; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_t_6 = PyNumber_Add(__pyx_t_2, __pyx_t_1); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 63; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_9 = __Pyx_PyInt_As_int16_t(__pyx_t_6); if (unlikely((__pyx_t_9 == (Sint16)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 63; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_rect, __pyx_n_s_y); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 63; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_6); __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_rect, __pyx_n_s_h); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 63; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = PyNumber_Add(__pyx_t_6, __pyx_t_1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 63; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_10 = __Pyx_PyInt_As_int16_t(__pyx_t_2); if (unlikely((__pyx_t_10 == (Sint16)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 63; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_11 = __Pyx_PyInt_As_int16_t(__pyx_v_rad); if (unlikely((__pyx_t_11 == (Sint16)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 63; __pyx_clineno = __LINE__; goto __pyx_L1_error;} roundedBoxRGBA(__pyx_v_surface->surface, __pyx_t_7, __pyx_t_8, __pyx_t_9, __pyx_t_10, __pyx_t_11, __pyx_v_c->r, __pyx_v_c->g, __pyx_v_c->b, __pyx_v_c->a); /* "pygame_sdl2/gfxdraw.pyx":59 * boxRGBA(surface.surface, rect.x, rect.y, rect.x + rect.w, rect.y + rect.h, c.r, c.g, c.b, c.a) * * def rounded_box(Surface surface, rect, rad, color): # <<<<<<<<<<<<<< * cdef Color c = Color(color) * if not isinstance(rect, Rect): */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_5); __Pyx_XDECREF(__pyx_t_6); __Pyx_AddTraceback("pygame_sdl2.gfxdraw.rounded_box", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF((PyObject *)__pyx_v_c); __Pyx_XDECREF(__pyx_v_rect); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/gfxdraw.pyx":65 * roundedBoxRGBA(surface.surface, rect.x, rect.y, rect.x + rect.w, rect.y + rect.h, rad, c.r, c.g, c.b, c.a) * * def line(Surface surface, x1, y1, x2, y2, color): # <<<<<<<<<<<<<< * cdef Color c = Color(color) * lineRGBA(surface.surface, x1, y1, x2, y2, c.r, c.g, c.b, c.a) */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_7gfxdraw_15line(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static PyMethodDef __pyx_mdef_11pygame_sdl2_7gfxdraw_15line = {"line", (PyCFunction)__pyx_pw_11pygame_sdl2_7gfxdraw_15line, METH_VARARGS|METH_KEYWORDS, 0}; static PyObject *__pyx_pw_11pygame_sdl2_7gfxdraw_15line(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { struct __pyx_obj_11pygame_sdl2_7surface_Surface *__pyx_v_surface = 0; PyObject *__pyx_v_x1 = 0; PyObject *__pyx_v_y1 = 0; PyObject *__pyx_v_x2 = 0; PyObject *__pyx_v_y2 = 0; PyObject *__pyx_v_color = 0; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("line (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_surface,&__pyx_n_s_x1,&__pyx_n_s_y1,&__pyx_n_s_x2,&__pyx_n_s_y2,&__pyx_n_s_color,0}; PyObject* values[6] = {0,0,0,0,0,0}; if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5); case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4); case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_surface)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; case 1: if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_x1)) != 0)) kw_args--; else { __Pyx_RaiseArgtupleInvalid("line", 1, 6, 6, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 65; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } case 2: if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_y1)) != 0)) kw_args--; else { __Pyx_RaiseArgtupleInvalid("line", 1, 6, 6, 2); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 65; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } case 3: if (likely((values[3] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_x2)) != 0)) kw_args--; else { __Pyx_RaiseArgtupleInvalid("line", 1, 6, 6, 3); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 65; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } case 4: if (likely((values[4] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_y2)) != 0)) kw_args--; else { __Pyx_RaiseArgtupleInvalid("line", 1, 6, 6, 4); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 65; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } case 5: if (likely((values[5] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_color)) != 0)) kw_args--; else { __Pyx_RaiseArgtupleInvalid("line", 1, 6, 6, 5); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 65; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "line") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 65; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } } else if (PyTuple_GET_SIZE(__pyx_args) != 6) { goto __pyx_L5_argtuple_error; } else { values[0] = PyTuple_GET_ITEM(__pyx_args, 0); values[1] = PyTuple_GET_ITEM(__pyx_args, 1); values[2] = PyTuple_GET_ITEM(__pyx_args, 2); values[3] = PyTuple_GET_ITEM(__pyx_args, 3); values[4] = PyTuple_GET_ITEM(__pyx_args, 4); values[5] = PyTuple_GET_ITEM(__pyx_args, 5); } __pyx_v_surface = ((struct __pyx_obj_11pygame_sdl2_7surface_Surface *)values[0]); __pyx_v_x1 = values[1]; __pyx_v_y1 = values[2]; __pyx_v_x2 = values[3]; __pyx_v_y2 = values[4]; __pyx_v_color = values[5]; } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("line", 1, 6, 6, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 65; __pyx_clineno = __LINE__; goto __pyx_L3_error;} __pyx_L3_error:; __Pyx_AddTraceback("pygame_sdl2.gfxdraw.line", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_surface), __pyx_ptype_11pygame_sdl2_7surface_Surface, 1, "surface", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 65; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_r = __pyx_pf_11pygame_sdl2_7gfxdraw_14line(__pyx_self, __pyx_v_surface, __pyx_v_x1, __pyx_v_y1, __pyx_v_x2, __pyx_v_y2, __pyx_v_color); /* function exit code */ goto __pyx_L0; __pyx_L1_error:; __pyx_r = NULL; __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_7gfxdraw_14line(CYTHON_UNUSED PyObject *__pyx_self, struct __pyx_obj_11pygame_sdl2_7surface_Surface *__pyx_v_surface, PyObject *__pyx_v_x1, PyObject *__pyx_v_y1, PyObject *__pyx_v_x2, PyObject *__pyx_v_y2, PyObject *__pyx_v_color) { struct __pyx_obj_11pygame_sdl2_5color_Color *__pyx_v_c = 0; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; Sint16 __pyx_t_3; Sint16 __pyx_t_4; Sint16 __pyx_t_5; Sint16 __pyx_t_6; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("line", 0); /* "pygame_sdl2/gfxdraw.pyx":66 * * def line(Surface surface, x1, y1, x2, y2, color): * cdef Color c = Color(color) # <<<<<<<<<<<<<< * lineRGBA(surface.surface, x1, y1, x2, y2, c.r, c.g, c.b, c.a) * */ __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 66; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __Pyx_INCREF(__pyx_v_color); __Pyx_GIVEREF(__pyx_v_color); PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_color); __pyx_t_2 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_11pygame_sdl2_5color_Color), __pyx_t_1, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 66; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_v_c = ((struct __pyx_obj_11pygame_sdl2_5color_Color *)__pyx_t_2); __pyx_t_2 = 0; /* "pygame_sdl2/gfxdraw.pyx":67 * def line(Surface surface, x1, y1, x2, y2, color): * cdef Color c = Color(color) * lineRGBA(surface.surface, x1, y1, x2, y2, c.r, c.g, c.b, c.a) # <<<<<<<<<<<<<< * * def aaline(Surface surface, x1, y1, x2, y2, color): */ __pyx_t_3 = __Pyx_PyInt_As_int16_t(__pyx_v_x1); if (unlikely((__pyx_t_3 == (Sint16)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 67; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_t_4 = __Pyx_PyInt_As_int16_t(__pyx_v_y1); if (unlikely((__pyx_t_4 == (Sint16)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 67; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_t_5 = __Pyx_PyInt_As_int16_t(__pyx_v_x2); if (unlikely((__pyx_t_5 == (Sint16)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 67; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_t_6 = __Pyx_PyInt_As_int16_t(__pyx_v_y2); if (unlikely((__pyx_t_6 == (Sint16)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 67; __pyx_clineno = __LINE__; goto __pyx_L1_error;} lineRGBA(__pyx_v_surface->surface, __pyx_t_3, __pyx_t_4, __pyx_t_5, __pyx_t_6, __pyx_v_c->r, __pyx_v_c->g, __pyx_v_c->b, __pyx_v_c->a); /* "pygame_sdl2/gfxdraw.pyx":65 * roundedBoxRGBA(surface.surface, rect.x, rect.y, rect.x + rect.w, rect.y + rect.h, rad, c.r, c.g, c.b, c.a) * * def line(Surface surface, x1, y1, x2, y2, color): # <<<<<<<<<<<<<< * cdef Color c = Color(color) * lineRGBA(surface.surface, x1, y1, x2, y2, c.r, c.g, c.b, c.a) */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_AddTraceback("pygame_sdl2.gfxdraw.line", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF((PyObject *)__pyx_v_c); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/gfxdraw.pyx":69 * lineRGBA(surface.surface, x1, y1, x2, y2, c.r, c.g, c.b, c.a) * * def aaline(Surface surface, x1, y1, x2, y2, color): # <<<<<<<<<<<<<< * cdef Color c = Color(color) * aalineRGBA(surface.surface, x1, y1, x2, y2, c.r, c.g, c.b, c.a) */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_7gfxdraw_17aaline(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static PyMethodDef __pyx_mdef_11pygame_sdl2_7gfxdraw_17aaline = {"aaline", (PyCFunction)__pyx_pw_11pygame_sdl2_7gfxdraw_17aaline, METH_VARARGS|METH_KEYWORDS, 0}; static PyObject *__pyx_pw_11pygame_sdl2_7gfxdraw_17aaline(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { struct __pyx_obj_11pygame_sdl2_7surface_Surface *__pyx_v_surface = 0; PyObject *__pyx_v_x1 = 0; PyObject *__pyx_v_y1 = 0; PyObject *__pyx_v_x2 = 0; PyObject *__pyx_v_y2 = 0; PyObject *__pyx_v_color = 0; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("aaline (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_surface,&__pyx_n_s_x1,&__pyx_n_s_y1,&__pyx_n_s_x2,&__pyx_n_s_y2,&__pyx_n_s_color,0}; PyObject* values[6] = {0,0,0,0,0,0}; if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5); case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4); case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_surface)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; case 1: if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_x1)) != 0)) kw_args--; else { __Pyx_RaiseArgtupleInvalid("aaline", 1, 6, 6, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 69; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } case 2: if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_y1)) != 0)) kw_args--; else { __Pyx_RaiseArgtupleInvalid("aaline", 1, 6, 6, 2); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 69; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } case 3: if (likely((values[3] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_x2)) != 0)) kw_args--; else { __Pyx_RaiseArgtupleInvalid("aaline", 1, 6, 6, 3); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 69; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } case 4: if (likely((values[4] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_y2)) != 0)) kw_args--; else { __Pyx_RaiseArgtupleInvalid("aaline", 1, 6, 6, 4); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 69; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } case 5: if (likely((values[5] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_color)) != 0)) kw_args--; else { __Pyx_RaiseArgtupleInvalid("aaline", 1, 6, 6, 5); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 69; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "aaline") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 69; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } } else if (PyTuple_GET_SIZE(__pyx_args) != 6) { goto __pyx_L5_argtuple_error; } else { values[0] = PyTuple_GET_ITEM(__pyx_args, 0); values[1] = PyTuple_GET_ITEM(__pyx_args, 1); values[2] = PyTuple_GET_ITEM(__pyx_args, 2); values[3] = PyTuple_GET_ITEM(__pyx_args, 3); values[4] = PyTuple_GET_ITEM(__pyx_args, 4); values[5] = PyTuple_GET_ITEM(__pyx_args, 5); } __pyx_v_surface = ((struct __pyx_obj_11pygame_sdl2_7surface_Surface *)values[0]); __pyx_v_x1 = values[1]; __pyx_v_y1 = values[2]; __pyx_v_x2 = values[3]; __pyx_v_y2 = values[4]; __pyx_v_color = values[5]; } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("aaline", 1, 6, 6, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 69; __pyx_clineno = __LINE__; goto __pyx_L3_error;} __pyx_L3_error:; __Pyx_AddTraceback("pygame_sdl2.gfxdraw.aaline", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_surface), __pyx_ptype_11pygame_sdl2_7surface_Surface, 1, "surface", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 69; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_r = __pyx_pf_11pygame_sdl2_7gfxdraw_16aaline(__pyx_self, __pyx_v_surface, __pyx_v_x1, __pyx_v_y1, __pyx_v_x2, __pyx_v_y2, __pyx_v_color); /* function exit code */ goto __pyx_L0; __pyx_L1_error:; __pyx_r = NULL; __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_7gfxdraw_16aaline(CYTHON_UNUSED PyObject *__pyx_self, struct __pyx_obj_11pygame_sdl2_7surface_Surface *__pyx_v_surface, PyObject *__pyx_v_x1, PyObject *__pyx_v_y1, PyObject *__pyx_v_x2, PyObject *__pyx_v_y2, PyObject *__pyx_v_color) { struct __pyx_obj_11pygame_sdl2_5color_Color *__pyx_v_c = 0; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; Sint16 __pyx_t_3; Sint16 __pyx_t_4; Sint16 __pyx_t_5; Sint16 __pyx_t_6; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("aaline", 0); /* "pygame_sdl2/gfxdraw.pyx":70 * * def aaline(Surface surface, x1, y1, x2, y2, color): * cdef Color c = Color(color) # <<<<<<<<<<<<<< * aalineRGBA(surface.surface, x1, y1, x2, y2, c.r, c.g, c.b, c.a) * */ __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 70; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __Pyx_INCREF(__pyx_v_color); __Pyx_GIVEREF(__pyx_v_color); PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_color); __pyx_t_2 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_11pygame_sdl2_5color_Color), __pyx_t_1, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 70; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_v_c = ((struct __pyx_obj_11pygame_sdl2_5color_Color *)__pyx_t_2); __pyx_t_2 = 0; /* "pygame_sdl2/gfxdraw.pyx":71 * def aaline(Surface surface, x1, y1, x2, y2, color): * cdef Color c = Color(color) * aalineRGBA(surface.surface, x1, y1, x2, y2, c.r, c.g, c.b, c.a) # <<<<<<<<<<<<<< * * def thick_line(Surface surface, x1, y1, x2, y2, width, color): */ __pyx_t_3 = __Pyx_PyInt_As_int16_t(__pyx_v_x1); if (unlikely((__pyx_t_3 == (Sint16)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 71; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_t_4 = __Pyx_PyInt_As_int16_t(__pyx_v_y1); if (unlikely((__pyx_t_4 == (Sint16)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 71; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_t_5 = __Pyx_PyInt_As_int16_t(__pyx_v_x2); if (unlikely((__pyx_t_5 == (Sint16)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 71; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_t_6 = __Pyx_PyInt_As_int16_t(__pyx_v_y2); if (unlikely((__pyx_t_6 == (Sint16)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 71; __pyx_clineno = __LINE__; goto __pyx_L1_error;} aalineRGBA(__pyx_v_surface->surface, __pyx_t_3, __pyx_t_4, __pyx_t_5, __pyx_t_6, __pyx_v_c->r, __pyx_v_c->g, __pyx_v_c->b, __pyx_v_c->a); /* "pygame_sdl2/gfxdraw.pyx":69 * lineRGBA(surface.surface, x1, y1, x2, y2, c.r, c.g, c.b, c.a) * * def aaline(Surface surface, x1, y1, x2, y2, color): # <<<<<<<<<<<<<< * cdef Color c = Color(color) * aalineRGBA(surface.surface, x1, y1, x2, y2, c.r, c.g, c.b, c.a) */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_AddTraceback("pygame_sdl2.gfxdraw.aaline", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF((PyObject *)__pyx_v_c); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/gfxdraw.pyx":73 * aalineRGBA(surface.surface, x1, y1, x2, y2, c.r, c.g, c.b, c.a) * * def thick_line(Surface surface, x1, y1, x2, y2, width, color): # <<<<<<<<<<<<<< * cdef Color c = Color(color) * */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_7gfxdraw_19thick_line(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static PyMethodDef __pyx_mdef_11pygame_sdl2_7gfxdraw_19thick_line = {"thick_line", (PyCFunction)__pyx_pw_11pygame_sdl2_7gfxdraw_19thick_line, METH_VARARGS|METH_KEYWORDS, 0}; static PyObject *__pyx_pw_11pygame_sdl2_7gfxdraw_19thick_line(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { struct __pyx_obj_11pygame_sdl2_7surface_Surface *__pyx_v_surface = 0; PyObject *__pyx_v_x1 = 0; PyObject *__pyx_v_y1 = 0; PyObject *__pyx_v_x2 = 0; PyObject *__pyx_v_y2 = 0; PyObject *__pyx_v_width = 0; PyObject *__pyx_v_color = 0; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("thick_line (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_surface,&__pyx_n_s_x1,&__pyx_n_s_y1,&__pyx_n_s_x2,&__pyx_n_s_y2,&__pyx_n_s_width,&__pyx_n_s_color,0}; PyObject* values[7] = {0,0,0,0,0,0,0}; if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 7: values[6] = PyTuple_GET_ITEM(__pyx_args, 6); case 6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5); case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4); case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_surface)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; case 1: if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_x1)) != 0)) kw_args--; else { __Pyx_RaiseArgtupleInvalid("thick_line", 1, 7, 7, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 73; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } case 2: if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_y1)) != 0)) kw_args--; else { __Pyx_RaiseArgtupleInvalid("thick_line", 1, 7, 7, 2); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 73; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } case 3: if (likely((values[3] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_x2)) != 0)) kw_args--; else { __Pyx_RaiseArgtupleInvalid("thick_line", 1, 7, 7, 3); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 73; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } case 4: if (likely((values[4] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_y2)) != 0)) kw_args--; else { __Pyx_RaiseArgtupleInvalid("thick_line", 1, 7, 7, 4); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 73; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } case 5: if (likely((values[5] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_width)) != 0)) kw_args--; else { __Pyx_RaiseArgtupleInvalid("thick_line", 1, 7, 7, 5); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 73; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } case 6: if (likely((values[6] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_color)) != 0)) kw_args--; else { __Pyx_RaiseArgtupleInvalid("thick_line", 1, 7, 7, 6); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 73; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "thick_line") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 73; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } } else if (PyTuple_GET_SIZE(__pyx_args) != 7) { goto __pyx_L5_argtuple_error; } else { values[0] = PyTuple_GET_ITEM(__pyx_args, 0); values[1] = PyTuple_GET_ITEM(__pyx_args, 1); values[2] = PyTuple_GET_ITEM(__pyx_args, 2); values[3] = PyTuple_GET_ITEM(__pyx_args, 3); values[4] = PyTuple_GET_ITEM(__pyx_args, 4); values[5] = PyTuple_GET_ITEM(__pyx_args, 5); values[6] = PyTuple_GET_ITEM(__pyx_args, 6); } __pyx_v_surface = ((struct __pyx_obj_11pygame_sdl2_7surface_Surface *)values[0]); __pyx_v_x1 = values[1]; __pyx_v_y1 = values[2]; __pyx_v_x2 = values[3]; __pyx_v_y2 = values[4]; __pyx_v_width = values[5]; __pyx_v_color = values[6]; } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("thick_line", 1, 7, 7, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 73; __pyx_clineno = __LINE__; goto __pyx_L3_error;} __pyx_L3_error:; __Pyx_AddTraceback("pygame_sdl2.gfxdraw.thick_line", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_surface), __pyx_ptype_11pygame_sdl2_7surface_Surface, 1, "surface", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 73; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_r = __pyx_pf_11pygame_sdl2_7gfxdraw_18thick_line(__pyx_self, __pyx_v_surface, __pyx_v_x1, __pyx_v_y1, __pyx_v_x2, __pyx_v_y2, __pyx_v_width, __pyx_v_color); /* function exit code */ goto __pyx_L0; __pyx_L1_error:; __pyx_r = NULL; __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_7gfxdraw_18thick_line(CYTHON_UNUSED PyObject *__pyx_self, struct __pyx_obj_11pygame_sdl2_7surface_Surface *__pyx_v_surface, PyObject *__pyx_v_x1, PyObject *__pyx_v_y1, PyObject *__pyx_v_x2, PyObject *__pyx_v_y2, PyObject *__pyx_v_width, PyObject *__pyx_v_color) { struct __pyx_obj_11pygame_sdl2_5color_Color *__pyx_v_c = 0; int __pyx_v_x1int; int __pyx_v_y1int; int __pyx_v_x2int; int __pyx_v_y2int; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; int __pyx_t_3; int __pyx_t_4; int __pyx_t_5; Uint8 __pyx_t_6; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("thick_line", 0); /* "pygame_sdl2/gfxdraw.pyx":74 * * def thick_line(Surface surface, x1, y1, x2, y2, width, color): * cdef Color c = Color(color) # <<<<<<<<<<<<<< * * # This locks up in c code when trying to draw a zero-length line. So make */ __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 74; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __Pyx_INCREF(__pyx_v_color); __Pyx_GIVEREF(__pyx_v_color); PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_color); __pyx_t_2 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_11pygame_sdl2_5color_Color), __pyx_t_1, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 74; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_v_c = ((struct __pyx_obj_11pygame_sdl2_5color_Color *)__pyx_t_2); __pyx_t_2 = 0; /* "pygame_sdl2/gfxdraw.pyx":79 * # sure that doesn't happen. * cdef int x1int, y1int, x2int, y2int * x1int = x1 # <<<<<<<<<<<<<< * y1int = y1 * x2int = x2 */ __pyx_t_3 = __Pyx_PyInt_As_int(__pyx_v_x1); if (unlikely((__pyx_t_3 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 79; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_v_x1int = __pyx_t_3; /* "pygame_sdl2/gfxdraw.pyx":80 * cdef int x1int, y1int, x2int, y2int * x1int = x1 * y1int = y1 # <<<<<<<<<<<<<< * x2int = x2 * y2int = y2 */ __pyx_t_3 = __Pyx_PyInt_As_int(__pyx_v_y1); if (unlikely((__pyx_t_3 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 80; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_v_y1int = __pyx_t_3; /* "pygame_sdl2/gfxdraw.pyx":81 * x1int = x1 * y1int = y1 * x2int = x2 # <<<<<<<<<<<<<< * y2int = y2 * */ __pyx_t_3 = __Pyx_PyInt_As_int(__pyx_v_x2); if (unlikely((__pyx_t_3 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 81; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_v_x2int = __pyx_t_3; /* "pygame_sdl2/gfxdraw.pyx":82 * y1int = y1 * x2int = x2 * y2int = y2 # <<<<<<<<<<<<<< * * */ __pyx_t_3 = __Pyx_PyInt_As_int(__pyx_v_y2); if (unlikely((__pyx_t_3 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 82; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_v_y2int = __pyx_t_3; /* "pygame_sdl2/gfxdraw.pyx":85 * * * if x1int == x2int and y1int == y2int: # <<<<<<<<<<<<<< * return * */ __pyx_t_5 = ((__pyx_v_x1int == __pyx_v_x2int) != 0); if (__pyx_t_5) { } else { __pyx_t_4 = __pyx_t_5; goto __pyx_L4_bool_binop_done; } __pyx_t_5 = ((__pyx_v_y1int == __pyx_v_y2int) != 0); __pyx_t_4 = __pyx_t_5; __pyx_L4_bool_binop_done:; if (__pyx_t_4) { /* "pygame_sdl2/gfxdraw.pyx":86 * * if x1int == x2int and y1int == y2int: * return # <<<<<<<<<<<<<< * * thickLineRGBA(surface.surface, x1int, y1int, x2int, y2int, width, c.r, c.g, c.b, c.a) */ __Pyx_XDECREF(__pyx_r); __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; /* "pygame_sdl2/gfxdraw.pyx":85 * * * if x1int == x2int and y1int == y2int: # <<<<<<<<<<<<<< * return * */ } /* "pygame_sdl2/gfxdraw.pyx":88 * return * * thickLineRGBA(surface.surface, x1int, y1int, x2int, y2int, width, c.r, c.g, c.b, c.a) # <<<<<<<<<<<<<< * * def circle(Surface surface, x, y, r, color): */ __pyx_t_6 = __Pyx_PyInt_As_uint8_t(__pyx_v_width); if (unlikely((__pyx_t_6 == (Uint8)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 88; __pyx_clineno = __LINE__; goto __pyx_L1_error;} thickLineRGBA(__pyx_v_surface->surface, __pyx_v_x1int, __pyx_v_y1int, __pyx_v_x2int, __pyx_v_y2int, __pyx_t_6, __pyx_v_c->r, __pyx_v_c->g, __pyx_v_c->b, __pyx_v_c->a); /* "pygame_sdl2/gfxdraw.pyx":73 * aalineRGBA(surface.surface, x1, y1, x2, y2, c.r, c.g, c.b, c.a) * * def thick_line(Surface surface, x1, y1, x2, y2, width, color): # <<<<<<<<<<<<<< * cdef Color c = Color(color) * */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_AddTraceback("pygame_sdl2.gfxdraw.thick_line", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF((PyObject *)__pyx_v_c); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/gfxdraw.pyx":90 * thickLineRGBA(surface.surface, x1int, y1int, x2int, y2int, width, c.r, c.g, c.b, c.a) * * def circle(Surface surface, x, y, r, color): # <<<<<<<<<<<<<< * cdef Color c = Color(color) * circleRGBA(surface.surface, x, y, r, c.r, c.g, c.b, c.a) */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_7gfxdraw_21circle(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static PyMethodDef __pyx_mdef_11pygame_sdl2_7gfxdraw_21circle = {"circle", (PyCFunction)__pyx_pw_11pygame_sdl2_7gfxdraw_21circle, METH_VARARGS|METH_KEYWORDS, 0}; static PyObject *__pyx_pw_11pygame_sdl2_7gfxdraw_21circle(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { struct __pyx_obj_11pygame_sdl2_7surface_Surface *__pyx_v_surface = 0; PyObject *__pyx_v_x = 0; PyObject *__pyx_v_y = 0; PyObject *__pyx_v_r = 0; PyObject *__pyx_v_color = 0; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("circle (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_surface,&__pyx_n_s_x,&__pyx_n_s_y,&__pyx_n_s_r,&__pyx_n_s_color,0}; PyObject* values[5] = {0,0,0,0,0}; if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4); case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_surface)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; case 1: if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_x)) != 0)) kw_args--; else { __Pyx_RaiseArgtupleInvalid("circle", 1, 5, 5, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 90; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } case 2: if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_y)) != 0)) kw_args--; else { __Pyx_RaiseArgtupleInvalid("circle", 1, 5, 5, 2); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 90; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } case 3: if (likely((values[3] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_r)) != 0)) kw_args--; else { __Pyx_RaiseArgtupleInvalid("circle", 1, 5, 5, 3); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 90; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } case 4: if (likely((values[4] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_color)) != 0)) kw_args--; else { __Pyx_RaiseArgtupleInvalid("circle", 1, 5, 5, 4); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 90; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "circle") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 90; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } } else if (PyTuple_GET_SIZE(__pyx_args) != 5) { goto __pyx_L5_argtuple_error; } else { values[0] = PyTuple_GET_ITEM(__pyx_args, 0); values[1] = PyTuple_GET_ITEM(__pyx_args, 1); values[2] = PyTuple_GET_ITEM(__pyx_args, 2); values[3] = PyTuple_GET_ITEM(__pyx_args, 3); values[4] = PyTuple_GET_ITEM(__pyx_args, 4); } __pyx_v_surface = ((struct __pyx_obj_11pygame_sdl2_7surface_Surface *)values[0]); __pyx_v_x = values[1]; __pyx_v_y = values[2]; __pyx_v_r = values[3]; __pyx_v_color = values[4]; } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("circle", 1, 5, 5, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 90; __pyx_clineno = __LINE__; goto __pyx_L3_error;} __pyx_L3_error:; __Pyx_AddTraceback("pygame_sdl2.gfxdraw.circle", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_surface), __pyx_ptype_11pygame_sdl2_7surface_Surface, 1, "surface", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 90; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_r = __pyx_pf_11pygame_sdl2_7gfxdraw_20circle(__pyx_self, __pyx_v_surface, __pyx_v_x, __pyx_v_y, __pyx_v_r, __pyx_v_color); /* function exit code */ goto __pyx_L0; __pyx_L1_error:; __pyx_r = NULL; __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_7gfxdraw_20circle(CYTHON_UNUSED PyObject *__pyx_self, struct __pyx_obj_11pygame_sdl2_7surface_Surface *__pyx_v_surface, PyObject *__pyx_v_x, PyObject *__pyx_v_y, PyObject *__pyx_v_r, PyObject *__pyx_v_color) { struct __pyx_obj_11pygame_sdl2_5color_Color *__pyx_v_c = 0; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; Sint16 __pyx_t_3; Sint16 __pyx_t_4; Sint16 __pyx_t_5; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("circle", 0); /* "pygame_sdl2/gfxdraw.pyx":91 * * def circle(Surface surface, x, y, r, color): * cdef Color c = Color(color) # <<<<<<<<<<<<<< * circleRGBA(surface.surface, x, y, r, c.r, c.g, c.b, c.a) * */ __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 91; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __Pyx_INCREF(__pyx_v_color); __Pyx_GIVEREF(__pyx_v_color); PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_color); __pyx_t_2 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_11pygame_sdl2_5color_Color), __pyx_t_1, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 91; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_v_c = ((struct __pyx_obj_11pygame_sdl2_5color_Color *)__pyx_t_2); __pyx_t_2 = 0; /* "pygame_sdl2/gfxdraw.pyx":92 * def circle(Surface surface, x, y, r, color): * cdef Color c = Color(color) * circleRGBA(surface.surface, x, y, r, c.r, c.g, c.b, c.a) # <<<<<<<<<<<<<< * * def arc(Surface surface, x, y, r, start, end, color): */ __pyx_t_3 = __Pyx_PyInt_As_int16_t(__pyx_v_x); if (unlikely((__pyx_t_3 == (Sint16)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 92; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_t_4 = __Pyx_PyInt_As_int16_t(__pyx_v_y); if (unlikely((__pyx_t_4 == (Sint16)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 92; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_t_5 = __Pyx_PyInt_As_int16_t(__pyx_v_r); if (unlikely((__pyx_t_5 == (Sint16)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 92; __pyx_clineno = __LINE__; goto __pyx_L1_error;} circleRGBA(__pyx_v_surface->surface, __pyx_t_3, __pyx_t_4, __pyx_t_5, __pyx_v_c->r, __pyx_v_c->g, __pyx_v_c->b, __pyx_v_c->a); /* "pygame_sdl2/gfxdraw.pyx":90 * thickLineRGBA(surface.surface, x1int, y1int, x2int, y2int, width, c.r, c.g, c.b, c.a) * * def circle(Surface surface, x, y, r, color): # <<<<<<<<<<<<<< * cdef Color c = Color(color) * circleRGBA(surface.surface, x, y, r, c.r, c.g, c.b, c.a) */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_AddTraceback("pygame_sdl2.gfxdraw.circle", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF((PyObject *)__pyx_v_c); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/gfxdraw.pyx":94 * circleRGBA(surface.surface, x, y, r, c.r, c.g, c.b, c.a) * * def arc(Surface surface, x, y, r, start, end, color): # <<<<<<<<<<<<<< * cdef Color c = Color(color) * arcRGBA(surface.surface, x, y, r, start, end, c.r, c.g, c.b, c.a) */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_7gfxdraw_23arc(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static PyMethodDef __pyx_mdef_11pygame_sdl2_7gfxdraw_23arc = {"arc", (PyCFunction)__pyx_pw_11pygame_sdl2_7gfxdraw_23arc, METH_VARARGS|METH_KEYWORDS, 0}; static PyObject *__pyx_pw_11pygame_sdl2_7gfxdraw_23arc(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { struct __pyx_obj_11pygame_sdl2_7surface_Surface *__pyx_v_surface = 0; PyObject *__pyx_v_x = 0; PyObject *__pyx_v_y = 0; PyObject *__pyx_v_r = 0; PyObject *__pyx_v_start = 0; PyObject *__pyx_v_end = 0; PyObject *__pyx_v_color = 0; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("arc (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_surface,&__pyx_n_s_x,&__pyx_n_s_y,&__pyx_n_s_r,&__pyx_n_s_start,&__pyx_n_s_end,&__pyx_n_s_color,0}; PyObject* values[7] = {0,0,0,0,0,0,0}; if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 7: values[6] = PyTuple_GET_ITEM(__pyx_args, 6); case 6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5); case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4); case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_surface)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; case 1: if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_x)) != 0)) kw_args--; else { __Pyx_RaiseArgtupleInvalid("arc", 1, 7, 7, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 94; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } case 2: if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_y)) != 0)) kw_args--; else { __Pyx_RaiseArgtupleInvalid("arc", 1, 7, 7, 2); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 94; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } case 3: if (likely((values[3] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_r)) != 0)) kw_args--; else { __Pyx_RaiseArgtupleInvalid("arc", 1, 7, 7, 3); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 94; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } case 4: if (likely((values[4] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_start)) != 0)) kw_args--; else { __Pyx_RaiseArgtupleInvalid("arc", 1, 7, 7, 4); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 94; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } case 5: if (likely((values[5] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_end)) != 0)) kw_args--; else { __Pyx_RaiseArgtupleInvalid("arc", 1, 7, 7, 5); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 94; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } case 6: if (likely((values[6] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_color)) != 0)) kw_args--; else { __Pyx_RaiseArgtupleInvalid("arc", 1, 7, 7, 6); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 94; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "arc") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 94; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } } else if (PyTuple_GET_SIZE(__pyx_args) != 7) { goto __pyx_L5_argtuple_error; } else { values[0] = PyTuple_GET_ITEM(__pyx_args, 0); values[1] = PyTuple_GET_ITEM(__pyx_args, 1); values[2] = PyTuple_GET_ITEM(__pyx_args, 2); values[3] = PyTuple_GET_ITEM(__pyx_args, 3); values[4] = PyTuple_GET_ITEM(__pyx_args, 4); values[5] = PyTuple_GET_ITEM(__pyx_args, 5); values[6] = PyTuple_GET_ITEM(__pyx_args, 6); } __pyx_v_surface = ((struct __pyx_obj_11pygame_sdl2_7surface_Surface *)values[0]); __pyx_v_x = values[1]; __pyx_v_y = values[2]; __pyx_v_r = values[3]; __pyx_v_start = values[4]; __pyx_v_end = values[5]; __pyx_v_color = values[6]; } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("arc", 1, 7, 7, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 94; __pyx_clineno = __LINE__; goto __pyx_L3_error;} __pyx_L3_error:; __Pyx_AddTraceback("pygame_sdl2.gfxdraw.arc", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_surface), __pyx_ptype_11pygame_sdl2_7surface_Surface, 1, "surface", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 94; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_r = __pyx_pf_11pygame_sdl2_7gfxdraw_22arc(__pyx_self, __pyx_v_surface, __pyx_v_x, __pyx_v_y, __pyx_v_r, __pyx_v_start, __pyx_v_end, __pyx_v_color); /* function exit code */ goto __pyx_L0; __pyx_L1_error:; __pyx_r = NULL; __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_7gfxdraw_22arc(CYTHON_UNUSED PyObject *__pyx_self, struct __pyx_obj_11pygame_sdl2_7surface_Surface *__pyx_v_surface, PyObject *__pyx_v_x, PyObject *__pyx_v_y, PyObject *__pyx_v_r, PyObject *__pyx_v_start, PyObject *__pyx_v_end, PyObject *__pyx_v_color) { struct __pyx_obj_11pygame_sdl2_5color_Color *__pyx_v_c = 0; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; Sint16 __pyx_t_3; Sint16 __pyx_t_4; Sint16 __pyx_t_5; Sint16 __pyx_t_6; Sint16 __pyx_t_7; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("arc", 0); /* "pygame_sdl2/gfxdraw.pyx":95 * * def arc(Surface surface, x, y, r, start, end, color): * cdef Color c = Color(color) # <<<<<<<<<<<<<< * arcRGBA(surface.surface, x, y, r, start, end, c.r, c.g, c.b, c.a) * */ __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 95; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __Pyx_INCREF(__pyx_v_color); __Pyx_GIVEREF(__pyx_v_color); PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_color); __pyx_t_2 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_11pygame_sdl2_5color_Color), __pyx_t_1, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 95; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_v_c = ((struct __pyx_obj_11pygame_sdl2_5color_Color *)__pyx_t_2); __pyx_t_2 = 0; /* "pygame_sdl2/gfxdraw.pyx":96 * def arc(Surface surface, x, y, r, start, end, color): * cdef Color c = Color(color) * arcRGBA(surface.surface, x, y, r, start, end, c.r, c.g, c.b, c.a) # <<<<<<<<<<<<<< * * def aacircle(Surface surface, x, y, r, color): */ __pyx_t_3 = __Pyx_PyInt_As_int16_t(__pyx_v_x); if (unlikely((__pyx_t_3 == (Sint16)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 96; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_t_4 = __Pyx_PyInt_As_int16_t(__pyx_v_y); if (unlikely((__pyx_t_4 == (Sint16)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 96; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_t_5 = __Pyx_PyInt_As_int16_t(__pyx_v_r); if (unlikely((__pyx_t_5 == (Sint16)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 96; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_t_6 = __Pyx_PyInt_As_int16_t(__pyx_v_start); if (unlikely((__pyx_t_6 == (Sint16)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 96; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_t_7 = __Pyx_PyInt_As_int16_t(__pyx_v_end); if (unlikely((__pyx_t_7 == (Sint16)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 96; __pyx_clineno = __LINE__; goto __pyx_L1_error;} arcRGBA(__pyx_v_surface->surface, __pyx_t_3, __pyx_t_4, __pyx_t_5, __pyx_t_6, __pyx_t_7, __pyx_v_c->r, __pyx_v_c->g, __pyx_v_c->b, __pyx_v_c->a); /* "pygame_sdl2/gfxdraw.pyx":94 * circleRGBA(surface.surface, x, y, r, c.r, c.g, c.b, c.a) * * def arc(Surface surface, x, y, r, start, end, color): # <<<<<<<<<<<<<< * cdef Color c = Color(color) * arcRGBA(surface.surface, x, y, r, start, end, c.r, c.g, c.b, c.a) */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_AddTraceback("pygame_sdl2.gfxdraw.arc", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF((PyObject *)__pyx_v_c); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/gfxdraw.pyx":98 * arcRGBA(surface.surface, x, y, r, start, end, c.r, c.g, c.b, c.a) * * def aacircle(Surface surface, x, y, r, color): # <<<<<<<<<<<<<< * cdef Color c = Color(color) * aacircleRGBA(surface.surface, x, y, r, c.r, c.g, c.b, c.a) */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_7gfxdraw_25aacircle(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static PyMethodDef __pyx_mdef_11pygame_sdl2_7gfxdraw_25aacircle = {"aacircle", (PyCFunction)__pyx_pw_11pygame_sdl2_7gfxdraw_25aacircle, METH_VARARGS|METH_KEYWORDS, 0}; static PyObject *__pyx_pw_11pygame_sdl2_7gfxdraw_25aacircle(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { struct __pyx_obj_11pygame_sdl2_7surface_Surface *__pyx_v_surface = 0; PyObject *__pyx_v_x = 0; PyObject *__pyx_v_y = 0; PyObject *__pyx_v_r = 0; PyObject *__pyx_v_color = 0; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("aacircle (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_surface,&__pyx_n_s_x,&__pyx_n_s_y,&__pyx_n_s_r,&__pyx_n_s_color,0}; PyObject* values[5] = {0,0,0,0,0}; if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4); case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_surface)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; case 1: if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_x)) != 0)) kw_args--; else { __Pyx_RaiseArgtupleInvalid("aacircle", 1, 5, 5, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 98; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } case 2: if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_y)) != 0)) kw_args--; else { __Pyx_RaiseArgtupleInvalid("aacircle", 1, 5, 5, 2); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 98; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } case 3: if (likely((values[3] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_r)) != 0)) kw_args--; else { __Pyx_RaiseArgtupleInvalid("aacircle", 1, 5, 5, 3); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 98; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } case 4: if (likely((values[4] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_color)) != 0)) kw_args--; else { __Pyx_RaiseArgtupleInvalid("aacircle", 1, 5, 5, 4); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 98; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "aacircle") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 98; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } } else if (PyTuple_GET_SIZE(__pyx_args) != 5) { goto __pyx_L5_argtuple_error; } else { values[0] = PyTuple_GET_ITEM(__pyx_args, 0); values[1] = PyTuple_GET_ITEM(__pyx_args, 1); values[2] = PyTuple_GET_ITEM(__pyx_args, 2); values[3] = PyTuple_GET_ITEM(__pyx_args, 3); values[4] = PyTuple_GET_ITEM(__pyx_args, 4); } __pyx_v_surface = ((struct __pyx_obj_11pygame_sdl2_7surface_Surface *)values[0]); __pyx_v_x = values[1]; __pyx_v_y = values[2]; __pyx_v_r = values[3]; __pyx_v_color = values[4]; } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("aacircle", 1, 5, 5, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 98; __pyx_clineno = __LINE__; goto __pyx_L3_error;} __pyx_L3_error:; __Pyx_AddTraceback("pygame_sdl2.gfxdraw.aacircle", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_surface), __pyx_ptype_11pygame_sdl2_7surface_Surface, 1, "surface", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 98; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_r = __pyx_pf_11pygame_sdl2_7gfxdraw_24aacircle(__pyx_self, __pyx_v_surface, __pyx_v_x, __pyx_v_y, __pyx_v_r, __pyx_v_color); /* function exit code */ goto __pyx_L0; __pyx_L1_error:; __pyx_r = NULL; __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_7gfxdraw_24aacircle(CYTHON_UNUSED PyObject *__pyx_self, struct __pyx_obj_11pygame_sdl2_7surface_Surface *__pyx_v_surface, PyObject *__pyx_v_x, PyObject *__pyx_v_y, PyObject *__pyx_v_r, PyObject *__pyx_v_color) { struct __pyx_obj_11pygame_sdl2_5color_Color *__pyx_v_c = 0; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; Sint16 __pyx_t_3; Sint16 __pyx_t_4; Sint16 __pyx_t_5; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("aacircle", 0); /* "pygame_sdl2/gfxdraw.pyx":99 * * def aacircle(Surface surface, x, y, r, color): * cdef Color c = Color(color) # <<<<<<<<<<<<<< * aacircleRGBA(surface.surface, x, y, r, c.r, c.g, c.b, c.a) * */ __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 99; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __Pyx_INCREF(__pyx_v_color); __Pyx_GIVEREF(__pyx_v_color); PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_color); __pyx_t_2 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_11pygame_sdl2_5color_Color), __pyx_t_1, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 99; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_v_c = ((struct __pyx_obj_11pygame_sdl2_5color_Color *)__pyx_t_2); __pyx_t_2 = 0; /* "pygame_sdl2/gfxdraw.pyx":100 * def aacircle(Surface surface, x, y, r, color): * cdef Color c = Color(color) * aacircleRGBA(surface.surface, x, y, r, c.r, c.g, c.b, c.a) # <<<<<<<<<<<<<< * * def filled_circle(Surface surface, x, y, r, color): */ __pyx_t_3 = __Pyx_PyInt_As_int16_t(__pyx_v_x); if (unlikely((__pyx_t_3 == (Sint16)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 100; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_t_4 = __Pyx_PyInt_As_int16_t(__pyx_v_y); if (unlikely((__pyx_t_4 == (Sint16)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 100; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_t_5 = __Pyx_PyInt_As_int16_t(__pyx_v_r); if (unlikely((__pyx_t_5 == (Sint16)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 100; __pyx_clineno = __LINE__; goto __pyx_L1_error;} aacircleRGBA(__pyx_v_surface->surface, __pyx_t_3, __pyx_t_4, __pyx_t_5, __pyx_v_c->r, __pyx_v_c->g, __pyx_v_c->b, __pyx_v_c->a); /* "pygame_sdl2/gfxdraw.pyx":98 * arcRGBA(surface.surface, x, y, r, start, end, c.r, c.g, c.b, c.a) * * def aacircle(Surface surface, x, y, r, color): # <<<<<<<<<<<<<< * cdef Color c = Color(color) * aacircleRGBA(surface.surface, x, y, r, c.r, c.g, c.b, c.a) */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_AddTraceback("pygame_sdl2.gfxdraw.aacircle", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF((PyObject *)__pyx_v_c); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/gfxdraw.pyx":102 * aacircleRGBA(surface.surface, x, y, r, c.r, c.g, c.b, c.a) * * def filled_circle(Surface surface, x, y, r, color): # <<<<<<<<<<<<<< * cdef Color c = Color(color) * filledCircleRGBA(surface.surface, x, y, r, c.r, c.g, c.b, c.a) */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_7gfxdraw_27filled_circle(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static PyMethodDef __pyx_mdef_11pygame_sdl2_7gfxdraw_27filled_circle = {"filled_circle", (PyCFunction)__pyx_pw_11pygame_sdl2_7gfxdraw_27filled_circle, METH_VARARGS|METH_KEYWORDS, 0}; static PyObject *__pyx_pw_11pygame_sdl2_7gfxdraw_27filled_circle(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { struct __pyx_obj_11pygame_sdl2_7surface_Surface *__pyx_v_surface = 0; PyObject *__pyx_v_x = 0; PyObject *__pyx_v_y = 0; PyObject *__pyx_v_r = 0; PyObject *__pyx_v_color = 0; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("filled_circle (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_surface,&__pyx_n_s_x,&__pyx_n_s_y,&__pyx_n_s_r,&__pyx_n_s_color,0}; PyObject* values[5] = {0,0,0,0,0}; if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4); case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_surface)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; case 1: if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_x)) != 0)) kw_args--; else { __Pyx_RaiseArgtupleInvalid("filled_circle", 1, 5, 5, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 102; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } case 2: if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_y)) != 0)) kw_args--; else { __Pyx_RaiseArgtupleInvalid("filled_circle", 1, 5, 5, 2); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 102; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } case 3: if (likely((values[3] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_r)) != 0)) kw_args--; else { __Pyx_RaiseArgtupleInvalid("filled_circle", 1, 5, 5, 3); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 102; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } case 4: if (likely((values[4] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_color)) != 0)) kw_args--; else { __Pyx_RaiseArgtupleInvalid("filled_circle", 1, 5, 5, 4); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 102; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "filled_circle") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 102; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } } else if (PyTuple_GET_SIZE(__pyx_args) != 5) { goto __pyx_L5_argtuple_error; } else { values[0] = PyTuple_GET_ITEM(__pyx_args, 0); values[1] = PyTuple_GET_ITEM(__pyx_args, 1); values[2] = PyTuple_GET_ITEM(__pyx_args, 2); values[3] = PyTuple_GET_ITEM(__pyx_args, 3); values[4] = PyTuple_GET_ITEM(__pyx_args, 4); } __pyx_v_surface = ((struct __pyx_obj_11pygame_sdl2_7surface_Surface *)values[0]); __pyx_v_x = values[1]; __pyx_v_y = values[2]; __pyx_v_r = values[3]; __pyx_v_color = values[4]; } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("filled_circle", 1, 5, 5, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 102; __pyx_clineno = __LINE__; goto __pyx_L3_error;} __pyx_L3_error:; __Pyx_AddTraceback("pygame_sdl2.gfxdraw.filled_circle", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_surface), __pyx_ptype_11pygame_sdl2_7surface_Surface, 1, "surface", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 102; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_r = __pyx_pf_11pygame_sdl2_7gfxdraw_26filled_circle(__pyx_self, __pyx_v_surface, __pyx_v_x, __pyx_v_y, __pyx_v_r, __pyx_v_color); /* function exit code */ goto __pyx_L0; __pyx_L1_error:; __pyx_r = NULL; __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_7gfxdraw_26filled_circle(CYTHON_UNUSED PyObject *__pyx_self, struct __pyx_obj_11pygame_sdl2_7surface_Surface *__pyx_v_surface, PyObject *__pyx_v_x, PyObject *__pyx_v_y, PyObject *__pyx_v_r, PyObject *__pyx_v_color) { struct __pyx_obj_11pygame_sdl2_5color_Color *__pyx_v_c = 0; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; Sint16 __pyx_t_3; Sint16 __pyx_t_4; Sint16 __pyx_t_5; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("filled_circle", 0); /* "pygame_sdl2/gfxdraw.pyx":103 * * def filled_circle(Surface surface, x, y, r, color): * cdef Color c = Color(color) # <<<<<<<<<<<<<< * filledCircleRGBA(surface.surface, x, y, r, c.r, c.g, c.b, c.a) * */ __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 103; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __Pyx_INCREF(__pyx_v_color); __Pyx_GIVEREF(__pyx_v_color); PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_color); __pyx_t_2 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_11pygame_sdl2_5color_Color), __pyx_t_1, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 103; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_v_c = ((struct __pyx_obj_11pygame_sdl2_5color_Color *)__pyx_t_2); __pyx_t_2 = 0; /* "pygame_sdl2/gfxdraw.pyx":104 * def filled_circle(Surface surface, x, y, r, color): * cdef Color c = Color(color) * filledCircleRGBA(surface.surface, x, y, r, c.r, c.g, c.b, c.a) # <<<<<<<<<<<<<< * * def ellipse(Surface surface, x, y, rx, ry, color): */ __pyx_t_3 = __Pyx_PyInt_As_int16_t(__pyx_v_x); if (unlikely((__pyx_t_3 == (Sint16)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 104; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_t_4 = __Pyx_PyInt_As_int16_t(__pyx_v_y); if (unlikely((__pyx_t_4 == (Sint16)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 104; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_t_5 = __Pyx_PyInt_As_int16_t(__pyx_v_r); if (unlikely((__pyx_t_5 == (Sint16)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 104; __pyx_clineno = __LINE__; goto __pyx_L1_error;} filledCircleRGBA(__pyx_v_surface->surface, __pyx_t_3, __pyx_t_4, __pyx_t_5, __pyx_v_c->r, __pyx_v_c->g, __pyx_v_c->b, __pyx_v_c->a); /* "pygame_sdl2/gfxdraw.pyx":102 * aacircleRGBA(surface.surface, x, y, r, c.r, c.g, c.b, c.a) * * def filled_circle(Surface surface, x, y, r, color): # <<<<<<<<<<<<<< * cdef Color c = Color(color) * filledCircleRGBA(surface.surface, x, y, r, c.r, c.g, c.b, c.a) */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_AddTraceback("pygame_sdl2.gfxdraw.filled_circle", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF((PyObject *)__pyx_v_c); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/gfxdraw.pyx":106 * filledCircleRGBA(surface.surface, x, y, r, c.r, c.g, c.b, c.a) * * def ellipse(Surface surface, x, y, rx, ry, color): # <<<<<<<<<<<<<< * cdef Color c = Color(color) * ellipseRGBA(surface.surface, x, y, rx, ry, c.r, c.g, c.b, c.a) */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_7gfxdraw_29ellipse(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static PyMethodDef __pyx_mdef_11pygame_sdl2_7gfxdraw_29ellipse = {"ellipse", (PyCFunction)__pyx_pw_11pygame_sdl2_7gfxdraw_29ellipse, METH_VARARGS|METH_KEYWORDS, 0}; static PyObject *__pyx_pw_11pygame_sdl2_7gfxdraw_29ellipse(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { struct __pyx_obj_11pygame_sdl2_7surface_Surface *__pyx_v_surface = 0; PyObject *__pyx_v_x = 0; PyObject *__pyx_v_y = 0; PyObject *__pyx_v_rx = 0; PyObject *__pyx_v_ry = 0; PyObject *__pyx_v_color = 0; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("ellipse (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_surface,&__pyx_n_s_x,&__pyx_n_s_y,&__pyx_n_s_rx,&__pyx_n_s_ry,&__pyx_n_s_color,0}; PyObject* values[6] = {0,0,0,0,0,0}; if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5); case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4); case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_surface)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; case 1: if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_x)) != 0)) kw_args--; else { __Pyx_RaiseArgtupleInvalid("ellipse", 1, 6, 6, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 106; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } case 2: if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_y)) != 0)) kw_args--; else { __Pyx_RaiseArgtupleInvalid("ellipse", 1, 6, 6, 2); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 106; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } case 3: if (likely((values[3] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_rx)) != 0)) kw_args--; else { __Pyx_RaiseArgtupleInvalid("ellipse", 1, 6, 6, 3); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 106; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } case 4: if (likely((values[4] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_ry)) != 0)) kw_args--; else { __Pyx_RaiseArgtupleInvalid("ellipse", 1, 6, 6, 4); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 106; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } case 5: if (likely((values[5] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_color)) != 0)) kw_args--; else { __Pyx_RaiseArgtupleInvalid("ellipse", 1, 6, 6, 5); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 106; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "ellipse") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 106; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } } else if (PyTuple_GET_SIZE(__pyx_args) != 6) { goto __pyx_L5_argtuple_error; } else { values[0] = PyTuple_GET_ITEM(__pyx_args, 0); values[1] = PyTuple_GET_ITEM(__pyx_args, 1); values[2] = PyTuple_GET_ITEM(__pyx_args, 2); values[3] = PyTuple_GET_ITEM(__pyx_args, 3); values[4] = PyTuple_GET_ITEM(__pyx_args, 4); values[5] = PyTuple_GET_ITEM(__pyx_args, 5); } __pyx_v_surface = ((struct __pyx_obj_11pygame_sdl2_7surface_Surface *)values[0]); __pyx_v_x = values[1]; __pyx_v_y = values[2]; __pyx_v_rx = values[3]; __pyx_v_ry = values[4]; __pyx_v_color = values[5]; } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("ellipse", 1, 6, 6, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 106; __pyx_clineno = __LINE__; goto __pyx_L3_error;} __pyx_L3_error:; __Pyx_AddTraceback("pygame_sdl2.gfxdraw.ellipse", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_surface), __pyx_ptype_11pygame_sdl2_7surface_Surface, 1, "surface", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 106; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_r = __pyx_pf_11pygame_sdl2_7gfxdraw_28ellipse(__pyx_self, __pyx_v_surface, __pyx_v_x, __pyx_v_y, __pyx_v_rx, __pyx_v_ry, __pyx_v_color); /* function exit code */ goto __pyx_L0; __pyx_L1_error:; __pyx_r = NULL; __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_7gfxdraw_28ellipse(CYTHON_UNUSED PyObject *__pyx_self, struct __pyx_obj_11pygame_sdl2_7surface_Surface *__pyx_v_surface, PyObject *__pyx_v_x, PyObject *__pyx_v_y, PyObject *__pyx_v_rx, PyObject *__pyx_v_ry, PyObject *__pyx_v_color) { struct __pyx_obj_11pygame_sdl2_5color_Color *__pyx_v_c = 0; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; Sint16 __pyx_t_3; Sint16 __pyx_t_4; Sint16 __pyx_t_5; Sint16 __pyx_t_6; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("ellipse", 0); /* "pygame_sdl2/gfxdraw.pyx":107 * * def ellipse(Surface surface, x, y, rx, ry, color): * cdef Color c = Color(color) # <<<<<<<<<<<<<< * ellipseRGBA(surface.surface, x, y, rx, ry, c.r, c.g, c.b, c.a) * */ __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 107; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __Pyx_INCREF(__pyx_v_color); __Pyx_GIVEREF(__pyx_v_color); PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_color); __pyx_t_2 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_11pygame_sdl2_5color_Color), __pyx_t_1, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 107; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_v_c = ((struct __pyx_obj_11pygame_sdl2_5color_Color *)__pyx_t_2); __pyx_t_2 = 0; /* "pygame_sdl2/gfxdraw.pyx":108 * def ellipse(Surface surface, x, y, rx, ry, color): * cdef Color c = Color(color) * ellipseRGBA(surface.surface, x, y, rx, ry, c.r, c.g, c.b, c.a) # <<<<<<<<<<<<<< * * def aaellipse(Surface surface, x, y, rx, ry, color): */ __pyx_t_3 = __Pyx_PyInt_As_int16_t(__pyx_v_x); if (unlikely((__pyx_t_3 == (Sint16)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 108; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_t_4 = __Pyx_PyInt_As_int16_t(__pyx_v_y); if (unlikely((__pyx_t_4 == (Sint16)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 108; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_t_5 = __Pyx_PyInt_As_int16_t(__pyx_v_rx); if (unlikely((__pyx_t_5 == (Sint16)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 108; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_t_6 = __Pyx_PyInt_As_int16_t(__pyx_v_ry); if (unlikely((__pyx_t_6 == (Sint16)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 108; __pyx_clineno = __LINE__; goto __pyx_L1_error;} ellipseRGBA(__pyx_v_surface->surface, __pyx_t_3, __pyx_t_4, __pyx_t_5, __pyx_t_6, __pyx_v_c->r, __pyx_v_c->g, __pyx_v_c->b, __pyx_v_c->a); /* "pygame_sdl2/gfxdraw.pyx":106 * filledCircleRGBA(surface.surface, x, y, r, c.r, c.g, c.b, c.a) * * def ellipse(Surface surface, x, y, rx, ry, color): # <<<<<<<<<<<<<< * cdef Color c = Color(color) * ellipseRGBA(surface.surface, x, y, rx, ry, c.r, c.g, c.b, c.a) */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_AddTraceback("pygame_sdl2.gfxdraw.ellipse", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF((PyObject *)__pyx_v_c); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/gfxdraw.pyx":110 * ellipseRGBA(surface.surface, x, y, rx, ry, c.r, c.g, c.b, c.a) * * def aaellipse(Surface surface, x, y, rx, ry, color): # <<<<<<<<<<<<<< * cdef Color c = Color(color) * aaellipseRGBA(surface.surface, x, y, rx, ry, c.r, c.g, c.b, c.a) */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_7gfxdraw_31aaellipse(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static PyMethodDef __pyx_mdef_11pygame_sdl2_7gfxdraw_31aaellipse = {"aaellipse", (PyCFunction)__pyx_pw_11pygame_sdl2_7gfxdraw_31aaellipse, METH_VARARGS|METH_KEYWORDS, 0}; static PyObject *__pyx_pw_11pygame_sdl2_7gfxdraw_31aaellipse(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { struct __pyx_obj_11pygame_sdl2_7surface_Surface *__pyx_v_surface = 0; PyObject *__pyx_v_x = 0; PyObject *__pyx_v_y = 0; PyObject *__pyx_v_rx = 0; PyObject *__pyx_v_ry = 0; PyObject *__pyx_v_color = 0; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("aaellipse (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_surface,&__pyx_n_s_x,&__pyx_n_s_y,&__pyx_n_s_rx,&__pyx_n_s_ry,&__pyx_n_s_color,0}; PyObject* values[6] = {0,0,0,0,0,0}; if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5); case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4); case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_surface)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; case 1: if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_x)) != 0)) kw_args--; else { __Pyx_RaiseArgtupleInvalid("aaellipse", 1, 6, 6, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 110; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } case 2: if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_y)) != 0)) kw_args--; else { __Pyx_RaiseArgtupleInvalid("aaellipse", 1, 6, 6, 2); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 110; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } case 3: if (likely((values[3] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_rx)) != 0)) kw_args--; else { __Pyx_RaiseArgtupleInvalid("aaellipse", 1, 6, 6, 3); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 110; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } case 4: if (likely((values[4] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_ry)) != 0)) kw_args--; else { __Pyx_RaiseArgtupleInvalid("aaellipse", 1, 6, 6, 4); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 110; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } case 5: if (likely((values[5] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_color)) != 0)) kw_args--; else { __Pyx_RaiseArgtupleInvalid("aaellipse", 1, 6, 6, 5); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 110; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "aaellipse") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 110; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } } else if (PyTuple_GET_SIZE(__pyx_args) != 6) { goto __pyx_L5_argtuple_error; } else { values[0] = PyTuple_GET_ITEM(__pyx_args, 0); values[1] = PyTuple_GET_ITEM(__pyx_args, 1); values[2] = PyTuple_GET_ITEM(__pyx_args, 2); values[3] = PyTuple_GET_ITEM(__pyx_args, 3); values[4] = PyTuple_GET_ITEM(__pyx_args, 4); values[5] = PyTuple_GET_ITEM(__pyx_args, 5); } __pyx_v_surface = ((struct __pyx_obj_11pygame_sdl2_7surface_Surface *)values[0]); __pyx_v_x = values[1]; __pyx_v_y = values[2]; __pyx_v_rx = values[3]; __pyx_v_ry = values[4]; __pyx_v_color = values[5]; } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("aaellipse", 1, 6, 6, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 110; __pyx_clineno = __LINE__; goto __pyx_L3_error;} __pyx_L3_error:; __Pyx_AddTraceback("pygame_sdl2.gfxdraw.aaellipse", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_surface), __pyx_ptype_11pygame_sdl2_7surface_Surface, 1, "surface", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 110; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_r = __pyx_pf_11pygame_sdl2_7gfxdraw_30aaellipse(__pyx_self, __pyx_v_surface, __pyx_v_x, __pyx_v_y, __pyx_v_rx, __pyx_v_ry, __pyx_v_color); /* function exit code */ goto __pyx_L0; __pyx_L1_error:; __pyx_r = NULL; __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_7gfxdraw_30aaellipse(CYTHON_UNUSED PyObject *__pyx_self, struct __pyx_obj_11pygame_sdl2_7surface_Surface *__pyx_v_surface, PyObject *__pyx_v_x, PyObject *__pyx_v_y, PyObject *__pyx_v_rx, PyObject *__pyx_v_ry, PyObject *__pyx_v_color) { struct __pyx_obj_11pygame_sdl2_5color_Color *__pyx_v_c = 0; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; Sint16 __pyx_t_3; Sint16 __pyx_t_4; Sint16 __pyx_t_5; Sint16 __pyx_t_6; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("aaellipse", 0); /* "pygame_sdl2/gfxdraw.pyx":111 * * def aaellipse(Surface surface, x, y, rx, ry, color): * cdef Color c = Color(color) # <<<<<<<<<<<<<< * aaellipseRGBA(surface.surface, x, y, rx, ry, c.r, c.g, c.b, c.a) * */ __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 111; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __Pyx_INCREF(__pyx_v_color); __Pyx_GIVEREF(__pyx_v_color); PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_color); __pyx_t_2 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_11pygame_sdl2_5color_Color), __pyx_t_1, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 111; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_v_c = ((struct __pyx_obj_11pygame_sdl2_5color_Color *)__pyx_t_2); __pyx_t_2 = 0; /* "pygame_sdl2/gfxdraw.pyx":112 * def aaellipse(Surface surface, x, y, rx, ry, color): * cdef Color c = Color(color) * aaellipseRGBA(surface.surface, x, y, rx, ry, c.r, c.g, c.b, c.a) # <<<<<<<<<<<<<< * * def filled_ellipse(Surface surface, x, y, rx, ry, color): */ __pyx_t_3 = __Pyx_PyInt_As_int16_t(__pyx_v_x); if (unlikely((__pyx_t_3 == (Sint16)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 112; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_t_4 = __Pyx_PyInt_As_int16_t(__pyx_v_y); if (unlikely((__pyx_t_4 == (Sint16)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 112; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_t_5 = __Pyx_PyInt_As_int16_t(__pyx_v_rx); if (unlikely((__pyx_t_5 == (Sint16)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 112; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_t_6 = __Pyx_PyInt_As_int16_t(__pyx_v_ry); if (unlikely((__pyx_t_6 == (Sint16)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 112; __pyx_clineno = __LINE__; goto __pyx_L1_error;} aaellipseRGBA(__pyx_v_surface->surface, __pyx_t_3, __pyx_t_4, __pyx_t_5, __pyx_t_6, __pyx_v_c->r, __pyx_v_c->g, __pyx_v_c->b, __pyx_v_c->a); /* "pygame_sdl2/gfxdraw.pyx":110 * ellipseRGBA(surface.surface, x, y, rx, ry, c.r, c.g, c.b, c.a) * * def aaellipse(Surface surface, x, y, rx, ry, color): # <<<<<<<<<<<<<< * cdef Color c = Color(color) * aaellipseRGBA(surface.surface, x, y, rx, ry, c.r, c.g, c.b, c.a) */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_AddTraceback("pygame_sdl2.gfxdraw.aaellipse", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF((PyObject *)__pyx_v_c); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/gfxdraw.pyx":114 * aaellipseRGBA(surface.surface, x, y, rx, ry, c.r, c.g, c.b, c.a) * * def filled_ellipse(Surface surface, x, y, rx, ry, color): # <<<<<<<<<<<<<< * cdef Color c = Color(color) * filledEllipseRGBA(surface.surface, x, y, rx, ry, c.r, c.g, c.b, c.a) */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_7gfxdraw_33filled_ellipse(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static PyMethodDef __pyx_mdef_11pygame_sdl2_7gfxdraw_33filled_ellipse = {"filled_ellipse", (PyCFunction)__pyx_pw_11pygame_sdl2_7gfxdraw_33filled_ellipse, METH_VARARGS|METH_KEYWORDS, 0}; static PyObject *__pyx_pw_11pygame_sdl2_7gfxdraw_33filled_ellipse(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { struct __pyx_obj_11pygame_sdl2_7surface_Surface *__pyx_v_surface = 0; PyObject *__pyx_v_x = 0; PyObject *__pyx_v_y = 0; PyObject *__pyx_v_rx = 0; PyObject *__pyx_v_ry = 0; PyObject *__pyx_v_color = 0; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("filled_ellipse (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_surface,&__pyx_n_s_x,&__pyx_n_s_y,&__pyx_n_s_rx,&__pyx_n_s_ry,&__pyx_n_s_color,0}; PyObject* values[6] = {0,0,0,0,0,0}; if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5); case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4); case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_surface)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; case 1: if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_x)) != 0)) kw_args--; else { __Pyx_RaiseArgtupleInvalid("filled_ellipse", 1, 6, 6, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 114; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } case 2: if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_y)) != 0)) kw_args--; else { __Pyx_RaiseArgtupleInvalid("filled_ellipse", 1, 6, 6, 2); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 114; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } case 3: if (likely((values[3] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_rx)) != 0)) kw_args--; else { __Pyx_RaiseArgtupleInvalid("filled_ellipse", 1, 6, 6, 3); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 114; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } case 4: if (likely((values[4] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_ry)) != 0)) kw_args--; else { __Pyx_RaiseArgtupleInvalid("filled_ellipse", 1, 6, 6, 4); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 114; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } case 5: if (likely((values[5] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_color)) != 0)) kw_args--; else { __Pyx_RaiseArgtupleInvalid("filled_ellipse", 1, 6, 6, 5); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 114; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "filled_ellipse") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 114; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } } else if (PyTuple_GET_SIZE(__pyx_args) != 6) { goto __pyx_L5_argtuple_error; } else { values[0] = PyTuple_GET_ITEM(__pyx_args, 0); values[1] = PyTuple_GET_ITEM(__pyx_args, 1); values[2] = PyTuple_GET_ITEM(__pyx_args, 2); values[3] = PyTuple_GET_ITEM(__pyx_args, 3); values[4] = PyTuple_GET_ITEM(__pyx_args, 4); values[5] = PyTuple_GET_ITEM(__pyx_args, 5); } __pyx_v_surface = ((struct __pyx_obj_11pygame_sdl2_7surface_Surface *)values[0]); __pyx_v_x = values[1]; __pyx_v_y = values[2]; __pyx_v_rx = values[3]; __pyx_v_ry = values[4]; __pyx_v_color = values[5]; } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("filled_ellipse", 1, 6, 6, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 114; __pyx_clineno = __LINE__; goto __pyx_L3_error;} __pyx_L3_error:; __Pyx_AddTraceback("pygame_sdl2.gfxdraw.filled_ellipse", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_surface), __pyx_ptype_11pygame_sdl2_7surface_Surface, 1, "surface", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 114; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_r = __pyx_pf_11pygame_sdl2_7gfxdraw_32filled_ellipse(__pyx_self, __pyx_v_surface, __pyx_v_x, __pyx_v_y, __pyx_v_rx, __pyx_v_ry, __pyx_v_color); /* function exit code */ goto __pyx_L0; __pyx_L1_error:; __pyx_r = NULL; __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_7gfxdraw_32filled_ellipse(CYTHON_UNUSED PyObject *__pyx_self, struct __pyx_obj_11pygame_sdl2_7surface_Surface *__pyx_v_surface, PyObject *__pyx_v_x, PyObject *__pyx_v_y, PyObject *__pyx_v_rx, PyObject *__pyx_v_ry, PyObject *__pyx_v_color) { struct __pyx_obj_11pygame_sdl2_5color_Color *__pyx_v_c = 0; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; Sint16 __pyx_t_3; Sint16 __pyx_t_4; Sint16 __pyx_t_5; Sint16 __pyx_t_6; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("filled_ellipse", 0); /* "pygame_sdl2/gfxdraw.pyx":115 * * def filled_ellipse(Surface surface, x, y, rx, ry, color): * cdef Color c = Color(color) # <<<<<<<<<<<<<< * filledEllipseRGBA(surface.surface, x, y, rx, ry, c.r, c.g, c.b, c.a) * */ __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 115; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __Pyx_INCREF(__pyx_v_color); __Pyx_GIVEREF(__pyx_v_color); PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_color); __pyx_t_2 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_11pygame_sdl2_5color_Color), __pyx_t_1, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 115; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_v_c = ((struct __pyx_obj_11pygame_sdl2_5color_Color *)__pyx_t_2); __pyx_t_2 = 0; /* "pygame_sdl2/gfxdraw.pyx":116 * def filled_ellipse(Surface surface, x, y, rx, ry, color): * cdef Color c = Color(color) * filledEllipseRGBA(surface.surface, x, y, rx, ry, c.r, c.g, c.b, c.a) # <<<<<<<<<<<<<< * * def pie(Surface surface, x, y, r, start, end, color): */ __pyx_t_3 = __Pyx_PyInt_As_int16_t(__pyx_v_x); if (unlikely((__pyx_t_3 == (Sint16)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 116; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_t_4 = __Pyx_PyInt_As_int16_t(__pyx_v_y); if (unlikely((__pyx_t_4 == (Sint16)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 116; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_t_5 = __Pyx_PyInt_As_int16_t(__pyx_v_rx); if (unlikely((__pyx_t_5 == (Sint16)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 116; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_t_6 = __Pyx_PyInt_As_int16_t(__pyx_v_ry); if (unlikely((__pyx_t_6 == (Sint16)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 116; __pyx_clineno = __LINE__; goto __pyx_L1_error;} filledEllipseRGBA(__pyx_v_surface->surface, __pyx_t_3, __pyx_t_4, __pyx_t_5, __pyx_t_6, __pyx_v_c->r, __pyx_v_c->g, __pyx_v_c->b, __pyx_v_c->a); /* "pygame_sdl2/gfxdraw.pyx":114 * aaellipseRGBA(surface.surface, x, y, rx, ry, c.r, c.g, c.b, c.a) * * def filled_ellipse(Surface surface, x, y, rx, ry, color): # <<<<<<<<<<<<<< * cdef Color c = Color(color) * filledEllipseRGBA(surface.surface, x, y, rx, ry, c.r, c.g, c.b, c.a) */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_AddTraceback("pygame_sdl2.gfxdraw.filled_ellipse", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF((PyObject *)__pyx_v_c); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/gfxdraw.pyx":118 * filledEllipseRGBA(surface.surface, x, y, rx, ry, c.r, c.g, c.b, c.a) * * def pie(Surface surface, x, y, r, start, end, color): # <<<<<<<<<<<<<< * cdef Color c = Color(color) * pieRGBA(surface.surface, x, y, r, start, end, c.r, c.g, c.b, c.a) */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_7gfxdraw_35pie(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static PyMethodDef __pyx_mdef_11pygame_sdl2_7gfxdraw_35pie = {"pie", (PyCFunction)__pyx_pw_11pygame_sdl2_7gfxdraw_35pie, METH_VARARGS|METH_KEYWORDS, 0}; static PyObject *__pyx_pw_11pygame_sdl2_7gfxdraw_35pie(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { struct __pyx_obj_11pygame_sdl2_7surface_Surface *__pyx_v_surface = 0; PyObject *__pyx_v_x = 0; PyObject *__pyx_v_y = 0; PyObject *__pyx_v_r = 0; PyObject *__pyx_v_start = 0; PyObject *__pyx_v_end = 0; PyObject *__pyx_v_color = 0; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("pie (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_surface,&__pyx_n_s_x,&__pyx_n_s_y,&__pyx_n_s_r,&__pyx_n_s_start,&__pyx_n_s_end,&__pyx_n_s_color,0}; PyObject* values[7] = {0,0,0,0,0,0,0}; if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 7: values[6] = PyTuple_GET_ITEM(__pyx_args, 6); case 6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5); case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4); case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_surface)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; case 1: if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_x)) != 0)) kw_args--; else { __Pyx_RaiseArgtupleInvalid("pie", 1, 7, 7, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 118; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } case 2: if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_y)) != 0)) kw_args--; else { __Pyx_RaiseArgtupleInvalid("pie", 1, 7, 7, 2); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 118; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } case 3: if (likely((values[3] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_r)) != 0)) kw_args--; else { __Pyx_RaiseArgtupleInvalid("pie", 1, 7, 7, 3); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 118; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } case 4: if (likely((values[4] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_start)) != 0)) kw_args--; else { __Pyx_RaiseArgtupleInvalid("pie", 1, 7, 7, 4); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 118; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } case 5: if (likely((values[5] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_end)) != 0)) kw_args--; else { __Pyx_RaiseArgtupleInvalid("pie", 1, 7, 7, 5); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 118; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } case 6: if (likely((values[6] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_color)) != 0)) kw_args--; else { __Pyx_RaiseArgtupleInvalid("pie", 1, 7, 7, 6); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 118; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "pie") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 118; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } } else if (PyTuple_GET_SIZE(__pyx_args) != 7) { goto __pyx_L5_argtuple_error; } else { values[0] = PyTuple_GET_ITEM(__pyx_args, 0); values[1] = PyTuple_GET_ITEM(__pyx_args, 1); values[2] = PyTuple_GET_ITEM(__pyx_args, 2); values[3] = PyTuple_GET_ITEM(__pyx_args, 3); values[4] = PyTuple_GET_ITEM(__pyx_args, 4); values[5] = PyTuple_GET_ITEM(__pyx_args, 5); values[6] = PyTuple_GET_ITEM(__pyx_args, 6); } __pyx_v_surface = ((struct __pyx_obj_11pygame_sdl2_7surface_Surface *)values[0]); __pyx_v_x = values[1]; __pyx_v_y = values[2]; __pyx_v_r = values[3]; __pyx_v_start = values[4]; __pyx_v_end = values[5]; __pyx_v_color = values[6]; } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("pie", 1, 7, 7, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 118; __pyx_clineno = __LINE__; goto __pyx_L3_error;} __pyx_L3_error:; __Pyx_AddTraceback("pygame_sdl2.gfxdraw.pie", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_surface), __pyx_ptype_11pygame_sdl2_7surface_Surface, 1, "surface", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 118; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_r = __pyx_pf_11pygame_sdl2_7gfxdraw_34pie(__pyx_self, __pyx_v_surface, __pyx_v_x, __pyx_v_y, __pyx_v_r, __pyx_v_start, __pyx_v_end, __pyx_v_color); /* function exit code */ goto __pyx_L0; __pyx_L1_error:; __pyx_r = NULL; __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_7gfxdraw_34pie(CYTHON_UNUSED PyObject *__pyx_self, struct __pyx_obj_11pygame_sdl2_7surface_Surface *__pyx_v_surface, PyObject *__pyx_v_x, PyObject *__pyx_v_y, PyObject *__pyx_v_r, PyObject *__pyx_v_start, PyObject *__pyx_v_end, PyObject *__pyx_v_color) { struct __pyx_obj_11pygame_sdl2_5color_Color *__pyx_v_c = 0; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; Sint16 __pyx_t_3; Sint16 __pyx_t_4; Sint16 __pyx_t_5; Sint16 __pyx_t_6; Sint16 __pyx_t_7; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("pie", 0); /* "pygame_sdl2/gfxdraw.pyx":119 * * def pie(Surface surface, x, y, r, start, end, color): * cdef Color c = Color(color) # <<<<<<<<<<<<<< * pieRGBA(surface.surface, x, y, r, start, end, c.r, c.g, c.b, c.a) * */ __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 119; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __Pyx_INCREF(__pyx_v_color); __Pyx_GIVEREF(__pyx_v_color); PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_color); __pyx_t_2 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_11pygame_sdl2_5color_Color), __pyx_t_1, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 119; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_v_c = ((struct __pyx_obj_11pygame_sdl2_5color_Color *)__pyx_t_2); __pyx_t_2 = 0; /* "pygame_sdl2/gfxdraw.pyx":120 * def pie(Surface surface, x, y, r, start, end, color): * cdef Color c = Color(color) * pieRGBA(surface.surface, x, y, r, start, end, c.r, c.g, c.b, c.a) # <<<<<<<<<<<<<< * * def filled_pie(Surface surface, x, y, r, start, end, color): */ __pyx_t_3 = __Pyx_PyInt_As_int16_t(__pyx_v_x); if (unlikely((__pyx_t_3 == (Sint16)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 120; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_t_4 = __Pyx_PyInt_As_int16_t(__pyx_v_y); if (unlikely((__pyx_t_4 == (Sint16)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 120; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_t_5 = __Pyx_PyInt_As_int16_t(__pyx_v_r); if (unlikely((__pyx_t_5 == (Sint16)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 120; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_t_6 = __Pyx_PyInt_As_int16_t(__pyx_v_start); if (unlikely((__pyx_t_6 == (Sint16)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 120; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_t_7 = __Pyx_PyInt_As_int16_t(__pyx_v_end); if (unlikely((__pyx_t_7 == (Sint16)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 120; __pyx_clineno = __LINE__; goto __pyx_L1_error;} pieRGBA(__pyx_v_surface->surface, __pyx_t_3, __pyx_t_4, __pyx_t_5, __pyx_t_6, __pyx_t_7, __pyx_v_c->r, __pyx_v_c->g, __pyx_v_c->b, __pyx_v_c->a); /* "pygame_sdl2/gfxdraw.pyx":118 * filledEllipseRGBA(surface.surface, x, y, rx, ry, c.r, c.g, c.b, c.a) * * def pie(Surface surface, x, y, r, start, end, color): # <<<<<<<<<<<<<< * cdef Color c = Color(color) * pieRGBA(surface.surface, x, y, r, start, end, c.r, c.g, c.b, c.a) */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_AddTraceback("pygame_sdl2.gfxdraw.pie", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF((PyObject *)__pyx_v_c); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/gfxdraw.pyx":122 * pieRGBA(surface.surface, x, y, r, start, end, c.r, c.g, c.b, c.a) * * def filled_pie(Surface surface, x, y, r, start, end, color): # <<<<<<<<<<<<<< * cdef Color c = Color(color) * filledPieRGBA(surface.surface, x, y, r, start, end, c.r, c.g, c.b, c.a) */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_7gfxdraw_37filled_pie(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static PyMethodDef __pyx_mdef_11pygame_sdl2_7gfxdraw_37filled_pie = {"filled_pie", (PyCFunction)__pyx_pw_11pygame_sdl2_7gfxdraw_37filled_pie, METH_VARARGS|METH_KEYWORDS, 0}; static PyObject *__pyx_pw_11pygame_sdl2_7gfxdraw_37filled_pie(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { struct __pyx_obj_11pygame_sdl2_7surface_Surface *__pyx_v_surface = 0; PyObject *__pyx_v_x = 0; PyObject *__pyx_v_y = 0; PyObject *__pyx_v_r = 0; PyObject *__pyx_v_start = 0; PyObject *__pyx_v_end = 0; PyObject *__pyx_v_color = 0; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("filled_pie (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_surface,&__pyx_n_s_x,&__pyx_n_s_y,&__pyx_n_s_r,&__pyx_n_s_start,&__pyx_n_s_end,&__pyx_n_s_color,0}; PyObject* values[7] = {0,0,0,0,0,0,0}; if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 7: values[6] = PyTuple_GET_ITEM(__pyx_args, 6); case 6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5); case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4); case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_surface)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; case 1: if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_x)) != 0)) kw_args--; else { __Pyx_RaiseArgtupleInvalid("filled_pie", 1, 7, 7, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 122; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } case 2: if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_y)) != 0)) kw_args--; else { __Pyx_RaiseArgtupleInvalid("filled_pie", 1, 7, 7, 2); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 122; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } case 3: if (likely((values[3] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_r)) != 0)) kw_args--; else { __Pyx_RaiseArgtupleInvalid("filled_pie", 1, 7, 7, 3); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 122; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } case 4: if (likely((values[4] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_start)) != 0)) kw_args--; else { __Pyx_RaiseArgtupleInvalid("filled_pie", 1, 7, 7, 4); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 122; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } case 5: if (likely((values[5] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_end)) != 0)) kw_args--; else { __Pyx_RaiseArgtupleInvalid("filled_pie", 1, 7, 7, 5); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 122; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } case 6: if (likely((values[6] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_color)) != 0)) kw_args--; else { __Pyx_RaiseArgtupleInvalid("filled_pie", 1, 7, 7, 6); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 122; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "filled_pie") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 122; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } } else if (PyTuple_GET_SIZE(__pyx_args) != 7) { goto __pyx_L5_argtuple_error; } else { values[0] = PyTuple_GET_ITEM(__pyx_args, 0); values[1] = PyTuple_GET_ITEM(__pyx_args, 1); values[2] = PyTuple_GET_ITEM(__pyx_args, 2); values[3] = PyTuple_GET_ITEM(__pyx_args, 3); values[4] = PyTuple_GET_ITEM(__pyx_args, 4); values[5] = PyTuple_GET_ITEM(__pyx_args, 5); values[6] = PyTuple_GET_ITEM(__pyx_args, 6); } __pyx_v_surface = ((struct __pyx_obj_11pygame_sdl2_7surface_Surface *)values[0]); __pyx_v_x = values[1]; __pyx_v_y = values[2]; __pyx_v_r = values[3]; __pyx_v_start = values[4]; __pyx_v_end = values[5]; __pyx_v_color = values[6]; } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("filled_pie", 1, 7, 7, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 122; __pyx_clineno = __LINE__; goto __pyx_L3_error;} __pyx_L3_error:; __Pyx_AddTraceback("pygame_sdl2.gfxdraw.filled_pie", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_surface), __pyx_ptype_11pygame_sdl2_7surface_Surface, 1, "surface", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 122; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_r = __pyx_pf_11pygame_sdl2_7gfxdraw_36filled_pie(__pyx_self, __pyx_v_surface, __pyx_v_x, __pyx_v_y, __pyx_v_r, __pyx_v_start, __pyx_v_end, __pyx_v_color); /* function exit code */ goto __pyx_L0; __pyx_L1_error:; __pyx_r = NULL; __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_7gfxdraw_36filled_pie(CYTHON_UNUSED PyObject *__pyx_self, struct __pyx_obj_11pygame_sdl2_7surface_Surface *__pyx_v_surface, PyObject *__pyx_v_x, PyObject *__pyx_v_y, PyObject *__pyx_v_r, PyObject *__pyx_v_start, PyObject *__pyx_v_end, PyObject *__pyx_v_color) { struct __pyx_obj_11pygame_sdl2_5color_Color *__pyx_v_c = 0; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; Sint16 __pyx_t_3; Sint16 __pyx_t_4; Sint16 __pyx_t_5; Sint16 __pyx_t_6; Sint16 __pyx_t_7; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("filled_pie", 0); /* "pygame_sdl2/gfxdraw.pyx":123 * * def filled_pie(Surface surface, x, y, r, start, end, color): * cdef Color c = Color(color) # <<<<<<<<<<<<<< * filledPieRGBA(surface.surface, x, y, r, start, end, c.r, c.g, c.b, c.a) * */ __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 123; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __Pyx_INCREF(__pyx_v_color); __Pyx_GIVEREF(__pyx_v_color); PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_color); __pyx_t_2 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_11pygame_sdl2_5color_Color), __pyx_t_1, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 123; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_v_c = ((struct __pyx_obj_11pygame_sdl2_5color_Color *)__pyx_t_2); __pyx_t_2 = 0; /* "pygame_sdl2/gfxdraw.pyx":124 * def filled_pie(Surface surface, x, y, r, start, end, color): * cdef Color c = Color(color) * filledPieRGBA(surface.surface, x, y, r, start, end, c.r, c.g, c.b, c.a) # <<<<<<<<<<<<<< * * def trigon(Surface surface, x1, y1, x2, y2, x3, y3, color): */ __pyx_t_3 = __Pyx_PyInt_As_int16_t(__pyx_v_x); if (unlikely((__pyx_t_3 == (Sint16)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 124; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_t_4 = __Pyx_PyInt_As_int16_t(__pyx_v_y); if (unlikely((__pyx_t_4 == (Sint16)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 124; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_t_5 = __Pyx_PyInt_As_int16_t(__pyx_v_r); if (unlikely((__pyx_t_5 == (Sint16)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 124; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_t_6 = __Pyx_PyInt_As_int16_t(__pyx_v_start); if (unlikely((__pyx_t_6 == (Sint16)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 124; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_t_7 = __Pyx_PyInt_As_int16_t(__pyx_v_end); if (unlikely((__pyx_t_7 == (Sint16)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 124; __pyx_clineno = __LINE__; goto __pyx_L1_error;} filledPieRGBA(__pyx_v_surface->surface, __pyx_t_3, __pyx_t_4, __pyx_t_5, __pyx_t_6, __pyx_t_7, __pyx_v_c->r, __pyx_v_c->g, __pyx_v_c->b, __pyx_v_c->a); /* "pygame_sdl2/gfxdraw.pyx":122 * pieRGBA(surface.surface, x, y, r, start, end, c.r, c.g, c.b, c.a) * * def filled_pie(Surface surface, x, y, r, start, end, color): # <<<<<<<<<<<<<< * cdef Color c = Color(color) * filledPieRGBA(surface.surface, x, y, r, start, end, c.r, c.g, c.b, c.a) */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_AddTraceback("pygame_sdl2.gfxdraw.filled_pie", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF((PyObject *)__pyx_v_c); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/gfxdraw.pyx":126 * filledPieRGBA(surface.surface, x, y, r, start, end, c.r, c.g, c.b, c.a) * * def trigon(Surface surface, x1, y1, x2, y2, x3, y3, color): # <<<<<<<<<<<<<< * cdef Color c = Color(color) * trigonRGBA(surface.surface, x1, y1, x2, y2, x3, y3, c.r, c.g, c.b, c.a) */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_7gfxdraw_39trigon(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static PyMethodDef __pyx_mdef_11pygame_sdl2_7gfxdraw_39trigon = {"trigon", (PyCFunction)__pyx_pw_11pygame_sdl2_7gfxdraw_39trigon, METH_VARARGS|METH_KEYWORDS, 0}; static PyObject *__pyx_pw_11pygame_sdl2_7gfxdraw_39trigon(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { struct __pyx_obj_11pygame_sdl2_7surface_Surface *__pyx_v_surface = 0; PyObject *__pyx_v_x1 = 0; PyObject *__pyx_v_y1 = 0; PyObject *__pyx_v_x2 = 0; PyObject *__pyx_v_y2 = 0; PyObject *__pyx_v_x3 = 0; PyObject *__pyx_v_y3 = 0; PyObject *__pyx_v_color = 0; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("trigon (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_surface,&__pyx_n_s_x1,&__pyx_n_s_y1,&__pyx_n_s_x2,&__pyx_n_s_y2,&__pyx_n_s_x3,&__pyx_n_s_y3,&__pyx_n_s_color,0}; PyObject* values[8] = {0,0,0,0,0,0,0,0}; if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 8: values[7] = PyTuple_GET_ITEM(__pyx_args, 7); case 7: values[6] = PyTuple_GET_ITEM(__pyx_args, 6); case 6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5); case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4); case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_surface)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; case 1: if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_x1)) != 0)) kw_args--; else { __Pyx_RaiseArgtupleInvalid("trigon", 1, 8, 8, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 126; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } case 2: if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_y1)) != 0)) kw_args--; else { __Pyx_RaiseArgtupleInvalid("trigon", 1, 8, 8, 2); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 126; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } case 3: if (likely((values[3] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_x2)) != 0)) kw_args--; else { __Pyx_RaiseArgtupleInvalid("trigon", 1, 8, 8, 3); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 126; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } case 4: if (likely((values[4] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_y2)) != 0)) kw_args--; else { __Pyx_RaiseArgtupleInvalid("trigon", 1, 8, 8, 4); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 126; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } case 5: if (likely((values[5] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_x3)) != 0)) kw_args--; else { __Pyx_RaiseArgtupleInvalid("trigon", 1, 8, 8, 5); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 126; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } case 6: if (likely((values[6] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_y3)) != 0)) kw_args--; else { __Pyx_RaiseArgtupleInvalid("trigon", 1, 8, 8, 6); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 126; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } case 7: if (likely((values[7] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_color)) != 0)) kw_args--; else { __Pyx_RaiseArgtupleInvalid("trigon", 1, 8, 8, 7); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 126; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "trigon") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 126; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } } else if (PyTuple_GET_SIZE(__pyx_args) != 8) { goto __pyx_L5_argtuple_error; } else { values[0] = PyTuple_GET_ITEM(__pyx_args, 0); values[1] = PyTuple_GET_ITEM(__pyx_args, 1); values[2] = PyTuple_GET_ITEM(__pyx_args, 2); values[3] = PyTuple_GET_ITEM(__pyx_args, 3); values[4] = PyTuple_GET_ITEM(__pyx_args, 4); values[5] = PyTuple_GET_ITEM(__pyx_args, 5); values[6] = PyTuple_GET_ITEM(__pyx_args, 6); values[7] = PyTuple_GET_ITEM(__pyx_args, 7); } __pyx_v_surface = ((struct __pyx_obj_11pygame_sdl2_7surface_Surface *)values[0]); __pyx_v_x1 = values[1]; __pyx_v_y1 = values[2]; __pyx_v_x2 = values[3]; __pyx_v_y2 = values[4]; __pyx_v_x3 = values[5]; __pyx_v_y3 = values[6]; __pyx_v_color = values[7]; } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("trigon", 1, 8, 8, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 126; __pyx_clineno = __LINE__; goto __pyx_L3_error;} __pyx_L3_error:; __Pyx_AddTraceback("pygame_sdl2.gfxdraw.trigon", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_surface), __pyx_ptype_11pygame_sdl2_7surface_Surface, 1, "surface", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 126; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_r = __pyx_pf_11pygame_sdl2_7gfxdraw_38trigon(__pyx_self, __pyx_v_surface, __pyx_v_x1, __pyx_v_y1, __pyx_v_x2, __pyx_v_y2, __pyx_v_x3, __pyx_v_y3, __pyx_v_color); /* function exit code */ goto __pyx_L0; __pyx_L1_error:; __pyx_r = NULL; __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_7gfxdraw_38trigon(CYTHON_UNUSED PyObject *__pyx_self, struct __pyx_obj_11pygame_sdl2_7surface_Surface *__pyx_v_surface, PyObject *__pyx_v_x1, PyObject *__pyx_v_y1, PyObject *__pyx_v_x2, PyObject *__pyx_v_y2, PyObject *__pyx_v_x3, PyObject *__pyx_v_y3, PyObject *__pyx_v_color) { struct __pyx_obj_11pygame_sdl2_5color_Color *__pyx_v_c = 0; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; Sint16 __pyx_t_3; Sint16 __pyx_t_4; Sint16 __pyx_t_5; Sint16 __pyx_t_6; Sint16 __pyx_t_7; Sint16 __pyx_t_8; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("trigon", 0); /* "pygame_sdl2/gfxdraw.pyx":127 * * def trigon(Surface surface, x1, y1, x2, y2, x3, y3, color): * cdef Color c = Color(color) # <<<<<<<<<<<<<< * trigonRGBA(surface.surface, x1, y1, x2, y2, x3, y3, c.r, c.g, c.b, c.a) * */ __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 127; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __Pyx_INCREF(__pyx_v_color); __Pyx_GIVEREF(__pyx_v_color); PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_color); __pyx_t_2 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_11pygame_sdl2_5color_Color), __pyx_t_1, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 127; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_v_c = ((struct __pyx_obj_11pygame_sdl2_5color_Color *)__pyx_t_2); __pyx_t_2 = 0; /* "pygame_sdl2/gfxdraw.pyx":128 * def trigon(Surface surface, x1, y1, x2, y2, x3, y3, color): * cdef Color c = Color(color) * trigonRGBA(surface.surface, x1, y1, x2, y2, x3, y3, c.r, c.g, c.b, c.a) # <<<<<<<<<<<<<< * * def aatrigon(Surface surface, x1, y1, x2, y2, x3, y3, color): */ __pyx_t_3 = __Pyx_PyInt_As_int16_t(__pyx_v_x1); if (unlikely((__pyx_t_3 == (Sint16)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 128; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_t_4 = __Pyx_PyInt_As_int16_t(__pyx_v_y1); if (unlikely((__pyx_t_4 == (Sint16)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 128; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_t_5 = __Pyx_PyInt_As_int16_t(__pyx_v_x2); if (unlikely((__pyx_t_5 == (Sint16)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 128; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_t_6 = __Pyx_PyInt_As_int16_t(__pyx_v_y2); if (unlikely((__pyx_t_6 == (Sint16)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 128; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_t_7 = __Pyx_PyInt_As_int16_t(__pyx_v_x3); if (unlikely((__pyx_t_7 == (Sint16)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 128; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_t_8 = __Pyx_PyInt_As_int16_t(__pyx_v_y3); if (unlikely((__pyx_t_8 == (Sint16)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 128; __pyx_clineno = __LINE__; goto __pyx_L1_error;} trigonRGBA(__pyx_v_surface->surface, __pyx_t_3, __pyx_t_4, __pyx_t_5, __pyx_t_6, __pyx_t_7, __pyx_t_8, __pyx_v_c->r, __pyx_v_c->g, __pyx_v_c->b, __pyx_v_c->a); /* "pygame_sdl2/gfxdraw.pyx":126 * filledPieRGBA(surface.surface, x, y, r, start, end, c.r, c.g, c.b, c.a) * * def trigon(Surface surface, x1, y1, x2, y2, x3, y3, color): # <<<<<<<<<<<<<< * cdef Color c = Color(color) * trigonRGBA(surface.surface, x1, y1, x2, y2, x3, y3, c.r, c.g, c.b, c.a) */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_AddTraceback("pygame_sdl2.gfxdraw.trigon", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF((PyObject *)__pyx_v_c); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/gfxdraw.pyx":130 * trigonRGBA(surface.surface, x1, y1, x2, y2, x3, y3, c.r, c.g, c.b, c.a) * * def aatrigon(Surface surface, x1, y1, x2, y2, x3, y3, color): # <<<<<<<<<<<<<< * cdef Color c = Color(color) * aatrigonRGBA(surface.surface, x1, y1, x2, y2, x3, y3, c.r, c.g, c.b, c.a) */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_7gfxdraw_41aatrigon(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static PyMethodDef __pyx_mdef_11pygame_sdl2_7gfxdraw_41aatrigon = {"aatrigon", (PyCFunction)__pyx_pw_11pygame_sdl2_7gfxdraw_41aatrigon, METH_VARARGS|METH_KEYWORDS, 0}; static PyObject *__pyx_pw_11pygame_sdl2_7gfxdraw_41aatrigon(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { struct __pyx_obj_11pygame_sdl2_7surface_Surface *__pyx_v_surface = 0; PyObject *__pyx_v_x1 = 0; PyObject *__pyx_v_y1 = 0; PyObject *__pyx_v_x2 = 0; PyObject *__pyx_v_y2 = 0; PyObject *__pyx_v_x3 = 0; PyObject *__pyx_v_y3 = 0; PyObject *__pyx_v_color = 0; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("aatrigon (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_surface,&__pyx_n_s_x1,&__pyx_n_s_y1,&__pyx_n_s_x2,&__pyx_n_s_y2,&__pyx_n_s_x3,&__pyx_n_s_y3,&__pyx_n_s_color,0}; PyObject* values[8] = {0,0,0,0,0,0,0,0}; if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 8: values[7] = PyTuple_GET_ITEM(__pyx_args, 7); case 7: values[6] = PyTuple_GET_ITEM(__pyx_args, 6); case 6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5); case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4); case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_surface)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; case 1: if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_x1)) != 0)) kw_args--; else { __Pyx_RaiseArgtupleInvalid("aatrigon", 1, 8, 8, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 130; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } case 2: if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_y1)) != 0)) kw_args--; else { __Pyx_RaiseArgtupleInvalid("aatrigon", 1, 8, 8, 2); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 130; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } case 3: if (likely((values[3] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_x2)) != 0)) kw_args--; else { __Pyx_RaiseArgtupleInvalid("aatrigon", 1, 8, 8, 3); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 130; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } case 4: if (likely((values[4] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_y2)) != 0)) kw_args--; else { __Pyx_RaiseArgtupleInvalid("aatrigon", 1, 8, 8, 4); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 130; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } case 5: if (likely((values[5] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_x3)) != 0)) kw_args--; else { __Pyx_RaiseArgtupleInvalid("aatrigon", 1, 8, 8, 5); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 130; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } case 6: if (likely((values[6] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_y3)) != 0)) kw_args--; else { __Pyx_RaiseArgtupleInvalid("aatrigon", 1, 8, 8, 6); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 130; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } case 7: if (likely((values[7] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_color)) != 0)) kw_args--; else { __Pyx_RaiseArgtupleInvalid("aatrigon", 1, 8, 8, 7); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 130; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "aatrigon") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 130; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } } else if (PyTuple_GET_SIZE(__pyx_args) != 8) { goto __pyx_L5_argtuple_error; } else { values[0] = PyTuple_GET_ITEM(__pyx_args, 0); values[1] = PyTuple_GET_ITEM(__pyx_args, 1); values[2] = PyTuple_GET_ITEM(__pyx_args, 2); values[3] = PyTuple_GET_ITEM(__pyx_args, 3); values[4] = PyTuple_GET_ITEM(__pyx_args, 4); values[5] = PyTuple_GET_ITEM(__pyx_args, 5); values[6] = PyTuple_GET_ITEM(__pyx_args, 6); values[7] = PyTuple_GET_ITEM(__pyx_args, 7); } __pyx_v_surface = ((struct __pyx_obj_11pygame_sdl2_7surface_Surface *)values[0]); __pyx_v_x1 = values[1]; __pyx_v_y1 = values[2]; __pyx_v_x2 = values[3]; __pyx_v_y2 = values[4]; __pyx_v_x3 = values[5]; __pyx_v_y3 = values[6]; __pyx_v_color = values[7]; } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("aatrigon", 1, 8, 8, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 130; __pyx_clineno = __LINE__; goto __pyx_L3_error;} __pyx_L3_error:; __Pyx_AddTraceback("pygame_sdl2.gfxdraw.aatrigon", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_surface), __pyx_ptype_11pygame_sdl2_7surface_Surface, 1, "surface", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 130; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_r = __pyx_pf_11pygame_sdl2_7gfxdraw_40aatrigon(__pyx_self, __pyx_v_surface, __pyx_v_x1, __pyx_v_y1, __pyx_v_x2, __pyx_v_y2, __pyx_v_x3, __pyx_v_y3, __pyx_v_color); /* function exit code */ goto __pyx_L0; __pyx_L1_error:; __pyx_r = NULL; __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_7gfxdraw_40aatrigon(CYTHON_UNUSED PyObject *__pyx_self, struct __pyx_obj_11pygame_sdl2_7surface_Surface *__pyx_v_surface, PyObject *__pyx_v_x1, PyObject *__pyx_v_y1, PyObject *__pyx_v_x2, PyObject *__pyx_v_y2, PyObject *__pyx_v_x3, PyObject *__pyx_v_y3, PyObject *__pyx_v_color) { struct __pyx_obj_11pygame_sdl2_5color_Color *__pyx_v_c = 0; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; Sint16 __pyx_t_3; Sint16 __pyx_t_4; Sint16 __pyx_t_5; Sint16 __pyx_t_6; Sint16 __pyx_t_7; Sint16 __pyx_t_8; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("aatrigon", 0); /* "pygame_sdl2/gfxdraw.pyx":131 * * def aatrigon(Surface surface, x1, y1, x2, y2, x3, y3, color): * cdef Color c = Color(color) # <<<<<<<<<<<<<< * aatrigonRGBA(surface.surface, x1, y1, x2, y2, x3, y3, c.r, c.g, c.b, c.a) * */ __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 131; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __Pyx_INCREF(__pyx_v_color); __Pyx_GIVEREF(__pyx_v_color); PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_color); __pyx_t_2 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_11pygame_sdl2_5color_Color), __pyx_t_1, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 131; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_v_c = ((struct __pyx_obj_11pygame_sdl2_5color_Color *)__pyx_t_2); __pyx_t_2 = 0; /* "pygame_sdl2/gfxdraw.pyx":132 * def aatrigon(Surface surface, x1, y1, x2, y2, x3, y3, color): * cdef Color c = Color(color) * aatrigonRGBA(surface.surface, x1, y1, x2, y2, x3, y3, c.r, c.g, c.b, c.a) # <<<<<<<<<<<<<< * * def filled_trigon(Surface surface, x1, y1, x2, y2, x3, y3, color): */ __pyx_t_3 = __Pyx_PyInt_As_int16_t(__pyx_v_x1); if (unlikely((__pyx_t_3 == (Sint16)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 132; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_t_4 = __Pyx_PyInt_As_int16_t(__pyx_v_y1); if (unlikely((__pyx_t_4 == (Sint16)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 132; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_t_5 = __Pyx_PyInt_As_int16_t(__pyx_v_x2); if (unlikely((__pyx_t_5 == (Sint16)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 132; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_t_6 = __Pyx_PyInt_As_int16_t(__pyx_v_y2); if (unlikely((__pyx_t_6 == (Sint16)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 132; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_t_7 = __Pyx_PyInt_As_int16_t(__pyx_v_x3); if (unlikely((__pyx_t_7 == (Sint16)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 132; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_t_8 = __Pyx_PyInt_As_int16_t(__pyx_v_y3); if (unlikely((__pyx_t_8 == (Sint16)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 132; __pyx_clineno = __LINE__; goto __pyx_L1_error;} aatrigonRGBA(__pyx_v_surface->surface, __pyx_t_3, __pyx_t_4, __pyx_t_5, __pyx_t_6, __pyx_t_7, __pyx_t_8, __pyx_v_c->r, __pyx_v_c->g, __pyx_v_c->b, __pyx_v_c->a); /* "pygame_sdl2/gfxdraw.pyx":130 * trigonRGBA(surface.surface, x1, y1, x2, y2, x3, y3, c.r, c.g, c.b, c.a) * * def aatrigon(Surface surface, x1, y1, x2, y2, x3, y3, color): # <<<<<<<<<<<<<< * cdef Color c = Color(color) * aatrigonRGBA(surface.surface, x1, y1, x2, y2, x3, y3, c.r, c.g, c.b, c.a) */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_AddTraceback("pygame_sdl2.gfxdraw.aatrigon", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF((PyObject *)__pyx_v_c); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/gfxdraw.pyx":134 * aatrigonRGBA(surface.surface, x1, y1, x2, y2, x3, y3, c.r, c.g, c.b, c.a) * * def filled_trigon(Surface surface, x1, y1, x2, y2, x3, y3, color): # <<<<<<<<<<<<<< * cdef Color c = Color(color) * filledTrigonRGBA(surface.surface, x1, y1, x2, y2, x3, y3, c.r, c.g, c.b, c.a) */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_7gfxdraw_43filled_trigon(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static PyMethodDef __pyx_mdef_11pygame_sdl2_7gfxdraw_43filled_trigon = {"filled_trigon", (PyCFunction)__pyx_pw_11pygame_sdl2_7gfxdraw_43filled_trigon, METH_VARARGS|METH_KEYWORDS, 0}; static PyObject *__pyx_pw_11pygame_sdl2_7gfxdraw_43filled_trigon(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { struct __pyx_obj_11pygame_sdl2_7surface_Surface *__pyx_v_surface = 0; PyObject *__pyx_v_x1 = 0; PyObject *__pyx_v_y1 = 0; PyObject *__pyx_v_x2 = 0; PyObject *__pyx_v_y2 = 0; PyObject *__pyx_v_x3 = 0; PyObject *__pyx_v_y3 = 0; PyObject *__pyx_v_color = 0; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("filled_trigon (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_surface,&__pyx_n_s_x1,&__pyx_n_s_y1,&__pyx_n_s_x2,&__pyx_n_s_y2,&__pyx_n_s_x3,&__pyx_n_s_y3,&__pyx_n_s_color,0}; PyObject* values[8] = {0,0,0,0,0,0,0,0}; if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 8: values[7] = PyTuple_GET_ITEM(__pyx_args, 7); case 7: values[6] = PyTuple_GET_ITEM(__pyx_args, 6); case 6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5); case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4); case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_surface)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; case 1: if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_x1)) != 0)) kw_args--; else { __Pyx_RaiseArgtupleInvalid("filled_trigon", 1, 8, 8, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 134; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } case 2: if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_y1)) != 0)) kw_args--; else { __Pyx_RaiseArgtupleInvalid("filled_trigon", 1, 8, 8, 2); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 134; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } case 3: if (likely((values[3] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_x2)) != 0)) kw_args--; else { __Pyx_RaiseArgtupleInvalid("filled_trigon", 1, 8, 8, 3); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 134; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } case 4: if (likely((values[4] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_y2)) != 0)) kw_args--; else { __Pyx_RaiseArgtupleInvalid("filled_trigon", 1, 8, 8, 4); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 134; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } case 5: if (likely((values[5] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_x3)) != 0)) kw_args--; else { __Pyx_RaiseArgtupleInvalid("filled_trigon", 1, 8, 8, 5); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 134; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } case 6: if (likely((values[6] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_y3)) != 0)) kw_args--; else { __Pyx_RaiseArgtupleInvalid("filled_trigon", 1, 8, 8, 6); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 134; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } case 7: if (likely((values[7] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_color)) != 0)) kw_args--; else { __Pyx_RaiseArgtupleInvalid("filled_trigon", 1, 8, 8, 7); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 134; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "filled_trigon") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 134; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } } else if (PyTuple_GET_SIZE(__pyx_args) != 8) { goto __pyx_L5_argtuple_error; } else { values[0] = PyTuple_GET_ITEM(__pyx_args, 0); values[1] = PyTuple_GET_ITEM(__pyx_args, 1); values[2] = PyTuple_GET_ITEM(__pyx_args, 2); values[3] = PyTuple_GET_ITEM(__pyx_args, 3); values[4] = PyTuple_GET_ITEM(__pyx_args, 4); values[5] = PyTuple_GET_ITEM(__pyx_args, 5); values[6] = PyTuple_GET_ITEM(__pyx_args, 6); values[7] = PyTuple_GET_ITEM(__pyx_args, 7); } __pyx_v_surface = ((struct __pyx_obj_11pygame_sdl2_7surface_Surface *)values[0]); __pyx_v_x1 = values[1]; __pyx_v_y1 = values[2]; __pyx_v_x2 = values[3]; __pyx_v_y2 = values[4]; __pyx_v_x3 = values[5]; __pyx_v_y3 = values[6]; __pyx_v_color = values[7]; } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("filled_trigon", 1, 8, 8, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 134; __pyx_clineno = __LINE__; goto __pyx_L3_error;} __pyx_L3_error:; __Pyx_AddTraceback("pygame_sdl2.gfxdraw.filled_trigon", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_surface), __pyx_ptype_11pygame_sdl2_7surface_Surface, 1, "surface", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 134; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_r = __pyx_pf_11pygame_sdl2_7gfxdraw_42filled_trigon(__pyx_self, __pyx_v_surface, __pyx_v_x1, __pyx_v_y1, __pyx_v_x2, __pyx_v_y2, __pyx_v_x3, __pyx_v_y3, __pyx_v_color); /* function exit code */ goto __pyx_L0; __pyx_L1_error:; __pyx_r = NULL; __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_7gfxdraw_42filled_trigon(CYTHON_UNUSED PyObject *__pyx_self, struct __pyx_obj_11pygame_sdl2_7surface_Surface *__pyx_v_surface, PyObject *__pyx_v_x1, PyObject *__pyx_v_y1, PyObject *__pyx_v_x2, PyObject *__pyx_v_y2, PyObject *__pyx_v_x3, PyObject *__pyx_v_y3, PyObject *__pyx_v_color) { struct __pyx_obj_11pygame_sdl2_5color_Color *__pyx_v_c = 0; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; Sint16 __pyx_t_3; Sint16 __pyx_t_4; Sint16 __pyx_t_5; Sint16 __pyx_t_6; Sint16 __pyx_t_7; Sint16 __pyx_t_8; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("filled_trigon", 0); /* "pygame_sdl2/gfxdraw.pyx":135 * * def filled_trigon(Surface surface, x1, y1, x2, y2, x3, y3, color): * cdef Color c = Color(color) # <<<<<<<<<<<<<< * filledTrigonRGBA(surface.surface, x1, y1, x2, y2, x3, y3, c.r, c.g, c.b, c.a) * */ __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 135; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __Pyx_INCREF(__pyx_v_color); __Pyx_GIVEREF(__pyx_v_color); PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_color); __pyx_t_2 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_11pygame_sdl2_5color_Color), __pyx_t_1, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 135; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_v_c = ((struct __pyx_obj_11pygame_sdl2_5color_Color *)__pyx_t_2); __pyx_t_2 = 0; /* "pygame_sdl2/gfxdraw.pyx":136 * def filled_trigon(Surface surface, x1, y1, x2, y2, x3, y3, color): * cdef Color c = Color(color) * filledTrigonRGBA(surface.surface, x1, y1, x2, y2, x3, y3, c.r, c.g, c.b, c.a) # <<<<<<<<<<<<<< * * def polygon(Surface surface, points, color): */ __pyx_t_3 = __Pyx_PyInt_As_int16_t(__pyx_v_x1); if (unlikely((__pyx_t_3 == (Sint16)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 136; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_t_4 = __Pyx_PyInt_As_int16_t(__pyx_v_y1); if (unlikely((__pyx_t_4 == (Sint16)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 136; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_t_5 = __Pyx_PyInt_As_int16_t(__pyx_v_x2); if (unlikely((__pyx_t_5 == (Sint16)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 136; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_t_6 = __Pyx_PyInt_As_int16_t(__pyx_v_y2); if (unlikely((__pyx_t_6 == (Sint16)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 136; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_t_7 = __Pyx_PyInt_As_int16_t(__pyx_v_x3); if (unlikely((__pyx_t_7 == (Sint16)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 136; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_t_8 = __Pyx_PyInt_As_int16_t(__pyx_v_y3); if (unlikely((__pyx_t_8 == (Sint16)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 136; __pyx_clineno = __LINE__; goto __pyx_L1_error;} filledTrigonRGBA(__pyx_v_surface->surface, __pyx_t_3, __pyx_t_4, __pyx_t_5, __pyx_t_6, __pyx_t_7, __pyx_t_8, __pyx_v_c->r, __pyx_v_c->g, __pyx_v_c->b, __pyx_v_c->a); /* "pygame_sdl2/gfxdraw.pyx":134 * aatrigonRGBA(surface.surface, x1, y1, x2, y2, x3, y3, c.r, c.g, c.b, c.a) * * def filled_trigon(Surface surface, x1, y1, x2, y2, x3, y3, color): # <<<<<<<<<<<<<< * cdef Color c = Color(color) * filledTrigonRGBA(surface.surface, x1, y1, x2, y2, x3, y3, c.r, c.g, c.b, c.a) */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_AddTraceback("pygame_sdl2.gfxdraw.filled_trigon", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF((PyObject *)__pyx_v_c); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/gfxdraw.pyx":138 * filledTrigonRGBA(surface.surface, x1, y1, x2, y2, x3, y3, c.r, c.g, c.b, c.a) * * def polygon(Surface surface, points, color): # <<<<<<<<<<<<<< * cdef Color c = Color(color) * cdef Sint16 *vx */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_7gfxdraw_45polygon(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static PyMethodDef __pyx_mdef_11pygame_sdl2_7gfxdraw_45polygon = {"polygon", (PyCFunction)__pyx_pw_11pygame_sdl2_7gfxdraw_45polygon, METH_VARARGS|METH_KEYWORDS, 0}; static PyObject *__pyx_pw_11pygame_sdl2_7gfxdraw_45polygon(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { struct __pyx_obj_11pygame_sdl2_7surface_Surface *__pyx_v_surface = 0; PyObject *__pyx_v_points = 0; PyObject *__pyx_v_color = 0; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("polygon (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_surface,&__pyx_n_s_points,&__pyx_n_s_color,0}; PyObject* values[3] = {0,0,0}; if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_surface)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; case 1: if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_points)) != 0)) kw_args--; else { __Pyx_RaiseArgtupleInvalid("polygon", 1, 3, 3, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 138; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } case 2: if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_color)) != 0)) kw_args--; else { __Pyx_RaiseArgtupleInvalid("polygon", 1, 3, 3, 2); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 138; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "polygon") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 138; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } } else if (PyTuple_GET_SIZE(__pyx_args) != 3) { goto __pyx_L5_argtuple_error; } else { values[0] = PyTuple_GET_ITEM(__pyx_args, 0); values[1] = PyTuple_GET_ITEM(__pyx_args, 1); values[2] = PyTuple_GET_ITEM(__pyx_args, 2); } __pyx_v_surface = ((struct __pyx_obj_11pygame_sdl2_7surface_Surface *)values[0]); __pyx_v_points = values[1]; __pyx_v_color = values[2]; } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("polygon", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 138; __pyx_clineno = __LINE__; goto __pyx_L3_error;} __pyx_L3_error:; __Pyx_AddTraceback("pygame_sdl2.gfxdraw.polygon", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_surface), __pyx_ptype_11pygame_sdl2_7surface_Surface, 1, "surface", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 138; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_r = __pyx_pf_11pygame_sdl2_7gfxdraw_44polygon(__pyx_self, __pyx_v_surface, __pyx_v_points, __pyx_v_color); /* function exit code */ goto __pyx_L0; __pyx_L1_error:; __pyx_r = NULL; __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_7gfxdraw_44polygon(CYTHON_UNUSED PyObject *__pyx_self, struct __pyx_obj_11pygame_sdl2_7surface_Surface *__pyx_v_surface, PyObject *__pyx_v_points, PyObject *__pyx_v_color) { struct __pyx_obj_11pygame_sdl2_5color_Color *__pyx_v_c = 0; Sint16 *__pyx_v_vx; Sint16 *__pyx_v_vy; size_t __pyx_v_num_points; PyObject *__pyx_v_n = NULL; CYTHON_UNUSED PyObject *__pyx_v_pt = NULL; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; Py_ssize_t __pyx_t_3; PyObject *(*__pyx_t_4)(PyObject *); PyObject *__pyx_t_5 = NULL; PyObject *__pyx_t_6 = NULL; PyObject *__pyx_t_7 = NULL; PyObject *(*__pyx_t_8)(PyObject *); Sint16 __pyx_t_9; Sint16 __pyx_t_10; Py_ssize_t __pyx_t_11; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("polygon", 0); /* "pygame_sdl2/gfxdraw.pyx":139 * * def polygon(Surface surface, points, color): * cdef Color c = Color(color) # <<<<<<<<<<<<<< * cdef Sint16 *vx * cdef Sint16 *vy */ __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 139; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __Pyx_INCREF(__pyx_v_color); __Pyx_GIVEREF(__pyx_v_color); PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_color); __pyx_t_2 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_11pygame_sdl2_5color_Color), __pyx_t_1, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 139; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_v_c = ((struct __pyx_obj_11pygame_sdl2_5color_Color *)__pyx_t_2); __pyx_t_2 = 0; /* "pygame_sdl2/gfxdraw.pyx":142 * cdef Sint16 *vx * cdef Sint16 *vy * cdef size_t num_points = len(points) # <<<<<<<<<<<<<< * vx = malloc(num_points * sizeof(Sint16)) * vy = malloc(num_points * sizeof(Sint16)) */ __pyx_t_3 = PyObject_Length(__pyx_v_points); if (unlikely(__pyx_t_3 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 142; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_v_num_points = __pyx_t_3; /* "pygame_sdl2/gfxdraw.pyx":143 * cdef Sint16 *vy * cdef size_t num_points = len(points) * vx = malloc(num_points * sizeof(Sint16)) # <<<<<<<<<<<<<< * vy = malloc(num_points * sizeof(Sint16)) * for n, pt in zip(range(num_points), points): */ __pyx_v_vx = ((Sint16 *)malloc((__pyx_v_num_points * (sizeof(Sint16))))); /* "pygame_sdl2/gfxdraw.pyx":144 * cdef size_t num_points = len(points) * vx = malloc(num_points * sizeof(Sint16)) * vy = malloc(num_points * sizeof(Sint16)) # <<<<<<<<<<<<<< * for n, pt in zip(range(num_points), points): * vx[n], vy[n] = points[n] */ __pyx_v_vy = ((Sint16 *)malloc((__pyx_v_num_points * (sizeof(Sint16))))); /* "pygame_sdl2/gfxdraw.pyx":145 * vx = malloc(num_points * sizeof(Sint16)) * vy = malloc(num_points * sizeof(Sint16)) * for n, pt in zip(range(num_points), points): # <<<<<<<<<<<<<< * vx[n], vy[n] = points[n] * polygonRGBA(surface.surface, vx, vy, num_points, c.r, c.g, c.b, c.a) */ __pyx_t_2 = __Pyx_PyInt_FromSize_t(__pyx_v_num_points); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 145; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 145; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __Pyx_GIVEREF(__pyx_t_2); PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_2); __pyx_t_2 = 0; __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_range, __pyx_t_1, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 145; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 145; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __Pyx_GIVEREF(__pyx_t_2); PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_2); __Pyx_INCREF(__pyx_v_points); __Pyx_GIVEREF(__pyx_v_points); PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_v_points); __pyx_t_2 = 0; __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_zip, __pyx_t_1, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 145; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (likely(PyList_CheckExact(__pyx_t_2)) || PyTuple_CheckExact(__pyx_t_2)) { __pyx_t_1 = __pyx_t_2; __Pyx_INCREF(__pyx_t_1); __pyx_t_3 = 0; __pyx_t_4 = NULL; } else { __pyx_t_3 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_t_2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 145; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_t_4 = Py_TYPE(__pyx_t_1)->tp_iternext; if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 145; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; for (;;) { if (likely(!__pyx_t_4)) { if (likely(PyList_CheckExact(__pyx_t_1))) { if (__pyx_t_3 >= PyList_GET_SIZE(__pyx_t_1)) break; #if CYTHON_COMPILING_IN_CPYTHON __pyx_t_2 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_3); __Pyx_INCREF(__pyx_t_2); __pyx_t_3++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 145; __pyx_clineno = __LINE__; goto __pyx_L1_error;} #else __pyx_t_2 = PySequence_ITEM(__pyx_t_1, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 145; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); #endif } else { if (__pyx_t_3 >= PyTuple_GET_SIZE(__pyx_t_1)) break; #if CYTHON_COMPILING_IN_CPYTHON __pyx_t_2 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_3); __Pyx_INCREF(__pyx_t_2); __pyx_t_3++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 145; __pyx_clineno = __LINE__; goto __pyx_L1_error;} #else __pyx_t_2 = PySequence_ITEM(__pyx_t_1, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 145; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); #endif } } else { __pyx_t_2 = __pyx_t_4(__pyx_t_1); if (unlikely(!__pyx_t_2)) { PyObject* exc_type = PyErr_Occurred(); if (exc_type) { if (likely(exc_type == PyExc_StopIteration || PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); else {__pyx_filename = __pyx_f[0]; __pyx_lineno = 145; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } break; } __Pyx_GOTREF(__pyx_t_2); } if ((likely(PyTuple_CheckExact(__pyx_t_2))) || (PyList_CheckExact(__pyx_t_2))) { PyObject* sequence = __pyx_t_2; #if CYTHON_COMPILING_IN_CPYTHON Py_ssize_t size = Py_SIZE(sequence); #else Py_ssize_t size = PySequence_Size(sequence); #endif if (unlikely(size != 2)) { if (size > 2) __Pyx_RaiseTooManyValuesError(2); else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 145; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } #if CYTHON_COMPILING_IN_CPYTHON if (likely(PyTuple_CheckExact(sequence))) { __pyx_t_5 = PyTuple_GET_ITEM(sequence, 0); __pyx_t_6 = PyTuple_GET_ITEM(sequence, 1); } else { __pyx_t_5 = PyList_GET_ITEM(sequence, 0); __pyx_t_6 = PyList_GET_ITEM(sequence, 1); } __Pyx_INCREF(__pyx_t_5); __Pyx_INCREF(__pyx_t_6); #else __pyx_t_5 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 145; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); __pyx_t_6 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 145; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_6); #endif __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } else { Py_ssize_t index = -1; __pyx_t_7 = PyObject_GetIter(__pyx_t_2); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 145; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_8 = Py_TYPE(__pyx_t_7)->tp_iternext; index = 0; __pyx_t_5 = __pyx_t_8(__pyx_t_7); if (unlikely(!__pyx_t_5)) goto __pyx_L5_unpacking_failed; __Pyx_GOTREF(__pyx_t_5); index = 1; __pyx_t_6 = __pyx_t_8(__pyx_t_7); if (unlikely(!__pyx_t_6)) goto __pyx_L5_unpacking_failed; __Pyx_GOTREF(__pyx_t_6); if (__Pyx_IternextUnpackEndCheck(__pyx_t_8(__pyx_t_7), 2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 145; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_t_8 = NULL; __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; goto __pyx_L6_unpacking_done; __pyx_L5_unpacking_failed:; __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __pyx_t_8 = NULL; if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 145; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_L6_unpacking_done:; } __Pyx_XDECREF_SET(__pyx_v_n, __pyx_t_5); __pyx_t_5 = 0; __Pyx_XDECREF_SET(__pyx_v_pt, __pyx_t_6); __pyx_t_6 = 0; /* "pygame_sdl2/gfxdraw.pyx":146 * vy = malloc(num_points * sizeof(Sint16)) * for n, pt in zip(range(num_points), points): * vx[n], vy[n] = points[n] # <<<<<<<<<<<<<< * polygonRGBA(surface.surface, vx, vy, num_points, c.r, c.g, c.b, c.a) * free(vx) */ __pyx_t_2 = PyObject_GetItem(__pyx_v_points, __pyx_v_n); if (unlikely(__pyx_t_2 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 146; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; __Pyx_GOTREF(__pyx_t_2); if ((likely(PyTuple_CheckExact(__pyx_t_2))) || (PyList_CheckExact(__pyx_t_2))) { PyObject* sequence = __pyx_t_2; #if CYTHON_COMPILING_IN_CPYTHON Py_ssize_t size = Py_SIZE(sequence); #else Py_ssize_t size = PySequence_Size(sequence); #endif if (unlikely(size != 2)) { if (size > 2) __Pyx_RaiseTooManyValuesError(2); else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 146; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } #if CYTHON_COMPILING_IN_CPYTHON if (likely(PyTuple_CheckExact(sequence))) { __pyx_t_6 = PyTuple_GET_ITEM(sequence, 0); __pyx_t_5 = PyTuple_GET_ITEM(sequence, 1); } else { __pyx_t_6 = PyList_GET_ITEM(sequence, 0); __pyx_t_5 = PyList_GET_ITEM(sequence, 1); } __Pyx_INCREF(__pyx_t_6); __Pyx_INCREF(__pyx_t_5); #else __pyx_t_6 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 146; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_6); __pyx_t_5 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 146; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); #endif __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } else { Py_ssize_t index = -1; __pyx_t_7 = PyObject_GetIter(__pyx_t_2); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 146; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_8 = Py_TYPE(__pyx_t_7)->tp_iternext; index = 0; __pyx_t_6 = __pyx_t_8(__pyx_t_7); if (unlikely(!__pyx_t_6)) goto __pyx_L7_unpacking_failed; __Pyx_GOTREF(__pyx_t_6); index = 1; __pyx_t_5 = __pyx_t_8(__pyx_t_7); if (unlikely(!__pyx_t_5)) goto __pyx_L7_unpacking_failed; __Pyx_GOTREF(__pyx_t_5); if (__Pyx_IternextUnpackEndCheck(__pyx_t_8(__pyx_t_7), 2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 146; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_t_8 = NULL; __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; goto __pyx_L8_unpacking_done; __pyx_L7_unpacking_failed:; __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __pyx_t_8 = NULL; if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 146; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_L8_unpacking_done:; } __pyx_t_9 = __Pyx_PyInt_As_int16_t(__pyx_t_6); if (unlikely((__pyx_t_9 == (Sint16)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 146; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __pyx_t_10 = __Pyx_PyInt_As_int16_t(__pyx_t_5); if (unlikely((__pyx_t_10 == (Sint16)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 146; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __pyx_t_11 = __Pyx_PyIndex_AsSsize_t(__pyx_v_n); if (unlikely((__pyx_t_11 == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 146; __pyx_clineno = __LINE__; goto __pyx_L1_error;} (__pyx_v_vx[__pyx_t_11]) = __pyx_t_9; __pyx_t_11 = __Pyx_PyIndex_AsSsize_t(__pyx_v_n); if (unlikely((__pyx_t_11 == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 146; __pyx_clineno = __LINE__; goto __pyx_L1_error;} (__pyx_v_vy[__pyx_t_11]) = __pyx_t_10; /* "pygame_sdl2/gfxdraw.pyx":145 * vx = malloc(num_points * sizeof(Sint16)) * vy = malloc(num_points * sizeof(Sint16)) * for n, pt in zip(range(num_points), points): # <<<<<<<<<<<<<< * vx[n], vy[n] = points[n] * polygonRGBA(surface.surface, vx, vy, num_points, c.r, c.g, c.b, c.a) */ } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "pygame_sdl2/gfxdraw.pyx":147 * for n, pt in zip(range(num_points), points): * vx[n], vy[n] = points[n] * polygonRGBA(surface.surface, vx, vy, num_points, c.r, c.g, c.b, c.a) # <<<<<<<<<<<<<< * free(vx) * free(vy) */ polygonRGBA(__pyx_v_surface->surface, __pyx_v_vx, __pyx_v_vy, __pyx_v_num_points, __pyx_v_c->r, __pyx_v_c->g, __pyx_v_c->b, __pyx_v_c->a); /* "pygame_sdl2/gfxdraw.pyx":148 * vx[n], vy[n] = points[n] * polygonRGBA(surface.surface, vx, vy, num_points, c.r, c.g, c.b, c.a) * free(vx) # <<<<<<<<<<<<<< * free(vy) * */ free(__pyx_v_vx); /* "pygame_sdl2/gfxdraw.pyx":149 * polygonRGBA(surface.surface, vx, vy, num_points, c.r, c.g, c.b, c.a) * free(vx) * free(vy) # <<<<<<<<<<<<<< * * def aapolygon(Surface surface, points, color): */ free(__pyx_v_vy); /* "pygame_sdl2/gfxdraw.pyx":138 * filledTrigonRGBA(surface.surface, x1, y1, x2, y2, x3, y3, c.r, c.g, c.b, c.a) * * def polygon(Surface surface, points, color): # <<<<<<<<<<<<<< * cdef Color c = Color(color) * cdef Sint16 *vx */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_5); __Pyx_XDECREF(__pyx_t_6); __Pyx_XDECREF(__pyx_t_7); __Pyx_AddTraceback("pygame_sdl2.gfxdraw.polygon", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF((PyObject *)__pyx_v_c); __Pyx_XDECREF(__pyx_v_n); __Pyx_XDECREF(__pyx_v_pt); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/gfxdraw.pyx":151 * free(vy) * * def aapolygon(Surface surface, points, color): # <<<<<<<<<<<<<< * cdef Color c = Color(color) * cdef Sint16 *vx */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_7gfxdraw_47aapolygon(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static PyMethodDef __pyx_mdef_11pygame_sdl2_7gfxdraw_47aapolygon = {"aapolygon", (PyCFunction)__pyx_pw_11pygame_sdl2_7gfxdraw_47aapolygon, METH_VARARGS|METH_KEYWORDS, 0}; static PyObject *__pyx_pw_11pygame_sdl2_7gfxdraw_47aapolygon(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { struct __pyx_obj_11pygame_sdl2_7surface_Surface *__pyx_v_surface = 0; PyObject *__pyx_v_points = 0; PyObject *__pyx_v_color = 0; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("aapolygon (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_surface,&__pyx_n_s_points,&__pyx_n_s_color,0}; PyObject* values[3] = {0,0,0}; if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_surface)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; case 1: if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_points)) != 0)) kw_args--; else { __Pyx_RaiseArgtupleInvalid("aapolygon", 1, 3, 3, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 151; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } case 2: if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_color)) != 0)) kw_args--; else { __Pyx_RaiseArgtupleInvalid("aapolygon", 1, 3, 3, 2); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 151; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "aapolygon") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 151; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } } else if (PyTuple_GET_SIZE(__pyx_args) != 3) { goto __pyx_L5_argtuple_error; } else { values[0] = PyTuple_GET_ITEM(__pyx_args, 0); values[1] = PyTuple_GET_ITEM(__pyx_args, 1); values[2] = PyTuple_GET_ITEM(__pyx_args, 2); } __pyx_v_surface = ((struct __pyx_obj_11pygame_sdl2_7surface_Surface *)values[0]); __pyx_v_points = values[1]; __pyx_v_color = values[2]; } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("aapolygon", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 151; __pyx_clineno = __LINE__; goto __pyx_L3_error;} __pyx_L3_error:; __Pyx_AddTraceback("pygame_sdl2.gfxdraw.aapolygon", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_surface), __pyx_ptype_11pygame_sdl2_7surface_Surface, 1, "surface", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 151; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_r = __pyx_pf_11pygame_sdl2_7gfxdraw_46aapolygon(__pyx_self, __pyx_v_surface, __pyx_v_points, __pyx_v_color); /* function exit code */ goto __pyx_L0; __pyx_L1_error:; __pyx_r = NULL; __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_7gfxdraw_46aapolygon(CYTHON_UNUSED PyObject *__pyx_self, struct __pyx_obj_11pygame_sdl2_7surface_Surface *__pyx_v_surface, PyObject *__pyx_v_points, PyObject *__pyx_v_color) { struct __pyx_obj_11pygame_sdl2_5color_Color *__pyx_v_c = 0; Sint16 *__pyx_v_vx; Sint16 *__pyx_v_vy; size_t __pyx_v_num_points; PyObject *__pyx_v_n = NULL; CYTHON_UNUSED PyObject *__pyx_v_pt = NULL; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; Py_ssize_t __pyx_t_3; PyObject *(*__pyx_t_4)(PyObject *); PyObject *__pyx_t_5 = NULL; PyObject *__pyx_t_6 = NULL; PyObject *__pyx_t_7 = NULL; PyObject *(*__pyx_t_8)(PyObject *); Sint16 __pyx_t_9; Sint16 __pyx_t_10; Py_ssize_t __pyx_t_11; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("aapolygon", 0); /* "pygame_sdl2/gfxdraw.pyx":152 * * def aapolygon(Surface surface, points, color): * cdef Color c = Color(color) # <<<<<<<<<<<<<< * cdef Sint16 *vx * cdef Sint16 *vy */ __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 152; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __Pyx_INCREF(__pyx_v_color); __Pyx_GIVEREF(__pyx_v_color); PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_color); __pyx_t_2 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_11pygame_sdl2_5color_Color), __pyx_t_1, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 152; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_v_c = ((struct __pyx_obj_11pygame_sdl2_5color_Color *)__pyx_t_2); __pyx_t_2 = 0; /* "pygame_sdl2/gfxdraw.pyx":155 * cdef Sint16 *vx * cdef Sint16 *vy * cdef size_t num_points = len(points) # <<<<<<<<<<<<<< * vx = malloc(num_points * sizeof(Sint16)) * vy = malloc(num_points * sizeof(Sint16)) */ __pyx_t_3 = PyObject_Length(__pyx_v_points); if (unlikely(__pyx_t_3 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 155; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_v_num_points = __pyx_t_3; /* "pygame_sdl2/gfxdraw.pyx":156 * cdef Sint16 *vy * cdef size_t num_points = len(points) * vx = malloc(num_points * sizeof(Sint16)) # <<<<<<<<<<<<<< * vy = malloc(num_points * sizeof(Sint16)) * for n, pt in zip(range(num_points), points): */ __pyx_v_vx = ((Sint16 *)malloc((__pyx_v_num_points * (sizeof(Sint16))))); /* "pygame_sdl2/gfxdraw.pyx":157 * cdef size_t num_points = len(points) * vx = malloc(num_points * sizeof(Sint16)) * vy = malloc(num_points * sizeof(Sint16)) # <<<<<<<<<<<<<< * for n, pt in zip(range(num_points), points): * vx[n], vy[n] = points[n] */ __pyx_v_vy = ((Sint16 *)malloc((__pyx_v_num_points * (sizeof(Sint16))))); /* "pygame_sdl2/gfxdraw.pyx":158 * vx = malloc(num_points * sizeof(Sint16)) * vy = malloc(num_points * sizeof(Sint16)) * for n, pt in zip(range(num_points), points): # <<<<<<<<<<<<<< * vx[n], vy[n] = points[n] * aapolygonRGBA(surface.surface, vx, vy, num_points, c.r, c.g, c.b, c.a) */ __pyx_t_2 = __Pyx_PyInt_FromSize_t(__pyx_v_num_points); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 158; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 158; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __Pyx_GIVEREF(__pyx_t_2); PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_2); __pyx_t_2 = 0; __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_range, __pyx_t_1, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 158; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 158; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __Pyx_GIVEREF(__pyx_t_2); PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_2); __Pyx_INCREF(__pyx_v_points); __Pyx_GIVEREF(__pyx_v_points); PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_v_points); __pyx_t_2 = 0; __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_zip, __pyx_t_1, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 158; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (likely(PyList_CheckExact(__pyx_t_2)) || PyTuple_CheckExact(__pyx_t_2)) { __pyx_t_1 = __pyx_t_2; __Pyx_INCREF(__pyx_t_1); __pyx_t_3 = 0; __pyx_t_4 = NULL; } else { __pyx_t_3 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_t_2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 158; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_t_4 = Py_TYPE(__pyx_t_1)->tp_iternext; if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 158; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; for (;;) { if (likely(!__pyx_t_4)) { if (likely(PyList_CheckExact(__pyx_t_1))) { if (__pyx_t_3 >= PyList_GET_SIZE(__pyx_t_1)) break; #if CYTHON_COMPILING_IN_CPYTHON __pyx_t_2 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_3); __Pyx_INCREF(__pyx_t_2); __pyx_t_3++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 158; __pyx_clineno = __LINE__; goto __pyx_L1_error;} #else __pyx_t_2 = PySequence_ITEM(__pyx_t_1, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 158; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); #endif } else { if (__pyx_t_3 >= PyTuple_GET_SIZE(__pyx_t_1)) break; #if CYTHON_COMPILING_IN_CPYTHON __pyx_t_2 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_3); __Pyx_INCREF(__pyx_t_2); __pyx_t_3++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 158; __pyx_clineno = __LINE__; goto __pyx_L1_error;} #else __pyx_t_2 = PySequence_ITEM(__pyx_t_1, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 158; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); #endif } } else { __pyx_t_2 = __pyx_t_4(__pyx_t_1); if (unlikely(!__pyx_t_2)) { PyObject* exc_type = PyErr_Occurred(); if (exc_type) { if (likely(exc_type == PyExc_StopIteration || PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); else {__pyx_filename = __pyx_f[0]; __pyx_lineno = 158; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } break; } __Pyx_GOTREF(__pyx_t_2); } if ((likely(PyTuple_CheckExact(__pyx_t_2))) || (PyList_CheckExact(__pyx_t_2))) { PyObject* sequence = __pyx_t_2; #if CYTHON_COMPILING_IN_CPYTHON Py_ssize_t size = Py_SIZE(sequence); #else Py_ssize_t size = PySequence_Size(sequence); #endif if (unlikely(size != 2)) { if (size > 2) __Pyx_RaiseTooManyValuesError(2); else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 158; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } #if CYTHON_COMPILING_IN_CPYTHON if (likely(PyTuple_CheckExact(sequence))) { __pyx_t_5 = PyTuple_GET_ITEM(sequence, 0); __pyx_t_6 = PyTuple_GET_ITEM(sequence, 1); } else { __pyx_t_5 = PyList_GET_ITEM(sequence, 0); __pyx_t_6 = PyList_GET_ITEM(sequence, 1); } __Pyx_INCREF(__pyx_t_5); __Pyx_INCREF(__pyx_t_6); #else __pyx_t_5 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 158; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); __pyx_t_6 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 158; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_6); #endif __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } else { Py_ssize_t index = -1; __pyx_t_7 = PyObject_GetIter(__pyx_t_2); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 158; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_8 = Py_TYPE(__pyx_t_7)->tp_iternext; index = 0; __pyx_t_5 = __pyx_t_8(__pyx_t_7); if (unlikely(!__pyx_t_5)) goto __pyx_L5_unpacking_failed; __Pyx_GOTREF(__pyx_t_5); index = 1; __pyx_t_6 = __pyx_t_8(__pyx_t_7); if (unlikely(!__pyx_t_6)) goto __pyx_L5_unpacking_failed; __Pyx_GOTREF(__pyx_t_6); if (__Pyx_IternextUnpackEndCheck(__pyx_t_8(__pyx_t_7), 2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 158; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_t_8 = NULL; __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; goto __pyx_L6_unpacking_done; __pyx_L5_unpacking_failed:; __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __pyx_t_8 = NULL; if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 158; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_L6_unpacking_done:; } __Pyx_XDECREF_SET(__pyx_v_n, __pyx_t_5); __pyx_t_5 = 0; __Pyx_XDECREF_SET(__pyx_v_pt, __pyx_t_6); __pyx_t_6 = 0; /* "pygame_sdl2/gfxdraw.pyx":159 * vy = malloc(num_points * sizeof(Sint16)) * for n, pt in zip(range(num_points), points): * vx[n], vy[n] = points[n] # <<<<<<<<<<<<<< * aapolygonRGBA(surface.surface, vx, vy, num_points, c.r, c.g, c.b, c.a) * free(vx) */ __pyx_t_2 = PyObject_GetItem(__pyx_v_points, __pyx_v_n); if (unlikely(__pyx_t_2 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 159; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; __Pyx_GOTREF(__pyx_t_2); if ((likely(PyTuple_CheckExact(__pyx_t_2))) || (PyList_CheckExact(__pyx_t_2))) { PyObject* sequence = __pyx_t_2; #if CYTHON_COMPILING_IN_CPYTHON Py_ssize_t size = Py_SIZE(sequence); #else Py_ssize_t size = PySequence_Size(sequence); #endif if (unlikely(size != 2)) { if (size > 2) __Pyx_RaiseTooManyValuesError(2); else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 159; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } #if CYTHON_COMPILING_IN_CPYTHON if (likely(PyTuple_CheckExact(sequence))) { __pyx_t_6 = PyTuple_GET_ITEM(sequence, 0); __pyx_t_5 = PyTuple_GET_ITEM(sequence, 1); } else { __pyx_t_6 = PyList_GET_ITEM(sequence, 0); __pyx_t_5 = PyList_GET_ITEM(sequence, 1); } __Pyx_INCREF(__pyx_t_6); __Pyx_INCREF(__pyx_t_5); #else __pyx_t_6 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 159; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_6); __pyx_t_5 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 159; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); #endif __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } else { Py_ssize_t index = -1; __pyx_t_7 = PyObject_GetIter(__pyx_t_2); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 159; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_8 = Py_TYPE(__pyx_t_7)->tp_iternext; index = 0; __pyx_t_6 = __pyx_t_8(__pyx_t_7); if (unlikely(!__pyx_t_6)) goto __pyx_L7_unpacking_failed; __Pyx_GOTREF(__pyx_t_6); index = 1; __pyx_t_5 = __pyx_t_8(__pyx_t_7); if (unlikely(!__pyx_t_5)) goto __pyx_L7_unpacking_failed; __Pyx_GOTREF(__pyx_t_5); if (__Pyx_IternextUnpackEndCheck(__pyx_t_8(__pyx_t_7), 2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 159; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_t_8 = NULL; __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; goto __pyx_L8_unpacking_done; __pyx_L7_unpacking_failed:; __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __pyx_t_8 = NULL; if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 159; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_L8_unpacking_done:; } __pyx_t_9 = __Pyx_PyInt_As_int16_t(__pyx_t_6); if (unlikely((__pyx_t_9 == (Sint16)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 159; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __pyx_t_10 = __Pyx_PyInt_As_int16_t(__pyx_t_5); if (unlikely((__pyx_t_10 == (Sint16)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 159; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __pyx_t_11 = __Pyx_PyIndex_AsSsize_t(__pyx_v_n); if (unlikely((__pyx_t_11 == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 159; __pyx_clineno = __LINE__; goto __pyx_L1_error;} (__pyx_v_vx[__pyx_t_11]) = __pyx_t_9; __pyx_t_11 = __Pyx_PyIndex_AsSsize_t(__pyx_v_n); if (unlikely((__pyx_t_11 == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 159; __pyx_clineno = __LINE__; goto __pyx_L1_error;} (__pyx_v_vy[__pyx_t_11]) = __pyx_t_10; /* "pygame_sdl2/gfxdraw.pyx":158 * vx = malloc(num_points * sizeof(Sint16)) * vy = malloc(num_points * sizeof(Sint16)) * for n, pt in zip(range(num_points), points): # <<<<<<<<<<<<<< * vx[n], vy[n] = points[n] * aapolygonRGBA(surface.surface, vx, vy, num_points, c.r, c.g, c.b, c.a) */ } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "pygame_sdl2/gfxdraw.pyx":160 * for n, pt in zip(range(num_points), points): * vx[n], vy[n] = points[n] * aapolygonRGBA(surface.surface, vx, vy, num_points, c.r, c.g, c.b, c.a) # <<<<<<<<<<<<<< * free(vx) * free(vy) */ aapolygonRGBA(__pyx_v_surface->surface, __pyx_v_vx, __pyx_v_vy, __pyx_v_num_points, __pyx_v_c->r, __pyx_v_c->g, __pyx_v_c->b, __pyx_v_c->a); /* "pygame_sdl2/gfxdraw.pyx":161 * vx[n], vy[n] = points[n] * aapolygonRGBA(surface.surface, vx, vy, num_points, c.r, c.g, c.b, c.a) * free(vx) # <<<<<<<<<<<<<< * free(vy) * */ free(__pyx_v_vx); /* "pygame_sdl2/gfxdraw.pyx":162 * aapolygonRGBA(surface.surface, vx, vy, num_points, c.r, c.g, c.b, c.a) * free(vx) * free(vy) # <<<<<<<<<<<<<< * * def filled_polygon(Surface surface, points, color): */ free(__pyx_v_vy); /* "pygame_sdl2/gfxdraw.pyx":151 * free(vy) * * def aapolygon(Surface surface, points, color): # <<<<<<<<<<<<<< * cdef Color c = Color(color) * cdef Sint16 *vx */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_5); __Pyx_XDECREF(__pyx_t_6); __Pyx_XDECREF(__pyx_t_7); __Pyx_AddTraceback("pygame_sdl2.gfxdraw.aapolygon", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF((PyObject *)__pyx_v_c); __Pyx_XDECREF(__pyx_v_n); __Pyx_XDECREF(__pyx_v_pt); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/gfxdraw.pyx":164 * free(vy) * * def filled_polygon(Surface surface, points, color): # <<<<<<<<<<<<<< * cdef Color c = Color(color) * cdef Sint16 *vx */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_7gfxdraw_49filled_polygon(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static PyMethodDef __pyx_mdef_11pygame_sdl2_7gfxdraw_49filled_polygon = {"filled_polygon", (PyCFunction)__pyx_pw_11pygame_sdl2_7gfxdraw_49filled_polygon, METH_VARARGS|METH_KEYWORDS, 0}; static PyObject *__pyx_pw_11pygame_sdl2_7gfxdraw_49filled_polygon(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { struct __pyx_obj_11pygame_sdl2_7surface_Surface *__pyx_v_surface = 0; PyObject *__pyx_v_points = 0; PyObject *__pyx_v_color = 0; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("filled_polygon (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_surface,&__pyx_n_s_points,&__pyx_n_s_color,0}; PyObject* values[3] = {0,0,0}; if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_surface)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; case 1: if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_points)) != 0)) kw_args--; else { __Pyx_RaiseArgtupleInvalid("filled_polygon", 1, 3, 3, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 164; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } case 2: if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_color)) != 0)) kw_args--; else { __Pyx_RaiseArgtupleInvalid("filled_polygon", 1, 3, 3, 2); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 164; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "filled_polygon") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 164; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } } else if (PyTuple_GET_SIZE(__pyx_args) != 3) { goto __pyx_L5_argtuple_error; } else { values[0] = PyTuple_GET_ITEM(__pyx_args, 0); values[1] = PyTuple_GET_ITEM(__pyx_args, 1); values[2] = PyTuple_GET_ITEM(__pyx_args, 2); } __pyx_v_surface = ((struct __pyx_obj_11pygame_sdl2_7surface_Surface *)values[0]); __pyx_v_points = values[1]; __pyx_v_color = values[2]; } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("filled_polygon", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 164; __pyx_clineno = __LINE__; goto __pyx_L3_error;} __pyx_L3_error:; __Pyx_AddTraceback("pygame_sdl2.gfxdraw.filled_polygon", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_surface), __pyx_ptype_11pygame_sdl2_7surface_Surface, 1, "surface", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 164; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_r = __pyx_pf_11pygame_sdl2_7gfxdraw_48filled_polygon(__pyx_self, __pyx_v_surface, __pyx_v_points, __pyx_v_color); /* function exit code */ goto __pyx_L0; __pyx_L1_error:; __pyx_r = NULL; __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_7gfxdraw_48filled_polygon(CYTHON_UNUSED PyObject *__pyx_self, struct __pyx_obj_11pygame_sdl2_7surface_Surface *__pyx_v_surface, PyObject *__pyx_v_points, PyObject *__pyx_v_color) { struct __pyx_obj_11pygame_sdl2_5color_Color *__pyx_v_c = 0; Sint16 *__pyx_v_vx; Sint16 *__pyx_v_vy; size_t __pyx_v_num_points; PyObject *__pyx_v_n = NULL; CYTHON_UNUSED PyObject *__pyx_v_pt = NULL; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; Py_ssize_t __pyx_t_3; PyObject *(*__pyx_t_4)(PyObject *); PyObject *__pyx_t_5 = NULL; PyObject *__pyx_t_6 = NULL; PyObject *__pyx_t_7 = NULL; PyObject *(*__pyx_t_8)(PyObject *); Sint16 __pyx_t_9; Sint16 __pyx_t_10; Py_ssize_t __pyx_t_11; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("filled_polygon", 0); /* "pygame_sdl2/gfxdraw.pyx":165 * * def filled_polygon(Surface surface, points, color): * cdef Color c = Color(color) # <<<<<<<<<<<<<< * cdef Sint16 *vx * cdef Sint16 *vy */ __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 165; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __Pyx_INCREF(__pyx_v_color); __Pyx_GIVEREF(__pyx_v_color); PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_color); __pyx_t_2 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_11pygame_sdl2_5color_Color), __pyx_t_1, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 165; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_v_c = ((struct __pyx_obj_11pygame_sdl2_5color_Color *)__pyx_t_2); __pyx_t_2 = 0; /* "pygame_sdl2/gfxdraw.pyx":168 * cdef Sint16 *vx * cdef Sint16 *vy * cdef size_t num_points = len(points) # <<<<<<<<<<<<<< * vx = malloc(num_points * sizeof(Sint16)) * vy = malloc(num_points * sizeof(Sint16)) */ __pyx_t_3 = PyObject_Length(__pyx_v_points); if (unlikely(__pyx_t_3 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 168; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_v_num_points = __pyx_t_3; /* "pygame_sdl2/gfxdraw.pyx":169 * cdef Sint16 *vy * cdef size_t num_points = len(points) * vx = malloc(num_points * sizeof(Sint16)) # <<<<<<<<<<<<<< * vy = malloc(num_points * sizeof(Sint16)) * for n, pt in zip(range(num_points), points): */ __pyx_v_vx = ((Sint16 *)malloc((__pyx_v_num_points * (sizeof(Sint16))))); /* "pygame_sdl2/gfxdraw.pyx":170 * cdef size_t num_points = len(points) * vx = malloc(num_points * sizeof(Sint16)) * vy = malloc(num_points * sizeof(Sint16)) # <<<<<<<<<<<<<< * for n, pt in zip(range(num_points), points): * vx[n], vy[n] = points[n] */ __pyx_v_vy = ((Sint16 *)malloc((__pyx_v_num_points * (sizeof(Sint16))))); /* "pygame_sdl2/gfxdraw.pyx":171 * vx = malloc(num_points * sizeof(Sint16)) * vy = malloc(num_points * sizeof(Sint16)) * for n, pt in zip(range(num_points), points): # <<<<<<<<<<<<<< * vx[n], vy[n] = points[n] * filledPolygonRGBA(surface.surface, vx, vy, num_points, c.r, c.g, c.b, c.a) */ __pyx_t_2 = __Pyx_PyInt_FromSize_t(__pyx_v_num_points); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 171; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 171; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __Pyx_GIVEREF(__pyx_t_2); PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_2); __pyx_t_2 = 0; __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_range, __pyx_t_1, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 171; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 171; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __Pyx_GIVEREF(__pyx_t_2); PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_2); __Pyx_INCREF(__pyx_v_points); __Pyx_GIVEREF(__pyx_v_points); PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_v_points); __pyx_t_2 = 0; __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_zip, __pyx_t_1, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 171; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (likely(PyList_CheckExact(__pyx_t_2)) || PyTuple_CheckExact(__pyx_t_2)) { __pyx_t_1 = __pyx_t_2; __Pyx_INCREF(__pyx_t_1); __pyx_t_3 = 0; __pyx_t_4 = NULL; } else { __pyx_t_3 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_t_2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 171; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_t_4 = Py_TYPE(__pyx_t_1)->tp_iternext; if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 171; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; for (;;) { if (likely(!__pyx_t_4)) { if (likely(PyList_CheckExact(__pyx_t_1))) { if (__pyx_t_3 >= PyList_GET_SIZE(__pyx_t_1)) break; #if CYTHON_COMPILING_IN_CPYTHON __pyx_t_2 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_3); __Pyx_INCREF(__pyx_t_2); __pyx_t_3++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 171; __pyx_clineno = __LINE__; goto __pyx_L1_error;} #else __pyx_t_2 = PySequence_ITEM(__pyx_t_1, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 171; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); #endif } else { if (__pyx_t_3 >= PyTuple_GET_SIZE(__pyx_t_1)) break; #if CYTHON_COMPILING_IN_CPYTHON __pyx_t_2 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_3); __Pyx_INCREF(__pyx_t_2); __pyx_t_3++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 171; __pyx_clineno = __LINE__; goto __pyx_L1_error;} #else __pyx_t_2 = PySequence_ITEM(__pyx_t_1, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 171; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); #endif } } else { __pyx_t_2 = __pyx_t_4(__pyx_t_1); if (unlikely(!__pyx_t_2)) { PyObject* exc_type = PyErr_Occurred(); if (exc_type) { if (likely(exc_type == PyExc_StopIteration || PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); else {__pyx_filename = __pyx_f[0]; __pyx_lineno = 171; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } break; } __Pyx_GOTREF(__pyx_t_2); } if ((likely(PyTuple_CheckExact(__pyx_t_2))) || (PyList_CheckExact(__pyx_t_2))) { PyObject* sequence = __pyx_t_2; #if CYTHON_COMPILING_IN_CPYTHON Py_ssize_t size = Py_SIZE(sequence); #else Py_ssize_t size = PySequence_Size(sequence); #endif if (unlikely(size != 2)) { if (size > 2) __Pyx_RaiseTooManyValuesError(2); else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 171; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } #if CYTHON_COMPILING_IN_CPYTHON if (likely(PyTuple_CheckExact(sequence))) { __pyx_t_5 = PyTuple_GET_ITEM(sequence, 0); __pyx_t_6 = PyTuple_GET_ITEM(sequence, 1); } else { __pyx_t_5 = PyList_GET_ITEM(sequence, 0); __pyx_t_6 = PyList_GET_ITEM(sequence, 1); } __Pyx_INCREF(__pyx_t_5); __Pyx_INCREF(__pyx_t_6); #else __pyx_t_5 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 171; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); __pyx_t_6 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 171; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_6); #endif __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } else { Py_ssize_t index = -1; __pyx_t_7 = PyObject_GetIter(__pyx_t_2); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 171; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_8 = Py_TYPE(__pyx_t_7)->tp_iternext; index = 0; __pyx_t_5 = __pyx_t_8(__pyx_t_7); if (unlikely(!__pyx_t_5)) goto __pyx_L5_unpacking_failed; __Pyx_GOTREF(__pyx_t_5); index = 1; __pyx_t_6 = __pyx_t_8(__pyx_t_7); if (unlikely(!__pyx_t_6)) goto __pyx_L5_unpacking_failed; __Pyx_GOTREF(__pyx_t_6); if (__Pyx_IternextUnpackEndCheck(__pyx_t_8(__pyx_t_7), 2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 171; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_t_8 = NULL; __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; goto __pyx_L6_unpacking_done; __pyx_L5_unpacking_failed:; __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __pyx_t_8 = NULL; if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 171; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_L6_unpacking_done:; } __Pyx_XDECREF_SET(__pyx_v_n, __pyx_t_5); __pyx_t_5 = 0; __Pyx_XDECREF_SET(__pyx_v_pt, __pyx_t_6); __pyx_t_6 = 0; /* "pygame_sdl2/gfxdraw.pyx":172 * vy = malloc(num_points * sizeof(Sint16)) * for n, pt in zip(range(num_points), points): * vx[n], vy[n] = points[n] # <<<<<<<<<<<<<< * filledPolygonRGBA(surface.surface, vx, vy, num_points, c.r, c.g, c.b, c.a) * free(vx) */ __pyx_t_2 = PyObject_GetItem(__pyx_v_points, __pyx_v_n); if (unlikely(__pyx_t_2 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 172; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; __Pyx_GOTREF(__pyx_t_2); if ((likely(PyTuple_CheckExact(__pyx_t_2))) || (PyList_CheckExact(__pyx_t_2))) { PyObject* sequence = __pyx_t_2; #if CYTHON_COMPILING_IN_CPYTHON Py_ssize_t size = Py_SIZE(sequence); #else Py_ssize_t size = PySequence_Size(sequence); #endif if (unlikely(size != 2)) { if (size > 2) __Pyx_RaiseTooManyValuesError(2); else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 172; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } #if CYTHON_COMPILING_IN_CPYTHON if (likely(PyTuple_CheckExact(sequence))) { __pyx_t_6 = PyTuple_GET_ITEM(sequence, 0); __pyx_t_5 = PyTuple_GET_ITEM(sequence, 1); } else { __pyx_t_6 = PyList_GET_ITEM(sequence, 0); __pyx_t_5 = PyList_GET_ITEM(sequence, 1); } __Pyx_INCREF(__pyx_t_6); __Pyx_INCREF(__pyx_t_5); #else __pyx_t_6 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 172; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_6); __pyx_t_5 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 172; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); #endif __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } else { Py_ssize_t index = -1; __pyx_t_7 = PyObject_GetIter(__pyx_t_2); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 172; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_8 = Py_TYPE(__pyx_t_7)->tp_iternext; index = 0; __pyx_t_6 = __pyx_t_8(__pyx_t_7); if (unlikely(!__pyx_t_6)) goto __pyx_L7_unpacking_failed; __Pyx_GOTREF(__pyx_t_6); index = 1; __pyx_t_5 = __pyx_t_8(__pyx_t_7); if (unlikely(!__pyx_t_5)) goto __pyx_L7_unpacking_failed; __Pyx_GOTREF(__pyx_t_5); if (__Pyx_IternextUnpackEndCheck(__pyx_t_8(__pyx_t_7), 2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 172; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_t_8 = NULL; __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; goto __pyx_L8_unpacking_done; __pyx_L7_unpacking_failed:; __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __pyx_t_8 = NULL; if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 172; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_L8_unpacking_done:; } __pyx_t_9 = __Pyx_PyInt_As_int16_t(__pyx_t_6); if (unlikely((__pyx_t_9 == (Sint16)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 172; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __pyx_t_10 = __Pyx_PyInt_As_int16_t(__pyx_t_5); if (unlikely((__pyx_t_10 == (Sint16)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 172; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __pyx_t_11 = __Pyx_PyIndex_AsSsize_t(__pyx_v_n); if (unlikely((__pyx_t_11 == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 172; __pyx_clineno = __LINE__; goto __pyx_L1_error;} (__pyx_v_vx[__pyx_t_11]) = __pyx_t_9; __pyx_t_11 = __Pyx_PyIndex_AsSsize_t(__pyx_v_n); if (unlikely((__pyx_t_11 == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 172; __pyx_clineno = __LINE__; goto __pyx_L1_error;} (__pyx_v_vy[__pyx_t_11]) = __pyx_t_10; /* "pygame_sdl2/gfxdraw.pyx":171 * vx = malloc(num_points * sizeof(Sint16)) * vy = malloc(num_points * sizeof(Sint16)) * for n, pt in zip(range(num_points), points): # <<<<<<<<<<<<<< * vx[n], vy[n] = points[n] * filledPolygonRGBA(surface.surface, vx, vy, num_points, c.r, c.g, c.b, c.a) */ } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "pygame_sdl2/gfxdraw.pyx":173 * for n, pt in zip(range(num_points), points): * vx[n], vy[n] = points[n] * filledPolygonRGBA(surface.surface, vx, vy, num_points, c.r, c.g, c.b, c.a) # <<<<<<<<<<<<<< * free(vx) * free(vy) */ filledPolygonRGBA(__pyx_v_surface->surface, __pyx_v_vx, __pyx_v_vy, __pyx_v_num_points, __pyx_v_c->r, __pyx_v_c->g, __pyx_v_c->b, __pyx_v_c->a); /* "pygame_sdl2/gfxdraw.pyx":174 * vx[n], vy[n] = points[n] * filledPolygonRGBA(surface.surface, vx, vy, num_points, c.r, c.g, c.b, c.a) * free(vx) # <<<<<<<<<<<<<< * free(vy) * */ free(__pyx_v_vx); /* "pygame_sdl2/gfxdraw.pyx":175 * filledPolygonRGBA(surface.surface, vx, vy, num_points, c.r, c.g, c.b, c.a) * free(vx) * free(vy) # <<<<<<<<<<<<<< * * def textured_polygon(Surface surface, points, Surface texture not None, tx, ty): */ free(__pyx_v_vy); /* "pygame_sdl2/gfxdraw.pyx":164 * free(vy) * * def filled_polygon(Surface surface, points, color): # <<<<<<<<<<<<<< * cdef Color c = Color(color) * cdef Sint16 *vx */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_5); __Pyx_XDECREF(__pyx_t_6); __Pyx_XDECREF(__pyx_t_7); __Pyx_AddTraceback("pygame_sdl2.gfxdraw.filled_polygon", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF((PyObject *)__pyx_v_c); __Pyx_XDECREF(__pyx_v_n); __Pyx_XDECREF(__pyx_v_pt); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/gfxdraw.pyx":177 * free(vy) * * def textured_polygon(Surface surface, points, Surface texture not None, tx, ty): # <<<<<<<<<<<<<< * cdef Sint16 *vx * cdef Sint16 *vy */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_7gfxdraw_51textured_polygon(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static PyMethodDef __pyx_mdef_11pygame_sdl2_7gfxdraw_51textured_polygon = {"textured_polygon", (PyCFunction)__pyx_pw_11pygame_sdl2_7gfxdraw_51textured_polygon, METH_VARARGS|METH_KEYWORDS, 0}; static PyObject *__pyx_pw_11pygame_sdl2_7gfxdraw_51textured_polygon(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { struct __pyx_obj_11pygame_sdl2_7surface_Surface *__pyx_v_surface = 0; PyObject *__pyx_v_points = 0; struct __pyx_obj_11pygame_sdl2_7surface_Surface *__pyx_v_texture = 0; PyObject *__pyx_v_tx = 0; PyObject *__pyx_v_ty = 0; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("textured_polygon (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_surface,&__pyx_n_s_points,&__pyx_n_s_texture,&__pyx_n_s_tx,&__pyx_n_s_ty,0}; PyObject* values[5] = {0,0,0,0,0}; if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4); case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_surface)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; case 1: if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_points)) != 0)) kw_args--; else { __Pyx_RaiseArgtupleInvalid("textured_polygon", 1, 5, 5, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 177; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } case 2: if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_texture)) != 0)) kw_args--; else { __Pyx_RaiseArgtupleInvalid("textured_polygon", 1, 5, 5, 2); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 177; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } case 3: if (likely((values[3] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_tx)) != 0)) kw_args--; else { __Pyx_RaiseArgtupleInvalid("textured_polygon", 1, 5, 5, 3); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 177; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } case 4: if (likely((values[4] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_ty)) != 0)) kw_args--; else { __Pyx_RaiseArgtupleInvalid("textured_polygon", 1, 5, 5, 4); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 177; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "textured_polygon") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 177; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } } else if (PyTuple_GET_SIZE(__pyx_args) != 5) { goto __pyx_L5_argtuple_error; } else { values[0] = PyTuple_GET_ITEM(__pyx_args, 0); values[1] = PyTuple_GET_ITEM(__pyx_args, 1); values[2] = PyTuple_GET_ITEM(__pyx_args, 2); values[3] = PyTuple_GET_ITEM(__pyx_args, 3); values[4] = PyTuple_GET_ITEM(__pyx_args, 4); } __pyx_v_surface = ((struct __pyx_obj_11pygame_sdl2_7surface_Surface *)values[0]); __pyx_v_points = values[1]; __pyx_v_texture = ((struct __pyx_obj_11pygame_sdl2_7surface_Surface *)values[2]); __pyx_v_tx = values[3]; __pyx_v_ty = values[4]; } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("textured_polygon", 1, 5, 5, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 177; __pyx_clineno = __LINE__; goto __pyx_L3_error;} __pyx_L3_error:; __Pyx_AddTraceback("pygame_sdl2.gfxdraw.textured_polygon", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_surface), __pyx_ptype_11pygame_sdl2_7surface_Surface, 1, "surface", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 177; __pyx_clineno = __LINE__; goto __pyx_L1_error;} if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_texture), __pyx_ptype_11pygame_sdl2_7surface_Surface, 0, "texture", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 177; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_r = __pyx_pf_11pygame_sdl2_7gfxdraw_50textured_polygon(__pyx_self, __pyx_v_surface, __pyx_v_points, __pyx_v_texture, __pyx_v_tx, __pyx_v_ty); /* function exit code */ goto __pyx_L0; __pyx_L1_error:; __pyx_r = NULL; __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_7gfxdraw_50textured_polygon(CYTHON_UNUSED PyObject *__pyx_self, struct __pyx_obj_11pygame_sdl2_7surface_Surface *__pyx_v_surface, PyObject *__pyx_v_points, struct __pyx_obj_11pygame_sdl2_7surface_Surface *__pyx_v_texture, PyObject *__pyx_v_tx, PyObject *__pyx_v_ty) { Sint16 *__pyx_v_vx; Sint16 *__pyx_v_vy; size_t __pyx_v_num_points; PyObject *__pyx_v_n = NULL; CYTHON_UNUSED PyObject *__pyx_v_pt = NULL; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations Py_ssize_t __pyx_t_1; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; PyObject *(*__pyx_t_4)(PyObject *); PyObject *__pyx_t_5 = NULL; PyObject *__pyx_t_6 = NULL; PyObject *__pyx_t_7 = NULL; PyObject *(*__pyx_t_8)(PyObject *); Sint16 __pyx_t_9; Sint16 __pyx_t_10; Py_ssize_t __pyx_t_11; int __pyx_t_12; int __pyx_t_13; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("textured_polygon", 0); /* "pygame_sdl2/gfxdraw.pyx":180 * cdef Sint16 *vx * cdef Sint16 *vy * cdef size_t num_points = len(points) # <<<<<<<<<<<<<< * vx = malloc(num_points * sizeof(Sint16)) * vy = malloc(num_points * sizeof(Sint16)) */ __pyx_t_1 = PyObject_Length(__pyx_v_points); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 180; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_v_num_points = __pyx_t_1; /* "pygame_sdl2/gfxdraw.pyx":181 * cdef Sint16 *vy * cdef size_t num_points = len(points) * vx = malloc(num_points * sizeof(Sint16)) # <<<<<<<<<<<<<< * vy = malloc(num_points * sizeof(Sint16)) * for n, pt in zip(range(num_points), points): */ __pyx_v_vx = ((Sint16 *)malloc((__pyx_v_num_points * (sizeof(Sint16))))); /* "pygame_sdl2/gfxdraw.pyx":182 * cdef size_t num_points = len(points) * vx = malloc(num_points * sizeof(Sint16)) * vy = malloc(num_points * sizeof(Sint16)) # <<<<<<<<<<<<<< * for n, pt in zip(range(num_points), points): * vx[n], vy[n] = points[n] */ __pyx_v_vy = ((Sint16 *)malloc((__pyx_v_num_points * (sizeof(Sint16))))); /* "pygame_sdl2/gfxdraw.pyx":183 * vx = malloc(num_points * sizeof(Sint16)) * vy = malloc(num_points * sizeof(Sint16)) * for n, pt in zip(range(num_points), points): # <<<<<<<<<<<<<< * vx[n], vy[n] = points[n] * texturedPolygon(surface.surface, vx, vy, num_points, texture.surface, tx, ty) */ __pyx_t_2 = __Pyx_PyInt_FromSize_t(__pyx_v_num_points); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 183; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 183; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __Pyx_GIVEREF(__pyx_t_2); PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_2); __pyx_t_2 = 0; __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_range, __pyx_t_3, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 183; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 183; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __Pyx_GIVEREF(__pyx_t_2); PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_2); __Pyx_INCREF(__pyx_v_points); __Pyx_GIVEREF(__pyx_v_points); PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_v_points); __pyx_t_2 = 0; __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_zip, __pyx_t_3, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 183; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; if (likely(PyList_CheckExact(__pyx_t_2)) || PyTuple_CheckExact(__pyx_t_2)) { __pyx_t_3 = __pyx_t_2; __Pyx_INCREF(__pyx_t_3); __pyx_t_1 = 0; __pyx_t_4 = NULL; } else { __pyx_t_1 = -1; __pyx_t_3 = PyObject_GetIter(__pyx_t_2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 183; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = Py_TYPE(__pyx_t_3)->tp_iternext; if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 183; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; for (;;) { if (likely(!__pyx_t_4)) { if (likely(PyList_CheckExact(__pyx_t_3))) { if (__pyx_t_1 >= PyList_GET_SIZE(__pyx_t_3)) break; #if CYTHON_COMPILING_IN_CPYTHON __pyx_t_2 = PyList_GET_ITEM(__pyx_t_3, __pyx_t_1); __Pyx_INCREF(__pyx_t_2); __pyx_t_1++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 183; __pyx_clineno = __LINE__; goto __pyx_L1_error;} #else __pyx_t_2 = PySequence_ITEM(__pyx_t_3, __pyx_t_1); __pyx_t_1++; if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 183; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); #endif } else { if (__pyx_t_1 >= PyTuple_GET_SIZE(__pyx_t_3)) break; #if CYTHON_COMPILING_IN_CPYTHON __pyx_t_2 = PyTuple_GET_ITEM(__pyx_t_3, __pyx_t_1); __Pyx_INCREF(__pyx_t_2); __pyx_t_1++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 183; __pyx_clineno = __LINE__; goto __pyx_L1_error;} #else __pyx_t_2 = PySequence_ITEM(__pyx_t_3, __pyx_t_1); __pyx_t_1++; if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 183; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); #endif } } else { __pyx_t_2 = __pyx_t_4(__pyx_t_3); if (unlikely(!__pyx_t_2)) { PyObject* exc_type = PyErr_Occurred(); if (exc_type) { if (likely(exc_type == PyExc_StopIteration || PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); else {__pyx_filename = __pyx_f[0]; __pyx_lineno = 183; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } break; } __Pyx_GOTREF(__pyx_t_2); } if ((likely(PyTuple_CheckExact(__pyx_t_2))) || (PyList_CheckExact(__pyx_t_2))) { PyObject* sequence = __pyx_t_2; #if CYTHON_COMPILING_IN_CPYTHON Py_ssize_t size = Py_SIZE(sequence); #else Py_ssize_t size = PySequence_Size(sequence); #endif if (unlikely(size != 2)) { if (size > 2) __Pyx_RaiseTooManyValuesError(2); else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 183; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } #if CYTHON_COMPILING_IN_CPYTHON if (likely(PyTuple_CheckExact(sequence))) { __pyx_t_5 = PyTuple_GET_ITEM(sequence, 0); __pyx_t_6 = PyTuple_GET_ITEM(sequence, 1); } else { __pyx_t_5 = PyList_GET_ITEM(sequence, 0); __pyx_t_6 = PyList_GET_ITEM(sequence, 1); } __Pyx_INCREF(__pyx_t_5); __Pyx_INCREF(__pyx_t_6); #else __pyx_t_5 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 183; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); __pyx_t_6 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 183; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_6); #endif __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } else { Py_ssize_t index = -1; __pyx_t_7 = PyObject_GetIter(__pyx_t_2); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 183; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_8 = Py_TYPE(__pyx_t_7)->tp_iternext; index = 0; __pyx_t_5 = __pyx_t_8(__pyx_t_7); if (unlikely(!__pyx_t_5)) goto __pyx_L5_unpacking_failed; __Pyx_GOTREF(__pyx_t_5); index = 1; __pyx_t_6 = __pyx_t_8(__pyx_t_7); if (unlikely(!__pyx_t_6)) goto __pyx_L5_unpacking_failed; __Pyx_GOTREF(__pyx_t_6); if (__Pyx_IternextUnpackEndCheck(__pyx_t_8(__pyx_t_7), 2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 183; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_t_8 = NULL; __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; goto __pyx_L6_unpacking_done; __pyx_L5_unpacking_failed:; __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __pyx_t_8 = NULL; if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 183; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_L6_unpacking_done:; } __Pyx_XDECREF_SET(__pyx_v_n, __pyx_t_5); __pyx_t_5 = 0; __Pyx_XDECREF_SET(__pyx_v_pt, __pyx_t_6); __pyx_t_6 = 0; /* "pygame_sdl2/gfxdraw.pyx":184 * vy = malloc(num_points * sizeof(Sint16)) * for n, pt in zip(range(num_points), points): * vx[n], vy[n] = points[n] # <<<<<<<<<<<<<< * texturedPolygon(surface.surface, vx, vy, num_points, texture.surface, tx, ty) * free(vx) */ __pyx_t_2 = PyObject_GetItem(__pyx_v_points, __pyx_v_n); if (unlikely(__pyx_t_2 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 184; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; __Pyx_GOTREF(__pyx_t_2); if ((likely(PyTuple_CheckExact(__pyx_t_2))) || (PyList_CheckExact(__pyx_t_2))) { PyObject* sequence = __pyx_t_2; #if CYTHON_COMPILING_IN_CPYTHON Py_ssize_t size = Py_SIZE(sequence); #else Py_ssize_t size = PySequence_Size(sequence); #endif if (unlikely(size != 2)) { if (size > 2) __Pyx_RaiseTooManyValuesError(2); else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 184; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } #if CYTHON_COMPILING_IN_CPYTHON if (likely(PyTuple_CheckExact(sequence))) { __pyx_t_6 = PyTuple_GET_ITEM(sequence, 0); __pyx_t_5 = PyTuple_GET_ITEM(sequence, 1); } else { __pyx_t_6 = PyList_GET_ITEM(sequence, 0); __pyx_t_5 = PyList_GET_ITEM(sequence, 1); } __Pyx_INCREF(__pyx_t_6); __Pyx_INCREF(__pyx_t_5); #else __pyx_t_6 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 184; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_6); __pyx_t_5 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 184; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); #endif __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } else { Py_ssize_t index = -1; __pyx_t_7 = PyObject_GetIter(__pyx_t_2); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 184; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_8 = Py_TYPE(__pyx_t_7)->tp_iternext; index = 0; __pyx_t_6 = __pyx_t_8(__pyx_t_7); if (unlikely(!__pyx_t_6)) goto __pyx_L7_unpacking_failed; __Pyx_GOTREF(__pyx_t_6); index = 1; __pyx_t_5 = __pyx_t_8(__pyx_t_7); if (unlikely(!__pyx_t_5)) goto __pyx_L7_unpacking_failed; __Pyx_GOTREF(__pyx_t_5); if (__Pyx_IternextUnpackEndCheck(__pyx_t_8(__pyx_t_7), 2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 184; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_t_8 = NULL; __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; goto __pyx_L8_unpacking_done; __pyx_L7_unpacking_failed:; __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __pyx_t_8 = NULL; if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 184; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_L8_unpacking_done:; } __pyx_t_9 = __Pyx_PyInt_As_int16_t(__pyx_t_6); if (unlikely((__pyx_t_9 == (Sint16)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 184; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __pyx_t_10 = __Pyx_PyInt_As_int16_t(__pyx_t_5); if (unlikely((__pyx_t_10 == (Sint16)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 184; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __pyx_t_11 = __Pyx_PyIndex_AsSsize_t(__pyx_v_n); if (unlikely((__pyx_t_11 == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 184; __pyx_clineno = __LINE__; goto __pyx_L1_error;} (__pyx_v_vx[__pyx_t_11]) = __pyx_t_9; __pyx_t_11 = __Pyx_PyIndex_AsSsize_t(__pyx_v_n); if (unlikely((__pyx_t_11 == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 184; __pyx_clineno = __LINE__; goto __pyx_L1_error;} (__pyx_v_vy[__pyx_t_11]) = __pyx_t_10; /* "pygame_sdl2/gfxdraw.pyx":183 * vx = malloc(num_points * sizeof(Sint16)) * vy = malloc(num_points * sizeof(Sint16)) * for n, pt in zip(range(num_points), points): # <<<<<<<<<<<<<< * vx[n], vy[n] = points[n] * texturedPolygon(surface.surface, vx, vy, num_points, texture.surface, tx, ty) */ } __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "pygame_sdl2/gfxdraw.pyx":185 * for n, pt in zip(range(num_points), points): * vx[n], vy[n] = points[n] * texturedPolygon(surface.surface, vx, vy, num_points, texture.surface, tx, ty) # <<<<<<<<<<<<<< * free(vx) * free(vy) */ __pyx_t_12 = __Pyx_PyInt_As_int(__pyx_v_tx); if (unlikely((__pyx_t_12 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 185; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_t_13 = __Pyx_PyInt_As_int(__pyx_v_ty); if (unlikely((__pyx_t_13 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 185; __pyx_clineno = __LINE__; goto __pyx_L1_error;} texturedPolygon(__pyx_v_surface->surface, __pyx_v_vx, __pyx_v_vy, __pyx_v_num_points, __pyx_v_texture->surface, __pyx_t_12, __pyx_t_13); /* "pygame_sdl2/gfxdraw.pyx":186 * vx[n], vy[n] = points[n] * texturedPolygon(surface.surface, vx, vy, num_points, texture.surface, tx, ty) * free(vx) # <<<<<<<<<<<<<< * free(vy) * */ free(__pyx_v_vx); /* "pygame_sdl2/gfxdraw.pyx":187 * texturedPolygon(surface.surface, vx, vy, num_points, texture.surface, tx, ty) * free(vx) * free(vy) # <<<<<<<<<<<<<< * * def bezier(Surface surface, points, steps, color): */ free(__pyx_v_vy); /* "pygame_sdl2/gfxdraw.pyx":177 * free(vy) * * def textured_polygon(Surface surface, points, Surface texture not None, tx, ty): # <<<<<<<<<<<<<< * cdef Sint16 *vx * cdef Sint16 *vy */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_5); __Pyx_XDECREF(__pyx_t_6); __Pyx_XDECREF(__pyx_t_7); __Pyx_AddTraceback("pygame_sdl2.gfxdraw.textured_polygon", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF(__pyx_v_n); __Pyx_XDECREF(__pyx_v_pt); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/gfxdraw.pyx":189 * free(vy) * * def bezier(Surface surface, points, steps, color): # <<<<<<<<<<<<<< * cdef Color c = Color(color) * cdef Sint16 *vx */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_7gfxdraw_53bezier(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static PyMethodDef __pyx_mdef_11pygame_sdl2_7gfxdraw_53bezier = {"bezier", (PyCFunction)__pyx_pw_11pygame_sdl2_7gfxdraw_53bezier, METH_VARARGS|METH_KEYWORDS, 0}; static PyObject *__pyx_pw_11pygame_sdl2_7gfxdraw_53bezier(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { struct __pyx_obj_11pygame_sdl2_7surface_Surface *__pyx_v_surface = 0; PyObject *__pyx_v_points = 0; PyObject *__pyx_v_steps = 0; PyObject *__pyx_v_color = 0; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("bezier (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_surface,&__pyx_n_s_points,&__pyx_n_s_steps,&__pyx_n_s_color,0}; PyObject* values[4] = {0,0,0,0}; if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_surface)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; case 1: if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_points)) != 0)) kw_args--; else { __Pyx_RaiseArgtupleInvalid("bezier", 1, 4, 4, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 189; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } case 2: if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_steps)) != 0)) kw_args--; else { __Pyx_RaiseArgtupleInvalid("bezier", 1, 4, 4, 2); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 189; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } case 3: if (likely((values[3] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_color)) != 0)) kw_args--; else { __Pyx_RaiseArgtupleInvalid("bezier", 1, 4, 4, 3); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 189; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "bezier") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 189; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } } else if (PyTuple_GET_SIZE(__pyx_args) != 4) { goto __pyx_L5_argtuple_error; } else { values[0] = PyTuple_GET_ITEM(__pyx_args, 0); values[1] = PyTuple_GET_ITEM(__pyx_args, 1); values[2] = PyTuple_GET_ITEM(__pyx_args, 2); values[3] = PyTuple_GET_ITEM(__pyx_args, 3); } __pyx_v_surface = ((struct __pyx_obj_11pygame_sdl2_7surface_Surface *)values[0]); __pyx_v_points = values[1]; __pyx_v_steps = values[2]; __pyx_v_color = values[3]; } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("bezier", 1, 4, 4, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 189; __pyx_clineno = __LINE__; goto __pyx_L3_error;} __pyx_L3_error:; __Pyx_AddTraceback("pygame_sdl2.gfxdraw.bezier", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_surface), __pyx_ptype_11pygame_sdl2_7surface_Surface, 1, "surface", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 189; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_r = __pyx_pf_11pygame_sdl2_7gfxdraw_52bezier(__pyx_self, __pyx_v_surface, __pyx_v_points, __pyx_v_steps, __pyx_v_color); /* function exit code */ goto __pyx_L0; __pyx_L1_error:; __pyx_r = NULL; __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_7gfxdraw_52bezier(CYTHON_UNUSED PyObject *__pyx_self, struct __pyx_obj_11pygame_sdl2_7surface_Surface *__pyx_v_surface, PyObject *__pyx_v_points, PyObject *__pyx_v_steps, PyObject *__pyx_v_color) { struct __pyx_obj_11pygame_sdl2_5color_Color *__pyx_v_c = 0; Sint16 *__pyx_v_vx; Sint16 *__pyx_v_vy; size_t __pyx_v_num_points; PyObject *__pyx_v_n = NULL; CYTHON_UNUSED PyObject *__pyx_v_pt = NULL; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; Py_ssize_t __pyx_t_3; PyObject *(*__pyx_t_4)(PyObject *); PyObject *__pyx_t_5 = NULL; PyObject *__pyx_t_6 = NULL; PyObject *__pyx_t_7 = NULL; PyObject *(*__pyx_t_8)(PyObject *); Sint16 __pyx_t_9; Sint16 __pyx_t_10; Py_ssize_t __pyx_t_11; int __pyx_t_12; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("bezier", 0); /* "pygame_sdl2/gfxdraw.pyx":190 * * def bezier(Surface surface, points, steps, color): * cdef Color c = Color(color) # <<<<<<<<<<<<<< * cdef Sint16 *vx * cdef Sint16 *vy */ __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 190; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __Pyx_INCREF(__pyx_v_color); __Pyx_GIVEREF(__pyx_v_color); PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_color); __pyx_t_2 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_11pygame_sdl2_5color_Color), __pyx_t_1, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 190; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_v_c = ((struct __pyx_obj_11pygame_sdl2_5color_Color *)__pyx_t_2); __pyx_t_2 = 0; /* "pygame_sdl2/gfxdraw.pyx":193 * cdef Sint16 *vx * cdef Sint16 *vy * cdef size_t num_points = len(points) # <<<<<<<<<<<<<< * vx = malloc(num_points * sizeof(Sint16)) * vy = malloc(num_points * sizeof(Sint16)) */ __pyx_t_3 = PyObject_Length(__pyx_v_points); if (unlikely(__pyx_t_3 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 193; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_v_num_points = __pyx_t_3; /* "pygame_sdl2/gfxdraw.pyx":194 * cdef Sint16 *vy * cdef size_t num_points = len(points) * vx = malloc(num_points * sizeof(Sint16)) # <<<<<<<<<<<<<< * vy = malloc(num_points * sizeof(Sint16)) * for n, pt in zip(range(num_points), points): */ __pyx_v_vx = ((Sint16 *)malloc((__pyx_v_num_points * (sizeof(Sint16))))); /* "pygame_sdl2/gfxdraw.pyx":195 * cdef size_t num_points = len(points) * vx = malloc(num_points * sizeof(Sint16)) * vy = malloc(num_points * sizeof(Sint16)) # <<<<<<<<<<<<<< * for n, pt in zip(range(num_points), points): * vx[n], vy[n] = points[n] */ __pyx_v_vy = ((Sint16 *)malloc((__pyx_v_num_points * (sizeof(Sint16))))); /* "pygame_sdl2/gfxdraw.pyx":196 * vx = malloc(num_points * sizeof(Sint16)) * vy = malloc(num_points * sizeof(Sint16)) * for n, pt in zip(range(num_points), points): # <<<<<<<<<<<<<< * vx[n], vy[n] = points[n] * bezierRGBA(surface.surface, vx, vy, num_points, steps, c.r, c.g, c.b, c.a) */ __pyx_t_2 = __Pyx_PyInt_FromSize_t(__pyx_v_num_points); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 196; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 196; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __Pyx_GIVEREF(__pyx_t_2); PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_2); __pyx_t_2 = 0; __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_range, __pyx_t_1, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 196; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 196; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __Pyx_GIVEREF(__pyx_t_2); PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_2); __Pyx_INCREF(__pyx_v_points); __Pyx_GIVEREF(__pyx_v_points); PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_v_points); __pyx_t_2 = 0; __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_zip, __pyx_t_1, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 196; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (likely(PyList_CheckExact(__pyx_t_2)) || PyTuple_CheckExact(__pyx_t_2)) { __pyx_t_1 = __pyx_t_2; __Pyx_INCREF(__pyx_t_1); __pyx_t_3 = 0; __pyx_t_4 = NULL; } else { __pyx_t_3 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_t_2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 196; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_t_4 = Py_TYPE(__pyx_t_1)->tp_iternext; if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 196; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; for (;;) { if (likely(!__pyx_t_4)) { if (likely(PyList_CheckExact(__pyx_t_1))) { if (__pyx_t_3 >= PyList_GET_SIZE(__pyx_t_1)) break; #if CYTHON_COMPILING_IN_CPYTHON __pyx_t_2 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_3); __Pyx_INCREF(__pyx_t_2); __pyx_t_3++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 196; __pyx_clineno = __LINE__; goto __pyx_L1_error;} #else __pyx_t_2 = PySequence_ITEM(__pyx_t_1, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 196; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); #endif } else { if (__pyx_t_3 >= PyTuple_GET_SIZE(__pyx_t_1)) break; #if CYTHON_COMPILING_IN_CPYTHON __pyx_t_2 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_3); __Pyx_INCREF(__pyx_t_2); __pyx_t_3++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 196; __pyx_clineno = __LINE__; goto __pyx_L1_error;} #else __pyx_t_2 = PySequence_ITEM(__pyx_t_1, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 196; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); #endif } } else { __pyx_t_2 = __pyx_t_4(__pyx_t_1); if (unlikely(!__pyx_t_2)) { PyObject* exc_type = PyErr_Occurred(); if (exc_type) { if (likely(exc_type == PyExc_StopIteration || PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); else {__pyx_filename = __pyx_f[0]; __pyx_lineno = 196; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } break; } __Pyx_GOTREF(__pyx_t_2); } if ((likely(PyTuple_CheckExact(__pyx_t_2))) || (PyList_CheckExact(__pyx_t_2))) { PyObject* sequence = __pyx_t_2; #if CYTHON_COMPILING_IN_CPYTHON Py_ssize_t size = Py_SIZE(sequence); #else Py_ssize_t size = PySequence_Size(sequence); #endif if (unlikely(size != 2)) { if (size > 2) __Pyx_RaiseTooManyValuesError(2); else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 196; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } #if CYTHON_COMPILING_IN_CPYTHON if (likely(PyTuple_CheckExact(sequence))) { __pyx_t_5 = PyTuple_GET_ITEM(sequence, 0); __pyx_t_6 = PyTuple_GET_ITEM(sequence, 1); } else { __pyx_t_5 = PyList_GET_ITEM(sequence, 0); __pyx_t_6 = PyList_GET_ITEM(sequence, 1); } __Pyx_INCREF(__pyx_t_5); __Pyx_INCREF(__pyx_t_6); #else __pyx_t_5 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 196; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); __pyx_t_6 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 196; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_6); #endif __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } else { Py_ssize_t index = -1; __pyx_t_7 = PyObject_GetIter(__pyx_t_2); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 196; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_8 = Py_TYPE(__pyx_t_7)->tp_iternext; index = 0; __pyx_t_5 = __pyx_t_8(__pyx_t_7); if (unlikely(!__pyx_t_5)) goto __pyx_L5_unpacking_failed; __Pyx_GOTREF(__pyx_t_5); index = 1; __pyx_t_6 = __pyx_t_8(__pyx_t_7); if (unlikely(!__pyx_t_6)) goto __pyx_L5_unpacking_failed; __Pyx_GOTREF(__pyx_t_6); if (__Pyx_IternextUnpackEndCheck(__pyx_t_8(__pyx_t_7), 2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 196; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_t_8 = NULL; __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; goto __pyx_L6_unpacking_done; __pyx_L5_unpacking_failed:; __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __pyx_t_8 = NULL; if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 196; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_L6_unpacking_done:; } __Pyx_XDECREF_SET(__pyx_v_n, __pyx_t_5); __pyx_t_5 = 0; __Pyx_XDECREF_SET(__pyx_v_pt, __pyx_t_6); __pyx_t_6 = 0; /* "pygame_sdl2/gfxdraw.pyx":197 * vy = malloc(num_points * sizeof(Sint16)) * for n, pt in zip(range(num_points), points): * vx[n], vy[n] = points[n] # <<<<<<<<<<<<<< * bezierRGBA(surface.surface, vx, vy, num_points, steps, c.r, c.g, c.b, c.a) * free(vx) */ __pyx_t_2 = PyObject_GetItem(__pyx_v_points, __pyx_v_n); if (unlikely(__pyx_t_2 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 197; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; __Pyx_GOTREF(__pyx_t_2); if ((likely(PyTuple_CheckExact(__pyx_t_2))) || (PyList_CheckExact(__pyx_t_2))) { PyObject* sequence = __pyx_t_2; #if CYTHON_COMPILING_IN_CPYTHON Py_ssize_t size = Py_SIZE(sequence); #else Py_ssize_t size = PySequence_Size(sequence); #endif if (unlikely(size != 2)) { if (size > 2) __Pyx_RaiseTooManyValuesError(2); else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 197; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } #if CYTHON_COMPILING_IN_CPYTHON if (likely(PyTuple_CheckExact(sequence))) { __pyx_t_6 = PyTuple_GET_ITEM(sequence, 0); __pyx_t_5 = PyTuple_GET_ITEM(sequence, 1); } else { __pyx_t_6 = PyList_GET_ITEM(sequence, 0); __pyx_t_5 = PyList_GET_ITEM(sequence, 1); } __Pyx_INCREF(__pyx_t_6); __Pyx_INCREF(__pyx_t_5); #else __pyx_t_6 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 197; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_6); __pyx_t_5 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 197; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); #endif __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } else { Py_ssize_t index = -1; __pyx_t_7 = PyObject_GetIter(__pyx_t_2); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 197; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_8 = Py_TYPE(__pyx_t_7)->tp_iternext; index = 0; __pyx_t_6 = __pyx_t_8(__pyx_t_7); if (unlikely(!__pyx_t_6)) goto __pyx_L7_unpacking_failed; __Pyx_GOTREF(__pyx_t_6); index = 1; __pyx_t_5 = __pyx_t_8(__pyx_t_7); if (unlikely(!__pyx_t_5)) goto __pyx_L7_unpacking_failed; __Pyx_GOTREF(__pyx_t_5); if (__Pyx_IternextUnpackEndCheck(__pyx_t_8(__pyx_t_7), 2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 197; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_t_8 = NULL; __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; goto __pyx_L8_unpacking_done; __pyx_L7_unpacking_failed:; __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __pyx_t_8 = NULL; if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 197; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_L8_unpacking_done:; } __pyx_t_9 = __Pyx_PyInt_As_int16_t(__pyx_t_6); if (unlikely((__pyx_t_9 == (Sint16)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 197; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __pyx_t_10 = __Pyx_PyInt_As_int16_t(__pyx_t_5); if (unlikely((__pyx_t_10 == (Sint16)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 197; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __pyx_t_11 = __Pyx_PyIndex_AsSsize_t(__pyx_v_n); if (unlikely((__pyx_t_11 == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 197; __pyx_clineno = __LINE__; goto __pyx_L1_error;} (__pyx_v_vx[__pyx_t_11]) = __pyx_t_9; __pyx_t_11 = __Pyx_PyIndex_AsSsize_t(__pyx_v_n); if (unlikely((__pyx_t_11 == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 197; __pyx_clineno = __LINE__; goto __pyx_L1_error;} (__pyx_v_vy[__pyx_t_11]) = __pyx_t_10; /* "pygame_sdl2/gfxdraw.pyx":196 * vx = malloc(num_points * sizeof(Sint16)) * vy = malloc(num_points * sizeof(Sint16)) * for n, pt in zip(range(num_points), points): # <<<<<<<<<<<<<< * vx[n], vy[n] = points[n] * bezierRGBA(surface.surface, vx, vy, num_points, steps, c.r, c.g, c.b, c.a) */ } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "pygame_sdl2/gfxdraw.pyx":198 * for n, pt in zip(range(num_points), points): * vx[n], vy[n] = points[n] * bezierRGBA(surface.surface, vx, vy, num_points, steps, c.r, c.g, c.b, c.a) # <<<<<<<<<<<<<< * free(vx) * free(vy) */ __pyx_t_12 = __Pyx_PyInt_As_int(__pyx_v_steps); if (unlikely((__pyx_t_12 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 198; __pyx_clineno = __LINE__; goto __pyx_L1_error;} bezierRGBA(__pyx_v_surface->surface, __pyx_v_vx, __pyx_v_vy, __pyx_v_num_points, __pyx_t_12, __pyx_v_c->r, __pyx_v_c->g, __pyx_v_c->b, __pyx_v_c->a); /* "pygame_sdl2/gfxdraw.pyx":199 * vx[n], vy[n] = points[n] * bezierRGBA(surface.surface, vx, vy, num_points, steps, c.r, c.g, c.b, c.a) * free(vx) # <<<<<<<<<<<<<< * free(vy) */ free(__pyx_v_vx); /* "pygame_sdl2/gfxdraw.pyx":200 * bezierRGBA(surface.surface, vx, vy, num_points, steps, c.r, c.g, c.b, c.a) * free(vx) * free(vy) # <<<<<<<<<<<<<< */ free(__pyx_v_vy); /* "pygame_sdl2/gfxdraw.pyx":189 * free(vy) * * def bezier(Surface surface, points, steps, color): # <<<<<<<<<<<<<< * cdef Color c = Color(color) * cdef Sint16 *vx */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_5); __Pyx_XDECREF(__pyx_t_6); __Pyx_XDECREF(__pyx_t_7); __Pyx_AddTraceback("pygame_sdl2.gfxdraw.bezier", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF((PyObject *)__pyx_v_c); __Pyx_XDECREF(__pyx_v_n); __Pyx_XDECREF(__pyx_v_pt); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyMethodDef __pyx_methods[] = { {0, 0, 0, 0} }; #if PY_MAJOR_VERSION >= 3 static struct PyModuleDef __pyx_moduledef = { #if PY_VERSION_HEX < 0x03020000 { PyObject_HEAD_INIT(NULL) NULL, 0, NULL }, #else PyModuleDef_HEAD_INIT, #endif "gfxdraw", 0, /* m_doc */ -1, /* m_size */ __pyx_methods /* m_methods */, NULL, /* m_reload */ NULL, /* m_traverse */ NULL, /* m_clear */ NULL /* m_free */ }; #endif static __Pyx_StringTabEntry __pyx_string_tab[] = { {&__pyx_n_s_Rect, __pyx_k_Rect, sizeof(__pyx_k_Rect), 0, 0, 1, 1}, {&__pyx_n_s_aacircle, __pyx_k_aacircle, sizeof(__pyx_k_aacircle), 0, 0, 1, 1}, {&__pyx_n_s_aaellipse, __pyx_k_aaellipse, sizeof(__pyx_k_aaellipse), 0, 0, 1, 1}, {&__pyx_n_s_aaline, __pyx_k_aaline, sizeof(__pyx_k_aaline), 0, 0, 1, 1}, {&__pyx_n_s_aapolygon, __pyx_k_aapolygon, sizeof(__pyx_k_aapolygon), 0, 0, 1, 1}, {&__pyx_n_s_aatrigon, __pyx_k_aatrigon, sizeof(__pyx_k_aatrigon), 0, 0, 1, 1}, {&__pyx_n_s_arc, __pyx_k_arc, sizeof(__pyx_k_arc), 0, 0, 1, 1}, {&__pyx_n_s_bezier, __pyx_k_bezier, sizeof(__pyx_k_bezier), 0, 0, 1, 1}, {&__pyx_n_s_box, __pyx_k_box, sizeof(__pyx_k_box), 0, 0, 1, 1}, {&__pyx_n_s_c, __pyx_k_c, sizeof(__pyx_k_c), 0, 0, 1, 1}, {&__pyx_n_s_circle, __pyx_k_circle, sizeof(__pyx_k_circle), 0, 0, 1, 1}, {&__pyx_n_s_color, __pyx_k_color, sizeof(__pyx_k_color), 0, 0, 1, 1}, {&__pyx_n_s_ellipse, __pyx_k_ellipse, sizeof(__pyx_k_ellipse), 0, 0, 1, 1}, {&__pyx_n_s_end, __pyx_k_end, sizeof(__pyx_k_end), 0, 0, 1, 1}, {&__pyx_n_s_error, __pyx_k_error, sizeof(__pyx_k_error), 0, 0, 1, 1}, {&__pyx_n_s_filled_circle, __pyx_k_filled_circle, sizeof(__pyx_k_filled_circle), 0, 0, 1, 1}, {&__pyx_n_s_filled_ellipse, __pyx_k_filled_ellipse, sizeof(__pyx_k_filled_ellipse), 0, 0, 1, 1}, {&__pyx_n_s_filled_pie, __pyx_k_filled_pie, sizeof(__pyx_k_filled_pie), 0, 0, 1, 1}, {&__pyx_n_s_filled_polygon, __pyx_k_filled_polygon, sizeof(__pyx_k_filled_polygon), 0, 0, 1, 1}, {&__pyx_n_s_filled_trigon, __pyx_k_filled_trigon, sizeof(__pyx_k_filled_trigon), 0, 0, 1, 1}, {&__pyx_n_s_h, __pyx_k_h, sizeof(__pyx_k_h), 0, 0, 1, 1}, {&__pyx_n_s_hline, __pyx_k_hline, sizeof(__pyx_k_hline), 0, 0, 1, 1}, {&__pyx_kp_s_home_tom_ab_pygame_sdl2_src_pyg, __pyx_k_home_tom_ab_pygame_sdl2_src_pyg, sizeof(__pyx_k_home_tom_ab_pygame_sdl2_src_pyg), 0, 0, 1, 0}, {&__pyx_n_s_import, __pyx_k_import, sizeof(__pyx_k_import), 0, 0, 1, 1}, {&__pyx_n_s_line, __pyx_k_line, sizeof(__pyx_k_line), 0, 0, 1, 1}, {&__pyx_n_s_main, __pyx_k_main, sizeof(__pyx_k_main), 0, 0, 1, 1}, {&__pyx_n_s_n, __pyx_k_n, sizeof(__pyx_k_n), 0, 0, 1, 1}, {&__pyx_n_s_num_points, __pyx_k_num_points, sizeof(__pyx_k_num_points), 0, 0, 1, 1}, {&__pyx_n_s_pie, __pyx_k_pie, sizeof(__pyx_k_pie), 0, 0, 1, 1}, {&__pyx_n_s_pixel, __pyx_k_pixel, sizeof(__pyx_k_pixel), 0, 0, 1, 1}, {&__pyx_n_s_points, __pyx_k_points, sizeof(__pyx_k_points), 0, 0, 1, 1}, {&__pyx_n_s_polygon, __pyx_k_polygon, sizeof(__pyx_k_polygon), 0, 0, 1, 1}, {&__pyx_n_s_pt, __pyx_k_pt, sizeof(__pyx_k_pt), 0, 0, 1, 1}, {&__pyx_n_s_pygame_sdl2_error, __pyx_k_pygame_sdl2_error, sizeof(__pyx_k_pygame_sdl2_error), 0, 0, 1, 1}, {&__pyx_n_s_pygame_sdl2_gfxdraw, __pyx_k_pygame_sdl2_gfxdraw, sizeof(__pyx_k_pygame_sdl2_gfxdraw), 0, 0, 1, 1}, {&__pyx_n_s_pygame_sdl2_rect, __pyx_k_pygame_sdl2_rect, sizeof(__pyx_k_pygame_sdl2_rect), 0, 0, 1, 1}, {&__pyx_n_s_pyx_vtable, __pyx_k_pyx_vtable, sizeof(__pyx_k_pyx_vtable), 0, 0, 1, 1}, {&__pyx_n_s_r, __pyx_k_r, sizeof(__pyx_k_r), 0, 0, 1, 1}, {&__pyx_n_s_rad, __pyx_k_rad, sizeof(__pyx_k_rad), 0, 0, 1, 1}, {&__pyx_n_s_range, __pyx_k_range, sizeof(__pyx_k_range), 0, 0, 1, 1}, {&__pyx_n_s_rect, __pyx_k_rect, sizeof(__pyx_k_rect), 0, 0, 1, 1}, {&__pyx_n_s_rectangle, __pyx_k_rectangle, sizeof(__pyx_k_rectangle), 0, 0, 1, 1}, {&__pyx_n_s_rounded_box, __pyx_k_rounded_box, sizeof(__pyx_k_rounded_box), 0, 0, 1, 1}, {&__pyx_n_s_rounded_rectangle, __pyx_k_rounded_rectangle, sizeof(__pyx_k_rounded_rectangle), 0, 0, 1, 1}, {&__pyx_n_s_rx, __pyx_k_rx, sizeof(__pyx_k_rx), 0, 0, 1, 1}, {&__pyx_n_s_ry, __pyx_k_ry, sizeof(__pyx_k_ry), 0, 0, 1, 1}, {&__pyx_n_s_start, __pyx_k_start, sizeof(__pyx_k_start), 0, 0, 1, 1}, {&__pyx_n_s_steps, __pyx_k_steps, sizeof(__pyx_k_steps), 0, 0, 1, 1}, {&__pyx_n_s_surface, __pyx_k_surface, sizeof(__pyx_k_surface), 0, 0, 1, 1}, {&__pyx_n_s_test, __pyx_k_test, sizeof(__pyx_k_test), 0, 0, 1, 1}, {&__pyx_n_s_texture, __pyx_k_texture, sizeof(__pyx_k_texture), 0, 0, 1, 1}, {&__pyx_n_s_textured_polygon, __pyx_k_textured_polygon, sizeof(__pyx_k_textured_polygon), 0, 0, 1, 1}, {&__pyx_n_s_thick_line, __pyx_k_thick_line, sizeof(__pyx_k_thick_line), 0, 0, 1, 1}, {&__pyx_n_s_trigon, __pyx_k_trigon, sizeof(__pyx_k_trigon), 0, 0, 1, 1}, {&__pyx_n_s_tx, __pyx_k_tx, sizeof(__pyx_k_tx), 0, 0, 1, 1}, {&__pyx_n_s_ty, __pyx_k_ty, sizeof(__pyx_k_ty), 0, 0, 1, 1}, {&__pyx_n_s_vline, __pyx_k_vline, sizeof(__pyx_k_vline), 0, 0, 1, 1}, {&__pyx_n_s_vx, __pyx_k_vx, sizeof(__pyx_k_vx), 0, 0, 1, 1}, {&__pyx_n_s_vy, __pyx_k_vy, sizeof(__pyx_k_vy), 0, 0, 1, 1}, {&__pyx_n_s_w, __pyx_k_w, sizeof(__pyx_k_w), 0, 0, 1, 1}, {&__pyx_n_s_width, __pyx_k_width, sizeof(__pyx_k_width), 0, 0, 1, 1}, {&__pyx_n_s_x, __pyx_k_x, sizeof(__pyx_k_x), 0, 0, 1, 1}, {&__pyx_n_s_x1, __pyx_k_x1, sizeof(__pyx_k_x1), 0, 0, 1, 1}, {&__pyx_n_s_x1int, __pyx_k_x1int, sizeof(__pyx_k_x1int), 0, 0, 1, 1}, {&__pyx_n_s_x2, __pyx_k_x2, sizeof(__pyx_k_x2), 0, 0, 1, 1}, {&__pyx_n_s_x2int, __pyx_k_x2int, sizeof(__pyx_k_x2int), 0, 0, 1, 1}, {&__pyx_n_s_x3, __pyx_k_x3, sizeof(__pyx_k_x3), 0, 0, 1, 1}, {&__pyx_n_s_y, __pyx_k_y, sizeof(__pyx_k_y), 0, 0, 1, 1}, {&__pyx_n_s_y1, __pyx_k_y1, sizeof(__pyx_k_y1), 0, 0, 1, 1}, {&__pyx_n_s_y1int, __pyx_k_y1int, sizeof(__pyx_k_y1int), 0, 0, 1, 1}, {&__pyx_n_s_y2, __pyx_k_y2, sizeof(__pyx_k_y2), 0, 0, 1, 1}, {&__pyx_n_s_y2int, __pyx_k_y2int, sizeof(__pyx_k_y2int), 0, 0, 1, 1}, {&__pyx_n_s_y3, __pyx_k_y3, sizeof(__pyx_k_y3), 0, 0, 1, 1}, {&__pyx_n_s_zip, __pyx_k_zip, sizeof(__pyx_k_zip), 0, 0, 1, 1}, {0, 0, 0, 0, 0, 0, 0} }; static int __Pyx_InitCachedBuiltins(void) { __pyx_builtin_zip = __Pyx_GetBuiltinName(__pyx_n_s_zip); if (!__pyx_builtin_zip) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 145; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_builtin_range = __Pyx_GetBuiltinName(__pyx_n_s_range); if (!__pyx_builtin_range) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 145; __pyx_clineno = __LINE__; goto __pyx_L1_error;} return 0; __pyx_L1_error:; return -1; } static int __Pyx_InitCachedConstants(void) { __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__Pyx_InitCachedConstants", 0); /* "pygame_sdl2/gfxdraw.pyx":29 * * * def pixel(Surface surface, x, y, color): # <<<<<<<<<<<<<< * cdef Color c = Color(color) * pixelRGBA(surface.surface, x, y, c.r, c.g, c.b, c.a) */ __pyx_tuple_ = PyTuple_Pack(5, __pyx_n_s_surface, __pyx_n_s_x, __pyx_n_s_y, __pyx_n_s_color, __pyx_n_s_c); if (unlikely(!__pyx_tuple_)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 29; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_tuple_); __Pyx_GIVEREF(__pyx_tuple_); __pyx_codeobj__2 = (PyObject*)__Pyx_PyCode_New(4, 0, 5, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple_, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_tom_ab_pygame_sdl2_src_pyg, __pyx_n_s_pixel, 29, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 29; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "pygame_sdl2/gfxdraw.pyx":33 * pixelRGBA(surface.surface, x, y, c.r, c.g, c.b, c.a) * * def hline(Surface surface, x1, x2, y, color): # <<<<<<<<<<<<<< * cdef Color c = Color(color) * hlineRGBA(surface.surface, x1, x2, y, c.r, c.g, c.b, c.a) */ __pyx_tuple__3 = PyTuple_Pack(6, __pyx_n_s_surface, __pyx_n_s_x1, __pyx_n_s_x2, __pyx_n_s_y, __pyx_n_s_color, __pyx_n_s_c); if (unlikely(!__pyx_tuple__3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 33; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_tuple__3); __Pyx_GIVEREF(__pyx_tuple__3); __pyx_codeobj__4 = (PyObject*)__Pyx_PyCode_New(5, 0, 6, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__3, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_tom_ab_pygame_sdl2_src_pyg, __pyx_n_s_hline, 33, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 33; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "pygame_sdl2/gfxdraw.pyx":37 * hlineRGBA(surface.surface, x1, x2, y, c.r, c.g, c.b, c.a) * * def vline(Surface surface, x, y1, y2, color): # <<<<<<<<<<<<<< * cdef Color c = Color(color) * vlineRGBA(surface.surface, x, y1, y2, c.r, c.g, c.b, c.a) */ __pyx_tuple__5 = PyTuple_Pack(6, __pyx_n_s_surface, __pyx_n_s_x, __pyx_n_s_y1, __pyx_n_s_y2, __pyx_n_s_color, __pyx_n_s_c); if (unlikely(!__pyx_tuple__5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 37; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_tuple__5); __Pyx_GIVEREF(__pyx_tuple__5); __pyx_codeobj__6 = (PyObject*)__Pyx_PyCode_New(5, 0, 6, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__5, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_tom_ab_pygame_sdl2_src_pyg, __pyx_n_s_vline, 37, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 37; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "pygame_sdl2/gfxdraw.pyx":41 * vlineRGBA(surface.surface, x, y1, y2, c.r, c.g, c.b, c.a) * * def rectangle(Surface surface, rect, color): # <<<<<<<<<<<<<< * cdef Color c = Color(color) * if not isinstance(rect, Rect): */ __pyx_tuple__7 = PyTuple_Pack(4, __pyx_n_s_surface, __pyx_n_s_rect, __pyx_n_s_color, __pyx_n_s_c); if (unlikely(!__pyx_tuple__7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 41; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_tuple__7); __Pyx_GIVEREF(__pyx_tuple__7); __pyx_codeobj__8 = (PyObject*)__Pyx_PyCode_New(3, 0, 4, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__7, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_tom_ab_pygame_sdl2_src_pyg, __pyx_n_s_rectangle, 41, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 41; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "pygame_sdl2/gfxdraw.pyx":47 * rectangleRGBA(surface.surface, rect.x, rect.y, rect.x + rect.w, rect.y + rect.h, c.r, c.g, c.b, c.a) * * def rounded_rectangle(Surface surface, rect, rad, color): # <<<<<<<<<<<<<< * cdef Color c = Color(color) * if not isinstance(rect, Rect): */ __pyx_tuple__9 = PyTuple_Pack(5, __pyx_n_s_surface, __pyx_n_s_rect, __pyx_n_s_rad, __pyx_n_s_color, __pyx_n_s_c); if (unlikely(!__pyx_tuple__9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 47; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_tuple__9); __Pyx_GIVEREF(__pyx_tuple__9); __pyx_codeobj__10 = (PyObject*)__Pyx_PyCode_New(4, 0, 5, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__9, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_tom_ab_pygame_sdl2_src_pyg, __pyx_n_s_rounded_rectangle, 47, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 47; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "pygame_sdl2/gfxdraw.pyx":53 * roundedRectangleRGBA(surface.surface, rect.x, rect.y, rect.x + rect.w, rect.y + rect.h, rad, c.r, c.g, c.b, c.a) * * def box(Surface surface, rect, color): # <<<<<<<<<<<<<< * cdef Color c = Color(color) * if not isinstance(rect, Rect): */ __pyx_tuple__11 = PyTuple_Pack(4, __pyx_n_s_surface, __pyx_n_s_rect, __pyx_n_s_color, __pyx_n_s_c); if (unlikely(!__pyx_tuple__11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 53; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_tuple__11); __Pyx_GIVEREF(__pyx_tuple__11); __pyx_codeobj__12 = (PyObject*)__Pyx_PyCode_New(3, 0, 4, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__11, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_tom_ab_pygame_sdl2_src_pyg, __pyx_n_s_box, 53, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__12)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 53; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "pygame_sdl2/gfxdraw.pyx":59 * boxRGBA(surface.surface, rect.x, rect.y, rect.x + rect.w, rect.y + rect.h, c.r, c.g, c.b, c.a) * * def rounded_box(Surface surface, rect, rad, color): # <<<<<<<<<<<<<< * cdef Color c = Color(color) * if not isinstance(rect, Rect): */ __pyx_tuple__13 = PyTuple_Pack(5, __pyx_n_s_surface, __pyx_n_s_rect, __pyx_n_s_rad, __pyx_n_s_color, __pyx_n_s_c); if (unlikely(!__pyx_tuple__13)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 59; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_tuple__13); __Pyx_GIVEREF(__pyx_tuple__13); __pyx_codeobj__14 = (PyObject*)__Pyx_PyCode_New(4, 0, 5, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__13, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_tom_ab_pygame_sdl2_src_pyg, __pyx_n_s_rounded_box, 59, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__14)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 59; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "pygame_sdl2/gfxdraw.pyx":65 * roundedBoxRGBA(surface.surface, rect.x, rect.y, rect.x + rect.w, rect.y + rect.h, rad, c.r, c.g, c.b, c.a) * * def line(Surface surface, x1, y1, x2, y2, color): # <<<<<<<<<<<<<< * cdef Color c = Color(color) * lineRGBA(surface.surface, x1, y1, x2, y2, c.r, c.g, c.b, c.a) */ __pyx_tuple__15 = PyTuple_Pack(7, __pyx_n_s_surface, __pyx_n_s_x1, __pyx_n_s_y1, __pyx_n_s_x2, __pyx_n_s_y2, __pyx_n_s_color, __pyx_n_s_c); if (unlikely(!__pyx_tuple__15)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 65; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_tuple__15); __Pyx_GIVEREF(__pyx_tuple__15); __pyx_codeobj__16 = (PyObject*)__Pyx_PyCode_New(6, 0, 7, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__15, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_tom_ab_pygame_sdl2_src_pyg, __pyx_n_s_line, 65, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__16)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 65; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "pygame_sdl2/gfxdraw.pyx":69 * lineRGBA(surface.surface, x1, y1, x2, y2, c.r, c.g, c.b, c.a) * * def aaline(Surface surface, x1, y1, x2, y2, color): # <<<<<<<<<<<<<< * cdef Color c = Color(color) * aalineRGBA(surface.surface, x1, y1, x2, y2, c.r, c.g, c.b, c.a) */ __pyx_tuple__17 = PyTuple_Pack(7, __pyx_n_s_surface, __pyx_n_s_x1, __pyx_n_s_y1, __pyx_n_s_x2, __pyx_n_s_y2, __pyx_n_s_color, __pyx_n_s_c); if (unlikely(!__pyx_tuple__17)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 69; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_tuple__17); __Pyx_GIVEREF(__pyx_tuple__17); __pyx_codeobj__18 = (PyObject*)__Pyx_PyCode_New(6, 0, 7, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__17, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_tom_ab_pygame_sdl2_src_pyg, __pyx_n_s_aaline, 69, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__18)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 69; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "pygame_sdl2/gfxdraw.pyx":73 * aalineRGBA(surface.surface, x1, y1, x2, y2, c.r, c.g, c.b, c.a) * * def thick_line(Surface surface, x1, y1, x2, y2, width, color): # <<<<<<<<<<<<<< * cdef Color c = Color(color) * */ __pyx_tuple__19 = PyTuple_Pack(12, __pyx_n_s_surface, __pyx_n_s_x1, __pyx_n_s_y1, __pyx_n_s_x2, __pyx_n_s_y2, __pyx_n_s_width, __pyx_n_s_color, __pyx_n_s_c, __pyx_n_s_x1int, __pyx_n_s_y1int, __pyx_n_s_x2int, __pyx_n_s_y2int); if (unlikely(!__pyx_tuple__19)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 73; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_tuple__19); __Pyx_GIVEREF(__pyx_tuple__19); __pyx_codeobj__20 = (PyObject*)__Pyx_PyCode_New(7, 0, 12, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__19, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_tom_ab_pygame_sdl2_src_pyg, __pyx_n_s_thick_line, 73, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__20)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 73; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "pygame_sdl2/gfxdraw.pyx":90 * thickLineRGBA(surface.surface, x1int, y1int, x2int, y2int, width, c.r, c.g, c.b, c.a) * * def circle(Surface surface, x, y, r, color): # <<<<<<<<<<<<<< * cdef Color c = Color(color) * circleRGBA(surface.surface, x, y, r, c.r, c.g, c.b, c.a) */ __pyx_tuple__21 = PyTuple_Pack(6, __pyx_n_s_surface, __pyx_n_s_x, __pyx_n_s_y, __pyx_n_s_r, __pyx_n_s_color, __pyx_n_s_c); if (unlikely(!__pyx_tuple__21)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 90; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_tuple__21); __Pyx_GIVEREF(__pyx_tuple__21); __pyx_codeobj__22 = (PyObject*)__Pyx_PyCode_New(5, 0, 6, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__21, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_tom_ab_pygame_sdl2_src_pyg, __pyx_n_s_circle, 90, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__22)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 90; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "pygame_sdl2/gfxdraw.pyx":94 * circleRGBA(surface.surface, x, y, r, c.r, c.g, c.b, c.a) * * def arc(Surface surface, x, y, r, start, end, color): # <<<<<<<<<<<<<< * cdef Color c = Color(color) * arcRGBA(surface.surface, x, y, r, start, end, c.r, c.g, c.b, c.a) */ __pyx_tuple__23 = PyTuple_Pack(8, __pyx_n_s_surface, __pyx_n_s_x, __pyx_n_s_y, __pyx_n_s_r, __pyx_n_s_start, __pyx_n_s_end, __pyx_n_s_color, __pyx_n_s_c); if (unlikely(!__pyx_tuple__23)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 94; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_tuple__23); __Pyx_GIVEREF(__pyx_tuple__23); __pyx_codeobj__24 = (PyObject*)__Pyx_PyCode_New(7, 0, 8, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__23, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_tom_ab_pygame_sdl2_src_pyg, __pyx_n_s_arc, 94, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__24)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 94; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "pygame_sdl2/gfxdraw.pyx":98 * arcRGBA(surface.surface, x, y, r, start, end, c.r, c.g, c.b, c.a) * * def aacircle(Surface surface, x, y, r, color): # <<<<<<<<<<<<<< * cdef Color c = Color(color) * aacircleRGBA(surface.surface, x, y, r, c.r, c.g, c.b, c.a) */ __pyx_tuple__25 = PyTuple_Pack(6, __pyx_n_s_surface, __pyx_n_s_x, __pyx_n_s_y, __pyx_n_s_r, __pyx_n_s_color, __pyx_n_s_c); if (unlikely(!__pyx_tuple__25)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 98; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_tuple__25); __Pyx_GIVEREF(__pyx_tuple__25); __pyx_codeobj__26 = (PyObject*)__Pyx_PyCode_New(5, 0, 6, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__25, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_tom_ab_pygame_sdl2_src_pyg, __pyx_n_s_aacircle, 98, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__26)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 98; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "pygame_sdl2/gfxdraw.pyx":102 * aacircleRGBA(surface.surface, x, y, r, c.r, c.g, c.b, c.a) * * def filled_circle(Surface surface, x, y, r, color): # <<<<<<<<<<<<<< * cdef Color c = Color(color) * filledCircleRGBA(surface.surface, x, y, r, c.r, c.g, c.b, c.a) */ __pyx_tuple__27 = PyTuple_Pack(6, __pyx_n_s_surface, __pyx_n_s_x, __pyx_n_s_y, __pyx_n_s_r, __pyx_n_s_color, __pyx_n_s_c); if (unlikely(!__pyx_tuple__27)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 102; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_tuple__27); __Pyx_GIVEREF(__pyx_tuple__27); __pyx_codeobj__28 = (PyObject*)__Pyx_PyCode_New(5, 0, 6, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__27, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_tom_ab_pygame_sdl2_src_pyg, __pyx_n_s_filled_circle, 102, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__28)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 102; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "pygame_sdl2/gfxdraw.pyx":106 * filledCircleRGBA(surface.surface, x, y, r, c.r, c.g, c.b, c.a) * * def ellipse(Surface surface, x, y, rx, ry, color): # <<<<<<<<<<<<<< * cdef Color c = Color(color) * ellipseRGBA(surface.surface, x, y, rx, ry, c.r, c.g, c.b, c.a) */ __pyx_tuple__29 = PyTuple_Pack(7, __pyx_n_s_surface, __pyx_n_s_x, __pyx_n_s_y, __pyx_n_s_rx, __pyx_n_s_ry, __pyx_n_s_color, __pyx_n_s_c); if (unlikely(!__pyx_tuple__29)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 106; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_tuple__29); __Pyx_GIVEREF(__pyx_tuple__29); __pyx_codeobj__30 = (PyObject*)__Pyx_PyCode_New(6, 0, 7, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__29, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_tom_ab_pygame_sdl2_src_pyg, __pyx_n_s_ellipse, 106, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__30)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 106; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "pygame_sdl2/gfxdraw.pyx":110 * ellipseRGBA(surface.surface, x, y, rx, ry, c.r, c.g, c.b, c.a) * * def aaellipse(Surface surface, x, y, rx, ry, color): # <<<<<<<<<<<<<< * cdef Color c = Color(color) * aaellipseRGBA(surface.surface, x, y, rx, ry, c.r, c.g, c.b, c.a) */ __pyx_tuple__31 = PyTuple_Pack(7, __pyx_n_s_surface, __pyx_n_s_x, __pyx_n_s_y, __pyx_n_s_rx, __pyx_n_s_ry, __pyx_n_s_color, __pyx_n_s_c); if (unlikely(!__pyx_tuple__31)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 110; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_tuple__31); __Pyx_GIVEREF(__pyx_tuple__31); __pyx_codeobj__32 = (PyObject*)__Pyx_PyCode_New(6, 0, 7, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__31, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_tom_ab_pygame_sdl2_src_pyg, __pyx_n_s_aaellipse, 110, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__32)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 110; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "pygame_sdl2/gfxdraw.pyx":114 * aaellipseRGBA(surface.surface, x, y, rx, ry, c.r, c.g, c.b, c.a) * * def filled_ellipse(Surface surface, x, y, rx, ry, color): # <<<<<<<<<<<<<< * cdef Color c = Color(color) * filledEllipseRGBA(surface.surface, x, y, rx, ry, c.r, c.g, c.b, c.a) */ __pyx_tuple__33 = PyTuple_Pack(7, __pyx_n_s_surface, __pyx_n_s_x, __pyx_n_s_y, __pyx_n_s_rx, __pyx_n_s_ry, __pyx_n_s_color, __pyx_n_s_c); if (unlikely(!__pyx_tuple__33)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 114; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_tuple__33); __Pyx_GIVEREF(__pyx_tuple__33); __pyx_codeobj__34 = (PyObject*)__Pyx_PyCode_New(6, 0, 7, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__33, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_tom_ab_pygame_sdl2_src_pyg, __pyx_n_s_filled_ellipse, 114, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__34)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 114; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "pygame_sdl2/gfxdraw.pyx":118 * filledEllipseRGBA(surface.surface, x, y, rx, ry, c.r, c.g, c.b, c.a) * * def pie(Surface surface, x, y, r, start, end, color): # <<<<<<<<<<<<<< * cdef Color c = Color(color) * pieRGBA(surface.surface, x, y, r, start, end, c.r, c.g, c.b, c.a) */ __pyx_tuple__35 = PyTuple_Pack(8, __pyx_n_s_surface, __pyx_n_s_x, __pyx_n_s_y, __pyx_n_s_r, __pyx_n_s_start, __pyx_n_s_end, __pyx_n_s_color, __pyx_n_s_c); if (unlikely(!__pyx_tuple__35)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 118; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_tuple__35); __Pyx_GIVEREF(__pyx_tuple__35); __pyx_codeobj__36 = (PyObject*)__Pyx_PyCode_New(7, 0, 8, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__35, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_tom_ab_pygame_sdl2_src_pyg, __pyx_n_s_pie, 118, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__36)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 118; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "pygame_sdl2/gfxdraw.pyx":122 * pieRGBA(surface.surface, x, y, r, start, end, c.r, c.g, c.b, c.a) * * def filled_pie(Surface surface, x, y, r, start, end, color): # <<<<<<<<<<<<<< * cdef Color c = Color(color) * filledPieRGBA(surface.surface, x, y, r, start, end, c.r, c.g, c.b, c.a) */ __pyx_tuple__37 = PyTuple_Pack(8, __pyx_n_s_surface, __pyx_n_s_x, __pyx_n_s_y, __pyx_n_s_r, __pyx_n_s_start, __pyx_n_s_end, __pyx_n_s_color, __pyx_n_s_c); if (unlikely(!__pyx_tuple__37)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 122; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_tuple__37); __Pyx_GIVEREF(__pyx_tuple__37); __pyx_codeobj__38 = (PyObject*)__Pyx_PyCode_New(7, 0, 8, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__37, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_tom_ab_pygame_sdl2_src_pyg, __pyx_n_s_filled_pie, 122, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__38)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 122; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "pygame_sdl2/gfxdraw.pyx":126 * filledPieRGBA(surface.surface, x, y, r, start, end, c.r, c.g, c.b, c.a) * * def trigon(Surface surface, x1, y1, x2, y2, x3, y3, color): # <<<<<<<<<<<<<< * cdef Color c = Color(color) * trigonRGBA(surface.surface, x1, y1, x2, y2, x3, y3, c.r, c.g, c.b, c.a) */ __pyx_tuple__39 = PyTuple_Pack(9, __pyx_n_s_surface, __pyx_n_s_x1, __pyx_n_s_y1, __pyx_n_s_x2, __pyx_n_s_y2, __pyx_n_s_x3, __pyx_n_s_y3, __pyx_n_s_color, __pyx_n_s_c); if (unlikely(!__pyx_tuple__39)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 126; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_tuple__39); __Pyx_GIVEREF(__pyx_tuple__39); __pyx_codeobj__40 = (PyObject*)__Pyx_PyCode_New(8, 0, 9, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__39, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_tom_ab_pygame_sdl2_src_pyg, __pyx_n_s_trigon, 126, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__40)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 126; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "pygame_sdl2/gfxdraw.pyx":130 * trigonRGBA(surface.surface, x1, y1, x2, y2, x3, y3, c.r, c.g, c.b, c.a) * * def aatrigon(Surface surface, x1, y1, x2, y2, x3, y3, color): # <<<<<<<<<<<<<< * cdef Color c = Color(color) * aatrigonRGBA(surface.surface, x1, y1, x2, y2, x3, y3, c.r, c.g, c.b, c.a) */ __pyx_tuple__41 = PyTuple_Pack(9, __pyx_n_s_surface, __pyx_n_s_x1, __pyx_n_s_y1, __pyx_n_s_x2, __pyx_n_s_y2, __pyx_n_s_x3, __pyx_n_s_y3, __pyx_n_s_color, __pyx_n_s_c); if (unlikely(!__pyx_tuple__41)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 130; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_tuple__41); __Pyx_GIVEREF(__pyx_tuple__41); __pyx_codeobj__42 = (PyObject*)__Pyx_PyCode_New(8, 0, 9, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__41, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_tom_ab_pygame_sdl2_src_pyg, __pyx_n_s_aatrigon, 130, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__42)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 130; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "pygame_sdl2/gfxdraw.pyx":134 * aatrigonRGBA(surface.surface, x1, y1, x2, y2, x3, y3, c.r, c.g, c.b, c.a) * * def filled_trigon(Surface surface, x1, y1, x2, y2, x3, y3, color): # <<<<<<<<<<<<<< * cdef Color c = Color(color) * filledTrigonRGBA(surface.surface, x1, y1, x2, y2, x3, y3, c.r, c.g, c.b, c.a) */ __pyx_tuple__43 = PyTuple_Pack(9, __pyx_n_s_surface, __pyx_n_s_x1, __pyx_n_s_y1, __pyx_n_s_x2, __pyx_n_s_y2, __pyx_n_s_x3, __pyx_n_s_y3, __pyx_n_s_color, __pyx_n_s_c); if (unlikely(!__pyx_tuple__43)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 134; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_tuple__43); __Pyx_GIVEREF(__pyx_tuple__43); __pyx_codeobj__44 = (PyObject*)__Pyx_PyCode_New(8, 0, 9, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__43, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_tom_ab_pygame_sdl2_src_pyg, __pyx_n_s_filled_trigon, 134, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__44)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 134; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "pygame_sdl2/gfxdraw.pyx":138 * filledTrigonRGBA(surface.surface, x1, y1, x2, y2, x3, y3, c.r, c.g, c.b, c.a) * * def polygon(Surface surface, points, color): # <<<<<<<<<<<<<< * cdef Color c = Color(color) * cdef Sint16 *vx */ __pyx_tuple__45 = PyTuple_Pack(9, __pyx_n_s_surface, __pyx_n_s_points, __pyx_n_s_color, __pyx_n_s_c, __pyx_n_s_vx, __pyx_n_s_vy, __pyx_n_s_num_points, __pyx_n_s_n, __pyx_n_s_pt); if (unlikely(!__pyx_tuple__45)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 138; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_tuple__45); __Pyx_GIVEREF(__pyx_tuple__45); __pyx_codeobj__46 = (PyObject*)__Pyx_PyCode_New(3, 0, 9, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__45, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_tom_ab_pygame_sdl2_src_pyg, __pyx_n_s_polygon, 138, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__46)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 138; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "pygame_sdl2/gfxdraw.pyx":151 * free(vy) * * def aapolygon(Surface surface, points, color): # <<<<<<<<<<<<<< * cdef Color c = Color(color) * cdef Sint16 *vx */ __pyx_tuple__47 = PyTuple_Pack(9, __pyx_n_s_surface, __pyx_n_s_points, __pyx_n_s_color, __pyx_n_s_c, __pyx_n_s_vx, __pyx_n_s_vy, __pyx_n_s_num_points, __pyx_n_s_n, __pyx_n_s_pt); if (unlikely(!__pyx_tuple__47)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 151; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_tuple__47); __Pyx_GIVEREF(__pyx_tuple__47); __pyx_codeobj__48 = (PyObject*)__Pyx_PyCode_New(3, 0, 9, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__47, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_tom_ab_pygame_sdl2_src_pyg, __pyx_n_s_aapolygon, 151, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__48)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 151; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "pygame_sdl2/gfxdraw.pyx":164 * free(vy) * * def filled_polygon(Surface surface, points, color): # <<<<<<<<<<<<<< * cdef Color c = Color(color) * cdef Sint16 *vx */ __pyx_tuple__49 = PyTuple_Pack(9, __pyx_n_s_surface, __pyx_n_s_points, __pyx_n_s_color, __pyx_n_s_c, __pyx_n_s_vx, __pyx_n_s_vy, __pyx_n_s_num_points, __pyx_n_s_n, __pyx_n_s_pt); if (unlikely(!__pyx_tuple__49)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 164; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_tuple__49); __Pyx_GIVEREF(__pyx_tuple__49); __pyx_codeobj__50 = (PyObject*)__Pyx_PyCode_New(3, 0, 9, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__49, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_tom_ab_pygame_sdl2_src_pyg, __pyx_n_s_filled_polygon, 164, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__50)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 164; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "pygame_sdl2/gfxdraw.pyx":177 * free(vy) * * def textured_polygon(Surface surface, points, Surface texture not None, tx, ty): # <<<<<<<<<<<<<< * cdef Sint16 *vx * cdef Sint16 *vy */ __pyx_tuple__51 = PyTuple_Pack(10, __pyx_n_s_surface, __pyx_n_s_points, __pyx_n_s_texture, __pyx_n_s_tx, __pyx_n_s_ty, __pyx_n_s_vx, __pyx_n_s_vy, __pyx_n_s_num_points, __pyx_n_s_n, __pyx_n_s_pt); if (unlikely(!__pyx_tuple__51)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 177; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_tuple__51); __Pyx_GIVEREF(__pyx_tuple__51); __pyx_codeobj__52 = (PyObject*)__Pyx_PyCode_New(5, 0, 10, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__51, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_tom_ab_pygame_sdl2_src_pyg, __pyx_n_s_textured_polygon, 177, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__52)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 177; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "pygame_sdl2/gfxdraw.pyx":189 * free(vy) * * def bezier(Surface surface, points, steps, color): # <<<<<<<<<<<<<< * cdef Color c = Color(color) * cdef Sint16 *vx */ __pyx_tuple__53 = PyTuple_Pack(10, __pyx_n_s_surface, __pyx_n_s_points, __pyx_n_s_steps, __pyx_n_s_color, __pyx_n_s_c, __pyx_n_s_vx, __pyx_n_s_vy, __pyx_n_s_num_points, __pyx_n_s_n, __pyx_n_s_pt); if (unlikely(!__pyx_tuple__53)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 189; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_tuple__53); __Pyx_GIVEREF(__pyx_tuple__53); __pyx_codeobj__54 = (PyObject*)__Pyx_PyCode_New(4, 0, 10, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__53, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_tom_ab_pygame_sdl2_src_pyg, __pyx_n_s_bezier, 189, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__54)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 189; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_RefNannyFinishContext(); return 0; __pyx_L1_error:; __Pyx_RefNannyFinishContext(); return -1; } static int __Pyx_InitGlobals(void) { if (__Pyx_InitStrings(__pyx_string_tab) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; return 0; __pyx_L1_error:; return -1; } #if PY_MAJOR_VERSION < 3 PyMODINIT_FUNC initgfxdraw(void); /*proto*/ PyMODINIT_FUNC initgfxdraw(void) #else PyMODINIT_FUNC PyInit_gfxdraw(void); /*proto*/ PyMODINIT_FUNC PyInit_gfxdraw(void) #endif { PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannyDeclarations #if CYTHON_REFNANNY __Pyx_RefNanny = __Pyx_RefNannyImportAPI("refnanny"); if (!__Pyx_RefNanny) { PyErr_Clear(); __Pyx_RefNanny = __Pyx_RefNannyImportAPI("Cython.Runtime.refnanny"); if (!__Pyx_RefNanny) Py_FatalError("failed to import 'refnanny' module"); } #endif __Pyx_RefNannySetupContext("PyMODINIT_FUNC PyInit_gfxdraw(void)", 0); if (__Pyx_check_binary_version() < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_empty_tuple = PyTuple_New(0); if (unlikely(!__pyx_empty_tuple)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_empty_bytes = PyBytes_FromStringAndSize("", 0); if (unlikely(!__pyx_empty_bytes)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} #ifdef __Pyx_CyFunction_USED if (__pyx_CyFunction_init() < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} #endif #ifdef __Pyx_FusedFunction_USED if (__pyx_FusedFunction_init() < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} #endif #ifdef __Pyx_Coroutine_USED if (__pyx_Coroutine_init() < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} #endif #ifdef __Pyx_Generator_USED if (__pyx_Generator_init() < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} #endif #ifdef __Pyx_StopAsyncIteration_USED if (__pyx_StopAsyncIteration_init() < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} #endif /*--- Library function declarations ---*/ /*--- Threads initialization code ---*/ #if defined(__PYX_FORCE_INIT_THREADS) && __PYX_FORCE_INIT_THREADS #ifdef WITH_THREAD /* Python build with threading support? */ PyEval_InitThreads(); #endif #endif /*--- Module creation code ---*/ #if PY_MAJOR_VERSION < 3 __pyx_m = Py_InitModule4("gfxdraw", __pyx_methods, 0, 0, PYTHON_API_VERSION); Py_XINCREF(__pyx_m); #else __pyx_m = PyModule_Create(&__pyx_moduledef); #endif if (unlikely(!__pyx_m)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_d = PyModule_GetDict(__pyx_m); if (unlikely(!__pyx_d)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} Py_INCREF(__pyx_d); __pyx_b = PyImport_AddModule(__Pyx_BUILTIN_MODULE_NAME); if (unlikely(!__pyx_b)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} #if CYTHON_COMPILING_IN_PYPY Py_INCREF(__pyx_b); #endif if (PyObject_SetAttrString(__pyx_m, "__builtins__", __pyx_b) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; /*--- Initialize various global constants etc. ---*/ if (__Pyx_InitGlobals() < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} #if PY_MAJOR_VERSION < 3 && (__PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT) if (__Pyx_init_sys_getdefaultencoding_params() < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} #endif if (__pyx_module_is_main_pygame_sdl2__gfxdraw) { if (PyObject_SetAttrString(__pyx_m, "__name__", __pyx_n_s_main) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } #if PY_MAJOR_VERSION >= 3 { PyObject *modules = PyImport_GetModuleDict(); if (unlikely(!modules)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} if (!PyDict_GetItemString(modules, "pygame_sdl2.gfxdraw")) { if (unlikely(PyDict_SetItemString(modules, "pygame_sdl2.gfxdraw", __pyx_m) < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } } #endif /*--- Builtin init code ---*/ if (__Pyx_InitCachedBuiltins() < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /*--- Constants init code ---*/ if (__Pyx_InitCachedConstants() < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /*--- Global init code ---*/ /*--- Variable export code ---*/ /*--- Function export code ---*/ /*--- Type init code ---*/ /*--- Type import code ---*/ __pyx_ptype_11pygame_sdl2_7surface_Surface = __Pyx_ImportType("pygame_sdl2.surface", "Surface", sizeof(struct __pyx_obj_11pygame_sdl2_7surface_Surface), 1); if (unlikely(!__pyx_ptype_11pygame_sdl2_7surface_Surface)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 23; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_vtabptr_11pygame_sdl2_7surface_Surface = (struct __pyx_vtabstruct_11pygame_sdl2_7surface_Surface*)__Pyx_GetVtable(__pyx_ptype_11pygame_sdl2_7surface_Surface->tp_dict); if (unlikely(!__pyx_vtabptr_11pygame_sdl2_7surface_Surface)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 23; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_ptype_11pygame_sdl2_5color_Color = __Pyx_ImportType("pygame_sdl2.color", "Color", sizeof(struct __pyx_obj_11pygame_sdl2_5color_Color), 1); if (unlikely(!__pyx_ptype_11pygame_sdl2_5color_Color)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 26; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_vtabptr_11pygame_sdl2_5color_Color = (struct __pyx_vtabstruct_11pygame_sdl2_5color_Color*)__Pyx_GetVtable(__pyx_ptype_11pygame_sdl2_5color_Color->tp_dict); if (unlikely(!__pyx_vtabptr_11pygame_sdl2_5color_Color)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 26; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /*--- Variable import code ---*/ /*--- Function import code ---*/ /*--- Execution code ---*/ #if defined(__Pyx_Generator_USED) || defined(__Pyx_Coroutine_USED) if (__Pyx_patch_abc() < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} #endif /* "pygame_sdl2/gfxdraw.pyx":25 * from pygame_sdl2.color cimport Color * * from pygame_sdl2.error import error # <<<<<<<<<<<<<< * from pygame_sdl2.rect import Rect * */ __pyx_t_1 = PyList_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 25; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __Pyx_INCREF(__pyx_n_s_error); __Pyx_GIVEREF(__pyx_n_s_error); PyList_SET_ITEM(__pyx_t_1, 0, __pyx_n_s_error); __pyx_t_2 = __Pyx_Import(__pyx_n_s_pygame_sdl2_error, __pyx_t_1, -1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 25; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_1 = __Pyx_ImportFrom(__pyx_t_2, __pyx_n_s_error); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 25; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); if (PyDict_SetItem(__pyx_d, __pyx_n_s_error, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 25; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "pygame_sdl2/gfxdraw.pyx":26 * * from pygame_sdl2.error import error * from pygame_sdl2.rect import Rect # <<<<<<<<<<<<<< * * */ __pyx_t_2 = PyList_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 26; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __Pyx_INCREF(__pyx_n_s_Rect); __Pyx_GIVEREF(__pyx_n_s_Rect); PyList_SET_ITEM(__pyx_t_2, 0, __pyx_n_s_Rect); __pyx_t_1 = __Pyx_Import(__pyx_n_s_pygame_sdl2_rect, __pyx_t_2, -1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 26; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_2 = __Pyx_ImportFrom(__pyx_t_1, __pyx_n_s_Rect); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 26; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_Rect, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 26; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "pygame_sdl2/gfxdraw.pyx":29 * * * def pixel(Surface surface, x, y, color): # <<<<<<<<<<<<<< * cdef Color c = Color(color) * pixelRGBA(surface.surface, x, y, c.r, c.g, c.b, c.a) */ __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_11pygame_sdl2_7gfxdraw_1pixel, NULL, __pyx_n_s_pygame_sdl2_gfxdraw); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 29; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); if (PyDict_SetItem(__pyx_d, __pyx_n_s_pixel, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 29; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "pygame_sdl2/gfxdraw.pyx":33 * pixelRGBA(surface.surface, x, y, c.r, c.g, c.b, c.a) * * def hline(Surface surface, x1, x2, y, color): # <<<<<<<<<<<<<< * cdef Color c = Color(color) * hlineRGBA(surface.surface, x1, x2, y, c.r, c.g, c.b, c.a) */ __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_11pygame_sdl2_7gfxdraw_3hline, NULL, __pyx_n_s_pygame_sdl2_gfxdraw); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 33; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); if (PyDict_SetItem(__pyx_d, __pyx_n_s_hline, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 33; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "pygame_sdl2/gfxdraw.pyx":37 * hlineRGBA(surface.surface, x1, x2, y, c.r, c.g, c.b, c.a) * * def vline(Surface surface, x, y1, y2, color): # <<<<<<<<<<<<<< * cdef Color c = Color(color) * vlineRGBA(surface.surface, x, y1, y2, c.r, c.g, c.b, c.a) */ __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_11pygame_sdl2_7gfxdraw_5vline, NULL, __pyx_n_s_pygame_sdl2_gfxdraw); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 37; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); if (PyDict_SetItem(__pyx_d, __pyx_n_s_vline, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 37; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "pygame_sdl2/gfxdraw.pyx":41 * vlineRGBA(surface.surface, x, y1, y2, c.r, c.g, c.b, c.a) * * def rectangle(Surface surface, rect, color): # <<<<<<<<<<<<<< * cdef Color c = Color(color) * if not isinstance(rect, Rect): */ __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_11pygame_sdl2_7gfxdraw_7rectangle, NULL, __pyx_n_s_pygame_sdl2_gfxdraw); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 41; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); if (PyDict_SetItem(__pyx_d, __pyx_n_s_rectangle, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 41; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "pygame_sdl2/gfxdraw.pyx":47 * rectangleRGBA(surface.surface, rect.x, rect.y, rect.x + rect.w, rect.y + rect.h, c.r, c.g, c.b, c.a) * * def rounded_rectangle(Surface surface, rect, rad, color): # <<<<<<<<<<<<<< * cdef Color c = Color(color) * if not isinstance(rect, Rect): */ __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_11pygame_sdl2_7gfxdraw_9rounded_rectangle, NULL, __pyx_n_s_pygame_sdl2_gfxdraw); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 47; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); if (PyDict_SetItem(__pyx_d, __pyx_n_s_rounded_rectangle, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 47; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "pygame_sdl2/gfxdraw.pyx":53 * roundedRectangleRGBA(surface.surface, rect.x, rect.y, rect.x + rect.w, rect.y + rect.h, rad, c.r, c.g, c.b, c.a) * * def box(Surface surface, rect, color): # <<<<<<<<<<<<<< * cdef Color c = Color(color) * if not isinstance(rect, Rect): */ __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_11pygame_sdl2_7gfxdraw_11box, NULL, __pyx_n_s_pygame_sdl2_gfxdraw); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 53; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); if (PyDict_SetItem(__pyx_d, __pyx_n_s_box, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 53; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "pygame_sdl2/gfxdraw.pyx":59 * boxRGBA(surface.surface, rect.x, rect.y, rect.x + rect.w, rect.y + rect.h, c.r, c.g, c.b, c.a) * * def rounded_box(Surface surface, rect, rad, color): # <<<<<<<<<<<<<< * cdef Color c = Color(color) * if not isinstance(rect, Rect): */ __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_11pygame_sdl2_7gfxdraw_13rounded_box, NULL, __pyx_n_s_pygame_sdl2_gfxdraw); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 59; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); if (PyDict_SetItem(__pyx_d, __pyx_n_s_rounded_box, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 59; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "pygame_sdl2/gfxdraw.pyx":65 * roundedBoxRGBA(surface.surface, rect.x, rect.y, rect.x + rect.w, rect.y + rect.h, rad, c.r, c.g, c.b, c.a) * * def line(Surface surface, x1, y1, x2, y2, color): # <<<<<<<<<<<<<< * cdef Color c = Color(color) * lineRGBA(surface.surface, x1, y1, x2, y2, c.r, c.g, c.b, c.a) */ __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_11pygame_sdl2_7gfxdraw_15line, NULL, __pyx_n_s_pygame_sdl2_gfxdraw); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 65; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); if (PyDict_SetItem(__pyx_d, __pyx_n_s_line, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 65; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "pygame_sdl2/gfxdraw.pyx":69 * lineRGBA(surface.surface, x1, y1, x2, y2, c.r, c.g, c.b, c.a) * * def aaline(Surface surface, x1, y1, x2, y2, color): # <<<<<<<<<<<<<< * cdef Color c = Color(color) * aalineRGBA(surface.surface, x1, y1, x2, y2, c.r, c.g, c.b, c.a) */ __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_11pygame_sdl2_7gfxdraw_17aaline, NULL, __pyx_n_s_pygame_sdl2_gfxdraw); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 69; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); if (PyDict_SetItem(__pyx_d, __pyx_n_s_aaline, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 69; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "pygame_sdl2/gfxdraw.pyx":73 * aalineRGBA(surface.surface, x1, y1, x2, y2, c.r, c.g, c.b, c.a) * * def thick_line(Surface surface, x1, y1, x2, y2, width, color): # <<<<<<<<<<<<<< * cdef Color c = Color(color) * */ __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_11pygame_sdl2_7gfxdraw_19thick_line, NULL, __pyx_n_s_pygame_sdl2_gfxdraw); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 73; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); if (PyDict_SetItem(__pyx_d, __pyx_n_s_thick_line, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 73; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "pygame_sdl2/gfxdraw.pyx":90 * thickLineRGBA(surface.surface, x1int, y1int, x2int, y2int, width, c.r, c.g, c.b, c.a) * * def circle(Surface surface, x, y, r, color): # <<<<<<<<<<<<<< * cdef Color c = Color(color) * circleRGBA(surface.surface, x, y, r, c.r, c.g, c.b, c.a) */ __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_11pygame_sdl2_7gfxdraw_21circle, NULL, __pyx_n_s_pygame_sdl2_gfxdraw); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 90; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); if (PyDict_SetItem(__pyx_d, __pyx_n_s_circle, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 90; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "pygame_sdl2/gfxdraw.pyx":94 * circleRGBA(surface.surface, x, y, r, c.r, c.g, c.b, c.a) * * def arc(Surface surface, x, y, r, start, end, color): # <<<<<<<<<<<<<< * cdef Color c = Color(color) * arcRGBA(surface.surface, x, y, r, start, end, c.r, c.g, c.b, c.a) */ __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_11pygame_sdl2_7gfxdraw_23arc, NULL, __pyx_n_s_pygame_sdl2_gfxdraw); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 94; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); if (PyDict_SetItem(__pyx_d, __pyx_n_s_arc, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 94; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "pygame_sdl2/gfxdraw.pyx":98 * arcRGBA(surface.surface, x, y, r, start, end, c.r, c.g, c.b, c.a) * * def aacircle(Surface surface, x, y, r, color): # <<<<<<<<<<<<<< * cdef Color c = Color(color) * aacircleRGBA(surface.surface, x, y, r, c.r, c.g, c.b, c.a) */ __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_11pygame_sdl2_7gfxdraw_25aacircle, NULL, __pyx_n_s_pygame_sdl2_gfxdraw); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 98; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); if (PyDict_SetItem(__pyx_d, __pyx_n_s_aacircle, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 98; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "pygame_sdl2/gfxdraw.pyx":102 * aacircleRGBA(surface.surface, x, y, r, c.r, c.g, c.b, c.a) * * def filled_circle(Surface surface, x, y, r, color): # <<<<<<<<<<<<<< * cdef Color c = Color(color) * filledCircleRGBA(surface.surface, x, y, r, c.r, c.g, c.b, c.a) */ __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_11pygame_sdl2_7gfxdraw_27filled_circle, NULL, __pyx_n_s_pygame_sdl2_gfxdraw); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 102; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); if (PyDict_SetItem(__pyx_d, __pyx_n_s_filled_circle, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 102; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "pygame_sdl2/gfxdraw.pyx":106 * filledCircleRGBA(surface.surface, x, y, r, c.r, c.g, c.b, c.a) * * def ellipse(Surface surface, x, y, rx, ry, color): # <<<<<<<<<<<<<< * cdef Color c = Color(color) * ellipseRGBA(surface.surface, x, y, rx, ry, c.r, c.g, c.b, c.a) */ __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_11pygame_sdl2_7gfxdraw_29ellipse, NULL, __pyx_n_s_pygame_sdl2_gfxdraw); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 106; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); if (PyDict_SetItem(__pyx_d, __pyx_n_s_ellipse, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 106; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "pygame_sdl2/gfxdraw.pyx":110 * ellipseRGBA(surface.surface, x, y, rx, ry, c.r, c.g, c.b, c.a) * * def aaellipse(Surface surface, x, y, rx, ry, color): # <<<<<<<<<<<<<< * cdef Color c = Color(color) * aaellipseRGBA(surface.surface, x, y, rx, ry, c.r, c.g, c.b, c.a) */ __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_11pygame_sdl2_7gfxdraw_31aaellipse, NULL, __pyx_n_s_pygame_sdl2_gfxdraw); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 110; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); if (PyDict_SetItem(__pyx_d, __pyx_n_s_aaellipse, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 110; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "pygame_sdl2/gfxdraw.pyx":114 * aaellipseRGBA(surface.surface, x, y, rx, ry, c.r, c.g, c.b, c.a) * * def filled_ellipse(Surface surface, x, y, rx, ry, color): # <<<<<<<<<<<<<< * cdef Color c = Color(color) * filledEllipseRGBA(surface.surface, x, y, rx, ry, c.r, c.g, c.b, c.a) */ __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_11pygame_sdl2_7gfxdraw_33filled_ellipse, NULL, __pyx_n_s_pygame_sdl2_gfxdraw); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 114; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); if (PyDict_SetItem(__pyx_d, __pyx_n_s_filled_ellipse, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 114; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "pygame_sdl2/gfxdraw.pyx":118 * filledEllipseRGBA(surface.surface, x, y, rx, ry, c.r, c.g, c.b, c.a) * * def pie(Surface surface, x, y, r, start, end, color): # <<<<<<<<<<<<<< * cdef Color c = Color(color) * pieRGBA(surface.surface, x, y, r, start, end, c.r, c.g, c.b, c.a) */ __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_11pygame_sdl2_7gfxdraw_35pie, NULL, __pyx_n_s_pygame_sdl2_gfxdraw); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 118; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); if (PyDict_SetItem(__pyx_d, __pyx_n_s_pie, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 118; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "pygame_sdl2/gfxdraw.pyx":122 * pieRGBA(surface.surface, x, y, r, start, end, c.r, c.g, c.b, c.a) * * def filled_pie(Surface surface, x, y, r, start, end, color): # <<<<<<<<<<<<<< * cdef Color c = Color(color) * filledPieRGBA(surface.surface, x, y, r, start, end, c.r, c.g, c.b, c.a) */ __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_11pygame_sdl2_7gfxdraw_37filled_pie, NULL, __pyx_n_s_pygame_sdl2_gfxdraw); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 122; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); if (PyDict_SetItem(__pyx_d, __pyx_n_s_filled_pie, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 122; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "pygame_sdl2/gfxdraw.pyx":126 * filledPieRGBA(surface.surface, x, y, r, start, end, c.r, c.g, c.b, c.a) * * def trigon(Surface surface, x1, y1, x2, y2, x3, y3, color): # <<<<<<<<<<<<<< * cdef Color c = Color(color) * trigonRGBA(surface.surface, x1, y1, x2, y2, x3, y3, c.r, c.g, c.b, c.a) */ __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_11pygame_sdl2_7gfxdraw_39trigon, NULL, __pyx_n_s_pygame_sdl2_gfxdraw); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 126; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); if (PyDict_SetItem(__pyx_d, __pyx_n_s_trigon, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 126; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "pygame_sdl2/gfxdraw.pyx":130 * trigonRGBA(surface.surface, x1, y1, x2, y2, x3, y3, c.r, c.g, c.b, c.a) * * def aatrigon(Surface surface, x1, y1, x2, y2, x3, y3, color): # <<<<<<<<<<<<<< * cdef Color c = Color(color) * aatrigonRGBA(surface.surface, x1, y1, x2, y2, x3, y3, c.r, c.g, c.b, c.a) */ __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_11pygame_sdl2_7gfxdraw_41aatrigon, NULL, __pyx_n_s_pygame_sdl2_gfxdraw); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 130; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); if (PyDict_SetItem(__pyx_d, __pyx_n_s_aatrigon, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 130; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "pygame_sdl2/gfxdraw.pyx":134 * aatrigonRGBA(surface.surface, x1, y1, x2, y2, x3, y3, c.r, c.g, c.b, c.a) * * def filled_trigon(Surface surface, x1, y1, x2, y2, x3, y3, color): # <<<<<<<<<<<<<< * cdef Color c = Color(color) * filledTrigonRGBA(surface.surface, x1, y1, x2, y2, x3, y3, c.r, c.g, c.b, c.a) */ __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_11pygame_sdl2_7gfxdraw_43filled_trigon, NULL, __pyx_n_s_pygame_sdl2_gfxdraw); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 134; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); if (PyDict_SetItem(__pyx_d, __pyx_n_s_filled_trigon, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 134; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "pygame_sdl2/gfxdraw.pyx":138 * filledTrigonRGBA(surface.surface, x1, y1, x2, y2, x3, y3, c.r, c.g, c.b, c.a) * * def polygon(Surface surface, points, color): # <<<<<<<<<<<<<< * cdef Color c = Color(color) * cdef Sint16 *vx */ __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_11pygame_sdl2_7gfxdraw_45polygon, NULL, __pyx_n_s_pygame_sdl2_gfxdraw); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 138; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); if (PyDict_SetItem(__pyx_d, __pyx_n_s_polygon, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 138; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "pygame_sdl2/gfxdraw.pyx":151 * free(vy) * * def aapolygon(Surface surface, points, color): # <<<<<<<<<<<<<< * cdef Color c = Color(color) * cdef Sint16 *vx */ __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_11pygame_sdl2_7gfxdraw_47aapolygon, NULL, __pyx_n_s_pygame_sdl2_gfxdraw); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 151; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); if (PyDict_SetItem(__pyx_d, __pyx_n_s_aapolygon, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 151; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "pygame_sdl2/gfxdraw.pyx":164 * free(vy) * * def filled_polygon(Surface surface, points, color): # <<<<<<<<<<<<<< * cdef Color c = Color(color) * cdef Sint16 *vx */ __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_11pygame_sdl2_7gfxdraw_49filled_polygon, NULL, __pyx_n_s_pygame_sdl2_gfxdraw); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 164; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); if (PyDict_SetItem(__pyx_d, __pyx_n_s_filled_polygon, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 164; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "pygame_sdl2/gfxdraw.pyx":177 * free(vy) * * def textured_polygon(Surface surface, points, Surface texture not None, tx, ty): # <<<<<<<<<<<<<< * cdef Sint16 *vx * cdef Sint16 *vy */ __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_11pygame_sdl2_7gfxdraw_51textured_polygon, NULL, __pyx_n_s_pygame_sdl2_gfxdraw); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 177; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); if (PyDict_SetItem(__pyx_d, __pyx_n_s_textured_polygon, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 177; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "pygame_sdl2/gfxdraw.pyx":189 * free(vy) * * def bezier(Surface surface, points, steps, color): # <<<<<<<<<<<<<< * cdef Color c = Color(color) * cdef Sint16 *vx */ __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_11pygame_sdl2_7gfxdraw_53bezier, NULL, __pyx_n_s_pygame_sdl2_gfxdraw); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 189; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); if (PyDict_SetItem(__pyx_d, __pyx_n_s_bezier, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 189; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "pygame_sdl2/gfxdraw.pyx":1 * # Copyright 2014 Patrick Dawson # <<<<<<<<<<<<<< * # * # This software is provided 'as-is', without any express or implied */ __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); if (PyDict_SetItem(__pyx_d, __pyx_n_s_test, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /*--- Wrapped vars code ---*/ goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); if (__pyx_m) { if (__pyx_d) { __Pyx_AddTraceback("init pygame_sdl2.gfxdraw", __pyx_clineno, __pyx_lineno, __pyx_filename); } Py_DECREF(__pyx_m); __pyx_m = 0; } else if (!PyErr_Occurred()) { PyErr_SetString(PyExc_ImportError, "init pygame_sdl2.gfxdraw"); } __pyx_L0:; __Pyx_RefNannyFinishContext(); #if PY_MAJOR_VERSION < 3 return; #else return __pyx_m; #endif } /* --- Runtime support code --- */ #if CYTHON_REFNANNY static __Pyx_RefNannyAPIStruct *__Pyx_RefNannyImportAPI(const char *modname) { PyObject *m = NULL, *p = NULL; void *r = NULL; m = PyImport_ImportModule((char *)modname); if (!m) goto end; p = PyObject_GetAttrString(m, (char *)"RefNannyAPI"); if (!p) goto end; r = PyLong_AsVoidPtr(p); end: Py_XDECREF(p); Py_XDECREF(m); return (__Pyx_RefNannyAPIStruct *)r; } #endif static PyObject *__Pyx_GetBuiltinName(PyObject *name) { PyObject* result = __Pyx_PyObject_GetAttrStr(__pyx_b, name); if (unlikely(!result)) { PyErr_Format(PyExc_NameError, #if PY_MAJOR_VERSION >= 3 "name '%U' is not defined", name); #else "name '%.200s' is not defined", PyString_AS_STRING(name)); #endif } return result; } static void __Pyx_RaiseArgtupleInvalid( const char* func_name, int exact, Py_ssize_t num_min, Py_ssize_t num_max, Py_ssize_t num_found) { Py_ssize_t num_expected; const char *more_or_less; if (num_found < num_min) { num_expected = num_min; more_or_less = "at least"; } else { num_expected = num_max; more_or_less = "at most"; } if (exact) { more_or_less = "exactly"; } PyErr_Format(PyExc_TypeError, "%.200s() takes %.8s %" CYTHON_FORMAT_SSIZE_T "d positional argument%.1s (%" CYTHON_FORMAT_SSIZE_T "d given)", func_name, more_or_less, num_expected, (num_expected == 1) ? "" : "s", num_found); } static void __Pyx_RaiseDoubleKeywordsError( const char* func_name, PyObject* kw_name) { PyErr_Format(PyExc_TypeError, #if PY_MAJOR_VERSION >= 3 "%s() got multiple values for keyword argument '%U'", func_name, kw_name); #else "%s() got multiple values for keyword argument '%s'", func_name, PyString_AsString(kw_name)); #endif } static int __Pyx_ParseOptionalKeywords( PyObject *kwds, PyObject **argnames[], PyObject *kwds2, PyObject *values[], Py_ssize_t num_pos_args, const char* function_name) { PyObject *key = 0, *value = 0; Py_ssize_t pos = 0; PyObject*** name; PyObject*** first_kw_arg = argnames + num_pos_args; while (PyDict_Next(kwds, &pos, &key, &value)) { name = first_kw_arg; while (*name && (**name != key)) name++; if (*name) { values[name-argnames] = value; continue; } name = first_kw_arg; #if PY_MAJOR_VERSION < 3 if (likely(PyString_CheckExact(key)) || likely(PyString_Check(key))) { while (*name) { if ((CYTHON_COMPILING_IN_PYPY || PyString_GET_SIZE(**name) == PyString_GET_SIZE(key)) && _PyString_Eq(**name, key)) { values[name-argnames] = value; break; } name++; } if (*name) continue; else { PyObject*** argname = argnames; while (argname != first_kw_arg) { if ((**argname == key) || ( (CYTHON_COMPILING_IN_PYPY || PyString_GET_SIZE(**argname) == PyString_GET_SIZE(key)) && _PyString_Eq(**argname, key))) { goto arg_passed_twice; } argname++; } } } else #endif if (likely(PyUnicode_Check(key))) { while (*name) { int cmp = (**name == key) ? 0 : #if !CYTHON_COMPILING_IN_PYPY && PY_MAJOR_VERSION >= 3 (PyUnicode_GET_SIZE(**name) != PyUnicode_GET_SIZE(key)) ? 1 : #endif PyUnicode_Compare(**name, key); if (cmp < 0 && unlikely(PyErr_Occurred())) goto bad; if (cmp == 0) { values[name-argnames] = value; break; } name++; } if (*name) continue; else { PyObject*** argname = argnames; while (argname != first_kw_arg) { int cmp = (**argname == key) ? 0 : #if !CYTHON_COMPILING_IN_PYPY && PY_MAJOR_VERSION >= 3 (PyUnicode_GET_SIZE(**argname) != PyUnicode_GET_SIZE(key)) ? 1 : #endif PyUnicode_Compare(**argname, key); if (cmp < 0 && unlikely(PyErr_Occurred())) goto bad; if (cmp == 0) goto arg_passed_twice; argname++; } } } else goto invalid_keyword_type; if (kwds2) { if (unlikely(PyDict_SetItem(kwds2, key, value))) goto bad; } else { goto invalid_keyword; } } return 0; arg_passed_twice: __Pyx_RaiseDoubleKeywordsError(function_name, key); goto bad; invalid_keyword_type: PyErr_Format(PyExc_TypeError, "%.200s() keywords must be strings", function_name); goto bad; invalid_keyword: PyErr_Format(PyExc_TypeError, #if PY_MAJOR_VERSION < 3 "%.200s() got an unexpected keyword argument '%.200s'", function_name, PyString_AsString(key)); #else "%s() got an unexpected keyword argument '%U'", function_name, key); #endif bad: return -1; } static void __Pyx_RaiseArgumentTypeInvalid(const char* name, PyObject *obj, PyTypeObject *type) { PyErr_Format(PyExc_TypeError, "Argument '%.200s' has incorrect type (expected %.200s, got %.200s)", name, type->tp_name, Py_TYPE(obj)->tp_name); } static CYTHON_INLINE int __Pyx_ArgTypeTest(PyObject *obj, PyTypeObject *type, int none_allowed, const char *name, int exact) { if (unlikely(!type)) { PyErr_SetString(PyExc_SystemError, "Missing type object"); return 0; } if (none_allowed && obj == Py_None) return 1; else if (exact) { if (likely(Py_TYPE(obj) == type)) return 1; #if PY_MAJOR_VERSION == 2 else if ((type == &PyBaseString_Type) && likely(__Pyx_PyBaseString_CheckExact(obj))) return 1; #endif } else { if (likely(PyObject_TypeCheck(obj, type))) return 1; } __Pyx_RaiseArgumentTypeInvalid(name, obj, type); return 0; } #if CYTHON_COMPILING_IN_CPYTHON static CYTHON_INLINE PyObject* __Pyx_PyObject_Call(PyObject *func, PyObject *arg, PyObject *kw) { PyObject *result; ternaryfunc call = func->ob_type->tp_call; if (unlikely(!call)) return PyObject_Call(func, arg, kw); if (unlikely(Py_EnterRecursiveCall((char*)" while calling a Python object"))) return NULL; result = (*call)(func, arg, kw); Py_LeaveRecursiveCall(); if (unlikely(!result) && unlikely(!PyErr_Occurred())) { PyErr_SetString( PyExc_SystemError, "NULL result without error in PyObject_Call"); } return result; } #endif static CYTHON_INLINE PyObject *__Pyx_GetModuleGlobalName(PyObject *name) { PyObject *result; #if CYTHON_COMPILING_IN_CPYTHON result = PyDict_GetItem(__pyx_d, name); if (likely(result)) { Py_INCREF(result); } else { #else result = PyObject_GetItem(__pyx_d, name); if (!result) { PyErr_Clear(); #endif result = __Pyx_GetBuiltinName(name); } return result; } #if CYTHON_COMPILING_IN_CPYTHON static CYTHON_INLINE PyObject* __Pyx_PyObject_CallMethO(PyObject *func, PyObject *arg) { PyObject *self, *result; PyCFunction cfunc; cfunc = PyCFunction_GET_FUNCTION(func); self = PyCFunction_GET_SELF(func); if (unlikely(Py_EnterRecursiveCall((char*)" while calling a Python object"))) return NULL; result = cfunc(self, arg); Py_LeaveRecursiveCall(); if (unlikely(!result) && unlikely(!PyErr_Occurred())) { PyErr_SetString( PyExc_SystemError, "NULL result without error in PyObject_Call"); } return result; } #endif #if CYTHON_COMPILING_IN_CPYTHON static PyObject* __Pyx__PyObject_CallOneArg(PyObject *func, PyObject *arg) { PyObject *result; PyObject *args = PyTuple_New(1); if (unlikely(!args)) return NULL; Py_INCREF(arg); PyTuple_SET_ITEM(args, 0, arg); result = __Pyx_PyObject_Call(func, args, NULL); Py_DECREF(args); return result; } static CYTHON_INLINE PyObject* __Pyx_PyObject_CallOneArg(PyObject *func, PyObject *arg) { #ifdef __Pyx_CyFunction_USED if (likely(PyCFunction_Check(func) || PyObject_TypeCheck(func, __pyx_CyFunctionType))) { #else if (likely(PyCFunction_Check(func))) { #endif if (likely(PyCFunction_GET_FLAGS(func) & METH_O)) { return __Pyx_PyObject_CallMethO(func, arg); } } return __Pyx__PyObject_CallOneArg(func, arg); } #else static CYTHON_INLINE PyObject* __Pyx_PyObject_CallOneArg(PyObject *func, PyObject *arg) { PyObject *result; PyObject *args = PyTuple_Pack(1, arg); if (unlikely(!args)) return NULL; result = __Pyx_PyObject_Call(func, args, NULL); Py_DECREF(args); return result; } #endif static CYTHON_INLINE void __Pyx_RaiseTooManyValuesError(Py_ssize_t expected) { PyErr_Format(PyExc_ValueError, "too many values to unpack (expected %" CYTHON_FORMAT_SSIZE_T "d)", expected); } static CYTHON_INLINE void __Pyx_RaiseNeedMoreValuesError(Py_ssize_t index) { PyErr_Format(PyExc_ValueError, "need more than %" CYTHON_FORMAT_SSIZE_T "d value%.1s to unpack", index, (index == 1) ? "" : "s"); } static CYTHON_INLINE int __Pyx_IterFinish(void) { #if CYTHON_COMPILING_IN_CPYTHON PyThreadState *tstate = PyThreadState_GET(); PyObject* exc_type = tstate->curexc_type; if (unlikely(exc_type)) { if (likely(exc_type == PyExc_StopIteration) || PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration)) { PyObject *exc_value, *exc_tb; exc_value = tstate->curexc_value; exc_tb = tstate->curexc_traceback; tstate->curexc_type = 0; tstate->curexc_value = 0; tstate->curexc_traceback = 0; Py_DECREF(exc_type); Py_XDECREF(exc_value); Py_XDECREF(exc_tb); return 0; } else { return -1; } } return 0; #else if (unlikely(PyErr_Occurred())) { if (likely(PyErr_ExceptionMatches(PyExc_StopIteration))) { PyErr_Clear(); return 0; } else { return -1; } } return 0; #endif } static int __Pyx_IternextUnpackEndCheck(PyObject *retval, Py_ssize_t expected) { if (unlikely(retval)) { Py_DECREF(retval); __Pyx_RaiseTooManyValuesError(expected); return -1; } else { return __Pyx_IterFinish(); } return 0; } static void* __Pyx_GetVtable(PyObject *dict) { void* ptr; PyObject *ob = PyObject_GetItem(dict, __pyx_n_s_pyx_vtable); if (!ob) goto bad; #if PY_VERSION_HEX >= 0x02070000 ptr = PyCapsule_GetPointer(ob, 0); #else ptr = PyCObject_AsVoidPtr(ob); #endif if (!ptr && !PyErr_Occurred()) PyErr_SetString(PyExc_RuntimeError, "invalid vtable found for imported type"); Py_DECREF(ob); return ptr; bad: Py_XDECREF(ob); return NULL; } static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list, int level) { PyObject *empty_list = 0; PyObject *module = 0; PyObject *global_dict = 0; PyObject *empty_dict = 0; PyObject *list; #if PY_VERSION_HEX < 0x03030000 PyObject *py_import; py_import = __Pyx_PyObject_GetAttrStr(__pyx_b, __pyx_n_s_import); if (!py_import) goto bad; #endif if (from_list) list = from_list; else { empty_list = PyList_New(0); if (!empty_list) goto bad; list = empty_list; } global_dict = PyModule_GetDict(__pyx_m); if (!global_dict) goto bad; empty_dict = PyDict_New(); if (!empty_dict) goto bad; { #if PY_MAJOR_VERSION >= 3 if (level == -1) { if (strchr(__Pyx_MODULE_NAME, '.')) { #if PY_VERSION_HEX < 0x03030000 PyObject *py_level = PyInt_FromLong(1); if (!py_level) goto bad; module = PyObject_CallFunctionObjArgs(py_import, name, global_dict, empty_dict, list, py_level, NULL); Py_DECREF(py_level); #else module = PyImport_ImportModuleLevelObject( name, global_dict, empty_dict, list, 1); #endif if (!module) { if (!PyErr_ExceptionMatches(PyExc_ImportError)) goto bad; PyErr_Clear(); } } level = 0; } #endif if (!module) { #if PY_VERSION_HEX < 0x03030000 PyObject *py_level = PyInt_FromLong(level); if (!py_level) goto bad; module = PyObject_CallFunctionObjArgs(py_import, name, global_dict, empty_dict, list, py_level, NULL); Py_DECREF(py_level); #else module = PyImport_ImportModuleLevelObject( name, global_dict, empty_dict, list, level); #endif } } bad: #if PY_VERSION_HEX < 0x03030000 Py_XDECREF(py_import); #endif Py_XDECREF(empty_list); Py_XDECREF(empty_dict); return module; } static PyObject* __Pyx_ImportFrom(PyObject* module, PyObject* name) { PyObject* value = __Pyx_PyObject_GetAttrStr(module, name); if (unlikely(!value) && PyErr_ExceptionMatches(PyExc_AttributeError)) { PyErr_Format(PyExc_ImportError, #if PY_MAJOR_VERSION < 3 "cannot import name %.230s", PyString_AS_STRING(name)); #else "cannot import name %S", name); #endif } return value; } static int __pyx_bisect_code_objects(__Pyx_CodeObjectCacheEntry* entries, int count, int code_line) { int start = 0, mid = 0, end = count - 1; if (end >= 0 && code_line > entries[end].code_line) { return count; } while (start < end) { mid = start + (end - start) / 2; if (code_line < entries[mid].code_line) { end = mid; } else if (code_line > entries[mid].code_line) { start = mid + 1; } else { return mid; } } if (code_line <= entries[mid].code_line) { return mid; } else { return mid + 1; } } static PyCodeObject *__pyx_find_code_object(int code_line) { PyCodeObject* code_object; int pos; if (unlikely(!code_line) || unlikely(!__pyx_code_cache.entries)) { return NULL; } pos = __pyx_bisect_code_objects(__pyx_code_cache.entries, __pyx_code_cache.count, code_line); if (unlikely(pos >= __pyx_code_cache.count) || unlikely(__pyx_code_cache.entries[pos].code_line != code_line)) { return NULL; } code_object = __pyx_code_cache.entries[pos].code_object; Py_INCREF(code_object); return code_object; } static void __pyx_insert_code_object(int code_line, PyCodeObject* code_object) { int pos, i; __Pyx_CodeObjectCacheEntry* entries = __pyx_code_cache.entries; if (unlikely(!code_line)) { return; } if (unlikely(!entries)) { entries = (__Pyx_CodeObjectCacheEntry*)PyMem_Malloc(64*sizeof(__Pyx_CodeObjectCacheEntry)); if (likely(entries)) { __pyx_code_cache.entries = entries; __pyx_code_cache.max_count = 64; __pyx_code_cache.count = 1; entries[0].code_line = code_line; entries[0].code_object = code_object; Py_INCREF(code_object); } return; } pos = __pyx_bisect_code_objects(__pyx_code_cache.entries, __pyx_code_cache.count, code_line); if ((pos < __pyx_code_cache.count) && unlikely(__pyx_code_cache.entries[pos].code_line == code_line)) { PyCodeObject* tmp = entries[pos].code_object; entries[pos].code_object = code_object; Py_DECREF(tmp); return; } if (__pyx_code_cache.count == __pyx_code_cache.max_count) { int new_max = __pyx_code_cache.max_count + 64; entries = (__Pyx_CodeObjectCacheEntry*)PyMem_Realloc( __pyx_code_cache.entries, (size_t)new_max*sizeof(__Pyx_CodeObjectCacheEntry)); if (unlikely(!entries)) { return; } __pyx_code_cache.entries = entries; __pyx_code_cache.max_count = new_max; } for (i=__pyx_code_cache.count; i>pos; i--) { entries[i] = entries[i-1]; } entries[pos].code_line = code_line; entries[pos].code_object = code_object; __pyx_code_cache.count++; Py_INCREF(code_object); } #include "compile.h" #include "frameobject.h" #include "traceback.h" static PyCodeObject* __Pyx_CreateCodeObjectForTraceback( const char *funcname, int c_line, int py_line, const char *filename) { PyCodeObject *py_code = 0; PyObject *py_srcfile = 0; PyObject *py_funcname = 0; #if PY_MAJOR_VERSION < 3 py_srcfile = PyString_FromString(filename); #else py_srcfile = PyUnicode_FromString(filename); #endif if (!py_srcfile) goto bad; if (c_line) { #if PY_MAJOR_VERSION < 3 py_funcname = PyString_FromFormat( "%s (%s:%d)", funcname, __pyx_cfilenm, c_line); #else py_funcname = PyUnicode_FromFormat( "%s (%s:%d)", funcname, __pyx_cfilenm, c_line); #endif } else { #if PY_MAJOR_VERSION < 3 py_funcname = PyString_FromString(funcname); #else py_funcname = PyUnicode_FromString(funcname); #endif } if (!py_funcname) goto bad; py_code = __Pyx_PyCode_New( 0, 0, 0, 0, 0, __pyx_empty_bytes, /*PyObject *code,*/ __pyx_empty_tuple, /*PyObject *consts,*/ __pyx_empty_tuple, /*PyObject *names,*/ __pyx_empty_tuple, /*PyObject *varnames,*/ __pyx_empty_tuple, /*PyObject *freevars,*/ __pyx_empty_tuple, /*PyObject *cellvars,*/ py_srcfile, /*PyObject *filename,*/ py_funcname, /*PyObject *name,*/ py_line, __pyx_empty_bytes /*PyObject *lnotab*/ ); Py_DECREF(py_srcfile); Py_DECREF(py_funcname); return py_code; bad: Py_XDECREF(py_srcfile); Py_XDECREF(py_funcname); return NULL; } static void __Pyx_AddTraceback(const char *funcname, int c_line, int py_line, const char *filename) { PyCodeObject *py_code = 0; PyFrameObject *py_frame = 0; py_code = __pyx_find_code_object(c_line ? c_line : py_line); if (!py_code) { py_code = __Pyx_CreateCodeObjectForTraceback( funcname, c_line, py_line, filename); if (!py_code) goto bad; __pyx_insert_code_object(c_line ? c_line : py_line, py_code); } py_frame = PyFrame_New( PyThreadState_GET(), /*PyThreadState *tstate,*/ py_code, /*PyCodeObject *code,*/ __pyx_d, /*PyObject *globals,*/ 0 /*PyObject *locals*/ ); if (!py_frame) goto bad; py_frame->f_lineno = py_line; PyTraceBack_Here(py_frame); bad: Py_XDECREF(py_code); Py_XDECREF(py_frame); } #define __PYX_VERIFY_RETURN_INT(target_type, func_type, func_value)\ __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, 0) #define __PYX_VERIFY_RETURN_INT_EXC(target_type, func_type, func_value)\ __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, 1) #define __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, exc)\ {\ func_type value = func_value;\ if (sizeof(target_type) < sizeof(func_type)) {\ if (unlikely(value != (func_type) (target_type) value)) {\ func_type zero = 0;\ if (exc && unlikely(value == (func_type)-1 && PyErr_Occurred()))\ return (target_type) -1;\ if (is_unsigned && unlikely(value < zero))\ goto raise_neg_overflow;\ else\ goto raise_overflow;\ }\ }\ return (target_type) value;\ } #if CYTHON_USE_PYLONG_INTERNALS #include "longintrepr.h" #endif static CYTHON_INLINE int16_t __Pyx_PyInt_As_int16_t(PyObject *x) { const int16_t neg_one = (int16_t) -1, const_zero = (int16_t) 0; const int is_unsigned = neg_one > const_zero; #if PY_MAJOR_VERSION < 3 if (likely(PyInt_Check(x))) { if (sizeof(int16_t) < sizeof(long)) { __PYX_VERIFY_RETURN_INT(int16_t, long, PyInt_AS_LONG(x)) } else { long val = PyInt_AS_LONG(x); if (is_unsigned && unlikely(val < 0)) { goto raise_neg_overflow; } return (int16_t) val; } } else #endif if (likely(PyLong_Check(x))) { if (is_unsigned) { #if CYTHON_USE_PYLONG_INTERNALS const digit* digits = ((PyLongObject*)x)->ob_digit; switch (Py_SIZE(x)) { case 0: return (int16_t) 0; case 1: __PYX_VERIFY_RETURN_INT(int16_t, digit, digits[0]) case 2: if (8 * sizeof(int16_t) > 1 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(int16_t, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(int16_t) >= 2 * PyLong_SHIFT) { return (int16_t) (((((int16_t)digits[1]) << PyLong_SHIFT) | (int16_t)digits[0])); } } break; case 3: if (8 * sizeof(int16_t) > 2 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(int16_t, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(int16_t) >= 3 * PyLong_SHIFT) { return (int16_t) (((((((int16_t)digits[2]) << PyLong_SHIFT) | (int16_t)digits[1]) << PyLong_SHIFT) | (int16_t)digits[0])); } } break; case 4: if (8 * sizeof(int16_t) > 3 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(int16_t, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(int16_t) >= 4 * PyLong_SHIFT) { return (int16_t) (((((((((int16_t)digits[3]) << PyLong_SHIFT) | (int16_t)digits[2]) << PyLong_SHIFT) | (int16_t)digits[1]) << PyLong_SHIFT) | (int16_t)digits[0])); } } break; } #endif #if CYTHON_COMPILING_IN_CPYTHON if (unlikely(Py_SIZE(x) < 0)) { goto raise_neg_overflow; } #else { int result = PyObject_RichCompareBool(x, Py_False, Py_LT); if (unlikely(result < 0)) return (int16_t) -1; if (unlikely(result == 1)) goto raise_neg_overflow; } #endif if (sizeof(int16_t) <= sizeof(unsigned long)) { __PYX_VERIFY_RETURN_INT_EXC(int16_t, unsigned long, PyLong_AsUnsignedLong(x)) } else if (sizeof(int16_t) <= sizeof(unsigned PY_LONG_LONG)) { __PYX_VERIFY_RETURN_INT_EXC(int16_t, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x)) } } else { #if CYTHON_USE_PYLONG_INTERNALS const digit* digits = ((PyLongObject*)x)->ob_digit; switch (Py_SIZE(x)) { case 0: return (int16_t) 0; case -1: __PYX_VERIFY_RETURN_INT(int16_t, sdigit, (sdigit) (-(sdigit)digits[0])) case 1: __PYX_VERIFY_RETURN_INT(int16_t, digit, +digits[0]) case -2: if (8 * sizeof(int16_t) - 1 > 1 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(int16_t, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(int16_t) - 1 > 2 * PyLong_SHIFT) { return (int16_t) (((int16_t)-1)*(((((int16_t)digits[1]) << PyLong_SHIFT) | (int16_t)digits[0]))); } } break; case 2: if (8 * sizeof(int16_t) > 1 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(int16_t, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(int16_t) - 1 > 2 * PyLong_SHIFT) { return (int16_t) ((((((int16_t)digits[1]) << PyLong_SHIFT) | (int16_t)digits[0]))); } } break; case -3: if (8 * sizeof(int16_t) - 1 > 2 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(int16_t, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(int16_t) - 1 > 3 * PyLong_SHIFT) { return (int16_t) (((int16_t)-1)*(((((((int16_t)digits[2]) << PyLong_SHIFT) | (int16_t)digits[1]) << PyLong_SHIFT) | (int16_t)digits[0]))); } } break; case 3: if (8 * sizeof(int16_t) > 2 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(int16_t, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(int16_t) - 1 > 3 * PyLong_SHIFT) { return (int16_t) ((((((((int16_t)digits[2]) << PyLong_SHIFT) | (int16_t)digits[1]) << PyLong_SHIFT) | (int16_t)digits[0]))); } } break; case -4: if (8 * sizeof(int16_t) - 1 > 3 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(int16_t, long, -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(int16_t) - 1 > 4 * PyLong_SHIFT) { return (int16_t) (((int16_t)-1)*(((((((((int16_t)digits[3]) << PyLong_SHIFT) | (int16_t)digits[2]) << PyLong_SHIFT) | (int16_t)digits[1]) << PyLong_SHIFT) | (int16_t)digits[0]))); } } break; case 4: if (8 * sizeof(int16_t) > 3 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(int16_t, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(int16_t) - 1 > 4 * PyLong_SHIFT) { return (int16_t) ((((((((((int16_t)digits[3]) << PyLong_SHIFT) | (int16_t)digits[2]) << PyLong_SHIFT) | (int16_t)digits[1]) << PyLong_SHIFT) | (int16_t)digits[0]))); } } break; } #endif if (sizeof(int16_t) <= sizeof(long)) { __PYX_VERIFY_RETURN_INT_EXC(int16_t, long, PyLong_AsLong(x)) } else if (sizeof(int16_t) <= sizeof(PY_LONG_LONG)) { __PYX_VERIFY_RETURN_INT_EXC(int16_t, PY_LONG_LONG, PyLong_AsLongLong(x)) } } { #if CYTHON_COMPILING_IN_PYPY && !defined(_PyLong_AsByteArray) PyErr_SetString(PyExc_RuntimeError, "_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers"); #else int16_t val; PyObject *v = __Pyx_PyNumber_Int(x); #if PY_MAJOR_VERSION < 3 if (likely(v) && !PyLong_Check(v)) { PyObject *tmp = v; v = PyNumber_Long(tmp); Py_DECREF(tmp); } #endif if (likely(v)) { int one = 1; int is_little = (int)*(unsigned char *)&one; unsigned char *bytes = (unsigned char *)&val; int ret = _PyLong_AsByteArray((PyLongObject *)v, bytes, sizeof(val), is_little, !is_unsigned); Py_DECREF(v); if (likely(!ret)) return val; } #endif return (int16_t) -1; } } else { int16_t val; PyObject *tmp = __Pyx_PyNumber_Int(x); if (!tmp) return (int16_t) -1; val = __Pyx_PyInt_As_int16_t(tmp); Py_DECREF(tmp); return val; } raise_overflow: PyErr_SetString(PyExc_OverflowError, "value too large to convert to int16_t"); return (int16_t) -1; raise_neg_overflow: PyErr_SetString(PyExc_OverflowError, "can't convert negative value to int16_t"); return (int16_t) -1; } static CYTHON_INLINE int __Pyx_PyInt_As_int(PyObject *x) { const int neg_one = (int) -1, const_zero = (int) 0; const int is_unsigned = neg_one > const_zero; #if PY_MAJOR_VERSION < 3 if (likely(PyInt_Check(x))) { if (sizeof(int) < sizeof(long)) { __PYX_VERIFY_RETURN_INT(int, long, PyInt_AS_LONG(x)) } else { long val = PyInt_AS_LONG(x); if (is_unsigned && unlikely(val < 0)) { goto raise_neg_overflow; } return (int) val; } } else #endif if (likely(PyLong_Check(x))) { if (is_unsigned) { #if CYTHON_USE_PYLONG_INTERNALS const digit* digits = ((PyLongObject*)x)->ob_digit; switch (Py_SIZE(x)) { case 0: return (int) 0; case 1: __PYX_VERIFY_RETURN_INT(int, digit, digits[0]) case 2: if (8 * sizeof(int) > 1 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(int) >= 2 * PyLong_SHIFT) { return (int) (((((int)digits[1]) << PyLong_SHIFT) | (int)digits[0])); } } break; case 3: if (8 * sizeof(int) > 2 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(int) >= 3 * PyLong_SHIFT) { return (int) (((((((int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0])); } } break; case 4: if (8 * sizeof(int) > 3 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(int) >= 4 * PyLong_SHIFT) { return (int) (((((((((int)digits[3]) << PyLong_SHIFT) | (int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0])); } } break; } #endif #if CYTHON_COMPILING_IN_CPYTHON if (unlikely(Py_SIZE(x) < 0)) { goto raise_neg_overflow; } #else { int result = PyObject_RichCompareBool(x, Py_False, Py_LT); if (unlikely(result < 0)) return (int) -1; if (unlikely(result == 1)) goto raise_neg_overflow; } #endif if (sizeof(int) <= sizeof(unsigned long)) { __PYX_VERIFY_RETURN_INT_EXC(int, unsigned long, PyLong_AsUnsignedLong(x)) } else if (sizeof(int) <= sizeof(unsigned PY_LONG_LONG)) { __PYX_VERIFY_RETURN_INT_EXC(int, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x)) } } else { #if CYTHON_USE_PYLONG_INTERNALS const digit* digits = ((PyLongObject*)x)->ob_digit; switch (Py_SIZE(x)) { case 0: return (int) 0; case -1: __PYX_VERIFY_RETURN_INT(int, sdigit, (sdigit) (-(sdigit)digits[0])) case 1: __PYX_VERIFY_RETURN_INT(int, digit, +digits[0]) case -2: if (8 * sizeof(int) - 1 > 1 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(int, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(int) - 1 > 2 * PyLong_SHIFT) { return (int) (((int)-1)*(((((int)digits[1]) << PyLong_SHIFT) | (int)digits[0]))); } } break; case 2: if (8 * sizeof(int) > 1 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(int) - 1 > 2 * PyLong_SHIFT) { return (int) ((((((int)digits[1]) << PyLong_SHIFT) | (int)digits[0]))); } } break; case -3: if (8 * sizeof(int) - 1 > 2 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(int, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(int) - 1 > 3 * PyLong_SHIFT) { return (int) (((int)-1)*(((((((int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0]))); } } break; case 3: if (8 * sizeof(int) > 2 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(int) - 1 > 3 * PyLong_SHIFT) { return (int) ((((((((int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0]))); } } break; case -4: if (8 * sizeof(int) - 1 > 3 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(int, long, -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(int) - 1 > 4 * PyLong_SHIFT) { return (int) (((int)-1)*(((((((((int)digits[3]) << PyLong_SHIFT) | (int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0]))); } } break; case 4: if (8 * sizeof(int) > 3 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(int) - 1 > 4 * PyLong_SHIFT) { return (int) ((((((((((int)digits[3]) << PyLong_SHIFT) | (int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0]))); } } break; } #endif if (sizeof(int) <= sizeof(long)) { __PYX_VERIFY_RETURN_INT_EXC(int, long, PyLong_AsLong(x)) } else if (sizeof(int) <= sizeof(PY_LONG_LONG)) { __PYX_VERIFY_RETURN_INT_EXC(int, PY_LONG_LONG, PyLong_AsLongLong(x)) } } { #if CYTHON_COMPILING_IN_PYPY && !defined(_PyLong_AsByteArray) PyErr_SetString(PyExc_RuntimeError, "_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers"); #else int val; PyObject *v = __Pyx_PyNumber_Int(x); #if PY_MAJOR_VERSION < 3 if (likely(v) && !PyLong_Check(v)) { PyObject *tmp = v; v = PyNumber_Long(tmp); Py_DECREF(tmp); } #endif if (likely(v)) { int one = 1; int is_little = (int)*(unsigned char *)&one; unsigned char *bytes = (unsigned char *)&val; int ret = _PyLong_AsByteArray((PyLongObject *)v, bytes, sizeof(val), is_little, !is_unsigned); Py_DECREF(v); if (likely(!ret)) return val; } #endif return (int) -1; } } else { int val; PyObject *tmp = __Pyx_PyNumber_Int(x); if (!tmp) return (int) -1; val = __Pyx_PyInt_As_int(tmp); Py_DECREF(tmp); return val; } raise_overflow: PyErr_SetString(PyExc_OverflowError, "value too large to convert to int"); return (int) -1; raise_neg_overflow: PyErr_SetString(PyExc_OverflowError, "can't convert negative value to int"); return (int) -1; } static CYTHON_INLINE uint8_t __Pyx_PyInt_As_uint8_t(PyObject *x) { const uint8_t neg_one = (uint8_t) -1, const_zero = (uint8_t) 0; const int is_unsigned = neg_one > const_zero; #if PY_MAJOR_VERSION < 3 if (likely(PyInt_Check(x))) { if (sizeof(uint8_t) < sizeof(long)) { __PYX_VERIFY_RETURN_INT(uint8_t, long, PyInt_AS_LONG(x)) } else { long val = PyInt_AS_LONG(x); if (is_unsigned && unlikely(val < 0)) { goto raise_neg_overflow; } return (uint8_t) val; } } else #endif if (likely(PyLong_Check(x))) { if (is_unsigned) { #if CYTHON_USE_PYLONG_INTERNALS const digit* digits = ((PyLongObject*)x)->ob_digit; switch (Py_SIZE(x)) { case 0: return (uint8_t) 0; case 1: __PYX_VERIFY_RETURN_INT(uint8_t, digit, digits[0]) case 2: if (8 * sizeof(uint8_t) > 1 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(uint8_t, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(uint8_t) >= 2 * PyLong_SHIFT) { return (uint8_t) (((((uint8_t)digits[1]) << PyLong_SHIFT) | (uint8_t)digits[0])); } } break; case 3: if (8 * sizeof(uint8_t) > 2 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(uint8_t, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(uint8_t) >= 3 * PyLong_SHIFT) { return (uint8_t) (((((((uint8_t)digits[2]) << PyLong_SHIFT) | (uint8_t)digits[1]) << PyLong_SHIFT) | (uint8_t)digits[0])); } } break; case 4: if (8 * sizeof(uint8_t) > 3 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(uint8_t, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(uint8_t) >= 4 * PyLong_SHIFT) { return (uint8_t) (((((((((uint8_t)digits[3]) << PyLong_SHIFT) | (uint8_t)digits[2]) << PyLong_SHIFT) | (uint8_t)digits[1]) << PyLong_SHIFT) | (uint8_t)digits[0])); } } break; } #endif #if CYTHON_COMPILING_IN_CPYTHON if (unlikely(Py_SIZE(x) < 0)) { goto raise_neg_overflow; } #else { int result = PyObject_RichCompareBool(x, Py_False, Py_LT); if (unlikely(result < 0)) return (uint8_t) -1; if (unlikely(result == 1)) goto raise_neg_overflow; } #endif if (sizeof(uint8_t) <= sizeof(unsigned long)) { __PYX_VERIFY_RETURN_INT_EXC(uint8_t, unsigned long, PyLong_AsUnsignedLong(x)) } else if (sizeof(uint8_t) <= sizeof(unsigned PY_LONG_LONG)) { __PYX_VERIFY_RETURN_INT_EXC(uint8_t, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x)) } } else { #if CYTHON_USE_PYLONG_INTERNALS const digit* digits = ((PyLongObject*)x)->ob_digit; switch (Py_SIZE(x)) { case 0: return (uint8_t) 0; case -1: __PYX_VERIFY_RETURN_INT(uint8_t, sdigit, (sdigit) (-(sdigit)digits[0])) case 1: __PYX_VERIFY_RETURN_INT(uint8_t, digit, +digits[0]) case -2: if (8 * sizeof(uint8_t) - 1 > 1 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(uint8_t, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(uint8_t) - 1 > 2 * PyLong_SHIFT) { return (uint8_t) (((uint8_t)-1)*(((((uint8_t)digits[1]) << PyLong_SHIFT) | (uint8_t)digits[0]))); } } break; case 2: if (8 * sizeof(uint8_t) > 1 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(uint8_t, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(uint8_t) - 1 > 2 * PyLong_SHIFT) { return (uint8_t) ((((((uint8_t)digits[1]) << PyLong_SHIFT) | (uint8_t)digits[0]))); } } break; case -3: if (8 * sizeof(uint8_t) - 1 > 2 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(uint8_t, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(uint8_t) - 1 > 3 * PyLong_SHIFT) { return (uint8_t) (((uint8_t)-1)*(((((((uint8_t)digits[2]) << PyLong_SHIFT) | (uint8_t)digits[1]) << PyLong_SHIFT) | (uint8_t)digits[0]))); } } break; case 3: if (8 * sizeof(uint8_t) > 2 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(uint8_t, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(uint8_t) - 1 > 3 * PyLong_SHIFT) { return (uint8_t) ((((((((uint8_t)digits[2]) << PyLong_SHIFT) | (uint8_t)digits[1]) << PyLong_SHIFT) | (uint8_t)digits[0]))); } } break; case -4: if (8 * sizeof(uint8_t) - 1 > 3 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(uint8_t, long, -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(uint8_t) - 1 > 4 * PyLong_SHIFT) { return (uint8_t) (((uint8_t)-1)*(((((((((uint8_t)digits[3]) << PyLong_SHIFT) | (uint8_t)digits[2]) << PyLong_SHIFT) | (uint8_t)digits[1]) << PyLong_SHIFT) | (uint8_t)digits[0]))); } } break; case 4: if (8 * sizeof(uint8_t) > 3 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(uint8_t, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(uint8_t) - 1 > 4 * PyLong_SHIFT) { return (uint8_t) ((((((((((uint8_t)digits[3]) << PyLong_SHIFT) | (uint8_t)digits[2]) << PyLong_SHIFT) | (uint8_t)digits[1]) << PyLong_SHIFT) | (uint8_t)digits[0]))); } } break; } #endif if (sizeof(uint8_t) <= sizeof(long)) { __PYX_VERIFY_RETURN_INT_EXC(uint8_t, long, PyLong_AsLong(x)) } else if (sizeof(uint8_t) <= sizeof(PY_LONG_LONG)) { __PYX_VERIFY_RETURN_INT_EXC(uint8_t, PY_LONG_LONG, PyLong_AsLongLong(x)) } } { #if CYTHON_COMPILING_IN_PYPY && !defined(_PyLong_AsByteArray) PyErr_SetString(PyExc_RuntimeError, "_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers"); #else uint8_t val; PyObject *v = __Pyx_PyNumber_Int(x); #if PY_MAJOR_VERSION < 3 if (likely(v) && !PyLong_Check(v)) { PyObject *tmp = v; v = PyNumber_Long(tmp); Py_DECREF(tmp); } #endif if (likely(v)) { int one = 1; int is_little = (int)*(unsigned char *)&one; unsigned char *bytes = (unsigned char *)&val; int ret = _PyLong_AsByteArray((PyLongObject *)v, bytes, sizeof(val), is_little, !is_unsigned); Py_DECREF(v); if (likely(!ret)) return val; } #endif return (uint8_t) -1; } } else { uint8_t val; PyObject *tmp = __Pyx_PyNumber_Int(x); if (!tmp) return (uint8_t) -1; val = __Pyx_PyInt_As_uint8_t(tmp); Py_DECREF(tmp); return val; } raise_overflow: PyErr_SetString(PyExc_OverflowError, "value too large to convert to uint8_t"); return (uint8_t) -1; raise_neg_overflow: PyErr_SetString(PyExc_OverflowError, "can't convert negative value to uint8_t"); return (uint8_t) -1; } static CYTHON_INLINE PyObject* __Pyx_PyInt_From_long(long value) { const long neg_one = (long) -1, const_zero = (long) 0; const int is_unsigned = neg_one > const_zero; if (is_unsigned) { if (sizeof(long) < sizeof(long)) { return PyInt_FromLong((long) value); } else if (sizeof(long) <= sizeof(unsigned long)) { return PyLong_FromUnsignedLong((unsigned long) value); } else if (sizeof(long) <= sizeof(unsigned PY_LONG_LONG)) { return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value); } } else { if (sizeof(long) <= sizeof(long)) { return PyInt_FromLong((long) value); } else if (sizeof(long) <= sizeof(PY_LONG_LONG)) { return PyLong_FromLongLong((PY_LONG_LONG) value); } } { int one = 1; int little = (int)*(unsigned char *)&one; unsigned char *bytes = (unsigned char *)&value; return _PyLong_FromByteArray(bytes, sizeof(long), little, !is_unsigned); } } static CYTHON_INLINE long __Pyx_PyInt_As_long(PyObject *x) { const long neg_one = (long) -1, const_zero = (long) 0; const int is_unsigned = neg_one > const_zero; #if PY_MAJOR_VERSION < 3 if (likely(PyInt_Check(x))) { if (sizeof(long) < sizeof(long)) { __PYX_VERIFY_RETURN_INT(long, long, PyInt_AS_LONG(x)) } else { long val = PyInt_AS_LONG(x); if (is_unsigned && unlikely(val < 0)) { goto raise_neg_overflow; } return (long) val; } } else #endif if (likely(PyLong_Check(x))) { if (is_unsigned) { #if CYTHON_USE_PYLONG_INTERNALS const digit* digits = ((PyLongObject*)x)->ob_digit; switch (Py_SIZE(x)) { case 0: return (long) 0; case 1: __PYX_VERIFY_RETURN_INT(long, digit, digits[0]) case 2: if (8 * sizeof(long) > 1 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(long) >= 2 * PyLong_SHIFT) { return (long) (((((long)digits[1]) << PyLong_SHIFT) | (long)digits[0])); } } break; case 3: if (8 * sizeof(long) > 2 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(long) >= 3 * PyLong_SHIFT) { return (long) (((((((long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0])); } } break; case 4: if (8 * sizeof(long) > 3 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(long) >= 4 * PyLong_SHIFT) { return (long) (((((((((long)digits[3]) << PyLong_SHIFT) | (long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0])); } } break; } #endif #if CYTHON_COMPILING_IN_CPYTHON if (unlikely(Py_SIZE(x) < 0)) { goto raise_neg_overflow; } #else { int result = PyObject_RichCompareBool(x, Py_False, Py_LT); if (unlikely(result < 0)) return (long) -1; if (unlikely(result == 1)) goto raise_neg_overflow; } #endif if (sizeof(long) <= sizeof(unsigned long)) { __PYX_VERIFY_RETURN_INT_EXC(long, unsigned long, PyLong_AsUnsignedLong(x)) } else if (sizeof(long) <= sizeof(unsigned PY_LONG_LONG)) { __PYX_VERIFY_RETURN_INT_EXC(long, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x)) } } else { #if CYTHON_USE_PYLONG_INTERNALS const digit* digits = ((PyLongObject*)x)->ob_digit; switch (Py_SIZE(x)) { case 0: return (long) 0; case -1: __PYX_VERIFY_RETURN_INT(long, sdigit, (sdigit) (-(sdigit)digits[0])) case 1: __PYX_VERIFY_RETURN_INT(long, digit, +digits[0]) case -2: if (8 * sizeof(long) - 1 > 1 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(long, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) { return (long) (((long)-1)*(((((long)digits[1]) << PyLong_SHIFT) | (long)digits[0]))); } } break; case 2: if (8 * sizeof(long) > 1 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) { return (long) ((((((long)digits[1]) << PyLong_SHIFT) | (long)digits[0]))); } } break; case -3: if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(long, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) { return (long) (((long)-1)*(((((((long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0]))); } } break; case 3: if (8 * sizeof(long) > 2 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) { return (long) ((((((((long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0]))); } } break; case -4: if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(long, long, -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(long) - 1 > 4 * PyLong_SHIFT) { return (long) (((long)-1)*(((((((((long)digits[3]) << PyLong_SHIFT) | (long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0]))); } } break; case 4: if (8 * sizeof(long) > 3 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(long) - 1 > 4 * PyLong_SHIFT) { return (long) ((((((((((long)digits[3]) << PyLong_SHIFT) | (long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0]))); } } break; } #endif if (sizeof(long) <= sizeof(long)) { __PYX_VERIFY_RETURN_INT_EXC(long, long, PyLong_AsLong(x)) } else if (sizeof(long) <= sizeof(PY_LONG_LONG)) { __PYX_VERIFY_RETURN_INT_EXC(long, PY_LONG_LONG, PyLong_AsLongLong(x)) } } { #if CYTHON_COMPILING_IN_PYPY && !defined(_PyLong_AsByteArray) PyErr_SetString(PyExc_RuntimeError, "_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers"); #else long val; PyObject *v = __Pyx_PyNumber_Int(x); #if PY_MAJOR_VERSION < 3 if (likely(v) && !PyLong_Check(v)) { PyObject *tmp = v; v = PyNumber_Long(tmp); Py_DECREF(tmp); } #endif if (likely(v)) { int one = 1; int is_little = (int)*(unsigned char *)&one; unsigned char *bytes = (unsigned char *)&val; int ret = _PyLong_AsByteArray((PyLongObject *)v, bytes, sizeof(val), is_little, !is_unsigned); Py_DECREF(v); if (likely(!ret)) return val; } #endif return (long) -1; } } else { long val; PyObject *tmp = __Pyx_PyNumber_Int(x); if (!tmp) return (long) -1; val = __Pyx_PyInt_As_long(tmp); Py_DECREF(tmp); return val; } raise_overflow: PyErr_SetString(PyExc_OverflowError, "value too large to convert to long"); return (long) -1; raise_neg_overflow: PyErr_SetString(PyExc_OverflowError, "can't convert negative value to long"); return (long) -1; } static int __Pyx_check_binary_version(void) { char ctversion[4], rtversion[4]; PyOS_snprintf(ctversion, 4, "%d.%d", PY_MAJOR_VERSION, PY_MINOR_VERSION); PyOS_snprintf(rtversion, 4, "%s", Py_GetVersion()); if (ctversion[0] != rtversion[0] || ctversion[2] != rtversion[2]) { char message[200]; PyOS_snprintf(message, sizeof(message), "compiletime version %s of module '%.100s' " "does not match runtime version %s", ctversion, __Pyx_MODULE_NAME, rtversion); return PyErr_WarnEx(NULL, message, 1); } return 0; } #ifndef __PYX_HAVE_RT_ImportModule #define __PYX_HAVE_RT_ImportModule static PyObject *__Pyx_ImportModule(const char *name) { PyObject *py_name = 0; PyObject *py_module = 0; py_name = __Pyx_PyIdentifier_FromString(name); if (!py_name) goto bad; py_module = PyImport_Import(py_name); Py_DECREF(py_name); return py_module; bad: Py_XDECREF(py_name); return 0; } #endif #ifndef __PYX_HAVE_RT_ImportType #define __PYX_HAVE_RT_ImportType static PyTypeObject *__Pyx_ImportType(const char *module_name, const char *class_name, size_t size, int strict) { PyObject *py_module = 0; PyObject *result = 0; PyObject *py_name = 0; char warning[200]; Py_ssize_t basicsize; #ifdef Py_LIMITED_API PyObject *py_basicsize; #endif py_module = __Pyx_ImportModule(module_name); if (!py_module) goto bad; py_name = __Pyx_PyIdentifier_FromString(class_name); if (!py_name) goto bad; result = PyObject_GetAttr(py_module, py_name); Py_DECREF(py_name); py_name = 0; Py_DECREF(py_module); py_module = 0; if (!result) goto bad; if (!PyType_Check(result)) { PyErr_Format(PyExc_TypeError, "%.200s.%.200s is not a type object", module_name, class_name); goto bad; } #ifndef Py_LIMITED_API basicsize = ((PyTypeObject *)result)->tp_basicsize; #else py_basicsize = PyObject_GetAttrString(result, "__basicsize__"); if (!py_basicsize) goto bad; basicsize = PyLong_AsSsize_t(py_basicsize); Py_DECREF(py_basicsize); py_basicsize = 0; if (basicsize == (Py_ssize_t)-1 && PyErr_Occurred()) goto bad; #endif if (!strict && (size_t)basicsize > size) { PyOS_snprintf(warning, sizeof(warning), "%s.%s size changed, may indicate binary incompatibility", module_name, class_name); if (PyErr_WarnEx(NULL, warning, 0) < 0) goto bad; } else if ((size_t)basicsize != size) { PyErr_Format(PyExc_ValueError, "%.200s.%.200s has the wrong size, try recompiling", module_name, class_name); goto bad; } return (PyTypeObject *)result; bad: Py_XDECREF(py_module); Py_XDECREF(result); return NULL; } #endif static int __Pyx_InitStrings(__Pyx_StringTabEntry *t) { while (t->p) { #if PY_MAJOR_VERSION < 3 if (t->is_unicode) { *t->p = PyUnicode_DecodeUTF8(t->s, t->n - 1, NULL); } else if (t->intern) { *t->p = PyString_InternFromString(t->s); } else { *t->p = PyString_FromStringAndSize(t->s, t->n - 1); } #else if (t->is_unicode | t->is_str) { if (t->intern) { *t->p = PyUnicode_InternFromString(t->s); } else if (t->encoding) { *t->p = PyUnicode_Decode(t->s, t->n - 1, t->encoding, NULL); } else { *t->p = PyUnicode_FromStringAndSize(t->s, t->n - 1); } } else { *t->p = PyBytes_FromStringAndSize(t->s, t->n - 1); } #endif if (!*t->p) return -1; ++t; } return 0; } static CYTHON_INLINE PyObject* __Pyx_PyUnicode_FromString(const char* c_str) { return __Pyx_PyUnicode_FromStringAndSize(c_str, (Py_ssize_t)strlen(c_str)); } static CYTHON_INLINE char* __Pyx_PyObject_AsString(PyObject* o) { Py_ssize_t ignore; return __Pyx_PyObject_AsStringAndSize(o, &ignore); } static CYTHON_INLINE char* __Pyx_PyObject_AsStringAndSize(PyObject* o, Py_ssize_t *length) { #if CYTHON_COMPILING_IN_CPYTHON && (__PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT) if ( #if PY_MAJOR_VERSION < 3 && __PYX_DEFAULT_STRING_ENCODING_IS_ASCII __Pyx_sys_getdefaultencoding_not_ascii && #endif PyUnicode_Check(o)) { #if PY_VERSION_HEX < 0x03030000 char* defenc_c; PyObject* defenc = _PyUnicode_AsDefaultEncodedString(o, NULL); if (!defenc) return NULL; defenc_c = PyBytes_AS_STRING(defenc); #if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII { char* end = defenc_c + PyBytes_GET_SIZE(defenc); char* c; for (c = defenc_c; c < end; c++) { if ((unsigned char) (*c) >= 128) { PyUnicode_AsASCIIString(o); return NULL; } } } #endif *length = PyBytes_GET_SIZE(defenc); return defenc_c; #else if (__Pyx_PyUnicode_READY(o) == -1) return NULL; #if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII if (PyUnicode_IS_ASCII(o)) { *length = PyUnicode_GET_LENGTH(o); return PyUnicode_AsUTF8(o); } else { PyUnicode_AsASCIIString(o); return NULL; } #else return PyUnicode_AsUTF8AndSize(o, length); #endif #endif } else #endif #if (!CYTHON_COMPILING_IN_PYPY) || (defined(PyByteArray_AS_STRING) && defined(PyByteArray_GET_SIZE)) if (PyByteArray_Check(o)) { *length = PyByteArray_GET_SIZE(o); return PyByteArray_AS_STRING(o); } else #endif { char* result; int r = PyBytes_AsStringAndSize(o, &result, length); if (unlikely(r < 0)) { return NULL; } else { return result; } } } static CYTHON_INLINE int __Pyx_PyObject_IsTrue(PyObject* x) { int is_true = x == Py_True; if (is_true | (x == Py_False) | (x == Py_None)) return is_true; else return PyObject_IsTrue(x); } static CYTHON_INLINE PyObject* __Pyx_PyNumber_Int(PyObject* x) { PyNumberMethods *m; const char *name = NULL; PyObject *res = NULL; #if PY_MAJOR_VERSION < 3 if (PyInt_Check(x) || PyLong_Check(x)) #else if (PyLong_Check(x)) #endif return __Pyx_NewRef(x); m = Py_TYPE(x)->tp_as_number; #if PY_MAJOR_VERSION < 3 if (m && m->nb_int) { name = "int"; res = PyNumber_Int(x); } else if (m && m->nb_long) { name = "long"; res = PyNumber_Long(x); } #else if (m && m->nb_int) { name = "int"; res = PyNumber_Long(x); } #endif if (res) { #if PY_MAJOR_VERSION < 3 if (!PyInt_Check(res) && !PyLong_Check(res)) { #else if (!PyLong_Check(res)) { #endif PyErr_Format(PyExc_TypeError, "__%.4s__ returned non-%.4s (type %.200s)", name, name, Py_TYPE(res)->tp_name); Py_DECREF(res); return NULL; } } else if (!PyErr_Occurred()) { PyErr_SetString(PyExc_TypeError, "an integer is required"); } return res; } static CYTHON_INLINE Py_ssize_t __Pyx_PyIndex_AsSsize_t(PyObject* b) { Py_ssize_t ival; PyObject *x; #if PY_MAJOR_VERSION < 3 if (likely(PyInt_CheckExact(b))) { if (sizeof(Py_ssize_t) >= sizeof(long)) return PyInt_AS_LONG(b); else return PyInt_AsSsize_t(x); } #endif if (likely(PyLong_CheckExact(b))) { #if CYTHON_USE_PYLONG_INTERNALS const digit* digits = ((PyLongObject*)b)->ob_digit; const Py_ssize_t size = Py_SIZE(b); if (likely(__Pyx_sst_abs(size) <= 1)) { ival = likely(size) ? digits[0] : 0; if (size == -1) ival = -ival; return ival; } else { switch (size) { case 2: if (8 * sizeof(Py_ssize_t) > 2 * PyLong_SHIFT) { return (Py_ssize_t) (((((size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])); } break; case -2: if (8 * sizeof(Py_ssize_t) > 2 * PyLong_SHIFT) { return -(Py_ssize_t) (((((size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])); } break; case 3: if (8 * sizeof(Py_ssize_t) > 3 * PyLong_SHIFT) { return (Py_ssize_t) (((((((size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])); } break; case -3: if (8 * sizeof(Py_ssize_t) > 3 * PyLong_SHIFT) { return -(Py_ssize_t) (((((((size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])); } break; case 4: if (8 * sizeof(Py_ssize_t) > 4 * PyLong_SHIFT) { return (Py_ssize_t) (((((((((size_t)digits[3]) << PyLong_SHIFT) | (size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])); } break; case -4: if (8 * sizeof(Py_ssize_t) > 4 * PyLong_SHIFT) { return -(Py_ssize_t) (((((((((size_t)digits[3]) << PyLong_SHIFT) | (size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])); } break; } } #endif return PyLong_AsSsize_t(b); } x = PyNumber_Index(b); if (!x) return -1; ival = PyInt_AsSsize_t(x); Py_DECREF(x); return ival; } static CYTHON_INLINE PyObject * __Pyx_PyInt_FromSize_t(size_t ival) { return PyInt_FromSize_t(ival); } #endif /* Py_PYTHON_H */ pygame_sdl2-2.1.0-for-renpy-6.99.14.1/gen/pygame_sdl2.rwobject.c0000664000175000017500000065324212764142606023233 0ustar tomtom00000000000000/* Generated by Cython 0.23.5 */ #define PY_SSIZE_T_CLEAN #include "Python.h" #ifndef Py_PYTHON_H #error Python headers needed to compile C extensions, please install development version of Python. #elif PY_VERSION_HEX < 0x02060000 || (0x03000000 <= PY_VERSION_HEX && PY_VERSION_HEX < 0x03020000) #error Cython requires Python 2.6+ or Python 3.2+. #else #define CYTHON_ABI "0_23_5" #include #ifndef offsetof #define offsetof(type, member) ( (size_t) & ((type*)0) -> member ) #endif #if !defined(WIN32) && !defined(MS_WINDOWS) #ifndef __stdcall #define __stdcall #endif #ifndef __cdecl #define __cdecl #endif #ifndef __fastcall #define __fastcall #endif #endif #ifndef DL_IMPORT #define DL_IMPORT(t) t #endif #ifndef DL_EXPORT #define DL_EXPORT(t) t #endif #ifndef PY_LONG_LONG #define PY_LONG_LONG LONG_LONG #endif #ifndef Py_HUGE_VAL #define Py_HUGE_VAL HUGE_VAL #endif #ifdef PYPY_VERSION #define CYTHON_COMPILING_IN_PYPY 1 #define CYTHON_COMPILING_IN_CPYTHON 0 #else #define CYTHON_COMPILING_IN_PYPY 0 #define CYTHON_COMPILING_IN_CPYTHON 1 #endif #if !defined(CYTHON_USE_PYLONG_INTERNALS) && CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x02070000 #define CYTHON_USE_PYLONG_INTERNALS 1 #endif #if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX < 0x02070600 && !defined(Py_OptimizeFlag) #define Py_OptimizeFlag 0 #endif #define __PYX_BUILD_PY_SSIZE_T "n" #define CYTHON_FORMAT_SSIZE_T "z" #if PY_MAJOR_VERSION < 3 #define __Pyx_BUILTIN_MODULE_NAME "__builtin__" #define __Pyx_PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)\ PyCode_New(a+k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos) #define __Pyx_DefaultClassType PyClass_Type #else #define __Pyx_BUILTIN_MODULE_NAME "builtins" #define __Pyx_PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)\ PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos) #define __Pyx_DefaultClassType PyType_Type #endif #ifndef Py_TPFLAGS_CHECKTYPES #define Py_TPFLAGS_CHECKTYPES 0 #endif #ifndef Py_TPFLAGS_HAVE_INDEX #define Py_TPFLAGS_HAVE_INDEX 0 #endif #ifndef Py_TPFLAGS_HAVE_NEWBUFFER #define Py_TPFLAGS_HAVE_NEWBUFFER 0 #endif #ifndef Py_TPFLAGS_HAVE_FINALIZE #define Py_TPFLAGS_HAVE_FINALIZE 0 #endif #if PY_VERSION_HEX > 0x03030000 && defined(PyUnicode_KIND) #define CYTHON_PEP393_ENABLED 1 #define __Pyx_PyUnicode_READY(op) (likely(PyUnicode_IS_READY(op)) ?\ 0 : _PyUnicode_Ready((PyObject *)(op))) #define __Pyx_PyUnicode_GET_LENGTH(u) PyUnicode_GET_LENGTH(u) #define __Pyx_PyUnicode_READ_CHAR(u, i) PyUnicode_READ_CHAR(u, i) #define __Pyx_PyUnicode_KIND(u) PyUnicode_KIND(u) #define __Pyx_PyUnicode_DATA(u) PyUnicode_DATA(u) #define __Pyx_PyUnicode_READ(k, d, i) PyUnicode_READ(k, d, i) #else #define CYTHON_PEP393_ENABLED 0 #define __Pyx_PyUnicode_READY(op) (0) #define __Pyx_PyUnicode_GET_LENGTH(u) PyUnicode_GET_SIZE(u) #define __Pyx_PyUnicode_READ_CHAR(u, i) ((Py_UCS4)(PyUnicode_AS_UNICODE(u)[i])) #define __Pyx_PyUnicode_KIND(u) (sizeof(Py_UNICODE)) #define __Pyx_PyUnicode_DATA(u) ((void*)PyUnicode_AS_UNICODE(u)) #define __Pyx_PyUnicode_READ(k, d, i) ((void)(k), (Py_UCS4)(((Py_UNICODE*)d)[i])) #endif #if CYTHON_COMPILING_IN_PYPY #define __Pyx_PyUnicode_Concat(a, b) PyNumber_Add(a, b) #define __Pyx_PyUnicode_ConcatSafe(a, b) PyNumber_Add(a, b) #else #define __Pyx_PyUnicode_Concat(a, b) PyUnicode_Concat(a, b) #define __Pyx_PyUnicode_ConcatSafe(a, b) ((unlikely((a) == Py_None) || unlikely((b) == Py_None)) ?\ PyNumber_Add(a, b) : __Pyx_PyUnicode_Concat(a, b)) #endif #if CYTHON_COMPILING_IN_PYPY && !defined(PyUnicode_Contains) #define PyUnicode_Contains(u, s) PySequence_Contains(u, s) #endif #define __Pyx_PyString_FormatSafe(a, b) ((unlikely((a) == Py_None)) ? PyNumber_Remainder(a, b) : __Pyx_PyString_Format(a, b)) #define __Pyx_PyUnicode_FormatSafe(a, b) ((unlikely((a) == Py_None)) ? PyNumber_Remainder(a, b) : PyUnicode_Format(a, b)) #if PY_MAJOR_VERSION >= 3 #define __Pyx_PyString_Format(a, b) PyUnicode_Format(a, b) #else #define __Pyx_PyString_Format(a, b) PyString_Format(a, b) #endif #if PY_MAJOR_VERSION >= 3 #define PyBaseString_Type PyUnicode_Type #define PyStringObject PyUnicodeObject #define PyString_Type PyUnicode_Type #define PyString_Check PyUnicode_Check #define PyString_CheckExact PyUnicode_CheckExact #endif #if PY_MAJOR_VERSION >= 3 #define __Pyx_PyBaseString_Check(obj) PyUnicode_Check(obj) #define __Pyx_PyBaseString_CheckExact(obj) PyUnicode_CheckExact(obj) #else #define __Pyx_PyBaseString_Check(obj) (PyString_Check(obj) || PyUnicode_Check(obj)) #define __Pyx_PyBaseString_CheckExact(obj) (PyString_CheckExact(obj) || PyUnicode_CheckExact(obj)) #endif #ifndef PySet_CheckExact #define PySet_CheckExact(obj) (Py_TYPE(obj) == &PySet_Type) #endif #define __Pyx_TypeCheck(obj, type) PyObject_TypeCheck(obj, (PyTypeObject *)type) #if PY_MAJOR_VERSION >= 3 #define PyIntObject PyLongObject #define PyInt_Type PyLong_Type #define PyInt_Check(op) PyLong_Check(op) #define PyInt_CheckExact(op) PyLong_CheckExact(op) #define PyInt_FromString PyLong_FromString #define PyInt_FromUnicode PyLong_FromUnicode #define PyInt_FromLong PyLong_FromLong #define PyInt_FromSize_t PyLong_FromSize_t #define PyInt_FromSsize_t PyLong_FromSsize_t #define PyInt_AsLong PyLong_AsLong #define PyInt_AS_LONG PyLong_AS_LONG #define PyInt_AsSsize_t PyLong_AsSsize_t #define PyInt_AsUnsignedLongMask PyLong_AsUnsignedLongMask #define PyInt_AsUnsignedLongLongMask PyLong_AsUnsignedLongLongMask #define PyNumber_Int PyNumber_Long #endif #if PY_MAJOR_VERSION >= 3 #define PyBoolObject PyLongObject #endif #if PY_MAJOR_VERSION >= 3 && CYTHON_COMPILING_IN_PYPY #ifndef PyUnicode_InternFromString #define PyUnicode_InternFromString(s) PyUnicode_FromString(s) #endif #endif #if PY_VERSION_HEX < 0x030200A4 typedef long Py_hash_t; #define __Pyx_PyInt_FromHash_t PyInt_FromLong #define __Pyx_PyInt_AsHash_t PyInt_AsLong #else #define __Pyx_PyInt_FromHash_t PyInt_FromSsize_t #define __Pyx_PyInt_AsHash_t PyInt_AsSsize_t #endif #if PY_MAJOR_VERSION >= 3 #define __Pyx_PyMethod_New(func, self, klass) ((self) ? PyMethod_New(func, self) : PyInstanceMethod_New(func)) #else #define __Pyx_PyMethod_New(func, self, klass) PyMethod_New(func, self, klass) #endif #if PY_VERSION_HEX >= 0x030500B1 #define __Pyx_PyAsyncMethodsStruct PyAsyncMethods #define __Pyx_PyType_AsAsync(obj) (Py_TYPE(obj)->tp_as_async) #elif CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3 typedef struct { unaryfunc am_await; unaryfunc am_aiter; unaryfunc am_anext; } __Pyx_PyAsyncMethodsStruct; #define __Pyx_PyType_AsAsync(obj) ((__Pyx_PyAsyncMethodsStruct*) (Py_TYPE(obj)->tp_reserved)) #else #define __Pyx_PyType_AsAsync(obj) NULL #endif #ifndef CYTHON_RESTRICT #if defined(__GNUC__) #define CYTHON_RESTRICT __restrict__ #elif defined(_MSC_VER) && _MSC_VER >= 1400 #define CYTHON_RESTRICT __restrict #elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L #define CYTHON_RESTRICT restrict #else #define CYTHON_RESTRICT #endif #endif #define __Pyx_void_to_None(void_result) ((void)(void_result), Py_INCREF(Py_None), Py_None) #ifndef CYTHON_INLINE #if defined(__GNUC__) #define CYTHON_INLINE __inline__ #elif defined(_MSC_VER) #define CYTHON_INLINE __inline #elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L #define CYTHON_INLINE inline #else #define CYTHON_INLINE #endif #endif #if defined(WIN32) || defined(MS_WINDOWS) #define _USE_MATH_DEFINES #endif #include #ifdef NAN #define __PYX_NAN() ((float) NAN) #else static CYTHON_INLINE float __PYX_NAN() { float value; memset(&value, 0xFF, sizeof(value)); return value; } #endif #if PY_MAJOR_VERSION >= 3 #define __Pyx_PyNumber_Divide(x,y) PyNumber_TrueDivide(x,y) #define __Pyx_PyNumber_InPlaceDivide(x,y) PyNumber_InPlaceTrueDivide(x,y) #else #define __Pyx_PyNumber_Divide(x,y) PyNumber_Divide(x,y) #define __Pyx_PyNumber_InPlaceDivide(x,y) PyNumber_InPlaceDivide(x,y) #endif #ifndef __PYX_EXTERN_C #ifdef __cplusplus #define __PYX_EXTERN_C extern "C" #else #define __PYX_EXTERN_C extern #endif #endif #define __PYX_HAVE__pygame_sdl2__rwobject #define __PYX_HAVE_API__pygame_sdl2__rwobject #include "stdint.h" #include "string.h" #include "stdio.h" #include "stddef.h" #include "SDL.h" #include "stdlib.h" #ifdef _OPENMP #include #endif /* _OPENMP */ #ifdef PYREX_WITHOUT_ASSERTIONS #define CYTHON_WITHOUT_ASSERTIONS #endif #ifndef CYTHON_UNUSED # if defined(__GNUC__) # if !(defined(__cplusplus)) || (__GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 4)) # define CYTHON_UNUSED __attribute__ ((__unused__)) # else # define CYTHON_UNUSED # endif # elif defined(__ICC) || (defined(__INTEL_COMPILER) && !defined(_MSC_VER)) # define CYTHON_UNUSED __attribute__ ((__unused__)) # else # define CYTHON_UNUSED # endif #endif #ifndef CYTHON_NCP_UNUSED # if CYTHON_COMPILING_IN_CPYTHON # define CYTHON_NCP_UNUSED # else # define CYTHON_NCP_UNUSED CYTHON_UNUSED # endif #endif typedef struct {PyObject **p; char *s; const Py_ssize_t n; const char* encoding; const char is_unicode; const char is_str; const char intern; } __Pyx_StringTabEntry; #define __PYX_DEFAULT_STRING_ENCODING_IS_ASCII 0 #define __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT 0 #define __PYX_DEFAULT_STRING_ENCODING "" #define __Pyx_PyObject_FromString __Pyx_PyBytes_FromString #define __Pyx_PyObject_FromStringAndSize __Pyx_PyBytes_FromStringAndSize #define __Pyx_uchar_cast(c) ((unsigned char)c) #define __Pyx_long_cast(x) ((long)x) #define __Pyx_fits_Py_ssize_t(v, type, is_signed) (\ (sizeof(type) < sizeof(Py_ssize_t)) ||\ (sizeof(type) > sizeof(Py_ssize_t) &&\ likely(v < (type)PY_SSIZE_T_MAX ||\ v == (type)PY_SSIZE_T_MAX) &&\ (!is_signed || likely(v > (type)PY_SSIZE_T_MIN ||\ v == (type)PY_SSIZE_T_MIN))) ||\ (sizeof(type) == sizeof(Py_ssize_t) &&\ (is_signed || likely(v < (type)PY_SSIZE_T_MAX ||\ v == (type)PY_SSIZE_T_MAX))) ) #if defined (__cplusplus) && __cplusplus >= 201103L #include #define __Pyx_sst_abs(value) std::abs(value) #elif SIZEOF_INT >= SIZEOF_SIZE_T #define __Pyx_sst_abs(value) abs(value) #elif SIZEOF_LONG >= SIZEOF_SIZE_T #define __Pyx_sst_abs(value) labs(value) #elif defined (_MSC_VER) && defined (_M_X64) #define __Pyx_sst_abs(value) _abs64(value) #elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L #define __Pyx_sst_abs(value) llabs(value) #elif defined (__GNUC__) #define __Pyx_sst_abs(value) __builtin_llabs(value) #else #define __Pyx_sst_abs(value) ((value<0) ? -value : value) #endif static CYTHON_INLINE char* __Pyx_PyObject_AsString(PyObject*); static CYTHON_INLINE char* __Pyx_PyObject_AsStringAndSize(PyObject*, Py_ssize_t* length); #define __Pyx_PyByteArray_FromString(s) PyByteArray_FromStringAndSize((const char*)s, strlen((const char*)s)) #define __Pyx_PyByteArray_FromStringAndSize(s, l) PyByteArray_FromStringAndSize((const char*)s, l) #define __Pyx_PyBytes_FromString PyBytes_FromString #define __Pyx_PyBytes_FromStringAndSize PyBytes_FromStringAndSize static CYTHON_INLINE PyObject* __Pyx_PyUnicode_FromString(const char*); #if PY_MAJOR_VERSION < 3 #define __Pyx_PyStr_FromString __Pyx_PyBytes_FromString #define __Pyx_PyStr_FromStringAndSize __Pyx_PyBytes_FromStringAndSize #else #define __Pyx_PyStr_FromString __Pyx_PyUnicode_FromString #define __Pyx_PyStr_FromStringAndSize __Pyx_PyUnicode_FromStringAndSize #endif #define __Pyx_PyObject_AsSString(s) ((signed char*) __Pyx_PyObject_AsString(s)) #define __Pyx_PyObject_AsUString(s) ((unsigned char*) __Pyx_PyObject_AsString(s)) #define __Pyx_PyObject_FromCString(s) __Pyx_PyObject_FromString((const char*)s) #define __Pyx_PyBytes_FromCString(s) __Pyx_PyBytes_FromString((const char*)s) #define __Pyx_PyByteArray_FromCString(s) __Pyx_PyByteArray_FromString((const char*)s) #define __Pyx_PyStr_FromCString(s) __Pyx_PyStr_FromString((const char*)s) #define __Pyx_PyUnicode_FromCString(s) __Pyx_PyUnicode_FromString((const char*)s) #if PY_MAJOR_VERSION < 3 static CYTHON_INLINE size_t __Pyx_Py_UNICODE_strlen(const Py_UNICODE *u) { const Py_UNICODE *u_end = u; while (*u_end++) ; return (size_t)(u_end - u - 1); } #else #define __Pyx_Py_UNICODE_strlen Py_UNICODE_strlen #endif #define __Pyx_PyUnicode_FromUnicode(u) PyUnicode_FromUnicode(u, __Pyx_Py_UNICODE_strlen(u)) #define __Pyx_PyUnicode_FromUnicodeAndLength PyUnicode_FromUnicode #define __Pyx_PyUnicode_AsUnicode PyUnicode_AsUnicode #define __Pyx_NewRef(obj) (Py_INCREF(obj), obj) #define __Pyx_Owned_Py_None(b) __Pyx_NewRef(Py_None) #define __Pyx_PyBool_FromLong(b) ((b) ? __Pyx_NewRef(Py_True) : __Pyx_NewRef(Py_False)) static CYTHON_INLINE int __Pyx_PyObject_IsTrue(PyObject*); static CYTHON_INLINE PyObject* __Pyx_PyNumber_Int(PyObject* x); static CYTHON_INLINE Py_ssize_t __Pyx_PyIndex_AsSsize_t(PyObject*); static CYTHON_INLINE PyObject * __Pyx_PyInt_FromSize_t(size_t); #if CYTHON_COMPILING_IN_CPYTHON #define __pyx_PyFloat_AsDouble(x) (PyFloat_CheckExact(x) ? PyFloat_AS_DOUBLE(x) : PyFloat_AsDouble(x)) #else #define __pyx_PyFloat_AsDouble(x) PyFloat_AsDouble(x) #endif #define __pyx_PyFloat_AsFloat(x) ((float) __pyx_PyFloat_AsDouble(x)) #if PY_MAJOR_VERSION < 3 && __PYX_DEFAULT_STRING_ENCODING_IS_ASCII static int __Pyx_sys_getdefaultencoding_not_ascii; static int __Pyx_init_sys_getdefaultencoding_params(void) { PyObject* sys; PyObject* default_encoding = NULL; PyObject* ascii_chars_u = NULL; PyObject* ascii_chars_b = NULL; const char* default_encoding_c; sys = PyImport_ImportModule("sys"); if (!sys) goto bad; default_encoding = PyObject_CallMethod(sys, (char*) "getdefaultencoding", NULL); Py_DECREF(sys); if (!default_encoding) goto bad; default_encoding_c = PyBytes_AsString(default_encoding); if (!default_encoding_c) goto bad; if (strcmp(default_encoding_c, "ascii") == 0) { __Pyx_sys_getdefaultencoding_not_ascii = 0; } else { char ascii_chars[128]; int c; for (c = 0; c < 128; c++) { ascii_chars[c] = c; } __Pyx_sys_getdefaultencoding_not_ascii = 1; ascii_chars_u = PyUnicode_DecodeASCII(ascii_chars, 128, NULL); if (!ascii_chars_u) goto bad; ascii_chars_b = PyUnicode_AsEncodedString(ascii_chars_u, default_encoding_c, NULL); if (!ascii_chars_b || !PyBytes_Check(ascii_chars_b) || memcmp(ascii_chars, PyBytes_AS_STRING(ascii_chars_b), 128) != 0) { PyErr_Format( PyExc_ValueError, "This module compiled with c_string_encoding=ascii, but default encoding '%.200s' is not a superset of ascii.", default_encoding_c); goto bad; } Py_DECREF(ascii_chars_u); Py_DECREF(ascii_chars_b); } Py_DECREF(default_encoding); return 0; bad: Py_XDECREF(default_encoding); Py_XDECREF(ascii_chars_u); Py_XDECREF(ascii_chars_b); return -1; } #endif #if __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT && PY_MAJOR_VERSION >= 3 #define __Pyx_PyUnicode_FromStringAndSize(c_str, size) PyUnicode_DecodeUTF8(c_str, size, NULL) #else #define __Pyx_PyUnicode_FromStringAndSize(c_str, size) PyUnicode_Decode(c_str, size, __PYX_DEFAULT_STRING_ENCODING, NULL) #if __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT static char* __PYX_DEFAULT_STRING_ENCODING; static int __Pyx_init_sys_getdefaultencoding_params(void) { PyObject* sys; PyObject* default_encoding = NULL; char* default_encoding_c; sys = PyImport_ImportModule("sys"); if (!sys) goto bad; default_encoding = PyObject_CallMethod(sys, (char*) (const char*) "getdefaultencoding", NULL); Py_DECREF(sys); if (!default_encoding) goto bad; default_encoding_c = PyBytes_AsString(default_encoding); if (!default_encoding_c) goto bad; __PYX_DEFAULT_STRING_ENCODING = (char*) malloc(strlen(default_encoding_c)); if (!__PYX_DEFAULT_STRING_ENCODING) goto bad; strcpy(__PYX_DEFAULT_STRING_ENCODING, default_encoding_c); Py_DECREF(default_encoding); return 0; bad: Py_XDECREF(default_encoding); return -1; } #endif #endif /* Test for GCC > 2.95 */ #if defined(__GNUC__) && (__GNUC__ > 2 || (__GNUC__ == 2 && (__GNUC_MINOR__ > 95))) #define likely(x) __builtin_expect(!!(x), 1) #define unlikely(x) __builtin_expect(!!(x), 0) #else /* !__GNUC__ or GCC < 2.95 */ #define likely(x) (x) #define unlikely(x) (x) #endif /* __GNUC__ */ static PyObject *__pyx_m; static PyObject *__pyx_d; static PyObject *__pyx_b; static PyObject *__pyx_empty_tuple; static PyObject *__pyx_empty_bytes; static int __pyx_lineno; static int __pyx_clineno = 0; static const char * __pyx_cfilenm= __FILE__; static const char *__pyx_filename; static const char *__pyx_f[] = { "src/pygame_sdl2/rwobject.pyx", "type.pxd", }; /*--- Type declarations ---*/ struct __pyx_opt_args_11pygame_sdl2_8rwobject_to_rwops; struct __pyx_t_11pygame_sdl2_8rwobject_SubFile; /* "pygame_sdl2/rwobject.pxd":21 * from sdl2 cimport SDL_RWops * * cdef SDL_RWops *to_rwops(filelike, mode=*) except NULL # <<<<<<<<<<<<<< * */ struct __pyx_opt_args_11pygame_sdl2_8rwobject_to_rwops { int __pyx_n; PyObject *mode; }; /* "pygame_sdl2/rwobject.pyx":124 * return 0 * * cdef struct SubFile: # <<<<<<<<<<<<<< * SDL_RWops *rw * Sint64 base */ struct __pyx_t_11pygame_sdl2_8rwobject_SubFile { SDL_RWops *rw; Sint64 base; Sint64 length; Sint64 tell; }; /* --- Runtime support code (head) --- */ #ifndef CYTHON_REFNANNY #define CYTHON_REFNANNY 0 #endif #if CYTHON_REFNANNY typedef struct { void (*INCREF)(void*, PyObject*, int); void (*DECREF)(void*, PyObject*, int); void (*GOTREF)(void*, PyObject*, int); void (*GIVEREF)(void*, PyObject*, int); void* (*SetupContext)(const char*, int, const char*); void (*FinishContext)(void**); } __Pyx_RefNannyAPIStruct; static __Pyx_RefNannyAPIStruct *__Pyx_RefNanny = NULL; static __Pyx_RefNannyAPIStruct *__Pyx_RefNannyImportAPI(const char *modname); #define __Pyx_RefNannyDeclarations void *__pyx_refnanny = NULL; #ifdef WITH_THREAD #define __Pyx_RefNannySetupContext(name, acquire_gil)\ if (acquire_gil) {\ PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure();\ __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), __LINE__, __FILE__);\ PyGILState_Release(__pyx_gilstate_save);\ } else {\ __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), __LINE__, __FILE__);\ } #else #define __Pyx_RefNannySetupContext(name, acquire_gil)\ __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), __LINE__, __FILE__) #endif #define __Pyx_RefNannyFinishContext()\ __Pyx_RefNanny->FinishContext(&__pyx_refnanny) #define __Pyx_INCREF(r) __Pyx_RefNanny->INCREF(__pyx_refnanny, (PyObject *)(r), __LINE__) #define __Pyx_DECREF(r) __Pyx_RefNanny->DECREF(__pyx_refnanny, (PyObject *)(r), __LINE__) #define __Pyx_GOTREF(r) __Pyx_RefNanny->GOTREF(__pyx_refnanny, (PyObject *)(r), __LINE__) #define __Pyx_GIVEREF(r) __Pyx_RefNanny->GIVEREF(__pyx_refnanny, (PyObject *)(r), __LINE__) #define __Pyx_XINCREF(r) do { if((r) != NULL) {__Pyx_INCREF(r); }} while(0) #define __Pyx_XDECREF(r) do { if((r) != NULL) {__Pyx_DECREF(r); }} while(0) #define __Pyx_XGOTREF(r) do { if((r) != NULL) {__Pyx_GOTREF(r); }} while(0) #define __Pyx_XGIVEREF(r) do { if((r) != NULL) {__Pyx_GIVEREF(r);}} while(0) #else #define __Pyx_RefNannyDeclarations #define __Pyx_RefNannySetupContext(name, acquire_gil) #define __Pyx_RefNannyFinishContext() #define __Pyx_INCREF(r) Py_INCREF(r) #define __Pyx_DECREF(r) Py_DECREF(r) #define __Pyx_GOTREF(r) #define __Pyx_GIVEREF(r) #define __Pyx_XINCREF(r) Py_XINCREF(r) #define __Pyx_XDECREF(r) Py_XDECREF(r) #define __Pyx_XGOTREF(r) #define __Pyx_XGIVEREF(r) #endif #define __Pyx_XDECREF_SET(r, v) do {\ PyObject *tmp = (PyObject *) r;\ r = v; __Pyx_XDECREF(tmp);\ } while (0) #define __Pyx_DECREF_SET(r, v) do {\ PyObject *tmp = (PyObject *) r;\ r = v; __Pyx_DECREF(tmp);\ } while (0) #define __Pyx_CLEAR(r) do { PyObject* tmp = ((PyObject*)(r)); r = NULL; __Pyx_DECREF(tmp);} while(0) #define __Pyx_XCLEAR(r) do { if((r) != NULL) {PyObject* tmp = ((PyObject*)(r)); r = NULL; __Pyx_DECREF(tmp);}} while(0) #if CYTHON_COMPILING_IN_CPYTHON static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStr(PyObject* obj, PyObject* attr_name) { PyTypeObject* tp = Py_TYPE(obj); if (likely(tp->tp_getattro)) return tp->tp_getattro(obj, attr_name); #if PY_MAJOR_VERSION < 3 if (likely(tp->tp_getattr)) return tp->tp_getattr(obj, PyString_AS_STRING(attr_name)); #endif return PyObject_GetAttr(obj, attr_name); } #else #define __Pyx_PyObject_GetAttrStr(o,n) PyObject_GetAttr(o,n) #endif static PyObject *__Pyx_GetBuiltinName(PyObject *name); #if CYTHON_COMPILING_IN_CPYTHON static CYTHON_INLINE PyObject* __Pyx_PyObject_Call(PyObject *func, PyObject *arg, PyObject *kw); #else #define __Pyx_PyObject_Call(func, arg, kw) PyObject_Call(func, arg, kw) #endif #ifndef __PYX_FORCE_INIT_THREADS #define __PYX_FORCE_INIT_THREADS 0 #endif #if CYTHON_COMPILING_IN_CPYTHON static CYTHON_INLINE PyObject* __Pyx_PyObject_CallMethO(PyObject *func, PyObject *arg); #endif static CYTHON_INLINE PyObject* __Pyx_PyObject_CallOneArg(PyObject *func, PyObject *arg); #if CYTHON_COMPILING_IN_CPYTHON static CYTHON_INLINE PyObject* __Pyx_PyObject_CallNoArg(PyObject *func); #else #define __Pyx_PyObject_CallNoArg(func) __Pyx_PyObject_Call(func, __pyx_empty_tuple, NULL) #endif static CYTHON_INLINE void __Pyx_ExceptionSave(PyObject **type, PyObject **value, PyObject **tb); static void __Pyx_ExceptionReset(PyObject *type, PyObject *value, PyObject *tb); static int __Pyx_GetException(PyObject **type, PyObject **value, PyObject **tb); static CYTHON_INLINE void __Pyx_ErrRestore(PyObject *type, PyObject *value, PyObject *tb); static CYTHON_INLINE void __Pyx_ErrFetch(PyObject **type, PyObject **value, PyObject **tb); static void __Pyx_WriteUnraisable(const char *name, int clineno, int lineno, const char *filename, int full_traceback, int nogil); static CYTHON_INLINE PyObject *__Pyx_GetModuleGlobalName(PyObject *name); #include static CYTHON_INLINE int __Pyx_PyBytes_Equals(PyObject* s1, PyObject* s2, int equals); static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, PyObject *cause); static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list, int level); static PyObject* __Pyx_ImportFrom(PyObject* module, PyObject* name); typedef struct { int code_line; PyCodeObject* code_object; } __Pyx_CodeObjectCacheEntry; struct __Pyx_CodeObjectCache { int count; int max_count; __Pyx_CodeObjectCacheEntry* entries; }; static struct __Pyx_CodeObjectCache __pyx_code_cache = {0,0,NULL}; static int __pyx_bisect_code_objects(__Pyx_CodeObjectCacheEntry* entries, int count, int code_line); static PyCodeObject *__pyx_find_code_object(int code_line); static void __pyx_insert_code_object(int code_line, PyCodeObject* code_object); static void __Pyx_AddTraceback(const char *funcname, int c_line, int py_line, const char *filename); static CYTHON_INLINE int64_t __Pyx_PyInt_As_int64_t(PyObject *); static CYTHON_INLINE PyObject* __Pyx_PyInt_From_int64_t(int64_t value); static CYTHON_INLINE PyObject* __Pyx_PyInt_From_int(int value); static CYTHON_INLINE PyObject* __Pyx_PyInt_From_long(long value); static CYTHON_INLINE long __Pyx_PyInt_As_long(PyObject *); static CYTHON_INLINE int __Pyx_PyInt_As_int(PyObject *); static int __Pyx_check_binary_version(void); static int __Pyx_ExportFunction(const char *name, void (*f)(void), const char *sig); #if !defined(__Pyx_PyIdentifier_FromString) #if PY_MAJOR_VERSION < 3 #define __Pyx_PyIdentifier_FromString(s) PyString_FromString(s) #else #define __Pyx_PyIdentifier_FromString(s) PyUnicode_FromString(s) #endif #endif static PyObject *__Pyx_ImportModule(const char *name); static PyTypeObject *__Pyx_ImportType(const char *module_name, const char *class_name, size_t size, int strict); static int __Pyx_InitStrings(__Pyx_StringTabEntry *t); /* Module declarations from 'libc.stdint' */ /* Module declarations from 'libc.string' */ /* Module declarations from 'libc.stdio' */ /* Module declarations from 'libc.stddef' */ /* Module declarations from 'sdl2' */ /* Module declarations from '__builtin__' */ /* Module declarations from 'cpython.type' */ static PyTypeObject *__pyx_ptype_7cpython_4type_type = 0; /* Module declarations from 'cpython' */ /* Module declarations from 'cpython.object' */ /* Module declarations from 'cpython.ref' */ /* Module declarations from 'libc.stdlib' */ /* Module declarations from 'pygame_sdl2.rwobject' */ static SDL_RWops *__pyx_f_11pygame_sdl2_8rwobject_to_rwops(PyObject *, struct __pyx_opt_args_11pygame_sdl2_8rwobject_to_rwops *__pyx_optional_args); /*proto*/ static PyObject *__pyx_f_11pygame_sdl2_8rwobject_set_error(PyObject *); /*proto*/ static Sint64 __pyx_f_11pygame_sdl2_8rwobject_python_size(SDL_RWops *); /*proto*/ static Sint64 __pyx_f_11pygame_sdl2_8rwobject_python_seek(SDL_RWops *, Sint64, int); /*proto*/ static size_t __pyx_f_11pygame_sdl2_8rwobject_python_read(SDL_RWops *, void *, size_t, size_t); /*proto*/ static size_t __pyx_f_11pygame_sdl2_8rwobject_python_write(SDL_RWops *, void const *, size_t, size_t); /*proto*/ static int __pyx_f_11pygame_sdl2_8rwobject_python_close(SDL_RWops *); /*proto*/ static Sint64 __pyx_f_11pygame_sdl2_8rwobject_subfile_size(SDL_RWops *); /*proto*/ static Sint64 __pyx_f_11pygame_sdl2_8rwobject_subfile_seek(SDL_RWops *, Sint64, int); /*proto*/ static size_t __pyx_f_11pygame_sdl2_8rwobject_subfile_read(SDL_RWops *, void *, size_t, size_t); /*proto*/ static int __pyx_f_11pygame_sdl2_8rwobject_subfile_close(SDL_RWops *); /*proto*/ static SDL_RWops *__pyx_f_11pygame_sdl2_8rwobject_RWopsFromPython(PyObject *); /*proto*/ #define __Pyx_MODULE_NAME "pygame_sdl2.rwobject" int __pyx_module_is_main_pygame_sdl2__rwobject = 0; /* Implementation of 'pygame_sdl2.rwobject' */ static PyObject *__pyx_builtin_Exception; static PyObject *__pyx_builtin_IOError; static PyObject *__pyx_builtin_AttributeError; static char __pyx_k_s[] = "%s"; static char __pyx_k_rb[] = "rb"; static char __pyx_k_sys[] = "sys"; static char __pyx_k_base[] = "base"; static char __pyx_k_main[] = "__main__"; static char __pyx_k_name[] = "name"; static char __pyx_k_read[] = "read"; static char __pyx_k_seek[] = "seek"; static char __pyx_k_tell[] = "tell"; static char __pyx_k_test[] = "__test__"; static char __pyx_k_ascii[] = "ascii"; static char __pyx_k_bytes[] = "bytes_"; static char __pyx_k_close[] = "close"; static char __pyx_k_utf_8[] = "utf-8"; static char __pyx_k_write[] = "write"; static char __pyx_k_decode[] = "decode"; static char __pyx_k_encode[] = "encode"; static char __pyx_k_format[] = "format"; static char __pyx_k_import[] = "__import__"; static char __pyx_k_length[] = "length"; static char __pyx_k_IOError[] = "IOError"; static char __pyx_k_unicode[] = "unicode_"; static char __pyx_k_Exception[] = "Exception"; static char __pyx_k_file_type[] = "file_type"; static char __pyx_k_fsencoding[] = "fsencoding"; static char __pyx_k_AttributeError[] = "AttributeError"; static char __pyx_k_Could_not_open_r[] = "Could not open {!r}: {}"; static char __pyx_k_Could_not_open_r_2[] = "Could not open {!r}."; static char __pyx_k_pygame_sdl2_compat[] = "pygame_sdl2.compat"; static char __pyx_k_getfilesystemencoding[] = "getfilesystemencoding"; static char __pyx_k_r_is_not_a_filename_or_file_lik[] = "{!r} is not a filename or file-like object."; static PyObject *__pyx_n_s_AttributeError; static PyObject *__pyx_kp_s_Could_not_open_r; static PyObject *__pyx_kp_s_Could_not_open_r_2; static PyObject *__pyx_n_s_Exception; static PyObject *__pyx_n_s_IOError; static PyObject *__pyx_n_s_ascii; static PyObject *__pyx_n_s_base; static PyObject *__pyx_n_s_bytes; static PyObject *__pyx_n_s_close; static PyObject *__pyx_n_s_decode; static PyObject *__pyx_n_s_encode; static PyObject *__pyx_n_s_file_type; static PyObject *__pyx_n_s_format; static PyObject *__pyx_n_s_fsencoding; static PyObject *__pyx_n_s_getfilesystemencoding; static PyObject *__pyx_n_s_import; static PyObject *__pyx_n_s_length; static PyObject *__pyx_n_s_main; static PyObject *__pyx_n_s_name; static PyObject *__pyx_n_s_pygame_sdl2_compat; static PyObject *__pyx_kp_s_r_is_not_a_filename_or_file_lik; static PyObject *__pyx_n_b_rb; static PyObject *__pyx_n_s_rb; static PyObject *__pyx_n_s_read; static PyObject *__pyx_n_s_seek; static PyObject *__pyx_n_s_sys; static PyObject *__pyx_n_s_tell; static PyObject *__pyx_n_s_test; static PyObject *__pyx_n_s_unicode; static PyObject *__pyx_kp_s_utf_8; static PyObject *__pyx_n_s_write; static PyObject *__pyx_int_0; static PyObject *__pyx_int_2; static PyObject *__pyx_tuple_; static PyObject *__pyx_tuple__2; static PyObject *__pyx_tuple__3; static PyObject *__pyx_tuple__4; /* "pygame_sdl2/rwobject.pyx":56 * * * cdef set_error(e): # <<<<<<<<<<<<<< * cdef char *msg * e = str(e) */ static PyObject *__pyx_f_11pygame_sdl2_8rwobject_set_error(PyObject *__pyx_v_e) { char *__pyx_v_msg; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; char *__pyx_t_3; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("set_error", 0); __Pyx_INCREF(__pyx_v_e); /* "pygame_sdl2/rwobject.pyx":58 * cdef set_error(e): * cdef char *msg * e = str(e) # <<<<<<<<<<<<<< * msg = e * SDL_SetError("%s", msg) */ __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 58; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __Pyx_INCREF(__pyx_v_e); __Pyx_GIVEREF(__pyx_v_e); PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_e); __pyx_t_2 = __Pyx_PyObject_Call(((PyObject *)(&PyString_Type)), __pyx_t_1, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 58; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF_SET(__pyx_v_e, __pyx_t_2); __pyx_t_2 = 0; /* "pygame_sdl2/rwobject.pyx":59 * cdef char *msg * e = str(e) * msg = e # <<<<<<<<<<<<<< * SDL_SetError("%s", msg) * */ __pyx_t_3 = __Pyx_PyObject_AsString(__pyx_v_e); if (unlikely((!__pyx_t_3) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 59; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_v_msg = ((char *)__pyx_t_3); /* "pygame_sdl2/rwobject.pyx":60 * e = str(e) * msg = e * SDL_SetError("%s", msg) # <<<<<<<<<<<<<< * * cdef Sint64 python_size(SDL_RWops *context) with gil: */ SDL_SetError(__pyx_k_s, __pyx_v_msg); /* "pygame_sdl2/rwobject.pyx":56 * * * cdef set_error(e): # <<<<<<<<<<<<<< * cdef char *msg * e = str(e) */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_AddTraceback("pygame_sdl2.rwobject.set_error", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XDECREF(__pyx_v_e); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/rwobject.pyx":62 * SDL_SetError("%s", msg) * * cdef Sint64 python_size(SDL_RWops *context) with gil: # <<<<<<<<<<<<<< * f = context.hidden.unknown.data1 * */ static Sint64 __pyx_f_11pygame_sdl2_8rwobject_python_size(SDL_RWops *__pyx_v_context) { PyObject *__pyx_v_f = NULL; PyObject *__pyx_v_cur = NULL; PyObject *__pyx_v_rv = NULL; Sint64 __pyx_r; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; PyObject *__pyx_t_5 = NULL; PyObject *__pyx_t_6 = NULL; Py_ssize_t __pyx_t_7; PyObject *__pyx_t_8 = NULL; Sint64 __pyx_t_9; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; #ifdef WITH_THREAD PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure(); #endif __Pyx_RefNannySetupContext("python_size", 0); /* "pygame_sdl2/rwobject.pyx":63 * * cdef Sint64 python_size(SDL_RWops *context) with gil: * f = context.hidden.unknown.data1 # <<<<<<<<<<<<<< * * try: */ __pyx_t_1 = ((PyObject *)__pyx_v_context->hidden.unknown.data1); __Pyx_INCREF(__pyx_t_1); __pyx_v_f = __pyx_t_1; __pyx_t_1 = 0; /* "pygame_sdl2/rwobject.pyx":65 * f = context.hidden.unknown.data1 * * try: # <<<<<<<<<<<<<< * cur = f.tell() * f.seek(0, 2) */ { __Pyx_ExceptionSave(&__pyx_t_2, &__pyx_t_3, &__pyx_t_4); __Pyx_XGOTREF(__pyx_t_2); __Pyx_XGOTREF(__pyx_t_3); __Pyx_XGOTREF(__pyx_t_4); /*try:*/ { /* "pygame_sdl2/rwobject.pyx":66 * * try: * cur = f.tell() # <<<<<<<<<<<<<< * f.seek(0, 2) * rv = f.tell() */ __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_f, __pyx_n_s_tell); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 66; __pyx_clineno = __LINE__; goto __pyx_L3_error;} __Pyx_GOTREF(__pyx_t_5); __pyx_t_6 = NULL; if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_5))) { __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_5); if (likely(__pyx_t_6)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5); __Pyx_INCREF(__pyx_t_6); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_5, function); } } if (__pyx_t_6) { __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_t_6); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 66; __pyx_clineno = __LINE__; goto __pyx_L3_error;} __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; } else { __pyx_t_1 = __Pyx_PyObject_CallNoArg(__pyx_t_5); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 66; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __pyx_v_cur = __pyx_t_1; __pyx_t_1 = 0; /* "pygame_sdl2/rwobject.pyx":67 * try: * cur = f.tell() * f.seek(0, 2) # <<<<<<<<<<<<<< * rv = f.tell() * f.seek(cur, 0) */ __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_f, __pyx_n_s_seek); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 67; __pyx_clineno = __LINE__; goto __pyx_L3_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_tuple_, NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 67; __pyx_clineno = __LINE__; goto __pyx_L3_error;} __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; /* "pygame_sdl2/rwobject.pyx":68 * cur = f.tell() * f.seek(0, 2) * rv = f.tell() # <<<<<<<<<<<<<< * f.seek(cur, 0) * except: */ __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_f, __pyx_n_s_tell); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 68; __pyx_clineno = __LINE__; goto __pyx_L3_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_t_6 = NULL; if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_1))) { __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_1); if (likely(__pyx_t_6)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1); __Pyx_INCREF(__pyx_t_6); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_1, function); } } if (__pyx_t_6) { __pyx_t_5 = __Pyx_PyObject_CallOneArg(__pyx_t_1, __pyx_t_6); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 68; __pyx_clineno = __LINE__; goto __pyx_L3_error;} __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; } else { __pyx_t_5 = __Pyx_PyObject_CallNoArg(__pyx_t_1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 68; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_v_rv = __pyx_t_5; __pyx_t_5 = 0; /* "pygame_sdl2/rwobject.pyx":69 * f.seek(0, 2) * rv = f.tell() * f.seek(cur, 0) # <<<<<<<<<<<<<< * except: * return -1 */ __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_f, __pyx_n_s_seek); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 69; __pyx_clineno = __LINE__; goto __pyx_L3_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_t_6 = NULL; __pyx_t_7 = 0; if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_1))) { __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_1); if (likely(__pyx_t_6)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1); __Pyx_INCREF(__pyx_t_6); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_1, function); __pyx_t_7 = 1; } } __pyx_t_8 = PyTuple_New(2+__pyx_t_7); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 69; __pyx_clineno = __LINE__; goto __pyx_L3_error;} __Pyx_GOTREF(__pyx_t_8); if (__pyx_t_6) { __Pyx_GIVEREF(__pyx_t_6); PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_6); __pyx_t_6 = NULL; } __Pyx_INCREF(__pyx_v_cur); __Pyx_GIVEREF(__pyx_v_cur); PyTuple_SET_ITEM(__pyx_t_8, 0+__pyx_t_7, __pyx_v_cur); __Pyx_INCREF(__pyx_int_0); __Pyx_GIVEREF(__pyx_int_0); PyTuple_SET_ITEM(__pyx_t_8, 1+__pyx_t_7, __pyx_int_0); __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_8, NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 69; __pyx_clineno = __LINE__; goto __pyx_L3_error;} __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; /* "pygame_sdl2/rwobject.pyx":65 * f = context.hidden.unknown.data1 * * try: # <<<<<<<<<<<<<< * cur = f.tell() * f.seek(0, 2) */ } __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; goto __pyx_L10_try_end; __pyx_L3_error:; __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0; __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; /* "pygame_sdl2/rwobject.pyx":70 * rv = f.tell() * f.seek(cur, 0) * except: # <<<<<<<<<<<<<< * return -1 * */ /*except:*/ { __Pyx_AddTraceback("pygame_sdl2.rwobject.python_size", __pyx_clineno, __pyx_lineno, __pyx_filename); if (__Pyx_GetException(&__pyx_t_5, &__pyx_t_1, &__pyx_t_8) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 70; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} __Pyx_GOTREF(__pyx_t_5); __Pyx_GOTREF(__pyx_t_1); __Pyx_GOTREF(__pyx_t_8); /* "pygame_sdl2/rwobject.pyx":71 * f.seek(cur, 0) * except: * return -1 # <<<<<<<<<<<<<< * * return rv */ __pyx_r = -1L; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; goto __pyx_L6_except_return; } __pyx_L5_except_error:; /* "pygame_sdl2/rwobject.pyx":65 * f = context.hidden.unknown.data1 * * try: # <<<<<<<<<<<<<< * cur = f.tell() * f.seek(0, 2) */ __Pyx_XGIVEREF(__pyx_t_2); __Pyx_XGIVEREF(__pyx_t_3); __Pyx_XGIVEREF(__pyx_t_4); __Pyx_ExceptionReset(__pyx_t_2, __pyx_t_3, __pyx_t_4); goto __pyx_L1_error; __pyx_L6_except_return:; __Pyx_XGIVEREF(__pyx_t_2); __Pyx_XGIVEREF(__pyx_t_3); __Pyx_XGIVEREF(__pyx_t_4); __Pyx_ExceptionReset(__pyx_t_2, __pyx_t_3, __pyx_t_4); goto __pyx_L0; __pyx_L10_try_end:; } /* "pygame_sdl2/rwobject.pyx":73 * return -1 * * return rv # <<<<<<<<<<<<<< * * cdef Sint64 python_seek(SDL_RWops *context, Sint64 seek, int whence) with gil: */ __pyx_t_9 = __Pyx_PyInt_As_int64_t(__pyx_v_rv); if (unlikely((__pyx_t_9 == (Sint64)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 73; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_r = __pyx_t_9; goto __pyx_L0; /* "pygame_sdl2/rwobject.pyx":62 * SDL_SetError("%s", msg) * * cdef Sint64 python_size(SDL_RWops *context) with gil: # <<<<<<<<<<<<<< * f = context.hidden.unknown.data1 * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_5); __Pyx_XDECREF(__pyx_t_6); __Pyx_XDECREF(__pyx_t_8); __Pyx_WriteUnraisable("pygame_sdl2.rwobject.python_size", __pyx_clineno, __pyx_lineno, __pyx_filename, 0, 0); __pyx_r = 0; __pyx_L0:; __Pyx_XDECREF(__pyx_v_f); __Pyx_XDECREF(__pyx_v_cur); __Pyx_XDECREF(__pyx_v_rv); __Pyx_RefNannyFinishContext(); #ifdef WITH_THREAD PyGILState_Release(__pyx_gilstate_save); #endif return __pyx_r; } /* "pygame_sdl2/rwobject.pyx":75 * return rv * * cdef Sint64 python_seek(SDL_RWops *context, Sint64 seek, int whence) with gil: # <<<<<<<<<<<<<< * f = context.hidden.unknown.data1 * */ static Sint64 __pyx_f_11pygame_sdl2_8rwobject_python_seek(SDL_RWops *__pyx_v_context, Sint64 __pyx_v_seek, int __pyx_v_whence) { PyObject *__pyx_v_f = NULL; PyObject *__pyx_v_rv = NULL; PyObject *__pyx_v_e = NULL; Sint64 __pyx_r; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; PyObject *__pyx_t_5 = NULL; PyObject *__pyx_t_6 = NULL; PyObject *__pyx_t_7 = NULL; PyObject *__pyx_t_8 = NULL; Py_ssize_t __pyx_t_9; PyObject *__pyx_t_10 = NULL; int __pyx_t_11; Sint64 __pyx_t_12; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; #ifdef WITH_THREAD PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure(); #endif __Pyx_RefNannySetupContext("python_seek", 0); /* "pygame_sdl2/rwobject.pyx":76 * * cdef Sint64 python_seek(SDL_RWops *context, Sint64 seek, int whence) with gil: * f = context.hidden.unknown.data1 # <<<<<<<<<<<<<< * * try: */ __pyx_t_1 = ((PyObject *)__pyx_v_context->hidden.unknown.data1); __Pyx_INCREF(__pyx_t_1); __pyx_v_f = __pyx_t_1; __pyx_t_1 = 0; /* "pygame_sdl2/rwobject.pyx":78 * f = context.hidden.unknown.data1 * * try: # <<<<<<<<<<<<<< * f.seek(seek, whence) * rv = f.tell() */ { __Pyx_ExceptionSave(&__pyx_t_2, &__pyx_t_3, &__pyx_t_4); __Pyx_XGOTREF(__pyx_t_2); __Pyx_XGOTREF(__pyx_t_3); __Pyx_XGOTREF(__pyx_t_4); /*try:*/ { /* "pygame_sdl2/rwobject.pyx":79 * * try: * f.seek(seek, whence) # <<<<<<<<<<<<<< * rv = f.tell() * except Exception as e: */ __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_f, __pyx_n_s_seek); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 79; __pyx_clineno = __LINE__; goto __pyx_L3_error;} __Pyx_GOTREF(__pyx_t_5); __pyx_t_6 = __Pyx_PyInt_From_int64_t(__pyx_v_seek); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 79; __pyx_clineno = __LINE__; goto __pyx_L3_error;} __Pyx_GOTREF(__pyx_t_6); __pyx_t_7 = __Pyx_PyInt_From_int(__pyx_v_whence); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 79; __pyx_clineno = __LINE__; goto __pyx_L3_error;} __Pyx_GOTREF(__pyx_t_7); __pyx_t_8 = NULL; __pyx_t_9 = 0; if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_5))) { __pyx_t_8 = PyMethod_GET_SELF(__pyx_t_5); if (likely(__pyx_t_8)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5); __Pyx_INCREF(__pyx_t_8); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_5, function); __pyx_t_9 = 1; } } __pyx_t_10 = PyTuple_New(2+__pyx_t_9); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 79; __pyx_clineno = __LINE__; goto __pyx_L3_error;} __Pyx_GOTREF(__pyx_t_10); if (__pyx_t_8) { __Pyx_GIVEREF(__pyx_t_8); PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_t_8); __pyx_t_8 = NULL; } __Pyx_GIVEREF(__pyx_t_6); PyTuple_SET_ITEM(__pyx_t_10, 0+__pyx_t_9, __pyx_t_6); __Pyx_GIVEREF(__pyx_t_7); PyTuple_SET_ITEM(__pyx_t_10, 1+__pyx_t_9, __pyx_t_7); __pyx_t_6 = 0; __pyx_t_7 = 0; __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_10, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 79; __pyx_clineno = __LINE__; goto __pyx_L3_error;} __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "pygame_sdl2/rwobject.pyx":80 * try: * f.seek(seek, whence) * rv = f.tell() # <<<<<<<<<<<<<< * except Exception as e: * set_error(e) */ __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_f, __pyx_n_s_tell); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 80; __pyx_clineno = __LINE__; goto __pyx_L3_error;} __Pyx_GOTREF(__pyx_t_5); __pyx_t_10 = NULL; if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_5))) { __pyx_t_10 = PyMethod_GET_SELF(__pyx_t_5); if (likely(__pyx_t_10)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5); __Pyx_INCREF(__pyx_t_10); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_5, function); } } if (__pyx_t_10) { __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_t_10); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 80; __pyx_clineno = __LINE__; goto __pyx_L3_error;} __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; } else { __pyx_t_1 = __Pyx_PyObject_CallNoArg(__pyx_t_5); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 80; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __pyx_v_rv = __pyx_t_1; __pyx_t_1 = 0; /* "pygame_sdl2/rwobject.pyx":78 * f = context.hidden.unknown.data1 * * try: # <<<<<<<<<<<<<< * f.seek(seek, whence) * rv = f.tell() */ } __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; goto __pyx_L10_try_end; __pyx_L3_error:; __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0; __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0; __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; /* "pygame_sdl2/rwobject.pyx":81 * f.seek(seek, whence) * rv = f.tell() * except Exception as e: # <<<<<<<<<<<<<< * set_error(e) * return -1 */ __pyx_t_11 = PyErr_ExceptionMatches(__pyx_builtin_Exception); if (__pyx_t_11) { __Pyx_AddTraceback("pygame_sdl2.rwobject.python_seek", __pyx_clineno, __pyx_lineno, __pyx_filename); if (__Pyx_GetException(&__pyx_t_1, &__pyx_t_5, &__pyx_t_10) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 81; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} __Pyx_GOTREF(__pyx_t_1); __Pyx_GOTREF(__pyx_t_5); __Pyx_GOTREF(__pyx_t_10); __Pyx_INCREF(__pyx_t_5); __pyx_v_e = __pyx_t_5; /* "pygame_sdl2/rwobject.pyx":82 * rv = f.tell() * except Exception as e: * set_error(e) # <<<<<<<<<<<<<< * return -1 * */ __pyx_t_7 = __pyx_f_11pygame_sdl2_8rwobject_set_error(__pyx_v_e); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 82; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; /* "pygame_sdl2/rwobject.pyx":83 * except Exception as e: * set_error(e) * return -1 # <<<<<<<<<<<<<< * * return rv */ __pyx_r = -1L; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; goto __pyx_L6_except_return; } goto __pyx_L5_except_error; __pyx_L5_except_error:; /* "pygame_sdl2/rwobject.pyx":78 * f = context.hidden.unknown.data1 * * try: # <<<<<<<<<<<<<< * f.seek(seek, whence) * rv = f.tell() */ __Pyx_XGIVEREF(__pyx_t_2); __Pyx_XGIVEREF(__pyx_t_3); __Pyx_XGIVEREF(__pyx_t_4); __Pyx_ExceptionReset(__pyx_t_2, __pyx_t_3, __pyx_t_4); goto __pyx_L1_error; __pyx_L6_except_return:; __Pyx_XGIVEREF(__pyx_t_2); __Pyx_XGIVEREF(__pyx_t_3); __Pyx_XGIVEREF(__pyx_t_4); __Pyx_ExceptionReset(__pyx_t_2, __pyx_t_3, __pyx_t_4); goto __pyx_L0; __pyx_L10_try_end:; } /* "pygame_sdl2/rwobject.pyx":85 * return -1 * * return rv # <<<<<<<<<<<<<< * * cdef size_t python_read(SDL_RWops *context, void *ptr, size_t size, size_t maxnum) with gil: */ __pyx_t_12 = __Pyx_PyInt_As_int64_t(__pyx_v_rv); if (unlikely((__pyx_t_12 == (Sint64)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 85; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_r = __pyx_t_12; goto __pyx_L0; /* "pygame_sdl2/rwobject.pyx":75 * return rv * * cdef Sint64 python_seek(SDL_RWops *context, Sint64 seek, int whence) with gil: # <<<<<<<<<<<<<< * f = context.hidden.unknown.data1 * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_5); __Pyx_XDECREF(__pyx_t_6); __Pyx_XDECREF(__pyx_t_7); __Pyx_XDECREF(__pyx_t_8); __Pyx_XDECREF(__pyx_t_10); __Pyx_WriteUnraisable("pygame_sdl2.rwobject.python_seek", __pyx_clineno, __pyx_lineno, __pyx_filename, 0, 0); __pyx_r = 0; __pyx_L0:; __Pyx_XDECREF(__pyx_v_f); __Pyx_XDECREF(__pyx_v_rv); __Pyx_XDECREF(__pyx_v_e); __Pyx_RefNannyFinishContext(); #ifdef WITH_THREAD PyGILState_Release(__pyx_gilstate_save); #endif return __pyx_r; } /* "pygame_sdl2/rwobject.pyx":87 * return rv * * cdef size_t python_read(SDL_RWops *context, void *ptr, size_t size, size_t maxnum) with gil: # <<<<<<<<<<<<<< * f = context.hidden.unknown.data1 * */ static size_t __pyx_f_11pygame_sdl2_8rwobject_python_read(SDL_RWops *__pyx_v_context, void *__pyx_v_ptr, size_t __pyx_v_size, size_t __pyx_v_maxnum) { PyObject *__pyx_v_f = NULL; PyObject *__pyx_v_data = NULL; PyObject *__pyx_v_e = NULL; size_t __pyx_r; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; PyObject *__pyx_t_5 = NULL; PyObject *__pyx_t_6 = NULL; PyObject *__pyx_t_7 = NULL; PyObject *__pyx_t_8 = NULL; int __pyx_t_9; char *__pyx_t_10; Py_ssize_t __pyx_t_11; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; #ifdef WITH_THREAD PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure(); #endif __Pyx_RefNannySetupContext("python_read", 0); /* "pygame_sdl2/rwobject.pyx":88 * * cdef size_t python_read(SDL_RWops *context, void *ptr, size_t size, size_t maxnum) with gil: * f = context.hidden.unknown.data1 # <<<<<<<<<<<<<< * * try: */ __pyx_t_1 = ((PyObject *)__pyx_v_context->hidden.unknown.data1); __Pyx_INCREF(__pyx_t_1); __pyx_v_f = __pyx_t_1; __pyx_t_1 = 0; /* "pygame_sdl2/rwobject.pyx":90 * f = context.hidden.unknown.data1 * * try: # <<<<<<<<<<<<<< * data = f.read(size * maxnum) * except Exception as e: */ { __Pyx_ExceptionSave(&__pyx_t_2, &__pyx_t_3, &__pyx_t_4); __Pyx_XGOTREF(__pyx_t_2); __Pyx_XGOTREF(__pyx_t_3); __Pyx_XGOTREF(__pyx_t_4); /*try:*/ { /* "pygame_sdl2/rwobject.pyx":91 * * try: * data = f.read(size * maxnum) # <<<<<<<<<<<<<< * except Exception as e: * set_error(e) */ __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_f, __pyx_n_s_read); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 91; __pyx_clineno = __LINE__; goto __pyx_L3_error;} __Pyx_GOTREF(__pyx_t_5); __pyx_t_6 = __Pyx_PyInt_FromSize_t((__pyx_v_size * __pyx_v_maxnum)); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 91; __pyx_clineno = __LINE__; goto __pyx_L3_error;} __Pyx_GOTREF(__pyx_t_6); __pyx_t_7 = NULL; if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_5))) { __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_5); if (likely(__pyx_t_7)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5); __Pyx_INCREF(__pyx_t_7); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_5, function); } } if (!__pyx_t_7) { __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_t_6); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 91; __pyx_clineno = __LINE__; goto __pyx_L3_error;} __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_GOTREF(__pyx_t_1); } else { __pyx_t_8 = PyTuple_New(1+1); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 91; __pyx_clineno = __LINE__; goto __pyx_L3_error;} __Pyx_GOTREF(__pyx_t_8); __Pyx_GIVEREF(__pyx_t_7); PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_7); __pyx_t_7 = NULL; __Pyx_GIVEREF(__pyx_t_6); PyTuple_SET_ITEM(__pyx_t_8, 0+1, __pyx_t_6); __pyx_t_6 = 0; __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_8, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 91; __pyx_clineno = __LINE__; goto __pyx_L3_error;} __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; } __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __pyx_v_data = __pyx_t_1; __pyx_t_1 = 0; /* "pygame_sdl2/rwobject.pyx":90 * f = context.hidden.unknown.data1 * * try: # <<<<<<<<<<<<<< * data = f.read(size * maxnum) * except Exception as e: */ } __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; goto __pyx_L10_try_end; __pyx_L3_error:; __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0; __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; /* "pygame_sdl2/rwobject.pyx":92 * try: * data = f.read(size * maxnum) * except Exception as e: # <<<<<<<<<<<<<< * set_error(e) * return -1 */ __pyx_t_9 = PyErr_ExceptionMatches(__pyx_builtin_Exception); if (__pyx_t_9) { __Pyx_AddTraceback("pygame_sdl2.rwobject.python_read", __pyx_clineno, __pyx_lineno, __pyx_filename); if (__Pyx_GetException(&__pyx_t_1, &__pyx_t_5, &__pyx_t_8) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 92; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} __Pyx_GOTREF(__pyx_t_1); __Pyx_GOTREF(__pyx_t_5); __Pyx_GOTREF(__pyx_t_8); __Pyx_INCREF(__pyx_t_5); __pyx_v_e = __pyx_t_5; /* "pygame_sdl2/rwobject.pyx":93 * data = f.read(size * maxnum) * except Exception as e: * set_error(e) # <<<<<<<<<<<<<< * return -1 * */ __pyx_t_6 = __pyx_f_11pygame_sdl2_8rwobject_set_error(__pyx_v_e); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 93; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; /* "pygame_sdl2/rwobject.pyx":94 * except Exception as e: * set_error(e) * return -1 # <<<<<<<<<<<<<< * * memcpy(ptr, data, len(data)) */ __pyx_r = -1L; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; goto __pyx_L6_except_return; } goto __pyx_L5_except_error; __pyx_L5_except_error:; /* "pygame_sdl2/rwobject.pyx":90 * f = context.hidden.unknown.data1 * * try: # <<<<<<<<<<<<<< * data = f.read(size * maxnum) * except Exception as e: */ __Pyx_XGIVEREF(__pyx_t_2); __Pyx_XGIVEREF(__pyx_t_3); __Pyx_XGIVEREF(__pyx_t_4); __Pyx_ExceptionReset(__pyx_t_2, __pyx_t_3, __pyx_t_4); goto __pyx_L1_error; __pyx_L6_except_return:; __Pyx_XGIVEREF(__pyx_t_2); __Pyx_XGIVEREF(__pyx_t_3); __Pyx_XGIVEREF(__pyx_t_4); __Pyx_ExceptionReset(__pyx_t_2, __pyx_t_3, __pyx_t_4); goto __pyx_L0; __pyx_L10_try_end:; } /* "pygame_sdl2/rwobject.pyx":96 * return -1 * * memcpy(ptr, data, len(data)) # <<<<<<<<<<<<<< * return len(data) * */ __pyx_t_10 = __Pyx_PyObject_AsString(__pyx_v_data); if (unlikely((!__pyx_t_10) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 96; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_t_11 = PyObject_Length(__pyx_v_data); if (unlikely(__pyx_t_11 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 96; __pyx_clineno = __LINE__; goto __pyx_L1_error;} memcpy(__pyx_v_ptr, ((void *)((char *)__pyx_t_10)), __pyx_t_11); /* "pygame_sdl2/rwobject.pyx":97 * * memcpy(ptr, data, len(data)) * return len(data) # <<<<<<<<<<<<<< * * cdef size_t python_write(SDL_RWops *context, const void *ptr, size_t size, size_t maxnum) with gil: */ __pyx_t_11 = PyObject_Length(__pyx_v_data); if (unlikely(__pyx_t_11 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 97; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_r = __pyx_t_11; goto __pyx_L0; /* "pygame_sdl2/rwobject.pyx":87 * return rv * * cdef size_t python_read(SDL_RWops *context, void *ptr, size_t size, size_t maxnum) with gil: # <<<<<<<<<<<<<< * f = context.hidden.unknown.data1 * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_5); __Pyx_XDECREF(__pyx_t_6); __Pyx_XDECREF(__pyx_t_7); __Pyx_XDECREF(__pyx_t_8); __Pyx_WriteUnraisable("pygame_sdl2.rwobject.python_read", __pyx_clineno, __pyx_lineno, __pyx_filename, 0, 0); __pyx_r = 0; __pyx_L0:; __Pyx_XDECREF(__pyx_v_f); __Pyx_XDECREF(__pyx_v_data); __Pyx_XDECREF(__pyx_v_e); __Pyx_RefNannyFinishContext(); #ifdef WITH_THREAD PyGILState_Release(__pyx_gilstate_save); #endif return __pyx_r; } /* "pygame_sdl2/rwobject.pyx":99 * return len(data) * * cdef size_t python_write(SDL_RWops *context, const void *ptr, size_t size, size_t maxnum) with gil: # <<<<<<<<<<<<<< * f = context.hidden.unknown.data1 * data = ( ptr)[:size * maxnum] */ static size_t __pyx_f_11pygame_sdl2_8rwobject_python_write(SDL_RWops *__pyx_v_context, void const *__pyx_v_ptr, size_t __pyx_v_size, size_t __pyx_v_maxnum) { PyObject *__pyx_v_f = NULL; PyObject *__pyx_v_data = NULL; PyObject *__pyx_v_e = NULL; size_t __pyx_r; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; PyObject *__pyx_t_5 = NULL; PyObject *__pyx_t_6 = NULL; PyObject *__pyx_t_7 = NULL; int __pyx_t_8; Py_ssize_t __pyx_t_9; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; #ifdef WITH_THREAD PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure(); #endif __Pyx_RefNannySetupContext("python_write", 0); /* "pygame_sdl2/rwobject.pyx":100 * * cdef size_t python_write(SDL_RWops *context, const void *ptr, size_t size, size_t maxnum) with gil: * f = context.hidden.unknown.data1 # <<<<<<<<<<<<<< * data = ( ptr)[:size * maxnum] * */ __pyx_t_1 = ((PyObject *)__pyx_v_context->hidden.unknown.data1); __Pyx_INCREF(__pyx_t_1); __pyx_v_f = __pyx_t_1; __pyx_t_1 = 0; /* "pygame_sdl2/rwobject.pyx":101 * cdef size_t python_write(SDL_RWops *context, const void *ptr, size_t size, size_t maxnum) with gil: * f = context.hidden.unknown.data1 * data = ( ptr)[:size * maxnum] # <<<<<<<<<<<<<< * * try: */ __pyx_t_1 = __Pyx_PyBytes_FromStringAndSize(((char *)__pyx_v_ptr) + 0, (__pyx_v_size * __pyx_v_maxnum) - 0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 101; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_v_data = ((PyObject*)__pyx_t_1); __pyx_t_1 = 0; /* "pygame_sdl2/rwobject.pyx":103 * data = ( ptr)[:size * maxnum] * * try: # <<<<<<<<<<<<<< * f.write(data) * except Exception as e: */ { __Pyx_ExceptionSave(&__pyx_t_2, &__pyx_t_3, &__pyx_t_4); __Pyx_XGOTREF(__pyx_t_2); __Pyx_XGOTREF(__pyx_t_3); __Pyx_XGOTREF(__pyx_t_4); /*try:*/ { /* "pygame_sdl2/rwobject.pyx":104 * * try: * f.write(data) # <<<<<<<<<<<<<< * except Exception as e: * set_error(e) */ __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_f, __pyx_n_s_write); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 104; __pyx_clineno = __LINE__; goto __pyx_L3_error;} __Pyx_GOTREF(__pyx_t_5); __pyx_t_6 = NULL; if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_5))) { __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_5); if (likely(__pyx_t_6)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5); __Pyx_INCREF(__pyx_t_6); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_5, function); } } if (!__pyx_t_6) { __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_v_data); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 104; __pyx_clineno = __LINE__; goto __pyx_L3_error;} __Pyx_GOTREF(__pyx_t_1); } else { __pyx_t_7 = PyTuple_New(1+1); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 104; __pyx_clineno = __LINE__; goto __pyx_L3_error;} __Pyx_GOTREF(__pyx_t_7); __Pyx_GIVEREF(__pyx_t_6); PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_6); __pyx_t_6 = NULL; __Pyx_INCREF(__pyx_v_data); __Pyx_GIVEREF(__pyx_v_data); PyTuple_SET_ITEM(__pyx_t_7, 0+1, __pyx_v_data); __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_7, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 104; __pyx_clineno = __LINE__; goto __pyx_L3_error;} __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; } __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "pygame_sdl2/rwobject.pyx":103 * data = ( ptr)[:size * maxnum] * * try: # <<<<<<<<<<<<<< * f.write(data) * except Exception as e: */ } __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; goto __pyx_L10_try_end; __pyx_L3_error:; __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; /* "pygame_sdl2/rwobject.pyx":105 * try: * f.write(data) * except Exception as e: # <<<<<<<<<<<<<< * set_error(e) * return -1 */ __pyx_t_8 = PyErr_ExceptionMatches(__pyx_builtin_Exception); if (__pyx_t_8) { __Pyx_AddTraceback("pygame_sdl2.rwobject.python_write", __pyx_clineno, __pyx_lineno, __pyx_filename); if (__Pyx_GetException(&__pyx_t_1, &__pyx_t_5, &__pyx_t_7) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 105; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} __Pyx_GOTREF(__pyx_t_1); __Pyx_GOTREF(__pyx_t_5); __Pyx_GOTREF(__pyx_t_7); __Pyx_INCREF(__pyx_t_5); __pyx_v_e = __pyx_t_5; /* "pygame_sdl2/rwobject.pyx":106 * f.write(data) * except Exception as e: * set_error(e) # <<<<<<<<<<<<<< * return -1 * */ __pyx_t_6 = __pyx_f_11pygame_sdl2_8rwobject_set_error(__pyx_v_e); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 106; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; /* "pygame_sdl2/rwobject.pyx":107 * except Exception as e: * set_error(e) * return -1 # <<<<<<<<<<<<<< * * return len(data) */ __pyx_r = -1L; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; goto __pyx_L6_except_return; } goto __pyx_L5_except_error; __pyx_L5_except_error:; /* "pygame_sdl2/rwobject.pyx":103 * data = ( ptr)[:size * maxnum] * * try: # <<<<<<<<<<<<<< * f.write(data) * except Exception as e: */ __Pyx_XGIVEREF(__pyx_t_2); __Pyx_XGIVEREF(__pyx_t_3); __Pyx_XGIVEREF(__pyx_t_4); __Pyx_ExceptionReset(__pyx_t_2, __pyx_t_3, __pyx_t_4); goto __pyx_L1_error; __pyx_L6_except_return:; __Pyx_XGIVEREF(__pyx_t_2); __Pyx_XGIVEREF(__pyx_t_3); __Pyx_XGIVEREF(__pyx_t_4); __Pyx_ExceptionReset(__pyx_t_2, __pyx_t_3, __pyx_t_4); goto __pyx_L0; __pyx_L10_try_end:; } /* "pygame_sdl2/rwobject.pyx":109 * return -1 * * return len(data) # <<<<<<<<<<<<<< * * cdef int python_close(SDL_RWops *context) with gil: */ __pyx_t_9 = PyBytes_GET_SIZE(__pyx_v_data); if (unlikely(__pyx_t_9 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 109; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_r = __pyx_t_9; goto __pyx_L0; /* "pygame_sdl2/rwobject.pyx":99 * return len(data) * * cdef size_t python_write(SDL_RWops *context, const void *ptr, size_t size, size_t maxnum) with gil: # <<<<<<<<<<<<<< * f = context.hidden.unknown.data1 * data = ( ptr)[:size * maxnum] */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_5); __Pyx_XDECREF(__pyx_t_6); __Pyx_XDECREF(__pyx_t_7); __Pyx_WriteUnraisable("pygame_sdl2.rwobject.python_write", __pyx_clineno, __pyx_lineno, __pyx_filename, 0, 0); __pyx_r = 0; __pyx_L0:; __Pyx_XDECREF(__pyx_v_f); __Pyx_XDECREF(__pyx_v_data); __Pyx_XDECREF(__pyx_v_e); __Pyx_RefNannyFinishContext(); #ifdef WITH_THREAD PyGILState_Release(__pyx_gilstate_save); #endif return __pyx_r; } /* "pygame_sdl2/rwobject.pyx":111 * return len(data) * * cdef int python_close(SDL_RWops *context) with gil: # <<<<<<<<<<<<<< * f = context.hidden.unknown.data1 * */ static int __pyx_f_11pygame_sdl2_8rwobject_python_close(SDL_RWops *__pyx_v_context) { PyObject *__pyx_v_f = NULL; PyObject *__pyx_v_e = NULL; int __pyx_r; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; PyObject *__pyx_t_5 = NULL; PyObject *__pyx_t_6 = NULL; int __pyx_t_7; PyObject *__pyx_t_8 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; #ifdef WITH_THREAD PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure(); #endif __Pyx_RefNannySetupContext("python_close", 0); /* "pygame_sdl2/rwobject.pyx":112 * * cdef int python_close(SDL_RWops *context) with gil: * f = context.hidden.unknown.data1 # <<<<<<<<<<<<<< * * try: */ __pyx_t_1 = ((PyObject *)__pyx_v_context->hidden.unknown.data1); __Pyx_INCREF(__pyx_t_1); __pyx_v_f = __pyx_t_1; __pyx_t_1 = 0; /* "pygame_sdl2/rwobject.pyx":114 * f = context.hidden.unknown.data1 * * try: # <<<<<<<<<<<<<< * f.close() * except Exception as e: */ { __Pyx_ExceptionSave(&__pyx_t_2, &__pyx_t_3, &__pyx_t_4); __Pyx_XGOTREF(__pyx_t_2); __Pyx_XGOTREF(__pyx_t_3); __Pyx_XGOTREF(__pyx_t_4); /*try:*/ { /* "pygame_sdl2/rwobject.pyx":115 * * try: * f.close() # <<<<<<<<<<<<<< * except Exception as e: * set_error(e) */ __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_f, __pyx_n_s_close); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 115; __pyx_clineno = __LINE__; goto __pyx_L3_error;} __Pyx_GOTREF(__pyx_t_5); __pyx_t_6 = NULL; if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_5))) { __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_5); if (likely(__pyx_t_6)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5); __Pyx_INCREF(__pyx_t_6); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_5, function); } } if (__pyx_t_6) { __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_t_6); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 115; __pyx_clineno = __LINE__; goto __pyx_L3_error;} __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; } else { __pyx_t_1 = __Pyx_PyObject_CallNoArg(__pyx_t_5); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 115; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "pygame_sdl2/rwobject.pyx":114 * f = context.hidden.unknown.data1 * * try: # <<<<<<<<<<<<<< * f.close() * except Exception as e: */ } __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; goto __pyx_L10_try_end; __pyx_L3_error:; __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; /* "pygame_sdl2/rwobject.pyx":116 * try: * f.close() * except Exception as e: # <<<<<<<<<<<<<< * set_error(e) * return -1 */ __pyx_t_7 = PyErr_ExceptionMatches(__pyx_builtin_Exception); if (__pyx_t_7) { __Pyx_AddTraceback("pygame_sdl2.rwobject.python_close", __pyx_clineno, __pyx_lineno, __pyx_filename); if (__Pyx_GetException(&__pyx_t_1, &__pyx_t_5, &__pyx_t_6) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 116; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} __Pyx_GOTREF(__pyx_t_1); __Pyx_GOTREF(__pyx_t_5); __Pyx_GOTREF(__pyx_t_6); __Pyx_INCREF(__pyx_t_5); __pyx_v_e = __pyx_t_5; /* "pygame_sdl2/rwobject.pyx":117 * f.close() * except Exception as e: * set_error(e) # <<<<<<<<<<<<<< * return -1 * */ __pyx_t_8 = __pyx_f_11pygame_sdl2_8rwobject_set_error(__pyx_v_e); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 117; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} __Pyx_GOTREF(__pyx_t_8); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; /* "pygame_sdl2/rwobject.pyx":118 * except Exception as e: * set_error(e) * return -1 # <<<<<<<<<<<<<< * * Py_DECREF(f) */ __pyx_r = -1; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; goto __pyx_L6_except_return; } goto __pyx_L5_except_error; __pyx_L5_except_error:; /* "pygame_sdl2/rwobject.pyx":114 * f = context.hidden.unknown.data1 * * try: # <<<<<<<<<<<<<< * f.close() * except Exception as e: */ __Pyx_XGIVEREF(__pyx_t_2); __Pyx_XGIVEREF(__pyx_t_3); __Pyx_XGIVEREF(__pyx_t_4); __Pyx_ExceptionReset(__pyx_t_2, __pyx_t_3, __pyx_t_4); goto __pyx_L1_error; __pyx_L6_except_return:; __Pyx_XGIVEREF(__pyx_t_2); __Pyx_XGIVEREF(__pyx_t_3); __Pyx_XGIVEREF(__pyx_t_4); __Pyx_ExceptionReset(__pyx_t_2, __pyx_t_3, __pyx_t_4); goto __pyx_L0; __pyx_L10_try_end:; } /* "pygame_sdl2/rwobject.pyx":120 * return -1 * * Py_DECREF(f) # <<<<<<<<<<<<<< * SDL_FreeRW(context) * return 0 */ Py_DECREF(__pyx_v_f); /* "pygame_sdl2/rwobject.pyx":121 * * Py_DECREF(f) * SDL_FreeRW(context) # <<<<<<<<<<<<<< * return 0 * */ SDL_FreeRW(__pyx_v_context); /* "pygame_sdl2/rwobject.pyx":122 * Py_DECREF(f) * SDL_FreeRW(context) * return 0 # <<<<<<<<<<<<<< * * cdef struct SubFile: */ __pyx_r = 0; goto __pyx_L0; /* "pygame_sdl2/rwobject.pyx":111 * return len(data) * * cdef int python_close(SDL_RWops *context) with gil: # <<<<<<<<<<<<<< * f = context.hidden.unknown.data1 * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_5); __Pyx_XDECREF(__pyx_t_6); __Pyx_XDECREF(__pyx_t_8); __Pyx_WriteUnraisable("pygame_sdl2.rwobject.python_close", __pyx_clineno, __pyx_lineno, __pyx_filename, 0, 0); __pyx_r = 0; __pyx_L0:; __Pyx_XDECREF(__pyx_v_f); __Pyx_XDECREF(__pyx_v_e); __Pyx_RefNannyFinishContext(); #ifdef WITH_THREAD PyGILState_Release(__pyx_gilstate_save); #endif return __pyx_r; } /* "pygame_sdl2/rwobject.pyx":130 * Sint64 tell * * cdef Sint64 subfile_size(SDL_RWops *context) nogil: # <<<<<<<<<<<<<< * cdef SubFile *sf = context.hidden.unknown.data1 * return sf.length */ static Sint64 __pyx_f_11pygame_sdl2_8rwobject_subfile_size(SDL_RWops *__pyx_v_context) { struct __pyx_t_11pygame_sdl2_8rwobject_SubFile *__pyx_v_sf; Sint64 __pyx_r; /* "pygame_sdl2/rwobject.pyx":131 * * cdef Sint64 subfile_size(SDL_RWops *context) nogil: * cdef SubFile *sf = context.hidden.unknown.data1 # <<<<<<<<<<<<<< * return sf.length * */ __pyx_v_sf = ((struct __pyx_t_11pygame_sdl2_8rwobject_SubFile *)__pyx_v_context->hidden.unknown.data1); /* "pygame_sdl2/rwobject.pyx":132 * cdef Sint64 subfile_size(SDL_RWops *context) nogil: * cdef SubFile *sf = context.hidden.unknown.data1 * return sf.length # <<<<<<<<<<<<<< * * cdef Sint64 subfile_seek(SDL_RWops *context, Sint64 seek, int whence) nogil: */ __pyx_r = __pyx_v_sf->length; goto __pyx_L0; /* "pygame_sdl2/rwobject.pyx":130 * Sint64 tell * * cdef Sint64 subfile_size(SDL_RWops *context) nogil: # <<<<<<<<<<<<<< * cdef SubFile *sf = context.hidden.unknown.data1 * return sf.length */ /* function exit code */ __pyx_L0:; return __pyx_r; } /* "pygame_sdl2/rwobject.pyx":134 * return sf.length * * cdef Sint64 subfile_seek(SDL_RWops *context, Sint64 seek, int whence) nogil: # <<<<<<<<<<<<<< * cdef SubFile *sf = context.hidden.unknown.data1 * */ static Sint64 __pyx_f_11pygame_sdl2_8rwobject_subfile_seek(SDL_RWops *__pyx_v_context, Sint64 __pyx_v_seek, int __pyx_v_whence) { struct __pyx_t_11pygame_sdl2_8rwobject_SubFile *__pyx_v_sf; Sint64 __pyx_r; /* "pygame_sdl2/rwobject.pyx":135 * * cdef Sint64 subfile_seek(SDL_RWops *context, Sint64 seek, int whence) nogil: * cdef SubFile *sf = context.hidden.unknown.data1 # <<<<<<<<<<<<<< * * if whence == RW_SEEK_SET: */ __pyx_v_sf = ((struct __pyx_t_11pygame_sdl2_8rwobject_SubFile *)__pyx_v_context->hidden.unknown.data1); /* "pygame_sdl2/rwobject.pyx":137 * cdef SubFile *sf = context.hidden.unknown.data1 * * if whence == RW_SEEK_SET: # <<<<<<<<<<<<<< * sf.tell = SDL_RWseek(sf.rw, seek + sf.base, RW_SEEK_SET) - sf.base * elif whence == RW_SEEK_CUR: */ switch (__pyx_v_whence) { case RW_SEEK_SET: /* "pygame_sdl2/rwobject.pyx":138 * * if whence == RW_SEEK_SET: * sf.tell = SDL_RWseek(sf.rw, seek + sf.base, RW_SEEK_SET) - sf.base # <<<<<<<<<<<<<< * elif whence == RW_SEEK_CUR: * sf.tell = SDL_RWseek(sf.rw, seek, RW_SEEK_CUR) - sf.base */ __pyx_v_sf->tell = (SDL_RWseek(__pyx_v_sf->rw, (__pyx_v_seek + __pyx_v_sf->base), RW_SEEK_SET) - __pyx_v_sf->base); /* "pygame_sdl2/rwobject.pyx":137 * cdef SubFile *sf = context.hidden.unknown.data1 * * if whence == RW_SEEK_SET: # <<<<<<<<<<<<<< * sf.tell = SDL_RWseek(sf.rw, seek + sf.base, RW_SEEK_SET) - sf.base * elif whence == RW_SEEK_CUR: */ break; /* "pygame_sdl2/rwobject.pyx":139 * if whence == RW_SEEK_SET: * sf.tell = SDL_RWseek(sf.rw, seek + sf.base, RW_SEEK_SET) - sf.base * elif whence == RW_SEEK_CUR: # <<<<<<<<<<<<<< * sf.tell = SDL_RWseek(sf.rw, seek, RW_SEEK_CUR) - sf.base * elif whence == RW_SEEK_END: */ case RW_SEEK_CUR: /* "pygame_sdl2/rwobject.pyx":140 * sf.tell = SDL_RWseek(sf.rw, seek + sf.base, RW_SEEK_SET) - sf.base * elif whence == RW_SEEK_CUR: * sf.tell = SDL_RWseek(sf.rw, seek, RW_SEEK_CUR) - sf.base # <<<<<<<<<<<<<< * elif whence == RW_SEEK_END: * sf.tell = SDL_RWseek(sf.rw, sf.base + sf.length + seek, RW_SEEK_SET) - sf.base */ __pyx_v_sf->tell = (SDL_RWseek(__pyx_v_sf->rw, __pyx_v_seek, RW_SEEK_CUR) - __pyx_v_sf->base); /* "pygame_sdl2/rwobject.pyx":139 * if whence == RW_SEEK_SET: * sf.tell = SDL_RWseek(sf.rw, seek + sf.base, RW_SEEK_SET) - sf.base * elif whence == RW_SEEK_CUR: # <<<<<<<<<<<<<< * sf.tell = SDL_RWseek(sf.rw, seek, RW_SEEK_CUR) - sf.base * elif whence == RW_SEEK_END: */ break; /* "pygame_sdl2/rwobject.pyx":141 * elif whence == RW_SEEK_CUR: * sf.tell = SDL_RWseek(sf.rw, seek, RW_SEEK_CUR) - sf.base * elif whence == RW_SEEK_END: # <<<<<<<<<<<<<< * sf.tell = SDL_RWseek(sf.rw, sf.base + sf.length + seek, RW_SEEK_SET) - sf.base * */ case RW_SEEK_END: /* "pygame_sdl2/rwobject.pyx":142 * sf.tell = SDL_RWseek(sf.rw, seek, RW_SEEK_CUR) - sf.base * elif whence == RW_SEEK_END: * sf.tell = SDL_RWseek(sf.rw, sf.base + sf.length + seek, RW_SEEK_SET) - sf.base # <<<<<<<<<<<<<< * * return sf.tell */ __pyx_v_sf->tell = (SDL_RWseek(__pyx_v_sf->rw, ((__pyx_v_sf->base + __pyx_v_sf->length) + __pyx_v_seek), RW_SEEK_SET) - __pyx_v_sf->base); /* "pygame_sdl2/rwobject.pyx":141 * elif whence == RW_SEEK_CUR: * sf.tell = SDL_RWseek(sf.rw, seek, RW_SEEK_CUR) - sf.base * elif whence == RW_SEEK_END: # <<<<<<<<<<<<<< * sf.tell = SDL_RWseek(sf.rw, sf.base + sf.length + seek, RW_SEEK_SET) - sf.base * */ break; default: break; } /* "pygame_sdl2/rwobject.pyx":144 * sf.tell = SDL_RWseek(sf.rw, sf.base + sf.length + seek, RW_SEEK_SET) - sf.base * * return sf.tell # <<<<<<<<<<<<<< * * cdef size_t subfile_read(SDL_RWops *context, void *ptr, size_t size, size_t maxnum) nogil: */ __pyx_r = __pyx_v_sf->tell; goto __pyx_L0; /* "pygame_sdl2/rwobject.pyx":134 * return sf.length * * cdef Sint64 subfile_seek(SDL_RWops *context, Sint64 seek, int whence) nogil: # <<<<<<<<<<<<<< * cdef SubFile *sf = context.hidden.unknown.data1 * */ /* function exit code */ __pyx_L0:; return __pyx_r; } /* "pygame_sdl2/rwobject.pyx":146 * return sf.tell * * cdef size_t subfile_read(SDL_RWops *context, void *ptr, size_t size, size_t maxnum) nogil: # <<<<<<<<<<<<<< * cdef SubFile *sf = context.hidden.unknown.data1 * */ static size_t __pyx_f_11pygame_sdl2_8rwobject_subfile_read(SDL_RWops *__pyx_v_context, void *__pyx_v_ptr, size_t __pyx_v_size, size_t __pyx_v_maxnum) { struct __pyx_t_11pygame_sdl2_8rwobject_SubFile *__pyx_v_sf; Sint64 __pyx_v_left; size_t __pyx_v_rv; size_t __pyx_r; int __pyx_t_1; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; /* "pygame_sdl2/rwobject.pyx":147 * * cdef size_t subfile_read(SDL_RWops *context, void *ptr, size_t size, size_t maxnum) nogil: * cdef SubFile *sf = context.hidden.unknown.data1 # <<<<<<<<<<<<<< * * cdef Sint64 left = sf.length - sf.tell */ __pyx_v_sf = ((struct __pyx_t_11pygame_sdl2_8rwobject_SubFile *)__pyx_v_context->hidden.unknown.data1); /* "pygame_sdl2/rwobject.pyx":149 * cdef SubFile *sf = context.hidden.unknown.data1 * * cdef Sint64 left = sf.length - sf.tell # <<<<<<<<<<<<<< * cdef size_t rv; * */ __pyx_v_left = (__pyx_v_sf->length - __pyx_v_sf->tell); /* "pygame_sdl2/rwobject.pyx":152 * cdef size_t rv; * * if size * maxnum > left: # <<<<<<<<<<<<<< * maxnum = left // size * */ __pyx_t_1 = (((__pyx_v_size * __pyx_v_maxnum) > __pyx_v_left) != 0); if (__pyx_t_1) { /* "pygame_sdl2/rwobject.pyx":153 * * if size * maxnum > left: * maxnum = left // size # <<<<<<<<<<<<<< * * if maxnum == 0: */ if (unlikely(__pyx_v_size == 0)) { #ifdef WITH_THREAD PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure(); #endif PyErr_SetString(PyExc_ZeroDivisionError, "integer division or modulo by zero"); #ifdef WITH_THREAD PyGILState_Release(__pyx_gilstate_save); #endif {__pyx_filename = __pyx_f[0]; __pyx_lineno = 153; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } __pyx_v_maxnum = (__pyx_v_left / __pyx_v_size); /* "pygame_sdl2/rwobject.pyx":152 * cdef size_t rv; * * if size * maxnum > left: # <<<<<<<<<<<<<< * maxnum = left // size * */ } /* "pygame_sdl2/rwobject.pyx":155 * maxnum = left // size * * if maxnum == 0: # <<<<<<<<<<<<<< * return 0 * */ __pyx_t_1 = ((__pyx_v_maxnum == 0) != 0); if (__pyx_t_1) { /* "pygame_sdl2/rwobject.pyx":156 * * if maxnum == 0: * return 0 # <<<<<<<<<<<<<< * * rv = SDL_RWread(sf.rw, ptr, size, maxnum) */ __pyx_r = 0; goto __pyx_L0; /* "pygame_sdl2/rwobject.pyx":155 * maxnum = left // size * * if maxnum == 0: # <<<<<<<<<<<<<< * return 0 * */ } /* "pygame_sdl2/rwobject.pyx":158 * return 0 * * rv = SDL_RWread(sf.rw, ptr, size, maxnum) # <<<<<<<<<<<<<< * * if rv > 0: */ __pyx_v_rv = SDL_RWread(__pyx_v_sf->rw, __pyx_v_ptr, __pyx_v_size, __pyx_v_maxnum); /* "pygame_sdl2/rwobject.pyx":160 * rv = SDL_RWread(sf.rw, ptr, size, maxnum) * * if rv > 0: # <<<<<<<<<<<<<< * sf.tell += size * rv * */ __pyx_t_1 = ((__pyx_v_rv > 0) != 0); if (__pyx_t_1) { /* "pygame_sdl2/rwobject.pyx":161 * * if rv > 0: * sf.tell += size * rv # <<<<<<<<<<<<<< * * return rv */ __pyx_v_sf->tell = (__pyx_v_sf->tell + (__pyx_v_size * __pyx_v_rv)); /* "pygame_sdl2/rwobject.pyx":160 * rv = SDL_RWread(sf.rw, ptr, size, maxnum) * * if rv > 0: # <<<<<<<<<<<<<< * sf.tell += size * rv * */ } /* "pygame_sdl2/rwobject.pyx":163 * sf.tell += size * rv * * return rv # <<<<<<<<<<<<<< * * cdef int subfile_close(SDL_RWops *context) nogil: */ __pyx_r = __pyx_v_rv; goto __pyx_L0; /* "pygame_sdl2/rwobject.pyx":146 * return sf.tell * * cdef size_t subfile_read(SDL_RWops *context, void *ptr, size_t size, size_t maxnum) nogil: # <<<<<<<<<<<<<< * cdef SubFile *sf = context.hidden.unknown.data1 * */ /* function exit code */ __pyx_L1_error:; __Pyx_WriteUnraisable("pygame_sdl2.rwobject.subfile_read", __pyx_clineno, __pyx_lineno, __pyx_filename, 0, 1); __pyx_r = 0; __pyx_L0:; return __pyx_r; } /* "pygame_sdl2/rwobject.pyx":165 * return rv * * cdef int subfile_close(SDL_RWops *context) nogil: # <<<<<<<<<<<<<< * cdef SubFile *sf = context.hidden.unknown.data1 * */ static int __pyx_f_11pygame_sdl2_8rwobject_subfile_close(SDL_RWops *__pyx_v_context) { struct __pyx_t_11pygame_sdl2_8rwobject_SubFile *__pyx_v_sf; int __pyx_r; /* "pygame_sdl2/rwobject.pyx":166 * * cdef int subfile_close(SDL_RWops *context) nogil: * cdef SubFile *sf = context.hidden.unknown.data1 # <<<<<<<<<<<<<< * * SDL_RWclose(sf.rw) */ __pyx_v_sf = ((struct __pyx_t_11pygame_sdl2_8rwobject_SubFile *)__pyx_v_context->hidden.unknown.data1); /* "pygame_sdl2/rwobject.pyx":168 * cdef SubFile *sf = context.hidden.unknown.data1 * * SDL_RWclose(sf.rw) # <<<<<<<<<<<<<< * free(sf) * SDL_FreeRW(context) */ SDL_RWclose(__pyx_v_sf->rw); /* "pygame_sdl2/rwobject.pyx":169 * * SDL_RWclose(sf.rw) * free(sf) # <<<<<<<<<<<<<< * SDL_FreeRW(context) * */ free(__pyx_v_sf); /* "pygame_sdl2/rwobject.pyx":170 * SDL_RWclose(sf.rw) * free(sf) * SDL_FreeRW(context) # <<<<<<<<<<<<<< * * */ SDL_FreeRW(__pyx_v_context); /* "pygame_sdl2/rwobject.pyx":165 * return rv * * cdef int subfile_close(SDL_RWops *context) nogil: # <<<<<<<<<<<<<< * cdef SubFile *sf = context.hidden.unknown.data1 * */ /* function exit code */ __pyx_r = 0; return __pyx_r; } /* "pygame_sdl2/rwobject.pyx":173 * * * cdef SDL_RWops *to_rwops(filelike, mode="rb") except NULL: # <<<<<<<<<<<<<< * * cdef FILE *f */ static SDL_RWops *__pyx_f_11pygame_sdl2_8rwobject_to_rwops(PyObject *__pyx_v_filelike, struct __pyx_opt_args_11pygame_sdl2_8rwobject_to_rwops *__pyx_optional_args) { PyObject *__pyx_v_mode = ((PyObject *)__pyx_n_s_rb); struct __pyx_t_11pygame_sdl2_8rwobject_SubFile *__pyx_v_sf; SDL_RWops *__pyx_v_rv; SDL_RWops *__pyx_v_rw; char *__pyx_v_cname; char *__pyx_v_cmode; PyObject *__pyx_v_name = NULL; PyObject *__pyx_v_dname = NULL; PyObject *__pyx_v_base = NULL; PyObject *__pyx_v_length = NULL; SDL_RWops *__pyx_r; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_t_2; int __pyx_t_3; PyObject *__pyx_t_4 = NULL; int __pyx_t_5; PyObject *__pyx_t_6 = NULL; PyObject *__pyx_t_7 = NULL; PyObject *__pyx_t_8 = NULL; char *__pyx_t_9; Py_ssize_t __pyx_t_10; PyObject *__pyx_t_11 = NULL; PyObject *__pyx_t_12 = NULL; PyObject *__pyx_t_13 = NULL; Sint64 __pyx_t_14; int __pyx_t_15; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("to_rwops", 0); if (__pyx_optional_args) { if (__pyx_optional_args->__pyx_n > 0) { __pyx_v_mode = __pyx_optional_args->mode; } } __Pyx_INCREF(__pyx_v_filelike); __Pyx_INCREF(__pyx_v_mode); /* "pygame_sdl2/rwobject.pyx":182 * cdef char *cmode * * if not isinstance(mode, bytes_): # <<<<<<<<<<<<<< * mode = mode.encode("ascii") * */ __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_bytes); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 182; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = PyObject_IsInstance(__pyx_v_mode, __pyx_t_1); if (unlikely(__pyx_t_2 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 182; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_3 = ((!(__pyx_t_2 != 0)) != 0); if (__pyx_t_3) { /* "pygame_sdl2/rwobject.pyx":183 * * if not isinstance(mode, bytes_): * mode = mode.encode("ascii") # <<<<<<<<<<<<<< * * if isinstance(filelike, file_type) and mode == b"rb": */ __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_mode, __pyx_n_s_encode); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 183; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_tuple__2, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 183; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF_SET(__pyx_v_mode, __pyx_t_4); __pyx_t_4 = 0; /* "pygame_sdl2/rwobject.pyx":182 * cdef char *cmode * * if not isinstance(mode, bytes_): # <<<<<<<<<<<<<< * mode = mode.encode("ascii") * */ } /* "pygame_sdl2/rwobject.pyx":185 * mode = mode.encode("ascii") * * if isinstance(filelike, file_type) and mode == b"rb": # <<<<<<<<<<<<<< * filelike = filelike.name * */ __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_file_type); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 185; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); __pyx_t_2 = PyObject_IsInstance(__pyx_v_filelike, __pyx_t_4); if (unlikely(__pyx_t_2 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 185; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_t_5 = (__pyx_t_2 != 0); if (__pyx_t_5) { } else { __pyx_t_3 = __pyx_t_5; goto __pyx_L5_bool_binop_done; } __pyx_t_5 = (__Pyx_PyBytes_Equals(__pyx_v_mode, __pyx_n_b_rb, Py_EQ)); if (unlikely(__pyx_t_5 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 185; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_t_3 = __pyx_t_5; __pyx_L5_bool_binop_done:; if (__pyx_t_3) { /* "pygame_sdl2/rwobject.pyx":186 * * if isinstance(filelike, file_type) and mode == b"rb": * filelike = filelike.name # <<<<<<<<<<<<<< * * # Try to open as a file. */ __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_filelike, __pyx_n_s_name); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 186; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF_SET(__pyx_v_filelike, __pyx_t_4); __pyx_t_4 = 0; /* "pygame_sdl2/rwobject.pyx":185 * mode = mode.encode("ascii") * * if isinstance(filelike, file_type) and mode == b"rb": # <<<<<<<<<<<<<< * filelike = filelike.name * */ } /* "pygame_sdl2/rwobject.pyx":189 * * # Try to open as a file. * if isinstance(filelike, bytes_): # <<<<<<<<<<<<<< * name = filelike.decode(fsencoding) * elif isinstance(filelike, unicode_): */ __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_bytes); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 189; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); __pyx_t_3 = PyObject_IsInstance(__pyx_v_filelike, __pyx_t_4); if (unlikely(__pyx_t_3 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 189; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_t_5 = (__pyx_t_3 != 0); if (__pyx_t_5) { /* "pygame_sdl2/rwobject.pyx":190 * # Try to open as a file. * if isinstance(filelike, bytes_): * name = filelike.decode(fsencoding) # <<<<<<<<<<<<<< * elif isinstance(filelike, unicode_): * name = filelike */ __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_filelike, __pyx_n_s_decode); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 190; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_t_6 = __Pyx_GetModuleGlobalName(__pyx_n_s_fsencoding); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 190; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_6); __pyx_t_7 = NULL; if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_1))) { __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_1); if (likely(__pyx_t_7)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1); __Pyx_INCREF(__pyx_t_7); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_1, function); } } if (!__pyx_t_7) { __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_t_1, __pyx_t_6); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 190; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_GOTREF(__pyx_t_4); } else { __pyx_t_8 = PyTuple_New(1+1); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 190; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_8); __Pyx_GIVEREF(__pyx_t_7); PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_7); __pyx_t_7 = NULL; __Pyx_GIVEREF(__pyx_t_6); PyTuple_SET_ITEM(__pyx_t_8, 0+1, __pyx_t_6); __pyx_t_6 = 0; __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_8, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 190; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_v_name = __pyx_t_4; __pyx_t_4 = 0; /* "pygame_sdl2/rwobject.pyx":189 * * # Try to open as a file. * if isinstance(filelike, bytes_): # <<<<<<<<<<<<<< * name = filelike.decode(fsencoding) * elif isinstance(filelike, unicode_): */ goto __pyx_L7; } /* "pygame_sdl2/rwobject.pyx":191 * if isinstance(filelike, bytes_): * name = filelike.decode(fsencoding) * elif isinstance(filelike, unicode_): # <<<<<<<<<<<<<< * name = filelike * else: */ __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_unicode); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 191; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); __pyx_t_5 = PyObject_IsInstance(__pyx_v_filelike, __pyx_t_4); if (unlikely(__pyx_t_5 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 191; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_t_3 = (__pyx_t_5 != 0); if (__pyx_t_3) { /* "pygame_sdl2/rwobject.pyx":192 * name = filelike.decode(fsencoding) * elif isinstance(filelike, unicode_): * name = filelike # <<<<<<<<<<<<<< * else: * name = None */ __Pyx_INCREF(__pyx_v_filelike); __pyx_v_name = __pyx_v_filelike; /* "pygame_sdl2/rwobject.pyx":191 * if isinstance(filelike, bytes_): * name = filelike.decode(fsencoding) * elif isinstance(filelike, unicode_): # <<<<<<<<<<<<<< * name = filelike * else: */ goto __pyx_L7; } /* "pygame_sdl2/rwobject.pyx":194 * name = filelike * else: * name = None # <<<<<<<<<<<<<< * * if name: */ /*else*/ { __Pyx_INCREF(Py_None); __pyx_v_name = Py_None; } __pyx_L7:; /* "pygame_sdl2/rwobject.pyx":196 * name = None * * if name: # <<<<<<<<<<<<<< * * dname = name.encode("utf-8") */ __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_v_name); if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 196; __pyx_clineno = __LINE__; goto __pyx_L1_error;} if (__pyx_t_3) { /* "pygame_sdl2/rwobject.pyx":198 * if name: * * dname = name.encode("utf-8") # <<<<<<<<<<<<<< * cname = dname * cmode = mode */ __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_name, __pyx_n_s_encode); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 198; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_tuple__3, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 198; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_v_dname = __pyx_t_1; __pyx_t_1 = 0; /* "pygame_sdl2/rwobject.pyx":199 * * dname = name.encode("utf-8") * cname = dname # <<<<<<<<<<<<<< * cmode = mode * */ __pyx_t_9 = __Pyx_PyObject_AsString(__pyx_v_dname); if (unlikely((!__pyx_t_9) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 199; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_v_cname = __pyx_t_9; /* "pygame_sdl2/rwobject.pyx":200 * dname = name.encode("utf-8") * cname = dname * cmode = mode # <<<<<<<<<<<<<< * * with nogil: */ __pyx_t_9 = __Pyx_PyObject_AsString(__pyx_v_mode); if (unlikely((!__pyx_t_9) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 200; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_v_cmode = __pyx_t_9; /* "pygame_sdl2/rwobject.pyx":202 * cmode = mode * * with nogil: # <<<<<<<<<<<<<< * rv = SDL_RWFromFile(cname, cmode) * */ { #ifdef WITH_THREAD PyThreadState *_save; Py_UNBLOCK_THREADS #endif /*try:*/ { /* "pygame_sdl2/rwobject.pyx":203 * * with nogil: * rv = SDL_RWFromFile(cname, cmode) # <<<<<<<<<<<<<< * * if rv == NULL: */ __pyx_v_rv = SDL_RWFromFile(__pyx_v_cname, __pyx_v_cmode); } /* "pygame_sdl2/rwobject.pyx":202 * cmode = mode * * with nogil: # <<<<<<<<<<<<<< * rv = SDL_RWFromFile(cname, cmode) * */ /*finally:*/ { /*normal exit:*/{ #ifdef WITH_THREAD Py_BLOCK_THREADS #endif goto __pyx_L11; } __pyx_L11:; } } /* "pygame_sdl2/rwobject.pyx":205 * rv = SDL_RWFromFile(cname, cmode) * * if rv == NULL: # <<<<<<<<<<<<<< * raise IOError("Could not open {!r}: {}".format(filelike, SDL_GetError())) * */ __pyx_t_3 = ((__pyx_v_rv == NULL) != 0); if (__pyx_t_3) { /* "pygame_sdl2/rwobject.pyx":206 * * if rv == NULL: * raise IOError("Could not open {!r}: {}".format(filelike, SDL_GetError())) # <<<<<<<<<<<<<< * * return rv */ __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_kp_s_Could_not_open_r, __pyx_n_s_format); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 206; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); __pyx_t_8 = __Pyx_PyBytes_FromString(SDL_GetError()); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 206; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_8); __pyx_t_6 = NULL; __pyx_t_10 = 0; if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_4))) { __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_4); if (likely(__pyx_t_6)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4); __Pyx_INCREF(__pyx_t_6); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_4, function); __pyx_t_10 = 1; } } __pyx_t_7 = PyTuple_New(2+__pyx_t_10); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 206; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_7); if (__pyx_t_6) { __Pyx_GIVEREF(__pyx_t_6); PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_6); __pyx_t_6 = NULL; } __Pyx_INCREF(__pyx_v_filelike); __Pyx_GIVEREF(__pyx_v_filelike); PyTuple_SET_ITEM(__pyx_t_7, 0+__pyx_t_10, __pyx_v_filelike); __Pyx_GIVEREF(__pyx_t_8); PyTuple_SET_ITEM(__pyx_t_7, 1+__pyx_t_10, __pyx_t_8); __pyx_t_8 = 0; __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_7, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 206; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 206; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); __Pyx_GIVEREF(__pyx_t_1); PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_1); __pyx_t_1 = 0; __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_IOError, __pyx_t_4, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 206; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_Raise(__pyx_t_1, 0, 0, 0); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; {__pyx_filename = __pyx_f[0]; __pyx_lineno = 206; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "pygame_sdl2/rwobject.pyx":205 * rv = SDL_RWFromFile(cname, cmode) * * if rv == NULL: # <<<<<<<<<<<<<< * raise IOError("Could not open {!r}: {}".format(filelike, SDL_GetError())) * */ } /* "pygame_sdl2/rwobject.pyx":208 * raise IOError("Could not open {!r}: {}".format(filelike, SDL_GetError())) * * return rv # <<<<<<<<<<<<<< * * if mode == b"rb": */ __pyx_r = __pyx_v_rv; goto __pyx_L0; /* "pygame_sdl2/rwobject.pyx":196 * name = None * * if name: # <<<<<<<<<<<<<< * * dname = name.encode("utf-8") */ } /* "pygame_sdl2/rwobject.pyx":210 * return rv * * if mode == b"rb": # <<<<<<<<<<<<<< * try: * */ __pyx_t_3 = (__Pyx_PyBytes_Equals(__pyx_v_mode, __pyx_n_b_rb, Py_EQ)); if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 210; __pyx_clineno = __LINE__; goto __pyx_L1_error;} if (__pyx_t_3) { /* "pygame_sdl2/rwobject.pyx":211 * * if mode == b"rb": * try: # <<<<<<<<<<<<<< * * # If we have these properties, we're either an APK asset or a Ren'Py-style */ { __Pyx_ExceptionSave(&__pyx_t_11, &__pyx_t_12, &__pyx_t_13); __Pyx_XGOTREF(__pyx_t_11); __Pyx_XGOTREF(__pyx_t_12); __Pyx_XGOTREF(__pyx_t_13); /*try:*/ { /* "pygame_sdl2/rwobject.pyx":215 * # If we have these properties, we're either an APK asset or a Ren'Py-style * # subfile, so use an optimized path. * name = filelike.name # <<<<<<<<<<<<<< * base = filelike.base * length = filelike.length */ __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_filelike, __pyx_n_s_name); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 215; __pyx_clineno = __LINE__; goto __pyx_L14_error;} __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF_SET(__pyx_v_name, __pyx_t_1); __pyx_t_1 = 0; /* "pygame_sdl2/rwobject.pyx":216 * # subfile, so use an optimized path. * name = filelike.name * base = filelike.base # <<<<<<<<<<<<<< * length = filelike.length * */ __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_filelike, __pyx_n_s_base); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 216; __pyx_clineno = __LINE__; goto __pyx_L14_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_v_base = __pyx_t_1; __pyx_t_1 = 0; /* "pygame_sdl2/rwobject.pyx":217 * name = filelike.name * base = filelike.base * length = filelike.length # <<<<<<<<<<<<<< * * if name is not None: */ __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_filelike, __pyx_n_s_length); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 217; __pyx_clineno = __LINE__; goto __pyx_L14_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_v_length = __pyx_t_1; __pyx_t_1 = 0; /* "pygame_sdl2/rwobject.pyx":219 * length = filelike.length * * if name is not None: # <<<<<<<<<<<<<< * * if not isinstance(name, unicode_): */ __pyx_t_3 = (__pyx_v_name != Py_None); __pyx_t_5 = (__pyx_t_3 != 0); if (__pyx_t_5) { /* "pygame_sdl2/rwobject.pyx":221 * if name is not None: * * if not isinstance(name, unicode_): # <<<<<<<<<<<<<< * name = name.decode(fsencoding) * */ __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_unicode); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 221; __pyx_clineno = __LINE__; goto __pyx_L14_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_t_5 = PyObject_IsInstance(__pyx_v_name, __pyx_t_1); if (unlikely(__pyx_t_5 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 221; __pyx_clineno = __LINE__; goto __pyx_L14_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_3 = ((!(__pyx_t_5 != 0)) != 0); if (__pyx_t_3) { /* "pygame_sdl2/rwobject.pyx":222 * * if not isinstance(name, unicode_): * name = name.decode(fsencoding) # <<<<<<<<<<<<<< * * dname = name.encode("utf-8") */ __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_name, __pyx_n_s_decode); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 222; __pyx_clineno = __LINE__; goto __pyx_L14_error;} __Pyx_GOTREF(__pyx_t_4); __pyx_t_7 = __Pyx_GetModuleGlobalName(__pyx_n_s_fsencoding); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 222; __pyx_clineno = __LINE__; goto __pyx_L14_error;} __Pyx_GOTREF(__pyx_t_7); __pyx_t_8 = NULL; if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_4))) { __pyx_t_8 = PyMethod_GET_SELF(__pyx_t_4); if (likely(__pyx_t_8)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4); __Pyx_INCREF(__pyx_t_8); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_4, function); } } if (!__pyx_t_8) { __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_7); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 222; __pyx_clineno = __LINE__; goto __pyx_L14_error;} __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_GOTREF(__pyx_t_1); } else { __pyx_t_6 = PyTuple_New(1+1); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 222; __pyx_clineno = __LINE__; goto __pyx_L14_error;} __Pyx_GOTREF(__pyx_t_6); __Pyx_GIVEREF(__pyx_t_8); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_8); __pyx_t_8 = NULL; __Pyx_GIVEREF(__pyx_t_7); PyTuple_SET_ITEM(__pyx_t_6, 0+1, __pyx_t_7); __pyx_t_7 = 0; __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_6, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 222; __pyx_clineno = __LINE__; goto __pyx_L14_error;} __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; } __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF_SET(__pyx_v_name, __pyx_t_1); __pyx_t_1 = 0; /* "pygame_sdl2/rwobject.pyx":221 * if name is not None: * * if not isinstance(name, unicode_): # <<<<<<<<<<<<<< * name = name.decode(fsencoding) * */ } /* "pygame_sdl2/rwobject.pyx":224 * name = name.decode(fsencoding) * * dname = name.encode("utf-8") # <<<<<<<<<<<<<< * cname = dname * */ __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_name, __pyx_n_s_encode); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 224; __pyx_clineno = __LINE__; goto __pyx_L14_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_tuple__4, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 224; __pyx_clineno = __LINE__; goto __pyx_L14_error;} __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_v_dname = __pyx_t_4; __pyx_t_4 = 0; /* "pygame_sdl2/rwobject.pyx":225 * * dname = name.encode("utf-8") * cname = dname # <<<<<<<<<<<<<< * * with nogil: */ __pyx_t_9 = __Pyx_PyObject_AsString(__pyx_v_dname); if (unlikely((!__pyx_t_9) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 225; __pyx_clineno = __LINE__; goto __pyx_L14_error;} __pyx_v_cname = __pyx_t_9; /* "pygame_sdl2/rwobject.pyx":227 * cname = dname * * with nogil: # <<<<<<<<<<<<<< * rw = SDL_RWFromFile(cname, b"rb") * */ { #ifdef WITH_THREAD PyThreadState *_save; Py_UNBLOCK_THREADS #endif /*try:*/ { /* "pygame_sdl2/rwobject.pyx":228 * * with nogil: * rw = SDL_RWFromFile(cname, b"rb") # <<<<<<<<<<<<<< * * if not rw: */ __pyx_v_rw = SDL_RWFromFile(__pyx_v_cname, __pyx_k_rb); } /* "pygame_sdl2/rwobject.pyx":227 * cname = dname * * with nogil: # <<<<<<<<<<<<<< * rw = SDL_RWFromFile(cname, b"rb") * */ /*finally:*/ { /*normal exit:*/{ #ifdef WITH_THREAD Py_BLOCK_THREADS #endif goto __pyx_L28; } __pyx_L28:; } } /* "pygame_sdl2/rwobject.pyx":230 * rw = SDL_RWFromFile(cname, b"rb") * * if not rw: # <<<<<<<<<<<<<< * raise IOError("Could not open {!r}.".format(name)) * */ __pyx_t_3 = ((!(__pyx_v_rw != 0)) != 0); if (__pyx_t_3) { /* "pygame_sdl2/rwobject.pyx":231 * * if not rw: * raise IOError("Could not open {!r}.".format(name)) # <<<<<<<<<<<<<< * * SDL_RWseek(rw, base, RW_SEEK_SET); */ __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_kp_s_Could_not_open_r_2, __pyx_n_s_format); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 231; __pyx_clineno = __LINE__; goto __pyx_L14_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_t_6 = NULL; if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_1))) { __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_1); if (likely(__pyx_t_6)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1); __Pyx_INCREF(__pyx_t_6); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_1, function); } } if (!__pyx_t_6) { __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_t_1, __pyx_v_name); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 231; __pyx_clineno = __LINE__; goto __pyx_L14_error;} __Pyx_GOTREF(__pyx_t_4); } else { __pyx_t_7 = PyTuple_New(1+1); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 231; __pyx_clineno = __LINE__; goto __pyx_L14_error;} __Pyx_GOTREF(__pyx_t_7); __Pyx_GIVEREF(__pyx_t_6); PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_6); __pyx_t_6 = NULL; __Pyx_INCREF(__pyx_v_name); __Pyx_GIVEREF(__pyx_v_name); PyTuple_SET_ITEM(__pyx_t_7, 0+1, __pyx_v_name); __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_7, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 231; __pyx_clineno = __LINE__; goto __pyx_L14_error;} __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 231; __pyx_clineno = __LINE__; goto __pyx_L14_error;} __Pyx_GOTREF(__pyx_t_1); __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_4); __pyx_t_4 = 0; __pyx_t_4 = __Pyx_PyObject_Call(__pyx_builtin_IOError, __pyx_t_1, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 231; __pyx_clineno = __LINE__; goto __pyx_L14_error;} __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_Raise(__pyx_t_4, 0, 0, 0); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; {__pyx_filename = __pyx_f[0]; __pyx_lineno = 231; __pyx_clineno = __LINE__; goto __pyx_L14_error;} /* "pygame_sdl2/rwobject.pyx":230 * rw = SDL_RWFromFile(cname, b"rb") * * if not rw: # <<<<<<<<<<<<<< * raise IOError("Could not open {!r}.".format(name)) * */ } /* "pygame_sdl2/rwobject.pyx":233 * raise IOError("Could not open {!r}.".format(name)) * * SDL_RWseek(rw, base, RW_SEEK_SET); # <<<<<<<<<<<<<< * * sf = calloc(sizeof(SubFile), 1) */ __pyx_t_14 = __Pyx_PyInt_As_int64_t(__pyx_v_base); if (unlikely((__pyx_t_14 == (Sint64)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 233; __pyx_clineno = __LINE__; goto __pyx_L14_error;} SDL_RWseek(__pyx_v_rw, __pyx_t_14, RW_SEEK_SET); /* "pygame_sdl2/rwobject.pyx":235 * SDL_RWseek(rw, base, RW_SEEK_SET); * * sf = calloc(sizeof(SubFile), 1) # <<<<<<<<<<<<<< * sf.rw = rw * sf.base = base */ __pyx_v_sf = ((struct __pyx_t_11pygame_sdl2_8rwobject_SubFile *)calloc((sizeof(struct __pyx_t_11pygame_sdl2_8rwobject_SubFile)), 1)); /* "pygame_sdl2/rwobject.pyx":236 * * sf = calloc(sizeof(SubFile), 1) * sf.rw = rw # <<<<<<<<<<<<<< * sf.base = base * sf.length = length */ __pyx_v_sf->rw = __pyx_v_rw; /* "pygame_sdl2/rwobject.pyx":237 * sf = calloc(sizeof(SubFile), 1) * sf.rw = rw * sf.base = base # <<<<<<<<<<<<<< * sf.length = length * sf.tell = 0; */ __pyx_t_14 = __Pyx_PyInt_As_int64_t(__pyx_v_base); if (unlikely((__pyx_t_14 == (Sint64)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 237; __pyx_clineno = __LINE__; goto __pyx_L14_error;} __pyx_v_sf->base = __pyx_t_14; /* "pygame_sdl2/rwobject.pyx":238 * sf.rw = rw * sf.base = base * sf.length = length # <<<<<<<<<<<<<< * sf.tell = 0; * */ __pyx_t_14 = __Pyx_PyInt_As_int64_t(__pyx_v_length); if (unlikely((__pyx_t_14 == (Sint64)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 238; __pyx_clineno = __LINE__; goto __pyx_L14_error;} __pyx_v_sf->length = __pyx_t_14; /* "pygame_sdl2/rwobject.pyx":239 * sf.base = base * sf.length = length * sf.tell = 0; # <<<<<<<<<<<<<< * * rv = SDL_AllocRW() */ __pyx_v_sf->tell = 0; /* "pygame_sdl2/rwobject.pyx":241 * sf.tell = 0; * * rv = SDL_AllocRW() # <<<<<<<<<<<<<< * rv.size = subfile_size * rv.seek = subfile_seek */ __pyx_v_rv = SDL_AllocRW(); /* "pygame_sdl2/rwobject.pyx":242 * * rv = SDL_AllocRW() * rv.size = subfile_size # <<<<<<<<<<<<<< * rv.seek = subfile_seek * rv.read = subfile_read */ __pyx_v_rv->size = __pyx_f_11pygame_sdl2_8rwobject_subfile_size; /* "pygame_sdl2/rwobject.pyx":243 * rv = SDL_AllocRW() * rv.size = subfile_size * rv.seek = subfile_seek # <<<<<<<<<<<<<< * rv.read = subfile_read * rv.write = NULL */ __pyx_v_rv->seek = __pyx_f_11pygame_sdl2_8rwobject_subfile_seek; /* "pygame_sdl2/rwobject.pyx":244 * rv.size = subfile_size * rv.seek = subfile_seek * rv.read = subfile_read # <<<<<<<<<<<<<< * rv.write = NULL * rv.close = subfile_close */ __pyx_v_rv->read = __pyx_f_11pygame_sdl2_8rwobject_subfile_read; /* "pygame_sdl2/rwobject.pyx":245 * rv.seek = subfile_seek * rv.read = subfile_read * rv.write = NULL # <<<<<<<<<<<<<< * rv.close = subfile_close * rv.type = 0 */ __pyx_v_rv->write = NULL; /* "pygame_sdl2/rwobject.pyx":246 * rv.read = subfile_read * rv.write = NULL * rv.close = subfile_close # <<<<<<<<<<<<<< * rv.type = 0 * rv.hidden.unknown.data1 = sf */ __pyx_v_rv->close = __pyx_f_11pygame_sdl2_8rwobject_subfile_close; /* "pygame_sdl2/rwobject.pyx":247 * rv.write = NULL * rv.close = subfile_close * rv.type = 0 # <<<<<<<<<<<<<< * rv.hidden.unknown.data1 = sf * */ __pyx_v_rv->type = 0; /* "pygame_sdl2/rwobject.pyx":248 * rv.close = subfile_close * rv.type = 0 * rv.hidden.unknown.data1 = sf # <<<<<<<<<<<<<< * * return rv */ __pyx_v_rv->hidden.unknown.data1 = ((void *)__pyx_v_sf); /* "pygame_sdl2/rwobject.pyx":250 * rv.hidden.unknown.data1 = sf * * return rv # <<<<<<<<<<<<<< * * except AttributeError: */ __pyx_r = __pyx_v_rv; goto __pyx_L18_try_return; /* "pygame_sdl2/rwobject.pyx":219 * length = filelike.length * * if name is not None: # <<<<<<<<<<<<<< * * if not isinstance(name, unicode_): */ } /* "pygame_sdl2/rwobject.pyx":211 * * if mode == b"rb": * try: # <<<<<<<<<<<<<< * * # If we have these properties, we're either an APK asset or a Ren'Py-style */ } __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0; __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0; __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0; goto __pyx_L21_try_end; __pyx_L14_error:; __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0; __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; /* "pygame_sdl2/rwobject.pyx":252 * return rv * * except AttributeError: # <<<<<<<<<<<<<< * pass * */ __pyx_t_15 = PyErr_ExceptionMatches(__pyx_builtin_AttributeError); if (__pyx_t_15) { PyErr_Restore(0,0,0); goto __pyx_L15_exception_handled; } goto __pyx_L16_except_error; __pyx_L16_except_error:; /* "pygame_sdl2/rwobject.pyx":211 * * if mode == b"rb": * try: # <<<<<<<<<<<<<< * * # If we have these properties, we're either an APK asset or a Ren'Py-style */ __Pyx_XGIVEREF(__pyx_t_11); __Pyx_XGIVEREF(__pyx_t_12); __Pyx_XGIVEREF(__pyx_t_13); __Pyx_ExceptionReset(__pyx_t_11, __pyx_t_12, __pyx_t_13); goto __pyx_L1_error; __pyx_L18_try_return:; __Pyx_XGIVEREF(__pyx_t_11); __Pyx_XGIVEREF(__pyx_t_12); __Pyx_XGIVEREF(__pyx_t_13); __Pyx_ExceptionReset(__pyx_t_11, __pyx_t_12, __pyx_t_13); goto __pyx_L0; __pyx_L15_exception_handled:; __Pyx_XGIVEREF(__pyx_t_11); __Pyx_XGIVEREF(__pyx_t_12); __Pyx_XGIVEREF(__pyx_t_13); __Pyx_ExceptionReset(__pyx_t_11, __pyx_t_12, __pyx_t_13); __pyx_L21_try_end:; } /* "pygame_sdl2/rwobject.pyx":210 * return rv * * if mode == b"rb": # <<<<<<<<<<<<<< * try: * */ } /* "pygame_sdl2/rwobject.pyx":256 * * * if not (hasattr(filelike, "read") or hasattr(filelike, "write")): # <<<<<<<<<<<<<< * raise IOError("{!r} is not a filename or file-like object.".format(filelike)) * */ __pyx_t_5 = PyObject_HasAttr(__pyx_v_filelike, __pyx_n_s_read); if (unlikely(__pyx_t_5 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 256; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_t_2 = (__pyx_t_5 != 0); if (!__pyx_t_2) { } else { __pyx_t_3 = __pyx_t_2; goto __pyx_L31_bool_binop_done; } __pyx_t_2 = PyObject_HasAttr(__pyx_v_filelike, __pyx_n_s_write); if (unlikely(__pyx_t_2 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 256; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_t_5 = (__pyx_t_2 != 0); __pyx_t_3 = __pyx_t_5; __pyx_L31_bool_binop_done:; __pyx_t_5 = ((!__pyx_t_3) != 0); if (__pyx_t_5) { /* "pygame_sdl2/rwobject.pyx":257 * * if not (hasattr(filelike, "read") or hasattr(filelike, "write")): * raise IOError("{!r} is not a filename or file-like object.".format(filelike)) # <<<<<<<<<<<<<< * * Py_INCREF(filelike) */ __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_kp_s_r_is_not_a_filename_or_file_lik, __pyx_n_s_format); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 257; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_t_7 = NULL; if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_1))) { __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_1); if (likely(__pyx_t_7)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1); __Pyx_INCREF(__pyx_t_7); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_1, function); } } if (!__pyx_t_7) { __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_t_1, __pyx_v_filelike); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 257; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); } else { __pyx_t_6 = PyTuple_New(1+1); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 257; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_6); __Pyx_GIVEREF(__pyx_t_7); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_7); __pyx_t_7 = NULL; __Pyx_INCREF(__pyx_v_filelike); __Pyx_GIVEREF(__pyx_v_filelike); PyTuple_SET_ITEM(__pyx_t_6, 0+1, __pyx_v_filelike); __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_6, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 257; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 257; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_4); __pyx_t_4 = 0; __pyx_t_4 = __Pyx_PyObject_Call(__pyx_builtin_IOError, __pyx_t_1, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 257; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_Raise(__pyx_t_4, 0, 0, 0); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; {__pyx_filename = __pyx_f[0]; __pyx_lineno = 257; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "pygame_sdl2/rwobject.pyx":256 * * * if not (hasattr(filelike, "read") or hasattr(filelike, "write")): # <<<<<<<<<<<<<< * raise IOError("{!r} is not a filename or file-like object.".format(filelike)) * */ } /* "pygame_sdl2/rwobject.pyx":259 * raise IOError("{!r} is not a filename or file-like object.".format(filelike)) * * Py_INCREF(filelike) # <<<<<<<<<<<<<< * * rv = SDL_AllocRW() */ Py_INCREF(__pyx_v_filelike); /* "pygame_sdl2/rwobject.pyx":261 * Py_INCREF(filelike) * * rv = SDL_AllocRW() # <<<<<<<<<<<<<< * rv.size = python_size * rv.seek = python_seek */ __pyx_v_rv = SDL_AllocRW(); /* "pygame_sdl2/rwobject.pyx":262 * * rv = SDL_AllocRW() * rv.size = python_size # <<<<<<<<<<<<<< * rv.seek = python_seek * rv.read = python_read */ __pyx_v_rv->size = __pyx_f_11pygame_sdl2_8rwobject_python_size; /* "pygame_sdl2/rwobject.pyx":263 * rv = SDL_AllocRW() * rv.size = python_size * rv.seek = python_seek # <<<<<<<<<<<<<< * rv.read = python_read * rv.write = python_write */ __pyx_v_rv->seek = __pyx_f_11pygame_sdl2_8rwobject_python_seek; /* "pygame_sdl2/rwobject.pyx":264 * rv.size = python_size * rv.seek = python_seek * rv.read = python_read # <<<<<<<<<<<<<< * rv.write = python_write * rv.close = python_close */ __pyx_v_rv->read = __pyx_f_11pygame_sdl2_8rwobject_python_read; /* "pygame_sdl2/rwobject.pyx":265 * rv.seek = python_seek * rv.read = python_read * rv.write = python_write # <<<<<<<<<<<<<< * rv.close = python_close * rv.type = 0 */ __pyx_v_rv->write = __pyx_f_11pygame_sdl2_8rwobject_python_write; /* "pygame_sdl2/rwobject.pyx":266 * rv.read = python_read * rv.write = python_write * rv.close = python_close # <<<<<<<<<<<<<< * rv.type = 0 * rv.hidden.unknown.data1 = filelike */ __pyx_v_rv->close = __pyx_f_11pygame_sdl2_8rwobject_python_close; /* "pygame_sdl2/rwobject.pyx":267 * rv.write = python_write * rv.close = python_close * rv.type = 0 # <<<<<<<<<<<<<< * rv.hidden.unknown.data1 = filelike * */ __pyx_v_rv->type = 0; /* "pygame_sdl2/rwobject.pyx":268 * rv.close = python_close * rv.type = 0 * rv.hidden.unknown.data1 = filelike # <<<<<<<<<<<<<< * * return rv */ __pyx_v_rv->hidden.unknown.data1 = ((void *)__pyx_v_filelike); /* "pygame_sdl2/rwobject.pyx":270 * rv.hidden.unknown.data1 = filelike * * return rv # <<<<<<<<<<<<<< * * */ __pyx_r = __pyx_v_rv; goto __pyx_L0; /* "pygame_sdl2/rwobject.pyx":173 * * * cdef SDL_RWops *to_rwops(filelike, mode="rb") except NULL: # <<<<<<<<<<<<<< * * cdef FILE *f */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_6); __Pyx_XDECREF(__pyx_t_7); __Pyx_XDECREF(__pyx_t_8); __Pyx_AddTraceback("pygame_sdl2.rwobject.to_rwops", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF(__pyx_v_name); __Pyx_XDECREF(__pyx_v_dname); __Pyx_XDECREF(__pyx_v_base); __Pyx_XDECREF(__pyx_v_length); __Pyx_XDECREF(__pyx_v_filelike); __Pyx_XDECREF(__pyx_v_mode); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/rwobject.pyx":273 * * * cdef api SDL_RWops *RWopsFromPython(filelike) except NULL: # <<<<<<<<<<<<<< * return to_rwops(filelike) * */ static SDL_RWops *__pyx_f_11pygame_sdl2_8rwobject_RWopsFromPython(PyObject *__pyx_v_filelike) { SDL_RWops *__pyx_r; __Pyx_RefNannyDeclarations SDL_RWops *__pyx_t_1; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("RWopsFromPython", 0); /* "pygame_sdl2/rwobject.pyx":274 * * cdef api SDL_RWops *RWopsFromPython(filelike) except NULL: * return to_rwops(filelike) # <<<<<<<<<<<<<< * * PyEval_InitThreads() */ __pyx_t_1 = __pyx_f_11pygame_sdl2_8rwobject_to_rwops(__pyx_v_filelike, NULL); if (unlikely(__pyx_t_1 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 274; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_r = __pyx_t_1; goto __pyx_L0; /* "pygame_sdl2/rwobject.pyx":273 * * * cdef api SDL_RWops *RWopsFromPython(filelike) except NULL: # <<<<<<<<<<<<<< * return to_rwops(filelike) * */ /* function exit code */ __pyx_L1_error:; __Pyx_AddTraceback("pygame_sdl2.rwobject.RWopsFromPython", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyMethodDef __pyx_methods[] = { {0, 0, 0, 0} }; #if PY_MAJOR_VERSION >= 3 static struct PyModuleDef __pyx_moduledef = { #if PY_VERSION_HEX < 0x03020000 { PyObject_HEAD_INIT(NULL) NULL, 0, NULL }, #else PyModuleDef_HEAD_INIT, #endif "rwobject", 0, /* m_doc */ -1, /* m_size */ __pyx_methods /* m_methods */, NULL, /* m_reload */ NULL, /* m_traverse */ NULL, /* m_clear */ NULL /* m_free */ }; #endif static __Pyx_StringTabEntry __pyx_string_tab[] = { {&__pyx_n_s_AttributeError, __pyx_k_AttributeError, sizeof(__pyx_k_AttributeError), 0, 0, 1, 1}, {&__pyx_kp_s_Could_not_open_r, __pyx_k_Could_not_open_r, sizeof(__pyx_k_Could_not_open_r), 0, 0, 1, 0}, {&__pyx_kp_s_Could_not_open_r_2, __pyx_k_Could_not_open_r_2, sizeof(__pyx_k_Could_not_open_r_2), 0, 0, 1, 0}, {&__pyx_n_s_Exception, __pyx_k_Exception, sizeof(__pyx_k_Exception), 0, 0, 1, 1}, {&__pyx_n_s_IOError, __pyx_k_IOError, sizeof(__pyx_k_IOError), 0, 0, 1, 1}, {&__pyx_n_s_ascii, __pyx_k_ascii, sizeof(__pyx_k_ascii), 0, 0, 1, 1}, {&__pyx_n_s_base, __pyx_k_base, sizeof(__pyx_k_base), 0, 0, 1, 1}, {&__pyx_n_s_bytes, __pyx_k_bytes, sizeof(__pyx_k_bytes), 0, 0, 1, 1}, {&__pyx_n_s_close, __pyx_k_close, sizeof(__pyx_k_close), 0, 0, 1, 1}, {&__pyx_n_s_decode, __pyx_k_decode, sizeof(__pyx_k_decode), 0, 0, 1, 1}, {&__pyx_n_s_encode, __pyx_k_encode, sizeof(__pyx_k_encode), 0, 0, 1, 1}, {&__pyx_n_s_file_type, __pyx_k_file_type, sizeof(__pyx_k_file_type), 0, 0, 1, 1}, {&__pyx_n_s_format, __pyx_k_format, sizeof(__pyx_k_format), 0, 0, 1, 1}, {&__pyx_n_s_fsencoding, __pyx_k_fsencoding, sizeof(__pyx_k_fsencoding), 0, 0, 1, 1}, {&__pyx_n_s_getfilesystemencoding, __pyx_k_getfilesystemencoding, sizeof(__pyx_k_getfilesystemencoding), 0, 0, 1, 1}, {&__pyx_n_s_import, __pyx_k_import, sizeof(__pyx_k_import), 0, 0, 1, 1}, {&__pyx_n_s_length, __pyx_k_length, sizeof(__pyx_k_length), 0, 0, 1, 1}, {&__pyx_n_s_main, __pyx_k_main, sizeof(__pyx_k_main), 0, 0, 1, 1}, {&__pyx_n_s_name, __pyx_k_name, sizeof(__pyx_k_name), 0, 0, 1, 1}, {&__pyx_n_s_pygame_sdl2_compat, __pyx_k_pygame_sdl2_compat, sizeof(__pyx_k_pygame_sdl2_compat), 0, 0, 1, 1}, {&__pyx_kp_s_r_is_not_a_filename_or_file_lik, __pyx_k_r_is_not_a_filename_or_file_lik, sizeof(__pyx_k_r_is_not_a_filename_or_file_lik), 0, 0, 1, 0}, {&__pyx_n_b_rb, __pyx_k_rb, sizeof(__pyx_k_rb), 0, 0, 0, 1}, {&__pyx_n_s_rb, __pyx_k_rb, sizeof(__pyx_k_rb), 0, 0, 1, 1}, {&__pyx_n_s_read, __pyx_k_read, sizeof(__pyx_k_read), 0, 0, 1, 1}, {&__pyx_n_s_seek, __pyx_k_seek, sizeof(__pyx_k_seek), 0, 0, 1, 1}, {&__pyx_n_s_sys, __pyx_k_sys, sizeof(__pyx_k_sys), 0, 0, 1, 1}, {&__pyx_n_s_tell, __pyx_k_tell, sizeof(__pyx_k_tell), 0, 0, 1, 1}, {&__pyx_n_s_test, __pyx_k_test, sizeof(__pyx_k_test), 0, 0, 1, 1}, {&__pyx_n_s_unicode, __pyx_k_unicode, sizeof(__pyx_k_unicode), 0, 0, 1, 1}, {&__pyx_kp_s_utf_8, __pyx_k_utf_8, sizeof(__pyx_k_utf_8), 0, 0, 1, 0}, {&__pyx_n_s_write, __pyx_k_write, sizeof(__pyx_k_write), 0, 0, 1, 1}, {0, 0, 0, 0, 0, 0, 0} }; static int __Pyx_InitCachedBuiltins(void) { __pyx_builtin_Exception = __Pyx_GetBuiltinName(__pyx_n_s_Exception); if (!__pyx_builtin_Exception) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 81; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_builtin_IOError = __Pyx_GetBuiltinName(__pyx_n_s_IOError); if (!__pyx_builtin_IOError) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 206; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_builtin_AttributeError = __Pyx_GetBuiltinName(__pyx_n_s_AttributeError); if (!__pyx_builtin_AttributeError) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 252; __pyx_clineno = __LINE__; goto __pyx_L1_error;} return 0; __pyx_L1_error:; return -1; } static int __Pyx_InitCachedConstants(void) { __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__Pyx_InitCachedConstants", 0); /* "pygame_sdl2/rwobject.pyx":67 * try: * cur = f.tell() * f.seek(0, 2) # <<<<<<<<<<<<<< * rv = f.tell() * f.seek(cur, 0) */ __pyx_tuple_ = PyTuple_Pack(2, __pyx_int_0, __pyx_int_2); if (unlikely(!__pyx_tuple_)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 67; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_tuple_); __Pyx_GIVEREF(__pyx_tuple_); /* "pygame_sdl2/rwobject.pyx":183 * * if not isinstance(mode, bytes_): * mode = mode.encode("ascii") # <<<<<<<<<<<<<< * * if isinstance(filelike, file_type) and mode == b"rb": */ __pyx_tuple__2 = PyTuple_Pack(1, __pyx_n_s_ascii); if (unlikely(!__pyx_tuple__2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 183; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_tuple__2); __Pyx_GIVEREF(__pyx_tuple__2); /* "pygame_sdl2/rwobject.pyx":198 * if name: * * dname = name.encode("utf-8") # <<<<<<<<<<<<<< * cname = dname * cmode = mode */ __pyx_tuple__3 = PyTuple_Pack(1, __pyx_kp_s_utf_8); if (unlikely(!__pyx_tuple__3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 198; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_tuple__3); __Pyx_GIVEREF(__pyx_tuple__3); /* "pygame_sdl2/rwobject.pyx":224 * name = name.decode(fsencoding) * * dname = name.encode("utf-8") # <<<<<<<<<<<<<< * cname = dname * */ __pyx_tuple__4 = PyTuple_Pack(1, __pyx_kp_s_utf_8); if (unlikely(!__pyx_tuple__4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 224; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_tuple__4); __Pyx_GIVEREF(__pyx_tuple__4); __Pyx_RefNannyFinishContext(); return 0; __pyx_L1_error:; __Pyx_RefNannyFinishContext(); return -1; } static int __Pyx_InitGlobals(void) { if (__Pyx_InitStrings(__pyx_string_tab) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; __pyx_int_0 = PyInt_FromLong(0); if (unlikely(!__pyx_int_0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_int_2 = PyInt_FromLong(2); if (unlikely(!__pyx_int_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} return 0; __pyx_L1_error:; return -1; } #if PY_MAJOR_VERSION < 3 PyMODINIT_FUNC initrwobject(void); /*proto*/ PyMODINIT_FUNC initrwobject(void) #else PyMODINIT_FUNC PyInit_rwobject(void); /*proto*/ PyMODINIT_FUNC PyInit_rwobject(void) #endif { PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; int __pyx_t_5; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannyDeclarations #if CYTHON_REFNANNY __Pyx_RefNanny = __Pyx_RefNannyImportAPI("refnanny"); if (!__Pyx_RefNanny) { PyErr_Clear(); __Pyx_RefNanny = __Pyx_RefNannyImportAPI("Cython.Runtime.refnanny"); if (!__Pyx_RefNanny) Py_FatalError("failed to import 'refnanny' module"); } #endif __Pyx_RefNannySetupContext("PyMODINIT_FUNC PyInit_rwobject(void)", 0); if (__Pyx_check_binary_version() < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_empty_tuple = PyTuple_New(0); if (unlikely(!__pyx_empty_tuple)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_empty_bytes = PyBytes_FromStringAndSize("", 0); if (unlikely(!__pyx_empty_bytes)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} #ifdef __Pyx_CyFunction_USED if (__pyx_CyFunction_init() < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} #endif #ifdef __Pyx_FusedFunction_USED if (__pyx_FusedFunction_init() < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} #endif #ifdef __Pyx_Coroutine_USED if (__pyx_Coroutine_init() < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} #endif #ifdef __Pyx_Generator_USED if (__pyx_Generator_init() < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} #endif #ifdef __Pyx_StopAsyncIteration_USED if (__pyx_StopAsyncIteration_init() < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} #endif /*--- Library function declarations ---*/ /*--- Threads initialization code ---*/ #if defined(__PYX_FORCE_INIT_THREADS) && __PYX_FORCE_INIT_THREADS #ifdef WITH_THREAD /* Python build with threading support? */ PyEval_InitThreads(); #endif #endif /*--- Module creation code ---*/ #if PY_MAJOR_VERSION < 3 __pyx_m = Py_InitModule4("rwobject", __pyx_methods, 0, 0, PYTHON_API_VERSION); Py_XINCREF(__pyx_m); #else __pyx_m = PyModule_Create(&__pyx_moduledef); #endif if (unlikely(!__pyx_m)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_d = PyModule_GetDict(__pyx_m); if (unlikely(!__pyx_d)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} Py_INCREF(__pyx_d); __pyx_b = PyImport_AddModule(__Pyx_BUILTIN_MODULE_NAME); if (unlikely(!__pyx_b)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} #if CYTHON_COMPILING_IN_PYPY Py_INCREF(__pyx_b); #endif if (PyObject_SetAttrString(__pyx_m, "__builtins__", __pyx_b) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; /*--- Initialize various global constants etc. ---*/ if (__Pyx_InitGlobals() < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} #if PY_MAJOR_VERSION < 3 && (__PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT) if (__Pyx_init_sys_getdefaultencoding_params() < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} #endif if (__pyx_module_is_main_pygame_sdl2__rwobject) { if (PyObject_SetAttrString(__pyx_m, "__name__", __pyx_n_s_main) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } #if PY_MAJOR_VERSION >= 3 { PyObject *modules = PyImport_GetModuleDict(); if (unlikely(!modules)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} if (!PyDict_GetItemString(modules, "pygame_sdl2.rwobject")) { if (unlikely(PyDict_SetItemString(modules, "pygame_sdl2.rwobject", __pyx_m) < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } } #endif /*--- Builtin init code ---*/ if (__Pyx_InitCachedBuiltins() < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /*--- Constants init code ---*/ if (__Pyx_InitCachedConstants() < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /*--- Global init code ---*/ /*--- Variable export code ---*/ /*--- Function export code ---*/ if (__Pyx_ExportFunction("to_rwops", (void (*)(void))__pyx_f_11pygame_sdl2_8rwobject_to_rwops, "SDL_RWops *(PyObject *, struct __pyx_opt_args_11pygame_sdl2_8rwobject_to_rwops *__pyx_optional_args)") < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} if (__Pyx_ExportFunction("RWopsFromPython", (void (*)(void))__pyx_f_11pygame_sdl2_8rwobject_RWopsFromPython, "SDL_RWops *(PyObject *)") < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /*--- Type init code ---*/ /*--- Type import code ---*/ __pyx_ptype_7cpython_4type_type = __Pyx_ImportType(__Pyx_BUILTIN_MODULE_NAME, "type", #if CYTHON_COMPILING_IN_PYPY sizeof(PyTypeObject), #else sizeof(PyHeapTypeObject), #endif 0); if (unlikely(!__pyx_ptype_7cpython_4type_type)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 9; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /*--- Variable import code ---*/ /*--- Function import code ---*/ /*--- Execution code ---*/ #if defined(__Pyx_Generator_USED) || defined(__Pyx_Coroutine_USED) if (__Pyx_patch_abc() < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} #endif /* "pygame_sdl2/rwobject.pyx":25 * from libc.stdlib cimport calloc, free * * from pygame_sdl2.compat import file_type, bytes_, unicode_ # <<<<<<<<<<<<<< * * import sys */ __pyx_t_1 = PyList_New(3); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 25; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __Pyx_INCREF(__pyx_n_s_file_type); __Pyx_GIVEREF(__pyx_n_s_file_type); PyList_SET_ITEM(__pyx_t_1, 0, __pyx_n_s_file_type); __Pyx_INCREF(__pyx_n_s_bytes); __Pyx_GIVEREF(__pyx_n_s_bytes); PyList_SET_ITEM(__pyx_t_1, 1, __pyx_n_s_bytes); __Pyx_INCREF(__pyx_n_s_unicode); __Pyx_GIVEREF(__pyx_n_s_unicode); PyList_SET_ITEM(__pyx_t_1, 2, __pyx_n_s_unicode); __pyx_t_2 = __Pyx_Import(__pyx_n_s_pygame_sdl2_compat, __pyx_t_1, -1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 25; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_1 = __Pyx_ImportFrom(__pyx_t_2, __pyx_n_s_file_type); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 25; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); if (PyDict_SetItem(__pyx_d, __pyx_n_s_file_type, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 25; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_1 = __Pyx_ImportFrom(__pyx_t_2, __pyx_n_s_bytes); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 25; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); if (PyDict_SetItem(__pyx_d, __pyx_n_s_bytes, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 25; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_1 = __Pyx_ImportFrom(__pyx_t_2, __pyx_n_s_unicode); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 25; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); if (PyDict_SetItem(__pyx_d, __pyx_n_s_unicode, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 25; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "pygame_sdl2/rwobject.pyx":27 * from pygame_sdl2.compat import file_type, bytes_, unicode_ * * import sys # <<<<<<<<<<<<<< * * # The fsencoding. */ __pyx_t_2 = __Pyx_Import(__pyx_n_s_sys, 0, -1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 27; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_sys, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 27; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "pygame_sdl2/rwobject.pyx":30 * * # The fsencoding. * fsencoding = sys.getfilesystemencoding() or "utf-8" # <<<<<<<<<<<<<< * * cdef extern from "SDL.h" nogil: */ __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_sys); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 30; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_getfilesystemencoding); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 30; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_3 = NULL; if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_4))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_4); if (likely(__pyx_t_3)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_4, function); } } if (__pyx_t_3) { __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_3); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 30; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } else { __pyx_t_1 = __Pyx_PyObject_CallNoArg(__pyx_t_4); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 30; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_5 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 30; __pyx_clineno = __LINE__; goto __pyx_L1_error;} if (!__pyx_t_5) { __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; } else { __Pyx_INCREF(__pyx_t_1); __pyx_t_2 = __pyx_t_1; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; goto __pyx_L2_bool_binop_done; } __Pyx_INCREF(__pyx_kp_s_utf_8); __pyx_t_2 = __pyx_kp_s_utf_8; __pyx_L2_bool_binop_done:; if (PyDict_SetItem(__pyx_d, __pyx_n_s_fsencoding, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 30; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "pygame_sdl2/rwobject.pyx":276 * return to_rwops(filelike) * * PyEval_InitThreads() # <<<<<<<<<<<<<< */ PyEval_InitThreads(); /* "pygame_sdl2/rwobject.pyx":1 * # Copyright 2014 Tom Rothamel # <<<<<<<<<<<<<< * # * # This software is provided 'as-is', without any express or implied */ __pyx_t_2 = PyDict_New(); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_test, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /*--- Wrapped vars code ---*/ goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); if (__pyx_m) { if (__pyx_d) { __Pyx_AddTraceback("init pygame_sdl2.rwobject", __pyx_clineno, __pyx_lineno, __pyx_filename); } Py_DECREF(__pyx_m); __pyx_m = 0; } else if (!PyErr_Occurred()) { PyErr_SetString(PyExc_ImportError, "init pygame_sdl2.rwobject"); } __pyx_L0:; __Pyx_RefNannyFinishContext(); #if PY_MAJOR_VERSION < 3 return; #else return __pyx_m; #endif } /* --- Runtime support code --- */ #if CYTHON_REFNANNY static __Pyx_RefNannyAPIStruct *__Pyx_RefNannyImportAPI(const char *modname) { PyObject *m = NULL, *p = NULL; void *r = NULL; m = PyImport_ImportModule((char *)modname); if (!m) goto end; p = PyObject_GetAttrString(m, (char *)"RefNannyAPI"); if (!p) goto end; r = PyLong_AsVoidPtr(p); end: Py_XDECREF(p); Py_XDECREF(m); return (__Pyx_RefNannyAPIStruct *)r; } #endif static PyObject *__Pyx_GetBuiltinName(PyObject *name) { PyObject* result = __Pyx_PyObject_GetAttrStr(__pyx_b, name); if (unlikely(!result)) { PyErr_Format(PyExc_NameError, #if PY_MAJOR_VERSION >= 3 "name '%U' is not defined", name); #else "name '%.200s' is not defined", PyString_AS_STRING(name)); #endif } return result; } #if CYTHON_COMPILING_IN_CPYTHON static CYTHON_INLINE PyObject* __Pyx_PyObject_Call(PyObject *func, PyObject *arg, PyObject *kw) { PyObject *result; ternaryfunc call = func->ob_type->tp_call; if (unlikely(!call)) return PyObject_Call(func, arg, kw); if (unlikely(Py_EnterRecursiveCall((char*)" while calling a Python object"))) return NULL; result = (*call)(func, arg, kw); Py_LeaveRecursiveCall(); if (unlikely(!result) && unlikely(!PyErr_Occurred())) { PyErr_SetString( PyExc_SystemError, "NULL result without error in PyObject_Call"); } return result; } #endif #if CYTHON_COMPILING_IN_CPYTHON static CYTHON_INLINE PyObject* __Pyx_PyObject_CallMethO(PyObject *func, PyObject *arg) { PyObject *self, *result; PyCFunction cfunc; cfunc = PyCFunction_GET_FUNCTION(func); self = PyCFunction_GET_SELF(func); if (unlikely(Py_EnterRecursiveCall((char*)" while calling a Python object"))) return NULL; result = cfunc(self, arg); Py_LeaveRecursiveCall(); if (unlikely(!result) && unlikely(!PyErr_Occurred())) { PyErr_SetString( PyExc_SystemError, "NULL result without error in PyObject_Call"); } return result; } #endif #if CYTHON_COMPILING_IN_CPYTHON static PyObject* __Pyx__PyObject_CallOneArg(PyObject *func, PyObject *arg) { PyObject *result; PyObject *args = PyTuple_New(1); if (unlikely(!args)) return NULL; Py_INCREF(arg); PyTuple_SET_ITEM(args, 0, arg); result = __Pyx_PyObject_Call(func, args, NULL); Py_DECREF(args); return result; } static CYTHON_INLINE PyObject* __Pyx_PyObject_CallOneArg(PyObject *func, PyObject *arg) { #ifdef __Pyx_CyFunction_USED if (likely(PyCFunction_Check(func) || PyObject_TypeCheck(func, __pyx_CyFunctionType))) { #else if (likely(PyCFunction_Check(func))) { #endif if (likely(PyCFunction_GET_FLAGS(func) & METH_O)) { return __Pyx_PyObject_CallMethO(func, arg); } } return __Pyx__PyObject_CallOneArg(func, arg); } #else static CYTHON_INLINE PyObject* __Pyx_PyObject_CallOneArg(PyObject *func, PyObject *arg) { PyObject *result; PyObject *args = PyTuple_Pack(1, arg); if (unlikely(!args)) return NULL; result = __Pyx_PyObject_Call(func, args, NULL); Py_DECREF(args); return result; } #endif #if CYTHON_COMPILING_IN_CPYTHON static CYTHON_INLINE PyObject* __Pyx_PyObject_CallNoArg(PyObject *func) { #ifdef __Pyx_CyFunction_USED if (likely(PyCFunction_Check(func) || PyObject_TypeCheck(func, __pyx_CyFunctionType))) { #else if (likely(PyCFunction_Check(func))) { #endif if (likely(PyCFunction_GET_FLAGS(func) & METH_NOARGS)) { return __Pyx_PyObject_CallMethO(func, NULL); } } return __Pyx_PyObject_Call(func, __pyx_empty_tuple, NULL); } #endif static CYTHON_INLINE void __Pyx_ExceptionSave(PyObject **type, PyObject **value, PyObject **tb) { #if CYTHON_COMPILING_IN_CPYTHON PyThreadState *tstate = PyThreadState_GET(); *type = tstate->exc_type; *value = tstate->exc_value; *tb = tstate->exc_traceback; Py_XINCREF(*type); Py_XINCREF(*value); Py_XINCREF(*tb); #else PyErr_GetExcInfo(type, value, tb); #endif } static void __Pyx_ExceptionReset(PyObject *type, PyObject *value, PyObject *tb) { #if CYTHON_COMPILING_IN_CPYTHON PyObject *tmp_type, *tmp_value, *tmp_tb; PyThreadState *tstate = PyThreadState_GET(); tmp_type = tstate->exc_type; tmp_value = tstate->exc_value; tmp_tb = tstate->exc_traceback; tstate->exc_type = type; tstate->exc_value = value; tstate->exc_traceback = tb; Py_XDECREF(tmp_type); Py_XDECREF(tmp_value); Py_XDECREF(tmp_tb); #else PyErr_SetExcInfo(type, value, tb); #endif } static int __Pyx_GetException(PyObject **type, PyObject **value, PyObject **tb) { PyObject *local_type, *local_value, *local_tb; #if CYTHON_COMPILING_IN_CPYTHON PyObject *tmp_type, *tmp_value, *tmp_tb; PyThreadState *tstate = PyThreadState_GET(); local_type = tstate->curexc_type; local_value = tstate->curexc_value; local_tb = tstate->curexc_traceback; tstate->curexc_type = 0; tstate->curexc_value = 0; tstate->curexc_traceback = 0; #else PyErr_Fetch(&local_type, &local_value, &local_tb); #endif PyErr_NormalizeException(&local_type, &local_value, &local_tb); #if CYTHON_COMPILING_IN_CPYTHON if (unlikely(tstate->curexc_type)) #else if (unlikely(PyErr_Occurred())) #endif goto bad; #if PY_MAJOR_VERSION >= 3 if (local_tb) { if (unlikely(PyException_SetTraceback(local_value, local_tb) < 0)) goto bad; } #endif Py_XINCREF(local_tb); Py_XINCREF(local_type); Py_XINCREF(local_value); *type = local_type; *value = local_value; *tb = local_tb; #if CYTHON_COMPILING_IN_CPYTHON tmp_type = tstate->exc_type; tmp_value = tstate->exc_value; tmp_tb = tstate->exc_traceback; tstate->exc_type = local_type; tstate->exc_value = local_value; tstate->exc_traceback = local_tb; Py_XDECREF(tmp_type); Py_XDECREF(tmp_value); Py_XDECREF(tmp_tb); #else PyErr_SetExcInfo(local_type, local_value, local_tb); #endif return 0; bad: *type = 0; *value = 0; *tb = 0; Py_XDECREF(local_type); Py_XDECREF(local_value); Py_XDECREF(local_tb); return -1; } static CYTHON_INLINE void __Pyx_ErrRestore(PyObject *type, PyObject *value, PyObject *tb) { #if CYTHON_COMPILING_IN_CPYTHON PyObject *tmp_type, *tmp_value, *tmp_tb; PyThreadState *tstate = PyThreadState_GET(); tmp_type = tstate->curexc_type; tmp_value = tstate->curexc_value; tmp_tb = tstate->curexc_traceback; tstate->curexc_type = type; tstate->curexc_value = value; tstate->curexc_traceback = tb; Py_XDECREF(tmp_type); Py_XDECREF(tmp_value); Py_XDECREF(tmp_tb); #else PyErr_Restore(type, value, tb); #endif } static CYTHON_INLINE void __Pyx_ErrFetch(PyObject **type, PyObject **value, PyObject **tb) { #if CYTHON_COMPILING_IN_CPYTHON PyThreadState *tstate = PyThreadState_GET(); *type = tstate->curexc_type; *value = tstate->curexc_value; *tb = tstate->curexc_traceback; tstate->curexc_type = 0; tstate->curexc_value = 0; tstate->curexc_traceback = 0; #else PyErr_Fetch(type, value, tb); #endif } static void __Pyx_WriteUnraisable(const char *name, CYTHON_UNUSED int clineno, CYTHON_UNUSED int lineno, CYTHON_UNUSED const char *filename, int full_traceback, CYTHON_UNUSED int nogil) { PyObject *old_exc, *old_val, *old_tb; PyObject *ctx; #ifdef WITH_THREAD PyGILState_STATE state; if (nogil) state = PyGILState_Ensure(); #endif __Pyx_ErrFetch(&old_exc, &old_val, &old_tb); if (full_traceback) { Py_XINCREF(old_exc); Py_XINCREF(old_val); Py_XINCREF(old_tb); __Pyx_ErrRestore(old_exc, old_val, old_tb); PyErr_PrintEx(1); } #if PY_MAJOR_VERSION < 3 ctx = PyString_FromString(name); #else ctx = PyUnicode_FromString(name); #endif __Pyx_ErrRestore(old_exc, old_val, old_tb); if (!ctx) { PyErr_WriteUnraisable(Py_None); } else { PyErr_WriteUnraisable(ctx); Py_DECREF(ctx); } #ifdef WITH_THREAD if (nogil) PyGILState_Release(state); #endif } static CYTHON_INLINE PyObject *__Pyx_GetModuleGlobalName(PyObject *name) { PyObject *result; #if CYTHON_COMPILING_IN_CPYTHON result = PyDict_GetItem(__pyx_d, name); if (likely(result)) { Py_INCREF(result); } else { #else result = PyObject_GetItem(__pyx_d, name); if (!result) { PyErr_Clear(); #endif result = __Pyx_GetBuiltinName(name); } return result; } static CYTHON_INLINE int __Pyx_PyBytes_Equals(PyObject* s1, PyObject* s2, int equals) { #if CYTHON_COMPILING_IN_PYPY return PyObject_RichCompareBool(s1, s2, equals); #else if (s1 == s2) { return (equals == Py_EQ); } else if (PyBytes_CheckExact(s1) & PyBytes_CheckExact(s2)) { const char *ps1, *ps2; Py_ssize_t length = PyBytes_GET_SIZE(s1); if (length != PyBytes_GET_SIZE(s2)) return (equals == Py_NE); ps1 = PyBytes_AS_STRING(s1); ps2 = PyBytes_AS_STRING(s2); if (ps1[0] != ps2[0]) { return (equals == Py_NE); } else if (length == 1) { return (equals == Py_EQ); } else { int result = memcmp(ps1, ps2, (size_t)length); return (equals == Py_EQ) ? (result == 0) : (result != 0); } } else if ((s1 == Py_None) & PyBytes_CheckExact(s2)) { return (equals == Py_NE); } else if ((s2 == Py_None) & PyBytes_CheckExact(s1)) { return (equals == Py_NE); } else { int result; PyObject* py_result = PyObject_RichCompare(s1, s2, equals); if (!py_result) return -1; result = __Pyx_PyObject_IsTrue(py_result); Py_DECREF(py_result); return result; } #endif } #if PY_MAJOR_VERSION < 3 static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, CYTHON_UNUSED PyObject *cause) { Py_XINCREF(type); if (!value || value == Py_None) value = NULL; else Py_INCREF(value); if (!tb || tb == Py_None) tb = NULL; else { Py_INCREF(tb); if (!PyTraceBack_Check(tb)) { PyErr_SetString(PyExc_TypeError, "raise: arg 3 must be a traceback or None"); goto raise_error; } } if (PyType_Check(type)) { #if CYTHON_COMPILING_IN_PYPY if (!value) { Py_INCREF(Py_None); value = Py_None; } #endif PyErr_NormalizeException(&type, &value, &tb); } else { if (value) { PyErr_SetString(PyExc_TypeError, "instance exception may not have a separate value"); goto raise_error; } value = type; type = (PyObject*) Py_TYPE(type); Py_INCREF(type); if (!PyType_IsSubtype((PyTypeObject *)type, (PyTypeObject *)PyExc_BaseException)) { PyErr_SetString(PyExc_TypeError, "raise: exception class must be a subclass of BaseException"); goto raise_error; } } __Pyx_ErrRestore(type, value, tb); return; raise_error: Py_XDECREF(value); Py_XDECREF(type); Py_XDECREF(tb); return; } #else static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, PyObject *cause) { PyObject* owned_instance = NULL; if (tb == Py_None) { tb = 0; } else if (tb && !PyTraceBack_Check(tb)) { PyErr_SetString(PyExc_TypeError, "raise: arg 3 must be a traceback or None"); goto bad; } if (value == Py_None) value = 0; if (PyExceptionInstance_Check(type)) { if (value) { PyErr_SetString(PyExc_TypeError, "instance exception may not have a separate value"); goto bad; } value = type; type = (PyObject*) Py_TYPE(value); } else if (PyExceptionClass_Check(type)) { PyObject *instance_class = NULL; if (value && PyExceptionInstance_Check(value)) { instance_class = (PyObject*) Py_TYPE(value); if (instance_class != type) { int is_subclass = PyObject_IsSubclass(instance_class, type); if (!is_subclass) { instance_class = NULL; } else if (unlikely(is_subclass == -1)) { goto bad; } else { type = instance_class; } } } if (!instance_class) { PyObject *args; if (!value) args = PyTuple_New(0); else if (PyTuple_Check(value)) { Py_INCREF(value); args = value; } else args = PyTuple_Pack(1, value); if (!args) goto bad; owned_instance = PyObject_Call(type, args, NULL); Py_DECREF(args); if (!owned_instance) goto bad; value = owned_instance; if (!PyExceptionInstance_Check(value)) { PyErr_Format(PyExc_TypeError, "calling %R should have returned an instance of " "BaseException, not %R", type, Py_TYPE(value)); goto bad; } } } else { PyErr_SetString(PyExc_TypeError, "raise: exception class must be a subclass of BaseException"); goto bad; } #if PY_VERSION_HEX >= 0x03030000 if (cause) { #else if (cause && cause != Py_None) { #endif PyObject *fixed_cause; if (cause == Py_None) { fixed_cause = NULL; } else if (PyExceptionClass_Check(cause)) { fixed_cause = PyObject_CallObject(cause, NULL); if (fixed_cause == NULL) goto bad; } else if (PyExceptionInstance_Check(cause)) { fixed_cause = cause; Py_INCREF(fixed_cause); } else { PyErr_SetString(PyExc_TypeError, "exception causes must derive from " "BaseException"); goto bad; } PyException_SetCause(value, fixed_cause); } PyErr_SetObject(type, value); if (tb) { #if CYTHON_COMPILING_IN_PYPY PyObject *tmp_type, *tmp_value, *tmp_tb; PyErr_Fetch(&tmp_type, &tmp_value, &tmp_tb); Py_INCREF(tb); PyErr_Restore(tmp_type, tmp_value, tb); Py_XDECREF(tmp_tb); #else PyThreadState *tstate = PyThreadState_GET(); PyObject* tmp_tb = tstate->curexc_traceback; if (tb != tmp_tb) { Py_INCREF(tb); tstate->curexc_traceback = tb; Py_XDECREF(tmp_tb); } #endif } bad: Py_XDECREF(owned_instance); return; } #endif static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list, int level) { PyObject *empty_list = 0; PyObject *module = 0; PyObject *global_dict = 0; PyObject *empty_dict = 0; PyObject *list; #if PY_VERSION_HEX < 0x03030000 PyObject *py_import; py_import = __Pyx_PyObject_GetAttrStr(__pyx_b, __pyx_n_s_import); if (!py_import) goto bad; #endif if (from_list) list = from_list; else { empty_list = PyList_New(0); if (!empty_list) goto bad; list = empty_list; } global_dict = PyModule_GetDict(__pyx_m); if (!global_dict) goto bad; empty_dict = PyDict_New(); if (!empty_dict) goto bad; { #if PY_MAJOR_VERSION >= 3 if (level == -1) { if (strchr(__Pyx_MODULE_NAME, '.')) { #if PY_VERSION_HEX < 0x03030000 PyObject *py_level = PyInt_FromLong(1); if (!py_level) goto bad; module = PyObject_CallFunctionObjArgs(py_import, name, global_dict, empty_dict, list, py_level, NULL); Py_DECREF(py_level); #else module = PyImport_ImportModuleLevelObject( name, global_dict, empty_dict, list, 1); #endif if (!module) { if (!PyErr_ExceptionMatches(PyExc_ImportError)) goto bad; PyErr_Clear(); } } level = 0; } #endif if (!module) { #if PY_VERSION_HEX < 0x03030000 PyObject *py_level = PyInt_FromLong(level); if (!py_level) goto bad; module = PyObject_CallFunctionObjArgs(py_import, name, global_dict, empty_dict, list, py_level, NULL); Py_DECREF(py_level); #else module = PyImport_ImportModuleLevelObject( name, global_dict, empty_dict, list, level); #endif } } bad: #if PY_VERSION_HEX < 0x03030000 Py_XDECREF(py_import); #endif Py_XDECREF(empty_list); Py_XDECREF(empty_dict); return module; } static PyObject* __Pyx_ImportFrom(PyObject* module, PyObject* name) { PyObject* value = __Pyx_PyObject_GetAttrStr(module, name); if (unlikely(!value) && PyErr_ExceptionMatches(PyExc_AttributeError)) { PyErr_Format(PyExc_ImportError, #if PY_MAJOR_VERSION < 3 "cannot import name %.230s", PyString_AS_STRING(name)); #else "cannot import name %S", name); #endif } return value; } static int __pyx_bisect_code_objects(__Pyx_CodeObjectCacheEntry* entries, int count, int code_line) { int start = 0, mid = 0, end = count - 1; if (end >= 0 && code_line > entries[end].code_line) { return count; } while (start < end) { mid = start + (end - start) / 2; if (code_line < entries[mid].code_line) { end = mid; } else if (code_line > entries[mid].code_line) { start = mid + 1; } else { return mid; } } if (code_line <= entries[mid].code_line) { return mid; } else { return mid + 1; } } static PyCodeObject *__pyx_find_code_object(int code_line) { PyCodeObject* code_object; int pos; if (unlikely(!code_line) || unlikely(!__pyx_code_cache.entries)) { return NULL; } pos = __pyx_bisect_code_objects(__pyx_code_cache.entries, __pyx_code_cache.count, code_line); if (unlikely(pos >= __pyx_code_cache.count) || unlikely(__pyx_code_cache.entries[pos].code_line != code_line)) { return NULL; } code_object = __pyx_code_cache.entries[pos].code_object; Py_INCREF(code_object); return code_object; } static void __pyx_insert_code_object(int code_line, PyCodeObject* code_object) { int pos, i; __Pyx_CodeObjectCacheEntry* entries = __pyx_code_cache.entries; if (unlikely(!code_line)) { return; } if (unlikely(!entries)) { entries = (__Pyx_CodeObjectCacheEntry*)PyMem_Malloc(64*sizeof(__Pyx_CodeObjectCacheEntry)); if (likely(entries)) { __pyx_code_cache.entries = entries; __pyx_code_cache.max_count = 64; __pyx_code_cache.count = 1; entries[0].code_line = code_line; entries[0].code_object = code_object; Py_INCREF(code_object); } return; } pos = __pyx_bisect_code_objects(__pyx_code_cache.entries, __pyx_code_cache.count, code_line); if ((pos < __pyx_code_cache.count) && unlikely(__pyx_code_cache.entries[pos].code_line == code_line)) { PyCodeObject* tmp = entries[pos].code_object; entries[pos].code_object = code_object; Py_DECREF(tmp); return; } if (__pyx_code_cache.count == __pyx_code_cache.max_count) { int new_max = __pyx_code_cache.max_count + 64; entries = (__Pyx_CodeObjectCacheEntry*)PyMem_Realloc( __pyx_code_cache.entries, (size_t)new_max*sizeof(__Pyx_CodeObjectCacheEntry)); if (unlikely(!entries)) { return; } __pyx_code_cache.entries = entries; __pyx_code_cache.max_count = new_max; } for (i=__pyx_code_cache.count; i>pos; i--) { entries[i] = entries[i-1]; } entries[pos].code_line = code_line; entries[pos].code_object = code_object; __pyx_code_cache.count++; Py_INCREF(code_object); } #include "compile.h" #include "frameobject.h" #include "traceback.h" static PyCodeObject* __Pyx_CreateCodeObjectForTraceback( const char *funcname, int c_line, int py_line, const char *filename) { PyCodeObject *py_code = 0; PyObject *py_srcfile = 0; PyObject *py_funcname = 0; #if PY_MAJOR_VERSION < 3 py_srcfile = PyString_FromString(filename); #else py_srcfile = PyUnicode_FromString(filename); #endif if (!py_srcfile) goto bad; if (c_line) { #if PY_MAJOR_VERSION < 3 py_funcname = PyString_FromFormat( "%s (%s:%d)", funcname, __pyx_cfilenm, c_line); #else py_funcname = PyUnicode_FromFormat( "%s (%s:%d)", funcname, __pyx_cfilenm, c_line); #endif } else { #if PY_MAJOR_VERSION < 3 py_funcname = PyString_FromString(funcname); #else py_funcname = PyUnicode_FromString(funcname); #endif } if (!py_funcname) goto bad; py_code = __Pyx_PyCode_New( 0, 0, 0, 0, 0, __pyx_empty_bytes, /*PyObject *code,*/ __pyx_empty_tuple, /*PyObject *consts,*/ __pyx_empty_tuple, /*PyObject *names,*/ __pyx_empty_tuple, /*PyObject *varnames,*/ __pyx_empty_tuple, /*PyObject *freevars,*/ __pyx_empty_tuple, /*PyObject *cellvars,*/ py_srcfile, /*PyObject *filename,*/ py_funcname, /*PyObject *name,*/ py_line, __pyx_empty_bytes /*PyObject *lnotab*/ ); Py_DECREF(py_srcfile); Py_DECREF(py_funcname); return py_code; bad: Py_XDECREF(py_srcfile); Py_XDECREF(py_funcname); return NULL; } static void __Pyx_AddTraceback(const char *funcname, int c_line, int py_line, const char *filename) { PyCodeObject *py_code = 0; PyFrameObject *py_frame = 0; py_code = __pyx_find_code_object(c_line ? c_line : py_line); if (!py_code) { py_code = __Pyx_CreateCodeObjectForTraceback( funcname, c_line, py_line, filename); if (!py_code) goto bad; __pyx_insert_code_object(c_line ? c_line : py_line, py_code); } py_frame = PyFrame_New( PyThreadState_GET(), /*PyThreadState *tstate,*/ py_code, /*PyCodeObject *code,*/ __pyx_d, /*PyObject *globals,*/ 0 /*PyObject *locals*/ ); if (!py_frame) goto bad; py_frame->f_lineno = py_line; PyTraceBack_Here(py_frame); bad: Py_XDECREF(py_code); Py_XDECREF(py_frame); } #define __PYX_VERIFY_RETURN_INT(target_type, func_type, func_value)\ __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, 0) #define __PYX_VERIFY_RETURN_INT_EXC(target_type, func_type, func_value)\ __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, 1) #define __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, exc)\ {\ func_type value = func_value;\ if (sizeof(target_type) < sizeof(func_type)) {\ if (unlikely(value != (func_type) (target_type) value)) {\ func_type zero = 0;\ if (exc && unlikely(value == (func_type)-1 && PyErr_Occurred()))\ return (target_type) -1;\ if (is_unsigned && unlikely(value < zero))\ goto raise_neg_overflow;\ else\ goto raise_overflow;\ }\ }\ return (target_type) value;\ } #if CYTHON_USE_PYLONG_INTERNALS #include "longintrepr.h" #endif static CYTHON_INLINE int64_t __Pyx_PyInt_As_int64_t(PyObject *x) { const int64_t neg_one = (int64_t) -1, const_zero = (int64_t) 0; const int is_unsigned = neg_one > const_zero; #if PY_MAJOR_VERSION < 3 if (likely(PyInt_Check(x))) { if (sizeof(int64_t) < sizeof(long)) { __PYX_VERIFY_RETURN_INT(int64_t, long, PyInt_AS_LONG(x)) } else { long val = PyInt_AS_LONG(x); if (is_unsigned && unlikely(val < 0)) { goto raise_neg_overflow; } return (int64_t) val; } } else #endif if (likely(PyLong_Check(x))) { if (is_unsigned) { #if CYTHON_USE_PYLONG_INTERNALS const digit* digits = ((PyLongObject*)x)->ob_digit; switch (Py_SIZE(x)) { case 0: return (int64_t) 0; case 1: __PYX_VERIFY_RETURN_INT(int64_t, digit, digits[0]) case 2: if (8 * sizeof(int64_t) > 1 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(int64_t, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(int64_t) >= 2 * PyLong_SHIFT) { return (int64_t) (((((int64_t)digits[1]) << PyLong_SHIFT) | (int64_t)digits[0])); } } break; case 3: if (8 * sizeof(int64_t) > 2 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(int64_t, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(int64_t) >= 3 * PyLong_SHIFT) { return (int64_t) (((((((int64_t)digits[2]) << PyLong_SHIFT) | (int64_t)digits[1]) << PyLong_SHIFT) | (int64_t)digits[0])); } } break; case 4: if (8 * sizeof(int64_t) > 3 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(int64_t, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(int64_t) >= 4 * PyLong_SHIFT) { return (int64_t) (((((((((int64_t)digits[3]) << PyLong_SHIFT) | (int64_t)digits[2]) << PyLong_SHIFT) | (int64_t)digits[1]) << PyLong_SHIFT) | (int64_t)digits[0])); } } break; } #endif #if CYTHON_COMPILING_IN_CPYTHON if (unlikely(Py_SIZE(x) < 0)) { goto raise_neg_overflow; } #else { int result = PyObject_RichCompareBool(x, Py_False, Py_LT); if (unlikely(result < 0)) return (int64_t) -1; if (unlikely(result == 1)) goto raise_neg_overflow; } #endif if (sizeof(int64_t) <= sizeof(unsigned long)) { __PYX_VERIFY_RETURN_INT_EXC(int64_t, unsigned long, PyLong_AsUnsignedLong(x)) } else if (sizeof(int64_t) <= sizeof(unsigned PY_LONG_LONG)) { __PYX_VERIFY_RETURN_INT_EXC(int64_t, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x)) } } else { #if CYTHON_USE_PYLONG_INTERNALS const digit* digits = ((PyLongObject*)x)->ob_digit; switch (Py_SIZE(x)) { case 0: return (int64_t) 0; case -1: __PYX_VERIFY_RETURN_INT(int64_t, sdigit, (sdigit) (-(sdigit)digits[0])) case 1: __PYX_VERIFY_RETURN_INT(int64_t, digit, +digits[0]) case -2: if (8 * sizeof(int64_t) - 1 > 1 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(int64_t, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(int64_t) - 1 > 2 * PyLong_SHIFT) { return (int64_t) (((int64_t)-1)*(((((int64_t)digits[1]) << PyLong_SHIFT) | (int64_t)digits[0]))); } } break; case 2: if (8 * sizeof(int64_t) > 1 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(int64_t, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(int64_t) - 1 > 2 * PyLong_SHIFT) { return (int64_t) ((((((int64_t)digits[1]) << PyLong_SHIFT) | (int64_t)digits[0]))); } } break; case -3: if (8 * sizeof(int64_t) - 1 > 2 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(int64_t, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(int64_t) - 1 > 3 * PyLong_SHIFT) { return (int64_t) (((int64_t)-1)*(((((((int64_t)digits[2]) << PyLong_SHIFT) | (int64_t)digits[1]) << PyLong_SHIFT) | (int64_t)digits[0]))); } } break; case 3: if (8 * sizeof(int64_t) > 2 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(int64_t, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(int64_t) - 1 > 3 * PyLong_SHIFT) { return (int64_t) ((((((((int64_t)digits[2]) << PyLong_SHIFT) | (int64_t)digits[1]) << PyLong_SHIFT) | (int64_t)digits[0]))); } } break; case -4: if (8 * sizeof(int64_t) - 1 > 3 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(int64_t, long, -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(int64_t) - 1 > 4 * PyLong_SHIFT) { return (int64_t) (((int64_t)-1)*(((((((((int64_t)digits[3]) << PyLong_SHIFT) | (int64_t)digits[2]) << PyLong_SHIFT) | (int64_t)digits[1]) << PyLong_SHIFT) | (int64_t)digits[0]))); } } break; case 4: if (8 * sizeof(int64_t) > 3 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(int64_t, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(int64_t) - 1 > 4 * PyLong_SHIFT) { return (int64_t) ((((((((((int64_t)digits[3]) << PyLong_SHIFT) | (int64_t)digits[2]) << PyLong_SHIFT) | (int64_t)digits[1]) << PyLong_SHIFT) | (int64_t)digits[0]))); } } break; } #endif if (sizeof(int64_t) <= sizeof(long)) { __PYX_VERIFY_RETURN_INT_EXC(int64_t, long, PyLong_AsLong(x)) } else if (sizeof(int64_t) <= sizeof(PY_LONG_LONG)) { __PYX_VERIFY_RETURN_INT_EXC(int64_t, PY_LONG_LONG, PyLong_AsLongLong(x)) } } { #if CYTHON_COMPILING_IN_PYPY && !defined(_PyLong_AsByteArray) PyErr_SetString(PyExc_RuntimeError, "_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers"); #else int64_t val; PyObject *v = __Pyx_PyNumber_Int(x); #if PY_MAJOR_VERSION < 3 if (likely(v) && !PyLong_Check(v)) { PyObject *tmp = v; v = PyNumber_Long(tmp); Py_DECREF(tmp); } #endif if (likely(v)) { int one = 1; int is_little = (int)*(unsigned char *)&one; unsigned char *bytes = (unsigned char *)&val; int ret = _PyLong_AsByteArray((PyLongObject *)v, bytes, sizeof(val), is_little, !is_unsigned); Py_DECREF(v); if (likely(!ret)) return val; } #endif return (int64_t) -1; } } else { int64_t val; PyObject *tmp = __Pyx_PyNumber_Int(x); if (!tmp) return (int64_t) -1; val = __Pyx_PyInt_As_int64_t(tmp); Py_DECREF(tmp); return val; } raise_overflow: PyErr_SetString(PyExc_OverflowError, "value too large to convert to int64_t"); return (int64_t) -1; raise_neg_overflow: PyErr_SetString(PyExc_OverflowError, "can't convert negative value to int64_t"); return (int64_t) -1; } static CYTHON_INLINE PyObject* __Pyx_PyInt_From_int64_t(int64_t value) { const int64_t neg_one = (int64_t) -1, const_zero = (int64_t) 0; const int is_unsigned = neg_one > const_zero; if (is_unsigned) { if (sizeof(int64_t) < sizeof(long)) { return PyInt_FromLong((long) value); } else if (sizeof(int64_t) <= sizeof(unsigned long)) { return PyLong_FromUnsignedLong((unsigned long) value); } else if (sizeof(int64_t) <= sizeof(unsigned PY_LONG_LONG)) { return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value); } } else { if (sizeof(int64_t) <= sizeof(long)) { return PyInt_FromLong((long) value); } else if (sizeof(int64_t) <= sizeof(PY_LONG_LONG)) { return PyLong_FromLongLong((PY_LONG_LONG) value); } } { int one = 1; int little = (int)*(unsigned char *)&one; unsigned char *bytes = (unsigned char *)&value; return _PyLong_FromByteArray(bytes, sizeof(int64_t), little, !is_unsigned); } } static CYTHON_INLINE PyObject* __Pyx_PyInt_From_int(int value) { const int neg_one = (int) -1, const_zero = (int) 0; const int is_unsigned = neg_one > const_zero; if (is_unsigned) { if (sizeof(int) < sizeof(long)) { return PyInt_FromLong((long) value); } else if (sizeof(int) <= sizeof(unsigned long)) { return PyLong_FromUnsignedLong((unsigned long) value); } else if (sizeof(int) <= sizeof(unsigned PY_LONG_LONG)) { return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value); } } else { if (sizeof(int) <= sizeof(long)) { return PyInt_FromLong((long) value); } else if (sizeof(int) <= sizeof(PY_LONG_LONG)) { return PyLong_FromLongLong((PY_LONG_LONG) value); } } { int one = 1; int little = (int)*(unsigned char *)&one; unsigned char *bytes = (unsigned char *)&value; return _PyLong_FromByteArray(bytes, sizeof(int), little, !is_unsigned); } } static CYTHON_INLINE PyObject* __Pyx_PyInt_From_long(long value) { const long neg_one = (long) -1, const_zero = (long) 0; const int is_unsigned = neg_one > const_zero; if (is_unsigned) { if (sizeof(long) < sizeof(long)) { return PyInt_FromLong((long) value); } else if (sizeof(long) <= sizeof(unsigned long)) { return PyLong_FromUnsignedLong((unsigned long) value); } else if (sizeof(long) <= sizeof(unsigned PY_LONG_LONG)) { return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value); } } else { if (sizeof(long) <= sizeof(long)) { return PyInt_FromLong((long) value); } else if (sizeof(long) <= sizeof(PY_LONG_LONG)) { return PyLong_FromLongLong((PY_LONG_LONG) value); } } { int one = 1; int little = (int)*(unsigned char *)&one; unsigned char *bytes = (unsigned char *)&value; return _PyLong_FromByteArray(bytes, sizeof(long), little, !is_unsigned); } } static CYTHON_INLINE long __Pyx_PyInt_As_long(PyObject *x) { const long neg_one = (long) -1, const_zero = (long) 0; const int is_unsigned = neg_one > const_zero; #if PY_MAJOR_VERSION < 3 if (likely(PyInt_Check(x))) { if (sizeof(long) < sizeof(long)) { __PYX_VERIFY_RETURN_INT(long, long, PyInt_AS_LONG(x)) } else { long val = PyInt_AS_LONG(x); if (is_unsigned && unlikely(val < 0)) { goto raise_neg_overflow; } return (long) val; } } else #endif if (likely(PyLong_Check(x))) { if (is_unsigned) { #if CYTHON_USE_PYLONG_INTERNALS const digit* digits = ((PyLongObject*)x)->ob_digit; switch (Py_SIZE(x)) { case 0: return (long) 0; case 1: __PYX_VERIFY_RETURN_INT(long, digit, digits[0]) case 2: if (8 * sizeof(long) > 1 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(long) >= 2 * PyLong_SHIFT) { return (long) (((((long)digits[1]) << PyLong_SHIFT) | (long)digits[0])); } } break; case 3: if (8 * sizeof(long) > 2 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(long) >= 3 * PyLong_SHIFT) { return (long) (((((((long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0])); } } break; case 4: if (8 * sizeof(long) > 3 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(long) >= 4 * PyLong_SHIFT) { return (long) (((((((((long)digits[3]) << PyLong_SHIFT) | (long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0])); } } break; } #endif #if CYTHON_COMPILING_IN_CPYTHON if (unlikely(Py_SIZE(x) < 0)) { goto raise_neg_overflow; } #else { int result = PyObject_RichCompareBool(x, Py_False, Py_LT); if (unlikely(result < 0)) return (long) -1; if (unlikely(result == 1)) goto raise_neg_overflow; } #endif if (sizeof(long) <= sizeof(unsigned long)) { __PYX_VERIFY_RETURN_INT_EXC(long, unsigned long, PyLong_AsUnsignedLong(x)) } else if (sizeof(long) <= sizeof(unsigned PY_LONG_LONG)) { __PYX_VERIFY_RETURN_INT_EXC(long, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x)) } } else { #if CYTHON_USE_PYLONG_INTERNALS const digit* digits = ((PyLongObject*)x)->ob_digit; switch (Py_SIZE(x)) { case 0: return (long) 0; case -1: __PYX_VERIFY_RETURN_INT(long, sdigit, (sdigit) (-(sdigit)digits[0])) case 1: __PYX_VERIFY_RETURN_INT(long, digit, +digits[0]) case -2: if (8 * sizeof(long) - 1 > 1 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(long, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) { return (long) (((long)-1)*(((((long)digits[1]) << PyLong_SHIFT) | (long)digits[0]))); } } break; case 2: if (8 * sizeof(long) > 1 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) { return (long) ((((((long)digits[1]) << PyLong_SHIFT) | (long)digits[0]))); } } break; case -3: if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(long, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) { return (long) (((long)-1)*(((((((long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0]))); } } break; case 3: if (8 * sizeof(long) > 2 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) { return (long) ((((((((long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0]))); } } break; case -4: if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(long, long, -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(long) - 1 > 4 * PyLong_SHIFT) { return (long) (((long)-1)*(((((((((long)digits[3]) << PyLong_SHIFT) | (long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0]))); } } break; case 4: if (8 * sizeof(long) > 3 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(long) - 1 > 4 * PyLong_SHIFT) { return (long) ((((((((((long)digits[3]) << PyLong_SHIFT) | (long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0]))); } } break; } #endif if (sizeof(long) <= sizeof(long)) { __PYX_VERIFY_RETURN_INT_EXC(long, long, PyLong_AsLong(x)) } else if (sizeof(long) <= sizeof(PY_LONG_LONG)) { __PYX_VERIFY_RETURN_INT_EXC(long, PY_LONG_LONG, PyLong_AsLongLong(x)) } } { #if CYTHON_COMPILING_IN_PYPY && !defined(_PyLong_AsByteArray) PyErr_SetString(PyExc_RuntimeError, "_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers"); #else long val; PyObject *v = __Pyx_PyNumber_Int(x); #if PY_MAJOR_VERSION < 3 if (likely(v) && !PyLong_Check(v)) { PyObject *tmp = v; v = PyNumber_Long(tmp); Py_DECREF(tmp); } #endif if (likely(v)) { int one = 1; int is_little = (int)*(unsigned char *)&one; unsigned char *bytes = (unsigned char *)&val; int ret = _PyLong_AsByteArray((PyLongObject *)v, bytes, sizeof(val), is_little, !is_unsigned); Py_DECREF(v); if (likely(!ret)) return val; } #endif return (long) -1; } } else { long val; PyObject *tmp = __Pyx_PyNumber_Int(x); if (!tmp) return (long) -1; val = __Pyx_PyInt_As_long(tmp); Py_DECREF(tmp); return val; } raise_overflow: PyErr_SetString(PyExc_OverflowError, "value too large to convert to long"); return (long) -1; raise_neg_overflow: PyErr_SetString(PyExc_OverflowError, "can't convert negative value to long"); return (long) -1; } static CYTHON_INLINE int __Pyx_PyInt_As_int(PyObject *x) { const int neg_one = (int) -1, const_zero = (int) 0; const int is_unsigned = neg_one > const_zero; #if PY_MAJOR_VERSION < 3 if (likely(PyInt_Check(x))) { if (sizeof(int) < sizeof(long)) { __PYX_VERIFY_RETURN_INT(int, long, PyInt_AS_LONG(x)) } else { long val = PyInt_AS_LONG(x); if (is_unsigned && unlikely(val < 0)) { goto raise_neg_overflow; } return (int) val; } } else #endif if (likely(PyLong_Check(x))) { if (is_unsigned) { #if CYTHON_USE_PYLONG_INTERNALS const digit* digits = ((PyLongObject*)x)->ob_digit; switch (Py_SIZE(x)) { case 0: return (int) 0; case 1: __PYX_VERIFY_RETURN_INT(int, digit, digits[0]) case 2: if (8 * sizeof(int) > 1 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(int) >= 2 * PyLong_SHIFT) { return (int) (((((int)digits[1]) << PyLong_SHIFT) | (int)digits[0])); } } break; case 3: if (8 * sizeof(int) > 2 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(int) >= 3 * PyLong_SHIFT) { return (int) (((((((int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0])); } } break; case 4: if (8 * sizeof(int) > 3 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(int) >= 4 * PyLong_SHIFT) { return (int) (((((((((int)digits[3]) << PyLong_SHIFT) | (int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0])); } } break; } #endif #if CYTHON_COMPILING_IN_CPYTHON if (unlikely(Py_SIZE(x) < 0)) { goto raise_neg_overflow; } #else { int result = PyObject_RichCompareBool(x, Py_False, Py_LT); if (unlikely(result < 0)) return (int) -1; if (unlikely(result == 1)) goto raise_neg_overflow; } #endif if (sizeof(int) <= sizeof(unsigned long)) { __PYX_VERIFY_RETURN_INT_EXC(int, unsigned long, PyLong_AsUnsignedLong(x)) } else if (sizeof(int) <= sizeof(unsigned PY_LONG_LONG)) { __PYX_VERIFY_RETURN_INT_EXC(int, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x)) } } else { #if CYTHON_USE_PYLONG_INTERNALS const digit* digits = ((PyLongObject*)x)->ob_digit; switch (Py_SIZE(x)) { case 0: return (int) 0; case -1: __PYX_VERIFY_RETURN_INT(int, sdigit, (sdigit) (-(sdigit)digits[0])) case 1: __PYX_VERIFY_RETURN_INT(int, digit, +digits[0]) case -2: if (8 * sizeof(int) - 1 > 1 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(int, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(int) - 1 > 2 * PyLong_SHIFT) { return (int) (((int)-1)*(((((int)digits[1]) << PyLong_SHIFT) | (int)digits[0]))); } } break; case 2: if (8 * sizeof(int) > 1 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(int) - 1 > 2 * PyLong_SHIFT) { return (int) ((((((int)digits[1]) << PyLong_SHIFT) | (int)digits[0]))); } } break; case -3: if (8 * sizeof(int) - 1 > 2 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(int, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(int) - 1 > 3 * PyLong_SHIFT) { return (int) (((int)-1)*(((((((int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0]))); } } break; case 3: if (8 * sizeof(int) > 2 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(int) - 1 > 3 * PyLong_SHIFT) { return (int) ((((((((int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0]))); } } break; case -4: if (8 * sizeof(int) - 1 > 3 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(int, long, -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(int) - 1 > 4 * PyLong_SHIFT) { return (int) (((int)-1)*(((((((((int)digits[3]) << PyLong_SHIFT) | (int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0]))); } } break; case 4: if (8 * sizeof(int) > 3 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(int) - 1 > 4 * PyLong_SHIFT) { return (int) ((((((((((int)digits[3]) << PyLong_SHIFT) | (int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0]))); } } break; } #endif if (sizeof(int) <= sizeof(long)) { __PYX_VERIFY_RETURN_INT_EXC(int, long, PyLong_AsLong(x)) } else if (sizeof(int) <= sizeof(PY_LONG_LONG)) { __PYX_VERIFY_RETURN_INT_EXC(int, PY_LONG_LONG, PyLong_AsLongLong(x)) } } { #if CYTHON_COMPILING_IN_PYPY && !defined(_PyLong_AsByteArray) PyErr_SetString(PyExc_RuntimeError, "_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers"); #else int val; PyObject *v = __Pyx_PyNumber_Int(x); #if PY_MAJOR_VERSION < 3 if (likely(v) && !PyLong_Check(v)) { PyObject *tmp = v; v = PyNumber_Long(tmp); Py_DECREF(tmp); } #endif if (likely(v)) { int one = 1; int is_little = (int)*(unsigned char *)&one; unsigned char *bytes = (unsigned char *)&val; int ret = _PyLong_AsByteArray((PyLongObject *)v, bytes, sizeof(val), is_little, !is_unsigned); Py_DECREF(v); if (likely(!ret)) return val; } #endif return (int) -1; } } else { int val; PyObject *tmp = __Pyx_PyNumber_Int(x); if (!tmp) return (int) -1; val = __Pyx_PyInt_As_int(tmp); Py_DECREF(tmp); return val; } raise_overflow: PyErr_SetString(PyExc_OverflowError, "value too large to convert to int"); return (int) -1; raise_neg_overflow: PyErr_SetString(PyExc_OverflowError, "can't convert negative value to int"); return (int) -1; } static int __Pyx_check_binary_version(void) { char ctversion[4], rtversion[4]; PyOS_snprintf(ctversion, 4, "%d.%d", PY_MAJOR_VERSION, PY_MINOR_VERSION); PyOS_snprintf(rtversion, 4, "%s", Py_GetVersion()); if (ctversion[0] != rtversion[0] || ctversion[2] != rtversion[2]) { char message[200]; PyOS_snprintf(message, sizeof(message), "compiletime version %s of module '%.100s' " "does not match runtime version %s", ctversion, __Pyx_MODULE_NAME, rtversion); return PyErr_WarnEx(NULL, message, 1); } return 0; } static int __Pyx_ExportFunction(const char *name, void (*f)(void), const char *sig) { PyObject *d = 0; PyObject *cobj = 0; union { void (*fp)(void); void *p; } tmp; d = PyObject_GetAttrString(__pyx_m, (char *)"__pyx_capi__"); if (!d) { PyErr_Clear(); d = PyDict_New(); if (!d) goto bad; Py_INCREF(d); if (PyModule_AddObject(__pyx_m, (char *)"__pyx_capi__", d) < 0) goto bad; } tmp.fp = f; #if PY_VERSION_HEX >= 0x02070000 cobj = PyCapsule_New(tmp.p, sig, 0); #else cobj = PyCObject_FromVoidPtrAndDesc(tmp.p, (void *)sig, 0); #endif if (!cobj) goto bad; if (PyDict_SetItemString(d, name, cobj) < 0) goto bad; Py_DECREF(cobj); Py_DECREF(d); return 0; bad: Py_XDECREF(cobj); Py_XDECREF(d); return -1; } #ifndef __PYX_HAVE_RT_ImportModule #define __PYX_HAVE_RT_ImportModule static PyObject *__Pyx_ImportModule(const char *name) { PyObject *py_name = 0; PyObject *py_module = 0; py_name = __Pyx_PyIdentifier_FromString(name); if (!py_name) goto bad; py_module = PyImport_Import(py_name); Py_DECREF(py_name); return py_module; bad: Py_XDECREF(py_name); return 0; } #endif #ifndef __PYX_HAVE_RT_ImportType #define __PYX_HAVE_RT_ImportType static PyTypeObject *__Pyx_ImportType(const char *module_name, const char *class_name, size_t size, int strict) { PyObject *py_module = 0; PyObject *result = 0; PyObject *py_name = 0; char warning[200]; Py_ssize_t basicsize; #ifdef Py_LIMITED_API PyObject *py_basicsize; #endif py_module = __Pyx_ImportModule(module_name); if (!py_module) goto bad; py_name = __Pyx_PyIdentifier_FromString(class_name); if (!py_name) goto bad; result = PyObject_GetAttr(py_module, py_name); Py_DECREF(py_name); py_name = 0; Py_DECREF(py_module); py_module = 0; if (!result) goto bad; if (!PyType_Check(result)) { PyErr_Format(PyExc_TypeError, "%.200s.%.200s is not a type object", module_name, class_name); goto bad; } #ifndef Py_LIMITED_API basicsize = ((PyTypeObject *)result)->tp_basicsize; #else py_basicsize = PyObject_GetAttrString(result, "__basicsize__"); if (!py_basicsize) goto bad; basicsize = PyLong_AsSsize_t(py_basicsize); Py_DECREF(py_basicsize); py_basicsize = 0; if (basicsize == (Py_ssize_t)-1 && PyErr_Occurred()) goto bad; #endif if (!strict && (size_t)basicsize > size) { PyOS_snprintf(warning, sizeof(warning), "%s.%s size changed, may indicate binary incompatibility", module_name, class_name); if (PyErr_WarnEx(NULL, warning, 0) < 0) goto bad; } else if ((size_t)basicsize != size) { PyErr_Format(PyExc_ValueError, "%.200s.%.200s has the wrong size, try recompiling", module_name, class_name); goto bad; } return (PyTypeObject *)result; bad: Py_XDECREF(py_module); Py_XDECREF(result); return NULL; } #endif static int __Pyx_InitStrings(__Pyx_StringTabEntry *t) { while (t->p) { #if PY_MAJOR_VERSION < 3 if (t->is_unicode) { *t->p = PyUnicode_DecodeUTF8(t->s, t->n - 1, NULL); } else if (t->intern) { *t->p = PyString_InternFromString(t->s); } else { *t->p = PyString_FromStringAndSize(t->s, t->n - 1); } #else if (t->is_unicode | t->is_str) { if (t->intern) { *t->p = PyUnicode_InternFromString(t->s); } else if (t->encoding) { *t->p = PyUnicode_Decode(t->s, t->n - 1, t->encoding, NULL); } else { *t->p = PyUnicode_FromStringAndSize(t->s, t->n - 1); } } else { *t->p = PyBytes_FromStringAndSize(t->s, t->n - 1); } #endif if (!*t->p) return -1; ++t; } return 0; } static CYTHON_INLINE PyObject* __Pyx_PyUnicode_FromString(const char* c_str) { return __Pyx_PyUnicode_FromStringAndSize(c_str, (Py_ssize_t)strlen(c_str)); } static CYTHON_INLINE char* __Pyx_PyObject_AsString(PyObject* o) { Py_ssize_t ignore; return __Pyx_PyObject_AsStringAndSize(o, &ignore); } static CYTHON_INLINE char* __Pyx_PyObject_AsStringAndSize(PyObject* o, Py_ssize_t *length) { #if CYTHON_COMPILING_IN_CPYTHON && (__PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT) if ( #if PY_MAJOR_VERSION < 3 && __PYX_DEFAULT_STRING_ENCODING_IS_ASCII __Pyx_sys_getdefaultencoding_not_ascii && #endif PyUnicode_Check(o)) { #if PY_VERSION_HEX < 0x03030000 char* defenc_c; PyObject* defenc = _PyUnicode_AsDefaultEncodedString(o, NULL); if (!defenc) return NULL; defenc_c = PyBytes_AS_STRING(defenc); #if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII { char* end = defenc_c + PyBytes_GET_SIZE(defenc); char* c; for (c = defenc_c; c < end; c++) { if ((unsigned char) (*c) >= 128) { PyUnicode_AsASCIIString(o); return NULL; } } } #endif *length = PyBytes_GET_SIZE(defenc); return defenc_c; #else if (__Pyx_PyUnicode_READY(o) == -1) return NULL; #if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII if (PyUnicode_IS_ASCII(o)) { *length = PyUnicode_GET_LENGTH(o); return PyUnicode_AsUTF8(o); } else { PyUnicode_AsASCIIString(o); return NULL; } #else return PyUnicode_AsUTF8AndSize(o, length); #endif #endif } else #endif #if (!CYTHON_COMPILING_IN_PYPY) || (defined(PyByteArray_AS_STRING) && defined(PyByteArray_GET_SIZE)) if (PyByteArray_Check(o)) { *length = PyByteArray_GET_SIZE(o); return PyByteArray_AS_STRING(o); } else #endif { char* result; int r = PyBytes_AsStringAndSize(o, &result, length); if (unlikely(r < 0)) { return NULL; } else { return result; } } } static CYTHON_INLINE int __Pyx_PyObject_IsTrue(PyObject* x) { int is_true = x == Py_True; if (is_true | (x == Py_False) | (x == Py_None)) return is_true; else return PyObject_IsTrue(x); } static CYTHON_INLINE PyObject* __Pyx_PyNumber_Int(PyObject* x) { PyNumberMethods *m; const char *name = NULL; PyObject *res = NULL; #if PY_MAJOR_VERSION < 3 if (PyInt_Check(x) || PyLong_Check(x)) #else if (PyLong_Check(x)) #endif return __Pyx_NewRef(x); m = Py_TYPE(x)->tp_as_number; #if PY_MAJOR_VERSION < 3 if (m && m->nb_int) { name = "int"; res = PyNumber_Int(x); } else if (m && m->nb_long) { name = "long"; res = PyNumber_Long(x); } #else if (m && m->nb_int) { name = "int"; res = PyNumber_Long(x); } #endif if (res) { #if PY_MAJOR_VERSION < 3 if (!PyInt_Check(res) && !PyLong_Check(res)) { #else if (!PyLong_Check(res)) { #endif PyErr_Format(PyExc_TypeError, "__%.4s__ returned non-%.4s (type %.200s)", name, name, Py_TYPE(res)->tp_name); Py_DECREF(res); return NULL; } } else if (!PyErr_Occurred()) { PyErr_SetString(PyExc_TypeError, "an integer is required"); } return res; } static CYTHON_INLINE Py_ssize_t __Pyx_PyIndex_AsSsize_t(PyObject* b) { Py_ssize_t ival; PyObject *x; #if PY_MAJOR_VERSION < 3 if (likely(PyInt_CheckExact(b))) { if (sizeof(Py_ssize_t) >= sizeof(long)) return PyInt_AS_LONG(b); else return PyInt_AsSsize_t(x); } #endif if (likely(PyLong_CheckExact(b))) { #if CYTHON_USE_PYLONG_INTERNALS const digit* digits = ((PyLongObject*)b)->ob_digit; const Py_ssize_t size = Py_SIZE(b); if (likely(__Pyx_sst_abs(size) <= 1)) { ival = likely(size) ? digits[0] : 0; if (size == -1) ival = -ival; return ival; } else { switch (size) { case 2: if (8 * sizeof(Py_ssize_t) > 2 * PyLong_SHIFT) { return (Py_ssize_t) (((((size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])); } break; case -2: if (8 * sizeof(Py_ssize_t) > 2 * PyLong_SHIFT) { return -(Py_ssize_t) (((((size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])); } break; case 3: if (8 * sizeof(Py_ssize_t) > 3 * PyLong_SHIFT) { return (Py_ssize_t) (((((((size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])); } break; case -3: if (8 * sizeof(Py_ssize_t) > 3 * PyLong_SHIFT) { return -(Py_ssize_t) (((((((size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])); } break; case 4: if (8 * sizeof(Py_ssize_t) > 4 * PyLong_SHIFT) { return (Py_ssize_t) (((((((((size_t)digits[3]) << PyLong_SHIFT) | (size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])); } break; case -4: if (8 * sizeof(Py_ssize_t) > 4 * PyLong_SHIFT) { return -(Py_ssize_t) (((((((((size_t)digits[3]) << PyLong_SHIFT) | (size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])); } break; } } #endif return PyLong_AsSsize_t(b); } x = PyNumber_Index(b); if (!x) return -1; ival = PyInt_AsSsize_t(x); Py_DECREF(x); return ival; } static CYTHON_INLINE PyObject * __Pyx_PyInt_FromSize_t(size_t ival) { return PyInt_FromSize_t(ival); } #endif /* Py_PYTHON_H */ pygame_sdl2-2.1.0-for-renpy-6.99.14.1/gen/pygame_sdl2.mouse.c0000664000175000017500000035267712660477772022566 0ustar tomtom00000000000000/* Generated by Cython 0.23.4 */ #define PY_SSIZE_T_CLEAN #include "Python.h" #ifndef Py_PYTHON_H #error Python headers needed to compile C extensions, please install development version of Python. #elif PY_VERSION_HEX < 0x02060000 || (0x03000000 <= PY_VERSION_HEX && PY_VERSION_HEX < 0x03020000) #error Cython requires Python 2.6+ or Python 3.2+. #else #define CYTHON_ABI "0_23_4" #include #ifndef offsetof #define offsetof(type, member) ( (size_t) & ((type*)0) -> member ) #endif #if !defined(WIN32) && !defined(MS_WINDOWS) #ifndef __stdcall #define __stdcall #endif #ifndef __cdecl #define __cdecl #endif #ifndef __fastcall #define __fastcall #endif #endif #ifndef DL_IMPORT #define DL_IMPORT(t) t #endif #ifndef DL_EXPORT #define DL_EXPORT(t) t #endif #ifndef PY_LONG_LONG #define PY_LONG_LONG LONG_LONG #endif #ifndef Py_HUGE_VAL #define Py_HUGE_VAL HUGE_VAL #endif #ifdef PYPY_VERSION #define CYTHON_COMPILING_IN_PYPY 1 #define CYTHON_COMPILING_IN_CPYTHON 0 #else #define CYTHON_COMPILING_IN_PYPY 0 #define CYTHON_COMPILING_IN_CPYTHON 1 #endif #if !defined(CYTHON_USE_PYLONG_INTERNALS) && CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x02070000 #define CYTHON_USE_PYLONG_INTERNALS 1 #endif #if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX < 0x02070600 && !defined(Py_OptimizeFlag) #define Py_OptimizeFlag 0 #endif #define __PYX_BUILD_PY_SSIZE_T "n" #define CYTHON_FORMAT_SSIZE_T "z" #if PY_MAJOR_VERSION < 3 #define __Pyx_BUILTIN_MODULE_NAME "__builtin__" #define __Pyx_PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)\ PyCode_New(a+k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos) #define __Pyx_DefaultClassType PyClass_Type #else #define __Pyx_BUILTIN_MODULE_NAME "builtins" #define __Pyx_PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)\ PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos) #define __Pyx_DefaultClassType PyType_Type #endif #ifndef Py_TPFLAGS_CHECKTYPES #define Py_TPFLAGS_CHECKTYPES 0 #endif #ifndef Py_TPFLAGS_HAVE_INDEX #define Py_TPFLAGS_HAVE_INDEX 0 #endif #ifndef Py_TPFLAGS_HAVE_NEWBUFFER #define Py_TPFLAGS_HAVE_NEWBUFFER 0 #endif #ifndef Py_TPFLAGS_HAVE_FINALIZE #define Py_TPFLAGS_HAVE_FINALIZE 0 #endif #if PY_VERSION_HEX > 0x03030000 && defined(PyUnicode_KIND) #define CYTHON_PEP393_ENABLED 1 #define __Pyx_PyUnicode_READY(op) (likely(PyUnicode_IS_READY(op)) ?\ 0 : _PyUnicode_Ready((PyObject *)(op))) #define __Pyx_PyUnicode_GET_LENGTH(u) PyUnicode_GET_LENGTH(u) #define __Pyx_PyUnicode_READ_CHAR(u, i) PyUnicode_READ_CHAR(u, i) #define __Pyx_PyUnicode_KIND(u) PyUnicode_KIND(u) #define __Pyx_PyUnicode_DATA(u) PyUnicode_DATA(u) #define __Pyx_PyUnicode_READ(k, d, i) PyUnicode_READ(k, d, i) #else #define CYTHON_PEP393_ENABLED 0 #define __Pyx_PyUnicode_READY(op) (0) #define __Pyx_PyUnicode_GET_LENGTH(u) PyUnicode_GET_SIZE(u) #define __Pyx_PyUnicode_READ_CHAR(u, i) ((Py_UCS4)(PyUnicode_AS_UNICODE(u)[i])) #define __Pyx_PyUnicode_KIND(u) (sizeof(Py_UNICODE)) #define __Pyx_PyUnicode_DATA(u) ((void*)PyUnicode_AS_UNICODE(u)) #define __Pyx_PyUnicode_READ(k, d, i) ((void)(k), (Py_UCS4)(((Py_UNICODE*)d)[i])) #endif #if CYTHON_COMPILING_IN_PYPY #define __Pyx_PyUnicode_Concat(a, b) PyNumber_Add(a, b) #define __Pyx_PyUnicode_ConcatSafe(a, b) PyNumber_Add(a, b) #else #define __Pyx_PyUnicode_Concat(a, b) PyUnicode_Concat(a, b) #define __Pyx_PyUnicode_ConcatSafe(a, b) ((unlikely((a) == Py_None) || unlikely((b) == Py_None)) ?\ PyNumber_Add(a, b) : __Pyx_PyUnicode_Concat(a, b)) #endif #if CYTHON_COMPILING_IN_PYPY && !defined(PyUnicode_Contains) #define PyUnicode_Contains(u, s) PySequence_Contains(u, s) #endif #define __Pyx_PyString_FormatSafe(a, b) ((unlikely((a) == Py_None)) ? PyNumber_Remainder(a, b) : __Pyx_PyString_Format(a, b)) #define __Pyx_PyUnicode_FormatSafe(a, b) ((unlikely((a) == Py_None)) ? PyNumber_Remainder(a, b) : PyUnicode_Format(a, b)) #if PY_MAJOR_VERSION >= 3 #define __Pyx_PyString_Format(a, b) PyUnicode_Format(a, b) #else #define __Pyx_PyString_Format(a, b) PyString_Format(a, b) #endif #if PY_MAJOR_VERSION >= 3 #define PyBaseString_Type PyUnicode_Type #define PyStringObject PyUnicodeObject #define PyString_Type PyUnicode_Type #define PyString_Check PyUnicode_Check #define PyString_CheckExact PyUnicode_CheckExact #endif #if PY_MAJOR_VERSION >= 3 #define __Pyx_PyBaseString_Check(obj) PyUnicode_Check(obj) #define __Pyx_PyBaseString_CheckExact(obj) PyUnicode_CheckExact(obj) #else #define __Pyx_PyBaseString_Check(obj) (PyString_Check(obj) || PyUnicode_Check(obj)) #define __Pyx_PyBaseString_CheckExact(obj) (PyString_CheckExact(obj) || PyUnicode_CheckExact(obj)) #endif #ifndef PySet_CheckExact #define PySet_CheckExact(obj) (Py_TYPE(obj) == &PySet_Type) #endif #define __Pyx_TypeCheck(obj, type) PyObject_TypeCheck(obj, (PyTypeObject *)type) #if PY_MAJOR_VERSION >= 3 #define PyIntObject PyLongObject #define PyInt_Type PyLong_Type #define PyInt_Check(op) PyLong_Check(op) #define PyInt_CheckExact(op) PyLong_CheckExact(op) #define PyInt_FromString PyLong_FromString #define PyInt_FromUnicode PyLong_FromUnicode #define PyInt_FromLong PyLong_FromLong #define PyInt_FromSize_t PyLong_FromSize_t #define PyInt_FromSsize_t PyLong_FromSsize_t #define PyInt_AsLong PyLong_AsLong #define PyInt_AS_LONG PyLong_AS_LONG #define PyInt_AsSsize_t PyLong_AsSsize_t #define PyInt_AsUnsignedLongMask PyLong_AsUnsignedLongMask #define PyInt_AsUnsignedLongLongMask PyLong_AsUnsignedLongLongMask #define PyNumber_Int PyNumber_Long #endif #if PY_MAJOR_VERSION >= 3 #define PyBoolObject PyLongObject #endif #if PY_MAJOR_VERSION >= 3 && CYTHON_COMPILING_IN_PYPY #ifndef PyUnicode_InternFromString #define PyUnicode_InternFromString(s) PyUnicode_FromString(s) #endif #endif #if PY_VERSION_HEX < 0x030200A4 typedef long Py_hash_t; #define __Pyx_PyInt_FromHash_t PyInt_FromLong #define __Pyx_PyInt_AsHash_t PyInt_AsLong #else #define __Pyx_PyInt_FromHash_t PyInt_FromSsize_t #define __Pyx_PyInt_AsHash_t PyInt_AsSsize_t #endif #if PY_MAJOR_VERSION >= 3 #define __Pyx_PyMethod_New(func, self, klass) ((self) ? PyMethod_New(func, self) : PyInstanceMethod_New(func)) #else #define __Pyx_PyMethod_New(func, self, klass) PyMethod_New(func, self, klass) #endif #if PY_VERSION_HEX >= 0x030500B1 #define __Pyx_PyAsyncMethodsStruct PyAsyncMethods #define __Pyx_PyType_AsAsync(obj) (Py_TYPE(obj)->tp_as_async) #elif CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3 typedef struct { unaryfunc am_await; unaryfunc am_aiter; unaryfunc am_anext; } __Pyx_PyAsyncMethodsStruct; #define __Pyx_PyType_AsAsync(obj) ((__Pyx_PyAsyncMethodsStruct*) (Py_TYPE(obj)->tp_reserved)) #else #define __Pyx_PyType_AsAsync(obj) NULL #endif #ifndef CYTHON_RESTRICT #if defined(__GNUC__) #define CYTHON_RESTRICT __restrict__ #elif defined(_MSC_VER) && _MSC_VER >= 1400 #define CYTHON_RESTRICT __restrict #elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L #define CYTHON_RESTRICT restrict #else #define CYTHON_RESTRICT #endif #endif #define __Pyx_void_to_None(void_result) ((void)(void_result), Py_INCREF(Py_None), Py_None) #ifndef CYTHON_INLINE #if defined(__GNUC__) #define CYTHON_INLINE __inline__ #elif defined(_MSC_VER) #define CYTHON_INLINE __inline #elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L #define CYTHON_INLINE inline #else #define CYTHON_INLINE #endif #endif #if defined(WIN32) || defined(MS_WINDOWS) #define _USE_MATH_DEFINES #endif #include #ifdef NAN #define __PYX_NAN() ((float) NAN) #else static CYTHON_INLINE float __PYX_NAN() { float value; memset(&value, 0xFF, sizeof(value)); return value; } #endif #if PY_MAJOR_VERSION >= 3 #define __Pyx_PyNumber_Divide(x,y) PyNumber_TrueDivide(x,y) #define __Pyx_PyNumber_InPlaceDivide(x,y) PyNumber_InPlaceTrueDivide(x,y) #else #define __Pyx_PyNumber_Divide(x,y) PyNumber_Divide(x,y) #define __Pyx_PyNumber_InPlaceDivide(x,y) PyNumber_InPlaceDivide(x,y) #endif #ifndef __PYX_EXTERN_C #ifdef __cplusplus #define __PYX_EXTERN_C extern "C" #else #define __PYX_EXTERN_C extern #endif #endif #define __PYX_HAVE__pygame_sdl2__mouse #define __PYX_HAVE_API__pygame_sdl2__mouse #include "stdint.h" #include "string.h" #include "stdio.h" #include "stddef.h" #include "SDL.h" #ifdef _OPENMP #include #endif /* _OPENMP */ #ifdef PYREX_WITHOUT_ASSERTIONS #define CYTHON_WITHOUT_ASSERTIONS #endif #ifndef CYTHON_UNUSED # if defined(__GNUC__) # if !(defined(__cplusplus)) || (__GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 4)) # define CYTHON_UNUSED __attribute__ ((__unused__)) # else # define CYTHON_UNUSED # endif # elif defined(__ICC) || (defined(__INTEL_COMPILER) && !defined(_MSC_VER)) # define CYTHON_UNUSED __attribute__ ((__unused__)) # else # define CYTHON_UNUSED # endif #endif #ifndef CYTHON_NCP_UNUSED # if CYTHON_COMPILING_IN_CPYTHON # define CYTHON_NCP_UNUSED # else # define CYTHON_NCP_UNUSED CYTHON_UNUSED # endif #endif typedef struct {PyObject **p; char *s; const Py_ssize_t n; const char* encoding; const char is_unicode; const char is_str; const char intern; } __Pyx_StringTabEntry; #define __PYX_DEFAULT_STRING_ENCODING_IS_ASCII 0 #define __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT 0 #define __PYX_DEFAULT_STRING_ENCODING "" #define __Pyx_PyObject_FromString __Pyx_PyBytes_FromString #define __Pyx_PyObject_FromStringAndSize __Pyx_PyBytes_FromStringAndSize #define __Pyx_uchar_cast(c) ((unsigned char)c) #define __Pyx_long_cast(x) ((long)x) #define __Pyx_fits_Py_ssize_t(v, type, is_signed) (\ (sizeof(type) < sizeof(Py_ssize_t)) ||\ (sizeof(type) > sizeof(Py_ssize_t) &&\ likely(v < (type)PY_SSIZE_T_MAX ||\ v == (type)PY_SSIZE_T_MAX) &&\ (!is_signed || likely(v > (type)PY_SSIZE_T_MIN ||\ v == (type)PY_SSIZE_T_MIN))) ||\ (sizeof(type) == sizeof(Py_ssize_t) &&\ (is_signed || likely(v < (type)PY_SSIZE_T_MAX ||\ v == (type)PY_SSIZE_T_MAX))) ) #if defined (__cplusplus) && __cplusplus >= 201103L #include #define __Pyx_sst_abs(value) std::abs(value) #elif SIZEOF_INT >= SIZEOF_SIZE_T #define __Pyx_sst_abs(value) abs(value) #elif SIZEOF_LONG >= SIZEOF_SIZE_T #define __Pyx_sst_abs(value) labs(value) #elif defined (_MSC_VER) && defined (_M_X64) #define __Pyx_sst_abs(value) _abs64(value) #elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L #define __Pyx_sst_abs(value) llabs(value) #elif defined (__GNUC__) #define __Pyx_sst_abs(value) __builtin_llabs(value) #else #define __Pyx_sst_abs(value) ((value<0) ? -value : value) #endif static CYTHON_INLINE char* __Pyx_PyObject_AsString(PyObject*); static CYTHON_INLINE char* __Pyx_PyObject_AsStringAndSize(PyObject*, Py_ssize_t* length); #define __Pyx_PyByteArray_FromString(s) PyByteArray_FromStringAndSize((const char*)s, strlen((const char*)s)) #define __Pyx_PyByteArray_FromStringAndSize(s, l) PyByteArray_FromStringAndSize((const char*)s, l) #define __Pyx_PyBytes_FromString PyBytes_FromString #define __Pyx_PyBytes_FromStringAndSize PyBytes_FromStringAndSize static CYTHON_INLINE PyObject* __Pyx_PyUnicode_FromString(const char*); #if PY_MAJOR_VERSION < 3 #define __Pyx_PyStr_FromString __Pyx_PyBytes_FromString #define __Pyx_PyStr_FromStringAndSize __Pyx_PyBytes_FromStringAndSize #else #define __Pyx_PyStr_FromString __Pyx_PyUnicode_FromString #define __Pyx_PyStr_FromStringAndSize __Pyx_PyUnicode_FromStringAndSize #endif #define __Pyx_PyObject_AsSString(s) ((signed char*) __Pyx_PyObject_AsString(s)) #define __Pyx_PyObject_AsUString(s) ((unsigned char*) __Pyx_PyObject_AsString(s)) #define __Pyx_PyObject_FromCString(s) __Pyx_PyObject_FromString((const char*)s) #define __Pyx_PyBytes_FromCString(s) __Pyx_PyBytes_FromString((const char*)s) #define __Pyx_PyByteArray_FromCString(s) __Pyx_PyByteArray_FromString((const char*)s) #define __Pyx_PyStr_FromCString(s) __Pyx_PyStr_FromString((const char*)s) #define __Pyx_PyUnicode_FromCString(s) __Pyx_PyUnicode_FromString((const char*)s) #if PY_MAJOR_VERSION < 3 static CYTHON_INLINE size_t __Pyx_Py_UNICODE_strlen(const Py_UNICODE *u) { const Py_UNICODE *u_end = u; while (*u_end++) ; return (size_t)(u_end - u - 1); } #else #define __Pyx_Py_UNICODE_strlen Py_UNICODE_strlen #endif #define __Pyx_PyUnicode_FromUnicode(u) PyUnicode_FromUnicode(u, __Pyx_Py_UNICODE_strlen(u)) #define __Pyx_PyUnicode_FromUnicodeAndLength PyUnicode_FromUnicode #define __Pyx_PyUnicode_AsUnicode PyUnicode_AsUnicode #define __Pyx_NewRef(obj) (Py_INCREF(obj), obj) #define __Pyx_Owned_Py_None(b) __Pyx_NewRef(Py_None) #define __Pyx_PyBool_FromLong(b) ((b) ? __Pyx_NewRef(Py_True) : __Pyx_NewRef(Py_False)) static CYTHON_INLINE int __Pyx_PyObject_IsTrue(PyObject*); static CYTHON_INLINE PyObject* __Pyx_PyNumber_Int(PyObject* x); static CYTHON_INLINE Py_ssize_t __Pyx_PyIndex_AsSsize_t(PyObject*); static CYTHON_INLINE PyObject * __Pyx_PyInt_FromSize_t(size_t); #if CYTHON_COMPILING_IN_CPYTHON #define __pyx_PyFloat_AsDouble(x) (PyFloat_CheckExact(x) ? PyFloat_AS_DOUBLE(x) : PyFloat_AsDouble(x)) #else #define __pyx_PyFloat_AsDouble(x) PyFloat_AsDouble(x) #endif #define __pyx_PyFloat_AsFloat(x) ((float) __pyx_PyFloat_AsDouble(x)) #if PY_MAJOR_VERSION < 3 && __PYX_DEFAULT_STRING_ENCODING_IS_ASCII static int __Pyx_sys_getdefaultencoding_not_ascii; static int __Pyx_init_sys_getdefaultencoding_params(void) { PyObject* sys; PyObject* default_encoding = NULL; PyObject* ascii_chars_u = NULL; PyObject* ascii_chars_b = NULL; const char* default_encoding_c; sys = PyImport_ImportModule("sys"); if (!sys) goto bad; default_encoding = PyObject_CallMethod(sys, (char*) "getdefaultencoding", NULL); Py_DECREF(sys); if (!default_encoding) goto bad; default_encoding_c = PyBytes_AsString(default_encoding); if (!default_encoding_c) goto bad; if (strcmp(default_encoding_c, "ascii") == 0) { __Pyx_sys_getdefaultencoding_not_ascii = 0; } else { char ascii_chars[128]; int c; for (c = 0; c < 128; c++) { ascii_chars[c] = c; } __Pyx_sys_getdefaultencoding_not_ascii = 1; ascii_chars_u = PyUnicode_DecodeASCII(ascii_chars, 128, NULL); if (!ascii_chars_u) goto bad; ascii_chars_b = PyUnicode_AsEncodedString(ascii_chars_u, default_encoding_c, NULL); if (!ascii_chars_b || !PyBytes_Check(ascii_chars_b) || memcmp(ascii_chars, PyBytes_AS_STRING(ascii_chars_b), 128) != 0) { PyErr_Format( PyExc_ValueError, "This module compiled with c_string_encoding=ascii, but default encoding '%.200s' is not a superset of ascii.", default_encoding_c); goto bad; } Py_DECREF(ascii_chars_u); Py_DECREF(ascii_chars_b); } Py_DECREF(default_encoding); return 0; bad: Py_XDECREF(default_encoding); Py_XDECREF(ascii_chars_u); Py_XDECREF(ascii_chars_b); return -1; } #endif #if __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT && PY_MAJOR_VERSION >= 3 #define __Pyx_PyUnicode_FromStringAndSize(c_str, size) PyUnicode_DecodeUTF8(c_str, size, NULL) #else #define __Pyx_PyUnicode_FromStringAndSize(c_str, size) PyUnicode_Decode(c_str, size, __PYX_DEFAULT_STRING_ENCODING, NULL) #if __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT static char* __PYX_DEFAULT_STRING_ENCODING; static int __Pyx_init_sys_getdefaultencoding_params(void) { PyObject* sys; PyObject* default_encoding = NULL; char* default_encoding_c; sys = PyImport_ImportModule("sys"); if (!sys) goto bad; default_encoding = PyObject_CallMethod(sys, (char*) (const char*) "getdefaultencoding", NULL); Py_DECREF(sys); if (!default_encoding) goto bad; default_encoding_c = PyBytes_AsString(default_encoding); if (!default_encoding_c) goto bad; __PYX_DEFAULT_STRING_ENCODING = (char*) malloc(strlen(default_encoding_c)); if (!__PYX_DEFAULT_STRING_ENCODING) goto bad; strcpy(__PYX_DEFAULT_STRING_ENCODING, default_encoding_c); Py_DECREF(default_encoding); return 0; bad: Py_XDECREF(default_encoding); return -1; } #endif #endif /* Test for GCC > 2.95 */ #if defined(__GNUC__) && (__GNUC__ > 2 || (__GNUC__ == 2 && (__GNUC_MINOR__ > 95))) #define likely(x) __builtin_expect(!!(x), 1) #define unlikely(x) __builtin_expect(!!(x), 0) #else /* !__GNUC__ or GCC < 2.95 */ #define likely(x) (x) #define unlikely(x) (x) #endif /* __GNUC__ */ static PyObject *__pyx_m; static PyObject *__pyx_d; static PyObject *__pyx_b; static PyObject *__pyx_empty_tuple; static PyObject *__pyx_empty_bytes; static int __pyx_lineno; static int __pyx_clineno = 0; static const char * __pyx_cfilenm= __FILE__; static const char *__pyx_filename; static const char *__pyx_f[] = { "src/pygame_sdl2/mouse.pyx", }; /*--- Type declarations ---*/ /* --- Runtime support code (head) --- */ #ifndef CYTHON_REFNANNY #define CYTHON_REFNANNY 0 #endif #if CYTHON_REFNANNY typedef struct { void (*INCREF)(void*, PyObject*, int); void (*DECREF)(void*, PyObject*, int); void (*GOTREF)(void*, PyObject*, int); void (*GIVEREF)(void*, PyObject*, int); void* (*SetupContext)(const char*, int, const char*); void (*FinishContext)(void**); } __Pyx_RefNannyAPIStruct; static __Pyx_RefNannyAPIStruct *__Pyx_RefNanny = NULL; static __Pyx_RefNannyAPIStruct *__Pyx_RefNannyImportAPI(const char *modname); #define __Pyx_RefNannyDeclarations void *__pyx_refnanny = NULL; #ifdef WITH_THREAD #define __Pyx_RefNannySetupContext(name, acquire_gil)\ if (acquire_gil) {\ PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure();\ __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), __LINE__, __FILE__);\ PyGILState_Release(__pyx_gilstate_save);\ } else {\ __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), __LINE__, __FILE__);\ } #else #define __Pyx_RefNannySetupContext(name, acquire_gil)\ __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), __LINE__, __FILE__) #endif #define __Pyx_RefNannyFinishContext()\ __Pyx_RefNanny->FinishContext(&__pyx_refnanny) #define __Pyx_INCREF(r) __Pyx_RefNanny->INCREF(__pyx_refnanny, (PyObject *)(r), __LINE__) #define __Pyx_DECREF(r) __Pyx_RefNanny->DECREF(__pyx_refnanny, (PyObject *)(r), __LINE__) #define __Pyx_GOTREF(r) __Pyx_RefNanny->GOTREF(__pyx_refnanny, (PyObject *)(r), __LINE__) #define __Pyx_GIVEREF(r) __Pyx_RefNanny->GIVEREF(__pyx_refnanny, (PyObject *)(r), __LINE__) #define __Pyx_XINCREF(r) do { if((r) != NULL) {__Pyx_INCREF(r); }} while(0) #define __Pyx_XDECREF(r) do { if((r) != NULL) {__Pyx_DECREF(r); }} while(0) #define __Pyx_XGOTREF(r) do { if((r) != NULL) {__Pyx_GOTREF(r); }} while(0) #define __Pyx_XGIVEREF(r) do { if((r) != NULL) {__Pyx_GIVEREF(r);}} while(0) #else #define __Pyx_RefNannyDeclarations #define __Pyx_RefNannySetupContext(name, acquire_gil) #define __Pyx_RefNannyFinishContext() #define __Pyx_INCREF(r) Py_INCREF(r) #define __Pyx_DECREF(r) Py_DECREF(r) #define __Pyx_GOTREF(r) #define __Pyx_GIVEREF(r) #define __Pyx_XINCREF(r) Py_XINCREF(r) #define __Pyx_XDECREF(r) Py_XDECREF(r) #define __Pyx_XGOTREF(r) #define __Pyx_XGIVEREF(r) #endif #define __Pyx_XDECREF_SET(r, v) do {\ PyObject *tmp = (PyObject *) r;\ r = v; __Pyx_XDECREF(tmp);\ } while (0) #define __Pyx_DECREF_SET(r, v) do {\ PyObject *tmp = (PyObject *) r;\ r = v; __Pyx_DECREF(tmp);\ } while (0) #define __Pyx_CLEAR(r) do { PyObject* tmp = ((PyObject*)(r)); r = NULL; __Pyx_DECREF(tmp);} while(0) #define __Pyx_XCLEAR(r) do { if((r) != NULL) {PyObject* tmp = ((PyObject*)(r)); r = NULL; __Pyx_DECREF(tmp);}} while(0) static CYTHON_INLINE void __Pyx_RaiseTooManyValuesError(Py_ssize_t expected); static CYTHON_INLINE void __Pyx_RaiseNeedMoreValuesError(Py_ssize_t index); static CYTHON_INLINE int __Pyx_IterFinish(void); static int __Pyx_IternextUnpackEndCheck(PyObject *retval, Py_ssize_t expected); static void __Pyx_RaiseArgtupleInvalid(const char* func_name, int exact, Py_ssize_t num_min, Py_ssize_t num_max, Py_ssize_t num_found); static void __Pyx_RaiseDoubleKeywordsError(const char* func_name, PyObject* kw_name); static int __Pyx_ParseOptionalKeywords(PyObject *kwds, PyObject **argnames[],\ PyObject *kwds2, PyObject *values[], Py_ssize_t num_pos_args,\ const char* function_name); typedef struct { int code_line; PyCodeObject* code_object; } __Pyx_CodeObjectCacheEntry; struct __Pyx_CodeObjectCache { int count; int max_count; __Pyx_CodeObjectCacheEntry* entries; }; static struct __Pyx_CodeObjectCache __pyx_code_cache = {0,0,NULL}; static int __pyx_bisect_code_objects(__Pyx_CodeObjectCacheEntry* entries, int count, int code_line); static PyCodeObject *__pyx_find_code_object(int code_line); static void __pyx_insert_code_object(int code_line, PyCodeObject* code_object); static void __Pyx_AddTraceback(const char *funcname, int c_line, int py_line, const char *filename); static CYTHON_INLINE PyObject* __Pyx_PyInt_From_int(int value); static CYTHON_INLINE int __Pyx_PyInt_As_int(PyObject *); static CYTHON_INLINE PyObject* __Pyx_PyInt_From_long(long value); static CYTHON_INLINE long __Pyx_PyInt_As_long(PyObject *); static int __Pyx_check_binary_version(void); static int __Pyx_InitStrings(__Pyx_StringTabEntry *t); /* Module declarations from 'libc.stdint' */ /* Module declarations from 'libc.string' */ /* Module declarations from 'libc.stdio' */ /* Module declarations from 'libc.stddef' */ /* Module declarations from 'sdl2' */ /* Module declarations from 'pygame_sdl2.mouse' */ #define __Pyx_MODULE_NAME "pygame_sdl2.mouse" int __pyx_module_is_main_pygame_sdl2__mouse = 0; /* Implementation of 'pygame_sdl2.mouse' */ static char __pyx_k_x[] = "x"; static char __pyx_k_y[] = "y"; static char __pyx_k_pos[] = "pos"; static char __pyx_k_init[] = "init"; static char __pyx_k_main[] = "__main__"; static char __pyx_k_quit[] = "quit"; static char __pyx_k_size[] = "size"; static char __pyx_k_test[] = "__test__"; static char __pyx_k_state[] = "state"; static char __pyx_k_get_pos[] = "get_pos"; static char __pyx_k_get_rel[] = "get_rel"; static char __pyx_k_hotspot[] = "hotspot"; static char __pyx_k_set_pos[] = "set_pos"; static char __pyx_k_visible[] = "visible"; static char __pyx_k_andmasks[] = "andmasks"; static char __pyx_k_xormasks[] = "xormasks"; static char __pyx_k_get_cursor[] = "get_cursor"; static char __pyx_k_set_cursor[] = "set_cursor"; static char __pyx_k_get_focused[] = "get_focused"; static char __pyx_k_get_pressed[] = "get_pressed"; static char __pyx_k_set_visible[] = "set_visible"; static char __pyx_k_pygame_sdl2_mouse[] = "pygame_sdl2.mouse"; static char __pyx_k_home_tom_ab_pygame_sdl2_src_pyg[] = "/home/tom/ab/pygame_sdl2/src/pygame_sdl2/mouse.pyx"; static PyObject *__pyx_n_s_andmasks; static PyObject *__pyx_n_s_get_cursor; static PyObject *__pyx_n_s_get_focused; static PyObject *__pyx_n_s_get_pos; static PyObject *__pyx_n_s_get_pressed; static PyObject *__pyx_n_s_get_rel; static PyObject *__pyx_kp_s_home_tom_ab_pygame_sdl2_src_pyg; static PyObject *__pyx_n_s_hotspot; static PyObject *__pyx_n_s_init; static PyObject *__pyx_n_s_main; static PyObject *__pyx_n_s_pos; static PyObject *__pyx_n_s_pygame_sdl2_mouse; static PyObject *__pyx_n_s_quit; static PyObject *__pyx_n_s_set_cursor; static PyObject *__pyx_n_s_set_pos; static PyObject *__pyx_n_s_set_visible; static PyObject *__pyx_n_s_size; static PyObject *__pyx_n_s_state; static PyObject *__pyx_n_s_test; static PyObject *__pyx_n_s_visible; static PyObject *__pyx_n_s_x; static PyObject *__pyx_n_s_xormasks; static PyObject *__pyx_n_s_y; static PyObject *__pyx_pf_11pygame_sdl2_5mouse_init(CYTHON_UNUSED PyObject *__pyx_self); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_5mouse_2quit(CYTHON_UNUSED PyObject *__pyx_self); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_5mouse_4get_pressed(CYTHON_UNUSED PyObject *__pyx_self); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_5mouse_6get_pos(CYTHON_UNUSED PyObject *__pyx_self); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_5mouse_8get_rel(CYTHON_UNUSED PyObject *__pyx_self); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_5mouse_10set_pos(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_pos); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_5mouse_12set_visible(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_visible); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_5mouse_14get_focused(CYTHON_UNUSED PyObject *__pyx_self); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_5mouse_16set_cursor(CYTHON_UNUSED PyObject *__pyx_self, CYTHON_UNUSED PyObject *__pyx_v_size, CYTHON_UNUSED PyObject *__pyx_v_hotspot, CYTHON_UNUSED PyObject *__pyx_v_xormasks, CYTHON_UNUSED PyObject *__pyx_v_andmasks); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_5mouse_18get_cursor(CYTHON_UNUSED PyObject *__pyx_self); /* proto */ static PyObject *__pyx_int_0; static PyObject *__pyx_int_1; static PyObject *__pyx_codeobj_; static PyObject *__pyx_tuple__3; static PyObject *__pyx_tuple__5; static PyObject *__pyx_tuple__7; static PyObject *__pyx_tuple__9; static PyObject *__pyx_tuple__11; static PyObject *__pyx_tuple__14; static PyObject *__pyx_codeobj__2; static PyObject *__pyx_codeobj__4; static PyObject *__pyx_codeobj__6; static PyObject *__pyx_codeobj__8; static PyObject *__pyx_codeobj__10; static PyObject *__pyx_codeobj__12; static PyObject *__pyx_codeobj__13; static PyObject *__pyx_codeobj__15; static PyObject *__pyx_codeobj__16; /* "pygame_sdl2/mouse.pyx":21 * from sdl2 cimport * * * def init(): # <<<<<<<<<<<<<< * pass * */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_5mouse_1init(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused); /*proto*/ static PyMethodDef __pyx_mdef_11pygame_sdl2_5mouse_1init = {"init", (PyCFunction)__pyx_pw_11pygame_sdl2_5mouse_1init, METH_NOARGS, 0}; static PyObject *__pyx_pw_11pygame_sdl2_5mouse_1init(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("init (wrapper)", 0); __pyx_r = __pyx_pf_11pygame_sdl2_5mouse_init(__pyx_self); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_5mouse_init(CYTHON_UNUSED PyObject *__pyx_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("init", 0); /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/mouse.pyx":24 * pass * * def quit(): # <<<<<<<<<<<<<< * pass * */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_5mouse_3quit(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused); /*proto*/ static PyMethodDef __pyx_mdef_11pygame_sdl2_5mouse_3quit = {"quit", (PyCFunction)__pyx_pw_11pygame_sdl2_5mouse_3quit, METH_NOARGS, 0}; static PyObject *__pyx_pw_11pygame_sdl2_5mouse_3quit(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("quit (wrapper)", 0); __pyx_r = __pyx_pf_11pygame_sdl2_5mouse_2quit(__pyx_self); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_5mouse_2quit(CYTHON_UNUSED PyObject *__pyx_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("quit", 0); /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/mouse.pyx":27 * pass * * def get_pressed(): # <<<<<<<<<<<<<< * cdef Uint32 state = SDL_GetMouseState(NULL, NULL) * return (1 if state & SDL_BUTTON_LMASK else 0, */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_5mouse_5get_pressed(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused); /*proto*/ static PyMethodDef __pyx_mdef_11pygame_sdl2_5mouse_5get_pressed = {"get_pressed", (PyCFunction)__pyx_pw_11pygame_sdl2_5mouse_5get_pressed, METH_NOARGS, 0}; static PyObject *__pyx_pw_11pygame_sdl2_5mouse_5get_pressed(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("get_pressed (wrapper)", 0); __pyx_r = __pyx_pf_11pygame_sdl2_5mouse_4get_pressed(__pyx_self); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_5mouse_4get_pressed(CYTHON_UNUSED PyObject *__pyx_self) { Uint32 __pyx_v_state; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("get_pressed", 0); /* "pygame_sdl2/mouse.pyx":28 * * def get_pressed(): * cdef Uint32 state = SDL_GetMouseState(NULL, NULL) # <<<<<<<<<<<<<< * return (1 if state & SDL_BUTTON_LMASK else 0, * 1 if state & SDL_BUTTON_MMASK else 0, */ __pyx_v_state = SDL_GetMouseState(NULL, NULL); /* "pygame_sdl2/mouse.pyx":29 * def get_pressed(): * cdef Uint32 state = SDL_GetMouseState(NULL, NULL) * return (1 if state & SDL_BUTTON_LMASK else 0, # <<<<<<<<<<<<<< * 1 if state & SDL_BUTTON_MMASK else 0, * 1 if state & SDL_BUTTON_RMASK else 0) */ __Pyx_XDECREF(__pyx_r); if (((__pyx_v_state & SDL_BUTTON_LMASK) != 0)) { __Pyx_INCREF(__pyx_int_1); __pyx_t_1 = __pyx_int_1; } else { __Pyx_INCREF(__pyx_int_0); __pyx_t_1 = __pyx_int_0; } /* "pygame_sdl2/mouse.pyx":30 * cdef Uint32 state = SDL_GetMouseState(NULL, NULL) * return (1 if state & SDL_BUTTON_LMASK else 0, * 1 if state & SDL_BUTTON_MMASK else 0, # <<<<<<<<<<<<<< * 1 if state & SDL_BUTTON_RMASK else 0) * */ if (((__pyx_v_state & SDL_BUTTON_MMASK) != 0)) { __Pyx_INCREF(__pyx_int_1); __pyx_t_2 = __pyx_int_1; } else { __Pyx_INCREF(__pyx_int_0); __pyx_t_2 = __pyx_int_0; } /* "pygame_sdl2/mouse.pyx":31 * return (1 if state & SDL_BUTTON_LMASK else 0, * 1 if state & SDL_BUTTON_MMASK else 0, * 1 if state & SDL_BUTTON_RMASK else 0) # <<<<<<<<<<<<<< * * def get_pos(): */ if (((__pyx_v_state & SDL_BUTTON_RMASK) != 0)) { __Pyx_INCREF(__pyx_int_1); __pyx_t_3 = __pyx_int_1; } else { __Pyx_INCREF(__pyx_int_0); __pyx_t_3 = __pyx_int_0; } /* "pygame_sdl2/mouse.pyx":29 * def get_pressed(): * cdef Uint32 state = SDL_GetMouseState(NULL, NULL) * return (1 if state & SDL_BUTTON_LMASK else 0, # <<<<<<<<<<<<<< * 1 if state & SDL_BUTTON_MMASK else 0, * 1 if state & SDL_BUTTON_RMASK else 0) */ __pyx_t_4 = PyTuple_New(3); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 29; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); __Pyx_GIVEREF(__pyx_t_1); PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_1); __Pyx_GIVEREF(__pyx_t_2); PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_2); __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_4, 2, __pyx_t_3); __pyx_t_1 = 0; __pyx_t_2 = 0; __pyx_t_3 = 0; __pyx_r = __pyx_t_4; __pyx_t_4 = 0; goto __pyx_L0; /* "pygame_sdl2/mouse.pyx":27 * pass * * def get_pressed(): # <<<<<<<<<<<<<< * cdef Uint32 state = SDL_GetMouseState(NULL, NULL) * return (1 if state & SDL_BUTTON_LMASK else 0, */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_AddTraceback("pygame_sdl2.mouse.get_pressed", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/mouse.pyx":33 * 1 if state & SDL_BUTTON_RMASK else 0) * * def get_pos(): # <<<<<<<<<<<<<< * cdef int x, y * SDL_GetMouseState(&x, &y) */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_5mouse_7get_pos(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused); /*proto*/ static PyMethodDef __pyx_mdef_11pygame_sdl2_5mouse_7get_pos = {"get_pos", (PyCFunction)__pyx_pw_11pygame_sdl2_5mouse_7get_pos, METH_NOARGS, 0}; static PyObject *__pyx_pw_11pygame_sdl2_5mouse_7get_pos(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("get_pos (wrapper)", 0); __pyx_r = __pyx_pf_11pygame_sdl2_5mouse_6get_pos(__pyx_self); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_5mouse_6get_pos(CYTHON_UNUSED PyObject *__pyx_self) { int __pyx_v_x; int __pyx_v_y; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("get_pos", 0); /* "pygame_sdl2/mouse.pyx":35 * def get_pos(): * cdef int x, y * SDL_GetMouseState(&x, &y) # <<<<<<<<<<<<<< * return (x, y) * */ SDL_GetMouseState((&__pyx_v_x), (&__pyx_v_y)); /* "pygame_sdl2/mouse.pyx":36 * cdef int x, y * SDL_GetMouseState(&x, &y) * return (x, y) # <<<<<<<<<<<<<< * * def get_rel(): */ __Pyx_XDECREF(__pyx_r); __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_x); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 36; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_v_y); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 36; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 36; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __Pyx_GIVEREF(__pyx_t_1); PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_1); __Pyx_GIVEREF(__pyx_t_2); PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_2); __pyx_t_1 = 0; __pyx_t_2 = 0; __pyx_r = __pyx_t_3; __pyx_t_3 = 0; goto __pyx_L0; /* "pygame_sdl2/mouse.pyx":33 * 1 if state & SDL_BUTTON_RMASK else 0) * * def get_pos(): # <<<<<<<<<<<<<< * cdef int x, y * SDL_GetMouseState(&x, &y) */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("pygame_sdl2.mouse.get_pos", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/mouse.pyx":38 * return (x, y) * * def get_rel(): # <<<<<<<<<<<<<< * cdef int x,y * SDL_GetRelativeMouseState(&x, &y) */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_5mouse_9get_rel(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused); /*proto*/ static PyMethodDef __pyx_mdef_11pygame_sdl2_5mouse_9get_rel = {"get_rel", (PyCFunction)__pyx_pw_11pygame_sdl2_5mouse_9get_rel, METH_NOARGS, 0}; static PyObject *__pyx_pw_11pygame_sdl2_5mouse_9get_rel(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("get_rel (wrapper)", 0); __pyx_r = __pyx_pf_11pygame_sdl2_5mouse_8get_rel(__pyx_self); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_5mouse_8get_rel(CYTHON_UNUSED PyObject *__pyx_self) { int __pyx_v_x; int __pyx_v_y; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("get_rel", 0); /* "pygame_sdl2/mouse.pyx":40 * def get_rel(): * cdef int x,y * SDL_GetRelativeMouseState(&x, &y) # <<<<<<<<<<<<<< * return (x, y) * */ SDL_GetRelativeMouseState((&__pyx_v_x), (&__pyx_v_y)); /* "pygame_sdl2/mouse.pyx":41 * cdef int x,y * SDL_GetRelativeMouseState(&x, &y) * return (x, y) # <<<<<<<<<<<<<< * * def set_pos(pos): */ __Pyx_XDECREF(__pyx_r); __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_x); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 41; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_v_y); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 41; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 41; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __Pyx_GIVEREF(__pyx_t_1); PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_1); __Pyx_GIVEREF(__pyx_t_2); PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_2); __pyx_t_1 = 0; __pyx_t_2 = 0; __pyx_r = __pyx_t_3; __pyx_t_3 = 0; goto __pyx_L0; /* "pygame_sdl2/mouse.pyx":38 * return (x, y) * * def get_rel(): # <<<<<<<<<<<<<< * cdef int x,y * SDL_GetRelativeMouseState(&x, &y) */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("pygame_sdl2.mouse.get_rel", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/mouse.pyx":43 * return (x, y) * * def set_pos(pos): # <<<<<<<<<<<<<< * (x, y) = pos * SDL_WarpMouseInWindow(NULL, x, y) */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_5mouse_11set_pos(PyObject *__pyx_self, PyObject *__pyx_v_pos); /*proto*/ static PyMethodDef __pyx_mdef_11pygame_sdl2_5mouse_11set_pos = {"set_pos", (PyCFunction)__pyx_pw_11pygame_sdl2_5mouse_11set_pos, METH_O, 0}; static PyObject *__pyx_pw_11pygame_sdl2_5mouse_11set_pos(PyObject *__pyx_self, PyObject *__pyx_v_pos) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("set_pos (wrapper)", 0); __pyx_r = __pyx_pf_11pygame_sdl2_5mouse_10set_pos(__pyx_self, ((PyObject *)__pyx_v_pos)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_5mouse_10set_pos(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_pos) { PyObject *__pyx_v_x = NULL; PyObject *__pyx_v_y = NULL; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; PyObject *(*__pyx_t_4)(PyObject *); int __pyx_t_5; int __pyx_t_6; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("set_pos", 0); /* "pygame_sdl2/mouse.pyx":44 * * def set_pos(pos): * (x, y) = pos # <<<<<<<<<<<<<< * SDL_WarpMouseInWindow(NULL, x, y) * */ if ((likely(PyTuple_CheckExact(__pyx_v_pos))) || (PyList_CheckExact(__pyx_v_pos))) { PyObject* sequence = __pyx_v_pos; #if CYTHON_COMPILING_IN_CPYTHON Py_ssize_t size = Py_SIZE(sequence); #else Py_ssize_t size = PySequence_Size(sequence); #endif if (unlikely(size != 2)) { if (size > 2) __Pyx_RaiseTooManyValuesError(2); else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 44; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } #if CYTHON_COMPILING_IN_CPYTHON if (likely(PyTuple_CheckExact(sequence))) { __pyx_t_1 = PyTuple_GET_ITEM(sequence, 0); __pyx_t_2 = PyTuple_GET_ITEM(sequence, 1); } else { __pyx_t_1 = PyList_GET_ITEM(sequence, 0); __pyx_t_2 = PyList_GET_ITEM(sequence, 1); } __Pyx_INCREF(__pyx_t_1); __Pyx_INCREF(__pyx_t_2); #else __pyx_t_1 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 44; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 44; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); #endif } else { Py_ssize_t index = -1; __pyx_t_3 = PyObject_GetIter(__pyx_v_pos); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 44; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = Py_TYPE(__pyx_t_3)->tp_iternext; index = 0; __pyx_t_1 = __pyx_t_4(__pyx_t_3); if (unlikely(!__pyx_t_1)) goto __pyx_L3_unpacking_failed; __Pyx_GOTREF(__pyx_t_1); index = 1; __pyx_t_2 = __pyx_t_4(__pyx_t_3); if (unlikely(!__pyx_t_2)) goto __pyx_L3_unpacking_failed; __Pyx_GOTREF(__pyx_t_2); if (__Pyx_IternextUnpackEndCheck(__pyx_t_4(__pyx_t_3), 2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 44; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_t_4 = NULL; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; goto __pyx_L4_unpacking_done; __pyx_L3_unpacking_failed:; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_4 = NULL; if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 44; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_L4_unpacking_done:; } __pyx_v_x = __pyx_t_1; __pyx_t_1 = 0; __pyx_v_y = __pyx_t_2; __pyx_t_2 = 0; /* "pygame_sdl2/mouse.pyx":45 * def set_pos(pos): * (x, y) = pos * SDL_WarpMouseInWindow(NULL, x, y) # <<<<<<<<<<<<<< * * def set_visible(visible): */ __pyx_t_5 = __Pyx_PyInt_As_int(__pyx_v_x); if (unlikely((__pyx_t_5 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 45; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_t_6 = __Pyx_PyInt_As_int(__pyx_v_y); if (unlikely((__pyx_t_6 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 45; __pyx_clineno = __LINE__; goto __pyx_L1_error;} SDL_WarpMouseInWindow(NULL, __pyx_t_5, __pyx_t_6); /* "pygame_sdl2/mouse.pyx":43 * return (x, y) * * def set_pos(pos): # <<<<<<<<<<<<<< * (x, y) = pos * SDL_WarpMouseInWindow(NULL, x, y) */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("pygame_sdl2.mouse.set_pos", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF(__pyx_v_x); __Pyx_XDECREF(__pyx_v_y); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/mouse.pyx":47 * SDL_WarpMouseInWindow(NULL, x, y) * * def set_visible(visible): # <<<<<<<<<<<<<< * SDL_ShowCursor(1 if visible else 0) * */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_5mouse_13set_visible(PyObject *__pyx_self, PyObject *__pyx_v_visible); /*proto*/ static PyMethodDef __pyx_mdef_11pygame_sdl2_5mouse_13set_visible = {"set_visible", (PyCFunction)__pyx_pw_11pygame_sdl2_5mouse_13set_visible, METH_O, 0}; static PyObject *__pyx_pw_11pygame_sdl2_5mouse_13set_visible(PyObject *__pyx_self, PyObject *__pyx_v_visible) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("set_visible (wrapper)", 0); __pyx_r = __pyx_pf_11pygame_sdl2_5mouse_12set_visible(__pyx_self, ((PyObject *)__pyx_v_visible)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_5mouse_12set_visible(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_visible) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; int __pyx_t_2; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("set_visible", 0); /* "pygame_sdl2/mouse.pyx":48 * * def set_visible(visible): * SDL_ShowCursor(1 if visible else 0) # <<<<<<<<<<<<<< * * def get_focused(): */ __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_v_visible); if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 48; __pyx_clineno = __LINE__; goto __pyx_L1_error;} if (__pyx_t_2) { __pyx_t_1 = 1; } else { __pyx_t_1 = 0; } SDL_ShowCursor(__pyx_t_1); /* "pygame_sdl2/mouse.pyx":47 * SDL_WarpMouseInWindow(NULL, x, y) * * def set_visible(visible): # <<<<<<<<<<<<<< * SDL_ShowCursor(1 if visible else 0) * */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("pygame_sdl2.mouse.set_visible", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/mouse.pyx":50 * SDL_ShowCursor(1 if visible else 0) * * def get_focused(): # <<<<<<<<<<<<<< * return SDL_GetMouseFocus() != NULL * */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_5mouse_15get_focused(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused); /*proto*/ static PyMethodDef __pyx_mdef_11pygame_sdl2_5mouse_15get_focused = {"get_focused", (PyCFunction)__pyx_pw_11pygame_sdl2_5mouse_15get_focused, METH_NOARGS, 0}; static PyObject *__pyx_pw_11pygame_sdl2_5mouse_15get_focused(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("get_focused (wrapper)", 0); __pyx_r = __pyx_pf_11pygame_sdl2_5mouse_14get_focused(__pyx_self); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_5mouse_14get_focused(CYTHON_UNUSED PyObject *__pyx_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("get_focused", 0); /* "pygame_sdl2/mouse.pyx":51 * * def get_focused(): * return SDL_GetMouseFocus() != NULL # <<<<<<<<<<<<<< * * def set_cursor(size, hotspot, xormasks, andmasks): */ __Pyx_XDECREF(__pyx_r); __pyx_t_1 = __Pyx_PyBool_FromLong((SDL_GetMouseFocus() != NULL)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 51; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "pygame_sdl2/mouse.pyx":50 * SDL_ShowCursor(1 if visible else 0) * * def get_focused(): # <<<<<<<<<<<<<< * return SDL_GetMouseFocus() != NULL * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("pygame_sdl2.mouse.get_focused", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/mouse.pyx":53 * return SDL_GetMouseFocus() != NULL * * def set_cursor(size, hotspot, xormasks, andmasks): # <<<<<<<<<<<<<< * # Does anyone use this? SDL2 has much improved custom cursor support. * pass */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_5mouse_17set_cursor(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static PyMethodDef __pyx_mdef_11pygame_sdl2_5mouse_17set_cursor = {"set_cursor", (PyCFunction)__pyx_pw_11pygame_sdl2_5mouse_17set_cursor, METH_VARARGS|METH_KEYWORDS, 0}; static PyObject *__pyx_pw_11pygame_sdl2_5mouse_17set_cursor(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { CYTHON_UNUSED PyObject *__pyx_v_size = 0; CYTHON_UNUSED PyObject *__pyx_v_hotspot = 0; CYTHON_UNUSED PyObject *__pyx_v_xormasks = 0; CYTHON_UNUSED PyObject *__pyx_v_andmasks = 0; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("set_cursor (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_size,&__pyx_n_s_hotspot,&__pyx_n_s_xormasks,&__pyx_n_s_andmasks,0}; PyObject* values[4] = {0,0,0,0}; if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_size)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; case 1: if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_hotspot)) != 0)) kw_args--; else { __Pyx_RaiseArgtupleInvalid("set_cursor", 1, 4, 4, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 53; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } case 2: if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_xormasks)) != 0)) kw_args--; else { __Pyx_RaiseArgtupleInvalid("set_cursor", 1, 4, 4, 2); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 53; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } case 3: if (likely((values[3] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_andmasks)) != 0)) kw_args--; else { __Pyx_RaiseArgtupleInvalid("set_cursor", 1, 4, 4, 3); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 53; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "set_cursor") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 53; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } } else if (PyTuple_GET_SIZE(__pyx_args) != 4) { goto __pyx_L5_argtuple_error; } else { values[0] = PyTuple_GET_ITEM(__pyx_args, 0); values[1] = PyTuple_GET_ITEM(__pyx_args, 1); values[2] = PyTuple_GET_ITEM(__pyx_args, 2); values[3] = PyTuple_GET_ITEM(__pyx_args, 3); } __pyx_v_size = values[0]; __pyx_v_hotspot = values[1]; __pyx_v_xormasks = values[2]; __pyx_v_andmasks = values[3]; } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("set_cursor", 1, 4, 4, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 53; __pyx_clineno = __LINE__; goto __pyx_L3_error;} __pyx_L3_error:; __Pyx_AddTraceback("pygame_sdl2.mouse.set_cursor", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_11pygame_sdl2_5mouse_16set_cursor(__pyx_self, __pyx_v_size, __pyx_v_hotspot, __pyx_v_xormasks, __pyx_v_andmasks); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_5mouse_16set_cursor(CYTHON_UNUSED PyObject *__pyx_self, CYTHON_UNUSED PyObject *__pyx_v_size, CYTHON_UNUSED PyObject *__pyx_v_hotspot, CYTHON_UNUSED PyObject *__pyx_v_xormasks, CYTHON_UNUSED PyObject *__pyx_v_andmasks) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("set_cursor", 0); /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/mouse.pyx":57 * pass * * def get_cursor(): # <<<<<<<<<<<<<< * return None */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_5mouse_19get_cursor(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused); /*proto*/ static PyMethodDef __pyx_mdef_11pygame_sdl2_5mouse_19get_cursor = {"get_cursor", (PyCFunction)__pyx_pw_11pygame_sdl2_5mouse_19get_cursor, METH_NOARGS, 0}; static PyObject *__pyx_pw_11pygame_sdl2_5mouse_19get_cursor(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("get_cursor (wrapper)", 0); __pyx_r = __pyx_pf_11pygame_sdl2_5mouse_18get_cursor(__pyx_self); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_5mouse_18get_cursor(CYTHON_UNUSED PyObject *__pyx_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("get_cursor", 0); /* "pygame_sdl2/mouse.pyx":58 * * def get_cursor(): * return None # <<<<<<<<<<<<<< */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(Py_None); __pyx_r = Py_None; goto __pyx_L0; /* "pygame_sdl2/mouse.pyx":57 * pass * * def get_cursor(): # <<<<<<<<<<<<<< * return None */ /* function exit code */ __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyMethodDef __pyx_methods[] = { {0, 0, 0, 0} }; #if PY_MAJOR_VERSION >= 3 static struct PyModuleDef __pyx_moduledef = { #if PY_VERSION_HEX < 0x03020000 { PyObject_HEAD_INIT(NULL) NULL, 0, NULL }, #else PyModuleDef_HEAD_INIT, #endif "mouse", 0, /* m_doc */ -1, /* m_size */ __pyx_methods /* m_methods */, NULL, /* m_reload */ NULL, /* m_traverse */ NULL, /* m_clear */ NULL /* m_free */ }; #endif static __Pyx_StringTabEntry __pyx_string_tab[] = { {&__pyx_n_s_andmasks, __pyx_k_andmasks, sizeof(__pyx_k_andmasks), 0, 0, 1, 1}, {&__pyx_n_s_get_cursor, __pyx_k_get_cursor, sizeof(__pyx_k_get_cursor), 0, 0, 1, 1}, {&__pyx_n_s_get_focused, __pyx_k_get_focused, sizeof(__pyx_k_get_focused), 0, 0, 1, 1}, {&__pyx_n_s_get_pos, __pyx_k_get_pos, sizeof(__pyx_k_get_pos), 0, 0, 1, 1}, {&__pyx_n_s_get_pressed, __pyx_k_get_pressed, sizeof(__pyx_k_get_pressed), 0, 0, 1, 1}, {&__pyx_n_s_get_rel, __pyx_k_get_rel, sizeof(__pyx_k_get_rel), 0, 0, 1, 1}, {&__pyx_kp_s_home_tom_ab_pygame_sdl2_src_pyg, __pyx_k_home_tom_ab_pygame_sdl2_src_pyg, sizeof(__pyx_k_home_tom_ab_pygame_sdl2_src_pyg), 0, 0, 1, 0}, {&__pyx_n_s_hotspot, __pyx_k_hotspot, sizeof(__pyx_k_hotspot), 0, 0, 1, 1}, {&__pyx_n_s_init, __pyx_k_init, sizeof(__pyx_k_init), 0, 0, 1, 1}, {&__pyx_n_s_main, __pyx_k_main, sizeof(__pyx_k_main), 0, 0, 1, 1}, {&__pyx_n_s_pos, __pyx_k_pos, sizeof(__pyx_k_pos), 0, 0, 1, 1}, {&__pyx_n_s_pygame_sdl2_mouse, __pyx_k_pygame_sdl2_mouse, sizeof(__pyx_k_pygame_sdl2_mouse), 0, 0, 1, 1}, {&__pyx_n_s_quit, __pyx_k_quit, sizeof(__pyx_k_quit), 0, 0, 1, 1}, {&__pyx_n_s_set_cursor, __pyx_k_set_cursor, sizeof(__pyx_k_set_cursor), 0, 0, 1, 1}, {&__pyx_n_s_set_pos, __pyx_k_set_pos, sizeof(__pyx_k_set_pos), 0, 0, 1, 1}, {&__pyx_n_s_set_visible, __pyx_k_set_visible, sizeof(__pyx_k_set_visible), 0, 0, 1, 1}, {&__pyx_n_s_size, __pyx_k_size, sizeof(__pyx_k_size), 0, 0, 1, 1}, {&__pyx_n_s_state, __pyx_k_state, sizeof(__pyx_k_state), 0, 0, 1, 1}, {&__pyx_n_s_test, __pyx_k_test, sizeof(__pyx_k_test), 0, 0, 1, 1}, {&__pyx_n_s_visible, __pyx_k_visible, sizeof(__pyx_k_visible), 0, 0, 1, 1}, {&__pyx_n_s_x, __pyx_k_x, sizeof(__pyx_k_x), 0, 0, 1, 1}, {&__pyx_n_s_xormasks, __pyx_k_xormasks, sizeof(__pyx_k_xormasks), 0, 0, 1, 1}, {&__pyx_n_s_y, __pyx_k_y, sizeof(__pyx_k_y), 0, 0, 1, 1}, {0, 0, 0, 0, 0, 0, 0} }; static int __Pyx_InitCachedBuiltins(void) { return 0; } static int __Pyx_InitCachedConstants(void) { __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__Pyx_InitCachedConstants", 0); /* "pygame_sdl2/mouse.pyx":21 * from sdl2 cimport * * * def init(): # <<<<<<<<<<<<<< * pass * */ __pyx_codeobj_ = (PyObject*)__Pyx_PyCode_New(0, 0, 0, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_tom_ab_pygame_sdl2_src_pyg, __pyx_n_s_init, 21, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj_)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 21; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "pygame_sdl2/mouse.pyx":24 * pass * * def quit(): # <<<<<<<<<<<<<< * pass * */ __pyx_codeobj__2 = (PyObject*)__Pyx_PyCode_New(0, 0, 0, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_tom_ab_pygame_sdl2_src_pyg, __pyx_n_s_quit, 24, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 24; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "pygame_sdl2/mouse.pyx":27 * pass * * def get_pressed(): # <<<<<<<<<<<<<< * cdef Uint32 state = SDL_GetMouseState(NULL, NULL) * return (1 if state & SDL_BUTTON_LMASK else 0, */ __pyx_tuple__3 = PyTuple_Pack(1, __pyx_n_s_state); if (unlikely(!__pyx_tuple__3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 27; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_tuple__3); __Pyx_GIVEREF(__pyx_tuple__3); __pyx_codeobj__4 = (PyObject*)__Pyx_PyCode_New(0, 0, 1, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__3, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_tom_ab_pygame_sdl2_src_pyg, __pyx_n_s_get_pressed, 27, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 27; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "pygame_sdl2/mouse.pyx":33 * 1 if state & SDL_BUTTON_RMASK else 0) * * def get_pos(): # <<<<<<<<<<<<<< * cdef int x, y * SDL_GetMouseState(&x, &y) */ __pyx_tuple__5 = PyTuple_Pack(2, __pyx_n_s_x, __pyx_n_s_y); if (unlikely(!__pyx_tuple__5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 33; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_tuple__5); __Pyx_GIVEREF(__pyx_tuple__5); __pyx_codeobj__6 = (PyObject*)__Pyx_PyCode_New(0, 0, 2, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__5, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_tom_ab_pygame_sdl2_src_pyg, __pyx_n_s_get_pos, 33, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 33; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "pygame_sdl2/mouse.pyx":38 * return (x, y) * * def get_rel(): # <<<<<<<<<<<<<< * cdef int x,y * SDL_GetRelativeMouseState(&x, &y) */ __pyx_tuple__7 = PyTuple_Pack(2, __pyx_n_s_x, __pyx_n_s_y); if (unlikely(!__pyx_tuple__7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 38; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_tuple__7); __Pyx_GIVEREF(__pyx_tuple__7); __pyx_codeobj__8 = (PyObject*)__Pyx_PyCode_New(0, 0, 2, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__7, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_tom_ab_pygame_sdl2_src_pyg, __pyx_n_s_get_rel, 38, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 38; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "pygame_sdl2/mouse.pyx":43 * return (x, y) * * def set_pos(pos): # <<<<<<<<<<<<<< * (x, y) = pos * SDL_WarpMouseInWindow(NULL, x, y) */ __pyx_tuple__9 = PyTuple_Pack(3, __pyx_n_s_pos, __pyx_n_s_x, __pyx_n_s_y); if (unlikely(!__pyx_tuple__9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 43; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_tuple__9); __Pyx_GIVEREF(__pyx_tuple__9); __pyx_codeobj__10 = (PyObject*)__Pyx_PyCode_New(1, 0, 3, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__9, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_tom_ab_pygame_sdl2_src_pyg, __pyx_n_s_set_pos, 43, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 43; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "pygame_sdl2/mouse.pyx":47 * SDL_WarpMouseInWindow(NULL, x, y) * * def set_visible(visible): # <<<<<<<<<<<<<< * SDL_ShowCursor(1 if visible else 0) * */ __pyx_tuple__11 = PyTuple_Pack(1, __pyx_n_s_visible); if (unlikely(!__pyx_tuple__11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 47; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_tuple__11); __Pyx_GIVEREF(__pyx_tuple__11); __pyx_codeobj__12 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__11, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_tom_ab_pygame_sdl2_src_pyg, __pyx_n_s_set_visible, 47, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__12)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 47; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "pygame_sdl2/mouse.pyx":50 * SDL_ShowCursor(1 if visible else 0) * * def get_focused(): # <<<<<<<<<<<<<< * return SDL_GetMouseFocus() != NULL * */ __pyx_codeobj__13 = (PyObject*)__Pyx_PyCode_New(0, 0, 0, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_tom_ab_pygame_sdl2_src_pyg, __pyx_n_s_get_focused, 50, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__13)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 50; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "pygame_sdl2/mouse.pyx":53 * return SDL_GetMouseFocus() != NULL * * def set_cursor(size, hotspot, xormasks, andmasks): # <<<<<<<<<<<<<< * # Does anyone use this? SDL2 has much improved custom cursor support. * pass */ __pyx_tuple__14 = PyTuple_Pack(4, __pyx_n_s_size, __pyx_n_s_hotspot, __pyx_n_s_xormasks, __pyx_n_s_andmasks); if (unlikely(!__pyx_tuple__14)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 53; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_tuple__14); __Pyx_GIVEREF(__pyx_tuple__14); __pyx_codeobj__15 = (PyObject*)__Pyx_PyCode_New(4, 0, 4, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__14, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_tom_ab_pygame_sdl2_src_pyg, __pyx_n_s_set_cursor, 53, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__15)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 53; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "pygame_sdl2/mouse.pyx":57 * pass * * def get_cursor(): # <<<<<<<<<<<<<< * return None */ __pyx_codeobj__16 = (PyObject*)__Pyx_PyCode_New(0, 0, 0, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_tom_ab_pygame_sdl2_src_pyg, __pyx_n_s_get_cursor, 57, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__16)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 57; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_RefNannyFinishContext(); return 0; __pyx_L1_error:; __Pyx_RefNannyFinishContext(); return -1; } static int __Pyx_InitGlobals(void) { if (__Pyx_InitStrings(__pyx_string_tab) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; __pyx_int_0 = PyInt_FromLong(0); if (unlikely(!__pyx_int_0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_int_1 = PyInt_FromLong(1); if (unlikely(!__pyx_int_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} return 0; __pyx_L1_error:; return -1; } #if PY_MAJOR_VERSION < 3 PyMODINIT_FUNC initmouse(void); /*proto*/ PyMODINIT_FUNC initmouse(void) #else PyMODINIT_FUNC PyInit_mouse(void); /*proto*/ PyMODINIT_FUNC PyInit_mouse(void) #endif { PyObject *__pyx_t_1 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannyDeclarations #if CYTHON_REFNANNY __Pyx_RefNanny = __Pyx_RefNannyImportAPI("refnanny"); if (!__Pyx_RefNanny) { PyErr_Clear(); __Pyx_RefNanny = __Pyx_RefNannyImportAPI("Cython.Runtime.refnanny"); if (!__Pyx_RefNanny) Py_FatalError("failed to import 'refnanny' module"); } #endif __Pyx_RefNannySetupContext("PyMODINIT_FUNC PyInit_mouse(void)", 0); if (__Pyx_check_binary_version() < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_empty_tuple = PyTuple_New(0); if (unlikely(!__pyx_empty_tuple)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_empty_bytes = PyBytes_FromStringAndSize("", 0); if (unlikely(!__pyx_empty_bytes)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} #ifdef __Pyx_CyFunction_USED if (__pyx_CyFunction_init() < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} #endif #ifdef __Pyx_FusedFunction_USED if (__pyx_FusedFunction_init() < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} #endif #ifdef __Pyx_Coroutine_USED if (__pyx_Coroutine_init() < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} #endif #ifdef __Pyx_Generator_USED if (__pyx_Generator_init() < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} #endif #ifdef __Pyx_StopAsyncIteration_USED if (__pyx_StopAsyncIteration_init() < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} #endif /*--- Library function declarations ---*/ /*--- Threads initialization code ---*/ #if defined(__PYX_FORCE_INIT_THREADS) && __PYX_FORCE_INIT_THREADS #ifdef WITH_THREAD /* Python build with threading support? */ PyEval_InitThreads(); #endif #endif /*--- Module creation code ---*/ #if PY_MAJOR_VERSION < 3 __pyx_m = Py_InitModule4("mouse", __pyx_methods, 0, 0, PYTHON_API_VERSION); Py_XINCREF(__pyx_m); #else __pyx_m = PyModule_Create(&__pyx_moduledef); #endif if (unlikely(!__pyx_m)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_d = PyModule_GetDict(__pyx_m); if (unlikely(!__pyx_d)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} Py_INCREF(__pyx_d); __pyx_b = PyImport_AddModule(__Pyx_BUILTIN_MODULE_NAME); if (unlikely(!__pyx_b)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} #if CYTHON_COMPILING_IN_PYPY Py_INCREF(__pyx_b); #endif if (PyObject_SetAttrString(__pyx_m, "__builtins__", __pyx_b) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; /*--- Initialize various global constants etc. ---*/ if (__Pyx_InitGlobals() < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} #if PY_MAJOR_VERSION < 3 && (__PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT) if (__Pyx_init_sys_getdefaultencoding_params() < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} #endif if (__pyx_module_is_main_pygame_sdl2__mouse) { if (PyObject_SetAttrString(__pyx_m, "__name__", __pyx_n_s_main) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } #if PY_MAJOR_VERSION >= 3 { PyObject *modules = PyImport_GetModuleDict(); if (unlikely(!modules)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} if (!PyDict_GetItemString(modules, "pygame_sdl2.mouse")) { if (unlikely(PyDict_SetItemString(modules, "pygame_sdl2.mouse", __pyx_m) < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } } #endif /*--- Builtin init code ---*/ if (__Pyx_InitCachedBuiltins() < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /*--- Constants init code ---*/ if (__Pyx_InitCachedConstants() < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /*--- Global init code ---*/ /*--- Variable export code ---*/ /*--- Function export code ---*/ /*--- Type init code ---*/ /*--- Type import code ---*/ /*--- Variable import code ---*/ /*--- Function import code ---*/ /*--- Execution code ---*/ #if defined(__Pyx_Generator_USED) || defined(__Pyx_Coroutine_USED) if (__Pyx_patch_abc() < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} #endif /* "pygame_sdl2/mouse.pyx":21 * from sdl2 cimport * * * def init(): # <<<<<<<<<<<<<< * pass * */ __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_11pygame_sdl2_5mouse_1init, NULL, __pyx_n_s_pygame_sdl2_mouse); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 21; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); if (PyDict_SetItem(__pyx_d, __pyx_n_s_init, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 21; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "pygame_sdl2/mouse.pyx":24 * pass * * def quit(): # <<<<<<<<<<<<<< * pass * */ __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_11pygame_sdl2_5mouse_3quit, NULL, __pyx_n_s_pygame_sdl2_mouse); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 24; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); if (PyDict_SetItem(__pyx_d, __pyx_n_s_quit, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 24; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "pygame_sdl2/mouse.pyx":27 * pass * * def get_pressed(): # <<<<<<<<<<<<<< * cdef Uint32 state = SDL_GetMouseState(NULL, NULL) * return (1 if state & SDL_BUTTON_LMASK else 0, */ __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_11pygame_sdl2_5mouse_5get_pressed, NULL, __pyx_n_s_pygame_sdl2_mouse); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 27; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); if (PyDict_SetItem(__pyx_d, __pyx_n_s_get_pressed, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 27; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "pygame_sdl2/mouse.pyx":33 * 1 if state & SDL_BUTTON_RMASK else 0) * * def get_pos(): # <<<<<<<<<<<<<< * cdef int x, y * SDL_GetMouseState(&x, &y) */ __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_11pygame_sdl2_5mouse_7get_pos, NULL, __pyx_n_s_pygame_sdl2_mouse); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 33; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); if (PyDict_SetItem(__pyx_d, __pyx_n_s_get_pos, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 33; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "pygame_sdl2/mouse.pyx":38 * return (x, y) * * def get_rel(): # <<<<<<<<<<<<<< * cdef int x,y * SDL_GetRelativeMouseState(&x, &y) */ __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_11pygame_sdl2_5mouse_9get_rel, NULL, __pyx_n_s_pygame_sdl2_mouse); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 38; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); if (PyDict_SetItem(__pyx_d, __pyx_n_s_get_rel, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 38; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "pygame_sdl2/mouse.pyx":43 * return (x, y) * * def set_pos(pos): # <<<<<<<<<<<<<< * (x, y) = pos * SDL_WarpMouseInWindow(NULL, x, y) */ __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_11pygame_sdl2_5mouse_11set_pos, NULL, __pyx_n_s_pygame_sdl2_mouse); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 43; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); if (PyDict_SetItem(__pyx_d, __pyx_n_s_set_pos, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 43; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "pygame_sdl2/mouse.pyx":47 * SDL_WarpMouseInWindow(NULL, x, y) * * def set_visible(visible): # <<<<<<<<<<<<<< * SDL_ShowCursor(1 if visible else 0) * */ __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_11pygame_sdl2_5mouse_13set_visible, NULL, __pyx_n_s_pygame_sdl2_mouse); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 47; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); if (PyDict_SetItem(__pyx_d, __pyx_n_s_set_visible, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 47; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "pygame_sdl2/mouse.pyx":50 * SDL_ShowCursor(1 if visible else 0) * * def get_focused(): # <<<<<<<<<<<<<< * return SDL_GetMouseFocus() != NULL * */ __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_11pygame_sdl2_5mouse_15get_focused, NULL, __pyx_n_s_pygame_sdl2_mouse); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 50; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); if (PyDict_SetItem(__pyx_d, __pyx_n_s_get_focused, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 50; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "pygame_sdl2/mouse.pyx":53 * return SDL_GetMouseFocus() != NULL * * def set_cursor(size, hotspot, xormasks, andmasks): # <<<<<<<<<<<<<< * # Does anyone use this? SDL2 has much improved custom cursor support. * pass */ __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_11pygame_sdl2_5mouse_17set_cursor, NULL, __pyx_n_s_pygame_sdl2_mouse); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 53; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); if (PyDict_SetItem(__pyx_d, __pyx_n_s_set_cursor, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 53; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "pygame_sdl2/mouse.pyx":57 * pass * * def get_cursor(): # <<<<<<<<<<<<<< * return None */ __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_11pygame_sdl2_5mouse_19get_cursor, NULL, __pyx_n_s_pygame_sdl2_mouse); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 57; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); if (PyDict_SetItem(__pyx_d, __pyx_n_s_get_cursor, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 57; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "pygame_sdl2/mouse.pyx":1 * # Copyright 2014 Patrick Dawson # <<<<<<<<<<<<<< * # * # This software is provided 'as-is', without any express or implied */ __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); if (PyDict_SetItem(__pyx_d, __pyx_n_s_test, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /*--- Wrapped vars code ---*/ goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); if (__pyx_m) { if (__pyx_d) { __Pyx_AddTraceback("init pygame_sdl2.mouse", __pyx_clineno, __pyx_lineno, __pyx_filename); } Py_DECREF(__pyx_m); __pyx_m = 0; } else if (!PyErr_Occurred()) { PyErr_SetString(PyExc_ImportError, "init pygame_sdl2.mouse"); } __pyx_L0:; __Pyx_RefNannyFinishContext(); #if PY_MAJOR_VERSION < 3 return; #else return __pyx_m; #endif } /* --- Runtime support code --- */ #if CYTHON_REFNANNY static __Pyx_RefNannyAPIStruct *__Pyx_RefNannyImportAPI(const char *modname) { PyObject *m = NULL, *p = NULL; void *r = NULL; m = PyImport_ImportModule((char *)modname); if (!m) goto end; p = PyObject_GetAttrString(m, (char *)"RefNannyAPI"); if (!p) goto end; r = PyLong_AsVoidPtr(p); end: Py_XDECREF(p); Py_XDECREF(m); return (__Pyx_RefNannyAPIStruct *)r; } #endif static CYTHON_INLINE void __Pyx_RaiseTooManyValuesError(Py_ssize_t expected) { PyErr_Format(PyExc_ValueError, "too many values to unpack (expected %" CYTHON_FORMAT_SSIZE_T "d)", expected); } static CYTHON_INLINE void __Pyx_RaiseNeedMoreValuesError(Py_ssize_t index) { PyErr_Format(PyExc_ValueError, "need more than %" CYTHON_FORMAT_SSIZE_T "d value%.1s to unpack", index, (index == 1) ? "" : "s"); } static CYTHON_INLINE int __Pyx_IterFinish(void) { #if CYTHON_COMPILING_IN_CPYTHON PyThreadState *tstate = PyThreadState_GET(); PyObject* exc_type = tstate->curexc_type; if (unlikely(exc_type)) { if (likely(exc_type == PyExc_StopIteration) || PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration)) { PyObject *exc_value, *exc_tb; exc_value = tstate->curexc_value; exc_tb = tstate->curexc_traceback; tstate->curexc_type = 0; tstate->curexc_value = 0; tstate->curexc_traceback = 0; Py_DECREF(exc_type); Py_XDECREF(exc_value); Py_XDECREF(exc_tb); return 0; } else { return -1; } } return 0; #else if (unlikely(PyErr_Occurred())) { if (likely(PyErr_ExceptionMatches(PyExc_StopIteration))) { PyErr_Clear(); return 0; } else { return -1; } } return 0; #endif } static int __Pyx_IternextUnpackEndCheck(PyObject *retval, Py_ssize_t expected) { if (unlikely(retval)) { Py_DECREF(retval); __Pyx_RaiseTooManyValuesError(expected); return -1; } else { return __Pyx_IterFinish(); } return 0; } static void __Pyx_RaiseArgtupleInvalid( const char* func_name, int exact, Py_ssize_t num_min, Py_ssize_t num_max, Py_ssize_t num_found) { Py_ssize_t num_expected; const char *more_or_less; if (num_found < num_min) { num_expected = num_min; more_or_less = "at least"; } else { num_expected = num_max; more_or_less = "at most"; } if (exact) { more_or_less = "exactly"; } PyErr_Format(PyExc_TypeError, "%.200s() takes %.8s %" CYTHON_FORMAT_SSIZE_T "d positional argument%.1s (%" CYTHON_FORMAT_SSIZE_T "d given)", func_name, more_or_less, num_expected, (num_expected == 1) ? "" : "s", num_found); } static void __Pyx_RaiseDoubleKeywordsError( const char* func_name, PyObject* kw_name) { PyErr_Format(PyExc_TypeError, #if PY_MAJOR_VERSION >= 3 "%s() got multiple values for keyword argument '%U'", func_name, kw_name); #else "%s() got multiple values for keyword argument '%s'", func_name, PyString_AsString(kw_name)); #endif } static int __Pyx_ParseOptionalKeywords( PyObject *kwds, PyObject **argnames[], PyObject *kwds2, PyObject *values[], Py_ssize_t num_pos_args, const char* function_name) { PyObject *key = 0, *value = 0; Py_ssize_t pos = 0; PyObject*** name; PyObject*** first_kw_arg = argnames + num_pos_args; while (PyDict_Next(kwds, &pos, &key, &value)) { name = first_kw_arg; while (*name && (**name != key)) name++; if (*name) { values[name-argnames] = value; continue; } name = first_kw_arg; #if PY_MAJOR_VERSION < 3 if (likely(PyString_CheckExact(key)) || likely(PyString_Check(key))) { while (*name) { if ((CYTHON_COMPILING_IN_PYPY || PyString_GET_SIZE(**name) == PyString_GET_SIZE(key)) && _PyString_Eq(**name, key)) { values[name-argnames] = value; break; } name++; } if (*name) continue; else { PyObject*** argname = argnames; while (argname != first_kw_arg) { if ((**argname == key) || ( (CYTHON_COMPILING_IN_PYPY || PyString_GET_SIZE(**argname) == PyString_GET_SIZE(key)) && _PyString_Eq(**argname, key))) { goto arg_passed_twice; } argname++; } } } else #endif if (likely(PyUnicode_Check(key))) { while (*name) { int cmp = (**name == key) ? 0 : #if !CYTHON_COMPILING_IN_PYPY && PY_MAJOR_VERSION >= 3 (PyUnicode_GET_SIZE(**name) != PyUnicode_GET_SIZE(key)) ? 1 : #endif PyUnicode_Compare(**name, key); if (cmp < 0 && unlikely(PyErr_Occurred())) goto bad; if (cmp == 0) { values[name-argnames] = value; break; } name++; } if (*name) continue; else { PyObject*** argname = argnames; while (argname != first_kw_arg) { int cmp = (**argname == key) ? 0 : #if !CYTHON_COMPILING_IN_PYPY && PY_MAJOR_VERSION >= 3 (PyUnicode_GET_SIZE(**argname) != PyUnicode_GET_SIZE(key)) ? 1 : #endif PyUnicode_Compare(**argname, key); if (cmp < 0 && unlikely(PyErr_Occurred())) goto bad; if (cmp == 0) goto arg_passed_twice; argname++; } } } else goto invalid_keyword_type; if (kwds2) { if (unlikely(PyDict_SetItem(kwds2, key, value))) goto bad; } else { goto invalid_keyword; } } return 0; arg_passed_twice: __Pyx_RaiseDoubleKeywordsError(function_name, key); goto bad; invalid_keyword_type: PyErr_Format(PyExc_TypeError, "%.200s() keywords must be strings", function_name); goto bad; invalid_keyword: PyErr_Format(PyExc_TypeError, #if PY_MAJOR_VERSION < 3 "%.200s() got an unexpected keyword argument '%.200s'", function_name, PyString_AsString(key)); #else "%s() got an unexpected keyword argument '%U'", function_name, key); #endif bad: return -1; } static int __pyx_bisect_code_objects(__Pyx_CodeObjectCacheEntry* entries, int count, int code_line) { int start = 0, mid = 0, end = count - 1; if (end >= 0 && code_line > entries[end].code_line) { return count; } while (start < end) { mid = start + (end - start) / 2; if (code_line < entries[mid].code_line) { end = mid; } else if (code_line > entries[mid].code_line) { start = mid + 1; } else { return mid; } } if (code_line <= entries[mid].code_line) { return mid; } else { return mid + 1; } } static PyCodeObject *__pyx_find_code_object(int code_line) { PyCodeObject* code_object; int pos; if (unlikely(!code_line) || unlikely(!__pyx_code_cache.entries)) { return NULL; } pos = __pyx_bisect_code_objects(__pyx_code_cache.entries, __pyx_code_cache.count, code_line); if (unlikely(pos >= __pyx_code_cache.count) || unlikely(__pyx_code_cache.entries[pos].code_line != code_line)) { return NULL; } code_object = __pyx_code_cache.entries[pos].code_object; Py_INCREF(code_object); return code_object; } static void __pyx_insert_code_object(int code_line, PyCodeObject* code_object) { int pos, i; __Pyx_CodeObjectCacheEntry* entries = __pyx_code_cache.entries; if (unlikely(!code_line)) { return; } if (unlikely(!entries)) { entries = (__Pyx_CodeObjectCacheEntry*)PyMem_Malloc(64*sizeof(__Pyx_CodeObjectCacheEntry)); if (likely(entries)) { __pyx_code_cache.entries = entries; __pyx_code_cache.max_count = 64; __pyx_code_cache.count = 1; entries[0].code_line = code_line; entries[0].code_object = code_object; Py_INCREF(code_object); } return; } pos = __pyx_bisect_code_objects(__pyx_code_cache.entries, __pyx_code_cache.count, code_line); if ((pos < __pyx_code_cache.count) && unlikely(__pyx_code_cache.entries[pos].code_line == code_line)) { PyCodeObject* tmp = entries[pos].code_object; entries[pos].code_object = code_object; Py_DECREF(tmp); return; } if (__pyx_code_cache.count == __pyx_code_cache.max_count) { int new_max = __pyx_code_cache.max_count + 64; entries = (__Pyx_CodeObjectCacheEntry*)PyMem_Realloc( __pyx_code_cache.entries, (size_t)new_max*sizeof(__Pyx_CodeObjectCacheEntry)); if (unlikely(!entries)) { return; } __pyx_code_cache.entries = entries; __pyx_code_cache.max_count = new_max; } for (i=__pyx_code_cache.count; i>pos; i--) { entries[i] = entries[i-1]; } entries[pos].code_line = code_line; entries[pos].code_object = code_object; __pyx_code_cache.count++; Py_INCREF(code_object); } #include "compile.h" #include "frameobject.h" #include "traceback.h" static PyCodeObject* __Pyx_CreateCodeObjectForTraceback( const char *funcname, int c_line, int py_line, const char *filename) { PyCodeObject *py_code = 0; PyObject *py_srcfile = 0; PyObject *py_funcname = 0; #if PY_MAJOR_VERSION < 3 py_srcfile = PyString_FromString(filename); #else py_srcfile = PyUnicode_FromString(filename); #endif if (!py_srcfile) goto bad; if (c_line) { #if PY_MAJOR_VERSION < 3 py_funcname = PyString_FromFormat( "%s (%s:%d)", funcname, __pyx_cfilenm, c_line); #else py_funcname = PyUnicode_FromFormat( "%s (%s:%d)", funcname, __pyx_cfilenm, c_line); #endif } else { #if PY_MAJOR_VERSION < 3 py_funcname = PyString_FromString(funcname); #else py_funcname = PyUnicode_FromString(funcname); #endif } if (!py_funcname) goto bad; py_code = __Pyx_PyCode_New( 0, 0, 0, 0, 0, __pyx_empty_bytes, /*PyObject *code,*/ __pyx_empty_tuple, /*PyObject *consts,*/ __pyx_empty_tuple, /*PyObject *names,*/ __pyx_empty_tuple, /*PyObject *varnames,*/ __pyx_empty_tuple, /*PyObject *freevars,*/ __pyx_empty_tuple, /*PyObject *cellvars,*/ py_srcfile, /*PyObject *filename,*/ py_funcname, /*PyObject *name,*/ py_line, __pyx_empty_bytes /*PyObject *lnotab*/ ); Py_DECREF(py_srcfile); Py_DECREF(py_funcname); return py_code; bad: Py_XDECREF(py_srcfile); Py_XDECREF(py_funcname); return NULL; } static void __Pyx_AddTraceback(const char *funcname, int c_line, int py_line, const char *filename) { PyCodeObject *py_code = 0; PyFrameObject *py_frame = 0; py_code = __pyx_find_code_object(c_line ? c_line : py_line); if (!py_code) { py_code = __Pyx_CreateCodeObjectForTraceback( funcname, c_line, py_line, filename); if (!py_code) goto bad; __pyx_insert_code_object(c_line ? c_line : py_line, py_code); } py_frame = PyFrame_New( PyThreadState_GET(), /*PyThreadState *tstate,*/ py_code, /*PyCodeObject *code,*/ __pyx_d, /*PyObject *globals,*/ 0 /*PyObject *locals*/ ); if (!py_frame) goto bad; py_frame->f_lineno = py_line; PyTraceBack_Here(py_frame); bad: Py_XDECREF(py_code); Py_XDECREF(py_frame); } static CYTHON_INLINE PyObject* __Pyx_PyInt_From_int(int value) { const int neg_one = (int) -1, const_zero = (int) 0; const int is_unsigned = neg_one > const_zero; if (is_unsigned) { if (sizeof(int) < sizeof(long)) { return PyInt_FromLong((long) value); } else if (sizeof(int) <= sizeof(unsigned long)) { return PyLong_FromUnsignedLong((unsigned long) value); } else if (sizeof(int) <= sizeof(unsigned PY_LONG_LONG)) { return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value); } } else { if (sizeof(int) <= sizeof(long)) { return PyInt_FromLong((long) value); } else if (sizeof(int) <= sizeof(PY_LONG_LONG)) { return PyLong_FromLongLong((PY_LONG_LONG) value); } } { int one = 1; int little = (int)*(unsigned char *)&one; unsigned char *bytes = (unsigned char *)&value; return _PyLong_FromByteArray(bytes, sizeof(int), little, !is_unsigned); } } #define __PYX_VERIFY_RETURN_INT(target_type, func_type, func_value)\ __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, 0) #define __PYX_VERIFY_RETURN_INT_EXC(target_type, func_type, func_value)\ __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, 1) #define __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, exc)\ {\ func_type value = func_value;\ if (sizeof(target_type) < sizeof(func_type)) {\ if (unlikely(value != (func_type) (target_type) value)) {\ func_type zero = 0;\ if (exc && unlikely(value == (func_type)-1 && PyErr_Occurred()))\ return (target_type) -1;\ if (is_unsigned && unlikely(value < zero))\ goto raise_neg_overflow;\ else\ goto raise_overflow;\ }\ }\ return (target_type) value;\ } #if CYTHON_USE_PYLONG_INTERNALS #include "longintrepr.h" #endif static CYTHON_INLINE int __Pyx_PyInt_As_int(PyObject *x) { const int neg_one = (int) -1, const_zero = (int) 0; const int is_unsigned = neg_one > const_zero; #if PY_MAJOR_VERSION < 3 if (likely(PyInt_Check(x))) { if (sizeof(int) < sizeof(long)) { __PYX_VERIFY_RETURN_INT(int, long, PyInt_AS_LONG(x)) } else { long val = PyInt_AS_LONG(x); if (is_unsigned && unlikely(val < 0)) { goto raise_neg_overflow; } return (int) val; } } else #endif if (likely(PyLong_Check(x))) { if (is_unsigned) { #if CYTHON_USE_PYLONG_INTERNALS const digit* digits = ((PyLongObject*)x)->ob_digit; switch (Py_SIZE(x)) { case 0: return (int) 0; case 1: __PYX_VERIFY_RETURN_INT(int, digit, digits[0]) case 2: if (8 * sizeof(int) > 1 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(int) >= 2 * PyLong_SHIFT) { return (int) (((((int)digits[1]) << PyLong_SHIFT) | (int)digits[0])); } } break; case 3: if (8 * sizeof(int) > 2 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(int) >= 3 * PyLong_SHIFT) { return (int) (((((((int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0])); } } break; case 4: if (8 * sizeof(int) > 3 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(int) >= 4 * PyLong_SHIFT) { return (int) (((((((((int)digits[3]) << PyLong_SHIFT) | (int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0])); } } break; } #endif #if CYTHON_COMPILING_IN_CPYTHON if (unlikely(Py_SIZE(x) < 0)) { goto raise_neg_overflow; } #else { int result = PyObject_RichCompareBool(x, Py_False, Py_LT); if (unlikely(result < 0)) return (int) -1; if (unlikely(result == 1)) goto raise_neg_overflow; } #endif if (sizeof(int) <= sizeof(unsigned long)) { __PYX_VERIFY_RETURN_INT_EXC(int, unsigned long, PyLong_AsUnsignedLong(x)) } else if (sizeof(int) <= sizeof(unsigned PY_LONG_LONG)) { __PYX_VERIFY_RETURN_INT_EXC(int, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x)) } } else { #if CYTHON_USE_PYLONG_INTERNALS const digit* digits = ((PyLongObject*)x)->ob_digit; switch (Py_SIZE(x)) { case 0: return (int) 0; case -1: __PYX_VERIFY_RETURN_INT(int, sdigit, -(sdigit) digits[0]) case 1: __PYX_VERIFY_RETURN_INT(int, digit, +digits[0]) case -2: if (8 * sizeof(int) - 1 > 1 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(int, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(int) - 1 > 2 * PyLong_SHIFT) { return (int) (((int)-1)*(((((int)digits[1]) << PyLong_SHIFT) | (int)digits[0]))); } } break; case 2: if (8 * sizeof(int) > 1 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(int) - 1 > 2 * PyLong_SHIFT) { return (int) ((((((int)digits[1]) << PyLong_SHIFT) | (int)digits[0]))); } } break; case -3: if (8 * sizeof(int) - 1 > 2 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(int, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(int) - 1 > 3 * PyLong_SHIFT) { return (int) (((int)-1)*(((((((int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0]))); } } break; case 3: if (8 * sizeof(int) > 2 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(int) - 1 > 3 * PyLong_SHIFT) { return (int) ((((((((int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0]))); } } break; case -4: if (8 * sizeof(int) - 1 > 3 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(int, long, -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(int) - 1 > 4 * PyLong_SHIFT) { return (int) (((int)-1)*(((((((((int)digits[3]) << PyLong_SHIFT) | (int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0]))); } } break; case 4: if (8 * sizeof(int) > 3 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(int) - 1 > 4 * PyLong_SHIFT) { return (int) ((((((((((int)digits[3]) << PyLong_SHIFT) | (int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0]))); } } break; } #endif if (sizeof(int) <= sizeof(long)) { __PYX_VERIFY_RETURN_INT_EXC(int, long, PyLong_AsLong(x)) } else if (sizeof(int) <= sizeof(PY_LONG_LONG)) { __PYX_VERIFY_RETURN_INT_EXC(int, PY_LONG_LONG, PyLong_AsLongLong(x)) } } { #if CYTHON_COMPILING_IN_PYPY && !defined(_PyLong_AsByteArray) PyErr_SetString(PyExc_RuntimeError, "_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers"); #else int val; PyObject *v = __Pyx_PyNumber_Int(x); #if PY_MAJOR_VERSION < 3 if (likely(v) && !PyLong_Check(v)) { PyObject *tmp = v; v = PyNumber_Long(tmp); Py_DECREF(tmp); } #endif if (likely(v)) { int one = 1; int is_little = (int)*(unsigned char *)&one; unsigned char *bytes = (unsigned char *)&val; int ret = _PyLong_AsByteArray((PyLongObject *)v, bytes, sizeof(val), is_little, !is_unsigned); Py_DECREF(v); if (likely(!ret)) return val; } #endif return (int) -1; } } else { int val; PyObject *tmp = __Pyx_PyNumber_Int(x); if (!tmp) return (int) -1; val = __Pyx_PyInt_As_int(tmp); Py_DECREF(tmp); return val; } raise_overflow: PyErr_SetString(PyExc_OverflowError, "value too large to convert to int"); return (int) -1; raise_neg_overflow: PyErr_SetString(PyExc_OverflowError, "can't convert negative value to int"); return (int) -1; } static CYTHON_INLINE PyObject* __Pyx_PyInt_From_long(long value) { const long neg_one = (long) -1, const_zero = (long) 0; const int is_unsigned = neg_one > const_zero; if (is_unsigned) { if (sizeof(long) < sizeof(long)) { return PyInt_FromLong((long) value); } else if (sizeof(long) <= sizeof(unsigned long)) { return PyLong_FromUnsignedLong((unsigned long) value); } else if (sizeof(long) <= sizeof(unsigned PY_LONG_LONG)) { return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value); } } else { if (sizeof(long) <= sizeof(long)) { return PyInt_FromLong((long) value); } else if (sizeof(long) <= sizeof(PY_LONG_LONG)) { return PyLong_FromLongLong((PY_LONG_LONG) value); } } { int one = 1; int little = (int)*(unsigned char *)&one; unsigned char *bytes = (unsigned char *)&value; return _PyLong_FromByteArray(bytes, sizeof(long), little, !is_unsigned); } } static CYTHON_INLINE long __Pyx_PyInt_As_long(PyObject *x) { const long neg_one = (long) -1, const_zero = (long) 0; const int is_unsigned = neg_one > const_zero; #if PY_MAJOR_VERSION < 3 if (likely(PyInt_Check(x))) { if (sizeof(long) < sizeof(long)) { __PYX_VERIFY_RETURN_INT(long, long, PyInt_AS_LONG(x)) } else { long val = PyInt_AS_LONG(x); if (is_unsigned && unlikely(val < 0)) { goto raise_neg_overflow; } return (long) val; } } else #endif if (likely(PyLong_Check(x))) { if (is_unsigned) { #if CYTHON_USE_PYLONG_INTERNALS const digit* digits = ((PyLongObject*)x)->ob_digit; switch (Py_SIZE(x)) { case 0: return (long) 0; case 1: __PYX_VERIFY_RETURN_INT(long, digit, digits[0]) case 2: if (8 * sizeof(long) > 1 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(long) >= 2 * PyLong_SHIFT) { return (long) (((((long)digits[1]) << PyLong_SHIFT) | (long)digits[0])); } } break; case 3: if (8 * sizeof(long) > 2 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(long) >= 3 * PyLong_SHIFT) { return (long) (((((((long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0])); } } break; case 4: if (8 * sizeof(long) > 3 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(long) >= 4 * PyLong_SHIFT) { return (long) (((((((((long)digits[3]) << PyLong_SHIFT) | (long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0])); } } break; } #endif #if CYTHON_COMPILING_IN_CPYTHON if (unlikely(Py_SIZE(x) < 0)) { goto raise_neg_overflow; } #else { int result = PyObject_RichCompareBool(x, Py_False, Py_LT); if (unlikely(result < 0)) return (long) -1; if (unlikely(result == 1)) goto raise_neg_overflow; } #endif if (sizeof(long) <= sizeof(unsigned long)) { __PYX_VERIFY_RETURN_INT_EXC(long, unsigned long, PyLong_AsUnsignedLong(x)) } else if (sizeof(long) <= sizeof(unsigned PY_LONG_LONG)) { __PYX_VERIFY_RETURN_INT_EXC(long, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x)) } } else { #if CYTHON_USE_PYLONG_INTERNALS const digit* digits = ((PyLongObject*)x)->ob_digit; switch (Py_SIZE(x)) { case 0: return (long) 0; case -1: __PYX_VERIFY_RETURN_INT(long, sdigit, -(sdigit) digits[0]) case 1: __PYX_VERIFY_RETURN_INT(long, digit, +digits[0]) case -2: if (8 * sizeof(long) - 1 > 1 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(long, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) { return (long) (((long)-1)*(((((long)digits[1]) << PyLong_SHIFT) | (long)digits[0]))); } } break; case 2: if (8 * sizeof(long) > 1 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) { return (long) ((((((long)digits[1]) << PyLong_SHIFT) | (long)digits[0]))); } } break; case -3: if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(long, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) { return (long) (((long)-1)*(((((((long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0]))); } } break; case 3: if (8 * sizeof(long) > 2 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) { return (long) ((((((((long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0]))); } } break; case -4: if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(long, long, -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(long) - 1 > 4 * PyLong_SHIFT) { return (long) (((long)-1)*(((((((((long)digits[3]) << PyLong_SHIFT) | (long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0]))); } } break; case 4: if (8 * sizeof(long) > 3 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(long) - 1 > 4 * PyLong_SHIFT) { return (long) ((((((((((long)digits[3]) << PyLong_SHIFT) | (long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0]))); } } break; } #endif if (sizeof(long) <= sizeof(long)) { __PYX_VERIFY_RETURN_INT_EXC(long, long, PyLong_AsLong(x)) } else if (sizeof(long) <= sizeof(PY_LONG_LONG)) { __PYX_VERIFY_RETURN_INT_EXC(long, PY_LONG_LONG, PyLong_AsLongLong(x)) } } { #if CYTHON_COMPILING_IN_PYPY && !defined(_PyLong_AsByteArray) PyErr_SetString(PyExc_RuntimeError, "_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers"); #else long val; PyObject *v = __Pyx_PyNumber_Int(x); #if PY_MAJOR_VERSION < 3 if (likely(v) && !PyLong_Check(v)) { PyObject *tmp = v; v = PyNumber_Long(tmp); Py_DECREF(tmp); } #endif if (likely(v)) { int one = 1; int is_little = (int)*(unsigned char *)&one; unsigned char *bytes = (unsigned char *)&val; int ret = _PyLong_AsByteArray((PyLongObject *)v, bytes, sizeof(val), is_little, !is_unsigned); Py_DECREF(v); if (likely(!ret)) return val; } #endif return (long) -1; } } else { long val; PyObject *tmp = __Pyx_PyNumber_Int(x); if (!tmp) return (long) -1; val = __Pyx_PyInt_As_long(tmp); Py_DECREF(tmp); return val; } raise_overflow: PyErr_SetString(PyExc_OverflowError, "value too large to convert to long"); return (long) -1; raise_neg_overflow: PyErr_SetString(PyExc_OverflowError, "can't convert negative value to long"); return (long) -1; } static int __Pyx_check_binary_version(void) { char ctversion[4], rtversion[4]; PyOS_snprintf(ctversion, 4, "%d.%d", PY_MAJOR_VERSION, PY_MINOR_VERSION); PyOS_snprintf(rtversion, 4, "%s", Py_GetVersion()); if (ctversion[0] != rtversion[0] || ctversion[2] != rtversion[2]) { char message[200]; PyOS_snprintf(message, sizeof(message), "compiletime version %s of module '%.100s' " "does not match runtime version %s", ctversion, __Pyx_MODULE_NAME, rtversion); return PyErr_WarnEx(NULL, message, 1); } return 0; } static int __Pyx_InitStrings(__Pyx_StringTabEntry *t) { while (t->p) { #if PY_MAJOR_VERSION < 3 if (t->is_unicode) { *t->p = PyUnicode_DecodeUTF8(t->s, t->n - 1, NULL); } else if (t->intern) { *t->p = PyString_InternFromString(t->s); } else { *t->p = PyString_FromStringAndSize(t->s, t->n - 1); } #else if (t->is_unicode | t->is_str) { if (t->intern) { *t->p = PyUnicode_InternFromString(t->s); } else if (t->encoding) { *t->p = PyUnicode_Decode(t->s, t->n - 1, t->encoding, NULL); } else { *t->p = PyUnicode_FromStringAndSize(t->s, t->n - 1); } } else { *t->p = PyBytes_FromStringAndSize(t->s, t->n - 1); } #endif if (!*t->p) return -1; ++t; } return 0; } static CYTHON_INLINE PyObject* __Pyx_PyUnicode_FromString(const char* c_str) { return __Pyx_PyUnicode_FromStringAndSize(c_str, (Py_ssize_t)strlen(c_str)); } static CYTHON_INLINE char* __Pyx_PyObject_AsString(PyObject* o) { Py_ssize_t ignore; return __Pyx_PyObject_AsStringAndSize(o, &ignore); } static CYTHON_INLINE char* __Pyx_PyObject_AsStringAndSize(PyObject* o, Py_ssize_t *length) { #if CYTHON_COMPILING_IN_CPYTHON && (__PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT) if ( #if PY_MAJOR_VERSION < 3 && __PYX_DEFAULT_STRING_ENCODING_IS_ASCII __Pyx_sys_getdefaultencoding_not_ascii && #endif PyUnicode_Check(o)) { #if PY_VERSION_HEX < 0x03030000 char* defenc_c; PyObject* defenc = _PyUnicode_AsDefaultEncodedString(o, NULL); if (!defenc) return NULL; defenc_c = PyBytes_AS_STRING(defenc); #if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII { char* end = defenc_c + PyBytes_GET_SIZE(defenc); char* c; for (c = defenc_c; c < end; c++) { if ((unsigned char) (*c) >= 128) { PyUnicode_AsASCIIString(o); return NULL; } } } #endif *length = PyBytes_GET_SIZE(defenc); return defenc_c; #else if (__Pyx_PyUnicode_READY(o) == -1) return NULL; #if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII if (PyUnicode_IS_ASCII(o)) { *length = PyUnicode_GET_LENGTH(o); return PyUnicode_AsUTF8(o); } else { PyUnicode_AsASCIIString(o); return NULL; } #else return PyUnicode_AsUTF8AndSize(o, length); #endif #endif } else #endif #if (!CYTHON_COMPILING_IN_PYPY) || (defined(PyByteArray_AS_STRING) && defined(PyByteArray_GET_SIZE)) if (PyByteArray_Check(o)) { *length = PyByteArray_GET_SIZE(o); return PyByteArray_AS_STRING(o); } else #endif { char* result; int r = PyBytes_AsStringAndSize(o, &result, length); if (unlikely(r < 0)) { return NULL; } else { return result; } } } static CYTHON_INLINE int __Pyx_PyObject_IsTrue(PyObject* x) { int is_true = x == Py_True; if (is_true | (x == Py_False) | (x == Py_None)) return is_true; else return PyObject_IsTrue(x); } static CYTHON_INLINE PyObject* __Pyx_PyNumber_Int(PyObject* x) { PyNumberMethods *m; const char *name = NULL; PyObject *res = NULL; #if PY_MAJOR_VERSION < 3 if (PyInt_Check(x) || PyLong_Check(x)) #else if (PyLong_Check(x)) #endif return __Pyx_NewRef(x); m = Py_TYPE(x)->tp_as_number; #if PY_MAJOR_VERSION < 3 if (m && m->nb_int) { name = "int"; res = PyNumber_Int(x); } else if (m && m->nb_long) { name = "long"; res = PyNumber_Long(x); } #else if (m && m->nb_int) { name = "int"; res = PyNumber_Long(x); } #endif if (res) { #if PY_MAJOR_VERSION < 3 if (!PyInt_Check(res) && !PyLong_Check(res)) { #else if (!PyLong_Check(res)) { #endif PyErr_Format(PyExc_TypeError, "__%.4s__ returned non-%.4s (type %.200s)", name, name, Py_TYPE(res)->tp_name); Py_DECREF(res); return NULL; } } else if (!PyErr_Occurred()) { PyErr_SetString(PyExc_TypeError, "an integer is required"); } return res; } static CYTHON_INLINE Py_ssize_t __Pyx_PyIndex_AsSsize_t(PyObject* b) { Py_ssize_t ival; PyObject *x; #if PY_MAJOR_VERSION < 3 if (likely(PyInt_CheckExact(b))) { if (sizeof(Py_ssize_t) >= sizeof(long)) return PyInt_AS_LONG(b); else return PyInt_AsSsize_t(x); } #endif if (likely(PyLong_CheckExact(b))) { #if CYTHON_USE_PYLONG_INTERNALS const digit* digits = ((PyLongObject*)b)->ob_digit; const Py_ssize_t size = Py_SIZE(b); if (likely(__Pyx_sst_abs(size) <= 1)) { ival = likely(size) ? digits[0] : 0; if (size == -1) ival = -ival; return ival; } else { switch (size) { case 2: if (8 * sizeof(Py_ssize_t) > 2 * PyLong_SHIFT) { return (Py_ssize_t) (((((size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])); } break; case -2: if (8 * sizeof(Py_ssize_t) > 2 * PyLong_SHIFT) { return -(Py_ssize_t) (((((size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])); } break; case 3: if (8 * sizeof(Py_ssize_t) > 3 * PyLong_SHIFT) { return (Py_ssize_t) (((((((size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])); } break; case -3: if (8 * sizeof(Py_ssize_t) > 3 * PyLong_SHIFT) { return -(Py_ssize_t) (((((((size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])); } break; case 4: if (8 * sizeof(Py_ssize_t) > 4 * PyLong_SHIFT) { return (Py_ssize_t) (((((((((size_t)digits[3]) << PyLong_SHIFT) | (size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])); } break; case -4: if (8 * sizeof(Py_ssize_t) > 4 * PyLong_SHIFT) { return -(Py_ssize_t) (((((((((size_t)digits[3]) << PyLong_SHIFT) | (size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])); } break; } } #endif return PyLong_AsSsize_t(b); } x = PyNumber_Index(b); if (!x) return -1; ival = PyInt_AsSsize_t(x); Py_DECREF(x); return ival; } static CYTHON_INLINE PyObject * __Pyx_PyInt_FromSize_t(size_t ival) { return PyInt_FromSize_t(ival); } #endif /* Py_PYTHON_H */ pygame_sdl2-2.1.0-for-renpy-6.99.14.1/gen/pygame_sdl2.transform.c0000664000175000017500000067366212660477774023453 0ustar tomtom00000000000000/* Generated by Cython 0.23.4 */ #define PY_SSIZE_T_CLEAN #include "Python.h" #ifndef Py_PYTHON_H #error Python headers needed to compile C extensions, please install development version of Python. #elif PY_VERSION_HEX < 0x02060000 || (0x03000000 <= PY_VERSION_HEX && PY_VERSION_HEX < 0x03020000) #error Cython requires Python 2.6+ or Python 3.2+. #else #define CYTHON_ABI "0_23_4" #include #ifndef offsetof #define offsetof(type, member) ( (size_t) & ((type*)0) -> member ) #endif #if !defined(WIN32) && !defined(MS_WINDOWS) #ifndef __stdcall #define __stdcall #endif #ifndef __cdecl #define __cdecl #endif #ifndef __fastcall #define __fastcall #endif #endif #ifndef DL_IMPORT #define DL_IMPORT(t) t #endif #ifndef DL_EXPORT #define DL_EXPORT(t) t #endif #ifndef PY_LONG_LONG #define PY_LONG_LONG LONG_LONG #endif #ifndef Py_HUGE_VAL #define Py_HUGE_VAL HUGE_VAL #endif #ifdef PYPY_VERSION #define CYTHON_COMPILING_IN_PYPY 1 #define CYTHON_COMPILING_IN_CPYTHON 0 #else #define CYTHON_COMPILING_IN_PYPY 0 #define CYTHON_COMPILING_IN_CPYTHON 1 #endif #if !defined(CYTHON_USE_PYLONG_INTERNALS) && CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x02070000 #define CYTHON_USE_PYLONG_INTERNALS 1 #endif #if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX < 0x02070600 && !defined(Py_OptimizeFlag) #define Py_OptimizeFlag 0 #endif #define __PYX_BUILD_PY_SSIZE_T "n" #define CYTHON_FORMAT_SSIZE_T "z" #if PY_MAJOR_VERSION < 3 #define __Pyx_BUILTIN_MODULE_NAME "__builtin__" #define __Pyx_PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)\ PyCode_New(a+k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos) #define __Pyx_DefaultClassType PyClass_Type #else #define __Pyx_BUILTIN_MODULE_NAME "builtins" #define __Pyx_PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)\ PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos) #define __Pyx_DefaultClassType PyType_Type #endif #ifndef Py_TPFLAGS_CHECKTYPES #define Py_TPFLAGS_CHECKTYPES 0 #endif #ifndef Py_TPFLAGS_HAVE_INDEX #define Py_TPFLAGS_HAVE_INDEX 0 #endif #ifndef Py_TPFLAGS_HAVE_NEWBUFFER #define Py_TPFLAGS_HAVE_NEWBUFFER 0 #endif #ifndef Py_TPFLAGS_HAVE_FINALIZE #define Py_TPFLAGS_HAVE_FINALIZE 0 #endif #if PY_VERSION_HEX > 0x03030000 && defined(PyUnicode_KIND) #define CYTHON_PEP393_ENABLED 1 #define __Pyx_PyUnicode_READY(op) (likely(PyUnicode_IS_READY(op)) ?\ 0 : _PyUnicode_Ready((PyObject *)(op))) #define __Pyx_PyUnicode_GET_LENGTH(u) PyUnicode_GET_LENGTH(u) #define __Pyx_PyUnicode_READ_CHAR(u, i) PyUnicode_READ_CHAR(u, i) #define __Pyx_PyUnicode_KIND(u) PyUnicode_KIND(u) #define __Pyx_PyUnicode_DATA(u) PyUnicode_DATA(u) #define __Pyx_PyUnicode_READ(k, d, i) PyUnicode_READ(k, d, i) #else #define CYTHON_PEP393_ENABLED 0 #define __Pyx_PyUnicode_READY(op) (0) #define __Pyx_PyUnicode_GET_LENGTH(u) PyUnicode_GET_SIZE(u) #define __Pyx_PyUnicode_READ_CHAR(u, i) ((Py_UCS4)(PyUnicode_AS_UNICODE(u)[i])) #define __Pyx_PyUnicode_KIND(u) (sizeof(Py_UNICODE)) #define __Pyx_PyUnicode_DATA(u) ((void*)PyUnicode_AS_UNICODE(u)) #define __Pyx_PyUnicode_READ(k, d, i) ((void)(k), (Py_UCS4)(((Py_UNICODE*)d)[i])) #endif #if CYTHON_COMPILING_IN_PYPY #define __Pyx_PyUnicode_Concat(a, b) PyNumber_Add(a, b) #define __Pyx_PyUnicode_ConcatSafe(a, b) PyNumber_Add(a, b) #else #define __Pyx_PyUnicode_Concat(a, b) PyUnicode_Concat(a, b) #define __Pyx_PyUnicode_ConcatSafe(a, b) ((unlikely((a) == Py_None) || unlikely((b) == Py_None)) ?\ PyNumber_Add(a, b) : __Pyx_PyUnicode_Concat(a, b)) #endif #if CYTHON_COMPILING_IN_PYPY && !defined(PyUnicode_Contains) #define PyUnicode_Contains(u, s) PySequence_Contains(u, s) #endif #define __Pyx_PyString_FormatSafe(a, b) ((unlikely((a) == Py_None)) ? PyNumber_Remainder(a, b) : __Pyx_PyString_Format(a, b)) #define __Pyx_PyUnicode_FormatSafe(a, b) ((unlikely((a) == Py_None)) ? PyNumber_Remainder(a, b) : PyUnicode_Format(a, b)) #if PY_MAJOR_VERSION >= 3 #define __Pyx_PyString_Format(a, b) PyUnicode_Format(a, b) #else #define __Pyx_PyString_Format(a, b) PyString_Format(a, b) #endif #if PY_MAJOR_VERSION >= 3 #define PyBaseString_Type PyUnicode_Type #define PyStringObject PyUnicodeObject #define PyString_Type PyUnicode_Type #define PyString_Check PyUnicode_Check #define PyString_CheckExact PyUnicode_CheckExact #endif #if PY_MAJOR_VERSION >= 3 #define __Pyx_PyBaseString_Check(obj) PyUnicode_Check(obj) #define __Pyx_PyBaseString_CheckExact(obj) PyUnicode_CheckExact(obj) #else #define __Pyx_PyBaseString_Check(obj) (PyString_Check(obj) || PyUnicode_Check(obj)) #define __Pyx_PyBaseString_CheckExact(obj) (PyString_CheckExact(obj) || PyUnicode_CheckExact(obj)) #endif #ifndef PySet_CheckExact #define PySet_CheckExact(obj) (Py_TYPE(obj) == &PySet_Type) #endif #define __Pyx_TypeCheck(obj, type) PyObject_TypeCheck(obj, (PyTypeObject *)type) #if PY_MAJOR_VERSION >= 3 #define PyIntObject PyLongObject #define PyInt_Type PyLong_Type #define PyInt_Check(op) PyLong_Check(op) #define PyInt_CheckExact(op) PyLong_CheckExact(op) #define PyInt_FromString PyLong_FromString #define PyInt_FromUnicode PyLong_FromUnicode #define PyInt_FromLong PyLong_FromLong #define PyInt_FromSize_t PyLong_FromSize_t #define PyInt_FromSsize_t PyLong_FromSsize_t #define PyInt_AsLong PyLong_AsLong #define PyInt_AS_LONG PyLong_AS_LONG #define PyInt_AsSsize_t PyLong_AsSsize_t #define PyInt_AsUnsignedLongMask PyLong_AsUnsignedLongMask #define PyInt_AsUnsignedLongLongMask PyLong_AsUnsignedLongLongMask #define PyNumber_Int PyNumber_Long #endif #if PY_MAJOR_VERSION >= 3 #define PyBoolObject PyLongObject #endif #if PY_MAJOR_VERSION >= 3 && CYTHON_COMPILING_IN_PYPY #ifndef PyUnicode_InternFromString #define PyUnicode_InternFromString(s) PyUnicode_FromString(s) #endif #endif #if PY_VERSION_HEX < 0x030200A4 typedef long Py_hash_t; #define __Pyx_PyInt_FromHash_t PyInt_FromLong #define __Pyx_PyInt_AsHash_t PyInt_AsLong #else #define __Pyx_PyInt_FromHash_t PyInt_FromSsize_t #define __Pyx_PyInt_AsHash_t PyInt_AsSsize_t #endif #if PY_MAJOR_VERSION >= 3 #define __Pyx_PyMethod_New(func, self, klass) ((self) ? PyMethod_New(func, self) : PyInstanceMethod_New(func)) #else #define __Pyx_PyMethod_New(func, self, klass) PyMethod_New(func, self, klass) #endif #if PY_VERSION_HEX >= 0x030500B1 #define __Pyx_PyAsyncMethodsStruct PyAsyncMethods #define __Pyx_PyType_AsAsync(obj) (Py_TYPE(obj)->tp_as_async) #elif CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3 typedef struct { unaryfunc am_await; unaryfunc am_aiter; unaryfunc am_anext; } __Pyx_PyAsyncMethodsStruct; #define __Pyx_PyType_AsAsync(obj) ((__Pyx_PyAsyncMethodsStruct*) (Py_TYPE(obj)->tp_reserved)) #else #define __Pyx_PyType_AsAsync(obj) NULL #endif #ifndef CYTHON_RESTRICT #if defined(__GNUC__) #define CYTHON_RESTRICT __restrict__ #elif defined(_MSC_VER) && _MSC_VER >= 1400 #define CYTHON_RESTRICT __restrict #elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L #define CYTHON_RESTRICT restrict #else #define CYTHON_RESTRICT #endif #endif #define __Pyx_void_to_None(void_result) ((void)(void_result), Py_INCREF(Py_None), Py_None) #ifndef CYTHON_INLINE #if defined(__GNUC__) #define CYTHON_INLINE __inline__ #elif defined(_MSC_VER) #define CYTHON_INLINE __inline #elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L #define CYTHON_INLINE inline #else #define CYTHON_INLINE #endif #endif #if defined(WIN32) || defined(MS_WINDOWS) #define _USE_MATH_DEFINES #endif #include #ifdef NAN #define __PYX_NAN() ((float) NAN) #else static CYTHON_INLINE float __PYX_NAN() { float value; memset(&value, 0xFF, sizeof(value)); return value; } #endif #if PY_MAJOR_VERSION >= 3 #define __Pyx_PyNumber_Divide(x,y) PyNumber_TrueDivide(x,y) #define __Pyx_PyNumber_InPlaceDivide(x,y) PyNumber_InPlaceTrueDivide(x,y) #else #define __Pyx_PyNumber_Divide(x,y) PyNumber_Divide(x,y) #define __Pyx_PyNumber_InPlaceDivide(x,y) PyNumber_InPlaceDivide(x,y) #endif #ifndef __PYX_EXTERN_C #ifdef __cplusplus #define __PYX_EXTERN_C extern "C" #else #define __PYX_EXTERN_C extern #endif #endif #define __PYX_HAVE__pygame_sdl2__transform #define __PYX_HAVE_API__pygame_sdl2__transform #include "stdint.h" #include "string.h" #include "stdio.h" #include "stddef.h" #include "SDL.h" #include "SDL2_rotozoom.h" #include "SDL_gfxPrimitives.h" #ifdef _OPENMP #include #endif /* _OPENMP */ #ifdef PYREX_WITHOUT_ASSERTIONS #define CYTHON_WITHOUT_ASSERTIONS #endif #ifndef CYTHON_UNUSED # if defined(__GNUC__) # if !(defined(__cplusplus)) || (__GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 4)) # define CYTHON_UNUSED __attribute__ ((__unused__)) # else # define CYTHON_UNUSED # endif # elif defined(__ICC) || (defined(__INTEL_COMPILER) && !defined(_MSC_VER)) # define CYTHON_UNUSED __attribute__ ((__unused__)) # else # define CYTHON_UNUSED # endif #endif #ifndef CYTHON_NCP_UNUSED # if CYTHON_COMPILING_IN_CPYTHON # define CYTHON_NCP_UNUSED # else # define CYTHON_NCP_UNUSED CYTHON_UNUSED # endif #endif typedef struct {PyObject **p; char *s; const Py_ssize_t n; const char* encoding; const char is_unicode; const char is_str; const char intern; } __Pyx_StringTabEntry; #define __PYX_DEFAULT_STRING_ENCODING_IS_ASCII 0 #define __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT 0 #define __PYX_DEFAULT_STRING_ENCODING "" #define __Pyx_PyObject_FromString __Pyx_PyBytes_FromString #define __Pyx_PyObject_FromStringAndSize __Pyx_PyBytes_FromStringAndSize #define __Pyx_uchar_cast(c) ((unsigned char)c) #define __Pyx_long_cast(x) ((long)x) #define __Pyx_fits_Py_ssize_t(v, type, is_signed) (\ (sizeof(type) < sizeof(Py_ssize_t)) ||\ (sizeof(type) > sizeof(Py_ssize_t) &&\ likely(v < (type)PY_SSIZE_T_MAX ||\ v == (type)PY_SSIZE_T_MAX) &&\ (!is_signed || likely(v > (type)PY_SSIZE_T_MIN ||\ v == (type)PY_SSIZE_T_MIN))) ||\ (sizeof(type) == sizeof(Py_ssize_t) &&\ (is_signed || likely(v < (type)PY_SSIZE_T_MAX ||\ v == (type)PY_SSIZE_T_MAX))) ) #if defined (__cplusplus) && __cplusplus >= 201103L #include #define __Pyx_sst_abs(value) std::abs(value) #elif SIZEOF_INT >= SIZEOF_SIZE_T #define __Pyx_sst_abs(value) abs(value) #elif SIZEOF_LONG >= SIZEOF_SIZE_T #define __Pyx_sst_abs(value) labs(value) #elif defined (_MSC_VER) && defined (_M_X64) #define __Pyx_sst_abs(value) _abs64(value) #elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L #define __Pyx_sst_abs(value) llabs(value) #elif defined (__GNUC__) #define __Pyx_sst_abs(value) __builtin_llabs(value) #else #define __Pyx_sst_abs(value) ((value<0) ? -value : value) #endif static CYTHON_INLINE char* __Pyx_PyObject_AsString(PyObject*); static CYTHON_INLINE char* __Pyx_PyObject_AsStringAndSize(PyObject*, Py_ssize_t* length); #define __Pyx_PyByteArray_FromString(s) PyByteArray_FromStringAndSize((const char*)s, strlen((const char*)s)) #define __Pyx_PyByteArray_FromStringAndSize(s, l) PyByteArray_FromStringAndSize((const char*)s, l) #define __Pyx_PyBytes_FromString PyBytes_FromString #define __Pyx_PyBytes_FromStringAndSize PyBytes_FromStringAndSize static CYTHON_INLINE PyObject* __Pyx_PyUnicode_FromString(const char*); #if PY_MAJOR_VERSION < 3 #define __Pyx_PyStr_FromString __Pyx_PyBytes_FromString #define __Pyx_PyStr_FromStringAndSize __Pyx_PyBytes_FromStringAndSize #else #define __Pyx_PyStr_FromString __Pyx_PyUnicode_FromString #define __Pyx_PyStr_FromStringAndSize __Pyx_PyUnicode_FromStringAndSize #endif #define __Pyx_PyObject_AsSString(s) ((signed char*) __Pyx_PyObject_AsString(s)) #define __Pyx_PyObject_AsUString(s) ((unsigned char*) __Pyx_PyObject_AsString(s)) #define __Pyx_PyObject_FromCString(s) __Pyx_PyObject_FromString((const char*)s) #define __Pyx_PyBytes_FromCString(s) __Pyx_PyBytes_FromString((const char*)s) #define __Pyx_PyByteArray_FromCString(s) __Pyx_PyByteArray_FromString((const char*)s) #define __Pyx_PyStr_FromCString(s) __Pyx_PyStr_FromString((const char*)s) #define __Pyx_PyUnicode_FromCString(s) __Pyx_PyUnicode_FromString((const char*)s) #if PY_MAJOR_VERSION < 3 static CYTHON_INLINE size_t __Pyx_Py_UNICODE_strlen(const Py_UNICODE *u) { const Py_UNICODE *u_end = u; while (*u_end++) ; return (size_t)(u_end - u - 1); } #else #define __Pyx_Py_UNICODE_strlen Py_UNICODE_strlen #endif #define __Pyx_PyUnicode_FromUnicode(u) PyUnicode_FromUnicode(u, __Pyx_Py_UNICODE_strlen(u)) #define __Pyx_PyUnicode_FromUnicodeAndLength PyUnicode_FromUnicode #define __Pyx_PyUnicode_AsUnicode PyUnicode_AsUnicode #define __Pyx_NewRef(obj) (Py_INCREF(obj), obj) #define __Pyx_Owned_Py_None(b) __Pyx_NewRef(Py_None) #define __Pyx_PyBool_FromLong(b) ((b) ? __Pyx_NewRef(Py_True) : __Pyx_NewRef(Py_False)) static CYTHON_INLINE int __Pyx_PyObject_IsTrue(PyObject*); static CYTHON_INLINE PyObject* __Pyx_PyNumber_Int(PyObject* x); static CYTHON_INLINE Py_ssize_t __Pyx_PyIndex_AsSsize_t(PyObject*); static CYTHON_INLINE PyObject * __Pyx_PyInt_FromSize_t(size_t); #if CYTHON_COMPILING_IN_CPYTHON #define __pyx_PyFloat_AsDouble(x) (PyFloat_CheckExact(x) ? PyFloat_AS_DOUBLE(x) : PyFloat_AsDouble(x)) #else #define __pyx_PyFloat_AsDouble(x) PyFloat_AsDouble(x) #endif #define __pyx_PyFloat_AsFloat(x) ((float) __pyx_PyFloat_AsDouble(x)) #if PY_MAJOR_VERSION < 3 && __PYX_DEFAULT_STRING_ENCODING_IS_ASCII static int __Pyx_sys_getdefaultencoding_not_ascii; static int __Pyx_init_sys_getdefaultencoding_params(void) { PyObject* sys; PyObject* default_encoding = NULL; PyObject* ascii_chars_u = NULL; PyObject* ascii_chars_b = NULL; const char* default_encoding_c; sys = PyImport_ImportModule("sys"); if (!sys) goto bad; default_encoding = PyObject_CallMethod(sys, (char*) "getdefaultencoding", NULL); Py_DECREF(sys); if (!default_encoding) goto bad; default_encoding_c = PyBytes_AsString(default_encoding); if (!default_encoding_c) goto bad; if (strcmp(default_encoding_c, "ascii") == 0) { __Pyx_sys_getdefaultencoding_not_ascii = 0; } else { char ascii_chars[128]; int c; for (c = 0; c < 128; c++) { ascii_chars[c] = c; } __Pyx_sys_getdefaultencoding_not_ascii = 1; ascii_chars_u = PyUnicode_DecodeASCII(ascii_chars, 128, NULL); if (!ascii_chars_u) goto bad; ascii_chars_b = PyUnicode_AsEncodedString(ascii_chars_u, default_encoding_c, NULL); if (!ascii_chars_b || !PyBytes_Check(ascii_chars_b) || memcmp(ascii_chars, PyBytes_AS_STRING(ascii_chars_b), 128) != 0) { PyErr_Format( PyExc_ValueError, "This module compiled with c_string_encoding=ascii, but default encoding '%.200s' is not a superset of ascii.", default_encoding_c); goto bad; } Py_DECREF(ascii_chars_u); Py_DECREF(ascii_chars_b); } Py_DECREF(default_encoding); return 0; bad: Py_XDECREF(default_encoding); Py_XDECREF(ascii_chars_u); Py_XDECREF(ascii_chars_b); return -1; } #endif #if __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT && PY_MAJOR_VERSION >= 3 #define __Pyx_PyUnicode_FromStringAndSize(c_str, size) PyUnicode_DecodeUTF8(c_str, size, NULL) #else #define __Pyx_PyUnicode_FromStringAndSize(c_str, size) PyUnicode_Decode(c_str, size, __PYX_DEFAULT_STRING_ENCODING, NULL) #if __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT static char* __PYX_DEFAULT_STRING_ENCODING; static int __Pyx_init_sys_getdefaultencoding_params(void) { PyObject* sys; PyObject* default_encoding = NULL; char* default_encoding_c; sys = PyImport_ImportModule("sys"); if (!sys) goto bad; default_encoding = PyObject_CallMethod(sys, (char*) (const char*) "getdefaultencoding", NULL); Py_DECREF(sys); if (!default_encoding) goto bad; default_encoding_c = PyBytes_AsString(default_encoding); if (!default_encoding_c) goto bad; __PYX_DEFAULT_STRING_ENCODING = (char*) malloc(strlen(default_encoding_c)); if (!__PYX_DEFAULT_STRING_ENCODING) goto bad; strcpy(__PYX_DEFAULT_STRING_ENCODING, default_encoding_c); Py_DECREF(default_encoding); return 0; bad: Py_XDECREF(default_encoding); return -1; } #endif #endif /* Test for GCC > 2.95 */ #if defined(__GNUC__) && (__GNUC__ > 2 || (__GNUC__ == 2 && (__GNUC_MINOR__ > 95))) #define likely(x) __builtin_expect(!!(x), 1) #define unlikely(x) __builtin_expect(!!(x), 0) #else /* !__GNUC__ or GCC < 2.95 */ #define likely(x) (x) #define unlikely(x) (x) #endif /* __GNUC__ */ static PyObject *__pyx_m; static PyObject *__pyx_d; static PyObject *__pyx_b; static PyObject *__pyx_empty_tuple; static PyObject *__pyx_empty_bytes; static int __pyx_lineno; static int __pyx_clineno = 0; static const char * __pyx_cfilenm= __FILE__; static const char *__pyx_filename; static const char *__pyx_f[] = { "src/pygame_sdl2/transform.pyx", "src/pygame_sdl2/surface.pxd", }; /*--- Type declarations ---*/ struct __pyx_obj_11pygame_sdl2_7surface_Surface; /* "pygame_sdl2/surface.pxd":23 * from sdl2 cimport SDL_Surface * * cdef class Surface: # <<<<<<<<<<<<<< * # Allow weak references. * cdef object __weakref__ */ struct __pyx_obj_11pygame_sdl2_7surface_Surface { PyObject_HEAD struct __pyx_vtabstruct_11pygame_sdl2_7surface_Surface *__pyx_vtab; PyObject *__weakref__; SDL_Surface *surface; int owns_surface; int window_surface; PyObject *locklist; struct __pyx_obj_11pygame_sdl2_7surface_Surface *parent; struct __pyx_obj_11pygame_sdl2_7surface_Surface *root; int offset_x; int offset_y; PyObject *get_window_flags; int has_alpha; }; struct __pyx_vtabstruct_11pygame_sdl2_7surface_Surface { void (*take_surface)(struct __pyx_obj_11pygame_sdl2_7surface_Surface *, SDL_Surface *); }; static struct __pyx_vtabstruct_11pygame_sdl2_7surface_Surface *__pyx_vtabptr_11pygame_sdl2_7surface_Surface; /* --- Runtime support code (head) --- */ #ifndef CYTHON_REFNANNY #define CYTHON_REFNANNY 0 #endif #if CYTHON_REFNANNY typedef struct { void (*INCREF)(void*, PyObject*, int); void (*DECREF)(void*, PyObject*, int); void (*GOTREF)(void*, PyObject*, int); void (*GIVEREF)(void*, PyObject*, int); void* (*SetupContext)(const char*, int, const char*); void (*FinishContext)(void**); } __Pyx_RefNannyAPIStruct; static __Pyx_RefNannyAPIStruct *__Pyx_RefNanny = NULL; static __Pyx_RefNannyAPIStruct *__Pyx_RefNannyImportAPI(const char *modname); #define __Pyx_RefNannyDeclarations void *__pyx_refnanny = NULL; #ifdef WITH_THREAD #define __Pyx_RefNannySetupContext(name, acquire_gil)\ if (acquire_gil) {\ PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure();\ __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), __LINE__, __FILE__);\ PyGILState_Release(__pyx_gilstate_save);\ } else {\ __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), __LINE__, __FILE__);\ } #else #define __Pyx_RefNannySetupContext(name, acquire_gil)\ __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), __LINE__, __FILE__) #endif #define __Pyx_RefNannyFinishContext()\ __Pyx_RefNanny->FinishContext(&__pyx_refnanny) #define __Pyx_INCREF(r) __Pyx_RefNanny->INCREF(__pyx_refnanny, (PyObject *)(r), __LINE__) #define __Pyx_DECREF(r) __Pyx_RefNanny->DECREF(__pyx_refnanny, (PyObject *)(r), __LINE__) #define __Pyx_GOTREF(r) __Pyx_RefNanny->GOTREF(__pyx_refnanny, (PyObject *)(r), __LINE__) #define __Pyx_GIVEREF(r) __Pyx_RefNanny->GIVEREF(__pyx_refnanny, (PyObject *)(r), __LINE__) #define __Pyx_XINCREF(r) do { if((r) != NULL) {__Pyx_INCREF(r); }} while(0) #define __Pyx_XDECREF(r) do { if((r) != NULL) {__Pyx_DECREF(r); }} while(0) #define __Pyx_XGOTREF(r) do { if((r) != NULL) {__Pyx_GOTREF(r); }} while(0) #define __Pyx_XGIVEREF(r) do { if((r) != NULL) {__Pyx_GIVEREF(r);}} while(0) #else #define __Pyx_RefNannyDeclarations #define __Pyx_RefNannySetupContext(name, acquire_gil) #define __Pyx_RefNannyFinishContext() #define __Pyx_INCREF(r) Py_INCREF(r) #define __Pyx_DECREF(r) Py_DECREF(r) #define __Pyx_GOTREF(r) #define __Pyx_GIVEREF(r) #define __Pyx_XINCREF(r) Py_XINCREF(r) #define __Pyx_XDECREF(r) Py_XDECREF(r) #define __Pyx_XGOTREF(r) #define __Pyx_XGIVEREF(r) #endif #define __Pyx_XDECREF_SET(r, v) do {\ PyObject *tmp = (PyObject *) r;\ r = v; __Pyx_XDECREF(tmp);\ } while (0) #define __Pyx_DECREF_SET(r, v) do {\ PyObject *tmp = (PyObject *) r;\ r = v; __Pyx_DECREF(tmp);\ } while (0) #define __Pyx_CLEAR(r) do { PyObject* tmp = ((PyObject*)(r)); r = NULL; __Pyx_DECREF(tmp);} while(0) #define __Pyx_XCLEAR(r) do { if((r) != NULL) {PyObject* tmp = ((PyObject*)(r)); r = NULL; __Pyx_DECREF(tmp);}} while(0) #if CYTHON_COMPILING_IN_CPYTHON static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStr(PyObject* obj, PyObject* attr_name) { PyTypeObject* tp = Py_TYPE(obj); if (likely(tp->tp_getattro)) return tp->tp_getattro(obj, attr_name); #if PY_MAJOR_VERSION < 3 if (likely(tp->tp_getattr)) return tp->tp_getattr(obj, PyString_AS_STRING(attr_name)); #endif return PyObject_GetAttr(obj, attr_name); } #else #define __Pyx_PyObject_GetAttrStr(o,n) PyObject_GetAttr(o,n) #endif static PyObject *__Pyx_GetBuiltinName(PyObject *name); static void __Pyx_RaiseArgtupleInvalid(const char* func_name, int exact, Py_ssize_t num_min, Py_ssize_t num_max, Py_ssize_t num_found); static void __Pyx_RaiseDoubleKeywordsError(const char* func_name, PyObject* kw_name); static int __Pyx_ParseOptionalKeywords(PyObject *kwds, PyObject **argnames[],\ PyObject *kwds2, PyObject *values[], Py_ssize_t num_pos_args,\ const char* function_name); static CYTHON_INLINE int __Pyx_ArgTypeTest(PyObject *obj, PyTypeObject *type, int none_allowed, const char *name, int exact); #if CYTHON_COMPILING_IN_CPYTHON static CYTHON_INLINE PyObject* __Pyx_PyObject_Call(PyObject *func, PyObject *arg, PyObject *kw); #else #define __Pyx_PyObject_Call(func, arg, kw) PyObject_Call(func, arg, kw) #endif #if CYTHON_COMPILING_IN_CPYTHON static CYTHON_INLINE PyObject* __Pyx_PyObject_CallMethO(PyObject *func, PyObject *arg); #endif static CYTHON_INLINE PyObject* __Pyx_PyObject_CallOneArg(PyObject *func, PyObject *arg); #if CYTHON_COMPILING_IN_CPYTHON static CYTHON_INLINE PyObject* __Pyx_PyObject_CallNoArg(PyObject *func); #else #define __Pyx_PyObject_CallNoArg(func) __Pyx_PyObject_Call(func, __pyx_empty_tuple, NULL) #endif static CYTHON_INLINE PyObject *__Pyx_GetModuleGlobalName(PyObject *name); static CYTHON_INLINE void __Pyx_ErrRestore(PyObject *type, PyObject *value, PyObject *tb); static CYTHON_INLINE void __Pyx_ErrFetch(PyObject **type, PyObject **value, PyObject **tb); static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, PyObject *cause); #ifndef __PYX_FORCE_INIT_THREADS #define __PYX_FORCE_INIT_THREADS 0 #endif static void __Pyx_WriteUnraisable(const char *name, int clineno, int lineno, const char *filename, int full_traceback, int nogil); static CYTHON_INLINE void __Pyx_RaiseTooManyValuesError(Py_ssize_t expected); static CYTHON_INLINE void __Pyx_RaiseNeedMoreValuesError(Py_ssize_t index); static CYTHON_INLINE int __Pyx_IterFinish(void); static int __Pyx_IternextUnpackEndCheck(PyObject *retval, Py_ssize_t expected); #define __Pyx_GetItemInt(o, i, type, is_signed, to_py_func, is_list, wraparound, boundscheck)\ (__Pyx_fits_Py_ssize_t(i, type, is_signed) ?\ __Pyx_GetItemInt_Fast(o, (Py_ssize_t)i, is_list, wraparound, boundscheck) :\ (is_list ? (PyErr_SetString(PyExc_IndexError, "list index out of range"), (PyObject*)NULL) :\ __Pyx_GetItemInt_Generic(o, to_py_func(i)))) #define __Pyx_GetItemInt_List(o, i, type, is_signed, to_py_func, is_list, wraparound, boundscheck)\ (__Pyx_fits_Py_ssize_t(i, type, is_signed) ?\ __Pyx_GetItemInt_List_Fast(o, (Py_ssize_t)i, wraparound, boundscheck) :\ (PyErr_SetString(PyExc_IndexError, "list index out of range"), (PyObject*)NULL)) static CYTHON_INLINE PyObject *__Pyx_GetItemInt_List_Fast(PyObject *o, Py_ssize_t i, int wraparound, int boundscheck); #define __Pyx_GetItemInt_Tuple(o, i, type, is_signed, to_py_func, is_list, wraparound, boundscheck)\ (__Pyx_fits_Py_ssize_t(i, type, is_signed) ?\ __Pyx_GetItemInt_Tuple_Fast(o, (Py_ssize_t)i, wraparound, boundscheck) :\ (PyErr_SetString(PyExc_IndexError, "tuple index out of range"), (PyObject*)NULL)) static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Tuple_Fast(PyObject *o, Py_ssize_t i, int wraparound, int boundscheck); static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Generic(PyObject *o, PyObject* j); static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Fast(PyObject *o, Py_ssize_t i, int is_list, int wraparound, int boundscheck); static void* __Pyx_GetVtable(PyObject *dict); static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list, int level); static PyObject* __Pyx_ImportFrom(PyObject* module, PyObject* name); typedef struct { int code_line; PyCodeObject* code_object; } __Pyx_CodeObjectCacheEntry; struct __Pyx_CodeObjectCache { int count; int max_count; __Pyx_CodeObjectCacheEntry* entries; }; static struct __Pyx_CodeObjectCache __pyx_code_cache = {0,0,NULL}; static int __pyx_bisect_code_objects(__Pyx_CodeObjectCacheEntry* entries, int count, int code_line); static PyCodeObject *__pyx_find_code_object(int code_line); static void __pyx_insert_code_object(int code_line, PyCodeObject* code_object); static void __Pyx_AddTraceback(const char *funcname, int c_line, int py_line, const char *filename); static CYTHON_INLINE int __Pyx_PyInt_As_int(PyObject *); static CYTHON_INLINE PyObject* __Pyx_PyInt_From_int(int value); static CYTHON_INLINE PyObject* __Pyx_PyInt_From_long(long value); static CYTHON_INLINE long __Pyx_PyInt_As_long(PyObject *); static int __Pyx_check_binary_version(void); #if !defined(__Pyx_PyIdentifier_FromString) #if PY_MAJOR_VERSION < 3 #define __Pyx_PyIdentifier_FromString(s) PyString_FromString(s) #else #define __Pyx_PyIdentifier_FromString(s) PyUnicode_FromString(s) #endif #endif static PyObject *__Pyx_ImportModule(const char *name); static PyTypeObject *__Pyx_ImportType(const char *module_name, const char *class_name, size_t size, int strict); static int __Pyx_InitStrings(__Pyx_StringTabEntry *t); /* Module declarations from 'libc.stdint' */ /* Module declarations from 'libc.string' */ /* Module declarations from 'libc.stdio' */ /* Module declarations from 'libc.stddef' */ /* Module declarations from 'sdl2' */ /* Module declarations from 'sdl2_gfx' */ /* Module declarations from 'pygame_sdl2.surface' */ static PyTypeObject *__pyx_ptype_11pygame_sdl2_7surface_Surface = 0; /* Module declarations from 'pygame_sdl2.transform' */ static uint32_t __pyx_f_11pygame_sdl2_9transform_get_at(SDL_Surface *, int, int); /*proto*/ static void __pyx_f_11pygame_sdl2_9transform_set_at(SDL_Surface *, int, int, uint32_t); /*proto*/ #define __Pyx_MODULE_NAME "pygame_sdl2.transform" int __pyx_module_is_main_pygame_sdl2__transform = 0; /* Implementation of 'pygame_sdl2.transform' */ static PyObject *__pyx_builtin_range; static char __pyx_k_a[] = "a"; static char __pyx_k_b[] = "b"; static char __pyx_k_c[] = "c"; static char __pyx_k_d[] = "d"; static char __pyx_k_e[] = "e"; static char __pyx_k_f[] = "f"; static char __pyx_k_g[] = "g"; static char __pyx_k_h[] = "h"; static char __pyx_k_i[] = "i"; static char __pyx_k_x[] = "x"; static char __pyx_k_y[] = "y"; static char __pyx_k_e0[] = "e0"; static char __pyx_k_e1[] = "e1"; static char __pyx_k_e2[] = "e2"; static char __pyx_k_e3[] = "e3"; static char __pyx_k_rv[] = "rv"; static char __pyx_k_err[] = "err"; static char __pyx_k_src[] = "src"; static char __pyx_k_dest[] = "dest"; static char __pyx_k_flip[] = "flip"; static char __pyx_k_lock[] = "lock"; static char __pyx_k_main[] = "__main__"; static char __pyx_k_size[] = "size"; static char __pyx_k_test[] = "__test__"; static char __pyx_k_angle[] = "angle"; static char __pyx_k_error[] = "error"; static char __pyx_k_range[] = "range"; static char __pyx_k_rsurf[] = "rsurf"; static char __pyx_k_scale[] = "scale"; static char __pyx_k_width[] = "width"; static char __pyx_k_xbool[] = "xbool"; static char __pyx_k_ybool[] = "ybool"; static char __pyx_k_height[] = "height"; static char __pyx_k_import[] = "__import__"; static char __pyx_k_rotate[] = "rotate"; static char __pyx_k_smooth[] = "smooth"; static char __pyx_k_unlock[] = "unlock"; static char __pyx_k_scale2x[] = "scale2x"; static char __pyx_k_scale_x[] = "scale_x"; static char __pyx_k_scale_y[] = "scale_y"; static char __pyx_k_src_end[] = "src_end"; static char __pyx_k_surface[] = "surface"; static char __pyx_k_get_size[] = "get_size"; static char __pyx_k_rotozoom[] = "rotozoom"; static char __pyx_k_surf_out[] = "surf_out"; static char __pyx_k_get_flags[] = "get_flags"; static char __pyx_k_get_width[] = "get_width"; static char __pyx_k_src_pixel[] = "src_pixel"; static char __pyx_k_dest_delta[] = "dest_delta"; static char __pyx_k_dest_pixel[] = "dest_pixel"; static char __pyx_k_get_height[] = "get_height"; static char __pyx_k_pyx_vtable[] = "__pyx_vtable__"; static char __pyx_k_DestSurface[] = "DestSurface"; static char __pyx_k_smoothscale[] = "smoothscale"; static char __pyx_k_get_bytesize[] = "get_bytesize"; static char __pyx_k_pygame_sdl2_error[] = "pygame_sdl2.error"; static char __pyx_k_pygame_sdl2_transform[] = "pygame_sdl2.transform"; static char __pyx_k_home_tom_ab_pygame_sdl2_src_pyg[] = "/home/tom/ab/pygame_sdl2/src/pygame_sdl2/transform.pyx"; static char __pyx_k_Surface_has_unsupported_bytesize[] = "Surface has unsupported bytesize."; static PyObject *__pyx_n_s_DestSurface; static PyObject *__pyx_kp_s_Surface_has_unsupported_bytesize; static PyObject *__pyx_n_s_a; static PyObject *__pyx_n_s_angle; static PyObject *__pyx_n_s_b; static PyObject *__pyx_n_s_c; static PyObject *__pyx_n_s_d; static PyObject *__pyx_n_s_dest; static PyObject *__pyx_n_s_dest_delta; static PyObject *__pyx_n_s_dest_pixel; static PyObject *__pyx_n_s_e; static PyObject *__pyx_n_s_e0; static PyObject *__pyx_n_s_e1; static PyObject *__pyx_n_s_e2; static PyObject *__pyx_n_s_e3; static PyObject *__pyx_n_s_err; static PyObject *__pyx_n_s_error; static PyObject *__pyx_n_s_f; static PyObject *__pyx_n_s_flip; static PyObject *__pyx_n_s_g; static PyObject *__pyx_n_s_get_bytesize; static PyObject *__pyx_n_s_get_flags; static PyObject *__pyx_n_s_get_height; static PyObject *__pyx_n_s_get_size; static PyObject *__pyx_n_s_get_width; static PyObject *__pyx_n_s_h; static PyObject *__pyx_n_s_height; static PyObject *__pyx_kp_s_home_tom_ab_pygame_sdl2_src_pyg; static PyObject *__pyx_n_s_i; static PyObject *__pyx_n_s_import; static PyObject *__pyx_n_s_lock; static PyObject *__pyx_n_s_main; static PyObject *__pyx_n_s_pygame_sdl2_error; static PyObject *__pyx_n_s_pygame_sdl2_transform; static PyObject *__pyx_n_s_pyx_vtable; static PyObject *__pyx_n_s_range; static PyObject *__pyx_n_s_rotate; static PyObject *__pyx_n_s_rotozoom; static PyObject *__pyx_n_s_rsurf; static PyObject *__pyx_n_s_rv; static PyObject *__pyx_n_s_scale; static PyObject *__pyx_n_s_scale2x; static PyObject *__pyx_n_s_scale_x; static PyObject *__pyx_n_s_scale_y; static PyObject *__pyx_n_s_size; static PyObject *__pyx_n_s_smooth; static PyObject *__pyx_n_s_smoothscale; static PyObject *__pyx_n_s_src; static PyObject *__pyx_n_s_src_end; static PyObject *__pyx_n_s_src_pixel; static PyObject *__pyx_n_s_surf_out; static PyObject *__pyx_n_s_surface; static PyObject *__pyx_n_s_test; static PyObject *__pyx_n_s_unlock; static PyObject *__pyx_n_s_width; static PyObject *__pyx_n_s_x; static PyObject *__pyx_n_s_xbool; static PyObject *__pyx_n_s_y; static PyObject *__pyx_n_s_ybool; static PyObject *__pyx_pf_11pygame_sdl2_9transform_flip(CYTHON_UNUSED PyObject *__pyx_self, struct __pyx_obj_11pygame_sdl2_7surface_Surface *__pyx_v_surface, int __pyx_v_xbool, int __pyx_v_ybool); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_9transform_2scale(CYTHON_UNUSED PyObject *__pyx_self, struct __pyx_obj_11pygame_sdl2_7surface_Surface *__pyx_v_surface, PyObject *__pyx_v_size, struct __pyx_obj_11pygame_sdl2_7surface_Surface *__pyx_v_DestSurface); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_9transform_4rotate(CYTHON_UNUSED PyObject *__pyx_self, struct __pyx_obj_11pygame_sdl2_7surface_Surface *__pyx_v_surface, PyObject *__pyx_v_angle); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_9transform_6rotozoom(CYTHON_UNUSED PyObject *__pyx_self, struct __pyx_obj_11pygame_sdl2_7surface_Surface *__pyx_v_surface, double __pyx_v_angle, double __pyx_v_scale, int __pyx_v_smooth); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_9transform_8scale2x(CYTHON_UNUSED PyObject *__pyx_self, struct __pyx_obj_11pygame_sdl2_7surface_Surface *__pyx_v_surface, struct __pyx_obj_11pygame_sdl2_7surface_Surface *__pyx_v_DestSurface); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_9transform_10smoothscale(CYTHON_UNUSED PyObject *__pyx_self, struct __pyx_obj_11pygame_sdl2_7surface_Surface *__pyx_v_surface, PyObject *__pyx_v_size, struct __pyx_obj_11pygame_sdl2_7surface_Surface *__pyx_v_DestSurface); /* proto */ static PyObject *__pyx_float_1_0; static PyObject *__pyx_int_0; static PyObject *__pyx_int_2; static PyObject *__pyx_int_4; static PyObject *__pyx_tuple_; static PyObject *__pyx_tuple__2; static PyObject *__pyx_tuple__3; static PyObject *__pyx_tuple__4; static PyObject *__pyx_tuple__6; static PyObject *__pyx_tuple__8; static PyObject *__pyx_tuple__10; static PyObject *__pyx_tuple__12; static PyObject *__pyx_tuple__14; static PyObject *__pyx_codeobj__5; static PyObject *__pyx_codeobj__7; static PyObject *__pyx_codeobj__9; static PyObject *__pyx_codeobj__11; static PyObject *__pyx_codeobj__13; static PyObject *__pyx_codeobj__15; /* "pygame_sdl2/transform.pyx":26 * * * def flip(Surface surface, bint xbool, bint ybool): # <<<<<<<<<<<<<< * * cdef Surface rv = Surface(surface.get_size(), surface.get_flags(), surface) */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_9transform_1flip(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static PyMethodDef __pyx_mdef_11pygame_sdl2_9transform_1flip = {"flip", (PyCFunction)__pyx_pw_11pygame_sdl2_9transform_1flip, METH_VARARGS|METH_KEYWORDS, 0}; static PyObject *__pyx_pw_11pygame_sdl2_9transform_1flip(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { struct __pyx_obj_11pygame_sdl2_7surface_Surface *__pyx_v_surface = 0; int __pyx_v_xbool; int __pyx_v_ybool; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("flip (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_surface,&__pyx_n_s_xbool,&__pyx_n_s_ybool,0}; PyObject* values[3] = {0,0,0}; if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_surface)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; case 1: if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_xbool)) != 0)) kw_args--; else { __Pyx_RaiseArgtupleInvalid("flip", 1, 3, 3, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 26; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } case 2: if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_ybool)) != 0)) kw_args--; else { __Pyx_RaiseArgtupleInvalid("flip", 1, 3, 3, 2); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 26; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "flip") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 26; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } } else if (PyTuple_GET_SIZE(__pyx_args) != 3) { goto __pyx_L5_argtuple_error; } else { values[0] = PyTuple_GET_ITEM(__pyx_args, 0); values[1] = PyTuple_GET_ITEM(__pyx_args, 1); values[2] = PyTuple_GET_ITEM(__pyx_args, 2); } __pyx_v_surface = ((struct __pyx_obj_11pygame_sdl2_7surface_Surface *)values[0]); __pyx_v_xbool = __Pyx_PyObject_IsTrue(values[1]); if (unlikely((__pyx_v_xbool == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 26; __pyx_clineno = __LINE__; goto __pyx_L3_error;} __pyx_v_ybool = __Pyx_PyObject_IsTrue(values[2]); if (unlikely((__pyx_v_ybool == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 26; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("flip", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 26; __pyx_clineno = __LINE__; goto __pyx_L3_error;} __pyx_L3_error:; __Pyx_AddTraceback("pygame_sdl2.transform.flip", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_surface), __pyx_ptype_11pygame_sdl2_7surface_Surface, 1, "surface", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 26; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_r = __pyx_pf_11pygame_sdl2_9transform_flip(__pyx_self, __pyx_v_surface, __pyx_v_xbool, __pyx_v_ybool); /* function exit code */ goto __pyx_L0; __pyx_L1_error:; __pyx_r = NULL; __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_9transform_flip(CYTHON_UNUSED PyObject *__pyx_self, struct __pyx_obj_11pygame_sdl2_7surface_Surface *__pyx_v_surface, int __pyx_v_xbool, int __pyx_v_ybool) { struct __pyx_obj_11pygame_sdl2_7surface_Surface *__pyx_v_rv = 0; SDL_Surface *__pyx_v_src; SDL_Surface *__pyx_v_dest; Uint32 *__pyx_v_src_pixel; Uint32 *__pyx_v_src_end; Uint32 *__pyx_v_dest_pixel; int __pyx_v_dest_delta; int __pyx_v_y; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; SDL_Surface *__pyx_t_5; int __pyx_t_6; int __pyx_t_7; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("flip", 0); /* "pygame_sdl2/transform.pyx":28 * def flip(Surface surface, bint xbool, bint ybool): * * cdef Surface rv = Surface(surface.get_size(), surface.get_flags(), surface) # <<<<<<<<<<<<<< * cdef SDL_Surface *src = surface.surface * cdef SDL_Surface *dest = rv.surface */ __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_surface), __pyx_n_s_get_size); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 28; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = NULL; if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_2))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); if (likely(__pyx_t_3)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); } } if (__pyx_t_3) { __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 28; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } else { __pyx_t_1 = __Pyx_PyObject_CallNoArg(__pyx_t_2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 28; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_surface), __pyx_n_s_get_flags); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 28; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = NULL; if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_3))) { __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3); if (likely(__pyx_t_4)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); __Pyx_INCREF(__pyx_t_4); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_3, function); } } if (__pyx_t_4) { __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 28; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; } else { __pyx_t_2 = __Pyx_PyObject_CallNoArg(__pyx_t_3); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 28; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_3 = PyTuple_New(3); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 28; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __Pyx_GIVEREF(__pyx_t_1); PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_1); __Pyx_GIVEREF(__pyx_t_2); PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_2); __Pyx_INCREF(((PyObject *)__pyx_v_surface)); __Pyx_GIVEREF(((PyObject *)__pyx_v_surface)); PyTuple_SET_ITEM(__pyx_t_3, 2, ((PyObject *)__pyx_v_surface)); __pyx_t_1 = 0; __pyx_t_2 = 0; __pyx_t_2 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_11pygame_sdl2_7surface_Surface), __pyx_t_3, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 28; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_v_rv = ((struct __pyx_obj_11pygame_sdl2_7surface_Surface *)__pyx_t_2); __pyx_t_2 = 0; /* "pygame_sdl2/transform.pyx":29 * * cdef Surface rv = Surface(surface.get_size(), surface.get_flags(), surface) * cdef SDL_Surface *src = surface.surface # <<<<<<<<<<<<<< * cdef SDL_Surface *dest = rv.surface * */ __pyx_t_5 = __pyx_v_surface->surface; __pyx_v_src = __pyx_t_5; /* "pygame_sdl2/transform.pyx":30 * cdef Surface rv = Surface(surface.get_size(), surface.get_flags(), surface) * cdef SDL_Surface *src = surface.surface * cdef SDL_Surface *dest = rv.surface # <<<<<<<<<<<<<< * * cdef Uint32 *src_pixel */ __pyx_t_5 = __pyx_v_rv->surface; __pyx_v_dest = __pyx_t_5; /* "pygame_sdl2/transform.pyx":40 * cdef int y * * with nogil: # <<<<<<<<<<<<<< * for 0 <= y < src.h: * */ { #ifdef WITH_THREAD PyThreadState *_save; Py_UNBLOCK_THREADS #endif /*try:*/ { /* "pygame_sdl2/transform.pyx":41 * * with nogil: * for 0 <= y < src.h: # <<<<<<<<<<<<<< * * src_pixel = (( src.pixels) + y * src.pitch) */ __pyx_t_6 = __pyx_v_src->h; for (__pyx_v_y = 0; __pyx_v_y < __pyx_t_6; __pyx_v_y++) { /* "pygame_sdl2/transform.pyx":43 * for 0 <= y < src.h: * * src_pixel = (( src.pixels) + y * src.pitch) # <<<<<<<<<<<<<< * src_end = src_pixel + src.w * */ __pyx_v_src_pixel = ((Uint32 *)(((Uint8 *)__pyx_v_src->pixels) + (__pyx_v_y * __pyx_v_src->pitch))); /* "pygame_sdl2/transform.pyx":44 * * src_pixel = (( src.pixels) + y * src.pitch) * src_end = src_pixel + src.w # <<<<<<<<<<<<<< * * if ybool: */ __pyx_v_src_end = (__pyx_v_src_pixel + __pyx_v_src->w); /* "pygame_sdl2/transform.pyx":46 * src_end = src_pixel + src.w * * if ybool: # <<<<<<<<<<<<<< * dest_pixel = (( dest.pixels) + (dest.h - y - 1) * dest.pitch) * else: */ __pyx_t_7 = (__pyx_v_ybool != 0); if (__pyx_t_7) { /* "pygame_sdl2/transform.pyx":47 * * if ybool: * dest_pixel = (( dest.pixels) + (dest.h - y - 1) * dest.pitch) # <<<<<<<<<<<<<< * else: * dest_pixel = (( dest.pixels) + y * dest.pitch) */ __pyx_v_dest_pixel = ((Uint32 *)(((Uint8 *)__pyx_v_dest->pixels) + (((__pyx_v_dest->h - __pyx_v_y) - 1) * __pyx_v_dest->pitch))); /* "pygame_sdl2/transform.pyx":46 * src_end = src_pixel + src.w * * if ybool: # <<<<<<<<<<<<<< * dest_pixel = (( dest.pixels) + (dest.h - y - 1) * dest.pitch) * else: */ goto __pyx_L8; } /* "pygame_sdl2/transform.pyx":49 * dest_pixel = (( dest.pixels) + (dest.h - y - 1) * dest.pitch) * else: * dest_pixel = (( dest.pixels) + y * dest.pitch) # <<<<<<<<<<<<<< * * if xbool: */ /*else*/ { __pyx_v_dest_pixel = ((Uint32 *)(((Uint8 *)__pyx_v_dest->pixels) + (__pyx_v_y * __pyx_v_dest->pitch))); } __pyx_L8:; /* "pygame_sdl2/transform.pyx":51 * dest_pixel = (( dest.pixels) + y * dest.pitch) * * if xbool: # <<<<<<<<<<<<<< * dest_pixel += (src.w - 1) * dest_delta = -1 */ __pyx_t_7 = (__pyx_v_xbool != 0); if (__pyx_t_7) { /* "pygame_sdl2/transform.pyx":52 * * if xbool: * dest_pixel += (src.w - 1) # <<<<<<<<<<<<<< * dest_delta = -1 * else: */ __pyx_v_dest_pixel = (__pyx_v_dest_pixel + (__pyx_v_src->w - 1)); /* "pygame_sdl2/transform.pyx":53 * if xbool: * dest_pixel += (src.w - 1) * dest_delta = -1 # <<<<<<<<<<<<<< * else: * dest_delta = 1 */ __pyx_v_dest_delta = -1; /* "pygame_sdl2/transform.pyx":51 * dest_pixel = (( dest.pixels) + y * dest.pitch) * * if xbool: # <<<<<<<<<<<<<< * dest_pixel += (src.w - 1) * dest_delta = -1 */ goto __pyx_L9; } /* "pygame_sdl2/transform.pyx":55 * dest_delta = -1 * else: * dest_delta = 1 # <<<<<<<<<<<<<< * * while src_pixel < src_end: */ /*else*/ { __pyx_v_dest_delta = 1; } __pyx_L9:; /* "pygame_sdl2/transform.pyx":57 * dest_delta = 1 * * while src_pixel < src_end: # <<<<<<<<<<<<<< * dest_pixel[0] = src_pixel[0] * src_pixel += 1 */ while (1) { __pyx_t_7 = ((__pyx_v_src_pixel < __pyx_v_src_end) != 0); if (!__pyx_t_7) break; /* "pygame_sdl2/transform.pyx":58 * * while src_pixel < src_end: * dest_pixel[0] = src_pixel[0] # <<<<<<<<<<<<<< * src_pixel += 1 * dest_pixel += dest_delta */ (__pyx_v_dest_pixel[0]) = (__pyx_v_src_pixel[0]); /* "pygame_sdl2/transform.pyx":59 * while src_pixel < src_end: * dest_pixel[0] = src_pixel[0] * src_pixel += 1 # <<<<<<<<<<<<<< * dest_pixel += dest_delta * */ __pyx_v_src_pixel = (__pyx_v_src_pixel + 1); /* "pygame_sdl2/transform.pyx":60 * dest_pixel[0] = src_pixel[0] * src_pixel += 1 * dest_pixel += dest_delta # <<<<<<<<<<<<<< * * return rv */ __pyx_v_dest_pixel = (__pyx_v_dest_pixel + __pyx_v_dest_delta); } } } /* "pygame_sdl2/transform.pyx":40 * cdef int y * * with nogil: # <<<<<<<<<<<<<< * for 0 <= y < src.h: * */ /*finally:*/ { /*normal exit:*/{ #ifdef WITH_THREAD Py_BLOCK_THREADS #endif goto __pyx_L5; } __pyx_L5:; } } /* "pygame_sdl2/transform.pyx":62 * dest_pixel += dest_delta * * return rv # <<<<<<<<<<<<<< * * */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(((PyObject *)__pyx_v_rv)); __pyx_r = ((PyObject *)__pyx_v_rv); goto __pyx_L0; /* "pygame_sdl2/transform.pyx":26 * * * def flip(Surface surface, bint xbool, bint ybool): # <<<<<<<<<<<<<< * * cdef Surface rv = Surface(surface.get_size(), surface.get_flags(), surface) */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_AddTraceback("pygame_sdl2.transform.flip", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF((PyObject *)__pyx_v_rv); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/transform.pyx":65 * * * def scale(Surface surface, size, Surface DestSurface=None): # <<<<<<<<<<<<<< * cdef Surface surf_out * cdef int err = -1 */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_9transform_3scale(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static PyMethodDef __pyx_mdef_11pygame_sdl2_9transform_3scale = {"scale", (PyCFunction)__pyx_pw_11pygame_sdl2_9transform_3scale, METH_VARARGS|METH_KEYWORDS, 0}; static PyObject *__pyx_pw_11pygame_sdl2_9transform_3scale(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { struct __pyx_obj_11pygame_sdl2_7surface_Surface *__pyx_v_surface = 0; PyObject *__pyx_v_size = 0; struct __pyx_obj_11pygame_sdl2_7surface_Surface *__pyx_v_DestSurface = 0; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("scale (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_surface,&__pyx_n_s_size,&__pyx_n_s_DestSurface,0}; PyObject* values[3] = {0,0,0}; values[2] = (PyObject *)((struct __pyx_obj_11pygame_sdl2_7surface_Surface *)Py_None); if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_surface)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; case 1: if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_size)) != 0)) kw_args--; else { __Pyx_RaiseArgtupleInvalid("scale", 0, 2, 3, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 65; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } case 2: if (kw_args > 0) { PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_DestSurface); if (value) { values[2] = value; kw_args--; } } } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "scale") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 65; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } } else { switch (PyTuple_GET_SIZE(__pyx_args)) { case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); values[0] = PyTuple_GET_ITEM(__pyx_args, 0); break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_surface = ((struct __pyx_obj_11pygame_sdl2_7surface_Surface *)values[0]); __pyx_v_size = values[1]; __pyx_v_DestSurface = ((struct __pyx_obj_11pygame_sdl2_7surface_Surface *)values[2]); } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("scale", 0, 2, 3, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 65; __pyx_clineno = __LINE__; goto __pyx_L3_error;} __pyx_L3_error:; __Pyx_AddTraceback("pygame_sdl2.transform.scale", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_surface), __pyx_ptype_11pygame_sdl2_7surface_Surface, 1, "surface", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 65; __pyx_clineno = __LINE__; goto __pyx_L1_error;} if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_DestSurface), __pyx_ptype_11pygame_sdl2_7surface_Surface, 1, "DestSurface", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 65; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_r = __pyx_pf_11pygame_sdl2_9transform_2scale(__pyx_self, __pyx_v_surface, __pyx_v_size, __pyx_v_DestSurface); /* function exit code */ goto __pyx_L0; __pyx_L1_error:; __pyx_r = NULL; __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_9transform_2scale(CYTHON_UNUSED PyObject *__pyx_self, struct __pyx_obj_11pygame_sdl2_7surface_Surface *__pyx_v_surface, PyObject *__pyx_v_size, struct __pyx_obj_11pygame_sdl2_7surface_Surface *__pyx_v_DestSurface) { struct __pyx_obj_11pygame_sdl2_7surface_Surface *__pyx_v_surf_out = 0; int __pyx_v_err; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_t_2; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("scale", 0); /* "pygame_sdl2/transform.pyx":67 * def scale(Surface surface, size, Surface DestSurface=None): * cdef Surface surf_out * cdef int err = -1 # <<<<<<<<<<<<<< * * if DestSurface == None: */ __pyx_v_err = -1; /* "pygame_sdl2/transform.pyx":69 * cdef int err = -1 * * if DestSurface == None: # <<<<<<<<<<<<<< * surf_out = Surface(size, 0, surface) * else: */ __pyx_t_1 = PyObject_RichCompare(((PyObject *)__pyx_v_DestSurface), Py_None, Py_EQ); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 69; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 69; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (__pyx_t_2) { /* "pygame_sdl2/transform.pyx":70 * * if DestSurface == None: * surf_out = Surface(size, 0, surface) # <<<<<<<<<<<<<< * else: * surf_out = DestSurface */ __pyx_t_1 = PyTuple_New(3); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 70; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __Pyx_INCREF(__pyx_v_size); __Pyx_GIVEREF(__pyx_v_size); PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_size); __Pyx_INCREF(__pyx_int_0); __Pyx_GIVEREF(__pyx_int_0); PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_int_0); __Pyx_INCREF(((PyObject *)__pyx_v_surface)); __Pyx_GIVEREF(((PyObject *)__pyx_v_surface)); PyTuple_SET_ITEM(__pyx_t_1, 2, ((PyObject *)__pyx_v_surface)); __pyx_t_3 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_11pygame_sdl2_7surface_Surface), __pyx_t_1, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 70; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_v_surf_out = ((struct __pyx_obj_11pygame_sdl2_7surface_Surface *)__pyx_t_3); __pyx_t_3 = 0; /* "pygame_sdl2/transform.pyx":69 * cdef int err = -1 * * if DestSurface == None: # <<<<<<<<<<<<<< * surf_out = Surface(size, 0, surface) * else: */ goto __pyx_L3; } /* "pygame_sdl2/transform.pyx":72 * surf_out = Surface(size, 0, surface) * else: * surf_out = DestSurface # <<<<<<<<<<<<<< * * with nogil: */ /*else*/ { __Pyx_INCREF(((PyObject *)__pyx_v_DestSurface)); __pyx_v_surf_out = __pyx_v_DestSurface; } __pyx_L3:; /* "pygame_sdl2/transform.pyx":74 * surf_out = DestSurface * * with nogil: # <<<<<<<<<<<<<< * SDL_SetSurfaceBlendMode(surface.surface, SDL_BLENDMODE_NONE) * err = SDL_UpperBlitScaled(surface.surface, NULL, surf_out.surface, NULL) */ { #ifdef WITH_THREAD PyThreadState *_save; Py_UNBLOCK_THREADS #endif /*try:*/ { /* "pygame_sdl2/transform.pyx":75 * * with nogil: * SDL_SetSurfaceBlendMode(surface.surface, SDL_BLENDMODE_NONE) # <<<<<<<<<<<<<< * err = SDL_UpperBlitScaled(surface.surface, NULL, surf_out.surface, NULL) * */ SDL_SetSurfaceBlendMode(__pyx_v_surface->surface, SDL_BLENDMODE_NONE); /* "pygame_sdl2/transform.pyx":76 * with nogil: * SDL_SetSurfaceBlendMode(surface.surface, SDL_BLENDMODE_NONE) * err = SDL_UpperBlitScaled(surface.surface, NULL, surf_out.surface, NULL) # <<<<<<<<<<<<<< * * if err != 0: */ __pyx_v_err = SDL_UpperBlitScaled(__pyx_v_surface->surface, NULL, __pyx_v_surf_out->surface, NULL); } /* "pygame_sdl2/transform.pyx":74 * surf_out = DestSurface * * with nogil: # <<<<<<<<<<<<<< * SDL_SetSurfaceBlendMode(surface.surface, SDL_BLENDMODE_NONE) * err = SDL_UpperBlitScaled(surface.surface, NULL, surf_out.surface, NULL) */ /*finally:*/ { /*normal exit:*/{ #ifdef WITH_THREAD Py_BLOCK_THREADS #endif goto __pyx_L6; } __pyx_L6:; } } /* "pygame_sdl2/transform.pyx":78 * err = SDL_UpperBlitScaled(surface.surface, NULL, surf_out.surface, NULL) * * if err != 0: # <<<<<<<<<<<<<< * raise error() * */ __pyx_t_2 = ((__pyx_v_err != 0) != 0); if (__pyx_t_2) { /* "pygame_sdl2/transform.pyx":79 * * if err != 0: * raise error() # <<<<<<<<<<<<<< * * return surf_out */ __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_error); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 79; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_t_4 = NULL; if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_1))) { __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_1); if (likely(__pyx_t_4)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1); __Pyx_INCREF(__pyx_t_4); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_1, function); } } if (__pyx_t_4) { __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_t_1, __pyx_t_4); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 79; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; } else { __pyx_t_3 = __Pyx_PyObject_CallNoArg(__pyx_t_1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 79; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_Raise(__pyx_t_3, 0, 0, 0); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; {__pyx_filename = __pyx_f[0]; __pyx_lineno = 79; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "pygame_sdl2/transform.pyx":78 * err = SDL_UpperBlitScaled(surface.surface, NULL, surf_out.surface, NULL) * * if err != 0: # <<<<<<<<<<<<<< * raise error() * */ } /* "pygame_sdl2/transform.pyx":81 * raise error() * * return surf_out # <<<<<<<<<<<<<< * * def rotate(Surface surface, angle): */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(((PyObject *)__pyx_v_surf_out)); __pyx_r = ((PyObject *)__pyx_v_surf_out); goto __pyx_L0; /* "pygame_sdl2/transform.pyx":65 * * * def scale(Surface surface, size, Surface DestSurface=None): # <<<<<<<<<<<<<< * cdef Surface surf_out * cdef int err = -1 */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_AddTraceback("pygame_sdl2.transform.scale", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF((PyObject *)__pyx_v_surf_out); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/transform.pyx":83 * return surf_out * * def rotate(Surface surface, angle): # <<<<<<<<<<<<<< * # rotateSurface90Degrees always returns NULL without setting an error?? * # cdef SDL_Surface *rsurf */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_9transform_5rotate(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static PyMethodDef __pyx_mdef_11pygame_sdl2_9transform_5rotate = {"rotate", (PyCFunction)__pyx_pw_11pygame_sdl2_9transform_5rotate, METH_VARARGS|METH_KEYWORDS, 0}; static PyObject *__pyx_pw_11pygame_sdl2_9transform_5rotate(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { struct __pyx_obj_11pygame_sdl2_7surface_Surface *__pyx_v_surface = 0; PyObject *__pyx_v_angle = 0; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("rotate (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_surface,&__pyx_n_s_angle,0}; PyObject* values[2] = {0,0}; if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_surface)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; case 1: if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_angle)) != 0)) kw_args--; else { __Pyx_RaiseArgtupleInvalid("rotate", 1, 2, 2, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 83; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "rotate") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 83; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } } else if (PyTuple_GET_SIZE(__pyx_args) != 2) { goto __pyx_L5_argtuple_error; } else { values[0] = PyTuple_GET_ITEM(__pyx_args, 0); values[1] = PyTuple_GET_ITEM(__pyx_args, 1); } __pyx_v_surface = ((struct __pyx_obj_11pygame_sdl2_7surface_Surface *)values[0]); __pyx_v_angle = values[1]; } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("rotate", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 83; __pyx_clineno = __LINE__; goto __pyx_L3_error;} __pyx_L3_error:; __Pyx_AddTraceback("pygame_sdl2.transform.rotate", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_surface), __pyx_ptype_11pygame_sdl2_7surface_Surface, 1, "surface", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 83; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_r = __pyx_pf_11pygame_sdl2_9transform_4rotate(__pyx_self, __pyx_v_surface, __pyx_v_angle); /* function exit code */ goto __pyx_L0; __pyx_L1_error:; __pyx_r = NULL; __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_9transform_4rotate(CYTHON_UNUSED PyObject *__pyx_self, struct __pyx_obj_11pygame_sdl2_7surface_Surface *__pyx_v_surface, PyObject *__pyx_v_angle) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; Py_ssize_t __pyx_t_5; PyObject *__pyx_t_6 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("rotate", 0); /* "pygame_sdl2/transform.pyx":90 * # if rsurf == NULL: * # raise error() * return rotozoom(surface, angle, 1.0, SMOOTHING_OFF) # <<<<<<<<<<<<<< * * def rotozoom(Surface surface, double angle, double scale, int smooth=1): */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_rotozoom); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 90; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = __Pyx_PyInt_From_int(SMOOTHING_OFF); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 90; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = NULL; __pyx_t_5 = 0; if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_2))) { __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_2); if (likely(__pyx_t_4)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_4); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); __pyx_t_5 = 1; } } __pyx_t_6 = PyTuple_New(4+__pyx_t_5); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 90; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_6); if (__pyx_t_4) { __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_4); __pyx_t_4 = NULL; } __Pyx_INCREF(((PyObject *)__pyx_v_surface)); __Pyx_GIVEREF(((PyObject *)__pyx_v_surface)); PyTuple_SET_ITEM(__pyx_t_6, 0+__pyx_t_5, ((PyObject *)__pyx_v_surface)); __Pyx_INCREF(__pyx_v_angle); __Pyx_GIVEREF(__pyx_v_angle); PyTuple_SET_ITEM(__pyx_t_6, 1+__pyx_t_5, __pyx_v_angle); __Pyx_INCREF(__pyx_float_1_0); __Pyx_GIVEREF(__pyx_float_1_0); PyTuple_SET_ITEM(__pyx_t_6, 2+__pyx_t_5, __pyx_float_1_0); __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_6, 3+__pyx_t_5, __pyx_t_3); __pyx_t_3 = 0; __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_6, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 90; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "pygame_sdl2/transform.pyx":83 * return surf_out * * def rotate(Surface surface, angle): # <<<<<<<<<<<<<< * # rotateSurface90Degrees always returns NULL without setting an error?? * # cdef SDL_Surface *rsurf */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_6); __Pyx_AddTraceback("pygame_sdl2.transform.rotate", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/transform.pyx":92 * return rotozoom(surface, angle, 1.0, SMOOTHING_OFF) * * def rotozoom(Surface surface, double angle, double scale, int smooth=1): # <<<<<<<<<<<<<< * cdef SDL_Surface *rsurf = NULL * cdef Surface rv */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_9transform_7rotozoom(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static PyMethodDef __pyx_mdef_11pygame_sdl2_9transform_7rotozoom = {"rotozoom", (PyCFunction)__pyx_pw_11pygame_sdl2_9transform_7rotozoom, METH_VARARGS|METH_KEYWORDS, 0}; static PyObject *__pyx_pw_11pygame_sdl2_9transform_7rotozoom(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { struct __pyx_obj_11pygame_sdl2_7surface_Surface *__pyx_v_surface = 0; double __pyx_v_angle; double __pyx_v_scale; int __pyx_v_smooth; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("rotozoom (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_surface,&__pyx_n_s_angle,&__pyx_n_s_scale,&__pyx_n_s_smooth,0}; PyObject* values[4] = {0,0,0,0}; if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_surface)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; case 1: if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_angle)) != 0)) kw_args--; else { __Pyx_RaiseArgtupleInvalid("rotozoom", 0, 3, 4, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 92; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } case 2: if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_scale)) != 0)) kw_args--; else { __Pyx_RaiseArgtupleInvalid("rotozoom", 0, 3, 4, 2); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 92; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } case 3: if (kw_args > 0) { PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_smooth); if (value) { values[3] = value; kw_args--; } } } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "rotozoom") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 92; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } } else { switch (PyTuple_GET_SIZE(__pyx_args)) { case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); values[1] = PyTuple_GET_ITEM(__pyx_args, 1); values[0] = PyTuple_GET_ITEM(__pyx_args, 0); break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_surface = ((struct __pyx_obj_11pygame_sdl2_7surface_Surface *)values[0]); __pyx_v_angle = __pyx_PyFloat_AsDouble(values[1]); if (unlikely((__pyx_v_angle == (double)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 92; __pyx_clineno = __LINE__; goto __pyx_L3_error;} __pyx_v_scale = __pyx_PyFloat_AsDouble(values[2]); if (unlikely((__pyx_v_scale == (double)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 92; __pyx_clineno = __LINE__; goto __pyx_L3_error;} if (values[3]) { __pyx_v_smooth = __Pyx_PyInt_As_int(values[3]); if (unlikely((__pyx_v_smooth == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 92; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } else { __pyx_v_smooth = ((int)1); } } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("rotozoom", 0, 3, 4, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 92; __pyx_clineno = __LINE__; goto __pyx_L3_error;} __pyx_L3_error:; __Pyx_AddTraceback("pygame_sdl2.transform.rotozoom", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_surface), __pyx_ptype_11pygame_sdl2_7surface_Surface, 1, "surface", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 92; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_r = __pyx_pf_11pygame_sdl2_9transform_6rotozoom(__pyx_self, __pyx_v_surface, __pyx_v_angle, __pyx_v_scale, __pyx_v_smooth); /* function exit code */ goto __pyx_L0; __pyx_L1_error:; __pyx_r = NULL; __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_9transform_6rotozoom(CYTHON_UNUSED PyObject *__pyx_self, struct __pyx_obj_11pygame_sdl2_7surface_Surface *__pyx_v_surface, double __pyx_v_angle, double __pyx_v_scale, int __pyx_v_smooth) { SDL_Surface *__pyx_v_rsurf; struct __pyx_obj_11pygame_sdl2_7surface_Surface *__pyx_v_rv = 0; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("rotozoom", 0); /* "pygame_sdl2/transform.pyx":93 * * def rotozoom(Surface surface, double angle, double scale, int smooth=1): * cdef SDL_Surface *rsurf = NULL # <<<<<<<<<<<<<< * cdef Surface rv * */ __pyx_v_rsurf = NULL; /* "pygame_sdl2/transform.pyx":96 * cdef Surface rv * * with nogil: # <<<<<<<<<<<<<< * rsurf = rotozoomSurface(surface.surface, angle, scale, smooth) * */ { #ifdef WITH_THREAD PyThreadState *_save; Py_UNBLOCK_THREADS #endif /*try:*/ { /* "pygame_sdl2/transform.pyx":97 * * with nogil: * rsurf = rotozoomSurface(surface.surface, angle, scale, smooth) # <<<<<<<<<<<<<< * * if rsurf == NULL: */ __pyx_v_rsurf = rotozoomSurface(__pyx_v_surface->surface, __pyx_v_angle, __pyx_v_scale, __pyx_v_smooth); } /* "pygame_sdl2/transform.pyx":96 * cdef Surface rv * * with nogil: # <<<<<<<<<<<<<< * rsurf = rotozoomSurface(surface.surface, angle, scale, smooth) * */ /*finally:*/ { /*normal exit:*/{ #ifdef WITH_THREAD Py_BLOCK_THREADS #endif goto __pyx_L5; } __pyx_L5:; } } /* "pygame_sdl2/transform.pyx":99 * rsurf = rotozoomSurface(surface.surface, angle, scale, smooth) * * if rsurf == NULL: # <<<<<<<<<<<<<< * raise error() * */ __pyx_t_1 = ((__pyx_v_rsurf == NULL) != 0); if (__pyx_t_1) { /* "pygame_sdl2/transform.pyx":100 * * if rsurf == NULL: * raise error() # <<<<<<<<<<<<<< * * rv = Surface(()) */ __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_error); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 100; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = NULL; if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_3))) { __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3); if (likely(__pyx_t_4)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); __Pyx_INCREF(__pyx_t_4); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_3, function); } } if (__pyx_t_4) { __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 100; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; } else { __pyx_t_2 = __Pyx_PyObject_CallNoArg(__pyx_t_3); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 100; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_Raise(__pyx_t_2, 0, 0, 0); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; {__pyx_filename = __pyx_f[0]; __pyx_lineno = 100; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "pygame_sdl2/transform.pyx":99 * rsurf = rotozoomSurface(surface.surface, angle, scale, smooth) * * if rsurf == NULL: # <<<<<<<<<<<<<< * raise error() * */ } /* "pygame_sdl2/transform.pyx":102 * raise error() * * rv = Surface(()) # <<<<<<<<<<<<<< * rv.take_surface(rsurf) * */ __pyx_t_2 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_11pygame_sdl2_7surface_Surface), __pyx_tuple_, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 102; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __pyx_v_rv = ((struct __pyx_obj_11pygame_sdl2_7surface_Surface *)__pyx_t_2); __pyx_t_2 = 0; /* "pygame_sdl2/transform.pyx":103 * * rv = Surface(()) * rv.take_surface(rsurf) # <<<<<<<<<<<<<< * * return rv */ ((struct __pyx_vtabstruct_11pygame_sdl2_7surface_Surface *)__pyx_v_rv->__pyx_vtab)->take_surface(__pyx_v_rv, __pyx_v_rsurf); /* "pygame_sdl2/transform.pyx":105 * rv.take_surface(rsurf) * * return rv # <<<<<<<<<<<<<< * * cdef uint32_t get_at(SDL_Surface *surf, int x, int y) nogil: */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(((PyObject *)__pyx_v_rv)); __pyx_r = ((PyObject *)__pyx_v_rv); goto __pyx_L0; /* "pygame_sdl2/transform.pyx":92 * return rotozoom(surface, angle, 1.0, SMOOTHING_OFF) * * def rotozoom(Surface surface, double angle, double scale, int smooth=1): # <<<<<<<<<<<<<< * cdef SDL_Surface *rsurf = NULL * cdef Surface rv */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_AddTraceback("pygame_sdl2.transform.rotozoom", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF((PyObject *)__pyx_v_rv); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/transform.pyx":107 * return rv * * cdef uint32_t get_at(SDL_Surface *surf, int x, int y) nogil: # <<<<<<<<<<<<<< * if x < 0: * x = 0 */ static uint32_t __pyx_f_11pygame_sdl2_9transform_get_at(SDL_Surface *__pyx_v_surf, int __pyx_v_x, int __pyx_v_y) { uint32_t *__pyx_v_p; uint32_t __pyx_r; int __pyx_t_1; size_t __pyx_t_2; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; /* "pygame_sdl2/transform.pyx":108 * * cdef uint32_t get_at(SDL_Surface *surf, int x, int y) nogil: * if x < 0: # <<<<<<<<<<<<<< * x = 0 * elif x >= surf.w: */ __pyx_t_1 = ((__pyx_v_x < 0) != 0); if (__pyx_t_1) { /* "pygame_sdl2/transform.pyx":109 * cdef uint32_t get_at(SDL_Surface *surf, int x, int y) nogil: * if x < 0: * x = 0 # <<<<<<<<<<<<<< * elif x >= surf.w: * x = surf.w - 1 */ __pyx_v_x = 0; /* "pygame_sdl2/transform.pyx":108 * * cdef uint32_t get_at(SDL_Surface *surf, int x, int y) nogil: * if x < 0: # <<<<<<<<<<<<<< * x = 0 * elif x >= surf.w: */ goto __pyx_L3; } /* "pygame_sdl2/transform.pyx":110 * if x < 0: * x = 0 * elif x >= surf.w: # <<<<<<<<<<<<<< * x = surf.w - 1 * if y < 0: */ __pyx_t_1 = ((__pyx_v_x >= __pyx_v_surf->w) != 0); if (__pyx_t_1) { /* "pygame_sdl2/transform.pyx":111 * x = 0 * elif x >= surf.w: * x = surf.w - 1 # <<<<<<<<<<<<<< * if y < 0: * y = 0 */ __pyx_v_x = (__pyx_v_surf->w - 1); /* "pygame_sdl2/transform.pyx":110 * if x < 0: * x = 0 * elif x >= surf.w: # <<<<<<<<<<<<<< * x = surf.w - 1 * if y < 0: */ } __pyx_L3:; /* "pygame_sdl2/transform.pyx":112 * elif x >= surf.w: * x = surf.w - 1 * if y < 0: # <<<<<<<<<<<<<< * y = 0 * elif y >= surf.h: */ __pyx_t_1 = ((__pyx_v_y < 0) != 0); if (__pyx_t_1) { /* "pygame_sdl2/transform.pyx":113 * x = surf.w - 1 * if y < 0: * y = 0 # <<<<<<<<<<<<<< * elif y >= surf.h: * y = surf.h - 1 */ __pyx_v_y = 0; /* "pygame_sdl2/transform.pyx":112 * elif x >= surf.w: * x = surf.w - 1 * if y < 0: # <<<<<<<<<<<<<< * y = 0 * elif y >= surf.h: */ goto __pyx_L4; } /* "pygame_sdl2/transform.pyx":114 * if y < 0: * y = 0 * elif y >= surf.h: # <<<<<<<<<<<<<< * y = surf.h - 1 * */ __pyx_t_1 = ((__pyx_v_y >= __pyx_v_surf->h) != 0); if (__pyx_t_1) { /* "pygame_sdl2/transform.pyx":115 * y = 0 * elif y >= surf.h: * y = surf.h - 1 # <<<<<<<<<<<<<< * * cdef uint32_t *p = surf.pixels */ __pyx_v_y = (__pyx_v_surf->h - 1); /* "pygame_sdl2/transform.pyx":114 * if y < 0: * y = 0 * elif y >= surf.h: # <<<<<<<<<<<<<< * y = surf.h - 1 * */ } __pyx_L4:; /* "pygame_sdl2/transform.pyx":117 * y = surf.h - 1 * * cdef uint32_t *p = surf.pixels # <<<<<<<<<<<<<< * p += y * (surf.pitch // sizeof(uint32_t)) * p += x */ __pyx_v_p = ((uint32_t *)__pyx_v_surf->pixels); /* "pygame_sdl2/transform.pyx":118 * * cdef uint32_t *p = surf.pixels * p += y * (surf.pitch // sizeof(uint32_t)) # <<<<<<<<<<<<<< * p += x * return p[0] */ __pyx_t_2 = (sizeof(uint32_t)); if (unlikely(__pyx_t_2 == 0)) { #ifdef WITH_THREAD PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure(); #endif PyErr_SetString(PyExc_ZeroDivisionError, "integer division or modulo by zero"); #ifdef WITH_THREAD PyGILState_Release(__pyx_gilstate_save); #endif {__pyx_filename = __pyx_f[0]; __pyx_lineno = 118; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } __pyx_v_p = (__pyx_v_p + (__pyx_v_y * (__pyx_v_surf->pitch / __pyx_t_2))); /* "pygame_sdl2/transform.pyx":119 * cdef uint32_t *p = surf.pixels * p += y * (surf.pitch // sizeof(uint32_t)) * p += x # <<<<<<<<<<<<<< * return p[0] * */ __pyx_v_p = (__pyx_v_p + __pyx_v_x); /* "pygame_sdl2/transform.pyx":120 * p += y * (surf.pitch // sizeof(uint32_t)) * p += x * return p[0] # <<<<<<<<<<<<<< * * cdef void set_at(SDL_Surface *surf, int x, int y, uint32_t color) nogil: */ __pyx_r = (__pyx_v_p[0]); goto __pyx_L0; /* "pygame_sdl2/transform.pyx":107 * return rv * * cdef uint32_t get_at(SDL_Surface *surf, int x, int y) nogil: # <<<<<<<<<<<<<< * if x < 0: * x = 0 */ /* function exit code */ __pyx_L1_error:; __Pyx_WriteUnraisable("pygame_sdl2.transform.get_at", __pyx_clineno, __pyx_lineno, __pyx_filename, 0, 1); __pyx_r = 0; __pyx_L0:; return __pyx_r; } /* "pygame_sdl2/transform.pyx":122 * return p[0] * * cdef void set_at(SDL_Surface *surf, int x, int y, uint32_t color) nogil: # <<<<<<<<<<<<<< * cdef uint32_t *p = surf.pixels * p += y * (surf.pitch // sizeof(uint32_t)) */ static void __pyx_f_11pygame_sdl2_9transform_set_at(SDL_Surface *__pyx_v_surf, int __pyx_v_x, int __pyx_v_y, uint32_t __pyx_v_color) { uint32_t *__pyx_v_p; size_t __pyx_t_1; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; /* "pygame_sdl2/transform.pyx":123 * * cdef void set_at(SDL_Surface *surf, int x, int y, uint32_t color) nogil: * cdef uint32_t *p = surf.pixels # <<<<<<<<<<<<<< * p += y * (surf.pitch // sizeof(uint32_t)) * p += x */ __pyx_v_p = ((uint32_t *)__pyx_v_surf->pixels); /* "pygame_sdl2/transform.pyx":124 * cdef void set_at(SDL_Surface *surf, int x, int y, uint32_t color) nogil: * cdef uint32_t *p = surf.pixels * p += y * (surf.pitch // sizeof(uint32_t)) # <<<<<<<<<<<<<< * p += x * p[0] = color */ __pyx_t_1 = (sizeof(uint32_t)); if (unlikely(__pyx_t_1 == 0)) { #ifdef WITH_THREAD PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure(); #endif PyErr_SetString(PyExc_ZeroDivisionError, "integer division or modulo by zero"); #ifdef WITH_THREAD PyGILState_Release(__pyx_gilstate_save); #endif {__pyx_filename = __pyx_f[0]; __pyx_lineno = 124; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } __pyx_v_p = (__pyx_v_p + (__pyx_v_y * (__pyx_v_surf->pitch / __pyx_t_1))); /* "pygame_sdl2/transform.pyx":125 * cdef uint32_t *p = surf.pixels * p += y * (surf.pitch // sizeof(uint32_t)) * p += x # <<<<<<<<<<<<<< * p[0] = color * */ __pyx_v_p = (__pyx_v_p + __pyx_v_x); /* "pygame_sdl2/transform.pyx":126 * p += y * (surf.pitch // sizeof(uint32_t)) * p += x * p[0] = color # <<<<<<<<<<<<<< * * def scale2x(Surface surface, Surface DestSurface=None): */ (__pyx_v_p[0]) = __pyx_v_color; /* "pygame_sdl2/transform.pyx":122 * return p[0] * * cdef void set_at(SDL_Surface *surf, int x, int y, uint32_t color) nogil: # <<<<<<<<<<<<<< * cdef uint32_t *p = surf.pixels * p += y * (surf.pitch // sizeof(uint32_t)) */ /* function exit code */ goto __pyx_L0; __pyx_L1_error:; __Pyx_WriteUnraisable("pygame_sdl2.transform.set_at", __pyx_clineno, __pyx_lineno, __pyx_filename, 0, 1); __pyx_L0:; } /* "pygame_sdl2/transform.pyx":128 * p[0] = color * * def scale2x(Surface surface, Surface DestSurface=None): # <<<<<<<<<<<<<< * cdef int x, y * */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_9transform_9scale2x(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static PyMethodDef __pyx_mdef_11pygame_sdl2_9transform_9scale2x = {"scale2x", (PyCFunction)__pyx_pw_11pygame_sdl2_9transform_9scale2x, METH_VARARGS|METH_KEYWORDS, 0}; static PyObject *__pyx_pw_11pygame_sdl2_9transform_9scale2x(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { struct __pyx_obj_11pygame_sdl2_7surface_Surface *__pyx_v_surface = 0; struct __pyx_obj_11pygame_sdl2_7surface_Surface *__pyx_v_DestSurface = 0; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("scale2x (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_surface,&__pyx_n_s_DestSurface,0}; PyObject* values[2] = {0,0}; values[1] = (PyObject *)((struct __pyx_obj_11pygame_sdl2_7surface_Surface *)Py_None); if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_surface)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; case 1: if (kw_args > 0) { PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_DestSurface); if (value) { values[1] = value; kw_args--; } } } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "scale2x") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 128; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } } else { switch (PyTuple_GET_SIZE(__pyx_args)) { case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_surface = ((struct __pyx_obj_11pygame_sdl2_7surface_Surface *)values[0]); __pyx_v_DestSurface = ((struct __pyx_obj_11pygame_sdl2_7surface_Surface *)values[1]); } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("scale2x", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 128; __pyx_clineno = __LINE__; goto __pyx_L3_error;} __pyx_L3_error:; __Pyx_AddTraceback("pygame_sdl2.transform.scale2x", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_surface), __pyx_ptype_11pygame_sdl2_7surface_Surface, 1, "surface", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 128; __pyx_clineno = __LINE__; goto __pyx_L1_error;} if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_DestSurface), __pyx_ptype_11pygame_sdl2_7surface_Surface, 1, "DestSurface", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 128; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_r = __pyx_pf_11pygame_sdl2_9transform_8scale2x(__pyx_self, __pyx_v_surface, __pyx_v_DestSurface); /* function exit code */ goto __pyx_L0; __pyx_L1_error:; __pyx_r = NULL; __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_9transform_8scale2x(CYTHON_UNUSED PyObject *__pyx_self, struct __pyx_obj_11pygame_sdl2_7surface_Surface *__pyx_v_surface, struct __pyx_obj_11pygame_sdl2_7surface_Surface *__pyx_v_DestSurface) { int __pyx_v_x; int __pyx_v_y; CYTHON_UNUSED uint32_t __pyx_v_a; uint32_t __pyx_v_b; CYTHON_UNUSED uint32_t __pyx_v_c; uint32_t __pyx_v_d; uint32_t __pyx_v_e; uint32_t __pyx_v_f; CYTHON_UNUSED uint32_t __pyx_v_g; uint32_t __pyx_v_h; CYTHON_UNUSED uint32_t __pyx_v_i; uint32_t __pyx_v_e0; uint32_t __pyx_v_e1; uint32_t __pyx_v_e2; uint32_t __pyx_v_e3; struct __pyx_obj_11pygame_sdl2_7surface_Surface *__pyx_v_surf_out = 0; int __pyx_v_width; int __pyx_v_height; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; int __pyx_t_4; PyObject *__pyx_t_5 = NULL; PyObject *(*__pyx_t_6)(PyObject *); int __pyx_t_7; int __pyx_t_8; int __pyx_t_9; int __pyx_t_10; int __pyx_t_11; uint32_t __pyx_t_12; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("scale2x", 0); /* "pygame_sdl2/transform.pyx":134 * cdef uint32_t e0, e1, e2, e3 * * if surface.get_bytesize() != 4: # <<<<<<<<<<<<<< * raise error("Surface has unsupported bytesize.") * */ __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_surface), __pyx_n_s_get_bytesize); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 134; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = NULL; if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_2))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); if (likely(__pyx_t_3)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); } } if (__pyx_t_3) { __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 134; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } else { __pyx_t_1 = __Pyx_PyObject_CallNoArg(__pyx_t_2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 134; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_2 = PyObject_RichCompare(__pyx_t_1, __pyx_int_4, Py_NE); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 134; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_4 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 134; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; if (__pyx_t_4) { /* "pygame_sdl2/transform.pyx":135 * * if surface.get_bytesize() != 4: * raise error("Surface has unsupported bytesize.") # <<<<<<<<<<<<<< * * cdef Surface surf_out = DestSurface */ __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_error); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 135; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_tuple__2, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 135; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_Raise(__pyx_t_1, 0, 0, 0); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; {__pyx_filename = __pyx_f[0]; __pyx_lineno = 135; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "pygame_sdl2/transform.pyx":134 * cdef uint32_t e0, e1, e2, e3 * * if surface.get_bytesize() != 4: # <<<<<<<<<<<<<< * raise error("Surface has unsupported bytesize.") * */ } /* "pygame_sdl2/transform.pyx":137 * raise error("Surface has unsupported bytesize.") * * cdef Surface surf_out = DestSurface # <<<<<<<<<<<<<< * if surf_out == None: * surf_out = Surface((surface.get_width()*2, surface.get_height()*2), 0, surface) */ __Pyx_INCREF(((PyObject *)__pyx_v_DestSurface)); __pyx_v_surf_out = __pyx_v_DestSurface; /* "pygame_sdl2/transform.pyx":138 * * cdef Surface surf_out = DestSurface * if surf_out == None: # <<<<<<<<<<<<<< * surf_out = Surface((surface.get_width()*2, surface.get_height()*2), 0, surface) * */ __pyx_t_1 = PyObject_RichCompare(((PyObject *)__pyx_v_surf_out), Py_None, Py_EQ); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 138; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_4 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 138; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (__pyx_t_4) { /* "pygame_sdl2/transform.pyx":139 * cdef Surface surf_out = DestSurface * if surf_out == None: * surf_out = Surface((surface.get_width()*2, surface.get_height()*2), 0, surface) # <<<<<<<<<<<<<< * * surface.lock() */ __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_surface), __pyx_n_s_get_width); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 139; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = NULL; if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_2))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); if (likely(__pyx_t_3)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); } } if (__pyx_t_3) { __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 139; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } else { __pyx_t_1 = __Pyx_PyObject_CallNoArg(__pyx_t_2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 139; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_2 = PyNumber_Multiply(__pyx_t_1, __pyx_int_2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 139; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_surface), __pyx_n_s_get_height); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 139; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __pyx_t_5 = NULL; if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_3))) { __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_3); if (likely(__pyx_t_5)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); __Pyx_INCREF(__pyx_t_5); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_3, function); } } if (__pyx_t_5) { __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_5); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 139; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; } else { __pyx_t_1 = __Pyx_PyObject_CallNoArg(__pyx_t_3); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 139; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_3 = PyNumber_Multiply(__pyx_t_1, __pyx_int_2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 139; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 139; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __Pyx_GIVEREF(__pyx_t_2); PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_2); __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_t_3); __pyx_t_2 = 0; __pyx_t_3 = 0; __pyx_t_3 = PyTuple_New(3); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 139; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __Pyx_GIVEREF(__pyx_t_1); PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_1); __Pyx_INCREF(__pyx_int_0); __Pyx_GIVEREF(__pyx_int_0); PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_int_0); __Pyx_INCREF(((PyObject *)__pyx_v_surface)); __Pyx_GIVEREF(((PyObject *)__pyx_v_surface)); PyTuple_SET_ITEM(__pyx_t_3, 2, ((PyObject *)__pyx_v_surface)); __pyx_t_1 = 0; __pyx_t_1 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_11pygame_sdl2_7surface_Surface), __pyx_t_3, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 139; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF_SET(__pyx_v_surf_out, ((struct __pyx_obj_11pygame_sdl2_7surface_Surface *)__pyx_t_1)); __pyx_t_1 = 0; /* "pygame_sdl2/transform.pyx":138 * * cdef Surface surf_out = DestSurface * if surf_out == None: # <<<<<<<<<<<<<< * surf_out = Surface((surface.get_width()*2, surface.get_height()*2), 0, surface) * */ } /* "pygame_sdl2/transform.pyx":141 * surf_out = Surface((surface.get_width()*2, surface.get_height()*2), 0, surface) * * surface.lock() # <<<<<<<<<<<<<< * surf_out.lock() * */ __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_surface), __pyx_n_s_lock); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 141; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __pyx_t_2 = NULL; if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_3))) { __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_3); if (likely(__pyx_t_2)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); __Pyx_INCREF(__pyx_t_2); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_3, function); } } if (__pyx_t_2) { __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 141; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } else { __pyx_t_1 = __Pyx_PyObject_CallNoArg(__pyx_t_3); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 141; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "pygame_sdl2/transform.pyx":142 * * surface.lock() * surf_out.lock() # <<<<<<<<<<<<<< * * cdef int width, height */ __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_surf_out), __pyx_n_s_lock); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 142; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __pyx_t_2 = NULL; if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_3))) { __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_3); if (likely(__pyx_t_2)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); __Pyx_INCREF(__pyx_t_2); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_3, function); } } if (__pyx_t_2) { __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 142; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } else { __pyx_t_1 = __Pyx_PyObject_CallNoArg(__pyx_t_3); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 142; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "pygame_sdl2/transform.pyx":145 * * cdef int width, height * width, height = surface.get_size() # <<<<<<<<<<<<<< * * with nogil: */ __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_surface), __pyx_n_s_get_size); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 145; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __pyx_t_2 = NULL; if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_3))) { __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_3); if (likely(__pyx_t_2)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); __Pyx_INCREF(__pyx_t_2); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_3, function); } } if (__pyx_t_2) { __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 145; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } else { __pyx_t_1 = __Pyx_PyObject_CallNoArg(__pyx_t_3); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 145; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; if ((likely(PyTuple_CheckExact(__pyx_t_1))) || (PyList_CheckExact(__pyx_t_1))) { PyObject* sequence = __pyx_t_1; #if CYTHON_COMPILING_IN_CPYTHON Py_ssize_t size = Py_SIZE(sequence); #else Py_ssize_t size = PySequence_Size(sequence); #endif if (unlikely(size != 2)) { if (size > 2) __Pyx_RaiseTooManyValuesError(2); else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 145; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } #if CYTHON_COMPILING_IN_CPYTHON if (likely(PyTuple_CheckExact(sequence))) { __pyx_t_3 = PyTuple_GET_ITEM(sequence, 0); __pyx_t_2 = PyTuple_GET_ITEM(sequence, 1); } else { __pyx_t_3 = PyList_GET_ITEM(sequence, 0); __pyx_t_2 = PyList_GET_ITEM(sequence, 1); } __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(__pyx_t_2); #else __pyx_t_3 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 145; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __pyx_t_2 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 145; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); #endif __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; } else { Py_ssize_t index = -1; __pyx_t_5 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 145; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_6 = Py_TYPE(__pyx_t_5)->tp_iternext; index = 0; __pyx_t_3 = __pyx_t_6(__pyx_t_5); if (unlikely(!__pyx_t_3)) goto __pyx_L5_unpacking_failed; __Pyx_GOTREF(__pyx_t_3); index = 1; __pyx_t_2 = __pyx_t_6(__pyx_t_5); if (unlikely(!__pyx_t_2)) goto __pyx_L5_unpacking_failed; __Pyx_GOTREF(__pyx_t_2); if (__Pyx_IternextUnpackEndCheck(__pyx_t_6(__pyx_t_5), 2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 145; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_t_6 = NULL; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; goto __pyx_L6_unpacking_done; __pyx_L5_unpacking_failed:; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __pyx_t_6 = NULL; if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 145; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_L6_unpacking_done:; } __pyx_t_7 = __Pyx_PyInt_As_int(__pyx_t_3); if (unlikely((__pyx_t_7 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 145; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_8 = __Pyx_PyInt_As_int(__pyx_t_2); if (unlikely((__pyx_t_8 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 145; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_v_width = __pyx_t_7; __pyx_v_height = __pyx_t_8; /* "pygame_sdl2/transform.pyx":147 * width, height = surface.get_size() * * with nogil: # <<<<<<<<<<<<<< * for x in range(width): * for y in range(height): */ { #ifdef WITH_THREAD PyThreadState *_save; Py_UNBLOCK_THREADS #endif /*try:*/ { /* "pygame_sdl2/transform.pyx":148 * * with nogil: * for x in range(width): # <<<<<<<<<<<<<< * for y in range(height): * # Get the surrounding 9 pixels. */ __pyx_t_8 = __pyx_v_width; for (__pyx_t_7 = 0; __pyx_t_7 < __pyx_t_8; __pyx_t_7+=1) { __pyx_v_x = __pyx_t_7; /* "pygame_sdl2/transform.pyx":149 * with nogil: * for x in range(width): * for y in range(height): # <<<<<<<<<<<<<< * # Get the surrounding 9 pixels. * a = get_at(surface.surface, x - 1, y - 1) */ __pyx_t_9 = __pyx_v_height; for (__pyx_t_10 = 0; __pyx_t_10 < __pyx_t_9; __pyx_t_10+=1) { __pyx_v_y = __pyx_t_10; /* "pygame_sdl2/transform.pyx":151 * for y in range(height): * # Get the surrounding 9 pixels. * a = get_at(surface.surface, x - 1, y - 1) # <<<<<<<<<<<<<< * b = get_at(surface.surface, x, y - 1) * c = get_at(surface.surface, x + 1, y - 1) */ __pyx_v_a = __pyx_f_11pygame_sdl2_9transform_get_at(__pyx_v_surface->surface, (__pyx_v_x - 1), (__pyx_v_y - 1)); /* "pygame_sdl2/transform.pyx":152 * # Get the surrounding 9 pixels. * a = get_at(surface.surface, x - 1, y - 1) * b = get_at(surface.surface, x, y - 1) # <<<<<<<<<<<<<< * c = get_at(surface.surface, x + 1, y - 1) * */ __pyx_v_b = __pyx_f_11pygame_sdl2_9transform_get_at(__pyx_v_surface->surface, __pyx_v_x, (__pyx_v_y - 1)); /* "pygame_sdl2/transform.pyx":153 * a = get_at(surface.surface, x - 1, y - 1) * b = get_at(surface.surface, x, y - 1) * c = get_at(surface.surface, x + 1, y - 1) # <<<<<<<<<<<<<< * * d = get_at(surface.surface, x - 1, y) */ __pyx_v_c = __pyx_f_11pygame_sdl2_9transform_get_at(__pyx_v_surface->surface, (__pyx_v_x + 1), (__pyx_v_y - 1)); /* "pygame_sdl2/transform.pyx":155 * c = get_at(surface.surface, x + 1, y - 1) * * d = get_at(surface.surface, x - 1, y) # <<<<<<<<<<<<<< * e = get_at(surface.surface, x, y) * f = get_at(surface.surface, x + 1, y) */ __pyx_v_d = __pyx_f_11pygame_sdl2_9transform_get_at(__pyx_v_surface->surface, (__pyx_v_x - 1), __pyx_v_y); /* "pygame_sdl2/transform.pyx":156 * * d = get_at(surface.surface, x - 1, y) * e = get_at(surface.surface, x, y) # <<<<<<<<<<<<<< * f = get_at(surface.surface, x + 1, y) * */ __pyx_v_e = __pyx_f_11pygame_sdl2_9transform_get_at(__pyx_v_surface->surface, __pyx_v_x, __pyx_v_y); /* "pygame_sdl2/transform.pyx":157 * d = get_at(surface.surface, x - 1, y) * e = get_at(surface.surface, x, y) * f = get_at(surface.surface, x + 1, y) # <<<<<<<<<<<<<< * * g = get_at(surface.surface, x - 1, y + 1) */ __pyx_v_f = __pyx_f_11pygame_sdl2_9transform_get_at(__pyx_v_surface->surface, (__pyx_v_x + 1), __pyx_v_y); /* "pygame_sdl2/transform.pyx":159 * f = get_at(surface.surface, x + 1, y) * * g = get_at(surface.surface, x - 1, y + 1) # <<<<<<<<<<<<<< * h = get_at(surface.surface, x, y + 1) * i = get_at(surface.surface, x + 1, y + 1) */ __pyx_v_g = __pyx_f_11pygame_sdl2_9transform_get_at(__pyx_v_surface->surface, (__pyx_v_x - 1), (__pyx_v_y + 1)); /* "pygame_sdl2/transform.pyx":160 * * g = get_at(surface.surface, x - 1, y + 1) * h = get_at(surface.surface, x, y + 1) # <<<<<<<<<<<<<< * i = get_at(surface.surface, x + 1, y + 1) * */ __pyx_v_h = __pyx_f_11pygame_sdl2_9transform_get_at(__pyx_v_surface->surface, __pyx_v_x, (__pyx_v_y + 1)); /* "pygame_sdl2/transform.pyx":161 * g = get_at(surface.surface, x - 1, y + 1) * h = get_at(surface.surface, x, y + 1) * i = get_at(surface.surface, x + 1, y + 1) # <<<<<<<<<<<<<< * * # Expand the center pixel. */ __pyx_v_i = __pyx_f_11pygame_sdl2_9transform_get_at(__pyx_v_surface->surface, (__pyx_v_x + 1), (__pyx_v_y + 1)); /* "pygame_sdl2/transform.pyx":164 * * # Expand the center pixel. * if b != h and d != f: # <<<<<<<<<<<<<< * e0 = d if d == b else e * e1 = f if b == f else e */ __pyx_t_11 = ((__pyx_v_b != __pyx_v_h) != 0); if (__pyx_t_11) { } else { __pyx_t_4 = __pyx_t_11; goto __pyx_L15_bool_binop_done; } __pyx_t_11 = ((__pyx_v_d != __pyx_v_f) != 0); __pyx_t_4 = __pyx_t_11; __pyx_L15_bool_binop_done:; if (__pyx_t_4) { /* "pygame_sdl2/transform.pyx":165 * # Expand the center pixel. * if b != h and d != f: * e0 = d if d == b else e # <<<<<<<<<<<<<< * e1 = f if b == f else e * e2 = d if d == h else e */ if (((__pyx_v_d == __pyx_v_b) != 0)) { __pyx_t_12 = __pyx_v_d; } else { __pyx_t_12 = __pyx_v_e; } __pyx_v_e0 = __pyx_t_12; /* "pygame_sdl2/transform.pyx":166 * if b != h and d != f: * e0 = d if d == b else e * e1 = f if b == f else e # <<<<<<<<<<<<<< * e2 = d if d == h else e * e3 = f if h == f else e */ if (((__pyx_v_b == __pyx_v_f) != 0)) { __pyx_t_12 = __pyx_v_f; } else { __pyx_t_12 = __pyx_v_e; } __pyx_v_e1 = __pyx_t_12; /* "pygame_sdl2/transform.pyx":167 * e0 = d if d == b else e * e1 = f if b == f else e * e2 = d if d == h else e # <<<<<<<<<<<<<< * e3 = f if h == f else e * else: */ if (((__pyx_v_d == __pyx_v_h) != 0)) { __pyx_t_12 = __pyx_v_d; } else { __pyx_t_12 = __pyx_v_e; } __pyx_v_e2 = __pyx_t_12; /* "pygame_sdl2/transform.pyx":168 * e1 = f if b == f else e * e2 = d if d == h else e * e3 = f if h == f else e # <<<<<<<<<<<<<< * else: * e0 = e1 = e2 = e3 = e */ if (((__pyx_v_h == __pyx_v_f) != 0)) { __pyx_t_12 = __pyx_v_f; } else { __pyx_t_12 = __pyx_v_e; } __pyx_v_e3 = __pyx_t_12; /* "pygame_sdl2/transform.pyx":164 * * # Expand the center pixel. * if b != h and d != f: # <<<<<<<<<<<<<< * e0 = d if d == b else e * e1 = f if b == f else e */ goto __pyx_L14; } /* "pygame_sdl2/transform.pyx":170 * e3 = f if h == f else e * else: * e0 = e1 = e2 = e3 = e # <<<<<<<<<<<<<< * * set_at(surf_out.surface, x*2, y*2, e0) */ /*else*/ { __pyx_v_e0 = __pyx_v_e; __pyx_v_e1 = __pyx_v_e; __pyx_v_e2 = __pyx_v_e; __pyx_v_e3 = __pyx_v_e; } __pyx_L14:; /* "pygame_sdl2/transform.pyx":172 * e0 = e1 = e2 = e3 = e * * set_at(surf_out.surface, x*2, y*2, e0) # <<<<<<<<<<<<<< * set_at(surf_out.surface, (x*2)+1, y*2, e1) * set_at(surf_out.surface, x*2, (y*2)+1, e2) */ __pyx_f_11pygame_sdl2_9transform_set_at(__pyx_v_surf_out->surface, (__pyx_v_x * 2), (__pyx_v_y * 2), __pyx_v_e0); /* "pygame_sdl2/transform.pyx":173 * * set_at(surf_out.surface, x*2, y*2, e0) * set_at(surf_out.surface, (x*2)+1, y*2, e1) # <<<<<<<<<<<<<< * set_at(surf_out.surface, x*2, (y*2)+1, e2) * set_at(surf_out.surface, (x*2)+1, (y*2)+1, e3) */ __pyx_f_11pygame_sdl2_9transform_set_at(__pyx_v_surf_out->surface, ((__pyx_v_x * 2) + 1), (__pyx_v_y * 2), __pyx_v_e1); /* "pygame_sdl2/transform.pyx":174 * set_at(surf_out.surface, x*2, y*2, e0) * set_at(surf_out.surface, (x*2)+1, y*2, e1) * set_at(surf_out.surface, x*2, (y*2)+1, e2) # <<<<<<<<<<<<<< * set_at(surf_out.surface, (x*2)+1, (y*2)+1, e3) * */ __pyx_f_11pygame_sdl2_9transform_set_at(__pyx_v_surf_out->surface, (__pyx_v_x * 2), ((__pyx_v_y * 2) + 1), __pyx_v_e2); /* "pygame_sdl2/transform.pyx":175 * set_at(surf_out.surface, (x*2)+1, y*2, e1) * set_at(surf_out.surface, x*2, (y*2)+1, e2) * set_at(surf_out.surface, (x*2)+1, (y*2)+1, e3) # <<<<<<<<<<<<<< * * surf_out.unlock() */ __pyx_f_11pygame_sdl2_9transform_set_at(__pyx_v_surf_out->surface, ((__pyx_v_x * 2) + 1), ((__pyx_v_y * 2) + 1), __pyx_v_e3); } } } /* "pygame_sdl2/transform.pyx":147 * width, height = surface.get_size() * * with nogil: # <<<<<<<<<<<<<< * for x in range(width): * for y in range(height): */ /*finally:*/ { /*normal exit:*/{ #ifdef WITH_THREAD Py_BLOCK_THREADS #endif goto __pyx_L9; } __pyx_L9:; } } /* "pygame_sdl2/transform.pyx":177 * set_at(surf_out.surface, (x*2)+1, (y*2)+1, e3) * * surf_out.unlock() # <<<<<<<<<<<<<< * surface.unlock() * */ __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_surf_out), __pyx_n_s_unlock); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 177; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = NULL; if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_2))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); if (likely(__pyx_t_3)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); } } if (__pyx_t_3) { __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 177; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } else { __pyx_t_1 = __Pyx_PyObject_CallNoArg(__pyx_t_2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 177; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "pygame_sdl2/transform.pyx":178 * * surf_out.unlock() * surface.unlock() # <<<<<<<<<<<<<< * * return surf_out */ __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_surface), __pyx_n_s_unlock); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 178; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = NULL; if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_2))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); if (likely(__pyx_t_3)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); } } if (__pyx_t_3) { __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 178; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } else { __pyx_t_1 = __Pyx_PyObject_CallNoArg(__pyx_t_2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 178; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "pygame_sdl2/transform.pyx":180 * surface.unlock() * * return surf_out # <<<<<<<<<<<<<< * * def smoothscale(Surface surface, size, Surface DestSurface=None): */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(((PyObject *)__pyx_v_surf_out)); __pyx_r = ((PyObject *)__pyx_v_surf_out); goto __pyx_L0; /* "pygame_sdl2/transform.pyx":128 * p[0] = color * * def scale2x(Surface surface, Surface DestSurface=None): # <<<<<<<<<<<<<< * cdef int x, y * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_5); __Pyx_AddTraceback("pygame_sdl2.transform.scale2x", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF((PyObject *)__pyx_v_surf_out); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/transform.pyx":182 * return surf_out * * def smoothscale(Surface surface, size, Surface DestSurface=None): # <<<<<<<<<<<<<< * cdef double scale_x = size[0] / surface.surface.w * cdef double scale_y = size[1] / surface.surface.h */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_9transform_11smoothscale(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static PyMethodDef __pyx_mdef_11pygame_sdl2_9transform_11smoothscale = {"smoothscale", (PyCFunction)__pyx_pw_11pygame_sdl2_9transform_11smoothscale, METH_VARARGS|METH_KEYWORDS, 0}; static PyObject *__pyx_pw_11pygame_sdl2_9transform_11smoothscale(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { struct __pyx_obj_11pygame_sdl2_7surface_Surface *__pyx_v_surface = 0; PyObject *__pyx_v_size = 0; struct __pyx_obj_11pygame_sdl2_7surface_Surface *__pyx_v_DestSurface = 0; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("smoothscale (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_surface,&__pyx_n_s_size,&__pyx_n_s_DestSurface,0}; PyObject* values[3] = {0,0,0}; values[2] = (PyObject *)((struct __pyx_obj_11pygame_sdl2_7surface_Surface *)Py_None); if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_surface)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; case 1: if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_size)) != 0)) kw_args--; else { __Pyx_RaiseArgtupleInvalid("smoothscale", 0, 2, 3, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 182; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } case 2: if (kw_args > 0) { PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_DestSurface); if (value) { values[2] = value; kw_args--; } } } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "smoothscale") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 182; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } } else { switch (PyTuple_GET_SIZE(__pyx_args)) { case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); values[0] = PyTuple_GET_ITEM(__pyx_args, 0); break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_surface = ((struct __pyx_obj_11pygame_sdl2_7surface_Surface *)values[0]); __pyx_v_size = values[1]; __pyx_v_DestSurface = ((struct __pyx_obj_11pygame_sdl2_7surface_Surface *)values[2]); } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("smoothscale", 0, 2, 3, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 182; __pyx_clineno = __LINE__; goto __pyx_L3_error;} __pyx_L3_error:; __Pyx_AddTraceback("pygame_sdl2.transform.smoothscale", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_surface), __pyx_ptype_11pygame_sdl2_7surface_Surface, 1, "surface", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 182; __pyx_clineno = __LINE__; goto __pyx_L1_error;} if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_DestSurface), __pyx_ptype_11pygame_sdl2_7surface_Surface, 1, "DestSurface", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 182; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_r = __pyx_pf_11pygame_sdl2_9transform_10smoothscale(__pyx_self, __pyx_v_surface, __pyx_v_size, __pyx_v_DestSurface); /* function exit code */ goto __pyx_L0; __pyx_L1_error:; __pyx_r = NULL; __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_9transform_10smoothscale(CYTHON_UNUSED PyObject *__pyx_self, struct __pyx_obj_11pygame_sdl2_7surface_Surface *__pyx_v_surface, PyObject *__pyx_v_size, struct __pyx_obj_11pygame_sdl2_7surface_Surface *__pyx_v_DestSurface) { double __pyx_v_scale_x; double __pyx_v_scale_y; SDL_Surface *__pyx_v_rsurf; struct __pyx_obj_11pygame_sdl2_7surface_Surface *__pyx_v_rv = 0; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; double __pyx_t_4; int __pyx_t_5; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("smoothscale", 0); /* "pygame_sdl2/transform.pyx":183 * * def smoothscale(Surface surface, size, Surface DestSurface=None): * cdef double scale_x = size[0] / surface.surface.w # <<<<<<<<<<<<<< * cdef double scale_y = size[1] / surface.surface.h * */ __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_size, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(__pyx_t_1 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 183; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = PyFloat_FromDouble(((double)__pyx_v_surface->surface->w)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 183; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = __Pyx_PyNumber_Divide(__pyx_t_1, __pyx_t_2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 183; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_4 = __pyx_PyFloat_AsDouble(__pyx_t_3); if (unlikely((__pyx_t_4 == (double)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 183; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_v_scale_x = __pyx_t_4; /* "pygame_sdl2/transform.pyx":184 * def smoothscale(Surface surface, size, Surface DestSurface=None): * cdef double scale_x = size[0] / surface.surface.w * cdef double scale_y = size[1] / surface.surface.h # <<<<<<<<<<<<<< * * cdef SDL_Surface *rsurf = NULL */ __pyx_t_3 = __Pyx_GetItemInt(__pyx_v_size, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(__pyx_t_3 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 184; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; __Pyx_GOTREF(__pyx_t_3); __pyx_t_2 = PyFloat_FromDouble(((double)__pyx_v_surface->surface->h)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 184; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __pyx_t_1 = __Pyx_PyNumber_Divide(__pyx_t_3, __pyx_t_2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 184; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_4 = __pyx_PyFloat_AsDouble(__pyx_t_1); if (unlikely((__pyx_t_4 == (double)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 184; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_v_scale_y = __pyx_t_4; /* "pygame_sdl2/transform.pyx":186 * cdef double scale_y = size[1] / surface.surface.h * * cdef SDL_Surface *rsurf = NULL # <<<<<<<<<<<<<< * cdef Surface rv * */ __pyx_v_rsurf = NULL; /* "pygame_sdl2/transform.pyx":189 * cdef Surface rv * * with nogil: # <<<<<<<<<<<<<< * rsurf = rotozoomSurfaceXY(surface.surface, 0.0, scale_x, scale_y, SMOOTHING_ON) * */ { #ifdef WITH_THREAD PyThreadState *_save; Py_UNBLOCK_THREADS #endif /*try:*/ { /* "pygame_sdl2/transform.pyx":190 * * with nogil: * rsurf = rotozoomSurfaceXY(surface.surface, 0.0, scale_x, scale_y, SMOOTHING_ON) # <<<<<<<<<<<<<< * * if rsurf == NULL: */ __pyx_v_rsurf = rotozoomSurfaceXY(__pyx_v_surface->surface, 0.0, __pyx_v_scale_x, __pyx_v_scale_y, SMOOTHING_ON); } /* "pygame_sdl2/transform.pyx":189 * cdef Surface rv * * with nogil: # <<<<<<<<<<<<<< * rsurf = rotozoomSurfaceXY(surface.surface, 0.0, scale_x, scale_y, SMOOTHING_ON) * */ /*finally:*/ { /*normal exit:*/{ #ifdef WITH_THREAD Py_BLOCK_THREADS #endif goto __pyx_L5; } __pyx_L5:; } } /* "pygame_sdl2/transform.pyx":192 * rsurf = rotozoomSurfaceXY(surface.surface, 0.0, scale_x, scale_y, SMOOTHING_ON) * * if rsurf == NULL: # <<<<<<<<<<<<<< * raise error() * */ __pyx_t_5 = ((__pyx_v_rsurf == NULL) != 0); if (__pyx_t_5) { /* "pygame_sdl2/transform.pyx":193 * * if rsurf == NULL: * raise error() # <<<<<<<<<<<<<< * * rv = Surface(()) */ __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_error); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 193; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = NULL; if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_2))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); if (likely(__pyx_t_3)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); } } if (__pyx_t_3) { __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 193; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } else { __pyx_t_1 = __Pyx_PyObject_CallNoArg(__pyx_t_2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 193; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_Raise(__pyx_t_1, 0, 0, 0); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; {__pyx_filename = __pyx_f[0]; __pyx_lineno = 193; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "pygame_sdl2/transform.pyx":192 * rsurf = rotozoomSurfaceXY(surface.surface, 0.0, scale_x, scale_y, SMOOTHING_ON) * * if rsurf == NULL: # <<<<<<<<<<<<<< * raise error() * */ } /* "pygame_sdl2/transform.pyx":195 * raise error() * * rv = Surface(()) # <<<<<<<<<<<<<< * rv.take_surface(rsurf) * */ __pyx_t_1 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_11pygame_sdl2_7surface_Surface), __pyx_tuple__3, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 195; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_v_rv = ((struct __pyx_obj_11pygame_sdl2_7surface_Surface *)__pyx_t_1); __pyx_t_1 = 0; /* "pygame_sdl2/transform.pyx":196 * * rv = Surface(()) * rv.take_surface(rsurf) # <<<<<<<<<<<<<< * * # This is inefficient. */ ((struct __pyx_vtabstruct_11pygame_sdl2_7surface_Surface *)__pyx_v_rv->__pyx_vtab)->take_surface(__pyx_v_rv, __pyx_v_rsurf); /* "pygame_sdl2/transform.pyx":199 * * # This is inefficient. * if DestSurface: # <<<<<<<<<<<<<< * with nogil: * SDL_SetSurfaceBlendMode(rv.surface, SDL_BLENDMODE_NONE) */ __pyx_t_5 = __Pyx_PyObject_IsTrue(((PyObject *)__pyx_v_DestSurface)); if (unlikely(__pyx_t_5 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 199; __pyx_clineno = __LINE__; goto __pyx_L1_error;} if (__pyx_t_5) { /* "pygame_sdl2/transform.pyx":200 * # This is inefficient. * if DestSurface: * with nogil: # <<<<<<<<<<<<<< * SDL_SetSurfaceBlendMode(rv.surface, SDL_BLENDMODE_NONE) * SDL_UpperBlit(rv.surface, NULL, DestSurface.surface, NULL) */ { #ifdef WITH_THREAD PyThreadState *_save; Py_UNBLOCK_THREADS #endif /*try:*/ { /* "pygame_sdl2/transform.pyx":201 * if DestSurface: * with nogil: * SDL_SetSurfaceBlendMode(rv.surface, SDL_BLENDMODE_NONE) # <<<<<<<<<<<<<< * SDL_UpperBlit(rv.surface, NULL, DestSurface.surface, NULL) * */ SDL_SetSurfaceBlendMode(__pyx_v_rv->surface, SDL_BLENDMODE_NONE); /* "pygame_sdl2/transform.pyx":202 * with nogil: * SDL_SetSurfaceBlendMode(rv.surface, SDL_BLENDMODE_NONE) * SDL_UpperBlit(rv.surface, NULL, DestSurface.surface, NULL) # <<<<<<<<<<<<<< * * return rv */ SDL_UpperBlit(__pyx_v_rv->surface, NULL, __pyx_v_DestSurface->surface, NULL); } /* "pygame_sdl2/transform.pyx":200 * # This is inefficient. * if DestSurface: * with nogil: # <<<<<<<<<<<<<< * SDL_SetSurfaceBlendMode(rv.surface, SDL_BLENDMODE_NONE) * SDL_UpperBlit(rv.surface, NULL, DestSurface.surface, NULL) */ /*finally:*/ { /*normal exit:*/{ #ifdef WITH_THREAD Py_BLOCK_THREADS #endif goto __pyx_L10; } __pyx_L10:; } } /* "pygame_sdl2/transform.pyx":199 * * # This is inefficient. * if DestSurface: # <<<<<<<<<<<<<< * with nogil: * SDL_SetSurfaceBlendMode(rv.surface, SDL_BLENDMODE_NONE) */ } /* "pygame_sdl2/transform.pyx":204 * SDL_UpperBlit(rv.surface, NULL, DestSurface.surface, NULL) * * return rv # <<<<<<<<<<<<<< */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(((PyObject *)__pyx_v_rv)); __pyx_r = ((PyObject *)__pyx_v_rv); goto __pyx_L0; /* "pygame_sdl2/transform.pyx":182 * return surf_out * * def smoothscale(Surface surface, size, Surface DestSurface=None): # <<<<<<<<<<<<<< * cdef double scale_x = size[0] / surface.surface.w * cdef double scale_y = size[1] / surface.surface.h */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("pygame_sdl2.transform.smoothscale", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF((PyObject *)__pyx_v_rv); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyMethodDef __pyx_methods[] = { {0, 0, 0, 0} }; #if PY_MAJOR_VERSION >= 3 static struct PyModuleDef __pyx_moduledef = { #if PY_VERSION_HEX < 0x03020000 { PyObject_HEAD_INIT(NULL) NULL, 0, NULL }, #else PyModuleDef_HEAD_INIT, #endif "transform", 0, /* m_doc */ -1, /* m_size */ __pyx_methods /* m_methods */, NULL, /* m_reload */ NULL, /* m_traverse */ NULL, /* m_clear */ NULL /* m_free */ }; #endif static __Pyx_StringTabEntry __pyx_string_tab[] = { {&__pyx_n_s_DestSurface, __pyx_k_DestSurface, sizeof(__pyx_k_DestSurface), 0, 0, 1, 1}, {&__pyx_kp_s_Surface_has_unsupported_bytesize, __pyx_k_Surface_has_unsupported_bytesize, sizeof(__pyx_k_Surface_has_unsupported_bytesize), 0, 0, 1, 0}, {&__pyx_n_s_a, __pyx_k_a, sizeof(__pyx_k_a), 0, 0, 1, 1}, {&__pyx_n_s_angle, __pyx_k_angle, sizeof(__pyx_k_angle), 0, 0, 1, 1}, {&__pyx_n_s_b, __pyx_k_b, sizeof(__pyx_k_b), 0, 0, 1, 1}, {&__pyx_n_s_c, __pyx_k_c, sizeof(__pyx_k_c), 0, 0, 1, 1}, {&__pyx_n_s_d, __pyx_k_d, sizeof(__pyx_k_d), 0, 0, 1, 1}, {&__pyx_n_s_dest, __pyx_k_dest, sizeof(__pyx_k_dest), 0, 0, 1, 1}, {&__pyx_n_s_dest_delta, __pyx_k_dest_delta, sizeof(__pyx_k_dest_delta), 0, 0, 1, 1}, {&__pyx_n_s_dest_pixel, __pyx_k_dest_pixel, sizeof(__pyx_k_dest_pixel), 0, 0, 1, 1}, {&__pyx_n_s_e, __pyx_k_e, sizeof(__pyx_k_e), 0, 0, 1, 1}, {&__pyx_n_s_e0, __pyx_k_e0, sizeof(__pyx_k_e0), 0, 0, 1, 1}, {&__pyx_n_s_e1, __pyx_k_e1, sizeof(__pyx_k_e1), 0, 0, 1, 1}, {&__pyx_n_s_e2, __pyx_k_e2, sizeof(__pyx_k_e2), 0, 0, 1, 1}, {&__pyx_n_s_e3, __pyx_k_e3, sizeof(__pyx_k_e3), 0, 0, 1, 1}, {&__pyx_n_s_err, __pyx_k_err, sizeof(__pyx_k_err), 0, 0, 1, 1}, {&__pyx_n_s_error, __pyx_k_error, sizeof(__pyx_k_error), 0, 0, 1, 1}, {&__pyx_n_s_f, __pyx_k_f, sizeof(__pyx_k_f), 0, 0, 1, 1}, {&__pyx_n_s_flip, __pyx_k_flip, sizeof(__pyx_k_flip), 0, 0, 1, 1}, {&__pyx_n_s_g, __pyx_k_g, sizeof(__pyx_k_g), 0, 0, 1, 1}, {&__pyx_n_s_get_bytesize, __pyx_k_get_bytesize, sizeof(__pyx_k_get_bytesize), 0, 0, 1, 1}, {&__pyx_n_s_get_flags, __pyx_k_get_flags, sizeof(__pyx_k_get_flags), 0, 0, 1, 1}, {&__pyx_n_s_get_height, __pyx_k_get_height, sizeof(__pyx_k_get_height), 0, 0, 1, 1}, {&__pyx_n_s_get_size, __pyx_k_get_size, sizeof(__pyx_k_get_size), 0, 0, 1, 1}, {&__pyx_n_s_get_width, __pyx_k_get_width, sizeof(__pyx_k_get_width), 0, 0, 1, 1}, {&__pyx_n_s_h, __pyx_k_h, sizeof(__pyx_k_h), 0, 0, 1, 1}, {&__pyx_n_s_height, __pyx_k_height, sizeof(__pyx_k_height), 0, 0, 1, 1}, {&__pyx_kp_s_home_tom_ab_pygame_sdl2_src_pyg, __pyx_k_home_tom_ab_pygame_sdl2_src_pyg, sizeof(__pyx_k_home_tom_ab_pygame_sdl2_src_pyg), 0, 0, 1, 0}, {&__pyx_n_s_i, __pyx_k_i, sizeof(__pyx_k_i), 0, 0, 1, 1}, {&__pyx_n_s_import, __pyx_k_import, sizeof(__pyx_k_import), 0, 0, 1, 1}, {&__pyx_n_s_lock, __pyx_k_lock, sizeof(__pyx_k_lock), 0, 0, 1, 1}, {&__pyx_n_s_main, __pyx_k_main, sizeof(__pyx_k_main), 0, 0, 1, 1}, {&__pyx_n_s_pygame_sdl2_error, __pyx_k_pygame_sdl2_error, sizeof(__pyx_k_pygame_sdl2_error), 0, 0, 1, 1}, {&__pyx_n_s_pygame_sdl2_transform, __pyx_k_pygame_sdl2_transform, sizeof(__pyx_k_pygame_sdl2_transform), 0, 0, 1, 1}, {&__pyx_n_s_pyx_vtable, __pyx_k_pyx_vtable, sizeof(__pyx_k_pyx_vtable), 0, 0, 1, 1}, {&__pyx_n_s_range, __pyx_k_range, sizeof(__pyx_k_range), 0, 0, 1, 1}, {&__pyx_n_s_rotate, __pyx_k_rotate, sizeof(__pyx_k_rotate), 0, 0, 1, 1}, {&__pyx_n_s_rotozoom, __pyx_k_rotozoom, sizeof(__pyx_k_rotozoom), 0, 0, 1, 1}, {&__pyx_n_s_rsurf, __pyx_k_rsurf, sizeof(__pyx_k_rsurf), 0, 0, 1, 1}, {&__pyx_n_s_rv, __pyx_k_rv, sizeof(__pyx_k_rv), 0, 0, 1, 1}, {&__pyx_n_s_scale, __pyx_k_scale, sizeof(__pyx_k_scale), 0, 0, 1, 1}, {&__pyx_n_s_scale2x, __pyx_k_scale2x, sizeof(__pyx_k_scale2x), 0, 0, 1, 1}, {&__pyx_n_s_scale_x, __pyx_k_scale_x, sizeof(__pyx_k_scale_x), 0, 0, 1, 1}, {&__pyx_n_s_scale_y, __pyx_k_scale_y, sizeof(__pyx_k_scale_y), 0, 0, 1, 1}, {&__pyx_n_s_size, __pyx_k_size, sizeof(__pyx_k_size), 0, 0, 1, 1}, {&__pyx_n_s_smooth, __pyx_k_smooth, sizeof(__pyx_k_smooth), 0, 0, 1, 1}, {&__pyx_n_s_smoothscale, __pyx_k_smoothscale, sizeof(__pyx_k_smoothscale), 0, 0, 1, 1}, {&__pyx_n_s_src, __pyx_k_src, sizeof(__pyx_k_src), 0, 0, 1, 1}, {&__pyx_n_s_src_end, __pyx_k_src_end, sizeof(__pyx_k_src_end), 0, 0, 1, 1}, {&__pyx_n_s_src_pixel, __pyx_k_src_pixel, sizeof(__pyx_k_src_pixel), 0, 0, 1, 1}, {&__pyx_n_s_surf_out, __pyx_k_surf_out, sizeof(__pyx_k_surf_out), 0, 0, 1, 1}, {&__pyx_n_s_surface, __pyx_k_surface, sizeof(__pyx_k_surface), 0, 0, 1, 1}, {&__pyx_n_s_test, __pyx_k_test, sizeof(__pyx_k_test), 0, 0, 1, 1}, {&__pyx_n_s_unlock, __pyx_k_unlock, sizeof(__pyx_k_unlock), 0, 0, 1, 1}, {&__pyx_n_s_width, __pyx_k_width, sizeof(__pyx_k_width), 0, 0, 1, 1}, {&__pyx_n_s_x, __pyx_k_x, sizeof(__pyx_k_x), 0, 0, 1, 1}, {&__pyx_n_s_xbool, __pyx_k_xbool, sizeof(__pyx_k_xbool), 0, 0, 1, 1}, {&__pyx_n_s_y, __pyx_k_y, sizeof(__pyx_k_y), 0, 0, 1, 1}, {&__pyx_n_s_ybool, __pyx_k_ybool, sizeof(__pyx_k_ybool), 0, 0, 1, 1}, {0, 0, 0, 0, 0, 0, 0} }; static int __Pyx_InitCachedBuiltins(void) { __pyx_builtin_range = __Pyx_GetBuiltinName(__pyx_n_s_range); if (!__pyx_builtin_range) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 148; __pyx_clineno = __LINE__; goto __pyx_L1_error;} return 0; __pyx_L1_error:; return -1; } static int __Pyx_InitCachedConstants(void) { __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__Pyx_InitCachedConstants", 0); /* "pygame_sdl2/transform.pyx":102 * raise error() * * rv = Surface(()) # <<<<<<<<<<<<<< * rv.take_surface(rsurf) * */ __pyx_tuple_ = PyTuple_Pack(1, __pyx_empty_tuple); if (unlikely(!__pyx_tuple_)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 102; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_tuple_); __Pyx_GIVEREF(__pyx_tuple_); /* "pygame_sdl2/transform.pyx":135 * * if surface.get_bytesize() != 4: * raise error("Surface has unsupported bytesize.") # <<<<<<<<<<<<<< * * cdef Surface surf_out = DestSurface */ __pyx_tuple__2 = PyTuple_Pack(1, __pyx_kp_s_Surface_has_unsupported_bytesize); if (unlikely(!__pyx_tuple__2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 135; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_tuple__2); __Pyx_GIVEREF(__pyx_tuple__2); /* "pygame_sdl2/transform.pyx":195 * raise error() * * rv = Surface(()) # <<<<<<<<<<<<<< * rv.take_surface(rsurf) * */ __pyx_tuple__3 = PyTuple_Pack(1, __pyx_empty_tuple); if (unlikely(!__pyx_tuple__3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 195; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_tuple__3); __Pyx_GIVEREF(__pyx_tuple__3); /* "pygame_sdl2/transform.pyx":26 * * * def flip(Surface surface, bint xbool, bint ybool): # <<<<<<<<<<<<<< * * cdef Surface rv = Surface(surface.get_size(), surface.get_flags(), surface) */ __pyx_tuple__4 = PyTuple_Pack(11, __pyx_n_s_surface, __pyx_n_s_xbool, __pyx_n_s_ybool, __pyx_n_s_rv, __pyx_n_s_src, __pyx_n_s_dest, __pyx_n_s_src_pixel, __pyx_n_s_src_end, __pyx_n_s_dest_pixel, __pyx_n_s_dest_delta, __pyx_n_s_y); if (unlikely(!__pyx_tuple__4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 26; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_tuple__4); __Pyx_GIVEREF(__pyx_tuple__4); __pyx_codeobj__5 = (PyObject*)__Pyx_PyCode_New(3, 0, 11, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__4, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_tom_ab_pygame_sdl2_src_pyg, __pyx_n_s_flip, 26, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 26; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "pygame_sdl2/transform.pyx":65 * * * def scale(Surface surface, size, Surface DestSurface=None): # <<<<<<<<<<<<<< * cdef Surface surf_out * cdef int err = -1 */ __pyx_tuple__6 = PyTuple_Pack(5, __pyx_n_s_surface, __pyx_n_s_size, __pyx_n_s_DestSurface, __pyx_n_s_surf_out, __pyx_n_s_err); if (unlikely(!__pyx_tuple__6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 65; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_tuple__6); __Pyx_GIVEREF(__pyx_tuple__6); __pyx_codeobj__7 = (PyObject*)__Pyx_PyCode_New(3, 0, 5, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__6, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_tom_ab_pygame_sdl2_src_pyg, __pyx_n_s_scale, 65, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 65; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "pygame_sdl2/transform.pyx":83 * return surf_out * * def rotate(Surface surface, angle): # <<<<<<<<<<<<<< * # rotateSurface90Degrees always returns NULL without setting an error?? * # cdef SDL_Surface *rsurf */ __pyx_tuple__8 = PyTuple_Pack(2, __pyx_n_s_surface, __pyx_n_s_angle); if (unlikely(!__pyx_tuple__8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 83; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_tuple__8); __Pyx_GIVEREF(__pyx_tuple__8); __pyx_codeobj__9 = (PyObject*)__Pyx_PyCode_New(2, 0, 2, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__8, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_tom_ab_pygame_sdl2_src_pyg, __pyx_n_s_rotate, 83, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 83; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "pygame_sdl2/transform.pyx":92 * return rotozoom(surface, angle, 1.0, SMOOTHING_OFF) * * def rotozoom(Surface surface, double angle, double scale, int smooth=1): # <<<<<<<<<<<<<< * cdef SDL_Surface *rsurf = NULL * cdef Surface rv */ __pyx_tuple__10 = PyTuple_Pack(6, __pyx_n_s_surface, __pyx_n_s_angle, __pyx_n_s_scale, __pyx_n_s_smooth, __pyx_n_s_rsurf, __pyx_n_s_rv); if (unlikely(!__pyx_tuple__10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 92; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_tuple__10); __Pyx_GIVEREF(__pyx_tuple__10); __pyx_codeobj__11 = (PyObject*)__Pyx_PyCode_New(4, 0, 6, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__10, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_tom_ab_pygame_sdl2_src_pyg, __pyx_n_s_rotozoom, 92, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 92; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "pygame_sdl2/transform.pyx":128 * p[0] = color * * def scale2x(Surface surface, Surface DestSurface=None): # <<<<<<<<<<<<<< * cdef int x, y * */ __pyx_tuple__12 = PyTuple_Pack(20, __pyx_n_s_surface, __pyx_n_s_DestSurface, __pyx_n_s_x, __pyx_n_s_y, __pyx_n_s_a, __pyx_n_s_b, __pyx_n_s_c, __pyx_n_s_d, __pyx_n_s_e, __pyx_n_s_f, __pyx_n_s_g, __pyx_n_s_h, __pyx_n_s_i, __pyx_n_s_e0, __pyx_n_s_e1, __pyx_n_s_e2, __pyx_n_s_e3, __pyx_n_s_surf_out, __pyx_n_s_width, __pyx_n_s_height); if (unlikely(!__pyx_tuple__12)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 128; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_tuple__12); __Pyx_GIVEREF(__pyx_tuple__12); __pyx_codeobj__13 = (PyObject*)__Pyx_PyCode_New(2, 0, 20, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__12, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_tom_ab_pygame_sdl2_src_pyg, __pyx_n_s_scale2x, 128, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__13)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 128; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "pygame_sdl2/transform.pyx":182 * return surf_out * * def smoothscale(Surface surface, size, Surface DestSurface=None): # <<<<<<<<<<<<<< * cdef double scale_x = size[0] / surface.surface.w * cdef double scale_y = size[1] / surface.surface.h */ __pyx_tuple__14 = PyTuple_Pack(7, __pyx_n_s_surface, __pyx_n_s_size, __pyx_n_s_DestSurface, __pyx_n_s_scale_x, __pyx_n_s_scale_y, __pyx_n_s_rsurf, __pyx_n_s_rv); if (unlikely(!__pyx_tuple__14)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 182; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_tuple__14); __Pyx_GIVEREF(__pyx_tuple__14); __pyx_codeobj__15 = (PyObject*)__Pyx_PyCode_New(3, 0, 7, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__14, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_tom_ab_pygame_sdl2_src_pyg, __pyx_n_s_smoothscale, 182, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__15)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 182; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_RefNannyFinishContext(); return 0; __pyx_L1_error:; __Pyx_RefNannyFinishContext(); return -1; } static int __Pyx_InitGlobals(void) { if (__Pyx_InitStrings(__pyx_string_tab) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; __pyx_float_1_0 = PyFloat_FromDouble(1.0); if (unlikely(!__pyx_float_1_0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_int_0 = PyInt_FromLong(0); if (unlikely(!__pyx_int_0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_int_2 = PyInt_FromLong(2); if (unlikely(!__pyx_int_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_int_4 = PyInt_FromLong(4); if (unlikely(!__pyx_int_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} return 0; __pyx_L1_error:; return -1; } #if PY_MAJOR_VERSION < 3 PyMODINIT_FUNC inittransform(void); /*proto*/ PyMODINIT_FUNC inittransform(void) #else PyMODINIT_FUNC PyInit_transform(void); /*proto*/ PyMODINIT_FUNC PyInit_transform(void) #endif { PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannyDeclarations #if CYTHON_REFNANNY __Pyx_RefNanny = __Pyx_RefNannyImportAPI("refnanny"); if (!__Pyx_RefNanny) { PyErr_Clear(); __Pyx_RefNanny = __Pyx_RefNannyImportAPI("Cython.Runtime.refnanny"); if (!__Pyx_RefNanny) Py_FatalError("failed to import 'refnanny' module"); } #endif __Pyx_RefNannySetupContext("PyMODINIT_FUNC PyInit_transform(void)", 0); if (__Pyx_check_binary_version() < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_empty_tuple = PyTuple_New(0); if (unlikely(!__pyx_empty_tuple)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_empty_bytes = PyBytes_FromStringAndSize("", 0); if (unlikely(!__pyx_empty_bytes)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} #ifdef __Pyx_CyFunction_USED if (__pyx_CyFunction_init() < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} #endif #ifdef __Pyx_FusedFunction_USED if (__pyx_FusedFunction_init() < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} #endif #ifdef __Pyx_Coroutine_USED if (__pyx_Coroutine_init() < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} #endif #ifdef __Pyx_Generator_USED if (__pyx_Generator_init() < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} #endif #ifdef __Pyx_StopAsyncIteration_USED if (__pyx_StopAsyncIteration_init() < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} #endif /*--- Library function declarations ---*/ /*--- Threads initialization code ---*/ #if defined(__PYX_FORCE_INIT_THREADS) && __PYX_FORCE_INIT_THREADS #ifdef WITH_THREAD /* Python build with threading support? */ PyEval_InitThreads(); #endif #endif /*--- Module creation code ---*/ #if PY_MAJOR_VERSION < 3 __pyx_m = Py_InitModule4("transform", __pyx_methods, 0, 0, PYTHON_API_VERSION); Py_XINCREF(__pyx_m); #else __pyx_m = PyModule_Create(&__pyx_moduledef); #endif if (unlikely(!__pyx_m)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_d = PyModule_GetDict(__pyx_m); if (unlikely(!__pyx_d)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} Py_INCREF(__pyx_d); __pyx_b = PyImport_AddModule(__Pyx_BUILTIN_MODULE_NAME); if (unlikely(!__pyx_b)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} #if CYTHON_COMPILING_IN_PYPY Py_INCREF(__pyx_b); #endif if (PyObject_SetAttrString(__pyx_m, "__builtins__", __pyx_b) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; /*--- Initialize various global constants etc. ---*/ if (__Pyx_InitGlobals() < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} #if PY_MAJOR_VERSION < 3 && (__PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT) if (__Pyx_init_sys_getdefaultencoding_params() < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} #endif if (__pyx_module_is_main_pygame_sdl2__transform) { if (PyObject_SetAttrString(__pyx_m, "__name__", __pyx_n_s_main) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } #if PY_MAJOR_VERSION >= 3 { PyObject *modules = PyImport_GetModuleDict(); if (unlikely(!modules)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} if (!PyDict_GetItemString(modules, "pygame_sdl2.transform")) { if (unlikely(PyDict_SetItemString(modules, "pygame_sdl2.transform", __pyx_m) < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } } #endif /*--- Builtin init code ---*/ if (__Pyx_InitCachedBuiltins() < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /*--- Constants init code ---*/ if (__Pyx_InitCachedConstants() < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /*--- Global init code ---*/ /*--- Variable export code ---*/ /*--- Function export code ---*/ /*--- Type init code ---*/ /*--- Type import code ---*/ __pyx_ptype_11pygame_sdl2_7surface_Surface = __Pyx_ImportType("pygame_sdl2.surface", "Surface", sizeof(struct __pyx_obj_11pygame_sdl2_7surface_Surface), 1); if (unlikely(!__pyx_ptype_11pygame_sdl2_7surface_Surface)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 23; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_vtabptr_11pygame_sdl2_7surface_Surface = (struct __pyx_vtabstruct_11pygame_sdl2_7surface_Surface*)__Pyx_GetVtable(__pyx_ptype_11pygame_sdl2_7surface_Surface->tp_dict); if (unlikely(!__pyx_vtabptr_11pygame_sdl2_7surface_Surface)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 23; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /*--- Variable import code ---*/ /*--- Function import code ---*/ /*--- Execution code ---*/ #if defined(__Pyx_Generator_USED) || defined(__Pyx_Coroutine_USED) if (__Pyx_patch_abc() < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} #endif /* "pygame_sdl2/transform.pyx":23 * from sdl2_gfx cimport * * from pygame_sdl2.surface cimport * * from pygame_sdl2.error import error # <<<<<<<<<<<<<< * * */ __pyx_t_1 = PyList_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 23; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __Pyx_INCREF(__pyx_n_s_error); __Pyx_GIVEREF(__pyx_n_s_error); PyList_SET_ITEM(__pyx_t_1, 0, __pyx_n_s_error); __pyx_t_2 = __Pyx_Import(__pyx_n_s_pygame_sdl2_error, __pyx_t_1, -1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 23; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_1 = __Pyx_ImportFrom(__pyx_t_2, __pyx_n_s_error); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 23; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); if (PyDict_SetItem(__pyx_d, __pyx_n_s_error, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 23; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "pygame_sdl2/transform.pyx":26 * * * def flip(Surface surface, bint xbool, bint ybool): # <<<<<<<<<<<<<< * * cdef Surface rv = Surface(surface.get_size(), surface.get_flags(), surface) */ __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_11pygame_sdl2_9transform_1flip, NULL, __pyx_n_s_pygame_sdl2_transform); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 26; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_flip, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 26; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "pygame_sdl2/transform.pyx":65 * * * def scale(Surface surface, size, Surface DestSurface=None): # <<<<<<<<<<<<<< * cdef Surface surf_out * cdef int err = -1 */ __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_11pygame_sdl2_9transform_3scale, NULL, __pyx_n_s_pygame_sdl2_transform); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 65; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_scale, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 65; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "pygame_sdl2/transform.pyx":83 * return surf_out * * def rotate(Surface surface, angle): # <<<<<<<<<<<<<< * # rotateSurface90Degrees always returns NULL without setting an error?? * # cdef SDL_Surface *rsurf */ __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_11pygame_sdl2_9transform_5rotate, NULL, __pyx_n_s_pygame_sdl2_transform); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 83; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_rotate, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 83; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "pygame_sdl2/transform.pyx":92 * return rotozoom(surface, angle, 1.0, SMOOTHING_OFF) * * def rotozoom(Surface surface, double angle, double scale, int smooth=1): # <<<<<<<<<<<<<< * cdef SDL_Surface *rsurf = NULL * cdef Surface rv */ __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_11pygame_sdl2_9transform_7rotozoom, NULL, __pyx_n_s_pygame_sdl2_transform); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 92; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_rotozoom, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 92; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "pygame_sdl2/transform.pyx":128 * p[0] = color * * def scale2x(Surface surface, Surface DestSurface=None): # <<<<<<<<<<<<<< * cdef int x, y * */ __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_11pygame_sdl2_9transform_9scale2x, NULL, __pyx_n_s_pygame_sdl2_transform); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 128; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_scale2x, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 128; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "pygame_sdl2/transform.pyx":182 * return surf_out * * def smoothscale(Surface surface, size, Surface DestSurface=None): # <<<<<<<<<<<<<< * cdef double scale_x = size[0] / surface.surface.w * cdef double scale_y = size[1] / surface.surface.h */ __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_11pygame_sdl2_9transform_11smoothscale, NULL, __pyx_n_s_pygame_sdl2_transform); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 182; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_smoothscale, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 182; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "pygame_sdl2/transform.pyx":1 * # Copyright 2014 Patrick Dawson # <<<<<<<<<<<<<< * # Tom Rothamel * # */ __pyx_t_2 = PyDict_New(); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_test, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /*--- Wrapped vars code ---*/ goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); if (__pyx_m) { if (__pyx_d) { __Pyx_AddTraceback("init pygame_sdl2.transform", __pyx_clineno, __pyx_lineno, __pyx_filename); } Py_DECREF(__pyx_m); __pyx_m = 0; } else if (!PyErr_Occurred()) { PyErr_SetString(PyExc_ImportError, "init pygame_sdl2.transform"); } __pyx_L0:; __Pyx_RefNannyFinishContext(); #if PY_MAJOR_VERSION < 3 return; #else return __pyx_m; #endif } /* --- Runtime support code --- */ #if CYTHON_REFNANNY static __Pyx_RefNannyAPIStruct *__Pyx_RefNannyImportAPI(const char *modname) { PyObject *m = NULL, *p = NULL; void *r = NULL; m = PyImport_ImportModule((char *)modname); if (!m) goto end; p = PyObject_GetAttrString(m, (char *)"RefNannyAPI"); if (!p) goto end; r = PyLong_AsVoidPtr(p); end: Py_XDECREF(p); Py_XDECREF(m); return (__Pyx_RefNannyAPIStruct *)r; } #endif static PyObject *__Pyx_GetBuiltinName(PyObject *name) { PyObject* result = __Pyx_PyObject_GetAttrStr(__pyx_b, name); if (unlikely(!result)) { PyErr_Format(PyExc_NameError, #if PY_MAJOR_VERSION >= 3 "name '%U' is not defined", name); #else "name '%.200s' is not defined", PyString_AS_STRING(name)); #endif } return result; } static void __Pyx_RaiseArgtupleInvalid( const char* func_name, int exact, Py_ssize_t num_min, Py_ssize_t num_max, Py_ssize_t num_found) { Py_ssize_t num_expected; const char *more_or_less; if (num_found < num_min) { num_expected = num_min; more_or_less = "at least"; } else { num_expected = num_max; more_or_less = "at most"; } if (exact) { more_or_less = "exactly"; } PyErr_Format(PyExc_TypeError, "%.200s() takes %.8s %" CYTHON_FORMAT_SSIZE_T "d positional argument%.1s (%" CYTHON_FORMAT_SSIZE_T "d given)", func_name, more_or_less, num_expected, (num_expected == 1) ? "" : "s", num_found); } static void __Pyx_RaiseDoubleKeywordsError( const char* func_name, PyObject* kw_name) { PyErr_Format(PyExc_TypeError, #if PY_MAJOR_VERSION >= 3 "%s() got multiple values for keyword argument '%U'", func_name, kw_name); #else "%s() got multiple values for keyword argument '%s'", func_name, PyString_AsString(kw_name)); #endif } static int __Pyx_ParseOptionalKeywords( PyObject *kwds, PyObject **argnames[], PyObject *kwds2, PyObject *values[], Py_ssize_t num_pos_args, const char* function_name) { PyObject *key = 0, *value = 0; Py_ssize_t pos = 0; PyObject*** name; PyObject*** first_kw_arg = argnames + num_pos_args; while (PyDict_Next(kwds, &pos, &key, &value)) { name = first_kw_arg; while (*name && (**name != key)) name++; if (*name) { values[name-argnames] = value; continue; } name = first_kw_arg; #if PY_MAJOR_VERSION < 3 if (likely(PyString_CheckExact(key)) || likely(PyString_Check(key))) { while (*name) { if ((CYTHON_COMPILING_IN_PYPY || PyString_GET_SIZE(**name) == PyString_GET_SIZE(key)) && _PyString_Eq(**name, key)) { values[name-argnames] = value; break; } name++; } if (*name) continue; else { PyObject*** argname = argnames; while (argname != first_kw_arg) { if ((**argname == key) || ( (CYTHON_COMPILING_IN_PYPY || PyString_GET_SIZE(**argname) == PyString_GET_SIZE(key)) && _PyString_Eq(**argname, key))) { goto arg_passed_twice; } argname++; } } } else #endif if (likely(PyUnicode_Check(key))) { while (*name) { int cmp = (**name == key) ? 0 : #if !CYTHON_COMPILING_IN_PYPY && PY_MAJOR_VERSION >= 3 (PyUnicode_GET_SIZE(**name) != PyUnicode_GET_SIZE(key)) ? 1 : #endif PyUnicode_Compare(**name, key); if (cmp < 0 && unlikely(PyErr_Occurred())) goto bad; if (cmp == 0) { values[name-argnames] = value; break; } name++; } if (*name) continue; else { PyObject*** argname = argnames; while (argname != first_kw_arg) { int cmp = (**argname == key) ? 0 : #if !CYTHON_COMPILING_IN_PYPY && PY_MAJOR_VERSION >= 3 (PyUnicode_GET_SIZE(**argname) != PyUnicode_GET_SIZE(key)) ? 1 : #endif PyUnicode_Compare(**argname, key); if (cmp < 0 && unlikely(PyErr_Occurred())) goto bad; if (cmp == 0) goto arg_passed_twice; argname++; } } } else goto invalid_keyword_type; if (kwds2) { if (unlikely(PyDict_SetItem(kwds2, key, value))) goto bad; } else { goto invalid_keyword; } } return 0; arg_passed_twice: __Pyx_RaiseDoubleKeywordsError(function_name, key); goto bad; invalid_keyword_type: PyErr_Format(PyExc_TypeError, "%.200s() keywords must be strings", function_name); goto bad; invalid_keyword: PyErr_Format(PyExc_TypeError, #if PY_MAJOR_VERSION < 3 "%.200s() got an unexpected keyword argument '%.200s'", function_name, PyString_AsString(key)); #else "%s() got an unexpected keyword argument '%U'", function_name, key); #endif bad: return -1; } static void __Pyx_RaiseArgumentTypeInvalid(const char* name, PyObject *obj, PyTypeObject *type) { PyErr_Format(PyExc_TypeError, "Argument '%.200s' has incorrect type (expected %.200s, got %.200s)", name, type->tp_name, Py_TYPE(obj)->tp_name); } static CYTHON_INLINE int __Pyx_ArgTypeTest(PyObject *obj, PyTypeObject *type, int none_allowed, const char *name, int exact) { if (unlikely(!type)) { PyErr_SetString(PyExc_SystemError, "Missing type object"); return 0; } if (none_allowed && obj == Py_None) return 1; else if (exact) { if (likely(Py_TYPE(obj) == type)) return 1; #if PY_MAJOR_VERSION == 2 else if ((type == &PyBaseString_Type) && likely(__Pyx_PyBaseString_CheckExact(obj))) return 1; #endif } else { if (likely(PyObject_TypeCheck(obj, type))) return 1; } __Pyx_RaiseArgumentTypeInvalid(name, obj, type); return 0; } #if CYTHON_COMPILING_IN_CPYTHON static CYTHON_INLINE PyObject* __Pyx_PyObject_Call(PyObject *func, PyObject *arg, PyObject *kw) { PyObject *result; ternaryfunc call = func->ob_type->tp_call; if (unlikely(!call)) return PyObject_Call(func, arg, kw); if (unlikely(Py_EnterRecursiveCall((char*)" while calling a Python object"))) return NULL; result = (*call)(func, arg, kw); Py_LeaveRecursiveCall(); if (unlikely(!result) && unlikely(!PyErr_Occurred())) { PyErr_SetString( PyExc_SystemError, "NULL result without error in PyObject_Call"); } return result; } #endif #if CYTHON_COMPILING_IN_CPYTHON static CYTHON_INLINE PyObject* __Pyx_PyObject_CallMethO(PyObject *func, PyObject *arg) { PyObject *self, *result; PyCFunction cfunc; cfunc = PyCFunction_GET_FUNCTION(func); self = PyCFunction_GET_SELF(func); if (unlikely(Py_EnterRecursiveCall((char*)" while calling a Python object"))) return NULL; result = cfunc(self, arg); Py_LeaveRecursiveCall(); if (unlikely(!result) && unlikely(!PyErr_Occurred())) { PyErr_SetString( PyExc_SystemError, "NULL result without error in PyObject_Call"); } return result; } #endif #if CYTHON_COMPILING_IN_CPYTHON static PyObject* __Pyx__PyObject_CallOneArg(PyObject *func, PyObject *arg) { PyObject *result; PyObject *args = PyTuple_New(1); if (unlikely(!args)) return NULL; Py_INCREF(arg); PyTuple_SET_ITEM(args, 0, arg); result = __Pyx_PyObject_Call(func, args, NULL); Py_DECREF(args); return result; } static CYTHON_INLINE PyObject* __Pyx_PyObject_CallOneArg(PyObject *func, PyObject *arg) { #ifdef __Pyx_CyFunction_USED if (likely(PyCFunction_Check(func) || PyObject_TypeCheck(func, __pyx_CyFunctionType))) { #else if (likely(PyCFunction_Check(func))) { #endif if (likely(PyCFunction_GET_FLAGS(func) & METH_O)) { return __Pyx_PyObject_CallMethO(func, arg); } } return __Pyx__PyObject_CallOneArg(func, arg); } #else static CYTHON_INLINE PyObject* __Pyx_PyObject_CallOneArg(PyObject *func, PyObject *arg) { PyObject *result; PyObject *args = PyTuple_Pack(1, arg); if (unlikely(!args)) return NULL; result = __Pyx_PyObject_Call(func, args, NULL); Py_DECREF(args); return result; } #endif #if CYTHON_COMPILING_IN_CPYTHON static CYTHON_INLINE PyObject* __Pyx_PyObject_CallNoArg(PyObject *func) { #ifdef __Pyx_CyFunction_USED if (likely(PyCFunction_Check(func) || PyObject_TypeCheck(func, __pyx_CyFunctionType))) { #else if (likely(PyCFunction_Check(func))) { #endif if (likely(PyCFunction_GET_FLAGS(func) & METH_NOARGS)) { return __Pyx_PyObject_CallMethO(func, NULL); } } return __Pyx_PyObject_Call(func, __pyx_empty_tuple, NULL); } #endif static CYTHON_INLINE PyObject *__Pyx_GetModuleGlobalName(PyObject *name) { PyObject *result; #if CYTHON_COMPILING_IN_CPYTHON result = PyDict_GetItem(__pyx_d, name); if (likely(result)) { Py_INCREF(result); } else { #else result = PyObject_GetItem(__pyx_d, name); if (!result) { PyErr_Clear(); #endif result = __Pyx_GetBuiltinName(name); } return result; } static CYTHON_INLINE void __Pyx_ErrRestore(PyObject *type, PyObject *value, PyObject *tb) { #if CYTHON_COMPILING_IN_CPYTHON PyObject *tmp_type, *tmp_value, *tmp_tb; PyThreadState *tstate = PyThreadState_GET(); tmp_type = tstate->curexc_type; tmp_value = tstate->curexc_value; tmp_tb = tstate->curexc_traceback; tstate->curexc_type = type; tstate->curexc_value = value; tstate->curexc_traceback = tb; Py_XDECREF(tmp_type); Py_XDECREF(tmp_value); Py_XDECREF(tmp_tb); #else PyErr_Restore(type, value, tb); #endif } static CYTHON_INLINE void __Pyx_ErrFetch(PyObject **type, PyObject **value, PyObject **tb) { #if CYTHON_COMPILING_IN_CPYTHON PyThreadState *tstate = PyThreadState_GET(); *type = tstate->curexc_type; *value = tstate->curexc_value; *tb = tstate->curexc_traceback; tstate->curexc_type = 0; tstate->curexc_value = 0; tstate->curexc_traceback = 0; #else PyErr_Fetch(type, value, tb); #endif } #if PY_MAJOR_VERSION < 3 static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, CYTHON_UNUSED PyObject *cause) { Py_XINCREF(type); if (!value || value == Py_None) value = NULL; else Py_INCREF(value); if (!tb || tb == Py_None) tb = NULL; else { Py_INCREF(tb); if (!PyTraceBack_Check(tb)) { PyErr_SetString(PyExc_TypeError, "raise: arg 3 must be a traceback or None"); goto raise_error; } } if (PyType_Check(type)) { #if CYTHON_COMPILING_IN_PYPY if (!value) { Py_INCREF(Py_None); value = Py_None; } #endif PyErr_NormalizeException(&type, &value, &tb); } else { if (value) { PyErr_SetString(PyExc_TypeError, "instance exception may not have a separate value"); goto raise_error; } value = type; type = (PyObject*) Py_TYPE(type); Py_INCREF(type); if (!PyType_IsSubtype((PyTypeObject *)type, (PyTypeObject *)PyExc_BaseException)) { PyErr_SetString(PyExc_TypeError, "raise: exception class must be a subclass of BaseException"); goto raise_error; } } __Pyx_ErrRestore(type, value, tb); return; raise_error: Py_XDECREF(value); Py_XDECREF(type); Py_XDECREF(tb); return; } #else static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, PyObject *cause) { PyObject* owned_instance = NULL; if (tb == Py_None) { tb = 0; } else if (tb && !PyTraceBack_Check(tb)) { PyErr_SetString(PyExc_TypeError, "raise: arg 3 must be a traceback or None"); goto bad; } if (value == Py_None) value = 0; if (PyExceptionInstance_Check(type)) { if (value) { PyErr_SetString(PyExc_TypeError, "instance exception may not have a separate value"); goto bad; } value = type; type = (PyObject*) Py_TYPE(value); } else if (PyExceptionClass_Check(type)) { PyObject *instance_class = NULL; if (value && PyExceptionInstance_Check(value)) { instance_class = (PyObject*) Py_TYPE(value); if (instance_class != type) { int is_subclass = PyObject_IsSubclass(instance_class, type); if (!is_subclass) { instance_class = NULL; } else if (unlikely(is_subclass == -1)) { goto bad; } else { type = instance_class; } } } if (!instance_class) { PyObject *args; if (!value) args = PyTuple_New(0); else if (PyTuple_Check(value)) { Py_INCREF(value); args = value; } else args = PyTuple_Pack(1, value); if (!args) goto bad; owned_instance = PyObject_Call(type, args, NULL); Py_DECREF(args); if (!owned_instance) goto bad; value = owned_instance; if (!PyExceptionInstance_Check(value)) { PyErr_Format(PyExc_TypeError, "calling %R should have returned an instance of " "BaseException, not %R", type, Py_TYPE(value)); goto bad; } } } else { PyErr_SetString(PyExc_TypeError, "raise: exception class must be a subclass of BaseException"); goto bad; } #if PY_VERSION_HEX >= 0x03030000 if (cause) { #else if (cause && cause != Py_None) { #endif PyObject *fixed_cause; if (cause == Py_None) { fixed_cause = NULL; } else if (PyExceptionClass_Check(cause)) { fixed_cause = PyObject_CallObject(cause, NULL); if (fixed_cause == NULL) goto bad; } else if (PyExceptionInstance_Check(cause)) { fixed_cause = cause; Py_INCREF(fixed_cause); } else { PyErr_SetString(PyExc_TypeError, "exception causes must derive from " "BaseException"); goto bad; } PyException_SetCause(value, fixed_cause); } PyErr_SetObject(type, value); if (tb) { #if CYTHON_COMPILING_IN_PYPY PyObject *tmp_type, *tmp_value, *tmp_tb; PyErr_Fetch(&tmp_type, &tmp_value, &tmp_tb); Py_INCREF(tb); PyErr_Restore(tmp_type, tmp_value, tb); Py_XDECREF(tmp_tb); #else PyThreadState *tstate = PyThreadState_GET(); PyObject* tmp_tb = tstate->curexc_traceback; if (tb != tmp_tb) { Py_INCREF(tb); tstate->curexc_traceback = tb; Py_XDECREF(tmp_tb); } #endif } bad: Py_XDECREF(owned_instance); return; } #endif static void __Pyx_WriteUnraisable(const char *name, CYTHON_UNUSED int clineno, CYTHON_UNUSED int lineno, CYTHON_UNUSED const char *filename, int full_traceback, CYTHON_UNUSED int nogil) { PyObject *old_exc, *old_val, *old_tb; PyObject *ctx; #ifdef WITH_THREAD PyGILState_STATE state; if (nogil) state = PyGILState_Ensure(); #endif __Pyx_ErrFetch(&old_exc, &old_val, &old_tb); if (full_traceback) { Py_XINCREF(old_exc); Py_XINCREF(old_val); Py_XINCREF(old_tb); __Pyx_ErrRestore(old_exc, old_val, old_tb); PyErr_PrintEx(1); } #if PY_MAJOR_VERSION < 3 ctx = PyString_FromString(name); #else ctx = PyUnicode_FromString(name); #endif __Pyx_ErrRestore(old_exc, old_val, old_tb); if (!ctx) { PyErr_WriteUnraisable(Py_None); } else { PyErr_WriteUnraisable(ctx); Py_DECREF(ctx); } #ifdef WITH_THREAD if (nogil) PyGILState_Release(state); #endif } static CYTHON_INLINE void __Pyx_RaiseTooManyValuesError(Py_ssize_t expected) { PyErr_Format(PyExc_ValueError, "too many values to unpack (expected %" CYTHON_FORMAT_SSIZE_T "d)", expected); } static CYTHON_INLINE void __Pyx_RaiseNeedMoreValuesError(Py_ssize_t index) { PyErr_Format(PyExc_ValueError, "need more than %" CYTHON_FORMAT_SSIZE_T "d value%.1s to unpack", index, (index == 1) ? "" : "s"); } static CYTHON_INLINE int __Pyx_IterFinish(void) { #if CYTHON_COMPILING_IN_CPYTHON PyThreadState *tstate = PyThreadState_GET(); PyObject* exc_type = tstate->curexc_type; if (unlikely(exc_type)) { if (likely(exc_type == PyExc_StopIteration) || PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration)) { PyObject *exc_value, *exc_tb; exc_value = tstate->curexc_value; exc_tb = tstate->curexc_traceback; tstate->curexc_type = 0; tstate->curexc_value = 0; tstate->curexc_traceback = 0; Py_DECREF(exc_type); Py_XDECREF(exc_value); Py_XDECREF(exc_tb); return 0; } else { return -1; } } return 0; #else if (unlikely(PyErr_Occurred())) { if (likely(PyErr_ExceptionMatches(PyExc_StopIteration))) { PyErr_Clear(); return 0; } else { return -1; } } return 0; #endif } static int __Pyx_IternextUnpackEndCheck(PyObject *retval, Py_ssize_t expected) { if (unlikely(retval)) { Py_DECREF(retval); __Pyx_RaiseTooManyValuesError(expected); return -1; } else { return __Pyx_IterFinish(); } return 0; } static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Generic(PyObject *o, PyObject* j) { PyObject *r; if (!j) return NULL; r = PyObject_GetItem(o, j); Py_DECREF(j); return r; } static CYTHON_INLINE PyObject *__Pyx_GetItemInt_List_Fast(PyObject *o, Py_ssize_t i, CYTHON_NCP_UNUSED int wraparound, CYTHON_NCP_UNUSED int boundscheck) { #if CYTHON_COMPILING_IN_CPYTHON if (wraparound & unlikely(i < 0)) i += PyList_GET_SIZE(o); if ((!boundscheck) || likely((0 <= i) & (i < PyList_GET_SIZE(o)))) { PyObject *r = PyList_GET_ITEM(o, i); Py_INCREF(r); return r; } return __Pyx_GetItemInt_Generic(o, PyInt_FromSsize_t(i)); #else return PySequence_GetItem(o, i); #endif } static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Tuple_Fast(PyObject *o, Py_ssize_t i, CYTHON_NCP_UNUSED int wraparound, CYTHON_NCP_UNUSED int boundscheck) { #if CYTHON_COMPILING_IN_CPYTHON if (wraparound & unlikely(i < 0)) i += PyTuple_GET_SIZE(o); if ((!boundscheck) || likely((0 <= i) & (i < PyTuple_GET_SIZE(o)))) { PyObject *r = PyTuple_GET_ITEM(o, i); Py_INCREF(r); return r; } return __Pyx_GetItemInt_Generic(o, PyInt_FromSsize_t(i)); #else return PySequence_GetItem(o, i); #endif } static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Fast(PyObject *o, Py_ssize_t i, int is_list, CYTHON_NCP_UNUSED int wraparound, CYTHON_NCP_UNUSED int boundscheck) { #if CYTHON_COMPILING_IN_CPYTHON if (is_list || PyList_CheckExact(o)) { Py_ssize_t n = ((!wraparound) | likely(i >= 0)) ? i : i + PyList_GET_SIZE(o); if ((!boundscheck) || (likely((n >= 0) & (n < PyList_GET_SIZE(o))))) { PyObject *r = PyList_GET_ITEM(o, n); Py_INCREF(r); return r; } } else if (PyTuple_CheckExact(o)) { Py_ssize_t n = ((!wraparound) | likely(i >= 0)) ? i : i + PyTuple_GET_SIZE(o); if ((!boundscheck) || likely((n >= 0) & (n < PyTuple_GET_SIZE(o)))) { PyObject *r = PyTuple_GET_ITEM(o, n); Py_INCREF(r); return r; } } else { PySequenceMethods *m = Py_TYPE(o)->tp_as_sequence; if (likely(m && m->sq_item)) { if (wraparound && unlikely(i < 0) && likely(m->sq_length)) { Py_ssize_t l = m->sq_length(o); if (likely(l >= 0)) { i += l; } else { if (PyErr_ExceptionMatches(PyExc_OverflowError)) PyErr_Clear(); else return NULL; } } return m->sq_item(o, i); } } #else if (is_list || PySequence_Check(o)) { return PySequence_GetItem(o, i); } #endif return __Pyx_GetItemInt_Generic(o, PyInt_FromSsize_t(i)); } static void* __Pyx_GetVtable(PyObject *dict) { void* ptr; PyObject *ob = PyObject_GetItem(dict, __pyx_n_s_pyx_vtable); if (!ob) goto bad; #if PY_VERSION_HEX >= 0x02070000 ptr = PyCapsule_GetPointer(ob, 0); #else ptr = PyCObject_AsVoidPtr(ob); #endif if (!ptr && !PyErr_Occurred()) PyErr_SetString(PyExc_RuntimeError, "invalid vtable found for imported type"); Py_DECREF(ob); return ptr; bad: Py_XDECREF(ob); return NULL; } static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list, int level) { PyObject *empty_list = 0; PyObject *module = 0; PyObject *global_dict = 0; PyObject *empty_dict = 0; PyObject *list; #if PY_VERSION_HEX < 0x03030000 PyObject *py_import; py_import = __Pyx_PyObject_GetAttrStr(__pyx_b, __pyx_n_s_import); if (!py_import) goto bad; #endif if (from_list) list = from_list; else { empty_list = PyList_New(0); if (!empty_list) goto bad; list = empty_list; } global_dict = PyModule_GetDict(__pyx_m); if (!global_dict) goto bad; empty_dict = PyDict_New(); if (!empty_dict) goto bad; { #if PY_MAJOR_VERSION >= 3 if (level == -1) { if (strchr(__Pyx_MODULE_NAME, '.')) { #if PY_VERSION_HEX < 0x03030000 PyObject *py_level = PyInt_FromLong(1); if (!py_level) goto bad; module = PyObject_CallFunctionObjArgs(py_import, name, global_dict, empty_dict, list, py_level, NULL); Py_DECREF(py_level); #else module = PyImport_ImportModuleLevelObject( name, global_dict, empty_dict, list, 1); #endif if (!module) { if (!PyErr_ExceptionMatches(PyExc_ImportError)) goto bad; PyErr_Clear(); } } level = 0; } #endif if (!module) { #if PY_VERSION_HEX < 0x03030000 PyObject *py_level = PyInt_FromLong(level); if (!py_level) goto bad; module = PyObject_CallFunctionObjArgs(py_import, name, global_dict, empty_dict, list, py_level, NULL); Py_DECREF(py_level); #else module = PyImport_ImportModuleLevelObject( name, global_dict, empty_dict, list, level); #endif } } bad: #if PY_VERSION_HEX < 0x03030000 Py_XDECREF(py_import); #endif Py_XDECREF(empty_list); Py_XDECREF(empty_dict); return module; } static PyObject* __Pyx_ImportFrom(PyObject* module, PyObject* name) { PyObject* value = __Pyx_PyObject_GetAttrStr(module, name); if (unlikely(!value) && PyErr_ExceptionMatches(PyExc_AttributeError)) { PyErr_Format(PyExc_ImportError, #if PY_MAJOR_VERSION < 3 "cannot import name %.230s", PyString_AS_STRING(name)); #else "cannot import name %S", name); #endif } return value; } static int __pyx_bisect_code_objects(__Pyx_CodeObjectCacheEntry* entries, int count, int code_line) { int start = 0, mid = 0, end = count - 1; if (end >= 0 && code_line > entries[end].code_line) { return count; } while (start < end) { mid = start + (end - start) / 2; if (code_line < entries[mid].code_line) { end = mid; } else if (code_line > entries[mid].code_line) { start = mid + 1; } else { return mid; } } if (code_line <= entries[mid].code_line) { return mid; } else { return mid + 1; } } static PyCodeObject *__pyx_find_code_object(int code_line) { PyCodeObject* code_object; int pos; if (unlikely(!code_line) || unlikely(!__pyx_code_cache.entries)) { return NULL; } pos = __pyx_bisect_code_objects(__pyx_code_cache.entries, __pyx_code_cache.count, code_line); if (unlikely(pos >= __pyx_code_cache.count) || unlikely(__pyx_code_cache.entries[pos].code_line != code_line)) { return NULL; } code_object = __pyx_code_cache.entries[pos].code_object; Py_INCREF(code_object); return code_object; } static void __pyx_insert_code_object(int code_line, PyCodeObject* code_object) { int pos, i; __Pyx_CodeObjectCacheEntry* entries = __pyx_code_cache.entries; if (unlikely(!code_line)) { return; } if (unlikely(!entries)) { entries = (__Pyx_CodeObjectCacheEntry*)PyMem_Malloc(64*sizeof(__Pyx_CodeObjectCacheEntry)); if (likely(entries)) { __pyx_code_cache.entries = entries; __pyx_code_cache.max_count = 64; __pyx_code_cache.count = 1; entries[0].code_line = code_line; entries[0].code_object = code_object; Py_INCREF(code_object); } return; } pos = __pyx_bisect_code_objects(__pyx_code_cache.entries, __pyx_code_cache.count, code_line); if ((pos < __pyx_code_cache.count) && unlikely(__pyx_code_cache.entries[pos].code_line == code_line)) { PyCodeObject* tmp = entries[pos].code_object; entries[pos].code_object = code_object; Py_DECREF(tmp); return; } if (__pyx_code_cache.count == __pyx_code_cache.max_count) { int new_max = __pyx_code_cache.max_count + 64; entries = (__Pyx_CodeObjectCacheEntry*)PyMem_Realloc( __pyx_code_cache.entries, (size_t)new_max*sizeof(__Pyx_CodeObjectCacheEntry)); if (unlikely(!entries)) { return; } __pyx_code_cache.entries = entries; __pyx_code_cache.max_count = new_max; } for (i=__pyx_code_cache.count; i>pos; i--) { entries[i] = entries[i-1]; } entries[pos].code_line = code_line; entries[pos].code_object = code_object; __pyx_code_cache.count++; Py_INCREF(code_object); } #include "compile.h" #include "frameobject.h" #include "traceback.h" static PyCodeObject* __Pyx_CreateCodeObjectForTraceback( const char *funcname, int c_line, int py_line, const char *filename) { PyCodeObject *py_code = 0; PyObject *py_srcfile = 0; PyObject *py_funcname = 0; #if PY_MAJOR_VERSION < 3 py_srcfile = PyString_FromString(filename); #else py_srcfile = PyUnicode_FromString(filename); #endif if (!py_srcfile) goto bad; if (c_line) { #if PY_MAJOR_VERSION < 3 py_funcname = PyString_FromFormat( "%s (%s:%d)", funcname, __pyx_cfilenm, c_line); #else py_funcname = PyUnicode_FromFormat( "%s (%s:%d)", funcname, __pyx_cfilenm, c_line); #endif } else { #if PY_MAJOR_VERSION < 3 py_funcname = PyString_FromString(funcname); #else py_funcname = PyUnicode_FromString(funcname); #endif } if (!py_funcname) goto bad; py_code = __Pyx_PyCode_New( 0, 0, 0, 0, 0, __pyx_empty_bytes, /*PyObject *code,*/ __pyx_empty_tuple, /*PyObject *consts,*/ __pyx_empty_tuple, /*PyObject *names,*/ __pyx_empty_tuple, /*PyObject *varnames,*/ __pyx_empty_tuple, /*PyObject *freevars,*/ __pyx_empty_tuple, /*PyObject *cellvars,*/ py_srcfile, /*PyObject *filename,*/ py_funcname, /*PyObject *name,*/ py_line, __pyx_empty_bytes /*PyObject *lnotab*/ ); Py_DECREF(py_srcfile); Py_DECREF(py_funcname); return py_code; bad: Py_XDECREF(py_srcfile); Py_XDECREF(py_funcname); return NULL; } static void __Pyx_AddTraceback(const char *funcname, int c_line, int py_line, const char *filename) { PyCodeObject *py_code = 0; PyFrameObject *py_frame = 0; py_code = __pyx_find_code_object(c_line ? c_line : py_line); if (!py_code) { py_code = __Pyx_CreateCodeObjectForTraceback( funcname, c_line, py_line, filename); if (!py_code) goto bad; __pyx_insert_code_object(c_line ? c_line : py_line, py_code); } py_frame = PyFrame_New( PyThreadState_GET(), /*PyThreadState *tstate,*/ py_code, /*PyCodeObject *code,*/ __pyx_d, /*PyObject *globals,*/ 0 /*PyObject *locals*/ ); if (!py_frame) goto bad; py_frame->f_lineno = py_line; PyTraceBack_Here(py_frame); bad: Py_XDECREF(py_code); Py_XDECREF(py_frame); } #define __PYX_VERIFY_RETURN_INT(target_type, func_type, func_value)\ __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, 0) #define __PYX_VERIFY_RETURN_INT_EXC(target_type, func_type, func_value)\ __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, 1) #define __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, exc)\ {\ func_type value = func_value;\ if (sizeof(target_type) < sizeof(func_type)) {\ if (unlikely(value != (func_type) (target_type) value)) {\ func_type zero = 0;\ if (exc && unlikely(value == (func_type)-1 && PyErr_Occurred()))\ return (target_type) -1;\ if (is_unsigned && unlikely(value < zero))\ goto raise_neg_overflow;\ else\ goto raise_overflow;\ }\ }\ return (target_type) value;\ } #if CYTHON_USE_PYLONG_INTERNALS #include "longintrepr.h" #endif static CYTHON_INLINE int __Pyx_PyInt_As_int(PyObject *x) { const int neg_one = (int) -1, const_zero = (int) 0; const int is_unsigned = neg_one > const_zero; #if PY_MAJOR_VERSION < 3 if (likely(PyInt_Check(x))) { if (sizeof(int) < sizeof(long)) { __PYX_VERIFY_RETURN_INT(int, long, PyInt_AS_LONG(x)) } else { long val = PyInt_AS_LONG(x); if (is_unsigned && unlikely(val < 0)) { goto raise_neg_overflow; } return (int) val; } } else #endif if (likely(PyLong_Check(x))) { if (is_unsigned) { #if CYTHON_USE_PYLONG_INTERNALS const digit* digits = ((PyLongObject*)x)->ob_digit; switch (Py_SIZE(x)) { case 0: return (int) 0; case 1: __PYX_VERIFY_RETURN_INT(int, digit, digits[0]) case 2: if (8 * sizeof(int) > 1 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(int) >= 2 * PyLong_SHIFT) { return (int) (((((int)digits[1]) << PyLong_SHIFT) | (int)digits[0])); } } break; case 3: if (8 * sizeof(int) > 2 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(int) >= 3 * PyLong_SHIFT) { return (int) (((((((int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0])); } } break; case 4: if (8 * sizeof(int) > 3 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(int) >= 4 * PyLong_SHIFT) { return (int) (((((((((int)digits[3]) << PyLong_SHIFT) | (int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0])); } } break; } #endif #if CYTHON_COMPILING_IN_CPYTHON if (unlikely(Py_SIZE(x) < 0)) { goto raise_neg_overflow; } #else { int result = PyObject_RichCompareBool(x, Py_False, Py_LT); if (unlikely(result < 0)) return (int) -1; if (unlikely(result == 1)) goto raise_neg_overflow; } #endif if (sizeof(int) <= sizeof(unsigned long)) { __PYX_VERIFY_RETURN_INT_EXC(int, unsigned long, PyLong_AsUnsignedLong(x)) } else if (sizeof(int) <= sizeof(unsigned PY_LONG_LONG)) { __PYX_VERIFY_RETURN_INT_EXC(int, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x)) } } else { #if CYTHON_USE_PYLONG_INTERNALS const digit* digits = ((PyLongObject*)x)->ob_digit; switch (Py_SIZE(x)) { case 0: return (int) 0; case -1: __PYX_VERIFY_RETURN_INT(int, sdigit, -(sdigit) digits[0]) case 1: __PYX_VERIFY_RETURN_INT(int, digit, +digits[0]) case -2: if (8 * sizeof(int) - 1 > 1 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(int, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(int) - 1 > 2 * PyLong_SHIFT) { return (int) (((int)-1)*(((((int)digits[1]) << PyLong_SHIFT) | (int)digits[0]))); } } break; case 2: if (8 * sizeof(int) > 1 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(int) - 1 > 2 * PyLong_SHIFT) { return (int) ((((((int)digits[1]) << PyLong_SHIFT) | (int)digits[0]))); } } break; case -3: if (8 * sizeof(int) - 1 > 2 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(int, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(int) - 1 > 3 * PyLong_SHIFT) { return (int) (((int)-1)*(((((((int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0]))); } } break; case 3: if (8 * sizeof(int) > 2 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(int) - 1 > 3 * PyLong_SHIFT) { return (int) ((((((((int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0]))); } } break; case -4: if (8 * sizeof(int) - 1 > 3 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(int, long, -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(int) - 1 > 4 * PyLong_SHIFT) { return (int) (((int)-1)*(((((((((int)digits[3]) << PyLong_SHIFT) | (int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0]))); } } break; case 4: if (8 * sizeof(int) > 3 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(int) - 1 > 4 * PyLong_SHIFT) { return (int) ((((((((((int)digits[3]) << PyLong_SHIFT) | (int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0]))); } } break; } #endif if (sizeof(int) <= sizeof(long)) { __PYX_VERIFY_RETURN_INT_EXC(int, long, PyLong_AsLong(x)) } else if (sizeof(int) <= sizeof(PY_LONG_LONG)) { __PYX_VERIFY_RETURN_INT_EXC(int, PY_LONG_LONG, PyLong_AsLongLong(x)) } } { #if CYTHON_COMPILING_IN_PYPY && !defined(_PyLong_AsByteArray) PyErr_SetString(PyExc_RuntimeError, "_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers"); #else int val; PyObject *v = __Pyx_PyNumber_Int(x); #if PY_MAJOR_VERSION < 3 if (likely(v) && !PyLong_Check(v)) { PyObject *tmp = v; v = PyNumber_Long(tmp); Py_DECREF(tmp); } #endif if (likely(v)) { int one = 1; int is_little = (int)*(unsigned char *)&one; unsigned char *bytes = (unsigned char *)&val; int ret = _PyLong_AsByteArray((PyLongObject *)v, bytes, sizeof(val), is_little, !is_unsigned); Py_DECREF(v); if (likely(!ret)) return val; } #endif return (int) -1; } } else { int val; PyObject *tmp = __Pyx_PyNumber_Int(x); if (!tmp) return (int) -1; val = __Pyx_PyInt_As_int(tmp); Py_DECREF(tmp); return val; } raise_overflow: PyErr_SetString(PyExc_OverflowError, "value too large to convert to int"); return (int) -1; raise_neg_overflow: PyErr_SetString(PyExc_OverflowError, "can't convert negative value to int"); return (int) -1; } static CYTHON_INLINE PyObject* __Pyx_PyInt_From_int(int value) { const int neg_one = (int) -1, const_zero = (int) 0; const int is_unsigned = neg_one > const_zero; if (is_unsigned) { if (sizeof(int) < sizeof(long)) { return PyInt_FromLong((long) value); } else if (sizeof(int) <= sizeof(unsigned long)) { return PyLong_FromUnsignedLong((unsigned long) value); } else if (sizeof(int) <= sizeof(unsigned PY_LONG_LONG)) { return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value); } } else { if (sizeof(int) <= sizeof(long)) { return PyInt_FromLong((long) value); } else if (sizeof(int) <= sizeof(PY_LONG_LONG)) { return PyLong_FromLongLong((PY_LONG_LONG) value); } } { int one = 1; int little = (int)*(unsigned char *)&one; unsigned char *bytes = (unsigned char *)&value; return _PyLong_FromByteArray(bytes, sizeof(int), little, !is_unsigned); } } static CYTHON_INLINE PyObject* __Pyx_PyInt_From_long(long value) { const long neg_one = (long) -1, const_zero = (long) 0; const int is_unsigned = neg_one > const_zero; if (is_unsigned) { if (sizeof(long) < sizeof(long)) { return PyInt_FromLong((long) value); } else if (sizeof(long) <= sizeof(unsigned long)) { return PyLong_FromUnsignedLong((unsigned long) value); } else if (sizeof(long) <= sizeof(unsigned PY_LONG_LONG)) { return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value); } } else { if (sizeof(long) <= sizeof(long)) { return PyInt_FromLong((long) value); } else if (sizeof(long) <= sizeof(PY_LONG_LONG)) { return PyLong_FromLongLong((PY_LONG_LONG) value); } } { int one = 1; int little = (int)*(unsigned char *)&one; unsigned char *bytes = (unsigned char *)&value; return _PyLong_FromByteArray(bytes, sizeof(long), little, !is_unsigned); } } static CYTHON_INLINE long __Pyx_PyInt_As_long(PyObject *x) { const long neg_one = (long) -1, const_zero = (long) 0; const int is_unsigned = neg_one > const_zero; #if PY_MAJOR_VERSION < 3 if (likely(PyInt_Check(x))) { if (sizeof(long) < sizeof(long)) { __PYX_VERIFY_RETURN_INT(long, long, PyInt_AS_LONG(x)) } else { long val = PyInt_AS_LONG(x); if (is_unsigned && unlikely(val < 0)) { goto raise_neg_overflow; } return (long) val; } } else #endif if (likely(PyLong_Check(x))) { if (is_unsigned) { #if CYTHON_USE_PYLONG_INTERNALS const digit* digits = ((PyLongObject*)x)->ob_digit; switch (Py_SIZE(x)) { case 0: return (long) 0; case 1: __PYX_VERIFY_RETURN_INT(long, digit, digits[0]) case 2: if (8 * sizeof(long) > 1 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(long) >= 2 * PyLong_SHIFT) { return (long) (((((long)digits[1]) << PyLong_SHIFT) | (long)digits[0])); } } break; case 3: if (8 * sizeof(long) > 2 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(long) >= 3 * PyLong_SHIFT) { return (long) (((((((long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0])); } } break; case 4: if (8 * sizeof(long) > 3 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(long) >= 4 * PyLong_SHIFT) { return (long) (((((((((long)digits[3]) << PyLong_SHIFT) | (long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0])); } } break; } #endif #if CYTHON_COMPILING_IN_CPYTHON if (unlikely(Py_SIZE(x) < 0)) { goto raise_neg_overflow; } #else { int result = PyObject_RichCompareBool(x, Py_False, Py_LT); if (unlikely(result < 0)) return (long) -1; if (unlikely(result == 1)) goto raise_neg_overflow; } #endif if (sizeof(long) <= sizeof(unsigned long)) { __PYX_VERIFY_RETURN_INT_EXC(long, unsigned long, PyLong_AsUnsignedLong(x)) } else if (sizeof(long) <= sizeof(unsigned PY_LONG_LONG)) { __PYX_VERIFY_RETURN_INT_EXC(long, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x)) } } else { #if CYTHON_USE_PYLONG_INTERNALS const digit* digits = ((PyLongObject*)x)->ob_digit; switch (Py_SIZE(x)) { case 0: return (long) 0; case -1: __PYX_VERIFY_RETURN_INT(long, sdigit, -(sdigit) digits[0]) case 1: __PYX_VERIFY_RETURN_INT(long, digit, +digits[0]) case -2: if (8 * sizeof(long) - 1 > 1 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(long, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) { return (long) (((long)-1)*(((((long)digits[1]) << PyLong_SHIFT) | (long)digits[0]))); } } break; case 2: if (8 * sizeof(long) > 1 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) { return (long) ((((((long)digits[1]) << PyLong_SHIFT) | (long)digits[0]))); } } break; case -3: if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(long, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) { return (long) (((long)-1)*(((((((long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0]))); } } break; case 3: if (8 * sizeof(long) > 2 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) { return (long) ((((((((long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0]))); } } break; case -4: if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(long, long, -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(long) - 1 > 4 * PyLong_SHIFT) { return (long) (((long)-1)*(((((((((long)digits[3]) << PyLong_SHIFT) | (long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0]))); } } break; case 4: if (8 * sizeof(long) > 3 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(long) - 1 > 4 * PyLong_SHIFT) { return (long) ((((((((((long)digits[3]) << PyLong_SHIFT) | (long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0]))); } } break; } #endif if (sizeof(long) <= sizeof(long)) { __PYX_VERIFY_RETURN_INT_EXC(long, long, PyLong_AsLong(x)) } else if (sizeof(long) <= sizeof(PY_LONG_LONG)) { __PYX_VERIFY_RETURN_INT_EXC(long, PY_LONG_LONG, PyLong_AsLongLong(x)) } } { #if CYTHON_COMPILING_IN_PYPY && !defined(_PyLong_AsByteArray) PyErr_SetString(PyExc_RuntimeError, "_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers"); #else long val; PyObject *v = __Pyx_PyNumber_Int(x); #if PY_MAJOR_VERSION < 3 if (likely(v) && !PyLong_Check(v)) { PyObject *tmp = v; v = PyNumber_Long(tmp); Py_DECREF(tmp); } #endif if (likely(v)) { int one = 1; int is_little = (int)*(unsigned char *)&one; unsigned char *bytes = (unsigned char *)&val; int ret = _PyLong_AsByteArray((PyLongObject *)v, bytes, sizeof(val), is_little, !is_unsigned); Py_DECREF(v); if (likely(!ret)) return val; } #endif return (long) -1; } } else { long val; PyObject *tmp = __Pyx_PyNumber_Int(x); if (!tmp) return (long) -1; val = __Pyx_PyInt_As_long(tmp); Py_DECREF(tmp); return val; } raise_overflow: PyErr_SetString(PyExc_OverflowError, "value too large to convert to long"); return (long) -1; raise_neg_overflow: PyErr_SetString(PyExc_OverflowError, "can't convert negative value to long"); return (long) -1; } static int __Pyx_check_binary_version(void) { char ctversion[4], rtversion[4]; PyOS_snprintf(ctversion, 4, "%d.%d", PY_MAJOR_VERSION, PY_MINOR_VERSION); PyOS_snprintf(rtversion, 4, "%s", Py_GetVersion()); if (ctversion[0] != rtversion[0] || ctversion[2] != rtversion[2]) { char message[200]; PyOS_snprintf(message, sizeof(message), "compiletime version %s of module '%.100s' " "does not match runtime version %s", ctversion, __Pyx_MODULE_NAME, rtversion); return PyErr_WarnEx(NULL, message, 1); } return 0; } #ifndef __PYX_HAVE_RT_ImportModule #define __PYX_HAVE_RT_ImportModule static PyObject *__Pyx_ImportModule(const char *name) { PyObject *py_name = 0; PyObject *py_module = 0; py_name = __Pyx_PyIdentifier_FromString(name); if (!py_name) goto bad; py_module = PyImport_Import(py_name); Py_DECREF(py_name); return py_module; bad: Py_XDECREF(py_name); return 0; } #endif #ifndef __PYX_HAVE_RT_ImportType #define __PYX_HAVE_RT_ImportType static PyTypeObject *__Pyx_ImportType(const char *module_name, const char *class_name, size_t size, int strict) { PyObject *py_module = 0; PyObject *result = 0; PyObject *py_name = 0; char warning[200]; Py_ssize_t basicsize; #ifdef Py_LIMITED_API PyObject *py_basicsize; #endif py_module = __Pyx_ImportModule(module_name); if (!py_module) goto bad; py_name = __Pyx_PyIdentifier_FromString(class_name); if (!py_name) goto bad; result = PyObject_GetAttr(py_module, py_name); Py_DECREF(py_name); py_name = 0; Py_DECREF(py_module); py_module = 0; if (!result) goto bad; if (!PyType_Check(result)) { PyErr_Format(PyExc_TypeError, "%.200s.%.200s is not a type object", module_name, class_name); goto bad; } #ifndef Py_LIMITED_API basicsize = ((PyTypeObject *)result)->tp_basicsize; #else py_basicsize = PyObject_GetAttrString(result, "__basicsize__"); if (!py_basicsize) goto bad; basicsize = PyLong_AsSsize_t(py_basicsize); Py_DECREF(py_basicsize); py_basicsize = 0; if (basicsize == (Py_ssize_t)-1 && PyErr_Occurred()) goto bad; #endif if (!strict && (size_t)basicsize > size) { PyOS_snprintf(warning, sizeof(warning), "%s.%s size changed, may indicate binary incompatibility", module_name, class_name); if (PyErr_WarnEx(NULL, warning, 0) < 0) goto bad; } else if ((size_t)basicsize != size) { PyErr_Format(PyExc_ValueError, "%.200s.%.200s has the wrong size, try recompiling", module_name, class_name); goto bad; } return (PyTypeObject *)result; bad: Py_XDECREF(py_module); Py_XDECREF(result); return NULL; } #endif static int __Pyx_InitStrings(__Pyx_StringTabEntry *t) { while (t->p) { #if PY_MAJOR_VERSION < 3 if (t->is_unicode) { *t->p = PyUnicode_DecodeUTF8(t->s, t->n - 1, NULL); } else if (t->intern) { *t->p = PyString_InternFromString(t->s); } else { *t->p = PyString_FromStringAndSize(t->s, t->n - 1); } #else if (t->is_unicode | t->is_str) { if (t->intern) { *t->p = PyUnicode_InternFromString(t->s); } else if (t->encoding) { *t->p = PyUnicode_Decode(t->s, t->n - 1, t->encoding, NULL); } else { *t->p = PyUnicode_FromStringAndSize(t->s, t->n - 1); } } else { *t->p = PyBytes_FromStringAndSize(t->s, t->n - 1); } #endif if (!*t->p) return -1; ++t; } return 0; } static CYTHON_INLINE PyObject* __Pyx_PyUnicode_FromString(const char* c_str) { return __Pyx_PyUnicode_FromStringAndSize(c_str, (Py_ssize_t)strlen(c_str)); } static CYTHON_INLINE char* __Pyx_PyObject_AsString(PyObject* o) { Py_ssize_t ignore; return __Pyx_PyObject_AsStringAndSize(o, &ignore); } static CYTHON_INLINE char* __Pyx_PyObject_AsStringAndSize(PyObject* o, Py_ssize_t *length) { #if CYTHON_COMPILING_IN_CPYTHON && (__PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT) if ( #if PY_MAJOR_VERSION < 3 && __PYX_DEFAULT_STRING_ENCODING_IS_ASCII __Pyx_sys_getdefaultencoding_not_ascii && #endif PyUnicode_Check(o)) { #if PY_VERSION_HEX < 0x03030000 char* defenc_c; PyObject* defenc = _PyUnicode_AsDefaultEncodedString(o, NULL); if (!defenc) return NULL; defenc_c = PyBytes_AS_STRING(defenc); #if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII { char* end = defenc_c + PyBytes_GET_SIZE(defenc); char* c; for (c = defenc_c; c < end; c++) { if ((unsigned char) (*c) >= 128) { PyUnicode_AsASCIIString(o); return NULL; } } } #endif *length = PyBytes_GET_SIZE(defenc); return defenc_c; #else if (__Pyx_PyUnicode_READY(o) == -1) return NULL; #if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII if (PyUnicode_IS_ASCII(o)) { *length = PyUnicode_GET_LENGTH(o); return PyUnicode_AsUTF8(o); } else { PyUnicode_AsASCIIString(o); return NULL; } #else return PyUnicode_AsUTF8AndSize(o, length); #endif #endif } else #endif #if (!CYTHON_COMPILING_IN_PYPY) || (defined(PyByteArray_AS_STRING) && defined(PyByteArray_GET_SIZE)) if (PyByteArray_Check(o)) { *length = PyByteArray_GET_SIZE(o); return PyByteArray_AS_STRING(o); } else #endif { char* result; int r = PyBytes_AsStringAndSize(o, &result, length); if (unlikely(r < 0)) { return NULL; } else { return result; } } } static CYTHON_INLINE int __Pyx_PyObject_IsTrue(PyObject* x) { int is_true = x == Py_True; if (is_true | (x == Py_False) | (x == Py_None)) return is_true; else return PyObject_IsTrue(x); } static CYTHON_INLINE PyObject* __Pyx_PyNumber_Int(PyObject* x) { PyNumberMethods *m; const char *name = NULL; PyObject *res = NULL; #if PY_MAJOR_VERSION < 3 if (PyInt_Check(x) || PyLong_Check(x)) #else if (PyLong_Check(x)) #endif return __Pyx_NewRef(x); m = Py_TYPE(x)->tp_as_number; #if PY_MAJOR_VERSION < 3 if (m && m->nb_int) { name = "int"; res = PyNumber_Int(x); } else if (m && m->nb_long) { name = "long"; res = PyNumber_Long(x); } #else if (m && m->nb_int) { name = "int"; res = PyNumber_Long(x); } #endif if (res) { #if PY_MAJOR_VERSION < 3 if (!PyInt_Check(res) && !PyLong_Check(res)) { #else if (!PyLong_Check(res)) { #endif PyErr_Format(PyExc_TypeError, "__%.4s__ returned non-%.4s (type %.200s)", name, name, Py_TYPE(res)->tp_name); Py_DECREF(res); return NULL; } } else if (!PyErr_Occurred()) { PyErr_SetString(PyExc_TypeError, "an integer is required"); } return res; } static CYTHON_INLINE Py_ssize_t __Pyx_PyIndex_AsSsize_t(PyObject* b) { Py_ssize_t ival; PyObject *x; #if PY_MAJOR_VERSION < 3 if (likely(PyInt_CheckExact(b))) { if (sizeof(Py_ssize_t) >= sizeof(long)) return PyInt_AS_LONG(b); else return PyInt_AsSsize_t(x); } #endif if (likely(PyLong_CheckExact(b))) { #if CYTHON_USE_PYLONG_INTERNALS const digit* digits = ((PyLongObject*)b)->ob_digit; const Py_ssize_t size = Py_SIZE(b); if (likely(__Pyx_sst_abs(size) <= 1)) { ival = likely(size) ? digits[0] : 0; if (size == -1) ival = -ival; return ival; } else { switch (size) { case 2: if (8 * sizeof(Py_ssize_t) > 2 * PyLong_SHIFT) { return (Py_ssize_t) (((((size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])); } break; case -2: if (8 * sizeof(Py_ssize_t) > 2 * PyLong_SHIFT) { return -(Py_ssize_t) (((((size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])); } break; case 3: if (8 * sizeof(Py_ssize_t) > 3 * PyLong_SHIFT) { return (Py_ssize_t) (((((((size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])); } break; case -3: if (8 * sizeof(Py_ssize_t) > 3 * PyLong_SHIFT) { return -(Py_ssize_t) (((((((size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])); } break; case 4: if (8 * sizeof(Py_ssize_t) > 4 * PyLong_SHIFT) { return (Py_ssize_t) (((((((((size_t)digits[3]) << PyLong_SHIFT) | (size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])); } break; case -4: if (8 * sizeof(Py_ssize_t) > 4 * PyLong_SHIFT) { return -(Py_ssize_t) (((((((((size_t)digits[3]) << PyLong_SHIFT) | (size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])); } break; } } #endif return PyLong_AsSsize_t(b); } x = PyNumber_Index(b); if (!x) return -1; ival = PyInt_AsSsize_t(x); Py_DECREF(x); return ival; } static CYTHON_INLINE PyObject * __Pyx_PyInt_FromSize_t(size_t ival) { return PyInt_FromSize_t(ival); } #endif /* Py_PYTHON_H */ pygame_sdl2-2.1.0-for-renpy-6.99.14.1/gen/pygame_sdl2.scrap.c0000664000175000017500000037734312660477777022550 0ustar tomtom00000000000000/* Generated by Cython 0.23.4 */ #define PY_SSIZE_T_CLEAN #include "Python.h" #ifndef Py_PYTHON_H #error Python headers needed to compile C extensions, please install development version of Python. #elif PY_VERSION_HEX < 0x02060000 || (0x03000000 <= PY_VERSION_HEX && PY_VERSION_HEX < 0x03020000) #error Cython requires Python 2.6+ or Python 3.2+. #else #define CYTHON_ABI "0_23_4" #include #ifndef offsetof #define offsetof(type, member) ( (size_t) & ((type*)0) -> member ) #endif #if !defined(WIN32) && !defined(MS_WINDOWS) #ifndef __stdcall #define __stdcall #endif #ifndef __cdecl #define __cdecl #endif #ifndef __fastcall #define __fastcall #endif #endif #ifndef DL_IMPORT #define DL_IMPORT(t) t #endif #ifndef DL_EXPORT #define DL_EXPORT(t) t #endif #ifndef PY_LONG_LONG #define PY_LONG_LONG LONG_LONG #endif #ifndef Py_HUGE_VAL #define Py_HUGE_VAL HUGE_VAL #endif #ifdef PYPY_VERSION #define CYTHON_COMPILING_IN_PYPY 1 #define CYTHON_COMPILING_IN_CPYTHON 0 #else #define CYTHON_COMPILING_IN_PYPY 0 #define CYTHON_COMPILING_IN_CPYTHON 1 #endif #if !defined(CYTHON_USE_PYLONG_INTERNALS) && CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x02070000 #define CYTHON_USE_PYLONG_INTERNALS 1 #endif #if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX < 0x02070600 && !defined(Py_OptimizeFlag) #define Py_OptimizeFlag 0 #endif #define __PYX_BUILD_PY_SSIZE_T "n" #define CYTHON_FORMAT_SSIZE_T "z" #if PY_MAJOR_VERSION < 3 #define __Pyx_BUILTIN_MODULE_NAME "__builtin__" #define __Pyx_PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)\ PyCode_New(a+k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos) #define __Pyx_DefaultClassType PyClass_Type #else #define __Pyx_BUILTIN_MODULE_NAME "builtins" #define __Pyx_PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)\ PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos) #define __Pyx_DefaultClassType PyType_Type #endif #ifndef Py_TPFLAGS_CHECKTYPES #define Py_TPFLAGS_CHECKTYPES 0 #endif #ifndef Py_TPFLAGS_HAVE_INDEX #define Py_TPFLAGS_HAVE_INDEX 0 #endif #ifndef Py_TPFLAGS_HAVE_NEWBUFFER #define Py_TPFLAGS_HAVE_NEWBUFFER 0 #endif #ifndef Py_TPFLAGS_HAVE_FINALIZE #define Py_TPFLAGS_HAVE_FINALIZE 0 #endif #if PY_VERSION_HEX > 0x03030000 && defined(PyUnicode_KIND) #define CYTHON_PEP393_ENABLED 1 #define __Pyx_PyUnicode_READY(op) (likely(PyUnicode_IS_READY(op)) ?\ 0 : _PyUnicode_Ready((PyObject *)(op))) #define __Pyx_PyUnicode_GET_LENGTH(u) PyUnicode_GET_LENGTH(u) #define __Pyx_PyUnicode_READ_CHAR(u, i) PyUnicode_READ_CHAR(u, i) #define __Pyx_PyUnicode_KIND(u) PyUnicode_KIND(u) #define __Pyx_PyUnicode_DATA(u) PyUnicode_DATA(u) #define __Pyx_PyUnicode_READ(k, d, i) PyUnicode_READ(k, d, i) #else #define CYTHON_PEP393_ENABLED 0 #define __Pyx_PyUnicode_READY(op) (0) #define __Pyx_PyUnicode_GET_LENGTH(u) PyUnicode_GET_SIZE(u) #define __Pyx_PyUnicode_READ_CHAR(u, i) ((Py_UCS4)(PyUnicode_AS_UNICODE(u)[i])) #define __Pyx_PyUnicode_KIND(u) (sizeof(Py_UNICODE)) #define __Pyx_PyUnicode_DATA(u) ((void*)PyUnicode_AS_UNICODE(u)) #define __Pyx_PyUnicode_READ(k, d, i) ((void)(k), (Py_UCS4)(((Py_UNICODE*)d)[i])) #endif #if CYTHON_COMPILING_IN_PYPY #define __Pyx_PyUnicode_Concat(a, b) PyNumber_Add(a, b) #define __Pyx_PyUnicode_ConcatSafe(a, b) PyNumber_Add(a, b) #else #define __Pyx_PyUnicode_Concat(a, b) PyUnicode_Concat(a, b) #define __Pyx_PyUnicode_ConcatSafe(a, b) ((unlikely((a) == Py_None) || unlikely((b) == Py_None)) ?\ PyNumber_Add(a, b) : __Pyx_PyUnicode_Concat(a, b)) #endif #if CYTHON_COMPILING_IN_PYPY && !defined(PyUnicode_Contains) #define PyUnicode_Contains(u, s) PySequence_Contains(u, s) #endif #define __Pyx_PyString_FormatSafe(a, b) ((unlikely((a) == Py_None)) ? PyNumber_Remainder(a, b) : __Pyx_PyString_Format(a, b)) #define __Pyx_PyUnicode_FormatSafe(a, b) ((unlikely((a) == Py_None)) ? PyNumber_Remainder(a, b) : PyUnicode_Format(a, b)) #if PY_MAJOR_VERSION >= 3 #define __Pyx_PyString_Format(a, b) PyUnicode_Format(a, b) #else #define __Pyx_PyString_Format(a, b) PyString_Format(a, b) #endif #if PY_MAJOR_VERSION >= 3 #define PyBaseString_Type PyUnicode_Type #define PyStringObject PyUnicodeObject #define PyString_Type PyUnicode_Type #define PyString_Check PyUnicode_Check #define PyString_CheckExact PyUnicode_CheckExact #endif #if PY_MAJOR_VERSION >= 3 #define __Pyx_PyBaseString_Check(obj) PyUnicode_Check(obj) #define __Pyx_PyBaseString_CheckExact(obj) PyUnicode_CheckExact(obj) #else #define __Pyx_PyBaseString_Check(obj) (PyString_Check(obj) || PyUnicode_Check(obj)) #define __Pyx_PyBaseString_CheckExact(obj) (PyString_CheckExact(obj) || PyUnicode_CheckExact(obj)) #endif #ifndef PySet_CheckExact #define PySet_CheckExact(obj) (Py_TYPE(obj) == &PySet_Type) #endif #define __Pyx_TypeCheck(obj, type) PyObject_TypeCheck(obj, (PyTypeObject *)type) #if PY_MAJOR_VERSION >= 3 #define PyIntObject PyLongObject #define PyInt_Type PyLong_Type #define PyInt_Check(op) PyLong_Check(op) #define PyInt_CheckExact(op) PyLong_CheckExact(op) #define PyInt_FromString PyLong_FromString #define PyInt_FromUnicode PyLong_FromUnicode #define PyInt_FromLong PyLong_FromLong #define PyInt_FromSize_t PyLong_FromSize_t #define PyInt_FromSsize_t PyLong_FromSsize_t #define PyInt_AsLong PyLong_AsLong #define PyInt_AS_LONG PyLong_AS_LONG #define PyInt_AsSsize_t PyLong_AsSsize_t #define PyInt_AsUnsignedLongMask PyLong_AsUnsignedLongMask #define PyInt_AsUnsignedLongLongMask PyLong_AsUnsignedLongLongMask #define PyNumber_Int PyNumber_Long #endif #if PY_MAJOR_VERSION >= 3 #define PyBoolObject PyLongObject #endif #if PY_MAJOR_VERSION >= 3 && CYTHON_COMPILING_IN_PYPY #ifndef PyUnicode_InternFromString #define PyUnicode_InternFromString(s) PyUnicode_FromString(s) #endif #endif #if PY_VERSION_HEX < 0x030200A4 typedef long Py_hash_t; #define __Pyx_PyInt_FromHash_t PyInt_FromLong #define __Pyx_PyInt_AsHash_t PyInt_AsLong #else #define __Pyx_PyInt_FromHash_t PyInt_FromSsize_t #define __Pyx_PyInt_AsHash_t PyInt_AsSsize_t #endif #if PY_MAJOR_VERSION >= 3 #define __Pyx_PyMethod_New(func, self, klass) ((self) ? PyMethod_New(func, self) : PyInstanceMethod_New(func)) #else #define __Pyx_PyMethod_New(func, self, klass) PyMethod_New(func, self, klass) #endif #if PY_VERSION_HEX >= 0x030500B1 #define __Pyx_PyAsyncMethodsStruct PyAsyncMethods #define __Pyx_PyType_AsAsync(obj) (Py_TYPE(obj)->tp_as_async) #elif CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3 typedef struct { unaryfunc am_await; unaryfunc am_aiter; unaryfunc am_anext; } __Pyx_PyAsyncMethodsStruct; #define __Pyx_PyType_AsAsync(obj) ((__Pyx_PyAsyncMethodsStruct*) (Py_TYPE(obj)->tp_reserved)) #else #define __Pyx_PyType_AsAsync(obj) NULL #endif #ifndef CYTHON_RESTRICT #if defined(__GNUC__) #define CYTHON_RESTRICT __restrict__ #elif defined(_MSC_VER) && _MSC_VER >= 1400 #define CYTHON_RESTRICT __restrict #elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L #define CYTHON_RESTRICT restrict #else #define CYTHON_RESTRICT #endif #endif #define __Pyx_void_to_None(void_result) ((void)(void_result), Py_INCREF(Py_None), Py_None) #ifndef CYTHON_INLINE #if defined(__GNUC__) #define CYTHON_INLINE __inline__ #elif defined(_MSC_VER) #define CYTHON_INLINE __inline #elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L #define CYTHON_INLINE inline #else #define CYTHON_INLINE #endif #endif #if defined(WIN32) || defined(MS_WINDOWS) #define _USE_MATH_DEFINES #endif #include #ifdef NAN #define __PYX_NAN() ((float) NAN) #else static CYTHON_INLINE float __PYX_NAN() { float value; memset(&value, 0xFF, sizeof(value)); return value; } #endif #if PY_MAJOR_VERSION >= 3 #define __Pyx_PyNumber_Divide(x,y) PyNumber_TrueDivide(x,y) #define __Pyx_PyNumber_InPlaceDivide(x,y) PyNumber_InPlaceTrueDivide(x,y) #else #define __Pyx_PyNumber_Divide(x,y) PyNumber_Divide(x,y) #define __Pyx_PyNumber_InPlaceDivide(x,y) PyNumber_InPlaceDivide(x,y) #endif #ifndef __PYX_EXTERN_C #ifdef __cplusplus #define __PYX_EXTERN_C extern "C" #else #define __PYX_EXTERN_C extern #endif #endif #define __PYX_HAVE__pygame_sdl2__scrap #define __PYX_HAVE_API__pygame_sdl2__scrap #include "stdint.h" #include "string.h" #include "stdio.h" #include "stddef.h" #include "SDL.h" #ifdef _OPENMP #include #endif /* _OPENMP */ #ifdef PYREX_WITHOUT_ASSERTIONS #define CYTHON_WITHOUT_ASSERTIONS #endif #ifndef CYTHON_UNUSED # if defined(__GNUC__) # if !(defined(__cplusplus)) || (__GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 4)) # define CYTHON_UNUSED __attribute__ ((__unused__)) # else # define CYTHON_UNUSED # endif # elif defined(__ICC) || (defined(__INTEL_COMPILER) && !defined(_MSC_VER)) # define CYTHON_UNUSED __attribute__ ((__unused__)) # else # define CYTHON_UNUSED # endif #endif #ifndef CYTHON_NCP_UNUSED # if CYTHON_COMPILING_IN_CPYTHON # define CYTHON_NCP_UNUSED # else # define CYTHON_NCP_UNUSED CYTHON_UNUSED # endif #endif typedef struct {PyObject **p; char *s; const Py_ssize_t n; const char* encoding; const char is_unicode; const char is_str; const char intern; } __Pyx_StringTabEntry; #define __PYX_DEFAULT_STRING_ENCODING_IS_ASCII 0 #define __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT 0 #define __PYX_DEFAULT_STRING_ENCODING "" #define __Pyx_PyObject_FromString __Pyx_PyBytes_FromString #define __Pyx_PyObject_FromStringAndSize __Pyx_PyBytes_FromStringAndSize #define __Pyx_uchar_cast(c) ((unsigned char)c) #define __Pyx_long_cast(x) ((long)x) #define __Pyx_fits_Py_ssize_t(v, type, is_signed) (\ (sizeof(type) < sizeof(Py_ssize_t)) ||\ (sizeof(type) > sizeof(Py_ssize_t) &&\ likely(v < (type)PY_SSIZE_T_MAX ||\ v == (type)PY_SSIZE_T_MAX) &&\ (!is_signed || likely(v > (type)PY_SSIZE_T_MIN ||\ v == (type)PY_SSIZE_T_MIN))) ||\ (sizeof(type) == sizeof(Py_ssize_t) &&\ (is_signed || likely(v < (type)PY_SSIZE_T_MAX ||\ v == (type)PY_SSIZE_T_MAX))) ) #if defined (__cplusplus) && __cplusplus >= 201103L #include #define __Pyx_sst_abs(value) std::abs(value) #elif SIZEOF_INT >= SIZEOF_SIZE_T #define __Pyx_sst_abs(value) abs(value) #elif SIZEOF_LONG >= SIZEOF_SIZE_T #define __Pyx_sst_abs(value) labs(value) #elif defined (_MSC_VER) && defined (_M_X64) #define __Pyx_sst_abs(value) _abs64(value) #elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L #define __Pyx_sst_abs(value) llabs(value) #elif defined (__GNUC__) #define __Pyx_sst_abs(value) __builtin_llabs(value) #else #define __Pyx_sst_abs(value) ((value<0) ? -value : value) #endif static CYTHON_INLINE char* __Pyx_PyObject_AsString(PyObject*); static CYTHON_INLINE char* __Pyx_PyObject_AsStringAndSize(PyObject*, Py_ssize_t* length); #define __Pyx_PyByteArray_FromString(s) PyByteArray_FromStringAndSize((const char*)s, strlen((const char*)s)) #define __Pyx_PyByteArray_FromStringAndSize(s, l) PyByteArray_FromStringAndSize((const char*)s, l) #define __Pyx_PyBytes_FromString PyBytes_FromString #define __Pyx_PyBytes_FromStringAndSize PyBytes_FromStringAndSize static CYTHON_INLINE PyObject* __Pyx_PyUnicode_FromString(const char*); #if PY_MAJOR_VERSION < 3 #define __Pyx_PyStr_FromString __Pyx_PyBytes_FromString #define __Pyx_PyStr_FromStringAndSize __Pyx_PyBytes_FromStringAndSize #else #define __Pyx_PyStr_FromString __Pyx_PyUnicode_FromString #define __Pyx_PyStr_FromStringAndSize __Pyx_PyUnicode_FromStringAndSize #endif #define __Pyx_PyObject_AsSString(s) ((signed char*) __Pyx_PyObject_AsString(s)) #define __Pyx_PyObject_AsUString(s) ((unsigned char*) __Pyx_PyObject_AsString(s)) #define __Pyx_PyObject_FromCString(s) __Pyx_PyObject_FromString((const char*)s) #define __Pyx_PyBytes_FromCString(s) __Pyx_PyBytes_FromString((const char*)s) #define __Pyx_PyByteArray_FromCString(s) __Pyx_PyByteArray_FromString((const char*)s) #define __Pyx_PyStr_FromCString(s) __Pyx_PyStr_FromString((const char*)s) #define __Pyx_PyUnicode_FromCString(s) __Pyx_PyUnicode_FromString((const char*)s) #if PY_MAJOR_VERSION < 3 static CYTHON_INLINE size_t __Pyx_Py_UNICODE_strlen(const Py_UNICODE *u) { const Py_UNICODE *u_end = u; while (*u_end++) ; return (size_t)(u_end - u - 1); } #else #define __Pyx_Py_UNICODE_strlen Py_UNICODE_strlen #endif #define __Pyx_PyUnicode_FromUnicode(u) PyUnicode_FromUnicode(u, __Pyx_Py_UNICODE_strlen(u)) #define __Pyx_PyUnicode_FromUnicodeAndLength PyUnicode_FromUnicode #define __Pyx_PyUnicode_AsUnicode PyUnicode_AsUnicode #define __Pyx_NewRef(obj) (Py_INCREF(obj), obj) #define __Pyx_Owned_Py_None(b) __Pyx_NewRef(Py_None) #define __Pyx_PyBool_FromLong(b) ((b) ? __Pyx_NewRef(Py_True) : __Pyx_NewRef(Py_False)) static CYTHON_INLINE int __Pyx_PyObject_IsTrue(PyObject*); static CYTHON_INLINE PyObject* __Pyx_PyNumber_Int(PyObject* x); static CYTHON_INLINE Py_ssize_t __Pyx_PyIndex_AsSsize_t(PyObject*); static CYTHON_INLINE PyObject * __Pyx_PyInt_FromSize_t(size_t); #if CYTHON_COMPILING_IN_CPYTHON #define __pyx_PyFloat_AsDouble(x) (PyFloat_CheckExact(x) ? PyFloat_AS_DOUBLE(x) : PyFloat_AsDouble(x)) #else #define __pyx_PyFloat_AsDouble(x) PyFloat_AsDouble(x) #endif #define __pyx_PyFloat_AsFloat(x) ((float) __pyx_PyFloat_AsDouble(x)) #if PY_MAJOR_VERSION < 3 && __PYX_DEFAULT_STRING_ENCODING_IS_ASCII static int __Pyx_sys_getdefaultencoding_not_ascii; static int __Pyx_init_sys_getdefaultencoding_params(void) { PyObject* sys; PyObject* default_encoding = NULL; PyObject* ascii_chars_u = NULL; PyObject* ascii_chars_b = NULL; const char* default_encoding_c; sys = PyImport_ImportModule("sys"); if (!sys) goto bad; default_encoding = PyObject_CallMethod(sys, (char*) "getdefaultencoding", NULL); Py_DECREF(sys); if (!default_encoding) goto bad; default_encoding_c = PyBytes_AsString(default_encoding); if (!default_encoding_c) goto bad; if (strcmp(default_encoding_c, "ascii") == 0) { __Pyx_sys_getdefaultencoding_not_ascii = 0; } else { char ascii_chars[128]; int c; for (c = 0; c < 128; c++) { ascii_chars[c] = c; } __Pyx_sys_getdefaultencoding_not_ascii = 1; ascii_chars_u = PyUnicode_DecodeASCII(ascii_chars, 128, NULL); if (!ascii_chars_u) goto bad; ascii_chars_b = PyUnicode_AsEncodedString(ascii_chars_u, default_encoding_c, NULL); if (!ascii_chars_b || !PyBytes_Check(ascii_chars_b) || memcmp(ascii_chars, PyBytes_AS_STRING(ascii_chars_b), 128) != 0) { PyErr_Format( PyExc_ValueError, "This module compiled with c_string_encoding=ascii, but default encoding '%.200s' is not a superset of ascii.", default_encoding_c); goto bad; } Py_DECREF(ascii_chars_u); Py_DECREF(ascii_chars_b); } Py_DECREF(default_encoding); return 0; bad: Py_XDECREF(default_encoding); Py_XDECREF(ascii_chars_u); Py_XDECREF(ascii_chars_b); return -1; } #endif #if __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT && PY_MAJOR_VERSION >= 3 #define __Pyx_PyUnicode_FromStringAndSize(c_str, size) PyUnicode_DecodeUTF8(c_str, size, NULL) #else #define __Pyx_PyUnicode_FromStringAndSize(c_str, size) PyUnicode_Decode(c_str, size, __PYX_DEFAULT_STRING_ENCODING, NULL) #if __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT static char* __PYX_DEFAULT_STRING_ENCODING; static int __Pyx_init_sys_getdefaultencoding_params(void) { PyObject* sys; PyObject* default_encoding = NULL; char* default_encoding_c; sys = PyImport_ImportModule("sys"); if (!sys) goto bad; default_encoding = PyObject_CallMethod(sys, (char*) (const char*) "getdefaultencoding", NULL); Py_DECREF(sys); if (!default_encoding) goto bad; default_encoding_c = PyBytes_AsString(default_encoding); if (!default_encoding_c) goto bad; __PYX_DEFAULT_STRING_ENCODING = (char*) malloc(strlen(default_encoding_c)); if (!__PYX_DEFAULT_STRING_ENCODING) goto bad; strcpy(__PYX_DEFAULT_STRING_ENCODING, default_encoding_c); Py_DECREF(default_encoding); return 0; bad: Py_XDECREF(default_encoding); return -1; } #endif #endif /* Test for GCC > 2.95 */ #if defined(__GNUC__) && (__GNUC__ > 2 || (__GNUC__ == 2 && (__GNUC_MINOR__ > 95))) #define likely(x) __builtin_expect(!!(x), 1) #define unlikely(x) __builtin_expect(!!(x), 0) #else /* !__GNUC__ or GCC < 2.95 */ #define likely(x) (x) #define unlikely(x) (x) #endif /* __GNUC__ */ static PyObject *__pyx_m; static PyObject *__pyx_d; static PyObject *__pyx_b; static PyObject *__pyx_empty_tuple; static PyObject *__pyx_empty_bytes; static int __pyx_lineno; static int __pyx_clineno = 0; static const char * __pyx_cfilenm= __FILE__; static const char *__pyx_filename; static const char *__pyx_f[] = { "src/pygame_sdl2/scrap.pyx", }; /*--- Type declarations ---*/ /* --- Runtime support code (head) --- */ #ifndef CYTHON_REFNANNY #define CYTHON_REFNANNY 0 #endif #if CYTHON_REFNANNY typedef struct { void (*INCREF)(void*, PyObject*, int); void (*DECREF)(void*, PyObject*, int); void (*GOTREF)(void*, PyObject*, int); void (*GIVEREF)(void*, PyObject*, int); void* (*SetupContext)(const char*, int, const char*); void (*FinishContext)(void**); } __Pyx_RefNannyAPIStruct; static __Pyx_RefNannyAPIStruct *__Pyx_RefNanny = NULL; static __Pyx_RefNannyAPIStruct *__Pyx_RefNannyImportAPI(const char *modname); #define __Pyx_RefNannyDeclarations void *__pyx_refnanny = NULL; #ifdef WITH_THREAD #define __Pyx_RefNannySetupContext(name, acquire_gil)\ if (acquire_gil) {\ PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure();\ __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), __LINE__, __FILE__);\ PyGILState_Release(__pyx_gilstate_save);\ } else {\ __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), __LINE__, __FILE__);\ } #else #define __Pyx_RefNannySetupContext(name, acquire_gil)\ __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), __LINE__, __FILE__) #endif #define __Pyx_RefNannyFinishContext()\ __Pyx_RefNanny->FinishContext(&__pyx_refnanny) #define __Pyx_INCREF(r) __Pyx_RefNanny->INCREF(__pyx_refnanny, (PyObject *)(r), __LINE__) #define __Pyx_DECREF(r) __Pyx_RefNanny->DECREF(__pyx_refnanny, (PyObject *)(r), __LINE__) #define __Pyx_GOTREF(r) __Pyx_RefNanny->GOTREF(__pyx_refnanny, (PyObject *)(r), __LINE__) #define __Pyx_GIVEREF(r) __Pyx_RefNanny->GIVEREF(__pyx_refnanny, (PyObject *)(r), __LINE__) #define __Pyx_XINCREF(r) do { if((r) != NULL) {__Pyx_INCREF(r); }} while(0) #define __Pyx_XDECREF(r) do { if((r) != NULL) {__Pyx_DECREF(r); }} while(0) #define __Pyx_XGOTREF(r) do { if((r) != NULL) {__Pyx_GOTREF(r); }} while(0) #define __Pyx_XGIVEREF(r) do { if((r) != NULL) {__Pyx_GIVEREF(r);}} while(0) #else #define __Pyx_RefNannyDeclarations #define __Pyx_RefNannySetupContext(name, acquire_gil) #define __Pyx_RefNannyFinishContext() #define __Pyx_INCREF(r) Py_INCREF(r) #define __Pyx_DECREF(r) Py_DECREF(r) #define __Pyx_GOTREF(r) #define __Pyx_GIVEREF(r) #define __Pyx_XINCREF(r) Py_XINCREF(r) #define __Pyx_XDECREF(r) Py_XDECREF(r) #define __Pyx_XGOTREF(r) #define __Pyx_XGIVEREF(r) #endif #define __Pyx_XDECREF_SET(r, v) do {\ PyObject *tmp = (PyObject *) r;\ r = v; __Pyx_XDECREF(tmp);\ } while (0) #define __Pyx_DECREF_SET(r, v) do {\ PyObject *tmp = (PyObject *) r;\ r = v; __Pyx_DECREF(tmp);\ } while (0) #define __Pyx_CLEAR(r) do { PyObject* tmp = ((PyObject*)(r)); r = NULL; __Pyx_DECREF(tmp);} while(0) #define __Pyx_XCLEAR(r) do { if((r) != NULL) {PyObject* tmp = ((PyObject*)(r)); r = NULL; __Pyx_DECREF(tmp);}} while(0) #if CYTHON_COMPILING_IN_CPYTHON static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStr(PyObject* obj, PyObject* attr_name) { PyTypeObject* tp = Py_TYPE(obj); if (likely(tp->tp_getattro)) return tp->tp_getattro(obj, attr_name); #if PY_MAJOR_VERSION < 3 if (likely(tp->tp_getattr)) return tp->tp_getattr(obj, PyString_AS_STRING(attr_name)); #endif return PyObject_GetAttr(obj, attr_name); } #else #define __Pyx_PyObject_GetAttrStr(o,n) PyObject_GetAttr(o,n) #endif static PyObject *__Pyx_GetBuiltinName(PyObject *name); static CYTHON_INLINE PyObject *__Pyx_GetModuleGlobalName(PyObject *name); #if CYTHON_COMPILING_IN_CPYTHON static CYTHON_INLINE PyObject* __Pyx_PyObject_Call(PyObject *func, PyObject *arg, PyObject *kw); #else #define __Pyx_PyObject_Call(func, arg, kw) PyObject_Call(func, arg, kw) #endif #if CYTHON_COMPILING_IN_CPYTHON static CYTHON_INLINE PyObject* __Pyx_PyObject_CallMethO(PyObject *func, PyObject *arg); #endif static CYTHON_INLINE PyObject* __Pyx_PyObject_CallOneArg(PyObject *func, PyObject *arg); #if CYTHON_COMPILING_IN_CPYTHON static CYTHON_INLINE PyObject* __Pyx_PyObject_CallNoArg(PyObject *func); #else #define __Pyx_PyObject_CallNoArg(func) __Pyx_PyObject_Call(func, __pyx_empty_tuple, NULL) #endif static CYTHON_INLINE void __Pyx_ErrRestore(PyObject *type, PyObject *value, PyObject *tb); static CYTHON_INLINE void __Pyx_ErrFetch(PyObject **type, PyObject **value, PyObject **tb); static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, PyObject *cause); static void __Pyx_RaiseArgtupleInvalid(const char* func_name, int exact, Py_ssize_t num_min, Py_ssize_t num_max, Py_ssize_t num_found); static void __Pyx_RaiseDoubleKeywordsError(const char* func_name, PyObject* kw_name); static int __Pyx_ParseOptionalKeywords(PyObject *kwds, PyObject **argnames[],\ PyObject *kwds2, PyObject *values[], Py_ssize_t num_pos_args,\ const char* function_name); static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list, int level); static PyObject* __Pyx_ImportFrom(PyObject* module, PyObject* name); typedef struct { int code_line; PyCodeObject* code_object; } __Pyx_CodeObjectCacheEntry; struct __Pyx_CodeObjectCache { int count; int max_count; __Pyx_CodeObjectCacheEntry* entries; }; static struct __Pyx_CodeObjectCache __pyx_code_cache = {0,0,NULL}; static int __pyx_bisect_code_objects(__Pyx_CodeObjectCacheEntry* entries, int count, int code_line); static PyCodeObject *__pyx_find_code_object(int code_line); static void __pyx_insert_code_object(int code_line, PyCodeObject* code_object); static void __Pyx_AddTraceback(const char *funcname, int c_line, int py_line, const char *filename); static CYTHON_INLINE PyObject* __Pyx_PyInt_From_long(long value); static CYTHON_INLINE long __Pyx_PyInt_As_long(PyObject *); static CYTHON_INLINE int __Pyx_PyInt_As_int(PyObject *); static int __Pyx_check_binary_version(void); static int __Pyx_InitStrings(__Pyx_StringTabEntry *t); /* Module declarations from 'libc.stdint' */ /* Module declarations from 'libc.string' */ /* Module declarations from 'libc.stdio' */ /* Module declarations from 'libc.stddef' */ /* Module declarations from 'sdl2' */ /* Module declarations from 'pygame_sdl2.scrap' */ #define __Pyx_MODULE_NAME "pygame_sdl2.scrap" int __pyx_module_is_main_pygame_sdl2__scrap = 0; /* Implementation of 'pygame_sdl2.scrap' */ static char __pyx_k_rv[] = "rv"; static char __pyx_k_get[] = "get"; static char __pyx_k_put[] = "put"; static char __pyx_k_data[] = "data"; static char __pyx_k_init[] = "init"; static char __pyx_k_lost[] = "lost"; static char __pyx_k_main[] = "__main__"; static char __pyx_k_mode[] = "mode"; static char __pyx_k_test[] = "__test__"; static char __pyx_k_text[] = "text"; static char __pyx_k_type[] = "type"; static char __pyx_k_bytes[] = "bytes_"; static char __pyx_k_error[] = "error"; static char __pyx_k_import[] = "__import__"; static char __pyx_k_contains[] = "contains"; static char __pyx_k_set_mode[] = "set_mode"; static char __pyx_k_get_types[] = "get_types"; static char __pyx_k_SCRAP_TEXT[] = "SCRAP_TEXT"; static char __pyx_k_Not_implemented[] = "Not implemented."; static char __pyx_k_pygame_sdl2_error[] = "pygame_sdl2.error"; static char __pyx_k_pygame_sdl2_scrap[] = "pygame_sdl2.scrap"; static char __pyx_k_pygame_sdl2_compat[] = "pygame_sdl2.compat"; static char __pyx_k_pygame_sdl2_locals[] = "pygame_sdl2.locals"; static char __pyx_k_home_tom_ab_pygame_sdl2_src_pyg[] = "/home/tom/ab/pygame_sdl2/src/pygame_sdl2/scrap.pyx"; static PyObject *__pyx_kp_s_Not_implemented; static PyObject *__pyx_n_s_SCRAP_TEXT; static PyObject *__pyx_n_s_bytes; static PyObject *__pyx_n_s_contains; static PyObject *__pyx_n_s_data; static PyObject *__pyx_n_s_error; static PyObject *__pyx_n_s_get; static PyObject *__pyx_n_s_get_types; static PyObject *__pyx_kp_s_home_tom_ab_pygame_sdl2_src_pyg; static PyObject *__pyx_n_s_import; static PyObject *__pyx_n_s_init; static PyObject *__pyx_n_s_lost; static PyObject *__pyx_n_s_main; static PyObject *__pyx_n_s_mode; static PyObject *__pyx_n_s_put; static PyObject *__pyx_n_s_pygame_sdl2_compat; static PyObject *__pyx_n_s_pygame_sdl2_error; static PyObject *__pyx_n_s_pygame_sdl2_locals; static PyObject *__pyx_n_s_pygame_sdl2_scrap; static PyObject *__pyx_n_s_rv; static PyObject *__pyx_n_s_set_mode; static PyObject *__pyx_n_s_test; static PyObject *__pyx_n_s_text; static PyObject *__pyx_n_s_type; static PyObject *__pyx_pf_11pygame_sdl2_5scrap_init(CYTHON_UNUSED PyObject *__pyx_self); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_5scrap_2get(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_type); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_5scrap_4get_types(CYTHON_UNUSED PyObject *__pyx_self); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_5scrap_6put(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_type, PyObject *__pyx_v_data); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_5scrap_8contains(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_type); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_5scrap_10lost(CYTHON_UNUSED PyObject *__pyx_self); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_5scrap_12set_mode(CYTHON_UNUSED PyObject *__pyx_self, CYTHON_UNUSED PyObject *__pyx_v_mode); /* proto */ static PyObject *__pyx_tuple_; static PyObject *__pyx_tuple__2; static PyObject *__pyx_tuple__4; static PyObject *__pyx_tuple__7; static PyObject *__pyx_tuple__9; static PyObject *__pyx_tuple__12; static PyObject *__pyx_codeobj__3; static PyObject *__pyx_codeobj__5; static PyObject *__pyx_codeobj__6; static PyObject *__pyx_codeobj__8; static PyObject *__pyx_codeobj__10; static PyObject *__pyx_codeobj__11; static PyObject *__pyx_codeobj__13; /* "pygame_sdl2/scrap.pyx":26 * from pygame_sdl2.compat import bytes_ * * def init(): # <<<<<<<<<<<<<< * pass * */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_5scrap_1init(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused); /*proto*/ static PyMethodDef __pyx_mdef_11pygame_sdl2_5scrap_1init = {"init", (PyCFunction)__pyx_pw_11pygame_sdl2_5scrap_1init, METH_NOARGS, 0}; static PyObject *__pyx_pw_11pygame_sdl2_5scrap_1init(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("init (wrapper)", 0); __pyx_r = __pyx_pf_11pygame_sdl2_5scrap_init(__pyx_self); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_5scrap_init(CYTHON_UNUSED PyObject *__pyx_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("init", 0); /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/scrap.pyx":29 * pass * * def get(type): # <<<<<<<<<<<<<< * cdef char *text = NULL * if type == SCRAP_TEXT: */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_5scrap_3get(PyObject *__pyx_self, PyObject *__pyx_v_type); /*proto*/ static PyMethodDef __pyx_mdef_11pygame_sdl2_5scrap_3get = {"get", (PyCFunction)__pyx_pw_11pygame_sdl2_5scrap_3get, METH_O, 0}; static PyObject *__pyx_pw_11pygame_sdl2_5scrap_3get(PyObject *__pyx_self, PyObject *__pyx_v_type) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("get (wrapper)", 0); __pyx_r = __pyx_pf_11pygame_sdl2_5scrap_2get(__pyx_self, ((PyObject *)__pyx_v_type)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_5scrap_2get(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_type) { char *__pyx_v_text; PyObject *__pyx_v_rv = NULL; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; int __pyx_t_3; PyObject *__pyx_t_4 = NULL; PyObject *__pyx_t_5 = NULL; PyObject *__pyx_t_6 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("get", 0); /* "pygame_sdl2/scrap.pyx":30 * * def get(type): * cdef char *text = NULL # <<<<<<<<<<<<<< * if type == SCRAP_TEXT: * text = SDL_GetClipboardText() */ __pyx_v_text = NULL; /* "pygame_sdl2/scrap.pyx":31 * def get(type): * cdef char *text = NULL * if type == SCRAP_TEXT: # <<<<<<<<<<<<<< * text = SDL_GetClipboardText() * if text == NULL: */ __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_SCRAP_TEXT); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 31; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = PyObject_RichCompare(__pyx_v_type, __pyx_t_1, Py_EQ); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 31; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 31; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; if (__pyx_t_3) { /* "pygame_sdl2/scrap.pyx":32 * cdef char *text = NULL * if type == SCRAP_TEXT: * text = SDL_GetClipboardText() # <<<<<<<<<<<<<< * if text == NULL: * raise error() */ __pyx_v_text = SDL_GetClipboardText(); /* "pygame_sdl2/scrap.pyx":33 * if type == SCRAP_TEXT: * text = SDL_GetClipboardText() * if text == NULL: # <<<<<<<<<<<<<< * raise error() * rv = bytes_(text) */ __pyx_t_3 = ((__pyx_v_text == NULL) != 0); if (__pyx_t_3) { /* "pygame_sdl2/scrap.pyx":34 * text = SDL_GetClipboardText() * if text == NULL: * raise error() # <<<<<<<<<<<<<< * rv = bytes_(text) * SDL_free(text) */ __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_error); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 34; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_t_4 = NULL; if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_1))) { __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_1); if (likely(__pyx_t_4)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1); __Pyx_INCREF(__pyx_t_4); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_1, function); } } if (__pyx_t_4) { __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_1, __pyx_t_4); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 34; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; } else { __pyx_t_2 = __Pyx_PyObject_CallNoArg(__pyx_t_1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 34; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_Raise(__pyx_t_2, 0, 0, 0); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; {__pyx_filename = __pyx_f[0]; __pyx_lineno = 34; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "pygame_sdl2/scrap.pyx":33 * if type == SCRAP_TEXT: * text = SDL_GetClipboardText() * if text == NULL: # <<<<<<<<<<<<<< * raise error() * rv = bytes_(text) */ } /* "pygame_sdl2/scrap.pyx":35 * if text == NULL: * raise error() * rv = bytes_(text) # <<<<<<<<<<<<<< * SDL_free(text) * return rv */ __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_bytes); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 35; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_t_4 = __Pyx_PyBytes_FromString(__pyx_v_text); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 35; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); __pyx_t_5 = NULL; if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_1))) { __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_1); if (likely(__pyx_t_5)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1); __Pyx_INCREF(__pyx_t_5); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_1, function); } } if (!__pyx_t_5) { __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_1, __pyx_t_4); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 35; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_GOTREF(__pyx_t_2); } else { __pyx_t_6 = PyTuple_New(1+1); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 35; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_6); __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_5); __pyx_t_5 = NULL; __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_6, 0+1, __pyx_t_4); __pyx_t_4 = 0; __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_6, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 35; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_v_rv = __pyx_t_2; __pyx_t_2 = 0; /* "pygame_sdl2/scrap.pyx":36 * raise error() * rv = bytes_(text) * SDL_free(text) # <<<<<<<<<<<<<< * return rv * else: */ SDL_free(__pyx_v_text); /* "pygame_sdl2/scrap.pyx":37 * rv = bytes_(text) * SDL_free(text) * return rv # <<<<<<<<<<<<<< * else: * raise error("Not implemented.") */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(__pyx_v_rv); __pyx_r = __pyx_v_rv; goto __pyx_L0; /* "pygame_sdl2/scrap.pyx":31 * def get(type): * cdef char *text = NULL * if type == SCRAP_TEXT: # <<<<<<<<<<<<<< * text = SDL_GetClipboardText() * if text == NULL: */ } /* "pygame_sdl2/scrap.pyx":39 * return rv * else: * raise error("Not implemented.") # <<<<<<<<<<<<<< * * def get_types(): */ /*else*/ { __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_error); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 39; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_tuple_, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 39; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_Raise(__pyx_t_1, 0, 0, 0); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; {__pyx_filename = __pyx_f[0]; __pyx_lineno = 39; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } /* "pygame_sdl2/scrap.pyx":29 * pass * * def get(type): # <<<<<<<<<<<<<< * cdef char *text = NULL * if type == SCRAP_TEXT: */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_5); __Pyx_XDECREF(__pyx_t_6); __Pyx_AddTraceback("pygame_sdl2.scrap.get", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF(__pyx_v_rv); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/scrap.pyx":41 * raise error("Not implemented.") * * def get_types(): # <<<<<<<<<<<<<< * return [SCRAP_TEXT] * */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_5scrap_5get_types(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused); /*proto*/ static PyMethodDef __pyx_mdef_11pygame_sdl2_5scrap_5get_types = {"get_types", (PyCFunction)__pyx_pw_11pygame_sdl2_5scrap_5get_types, METH_NOARGS, 0}; static PyObject *__pyx_pw_11pygame_sdl2_5scrap_5get_types(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("get_types (wrapper)", 0); __pyx_r = __pyx_pf_11pygame_sdl2_5scrap_4get_types(__pyx_self); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_5scrap_4get_types(CYTHON_UNUSED PyObject *__pyx_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("get_types", 0); /* "pygame_sdl2/scrap.pyx":42 * * def get_types(): * return [SCRAP_TEXT] # <<<<<<<<<<<<<< * * def put(type, data): */ __Pyx_XDECREF(__pyx_r); __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_SCRAP_TEXT); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 42; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = PyList_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 42; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __Pyx_GIVEREF(__pyx_t_1); PyList_SET_ITEM(__pyx_t_2, 0, __pyx_t_1); __pyx_t_1 = 0; __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; /* "pygame_sdl2/scrap.pyx":41 * raise error("Not implemented.") * * def get_types(): # <<<<<<<<<<<<<< * return [SCRAP_TEXT] * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_AddTraceback("pygame_sdl2.scrap.get_types", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/scrap.pyx":44 * return [SCRAP_TEXT] * * def put(type, data): # <<<<<<<<<<<<<< * if type != SCRAP_TEXT: * raise error("Not implemented.") */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_5scrap_7put(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static PyMethodDef __pyx_mdef_11pygame_sdl2_5scrap_7put = {"put", (PyCFunction)__pyx_pw_11pygame_sdl2_5scrap_7put, METH_VARARGS|METH_KEYWORDS, 0}; static PyObject *__pyx_pw_11pygame_sdl2_5scrap_7put(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_type = 0; PyObject *__pyx_v_data = 0; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("put (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_type,&__pyx_n_s_data,0}; PyObject* values[2] = {0,0}; if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_type)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; case 1: if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_data)) != 0)) kw_args--; else { __Pyx_RaiseArgtupleInvalid("put", 1, 2, 2, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 44; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "put") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 44; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } } else if (PyTuple_GET_SIZE(__pyx_args) != 2) { goto __pyx_L5_argtuple_error; } else { values[0] = PyTuple_GET_ITEM(__pyx_args, 0); values[1] = PyTuple_GET_ITEM(__pyx_args, 1); } __pyx_v_type = values[0]; __pyx_v_data = values[1]; } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("put", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 44; __pyx_clineno = __LINE__; goto __pyx_L3_error;} __pyx_L3_error:; __Pyx_AddTraceback("pygame_sdl2.scrap.put", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_11pygame_sdl2_5scrap_6put(__pyx_self, __pyx_v_type, __pyx_v_data); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_5scrap_6put(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_type, PyObject *__pyx_v_data) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; int __pyx_t_3; PyObject *__pyx_t_4 = NULL; PyObject *__pyx_t_5 = NULL; char const *__pyx_t_6; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("put", 0); __Pyx_INCREF(__pyx_v_data); /* "pygame_sdl2/scrap.pyx":45 * * def put(type, data): * if type != SCRAP_TEXT: # <<<<<<<<<<<<<< * raise error("Not implemented.") * */ __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_SCRAP_TEXT); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 45; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = PyObject_RichCompare(__pyx_v_type, __pyx_t_1, Py_NE); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 45; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 45; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; if (__pyx_t_3) { /* "pygame_sdl2/scrap.pyx":46 * def put(type, data): * if type != SCRAP_TEXT: * raise error("Not implemented.") # <<<<<<<<<<<<<< * * data = bytes_(data) */ __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_error); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 46; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_tuple__2, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 46; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_Raise(__pyx_t_1, 0, 0, 0); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; {__pyx_filename = __pyx_f[0]; __pyx_lineno = 46; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "pygame_sdl2/scrap.pyx":45 * * def put(type, data): * if type != SCRAP_TEXT: # <<<<<<<<<<<<<< * raise error("Not implemented.") * */ } /* "pygame_sdl2/scrap.pyx":48 * raise error("Not implemented.") * * data = bytes_(data) # <<<<<<<<<<<<<< * * if SDL_SetClipboardText(data) != 0: */ __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_bytes); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 48; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __pyx_t_4 = NULL; if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_2))) { __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_2); if (likely(__pyx_t_4)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_4); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); } } if (!__pyx_t_4) { __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_v_data); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 48; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); } else { __pyx_t_5 = PyTuple_New(1+1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 48; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_4); __pyx_t_4 = NULL; __Pyx_INCREF(__pyx_v_data); __Pyx_GIVEREF(__pyx_v_data); PyTuple_SET_ITEM(__pyx_t_5, 0+1, __pyx_v_data); __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_5, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 48; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; } __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF_SET(__pyx_v_data, __pyx_t_1); __pyx_t_1 = 0; /* "pygame_sdl2/scrap.pyx":50 * data = bytes_(data) * * if SDL_SetClipboardText(data) != 0: # <<<<<<<<<<<<<< * raise error() * */ __pyx_t_6 = __Pyx_PyObject_AsString(__pyx_v_data); if (unlikely((!__pyx_t_6) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 50; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_t_3 = ((SDL_SetClipboardText(__pyx_t_6) != 0) != 0); if (__pyx_t_3) { /* "pygame_sdl2/scrap.pyx":51 * * if SDL_SetClipboardText(data) != 0: * raise error() # <<<<<<<<<<<<<< * * def contains(type): */ __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_error); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 51; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __pyx_t_5 = NULL; if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_2))) { __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_2); if (likely(__pyx_t_5)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_5); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); } } if (__pyx_t_5) { __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_5); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 51; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; } else { __pyx_t_1 = __Pyx_PyObject_CallNoArg(__pyx_t_2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 51; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_Raise(__pyx_t_1, 0, 0, 0); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; {__pyx_filename = __pyx_f[0]; __pyx_lineno = 51; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "pygame_sdl2/scrap.pyx":50 * data = bytes_(data) * * if SDL_SetClipboardText(data) != 0: # <<<<<<<<<<<<<< * raise error() * */ } /* "pygame_sdl2/scrap.pyx":44 * return [SCRAP_TEXT] * * def put(type, data): # <<<<<<<<<<<<<< * if type != SCRAP_TEXT: * raise error("Not implemented.") */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_5); __Pyx_AddTraceback("pygame_sdl2.scrap.put", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF(__pyx_v_data); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/scrap.pyx":53 * raise error() * * def contains(type): # <<<<<<<<<<<<<< * if type != SCRAP_TEXT: * return False */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_5scrap_9contains(PyObject *__pyx_self, PyObject *__pyx_v_type); /*proto*/ static PyMethodDef __pyx_mdef_11pygame_sdl2_5scrap_9contains = {"contains", (PyCFunction)__pyx_pw_11pygame_sdl2_5scrap_9contains, METH_O, 0}; static PyObject *__pyx_pw_11pygame_sdl2_5scrap_9contains(PyObject *__pyx_self, PyObject *__pyx_v_type) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("contains (wrapper)", 0); __pyx_r = __pyx_pf_11pygame_sdl2_5scrap_8contains(__pyx_self, ((PyObject *)__pyx_v_type)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_5scrap_8contains(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_type) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; int __pyx_t_3; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("contains", 0); /* "pygame_sdl2/scrap.pyx":54 * * def contains(type): * if type != SCRAP_TEXT: # <<<<<<<<<<<<<< * return False * */ __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_SCRAP_TEXT); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 54; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = PyObject_RichCompare(__pyx_v_type, __pyx_t_1, Py_NE); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 54; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 54; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; if (__pyx_t_3) { /* "pygame_sdl2/scrap.pyx":55 * def contains(type): * if type != SCRAP_TEXT: * return False # <<<<<<<<<<<<<< * * return SDL_HasClipboardText() == SDL_TRUE */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(Py_False); __pyx_r = Py_False; goto __pyx_L0; /* "pygame_sdl2/scrap.pyx":54 * * def contains(type): * if type != SCRAP_TEXT: # <<<<<<<<<<<<<< * return False * */ } /* "pygame_sdl2/scrap.pyx":57 * return False * * return SDL_HasClipboardText() == SDL_TRUE # <<<<<<<<<<<<<< * * def lost(): */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __Pyx_PyBool_FromLong((SDL_HasClipboardText() == SDL_TRUE)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 57; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; /* "pygame_sdl2/scrap.pyx":53 * raise error() * * def contains(type): # <<<<<<<<<<<<<< * if type != SCRAP_TEXT: * return False */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_AddTraceback("pygame_sdl2.scrap.contains", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/scrap.pyx":59 * return SDL_HasClipboardText() == SDL_TRUE * * def lost(): # <<<<<<<<<<<<<< * return False * */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_5scrap_11lost(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused); /*proto*/ static PyMethodDef __pyx_mdef_11pygame_sdl2_5scrap_11lost = {"lost", (PyCFunction)__pyx_pw_11pygame_sdl2_5scrap_11lost, METH_NOARGS, 0}; static PyObject *__pyx_pw_11pygame_sdl2_5scrap_11lost(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("lost (wrapper)", 0); __pyx_r = __pyx_pf_11pygame_sdl2_5scrap_10lost(__pyx_self); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_5scrap_10lost(CYTHON_UNUSED PyObject *__pyx_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("lost", 0); /* "pygame_sdl2/scrap.pyx":60 * * def lost(): * return False # <<<<<<<<<<<<<< * * def set_mode(mode): */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(Py_False); __pyx_r = Py_False; goto __pyx_L0; /* "pygame_sdl2/scrap.pyx":59 * return SDL_HasClipboardText() == SDL_TRUE * * def lost(): # <<<<<<<<<<<<<< * return False * */ /* function exit code */ __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/scrap.pyx":62 * return False * * def set_mode(mode): # <<<<<<<<<<<<<< * pass */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_5scrap_13set_mode(PyObject *__pyx_self, PyObject *__pyx_v_mode); /*proto*/ static PyMethodDef __pyx_mdef_11pygame_sdl2_5scrap_13set_mode = {"set_mode", (PyCFunction)__pyx_pw_11pygame_sdl2_5scrap_13set_mode, METH_O, 0}; static PyObject *__pyx_pw_11pygame_sdl2_5scrap_13set_mode(PyObject *__pyx_self, PyObject *__pyx_v_mode) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("set_mode (wrapper)", 0); __pyx_r = __pyx_pf_11pygame_sdl2_5scrap_12set_mode(__pyx_self, ((PyObject *)__pyx_v_mode)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_5scrap_12set_mode(CYTHON_UNUSED PyObject *__pyx_self, CYTHON_UNUSED PyObject *__pyx_v_mode) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("set_mode", 0); /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyMethodDef __pyx_methods[] = { {0, 0, 0, 0} }; #if PY_MAJOR_VERSION >= 3 static struct PyModuleDef __pyx_moduledef = { #if PY_VERSION_HEX < 0x03020000 { PyObject_HEAD_INIT(NULL) NULL, 0, NULL }, #else PyModuleDef_HEAD_INIT, #endif "scrap", 0, /* m_doc */ -1, /* m_size */ __pyx_methods /* m_methods */, NULL, /* m_reload */ NULL, /* m_traverse */ NULL, /* m_clear */ NULL /* m_free */ }; #endif static __Pyx_StringTabEntry __pyx_string_tab[] = { {&__pyx_kp_s_Not_implemented, __pyx_k_Not_implemented, sizeof(__pyx_k_Not_implemented), 0, 0, 1, 0}, {&__pyx_n_s_SCRAP_TEXT, __pyx_k_SCRAP_TEXT, sizeof(__pyx_k_SCRAP_TEXT), 0, 0, 1, 1}, {&__pyx_n_s_bytes, __pyx_k_bytes, sizeof(__pyx_k_bytes), 0, 0, 1, 1}, {&__pyx_n_s_contains, __pyx_k_contains, sizeof(__pyx_k_contains), 0, 0, 1, 1}, {&__pyx_n_s_data, __pyx_k_data, sizeof(__pyx_k_data), 0, 0, 1, 1}, {&__pyx_n_s_error, __pyx_k_error, sizeof(__pyx_k_error), 0, 0, 1, 1}, {&__pyx_n_s_get, __pyx_k_get, sizeof(__pyx_k_get), 0, 0, 1, 1}, {&__pyx_n_s_get_types, __pyx_k_get_types, sizeof(__pyx_k_get_types), 0, 0, 1, 1}, {&__pyx_kp_s_home_tom_ab_pygame_sdl2_src_pyg, __pyx_k_home_tom_ab_pygame_sdl2_src_pyg, sizeof(__pyx_k_home_tom_ab_pygame_sdl2_src_pyg), 0, 0, 1, 0}, {&__pyx_n_s_import, __pyx_k_import, sizeof(__pyx_k_import), 0, 0, 1, 1}, {&__pyx_n_s_init, __pyx_k_init, sizeof(__pyx_k_init), 0, 0, 1, 1}, {&__pyx_n_s_lost, __pyx_k_lost, sizeof(__pyx_k_lost), 0, 0, 1, 1}, {&__pyx_n_s_main, __pyx_k_main, sizeof(__pyx_k_main), 0, 0, 1, 1}, {&__pyx_n_s_mode, __pyx_k_mode, sizeof(__pyx_k_mode), 0, 0, 1, 1}, {&__pyx_n_s_put, __pyx_k_put, sizeof(__pyx_k_put), 0, 0, 1, 1}, {&__pyx_n_s_pygame_sdl2_compat, __pyx_k_pygame_sdl2_compat, sizeof(__pyx_k_pygame_sdl2_compat), 0, 0, 1, 1}, {&__pyx_n_s_pygame_sdl2_error, __pyx_k_pygame_sdl2_error, sizeof(__pyx_k_pygame_sdl2_error), 0, 0, 1, 1}, {&__pyx_n_s_pygame_sdl2_locals, __pyx_k_pygame_sdl2_locals, sizeof(__pyx_k_pygame_sdl2_locals), 0, 0, 1, 1}, {&__pyx_n_s_pygame_sdl2_scrap, __pyx_k_pygame_sdl2_scrap, sizeof(__pyx_k_pygame_sdl2_scrap), 0, 0, 1, 1}, {&__pyx_n_s_rv, __pyx_k_rv, sizeof(__pyx_k_rv), 0, 0, 1, 1}, {&__pyx_n_s_set_mode, __pyx_k_set_mode, sizeof(__pyx_k_set_mode), 0, 0, 1, 1}, {&__pyx_n_s_test, __pyx_k_test, sizeof(__pyx_k_test), 0, 0, 1, 1}, {&__pyx_n_s_text, __pyx_k_text, sizeof(__pyx_k_text), 0, 0, 1, 1}, {&__pyx_n_s_type, __pyx_k_type, sizeof(__pyx_k_type), 0, 0, 1, 1}, {0, 0, 0, 0, 0, 0, 0} }; static int __Pyx_InitCachedBuiltins(void) { return 0; } static int __Pyx_InitCachedConstants(void) { __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__Pyx_InitCachedConstants", 0); /* "pygame_sdl2/scrap.pyx":39 * return rv * else: * raise error("Not implemented.") # <<<<<<<<<<<<<< * * def get_types(): */ __pyx_tuple_ = PyTuple_Pack(1, __pyx_kp_s_Not_implemented); if (unlikely(!__pyx_tuple_)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 39; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_tuple_); __Pyx_GIVEREF(__pyx_tuple_); /* "pygame_sdl2/scrap.pyx":46 * def put(type, data): * if type != SCRAP_TEXT: * raise error("Not implemented.") # <<<<<<<<<<<<<< * * data = bytes_(data) */ __pyx_tuple__2 = PyTuple_Pack(1, __pyx_kp_s_Not_implemented); if (unlikely(!__pyx_tuple__2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 46; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_tuple__2); __Pyx_GIVEREF(__pyx_tuple__2); /* "pygame_sdl2/scrap.pyx":26 * from pygame_sdl2.compat import bytes_ * * def init(): # <<<<<<<<<<<<<< * pass * */ __pyx_codeobj__3 = (PyObject*)__Pyx_PyCode_New(0, 0, 0, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_tom_ab_pygame_sdl2_src_pyg, __pyx_n_s_init, 26, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 26; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "pygame_sdl2/scrap.pyx":29 * pass * * def get(type): # <<<<<<<<<<<<<< * cdef char *text = NULL * if type == SCRAP_TEXT: */ __pyx_tuple__4 = PyTuple_Pack(3, __pyx_n_s_type, __pyx_n_s_text, __pyx_n_s_rv); if (unlikely(!__pyx_tuple__4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 29; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_tuple__4); __Pyx_GIVEREF(__pyx_tuple__4); __pyx_codeobj__5 = (PyObject*)__Pyx_PyCode_New(1, 0, 3, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__4, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_tom_ab_pygame_sdl2_src_pyg, __pyx_n_s_get, 29, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 29; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "pygame_sdl2/scrap.pyx":41 * raise error("Not implemented.") * * def get_types(): # <<<<<<<<<<<<<< * return [SCRAP_TEXT] * */ __pyx_codeobj__6 = (PyObject*)__Pyx_PyCode_New(0, 0, 0, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_tom_ab_pygame_sdl2_src_pyg, __pyx_n_s_get_types, 41, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 41; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "pygame_sdl2/scrap.pyx":44 * return [SCRAP_TEXT] * * def put(type, data): # <<<<<<<<<<<<<< * if type != SCRAP_TEXT: * raise error("Not implemented.") */ __pyx_tuple__7 = PyTuple_Pack(2, __pyx_n_s_type, __pyx_n_s_data); if (unlikely(!__pyx_tuple__7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 44; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_tuple__7); __Pyx_GIVEREF(__pyx_tuple__7); __pyx_codeobj__8 = (PyObject*)__Pyx_PyCode_New(2, 0, 2, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__7, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_tom_ab_pygame_sdl2_src_pyg, __pyx_n_s_put, 44, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 44; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "pygame_sdl2/scrap.pyx":53 * raise error() * * def contains(type): # <<<<<<<<<<<<<< * if type != SCRAP_TEXT: * return False */ __pyx_tuple__9 = PyTuple_Pack(1, __pyx_n_s_type); if (unlikely(!__pyx_tuple__9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 53; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_tuple__9); __Pyx_GIVEREF(__pyx_tuple__9); __pyx_codeobj__10 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__9, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_tom_ab_pygame_sdl2_src_pyg, __pyx_n_s_contains, 53, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 53; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "pygame_sdl2/scrap.pyx":59 * return SDL_HasClipboardText() == SDL_TRUE * * def lost(): # <<<<<<<<<<<<<< * return False * */ __pyx_codeobj__11 = (PyObject*)__Pyx_PyCode_New(0, 0, 0, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_tom_ab_pygame_sdl2_src_pyg, __pyx_n_s_lost, 59, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 59; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "pygame_sdl2/scrap.pyx":62 * return False * * def set_mode(mode): # <<<<<<<<<<<<<< * pass */ __pyx_tuple__12 = PyTuple_Pack(1, __pyx_n_s_mode); if (unlikely(!__pyx_tuple__12)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 62; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_tuple__12); __Pyx_GIVEREF(__pyx_tuple__12); __pyx_codeobj__13 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__12, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_tom_ab_pygame_sdl2_src_pyg, __pyx_n_s_set_mode, 62, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__13)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 62; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_RefNannyFinishContext(); return 0; __pyx_L1_error:; __Pyx_RefNannyFinishContext(); return -1; } static int __Pyx_InitGlobals(void) { if (__Pyx_InitStrings(__pyx_string_tab) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; return 0; __pyx_L1_error:; return -1; } #if PY_MAJOR_VERSION < 3 PyMODINIT_FUNC initscrap(void); /*proto*/ PyMODINIT_FUNC initscrap(void) #else PyMODINIT_FUNC PyInit_scrap(void); /*proto*/ PyMODINIT_FUNC PyInit_scrap(void) #endif { PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannyDeclarations #if CYTHON_REFNANNY __Pyx_RefNanny = __Pyx_RefNannyImportAPI("refnanny"); if (!__Pyx_RefNanny) { PyErr_Clear(); __Pyx_RefNanny = __Pyx_RefNannyImportAPI("Cython.Runtime.refnanny"); if (!__Pyx_RefNanny) Py_FatalError("failed to import 'refnanny' module"); } #endif __Pyx_RefNannySetupContext("PyMODINIT_FUNC PyInit_scrap(void)", 0); if (__Pyx_check_binary_version() < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_empty_tuple = PyTuple_New(0); if (unlikely(!__pyx_empty_tuple)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_empty_bytes = PyBytes_FromStringAndSize("", 0); if (unlikely(!__pyx_empty_bytes)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} #ifdef __Pyx_CyFunction_USED if (__pyx_CyFunction_init() < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} #endif #ifdef __Pyx_FusedFunction_USED if (__pyx_FusedFunction_init() < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} #endif #ifdef __Pyx_Coroutine_USED if (__pyx_Coroutine_init() < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} #endif #ifdef __Pyx_Generator_USED if (__pyx_Generator_init() < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} #endif #ifdef __Pyx_StopAsyncIteration_USED if (__pyx_StopAsyncIteration_init() < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} #endif /*--- Library function declarations ---*/ /*--- Threads initialization code ---*/ #if defined(__PYX_FORCE_INIT_THREADS) && __PYX_FORCE_INIT_THREADS #ifdef WITH_THREAD /* Python build with threading support? */ PyEval_InitThreads(); #endif #endif /*--- Module creation code ---*/ #if PY_MAJOR_VERSION < 3 __pyx_m = Py_InitModule4("scrap", __pyx_methods, 0, 0, PYTHON_API_VERSION); Py_XINCREF(__pyx_m); #else __pyx_m = PyModule_Create(&__pyx_moduledef); #endif if (unlikely(!__pyx_m)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_d = PyModule_GetDict(__pyx_m); if (unlikely(!__pyx_d)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} Py_INCREF(__pyx_d); __pyx_b = PyImport_AddModule(__Pyx_BUILTIN_MODULE_NAME); if (unlikely(!__pyx_b)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} #if CYTHON_COMPILING_IN_PYPY Py_INCREF(__pyx_b); #endif if (PyObject_SetAttrString(__pyx_m, "__builtins__", __pyx_b) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; /*--- Initialize various global constants etc. ---*/ if (__Pyx_InitGlobals() < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} #if PY_MAJOR_VERSION < 3 && (__PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT) if (__Pyx_init_sys_getdefaultencoding_params() < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} #endif if (__pyx_module_is_main_pygame_sdl2__scrap) { if (PyObject_SetAttrString(__pyx_m, "__name__", __pyx_n_s_main) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } #if PY_MAJOR_VERSION >= 3 { PyObject *modules = PyImport_GetModuleDict(); if (unlikely(!modules)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} if (!PyDict_GetItemString(modules, "pygame_sdl2.scrap")) { if (unlikely(PyDict_SetItemString(modules, "pygame_sdl2.scrap", __pyx_m) < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } } #endif /*--- Builtin init code ---*/ if (__Pyx_InitCachedBuiltins() < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /*--- Constants init code ---*/ if (__Pyx_InitCachedConstants() < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /*--- Global init code ---*/ /*--- Variable export code ---*/ /*--- Function export code ---*/ /*--- Type init code ---*/ /*--- Type import code ---*/ /*--- Variable import code ---*/ /*--- Function import code ---*/ /*--- Execution code ---*/ #if defined(__Pyx_Generator_USED) || defined(__Pyx_Coroutine_USED) if (__Pyx_patch_abc() < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} #endif /* "pygame_sdl2/scrap.pyx":21 * from sdl2 cimport * * * from pygame_sdl2.error import error # <<<<<<<<<<<<<< * from pygame_sdl2.locals import SCRAP_TEXT * */ __pyx_t_1 = PyList_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 21; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __Pyx_INCREF(__pyx_n_s_error); __Pyx_GIVEREF(__pyx_n_s_error); PyList_SET_ITEM(__pyx_t_1, 0, __pyx_n_s_error); __pyx_t_2 = __Pyx_Import(__pyx_n_s_pygame_sdl2_error, __pyx_t_1, -1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 21; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_1 = __Pyx_ImportFrom(__pyx_t_2, __pyx_n_s_error); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 21; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); if (PyDict_SetItem(__pyx_d, __pyx_n_s_error, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 21; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "pygame_sdl2/scrap.pyx":22 * * from pygame_sdl2.error import error * from pygame_sdl2.locals import SCRAP_TEXT # <<<<<<<<<<<<<< * * from pygame_sdl2.compat import bytes_ */ __pyx_t_2 = PyList_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 22; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __Pyx_INCREF(__pyx_n_s_SCRAP_TEXT); __Pyx_GIVEREF(__pyx_n_s_SCRAP_TEXT); PyList_SET_ITEM(__pyx_t_2, 0, __pyx_n_s_SCRAP_TEXT); __pyx_t_1 = __Pyx_Import(__pyx_n_s_pygame_sdl2_locals, __pyx_t_2, -1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 22; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_2 = __Pyx_ImportFrom(__pyx_t_1, __pyx_n_s_SCRAP_TEXT); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 22; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_SCRAP_TEXT, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 22; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "pygame_sdl2/scrap.pyx":24 * from pygame_sdl2.locals import SCRAP_TEXT * * from pygame_sdl2.compat import bytes_ # <<<<<<<<<<<<<< * * def init(): */ __pyx_t_1 = PyList_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 24; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __Pyx_INCREF(__pyx_n_s_bytes); __Pyx_GIVEREF(__pyx_n_s_bytes); PyList_SET_ITEM(__pyx_t_1, 0, __pyx_n_s_bytes); __pyx_t_2 = __Pyx_Import(__pyx_n_s_pygame_sdl2_compat, __pyx_t_1, -1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 24; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_1 = __Pyx_ImportFrom(__pyx_t_2, __pyx_n_s_bytes); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 24; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); if (PyDict_SetItem(__pyx_d, __pyx_n_s_bytes, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 24; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "pygame_sdl2/scrap.pyx":26 * from pygame_sdl2.compat import bytes_ * * def init(): # <<<<<<<<<<<<<< * pass * */ __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_11pygame_sdl2_5scrap_1init, NULL, __pyx_n_s_pygame_sdl2_scrap); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 26; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_init, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 26; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "pygame_sdl2/scrap.pyx":29 * pass * * def get(type): # <<<<<<<<<<<<<< * cdef char *text = NULL * if type == SCRAP_TEXT: */ __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_11pygame_sdl2_5scrap_3get, NULL, __pyx_n_s_pygame_sdl2_scrap); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 29; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_get, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 29; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "pygame_sdl2/scrap.pyx":41 * raise error("Not implemented.") * * def get_types(): # <<<<<<<<<<<<<< * return [SCRAP_TEXT] * */ __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_11pygame_sdl2_5scrap_5get_types, NULL, __pyx_n_s_pygame_sdl2_scrap); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 41; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_get_types, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 41; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "pygame_sdl2/scrap.pyx":44 * return [SCRAP_TEXT] * * def put(type, data): # <<<<<<<<<<<<<< * if type != SCRAP_TEXT: * raise error("Not implemented.") */ __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_11pygame_sdl2_5scrap_7put, NULL, __pyx_n_s_pygame_sdl2_scrap); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 44; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_put, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 44; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "pygame_sdl2/scrap.pyx":53 * raise error() * * def contains(type): # <<<<<<<<<<<<<< * if type != SCRAP_TEXT: * return False */ __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_11pygame_sdl2_5scrap_9contains, NULL, __pyx_n_s_pygame_sdl2_scrap); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 53; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_contains, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 53; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "pygame_sdl2/scrap.pyx":59 * return SDL_HasClipboardText() == SDL_TRUE * * def lost(): # <<<<<<<<<<<<<< * return False * */ __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_11pygame_sdl2_5scrap_11lost, NULL, __pyx_n_s_pygame_sdl2_scrap); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 59; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_lost, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 59; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "pygame_sdl2/scrap.pyx":62 * return False * * def set_mode(mode): # <<<<<<<<<<<<<< * pass */ __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_11pygame_sdl2_5scrap_13set_mode, NULL, __pyx_n_s_pygame_sdl2_scrap); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 62; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_set_mode, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 62; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "pygame_sdl2/scrap.pyx":1 * # Copyright 2014 Patrick Dawson # <<<<<<<<<<<<<< * # * # This software is provided 'as-is', without any express or implied */ __pyx_t_2 = PyDict_New(); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_test, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /*--- Wrapped vars code ---*/ goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); if (__pyx_m) { if (__pyx_d) { __Pyx_AddTraceback("init pygame_sdl2.scrap", __pyx_clineno, __pyx_lineno, __pyx_filename); } Py_DECREF(__pyx_m); __pyx_m = 0; } else if (!PyErr_Occurred()) { PyErr_SetString(PyExc_ImportError, "init pygame_sdl2.scrap"); } __pyx_L0:; __Pyx_RefNannyFinishContext(); #if PY_MAJOR_VERSION < 3 return; #else return __pyx_m; #endif } /* --- Runtime support code --- */ #if CYTHON_REFNANNY static __Pyx_RefNannyAPIStruct *__Pyx_RefNannyImportAPI(const char *modname) { PyObject *m = NULL, *p = NULL; void *r = NULL; m = PyImport_ImportModule((char *)modname); if (!m) goto end; p = PyObject_GetAttrString(m, (char *)"RefNannyAPI"); if (!p) goto end; r = PyLong_AsVoidPtr(p); end: Py_XDECREF(p); Py_XDECREF(m); return (__Pyx_RefNannyAPIStruct *)r; } #endif static PyObject *__Pyx_GetBuiltinName(PyObject *name) { PyObject* result = __Pyx_PyObject_GetAttrStr(__pyx_b, name); if (unlikely(!result)) { PyErr_Format(PyExc_NameError, #if PY_MAJOR_VERSION >= 3 "name '%U' is not defined", name); #else "name '%.200s' is not defined", PyString_AS_STRING(name)); #endif } return result; } static CYTHON_INLINE PyObject *__Pyx_GetModuleGlobalName(PyObject *name) { PyObject *result; #if CYTHON_COMPILING_IN_CPYTHON result = PyDict_GetItem(__pyx_d, name); if (likely(result)) { Py_INCREF(result); } else { #else result = PyObject_GetItem(__pyx_d, name); if (!result) { PyErr_Clear(); #endif result = __Pyx_GetBuiltinName(name); } return result; } #if CYTHON_COMPILING_IN_CPYTHON static CYTHON_INLINE PyObject* __Pyx_PyObject_Call(PyObject *func, PyObject *arg, PyObject *kw) { PyObject *result; ternaryfunc call = func->ob_type->tp_call; if (unlikely(!call)) return PyObject_Call(func, arg, kw); if (unlikely(Py_EnterRecursiveCall((char*)" while calling a Python object"))) return NULL; result = (*call)(func, arg, kw); Py_LeaveRecursiveCall(); if (unlikely(!result) && unlikely(!PyErr_Occurred())) { PyErr_SetString( PyExc_SystemError, "NULL result without error in PyObject_Call"); } return result; } #endif #if CYTHON_COMPILING_IN_CPYTHON static CYTHON_INLINE PyObject* __Pyx_PyObject_CallMethO(PyObject *func, PyObject *arg) { PyObject *self, *result; PyCFunction cfunc; cfunc = PyCFunction_GET_FUNCTION(func); self = PyCFunction_GET_SELF(func); if (unlikely(Py_EnterRecursiveCall((char*)" while calling a Python object"))) return NULL; result = cfunc(self, arg); Py_LeaveRecursiveCall(); if (unlikely(!result) && unlikely(!PyErr_Occurred())) { PyErr_SetString( PyExc_SystemError, "NULL result without error in PyObject_Call"); } return result; } #endif #if CYTHON_COMPILING_IN_CPYTHON static PyObject* __Pyx__PyObject_CallOneArg(PyObject *func, PyObject *arg) { PyObject *result; PyObject *args = PyTuple_New(1); if (unlikely(!args)) return NULL; Py_INCREF(arg); PyTuple_SET_ITEM(args, 0, arg); result = __Pyx_PyObject_Call(func, args, NULL); Py_DECREF(args); return result; } static CYTHON_INLINE PyObject* __Pyx_PyObject_CallOneArg(PyObject *func, PyObject *arg) { #ifdef __Pyx_CyFunction_USED if (likely(PyCFunction_Check(func) || PyObject_TypeCheck(func, __pyx_CyFunctionType))) { #else if (likely(PyCFunction_Check(func))) { #endif if (likely(PyCFunction_GET_FLAGS(func) & METH_O)) { return __Pyx_PyObject_CallMethO(func, arg); } } return __Pyx__PyObject_CallOneArg(func, arg); } #else static CYTHON_INLINE PyObject* __Pyx_PyObject_CallOneArg(PyObject *func, PyObject *arg) { PyObject *result; PyObject *args = PyTuple_Pack(1, arg); if (unlikely(!args)) return NULL; result = __Pyx_PyObject_Call(func, args, NULL); Py_DECREF(args); return result; } #endif #if CYTHON_COMPILING_IN_CPYTHON static CYTHON_INLINE PyObject* __Pyx_PyObject_CallNoArg(PyObject *func) { #ifdef __Pyx_CyFunction_USED if (likely(PyCFunction_Check(func) || PyObject_TypeCheck(func, __pyx_CyFunctionType))) { #else if (likely(PyCFunction_Check(func))) { #endif if (likely(PyCFunction_GET_FLAGS(func) & METH_NOARGS)) { return __Pyx_PyObject_CallMethO(func, NULL); } } return __Pyx_PyObject_Call(func, __pyx_empty_tuple, NULL); } #endif static CYTHON_INLINE void __Pyx_ErrRestore(PyObject *type, PyObject *value, PyObject *tb) { #if CYTHON_COMPILING_IN_CPYTHON PyObject *tmp_type, *tmp_value, *tmp_tb; PyThreadState *tstate = PyThreadState_GET(); tmp_type = tstate->curexc_type; tmp_value = tstate->curexc_value; tmp_tb = tstate->curexc_traceback; tstate->curexc_type = type; tstate->curexc_value = value; tstate->curexc_traceback = tb; Py_XDECREF(tmp_type); Py_XDECREF(tmp_value); Py_XDECREF(tmp_tb); #else PyErr_Restore(type, value, tb); #endif } static CYTHON_INLINE void __Pyx_ErrFetch(PyObject **type, PyObject **value, PyObject **tb) { #if CYTHON_COMPILING_IN_CPYTHON PyThreadState *tstate = PyThreadState_GET(); *type = tstate->curexc_type; *value = tstate->curexc_value; *tb = tstate->curexc_traceback; tstate->curexc_type = 0; tstate->curexc_value = 0; tstate->curexc_traceback = 0; #else PyErr_Fetch(type, value, tb); #endif } #if PY_MAJOR_VERSION < 3 static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, CYTHON_UNUSED PyObject *cause) { Py_XINCREF(type); if (!value || value == Py_None) value = NULL; else Py_INCREF(value); if (!tb || tb == Py_None) tb = NULL; else { Py_INCREF(tb); if (!PyTraceBack_Check(tb)) { PyErr_SetString(PyExc_TypeError, "raise: arg 3 must be a traceback or None"); goto raise_error; } } if (PyType_Check(type)) { #if CYTHON_COMPILING_IN_PYPY if (!value) { Py_INCREF(Py_None); value = Py_None; } #endif PyErr_NormalizeException(&type, &value, &tb); } else { if (value) { PyErr_SetString(PyExc_TypeError, "instance exception may not have a separate value"); goto raise_error; } value = type; type = (PyObject*) Py_TYPE(type); Py_INCREF(type); if (!PyType_IsSubtype((PyTypeObject *)type, (PyTypeObject *)PyExc_BaseException)) { PyErr_SetString(PyExc_TypeError, "raise: exception class must be a subclass of BaseException"); goto raise_error; } } __Pyx_ErrRestore(type, value, tb); return; raise_error: Py_XDECREF(value); Py_XDECREF(type); Py_XDECREF(tb); return; } #else static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, PyObject *cause) { PyObject* owned_instance = NULL; if (tb == Py_None) { tb = 0; } else if (tb && !PyTraceBack_Check(tb)) { PyErr_SetString(PyExc_TypeError, "raise: arg 3 must be a traceback or None"); goto bad; } if (value == Py_None) value = 0; if (PyExceptionInstance_Check(type)) { if (value) { PyErr_SetString(PyExc_TypeError, "instance exception may not have a separate value"); goto bad; } value = type; type = (PyObject*) Py_TYPE(value); } else if (PyExceptionClass_Check(type)) { PyObject *instance_class = NULL; if (value && PyExceptionInstance_Check(value)) { instance_class = (PyObject*) Py_TYPE(value); if (instance_class != type) { int is_subclass = PyObject_IsSubclass(instance_class, type); if (!is_subclass) { instance_class = NULL; } else if (unlikely(is_subclass == -1)) { goto bad; } else { type = instance_class; } } } if (!instance_class) { PyObject *args; if (!value) args = PyTuple_New(0); else if (PyTuple_Check(value)) { Py_INCREF(value); args = value; } else args = PyTuple_Pack(1, value); if (!args) goto bad; owned_instance = PyObject_Call(type, args, NULL); Py_DECREF(args); if (!owned_instance) goto bad; value = owned_instance; if (!PyExceptionInstance_Check(value)) { PyErr_Format(PyExc_TypeError, "calling %R should have returned an instance of " "BaseException, not %R", type, Py_TYPE(value)); goto bad; } } } else { PyErr_SetString(PyExc_TypeError, "raise: exception class must be a subclass of BaseException"); goto bad; } #if PY_VERSION_HEX >= 0x03030000 if (cause) { #else if (cause && cause != Py_None) { #endif PyObject *fixed_cause; if (cause == Py_None) { fixed_cause = NULL; } else if (PyExceptionClass_Check(cause)) { fixed_cause = PyObject_CallObject(cause, NULL); if (fixed_cause == NULL) goto bad; } else if (PyExceptionInstance_Check(cause)) { fixed_cause = cause; Py_INCREF(fixed_cause); } else { PyErr_SetString(PyExc_TypeError, "exception causes must derive from " "BaseException"); goto bad; } PyException_SetCause(value, fixed_cause); } PyErr_SetObject(type, value); if (tb) { #if CYTHON_COMPILING_IN_PYPY PyObject *tmp_type, *tmp_value, *tmp_tb; PyErr_Fetch(&tmp_type, &tmp_value, &tmp_tb); Py_INCREF(tb); PyErr_Restore(tmp_type, tmp_value, tb); Py_XDECREF(tmp_tb); #else PyThreadState *tstate = PyThreadState_GET(); PyObject* tmp_tb = tstate->curexc_traceback; if (tb != tmp_tb) { Py_INCREF(tb); tstate->curexc_traceback = tb; Py_XDECREF(tmp_tb); } #endif } bad: Py_XDECREF(owned_instance); return; } #endif static void __Pyx_RaiseArgtupleInvalid( const char* func_name, int exact, Py_ssize_t num_min, Py_ssize_t num_max, Py_ssize_t num_found) { Py_ssize_t num_expected; const char *more_or_less; if (num_found < num_min) { num_expected = num_min; more_or_less = "at least"; } else { num_expected = num_max; more_or_less = "at most"; } if (exact) { more_or_less = "exactly"; } PyErr_Format(PyExc_TypeError, "%.200s() takes %.8s %" CYTHON_FORMAT_SSIZE_T "d positional argument%.1s (%" CYTHON_FORMAT_SSIZE_T "d given)", func_name, more_or_less, num_expected, (num_expected == 1) ? "" : "s", num_found); } static void __Pyx_RaiseDoubleKeywordsError( const char* func_name, PyObject* kw_name) { PyErr_Format(PyExc_TypeError, #if PY_MAJOR_VERSION >= 3 "%s() got multiple values for keyword argument '%U'", func_name, kw_name); #else "%s() got multiple values for keyword argument '%s'", func_name, PyString_AsString(kw_name)); #endif } static int __Pyx_ParseOptionalKeywords( PyObject *kwds, PyObject **argnames[], PyObject *kwds2, PyObject *values[], Py_ssize_t num_pos_args, const char* function_name) { PyObject *key = 0, *value = 0; Py_ssize_t pos = 0; PyObject*** name; PyObject*** first_kw_arg = argnames + num_pos_args; while (PyDict_Next(kwds, &pos, &key, &value)) { name = first_kw_arg; while (*name && (**name != key)) name++; if (*name) { values[name-argnames] = value; continue; } name = first_kw_arg; #if PY_MAJOR_VERSION < 3 if (likely(PyString_CheckExact(key)) || likely(PyString_Check(key))) { while (*name) { if ((CYTHON_COMPILING_IN_PYPY || PyString_GET_SIZE(**name) == PyString_GET_SIZE(key)) && _PyString_Eq(**name, key)) { values[name-argnames] = value; break; } name++; } if (*name) continue; else { PyObject*** argname = argnames; while (argname != first_kw_arg) { if ((**argname == key) || ( (CYTHON_COMPILING_IN_PYPY || PyString_GET_SIZE(**argname) == PyString_GET_SIZE(key)) && _PyString_Eq(**argname, key))) { goto arg_passed_twice; } argname++; } } } else #endif if (likely(PyUnicode_Check(key))) { while (*name) { int cmp = (**name == key) ? 0 : #if !CYTHON_COMPILING_IN_PYPY && PY_MAJOR_VERSION >= 3 (PyUnicode_GET_SIZE(**name) != PyUnicode_GET_SIZE(key)) ? 1 : #endif PyUnicode_Compare(**name, key); if (cmp < 0 && unlikely(PyErr_Occurred())) goto bad; if (cmp == 0) { values[name-argnames] = value; break; } name++; } if (*name) continue; else { PyObject*** argname = argnames; while (argname != first_kw_arg) { int cmp = (**argname == key) ? 0 : #if !CYTHON_COMPILING_IN_PYPY && PY_MAJOR_VERSION >= 3 (PyUnicode_GET_SIZE(**argname) != PyUnicode_GET_SIZE(key)) ? 1 : #endif PyUnicode_Compare(**argname, key); if (cmp < 0 && unlikely(PyErr_Occurred())) goto bad; if (cmp == 0) goto arg_passed_twice; argname++; } } } else goto invalid_keyword_type; if (kwds2) { if (unlikely(PyDict_SetItem(kwds2, key, value))) goto bad; } else { goto invalid_keyword; } } return 0; arg_passed_twice: __Pyx_RaiseDoubleKeywordsError(function_name, key); goto bad; invalid_keyword_type: PyErr_Format(PyExc_TypeError, "%.200s() keywords must be strings", function_name); goto bad; invalid_keyword: PyErr_Format(PyExc_TypeError, #if PY_MAJOR_VERSION < 3 "%.200s() got an unexpected keyword argument '%.200s'", function_name, PyString_AsString(key)); #else "%s() got an unexpected keyword argument '%U'", function_name, key); #endif bad: return -1; } static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list, int level) { PyObject *empty_list = 0; PyObject *module = 0; PyObject *global_dict = 0; PyObject *empty_dict = 0; PyObject *list; #if PY_VERSION_HEX < 0x03030000 PyObject *py_import; py_import = __Pyx_PyObject_GetAttrStr(__pyx_b, __pyx_n_s_import); if (!py_import) goto bad; #endif if (from_list) list = from_list; else { empty_list = PyList_New(0); if (!empty_list) goto bad; list = empty_list; } global_dict = PyModule_GetDict(__pyx_m); if (!global_dict) goto bad; empty_dict = PyDict_New(); if (!empty_dict) goto bad; { #if PY_MAJOR_VERSION >= 3 if (level == -1) { if (strchr(__Pyx_MODULE_NAME, '.')) { #if PY_VERSION_HEX < 0x03030000 PyObject *py_level = PyInt_FromLong(1); if (!py_level) goto bad; module = PyObject_CallFunctionObjArgs(py_import, name, global_dict, empty_dict, list, py_level, NULL); Py_DECREF(py_level); #else module = PyImport_ImportModuleLevelObject( name, global_dict, empty_dict, list, 1); #endif if (!module) { if (!PyErr_ExceptionMatches(PyExc_ImportError)) goto bad; PyErr_Clear(); } } level = 0; } #endif if (!module) { #if PY_VERSION_HEX < 0x03030000 PyObject *py_level = PyInt_FromLong(level); if (!py_level) goto bad; module = PyObject_CallFunctionObjArgs(py_import, name, global_dict, empty_dict, list, py_level, NULL); Py_DECREF(py_level); #else module = PyImport_ImportModuleLevelObject( name, global_dict, empty_dict, list, level); #endif } } bad: #if PY_VERSION_HEX < 0x03030000 Py_XDECREF(py_import); #endif Py_XDECREF(empty_list); Py_XDECREF(empty_dict); return module; } static PyObject* __Pyx_ImportFrom(PyObject* module, PyObject* name) { PyObject* value = __Pyx_PyObject_GetAttrStr(module, name); if (unlikely(!value) && PyErr_ExceptionMatches(PyExc_AttributeError)) { PyErr_Format(PyExc_ImportError, #if PY_MAJOR_VERSION < 3 "cannot import name %.230s", PyString_AS_STRING(name)); #else "cannot import name %S", name); #endif } return value; } static int __pyx_bisect_code_objects(__Pyx_CodeObjectCacheEntry* entries, int count, int code_line) { int start = 0, mid = 0, end = count - 1; if (end >= 0 && code_line > entries[end].code_line) { return count; } while (start < end) { mid = start + (end - start) / 2; if (code_line < entries[mid].code_line) { end = mid; } else if (code_line > entries[mid].code_line) { start = mid + 1; } else { return mid; } } if (code_line <= entries[mid].code_line) { return mid; } else { return mid + 1; } } static PyCodeObject *__pyx_find_code_object(int code_line) { PyCodeObject* code_object; int pos; if (unlikely(!code_line) || unlikely(!__pyx_code_cache.entries)) { return NULL; } pos = __pyx_bisect_code_objects(__pyx_code_cache.entries, __pyx_code_cache.count, code_line); if (unlikely(pos >= __pyx_code_cache.count) || unlikely(__pyx_code_cache.entries[pos].code_line != code_line)) { return NULL; } code_object = __pyx_code_cache.entries[pos].code_object; Py_INCREF(code_object); return code_object; } static void __pyx_insert_code_object(int code_line, PyCodeObject* code_object) { int pos, i; __Pyx_CodeObjectCacheEntry* entries = __pyx_code_cache.entries; if (unlikely(!code_line)) { return; } if (unlikely(!entries)) { entries = (__Pyx_CodeObjectCacheEntry*)PyMem_Malloc(64*sizeof(__Pyx_CodeObjectCacheEntry)); if (likely(entries)) { __pyx_code_cache.entries = entries; __pyx_code_cache.max_count = 64; __pyx_code_cache.count = 1; entries[0].code_line = code_line; entries[0].code_object = code_object; Py_INCREF(code_object); } return; } pos = __pyx_bisect_code_objects(__pyx_code_cache.entries, __pyx_code_cache.count, code_line); if ((pos < __pyx_code_cache.count) && unlikely(__pyx_code_cache.entries[pos].code_line == code_line)) { PyCodeObject* tmp = entries[pos].code_object; entries[pos].code_object = code_object; Py_DECREF(tmp); return; } if (__pyx_code_cache.count == __pyx_code_cache.max_count) { int new_max = __pyx_code_cache.max_count + 64; entries = (__Pyx_CodeObjectCacheEntry*)PyMem_Realloc( __pyx_code_cache.entries, (size_t)new_max*sizeof(__Pyx_CodeObjectCacheEntry)); if (unlikely(!entries)) { return; } __pyx_code_cache.entries = entries; __pyx_code_cache.max_count = new_max; } for (i=__pyx_code_cache.count; i>pos; i--) { entries[i] = entries[i-1]; } entries[pos].code_line = code_line; entries[pos].code_object = code_object; __pyx_code_cache.count++; Py_INCREF(code_object); } #include "compile.h" #include "frameobject.h" #include "traceback.h" static PyCodeObject* __Pyx_CreateCodeObjectForTraceback( const char *funcname, int c_line, int py_line, const char *filename) { PyCodeObject *py_code = 0; PyObject *py_srcfile = 0; PyObject *py_funcname = 0; #if PY_MAJOR_VERSION < 3 py_srcfile = PyString_FromString(filename); #else py_srcfile = PyUnicode_FromString(filename); #endif if (!py_srcfile) goto bad; if (c_line) { #if PY_MAJOR_VERSION < 3 py_funcname = PyString_FromFormat( "%s (%s:%d)", funcname, __pyx_cfilenm, c_line); #else py_funcname = PyUnicode_FromFormat( "%s (%s:%d)", funcname, __pyx_cfilenm, c_line); #endif } else { #if PY_MAJOR_VERSION < 3 py_funcname = PyString_FromString(funcname); #else py_funcname = PyUnicode_FromString(funcname); #endif } if (!py_funcname) goto bad; py_code = __Pyx_PyCode_New( 0, 0, 0, 0, 0, __pyx_empty_bytes, /*PyObject *code,*/ __pyx_empty_tuple, /*PyObject *consts,*/ __pyx_empty_tuple, /*PyObject *names,*/ __pyx_empty_tuple, /*PyObject *varnames,*/ __pyx_empty_tuple, /*PyObject *freevars,*/ __pyx_empty_tuple, /*PyObject *cellvars,*/ py_srcfile, /*PyObject *filename,*/ py_funcname, /*PyObject *name,*/ py_line, __pyx_empty_bytes /*PyObject *lnotab*/ ); Py_DECREF(py_srcfile); Py_DECREF(py_funcname); return py_code; bad: Py_XDECREF(py_srcfile); Py_XDECREF(py_funcname); return NULL; } static void __Pyx_AddTraceback(const char *funcname, int c_line, int py_line, const char *filename) { PyCodeObject *py_code = 0; PyFrameObject *py_frame = 0; py_code = __pyx_find_code_object(c_line ? c_line : py_line); if (!py_code) { py_code = __Pyx_CreateCodeObjectForTraceback( funcname, c_line, py_line, filename); if (!py_code) goto bad; __pyx_insert_code_object(c_line ? c_line : py_line, py_code); } py_frame = PyFrame_New( PyThreadState_GET(), /*PyThreadState *tstate,*/ py_code, /*PyCodeObject *code,*/ __pyx_d, /*PyObject *globals,*/ 0 /*PyObject *locals*/ ); if (!py_frame) goto bad; py_frame->f_lineno = py_line; PyTraceBack_Here(py_frame); bad: Py_XDECREF(py_code); Py_XDECREF(py_frame); } static CYTHON_INLINE PyObject* __Pyx_PyInt_From_long(long value) { const long neg_one = (long) -1, const_zero = (long) 0; const int is_unsigned = neg_one > const_zero; if (is_unsigned) { if (sizeof(long) < sizeof(long)) { return PyInt_FromLong((long) value); } else if (sizeof(long) <= sizeof(unsigned long)) { return PyLong_FromUnsignedLong((unsigned long) value); } else if (sizeof(long) <= sizeof(unsigned PY_LONG_LONG)) { return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value); } } else { if (sizeof(long) <= sizeof(long)) { return PyInt_FromLong((long) value); } else if (sizeof(long) <= sizeof(PY_LONG_LONG)) { return PyLong_FromLongLong((PY_LONG_LONG) value); } } { int one = 1; int little = (int)*(unsigned char *)&one; unsigned char *bytes = (unsigned char *)&value; return _PyLong_FromByteArray(bytes, sizeof(long), little, !is_unsigned); } } #define __PYX_VERIFY_RETURN_INT(target_type, func_type, func_value)\ __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, 0) #define __PYX_VERIFY_RETURN_INT_EXC(target_type, func_type, func_value)\ __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, 1) #define __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, exc)\ {\ func_type value = func_value;\ if (sizeof(target_type) < sizeof(func_type)) {\ if (unlikely(value != (func_type) (target_type) value)) {\ func_type zero = 0;\ if (exc && unlikely(value == (func_type)-1 && PyErr_Occurred()))\ return (target_type) -1;\ if (is_unsigned && unlikely(value < zero))\ goto raise_neg_overflow;\ else\ goto raise_overflow;\ }\ }\ return (target_type) value;\ } #if CYTHON_USE_PYLONG_INTERNALS #include "longintrepr.h" #endif static CYTHON_INLINE long __Pyx_PyInt_As_long(PyObject *x) { const long neg_one = (long) -1, const_zero = (long) 0; const int is_unsigned = neg_one > const_zero; #if PY_MAJOR_VERSION < 3 if (likely(PyInt_Check(x))) { if (sizeof(long) < sizeof(long)) { __PYX_VERIFY_RETURN_INT(long, long, PyInt_AS_LONG(x)) } else { long val = PyInt_AS_LONG(x); if (is_unsigned && unlikely(val < 0)) { goto raise_neg_overflow; } return (long) val; } } else #endif if (likely(PyLong_Check(x))) { if (is_unsigned) { #if CYTHON_USE_PYLONG_INTERNALS const digit* digits = ((PyLongObject*)x)->ob_digit; switch (Py_SIZE(x)) { case 0: return (long) 0; case 1: __PYX_VERIFY_RETURN_INT(long, digit, digits[0]) case 2: if (8 * sizeof(long) > 1 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(long) >= 2 * PyLong_SHIFT) { return (long) (((((long)digits[1]) << PyLong_SHIFT) | (long)digits[0])); } } break; case 3: if (8 * sizeof(long) > 2 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(long) >= 3 * PyLong_SHIFT) { return (long) (((((((long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0])); } } break; case 4: if (8 * sizeof(long) > 3 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(long) >= 4 * PyLong_SHIFT) { return (long) (((((((((long)digits[3]) << PyLong_SHIFT) | (long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0])); } } break; } #endif #if CYTHON_COMPILING_IN_CPYTHON if (unlikely(Py_SIZE(x) < 0)) { goto raise_neg_overflow; } #else { int result = PyObject_RichCompareBool(x, Py_False, Py_LT); if (unlikely(result < 0)) return (long) -1; if (unlikely(result == 1)) goto raise_neg_overflow; } #endif if (sizeof(long) <= sizeof(unsigned long)) { __PYX_VERIFY_RETURN_INT_EXC(long, unsigned long, PyLong_AsUnsignedLong(x)) } else if (sizeof(long) <= sizeof(unsigned PY_LONG_LONG)) { __PYX_VERIFY_RETURN_INT_EXC(long, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x)) } } else { #if CYTHON_USE_PYLONG_INTERNALS const digit* digits = ((PyLongObject*)x)->ob_digit; switch (Py_SIZE(x)) { case 0: return (long) 0; case -1: __PYX_VERIFY_RETURN_INT(long, sdigit, -(sdigit) digits[0]) case 1: __PYX_VERIFY_RETURN_INT(long, digit, +digits[0]) case -2: if (8 * sizeof(long) - 1 > 1 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(long, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) { return (long) (((long)-1)*(((((long)digits[1]) << PyLong_SHIFT) | (long)digits[0]))); } } break; case 2: if (8 * sizeof(long) > 1 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) { return (long) ((((((long)digits[1]) << PyLong_SHIFT) | (long)digits[0]))); } } break; case -3: if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(long, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) { return (long) (((long)-1)*(((((((long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0]))); } } break; case 3: if (8 * sizeof(long) > 2 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) { return (long) ((((((((long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0]))); } } break; case -4: if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(long, long, -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(long) - 1 > 4 * PyLong_SHIFT) { return (long) (((long)-1)*(((((((((long)digits[3]) << PyLong_SHIFT) | (long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0]))); } } break; case 4: if (8 * sizeof(long) > 3 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(long) - 1 > 4 * PyLong_SHIFT) { return (long) ((((((((((long)digits[3]) << PyLong_SHIFT) | (long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0]))); } } break; } #endif if (sizeof(long) <= sizeof(long)) { __PYX_VERIFY_RETURN_INT_EXC(long, long, PyLong_AsLong(x)) } else if (sizeof(long) <= sizeof(PY_LONG_LONG)) { __PYX_VERIFY_RETURN_INT_EXC(long, PY_LONG_LONG, PyLong_AsLongLong(x)) } } { #if CYTHON_COMPILING_IN_PYPY && !defined(_PyLong_AsByteArray) PyErr_SetString(PyExc_RuntimeError, "_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers"); #else long val; PyObject *v = __Pyx_PyNumber_Int(x); #if PY_MAJOR_VERSION < 3 if (likely(v) && !PyLong_Check(v)) { PyObject *tmp = v; v = PyNumber_Long(tmp); Py_DECREF(tmp); } #endif if (likely(v)) { int one = 1; int is_little = (int)*(unsigned char *)&one; unsigned char *bytes = (unsigned char *)&val; int ret = _PyLong_AsByteArray((PyLongObject *)v, bytes, sizeof(val), is_little, !is_unsigned); Py_DECREF(v); if (likely(!ret)) return val; } #endif return (long) -1; } } else { long val; PyObject *tmp = __Pyx_PyNumber_Int(x); if (!tmp) return (long) -1; val = __Pyx_PyInt_As_long(tmp); Py_DECREF(tmp); return val; } raise_overflow: PyErr_SetString(PyExc_OverflowError, "value too large to convert to long"); return (long) -1; raise_neg_overflow: PyErr_SetString(PyExc_OverflowError, "can't convert negative value to long"); return (long) -1; } static CYTHON_INLINE int __Pyx_PyInt_As_int(PyObject *x) { const int neg_one = (int) -1, const_zero = (int) 0; const int is_unsigned = neg_one > const_zero; #if PY_MAJOR_VERSION < 3 if (likely(PyInt_Check(x))) { if (sizeof(int) < sizeof(long)) { __PYX_VERIFY_RETURN_INT(int, long, PyInt_AS_LONG(x)) } else { long val = PyInt_AS_LONG(x); if (is_unsigned && unlikely(val < 0)) { goto raise_neg_overflow; } return (int) val; } } else #endif if (likely(PyLong_Check(x))) { if (is_unsigned) { #if CYTHON_USE_PYLONG_INTERNALS const digit* digits = ((PyLongObject*)x)->ob_digit; switch (Py_SIZE(x)) { case 0: return (int) 0; case 1: __PYX_VERIFY_RETURN_INT(int, digit, digits[0]) case 2: if (8 * sizeof(int) > 1 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(int) >= 2 * PyLong_SHIFT) { return (int) (((((int)digits[1]) << PyLong_SHIFT) | (int)digits[0])); } } break; case 3: if (8 * sizeof(int) > 2 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(int) >= 3 * PyLong_SHIFT) { return (int) (((((((int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0])); } } break; case 4: if (8 * sizeof(int) > 3 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(int) >= 4 * PyLong_SHIFT) { return (int) (((((((((int)digits[3]) << PyLong_SHIFT) | (int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0])); } } break; } #endif #if CYTHON_COMPILING_IN_CPYTHON if (unlikely(Py_SIZE(x) < 0)) { goto raise_neg_overflow; } #else { int result = PyObject_RichCompareBool(x, Py_False, Py_LT); if (unlikely(result < 0)) return (int) -1; if (unlikely(result == 1)) goto raise_neg_overflow; } #endif if (sizeof(int) <= sizeof(unsigned long)) { __PYX_VERIFY_RETURN_INT_EXC(int, unsigned long, PyLong_AsUnsignedLong(x)) } else if (sizeof(int) <= sizeof(unsigned PY_LONG_LONG)) { __PYX_VERIFY_RETURN_INT_EXC(int, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x)) } } else { #if CYTHON_USE_PYLONG_INTERNALS const digit* digits = ((PyLongObject*)x)->ob_digit; switch (Py_SIZE(x)) { case 0: return (int) 0; case -1: __PYX_VERIFY_RETURN_INT(int, sdigit, -(sdigit) digits[0]) case 1: __PYX_VERIFY_RETURN_INT(int, digit, +digits[0]) case -2: if (8 * sizeof(int) - 1 > 1 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(int, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(int) - 1 > 2 * PyLong_SHIFT) { return (int) (((int)-1)*(((((int)digits[1]) << PyLong_SHIFT) | (int)digits[0]))); } } break; case 2: if (8 * sizeof(int) > 1 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(int) - 1 > 2 * PyLong_SHIFT) { return (int) ((((((int)digits[1]) << PyLong_SHIFT) | (int)digits[0]))); } } break; case -3: if (8 * sizeof(int) - 1 > 2 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(int, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(int) - 1 > 3 * PyLong_SHIFT) { return (int) (((int)-1)*(((((((int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0]))); } } break; case 3: if (8 * sizeof(int) > 2 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(int) - 1 > 3 * PyLong_SHIFT) { return (int) ((((((((int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0]))); } } break; case -4: if (8 * sizeof(int) - 1 > 3 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(int, long, -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(int) - 1 > 4 * PyLong_SHIFT) { return (int) (((int)-1)*(((((((((int)digits[3]) << PyLong_SHIFT) | (int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0]))); } } break; case 4: if (8 * sizeof(int) > 3 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(int) - 1 > 4 * PyLong_SHIFT) { return (int) ((((((((((int)digits[3]) << PyLong_SHIFT) | (int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0]))); } } break; } #endif if (sizeof(int) <= sizeof(long)) { __PYX_VERIFY_RETURN_INT_EXC(int, long, PyLong_AsLong(x)) } else if (sizeof(int) <= sizeof(PY_LONG_LONG)) { __PYX_VERIFY_RETURN_INT_EXC(int, PY_LONG_LONG, PyLong_AsLongLong(x)) } } { #if CYTHON_COMPILING_IN_PYPY && !defined(_PyLong_AsByteArray) PyErr_SetString(PyExc_RuntimeError, "_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers"); #else int val; PyObject *v = __Pyx_PyNumber_Int(x); #if PY_MAJOR_VERSION < 3 if (likely(v) && !PyLong_Check(v)) { PyObject *tmp = v; v = PyNumber_Long(tmp); Py_DECREF(tmp); } #endif if (likely(v)) { int one = 1; int is_little = (int)*(unsigned char *)&one; unsigned char *bytes = (unsigned char *)&val; int ret = _PyLong_AsByteArray((PyLongObject *)v, bytes, sizeof(val), is_little, !is_unsigned); Py_DECREF(v); if (likely(!ret)) return val; } #endif return (int) -1; } } else { int val; PyObject *tmp = __Pyx_PyNumber_Int(x); if (!tmp) return (int) -1; val = __Pyx_PyInt_As_int(tmp); Py_DECREF(tmp); return val; } raise_overflow: PyErr_SetString(PyExc_OverflowError, "value too large to convert to int"); return (int) -1; raise_neg_overflow: PyErr_SetString(PyExc_OverflowError, "can't convert negative value to int"); return (int) -1; } static int __Pyx_check_binary_version(void) { char ctversion[4], rtversion[4]; PyOS_snprintf(ctversion, 4, "%d.%d", PY_MAJOR_VERSION, PY_MINOR_VERSION); PyOS_snprintf(rtversion, 4, "%s", Py_GetVersion()); if (ctversion[0] != rtversion[0] || ctversion[2] != rtversion[2]) { char message[200]; PyOS_snprintf(message, sizeof(message), "compiletime version %s of module '%.100s' " "does not match runtime version %s", ctversion, __Pyx_MODULE_NAME, rtversion); return PyErr_WarnEx(NULL, message, 1); } return 0; } static int __Pyx_InitStrings(__Pyx_StringTabEntry *t) { while (t->p) { #if PY_MAJOR_VERSION < 3 if (t->is_unicode) { *t->p = PyUnicode_DecodeUTF8(t->s, t->n - 1, NULL); } else if (t->intern) { *t->p = PyString_InternFromString(t->s); } else { *t->p = PyString_FromStringAndSize(t->s, t->n - 1); } #else if (t->is_unicode | t->is_str) { if (t->intern) { *t->p = PyUnicode_InternFromString(t->s); } else if (t->encoding) { *t->p = PyUnicode_Decode(t->s, t->n - 1, t->encoding, NULL); } else { *t->p = PyUnicode_FromStringAndSize(t->s, t->n - 1); } } else { *t->p = PyBytes_FromStringAndSize(t->s, t->n - 1); } #endif if (!*t->p) return -1; ++t; } return 0; } static CYTHON_INLINE PyObject* __Pyx_PyUnicode_FromString(const char* c_str) { return __Pyx_PyUnicode_FromStringAndSize(c_str, (Py_ssize_t)strlen(c_str)); } static CYTHON_INLINE char* __Pyx_PyObject_AsString(PyObject* o) { Py_ssize_t ignore; return __Pyx_PyObject_AsStringAndSize(o, &ignore); } static CYTHON_INLINE char* __Pyx_PyObject_AsStringAndSize(PyObject* o, Py_ssize_t *length) { #if CYTHON_COMPILING_IN_CPYTHON && (__PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT) if ( #if PY_MAJOR_VERSION < 3 && __PYX_DEFAULT_STRING_ENCODING_IS_ASCII __Pyx_sys_getdefaultencoding_not_ascii && #endif PyUnicode_Check(o)) { #if PY_VERSION_HEX < 0x03030000 char* defenc_c; PyObject* defenc = _PyUnicode_AsDefaultEncodedString(o, NULL); if (!defenc) return NULL; defenc_c = PyBytes_AS_STRING(defenc); #if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII { char* end = defenc_c + PyBytes_GET_SIZE(defenc); char* c; for (c = defenc_c; c < end; c++) { if ((unsigned char) (*c) >= 128) { PyUnicode_AsASCIIString(o); return NULL; } } } #endif *length = PyBytes_GET_SIZE(defenc); return defenc_c; #else if (__Pyx_PyUnicode_READY(o) == -1) return NULL; #if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII if (PyUnicode_IS_ASCII(o)) { *length = PyUnicode_GET_LENGTH(o); return PyUnicode_AsUTF8(o); } else { PyUnicode_AsASCIIString(o); return NULL; } #else return PyUnicode_AsUTF8AndSize(o, length); #endif #endif } else #endif #if (!CYTHON_COMPILING_IN_PYPY) || (defined(PyByteArray_AS_STRING) && defined(PyByteArray_GET_SIZE)) if (PyByteArray_Check(o)) { *length = PyByteArray_GET_SIZE(o); return PyByteArray_AS_STRING(o); } else #endif { char* result; int r = PyBytes_AsStringAndSize(o, &result, length); if (unlikely(r < 0)) { return NULL; } else { return result; } } } static CYTHON_INLINE int __Pyx_PyObject_IsTrue(PyObject* x) { int is_true = x == Py_True; if (is_true | (x == Py_False) | (x == Py_None)) return is_true; else return PyObject_IsTrue(x); } static CYTHON_INLINE PyObject* __Pyx_PyNumber_Int(PyObject* x) { PyNumberMethods *m; const char *name = NULL; PyObject *res = NULL; #if PY_MAJOR_VERSION < 3 if (PyInt_Check(x) || PyLong_Check(x)) #else if (PyLong_Check(x)) #endif return __Pyx_NewRef(x); m = Py_TYPE(x)->tp_as_number; #if PY_MAJOR_VERSION < 3 if (m && m->nb_int) { name = "int"; res = PyNumber_Int(x); } else if (m && m->nb_long) { name = "long"; res = PyNumber_Long(x); } #else if (m && m->nb_int) { name = "int"; res = PyNumber_Long(x); } #endif if (res) { #if PY_MAJOR_VERSION < 3 if (!PyInt_Check(res) && !PyLong_Check(res)) { #else if (!PyLong_Check(res)) { #endif PyErr_Format(PyExc_TypeError, "__%.4s__ returned non-%.4s (type %.200s)", name, name, Py_TYPE(res)->tp_name); Py_DECREF(res); return NULL; } } else if (!PyErr_Occurred()) { PyErr_SetString(PyExc_TypeError, "an integer is required"); } return res; } static CYTHON_INLINE Py_ssize_t __Pyx_PyIndex_AsSsize_t(PyObject* b) { Py_ssize_t ival; PyObject *x; #if PY_MAJOR_VERSION < 3 if (likely(PyInt_CheckExact(b))) { if (sizeof(Py_ssize_t) >= sizeof(long)) return PyInt_AS_LONG(b); else return PyInt_AsSsize_t(x); } #endif if (likely(PyLong_CheckExact(b))) { #if CYTHON_USE_PYLONG_INTERNALS const digit* digits = ((PyLongObject*)b)->ob_digit; const Py_ssize_t size = Py_SIZE(b); if (likely(__Pyx_sst_abs(size) <= 1)) { ival = likely(size) ? digits[0] : 0; if (size == -1) ival = -ival; return ival; } else { switch (size) { case 2: if (8 * sizeof(Py_ssize_t) > 2 * PyLong_SHIFT) { return (Py_ssize_t) (((((size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])); } break; case -2: if (8 * sizeof(Py_ssize_t) > 2 * PyLong_SHIFT) { return -(Py_ssize_t) (((((size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])); } break; case 3: if (8 * sizeof(Py_ssize_t) > 3 * PyLong_SHIFT) { return (Py_ssize_t) (((((((size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])); } break; case -3: if (8 * sizeof(Py_ssize_t) > 3 * PyLong_SHIFT) { return -(Py_ssize_t) (((((((size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])); } break; case 4: if (8 * sizeof(Py_ssize_t) > 4 * PyLong_SHIFT) { return (Py_ssize_t) (((((((((size_t)digits[3]) << PyLong_SHIFT) | (size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])); } break; case -4: if (8 * sizeof(Py_ssize_t) > 4 * PyLong_SHIFT) { return -(Py_ssize_t) (((((((((size_t)digits[3]) << PyLong_SHIFT) | (size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])); } break; } } #endif return PyLong_AsSsize_t(b); } x = PyNumber_Index(b); if (!x) return -1; ival = PyInt_AsSsize_t(x); Py_DECREF(x); return ival; } static CYTHON_INLINE PyObject * __Pyx_PyInt_FromSize_t(size_t ival) { return PyInt_FromSize_t(ival); } #endif /* Py_PYTHON_H */ pygame_sdl2-2.1.0-for-renpy-6.99.14.1/gen/pygame_sdl2.controller.c0000664000175000017500000067257012660477766023621 0ustar tomtom00000000000000/* Generated by Cython 0.23.4 */ #define PY_SSIZE_T_CLEAN #include "Python.h" #ifndef Py_PYTHON_H #error Python headers needed to compile C extensions, please install development version of Python. #elif PY_VERSION_HEX < 0x02060000 || (0x03000000 <= PY_VERSION_HEX && PY_VERSION_HEX < 0x03020000) #error Cython requires Python 2.6+ or Python 3.2+. #else #define CYTHON_ABI "0_23_4" #include #ifndef offsetof #define offsetof(type, member) ( (size_t) & ((type*)0) -> member ) #endif #if !defined(WIN32) && !defined(MS_WINDOWS) #ifndef __stdcall #define __stdcall #endif #ifndef __cdecl #define __cdecl #endif #ifndef __fastcall #define __fastcall #endif #endif #ifndef DL_IMPORT #define DL_IMPORT(t) t #endif #ifndef DL_EXPORT #define DL_EXPORT(t) t #endif #ifndef PY_LONG_LONG #define PY_LONG_LONG LONG_LONG #endif #ifndef Py_HUGE_VAL #define Py_HUGE_VAL HUGE_VAL #endif #ifdef PYPY_VERSION #define CYTHON_COMPILING_IN_PYPY 1 #define CYTHON_COMPILING_IN_CPYTHON 0 #else #define CYTHON_COMPILING_IN_PYPY 0 #define CYTHON_COMPILING_IN_CPYTHON 1 #endif #if !defined(CYTHON_USE_PYLONG_INTERNALS) && CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x02070000 #define CYTHON_USE_PYLONG_INTERNALS 1 #endif #if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX < 0x02070600 && !defined(Py_OptimizeFlag) #define Py_OptimizeFlag 0 #endif #define __PYX_BUILD_PY_SSIZE_T "n" #define CYTHON_FORMAT_SSIZE_T "z" #if PY_MAJOR_VERSION < 3 #define __Pyx_BUILTIN_MODULE_NAME "__builtin__" #define __Pyx_PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)\ PyCode_New(a+k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos) #define __Pyx_DefaultClassType PyClass_Type #else #define __Pyx_BUILTIN_MODULE_NAME "builtins" #define __Pyx_PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)\ PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos) #define __Pyx_DefaultClassType PyType_Type #endif #ifndef Py_TPFLAGS_CHECKTYPES #define Py_TPFLAGS_CHECKTYPES 0 #endif #ifndef Py_TPFLAGS_HAVE_INDEX #define Py_TPFLAGS_HAVE_INDEX 0 #endif #ifndef Py_TPFLAGS_HAVE_NEWBUFFER #define Py_TPFLAGS_HAVE_NEWBUFFER 0 #endif #ifndef Py_TPFLAGS_HAVE_FINALIZE #define Py_TPFLAGS_HAVE_FINALIZE 0 #endif #if PY_VERSION_HEX > 0x03030000 && defined(PyUnicode_KIND) #define CYTHON_PEP393_ENABLED 1 #define __Pyx_PyUnicode_READY(op) (likely(PyUnicode_IS_READY(op)) ?\ 0 : _PyUnicode_Ready((PyObject *)(op))) #define __Pyx_PyUnicode_GET_LENGTH(u) PyUnicode_GET_LENGTH(u) #define __Pyx_PyUnicode_READ_CHAR(u, i) PyUnicode_READ_CHAR(u, i) #define __Pyx_PyUnicode_KIND(u) PyUnicode_KIND(u) #define __Pyx_PyUnicode_DATA(u) PyUnicode_DATA(u) #define __Pyx_PyUnicode_READ(k, d, i) PyUnicode_READ(k, d, i) #else #define CYTHON_PEP393_ENABLED 0 #define __Pyx_PyUnicode_READY(op) (0) #define __Pyx_PyUnicode_GET_LENGTH(u) PyUnicode_GET_SIZE(u) #define __Pyx_PyUnicode_READ_CHAR(u, i) ((Py_UCS4)(PyUnicode_AS_UNICODE(u)[i])) #define __Pyx_PyUnicode_KIND(u) (sizeof(Py_UNICODE)) #define __Pyx_PyUnicode_DATA(u) ((void*)PyUnicode_AS_UNICODE(u)) #define __Pyx_PyUnicode_READ(k, d, i) ((void)(k), (Py_UCS4)(((Py_UNICODE*)d)[i])) #endif #if CYTHON_COMPILING_IN_PYPY #define __Pyx_PyUnicode_Concat(a, b) PyNumber_Add(a, b) #define __Pyx_PyUnicode_ConcatSafe(a, b) PyNumber_Add(a, b) #else #define __Pyx_PyUnicode_Concat(a, b) PyUnicode_Concat(a, b) #define __Pyx_PyUnicode_ConcatSafe(a, b) ((unlikely((a) == Py_None) || unlikely((b) == Py_None)) ?\ PyNumber_Add(a, b) : __Pyx_PyUnicode_Concat(a, b)) #endif #if CYTHON_COMPILING_IN_PYPY && !defined(PyUnicode_Contains) #define PyUnicode_Contains(u, s) PySequence_Contains(u, s) #endif #define __Pyx_PyString_FormatSafe(a, b) ((unlikely((a) == Py_None)) ? PyNumber_Remainder(a, b) : __Pyx_PyString_Format(a, b)) #define __Pyx_PyUnicode_FormatSafe(a, b) ((unlikely((a) == Py_None)) ? PyNumber_Remainder(a, b) : PyUnicode_Format(a, b)) #if PY_MAJOR_VERSION >= 3 #define __Pyx_PyString_Format(a, b) PyUnicode_Format(a, b) #else #define __Pyx_PyString_Format(a, b) PyString_Format(a, b) #endif #if PY_MAJOR_VERSION >= 3 #define PyBaseString_Type PyUnicode_Type #define PyStringObject PyUnicodeObject #define PyString_Type PyUnicode_Type #define PyString_Check PyUnicode_Check #define PyString_CheckExact PyUnicode_CheckExact #endif #if PY_MAJOR_VERSION >= 3 #define __Pyx_PyBaseString_Check(obj) PyUnicode_Check(obj) #define __Pyx_PyBaseString_CheckExact(obj) PyUnicode_CheckExact(obj) #else #define __Pyx_PyBaseString_Check(obj) (PyString_Check(obj) || PyUnicode_Check(obj)) #define __Pyx_PyBaseString_CheckExact(obj) (PyString_CheckExact(obj) || PyUnicode_CheckExact(obj)) #endif #ifndef PySet_CheckExact #define PySet_CheckExact(obj) (Py_TYPE(obj) == &PySet_Type) #endif #define __Pyx_TypeCheck(obj, type) PyObject_TypeCheck(obj, (PyTypeObject *)type) #if PY_MAJOR_VERSION >= 3 #define PyIntObject PyLongObject #define PyInt_Type PyLong_Type #define PyInt_Check(op) PyLong_Check(op) #define PyInt_CheckExact(op) PyLong_CheckExact(op) #define PyInt_FromString PyLong_FromString #define PyInt_FromUnicode PyLong_FromUnicode #define PyInt_FromLong PyLong_FromLong #define PyInt_FromSize_t PyLong_FromSize_t #define PyInt_FromSsize_t PyLong_FromSsize_t #define PyInt_AsLong PyLong_AsLong #define PyInt_AS_LONG PyLong_AS_LONG #define PyInt_AsSsize_t PyLong_AsSsize_t #define PyInt_AsUnsignedLongMask PyLong_AsUnsignedLongMask #define PyInt_AsUnsignedLongLongMask PyLong_AsUnsignedLongLongMask #define PyNumber_Int PyNumber_Long #endif #if PY_MAJOR_VERSION >= 3 #define PyBoolObject PyLongObject #endif #if PY_MAJOR_VERSION >= 3 && CYTHON_COMPILING_IN_PYPY #ifndef PyUnicode_InternFromString #define PyUnicode_InternFromString(s) PyUnicode_FromString(s) #endif #endif #if PY_VERSION_HEX < 0x030200A4 typedef long Py_hash_t; #define __Pyx_PyInt_FromHash_t PyInt_FromLong #define __Pyx_PyInt_AsHash_t PyInt_AsLong #else #define __Pyx_PyInt_FromHash_t PyInt_FromSsize_t #define __Pyx_PyInt_AsHash_t PyInt_AsSsize_t #endif #if PY_MAJOR_VERSION >= 3 #define __Pyx_PyMethod_New(func, self, klass) ((self) ? PyMethod_New(func, self) : PyInstanceMethod_New(func)) #else #define __Pyx_PyMethod_New(func, self, klass) PyMethod_New(func, self, klass) #endif #if PY_VERSION_HEX >= 0x030500B1 #define __Pyx_PyAsyncMethodsStruct PyAsyncMethods #define __Pyx_PyType_AsAsync(obj) (Py_TYPE(obj)->tp_as_async) #elif CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3 typedef struct { unaryfunc am_await; unaryfunc am_aiter; unaryfunc am_anext; } __Pyx_PyAsyncMethodsStruct; #define __Pyx_PyType_AsAsync(obj) ((__Pyx_PyAsyncMethodsStruct*) (Py_TYPE(obj)->tp_reserved)) #else #define __Pyx_PyType_AsAsync(obj) NULL #endif #ifndef CYTHON_RESTRICT #if defined(__GNUC__) #define CYTHON_RESTRICT __restrict__ #elif defined(_MSC_VER) && _MSC_VER >= 1400 #define CYTHON_RESTRICT __restrict #elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L #define CYTHON_RESTRICT restrict #else #define CYTHON_RESTRICT #endif #endif #define __Pyx_void_to_None(void_result) ((void)(void_result), Py_INCREF(Py_None), Py_None) #ifndef CYTHON_INLINE #if defined(__GNUC__) #define CYTHON_INLINE __inline__ #elif defined(_MSC_VER) #define CYTHON_INLINE __inline #elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L #define CYTHON_INLINE inline #else #define CYTHON_INLINE #endif #endif #if defined(WIN32) || defined(MS_WINDOWS) #define _USE_MATH_DEFINES #endif #include #ifdef NAN #define __PYX_NAN() ((float) NAN) #else static CYTHON_INLINE float __PYX_NAN() { float value; memset(&value, 0xFF, sizeof(value)); return value; } #endif #if PY_MAJOR_VERSION >= 3 #define __Pyx_PyNumber_Divide(x,y) PyNumber_TrueDivide(x,y) #define __Pyx_PyNumber_InPlaceDivide(x,y) PyNumber_InPlaceTrueDivide(x,y) #else #define __Pyx_PyNumber_Divide(x,y) PyNumber_Divide(x,y) #define __Pyx_PyNumber_InPlaceDivide(x,y) PyNumber_InPlaceDivide(x,y) #endif #ifndef __PYX_EXTERN_C #ifdef __cplusplus #define __PYX_EXTERN_C extern "C" #else #define __PYX_EXTERN_C extern #endif #endif #define __PYX_HAVE__pygame_sdl2__controller #define __PYX_HAVE_API__pygame_sdl2__controller #include "stdint.h" #include "string.h" #include "stdio.h" #include "stddef.h" #include "SDL.h" #ifdef _OPENMP #include #endif /* _OPENMP */ #ifdef PYREX_WITHOUT_ASSERTIONS #define CYTHON_WITHOUT_ASSERTIONS #endif #ifndef CYTHON_UNUSED # if defined(__GNUC__) # if !(defined(__cplusplus)) || (__GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 4)) # define CYTHON_UNUSED __attribute__ ((__unused__)) # else # define CYTHON_UNUSED # endif # elif defined(__ICC) || (defined(__INTEL_COMPILER) && !defined(_MSC_VER)) # define CYTHON_UNUSED __attribute__ ((__unused__)) # else # define CYTHON_UNUSED # endif #endif #ifndef CYTHON_NCP_UNUSED # if CYTHON_COMPILING_IN_CPYTHON # define CYTHON_NCP_UNUSED # else # define CYTHON_NCP_UNUSED CYTHON_UNUSED # endif #endif typedef struct {PyObject **p; char *s; const Py_ssize_t n; const char* encoding; const char is_unicode; const char is_str; const char intern; } __Pyx_StringTabEntry; #define __PYX_DEFAULT_STRING_ENCODING_IS_ASCII 0 #define __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT 0 #define __PYX_DEFAULT_STRING_ENCODING "" #define __Pyx_PyObject_FromString __Pyx_PyBytes_FromString #define __Pyx_PyObject_FromStringAndSize __Pyx_PyBytes_FromStringAndSize #define __Pyx_uchar_cast(c) ((unsigned char)c) #define __Pyx_long_cast(x) ((long)x) #define __Pyx_fits_Py_ssize_t(v, type, is_signed) (\ (sizeof(type) < sizeof(Py_ssize_t)) ||\ (sizeof(type) > sizeof(Py_ssize_t) &&\ likely(v < (type)PY_SSIZE_T_MAX ||\ v == (type)PY_SSIZE_T_MAX) &&\ (!is_signed || likely(v > (type)PY_SSIZE_T_MIN ||\ v == (type)PY_SSIZE_T_MIN))) ||\ (sizeof(type) == sizeof(Py_ssize_t) &&\ (is_signed || likely(v < (type)PY_SSIZE_T_MAX ||\ v == (type)PY_SSIZE_T_MAX))) ) #if defined (__cplusplus) && __cplusplus >= 201103L #include #define __Pyx_sst_abs(value) std::abs(value) #elif SIZEOF_INT >= SIZEOF_SIZE_T #define __Pyx_sst_abs(value) abs(value) #elif SIZEOF_LONG >= SIZEOF_SIZE_T #define __Pyx_sst_abs(value) labs(value) #elif defined (_MSC_VER) && defined (_M_X64) #define __Pyx_sst_abs(value) _abs64(value) #elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L #define __Pyx_sst_abs(value) llabs(value) #elif defined (__GNUC__) #define __Pyx_sst_abs(value) __builtin_llabs(value) #else #define __Pyx_sst_abs(value) ((value<0) ? -value : value) #endif static CYTHON_INLINE char* __Pyx_PyObject_AsString(PyObject*); static CYTHON_INLINE char* __Pyx_PyObject_AsStringAndSize(PyObject*, Py_ssize_t* length); #define __Pyx_PyByteArray_FromString(s) PyByteArray_FromStringAndSize((const char*)s, strlen((const char*)s)) #define __Pyx_PyByteArray_FromStringAndSize(s, l) PyByteArray_FromStringAndSize((const char*)s, l) #define __Pyx_PyBytes_FromString PyBytes_FromString #define __Pyx_PyBytes_FromStringAndSize PyBytes_FromStringAndSize static CYTHON_INLINE PyObject* __Pyx_PyUnicode_FromString(const char*); #if PY_MAJOR_VERSION < 3 #define __Pyx_PyStr_FromString __Pyx_PyBytes_FromString #define __Pyx_PyStr_FromStringAndSize __Pyx_PyBytes_FromStringAndSize #else #define __Pyx_PyStr_FromString __Pyx_PyUnicode_FromString #define __Pyx_PyStr_FromStringAndSize __Pyx_PyUnicode_FromStringAndSize #endif #define __Pyx_PyObject_AsSString(s) ((signed char*) __Pyx_PyObject_AsString(s)) #define __Pyx_PyObject_AsUString(s) ((unsigned char*) __Pyx_PyObject_AsString(s)) #define __Pyx_PyObject_FromCString(s) __Pyx_PyObject_FromString((const char*)s) #define __Pyx_PyBytes_FromCString(s) __Pyx_PyBytes_FromString((const char*)s) #define __Pyx_PyByteArray_FromCString(s) __Pyx_PyByteArray_FromString((const char*)s) #define __Pyx_PyStr_FromCString(s) __Pyx_PyStr_FromString((const char*)s) #define __Pyx_PyUnicode_FromCString(s) __Pyx_PyUnicode_FromString((const char*)s) #if PY_MAJOR_VERSION < 3 static CYTHON_INLINE size_t __Pyx_Py_UNICODE_strlen(const Py_UNICODE *u) { const Py_UNICODE *u_end = u; while (*u_end++) ; return (size_t)(u_end - u - 1); } #else #define __Pyx_Py_UNICODE_strlen Py_UNICODE_strlen #endif #define __Pyx_PyUnicode_FromUnicode(u) PyUnicode_FromUnicode(u, __Pyx_Py_UNICODE_strlen(u)) #define __Pyx_PyUnicode_FromUnicodeAndLength PyUnicode_FromUnicode #define __Pyx_PyUnicode_AsUnicode PyUnicode_AsUnicode #define __Pyx_NewRef(obj) (Py_INCREF(obj), obj) #define __Pyx_Owned_Py_None(b) __Pyx_NewRef(Py_None) #define __Pyx_PyBool_FromLong(b) ((b) ? __Pyx_NewRef(Py_True) : __Pyx_NewRef(Py_False)) static CYTHON_INLINE int __Pyx_PyObject_IsTrue(PyObject*); static CYTHON_INLINE PyObject* __Pyx_PyNumber_Int(PyObject* x); static CYTHON_INLINE Py_ssize_t __Pyx_PyIndex_AsSsize_t(PyObject*); static CYTHON_INLINE PyObject * __Pyx_PyInt_FromSize_t(size_t); #if CYTHON_COMPILING_IN_CPYTHON #define __pyx_PyFloat_AsDouble(x) (PyFloat_CheckExact(x) ? PyFloat_AS_DOUBLE(x) : PyFloat_AsDouble(x)) #else #define __pyx_PyFloat_AsDouble(x) PyFloat_AsDouble(x) #endif #define __pyx_PyFloat_AsFloat(x) ((float) __pyx_PyFloat_AsDouble(x)) #if PY_MAJOR_VERSION < 3 && __PYX_DEFAULT_STRING_ENCODING_IS_ASCII static int __Pyx_sys_getdefaultencoding_not_ascii; static int __Pyx_init_sys_getdefaultencoding_params(void) { PyObject* sys; PyObject* default_encoding = NULL; PyObject* ascii_chars_u = NULL; PyObject* ascii_chars_b = NULL; const char* default_encoding_c; sys = PyImport_ImportModule("sys"); if (!sys) goto bad; default_encoding = PyObject_CallMethod(sys, (char*) "getdefaultencoding", NULL); Py_DECREF(sys); if (!default_encoding) goto bad; default_encoding_c = PyBytes_AsString(default_encoding); if (!default_encoding_c) goto bad; if (strcmp(default_encoding_c, "ascii") == 0) { __Pyx_sys_getdefaultencoding_not_ascii = 0; } else { char ascii_chars[128]; int c; for (c = 0; c < 128; c++) { ascii_chars[c] = c; } __Pyx_sys_getdefaultencoding_not_ascii = 1; ascii_chars_u = PyUnicode_DecodeASCII(ascii_chars, 128, NULL); if (!ascii_chars_u) goto bad; ascii_chars_b = PyUnicode_AsEncodedString(ascii_chars_u, default_encoding_c, NULL); if (!ascii_chars_b || !PyBytes_Check(ascii_chars_b) || memcmp(ascii_chars, PyBytes_AS_STRING(ascii_chars_b), 128) != 0) { PyErr_Format( PyExc_ValueError, "This module compiled with c_string_encoding=ascii, but default encoding '%.200s' is not a superset of ascii.", default_encoding_c); goto bad; } Py_DECREF(ascii_chars_u); Py_DECREF(ascii_chars_b); } Py_DECREF(default_encoding); return 0; bad: Py_XDECREF(default_encoding); Py_XDECREF(ascii_chars_u); Py_XDECREF(ascii_chars_b); return -1; } #endif #if __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT && PY_MAJOR_VERSION >= 3 #define __Pyx_PyUnicode_FromStringAndSize(c_str, size) PyUnicode_DecodeUTF8(c_str, size, NULL) #else #define __Pyx_PyUnicode_FromStringAndSize(c_str, size) PyUnicode_Decode(c_str, size, __PYX_DEFAULT_STRING_ENCODING, NULL) #if __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT static char* __PYX_DEFAULT_STRING_ENCODING; static int __Pyx_init_sys_getdefaultencoding_params(void) { PyObject* sys; PyObject* default_encoding = NULL; char* default_encoding_c; sys = PyImport_ImportModule("sys"); if (!sys) goto bad; default_encoding = PyObject_CallMethod(sys, (char*) (const char*) "getdefaultencoding", NULL); Py_DECREF(sys); if (!default_encoding) goto bad; default_encoding_c = PyBytes_AsString(default_encoding); if (!default_encoding_c) goto bad; __PYX_DEFAULT_STRING_ENCODING = (char*) malloc(strlen(default_encoding_c)); if (!__PYX_DEFAULT_STRING_ENCODING) goto bad; strcpy(__PYX_DEFAULT_STRING_ENCODING, default_encoding_c); Py_DECREF(default_encoding); return 0; bad: Py_XDECREF(default_encoding); return -1; } #endif #endif /* Test for GCC > 2.95 */ #if defined(__GNUC__) && (__GNUC__ > 2 || (__GNUC__ == 2 && (__GNUC_MINOR__ > 95))) #define likely(x) __builtin_expect(!!(x), 1) #define unlikely(x) __builtin_expect(!!(x), 0) #else /* !__GNUC__ or GCC < 2.95 */ #define likely(x) (x) #define unlikely(x) (x) #endif /* __GNUC__ */ static PyObject *__pyx_m; static PyObject *__pyx_d; static PyObject *__pyx_b; static PyObject *__pyx_empty_tuple; static PyObject *__pyx_empty_bytes; static int __pyx_lineno; static int __pyx_clineno = 0; static const char * __pyx_cfilenm= __FILE__; static const char *__pyx_filename; static const char *__pyx_f[] = { "src/pygame_sdl2/controller.pyx", }; /*--- Type declarations ---*/ struct __pyx_obj_11pygame_sdl2_10controller_Controller; struct __pyx_opt_args_11pygame_sdl2_8rwobject_to_rwops; /* "pygame_sdl2/rwobject.pxd":21 * from sdl2 cimport SDL_RWops * * cdef SDL_RWops *to_rwops(filelike, mode=*) except NULL # <<<<<<<<<<<<<< * */ struct __pyx_opt_args_11pygame_sdl2_8rwobject_to_rwops { int __pyx_n; PyObject *mode; }; /* "pygame_sdl2/controller.pyx":134 * * * cdef class Controller: # <<<<<<<<<<<<<< * # Allow weak references. * cdef object __weakref__ */ struct __pyx_obj_11pygame_sdl2_10controller_Controller { PyObject_HEAD PyObject *__weakref__; SDL_GameController *controller; int index; }; /* --- Runtime support code (head) --- */ #ifndef CYTHON_REFNANNY #define CYTHON_REFNANNY 0 #endif #if CYTHON_REFNANNY typedef struct { void (*INCREF)(void*, PyObject*, int); void (*DECREF)(void*, PyObject*, int); void (*GOTREF)(void*, PyObject*, int); void (*GIVEREF)(void*, PyObject*, int); void* (*SetupContext)(const char*, int, const char*); void (*FinishContext)(void**); } __Pyx_RefNannyAPIStruct; static __Pyx_RefNannyAPIStruct *__Pyx_RefNanny = NULL; static __Pyx_RefNannyAPIStruct *__Pyx_RefNannyImportAPI(const char *modname); #define __Pyx_RefNannyDeclarations void *__pyx_refnanny = NULL; #ifdef WITH_THREAD #define __Pyx_RefNannySetupContext(name, acquire_gil)\ if (acquire_gil) {\ PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure();\ __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), __LINE__, __FILE__);\ PyGILState_Release(__pyx_gilstate_save);\ } else {\ __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), __LINE__, __FILE__);\ } #else #define __Pyx_RefNannySetupContext(name, acquire_gil)\ __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), __LINE__, __FILE__) #endif #define __Pyx_RefNannyFinishContext()\ __Pyx_RefNanny->FinishContext(&__pyx_refnanny) #define __Pyx_INCREF(r) __Pyx_RefNanny->INCREF(__pyx_refnanny, (PyObject *)(r), __LINE__) #define __Pyx_DECREF(r) __Pyx_RefNanny->DECREF(__pyx_refnanny, (PyObject *)(r), __LINE__) #define __Pyx_GOTREF(r) __Pyx_RefNanny->GOTREF(__pyx_refnanny, (PyObject *)(r), __LINE__) #define __Pyx_GIVEREF(r) __Pyx_RefNanny->GIVEREF(__pyx_refnanny, (PyObject *)(r), __LINE__) #define __Pyx_XINCREF(r) do { if((r) != NULL) {__Pyx_INCREF(r); }} while(0) #define __Pyx_XDECREF(r) do { if((r) != NULL) {__Pyx_DECREF(r); }} while(0) #define __Pyx_XGOTREF(r) do { if((r) != NULL) {__Pyx_GOTREF(r); }} while(0) #define __Pyx_XGIVEREF(r) do { if((r) != NULL) {__Pyx_GIVEREF(r);}} while(0) #else #define __Pyx_RefNannyDeclarations #define __Pyx_RefNannySetupContext(name, acquire_gil) #define __Pyx_RefNannyFinishContext() #define __Pyx_INCREF(r) Py_INCREF(r) #define __Pyx_DECREF(r) Py_DECREF(r) #define __Pyx_GOTREF(r) #define __Pyx_GIVEREF(r) #define __Pyx_XINCREF(r) Py_XINCREF(r) #define __Pyx_XDECREF(r) Py_XDECREF(r) #define __Pyx_XGOTREF(r) #define __Pyx_XGIVEREF(r) #endif #define __Pyx_XDECREF_SET(r, v) do {\ PyObject *tmp = (PyObject *) r;\ r = v; __Pyx_XDECREF(tmp);\ } while (0) #define __Pyx_DECREF_SET(r, v) do {\ PyObject *tmp = (PyObject *) r;\ r = v; __Pyx_DECREF(tmp);\ } while (0) #define __Pyx_CLEAR(r) do { PyObject* tmp = ((PyObject*)(r)); r = NULL; __Pyx_DECREF(tmp);} while(0) #define __Pyx_XCLEAR(r) do { if((r) != NULL) {PyObject* tmp = ((PyObject*)(r)); r = NULL; __Pyx_DECREF(tmp);}} while(0) #if CYTHON_COMPILING_IN_CPYTHON static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStr(PyObject* obj, PyObject* attr_name) { PyTypeObject* tp = Py_TYPE(obj); if (likely(tp->tp_getattro)) return tp->tp_getattro(obj, attr_name); #if PY_MAJOR_VERSION < 3 if (likely(tp->tp_getattr)) return tp->tp_getattr(obj, PyString_AS_STRING(attr_name)); #endif return PyObject_GetAttr(obj, attr_name); } #else #define __Pyx_PyObject_GetAttrStr(o,n) PyObject_GetAttr(o,n) #endif static PyObject *__Pyx_GetBuiltinName(PyObject *name); static CYTHON_INLINE PyObject *__Pyx_GetModuleGlobalName(PyObject *name); #if CYTHON_COMPILING_IN_CPYTHON static CYTHON_INLINE PyObject* __Pyx_PyObject_Call(PyObject *func, PyObject *arg, PyObject *kw); #else #define __Pyx_PyObject_Call(func, arg, kw) PyObject_Call(func, arg, kw) #endif #if CYTHON_COMPILING_IN_CPYTHON static CYTHON_INLINE PyObject* __Pyx_PyObject_CallMethO(PyObject *func, PyObject *arg); #endif static CYTHON_INLINE PyObject* __Pyx_PyObject_CallOneArg(PyObject *func, PyObject *arg); #if CYTHON_COMPILING_IN_CPYTHON static CYTHON_INLINE PyObject* __Pyx_PyObject_CallNoArg(PyObject *func); #else #define __Pyx_PyObject_CallNoArg(func) __Pyx_PyObject_Call(func, __pyx_empty_tuple, NULL) #endif static CYTHON_INLINE void __Pyx_ErrRestore(PyObject *type, PyObject *value, PyObject *tb); static CYTHON_INLINE void __Pyx_ErrFetch(PyObject **type, PyObject **value, PyObject **tb); static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, PyObject *cause); static void __Pyx_RaiseArgtupleInvalid(const char* func_name, int exact, Py_ssize_t num_min, Py_ssize_t num_max, Py_ssize_t num_found); static CYTHON_INLINE int __Pyx_CheckKeywordStrings(PyObject *kwdict, const char* function_name, int kw_allowed); static void __Pyx_RaiseDoubleKeywordsError(const char* func_name, PyObject* kw_name); static int __Pyx_ParseOptionalKeywords(PyObject *kwds, PyObject **argnames[],\ PyObject *kwds2, PyObject *values[], Py_ssize_t num_pos_args,\ const char* function_name); static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list, int level); static PyObject* __Pyx_ImportFrom(PyObject* module, PyObject* name); typedef struct { int code_line; PyCodeObject* code_object; } __Pyx_CodeObjectCacheEntry; struct __Pyx_CodeObjectCache { int count; int max_count; __Pyx_CodeObjectCacheEntry* entries; }; static struct __Pyx_CodeObjectCache __pyx_code_cache = {0,0,NULL}; static int __pyx_bisect_code_objects(__Pyx_CodeObjectCacheEntry* entries, int count, int code_line); static PyCodeObject *__pyx_find_code_object(int code_line); static void __pyx_insert_code_object(int code_line, PyCodeObject* code_object); static void __Pyx_AddTraceback(const char *funcname, int c_line, int py_line, const char *filename); static CYTHON_INLINE PyObject* __Pyx_PyInt_From_int(int value); static CYTHON_INLINE PyObject* __Pyx_PyInt_From_SDL_GameControllerAxis(SDL_GameControllerAxis value); static CYTHON_INLINE PyObject* __Pyx_PyInt_From_SDL_GameControllerButton(SDL_GameControllerButton value); static CYTHON_INLINE SDL_GameControllerAxis __Pyx_PyInt_As_SDL_GameControllerAxis(PyObject *); static CYTHON_INLINE SDL_GameControllerButton __Pyx_PyInt_As_SDL_GameControllerButton(PyObject *); static CYTHON_INLINE int __Pyx_PyInt_As_int(PyObject *); static CYTHON_INLINE PyObject* __Pyx_PyInt_From_int16_t(int16_t value); static CYTHON_INLINE PyObject* __Pyx_PyInt_From_uint8_t(uint8_t value); static CYTHON_INLINE PyObject* __Pyx_PyInt_From_SDL_bool(SDL_bool value); static CYTHON_INLINE PyObject* __Pyx_PyInt_From_long(long value); static CYTHON_INLINE long __Pyx_PyInt_As_long(PyObject *); static int __Pyx_check_binary_version(void); #if !defined(__Pyx_PyIdentifier_FromString) #if PY_MAJOR_VERSION < 3 #define __Pyx_PyIdentifier_FromString(s) PyString_FromString(s) #else #define __Pyx_PyIdentifier_FromString(s) PyUnicode_FromString(s) #endif #endif static PyObject *__Pyx_ImportModule(const char *name); static int __Pyx_ImportFunction(PyObject *module, const char *funcname, void (**f)(void), const char *sig); static int __Pyx_InitStrings(__Pyx_StringTabEntry *t); /* Module declarations from 'libc.stdint' */ /* Module declarations from 'libc.string' */ /* Module declarations from 'libc.stdio' */ /* Module declarations from 'libc.stddef' */ /* Module declarations from 'sdl2' */ /* Module declarations from 'pygame_sdl2.rwobject' */ static SDL_RWops *(*__pyx_f_11pygame_sdl2_8rwobject_to_rwops)(PyObject *, struct __pyx_opt_args_11pygame_sdl2_8rwobject_to_rwops *__pyx_optional_args); /*proto*/ /* Module declarations from 'pygame_sdl2.controller' */ static PyTypeObject *__pyx_ptype_11pygame_sdl2_10controller_Controller = 0; #define __Pyx_MODULE_NAME "pygame_sdl2.controller" int __pyx_module_is_main_pygame_sdl2__controller = 0; /* Implementation of 'pygame_sdl2.controller' */ static char __pyx_k_rv[] = "rv"; static char __pyx_k_axis[] = "axis"; static char __pyx_k_init[] = "init"; static char __pyx_k_main[] = "__main__"; static char __pyx_k_name[] = "name"; static char __pyx_k_quit[] = "quit"; static char __pyx_k_test[] = "__test__"; static char __pyx_k_error[] = "error"; static char __pyx_k_index[] = "index"; static char __pyx_k_rwops[] = "rwops"; static char __pyx_k_button[] = "button"; static char __pyx_k_import[] = "__import__"; static char __pyx_k_display[] = "display"; static char __pyx_k_mapping[] = "mapping"; static char __pyx_k_get_init[] = "get_init"; static char __pyx_k_get_count[] = "get_count"; static char __pyx_k_add_mapping[] = "add_mapping"; static char __pyx_k_pygame_sdl2[] = "pygame_sdl2"; static char __pyx_k_add_mappings[] = "add_mappings"; static char __pyx_k_mapping_file[] = "mapping_file"; static char __pyx_k_register_init[] = "register_init"; static char __pyx_k_register_quit[] = "register_quit"; static char __pyx_k_sdl_main_init[] = "sdl_main_init"; static char __pyx_k_pygame_sdl2_error[] = "pygame_sdl2.error"; static char __pyx_k_get_string_for_axis[] = "get_string_for_axis"; static char __pyx_k_get_axis_from_string[] = "get_axis_from_string"; static char __pyx_k_get_string_for_button[] = "get_string_for_button"; static char __pyx_k_get_button_from_string[] = "get_button_from_string"; static char __pyx_k_pygame_sdl2_controller[] = "pygame_sdl2.controller"; static char __pyx_k_controller_not_initialized[] = "controller not initialized."; static char __pyx_k_home_tom_ab_pygame_sdl2_src_pyg[] = "/home/tom/ab/pygame_sdl2/src/pygame_sdl2/controller.pyx"; static PyObject *__pyx_n_s_add_mapping; static PyObject *__pyx_n_s_add_mappings; static PyObject *__pyx_n_s_axis; static PyObject *__pyx_n_s_button; static PyObject *__pyx_kp_s_controller_not_initialized; static PyObject *__pyx_n_s_display; static PyObject *__pyx_n_s_error; static PyObject *__pyx_n_s_get_axis_from_string; static PyObject *__pyx_n_s_get_button_from_string; static PyObject *__pyx_n_s_get_count; static PyObject *__pyx_n_s_get_init; static PyObject *__pyx_n_s_get_string_for_axis; static PyObject *__pyx_n_s_get_string_for_button; static PyObject *__pyx_kp_s_home_tom_ab_pygame_sdl2_src_pyg; static PyObject *__pyx_n_s_import; static PyObject *__pyx_n_s_index; static PyObject *__pyx_n_s_init; static PyObject *__pyx_n_s_main; static PyObject *__pyx_n_s_mapping; static PyObject *__pyx_n_s_mapping_file; static PyObject *__pyx_n_s_name; static PyObject *__pyx_n_s_pygame_sdl2; static PyObject *__pyx_n_s_pygame_sdl2_controller; static PyObject *__pyx_n_s_pygame_sdl2_error; static PyObject *__pyx_n_s_quit; static PyObject *__pyx_n_s_register_init; static PyObject *__pyx_n_s_register_quit; static PyObject *__pyx_n_s_rv; static PyObject *__pyx_n_s_rwops; static PyObject *__pyx_n_s_sdl_main_init; static PyObject *__pyx_n_s_test; static PyObject *__pyx_pf_11pygame_sdl2_10controller_init(CYTHON_UNUSED PyObject *__pyx_self); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_10controller_2quit(CYTHON_UNUSED PyObject *__pyx_self); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_10controller_4get_init(CYTHON_UNUSED PyObject *__pyx_self); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_10controller_6get_count(CYTHON_UNUSED PyObject *__pyx_self); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_10controller_8add_mapping(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_mapping); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_10controller_10add_mappings(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_mapping_file); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_10controller_12get_axis_from_string(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_name); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_10controller_14get_button_from_string(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_name); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_10controller_16get_string_for_axis(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_axis); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_10controller_18get_string_for_button(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_button); /* proto */ static int __pyx_pf_11pygame_sdl2_10controller_10Controller___cinit__(struct __pyx_obj_11pygame_sdl2_10controller_Controller *__pyx_v_self); /* proto */ static int __pyx_pf_11pygame_sdl2_10controller_10Controller_2__init__(struct __pyx_obj_11pygame_sdl2_10controller_Controller *__pyx_v_self, PyObject *__pyx_v_index); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_10controller_10Controller_4init(struct __pyx_obj_11pygame_sdl2_10controller_Controller *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_10controller_10Controller_6quit(struct __pyx_obj_11pygame_sdl2_10controller_Controller *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_10controller_10Controller_8get_init(struct __pyx_obj_11pygame_sdl2_10controller_Controller *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_10controller_10Controller_10get_axis(struct __pyx_obj_11pygame_sdl2_10controller_Controller *__pyx_v_self, PyObject *__pyx_v_axis); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_10controller_10Controller_12get_button(struct __pyx_obj_11pygame_sdl2_10controller_Controller *__pyx_v_self, PyObject *__pyx_v_button); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_10controller_10Controller_14get_name(struct __pyx_obj_11pygame_sdl2_10controller_Controller *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_10controller_10Controller_16is_controller(struct __pyx_obj_11pygame_sdl2_10controller_Controller *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_10controller_10Controller_18get_guid_string(struct __pyx_obj_11pygame_sdl2_10controller_Controller *__pyx_v_self); /* proto */ static PyObject *__pyx_tp_new_11pygame_sdl2_10controller_Controller(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ static PyObject *__pyx_tuple_; static PyObject *__pyx_tuple__2; static PyObject *__pyx_tuple__7; static PyObject *__pyx_tuple__9; static PyObject *__pyx_tuple__11; static PyObject *__pyx_tuple__13; static PyObject *__pyx_tuple__15; static PyObject *__pyx_tuple__17; static PyObject *__pyx_codeobj__3; static PyObject *__pyx_codeobj__4; static PyObject *__pyx_codeobj__5; static PyObject *__pyx_codeobj__6; static PyObject *__pyx_codeobj__8; static PyObject *__pyx_codeobj__10; static PyObject *__pyx_codeobj__12; static PyObject *__pyx_codeobj__14; static PyObject *__pyx_codeobj__16; static PyObject *__pyx_codeobj__18; /* "pygame_sdl2/controller.pyx":26 * * @pygame_sdl2.register_init * def init(): # <<<<<<<<<<<<<< * """ * Initializes game controller support. */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_10controller_1init(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused); /*proto*/ static char __pyx_doc_11pygame_sdl2_10controller_init[] = "\n Initializes game controller support.\n "; static PyMethodDef __pyx_mdef_11pygame_sdl2_10controller_1init = {"init", (PyCFunction)__pyx_pw_11pygame_sdl2_10controller_1init, METH_NOARGS, __pyx_doc_11pygame_sdl2_10controller_init}; static PyObject *__pyx_pw_11pygame_sdl2_10controller_1init(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("init (wrapper)", 0); __pyx_r = __pyx_pf_11pygame_sdl2_10controller_init(__pyx_self); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_10controller_init(CYTHON_UNUSED PyObject *__pyx_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; int __pyx_t_4; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("init", 0); /* "pygame_sdl2/controller.pyx":31 * """ * * pygame_sdl2.display.sdl_main_init() # <<<<<<<<<<<<<< * * if SDL_InitSubSystem(SDL_INIT_GAMECONTROLLER): */ __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_pygame_sdl2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 31; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_display); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 31; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_sdl_main_init); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 31; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_3 = NULL; if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_2))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); if (likely(__pyx_t_3)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); } } if (__pyx_t_3) { __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 31; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } else { __pyx_t_1 = __Pyx_PyObject_CallNoArg(__pyx_t_2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 31; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "pygame_sdl2/controller.pyx":33 * pygame_sdl2.display.sdl_main_init() * * if SDL_InitSubSystem(SDL_INIT_GAMECONTROLLER): # <<<<<<<<<<<<<< * raise error() * */ __pyx_t_4 = (SDL_InitSubSystem(SDL_INIT_GAMECONTROLLER) != 0); if (__pyx_t_4) { /* "pygame_sdl2/controller.pyx":34 * * if SDL_InitSubSystem(SDL_INIT_GAMECONTROLLER): * raise error() # <<<<<<<<<<<<<< * * @pygame_sdl2.register_quit */ __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_error); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 34; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = NULL; if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_2))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); if (likely(__pyx_t_3)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); } } if (__pyx_t_3) { __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 34; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } else { __pyx_t_1 = __Pyx_PyObject_CallNoArg(__pyx_t_2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 34; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_Raise(__pyx_t_1, 0, 0, 0); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; {__pyx_filename = __pyx_f[0]; __pyx_lineno = 34; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "pygame_sdl2/controller.pyx":33 * pygame_sdl2.display.sdl_main_init() * * if SDL_InitSubSystem(SDL_INIT_GAMECONTROLLER): # <<<<<<<<<<<<<< * raise error() * */ } /* "pygame_sdl2/controller.pyx":26 * * @pygame_sdl2.register_init * def init(): # <<<<<<<<<<<<<< * """ * Initializes game controller support. */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("pygame_sdl2.controller.init", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/controller.pyx":37 * * @pygame_sdl2.register_quit * def quit(): # @ReservedAssignment # <<<<<<<<<<<<<< * """ * Shuts down game controller support. */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_10controller_3quit(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused); /*proto*/ static char __pyx_doc_11pygame_sdl2_10controller_2quit[] = "\n Shuts down game controller support.\n "; static PyMethodDef __pyx_mdef_11pygame_sdl2_10controller_3quit = {"quit", (PyCFunction)__pyx_pw_11pygame_sdl2_10controller_3quit, METH_NOARGS, __pyx_doc_11pygame_sdl2_10controller_2quit}; static PyObject *__pyx_pw_11pygame_sdl2_10controller_3quit(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("quit (wrapper)", 0); __pyx_r = __pyx_pf_11pygame_sdl2_10controller_2quit(__pyx_self); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_10controller_2quit(CYTHON_UNUSED PyObject *__pyx_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("quit", 0); /* "pygame_sdl2/controller.pyx":42 * """ * * SDL_QuitSubSystem(SDL_INIT_GAMECONTROLLER) # <<<<<<<<<<<<<< * * def get_init(): */ SDL_QuitSubSystem(SDL_INIT_GAMECONTROLLER); /* "pygame_sdl2/controller.pyx":37 * * @pygame_sdl2.register_quit * def quit(): # @ReservedAssignment # <<<<<<<<<<<<<< * """ * Shuts down game controller support. */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/controller.pyx":44 * SDL_QuitSubSystem(SDL_INIT_GAMECONTROLLER) * * def get_init(): # <<<<<<<<<<<<<< * """ * Returns true if game controller support has been initialized. */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_10controller_5get_init(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused); /*proto*/ static char __pyx_doc_11pygame_sdl2_10controller_4get_init[] = "\n Returns true if game controller support has been initialized.\n "; static PyMethodDef __pyx_mdef_11pygame_sdl2_10controller_5get_init = {"get_init", (PyCFunction)__pyx_pw_11pygame_sdl2_10controller_5get_init, METH_NOARGS, __pyx_doc_11pygame_sdl2_10controller_4get_init}; static PyObject *__pyx_pw_11pygame_sdl2_10controller_5get_init(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("get_init (wrapper)", 0); __pyx_r = __pyx_pf_11pygame_sdl2_10controller_4get_init(__pyx_self); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_10controller_4get_init(CYTHON_UNUSED PyObject *__pyx_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("get_init", 0); /* "pygame_sdl2/controller.pyx":49 * """ * * return SDL_WasInit(SDL_INIT_GAMECONTROLLER) != 0 # <<<<<<<<<<<<<< * * def get_count(): */ __Pyx_XDECREF(__pyx_r); __pyx_t_1 = __Pyx_PyBool_FromLong((SDL_WasInit(SDL_INIT_GAMECONTROLLER) != 0)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 49; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "pygame_sdl2/controller.pyx":44 * SDL_QuitSubSystem(SDL_INIT_GAMECONTROLLER) * * def get_init(): # <<<<<<<<<<<<<< * """ * Returns true if game controller support has been initialized. */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("pygame_sdl2.controller.get_init", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/controller.pyx":51 * return SDL_WasInit(SDL_INIT_GAMECONTROLLER) != 0 * * def get_count(): # <<<<<<<<<<<<<< * """ * Returns the number of joysticks and game controllers connected to the */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_10controller_7get_count(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused); /*proto*/ static char __pyx_doc_11pygame_sdl2_10controller_6get_count[] = "\n Returns the number of joysticks and game controllers connected to the\n system. This is one more than the maximum index that can be passed to\n Controller. While every game controller is a joystick, not every joystick\n is a game controller. To check that index `i` corresponds to a game\n controller, use code such as::\n\n if pygame_sdl2.controller.Controller(i).is_controller():\n ...\n "; static PyMethodDef __pyx_mdef_11pygame_sdl2_10controller_7get_count = {"get_count", (PyCFunction)__pyx_pw_11pygame_sdl2_10controller_7get_count, METH_NOARGS, __pyx_doc_11pygame_sdl2_10controller_6get_count}; static PyObject *__pyx_pw_11pygame_sdl2_10controller_7get_count(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("get_count (wrapper)", 0); __pyx_r = __pyx_pf_11pygame_sdl2_10controller_6get_count(__pyx_self); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_10controller_6get_count(CYTHON_UNUSED PyObject *__pyx_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("get_count", 0); /* "pygame_sdl2/controller.pyx":63 * """ * * return SDL_NumJoysticks() # <<<<<<<<<<<<<< * * */ __Pyx_XDECREF(__pyx_r); __pyx_t_1 = __Pyx_PyInt_From_int(SDL_NumJoysticks()); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 63; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "pygame_sdl2/controller.pyx":51 * return SDL_WasInit(SDL_INIT_GAMECONTROLLER) != 0 * * def get_count(): # <<<<<<<<<<<<<< * """ * Returns the number of joysticks and game controllers connected to the */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("pygame_sdl2.controller.get_count", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/controller.pyx":66 * * * def add_mapping(mapping): # <<<<<<<<<<<<<< * """ * Adds a game controller mapping from the string in `mapping`. */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_10controller_9add_mapping(PyObject *__pyx_self, PyObject *__pyx_v_mapping); /*proto*/ static char __pyx_doc_11pygame_sdl2_10controller_8add_mapping[] = "\n Adds a game controller mapping from the string in `mapping`.\n "; static PyMethodDef __pyx_mdef_11pygame_sdl2_10controller_9add_mapping = {"add_mapping", (PyCFunction)__pyx_pw_11pygame_sdl2_10controller_9add_mapping, METH_O, __pyx_doc_11pygame_sdl2_10controller_8add_mapping}; static PyObject *__pyx_pw_11pygame_sdl2_10controller_9add_mapping(PyObject *__pyx_self, PyObject *__pyx_v_mapping) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("add_mapping (wrapper)", 0); __pyx_r = __pyx_pf_11pygame_sdl2_10controller_8add_mapping(__pyx_self, ((PyObject *)__pyx_v_mapping)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_10controller_8add_mapping(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_mapping) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations char const *__pyx_t_1; int __pyx_t_2; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; PyObject *__pyx_t_5 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("add_mapping", 0); /* "pygame_sdl2/controller.pyx":71 * """ * * if SDL_GameControllerAddMapping(mapping) == -1: # <<<<<<<<<<<<<< * raise error() * */ __pyx_t_1 = __Pyx_PyObject_AsString(__pyx_v_mapping); if (unlikely((!__pyx_t_1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 71; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_t_2 = ((SDL_GameControllerAddMapping(__pyx_t_1) == -1L) != 0); if (__pyx_t_2) { /* "pygame_sdl2/controller.pyx":72 * * if SDL_GameControllerAddMapping(mapping) == -1: * raise error() # <<<<<<<<<<<<<< * * def add_mappings(mapping_file): */ __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_error); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 72; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); __pyx_t_5 = NULL; if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_4))) { __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4); if (likely(__pyx_t_5)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4); __Pyx_INCREF(__pyx_t_5); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_4, function); } } if (__pyx_t_5) { __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_5); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 72; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; } else { __pyx_t_3 = __Pyx_PyObject_CallNoArg(__pyx_t_4); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 72; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_Raise(__pyx_t_3, 0, 0, 0); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; {__pyx_filename = __pyx_f[0]; __pyx_lineno = 72; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "pygame_sdl2/controller.pyx":71 * """ * * if SDL_GameControllerAddMapping(mapping) == -1: # <<<<<<<<<<<<<< * raise error() * */ } /* "pygame_sdl2/controller.pyx":66 * * * def add_mapping(mapping): # <<<<<<<<<<<<<< * """ * Adds a game controller mapping from the string in `mapping`. */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_5); __Pyx_AddTraceback("pygame_sdl2.controller.add_mapping", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/controller.pyx":74 * raise error() * * def add_mappings(mapping_file): # <<<<<<<<<<<<<< * """ * Adds game controller mappings from `mapping_file`, which can be a string */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_10controller_11add_mappings(PyObject *__pyx_self, PyObject *__pyx_v_mapping_file); /*proto*/ static char __pyx_doc_11pygame_sdl2_10controller_10add_mappings[] = "\n Adds game controller mappings from `mapping_file`, which can be a string\n filename or a file-like object. This file should be gamecontrollerdb.txt,\n downloaded from:\n\n https://raw.githubusercontent.com/gabomdq/SDL_GameControllerDB/master/gamecontrollerdb.txt\n\n This should be called before creating a Controller object. It can be called\n multiple times to add multiple database files.\n "; static PyMethodDef __pyx_mdef_11pygame_sdl2_10controller_11add_mappings = {"add_mappings", (PyCFunction)__pyx_pw_11pygame_sdl2_10controller_11add_mappings, METH_O, __pyx_doc_11pygame_sdl2_10controller_10add_mappings}; static PyObject *__pyx_pw_11pygame_sdl2_10controller_11add_mappings(PyObject *__pyx_self, PyObject *__pyx_v_mapping_file) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("add_mappings (wrapper)", 0); __pyx_r = __pyx_pf_11pygame_sdl2_10controller_10add_mappings(__pyx_self, ((PyObject *)__pyx_v_mapping_file)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_10controller_10add_mappings(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_mapping_file) { SDL_RWops *__pyx_v_rwops; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations SDL_RWops *__pyx_t_1; int __pyx_t_2; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; PyObject *__pyx_t_5 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("add_mappings", 0); /* "pygame_sdl2/controller.pyx":86 * """ * * cdef SDL_RWops *rwops = to_rwops(mapping_file) # <<<<<<<<<<<<<< * * if SDL_GameControllerAddMappingsFromRW(rwops, 1) == -1: */ __pyx_t_1 = __pyx_f_11pygame_sdl2_8rwobject_to_rwops(__pyx_v_mapping_file, NULL); if (unlikely(__pyx_t_1 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 86; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_v_rwops = __pyx_t_1; /* "pygame_sdl2/controller.pyx":88 * cdef SDL_RWops *rwops = to_rwops(mapping_file) * * if SDL_GameControllerAddMappingsFromRW(rwops, 1) == -1: # <<<<<<<<<<<<<< * raise error() * */ __pyx_t_2 = ((SDL_GameControllerAddMappingsFromRW(__pyx_v_rwops, 1) == -1L) != 0); if (__pyx_t_2) { /* "pygame_sdl2/controller.pyx":89 * * if SDL_GameControllerAddMappingsFromRW(rwops, 1) == -1: * raise error() # <<<<<<<<<<<<<< * * def get_axis_from_string(name): */ __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_error); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 89; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); __pyx_t_5 = NULL; if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_4))) { __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4); if (likely(__pyx_t_5)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4); __Pyx_INCREF(__pyx_t_5); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_4, function); } } if (__pyx_t_5) { __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_5); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 89; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; } else { __pyx_t_3 = __Pyx_PyObject_CallNoArg(__pyx_t_4); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 89; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_Raise(__pyx_t_3, 0, 0, 0); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; {__pyx_filename = __pyx_f[0]; __pyx_lineno = 89; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "pygame_sdl2/controller.pyx":88 * cdef SDL_RWops *rwops = to_rwops(mapping_file) * * if SDL_GameControllerAddMappingsFromRW(rwops, 1) == -1: # <<<<<<<<<<<<<< * raise error() * */ } /* "pygame_sdl2/controller.pyx":74 * raise error() * * def add_mappings(mapping_file): # <<<<<<<<<<<<<< * """ * Adds game controller mappings from `mapping_file`, which can be a string */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_5); __Pyx_AddTraceback("pygame_sdl2.controller.add_mappings", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/controller.pyx":91 * raise error() * * def get_axis_from_string(name): # <<<<<<<<<<<<<< * """ * Returns the axis number of the controller axis with `name`, or */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_10controller_13get_axis_from_string(PyObject *__pyx_self, PyObject *__pyx_v_name); /*proto*/ static char __pyx_doc_11pygame_sdl2_10controller_12get_axis_from_string[] = "\n Returns the axis number of the controller axis with `name`, or\n pygame.CONTROLLER_AXIS_INVALID if `name` is not known.\n "; static PyMethodDef __pyx_mdef_11pygame_sdl2_10controller_13get_axis_from_string = {"get_axis_from_string", (PyCFunction)__pyx_pw_11pygame_sdl2_10controller_13get_axis_from_string, METH_O, __pyx_doc_11pygame_sdl2_10controller_12get_axis_from_string}; static PyObject *__pyx_pw_11pygame_sdl2_10controller_13get_axis_from_string(PyObject *__pyx_self, PyObject *__pyx_v_name) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("get_axis_from_string (wrapper)", 0); __pyx_r = __pyx_pf_11pygame_sdl2_10controller_12get_axis_from_string(__pyx_self, ((PyObject *)__pyx_v_name)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_10controller_12get_axis_from_string(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_name) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations char const *__pyx_t_1; PyObject *__pyx_t_2 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("get_axis_from_string", 0); /* "pygame_sdl2/controller.pyx":97 * """ * * return SDL_GameControllerGetAxisFromString(name) # <<<<<<<<<<<<<< * * def get_button_from_string(name): */ __Pyx_XDECREF(__pyx_r); __pyx_t_1 = __Pyx_PyObject_AsString(__pyx_v_name); if (unlikely((!__pyx_t_1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 97; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_t_2 = __Pyx_PyInt_From_SDL_GameControllerAxis(SDL_GameControllerGetAxisFromString(__pyx_t_1)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 97; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; /* "pygame_sdl2/controller.pyx":91 * raise error() * * def get_axis_from_string(name): # <<<<<<<<<<<<<< * """ * Returns the axis number of the controller axis with `name`, or */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_AddTraceback("pygame_sdl2.controller.get_axis_from_string", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/controller.pyx":99 * return SDL_GameControllerGetAxisFromString(name) * * def get_button_from_string(name): # <<<<<<<<<<<<<< * """ * Returns the button number of the controller button with `name`, or */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_10controller_15get_button_from_string(PyObject *__pyx_self, PyObject *__pyx_v_name); /*proto*/ static char __pyx_doc_11pygame_sdl2_10controller_14get_button_from_string[] = "\n Returns the button number of the controller button with `name`, or\n pygame.CONTROLLER_BUTTON_INVALID if `name` is not known.\n "; static PyMethodDef __pyx_mdef_11pygame_sdl2_10controller_15get_button_from_string = {"get_button_from_string", (PyCFunction)__pyx_pw_11pygame_sdl2_10controller_15get_button_from_string, METH_O, __pyx_doc_11pygame_sdl2_10controller_14get_button_from_string}; static PyObject *__pyx_pw_11pygame_sdl2_10controller_15get_button_from_string(PyObject *__pyx_self, PyObject *__pyx_v_name) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("get_button_from_string (wrapper)", 0); __pyx_r = __pyx_pf_11pygame_sdl2_10controller_14get_button_from_string(__pyx_self, ((PyObject *)__pyx_v_name)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_10controller_14get_button_from_string(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_name) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations char const *__pyx_t_1; PyObject *__pyx_t_2 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("get_button_from_string", 0); /* "pygame_sdl2/controller.pyx":105 * """ * * return SDL_GameControllerGetButtonFromString(name) # <<<<<<<<<<<<<< * * def get_string_for_axis(axis): */ __Pyx_XDECREF(__pyx_r); __pyx_t_1 = __Pyx_PyObject_AsString(__pyx_v_name); if (unlikely((!__pyx_t_1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 105; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_t_2 = __Pyx_PyInt_From_SDL_GameControllerButton(SDL_GameControllerGetButtonFromString(__pyx_t_1)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 105; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; /* "pygame_sdl2/controller.pyx":99 * return SDL_GameControllerGetAxisFromString(name) * * def get_button_from_string(name): # <<<<<<<<<<<<<< * """ * Returns the button number of the controller button with `name`, or */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_AddTraceback("pygame_sdl2.controller.get_button_from_string", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/controller.pyx":107 * return SDL_GameControllerGetButtonFromString(name) * * def get_string_for_axis(axis): # <<<<<<<<<<<<<< * """ * Returns a string describing the controller axis `axis`, which must be */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_10controller_17get_string_for_axis(PyObject *__pyx_self, PyObject *__pyx_v_axis); /*proto*/ static char __pyx_doc_11pygame_sdl2_10controller_16get_string_for_axis[] = "\n Returns a string describing the controller axis `axis`, which must be\n an integer. Returns None if the axis is not known.\n "; static PyMethodDef __pyx_mdef_11pygame_sdl2_10controller_17get_string_for_axis = {"get_string_for_axis", (PyCFunction)__pyx_pw_11pygame_sdl2_10controller_17get_string_for_axis, METH_O, __pyx_doc_11pygame_sdl2_10controller_16get_string_for_axis}; static PyObject *__pyx_pw_11pygame_sdl2_10controller_17get_string_for_axis(PyObject *__pyx_self, PyObject *__pyx_v_axis) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("get_string_for_axis (wrapper)", 0); __pyx_r = __pyx_pf_11pygame_sdl2_10controller_16get_string_for_axis(__pyx_self, ((PyObject *)__pyx_v_axis)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_10controller_16get_string_for_axis(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_axis) { char const *__pyx_v_rv; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations SDL_GameControllerAxis __pyx_t_1; int __pyx_t_2; PyObject *__pyx_t_3 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("get_string_for_axis", 0); /* "pygame_sdl2/controller.pyx":113 * """ * * cdef const char *rv = SDL_GameControllerGetStringForAxis(axis) # <<<<<<<<<<<<<< * * if rv != NULL: */ __pyx_t_1 = ((SDL_GameControllerAxis)__Pyx_PyInt_As_SDL_GameControllerAxis(__pyx_v_axis)); if (unlikely(PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 113; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_v_rv = SDL_GameControllerGetStringForAxis(__pyx_t_1); /* "pygame_sdl2/controller.pyx":115 * cdef const char *rv = SDL_GameControllerGetStringForAxis(axis) * * if rv != NULL: # <<<<<<<<<<<<<< * return rv * else: */ __pyx_t_2 = ((__pyx_v_rv != NULL) != 0); if (__pyx_t_2) { /* "pygame_sdl2/controller.pyx":116 * * if rv != NULL: * return rv # <<<<<<<<<<<<<< * else: * return None */ __Pyx_XDECREF(__pyx_r); __pyx_t_3 = __Pyx_PyBytes_FromString(__pyx_v_rv); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 116; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __pyx_r = __pyx_t_3; __pyx_t_3 = 0; goto __pyx_L0; /* "pygame_sdl2/controller.pyx":115 * cdef const char *rv = SDL_GameControllerGetStringForAxis(axis) * * if rv != NULL: # <<<<<<<<<<<<<< * return rv * else: */ } /* "pygame_sdl2/controller.pyx":118 * return rv * else: * return None # <<<<<<<<<<<<<< * * def get_string_for_button(button): */ /*else*/ { __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(Py_None); __pyx_r = Py_None; goto __pyx_L0; } /* "pygame_sdl2/controller.pyx":107 * return SDL_GameControllerGetButtonFromString(name) * * def get_string_for_axis(axis): # <<<<<<<<<<<<<< * """ * Returns a string describing the controller axis `axis`, which must be */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("pygame_sdl2.controller.get_string_for_axis", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/controller.pyx":120 * return None * * def get_string_for_button(button): # <<<<<<<<<<<<<< * """ * Returns a string describing the controller button `button`, which must be */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_10controller_19get_string_for_button(PyObject *__pyx_self, PyObject *__pyx_v_button); /*proto*/ static char __pyx_doc_11pygame_sdl2_10controller_18get_string_for_button[] = "\n Returns a string describing the controller button `button`, which must be\n an integer. Returns None if the button is not known.\n "; static PyMethodDef __pyx_mdef_11pygame_sdl2_10controller_19get_string_for_button = {"get_string_for_button", (PyCFunction)__pyx_pw_11pygame_sdl2_10controller_19get_string_for_button, METH_O, __pyx_doc_11pygame_sdl2_10controller_18get_string_for_button}; static PyObject *__pyx_pw_11pygame_sdl2_10controller_19get_string_for_button(PyObject *__pyx_self, PyObject *__pyx_v_button) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("get_string_for_button (wrapper)", 0); __pyx_r = __pyx_pf_11pygame_sdl2_10controller_18get_string_for_button(__pyx_self, ((PyObject *)__pyx_v_button)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_10controller_18get_string_for_button(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_button) { char const *__pyx_v_rv; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations SDL_GameControllerButton __pyx_t_1; int __pyx_t_2; PyObject *__pyx_t_3 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("get_string_for_button", 0); /* "pygame_sdl2/controller.pyx":126 * """ * * cdef const char *rv = SDL_GameControllerGetStringForButton(button) # <<<<<<<<<<<<<< * * if rv != NULL: */ __pyx_t_1 = ((SDL_GameControllerButton)__Pyx_PyInt_As_SDL_GameControllerButton(__pyx_v_button)); if (unlikely(PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 126; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_v_rv = SDL_GameControllerGetStringForButton(__pyx_t_1); /* "pygame_sdl2/controller.pyx":128 * cdef const char *rv = SDL_GameControllerGetStringForButton(button) * * if rv != NULL: # <<<<<<<<<<<<<< * return rv * else: */ __pyx_t_2 = ((__pyx_v_rv != NULL) != 0); if (__pyx_t_2) { /* "pygame_sdl2/controller.pyx":129 * * if rv != NULL: * return rv # <<<<<<<<<<<<<< * else: * return None */ __Pyx_XDECREF(__pyx_r); __pyx_t_3 = __Pyx_PyBytes_FromString(__pyx_v_rv); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 129; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __pyx_r = __pyx_t_3; __pyx_t_3 = 0; goto __pyx_L0; /* "pygame_sdl2/controller.pyx":128 * cdef const char *rv = SDL_GameControllerGetStringForButton(button) * * if rv != NULL: # <<<<<<<<<<<<<< * return rv * else: */ } /* "pygame_sdl2/controller.pyx":131 * return rv * else: * return None # <<<<<<<<<<<<<< * * */ /*else*/ { __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(Py_None); __pyx_r = Py_None; goto __pyx_L0; } /* "pygame_sdl2/controller.pyx":120 * return None * * def get_string_for_button(button): # <<<<<<<<<<<<<< * """ * Returns a string describing the controller button `button`, which must be */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("pygame_sdl2.controller.get_string_for_button", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/controller.pyx":141 * cdef int index * * def __cinit__(self): # <<<<<<<<<<<<<< * self.controller = NULL * */ /* Python wrapper */ static int __pyx_pw_11pygame_sdl2_10controller_10Controller_1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static int __pyx_pw_11pygame_sdl2_10controller_10Controller_1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__cinit__ (wrapper)", 0); if (unlikely(PyTuple_GET_SIZE(__pyx_args) > 0)) { __Pyx_RaiseArgtupleInvalid("__cinit__", 1, 0, 0, PyTuple_GET_SIZE(__pyx_args)); return -1;} if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "__cinit__", 0))) return -1; __pyx_r = __pyx_pf_11pygame_sdl2_10controller_10Controller___cinit__(((struct __pyx_obj_11pygame_sdl2_10controller_Controller *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static int __pyx_pf_11pygame_sdl2_10controller_10Controller___cinit__(struct __pyx_obj_11pygame_sdl2_10controller_Controller *__pyx_v_self) { int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__cinit__", 0); /* "pygame_sdl2/controller.pyx":142 * * def __cinit__(self): * self.controller = NULL # <<<<<<<<<<<<<< * * def __init__(self, index): */ __pyx_v_self->controller = NULL; /* "pygame_sdl2/controller.pyx":141 * cdef int index * * def __cinit__(self): # <<<<<<<<<<<<<< * self.controller = NULL * */ /* function exit code */ __pyx_r = 0; __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/controller.pyx":144 * self.controller = NULL * * def __init__(self, index): # <<<<<<<<<<<<<< * """ * Represents a game controller object corresponding to the joystick */ /* Python wrapper */ static int __pyx_pw_11pygame_sdl2_10controller_10Controller_3__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_11pygame_sdl2_10controller_10Controller_2__init__[] = "\n Represents a game controller object corresponding to the joystick\n with `index`.\n "; #if CYTHON_COMPILING_IN_CPYTHON struct wrapperbase __pyx_wrapperbase_11pygame_sdl2_10controller_10Controller_2__init__; #endif static int __pyx_pw_11pygame_sdl2_10controller_10Controller_3__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_index = 0; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__init__ (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_index,0}; PyObject* values[1] = {0}; if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_index)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__init__") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 144; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } } else if (PyTuple_GET_SIZE(__pyx_args) != 1) { goto __pyx_L5_argtuple_error; } else { values[0] = PyTuple_GET_ITEM(__pyx_args, 0); } __pyx_v_index = values[0]; } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("__init__", 1, 1, 1, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 144; __pyx_clineno = __LINE__; goto __pyx_L3_error;} __pyx_L3_error:; __Pyx_AddTraceback("pygame_sdl2.controller.Controller.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return -1; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_11pygame_sdl2_10controller_10Controller_2__init__(((struct __pyx_obj_11pygame_sdl2_10controller_Controller *)__pyx_v_self), __pyx_v_index); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static int __pyx_pf_11pygame_sdl2_10controller_10Controller_2__init__(struct __pyx_obj_11pygame_sdl2_10controller_Controller *__pyx_v_self, PyObject *__pyx_v_index) { int __pyx_r; __Pyx_RefNannyDeclarations int __pyx_t_1; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__init__", 0); /* "pygame_sdl2/controller.pyx":150 * """ * * self.index = index # <<<<<<<<<<<<<< * * def init(self): */ __pyx_t_1 = __Pyx_PyInt_As_int(__pyx_v_index); if (unlikely((__pyx_t_1 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 150; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_v_self->index = __pyx_t_1; /* "pygame_sdl2/controller.pyx":144 * self.controller = NULL * * def __init__(self, index): # <<<<<<<<<<<<<< * """ * Represents a game controller object corresponding to the joystick */ /* function exit code */ __pyx_r = 0; goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("pygame_sdl2.controller.Controller.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = -1; __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/controller.pyx":152 * self.index = index * * def init(self): # <<<<<<<<<<<<<< * """ * Opens the game controller, causing it to begin sending events. */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_10controller_10Controller_5init(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/ static char __pyx_doc_11pygame_sdl2_10controller_10Controller_4init[] = "\n Opens the game controller, causing it to begin sending events.\n "; static PyObject *__pyx_pw_11pygame_sdl2_10controller_10Controller_5init(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("init (wrapper)", 0); __pyx_r = __pyx_pf_11pygame_sdl2_10controller_10Controller_4init(((struct __pyx_obj_11pygame_sdl2_10controller_Controller *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_10controller_10Controller_4init(struct __pyx_obj_11pygame_sdl2_10controller_Controller *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("init", 0); /* "pygame_sdl2/controller.pyx":157 * """ * * if self.controller == NULL: # <<<<<<<<<<<<<< * self.controller = SDL_GameControllerOpen(self.index) * if self.controller == NULL: */ __pyx_t_1 = ((__pyx_v_self->controller == NULL) != 0); if (__pyx_t_1) { /* "pygame_sdl2/controller.pyx":158 * * if self.controller == NULL: * self.controller = SDL_GameControllerOpen(self.index) # <<<<<<<<<<<<<< * if self.controller == NULL: * raise error() */ __pyx_v_self->controller = SDL_GameControllerOpen(__pyx_v_self->index); /* "pygame_sdl2/controller.pyx":159 * if self.controller == NULL: * self.controller = SDL_GameControllerOpen(self.index) * if self.controller == NULL: # <<<<<<<<<<<<<< * raise error() * */ __pyx_t_1 = ((__pyx_v_self->controller == NULL) != 0); if (__pyx_t_1) { /* "pygame_sdl2/controller.pyx":160 * self.controller = SDL_GameControllerOpen(self.index) * if self.controller == NULL: * raise error() # <<<<<<<<<<<<<< * * def quit(self): # @ReservedAssignment */ __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_error); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 160; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = NULL; if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_3))) { __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3); if (likely(__pyx_t_4)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); __Pyx_INCREF(__pyx_t_4); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_3, function); } } if (__pyx_t_4) { __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 160; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; } else { __pyx_t_2 = __Pyx_PyObject_CallNoArg(__pyx_t_3); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 160; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_Raise(__pyx_t_2, 0, 0, 0); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; {__pyx_filename = __pyx_f[0]; __pyx_lineno = 160; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "pygame_sdl2/controller.pyx":159 * if self.controller == NULL: * self.controller = SDL_GameControllerOpen(self.index) * if self.controller == NULL: # <<<<<<<<<<<<<< * raise error() * */ } /* "pygame_sdl2/controller.pyx":157 * """ * * if self.controller == NULL: # <<<<<<<<<<<<<< * self.controller = SDL_GameControllerOpen(self.index) * if self.controller == NULL: */ } /* "pygame_sdl2/controller.pyx":152 * self.index = index * * def init(self): # <<<<<<<<<<<<<< * """ * Opens the game controller, causing it to begin sending events. */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_AddTraceback("pygame_sdl2.controller.Controller.init", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/controller.pyx":162 * raise error() * * def quit(self): # @ReservedAssignment # <<<<<<<<<<<<<< * """ * Closes the game controller, preventing it from sending events. */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_10controller_10Controller_7quit(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/ static char __pyx_doc_11pygame_sdl2_10controller_10Controller_6quit[] = "\n Closes the game controller, preventing it from sending events.\n "; static PyObject *__pyx_pw_11pygame_sdl2_10controller_10Controller_7quit(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("quit (wrapper)", 0); __pyx_r = __pyx_pf_11pygame_sdl2_10controller_10Controller_6quit(((struct __pyx_obj_11pygame_sdl2_10controller_Controller *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_10controller_10Controller_6quit(struct __pyx_obj_11pygame_sdl2_10controller_Controller *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; int __pyx_t_2; SDL_bool __pyx_t_3; __Pyx_RefNannySetupContext("quit", 0); /* "pygame_sdl2/controller.pyx":167 * """ * * if self.controller and SDL_GameControllerGetAttached(self.controller): # <<<<<<<<<<<<<< * SDL_GameControllerClose(self.controller) * self.controller = NULL */ __pyx_t_2 = (__pyx_v_self->controller != 0); if (__pyx_t_2) { } else { __pyx_t_1 = __pyx_t_2; goto __pyx_L4_bool_binop_done; } __pyx_t_3 = SDL_GameControllerGetAttached(__pyx_v_self->controller); __pyx_t_1 = __pyx_t_3; __pyx_L4_bool_binop_done:; if (__pyx_t_1) { /* "pygame_sdl2/controller.pyx":168 * * if self.controller and SDL_GameControllerGetAttached(self.controller): * SDL_GameControllerClose(self.controller) # <<<<<<<<<<<<<< * self.controller = NULL * */ SDL_GameControllerClose(__pyx_v_self->controller); /* "pygame_sdl2/controller.pyx":169 * if self.controller and SDL_GameControllerGetAttached(self.controller): * SDL_GameControllerClose(self.controller) * self.controller = NULL # <<<<<<<<<<<<<< * * def get_init(self): */ __pyx_v_self->controller = NULL; /* "pygame_sdl2/controller.pyx":167 * """ * * if self.controller and SDL_GameControllerGetAttached(self.controller): # <<<<<<<<<<<<<< * SDL_GameControllerClose(self.controller) * self.controller = NULL */ } /* "pygame_sdl2/controller.pyx":162 * raise error() * * def quit(self): # @ReservedAssignment # <<<<<<<<<<<<<< * """ * Closes the game controller, preventing it from sending events. */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/controller.pyx":171 * self.controller = NULL * * def get_init(self): # <<<<<<<<<<<<<< * """ * Returns true if the controller has been initialized, false otherwise. */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_10controller_10Controller_9get_init(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/ static char __pyx_doc_11pygame_sdl2_10controller_10Controller_8get_init[] = "\n Returns true if the controller has been initialized, false otherwise.\n "; static PyObject *__pyx_pw_11pygame_sdl2_10controller_10Controller_9get_init(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("get_init (wrapper)", 0); __pyx_r = __pyx_pf_11pygame_sdl2_10controller_10Controller_8get_init(((struct __pyx_obj_11pygame_sdl2_10controller_Controller *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_10controller_10Controller_8get_init(struct __pyx_obj_11pygame_sdl2_10controller_Controller *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; __Pyx_RefNannySetupContext("get_init", 0); /* "pygame_sdl2/controller.pyx":176 * """ * * if self.controller: # <<<<<<<<<<<<<< * return True * else: */ __pyx_t_1 = (__pyx_v_self->controller != 0); if (__pyx_t_1) { /* "pygame_sdl2/controller.pyx":177 * * if self.controller: * return True # <<<<<<<<<<<<<< * else: * return False */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(Py_True); __pyx_r = Py_True; goto __pyx_L0; /* "pygame_sdl2/controller.pyx":176 * """ * * if self.controller: # <<<<<<<<<<<<<< * return True * else: */ } /* "pygame_sdl2/controller.pyx":179 * return True * else: * return False # <<<<<<<<<<<<<< * * def get_axis(self, axis): */ /*else*/ { __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(Py_False); __pyx_r = Py_False; goto __pyx_L0; } /* "pygame_sdl2/controller.pyx":171 * self.controller = NULL * * def get_init(self): # <<<<<<<<<<<<<< * """ * Returns true if the controller has been initialized, false otherwise. */ /* function exit code */ __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/controller.pyx":181 * return False * * def get_axis(self, axis): # <<<<<<<<<<<<<< * """ * Returns the value of `axis`, which is one of the pygame.CONTROLLER_AXIS */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_10controller_10Controller_11get_axis(PyObject *__pyx_v_self, PyObject *__pyx_v_axis); /*proto*/ static char __pyx_doc_11pygame_sdl2_10controller_10Controller_10get_axis[] = "\n Returns the value of `axis`, which is one of the pygame.CONTROLLER_AXIS\n constants.\n\n Axes return values from -32768 to 32678, triggers return 0 to 32768. 0 is\n returned on failure.\n "; static PyObject *__pyx_pw_11pygame_sdl2_10controller_10Controller_11get_axis(PyObject *__pyx_v_self, PyObject *__pyx_v_axis) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("get_axis (wrapper)", 0); __pyx_r = __pyx_pf_11pygame_sdl2_10controller_10Controller_10get_axis(((struct __pyx_obj_11pygame_sdl2_10controller_Controller *)__pyx_v_self), ((PyObject *)__pyx_v_axis)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_10controller_10Controller_10get_axis(struct __pyx_obj_11pygame_sdl2_10controller_Controller *__pyx_v_self, PyObject *__pyx_v_axis) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; SDL_GameControllerAxis __pyx_t_4; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("get_axis", 0); /* "pygame_sdl2/controller.pyx":190 * """ * * if self.controller == NULL: # <<<<<<<<<<<<<< * raise error("controller not initialized.") * */ __pyx_t_1 = ((__pyx_v_self->controller == NULL) != 0); if (__pyx_t_1) { /* "pygame_sdl2/controller.pyx":191 * * if self.controller == NULL: * raise error("controller not initialized.") # <<<<<<<<<<<<<< * * return SDL_GameControllerGetAxis(self.controller, axis) */ __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_error); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 191; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_tuple_, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 191; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_Raise(__pyx_t_3, 0, 0, 0); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; {__pyx_filename = __pyx_f[0]; __pyx_lineno = 191; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "pygame_sdl2/controller.pyx":190 * """ * * if self.controller == NULL: # <<<<<<<<<<<<<< * raise error("controller not initialized.") * */ } /* "pygame_sdl2/controller.pyx":193 * raise error("controller not initialized.") * * return SDL_GameControllerGetAxis(self.controller, axis) # <<<<<<<<<<<<<< * * */ __Pyx_XDECREF(__pyx_r); __pyx_t_4 = ((SDL_GameControllerAxis)__Pyx_PyInt_As_SDL_GameControllerAxis(__pyx_v_axis)); if (unlikely(PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 193; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_t_3 = __Pyx_PyInt_From_int16_t(SDL_GameControllerGetAxis(__pyx_v_self->controller, __pyx_t_4)); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 193; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __pyx_r = __pyx_t_3; __pyx_t_3 = 0; goto __pyx_L0; /* "pygame_sdl2/controller.pyx":181 * return False * * def get_axis(self, axis): # <<<<<<<<<<<<<< * """ * Returns the value of `axis`, which is one of the pygame.CONTROLLER_AXIS */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("pygame_sdl2.controller.Controller.get_axis", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/controller.pyx":196 * * * def get_button(self, button): # <<<<<<<<<<<<<< * """ * Returns the value of `button`, which must be one of the pygame.CONTROLLER_BUTTON */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_10controller_10Controller_13get_button(PyObject *__pyx_v_self, PyObject *__pyx_v_button); /*proto*/ static char __pyx_doc_11pygame_sdl2_10controller_10Controller_12get_button[] = "\n Returns the value of `button`, which must be one of the pygame.CONTROLLER_BUTTON\n constants.\n\n Returns 1 if the button is pressed, 0 if not or the button does not exist.\n "; static PyObject *__pyx_pw_11pygame_sdl2_10controller_10Controller_13get_button(PyObject *__pyx_v_self, PyObject *__pyx_v_button) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("get_button (wrapper)", 0); __pyx_r = __pyx_pf_11pygame_sdl2_10controller_10Controller_12get_button(((struct __pyx_obj_11pygame_sdl2_10controller_Controller *)__pyx_v_self), ((PyObject *)__pyx_v_button)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_10controller_10Controller_12get_button(struct __pyx_obj_11pygame_sdl2_10controller_Controller *__pyx_v_self, PyObject *__pyx_v_button) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; SDL_GameControllerButton __pyx_t_4; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("get_button", 0); /* "pygame_sdl2/controller.pyx":204 * """ * * if self.controller == NULL: # <<<<<<<<<<<<<< * raise error("controller not initialized.") * */ __pyx_t_1 = ((__pyx_v_self->controller == NULL) != 0); if (__pyx_t_1) { /* "pygame_sdl2/controller.pyx":205 * * if self.controller == NULL: * raise error("controller not initialized.") # <<<<<<<<<<<<<< * * return SDL_GameControllerGetButton(self.controller, button) */ __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_error); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 205; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_tuple__2, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 205; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_Raise(__pyx_t_3, 0, 0, 0); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; {__pyx_filename = __pyx_f[0]; __pyx_lineno = 205; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "pygame_sdl2/controller.pyx":204 * """ * * if self.controller == NULL: # <<<<<<<<<<<<<< * raise error("controller not initialized.") * */ } /* "pygame_sdl2/controller.pyx":207 * raise error("controller not initialized.") * * return SDL_GameControllerGetButton(self.controller, button) # <<<<<<<<<<<<<< * * def get_name(self): */ __Pyx_XDECREF(__pyx_r); __pyx_t_4 = ((SDL_GameControllerButton)__Pyx_PyInt_As_SDL_GameControllerButton(__pyx_v_button)); if (unlikely(PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 207; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_t_3 = __Pyx_PyInt_From_uint8_t(SDL_GameControllerGetButton(__pyx_v_self->controller, __pyx_t_4)); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 207; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __pyx_r = __pyx_t_3; __pyx_t_3 = 0; goto __pyx_L0; /* "pygame_sdl2/controller.pyx":196 * * * def get_button(self, button): # <<<<<<<<<<<<<< * """ * Returns the value of `button`, which must be one of the pygame.CONTROLLER_BUTTON */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("pygame_sdl2.controller.Controller.get_button", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/controller.pyx":209 * return SDL_GameControllerGetButton(self.controller, button) * * def get_name(self): # <<<<<<<<<<<<<< * """ * Returns an implementation-dependent name for this game controller, */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_10controller_10Controller_15get_name(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/ static char __pyx_doc_11pygame_sdl2_10controller_10Controller_14get_name[] = "\n Returns an implementation-dependent name for this game controller,\n or None if no name could be found.\n "; static PyObject *__pyx_pw_11pygame_sdl2_10controller_10Controller_15get_name(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("get_name (wrapper)", 0); __pyx_r = __pyx_pf_11pygame_sdl2_10controller_10Controller_14get_name(((struct __pyx_obj_11pygame_sdl2_10controller_Controller *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_10controller_10Controller_14get_name(struct __pyx_obj_11pygame_sdl2_10controller_Controller *__pyx_v_self) { char const *__pyx_v_rv; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; PyObject *__pyx_t_2 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("get_name", 0); /* "pygame_sdl2/controller.pyx":215 * """ * * cdef const char *rv = SDL_GameControllerNameForIndex(self.index) # <<<<<<<<<<<<<< * * if rv == NULL: */ __pyx_v_rv = SDL_GameControllerNameForIndex(__pyx_v_self->index); /* "pygame_sdl2/controller.pyx":217 * cdef const char *rv = SDL_GameControllerNameForIndex(self.index) * * if rv == NULL: # <<<<<<<<<<<<<< * return None * */ __pyx_t_1 = ((__pyx_v_rv == NULL) != 0); if (__pyx_t_1) { /* "pygame_sdl2/controller.pyx":218 * * if rv == NULL: * return None # <<<<<<<<<<<<<< * * return rv */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(Py_None); __pyx_r = Py_None; goto __pyx_L0; /* "pygame_sdl2/controller.pyx":217 * cdef const char *rv = SDL_GameControllerNameForIndex(self.index) * * if rv == NULL: # <<<<<<<<<<<<<< * return None * */ } /* "pygame_sdl2/controller.pyx":220 * return None * * return rv # <<<<<<<<<<<<<< * * def is_controller(self): */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __Pyx_PyBytes_FromString(__pyx_v_rv); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 220; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; /* "pygame_sdl2/controller.pyx":209 * return SDL_GameControllerGetButton(self.controller, button) * * def get_name(self): # <<<<<<<<<<<<<< * """ * Returns an implementation-dependent name for this game controller, */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_AddTraceback("pygame_sdl2.controller.Controller.get_name", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/controller.pyx":222 * return rv * * def is_controller(self): # <<<<<<<<<<<<<< * """ * Returns true if this Controller object corresponds to a supported */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_10controller_10Controller_17is_controller(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/ static char __pyx_doc_11pygame_sdl2_10controller_10Controller_16is_controller[] = "\n Returns true if this Controller object corresponds to a supported\n game controller, or False otherwise.\n "; static PyObject *__pyx_pw_11pygame_sdl2_10controller_10Controller_17is_controller(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("is_controller (wrapper)", 0); __pyx_r = __pyx_pf_11pygame_sdl2_10controller_10Controller_16is_controller(((struct __pyx_obj_11pygame_sdl2_10controller_Controller *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_10controller_10Controller_16is_controller(struct __pyx_obj_11pygame_sdl2_10controller_Controller *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("is_controller", 0); /* "pygame_sdl2/controller.pyx":228 * """ * * return SDL_IsGameController(self.index) # <<<<<<<<<<<<<< * * def get_guid_string(self): */ __Pyx_XDECREF(__pyx_r); __pyx_t_1 = __Pyx_PyInt_From_SDL_bool(SDL_IsGameController(__pyx_v_self->index)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 228; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "pygame_sdl2/controller.pyx":222 * return rv * * def is_controller(self): # <<<<<<<<<<<<<< * """ * Returns true if this Controller object corresponds to a supported */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("pygame_sdl2.controller.Controller.is_controller", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/controller.pyx":230 * return SDL_IsGameController(self.index) * * def get_guid_string(self): # <<<<<<<<<<<<<< * """ * Returns the guid string corresponding to this controller. */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_10controller_10Controller_19get_guid_string(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/ static char __pyx_doc_11pygame_sdl2_10controller_10Controller_18get_guid_string[] = "\n Returns the guid string corresponding to this controller.\n "; static PyObject *__pyx_pw_11pygame_sdl2_10controller_10Controller_19get_guid_string(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("get_guid_string (wrapper)", 0); __pyx_r = __pyx_pf_11pygame_sdl2_10controller_10Controller_18get_guid_string(((struct __pyx_obj_11pygame_sdl2_10controller_Controller *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_10controller_10Controller_18get_guid_string(struct __pyx_obj_11pygame_sdl2_10controller_Controller *__pyx_v_self) { SDL_JoystickGUID __pyx_v_guid; char __pyx_v_s[33]; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("get_guid_string", 0); /* "pygame_sdl2/controller.pyx":238 * cdef char s[33] * * guid = SDL_JoystickGetDeviceGUID(self.index) # <<<<<<<<<<<<<< * SDL_JoystickGetGUIDString(guid, s, 33) * */ __pyx_v_guid = SDL_JoystickGetDeviceGUID(__pyx_v_self->index); /* "pygame_sdl2/controller.pyx":239 * * guid = SDL_JoystickGetDeviceGUID(self.index) * SDL_JoystickGetGUIDString(guid, s, 33) # <<<<<<<<<<<<<< * * return s */ SDL_JoystickGetGUIDString(__pyx_v_guid, __pyx_v_s, 33); /* "pygame_sdl2/controller.pyx":241 * SDL_JoystickGetGUIDString(guid, s, 33) * * return s # <<<<<<<<<<<<<< * */ __Pyx_XDECREF(__pyx_r); __pyx_t_1 = __Pyx_PyObject_FromString(__pyx_v_s); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 241; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "pygame_sdl2/controller.pyx":230 * return SDL_IsGameController(self.index) * * def get_guid_string(self): # <<<<<<<<<<<<<< * """ * Returns the guid string corresponding to this controller. */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("pygame_sdl2.controller.Controller.get_guid_string", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_tp_new_11pygame_sdl2_10controller_Controller(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) { PyObject *o; if (likely((t->tp_flags & Py_TPFLAGS_IS_ABSTRACT) == 0)) { o = (*t->tp_alloc)(t, 0); } else { o = (PyObject *) PyBaseObject_Type.tp_new(t, __pyx_empty_tuple, 0); } if (unlikely(!o)) return 0; if (unlikely(__pyx_pw_11pygame_sdl2_10controller_10Controller_1__cinit__(o, __pyx_empty_tuple, NULL) < 0)) { Py_DECREF(o); o = 0; } return o; } static void __pyx_tp_dealloc_11pygame_sdl2_10controller_Controller(PyObject *o) { struct __pyx_obj_11pygame_sdl2_10controller_Controller *p = (struct __pyx_obj_11pygame_sdl2_10controller_Controller *)o; #if PY_VERSION_HEX >= 0x030400a1 if (unlikely(Py_TYPE(o)->tp_finalize) && (!PyType_IS_GC(Py_TYPE(o)) || !_PyGC_FINALIZED(o))) { if (PyObject_CallFinalizerFromDealloc(o)) return; } #endif if (p->__weakref__) PyObject_ClearWeakRefs(o); (*Py_TYPE(o)->tp_free)(o); } static PyMethodDef __pyx_methods_11pygame_sdl2_10controller_Controller[] = { {"init", (PyCFunction)__pyx_pw_11pygame_sdl2_10controller_10Controller_5init, METH_NOARGS, __pyx_doc_11pygame_sdl2_10controller_10Controller_4init}, {"quit", (PyCFunction)__pyx_pw_11pygame_sdl2_10controller_10Controller_7quit, METH_NOARGS, __pyx_doc_11pygame_sdl2_10controller_10Controller_6quit}, {"get_init", (PyCFunction)__pyx_pw_11pygame_sdl2_10controller_10Controller_9get_init, METH_NOARGS, __pyx_doc_11pygame_sdl2_10controller_10Controller_8get_init}, {"get_axis", (PyCFunction)__pyx_pw_11pygame_sdl2_10controller_10Controller_11get_axis, METH_O, __pyx_doc_11pygame_sdl2_10controller_10Controller_10get_axis}, {"get_button", (PyCFunction)__pyx_pw_11pygame_sdl2_10controller_10Controller_13get_button, METH_O, __pyx_doc_11pygame_sdl2_10controller_10Controller_12get_button}, {"get_name", (PyCFunction)__pyx_pw_11pygame_sdl2_10controller_10Controller_15get_name, METH_NOARGS, __pyx_doc_11pygame_sdl2_10controller_10Controller_14get_name}, {"is_controller", (PyCFunction)__pyx_pw_11pygame_sdl2_10controller_10Controller_17is_controller, METH_NOARGS, __pyx_doc_11pygame_sdl2_10controller_10Controller_16is_controller}, {"get_guid_string", (PyCFunction)__pyx_pw_11pygame_sdl2_10controller_10Controller_19get_guid_string, METH_NOARGS, __pyx_doc_11pygame_sdl2_10controller_10Controller_18get_guid_string}, {0, 0, 0, 0} }; static PyTypeObject __pyx_type_11pygame_sdl2_10controller_Controller = { PyVarObject_HEAD_INIT(0, 0) "pygame_sdl2.controller.Controller", /*tp_name*/ sizeof(struct __pyx_obj_11pygame_sdl2_10controller_Controller), /*tp_basicsize*/ 0, /*tp_itemsize*/ __pyx_tp_dealloc_11pygame_sdl2_10controller_Controller, /*tp_dealloc*/ 0, /*tp_print*/ 0, /*tp_getattr*/ 0, /*tp_setattr*/ #if PY_MAJOR_VERSION < 3 0, /*tp_compare*/ #endif #if PY_MAJOR_VERSION >= 3 0, /*tp_as_async*/ #endif 0, /*tp_repr*/ 0, /*tp_as_number*/ 0, /*tp_as_sequence*/ 0, /*tp_as_mapping*/ 0, /*tp_hash*/ 0, /*tp_call*/ 0, /*tp_str*/ 0, /*tp_getattro*/ 0, /*tp_setattro*/ 0, /*tp_as_buffer*/ Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE, /*tp_flags*/ 0, /*tp_doc*/ 0, /*tp_traverse*/ 0, /*tp_clear*/ 0, /*tp_richcompare*/ 0, /*tp_weaklistoffset*/ 0, /*tp_iter*/ 0, /*tp_iternext*/ __pyx_methods_11pygame_sdl2_10controller_Controller, /*tp_methods*/ 0, /*tp_members*/ 0, /*tp_getset*/ 0, /*tp_base*/ 0, /*tp_dict*/ 0, /*tp_descr_get*/ 0, /*tp_descr_set*/ 0, /*tp_dictoffset*/ __pyx_pw_11pygame_sdl2_10controller_10Controller_3__init__, /*tp_init*/ 0, /*tp_alloc*/ __pyx_tp_new_11pygame_sdl2_10controller_Controller, /*tp_new*/ 0, /*tp_free*/ 0, /*tp_is_gc*/ 0, /*tp_bases*/ 0, /*tp_mro*/ 0, /*tp_cache*/ 0, /*tp_subclasses*/ 0, /*tp_weaklist*/ 0, /*tp_del*/ 0, /*tp_version_tag*/ #if PY_VERSION_HEX >= 0x030400a1 0, /*tp_finalize*/ #endif }; static PyMethodDef __pyx_methods[] = { {0, 0, 0, 0} }; #if PY_MAJOR_VERSION >= 3 static struct PyModuleDef __pyx_moduledef = { #if PY_VERSION_HEX < 0x03020000 { PyObject_HEAD_INIT(NULL) NULL, 0, NULL }, #else PyModuleDef_HEAD_INIT, #endif "controller", 0, /* m_doc */ -1, /* m_size */ __pyx_methods /* m_methods */, NULL, /* m_reload */ NULL, /* m_traverse */ NULL, /* m_clear */ NULL /* m_free */ }; #endif static __Pyx_StringTabEntry __pyx_string_tab[] = { {&__pyx_n_s_add_mapping, __pyx_k_add_mapping, sizeof(__pyx_k_add_mapping), 0, 0, 1, 1}, {&__pyx_n_s_add_mappings, __pyx_k_add_mappings, sizeof(__pyx_k_add_mappings), 0, 0, 1, 1}, {&__pyx_n_s_axis, __pyx_k_axis, sizeof(__pyx_k_axis), 0, 0, 1, 1}, {&__pyx_n_s_button, __pyx_k_button, sizeof(__pyx_k_button), 0, 0, 1, 1}, {&__pyx_kp_s_controller_not_initialized, __pyx_k_controller_not_initialized, sizeof(__pyx_k_controller_not_initialized), 0, 0, 1, 0}, {&__pyx_n_s_display, __pyx_k_display, sizeof(__pyx_k_display), 0, 0, 1, 1}, {&__pyx_n_s_error, __pyx_k_error, sizeof(__pyx_k_error), 0, 0, 1, 1}, {&__pyx_n_s_get_axis_from_string, __pyx_k_get_axis_from_string, sizeof(__pyx_k_get_axis_from_string), 0, 0, 1, 1}, {&__pyx_n_s_get_button_from_string, __pyx_k_get_button_from_string, sizeof(__pyx_k_get_button_from_string), 0, 0, 1, 1}, {&__pyx_n_s_get_count, __pyx_k_get_count, sizeof(__pyx_k_get_count), 0, 0, 1, 1}, {&__pyx_n_s_get_init, __pyx_k_get_init, sizeof(__pyx_k_get_init), 0, 0, 1, 1}, {&__pyx_n_s_get_string_for_axis, __pyx_k_get_string_for_axis, sizeof(__pyx_k_get_string_for_axis), 0, 0, 1, 1}, {&__pyx_n_s_get_string_for_button, __pyx_k_get_string_for_button, sizeof(__pyx_k_get_string_for_button), 0, 0, 1, 1}, {&__pyx_kp_s_home_tom_ab_pygame_sdl2_src_pyg, __pyx_k_home_tom_ab_pygame_sdl2_src_pyg, sizeof(__pyx_k_home_tom_ab_pygame_sdl2_src_pyg), 0, 0, 1, 0}, {&__pyx_n_s_import, __pyx_k_import, sizeof(__pyx_k_import), 0, 0, 1, 1}, {&__pyx_n_s_index, __pyx_k_index, sizeof(__pyx_k_index), 0, 0, 1, 1}, {&__pyx_n_s_init, __pyx_k_init, sizeof(__pyx_k_init), 0, 0, 1, 1}, {&__pyx_n_s_main, __pyx_k_main, sizeof(__pyx_k_main), 0, 0, 1, 1}, {&__pyx_n_s_mapping, __pyx_k_mapping, sizeof(__pyx_k_mapping), 0, 0, 1, 1}, {&__pyx_n_s_mapping_file, __pyx_k_mapping_file, sizeof(__pyx_k_mapping_file), 0, 0, 1, 1}, {&__pyx_n_s_name, __pyx_k_name, sizeof(__pyx_k_name), 0, 0, 1, 1}, {&__pyx_n_s_pygame_sdl2, __pyx_k_pygame_sdl2, sizeof(__pyx_k_pygame_sdl2), 0, 0, 1, 1}, {&__pyx_n_s_pygame_sdl2_controller, __pyx_k_pygame_sdl2_controller, sizeof(__pyx_k_pygame_sdl2_controller), 0, 0, 1, 1}, {&__pyx_n_s_pygame_sdl2_error, __pyx_k_pygame_sdl2_error, sizeof(__pyx_k_pygame_sdl2_error), 0, 0, 1, 1}, {&__pyx_n_s_quit, __pyx_k_quit, sizeof(__pyx_k_quit), 0, 0, 1, 1}, {&__pyx_n_s_register_init, __pyx_k_register_init, sizeof(__pyx_k_register_init), 0, 0, 1, 1}, {&__pyx_n_s_register_quit, __pyx_k_register_quit, sizeof(__pyx_k_register_quit), 0, 0, 1, 1}, {&__pyx_n_s_rv, __pyx_k_rv, sizeof(__pyx_k_rv), 0, 0, 1, 1}, {&__pyx_n_s_rwops, __pyx_k_rwops, sizeof(__pyx_k_rwops), 0, 0, 1, 1}, {&__pyx_n_s_sdl_main_init, __pyx_k_sdl_main_init, sizeof(__pyx_k_sdl_main_init), 0, 0, 1, 1}, {&__pyx_n_s_test, __pyx_k_test, sizeof(__pyx_k_test), 0, 0, 1, 1}, {0, 0, 0, 0, 0, 0, 0} }; static int __Pyx_InitCachedBuiltins(void) { return 0; } static int __Pyx_InitCachedConstants(void) { __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__Pyx_InitCachedConstants", 0); /* "pygame_sdl2/controller.pyx":191 * * if self.controller == NULL: * raise error("controller not initialized.") # <<<<<<<<<<<<<< * * return SDL_GameControllerGetAxis(self.controller, axis) */ __pyx_tuple_ = PyTuple_Pack(1, __pyx_kp_s_controller_not_initialized); if (unlikely(!__pyx_tuple_)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 191; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_tuple_); __Pyx_GIVEREF(__pyx_tuple_); /* "pygame_sdl2/controller.pyx":205 * * if self.controller == NULL: * raise error("controller not initialized.") # <<<<<<<<<<<<<< * * return SDL_GameControllerGetButton(self.controller, button) */ __pyx_tuple__2 = PyTuple_Pack(1, __pyx_kp_s_controller_not_initialized); if (unlikely(!__pyx_tuple__2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 205; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_tuple__2); __Pyx_GIVEREF(__pyx_tuple__2); /* "pygame_sdl2/controller.pyx":26 * * @pygame_sdl2.register_init * def init(): # <<<<<<<<<<<<<< * """ * Initializes game controller support. */ __pyx_codeobj__3 = (PyObject*)__Pyx_PyCode_New(0, 0, 0, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_tom_ab_pygame_sdl2_src_pyg, __pyx_n_s_init, 26, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 26; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "pygame_sdl2/controller.pyx":37 * * @pygame_sdl2.register_quit * def quit(): # @ReservedAssignment # <<<<<<<<<<<<<< * """ * Shuts down game controller support. */ __pyx_codeobj__4 = (PyObject*)__Pyx_PyCode_New(0, 0, 0, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_tom_ab_pygame_sdl2_src_pyg, __pyx_n_s_quit, 37, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 37; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "pygame_sdl2/controller.pyx":44 * SDL_QuitSubSystem(SDL_INIT_GAMECONTROLLER) * * def get_init(): # <<<<<<<<<<<<<< * """ * Returns true if game controller support has been initialized. */ __pyx_codeobj__5 = (PyObject*)__Pyx_PyCode_New(0, 0, 0, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_tom_ab_pygame_sdl2_src_pyg, __pyx_n_s_get_init, 44, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 44; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "pygame_sdl2/controller.pyx":51 * return SDL_WasInit(SDL_INIT_GAMECONTROLLER) != 0 * * def get_count(): # <<<<<<<<<<<<<< * """ * Returns the number of joysticks and game controllers connected to the */ __pyx_codeobj__6 = (PyObject*)__Pyx_PyCode_New(0, 0, 0, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_tom_ab_pygame_sdl2_src_pyg, __pyx_n_s_get_count, 51, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 51; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "pygame_sdl2/controller.pyx":66 * * * def add_mapping(mapping): # <<<<<<<<<<<<<< * """ * Adds a game controller mapping from the string in `mapping`. */ __pyx_tuple__7 = PyTuple_Pack(1, __pyx_n_s_mapping); if (unlikely(!__pyx_tuple__7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 66; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_tuple__7); __Pyx_GIVEREF(__pyx_tuple__7); __pyx_codeobj__8 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__7, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_tom_ab_pygame_sdl2_src_pyg, __pyx_n_s_add_mapping, 66, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 66; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "pygame_sdl2/controller.pyx":74 * raise error() * * def add_mappings(mapping_file): # <<<<<<<<<<<<<< * """ * Adds game controller mappings from `mapping_file`, which can be a string */ __pyx_tuple__9 = PyTuple_Pack(2, __pyx_n_s_mapping_file, __pyx_n_s_rwops); if (unlikely(!__pyx_tuple__9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 74; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_tuple__9); __Pyx_GIVEREF(__pyx_tuple__9); __pyx_codeobj__10 = (PyObject*)__Pyx_PyCode_New(1, 0, 2, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__9, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_tom_ab_pygame_sdl2_src_pyg, __pyx_n_s_add_mappings, 74, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 74; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "pygame_sdl2/controller.pyx":91 * raise error() * * def get_axis_from_string(name): # <<<<<<<<<<<<<< * """ * Returns the axis number of the controller axis with `name`, or */ __pyx_tuple__11 = PyTuple_Pack(1, __pyx_n_s_name); if (unlikely(!__pyx_tuple__11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 91; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_tuple__11); __Pyx_GIVEREF(__pyx_tuple__11); __pyx_codeobj__12 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__11, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_tom_ab_pygame_sdl2_src_pyg, __pyx_n_s_get_axis_from_string, 91, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__12)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 91; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "pygame_sdl2/controller.pyx":99 * return SDL_GameControllerGetAxisFromString(name) * * def get_button_from_string(name): # <<<<<<<<<<<<<< * """ * Returns the button number of the controller button with `name`, or */ __pyx_tuple__13 = PyTuple_Pack(1, __pyx_n_s_name); if (unlikely(!__pyx_tuple__13)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 99; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_tuple__13); __Pyx_GIVEREF(__pyx_tuple__13); __pyx_codeobj__14 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__13, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_tom_ab_pygame_sdl2_src_pyg, __pyx_n_s_get_button_from_string, 99, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__14)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 99; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "pygame_sdl2/controller.pyx":107 * return SDL_GameControllerGetButtonFromString(name) * * def get_string_for_axis(axis): # <<<<<<<<<<<<<< * """ * Returns a string describing the controller axis `axis`, which must be */ __pyx_tuple__15 = PyTuple_Pack(2, __pyx_n_s_axis, __pyx_n_s_rv); if (unlikely(!__pyx_tuple__15)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 107; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_tuple__15); __Pyx_GIVEREF(__pyx_tuple__15); __pyx_codeobj__16 = (PyObject*)__Pyx_PyCode_New(1, 0, 2, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__15, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_tom_ab_pygame_sdl2_src_pyg, __pyx_n_s_get_string_for_axis, 107, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__16)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 107; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "pygame_sdl2/controller.pyx":120 * return None * * def get_string_for_button(button): # <<<<<<<<<<<<<< * """ * Returns a string describing the controller button `button`, which must be */ __pyx_tuple__17 = PyTuple_Pack(2, __pyx_n_s_button, __pyx_n_s_rv); if (unlikely(!__pyx_tuple__17)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 120; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_tuple__17); __Pyx_GIVEREF(__pyx_tuple__17); __pyx_codeobj__18 = (PyObject*)__Pyx_PyCode_New(1, 0, 2, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__17, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_tom_ab_pygame_sdl2_src_pyg, __pyx_n_s_get_string_for_button, 120, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__18)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 120; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_RefNannyFinishContext(); return 0; __pyx_L1_error:; __Pyx_RefNannyFinishContext(); return -1; } static int __Pyx_InitGlobals(void) { if (__Pyx_InitStrings(__pyx_string_tab) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; return 0; __pyx_L1_error:; return -1; } #if PY_MAJOR_VERSION < 3 PyMODINIT_FUNC initcontroller(void); /*proto*/ PyMODINIT_FUNC initcontroller(void) #else PyMODINIT_FUNC PyInit_controller(void); /*proto*/ PyMODINIT_FUNC PyInit_controller(void) #endif { PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; PyObject *__pyx_t_5 = NULL; PyObject *__pyx_t_6 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannyDeclarations #if CYTHON_REFNANNY __Pyx_RefNanny = __Pyx_RefNannyImportAPI("refnanny"); if (!__Pyx_RefNanny) { PyErr_Clear(); __Pyx_RefNanny = __Pyx_RefNannyImportAPI("Cython.Runtime.refnanny"); if (!__Pyx_RefNanny) Py_FatalError("failed to import 'refnanny' module"); } #endif __Pyx_RefNannySetupContext("PyMODINIT_FUNC PyInit_controller(void)", 0); if (__Pyx_check_binary_version() < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_empty_tuple = PyTuple_New(0); if (unlikely(!__pyx_empty_tuple)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_empty_bytes = PyBytes_FromStringAndSize("", 0); if (unlikely(!__pyx_empty_bytes)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} #ifdef __Pyx_CyFunction_USED if (__pyx_CyFunction_init() < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} #endif #ifdef __Pyx_FusedFunction_USED if (__pyx_FusedFunction_init() < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} #endif #ifdef __Pyx_Coroutine_USED if (__pyx_Coroutine_init() < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} #endif #ifdef __Pyx_Generator_USED if (__pyx_Generator_init() < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} #endif #ifdef __Pyx_StopAsyncIteration_USED if (__pyx_StopAsyncIteration_init() < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} #endif /*--- Library function declarations ---*/ /*--- Threads initialization code ---*/ #if defined(__PYX_FORCE_INIT_THREADS) && __PYX_FORCE_INIT_THREADS #ifdef WITH_THREAD /* Python build with threading support? */ PyEval_InitThreads(); #endif #endif /*--- Module creation code ---*/ #if PY_MAJOR_VERSION < 3 __pyx_m = Py_InitModule4("controller", __pyx_methods, 0, 0, PYTHON_API_VERSION); Py_XINCREF(__pyx_m); #else __pyx_m = PyModule_Create(&__pyx_moduledef); #endif if (unlikely(!__pyx_m)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_d = PyModule_GetDict(__pyx_m); if (unlikely(!__pyx_d)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} Py_INCREF(__pyx_d); __pyx_b = PyImport_AddModule(__Pyx_BUILTIN_MODULE_NAME); if (unlikely(!__pyx_b)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} #if CYTHON_COMPILING_IN_PYPY Py_INCREF(__pyx_b); #endif if (PyObject_SetAttrString(__pyx_m, "__builtins__", __pyx_b) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; /*--- Initialize various global constants etc. ---*/ if (__Pyx_InitGlobals() < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} #if PY_MAJOR_VERSION < 3 && (__PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT) if (__Pyx_init_sys_getdefaultencoding_params() < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} #endif if (__pyx_module_is_main_pygame_sdl2__controller) { if (PyObject_SetAttrString(__pyx_m, "__name__", __pyx_n_s_main) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } #if PY_MAJOR_VERSION >= 3 { PyObject *modules = PyImport_GetModuleDict(); if (unlikely(!modules)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} if (!PyDict_GetItemString(modules, "pygame_sdl2.controller")) { if (unlikely(PyDict_SetItemString(modules, "pygame_sdl2.controller", __pyx_m) < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } } #endif /*--- Builtin init code ---*/ if (__Pyx_InitCachedBuiltins() < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /*--- Constants init code ---*/ if (__Pyx_InitCachedConstants() < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /*--- Global init code ---*/ /*--- Variable export code ---*/ /*--- Function export code ---*/ /*--- Type init code ---*/ if (PyType_Ready(&__pyx_type_11pygame_sdl2_10controller_Controller) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 134; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_type_11pygame_sdl2_10controller_Controller.tp_print = 0; #if CYTHON_COMPILING_IN_CPYTHON { PyObject *wrapper = PyObject_GetAttrString((PyObject *)&__pyx_type_11pygame_sdl2_10controller_Controller, "__init__"); if (unlikely(!wrapper)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 134; __pyx_clineno = __LINE__; goto __pyx_L1_error;} if (Py_TYPE(wrapper) == &PyWrapperDescr_Type) { __pyx_wrapperbase_11pygame_sdl2_10controller_10Controller_2__init__ = *((PyWrapperDescrObject *)wrapper)->d_base; __pyx_wrapperbase_11pygame_sdl2_10controller_10Controller_2__init__.doc = __pyx_doc_11pygame_sdl2_10controller_10Controller_2__init__; ((PyWrapperDescrObject *)wrapper)->d_base = &__pyx_wrapperbase_11pygame_sdl2_10controller_10Controller_2__init__; } } #endif if (PyObject_SetAttrString(__pyx_m, "Controller", (PyObject *)&__pyx_type_11pygame_sdl2_10controller_Controller) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 134; __pyx_clineno = __LINE__; goto __pyx_L1_error;} if (__pyx_type_11pygame_sdl2_10controller_Controller.tp_weaklistoffset == 0) __pyx_type_11pygame_sdl2_10controller_Controller.tp_weaklistoffset = offsetof(struct __pyx_obj_11pygame_sdl2_10controller_Controller, __weakref__); __pyx_ptype_11pygame_sdl2_10controller_Controller = &__pyx_type_11pygame_sdl2_10controller_Controller; /*--- Type import code ---*/ /*--- Variable import code ---*/ /*--- Function import code ---*/ __pyx_t_1 = __Pyx_ImportModule("pygame_sdl2.rwobject"); if (!__pyx_t_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} if (__Pyx_ImportFunction(__pyx_t_1, "to_rwops", (void (**)(void))&__pyx_f_11pygame_sdl2_8rwobject_to_rwops, "SDL_RWops *(PyObject *, struct __pyx_opt_args_11pygame_sdl2_8rwobject_to_rwops *__pyx_optional_args)") < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} Py_DECREF(__pyx_t_1); __pyx_t_1 = 0; /*--- Execution code ---*/ #if defined(__Pyx_Generator_USED) || defined(__Pyx_Coroutine_USED) if (__Pyx_patch_abc() < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} #endif /* "pygame_sdl2/controller.pyx":20 * * from sdl2 cimport * * from pygame_sdl2.error import error # <<<<<<<<<<<<<< * import pygame_sdl2 * */ __pyx_t_2 = PyList_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 20; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __Pyx_INCREF(__pyx_n_s_error); __Pyx_GIVEREF(__pyx_n_s_error); PyList_SET_ITEM(__pyx_t_2, 0, __pyx_n_s_error); __pyx_t_3 = __Pyx_Import(__pyx_n_s_pygame_sdl2_error, __pyx_t_2, -1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 20; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_2 = __Pyx_ImportFrom(__pyx_t_3, __pyx_n_s_error); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 20; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_error, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 20; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "pygame_sdl2/controller.pyx":21 * from sdl2 cimport * * from pygame_sdl2.error import error * import pygame_sdl2 # <<<<<<<<<<<<<< * * from pygame_sdl2.rwobject cimport to_rwops */ __pyx_t_3 = __Pyx_Import(__pyx_n_s_pygame_sdl2, 0, -1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 21; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); if (PyDict_SetItem(__pyx_d, __pyx_n_s_pygame_sdl2, __pyx_t_3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 21; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "pygame_sdl2/controller.pyx":25 * from pygame_sdl2.rwobject cimport to_rwops * * @pygame_sdl2.register_init # <<<<<<<<<<<<<< * def init(): * """ */ __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_pygame_sdl2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 25; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_register_init); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 25; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "pygame_sdl2/controller.pyx":26 * * @pygame_sdl2.register_init * def init(): # <<<<<<<<<<<<<< * """ * Initializes game controller support. */ __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_11pygame_sdl2_10controller_1init, NULL, __pyx_n_s_pygame_sdl2_controller); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 26; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __pyx_t_5 = NULL; if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_4))) { __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4); if (likely(__pyx_t_5)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4); __Pyx_INCREF(__pyx_t_5); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_4, function); } } if (!__pyx_t_5) { __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 25; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_GOTREF(__pyx_t_3); } else { __pyx_t_6 = PyTuple_New(1+1); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 25; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_6); __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_5); __pyx_t_5 = NULL; __Pyx_GIVEREF(__pyx_t_2); PyTuple_SET_ITEM(__pyx_t_6, 0+1, __pyx_t_2); __pyx_t_2 = 0; __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_6, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 25; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; } __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; if (PyDict_SetItem(__pyx_d, __pyx_n_s_init, __pyx_t_3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 26; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "pygame_sdl2/controller.pyx":36 * raise error() * * @pygame_sdl2.register_quit # <<<<<<<<<<<<<< * def quit(): # @ReservedAssignment * """ */ __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_pygame_sdl2); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 36; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_register_quit); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 36; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; /* "pygame_sdl2/controller.pyx":37 * * @pygame_sdl2.register_quit * def quit(): # @ReservedAssignment # <<<<<<<<<<<<<< * """ * Shuts down game controller support. */ __pyx_t_4 = PyCFunction_NewEx(&__pyx_mdef_11pygame_sdl2_10controller_3quit, NULL, __pyx_n_s_pygame_sdl2_controller); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 37; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); __pyx_t_2 = NULL; if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_6))) { __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_6); if (likely(__pyx_t_2)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6); __Pyx_INCREF(__pyx_t_2); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_6, function); } } if (!__pyx_t_2) { __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_t_6, __pyx_t_4); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 36; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_GOTREF(__pyx_t_3); } else { __pyx_t_5 = PyTuple_New(1+1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 36; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); __Pyx_GIVEREF(__pyx_t_2); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_2); __pyx_t_2 = NULL; __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_5, 0+1, __pyx_t_4); __pyx_t_4 = 0; __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_5, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 36; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; } __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; if (PyDict_SetItem(__pyx_d, __pyx_n_s_quit, __pyx_t_3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 37; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "pygame_sdl2/controller.pyx":44 * SDL_QuitSubSystem(SDL_INIT_GAMECONTROLLER) * * def get_init(): # <<<<<<<<<<<<<< * """ * Returns true if game controller support has been initialized. */ __pyx_t_3 = PyCFunction_NewEx(&__pyx_mdef_11pygame_sdl2_10controller_5get_init, NULL, __pyx_n_s_pygame_sdl2_controller); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 44; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); if (PyDict_SetItem(__pyx_d, __pyx_n_s_get_init, __pyx_t_3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 44; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "pygame_sdl2/controller.pyx":51 * return SDL_WasInit(SDL_INIT_GAMECONTROLLER) != 0 * * def get_count(): # <<<<<<<<<<<<<< * """ * Returns the number of joysticks and game controllers connected to the */ __pyx_t_3 = PyCFunction_NewEx(&__pyx_mdef_11pygame_sdl2_10controller_7get_count, NULL, __pyx_n_s_pygame_sdl2_controller); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 51; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); if (PyDict_SetItem(__pyx_d, __pyx_n_s_get_count, __pyx_t_3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 51; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "pygame_sdl2/controller.pyx":66 * * * def add_mapping(mapping): # <<<<<<<<<<<<<< * """ * Adds a game controller mapping from the string in `mapping`. */ __pyx_t_3 = PyCFunction_NewEx(&__pyx_mdef_11pygame_sdl2_10controller_9add_mapping, NULL, __pyx_n_s_pygame_sdl2_controller); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 66; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); if (PyDict_SetItem(__pyx_d, __pyx_n_s_add_mapping, __pyx_t_3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 66; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "pygame_sdl2/controller.pyx":74 * raise error() * * def add_mappings(mapping_file): # <<<<<<<<<<<<<< * """ * Adds game controller mappings from `mapping_file`, which can be a string */ __pyx_t_3 = PyCFunction_NewEx(&__pyx_mdef_11pygame_sdl2_10controller_11add_mappings, NULL, __pyx_n_s_pygame_sdl2_controller); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 74; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); if (PyDict_SetItem(__pyx_d, __pyx_n_s_add_mappings, __pyx_t_3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 74; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "pygame_sdl2/controller.pyx":91 * raise error() * * def get_axis_from_string(name): # <<<<<<<<<<<<<< * """ * Returns the axis number of the controller axis with `name`, or */ __pyx_t_3 = PyCFunction_NewEx(&__pyx_mdef_11pygame_sdl2_10controller_13get_axis_from_string, NULL, __pyx_n_s_pygame_sdl2_controller); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 91; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); if (PyDict_SetItem(__pyx_d, __pyx_n_s_get_axis_from_string, __pyx_t_3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 91; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "pygame_sdl2/controller.pyx":99 * return SDL_GameControllerGetAxisFromString(name) * * def get_button_from_string(name): # <<<<<<<<<<<<<< * """ * Returns the button number of the controller button with `name`, or */ __pyx_t_3 = PyCFunction_NewEx(&__pyx_mdef_11pygame_sdl2_10controller_15get_button_from_string, NULL, __pyx_n_s_pygame_sdl2_controller); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 99; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); if (PyDict_SetItem(__pyx_d, __pyx_n_s_get_button_from_string, __pyx_t_3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 99; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "pygame_sdl2/controller.pyx":107 * return SDL_GameControllerGetButtonFromString(name) * * def get_string_for_axis(axis): # <<<<<<<<<<<<<< * """ * Returns a string describing the controller axis `axis`, which must be */ __pyx_t_3 = PyCFunction_NewEx(&__pyx_mdef_11pygame_sdl2_10controller_17get_string_for_axis, NULL, __pyx_n_s_pygame_sdl2_controller); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 107; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); if (PyDict_SetItem(__pyx_d, __pyx_n_s_get_string_for_axis, __pyx_t_3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 107; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "pygame_sdl2/controller.pyx":120 * return None * * def get_string_for_button(button): # <<<<<<<<<<<<<< * """ * Returns a string describing the controller button `button`, which must be */ __pyx_t_3 = PyCFunction_NewEx(&__pyx_mdef_11pygame_sdl2_10controller_19get_string_for_button, NULL, __pyx_n_s_pygame_sdl2_controller); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 120; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); if (PyDict_SetItem(__pyx_d, __pyx_n_s_get_string_for_button, __pyx_t_3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 120; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "pygame_sdl2/controller.pyx":1 * # Copyright 2015 Tom Rothamel # <<<<<<<<<<<<<< * # * # This software is provided 'as-is', without any express or implied */ __pyx_t_3 = PyDict_New(); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); if (PyDict_SetItem(__pyx_d, __pyx_n_s_test, __pyx_t_3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /*--- Wrapped vars code ---*/ goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_5); __Pyx_XDECREF(__pyx_t_6); if (__pyx_m) { if (__pyx_d) { __Pyx_AddTraceback("init pygame_sdl2.controller", __pyx_clineno, __pyx_lineno, __pyx_filename); } Py_DECREF(__pyx_m); __pyx_m = 0; } else if (!PyErr_Occurred()) { PyErr_SetString(PyExc_ImportError, "init pygame_sdl2.controller"); } __pyx_L0:; __Pyx_RefNannyFinishContext(); #if PY_MAJOR_VERSION < 3 return; #else return __pyx_m; #endif } /* --- Runtime support code --- */ #if CYTHON_REFNANNY static __Pyx_RefNannyAPIStruct *__Pyx_RefNannyImportAPI(const char *modname) { PyObject *m = NULL, *p = NULL; void *r = NULL; m = PyImport_ImportModule((char *)modname); if (!m) goto end; p = PyObject_GetAttrString(m, (char *)"RefNannyAPI"); if (!p) goto end; r = PyLong_AsVoidPtr(p); end: Py_XDECREF(p); Py_XDECREF(m); return (__Pyx_RefNannyAPIStruct *)r; } #endif static PyObject *__Pyx_GetBuiltinName(PyObject *name) { PyObject* result = __Pyx_PyObject_GetAttrStr(__pyx_b, name); if (unlikely(!result)) { PyErr_Format(PyExc_NameError, #if PY_MAJOR_VERSION >= 3 "name '%U' is not defined", name); #else "name '%.200s' is not defined", PyString_AS_STRING(name)); #endif } return result; } static CYTHON_INLINE PyObject *__Pyx_GetModuleGlobalName(PyObject *name) { PyObject *result; #if CYTHON_COMPILING_IN_CPYTHON result = PyDict_GetItem(__pyx_d, name); if (likely(result)) { Py_INCREF(result); } else { #else result = PyObject_GetItem(__pyx_d, name); if (!result) { PyErr_Clear(); #endif result = __Pyx_GetBuiltinName(name); } return result; } #if CYTHON_COMPILING_IN_CPYTHON static CYTHON_INLINE PyObject* __Pyx_PyObject_Call(PyObject *func, PyObject *arg, PyObject *kw) { PyObject *result; ternaryfunc call = func->ob_type->tp_call; if (unlikely(!call)) return PyObject_Call(func, arg, kw); if (unlikely(Py_EnterRecursiveCall((char*)" while calling a Python object"))) return NULL; result = (*call)(func, arg, kw); Py_LeaveRecursiveCall(); if (unlikely(!result) && unlikely(!PyErr_Occurred())) { PyErr_SetString( PyExc_SystemError, "NULL result without error in PyObject_Call"); } return result; } #endif #if CYTHON_COMPILING_IN_CPYTHON static CYTHON_INLINE PyObject* __Pyx_PyObject_CallMethO(PyObject *func, PyObject *arg) { PyObject *self, *result; PyCFunction cfunc; cfunc = PyCFunction_GET_FUNCTION(func); self = PyCFunction_GET_SELF(func); if (unlikely(Py_EnterRecursiveCall((char*)" while calling a Python object"))) return NULL; result = cfunc(self, arg); Py_LeaveRecursiveCall(); if (unlikely(!result) && unlikely(!PyErr_Occurred())) { PyErr_SetString( PyExc_SystemError, "NULL result without error in PyObject_Call"); } return result; } #endif #if CYTHON_COMPILING_IN_CPYTHON static PyObject* __Pyx__PyObject_CallOneArg(PyObject *func, PyObject *arg) { PyObject *result; PyObject *args = PyTuple_New(1); if (unlikely(!args)) return NULL; Py_INCREF(arg); PyTuple_SET_ITEM(args, 0, arg); result = __Pyx_PyObject_Call(func, args, NULL); Py_DECREF(args); return result; } static CYTHON_INLINE PyObject* __Pyx_PyObject_CallOneArg(PyObject *func, PyObject *arg) { #ifdef __Pyx_CyFunction_USED if (likely(PyCFunction_Check(func) || PyObject_TypeCheck(func, __pyx_CyFunctionType))) { #else if (likely(PyCFunction_Check(func))) { #endif if (likely(PyCFunction_GET_FLAGS(func) & METH_O)) { return __Pyx_PyObject_CallMethO(func, arg); } } return __Pyx__PyObject_CallOneArg(func, arg); } #else static CYTHON_INLINE PyObject* __Pyx_PyObject_CallOneArg(PyObject *func, PyObject *arg) { PyObject *result; PyObject *args = PyTuple_Pack(1, arg); if (unlikely(!args)) return NULL; result = __Pyx_PyObject_Call(func, args, NULL); Py_DECREF(args); return result; } #endif #if CYTHON_COMPILING_IN_CPYTHON static CYTHON_INLINE PyObject* __Pyx_PyObject_CallNoArg(PyObject *func) { #ifdef __Pyx_CyFunction_USED if (likely(PyCFunction_Check(func) || PyObject_TypeCheck(func, __pyx_CyFunctionType))) { #else if (likely(PyCFunction_Check(func))) { #endif if (likely(PyCFunction_GET_FLAGS(func) & METH_NOARGS)) { return __Pyx_PyObject_CallMethO(func, NULL); } } return __Pyx_PyObject_Call(func, __pyx_empty_tuple, NULL); } #endif static CYTHON_INLINE void __Pyx_ErrRestore(PyObject *type, PyObject *value, PyObject *tb) { #if CYTHON_COMPILING_IN_CPYTHON PyObject *tmp_type, *tmp_value, *tmp_tb; PyThreadState *tstate = PyThreadState_GET(); tmp_type = tstate->curexc_type; tmp_value = tstate->curexc_value; tmp_tb = tstate->curexc_traceback; tstate->curexc_type = type; tstate->curexc_value = value; tstate->curexc_traceback = tb; Py_XDECREF(tmp_type); Py_XDECREF(tmp_value); Py_XDECREF(tmp_tb); #else PyErr_Restore(type, value, tb); #endif } static CYTHON_INLINE void __Pyx_ErrFetch(PyObject **type, PyObject **value, PyObject **tb) { #if CYTHON_COMPILING_IN_CPYTHON PyThreadState *tstate = PyThreadState_GET(); *type = tstate->curexc_type; *value = tstate->curexc_value; *tb = tstate->curexc_traceback; tstate->curexc_type = 0; tstate->curexc_value = 0; tstate->curexc_traceback = 0; #else PyErr_Fetch(type, value, tb); #endif } #if PY_MAJOR_VERSION < 3 static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, CYTHON_UNUSED PyObject *cause) { Py_XINCREF(type); if (!value || value == Py_None) value = NULL; else Py_INCREF(value); if (!tb || tb == Py_None) tb = NULL; else { Py_INCREF(tb); if (!PyTraceBack_Check(tb)) { PyErr_SetString(PyExc_TypeError, "raise: arg 3 must be a traceback or None"); goto raise_error; } } if (PyType_Check(type)) { #if CYTHON_COMPILING_IN_PYPY if (!value) { Py_INCREF(Py_None); value = Py_None; } #endif PyErr_NormalizeException(&type, &value, &tb); } else { if (value) { PyErr_SetString(PyExc_TypeError, "instance exception may not have a separate value"); goto raise_error; } value = type; type = (PyObject*) Py_TYPE(type); Py_INCREF(type); if (!PyType_IsSubtype((PyTypeObject *)type, (PyTypeObject *)PyExc_BaseException)) { PyErr_SetString(PyExc_TypeError, "raise: exception class must be a subclass of BaseException"); goto raise_error; } } __Pyx_ErrRestore(type, value, tb); return; raise_error: Py_XDECREF(value); Py_XDECREF(type); Py_XDECREF(tb); return; } #else static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, PyObject *cause) { PyObject* owned_instance = NULL; if (tb == Py_None) { tb = 0; } else if (tb && !PyTraceBack_Check(tb)) { PyErr_SetString(PyExc_TypeError, "raise: arg 3 must be a traceback or None"); goto bad; } if (value == Py_None) value = 0; if (PyExceptionInstance_Check(type)) { if (value) { PyErr_SetString(PyExc_TypeError, "instance exception may not have a separate value"); goto bad; } value = type; type = (PyObject*) Py_TYPE(value); } else if (PyExceptionClass_Check(type)) { PyObject *instance_class = NULL; if (value && PyExceptionInstance_Check(value)) { instance_class = (PyObject*) Py_TYPE(value); if (instance_class != type) { int is_subclass = PyObject_IsSubclass(instance_class, type); if (!is_subclass) { instance_class = NULL; } else if (unlikely(is_subclass == -1)) { goto bad; } else { type = instance_class; } } } if (!instance_class) { PyObject *args; if (!value) args = PyTuple_New(0); else if (PyTuple_Check(value)) { Py_INCREF(value); args = value; } else args = PyTuple_Pack(1, value); if (!args) goto bad; owned_instance = PyObject_Call(type, args, NULL); Py_DECREF(args); if (!owned_instance) goto bad; value = owned_instance; if (!PyExceptionInstance_Check(value)) { PyErr_Format(PyExc_TypeError, "calling %R should have returned an instance of " "BaseException, not %R", type, Py_TYPE(value)); goto bad; } } } else { PyErr_SetString(PyExc_TypeError, "raise: exception class must be a subclass of BaseException"); goto bad; } #if PY_VERSION_HEX >= 0x03030000 if (cause) { #else if (cause && cause != Py_None) { #endif PyObject *fixed_cause; if (cause == Py_None) { fixed_cause = NULL; } else if (PyExceptionClass_Check(cause)) { fixed_cause = PyObject_CallObject(cause, NULL); if (fixed_cause == NULL) goto bad; } else if (PyExceptionInstance_Check(cause)) { fixed_cause = cause; Py_INCREF(fixed_cause); } else { PyErr_SetString(PyExc_TypeError, "exception causes must derive from " "BaseException"); goto bad; } PyException_SetCause(value, fixed_cause); } PyErr_SetObject(type, value); if (tb) { #if CYTHON_COMPILING_IN_PYPY PyObject *tmp_type, *tmp_value, *tmp_tb; PyErr_Fetch(&tmp_type, &tmp_value, &tmp_tb); Py_INCREF(tb); PyErr_Restore(tmp_type, tmp_value, tb); Py_XDECREF(tmp_tb); #else PyThreadState *tstate = PyThreadState_GET(); PyObject* tmp_tb = tstate->curexc_traceback; if (tb != tmp_tb) { Py_INCREF(tb); tstate->curexc_traceback = tb; Py_XDECREF(tmp_tb); } #endif } bad: Py_XDECREF(owned_instance); return; } #endif static void __Pyx_RaiseArgtupleInvalid( const char* func_name, int exact, Py_ssize_t num_min, Py_ssize_t num_max, Py_ssize_t num_found) { Py_ssize_t num_expected; const char *more_or_less; if (num_found < num_min) { num_expected = num_min; more_or_less = "at least"; } else { num_expected = num_max; more_or_less = "at most"; } if (exact) { more_or_less = "exactly"; } PyErr_Format(PyExc_TypeError, "%.200s() takes %.8s %" CYTHON_FORMAT_SSIZE_T "d positional argument%.1s (%" CYTHON_FORMAT_SSIZE_T "d given)", func_name, more_or_less, num_expected, (num_expected == 1) ? "" : "s", num_found); } static CYTHON_INLINE int __Pyx_CheckKeywordStrings( PyObject *kwdict, const char* function_name, int kw_allowed) { PyObject* key = 0; Py_ssize_t pos = 0; #if CYTHON_COMPILING_IN_PYPY if (!kw_allowed && PyDict_Next(kwdict, &pos, &key, 0)) goto invalid_keyword; return 1; #else while (PyDict_Next(kwdict, &pos, &key, 0)) { #if PY_MAJOR_VERSION < 3 if (unlikely(!PyString_CheckExact(key)) && unlikely(!PyString_Check(key))) #endif if (unlikely(!PyUnicode_Check(key))) goto invalid_keyword_type; } if ((!kw_allowed) && unlikely(key)) goto invalid_keyword; return 1; invalid_keyword_type: PyErr_Format(PyExc_TypeError, "%.200s() keywords must be strings", function_name); return 0; #endif invalid_keyword: PyErr_Format(PyExc_TypeError, #if PY_MAJOR_VERSION < 3 "%.200s() got an unexpected keyword argument '%.200s'", function_name, PyString_AsString(key)); #else "%s() got an unexpected keyword argument '%U'", function_name, key); #endif return 0; } static void __Pyx_RaiseDoubleKeywordsError( const char* func_name, PyObject* kw_name) { PyErr_Format(PyExc_TypeError, #if PY_MAJOR_VERSION >= 3 "%s() got multiple values for keyword argument '%U'", func_name, kw_name); #else "%s() got multiple values for keyword argument '%s'", func_name, PyString_AsString(kw_name)); #endif } static int __Pyx_ParseOptionalKeywords( PyObject *kwds, PyObject **argnames[], PyObject *kwds2, PyObject *values[], Py_ssize_t num_pos_args, const char* function_name) { PyObject *key = 0, *value = 0; Py_ssize_t pos = 0; PyObject*** name; PyObject*** first_kw_arg = argnames + num_pos_args; while (PyDict_Next(kwds, &pos, &key, &value)) { name = first_kw_arg; while (*name && (**name != key)) name++; if (*name) { values[name-argnames] = value; continue; } name = first_kw_arg; #if PY_MAJOR_VERSION < 3 if (likely(PyString_CheckExact(key)) || likely(PyString_Check(key))) { while (*name) { if ((CYTHON_COMPILING_IN_PYPY || PyString_GET_SIZE(**name) == PyString_GET_SIZE(key)) && _PyString_Eq(**name, key)) { values[name-argnames] = value; break; } name++; } if (*name) continue; else { PyObject*** argname = argnames; while (argname != first_kw_arg) { if ((**argname == key) || ( (CYTHON_COMPILING_IN_PYPY || PyString_GET_SIZE(**argname) == PyString_GET_SIZE(key)) && _PyString_Eq(**argname, key))) { goto arg_passed_twice; } argname++; } } } else #endif if (likely(PyUnicode_Check(key))) { while (*name) { int cmp = (**name == key) ? 0 : #if !CYTHON_COMPILING_IN_PYPY && PY_MAJOR_VERSION >= 3 (PyUnicode_GET_SIZE(**name) != PyUnicode_GET_SIZE(key)) ? 1 : #endif PyUnicode_Compare(**name, key); if (cmp < 0 && unlikely(PyErr_Occurred())) goto bad; if (cmp == 0) { values[name-argnames] = value; break; } name++; } if (*name) continue; else { PyObject*** argname = argnames; while (argname != first_kw_arg) { int cmp = (**argname == key) ? 0 : #if !CYTHON_COMPILING_IN_PYPY && PY_MAJOR_VERSION >= 3 (PyUnicode_GET_SIZE(**argname) != PyUnicode_GET_SIZE(key)) ? 1 : #endif PyUnicode_Compare(**argname, key); if (cmp < 0 && unlikely(PyErr_Occurred())) goto bad; if (cmp == 0) goto arg_passed_twice; argname++; } } } else goto invalid_keyword_type; if (kwds2) { if (unlikely(PyDict_SetItem(kwds2, key, value))) goto bad; } else { goto invalid_keyword; } } return 0; arg_passed_twice: __Pyx_RaiseDoubleKeywordsError(function_name, key); goto bad; invalid_keyword_type: PyErr_Format(PyExc_TypeError, "%.200s() keywords must be strings", function_name); goto bad; invalid_keyword: PyErr_Format(PyExc_TypeError, #if PY_MAJOR_VERSION < 3 "%.200s() got an unexpected keyword argument '%.200s'", function_name, PyString_AsString(key)); #else "%s() got an unexpected keyword argument '%U'", function_name, key); #endif bad: return -1; } static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list, int level) { PyObject *empty_list = 0; PyObject *module = 0; PyObject *global_dict = 0; PyObject *empty_dict = 0; PyObject *list; #if PY_VERSION_HEX < 0x03030000 PyObject *py_import; py_import = __Pyx_PyObject_GetAttrStr(__pyx_b, __pyx_n_s_import); if (!py_import) goto bad; #endif if (from_list) list = from_list; else { empty_list = PyList_New(0); if (!empty_list) goto bad; list = empty_list; } global_dict = PyModule_GetDict(__pyx_m); if (!global_dict) goto bad; empty_dict = PyDict_New(); if (!empty_dict) goto bad; { #if PY_MAJOR_VERSION >= 3 if (level == -1) { if (strchr(__Pyx_MODULE_NAME, '.')) { #if PY_VERSION_HEX < 0x03030000 PyObject *py_level = PyInt_FromLong(1); if (!py_level) goto bad; module = PyObject_CallFunctionObjArgs(py_import, name, global_dict, empty_dict, list, py_level, NULL); Py_DECREF(py_level); #else module = PyImport_ImportModuleLevelObject( name, global_dict, empty_dict, list, 1); #endif if (!module) { if (!PyErr_ExceptionMatches(PyExc_ImportError)) goto bad; PyErr_Clear(); } } level = 0; } #endif if (!module) { #if PY_VERSION_HEX < 0x03030000 PyObject *py_level = PyInt_FromLong(level); if (!py_level) goto bad; module = PyObject_CallFunctionObjArgs(py_import, name, global_dict, empty_dict, list, py_level, NULL); Py_DECREF(py_level); #else module = PyImport_ImportModuleLevelObject( name, global_dict, empty_dict, list, level); #endif } } bad: #if PY_VERSION_HEX < 0x03030000 Py_XDECREF(py_import); #endif Py_XDECREF(empty_list); Py_XDECREF(empty_dict); return module; } static PyObject* __Pyx_ImportFrom(PyObject* module, PyObject* name) { PyObject* value = __Pyx_PyObject_GetAttrStr(module, name); if (unlikely(!value) && PyErr_ExceptionMatches(PyExc_AttributeError)) { PyErr_Format(PyExc_ImportError, #if PY_MAJOR_VERSION < 3 "cannot import name %.230s", PyString_AS_STRING(name)); #else "cannot import name %S", name); #endif } return value; } static int __pyx_bisect_code_objects(__Pyx_CodeObjectCacheEntry* entries, int count, int code_line) { int start = 0, mid = 0, end = count - 1; if (end >= 0 && code_line > entries[end].code_line) { return count; } while (start < end) { mid = start + (end - start) / 2; if (code_line < entries[mid].code_line) { end = mid; } else if (code_line > entries[mid].code_line) { start = mid + 1; } else { return mid; } } if (code_line <= entries[mid].code_line) { return mid; } else { return mid + 1; } } static PyCodeObject *__pyx_find_code_object(int code_line) { PyCodeObject* code_object; int pos; if (unlikely(!code_line) || unlikely(!__pyx_code_cache.entries)) { return NULL; } pos = __pyx_bisect_code_objects(__pyx_code_cache.entries, __pyx_code_cache.count, code_line); if (unlikely(pos >= __pyx_code_cache.count) || unlikely(__pyx_code_cache.entries[pos].code_line != code_line)) { return NULL; } code_object = __pyx_code_cache.entries[pos].code_object; Py_INCREF(code_object); return code_object; } static void __pyx_insert_code_object(int code_line, PyCodeObject* code_object) { int pos, i; __Pyx_CodeObjectCacheEntry* entries = __pyx_code_cache.entries; if (unlikely(!code_line)) { return; } if (unlikely(!entries)) { entries = (__Pyx_CodeObjectCacheEntry*)PyMem_Malloc(64*sizeof(__Pyx_CodeObjectCacheEntry)); if (likely(entries)) { __pyx_code_cache.entries = entries; __pyx_code_cache.max_count = 64; __pyx_code_cache.count = 1; entries[0].code_line = code_line; entries[0].code_object = code_object; Py_INCREF(code_object); } return; } pos = __pyx_bisect_code_objects(__pyx_code_cache.entries, __pyx_code_cache.count, code_line); if ((pos < __pyx_code_cache.count) && unlikely(__pyx_code_cache.entries[pos].code_line == code_line)) { PyCodeObject* tmp = entries[pos].code_object; entries[pos].code_object = code_object; Py_DECREF(tmp); return; } if (__pyx_code_cache.count == __pyx_code_cache.max_count) { int new_max = __pyx_code_cache.max_count + 64; entries = (__Pyx_CodeObjectCacheEntry*)PyMem_Realloc( __pyx_code_cache.entries, (size_t)new_max*sizeof(__Pyx_CodeObjectCacheEntry)); if (unlikely(!entries)) { return; } __pyx_code_cache.entries = entries; __pyx_code_cache.max_count = new_max; } for (i=__pyx_code_cache.count; i>pos; i--) { entries[i] = entries[i-1]; } entries[pos].code_line = code_line; entries[pos].code_object = code_object; __pyx_code_cache.count++; Py_INCREF(code_object); } #include "compile.h" #include "frameobject.h" #include "traceback.h" static PyCodeObject* __Pyx_CreateCodeObjectForTraceback( const char *funcname, int c_line, int py_line, const char *filename) { PyCodeObject *py_code = 0; PyObject *py_srcfile = 0; PyObject *py_funcname = 0; #if PY_MAJOR_VERSION < 3 py_srcfile = PyString_FromString(filename); #else py_srcfile = PyUnicode_FromString(filename); #endif if (!py_srcfile) goto bad; if (c_line) { #if PY_MAJOR_VERSION < 3 py_funcname = PyString_FromFormat( "%s (%s:%d)", funcname, __pyx_cfilenm, c_line); #else py_funcname = PyUnicode_FromFormat( "%s (%s:%d)", funcname, __pyx_cfilenm, c_line); #endif } else { #if PY_MAJOR_VERSION < 3 py_funcname = PyString_FromString(funcname); #else py_funcname = PyUnicode_FromString(funcname); #endif } if (!py_funcname) goto bad; py_code = __Pyx_PyCode_New( 0, 0, 0, 0, 0, __pyx_empty_bytes, /*PyObject *code,*/ __pyx_empty_tuple, /*PyObject *consts,*/ __pyx_empty_tuple, /*PyObject *names,*/ __pyx_empty_tuple, /*PyObject *varnames,*/ __pyx_empty_tuple, /*PyObject *freevars,*/ __pyx_empty_tuple, /*PyObject *cellvars,*/ py_srcfile, /*PyObject *filename,*/ py_funcname, /*PyObject *name,*/ py_line, __pyx_empty_bytes /*PyObject *lnotab*/ ); Py_DECREF(py_srcfile); Py_DECREF(py_funcname); return py_code; bad: Py_XDECREF(py_srcfile); Py_XDECREF(py_funcname); return NULL; } static void __Pyx_AddTraceback(const char *funcname, int c_line, int py_line, const char *filename) { PyCodeObject *py_code = 0; PyFrameObject *py_frame = 0; py_code = __pyx_find_code_object(c_line ? c_line : py_line); if (!py_code) { py_code = __Pyx_CreateCodeObjectForTraceback( funcname, c_line, py_line, filename); if (!py_code) goto bad; __pyx_insert_code_object(c_line ? c_line : py_line, py_code); } py_frame = PyFrame_New( PyThreadState_GET(), /*PyThreadState *tstate,*/ py_code, /*PyCodeObject *code,*/ __pyx_d, /*PyObject *globals,*/ 0 /*PyObject *locals*/ ); if (!py_frame) goto bad; py_frame->f_lineno = py_line; PyTraceBack_Here(py_frame); bad: Py_XDECREF(py_code); Py_XDECREF(py_frame); } static CYTHON_INLINE PyObject* __Pyx_PyInt_From_int(int value) { const int neg_one = (int) -1, const_zero = (int) 0; const int is_unsigned = neg_one > const_zero; if (is_unsigned) { if (sizeof(int) < sizeof(long)) { return PyInt_FromLong((long) value); } else if (sizeof(int) <= sizeof(unsigned long)) { return PyLong_FromUnsignedLong((unsigned long) value); } else if (sizeof(int) <= sizeof(unsigned PY_LONG_LONG)) { return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value); } } else { if (sizeof(int) <= sizeof(long)) { return PyInt_FromLong((long) value); } else if (sizeof(int) <= sizeof(PY_LONG_LONG)) { return PyLong_FromLongLong((PY_LONG_LONG) value); } } { int one = 1; int little = (int)*(unsigned char *)&one; unsigned char *bytes = (unsigned char *)&value; return _PyLong_FromByteArray(bytes, sizeof(int), little, !is_unsigned); } } static CYTHON_INLINE PyObject* __Pyx_PyInt_From_SDL_GameControllerAxis(SDL_GameControllerAxis value) { const SDL_GameControllerAxis neg_one = (SDL_GameControllerAxis) -1, const_zero = (SDL_GameControllerAxis) 0; const int is_unsigned = neg_one > const_zero; if (is_unsigned) { if (sizeof(SDL_GameControllerAxis) < sizeof(long)) { return PyInt_FromLong((long) value); } else if (sizeof(SDL_GameControllerAxis) <= sizeof(unsigned long)) { return PyLong_FromUnsignedLong((unsigned long) value); } else if (sizeof(SDL_GameControllerAxis) <= sizeof(unsigned PY_LONG_LONG)) { return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value); } } else { if (sizeof(SDL_GameControllerAxis) <= sizeof(long)) { return PyInt_FromLong((long) value); } else if (sizeof(SDL_GameControllerAxis) <= sizeof(PY_LONG_LONG)) { return PyLong_FromLongLong((PY_LONG_LONG) value); } } { int one = 1; int little = (int)*(unsigned char *)&one; unsigned char *bytes = (unsigned char *)&value; return _PyLong_FromByteArray(bytes, sizeof(SDL_GameControllerAxis), little, !is_unsigned); } } static CYTHON_INLINE PyObject* __Pyx_PyInt_From_SDL_GameControllerButton(SDL_GameControllerButton value) { const SDL_GameControllerButton neg_one = (SDL_GameControllerButton) -1, const_zero = (SDL_GameControllerButton) 0; const int is_unsigned = neg_one > const_zero; if (is_unsigned) { if (sizeof(SDL_GameControllerButton) < sizeof(long)) { return PyInt_FromLong((long) value); } else if (sizeof(SDL_GameControllerButton) <= sizeof(unsigned long)) { return PyLong_FromUnsignedLong((unsigned long) value); } else if (sizeof(SDL_GameControllerButton) <= sizeof(unsigned PY_LONG_LONG)) { return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value); } } else { if (sizeof(SDL_GameControllerButton) <= sizeof(long)) { return PyInt_FromLong((long) value); } else if (sizeof(SDL_GameControllerButton) <= sizeof(PY_LONG_LONG)) { return PyLong_FromLongLong((PY_LONG_LONG) value); } } { int one = 1; int little = (int)*(unsigned char *)&one; unsigned char *bytes = (unsigned char *)&value; return _PyLong_FromByteArray(bytes, sizeof(SDL_GameControllerButton), little, !is_unsigned); } } #define __PYX_VERIFY_RETURN_INT(target_type, func_type, func_value)\ __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, 0) #define __PYX_VERIFY_RETURN_INT_EXC(target_type, func_type, func_value)\ __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, 1) #define __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, exc)\ {\ func_type value = func_value;\ if (sizeof(target_type) < sizeof(func_type)) {\ if (unlikely(value != (func_type) (target_type) value)) {\ func_type zero = 0;\ if (exc && unlikely(value == (func_type)-1 && PyErr_Occurred()))\ return (target_type) -1;\ if (is_unsigned && unlikely(value < zero))\ goto raise_neg_overflow;\ else\ goto raise_overflow;\ }\ }\ return (target_type) value;\ } #if CYTHON_USE_PYLONG_INTERNALS #include "longintrepr.h" #endif static CYTHON_INLINE SDL_GameControllerAxis __Pyx_PyInt_As_SDL_GameControllerAxis(PyObject *x) { const SDL_GameControllerAxis neg_one = (SDL_GameControllerAxis) -1, const_zero = (SDL_GameControllerAxis) 0; const int is_unsigned = neg_one > const_zero; #if PY_MAJOR_VERSION < 3 if (likely(PyInt_Check(x))) { if (sizeof(SDL_GameControllerAxis) < sizeof(long)) { __PYX_VERIFY_RETURN_INT(SDL_GameControllerAxis, long, PyInt_AS_LONG(x)) } else { long val = PyInt_AS_LONG(x); if (is_unsigned && unlikely(val < 0)) { goto raise_neg_overflow; } return (SDL_GameControllerAxis) val; } } else #endif if (likely(PyLong_Check(x))) { if (is_unsigned) { #if CYTHON_USE_PYLONG_INTERNALS const digit* digits = ((PyLongObject*)x)->ob_digit; switch (Py_SIZE(x)) { case 0: return (SDL_GameControllerAxis) 0; case 1: __PYX_VERIFY_RETURN_INT(SDL_GameControllerAxis, digit, digits[0]) case 2: if (8 * sizeof(SDL_GameControllerAxis) > 1 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(SDL_GameControllerAxis, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(SDL_GameControllerAxis) >= 2 * PyLong_SHIFT) { return (SDL_GameControllerAxis) (((((SDL_GameControllerAxis)digits[1]) << PyLong_SHIFT) | (SDL_GameControllerAxis)digits[0])); } } break; case 3: if (8 * sizeof(SDL_GameControllerAxis) > 2 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(SDL_GameControllerAxis, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(SDL_GameControllerAxis) >= 3 * PyLong_SHIFT) { return (SDL_GameControllerAxis) (((((((SDL_GameControllerAxis)digits[2]) << PyLong_SHIFT) | (SDL_GameControllerAxis)digits[1]) << PyLong_SHIFT) | (SDL_GameControllerAxis)digits[0])); } } break; case 4: if (8 * sizeof(SDL_GameControllerAxis) > 3 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(SDL_GameControllerAxis, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(SDL_GameControllerAxis) >= 4 * PyLong_SHIFT) { return (SDL_GameControllerAxis) (((((((((SDL_GameControllerAxis)digits[3]) << PyLong_SHIFT) | (SDL_GameControllerAxis)digits[2]) << PyLong_SHIFT) | (SDL_GameControllerAxis)digits[1]) << PyLong_SHIFT) | (SDL_GameControllerAxis)digits[0])); } } break; } #endif #if CYTHON_COMPILING_IN_CPYTHON if (unlikely(Py_SIZE(x) < 0)) { goto raise_neg_overflow; } #else { int result = PyObject_RichCompareBool(x, Py_False, Py_LT); if (unlikely(result < 0)) return (SDL_GameControllerAxis) -1; if (unlikely(result == 1)) goto raise_neg_overflow; } #endif if (sizeof(SDL_GameControllerAxis) <= sizeof(unsigned long)) { __PYX_VERIFY_RETURN_INT_EXC(SDL_GameControllerAxis, unsigned long, PyLong_AsUnsignedLong(x)) } else if (sizeof(SDL_GameControllerAxis) <= sizeof(unsigned PY_LONG_LONG)) { __PYX_VERIFY_RETURN_INT_EXC(SDL_GameControllerAxis, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x)) } } else { #if CYTHON_USE_PYLONG_INTERNALS const digit* digits = ((PyLongObject*)x)->ob_digit; switch (Py_SIZE(x)) { case 0: return (SDL_GameControllerAxis) 0; case -1: __PYX_VERIFY_RETURN_INT(SDL_GameControllerAxis, sdigit, -(sdigit) digits[0]) case 1: __PYX_VERIFY_RETURN_INT(SDL_GameControllerAxis, digit, +digits[0]) case -2: if (8 * sizeof(SDL_GameControllerAxis) - 1 > 1 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(SDL_GameControllerAxis, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(SDL_GameControllerAxis) - 1 > 2 * PyLong_SHIFT) { return (SDL_GameControllerAxis) (((SDL_GameControllerAxis)-1)*(((((SDL_GameControllerAxis)digits[1]) << PyLong_SHIFT) | (SDL_GameControllerAxis)digits[0]))); } } break; case 2: if (8 * sizeof(SDL_GameControllerAxis) > 1 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(SDL_GameControllerAxis, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(SDL_GameControllerAxis) - 1 > 2 * PyLong_SHIFT) { return (SDL_GameControllerAxis) ((((((SDL_GameControllerAxis)digits[1]) << PyLong_SHIFT) | (SDL_GameControllerAxis)digits[0]))); } } break; case -3: if (8 * sizeof(SDL_GameControllerAxis) - 1 > 2 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(SDL_GameControllerAxis, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(SDL_GameControllerAxis) - 1 > 3 * PyLong_SHIFT) { return (SDL_GameControllerAxis) (((SDL_GameControllerAxis)-1)*(((((((SDL_GameControllerAxis)digits[2]) << PyLong_SHIFT) | (SDL_GameControllerAxis)digits[1]) << PyLong_SHIFT) | (SDL_GameControllerAxis)digits[0]))); } } break; case 3: if (8 * sizeof(SDL_GameControllerAxis) > 2 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(SDL_GameControllerAxis, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(SDL_GameControllerAxis) - 1 > 3 * PyLong_SHIFT) { return (SDL_GameControllerAxis) ((((((((SDL_GameControllerAxis)digits[2]) << PyLong_SHIFT) | (SDL_GameControllerAxis)digits[1]) << PyLong_SHIFT) | (SDL_GameControllerAxis)digits[0]))); } } break; case -4: if (8 * sizeof(SDL_GameControllerAxis) - 1 > 3 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(SDL_GameControllerAxis, long, -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(SDL_GameControllerAxis) - 1 > 4 * PyLong_SHIFT) { return (SDL_GameControllerAxis) (((SDL_GameControllerAxis)-1)*(((((((((SDL_GameControllerAxis)digits[3]) << PyLong_SHIFT) | (SDL_GameControllerAxis)digits[2]) << PyLong_SHIFT) | (SDL_GameControllerAxis)digits[1]) << PyLong_SHIFT) | (SDL_GameControllerAxis)digits[0]))); } } break; case 4: if (8 * sizeof(SDL_GameControllerAxis) > 3 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(SDL_GameControllerAxis, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(SDL_GameControllerAxis) - 1 > 4 * PyLong_SHIFT) { return (SDL_GameControllerAxis) ((((((((((SDL_GameControllerAxis)digits[3]) << PyLong_SHIFT) | (SDL_GameControllerAxis)digits[2]) << PyLong_SHIFT) | (SDL_GameControllerAxis)digits[1]) << PyLong_SHIFT) | (SDL_GameControllerAxis)digits[0]))); } } break; } #endif if (sizeof(SDL_GameControllerAxis) <= sizeof(long)) { __PYX_VERIFY_RETURN_INT_EXC(SDL_GameControllerAxis, long, PyLong_AsLong(x)) } else if (sizeof(SDL_GameControllerAxis) <= sizeof(PY_LONG_LONG)) { __PYX_VERIFY_RETURN_INT_EXC(SDL_GameControllerAxis, PY_LONG_LONG, PyLong_AsLongLong(x)) } } { #if CYTHON_COMPILING_IN_PYPY && !defined(_PyLong_AsByteArray) PyErr_SetString(PyExc_RuntimeError, "_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers"); #else SDL_GameControllerAxis val; PyObject *v = __Pyx_PyNumber_Int(x); #if PY_MAJOR_VERSION < 3 if (likely(v) && !PyLong_Check(v)) { PyObject *tmp = v; v = PyNumber_Long(tmp); Py_DECREF(tmp); } #endif if (likely(v)) { int one = 1; int is_little = (int)*(unsigned char *)&one; unsigned char *bytes = (unsigned char *)&val; int ret = _PyLong_AsByteArray((PyLongObject *)v, bytes, sizeof(val), is_little, !is_unsigned); Py_DECREF(v); if (likely(!ret)) return val; } #endif return (SDL_GameControllerAxis) -1; } } else { SDL_GameControllerAxis val; PyObject *tmp = __Pyx_PyNumber_Int(x); if (!tmp) return (SDL_GameControllerAxis) -1; val = __Pyx_PyInt_As_SDL_GameControllerAxis(tmp); Py_DECREF(tmp); return val; } raise_overflow: PyErr_SetString(PyExc_OverflowError, "value too large to convert to SDL_GameControllerAxis"); return (SDL_GameControllerAxis) -1; raise_neg_overflow: PyErr_SetString(PyExc_OverflowError, "can't convert negative value to SDL_GameControllerAxis"); return (SDL_GameControllerAxis) -1; } static CYTHON_INLINE SDL_GameControllerButton __Pyx_PyInt_As_SDL_GameControllerButton(PyObject *x) { const SDL_GameControllerButton neg_one = (SDL_GameControllerButton) -1, const_zero = (SDL_GameControllerButton) 0; const int is_unsigned = neg_one > const_zero; #if PY_MAJOR_VERSION < 3 if (likely(PyInt_Check(x))) { if (sizeof(SDL_GameControllerButton) < sizeof(long)) { __PYX_VERIFY_RETURN_INT(SDL_GameControllerButton, long, PyInt_AS_LONG(x)) } else { long val = PyInt_AS_LONG(x); if (is_unsigned && unlikely(val < 0)) { goto raise_neg_overflow; } return (SDL_GameControllerButton) val; } } else #endif if (likely(PyLong_Check(x))) { if (is_unsigned) { #if CYTHON_USE_PYLONG_INTERNALS const digit* digits = ((PyLongObject*)x)->ob_digit; switch (Py_SIZE(x)) { case 0: return (SDL_GameControllerButton) 0; case 1: __PYX_VERIFY_RETURN_INT(SDL_GameControllerButton, digit, digits[0]) case 2: if (8 * sizeof(SDL_GameControllerButton) > 1 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(SDL_GameControllerButton, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(SDL_GameControllerButton) >= 2 * PyLong_SHIFT) { return (SDL_GameControllerButton) (((((SDL_GameControllerButton)digits[1]) << PyLong_SHIFT) | (SDL_GameControllerButton)digits[0])); } } break; case 3: if (8 * sizeof(SDL_GameControllerButton) > 2 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(SDL_GameControllerButton, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(SDL_GameControllerButton) >= 3 * PyLong_SHIFT) { return (SDL_GameControllerButton) (((((((SDL_GameControllerButton)digits[2]) << PyLong_SHIFT) | (SDL_GameControllerButton)digits[1]) << PyLong_SHIFT) | (SDL_GameControllerButton)digits[0])); } } break; case 4: if (8 * sizeof(SDL_GameControllerButton) > 3 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(SDL_GameControllerButton, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(SDL_GameControllerButton) >= 4 * PyLong_SHIFT) { return (SDL_GameControllerButton) (((((((((SDL_GameControllerButton)digits[3]) << PyLong_SHIFT) | (SDL_GameControllerButton)digits[2]) << PyLong_SHIFT) | (SDL_GameControllerButton)digits[1]) << PyLong_SHIFT) | (SDL_GameControllerButton)digits[0])); } } break; } #endif #if CYTHON_COMPILING_IN_CPYTHON if (unlikely(Py_SIZE(x) < 0)) { goto raise_neg_overflow; } #else { int result = PyObject_RichCompareBool(x, Py_False, Py_LT); if (unlikely(result < 0)) return (SDL_GameControllerButton) -1; if (unlikely(result == 1)) goto raise_neg_overflow; } #endif if (sizeof(SDL_GameControllerButton) <= sizeof(unsigned long)) { __PYX_VERIFY_RETURN_INT_EXC(SDL_GameControllerButton, unsigned long, PyLong_AsUnsignedLong(x)) } else if (sizeof(SDL_GameControllerButton) <= sizeof(unsigned PY_LONG_LONG)) { __PYX_VERIFY_RETURN_INT_EXC(SDL_GameControllerButton, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x)) } } else { #if CYTHON_USE_PYLONG_INTERNALS const digit* digits = ((PyLongObject*)x)->ob_digit; switch (Py_SIZE(x)) { case 0: return (SDL_GameControllerButton) 0; case -1: __PYX_VERIFY_RETURN_INT(SDL_GameControllerButton, sdigit, -(sdigit) digits[0]) case 1: __PYX_VERIFY_RETURN_INT(SDL_GameControllerButton, digit, +digits[0]) case -2: if (8 * sizeof(SDL_GameControllerButton) - 1 > 1 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(SDL_GameControllerButton, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(SDL_GameControllerButton) - 1 > 2 * PyLong_SHIFT) { return (SDL_GameControllerButton) (((SDL_GameControllerButton)-1)*(((((SDL_GameControllerButton)digits[1]) << PyLong_SHIFT) | (SDL_GameControllerButton)digits[0]))); } } break; case 2: if (8 * sizeof(SDL_GameControllerButton) > 1 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(SDL_GameControllerButton, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(SDL_GameControllerButton) - 1 > 2 * PyLong_SHIFT) { return (SDL_GameControllerButton) ((((((SDL_GameControllerButton)digits[1]) << PyLong_SHIFT) | (SDL_GameControllerButton)digits[0]))); } } break; case -3: if (8 * sizeof(SDL_GameControllerButton) - 1 > 2 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(SDL_GameControllerButton, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(SDL_GameControllerButton) - 1 > 3 * PyLong_SHIFT) { return (SDL_GameControllerButton) (((SDL_GameControllerButton)-1)*(((((((SDL_GameControllerButton)digits[2]) << PyLong_SHIFT) | (SDL_GameControllerButton)digits[1]) << PyLong_SHIFT) | (SDL_GameControllerButton)digits[0]))); } } break; case 3: if (8 * sizeof(SDL_GameControllerButton) > 2 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(SDL_GameControllerButton, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(SDL_GameControllerButton) - 1 > 3 * PyLong_SHIFT) { return (SDL_GameControllerButton) ((((((((SDL_GameControllerButton)digits[2]) << PyLong_SHIFT) | (SDL_GameControllerButton)digits[1]) << PyLong_SHIFT) | (SDL_GameControllerButton)digits[0]))); } } break; case -4: if (8 * sizeof(SDL_GameControllerButton) - 1 > 3 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(SDL_GameControllerButton, long, -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(SDL_GameControllerButton) - 1 > 4 * PyLong_SHIFT) { return (SDL_GameControllerButton) (((SDL_GameControllerButton)-1)*(((((((((SDL_GameControllerButton)digits[3]) << PyLong_SHIFT) | (SDL_GameControllerButton)digits[2]) << PyLong_SHIFT) | (SDL_GameControllerButton)digits[1]) << PyLong_SHIFT) | (SDL_GameControllerButton)digits[0]))); } } break; case 4: if (8 * sizeof(SDL_GameControllerButton) > 3 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(SDL_GameControllerButton, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(SDL_GameControllerButton) - 1 > 4 * PyLong_SHIFT) { return (SDL_GameControllerButton) ((((((((((SDL_GameControllerButton)digits[3]) << PyLong_SHIFT) | (SDL_GameControllerButton)digits[2]) << PyLong_SHIFT) | (SDL_GameControllerButton)digits[1]) << PyLong_SHIFT) | (SDL_GameControllerButton)digits[0]))); } } break; } #endif if (sizeof(SDL_GameControllerButton) <= sizeof(long)) { __PYX_VERIFY_RETURN_INT_EXC(SDL_GameControllerButton, long, PyLong_AsLong(x)) } else if (sizeof(SDL_GameControllerButton) <= sizeof(PY_LONG_LONG)) { __PYX_VERIFY_RETURN_INT_EXC(SDL_GameControllerButton, PY_LONG_LONG, PyLong_AsLongLong(x)) } } { #if CYTHON_COMPILING_IN_PYPY && !defined(_PyLong_AsByteArray) PyErr_SetString(PyExc_RuntimeError, "_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers"); #else SDL_GameControllerButton val; PyObject *v = __Pyx_PyNumber_Int(x); #if PY_MAJOR_VERSION < 3 if (likely(v) && !PyLong_Check(v)) { PyObject *tmp = v; v = PyNumber_Long(tmp); Py_DECREF(tmp); } #endif if (likely(v)) { int one = 1; int is_little = (int)*(unsigned char *)&one; unsigned char *bytes = (unsigned char *)&val; int ret = _PyLong_AsByteArray((PyLongObject *)v, bytes, sizeof(val), is_little, !is_unsigned); Py_DECREF(v); if (likely(!ret)) return val; } #endif return (SDL_GameControllerButton) -1; } } else { SDL_GameControllerButton val; PyObject *tmp = __Pyx_PyNumber_Int(x); if (!tmp) return (SDL_GameControllerButton) -1; val = __Pyx_PyInt_As_SDL_GameControllerButton(tmp); Py_DECREF(tmp); return val; } raise_overflow: PyErr_SetString(PyExc_OverflowError, "value too large to convert to SDL_GameControllerButton"); return (SDL_GameControllerButton) -1; raise_neg_overflow: PyErr_SetString(PyExc_OverflowError, "can't convert negative value to SDL_GameControllerButton"); return (SDL_GameControllerButton) -1; } static CYTHON_INLINE int __Pyx_PyInt_As_int(PyObject *x) { const int neg_one = (int) -1, const_zero = (int) 0; const int is_unsigned = neg_one > const_zero; #if PY_MAJOR_VERSION < 3 if (likely(PyInt_Check(x))) { if (sizeof(int) < sizeof(long)) { __PYX_VERIFY_RETURN_INT(int, long, PyInt_AS_LONG(x)) } else { long val = PyInt_AS_LONG(x); if (is_unsigned && unlikely(val < 0)) { goto raise_neg_overflow; } return (int) val; } } else #endif if (likely(PyLong_Check(x))) { if (is_unsigned) { #if CYTHON_USE_PYLONG_INTERNALS const digit* digits = ((PyLongObject*)x)->ob_digit; switch (Py_SIZE(x)) { case 0: return (int) 0; case 1: __PYX_VERIFY_RETURN_INT(int, digit, digits[0]) case 2: if (8 * sizeof(int) > 1 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(int) >= 2 * PyLong_SHIFT) { return (int) (((((int)digits[1]) << PyLong_SHIFT) | (int)digits[0])); } } break; case 3: if (8 * sizeof(int) > 2 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(int) >= 3 * PyLong_SHIFT) { return (int) (((((((int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0])); } } break; case 4: if (8 * sizeof(int) > 3 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(int) >= 4 * PyLong_SHIFT) { return (int) (((((((((int)digits[3]) << PyLong_SHIFT) | (int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0])); } } break; } #endif #if CYTHON_COMPILING_IN_CPYTHON if (unlikely(Py_SIZE(x) < 0)) { goto raise_neg_overflow; } #else { int result = PyObject_RichCompareBool(x, Py_False, Py_LT); if (unlikely(result < 0)) return (int) -1; if (unlikely(result == 1)) goto raise_neg_overflow; } #endif if (sizeof(int) <= sizeof(unsigned long)) { __PYX_VERIFY_RETURN_INT_EXC(int, unsigned long, PyLong_AsUnsignedLong(x)) } else if (sizeof(int) <= sizeof(unsigned PY_LONG_LONG)) { __PYX_VERIFY_RETURN_INT_EXC(int, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x)) } } else { #if CYTHON_USE_PYLONG_INTERNALS const digit* digits = ((PyLongObject*)x)->ob_digit; switch (Py_SIZE(x)) { case 0: return (int) 0; case -1: __PYX_VERIFY_RETURN_INT(int, sdigit, -(sdigit) digits[0]) case 1: __PYX_VERIFY_RETURN_INT(int, digit, +digits[0]) case -2: if (8 * sizeof(int) - 1 > 1 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(int, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(int) - 1 > 2 * PyLong_SHIFT) { return (int) (((int)-1)*(((((int)digits[1]) << PyLong_SHIFT) | (int)digits[0]))); } } break; case 2: if (8 * sizeof(int) > 1 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(int) - 1 > 2 * PyLong_SHIFT) { return (int) ((((((int)digits[1]) << PyLong_SHIFT) | (int)digits[0]))); } } break; case -3: if (8 * sizeof(int) - 1 > 2 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(int, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(int) - 1 > 3 * PyLong_SHIFT) { return (int) (((int)-1)*(((((((int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0]))); } } break; case 3: if (8 * sizeof(int) > 2 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(int) - 1 > 3 * PyLong_SHIFT) { return (int) ((((((((int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0]))); } } break; case -4: if (8 * sizeof(int) - 1 > 3 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(int, long, -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(int) - 1 > 4 * PyLong_SHIFT) { return (int) (((int)-1)*(((((((((int)digits[3]) << PyLong_SHIFT) | (int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0]))); } } break; case 4: if (8 * sizeof(int) > 3 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(int) - 1 > 4 * PyLong_SHIFT) { return (int) ((((((((((int)digits[3]) << PyLong_SHIFT) | (int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0]))); } } break; } #endif if (sizeof(int) <= sizeof(long)) { __PYX_VERIFY_RETURN_INT_EXC(int, long, PyLong_AsLong(x)) } else if (sizeof(int) <= sizeof(PY_LONG_LONG)) { __PYX_VERIFY_RETURN_INT_EXC(int, PY_LONG_LONG, PyLong_AsLongLong(x)) } } { #if CYTHON_COMPILING_IN_PYPY && !defined(_PyLong_AsByteArray) PyErr_SetString(PyExc_RuntimeError, "_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers"); #else int val; PyObject *v = __Pyx_PyNumber_Int(x); #if PY_MAJOR_VERSION < 3 if (likely(v) && !PyLong_Check(v)) { PyObject *tmp = v; v = PyNumber_Long(tmp); Py_DECREF(tmp); } #endif if (likely(v)) { int one = 1; int is_little = (int)*(unsigned char *)&one; unsigned char *bytes = (unsigned char *)&val; int ret = _PyLong_AsByteArray((PyLongObject *)v, bytes, sizeof(val), is_little, !is_unsigned); Py_DECREF(v); if (likely(!ret)) return val; } #endif return (int) -1; } } else { int val; PyObject *tmp = __Pyx_PyNumber_Int(x); if (!tmp) return (int) -1; val = __Pyx_PyInt_As_int(tmp); Py_DECREF(tmp); return val; } raise_overflow: PyErr_SetString(PyExc_OverflowError, "value too large to convert to int"); return (int) -1; raise_neg_overflow: PyErr_SetString(PyExc_OverflowError, "can't convert negative value to int"); return (int) -1; } static CYTHON_INLINE PyObject* __Pyx_PyInt_From_int16_t(int16_t value) { const int16_t neg_one = (int16_t) -1, const_zero = (int16_t) 0; const int is_unsigned = neg_one > const_zero; if (is_unsigned) { if (sizeof(int16_t) < sizeof(long)) { return PyInt_FromLong((long) value); } else if (sizeof(int16_t) <= sizeof(unsigned long)) { return PyLong_FromUnsignedLong((unsigned long) value); } else if (sizeof(int16_t) <= sizeof(unsigned PY_LONG_LONG)) { return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value); } } else { if (sizeof(int16_t) <= sizeof(long)) { return PyInt_FromLong((long) value); } else if (sizeof(int16_t) <= sizeof(PY_LONG_LONG)) { return PyLong_FromLongLong((PY_LONG_LONG) value); } } { int one = 1; int little = (int)*(unsigned char *)&one; unsigned char *bytes = (unsigned char *)&value; return _PyLong_FromByteArray(bytes, sizeof(int16_t), little, !is_unsigned); } } static CYTHON_INLINE PyObject* __Pyx_PyInt_From_uint8_t(uint8_t value) { const uint8_t neg_one = (uint8_t) -1, const_zero = (uint8_t) 0; const int is_unsigned = neg_one > const_zero; if (is_unsigned) { if (sizeof(uint8_t) < sizeof(long)) { return PyInt_FromLong((long) value); } else if (sizeof(uint8_t) <= sizeof(unsigned long)) { return PyLong_FromUnsignedLong((unsigned long) value); } else if (sizeof(uint8_t) <= sizeof(unsigned PY_LONG_LONG)) { return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value); } } else { if (sizeof(uint8_t) <= sizeof(long)) { return PyInt_FromLong((long) value); } else if (sizeof(uint8_t) <= sizeof(PY_LONG_LONG)) { return PyLong_FromLongLong((PY_LONG_LONG) value); } } { int one = 1; int little = (int)*(unsigned char *)&one; unsigned char *bytes = (unsigned char *)&value; return _PyLong_FromByteArray(bytes, sizeof(uint8_t), little, !is_unsigned); } } static CYTHON_INLINE PyObject* __Pyx_PyInt_From_SDL_bool(SDL_bool value) { const SDL_bool neg_one = (SDL_bool) -1, const_zero = (SDL_bool) 0; const int is_unsigned = neg_one > const_zero; if (is_unsigned) { if (sizeof(SDL_bool) < sizeof(long)) { return PyInt_FromLong((long) value); } else if (sizeof(SDL_bool) <= sizeof(unsigned long)) { return PyLong_FromUnsignedLong((unsigned long) value); } else if (sizeof(SDL_bool) <= sizeof(unsigned PY_LONG_LONG)) { return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value); } } else { if (sizeof(SDL_bool) <= sizeof(long)) { return PyInt_FromLong((long) value); } else if (sizeof(SDL_bool) <= sizeof(PY_LONG_LONG)) { return PyLong_FromLongLong((PY_LONG_LONG) value); } } { int one = 1; int little = (int)*(unsigned char *)&one; unsigned char *bytes = (unsigned char *)&value; return _PyLong_FromByteArray(bytes, sizeof(SDL_bool), little, !is_unsigned); } } static CYTHON_INLINE PyObject* __Pyx_PyInt_From_long(long value) { const long neg_one = (long) -1, const_zero = (long) 0; const int is_unsigned = neg_one > const_zero; if (is_unsigned) { if (sizeof(long) < sizeof(long)) { return PyInt_FromLong((long) value); } else if (sizeof(long) <= sizeof(unsigned long)) { return PyLong_FromUnsignedLong((unsigned long) value); } else if (sizeof(long) <= sizeof(unsigned PY_LONG_LONG)) { return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value); } } else { if (sizeof(long) <= sizeof(long)) { return PyInt_FromLong((long) value); } else if (sizeof(long) <= sizeof(PY_LONG_LONG)) { return PyLong_FromLongLong((PY_LONG_LONG) value); } } { int one = 1; int little = (int)*(unsigned char *)&one; unsigned char *bytes = (unsigned char *)&value; return _PyLong_FromByteArray(bytes, sizeof(long), little, !is_unsigned); } } static CYTHON_INLINE long __Pyx_PyInt_As_long(PyObject *x) { const long neg_one = (long) -1, const_zero = (long) 0; const int is_unsigned = neg_one > const_zero; #if PY_MAJOR_VERSION < 3 if (likely(PyInt_Check(x))) { if (sizeof(long) < sizeof(long)) { __PYX_VERIFY_RETURN_INT(long, long, PyInt_AS_LONG(x)) } else { long val = PyInt_AS_LONG(x); if (is_unsigned && unlikely(val < 0)) { goto raise_neg_overflow; } return (long) val; } } else #endif if (likely(PyLong_Check(x))) { if (is_unsigned) { #if CYTHON_USE_PYLONG_INTERNALS const digit* digits = ((PyLongObject*)x)->ob_digit; switch (Py_SIZE(x)) { case 0: return (long) 0; case 1: __PYX_VERIFY_RETURN_INT(long, digit, digits[0]) case 2: if (8 * sizeof(long) > 1 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(long) >= 2 * PyLong_SHIFT) { return (long) (((((long)digits[1]) << PyLong_SHIFT) | (long)digits[0])); } } break; case 3: if (8 * sizeof(long) > 2 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(long) >= 3 * PyLong_SHIFT) { return (long) (((((((long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0])); } } break; case 4: if (8 * sizeof(long) > 3 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(long) >= 4 * PyLong_SHIFT) { return (long) (((((((((long)digits[3]) << PyLong_SHIFT) | (long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0])); } } break; } #endif #if CYTHON_COMPILING_IN_CPYTHON if (unlikely(Py_SIZE(x) < 0)) { goto raise_neg_overflow; } #else { int result = PyObject_RichCompareBool(x, Py_False, Py_LT); if (unlikely(result < 0)) return (long) -1; if (unlikely(result == 1)) goto raise_neg_overflow; } #endif if (sizeof(long) <= sizeof(unsigned long)) { __PYX_VERIFY_RETURN_INT_EXC(long, unsigned long, PyLong_AsUnsignedLong(x)) } else if (sizeof(long) <= sizeof(unsigned PY_LONG_LONG)) { __PYX_VERIFY_RETURN_INT_EXC(long, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x)) } } else { #if CYTHON_USE_PYLONG_INTERNALS const digit* digits = ((PyLongObject*)x)->ob_digit; switch (Py_SIZE(x)) { case 0: return (long) 0; case -1: __PYX_VERIFY_RETURN_INT(long, sdigit, -(sdigit) digits[0]) case 1: __PYX_VERIFY_RETURN_INT(long, digit, +digits[0]) case -2: if (8 * sizeof(long) - 1 > 1 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(long, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) { return (long) (((long)-1)*(((((long)digits[1]) << PyLong_SHIFT) | (long)digits[0]))); } } break; case 2: if (8 * sizeof(long) > 1 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) { return (long) ((((((long)digits[1]) << PyLong_SHIFT) | (long)digits[0]))); } } break; case -3: if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(long, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) { return (long) (((long)-1)*(((((((long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0]))); } } break; case 3: if (8 * sizeof(long) > 2 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) { return (long) ((((((((long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0]))); } } break; case -4: if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(long, long, -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(long) - 1 > 4 * PyLong_SHIFT) { return (long) (((long)-1)*(((((((((long)digits[3]) << PyLong_SHIFT) | (long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0]))); } } break; case 4: if (8 * sizeof(long) > 3 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(long) - 1 > 4 * PyLong_SHIFT) { return (long) ((((((((((long)digits[3]) << PyLong_SHIFT) | (long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0]))); } } break; } #endif if (sizeof(long) <= sizeof(long)) { __PYX_VERIFY_RETURN_INT_EXC(long, long, PyLong_AsLong(x)) } else if (sizeof(long) <= sizeof(PY_LONG_LONG)) { __PYX_VERIFY_RETURN_INT_EXC(long, PY_LONG_LONG, PyLong_AsLongLong(x)) } } { #if CYTHON_COMPILING_IN_PYPY && !defined(_PyLong_AsByteArray) PyErr_SetString(PyExc_RuntimeError, "_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers"); #else long val; PyObject *v = __Pyx_PyNumber_Int(x); #if PY_MAJOR_VERSION < 3 if (likely(v) && !PyLong_Check(v)) { PyObject *tmp = v; v = PyNumber_Long(tmp); Py_DECREF(tmp); } #endif if (likely(v)) { int one = 1; int is_little = (int)*(unsigned char *)&one; unsigned char *bytes = (unsigned char *)&val; int ret = _PyLong_AsByteArray((PyLongObject *)v, bytes, sizeof(val), is_little, !is_unsigned); Py_DECREF(v); if (likely(!ret)) return val; } #endif return (long) -1; } } else { long val; PyObject *tmp = __Pyx_PyNumber_Int(x); if (!tmp) return (long) -1; val = __Pyx_PyInt_As_long(tmp); Py_DECREF(tmp); return val; } raise_overflow: PyErr_SetString(PyExc_OverflowError, "value too large to convert to long"); return (long) -1; raise_neg_overflow: PyErr_SetString(PyExc_OverflowError, "can't convert negative value to long"); return (long) -1; } static int __Pyx_check_binary_version(void) { char ctversion[4], rtversion[4]; PyOS_snprintf(ctversion, 4, "%d.%d", PY_MAJOR_VERSION, PY_MINOR_VERSION); PyOS_snprintf(rtversion, 4, "%s", Py_GetVersion()); if (ctversion[0] != rtversion[0] || ctversion[2] != rtversion[2]) { char message[200]; PyOS_snprintf(message, sizeof(message), "compiletime version %s of module '%.100s' " "does not match runtime version %s", ctversion, __Pyx_MODULE_NAME, rtversion); return PyErr_WarnEx(NULL, message, 1); } return 0; } #ifndef __PYX_HAVE_RT_ImportModule #define __PYX_HAVE_RT_ImportModule static PyObject *__Pyx_ImportModule(const char *name) { PyObject *py_name = 0; PyObject *py_module = 0; py_name = __Pyx_PyIdentifier_FromString(name); if (!py_name) goto bad; py_module = PyImport_Import(py_name); Py_DECREF(py_name); return py_module; bad: Py_XDECREF(py_name); return 0; } #endif #ifndef __PYX_HAVE_RT_ImportFunction #define __PYX_HAVE_RT_ImportFunction static int __Pyx_ImportFunction(PyObject *module, const char *funcname, void (**f)(void), const char *sig) { PyObject *d = 0; PyObject *cobj = 0; union { void (*fp)(void); void *p; } tmp; d = PyObject_GetAttrString(module, (char *)"__pyx_capi__"); if (!d) goto bad; cobj = PyDict_GetItemString(d, funcname); if (!cobj) { PyErr_Format(PyExc_ImportError, "%.200s does not export expected C function %.200s", PyModule_GetName(module), funcname); goto bad; } #if PY_VERSION_HEX >= 0x02070000 if (!PyCapsule_IsValid(cobj, sig)) { PyErr_Format(PyExc_TypeError, "C function %.200s.%.200s has wrong signature (expected %.500s, got %.500s)", PyModule_GetName(module), funcname, sig, PyCapsule_GetName(cobj)); goto bad; } tmp.p = PyCapsule_GetPointer(cobj, sig); #else {const char *desc, *s1, *s2; desc = (const char *)PyCObject_GetDesc(cobj); if (!desc) goto bad; s1 = desc; s2 = sig; while (*s1 != '\0' && *s1 == *s2) { s1++; s2++; } if (*s1 != *s2) { PyErr_Format(PyExc_TypeError, "C function %.200s.%.200s has wrong signature (expected %.500s, got %.500s)", PyModule_GetName(module), funcname, sig, desc); goto bad; } tmp.p = PyCObject_AsVoidPtr(cobj);} #endif *f = tmp.fp; if (!(*f)) goto bad; Py_DECREF(d); return 0; bad: Py_XDECREF(d); return -1; } #endif static int __Pyx_InitStrings(__Pyx_StringTabEntry *t) { while (t->p) { #if PY_MAJOR_VERSION < 3 if (t->is_unicode) { *t->p = PyUnicode_DecodeUTF8(t->s, t->n - 1, NULL); } else if (t->intern) { *t->p = PyString_InternFromString(t->s); } else { *t->p = PyString_FromStringAndSize(t->s, t->n - 1); } #else if (t->is_unicode | t->is_str) { if (t->intern) { *t->p = PyUnicode_InternFromString(t->s); } else if (t->encoding) { *t->p = PyUnicode_Decode(t->s, t->n - 1, t->encoding, NULL); } else { *t->p = PyUnicode_FromStringAndSize(t->s, t->n - 1); } } else { *t->p = PyBytes_FromStringAndSize(t->s, t->n - 1); } #endif if (!*t->p) return -1; ++t; } return 0; } static CYTHON_INLINE PyObject* __Pyx_PyUnicode_FromString(const char* c_str) { return __Pyx_PyUnicode_FromStringAndSize(c_str, (Py_ssize_t)strlen(c_str)); } static CYTHON_INLINE char* __Pyx_PyObject_AsString(PyObject* o) { Py_ssize_t ignore; return __Pyx_PyObject_AsStringAndSize(o, &ignore); } static CYTHON_INLINE char* __Pyx_PyObject_AsStringAndSize(PyObject* o, Py_ssize_t *length) { #if CYTHON_COMPILING_IN_CPYTHON && (__PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT) if ( #if PY_MAJOR_VERSION < 3 && __PYX_DEFAULT_STRING_ENCODING_IS_ASCII __Pyx_sys_getdefaultencoding_not_ascii && #endif PyUnicode_Check(o)) { #if PY_VERSION_HEX < 0x03030000 char* defenc_c; PyObject* defenc = _PyUnicode_AsDefaultEncodedString(o, NULL); if (!defenc) return NULL; defenc_c = PyBytes_AS_STRING(defenc); #if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII { char* end = defenc_c + PyBytes_GET_SIZE(defenc); char* c; for (c = defenc_c; c < end; c++) { if ((unsigned char) (*c) >= 128) { PyUnicode_AsASCIIString(o); return NULL; } } } #endif *length = PyBytes_GET_SIZE(defenc); return defenc_c; #else if (__Pyx_PyUnicode_READY(o) == -1) return NULL; #if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII if (PyUnicode_IS_ASCII(o)) { *length = PyUnicode_GET_LENGTH(o); return PyUnicode_AsUTF8(o); } else { PyUnicode_AsASCIIString(o); return NULL; } #else return PyUnicode_AsUTF8AndSize(o, length); #endif #endif } else #endif #if (!CYTHON_COMPILING_IN_PYPY) || (defined(PyByteArray_AS_STRING) && defined(PyByteArray_GET_SIZE)) if (PyByteArray_Check(o)) { *length = PyByteArray_GET_SIZE(o); return PyByteArray_AS_STRING(o); } else #endif { char* result; int r = PyBytes_AsStringAndSize(o, &result, length); if (unlikely(r < 0)) { return NULL; } else { return result; } } } static CYTHON_INLINE int __Pyx_PyObject_IsTrue(PyObject* x) { int is_true = x == Py_True; if (is_true | (x == Py_False) | (x == Py_None)) return is_true; else return PyObject_IsTrue(x); } static CYTHON_INLINE PyObject* __Pyx_PyNumber_Int(PyObject* x) { PyNumberMethods *m; const char *name = NULL; PyObject *res = NULL; #if PY_MAJOR_VERSION < 3 if (PyInt_Check(x) || PyLong_Check(x)) #else if (PyLong_Check(x)) #endif return __Pyx_NewRef(x); m = Py_TYPE(x)->tp_as_number; #if PY_MAJOR_VERSION < 3 if (m && m->nb_int) { name = "int"; res = PyNumber_Int(x); } else if (m && m->nb_long) { name = "long"; res = PyNumber_Long(x); } #else if (m && m->nb_int) { name = "int"; res = PyNumber_Long(x); } #endif if (res) { #if PY_MAJOR_VERSION < 3 if (!PyInt_Check(res) && !PyLong_Check(res)) { #else if (!PyLong_Check(res)) { #endif PyErr_Format(PyExc_TypeError, "__%.4s__ returned non-%.4s (type %.200s)", name, name, Py_TYPE(res)->tp_name); Py_DECREF(res); return NULL; } } else if (!PyErr_Occurred()) { PyErr_SetString(PyExc_TypeError, "an integer is required"); } return res; } static CYTHON_INLINE Py_ssize_t __Pyx_PyIndex_AsSsize_t(PyObject* b) { Py_ssize_t ival; PyObject *x; #if PY_MAJOR_VERSION < 3 if (likely(PyInt_CheckExact(b))) { if (sizeof(Py_ssize_t) >= sizeof(long)) return PyInt_AS_LONG(b); else return PyInt_AsSsize_t(x); } #endif if (likely(PyLong_CheckExact(b))) { #if CYTHON_USE_PYLONG_INTERNALS const digit* digits = ((PyLongObject*)b)->ob_digit; const Py_ssize_t size = Py_SIZE(b); if (likely(__Pyx_sst_abs(size) <= 1)) { ival = likely(size) ? digits[0] : 0; if (size == -1) ival = -ival; return ival; } else { switch (size) { case 2: if (8 * sizeof(Py_ssize_t) > 2 * PyLong_SHIFT) { return (Py_ssize_t) (((((size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])); } break; case -2: if (8 * sizeof(Py_ssize_t) > 2 * PyLong_SHIFT) { return -(Py_ssize_t) (((((size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])); } break; case 3: if (8 * sizeof(Py_ssize_t) > 3 * PyLong_SHIFT) { return (Py_ssize_t) (((((((size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])); } break; case -3: if (8 * sizeof(Py_ssize_t) > 3 * PyLong_SHIFT) { return -(Py_ssize_t) (((((((size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])); } break; case 4: if (8 * sizeof(Py_ssize_t) > 4 * PyLong_SHIFT) { return (Py_ssize_t) (((((((((size_t)digits[3]) << PyLong_SHIFT) | (size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])); } break; case -4: if (8 * sizeof(Py_ssize_t) > 4 * PyLong_SHIFT) { return -(Py_ssize_t) (((((((((size_t)digits[3]) << PyLong_SHIFT) | (size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])); } break; } } #endif return PyLong_AsSsize_t(b); } x = PyNumber_Index(b); if (!x) return -1; ival = PyInt_AsSsize_t(x); Py_DECREF(x); return ival; } static CYTHON_INLINE PyObject * __Pyx_PyInt_FromSize_t(size_t ival) { return PyInt_FromSize_t(ival); } #endif /* Py_PYTHON_H */ pygame_sdl2-2.1.0-for-renpy-6.99.14.1/gen/pygame_sdl2.key.c0000664000175000017500000061077012660477772022215 0ustar tomtom00000000000000/* Generated by Cython 0.23.4 */ #define PY_SSIZE_T_CLEAN #include "Python.h" #ifndef Py_PYTHON_H #error Python headers needed to compile C extensions, please install development version of Python. #elif PY_VERSION_HEX < 0x02060000 || (0x03000000 <= PY_VERSION_HEX && PY_VERSION_HEX < 0x03020000) #error Cython requires Python 2.6+ or Python 3.2+. #else #define CYTHON_ABI "0_23_4" #include #ifndef offsetof #define offsetof(type, member) ( (size_t) & ((type*)0) -> member ) #endif #if !defined(WIN32) && !defined(MS_WINDOWS) #ifndef __stdcall #define __stdcall #endif #ifndef __cdecl #define __cdecl #endif #ifndef __fastcall #define __fastcall #endif #endif #ifndef DL_IMPORT #define DL_IMPORT(t) t #endif #ifndef DL_EXPORT #define DL_EXPORT(t) t #endif #ifndef PY_LONG_LONG #define PY_LONG_LONG LONG_LONG #endif #ifndef Py_HUGE_VAL #define Py_HUGE_VAL HUGE_VAL #endif #ifdef PYPY_VERSION #define CYTHON_COMPILING_IN_PYPY 1 #define CYTHON_COMPILING_IN_CPYTHON 0 #else #define CYTHON_COMPILING_IN_PYPY 0 #define CYTHON_COMPILING_IN_CPYTHON 1 #endif #if !defined(CYTHON_USE_PYLONG_INTERNALS) && CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x02070000 #define CYTHON_USE_PYLONG_INTERNALS 1 #endif #if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX < 0x02070600 && !defined(Py_OptimizeFlag) #define Py_OptimizeFlag 0 #endif #define __PYX_BUILD_PY_SSIZE_T "n" #define CYTHON_FORMAT_SSIZE_T "z" #if PY_MAJOR_VERSION < 3 #define __Pyx_BUILTIN_MODULE_NAME "__builtin__" #define __Pyx_PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)\ PyCode_New(a+k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos) #define __Pyx_DefaultClassType PyClass_Type #else #define __Pyx_BUILTIN_MODULE_NAME "builtins" #define __Pyx_PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)\ PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos) #define __Pyx_DefaultClassType PyType_Type #endif #ifndef Py_TPFLAGS_CHECKTYPES #define Py_TPFLAGS_CHECKTYPES 0 #endif #ifndef Py_TPFLAGS_HAVE_INDEX #define Py_TPFLAGS_HAVE_INDEX 0 #endif #ifndef Py_TPFLAGS_HAVE_NEWBUFFER #define Py_TPFLAGS_HAVE_NEWBUFFER 0 #endif #ifndef Py_TPFLAGS_HAVE_FINALIZE #define Py_TPFLAGS_HAVE_FINALIZE 0 #endif #if PY_VERSION_HEX > 0x03030000 && defined(PyUnicode_KIND) #define CYTHON_PEP393_ENABLED 1 #define __Pyx_PyUnicode_READY(op) (likely(PyUnicode_IS_READY(op)) ?\ 0 : _PyUnicode_Ready((PyObject *)(op))) #define __Pyx_PyUnicode_GET_LENGTH(u) PyUnicode_GET_LENGTH(u) #define __Pyx_PyUnicode_READ_CHAR(u, i) PyUnicode_READ_CHAR(u, i) #define __Pyx_PyUnicode_KIND(u) PyUnicode_KIND(u) #define __Pyx_PyUnicode_DATA(u) PyUnicode_DATA(u) #define __Pyx_PyUnicode_READ(k, d, i) PyUnicode_READ(k, d, i) #else #define CYTHON_PEP393_ENABLED 0 #define __Pyx_PyUnicode_READY(op) (0) #define __Pyx_PyUnicode_GET_LENGTH(u) PyUnicode_GET_SIZE(u) #define __Pyx_PyUnicode_READ_CHAR(u, i) ((Py_UCS4)(PyUnicode_AS_UNICODE(u)[i])) #define __Pyx_PyUnicode_KIND(u) (sizeof(Py_UNICODE)) #define __Pyx_PyUnicode_DATA(u) ((void*)PyUnicode_AS_UNICODE(u)) #define __Pyx_PyUnicode_READ(k, d, i) ((void)(k), (Py_UCS4)(((Py_UNICODE*)d)[i])) #endif #if CYTHON_COMPILING_IN_PYPY #define __Pyx_PyUnicode_Concat(a, b) PyNumber_Add(a, b) #define __Pyx_PyUnicode_ConcatSafe(a, b) PyNumber_Add(a, b) #else #define __Pyx_PyUnicode_Concat(a, b) PyUnicode_Concat(a, b) #define __Pyx_PyUnicode_ConcatSafe(a, b) ((unlikely((a) == Py_None) || unlikely((b) == Py_None)) ?\ PyNumber_Add(a, b) : __Pyx_PyUnicode_Concat(a, b)) #endif #if CYTHON_COMPILING_IN_PYPY && !defined(PyUnicode_Contains) #define PyUnicode_Contains(u, s) PySequence_Contains(u, s) #endif #define __Pyx_PyString_FormatSafe(a, b) ((unlikely((a) == Py_None)) ? PyNumber_Remainder(a, b) : __Pyx_PyString_Format(a, b)) #define __Pyx_PyUnicode_FormatSafe(a, b) ((unlikely((a) == Py_None)) ? PyNumber_Remainder(a, b) : PyUnicode_Format(a, b)) #if PY_MAJOR_VERSION >= 3 #define __Pyx_PyString_Format(a, b) PyUnicode_Format(a, b) #else #define __Pyx_PyString_Format(a, b) PyString_Format(a, b) #endif #if PY_MAJOR_VERSION >= 3 #define PyBaseString_Type PyUnicode_Type #define PyStringObject PyUnicodeObject #define PyString_Type PyUnicode_Type #define PyString_Check PyUnicode_Check #define PyString_CheckExact PyUnicode_CheckExact #endif #if PY_MAJOR_VERSION >= 3 #define __Pyx_PyBaseString_Check(obj) PyUnicode_Check(obj) #define __Pyx_PyBaseString_CheckExact(obj) PyUnicode_CheckExact(obj) #else #define __Pyx_PyBaseString_Check(obj) (PyString_Check(obj) || PyUnicode_Check(obj)) #define __Pyx_PyBaseString_CheckExact(obj) (PyString_CheckExact(obj) || PyUnicode_CheckExact(obj)) #endif #ifndef PySet_CheckExact #define PySet_CheckExact(obj) (Py_TYPE(obj) == &PySet_Type) #endif #define __Pyx_TypeCheck(obj, type) PyObject_TypeCheck(obj, (PyTypeObject *)type) #if PY_MAJOR_VERSION >= 3 #define PyIntObject PyLongObject #define PyInt_Type PyLong_Type #define PyInt_Check(op) PyLong_Check(op) #define PyInt_CheckExact(op) PyLong_CheckExact(op) #define PyInt_FromString PyLong_FromString #define PyInt_FromUnicode PyLong_FromUnicode #define PyInt_FromLong PyLong_FromLong #define PyInt_FromSize_t PyLong_FromSize_t #define PyInt_FromSsize_t PyLong_FromSsize_t #define PyInt_AsLong PyLong_AsLong #define PyInt_AS_LONG PyLong_AS_LONG #define PyInt_AsSsize_t PyLong_AsSsize_t #define PyInt_AsUnsignedLongMask PyLong_AsUnsignedLongMask #define PyInt_AsUnsignedLongLongMask PyLong_AsUnsignedLongLongMask #define PyNumber_Int PyNumber_Long #endif #if PY_MAJOR_VERSION >= 3 #define PyBoolObject PyLongObject #endif #if PY_MAJOR_VERSION >= 3 && CYTHON_COMPILING_IN_PYPY #ifndef PyUnicode_InternFromString #define PyUnicode_InternFromString(s) PyUnicode_FromString(s) #endif #endif #if PY_VERSION_HEX < 0x030200A4 typedef long Py_hash_t; #define __Pyx_PyInt_FromHash_t PyInt_FromLong #define __Pyx_PyInt_AsHash_t PyInt_AsLong #else #define __Pyx_PyInt_FromHash_t PyInt_FromSsize_t #define __Pyx_PyInt_AsHash_t PyInt_AsSsize_t #endif #if PY_MAJOR_VERSION >= 3 #define __Pyx_PyMethod_New(func, self, klass) ((self) ? PyMethod_New(func, self) : PyInstanceMethod_New(func)) #else #define __Pyx_PyMethod_New(func, self, klass) PyMethod_New(func, self, klass) #endif #if PY_VERSION_HEX >= 0x030500B1 #define __Pyx_PyAsyncMethodsStruct PyAsyncMethods #define __Pyx_PyType_AsAsync(obj) (Py_TYPE(obj)->tp_as_async) #elif CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3 typedef struct { unaryfunc am_await; unaryfunc am_aiter; unaryfunc am_anext; } __Pyx_PyAsyncMethodsStruct; #define __Pyx_PyType_AsAsync(obj) ((__Pyx_PyAsyncMethodsStruct*) (Py_TYPE(obj)->tp_reserved)) #else #define __Pyx_PyType_AsAsync(obj) NULL #endif #ifndef CYTHON_RESTRICT #if defined(__GNUC__) #define CYTHON_RESTRICT __restrict__ #elif defined(_MSC_VER) && _MSC_VER >= 1400 #define CYTHON_RESTRICT __restrict #elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L #define CYTHON_RESTRICT restrict #else #define CYTHON_RESTRICT #endif #endif #define __Pyx_void_to_None(void_result) ((void)(void_result), Py_INCREF(Py_None), Py_None) #ifndef CYTHON_INLINE #if defined(__GNUC__) #define CYTHON_INLINE __inline__ #elif defined(_MSC_VER) #define CYTHON_INLINE __inline #elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L #define CYTHON_INLINE inline #else #define CYTHON_INLINE #endif #endif #if defined(WIN32) || defined(MS_WINDOWS) #define _USE_MATH_DEFINES #endif #include #ifdef NAN #define __PYX_NAN() ((float) NAN) #else static CYTHON_INLINE float __PYX_NAN() { float value; memset(&value, 0xFF, sizeof(value)); return value; } #endif #if PY_MAJOR_VERSION >= 3 #define __Pyx_PyNumber_Divide(x,y) PyNumber_TrueDivide(x,y) #define __Pyx_PyNumber_InPlaceDivide(x,y) PyNumber_InPlaceTrueDivide(x,y) #else #define __Pyx_PyNumber_Divide(x,y) PyNumber_Divide(x,y) #define __Pyx_PyNumber_InPlaceDivide(x,y) PyNumber_InPlaceDivide(x,y) #endif #ifndef __PYX_EXTERN_C #ifdef __cplusplus #define __PYX_EXTERN_C extern "C" #else #define __PYX_EXTERN_C extern #endif #endif #define __PYX_HAVE__pygame_sdl2__key #define __PYX_HAVE_API__pygame_sdl2__key #include "stdint.h" #include "string.h" #include "stdio.h" #include "stddef.h" #include "SDL.h" #include "stdlib.h" #ifdef _OPENMP #include #endif /* _OPENMP */ #ifdef PYREX_WITHOUT_ASSERTIONS #define CYTHON_WITHOUT_ASSERTIONS #endif #ifndef CYTHON_UNUSED # if defined(__GNUC__) # if !(defined(__cplusplus)) || (__GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 4)) # define CYTHON_UNUSED __attribute__ ((__unused__)) # else # define CYTHON_UNUSED # endif # elif defined(__ICC) || (defined(__INTEL_COMPILER) && !defined(_MSC_VER)) # define CYTHON_UNUSED __attribute__ ((__unused__)) # else # define CYTHON_UNUSED # endif #endif #ifndef CYTHON_NCP_UNUSED # if CYTHON_COMPILING_IN_CPYTHON # define CYTHON_NCP_UNUSED # else # define CYTHON_NCP_UNUSED CYTHON_UNUSED # endif #endif typedef struct {PyObject **p; char *s; const Py_ssize_t n; const char* encoding; const char is_unicode; const char is_str; const char intern; } __Pyx_StringTabEntry; #define __PYX_DEFAULT_STRING_ENCODING_IS_ASCII 0 #define __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT 0 #define __PYX_DEFAULT_STRING_ENCODING "" #define __Pyx_PyObject_FromString __Pyx_PyBytes_FromString #define __Pyx_PyObject_FromStringAndSize __Pyx_PyBytes_FromStringAndSize #define __Pyx_uchar_cast(c) ((unsigned char)c) #define __Pyx_long_cast(x) ((long)x) #define __Pyx_fits_Py_ssize_t(v, type, is_signed) (\ (sizeof(type) < sizeof(Py_ssize_t)) ||\ (sizeof(type) > sizeof(Py_ssize_t) &&\ likely(v < (type)PY_SSIZE_T_MAX ||\ v == (type)PY_SSIZE_T_MAX) &&\ (!is_signed || likely(v > (type)PY_SSIZE_T_MIN ||\ v == (type)PY_SSIZE_T_MIN))) ||\ (sizeof(type) == sizeof(Py_ssize_t) &&\ (is_signed || likely(v < (type)PY_SSIZE_T_MAX ||\ v == (type)PY_SSIZE_T_MAX))) ) #if defined (__cplusplus) && __cplusplus >= 201103L #include #define __Pyx_sst_abs(value) std::abs(value) #elif SIZEOF_INT >= SIZEOF_SIZE_T #define __Pyx_sst_abs(value) abs(value) #elif SIZEOF_LONG >= SIZEOF_SIZE_T #define __Pyx_sst_abs(value) labs(value) #elif defined (_MSC_VER) && defined (_M_X64) #define __Pyx_sst_abs(value) _abs64(value) #elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L #define __Pyx_sst_abs(value) llabs(value) #elif defined (__GNUC__) #define __Pyx_sst_abs(value) __builtin_llabs(value) #else #define __Pyx_sst_abs(value) ((value<0) ? -value : value) #endif static CYTHON_INLINE char* __Pyx_PyObject_AsString(PyObject*); static CYTHON_INLINE char* __Pyx_PyObject_AsStringAndSize(PyObject*, Py_ssize_t* length); #define __Pyx_PyByteArray_FromString(s) PyByteArray_FromStringAndSize((const char*)s, strlen((const char*)s)) #define __Pyx_PyByteArray_FromStringAndSize(s, l) PyByteArray_FromStringAndSize((const char*)s, l) #define __Pyx_PyBytes_FromString PyBytes_FromString #define __Pyx_PyBytes_FromStringAndSize PyBytes_FromStringAndSize static CYTHON_INLINE PyObject* __Pyx_PyUnicode_FromString(const char*); #if PY_MAJOR_VERSION < 3 #define __Pyx_PyStr_FromString __Pyx_PyBytes_FromString #define __Pyx_PyStr_FromStringAndSize __Pyx_PyBytes_FromStringAndSize #else #define __Pyx_PyStr_FromString __Pyx_PyUnicode_FromString #define __Pyx_PyStr_FromStringAndSize __Pyx_PyUnicode_FromStringAndSize #endif #define __Pyx_PyObject_AsSString(s) ((signed char*) __Pyx_PyObject_AsString(s)) #define __Pyx_PyObject_AsUString(s) ((unsigned char*) __Pyx_PyObject_AsString(s)) #define __Pyx_PyObject_FromCString(s) __Pyx_PyObject_FromString((const char*)s) #define __Pyx_PyBytes_FromCString(s) __Pyx_PyBytes_FromString((const char*)s) #define __Pyx_PyByteArray_FromCString(s) __Pyx_PyByteArray_FromString((const char*)s) #define __Pyx_PyStr_FromCString(s) __Pyx_PyStr_FromString((const char*)s) #define __Pyx_PyUnicode_FromCString(s) __Pyx_PyUnicode_FromString((const char*)s) #if PY_MAJOR_VERSION < 3 static CYTHON_INLINE size_t __Pyx_Py_UNICODE_strlen(const Py_UNICODE *u) { const Py_UNICODE *u_end = u; while (*u_end++) ; return (size_t)(u_end - u - 1); } #else #define __Pyx_Py_UNICODE_strlen Py_UNICODE_strlen #endif #define __Pyx_PyUnicode_FromUnicode(u) PyUnicode_FromUnicode(u, __Pyx_Py_UNICODE_strlen(u)) #define __Pyx_PyUnicode_FromUnicodeAndLength PyUnicode_FromUnicode #define __Pyx_PyUnicode_AsUnicode PyUnicode_AsUnicode #define __Pyx_NewRef(obj) (Py_INCREF(obj), obj) #define __Pyx_Owned_Py_None(b) __Pyx_NewRef(Py_None) #define __Pyx_PyBool_FromLong(b) ((b) ? __Pyx_NewRef(Py_True) : __Pyx_NewRef(Py_False)) static CYTHON_INLINE int __Pyx_PyObject_IsTrue(PyObject*); static CYTHON_INLINE PyObject* __Pyx_PyNumber_Int(PyObject* x); static CYTHON_INLINE Py_ssize_t __Pyx_PyIndex_AsSsize_t(PyObject*); static CYTHON_INLINE PyObject * __Pyx_PyInt_FromSize_t(size_t); #if CYTHON_COMPILING_IN_CPYTHON #define __pyx_PyFloat_AsDouble(x) (PyFloat_CheckExact(x) ? PyFloat_AS_DOUBLE(x) : PyFloat_AsDouble(x)) #else #define __pyx_PyFloat_AsDouble(x) PyFloat_AsDouble(x) #endif #define __pyx_PyFloat_AsFloat(x) ((float) __pyx_PyFloat_AsDouble(x)) #if PY_MAJOR_VERSION < 3 && __PYX_DEFAULT_STRING_ENCODING_IS_ASCII static int __Pyx_sys_getdefaultencoding_not_ascii; static int __Pyx_init_sys_getdefaultencoding_params(void) { PyObject* sys; PyObject* default_encoding = NULL; PyObject* ascii_chars_u = NULL; PyObject* ascii_chars_b = NULL; const char* default_encoding_c; sys = PyImport_ImportModule("sys"); if (!sys) goto bad; default_encoding = PyObject_CallMethod(sys, (char*) "getdefaultencoding", NULL); Py_DECREF(sys); if (!default_encoding) goto bad; default_encoding_c = PyBytes_AsString(default_encoding); if (!default_encoding_c) goto bad; if (strcmp(default_encoding_c, "ascii") == 0) { __Pyx_sys_getdefaultencoding_not_ascii = 0; } else { char ascii_chars[128]; int c; for (c = 0; c < 128; c++) { ascii_chars[c] = c; } __Pyx_sys_getdefaultencoding_not_ascii = 1; ascii_chars_u = PyUnicode_DecodeASCII(ascii_chars, 128, NULL); if (!ascii_chars_u) goto bad; ascii_chars_b = PyUnicode_AsEncodedString(ascii_chars_u, default_encoding_c, NULL); if (!ascii_chars_b || !PyBytes_Check(ascii_chars_b) || memcmp(ascii_chars, PyBytes_AS_STRING(ascii_chars_b), 128) != 0) { PyErr_Format( PyExc_ValueError, "This module compiled with c_string_encoding=ascii, but default encoding '%.200s' is not a superset of ascii.", default_encoding_c); goto bad; } Py_DECREF(ascii_chars_u); Py_DECREF(ascii_chars_b); } Py_DECREF(default_encoding); return 0; bad: Py_XDECREF(default_encoding); Py_XDECREF(ascii_chars_u); Py_XDECREF(ascii_chars_b); return -1; } #endif #if __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT && PY_MAJOR_VERSION >= 3 #define __Pyx_PyUnicode_FromStringAndSize(c_str, size) PyUnicode_DecodeUTF8(c_str, size, NULL) #else #define __Pyx_PyUnicode_FromStringAndSize(c_str, size) PyUnicode_Decode(c_str, size, __PYX_DEFAULT_STRING_ENCODING, NULL) #if __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT static char* __PYX_DEFAULT_STRING_ENCODING; static int __Pyx_init_sys_getdefaultencoding_params(void) { PyObject* sys; PyObject* default_encoding = NULL; char* default_encoding_c; sys = PyImport_ImportModule("sys"); if (!sys) goto bad; default_encoding = PyObject_CallMethod(sys, (char*) (const char*) "getdefaultencoding", NULL); Py_DECREF(sys); if (!default_encoding) goto bad; default_encoding_c = PyBytes_AsString(default_encoding); if (!default_encoding_c) goto bad; __PYX_DEFAULT_STRING_ENCODING = (char*) malloc(strlen(default_encoding_c)); if (!__PYX_DEFAULT_STRING_ENCODING) goto bad; strcpy(__PYX_DEFAULT_STRING_ENCODING, default_encoding_c); Py_DECREF(default_encoding); return 0; bad: Py_XDECREF(default_encoding); return -1; } #endif #endif /* Test for GCC > 2.95 */ #if defined(__GNUC__) && (__GNUC__ > 2 || (__GNUC__ == 2 && (__GNUC_MINOR__ > 95))) #define likely(x) __builtin_expect(!!(x), 1) #define unlikely(x) __builtin_expect(!!(x), 0) #else /* !__GNUC__ or GCC < 2.95 */ #define likely(x) (x) #define unlikely(x) (x) #endif /* __GNUC__ */ static PyObject *__pyx_m; static PyObject *__pyx_d; static PyObject *__pyx_b; static PyObject *__pyx_empty_tuple; static PyObject *__pyx_empty_bytes; static int __pyx_lineno; static int __pyx_clineno = 0; static const char * __pyx_cfilenm= __FILE__; static const char *__pyx_filename; static const char *__pyx_f[] = { "src/pygame_sdl2/key.pyx", "src/pygame_sdl2/surface.pxd", "src/pygame_sdl2/display.pxd", "src/pygame_sdl2/rect.pxd", }; /*--- Type declarations ---*/ struct __pyx_obj_11pygame_sdl2_7surface_Surface; struct __pyx_obj_11pygame_sdl2_7display_Window; struct __pyx_obj_11pygame_sdl2_4rect_Rect; struct __pyx_obj_11pygame_sdl2_3key_KeyboardState; struct __pyx_opt_args_11pygame_sdl2_4rect_to_sdl_rect; /* "pygame_sdl2/rect.pxd":31 * * * cdef int to_sdl_rect(rectlike, SDL_Rect *rect, argname=*) except -1 # <<<<<<<<<<<<<< */ struct __pyx_opt_args_11pygame_sdl2_4rect_to_sdl_rect { int __pyx_n; PyObject *argname; }; /* "pygame_sdl2/surface.pxd":23 * from sdl2 cimport SDL_Surface * * cdef class Surface: # <<<<<<<<<<<<<< * # Allow weak references. * cdef object __weakref__ */ struct __pyx_obj_11pygame_sdl2_7surface_Surface { PyObject_HEAD struct __pyx_vtabstruct_11pygame_sdl2_7surface_Surface *__pyx_vtab; PyObject *__weakref__; SDL_Surface *surface; int owns_surface; int window_surface; PyObject *locklist; struct __pyx_obj_11pygame_sdl2_7surface_Surface *parent; struct __pyx_obj_11pygame_sdl2_7surface_Surface *root; int offset_x; int offset_y; PyObject *get_window_flags; int has_alpha; }; /* "pygame_sdl2/display.pxd":23 * from pygame_sdl2.surface cimport Surface * * cdef class Window: # <<<<<<<<<<<<<< * # Allow weak references. * cdef object __weakref__ */ struct __pyx_obj_11pygame_sdl2_7display_Window { PyObject_HEAD PyObject *__weakref__; SDL_Window *window; SDL_Surface *window_surface; struct __pyx_obj_11pygame_sdl2_7surface_Surface *surface; SDL_GLContext gl_context; Uint32 create_flags; }; /* "pygame_sdl2/rect.pxd":21 * from sdl2 cimport * * * cdef class Rect: # <<<<<<<<<<<<<< * # Allow weak references. * cdef object __weakref__ */ struct __pyx_obj_11pygame_sdl2_4rect_Rect { PyObject_HEAD PyObject *__weakref__; int x; int y; int w; int h; }; /* "pygame_sdl2/key.pyx":28 * * * cdef class KeyboardState: # <<<<<<<<<<<<<< * # Allow weak references. * cdef object __weakref__ */ struct __pyx_obj_11pygame_sdl2_3key_KeyboardState { PyObject_HEAD PyObject *__weakref__; uint8_t *data; int numkeys; }; /* "pygame_sdl2/surface.pxd":23 * from sdl2 cimport SDL_Surface * * cdef class Surface: # <<<<<<<<<<<<<< * # Allow weak references. * cdef object __weakref__ */ struct __pyx_vtabstruct_11pygame_sdl2_7surface_Surface { void (*take_surface)(struct __pyx_obj_11pygame_sdl2_7surface_Surface *, SDL_Surface *); }; static struct __pyx_vtabstruct_11pygame_sdl2_7surface_Surface *__pyx_vtabptr_11pygame_sdl2_7surface_Surface; /* --- Runtime support code (head) --- */ #ifndef CYTHON_REFNANNY #define CYTHON_REFNANNY 0 #endif #if CYTHON_REFNANNY typedef struct { void (*INCREF)(void*, PyObject*, int); void (*DECREF)(void*, PyObject*, int); void (*GOTREF)(void*, PyObject*, int); void (*GIVEREF)(void*, PyObject*, int); void* (*SetupContext)(const char*, int, const char*); void (*FinishContext)(void**); } __Pyx_RefNannyAPIStruct; static __Pyx_RefNannyAPIStruct *__Pyx_RefNanny = NULL; static __Pyx_RefNannyAPIStruct *__Pyx_RefNannyImportAPI(const char *modname); #define __Pyx_RefNannyDeclarations void *__pyx_refnanny = NULL; #ifdef WITH_THREAD #define __Pyx_RefNannySetupContext(name, acquire_gil)\ if (acquire_gil) {\ PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure();\ __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), __LINE__, __FILE__);\ PyGILState_Release(__pyx_gilstate_save);\ } else {\ __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), __LINE__, __FILE__);\ } #else #define __Pyx_RefNannySetupContext(name, acquire_gil)\ __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), __LINE__, __FILE__) #endif #define __Pyx_RefNannyFinishContext()\ __Pyx_RefNanny->FinishContext(&__pyx_refnanny) #define __Pyx_INCREF(r) __Pyx_RefNanny->INCREF(__pyx_refnanny, (PyObject *)(r), __LINE__) #define __Pyx_DECREF(r) __Pyx_RefNanny->DECREF(__pyx_refnanny, (PyObject *)(r), __LINE__) #define __Pyx_GOTREF(r) __Pyx_RefNanny->GOTREF(__pyx_refnanny, (PyObject *)(r), __LINE__) #define __Pyx_GIVEREF(r) __Pyx_RefNanny->GIVEREF(__pyx_refnanny, (PyObject *)(r), __LINE__) #define __Pyx_XINCREF(r) do { if((r) != NULL) {__Pyx_INCREF(r); }} while(0) #define __Pyx_XDECREF(r) do { if((r) != NULL) {__Pyx_DECREF(r); }} while(0) #define __Pyx_XGOTREF(r) do { if((r) != NULL) {__Pyx_GOTREF(r); }} while(0) #define __Pyx_XGIVEREF(r) do { if((r) != NULL) {__Pyx_GIVEREF(r);}} while(0) #else #define __Pyx_RefNannyDeclarations #define __Pyx_RefNannySetupContext(name, acquire_gil) #define __Pyx_RefNannyFinishContext() #define __Pyx_INCREF(r) Py_INCREF(r) #define __Pyx_DECREF(r) Py_DECREF(r) #define __Pyx_GOTREF(r) #define __Pyx_GIVEREF(r) #define __Pyx_XINCREF(r) Py_XINCREF(r) #define __Pyx_XDECREF(r) Py_XDECREF(r) #define __Pyx_XGOTREF(r) #define __Pyx_XGIVEREF(r) #endif #define __Pyx_XDECREF_SET(r, v) do {\ PyObject *tmp = (PyObject *) r;\ r = v; __Pyx_XDECREF(tmp);\ } while (0) #define __Pyx_DECREF_SET(r, v) do {\ PyObject *tmp = (PyObject *) r;\ r = v; __Pyx_DECREF(tmp);\ } while (0) #define __Pyx_CLEAR(r) do { PyObject* tmp = ((PyObject*)(r)); r = NULL; __Pyx_DECREF(tmp);} while(0) #define __Pyx_XCLEAR(r) do { if((r) != NULL) {PyObject* tmp = ((PyObject*)(r)); r = NULL; __Pyx_DECREF(tmp);}} while(0) #if CYTHON_COMPILING_IN_CPYTHON static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStr(PyObject* obj, PyObject* attr_name) { PyTypeObject* tp = Py_TYPE(obj); if (likely(tp->tp_getattro)) return tp->tp_getattro(obj, attr_name); #if PY_MAJOR_VERSION < 3 if (likely(tp->tp_getattr)) return tp->tp_getattr(obj, PyString_AS_STRING(attr_name)); #endif return PyObject_GetAttr(obj, attr_name); } #else #define __Pyx_PyObject_GetAttrStr(o,n) PyObject_GetAttr(o,n) #endif static PyObject *__Pyx_GetBuiltinName(PyObject *name); static void __Pyx_RaiseArgtupleInvalid(const char* func_name, int exact, Py_ssize_t num_min, Py_ssize_t num_max, Py_ssize_t num_found); static CYTHON_INLINE int __Pyx_CheckKeywordStrings(PyObject *kwdict, const char* function_name, int kw_allowed); static CYTHON_INLINE PyObject *__Pyx_GetModuleGlobalName(PyObject *name); #if CYTHON_COMPILING_IN_CPYTHON static CYTHON_INLINE PyObject* __Pyx_PyObject_Call(PyObject *func, PyObject *arg, PyObject *kw); #else #define __Pyx_PyObject_Call(func, arg, kw) PyObject_Call(func, arg, kw) #endif #if CYTHON_COMPILING_IN_CPYTHON static CYTHON_INLINE PyObject* __Pyx_PyObject_CallMethO(PyObject *func, PyObject *arg); #endif static CYTHON_INLINE PyObject* __Pyx_PyObject_CallOneArg(PyObject *func, PyObject *arg); #if CYTHON_COMPILING_IN_CPYTHON static CYTHON_INLINE PyObject* __Pyx_PyObject_CallNoArg(PyObject *func); #else #define __Pyx_PyObject_CallNoArg(func) __Pyx_PyObject_Call(func, __pyx_empty_tuple, NULL) #endif static CYTHON_INLINE void __Pyx_ErrRestore(PyObject *type, PyObject *value, PyObject *tb); static CYTHON_INLINE void __Pyx_ErrFetch(PyObject **type, PyObject **value, PyObject **tb); static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, PyObject *cause); static void __Pyx_RaiseDoubleKeywordsError(const char* func_name, PyObject* kw_name); static int __Pyx_ParseOptionalKeywords(PyObject *kwds, PyObject **argnames[],\ PyObject *kwds2, PyObject *values[], Py_ssize_t num_pos_args,\ const char* function_name); static CYTHON_INLINE int __Pyx_ArgTypeTest(PyObject *obj, PyTypeObject *type, int none_allowed, const char *name, int exact); static void* __Pyx_GetVtable(PyObject *dict); static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list, int level); static PyObject* __Pyx_ImportFrom(PyObject* module, PyObject* name); typedef struct { int code_line; PyCodeObject* code_object; } __Pyx_CodeObjectCacheEntry; struct __Pyx_CodeObjectCache { int count; int max_count; __Pyx_CodeObjectCacheEntry* entries; }; static struct __Pyx_CodeObjectCache __pyx_code_cache = {0,0,NULL}; static int __pyx_bisect_code_objects(__Pyx_CodeObjectCacheEntry* entries, int count, int code_line); static PyCodeObject *__pyx_find_code_object(int code_line); static void __pyx_insert_code_object(int code_line, PyCodeObject* code_object); static void __Pyx_AddTraceback(const char *funcname, int c_line, int py_line, const char *filename); static CYTHON_INLINE int __Pyx_PyInt_As_int(PyObject *); static CYTHON_INLINE PyObject* __Pyx_PyInt_From_uint8_t(uint8_t value); static CYTHON_INLINE PyObject* __Pyx_PyInt_From_SDL_Keymod(SDL_Keymod value); static CYTHON_INLINE SDL_Keymod __Pyx_PyInt_As_SDL_Keymod(PyObject *); static CYTHON_INLINE int32_t __Pyx_PyInt_As_int32_t(PyObject *); static CYTHON_INLINE PyObject* __Pyx_PyInt_From_SDL_bool(SDL_bool value); static CYTHON_INLINE PyObject* __Pyx_PyInt_From_long(long value); static CYTHON_INLINE long __Pyx_PyInt_As_long(PyObject *); static int __Pyx_check_binary_version(void); #if !defined(__Pyx_PyIdentifier_FromString) #if PY_MAJOR_VERSION < 3 #define __Pyx_PyIdentifier_FromString(s) PyString_FromString(s) #else #define __Pyx_PyIdentifier_FromString(s) PyUnicode_FromString(s) #endif #endif static PyObject *__Pyx_ImportModule(const char *name); static PyTypeObject *__Pyx_ImportType(const char *module_name, const char *class_name, size_t size, int strict); static int __Pyx_ImportVoidPtr(PyObject *module, const char *name, void **p, const char *sig); static int __Pyx_ImportFunction(PyObject *module, const char *funcname, void (**f)(void), const char *sig); static int __Pyx_InitStrings(__Pyx_StringTabEntry *t); /* Module declarations from 'libc.stdint' */ /* Module declarations from 'libc.string' */ /* Module declarations from 'libc.stdio' */ /* Module declarations from 'libc.stddef' */ /* Module declarations from 'sdl2' */ /* Module declarations from 'libc.stdlib' */ /* Module declarations from 'pygame_sdl2.surface' */ static PyTypeObject *__pyx_ptype_11pygame_sdl2_7surface_Surface = 0; /* Module declarations from 'pygame_sdl2.display' */ static PyTypeObject *__pyx_ptype_11pygame_sdl2_7display_Window = 0; static struct __pyx_obj_11pygame_sdl2_7display_Window **__pyx_vp_11pygame_sdl2_7display_main_window = 0; #define __pyx_v_11pygame_sdl2_7display_main_window (*__pyx_vp_11pygame_sdl2_7display_main_window) /* Module declarations from 'pygame_sdl2.rect' */ static PyTypeObject *__pyx_ptype_11pygame_sdl2_4rect_Rect = 0; static int (*__pyx_f_11pygame_sdl2_4rect_to_sdl_rect)(PyObject *, SDL_Rect *, struct __pyx_opt_args_11pygame_sdl2_4rect_to_sdl_rect *__pyx_optional_args); /*proto*/ /* Module declarations from 'pygame_sdl2.key' */ static PyTypeObject *__pyx_ptype_11pygame_sdl2_3key_KeyboardState = 0; #define __Pyx_MODULE_NAME "pygame_sdl2.key" int __pyx_module_is_main_pygame_sdl2__key = 0; /* Implementation of 'pygame_sdl2.key' */ static PyObject *__pyx_builtin_IndexError; static char __pyx_k_key[] = "key"; static char __pyx_k_main[] = "__main__"; static char __pyx_k_name[] = "name"; static char __pyx_k_rect[] = "rect"; static char __pyx_k_test[] = "__test__"; static char __pyx_k_delay[] = "delay"; static char __pyx_k_error[] = "error"; static char __pyx_k_state[] = "state"; static char __pyx_k_import[] = "__import__"; static char __pyx_k_window[] = "window"; static char __pyx_k_get_mods[] = "get_mods"; static char __pyx_k_interval[] = "interval"; static char __pyx_k_sdl_rect[] = "sdl_rect"; static char __pyx_k_set_mods[] = "set_mods"; static char __pyx_k_IndexError[] = "IndexError"; static char __pyx_k_get_repeat[] = "get_repeat"; static char __pyx_k_pyx_vtable[] = "__pyx_vtable__"; static char __pyx_k_set_repeat[] = "set_repeat"; static char __pyx_k_text_input[] = "text_input"; static char __pyx_k_get_focused[] = "get_focused"; static char __pyx_k_get_pressed[] = "get_pressed"; static char __pyx_k_Out_of_range[] = "Out of range."; static char __pyx_k_pygame_sdl2_key[] = "pygame_sdl2.key"; static char __pyx_k_stop_text_input[] = "stop_text_input"; static char __pyx_k_start_text_input[] = "start_text_input"; static char __pyx_k_pygame_sdl2_error[] = "pygame_sdl2.error"; static char __pyx_k_set_text_input_rect[] = "set_text_input_rect"; static char __pyx_k_is_screen_keyboard_shown[] = "is_screen_keyboard_shown"; static char __pyx_k_has_screen_keyboard_support[] = "has_screen_keyboard_support"; static char __pyx_k_home_tom_ab_pygame_sdl2_src_pyg[] = "/home/tom/ab/pygame_sdl2/src/pygame_sdl2/key.pyx"; static PyObject *__pyx_n_s_IndexError; static PyObject *__pyx_kp_s_Out_of_range; static PyObject *__pyx_n_s_delay; static PyObject *__pyx_n_s_error; static PyObject *__pyx_n_s_get_focused; static PyObject *__pyx_n_s_get_mods; static PyObject *__pyx_n_s_get_pressed; static PyObject *__pyx_n_s_get_repeat; static PyObject *__pyx_n_s_has_screen_keyboard_support; static PyObject *__pyx_kp_s_home_tom_ab_pygame_sdl2_src_pyg; static PyObject *__pyx_n_s_import; static PyObject *__pyx_n_s_interval; static PyObject *__pyx_n_s_is_screen_keyboard_shown; static PyObject *__pyx_n_s_key; static PyObject *__pyx_n_s_main; static PyObject *__pyx_n_s_name; static PyObject *__pyx_n_s_pygame_sdl2_error; static PyObject *__pyx_n_s_pygame_sdl2_key; static PyObject *__pyx_n_s_pyx_vtable; static PyObject *__pyx_n_s_rect; static PyObject *__pyx_n_s_sdl_rect; static PyObject *__pyx_n_s_set_mods; static PyObject *__pyx_n_s_set_repeat; static PyObject *__pyx_n_s_set_text_input_rect; static PyObject *__pyx_n_s_start_text_input; static PyObject *__pyx_n_s_state; static PyObject *__pyx_n_s_stop_text_input; static PyObject *__pyx_n_s_test; static PyObject *__pyx_n_s_text_input; static PyObject *__pyx_n_s_window; static int __pyx_pf_11pygame_sdl2_3key_13KeyboardState___cinit__(struct __pyx_obj_11pygame_sdl2_3key_KeyboardState *__pyx_v_self); /* proto */ static void __pyx_pf_11pygame_sdl2_3key_13KeyboardState_2__dealloc__(struct __pyx_obj_11pygame_sdl2_3key_KeyboardState *__pyx_v_self); /* proto */ static int __pyx_pf_11pygame_sdl2_3key_13KeyboardState_4__init__(struct __pyx_obj_11pygame_sdl2_3key_KeyboardState *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_3key_13KeyboardState_6__getitem__(struct __pyx_obj_11pygame_sdl2_3key_KeyboardState *__pyx_v_self, int __pyx_v_key); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_3key_get_focused(CYTHON_UNUSED PyObject *__pyx_self); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_3key_2get_pressed(CYTHON_UNUSED PyObject *__pyx_self); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_3key_4get_mods(CYTHON_UNUSED PyObject *__pyx_self); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_3key_6set_mods(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_state); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_3key_8set_repeat(CYTHON_UNUSED PyObject *__pyx_self, CYTHON_UNUSED PyObject *__pyx_v_delay, CYTHON_UNUSED PyObject *__pyx_v_interval); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_3key_10get_repeat(CYTHON_UNUSED PyObject *__pyx_self); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_3key_12name(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_key); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_3key_14start_text_input(CYTHON_UNUSED PyObject *__pyx_self); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_3key_16stop_text_input(CYTHON_UNUSED PyObject *__pyx_self); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_3key_18set_text_input_rect(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_rect); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_3key_20has_screen_keyboard_support(CYTHON_UNUSED PyObject *__pyx_self); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_3key_22is_screen_keyboard_shown(CYTHON_UNUSED PyObject *__pyx_self, struct __pyx_obj_11pygame_sdl2_7display_Window *__pyx_v_window); /* proto */ static PyObject *__pyx_tp_new_11pygame_sdl2_3key_KeyboardState(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ static PyObject *__pyx_int_0; static PyObject *__pyx_tuple_; static PyObject *__pyx_tuple__2; static PyObject *__pyx_tuple__3; static PyObject *__pyx_tuple__7; static PyObject *__pyx_tuple__9; static PyObject *__pyx_tuple__12; static PyObject *__pyx_tuple__16; static PyObject *__pyx_tuple__19; static PyObject *__pyx_codeobj__4; static PyObject *__pyx_codeobj__5; static PyObject *__pyx_codeobj__6; static PyObject *__pyx_codeobj__8; static PyObject *__pyx_codeobj__10; static PyObject *__pyx_codeobj__11; static PyObject *__pyx_codeobj__13; static PyObject *__pyx_codeobj__14; static PyObject *__pyx_codeobj__15; static PyObject *__pyx_codeobj__17; static PyObject *__pyx_codeobj__18; static PyObject *__pyx_codeobj__20; /* "pygame_sdl2/key.pyx":35 * cdef int numkeys * * def __cinit__(self): # <<<<<<<<<<<<<< * self.data = NULL * */ /* Python wrapper */ static int __pyx_pw_11pygame_sdl2_3key_13KeyboardState_1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static int __pyx_pw_11pygame_sdl2_3key_13KeyboardState_1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__cinit__ (wrapper)", 0); if (unlikely(PyTuple_GET_SIZE(__pyx_args) > 0)) { __Pyx_RaiseArgtupleInvalid("__cinit__", 1, 0, 0, PyTuple_GET_SIZE(__pyx_args)); return -1;} if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "__cinit__", 0))) return -1; __pyx_r = __pyx_pf_11pygame_sdl2_3key_13KeyboardState___cinit__(((struct __pyx_obj_11pygame_sdl2_3key_KeyboardState *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static int __pyx_pf_11pygame_sdl2_3key_13KeyboardState___cinit__(struct __pyx_obj_11pygame_sdl2_3key_KeyboardState *__pyx_v_self) { int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__cinit__", 0); /* "pygame_sdl2/key.pyx":36 * * def __cinit__(self): * self.data = NULL # <<<<<<<<<<<<<< * * def __dealloc__(self): */ __pyx_v_self->data = NULL; /* "pygame_sdl2/key.pyx":35 * cdef int numkeys * * def __cinit__(self): # <<<<<<<<<<<<<< * self.data = NULL * */ /* function exit code */ __pyx_r = 0; __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/key.pyx":38 * self.data = NULL * * def __dealloc__(self): # <<<<<<<<<<<<<< * if self.data != NULL: * free(self.data) */ /* Python wrapper */ static void __pyx_pw_11pygame_sdl2_3key_13KeyboardState_3__dealloc__(PyObject *__pyx_v_self); /*proto*/ static void __pyx_pw_11pygame_sdl2_3key_13KeyboardState_3__dealloc__(PyObject *__pyx_v_self) { __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__dealloc__ (wrapper)", 0); __pyx_pf_11pygame_sdl2_3key_13KeyboardState_2__dealloc__(((struct __pyx_obj_11pygame_sdl2_3key_KeyboardState *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); } static void __pyx_pf_11pygame_sdl2_3key_13KeyboardState_2__dealloc__(struct __pyx_obj_11pygame_sdl2_3key_KeyboardState *__pyx_v_self) { __Pyx_RefNannyDeclarations int __pyx_t_1; __Pyx_RefNannySetupContext("__dealloc__", 0); /* "pygame_sdl2/key.pyx":39 * * def __dealloc__(self): * if self.data != NULL: # <<<<<<<<<<<<<< * free(self.data) * */ __pyx_t_1 = ((__pyx_v_self->data != NULL) != 0); if (__pyx_t_1) { /* "pygame_sdl2/key.pyx":40 * def __dealloc__(self): * if self.data != NULL: * free(self.data) # <<<<<<<<<<<<<< * * def __init__(self): */ free(__pyx_v_self->data); /* "pygame_sdl2/key.pyx":39 * * def __dealloc__(self): * if self.data != NULL: # <<<<<<<<<<<<<< * free(self.data) * */ } /* "pygame_sdl2/key.pyx":38 * self.data = NULL * * def __dealloc__(self): # <<<<<<<<<<<<<< * if self.data != NULL: * free(self.data) */ /* function exit code */ __Pyx_RefNannyFinishContext(); } /* "pygame_sdl2/key.pyx":42 * free(self.data) * * def __init__(self): # <<<<<<<<<<<<<< * cdef uint8_t *state = SDL_GetKeyboardState(&self.numkeys) * if state == NULL: */ /* Python wrapper */ static int __pyx_pw_11pygame_sdl2_3key_13KeyboardState_5__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static int __pyx_pw_11pygame_sdl2_3key_13KeyboardState_5__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__init__ (wrapper)", 0); if (unlikely(PyTuple_GET_SIZE(__pyx_args) > 0)) { __Pyx_RaiseArgtupleInvalid("__init__", 1, 0, 0, PyTuple_GET_SIZE(__pyx_args)); return -1;} if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "__init__", 0))) return -1; __pyx_r = __pyx_pf_11pygame_sdl2_3key_13KeyboardState_4__init__(((struct __pyx_obj_11pygame_sdl2_3key_KeyboardState *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static int __pyx_pf_11pygame_sdl2_3key_13KeyboardState_4__init__(struct __pyx_obj_11pygame_sdl2_3key_KeyboardState *__pyx_v_self) { uint8_t *__pyx_v_state; int __pyx_r; __Pyx_RefNannyDeclarations int __pyx_t_1; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__init__", 0); /* "pygame_sdl2/key.pyx":43 * * def __init__(self): * cdef uint8_t *state = SDL_GetKeyboardState(&self.numkeys) # <<<<<<<<<<<<<< * if state == NULL: * raise error() */ __pyx_v_state = SDL_GetKeyboardState((&__pyx_v_self->numkeys)); /* "pygame_sdl2/key.pyx":44 * def __init__(self): * cdef uint8_t *state = SDL_GetKeyboardState(&self.numkeys) * if state == NULL: # <<<<<<<<<<<<<< * raise error() * */ __pyx_t_1 = ((__pyx_v_state == NULL) != 0); if (__pyx_t_1) { /* "pygame_sdl2/key.pyx":45 * cdef uint8_t *state = SDL_GetKeyboardState(&self.numkeys) * if state == NULL: * raise error() # <<<<<<<<<<<<<< * * # Take a snapshot of the current state, rather than saving the pointer. */ __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_error); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 45; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = NULL; if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_3))) { __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3); if (likely(__pyx_t_4)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); __Pyx_INCREF(__pyx_t_4); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_3, function); } } if (__pyx_t_4) { __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 45; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; } else { __pyx_t_2 = __Pyx_PyObject_CallNoArg(__pyx_t_3); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 45; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_Raise(__pyx_t_2, 0, 0, 0); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; {__pyx_filename = __pyx_f[0]; __pyx_lineno = 45; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "pygame_sdl2/key.pyx":44 * def __init__(self): * cdef uint8_t *state = SDL_GetKeyboardState(&self.numkeys) * if state == NULL: # <<<<<<<<<<<<<< * raise error() * */ } /* "pygame_sdl2/key.pyx":48 * * # Take a snapshot of the current state, rather than saving the pointer. * self.data = malloc(self.numkeys) # <<<<<<<<<<<<<< * memcpy(self.data, state, self.numkeys) * */ __pyx_v_self->data = ((uint8_t *)malloc(__pyx_v_self->numkeys)); /* "pygame_sdl2/key.pyx":49 * # Take a snapshot of the current state, rather than saving the pointer. * self.data = malloc(self.numkeys) * memcpy(self.data, state, self.numkeys) # <<<<<<<<<<<<<< * * def __getitem__(self, int key): */ memcpy(__pyx_v_self->data, __pyx_v_state, __pyx_v_self->numkeys); /* "pygame_sdl2/key.pyx":42 * free(self.data) * * def __init__(self): # <<<<<<<<<<<<<< * cdef uint8_t *state = SDL_GetKeyboardState(&self.numkeys) * if state == NULL: */ /* function exit code */ __pyx_r = 0; goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_AddTraceback("pygame_sdl2.key.KeyboardState.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = -1; __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/key.pyx":51 * memcpy(self.data, state, self.numkeys) * * def __getitem__(self, int key): # <<<<<<<<<<<<<< * if SDLK_DELETE < key < SDLK_CAPSLOCK: * raise IndexError("Out of range.") */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_3key_13KeyboardState_7__getitem__(PyObject *__pyx_v_self, PyObject *__pyx_arg_key); /*proto*/ static PyObject *__pyx_pw_11pygame_sdl2_3key_13KeyboardState_7__getitem__(PyObject *__pyx_v_self, PyObject *__pyx_arg_key) { int __pyx_v_key; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__getitem__ (wrapper)", 0); assert(__pyx_arg_key); { __pyx_v_key = __Pyx_PyInt_As_int(__pyx_arg_key); if (unlikely((__pyx_v_key == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 51; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; __Pyx_AddTraceback("pygame_sdl2.key.KeyboardState.__getitem__", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_11pygame_sdl2_3key_13KeyboardState_6__getitem__(((struct __pyx_obj_11pygame_sdl2_3key_KeyboardState *)__pyx_v_self), ((int)__pyx_v_key)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_3key_13KeyboardState_6__getitem__(struct __pyx_obj_11pygame_sdl2_3key_KeyboardState *__pyx_v_self, int __pyx_v_key) { int __pyx_v_sc; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; int __pyx_t_2; PyObject *__pyx_t_3 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__getitem__", 0); /* "pygame_sdl2/key.pyx":52 * * def __getitem__(self, int key): * if SDLK_DELETE < key < SDLK_CAPSLOCK: # <<<<<<<<<<<<<< * raise IndexError("Out of range.") * */ __pyx_t_1 = (SDLK_DELETE < __pyx_v_key); if (__pyx_t_1) { __pyx_t_1 = (__pyx_v_key < SDLK_CAPSLOCK); } __pyx_t_2 = (__pyx_t_1 != 0); if (__pyx_t_2) { /* "pygame_sdl2/key.pyx":53 * def __getitem__(self, int key): * if SDLK_DELETE < key < SDLK_CAPSLOCK: * raise IndexError("Out of range.") # <<<<<<<<<<<<<< * * cdef int sc = SDL_GetScancodeFromKey(key) */ __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_IndexError, __pyx_tuple_, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 53; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __Pyx_Raise(__pyx_t_3, 0, 0, 0); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; {__pyx_filename = __pyx_f[0]; __pyx_lineno = 53; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "pygame_sdl2/key.pyx":52 * * def __getitem__(self, int key): * if SDLK_DELETE < key < SDLK_CAPSLOCK: # <<<<<<<<<<<<<< * raise IndexError("Out of range.") * */ } /* "pygame_sdl2/key.pyx":55 * raise IndexError("Out of range.") * * cdef int sc = SDL_GetScancodeFromKey(key) # <<<<<<<<<<<<<< * if sc > self.numkeys: * raise IndexError("Out of range.") */ __pyx_v_sc = ((int)SDL_GetScancodeFromKey(__pyx_v_key)); /* "pygame_sdl2/key.pyx":56 * * cdef int sc = SDL_GetScancodeFromKey(key) * if sc > self.numkeys: # <<<<<<<<<<<<<< * raise IndexError("Out of range.") * */ __pyx_t_2 = ((__pyx_v_sc > __pyx_v_self->numkeys) != 0); if (__pyx_t_2) { /* "pygame_sdl2/key.pyx":57 * cdef int sc = SDL_GetScancodeFromKey(key) * if sc > self.numkeys: * raise IndexError("Out of range.") # <<<<<<<<<<<<<< * * return self.data[sc] */ __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_IndexError, __pyx_tuple__2, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 57; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __Pyx_Raise(__pyx_t_3, 0, 0, 0); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; {__pyx_filename = __pyx_f[0]; __pyx_lineno = 57; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "pygame_sdl2/key.pyx":56 * * cdef int sc = SDL_GetScancodeFromKey(key) * if sc > self.numkeys: # <<<<<<<<<<<<<< * raise IndexError("Out of range.") * */ } /* "pygame_sdl2/key.pyx":59 * raise IndexError("Out of range.") * * return self.data[sc] # <<<<<<<<<<<<<< * * */ __Pyx_XDECREF(__pyx_r); __pyx_t_3 = __Pyx_PyInt_From_uint8_t((__pyx_v_self->data[__pyx_v_sc])); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 59; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __pyx_r = __pyx_t_3; __pyx_t_3 = 0; goto __pyx_L0; /* "pygame_sdl2/key.pyx":51 * memcpy(self.data, state, self.numkeys) * * def __getitem__(self, int key): # <<<<<<<<<<<<<< * if SDLK_DELETE < key < SDLK_CAPSLOCK: * raise IndexError("Out of range.") */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("pygame_sdl2.key.KeyboardState.__getitem__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/key.pyx":62 * * * def get_focused(): # <<<<<<<<<<<<<< * return SDL_GetKeyboardFocus() != NULL * */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_3key_1get_focused(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused); /*proto*/ static PyMethodDef __pyx_mdef_11pygame_sdl2_3key_1get_focused = {"get_focused", (PyCFunction)__pyx_pw_11pygame_sdl2_3key_1get_focused, METH_NOARGS, 0}; static PyObject *__pyx_pw_11pygame_sdl2_3key_1get_focused(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("get_focused (wrapper)", 0); __pyx_r = __pyx_pf_11pygame_sdl2_3key_get_focused(__pyx_self); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_3key_get_focused(CYTHON_UNUSED PyObject *__pyx_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("get_focused", 0); /* "pygame_sdl2/key.pyx":63 * * def get_focused(): * return SDL_GetKeyboardFocus() != NULL # <<<<<<<<<<<<<< * * def get_pressed(): */ __Pyx_XDECREF(__pyx_r); __pyx_t_1 = __Pyx_PyBool_FromLong((SDL_GetKeyboardFocus() != NULL)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 63; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "pygame_sdl2/key.pyx":62 * * * def get_focused(): # <<<<<<<<<<<<<< * return SDL_GetKeyboardFocus() != NULL * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("pygame_sdl2.key.get_focused", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/key.pyx":65 * return SDL_GetKeyboardFocus() != NULL * * def get_pressed(): # <<<<<<<<<<<<<< * """ No longer returns a tuple. Use the returned object to check for * individual keys, but don't loop through it. """ */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_3key_3get_pressed(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused); /*proto*/ static char __pyx_doc_11pygame_sdl2_3key_2get_pressed[] = " No longer returns a tuple. Use the returned object to check for\n individual keys, but don't loop through it. "; static PyMethodDef __pyx_mdef_11pygame_sdl2_3key_3get_pressed = {"get_pressed", (PyCFunction)__pyx_pw_11pygame_sdl2_3key_3get_pressed, METH_NOARGS, __pyx_doc_11pygame_sdl2_3key_2get_pressed}; static PyObject *__pyx_pw_11pygame_sdl2_3key_3get_pressed(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("get_pressed (wrapper)", 0); __pyx_r = __pyx_pf_11pygame_sdl2_3key_2get_pressed(__pyx_self); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_3key_2get_pressed(CYTHON_UNUSED PyObject *__pyx_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("get_pressed", 0); /* "pygame_sdl2/key.pyx":69 * individual keys, but don't loop through it. """ * * return KeyboardState() # <<<<<<<<<<<<<< * * def get_mods(): */ __Pyx_XDECREF(__pyx_r); __pyx_t_1 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_11pygame_sdl2_3key_KeyboardState), __pyx_empty_tuple, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 69; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "pygame_sdl2/key.pyx":65 * return SDL_GetKeyboardFocus() != NULL * * def get_pressed(): # <<<<<<<<<<<<<< * """ No longer returns a tuple. Use the returned object to check for * individual keys, but don't loop through it. """ */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("pygame_sdl2.key.get_pressed", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/key.pyx":71 * return KeyboardState() * * def get_mods(): # <<<<<<<<<<<<<< * return SDL_GetModState() * */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_3key_5get_mods(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused); /*proto*/ static PyMethodDef __pyx_mdef_11pygame_sdl2_3key_5get_mods = {"get_mods", (PyCFunction)__pyx_pw_11pygame_sdl2_3key_5get_mods, METH_NOARGS, 0}; static PyObject *__pyx_pw_11pygame_sdl2_3key_5get_mods(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("get_mods (wrapper)", 0); __pyx_r = __pyx_pf_11pygame_sdl2_3key_4get_mods(__pyx_self); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_3key_4get_mods(CYTHON_UNUSED PyObject *__pyx_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("get_mods", 0); /* "pygame_sdl2/key.pyx":72 * * def get_mods(): * return SDL_GetModState() # <<<<<<<<<<<<<< * * def set_mods(state): */ __Pyx_XDECREF(__pyx_r); __pyx_t_1 = __Pyx_PyInt_From_SDL_Keymod(SDL_GetModState()); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 72; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "pygame_sdl2/key.pyx":71 * return KeyboardState() * * def get_mods(): # <<<<<<<<<<<<<< * return SDL_GetModState() * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("pygame_sdl2.key.get_mods", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/key.pyx":74 * return SDL_GetModState() * * def set_mods(state): # <<<<<<<<<<<<<< * SDL_SetModState(state) * */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_3key_7set_mods(PyObject *__pyx_self, PyObject *__pyx_v_state); /*proto*/ static PyMethodDef __pyx_mdef_11pygame_sdl2_3key_7set_mods = {"set_mods", (PyCFunction)__pyx_pw_11pygame_sdl2_3key_7set_mods, METH_O, 0}; static PyObject *__pyx_pw_11pygame_sdl2_3key_7set_mods(PyObject *__pyx_self, PyObject *__pyx_v_state) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("set_mods (wrapper)", 0); __pyx_r = __pyx_pf_11pygame_sdl2_3key_6set_mods(__pyx_self, ((PyObject *)__pyx_v_state)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_3key_6set_mods(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_state) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations SDL_Keymod __pyx_t_1; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("set_mods", 0); /* "pygame_sdl2/key.pyx":75 * * def set_mods(state): * SDL_SetModState(state) # <<<<<<<<<<<<<< * * def set_repeat(delay=0, interval=0): */ __pyx_t_1 = ((SDL_Keymod)__Pyx_PyInt_As_SDL_Keymod(__pyx_v_state)); if (unlikely(PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 75; __pyx_clineno = __LINE__; goto __pyx_L1_error;} SDL_SetModState(__pyx_t_1); /* "pygame_sdl2/key.pyx":74 * return SDL_GetModState() * * def set_mods(state): # <<<<<<<<<<<<<< * SDL_SetModState(state) * */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("pygame_sdl2.key.set_mods", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/key.pyx":77 * SDL_SetModState(state) * * def set_repeat(delay=0, interval=0): # <<<<<<<<<<<<<< * # Not possible with SDL2. * pass */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_3key_9set_repeat(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static PyMethodDef __pyx_mdef_11pygame_sdl2_3key_9set_repeat = {"set_repeat", (PyCFunction)__pyx_pw_11pygame_sdl2_3key_9set_repeat, METH_VARARGS|METH_KEYWORDS, 0}; static PyObject *__pyx_pw_11pygame_sdl2_3key_9set_repeat(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { CYTHON_UNUSED PyObject *__pyx_v_delay = 0; CYTHON_UNUSED PyObject *__pyx_v_interval = 0; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("set_repeat (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_delay,&__pyx_n_s_interval,0}; PyObject* values[2] = {0,0}; values[0] = ((PyObject *)__pyx_int_0); values[1] = ((PyObject *)__pyx_int_0); if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (kw_args > 0) { PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_delay); if (value) { values[0] = value; kw_args--; } } case 1: if (kw_args > 0) { PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_interval); if (value) { values[1] = value; kw_args--; } } } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "set_repeat") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 77; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } } else { switch (PyTuple_GET_SIZE(__pyx_args)) { case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); case 0: break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_delay = values[0]; __pyx_v_interval = values[1]; } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("set_repeat", 0, 0, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 77; __pyx_clineno = __LINE__; goto __pyx_L3_error;} __pyx_L3_error:; __Pyx_AddTraceback("pygame_sdl2.key.set_repeat", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_11pygame_sdl2_3key_8set_repeat(__pyx_self, __pyx_v_delay, __pyx_v_interval); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_3key_8set_repeat(CYTHON_UNUSED PyObject *__pyx_self, CYTHON_UNUSED PyObject *__pyx_v_delay, CYTHON_UNUSED PyObject *__pyx_v_interval) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("set_repeat", 0); /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/key.pyx":81 * pass * * def get_repeat(): # <<<<<<<<<<<<<< * # Not possible with SDL2. * return (0,0) */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_3key_11get_repeat(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused); /*proto*/ static PyMethodDef __pyx_mdef_11pygame_sdl2_3key_11get_repeat = {"get_repeat", (PyCFunction)__pyx_pw_11pygame_sdl2_3key_11get_repeat, METH_NOARGS, 0}; static PyObject *__pyx_pw_11pygame_sdl2_3key_11get_repeat(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("get_repeat (wrapper)", 0); __pyx_r = __pyx_pf_11pygame_sdl2_3key_10get_repeat(__pyx_self); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_3key_10get_repeat(CYTHON_UNUSED PyObject *__pyx_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("get_repeat", 0); /* "pygame_sdl2/key.pyx":83 * def get_repeat(): * # Not possible with SDL2. * return (0,0) # <<<<<<<<<<<<<< * * def name(key): */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(__pyx_tuple__3); __pyx_r = __pyx_tuple__3; goto __pyx_L0; /* "pygame_sdl2/key.pyx":81 * pass * * def get_repeat(): # <<<<<<<<<<<<<< * # Not possible with SDL2. * return (0,0) */ /* function exit code */ __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/key.pyx":85 * return (0,0) * * def name(key): # <<<<<<<<<<<<<< * return SDL_GetKeyName(key) * */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_3key_13name(PyObject *__pyx_self, PyObject *__pyx_v_key); /*proto*/ static PyMethodDef __pyx_mdef_11pygame_sdl2_3key_13name = {"name", (PyCFunction)__pyx_pw_11pygame_sdl2_3key_13name, METH_O, 0}; static PyObject *__pyx_pw_11pygame_sdl2_3key_13name(PyObject *__pyx_self, PyObject *__pyx_v_key) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("name (wrapper)", 0); __pyx_r = __pyx_pf_11pygame_sdl2_3key_12name(__pyx_self, ((PyObject *)__pyx_v_key)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_3key_12name(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_key) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations SDL_Keycode __pyx_t_1; PyObject *__pyx_t_2 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("name", 0); /* "pygame_sdl2/key.pyx":86 * * def name(key): * return SDL_GetKeyName(key) # <<<<<<<<<<<<<< * * text_input = False */ __Pyx_XDECREF(__pyx_r); __pyx_t_1 = __Pyx_PyInt_As_int32_t(__pyx_v_key); if (unlikely((__pyx_t_1 == (SDL_Keycode)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 86; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_t_2 = __Pyx_PyBytes_FromString(SDL_GetKeyName(__pyx_t_1)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 86; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; /* "pygame_sdl2/key.pyx":85 * return (0,0) * * def name(key): # <<<<<<<<<<<<<< * return SDL_GetKeyName(key) * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_AddTraceback("pygame_sdl2.key.name", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/key.pyx":90 * text_input = False * * def start_text_input(): # <<<<<<<<<<<<<< * global text_input * text_input = True */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_3key_15start_text_input(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused); /*proto*/ static PyMethodDef __pyx_mdef_11pygame_sdl2_3key_15start_text_input = {"start_text_input", (PyCFunction)__pyx_pw_11pygame_sdl2_3key_15start_text_input, METH_NOARGS, 0}; static PyObject *__pyx_pw_11pygame_sdl2_3key_15start_text_input(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("start_text_input (wrapper)", 0); __pyx_r = __pyx_pf_11pygame_sdl2_3key_14start_text_input(__pyx_self); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_3key_14start_text_input(CYTHON_UNUSED PyObject *__pyx_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations SDL_bool __pyx_t_1; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("start_text_input", 0); /* "pygame_sdl2/key.pyx":92 * def start_text_input(): * global text_input * text_input = True # <<<<<<<<<<<<<< * * if SDL_HasScreenKeyboardSupport(): */ if (PyDict_SetItem(__pyx_d, __pyx_n_s_text_input, Py_True) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 92; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "pygame_sdl2/key.pyx":94 * text_input = True * * if SDL_HasScreenKeyboardSupport(): # <<<<<<<<<<<<<< * SDL_StartTextInput() * */ __pyx_t_1 = SDL_HasScreenKeyboardSupport(); if (__pyx_t_1) { /* "pygame_sdl2/key.pyx":95 * * if SDL_HasScreenKeyboardSupport(): * SDL_StartTextInput() # <<<<<<<<<<<<<< * * def stop_text_input(): */ SDL_StartTextInput(); /* "pygame_sdl2/key.pyx":94 * text_input = True * * if SDL_HasScreenKeyboardSupport(): # <<<<<<<<<<<<<< * SDL_StartTextInput() * */ } /* "pygame_sdl2/key.pyx":90 * text_input = False * * def start_text_input(): # <<<<<<<<<<<<<< * global text_input * text_input = True */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("pygame_sdl2.key.start_text_input", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/key.pyx":97 * SDL_StartTextInput() * * def stop_text_input(): # <<<<<<<<<<<<<< * global text_input * text_input = False */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_3key_17stop_text_input(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused); /*proto*/ static PyMethodDef __pyx_mdef_11pygame_sdl2_3key_17stop_text_input = {"stop_text_input", (PyCFunction)__pyx_pw_11pygame_sdl2_3key_17stop_text_input, METH_NOARGS, 0}; static PyObject *__pyx_pw_11pygame_sdl2_3key_17stop_text_input(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("stop_text_input (wrapper)", 0); __pyx_r = __pyx_pf_11pygame_sdl2_3key_16stop_text_input(__pyx_self); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_3key_16stop_text_input(CYTHON_UNUSED PyObject *__pyx_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations SDL_bool __pyx_t_1; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("stop_text_input", 0); /* "pygame_sdl2/key.pyx":99 * def stop_text_input(): * global text_input * text_input = False # <<<<<<<<<<<<<< * * if SDL_HasScreenKeyboardSupport(): */ if (PyDict_SetItem(__pyx_d, __pyx_n_s_text_input, Py_False) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 99; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "pygame_sdl2/key.pyx":101 * text_input = False * * if SDL_HasScreenKeyboardSupport(): # <<<<<<<<<<<<<< * SDL_StopTextInput() * */ __pyx_t_1 = SDL_HasScreenKeyboardSupport(); if (__pyx_t_1) { /* "pygame_sdl2/key.pyx":102 * * if SDL_HasScreenKeyboardSupport(): * SDL_StopTextInput() # <<<<<<<<<<<<<< * * def set_text_input_rect(rect): */ SDL_StopTextInput(); /* "pygame_sdl2/key.pyx":101 * text_input = False * * if SDL_HasScreenKeyboardSupport(): # <<<<<<<<<<<<<< * SDL_StopTextInput() * */ } /* "pygame_sdl2/key.pyx":97 * SDL_StartTextInput() * * def stop_text_input(): # <<<<<<<<<<<<<< * global text_input * text_input = False */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("pygame_sdl2.key.stop_text_input", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/key.pyx":104 * SDL_StopTextInput() * * def set_text_input_rect(rect): # <<<<<<<<<<<<<< * cdef SDL_Rect sdl_rect; * */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_3key_19set_text_input_rect(PyObject *__pyx_self, PyObject *__pyx_v_rect); /*proto*/ static PyMethodDef __pyx_mdef_11pygame_sdl2_3key_19set_text_input_rect = {"set_text_input_rect", (PyCFunction)__pyx_pw_11pygame_sdl2_3key_19set_text_input_rect, METH_O, 0}; static PyObject *__pyx_pw_11pygame_sdl2_3key_19set_text_input_rect(PyObject *__pyx_self, PyObject *__pyx_v_rect) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("set_text_input_rect (wrapper)", 0); __pyx_r = __pyx_pf_11pygame_sdl2_3key_18set_text_input_rect(__pyx_self, ((PyObject *)__pyx_v_rect)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_3key_18set_text_input_rect(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_rect) { SDL_Rect __pyx_v_sdl_rect; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; int __pyx_t_2; int __pyx_t_3; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("set_text_input_rect", 0); /* "pygame_sdl2/key.pyx":107 * cdef SDL_Rect sdl_rect; * * if rect is not None: # <<<<<<<<<<<<<< * to_sdl_rect(rect, &sdl_rect) * SDL_SetTextInputRect(&sdl_rect) */ __pyx_t_1 = (__pyx_v_rect != Py_None); __pyx_t_2 = (__pyx_t_1 != 0); if (__pyx_t_2) { /* "pygame_sdl2/key.pyx":108 * * if rect is not None: * to_sdl_rect(rect, &sdl_rect) # <<<<<<<<<<<<<< * SDL_SetTextInputRect(&sdl_rect) * else: */ __pyx_t_3 = __pyx_f_11pygame_sdl2_4rect_to_sdl_rect(__pyx_v_rect, (&__pyx_v_sdl_rect), NULL); if (unlikely(__pyx_t_3 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 108; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "pygame_sdl2/key.pyx":109 * if rect is not None: * to_sdl_rect(rect, &sdl_rect) * SDL_SetTextInputRect(&sdl_rect) # <<<<<<<<<<<<<< * else: * SDL_SetTextInputRect(NULL) */ SDL_SetTextInputRect((&__pyx_v_sdl_rect)); /* "pygame_sdl2/key.pyx":107 * cdef SDL_Rect sdl_rect; * * if rect is not None: # <<<<<<<<<<<<<< * to_sdl_rect(rect, &sdl_rect) * SDL_SetTextInputRect(&sdl_rect) */ goto __pyx_L3; } /* "pygame_sdl2/key.pyx":111 * SDL_SetTextInputRect(&sdl_rect) * else: * SDL_SetTextInputRect(NULL) # <<<<<<<<<<<<<< * * def has_screen_keyboard_support(): */ /*else*/ { SDL_SetTextInputRect(NULL); } __pyx_L3:; /* "pygame_sdl2/key.pyx":104 * SDL_StopTextInput() * * def set_text_input_rect(rect): # <<<<<<<<<<<<<< * cdef SDL_Rect sdl_rect; * */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("pygame_sdl2.key.set_text_input_rect", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/key.pyx":113 * SDL_SetTextInputRect(NULL) * * def has_screen_keyboard_support(): # <<<<<<<<<<<<<< * return SDL_HasScreenKeyboardSupport() * */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_3key_21has_screen_keyboard_support(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused); /*proto*/ static PyMethodDef __pyx_mdef_11pygame_sdl2_3key_21has_screen_keyboard_support = {"has_screen_keyboard_support", (PyCFunction)__pyx_pw_11pygame_sdl2_3key_21has_screen_keyboard_support, METH_NOARGS, 0}; static PyObject *__pyx_pw_11pygame_sdl2_3key_21has_screen_keyboard_support(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("has_screen_keyboard_support (wrapper)", 0); __pyx_r = __pyx_pf_11pygame_sdl2_3key_20has_screen_keyboard_support(__pyx_self); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_3key_20has_screen_keyboard_support(CYTHON_UNUSED PyObject *__pyx_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("has_screen_keyboard_support", 0); /* "pygame_sdl2/key.pyx":114 * * def has_screen_keyboard_support(): * return SDL_HasScreenKeyboardSupport() # <<<<<<<<<<<<<< * * def is_screen_keyboard_shown(Window window=None): */ __Pyx_XDECREF(__pyx_r); __pyx_t_1 = __Pyx_PyInt_From_SDL_bool(SDL_HasScreenKeyboardSupport()); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 114; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "pygame_sdl2/key.pyx":113 * SDL_SetTextInputRect(NULL) * * def has_screen_keyboard_support(): # <<<<<<<<<<<<<< * return SDL_HasScreenKeyboardSupport() * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("pygame_sdl2.key.has_screen_keyboard_support", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/key.pyx":116 * return SDL_HasScreenKeyboardSupport() * * def is_screen_keyboard_shown(Window window=None): # <<<<<<<<<<<<<< * if window is None: * window = main_window */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_3key_23is_screen_keyboard_shown(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static PyMethodDef __pyx_mdef_11pygame_sdl2_3key_23is_screen_keyboard_shown = {"is_screen_keyboard_shown", (PyCFunction)__pyx_pw_11pygame_sdl2_3key_23is_screen_keyboard_shown, METH_VARARGS|METH_KEYWORDS, 0}; static PyObject *__pyx_pw_11pygame_sdl2_3key_23is_screen_keyboard_shown(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { struct __pyx_obj_11pygame_sdl2_7display_Window *__pyx_v_window = 0; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("is_screen_keyboard_shown (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_window,0}; PyObject* values[1] = {0}; values[0] = (PyObject *)((struct __pyx_obj_11pygame_sdl2_7display_Window *)Py_None); if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (kw_args > 0) { PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_window); if (value) { values[0] = value; kw_args--; } } } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "is_screen_keyboard_shown") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 116; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } } else { switch (PyTuple_GET_SIZE(__pyx_args)) { case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); case 0: break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_window = ((struct __pyx_obj_11pygame_sdl2_7display_Window *)values[0]); } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("is_screen_keyboard_shown", 0, 0, 1, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 116; __pyx_clineno = __LINE__; goto __pyx_L3_error;} __pyx_L3_error:; __Pyx_AddTraceback("pygame_sdl2.key.is_screen_keyboard_shown", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_window), __pyx_ptype_11pygame_sdl2_7display_Window, 1, "window", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 116; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_r = __pyx_pf_11pygame_sdl2_3key_22is_screen_keyboard_shown(__pyx_self, __pyx_v_window); /* function exit code */ goto __pyx_L0; __pyx_L1_error:; __pyx_r = NULL; __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_3key_22is_screen_keyboard_shown(CYTHON_UNUSED PyObject *__pyx_self, struct __pyx_obj_11pygame_sdl2_7display_Window *__pyx_v_window) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; int __pyx_t_2; PyObject *__pyx_t_3 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("is_screen_keyboard_shown", 0); __Pyx_INCREF((PyObject *)__pyx_v_window); /* "pygame_sdl2/key.pyx":117 * * def is_screen_keyboard_shown(Window window=None): * if window is None: # <<<<<<<<<<<<<< * window = main_window * */ __pyx_t_1 = (((PyObject *)__pyx_v_window) == Py_None); __pyx_t_2 = (__pyx_t_1 != 0); if (__pyx_t_2) { /* "pygame_sdl2/key.pyx":118 * def is_screen_keyboard_shown(Window window=None): * if window is None: * window = main_window # <<<<<<<<<<<<<< * * return SDL_IsScreenKeyboardShown(window.window) */ __Pyx_INCREF(((PyObject *)__pyx_v_11pygame_sdl2_7display_main_window)); __Pyx_DECREF_SET(__pyx_v_window, __pyx_v_11pygame_sdl2_7display_main_window); /* "pygame_sdl2/key.pyx":117 * * def is_screen_keyboard_shown(Window window=None): * if window is None: # <<<<<<<<<<<<<< * window = main_window * */ } /* "pygame_sdl2/key.pyx":120 * window = main_window * * return SDL_IsScreenKeyboardShown(window.window) # <<<<<<<<<<<<<< */ __Pyx_XDECREF(__pyx_r); __pyx_t_3 = __Pyx_PyInt_From_SDL_bool(SDL_IsScreenKeyboardShown(__pyx_v_window->window)); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 120; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __pyx_r = __pyx_t_3; __pyx_t_3 = 0; goto __pyx_L0; /* "pygame_sdl2/key.pyx":116 * return SDL_HasScreenKeyboardSupport() * * def is_screen_keyboard_shown(Window window=None): # <<<<<<<<<<<<<< * if window is None: * window = main_window */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("pygame_sdl2.key.is_screen_keyboard_shown", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF((PyObject *)__pyx_v_window); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_tp_new_11pygame_sdl2_3key_KeyboardState(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) { PyObject *o; if (likely((t->tp_flags & Py_TPFLAGS_IS_ABSTRACT) == 0)) { o = (*t->tp_alloc)(t, 0); } else { o = (PyObject *) PyBaseObject_Type.tp_new(t, __pyx_empty_tuple, 0); } if (unlikely(!o)) return 0; if (unlikely(__pyx_pw_11pygame_sdl2_3key_13KeyboardState_1__cinit__(o, __pyx_empty_tuple, NULL) < 0)) { Py_DECREF(o); o = 0; } return o; } static void __pyx_tp_dealloc_11pygame_sdl2_3key_KeyboardState(PyObject *o) { struct __pyx_obj_11pygame_sdl2_3key_KeyboardState *p = (struct __pyx_obj_11pygame_sdl2_3key_KeyboardState *)o; #if PY_VERSION_HEX >= 0x030400a1 if (unlikely(Py_TYPE(o)->tp_finalize) && (!PyType_IS_GC(Py_TYPE(o)) || !_PyGC_FINALIZED(o))) { if (PyObject_CallFinalizerFromDealloc(o)) return; } #endif { PyObject *etype, *eval, *etb; PyErr_Fetch(&etype, &eval, &etb); ++Py_REFCNT(o); __pyx_pw_11pygame_sdl2_3key_13KeyboardState_3__dealloc__(o); --Py_REFCNT(o); PyErr_Restore(etype, eval, etb); } if (p->__weakref__) PyObject_ClearWeakRefs(o); (*Py_TYPE(o)->tp_free)(o); } static PyObject *__pyx_sq_item_11pygame_sdl2_3key_KeyboardState(PyObject *o, Py_ssize_t i) { PyObject *r; PyObject *x = PyInt_FromSsize_t(i); if(!x) return 0; r = Py_TYPE(o)->tp_as_mapping->mp_subscript(o, x); Py_DECREF(x); return r; } static PyMethodDef __pyx_methods_11pygame_sdl2_3key_KeyboardState[] = { {0, 0, 0, 0} }; static PySequenceMethods __pyx_tp_as_sequence_KeyboardState = { 0, /*sq_length*/ 0, /*sq_concat*/ 0, /*sq_repeat*/ __pyx_sq_item_11pygame_sdl2_3key_KeyboardState, /*sq_item*/ 0, /*sq_slice*/ 0, /*sq_ass_item*/ 0, /*sq_ass_slice*/ 0, /*sq_contains*/ 0, /*sq_inplace_concat*/ 0, /*sq_inplace_repeat*/ }; static PyMappingMethods __pyx_tp_as_mapping_KeyboardState = { 0, /*mp_length*/ __pyx_pw_11pygame_sdl2_3key_13KeyboardState_7__getitem__, /*mp_subscript*/ 0, /*mp_ass_subscript*/ }; static PyTypeObject __pyx_type_11pygame_sdl2_3key_KeyboardState = { PyVarObject_HEAD_INIT(0, 0) "pygame_sdl2.key.KeyboardState", /*tp_name*/ sizeof(struct __pyx_obj_11pygame_sdl2_3key_KeyboardState), /*tp_basicsize*/ 0, /*tp_itemsize*/ __pyx_tp_dealloc_11pygame_sdl2_3key_KeyboardState, /*tp_dealloc*/ 0, /*tp_print*/ 0, /*tp_getattr*/ 0, /*tp_setattr*/ #if PY_MAJOR_VERSION < 3 0, /*tp_compare*/ #endif #if PY_MAJOR_VERSION >= 3 0, /*tp_as_async*/ #endif 0, /*tp_repr*/ 0, /*tp_as_number*/ &__pyx_tp_as_sequence_KeyboardState, /*tp_as_sequence*/ &__pyx_tp_as_mapping_KeyboardState, /*tp_as_mapping*/ 0, /*tp_hash*/ 0, /*tp_call*/ 0, /*tp_str*/ 0, /*tp_getattro*/ 0, /*tp_setattro*/ 0, /*tp_as_buffer*/ Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE, /*tp_flags*/ 0, /*tp_doc*/ 0, /*tp_traverse*/ 0, /*tp_clear*/ 0, /*tp_richcompare*/ 0, /*tp_weaklistoffset*/ 0, /*tp_iter*/ 0, /*tp_iternext*/ __pyx_methods_11pygame_sdl2_3key_KeyboardState, /*tp_methods*/ 0, /*tp_members*/ 0, /*tp_getset*/ 0, /*tp_base*/ 0, /*tp_dict*/ 0, /*tp_descr_get*/ 0, /*tp_descr_set*/ 0, /*tp_dictoffset*/ __pyx_pw_11pygame_sdl2_3key_13KeyboardState_5__init__, /*tp_init*/ 0, /*tp_alloc*/ __pyx_tp_new_11pygame_sdl2_3key_KeyboardState, /*tp_new*/ 0, /*tp_free*/ 0, /*tp_is_gc*/ 0, /*tp_bases*/ 0, /*tp_mro*/ 0, /*tp_cache*/ 0, /*tp_subclasses*/ 0, /*tp_weaklist*/ 0, /*tp_del*/ 0, /*tp_version_tag*/ #if PY_VERSION_HEX >= 0x030400a1 0, /*tp_finalize*/ #endif }; static PyMethodDef __pyx_methods[] = { {0, 0, 0, 0} }; #if PY_MAJOR_VERSION >= 3 static struct PyModuleDef __pyx_moduledef = { #if PY_VERSION_HEX < 0x03020000 { PyObject_HEAD_INIT(NULL) NULL, 0, NULL }, #else PyModuleDef_HEAD_INIT, #endif "key", 0, /* m_doc */ -1, /* m_size */ __pyx_methods /* m_methods */, NULL, /* m_reload */ NULL, /* m_traverse */ NULL, /* m_clear */ NULL /* m_free */ }; #endif static __Pyx_StringTabEntry __pyx_string_tab[] = { {&__pyx_n_s_IndexError, __pyx_k_IndexError, sizeof(__pyx_k_IndexError), 0, 0, 1, 1}, {&__pyx_kp_s_Out_of_range, __pyx_k_Out_of_range, sizeof(__pyx_k_Out_of_range), 0, 0, 1, 0}, {&__pyx_n_s_delay, __pyx_k_delay, sizeof(__pyx_k_delay), 0, 0, 1, 1}, {&__pyx_n_s_error, __pyx_k_error, sizeof(__pyx_k_error), 0, 0, 1, 1}, {&__pyx_n_s_get_focused, __pyx_k_get_focused, sizeof(__pyx_k_get_focused), 0, 0, 1, 1}, {&__pyx_n_s_get_mods, __pyx_k_get_mods, sizeof(__pyx_k_get_mods), 0, 0, 1, 1}, {&__pyx_n_s_get_pressed, __pyx_k_get_pressed, sizeof(__pyx_k_get_pressed), 0, 0, 1, 1}, {&__pyx_n_s_get_repeat, __pyx_k_get_repeat, sizeof(__pyx_k_get_repeat), 0, 0, 1, 1}, {&__pyx_n_s_has_screen_keyboard_support, __pyx_k_has_screen_keyboard_support, sizeof(__pyx_k_has_screen_keyboard_support), 0, 0, 1, 1}, {&__pyx_kp_s_home_tom_ab_pygame_sdl2_src_pyg, __pyx_k_home_tom_ab_pygame_sdl2_src_pyg, sizeof(__pyx_k_home_tom_ab_pygame_sdl2_src_pyg), 0, 0, 1, 0}, {&__pyx_n_s_import, __pyx_k_import, sizeof(__pyx_k_import), 0, 0, 1, 1}, {&__pyx_n_s_interval, __pyx_k_interval, sizeof(__pyx_k_interval), 0, 0, 1, 1}, {&__pyx_n_s_is_screen_keyboard_shown, __pyx_k_is_screen_keyboard_shown, sizeof(__pyx_k_is_screen_keyboard_shown), 0, 0, 1, 1}, {&__pyx_n_s_key, __pyx_k_key, sizeof(__pyx_k_key), 0, 0, 1, 1}, {&__pyx_n_s_main, __pyx_k_main, sizeof(__pyx_k_main), 0, 0, 1, 1}, {&__pyx_n_s_name, __pyx_k_name, sizeof(__pyx_k_name), 0, 0, 1, 1}, {&__pyx_n_s_pygame_sdl2_error, __pyx_k_pygame_sdl2_error, sizeof(__pyx_k_pygame_sdl2_error), 0, 0, 1, 1}, {&__pyx_n_s_pygame_sdl2_key, __pyx_k_pygame_sdl2_key, sizeof(__pyx_k_pygame_sdl2_key), 0, 0, 1, 1}, {&__pyx_n_s_pyx_vtable, __pyx_k_pyx_vtable, sizeof(__pyx_k_pyx_vtable), 0, 0, 1, 1}, {&__pyx_n_s_rect, __pyx_k_rect, sizeof(__pyx_k_rect), 0, 0, 1, 1}, {&__pyx_n_s_sdl_rect, __pyx_k_sdl_rect, sizeof(__pyx_k_sdl_rect), 0, 0, 1, 1}, {&__pyx_n_s_set_mods, __pyx_k_set_mods, sizeof(__pyx_k_set_mods), 0, 0, 1, 1}, {&__pyx_n_s_set_repeat, __pyx_k_set_repeat, sizeof(__pyx_k_set_repeat), 0, 0, 1, 1}, {&__pyx_n_s_set_text_input_rect, __pyx_k_set_text_input_rect, sizeof(__pyx_k_set_text_input_rect), 0, 0, 1, 1}, {&__pyx_n_s_start_text_input, __pyx_k_start_text_input, sizeof(__pyx_k_start_text_input), 0, 0, 1, 1}, {&__pyx_n_s_state, __pyx_k_state, sizeof(__pyx_k_state), 0, 0, 1, 1}, {&__pyx_n_s_stop_text_input, __pyx_k_stop_text_input, sizeof(__pyx_k_stop_text_input), 0, 0, 1, 1}, {&__pyx_n_s_test, __pyx_k_test, sizeof(__pyx_k_test), 0, 0, 1, 1}, {&__pyx_n_s_text_input, __pyx_k_text_input, sizeof(__pyx_k_text_input), 0, 0, 1, 1}, {&__pyx_n_s_window, __pyx_k_window, sizeof(__pyx_k_window), 0, 0, 1, 1}, {0, 0, 0, 0, 0, 0, 0} }; static int __Pyx_InitCachedBuiltins(void) { __pyx_builtin_IndexError = __Pyx_GetBuiltinName(__pyx_n_s_IndexError); if (!__pyx_builtin_IndexError) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 53; __pyx_clineno = __LINE__; goto __pyx_L1_error;} return 0; __pyx_L1_error:; return -1; } static int __Pyx_InitCachedConstants(void) { __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__Pyx_InitCachedConstants", 0); /* "pygame_sdl2/key.pyx":53 * def __getitem__(self, int key): * if SDLK_DELETE < key < SDLK_CAPSLOCK: * raise IndexError("Out of range.") # <<<<<<<<<<<<<< * * cdef int sc = SDL_GetScancodeFromKey(key) */ __pyx_tuple_ = PyTuple_Pack(1, __pyx_kp_s_Out_of_range); if (unlikely(!__pyx_tuple_)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 53; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_tuple_); __Pyx_GIVEREF(__pyx_tuple_); /* "pygame_sdl2/key.pyx":57 * cdef int sc = SDL_GetScancodeFromKey(key) * if sc > self.numkeys: * raise IndexError("Out of range.") # <<<<<<<<<<<<<< * * return self.data[sc] */ __pyx_tuple__2 = PyTuple_Pack(1, __pyx_kp_s_Out_of_range); if (unlikely(!__pyx_tuple__2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 57; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_tuple__2); __Pyx_GIVEREF(__pyx_tuple__2); /* "pygame_sdl2/key.pyx":83 * def get_repeat(): * # Not possible with SDL2. * return (0,0) # <<<<<<<<<<<<<< * * def name(key): */ __pyx_tuple__3 = PyTuple_Pack(2, __pyx_int_0, __pyx_int_0); if (unlikely(!__pyx_tuple__3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 83; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_tuple__3); __Pyx_GIVEREF(__pyx_tuple__3); /* "pygame_sdl2/key.pyx":62 * * * def get_focused(): # <<<<<<<<<<<<<< * return SDL_GetKeyboardFocus() != NULL * */ __pyx_codeobj__4 = (PyObject*)__Pyx_PyCode_New(0, 0, 0, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_tom_ab_pygame_sdl2_src_pyg, __pyx_n_s_get_focused, 62, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 62; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "pygame_sdl2/key.pyx":65 * return SDL_GetKeyboardFocus() != NULL * * def get_pressed(): # <<<<<<<<<<<<<< * """ No longer returns a tuple. Use the returned object to check for * individual keys, but don't loop through it. """ */ __pyx_codeobj__5 = (PyObject*)__Pyx_PyCode_New(0, 0, 0, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_tom_ab_pygame_sdl2_src_pyg, __pyx_n_s_get_pressed, 65, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 65; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "pygame_sdl2/key.pyx":71 * return KeyboardState() * * def get_mods(): # <<<<<<<<<<<<<< * return SDL_GetModState() * */ __pyx_codeobj__6 = (PyObject*)__Pyx_PyCode_New(0, 0, 0, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_tom_ab_pygame_sdl2_src_pyg, __pyx_n_s_get_mods, 71, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 71; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "pygame_sdl2/key.pyx":74 * return SDL_GetModState() * * def set_mods(state): # <<<<<<<<<<<<<< * SDL_SetModState(state) * */ __pyx_tuple__7 = PyTuple_Pack(1, __pyx_n_s_state); if (unlikely(!__pyx_tuple__7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 74; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_tuple__7); __Pyx_GIVEREF(__pyx_tuple__7); __pyx_codeobj__8 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__7, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_tom_ab_pygame_sdl2_src_pyg, __pyx_n_s_set_mods, 74, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 74; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "pygame_sdl2/key.pyx":77 * SDL_SetModState(state) * * def set_repeat(delay=0, interval=0): # <<<<<<<<<<<<<< * # Not possible with SDL2. * pass */ __pyx_tuple__9 = PyTuple_Pack(2, __pyx_n_s_delay, __pyx_n_s_interval); if (unlikely(!__pyx_tuple__9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 77; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_tuple__9); __Pyx_GIVEREF(__pyx_tuple__9); __pyx_codeobj__10 = (PyObject*)__Pyx_PyCode_New(2, 0, 2, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__9, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_tom_ab_pygame_sdl2_src_pyg, __pyx_n_s_set_repeat, 77, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 77; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "pygame_sdl2/key.pyx":81 * pass * * def get_repeat(): # <<<<<<<<<<<<<< * # Not possible with SDL2. * return (0,0) */ __pyx_codeobj__11 = (PyObject*)__Pyx_PyCode_New(0, 0, 0, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_tom_ab_pygame_sdl2_src_pyg, __pyx_n_s_get_repeat, 81, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 81; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "pygame_sdl2/key.pyx":85 * return (0,0) * * def name(key): # <<<<<<<<<<<<<< * return SDL_GetKeyName(key) * */ __pyx_tuple__12 = PyTuple_Pack(1, __pyx_n_s_key); if (unlikely(!__pyx_tuple__12)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 85; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_tuple__12); __Pyx_GIVEREF(__pyx_tuple__12); __pyx_codeobj__13 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__12, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_tom_ab_pygame_sdl2_src_pyg, __pyx_n_s_name, 85, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__13)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 85; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "pygame_sdl2/key.pyx":90 * text_input = False * * def start_text_input(): # <<<<<<<<<<<<<< * global text_input * text_input = True */ __pyx_codeobj__14 = (PyObject*)__Pyx_PyCode_New(0, 0, 0, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_tom_ab_pygame_sdl2_src_pyg, __pyx_n_s_start_text_input, 90, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__14)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 90; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "pygame_sdl2/key.pyx":97 * SDL_StartTextInput() * * def stop_text_input(): # <<<<<<<<<<<<<< * global text_input * text_input = False */ __pyx_codeobj__15 = (PyObject*)__Pyx_PyCode_New(0, 0, 0, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_tom_ab_pygame_sdl2_src_pyg, __pyx_n_s_stop_text_input, 97, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__15)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 97; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "pygame_sdl2/key.pyx":104 * SDL_StopTextInput() * * def set_text_input_rect(rect): # <<<<<<<<<<<<<< * cdef SDL_Rect sdl_rect; * */ __pyx_tuple__16 = PyTuple_Pack(2, __pyx_n_s_rect, __pyx_n_s_sdl_rect); if (unlikely(!__pyx_tuple__16)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 104; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_tuple__16); __Pyx_GIVEREF(__pyx_tuple__16); __pyx_codeobj__17 = (PyObject*)__Pyx_PyCode_New(1, 0, 2, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__16, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_tom_ab_pygame_sdl2_src_pyg, __pyx_n_s_set_text_input_rect, 104, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__17)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 104; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "pygame_sdl2/key.pyx":113 * SDL_SetTextInputRect(NULL) * * def has_screen_keyboard_support(): # <<<<<<<<<<<<<< * return SDL_HasScreenKeyboardSupport() * */ __pyx_codeobj__18 = (PyObject*)__Pyx_PyCode_New(0, 0, 0, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_tom_ab_pygame_sdl2_src_pyg, __pyx_n_s_has_screen_keyboard_support, 113, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__18)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 113; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "pygame_sdl2/key.pyx":116 * return SDL_HasScreenKeyboardSupport() * * def is_screen_keyboard_shown(Window window=None): # <<<<<<<<<<<<<< * if window is None: * window = main_window */ __pyx_tuple__19 = PyTuple_Pack(1, __pyx_n_s_window); if (unlikely(!__pyx_tuple__19)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 116; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_tuple__19); __Pyx_GIVEREF(__pyx_tuple__19); __pyx_codeobj__20 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__19, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_tom_ab_pygame_sdl2_src_pyg, __pyx_n_s_is_screen_keyboard_shown, 116, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__20)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 116; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_RefNannyFinishContext(); return 0; __pyx_L1_error:; __Pyx_RefNannyFinishContext(); return -1; } static int __Pyx_InitGlobals(void) { if (__Pyx_InitStrings(__pyx_string_tab) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; __pyx_int_0 = PyInt_FromLong(0); if (unlikely(!__pyx_int_0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} return 0; __pyx_L1_error:; return -1; } #if PY_MAJOR_VERSION < 3 PyMODINIT_FUNC initkey(void); /*proto*/ PyMODINIT_FUNC initkey(void) #else PyMODINIT_FUNC PyInit_key(void); /*proto*/ PyMODINIT_FUNC PyInit_key(void) #endif { PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannyDeclarations #if CYTHON_REFNANNY __Pyx_RefNanny = __Pyx_RefNannyImportAPI("refnanny"); if (!__Pyx_RefNanny) { PyErr_Clear(); __Pyx_RefNanny = __Pyx_RefNannyImportAPI("Cython.Runtime.refnanny"); if (!__Pyx_RefNanny) Py_FatalError("failed to import 'refnanny' module"); } #endif __Pyx_RefNannySetupContext("PyMODINIT_FUNC PyInit_key(void)", 0); if (__Pyx_check_binary_version() < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_empty_tuple = PyTuple_New(0); if (unlikely(!__pyx_empty_tuple)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_empty_bytes = PyBytes_FromStringAndSize("", 0); if (unlikely(!__pyx_empty_bytes)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} #ifdef __Pyx_CyFunction_USED if (__pyx_CyFunction_init() < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} #endif #ifdef __Pyx_FusedFunction_USED if (__pyx_FusedFunction_init() < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} #endif #ifdef __Pyx_Coroutine_USED if (__pyx_Coroutine_init() < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} #endif #ifdef __Pyx_Generator_USED if (__pyx_Generator_init() < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} #endif #ifdef __Pyx_StopAsyncIteration_USED if (__pyx_StopAsyncIteration_init() < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} #endif /*--- Library function declarations ---*/ /*--- Threads initialization code ---*/ #if defined(__PYX_FORCE_INIT_THREADS) && __PYX_FORCE_INIT_THREADS #ifdef WITH_THREAD /* Python build with threading support? */ PyEval_InitThreads(); #endif #endif /*--- Module creation code ---*/ #if PY_MAJOR_VERSION < 3 __pyx_m = Py_InitModule4("key", __pyx_methods, 0, 0, PYTHON_API_VERSION); Py_XINCREF(__pyx_m); #else __pyx_m = PyModule_Create(&__pyx_moduledef); #endif if (unlikely(!__pyx_m)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_d = PyModule_GetDict(__pyx_m); if (unlikely(!__pyx_d)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} Py_INCREF(__pyx_d); __pyx_b = PyImport_AddModule(__Pyx_BUILTIN_MODULE_NAME); if (unlikely(!__pyx_b)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} #if CYTHON_COMPILING_IN_PYPY Py_INCREF(__pyx_b); #endif if (PyObject_SetAttrString(__pyx_m, "__builtins__", __pyx_b) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; /*--- Initialize various global constants etc. ---*/ if (__Pyx_InitGlobals() < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} #if PY_MAJOR_VERSION < 3 && (__PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT) if (__Pyx_init_sys_getdefaultencoding_params() < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} #endif if (__pyx_module_is_main_pygame_sdl2__key) { if (PyObject_SetAttrString(__pyx_m, "__name__", __pyx_n_s_main) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } #if PY_MAJOR_VERSION >= 3 { PyObject *modules = PyImport_GetModuleDict(); if (unlikely(!modules)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} if (!PyDict_GetItemString(modules, "pygame_sdl2.key")) { if (unlikely(PyDict_SetItemString(modules, "pygame_sdl2.key", __pyx_m) < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } } #endif /*--- Builtin init code ---*/ if (__Pyx_InitCachedBuiltins() < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /*--- Constants init code ---*/ if (__Pyx_InitCachedConstants() < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /*--- Global init code ---*/ /*--- Variable export code ---*/ /*--- Function export code ---*/ /*--- Type init code ---*/ if (PyType_Ready(&__pyx_type_11pygame_sdl2_3key_KeyboardState) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 28; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_type_11pygame_sdl2_3key_KeyboardState.tp_print = 0; if (PyObject_SetAttrString(__pyx_m, "KeyboardState", (PyObject *)&__pyx_type_11pygame_sdl2_3key_KeyboardState) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 28; __pyx_clineno = __LINE__; goto __pyx_L1_error;} if (__pyx_type_11pygame_sdl2_3key_KeyboardState.tp_weaklistoffset == 0) __pyx_type_11pygame_sdl2_3key_KeyboardState.tp_weaklistoffset = offsetof(struct __pyx_obj_11pygame_sdl2_3key_KeyboardState, __weakref__); __pyx_ptype_11pygame_sdl2_3key_KeyboardState = &__pyx_type_11pygame_sdl2_3key_KeyboardState; /*--- Type import code ---*/ __pyx_ptype_11pygame_sdl2_7surface_Surface = __Pyx_ImportType("pygame_sdl2.surface", "Surface", sizeof(struct __pyx_obj_11pygame_sdl2_7surface_Surface), 1); if (unlikely(!__pyx_ptype_11pygame_sdl2_7surface_Surface)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 23; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_vtabptr_11pygame_sdl2_7surface_Surface = (struct __pyx_vtabstruct_11pygame_sdl2_7surface_Surface*)__Pyx_GetVtable(__pyx_ptype_11pygame_sdl2_7surface_Surface->tp_dict); if (unlikely(!__pyx_vtabptr_11pygame_sdl2_7surface_Surface)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 23; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_ptype_11pygame_sdl2_7display_Window = __Pyx_ImportType("pygame_sdl2.display", "Window", sizeof(struct __pyx_obj_11pygame_sdl2_7display_Window), 1); if (unlikely(!__pyx_ptype_11pygame_sdl2_7display_Window)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 23; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_ptype_11pygame_sdl2_4rect_Rect = __Pyx_ImportType("pygame_sdl2.rect", "Rect", sizeof(struct __pyx_obj_11pygame_sdl2_4rect_Rect), 1); if (unlikely(!__pyx_ptype_11pygame_sdl2_4rect_Rect)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 21; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /*--- Variable import code ---*/ __pyx_t_1 = __Pyx_ImportModule("pygame_sdl2.display"); if (!__pyx_t_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} if (__Pyx_ImportVoidPtr(__pyx_t_1, "main_window", (void **)&__pyx_vp_11pygame_sdl2_7display_main_window, "struct __pyx_obj_11pygame_sdl2_7display_Window *") < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} Py_DECREF(__pyx_t_1); __pyx_t_1 = 0; /*--- Function import code ---*/ __pyx_t_2 = __Pyx_ImportModule("pygame_sdl2.rect"); if (!__pyx_t_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} if (__Pyx_ImportFunction(__pyx_t_2, "to_sdl_rect", (void (**)(void))&__pyx_f_11pygame_sdl2_4rect_to_sdl_rect, "int (PyObject *, SDL_Rect *, struct __pyx_opt_args_11pygame_sdl2_4rect_to_sdl_rect *__pyx_optional_args)") < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} Py_DECREF(__pyx_t_2); __pyx_t_2 = 0; /*--- Execution code ---*/ #if defined(__Pyx_Generator_USED) || defined(__Pyx_Coroutine_USED) if (__Pyx_patch_abc() < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} #endif /* "pygame_sdl2/key.pyx":25 * from pygame_sdl2.rect cimport to_sdl_rect * * from pygame_sdl2.error import error # <<<<<<<<<<<<<< * * */ __pyx_t_3 = PyList_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 25; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __Pyx_INCREF(__pyx_n_s_error); __Pyx_GIVEREF(__pyx_n_s_error); PyList_SET_ITEM(__pyx_t_3, 0, __pyx_n_s_error); __pyx_t_4 = __Pyx_Import(__pyx_n_s_pygame_sdl2_error, __pyx_t_3, -1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 25; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_3 = __Pyx_ImportFrom(__pyx_t_4, __pyx_n_s_error); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 25; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); if (PyDict_SetItem(__pyx_d, __pyx_n_s_error, __pyx_t_3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 25; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; /* "pygame_sdl2/key.pyx":62 * * * def get_focused(): # <<<<<<<<<<<<<< * return SDL_GetKeyboardFocus() != NULL * */ __pyx_t_4 = PyCFunction_NewEx(&__pyx_mdef_11pygame_sdl2_3key_1get_focused, NULL, __pyx_n_s_pygame_sdl2_key); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 62; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); if (PyDict_SetItem(__pyx_d, __pyx_n_s_get_focused, __pyx_t_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 62; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; /* "pygame_sdl2/key.pyx":65 * return SDL_GetKeyboardFocus() != NULL * * def get_pressed(): # <<<<<<<<<<<<<< * """ No longer returns a tuple. Use the returned object to check for * individual keys, but don't loop through it. """ */ __pyx_t_4 = PyCFunction_NewEx(&__pyx_mdef_11pygame_sdl2_3key_3get_pressed, NULL, __pyx_n_s_pygame_sdl2_key); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 65; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); if (PyDict_SetItem(__pyx_d, __pyx_n_s_get_pressed, __pyx_t_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 65; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; /* "pygame_sdl2/key.pyx":71 * return KeyboardState() * * def get_mods(): # <<<<<<<<<<<<<< * return SDL_GetModState() * */ __pyx_t_4 = PyCFunction_NewEx(&__pyx_mdef_11pygame_sdl2_3key_5get_mods, NULL, __pyx_n_s_pygame_sdl2_key); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 71; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); if (PyDict_SetItem(__pyx_d, __pyx_n_s_get_mods, __pyx_t_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 71; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; /* "pygame_sdl2/key.pyx":74 * return SDL_GetModState() * * def set_mods(state): # <<<<<<<<<<<<<< * SDL_SetModState(state) * */ __pyx_t_4 = PyCFunction_NewEx(&__pyx_mdef_11pygame_sdl2_3key_7set_mods, NULL, __pyx_n_s_pygame_sdl2_key); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 74; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); if (PyDict_SetItem(__pyx_d, __pyx_n_s_set_mods, __pyx_t_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 74; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; /* "pygame_sdl2/key.pyx":77 * SDL_SetModState(state) * * def set_repeat(delay=0, interval=0): # <<<<<<<<<<<<<< * # Not possible with SDL2. * pass */ __pyx_t_4 = PyCFunction_NewEx(&__pyx_mdef_11pygame_sdl2_3key_9set_repeat, NULL, __pyx_n_s_pygame_sdl2_key); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 77; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); if (PyDict_SetItem(__pyx_d, __pyx_n_s_set_repeat, __pyx_t_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 77; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; /* "pygame_sdl2/key.pyx":81 * pass * * def get_repeat(): # <<<<<<<<<<<<<< * # Not possible with SDL2. * return (0,0) */ __pyx_t_4 = PyCFunction_NewEx(&__pyx_mdef_11pygame_sdl2_3key_11get_repeat, NULL, __pyx_n_s_pygame_sdl2_key); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 81; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); if (PyDict_SetItem(__pyx_d, __pyx_n_s_get_repeat, __pyx_t_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 81; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; /* "pygame_sdl2/key.pyx":85 * return (0,0) * * def name(key): # <<<<<<<<<<<<<< * return SDL_GetKeyName(key) * */ __pyx_t_4 = PyCFunction_NewEx(&__pyx_mdef_11pygame_sdl2_3key_13name, NULL, __pyx_n_s_pygame_sdl2_key); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 85; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); if (PyDict_SetItem(__pyx_d, __pyx_n_s_name, __pyx_t_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 85; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; /* "pygame_sdl2/key.pyx":88 * return SDL_GetKeyName(key) * * text_input = False # <<<<<<<<<<<<<< * * def start_text_input(): */ if (PyDict_SetItem(__pyx_d, __pyx_n_s_text_input, Py_False) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 88; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "pygame_sdl2/key.pyx":90 * text_input = False * * def start_text_input(): # <<<<<<<<<<<<<< * global text_input * text_input = True */ __pyx_t_4 = PyCFunction_NewEx(&__pyx_mdef_11pygame_sdl2_3key_15start_text_input, NULL, __pyx_n_s_pygame_sdl2_key); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 90; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); if (PyDict_SetItem(__pyx_d, __pyx_n_s_start_text_input, __pyx_t_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 90; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; /* "pygame_sdl2/key.pyx":97 * SDL_StartTextInput() * * def stop_text_input(): # <<<<<<<<<<<<<< * global text_input * text_input = False */ __pyx_t_4 = PyCFunction_NewEx(&__pyx_mdef_11pygame_sdl2_3key_17stop_text_input, NULL, __pyx_n_s_pygame_sdl2_key); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 97; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); if (PyDict_SetItem(__pyx_d, __pyx_n_s_stop_text_input, __pyx_t_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 97; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; /* "pygame_sdl2/key.pyx":104 * SDL_StopTextInput() * * def set_text_input_rect(rect): # <<<<<<<<<<<<<< * cdef SDL_Rect sdl_rect; * */ __pyx_t_4 = PyCFunction_NewEx(&__pyx_mdef_11pygame_sdl2_3key_19set_text_input_rect, NULL, __pyx_n_s_pygame_sdl2_key); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 104; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); if (PyDict_SetItem(__pyx_d, __pyx_n_s_set_text_input_rect, __pyx_t_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 104; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; /* "pygame_sdl2/key.pyx":113 * SDL_SetTextInputRect(NULL) * * def has_screen_keyboard_support(): # <<<<<<<<<<<<<< * return SDL_HasScreenKeyboardSupport() * */ __pyx_t_4 = PyCFunction_NewEx(&__pyx_mdef_11pygame_sdl2_3key_21has_screen_keyboard_support, NULL, __pyx_n_s_pygame_sdl2_key); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 113; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); if (PyDict_SetItem(__pyx_d, __pyx_n_s_has_screen_keyboard_support, __pyx_t_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 113; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; /* "pygame_sdl2/key.pyx":116 * return SDL_HasScreenKeyboardSupport() * * def is_screen_keyboard_shown(Window window=None): # <<<<<<<<<<<<<< * if window is None: * window = main_window */ __pyx_t_4 = PyCFunction_NewEx(&__pyx_mdef_11pygame_sdl2_3key_23is_screen_keyboard_shown, NULL, __pyx_n_s_pygame_sdl2_key); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 116; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); if (PyDict_SetItem(__pyx_d, __pyx_n_s_is_screen_keyboard_shown, __pyx_t_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 116; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; /* "pygame_sdl2/key.pyx":1 * # Copyright 2014 Patrick Dawson # <<<<<<<<<<<<<< * # * # This software is provided 'as-is', without any express or implied */ __pyx_t_4 = PyDict_New(); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); if (PyDict_SetItem(__pyx_d, __pyx_n_s_test, __pyx_t_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; /*--- Wrapped vars code ---*/ goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); if (__pyx_m) { if (__pyx_d) { __Pyx_AddTraceback("init pygame_sdl2.key", __pyx_clineno, __pyx_lineno, __pyx_filename); } Py_DECREF(__pyx_m); __pyx_m = 0; } else if (!PyErr_Occurred()) { PyErr_SetString(PyExc_ImportError, "init pygame_sdl2.key"); } __pyx_L0:; __Pyx_RefNannyFinishContext(); #if PY_MAJOR_VERSION < 3 return; #else return __pyx_m; #endif } /* --- Runtime support code --- */ #if CYTHON_REFNANNY static __Pyx_RefNannyAPIStruct *__Pyx_RefNannyImportAPI(const char *modname) { PyObject *m = NULL, *p = NULL; void *r = NULL; m = PyImport_ImportModule((char *)modname); if (!m) goto end; p = PyObject_GetAttrString(m, (char *)"RefNannyAPI"); if (!p) goto end; r = PyLong_AsVoidPtr(p); end: Py_XDECREF(p); Py_XDECREF(m); return (__Pyx_RefNannyAPIStruct *)r; } #endif static PyObject *__Pyx_GetBuiltinName(PyObject *name) { PyObject* result = __Pyx_PyObject_GetAttrStr(__pyx_b, name); if (unlikely(!result)) { PyErr_Format(PyExc_NameError, #if PY_MAJOR_VERSION >= 3 "name '%U' is not defined", name); #else "name '%.200s' is not defined", PyString_AS_STRING(name)); #endif } return result; } static void __Pyx_RaiseArgtupleInvalid( const char* func_name, int exact, Py_ssize_t num_min, Py_ssize_t num_max, Py_ssize_t num_found) { Py_ssize_t num_expected; const char *more_or_less; if (num_found < num_min) { num_expected = num_min; more_or_less = "at least"; } else { num_expected = num_max; more_or_less = "at most"; } if (exact) { more_or_less = "exactly"; } PyErr_Format(PyExc_TypeError, "%.200s() takes %.8s %" CYTHON_FORMAT_SSIZE_T "d positional argument%.1s (%" CYTHON_FORMAT_SSIZE_T "d given)", func_name, more_or_less, num_expected, (num_expected == 1) ? "" : "s", num_found); } static CYTHON_INLINE int __Pyx_CheckKeywordStrings( PyObject *kwdict, const char* function_name, int kw_allowed) { PyObject* key = 0; Py_ssize_t pos = 0; #if CYTHON_COMPILING_IN_PYPY if (!kw_allowed && PyDict_Next(kwdict, &pos, &key, 0)) goto invalid_keyword; return 1; #else while (PyDict_Next(kwdict, &pos, &key, 0)) { #if PY_MAJOR_VERSION < 3 if (unlikely(!PyString_CheckExact(key)) && unlikely(!PyString_Check(key))) #endif if (unlikely(!PyUnicode_Check(key))) goto invalid_keyword_type; } if ((!kw_allowed) && unlikely(key)) goto invalid_keyword; return 1; invalid_keyword_type: PyErr_Format(PyExc_TypeError, "%.200s() keywords must be strings", function_name); return 0; #endif invalid_keyword: PyErr_Format(PyExc_TypeError, #if PY_MAJOR_VERSION < 3 "%.200s() got an unexpected keyword argument '%.200s'", function_name, PyString_AsString(key)); #else "%s() got an unexpected keyword argument '%U'", function_name, key); #endif return 0; } static CYTHON_INLINE PyObject *__Pyx_GetModuleGlobalName(PyObject *name) { PyObject *result; #if CYTHON_COMPILING_IN_CPYTHON result = PyDict_GetItem(__pyx_d, name); if (likely(result)) { Py_INCREF(result); } else { #else result = PyObject_GetItem(__pyx_d, name); if (!result) { PyErr_Clear(); #endif result = __Pyx_GetBuiltinName(name); } return result; } #if CYTHON_COMPILING_IN_CPYTHON static CYTHON_INLINE PyObject* __Pyx_PyObject_Call(PyObject *func, PyObject *arg, PyObject *kw) { PyObject *result; ternaryfunc call = func->ob_type->tp_call; if (unlikely(!call)) return PyObject_Call(func, arg, kw); if (unlikely(Py_EnterRecursiveCall((char*)" while calling a Python object"))) return NULL; result = (*call)(func, arg, kw); Py_LeaveRecursiveCall(); if (unlikely(!result) && unlikely(!PyErr_Occurred())) { PyErr_SetString( PyExc_SystemError, "NULL result without error in PyObject_Call"); } return result; } #endif #if CYTHON_COMPILING_IN_CPYTHON static CYTHON_INLINE PyObject* __Pyx_PyObject_CallMethO(PyObject *func, PyObject *arg) { PyObject *self, *result; PyCFunction cfunc; cfunc = PyCFunction_GET_FUNCTION(func); self = PyCFunction_GET_SELF(func); if (unlikely(Py_EnterRecursiveCall((char*)" while calling a Python object"))) return NULL; result = cfunc(self, arg); Py_LeaveRecursiveCall(); if (unlikely(!result) && unlikely(!PyErr_Occurred())) { PyErr_SetString( PyExc_SystemError, "NULL result without error in PyObject_Call"); } return result; } #endif #if CYTHON_COMPILING_IN_CPYTHON static PyObject* __Pyx__PyObject_CallOneArg(PyObject *func, PyObject *arg) { PyObject *result; PyObject *args = PyTuple_New(1); if (unlikely(!args)) return NULL; Py_INCREF(arg); PyTuple_SET_ITEM(args, 0, arg); result = __Pyx_PyObject_Call(func, args, NULL); Py_DECREF(args); return result; } static CYTHON_INLINE PyObject* __Pyx_PyObject_CallOneArg(PyObject *func, PyObject *arg) { #ifdef __Pyx_CyFunction_USED if (likely(PyCFunction_Check(func) || PyObject_TypeCheck(func, __pyx_CyFunctionType))) { #else if (likely(PyCFunction_Check(func))) { #endif if (likely(PyCFunction_GET_FLAGS(func) & METH_O)) { return __Pyx_PyObject_CallMethO(func, arg); } } return __Pyx__PyObject_CallOneArg(func, arg); } #else static CYTHON_INLINE PyObject* __Pyx_PyObject_CallOneArg(PyObject *func, PyObject *arg) { PyObject *result; PyObject *args = PyTuple_Pack(1, arg); if (unlikely(!args)) return NULL; result = __Pyx_PyObject_Call(func, args, NULL); Py_DECREF(args); return result; } #endif #if CYTHON_COMPILING_IN_CPYTHON static CYTHON_INLINE PyObject* __Pyx_PyObject_CallNoArg(PyObject *func) { #ifdef __Pyx_CyFunction_USED if (likely(PyCFunction_Check(func) || PyObject_TypeCheck(func, __pyx_CyFunctionType))) { #else if (likely(PyCFunction_Check(func))) { #endif if (likely(PyCFunction_GET_FLAGS(func) & METH_NOARGS)) { return __Pyx_PyObject_CallMethO(func, NULL); } } return __Pyx_PyObject_Call(func, __pyx_empty_tuple, NULL); } #endif static CYTHON_INLINE void __Pyx_ErrRestore(PyObject *type, PyObject *value, PyObject *tb) { #if CYTHON_COMPILING_IN_CPYTHON PyObject *tmp_type, *tmp_value, *tmp_tb; PyThreadState *tstate = PyThreadState_GET(); tmp_type = tstate->curexc_type; tmp_value = tstate->curexc_value; tmp_tb = tstate->curexc_traceback; tstate->curexc_type = type; tstate->curexc_value = value; tstate->curexc_traceback = tb; Py_XDECREF(tmp_type); Py_XDECREF(tmp_value); Py_XDECREF(tmp_tb); #else PyErr_Restore(type, value, tb); #endif } static CYTHON_INLINE void __Pyx_ErrFetch(PyObject **type, PyObject **value, PyObject **tb) { #if CYTHON_COMPILING_IN_CPYTHON PyThreadState *tstate = PyThreadState_GET(); *type = tstate->curexc_type; *value = tstate->curexc_value; *tb = tstate->curexc_traceback; tstate->curexc_type = 0; tstate->curexc_value = 0; tstate->curexc_traceback = 0; #else PyErr_Fetch(type, value, tb); #endif } #if PY_MAJOR_VERSION < 3 static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, CYTHON_UNUSED PyObject *cause) { Py_XINCREF(type); if (!value || value == Py_None) value = NULL; else Py_INCREF(value); if (!tb || tb == Py_None) tb = NULL; else { Py_INCREF(tb); if (!PyTraceBack_Check(tb)) { PyErr_SetString(PyExc_TypeError, "raise: arg 3 must be a traceback or None"); goto raise_error; } } if (PyType_Check(type)) { #if CYTHON_COMPILING_IN_PYPY if (!value) { Py_INCREF(Py_None); value = Py_None; } #endif PyErr_NormalizeException(&type, &value, &tb); } else { if (value) { PyErr_SetString(PyExc_TypeError, "instance exception may not have a separate value"); goto raise_error; } value = type; type = (PyObject*) Py_TYPE(type); Py_INCREF(type); if (!PyType_IsSubtype((PyTypeObject *)type, (PyTypeObject *)PyExc_BaseException)) { PyErr_SetString(PyExc_TypeError, "raise: exception class must be a subclass of BaseException"); goto raise_error; } } __Pyx_ErrRestore(type, value, tb); return; raise_error: Py_XDECREF(value); Py_XDECREF(type); Py_XDECREF(tb); return; } #else static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, PyObject *cause) { PyObject* owned_instance = NULL; if (tb == Py_None) { tb = 0; } else if (tb && !PyTraceBack_Check(tb)) { PyErr_SetString(PyExc_TypeError, "raise: arg 3 must be a traceback or None"); goto bad; } if (value == Py_None) value = 0; if (PyExceptionInstance_Check(type)) { if (value) { PyErr_SetString(PyExc_TypeError, "instance exception may not have a separate value"); goto bad; } value = type; type = (PyObject*) Py_TYPE(value); } else if (PyExceptionClass_Check(type)) { PyObject *instance_class = NULL; if (value && PyExceptionInstance_Check(value)) { instance_class = (PyObject*) Py_TYPE(value); if (instance_class != type) { int is_subclass = PyObject_IsSubclass(instance_class, type); if (!is_subclass) { instance_class = NULL; } else if (unlikely(is_subclass == -1)) { goto bad; } else { type = instance_class; } } } if (!instance_class) { PyObject *args; if (!value) args = PyTuple_New(0); else if (PyTuple_Check(value)) { Py_INCREF(value); args = value; } else args = PyTuple_Pack(1, value); if (!args) goto bad; owned_instance = PyObject_Call(type, args, NULL); Py_DECREF(args); if (!owned_instance) goto bad; value = owned_instance; if (!PyExceptionInstance_Check(value)) { PyErr_Format(PyExc_TypeError, "calling %R should have returned an instance of " "BaseException, not %R", type, Py_TYPE(value)); goto bad; } } } else { PyErr_SetString(PyExc_TypeError, "raise: exception class must be a subclass of BaseException"); goto bad; } #if PY_VERSION_HEX >= 0x03030000 if (cause) { #else if (cause && cause != Py_None) { #endif PyObject *fixed_cause; if (cause == Py_None) { fixed_cause = NULL; } else if (PyExceptionClass_Check(cause)) { fixed_cause = PyObject_CallObject(cause, NULL); if (fixed_cause == NULL) goto bad; } else if (PyExceptionInstance_Check(cause)) { fixed_cause = cause; Py_INCREF(fixed_cause); } else { PyErr_SetString(PyExc_TypeError, "exception causes must derive from " "BaseException"); goto bad; } PyException_SetCause(value, fixed_cause); } PyErr_SetObject(type, value); if (tb) { #if CYTHON_COMPILING_IN_PYPY PyObject *tmp_type, *tmp_value, *tmp_tb; PyErr_Fetch(&tmp_type, &tmp_value, &tmp_tb); Py_INCREF(tb); PyErr_Restore(tmp_type, tmp_value, tb); Py_XDECREF(tmp_tb); #else PyThreadState *tstate = PyThreadState_GET(); PyObject* tmp_tb = tstate->curexc_traceback; if (tb != tmp_tb) { Py_INCREF(tb); tstate->curexc_traceback = tb; Py_XDECREF(tmp_tb); } #endif } bad: Py_XDECREF(owned_instance); return; } #endif static void __Pyx_RaiseDoubleKeywordsError( const char* func_name, PyObject* kw_name) { PyErr_Format(PyExc_TypeError, #if PY_MAJOR_VERSION >= 3 "%s() got multiple values for keyword argument '%U'", func_name, kw_name); #else "%s() got multiple values for keyword argument '%s'", func_name, PyString_AsString(kw_name)); #endif } static int __Pyx_ParseOptionalKeywords( PyObject *kwds, PyObject **argnames[], PyObject *kwds2, PyObject *values[], Py_ssize_t num_pos_args, const char* function_name) { PyObject *key = 0, *value = 0; Py_ssize_t pos = 0; PyObject*** name; PyObject*** first_kw_arg = argnames + num_pos_args; while (PyDict_Next(kwds, &pos, &key, &value)) { name = first_kw_arg; while (*name && (**name != key)) name++; if (*name) { values[name-argnames] = value; continue; } name = first_kw_arg; #if PY_MAJOR_VERSION < 3 if (likely(PyString_CheckExact(key)) || likely(PyString_Check(key))) { while (*name) { if ((CYTHON_COMPILING_IN_PYPY || PyString_GET_SIZE(**name) == PyString_GET_SIZE(key)) && _PyString_Eq(**name, key)) { values[name-argnames] = value; break; } name++; } if (*name) continue; else { PyObject*** argname = argnames; while (argname != first_kw_arg) { if ((**argname == key) || ( (CYTHON_COMPILING_IN_PYPY || PyString_GET_SIZE(**argname) == PyString_GET_SIZE(key)) && _PyString_Eq(**argname, key))) { goto arg_passed_twice; } argname++; } } } else #endif if (likely(PyUnicode_Check(key))) { while (*name) { int cmp = (**name == key) ? 0 : #if !CYTHON_COMPILING_IN_PYPY && PY_MAJOR_VERSION >= 3 (PyUnicode_GET_SIZE(**name) != PyUnicode_GET_SIZE(key)) ? 1 : #endif PyUnicode_Compare(**name, key); if (cmp < 0 && unlikely(PyErr_Occurred())) goto bad; if (cmp == 0) { values[name-argnames] = value; break; } name++; } if (*name) continue; else { PyObject*** argname = argnames; while (argname != first_kw_arg) { int cmp = (**argname == key) ? 0 : #if !CYTHON_COMPILING_IN_PYPY && PY_MAJOR_VERSION >= 3 (PyUnicode_GET_SIZE(**argname) != PyUnicode_GET_SIZE(key)) ? 1 : #endif PyUnicode_Compare(**argname, key); if (cmp < 0 && unlikely(PyErr_Occurred())) goto bad; if (cmp == 0) goto arg_passed_twice; argname++; } } } else goto invalid_keyword_type; if (kwds2) { if (unlikely(PyDict_SetItem(kwds2, key, value))) goto bad; } else { goto invalid_keyword; } } return 0; arg_passed_twice: __Pyx_RaiseDoubleKeywordsError(function_name, key); goto bad; invalid_keyword_type: PyErr_Format(PyExc_TypeError, "%.200s() keywords must be strings", function_name); goto bad; invalid_keyword: PyErr_Format(PyExc_TypeError, #if PY_MAJOR_VERSION < 3 "%.200s() got an unexpected keyword argument '%.200s'", function_name, PyString_AsString(key)); #else "%s() got an unexpected keyword argument '%U'", function_name, key); #endif bad: return -1; } static void __Pyx_RaiseArgumentTypeInvalid(const char* name, PyObject *obj, PyTypeObject *type) { PyErr_Format(PyExc_TypeError, "Argument '%.200s' has incorrect type (expected %.200s, got %.200s)", name, type->tp_name, Py_TYPE(obj)->tp_name); } static CYTHON_INLINE int __Pyx_ArgTypeTest(PyObject *obj, PyTypeObject *type, int none_allowed, const char *name, int exact) { if (unlikely(!type)) { PyErr_SetString(PyExc_SystemError, "Missing type object"); return 0; } if (none_allowed && obj == Py_None) return 1; else if (exact) { if (likely(Py_TYPE(obj) == type)) return 1; #if PY_MAJOR_VERSION == 2 else if ((type == &PyBaseString_Type) && likely(__Pyx_PyBaseString_CheckExact(obj))) return 1; #endif } else { if (likely(PyObject_TypeCheck(obj, type))) return 1; } __Pyx_RaiseArgumentTypeInvalid(name, obj, type); return 0; } static void* __Pyx_GetVtable(PyObject *dict) { void* ptr; PyObject *ob = PyObject_GetItem(dict, __pyx_n_s_pyx_vtable); if (!ob) goto bad; #if PY_VERSION_HEX >= 0x02070000 ptr = PyCapsule_GetPointer(ob, 0); #else ptr = PyCObject_AsVoidPtr(ob); #endif if (!ptr && !PyErr_Occurred()) PyErr_SetString(PyExc_RuntimeError, "invalid vtable found for imported type"); Py_DECREF(ob); return ptr; bad: Py_XDECREF(ob); return NULL; } static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list, int level) { PyObject *empty_list = 0; PyObject *module = 0; PyObject *global_dict = 0; PyObject *empty_dict = 0; PyObject *list; #if PY_VERSION_HEX < 0x03030000 PyObject *py_import; py_import = __Pyx_PyObject_GetAttrStr(__pyx_b, __pyx_n_s_import); if (!py_import) goto bad; #endif if (from_list) list = from_list; else { empty_list = PyList_New(0); if (!empty_list) goto bad; list = empty_list; } global_dict = PyModule_GetDict(__pyx_m); if (!global_dict) goto bad; empty_dict = PyDict_New(); if (!empty_dict) goto bad; { #if PY_MAJOR_VERSION >= 3 if (level == -1) { if (strchr(__Pyx_MODULE_NAME, '.')) { #if PY_VERSION_HEX < 0x03030000 PyObject *py_level = PyInt_FromLong(1); if (!py_level) goto bad; module = PyObject_CallFunctionObjArgs(py_import, name, global_dict, empty_dict, list, py_level, NULL); Py_DECREF(py_level); #else module = PyImport_ImportModuleLevelObject( name, global_dict, empty_dict, list, 1); #endif if (!module) { if (!PyErr_ExceptionMatches(PyExc_ImportError)) goto bad; PyErr_Clear(); } } level = 0; } #endif if (!module) { #if PY_VERSION_HEX < 0x03030000 PyObject *py_level = PyInt_FromLong(level); if (!py_level) goto bad; module = PyObject_CallFunctionObjArgs(py_import, name, global_dict, empty_dict, list, py_level, NULL); Py_DECREF(py_level); #else module = PyImport_ImportModuleLevelObject( name, global_dict, empty_dict, list, level); #endif } } bad: #if PY_VERSION_HEX < 0x03030000 Py_XDECREF(py_import); #endif Py_XDECREF(empty_list); Py_XDECREF(empty_dict); return module; } static PyObject* __Pyx_ImportFrom(PyObject* module, PyObject* name) { PyObject* value = __Pyx_PyObject_GetAttrStr(module, name); if (unlikely(!value) && PyErr_ExceptionMatches(PyExc_AttributeError)) { PyErr_Format(PyExc_ImportError, #if PY_MAJOR_VERSION < 3 "cannot import name %.230s", PyString_AS_STRING(name)); #else "cannot import name %S", name); #endif } return value; } static int __pyx_bisect_code_objects(__Pyx_CodeObjectCacheEntry* entries, int count, int code_line) { int start = 0, mid = 0, end = count - 1; if (end >= 0 && code_line > entries[end].code_line) { return count; } while (start < end) { mid = start + (end - start) / 2; if (code_line < entries[mid].code_line) { end = mid; } else if (code_line > entries[mid].code_line) { start = mid + 1; } else { return mid; } } if (code_line <= entries[mid].code_line) { return mid; } else { return mid + 1; } } static PyCodeObject *__pyx_find_code_object(int code_line) { PyCodeObject* code_object; int pos; if (unlikely(!code_line) || unlikely(!__pyx_code_cache.entries)) { return NULL; } pos = __pyx_bisect_code_objects(__pyx_code_cache.entries, __pyx_code_cache.count, code_line); if (unlikely(pos >= __pyx_code_cache.count) || unlikely(__pyx_code_cache.entries[pos].code_line != code_line)) { return NULL; } code_object = __pyx_code_cache.entries[pos].code_object; Py_INCREF(code_object); return code_object; } static void __pyx_insert_code_object(int code_line, PyCodeObject* code_object) { int pos, i; __Pyx_CodeObjectCacheEntry* entries = __pyx_code_cache.entries; if (unlikely(!code_line)) { return; } if (unlikely(!entries)) { entries = (__Pyx_CodeObjectCacheEntry*)PyMem_Malloc(64*sizeof(__Pyx_CodeObjectCacheEntry)); if (likely(entries)) { __pyx_code_cache.entries = entries; __pyx_code_cache.max_count = 64; __pyx_code_cache.count = 1; entries[0].code_line = code_line; entries[0].code_object = code_object; Py_INCREF(code_object); } return; } pos = __pyx_bisect_code_objects(__pyx_code_cache.entries, __pyx_code_cache.count, code_line); if ((pos < __pyx_code_cache.count) && unlikely(__pyx_code_cache.entries[pos].code_line == code_line)) { PyCodeObject* tmp = entries[pos].code_object; entries[pos].code_object = code_object; Py_DECREF(tmp); return; } if (__pyx_code_cache.count == __pyx_code_cache.max_count) { int new_max = __pyx_code_cache.max_count + 64; entries = (__Pyx_CodeObjectCacheEntry*)PyMem_Realloc( __pyx_code_cache.entries, (size_t)new_max*sizeof(__Pyx_CodeObjectCacheEntry)); if (unlikely(!entries)) { return; } __pyx_code_cache.entries = entries; __pyx_code_cache.max_count = new_max; } for (i=__pyx_code_cache.count; i>pos; i--) { entries[i] = entries[i-1]; } entries[pos].code_line = code_line; entries[pos].code_object = code_object; __pyx_code_cache.count++; Py_INCREF(code_object); } #include "compile.h" #include "frameobject.h" #include "traceback.h" static PyCodeObject* __Pyx_CreateCodeObjectForTraceback( const char *funcname, int c_line, int py_line, const char *filename) { PyCodeObject *py_code = 0; PyObject *py_srcfile = 0; PyObject *py_funcname = 0; #if PY_MAJOR_VERSION < 3 py_srcfile = PyString_FromString(filename); #else py_srcfile = PyUnicode_FromString(filename); #endif if (!py_srcfile) goto bad; if (c_line) { #if PY_MAJOR_VERSION < 3 py_funcname = PyString_FromFormat( "%s (%s:%d)", funcname, __pyx_cfilenm, c_line); #else py_funcname = PyUnicode_FromFormat( "%s (%s:%d)", funcname, __pyx_cfilenm, c_line); #endif } else { #if PY_MAJOR_VERSION < 3 py_funcname = PyString_FromString(funcname); #else py_funcname = PyUnicode_FromString(funcname); #endif } if (!py_funcname) goto bad; py_code = __Pyx_PyCode_New( 0, 0, 0, 0, 0, __pyx_empty_bytes, /*PyObject *code,*/ __pyx_empty_tuple, /*PyObject *consts,*/ __pyx_empty_tuple, /*PyObject *names,*/ __pyx_empty_tuple, /*PyObject *varnames,*/ __pyx_empty_tuple, /*PyObject *freevars,*/ __pyx_empty_tuple, /*PyObject *cellvars,*/ py_srcfile, /*PyObject *filename,*/ py_funcname, /*PyObject *name,*/ py_line, __pyx_empty_bytes /*PyObject *lnotab*/ ); Py_DECREF(py_srcfile); Py_DECREF(py_funcname); return py_code; bad: Py_XDECREF(py_srcfile); Py_XDECREF(py_funcname); return NULL; } static void __Pyx_AddTraceback(const char *funcname, int c_line, int py_line, const char *filename) { PyCodeObject *py_code = 0; PyFrameObject *py_frame = 0; py_code = __pyx_find_code_object(c_line ? c_line : py_line); if (!py_code) { py_code = __Pyx_CreateCodeObjectForTraceback( funcname, c_line, py_line, filename); if (!py_code) goto bad; __pyx_insert_code_object(c_line ? c_line : py_line, py_code); } py_frame = PyFrame_New( PyThreadState_GET(), /*PyThreadState *tstate,*/ py_code, /*PyCodeObject *code,*/ __pyx_d, /*PyObject *globals,*/ 0 /*PyObject *locals*/ ); if (!py_frame) goto bad; py_frame->f_lineno = py_line; PyTraceBack_Here(py_frame); bad: Py_XDECREF(py_code); Py_XDECREF(py_frame); } #define __PYX_VERIFY_RETURN_INT(target_type, func_type, func_value)\ __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, 0) #define __PYX_VERIFY_RETURN_INT_EXC(target_type, func_type, func_value)\ __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, 1) #define __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, exc)\ {\ func_type value = func_value;\ if (sizeof(target_type) < sizeof(func_type)) {\ if (unlikely(value != (func_type) (target_type) value)) {\ func_type zero = 0;\ if (exc && unlikely(value == (func_type)-1 && PyErr_Occurred()))\ return (target_type) -1;\ if (is_unsigned && unlikely(value < zero))\ goto raise_neg_overflow;\ else\ goto raise_overflow;\ }\ }\ return (target_type) value;\ } #if CYTHON_USE_PYLONG_INTERNALS #include "longintrepr.h" #endif static CYTHON_INLINE int __Pyx_PyInt_As_int(PyObject *x) { const int neg_one = (int) -1, const_zero = (int) 0; const int is_unsigned = neg_one > const_zero; #if PY_MAJOR_VERSION < 3 if (likely(PyInt_Check(x))) { if (sizeof(int) < sizeof(long)) { __PYX_VERIFY_RETURN_INT(int, long, PyInt_AS_LONG(x)) } else { long val = PyInt_AS_LONG(x); if (is_unsigned && unlikely(val < 0)) { goto raise_neg_overflow; } return (int) val; } } else #endif if (likely(PyLong_Check(x))) { if (is_unsigned) { #if CYTHON_USE_PYLONG_INTERNALS const digit* digits = ((PyLongObject*)x)->ob_digit; switch (Py_SIZE(x)) { case 0: return (int) 0; case 1: __PYX_VERIFY_RETURN_INT(int, digit, digits[0]) case 2: if (8 * sizeof(int) > 1 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(int) >= 2 * PyLong_SHIFT) { return (int) (((((int)digits[1]) << PyLong_SHIFT) | (int)digits[0])); } } break; case 3: if (8 * sizeof(int) > 2 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(int) >= 3 * PyLong_SHIFT) { return (int) (((((((int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0])); } } break; case 4: if (8 * sizeof(int) > 3 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(int) >= 4 * PyLong_SHIFT) { return (int) (((((((((int)digits[3]) << PyLong_SHIFT) | (int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0])); } } break; } #endif #if CYTHON_COMPILING_IN_CPYTHON if (unlikely(Py_SIZE(x) < 0)) { goto raise_neg_overflow; } #else { int result = PyObject_RichCompareBool(x, Py_False, Py_LT); if (unlikely(result < 0)) return (int) -1; if (unlikely(result == 1)) goto raise_neg_overflow; } #endif if (sizeof(int) <= sizeof(unsigned long)) { __PYX_VERIFY_RETURN_INT_EXC(int, unsigned long, PyLong_AsUnsignedLong(x)) } else if (sizeof(int) <= sizeof(unsigned PY_LONG_LONG)) { __PYX_VERIFY_RETURN_INT_EXC(int, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x)) } } else { #if CYTHON_USE_PYLONG_INTERNALS const digit* digits = ((PyLongObject*)x)->ob_digit; switch (Py_SIZE(x)) { case 0: return (int) 0; case -1: __PYX_VERIFY_RETURN_INT(int, sdigit, -(sdigit) digits[0]) case 1: __PYX_VERIFY_RETURN_INT(int, digit, +digits[0]) case -2: if (8 * sizeof(int) - 1 > 1 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(int, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(int) - 1 > 2 * PyLong_SHIFT) { return (int) (((int)-1)*(((((int)digits[1]) << PyLong_SHIFT) | (int)digits[0]))); } } break; case 2: if (8 * sizeof(int) > 1 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(int) - 1 > 2 * PyLong_SHIFT) { return (int) ((((((int)digits[1]) << PyLong_SHIFT) | (int)digits[0]))); } } break; case -3: if (8 * sizeof(int) - 1 > 2 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(int, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(int) - 1 > 3 * PyLong_SHIFT) { return (int) (((int)-1)*(((((((int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0]))); } } break; case 3: if (8 * sizeof(int) > 2 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(int) - 1 > 3 * PyLong_SHIFT) { return (int) ((((((((int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0]))); } } break; case -4: if (8 * sizeof(int) - 1 > 3 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(int, long, -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(int) - 1 > 4 * PyLong_SHIFT) { return (int) (((int)-1)*(((((((((int)digits[3]) << PyLong_SHIFT) | (int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0]))); } } break; case 4: if (8 * sizeof(int) > 3 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(int) - 1 > 4 * PyLong_SHIFT) { return (int) ((((((((((int)digits[3]) << PyLong_SHIFT) | (int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0]))); } } break; } #endif if (sizeof(int) <= sizeof(long)) { __PYX_VERIFY_RETURN_INT_EXC(int, long, PyLong_AsLong(x)) } else if (sizeof(int) <= sizeof(PY_LONG_LONG)) { __PYX_VERIFY_RETURN_INT_EXC(int, PY_LONG_LONG, PyLong_AsLongLong(x)) } } { #if CYTHON_COMPILING_IN_PYPY && !defined(_PyLong_AsByteArray) PyErr_SetString(PyExc_RuntimeError, "_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers"); #else int val; PyObject *v = __Pyx_PyNumber_Int(x); #if PY_MAJOR_VERSION < 3 if (likely(v) && !PyLong_Check(v)) { PyObject *tmp = v; v = PyNumber_Long(tmp); Py_DECREF(tmp); } #endif if (likely(v)) { int one = 1; int is_little = (int)*(unsigned char *)&one; unsigned char *bytes = (unsigned char *)&val; int ret = _PyLong_AsByteArray((PyLongObject *)v, bytes, sizeof(val), is_little, !is_unsigned); Py_DECREF(v); if (likely(!ret)) return val; } #endif return (int) -1; } } else { int val; PyObject *tmp = __Pyx_PyNumber_Int(x); if (!tmp) return (int) -1; val = __Pyx_PyInt_As_int(tmp); Py_DECREF(tmp); return val; } raise_overflow: PyErr_SetString(PyExc_OverflowError, "value too large to convert to int"); return (int) -1; raise_neg_overflow: PyErr_SetString(PyExc_OverflowError, "can't convert negative value to int"); return (int) -1; } static CYTHON_INLINE PyObject* __Pyx_PyInt_From_uint8_t(uint8_t value) { const uint8_t neg_one = (uint8_t) -1, const_zero = (uint8_t) 0; const int is_unsigned = neg_one > const_zero; if (is_unsigned) { if (sizeof(uint8_t) < sizeof(long)) { return PyInt_FromLong((long) value); } else if (sizeof(uint8_t) <= sizeof(unsigned long)) { return PyLong_FromUnsignedLong((unsigned long) value); } else if (sizeof(uint8_t) <= sizeof(unsigned PY_LONG_LONG)) { return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value); } } else { if (sizeof(uint8_t) <= sizeof(long)) { return PyInt_FromLong((long) value); } else if (sizeof(uint8_t) <= sizeof(PY_LONG_LONG)) { return PyLong_FromLongLong((PY_LONG_LONG) value); } } { int one = 1; int little = (int)*(unsigned char *)&one; unsigned char *bytes = (unsigned char *)&value; return _PyLong_FromByteArray(bytes, sizeof(uint8_t), little, !is_unsigned); } } static CYTHON_INLINE PyObject* __Pyx_PyInt_From_SDL_Keymod(SDL_Keymod value) { const SDL_Keymod neg_one = (SDL_Keymod) -1, const_zero = (SDL_Keymod) 0; const int is_unsigned = neg_one > const_zero; if (is_unsigned) { if (sizeof(SDL_Keymod) < sizeof(long)) { return PyInt_FromLong((long) value); } else if (sizeof(SDL_Keymod) <= sizeof(unsigned long)) { return PyLong_FromUnsignedLong((unsigned long) value); } else if (sizeof(SDL_Keymod) <= sizeof(unsigned PY_LONG_LONG)) { return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value); } } else { if (sizeof(SDL_Keymod) <= sizeof(long)) { return PyInt_FromLong((long) value); } else if (sizeof(SDL_Keymod) <= sizeof(PY_LONG_LONG)) { return PyLong_FromLongLong((PY_LONG_LONG) value); } } { int one = 1; int little = (int)*(unsigned char *)&one; unsigned char *bytes = (unsigned char *)&value; return _PyLong_FromByteArray(bytes, sizeof(SDL_Keymod), little, !is_unsigned); } } static CYTHON_INLINE SDL_Keymod __Pyx_PyInt_As_SDL_Keymod(PyObject *x) { const SDL_Keymod neg_one = (SDL_Keymod) -1, const_zero = (SDL_Keymod) 0; const int is_unsigned = neg_one > const_zero; #if PY_MAJOR_VERSION < 3 if (likely(PyInt_Check(x))) { if (sizeof(SDL_Keymod) < sizeof(long)) { __PYX_VERIFY_RETURN_INT(SDL_Keymod, long, PyInt_AS_LONG(x)) } else { long val = PyInt_AS_LONG(x); if (is_unsigned && unlikely(val < 0)) { goto raise_neg_overflow; } return (SDL_Keymod) val; } } else #endif if (likely(PyLong_Check(x))) { if (is_unsigned) { #if CYTHON_USE_PYLONG_INTERNALS const digit* digits = ((PyLongObject*)x)->ob_digit; switch (Py_SIZE(x)) { case 0: return (SDL_Keymod) 0; case 1: __PYX_VERIFY_RETURN_INT(SDL_Keymod, digit, digits[0]) case 2: if (8 * sizeof(SDL_Keymod) > 1 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(SDL_Keymod, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(SDL_Keymod) >= 2 * PyLong_SHIFT) { return (SDL_Keymod) (((((SDL_Keymod)digits[1]) << PyLong_SHIFT) | (SDL_Keymod)digits[0])); } } break; case 3: if (8 * sizeof(SDL_Keymod) > 2 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(SDL_Keymod, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(SDL_Keymod) >= 3 * PyLong_SHIFT) { return (SDL_Keymod) (((((((SDL_Keymod)digits[2]) << PyLong_SHIFT) | (SDL_Keymod)digits[1]) << PyLong_SHIFT) | (SDL_Keymod)digits[0])); } } break; case 4: if (8 * sizeof(SDL_Keymod) > 3 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(SDL_Keymod, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(SDL_Keymod) >= 4 * PyLong_SHIFT) { return (SDL_Keymod) (((((((((SDL_Keymod)digits[3]) << PyLong_SHIFT) | (SDL_Keymod)digits[2]) << PyLong_SHIFT) | (SDL_Keymod)digits[1]) << PyLong_SHIFT) | (SDL_Keymod)digits[0])); } } break; } #endif #if CYTHON_COMPILING_IN_CPYTHON if (unlikely(Py_SIZE(x) < 0)) { goto raise_neg_overflow; } #else { int result = PyObject_RichCompareBool(x, Py_False, Py_LT); if (unlikely(result < 0)) return (SDL_Keymod) -1; if (unlikely(result == 1)) goto raise_neg_overflow; } #endif if (sizeof(SDL_Keymod) <= sizeof(unsigned long)) { __PYX_VERIFY_RETURN_INT_EXC(SDL_Keymod, unsigned long, PyLong_AsUnsignedLong(x)) } else if (sizeof(SDL_Keymod) <= sizeof(unsigned PY_LONG_LONG)) { __PYX_VERIFY_RETURN_INT_EXC(SDL_Keymod, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x)) } } else { #if CYTHON_USE_PYLONG_INTERNALS const digit* digits = ((PyLongObject*)x)->ob_digit; switch (Py_SIZE(x)) { case 0: return (SDL_Keymod) 0; case -1: __PYX_VERIFY_RETURN_INT(SDL_Keymod, sdigit, -(sdigit) digits[0]) case 1: __PYX_VERIFY_RETURN_INT(SDL_Keymod, digit, +digits[0]) case -2: if (8 * sizeof(SDL_Keymod) - 1 > 1 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(SDL_Keymod, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(SDL_Keymod) - 1 > 2 * PyLong_SHIFT) { return (SDL_Keymod) (((SDL_Keymod)-1)*(((((SDL_Keymod)digits[1]) << PyLong_SHIFT) | (SDL_Keymod)digits[0]))); } } break; case 2: if (8 * sizeof(SDL_Keymod) > 1 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(SDL_Keymod, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(SDL_Keymod) - 1 > 2 * PyLong_SHIFT) { return (SDL_Keymod) ((((((SDL_Keymod)digits[1]) << PyLong_SHIFT) | (SDL_Keymod)digits[0]))); } } break; case -3: if (8 * sizeof(SDL_Keymod) - 1 > 2 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(SDL_Keymod, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(SDL_Keymod) - 1 > 3 * PyLong_SHIFT) { return (SDL_Keymod) (((SDL_Keymod)-1)*(((((((SDL_Keymod)digits[2]) << PyLong_SHIFT) | (SDL_Keymod)digits[1]) << PyLong_SHIFT) | (SDL_Keymod)digits[0]))); } } break; case 3: if (8 * sizeof(SDL_Keymod) > 2 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(SDL_Keymod, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(SDL_Keymod) - 1 > 3 * PyLong_SHIFT) { return (SDL_Keymod) ((((((((SDL_Keymod)digits[2]) << PyLong_SHIFT) | (SDL_Keymod)digits[1]) << PyLong_SHIFT) | (SDL_Keymod)digits[0]))); } } break; case -4: if (8 * sizeof(SDL_Keymod) - 1 > 3 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(SDL_Keymod, long, -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(SDL_Keymod) - 1 > 4 * PyLong_SHIFT) { return (SDL_Keymod) (((SDL_Keymod)-1)*(((((((((SDL_Keymod)digits[3]) << PyLong_SHIFT) | (SDL_Keymod)digits[2]) << PyLong_SHIFT) | (SDL_Keymod)digits[1]) << PyLong_SHIFT) | (SDL_Keymod)digits[0]))); } } break; case 4: if (8 * sizeof(SDL_Keymod) > 3 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(SDL_Keymod, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(SDL_Keymod) - 1 > 4 * PyLong_SHIFT) { return (SDL_Keymod) ((((((((((SDL_Keymod)digits[3]) << PyLong_SHIFT) | (SDL_Keymod)digits[2]) << PyLong_SHIFT) | (SDL_Keymod)digits[1]) << PyLong_SHIFT) | (SDL_Keymod)digits[0]))); } } break; } #endif if (sizeof(SDL_Keymod) <= sizeof(long)) { __PYX_VERIFY_RETURN_INT_EXC(SDL_Keymod, long, PyLong_AsLong(x)) } else if (sizeof(SDL_Keymod) <= sizeof(PY_LONG_LONG)) { __PYX_VERIFY_RETURN_INT_EXC(SDL_Keymod, PY_LONG_LONG, PyLong_AsLongLong(x)) } } { #if CYTHON_COMPILING_IN_PYPY && !defined(_PyLong_AsByteArray) PyErr_SetString(PyExc_RuntimeError, "_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers"); #else SDL_Keymod val; PyObject *v = __Pyx_PyNumber_Int(x); #if PY_MAJOR_VERSION < 3 if (likely(v) && !PyLong_Check(v)) { PyObject *tmp = v; v = PyNumber_Long(tmp); Py_DECREF(tmp); } #endif if (likely(v)) { int one = 1; int is_little = (int)*(unsigned char *)&one; unsigned char *bytes = (unsigned char *)&val; int ret = _PyLong_AsByteArray((PyLongObject *)v, bytes, sizeof(val), is_little, !is_unsigned); Py_DECREF(v); if (likely(!ret)) return val; } #endif return (SDL_Keymod) -1; } } else { SDL_Keymod val; PyObject *tmp = __Pyx_PyNumber_Int(x); if (!tmp) return (SDL_Keymod) -1; val = __Pyx_PyInt_As_SDL_Keymod(tmp); Py_DECREF(tmp); return val; } raise_overflow: PyErr_SetString(PyExc_OverflowError, "value too large to convert to SDL_Keymod"); return (SDL_Keymod) -1; raise_neg_overflow: PyErr_SetString(PyExc_OverflowError, "can't convert negative value to SDL_Keymod"); return (SDL_Keymod) -1; } static CYTHON_INLINE int32_t __Pyx_PyInt_As_int32_t(PyObject *x) { const int32_t neg_one = (int32_t) -1, const_zero = (int32_t) 0; const int is_unsigned = neg_one > const_zero; #if PY_MAJOR_VERSION < 3 if (likely(PyInt_Check(x))) { if (sizeof(int32_t) < sizeof(long)) { __PYX_VERIFY_RETURN_INT(int32_t, long, PyInt_AS_LONG(x)) } else { long val = PyInt_AS_LONG(x); if (is_unsigned && unlikely(val < 0)) { goto raise_neg_overflow; } return (int32_t) val; } } else #endif if (likely(PyLong_Check(x))) { if (is_unsigned) { #if CYTHON_USE_PYLONG_INTERNALS const digit* digits = ((PyLongObject*)x)->ob_digit; switch (Py_SIZE(x)) { case 0: return (int32_t) 0; case 1: __PYX_VERIFY_RETURN_INT(int32_t, digit, digits[0]) case 2: if (8 * sizeof(int32_t) > 1 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(int32_t, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(int32_t) >= 2 * PyLong_SHIFT) { return (int32_t) (((((int32_t)digits[1]) << PyLong_SHIFT) | (int32_t)digits[0])); } } break; case 3: if (8 * sizeof(int32_t) > 2 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(int32_t, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(int32_t) >= 3 * PyLong_SHIFT) { return (int32_t) (((((((int32_t)digits[2]) << PyLong_SHIFT) | (int32_t)digits[1]) << PyLong_SHIFT) | (int32_t)digits[0])); } } break; case 4: if (8 * sizeof(int32_t) > 3 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(int32_t, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(int32_t) >= 4 * PyLong_SHIFT) { return (int32_t) (((((((((int32_t)digits[3]) << PyLong_SHIFT) | (int32_t)digits[2]) << PyLong_SHIFT) | (int32_t)digits[1]) << PyLong_SHIFT) | (int32_t)digits[0])); } } break; } #endif #if CYTHON_COMPILING_IN_CPYTHON if (unlikely(Py_SIZE(x) < 0)) { goto raise_neg_overflow; } #else { int result = PyObject_RichCompareBool(x, Py_False, Py_LT); if (unlikely(result < 0)) return (int32_t) -1; if (unlikely(result == 1)) goto raise_neg_overflow; } #endif if (sizeof(int32_t) <= sizeof(unsigned long)) { __PYX_VERIFY_RETURN_INT_EXC(int32_t, unsigned long, PyLong_AsUnsignedLong(x)) } else if (sizeof(int32_t) <= sizeof(unsigned PY_LONG_LONG)) { __PYX_VERIFY_RETURN_INT_EXC(int32_t, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x)) } } else { #if CYTHON_USE_PYLONG_INTERNALS const digit* digits = ((PyLongObject*)x)->ob_digit; switch (Py_SIZE(x)) { case 0: return (int32_t) 0; case -1: __PYX_VERIFY_RETURN_INT(int32_t, sdigit, -(sdigit) digits[0]) case 1: __PYX_VERIFY_RETURN_INT(int32_t, digit, +digits[0]) case -2: if (8 * sizeof(int32_t) - 1 > 1 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(int32_t, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(int32_t) - 1 > 2 * PyLong_SHIFT) { return (int32_t) (((int32_t)-1)*(((((int32_t)digits[1]) << PyLong_SHIFT) | (int32_t)digits[0]))); } } break; case 2: if (8 * sizeof(int32_t) > 1 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(int32_t, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(int32_t) - 1 > 2 * PyLong_SHIFT) { return (int32_t) ((((((int32_t)digits[1]) << PyLong_SHIFT) | (int32_t)digits[0]))); } } break; case -3: if (8 * sizeof(int32_t) - 1 > 2 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(int32_t, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(int32_t) - 1 > 3 * PyLong_SHIFT) { return (int32_t) (((int32_t)-1)*(((((((int32_t)digits[2]) << PyLong_SHIFT) | (int32_t)digits[1]) << PyLong_SHIFT) | (int32_t)digits[0]))); } } break; case 3: if (8 * sizeof(int32_t) > 2 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(int32_t, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(int32_t) - 1 > 3 * PyLong_SHIFT) { return (int32_t) ((((((((int32_t)digits[2]) << PyLong_SHIFT) | (int32_t)digits[1]) << PyLong_SHIFT) | (int32_t)digits[0]))); } } break; case -4: if (8 * sizeof(int32_t) - 1 > 3 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(int32_t, long, -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(int32_t) - 1 > 4 * PyLong_SHIFT) { return (int32_t) (((int32_t)-1)*(((((((((int32_t)digits[3]) << PyLong_SHIFT) | (int32_t)digits[2]) << PyLong_SHIFT) | (int32_t)digits[1]) << PyLong_SHIFT) | (int32_t)digits[0]))); } } break; case 4: if (8 * sizeof(int32_t) > 3 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(int32_t, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(int32_t) - 1 > 4 * PyLong_SHIFT) { return (int32_t) ((((((((((int32_t)digits[3]) << PyLong_SHIFT) | (int32_t)digits[2]) << PyLong_SHIFT) | (int32_t)digits[1]) << PyLong_SHIFT) | (int32_t)digits[0]))); } } break; } #endif if (sizeof(int32_t) <= sizeof(long)) { __PYX_VERIFY_RETURN_INT_EXC(int32_t, long, PyLong_AsLong(x)) } else if (sizeof(int32_t) <= sizeof(PY_LONG_LONG)) { __PYX_VERIFY_RETURN_INT_EXC(int32_t, PY_LONG_LONG, PyLong_AsLongLong(x)) } } { #if CYTHON_COMPILING_IN_PYPY && !defined(_PyLong_AsByteArray) PyErr_SetString(PyExc_RuntimeError, "_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers"); #else int32_t val; PyObject *v = __Pyx_PyNumber_Int(x); #if PY_MAJOR_VERSION < 3 if (likely(v) && !PyLong_Check(v)) { PyObject *tmp = v; v = PyNumber_Long(tmp); Py_DECREF(tmp); } #endif if (likely(v)) { int one = 1; int is_little = (int)*(unsigned char *)&one; unsigned char *bytes = (unsigned char *)&val; int ret = _PyLong_AsByteArray((PyLongObject *)v, bytes, sizeof(val), is_little, !is_unsigned); Py_DECREF(v); if (likely(!ret)) return val; } #endif return (int32_t) -1; } } else { int32_t val; PyObject *tmp = __Pyx_PyNumber_Int(x); if (!tmp) return (int32_t) -1; val = __Pyx_PyInt_As_int32_t(tmp); Py_DECREF(tmp); return val; } raise_overflow: PyErr_SetString(PyExc_OverflowError, "value too large to convert to int32_t"); return (int32_t) -1; raise_neg_overflow: PyErr_SetString(PyExc_OverflowError, "can't convert negative value to int32_t"); return (int32_t) -1; } static CYTHON_INLINE PyObject* __Pyx_PyInt_From_SDL_bool(SDL_bool value) { const SDL_bool neg_one = (SDL_bool) -1, const_zero = (SDL_bool) 0; const int is_unsigned = neg_one > const_zero; if (is_unsigned) { if (sizeof(SDL_bool) < sizeof(long)) { return PyInt_FromLong((long) value); } else if (sizeof(SDL_bool) <= sizeof(unsigned long)) { return PyLong_FromUnsignedLong((unsigned long) value); } else if (sizeof(SDL_bool) <= sizeof(unsigned PY_LONG_LONG)) { return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value); } } else { if (sizeof(SDL_bool) <= sizeof(long)) { return PyInt_FromLong((long) value); } else if (sizeof(SDL_bool) <= sizeof(PY_LONG_LONG)) { return PyLong_FromLongLong((PY_LONG_LONG) value); } } { int one = 1; int little = (int)*(unsigned char *)&one; unsigned char *bytes = (unsigned char *)&value; return _PyLong_FromByteArray(bytes, sizeof(SDL_bool), little, !is_unsigned); } } static CYTHON_INLINE PyObject* __Pyx_PyInt_From_long(long value) { const long neg_one = (long) -1, const_zero = (long) 0; const int is_unsigned = neg_one > const_zero; if (is_unsigned) { if (sizeof(long) < sizeof(long)) { return PyInt_FromLong((long) value); } else if (sizeof(long) <= sizeof(unsigned long)) { return PyLong_FromUnsignedLong((unsigned long) value); } else if (sizeof(long) <= sizeof(unsigned PY_LONG_LONG)) { return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value); } } else { if (sizeof(long) <= sizeof(long)) { return PyInt_FromLong((long) value); } else if (sizeof(long) <= sizeof(PY_LONG_LONG)) { return PyLong_FromLongLong((PY_LONG_LONG) value); } } { int one = 1; int little = (int)*(unsigned char *)&one; unsigned char *bytes = (unsigned char *)&value; return _PyLong_FromByteArray(bytes, sizeof(long), little, !is_unsigned); } } static CYTHON_INLINE long __Pyx_PyInt_As_long(PyObject *x) { const long neg_one = (long) -1, const_zero = (long) 0; const int is_unsigned = neg_one > const_zero; #if PY_MAJOR_VERSION < 3 if (likely(PyInt_Check(x))) { if (sizeof(long) < sizeof(long)) { __PYX_VERIFY_RETURN_INT(long, long, PyInt_AS_LONG(x)) } else { long val = PyInt_AS_LONG(x); if (is_unsigned && unlikely(val < 0)) { goto raise_neg_overflow; } return (long) val; } } else #endif if (likely(PyLong_Check(x))) { if (is_unsigned) { #if CYTHON_USE_PYLONG_INTERNALS const digit* digits = ((PyLongObject*)x)->ob_digit; switch (Py_SIZE(x)) { case 0: return (long) 0; case 1: __PYX_VERIFY_RETURN_INT(long, digit, digits[0]) case 2: if (8 * sizeof(long) > 1 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(long) >= 2 * PyLong_SHIFT) { return (long) (((((long)digits[1]) << PyLong_SHIFT) | (long)digits[0])); } } break; case 3: if (8 * sizeof(long) > 2 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(long) >= 3 * PyLong_SHIFT) { return (long) (((((((long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0])); } } break; case 4: if (8 * sizeof(long) > 3 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(long) >= 4 * PyLong_SHIFT) { return (long) (((((((((long)digits[3]) << PyLong_SHIFT) | (long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0])); } } break; } #endif #if CYTHON_COMPILING_IN_CPYTHON if (unlikely(Py_SIZE(x) < 0)) { goto raise_neg_overflow; } #else { int result = PyObject_RichCompareBool(x, Py_False, Py_LT); if (unlikely(result < 0)) return (long) -1; if (unlikely(result == 1)) goto raise_neg_overflow; } #endif if (sizeof(long) <= sizeof(unsigned long)) { __PYX_VERIFY_RETURN_INT_EXC(long, unsigned long, PyLong_AsUnsignedLong(x)) } else if (sizeof(long) <= sizeof(unsigned PY_LONG_LONG)) { __PYX_VERIFY_RETURN_INT_EXC(long, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x)) } } else { #if CYTHON_USE_PYLONG_INTERNALS const digit* digits = ((PyLongObject*)x)->ob_digit; switch (Py_SIZE(x)) { case 0: return (long) 0; case -1: __PYX_VERIFY_RETURN_INT(long, sdigit, -(sdigit) digits[0]) case 1: __PYX_VERIFY_RETURN_INT(long, digit, +digits[0]) case -2: if (8 * sizeof(long) - 1 > 1 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(long, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) { return (long) (((long)-1)*(((((long)digits[1]) << PyLong_SHIFT) | (long)digits[0]))); } } break; case 2: if (8 * sizeof(long) > 1 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) { return (long) ((((((long)digits[1]) << PyLong_SHIFT) | (long)digits[0]))); } } break; case -3: if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(long, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) { return (long) (((long)-1)*(((((((long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0]))); } } break; case 3: if (8 * sizeof(long) > 2 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) { return (long) ((((((((long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0]))); } } break; case -4: if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(long, long, -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(long) - 1 > 4 * PyLong_SHIFT) { return (long) (((long)-1)*(((((((((long)digits[3]) << PyLong_SHIFT) | (long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0]))); } } break; case 4: if (8 * sizeof(long) > 3 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(long) - 1 > 4 * PyLong_SHIFT) { return (long) ((((((((((long)digits[3]) << PyLong_SHIFT) | (long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0]))); } } break; } #endif if (sizeof(long) <= sizeof(long)) { __PYX_VERIFY_RETURN_INT_EXC(long, long, PyLong_AsLong(x)) } else if (sizeof(long) <= sizeof(PY_LONG_LONG)) { __PYX_VERIFY_RETURN_INT_EXC(long, PY_LONG_LONG, PyLong_AsLongLong(x)) } } { #if CYTHON_COMPILING_IN_PYPY && !defined(_PyLong_AsByteArray) PyErr_SetString(PyExc_RuntimeError, "_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers"); #else long val; PyObject *v = __Pyx_PyNumber_Int(x); #if PY_MAJOR_VERSION < 3 if (likely(v) && !PyLong_Check(v)) { PyObject *tmp = v; v = PyNumber_Long(tmp); Py_DECREF(tmp); } #endif if (likely(v)) { int one = 1; int is_little = (int)*(unsigned char *)&one; unsigned char *bytes = (unsigned char *)&val; int ret = _PyLong_AsByteArray((PyLongObject *)v, bytes, sizeof(val), is_little, !is_unsigned); Py_DECREF(v); if (likely(!ret)) return val; } #endif return (long) -1; } } else { long val; PyObject *tmp = __Pyx_PyNumber_Int(x); if (!tmp) return (long) -1; val = __Pyx_PyInt_As_long(tmp); Py_DECREF(tmp); return val; } raise_overflow: PyErr_SetString(PyExc_OverflowError, "value too large to convert to long"); return (long) -1; raise_neg_overflow: PyErr_SetString(PyExc_OverflowError, "can't convert negative value to long"); return (long) -1; } static int __Pyx_check_binary_version(void) { char ctversion[4], rtversion[4]; PyOS_snprintf(ctversion, 4, "%d.%d", PY_MAJOR_VERSION, PY_MINOR_VERSION); PyOS_snprintf(rtversion, 4, "%s", Py_GetVersion()); if (ctversion[0] != rtversion[0] || ctversion[2] != rtversion[2]) { char message[200]; PyOS_snprintf(message, sizeof(message), "compiletime version %s of module '%.100s' " "does not match runtime version %s", ctversion, __Pyx_MODULE_NAME, rtversion); return PyErr_WarnEx(NULL, message, 1); } return 0; } #ifndef __PYX_HAVE_RT_ImportModule #define __PYX_HAVE_RT_ImportModule static PyObject *__Pyx_ImportModule(const char *name) { PyObject *py_name = 0; PyObject *py_module = 0; py_name = __Pyx_PyIdentifier_FromString(name); if (!py_name) goto bad; py_module = PyImport_Import(py_name); Py_DECREF(py_name); return py_module; bad: Py_XDECREF(py_name); return 0; } #endif #ifndef __PYX_HAVE_RT_ImportType #define __PYX_HAVE_RT_ImportType static PyTypeObject *__Pyx_ImportType(const char *module_name, const char *class_name, size_t size, int strict) { PyObject *py_module = 0; PyObject *result = 0; PyObject *py_name = 0; char warning[200]; Py_ssize_t basicsize; #ifdef Py_LIMITED_API PyObject *py_basicsize; #endif py_module = __Pyx_ImportModule(module_name); if (!py_module) goto bad; py_name = __Pyx_PyIdentifier_FromString(class_name); if (!py_name) goto bad; result = PyObject_GetAttr(py_module, py_name); Py_DECREF(py_name); py_name = 0; Py_DECREF(py_module); py_module = 0; if (!result) goto bad; if (!PyType_Check(result)) { PyErr_Format(PyExc_TypeError, "%.200s.%.200s is not a type object", module_name, class_name); goto bad; } #ifndef Py_LIMITED_API basicsize = ((PyTypeObject *)result)->tp_basicsize; #else py_basicsize = PyObject_GetAttrString(result, "__basicsize__"); if (!py_basicsize) goto bad; basicsize = PyLong_AsSsize_t(py_basicsize); Py_DECREF(py_basicsize); py_basicsize = 0; if (basicsize == (Py_ssize_t)-1 && PyErr_Occurred()) goto bad; #endif if (!strict && (size_t)basicsize > size) { PyOS_snprintf(warning, sizeof(warning), "%s.%s size changed, may indicate binary incompatibility", module_name, class_name); if (PyErr_WarnEx(NULL, warning, 0) < 0) goto bad; } else if ((size_t)basicsize != size) { PyErr_Format(PyExc_ValueError, "%.200s.%.200s has the wrong size, try recompiling", module_name, class_name); goto bad; } return (PyTypeObject *)result; bad: Py_XDECREF(py_module); Py_XDECREF(result); return NULL; } #endif #ifndef __PYX_HAVE_RT_ImportVoidPtr #define __PYX_HAVE_RT_ImportVoidPtr static int __Pyx_ImportVoidPtr(PyObject *module, const char *name, void **p, const char *sig) { PyObject *d = 0; PyObject *cobj = 0; d = PyObject_GetAttrString(module, (char *)"__pyx_capi__"); if (!d) goto bad; cobj = PyDict_GetItemString(d, name); if (!cobj) { PyErr_Format(PyExc_ImportError, "%.200s does not export expected C variable %.200s", PyModule_GetName(module), name); goto bad; } #if PY_VERSION_HEX >= 0x02070000 if (!PyCapsule_IsValid(cobj, sig)) { PyErr_Format(PyExc_TypeError, "C variable %.200s.%.200s has wrong signature (expected %.500s, got %.500s)", PyModule_GetName(module), name, sig, PyCapsule_GetName(cobj)); goto bad; } *p = PyCapsule_GetPointer(cobj, sig); #else {const char *desc, *s1, *s2; desc = (const char *)PyCObject_GetDesc(cobj); if (!desc) goto bad; s1 = desc; s2 = sig; while (*s1 != '\0' && *s1 == *s2) { s1++; s2++; } if (*s1 != *s2) { PyErr_Format(PyExc_TypeError, "C variable %.200s.%.200s has wrong signature (expected %.500s, got %.500s)", PyModule_GetName(module), name, sig, desc); goto bad; } *p = PyCObject_AsVoidPtr(cobj);} #endif if (!(*p)) goto bad; Py_DECREF(d); return 0; bad: Py_XDECREF(d); return -1; } #endif #ifndef __PYX_HAVE_RT_ImportFunction #define __PYX_HAVE_RT_ImportFunction static int __Pyx_ImportFunction(PyObject *module, const char *funcname, void (**f)(void), const char *sig) { PyObject *d = 0; PyObject *cobj = 0; union { void (*fp)(void); void *p; } tmp; d = PyObject_GetAttrString(module, (char *)"__pyx_capi__"); if (!d) goto bad; cobj = PyDict_GetItemString(d, funcname); if (!cobj) { PyErr_Format(PyExc_ImportError, "%.200s does not export expected C function %.200s", PyModule_GetName(module), funcname); goto bad; } #if PY_VERSION_HEX >= 0x02070000 if (!PyCapsule_IsValid(cobj, sig)) { PyErr_Format(PyExc_TypeError, "C function %.200s.%.200s has wrong signature (expected %.500s, got %.500s)", PyModule_GetName(module), funcname, sig, PyCapsule_GetName(cobj)); goto bad; } tmp.p = PyCapsule_GetPointer(cobj, sig); #else {const char *desc, *s1, *s2; desc = (const char *)PyCObject_GetDesc(cobj); if (!desc) goto bad; s1 = desc; s2 = sig; while (*s1 != '\0' && *s1 == *s2) { s1++; s2++; } if (*s1 != *s2) { PyErr_Format(PyExc_TypeError, "C function %.200s.%.200s has wrong signature (expected %.500s, got %.500s)", PyModule_GetName(module), funcname, sig, desc); goto bad; } tmp.p = PyCObject_AsVoidPtr(cobj);} #endif *f = tmp.fp; if (!(*f)) goto bad; Py_DECREF(d); return 0; bad: Py_XDECREF(d); return -1; } #endif static int __Pyx_InitStrings(__Pyx_StringTabEntry *t) { while (t->p) { #if PY_MAJOR_VERSION < 3 if (t->is_unicode) { *t->p = PyUnicode_DecodeUTF8(t->s, t->n - 1, NULL); } else if (t->intern) { *t->p = PyString_InternFromString(t->s); } else { *t->p = PyString_FromStringAndSize(t->s, t->n - 1); } #else if (t->is_unicode | t->is_str) { if (t->intern) { *t->p = PyUnicode_InternFromString(t->s); } else if (t->encoding) { *t->p = PyUnicode_Decode(t->s, t->n - 1, t->encoding, NULL); } else { *t->p = PyUnicode_FromStringAndSize(t->s, t->n - 1); } } else { *t->p = PyBytes_FromStringAndSize(t->s, t->n - 1); } #endif if (!*t->p) return -1; ++t; } return 0; } static CYTHON_INLINE PyObject* __Pyx_PyUnicode_FromString(const char* c_str) { return __Pyx_PyUnicode_FromStringAndSize(c_str, (Py_ssize_t)strlen(c_str)); } static CYTHON_INLINE char* __Pyx_PyObject_AsString(PyObject* o) { Py_ssize_t ignore; return __Pyx_PyObject_AsStringAndSize(o, &ignore); } static CYTHON_INLINE char* __Pyx_PyObject_AsStringAndSize(PyObject* o, Py_ssize_t *length) { #if CYTHON_COMPILING_IN_CPYTHON && (__PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT) if ( #if PY_MAJOR_VERSION < 3 && __PYX_DEFAULT_STRING_ENCODING_IS_ASCII __Pyx_sys_getdefaultencoding_not_ascii && #endif PyUnicode_Check(o)) { #if PY_VERSION_HEX < 0x03030000 char* defenc_c; PyObject* defenc = _PyUnicode_AsDefaultEncodedString(o, NULL); if (!defenc) return NULL; defenc_c = PyBytes_AS_STRING(defenc); #if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII { char* end = defenc_c + PyBytes_GET_SIZE(defenc); char* c; for (c = defenc_c; c < end; c++) { if ((unsigned char) (*c) >= 128) { PyUnicode_AsASCIIString(o); return NULL; } } } #endif *length = PyBytes_GET_SIZE(defenc); return defenc_c; #else if (__Pyx_PyUnicode_READY(o) == -1) return NULL; #if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII if (PyUnicode_IS_ASCII(o)) { *length = PyUnicode_GET_LENGTH(o); return PyUnicode_AsUTF8(o); } else { PyUnicode_AsASCIIString(o); return NULL; } #else return PyUnicode_AsUTF8AndSize(o, length); #endif #endif } else #endif #if (!CYTHON_COMPILING_IN_PYPY) || (defined(PyByteArray_AS_STRING) && defined(PyByteArray_GET_SIZE)) if (PyByteArray_Check(o)) { *length = PyByteArray_GET_SIZE(o); return PyByteArray_AS_STRING(o); } else #endif { char* result; int r = PyBytes_AsStringAndSize(o, &result, length); if (unlikely(r < 0)) { return NULL; } else { return result; } } } static CYTHON_INLINE int __Pyx_PyObject_IsTrue(PyObject* x) { int is_true = x == Py_True; if (is_true | (x == Py_False) | (x == Py_None)) return is_true; else return PyObject_IsTrue(x); } static CYTHON_INLINE PyObject* __Pyx_PyNumber_Int(PyObject* x) { PyNumberMethods *m; const char *name = NULL; PyObject *res = NULL; #if PY_MAJOR_VERSION < 3 if (PyInt_Check(x) || PyLong_Check(x)) #else if (PyLong_Check(x)) #endif return __Pyx_NewRef(x); m = Py_TYPE(x)->tp_as_number; #if PY_MAJOR_VERSION < 3 if (m && m->nb_int) { name = "int"; res = PyNumber_Int(x); } else if (m && m->nb_long) { name = "long"; res = PyNumber_Long(x); } #else if (m && m->nb_int) { name = "int"; res = PyNumber_Long(x); } #endif if (res) { #if PY_MAJOR_VERSION < 3 if (!PyInt_Check(res) && !PyLong_Check(res)) { #else if (!PyLong_Check(res)) { #endif PyErr_Format(PyExc_TypeError, "__%.4s__ returned non-%.4s (type %.200s)", name, name, Py_TYPE(res)->tp_name); Py_DECREF(res); return NULL; } } else if (!PyErr_Occurred()) { PyErr_SetString(PyExc_TypeError, "an integer is required"); } return res; } static CYTHON_INLINE Py_ssize_t __Pyx_PyIndex_AsSsize_t(PyObject* b) { Py_ssize_t ival; PyObject *x; #if PY_MAJOR_VERSION < 3 if (likely(PyInt_CheckExact(b))) { if (sizeof(Py_ssize_t) >= sizeof(long)) return PyInt_AS_LONG(b); else return PyInt_AsSsize_t(x); } #endif if (likely(PyLong_CheckExact(b))) { #if CYTHON_USE_PYLONG_INTERNALS const digit* digits = ((PyLongObject*)b)->ob_digit; const Py_ssize_t size = Py_SIZE(b); if (likely(__Pyx_sst_abs(size) <= 1)) { ival = likely(size) ? digits[0] : 0; if (size == -1) ival = -ival; return ival; } else { switch (size) { case 2: if (8 * sizeof(Py_ssize_t) > 2 * PyLong_SHIFT) { return (Py_ssize_t) (((((size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])); } break; case -2: if (8 * sizeof(Py_ssize_t) > 2 * PyLong_SHIFT) { return -(Py_ssize_t) (((((size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])); } break; case 3: if (8 * sizeof(Py_ssize_t) > 3 * PyLong_SHIFT) { return (Py_ssize_t) (((((((size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])); } break; case -3: if (8 * sizeof(Py_ssize_t) > 3 * PyLong_SHIFT) { return -(Py_ssize_t) (((((((size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])); } break; case 4: if (8 * sizeof(Py_ssize_t) > 4 * PyLong_SHIFT) { return (Py_ssize_t) (((((((((size_t)digits[3]) << PyLong_SHIFT) | (size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])); } break; case -4: if (8 * sizeof(Py_ssize_t) > 4 * PyLong_SHIFT) { return -(Py_ssize_t) (((((((((size_t)digits[3]) << PyLong_SHIFT) | (size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])); } break; } } #endif return PyLong_AsSsize_t(b); } x = PyNumber_Index(b); if (!x) return -1; ival = PyInt_AsSsize_t(x); Py_DECREF(x); return ival; } static CYTHON_INLINE PyObject * __Pyx_PyInt_FromSize_t(size_t ival) { return PyInt_FromSize_t(ival); } #endif /* Py_PYTHON_H */ pygame_sdl2-2.1.0-for-renpy-6.99.14.1/gen/pygame_sdl2.image.c0000664000175000017500000060707312673650451022500 0ustar tomtom00000000000000/* Generated by Cython 0.23.4 */ #define PY_SSIZE_T_CLEAN #include "Python.h" #ifndef Py_PYTHON_H #error Python headers needed to compile C extensions, please install development version of Python. #elif PY_VERSION_HEX < 0x02060000 || (0x03000000 <= PY_VERSION_HEX && PY_VERSION_HEX < 0x03020000) #error Cython requires Python 2.6+ or Python 3.2+. #else #define CYTHON_ABI "0_23_4" #include #ifndef offsetof #define offsetof(type, member) ( (size_t) & ((type*)0) -> member ) #endif #if !defined(WIN32) && !defined(MS_WINDOWS) #ifndef __stdcall #define __stdcall #endif #ifndef __cdecl #define __cdecl #endif #ifndef __fastcall #define __fastcall #endif #endif #ifndef DL_IMPORT #define DL_IMPORT(t) t #endif #ifndef DL_EXPORT #define DL_EXPORT(t) t #endif #ifndef PY_LONG_LONG #define PY_LONG_LONG LONG_LONG #endif #ifndef Py_HUGE_VAL #define Py_HUGE_VAL HUGE_VAL #endif #ifdef PYPY_VERSION #define CYTHON_COMPILING_IN_PYPY 1 #define CYTHON_COMPILING_IN_CPYTHON 0 #else #define CYTHON_COMPILING_IN_PYPY 0 #define CYTHON_COMPILING_IN_CPYTHON 1 #endif #if !defined(CYTHON_USE_PYLONG_INTERNALS) && CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x02070000 #define CYTHON_USE_PYLONG_INTERNALS 1 #endif #if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX < 0x02070600 && !defined(Py_OptimizeFlag) #define Py_OptimizeFlag 0 #endif #define __PYX_BUILD_PY_SSIZE_T "n" #define CYTHON_FORMAT_SSIZE_T "z" #if PY_MAJOR_VERSION < 3 #define __Pyx_BUILTIN_MODULE_NAME "__builtin__" #define __Pyx_PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)\ PyCode_New(a+k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos) #define __Pyx_DefaultClassType PyClass_Type #else #define __Pyx_BUILTIN_MODULE_NAME "builtins" #define __Pyx_PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)\ PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos) #define __Pyx_DefaultClassType PyType_Type #endif #ifndef Py_TPFLAGS_CHECKTYPES #define Py_TPFLAGS_CHECKTYPES 0 #endif #ifndef Py_TPFLAGS_HAVE_INDEX #define Py_TPFLAGS_HAVE_INDEX 0 #endif #ifndef Py_TPFLAGS_HAVE_NEWBUFFER #define Py_TPFLAGS_HAVE_NEWBUFFER 0 #endif #ifndef Py_TPFLAGS_HAVE_FINALIZE #define Py_TPFLAGS_HAVE_FINALIZE 0 #endif #if PY_VERSION_HEX > 0x03030000 && defined(PyUnicode_KIND) #define CYTHON_PEP393_ENABLED 1 #define __Pyx_PyUnicode_READY(op) (likely(PyUnicode_IS_READY(op)) ?\ 0 : _PyUnicode_Ready((PyObject *)(op))) #define __Pyx_PyUnicode_GET_LENGTH(u) PyUnicode_GET_LENGTH(u) #define __Pyx_PyUnicode_READ_CHAR(u, i) PyUnicode_READ_CHAR(u, i) #define __Pyx_PyUnicode_KIND(u) PyUnicode_KIND(u) #define __Pyx_PyUnicode_DATA(u) PyUnicode_DATA(u) #define __Pyx_PyUnicode_READ(k, d, i) PyUnicode_READ(k, d, i) #else #define CYTHON_PEP393_ENABLED 0 #define __Pyx_PyUnicode_READY(op) (0) #define __Pyx_PyUnicode_GET_LENGTH(u) PyUnicode_GET_SIZE(u) #define __Pyx_PyUnicode_READ_CHAR(u, i) ((Py_UCS4)(PyUnicode_AS_UNICODE(u)[i])) #define __Pyx_PyUnicode_KIND(u) (sizeof(Py_UNICODE)) #define __Pyx_PyUnicode_DATA(u) ((void*)PyUnicode_AS_UNICODE(u)) #define __Pyx_PyUnicode_READ(k, d, i) ((void)(k), (Py_UCS4)(((Py_UNICODE*)d)[i])) #endif #if CYTHON_COMPILING_IN_PYPY #define __Pyx_PyUnicode_Concat(a, b) PyNumber_Add(a, b) #define __Pyx_PyUnicode_ConcatSafe(a, b) PyNumber_Add(a, b) #else #define __Pyx_PyUnicode_Concat(a, b) PyUnicode_Concat(a, b) #define __Pyx_PyUnicode_ConcatSafe(a, b) ((unlikely((a) == Py_None) || unlikely((b) == Py_None)) ?\ PyNumber_Add(a, b) : __Pyx_PyUnicode_Concat(a, b)) #endif #if CYTHON_COMPILING_IN_PYPY && !defined(PyUnicode_Contains) #define PyUnicode_Contains(u, s) PySequence_Contains(u, s) #endif #define __Pyx_PyString_FormatSafe(a, b) ((unlikely((a) == Py_None)) ? PyNumber_Remainder(a, b) : __Pyx_PyString_Format(a, b)) #define __Pyx_PyUnicode_FormatSafe(a, b) ((unlikely((a) == Py_None)) ? PyNumber_Remainder(a, b) : PyUnicode_Format(a, b)) #if PY_MAJOR_VERSION >= 3 #define __Pyx_PyString_Format(a, b) PyUnicode_Format(a, b) #else #define __Pyx_PyString_Format(a, b) PyString_Format(a, b) #endif #if PY_MAJOR_VERSION >= 3 #define PyBaseString_Type PyUnicode_Type #define PyStringObject PyUnicodeObject #define PyString_Type PyUnicode_Type #define PyString_Check PyUnicode_Check #define PyString_CheckExact PyUnicode_CheckExact #endif #if PY_MAJOR_VERSION >= 3 #define __Pyx_PyBaseString_Check(obj) PyUnicode_Check(obj) #define __Pyx_PyBaseString_CheckExact(obj) PyUnicode_CheckExact(obj) #else #define __Pyx_PyBaseString_Check(obj) (PyString_Check(obj) || PyUnicode_Check(obj)) #define __Pyx_PyBaseString_CheckExact(obj) (PyString_CheckExact(obj) || PyUnicode_CheckExact(obj)) #endif #ifndef PySet_CheckExact #define PySet_CheckExact(obj) (Py_TYPE(obj) == &PySet_Type) #endif #define __Pyx_TypeCheck(obj, type) PyObject_TypeCheck(obj, (PyTypeObject *)type) #if PY_MAJOR_VERSION >= 3 #define PyIntObject PyLongObject #define PyInt_Type PyLong_Type #define PyInt_Check(op) PyLong_Check(op) #define PyInt_CheckExact(op) PyLong_CheckExact(op) #define PyInt_FromString PyLong_FromString #define PyInt_FromUnicode PyLong_FromUnicode #define PyInt_FromLong PyLong_FromLong #define PyInt_FromSize_t PyLong_FromSize_t #define PyInt_FromSsize_t PyLong_FromSsize_t #define PyInt_AsLong PyLong_AsLong #define PyInt_AS_LONG PyLong_AS_LONG #define PyInt_AsSsize_t PyLong_AsSsize_t #define PyInt_AsUnsignedLongMask PyLong_AsUnsignedLongMask #define PyInt_AsUnsignedLongLongMask PyLong_AsUnsignedLongLongMask #define PyNumber_Int PyNumber_Long #endif #if PY_MAJOR_VERSION >= 3 #define PyBoolObject PyLongObject #endif #if PY_MAJOR_VERSION >= 3 && CYTHON_COMPILING_IN_PYPY #ifndef PyUnicode_InternFromString #define PyUnicode_InternFromString(s) PyUnicode_FromString(s) #endif #endif #if PY_VERSION_HEX < 0x030200A4 typedef long Py_hash_t; #define __Pyx_PyInt_FromHash_t PyInt_FromLong #define __Pyx_PyInt_AsHash_t PyInt_AsLong #else #define __Pyx_PyInt_FromHash_t PyInt_FromSsize_t #define __Pyx_PyInt_AsHash_t PyInt_AsSsize_t #endif #if PY_MAJOR_VERSION >= 3 #define __Pyx_PyMethod_New(func, self, klass) ((self) ? PyMethod_New(func, self) : PyInstanceMethod_New(func)) #else #define __Pyx_PyMethod_New(func, self, klass) PyMethod_New(func, self, klass) #endif #if PY_VERSION_HEX >= 0x030500B1 #define __Pyx_PyAsyncMethodsStruct PyAsyncMethods #define __Pyx_PyType_AsAsync(obj) (Py_TYPE(obj)->tp_as_async) #elif CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3 typedef struct { unaryfunc am_await; unaryfunc am_aiter; unaryfunc am_anext; } __Pyx_PyAsyncMethodsStruct; #define __Pyx_PyType_AsAsync(obj) ((__Pyx_PyAsyncMethodsStruct*) (Py_TYPE(obj)->tp_reserved)) #else #define __Pyx_PyType_AsAsync(obj) NULL #endif #ifndef CYTHON_RESTRICT #if defined(__GNUC__) #define CYTHON_RESTRICT __restrict__ #elif defined(_MSC_VER) && _MSC_VER >= 1400 #define CYTHON_RESTRICT __restrict #elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L #define CYTHON_RESTRICT restrict #else #define CYTHON_RESTRICT #endif #endif #define __Pyx_void_to_None(void_result) ((void)(void_result), Py_INCREF(Py_None), Py_None) #ifndef CYTHON_INLINE #if defined(__GNUC__) #define CYTHON_INLINE __inline__ #elif defined(_MSC_VER) #define CYTHON_INLINE __inline #elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L #define CYTHON_INLINE inline #else #define CYTHON_INLINE #endif #endif #if defined(WIN32) || defined(MS_WINDOWS) #define _USE_MATH_DEFINES #endif #include #ifdef NAN #define __PYX_NAN() ((float) NAN) #else static CYTHON_INLINE float __PYX_NAN() { float value; memset(&value, 0xFF, sizeof(value)); return value; } #endif #if PY_MAJOR_VERSION >= 3 #define __Pyx_PyNumber_Divide(x,y) PyNumber_TrueDivide(x,y) #define __Pyx_PyNumber_InPlaceDivide(x,y) PyNumber_InPlaceTrueDivide(x,y) #else #define __Pyx_PyNumber_Divide(x,y) PyNumber_Divide(x,y) #define __Pyx_PyNumber_InPlaceDivide(x,y) PyNumber_InPlaceDivide(x,y) #endif #ifndef __PYX_EXTERN_C #ifdef __cplusplus #define __PYX_EXTERN_C extern "C" #else #define __PYX_EXTERN_C extern #endif #endif #define __PYX_HAVE__pygame_sdl2__image #define __PYX_HAVE_API__pygame_sdl2__image #include "stdint.h" #include "string.h" #include "stdio.h" #include "stddef.h" #include "SDL.h" #include "SDL_image.h" #include "write_jpeg.h" #include "write_png.h" #ifdef _OPENMP #include #endif /* _OPENMP */ #ifdef PYREX_WITHOUT_ASSERTIONS #define CYTHON_WITHOUT_ASSERTIONS #endif #ifndef CYTHON_UNUSED # if defined(__GNUC__) # if !(defined(__cplusplus)) || (__GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 4)) # define CYTHON_UNUSED __attribute__ ((__unused__)) # else # define CYTHON_UNUSED # endif # elif defined(__ICC) || (defined(__INTEL_COMPILER) && !defined(_MSC_VER)) # define CYTHON_UNUSED __attribute__ ((__unused__)) # else # define CYTHON_UNUSED # endif #endif #ifndef CYTHON_NCP_UNUSED # if CYTHON_COMPILING_IN_CPYTHON # define CYTHON_NCP_UNUSED # else # define CYTHON_NCP_UNUSED CYTHON_UNUSED # endif #endif typedef struct {PyObject **p; char *s; const Py_ssize_t n; const char* encoding; const char is_unicode; const char is_str; const char intern; } __Pyx_StringTabEntry; #define __PYX_DEFAULT_STRING_ENCODING_IS_ASCII 0 #define __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT 0 #define __PYX_DEFAULT_STRING_ENCODING "" #define __Pyx_PyObject_FromString __Pyx_PyBytes_FromString #define __Pyx_PyObject_FromStringAndSize __Pyx_PyBytes_FromStringAndSize #define __Pyx_uchar_cast(c) ((unsigned char)c) #define __Pyx_long_cast(x) ((long)x) #define __Pyx_fits_Py_ssize_t(v, type, is_signed) (\ (sizeof(type) < sizeof(Py_ssize_t)) ||\ (sizeof(type) > sizeof(Py_ssize_t) &&\ likely(v < (type)PY_SSIZE_T_MAX ||\ v == (type)PY_SSIZE_T_MAX) &&\ (!is_signed || likely(v > (type)PY_SSIZE_T_MIN ||\ v == (type)PY_SSIZE_T_MIN))) ||\ (sizeof(type) == sizeof(Py_ssize_t) &&\ (is_signed || likely(v < (type)PY_SSIZE_T_MAX ||\ v == (type)PY_SSIZE_T_MAX))) ) #if defined (__cplusplus) && __cplusplus >= 201103L #include #define __Pyx_sst_abs(value) std::abs(value) #elif SIZEOF_INT >= SIZEOF_SIZE_T #define __Pyx_sst_abs(value) abs(value) #elif SIZEOF_LONG >= SIZEOF_SIZE_T #define __Pyx_sst_abs(value) labs(value) #elif defined (_MSC_VER) && defined (_M_X64) #define __Pyx_sst_abs(value) _abs64(value) #elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L #define __Pyx_sst_abs(value) llabs(value) #elif defined (__GNUC__) #define __Pyx_sst_abs(value) __builtin_llabs(value) #else #define __Pyx_sst_abs(value) ((value<0) ? -value : value) #endif static CYTHON_INLINE char* __Pyx_PyObject_AsString(PyObject*); static CYTHON_INLINE char* __Pyx_PyObject_AsStringAndSize(PyObject*, Py_ssize_t* length); #define __Pyx_PyByteArray_FromString(s) PyByteArray_FromStringAndSize((const char*)s, strlen((const char*)s)) #define __Pyx_PyByteArray_FromStringAndSize(s, l) PyByteArray_FromStringAndSize((const char*)s, l) #define __Pyx_PyBytes_FromString PyBytes_FromString #define __Pyx_PyBytes_FromStringAndSize PyBytes_FromStringAndSize static CYTHON_INLINE PyObject* __Pyx_PyUnicode_FromString(const char*); #if PY_MAJOR_VERSION < 3 #define __Pyx_PyStr_FromString __Pyx_PyBytes_FromString #define __Pyx_PyStr_FromStringAndSize __Pyx_PyBytes_FromStringAndSize #else #define __Pyx_PyStr_FromString __Pyx_PyUnicode_FromString #define __Pyx_PyStr_FromStringAndSize __Pyx_PyUnicode_FromStringAndSize #endif #define __Pyx_PyObject_AsSString(s) ((signed char*) __Pyx_PyObject_AsString(s)) #define __Pyx_PyObject_AsUString(s) ((unsigned char*) __Pyx_PyObject_AsString(s)) #define __Pyx_PyObject_FromCString(s) __Pyx_PyObject_FromString((const char*)s) #define __Pyx_PyBytes_FromCString(s) __Pyx_PyBytes_FromString((const char*)s) #define __Pyx_PyByteArray_FromCString(s) __Pyx_PyByteArray_FromString((const char*)s) #define __Pyx_PyStr_FromCString(s) __Pyx_PyStr_FromString((const char*)s) #define __Pyx_PyUnicode_FromCString(s) __Pyx_PyUnicode_FromString((const char*)s) #if PY_MAJOR_VERSION < 3 static CYTHON_INLINE size_t __Pyx_Py_UNICODE_strlen(const Py_UNICODE *u) { const Py_UNICODE *u_end = u; while (*u_end++) ; return (size_t)(u_end - u - 1); } #else #define __Pyx_Py_UNICODE_strlen Py_UNICODE_strlen #endif #define __Pyx_PyUnicode_FromUnicode(u) PyUnicode_FromUnicode(u, __Pyx_Py_UNICODE_strlen(u)) #define __Pyx_PyUnicode_FromUnicodeAndLength PyUnicode_FromUnicode #define __Pyx_PyUnicode_AsUnicode PyUnicode_AsUnicode #define __Pyx_NewRef(obj) (Py_INCREF(obj), obj) #define __Pyx_Owned_Py_None(b) __Pyx_NewRef(Py_None) #define __Pyx_PyBool_FromLong(b) ((b) ? __Pyx_NewRef(Py_True) : __Pyx_NewRef(Py_False)) static CYTHON_INLINE int __Pyx_PyObject_IsTrue(PyObject*); static CYTHON_INLINE PyObject* __Pyx_PyNumber_Int(PyObject* x); static CYTHON_INLINE Py_ssize_t __Pyx_PyIndex_AsSsize_t(PyObject*); static CYTHON_INLINE PyObject * __Pyx_PyInt_FromSize_t(size_t); #if CYTHON_COMPILING_IN_CPYTHON #define __pyx_PyFloat_AsDouble(x) (PyFloat_CheckExact(x) ? PyFloat_AS_DOUBLE(x) : PyFloat_AsDouble(x)) #else #define __pyx_PyFloat_AsDouble(x) PyFloat_AsDouble(x) #endif #define __pyx_PyFloat_AsFloat(x) ((float) __pyx_PyFloat_AsDouble(x)) #if PY_MAJOR_VERSION < 3 && __PYX_DEFAULT_STRING_ENCODING_IS_ASCII static int __Pyx_sys_getdefaultencoding_not_ascii; static int __Pyx_init_sys_getdefaultencoding_params(void) { PyObject* sys; PyObject* default_encoding = NULL; PyObject* ascii_chars_u = NULL; PyObject* ascii_chars_b = NULL; const char* default_encoding_c; sys = PyImport_ImportModule("sys"); if (!sys) goto bad; default_encoding = PyObject_CallMethod(sys, (char*) "getdefaultencoding", NULL); Py_DECREF(sys); if (!default_encoding) goto bad; default_encoding_c = PyBytes_AsString(default_encoding); if (!default_encoding_c) goto bad; if (strcmp(default_encoding_c, "ascii") == 0) { __Pyx_sys_getdefaultencoding_not_ascii = 0; } else { char ascii_chars[128]; int c; for (c = 0; c < 128; c++) { ascii_chars[c] = c; } __Pyx_sys_getdefaultencoding_not_ascii = 1; ascii_chars_u = PyUnicode_DecodeASCII(ascii_chars, 128, NULL); if (!ascii_chars_u) goto bad; ascii_chars_b = PyUnicode_AsEncodedString(ascii_chars_u, default_encoding_c, NULL); if (!ascii_chars_b || !PyBytes_Check(ascii_chars_b) || memcmp(ascii_chars, PyBytes_AS_STRING(ascii_chars_b), 128) != 0) { PyErr_Format( PyExc_ValueError, "This module compiled with c_string_encoding=ascii, but default encoding '%.200s' is not a superset of ascii.", default_encoding_c); goto bad; } Py_DECREF(ascii_chars_u); Py_DECREF(ascii_chars_b); } Py_DECREF(default_encoding); return 0; bad: Py_XDECREF(default_encoding); Py_XDECREF(ascii_chars_u); Py_XDECREF(ascii_chars_b); return -1; } #endif #if __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT && PY_MAJOR_VERSION >= 3 #define __Pyx_PyUnicode_FromStringAndSize(c_str, size) PyUnicode_DecodeUTF8(c_str, size, NULL) #else #define __Pyx_PyUnicode_FromStringAndSize(c_str, size) PyUnicode_Decode(c_str, size, __PYX_DEFAULT_STRING_ENCODING, NULL) #if __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT static char* __PYX_DEFAULT_STRING_ENCODING; static int __Pyx_init_sys_getdefaultencoding_params(void) { PyObject* sys; PyObject* default_encoding = NULL; char* default_encoding_c; sys = PyImport_ImportModule("sys"); if (!sys) goto bad; default_encoding = PyObject_CallMethod(sys, (char*) (const char*) "getdefaultencoding", NULL); Py_DECREF(sys); if (!default_encoding) goto bad; default_encoding_c = PyBytes_AsString(default_encoding); if (!default_encoding_c) goto bad; __PYX_DEFAULT_STRING_ENCODING = (char*) malloc(strlen(default_encoding_c)); if (!__PYX_DEFAULT_STRING_ENCODING) goto bad; strcpy(__PYX_DEFAULT_STRING_ENCODING, default_encoding_c); Py_DECREF(default_encoding); return 0; bad: Py_XDECREF(default_encoding); return -1; } #endif #endif /* Test for GCC > 2.95 */ #if defined(__GNUC__) && (__GNUC__ > 2 || (__GNUC__ == 2 && (__GNUC_MINOR__ > 95))) #define likely(x) __builtin_expect(!!(x), 1) #define unlikely(x) __builtin_expect(!!(x), 0) #else /* !__GNUC__ or GCC < 2.95 */ #define likely(x) (x) #define unlikely(x) (x) #endif /* __GNUC__ */ static PyObject *__pyx_m; static PyObject *__pyx_d; static PyObject *__pyx_b; static PyObject *__pyx_empty_tuple; static PyObject *__pyx_empty_bytes; static int __pyx_lineno; static int __pyx_clineno = 0; static const char * __pyx_cfilenm= __FILE__; static const char *__pyx_filename; static const char *__pyx_f[] = { "src/pygame_sdl2/image.pyx", "src/pygame_sdl2/surface.pxd", }; /*--- Type declarations ---*/ struct __pyx_obj_11pygame_sdl2_7surface_Surface; struct __pyx_opt_args_11pygame_sdl2_8rwobject_to_rwops; /* "pygame_sdl2/rwobject.pxd":21 * from sdl2 cimport SDL_RWops * * cdef SDL_RWops *to_rwops(filelike, mode=*) except NULL # <<<<<<<<<<<<<< * */ struct __pyx_opt_args_11pygame_sdl2_8rwobject_to_rwops { int __pyx_n; PyObject *mode; }; /* "pygame_sdl2/surface.pxd":23 * from sdl2 cimport SDL_Surface * * cdef class Surface: # <<<<<<<<<<<<<< * # Allow weak references. * cdef object __weakref__ */ struct __pyx_obj_11pygame_sdl2_7surface_Surface { PyObject_HEAD struct __pyx_vtabstruct_11pygame_sdl2_7surface_Surface *__pyx_vtab; PyObject *__weakref__; SDL_Surface *surface; int owns_surface; int window_surface; PyObject *locklist; struct __pyx_obj_11pygame_sdl2_7surface_Surface *parent; struct __pyx_obj_11pygame_sdl2_7surface_Surface *root; int offset_x; int offset_y; PyObject *get_window_flags; int has_alpha; }; struct __pyx_vtabstruct_11pygame_sdl2_7surface_Surface { void (*take_surface)(struct __pyx_obj_11pygame_sdl2_7surface_Surface *, SDL_Surface *); }; static struct __pyx_vtabstruct_11pygame_sdl2_7surface_Surface *__pyx_vtabptr_11pygame_sdl2_7surface_Surface; /* --- Runtime support code (head) --- */ #ifndef CYTHON_REFNANNY #define CYTHON_REFNANNY 0 #endif #if CYTHON_REFNANNY typedef struct { void (*INCREF)(void*, PyObject*, int); void (*DECREF)(void*, PyObject*, int); void (*GOTREF)(void*, PyObject*, int); void (*GIVEREF)(void*, PyObject*, int); void* (*SetupContext)(const char*, int, const char*); void (*FinishContext)(void**); } __Pyx_RefNannyAPIStruct; static __Pyx_RefNannyAPIStruct *__Pyx_RefNanny = NULL; static __Pyx_RefNannyAPIStruct *__Pyx_RefNannyImportAPI(const char *modname); #define __Pyx_RefNannyDeclarations void *__pyx_refnanny = NULL; #ifdef WITH_THREAD #define __Pyx_RefNannySetupContext(name, acquire_gil)\ if (acquire_gil) {\ PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure();\ __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), __LINE__, __FILE__);\ PyGILState_Release(__pyx_gilstate_save);\ } else {\ __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), __LINE__, __FILE__);\ } #else #define __Pyx_RefNannySetupContext(name, acquire_gil)\ __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), __LINE__, __FILE__) #endif #define __Pyx_RefNannyFinishContext()\ __Pyx_RefNanny->FinishContext(&__pyx_refnanny) #define __Pyx_INCREF(r) __Pyx_RefNanny->INCREF(__pyx_refnanny, (PyObject *)(r), __LINE__) #define __Pyx_DECREF(r) __Pyx_RefNanny->DECREF(__pyx_refnanny, (PyObject *)(r), __LINE__) #define __Pyx_GOTREF(r) __Pyx_RefNanny->GOTREF(__pyx_refnanny, (PyObject *)(r), __LINE__) #define __Pyx_GIVEREF(r) __Pyx_RefNanny->GIVEREF(__pyx_refnanny, (PyObject *)(r), __LINE__) #define __Pyx_XINCREF(r) do { if((r) != NULL) {__Pyx_INCREF(r); }} while(0) #define __Pyx_XDECREF(r) do { if((r) != NULL) {__Pyx_DECREF(r); }} while(0) #define __Pyx_XGOTREF(r) do { if((r) != NULL) {__Pyx_GOTREF(r); }} while(0) #define __Pyx_XGIVEREF(r) do { if((r) != NULL) {__Pyx_GIVEREF(r);}} while(0) #else #define __Pyx_RefNannyDeclarations #define __Pyx_RefNannySetupContext(name, acquire_gil) #define __Pyx_RefNannyFinishContext() #define __Pyx_INCREF(r) Py_INCREF(r) #define __Pyx_DECREF(r) Py_DECREF(r) #define __Pyx_GOTREF(r) #define __Pyx_GIVEREF(r) #define __Pyx_XINCREF(r) Py_XINCREF(r) #define __Pyx_XDECREF(r) Py_XDECREF(r) #define __Pyx_XGOTREF(r) #define __Pyx_XGIVEREF(r) #endif #define __Pyx_XDECREF_SET(r, v) do {\ PyObject *tmp = (PyObject *) r;\ r = v; __Pyx_XDECREF(tmp);\ } while (0) #define __Pyx_DECREF_SET(r, v) do {\ PyObject *tmp = (PyObject *) r;\ r = v; __Pyx_DECREF(tmp);\ } while (0) #define __Pyx_CLEAR(r) do { PyObject* tmp = ((PyObject*)(r)); r = NULL; __Pyx_DECREF(tmp);} while(0) #define __Pyx_XCLEAR(r) do { if((r) != NULL) {PyObject* tmp = ((PyObject*)(r)); r = NULL; __Pyx_DECREF(tmp);}} while(0) #if CYTHON_COMPILING_IN_CPYTHON static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStr(PyObject* obj, PyObject* attr_name) { PyTypeObject* tp = Py_TYPE(obj); if (likely(tp->tp_getattro)) return tp->tp_getattro(obj, attr_name); #if PY_MAJOR_VERSION < 3 if (likely(tp->tp_getattr)) return tp->tp_getattr(obj, PyString_AS_STRING(attr_name)); #endif return PyObject_GetAttr(obj, attr_name); } #else #define __Pyx_PyObject_GetAttrStr(o,n) PyObject_GetAttr(o,n) #endif static PyObject *__Pyx_GetBuiltinName(PyObject *name); static CYTHON_INLINE PyObject *__Pyx_GetModuleGlobalName(PyObject *name); #if CYTHON_COMPILING_IN_CPYTHON static CYTHON_INLINE PyObject* __Pyx_PyObject_Call(PyObject *func, PyObject *arg, PyObject *kw); #else #define __Pyx_PyObject_Call(func, arg, kw) PyObject_Call(func, arg, kw) #endif #if CYTHON_COMPILING_IN_CPYTHON static CYTHON_INLINE PyObject* __Pyx_PyObject_CallMethO(PyObject *func, PyObject *arg); #endif static CYTHON_INLINE PyObject* __Pyx_PyObject_CallOneArg(PyObject *func, PyObject *arg); #if CYTHON_COMPILING_IN_CPYTHON static CYTHON_INLINE PyObject* __Pyx_PyObject_CallNoArg(PyObject *func); #else #define __Pyx_PyObject_CallNoArg(func) __Pyx_PyObject_Call(func, __pyx_empty_tuple, NULL) #endif static CYTHON_INLINE void __Pyx_ErrRestore(PyObject *type, PyObject *value, PyObject *tb); static CYTHON_INLINE void __Pyx_ErrFetch(PyObject **type, PyObject **value, PyObject **tb); static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, PyObject *cause); #define __Pyx_GetItemInt(o, i, type, is_signed, to_py_func, is_list, wraparound, boundscheck)\ (__Pyx_fits_Py_ssize_t(i, type, is_signed) ?\ __Pyx_GetItemInt_Fast(o, (Py_ssize_t)i, is_list, wraparound, boundscheck) :\ (is_list ? (PyErr_SetString(PyExc_IndexError, "list index out of range"), (PyObject*)NULL) :\ __Pyx_GetItemInt_Generic(o, to_py_func(i)))) #define __Pyx_GetItemInt_List(o, i, type, is_signed, to_py_func, is_list, wraparound, boundscheck)\ (__Pyx_fits_Py_ssize_t(i, type, is_signed) ?\ __Pyx_GetItemInt_List_Fast(o, (Py_ssize_t)i, wraparound, boundscheck) :\ (PyErr_SetString(PyExc_IndexError, "list index out of range"), (PyObject*)NULL)) static CYTHON_INLINE PyObject *__Pyx_GetItemInt_List_Fast(PyObject *o, Py_ssize_t i, int wraparound, int boundscheck); #define __Pyx_GetItemInt_Tuple(o, i, type, is_signed, to_py_func, is_list, wraparound, boundscheck)\ (__Pyx_fits_Py_ssize_t(i, type, is_signed) ?\ __Pyx_GetItemInt_Tuple_Fast(o, (Py_ssize_t)i, wraparound, boundscheck) :\ (PyErr_SetString(PyExc_IndexError, "tuple index out of range"), (PyObject*)NULL)) static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Tuple_Fast(PyObject *o, Py_ssize_t i, int wraparound, int boundscheck); static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Generic(PyObject *o, PyObject* j); static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Fast(PyObject *o, Py_ssize_t i, int is_list, int wraparound, int boundscheck); #include static CYTHON_INLINE int __Pyx_PyBytes_Equals(PyObject* s1, PyObject* s2, int equals); static CYTHON_INLINE PyObject* __Pyx_PyObject_GetSlice( PyObject* obj, Py_ssize_t cstart, Py_ssize_t cstop, PyObject** py_start, PyObject** py_stop, PyObject** py_slice, int has_cstart, int has_cstop, int wraparound); static void __Pyx_RaiseDoubleKeywordsError(const char* func_name, PyObject* kw_name); static int __Pyx_ParseOptionalKeywords(PyObject *kwds, PyObject **argnames[],\ PyObject *kwds2, PyObject *values[], Py_ssize_t num_pos_args,\ const char* function_name); static void __Pyx_RaiseArgtupleInvalid(const char* func_name, int exact, Py_ssize_t num_min, Py_ssize_t num_max, Py_ssize_t num_found); static CYTHON_INLINE int __Pyx_PyUnicode_Equals(PyObject* s1, PyObject* s2, int equals); #if PY_MAJOR_VERSION >= 3 #define __Pyx_PyString_Equals __Pyx_PyUnicode_Equals #else #define __Pyx_PyString_Equals __Pyx_PyBytes_Equals #endif static CYTHON_INLINE void __Pyx_ExceptionSave(PyObject **type, PyObject **value, PyObject **tb); static void __Pyx_ExceptionReset(PyObject *type, PyObject *value, PyObject *tb); static int __Pyx_GetException(PyObject **type, PyObject **value, PyObject **tb); static CYTHON_INLINE int __Pyx_ArgTypeTest(PyObject *obj, PyTypeObject *type, int none_allowed, const char *name, int exact); static void* __Pyx_GetVtable(PyObject *dict); static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list, int level); static PyObject* __Pyx_ImportFrom(PyObject* module, PyObject* name); typedef struct { int code_line; PyCodeObject* code_object; } __Pyx_CodeObjectCacheEntry; struct __Pyx_CodeObjectCache { int count; int max_count; __Pyx_CodeObjectCacheEntry* entries; }; static struct __Pyx_CodeObjectCache __pyx_code_cache = {0,0,NULL}; static int __pyx_bisect_code_objects(__Pyx_CodeObjectCacheEntry* entries, int count, int code_line); static PyCodeObject *__pyx_find_code_object(int code_line); static void __pyx_insert_code_object(int code_line, PyCodeObject* code_object); static void __Pyx_AddTraceback(const char *funcname, int c_line, int py_line, const char *filename); static CYTHON_INLINE PyObject* __Pyx_PyInt_From_long(long value); #ifndef __PYX_FORCE_INIT_THREADS #define __PYX_FORCE_INIT_THREADS 0 #endif static CYTHON_INLINE int __Pyx_PyInt_As_int(PyObject *); static CYTHON_INLINE long __Pyx_PyInt_As_long(PyObject *); static int __Pyx_check_binary_version(void); #if !defined(__Pyx_PyIdentifier_FromString) #if PY_MAJOR_VERSION < 3 #define __Pyx_PyIdentifier_FromString(s) PyString_FromString(s) #else #define __Pyx_PyIdentifier_FromString(s) PyUnicode_FromString(s) #endif #endif static PyObject *__Pyx_ImportModule(const char *name); static PyTypeObject *__Pyx_ImportType(const char *module_name, const char *class_name, size_t size, int strict); static int __Pyx_ImportFunction(PyObject *module, const char *funcname, void (**f)(void), const char *sig); static int __Pyx_InitStrings(__Pyx_StringTabEntry *t); /* Module declarations from 'libc.stdint' */ /* Module declarations from 'libc.string' */ /* Module declarations from 'libc.stdio' */ /* Module declarations from 'libc.stddef' */ /* Module declarations from 'sdl2' */ /* Module declarations from 'sdl2_image' */ /* Module declarations from 'pygame_sdl2.surface' */ static PyTypeObject *__pyx_ptype_11pygame_sdl2_7surface_Surface = 0; /* Module declarations from 'pygame_sdl2.rwobject' */ static SDL_RWops *(*__pyx_f_11pygame_sdl2_8rwobject_to_rwops)(PyObject *, struct __pyx_opt_args_11pygame_sdl2_8rwobject_to_rwops *__pyx_optional_args); /*proto*/ /* Module declarations from 'pygame_sdl2.image' */ static int __pyx_v_11pygame_sdl2_5image_image_formats; static PyObject *__pyx_f_11pygame_sdl2_5image_process_namehint(PyObject *); /*proto*/ #define __Pyx_MODULE_NAME "pygame_sdl2.image" int __pyx_module_is_main_pygame_sdl2__image = 0; /* Implementation of 'pygame_sdl2.image' */ static PyObject *__pyx_builtin_ValueError; static char __pyx_k_n[] = "n"; static char __pyx_k__2[] = ""; static char __pyx_k__3[] = "."; static char __pyx_k_fi[] = "fi"; static char __pyx_k_fn[] = "fn"; static char __pyx_k_os[] = "os"; static char __pyx_k_wb[] = "wb"; static char __pyx_k_BMP[] = ".BMP"; static char __pyx_k_JPG[] = ".JPG"; static char __pyx_k_PNG[] = ".PNG"; static char __pyx_k_TGA[] = "TGA"; static char __pyx_k_err[] = "err"; static char __pyx_k_ext[] = "ext"; static char __pyx_k_img[] = "img"; static char __pyx_k_tga[] = ".tga"; static char __pyx_k_JPEG[] = ".JPEG"; static char __pyx_k_init[] = "init"; static char __pyx_k_load[] = "load"; static char __pyx_k_main[] = "__main__"; static char __pyx_k_path[] = "path"; static char __pyx_k_quit[] = "quit"; static char __pyx_k_save[] = "save"; static char __pyx_k_surf[] = "surf"; static char __pyx_k_test[] = "__test__"; static char __pyx_k_ascii[] = "ascii"; static char __pyx_k_bytes[] = "bytes_"; static char __pyx_k_error[] = "error"; static char __pyx_k_ftype[] = "ftype"; static char __pyx_k_lower[] = "lower"; static char __pyx_k_rwops[] = "rwops"; static char __pyx_k_upper[] = "upper"; static char __pyx_k_encode[] = "encode"; static char __pyx_k_import[] = "__import__"; static char __pyx_k_convert[] = "convert"; static char __pyx_k_replace[] = "replace"; static char __pyx_k_surface[] = "surface"; static char __pyx_k_unicode[] = "unicode_"; static char __pyx_k_endswith[] = "endswith"; static char __pyx_k_filename[] = "filename"; static char __pyx_k_namehint[] = "namehint"; static char __pyx_k_splitext[] = "splitext"; static char __pyx_k_has_alpha[] = "has_alpha"; static char __pyx_k_ValueError[] = "ValueError"; static char __pyx_k_pyx_vtable[] = "__pyx_vtable__"; static char __pyx_k_compression[] = "compression"; static char __pyx_k_pygame_sdl2[] = "pygame_sdl2"; static char __pyx_k_get_extended[] = "get_extended"; static char __pyx_k_convert_alpha[] = "convert_alpha"; static char __pyx_k_compression_level[] = "compression_level"; static char __pyx_k_filesystem_encode[] = "filesystem_encode"; static char __pyx_k_pygame_sdl2_error[] = "pygame_sdl2.error"; static char __pyx_k_pygame_sdl2_image[] = "pygame_sdl2.image"; static char __pyx_k_pygame_sdl2_compat[] = "pygame_sdl2.compat"; static char __pyx_k_Unsupported_format_s[] = "Unsupported format: %s"; static char __pyx_k_home_tom_ab_pygame_sdl2_src_pyg[] = "/home/tom/ab/pygame_sdl2/src/pygame_sdl2/image.pyx"; static PyObject *__pyx_kp_b_BMP; static PyObject *__pyx_kp_b_JPEG; static PyObject *__pyx_kp_b_JPG; static PyObject *__pyx_kp_b_PNG; static PyObject *__pyx_n_s_TGA; static PyObject *__pyx_kp_s_Unsupported_format_s; static PyObject *__pyx_n_s_ValueError; static PyObject *__pyx_kp_b__2; static PyObject *__pyx_kp_s__2; static PyObject *__pyx_kp_b__3; static PyObject *__pyx_n_s_ascii; static PyObject *__pyx_n_s_bytes; static PyObject *__pyx_n_s_compression; static PyObject *__pyx_n_s_compression_level; static PyObject *__pyx_n_s_convert; static PyObject *__pyx_n_s_convert_alpha; static PyObject *__pyx_n_s_encode; static PyObject *__pyx_n_s_endswith; static PyObject *__pyx_n_s_err; static PyObject *__pyx_n_s_error; static PyObject *__pyx_n_s_ext; static PyObject *__pyx_n_s_fi; static PyObject *__pyx_n_s_filename; static PyObject *__pyx_n_s_filesystem_encode; static PyObject *__pyx_n_s_fn; static PyObject *__pyx_n_s_ftype; static PyObject *__pyx_n_s_get_extended; static PyObject *__pyx_n_s_has_alpha; static PyObject *__pyx_kp_s_home_tom_ab_pygame_sdl2_src_pyg; static PyObject *__pyx_n_s_img; static PyObject *__pyx_n_s_import; static PyObject *__pyx_n_s_init; static PyObject *__pyx_n_s_load; static PyObject *__pyx_n_s_lower; static PyObject *__pyx_n_s_main; static PyObject *__pyx_n_s_n; static PyObject *__pyx_n_s_namehint; static PyObject *__pyx_n_s_os; static PyObject *__pyx_n_s_path; static PyObject *__pyx_n_s_pygame_sdl2; static PyObject *__pyx_n_s_pygame_sdl2_compat; static PyObject *__pyx_n_s_pygame_sdl2_error; static PyObject *__pyx_n_s_pygame_sdl2_image; static PyObject *__pyx_n_s_pyx_vtable; static PyObject *__pyx_n_s_quit; static PyObject *__pyx_n_s_replace; static PyObject *__pyx_n_s_rwops; static PyObject *__pyx_n_s_save; static PyObject *__pyx_n_s_splitext; static PyObject *__pyx_n_s_surf; static PyObject *__pyx_n_s_surface; static PyObject *__pyx_n_s_test; static PyObject *__pyx_kp_s_tga; static PyObject *__pyx_n_s_unicode; static PyObject *__pyx_n_s_upper; static PyObject *__pyx_n_s_wb; static PyObject *__pyx_pf_11pygame_sdl2_5image_init(CYTHON_UNUSED PyObject *__pyx_self); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_5image_2quit(CYTHON_UNUSED PyObject *__pyx_self); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_5image_4load(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_fi, PyObject *__pyx_v_namehint); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_5image_6save(CYTHON_UNUSED PyObject *__pyx_self, struct __pyx_obj_11pygame_sdl2_7surface_Surface *__pyx_v_surface, PyObject *__pyx_v_filename, PyObject *__pyx_v_compression); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_5image_8get_extended(CYTHON_UNUSED PyObject *__pyx_self); /* proto */ static PyObject *__pyx_int_1; static PyObject *__pyx_int_neg_1; static PyObject *__pyx_tuple_; static PyObject *__pyx_slice__4; static PyObject *__pyx_tuple__5; static PyObject *__pyx_tuple__6; static PyObject *__pyx_tuple__9; static PyObject *__pyx_tuple__11; static PyObject *__pyx_codeobj__7; static PyObject *__pyx_codeobj__8; static PyObject *__pyx_codeobj__10; static PyObject *__pyx_codeobj__12; static PyObject *__pyx_codeobj__13; /* "pygame_sdl2/image.pyx":33 * cdef int image_formats = 0 * * def init(): # <<<<<<<<<<<<<< * global image_formats * image_formats = IMG_Init(IMG_INIT_JPG | IMG_INIT_PNG | IMG_INIT_TIF | IMG_INIT_WEBP) */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_5image_1init(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused); /*proto*/ static PyMethodDef __pyx_mdef_11pygame_sdl2_5image_1init = {"init", (PyCFunction)__pyx_pw_11pygame_sdl2_5image_1init, METH_NOARGS, 0}; static PyObject *__pyx_pw_11pygame_sdl2_5image_1init(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("init (wrapper)", 0); __pyx_r = __pyx_pf_11pygame_sdl2_5image_init(__pyx_self); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_5image_init(CYTHON_UNUSED PyObject *__pyx_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("init", 0); /* "pygame_sdl2/image.pyx":35 * def init(): * global image_formats * image_formats = IMG_Init(IMG_INIT_JPG | IMG_INIT_PNG | IMG_INIT_TIF | IMG_INIT_WEBP) # <<<<<<<<<<<<<< * if image_formats == 0: * raise error() */ __pyx_v_11pygame_sdl2_5image_image_formats = IMG_Init((((IMG_INIT_JPG | IMG_INIT_PNG) | IMG_INIT_TIF) | IMG_INIT_WEBP)); /* "pygame_sdl2/image.pyx":36 * global image_formats * image_formats = IMG_Init(IMG_INIT_JPG | IMG_INIT_PNG | IMG_INIT_TIF | IMG_INIT_WEBP) * if image_formats == 0: # <<<<<<<<<<<<<< * raise error() * */ __pyx_t_1 = ((__pyx_v_11pygame_sdl2_5image_image_formats == 0) != 0); if (__pyx_t_1) { /* "pygame_sdl2/image.pyx":37 * image_formats = IMG_Init(IMG_INIT_JPG | IMG_INIT_PNG | IMG_INIT_TIF | IMG_INIT_WEBP) * if image_formats == 0: * raise error() # <<<<<<<<<<<<<< * * init() */ __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_error); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 37; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = NULL; if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_3))) { __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3); if (likely(__pyx_t_4)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); __Pyx_INCREF(__pyx_t_4); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_3, function); } } if (__pyx_t_4) { __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 37; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; } else { __pyx_t_2 = __Pyx_PyObject_CallNoArg(__pyx_t_3); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 37; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_Raise(__pyx_t_2, 0, 0, 0); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; {__pyx_filename = __pyx_f[0]; __pyx_lineno = 37; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "pygame_sdl2/image.pyx":36 * global image_formats * image_formats = IMG_Init(IMG_INIT_JPG | IMG_INIT_PNG | IMG_INIT_TIF | IMG_INIT_WEBP) * if image_formats == 0: # <<<<<<<<<<<<<< * raise error() * */ } /* "pygame_sdl2/image.pyx":33 * cdef int image_formats = 0 * * def init(): # <<<<<<<<<<<<<< * global image_formats * image_formats = IMG_Init(IMG_INIT_JPG | IMG_INIT_PNG | IMG_INIT_TIF | IMG_INIT_WEBP) */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_AddTraceback("pygame_sdl2.image.init", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/image.pyx":41 * init() * * def quit(): # @ReservedAssignment # <<<<<<<<<<<<<< * IMG_Quit() * */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_5image_3quit(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused); /*proto*/ static PyMethodDef __pyx_mdef_11pygame_sdl2_5image_3quit = {"quit", (PyCFunction)__pyx_pw_11pygame_sdl2_5image_3quit, METH_NOARGS, 0}; static PyObject *__pyx_pw_11pygame_sdl2_5image_3quit(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("quit (wrapper)", 0); __pyx_r = __pyx_pf_11pygame_sdl2_5image_2quit(__pyx_self); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_5image_2quit(CYTHON_UNUSED PyObject *__pyx_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("quit", 0); /* "pygame_sdl2/image.pyx":42 * * def quit(): # @ReservedAssignment * IMG_Quit() # <<<<<<<<<<<<<< * * cdef process_namehint(namehint): */ IMG_Quit(); /* "pygame_sdl2/image.pyx":41 * init() * * def quit(): # @ReservedAssignment # <<<<<<<<<<<<<< * IMG_Quit() * */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/image.pyx":44 * IMG_Quit() * * cdef process_namehint(namehint): # <<<<<<<<<<<<<< * # Accepts "foo.png", ".png", or "png" * */ static PyObject *__pyx_f_11pygame_sdl2_5image_process_namehint(PyObject *__pyx_v_namehint) { PyObject *__pyx_v_ext = NULL; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_t_2; int __pyx_t_3; PyObject *__pyx_t_4 = NULL; PyObject *__pyx_t_5 = NULL; PyObject *__pyx_t_6 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("process_namehint", 0); __Pyx_INCREF(__pyx_v_namehint); /* "pygame_sdl2/image.pyx":47 * # Accepts "foo.png", ".png", or "png" * * if not isinstance(namehint, bytes_): # <<<<<<<<<<<<<< * namehint = namehint.encode("ascii", "replace") * */ __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_bytes); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 47; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = PyObject_IsInstance(__pyx_v_namehint, __pyx_t_1); if (unlikely(__pyx_t_2 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 47; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_3 = ((!(__pyx_t_2 != 0)) != 0); if (__pyx_t_3) { /* "pygame_sdl2/image.pyx":48 * * if not isinstance(namehint, bytes_): * namehint = namehint.encode("ascii", "replace") # <<<<<<<<<<<<<< * * if not namehint: */ __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_namehint, __pyx_n_s_encode); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 48; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_tuple_, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 48; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF_SET(__pyx_v_namehint, __pyx_t_4); __pyx_t_4 = 0; /* "pygame_sdl2/image.pyx":47 * # Accepts "foo.png", ".png", or "png" * * if not isinstance(namehint, bytes_): # <<<<<<<<<<<<<< * namehint = namehint.encode("ascii", "replace") * */ } /* "pygame_sdl2/image.pyx":50 * namehint = namehint.encode("ascii", "replace") * * if not namehint: # <<<<<<<<<<<<<< * return b'' * */ __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_v_namehint); if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 50; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_t_2 = ((!__pyx_t_3) != 0); if (__pyx_t_2) { /* "pygame_sdl2/image.pyx":51 * * if not namehint: * return b'' # <<<<<<<<<<<<<< * * ext = os.path.splitext(namehint)[1] */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(__pyx_kp_b__2); __pyx_r = __pyx_kp_b__2; goto __pyx_L0; /* "pygame_sdl2/image.pyx":50 * namehint = namehint.encode("ascii", "replace") * * if not namehint: # <<<<<<<<<<<<<< * return b'' * */ } /* "pygame_sdl2/image.pyx":53 * return b'' * * ext = os.path.splitext(namehint)[1] # <<<<<<<<<<<<<< * if not ext: * ext = namehint */ __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_os); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 53; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_path); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 53; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_splitext); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 53; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __pyx_t_5 = NULL; if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_1))) { __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_1); if (likely(__pyx_t_5)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1); __Pyx_INCREF(__pyx_t_5); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_1, function); } } if (!__pyx_t_5) { __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_t_1, __pyx_v_namehint); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 53; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); } else { __pyx_t_6 = PyTuple_New(1+1); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 53; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_6); __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_5); __pyx_t_5 = NULL; __Pyx_INCREF(__pyx_v_namehint); __Pyx_GIVEREF(__pyx_v_namehint); PyTuple_SET_ITEM(__pyx_t_6, 0+1, __pyx_v_namehint); __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_6, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 53; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_1 = __Pyx_GetItemInt(__pyx_t_4, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(__pyx_t_1 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 53; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_v_ext = __pyx_t_1; __pyx_t_1 = 0; /* "pygame_sdl2/image.pyx":54 * * ext = os.path.splitext(namehint)[1] * if not ext: # <<<<<<<<<<<<<< * ext = namehint * if ext[0] == b'.': */ __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_v_ext); if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 54; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_t_3 = ((!__pyx_t_2) != 0); if (__pyx_t_3) { /* "pygame_sdl2/image.pyx":55 * ext = os.path.splitext(namehint)[1] * if not ext: * ext = namehint # <<<<<<<<<<<<<< * if ext[0] == b'.': * ext = ext[1:] */ __Pyx_INCREF(__pyx_v_namehint); __Pyx_DECREF_SET(__pyx_v_ext, __pyx_v_namehint); /* "pygame_sdl2/image.pyx":54 * * ext = os.path.splitext(namehint)[1] * if not ext: # <<<<<<<<<<<<<< * ext = namehint * if ext[0] == b'.': */ } /* "pygame_sdl2/image.pyx":56 * if not ext: * ext = namehint * if ext[0] == b'.': # <<<<<<<<<<<<<< * ext = ext[1:] * */ __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_ext, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(__pyx_t_1 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 56; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; __Pyx_GOTREF(__pyx_t_1); __pyx_t_3 = (__Pyx_PyBytes_Equals(__pyx_t_1, __pyx_kp_b__3, Py_EQ)); if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 56; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (__pyx_t_3) { /* "pygame_sdl2/image.pyx":57 * ext = namehint * if ext[0] == b'.': * ext = ext[1:] # <<<<<<<<<<<<<< * * return ext.upper() */ __pyx_t_1 = __Pyx_PyObject_GetSlice(__pyx_v_ext, 1, 0, NULL, NULL, &__pyx_slice__4, 1, 0, 1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 57; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF_SET(__pyx_v_ext, __pyx_t_1); __pyx_t_1 = 0; /* "pygame_sdl2/image.pyx":56 * if not ext: * ext = namehint * if ext[0] == b'.': # <<<<<<<<<<<<<< * ext = ext[1:] * */ } /* "pygame_sdl2/image.pyx":59 * ext = ext[1:] * * return ext.upper() # <<<<<<<<<<<<<< * * def load(fi, namehint=""): */ __Pyx_XDECREF(__pyx_r); __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_ext, __pyx_n_s_upper); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 59; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); __pyx_t_6 = NULL; if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_4))) { __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_4); if (likely(__pyx_t_6)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4); __Pyx_INCREF(__pyx_t_6); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_4, function); } } if (__pyx_t_6) { __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_6); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 59; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; } else { __pyx_t_1 = __Pyx_PyObject_CallNoArg(__pyx_t_4); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 59; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "pygame_sdl2/image.pyx":44 * IMG_Quit() * * cdef process_namehint(namehint): # <<<<<<<<<<<<<< * # Accepts "foo.png", ".png", or "png" * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_5); __Pyx_XDECREF(__pyx_t_6); __Pyx_AddTraceback("pygame_sdl2.image.process_namehint", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XDECREF(__pyx_v_ext); __Pyx_XDECREF(__pyx_v_namehint); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/image.pyx":61 * return ext.upper() * * def load(fi, namehint=""): # <<<<<<<<<<<<<< * cdef SDL_Surface *img * */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_5image_5load(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static PyMethodDef __pyx_mdef_11pygame_sdl2_5image_5load = {"load", (PyCFunction)__pyx_pw_11pygame_sdl2_5image_5load, METH_VARARGS|METH_KEYWORDS, 0}; static PyObject *__pyx_pw_11pygame_sdl2_5image_5load(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_fi = 0; PyObject *__pyx_v_namehint = 0; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("load (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_fi,&__pyx_n_s_namehint,0}; PyObject* values[2] = {0,0}; values[1] = ((PyObject *)__pyx_kp_s__2); if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_fi)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; case 1: if (kw_args > 0) { PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_namehint); if (value) { values[1] = value; kw_args--; } } } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "load") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 61; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } } else { switch (PyTuple_GET_SIZE(__pyx_args)) { case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_fi = values[0]; __pyx_v_namehint = values[1]; } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("load", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 61; __pyx_clineno = __LINE__; goto __pyx_L3_error;} __pyx_L3_error:; __Pyx_AddTraceback("pygame_sdl2.image.load", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_11pygame_sdl2_5image_4load(__pyx_self, __pyx_v_fi, __pyx_v_namehint); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_5image_4load(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_fi, PyObject *__pyx_v_namehint) { SDL_Surface *__pyx_v_img; SDL_RWops *__pyx_v_rwops; char *__pyx_v_ftype; struct __pyx_obj_11pygame_sdl2_7surface_Surface *__pyx_v_surf = 0; int __pyx_v_n; int __pyx_v_has_alpha; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; int __pyx_t_2; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; PyObject *__pyx_t_5 = NULL; SDL_RWops *__pyx_t_6; char *__pyx_t_7; PyObject *__pyx_t_8 = NULL; PyObject *__pyx_t_9 = NULL; PyObject *__pyx_t_10 = NULL; int __pyx_t_11; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("load", 0); __Pyx_INCREF(__pyx_v_namehint); /* "pygame_sdl2/image.pyx":68 * * # IMG_Load_RW can't load TGA images. * if isinstance(fi, str): # <<<<<<<<<<<<<< * if fi.lower().endswith('.tga'): * namehint = "TGA" */ __pyx_t_1 = PyString_Check(__pyx_v_fi); __pyx_t_2 = (__pyx_t_1 != 0); if (__pyx_t_2) { /* "pygame_sdl2/image.pyx":69 * # IMG_Load_RW can't load TGA images. * if isinstance(fi, str): * if fi.lower().endswith('.tga'): # <<<<<<<<<<<<<< * namehint = "TGA" * */ __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_fi, __pyx_n_s_lower); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 69; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); __pyx_t_5 = NULL; if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_4))) { __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4); if (likely(__pyx_t_5)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4); __Pyx_INCREF(__pyx_t_5); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_4, function); } } if (__pyx_t_5) { __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_5); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 69; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; } else { __pyx_t_3 = __Pyx_PyObject_CallNoArg(__pyx_t_4); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 69; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_endswith); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 69; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_tuple__5, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 69; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 69; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; if (__pyx_t_2) { /* "pygame_sdl2/image.pyx":70 * if isinstance(fi, str): * if fi.lower().endswith('.tga'): * namehint = "TGA" # <<<<<<<<<<<<<< * * rwops = to_rwops(fi) */ __Pyx_INCREF(__pyx_n_s_TGA); __Pyx_DECREF_SET(__pyx_v_namehint, __pyx_n_s_TGA); /* "pygame_sdl2/image.pyx":69 * # IMG_Load_RW can't load TGA images. * if isinstance(fi, str): * if fi.lower().endswith('.tga'): # <<<<<<<<<<<<<< * namehint = "TGA" * */ } /* "pygame_sdl2/image.pyx":68 * * # IMG_Load_RW can't load TGA images. * if isinstance(fi, str): # <<<<<<<<<<<<<< * if fi.lower().endswith('.tga'): * namehint = "TGA" */ } /* "pygame_sdl2/image.pyx":72 * namehint = "TGA" * * rwops = to_rwops(fi) # <<<<<<<<<<<<<< * * if namehint == "": */ __pyx_t_6 = __pyx_f_11pygame_sdl2_8rwobject_to_rwops(__pyx_v_fi, NULL); if (unlikely(__pyx_t_6 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 72; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_v_rwops = __pyx_t_6; /* "pygame_sdl2/image.pyx":74 * rwops = to_rwops(fi) * * if namehint == "": # <<<<<<<<<<<<<< * with nogil: * img = IMG_Load_RW(rwops, 1) */ __pyx_t_2 = (__Pyx_PyString_Equals(__pyx_v_namehint, __pyx_kp_s__2, Py_EQ)); if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 74; __pyx_clineno = __LINE__; goto __pyx_L1_error;} if (__pyx_t_2) { /* "pygame_sdl2/image.pyx":75 * * if namehint == "": * with nogil: # <<<<<<<<<<<<<< * img = IMG_Load_RW(rwops, 1) * */ { #ifdef WITH_THREAD PyThreadState *_save; Py_UNBLOCK_THREADS #endif /*try:*/ { /* "pygame_sdl2/image.pyx":76 * if namehint == "": * with nogil: * img = IMG_Load_RW(rwops, 1) # <<<<<<<<<<<<<< * * else: */ __pyx_v_img = IMG_Load_RW(__pyx_v_rwops, 1); } /* "pygame_sdl2/image.pyx":75 * * if namehint == "": * with nogil: # <<<<<<<<<<<<<< * img = IMG_Load_RW(rwops, 1) * */ /*finally:*/ { /*normal exit:*/{ #ifdef WITH_THREAD Py_BLOCK_THREADS #endif goto __pyx_L8; } __pyx_L8:; } } /* "pygame_sdl2/image.pyx":74 * rwops = to_rwops(fi) * * if namehint == "": # <<<<<<<<<<<<<< * with nogil: * img = IMG_Load_RW(rwops, 1) */ goto __pyx_L5; } /* "pygame_sdl2/image.pyx":79 * * else: * namehint = process_namehint(namehint) # <<<<<<<<<<<<<< * ftype = namehint * */ /*else*/ { __pyx_t_3 = __pyx_f_11pygame_sdl2_5image_process_namehint(__pyx_v_namehint); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 79; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF_SET(__pyx_v_namehint, __pyx_t_3); __pyx_t_3 = 0; /* "pygame_sdl2/image.pyx":80 * else: * namehint = process_namehint(namehint) * ftype = namehint # <<<<<<<<<<<<<< * * with nogil: */ __pyx_t_7 = __Pyx_PyObject_AsString(__pyx_v_namehint); if (unlikely((!__pyx_t_7) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 80; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_v_ftype = __pyx_t_7; /* "pygame_sdl2/image.pyx":82 * ftype = namehint * * with nogil: # <<<<<<<<<<<<<< * img = IMG_LoadTyped_RW(rwops, 1, ftype) * */ { #ifdef WITH_THREAD PyThreadState *_save; Py_UNBLOCK_THREADS #endif /*try:*/ { /* "pygame_sdl2/image.pyx":83 * * with nogil: * img = IMG_LoadTyped_RW(rwops, 1, ftype) # <<<<<<<<<<<<<< * * if img == NULL: */ __pyx_v_img = IMG_LoadTyped_RW(__pyx_v_rwops, 1, __pyx_v_ftype); } /* "pygame_sdl2/image.pyx":82 * ftype = namehint * * with nogil: # <<<<<<<<<<<<<< * img = IMG_LoadTyped_RW(rwops, 1, ftype) * */ /*finally:*/ { /*normal exit:*/{ #ifdef WITH_THREAD Py_BLOCK_THREADS #endif goto __pyx_L11; } __pyx_L11:; } } } __pyx_L5:; /* "pygame_sdl2/image.pyx":85 * img = IMG_LoadTyped_RW(rwops, 1, ftype) * * if img == NULL: # <<<<<<<<<<<<<< * raise error() * */ __pyx_t_2 = ((__pyx_v_img == NULL) != 0); if (__pyx_t_2) { /* "pygame_sdl2/image.pyx":86 * * if img == NULL: * raise error() # <<<<<<<<<<<<<< * * cdef Surface surf = Surface(()) */ __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_error); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 86; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); __pyx_t_5 = NULL; if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_4))) { __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4); if (likely(__pyx_t_5)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4); __Pyx_INCREF(__pyx_t_5); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_4, function); } } if (__pyx_t_5) { __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_5); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 86; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; } else { __pyx_t_3 = __Pyx_PyObject_CallNoArg(__pyx_t_4); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 86; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_Raise(__pyx_t_3, 0, 0, 0); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; {__pyx_filename = __pyx_f[0]; __pyx_lineno = 86; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "pygame_sdl2/image.pyx":85 * img = IMG_LoadTyped_RW(rwops, 1, ftype) * * if img == NULL: # <<<<<<<<<<<<<< * raise error() * */ } /* "pygame_sdl2/image.pyx":88 * raise error() * * cdef Surface surf = Surface(()) # <<<<<<<<<<<<<< * surf.take_surface(img) * */ __pyx_t_3 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_11pygame_sdl2_7surface_Surface), __pyx_tuple__6, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 88; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __pyx_v_surf = ((struct __pyx_obj_11pygame_sdl2_7surface_Surface *)__pyx_t_3); __pyx_t_3 = 0; /* "pygame_sdl2/image.pyx":89 * * cdef Surface surf = Surface(()) * surf.take_surface(img) # <<<<<<<<<<<<<< * * if img.format.BitsPerPixel == 32: */ ((struct __pyx_vtabstruct_11pygame_sdl2_7surface_Surface *)__pyx_v_surf->__pyx_vtab)->take_surface(__pyx_v_surf, __pyx_v_img); /* "pygame_sdl2/image.pyx":91 * surf.take_surface(img) * * if img.format.BitsPerPixel == 32: # <<<<<<<<<<<<<< * return surf * */ __pyx_t_2 = ((__pyx_v_img->format->BitsPerPixel == 32) != 0); if (__pyx_t_2) { /* "pygame_sdl2/image.pyx":92 * * if img.format.BitsPerPixel == 32: * return surf # <<<<<<<<<<<<<< * * cdef int n = 0 */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(((PyObject *)__pyx_v_surf)); __pyx_r = ((PyObject *)__pyx_v_surf); goto __pyx_L0; /* "pygame_sdl2/image.pyx":91 * surf.take_surface(img) * * if img.format.BitsPerPixel == 32: # <<<<<<<<<<<<<< * return surf * */ } /* "pygame_sdl2/image.pyx":94 * return surf * * cdef int n = 0 # <<<<<<<<<<<<<< * has_alpha = False * */ __pyx_v_n = 0; /* "pygame_sdl2/image.pyx":95 * * cdef int n = 0 * has_alpha = False # <<<<<<<<<<<<<< * * if img.format.Amask: */ __pyx_v_has_alpha = 0; /* "pygame_sdl2/image.pyx":97 * has_alpha = False * * if img.format.Amask: # <<<<<<<<<<<<<< * has_alpha = True * elif (img.format.format >> 24) & SDL_PIXELTYPE_INDEX1: */ __pyx_t_2 = (__pyx_v_img->format->Amask != 0); if (__pyx_t_2) { /* "pygame_sdl2/image.pyx":98 * * if img.format.Amask: * has_alpha = True # <<<<<<<<<<<<<< * elif (img.format.format >> 24) & SDL_PIXELTYPE_INDEX1: * has_alpha = True */ __pyx_v_has_alpha = 1; /* "pygame_sdl2/image.pyx":97 * has_alpha = False * * if img.format.Amask: # <<<<<<<<<<<<<< * has_alpha = True * elif (img.format.format >> 24) & SDL_PIXELTYPE_INDEX1: */ goto __pyx_L14; } /* "pygame_sdl2/image.pyx":99 * if img.format.Amask: * has_alpha = True * elif (img.format.format >> 24) & SDL_PIXELTYPE_INDEX1: # <<<<<<<<<<<<<< * has_alpha = True * elif img.format.palette != NULL: */ __pyx_t_2 = (((__pyx_v_img->format->format >> 24) & SDL_PIXELTYPE_INDEX1) != 0); if (__pyx_t_2) { /* "pygame_sdl2/image.pyx":100 * has_alpha = True * elif (img.format.format >> 24) & SDL_PIXELTYPE_INDEX1: * has_alpha = True # <<<<<<<<<<<<<< * elif img.format.palette != NULL: * # Check for non-opaque palette colors. */ __pyx_v_has_alpha = 1; /* "pygame_sdl2/image.pyx":99 * if img.format.Amask: * has_alpha = True * elif (img.format.format >> 24) & SDL_PIXELTYPE_INDEX1: # <<<<<<<<<<<<<< * has_alpha = True * elif img.format.palette != NULL: */ goto __pyx_L14; } /* "pygame_sdl2/image.pyx":101 * elif (img.format.format >> 24) & SDL_PIXELTYPE_INDEX1: * has_alpha = True * elif img.format.palette != NULL: # <<<<<<<<<<<<<< * # Check for non-opaque palette colors. * while n < img.format.palette.ncolors: */ __pyx_t_2 = ((__pyx_v_img->format->palette != NULL) != 0); if (__pyx_t_2) { /* "pygame_sdl2/image.pyx":103 * elif img.format.palette != NULL: * # Check for non-opaque palette colors. * while n < img.format.palette.ncolors: # <<<<<<<<<<<<<< * if img.format.palette.colors[n].a != 255: * has_alpha = True */ while (1) { __pyx_t_2 = ((__pyx_v_n < __pyx_v_img->format->palette->ncolors) != 0); if (!__pyx_t_2) break; /* "pygame_sdl2/image.pyx":104 * # Check for non-opaque palette colors. * while n < img.format.palette.ncolors: * if img.format.palette.colors[n].a != 255: # <<<<<<<<<<<<<< * has_alpha = True * break */ __pyx_t_2 = (((__pyx_v_img->format->palette->colors[__pyx_v_n]).a != 0xFF) != 0); if (__pyx_t_2) { /* "pygame_sdl2/image.pyx":105 * while n < img.format.palette.ncolors: * if img.format.palette.colors[n].a != 255: * has_alpha = True # <<<<<<<<<<<<<< * break * n += 1 */ __pyx_v_has_alpha = 1; /* "pygame_sdl2/image.pyx":106 * if img.format.palette.colors[n].a != 255: * has_alpha = True * break # <<<<<<<<<<<<<< * n += 1 * */ goto __pyx_L16_break; /* "pygame_sdl2/image.pyx":104 * # Check for non-opaque palette colors. * while n < img.format.palette.ncolors: * if img.format.palette.colors[n].a != 255: # <<<<<<<<<<<<<< * has_alpha = True * break */ } /* "pygame_sdl2/image.pyx":107 * has_alpha = True * break * n += 1 # <<<<<<<<<<<<<< * * try: */ __pyx_v_n = (__pyx_v_n + 1); } __pyx_L16_break:; /* "pygame_sdl2/image.pyx":101 * elif (img.format.format >> 24) & SDL_PIXELTYPE_INDEX1: * has_alpha = True * elif img.format.palette != NULL: # <<<<<<<<<<<<<< * # Check for non-opaque palette colors. * while n < img.format.palette.ncolors: */ } __pyx_L14:; /* "pygame_sdl2/image.pyx":109 * n += 1 * * try: # <<<<<<<<<<<<<< * if has_alpha: * return surf.convert_alpha() */ { __Pyx_ExceptionSave(&__pyx_t_8, &__pyx_t_9, &__pyx_t_10); __Pyx_XGOTREF(__pyx_t_8); __Pyx_XGOTREF(__pyx_t_9); __Pyx_XGOTREF(__pyx_t_10); /*try:*/ { /* "pygame_sdl2/image.pyx":110 * * try: * if has_alpha: # <<<<<<<<<<<<<< * return surf.convert_alpha() * else: */ __pyx_t_2 = (__pyx_v_has_alpha != 0); if (__pyx_t_2) { /* "pygame_sdl2/image.pyx":111 * try: * if has_alpha: * return surf.convert_alpha() # <<<<<<<<<<<<<< * else: * return surf.convert() */ __Pyx_XDECREF(__pyx_r); __pyx_t_4 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_surf), __pyx_n_s_convert_alpha); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 111; __pyx_clineno = __LINE__; goto __pyx_L18_error;} __Pyx_GOTREF(__pyx_t_4); __pyx_t_5 = NULL; if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_4))) { __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4); if (likely(__pyx_t_5)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4); __Pyx_INCREF(__pyx_t_5); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_4, function); } } if (__pyx_t_5) { __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_5); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 111; __pyx_clineno = __LINE__; goto __pyx_L18_error;} __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; } else { __pyx_t_3 = __Pyx_PyObject_CallNoArg(__pyx_t_4); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 111; __pyx_clineno = __LINE__; goto __pyx_L18_error;} } __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_r = __pyx_t_3; __pyx_t_3 = 0; goto __pyx_L22_try_return; /* "pygame_sdl2/image.pyx":110 * * try: * if has_alpha: # <<<<<<<<<<<<<< * return surf.convert_alpha() * else: */ } /* "pygame_sdl2/image.pyx":113 * return surf.convert_alpha() * else: * return surf.convert() # <<<<<<<<<<<<<< * except error: * return surf */ /*else*/ { __Pyx_XDECREF(__pyx_r); __pyx_t_4 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_surf), __pyx_n_s_convert); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 113; __pyx_clineno = __LINE__; goto __pyx_L18_error;} __Pyx_GOTREF(__pyx_t_4); __pyx_t_5 = NULL; if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_4))) { __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4); if (likely(__pyx_t_5)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4); __Pyx_INCREF(__pyx_t_5); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_4, function); } } if (__pyx_t_5) { __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_5); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 113; __pyx_clineno = __LINE__; goto __pyx_L18_error;} __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; } else { __pyx_t_3 = __Pyx_PyObject_CallNoArg(__pyx_t_4); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 113; __pyx_clineno = __LINE__; goto __pyx_L18_error;} } __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_r = __pyx_t_3; __pyx_t_3 = 0; goto __pyx_L22_try_return; } /* "pygame_sdl2/image.pyx":109 * n += 1 * * try: # <<<<<<<<<<<<<< * if has_alpha: * return surf.convert_alpha() */ } __pyx_L18_error:; __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; /* "pygame_sdl2/image.pyx":114 * else: * return surf.convert() * except error: # <<<<<<<<<<<<<< * return surf * */ __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_error); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 114; __pyx_clineno = __LINE__; goto __pyx_L20_except_error;} __Pyx_GOTREF(__pyx_t_3); __pyx_t_11 = PyErr_ExceptionMatches(__pyx_t_3); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; if (__pyx_t_11) { __Pyx_AddTraceback("pygame_sdl2.image.load", __pyx_clineno, __pyx_lineno, __pyx_filename); if (__Pyx_GetException(&__pyx_t_3, &__pyx_t_4, &__pyx_t_5) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 114; __pyx_clineno = __LINE__; goto __pyx_L20_except_error;} __Pyx_GOTREF(__pyx_t_3); __Pyx_GOTREF(__pyx_t_4); __Pyx_GOTREF(__pyx_t_5); /* "pygame_sdl2/image.pyx":115 * return surf.convert() * except error: * return surf # <<<<<<<<<<<<<< * * cdef extern from "write_jpeg.h": */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(((PyObject *)__pyx_v_surf)); __pyx_r = ((PyObject *)__pyx_v_surf); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; goto __pyx_L21_except_return; } goto __pyx_L20_except_error; __pyx_L20_except_error:; /* "pygame_sdl2/image.pyx":109 * n += 1 * * try: # <<<<<<<<<<<<<< * if has_alpha: * return surf.convert_alpha() */ __Pyx_XGIVEREF(__pyx_t_8); __Pyx_XGIVEREF(__pyx_t_9); __Pyx_XGIVEREF(__pyx_t_10); __Pyx_ExceptionReset(__pyx_t_8, __pyx_t_9, __pyx_t_10); goto __pyx_L1_error; __pyx_L22_try_return:; __Pyx_XGIVEREF(__pyx_t_8); __Pyx_XGIVEREF(__pyx_t_9); __Pyx_XGIVEREF(__pyx_t_10); __Pyx_ExceptionReset(__pyx_t_8, __pyx_t_9, __pyx_t_10); goto __pyx_L0; __pyx_L21_except_return:; __Pyx_XGIVEREF(__pyx_t_8); __Pyx_XGIVEREF(__pyx_t_9); __Pyx_XGIVEREF(__pyx_t_10); __Pyx_ExceptionReset(__pyx_t_8, __pyx_t_9, __pyx_t_10); goto __pyx_L0; } /* "pygame_sdl2/image.pyx":61 * return ext.upper() * * def load(fi, namehint=""): # <<<<<<<<<<<<<< * cdef SDL_Surface *img * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_5); __Pyx_AddTraceback("pygame_sdl2.image.load", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF((PyObject *)__pyx_v_surf); __Pyx_XDECREF(__pyx_v_namehint); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/image.pyx":123 * int Pygame_SDL2_SavePNG(const char *, SDL_Surface *, int) nogil * * def save(Surface surface not None, filename, compression=-1): # <<<<<<<<<<<<<< * * if isinstance(filename, unicode_): */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_5image_7save(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static PyMethodDef __pyx_mdef_11pygame_sdl2_5image_7save = {"save", (PyCFunction)__pyx_pw_11pygame_sdl2_5image_7save, METH_VARARGS|METH_KEYWORDS, 0}; static PyObject *__pyx_pw_11pygame_sdl2_5image_7save(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { struct __pyx_obj_11pygame_sdl2_7surface_Surface *__pyx_v_surface = 0; PyObject *__pyx_v_filename = 0; PyObject *__pyx_v_compression = 0; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("save (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_surface,&__pyx_n_s_filename,&__pyx_n_s_compression,0}; PyObject* values[3] = {0,0,0}; values[2] = ((PyObject *)__pyx_int_neg_1); if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_surface)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; case 1: if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_filename)) != 0)) kw_args--; else { __Pyx_RaiseArgtupleInvalid("save", 0, 2, 3, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 123; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } case 2: if (kw_args > 0) { PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_compression); if (value) { values[2] = value; kw_args--; } } } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "save") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 123; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } } else { switch (PyTuple_GET_SIZE(__pyx_args)) { case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); values[0] = PyTuple_GET_ITEM(__pyx_args, 0); break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_surface = ((struct __pyx_obj_11pygame_sdl2_7surface_Surface *)values[0]); __pyx_v_filename = values[1]; __pyx_v_compression = values[2]; } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("save", 0, 2, 3, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 123; __pyx_clineno = __LINE__; goto __pyx_L3_error;} __pyx_L3_error:; __Pyx_AddTraceback("pygame_sdl2.image.save", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_surface), __pyx_ptype_11pygame_sdl2_7surface_Surface, 0, "surface", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 123; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_r = __pyx_pf_11pygame_sdl2_5image_6save(__pyx_self, __pyx_v_surface, __pyx_v_filename, __pyx_v_compression); /* function exit code */ goto __pyx_L0; __pyx_L1_error:; __pyx_r = NULL; __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_5image_6save(CYTHON_UNUSED PyObject *__pyx_self, struct __pyx_obj_11pygame_sdl2_7surface_Surface *__pyx_v_surface, PyObject *__pyx_v_filename, PyObject *__pyx_v_compression) { PyObject *__pyx_v_ext = NULL; long __pyx_v_err; char *__pyx_v_fn; SDL_RWops *__pyx_v_rwops; int __pyx_v_compression_level; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_t_2; int __pyx_t_3; PyObject *__pyx_t_4 = NULL; PyObject *__pyx_t_5 = NULL; PyObject *__pyx_t_6 = NULL; char *__pyx_t_7; int __pyx_t_8; SDL_RWops *__pyx_t_9; struct __pyx_opt_args_11pygame_sdl2_8rwobject_to_rwops __pyx_t_10; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("save", 0); __Pyx_INCREF(__pyx_v_filename); /* "pygame_sdl2/image.pyx":125 * def save(Surface surface not None, filename, compression=-1): * * if isinstance(filename, unicode_): # <<<<<<<<<<<<<< * filename = filesystem_encode(filename) * */ __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_unicode); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 125; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = PyObject_IsInstance(__pyx_v_filename, __pyx_t_1); if (unlikely(__pyx_t_2 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 125; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_3 = (__pyx_t_2 != 0); if (__pyx_t_3) { /* "pygame_sdl2/image.pyx":126 * * if isinstance(filename, unicode_): * filename = filesystem_encode(filename) # <<<<<<<<<<<<<< * * ext = os.path.splitext(filename)[1] */ __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_filesystem_encode); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 126; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); __pyx_t_5 = NULL; if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_4))) { __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4); if (likely(__pyx_t_5)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4); __Pyx_INCREF(__pyx_t_5); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_4, function); } } if (!__pyx_t_5) { __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_v_filename); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 126; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); } else { __pyx_t_6 = PyTuple_New(1+1); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 126; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_6); __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_5); __pyx_t_5 = NULL; __Pyx_INCREF(__pyx_v_filename); __Pyx_GIVEREF(__pyx_v_filename); PyTuple_SET_ITEM(__pyx_t_6, 0+1, __pyx_v_filename); __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_6, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 126; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; } __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF_SET(__pyx_v_filename, __pyx_t_1); __pyx_t_1 = 0; /* "pygame_sdl2/image.pyx":125 * def save(Surface surface not None, filename, compression=-1): * * if isinstance(filename, unicode_): # <<<<<<<<<<<<<< * filename = filesystem_encode(filename) * */ } /* "pygame_sdl2/image.pyx":128 * filename = filesystem_encode(filename) * * ext = os.path.splitext(filename)[1] # <<<<<<<<<<<<<< * ext = ext.upper() * err = 0 */ __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_os); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 128; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_path); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 128; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_splitext); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 128; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __pyx_t_6 = NULL; if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_4))) { __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_4); if (likely(__pyx_t_6)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4); __Pyx_INCREF(__pyx_t_6); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_4, function); } } if (!__pyx_t_6) { __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_v_filename); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 128; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); } else { __pyx_t_5 = PyTuple_New(1+1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 128; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); __Pyx_GIVEREF(__pyx_t_6); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_6); __pyx_t_6 = NULL; __Pyx_INCREF(__pyx_v_filename); __Pyx_GIVEREF(__pyx_v_filename); PyTuple_SET_ITEM(__pyx_t_5, 0+1, __pyx_v_filename); __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_5, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 128; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; } __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_t_4 = __Pyx_GetItemInt(__pyx_t_1, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(__pyx_t_4 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 128; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_v_ext = __pyx_t_4; __pyx_t_4 = 0; /* "pygame_sdl2/image.pyx":129 * * ext = os.path.splitext(filename)[1] * ext = ext.upper() # <<<<<<<<<<<<<< * err = 0 * */ __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_ext, __pyx_n_s_upper); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 129; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_t_5 = NULL; if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_1))) { __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_1); if (likely(__pyx_t_5)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1); __Pyx_INCREF(__pyx_t_5); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_1, function); } } if (__pyx_t_5) { __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_t_1, __pyx_t_5); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 129; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; } else { __pyx_t_4 = __Pyx_PyObject_CallNoArg(__pyx_t_1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 129; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF_SET(__pyx_v_ext, __pyx_t_4); __pyx_t_4 = 0; /* "pygame_sdl2/image.pyx":130 * ext = os.path.splitext(filename)[1] * ext = ext.upper() * err = 0 # <<<<<<<<<<<<<< * * */ __pyx_v_err = 0; /* "pygame_sdl2/image.pyx":133 * * * cdef char *fn = filename # <<<<<<<<<<<<<< * cdef SDL_RWops *rwops * cdef int compression_level = compression */ __pyx_t_7 = __Pyx_PyObject_AsString(__pyx_v_filename); if (unlikely((!__pyx_t_7) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 133; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_v_fn = __pyx_t_7; /* "pygame_sdl2/image.pyx":135 * cdef char *fn = filename * cdef SDL_RWops *rwops * cdef int compression_level = compression # <<<<<<<<<<<<<< * * if ext == b'.PNG': */ __pyx_t_8 = __Pyx_PyInt_As_int(__pyx_v_compression); if (unlikely((__pyx_t_8 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 135; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_v_compression_level = __pyx_t_8; /* "pygame_sdl2/image.pyx":137 * cdef int compression_level = compression * * if ext == b'.PNG': # <<<<<<<<<<<<<< * with nogil: * err = Pygame_SDL2_SavePNG(fn, surface.surface, compression_level) */ __pyx_t_3 = (__Pyx_PyBytes_Equals(__pyx_v_ext, __pyx_kp_b_PNG, Py_EQ)); if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 137; __pyx_clineno = __LINE__; goto __pyx_L1_error;} if (__pyx_t_3) { /* "pygame_sdl2/image.pyx":138 * * if ext == b'.PNG': * with nogil: # <<<<<<<<<<<<<< * err = Pygame_SDL2_SavePNG(fn, surface.surface, compression_level) * elif ext == b'.BMP': */ { #ifdef WITH_THREAD PyThreadState *_save; Py_UNBLOCK_THREADS #endif /*try:*/ { /* "pygame_sdl2/image.pyx":139 * if ext == b'.PNG': * with nogil: * err = Pygame_SDL2_SavePNG(fn, surface.surface, compression_level) # <<<<<<<<<<<<<< * elif ext == b'.BMP': * rwops = to_rwops(filename, "wb") */ __pyx_v_err = Pygame_SDL2_SavePNG(__pyx_v_fn, __pyx_v_surface->surface, __pyx_v_compression_level); } /* "pygame_sdl2/image.pyx":138 * * if ext == b'.PNG': * with nogil: # <<<<<<<<<<<<<< * err = Pygame_SDL2_SavePNG(fn, surface.surface, compression_level) * elif ext == b'.BMP': */ /*finally:*/ { /*normal exit:*/{ #ifdef WITH_THREAD Py_BLOCK_THREADS #endif goto __pyx_L7; } __pyx_L7:; } } /* "pygame_sdl2/image.pyx":137 * cdef int compression_level = compression * * if ext == b'.PNG': # <<<<<<<<<<<<<< * with nogil: * err = Pygame_SDL2_SavePNG(fn, surface.surface, compression_level) */ goto __pyx_L4; } /* "pygame_sdl2/image.pyx":140 * with nogil: * err = Pygame_SDL2_SavePNG(fn, surface.surface, compression_level) * elif ext == b'.BMP': # <<<<<<<<<<<<<< * rwops = to_rwops(filename, "wb") * with nogil: */ __pyx_t_3 = (__Pyx_PyBytes_Equals(__pyx_v_ext, __pyx_kp_b_BMP, Py_EQ)); if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 140; __pyx_clineno = __LINE__; goto __pyx_L1_error;} if (__pyx_t_3) { /* "pygame_sdl2/image.pyx":141 * err = Pygame_SDL2_SavePNG(fn, surface.surface, compression_level) * elif ext == b'.BMP': * rwops = to_rwops(filename, "wb") # <<<<<<<<<<<<<< * with nogil: * err = SDL_SaveBMP_RW(surface.surface, rwops, 1) */ __pyx_t_10.__pyx_n = 1; __pyx_t_10.mode = __pyx_n_s_wb; __pyx_t_9 = __pyx_f_11pygame_sdl2_8rwobject_to_rwops(__pyx_v_filename, &__pyx_t_10); if (unlikely(__pyx_t_9 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 141; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_v_rwops = __pyx_t_9; /* "pygame_sdl2/image.pyx":142 * elif ext == b'.BMP': * rwops = to_rwops(filename, "wb") * with nogil: # <<<<<<<<<<<<<< * err = SDL_SaveBMP_RW(surface.surface, rwops, 1) * elif ext == b".JPG" or ext == b".JPEG": */ { #ifdef WITH_THREAD PyThreadState *_save; Py_UNBLOCK_THREADS #endif /*try:*/ { /* "pygame_sdl2/image.pyx":143 * rwops = to_rwops(filename, "wb") * with nogil: * err = SDL_SaveBMP_RW(surface.surface, rwops, 1) # <<<<<<<<<<<<<< * elif ext == b".JPG" or ext == b".JPEG": * with nogil: */ __pyx_v_err = SDL_SaveBMP_RW(__pyx_v_surface->surface, __pyx_v_rwops, 1); } /* "pygame_sdl2/image.pyx":142 * elif ext == b'.BMP': * rwops = to_rwops(filename, "wb") * with nogil: # <<<<<<<<<<<<<< * err = SDL_SaveBMP_RW(surface.surface, rwops, 1) * elif ext == b".JPG" or ext == b".JPEG": */ /*finally:*/ { /*normal exit:*/{ #ifdef WITH_THREAD Py_BLOCK_THREADS #endif goto __pyx_L10; } __pyx_L10:; } } /* "pygame_sdl2/image.pyx":140 * with nogil: * err = Pygame_SDL2_SavePNG(fn, surface.surface, compression_level) * elif ext == b'.BMP': # <<<<<<<<<<<<<< * rwops = to_rwops(filename, "wb") * with nogil: */ goto __pyx_L4; } /* "pygame_sdl2/image.pyx":144 * with nogil: * err = SDL_SaveBMP_RW(surface.surface, rwops, 1) * elif ext == b".JPG" or ext == b".JPEG": # <<<<<<<<<<<<<< * with nogil: * err = Pygame_SDL2_SaveJPEG(surface.surface, fn, compression_level) */ __pyx_t_2 = (__Pyx_PyBytes_Equals(__pyx_v_ext, __pyx_kp_b_JPG, Py_EQ)); if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 144; __pyx_clineno = __LINE__; goto __pyx_L1_error;} if (!__pyx_t_2) { } else { __pyx_t_3 = __pyx_t_2; goto __pyx_L11_bool_binop_done; } __pyx_t_2 = (__Pyx_PyBytes_Equals(__pyx_v_ext, __pyx_kp_b_JPEG, Py_EQ)); if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 144; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_t_3 = __pyx_t_2; __pyx_L11_bool_binop_done:; if (__pyx_t_3) { /* "pygame_sdl2/image.pyx":145 * err = SDL_SaveBMP_RW(surface.surface, rwops, 1) * elif ext == b".JPG" or ext == b".JPEG": * with nogil: # <<<<<<<<<<<<<< * err = Pygame_SDL2_SaveJPEG(surface.surface, fn, compression_level) * else: */ { #ifdef WITH_THREAD PyThreadState *_save; Py_UNBLOCK_THREADS #endif /*try:*/ { /* "pygame_sdl2/image.pyx":146 * elif ext == b".JPG" or ext == b".JPEG": * with nogil: * err = Pygame_SDL2_SaveJPEG(surface.surface, fn, compression_level) # <<<<<<<<<<<<<< * else: * raise ValueError("Unsupported format: %s" % ext) */ __pyx_v_err = Pygame_SDL2_SaveJPEG(__pyx_v_surface->surface, __pyx_v_fn, __pyx_v_compression_level); } /* "pygame_sdl2/image.pyx":145 * err = SDL_SaveBMP_RW(surface.surface, rwops, 1) * elif ext == b".JPG" or ext == b".JPEG": * with nogil: # <<<<<<<<<<<<<< * err = Pygame_SDL2_SaveJPEG(surface.surface, fn, compression_level) * else: */ /*finally:*/ { /*normal exit:*/{ #ifdef WITH_THREAD Py_BLOCK_THREADS #endif goto __pyx_L15; } __pyx_L15:; } } /* "pygame_sdl2/image.pyx":144 * with nogil: * err = SDL_SaveBMP_RW(surface.surface, rwops, 1) * elif ext == b".JPG" or ext == b".JPEG": # <<<<<<<<<<<<<< * with nogil: * err = Pygame_SDL2_SaveJPEG(surface.surface, fn, compression_level) */ goto __pyx_L4; } /* "pygame_sdl2/image.pyx":148 * err = Pygame_SDL2_SaveJPEG(surface.surface, fn, compression_level) * else: * raise ValueError("Unsupported format: %s" % ext) # <<<<<<<<<<<<<< * * if err != 0: */ /*else*/ { __pyx_t_4 = __Pyx_PyString_Format(__pyx_kp_s_Unsupported_format_s, __pyx_v_ext); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 148; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 148; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_4); __pyx_t_4 = 0; __pyx_t_4 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_t_1, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 148; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_Raise(__pyx_t_4, 0, 0, 0); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; {__pyx_filename = __pyx_f[0]; __pyx_lineno = 148; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } __pyx_L4:; /* "pygame_sdl2/image.pyx":150 * raise ValueError("Unsupported format: %s" % ext) * * if err != 0: # <<<<<<<<<<<<<< * raise error() * */ __pyx_t_3 = ((__pyx_v_err != 0) != 0); if (__pyx_t_3) { /* "pygame_sdl2/image.pyx":151 * * if err != 0: * raise error() # <<<<<<<<<<<<<< * * def get_extended(): */ __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_error); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 151; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_t_5 = NULL; if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_1))) { __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_1); if (likely(__pyx_t_5)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1); __Pyx_INCREF(__pyx_t_5); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_1, function); } } if (__pyx_t_5) { __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_t_1, __pyx_t_5); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 151; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; } else { __pyx_t_4 = __Pyx_PyObject_CallNoArg(__pyx_t_1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 151; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_Raise(__pyx_t_4, 0, 0, 0); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; {__pyx_filename = __pyx_f[0]; __pyx_lineno = 151; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "pygame_sdl2/image.pyx":150 * raise ValueError("Unsupported format: %s" % ext) * * if err != 0: # <<<<<<<<<<<<<< * raise error() * */ } /* "pygame_sdl2/image.pyx":123 * int Pygame_SDL2_SavePNG(const char *, SDL_Surface *, int) nogil * * def save(Surface surface not None, filename, compression=-1): # <<<<<<<<<<<<<< * * if isinstance(filename, unicode_): */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_5); __Pyx_XDECREF(__pyx_t_6); __Pyx_AddTraceback("pygame_sdl2.image.save", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF(__pyx_v_ext); __Pyx_XDECREF(__pyx_v_filename); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/image.pyx":153 * raise error() * * def get_extended(): # <<<<<<<<<<<<<< * # This may be called before init. * return True */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_5image_9get_extended(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused); /*proto*/ static PyMethodDef __pyx_mdef_11pygame_sdl2_5image_9get_extended = {"get_extended", (PyCFunction)__pyx_pw_11pygame_sdl2_5image_9get_extended, METH_NOARGS, 0}; static PyObject *__pyx_pw_11pygame_sdl2_5image_9get_extended(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("get_extended (wrapper)", 0); __pyx_r = __pyx_pf_11pygame_sdl2_5image_8get_extended(__pyx_self); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_5image_8get_extended(CYTHON_UNUSED PyObject *__pyx_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("get_extended", 0); /* "pygame_sdl2/image.pyx":155 * def get_extended(): * # This may be called before init. * return True # <<<<<<<<<<<<<< */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(Py_True); __pyx_r = Py_True; goto __pyx_L0; /* "pygame_sdl2/image.pyx":153 * raise error() * * def get_extended(): # <<<<<<<<<<<<<< * # This may be called before init. * return True */ /* function exit code */ __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyMethodDef __pyx_methods[] = { {0, 0, 0, 0} }; #if PY_MAJOR_VERSION >= 3 static struct PyModuleDef __pyx_moduledef = { #if PY_VERSION_HEX < 0x03020000 { PyObject_HEAD_INIT(NULL) NULL, 0, NULL }, #else PyModuleDef_HEAD_INIT, #endif "image", 0, /* m_doc */ -1, /* m_size */ __pyx_methods /* m_methods */, NULL, /* m_reload */ NULL, /* m_traverse */ NULL, /* m_clear */ NULL /* m_free */ }; #endif static __Pyx_StringTabEntry __pyx_string_tab[] = { {&__pyx_kp_b_BMP, __pyx_k_BMP, sizeof(__pyx_k_BMP), 0, 0, 0, 0}, {&__pyx_kp_b_JPEG, __pyx_k_JPEG, sizeof(__pyx_k_JPEG), 0, 0, 0, 0}, {&__pyx_kp_b_JPG, __pyx_k_JPG, sizeof(__pyx_k_JPG), 0, 0, 0, 0}, {&__pyx_kp_b_PNG, __pyx_k_PNG, sizeof(__pyx_k_PNG), 0, 0, 0, 0}, {&__pyx_n_s_TGA, __pyx_k_TGA, sizeof(__pyx_k_TGA), 0, 0, 1, 1}, {&__pyx_kp_s_Unsupported_format_s, __pyx_k_Unsupported_format_s, sizeof(__pyx_k_Unsupported_format_s), 0, 0, 1, 0}, {&__pyx_n_s_ValueError, __pyx_k_ValueError, sizeof(__pyx_k_ValueError), 0, 0, 1, 1}, {&__pyx_kp_b__2, __pyx_k__2, sizeof(__pyx_k__2), 0, 0, 0, 0}, {&__pyx_kp_s__2, __pyx_k__2, sizeof(__pyx_k__2), 0, 0, 1, 0}, {&__pyx_kp_b__3, __pyx_k__3, sizeof(__pyx_k__3), 0, 0, 0, 0}, {&__pyx_n_s_ascii, __pyx_k_ascii, sizeof(__pyx_k_ascii), 0, 0, 1, 1}, {&__pyx_n_s_bytes, __pyx_k_bytes, sizeof(__pyx_k_bytes), 0, 0, 1, 1}, {&__pyx_n_s_compression, __pyx_k_compression, sizeof(__pyx_k_compression), 0, 0, 1, 1}, {&__pyx_n_s_compression_level, __pyx_k_compression_level, sizeof(__pyx_k_compression_level), 0, 0, 1, 1}, {&__pyx_n_s_convert, __pyx_k_convert, sizeof(__pyx_k_convert), 0, 0, 1, 1}, {&__pyx_n_s_convert_alpha, __pyx_k_convert_alpha, sizeof(__pyx_k_convert_alpha), 0, 0, 1, 1}, {&__pyx_n_s_encode, __pyx_k_encode, sizeof(__pyx_k_encode), 0, 0, 1, 1}, {&__pyx_n_s_endswith, __pyx_k_endswith, sizeof(__pyx_k_endswith), 0, 0, 1, 1}, {&__pyx_n_s_err, __pyx_k_err, sizeof(__pyx_k_err), 0, 0, 1, 1}, {&__pyx_n_s_error, __pyx_k_error, sizeof(__pyx_k_error), 0, 0, 1, 1}, {&__pyx_n_s_ext, __pyx_k_ext, sizeof(__pyx_k_ext), 0, 0, 1, 1}, {&__pyx_n_s_fi, __pyx_k_fi, sizeof(__pyx_k_fi), 0, 0, 1, 1}, {&__pyx_n_s_filename, __pyx_k_filename, sizeof(__pyx_k_filename), 0, 0, 1, 1}, {&__pyx_n_s_filesystem_encode, __pyx_k_filesystem_encode, sizeof(__pyx_k_filesystem_encode), 0, 0, 1, 1}, {&__pyx_n_s_fn, __pyx_k_fn, sizeof(__pyx_k_fn), 0, 0, 1, 1}, {&__pyx_n_s_ftype, __pyx_k_ftype, sizeof(__pyx_k_ftype), 0, 0, 1, 1}, {&__pyx_n_s_get_extended, __pyx_k_get_extended, sizeof(__pyx_k_get_extended), 0, 0, 1, 1}, {&__pyx_n_s_has_alpha, __pyx_k_has_alpha, sizeof(__pyx_k_has_alpha), 0, 0, 1, 1}, {&__pyx_kp_s_home_tom_ab_pygame_sdl2_src_pyg, __pyx_k_home_tom_ab_pygame_sdl2_src_pyg, sizeof(__pyx_k_home_tom_ab_pygame_sdl2_src_pyg), 0, 0, 1, 0}, {&__pyx_n_s_img, __pyx_k_img, sizeof(__pyx_k_img), 0, 0, 1, 1}, {&__pyx_n_s_import, __pyx_k_import, sizeof(__pyx_k_import), 0, 0, 1, 1}, {&__pyx_n_s_init, __pyx_k_init, sizeof(__pyx_k_init), 0, 0, 1, 1}, {&__pyx_n_s_load, __pyx_k_load, sizeof(__pyx_k_load), 0, 0, 1, 1}, {&__pyx_n_s_lower, __pyx_k_lower, sizeof(__pyx_k_lower), 0, 0, 1, 1}, {&__pyx_n_s_main, __pyx_k_main, sizeof(__pyx_k_main), 0, 0, 1, 1}, {&__pyx_n_s_n, __pyx_k_n, sizeof(__pyx_k_n), 0, 0, 1, 1}, {&__pyx_n_s_namehint, __pyx_k_namehint, sizeof(__pyx_k_namehint), 0, 0, 1, 1}, {&__pyx_n_s_os, __pyx_k_os, sizeof(__pyx_k_os), 0, 0, 1, 1}, {&__pyx_n_s_path, __pyx_k_path, sizeof(__pyx_k_path), 0, 0, 1, 1}, {&__pyx_n_s_pygame_sdl2, __pyx_k_pygame_sdl2, sizeof(__pyx_k_pygame_sdl2), 0, 0, 1, 1}, {&__pyx_n_s_pygame_sdl2_compat, __pyx_k_pygame_sdl2_compat, sizeof(__pyx_k_pygame_sdl2_compat), 0, 0, 1, 1}, {&__pyx_n_s_pygame_sdl2_error, __pyx_k_pygame_sdl2_error, sizeof(__pyx_k_pygame_sdl2_error), 0, 0, 1, 1}, {&__pyx_n_s_pygame_sdl2_image, __pyx_k_pygame_sdl2_image, sizeof(__pyx_k_pygame_sdl2_image), 0, 0, 1, 1}, {&__pyx_n_s_pyx_vtable, __pyx_k_pyx_vtable, sizeof(__pyx_k_pyx_vtable), 0, 0, 1, 1}, {&__pyx_n_s_quit, __pyx_k_quit, sizeof(__pyx_k_quit), 0, 0, 1, 1}, {&__pyx_n_s_replace, __pyx_k_replace, sizeof(__pyx_k_replace), 0, 0, 1, 1}, {&__pyx_n_s_rwops, __pyx_k_rwops, sizeof(__pyx_k_rwops), 0, 0, 1, 1}, {&__pyx_n_s_save, __pyx_k_save, sizeof(__pyx_k_save), 0, 0, 1, 1}, {&__pyx_n_s_splitext, __pyx_k_splitext, sizeof(__pyx_k_splitext), 0, 0, 1, 1}, {&__pyx_n_s_surf, __pyx_k_surf, sizeof(__pyx_k_surf), 0, 0, 1, 1}, {&__pyx_n_s_surface, __pyx_k_surface, sizeof(__pyx_k_surface), 0, 0, 1, 1}, {&__pyx_n_s_test, __pyx_k_test, sizeof(__pyx_k_test), 0, 0, 1, 1}, {&__pyx_kp_s_tga, __pyx_k_tga, sizeof(__pyx_k_tga), 0, 0, 1, 0}, {&__pyx_n_s_unicode, __pyx_k_unicode, sizeof(__pyx_k_unicode), 0, 0, 1, 1}, {&__pyx_n_s_upper, __pyx_k_upper, sizeof(__pyx_k_upper), 0, 0, 1, 1}, {&__pyx_n_s_wb, __pyx_k_wb, sizeof(__pyx_k_wb), 0, 0, 1, 1}, {0, 0, 0, 0, 0, 0, 0} }; static int __Pyx_InitCachedBuiltins(void) { __pyx_builtin_ValueError = __Pyx_GetBuiltinName(__pyx_n_s_ValueError); if (!__pyx_builtin_ValueError) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 148; __pyx_clineno = __LINE__; goto __pyx_L1_error;} return 0; __pyx_L1_error:; return -1; } static int __Pyx_InitCachedConstants(void) { __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__Pyx_InitCachedConstants", 0); /* "pygame_sdl2/image.pyx":48 * * if not isinstance(namehint, bytes_): * namehint = namehint.encode("ascii", "replace") # <<<<<<<<<<<<<< * * if not namehint: */ __pyx_tuple_ = PyTuple_Pack(2, __pyx_n_s_ascii, __pyx_n_s_replace); if (unlikely(!__pyx_tuple_)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 48; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_tuple_); __Pyx_GIVEREF(__pyx_tuple_); /* "pygame_sdl2/image.pyx":57 * ext = namehint * if ext[0] == b'.': * ext = ext[1:] # <<<<<<<<<<<<<< * * return ext.upper() */ __pyx_slice__4 = PySlice_New(__pyx_int_1, Py_None, Py_None); if (unlikely(!__pyx_slice__4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 57; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_slice__4); __Pyx_GIVEREF(__pyx_slice__4); /* "pygame_sdl2/image.pyx":69 * # IMG_Load_RW can't load TGA images. * if isinstance(fi, str): * if fi.lower().endswith('.tga'): # <<<<<<<<<<<<<< * namehint = "TGA" * */ __pyx_tuple__5 = PyTuple_Pack(1, __pyx_kp_s_tga); if (unlikely(!__pyx_tuple__5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 69; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_tuple__5); __Pyx_GIVEREF(__pyx_tuple__5); /* "pygame_sdl2/image.pyx":88 * raise error() * * cdef Surface surf = Surface(()) # <<<<<<<<<<<<<< * surf.take_surface(img) * */ __pyx_tuple__6 = PyTuple_Pack(1, __pyx_empty_tuple); if (unlikely(!__pyx_tuple__6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 88; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_tuple__6); __Pyx_GIVEREF(__pyx_tuple__6); /* "pygame_sdl2/image.pyx":33 * cdef int image_formats = 0 * * def init(): # <<<<<<<<<<<<<< * global image_formats * image_formats = IMG_Init(IMG_INIT_JPG | IMG_INIT_PNG | IMG_INIT_TIF | IMG_INIT_WEBP) */ __pyx_codeobj__7 = (PyObject*)__Pyx_PyCode_New(0, 0, 0, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_tom_ab_pygame_sdl2_src_pyg, __pyx_n_s_init, 33, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 33; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "pygame_sdl2/image.pyx":41 * init() * * def quit(): # @ReservedAssignment # <<<<<<<<<<<<<< * IMG_Quit() * */ __pyx_codeobj__8 = (PyObject*)__Pyx_PyCode_New(0, 0, 0, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_tom_ab_pygame_sdl2_src_pyg, __pyx_n_s_quit, 41, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 41; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "pygame_sdl2/image.pyx":61 * return ext.upper() * * def load(fi, namehint=""): # <<<<<<<<<<<<<< * cdef SDL_Surface *img * */ __pyx_tuple__9 = PyTuple_Pack(8, __pyx_n_s_fi, __pyx_n_s_namehint, __pyx_n_s_img, __pyx_n_s_rwops, __pyx_n_s_ftype, __pyx_n_s_surf, __pyx_n_s_n, __pyx_n_s_has_alpha); if (unlikely(!__pyx_tuple__9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 61; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_tuple__9); __Pyx_GIVEREF(__pyx_tuple__9); __pyx_codeobj__10 = (PyObject*)__Pyx_PyCode_New(2, 0, 8, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__9, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_tom_ab_pygame_sdl2_src_pyg, __pyx_n_s_load, 61, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 61; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "pygame_sdl2/image.pyx":123 * int Pygame_SDL2_SavePNG(const char *, SDL_Surface *, int) nogil * * def save(Surface surface not None, filename, compression=-1): # <<<<<<<<<<<<<< * * if isinstance(filename, unicode_): */ __pyx_tuple__11 = PyTuple_Pack(8, __pyx_n_s_surface, __pyx_n_s_filename, __pyx_n_s_compression, __pyx_n_s_ext, __pyx_n_s_err, __pyx_n_s_fn, __pyx_n_s_rwops, __pyx_n_s_compression_level); if (unlikely(!__pyx_tuple__11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 123; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_tuple__11); __Pyx_GIVEREF(__pyx_tuple__11); __pyx_codeobj__12 = (PyObject*)__Pyx_PyCode_New(3, 0, 8, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__11, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_tom_ab_pygame_sdl2_src_pyg, __pyx_n_s_save, 123, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__12)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 123; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "pygame_sdl2/image.pyx":153 * raise error() * * def get_extended(): # <<<<<<<<<<<<<< * # This may be called before init. * return True */ __pyx_codeobj__13 = (PyObject*)__Pyx_PyCode_New(0, 0, 0, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_tom_ab_pygame_sdl2_src_pyg, __pyx_n_s_get_extended, 153, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__13)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 153; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_RefNannyFinishContext(); return 0; __pyx_L1_error:; __Pyx_RefNannyFinishContext(); return -1; } static int __Pyx_InitGlobals(void) { if (__Pyx_InitStrings(__pyx_string_tab) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; __pyx_int_1 = PyInt_FromLong(1); if (unlikely(!__pyx_int_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_int_neg_1 = PyInt_FromLong(-1); if (unlikely(!__pyx_int_neg_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} return 0; __pyx_L1_error:; return -1; } #if PY_MAJOR_VERSION < 3 PyMODINIT_FUNC initimage(void); /*proto*/ PyMODINIT_FUNC initimage(void) #else PyMODINIT_FUNC PyInit_image(void); /*proto*/ PyMODINIT_FUNC PyInit_image(void) #endif { PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannyDeclarations #if CYTHON_REFNANNY __Pyx_RefNanny = __Pyx_RefNannyImportAPI("refnanny"); if (!__Pyx_RefNanny) { PyErr_Clear(); __Pyx_RefNanny = __Pyx_RefNannyImportAPI("Cython.Runtime.refnanny"); if (!__Pyx_RefNanny) Py_FatalError("failed to import 'refnanny' module"); } #endif __Pyx_RefNannySetupContext("PyMODINIT_FUNC PyInit_image(void)", 0); if (__Pyx_check_binary_version() < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_empty_tuple = PyTuple_New(0); if (unlikely(!__pyx_empty_tuple)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_empty_bytes = PyBytes_FromStringAndSize("", 0); if (unlikely(!__pyx_empty_bytes)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} #ifdef __Pyx_CyFunction_USED if (__pyx_CyFunction_init() < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} #endif #ifdef __Pyx_FusedFunction_USED if (__pyx_FusedFunction_init() < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} #endif #ifdef __Pyx_Coroutine_USED if (__pyx_Coroutine_init() < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} #endif #ifdef __Pyx_Generator_USED if (__pyx_Generator_init() < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} #endif #ifdef __Pyx_StopAsyncIteration_USED if (__pyx_StopAsyncIteration_init() < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} #endif /*--- Library function declarations ---*/ /*--- Threads initialization code ---*/ #if defined(__PYX_FORCE_INIT_THREADS) && __PYX_FORCE_INIT_THREADS #ifdef WITH_THREAD /* Python build with threading support? */ PyEval_InitThreads(); #endif #endif /*--- Module creation code ---*/ #if PY_MAJOR_VERSION < 3 __pyx_m = Py_InitModule4("image", __pyx_methods, 0, 0, PYTHON_API_VERSION); Py_XINCREF(__pyx_m); #else __pyx_m = PyModule_Create(&__pyx_moduledef); #endif if (unlikely(!__pyx_m)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_d = PyModule_GetDict(__pyx_m); if (unlikely(!__pyx_d)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} Py_INCREF(__pyx_d); __pyx_b = PyImport_AddModule(__Pyx_BUILTIN_MODULE_NAME); if (unlikely(!__pyx_b)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} #if CYTHON_COMPILING_IN_PYPY Py_INCREF(__pyx_b); #endif if (PyObject_SetAttrString(__pyx_m, "__builtins__", __pyx_b) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; /*--- Initialize various global constants etc. ---*/ if (__Pyx_InitGlobals() < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} #if PY_MAJOR_VERSION < 3 && (__PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT) if (__Pyx_init_sys_getdefaultencoding_params() < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} #endif if (__pyx_module_is_main_pygame_sdl2__image) { if (PyObject_SetAttrString(__pyx_m, "__name__", __pyx_n_s_main) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } #if PY_MAJOR_VERSION >= 3 { PyObject *modules = PyImport_GetModuleDict(); if (unlikely(!modules)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} if (!PyDict_GetItemString(modules, "pygame_sdl2.image")) { if (unlikely(PyDict_SetItemString(modules, "pygame_sdl2.image", __pyx_m) < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } } #endif /*--- Builtin init code ---*/ if (__Pyx_InitCachedBuiltins() < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /*--- Constants init code ---*/ if (__Pyx_InitCachedConstants() < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /*--- Global init code ---*/ /*--- Variable export code ---*/ /*--- Function export code ---*/ /*--- Type init code ---*/ /*--- Type import code ---*/ __pyx_ptype_11pygame_sdl2_7surface_Surface = __Pyx_ImportType("pygame_sdl2.surface", "Surface", sizeof(struct __pyx_obj_11pygame_sdl2_7surface_Surface), 1); if (unlikely(!__pyx_ptype_11pygame_sdl2_7surface_Surface)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 23; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_vtabptr_11pygame_sdl2_7surface_Surface = (struct __pyx_vtabstruct_11pygame_sdl2_7surface_Surface*)__Pyx_GetVtable(__pyx_ptype_11pygame_sdl2_7surface_Surface->tp_dict); if (unlikely(!__pyx_vtabptr_11pygame_sdl2_7surface_Surface)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 23; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /*--- Variable import code ---*/ /*--- Function import code ---*/ __pyx_t_1 = __Pyx_ImportModule("pygame_sdl2.rwobject"); if (!__pyx_t_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} if (__Pyx_ImportFunction(__pyx_t_1, "to_rwops", (void (**)(void))&__pyx_f_11pygame_sdl2_8rwobject_to_rwops, "SDL_RWops *(PyObject *, struct __pyx_opt_args_11pygame_sdl2_8rwobject_to_rwops *__pyx_optional_args)") < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} Py_DECREF(__pyx_t_1); __pyx_t_1 = 0; /*--- Execution code ---*/ #if defined(__Pyx_Generator_USED) || defined(__Pyx_Coroutine_USED) if (__Pyx_patch_abc() < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} #endif /* "pygame_sdl2/image.pyx":24 * from pygame_sdl2.rwobject cimport to_rwops * * from pygame_sdl2.error import error # <<<<<<<<<<<<<< * from pygame_sdl2.compat import bytes_, unicode_, filesystem_encode * */ __pyx_t_2 = PyList_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 24; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __Pyx_INCREF(__pyx_n_s_error); __Pyx_GIVEREF(__pyx_n_s_error); PyList_SET_ITEM(__pyx_t_2, 0, __pyx_n_s_error); __pyx_t_3 = __Pyx_Import(__pyx_n_s_pygame_sdl2_error, __pyx_t_2, -1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 24; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_2 = __Pyx_ImportFrom(__pyx_t_3, __pyx_n_s_error); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 24; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_error, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 24; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "pygame_sdl2/image.pyx":25 * * from pygame_sdl2.error import error * from pygame_sdl2.compat import bytes_, unicode_, filesystem_encode # <<<<<<<<<<<<<< * * import os */ __pyx_t_3 = PyList_New(3); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 25; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __Pyx_INCREF(__pyx_n_s_bytes); __Pyx_GIVEREF(__pyx_n_s_bytes); PyList_SET_ITEM(__pyx_t_3, 0, __pyx_n_s_bytes); __Pyx_INCREF(__pyx_n_s_unicode); __Pyx_GIVEREF(__pyx_n_s_unicode); PyList_SET_ITEM(__pyx_t_3, 1, __pyx_n_s_unicode); __Pyx_INCREF(__pyx_n_s_filesystem_encode); __Pyx_GIVEREF(__pyx_n_s_filesystem_encode); PyList_SET_ITEM(__pyx_t_3, 2, __pyx_n_s_filesystem_encode); __pyx_t_2 = __Pyx_Import(__pyx_n_s_pygame_sdl2_compat, __pyx_t_3, -1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 25; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_3 = __Pyx_ImportFrom(__pyx_t_2, __pyx_n_s_bytes); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 25; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); if (PyDict_SetItem(__pyx_d, __pyx_n_s_bytes, __pyx_t_3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 25; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_3 = __Pyx_ImportFrom(__pyx_t_2, __pyx_n_s_unicode); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 25; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); if (PyDict_SetItem(__pyx_d, __pyx_n_s_unicode, __pyx_t_3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 25; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_3 = __Pyx_ImportFrom(__pyx_t_2, __pyx_n_s_filesystem_encode); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 25; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); if (PyDict_SetItem(__pyx_d, __pyx_n_s_filesystem_encode, __pyx_t_3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 25; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "pygame_sdl2/image.pyx":27 * from pygame_sdl2.compat import bytes_, unicode_, filesystem_encode * * import os # <<<<<<<<<<<<<< * import pygame_sdl2 * */ __pyx_t_2 = __Pyx_Import(__pyx_n_s_os, 0, -1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 27; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_os, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 27; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "pygame_sdl2/image.pyx":28 * * import os * import pygame_sdl2 # <<<<<<<<<<<<<< * * */ __pyx_t_2 = __Pyx_Import(__pyx_n_s_pygame_sdl2, 0, -1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 28; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_pygame_sdl2, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 28; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "pygame_sdl2/image.pyx":31 * * * cdef int image_formats = 0 # <<<<<<<<<<<<<< * * def init(): */ __pyx_v_11pygame_sdl2_5image_image_formats = 0; /* "pygame_sdl2/image.pyx":33 * cdef int image_formats = 0 * * def init(): # <<<<<<<<<<<<<< * global image_formats * image_formats = IMG_Init(IMG_INIT_JPG | IMG_INIT_PNG | IMG_INIT_TIF | IMG_INIT_WEBP) */ __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_11pygame_sdl2_5image_1init, NULL, __pyx_n_s_pygame_sdl2_image); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 33; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_init, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 33; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "pygame_sdl2/image.pyx":39 * raise error() * * init() # <<<<<<<<<<<<<< * * def quit(): # @ReservedAssignment */ __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_init); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 39; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = NULL; if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_3))) { __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3); if (likely(__pyx_t_4)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); __Pyx_INCREF(__pyx_t_4); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_3, function); } } if (__pyx_t_4) { __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 39; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; } else { __pyx_t_2 = __Pyx_PyObject_CallNoArg(__pyx_t_3); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 39; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "pygame_sdl2/image.pyx":41 * init() * * def quit(): # @ReservedAssignment # <<<<<<<<<<<<<< * IMG_Quit() * */ __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_11pygame_sdl2_5image_3quit, NULL, __pyx_n_s_pygame_sdl2_image); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 41; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_quit, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 41; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "pygame_sdl2/image.pyx":61 * return ext.upper() * * def load(fi, namehint=""): # <<<<<<<<<<<<<< * cdef SDL_Surface *img * */ __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_11pygame_sdl2_5image_5load, NULL, __pyx_n_s_pygame_sdl2_image); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 61; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_load, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 61; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "pygame_sdl2/image.pyx":123 * int Pygame_SDL2_SavePNG(const char *, SDL_Surface *, int) nogil * * def save(Surface surface not None, filename, compression=-1): # <<<<<<<<<<<<<< * * if isinstance(filename, unicode_): */ __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_11pygame_sdl2_5image_7save, NULL, __pyx_n_s_pygame_sdl2_image); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 123; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_save, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 123; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "pygame_sdl2/image.pyx":153 * raise error() * * def get_extended(): # <<<<<<<<<<<<<< * # This may be called before init. * return True */ __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_11pygame_sdl2_5image_9get_extended, NULL, __pyx_n_s_pygame_sdl2_image); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 153; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_get_extended, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 153; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "pygame_sdl2/image.pyx":1 * # Copyright 2014 Patrick Dawson # <<<<<<<<<<<<<< * # * # This software is provided 'as-is', without any express or implied */ __pyx_t_2 = PyDict_New(); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_test, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /*--- Wrapped vars code ---*/ goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); if (__pyx_m) { if (__pyx_d) { __Pyx_AddTraceback("init pygame_sdl2.image", __pyx_clineno, __pyx_lineno, __pyx_filename); } Py_DECREF(__pyx_m); __pyx_m = 0; } else if (!PyErr_Occurred()) { PyErr_SetString(PyExc_ImportError, "init pygame_sdl2.image"); } __pyx_L0:; __Pyx_RefNannyFinishContext(); #if PY_MAJOR_VERSION < 3 return; #else return __pyx_m; #endif } /* --- Runtime support code --- */ #if CYTHON_REFNANNY static __Pyx_RefNannyAPIStruct *__Pyx_RefNannyImportAPI(const char *modname) { PyObject *m = NULL, *p = NULL; void *r = NULL; m = PyImport_ImportModule((char *)modname); if (!m) goto end; p = PyObject_GetAttrString(m, (char *)"RefNannyAPI"); if (!p) goto end; r = PyLong_AsVoidPtr(p); end: Py_XDECREF(p); Py_XDECREF(m); return (__Pyx_RefNannyAPIStruct *)r; } #endif static PyObject *__Pyx_GetBuiltinName(PyObject *name) { PyObject* result = __Pyx_PyObject_GetAttrStr(__pyx_b, name); if (unlikely(!result)) { PyErr_Format(PyExc_NameError, #if PY_MAJOR_VERSION >= 3 "name '%U' is not defined", name); #else "name '%.200s' is not defined", PyString_AS_STRING(name)); #endif } return result; } static CYTHON_INLINE PyObject *__Pyx_GetModuleGlobalName(PyObject *name) { PyObject *result; #if CYTHON_COMPILING_IN_CPYTHON result = PyDict_GetItem(__pyx_d, name); if (likely(result)) { Py_INCREF(result); } else { #else result = PyObject_GetItem(__pyx_d, name); if (!result) { PyErr_Clear(); #endif result = __Pyx_GetBuiltinName(name); } return result; } #if CYTHON_COMPILING_IN_CPYTHON static CYTHON_INLINE PyObject* __Pyx_PyObject_Call(PyObject *func, PyObject *arg, PyObject *kw) { PyObject *result; ternaryfunc call = func->ob_type->tp_call; if (unlikely(!call)) return PyObject_Call(func, arg, kw); if (unlikely(Py_EnterRecursiveCall((char*)" while calling a Python object"))) return NULL; result = (*call)(func, arg, kw); Py_LeaveRecursiveCall(); if (unlikely(!result) && unlikely(!PyErr_Occurred())) { PyErr_SetString( PyExc_SystemError, "NULL result without error in PyObject_Call"); } return result; } #endif #if CYTHON_COMPILING_IN_CPYTHON static CYTHON_INLINE PyObject* __Pyx_PyObject_CallMethO(PyObject *func, PyObject *arg) { PyObject *self, *result; PyCFunction cfunc; cfunc = PyCFunction_GET_FUNCTION(func); self = PyCFunction_GET_SELF(func); if (unlikely(Py_EnterRecursiveCall((char*)" while calling a Python object"))) return NULL; result = cfunc(self, arg); Py_LeaveRecursiveCall(); if (unlikely(!result) && unlikely(!PyErr_Occurred())) { PyErr_SetString( PyExc_SystemError, "NULL result without error in PyObject_Call"); } return result; } #endif #if CYTHON_COMPILING_IN_CPYTHON static PyObject* __Pyx__PyObject_CallOneArg(PyObject *func, PyObject *arg) { PyObject *result; PyObject *args = PyTuple_New(1); if (unlikely(!args)) return NULL; Py_INCREF(arg); PyTuple_SET_ITEM(args, 0, arg); result = __Pyx_PyObject_Call(func, args, NULL); Py_DECREF(args); return result; } static CYTHON_INLINE PyObject* __Pyx_PyObject_CallOneArg(PyObject *func, PyObject *arg) { #ifdef __Pyx_CyFunction_USED if (likely(PyCFunction_Check(func) || PyObject_TypeCheck(func, __pyx_CyFunctionType))) { #else if (likely(PyCFunction_Check(func))) { #endif if (likely(PyCFunction_GET_FLAGS(func) & METH_O)) { return __Pyx_PyObject_CallMethO(func, arg); } } return __Pyx__PyObject_CallOneArg(func, arg); } #else static CYTHON_INLINE PyObject* __Pyx_PyObject_CallOneArg(PyObject *func, PyObject *arg) { PyObject *result; PyObject *args = PyTuple_Pack(1, arg); if (unlikely(!args)) return NULL; result = __Pyx_PyObject_Call(func, args, NULL); Py_DECREF(args); return result; } #endif #if CYTHON_COMPILING_IN_CPYTHON static CYTHON_INLINE PyObject* __Pyx_PyObject_CallNoArg(PyObject *func) { #ifdef __Pyx_CyFunction_USED if (likely(PyCFunction_Check(func) || PyObject_TypeCheck(func, __pyx_CyFunctionType))) { #else if (likely(PyCFunction_Check(func))) { #endif if (likely(PyCFunction_GET_FLAGS(func) & METH_NOARGS)) { return __Pyx_PyObject_CallMethO(func, NULL); } } return __Pyx_PyObject_Call(func, __pyx_empty_tuple, NULL); } #endif static CYTHON_INLINE void __Pyx_ErrRestore(PyObject *type, PyObject *value, PyObject *tb) { #if CYTHON_COMPILING_IN_CPYTHON PyObject *tmp_type, *tmp_value, *tmp_tb; PyThreadState *tstate = PyThreadState_GET(); tmp_type = tstate->curexc_type; tmp_value = tstate->curexc_value; tmp_tb = tstate->curexc_traceback; tstate->curexc_type = type; tstate->curexc_value = value; tstate->curexc_traceback = tb; Py_XDECREF(tmp_type); Py_XDECREF(tmp_value); Py_XDECREF(tmp_tb); #else PyErr_Restore(type, value, tb); #endif } static CYTHON_INLINE void __Pyx_ErrFetch(PyObject **type, PyObject **value, PyObject **tb) { #if CYTHON_COMPILING_IN_CPYTHON PyThreadState *tstate = PyThreadState_GET(); *type = tstate->curexc_type; *value = tstate->curexc_value; *tb = tstate->curexc_traceback; tstate->curexc_type = 0; tstate->curexc_value = 0; tstate->curexc_traceback = 0; #else PyErr_Fetch(type, value, tb); #endif } #if PY_MAJOR_VERSION < 3 static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, CYTHON_UNUSED PyObject *cause) { Py_XINCREF(type); if (!value || value == Py_None) value = NULL; else Py_INCREF(value); if (!tb || tb == Py_None) tb = NULL; else { Py_INCREF(tb); if (!PyTraceBack_Check(tb)) { PyErr_SetString(PyExc_TypeError, "raise: arg 3 must be a traceback or None"); goto raise_error; } } if (PyType_Check(type)) { #if CYTHON_COMPILING_IN_PYPY if (!value) { Py_INCREF(Py_None); value = Py_None; } #endif PyErr_NormalizeException(&type, &value, &tb); } else { if (value) { PyErr_SetString(PyExc_TypeError, "instance exception may not have a separate value"); goto raise_error; } value = type; type = (PyObject*) Py_TYPE(type); Py_INCREF(type); if (!PyType_IsSubtype((PyTypeObject *)type, (PyTypeObject *)PyExc_BaseException)) { PyErr_SetString(PyExc_TypeError, "raise: exception class must be a subclass of BaseException"); goto raise_error; } } __Pyx_ErrRestore(type, value, tb); return; raise_error: Py_XDECREF(value); Py_XDECREF(type); Py_XDECREF(tb); return; } #else static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, PyObject *cause) { PyObject* owned_instance = NULL; if (tb == Py_None) { tb = 0; } else if (tb && !PyTraceBack_Check(tb)) { PyErr_SetString(PyExc_TypeError, "raise: arg 3 must be a traceback or None"); goto bad; } if (value == Py_None) value = 0; if (PyExceptionInstance_Check(type)) { if (value) { PyErr_SetString(PyExc_TypeError, "instance exception may not have a separate value"); goto bad; } value = type; type = (PyObject*) Py_TYPE(value); } else if (PyExceptionClass_Check(type)) { PyObject *instance_class = NULL; if (value && PyExceptionInstance_Check(value)) { instance_class = (PyObject*) Py_TYPE(value); if (instance_class != type) { int is_subclass = PyObject_IsSubclass(instance_class, type); if (!is_subclass) { instance_class = NULL; } else if (unlikely(is_subclass == -1)) { goto bad; } else { type = instance_class; } } } if (!instance_class) { PyObject *args; if (!value) args = PyTuple_New(0); else if (PyTuple_Check(value)) { Py_INCREF(value); args = value; } else args = PyTuple_Pack(1, value); if (!args) goto bad; owned_instance = PyObject_Call(type, args, NULL); Py_DECREF(args); if (!owned_instance) goto bad; value = owned_instance; if (!PyExceptionInstance_Check(value)) { PyErr_Format(PyExc_TypeError, "calling %R should have returned an instance of " "BaseException, not %R", type, Py_TYPE(value)); goto bad; } } } else { PyErr_SetString(PyExc_TypeError, "raise: exception class must be a subclass of BaseException"); goto bad; } #if PY_VERSION_HEX >= 0x03030000 if (cause) { #else if (cause && cause != Py_None) { #endif PyObject *fixed_cause; if (cause == Py_None) { fixed_cause = NULL; } else if (PyExceptionClass_Check(cause)) { fixed_cause = PyObject_CallObject(cause, NULL); if (fixed_cause == NULL) goto bad; } else if (PyExceptionInstance_Check(cause)) { fixed_cause = cause; Py_INCREF(fixed_cause); } else { PyErr_SetString(PyExc_TypeError, "exception causes must derive from " "BaseException"); goto bad; } PyException_SetCause(value, fixed_cause); } PyErr_SetObject(type, value); if (tb) { #if CYTHON_COMPILING_IN_PYPY PyObject *tmp_type, *tmp_value, *tmp_tb; PyErr_Fetch(&tmp_type, &tmp_value, &tmp_tb); Py_INCREF(tb); PyErr_Restore(tmp_type, tmp_value, tb); Py_XDECREF(tmp_tb); #else PyThreadState *tstate = PyThreadState_GET(); PyObject* tmp_tb = tstate->curexc_traceback; if (tb != tmp_tb) { Py_INCREF(tb); tstate->curexc_traceback = tb; Py_XDECREF(tmp_tb); } #endif } bad: Py_XDECREF(owned_instance); return; } #endif static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Generic(PyObject *o, PyObject* j) { PyObject *r; if (!j) return NULL; r = PyObject_GetItem(o, j); Py_DECREF(j); return r; } static CYTHON_INLINE PyObject *__Pyx_GetItemInt_List_Fast(PyObject *o, Py_ssize_t i, CYTHON_NCP_UNUSED int wraparound, CYTHON_NCP_UNUSED int boundscheck) { #if CYTHON_COMPILING_IN_CPYTHON if (wraparound & unlikely(i < 0)) i += PyList_GET_SIZE(o); if ((!boundscheck) || likely((0 <= i) & (i < PyList_GET_SIZE(o)))) { PyObject *r = PyList_GET_ITEM(o, i); Py_INCREF(r); return r; } return __Pyx_GetItemInt_Generic(o, PyInt_FromSsize_t(i)); #else return PySequence_GetItem(o, i); #endif } static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Tuple_Fast(PyObject *o, Py_ssize_t i, CYTHON_NCP_UNUSED int wraparound, CYTHON_NCP_UNUSED int boundscheck) { #if CYTHON_COMPILING_IN_CPYTHON if (wraparound & unlikely(i < 0)) i += PyTuple_GET_SIZE(o); if ((!boundscheck) || likely((0 <= i) & (i < PyTuple_GET_SIZE(o)))) { PyObject *r = PyTuple_GET_ITEM(o, i); Py_INCREF(r); return r; } return __Pyx_GetItemInt_Generic(o, PyInt_FromSsize_t(i)); #else return PySequence_GetItem(o, i); #endif } static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Fast(PyObject *o, Py_ssize_t i, int is_list, CYTHON_NCP_UNUSED int wraparound, CYTHON_NCP_UNUSED int boundscheck) { #if CYTHON_COMPILING_IN_CPYTHON if (is_list || PyList_CheckExact(o)) { Py_ssize_t n = ((!wraparound) | likely(i >= 0)) ? i : i + PyList_GET_SIZE(o); if ((!boundscheck) || (likely((n >= 0) & (n < PyList_GET_SIZE(o))))) { PyObject *r = PyList_GET_ITEM(o, n); Py_INCREF(r); return r; } } else if (PyTuple_CheckExact(o)) { Py_ssize_t n = ((!wraparound) | likely(i >= 0)) ? i : i + PyTuple_GET_SIZE(o); if ((!boundscheck) || likely((n >= 0) & (n < PyTuple_GET_SIZE(o)))) { PyObject *r = PyTuple_GET_ITEM(o, n); Py_INCREF(r); return r; } } else { PySequenceMethods *m = Py_TYPE(o)->tp_as_sequence; if (likely(m && m->sq_item)) { if (wraparound && unlikely(i < 0) && likely(m->sq_length)) { Py_ssize_t l = m->sq_length(o); if (likely(l >= 0)) { i += l; } else { if (PyErr_ExceptionMatches(PyExc_OverflowError)) PyErr_Clear(); else return NULL; } } return m->sq_item(o, i); } } #else if (is_list || PySequence_Check(o)) { return PySequence_GetItem(o, i); } #endif return __Pyx_GetItemInt_Generic(o, PyInt_FromSsize_t(i)); } static CYTHON_INLINE int __Pyx_PyBytes_Equals(PyObject* s1, PyObject* s2, int equals) { #if CYTHON_COMPILING_IN_PYPY return PyObject_RichCompareBool(s1, s2, equals); #else if (s1 == s2) { return (equals == Py_EQ); } else if (PyBytes_CheckExact(s1) & PyBytes_CheckExact(s2)) { const char *ps1, *ps2; Py_ssize_t length = PyBytes_GET_SIZE(s1); if (length != PyBytes_GET_SIZE(s2)) return (equals == Py_NE); ps1 = PyBytes_AS_STRING(s1); ps2 = PyBytes_AS_STRING(s2); if (ps1[0] != ps2[0]) { return (equals == Py_NE); } else if (length == 1) { return (equals == Py_EQ); } else { int result = memcmp(ps1, ps2, (size_t)length); return (equals == Py_EQ) ? (result == 0) : (result != 0); } } else if ((s1 == Py_None) & PyBytes_CheckExact(s2)) { return (equals == Py_NE); } else if ((s2 == Py_None) & PyBytes_CheckExact(s1)) { return (equals == Py_NE); } else { int result; PyObject* py_result = PyObject_RichCompare(s1, s2, equals); if (!py_result) return -1; result = __Pyx_PyObject_IsTrue(py_result); Py_DECREF(py_result); return result; } #endif } static CYTHON_INLINE PyObject* __Pyx_PyObject_GetSlice(PyObject* obj, Py_ssize_t cstart, Py_ssize_t cstop, PyObject** _py_start, PyObject** _py_stop, PyObject** _py_slice, int has_cstart, int has_cstop, CYTHON_UNUSED int wraparound) { #if CYTHON_COMPILING_IN_CPYTHON PyMappingMethods* mp; #if PY_MAJOR_VERSION < 3 PySequenceMethods* ms = Py_TYPE(obj)->tp_as_sequence; if (likely(ms && ms->sq_slice)) { if (!has_cstart) { if (_py_start && (*_py_start != Py_None)) { cstart = __Pyx_PyIndex_AsSsize_t(*_py_start); if ((cstart == (Py_ssize_t)-1) && PyErr_Occurred()) goto bad; } else cstart = 0; } if (!has_cstop) { if (_py_stop && (*_py_stop != Py_None)) { cstop = __Pyx_PyIndex_AsSsize_t(*_py_stop); if ((cstop == (Py_ssize_t)-1) && PyErr_Occurred()) goto bad; } else cstop = PY_SSIZE_T_MAX; } if (wraparound && unlikely((cstart < 0) | (cstop < 0)) && likely(ms->sq_length)) { Py_ssize_t l = ms->sq_length(obj); if (likely(l >= 0)) { if (cstop < 0) { cstop += l; if (cstop < 0) cstop = 0; } if (cstart < 0) { cstart += l; if (cstart < 0) cstart = 0; } } else { if (PyErr_ExceptionMatches(PyExc_OverflowError)) PyErr_Clear(); else goto bad; } } return ms->sq_slice(obj, cstart, cstop); } #endif mp = Py_TYPE(obj)->tp_as_mapping; if (likely(mp && mp->mp_subscript)) #endif { PyObject* result; PyObject *py_slice, *py_start, *py_stop; if (_py_slice) { py_slice = *_py_slice; } else { PyObject* owned_start = NULL; PyObject* owned_stop = NULL; if (_py_start) { py_start = *_py_start; } else { if (has_cstart) { owned_start = py_start = PyInt_FromSsize_t(cstart); if (unlikely(!py_start)) goto bad; } else py_start = Py_None; } if (_py_stop) { py_stop = *_py_stop; } else { if (has_cstop) { owned_stop = py_stop = PyInt_FromSsize_t(cstop); if (unlikely(!py_stop)) { Py_XDECREF(owned_start); goto bad; } } else py_stop = Py_None; } py_slice = PySlice_New(py_start, py_stop, Py_None); Py_XDECREF(owned_start); Py_XDECREF(owned_stop); if (unlikely(!py_slice)) goto bad; } #if CYTHON_COMPILING_IN_CPYTHON result = mp->mp_subscript(obj, py_slice); #else result = PyObject_GetItem(obj, py_slice); #endif if (!_py_slice) { Py_DECREF(py_slice); } return result; } PyErr_Format(PyExc_TypeError, "'%.200s' object is unsliceable", Py_TYPE(obj)->tp_name); bad: return NULL; } static void __Pyx_RaiseDoubleKeywordsError( const char* func_name, PyObject* kw_name) { PyErr_Format(PyExc_TypeError, #if PY_MAJOR_VERSION >= 3 "%s() got multiple values for keyword argument '%U'", func_name, kw_name); #else "%s() got multiple values for keyword argument '%s'", func_name, PyString_AsString(kw_name)); #endif } static int __Pyx_ParseOptionalKeywords( PyObject *kwds, PyObject **argnames[], PyObject *kwds2, PyObject *values[], Py_ssize_t num_pos_args, const char* function_name) { PyObject *key = 0, *value = 0; Py_ssize_t pos = 0; PyObject*** name; PyObject*** first_kw_arg = argnames + num_pos_args; while (PyDict_Next(kwds, &pos, &key, &value)) { name = first_kw_arg; while (*name && (**name != key)) name++; if (*name) { values[name-argnames] = value; continue; } name = first_kw_arg; #if PY_MAJOR_VERSION < 3 if (likely(PyString_CheckExact(key)) || likely(PyString_Check(key))) { while (*name) { if ((CYTHON_COMPILING_IN_PYPY || PyString_GET_SIZE(**name) == PyString_GET_SIZE(key)) && _PyString_Eq(**name, key)) { values[name-argnames] = value; break; } name++; } if (*name) continue; else { PyObject*** argname = argnames; while (argname != first_kw_arg) { if ((**argname == key) || ( (CYTHON_COMPILING_IN_PYPY || PyString_GET_SIZE(**argname) == PyString_GET_SIZE(key)) && _PyString_Eq(**argname, key))) { goto arg_passed_twice; } argname++; } } } else #endif if (likely(PyUnicode_Check(key))) { while (*name) { int cmp = (**name == key) ? 0 : #if !CYTHON_COMPILING_IN_PYPY && PY_MAJOR_VERSION >= 3 (PyUnicode_GET_SIZE(**name) != PyUnicode_GET_SIZE(key)) ? 1 : #endif PyUnicode_Compare(**name, key); if (cmp < 0 && unlikely(PyErr_Occurred())) goto bad; if (cmp == 0) { values[name-argnames] = value; break; } name++; } if (*name) continue; else { PyObject*** argname = argnames; while (argname != first_kw_arg) { int cmp = (**argname == key) ? 0 : #if !CYTHON_COMPILING_IN_PYPY && PY_MAJOR_VERSION >= 3 (PyUnicode_GET_SIZE(**argname) != PyUnicode_GET_SIZE(key)) ? 1 : #endif PyUnicode_Compare(**argname, key); if (cmp < 0 && unlikely(PyErr_Occurred())) goto bad; if (cmp == 0) goto arg_passed_twice; argname++; } } } else goto invalid_keyword_type; if (kwds2) { if (unlikely(PyDict_SetItem(kwds2, key, value))) goto bad; } else { goto invalid_keyword; } } return 0; arg_passed_twice: __Pyx_RaiseDoubleKeywordsError(function_name, key); goto bad; invalid_keyword_type: PyErr_Format(PyExc_TypeError, "%.200s() keywords must be strings", function_name); goto bad; invalid_keyword: PyErr_Format(PyExc_TypeError, #if PY_MAJOR_VERSION < 3 "%.200s() got an unexpected keyword argument '%.200s'", function_name, PyString_AsString(key)); #else "%s() got an unexpected keyword argument '%U'", function_name, key); #endif bad: return -1; } static void __Pyx_RaiseArgtupleInvalid( const char* func_name, int exact, Py_ssize_t num_min, Py_ssize_t num_max, Py_ssize_t num_found) { Py_ssize_t num_expected; const char *more_or_less; if (num_found < num_min) { num_expected = num_min; more_or_less = "at least"; } else { num_expected = num_max; more_or_less = "at most"; } if (exact) { more_or_less = "exactly"; } PyErr_Format(PyExc_TypeError, "%.200s() takes %.8s %" CYTHON_FORMAT_SSIZE_T "d positional argument%.1s (%" CYTHON_FORMAT_SSIZE_T "d given)", func_name, more_or_less, num_expected, (num_expected == 1) ? "" : "s", num_found); } static CYTHON_INLINE int __Pyx_PyUnicode_Equals(PyObject* s1, PyObject* s2, int equals) { #if CYTHON_COMPILING_IN_PYPY return PyObject_RichCompareBool(s1, s2, equals); #else #if PY_MAJOR_VERSION < 3 PyObject* owned_ref = NULL; #endif int s1_is_unicode, s2_is_unicode; if (s1 == s2) { goto return_eq; } s1_is_unicode = PyUnicode_CheckExact(s1); s2_is_unicode = PyUnicode_CheckExact(s2); #if PY_MAJOR_VERSION < 3 if ((s1_is_unicode & (!s2_is_unicode)) && PyString_CheckExact(s2)) { owned_ref = PyUnicode_FromObject(s2); if (unlikely(!owned_ref)) return -1; s2 = owned_ref; s2_is_unicode = 1; } else if ((s2_is_unicode & (!s1_is_unicode)) && PyString_CheckExact(s1)) { owned_ref = PyUnicode_FromObject(s1); if (unlikely(!owned_ref)) return -1; s1 = owned_ref; s1_is_unicode = 1; } else if (((!s2_is_unicode) & (!s1_is_unicode))) { return __Pyx_PyBytes_Equals(s1, s2, equals); } #endif if (s1_is_unicode & s2_is_unicode) { Py_ssize_t length; int kind; void *data1, *data2; if (unlikely(__Pyx_PyUnicode_READY(s1) < 0) || unlikely(__Pyx_PyUnicode_READY(s2) < 0)) return -1; length = __Pyx_PyUnicode_GET_LENGTH(s1); if (length != __Pyx_PyUnicode_GET_LENGTH(s2)) { goto return_ne; } kind = __Pyx_PyUnicode_KIND(s1); if (kind != __Pyx_PyUnicode_KIND(s2)) { goto return_ne; } data1 = __Pyx_PyUnicode_DATA(s1); data2 = __Pyx_PyUnicode_DATA(s2); if (__Pyx_PyUnicode_READ(kind, data1, 0) != __Pyx_PyUnicode_READ(kind, data2, 0)) { goto return_ne; } else if (length == 1) { goto return_eq; } else { int result = memcmp(data1, data2, (size_t)(length * kind)); #if PY_MAJOR_VERSION < 3 Py_XDECREF(owned_ref); #endif return (equals == Py_EQ) ? (result == 0) : (result != 0); } } else if ((s1 == Py_None) & s2_is_unicode) { goto return_ne; } else if ((s2 == Py_None) & s1_is_unicode) { goto return_ne; } else { int result; PyObject* py_result = PyObject_RichCompare(s1, s2, equals); if (!py_result) return -1; result = __Pyx_PyObject_IsTrue(py_result); Py_DECREF(py_result); return result; } return_eq: #if PY_MAJOR_VERSION < 3 Py_XDECREF(owned_ref); #endif return (equals == Py_EQ); return_ne: #if PY_MAJOR_VERSION < 3 Py_XDECREF(owned_ref); #endif return (equals == Py_NE); #endif } static CYTHON_INLINE void __Pyx_ExceptionSave(PyObject **type, PyObject **value, PyObject **tb) { #if CYTHON_COMPILING_IN_CPYTHON PyThreadState *tstate = PyThreadState_GET(); *type = tstate->exc_type; *value = tstate->exc_value; *tb = tstate->exc_traceback; Py_XINCREF(*type); Py_XINCREF(*value); Py_XINCREF(*tb); #else PyErr_GetExcInfo(type, value, tb); #endif } static void __Pyx_ExceptionReset(PyObject *type, PyObject *value, PyObject *tb) { #if CYTHON_COMPILING_IN_CPYTHON PyObject *tmp_type, *tmp_value, *tmp_tb; PyThreadState *tstate = PyThreadState_GET(); tmp_type = tstate->exc_type; tmp_value = tstate->exc_value; tmp_tb = tstate->exc_traceback; tstate->exc_type = type; tstate->exc_value = value; tstate->exc_traceback = tb; Py_XDECREF(tmp_type); Py_XDECREF(tmp_value); Py_XDECREF(tmp_tb); #else PyErr_SetExcInfo(type, value, tb); #endif } static int __Pyx_GetException(PyObject **type, PyObject **value, PyObject **tb) { PyObject *local_type, *local_value, *local_tb; #if CYTHON_COMPILING_IN_CPYTHON PyObject *tmp_type, *tmp_value, *tmp_tb; PyThreadState *tstate = PyThreadState_GET(); local_type = tstate->curexc_type; local_value = tstate->curexc_value; local_tb = tstate->curexc_traceback; tstate->curexc_type = 0; tstate->curexc_value = 0; tstate->curexc_traceback = 0; #else PyErr_Fetch(&local_type, &local_value, &local_tb); #endif PyErr_NormalizeException(&local_type, &local_value, &local_tb); #if CYTHON_COMPILING_IN_CPYTHON if (unlikely(tstate->curexc_type)) #else if (unlikely(PyErr_Occurred())) #endif goto bad; #if PY_MAJOR_VERSION >= 3 if (local_tb) { if (unlikely(PyException_SetTraceback(local_value, local_tb) < 0)) goto bad; } #endif Py_XINCREF(local_tb); Py_XINCREF(local_type); Py_XINCREF(local_value); *type = local_type; *value = local_value; *tb = local_tb; #if CYTHON_COMPILING_IN_CPYTHON tmp_type = tstate->exc_type; tmp_value = tstate->exc_value; tmp_tb = tstate->exc_traceback; tstate->exc_type = local_type; tstate->exc_value = local_value; tstate->exc_traceback = local_tb; Py_XDECREF(tmp_type); Py_XDECREF(tmp_value); Py_XDECREF(tmp_tb); #else PyErr_SetExcInfo(local_type, local_value, local_tb); #endif return 0; bad: *type = 0; *value = 0; *tb = 0; Py_XDECREF(local_type); Py_XDECREF(local_value); Py_XDECREF(local_tb); return -1; } static void __Pyx_RaiseArgumentTypeInvalid(const char* name, PyObject *obj, PyTypeObject *type) { PyErr_Format(PyExc_TypeError, "Argument '%.200s' has incorrect type (expected %.200s, got %.200s)", name, type->tp_name, Py_TYPE(obj)->tp_name); } static CYTHON_INLINE int __Pyx_ArgTypeTest(PyObject *obj, PyTypeObject *type, int none_allowed, const char *name, int exact) { if (unlikely(!type)) { PyErr_SetString(PyExc_SystemError, "Missing type object"); return 0; } if (none_allowed && obj == Py_None) return 1; else if (exact) { if (likely(Py_TYPE(obj) == type)) return 1; #if PY_MAJOR_VERSION == 2 else if ((type == &PyBaseString_Type) && likely(__Pyx_PyBaseString_CheckExact(obj))) return 1; #endif } else { if (likely(PyObject_TypeCheck(obj, type))) return 1; } __Pyx_RaiseArgumentTypeInvalid(name, obj, type); return 0; } static void* __Pyx_GetVtable(PyObject *dict) { void* ptr; PyObject *ob = PyObject_GetItem(dict, __pyx_n_s_pyx_vtable); if (!ob) goto bad; #if PY_VERSION_HEX >= 0x02070000 ptr = PyCapsule_GetPointer(ob, 0); #else ptr = PyCObject_AsVoidPtr(ob); #endif if (!ptr && !PyErr_Occurred()) PyErr_SetString(PyExc_RuntimeError, "invalid vtable found for imported type"); Py_DECREF(ob); return ptr; bad: Py_XDECREF(ob); return NULL; } static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list, int level) { PyObject *empty_list = 0; PyObject *module = 0; PyObject *global_dict = 0; PyObject *empty_dict = 0; PyObject *list; #if PY_VERSION_HEX < 0x03030000 PyObject *py_import; py_import = __Pyx_PyObject_GetAttrStr(__pyx_b, __pyx_n_s_import); if (!py_import) goto bad; #endif if (from_list) list = from_list; else { empty_list = PyList_New(0); if (!empty_list) goto bad; list = empty_list; } global_dict = PyModule_GetDict(__pyx_m); if (!global_dict) goto bad; empty_dict = PyDict_New(); if (!empty_dict) goto bad; { #if PY_MAJOR_VERSION >= 3 if (level == -1) { if (strchr(__Pyx_MODULE_NAME, '.')) { #if PY_VERSION_HEX < 0x03030000 PyObject *py_level = PyInt_FromLong(1); if (!py_level) goto bad; module = PyObject_CallFunctionObjArgs(py_import, name, global_dict, empty_dict, list, py_level, NULL); Py_DECREF(py_level); #else module = PyImport_ImportModuleLevelObject( name, global_dict, empty_dict, list, 1); #endif if (!module) { if (!PyErr_ExceptionMatches(PyExc_ImportError)) goto bad; PyErr_Clear(); } } level = 0; } #endif if (!module) { #if PY_VERSION_HEX < 0x03030000 PyObject *py_level = PyInt_FromLong(level); if (!py_level) goto bad; module = PyObject_CallFunctionObjArgs(py_import, name, global_dict, empty_dict, list, py_level, NULL); Py_DECREF(py_level); #else module = PyImport_ImportModuleLevelObject( name, global_dict, empty_dict, list, level); #endif } } bad: #if PY_VERSION_HEX < 0x03030000 Py_XDECREF(py_import); #endif Py_XDECREF(empty_list); Py_XDECREF(empty_dict); return module; } static PyObject* __Pyx_ImportFrom(PyObject* module, PyObject* name) { PyObject* value = __Pyx_PyObject_GetAttrStr(module, name); if (unlikely(!value) && PyErr_ExceptionMatches(PyExc_AttributeError)) { PyErr_Format(PyExc_ImportError, #if PY_MAJOR_VERSION < 3 "cannot import name %.230s", PyString_AS_STRING(name)); #else "cannot import name %S", name); #endif } return value; } static int __pyx_bisect_code_objects(__Pyx_CodeObjectCacheEntry* entries, int count, int code_line) { int start = 0, mid = 0, end = count - 1; if (end >= 0 && code_line > entries[end].code_line) { return count; } while (start < end) { mid = start + (end - start) / 2; if (code_line < entries[mid].code_line) { end = mid; } else if (code_line > entries[mid].code_line) { start = mid + 1; } else { return mid; } } if (code_line <= entries[mid].code_line) { return mid; } else { return mid + 1; } } static PyCodeObject *__pyx_find_code_object(int code_line) { PyCodeObject* code_object; int pos; if (unlikely(!code_line) || unlikely(!__pyx_code_cache.entries)) { return NULL; } pos = __pyx_bisect_code_objects(__pyx_code_cache.entries, __pyx_code_cache.count, code_line); if (unlikely(pos >= __pyx_code_cache.count) || unlikely(__pyx_code_cache.entries[pos].code_line != code_line)) { return NULL; } code_object = __pyx_code_cache.entries[pos].code_object; Py_INCREF(code_object); return code_object; } static void __pyx_insert_code_object(int code_line, PyCodeObject* code_object) { int pos, i; __Pyx_CodeObjectCacheEntry* entries = __pyx_code_cache.entries; if (unlikely(!code_line)) { return; } if (unlikely(!entries)) { entries = (__Pyx_CodeObjectCacheEntry*)PyMem_Malloc(64*sizeof(__Pyx_CodeObjectCacheEntry)); if (likely(entries)) { __pyx_code_cache.entries = entries; __pyx_code_cache.max_count = 64; __pyx_code_cache.count = 1; entries[0].code_line = code_line; entries[0].code_object = code_object; Py_INCREF(code_object); } return; } pos = __pyx_bisect_code_objects(__pyx_code_cache.entries, __pyx_code_cache.count, code_line); if ((pos < __pyx_code_cache.count) && unlikely(__pyx_code_cache.entries[pos].code_line == code_line)) { PyCodeObject* tmp = entries[pos].code_object; entries[pos].code_object = code_object; Py_DECREF(tmp); return; } if (__pyx_code_cache.count == __pyx_code_cache.max_count) { int new_max = __pyx_code_cache.max_count + 64; entries = (__Pyx_CodeObjectCacheEntry*)PyMem_Realloc( __pyx_code_cache.entries, (size_t)new_max*sizeof(__Pyx_CodeObjectCacheEntry)); if (unlikely(!entries)) { return; } __pyx_code_cache.entries = entries; __pyx_code_cache.max_count = new_max; } for (i=__pyx_code_cache.count; i>pos; i--) { entries[i] = entries[i-1]; } entries[pos].code_line = code_line; entries[pos].code_object = code_object; __pyx_code_cache.count++; Py_INCREF(code_object); } #include "compile.h" #include "frameobject.h" #include "traceback.h" static PyCodeObject* __Pyx_CreateCodeObjectForTraceback( const char *funcname, int c_line, int py_line, const char *filename) { PyCodeObject *py_code = 0; PyObject *py_srcfile = 0; PyObject *py_funcname = 0; #if PY_MAJOR_VERSION < 3 py_srcfile = PyString_FromString(filename); #else py_srcfile = PyUnicode_FromString(filename); #endif if (!py_srcfile) goto bad; if (c_line) { #if PY_MAJOR_VERSION < 3 py_funcname = PyString_FromFormat( "%s (%s:%d)", funcname, __pyx_cfilenm, c_line); #else py_funcname = PyUnicode_FromFormat( "%s (%s:%d)", funcname, __pyx_cfilenm, c_line); #endif } else { #if PY_MAJOR_VERSION < 3 py_funcname = PyString_FromString(funcname); #else py_funcname = PyUnicode_FromString(funcname); #endif } if (!py_funcname) goto bad; py_code = __Pyx_PyCode_New( 0, 0, 0, 0, 0, __pyx_empty_bytes, /*PyObject *code,*/ __pyx_empty_tuple, /*PyObject *consts,*/ __pyx_empty_tuple, /*PyObject *names,*/ __pyx_empty_tuple, /*PyObject *varnames,*/ __pyx_empty_tuple, /*PyObject *freevars,*/ __pyx_empty_tuple, /*PyObject *cellvars,*/ py_srcfile, /*PyObject *filename,*/ py_funcname, /*PyObject *name,*/ py_line, __pyx_empty_bytes /*PyObject *lnotab*/ ); Py_DECREF(py_srcfile); Py_DECREF(py_funcname); return py_code; bad: Py_XDECREF(py_srcfile); Py_XDECREF(py_funcname); return NULL; } static void __Pyx_AddTraceback(const char *funcname, int c_line, int py_line, const char *filename) { PyCodeObject *py_code = 0; PyFrameObject *py_frame = 0; py_code = __pyx_find_code_object(c_line ? c_line : py_line); if (!py_code) { py_code = __Pyx_CreateCodeObjectForTraceback( funcname, c_line, py_line, filename); if (!py_code) goto bad; __pyx_insert_code_object(c_line ? c_line : py_line, py_code); } py_frame = PyFrame_New( PyThreadState_GET(), /*PyThreadState *tstate,*/ py_code, /*PyCodeObject *code,*/ __pyx_d, /*PyObject *globals,*/ 0 /*PyObject *locals*/ ); if (!py_frame) goto bad; py_frame->f_lineno = py_line; PyTraceBack_Here(py_frame); bad: Py_XDECREF(py_code); Py_XDECREF(py_frame); } static CYTHON_INLINE PyObject* __Pyx_PyInt_From_long(long value) { const long neg_one = (long) -1, const_zero = (long) 0; const int is_unsigned = neg_one > const_zero; if (is_unsigned) { if (sizeof(long) < sizeof(long)) { return PyInt_FromLong((long) value); } else if (sizeof(long) <= sizeof(unsigned long)) { return PyLong_FromUnsignedLong((unsigned long) value); } else if (sizeof(long) <= sizeof(unsigned PY_LONG_LONG)) { return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value); } } else { if (sizeof(long) <= sizeof(long)) { return PyInt_FromLong((long) value); } else if (sizeof(long) <= sizeof(PY_LONG_LONG)) { return PyLong_FromLongLong((PY_LONG_LONG) value); } } { int one = 1; int little = (int)*(unsigned char *)&one; unsigned char *bytes = (unsigned char *)&value; return _PyLong_FromByteArray(bytes, sizeof(long), little, !is_unsigned); } } #define __PYX_VERIFY_RETURN_INT(target_type, func_type, func_value)\ __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, 0) #define __PYX_VERIFY_RETURN_INT_EXC(target_type, func_type, func_value)\ __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, 1) #define __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, exc)\ {\ func_type value = func_value;\ if (sizeof(target_type) < sizeof(func_type)) {\ if (unlikely(value != (func_type) (target_type) value)) {\ func_type zero = 0;\ if (exc && unlikely(value == (func_type)-1 && PyErr_Occurred()))\ return (target_type) -1;\ if (is_unsigned && unlikely(value < zero))\ goto raise_neg_overflow;\ else\ goto raise_overflow;\ }\ }\ return (target_type) value;\ } #if CYTHON_USE_PYLONG_INTERNALS #include "longintrepr.h" #endif static CYTHON_INLINE int __Pyx_PyInt_As_int(PyObject *x) { const int neg_one = (int) -1, const_zero = (int) 0; const int is_unsigned = neg_one > const_zero; #if PY_MAJOR_VERSION < 3 if (likely(PyInt_Check(x))) { if (sizeof(int) < sizeof(long)) { __PYX_VERIFY_RETURN_INT(int, long, PyInt_AS_LONG(x)) } else { long val = PyInt_AS_LONG(x); if (is_unsigned && unlikely(val < 0)) { goto raise_neg_overflow; } return (int) val; } } else #endif if (likely(PyLong_Check(x))) { if (is_unsigned) { #if CYTHON_USE_PYLONG_INTERNALS const digit* digits = ((PyLongObject*)x)->ob_digit; switch (Py_SIZE(x)) { case 0: return (int) 0; case 1: __PYX_VERIFY_RETURN_INT(int, digit, digits[0]) case 2: if (8 * sizeof(int) > 1 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(int) >= 2 * PyLong_SHIFT) { return (int) (((((int)digits[1]) << PyLong_SHIFT) | (int)digits[0])); } } break; case 3: if (8 * sizeof(int) > 2 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(int) >= 3 * PyLong_SHIFT) { return (int) (((((((int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0])); } } break; case 4: if (8 * sizeof(int) > 3 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(int) >= 4 * PyLong_SHIFT) { return (int) (((((((((int)digits[3]) << PyLong_SHIFT) | (int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0])); } } break; } #endif #if CYTHON_COMPILING_IN_CPYTHON if (unlikely(Py_SIZE(x) < 0)) { goto raise_neg_overflow; } #else { int result = PyObject_RichCompareBool(x, Py_False, Py_LT); if (unlikely(result < 0)) return (int) -1; if (unlikely(result == 1)) goto raise_neg_overflow; } #endif if (sizeof(int) <= sizeof(unsigned long)) { __PYX_VERIFY_RETURN_INT_EXC(int, unsigned long, PyLong_AsUnsignedLong(x)) } else if (sizeof(int) <= sizeof(unsigned PY_LONG_LONG)) { __PYX_VERIFY_RETURN_INT_EXC(int, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x)) } } else { #if CYTHON_USE_PYLONG_INTERNALS const digit* digits = ((PyLongObject*)x)->ob_digit; switch (Py_SIZE(x)) { case 0: return (int) 0; case -1: __PYX_VERIFY_RETURN_INT(int, sdigit, -(sdigit) digits[0]) case 1: __PYX_VERIFY_RETURN_INT(int, digit, +digits[0]) case -2: if (8 * sizeof(int) - 1 > 1 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(int, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(int) - 1 > 2 * PyLong_SHIFT) { return (int) (((int)-1)*(((((int)digits[1]) << PyLong_SHIFT) | (int)digits[0]))); } } break; case 2: if (8 * sizeof(int) > 1 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(int) - 1 > 2 * PyLong_SHIFT) { return (int) ((((((int)digits[1]) << PyLong_SHIFT) | (int)digits[0]))); } } break; case -3: if (8 * sizeof(int) - 1 > 2 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(int, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(int) - 1 > 3 * PyLong_SHIFT) { return (int) (((int)-1)*(((((((int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0]))); } } break; case 3: if (8 * sizeof(int) > 2 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(int) - 1 > 3 * PyLong_SHIFT) { return (int) ((((((((int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0]))); } } break; case -4: if (8 * sizeof(int) - 1 > 3 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(int, long, -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(int) - 1 > 4 * PyLong_SHIFT) { return (int) (((int)-1)*(((((((((int)digits[3]) << PyLong_SHIFT) | (int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0]))); } } break; case 4: if (8 * sizeof(int) > 3 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(int) - 1 > 4 * PyLong_SHIFT) { return (int) ((((((((((int)digits[3]) << PyLong_SHIFT) | (int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0]))); } } break; } #endif if (sizeof(int) <= sizeof(long)) { __PYX_VERIFY_RETURN_INT_EXC(int, long, PyLong_AsLong(x)) } else if (sizeof(int) <= sizeof(PY_LONG_LONG)) { __PYX_VERIFY_RETURN_INT_EXC(int, PY_LONG_LONG, PyLong_AsLongLong(x)) } } { #if CYTHON_COMPILING_IN_PYPY && !defined(_PyLong_AsByteArray) PyErr_SetString(PyExc_RuntimeError, "_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers"); #else int val; PyObject *v = __Pyx_PyNumber_Int(x); #if PY_MAJOR_VERSION < 3 if (likely(v) && !PyLong_Check(v)) { PyObject *tmp = v; v = PyNumber_Long(tmp); Py_DECREF(tmp); } #endif if (likely(v)) { int one = 1; int is_little = (int)*(unsigned char *)&one; unsigned char *bytes = (unsigned char *)&val; int ret = _PyLong_AsByteArray((PyLongObject *)v, bytes, sizeof(val), is_little, !is_unsigned); Py_DECREF(v); if (likely(!ret)) return val; } #endif return (int) -1; } } else { int val; PyObject *tmp = __Pyx_PyNumber_Int(x); if (!tmp) return (int) -1; val = __Pyx_PyInt_As_int(tmp); Py_DECREF(tmp); return val; } raise_overflow: PyErr_SetString(PyExc_OverflowError, "value too large to convert to int"); return (int) -1; raise_neg_overflow: PyErr_SetString(PyExc_OverflowError, "can't convert negative value to int"); return (int) -1; } static CYTHON_INLINE long __Pyx_PyInt_As_long(PyObject *x) { const long neg_one = (long) -1, const_zero = (long) 0; const int is_unsigned = neg_one > const_zero; #if PY_MAJOR_VERSION < 3 if (likely(PyInt_Check(x))) { if (sizeof(long) < sizeof(long)) { __PYX_VERIFY_RETURN_INT(long, long, PyInt_AS_LONG(x)) } else { long val = PyInt_AS_LONG(x); if (is_unsigned && unlikely(val < 0)) { goto raise_neg_overflow; } return (long) val; } } else #endif if (likely(PyLong_Check(x))) { if (is_unsigned) { #if CYTHON_USE_PYLONG_INTERNALS const digit* digits = ((PyLongObject*)x)->ob_digit; switch (Py_SIZE(x)) { case 0: return (long) 0; case 1: __PYX_VERIFY_RETURN_INT(long, digit, digits[0]) case 2: if (8 * sizeof(long) > 1 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(long) >= 2 * PyLong_SHIFT) { return (long) (((((long)digits[1]) << PyLong_SHIFT) | (long)digits[0])); } } break; case 3: if (8 * sizeof(long) > 2 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(long) >= 3 * PyLong_SHIFT) { return (long) (((((((long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0])); } } break; case 4: if (8 * sizeof(long) > 3 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(long) >= 4 * PyLong_SHIFT) { return (long) (((((((((long)digits[3]) << PyLong_SHIFT) | (long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0])); } } break; } #endif #if CYTHON_COMPILING_IN_CPYTHON if (unlikely(Py_SIZE(x) < 0)) { goto raise_neg_overflow; } #else { int result = PyObject_RichCompareBool(x, Py_False, Py_LT); if (unlikely(result < 0)) return (long) -1; if (unlikely(result == 1)) goto raise_neg_overflow; } #endif if (sizeof(long) <= sizeof(unsigned long)) { __PYX_VERIFY_RETURN_INT_EXC(long, unsigned long, PyLong_AsUnsignedLong(x)) } else if (sizeof(long) <= sizeof(unsigned PY_LONG_LONG)) { __PYX_VERIFY_RETURN_INT_EXC(long, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x)) } } else { #if CYTHON_USE_PYLONG_INTERNALS const digit* digits = ((PyLongObject*)x)->ob_digit; switch (Py_SIZE(x)) { case 0: return (long) 0; case -1: __PYX_VERIFY_RETURN_INT(long, sdigit, -(sdigit) digits[0]) case 1: __PYX_VERIFY_RETURN_INT(long, digit, +digits[0]) case -2: if (8 * sizeof(long) - 1 > 1 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(long, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) { return (long) (((long)-1)*(((((long)digits[1]) << PyLong_SHIFT) | (long)digits[0]))); } } break; case 2: if (8 * sizeof(long) > 1 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) { return (long) ((((((long)digits[1]) << PyLong_SHIFT) | (long)digits[0]))); } } break; case -3: if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(long, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) { return (long) (((long)-1)*(((((((long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0]))); } } break; case 3: if (8 * sizeof(long) > 2 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) { return (long) ((((((((long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0]))); } } break; case -4: if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(long, long, -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(long) - 1 > 4 * PyLong_SHIFT) { return (long) (((long)-1)*(((((((((long)digits[3]) << PyLong_SHIFT) | (long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0]))); } } break; case 4: if (8 * sizeof(long) > 3 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(long) - 1 > 4 * PyLong_SHIFT) { return (long) ((((((((((long)digits[3]) << PyLong_SHIFT) | (long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0]))); } } break; } #endif if (sizeof(long) <= sizeof(long)) { __PYX_VERIFY_RETURN_INT_EXC(long, long, PyLong_AsLong(x)) } else if (sizeof(long) <= sizeof(PY_LONG_LONG)) { __PYX_VERIFY_RETURN_INT_EXC(long, PY_LONG_LONG, PyLong_AsLongLong(x)) } } { #if CYTHON_COMPILING_IN_PYPY && !defined(_PyLong_AsByteArray) PyErr_SetString(PyExc_RuntimeError, "_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers"); #else long val; PyObject *v = __Pyx_PyNumber_Int(x); #if PY_MAJOR_VERSION < 3 if (likely(v) && !PyLong_Check(v)) { PyObject *tmp = v; v = PyNumber_Long(tmp); Py_DECREF(tmp); } #endif if (likely(v)) { int one = 1; int is_little = (int)*(unsigned char *)&one; unsigned char *bytes = (unsigned char *)&val; int ret = _PyLong_AsByteArray((PyLongObject *)v, bytes, sizeof(val), is_little, !is_unsigned); Py_DECREF(v); if (likely(!ret)) return val; } #endif return (long) -1; } } else { long val; PyObject *tmp = __Pyx_PyNumber_Int(x); if (!tmp) return (long) -1; val = __Pyx_PyInt_As_long(tmp); Py_DECREF(tmp); return val; } raise_overflow: PyErr_SetString(PyExc_OverflowError, "value too large to convert to long"); return (long) -1; raise_neg_overflow: PyErr_SetString(PyExc_OverflowError, "can't convert negative value to long"); return (long) -1; } static int __Pyx_check_binary_version(void) { char ctversion[4], rtversion[4]; PyOS_snprintf(ctversion, 4, "%d.%d", PY_MAJOR_VERSION, PY_MINOR_VERSION); PyOS_snprintf(rtversion, 4, "%s", Py_GetVersion()); if (ctversion[0] != rtversion[0] || ctversion[2] != rtversion[2]) { char message[200]; PyOS_snprintf(message, sizeof(message), "compiletime version %s of module '%.100s' " "does not match runtime version %s", ctversion, __Pyx_MODULE_NAME, rtversion); return PyErr_WarnEx(NULL, message, 1); } return 0; } #ifndef __PYX_HAVE_RT_ImportModule #define __PYX_HAVE_RT_ImportModule static PyObject *__Pyx_ImportModule(const char *name) { PyObject *py_name = 0; PyObject *py_module = 0; py_name = __Pyx_PyIdentifier_FromString(name); if (!py_name) goto bad; py_module = PyImport_Import(py_name); Py_DECREF(py_name); return py_module; bad: Py_XDECREF(py_name); return 0; } #endif #ifndef __PYX_HAVE_RT_ImportType #define __PYX_HAVE_RT_ImportType static PyTypeObject *__Pyx_ImportType(const char *module_name, const char *class_name, size_t size, int strict) { PyObject *py_module = 0; PyObject *result = 0; PyObject *py_name = 0; char warning[200]; Py_ssize_t basicsize; #ifdef Py_LIMITED_API PyObject *py_basicsize; #endif py_module = __Pyx_ImportModule(module_name); if (!py_module) goto bad; py_name = __Pyx_PyIdentifier_FromString(class_name); if (!py_name) goto bad; result = PyObject_GetAttr(py_module, py_name); Py_DECREF(py_name); py_name = 0; Py_DECREF(py_module); py_module = 0; if (!result) goto bad; if (!PyType_Check(result)) { PyErr_Format(PyExc_TypeError, "%.200s.%.200s is not a type object", module_name, class_name); goto bad; } #ifndef Py_LIMITED_API basicsize = ((PyTypeObject *)result)->tp_basicsize; #else py_basicsize = PyObject_GetAttrString(result, "__basicsize__"); if (!py_basicsize) goto bad; basicsize = PyLong_AsSsize_t(py_basicsize); Py_DECREF(py_basicsize); py_basicsize = 0; if (basicsize == (Py_ssize_t)-1 && PyErr_Occurred()) goto bad; #endif if (!strict && (size_t)basicsize > size) { PyOS_snprintf(warning, sizeof(warning), "%s.%s size changed, may indicate binary incompatibility", module_name, class_name); if (PyErr_WarnEx(NULL, warning, 0) < 0) goto bad; } else if ((size_t)basicsize != size) { PyErr_Format(PyExc_ValueError, "%.200s.%.200s has the wrong size, try recompiling", module_name, class_name); goto bad; } return (PyTypeObject *)result; bad: Py_XDECREF(py_module); Py_XDECREF(result); return NULL; } #endif #ifndef __PYX_HAVE_RT_ImportFunction #define __PYX_HAVE_RT_ImportFunction static int __Pyx_ImportFunction(PyObject *module, const char *funcname, void (**f)(void), const char *sig) { PyObject *d = 0; PyObject *cobj = 0; union { void (*fp)(void); void *p; } tmp; d = PyObject_GetAttrString(module, (char *)"__pyx_capi__"); if (!d) goto bad; cobj = PyDict_GetItemString(d, funcname); if (!cobj) { PyErr_Format(PyExc_ImportError, "%.200s does not export expected C function %.200s", PyModule_GetName(module), funcname); goto bad; } #if PY_VERSION_HEX >= 0x02070000 if (!PyCapsule_IsValid(cobj, sig)) { PyErr_Format(PyExc_TypeError, "C function %.200s.%.200s has wrong signature (expected %.500s, got %.500s)", PyModule_GetName(module), funcname, sig, PyCapsule_GetName(cobj)); goto bad; } tmp.p = PyCapsule_GetPointer(cobj, sig); #else {const char *desc, *s1, *s2; desc = (const char *)PyCObject_GetDesc(cobj); if (!desc) goto bad; s1 = desc; s2 = sig; while (*s1 != '\0' && *s1 == *s2) { s1++; s2++; } if (*s1 != *s2) { PyErr_Format(PyExc_TypeError, "C function %.200s.%.200s has wrong signature (expected %.500s, got %.500s)", PyModule_GetName(module), funcname, sig, desc); goto bad; } tmp.p = PyCObject_AsVoidPtr(cobj);} #endif *f = tmp.fp; if (!(*f)) goto bad; Py_DECREF(d); return 0; bad: Py_XDECREF(d); return -1; } #endif static int __Pyx_InitStrings(__Pyx_StringTabEntry *t) { while (t->p) { #if PY_MAJOR_VERSION < 3 if (t->is_unicode) { *t->p = PyUnicode_DecodeUTF8(t->s, t->n - 1, NULL); } else if (t->intern) { *t->p = PyString_InternFromString(t->s); } else { *t->p = PyString_FromStringAndSize(t->s, t->n - 1); } #else if (t->is_unicode | t->is_str) { if (t->intern) { *t->p = PyUnicode_InternFromString(t->s); } else if (t->encoding) { *t->p = PyUnicode_Decode(t->s, t->n - 1, t->encoding, NULL); } else { *t->p = PyUnicode_FromStringAndSize(t->s, t->n - 1); } } else { *t->p = PyBytes_FromStringAndSize(t->s, t->n - 1); } #endif if (!*t->p) return -1; ++t; } return 0; } static CYTHON_INLINE PyObject* __Pyx_PyUnicode_FromString(const char* c_str) { return __Pyx_PyUnicode_FromStringAndSize(c_str, (Py_ssize_t)strlen(c_str)); } static CYTHON_INLINE char* __Pyx_PyObject_AsString(PyObject* o) { Py_ssize_t ignore; return __Pyx_PyObject_AsStringAndSize(o, &ignore); } static CYTHON_INLINE char* __Pyx_PyObject_AsStringAndSize(PyObject* o, Py_ssize_t *length) { #if CYTHON_COMPILING_IN_CPYTHON && (__PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT) if ( #if PY_MAJOR_VERSION < 3 && __PYX_DEFAULT_STRING_ENCODING_IS_ASCII __Pyx_sys_getdefaultencoding_not_ascii && #endif PyUnicode_Check(o)) { #if PY_VERSION_HEX < 0x03030000 char* defenc_c; PyObject* defenc = _PyUnicode_AsDefaultEncodedString(o, NULL); if (!defenc) return NULL; defenc_c = PyBytes_AS_STRING(defenc); #if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII { char* end = defenc_c + PyBytes_GET_SIZE(defenc); char* c; for (c = defenc_c; c < end; c++) { if ((unsigned char) (*c) >= 128) { PyUnicode_AsASCIIString(o); return NULL; } } } #endif *length = PyBytes_GET_SIZE(defenc); return defenc_c; #else if (__Pyx_PyUnicode_READY(o) == -1) return NULL; #if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII if (PyUnicode_IS_ASCII(o)) { *length = PyUnicode_GET_LENGTH(o); return PyUnicode_AsUTF8(o); } else { PyUnicode_AsASCIIString(o); return NULL; } #else return PyUnicode_AsUTF8AndSize(o, length); #endif #endif } else #endif #if (!CYTHON_COMPILING_IN_PYPY) || (defined(PyByteArray_AS_STRING) && defined(PyByteArray_GET_SIZE)) if (PyByteArray_Check(o)) { *length = PyByteArray_GET_SIZE(o); return PyByteArray_AS_STRING(o); } else #endif { char* result; int r = PyBytes_AsStringAndSize(o, &result, length); if (unlikely(r < 0)) { return NULL; } else { return result; } } } static CYTHON_INLINE int __Pyx_PyObject_IsTrue(PyObject* x) { int is_true = x == Py_True; if (is_true | (x == Py_False) | (x == Py_None)) return is_true; else return PyObject_IsTrue(x); } static CYTHON_INLINE PyObject* __Pyx_PyNumber_Int(PyObject* x) { PyNumberMethods *m; const char *name = NULL; PyObject *res = NULL; #if PY_MAJOR_VERSION < 3 if (PyInt_Check(x) || PyLong_Check(x)) #else if (PyLong_Check(x)) #endif return __Pyx_NewRef(x); m = Py_TYPE(x)->tp_as_number; #if PY_MAJOR_VERSION < 3 if (m && m->nb_int) { name = "int"; res = PyNumber_Int(x); } else if (m && m->nb_long) { name = "long"; res = PyNumber_Long(x); } #else if (m && m->nb_int) { name = "int"; res = PyNumber_Long(x); } #endif if (res) { #if PY_MAJOR_VERSION < 3 if (!PyInt_Check(res) && !PyLong_Check(res)) { #else if (!PyLong_Check(res)) { #endif PyErr_Format(PyExc_TypeError, "__%.4s__ returned non-%.4s (type %.200s)", name, name, Py_TYPE(res)->tp_name); Py_DECREF(res); return NULL; } } else if (!PyErr_Occurred()) { PyErr_SetString(PyExc_TypeError, "an integer is required"); } return res; } static CYTHON_INLINE Py_ssize_t __Pyx_PyIndex_AsSsize_t(PyObject* b) { Py_ssize_t ival; PyObject *x; #if PY_MAJOR_VERSION < 3 if (likely(PyInt_CheckExact(b))) { if (sizeof(Py_ssize_t) >= sizeof(long)) return PyInt_AS_LONG(b); else return PyInt_AsSsize_t(x); } #endif if (likely(PyLong_CheckExact(b))) { #if CYTHON_USE_PYLONG_INTERNALS const digit* digits = ((PyLongObject*)b)->ob_digit; const Py_ssize_t size = Py_SIZE(b); if (likely(__Pyx_sst_abs(size) <= 1)) { ival = likely(size) ? digits[0] : 0; if (size == -1) ival = -ival; return ival; } else { switch (size) { case 2: if (8 * sizeof(Py_ssize_t) > 2 * PyLong_SHIFT) { return (Py_ssize_t) (((((size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])); } break; case -2: if (8 * sizeof(Py_ssize_t) > 2 * PyLong_SHIFT) { return -(Py_ssize_t) (((((size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])); } break; case 3: if (8 * sizeof(Py_ssize_t) > 3 * PyLong_SHIFT) { return (Py_ssize_t) (((((((size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])); } break; case -3: if (8 * sizeof(Py_ssize_t) > 3 * PyLong_SHIFT) { return -(Py_ssize_t) (((((((size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])); } break; case 4: if (8 * sizeof(Py_ssize_t) > 4 * PyLong_SHIFT) { return (Py_ssize_t) (((((((((size_t)digits[3]) << PyLong_SHIFT) | (size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])); } break; case -4: if (8 * sizeof(Py_ssize_t) > 4 * PyLong_SHIFT) { return -(Py_ssize_t) (((((((((size_t)digits[3]) << PyLong_SHIFT) | (size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])); } break; } } #endif return PyLong_AsSsize_t(b); } x = PyNumber_Index(b); if (!x) return -1; ival = PyInt_AsSsize_t(x); Py_DECREF(x); return ival; } static CYTHON_INLINE PyObject * __Pyx_PyInt_FromSize_t(size_t ival) { return PyInt_FromSize_t(ival); } #endif /* Py_PYTHON_H */ pygame_sdl2-2.1.0-for-renpy-6.99.14.1/gen/pygame_sdl2.pygame_time.c0000664000175000017500000074546512660477773023740 0ustar tomtom00000000000000/* Generated by Cython 0.23.4 */ #define PY_SSIZE_T_CLEAN #include "Python.h" #ifndef Py_PYTHON_H #error Python headers needed to compile C extensions, please install development version of Python. #elif PY_VERSION_HEX < 0x02060000 || (0x03000000 <= PY_VERSION_HEX && PY_VERSION_HEX < 0x03020000) #error Cython requires Python 2.6+ or Python 3.2+. #else #define CYTHON_ABI "0_23_4" #include #ifndef offsetof #define offsetof(type, member) ( (size_t) & ((type*)0) -> member ) #endif #if !defined(WIN32) && !defined(MS_WINDOWS) #ifndef __stdcall #define __stdcall #endif #ifndef __cdecl #define __cdecl #endif #ifndef __fastcall #define __fastcall #endif #endif #ifndef DL_IMPORT #define DL_IMPORT(t) t #endif #ifndef DL_EXPORT #define DL_EXPORT(t) t #endif #ifndef PY_LONG_LONG #define PY_LONG_LONG LONG_LONG #endif #ifndef Py_HUGE_VAL #define Py_HUGE_VAL HUGE_VAL #endif #ifdef PYPY_VERSION #define CYTHON_COMPILING_IN_PYPY 1 #define CYTHON_COMPILING_IN_CPYTHON 0 #else #define CYTHON_COMPILING_IN_PYPY 0 #define CYTHON_COMPILING_IN_CPYTHON 1 #endif #if !defined(CYTHON_USE_PYLONG_INTERNALS) && CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x02070000 #define CYTHON_USE_PYLONG_INTERNALS 1 #endif #if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX < 0x02070600 && !defined(Py_OptimizeFlag) #define Py_OptimizeFlag 0 #endif #define __PYX_BUILD_PY_SSIZE_T "n" #define CYTHON_FORMAT_SSIZE_T "z" #if PY_MAJOR_VERSION < 3 #define __Pyx_BUILTIN_MODULE_NAME "__builtin__" #define __Pyx_PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)\ PyCode_New(a+k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos) #define __Pyx_DefaultClassType PyClass_Type #else #define __Pyx_BUILTIN_MODULE_NAME "builtins" #define __Pyx_PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)\ PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos) #define __Pyx_DefaultClassType PyType_Type #endif #ifndef Py_TPFLAGS_CHECKTYPES #define Py_TPFLAGS_CHECKTYPES 0 #endif #ifndef Py_TPFLAGS_HAVE_INDEX #define Py_TPFLAGS_HAVE_INDEX 0 #endif #ifndef Py_TPFLAGS_HAVE_NEWBUFFER #define Py_TPFLAGS_HAVE_NEWBUFFER 0 #endif #ifndef Py_TPFLAGS_HAVE_FINALIZE #define Py_TPFLAGS_HAVE_FINALIZE 0 #endif #if PY_VERSION_HEX > 0x03030000 && defined(PyUnicode_KIND) #define CYTHON_PEP393_ENABLED 1 #define __Pyx_PyUnicode_READY(op) (likely(PyUnicode_IS_READY(op)) ?\ 0 : _PyUnicode_Ready((PyObject *)(op))) #define __Pyx_PyUnicode_GET_LENGTH(u) PyUnicode_GET_LENGTH(u) #define __Pyx_PyUnicode_READ_CHAR(u, i) PyUnicode_READ_CHAR(u, i) #define __Pyx_PyUnicode_KIND(u) PyUnicode_KIND(u) #define __Pyx_PyUnicode_DATA(u) PyUnicode_DATA(u) #define __Pyx_PyUnicode_READ(k, d, i) PyUnicode_READ(k, d, i) #else #define CYTHON_PEP393_ENABLED 0 #define __Pyx_PyUnicode_READY(op) (0) #define __Pyx_PyUnicode_GET_LENGTH(u) PyUnicode_GET_SIZE(u) #define __Pyx_PyUnicode_READ_CHAR(u, i) ((Py_UCS4)(PyUnicode_AS_UNICODE(u)[i])) #define __Pyx_PyUnicode_KIND(u) (sizeof(Py_UNICODE)) #define __Pyx_PyUnicode_DATA(u) ((void*)PyUnicode_AS_UNICODE(u)) #define __Pyx_PyUnicode_READ(k, d, i) ((void)(k), (Py_UCS4)(((Py_UNICODE*)d)[i])) #endif #if CYTHON_COMPILING_IN_PYPY #define __Pyx_PyUnicode_Concat(a, b) PyNumber_Add(a, b) #define __Pyx_PyUnicode_ConcatSafe(a, b) PyNumber_Add(a, b) #else #define __Pyx_PyUnicode_Concat(a, b) PyUnicode_Concat(a, b) #define __Pyx_PyUnicode_ConcatSafe(a, b) ((unlikely((a) == Py_None) || unlikely((b) == Py_None)) ?\ PyNumber_Add(a, b) : __Pyx_PyUnicode_Concat(a, b)) #endif #if CYTHON_COMPILING_IN_PYPY && !defined(PyUnicode_Contains) #define PyUnicode_Contains(u, s) PySequence_Contains(u, s) #endif #define __Pyx_PyString_FormatSafe(a, b) ((unlikely((a) == Py_None)) ? PyNumber_Remainder(a, b) : __Pyx_PyString_Format(a, b)) #define __Pyx_PyUnicode_FormatSafe(a, b) ((unlikely((a) == Py_None)) ? PyNumber_Remainder(a, b) : PyUnicode_Format(a, b)) #if PY_MAJOR_VERSION >= 3 #define __Pyx_PyString_Format(a, b) PyUnicode_Format(a, b) #else #define __Pyx_PyString_Format(a, b) PyString_Format(a, b) #endif #if PY_MAJOR_VERSION >= 3 #define PyBaseString_Type PyUnicode_Type #define PyStringObject PyUnicodeObject #define PyString_Type PyUnicode_Type #define PyString_Check PyUnicode_Check #define PyString_CheckExact PyUnicode_CheckExact #endif #if PY_MAJOR_VERSION >= 3 #define __Pyx_PyBaseString_Check(obj) PyUnicode_Check(obj) #define __Pyx_PyBaseString_CheckExact(obj) PyUnicode_CheckExact(obj) #else #define __Pyx_PyBaseString_Check(obj) (PyString_Check(obj) || PyUnicode_Check(obj)) #define __Pyx_PyBaseString_CheckExact(obj) (PyString_CheckExact(obj) || PyUnicode_CheckExact(obj)) #endif #ifndef PySet_CheckExact #define PySet_CheckExact(obj) (Py_TYPE(obj) == &PySet_Type) #endif #define __Pyx_TypeCheck(obj, type) PyObject_TypeCheck(obj, (PyTypeObject *)type) #if PY_MAJOR_VERSION >= 3 #define PyIntObject PyLongObject #define PyInt_Type PyLong_Type #define PyInt_Check(op) PyLong_Check(op) #define PyInt_CheckExact(op) PyLong_CheckExact(op) #define PyInt_FromString PyLong_FromString #define PyInt_FromUnicode PyLong_FromUnicode #define PyInt_FromLong PyLong_FromLong #define PyInt_FromSize_t PyLong_FromSize_t #define PyInt_FromSsize_t PyLong_FromSsize_t #define PyInt_AsLong PyLong_AsLong #define PyInt_AS_LONG PyLong_AS_LONG #define PyInt_AsSsize_t PyLong_AsSsize_t #define PyInt_AsUnsignedLongMask PyLong_AsUnsignedLongMask #define PyInt_AsUnsignedLongLongMask PyLong_AsUnsignedLongLongMask #define PyNumber_Int PyNumber_Long #endif #if PY_MAJOR_VERSION >= 3 #define PyBoolObject PyLongObject #endif #if PY_MAJOR_VERSION >= 3 && CYTHON_COMPILING_IN_PYPY #ifndef PyUnicode_InternFromString #define PyUnicode_InternFromString(s) PyUnicode_FromString(s) #endif #endif #if PY_VERSION_HEX < 0x030200A4 typedef long Py_hash_t; #define __Pyx_PyInt_FromHash_t PyInt_FromLong #define __Pyx_PyInt_AsHash_t PyInt_AsLong #else #define __Pyx_PyInt_FromHash_t PyInt_FromSsize_t #define __Pyx_PyInt_AsHash_t PyInt_AsSsize_t #endif #if PY_MAJOR_VERSION >= 3 #define __Pyx_PyMethod_New(func, self, klass) ((self) ? PyMethod_New(func, self) : PyInstanceMethod_New(func)) #else #define __Pyx_PyMethod_New(func, self, klass) PyMethod_New(func, self, klass) #endif #if PY_VERSION_HEX >= 0x030500B1 #define __Pyx_PyAsyncMethodsStruct PyAsyncMethods #define __Pyx_PyType_AsAsync(obj) (Py_TYPE(obj)->tp_as_async) #elif CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3 typedef struct { unaryfunc am_await; unaryfunc am_aiter; unaryfunc am_anext; } __Pyx_PyAsyncMethodsStruct; #define __Pyx_PyType_AsAsync(obj) ((__Pyx_PyAsyncMethodsStruct*) (Py_TYPE(obj)->tp_reserved)) #else #define __Pyx_PyType_AsAsync(obj) NULL #endif #ifndef CYTHON_RESTRICT #if defined(__GNUC__) #define CYTHON_RESTRICT __restrict__ #elif defined(_MSC_VER) && _MSC_VER >= 1400 #define CYTHON_RESTRICT __restrict #elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L #define CYTHON_RESTRICT restrict #else #define CYTHON_RESTRICT #endif #endif #define __Pyx_void_to_None(void_result) ((void)(void_result), Py_INCREF(Py_None), Py_None) #ifndef CYTHON_INLINE #if defined(__GNUC__) #define CYTHON_INLINE __inline__ #elif defined(_MSC_VER) #define CYTHON_INLINE __inline #elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L #define CYTHON_INLINE inline #else #define CYTHON_INLINE #endif #endif #if defined(WIN32) || defined(MS_WINDOWS) #define _USE_MATH_DEFINES #endif #include #ifdef NAN #define __PYX_NAN() ((float) NAN) #else static CYTHON_INLINE float __PYX_NAN() { float value; memset(&value, 0xFF, sizeof(value)); return value; } #endif #if PY_MAJOR_VERSION >= 3 #define __Pyx_PyNumber_Divide(x,y) PyNumber_TrueDivide(x,y) #define __Pyx_PyNumber_InPlaceDivide(x,y) PyNumber_InPlaceTrueDivide(x,y) #else #define __Pyx_PyNumber_Divide(x,y) PyNumber_Divide(x,y) #define __Pyx_PyNumber_InPlaceDivide(x,y) PyNumber_InPlaceDivide(x,y) #endif #ifndef __PYX_EXTERN_C #ifdef __cplusplus #define __PYX_EXTERN_C extern "C" #else #define __PYX_EXTERN_C extern #endif #endif #define __PYX_HAVE__pygame_sdl2__pygame_time #define __PYX_HAVE_API__pygame_sdl2__pygame_time #include "stdint.h" #include "string.h" #include "stdio.h" #include "stddef.h" #include "SDL.h" #ifdef _OPENMP #include #endif /* _OPENMP */ #ifdef PYREX_WITHOUT_ASSERTIONS #define CYTHON_WITHOUT_ASSERTIONS #endif #ifndef CYTHON_UNUSED # if defined(__GNUC__) # if !(defined(__cplusplus)) || (__GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 4)) # define CYTHON_UNUSED __attribute__ ((__unused__)) # else # define CYTHON_UNUSED # endif # elif defined(__ICC) || (defined(__INTEL_COMPILER) && !defined(_MSC_VER)) # define CYTHON_UNUSED __attribute__ ((__unused__)) # else # define CYTHON_UNUSED # endif #endif #ifndef CYTHON_NCP_UNUSED # if CYTHON_COMPILING_IN_CPYTHON # define CYTHON_NCP_UNUSED # else # define CYTHON_NCP_UNUSED CYTHON_UNUSED # endif #endif typedef struct {PyObject **p; char *s; const Py_ssize_t n; const char* encoding; const char is_unicode; const char is_str; const char intern; } __Pyx_StringTabEntry; #define __PYX_DEFAULT_STRING_ENCODING_IS_ASCII 0 #define __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT 0 #define __PYX_DEFAULT_STRING_ENCODING "" #define __Pyx_PyObject_FromString __Pyx_PyBytes_FromString #define __Pyx_PyObject_FromStringAndSize __Pyx_PyBytes_FromStringAndSize #define __Pyx_uchar_cast(c) ((unsigned char)c) #define __Pyx_long_cast(x) ((long)x) #define __Pyx_fits_Py_ssize_t(v, type, is_signed) (\ (sizeof(type) < sizeof(Py_ssize_t)) ||\ (sizeof(type) > sizeof(Py_ssize_t) &&\ likely(v < (type)PY_SSIZE_T_MAX ||\ v == (type)PY_SSIZE_T_MAX) &&\ (!is_signed || likely(v > (type)PY_SSIZE_T_MIN ||\ v == (type)PY_SSIZE_T_MIN))) ||\ (sizeof(type) == sizeof(Py_ssize_t) &&\ (is_signed || likely(v < (type)PY_SSIZE_T_MAX ||\ v == (type)PY_SSIZE_T_MAX))) ) #if defined (__cplusplus) && __cplusplus >= 201103L #include #define __Pyx_sst_abs(value) std::abs(value) #elif SIZEOF_INT >= SIZEOF_SIZE_T #define __Pyx_sst_abs(value) abs(value) #elif SIZEOF_LONG >= SIZEOF_SIZE_T #define __Pyx_sst_abs(value) labs(value) #elif defined (_MSC_VER) && defined (_M_X64) #define __Pyx_sst_abs(value) _abs64(value) #elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L #define __Pyx_sst_abs(value) llabs(value) #elif defined (__GNUC__) #define __Pyx_sst_abs(value) __builtin_llabs(value) #else #define __Pyx_sst_abs(value) ((value<0) ? -value : value) #endif static CYTHON_INLINE char* __Pyx_PyObject_AsString(PyObject*); static CYTHON_INLINE char* __Pyx_PyObject_AsStringAndSize(PyObject*, Py_ssize_t* length); #define __Pyx_PyByteArray_FromString(s) PyByteArray_FromStringAndSize((const char*)s, strlen((const char*)s)) #define __Pyx_PyByteArray_FromStringAndSize(s, l) PyByteArray_FromStringAndSize((const char*)s, l) #define __Pyx_PyBytes_FromString PyBytes_FromString #define __Pyx_PyBytes_FromStringAndSize PyBytes_FromStringAndSize static CYTHON_INLINE PyObject* __Pyx_PyUnicode_FromString(const char*); #if PY_MAJOR_VERSION < 3 #define __Pyx_PyStr_FromString __Pyx_PyBytes_FromString #define __Pyx_PyStr_FromStringAndSize __Pyx_PyBytes_FromStringAndSize #else #define __Pyx_PyStr_FromString __Pyx_PyUnicode_FromString #define __Pyx_PyStr_FromStringAndSize __Pyx_PyUnicode_FromStringAndSize #endif #define __Pyx_PyObject_AsSString(s) ((signed char*) __Pyx_PyObject_AsString(s)) #define __Pyx_PyObject_AsUString(s) ((unsigned char*) __Pyx_PyObject_AsString(s)) #define __Pyx_PyObject_FromCString(s) __Pyx_PyObject_FromString((const char*)s) #define __Pyx_PyBytes_FromCString(s) __Pyx_PyBytes_FromString((const char*)s) #define __Pyx_PyByteArray_FromCString(s) __Pyx_PyByteArray_FromString((const char*)s) #define __Pyx_PyStr_FromCString(s) __Pyx_PyStr_FromString((const char*)s) #define __Pyx_PyUnicode_FromCString(s) __Pyx_PyUnicode_FromString((const char*)s) #if PY_MAJOR_VERSION < 3 static CYTHON_INLINE size_t __Pyx_Py_UNICODE_strlen(const Py_UNICODE *u) { const Py_UNICODE *u_end = u; while (*u_end++) ; return (size_t)(u_end - u - 1); } #else #define __Pyx_Py_UNICODE_strlen Py_UNICODE_strlen #endif #define __Pyx_PyUnicode_FromUnicode(u) PyUnicode_FromUnicode(u, __Pyx_Py_UNICODE_strlen(u)) #define __Pyx_PyUnicode_FromUnicodeAndLength PyUnicode_FromUnicode #define __Pyx_PyUnicode_AsUnicode PyUnicode_AsUnicode #define __Pyx_NewRef(obj) (Py_INCREF(obj), obj) #define __Pyx_Owned_Py_None(b) __Pyx_NewRef(Py_None) #define __Pyx_PyBool_FromLong(b) ((b) ? __Pyx_NewRef(Py_True) : __Pyx_NewRef(Py_False)) static CYTHON_INLINE int __Pyx_PyObject_IsTrue(PyObject*); static CYTHON_INLINE PyObject* __Pyx_PyNumber_Int(PyObject* x); static CYTHON_INLINE Py_ssize_t __Pyx_PyIndex_AsSsize_t(PyObject*); static CYTHON_INLINE PyObject * __Pyx_PyInt_FromSize_t(size_t); #if CYTHON_COMPILING_IN_CPYTHON #define __pyx_PyFloat_AsDouble(x) (PyFloat_CheckExact(x) ? PyFloat_AS_DOUBLE(x) : PyFloat_AsDouble(x)) #else #define __pyx_PyFloat_AsDouble(x) PyFloat_AsDouble(x) #endif #define __pyx_PyFloat_AsFloat(x) ((float) __pyx_PyFloat_AsDouble(x)) #if PY_MAJOR_VERSION < 3 && __PYX_DEFAULT_STRING_ENCODING_IS_ASCII static int __Pyx_sys_getdefaultencoding_not_ascii; static int __Pyx_init_sys_getdefaultencoding_params(void) { PyObject* sys; PyObject* default_encoding = NULL; PyObject* ascii_chars_u = NULL; PyObject* ascii_chars_b = NULL; const char* default_encoding_c; sys = PyImport_ImportModule("sys"); if (!sys) goto bad; default_encoding = PyObject_CallMethod(sys, (char*) "getdefaultencoding", NULL); Py_DECREF(sys); if (!default_encoding) goto bad; default_encoding_c = PyBytes_AsString(default_encoding); if (!default_encoding_c) goto bad; if (strcmp(default_encoding_c, "ascii") == 0) { __Pyx_sys_getdefaultencoding_not_ascii = 0; } else { char ascii_chars[128]; int c; for (c = 0; c < 128; c++) { ascii_chars[c] = c; } __Pyx_sys_getdefaultencoding_not_ascii = 1; ascii_chars_u = PyUnicode_DecodeASCII(ascii_chars, 128, NULL); if (!ascii_chars_u) goto bad; ascii_chars_b = PyUnicode_AsEncodedString(ascii_chars_u, default_encoding_c, NULL); if (!ascii_chars_b || !PyBytes_Check(ascii_chars_b) || memcmp(ascii_chars, PyBytes_AS_STRING(ascii_chars_b), 128) != 0) { PyErr_Format( PyExc_ValueError, "This module compiled with c_string_encoding=ascii, but default encoding '%.200s' is not a superset of ascii.", default_encoding_c); goto bad; } Py_DECREF(ascii_chars_u); Py_DECREF(ascii_chars_b); } Py_DECREF(default_encoding); return 0; bad: Py_XDECREF(default_encoding); Py_XDECREF(ascii_chars_u); Py_XDECREF(ascii_chars_b); return -1; } #endif #if __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT && PY_MAJOR_VERSION >= 3 #define __Pyx_PyUnicode_FromStringAndSize(c_str, size) PyUnicode_DecodeUTF8(c_str, size, NULL) #else #define __Pyx_PyUnicode_FromStringAndSize(c_str, size) PyUnicode_Decode(c_str, size, __PYX_DEFAULT_STRING_ENCODING, NULL) #if __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT static char* __PYX_DEFAULT_STRING_ENCODING; static int __Pyx_init_sys_getdefaultencoding_params(void) { PyObject* sys; PyObject* default_encoding = NULL; char* default_encoding_c; sys = PyImport_ImportModule("sys"); if (!sys) goto bad; default_encoding = PyObject_CallMethod(sys, (char*) (const char*) "getdefaultencoding", NULL); Py_DECREF(sys); if (!default_encoding) goto bad; default_encoding_c = PyBytes_AsString(default_encoding); if (!default_encoding_c) goto bad; __PYX_DEFAULT_STRING_ENCODING = (char*) malloc(strlen(default_encoding_c)); if (!__PYX_DEFAULT_STRING_ENCODING) goto bad; strcpy(__PYX_DEFAULT_STRING_ENCODING, default_encoding_c); Py_DECREF(default_encoding); return 0; bad: Py_XDECREF(default_encoding); return -1; } #endif #endif /* Test for GCC > 2.95 */ #if defined(__GNUC__) && (__GNUC__ > 2 || (__GNUC__ == 2 && (__GNUC_MINOR__ > 95))) #define likely(x) __builtin_expect(!!(x), 1) #define unlikely(x) __builtin_expect(!!(x), 0) #else /* !__GNUC__ or GCC < 2.95 */ #define likely(x) (x) #define unlikely(x) (x) #endif /* __GNUC__ */ static PyObject *__pyx_m; static PyObject *__pyx_d; static PyObject *__pyx_b; static PyObject *__pyx_empty_tuple; static PyObject *__pyx_empty_bytes; static int __pyx_lineno; static int __pyx_clineno = 0; static const char * __pyx_cfilenm= __FILE__; static const char *__pyx_filename; static const char *__pyx_f[] = { "src/pygame_sdl2/pygame_time.pyx", }; /*--- Type declarations ---*/ /* --- Runtime support code (head) --- */ #ifndef CYTHON_REFNANNY #define CYTHON_REFNANNY 0 #endif #if CYTHON_REFNANNY typedef struct { void (*INCREF)(void*, PyObject*, int); void (*DECREF)(void*, PyObject*, int); void (*GOTREF)(void*, PyObject*, int); void (*GIVEREF)(void*, PyObject*, int); void* (*SetupContext)(const char*, int, const char*); void (*FinishContext)(void**); } __Pyx_RefNannyAPIStruct; static __Pyx_RefNannyAPIStruct *__Pyx_RefNanny = NULL; static __Pyx_RefNannyAPIStruct *__Pyx_RefNannyImportAPI(const char *modname); #define __Pyx_RefNannyDeclarations void *__pyx_refnanny = NULL; #ifdef WITH_THREAD #define __Pyx_RefNannySetupContext(name, acquire_gil)\ if (acquire_gil) {\ PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure();\ __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), __LINE__, __FILE__);\ PyGILState_Release(__pyx_gilstate_save);\ } else {\ __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), __LINE__, __FILE__);\ } #else #define __Pyx_RefNannySetupContext(name, acquire_gil)\ __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), __LINE__, __FILE__) #endif #define __Pyx_RefNannyFinishContext()\ __Pyx_RefNanny->FinishContext(&__pyx_refnanny) #define __Pyx_INCREF(r) __Pyx_RefNanny->INCREF(__pyx_refnanny, (PyObject *)(r), __LINE__) #define __Pyx_DECREF(r) __Pyx_RefNanny->DECREF(__pyx_refnanny, (PyObject *)(r), __LINE__) #define __Pyx_GOTREF(r) __Pyx_RefNanny->GOTREF(__pyx_refnanny, (PyObject *)(r), __LINE__) #define __Pyx_GIVEREF(r) __Pyx_RefNanny->GIVEREF(__pyx_refnanny, (PyObject *)(r), __LINE__) #define __Pyx_XINCREF(r) do { if((r) != NULL) {__Pyx_INCREF(r); }} while(0) #define __Pyx_XDECREF(r) do { if((r) != NULL) {__Pyx_DECREF(r); }} while(0) #define __Pyx_XGOTREF(r) do { if((r) != NULL) {__Pyx_GOTREF(r); }} while(0) #define __Pyx_XGIVEREF(r) do { if((r) != NULL) {__Pyx_GIVEREF(r);}} while(0) #else #define __Pyx_RefNannyDeclarations #define __Pyx_RefNannySetupContext(name, acquire_gil) #define __Pyx_RefNannyFinishContext() #define __Pyx_INCREF(r) Py_INCREF(r) #define __Pyx_DECREF(r) Py_DECREF(r) #define __Pyx_GOTREF(r) #define __Pyx_GIVEREF(r) #define __Pyx_XINCREF(r) Py_XINCREF(r) #define __Pyx_XDECREF(r) Py_XDECREF(r) #define __Pyx_XGOTREF(r) #define __Pyx_XGIVEREF(r) #endif #define __Pyx_XDECREF_SET(r, v) do {\ PyObject *tmp = (PyObject *) r;\ r = v; __Pyx_XDECREF(tmp);\ } while (0) #define __Pyx_DECREF_SET(r, v) do {\ PyObject *tmp = (PyObject *) r;\ r = v; __Pyx_DECREF(tmp);\ } while (0) #define __Pyx_CLEAR(r) do { PyObject* tmp = ((PyObject*)(r)); r = NULL; __Pyx_DECREF(tmp);} while(0) #define __Pyx_XCLEAR(r) do { if((r) != NULL) {PyObject* tmp = ((PyObject*)(r)); r = NULL; __Pyx_DECREF(tmp);}} while(0) #if CYTHON_COMPILING_IN_CPYTHON static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStr(PyObject* obj, PyObject* attr_name) { PyTypeObject* tp = Py_TYPE(obj); if (likely(tp->tp_getattro)) return tp->tp_getattro(obj, attr_name); #if PY_MAJOR_VERSION < 3 if (likely(tp->tp_getattr)) return tp->tp_getattr(obj, PyString_AS_STRING(attr_name)); #endif return PyObject_GetAttr(obj, attr_name); } #else #define __Pyx_PyObject_GetAttrStr(o,n) PyObject_GetAttr(o,n) #endif static PyObject *__Pyx_GetBuiltinName(PyObject *name); static CYTHON_INLINE PyObject *__Pyx_GetModuleGlobalName(PyObject *name); #if CYTHON_COMPILING_IN_CPYTHON static CYTHON_INLINE PyObject* __Pyx_PyObject_Call(PyObject *func, PyObject *arg, PyObject *kw); #else #define __Pyx_PyObject_Call(func, arg, kw) PyObject_Call(func, arg, kw) #endif #if CYTHON_COMPILING_IN_CPYTHON static CYTHON_INLINE PyObject* __Pyx_PyObject_CallMethO(PyObject *func, PyObject *arg); #endif static CYTHON_INLINE PyObject* __Pyx_PyObject_CallOneArg(PyObject *func, PyObject *arg); #if CYTHON_COMPILING_IN_CPYTHON static CYTHON_INLINE PyObject* __Pyx_PyObject_CallNoArg(PyObject *func); #else #define __Pyx_PyObject_CallNoArg(func) __Pyx_PyObject_Call(func, __pyx_empty_tuple, NULL) #endif static CYTHON_INLINE void __Pyx_ErrRestore(PyObject *type, PyObject *value, PyObject *tb); static CYTHON_INLINE void __Pyx_ErrFetch(PyObject **type, PyObject **value, PyObject **tb); static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, PyObject *cause); static void __Pyx_RaiseArgtupleInvalid(const char* func_name, int exact, Py_ssize_t num_min, Py_ssize_t num_max, Py_ssize_t num_found); static void __Pyx_RaiseDoubleKeywordsError(const char* func_name, PyObject* kw_name); static int __Pyx_ParseOptionalKeywords(PyObject *kwds, PyObject **argnames[],\ PyObject *kwds2, PyObject *values[], Py_ssize_t num_pos_args,\ const char* function_name); static PyObject* __Pyx_PyDict_GetItemDefault(PyObject* d, PyObject* key, PyObject* default_value); #if CYTHON_COMPILING_IN_CPYTHON #define __Pyx_PyObject_DelAttrStr(o,n) __Pyx_PyObject_SetAttrStr(o,n,NULL) static CYTHON_INLINE int __Pyx_PyObject_SetAttrStr(PyObject* obj, PyObject* attr_name, PyObject* value) { PyTypeObject* tp = Py_TYPE(obj); if (likely(tp->tp_setattro)) return tp->tp_setattro(obj, attr_name, value); #if PY_MAJOR_VERSION < 3 if (likely(tp->tp_setattr)) return tp->tp_setattr(obj, PyString_AS_STRING(attr_name), value); #endif return PyObject_SetAttr(obj, attr_name, value); } #else #define __Pyx_PyObject_DelAttrStr(o,n) PyObject_DelAttr(o,n) #define __Pyx_PyObject_SetAttrStr(o,n,v) PyObject_SetAttr(o,n,v) #endif static PyObject* __Pyx_PyObject_CallMethod1(PyObject* obj, PyObject* method_name, PyObject* arg); static PyObject* __Pyx__PyObject_PopNewIndex(PyObject* L, PyObject* py_ix); static PyObject* __Pyx__PyObject_PopIndex(PyObject* L, PyObject* py_ix); #if CYTHON_COMPILING_IN_CPYTHON static PyObject* __Pyx__PyList_PopIndex(PyObject* L, PyObject* py_ix, Py_ssize_t ix); #define __Pyx_PyObject_PopIndex(L, py_ix, ix, is_signed, type, to_py_func) (\ (likely(PyList_CheckExact(L) && __Pyx_fits_Py_ssize_t(ix, type, is_signed))) ?\ __Pyx__PyList_PopIndex(L, py_ix, ix) : (\ (unlikely(py_ix == Py_None)) ? __Pyx__PyObject_PopNewIndex(L, to_py_func(ix)) :\ __Pyx__PyObject_PopIndex(L, py_ix))) #define __Pyx_PyList_PopIndex(L, py_ix, ix, is_signed, type, to_py_func) (\ __Pyx_fits_Py_ssize_t(ix, type, is_signed) ?\ __Pyx__PyList_PopIndex(L, py_ix, ix) : (\ (unlikely(py_ix == Py_None)) ? __Pyx__PyObject_PopNewIndex(L, to_py_func(ix)) :\ __Pyx__PyObject_PopIndex(L, py_ix))) #else #define __Pyx_PyList_PopIndex(L, py_ix, ix, is_signed, type, to_py_func)\ __Pyx_PyObject_PopIndex(L, py_ix, ix, is_signed, type, to_py_func) #define __Pyx_PyObject_PopIndex(L, py_ix, ix, is_signed, type, to_py_func) (\ (unlikely(py_ix == Py_None)) ? __Pyx__PyObject_PopNewIndex(L, to_py_func(ix)) :\ __Pyx__PyObject_PopIndex(L, py_ix)) #endif #if CYTHON_COMPILING_IN_CPYTHON static PyObject* __Pyx_PyInt_EqObjC(PyObject *op1, PyObject *op2, long intval, int inplace); #else #define __Pyx_PyInt_EqObjC(op1, op2, intval, inplace)\ PyObject_RichCompare(op1, op2, Py_EQ) #endif #if CYTHON_COMPILING_IN_CPYTHON static CYTHON_INLINE int __Pyx_PyList_Append(PyObject* list, PyObject* x) { PyListObject* L = (PyListObject*) list; Py_ssize_t len = Py_SIZE(list); if (likely(L->allocated > len) & likely(len > (L->allocated >> 1))) { Py_INCREF(x); PyList_SET_ITEM(list, len, x); Py_SIZE(list) = len+1; return 0; } return PyList_Append(list, x); } #else #define __Pyx_PyList_Append(L,x) PyList_Append(L,x) #endif static CYTHON_INLINE int __Pyx_PyObject_Append(PyObject* L, PyObject* x); #if CYTHON_COMPILING_IN_CPYTHON static PyObject* __Pyx_PyFloat_DivideCObj(PyObject *op1, PyObject *op2, double floatval, int inplace); #else #define __Pyx_PyFloat_DivideCObj(op1, op2, floatval, inplace)\ ((inplace ? __Pyx_PyNumber_InPlaceDivide(op1, op2) : __Pyx_PyNumber_Divide(op1, op2))) #endif static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list, int level); static PyObject* __Pyx_ImportFrom(PyObject* module, PyObject* name); static PyTypeObject* __Pyx_FetchCommonType(PyTypeObject* type); #define __Pyx_CyFunction_USED 1 #include #define __Pyx_CYFUNCTION_STATICMETHOD 0x01 #define __Pyx_CYFUNCTION_CLASSMETHOD 0x02 #define __Pyx_CYFUNCTION_CCLASS 0x04 #define __Pyx_CyFunction_GetClosure(f)\ (((__pyx_CyFunctionObject *) (f))->func_closure) #define __Pyx_CyFunction_GetClassObj(f)\ (((__pyx_CyFunctionObject *) (f))->func_classobj) #define __Pyx_CyFunction_Defaults(type, f)\ ((type *)(((__pyx_CyFunctionObject *) (f))->defaults)) #define __Pyx_CyFunction_SetDefaultsGetter(f, g)\ ((__pyx_CyFunctionObject *) (f))->defaults_getter = (g) typedef struct { PyCFunctionObject func; #if PY_VERSION_HEX < 0x030500A0 PyObject *func_weakreflist; #endif PyObject *func_dict; PyObject *func_name; PyObject *func_qualname; PyObject *func_doc; PyObject *func_globals; PyObject *func_code; PyObject *func_closure; PyObject *func_classobj; void *defaults; int defaults_pyobjects; int flags; PyObject *defaults_tuple; PyObject *defaults_kwdict; PyObject *(*defaults_getter)(PyObject *); PyObject *func_annotations; } __pyx_CyFunctionObject; static PyTypeObject *__pyx_CyFunctionType = 0; #define __Pyx_CyFunction_NewEx(ml, flags, qualname, self, module, globals, code)\ __Pyx_CyFunction_New(__pyx_CyFunctionType, ml, flags, qualname, self, module, globals, code) static PyObject *__Pyx_CyFunction_New(PyTypeObject *, PyMethodDef *ml, int flags, PyObject* qualname, PyObject *self, PyObject *module, PyObject *globals, PyObject* code); static CYTHON_INLINE void *__Pyx_CyFunction_InitDefaults(PyObject *m, size_t size, int pyobjects); static CYTHON_INLINE void __Pyx_CyFunction_SetDefaultsTuple(PyObject *m, PyObject *tuple); static CYTHON_INLINE void __Pyx_CyFunction_SetDefaultsKwDict(PyObject *m, PyObject *dict); static CYTHON_INLINE void __Pyx_CyFunction_SetAnnotationsDict(PyObject *m, PyObject *dict); static int __pyx_CyFunction_init(void); static PyObject *__Pyx_CalculateMetaclass(PyTypeObject *metaclass, PyObject *bases); static PyObject *__Pyx_Py3MetaclassPrepare(PyObject *metaclass, PyObject *bases, PyObject *name, PyObject *qualname, PyObject *mkw, PyObject *modname, PyObject *doc); static PyObject *__Pyx_Py3ClassCreate(PyObject *metaclass, PyObject *name, PyObject *bases, PyObject *dict, PyObject *mkw, int calculate_metaclass, int allow_py2_metaclass); typedef struct { int code_line; PyCodeObject* code_object; } __Pyx_CodeObjectCacheEntry; struct __Pyx_CodeObjectCache { int count; int max_count; __Pyx_CodeObjectCacheEntry* entries; }; static struct __Pyx_CodeObjectCache __pyx_code_cache = {0,0,NULL}; static int __pyx_bisect_code_objects(__Pyx_CodeObjectCacheEntry* entries, int count, int code_line); static PyCodeObject *__pyx_find_code_object(int code_line); static void __pyx_insert_code_object(int code_line, PyCodeObject* code_object); static void __Pyx_AddTraceback(const char *funcname, int c_line, int py_line, const char *filename); static CYTHON_INLINE int __Pyx_PyInt_As_int(PyObject *); static CYTHON_INLINE PyObject* __Pyx_PyInt_From_uint32_t(uint32_t value); #ifndef __PYX_FORCE_INIT_THREADS #define __PYX_FORCE_INIT_THREADS 0 #endif static CYTHON_INLINE uint32_t __Pyx_PyInt_As_uint32_t(PyObject *); static CYTHON_INLINE PyObject* __Pyx_PyInt_From_int(int value); static CYTHON_INLINE PyObject* __Pyx_PyInt_From_long(long value); static CYTHON_INLINE long __Pyx_PyInt_As_long(PyObject *); static int __Pyx_check_binary_version(void); static int __Pyx_InitStrings(__Pyx_StringTabEntry *t); /* Module declarations from 'cython' */ /* Module declarations from 'libc.stdint' */ /* Module declarations from 'libc.string' */ /* Module declarations from 'libc.stdio' */ /* Module declarations from 'libc.stddef' */ /* Module declarations from 'sdl2' */ /* Module declarations from 'pygame_sdl2.pygame_time' */ static int __pyx_v_11pygame_sdl2_11pygame_time_timer_id; static PyObject *__pyx_v_11pygame_sdl2_11pygame_time_timer_by_event = 0; static Uint32 __pyx_f_11pygame_sdl2_11pygame_time_timer_callback(Uint32, void *); /*proto*/ #define __Pyx_MODULE_NAME "pygame_sdl2.pygame_time" int __pyx_module_is_main_pygame_sdl2__pygame_time = 0; /* Implementation of 'pygame_sdl2.pygame_time' */ static PyObject *__pyx_builtin_sum; static char __pyx_k_doc[] = "__doc__"; static char __pyx_k_get[] = "get"; static char __pyx_k_now[] = "now"; static char __pyx_k_pop[] = "pop"; static char __pyx_k_sum[] = "sum"; static char __pyx_k_init[] = "init"; static char __pyx_k_last[] = "last"; static char __pyx_k_main[] = "__main__"; static char __pyx_k_math[] = "math"; static char __pyx_k_quit[] = "quit"; static char __pyx_k_self[] = "self"; static char __pyx_k_test[] = "__test__"; static char __pyx_k_tick[] = "tick"; static char __pyx_k_wait[] = "wait"; static char __pyx_k_Clock[] = "Clock"; static char __pyx_k_delay[] = "delay"; static char __pyx_k_error[] = "error"; static char __pyx_k_isnan[] = "isnan"; static char __pyx_k_start[] = "start"; static char __pyx_k_append[] = "append"; static char __pyx_k_import[] = "__import__"; static char __pyx_k_init_2[] = "__init__"; static char __pyx_k_module[] = "__module__"; static char __pyx_k_display[] = "display"; static char __pyx_k_eventid[] = "eventid"; static char __pyx_k_get_fps[] = "get_fps"; static char __pyx_k_prepare[] = "__prepare__"; static char __pyx_k_get_time[] = "get_time"; static char __pyx_k_qualname[] = "__qualname__"; static char __pyx_k_timer_id[] = "timer_id"; static char __pyx_k_framerate[] = "framerate"; static char __pyx_k_frametime[] = "frametime"; static char __pyx_k_get_ticks[] = "get_ticks"; static char __pyx_k_metaclass[] = "__metaclass__"; static char __pyx_k_set_timer[] = "set_timer"; static char __pyx_k_Clock_tick[] = "Clock.tick"; static char __pyx_k_total_time[] = "total_time"; static char __pyx_k_average_fps[] = "average_fps"; static char __pyx_k_get_rawtime[] = "get_rawtime"; static char __pyx_k_last_frames[] = "last_frames"; static char __pyx_k_pygame_sdl2[] = "pygame_sdl2"; static char __pyx_k_Clock___init[] = "Clock.__init__"; static char __pyx_k_average_time[] = "average_time"; static char __pyx_k_milliseconds[] = "milliseconds"; static char __pyx_k_Clock_get_fps[] = "Clock.get_fps"; static char __pyx_k_raw_frametime[] = "raw_frametime"; static char __pyx_k_register_init[] = "register_init"; static char __pyx_k_register_quit[] = "register_quit"; static char __pyx_k_sdl_main_init[] = "sdl_main_init"; static char __pyx_k_Clock_get_time[] = "Clock.get_time"; static char __pyx_k_frame_duration[] = "frame_duration"; static char __pyx_k_tick_busy_loop[] = "tick_busy_loop"; static char __pyx_k_Clock_get_rawtime[] = "Clock.get_rawtime"; static char __pyx_k_pygame_sdl2_error[] = "pygame_sdl2.error"; static char __pyx_k_Clock_tick_busy_loop[] = "Clock.tick_busy_loop"; static char __pyx_k_pygame_sdl2_pygame_time[] = "pygame_sdl2.pygame_time"; static char __pyx_k_home_tom_ab_pygame_sdl2_src_pyg[] = "/home/tom/ab/pygame_sdl2/src/pygame_sdl2/pygame_time.pyx"; static PyObject *__pyx_n_s_Clock; static PyObject *__pyx_n_s_Clock___init; static PyObject *__pyx_n_s_Clock_get_fps; static PyObject *__pyx_n_s_Clock_get_rawtime; static PyObject *__pyx_n_s_Clock_get_time; static PyObject *__pyx_n_s_Clock_tick; static PyObject *__pyx_n_s_Clock_tick_busy_loop; static PyObject *__pyx_n_s_append; static PyObject *__pyx_n_s_average_fps; static PyObject *__pyx_n_s_average_time; static PyObject *__pyx_n_s_delay; static PyObject *__pyx_n_s_display; static PyObject *__pyx_n_s_doc; static PyObject *__pyx_n_s_error; static PyObject *__pyx_n_s_eventid; static PyObject *__pyx_n_s_frame_duration; static PyObject *__pyx_n_s_framerate; static PyObject *__pyx_n_s_frametime; static PyObject *__pyx_n_s_get; static PyObject *__pyx_n_s_get_fps; static PyObject *__pyx_n_s_get_rawtime; static PyObject *__pyx_n_s_get_ticks; static PyObject *__pyx_n_s_get_time; static PyObject *__pyx_kp_s_home_tom_ab_pygame_sdl2_src_pyg; static PyObject *__pyx_n_s_import; static PyObject *__pyx_n_s_init; static PyObject *__pyx_n_s_init_2; static PyObject *__pyx_n_s_isnan; static PyObject *__pyx_n_s_last; static PyObject *__pyx_n_s_last_frames; static PyObject *__pyx_n_s_main; static PyObject *__pyx_n_s_math; static PyObject *__pyx_n_s_metaclass; static PyObject *__pyx_n_s_milliseconds; static PyObject *__pyx_n_s_module; static PyObject *__pyx_n_s_now; static PyObject *__pyx_n_s_pop; static PyObject *__pyx_n_s_prepare; static PyObject *__pyx_n_s_pygame_sdl2; static PyObject *__pyx_n_s_pygame_sdl2_error; static PyObject *__pyx_n_s_pygame_sdl2_pygame_time; static PyObject *__pyx_n_s_qualname; static PyObject *__pyx_n_s_quit; static PyObject *__pyx_n_s_raw_frametime; static PyObject *__pyx_n_s_register_init; static PyObject *__pyx_n_s_register_quit; static PyObject *__pyx_n_s_sdl_main_init; static PyObject *__pyx_n_s_self; static PyObject *__pyx_n_s_set_timer; static PyObject *__pyx_n_s_start; static PyObject *__pyx_n_s_sum; static PyObject *__pyx_n_s_test; static PyObject *__pyx_n_s_tick; static PyObject *__pyx_n_s_tick_busy_loop; static PyObject *__pyx_n_s_timer_id; static PyObject *__pyx_n_s_total_time; static PyObject *__pyx_n_s_wait; static PyObject *__pyx_pf_11pygame_sdl2_11pygame_time_init(CYTHON_UNUSED PyObject *__pyx_self); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_11pygame_time_2quit(CYTHON_UNUSED PyObject *__pyx_self); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_11pygame_time_4get_ticks(CYTHON_UNUSED PyObject *__pyx_self); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_11pygame_time_6wait(CYTHON_UNUSED PyObject *__pyx_self, int __pyx_v_milliseconds); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_11pygame_time_8delay(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_milliseconds); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_11pygame_time_10set_timer(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_eventid, PyObject *__pyx_v_milliseconds); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_11pygame_time_5Clock___init__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_11pygame_time_5Clock_2tick(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_framerate); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_11pygame_time_5Clock_4tick_busy_loop(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_framerate); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_11pygame_time_5Clock_6get_time(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_11pygame_time_5Clock_8get_rawtime(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_11pygame_time_5Clock_10get_fps(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self); /* proto */ static PyObject *__pyx_float_1_0; static PyObject *__pyx_int_0; static PyObject *__pyx_int_1000; static PyObject *__pyx_codeobj_; static PyObject *__pyx_tuple__4; static PyObject *__pyx_tuple__6; static PyObject *__pyx_tuple__8; static PyObject *__pyx_tuple__10; static PyObject *__pyx_tuple__12; static PyObject *__pyx_tuple__14; static PyObject *__pyx_tuple__15; static PyObject *__pyx_tuple__17; static PyObject *__pyx_tuple__18; static PyObject *__pyx_tuple__20; static PyObject *__pyx_tuple__22; static PyObject *__pyx_codeobj__2; static PyObject *__pyx_codeobj__3; static PyObject *__pyx_codeobj__5; static PyObject *__pyx_codeobj__7; static PyObject *__pyx_codeobj__9; static PyObject *__pyx_codeobj__11; static PyObject *__pyx_codeobj__13; static PyObject *__pyx_codeobj__16; static PyObject *__pyx_codeobj__19; static PyObject *__pyx_codeobj__21; static PyObject *__pyx_codeobj__23; /* "pygame_sdl2/pygame_time.pyx":28 * * @pygame_sdl2.register_init * def init(): # <<<<<<<<<<<<<< * pygame_sdl2.display.sdl_main_init() * */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_11pygame_time_1init(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused); /*proto*/ static PyMethodDef __pyx_mdef_11pygame_sdl2_11pygame_time_1init = {"init", (PyCFunction)__pyx_pw_11pygame_sdl2_11pygame_time_1init, METH_NOARGS, 0}; static PyObject *__pyx_pw_11pygame_sdl2_11pygame_time_1init(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("init (wrapper)", 0); __pyx_r = __pyx_pf_11pygame_sdl2_11pygame_time_init(__pyx_self); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_11pygame_time_init(CYTHON_UNUSED PyObject *__pyx_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; int __pyx_t_4; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("init", 0); /* "pygame_sdl2/pygame_time.pyx":29 * @pygame_sdl2.register_init * def init(): * pygame_sdl2.display.sdl_main_init() # <<<<<<<<<<<<<< * * if SDL_InitSubSystem(SDL_INIT_TIMER): */ __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_pygame_sdl2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 29; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_display); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 29; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_sdl_main_init); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 29; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_3 = NULL; if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_2))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); if (likely(__pyx_t_3)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); } } if (__pyx_t_3) { __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 29; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } else { __pyx_t_1 = __Pyx_PyObject_CallNoArg(__pyx_t_2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 29; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "pygame_sdl2/pygame_time.pyx":31 * pygame_sdl2.display.sdl_main_init() * * if SDL_InitSubSystem(SDL_INIT_TIMER): # <<<<<<<<<<<<<< * raise error() * */ __pyx_t_4 = (SDL_InitSubSystem(SDL_INIT_TIMER) != 0); if (__pyx_t_4) { /* "pygame_sdl2/pygame_time.pyx":32 * * if SDL_InitSubSystem(SDL_INIT_TIMER): * raise error() # <<<<<<<<<<<<<< * * @pygame_sdl2.register_quit */ __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_error); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 32; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = NULL; if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_2))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); if (likely(__pyx_t_3)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); } } if (__pyx_t_3) { __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 32; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } else { __pyx_t_1 = __Pyx_PyObject_CallNoArg(__pyx_t_2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 32; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_Raise(__pyx_t_1, 0, 0, 0); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; {__pyx_filename = __pyx_f[0]; __pyx_lineno = 32; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "pygame_sdl2/pygame_time.pyx":31 * pygame_sdl2.display.sdl_main_init() * * if SDL_InitSubSystem(SDL_INIT_TIMER): # <<<<<<<<<<<<<< * raise error() * */ } /* "pygame_sdl2/pygame_time.pyx":28 * * @pygame_sdl2.register_init * def init(): # <<<<<<<<<<<<<< * pygame_sdl2.display.sdl_main_init() * */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("pygame_sdl2.pygame_time.init", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/pygame_time.pyx":35 * * @pygame_sdl2.register_quit * def quit(): # @ReservedAssignment # <<<<<<<<<<<<<< * SDL_QuitSubSystem(SDL_INIT_TIMER) * */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_11pygame_time_3quit(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused); /*proto*/ static PyMethodDef __pyx_mdef_11pygame_sdl2_11pygame_time_3quit = {"quit", (PyCFunction)__pyx_pw_11pygame_sdl2_11pygame_time_3quit, METH_NOARGS, 0}; static PyObject *__pyx_pw_11pygame_sdl2_11pygame_time_3quit(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("quit (wrapper)", 0); __pyx_r = __pyx_pf_11pygame_sdl2_11pygame_time_2quit(__pyx_self); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_11pygame_time_2quit(CYTHON_UNUSED PyObject *__pyx_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("quit", 0); /* "pygame_sdl2/pygame_time.pyx":36 * @pygame_sdl2.register_quit * def quit(): # @ReservedAssignment * SDL_QuitSubSystem(SDL_INIT_TIMER) # <<<<<<<<<<<<<< * * def get_ticks(): */ SDL_QuitSubSystem(SDL_INIT_TIMER); /* "pygame_sdl2/pygame_time.pyx":35 * * @pygame_sdl2.register_quit * def quit(): # @ReservedAssignment # <<<<<<<<<<<<<< * SDL_QuitSubSystem(SDL_INIT_TIMER) * */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/pygame_time.pyx":38 * SDL_QuitSubSystem(SDL_INIT_TIMER) * * def get_ticks(): # <<<<<<<<<<<<<< * return SDL_GetTicks() * */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_11pygame_time_5get_ticks(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused); /*proto*/ static PyMethodDef __pyx_mdef_11pygame_sdl2_11pygame_time_5get_ticks = {"get_ticks", (PyCFunction)__pyx_pw_11pygame_sdl2_11pygame_time_5get_ticks, METH_NOARGS, 0}; static PyObject *__pyx_pw_11pygame_sdl2_11pygame_time_5get_ticks(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("get_ticks (wrapper)", 0); __pyx_r = __pyx_pf_11pygame_sdl2_11pygame_time_4get_ticks(__pyx_self); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_11pygame_time_4get_ticks(CYTHON_UNUSED PyObject *__pyx_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("get_ticks", 0); /* "pygame_sdl2/pygame_time.pyx":39 * * def get_ticks(): * return SDL_GetTicks() # <<<<<<<<<<<<<< * * def wait(int milliseconds): */ __Pyx_XDECREF(__pyx_r); __pyx_t_1 = __Pyx_PyInt_From_uint32_t(SDL_GetTicks()); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 39; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "pygame_sdl2/pygame_time.pyx":38 * SDL_QuitSubSystem(SDL_INIT_TIMER) * * def get_ticks(): # <<<<<<<<<<<<<< * return SDL_GetTicks() * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("pygame_sdl2.pygame_time.get_ticks", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/pygame_time.pyx":41 * return SDL_GetTicks() * * def wait(int milliseconds): # <<<<<<<<<<<<<< * cdef int start * */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_11pygame_time_7wait(PyObject *__pyx_self, PyObject *__pyx_arg_milliseconds); /*proto*/ static PyMethodDef __pyx_mdef_11pygame_sdl2_11pygame_time_7wait = {"wait", (PyCFunction)__pyx_pw_11pygame_sdl2_11pygame_time_7wait, METH_O, 0}; static PyObject *__pyx_pw_11pygame_sdl2_11pygame_time_7wait(PyObject *__pyx_self, PyObject *__pyx_arg_milliseconds) { int __pyx_v_milliseconds; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("wait (wrapper)", 0); assert(__pyx_arg_milliseconds); { __pyx_v_milliseconds = __Pyx_PyInt_As_int(__pyx_arg_milliseconds); if (unlikely((__pyx_v_milliseconds == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 41; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; __Pyx_AddTraceback("pygame_sdl2.pygame_time.wait", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_11pygame_sdl2_11pygame_time_6wait(__pyx_self, ((int)__pyx_v_milliseconds)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_11pygame_time_6wait(CYTHON_UNUSED PyObject *__pyx_self, int __pyx_v_milliseconds) { int __pyx_v_start; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("wait", 0); /* "pygame_sdl2/pygame_time.pyx":44 * cdef int start * * start = SDL_GetTicks() # <<<<<<<<<<<<<< * with nogil: * SDL_Delay(milliseconds) */ __pyx_v_start = SDL_GetTicks(); /* "pygame_sdl2/pygame_time.pyx":45 * * start = SDL_GetTicks() * with nogil: # <<<<<<<<<<<<<< * SDL_Delay(milliseconds) * return SDL_GetTicks() - start */ { #ifdef WITH_THREAD PyThreadState *_save; Py_UNBLOCK_THREADS #endif /*try:*/ { /* "pygame_sdl2/pygame_time.pyx":46 * start = SDL_GetTicks() * with nogil: * SDL_Delay(milliseconds) # <<<<<<<<<<<<<< * return SDL_GetTicks() - start * */ SDL_Delay(__pyx_v_milliseconds); } /* "pygame_sdl2/pygame_time.pyx":45 * * start = SDL_GetTicks() * with nogil: # <<<<<<<<<<<<<< * SDL_Delay(milliseconds) * return SDL_GetTicks() - start */ /*finally:*/ { /*normal exit:*/{ #ifdef WITH_THREAD Py_BLOCK_THREADS #endif goto __pyx_L5; } __pyx_L5:; } } /* "pygame_sdl2/pygame_time.pyx":47 * with nogil: * SDL_Delay(milliseconds) * return SDL_GetTicks() - start # <<<<<<<<<<<<<< * * def delay(milliseconds): */ __Pyx_XDECREF(__pyx_r); __pyx_t_1 = __Pyx_PyInt_From_uint32_t((SDL_GetTicks() - __pyx_v_start)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 47; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "pygame_sdl2/pygame_time.pyx":41 * return SDL_GetTicks() * * def wait(int milliseconds): # <<<<<<<<<<<<<< * cdef int start * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("pygame_sdl2.pygame_time.wait", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/pygame_time.pyx":49 * return SDL_GetTicks() - start * * def delay(milliseconds): # <<<<<<<<<<<<<< * # SDL_Delay() should be accurate enough. * return wait(milliseconds) */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_11pygame_time_9delay(PyObject *__pyx_self, PyObject *__pyx_v_milliseconds); /*proto*/ static PyMethodDef __pyx_mdef_11pygame_sdl2_11pygame_time_9delay = {"delay", (PyCFunction)__pyx_pw_11pygame_sdl2_11pygame_time_9delay, METH_O, 0}; static PyObject *__pyx_pw_11pygame_sdl2_11pygame_time_9delay(PyObject *__pyx_self, PyObject *__pyx_v_milliseconds) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("delay (wrapper)", 0); __pyx_r = __pyx_pf_11pygame_sdl2_11pygame_time_8delay(__pyx_self, ((PyObject *)__pyx_v_milliseconds)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_11pygame_time_8delay(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_milliseconds) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("delay", 0); /* "pygame_sdl2/pygame_time.pyx":51 * def delay(milliseconds): * # SDL_Delay() should be accurate enough. * return wait(milliseconds) # <<<<<<<<<<<<<< * * cdef Uint32 timer_callback(Uint32 interval, void *param): */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_wait); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 51; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = NULL; if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_2))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); if (likely(__pyx_t_3)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); } } if (!__pyx_t_3) { __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_v_milliseconds); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 51; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); } else { __pyx_t_4 = PyTuple_New(1+1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 51; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_3); __pyx_t_3 = NULL; __Pyx_INCREF(__pyx_v_milliseconds); __Pyx_GIVEREF(__pyx_v_milliseconds); PyTuple_SET_ITEM(__pyx_t_4, 0+1, __pyx_v_milliseconds); __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_4, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 51; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; } __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "pygame_sdl2/pygame_time.pyx":49 * return SDL_GetTicks() - start * * def delay(milliseconds): # <<<<<<<<<<<<<< * # SDL_Delay() should be accurate enough. * return wait(milliseconds) */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_AddTraceback("pygame_sdl2.pygame_time.delay", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/pygame_time.pyx":53 * return wait(milliseconds) * * cdef Uint32 timer_callback(Uint32 interval, void *param): # <<<<<<<<<<<<<< * cdef SDL_Event e * e.type = param */ static Uint32 __pyx_f_11pygame_sdl2_11pygame_time_timer_callback(Uint32 __pyx_v_interval, void *__pyx_v_param) { SDL_Event __pyx_v_e; Uint32 __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("timer_callback", 0); /* "pygame_sdl2/pygame_time.pyx":55 * cdef Uint32 timer_callback(Uint32 interval, void *param): * cdef SDL_Event e * e.type = param # <<<<<<<<<<<<<< * e.user.code = 0 * e.user.data1 = NULL */ __pyx_v_e.type = ((int)__pyx_v_param); /* "pygame_sdl2/pygame_time.pyx":56 * cdef SDL_Event e * e.type = param * e.user.code = 0 # <<<<<<<<<<<<<< * e.user.data1 = NULL * e.user.data2 = NULL */ __pyx_v_e.user.code = 0; /* "pygame_sdl2/pygame_time.pyx":57 * e.type = param * e.user.code = 0 * e.user.data1 = NULL # <<<<<<<<<<<<<< * e.user.data2 = NULL * SDL_PushEvent(&e) */ __pyx_v_e.user.data1 = NULL; /* "pygame_sdl2/pygame_time.pyx":58 * e.user.code = 0 * e.user.data1 = NULL * e.user.data2 = NULL # <<<<<<<<<<<<<< * SDL_PushEvent(&e) * return interval */ __pyx_v_e.user.data2 = NULL; /* "pygame_sdl2/pygame_time.pyx":59 * e.user.data1 = NULL * e.user.data2 = NULL * SDL_PushEvent(&e) # <<<<<<<<<<<<<< * return interval * */ SDL_PushEvent((&__pyx_v_e)); /* "pygame_sdl2/pygame_time.pyx":60 * e.user.data2 = NULL * SDL_PushEvent(&e) * return interval # <<<<<<<<<<<<<< * * # A map from eventid to SDL_Timer_ID. */ __pyx_r = __pyx_v_interval; goto __pyx_L0; /* "pygame_sdl2/pygame_time.pyx":53 * return wait(milliseconds) * * cdef Uint32 timer_callback(Uint32 interval, void *param): # <<<<<<<<<<<<<< * cdef SDL_Event e * e.type = param */ /* function exit code */ __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/pygame_time.pyx":65 * cdef dict timer_by_event = { } * * def set_timer(eventid, milliseconds): # <<<<<<<<<<<<<< * * cdef int timer_id = timer_by_event.get(eventid, 0) */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_11pygame_time_11set_timer(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static PyMethodDef __pyx_mdef_11pygame_sdl2_11pygame_time_11set_timer = {"set_timer", (PyCFunction)__pyx_pw_11pygame_sdl2_11pygame_time_11set_timer, METH_VARARGS|METH_KEYWORDS, 0}; static PyObject *__pyx_pw_11pygame_sdl2_11pygame_time_11set_timer(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_eventid = 0; PyObject *__pyx_v_milliseconds = 0; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("set_timer (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_eventid,&__pyx_n_s_milliseconds,0}; PyObject* values[2] = {0,0}; if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_eventid)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; case 1: if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_milliseconds)) != 0)) kw_args--; else { __Pyx_RaiseArgtupleInvalid("set_timer", 1, 2, 2, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 65; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "set_timer") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 65; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } } else if (PyTuple_GET_SIZE(__pyx_args) != 2) { goto __pyx_L5_argtuple_error; } else { values[0] = PyTuple_GET_ITEM(__pyx_args, 0); values[1] = PyTuple_GET_ITEM(__pyx_args, 1); } __pyx_v_eventid = values[0]; __pyx_v_milliseconds = values[1]; } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("set_timer", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 65; __pyx_clineno = __LINE__; goto __pyx_L3_error;} __pyx_L3_error:; __Pyx_AddTraceback("pygame_sdl2.pygame_time.set_timer", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_11pygame_sdl2_11pygame_time_10set_timer(__pyx_self, __pyx_v_eventid, __pyx_v_milliseconds); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_11pygame_time_10set_timer(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_eventid, PyObject *__pyx_v_milliseconds) { int __pyx_v_timer_id; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_t_2; int __pyx_t_3; Uint32 __pyx_t_4; PyObject *__pyx_t_5 = NULL; PyObject *__pyx_t_6 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("set_timer", 0); /* "pygame_sdl2/pygame_time.pyx":67 * def set_timer(eventid, milliseconds): * * cdef int timer_id = timer_by_event.get(eventid, 0) # <<<<<<<<<<<<<< * * if timer_id != 0: */ if (unlikely(__pyx_v_11pygame_sdl2_11pygame_time_timer_by_event == Py_None)) { PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%s'", "get"); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 67; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } __pyx_t_1 = __Pyx_PyDict_GetItemDefault(__pyx_v_11pygame_sdl2_11pygame_time_timer_by_event, __pyx_v_eventid, __pyx_int_0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 67; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = __Pyx_PyInt_As_int(__pyx_t_1); if (unlikely((__pyx_t_2 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 67; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_v_timer_id = __pyx_t_2; /* "pygame_sdl2/pygame_time.pyx":69 * cdef int timer_id = timer_by_event.get(eventid, 0) * * if timer_id != 0: # <<<<<<<<<<<<<< * SDL_RemoveTimer(timer_id) * timer_id = 0 */ __pyx_t_3 = ((__pyx_v_timer_id != 0) != 0); if (__pyx_t_3) { /* "pygame_sdl2/pygame_time.pyx":70 * * if timer_id != 0: * SDL_RemoveTimer(timer_id) # <<<<<<<<<<<<<< * timer_id = 0 * */ SDL_RemoveTimer(__pyx_v_timer_id); /* "pygame_sdl2/pygame_time.pyx":71 * if timer_id != 0: * SDL_RemoveTimer(timer_id) * timer_id = 0 # <<<<<<<<<<<<<< * * if milliseconds > 0: */ __pyx_v_timer_id = 0; /* "pygame_sdl2/pygame_time.pyx":69 * cdef int timer_id = timer_by_event.get(eventid, 0) * * if timer_id != 0: # <<<<<<<<<<<<<< * SDL_RemoveTimer(timer_id) * timer_id = 0 */ } /* "pygame_sdl2/pygame_time.pyx":73 * timer_id = 0 * * if milliseconds > 0: # <<<<<<<<<<<<<< * timer_id = SDL_AddTimer(milliseconds, timer_callback, eventid) * if timer_id == 0: */ __pyx_t_1 = PyObject_RichCompare(__pyx_v_milliseconds, __pyx_int_0, Py_GT); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 73; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 73; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (__pyx_t_3) { /* "pygame_sdl2/pygame_time.pyx":74 * * if milliseconds > 0: * timer_id = SDL_AddTimer(milliseconds, timer_callback, eventid) # <<<<<<<<<<<<<< * if timer_id == 0: * raise error() */ __pyx_t_4 = __Pyx_PyInt_As_uint32_t(__pyx_v_milliseconds); if (unlikely((__pyx_t_4 == (Uint32)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 74; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_t_2 = __Pyx_PyInt_As_int(__pyx_v_eventid); if (unlikely((__pyx_t_2 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 74; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_v_timer_id = SDL_AddTimer(__pyx_t_4, ((SDL_TimerCallback)__pyx_f_11pygame_sdl2_11pygame_time_timer_callback), ((void *)((int)__pyx_t_2))); /* "pygame_sdl2/pygame_time.pyx":75 * if milliseconds > 0: * timer_id = SDL_AddTimer(milliseconds, timer_callback, eventid) * if timer_id == 0: # <<<<<<<<<<<<<< * raise error() * */ __pyx_t_3 = ((__pyx_v_timer_id == 0) != 0); if (__pyx_t_3) { /* "pygame_sdl2/pygame_time.pyx":76 * timer_id = SDL_AddTimer(milliseconds, timer_callback, eventid) * if timer_id == 0: * raise error() # <<<<<<<<<<<<<< * * timer_by_event[eventid] = timer_id */ __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_error); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 76; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); __pyx_t_6 = NULL; if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_5))) { __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_5); if (likely(__pyx_t_6)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5); __Pyx_INCREF(__pyx_t_6); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_5, function); } } if (__pyx_t_6) { __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_t_6); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 76; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; } else { __pyx_t_1 = __Pyx_PyObject_CallNoArg(__pyx_t_5); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 76; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_Raise(__pyx_t_1, 0, 0, 0); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; {__pyx_filename = __pyx_f[0]; __pyx_lineno = 76; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "pygame_sdl2/pygame_time.pyx":75 * if milliseconds > 0: * timer_id = SDL_AddTimer(milliseconds, timer_callback, eventid) * if timer_id == 0: # <<<<<<<<<<<<<< * raise error() * */ } /* "pygame_sdl2/pygame_time.pyx":73 * timer_id = 0 * * if milliseconds > 0: # <<<<<<<<<<<<<< * timer_id = SDL_AddTimer(milliseconds, timer_callback, eventid) * if timer_id == 0: */ } /* "pygame_sdl2/pygame_time.pyx":78 * raise error() * * timer_by_event[eventid] = timer_id # <<<<<<<<<<<<<< * * class Clock: */ __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_timer_id); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 78; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); if (unlikely(__pyx_v_11pygame_sdl2_11pygame_time_timer_by_event == Py_None)) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 78; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } if (unlikely(PyDict_SetItem(__pyx_v_11pygame_sdl2_11pygame_time_timer_by_event, __pyx_v_eventid, __pyx_t_1) < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 78; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "pygame_sdl2/pygame_time.pyx":65 * cdef dict timer_by_event = { } * * def set_timer(eventid, milliseconds): # <<<<<<<<<<<<<< * * cdef int timer_id = timer_by_event.get(eventid, 0) */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_5); __Pyx_XDECREF(__pyx_t_6); __Pyx_AddTraceback("pygame_sdl2.pygame_time.set_timer", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/pygame_time.pyx":81 * * class Clock: * def __init__(self): # <<<<<<<<<<<<<< * self.last = SDL_GetTicks() * self.last_frames = [] */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_11pygame_time_5Clock_1__init__(PyObject *__pyx_self, PyObject *__pyx_v_self); /*proto*/ static PyMethodDef __pyx_mdef_11pygame_sdl2_11pygame_time_5Clock_1__init__ = {"__init__", (PyCFunction)__pyx_pw_11pygame_sdl2_11pygame_time_5Clock_1__init__, METH_O, 0}; static PyObject *__pyx_pw_11pygame_sdl2_11pygame_time_5Clock_1__init__(PyObject *__pyx_self, PyObject *__pyx_v_self) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__init__ (wrapper)", 0); __pyx_r = __pyx_pf_11pygame_sdl2_11pygame_time_5Clock___init__(__pyx_self, ((PyObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_11pygame_time_5Clock___init__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__init__", 0); /* "pygame_sdl2/pygame_time.pyx":82 * class Clock: * def __init__(self): * self.last = SDL_GetTicks() # <<<<<<<<<<<<<< * self.last_frames = [] * self.frametime = 0 */ __pyx_t_1 = __Pyx_PyInt_From_uint32_t(SDL_GetTicks()); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 82; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_last, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 82; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "pygame_sdl2/pygame_time.pyx":83 * def __init__(self): * self.last = SDL_GetTicks() * self.last_frames = [] # <<<<<<<<<<<<<< * self.frametime = 0 * self.raw_frametime = 0 */ __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 83; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_last_frames, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 83; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "pygame_sdl2/pygame_time.pyx":84 * self.last = SDL_GetTicks() * self.last_frames = [] * self.frametime = 0 # <<<<<<<<<<<<<< * self.raw_frametime = 0 * */ if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_frametime, __pyx_int_0) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 84; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "pygame_sdl2/pygame_time.pyx":85 * self.last_frames = [] * self.frametime = 0 * self.raw_frametime = 0 # <<<<<<<<<<<<<< * * def tick(self, framerate=0): */ if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_raw_frametime, __pyx_int_0) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 85; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "pygame_sdl2/pygame_time.pyx":81 * * class Clock: * def __init__(self): # <<<<<<<<<<<<<< * self.last = SDL_GetTicks() * self.last_frames = [] */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("pygame_sdl2.pygame_time.Clock.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/pygame_time.pyx":87 * self.raw_frametime = 0 * * def tick(self, framerate=0): # <<<<<<<<<<<<<< * cdef int now = SDL_GetTicks() * self.raw_frametime = now - self.last */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_11pygame_time_5Clock_3tick(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static PyMethodDef __pyx_mdef_11pygame_sdl2_11pygame_time_5Clock_3tick = {"tick", (PyCFunction)__pyx_pw_11pygame_sdl2_11pygame_time_5Clock_3tick, METH_VARARGS|METH_KEYWORDS, 0}; static PyObject *__pyx_pw_11pygame_sdl2_11pygame_time_5Clock_3tick(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_self = 0; PyObject *__pyx_v_framerate = 0; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("tick (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_framerate,0}; PyObject* values[2] = {0,0}; values[1] = ((PyObject *)((PyObject *)__pyx_int_0)); if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_self)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; case 1: if (kw_args > 0) { PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_framerate); if (value) { values[1] = value; kw_args--; } } } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "tick") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 87; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } } else { switch (PyTuple_GET_SIZE(__pyx_args)) { case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_self = values[0]; __pyx_v_framerate = values[1]; } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("tick", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 87; __pyx_clineno = __LINE__; goto __pyx_L3_error;} __pyx_L3_error:; __Pyx_AddTraceback("pygame_sdl2.pygame_time.Clock.tick", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_11pygame_sdl2_11pygame_time_5Clock_2tick(__pyx_self, __pyx_v_self, __pyx_v_framerate); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_11pygame_time_5Clock_2tick(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_framerate) { int __pyx_v_now; int __pyx_v_frame_duration; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; Py_ssize_t __pyx_t_4; int __pyx_t_5; int __pyx_t_6; int __pyx_t_7; PyObject *__pyx_t_8 = NULL; PyObject *__pyx_t_9 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("tick", 0); /* "pygame_sdl2/pygame_time.pyx":88 * * def tick(self, framerate=0): * cdef int now = SDL_GetTicks() # <<<<<<<<<<<<<< * self.raw_frametime = now - self.last * while len(self.last_frames) > 9: */ __pyx_v_now = SDL_GetTicks(); /* "pygame_sdl2/pygame_time.pyx":89 * def tick(self, framerate=0): * cdef int now = SDL_GetTicks() * self.raw_frametime = now - self.last # <<<<<<<<<<<<<< * while len(self.last_frames) > 9: * self.last_frames.pop(0) */ __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_now); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 89; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_last); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 89; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = PyNumber_Subtract(__pyx_t_1, __pyx_t_2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 89; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_raw_frametime, __pyx_t_3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 89; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "pygame_sdl2/pygame_time.pyx":90 * cdef int now = SDL_GetTicks() * self.raw_frametime = now - self.last * while len(self.last_frames) > 9: # <<<<<<<<<<<<<< * self.last_frames.pop(0) * if framerate == 0: */ while (1) { __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_last_frames); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 90; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = PyObject_Length(__pyx_t_3); if (unlikely(__pyx_t_4 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 90; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_5 = ((__pyx_t_4 > 9) != 0); if (!__pyx_t_5) break; /* "pygame_sdl2/pygame_time.pyx":91 * self.raw_frametime = now - self.last * while len(self.last_frames) > 9: * self.last_frames.pop(0) # <<<<<<<<<<<<<< * if framerate == 0: * self.last = now */ __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_last_frames); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 91; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __pyx_t_2 = __Pyx_PyObject_PopIndex(__pyx_t_3, __pyx_int_0, 0, 1, Py_ssize_t, PyInt_FromSsize_t); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 91; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } /* "pygame_sdl2/pygame_time.pyx":92 * while len(self.last_frames) > 9: * self.last_frames.pop(0) * if framerate == 0: # <<<<<<<<<<<<<< * self.last = now * self.last_frames.append(self.raw_frametime) */ __pyx_t_2 = __Pyx_PyInt_EqObjC(__pyx_v_framerate, __pyx_int_0, 0, 0); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 92; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_5 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 92; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; if (__pyx_t_5) { /* "pygame_sdl2/pygame_time.pyx":93 * self.last_frames.pop(0) * if framerate == 0: * self.last = now # <<<<<<<<<<<<<< * self.last_frames.append(self.raw_frametime) * return self.raw_frametime */ __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_v_now); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 93; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_last, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 93; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "pygame_sdl2/pygame_time.pyx":94 * if framerate == 0: * self.last = now * self.last_frames.append(self.raw_frametime) # <<<<<<<<<<<<<< * return self.raw_frametime * cdef int frame_duration = 1.0 / framerate * 1000 */ __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_last_frames); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 94; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_raw_frametime); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 94; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __pyx_t_6 = __Pyx_PyObject_Append(__pyx_t_2, __pyx_t_3); if (unlikely(__pyx_t_6 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 94; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "pygame_sdl2/pygame_time.pyx":95 * self.last = now * self.last_frames.append(self.raw_frametime) * return self.raw_frametime # <<<<<<<<<<<<<< * cdef int frame_duration = 1.0 / framerate * 1000 * if self.raw_frametime < frame_duration: */ __Pyx_XDECREF(__pyx_r); __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_raw_frametime); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 95; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __pyx_r = __pyx_t_3; __pyx_t_3 = 0; goto __pyx_L0; /* "pygame_sdl2/pygame_time.pyx":92 * while len(self.last_frames) > 9: * self.last_frames.pop(0) * if framerate == 0: # <<<<<<<<<<<<<< * self.last = now * self.last_frames.append(self.raw_frametime) */ } /* "pygame_sdl2/pygame_time.pyx":96 * self.last_frames.append(self.raw_frametime) * return self.raw_frametime * cdef int frame_duration = 1.0 / framerate * 1000 # <<<<<<<<<<<<<< * if self.raw_frametime < frame_duration: * delay(frame_duration - self.raw_frametime) */ __pyx_t_3 = __Pyx_PyFloat_DivideCObj(__pyx_float_1_0, __pyx_v_framerate, 1.0, 0); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 96; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __pyx_t_2 = PyNumber_Multiply(__pyx_t_3, __pyx_int_1000); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 96; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_7 = __Pyx_PyInt_As_int(__pyx_t_2); if (unlikely((__pyx_t_7 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 96; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_v_frame_duration = __pyx_t_7; /* "pygame_sdl2/pygame_time.pyx":97 * return self.raw_frametime * cdef int frame_duration = 1.0 / framerate * 1000 * if self.raw_frametime < frame_duration: # <<<<<<<<<<<<<< * delay(frame_duration - self.raw_frametime) * now = SDL_GetTicks() */ __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_raw_frametime); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 97; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = __Pyx_PyInt_From_int(__pyx_v_frame_duration); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 97; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __pyx_t_1 = PyObject_RichCompare(__pyx_t_2, __pyx_t_3, Py_LT); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 97; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_5 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 97; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (__pyx_t_5) { /* "pygame_sdl2/pygame_time.pyx":98 * cdef int frame_duration = 1.0 / framerate * 1000 * if self.raw_frametime < frame_duration: * delay(frame_duration - self.raw_frametime) # <<<<<<<<<<<<<< * now = SDL_GetTicks() * self.frametime = now - self.last */ __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_delay); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 98; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_v_frame_duration); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 98; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_raw_frametime); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 98; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_8); __pyx_t_9 = PyNumber_Subtract(__pyx_t_2, __pyx_t_8); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 98; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_9); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; __pyx_t_8 = NULL; if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_3))) { __pyx_t_8 = PyMethod_GET_SELF(__pyx_t_3); if (likely(__pyx_t_8)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); __Pyx_INCREF(__pyx_t_8); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_3, function); } } if (!__pyx_t_8) { __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_9); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 98; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; __Pyx_GOTREF(__pyx_t_1); } else { __pyx_t_2 = PyTuple_New(1+1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 98; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __Pyx_GIVEREF(__pyx_t_8); PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_8); __pyx_t_8 = NULL; __Pyx_GIVEREF(__pyx_t_9); PyTuple_SET_ITEM(__pyx_t_2, 0+1, __pyx_t_9); __pyx_t_9 = 0; __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_2, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 98; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "pygame_sdl2/pygame_time.pyx":97 * return self.raw_frametime * cdef int frame_duration = 1.0 / framerate * 1000 * if self.raw_frametime < frame_duration: # <<<<<<<<<<<<<< * delay(frame_duration - self.raw_frametime) * now = SDL_GetTicks() */ } /* "pygame_sdl2/pygame_time.pyx":99 * if self.raw_frametime < frame_duration: * delay(frame_duration - self.raw_frametime) * now = SDL_GetTicks() # <<<<<<<<<<<<<< * self.frametime = now - self.last * self.last = now */ __pyx_v_now = SDL_GetTicks(); /* "pygame_sdl2/pygame_time.pyx":100 * delay(frame_duration - self.raw_frametime) * now = SDL_GetTicks() * self.frametime = now - self.last # <<<<<<<<<<<<<< * self.last = now * self.last_frames.append(self.frametime) */ __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_now); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 100; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_last); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 100; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __pyx_t_2 = PyNumber_Subtract(__pyx_t_1, __pyx_t_3); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 100; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_frametime, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 100; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "pygame_sdl2/pygame_time.pyx":101 * now = SDL_GetTicks() * self.frametime = now - self.last * self.last = now # <<<<<<<<<<<<<< * self.last_frames.append(self.frametime) * return self.frametime */ __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_v_now); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 101; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_last, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 101; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "pygame_sdl2/pygame_time.pyx":102 * self.frametime = now - self.last * self.last = now * self.last_frames.append(self.frametime) # <<<<<<<<<<<<<< * return self.frametime * */ __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_last_frames); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 102; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_frametime); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 102; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __pyx_t_6 = __Pyx_PyObject_Append(__pyx_t_2, __pyx_t_3); if (unlikely(__pyx_t_6 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 102; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "pygame_sdl2/pygame_time.pyx":103 * self.last = now * self.last_frames.append(self.frametime) * return self.frametime # <<<<<<<<<<<<<< * * def tick_busy_loop(self, framerate=0): */ __Pyx_XDECREF(__pyx_r); __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_frametime); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 103; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __pyx_r = __pyx_t_3; __pyx_t_3 = 0; goto __pyx_L0; /* "pygame_sdl2/pygame_time.pyx":87 * self.raw_frametime = 0 * * def tick(self, framerate=0): # <<<<<<<<<<<<<< * cdef int now = SDL_GetTicks() * self.raw_frametime = now - self.last */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_8); __Pyx_XDECREF(__pyx_t_9); __Pyx_AddTraceback("pygame_sdl2.pygame_time.Clock.tick", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/pygame_time.pyx":105 * return self.frametime * * def tick_busy_loop(self, framerate=0): # <<<<<<<<<<<<<< * return self.tick(framerate) * */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_11pygame_time_5Clock_5tick_busy_loop(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static PyMethodDef __pyx_mdef_11pygame_sdl2_11pygame_time_5Clock_5tick_busy_loop = {"tick_busy_loop", (PyCFunction)__pyx_pw_11pygame_sdl2_11pygame_time_5Clock_5tick_busy_loop, METH_VARARGS|METH_KEYWORDS, 0}; static PyObject *__pyx_pw_11pygame_sdl2_11pygame_time_5Clock_5tick_busy_loop(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_self = 0; PyObject *__pyx_v_framerate = 0; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("tick_busy_loop (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_framerate,0}; PyObject* values[2] = {0,0}; values[1] = ((PyObject *)((PyObject *)__pyx_int_0)); if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_self)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; case 1: if (kw_args > 0) { PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_framerate); if (value) { values[1] = value; kw_args--; } } } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "tick_busy_loop") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 105; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } } else { switch (PyTuple_GET_SIZE(__pyx_args)) { case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_self = values[0]; __pyx_v_framerate = values[1]; } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("tick_busy_loop", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 105; __pyx_clineno = __LINE__; goto __pyx_L3_error;} __pyx_L3_error:; __Pyx_AddTraceback("pygame_sdl2.pygame_time.Clock.tick_busy_loop", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_11pygame_sdl2_11pygame_time_5Clock_4tick_busy_loop(__pyx_self, __pyx_v_self, __pyx_v_framerate); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_11pygame_time_5Clock_4tick_busy_loop(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_framerate) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("tick_busy_loop", 0); /* "pygame_sdl2/pygame_time.pyx":106 * * def tick_busy_loop(self, framerate=0): * return self.tick(framerate) # <<<<<<<<<<<<<< * * def get_time(self): */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_tick); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 106; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = NULL; if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_2))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); if (likely(__pyx_t_3)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); } } if (!__pyx_t_3) { __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_v_framerate); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 106; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); } else { __pyx_t_4 = PyTuple_New(1+1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 106; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_3); __pyx_t_3 = NULL; __Pyx_INCREF(__pyx_v_framerate); __Pyx_GIVEREF(__pyx_v_framerate); PyTuple_SET_ITEM(__pyx_t_4, 0+1, __pyx_v_framerate); __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_4, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 106; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; } __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "pygame_sdl2/pygame_time.pyx":105 * return self.frametime * * def tick_busy_loop(self, framerate=0): # <<<<<<<<<<<<<< * return self.tick(framerate) * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_AddTraceback("pygame_sdl2.pygame_time.Clock.tick_busy_loop", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/pygame_time.pyx":108 * return self.tick(framerate) * * def get_time(self): # <<<<<<<<<<<<<< * return self.frametime * */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_11pygame_time_5Clock_7get_time(PyObject *__pyx_self, PyObject *__pyx_v_self); /*proto*/ static PyMethodDef __pyx_mdef_11pygame_sdl2_11pygame_time_5Clock_7get_time = {"get_time", (PyCFunction)__pyx_pw_11pygame_sdl2_11pygame_time_5Clock_7get_time, METH_O, 0}; static PyObject *__pyx_pw_11pygame_sdl2_11pygame_time_5Clock_7get_time(PyObject *__pyx_self, PyObject *__pyx_v_self) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("get_time (wrapper)", 0); __pyx_r = __pyx_pf_11pygame_sdl2_11pygame_time_5Clock_6get_time(__pyx_self, ((PyObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_11pygame_time_5Clock_6get_time(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("get_time", 0); /* "pygame_sdl2/pygame_time.pyx":109 * * def get_time(self): * return self.frametime # <<<<<<<<<<<<<< * * def get_rawtime(self): */ __Pyx_XDECREF(__pyx_r); __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_frametime); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 109; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "pygame_sdl2/pygame_time.pyx":108 * return self.tick(framerate) * * def get_time(self): # <<<<<<<<<<<<<< * return self.frametime * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("pygame_sdl2.pygame_time.Clock.get_time", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/pygame_time.pyx":111 * return self.frametime * * def get_rawtime(self): # <<<<<<<<<<<<<< * return self.raw_frametime * */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_11pygame_time_5Clock_9get_rawtime(PyObject *__pyx_self, PyObject *__pyx_v_self); /*proto*/ static PyMethodDef __pyx_mdef_11pygame_sdl2_11pygame_time_5Clock_9get_rawtime = {"get_rawtime", (PyCFunction)__pyx_pw_11pygame_sdl2_11pygame_time_5Clock_9get_rawtime, METH_O, 0}; static PyObject *__pyx_pw_11pygame_sdl2_11pygame_time_5Clock_9get_rawtime(PyObject *__pyx_self, PyObject *__pyx_v_self) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("get_rawtime (wrapper)", 0); __pyx_r = __pyx_pf_11pygame_sdl2_11pygame_time_5Clock_8get_rawtime(__pyx_self, ((PyObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_11pygame_time_5Clock_8get_rawtime(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("get_rawtime", 0); /* "pygame_sdl2/pygame_time.pyx":112 * * def get_rawtime(self): * return self.raw_frametime # <<<<<<<<<<<<<< * * @cython.cdivision(True) */ __Pyx_XDECREF(__pyx_r); __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_raw_frametime); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 112; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "pygame_sdl2/pygame_time.pyx":111 * return self.frametime * * def get_rawtime(self): # <<<<<<<<<<<<<< * return self.raw_frametime * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("pygame_sdl2.pygame_time.Clock.get_rawtime", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/pygame_time.pyx":115 * * @cython.cdivision(True) * def get_fps(self): # <<<<<<<<<<<<<< * cdef int total_time = sum(self.last_frames) * cdef float average_time = total_time / 1000.0 / len(self.last_frames) */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_11pygame_time_5Clock_11get_fps(PyObject *__pyx_self, PyObject *__pyx_v_self); /*proto*/ static PyMethodDef __pyx_mdef_11pygame_sdl2_11pygame_time_5Clock_11get_fps = {"get_fps", (PyCFunction)__pyx_pw_11pygame_sdl2_11pygame_time_5Clock_11get_fps, METH_O, 0}; static PyObject *__pyx_pw_11pygame_sdl2_11pygame_time_5Clock_11get_fps(PyObject *__pyx_self, PyObject *__pyx_v_self) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("get_fps (wrapper)", 0); __pyx_r = __pyx_pf_11pygame_sdl2_11pygame_time_5Clock_10get_fps(__pyx_self, ((PyObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_11pygame_time_5Clock_10get_fps(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self) { int __pyx_v_total_time; float __pyx_v_average_time; float __pyx_v_average_fps; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; int __pyx_t_3; Py_ssize_t __pyx_t_4; PyObject *__pyx_t_5 = NULL; PyObject *__pyx_t_6 = NULL; PyObject *__pyx_t_7 = NULL; PyObject *__pyx_t_8 = NULL; int __pyx_t_9; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("get_fps", 0); /* "pygame_sdl2/pygame_time.pyx":116 * @cython.cdivision(True) * def get_fps(self): * cdef int total_time = sum(self.last_frames) # <<<<<<<<<<<<<< * cdef float average_time = total_time / 1000.0 / len(self.last_frames) * cdef float average_fps = 1.0 / average_time */ __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_last_frames); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 116; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 116; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __Pyx_GIVEREF(__pyx_t_1); PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_1); __pyx_t_1 = 0; __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_sum, __pyx_t_2, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 116; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_3 = __Pyx_PyInt_As_int(__pyx_t_1); if (unlikely((__pyx_t_3 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 116; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_v_total_time = __pyx_t_3; /* "pygame_sdl2/pygame_time.pyx":117 * def get_fps(self): * cdef int total_time = sum(self.last_frames) * cdef float average_time = total_time / 1000.0 / len(self.last_frames) # <<<<<<<<<<<<<< * cdef float average_fps = 1.0 / average_time * return 0 if math.isnan(average_fps) else average_fps */ __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_last_frames); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 117; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_t_4 = PyObject_Length(__pyx_t_1); if (unlikely(__pyx_t_4 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 117; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_v_average_time = ((__pyx_v_total_time / 1000.0) / __pyx_t_4); /* "pygame_sdl2/pygame_time.pyx":118 * cdef int total_time = sum(self.last_frames) * cdef float average_time = total_time / 1000.0 / len(self.last_frames) * cdef float average_fps = 1.0 / average_time # <<<<<<<<<<<<<< * return 0 if math.isnan(average_fps) else average_fps */ __pyx_v_average_fps = (1.0 / __pyx_v_average_time); /* "pygame_sdl2/pygame_time.pyx":119 * cdef float average_time = total_time / 1000.0 / len(self.last_frames) * cdef float average_fps = 1.0 / average_time * return 0 if math.isnan(average_fps) else average_fps # <<<<<<<<<<<<<< */ __Pyx_XDECREF(__pyx_r); __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_math); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 119; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_isnan); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 119; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __pyx_t_5 = PyFloat_FromDouble(__pyx_v_average_fps); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 119; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); __pyx_t_7 = NULL; if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_6))) { __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_6); if (likely(__pyx_t_7)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6); __Pyx_INCREF(__pyx_t_7); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_6, function); } } if (!__pyx_t_7) { __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_6, __pyx_t_5); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 119; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_GOTREF(__pyx_t_2); } else { __pyx_t_8 = PyTuple_New(1+1); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 119; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_8); __Pyx_GIVEREF(__pyx_t_7); PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_7); __pyx_t_7 = NULL; __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_8, 0+1, __pyx_t_5); __pyx_t_5 = 0; __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_8, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 119; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; } __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __pyx_t_9 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_9 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 119; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; if (__pyx_t_9) { __Pyx_INCREF(__pyx_int_0); __pyx_t_1 = __pyx_int_0; } else { __pyx_t_2 = PyFloat_FromDouble(__pyx_v_average_fps); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 119; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __pyx_t_1 = __pyx_t_2; __pyx_t_2 = 0; } __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "pygame_sdl2/pygame_time.pyx":115 * * @cython.cdivision(True) * def get_fps(self): # <<<<<<<<<<<<<< * cdef int total_time = sum(self.last_frames) * cdef float average_time = total_time / 1000.0 / len(self.last_frames) */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_5); __Pyx_XDECREF(__pyx_t_6); __Pyx_XDECREF(__pyx_t_7); __Pyx_XDECREF(__pyx_t_8); __Pyx_AddTraceback("pygame_sdl2.pygame_time.Clock.get_fps", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyMethodDef __pyx_methods[] = { {0, 0, 0, 0} }; #if PY_MAJOR_VERSION >= 3 static struct PyModuleDef __pyx_moduledef = { #if PY_VERSION_HEX < 0x03020000 { PyObject_HEAD_INIT(NULL) NULL, 0, NULL }, #else PyModuleDef_HEAD_INIT, #endif "pygame_time", 0, /* m_doc */ -1, /* m_size */ __pyx_methods /* m_methods */, NULL, /* m_reload */ NULL, /* m_traverse */ NULL, /* m_clear */ NULL /* m_free */ }; #endif static __Pyx_StringTabEntry __pyx_string_tab[] = { {&__pyx_n_s_Clock, __pyx_k_Clock, sizeof(__pyx_k_Clock), 0, 0, 1, 1}, {&__pyx_n_s_Clock___init, __pyx_k_Clock___init, sizeof(__pyx_k_Clock___init), 0, 0, 1, 1}, {&__pyx_n_s_Clock_get_fps, __pyx_k_Clock_get_fps, sizeof(__pyx_k_Clock_get_fps), 0, 0, 1, 1}, {&__pyx_n_s_Clock_get_rawtime, __pyx_k_Clock_get_rawtime, sizeof(__pyx_k_Clock_get_rawtime), 0, 0, 1, 1}, {&__pyx_n_s_Clock_get_time, __pyx_k_Clock_get_time, sizeof(__pyx_k_Clock_get_time), 0, 0, 1, 1}, {&__pyx_n_s_Clock_tick, __pyx_k_Clock_tick, sizeof(__pyx_k_Clock_tick), 0, 0, 1, 1}, {&__pyx_n_s_Clock_tick_busy_loop, __pyx_k_Clock_tick_busy_loop, sizeof(__pyx_k_Clock_tick_busy_loop), 0, 0, 1, 1}, {&__pyx_n_s_append, __pyx_k_append, sizeof(__pyx_k_append), 0, 0, 1, 1}, {&__pyx_n_s_average_fps, __pyx_k_average_fps, sizeof(__pyx_k_average_fps), 0, 0, 1, 1}, {&__pyx_n_s_average_time, __pyx_k_average_time, sizeof(__pyx_k_average_time), 0, 0, 1, 1}, {&__pyx_n_s_delay, __pyx_k_delay, sizeof(__pyx_k_delay), 0, 0, 1, 1}, {&__pyx_n_s_display, __pyx_k_display, sizeof(__pyx_k_display), 0, 0, 1, 1}, {&__pyx_n_s_doc, __pyx_k_doc, sizeof(__pyx_k_doc), 0, 0, 1, 1}, {&__pyx_n_s_error, __pyx_k_error, sizeof(__pyx_k_error), 0, 0, 1, 1}, {&__pyx_n_s_eventid, __pyx_k_eventid, sizeof(__pyx_k_eventid), 0, 0, 1, 1}, {&__pyx_n_s_frame_duration, __pyx_k_frame_duration, sizeof(__pyx_k_frame_duration), 0, 0, 1, 1}, {&__pyx_n_s_framerate, __pyx_k_framerate, sizeof(__pyx_k_framerate), 0, 0, 1, 1}, {&__pyx_n_s_frametime, __pyx_k_frametime, sizeof(__pyx_k_frametime), 0, 0, 1, 1}, {&__pyx_n_s_get, __pyx_k_get, sizeof(__pyx_k_get), 0, 0, 1, 1}, {&__pyx_n_s_get_fps, __pyx_k_get_fps, sizeof(__pyx_k_get_fps), 0, 0, 1, 1}, {&__pyx_n_s_get_rawtime, __pyx_k_get_rawtime, sizeof(__pyx_k_get_rawtime), 0, 0, 1, 1}, {&__pyx_n_s_get_ticks, __pyx_k_get_ticks, sizeof(__pyx_k_get_ticks), 0, 0, 1, 1}, {&__pyx_n_s_get_time, __pyx_k_get_time, sizeof(__pyx_k_get_time), 0, 0, 1, 1}, {&__pyx_kp_s_home_tom_ab_pygame_sdl2_src_pyg, __pyx_k_home_tom_ab_pygame_sdl2_src_pyg, sizeof(__pyx_k_home_tom_ab_pygame_sdl2_src_pyg), 0, 0, 1, 0}, {&__pyx_n_s_import, __pyx_k_import, sizeof(__pyx_k_import), 0, 0, 1, 1}, {&__pyx_n_s_init, __pyx_k_init, sizeof(__pyx_k_init), 0, 0, 1, 1}, {&__pyx_n_s_init_2, __pyx_k_init_2, sizeof(__pyx_k_init_2), 0, 0, 1, 1}, {&__pyx_n_s_isnan, __pyx_k_isnan, sizeof(__pyx_k_isnan), 0, 0, 1, 1}, {&__pyx_n_s_last, __pyx_k_last, sizeof(__pyx_k_last), 0, 0, 1, 1}, {&__pyx_n_s_last_frames, __pyx_k_last_frames, sizeof(__pyx_k_last_frames), 0, 0, 1, 1}, {&__pyx_n_s_main, __pyx_k_main, sizeof(__pyx_k_main), 0, 0, 1, 1}, {&__pyx_n_s_math, __pyx_k_math, sizeof(__pyx_k_math), 0, 0, 1, 1}, {&__pyx_n_s_metaclass, __pyx_k_metaclass, sizeof(__pyx_k_metaclass), 0, 0, 1, 1}, {&__pyx_n_s_milliseconds, __pyx_k_milliseconds, sizeof(__pyx_k_milliseconds), 0, 0, 1, 1}, {&__pyx_n_s_module, __pyx_k_module, sizeof(__pyx_k_module), 0, 0, 1, 1}, {&__pyx_n_s_now, __pyx_k_now, sizeof(__pyx_k_now), 0, 0, 1, 1}, {&__pyx_n_s_pop, __pyx_k_pop, sizeof(__pyx_k_pop), 0, 0, 1, 1}, {&__pyx_n_s_prepare, __pyx_k_prepare, sizeof(__pyx_k_prepare), 0, 0, 1, 1}, {&__pyx_n_s_pygame_sdl2, __pyx_k_pygame_sdl2, sizeof(__pyx_k_pygame_sdl2), 0, 0, 1, 1}, {&__pyx_n_s_pygame_sdl2_error, __pyx_k_pygame_sdl2_error, sizeof(__pyx_k_pygame_sdl2_error), 0, 0, 1, 1}, {&__pyx_n_s_pygame_sdl2_pygame_time, __pyx_k_pygame_sdl2_pygame_time, sizeof(__pyx_k_pygame_sdl2_pygame_time), 0, 0, 1, 1}, {&__pyx_n_s_qualname, __pyx_k_qualname, sizeof(__pyx_k_qualname), 0, 0, 1, 1}, {&__pyx_n_s_quit, __pyx_k_quit, sizeof(__pyx_k_quit), 0, 0, 1, 1}, {&__pyx_n_s_raw_frametime, __pyx_k_raw_frametime, sizeof(__pyx_k_raw_frametime), 0, 0, 1, 1}, {&__pyx_n_s_register_init, __pyx_k_register_init, sizeof(__pyx_k_register_init), 0, 0, 1, 1}, {&__pyx_n_s_register_quit, __pyx_k_register_quit, sizeof(__pyx_k_register_quit), 0, 0, 1, 1}, {&__pyx_n_s_sdl_main_init, __pyx_k_sdl_main_init, sizeof(__pyx_k_sdl_main_init), 0, 0, 1, 1}, {&__pyx_n_s_self, __pyx_k_self, sizeof(__pyx_k_self), 0, 0, 1, 1}, {&__pyx_n_s_set_timer, __pyx_k_set_timer, sizeof(__pyx_k_set_timer), 0, 0, 1, 1}, {&__pyx_n_s_start, __pyx_k_start, sizeof(__pyx_k_start), 0, 0, 1, 1}, {&__pyx_n_s_sum, __pyx_k_sum, sizeof(__pyx_k_sum), 0, 0, 1, 1}, {&__pyx_n_s_test, __pyx_k_test, sizeof(__pyx_k_test), 0, 0, 1, 1}, {&__pyx_n_s_tick, __pyx_k_tick, sizeof(__pyx_k_tick), 0, 0, 1, 1}, {&__pyx_n_s_tick_busy_loop, __pyx_k_tick_busy_loop, sizeof(__pyx_k_tick_busy_loop), 0, 0, 1, 1}, {&__pyx_n_s_timer_id, __pyx_k_timer_id, sizeof(__pyx_k_timer_id), 0, 0, 1, 1}, {&__pyx_n_s_total_time, __pyx_k_total_time, sizeof(__pyx_k_total_time), 0, 0, 1, 1}, {&__pyx_n_s_wait, __pyx_k_wait, sizeof(__pyx_k_wait), 0, 0, 1, 1}, {0, 0, 0, 0, 0, 0, 0} }; static int __Pyx_InitCachedBuiltins(void) { __pyx_builtin_sum = __Pyx_GetBuiltinName(__pyx_n_s_sum); if (!__pyx_builtin_sum) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 116; __pyx_clineno = __LINE__; goto __pyx_L1_error;} return 0; __pyx_L1_error:; return -1; } static int __Pyx_InitCachedConstants(void) { __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__Pyx_InitCachedConstants", 0); /* "pygame_sdl2/pygame_time.pyx":28 * * @pygame_sdl2.register_init * def init(): # <<<<<<<<<<<<<< * pygame_sdl2.display.sdl_main_init() * */ __pyx_codeobj_ = (PyObject*)__Pyx_PyCode_New(0, 0, 0, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_tom_ab_pygame_sdl2_src_pyg, __pyx_n_s_init, 28, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj_)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 28; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "pygame_sdl2/pygame_time.pyx":35 * * @pygame_sdl2.register_quit * def quit(): # @ReservedAssignment # <<<<<<<<<<<<<< * SDL_QuitSubSystem(SDL_INIT_TIMER) * */ __pyx_codeobj__2 = (PyObject*)__Pyx_PyCode_New(0, 0, 0, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_tom_ab_pygame_sdl2_src_pyg, __pyx_n_s_quit, 35, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 35; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "pygame_sdl2/pygame_time.pyx":38 * SDL_QuitSubSystem(SDL_INIT_TIMER) * * def get_ticks(): # <<<<<<<<<<<<<< * return SDL_GetTicks() * */ __pyx_codeobj__3 = (PyObject*)__Pyx_PyCode_New(0, 0, 0, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_tom_ab_pygame_sdl2_src_pyg, __pyx_n_s_get_ticks, 38, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 38; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "pygame_sdl2/pygame_time.pyx":41 * return SDL_GetTicks() * * def wait(int milliseconds): # <<<<<<<<<<<<<< * cdef int start * */ __pyx_tuple__4 = PyTuple_Pack(3, __pyx_n_s_milliseconds, __pyx_n_s_milliseconds, __pyx_n_s_start); if (unlikely(!__pyx_tuple__4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 41; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_tuple__4); __Pyx_GIVEREF(__pyx_tuple__4); __pyx_codeobj__5 = (PyObject*)__Pyx_PyCode_New(1, 0, 3, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__4, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_tom_ab_pygame_sdl2_src_pyg, __pyx_n_s_wait, 41, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 41; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "pygame_sdl2/pygame_time.pyx":49 * return SDL_GetTicks() - start * * def delay(milliseconds): # <<<<<<<<<<<<<< * # SDL_Delay() should be accurate enough. * return wait(milliseconds) */ __pyx_tuple__6 = PyTuple_Pack(1, __pyx_n_s_milliseconds); if (unlikely(!__pyx_tuple__6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 49; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_tuple__6); __Pyx_GIVEREF(__pyx_tuple__6); __pyx_codeobj__7 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__6, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_tom_ab_pygame_sdl2_src_pyg, __pyx_n_s_delay, 49, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 49; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "pygame_sdl2/pygame_time.pyx":65 * cdef dict timer_by_event = { } * * def set_timer(eventid, milliseconds): # <<<<<<<<<<<<<< * * cdef int timer_id = timer_by_event.get(eventid, 0) */ __pyx_tuple__8 = PyTuple_Pack(3, __pyx_n_s_eventid, __pyx_n_s_milliseconds, __pyx_n_s_timer_id); if (unlikely(!__pyx_tuple__8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 65; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_tuple__8); __Pyx_GIVEREF(__pyx_tuple__8); __pyx_codeobj__9 = (PyObject*)__Pyx_PyCode_New(2, 0, 3, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__8, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_tom_ab_pygame_sdl2_src_pyg, __pyx_n_s_set_timer, 65, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 65; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "pygame_sdl2/pygame_time.pyx":81 * * class Clock: * def __init__(self): # <<<<<<<<<<<<<< * self.last = SDL_GetTicks() * self.last_frames = [] */ __pyx_tuple__10 = PyTuple_Pack(1, __pyx_n_s_self); if (unlikely(!__pyx_tuple__10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 81; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_tuple__10); __Pyx_GIVEREF(__pyx_tuple__10); __pyx_codeobj__11 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__10, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_tom_ab_pygame_sdl2_src_pyg, __pyx_n_s_init_2, 81, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 81; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "pygame_sdl2/pygame_time.pyx":87 * self.raw_frametime = 0 * * def tick(self, framerate=0): # <<<<<<<<<<<<<< * cdef int now = SDL_GetTicks() * self.raw_frametime = now - self.last */ __pyx_tuple__12 = PyTuple_Pack(4, __pyx_n_s_self, __pyx_n_s_framerate, __pyx_n_s_now, __pyx_n_s_frame_duration); if (unlikely(!__pyx_tuple__12)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 87; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_tuple__12); __Pyx_GIVEREF(__pyx_tuple__12); __pyx_codeobj__13 = (PyObject*)__Pyx_PyCode_New(2, 0, 4, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__12, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_tom_ab_pygame_sdl2_src_pyg, __pyx_n_s_tick, 87, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__13)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 87; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_tuple__14 = PyTuple_Pack(1, ((PyObject *)__pyx_int_0)); if (unlikely(!__pyx_tuple__14)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 87; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_tuple__14); __Pyx_GIVEREF(__pyx_tuple__14); /* "pygame_sdl2/pygame_time.pyx":105 * return self.frametime * * def tick_busy_loop(self, framerate=0): # <<<<<<<<<<<<<< * return self.tick(framerate) * */ __pyx_tuple__15 = PyTuple_Pack(2, __pyx_n_s_self, __pyx_n_s_framerate); if (unlikely(!__pyx_tuple__15)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 105; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_tuple__15); __Pyx_GIVEREF(__pyx_tuple__15); __pyx_codeobj__16 = (PyObject*)__Pyx_PyCode_New(2, 0, 2, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__15, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_tom_ab_pygame_sdl2_src_pyg, __pyx_n_s_tick_busy_loop, 105, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__16)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 105; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_tuple__17 = PyTuple_Pack(1, ((PyObject *)__pyx_int_0)); if (unlikely(!__pyx_tuple__17)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 105; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_tuple__17); __Pyx_GIVEREF(__pyx_tuple__17); /* "pygame_sdl2/pygame_time.pyx":108 * return self.tick(framerate) * * def get_time(self): # <<<<<<<<<<<<<< * return self.frametime * */ __pyx_tuple__18 = PyTuple_Pack(1, __pyx_n_s_self); if (unlikely(!__pyx_tuple__18)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 108; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_tuple__18); __Pyx_GIVEREF(__pyx_tuple__18); __pyx_codeobj__19 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__18, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_tom_ab_pygame_sdl2_src_pyg, __pyx_n_s_get_time, 108, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__19)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 108; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "pygame_sdl2/pygame_time.pyx":111 * return self.frametime * * def get_rawtime(self): # <<<<<<<<<<<<<< * return self.raw_frametime * */ __pyx_tuple__20 = PyTuple_Pack(1, __pyx_n_s_self); if (unlikely(!__pyx_tuple__20)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 111; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_tuple__20); __Pyx_GIVEREF(__pyx_tuple__20); __pyx_codeobj__21 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__20, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_tom_ab_pygame_sdl2_src_pyg, __pyx_n_s_get_rawtime, 111, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__21)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 111; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "pygame_sdl2/pygame_time.pyx":115 * * @cython.cdivision(True) * def get_fps(self): # <<<<<<<<<<<<<< * cdef int total_time = sum(self.last_frames) * cdef float average_time = total_time / 1000.0 / len(self.last_frames) */ __pyx_tuple__22 = PyTuple_Pack(4, __pyx_n_s_self, __pyx_n_s_total_time, __pyx_n_s_average_time, __pyx_n_s_average_fps); if (unlikely(!__pyx_tuple__22)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 115; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_tuple__22); __Pyx_GIVEREF(__pyx_tuple__22); __pyx_codeobj__23 = (PyObject*)__Pyx_PyCode_New(1, 0, 4, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__22, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_tom_ab_pygame_sdl2_src_pyg, __pyx_n_s_get_fps, 115, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__23)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 115; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_RefNannyFinishContext(); return 0; __pyx_L1_error:; __Pyx_RefNannyFinishContext(); return -1; } static int __Pyx_InitGlobals(void) { if (__Pyx_InitStrings(__pyx_string_tab) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; __pyx_float_1_0 = PyFloat_FromDouble(1.0); if (unlikely(!__pyx_float_1_0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_int_0 = PyInt_FromLong(0); if (unlikely(!__pyx_int_0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_int_1000 = PyInt_FromLong(1000); if (unlikely(!__pyx_int_1000)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} return 0; __pyx_L1_error:; return -1; } #if PY_MAJOR_VERSION < 3 PyMODINIT_FUNC initpygame_time(void); /*proto*/ PyMODINIT_FUNC initpygame_time(void) #else PyMODINIT_FUNC PyInit_pygame_time(void); /*proto*/ PyMODINIT_FUNC PyInit_pygame_time(void) #endif { PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; PyObject *__pyx_t_5 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannyDeclarations #if CYTHON_REFNANNY __Pyx_RefNanny = __Pyx_RefNannyImportAPI("refnanny"); if (!__Pyx_RefNanny) { PyErr_Clear(); __Pyx_RefNanny = __Pyx_RefNannyImportAPI("Cython.Runtime.refnanny"); if (!__Pyx_RefNanny) Py_FatalError("failed to import 'refnanny' module"); } #endif __Pyx_RefNannySetupContext("PyMODINIT_FUNC PyInit_pygame_time(void)", 0); if (__Pyx_check_binary_version() < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_empty_tuple = PyTuple_New(0); if (unlikely(!__pyx_empty_tuple)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_empty_bytes = PyBytes_FromStringAndSize("", 0); if (unlikely(!__pyx_empty_bytes)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} #ifdef __Pyx_CyFunction_USED if (__pyx_CyFunction_init() < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} #endif #ifdef __Pyx_FusedFunction_USED if (__pyx_FusedFunction_init() < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} #endif #ifdef __Pyx_Coroutine_USED if (__pyx_Coroutine_init() < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} #endif #ifdef __Pyx_Generator_USED if (__pyx_Generator_init() < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} #endif #ifdef __Pyx_StopAsyncIteration_USED if (__pyx_StopAsyncIteration_init() < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} #endif /*--- Library function declarations ---*/ /*--- Threads initialization code ---*/ #if defined(__PYX_FORCE_INIT_THREADS) && __PYX_FORCE_INIT_THREADS #ifdef WITH_THREAD /* Python build with threading support? */ PyEval_InitThreads(); #endif #endif /*--- Module creation code ---*/ #if PY_MAJOR_VERSION < 3 __pyx_m = Py_InitModule4("pygame_time", __pyx_methods, 0, 0, PYTHON_API_VERSION); Py_XINCREF(__pyx_m); #else __pyx_m = PyModule_Create(&__pyx_moduledef); #endif if (unlikely(!__pyx_m)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_d = PyModule_GetDict(__pyx_m); if (unlikely(!__pyx_d)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} Py_INCREF(__pyx_d); __pyx_b = PyImport_AddModule(__Pyx_BUILTIN_MODULE_NAME); if (unlikely(!__pyx_b)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} #if CYTHON_COMPILING_IN_PYPY Py_INCREF(__pyx_b); #endif if (PyObject_SetAttrString(__pyx_m, "__builtins__", __pyx_b) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; /*--- Initialize various global constants etc. ---*/ if (__Pyx_InitGlobals() < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} #if PY_MAJOR_VERSION < 3 && (__PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT) if (__Pyx_init_sys_getdefaultencoding_params() < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} #endif if (__pyx_module_is_main_pygame_sdl2__pygame_time) { if (PyObject_SetAttrString(__pyx_m, "__name__", __pyx_n_s_main) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } #if PY_MAJOR_VERSION >= 3 { PyObject *modules = PyImport_GetModuleDict(); if (unlikely(!modules)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} if (!PyDict_GetItemString(modules, "pygame_sdl2.pygame_time")) { if (unlikely(PyDict_SetItemString(modules, "pygame_sdl2.pygame_time", __pyx_m) < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } } #endif /*--- Builtin init code ---*/ if (__Pyx_InitCachedBuiltins() < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /*--- Constants init code ---*/ if (__Pyx_InitCachedConstants() < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /*--- Global init code ---*/ __pyx_v_11pygame_sdl2_11pygame_time_timer_by_event = ((PyObject*)Py_None); Py_INCREF(Py_None); /*--- Variable export code ---*/ /*--- Function export code ---*/ /*--- Type init code ---*/ /*--- Type import code ---*/ /*--- Variable import code ---*/ /*--- Function import code ---*/ /*--- Execution code ---*/ #if defined(__Pyx_Generator_USED) || defined(__Pyx_Coroutine_USED) if (__Pyx_patch_abc() < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} #endif /* "pygame_sdl2/pygame_time.pyx":20 * * import cython * import math # <<<<<<<<<<<<<< * from sdl2 cimport * * from pygame_sdl2.error import error */ __pyx_t_1 = __Pyx_Import(__pyx_n_s_math, 0, -1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 20; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); if (PyDict_SetItem(__pyx_d, __pyx_n_s_math, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 20; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "pygame_sdl2/pygame_time.pyx":22 * import math * from sdl2 cimport * * from pygame_sdl2.error import error # <<<<<<<<<<<<<< * import pygame_sdl2 * */ __pyx_t_1 = PyList_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 22; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __Pyx_INCREF(__pyx_n_s_error); __Pyx_GIVEREF(__pyx_n_s_error); PyList_SET_ITEM(__pyx_t_1, 0, __pyx_n_s_error); __pyx_t_2 = __Pyx_Import(__pyx_n_s_pygame_sdl2_error, __pyx_t_1, -1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 22; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_1 = __Pyx_ImportFrom(__pyx_t_2, __pyx_n_s_error); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 22; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); if (PyDict_SetItem(__pyx_d, __pyx_n_s_error, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 22; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "pygame_sdl2/pygame_time.pyx":23 * from sdl2 cimport * * from pygame_sdl2.error import error * import pygame_sdl2 # <<<<<<<<<<<<<< * * cdef int timer_id = 0 */ __pyx_t_2 = __Pyx_Import(__pyx_n_s_pygame_sdl2, 0, -1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 23; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_pygame_sdl2, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 23; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "pygame_sdl2/pygame_time.pyx":25 * import pygame_sdl2 * * cdef int timer_id = 0 # <<<<<<<<<<<<<< * * @pygame_sdl2.register_init */ __pyx_v_11pygame_sdl2_11pygame_time_timer_id = 0; /* "pygame_sdl2/pygame_time.pyx":27 * cdef int timer_id = 0 * * @pygame_sdl2.register_init # <<<<<<<<<<<<<< * def init(): * pygame_sdl2.display.sdl_main_init() */ __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_pygame_sdl2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 27; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_register_init); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 27; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "pygame_sdl2/pygame_time.pyx":28 * * @pygame_sdl2.register_init * def init(): # <<<<<<<<<<<<<< * pygame_sdl2.display.sdl_main_init() * */ __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_11pygame_sdl2_11pygame_time_1init, NULL, __pyx_n_s_pygame_sdl2_pygame_time); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 28; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_t_4 = NULL; if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_3))) { __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3); if (likely(__pyx_t_4)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); __Pyx_INCREF(__pyx_t_4); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_3, function); } } if (!__pyx_t_4) { __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 27; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_GOTREF(__pyx_t_2); } else { __pyx_t_5 = PyTuple_New(1+1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 27; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_4); __pyx_t_4 = NULL; __Pyx_GIVEREF(__pyx_t_1); PyTuple_SET_ITEM(__pyx_t_5, 0+1, __pyx_t_1); __pyx_t_1 = 0; __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_5, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 27; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; } __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; if (PyDict_SetItem(__pyx_d, __pyx_n_s_init, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 28; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "pygame_sdl2/pygame_time.pyx":34 * raise error() * * @pygame_sdl2.register_quit # <<<<<<<<<<<<<< * def quit(): # @ReservedAssignment * SDL_QuitSubSystem(SDL_INIT_TIMER) */ __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_pygame_sdl2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 34; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_register_quit); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 34; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "pygame_sdl2/pygame_time.pyx":35 * * @pygame_sdl2.register_quit * def quit(): # @ReservedAssignment # <<<<<<<<<<<<<< * SDL_QuitSubSystem(SDL_INIT_TIMER) * */ __pyx_t_3 = PyCFunction_NewEx(&__pyx_mdef_11pygame_sdl2_11pygame_time_3quit, NULL, __pyx_n_s_pygame_sdl2_pygame_time); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 35; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __pyx_t_1 = NULL; if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_5))) { __pyx_t_1 = PyMethod_GET_SELF(__pyx_t_5); if (likely(__pyx_t_1)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5); __Pyx_INCREF(__pyx_t_1); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_5, function); } } if (!__pyx_t_1) { __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_t_3); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 34; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_GOTREF(__pyx_t_2); } else { __pyx_t_4 = PyTuple_New(1+1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 34; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); __Pyx_GIVEREF(__pyx_t_1); PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_1); __pyx_t_1 = NULL; __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_4, 0+1, __pyx_t_3); __pyx_t_3 = 0; __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_4, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 34; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; } __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; if (PyDict_SetItem(__pyx_d, __pyx_n_s_quit, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 35; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "pygame_sdl2/pygame_time.pyx":38 * SDL_QuitSubSystem(SDL_INIT_TIMER) * * def get_ticks(): # <<<<<<<<<<<<<< * return SDL_GetTicks() * */ __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_11pygame_sdl2_11pygame_time_5get_ticks, NULL, __pyx_n_s_pygame_sdl2_pygame_time); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 38; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_get_ticks, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 38; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "pygame_sdl2/pygame_time.pyx":41 * return SDL_GetTicks() * * def wait(int milliseconds): # <<<<<<<<<<<<<< * cdef int start * */ __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_11pygame_sdl2_11pygame_time_7wait, NULL, __pyx_n_s_pygame_sdl2_pygame_time); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 41; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_wait, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 41; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "pygame_sdl2/pygame_time.pyx":49 * return SDL_GetTicks() - start * * def delay(milliseconds): # <<<<<<<<<<<<<< * # SDL_Delay() should be accurate enough. * return wait(milliseconds) */ __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_11pygame_sdl2_11pygame_time_9delay, NULL, __pyx_n_s_pygame_sdl2_pygame_time); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 49; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_delay, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 49; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "pygame_sdl2/pygame_time.pyx":63 * * # A map from eventid to SDL_Timer_ID. * cdef dict timer_by_event = { } # <<<<<<<<<<<<<< * * def set_timer(eventid, milliseconds): */ __pyx_t_2 = PyDict_New(); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 63; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __Pyx_XGOTREF(__pyx_v_11pygame_sdl2_11pygame_time_timer_by_event); __Pyx_DECREF_SET(__pyx_v_11pygame_sdl2_11pygame_time_timer_by_event, ((PyObject*)__pyx_t_2)); __Pyx_GIVEREF(__pyx_t_2); __pyx_t_2 = 0; /* "pygame_sdl2/pygame_time.pyx":65 * cdef dict timer_by_event = { } * * def set_timer(eventid, milliseconds): # <<<<<<<<<<<<<< * * cdef int timer_id = timer_by_event.get(eventid, 0) */ __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_11pygame_sdl2_11pygame_time_11set_timer, NULL, __pyx_n_s_pygame_sdl2_pygame_time); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 65; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_set_timer, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 65; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "pygame_sdl2/pygame_time.pyx":80 * timer_by_event[eventid] = timer_id * * class Clock: # <<<<<<<<<<<<<< * def __init__(self): * self.last = SDL_GetTicks() */ __pyx_t_2 = __Pyx_Py3MetaclassPrepare((PyObject *) NULL, __pyx_empty_tuple, __pyx_n_s_Clock, __pyx_n_s_Clock, (PyObject *) NULL, __pyx_n_s_pygame_sdl2_pygame_time, (PyObject *) NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 80; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); /* "pygame_sdl2/pygame_time.pyx":81 * * class Clock: * def __init__(self): # <<<<<<<<<<<<<< * self.last = SDL_GetTicks() * self.last_frames = [] */ __pyx_t_5 = __Pyx_CyFunction_NewEx(&__pyx_mdef_11pygame_sdl2_11pygame_time_5Clock_1__init__, 0, __pyx_n_s_Clock___init, NULL, __pyx_n_s_pygame_sdl2_pygame_time, __pyx_d, ((PyObject *)__pyx_codeobj__11)); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 81; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); if (PyObject_SetItem(__pyx_t_2, __pyx_n_s_init_2, __pyx_t_5) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 81; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; /* "pygame_sdl2/pygame_time.pyx":87 * self.raw_frametime = 0 * * def tick(self, framerate=0): # <<<<<<<<<<<<<< * cdef int now = SDL_GetTicks() * self.raw_frametime = now - self.last */ __pyx_t_5 = __Pyx_CyFunction_NewEx(&__pyx_mdef_11pygame_sdl2_11pygame_time_5Clock_3tick, 0, __pyx_n_s_Clock_tick, NULL, __pyx_n_s_pygame_sdl2_pygame_time, __pyx_d, ((PyObject *)__pyx_codeobj__13)); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 87; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_5, __pyx_tuple__14); if (PyObject_SetItem(__pyx_t_2, __pyx_n_s_tick, __pyx_t_5) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 87; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; /* "pygame_sdl2/pygame_time.pyx":105 * return self.frametime * * def tick_busy_loop(self, framerate=0): # <<<<<<<<<<<<<< * return self.tick(framerate) * */ __pyx_t_5 = __Pyx_CyFunction_NewEx(&__pyx_mdef_11pygame_sdl2_11pygame_time_5Clock_5tick_busy_loop, 0, __pyx_n_s_Clock_tick_busy_loop, NULL, __pyx_n_s_pygame_sdl2_pygame_time, __pyx_d, ((PyObject *)__pyx_codeobj__16)); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 105; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_5, __pyx_tuple__17); if (PyObject_SetItem(__pyx_t_2, __pyx_n_s_tick_busy_loop, __pyx_t_5) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 105; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; /* "pygame_sdl2/pygame_time.pyx":108 * return self.tick(framerate) * * def get_time(self): # <<<<<<<<<<<<<< * return self.frametime * */ __pyx_t_5 = __Pyx_CyFunction_NewEx(&__pyx_mdef_11pygame_sdl2_11pygame_time_5Clock_7get_time, 0, __pyx_n_s_Clock_get_time, NULL, __pyx_n_s_pygame_sdl2_pygame_time, __pyx_d, ((PyObject *)__pyx_codeobj__19)); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 108; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); if (PyObject_SetItem(__pyx_t_2, __pyx_n_s_get_time, __pyx_t_5) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 108; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; /* "pygame_sdl2/pygame_time.pyx":111 * return self.frametime * * def get_rawtime(self): # <<<<<<<<<<<<<< * return self.raw_frametime * */ __pyx_t_5 = __Pyx_CyFunction_NewEx(&__pyx_mdef_11pygame_sdl2_11pygame_time_5Clock_9get_rawtime, 0, __pyx_n_s_Clock_get_rawtime, NULL, __pyx_n_s_pygame_sdl2_pygame_time, __pyx_d, ((PyObject *)__pyx_codeobj__21)); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 111; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); if (PyObject_SetItem(__pyx_t_2, __pyx_n_s_get_rawtime, __pyx_t_5) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 111; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; /* "pygame_sdl2/pygame_time.pyx":115 * * @cython.cdivision(True) * def get_fps(self): # <<<<<<<<<<<<<< * cdef int total_time = sum(self.last_frames) * cdef float average_time = total_time / 1000.0 / len(self.last_frames) */ __pyx_t_5 = __Pyx_CyFunction_NewEx(&__pyx_mdef_11pygame_sdl2_11pygame_time_5Clock_11get_fps, 0, __pyx_n_s_Clock_get_fps, NULL, __pyx_n_s_pygame_sdl2_pygame_time, __pyx_d, ((PyObject *)__pyx_codeobj__23)); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 115; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); if (PyObject_SetItem(__pyx_t_2, __pyx_n_s_get_fps, __pyx_t_5) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 115; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; /* "pygame_sdl2/pygame_time.pyx":80 * timer_by_event[eventid] = timer_id * * class Clock: # <<<<<<<<<<<<<< * def __init__(self): * self.last = SDL_GetTicks() */ __pyx_t_5 = __Pyx_Py3ClassCreate(((PyObject*)&__Pyx_DefaultClassType), __pyx_n_s_Clock, __pyx_empty_tuple, __pyx_t_2, NULL, 0, 1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 80; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); if (PyDict_SetItem(__pyx_d, __pyx_n_s_Clock, __pyx_t_5) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 80; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "pygame_sdl2/pygame_time.pyx":1 * # Copyright 2014 Patrick Dawson # <<<<<<<<<<<<<< * # * # This software is provided 'as-is', without any express or implied */ __pyx_t_2 = PyDict_New(); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_test, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /*--- Wrapped vars code ---*/ goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_5); if (__pyx_m) { if (__pyx_d) { __Pyx_AddTraceback("init pygame_sdl2.pygame_time", __pyx_clineno, __pyx_lineno, __pyx_filename); } Py_DECREF(__pyx_m); __pyx_m = 0; } else if (!PyErr_Occurred()) { PyErr_SetString(PyExc_ImportError, "init pygame_sdl2.pygame_time"); } __pyx_L0:; __Pyx_RefNannyFinishContext(); #if PY_MAJOR_VERSION < 3 return; #else return __pyx_m; #endif } /* --- Runtime support code --- */ #if CYTHON_REFNANNY static __Pyx_RefNannyAPIStruct *__Pyx_RefNannyImportAPI(const char *modname) { PyObject *m = NULL, *p = NULL; void *r = NULL; m = PyImport_ImportModule((char *)modname); if (!m) goto end; p = PyObject_GetAttrString(m, (char *)"RefNannyAPI"); if (!p) goto end; r = PyLong_AsVoidPtr(p); end: Py_XDECREF(p); Py_XDECREF(m); return (__Pyx_RefNannyAPIStruct *)r; } #endif static PyObject *__Pyx_GetBuiltinName(PyObject *name) { PyObject* result = __Pyx_PyObject_GetAttrStr(__pyx_b, name); if (unlikely(!result)) { PyErr_Format(PyExc_NameError, #if PY_MAJOR_VERSION >= 3 "name '%U' is not defined", name); #else "name '%.200s' is not defined", PyString_AS_STRING(name)); #endif } return result; } static CYTHON_INLINE PyObject *__Pyx_GetModuleGlobalName(PyObject *name) { PyObject *result; #if CYTHON_COMPILING_IN_CPYTHON result = PyDict_GetItem(__pyx_d, name); if (likely(result)) { Py_INCREF(result); } else { #else result = PyObject_GetItem(__pyx_d, name); if (!result) { PyErr_Clear(); #endif result = __Pyx_GetBuiltinName(name); } return result; } #if CYTHON_COMPILING_IN_CPYTHON static CYTHON_INLINE PyObject* __Pyx_PyObject_Call(PyObject *func, PyObject *arg, PyObject *kw) { PyObject *result; ternaryfunc call = func->ob_type->tp_call; if (unlikely(!call)) return PyObject_Call(func, arg, kw); if (unlikely(Py_EnterRecursiveCall((char*)" while calling a Python object"))) return NULL; result = (*call)(func, arg, kw); Py_LeaveRecursiveCall(); if (unlikely(!result) && unlikely(!PyErr_Occurred())) { PyErr_SetString( PyExc_SystemError, "NULL result without error in PyObject_Call"); } return result; } #endif #if CYTHON_COMPILING_IN_CPYTHON static CYTHON_INLINE PyObject* __Pyx_PyObject_CallMethO(PyObject *func, PyObject *arg) { PyObject *self, *result; PyCFunction cfunc; cfunc = PyCFunction_GET_FUNCTION(func); self = PyCFunction_GET_SELF(func); if (unlikely(Py_EnterRecursiveCall((char*)" while calling a Python object"))) return NULL; result = cfunc(self, arg); Py_LeaveRecursiveCall(); if (unlikely(!result) && unlikely(!PyErr_Occurred())) { PyErr_SetString( PyExc_SystemError, "NULL result without error in PyObject_Call"); } return result; } #endif #if CYTHON_COMPILING_IN_CPYTHON static PyObject* __Pyx__PyObject_CallOneArg(PyObject *func, PyObject *arg) { PyObject *result; PyObject *args = PyTuple_New(1); if (unlikely(!args)) return NULL; Py_INCREF(arg); PyTuple_SET_ITEM(args, 0, arg); result = __Pyx_PyObject_Call(func, args, NULL); Py_DECREF(args); return result; } static CYTHON_INLINE PyObject* __Pyx_PyObject_CallOneArg(PyObject *func, PyObject *arg) { #ifdef __Pyx_CyFunction_USED if (likely(PyCFunction_Check(func) || PyObject_TypeCheck(func, __pyx_CyFunctionType))) { #else if (likely(PyCFunction_Check(func))) { #endif if (likely(PyCFunction_GET_FLAGS(func) & METH_O)) { return __Pyx_PyObject_CallMethO(func, arg); } } return __Pyx__PyObject_CallOneArg(func, arg); } #else static CYTHON_INLINE PyObject* __Pyx_PyObject_CallOneArg(PyObject *func, PyObject *arg) { PyObject *result; PyObject *args = PyTuple_Pack(1, arg); if (unlikely(!args)) return NULL; result = __Pyx_PyObject_Call(func, args, NULL); Py_DECREF(args); return result; } #endif #if CYTHON_COMPILING_IN_CPYTHON static CYTHON_INLINE PyObject* __Pyx_PyObject_CallNoArg(PyObject *func) { #ifdef __Pyx_CyFunction_USED if (likely(PyCFunction_Check(func) || PyObject_TypeCheck(func, __pyx_CyFunctionType))) { #else if (likely(PyCFunction_Check(func))) { #endif if (likely(PyCFunction_GET_FLAGS(func) & METH_NOARGS)) { return __Pyx_PyObject_CallMethO(func, NULL); } } return __Pyx_PyObject_Call(func, __pyx_empty_tuple, NULL); } #endif static CYTHON_INLINE void __Pyx_ErrRestore(PyObject *type, PyObject *value, PyObject *tb) { #if CYTHON_COMPILING_IN_CPYTHON PyObject *tmp_type, *tmp_value, *tmp_tb; PyThreadState *tstate = PyThreadState_GET(); tmp_type = tstate->curexc_type; tmp_value = tstate->curexc_value; tmp_tb = tstate->curexc_traceback; tstate->curexc_type = type; tstate->curexc_value = value; tstate->curexc_traceback = tb; Py_XDECREF(tmp_type); Py_XDECREF(tmp_value); Py_XDECREF(tmp_tb); #else PyErr_Restore(type, value, tb); #endif } static CYTHON_INLINE void __Pyx_ErrFetch(PyObject **type, PyObject **value, PyObject **tb) { #if CYTHON_COMPILING_IN_CPYTHON PyThreadState *tstate = PyThreadState_GET(); *type = tstate->curexc_type; *value = tstate->curexc_value; *tb = tstate->curexc_traceback; tstate->curexc_type = 0; tstate->curexc_value = 0; tstate->curexc_traceback = 0; #else PyErr_Fetch(type, value, tb); #endif } #if PY_MAJOR_VERSION < 3 static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, CYTHON_UNUSED PyObject *cause) { Py_XINCREF(type); if (!value || value == Py_None) value = NULL; else Py_INCREF(value); if (!tb || tb == Py_None) tb = NULL; else { Py_INCREF(tb); if (!PyTraceBack_Check(tb)) { PyErr_SetString(PyExc_TypeError, "raise: arg 3 must be a traceback or None"); goto raise_error; } } if (PyType_Check(type)) { #if CYTHON_COMPILING_IN_PYPY if (!value) { Py_INCREF(Py_None); value = Py_None; } #endif PyErr_NormalizeException(&type, &value, &tb); } else { if (value) { PyErr_SetString(PyExc_TypeError, "instance exception may not have a separate value"); goto raise_error; } value = type; type = (PyObject*) Py_TYPE(type); Py_INCREF(type); if (!PyType_IsSubtype((PyTypeObject *)type, (PyTypeObject *)PyExc_BaseException)) { PyErr_SetString(PyExc_TypeError, "raise: exception class must be a subclass of BaseException"); goto raise_error; } } __Pyx_ErrRestore(type, value, tb); return; raise_error: Py_XDECREF(value); Py_XDECREF(type); Py_XDECREF(tb); return; } #else static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, PyObject *cause) { PyObject* owned_instance = NULL; if (tb == Py_None) { tb = 0; } else if (tb && !PyTraceBack_Check(tb)) { PyErr_SetString(PyExc_TypeError, "raise: arg 3 must be a traceback or None"); goto bad; } if (value == Py_None) value = 0; if (PyExceptionInstance_Check(type)) { if (value) { PyErr_SetString(PyExc_TypeError, "instance exception may not have a separate value"); goto bad; } value = type; type = (PyObject*) Py_TYPE(value); } else if (PyExceptionClass_Check(type)) { PyObject *instance_class = NULL; if (value && PyExceptionInstance_Check(value)) { instance_class = (PyObject*) Py_TYPE(value); if (instance_class != type) { int is_subclass = PyObject_IsSubclass(instance_class, type); if (!is_subclass) { instance_class = NULL; } else if (unlikely(is_subclass == -1)) { goto bad; } else { type = instance_class; } } } if (!instance_class) { PyObject *args; if (!value) args = PyTuple_New(0); else if (PyTuple_Check(value)) { Py_INCREF(value); args = value; } else args = PyTuple_Pack(1, value); if (!args) goto bad; owned_instance = PyObject_Call(type, args, NULL); Py_DECREF(args); if (!owned_instance) goto bad; value = owned_instance; if (!PyExceptionInstance_Check(value)) { PyErr_Format(PyExc_TypeError, "calling %R should have returned an instance of " "BaseException, not %R", type, Py_TYPE(value)); goto bad; } } } else { PyErr_SetString(PyExc_TypeError, "raise: exception class must be a subclass of BaseException"); goto bad; } #if PY_VERSION_HEX >= 0x03030000 if (cause) { #else if (cause && cause != Py_None) { #endif PyObject *fixed_cause; if (cause == Py_None) { fixed_cause = NULL; } else if (PyExceptionClass_Check(cause)) { fixed_cause = PyObject_CallObject(cause, NULL); if (fixed_cause == NULL) goto bad; } else if (PyExceptionInstance_Check(cause)) { fixed_cause = cause; Py_INCREF(fixed_cause); } else { PyErr_SetString(PyExc_TypeError, "exception causes must derive from " "BaseException"); goto bad; } PyException_SetCause(value, fixed_cause); } PyErr_SetObject(type, value); if (tb) { #if CYTHON_COMPILING_IN_PYPY PyObject *tmp_type, *tmp_value, *tmp_tb; PyErr_Fetch(&tmp_type, &tmp_value, &tmp_tb); Py_INCREF(tb); PyErr_Restore(tmp_type, tmp_value, tb); Py_XDECREF(tmp_tb); #else PyThreadState *tstate = PyThreadState_GET(); PyObject* tmp_tb = tstate->curexc_traceback; if (tb != tmp_tb) { Py_INCREF(tb); tstate->curexc_traceback = tb; Py_XDECREF(tmp_tb); } #endif } bad: Py_XDECREF(owned_instance); return; } #endif static void __Pyx_RaiseArgtupleInvalid( const char* func_name, int exact, Py_ssize_t num_min, Py_ssize_t num_max, Py_ssize_t num_found) { Py_ssize_t num_expected; const char *more_or_less; if (num_found < num_min) { num_expected = num_min; more_or_less = "at least"; } else { num_expected = num_max; more_or_less = "at most"; } if (exact) { more_or_less = "exactly"; } PyErr_Format(PyExc_TypeError, "%.200s() takes %.8s %" CYTHON_FORMAT_SSIZE_T "d positional argument%.1s (%" CYTHON_FORMAT_SSIZE_T "d given)", func_name, more_or_less, num_expected, (num_expected == 1) ? "" : "s", num_found); } static void __Pyx_RaiseDoubleKeywordsError( const char* func_name, PyObject* kw_name) { PyErr_Format(PyExc_TypeError, #if PY_MAJOR_VERSION >= 3 "%s() got multiple values for keyword argument '%U'", func_name, kw_name); #else "%s() got multiple values for keyword argument '%s'", func_name, PyString_AsString(kw_name)); #endif } static int __Pyx_ParseOptionalKeywords( PyObject *kwds, PyObject **argnames[], PyObject *kwds2, PyObject *values[], Py_ssize_t num_pos_args, const char* function_name) { PyObject *key = 0, *value = 0; Py_ssize_t pos = 0; PyObject*** name; PyObject*** first_kw_arg = argnames + num_pos_args; while (PyDict_Next(kwds, &pos, &key, &value)) { name = first_kw_arg; while (*name && (**name != key)) name++; if (*name) { values[name-argnames] = value; continue; } name = first_kw_arg; #if PY_MAJOR_VERSION < 3 if (likely(PyString_CheckExact(key)) || likely(PyString_Check(key))) { while (*name) { if ((CYTHON_COMPILING_IN_PYPY || PyString_GET_SIZE(**name) == PyString_GET_SIZE(key)) && _PyString_Eq(**name, key)) { values[name-argnames] = value; break; } name++; } if (*name) continue; else { PyObject*** argname = argnames; while (argname != first_kw_arg) { if ((**argname == key) || ( (CYTHON_COMPILING_IN_PYPY || PyString_GET_SIZE(**argname) == PyString_GET_SIZE(key)) && _PyString_Eq(**argname, key))) { goto arg_passed_twice; } argname++; } } } else #endif if (likely(PyUnicode_Check(key))) { while (*name) { int cmp = (**name == key) ? 0 : #if !CYTHON_COMPILING_IN_PYPY && PY_MAJOR_VERSION >= 3 (PyUnicode_GET_SIZE(**name) != PyUnicode_GET_SIZE(key)) ? 1 : #endif PyUnicode_Compare(**name, key); if (cmp < 0 && unlikely(PyErr_Occurred())) goto bad; if (cmp == 0) { values[name-argnames] = value; break; } name++; } if (*name) continue; else { PyObject*** argname = argnames; while (argname != first_kw_arg) { int cmp = (**argname == key) ? 0 : #if !CYTHON_COMPILING_IN_PYPY && PY_MAJOR_VERSION >= 3 (PyUnicode_GET_SIZE(**argname) != PyUnicode_GET_SIZE(key)) ? 1 : #endif PyUnicode_Compare(**argname, key); if (cmp < 0 && unlikely(PyErr_Occurred())) goto bad; if (cmp == 0) goto arg_passed_twice; argname++; } } } else goto invalid_keyword_type; if (kwds2) { if (unlikely(PyDict_SetItem(kwds2, key, value))) goto bad; } else { goto invalid_keyword; } } return 0; arg_passed_twice: __Pyx_RaiseDoubleKeywordsError(function_name, key); goto bad; invalid_keyword_type: PyErr_Format(PyExc_TypeError, "%.200s() keywords must be strings", function_name); goto bad; invalid_keyword: PyErr_Format(PyExc_TypeError, #if PY_MAJOR_VERSION < 3 "%.200s() got an unexpected keyword argument '%.200s'", function_name, PyString_AsString(key)); #else "%s() got an unexpected keyword argument '%U'", function_name, key); #endif bad: return -1; } static PyObject* __Pyx_PyDict_GetItemDefault(PyObject* d, PyObject* key, PyObject* default_value) { PyObject* value; #if PY_MAJOR_VERSION >= 3 && !CYTHON_COMPILING_IN_PYPY value = PyDict_GetItemWithError(d, key); if (unlikely(!value)) { if (unlikely(PyErr_Occurred())) return NULL; value = default_value; } Py_INCREF(value); #else if (PyString_CheckExact(key) || PyUnicode_CheckExact(key) || PyInt_CheckExact(key)) { value = PyDict_GetItem(d, key); if (unlikely(!value)) { value = default_value; } Py_INCREF(value); } else { if (default_value == Py_None) default_value = NULL; value = PyObject_CallMethodObjArgs( d, __pyx_n_s_get, key, default_value, NULL); } #endif return value; } static PyObject* __Pyx_PyObject_CallMethod1(PyObject* obj, PyObject* method_name, PyObject* arg) { PyObject *method, *result = NULL; method = __Pyx_PyObject_GetAttrStr(obj, method_name); if (unlikely(!method)) goto bad; #if CYTHON_COMPILING_IN_CPYTHON if (likely(PyMethod_Check(method))) { PyObject *self = PyMethod_GET_SELF(method); if (likely(self)) { PyObject *args; PyObject *function = PyMethod_GET_FUNCTION(method); args = PyTuple_New(2); if (unlikely(!args)) goto bad; Py_INCREF(self); PyTuple_SET_ITEM(args, 0, self); Py_INCREF(arg); PyTuple_SET_ITEM(args, 1, arg); Py_INCREF(function); Py_DECREF(method); method = NULL; result = __Pyx_PyObject_Call(function, args, NULL); Py_DECREF(args); Py_DECREF(function); return result; } } #endif result = __Pyx_PyObject_CallOneArg(method, arg); bad: Py_XDECREF(method); return result; } static PyObject* __Pyx__PyObject_PopNewIndex(PyObject* L, PyObject* py_ix) { PyObject *r; if (unlikely(!py_ix)) return NULL; r = __Pyx__PyObject_PopIndex(L, py_ix); Py_DECREF(py_ix); return r; } static PyObject* __Pyx__PyObject_PopIndex(PyObject* L, PyObject* py_ix) { return __Pyx_PyObject_CallMethod1(L, __pyx_n_s_pop, py_ix); } #if CYTHON_COMPILING_IN_CPYTHON static PyObject* __Pyx__PyList_PopIndex(PyObject* L, PyObject* py_ix, Py_ssize_t ix) { Py_ssize_t size = PyList_GET_SIZE(L); if (likely(size > (((PyListObject*)L)->allocated >> 1))) { Py_ssize_t cix = ix; if (cix < 0) { cix += size; } if (likely(0 <= cix && cix < size)) { PyObject* v = PyList_GET_ITEM(L, cix); Py_SIZE(L) -= 1; size -= 1; memmove(&PyList_GET_ITEM(L, cix), &PyList_GET_ITEM(L, cix+1), (size_t)(size-cix)*sizeof(PyObject*)); return v; } } if (py_ix == Py_None) { return __Pyx__PyObject_PopNewIndex(L, PyInt_FromSsize_t(ix)); } else { return __Pyx__PyObject_PopIndex(L, py_ix); } } #endif #if CYTHON_USE_PYLONG_INTERNALS #include "longintrepr.h" #endif #if CYTHON_COMPILING_IN_CPYTHON static PyObject* __Pyx_PyInt_EqObjC(PyObject *op1, PyObject *op2, CYTHON_UNUSED long intval, CYTHON_UNUSED int inplace) { if (op1 == op2) { Py_RETURN_TRUE; } #if PY_MAJOR_VERSION < 3 if (likely(PyInt_CheckExact(op1))) { const long b = intval; long a = PyInt_AS_LONG(op1); if (a == b) { Py_RETURN_TRUE; } else { Py_RETURN_FALSE; } } #endif #if CYTHON_USE_PYLONG_INTERNALS && PY_MAJOR_VERSION >= 3 if (likely(PyLong_CheckExact(op1))) { const long b = intval; long a; const digit* digits = ((PyLongObject*)op1)->ob_digit; const Py_ssize_t size = Py_SIZE(op1); if (likely(__Pyx_sst_abs(size) <= 1)) { a = likely(size) ? digits[0] : 0; if (size == -1) a = -a; } else { switch (size) { case -2: if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) { a = -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])); break; } case 2: if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) { a = (long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])); break; } case -3: if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) { a = -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])); break; } case 3: if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) { a = (long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])); break; } case -4: if (8 * sizeof(long) - 1 > 4 * PyLong_SHIFT) { a = -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])); break; } case 4: if (8 * sizeof(long) - 1 > 4 * PyLong_SHIFT) { a = (long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])); break; } #if PyLong_SHIFT < 30 && PyLong_SHIFT != 15 default: return PyLong_Type.tp_richcompare(op1, op2, Py_EQ); #else default: Py_RETURN_FALSE; #endif } } if (a == b) { Py_RETURN_TRUE; } else { Py_RETURN_FALSE; } } #endif if (PyFloat_CheckExact(op1)) { const long b = intval; double a = PyFloat_AS_DOUBLE(op1); if ((double)a == (double)b) { Py_RETURN_TRUE; } else { Py_RETURN_FALSE; } } return PyObject_RichCompare(op1, op2, Py_EQ); } #endif static CYTHON_INLINE int __Pyx_PyObject_Append(PyObject* L, PyObject* x) { if (likely(PyList_CheckExact(L))) { if (unlikely(__Pyx_PyList_Append(L, x) < 0)) return -1; } else { PyObject* retval = __Pyx_PyObject_CallMethod1(L, __pyx_n_s_append, x); if (unlikely(!retval)) return -1; Py_DECREF(retval); } return 0; } #if CYTHON_COMPILING_IN_CPYTHON static PyObject* __Pyx_PyFloat_DivideCObj(PyObject *op1, PyObject *op2, double floatval, CYTHON_UNUSED int inplace) { const double a = floatval; double b, result; if (likely(PyFloat_CheckExact(op2))) { b = PyFloat_AS_DOUBLE(op2); } else #if PY_MAJOR_VERSION < 3 if (likely(PyInt_CheckExact(op2))) { b = (double) PyInt_AS_LONG(op2); } else #endif if (likely(PyLong_CheckExact(op2))) { #if CYTHON_USE_PYLONG_INTERNALS && PY_MAJOR_VERSION >= 3 const digit* digits = ((PyLongObject*)op2)->ob_digit; const Py_ssize_t size = Py_SIZE(op2); switch (size) { case 0: b = 0.0; break; case -1: b = -(double) digits[0]; break; case 1: b = (double) digits[0]; break; case -2: case 2: if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT && ((8 * sizeof(unsigned long) < 53) || (1 * PyLong_SHIFT < 53))) { b = (double) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])); if ((8 * sizeof(unsigned long) < 53) || (2 * PyLong_SHIFT < 53) || (b < (double) (1L<<53))) { if (size == -2) b = -b; break; } } case -3: case 3: if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT && ((8 * sizeof(unsigned long) < 53) || (2 * PyLong_SHIFT < 53))) { b = (double) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])); if ((8 * sizeof(unsigned long) < 53) || (3 * PyLong_SHIFT < 53) || (b < (double) (1L<<53))) { if (size == -3) b = -b; break; } } case -4: case 4: if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT && ((8 * sizeof(unsigned long) < 53) || (3 * PyLong_SHIFT < 53))) { b = (double) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])); if ((8 * sizeof(unsigned long) < 53) || (4 * PyLong_SHIFT < 53) || (b < (double) (1L<<53))) { if (size == -4) b = -b; break; } } default: #else { #endif b = PyLong_AsDouble(op2); if (unlikely(b == -1.0 && PyErr_Occurred())) return NULL; } } else { return (inplace ? __Pyx_PyNumber_InPlaceDivide(op1, op2) : __Pyx_PyNumber_Divide(op1, op2)); } PyFPE_START_PROTECT("divide", return NULL) result = a / b; PyFPE_END_PROTECT(result) return PyFloat_FromDouble(result); } #endif static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list, int level) { PyObject *empty_list = 0; PyObject *module = 0; PyObject *global_dict = 0; PyObject *empty_dict = 0; PyObject *list; #if PY_VERSION_HEX < 0x03030000 PyObject *py_import; py_import = __Pyx_PyObject_GetAttrStr(__pyx_b, __pyx_n_s_import); if (!py_import) goto bad; #endif if (from_list) list = from_list; else { empty_list = PyList_New(0); if (!empty_list) goto bad; list = empty_list; } global_dict = PyModule_GetDict(__pyx_m); if (!global_dict) goto bad; empty_dict = PyDict_New(); if (!empty_dict) goto bad; { #if PY_MAJOR_VERSION >= 3 if (level == -1) { if (strchr(__Pyx_MODULE_NAME, '.')) { #if PY_VERSION_HEX < 0x03030000 PyObject *py_level = PyInt_FromLong(1); if (!py_level) goto bad; module = PyObject_CallFunctionObjArgs(py_import, name, global_dict, empty_dict, list, py_level, NULL); Py_DECREF(py_level); #else module = PyImport_ImportModuleLevelObject( name, global_dict, empty_dict, list, 1); #endif if (!module) { if (!PyErr_ExceptionMatches(PyExc_ImportError)) goto bad; PyErr_Clear(); } } level = 0; } #endif if (!module) { #if PY_VERSION_HEX < 0x03030000 PyObject *py_level = PyInt_FromLong(level); if (!py_level) goto bad; module = PyObject_CallFunctionObjArgs(py_import, name, global_dict, empty_dict, list, py_level, NULL); Py_DECREF(py_level); #else module = PyImport_ImportModuleLevelObject( name, global_dict, empty_dict, list, level); #endif } } bad: #if PY_VERSION_HEX < 0x03030000 Py_XDECREF(py_import); #endif Py_XDECREF(empty_list); Py_XDECREF(empty_dict); return module; } static PyObject* __Pyx_ImportFrom(PyObject* module, PyObject* name) { PyObject* value = __Pyx_PyObject_GetAttrStr(module, name); if (unlikely(!value) && PyErr_ExceptionMatches(PyExc_AttributeError)) { PyErr_Format(PyExc_ImportError, #if PY_MAJOR_VERSION < 3 "cannot import name %.230s", PyString_AS_STRING(name)); #else "cannot import name %S", name); #endif } return value; } static PyTypeObject* __Pyx_FetchCommonType(PyTypeObject* type) { PyObject* fake_module; PyTypeObject* cached_type = NULL; fake_module = PyImport_AddModule((char*) "_cython_" CYTHON_ABI); if (!fake_module) return NULL; Py_INCREF(fake_module); cached_type = (PyTypeObject*) PyObject_GetAttrString(fake_module, type->tp_name); if (cached_type) { if (!PyType_Check((PyObject*)cached_type)) { PyErr_Format(PyExc_TypeError, "Shared Cython type %.200s is not a type object", type->tp_name); goto bad; } if (cached_type->tp_basicsize != type->tp_basicsize) { PyErr_Format(PyExc_TypeError, "Shared Cython type %.200s has the wrong size, try recompiling", type->tp_name); goto bad; } } else { if (!PyErr_ExceptionMatches(PyExc_AttributeError)) goto bad; PyErr_Clear(); if (PyType_Ready(type) < 0) goto bad; if (PyObject_SetAttrString(fake_module, type->tp_name, (PyObject*) type) < 0) goto bad; Py_INCREF(type); cached_type = type; } done: Py_DECREF(fake_module); return cached_type; bad: Py_XDECREF(cached_type); cached_type = NULL; goto done; } static PyObject * __Pyx_CyFunction_get_doc(__pyx_CyFunctionObject *op, CYTHON_UNUSED void *closure) { if (unlikely(op->func_doc == NULL)) { if (op->func.m_ml->ml_doc) { #if PY_MAJOR_VERSION >= 3 op->func_doc = PyUnicode_FromString(op->func.m_ml->ml_doc); #else op->func_doc = PyString_FromString(op->func.m_ml->ml_doc); #endif if (unlikely(op->func_doc == NULL)) return NULL; } else { Py_INCREF(Py_None); return Py_None; } } Py_INCREF(op->func_doc); return op->func_doc; } static int __Pyx_CyFunction_set_doc(__pyx_CyFunctionObject *op, PyObject *value) { PyObject *tmp = op->func_doc; if (value == NULL) { value = Py_None; } Py_INCREF(value); op->func_doc = value; Py_XDECREF(tmp); return 0; } static PyObject * __Pyx_CyFunction_get_name(__pyx_CyFunctionObject *op) { if (unlikely(op->func_name == NULL)) { #if PY_MAJOR_VERSION >= 3 op->func_name = PyUnicode_InternFromString(op->func.m_ml->ml_name); #else op->func_name = PyString_InternFromString(op->func.m_ml->ml_name); #endif if (unlikely(op->func_name == NULL)) return NULL; } Py_INCREF(op->func_name); return op->func_name; } static int __Pyx_CyFunction_set_name(__pyx_CyFunctionObject *op, PyObject *value) { PyObject *tmp; #if PY_MAJOR_VERSION >= 3 if (unlikely(value == NULL || !PyUnicode_Check(value))) { #else if (unlikely(value == NULL || !PyString_Check(value))) { #endif PyErr_SetString(PyExc_TypeError, "__name__ must be set to a string object"); return -1; } tmp = op->func_name; Py_INCREF(value); op->func_name = value; Py_XDECREF(tmp); return 0; } static PyObject * __Pyx_CyFunction_get_qualname(__pyx_CyFunctionObject *op) { Py_INCREF(op->func_qualname); return op->func_qualname; } static int __Pyx_CyFunction_set_qualname(__pyx_CyFunctionObject *op, PyObject *value) { PyObject *tmp; #if PY_MAJOR_VERSION >= 3 if (unlikely(value == NULL || !PyUnicode_Check(value))) { #else if (unlikely(value == NULL || !PyString_Check(value))) { #endif PyErr_SetString(PyExc_TypeError, "__qualname__ must be set to a string object"); return -1; } tmp = op->func_qualname; Py_INCREF(value); op->func_qualname = value; Py_XDECREF(tmp); return 0; } static PyObject * __Pyx_CyFunction_get_self(__pyx_CyFunctionObject *m, CYTHON_UNUSED void *closure) { PyObject *self; self = m->func_closure; if (self == NULL) self = Py_None; Py_INCREF(self); return self; } static PyObject * __Pyx_CyFunction_get_dict(__pyx_CyFunctionObject *op) { if (unlikely(op->func_dict == NULL)) { op->func_dict = PyDict_New(); if (unlikely(op->func_dict == NULL)) return NULL; } Py_INCREF(op->func_dict); return op->func_dict; } static int __Pyx_CyFunction_set_dict(__pyx_CyFunctionObject *op, PyObject *value) { PyObject *tmp; if (unlikely(value == NULL)) { PyErr_SetString(PyExc_TypeError, "function's dictionary may not be deleted"); return -1; } if (unlikely(!PyDict_Check(value))) { PyErr_SetString(PyExc_TypeError, "setting function's dictionary to a non-dict"); return -1; } tmp = op->func_dict; Py_INCREF(value); op->func_dict = value; Py_XDECREF(tmp); return 0; } static PyObject * __Pyx_CyFunction_get_globals(__pyx_CyFunctionObject *op) { Py_INCREF(op->func_globals); return op->func_globals; } static PyObject * __Pyx_CyFunction_get_closure(CYTHON_UNUSED __pyx_CyFunctionObject *op) { Py_INCREF(Py_None); return Py_None; } static PyObject * __Pyx_CyFunction_get_code(__pyx_CyFunctionObject *op) { PyObject* result = (op->func_code) ? op->func_code : Py_None; Py_INCREF(result); return result; } static int __Pyx_CyFunction_init_defaults(__pyx_CyFunctionObject *op) { int result = 0; PyObject *res = op->defaults_getter((PyObject *) op); if (unlikely(!res)) return -1; #if CYTHON_COMPILING_IN_CPYTHON op->defaults_tuple = PyTuple_GET_ITEM(res, 0); Py_INCREF(op->defaults_tuple); op->defaults_kwdict = PyTuple_GET_ITEM(res, 1); Py_INCREF(op->defaults_kwdict); #else op->defaults_tuple = PySequence_ITEM(res, 0); if (unlikely(!op->defaults_tuple)) result = -1; else { op->defaults_kwdict = PySequence_ITEM(res, 1); if (unlikely(!op->defaults_kwdict)) result = -1; } #endif Py_DECREF(res); return result; } static int __Pyx_CyFunction_set_defaults(__pyx_CyFunctionObject *op, PyObject* value) { PyObject* tmp; if (!value) { value = Py_None; } else if (value != Py_None && !PyTuple_Check(value)) { PyErr_SetString(PyExc_TypeError, "__defaults__ must be set to a tuple object"); return -1; } Py_INCREF(value); tmp = op->defaults_tuple; op->defaults_tuple = value; Py_XDECREF(tmp); return 0; } static PyObject * __Pyx_CyFunction_get_defaults(__pyx_CyFunctionObject *op) { PyObject* result = op->defaults_tuple; if (unlikely(!result)) { if (op->defaults_getter) { if (__Pyx_CyFunction_init_defaults(op) < 0) return NULL; result = op->defaults_tuple; } else { result = Py_None; } } Py_INCREF(result); return result; } static int __Pyx_CyFunction_set_kwdefaults(__pyx_CyFunctionObject *op, PyObject* value) { PyObject* tmp; if (!value) { value = Py_None; } else if (value != Py_None && !PyDict_Check(value)) { PyErr_SetString(PyExc_TypeError, "__kwdefaults__ must be set to a dict object"); return -1; } Py_INCREF(value); tmp = op->defaults_kwdict; op->defaults_kwdict = value; Py_XDECREF(tmp); return 0; } static PyObject * __Pyx_CyFunction_get_kwdefaults(__pyx_CyFunctionObject *op) { PyObject* result = op->defaults_kwdict; if (unlikely(!result)) { if (op->defaults_getter) { if (__Pyx_CyFunction_init_defaults(op) < 0) return NULL; result = op->defaults_kwdict; } else { result = Py_None; } } Py_INCREF(result); return result; } static int __Pyx_CyFunction_set_annotations(__pyx_CyFunctionObject *op, PyObject* value) { PyObject* tmp; if (!value || value == Py_None) { value = NULL; } else if (!PyDict_Check(value)) { PyErr_SetString(PyExc_TypeError, "__annotations__ must be set to a dict object"); return -1; } Py_XINCREF(value); tmp = op->func_annotations; op->func_annotations = value; Py_XDECREF(tmp); return 0; } static PyObject * __Pyx_CyFunction_get_annotations(__pyx_CyFunctionObject *op) { PyObject* result = op->func_annotations; if (unlikely(!result)) { result = PyDict_New(); if (unlikely(!result)) return NULL; op->func_annotations = result; } Py_INCREF(result); return result; } static PyGetSetDef __pyx_CyFunction_getsets[] = { {(char *) "func_doc", (getter)__Pyx_CyFunction_get_doc, (setter)__Pyx_CyFunction_set_doc, 0, 0}, {(char *) "__doc__", (getter)__Pyx_CyFunction_get_doc, (setter)__Pyx_CyFunction_set_doc, 0, 0}, {(char *) "func_name", (getter)__Pyx_CyFunction_get_name, (setter)__Pyx_CyFunction_set_name, 0, 0}, {(char *) "__name__", (getter)__Pyx_CyFunction_get_name, (setter)__Pyx_CyFunction_set_name, 0, 0}, {(char *) "__qualname__", (getter)__Pyx_CyFunction_get_qualname, (setter)__Pyx_CyFunction_set_qualname, 0, 0}, {(char *) "__self__", (getter)__Pyx_CyFunction_get_self, 0, 0, 0}, {(char *) "func_dict", (getter)__Pyx_CyFunction_get_dict, (setter)__Pyx_CyFunction_set_dict, 0, 0}, {(char *) "__dict__", (getter)__Pyx_CyFunction_get_dict, (setter)__Pyx_CyFunction_set_dict, 0, 0}, {(char *) "func_globals", (getter)__Pyx_CyFunction_get_globals, 0, 0, 0}, {(char *) "__globals__", (getter)__Pyx_CyFunction_get_globals, 0, 0, 0}, {(char *) "func_closure", (getter)__Pyx_CyFunction_get_closure, 0, 0, 0}, {(char *) "__closure__", (getter)__Pyx_CyFunction_get_closure, 0, 0, 0}, {(char *) "func_code", (getter)__Pyx_CyFunction_get_code, 0, 0, 0}, {(char *) "__code__", (getter)__Pyx_CyFunction_get_code, 0, 0, 0}, {(char *) "func_defaults", (getter)__Pyx_CyFunction_get_defaults, (setter)__Pyx_CyFunction_set_defaults, 0, 0}, {(char *) "__defaults__", (getter)__Pyx_CyFunction_get_defaults, (setter)__Pyx_CyFunction_set_defaults, 0, 0}, {(char *) "__kwdefaults__", (getter)__Pyx_CyFunction_get_kwdefaults, (setter)__Pyx_CyFunction_set_kwdefaults, 0, 0}, {(char *) "__annotations__", (getter)__Pyx_CyFunction_get_annotations, (setter)__Pyx_CyFunction_set_annotations, 0, 0}, {0, 0, 0, 0, 0} }; static PyMemberDef __pyx_CyFunction_members[] = { {(char *) "__module__", T_OBJECT, offsetof(__pyx_CyFunctionObject, func.m_module), PY_WRITE_RESTRICTED, 0}, {0, 0, 0, 0, 0} }; static PyObject * __Pyx_CyFunction_reduce(__pyx_CyFunctionObject *m, CYTHON_UNUSED PyObject *args) { #if PY_MAJOR_VERSION >= 3 return PyUnicode_FromString(m->func.m_ml->ml_name); #else return PyString_FromString(m->func.m_ml->ml_name); #endif } static PyMethodDef __pyx_CyFunction_methods[] = { {"__reduce__", (PyCFunction)__Pyx_CyFunction_reduce, METH_VARARGS, 0}, {0, 0, 0, 0} }; #if PY_VERSION_HEX < 0x030500A0 #define __Pyx_CyFunction_weakreflist(cyfunc) ((cyfunc)->func_weakreflist) #else #define __Pyx_CyFunction_weakreflist(cyfunc) ((cyfunc)->func.m_weakreflist) #endif static PyObject *__Pyx_CyFunction_New(PyTypeObject *type, PyMethodDef *ml, int flags, PyObject* qualname, PyObject *closure, PyObject *module, PyObject* globals, PyObject* code) { __pyx_CyFunctionObject *op = PyObject_GC_New(__pyx_CyFunctionObject, type); if (op == NULL) return NULL; op->flags = flags; __Pyx_CyFunction_weakreflist(op) = NULL; op->func.m_ml = ml; op->func.m_self = (PyObject *) op; Py_XINCREF(closure); op->func_closure = closure; Py_XINCREF(module); op->func.m_module = module; op->func_dict = NULL; op->func_name = NULL; Py_INCREF(qualname); op->func_qualname = qualname; op->func_doc = NULL; op->func_classobj = NULL; op->func_globals = globals; Py_INCREF(op->func_globals); Py_XINCREF(code); op->func_code = code; op->defaults_pyobjects = 0; op->defaults = NULL; op->defaults_tuple = NULL; op->defaults_kwdict = NULL; op->defaults_getter = NULL; op->func_annotations = NULL; PyObject_GC_Track(op); return (PyObject *) op; } static int __Pyx_CyFunction_clear(__pyx_CyFunctionObject *m) { Py_CLEAR(m->func_closure); Py_CLEAR(m->func.m_module); Py_CLEAR(m->func_dict); Py_CLEAR(m->func_name); Py_CLEAR(m->func_qualname); Py_CLEAR(m->func_doc); Py_CLEAR(m->func_globals); Py_CLEAR(m->func_code); Py_CLEAR(m->func_classobj); Py_CLEAR(m->defaults_tuple); Py_CLEAR(m->defaults_kwdict); Py_CLEAR(m->func_annotations); if (m->defaults) { PyObject **pydefaults = __Pyx_CyFunction_Defaults(PyObject *, m); int i; for (i = 0; i < m->defaults_pyobjects; i++) Py_XDECREF(pydefaults[i]); PyMem_Free(m->defaults); m->defaults = NULL; } return 0; } static void __Pyx_CyFunction_dealloc(__pyx_CyFunctionObject *m) { PyObject_GC_UnTrack(m); if (__Pyx_CyFunction_weakreflist(m) != NULL) PyObject_ClearWeakRefs((PyObject *) m); __Pyx_CyFunction_clear(m); PyObject_GC_Del(m); } static int __Pyx_CyFunction_traverse(__pyx_CyFunctionObject *m, visitproc visit, void *arg) { Py_VISIT(m->func_closure); Py_VISIT(m->func.m_module); Py_VISIT(m->func_dict); Py_VISIT(m->func_name); Py_VISIT(m->func_qualname); Py_VISIT(m->func_doc); Py_VISIT(m->func_globals); Py_VISIT(m->func_code); Py_VISIT(m->func_classobj); Py_VISIT(m->defaults_tuple); Py_VISIT(m->defaults_kwdict); if (m->defaults) { PyObject **pydefaults = __Pyx_CyFunction_Defaults(PyObject *, m); int i; for (i = 0; i < m->defaults_pyobjects; i++) Py_VISIT(pydefaults[i]); } return 0; } static PyObject *__Pyx_CyFunction_descr_get(PyObject *func, PyObject *obj, PyObject *type) { __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func; if (m->flags & __Pyx_CYFUNCTION_STATICMETHOD) { Py_INCREF(func); return func; } if (m->flags & __Pyx_CYFUNCTION_CLASSMETHOD) { if (type == NULL) type = (PyObject *)(Py_TYPE(obj)); return __Pyx_PyMethod_New(func, type, (PyObject *)(Py_TYPE(type))); } if (obj == Py_None) obj = NULL; return __Pyx_PyMethod_New(func, obj, type); } static PyObject* __Pyx_CyFunction_repr(__pyx_CyFunctionObject *op) { #if PY_MAJOR_VERSION >= 3 return PyUnicode_FromFormat("", op->func_qualname, (void *)op); #else return PyString_FromFormat("", PyString_AsString(op->func_qualname), (void *)op); #endif } #if CYTHON_COMPILING_IN_PYPY static PyObject * __Pyx_CyFunction_Call(PyObject *func, PyObject *arg, PyObject *kw) { PyCFunctionObject* f = (PyCFunctionObject*)func; PyCFunction meth = f->m_ml->ml_meth; PyObject *self = f->m_self; Py_ssize_t size; switch (f->m_ml->ml_flags & (METH_VARARGS | METH_KEYWORDS | METH_NOARGS | METH_O)) { case METH_VARARGS: if (likely(kw == NULL || PyDict_Size(kw) == 0)) return (*meth)(self, arg); break; case METH_VARARGS | METH_KEYWORDS: return (*(PyCFunctionWithKeywords)meth)(self, arg, kw); case METH_NOARGS: if (likely(kw == NULL || PyDict_Size(kw) == 0)) { size = PyTuple_GET_SIZE(arg); if (likely(size == 0)) return (*meth)(self, NULL); PyErr_Format(PyExc_TypeError, "%.200s() takes no arguments (%" CYTHON_FORMAT_SSIZE_T "d given)", f->m_ml->ml_name, size); return NULL; } break; case METH_O: if (likely(kw == NULL || PyDict_Size(kw) == 0)) { size = PyTuple_GET_SIZE(arg); if (likely(size == 1)) { PyObject *result, *arg0 = PySequence_ITEM(arg, 0); if (unlikely(!arg0)) return NULL; result = (*meth)(self, arg0); Py_DECREF(arg0); return result; } PyErr_Format(PyExc_TypeError, "%.200s() takes exactly one argument (%" CYTHON_FORMAT_SSIZE_T "d given)", f->m_ml->ml_name, size); return NULL; } break; default: PyErr_SetString(PyExc_SystemError, "Bad call flags in " "__Pyx_CyFunction_Call. METH_OLDARGS is no " "longer supported!"); return NULL; } PyErr_Format(PyExc_TypeError, "%.200s() takes no keyword arguments", f->m_ml->ml_name); return NULL; } #else static PyObject * __Pyx_CyFunction_Call(PyObject *func, PyObject *arg, PyObject *kw) { return PyCFunction_Call(func, arg, kw); } #endif static PyTypeObject __pyx_CyFunctionType_type = { PyVarObject_HEAD_INIT(0, 0) "cython_function_or_method", sizeof(__pyx_CyFunctionObject), 0, (destructor) __Pyx_CyFunction_dealloc, 0, 0, 0, #if PY_MAJOR_VERSION < 3 0, #else 0, #endif (reprfunc) __Pyx_CyFunction_repr, 0, 0, 0, 0, __Pyx_CyFunction_Call, 0, 0, 0, 0, Py_TPFLAGS_DEFAULT | Py_TPFLAGS_HAVE_GC, 0, (traverseproc) __Pyx_CyFunction_traverse, (inquiry) __Pyx_CyFunction_clear, 0, #if PY_VERSION_HEX < 0x030500A0 offsetof(__pyx_CyFunctionObject, func_weakreflist), #else offsetof(PyCFunctionObject, m_weakreflist), #endif 0, 0, __pyx_CyFunction_methods, __pyx_CyFunction_members, __pyx_CyFunction_getsets, 0, 0, __Pyx_CyFunction_descr_get, 0, offsetof(__pyx_CyFunctionObject, func_dict), 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, #if PY_VERSION_HEX >= 0x030400a1 0, #endif }; static int __pyx_CyFunction_init(void) { #if !CYTHON_COMPILING_IN_PYPY __pyx_CyFunctionType_type.tp_call = PyCFunction_Call; #endif __pyx_CyFunctionType = __Pyx_FetchCommonType(&__pyx_CyFunctionType_type); if (__pyx_CyFunctionType == NULL) { return -1; } return 0; } static CYTHON_INLINE void *__Pyx_CyFunction_InitDefaults(PyObject *func, size_t size, int pyobjects) { __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func; m->defaults = PyMem_Malloc(size); if (!m->defaults) return PyErr_NoMemory(); memset(m->defaults, 0, size); m->defaults_pyobjects = pyobjects; return m->defaults; } static CYTHON_INLINE void __Pyx_CyFunction_SetDefaultsTuple(PyObject *func, PyObject *tuple) { __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func; m->defaults_tuple = tuple; Py_INCREF(tuple); } static CYTHON_INLINE void __Pyx_CyFunction_SetDefaultsKwDict(PyObject *func, PyObject *dict) { __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func; m->defaults_kwdict = dict; Py_INCREF(dict); } static CYTHON_INLINE void __Pyx_CyFunction_SetAnnotationsDict(PyObject *func, PyObject *dict) { __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func; m->func_annotations = dict; Py_INCREF(dict); } static PyObject *__Pyx_CalculateMetaclass(PyTypeObject *metaclass, PyObject *bases) { Py_ssize_t i, nbases = PyTuple_GET_SIZE(bases); for (i=0; i < nbases; i++) { PyTypeObject *tmptype; PyObject *tmp = PyTuple_GET_ITEM(bases, i); tmptype = Py_TYPE(tmp); #if PY_MAJOR_VERSION < 3 if (tmptype == &PyClass_Type) continue; #endif if (!metaclass) { metaclass = tmptype; continue; } if (PyType_IsSubtype(metaclass, tmptype)) continue; if (PyType_IsSubtype(tmptype, metaclass)) { metaclass = tmptype; continue; } PyErr_SetString(PyExc_TypeError, "metaclass conflict: " "the metaclass of a derived class " "must be a (non-strict) subclass " "of the metaclasses of all its bases"); return NULL; } if (!metaclass) { #if PY_MAJOR_VERSION < 3 metaclass = &PyClass_Type; #else metaclass = &PyType_Type; #endif } Py_INCREF((PyObject*) metaclass); return (PyObject*) metaclass; } static PyObject *__Pyx_Py3MetaclassPrepare(PyObject *metaclass, PyObject *bases, PyObject *name, PyObject *qualname, PyObject *mkw, PyObject *modname, PyObject *doc) { PyObject *ns; if (metaclass) { PyObject *prep = __Pyx_PyObject_GetAttrStr(metaclass, __pyx_n_s_prepare); if (prep) { PyObject *pargs = PyTuple_Pack(2, name, bases); if (unlikely(!pargs)) { Py_DECREF(prep); return NULL; } ns = PyObject_Call(prep, pargs, mkw); Py_DECREF(prep); Py_DECREF(pargs); } else { if (unlikely(!PyErr_ExceptionMatches(PyExc_AttributeError))) return NULL; PyErr_Clear(); ns = PyDict_New(); } } else { ns = PyDict_New(); } if (unlikely(!ns)) return NULL; if (unlikely(PyObject_SetItem(ns, __pyx_n_s_module, modname) < 0)) goto bad; if (unlikely(PyObject_SetItem(ns, __pyx_n_s_qualname, qualname) < 0)) goto bad; if (unlikely(doc && PyObject_SetItem(ns, __pyx_n_s_doc, doc) < 0)) goto bad; return ns; bad: Py_DECREF(ns); return NULL; } static PyObject *__Pyx_Py3ClassCreate(PyObject *metaclass, PyObject *name, PyObject *bases, PyObject *dict, PyObject *mkw, int calculate_metaclass, int allow_py2_metaclass) { PyObject *result, *margs; PyObject *owned_metaclass = NULL; if (allow_py2_metaclass) { owned_metaclass = PyObject_GetItem(dict, __pyx_n_s_metaclass); if (owned_metaclass) { metaclass = owned_metaclass; } else if (likely(PyErr_ExceptionMatches(PyExc_KeyError))) { PyErr_Clear(); } else { return NULL; } } if (calculate_metaclass && (!metaclass || PyType_Check(metaclass))) { metaclass = __Pyx_CalculateMetaclass((PyTypeObject*) metaclass, bases); Py_XDECREF(owned_metaclass); if (unlikely(!metaclass)) return NULL; owned_metaclass = metaclass; } margs = PyTuple_Pack(3, name, bases, dict); if (unlikely(!margs)) { result = NULL; } else { result = PyObject_Call(metaclass, margs, mkw); Py_DECREF(margs); } Py_XDECREF(owned_metaclass); return result; } static int __pyx_bisect_code_objects(__Pyx_CodeObjectCacheEntry* entries, int count, int code_line) { int start = 0, mid = 0, end = count - 1; if (end >= 0 && code_line > entries[end].code_line) { return count; } while (start < end) { mid = start + (end - start) / 2; if (code_line < entries[mid].code_line) { end = mid; } else if (code_line > entries[mid].code_line) { start = mid + 1; } else { return mid; } } if (code_line <= entries[mid].code_line) { return mid; } else { return mid + 1; } } static PyCodeObject *__pyx_find_code_object(int code_line) { PyCodeObject* code_object; int pos; if (unlikely(!code_line) || unlikely(!__pyx_code_cache.entries)) { return NULL; } pos = __pyx_bisect_code_objects(__pyx_code_cache.entries, __pyx_code_cache.count, code_line); if (unlikely(pos >= __pyx_code_cache.count) || unlikely(__pyx_code_cache.entries[pos].code_line != code_line)) { return NULL; } code_object = __pyx_code_cache.entries[pos].code_object; Py_INCREF(code_object); return code_object; } static void __pyx_insert_code_object(int code_line, PyCodeObject* code_object) { int pos, i; __Pyx_CodeObjectCacheEntry* entries = __pyx_code_cache.entries; if (unlikely(!code_line)) { return; } if (unlikely(!entries)) { entries = (__Pyx_CodeObjectCacheEntry*)PyMem_Malloc(64*sizeof(__Pyx_CodeObjectCacheEntry)); if (likely(entries)) { __pyx_code_cache.entries = entries; __pyx_code_cache.max_count = 64; __pyx_code_cache.count = 1; entries[0].code_line = code_line; entries[0].code_object = code_object; Py_INCREF(code_object); } return; } pos = __pyx_bisect_code_objects(__pyx_code_cache.entries, __pyx_code_cache.count, code_line); if ((pos < __pyx_code_cache.count) && unlikely(__pyx_code_cache.entries[pos].code_line == code_line)) { PyCodeObject* tmp = entries[pos].code_object; entries[pos].code_object = code_object; Py_DECREF(tmp); return; } if (__pyx_code_cache.count == __pyx_code_cache.max_count) { int new_max = __pyx_code_cache.max_count + 64; entries = (__Pyx_CodeObjectCacheEntry*)PyMem_Realloc( __pyx_code_cache.entries, (size_t)new_max*sizeof(__Pyx_CodeObjectCacheEntry)); if (unlikely(!entries)) { return; } __pyx_code_cache.entries = entries; __pyx_code_cache.max_count = new_max; } for (i=__pyx_code_cache.count; i>pos; i--) { entries[i] = entries[i-1]; } entries[pos].code_line = code_line; entries[pos].code_object = code_object; __pyx_code_cache.count++; Py_INCREF(code_object); } #include "compile.h" #include "frameobject.h" #include "traceback.h" static PyCodeObject* __Pyx_CreateCodeObjectForTraceback( const char *funcname, int c_line, int py_line, const char *filename) { PyCodeObject *py_code = 0; PyObject *py_srcfile = 0; PyObject *py_funcname = 0; #if PY_MAJOR_VERSION < 3 py_srcfile = PyString_FromString(filename); #else py_srcfile = PyUnicode_FromString(filename); #endif if (!py_srcfile) goto bad; if (c_line) { #if PY_MAJOR_VERSION < 3 py_funcname = PyString_FromFormat( "%s (%s:%d)", funcname, __pyx_cfilenm, c_line); #else py_funcname = PyUnicode_FromFormat( "%s (%s:%d)", funcname, __pyx_cfilenm, c_line); #endif } else { #if PY_MAJOR_VERSION < 3 py_funcname = PyString_FromString(funcname); #else py_funcname = PyUnicode_FromString(funcname); #endif } if (!py_funcname) goto bad; py_code = __Pyx_PyCode_New( 0, 0, 0, 0, 0, __pyx_empty_bytes, /*PyObject *code,*/ __pyx_empty_tuple, /*PyObject *consts,*/ __pyx_empty_tuple, /*PyObject *names,*/ __pyx_empty_tuple, /*PyObject *varnames,*/ __pyx_empty_tuple, /*PyObject *freevars,*/ __pyx_empty_tuple, /*PyObject *cellvars,*/ py_srcfile, /*PyObject *filename,*/ py_funcname, /*PyObject *name,*/ py_line, __pyx_empty_bytes /*PyObject *lnotab*/ ); Py_DECREF(py_srcfile); Py_DECREF(py_funcname); return py_code; bad: Py_XDECREF(py_srcfile); Py_XDECREF(py_funcname); return NULL; } static void __Pyx_AddTraceback(const char *funcname, int c_line, int py_line, const char *filename) { PyCodeObject *py_code = 0; PyFrameObject *py_frame = 0; py_code = __pyx_find_code_object(c_line ? c_line : py_line); if (!py_code) { py_code = __Pyx_CreateCodeObjectForTraceback( funcname, c_line, py_line, filename); if (!py_code) goto bad; __pyx_insert_code_object(c_line ? c_line : py_line, py_code); } py_frame = PyFrame_New( PyThreadState_GET(), /*PyThreadState *tstate,*/ py_code, /*PyCodeObject *code,*/ __pyx_d, /*PyObject *globals,*/ 0 /*PyObject *locals*/ ); if (!py_frame) goto bad; py_frame->f_lineno = py_line; PyTraceBack_Here(py_frame); bad: Py_XDECREF(py_code); Py_XDECREF(py_frame); } #define __PYX_VERIFY_RETURN_INT(target_type, func_type, func_value)\ __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, 0) #define __PYX_VERIFY_RETURN_INT_EXC(target_type, func_type, func_value)\ __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, 1) #define __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, exc)\ {\ func_type value = func_value;\ if (sizeof(target_type) < sizeof(func_type)) {\ if (unlikely(value != (func_type) (target_type) value)) {\ func_type zero = 0;\ if (exc && unlikely(value == (func_type)-1 && PyErr_Occurred()))\ return (target_type) -1;\ if (is_unsigned && unlikely(value < zero))\ goto raise_neg_overflow;\ else\ goto raise_overflow;\ }\ }\ return (target_type) value;\ } static CYTHON_INLINE int __Pyx_PyInt_As_int(PyObject *x) { const int neg_one = (int) -1, const_zero = (int) 0; const int is_unsigned = neg_one > const_zero; #if PY_MAJOR_VERSION < 3 if (likely(PyInt_Check(x))) { if (sizeof(int) < sizeof(long)) { __PYX_VERIFY_RETURN_INT(int, long, PyInt_AS_LONG(x)) } else { long val = PyInt_AS_LONG(x); if (is_unsigned && unlikely(val < 0)) { goto raise_neg_overflow; } return (int) val; } } else #endif if (likely(PyLong_Check(x))) { if (is_unsigned) { #if CYTHON_USE_PYLONG_INTERNALS const digit* digits = ((PyLongObject*)x)->ob_digit; switch (Py_SIZE(x)) { case 0: return (int) 0; case 1: __PYX_VERIFY_RETURN_INT(int, digit, digits[0]) case 2: if (8 * sizeof(int) > 1 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(int) >= 2 * PyLong_SHIFT) { return (int) (((((int)digits[1]) << PyLong_SHIFT) | (int)digits[0])); } } break; case 3: if (8 * sizeof(int) > 2 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(int) >= 3 * PyLong_SHIFT) { return (int) (((((((int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0])); } } break; case 4: if (8 * sizeof(int) > 3 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(int) >= 4 * PyLong_SHIFT) { return (int) (((((((((int)digits[3]) << PyLong_SHIFT) | (int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0])); } } break; } #endif #if CYTHON_COMPILING_IN_CPYTHON if (unlikely(Py_SIZE(x) < 0)) { goto raise_neg_overflow; } #else { int result = PyObject_RichCompareBool(x, Py_False, Py_LT); if (unlikely(result < 0)) return (int) -1; if (unlikely(result == 1)) goto raise_neg_overflow; } #endif if (sizeof(int) <= sizeof(unsigned long)) { __PYX_VERIFY_RETURN_INT_EXC(int, unsigned long, PyLong_AsUnsignedLong(x)) } else if (sizeof(int) <= sizeof(unsigned PY_LONG_LONG)) { __PYX_VERIFY_RETURN_INT_EXC(int, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x)) } } else { #if CYTHON_USE_PYLONG_INTERNALS const digit* digits = ((PyLongObject*)x)->ob_digit; switch (Py_SIZE(x)) { case 0: return (int) 0; case -1: __PYX_VERIFY_RETURN_INT(int, sdigit, -(sdigit) digits[0]) case 1: __PYX_VERIFY_RETURN_INT(int, digit, +digits[0]) case -2: if (8 * sizeof(int) - 1 > 1 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(int, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(int) - 1 > 2 * PyLong_SHIFT) { return (int) (((int)-1)*(((((int)digits[1]) << PyLong_SHIFT) | (int)digits[0]))); } } break; case 2: if (8 * sizeof(int) > 1 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(int) - 1 > 2 * PyLong_SHIFT) { return (int) ((((((int)digits[1]) << PyLong_SHIFT) | (int)digits[0]))); } } break; case -3: if (8 * sizeof(int) - 1 > 2 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(int, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(int) - 1 > 3 * PyLong_SHIFT) { return (int) (((int)-1)*(((((((int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0]))); } } break; case 3: if (8 * sizeof(int) > 2 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(int) - 1 > 3 * PyLong_SHIFT) { return (int) ((((((((int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0]))); } } break; case -4: if (8 * sizeof(int) - 1 > 3 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(int, long, -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(int) - 1 > 4 * PyLong_SHIFT) { return (int) (((int)-1)*(((((((((int)digits[3]) << PyLong_SHIFT) | (int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0]))); } } break; case 4: if (8 * sizeof(int) > 3 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(int) - 1 > 4 * PyLong_SHIFT) { return (int) ((((((((((int)digits[3]) << PyLong_SHIFT) | (int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0]))); } } break; } #endif if (sizeof(int) <= sizeof(long)) { __PYX_VERIFY_RETURN_INT_EXC(int, long, PyLong_AsLong(x)) } else if (sizeof(int) <= sizeof(PY_LONG_LONG)) { __PYX_VERIFY_RETURN_INT_EXC(int, PY_LONG_LONG, PyLong_AsLongLong(x)) } } { #if CYTHON_COMPILING_IN_PYPY && !defined(_PyLong_AsByteArray) PyErr_SetString(PyExc_RuntimeError, "_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers"); #else int val; PyObject *v = __Pyx_PyNumber_Int(x); #if PY_MAJOR_VERSION < 3 if (likely(v) && !PyLong_Check(v)) { PyObject *tmp = v; v = PyNumber_Long(tmp); Py_DECREF(tmp); } #endif if (likely(v)) { int one = 1; int is_little = (int)*(unsigned char *)&one; unsigned char *bytes = (unsigned char *)&val; int ret = _PyLong_AsByteArray((PyLongObject *)v, bytes, sizeof(val), is_little, !is_unsigned); Py_DECREF(v); if (likely(!ret)) return val; } #endif return (int) -1; } } else { int val; PyObject *tmp = __Pyx_PyNumber_Int(x); if (!tmp) return (int) -1; val = __Pyx_PyInt_As_int(tmp); Py_DECREF(tmp); return val; } raise_overflow: PyErr_SetString(PyExc_OverflowError, "value too large to convert to int"); return (int) -1; raise_neg_overflow: PyErr_SetString(PyExc_OverflowError, "can't convert negative value to int"); return (int) -1; } static CYTHON_INLINE PyObject* __Pyx_PyInt_From_uint32_t(uint32_t value) { const uint32_t neg_one = (uint32_t) -1, const_zero = (uint32_t) 0; const int is_unsigned = neg_one > const_zero; if (is_unsigned) { if (sizeof(uint32_t) < sizeof(long)) { return PyInt_FromLong((long) value); } else if (sizeof(uint32_t) <= sizeof(unsigned long)) { return PyLong_FromUnsignedLong((unsigned long) value); } else if (sizeof(uint32_t) <= sizeof(unsigned PY_LONG_LONG)) { return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value); } } else { if (sizeof(uint32_t) <= sizeof(long)) { return PyInt_FromLong((long) value); } else if (sizeof(uint32_t) <= sizeof(PY_LONG_LONG)) { return PyLong_FromLongLong((PY_LONG_LONG) value); } } { int one = 1; int little = (int)*(unsigned char *)&one; unsigned char *bytes = (unsigned char *)&value; return _PyLong_FromByteArray(bytes, sizeof(uint32_t), little, !is_unsigned); } } static CYTHON_INLINE uint32_t __Pyx_PyInt_As_uint32_t(PyObject *x) { const uint32_t neg_one = (uint32_t) -1, const_zero = (uint32_t) 0; const int is_unsigned = neg_one > const_zero; #if PY_MAJOR_VERSION < 3 if (likely(PyInt_Check(x))) { if (sizeof(uint32_t) < sizeof(long)) { __PYX_VERIFY_RETURN_INT(uint32_t, long, PyInt_AS_LONG(x)) } else { long val = PyInt_AS_LONG(x); if (is_unsigned && unlikely(val < 0)) { goto raise_neg_overflow; } return (uint32_t) val; } } else #endif if (likely(PyLong_Check(x))) { if (is_unsigned) { #if CYTHON_USE_PYLONG_INTERNALS const digit* digits = ((PyLongObject*)x)->ob_digit; switch (Py_SIZE(x)) { case 0: return (uint32_t) 0; case 1: __PYX_VERIFY_RETURN_INT(uint32_t, digit, digits[0]) case 2: if (8 * sizeof(uint32_t) > 1 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(uint32_t, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(uint32_t) >= 2 * PyLong_SHIFT) { return (uint32_t) (((((uint32_t)digits[1]) << PyLong_SHIFT) | (uint32_t)digits[0])); } } break; case 3: if (8 * sizeof(uint32_t) > 2 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(uint32_t, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(uint32_t) >= 3 * PyLong_SHIFT) { return (uint32_t) (((((((uint32_t)digits[2]) << PyLong_SHIFT) | (uint32_t)digits[1]) << PyLong_SHIFT) | (uint32_t)digits[0])); } } break; case 4: if (8 * sizeof(uint32_t) > 3 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(uint32_t, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(uint32_t) >= 4 * PyLong_SHIFT) { return (uint32_t) (((((((((uint32_t)digits[3]) << PyLong_SHIFT) | (uint32_t)digits[2]) << PyLong_SHIFT) | (uint32_t)digits[1]) << PyLong_SHIFT) | (uint32_t)digits[0])); } } break; } #endif #if CYTHON_COMPILING_IN_CPYTHON if (unlikely(Py_SIZE(x) < 0)) { goto raise_neg_overflow; } #else { int result = PyObject_RichCompareBool(x, Py_False, Py_LT); if (unlikely(result < 0)) return (uint32_t) -1; if (unlikely(result == 1)) goto raise_neg_overflow; } #endif if (sizeof(uint32_t) <= sizeof(unsigned long)) { __PYX_VERIFY_RETURN_INT_EXC(uint32_t, unsigned long, PyLong_AsUnsignedLong(x)) } else if (sizeof(uint32_t) <= sizeof(unsigned PY_LONG_LONG)) { __PYX_VERIFY_RETURN_INT_EXC(uint32_t, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x)) } } else { #if CYTHON_USE_PYLONG_INTERNALS const digit* digits = ((PyLongObject*)x)->ob_digit; switch (Py_SIZE(x)) { case 0: return (uint32_t) 0; case -1: __PYX_VERIFY_RETURN_INT(uint32_t, sdigit, -(sdigit) digits[0]) case 1: __PYX_VERIFY_RETURN_INT(uint32_t, digit, +digits[0]) case -2: if (8 * sizeof(uint32_t) - 1 > 1 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(uint32_t, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(uint32_t) - 1 > 2 * PyLong_SHIFT) { return (uint32_t) (((uint32_t)-1)*(((((uint32_t)digits[1]) << PyLong_SHIFT) | (uint32_t)digits[0]))); } } break; case 2: if (8 * sizeof(uint32_t) > 1 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(uint32_t, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(uint32_t) - 1 > 2 * PyLong_SHIFT) { return (uint32_t) ((((((uint32_t)digits[1]) << PyLong_SHIFT) | (uint32_t)digits[0]))); } } break; case -3: if (8 * sizeof(uint32_t) - 1 > 2 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(uint32_t, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(uint32_t) - 1 > 3 * PyLong_SHIFT) { return (uint32_t) (((uint32_t)-1)*(((((((uint32_t)digits[2]) << PyLong_SHIFT) | (uint32_t)digits[1]) << PyLong_SHIFT) | (uint32_t)digits[0]))); } } break; case 3: if (8 * sizeof(uint32_t) > 2 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(uint32_t, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(uint32_t) - 1 > 3 * PyLong_SHIFT) { return (uint32_t) ((((((((uint32_t)digits[2]) << PyLong_SHIFT) | (uint32_t)digits[1]) << PyLong_SHIFT) | (uint32_t)digits[0]))); } } break; case -4: if (8 * sizeof(uint32_t) - 1 > 3 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(uint32_t, long, -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(uint32_t) - 1 > 4 * PyLong_SHIFT) { return (uint32_t) (((uint32_t)-1)*(((((((((uint32_t)digits[3]) << PyLong_SHIFT) | (uint32_t)digits[2]) << PyLong_SHIFT) | (uint32_t)digits[1]) << PyLong_SHIFT) | (uint32_t)digits[0]))); } } break; case 4: if (8 * sizeof(uint32_t) > 3 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(uint32_t, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(uint32_t) - 1 > 4 * PyLong_SHIFT) { return (uint32_t) ((((((((((uint32_t)digits[3]) << PyLong_SHIFT) | (uint32_t)digits[2]) << PyLong_SHIFT) | (uint32_t)digits[1]) << PyLong_SHIFT) | (uint32_t)digits[0]))); } } break; } #endif if (sizeof(uint32_t) <= sizeof(long)) { __PYX_VERIFY_RETURN_INT_EXC(uint32_t, long, PyLong_AsLong(x)) } else if (sizeof(uint32_t) <= sizeof(PY_LONG_LONG)) { __PYX_VERIFY_RETURN_INT_EXC(uint32_t, PY_LONG_LONG, PyLong_AsLongLong(x)) } } { #if CYTHON_COMPILING_IN_PYPY && !defined(_PyLong_AsByteArray) PyErr_SetString(PyExc_RuntimeError, "_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers"); #else uint32_t val; PyObject *v = __Pyx_PyNumber_Int(x); #if PY_MAJOR_VERSION < 3 if (likely(v) && !PyLong_Check(v)) { PyObject *tmp = v; v = PyNumber_Long(tmp); Py_DECREF(tmp); } #endif if (likely(v)) { int one = 1; int is_little = (int)*(unsigned char *)&one; unsigned char *bytes = (unsigned char *)&val; int ret = _PyLong_AsByteArray((PyLongObject *)v, bytes, sizeof(val), is_little, !is_unsigned); Py_DECREF(v); if (likely(!ret)) return val; } #endif return (uint32_t) -1; } } else { uint32_t val; PyObject *tmp = __Pyx_PyNumber_Int(x); if (!tmp) return (uint32_t) -1; val = __Pyx_PyInt_As_uint32_t(tmp); Py_DECREF(tmp); return val; } raise_overflow: PyErr_SetString(PyExc_OverflowError, "value too large to convert to uint32_t"); return (uint32_t) -1; raise_neg_overflow: PyErr_SetString(PyExc_OverflowError, "can't convert negative value to uint32_t"); return (uint32_t) -1; } static CYTHON_INLINE PyObject* __Pyx_PyInt_From_int(int value) { const int neg_one = (int) -1, const_zero = (int) 0; const int is_unsigned = neg_one > const_zero; if (is_unsigned) { if (sizeof(int) < sizeof(long)) { return PyInt_FromLong((long) value); } else if (sizeof(int) <= sizeof(unsigned long)) { return PyLong_FromUnsignedLong((unsigned long) value); } else if (sizeof(int) <= sizeof(unsigned PY_LONG_LONG)) { return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value); } } else { if (sizeof(int) <= sizeof(long)) { return PyInt_FromLong((long) value); } else if (sizeof(int) <= sizeof(PY_LONG_LONG)) { return PyLong_FromLongLong((PY_LONG_LONG) value); } } { int one = 1; int little = (int)*(unsigned char *)&one; unsigned char *bytes = (unsigned char *)&value; return _PyLong_FromByteArray(bytes, sizeof(int), little, !is_unsigned); } } static CYTHON_INLINE PyObject* __Pyx_PyInt_From_long(long value) { const long neg_one = (long) -1, const_zero = (long) 0; const int is_unsigned = neg_one > const_zero; if (is_unsigned) { if (sizeof(long) < sizeof(long)) { return PyInt_FromLong((long) value); } else if (sizeof(long) <= sizeof(unsigned long)) { return PyLong_FromUnsignedLong((unsigned long) value); } else if (sizeof(long) <= sizeof(unsigned PY_LONG_LONG)) { return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value); } } else { if (sizeof(long) <= sizeof(long)) { return PyInt_FromLong((long) value); } else if (sizeof(long) <= sizeof(PY_LONG_LONG)) { return PyLong_FromLongLong((PY_LONG_LONG) value); } } { int one = 1; int little = (int)*(unsigned char *)&one; unsigned char *bytes = (unsigned char *)&value; return _PyLong_FromByteArray(bytes, sizeof(long), little, !is_unsigned); } } static CYTHON_INLINE long __Pyx_PyInt_As_long(PyObject *x) { const long neg_one = (long) -1, const_zero = (long) 0; const int is_unsigned = neg_one > const_zero; #if PY_MAJOR_VERSION < 3 if (likely(PyInt_Check(x))) { if (sizeof(long) < sizeof(long)) { __PYX_VERIFY_RETURN_INT(long, long, PyInt_AS_LONG(x)) } else { long val = PyInt_AS_LONG(x); if (is_unsigned && unlikely(val < 0)) { goto raise_neg_overflow; } return (long) val; } } else #endif if (likely(PyLong_Check(x))) { if (is_unsigned) { #if CYTHON_USE_PYLONG_INTERNALS const digit* digits = ((PyLongObject*)x)->ob_digit; switch (Py_SIZE(x)) { case 0: return (long) 0; case 1: __PYX_VERIFY_RETURN_INT(long, digit, digits[0]) case 2: if (8 * sizeof(long) > 1 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(long) >= 2 * PyLong_SHIFT) { return (long) (((((long)digits[1]) << PyLong_SHIFT) | (long)digits[0])); } } break; case 3: if (8 * sizeof(long) > 2 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(long) >= 3 * PyLong_SHIFT) { return (long) (((((((long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0])); } } break; case 4: if (8 * sizeof(long) > 3 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(long) >= 4 * PyLong_SHIFT) { return (long) (((((((((long)digits[3]) << PyLong_SHIFT) | (long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0])); } } break; } #endif #if CYTHON_COMPILING_IN_CPYTHON if (unlikely(Py_SIZE(x) < 0)) { goto raise_neg_overflow; } #else { int result = PyObject_RichCompareBool(x, Py_False, Py_LT); if (unlikely(result < 0)) return (long) -1; if (unlikely(result == 1)) goto raise_neg_overflow; } #endif if (sizeof(long) <= sizeof(unsigned long)) { __PYX_VERIFY_RETURN_INT_EXC(long, unsigned long, PyLong_AsUnsignedLong(x)) } else if (sizeof(long) <= sizeof(unsigned PY_LONG_LONG)) { __PYX_VERIFY_RETURN_INT_EXC(long, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x)) } } else { #if CYTHON_USE_PYLONG_INTERNALS const digit* digits = ((PyLongObject*)x)->ob_digit; switch (Py_SIZE(x)) { case 0: return (long) 0; case -1: __PYX_VERIFY_RETURN_INT(long, sdigit, -(sdigit) digits[0]) case 1: __PYX_VERIFY_RETURN_INT(long, digit, +digits[0]) case -2: if (8 * sizeof(long) - 1 > 1 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(long, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) { return (long) (((long)-1)*(((((long)digits[1]) << PyLong_SHIFT) | (long)digits[0]))); } } break; case 2: if (8 * sizeof(long) > 1 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) { return (long) ((((((long)digits[1]) << PyLong_SHIFT) | (long)digits[0]))); } } break; case -3: if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(long, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) { return (long) (((long)-1)*(((((((long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0]))); } } break; case 3: if (8 * sizeof(long) > 2 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) { return (long) ((((((((long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0]))); } } break; case -4: if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(long, long, -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(long) - 1 > 4 * PyLong_SHIFT) { return (long) (((long)-1)*(((((((((long)digits[3]) << PyLong_SHIFT) | (long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0]))); } } break; case 4: if (8 * sizeof(long) > 3 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(long) - 1 > 4 * PyLong_SHIFT) { return (long) ((((((((((long)digits[3]) << PyLong_SHIFT) | (long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0]))); } } break; } #endif if (sizeof(long) <= sizeof(long)) { __PYX_VERIFY_RETURN_INT_EXC(long, long, PyLong_AsLong(x)) } else if (sizeof(long) <= sizeof(PY_LONG_LONG)) { __PYX_VERIFY_RETURN_INT_EXC(long, PY_LONG_LONG, PyLong_AsLongLong(x)) } } { #if CYTHON_COMPILING_IN_PYPY && !defined(_PyLong_AsByteArray) PyErr_SetString(PyExc_RuntimeError, "_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers"); #else long val; PyObject *v = __Pyx_PyNumber_Int(x); #if PY_MAJOR_VERSION < 3 if (likely(v) && !PyLong_Check(v)) { PyObject *tmp = v; v = PyNumber_Long(tmp); Py_DECREF(tmp); } #endif if (likely(v)) { int one = 1; int is_little = (int)*(unsigned char *)&one; unsigned char *bytes = (unsigned char *)&val; int ret = _PyLong_AsByteArray((PyLongObject *)v, bytes, sizeof(val), is_little, !is_unsigned); Py_DECREF(v); if (likely(!ret)) return val; } #endif return (long) -1; } } else { long val; PyObject *tmp = __Pyx_PyNumber_Int(x); if (!tmp) return (long) -1; val = __Pyx_PyInt_As_long(tmp); Py_DECREF(tmp); return val; } raise_overflow: PyErr_SetString(PyExc_OverflowError, "value too large to convert to long"); return (long) -1; raise_neg_overflow: PyErr_SetString(PyExc_OverflowError, "can't convert negative value to long"); return (long) -1; } static int __Pyx_check_binary_version(void) { char ctversion[4], rtversion[4]; PyOS_snprintf(ctversion, 4, "%d.%d", PY_MAJOR_VERSION, PY_MINOR_VERSION); PyOS_snprintf(rtversion, 4, "%s", Py_GetVersion()); if (ctversion[0] != rtversion[0] || ctversion[2] != rtversion[2]) { char message[200]; PyOS_snprintf(message, sizeof(message), "compiletime version %s of module '%.100s' " "does not match runtime version %s", ctversion, __Pyx_MODULE_NAME, rtversion); return PyErr_WarnEx(NULL, message, 1); } return 0; } static int __Pyx_InitStrings(__Pyx_StringTabEntry *t) { while (t->p) { #if PY_MAJOR_VERSION < 3 if (t->is_unicode) { *t->p = PyUnicode_DecodeUTF8(t->s, t->n - 1, NULL); } else if (t->intern) { *t->p = PyString_InternFromString(t->s); } else { *t->p = PyString_FromStringAndSize(t->s, t->n - 1); } #else if (t->is_unicode | t->is_str) { if (t->intern) { *t->p = PyUnicode_InternFromString(t->s); } else if (t->encoding) { *t->p = PyUnicode_Decode(t->s, t->n - 1, t->encoding, NULL); } else { *t->p = PyUnicode_FromStringAndSize(t->s, t->n - 1); } } else { *t->p = PyBytes_FromStringAndSize(t->s, t->n - 1); } #endif if (!*t->p) return -1; ++t; } return 0; } static CYTHON_INLINE PyObject* __Pyx_PyUnicode_FromString(const char* c_str) { return __Pyx_PyUnicode_FromStringAndSize(c_str, (Py_ssize_t)strlen(c_str)); } static CYTHON_INLINE char* __Pyx_PyObject_AsString(PyObject* o) { Py_ssize_t ignore; return __Pyx_PyObject_AsStringAndSize(o, &ignore); } static CYTHON_INLINE char* __Pyx_PyObject_AsStringAndSize(PyObject* o, Py_ssize_t *length) { #if CYTHON_COMPILING_IN_CPYTHON && (__PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT) if ( #if PY_MAJOR_VERSION < 3 && __PYX_DEFAULT_STRING_ENCODING_IS_ASCII __Pyx_sys_getdefaultencoding_not_ascii && #endif PyUnicode_Check(o)) { #if PY_VERSION_HEX < 0x03030000 char* defenc_c; PyObject* defenc = _PyUnicode_AsDefaultEncodedString(o, NULL); if (!defenc) return NULL; defenc_c = PyBytes_AS_STRING(defenc); #if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII { char* end = defenc_c + PyBytes_GET_SIZE(defenc); char* c; for (c = defenc_c; c < end; c++) { if ((unsigned char) (*c) >= 128) { PyUnicode_AsASCIIString(o); return NULL; } } } #endif *length = PyBytes_GET_SIZE(defenc); return defenc_c; #else if (__Pyx_PyUnicode_READY(o) == -1) return NULL; #if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII if (PyUnicode_IS_ASCII(o)) { *length = PyUnicode_GET_LENGTH(o); return PyUnicode_AsUTF8(o); } else { PyUnicode_AsASCIIString(o); return NULL; } #else return PyUnicode_AsUTF8AndSize(o, length); #endif #endif } else #endif #if (!CYTHON_COMPILING_IN_PYPY) || (defined(PyByteArray_AS_STRING) && defined(PyByteArray_GET_SIZE)) if (PyByteArray_Check(o)) { *length = PyByteArray_GET_SIZE(o); return PyByteArray_AS_STRING(o); } else #endif { char* result; int r = PyBytes_AsStringAndSize(o, &result, length); if (unlikely(r < 0)) { return NULL; } else { return result; } } } static CYTHON_INLINE int __Pyx_PyObject_IsTrue(PyObject* x) { int is_true = x == Py_True; if (is_true | (x == Py_False) | (x == Py_None)) return is_true; else return PyObject_IsTrue(x); } static CYTHON_INLINE PyObject* __Pyx_PyNumber_Int(PyObject* x) { PyNumberMethods *m; const char *name = NULL; PyObject *res = NULL; #if PY_MAJOR_VERSION < 3 if (PyInt_Check(x) || PyLong_Check(x)) #else if (PyLong_Check(x)) #endif return __Pyx_NewRef(x); m = Py_TYPE(x)->tp_as_number; #if PY_MAJOR_VERSION < 3 if (m && m->nb_int) { name = "int"; res = PyNumber_Int(x); } else if (m && m->nb_long) { name = "long"; res = PyNumber_Long(x); } #else if (m && m->nb_int) { name = "int"; res = PyNumber_Long(x); } #endif if (res) { #if PY_MAJOR_VERSION < 3 if (!PyInt_Check(res) && !PyLong_Check(res)) { #else if (!PyLong_Check(res)) { #endif PyErr_Format(PyExc_TypeError, "__%.4s__ returned non-%.4s (type %.200s)", name, name, Py_TYPE(res)->tp_name); Py_DECREF(res); return NULL; } } else if (!PyErr_Occurred()) { PyErr_SetString(PyExc_TypeError, "an integer is required"); } return res; } static CYTHON_INLINE Py_ssize_t __Pyx_PyIndex_AsSsize_t(PyObject* b) { Py_ssize_t ival; PyObject *x; #if PY_MAJOR_VERSION < 3 if (likely(PyInt_CheckExact(b))) { if (sizeof(Py_ssize_t) >= sizeof(long)) return PyInt_AS_LONG(b); else return PyInt_AsSsize_t(x); } #endif if (likely(PyLong_CheckExact(b))) { #if CYTHON_USE_PYLONG_INTERNALS const digit* digits = ((PyLongObject*)b)->ob_digit; const Py_ssize_t size = Py_SIZE(b); if (likely(__Pyx_sst_abs(size) <= 1)) { ival = likely(size) ? digits[0] : 0; if (size == -1) ival = -ival; return ival; } else { switch (size) { case 2: if (8 * sizeof(Py_ssize_t) > 2 * PyLong_SHIFT) { return (Py_ssize_t) (((((size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])); } break; case -2: if (8 * sizeof(Py_ssize_t) > 2 * PyLong_SHIFT) { return -(Py_ssize_t) (((((size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])); } break; case 3: if (8 * sizeof(Py_ssize_t) > 3 * PyLong_SHIFT) { return (Py_ssize_t) (((((((size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])); } break; case -3: if (8 * sizeof(Py_ssize_t) > 3 * PyLong_SHIFT) { return -(Py_ssize_t) (((((((size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])); } break; case 4: if (8 * sizeof(Py_ssize_t) > 4 * PyLong_SHIFT) { return (Py_ssize_t) (((((((((size_t)digits[3]) << PyLong_SHIFT) | (size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])); } break; case -4: if (8 * sizeof(Py_ssize_t) > 4 * PyLong_SHIFT) { return -(Py_ssize_t) (((((((((size_t)digits[3]) << PyLong_SHIFT) | (size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])); } break; } } #endif return PyLong_AsSsize_t(b); } x = PyNumber_Index(b); if (!x) return -1; ival = PyInt_AsSsize_t(x); Py_DECREF(x); return ival; } static CYTHON_INLINE PyObject * __Pyx_PyInt_FromSize_t(size_t ival) { return PyInt_FromSize_t(ival); } #endif /* Py_PYTHON_H */ pygame_sdl2-2.1.0-for-renpy-6.99.14.1/gen/pygame_sdl2.color.c0000644000175000017500000525001413110722720022506 0ustar tomtom00000000000000/* Generated by Cython 0.23.5 */ #define PY_SSIZE_T_CLEAN #include "Python.h" #ifndef Py_PYTHON_H #error Python headers needed to compile C extensions, please install development version of Python. #elif PY_VERSION_HEX < 0x02060000 || (0x03000000 <= PY_VERSION_HEX && PY_VERSION_HEX < 0x03020000) #error Cython requires Python 2.6+ or Python 3.2+. #else #define CYTHON_ABI "0_23_5" #include #ifndef offsetof #define offsetof(type, member) ( (size_t) & ((type*)0) -> member ) #endif #if !defined(WIN32) && !defined(MS_WINDOWS) #ifndef __stdcall #define __stdcall #endif #ifndef __cdecl #define __cdecl #endif #ifndef __fastcall #define __fastcall #endif #endif #ifndef DL_IMPORT #define DL_IMPORT(t) t #endif #ifndef DL_EXPORT #define DL_EXPORT(t) t #endif #ifndef PY_LONG_LONG #define PY_LONG_LONG LONG_LONG #endif #ifndef Py_HUGE_VAL #define Py_HUGE_VAL HUGE_VAL #endif #ifdef PYPY_VERSION #define CYTHON_COMPILING_IN_PYPY 1 #define CYTHON_COMPILING_IN_CPYTHON 0 #else #define CYTHON_COMPILING_IN_PYPY 0 #define CYTHON_COMPILING_IN_CPYTHON 1 #endif #if !defined(CYTHON_USE_PYLONG_INTERNALS) && CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x02070000 #define CYTHON_USE_PYLONG_INTERNALS 1 #endif #if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX < 0x02070600 && !defined(Py_OptimizeFlag) #define Py_OptimizeFlag 0 #endif #define __PYX_BUILD_PY_SSIZE_T "n" #define CYTHON_FORMAT_SSIZE_T "z" #if PY_MAJOR_VERSION < 3 #define __Pyx_BUILTIN_MODULE_NAME "__builtin__" #define __Pyx_PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)\ PyCode_New(a+k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos) #define __Pyx_DefaultClassType PyClass_Type #else #define __Pyx_BUILTIN_MODULE_NAME "builtins" #define __Pyx_PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)\ PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos) #define __Pyx_DefaultClassType PyType_Type #endif #ifndef Py_TPFLAGS_CHECKTYPES #define Py_TPFLAGS_CHECKTYPES 0 #endif #ifndef Py_TPFLAGS_HAVE_INDEX #define Py_TPFLAGS_HAVE_INDEX 0 #endif #ifndef Py_TPFLAGS_HAVE_NEWBUFFER #define Py_TPFLAGS_HAVE_NEWBUFFER 0 #endif #ifndef Py_TPFLAGS_HAVE_FINALIZE #define Py_TPFLAGS_HAVE_FINALIZE 0 #endif #if PY_VERSION_HEX > 0x03030000 && defined(PyUnicode_KIND) #define CYTHON_PEP393_ENABLED 1 #define __Pyx_PyUnicode_READY(op) (likely(PyUnicode_IS_READY(op)) ?\ 0 : _PyUnicode_Ready((PyObject *)(op))) #define __Pyx_PyUnicode_GET_LENGTH(u) PyUnicode_GET_LENGTH(u) #define __Pyx_PyUnicode_READ_CHAR(u, i) PyUnicode_READ_CHAR(u, i) #define __Pyx_PyUnicode_KIND(u) PyUnicode_KIND(u) #define __Pyx_PyUnicode_DATA(u) PyUnicode_DATA(u) #define __Pyx_PyUnicode_READ(k, d, i) PyUnicode_READ(k, d, i) #else #define CYTHON_PEP393_ENABLED 0 #define __Pyx_PyUnicode_READY(op) (0) #define __Pyx_PyUnicode_GET_LENGTH(u) PyUnicode_GET_SIZE(u) #define __Pyx_PyUnicode_READ_CHAR(u, i) ((Py_UCS4)(PyUnicode_AS_UNICODE(u)[i])) #define __Pyx_PyUnicode_KIND(u) (sizeof(Py_UNICODE)) #define __Pyx_PyUnicode_DATA(u) ((void*)PyUnicode_AS_UNICODE(u)) #define __Pyx_PyUnicode_READ(k, d, i) ((void)(k), (Py_UCS4)(((Py_UNICODE*)d)[i])) #endif #if CYTHON_COMPILING_IN_PYPY #define __Pyx_PyUnicode_Concat(a, b) PyNumber_Add(a, b) #define __Pyx_PyUnicode_ConcatSafe(a, b) PyNumber_Add(a, b) #else #define __Pyx_PyUnicode_Concat(a, b) PyUnicode_Concat(a, b) #define __Pyx_PyUnicode_ConcatSafe(a, b) ((unlikely((a) == Py_None) || unlikely((b) == Py_None)) ?\ PyNumber_Add(a, b) : __Pyx_PyUnicode_Concat(a, b)) #endif #if CYTHON_COMPILING_IN_PYPY && !defined(PyUnicode_Contains) #define PyUnicode_Contains(u, s) PySequence_Contains(u, s) #endif #define __Pyx_PyString_FormatSafe(a, b) ((unlikely((a) == Py_None)) ? PyNumber_Remainder(a, b) : __Pyx_PyString_Format(a, b)) #define __Pyx_PyUnicode_FormatSafe(a, b) ((unlikely((a) == Py_None)) ? PyNumber_Remainder(a, b) : PyUnicode_Format(a, b)) #if PY_MAJOR_VERSION >= 3 #define __Pyx_PyString_Format(a, b) PyUnicode_Format(a, b) #else #define __Pyx_PyString_Format(a, b) PyString_Format(a, b) #endif #if PY_MAJOR_VERSION >= 3 #define PyBaseString_Type PyUnicode_Type #define PyStringObject PyUnicodeObject #define PyString_Type PyUnicode_Type #define PyString_Check PyUnicode_Check #define PyString_CheckExact PyUnicode_CheckExact #endif #if PY_MAJOR_VERSION >= 3 #define __Pyx_PyBaseString_Check(obj) PyUnicode_Check(obj) #define __Pyx_PyBaseString_CheckExact(obj) PyUnicode_CheckExact(obj) #else #define __Pyx_PyBaseString_Check(obj) (PyString_Check(obj) || PyUnicode_Check(obj)) #define __Pyx_PyBaseString_CheckExact(obj) (PyString_CheckExact(obj) || PyUnicode_CheckExact(obj)) #endif #ifndef PySet_CheckExact #define PySet_CheckExact(obj) (Py_TYPE(obj) == &PySet_Type) #endif #define __Pyx_TypeCheck(obj, type) PyObject_TypeCheck(obj, (PyTypeObject *)type) #if PY_MAJOR_VERSION >= 3 #define PyIntObject PyLongObject #define PyInt_Type PyLong_Type #define PyInt_Check(op) PyLong_Check(op) #define PyInt_CheckExact(op) PyLong_CheckExact(op) #define PyInt_FromString PyLong_FromString #define PyInt_FromUnicode PyLong_FromUnicode #define PyInt_FromLong PyLong_FromLong #define PyInt_FromSize_t PyLong_FromSize_t #define PyInt_FromSsize_t PyLong_FromSsize_t #define PyInt_AsLong PyLong_AsLong #define PyInt_AS_LONG PyLong_AS_LONG #define PyInt_AsSsize_t PyLong_AsSsize_t #define PyInt_AsUnsignedLongMask PyLong_AsUnsignedLongMask #define PyInt_AsUnsignedLongLongMask PyLong_AsUnsignedLongLongMask #define PyNumber_Int PyNumber_Long #endif #if PY_MAJOR_VERSION >= 3 #define PyBoolObject PyLongObject #endif #if PY_MAJOR_VERSION >= 3 && CYTHON_COMPILING_IN_PYPY #ifndef PyUnicode_InternFromString #define PyUnicode_InternFromString(s) PyUnicode_FromString(s) #endif #endif #if PY_VERSION_HEX < 0x030200A4 typedef long Py_hash_t; #define __Pyx_PyInt_FromHash_t PyInt_FromLong #define __Pyx_PyInt_AsHash_t PyInt_AsLong #else #define __Pyx_PyInt_FromHash_t PyInt_FromSsize_t #define __Pyx_PyInt_AsHash_t PyInt_AsSsize_t #endif #if PY_MAJOR_VERSION >= 3 #define __Pyx_PyMethod_New(func, self, klass) ((self) ? PyMethod_New(func, self) : PyInstanceMethod_New(func)) #else #define __Pyx_PyMethod_New(func, self, klass) PyMethod_New(func, self, klass) #endif #if PY_VERSION_HEX >= 0x030500B1 #define __Pyx_PyAsyncMethodsStruct PyAsyncMethods #define __Pyx_PyType_AsAsync(obj) (Py_TYPE(obj)->tp_as_async) #elif CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3 typedef struct { unaryfunc am_await; unaryfunc am_aiter; unaryfunc am_anext; } __Pyx_PyAsyncMethodsStruct; #define __Pyx_PyType_AsAsync(obj) ((__Pyx_PyAsyncMethodsStruct*) (Py_TYPE(obj)->tp_reserved)) #else #define __Pyx_PyType_AsAsync(obj) NULL #endif #ifndef CYTHON_RESTRICT #if defined(__GNUC__) #define CYTHON_RESTRICT __restrict__ #elif defined(_MSC_VER) && _MSC_VER >= 1400 #define CYTHON_RESTRICT __restrict #elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L #define CYTHON_RESTRICT restrict #else #define CYTHON_RESTRICT #endif #endif #define __Pyx_void_to_None(void_result) ((void)(void_result), Py_INCREF(Py_None), Py_None) #ifndef CYTHON_INLINE #if defined(__GNUC__) #define CYTHON_INLINE __inline__ #elif defined(_MSC_VER) #define CYTHON_INLINE __inline #elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L #define CYTHON_INLINE inline #else #define CYTHON_INLINE #endif #endif #if defined(WIN32) || defined(MS_WINDOWS) #define _USE_MATH_DEFINES #endif #include #ifdef NAN #define __PYX_NAN() ((float) NAN) #else static CYTHON_INLINE float __PYX_NAN() { float value; memset(&value, 0xFF, sizeof(value)); return value; } #endif #if PY_MAJOR_VERSION >= 3 #define __Pyx_PyNumber_Divide(x,y) PyNumber_TrueDivide(x,y) #define __Pyx_PyNumber_InPlaceDivide(x,y) PyNumber_InPlaceTrueDivide(x,y) #else #define __Pyx_PyNumber_Divide(x,y) PyNumber_Divide(x,y) #define __Pyx_PyNumber_InPlaceDivide(x,y) PyNumber_InPlaceDivide(x,y) #endif #ifndef __PYX_EXTERN_C #ifdef __cplusplus #define __PYX_EXTERN_C extern "C" #else #define __PYX_EXTERN_C extern #endif #endif #define __PYX_HAVE__pygame_sdl2__color #define __PYX_HAVE_API__pygame_sdl2__color #include "stdint.h" #include "string.h" #include "stdio.h" #include "stddef.h" #include "SDL.h" #ifdef _OPENMP #include #endif /* _OPENMP */ #ifdef PYREX_WITHOUT_ASSERTIONS #define CYTHON_WITHOUT_ASSERTIONS #endif #ifndef CYTHON_UNUSED # if defined(__GNUC__) # if !(defined(__cplusplus)) || (__GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 4)) # define CYTHON_UNUSED __attribute__ ((__unused__)) # else # define CYTHON_UNUSED # endif # elif defined(__ICC) || (defined(__INTEL_COMPILER) && !defined(_MSC_VER)) # define CYTHON_UNUSED __attribute__ ((__unused__)) # else # define CYTHON_UNUSED # endif #endif #ifndef CYTHON_NCP_UNUSED # if CYTHON_COMPILING_IN_CPYTHON # define CYTHON_NCP_UNUSED # else # define CYTHON_NCP_UNUSED CYTHON_UNUSED # endif #endif typedef struct {PyObject **p; char *s; const Py_ssize_t n; const char* encoding; const char is_unicode; const char is_str; const char intern; } __Pyx_StringTabEntry; #define __PYX_DEFAULT_STRING_ENCODING_IS_ASCII 0 #define __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT 0 #define __PYX_DEFAULT_STRING_ENCODING "" #define __Pyx_PyObject_FromString __Pyx_PyBytes_FromString #define __Pyx_PyObject_FromStringAndSize __Pyx_PyBytes_FromStringAndSize #define __Pyx_uchar_cast(c) ((unsigned char)c) #define __Pyx_long_cast(x) ((long)x) #define __Pyx_fits_Py_ssize_t(v, type, is_signed) (\ (sizeof(type) < sizeof(Py_ssize_t)) ||\ (sizeof(type) > sizeof(Py_ssize_t) &&\ likely(v < (type)PY_SSIZE_T_MAX ||\ v == (type)PY_SSIZE_T_MAX) &&\ (!is_signed || likely(v > (type)PY_SSIZE_T_MIN ||\ v == (type)PY_SSIZE_T_MIN))) ||\ (sizeof(type) == sizeof(Py_ssize_t) &&\ (is_signed || likely(v < (type)PY_SSIZE_T_MAX ||\ v == (type)PY_SSIZE_T_MAX))) ) #if defined (__cplusplus) && __cplusplus >= 201103L #include #define __Pyx_sst_abs(value) std::abs(value) #elif SIZEOF_INT >= SIZEOF_SIZE_T #define __Pyx_sst_abs(value) abs(value) #elif SIZEOF_LONG >= SIZEOF_SIZE_T #define __Pyx_sst_abs(value) labs(value) #elif defined (_MSC_VER) && defined (_M_X64) #define __Pyx_sst_abs(value) _abs64(value) #elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L #define __Pyx_sst_abs(value) llabs(value) #elif defined (__GNUC__) #define __Pyx_sst_abs(value) __builtin_llabs(value) #else #define __Pyx_sst_abs(value) ((value<0) ? -value : value) #endif static CYTHON_INLINE char* __Pyx_PyObject_AsString(PyObject*); static CYTHON_INLINE char* __Pyx_PyObject_AsStringAndSize(PyObject*, Py_ssize_t* length); #define __Pyx_PyByteArray_FromString(s) PyByteArray_FromStringAndSize((const char*)s, strlen((const char*)s)) #define __Pyx_PyByteArray_FromStringAndSize(s, l) PyByteArray_FromStringAndSize((const char*)s, l) #define __Pyx_PyBytes_FromString PyBytes_FromString #define __Pyx_PyBytes_FromStringAndSize PyBytes_FromStringAndSize static CYTHON_INLINE PyObject* __Pyx_PyUnicode_FromString(const char*); #if PY_MAJOR_VERSION < 3 #define __Pyx_PyStr_FromString __Pyx_PyBytes_FromString #define __Pyx_PyStr_FromStringAndSize __Pyx_PyBytes_FromStringAndSize #else #define __Pyx_PyStr_FromString __Pyx_PyUnicode_FromString #define __Pyx_PyStr_FromStringAndSize __Pyx_PyUnicode_FromStringAndSize #endif #define __Pyx_PyObject_AsSString(s) ((signed char*) __Pyx_PyObject_AsString(s)) #define __Pyx_PyObject_AsUString(s) ((unsigned char*) __Pyx_PyObject_AsString(s)) #define __Pyx_PyObject_FromCString(s) __Pyx_PyObject_FromString((const char*)s) #define __Pyx_PyBytes_FromCString(s) __Pyx_PyBytes_FromString((const char*)s) #define __Pyx_PyByteArray_FromCString(s) __Pyx_PyByteArray_FromString((const char*)s) #define __Pyx_PyStr_FromCString(s) __Pyx_PyStr_FromString((const char*)s) #define __Pyx_PyUnicode_FromCString(s) __Pyx_PyUnicode_FromString((const char*)s) #if PY_MAJOR_VERSION < 3 static CYTHON_INLINE size_t __Pyx_Py_UNICODE_strlen(const Py_UNICODE *u) { const Py_UNICODE *u_end = u; while (*u_end++) ; return (size_t)(u_end - u - 1); } #else #define __Pyx_Py_UNICODE_strlen Py_UNICODE_strlen #endif #define __Pyx_PyUnicode_FromUnicode(u) PyUnicode_FromUnicode(u, __Pyx_Py_UNICODE_strlen(u)) #define __Pyx_PyUnicode_FromUnicodeAndLength PyUnicode_FromUnicode #define __Pyx_PyUnicode_AsUnicode PyUnicode_AsUnicode #define __Pyx_NewRef(obj) (Py_INCREF(obj), obj) #define __Pyx_Owned_Py_None(b) __Pyx_NewRef(Py_None) #define __Pyx_PyBool_FromLong(b) ((b) ? __Pyx_NewRef(Py_True) : __Pyx_NewRef(Py_False)) static CYTHON_INLINE int __Pyx_PyObject_IsTrue(PyObject*); static CYTHON_INLINE PyObject* __Pyx_PyNumber_Int(PyObject* x); static CYTHON_INLINE Py_ssize_t __Pyx_PyIndex_AsSsize_t(PyObject*); static CYTHON_INLINE PyObject * __Pyx_PyInt_FromSize_t(size_t); #if CYTHON_COMPILING_IN_CPYTHON #define __pyx_PyFloat_AsDouble(x) (PyFloat_CheckExact(x) ? PyFloat_AS_DOUBLE(x) : PyFloat_AsDouble(x)) #else #define __pyx_PyFloat_AsDouble(x) PyFloat_AsDouble(x) #endif #define __pyx_PyFloat_AsFloat(x) ((float) __pyx_PyFloat_AsDouble(x)) #if PY_MAJOR_VERSION < 3 && __PYX_DEFAULT_STRING_ENCODING_IS_ASCII static int __Pyx_sys_getdefaultencoding_not_ascii; static int __Pyx_init_sys_getdefaultencoding_params(void) { PyObject* sys; PyObject* default_encoding = NULL; PyObject* ascii_chars_u = NULL; PyObject* ascii_chars_b = NULL; const char* default_encoding_c; sys = PyImport_ImportModule("sys"); if (!sys) goto bad; default_encoding = PyObject_CallMethod(sys, (char*) "getdefaultencoding", NULL); Py_DECREF(sys); if (!default_encoding) goto bad; default_encoding_c = PyBytes_AsString(default_encoding); if (!default_encoding_c) goto bad; if (strcmp(default_encoding_c, "ascii") == 0) { __Pyx_sys_getdefaultencoding_not_ascii = 0; } else { char ascii_chars[128]; int c; for (c = 0; c < 128; c++) { ascii_chars[c] = c; } __Pyx_sys_getdefaultencoding_not_ascii = 1; ascii_chars_u = PyUnicode_DecodeASCII(ascii_chars, 128, NULL); if (!ascii_chars_u) goto bad; ascii_chars_b = PyUnicode_AsEncodedString(ascii_chars_u, default_encoding_c, NULL); if (!ascii_chars_b || !PyBytes_Check(ascii_chars_b) || memcmp(ascii_chars, PyBytes_AS_STRING(ascii_chars_b), 128) != 0) { PyErr_Format( PyExc_ValueError, "This module compiled with c_string_encoding=ascii, but default encoding '%.200s' is not a superset of ascii.", default_encoding_c); goto bad; } Py_DECREF(ascii_chars_u); Py_DECREF(ascii_chars_b); } Py_DECREF(default_encoding); return 0; bad: Py_XDECREF(default_encoding); Py_XDECREF(ascii_chars_u); Py_XDECREF(ascii_chars_b); return -1; } #endif #if __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT && PY_MAJOR_VERSION >= 3 #define __Pyx_PyUnicode_FromStringAndSize(c_str, size) PyUnicode_DecodeUTF8(c_str, size, NULL) #else #define __Pyx_PyUnicode_FromStringAndSize(c_str, size) PyUnicode_Decode(c_str, size, __PYX_DEFAULT_STRING_ENCODING, NULL) #if __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT static char* __PYX_DEFAULT_STRING_ENCODING; static int __Pyx_init_sys_getdefaultencoding_params(void) { PyObject* sys; PyObject* default_encoding = NULL; char* default_encoding_c; sys = PyImport_ImportModule("sys"); if (!sys) goto bad; default_encoding = PyObject_CallMethod(sys, (char*) (const char*) "getdefaultencoding", NULL); Py_DECREF(sys); if (!default_encoding) goto bad; default_encoding_c = PyBytes_AsString(default_encoding); if (!default_encoding_c) goto bad; __PYX_DEFAULT_STRING_ENCODING = (char*) malloc(strlen(default_encoding_c)); if (!__PYX_DEFAULT_STRING_ENCODING) goto bad; strcpy(__PYX_DEFAULT_STRING_ENCODING, default_encoding_c); Py_DECREF(default_encoding); return 0; bad: Py_XDECREF(default_encoding); return -1; } #endif #endif /* Test for GCC > 2.95 */ #if defined(__GNUC__) && (__GNUC__ > 2 || (__GNUC__ == 2 && (__GNUC_MINOR__ > 95))) #define likely(x) __builtin_expect(!!(x), 1) #define unlikely(x) __builtin_expect(!!(x), 0) #else /* !__GNUC__ or GCC < 2.95 */ #define likely(x) (x) #define unlikely(x) (x) #endif /* __GNUC__ */ static PyObject *__pyx_m; static PyObject *__pyx_d; static PyObject *__pyx_b; static PyObject *__pyx_empty_tuple; static PyObject *__pyx_empty_bytes; static int __pyx_lineno; static int __pyx_clineno = 0; static const char * __pyx_cfilenm= __FILE__; static const char *__pyx_filename; static const char *__pyx_f[] = { "src/pygame_sdl2/color.pyx", "src/pygame_sdl2/color.pxd", "include/color_dict.pxi", }; /*--- Type declarations ---*/ struct __pyx_obj_11pygame_sdl2_5color_Color; struct __pyx_obj_11pygame_sdl2_5color___pyx_scope_struct__correct_gamma; /* "pygame_sdl2/color.pxd":26 * cdef to_sdl_color(color, SDL_Color *out) * * cdef class Color: # <<<<<<<<<<<<<< * # Allow weak references. * cdef object __weakref__ */ struct __pyx_obj_11pygame_sdl2_5color_Color { PyObject_HEAD struct __pyx_vtabstruct_11pygame_sdl2_5color_Color *__pyx_vtab; PyObject *__weakref__; Uint8 r; Uint8 g; Uint8 b; Uint8 a; uint8_t length; }; /* "pygame_sdl2/color.pyx":452 * return self.r / 255.0, self.g / 255.0, self.b / 255.0, self.a / 255.0 * * def correct_gamma(self, gamma): # <<<<<<<<<<<<<< * m = map(lambda x: int(round(pow(x / 255.0, gamma) * 255)), tuple(self)) * c = type(self)(tuple(m)) */ struct __pyx_obj_11pygame_sdl2_5color___pyx_scope_struct__correct_gamma { PyObject_HEAD PyObject *__pyx_v_gamma; }; /* "pygame_sdl2/color.pyx":63 * out.a = color.a * * cdef class Color: # <<<<<<<<<<<<<< * cdef from_rgba(self, Uint8 r, Uint8 g, Uint8 b, Uint8 a): * self.r = r */ struct __pyx_vtabstruct_11pygame_sdl2_5color_Color { PyObject *(*from_rgba)(struct __pyx_obj_11pygame_sdl2_5color_Color *, Uint8, Uint8, Uint8, Uint8); PyObject *(*from_name)(struct __pyx_obj_11pygame_sdl2_5color_Color *, PyObject *); PyObject *(*from_hex)(struct __pyx_obj_11pygame_sdl2_5color_Color *, PyObject *); }; static struct __pyx_vtabstruct_11pygame_sdl2_5color_Color *__pyx_vtabptr_11pygame_sdl2_5color_Color; /* --- Runtime support code (head) --- */ #ifndef CYTHON_REFNANNY #define CYTHON_REFNANNY 0 #endif #if CYTHON_REFNANNY typedef struct { void (*INCREF)(void*, PyObject*, int); void (*DECREF)(void*, PyObject*, int); void (*GOTREF)(void*, PyObject*, int); void (*GIVEREF)(void*, PyObject*, int); void* (*SetupContext)(const char*, int, const char*); void (*FinishContext)(void**); } __Pyx_RefNannyAPIStruct; static __Pyx_RefNannyAPIStruct *__Pyx_RefNanny = NULL; static __Pyx_RefNannyAPIStruct *__Pyx_RefNannyImportAPI(const char *modname); #define __Pyx_RefNannyDeclarations void *__pyx_refnanny = NULL; #ifdef WITH_THREAD #define __Pyx_RefNannySetupContext(name, acquire_gil)\ if (acquire_gil) {\ PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure();\ __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), __LINE__, __FILE__);\ PyGILState_Release(__pyx_gilstate_save);\ } else {\ __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), __LINE__, __FILE__);\ } #else #define __Pyx_RefNannySetupContext(name, acquire_gil)\ __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), __LINE__, __FILE__) #endif #define __Pyx_RefNannyFinishContext()\ __Pyx_RefNanny->FinishContext(&__pyx_refnanny) #define __Pyx_INCREF(r) __Pyx_RefNanny->INCREF(__pyx_refnanny, (PyObject *)(r), __LINE__) #define __Pyx_DECREF(r) __Pyx_RefNanny->DECREF(__pyx_refnanny, (PyObject *)(r), __LINE__) #define __Pyx_GOTREF(r) __Pyx_RefNanny->GOTREF(__pyx_refnanny, (PyObject *)(r), __LINE__) #define __Pyx_GIVEREF(r) __Pyx_RefNanny->GIVEREF(__pyx_refnanny, (PyObject *)(r), __LINE__) #define __Pyx_XINCREF(r) do { if((r) != NULL) {__Pyx_INCREF(r); }} while(0) #define __Pyx_XDECREF(r) do { if((r) != NULL) {__Pyx_DECREF(r); }} while(0) #define __Pyx_XGOTREF(r) do { if((r) != NULL) {__Pyx_GOTREF(r); }} while(0) #define __Pyx_XGIVEREF(r) do { if((r) != NULL) {__Pyx_GIVEREF(r);}} while(0) #else #define __Pyx_RefNannyDeclarations #define __Pyx_RefNannySetupContext(name, acquire_gil) #define __Pyx_RefNannyFinishContext() #define __Pyx_INCREF(r) Py_INCREF(r) #define __Pyx_DECREF(r) Py_DECREF(r) #define __Pyx_GOTREF(r) #define __Pyx_GIVEREF(r) #define __Pyx_XINCREF(r) Py_XINCREF(r) #define __Pyx_XDECREF(r) Py_XDECREF(r) #define __Pyx_XGOTREF(r) #define __Pyx_XGIVEREF(r) #endif #define __Pyx_XDECREF_SET(r, v) do {\ PyObject *tmp = (PyObject *) r;\ r = v; __Pyx_XDECREF(tmp);\ } while (0) #define __Pyx_DECREF_SET(r, v) do {\ PyObject *tmp = (PyObject *) r;\ r = v; __Pyx_DECREF(tmp);\ } while (0) #define __Pyx_CLEAR(r) do { PyObject* tmp = ((PyObject*)(r)); r = NULL; __Pyx_DECREF(tmp);} while(0) #define __Pyx_XCLEAR(r) do { if((r) != NULL) {PyObject* tmp = ((PyObject*)(r)); r = NULL; __Pyx_DECREF(tmp);}} while(0) #if CYTHON_COMPILING_IN_CPYTHON static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStr(PyObject* obj, PyObject* attr_name) { PyTypeObject* tp = Py_TYPE(obj); if (likely(tp->tp_getattro)) return tp->tp_getattro(obj, attr_name); #if PY_MAJOR_VERSION < 3 if (likely(tp->tp_getattr)) return tp->tp_getattr(obj, PyString_AS_STRING(attr_name)); #endif return PyObject_GetAttr(obj, attr_name); } #else #define __Pyx_PyObject_GetAttrStr(o,n) PyObject_GetAttr(o,n) #endif static PyObject *__Pyx_GetBuiltinName(PyObject *name); static CYTHON_INLINE void __Pyx_RaiseTooManyValuesError(Py_ssize_t expected); static CYTHON_INLINE void __Pyx_RaiseNeedMoreValuesError(Py_ssize_t index); static CYTHON_INLINE int __Pyx_IterFinish(void); static int __Pyx_IternextUnpackEndCheck(PyObject *retval, Py_ssize_t expected); #if CYTHON_COMPILING_IN_CPYTHON static CYTHON_INLINE PyObject* __Pyx_PyObject_Call(PyObject *func, PyObject *arg, PyObject *kw); #else #define __Pyx_PyObject_Call(func, arg, kw) PyObject_Call(func, arg, kw) #endif static CYTHON_INLINE void __Pyx_ErrRestore(PyObject *type, PyObject *value, PyObject *tb); static CYTHON_INLINE void __Pyx_ErrFetch(PyObject **type, PyObject **value, PyObject **tb); static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, PyObject *cause); #if PY_MAJOR_VERSION < 3 #define __Pyx_PyString_Join __Pyx_PyBytes_Join #define __Pyx_PyBaseString_Join(s, v) (PyUnicode_CheckExact(s) ? PyUnicode_Join(s, v) : __Pyx_PyBytes_Join(s, v)) #else #define __Pyx_PyString_Join PyUnicode_Join #define __Pyx_PyBaseString_Join PyUnicode_Join #endif #if CYTHON_COMPILING_IN_CPYTHON #if PY_MAJOR_VERSION < 3 #define __Pyx_PyBytes_Join _PyString_Join #else #define __Pyx_PyBytes_Join _PyBytes_Join #endif #else static CYTHON_INLINE PyObject* __Pyx_PyBytes_Join(PyObject* sep, PyObject* values); #endif static PyTypeObject* __Pyx_FetchCommonType(PyTypeObject* type); #define __Pyx_CyFunction_USED 1 #include #define __Pyx_CYFUNCTION_STATICMETHOD 0x01 #define __Pyx_CYFUNCTION_CLASSMETHOD 0x02 #define __Pyx_CYFUNCTION_CCLASS 0x04 #define __Pyx_CyFunction_GetClosure(f)\ (((__pyx_CyFunctionObject *) (f))->func_closure) #define __Pyx_CyFunction_GetClassObj(f)\ (((__pyx_CyFunctionObject *) (f))->func_classobj) #define __Pyx_CyFunction_Defaults(type, f)\ ((type *)(((__pyx_CyFunctionObject *) (f))->defaults)) #define __Pyx_CyFunction_SetDefaultsGetter(f, g)\ ((__pyx_CyFunctionObject *) (f))->defaults_getter = (g) typedef struct { PyCFunctionObject func; #if PY_VERSION_HEX < 0x030500A0 PyObject *func_weakreflist; #endif PyObject *func_dict; PyObject *func_name; PyObject *func_qualname; PyObject *func_doc; PyObject *func_globals; PyObject *func_code; PyObject *func_closure; PyObject *func_classobj; void *defaults; int defaults_pyobjects; int flags; PyObject *defaults_tuple; PyObject *defaults_kwdict; PyObject *(*defaults_getter)(PyObject *); PyObject *func_annotations; } __pyx_CyFunctionObject; static PyTypeObject *__pyx_CyFunctionType = 0; #define __Pyx_CyFunction_NewEx(ml, flags, qualname, self, module, globals, code)\ __Pyx_CyFunction_New(__pyx_CyFunctionType, ml, flags, qualname, self, module, globals, code) static PyObject *__Pyx_CyFunction_New(PyTypeObject *, PyMethodDef *ml, int flags, PyObject* qualname, PyObject *self, PyObject *module, PyObject *globals, PyObject* code); static CYTHON_INLINE void *__Pyx_CyFunction_InitDefaults(PyObject *m, size_t size, int pyobjects); static CYTHON_INLINE void __Pyx_CyFunction_SetDefaultsTuple(PyObject *m, PyObject *tuple); static CYTHON_INLINE void __Pyx_CyFunction_SetDefaultsKwDict(PyObject *m, PyObject *dict); static CYTHON_INLINE void __Pyx_CyFunction_SetAnnotationsDict(PyObject *m, PyObject *dict); static int __pyx_CyFunction_init(void); static CYTHON_INLINE PyObject *__Pyx_GetModuleGlobalName(PyObject *name); #if CYTHON_COMPILING_IN_CPYTHON static CYTHON_INLINE PyObject* __Pyx_PyObject_CallMethO(PyObject *func, PyObject *arg); #endif static CYTHON_INLINE PyObject* __Pyx_PyObject_CallOneArg(PyObject *func, PyObject *arg); static CYTHON_INLINE void __Pyx_ExceptionSave(PyObject **type, PyObject **value, PyObject **tb); static void __Pyx_ExceptionReset(PyObject *type, PyObject *value, PyObject *tb); static int __Pyx_GetException(PyObject **type, PyObject **value, PyObject **tb); #if CYTHON_COMPILING_IN_CPYTHON static CYTHON_INLINE PyObject* __Pyx_PyObject_CallNoArg(PyObject *func); #else #define __Pyx_PyObject_CallNoArg(func) __Pyx_PyObject_Call(func, __pyx_empty_tuple, NULL) #endif static CYTHON_INLINE int __Pyx_ArgTypeTest(PyObject *obj, PyTypeObject *type, int none_allowed, const char *name, int exact); static void __Pyx_RaiseArgtupleInvalid(const char* func_name, int exact, Py_ssize_t num_min, Py_ssize_t num_max, Py_ssize_t num_found); static CYTHON_INLINE int __Pyx_CheckKeywordStrings(PyObject *kwdict, const char* function_name, int kw_allowed); #define __Pyx_GetItemInt(o, i, type, is_signed, to_py_func, is_list, wraparound, boundscheck)\ (__Pyx_fits_Py_ssize_t(i, type, is_signed) ?\ __Pyx_GetItemInt_Fast(o, (Py_ssize_t)i, is_list, wraparound, boundscheck) :\ (is_list ? (PyErr_SetString(PyExc_IndexError, "list index out of range"), (PyObject*)NULL) :\ __Pyx_GetItemInt_Generic(o, to_py_func(i)))) #define __Pyx_GetItemInt_List(o, i, type, is_signed, to_py_func, is_list, wraparound, boundscheck)\ (__Pyx_fits_Py_ssize_t(i, type, is_signed) ?\ __Pyx_GetItemInt_List_Fast(o, (Py_ssize_t)i, wraparound, boundscheck) :\ (PyErr_SetString(PyExc_IndexError, "list index out of range"), (PyObject*)NULL)) static CYTHON_INLINE PyObject *__Pyx_GetItemInt_List_Fast(PyObject *o, Py_ssize_t i, int wraparound, int boundscheck); #define __Pyx_GetItemInt_Tuple(o, i, type, is_signed, to_py_func, is_list, wraparound, boundscheck)\ (__Pyx_fits_Py_ssize_t(i, type, is_signed) ?\ __Pyx_GetItemInt_Tuple_Fast(o, (Py_ssize_t)i, wraparound, boundscheck) :\ (PyErr_SetString(PyExc_IndexError, "tuple index out of range"), (PyObject*)NULL)) static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Tuple_Fast(PyObject *o, Py_ssize_t i, int wraparound, int boundscheck); static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Generic(PyObject *o, PyObject* j); static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Fast(PyObject *o, Py_ssize_t i, int is_list, int wraparound, int boundscheck); static CYTHON_INLINE PyObject* __Pyx_PyObject_GetSlice( PyObject* obj, Py_ssize_t cstart, Py_ssize_t cstop, PyObject** py_start, PyObject** py_stop, PyObject** py_slice, int has_cstart, int has_cstop, int wraparound); static double __Pyx__PyObject_AsDouble(PyObject* obj); #if CYTHON_COMPILING_IN_PYPY #define __Pyx_PyObject_AsDouble(obj)\ (likely(PyFloat_CheckExact(obj)) ? PyFloat_AS_DOUBLE(obj) :\ likely(PyInt_CheckExact(obj)) ?\ PyFloat_AsDouble(obj) : __Pyx__PyObject_AsDouble(obj)) #else #define __Pyx_PyObject_AsDouble(obj)\ ((likely(PyFloat_CheckExact(obj))) ?\ PyFloat_AS_DOUBLE(obj) : __Pyx__PyObject_AsDouble(obj)) #endif #if CYTHON_COMPILING_IN_CPYTHON static PyObject* __Pyx_PyInt_EqObjC(PyObject *op1, PyObject *op2, long intval, int inplace); #else #define __Pyx_PyInt_EqObjC(op1, op2, intval, inplace)\ PyObject_RichCompare(op1, op2, Py_EQ) #endif static void __Pyx_RaiseDoubleKeywordsError(const char* func_name, PyObject* kw_name); static int __Pyx_ParseOptionalKeywords(PyObject *kwds, PyObject **argnames[],\ PyObject *kwds2, PyObject *values[], Py_ssize_t num_pos_args,\ const char* function_name); #if CYTHON_COMPILING_IN_CPYTHON static PyObject* __Pyx_PyInt_SubtractCObj(PyObject *op1, PyObject *op2, long intval, int inplace); #else #define __Pyx_PyInt_SubtractCObj(op1, op2, intval, inplace)\ (inplace ? PyNumber_InPlaceSubtract(op1, op2) : PyNumber_Subtract(op1, op2)) #endif static CYTHON_INLINE double __Pyx_mod_double(double, double); #if CYTHON_COMPILING_IN_CPYTHON static PyObject* __Pyx_PyFloat_RemainderObjC(PyObject *op1, PyObject *op2, double floatval, int inplace); #else #define __Pyx_PyFloat_RemainderObjC(op1, op2, floatval, inplace)\ (inplace ? PyNumber_InPlaceRemainder(op1, op2) : PyNumber_Remainder(op1, op2)) #endif #if CYTHON_COMPILING_IN_CPYTHON static PyObject* __Pyx_PyFloat_DivideObjC(PyObject *op1, PyObject *op2, double floatval, int inplace); #else #define __Pyx_PyFloat_DivideObjC(op1, op2, floatval, inplace)\ ((inplace ? __Pyx_PyNumber_InPlaceDivide(op1, op2) : __Pyx_PyNumber_Divide(op1, op2))) #endif static CYTHON_INLINE void __Pyx_RaiseClosureNameError(const char *varname); #define __Pyx_PyNumber_Power2(a, b) PyNumber_Power(a, b, Py_None) #include static int __Pyx_SetVtable(PyObject *dict, void *vtable); static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list, int level); typedef struct { int code_line; PyCodeObject* code_object; } __Pyx_CodeObjectCacheEntry; struct __Pyx_CodeObjectCache { int count; int max_count; __Pyx_CodeObjectCacheEntry* entries; }; static struct __Pyx_CodeObjectCache __pyx_code_cache = {0,0,NULL}; static int __pyx_bisect_code_objects(__Pyx_CodeObjectCacheEntry* entries, int count, int code_line); static PyCodeObject *__pyx_find_code_object(int code_line); static void __pyx_insert_code_object(int code_line, PyCodeObject* code_object); static void __Pyx_AddTraceback(const char *funcname, int c_line, int py_line, const char *filename); static CYTHON_INLINE int __Pyx_PyInt_As_int(PyObject *); static CYTHON_INLINE uint8_t __Pyx_PyInt_As_uint8_t(PyObject *); static CYTHON_INLINE uint32_t __Pyx_PyInt_As_uint32_t(PyObject *); static CYTHON_INLINE PyObject* __Pyx_PyInt_From_uint8_t(uint8_t value); static CYTHON_INLINE PyObject* __Pyx_PyInt_From_long(long value); static CYTHON_INLINE long __Pyx_PyInt_As_long(PyObject *); static int __Pyx_check_binary_version(void); static int __Pyx_ExportFunction(const char *name, void (*f)(void), const char *sig); static int __Pyx_InitStrings(__Pyx_StringTabEntry *t); static PyObject *__pyx_f_11pygame_sdl2_5color_5Color_from_rgba(struct __pyx_obj_11pygame_sdl2_5color_Color *__pyx_v_self, Uint8 __pyx_v_r, Uint8 __pyx_v_g, Uint8 __pyx_v_b, Uint8 __pyx_v_a); /* proto*/ static PyObject *__pyx_f_11pygame_sdl2_5color_5Color_from_hex(struct __pyx_obj_11pygame_sdl2_5color_Color *__pyx_v_self, PyObject *__pyx_v_c); /* proto*/ static PyObject *__pyx_f_11pygame_sdl2_5color_5Color_from_name(struct __pyx_obj_11pygame_sdl2_5color_Color *__pyx_v_self, PyObject *__pyx_v_c); /* proto*/ /* Module declarations from 'libc.stdint' */ /* Module declarations from 'libc.string' */ /* Module declarations from 'libc.stdio' */ /* Module declarations from 'libc.stddef' */ /* Module declarations from 'sdl2' */ /* Module declarations from 'pygame_sdl2.color' */ static PyTypeObject *__pyx_ptype_11pygame_sdl2_5color_Color = 0; static PyTypeObject *__pyx_ptype_11pygame_sdl2_5color___pyx_scope_struct__correct_gamma = 0; static PyObject *__pyx_v_11pygame_sdl2_5color_colors = 0; #define __Pyx_MODULE_NAME "pygame_sdl2.color" int __pyx_module_is_main_pygame_sdl2__color = 0; /* Implementation of 'pygame_sdl2.color' */ static PyObject *__pyx_builtin_TypeError; static PyObject *__pyx_builtin_map; static PyObject *__pyx_builtin_ValueError; static PyObject *__pyx_builtin_KeyError; static PyObject *__pyx_builtin_hex; static PyObject *__pyx_builtin_oct; static PyObject *__pyx_builtin_IndexError; static PyObject *__pyx_builtin_round; static char __pyx_k_L[] = ">L"; static char __pyx_k_a[] = "a"; static char __pyx_k_b[] = "b"; static char __pyx_k_g[] = "g"; static char __pyx_k_l[] = "l"; static char __pyx_k_r[] = "r"; static char __pyx_k_0x[] = "0x"; static char __pyx_k__2[] = ""; static char __pyx_k__3[] = "#"; static char __pyx_k_08x[] = "%08x"; static char __pyx_k_BBB[] = "BBB"; static char __pyx_k_div[] = "div"; static char __pyx_k_hex[] = "hex"; static char __pyx_k_map[] = "map"; static char __pyx_k_mod[] = "mod"; static char __pyx_k_oct[] = "oct"; static char __pyx_k_red[] = "red"; static char __pyx_k_tan[] = "tan"; static char __pyx_k_BBBB[] = "BBBB"; static char __pyx_k_aqua[] = "aqua"; static char __pyx_k_blue[] = "blue"; static char __pyx_k_cyan[] = "cyan"; static char __pyx_k_gold[] = "gold"; static char __pyx_k_gray[] = "gray"; static char __pyx_k_grey[] = "grey"; static char __pyx_k_hsva[] = "hsva"; static char __pyx_k_join[] = "join"; static char __pyx_k_lime[] = "lime"; static char __pyx_k_main[] = "__main__"; static char __pyx_k_navy[] = "navy"; static char __pyx_k_pack[] = "pack"; static char __pyx_k_peru[] = "peru"; static char __pyx_k_pink[] = "pink"; static char __pyx_k_plum[] = "plum"; static char __pyx_k_red1[] = "red1"; static char __pyx_k_red2[] = "red2"; static char __pyx_k_red3[] = "red3"; static char __pyx_k_red4[] = "red4"; static char __pyx_k_rgba[] = "rgba"; static char __pyx_k_snow[] = "snow"; static char __pyx_k_tan1[] = "tan1"; static char __pyx_k_tan2[] = "tan2"; static char __pyx_k_tan3[] = "tan3"; static char __pyx_k_tan4[] = "tan4"; static char __pyx_k_teal[] = "teal"; static char __pyx_k_test[] = "__test__"; static char __pyx_k_azure[] = "azure"; static char __pyx_k_beige[] = "beige"; static char __pyx_k_black[] = "black"; static char __pyx_k_blue1[] = "blue1"; static char __pyx_k_blue2[] = "blue2"; static char __pyx_k_blue3[] = "blue3"; static char __pyx_k_blue4[] = "blue4"; static char __pyx_k_brown[] = "brown"; static char __pyx_k_coral[] = "coral"; static char __pyx_k_cyan1[] = "cyan1"; static char __pyx_k_cyan2[] = "cyan2"; static char __pyx_k_cyan3[] = "cyan3"; static char __pyx_k_cyan4[] = "cyan4"; static char __pyx_k_gold1[] = "gold1"; static char __pyx_k_gold2[] = "gold2"; static char __pyx_k_gold3[] = "gold3"; static char __pyx_k_gold4[] = "gold4"; static char __pyx_k_gray0[] = "gray0"; static char __pyx_k_gray1[] = "gray1"; static char __pyx_k_gray2[] = "gray2"; static char __pyx_k_gray3[] = "gray3"; static char __pyx_k_gray4[] = "gray4"; static char __pyx_k_gray5[] = "gray5"; static char __pyx_k_gray6[] = "gray6"; static char __pyx_k_gray7[] = "gray7"; static char __pyx_k_gray8[] = "gray8"; static char __pyx_k_gray9[] = "gray9"; static char __pyx_k_green[] = "green"; static char __pyx_k_grey0[] = "grey0"; static char __pyx_k_grey1[] = "grey1"; static char __pyx_k_grey2[] = "grey2"; static char __pyx_k_grey3[] = "grey3"; static char __pyx_k_grey4[] = "grey4"; static char __pyx_k_grey5[] = "grey5"; static char __pyx_k_grey6[] = "grey6"; static char __pyx_k_grey7[] = "grey7"; static char __pyx_k_grey8[] = "grey8"; static char __pyx_k_grey9[] = "grey9"; static char __pyx_k_ivory[] = "ivory"; static char __pyx_k_khaki[] = "khaki"; static char __pyx_k_linen[] = "linen"; static char __pyx_k_lower[] = "lower"; static char __pyx_k_olive[] = "olive"; static char __pyx_k_pink1[] = "pink1"; static char __pyx_k_pink2[] = "pink2"; static char __pyx_k_pink3[] = "pink3"; static char __pyx_k_pink4[] = "pink4"; static char __pyx_k_plum1[] = "plum1"; static char __pyx_k_plum2[] = "plum2"; static char __pyx_k_plum3[] = "plum3"; static char __pyx_k_plum4[] = "plum4"; static char __pyx_k_round[] = "round"; static char __pyx_k_snow1[] = "snow1"; static char __pyx_k_snow2[] = "snow2"; static char __pyx_k_snow3[] = "snow3"; static char __pyx_k_snow4[] = "snow4"; static char __pyx_k_split[] = "split"; static char __pyx_k_wheat[] = "wheat"; static char __pyx_k_white[] = "white"; static char __pyx_k_azure1[] = "azure1"; static char __pyx_k_azure2[] = "azure2"; static char __pyx_k_azure3[] = "azure3"; static char __pyx_k_azure4[] = "azure4"; static char __pyx_k_bisque[] = "bisque"; static char __pyx_k_brown1[] = "brown1"; static char __pyx_k_brown2[] = "brown2"; static char __pyx_k_brown3[] = "brown3"; static char __pyx_k_brown4[] = "brown4"; static char __pyx_k_coral1[] = "coral1"; static char __pyx_k_coral2[] = "coral2"; static char __pyx_k_coral3[] = "coral3"; static char __pyx_k_coral4[] = "coral4"; static char __pyx_k_gray10[] = "gray10"; static char __pyx_k_gray11[] = "gray11"; static char __pyx_k_gray12[] = "gray12"; static char __pyx_k_gray13[] = "gray13"; static char __pyx_k_gray14[] = "gray14"; static char __pyx_k_gray15[] = "gray15"; static char __pyx_k_gray16[] = "gray16"; static char __pyx_k_gray17[] = "gray17"; static char __pyx_k_gray18[] = "gray18"; static char __pyx_k_gray19[] = "gray19"; static char __pyx_k_gray20[] = "gray20"; static char __pyx_k_gray21[] = "gray21"; static char __pyx_k_gray22[] = "gray22"; static char __pyx_k_gray23[] = "gray23"; static char __pyx_k_gray24[] = "gray24"; static char __pyx_k_gray25[] = "gray25"; static char __pyx_k_gray26[] = "gray26"; static char __pyx_k_gray27[] = "gray27"; static char __pyx_k_gray28[] = "gray28"; static char __pyx_k_gray29[] = "gray29"; static char __pyx_k_gray30[] = "gray30"; static char __pyx_k_gray31[] = "gray31"; static char __pyx_k_gray32[] = "gray32"; static char __pyx_k_gray33[] = "gray33"; static char __pyx_k_gray34[] = "gray34"; static char __pyx_k_gray35[] = "gray35"; static char __pyx_k_gray36[] = "gray36"; static char __pyx_k_gray37[] = "gray37"; static char __pyx_k_gray38[] = "gray38"; static char __pyx_k_gray39[] = "gray39"; static char __pyx_k_gray40[] = "gray40"; static char __pyx_k_gray41[] = "gray41"; static char __pyx_k_gray42[] = "gray42"; static char __pyx_k_gray43[] = "gray43"; static char __pyx_k_gray44[] = "gray44"; static char __pyx_k_gray45[] = "gray45"; static char __pyx_k_gray46[] = "gray46"; static char __pyx_k_gray47[] = "gray47"; static char __pyx_k_gray48[] = "gray48"; static char __pyx_k_gray49[] = "gray49"; static char __pyx_k_gray50[] = "gray50"; static char __pyx_k_gray51[] = "gray51"; static char __pyx_k_gray52[] = "gray52"; static char __pyx_k_gray53[] = "gray53"; static char __pyx_k_gray54[] = "gray54"; static char __pyx_k_gray55[] = "gray55"; static char __pyx_k_gray56[] = "gray56"; static char __pyx_k_gray57[] = "gray57"; static char __pyx_k_gray58[] = "gray58"; static char __pyx_k_gray59[] = "gray59"; static char __pyx_k_gray60[] = "gray60"; static char __pyx_k_gray61[] = "gray61"; static char __pyx_k_gray62[] = "gray62"; static char __pyx_k_gray63[] = "gray63"; static char __pyx_k_gray64[] = "gray64"; static char __pyx_k_gray65[] = "gray65"; static char __pyx_k_gray66[] = "gray66"; static char __pyx_k_gray67[] = "gray67"; static char __pyx_k_gray68[] = "gray68"; static char __pyx_k_gray69[] = "gray69"; static char __pyx_k_gray70[] = "gray70"; static char __pyx_k_gray71[] = "gray71"; static char __pyx_k_gray72[] = "gray72"; static char __pyx_k_gray73[] = "gray73"; static char __pyx_k_gray74[] = "gray74"; static char __pyx_k_gray75[] = "gray75"; static char __pyx_k_gray76[] = "gray76"; static char __pyx_k_gray77[] = "gray77"; static char __pyx_k_gray78[] = "gray78"; static char __pyx_k_gray79[] = "gray79"; static char __pyx_k_gray80[] = "gray80"; static char __pyx_k_gray81[] = "gray81"; static char __pyx_k_gray82[] = "gray82"; static char __pyx_k_gray83[] = "gray83"; static char __pyx_k_gray84[] = "gray84"; static char __pyx_k_gray85[] = "gray85"; static char __pyx_k_gray86[] = "gray86"; static char __pyx_k_gray87[] = "gray87"; static char __pyx_k_gray88[] = "gray88"; static char __pyx_k_gray89[] = "gray89"; static char __pyx_k_gray90[] = "gray90"; static char __pyx_k_gray91[] = "gray91"; static char __pyx_k_gray92[] = "gray92"; static char __pyx_k_gray93[] = "gray93"; static char __pyx_k_gray94[] = "gray94"; static char __pyx_k_gray95[] = "gray95"; static char __pyx_k_gray96[] = "gray96"; static char __pyx_k_gray97[] = "gray97"; static char __pyx_k_gray98[] = "gray98"; static char __pyx_k_gray99[] = "gray99"; static char __pyx_k_green1[] = "green1"; static char __pyx_k_green2[] = "green2"; static char __pyx_k_green3[] = "green3"; static char __pyx_k_green4[] = "green4"; static char __pyx_k_grey10[] = "grey10"; static char __pyx_k_grey11[] = "grey11"; static char __pyx_k_grey12[] = "grey12"; static char __pyx_k_grey13[] = "grey13"; static char __pyx_k_grey14[] = "grey14"; static char __pyx_k_grey15[] = "grey15"; static char __pyx_k_grey16[] = "grey16"; static char __pyx_k_grey17[] = "grey17"; static char __pyx_k_grey18[] = "grey18"; static char __pyx_k_grey19[] = "grey19"; static char __pyx_k_grey20[] = "grey20"; static char __pyx_k_grey21[] = "grey21"; static char __pyx_k_grey22[] = "grey22"; static char __pyx_k_grey23[] = "grey23"; static char __pyx_k_grey24[] = "grey24"; static char __pyx_k_grey25[] = "grey25"; static char __pyx_k_grey26[] = "grey26"; static char __pyx_k_grey27[] = "grey27"; static char __pyx_k_grey28[] = "grey28"; static char __pyx_k_grey29[] = "grey29"; static char __pyx_k_grey30[] = "grey30"; static char __pyx_k_grey31[] = "grey31"; static char __pyx_k_grey32[] = "grey32"; static char __pyx_k_grey33[] = "grey33"; static char __pyx_k_grey34[] = "grey34"; static char __pyx_k_grey35[] = "grey35"; static char __pyx_k_grey36[] = "grey36"; static char __pyx_k_grey37[] = "grey37"; static char __pyx_k_grey38[] = "grey38"; static char __pyx_k_grey39[] = "grey39"; static char __pyx_k_grey40[] = "grey40"; static char __pyx_k_grey41[] = "grey41"; static char __pyx_k_grey42[] = "grey42"; static char __pyx_k_grey43[] = "grey43"; static char __pyx_k_grey44[] = "grey44"; static char __pyx_k_grey45[] = "grey45"; static char __pyx_k_grey46[] = "grey46"; static char __pyx_k_grey47[] = "grey47"; static char __pyx_k_grey48[] = "grey48"; static char __pyx_k_grey49[] = "grey49"; static char __pyx_k_grey50[] = "grey50"; static char __pyx_k_grey51[] = "grey51"; static char __pyx_k_grey52[] = "grey52"; static char __pyx_k_grey53[] = "grey53"; static char __pyx_k_grey54[] = "grey54"; static char __pyx_k_grey55[] = "grey55"; static char __pyx_k_grey56[] = "grey56"; static char __pyx_k_grey57[] = "grey57"; static char __pyx_k_grey58[] = "grey58"; static char __pyx_k_grey59[] = "grey59"; static char __pyx_k_grey60[] = "grey60"; static char __pyx_k_grey61[] = "grey61"; static char __pyx_k_grey62[] = "grey62"; static char __pyx_k_grey63[] = "grey63"; static char __pyx_k_grey64[] = "grey64"; static char __pyx_k_grey65[] = "grey65"; static char __pyx_k_grey66[] = "grey66"; static char __pyx_k_grey67[] = "grey67"; static char __pyx_k_grey68[] = "grey68"; static char __pyx_k_grey69[] = "grey69"; static char __pyx_k_grey70[] = "grey70"; static char __pyx_k_grey71[] = "grey71"; static char __pyx_k_grey72[] = "grey72"; static char __pyx_k_grey73[] = "grey73"; static char __pyx_k_grey74[] = "grey74"; static char __pyx_k_grey75[] = "grey75"; static char __pyx_k_grey76[] = "grey76"; static char __pyx_k_grey77[] = "grey77"; static char __pyx_k_grey78[] = "grey78"; static char __pyx_k_grey79[] = "grey79"; static char __pyx_k_grey80[] = "grey80"; static char __pyx_k_grey81[] = "grey81"; static char __pyx_k_grey82[] = "grey82"; static char __pyx_k_grey83[] = "grey83"; static char __pyx_k_grey84[] = "grey84"; static char __pyx_k_grey85[] = "grey85"; static char __pyx_k_grey86[] = "grey86"; static char __pyx_k_grey87[] = "grey87"; static char __pyx_k_grey88[] = "grey88"; static char __pyx_k_grey89[] = "grey89"; static char __pyx_k_grey90[] = "grey90"; static char __pyx_k_grey91[] = "grey91"; static char __pyx_k_grey92[] = "grey92"; static char __pyx_k_grey93[] = "grey93"; static char __pyx_k_grey94[] = "grey94"; static char __pyx_k_grey95[] = "grey95"; static char __pyx_k_grey96[] = "grey96"; static char __pyx_k_grey97[] = "grey97"; static char __pyx_k_grey98[] = "grey98"; static char __pyx_k_grey99[] = "grey99"; static char __pyx_k_import[] = "__import__"; static char __pyx_k_indigo[] = "indigo"; static char __pyx_k_ivory1[] = "ivory1"; static char __pyx_k_ivory2[] = "ivory2"; static char __pyx_k_ivory3[] = "ivory3"; static char __pyx_k_ivory4[] = "ivory4"; static char __pyx_k_khaki1[] = "khaki1"; static char __pyx_k_khaki2[] = "khaki2"; static char __pyx_k_khaki3[] = "khaki3"; static char __pyx_k_khaki4[] = "khaki4"; static char __pyx_k_maroon[] = "maroon"; static char __pyx_k_orange[] = "orange"; static char __pyx_k_orchid[] = "orchid"; static char __pyx_k_purple[] = "purple"; static char __pyx_k_salmon[] = "salmon"; static char __pyx_k_sienna[] = "sienna"; static char __pyx_k_silver[] = "silver"; static char __pyx_k_struct[] = "struct"; static char __pyx_k_tomato[] = "tomato"; static char __pyx_k_unpack[] = "unpack"; static char __pyx_k_violet[] = "violet"; static char __pyx_k_wheat1[] = "wheat1"; static char __pyx_k_wheat2[] = "wheat2"; static char __pyx_k_wheat3[] = "wheat3"; static char __pyx_k_wheat4[] = "wheat4"; static char __pyx_k_yellow[] = "yellow"; static char __pyx_k_bisque1[] = "bisque1"; static char __pyx_k_bisque2[] = "bisque2"; static char __pyx_k_bisque3[] = "bisque3"; static char __pyx_k_bisque4[] = "bisque4"; static char __pyx_k_crimson[] = "crimson"; static char __pyx_k_darkred[] = "darkred"; static char __pyx_k_dimgray[] = "dimgray"; static char __pyx_k_dimgrey[] = "dimgrey"; static char __pyx_k_fuchsia[] = "fuchsia"; static char __pyx_k_gray100[] = "gray100"; static char __pyx_k_grey100[] = "grey100"; static char __pyx_k_hotpink[] = "hotpink"; static char __pyx_k_magenta[] = "magenta"; static char __pyx_k_maroon1[] = "maroon1"; static char __pyx_k_maroon2[] = "maroon2"; static char __pyx_k_maroon3[] = "maroon3"; static char __pyx_k_maroon4[] = "maroon4"; static char __pyx_k_oldlace[] = "oldlace"; static char __pyx_k_orange1[] = "orange1"; static char __pyx_k_orange2[] = "orange2"; static char __pyx_k_orange3[] = "orange3"; static char __pyx_k_orange4[] = "orange4"; static char __pyx_k_orchid1[] = "orchid1"; static char __pyx_k_orchid2[] = "orchid2"; static char __pyx_k_orchid3[] = "orchid3"; static char __pyx_k_orchid4[] = "orchid4"; static char __pyx_k_purple1[] = "purple1"; static char __pyx_k_purple2[] = "purple2"; static char __pyx_k_purple3[] = "purple3"; static char __pyx_k_purple4[] = "purple4"; static char __pyx_k_salmon1[] = "salmon1"; static char __pyx_k_salmon2[] = "salmon2"; static char __pyx_k_salmon3[] = "salmon3"; static char __pyx_k_salmon4[] = "salmon4"; static char __pyx_k_sienna1[] = "sienna1"; static char __pyx_k_sienna2[] = "sienna2"; static char __pyx_k_sienna3[] = "sienna3"; static char __pyx_k_sienna4[] = "sienna4"; static char __pyx_k_skyblue[] = "skyblue"; static char __pyx_k_thistle[] = "thistle"; static char __pyx_k_tomato1[] = "tomato1"; static char __pyx_k_tomato2[] = "tomato2"; static char __pyx_k_tomato3[] = "tomato3"; static char __pyx_k_tomato4[] = "tomato4"; static char __pyx_k_webgray[] = "webgray"; static char __pyx_k_webgrey[] = "webgrey"; static char __pyx_k_x11gray[] = "x11gray"; static char __pyx_k_x11grey[] = "x11grey"; static char __pyx_k_yellow1[] = "yellow1"; static char __pyx_k_yellow2[] = "yellow2"; static char __pyx_k_yellow3[] = "yellow3"; static char __pyx_k_yellow4[] = "yellow4"; static char __pyx_k_KeyError[] = "KeyError"; static char __pyx_k_binascii[] = "binascii"; static char __pyx_k_cornsilk[] = "cornsilk"; static char __pyx_k_darkblue[] = "darkblue"; static char __pyx_k_darkcyan[] = "darkcyan"; static char __pyx_k_darkgray[] = "darkgray"; static char __pyx_k_darkgrey[] = "darkgrey"; static char __pyx_k_deeppink[] = "deeppink"; static char __pyx_k_honeydew[] = "honeydew"; static char __pyx_k_hotpink1[] = "hotpink1"; static char __pyx_k_hotpink2[] = "hotpink2"; static char __pyx_k_hotpink3[] = "hotpink3"; static char __pyx_k_hotpink4[] = "hotpink4"; static char __pyx_k_lavender[] = "lavender"; static char __pyx_k_magenta1[] = "magenta1"; static char __pyx_k_magenta2[] = "magenta2"; static char __pyx_k_magenta3[] = "magenta3"; static char __pyx_k_magenta4[] = "magenta4"; static char __pyx_k_moccasin[] = "moccasin"; static char __pyx_k_navyblue[] = "navyblue"; static char __pyx_k_seagreen[] = "seagreen"; static char __pyx_k_seashell[] = "seashell"; static char __pyx_k_skyblue1[] = "skyblue1"; static char __pyx_k_skyblue2[] = "skyblue2"; static char __pyx_k_skyblue3[] = "skyblue3"; static char __pyx_k_skyblue4[] = "skyblue4"; static char __pyx_k_thistle1[] = "thistle1"; static char __pyx_k_thistle2[] = "thistle2"; static char __pyx_k_thistle3[] = "thistle3"; static char __pyx_k_thistle4[] = "thistle4"; static char __pyx_k_webgreen[] = "webgreen"; static char __pyx_k_x11green[] = "x11green"; static char __pyx_k_TypeError[] = "TypeError"; static char __pyx_k_aliceblue[] = "aliceblue"; static char __pyx_k_burlywood[] = "burlywood"; static char __pyx_k_cadetblue[] = "cadetblue"; static char __pyx_k_chocolate[] = "chocolate"; static char __pyx_k_cornsilk1[] = "cornsilk1"; static char __pyx_k_cornsilk2[] = "cornsilk2"; static char __pyx_k_cornsilk3[] = "cornsilk3"; static char __pyx_k_cornsilk4[] = "cornsilk4"; static char __pyx_k_darkgreen[] = "darkgreen"; static char __pyx_k_darkkhaki[] = "darkkhaki"; static char __pyx_k_deeppink1[] = "deeppink1"; static char __pyx_k_deeppink2[] = "deeppink2"; static char __pyx_k_deeppink3[] = "deeppink3"; static char __pyx_k_deeppink4[] = "deeppink4"; static char __pyx_k_firebrick[] = "firebrick"; static char __pyx_k_gainsboro[] = "gainsboro"; static char __pyx_k_goldenrod[] = "goldenrod"; static char __pyx_k_honeydew1[] = "honeydew1"; static char __pyx_k_honeydew2[] = "honeydew2"; static char __pyx_k_honeydew3[] = "honeydew3"; static char __pyx_k_honeydew4[] = "honeydew4"; static char __pyx_k_indianred[] = "indianred"; static char __pyx_k_lawngreen[] = "lawngreen"; static char __pyx_k_lightblue[] = "lightblue"; static char __pyx_k_lightcyan[] = "lightcyan"; static char __pyx_k_lightgray[] = "lightgray"; static char __pyx_k_lightgrey[] = "lightgrey"; static char __pyx_k_lightpink[] = "lightpink"; static char __pyx_k_limegreen[] = "limegreen"; static char __pyx_k_mintcream[] = "mintcream"; static char __pyx_k_mistyrose[] = "mistyrose"; static char __pyx_k_olivedrab[] = "olivedrab"; static char __pyx_k_orangered[] = "orangered"; static char __pyx_k_palegreen[] = "palegreen"; static char __pyx_k_peachpuff[] = "peachpuff"; static char __pyx_k_rosybrown[] = "rosybrown"; static char __pyx_k_royalblue[] = "royalblue"; static char __pyx_k_seagreen1[] = "seagreen1"; static char __pyx_k_seagreen2[] = "seagreen2"; static char __pyx_k_seagreen3[] = "seagreen3"; static char __pyx_k_seagreen4[] = "seagreen4"; static char __pyx_k_seashell1[] = "seashell1"; static char __pyx_k_seashell2[] = "seashell2"; static char __pyx_k_seashell3[] = "seashell3"; static char __pyx_k_seashell4[] = "seashell4"; static char __pyx_k_slateblue[] = "slateblue"; static char __pyx_k_slategray[] = "slategray"; static char __pyx_k_slategrey[] = "slategrey"; static char __pyx_k_steelblue[] = "steelblue"; static char __pyx_k_turquoise[] = "turquoise"; static char __pyx_k_unhexlify[] = "unhexlify"; static char __pyx_k_violetred[] = "violetred"; static char __pyx_k_webmaroon[] = "webmaroon"; static char __pyx_k_webpurple[] = "webpurple"; static char __pyx_k_x11maroon[] = "x11maroon"; static char __pyx_k_x11purple[] = "x11purple"; static char __pyx_k_IndexError[] = "IndexError"; static char __pyx_k_ValueError[] = "ValueError"; static char __pyx_k_aquamarine[] = "aquamarine"; static char __pyx_k_blueviolet[] = "blueviolet"; static char __pyx_k_burlywood1[] = "burlywood1"; static char __pyx_k_burlywood2[] = "burlywood2"; static char __pyx_k_burlywood3[] = "burlywood3"; static char __pyx_k_burlywood4[] = "burlywood4"; static char __pyx_k_cadetblue1[] = "cadetblue1"; static char __pyx_k_cadetblue2[] = "cadetblue2"; static char __pyx_k_cadetblue3[] = "cadetblue3"; static char __pyx_k_cadetblue4[] = "cadetblue4"; static char __pyx_k_chartreuse[] = "chartreuse"; static char __pyx_k_chocolate1[] = "chocolate1"; static char __pyx_k_chocolate2[] = "chocolate2"; static char __pyx_k_chocolate3[] = "chocolate3"; static char __pyx_k_chocolate4[] = "chocolate4"; static char __pyx_k_darkorange[] = "darkorange"; static char __pyx_k_darkorchid[] = "darkorchid"; static char __pyx_k_darksalmon[] = "darksalmon"; static char __pyx_k_darkviolet[] = "darkviolet"; static char __pyx_k_dodgerblue[] = "dodgerblue"; static char __pyx_k_firebrick1[] = "firebrick1"; static char __pyx_k_firebrick2[] = "firebrick2"; static char __pyx_k_firebrick3[] = "firebrick3"; static char __pyx_k_firebrick4[] = "firebrick4"; static char __pyx_k_ghostwhite[] = "ghostwhite"; static char __pyx_k_goldenrod1[] = "goldenrod1"; static char __pyx_k_goldenrod2[] = "goldenrod2"; static char __pyx_k_goldenrod3[] = "goldenrod3"; static char __pyx_k_goldenrod4[] = "goldenrod4"; static char __pyx_k_indianred1[] = "indianred1"; static char __pyx_k_indianred2[] = "indianred2"; static char __pyx_k_indianred3[] = "indianred3"; static char __pyx_k_indianred4[] = "indianred4"; static char __pyx_k_lightblue1[] = "lightblue1"; static char __pyx_k_lightblue2[] = "lightblue2"; static char __pyx_k_lightblue3[] = "lightblue3"; static char __pyx_k_lightblue4[] = "lightblue4"; static char __pyx_k_lightcoral[] = "lightcoral"; static char __pyx_k_lightcyan1[] = "lightcyan1"; static char __pyx_k_lightcyan2[] = "lightcyan2"; static char __pyx_k_lightcyan3[] = "lightcyan3"; static char __pyx_k_lightcyan4[] = "lightcyan4"; static char __pyx_k_lightgreen[] = "lightgreen"; static char __pyx_k_lightpink1[] = "lightpink1"; static char __pyx_k_lightpink2[] = "lightpink2"; static char __pyx_k_lightpink3[] = "lightpink3"; static char __pyx_k_lightpink4[] = "lightpink4"; static char __pyx_k_mediumblue[] = "mediumblue"; static char __pyx_k_mistyrose1[] = "mistyrose1"; static char __pyx_k_mistyrose2[] = "mistyrose2"; static char __pyx_k_mistyrose3[] = "mistyrose3"; static char __pyx_k_mistyrose4[] = "mistyrose4"; static char __pyx_k_olivedrab1[] = "olivedrab1"; static char __pyx_k_olivedrab2[] = "olivedrab2"; static char __pyx_k_olivedrab3[] = "olivedrab3"; static char __pyx_k_olivedrab4[] = "olivedrab4"; static char __pyx_k_orangered1[] = "orangered1"; static char __pyx_k_orangered2[] = "orangered2"; static char __pyx_k_orangered3[] = "orangered3"; static char __pyx_k_orangered4[] = "orangered4"; static char __pyx_k_palegreen1[] = "palegreen1"; static char __pyx_k_palegreen2[] = "palegreen2"; static char __pyx_k_palegreen3[] = "palegreen3"; static char __pyx_k_palegreen4[] = "palegreen4"; static char __pyx_k_papayawhip[] = "papayawhip"; static char __pyx_k_peachpuff1[] = "peachpuff1"; static char __pyx_k_peachpuff2[] = "peachpuff2"; static char __pyx_k_peachpuff3[] = "peachpuff3"; static char __pyx_k_peachpuff4[] = "peachpuff4"; static char __pyx_k_powderblue[] = "powderblue"; static char __pyx_k_pyx_vtable[] = "__pyx_vtable__"; static char __pyx_k_rosybrown1[] = "rosybrown1"; static char __pyx_k_rosybrown2[] = "rosybrown2"; static char __pyx_k_rosybrown3[] = "rosybrown3"; static char __pyx_k_rosybrown4[] = "rosybrown4"; static char __pyx_k_royalblue1[] = "royalblue1"; static char __pyx_k_royalblue2[] = "royalblue2"; static char __pyx_k_royalblue3[] = "royalblue3"; static char __pyx_k_royalblue4[] = "royalblue4"; static char __pyx_k_sandybrown[] = "sandybrown"; static char __pyx_k_slateblue1[] = "slateblue1"; static char __pyx_k_slateblue2[] = "slateblue2"; static char __pyx_k_slateblue3[] = "slateblue3"; static char __pyx_k_slateblue4[] = "slateblue4"; static char __pyx_k_slategray1[] = "slategray1"; static char __pyx_k_slategray2[] = "slategray2"; static char __pyx_k_slategray3[] = "slategray3"; static char __pyx_k_slategray4[] = "slategray4"; static char __pyx_k_startswith[] = "startswith"; static char __pyx_k_steelblue1[] = "steelblue1"; static char __pyx_k_steelblue2[] = "steelblue2"; static char __pyx_k_steelblue3[] = "steelblue3"; static char __pyx_k_steelblue4[] = "steelblue4"; static char __pyx_k_turquoise1[] = "turquoise1"; static char __pyx_k_turquoise2[] = "turquoise2"; static char __pyx_k_turquoise3[] = "turquoise3"; static char __pyx_k_turquoise4[] = "turquoise4"; static char __pyx_k_violetred1[] = "violetred1"; static char __pyx_k_violetred2[] = "violetred2"; static char __pyx_k_violetred3[] = "violetred3"; static char __pyx_k_violetred4[] = "violetred4"; static char __pyx_k_whitesmoke[] = "whitesmoke"; static char __pyx_k_aquamarine1[] = "aquamarine1"; static char __pyx_k_aquamarine2[] = "aquamarine2"; static char __pyx_k_aquamarine3[] = "aquamarine3"; static char __pyx_k_aquamarine4[] = "aquamarine4"; static char __pyx_k_chartreuse1[] = "chartreuse1"; static char __pyx_k_chartreuse2[] = "chartreuse2"; static char __pyx_k_chartreuse3[] = "chartreuse3"; static char __pyx_k_chartreuse4[] = "chartreuse4"; static char __pyx_k_darkmagenta[] = "darkmagenta"; static char __pyx_k_darkorange1[] = "darkorange1"; static char __pyx_k_darkorange2[] = "darkorange2"; static char __pyx_k_darkorange3[] = "darkorange3"; static char __pyx_k_darkorange4[] = "darkorange4"; static char __pyx_k_darkorchid1[] = "darkorchid1"; static char __pyx_k_darkorchid2[] = "darkorchid2"; static char __pyx_k_darkorchid3[] = "darkorchid3"; static char __pyx_k_darkorchid4[] = "darkorchid4"; static char __pyx_k_deepskyblue[] = "deepskyblue"; static char __pyx_k_dodgerblue1[] = "dodgerblue1"; static char __pyx_k_dodgerblue2[] = "dodgerblue2"; static char __pyx_k_dodgerblue3[] = "dodgerblue3"; static char __pyx_k_dodgerblue4[] = "dodgerblue4"; static char __pyx_k_floralwhite[] = "floralwhite"; static char __pyx_k_forestgreen[] = "forestgreen"; static char __pyx_k_greenyellow[] = "greenyellow"; static char __pyx_k_lightsalmon[] = "lightsalmon"; static char __pyx_k_lightyellow[] = "lightyellow"; static char __pyx_k_navajowhite[] = "navajowhite"; static char __pyx_k_saddlebrown[] = "saddlebrown"; static char __pyx_k_springgreen[] = "springgreen"; static char __pyx_k_yellowgreen[] = "yellowgreen"; static char __pyx_k_antiquewhite[] = "antiquewhite"; static char __pyx_k_darkseagreen[] = "darkseagreen"; static char __pyx_k_deepskyblue1[] = "deepskyblue1"; static char __pyx_k_deepskyblue2[] = "deepskyblue2"; static char __pyx_k_deepskyblue3[] = "deepskyblue3"; static char __pyx_k_deepskyblue4[] = "deepskyblue4"; static char __pyx_k_lemonchiffon[] = "lemonchiffon"; static char __pyx_k_lightsalmon1[] = "lightsalmon1"; static char __pyx_k_lightsalmon2[] = "lightsalmon2"; static char __pyx_k_lightsalmon3[] = "lightsalmon3"; static char __pyx_k_lightsalmon4[] = "lightsalmon4"; static char __pyx_k_lightskyblue[] = "lightskyblue"; static char __pyx_k_lightyellow1[] = "lightyellow1"; static char __pyx_k_lightyellow2[] = "lightyellow2"; static char __pyx_k_lightyellow3[] = "lightyellow3"; static char __pyx_k_lightyellow4[] = "lightyellow4"; static char __pyx_k_mediumorchid[] = "mediumorchid"; static char __pyx_k_mediumpurple[] = "mediumpurple"; static char __pyx_k_midnightblue[] = "midnightblue"; static char __pyx_k_navajowhite1[] = "navajowhite1"; static char __pyx_k_navajowhite2[] = "navajowhite2"; static char __pyx_k_navajowhite3[] = "navajowhite3"; static char __pyx_k_navajowhite4[] = "navajowhite4"; static char __pyx_k_springgreen1[] = "springgreen1"; static char __pyx_k_springgreen2[] = "springgreen2"; static char __pyx_k_springgreen3[] = "springgreen3"; static char __pyx_k_springgreen4[] = "springgreen4"; static char __pyx_k_antiquewhite1[] = "antiquewhite1"; static char __pyx_k_antiquewhite2[] = "antiquewhite2"; static char __pyx_k_antiquewhite3[] = "antiquewhite3"; static char __pyx_k_antiquewhite4[] = "antiquewhite4"; static char __pyx_k_darkgoldenrod[] = "darkgoldenrod"; static char __pyx_k_darkseagreen1[] = "darkseagreen1"; static char __pyx_k_darkseagreen2[] = "darkseagreen2"; static char __pyx_k_darkseagreen3[] = "darkseagreen3"; static char __pyx_k_darkseagreen4[] = "darkseagreen4"; static char __pyx_k_darkslateblue[] = "darkslateblue"; static char __pyx_k_darkslategray[] = "darkslategray"; static char __pyx_k_darkslategrey[] = "darkslategrey"; static char __pyx_k_darkturquoise[] = "darkturquoise"; static char __pyx_k_lavenderblush[] = "lavenderblush"; static char __pyx_k_lemonchiffon1[] = "lemonchiffon1"; static char __pyx_k_lemonchiffon2[] = "lemonchiffon2"; static char __pyx_k_lemonchiffon3[] = "lemonchiffon3"; static char __pyx_k_lemonchiffon4[] = "lemonchiffon4"; static char __pyx_k_lightseagreen[] = "lightseagreen"; static char __pyx_k_lightskyblue1[] = "lightskyblue1"; static char __pyx_k_lightskyblue2[] = "lightskyblue2"; static char __pyx_k_lightskyblue3[] = "lightskyblue3"; static char __pyx_k_lightskyblue4[] = "lightskyblue4"; static char __pyx_k_mediumorchid1[] = "mediumorchid1"; static char __pyx_k_mediumorchid2[] = "mediumorchid2"; static char __pyx_k_mediumorchid3[] = "mediumorchid3"; static char __pyx_k_mediumorchid4[] = "mediumorchid4"; static char __pyx_k_mediumpurple1[] = "mediumpurple1"; static char __pyx_k_mediumpurple2[] = "mediumpurple2"; static char __pyx_k_mediumpurple3[] = "mediumpurple3"; static char __pyx_k_mediumpurple4[] = "mediumpurple4"; static char __pyx_k_palegoldenrod[] = "palegoldenrod"; static char __pyx_k_paleturquoise[] = "paleturquoise"; static char __pyx_k_palevioletred[] = "palevioletred"; static char __pyx_k_rebeccapurple[] = "rebeccapurple"; static char __pyx_k_blanchedalmond[] = "blanchedalmond"; static char __pyx_k_cornflowerblue[] = "cornflowerblue"; static char __pyx_k_darkgoldenrod1[] = "darkgoldenrod1"; static char __pyx_k_darkgoldenrod2[] = "darkgoldenrod2"; static char __pyx_k_darkgoldenrod3[] = "darkgoldenrod3"; static char __pyx_k_darkgoldenrod4[] = "darkgoldenrod4"; static char __pyx_k_darkolivegreen[] = "darkolivegreen"; static char __pyx_k_darkslategray1[] = "darkslategray1"; static char __pyx_k_darkslategray2[] = "darkslategray2"; static char __pyx_k_darkslategray3[] = "darkslategray3"; static char __pyx_k_darkslategray4[] = "darkslategray4"; static char __pyx_k_lavenderblush1[] = "lavenderblush1"; static char __pyx_k_lavenderblush2[] = "lavenderblush2"; static char __pyx_k_lavenderblush3[] = "lavenderblush3"; static char __pyx_k_lavenderblush4[] = "lavenderblush4"; static char __pyx_k_lightgoldenrod[] = "lightgoldenrod"; static char __pyx_k_lightslateblue[] = "lightslateblue"; static char __pyx_k_lightslategray[] = "lightslategray"; static char __pyx_k_lightslategrey[] = "lightslategrey"; static char __pyx_k_lightsteelblue[] = "lightsteelblue"; static char __pyx_k_mediumseagreen[] = "mediumseagreen"; static char __pyx_k_paleturquoise1[] = "paleturquoise1"; static char __pyx_k_paleturquoise2[] = "paleturquoise2"; static char __pyx_k_paleturquoise3[] = "paleturquoise3"; static char __pyx_k_paleturquoise4[] = "paleturquoise4"; static char __pyx_k_palevioletred1[] = "palevioletred1"; static char __pyx_k_palevioletred2[] = "palevioletred2"; static char __pyx_k_palevioletred3[] = "palevioletred3"; static char __pyx_k_palevioletred4[] = "palevioletred4"; static char __pyx_k_darkolivegreen1[] = "darkolivegreen1"; static char __pyx_k_darkolivegreen2[] = "darkolivegreen2"; static char __pyx_k_darkolivegreen3[] = "darkolivegreen3"; static char __pyx_k_darkolivegreen4[] = "darkolivegreen4"; static char __pyx_k_lightgoldenrod1[] = "lightgoldenrod1"; static char __pyx_k_lightgoldenrod2[] = "lightgoldenrod2"; static char __pyx_k_lightgoldenrod3[] = "lightgoldenrod3"; static char __pyx_k_lightgoldenrod4[] = "lightgoldenrod4"; static char __pyx_k_lightsteelblue1[] = "lightsteelblue1"; static char __pyx_k_lightsteelblue2[] = "lightsteelblue2"; static char __pyx_k_lightsteelblue3[] = "lightsteelblue3"; static char __pyx_k_lightsteelblue4[] = "lightsteelblue4"; static char __pyx_k_mediumslateblue[] = "mediumslateblue"; static char __pyx_k_mediumturquoise[] = "mediumturquoise"; static char __pyx_k_mediumvioletred[] = "mediumvioletred"; static char __pyx_k_Expected_a_color[] = "Expected a color."; static char __pyx_k_mediumaquamarine[] = "mediumaquamarine"; static char __pyx_k_mod___locals_mod[] = "__mod__..mod"; static char __pyx_k_mediumspringgreen[] = "mediumspringgreen"; static char __pyx_k_pygame_sdl2_color[] = "pygame_sdl2.color"; static char __pyx_k_lightgoldenrodyellow[] = "lightgoldenrodyellow"; static char __pyx_k_floordiv___locals_div[] = "__floordiv__..div"; static char __pyx_k_correct_gamma_locals_lambda[] = "correct_gamma.."; static char __pyx_k_Color_from_hex_locals_lambda[] = "Color.from_hex.."; static char __pyx_k_home_tom_ab_pygame_sdl2_src_pyg[] = "/home/tom/ab/pygame_sdl2/src/pygame_sdl2/color.pyx"; static PyObject *__pyx_kp_s_08x; static PyObject *__pyx_kp_s_0x; static PyObject *__pyx_n_s_BBB; static PyObject *__pyx_n_s_BBBB; static PyObject *__pyx_n_s_Color_from_hex_locals_lambda; static PyObject *__pyx_kp_s_Expected_a_color; static PyObject *__pyx_n_s_IndexError; static PyObject *__pyx_n_s_KeyError; static PyObject *__pyx_kp_s_L; static PyObject *__pyx_n_s_TypeError; static PyObject *__pyx_n_s_ValueError; static PyObject *__pyx_kp_s__2; static PyObject *__pyx_kp_s__3; static PyObject *__pyx_n_s_a; static PyObject *__pyx_n_s_aliceblue; static PyObject *__pyx_n_s_antiquewhite; static PyObject *__pyx_n_s_antiquewhite1; static PyObject *__pyx_n_s_antiquewhite2; static PyObject *__pyx_n_s_antiquewhite3; static PyObject *__pyx_n_s_antiquewhite4; static PyObject *__pyx_n_s_aqua; static PyObject *__pyx_n_s_aquamarine; static PyObject *__pyx_n_s_aquamarine1; static PyObject *__pyx_n_s_aquamarine2; static PyObject *__pyx_n_s_aquamarine3; static PyObject *__pyx_n_s_aquamarine4; static PyObject *__pyx_n_s_azure; static PyObject *__pyx_n_s_azure1; static PyObject *__pyx_n_s_azure2; static PyObject *__pyx_n_s_azure3; static PyObject *__pyx_n_s_azure4; static PyObject *__pyx_n_s_b; static PyObject *__pyx_n_s_beige; static PyObject *__pyx_n_s_binascii; static PyObject *__pyx_n_s_bisque; static PyObject *__pyx_n_s_bisque1; static PyObject *__pyx_n_s_bisque2; static PyObject *__pyx_n_s_bisque3; static PyObject *__pyx_n_s_bisque4; static PyObject *__pyx_n_s_black; static PyObject *__pyx_n_s_blanchedalmond; static PyObject *__pyx_n_s_blue; static PyObject *__pyx_n_s_blue1; static PyObject *__pyx_n_s_blue2; static PyObject *__pyx_n_s_blue3; static PyObject *__pyx_n_s_blue4; static PyObject *__pyx_n_s_blueviolet; static PyObject *__pyx_n_s_brown; static PyObject *__pyx_n_s_brown1; static PyObject *__pyx_n_s_brown2; static PyObject *__pyx_n_s_brown3; static PyObject *__pyx_n_s_brown4; static PyObject *__pyx_n_s_burlywood; static PyObject *__pyx_n_s_burlywood1; static PyObject *__pyx_n_s_burlywood2; static PyObject *__pyx_n_s_burlywood3; static PyObject *__pyx_n_s_burlywood4; static PyObject *__pyx_n_s_cadetblue; static PyObject *__pyx_n_s_cadetblue1; static PyObject *__pyx_n_s_cadetblue2; static PyObject *__pyx_n_s_cadetblue3; static PyObject *__pyx_n_s_cadetblue4; static PyObject *__pyx_n_s_chartreuse; static PyObject *__pyx_n_s_chartreuse1; static PyObject *__pyx_n_s_chartreuse2; static PyObject *__pyx_n_s_chartreuse3; static PyObject *__pyx_n_s_chartreuse4; static PyObject *__pyx_n_s_chocolate; static PyObject *__pyx_n_s_chocolate1; static PyObject *__pyx_n_s_chocolate2; static PyObject *__pyx_n_s_chocolate3; static PyObject *__pyx_n_s_chocolate4; static PyObject *__pyx_n_s_coral; static PyObject *__pyx_n_s_coral1; static PyObject *__pyx_n_s_coral2; static PyObject *__pyx_n_s_coral3; static PyObject *__pyx_n_s_coral4; static PyObject *__pyx_n_s_cornflowerblue; static PyObject *__pyx_n_s_cornsilk; static PyObject *__pyx_n_s_cornsilk1; static PyObject *__pyx_n_s_cornsilk2; static PyObject *__pyx_n_s_cornsilk3; static PyObject *__pyx_n_s_cornsilk4; static PyObject *__pyx_n_s_correct_gamma_locals_lambda; static PyObject *__pyx_n_s_crimson; static PyObject *__pyx_n_s_cyan; static PyObject *__pyx_n_s_cyan1; static PyObject *__pyx_n_s_cyan2; static PyObject *__pyx_n_s_cyan3; static PyObject *__pyx_n_s_cyan4; static PyObject *__pyx_n_s_darkblue; static PyObject *__pyx_n_s_darkcyan; static PyObject *__pyx_n_s_darkgoldenrod; static PyObject *__pyx_n_s_darkgoldenrod1; static PyObject *__pyx_n_s_darkgoldenrod2; static PyObject *__pyx_n_s_darkgoldenrod3; static PyObject *__pyx_n_s_darkgoldenrod4; static PyObject *__pyx_n_s_darkgray; static PyObject *__pyx_n_s_darkgreen; static PyObject *__pyx_n_s_darkgrey; static PyObject *__pyx_n_s_darkkhaki; static PyObject *__pyx_n_s_darkmagenta; static PyObject *__pyx_n_s_darkolivegreen; static PyObject *__pyx_n_s_darkolivegreen1; static PyObject *__pyx_n_s_darkolivegreen2; static PyObject *__pyx_n_s_darkolivegreen3; static PyObject *__pyx_n_s_darkolivegreen4; static PyObject *__pyx_n_s_darkorange; static PyObject *__pyx_n_s_darkorange1; static PyObject *__pyx_n_s_darkorange2; static PyObject *__pyx_n_s_darkorange3; static PyObject *__pyx_n_s_darkorange4; static PyObject *__pyx_n_s_darkorchid; static PyObject *__pyx_n_s_darkorchid1; static PyObject *__pyx_n_s_darkorchid2; static PyObject *__pyx_n_s_darkorchid3; static PyObject *__pyx_n_s_darkorchid4; static PyObject *__pyx_n_s_darkred; static PyObject *__pyx_n_s_darksalmon; static PyObject *__pyx_n_s_darkseagreen; static PyObject *__pyx_n_s_darkseagreen1; static PyObject *__pyx_n_s_darkseagreen2; static PyObject *__pyx_n_s_darkseagreen3; static PyObject *__pyx_n_s_darkseagreen4; static PyObject *__pyx_n_s_darkslateblue; static PyObject *__pyx_n_s_darkslategray; static PyObject *__pyx_n_s_darkslategray1; static PyObject *__pyx_n_s_darkslategray2; static PyObject *__pyx_n_s_darkslategray3; static PyObject *__pyx_n_s_darkslategray4; static PyObject *__pyx_n_s_darkslategrey; static PyObject *__pyx_n_s_darkturquoise; static PyObject *__pyx_n_s_darkviolet; static PyObject *__pyx_n_s_deeppink; static PyObject *__pyx_n_s_deeppink1; static PyObject *__pyx_n_s_deeppink2; static PyObject *__pyx_n_s_deeppink3; static PyObject *__pyx_n_s_deeppink4; static PyObject *__pyx_n_s_deepskyblue; static PyObject *__pyx_n_s_deepskyblue1; static PyObject *__pyx_n_s_deepskyblue2; static PyObject *__pyx_n_s_deepskyblue3; static PyObject *__pyx_n_s_deepskyblue4; static PyObject *__pyx_n_s_dimgray; static PyObject *__pyx_n_s_dimgrey; static PyObject *__pyx_n_s_div; static PyObject *__pyx_n_s_dodgerblue; static PyObject *__pyx_n_s_dodgerblue1; static PyObject *__pyx_n_s_dodgerblue2; static PyObject *__pyx_n_s_dodgerblue3; static PyObject *__pyx_n_s_dodgerblue4; static PyObject *__pyx_n_s_firebrick; static PyObject *__pyx_n_s_firebrick1; static PyObject *__pyx_n_s_firebrick2; static PyObject *__pyx_n_s_firebrick3; static PyObject *__pyx_n_s_firebrick4; static PyObject *__pyx_n_s_floordiv___locals_div; static PyObject *__pyx_n_s_floralwhite; static PyObject *__pyx_n_s_forestgreen; static PyObject *__pyx_n_s_fuchsia; static PyObject *__pyx_n_s_g; static PyObject *__pyx_n_s_gainsboro; static PyObject *__pyx_n_s_ghostwhite; static PyObject *__pyx_n_s_gold; static PyObject *__pyx_n_s_gold1; static PyObject *__pyx_n_s_gold2; static PyObject *__pyx_n_s_gold3; static PyObject *__pyx_n_s_gold4; static PyObject *__pyx_n_s_goldenrod; static PyObject *__pyx_n_s_goldenrod1; static PyObject *__pyx_n_s_goldenrod2; static PyObject *__pyx_n_s_goldenrod3; static PyObject *__pyx_n_s_goldenrod4; static PyObject *__pyx_n_s_gray; static PyObject *__pyx_n_s_gray0; static PyObject *__pyx_n_s_gray1; static PyObject *__pyx_n_s_gray10; static PyObject *__pyx_n_s_gray100; static PyObject *__pyx_n_s_gray11; static PyObject *__pyx_n_s_gray12; static PyObject *__pyx_n_s_gray13; static PyObject *__pyx_n_s_gray14; static PyObject *__pyx_n_s_gray15; static PyObject *__pyx_n_s_gray16; static PyObject *__pyx_n_s_gray17; static PyObject *__pyx_n_s_gray18; static PyObject *__pyx_n_s_gray19; static PyObject *__pyx_n_s_gray2; static PyObject *__pyx_n_s_gray20; static PyObject *__pyx_n_s_gray21; static PyObject *__pyx_n_s_gray22; static PyObject *__pyx_n_s_gray23; static PyObject *__pyx_n_s_gray24; static PyObject *__pyx_n_s_gray25; static PyObject *__pyx_n_s_gray26; static PyObject *__pyx_n_s_gray27; static PyObject *__pyx_n_s_gray28; static PyObject *__pyx_n_s_gray29; static PyObject *__pyx_n_s_gray3; static PyObject *__pyx_n_s_gray30; static PyObject *__pyx_n_s_gray31; static PyObject *__pyx_n_s_gray32; static PyObject *__pyx_n_s_gray33; static PyObject *__pyx_n_s_gray34; static PyObject *__pyx_n_s_gray35; static PyObject *__pyx_n_s_gray36; static PyObject *__pyx_n_s_gray37; static PyObject *__pyx_n_s_gray38; static PyObject *__pyx_n_s_gray39; static PyObject *__pyx_n_s_gray4; static PyObject *__pyx_n_s_gray40; static PyObject *__pyx_n_s_gray41; static PyObject *__pyx_n_s_gray42; static PyObject *__pyx_n_s_gray43; static PyObject *__pyx_n_s_gray44; static PyObject *__pyx_n_s_gray45; static PyObject *__pyx_n_s_gray46; static PyObject *__pyx_n_s_gray47; static PyObject *__pyx_n_s_gray48; static PyObject *__pyx_n_s_gray49; static PyObject *__pyx_n_s_gray5; static PyObject *__pyx_n_s_gray50; static PyObject *__pyx_n_s_gray51; static PyObject *__pyx_n_s_gray52; static PyObject *__pyx_n_s_gray53; static PyObject *__pyx_n_s_gray54; static PyObject *__pyx_n_s_gray55; static PyObject *__pyx_n_s_gray56; static PyObject *__pyx_n_s_gray57; static PyObject *__pyx_n_s_gray58; static PyObject *__pyx_n_s_gray59; static PyObject *__pyx_n_s_gray6; static PyObject *__pyx_n_s_gray60; static PyObject *__pyx_n_s_gray61; static PyObject *__pyx_n_s_gray62; static PyObject *__pyx_n_s_gray63; static PyObject *__pyx_n_s_gray64; static PyObject *__pyx_n_s_gray65; static PyObject *__pyx_n_s_gray66; static PyObject *__pyx_n_s_gray67; static PyObject *__pyx_n_s_gray68; static PyObject *__pyx_n_s_gray69; static PyObject *__pyx_n_s_gray7; static PyObject *__pyx_n_s_gray70; static PyObject *__pyx_n_s_gray71; static PyObject *__pyx_n_s_gray72; static PyObject *__pyx_n_s_gray73; static PyObject *__pyx_n_s_gray74; static PyObject *__pyx_n_s_gray75; static PyObject *__pyx_n_s_gray76; static PyObject *__pyx_n_s_gray77; static PyObject *__pyx_n_s_gray78; static PyObject *__pyx_n_s_gray79; static PyObject *__pyx_n_s_gray8; static PyObject *__pyx_n_s_gray80; static PyObject *__pyx_n_s_gray81; static PyObject *__pyx_n_s_gray82; static PyObject *__pyx_n_s_gray83; static PyObject *__pyx_n_s_gray84; static PyObject *__pyx_n_s_gray85; static PyObject *__pyx_n_s_gray86; static PyObject *__pyx_n_s_gray87; static PyObject *__pyx_n_s_gray88; static PyObject *__pyx_n_s_gray89; static PyObject *__pyx_n_s_gray9; static PyObject *__pyx_n_s_gray90; static PyObject *__pyx_n_s_gray91; static PyObject *__pyx_n_s_gray92; static PyObject *__pyx_n_s_gray93; static PyObject *__pyx_n_s_gray94; static PyObject *__pyx_n_s_gray95; static PyObject *__pyx_n_s_gray96; static PyObject *__pyx_n_s_gray97; static PyObject *__pyx_n_s_gray98; static PyObject *__pyx_n_s_gray99; static PyObject *__pyx_n_s_green; static PyObject *__pyx_n_s_green1; static PyObject *__pyx_n_s_green2; static PyObject *__pyx_n_s_green3; static PyObject *__pyx_n_s_green4; static PyObject *__pyx_n_s_greenyellow; static PyObject *__pyx_n_s_grey; static PyObject *__pyx_n_s_grey0; static PyObject *__pyx_n_s_grey1; static PyObject *__pyx_n_s_grey10; static PyObject *__pyx_n_s_grey100; static PyObject *__pyx_n_s_grey11; static PyObject *__pyx_n_s_grey12; static PyObject *__pyx_n_s_grey13; static PyObject *__pyx_n_s_grey14; static PyObject *__pyx_n_s_grey15; static PyObject *__pyx_n_s_grey16; static PyObject *__pyx_n_s_grey17; static PyObject *__pyx_n_s_grey18; static PyObject *__pyx_n_s_grey19; static PyObject *__pyx_n_s_grey2; static PyObject *__pyx_n_s_grey20; static PyObject *__pyx_n_s_grey21; static PyObject *__pyx_n_s_grey22; static PyObject *__pyx_n_s_grey23; static PyObject *__pyx_n_s_grey24; static PyObject *__pyx_n_s_grey25; static PyObject *__pyx_n_s_grey26; static PyObject *__pyx_n_s_grey27; static PyObject *__pyx_n_s_grey28; static PyObject *__pyx_n_s_grey29; static PyObject *__pyx_n_s_grey3; static PyObject *__pyx_n_s_grey30; static PyObject *__pyx_n_s_grey31; static PyObject *__pyx_n_s_grey32; static PyObject *__pyx_n_s_grey33; static PyObject *__pyx_n_s_grey34; static PyObject *__pyx_n_s_grey35; static PyObject *__pyx_n_s_grey36; static PyObject *__pyx_n_s_grey37; static PyObject *__pyx_n_s_grey38; static PyObject *__pyx_n_s_grey39; static PyObject *__pyx_n_s_grey4; static PyObject *__pyx_n_s_grey40; static PyObject *__pyx_n_s_grey41; static PyObject *__pyx_n_s_grey42; static PyObject *__pyx_n_s_grey43; static PyObject *__pyx_n_s_grey44; static PyObject *__pyx_n_s_grey45; static PyObject *__pyx_n_s_grey46; static PyObject *__pyx_n_s_grey47; static PyObject *__pyx_n_s_grey48; static PyObject *__pyx_n_s_grey49; static PyObject *__pyx_n_s_grey5; static PyObject *__pyx_n_s_grey50; static PyObject *__pyx_n_s_grey51; static PyObject *__pyx_n_s_grey52; static PyObject *__pyx_n_s_grey53; static PyObject *__pyx_n_s_grey54; static PyObject *__pyx_n_s_grey55; static PyObject *__pyx_n_s_grey56; static PyObject *__pyx_n_s_grey57; static PyObject *__pyx_n_s_grey58; static PyObject *__pyx_n_s_grey59; static PyObject *__pyx_n_s_grey6; static PyObject *__pyx_n_s_grey60; static PyObject *__pyx_n_s_grey61; static PyObject *__pyx_n_s_grey62; static PyObject *__pyx_n_s_grey63; static PyObject *__pyx_n_s_grey64; static PyObject *__pyx_n_s_grey65; static PyObject *__pyx_n_s_grey66; static PyObject *__pyx_n_s_grey67; static PyObject *__pyx_n_s_grey68; static PyObject *__pyx_n_s_grey69; static PyObject *__pyx_n_s_grey7; static PyObject *__pyx_n_s_grey70; static PyObject *__pyx_n_s_grey71; static PyObject *__pyx_n_s_grey72; static PyObject *__pyx_n_s_grey73; static PyObject *__pyx_n_s_grey74; static PyObject *__pyx_n_s_grey75; static PyObject *__pyx_n_s_grey76; static PyObject *__pyx_n_s_grey77; static PyObject *__pyx_n_s_grey78; static PyObject *__pyx_n_s_grey79; static PyObject *__pyx_n_s_grey8; static PyObject *__pyx_n_s_grey80; static PyObject *__pyx_n_s_grey81; static PyObject *__pyx_n_s_grey82; static PyObject *__pyx_n_s_grey83; static PyObject *__pyx_n_s_grey84; static PyObject *__pyx_n_s_grey85; static PyObject *__pyx_n_s_grey86; static PyObject *__pyx_n_s_grey87; static PyObject *__pyx_n_s_grey88; static PyObject *__pyx_n_s_grey89; static PyObject *__pyx_n_s_grey9; static PyObject *__pyx_n_s_grey90; static PyObject *__pyx_n_s_grey91; static PyObject *__pyx_n_s_grey92; static PyObject *__pyx_n_s_grey93; static PyObject *__pyx_n_s_grey94; static PyObject *__pyx_n_s_grey95; static PyObject *__pyx_n_s_grey96; static PyObject *__pyx_n_s_grey97; static PyObject *__pyx_n_s_grey98; static PyObject *__pyx_n_s_grey99; static PyObject *__pyx_n_s_hex; static PyObject *__pyx_kp_s_home_tom_ab_pygame_sdl2_src_pyg; static PyObject *__pyx_n_s_honeydew; static PyObject *__pyx_n_s_honeydew1; static PyObject *__pyx_n_s_honeydew2; static PyObject *__pyx_n_s_honeydew3; static PyObject *__pyx_n_s_honeydew4; static PyObject *__pyx_n_s_hotpink; static PyObject *__pyx_n_s_hotpink1; static PyObject *__pyx_n_s_hotpink2; static PyObject *__pyx_n_s_hotpink3; static PyObject *__pyx_n_s_hotpink4; static PyObject *__pyx_n_s_hsva; static PyObject *__pyx_n_s_import; static PyObject *__pyx_n_s_indianred; static PyObject *__pyx_n_s_indianred1; static PyObject *__pyx_n_s_indianred2; static PyObject *__pyx_n_s_indianred3; static PyObject *__pyx_n_s_indianred4; static PyObject *__pyx_n_s_indigo; static PyObject *__pyx_n_s_ivory; static PyObject *__pyx_n_s_ivory1; static PyObject *__pyx_n_s_ivory2; static PyObject *__pyx_n_s_ivory3; static PyObject *__pyx_n_s_ivory4; static PyObject *__pyx_n_s_join; static PyObject *__pyx_n_s_khaki; static PyObject *__pyx_n_s_khaki1; static PyObject *__pyx_n_s_khaki2; static PyObject *__pyx_n_s_khaki3; static PyObject *__pyx_n_s_khaki4; static PyObject *__pyx_n_s_l; static PyObject *__pyx_n_s_lavender; static PyObject *__pyx_n_s_lavenderblush; static PyObject *__pyx_n_s_lavenderblush1; static PyObject *__pyx_n_s_lavenderblush2; static PyObject *__pyx_n_s_lavenderblush3; static PyObject *__pyx_n_s_lavenderblush4; static PyObject *__pyx_n_s_lawngreen; static PyObject *__pyx_n_s_lemonchiffon; static PyObject *__pyx_n_s_lemonchiffon1; static PyObject *__pyx_n_s_lemonchiffon2; static PyObject *__pyx_n_s_lemonchiffon3; static PyObject *__pyx_n_s_lemonchiffon4; static PyObject *__pyx_n_s_lightblue; static PyObject *__pyx_n_s_lightblue1; static PyObject *__pyx_n_s_lightblue2; static PyObject *__pyx_n_s_lightblue3; static PyObject *__pyx_n_s_lightblue4; static PyObject *__pyx_n_s_lightcoral; static PyObject *__pyx_n_s_lightcyan; static PyObject *__pyx_n_s_lightcyan1; static PyObject *__pyx_n_s_lightcyan2; static PyObject *__pyx_n_s_lightcyan3; static PyObject *__pyx_n_s_lightcyan4; static PyObject *__pyx_n_s_lightgoldenrod; static PyObject *__pyx_n_s_lightgoldenrod1; static PyObject *__pyx_n_s_lightgoldenrod2; static PyObject *__pyx_n_s_lightgoldenrod3; static PyObject *__pyx_n_s_lightgoldenrod4; static PyObject *__pyx_n_s_lightgoldenrodyellow; static PyObject *__pyx_n_s_lightgray; static PyObject *__pyx_n_s_lightgreen; static PyObject *__pyx_n_s_lightgrey; static PyObject *__pyx_n_s_lightpink; static PyObject *__pyx_n_s_lightpink1; static PyObject *__pyx_n_s_lightpink2; static PyObject *__pyx_n_s_lightpink3; static PyObject *__pyx_n_s_lightpink4; static PyObject *__pyx_n_s_lightsalmon; static PyObject *__pyx_n_s_lightsalmon1; static PyObject *__pyx_n_s_lightsalmon2; static PyObject *__pyx_n_s_lightsalmon3; static PyObject *__pyx_n_s_lightsalmon4; static PyObject *__pyx_n_s_lightseagreen; static PyObject *__pyx_n_s_lightskyblue; static PyObject *__pyx_n_s_lightskyblue1; static PyObject *__pyx_n_s_lightskyblue2; static PyObject *__pyx_n_s_lightskyblue3; static PyObject *__pyx_n_s_lightskyblue4; static PyObject *__pyx_n_s_lightslateblue; static PyObject *__pyx_n_s_lightslategray; static PyObject *__pyx_n_s_lightslategrey; static PyObject *__pyx_n_s_lightsteelblue; static PyObject *__pyx_n_s_lightsteelblue1; static PyObject *__pyx_n_s_lightsteelblue2; static PyObject *__pyx_n_s_lightsteelblue3; static PyObject *__pyx_n_s_lightsteelblue4; static PyObject *__pyx_n_s_lightyellow; static PyObject *__pyx_n_s_lightyellow1; static PyObject *__pyx_n_s_lightyellow2; static PyObject *__pyx_n_s_lightyellow3; static PyObject *__pyx_n_s_lightyellow4; static PyObject *__pyx_n_s_lime; static PyObject *__pyx_n_s_limegreen; static PyObject *__pyx_n_s_linen; static PyObject *__pyx_n_s_lower; static PyObject *__pyx_n_s_magenta; static PyObject *__pyx_n_s_magenta1; static PyObject *__pyx_n_s_magenta2; static PyObject *__pyx_n_s_magenta3; static PyObject *__pyx_n_s_magenta4; static PyObject *__pyx_n_s_main; static PyObject *__pyx_n_s_map; static PyObject *__pyx_n_s_maroon; static PyObject *__pyx_n_s_maroon1; static PyObject *__pyx_n_s_maroon2; static PyObject *__pyx_n_s_maroon3; static PyObject *__pyx_n_s_maroon4; static PyObject *__pyx_n_s_mediumaquamarine; static PyObject *__pyx_n_s_mediumblue; static PyObject *__pyx_n_s_mediumorchid; static PyObject *__pyx_n_s_mediumorchid1; static PyObject *__pyx_n_s_mediumorchid2; static PyObject *__pyx_n_s_mediumorchid3; static PyObject *__pyx_n_s_mediumorchid4; static PyObject *__pyx_n_s_mediumpurple; static PyObject *__pyx_n_s_mediumpurple1; static PyObject *__pyx_n_s_mediumpurple2; static PyObject *__pyx_n_s_mediumpurple3; static PyObject *__pyx_n_s_mediumpurple4; static PyObject *__pyx_n_s_mediumseagreen; static PyObject *__pyx_n_s_mediumslateblue; static PyObject *__pyx_n_s_mediumspringgreen; static PyObject *__pyx_n_s_mediumturquoise; static PyObject *__pyx_n_s_mediumvioletred; static PyObject *__pyx_n_s_midnightblue; static PyObject *__pyx_n_s_mintcream; static PyObject *__pyx_n_s_mistyrose; static PyObject *__pyx_n_s_mistyrose1; static PyObject *__pyx_n_s_mistyrose2; static PyObject *__pyx_n_s_mistyrose3; static PyObject *__pyx_n_s_mistyrose4; static PyObject *__pyx_n_s_moccasin; static PyObject *__pyx_n_s_mod; static PyObject *__pyx_n_s_mod___locals_mod; static PyObject *__pyx_n_s_navajowhite; static PyObject *__pyx_n_s_navajowhite1; static PyObject *__pyx_n_s_navajowhite2; static PyObject *__pyx_n_s_navajowhite3; static PyObject *__pyx_n_s_navajowhite4; static PyObject *__pyx_n_s_navy; static PyObject *__pyx_n_s_navyblue; static PyObject *__pyx_n_s_oct; static PyObject *__pyx_n_s_oldlace; static PyObject *__pyx_n_s_olive; static PyObject *__pyx_n_s_olivedrab; static PyObject *__pyx_n_s_olivedrab1; static PyObject *__pyx_n_s_olivedrab2; static PyObject *__pyx_n_s_olivedrab3; static PyObject *__pyx_n_s_olivedrab4; static PyObject *__pyx_n_s_orange; static PyObject *__pyx_n_s_orange1; static PyObject *__pyx_n_s_orange2; static PyObject *__pyx_n_s_orange3; static PyObject *__pyx_n_s_orange4; static PyObject *__pyx_n_s_orangered; static PyObject *__pyx_n_s_orangered1; static PyObject *__pyx_n_s_orangered2; static PyObject *__pyx_n_s_orangered3; static PyObject *__pyx_n_s_orangered4; static PyObject *__pyx_n_s_orchid; static PyObject *__pyx_n_s_orchid1; static PyObject *__pyx_n_s_orchid2; static PyObject *__pyx_n_s_orchid3; static PyObject *__pyx_n_s_orchid4; static PyObject *__pyx_n_s_pack; static PyObject *__pyx_n_s_palegoldenrod; static PyObject *__pyx_n_s_palegreen; static PyObject *__pyx_n_s_palegreen1; static PyObject *__pyx_n_s_palegreen2; static PyObject *__pyx_n_s_palegreen3; static PyObject *__pyx_n_s_palegreen4; static PyObject *__pyx_n_s_paleturquoise; static PyObject *__pyx_n_s_paleturquoise1; static PyObject *__pyx_n_s_paleturquoise2; static PyObject *__pyx_n_s_paleturquoise3; static PyObject *__pyx_n_s_paleturquoise4; static PyObject *__pyx_n_s_palevioletred; static PyObject *__pyx_n_s_palevioletred1; static PyObject *__pyx_n_s_palevioletred2; static PyObject *__pyx_n_s_palevioletred3; static PyObject *__pyx_n_s_palevioletred4; static PyObject *__pyx_n_s_papayawhip; static PyObject *__pyx_n_s_peachpuff; static PyObject *__pyx_n_s_peachpuff1; static PyObject *__pyx_n_s_peachpuff2; static PyObject *__pyx_n_s_peachpuff3; static PyObject *__pyx_n_s_peachpuff4; static PyObject *__pyx_n_s_peru; static PyObject *__pyx_n_s_pink; static PyObject *__pyx_n_s_pink1; static PyObject *__pyx_n_s_pink2; static PyObject *__pyx_n_s_pink3; static PyObject *__pyx_n_s_pink4; static PyObject *__pyx_n_s_plum; static PyObject *__pyx_n_s_plum1; static PyObject *__pyx_n_s_plum2; static PyObject *__pyx_n_s_plum3; static PyObject *__pyx_n_s_plum4; static PyObject *__pyx_n_s_powderblue; static PyObject *__pyx_n_s_purple; static PyObject *__pyx_n_s_purple1; static PyObject *__pyx_n_s_purple2; static PyObject *__pyx_n_s_purple3; static PyObject *__pyx_n_s_purple4; static PyObject *__pyx_n_s_pygame_sdl2_color; static PyObject *__pyx_n_s_pyx_vtable; static PyObject *__pyx_n_s_r; static PyObject *__pyx_n_s_rebeccapurple; static PyObject *__pyx_n_s_red; static PyObject *__pyx_n_s_red1; static PyObject *__pyx_n_s_red2; static PyObject *__pyx_n_s_red3; static PyObject *__pyx_n_s_red4; static PyObject *__pyx_n_s_rgba; static PyObject *__pyx_n_s_rosybrown; static PyObject *__pyx_n_s_rosybrown1; static PyObject *__pyx_n_s_rosybrown2; static PyObject *__pyx_n_s_rosybrown3; static PyObject *__pyx_n_s_rosybrown4; static PyObject *__pyx_n_s_round; static PyObject *__pyx_n_s_royalblue; static PyObject *__pyx_n_s_royalblue1; static PyObject *__pyx_n_s_royalblue2; static PyObject *__pyx_n_s_royalblue3; static PyObject *__pyx_n_s_royalblue4; static PyObject *__pyx_n_s_saddlebrown; static PyObject *__pyx_n_s_salmon; static PyObject *__pyx_n_s_salmon1; static PyObject *__pyx_n_s_salmon2; static PyObject *__pyx_n_s_salmon3; static PyObject *__pyx_n_s_salmon4; static PyObject *__pyx_n_s_sandybrown; static PyObject *__pyx_n_s_seagreen; static PyObject *__pyx_n_s_seagreen1; static PyObject *__pyx_n_s_seagreen2; static PyObject *__pyx_n_s_seagreen3; static PyObject *__pyx_n_s_seagreen4; static PyObject *__pyx_n_s_seashell; static PyObject *__pyx_n_s_seashell1; static PyObject *__pyx_n_s_seashell2; static PyObject *__pyx_n_s_seashell3; static PyObject *__pyx_n_s_seashell4; static PyObject *__pyx_n_s_sienna; static PyObject *__pyx_n_s_sienna1; static PyObject *__pyx_n_s_sienna2; static PyObject *__pyx_n_s_sienna3; static PyObject *__pyx_n_s_sienna4; static PyObject *__pyx_n_s_silver; static PyObject *__pyx_n_s_skyblue; static PyObject *__pyx_n_s_skyblue1; static PyObject *__pyx_n_s_skyblue2; static PyObject *__pyx_n_s_skyblue3; static PyObject *__pyx_n_s_skyblue4; static PyObject *__pyx_n_s_slateblue; static PyObject *__pyx_n_s_slateblue1; static PyObject *__pyx_n_s_slateblue2; static PyObject *__pyx_n_s_slateblue3; static PyObject *__pyx_n_s_slateblue4; static PyObject *__pyx_n_s_slategray; static PyObject *__pyx_n_s_slategray1; static PyObject *__pyx_n_s_slategray2; static PyObject *__pyx_n_s_slategray3; static PyObject *__pyx_n_s_slategray4; static PyObject *__pyx_n_s_slategrey; static PyObject *__pyx_n_s_snow; static PyObject *__pyx_n_s_snow1; static PyObject *__pyx_n_s_snow2; static PyObject *__pyx_n_s_snow3; static PyObject *__pyx_n_s_snow4; static PyObject *__pyx_n_s_split; static PyObject *__pyx_n_s_springgreen; static PyObject *__pyx_n_s_springgreen1; static PyObject *__pyx_n_s_springgreen2; static PyObject *__pyx_n_s_springgreen3; static PyObject *__pyx_n_s_springgreen4; static PyObject *__pyx_n_s_startswith; static PyObject *__pyx_n_s_steelblue; static PyObject *__pyx_n_s_steelblue1; static PyObject *__pyx_n_s_steelblue2; static PyObject *__pyx_n_s_steelblue3; static PyObject *__pyx_n_s_steelblue4; static PyObject *__pyx_n_s_struct; static PyObject *__pyx_n_s_tan; static PyObject *__pyx_n_s_tan1; static PyObject *__pyx_n_s_tan2; static PyObject *__pyx_n_s_tan3; static PyObject *__pyx_n_s_tan4; static PyObject *__pyx_n_s_teal; static PyObject *__pyx_n_s_test; static PyObject *__pyx_n_s_thistle; static PyObject *__pyx_n_s_thistle1; static PyObject *__pyx_n_s_thistle2; static PyObject *__pyx_n_s_thistle3; static PyObject *__pyx_n_s_thistle4; static PyObject *__pyx_n_s_tomato; static PyObject *__pyx_n_s_tomato1; static PyObject *__pyx_n_s_tomato2; static PyObject *__pyx_n_s_tomato3; static PyObject *__pyx_n_s_tomato4; static PyObject *__pyx_n_s_turquoise; static PyObject *__pyx_n_s_turquoise1; static PyObject *__pyx_n_s_turquoise2; static PyObject *__pyx_n_s_turquoise3; static PyObject *__pyx_n_s_turquoise4; static PyObject *__pyx_n_s_unhexlify; static PyObject *__pyx_n_s_unpack; static PyObject *__pyx_n_s_violet; static PyObject *__pyx_n_s_violetred; static PyObject *__pyx_n_s_violetred1; static PyObject *__pyx_n_s_violetred2; static PyObject *__pyx_n_s_violetred3; static PyObject *__pyx_n_s_violetred4; static PyObject *__pyx_n_s_webgray; static PyObject *__pyx_n_s_webgreen; static PyObject *__pyx_n_s_webgrey; static PyObject *__pyx_n_s_webmaroon; static PyObject *__pyx_n_s_webpurple; static PyObject *__pyx_n_s_wheat; static PyObject *__pyx_n_s_wheat1; static PyObject *__pyx_n_s_wheat2; static PyObject *__pyx_n_s_wheat3; static PyObject *__pyx_n_s_wheat4; static PyObject *__pyx_n_s_white; static PyObject *__pyx_n_s_whitesmoke; static PyObject *__pyx_n_s_x11gray; static PyObject *__pyx_n_s_x11green; static PyObject *__pyx_n_s_x11grey; static PyObject *__pyx_n_s_x11maroon; static PyObject *__pyx_n_s_x11purple; static PyObject *__pyx_n_s_yellow; static PyObject *__pyx_n_s_yellow1; static PyObject *__pyx_n_s_yellow2; static PyObject *__pyx_n_s_yellow3; static PyObject *__pyx_n_s_yellow4; static PyObject *__pyx_n_s_yellowgreen; static PyObject *__pyx_lambda_funcdef_lambda(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_x); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_5color_5Color___richcmp__(struct __pyx_obj_11pygame_sdl2_5color_Color *__pyx_v_x, PyObject *__pyx_v_y, int __pyx_v_op); /* proto */ static int __pyx_pf_11pygame_sdl2_5color_5Color_2__cinit__(struct __pyx_obj_11pygame_sdl2_5color_Color *__pyx_v_self); /* proto */ static int __pyx_pf_11pygame_sdl2_5color_5Color_4__init__(struct __pyx_obj_11pygame_sdl2_5color_Color *__pyx_v_self, PyObject *__pyx_v_args); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_5color_5Color_6__repr__(struct __pyx_obj_11pygame_sdl2_5color_Color *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_5color_5Color_8__int__(struct __pyx_obj_11pygame_sdl2_5color_Color *__pyx_v_self); /* proto */ #if PY_MAJOR_VERSION < 3 || CYTHON_COMPILING_IN_PYPY static PyObject *__pyx_pf_11pygame_sdl2_5color_5Color_10__hex__(struct __pyx_obj_11pygame_sdl2_5color_Color *__pyx_v_self); /* proto */ #endif #if PY_MAJOR_VERSION < 3 || CYTHON_COMPILING_IN_PYPY static PyObject *__pyx_pf_11pygame_sdl2_5color_5Color_12__oct__(struct __pyx_obj_11pygame_sdl2_5color_Color *__pyx_v_self); /* proto */ #endif static PyObject *__pyx_pf_11pygame_sdl2_5color_5Color_14__float__(struct __pyx_obj_11pygame_sdl2_5color_Color *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_5color_5Color_16__reduce__(struct __pyx_obj_11pygame_sdl2_5color_Color *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_5color_5Color_18__setstate__(struct __pyx_obj_11pygame_sdl2_5color_Color *__pyx_v_self, PyObject *__pyx_v_d); /* proto */ static int __pyx_pf_11pygame_sdl2_5color_5Color_20__setitem__(struct __pyx_obj_11pygame_sdl2_5color_Color *__pyx_v_self, PyObject *__pyx_v_key, PyObject *__pyx_v_val); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_5color_5Color_22__getitem__(struct __pyx_obj_11pygame_sdl2_5color_Color *__pyx_v_self, PyObject *__pyx_v_key); /* proto */ static Py_ssize_t __pyx_pf_11pygame_sdl2_5color_5Color_24__len__(struct __pyx_obj_11pygame_sdl2_5color_Color *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_5color_5Color_26__mul__(PyObject *__pyx_v_self, struct __pyx_obj_11pygame_sdl2_5color_Color *__pyx_v_rhs); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_5color_5Color_28__add__(PyObject *__pyx_v_self, struct __pyx_obj_11pygame_sdl2_5color_Color *__pyx_v_rhs); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_5color_5Color_30__sub__(PyObject *__pyx_v_self, struct __pyx_obj_11pygame_sdl2_5color_Color *__pyx_v_rhs); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_5color_5Color_7__mod___mod(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_l, PyObject *__pyx_v_r); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_5color_5Color_32__mod__(PyObject *__pyx_v_self, struct __pyx_obj_11pygame_sdl2_5color_Color *__pyx_v_rhs); /* proto */ #if PY_MAJOR_VERSION < 3 || CYTHON_COMPILING_IN_PYPY static PyObject *__pyx_pf_11pygame_sdl2_5color_5Color_34__div__(PyObject *__pyx_v_self, struct __pyx_obj_11pygame_sdl2_5color_Color *__pyx_v_rhs); /* proto */ #endif static PyObject *__pyx_pf_11pygame_sdl2_5color_5Color_12__floordiv___div(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_a, PyObject *__pyx_v_b); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_5color_5Color_36__floordiv__(PyObject *__pyx_v_self, struct __pyx_obj_11pygame_sdl2_5color_Color *__pyx_v_rhs); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_5color_5Color_3cmy___get__(struct __pyx_obj_11pygame_sdl2_5color_Color *__pyx_v_self); /* proto */ static int __pyx_pf_11pygame_sdl2_5color_5Color_3cmy_2__set__(struct __pyx_obj_11pygame_sdl2_5color_Color *__pyx_v_self, PyObject *__pyx_v_val); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_5color_5Color_4hsva___get__(struct __pyx_obj_11pygame_sdl2_5color_Color *__pyx_v_self); /* proto */ static int __pyx_pf_11pygame_sdl2_5color_5Color_4hsva_2__set__(struct __pyx_obj_11pygame_sdl2_5color_Color *__pyx_v_self, PyObject *__pyx_v_val); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_5color_5Color_4hsla___get__(struct __pyx_obj_11pygame_sdl2_5color_Color *__pyx_v_self); /* proto */ static int __pyx_pf_11pygame_sdl2_5color_5Color_4hsla_2__set__(struct __pyx_obj_11pygame_sdl2_5color_Color *__pyx_v_self, PyObject *__pyx_v_val); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_5color_5Color_6i1i2i3___get__(struct __pyx_obj_11pygame_sdl2_5color_Color *__pyx_v_self); /* proto */ static int __pyx_pf_11pygame_sdl2_5color_5Color_6i1i2i3_2__set__(struct __pyx_obj_11pygame_sdl2_5color_Color *__pyx_v_self, PyObject *__pyx_v_val); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_5color_5Color_38normalize(struct __pyx_obj_11pygame_sdl2_5color_Color *__pyx_v_self); /* proto */ static PyObject *__pyx_lambda_funcdef_lambda1(PyObject *__pyx_self, PyObject *__pyx_v_x); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_5color_5Color_40correct_gamma(struct __pyx_obj_11pygame_sdl2_5color_Color *__pyx_v_self, PyObject *__pyx_v_gamma); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_5color_5Color_42set_length(struct __pyx_obj_11pygame_sdl2_5color_Color *__pyx_v_self, PyObject *__pyx_v_n); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_5color_5Color_1r___get__(struct __pyx_obj_11pygame_sdl2_5color_Color *__pyx_v_self); /* proto */ static int __pyx_pf_11pygame_sdl2_5color_5Color_1r_2__set__(struct __pyx_obj_11pygame_sdl2_5color_Color *__pyx_v_self, PyObject *__pyx_v_value); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_5color_5Color_1g___get__(struct __pyx_obj_11pygame_sdl2_5color_Color *__pyx_v_self); /* proto */ static int __pyx_pf_11pygame_sdl2_5color_5Color_1g_2__set__(struct __pyx_obj_11pygame_sdl2_5color_Color *__pyx_v_self, PyObject *__pyx_v_value); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_5color_5Color_1b___get__(struct __pyx_obj_11pygame_sdl2_5color_Color *__pyx_v_self); /* proto */ static int __pyx_pf_11pygame_sdl2_5color_5Color_1b_2__set__(struct __pyx_obj_11pygame_sdl2_5color_Color *__pyx_v_self, PyObject *__pyx_v_value); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_5color_5Color_1a___get__(struct __pyx_obj_11pygame_sdl2_5color_Color *__pyx_v_self); /* proto */ static int __pyx_pf_11pygame_sdl2_5color_5Color_1a_2__set__(struct __pyx_obj_11pygame_sdl2_5color_Color *__pyx_v_self, PyObject *__pyx_v_value); /* proto */ static PyObject *__pyx_tp_new_11pygame_sdl2_5color_Color(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ static PyObject *__pyx_tp_new_11pygame_sdl2_5color___pyx_scope_struct__correct_gamma(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ static PyObject *__pyx_float_255_0; static PyObject *__pyx_float_360_0; static PyObject *__pyx_int_0; static PyObject *__pyx_int_1; static PyObject *__pyx_int_2; static PyObject *__pyx_int_3; static PyObject *__pyx_int_4; static PyObject *__pyx_int_5; static PyObject *__pyx_int_8; static PyObject *__pyx_int_10; static PyObject *__pyx_int_11; static PyObject *__pyx_int_12; static PyObject *__pyx_int_13; static PyObject *__pyx_int_14; static PyObject *__pyx_int_15; static PyObject *__pyx_int_16; static PyObject *__pyx_int_18; static PyObject *__pyx_int_19; static PyObject *__pyx_int_20; static PyObject *__pyx_int_21; static PyObject *__pyx_int_23; static PyObject *__pyx_int_24; static PyObject *__pyx_int_25; static PyObject *__pyx_int_26; static PyObject *__pyx_int_28; static PyObject *__pyx_int_29; static PyObject *__pyx_int_30; static PyObject *__pyx_int_31; static PyObject *__pyx_int_32; static PyObject *__pyx_int_33; static PyObject *__pyx_int_34; static PyObject *__pyx_int_35; static PyObject *__pyx_int_36; static PyObject *__pyx_int_37; static PyObject *__pyx_int_38; static PyObject *__pyx_int_39; static PyObject *__pyx_int_41; static PyObject *__pyx_int_42; static PyObject *__pyx_int_43; static PyObject *__pyx_int_44; static PyObject *__pyx_int_45; static PyObject *__pyx_int_46; static PyObject *__pyx_int_47; static PyObject *__pyx_int_48; static PyObject *__pyx_int_50; static PyObject *__pyx_int_51; static PyObject *__pyx_int_52; static PyObject *__pyx_int_54; static PyObject *__pyx_int_55; static PyObject *__pyx_int_56; static PyObject *__pyx_int_57; static PyObject *__pyx_int_58; static PyObject *__pyx_int_59; static PyObject *__pyx_int_60; static PyObject *__pyx_int_61; static PyObject *__pyx_int_62; static PyObject *__pyx_int_63; static PyObject *__pyx_int_64; static PyObject *__pyx_int_65; static PyObject *__pyx_int_66; static PyObject *__pyx_int_67; static PyObject *__pyx_int_69; static PyObject *__pyx_int_70; static PyObject *__pyx_int_71; static PyObject *__pyx_int_72; static PyObject *__pyx_int_73; static PyObject *__pyx_int_74; static PyObject *__pyx_int_75; static PyObject *__pyx_int_76; static PyObject *__pyx_int_77; static PyObject *__pyx_int_78; static PyObject *__pyx_int_79; static PyObject *__pyx_int_80; static PyObject *__pyx_int_82; static PyObject *__pyx_int_83; static PyObject *__pyx_int_84; static PyObject *__pyx_int_85; static PyObject *__pyx_int_86; static PyObject *__pyx_int_87; static PyObject *__pyx_int_89; static PyObject *__pyx_int_90; static PyObject *__pyx_int_91; static PyObject *__pyx_int_92; static PyObject *__pyx_int_93; static PyObject *__pyx_int_94; static PyObject *__pyx_int_95; static PyObject *__pyx_int_96; static PyObject *__pyx_int_97; static PyObject *__pyx_int_98; static PyObject *__pyx_int_99; static PyObject *__pyx_int_100; static PyObject *__pyx_int_101; static PyObject *__pyx_int_102; static PyObject *__pyx_int_103; static PyObject *__pyx_int_104; static PyObject *__pyx_int_105; static PyObject *__pyx_int_106; static PyObject *__pyx_int_107; static PyObject *__pyx_int_108; static PyObject *__pyx_int_110; static PyObject *__pyx_int_111; static PyObject *__pyx_int_112; static PyObject *__pyx_int_113; static PyObject *__pyx_int_114; static PyObject *__pyx_int_115; static PyObject *__pyx_int_116; static PyObject *__pyx_int_117; static PyObject *__pyx_int_118; static PyObject *__pyx_int_119; static PyObject *__pyx_int_120; static PyObject *__pyx_int_121; static PyObject *__pyx_int_122; static PyObject *__pyx_int_123; static PyObject *__pyx_int_124; static PyObject *__pyx_int_125; static PyObject *__pyx_int_126; static PyObject *__pyx_int_127; static PyObject *__pyx_int_128; static PyObject *__pyx_int_129; static PyObject *__pyx_int_130; static PyObject *__pyx_int_131; static PyObject *__pyx_int_132; static PyObject *__pyx_int_133; static PyObject *__pyx_int_134; static PyObject *__pyx_int_135; static PyObject *__pyx_int_136; static PyObject *__pyx_int_137; static PyObject *__pyx_int_138; static PyObject *__pyx_int_139; static PyObject *__pyx_int_140; static PyObject *__pyx_int_141; static PyObject *__pyx_int_142; static PyObject *__pyx_int_143; static PyObject *__pyx_int_144; static PyObject *__pyx_int_145; static PyObject *__pyx_int_147; static PyObject *__pyx_int_148; static PyObject *__pyx_int_149; static PyObject *__pyx_int_150; static PyObject *__pyx_int_151; static PyObject *__pyx_int_152; static PyObject *__pyx_int_153; static PyObject *__pyx_int_154; static PyObject *__pyx_int_155; static PyObject *__pyx_int_156; static PyObject *__pyx_int_158; static PyObject *__pyx_int_159; static PyObject *__pyx_int_160; static PyObject *__pyx_int_161; static PyObject *__pyx_int_162; static PyObject *__pyx_int_163; static PyObject *__pyx_int_164; static PyObject *__pyx_int_165; static PyObject *__pyx_int_166; static PyObject *__pyx_int_167; static PyObject *__pyx_int_168; static PyObject *__pyx_int_169; static PyObject *__pyx_int_170; static PyObject *__pyx_int_171; static PyObject *__pyx_int_172; static PyObject *__pyx_int_173; static PyObject *__pyx_int_174; static PyObject *__pyx_int_175; static PyObject *__pyx_int_176; static PyObject *__pyx_int_177; static PyObject *__pyx_int_178; static PyObject *__pyx_int_179; static PyObject *__pyx_int_180; static PyObject *__pyx_int_181; static PyObject *__pyx_int_182; static PyObject *__pyx_int_183; static PyObject *__pyx_int_184; static PyObject *__pyx_int_185; static PyObject *__pyx_int_186; static PyObject *__pyx_int_187; static PyObject *__pyx_int_188; static PyObject *__pyx_int_189; static PyObject *__pyx_int_190; static PyObject *__pyx_int_191; static PyObject *__pyx_int_192; static PyObject *__pyx_int_193; static PyObject *__pyx_int_194; static PyObject *__pyx_int_196; static PyObject *__pyx_int_197; static PyObject *__pyx_int_198; static PyObject *__pyx_int_199; static PyObject *__pyx_int_200; static PyObject *__pyx_int_201; static PyObject *__pyx_int_202; static PyObject *__pyx_int_203; static PyObject *__pyx_int_204; static PyObject *__pyx_int_205; static PyObject *__pyx_int_206; static PyObject *__pyx_int_207; static PyObject *__pyx_int_208; static PyObject *__pyx_int_209; static PyObject *__pyx_int_210; static PyObject *__pyx_int_211; static PyObject *__pyx_int_212; static PyObject *__pyx_int_213; static PyObject *__pyx_int_214; static PyObject *__pyx_int_215; static PyObject *__pyx_int_216; static PyObject *__pyx_int_217; static PyObject *__pyx_int_218; static PyObject *__pyx_int_219; static PyObject *__pyx_int_220; static PyObject *__pyx_int_221; static PyObject *__pyx_int_222; static PyObject *__pyx_int_223; static PyObject *__pyx_int_224; static PyObject *__pyx_int_225; static PyObject *__pyx_int_226; static PyObject *__pyx_int_227; static PyObject *__pyx_int_228; static PyObject *__pyx_int_229; static PyObject *__pyx_int_230; static PyObject *__pyx_int_231; static PyObject *__pyx_int_232; static PyObject *__pyx_int_233; static PyObject *__pyx_int_235; static PyObject *__pyx_int_236; static PyObject *__pyx_int_237; static PyObject *__pyx_int_238; static PyObject *__pyx_int_239; static PyObject *__pyx_int_240; static PyObject *__pyx_int_242; static PyObject *__pyx_int_244; static PyObject *__pyx_int_245; static PyObject *__pyx_int_246; static PyObject *__pyx_int_247; static PyObject *__pyx_int_248; static PyObject *__pyx_int_250; static PyObject *__pyx_int_251; static PyObject *__pyx_int_252; static PyObject *__pyx_int_253; static PyObject *__pyx_int_255; static PyObject *__pyx_tuple_; static PyObject *__pyx_slice__5; static PyObject *__pyx_slice__7; static PyObject *__pyx_tuple__4; static PyObject *__pyx_tuple__6; static PyObject *__pyx_tuple__8; static PyObject *__pyx_tuple__10; static PyObject *__pyx_tuple__12; static PyObject *__pyx_tuple__13; static PyObject *__pyx_tuple__14; static PyObject *__pyx_tuple__15; static PyObject *__pyx_tuple__16; static PyObject *__pyx_tuple__17; static PyObject *__pyx_tuple__18; static PyObject *__pyx_tuple__19; static PyObject *__pyx_tuple__20; static PyObject *__pyx_tuple__21; static PyObject *__pyx_tuple__22; static PyObject *__pyx_tuple__23; static PyObject *__pyx_tuple__24; static PyObject *__pyx_tuple__25; static PyObject *__pyx_tuple__26; static PyObject *__pyx_tuple__27; static PyObject *__pyx_tuple__28; static PyObject *__pyx_tuple__29; static PyObject *__pyx_tuple__30; static PyObject *__pyx_tuple__31; static PyObject *__pyx_tuple__32; static PyObject *__pyx_tuple__33; static PyObject *__pyx_tuple__34; static PyObject *__pyx_tuple__35; static PyObject *__pyx_tuple__36; static PyObject *__pyx_tuple__37; static PyObject *__pyx_tuple__38; static PyObject *__pyx_tuple__39; static PyObject *__pyx_tuple__40; static PyObject *__pyx_tuple__41; static PyObject *__pyx_tuple__42; static PyObject *__pyx_tuple__43; static PyObject *__pyx_tuple__44; static PyObject *__pyx_tuple__45; static PyObject *__pyx_tuple__46; static PyObject *__pyx_tuple__47; static PyObject *__pyx_tuple__48; static PyObject *__pyx_tuple__49; static PyObject *__pyx_tuple__50; static PyObject *__pyx_tuple__51; static PyObject *__pyx_tuple__52; static PyObject *__pyx_tuple__53; static PyObject *__pyx_tuple__54; static PyObject *__pyx_tuple__55; static PyObject *__pyx_tuple__56; static PyObject *__pyx_tuple__57; static PyObject *__pyx_tuple__58; static PyObject *__pyx_tuple__59; static PyObject *__pyx_tuple__60; static PyObject *__pyx_tuple__61; static PyObject *__pyx_tuple__62; static PyObject *__pyx_tuple__63; static PyObject *__pyx_tuple__64; static PyObject *__pyx_tuple__65; static PyObject *__pyx_tuple__66; static PyObject *__pyx_tuple__67; static PyObject *__pyx_tuple__68; static PyObject *__pyx_tuple__69; static PyObject *__pyx_tuple__70; static PyObject *__pyx_tuple__71; static PyObject *__pyx_tuple__72; static PyObject *__pyx_tuple__73; static PyObject *__pyx_tuple__74; static PyObject *__pyx_tuple__75; static PyObject *__pyx_tuple__76; static PyObject *__pyx_tuple__77; static PyObject *__pyx_tuple__78; static PyObject *__pyx_tuple__79; static PyObject *__pyx_tuple__80; static PyObject *__pyx_tuple__81; static PyObject *__pyx_tuple__82; static PyObject *__pyx_tuple__83; static PyObject *__pyx_tuple__84; static PyObject *__pyx_tuple__85; static PyObject *__pyx_tuple__86; static PyObject *__pyx_tuple__87; static PyObject *__pyx_tuple__88; static PyObject *__pyx_tuple__89; static PyObject *__pyx_tuple__90; static PyObject *__pyx_tuple__91; static PyObject *__pyx_tuple__92; static PyObject *__pyx_tuple__93; static PyObject *__pyx_tuple__94; static PyObject *__pyx_tuple__95; static PyObject *__pyx_tuple__96; static PyObject *__pyx_tuple__97; static PyObject *__pyx_tuple__98; static PyObject *__pyx_tuple__99; static PyObject *__pyx_codeobj__9; static PyObject *__pyx_tuple__100; static PyObject *__pyx_tuple__101; static PyObject *__pyx_tuple__102; static PyObject *__pyx_tuple__103; static PyObject *__pyx_tuple__104; static PyObject *__pyx_tuple__105; static PyObject *__pyx_tuple__106; static PyObject *__pyx_tuple__107; static PyObject *__pyx_tuple__108; static PyObject *__pyx_tuple__109; static PyObject *__pyx_tuple__110; static PyObject *__pyx_tuple__111; static PyObject *__pyx_tuple__112; static PyObject *__pyx_tuple__113; static PyObject *__pyx_tuple__114; static PyObject *__pyx_tuple__115; static PyObject *__pyx_tuple__116; static PyObject *__pyx_tuple__117; static PyObject *__pyx_tuple__118; static PyObject *__pyx_tuple__119; static PyObject *__pyx_tuple__120; static PyObject *__pyx_tuple__121; static PyObject *__pyx_tuple__122; static PyObject *__pyx_tuple__123; static PyObject *__pyx_tuple__124; static PyObject *__pyx_tuple__125; static PyObject *__pyx_tuple__126; static PyObject *__pyx_tuple__127; static PyObject *__pyx_tuple__128; static PyObject *__pyx_tuple__129; static PyObject *__pyx_tuple__130; static PyObject *__pyx_tuple__131; static PyObject *__pyx_tuple__132; static PyObject *__pyx_tuple__133; static PyObject *__pyx_tuple__134; static PyObject *__pyx_tuple__135; static PyObject *__pyx_tuple__136; static PyObject *__pyx_tuple__137; static PyObject *__pyx_tuple__138; static PyObject *__pyx_tuple__139; static PyObject *__pyx_tuple__140; static PyObject *__pyx_tuple__141; static PyObject *__pyx_tuple__142; static PyObject *__pyx_tuple__143; static PyObject *__pyx_tuple__144; static PyObject *__pyx_tuple__145; static PyObject *__pyx_tuple__146; static PyObject *__pyx_tuple__147; static PyObject *__pyx_tuple__148; static PyObject *__pyx_tuple__149; static PyObject *__pyx_tuple__150; static PyObject *__pyx_tuple__151; static PyObject *__pyx_tuple__152; static PyObject *__pyx_tuple__153; static PyObject *__pyx_tuple__154; static PyObject *__pyx_tuple__155; static PyObject *__pyx_tuple__156; static PyObject *__pyx_tuple__157; static PyObject *__pyx_tuple__158; static PyObject *__pyx_tuple__159; static PyObject *__pyx_tuple__160; static PyObject *__pyx_tuple__161; static PyObject *__pyx_tuple__162; static PyObject *__pyx_tuple__163; static PyObject *__pyx_tuple__164; static PyObject *__pyx_tuple__165; static PyObject *__pyx_tuple__166; static PyObject *__pyx_tuple__167; static PyObject *__pyx_tuple__168; static PyObject *__pyx_tuple__169; static PyObject *__pyx_tuple__170; static PyObject *__pyx_tuple__171; static PyObject *__pyx_tuple__172; static PyObject *__pyx_tuple__173; static PyObject *__pyx_tuple__174; static PyObject *__pyx_tuple__175; static PyObject *__pyx_tuple__176; static PyObject *__pyx_tuple__177; static PyObject *__pyx_tuple__178; static PyObject *__pyx_tuple__179; static PyObject *__pyx_tuple__180; static PyObject *__pyx_tuple__181; static PyObject *__pyx_tuple__182; static PyObject *__pyx_tuple__183; static PyObject *__pyx_tuple__184; static PyObject *__pyx_tuple__185; static PyObject *__pyx_tuple__186; static PyObject *__pyx_tuple__187; static PyObject *__pyx_tuple__188; static PyObject *__pyx_tuple__189; static PyObject *__pyx_tuple__190; static PyObject *__pyx_tuple__191; static PyObject *__pyx_tuple__192; static PyObject *__pyx_tuple__193; static PyObject *__pyx_tuple__194; static PyObject *__pyx_tuple__195; static PyObject *__pyx_tuple__196; static PyObject *__pyx_tuple__197; static PyObject *__pyx_tuple__198; static PyObject *__pyx_tuple__199; static PyObject *__pyx_tuple__200; static PyObject *__pyx_tuple__201; static PyObject *__pyx_tuple__202; static PyObject *__pyx_tuple__203; static PyObject *__pyx_tuple__204; static PyObject *__pyx_tuple__205; static PyObject *__pyx_tuple__206; static PyObject *__pyx_tuple__207; static PyObject *__pyx_tuple__208; static PyObject *__pyx_tuple__209; static PyObject *__pyx_tuple__210; static PyObject *__pyx_tuple__211; static PyObject *__pyx_tuple__212; static PyObject *__pyx_tuple__213; static PyObject *__pyx_tuple__214; static PyObject *__pyx_tuple__215; static PyObject *__pyx_tuple__216; static PyObject *__pyx_tuple__217; static PyObject *__pyx_tuple__218; static PyObject *__pyx_tuple__219; static PyObject *__pyx_tuple__220; static PyObject *__pyx_tuple__221; static PyObject *__pyx_tuple__222; static PyObject *__pyx_tuple__223; static PyObject *__pyx_tuple__224; static PyObject *__pyx_tuple__225; static PyObject *__pyx_tuple__226; static PyObject *__pyx_tuple__227; static PyObject *__pyx_tuple__228; static PyObject *__pyx_tuple__229; static PyObject *__pyx_tuple__230; static PyObject *__pyx_tuple__231; static PyObject *__pyx_tuple__232; static PyObject *__pyx_tuple__233; static PyObject *__pyx_tuple__234; static PyObject *__pyx_tuple__235; static PyObject *__pyx_tuple__236; static PyObject *__pyx_tuple__237; static PyObject *__pyx_tuple__238; static PyObject *__pyx_tuple__239; static PyObject *__pyx_tuple__240; static PyObject *__pyx_tuple__241; static PyObject *__pyx_tuple__242; static PyObject *__pyx_tuple__243; static PyObject *__pyx_tuple__244; static PyObject *__pyx_tuple__245; static PyObject *__pyx_tuple__246; static PyObject *__pyx_tuple__247; static PyObject *__pyx_tuple__248; static PyObject *__pyx_tuple__249; static PyObject *__pyx_tuple__250; static PyObject *__pyx_tuple__251; static PyObject *__pyx_tuple__252; static PyObject *__pyx_tuple__253; static PyObject *__pyx_tuple__254; static PyObject *__pyx_tuple__255; static PyObject *__pyx_tuple__256; static PyObject *__pyx_tuple__257; static PyObject *__pyx_tuple__258; static PyObject *__pyx_tuple__259; static PyObject *__pyx_tuple__260; static PyObject *__pyx_tuple__261; static PyObject *__pyx_tuple__262; static PyObject *__pyx_tuple__263; static PyObject *__pyx_tuple__264; static PyObject *__pyx_tuple__265; static PyObject *__pyx_tuple__266; static PyObject *__pyx_tuple__267; static PyObject *__pyx_tuple__268; static PyObject *__pyx_tuple__269; static PyObject *__pyx_tuple__270; static PyObject *__pyx_tuple__271; static PyObject *__pyx_tuple__272; static PyObject *__pyx_tuple__273; static PyObject *__pyx_tuple__274; static PyObject *__pyx_tuple__275; static PyObject *__pyx_tuple__276; static PyObject *__pyx_tuple__277; static PyObject *__pyx_tuple__278; static PyObject *__pyx_tuple__279; static PyObject *__pyx_tuple__280; static PyObject *__pyx_tuple__281; static PyObject *__pyx_tuple__282; static PyObject *__pyx_tuple__283; static PyObject *__pyx_tuple__284; static PyObject *__pyx_tuple__285; static PyObject *__pyx_tuple__286; static PyObject *__pyx_tuple__287; static PyObject *__pyx_tuple__288; static PyObject *__pyx_tuple__289; static PyObject *__pyx_tuple__290; static PyObject *__pyx_tuple__291; static PyObject *__pyx_tuple__292; static PyObject *__pyx_tuple__293; static PyObject *__pyx_tuple__294; static PyObject *__pyx_tuple__295; static PyObject *__pyx_tuple__296; static PyObject *__pyx_tuple__297; static PyObject *__pyx_tuple__298; static PyObject *__pyx_tuple__299; static PyObject *__pyx_tuple__300; static PyObject *__pyx_tuple__301; static PyObject *__pyx_tuple__302; static PyObject *__pyx_tuple__303; static PyObject *__pyx_tuple__304; static PyObject *__pyx_tuple__305; static PyObject *__pyx_tuple__306; static PyObject *__pyx_tuple__307; static PyObject *__pyx_tuple__308; static PyObject *__pyx_tuple__309; static PyObject *__pyx_tuple__310; static PyObject *__pyx_tuple__311; static PyObject *__pyx_tuple__312; static PyObject *__pyx_tuple__313; static PyObject *__pyx_tuple__314; static PyObject *__pyx_tuple__315; static PyObject *__pyx_tuple__316; static PyObject *__pyx_tuple__317; static PyObject *__pyx_tuple__318; static PyObject *__pyx_tuple__319; static PyObject *__pyx_tuple__320; static PyObject *__pyx_tuple__321; static PyObject *__pyx_tuple__322; static PyObject *__pyx_tuple__323; static PyObject *__pyx_tuple__324; static PyObject *__pyx_tuple__325; static PyObject *__pyx_tuple__326; static PyObject *__pyx_tuple__327; static PyObject *__pyx_tuple__328; static PyObject *__pyx_tuple__329; static PyObject *__pyx_tuple__330; static PyObject *__pyx_tuple__331; static PyObject *__pyx_tuple__332; static PyObject *__pyx_tuple__333; static PyObject *__pyx_tuple__334; static PyObject *__pyx_tuple__335; static PyObject *__pyx_tuple__336; static PyObject *__pyx_tuple__337; static PyObject *__pyx_tuple__338; static PyObject *__pyx_tuple__339; static PyObject *__pyx_tuple__340; static PyObject *__pyx_tuple__341; static PyObject *__pyx_tuple__342; static PyObject *__pyx_tuple__343; static PyObject *__pyx_tuple__344; static PyObject *__pyx_tuple__345; static PyObject *__pyx_tuple__346; static PyObject *__pyx_tuple__347; static PyObject *__pyx_tuple__348; static PyObject *__pyx_tuple__349; static PyObject *__pyx_tuple__350; static PyObject *__pyx_tuple__351; static PyObject *__pyx_tuple__352; static PyObject *__pyx_tuple__353; static PyObject *__pyx_tuple__354; static PyObject *__pyx_tuple__355; static PyObject *__pyx_tuple__356; static PyObject *__pyx_tuple__357; static PyObject *__pyx_tuple__358; static PyObject *__pyx_tuple__359; static PyObject *__pyx_tuple__360; static PyObject *__pyx_tuple__361; static PyObject *__pyx_tuple__362; static PyObject *__pyx_tuple__363; static PyObject *__pyx_tuple__364; static PyObject *__pyx_tuple__365; static PyObject *__pyx_tuple__366; static PyObject *__pyx_tuple__367; static PyObject *__pyx_tuple__368; static PyObject *__pyx_tuple__369; static PyObject *__pyx_tuple__370; static PyObject *__pyx_tuple__371; static PyObject *__pyx_tuple__372; static PyObject *__pyx_tuple__373; static PyObject *__pyx_tuple__374; static PyObject *__pyx_tuple__375; static PyObject *__pyx_tuple__376; static PyObject *__pyx_tuple__377; static PyObject *__pyx_tuple__378; static PyObject *__pyx_tuple__379; static PyObject *__pyx_tuple__380; static PyObject *__pyx_tuple__381; static PyObject *__pyx_tuple__382; static PyObject *__pyx_tuple__383; static PyObject *__pyx_tuple__384; static PyObject *__pyx_tuple__385; static PyObject *__pyx_tuple__386; static PyObject *__pyx_tuple__387; static PyObject *__pyx_tuple__388; static PyObject *__pyx_tuple__389; static PyObject *__pyx_tuple__390; static PyObject *__pyx_tuple__391; static PyObject *__pyx_tuple__392; static PyObject *__pyx_tuple__393; static PyObject *__pyx_tuple__394; static PyObject *__pyx_tuple__395; static PyObject *__pyx_tuple__396; static PyObject *__pyx_tuple__397; static PyObject *__pyx_tuple__398; static PyObject *__pyx_tuple__399; static PyObject *__pyx_tuple__400; static PyObject *__pyx_tuple__401; static PyObject *__pyx_tuple__402; static PyObject *__pyx_tuple__403; static PyObject *__pyx_tuple__404; static PyObject *__pyx_tuple__405; static PyObject *__pyx_tuple__406; static PyObject *__pyx_tuple__407; static PyObject *__pyx_tuple__408; static PyObject *__pyx_tuple__409; static PyObject *__pyx_tuple__410; static PyObject *__pyx_tuple__411; static PyObject *__pyx_tuple__412; static PyObject *__pyx_tuple__413; static PyObject *__pyx_tuple__414; static PyObject *__pyx_tuple__415; static PyObject *__pyx_tuple__416; static PyObject *__pyx_tuple__417; static PyObject *__pyx_tuple__418; static PyObject *__pyx_tuple__419; static PyObject *__pyx_tuple__420; static PyObject *__pyx_tuple__421; static PyObject *__pyx_tuple__422; static PyObject *__pyx_tuple__423; static PyObject *__pyx_tuple__424; static PyObject *__pyx_tuple__425; static PyObject *__pyx_tuple__426; static PyObject *__pyx_tuple__427; static PyObject *__pyx_tuple__428; static PyObject *__pyx_tuple__429; static PyObject *__pyx_tuple__430; static PyObject *__pyx_tuple__431; static PyObject *__pyx_tuple__432; static PyObject *__pyx_tuple__433; static PyObject *__pyx_tuple__434; static PyObject *__pyx_tuple__435; static PyObject *__pyx_tuple__436; static PyObject *__pyx_tuple__437; static PyObject *__pyx_tuple__438; static PyObject *__pyx_tuple__439; static PyObject *__pyx_tuple__440; static PyObject *__pyx_tuple__441; static PyObject *__pyx_tuple__442; static PyObject *__pyx_tuple__443; static PyObject *__pyx_tuple__444; static PyObject *__pyx_tuple__445; static PyObject *__pyx_tuple__446; static PyObject *__pyx_tuple__447; static PyObject *__pyx_tuple__448; static PyObject *__pyx_tuple__449; static PyObject *__pyx_tuple__450; static PyObject *__pyx_tuple__451; static PyObject *__pyx_tuple__452; static PyObject *__pyx_tuple__453; static PyObject *__pyx_tuple__454; static PyObject *__pyx_tuple__455; static PyObject *__pyx_tuple__456; static PyObject *__pyx_tuple__457; static PyObject *__pyx_tuple__458; static PyObject *__pyx_tuple__459; static PyObject *__pyx_tuple__460; static PyObject *__pyx_tuple__461; static PyObject *__pyx_tuple__462; static PyObject *__pyx_tuple__463; static PyObject *__pyx_tuple__464; static PyObject *__pyx_tuple__465; static PyObject *__pyx_tuple__466; static PyObject *__pyx_tuple__467; static PyObject *__pyx_tuple__468; static PyObject *__pyx_tuple__469; static PyObject *__pyx_tuple__470; static PyObject *__pyx_tuple__471; static PyObject *__pyx_tuple__472; static PyObject *__pyx_tuple__473; static PyObject *__pyx_tuple__474; static PyObject *__pyx_tuple__475; static PyObject *__pyx_tuple__476; static PyObject *__pyx_tuple__477; static PyObject *__pyx_tuple__478; static PyObject *__pyx_tuple__479; static PyObject *__pyx_tuple__480; static PyObject *__pyx_tuple__481; static PyObject *__pyx_tuple__482; static PyObject *__pyx_tuple__483; static PyObject *__pyx_tuple__484; static PyObject *__pyx_tuple__485; static PyObject *__pyx_tuple__486; static PyObject *__pyx_tuple__487; static PyObject *__pyx_tuple__488; static PyObject *__pyx_tuple__489; static PyObject *__pyx_tuple__490; static PyObject *__pyx_tuple__491; static PyObject *__pyx_tuple__492; static PyObject *__pyx_tuple__493; static PyObject *__pyx_tuple__494; static PyObject *__pyx_tuple__495; static PyObject *__pyx_tuple__496; static PyObject *__pyx_tuple__497; static PyObject *__pyx_tuple__498; static PyObject *__pyx_tuple__499; static PyObject *__pyx_tuple__500; static PyObject *__pyx_tuple__501; static PyObject *__pyx_tuple__502; static PyObject *__pyx_tuple__503; static PyObject *__pyx_tuple__504; static PyObject *__pyx_tuple__505; static PyObject *__pyx_tuple__506; static PyObject *__pyx_tuple__507; static PyObject *__pyx_tuple__508; static PyObject *__pyx_tuple__509; static PyObject *__pyx_tuple__510; static PyObject *__pyx_tuple__511; static PyObject *__pyx_tuple__512; static PyObject *__pyx_tuple__513; static PyObject *__pyx_tuple__514; static PyObject *__pyx_tuple__515; static PyObject *__pyx_tuple__516; static PyObject *__pyx_tuple__517; static PyObject *__pyx_tuple__518; static PyObject *__pyx_tuple__519; static PyObject *__pyx_tuple__520; static PyObject *__pyx_tuple__521; static PyObject *__pyx_tuple__522; static PyObject *__pyx_tuple__523; static PyObject *__pyx_tuple__524; static PyObject *__pyx_tuple__525; static PyObject *__pyx_tuple__526; static PyObject *__pyx_tuple__527; static PyObject *__pyx_tuple__528; static PyObject *__pyx_tuple__529; static PyObject *__pyx_tuple__530; static PyObject *__pyx_tuple__531; static PyObject *__pyx_tuple__532; static PyObject *__pyx_tuple__533; static PyObject *__pyx_tuple__534; static PyObject *__pyx_tuple__535; static PyObject *__pyx_tuple__536; static PyObject *__pyx_tuple__537; static PyObject *__pyx_tuple__538; static PyObject *__pyx_tuple__539; static PyObject *__pyx_tuple__540; static PyObject *__pyx_tuple__541; static PyObject *__pyx_tuple__542; static PyObject *__pyx_tuple__543; static PyObject *__pyx_tuple__544; static PyObject *__pyx_tuple__545; static PyObject *__pyx_tuple__546; static PyObject *__pyx_tuple__547; static PyObject *__pyx_tuple__548; static PyObject *__pyx_tuple__549; static PyObject *__pyx_tuple__550; static PyObject *__pyx_tuple__551; static PyObject *__pyx_tuple__552; static PyObject *__pyx_tuple__553; static PyObject *__pyx_tuple__554; static PyObject *__pyx_tuple__555; static PyObject *__pyx_tuple__556; static PyObject *__pyx_tuple__557; static PyObject *__pyx_tuple__558; static PyObject *__pyx_tuple__559; static PyObject *__pyx_tuple__560; static PyObject *__pyx_tuple__561; static PyObject *__pyx_tuple__562; static PyObject *__pyx_tuple__563; static PyObject *__pyx_tuple__564; static PyObject *__pyx_tuple__565; static PyObject *__pyx_tuple__566; static PyObject *__pyx_tuple__567; static PyObject *__pyx_tuple__568; static PyObject *__pyx_tuple__569; static PyObject *__pyx_tuple__570; static PyObject *__pyx_tuple__571; static PyObject *__pyx_tuple__572; static PyObject *__pyx_tuple__573; static PyObject *__pyx_tuple__574; static PyObject *__pyx_tuple__575; static PyObject *__pyx_tuple__576; static PyObject *__pyx_tuple__577; static PyObject *__pyx_tuple__578; static PyObject *__pyx_tuple__579; static PyObject *__pyx_tuple__580; static PyObject *__pyx_tuple__581; static PyObject *__pyx_tuple__582; static PyObject *__pyx_tuple__583; static PyObject *__pyx_tuple__584; static PyObject *__pyx_tuple__585; static PyObject *__pyx_tuple__586; static PyObject *__pyx_tuple__587; static PyObject *__pyx_tuple__588; static PyObject *__pyx_tuple__589; static PyObject *__pyx_tuple__590; static PyObject *__pyx_tuple__591; static PyObject *__pyx_tuple__592; static PyObject *__pyx_tuple__593; static PyObject *__pyx_tuple__594; static PyObject *__pyx_tuple__595; static PyObject *__pyx_tuple__596; static PyObject *__pyx_tuple__597; static PyObject *__pyx_tuple__598; static PyObject *__pyx_tuple__599; static PyObject *__pyx_tuple__600; static PyObject *__pyx_tuple__601; static PyObject *__pyx_tuple__602; static PyObject *__pyx_tuple__603; static PyObject *__pyx_tuple__604; static PyObject *__pyx_tuple__605; static PyObject *__pyx_tuple__606; static PyObject *__pyx_tuple__607; static PyObject *__pyx_tuple__608; static PyObject *__pyx_tuple__609; static PyObject *__pyx_tuple__610; static PyObject *__pyx_tuple__611; static PyObject *__pyx_tuple__612; static PyObject *__pyx_tuple__613; static PyObject *__pyx_tuple__614; static PyObject *__pyx_tuple__615; static PyObject *__pyx_tuple__616; static PyObject *__pyx_tuple__617; static PyObject *__pyx_tuple__618; static PyObject *__pyx_tuple__619; static PyObject *__pyx_tuple__620; static PyObject *__pyx_tuple__621; static PyObject *__pyx_tuple__622; static PyObject *__pyx_tuple__623; static PyObject *__pyx_tuple__624; static PyObject *__pyx_tuple__625; static PyObject *__pyx_tuple__626; static PyObject *__pyx_tuple__627; static PyObject *__pyx_tuple__628; static PyObject *__pyx_tuple__629; static PyObject *__pyx_tuple__630; static PyObject *__pyx_tuple__631; static PyObject *__pyx_tuple__632; static PyObject *__pyx_tuple__633; static PyObject *__pyx_tuple__634; static PyObject *__pyx_tuple__635; static PyObject *__pyx_tuple__636; static PyObject *__pyx_tuple__637; static PyObject *__pyx_tuple__638; static PyObject *__pyx_tuple__639; static PyObject *__pyx_tuple__640; static PyObject *__pyx_tuple__641; static PyObject *__pyx_tuple__642; static PyObject *__pyx_tuple__643; static PyObject *__pyx_tuple__644; static PyObject *__pyx_tuple__645; static PyObject *__pyx_tuple__646; static PyObject *__pyx_tuple__647; static PyObject *__pyx_tuple__648; static PyObject *__pyx_tuple__649; static PyObject *__pyx_tuple__650; static PyObject *__pyx_tuple__651; static PyObject *__pyx_tuple__652; static PyObject *__pyx_tuple__653; static PyObject *__pyx_tuple__654; static PyObject *__pyx_tuple__655; static PyObject *__pyx_tuple__656; static PyObject *__pyx_tuple__657; static PyObject *__pyx_tuple__658; static PyObject *__pyx_tuple__659; static PyObject *__pyx_tuple__660; static PyObject *__pyx_tuple__661; static PyObject *__pyx_tuple__662; static PyObject *__pyx_tuple__663; static PyObject *__pyx_tuple__664; static PyObject *__pyx_tuple__665; static PyObject *__pyx_tuple__666; static PyObject *__pyx_tuple__667; static PyObject *__pyx_tuple__668; static PyObject *__pyx_tuple__669; static PyObject *__pyx_tuple__670; static PyObject *__pyx_tuple__671; static PyObject *__pyx_tuple__672; static PyObject *__pyx_tuple__673; static PyObject *__pyx_tuple__674; static PyObject *__pyx_tuple__675; static PyObject *__pyx_tuple__676; static PyObject *__pyx_tuple__677; static PyObject *__pyx_tuple__678; static PyObject *__pyx_tuple__679; static PyObject *__pyx_tuple__680; static PyObject *__pyx_tuple__681; static PyObject *__pyx_tuple__682; static PyObject *__pyx_tuple__683; static PyObject *__pyx_tuple__684; static PyObject *__pyx_tuple__685; static PyObject *__pyx_tuple__686; static PyObject *__pyx_tuple__687; static PyObject *__pyx_codeobj__11; /* "pygame_sdl2/color.pyx":26 * include "color_dict.pxi" * * cdef Uint32 map_color(SDL_Surface *surface, color) except? 0xaabbccdd: # <<<<<<<<<<<<<< * """ * Maps `color` into an RGBA color value that can be used with `surface`. */ static Uint32 __pyx_f_11pygame_sdl2_5color_map_color(SDL_Surface *__pyx_v_surface, PyObject *__pyx_v_color) { Uint8 __pyx_v_r; Uint8 __pyx_v_g; Uint8 __pyx_v_b; Uint8 __pyx_v_a; Uint32 __pyx_r; __Pyx_RefNannyDeclarations int __pyx_t_1; int __pyx_t_2; int __pyx_t_3; int __pyx_t_4; Py_ssize_t __pyx_t_5; PyObject *__pyx_t_6 = NULL; PyObject *__pyx_t_7 = NULL; PyObject *__pyx_t_8 = NULL; PyObject *__pyx_t_9 = NULL; PyObject *__pyx_t_10 = NULL; PyObject *(*__pyx_t_11)(PyObject *); Uint8 __pyx_t_12; Uint8 __pyx_t_13; Uint8 __pyx_t_14; Uint8 __pyx_t_15; Uint32 __pyx_t_16; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("map_color", 0); /* "pygame_sdl2/color.pyx":33 * cdef Uint8 r, g, b, a * * if isinstance(color, (tuple, list, Color)) and len(color) == 4: # <<<<<<<<<<<<<< * r, g, b, a = color * elif isinstance(color, (tuple, list, Color)) and len(color) == 3: */ __pyx_t_3 = PyTuple_Check(__pyx_v_color); __pyx_t_4 = (__pyx_t_3 != 0); if (!__pyx_t_4) { } else { __pyx_t_2 = __pyx_t_4; goto __pyx_L6_bool_binop_done; } __pyx_t_4 = PyList_Check(__pyx_v_color); __pyx_t_3 = (__pyx_t_4 != 0); if (!__pyx_t_3) { } else { __pyx_t_2 = __pyx_t_3; goto __pyx_L6_bool_binop_done; } __pyx_t_3 = __Pyx_TypeCheck(__pyx_v_color, __pyx_ptype_11pygame_sdl2_5color_Color); __pyx_t_4 = (__pyx_t_3 != 0); __pyx_t_2 = __pyx_t_4; __pyx_L6_bool_binop_done:; __pyx_t_4 = (__pyx_t_2 != 0); if (__pyx_t_4) { } else { __pyx_t_1 = __pyx_t_4; goto __pyx_L4_bool_binop_done; } __pyx_t_5 = PyObject_Length(__pyx_v_color); if (unlikely(__pyx_t_5 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 33; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_t_4 = ((__pyx_t_5 == 4) != 0); __pyx_t_1 = __pyx_t_4; __pyx_L4_bool_binop_done:; if (__pyx_t_1) { /* "pygame_sdl2/color.pyx":34 * * if isinstance(color, (tuple, list, Color)) and len(color) == 4: * r, g, b, a = color # <<<<<<<<<<<<<< * elif isinstance(color, (tuple, list, Color)) and len(color) == 3: * r, g, b = color */ if ((likely(PyTuple_CheckExact(__pyx_v_color))) || (PyList_CheckExact(__pyx_v_color))) { PyObject* sequence = __pyx_v_color; #if CYTHON_COMPILING_IN_CPYTHON Py_ssize_t size = Py_SIZE(sequence); #else Py_ssize_t size = PySequence_Size(sequence); #endif if (unlikely(size != 4)) { if (size > 4) __Pyx_RaiseTooManyValuesError(4); else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 34; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } #if CYTHON_COMPILING_IN_CPYTHON if (likely(PyTuple_CheckExact(sequence))) { __pyx_t_6 = PyTuple_GET_ITEM(sequence, 0); __pyx_t_7 = PyTuple_GET_ITEM(sequence, 1); __pyx_t_8 = PyTuple_GET_ITEM(sequence, 2); __pyx_t_9 = PyTuple_GET_ITEM(sequence, 3); } else { __pyx_t_6 = PyList_GET_ITEM(sequence, 0); __pyx_t_7 = PyList_GET_ITEM(sequence, 1); __pyx_t_8 = PyList_GET_ITEM(sequence, 2); __pyx_t_9 = PyList_GET_ITEM(sequence, 3); } __Pyx_INCREF(__pyx_t_6); __Pyx_INCREF(__pyx_t_7); __Pyx_INCREF(__pyx_t_8); __Pyx_INCREF(__pyx_t_9); #else { Py_ssize_t i; PyObject** temps[4] = {&__pyx_t_6,&__pyx_t_7,&__pyx_t_8,&__pyx_t_9}; for (i=0; i < 4; i++) { PyObject* item = PySequence_ITEM(sequence, i); if (unlikely(!item)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 34; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(item); *(temps[i]) = item; } } #endif } else { Py_ssize_t index = -1; PyObject** temps[4] = {&__pyx_t_6,&__pyx_t_7,&__pyx_t_8,&__pyx_t_9}; __pyx_t_10 = PyObject_GetIter(__pyx_v_color); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 34; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_10); __pyx_t_11 = Py_TYPE(__pyx_t_10)->tp_iternext; for (index=0; index < 4; index++) { PyObject* item = __pyx_t_11(__pyx_t_10); if (unlikely(!item)) goto __pyx_L9_unpacking_failed; __Pyx_GOTREF(item); *(temps[index]) = item; } if (__Pyx_IternextUnpackEndCheck(__pyx_t_11(__pyx_t_10), 4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 34; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_t_11 = NULL; __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; goto __pyx_L10_unpacking_done; __pyx_L9_unpacking_failed:; __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; __pyx_t_11 = NULL; if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 34; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_L10_unpacking_done:; } __pyx_t_12 = __Pyx_PyInt_As_uint8_t(__pyx_t_6); if (unlikely((__pyx_t_12 == (Uint8)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 34; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __pyx_t_13 = __Pyx_PyInt_As_uint8_t(__pyx_t_7); if (unlikely((__pyx_t_13 == (Uint8)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 34; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __pyx_t_14 = __Pyx_PyInt_As_uint8_t(__pyx_t_8); if (unlikely((__pyx_t_14 == (Uint8)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 34; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; __pyx_t_15 = __Pyx_PyInt_As_uint8_t(__pyx_t_9); if (unlikely((__pyx_t_15 == (Uint8)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 34; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; __pyx_v_r = __pyx_t_12; __pyx_v_g = __pyx_t_13; __pyx_v_b = __pyx_t_14; __pyx_v_a = __pyx_t_15; /* "pygame_sdl2/color.pyx":33 * cdef Uint8 r, g, b, a * * if isinstance(color, (tuple, list, Color)) and len(color) == 4: # <<<<<<<<<<<<<< * r, g, b, a = color * elif isinstance(color, (tuple, list, Color)) and len(color) == 3: */ goto __pyx_L3; } /* "pygame_sdl2/color.pyx":35 * if isinstance(color, (tuple, list, Color)) and len(color) == 4: * r, g, b, a = color * elif isinstance(color, (tuple, list, Color)) and len(color) == 3: # <<<<<<<<<<<<<< * r, g, b = color * a = 255 */ __pyx_t_2 = PyTuple_Check(__pyx_v_color); __pyx_t_3 = (__pyx_t_2 != 0); if (!__pyx_t_3) { } else { __pyx_t_4 = __pyx_t_3; goto __pyx_L13_bool_binop_done; } __pyx_t_3 = PyList_Check(__pyx_v_color); __pyx_t_2 = (__pyx_t_3 != 0); if (!__pyx_t_2) { } else { __pyx_t_4 = __pyx_t_2; goto __pyx_L13_bool_binop_done; } __pyx_t_2 = __Pyx_TypeCheck(__pyx_v_color, __pyx_ptype_11pygame_sdl2_5color_Color); __pyx_t_3 = (__pyx_t_2 != 0); __pyx_t_4 = __pyx_t_3; __pyx_L13_bool_binop_done:; __pyx_t_3 = (__pyx_t_4 != 0); if (__pyx_t_3) { } else { __pyx_t_1 = __pyx_t_3; goto __pyx_L11_bool_binop_done; } __pyx_t_5 = PyObject_Length(__pyx_v_color); if (unlikely(__pyx_t_5 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 35; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_t_3 = ((__pyx_t_5 == 3) != 0); __pyx_t_1 = __pyx_t_3; __pyx_L11_bool_binop_done:; if (__pyx_t_1) { /* "pygame_sdl2/color.pyx":36 * r, g, b, a = color * elif isinstance(color, (tuple, list, Color)) and len(color) == 3: * r, g, b = color # <<<<<<<<<<<<<< * a = 255 * elif isinstance(color, int): */ if ((likely(PyTuple_CheckExact(__pyx_v_color))) || (PyList_CheckExact(__pyx_v_color))) { PyObject* sequence = __pyx_v_color; #if CYTHON_COMPILING_IN_CPYTHON Py_ssize_t size = Py_SIZE(sequence); #else Py_ssize_t size = PySequence_Size(sequence); #endif if (unlikely(size != 3)) { if (size > 3) __Pyx_RaiseTooManyValuesError(3); else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 36; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } #if CYTHON_COMPILING_IN_CPYTHON if (likely(PyTuple_CheckExact(sequence))) { __pyx_t_9 = PyTuple_GET_ITEM(sequence, 0); __pyx_t_8 = PyTuple_GET_ITEM(sequence, 1); __pyx_t_7 = PyTuple_GET_ITEM(sequence, 2); } else { __pyx_t_9 = PyList_GET_ITEM(sequence, 0); __pyx_t_8 = PyList_GET_ITEM(sequence, 1); __pyx_t_7 = PyList_GET_ITEM(sequence, 2); } __Pyx_INCREF(__pyx_t_9); __Pyx_INCREF(__pyx_t_8); __Pyx_INCREF(__pyx_t_7); #else __pyx_t_9 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 36; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_9); __pyx_t_8 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 36; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_8); __pyx_t_7 = PySequence_ITEM(sequence, 2); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 36; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_7); #endif } else { Py_ssize_t index = -1; __pyx_t_6 = PyObject_GetIter(__pyx_v_color); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 36; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_6); __pyx_t_11 = Py_TYPE(__pyx_t_6)->tp_iternext; index = 0; __pyx_t_9 = __pyx_t_11(__pyx_t_6); if (unlikely(!__pyx_t_9)) goto __pyx_L16_unpacking_failed; __Pyx_GOTREF(__pyx_t_9); index = 1; __pyx_t_8 = __pyx_t_11(__pyx_t_6); if (unlikely(!__pyx_t_8)) goto __pyx_L16_unpacking_failed; __Pyx_GOTREF(__pyx_t_8); index = 2; __pyx_t_7 = __pyx_t_11(__pyx_t_6); if (unlikely(!__pyx_t_7)) goto __pyx_L16_unpacking_failed; __Pyx_GOTREF(__pyx_t_7); if (__Pyx_IternextUnpackEndCheck(__pyx_t_11(__pyx_t_6), 3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 36; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_t_11 = NULL; __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; goto __pyx_L17_unpacking_done; __pyx_L16_unpacking_failed:; __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __pyx_t_11 = NULL; if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 36; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_L17_unpacking_done:; } __pyx_t_15 = __Pyx_PyInt_As_uint8_t(__pyx_t_9); if (unlikely((__pyx_t_15 == (Uint8)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 36; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; __pyx_t_14 = __Pyx_PyInt_As_uint8_t(__pyx_t_8); if (unlikely((__pyx_t_14 == (Uint8)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 36; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; __pyx_t_13 = __Pyx_PyInt_As_uint8_t(__pyx_t_7); if (unlikely((__pyx_t_13 == (Uint8)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 36; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __pyx_v_r = __pyx_t_15; __pyx_v_g = __pyx_t_14; __pyx_v_b = __pyx_t_13; /* "pygame_sdl2/color.pyx":37 * elif isinstance(color, (tuple, list, Color)) and len(color) == 3: * r, g, b = color * a = 255 # <<<<<<<<<<<<<< * elif isinstance(color, int): * return color */ __pyx_v_a = 0xFF; /* "pygame_sdl2/color.pyx":35 * if isinstance(color, (tuple, list, Color)) and len(color) == 4: * r, g, b, a = color * elif isinstance(color, (tuple, list, Color)) and len(color) == 3: # <<<<<<<<<<<<<< * r, g, b = color * a = 255 */ goto __pyx_L3; } /* "pygame_sdl2/color.pyx":38 * r, g, b = color * a = 255 * elif isinstance(color, int): # <<<<<<<<<<<<<< * return color * else: */ __pyx_t_1 = PyInt_Check(__pyx_v_color); __pyx_t_3 = (__pyx_t_1 != 0); if (__pyx_t_3) { /* "pygame_sdl2/color.pyx":39 * a = 255 * elif isinstance(color, int): * return color # <<<<<<<<<<<<<< * else: * raise TypeError("Expected a color.") */ __pyx_t_16 = __Pyx_PyInt_As_uint32_t(__pyx_v_color); if (unlikely((__pyx_t_16 == (Uint32)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 39; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_r = __pyx_t_16; goto __pyx_L0; /* "pygame_sdl2/color.pyx":38 * r, g, b = color * a = 255 * elif isinstance(color, int): # <<<<<<<<<<<<<< * return color * else: */ } /* "pygame_sdl2/color.pyx":41 * return color * else: * raise TypeError("Expected a color.") # <<<<<<<<<<<<<< * * return SDL_MapRGBA(surface.format, r, g, b, a) */ /*else*/ { __pyx_t_7 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple_, NULL); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 41; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_7); __Pyx_Raise(__pyx_t_7, 0, 0, 0); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; {__pyx_filename = __pyx_f[0]; __pyx_lineno = 41; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } __pyx_L3:; /* "pygame_sdl2/color.pyx":43 * raise TypeError("Expected a color.") * * return SDL_MapRGBA(surface.format, r, g, b, a) # <<<<<<<<<<<<<< * * cdef object get_color(Uint32 pixel, SDL_Surface *surface): */ __pyx_r = SDL_MapRGBA(__pyx_v_surface->format, __pyx_v_r, __pyx_v_g, __pyx_v_b, __pyx_v_a); goto __pyx_L0; /* "pygame_sdl2/color.pyx":26 * include "color_dict.pxi" * * cdef Uint32 map_color(SDL_Surface *surface, color) except? 0xaabbccdd: # <<<<<<<<<<<<<< * """ * Maps `color` into an RGBA color value that can be used with `surface`. */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_6); __Pyx_XDECREF(__pyx_t_7); __Pyx_XDECREF(__pyx_t_8); __Pyx_XDECREF(__pyx_t_9); __Pyx_XDECREF(__pyx_t_10); __Pyx_AddTraceback("pygame_sdl2.color.map_color", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0xaabbccdd; __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/color.pyx":45 * return SDL_MapRGBA(surface.format, r, g, b, a) * * cdef object get_color(Uint32 pixel, SDL_Surface *surface): # <<<<<<<<<<<<<< * cdef Uint8 r * cdef Uint8 g */ static PyObject *__pyx_f_11pygame_sdl2_5color_get_color(Uint32 __pyx_v_pixel, SDL_Surface *__pyx_v_surface) { Uint8 __pyx_v_r; Uint8 __pyx_v_g; Uint8 __pyx_v_b; Uint8 __pyx_v_a; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; PyObject *__pyx_t_5 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("get_color", 0); /* "pygame_sdl2/color.pyx":51 * cdef Uint8 a * * SDL_GetRGBA(pixel, surface.format, &r, &g, &b, &a) # <<<<<<<<<<<<<< * * return Color(r, g, b, a) */ SDL_GetRGBA(__pyx_v_pixel, __pyx_v_surface->format, (&__pyx_v_r), (&__pyx_v_g), (&__pyx_v_b), (&__pyx_v_a)); /* "pygame_sdl2/color.pyx":53 * SDL_GetRGBA(pixel, surface.format, &r, &g, &b, &a) * * return Color(r, g, b, a) # <<<<<<<<<<<<<< * * cdef to_sdl_color(color, SDL_Color *out): */ __Pyx_XDECREF(__pyx_r); __pyx_t_1 = __Pyx_PyInt_From_uint8_t(__pyx_v_r); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 53; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = __Pyx_PyInt_From_uint8_t(__pyx_v_g); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 53; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = __Pyx_PyInt_From_uint8_t(__pyx_v_b); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 53; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = __Pyx_PyInt_From_uint8_t(__pyx_v_a); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 53; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); __pyx_t_5 = PyTuple_New(4); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 53; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); __Pyx_GIVEREF(__pyx_t_1); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_1); __Pyx_GIVEREF(__pyx_t_2); PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_t_2); __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_5, 2, __pyx_t_3); __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_5, 3, __pyx_t_4); __pyx_t_1 = 0; __pyx_t_2 = 0; __pyx_t_3 = 0; __pyx_t_4 = 0; __pyx_t_4 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_11pygame_sdl2_5color_Color), __pyx_t_5, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 53; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __pyx_r = __pyx_t_4; __pyx_t_4 = 0; goto __pyx_L0; /* "pygame_sdl2/color.pyx":45 * return SDL_MapRGBA(surface.format, r, g, b, a) * * cdef object get_color(Uint32 pixel, SDL_Surface *surface): # <<<<<<<<<<<<<< * cdef Uint8 r * cdef Uint8 g */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_5); __Pyx_AddTraceback("pygame_sdl2.color.get_color", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/color.pyx":55 * return Color(r, g, b, a) * * cdef to_sdl_color(color, SDL_Color *out): # <<<<<<<<<<<<<< * if not isinstance(color, Color): * color = Color(color) */ static PyObject *__pyx_f_11pygame_sdl2_5color_to_sdl_color(PyObject *__pyx_v_color, SDL_Color *__pyx_v_out) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; int __pyx_t_2; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; Uint8 __pyx_t_5; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("to_sdl_color", 0); __Pyx_INCREF(__pyx_v_color); /* "pygame_sdl2/color.pyx":56 * * cdef to_sdl_color(color, SDL_Color *out): * if not isinstance(color, Color): # <<<<<<<<<<<<<< * color = Color(color) * out.r = color.r */ __pyx_t_1 = __Pyx_TypeCheck(__pyx_v_color, __pyx_ptype_11pygame_sdl2_5color_Color); __pyx_t_2 = ((!(__pyx_t_1 != 0)) != 0); if (__pyx_t_2) { /* "pygame_sdl2/color.pyx":57 * cdef to_sdl_color(color, SDL_Color *out): * if not isinstance(color, Color): * color = Color(color) # <<<<<<<<<<<<<< * out.r = color.r * out.g = color.g */ __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 57; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __Pyx_INCREF(__pyx_v_color); __Pyx_GIVEREF(__pyx_v_color); PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_color); __pyx_t_4 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_11pygame_sdl2_5color_Color), __pyx_t_3, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 57; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF_SET(__pyx_v_color, __pyx_t_4); __pyx_t_4 = 0; /* "pygame_sdl2/color.pyx":56 * * cdef to_sdl_color(color, SDL_Color *out): * if not isinstance(color, Color): # <<<<<<<<<<<<<< * color = Color(color) * out.r = color.r */ } /* "pygame_sdl2/color.pyx":58 * if not isinstance(color, Color): * color = Color(color) * out.r = color.r # <<<<<<<<<<<<<< * out.g = color.g * out.b = color.b */ __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_color, __pyx_n_s_r); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 58; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); __pyx_t_5 = __Pyx_PyInt_As_uint8_t(__pyx_t_4); if (unlikely((__pyx_t_5 == (Uint8)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 58; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_v_out->r = __pyx_t_5; /* "pygame_sdl2/color.pyx":59 * color = Color(color) * out.r = color.r * out.g = color.g # <<<<<<<<<<<<<< * out.b = color.b * out.a = color.a */ __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_color, __pyx_n_s_g); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 59; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); __pyx_t_5 = __Pyx_PyInt_As_uint8_t(__pyx_t_4); if (unlikely((__pyx_t_5 == (Uint8)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 59; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_v_out->g = __pyx_t_5; /* "pygame_sdl2/color.pyx":60 * out.r = color.r * out.g = color.g * out.b = color.b # <<<<<<<<<<<<<< * out.a = color.a * */ __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_color, __pyx_n_s_b); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 60; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); __pyx_t_5 = __Pyx_PyInt_As_uint8_t(__pyx_t_4); if (unlikely((__pyx_t_5 == (Uint8)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 60; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_v_out->b = __pyx_t_5; /* "pygame_sdl2/color.pyx":61 * out.g = color.g * out.b = color.b * out.a = color.a # <<<<<<<<<<<<<< * * cdef class Color: */ __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_color, __pyx_n_s_a); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 61; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); __pyx_t_5 = __Pyx_PyInt_As_uint8_t(__pyx_t_4); if (unlikely((__pyx_t_5 == (Uint8)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 61; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_v_out->a = __pyx_t_5; /* "pygame_sdl2/color.pyx":55 * return Color(r, g, b, a) * * cdef to_sdl_color(color, SDL_Color *out): # <<<<<<<<<<<<<< * if not isinstance(color, Color): * color = Color(color) */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_AddTraceback("pygame_sdl2.color.to_sdl_color", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XDECREF(__pyx_v_color); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/color.pyx":64 * * cdef class Color: * cdef from_rgba(self, Uint8 r, Uint8 g, Uint8 b, Uint8 a): # <<<<<<<<<<<<<< * self.r = r * self.g = g */ static PyObject *__pyx_f_11pygame_sdl2_5color_5Color_from_rgba(struct __pyx_obj_11pygame_sdl2_5color_Color *__pyx_v_self, Uint8 __pyx_v_r, Uint8 __pyx_v_g, Uint8 __pyx_v_b, Uint8 __pyx_v_a) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("from_rgba", 0); /* "pygame_sdl2/color.pyx":65 * cdef class Color: * cdef from_rgba(self, Uint8 r, Uint8 g, Uint8 b, Uint8 a): * self.r = r # <<<<<<<<<<<<<< * self.g = g * self.b = b */ __pyx_v_self->r = __pyx_v_r; /* "pygame_sdl2/color.pyx":66 * cdef from_rgba(self, Uint8 r, Uint8 g, Uint8 b, Uint8 a): * self.r = r * self.g = g # <<<<<<<<<<<<<< * self.b = b * self.a = a */ __pyx_v_self->g = __pyx_v_g; /* "pygame_sdl2/color.pyx":67 * self.r = r * self.g = g * self.b = b # <<<<<<<<<<<<<< * self.a = a * */ __pyx_v_self->b = __pyx_v_b; /* "pygame_sdl2/color.pyx":68 * self.g = g * self.b = b * self.a = a # <<<<<<<<<<<<<< * * cdef from_hex(self, c): */ __pyx_v_self->a = __pyx_v_a; /* "pygame_sdl2/color.pyx":64 * * cdef class Color: * cdef from_rgba(self, Uint8 r, Uint8 g, Uint8 b, Uint8 a): # <<<<<<<<<<<<<< * self.r = r * self.g = g */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/color.pyx":73 * # Handle short hex strings. * if len(c) == 3 or len(c) == 4: * c = "".join(map(lambda x: x*2, c)) # <<<<<<<<<<<<<< * * try: */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_5color_5Color_8from_hex_lambda(PyObject *__pyx_self, PyObject *__pyx_v_x); /*proto*/ static PyMethodDef __pyx_mdef_11pygame_sdl2_5color_5Color_8from_hex_lambda = {"lambda", (PyCFunction)__pyx_pw_11pygame_sdl2_5color_5Color_8from_hex_lambda, METH_O, 0}; static PyObject *__pyx_pw_11pygame_sdl2_5color_5Color_8from_hex_lambda(PyObject *__pyx_self, PyObject *__pyx_v_x) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("lambda (wrapper)", 0); __pyx_r = __pyx_lambda_funcdef_lambda(__pyx_self, ((PyObject *)__pyx_v_x)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_lambda_funcdef_lambda(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_x) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("lambda", 0); __Pyx_XDECREF(__pyx_r); __pyx_t_1 = PyNumber_Multiply(__pyx_v_x, __pyx_int_2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 73; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("pygame_sdl2.color.Color.from_hex.lambda", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/color.pyx":70 * self.a = a * * cdef from_hex(self, c): # <<<<<<<<<<<<<< * # Handle short hex strings. * if len(c) == 3 or len(c) == 4: */ static PyObject *__pyx_f_11pygame_sdl2_5color_5Color_from_hex(struct __pyx_obj_11pygame_sdl2_5color_Color *__pyx_v_self, PyObject *__pyx_v_c) { PyObject *__pyx_v_r = NULL; PyObject *__pyx_v_g = NULL; PyObject *__pyx_v_b = NULL; PyObject *__pyx_v_a = NULL; CYTHON_UNUSED PyObject *__pyx_v_e = NULL; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; Py_ssize_t __pyx_t_2; int __pyx_t_3; PyObject *__pyx_t_4 = NULL; PyObject *__pyx_t_5 = NULL; PyObject *__pyx_t_6 = NULL; PyObject *__pyx_t_7 = NULL; PyObject *__pyx_t_8 = NULL; PyObject *__pyx_t_9 = NULL; PyObject *__pyx_t_10 = NULL; PyObject *__pyx_t_11 = NULL; PyObject *__pyx_t_12 = NULL; PyObject *(*__pyx_t_13)(PyObject *); int __pyx_t_14; Uint8 __pyx_t_15; Uint8 __pyx_t_16; Uint8 __pyx_t_17; Uint8 __pyx_t_18; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("from_hex", 0); __Pyx_INCREF(__pyx_v_c); /* "pygame_sdl2/color.pyx":72 * cdef from_hex(self, c): * # Handle short hex strings. * if len(c) == 3 or len(c) == 4: # <<<<<<<<<<<<<< * c = "".join(map(lambda x: x*2, c)) * */ __pyx_t_2 = PyObject_Length(__pyx_v_c); if (unlikely(__pyx_t_2 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 72; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_t_3 = ((__pyx_t_2 == 3) != 0); if (!__pyx_t_3) { } else { __pyx_t_1 = __pyx_t_3; goto __pyx_L4_bool_binop_done; } __pyx_t_2 = PyObject_Length(__pyx_v_c); if (unlikely(__pyx_t_2 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 72; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_t_3 = ((__pyx_t_2 == 4) != 0); __pyx_t_1 = __pyx_t_3; __pyx_L4_bool_binop_done:; if (__pyx_t_1) { /* "pygame_sdl2/color.pyx":73 * # Handle short hex strings. * if len(c) == 3 or len(c) == 4: * c = "".join(map(lambda x: x*2, c)) # <<<<<<<<<<<<<< * * try: */ __pyx_t_4 = __Pyx_CyFunction_NewEx(&__pyx_mdef_11pygame_sdl2_5color_5Color_8from_hex_lambda, 0, __pyx_n_s_Color_from_hex_locals_lambda, NULL, __pyx_n_s_pygame_sdl2_color, __pyx_d, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 73; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); __pyx_t_5 = PyTuple_New(2); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 73; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_4); __Pyx_INCREF(__pyx_v_c); __Pyx_GIVEREF(__pyx_v_c); PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_v_c); __pyx_t_4 = 0; __pyx_t_4 = __Pyx_PyObject_Call(__pyx_builtin_map, __pyx_t_5, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 73; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __pyx_t_5 = __Pyx_PyString_Join(__pyx_kp_s__2, __pyx_t_4); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 73; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF_SET(__pyx_v_c, __pyx_t_5); __pyx_t_5 = 0; /* "pygame_sdl2/color.pyx":72 * cdef from_hex(self, c): * # Handle short hex strings. * if len(c) == 3 or len(c) == 4: # <<<<<<<<<<<<<< * c = "".join(map(lambda x: x*2, c)) * */ } /* "pygame_sdl2/color.pyx":75 * c = "".join(map(lambda x: x*2, c)) * * try: # <<<<<<<<<<<<<< * if len(c) == 6: * r, g, b = struct.unpack('BBB', binascii.unhexlify(c)) */ { __Pyx_ExceptionSave(&__pyx_t_6, &__pyx_t_7, &__pyx_t_8); __Pyx_XGOTREF(__pyx_t_6); __Pyx_XGOTREF(__pyx_t_7); __Pyx_XGOTREF(__pyx_t_8); /*try:*/ { /* "pygame_sdl2/color.pyx":76 * * try: * if len(c) == 6: # <<<<<<<<<<<<<< * r, g, b = struct.unpack('BBB', binascii.unhexlify(c)) * a = 255 */ __pyx_t_2 = PyObject_Length(__pyx_v_c); if (unlikely(__pyx_t_2 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 76; __pyx_clineno = __LINE__; goto __pyx_L6_error;} __pyx_t_1 = ((__pyx_t_2 == 6) != 0); if (__pyx_t_1) { /* "pygame_sdl2/color.pyx":77 * try: * if len(c) == 6: * r, g, b = struct.unpack('BBB', binascii.unhexlify(c)) # <<<<<<<<<<<<<< * a = 255 * elif len(c) == 8: */ __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_struct); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 77; __pyx_clineno = __LINE__; goto __pyx_L6_error;} __Pyx_GOTREF(__pyx_t_4); __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_unpack); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 77; __pyx_clineno = __LINE__; goto __pyx_L6_error;} __Pyx_GOTREF(__pyx_t_9); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_t_10 = __Pyx_GetModuleGlobalName(__pyx_n_s_binascii); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 77; __pyx_clineno = __LINE__; goto __pyx_L6_error;} __Pyx_GOTREF(__pyx_t_10); __pyx_t_11 = __Pyx_PyObject_GetAttrStr(__pyx_t_10, __pyx_n_s_unhexlify); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 77; __pyx_clineno = __LINE__; goto __pyx_L6_error;} __Pyx_GOTREF(__pyx_t_11); __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; __pyx_t_10 = NULL; if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_11))) { __pyx_t_10 = PyMethod_GET_SELF(__pyx_t_11); if (likely(__pyx_t_10)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_11); __Pyx_INCREF(__pyx_t_10); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_11, function); } } if (!__pyx_t_10) { __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_t_11, __pyx_v_c); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 77; __pyx_clineno = __LINE__; goto __pyx_L6_error;} __Pyx_GOTREF(__pyx_t_4); } else { __pyx_t_12 = PyTuple_New(1+1); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 77; __pyx_clineno = __LINE__; goto __pyx_L6_error;} __Pyx_GOTREF(__pyx_t_12); __Pyx_GIVEREF(__pyx_t_10); PyTuple_SET_ITEM(__pyx_t_12, 0, __pyx_t_10); __pyx_t_10 = NULL; __Pyx_INCREF(__pyx_v_c); __Pyx_GIVEREF(__pyx_v_c); PyTuple_SET_ITEM(__pyx_t_12, 0+1, __pyx_v_c); __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_11, __pyx_t_12, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 77; __pyx_clineno = __LINE__; goto __pyx_L6_error;} __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; } __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; __pyx_t_11 = NULL; __pyx_t_2 = 0; if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_9))) { __pyx_t_11 = PyMethod_GET_SELF(__pyx_t_9); if (likely(__pyx_t_11)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_9); __Pyx_INCREF(__pyx_t_11); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_9, function); __pyx_t_2 = 1; } } __pyx_t_12 = PyTuple_New(2+__pyx_t_2); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 77; __pyx_clineno = __LINE__; goto __pyx_L6_error;} __Pyx_GOTREF(__pyx_t_12); if (__pyx_t_11) { __Pyx_GIVEREF(__pyx_t_11); PyTuple_SET_ITEM(__pyx_t_12, 0, __pyx_t_11); __pyx_t_11 = NULL; } __Pyx_INCREF(__pyx_n_s_BBB); __Pyx_GIVEREF(__pyx_n_s_BBB); PyTuple_SET_ITEM(__pyx_t_12, 0+__pyx_t_2, __pyx_n_s_BBB); __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_12, 1+__pyx_t_2, __pyx_t_4); __pyx_t_4 = 0; __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_9, __pyx_t_12, NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 77; __pyx_clineno = __LINE__; goto __pyx_L6_error;} __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; if ((likely(PyTuple_CheckExact(__pyx_t_5))) || (PyList_CheckExact(__pyx_t_5))) { PyObject* sequence = __pyx_t_5; #if CYTHON_COMPILING_IN_CPYTHON Py_ssize_t size = Py_SIZE(sequence); #else Py_ssize_t size = PySequence_Size(sequence); #endif if (unlikely(size != 3)) { if (size > 3) __Pyx_RaiseTooManyValuesError(3); else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 77; __pyx_clineno = __LINE__; goto __pyx_L6_error;} } #if CYTHON_COMPILING_IN_CPYTHON if (likely(PyTuple_CheckExact(sequence))) { __pyx_t_9 = PyTuple_GET_ITEM(sequence, 0); __pyx_t_12 = PyTuple_GET_ITEM(sequence, 1); __pyx_t_4 = PyTuple_GET_ITEM(sequence, 2); } else { __pyx_t_9 = PyList_GET_ITEM(sequence, 0); __pyx_t_12 = PyList_GET_ITEM(sequence, 1); __pyx_t_4 = PyList_GET_ITEM(sequence, 2); } __Pyx_INCREF(__pyx_t_9); __Pyx_INCREF(__pyx_t_12); __Pyx_INCREF(__pyx_t_4); #else __pyx_t_9 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 77; __pyx_clineno = __LINE__; goto __pyx_L6_error;} __Pyx_GOTREF(__pyx_t_9); __pyx_t_12 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 77; __pyx_clineno = __LINE__; goto __pyx_L6_error;} __Pyx_GOTREF(__pyx_t_12); __pyx_t_4 = PySequence_ITEM(sequence, 2); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 77; __pyx_clineno = __LINE__; goto __pyx_L6_error;} __Pyx_GOTREF(__pyx_t_4); #endif __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; } else { Py_ssize_t index = -1; __pyx_t_11 = PyObject_GetIter(__pyx_t_5); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 77; __pyx_clineno = __LINE__; goto __pyx_L6_error;} __Pyx_GOTREF(__pyx_t_11); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __pyx_t_13 = Py_TYPE(__pyx_t_11)->tp_iternext; index = 0; __pyx_t_9 = __pyx_t_13(__pyx_t_11); if (unlikely(!__pyx_t_9)) goto __pyx_L15_unpacking_failed; __Pyx_GOTREF(__pyx_t_9); index = 1; __pyx_t_12 = __pyx_t_13(__pyx_t_11); if (unlikely(!__pyx_t_12)) goto __pyx_L15_unpacking_failed; __Pyx_GOTREF(__pyx_t_12); index = 2; __pyx_t_4 = __pyx_t_13(__pyx_t_11); if (unlikely(!__pyx_t_4)) goto __pyx_L15_unpacking_failed; __Pyx_GOTREF(__pyx_t_4); if (__Pyx_IternextUnpackEndCheck(__pyx_t_13(__pyx_t_11), 3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 77; __pyx_clineno = __LINE__; goto __pyx_L6_error;} __pyx_t_13 = NULL; __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; goto __pyx_L16_unpacking_done; __pyx_L15_unpacking_failed:; __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; __pyx_t_13 = NULL; if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 77; __pyx_clineno = __LINE__; goto __pyx_L6_error;} __pyx_L16_unpacking_done:; } __pyx_v_r = __pyx_t_9; __pyx_t_9 = 0; __pyx_v_g = __pyx_t_12; __pyx_t_12 = 0; __pyx_v_b = __pyx_t_4; __pyx_t_4 = 0; /* "pygame_sdl2/color.pyx":78 * if len(c) == 6: * r, g, b = struct.unpack('BBB', binascii.unhexlify(c)) * a = 255 # <<<<<<<<<<<<<< * elif len(c) == 8: * r, g, b, a = struct.unpack('BBBB', binascii.unhexlify(c)) */ __Pyx_INCREF(__pyx_int_255); __pyx_v_a = __pyx_int_255; /* "pygame_sdl2/color.pyx":76 * * try: * if len(c) == 6: # <<<<<<<<<<<<<< * r, g, b = struct.unpack('BBB', binascii.unhexlify(c)) * a = 255 */ goto __pyx_L14; } /* "pygame_sdl2/color.pyx":79 * r, g, b = struct.unpack('BBB', binascii.unhexlify(c)) * a = 255 * elif len(c) == 8: # <<<<<<<<<<<<<< * r, g, b, a = struct.unpack('BBBB', binascii.unhexlify(c)) * else: */ __pyx_t_2 = PyObject_Length(__pyx_v_c); if (unlikely(__pyx_t_2 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 79; __pyx_clineno = __LINE__; goto __pyx_L6_error;} __pyx_t_1 = ((__pyx_t_2 == 8) != 0); if (__pyx_t_1) { /* "pygame_sdl2/color.pyx":80 * a = 255 * elif len(c) == 8: * r, g, b, a = struct.unpack('BBBB', binascii.unhexlify(c)) # <<<<<<<<<<<<<< * else: * raise ValueError(c) */ __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_struct); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 80; __pyx_clineno = __LINE__; goto __pyx_L6_error;} __Pyx_GOTREF(__pyx_t_4); __pyx_t_12 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_unpack); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 80; __pyx_clineno = __LINE__; goto __pyx_L6_error;} __Pyx_GOTREF(__pyx_t_12); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_t_9 = __Pyx_GetModuleGlobalName(__pyx_n_s_binascii); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 80; __pyx_clineno = __LINE__; goto __pyx_L6_error;} __Pyx_GOTREF(__pyx_t_9); __pyx_t_11 = __Pyx_PyObject_GetAttrStr(__pyx_t_9, __pyx_n_s_unhexlify); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 80; __pyx_clineno = __LINE__; goto __pyx_L6_error;} __Pyx_GOTREF(__pyx_t_11); __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; __pyx_t_9 = NULL; if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_11))) { __pyx_t_9 = PyMethod_GET_SELF(__pyx_t_11); if (likely(__pyx_t_9)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_11); __Pyx_INCREF(__pyx_t_9); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_11, function); } } if (!__pyx_t_9) { __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_t_11, __pyx_v_c); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 80; __pyx_clineno = __LINE__; goto __pyx_L6_error;} __Pyx_GOTREF(__pyx_t_4); } else { __pyx_t_10 = PyTuple_New(1+1); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 80; __pyx_clineno = __LINE__; goto __pyx_L6_error;} __Pyx_GOTREF(__pyx_t_10); __Pyx_GIVEREF(__pyx_t_9); PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_t_9); __pyx_t_9 = NULL; __Pyx_INCREF(__pyx_v_c); __Pyx_GIVEREF(__pyx_v_c); PyTuple_SET_ITEM(__pyx_t_10, 0+1, __pyx_v_c); __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_11, __pyx_t_10, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 80; __pyx_clineno = __LINE__; goto __pyx_L6_error;} __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; } __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; __pyx_t_11 = NULL; __pyx_t_2 = 0; if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_12))) { __pyx_t_11 = PyMethod_GET_SELF(__pyx_t_12); if (likely(__pyx_t_11)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_12); __Pyx_INCREF(__pyx_t_11); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_12, function); __pyx_t_2 = 1; } } __pyx_t_10 = PyTuple_New(2+__pyx_t_2); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 80; __pyx_clineno = __LINE__; goto __pyx_L6_error;} __Pyx_GOTREF(__pyx_t_10); if (__pyx_t_11) { __Pyx_GIVEREF(__pyx_t_11); PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_t_11); __pyx_t_11 = NULL; } __Pyx_INCREF(__pyx_n_s_BBBB); __Pyx_GIVEREF(__pyx_n_s_BBBB); PyTuple_SET_ITEM(__pyx_t_10, 0+__pyx_t_2, __pyx_n_s_BBBB); __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_10, 1+__pyx_t_2, __pyx_t_4); __pyx_t_4 = 0; __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_12, __pyx_t_10, NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 80; __pyx_clineno = __LINE__; goto __pyx_L6_error;} __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; if ((likely(PyTuple_CheckExact(__pyx_t_5))) || (PyList_CheckExact(__pyx_t_5))) { PyObject* sequence = __pyx_t_5; #if CYTHON_COMPILING_IN_CPYTHON Py_ssize_t size = Py_SIZE(sequence); #else Py_ssize_t size = PySequence_Size(sequence); #endif if (unlikely(size != 4)) { if (size > 4) __Pyx_RaiseTooManyValuesError(4); else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 80; __pyx_clineno = __LINE__; goto __pyx_L6_error;} } #if CYTHON_COMPILING_IN_CPYTHON if (likely(PyTuple_CheckExact(sequence))) { __pyx_t_12 = PyTuple_GET_ITEM(sequence, 0); __pyx_t_10 = PyTuple_GET_ITEM(sequence, 1); __pyx_t_4 = PyTuple_GET_ITEM(sequence, 2); __pyx_t_11 = PyTuple_GET_ITEM(sequence, 3); } else { __pyx_t_12 = PyList_GET_ITEM(sequence, 0); __pyx_t_10 = PyList_GET_ITEM(sequence, 1); __pyx_t_4 = PyList_GET_ITEM(sequence, 2); __pyx_t_11 = PyList_GET_ITEM(sequence, 3); } __Pyx_INCREF(__pyx_t_12); __Pyx_INCREF(__pyx_t_10); __Pyx_INCREF(__pyx_t_4); __Pyx_INCREF(__pyx_t_11); #else { Py_ssize_t i; PyObject** temps[4] = {&__pyx_t_12,&__pyx_t_10,&__pyx_t_4,&__pyx_t_11}; for (i=0; i < 4; i++) { PyObject* item = PySequence_ITEM(sequence, i); if (unlikely(!item)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 80; __pyx_clineno = __LINE__; goto __pyx_L6_error;} __Pyx_GOTREF(item); *(temps[i]) = item; } } #endif __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; } else { Py_ssize_t index = -1; PyObject** temps[4] = {&__pyx_t_12,&__pyx_t_10,&__pyx_t_4,&__pyx_t_11}; __pyx_t_9 = PyObject_GetIter(__pyx_t_5); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 80; __pyx_clineno = __LINE__; goto __pyx_L6_error;} __Pyx_GOTREF(__pyx_t_9); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __pyx_t_13 = Py_TYPE(__pyx_t_9)->tp_iternext; for (index=0; index < 4; index++) { PyObject* item = __pyx_t_13(__pyx_t_9); if (unlikely(!item)) goto __pyx_L17_unpacking_failed; __Pyx_GOTREF(item); *(temps[index]) = item; } if (__Pyx_IternextUnpackEndCheck(__pyx_t_13(__pyx_t_9), 4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 80; __pyx_clineno = __LINE__; goto __pyx_L6_error;} __pyx_t_13 = NULL; __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; goto __pyx_L18_unpacking_done; __pyx_L17_unpacking_failed:; __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; __pyx_t_13 = NULL; if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 80; __pyx_clineno = __LINE__; goto __pyx_L6_error;} __pyx_L18_unpacking_done:; } __pyx_v_r = __pyx_t_12; __pyx_t_12 = 0; __pyx_v_g = __pyx_t_10; __pyx_t_10 = 0; __pyx_v_b = __pyx_t_4; __pyx_t_4 = 0; __pyx_v_a = __pyx_t_11; __pyx_t_11 = 0; /* "pygame_sdl2/color.pyx":79 * r, g, b = struct.unpack('BBB', binascii.unhexlify(c)) * a = 255 * elif len(c) == 8: # <<<<<<<<<<<<<< * r, g, b, a = struct.unpack('BBBB', binascii.unhexlify(c)) * else: */ goto __pyx_L14; } /* "pygame_sdl2/color.pyx":82 * r, g, b, a = struct.unpack('BBBB', binascii.unhexlify(c)) * else: * raise ValueError(c) # <<<<<<<<<<<<<< * except TypeError as e: * raise ValueError(c) */ /*else*/ { __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 82; __pyx_clineno = __LINE__; goto __pyx_L6_error;} __Pyx_GOTREF(__pyx_t_5); __Pyx_INCREF(__pyx_v_c); __Pyx_GIVEREF(__pyx_v_c); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_v_c); __pyx_t_11 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_t_5, NULL); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 82; __pyx_clineno = __LINE__; goto __pyx_L6_error;} __Pyx_GOTREF(__pyx_t_11); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_Raise(__pyx_t_11, 0, 0, 0); __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; {__pyx_filename = __pyx_f[0]; __pyx_lineno = 82; __pyx_clineno = __LINE__; goto __pyx_L6_error;} } __pyx_L14:; /* "pygame_sdl2/color.pyx":75 * c = "".join(map(lambda x: x*2, c)) * * try: # <<<<<<<<<<<<<< * if len(c) == 6: * r, g, b = struct.unpack('BBB', binascii.unhexlify(c)) */ } __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0; goto __pyx_L13_try_end; __pyx_L6_error:; __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0; __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0; __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0; __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0; /* "pygame_sdl2/color.pyx":83 * else: * raise ValueError(c) * except TypeError as e: # <<<<<<<<<<<<<< * raise ValueError(c) * */ __pyx_t_14 = PyErr_ExceptionMatches(__pyx_builtin_TypeError); if (__pyx_t_14) { __Pyx_AddTraceback("pygame_sdl2.color.Color.from_hex", __pyx_clineno, __pyx_lineno, __pyx_filename); if (__Pyx_GetException(&__pyx_t_11, &__pyx_t_5, &__pyx_t_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 83; __pyx_clineno = __LINE__; goto __pyx_L8_except_error;} __Pyx_GOTREF(__pyx_t_11); __Pyx_GOTREF(__pyx_t_5); __Pyx_GOTREF(__pyx_t_4); __Pyx_INCREF(__pyx_t_5); __pyx_v_e = __pyx_t_5; /* "pygame_sdl2/color.pyx":84 * raise ValueError(c) * except TypeError as e: * raise ValueError(c) # <<<<<<<<<<<<<< * * self.from_rgba(r, g, b, a) */ __pyx_t_10 = PyTuple_New(1); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 84; __pyx_clineno = __LINE__; goto __pyx_L8_except_error;} __Pyx_GOTREF(__pyx_t_10); __Pyx_INCREF(__pyx_v_c); __Pyx_GIVEREF(__pyx_v_c); PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_v_c); __pyx_t_12 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_t_10, NULL); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 84; __pyx_clineno = __LINE__; goto __pyx_L8_except_error;} __Pyx_GOTREF(__pyx_t_12); __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; __Pyx_Raise(__pyx_t_12, 0, 0, 0); __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; {__pyx_filename = __pyx_f[0]; __pyx_lineno = 84; __pyx_clineno = __LINE__; goto __pyx_L8_except_error;} } goto __pyx_L8_except_error; __pyx_L8_except_error:; /* "pygame_sdl2/color.pyx":75 * c = "".join(map(lambda x: x*2, c)) * * try: # <<<<<<<<<<<<<< * if len(c) == 6: * r, g, b = struct.unpack('BBB', binascii.unhexlify(c)) */ __Pyx_XGIVEREF(__pyx_t_6); __Pyx_XGIVEREF(__pyx_t_7); __Pyx_XGIVEREF(__pyx_t_8); __Pyx_ExceptionReset(__pyx_t_6, __pyx_t_7, __pyx_t_8); goto __pyx_L1_error; __pyx_L13_try_end:; } /* "pygame_sdl2/color.pyx":86 * raise ValueError(c) * * self.from_rgba(r, g, b, a) # <<<<<<<<<<<<<< * * cdef from_name(self, c): */ __pyx_t_15 = __Pyx_PyInt_As_uint8_t(__pyx_v_r); if (unlikely((__pyx_t_15 == (Uint8)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 86; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_t_16 = __Pyx_PyInt_As_uint8_t(__pyx_v_g); if (unlikely((__pyx_t_16 == (Uint8)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 86; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_t_17 = __Pyx_PyInt_As_uint8_t(__pyx_v_b); if (unlikely((__pyx_t_17 == (Uint8)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 86; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_t_18 = __Pyx_PyInt_As_uint8_t(__pyx_v_a); if (unlikely((__pyx_t_18 == (Uint8)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 86; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_t_4 = ((struct __pyx_vtabstruct_11pygame_sdl2_5color_Color *)__pyx_v_self->__pyx_vtab)->from_rgba(__pyx_v_self, __pyx_t_15, __pyx_t_16, __pyx_t_17, __pyx_t_18); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 86; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; /* "pygame_sdl2/color.pyx":70 * self.a = a * * cdef from_hex(self, c): # <<<<<<<<<<<<<< * # Handle short hex strings. * if len(c) == 3 or len(c) == 4: */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_5); __Pyx_XDECREF(__pyx_t_9); __Pyx_XDECREF(__pyx_t_10); __Pyx_XDECREF(__pyx_t_11); __Pyx_XDECREF(__pyx_t_12); __Pyx_AddTraceback("pygame_sdl2.color.Color.from_hex", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XDECREF(__pyx_v_r); __Pyx_XDECREF(__pyx_v_g); __Pyx_XDECREF(__pyx_v_b); __Pyx_XDECREF(__pyx_v_a); __Pyx_XDECREF(__pyx_v_e); __Pyx_XDECREF(__pyx_v_c); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/color.pyx":88 * self.from_rgba(r, g, b, a) * * cdef from_name(self, c): # <<<<<<<<<<<<<< * # Remove all whitespace. * c = "".join(c.split()).lower() */ static PyObject *__pyx_f_11pygame_sdl2_5color_5Color_from_name(struct __pyx_obj_11pygame_sdl2_5color_Color *__pyx_v_self, PyObject *__pyx_v_c) { PyObject *__pyx_v_r = NULL; PyObject *__pyx_v_g = NULL; PyObject *__pyx_v_b = NULL; CYTHON_UNUSED PyObject *__pyx_v_e = NULL; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; PyObject *__pyx_t_5 = NULL; PyObject *__pyx_t_6 = NULL; PyObject *__pyx_t_7 = NULL; PyObject *__pyx_t_8 = NULL; PyObject *(*__pyx_t_9)(PyObject *); int __pyx_t_10; Uint8 __pyx_t_11; Uint8 __pyx_t_12; Uint8 __pyx_t_13; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("from_name", 0); __Pyx_INCREF(__pyx_v_c); /* "pygame_sdl2/color.pyx":90 * cdef from_name(self, c): * # Remove all whitespace. * c = "".join(c.split()).lower() # <<<<<<<<<<<<<< * * try: */ __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_c, __pyx_n_s_split); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 90; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = NULL; if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_3))) { __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3); if (likely(__pyx_t_4)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); __Pyx_INCREF(__pyx_t_4); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_3, function); } } if (__pyx_t_4) { __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 90; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; } else { __pyx_t_2 = __Pyx_PyObject_CallNoArg(__pyx_t_3); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 90; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_3 = __Pyx_PyString_Join(__pyx_kp_s__2, __pyx_t_2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 90; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_lower); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 90; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_3 = NULL; if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_2))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); if (likely(__pyx_t_3)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); } } if (__pyx_t_3) { __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 90; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } else { __pyx_t_1 = __Pyx_PyObject_CallNoArg(__pyx_t_2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 90; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF_SET(__pyx_v_c, __pyx_t_1); __pyx_t_1 = 0; /* "pygame_sdl2/color.pyx":92 * c = "".join(c.split()).lower() * * try: # <<<<<<<<<<<<<< * r, g, b = colors[c] * except KeyError as e: */ { __Pyx_ExceptionSave(&__pyx_t_5, &__pyx_t_6, &__pyx_t_7); __Pyx_XGOTREF(__pyx_t_5); __Pyx_XGOTREF(__pyx_t_6); __Pyx_XGOTREF(__pyx_t_7); /*try:*/ { /* "pygame_sdl2/color.pyx":93 * * try: * r, g, b = colors[c] # <<<<<<<<<<<<<< * except KeyError as e: * raise ValueError(c) */ __pyx_t_1 = PyObject_GetItem(__pyx_v_11pygame_sdl2_5color_colors, __pyx_v_c); if (unlikely(__pyx_t_1 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 93; __pyx_clineno = __LINE__; goto __pyx_L3_error;}; __Pyx_GOTREF(__pyx_t_1); if ((likely(PyTuple_CheckExact(__pyx_t_1))) || (PyList_CheckExact(__pyx_t_1))) { PyObject* sequence = __pyx_t_1; #if CYTHON_COMPILING_IN_CPYTHON Py_ssize_t size = Py_SIZE(sequence); #else Py_ssize_t size = PySequence_Size(sequence); #endif if (unlikely(size != 3)) { if (size > 3) __Pyx_RaiseTooManyValuesError(3); else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 93; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } #if CYTHON_COMPILING_IN_CPYTHON if (likely(PyTuple_CheckExact(sequence))) { __pyx_t_2 = PyTuple_GET_ITEM(sequence, 0); __pyx_t_3 = PyTuple_GET_ITEM(sequence, 1); __pyx_t_4 = PyTuple_GET_ITEM(sequence, 2); } else { __pyx_t_2 = PyList_GET_ITEM(sequence, 0); __pyx_t_3 = PyList_GET_ITEM(sequence, 1); __pyx_t_4 = PyList_GET_ITEM(sequence, 2); } __Pyx_INCREF(__pyx_t_2); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(__pyx_t_4); #else __pyx_t_2 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 93; __pyx_clineno = __LINE__; goto __pyx_L3_error;} __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 93; __pyx_clineno = __LINE__; goto __pyx_L3_error;} __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = PySequence_ITEM(sequence, 2); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 93; __pyx_clineno = __LINE__; goto __pyx_L3_error;} __Pyx_GOTREF(__pyx_t_4); #endif __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; } else { Py_ssize_t index = -1; __pyx_t_8 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 93; __pyx_clineno = __LINE__; goto __pyx_L3_error;} __Pyx_GOTREF(__pyx_t_8); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_9 = Py_TYPE(__pyx_t_8)->tp_iternext; index = 0; __pyx_t_2 = __pyx_t_9(__pyx_t_8); if (unlikely(!__pyx_t_2)) goto __pyx_L11_unpacking_failed; __Pyx_GOTREF(__pyx_t_2); index = 1; __pyx_t_3 = __pyx_t_9(__pyx_t_8); if (unlikely(!__pyx_t_3)) goto __pyx_L11_unpacking_failed; __Pyx_GOTREF(__pyx_t_3); index = 2; __pyx_t_4 = __pyx_t_9(__pyx_t_8); if (unlikely(!__pyx_t_4)) goto __pyx_L11_unpacking_failed; __Pyx_GOTREF(__pyx_t_4); if (__Pyx_IternextUnpackEndCheck(__pyx_t_9(__pyx_t_8), 3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 93; __pyx_clineno = __LINE__; goto __pyx_L3_error;} __pyx_t_9 = NULL; __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; goto __pyx_L12_unpacking_done; __pyx_L11_unpacking_failed:; __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; __pyx_t_9 = NULL; if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 93; __pyx_clineno = __LINE__; goto __pyx_L3_error;} __pyx_L12_unpacking_done:; } __pyx_v_r = __pyx_t_2; __pyx_t_2 = 0; __pyx_v_g = __pyx_t_3; __pyx_t_3 = 0; __pyx_v_b = __pyx_t_4; __pyx_t_4 = 0; /* "pygame_sdl2/color.pyx":92 * c = "".join(c.split()).lower() * * try: # <<<<<<<<<<<<<< * r, g, b = colors[c] * except KeyError as e: */ } __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; goto __pyx_L10_try_end; __pyx_L3_error:; __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0; __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; /* "pygame_sdl2/color.pyx":94 * try: * r, g, b = colors[c] * except KeyError as e: # <<<<<<<<<<<<<< * raise ValueError(c) * self.from_rgba(r, g, b, 255) */ __pyx_t_10 = PyErr_ExceptionMatches(__pyx_builtin_KeyError); if (__pyx_t_10) { __Pyx_AddTraceback("pygame_sdl2.color.Color.from_name", __pyx_clineno, __pyx_lineno, __pyx_filename); if (__Pyx_GetException(&__pyx_t_1, &__pyx_t_4, &__pyx_t_3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 94; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} __Pyx_GOTREF(__pyx_t_1); __Pyx_GOTREF(__pyx_t_4); __Pyx_GOTREF(__pyx_t_3); __Pyx_INCREF(__pyx_t_4); __pyx_v_e = __pyx_t_4; /* "pygame_sdl2/color.pyx":95 * r, g, b = colors[c] * except KeyError as e: * raise ValueError(c) # <<<<<<<<<<<<<< * self.from_rgba(r, g, b, 255) * */ __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 95; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} __Pyx_GOTREF(__pyx_t_2); __Pyx_INCREF(__pyx_v_c); __Pyx_GIVEREF(__pyx_v_c); PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_c); __pyx_t_8 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_t_2, NULL); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 95; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} __Pyx_GOTREF(__pyx_t_8); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_Raise(__pyx_t_8, 0, 0, 0); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; {__pyx_filename = __pyx_f[0]; __pyx_lineno = 95; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} } goto __pyx_L5_except_error; __pyx_L5_except_error:; /* "pygame_sdl2/color.pyx":92 * c = "".join(c.split()).lower() * * try: # <<<<<<<<<<<<<< * r, g, b = colors[c] * except KeyError as e: */ __Pyx_XGIVEREF(__pyx_t_5); __Pyx_XGIVEREF(__pyx_t_6); __Pyx_XGIVEREF(__pyx_t_7); __Pyx_ExceptionReset(__pyx_t_5, __pyx_t_6, __pyx_t_7); goto __pyx_L1_error; __pyx_L10_try_end:; } /* "pygame_sdl2/color.pyx":96 * except KeyError as e: * raise ValueError(c) * self.from_rgba(r, g, b, 255) # <<<<<<<<<<<<<< * * def __richcmp__(Color x, y, int op): */ __pyx_t_11 = __Pyx_PyInt_As_uint8_t(__pyx_v_r); if (unlikely((__pyx_t_11 == (Uint8)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 96; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_t_12 = __Pyx_PyInt_As_uint8_t(__pyx_v_g); if (unlikely((__pyx_t_12 == (Uint8)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 96; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_t_13 = __Pyx_PyInt_As_uint8_t(__pyx_v_b); if (unlikely((__pyx_t_13 == (Uint8)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 96; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_t_3 = ((struct __pyx_vtabstruct_11pygame_sdl2_5color_Color *)__pyx_v_self->__pyx_vtab)->from_rgba(__pyx_v_self, __pyx_t_11, __pyx_t_12, __pyx_t_13, 0xFF); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 96; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "pygame_sdl2/color.pyx":88 * self.from_rgba(r, g, b, a) * * cdef from_name(self, c): # <<<<<<<<<<<<<< * # Remove all whitespace. * c = "".join(c.split()).lower() */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_8); __Pyx_AddTraceback("pygame_sdl2.color.Color.from_name", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XDECREF(__pyx_v_r); __Pyx_XDECREF(__pyx_v_g); __Pyx_XDECREF(__pyx_v_b); __Pyx_XDECREF(__pyx_v_e); __Pyx_XDECREF(__pyx_v_c); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/color.pyx":98 * self.from_rgba(r, g, b, 255) * * def __richcmp__(Color x, y, int op): # <<<<<<<<<<<<<< * if op == 3: * return not (x == y) */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_5color_5Color_1__richcmp__(PyObject *__pyx_v_x, PyObject *__pyx_v_y, int __pyx_v_op); /*proto*/ static PyObject *__pyx_pw_11pygame_sdl2_5color_5Color_1__richcmp__(PyObject *__pyx_v_x, PyObject *__pyx_v_y, int __pyx_v_op) { CYTHON_UNUSED int __pyx_lineno = 0; CYTHON_UNUSED const char *__pyx_filename = NULL; CYTHON_UNUSED int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__richcmp__ (wrapper)", 0); if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_x), __pyx_ptype_11pygame_sdl2_5color_Color, 1, "x", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 98; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_r = __pyx_pf_11pygame_sdl2_5color_5Color___richcmp__(((struct __pyx_obj_11pygame_sdl2_5color_Color *)__pyx_v_x), ((PyObject *)__pyx_v_y), ((int)__pyx_v_op)); /* function exit code */ goto __pyx_L0; __pyx_L1_error:; __pyx_r = NULL; __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_5color_5Color___richcmp__(struct __pyx_obj_11pygame_sdl2_5color_Color *__pyx_v_x, PyObject *__pyx_v_y, int __pyx_v_op) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; PyObject *__pyx_t_2 = NULL; int __pyx_t_3; PyObject *__pyx_t_4 = NULL; PyObject *__pyx_t_5 = NULL; PyObject *__pyx_t_6 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__richcmp__", 0); __Pyx_INCREF(__pyx_v_y); /* "pygame_sdl2/color.pyx":99 * * def __richcmp__(Color x, y, int op): * if op == 3: # <<<<<<<<<<<<<< * return not (x == y) * */ __pyx_t_1 = ((__pyx_v_op == 3) != 0); if (__pyx_t_1) { /* "pygame_sdl2/color.pyx":100 * def __richcmp__(Color x, y, int op): * if op == 3: * return not (x == y) # <<<<<<<<<<<<<< * * if isinstance(y, tuple): */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = PyObject_RichCompare(((PyObject *)__pyx_v_x), __pyx_v_y, Py_EQ); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 100; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_1 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 100; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_2 = __Pyx_PyBool_FromLong((!__pyx_t_1)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 100; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; /* "pygame_sdl2/color.pyx":99 * * def __richcmp__(Color x, y, int op): * if op == 3: # <<<<<<<<<<<<<< * return not (x == y) * */ } /* "pygame_sdl2/color.pyx":102 * return not (x == y) * * if isinstance(y, tuple): # <<<<<<<<<<<<<< * y = Color(y) * if not isinstance(y, Color): */ __pyx_t_1 = PyTuple_Check(__pyx_v_y); __pyx_t_3 = (__pyx_t_1 != 0); if (__pyx_t_3) { /* "pygame_sdl2/color.pyx":103 * * if isinstance(y, tuple): * y = Color(y) # <<<<<<<<<<<<<< * if not isinstance(y, Color): * return False */ __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 103; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __Pyx_INCREF(__pyx_v_y); __Pyx_GIVEREF(__pyx_v_y); PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_y); __pyx_t_4 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_11pygame_sdl2_5color_Color), __pyx_t_2, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 103; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF_SET(__pyx_v_y, __pyx_t_4); __pyx_t_4 = 0; /* "pygame_sdl2/color.pyx":102 * return not (x == y) * * if isinstance(y, tuple): # <<<<<<<<<<<<<< * y = Color(y) * if not isinstance(y, Color): */ } /* "pygame_sdl2/color.pyx":104 * if isinstance(y, tuple): * y = Color(y) * if not isinstance(y, Color): # <<<<<<<<<<<<<< * return False * if op == 2: */ __pyx_t_3 = __Pyx_TypeCheck(__pyx_v_y, __pyx_ptype_11pygame_sdl2_5color_Color); __pyx_t_1 = ((!(__pyx_t_3 != 0)) != 0); if (__pyx_t_1) { /* "pygame_sdl2/color.pyx":105 * y = Color(y) * if not isinstance(y, Color): * return False # <<<<<<<<<<<<<< * if op == 2: * return x.r == y.r and x.g == y.g and x.b == y.b and x.a == y.a */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(Py_False); __pyx_r = Py_False; goto __pyx_L0; /* "pygame_sdl2/color.pyx":104 * if isinstance(y, tuple): * y = Color(y) * if not isinstance(y, Color): # <<<<<<<<<<<<<< * return False * if op == 2: */ } /* "pygame_sdl2/color.pyx":106 * if not isinstance(y, Color): * return False * if op == 2: # <<<<<<<<<<<<<< * return x.r == y.r and x.g == y.g and x.b == y.b and x.a == y.a * */ __pyx_t_1 = ((__pyx_v_op == 2) != 0); if (__pyx_t_1) { /* "pygame_sdl2/color.pyx":107 * return False * if op == 2: * return x.r == y.r and x.g == y.g and x.b == y.b and x.a == y.a # <<<<<<<<<<<<<< * * def __cinit__(self): */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __Pyx_PyInt_From_uint8_t(__pyx_v_x->r); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 107; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_y, __pyx_n_s_r); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 107; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); __pyx_t_6 = PyObject_RichCompare(__pyx_t_2, __pyx_t_5, Py_EQ); __Pyx_XGOTREF(__pyx_t_6); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 107; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_6); if (unlikely(__pyx_t_1 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 107; __pyx_clineno = __LINE__; goto __pyx_L1_error;} if (__pyx_t_1) { __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; } else { __Pyx_INCREF(__pyx_t_6); __pyx_t_4 = __pyx_t_6; __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; goto __pyx_L7_bool_binop_done; } __pyx_t_6 = __Pyx_PyInt_From_uint8_t(__pyx_v_x->g); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 107; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_6); __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_y, __pyx_n_s_g); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 107; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); __pyx_t_2 = PyObject_RichCompare(__pyx_t_6, __pyx_t_5, Py_EQ); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 107; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_1 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 107; __pyx_clineno = __LINE__; goto __pyx_L1_error;} if (__pyx_t_1) { __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } else { __Pyx_INCREF(__pyx_t_2); __pyx_t_4 = __pyx_t_2; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; goto __pyx_L7_bool_binop_done; } __pyx_t_2 = __Pyx_PyInt_From_uint8_t(__pyx_v_x->b); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 107; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_y, __pyx_n_s_b); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 107; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); __pyx_t_6 = PyObject_RichCompare(__pyx_t_2, __pyx_t_5, Py_EQ); __Pyx_XGOTREF(__pyx_t_6); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 107; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_6); if (unlikely(__pyx_t_1 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 107; __pyx_clineno = __LINE__; goto __pyx_L1_error;} if (__pyx_t_1) { __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; } else { __Pyx_INCREF(__pyx_t_6); __pyx_t_4 = __pyx_t_6; __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; goto __pyx_L7_bool_binop_done; } __pyx_t_6 = __Pyx_PyInt_From_uint8_t(__pyx_v_x->a); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 107; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_6); __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_y, __pyx_n_s_a); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 107; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); __pyx_t_2 = PyObject_RichCompare(__pyx_t_6, __pyx_t_5, Py_EQ); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 107; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_INCREF(__pyx_t_2); __pyx_t_4 = __pyx_t_2; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_L7_bool_binop_done:; __pyx_r = __pyx_t_4; __pyx_t_4 = 0; goto __pyx_L0; /* "pygame_sdl2/color.pyx":106 * if not isinstance(y, Color): * return False * if op == 2: # <<<<<<<<<<<<<< * return x.r == y.r and x.g == y.g and x.b == y.b and x.a == y.a * */ } /* "pygame_sdl2/color.pyx":98 * self.from_rgba(r, g, b, 255) * * def __richcmp__(Color x, y, int op): # <<<<<<<<<<<<<< * if op == 3: * return not (x == y) */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_5); __Pyx_XDECREF(__pyx_t_6); __Pyx_AddTraceback("pygame_sdl2.color.Color.__richcmp__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF(__pyx_v_y); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/color.pyx":109 * return x.r == y.r and x.g == y.g and x.b == y.b and x.a == y.a * * def __cinit__(self): # <<<<<<<<<<<<<< * self.length = 4 * self.r = 0 */ /* Python wrapper */ static int __pyx_pw_11pygame_sdl2_5color_5Color_3__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static int __pyx_pw_11pygame_sdl2_5color_5Color_3__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__cinit__ (wrapper)", 0); if (unlikely(PyTuple_GET_SIZE(__pyx_args) > 0)) { __Pyx_RaiseArgtupleInvalid("__cinit__", 1, 0, 0, PyTuple_GET_SIZE(__pyx_args)); return -1;} if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "__cinit__", 0))) return -1; __pyx_r = __pyx_pf_11pygame_sdl2_5color_5Color_2__cinit__(((struct __pyx_obj_11pygame_sdl2_5color_Color *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static int __pyx_pf_11pygame_sdl2_5color_5Color_2__cinit__(struct __pyx_obj_11pygame_sdl2_5color_Color *__pyx_v_self) { int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__cinit__", 0); /* "pygame_sdl2/color.pyx":110 * * def __cinit__(self): * self.length = 4 # <<<<<<<<<<<<<< * self.r = 0 * self.g = 0 */ __pyx_v_self->length = 4; /* "pygame_sdl2/color.pyx":111 * def __cinit__(self): * self.length = 4 * self.r = 0 # <<<<<<<<<<<<<< * self.g = 0 * self.b = 0 */ __pyx_v_self->r = 0; /* "pygame_sdl2/color.pyx":112 * self.length = 4 * self.r = 0 * self.g = 0 # <<<<<<<<<<<<<< * self.b = 0 * self.a = 255 */ __pyx_v_self->g = 0; /* "pygame_sdl2/color.pyx":113 * self.r = 0 * self.g = 0 * self.b = 0 # <<<<<<<<<<<<<< * self.a = 255 * */ __pyx_v_self->b = 0; /* "pygame_sdl2/color.pyx":114 * self.g = 0 * self.b = 0 * self.a = 255 # <<<<<<<<<<<<<< * * def __init__(self, *args): */ __pyx_v_self->a = 0xFF; /* "pygame_sdl2/color.pyx":109 * return x.r == y.r and x.g == y.g and x.b == y.b and x.a == y.a * * def __cinit__(self): # <<<<<<<<<<<<<< * self.length = 4 * self.r = 0 */ /* function exit code */ __pyx_r = 0; __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/color.pyx":116 * self.a = 255 * * def __init__(self, *args): # <<<<<<<<<<<<<< * self.length = 4 * */ /* Python wrapper */ static int __pyx_pw_11pygame_sdl2_5color_5Color_5__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static int __pyx_pw_11pygame_sdl2_5color_5Color_5__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_args = 0; int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__init__ (wrapper)", 0); if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "__init__", 0))) return -1; __Pyx_INCREF(__pyx_args); __pyx_v_args = __pyx_args; __pyx_r = __pyx_pf_11pygame_sdl2_5color_5Color_4__init__(((struct __pyx_obj_11pygame_sdl2_5color_Color *)__pyx_v_self), __pyx_v_args); /* function exit code */ __Pyx_XDECREF(__pyx_v_args); __Pyx_RefNannyFinishContext(); return __pyx_r; } static int __pyx_pf_11pygame_sdl2_5color_5Color_4__init__(struct __pyx_obj_11pygame_sdl2_5color_Color *__pyx_v_self, PyObject *__pyx_v_args) { PyObject *__pyx_v_c = NULL; PyObject *__pyx_v_r = NULL; PyObject *__pyx_v_g = NULL; PyObject *__pyx_v_b = NULL; PyObject *__pyx_v_a = NULL; int __pyx_r; __Pyx_RefNannyDeclarations Py_ssize_t __pyx_t_1; int __pyx_t_2; PyObject *__pyx_t_3 = NULL; int __pyx_t_4; PyObject *__pyx_t_5 = NULL; int __pyx_t_6; Uint8 __pyx_t_7; Uint8 __pyx_t_8; Uint8 __pyx_t_9; Uint8 __pyx_t_10; PyObject *__pyx_t_11 = NULL; PyObject *__pyx_t_12 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__init__", 0); /* "pygame_sdl2/color.pyx":117 * * def __init__(self, *args): * self.length = 4 # <<<<<<<<<<<<<< * * if len(args) == 1: */ __pyx_v_self->length = 4; /* "pygame_sdl2/color.pyx":119 * self.length = 4 * * if len(args) == 1: # <<<<<<<<<<<<<< * c = args[0] * if isinstance(c, basestring): */ __pyx_t_1 = PyTuple_GET_SIZE(__pyx_v_args); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 119; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_t_2 = ((__pyx_t_1 == 1) != 0); if (__pyx_t_2) { /* "pygame_sdl2/color.pyx":120 * * if len(args) == 1: * c = args[0] # <<<<<<<<<<<<<< * if isinstance(c, basestring): * if c.startswith('#'): */ __pyx_t_3 = __Pyx_GetItemInt_Tuple(__pyx_v_args, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(__pyx_t_3 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 120; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; __Pyx_GOTREF(__pyx_t_3); __pyx_v_c = __pyx_t_3; __pyx_t_3 = 0; /* "pygame_sdl2/color.pyx":121 * if len(args) == 1: * c = args[0] * if isinstance(c, basestring): # <<<<<<<<<<<<<< * if c.startswith('#'): * self.from_hex(c[1:]) */ __pyx_t_2 = __Pyx_PyBaseString_Check(__pyx_v_c); __pyx_t_4 = (__pyx_t_2 != 0); if (__pyx_t_4) { /* "pygame_sdl2/color.pyx":122 * c = args[0] * if isinstance(c, basestring): * if c.startswith('#'): # <<<<<<<<<<<<<< * self.from_hex(c[1:]) * elif c.startswith('0x'): */ __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_c, __pyx_n_s_startswith); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 122; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_tuple__4, NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 122; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_4 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 122; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; if (__pyx_t_4) { /* "pygame_sdl2/color.pyx":123 * if isinstance(c, basestring): * if c.startswith('#'): * self.from_hex(c[1:]) # <<<<<<<<<<<<<< * elif c.startswith('0x'): * self.from_hex(c[2:]) */ __pyx_t_5 = __Pyx_PyObject_GetSlice(__pyx_v_c, 1, 0, NULL, NULL, &__pyx_slice__5, 1, 0, 1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 123; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); __pyx_t_3 = ((struct __pyx_vtabstruct_11pygame_sdl2_5color_Color *)__pyx_v_self->__pyx_vtab)->from_hex(__pyx_v_self, __pyx_t_5); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 123; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "pygame_sdl2/color.pyx":122 * c = args[0] * if isinstance(c, basestring): * if c.startswith('#'): # <<<<<<<<<<<<<< * self.from_hex(c[1:]) * elif c.startswith('0x'): */ goto __pyx_L5; } /* "pygame_sdl2/color.pyx":124 * if c.startswith('#'): * self.from_hex(c[1:]) * elif c.startswith('0x'): # <<<<<<<<<<<<<< * self.from_hex(c[2:]) * else: */ __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_c, __pyx_n_s_startswith); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 124; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_tuple__6, NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 124; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_4 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 124; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; if (__pyx_t_4) { /* "pygame_sdl2/color.pyx":125 * self.from_hex(c[1:]) * elif c.startswith('0x'): * self.from_hex(c[2:]) # <<<<<<<<<<<<<< * else: * self.from_name(c) */ __pyx_t_5 = __Pyx_PyObject_GetSlice(__pyx_v_c, 2, 0, NULL, NULL, &__pyx_slice__7, 1, 0, 1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 125; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); __pyx_t_3 = ((struct __pyx_vtabstruct_11pygame_sdl2_5color_Color *)__pyx_v_self->__pyx_vtab)->from_hex(__pyx_v_self, __pyx_t_5); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 125; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "pygame_sdl2/color.pyx":124 * if c.startswith('#'): * self.from_hex(c[1:]) * elif c.startswith('0x'): # <<<<<<<<<<<<<< * self.from_hex(c[2:]) * else: */ goto __pyx_L5; } /* "pygame_sdl2/color.pyx":127 * self.from_hex(c[2:]) * else: * self.from_name(c) # <<<<<<<<<<<<<< * elif isinstance(c, (tuple, list, Color)): * if len(c) == 4: */ /*else*/ { __pyx_t_3 = ((struct __pyx_vtabstruct_11pygame_sdl2_5color_Color *)__pyx_v_self->__pyx_vtab)->from_name(__pyx_v_self, __pyx_v_c); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 127; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } __pyx_L5:; /* "pygame_sdl2/color.pyx":121 * if len(args) == 1: * c = args[0] * if isinstance(c, basestring): # <<<<<<<<<<<<<< * if c.startswith('#'): * self.from_hex(c[1:]) */ goto __pyx_L4; } /* "pygame_sdl2/color.pyx":128 * else: * self.from_name(c) * elif isinstance(c, (tuple, list, Color)): # <<<<<<<<<<<<<< * if len(c) == 4: * self.from_rgba(c[0], c[1], c[2], c[3]) */ __pyx_t_2 = PyTuple_Check(__pyx_v_c); __pyx_t_6 = (__pyx_t_2 != 0); if (!__pyx_t_6) { } else { __pyx_t_4 = __pyx_t_6; goto __pyx_L6_bool_binop_done; } __pyx_t_6 = PyList_Check(__pyx_v_c); __pyx_t_2 = (__pyx_t_6 != 0); if (!__pyx_t_2) { } else { __pyx_t_4 = __pyx_t_2; goto __pyx_L6_bool_binop_done; } __pyx_t_2 = __Pyx_TypeCheck(__pyx_v_c, __pyx_ptype_11pygame_sdl2_5color_Color); __pyx_t_6 = (__pyx_t_2 != 0); __pyx_t_4 = __pyx_t_6; __pyx_L6_bool_binop_done:; __pyx_t_6 = (__pyx_t_4 != 0); if (__pyx_t_6) { /* "pygame_sdl2/color.pyx":129 * self.from_name(c) * elif isinstance(c, (tuple, list, Color)): * if len(c) == 4: # <<<<<<<<<<<<<< * self.from_rgba(c[0], c[1], c[2], c[3]) * elif len(c) == 3: */ __pyx_t_1 = PyObject_Length(__pyx_v_c); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 129; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_t_6 = ((__pyx_t_1 == 4) != 0); if (__pyx_t_6) { /* "pygame_sdl2/color.pyx":130 * elif isinstance(c, (tuple, list, Color)): * if len(c) == 4: * self.from_rgba(c[0], c[1], c[2], c[3]) # <<<<<<<<<<<<<< * elif len(c) == 3: * self.from_rgba(c[0], c[1], c[2], 255) */ __pyx_t_3 = __Pyx_GetItemInt(__pyx_v_c, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(__pyx_t_3 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 130; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; __Pyx_GOTREF(__pyx_t_3); __pyx_t_7 = __Pyx_PyInt_As_uint8_t(__pyx_t_3); if (unlikely((__pyx_t_7 == (Uint8)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 130; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_3 = __Pyx_GetItemInt(__pyx_v_c, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(__pyx_t_3 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 130; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; __Pyx_GOTREF(__pyx_t_3); __pyx_t_8 = __Pyx_PyInt_As_uint8_t(__pyx_t_3); if (unlikely((__pyx_t_8 == (Uint8)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 130; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_3 = __Pyx_GetItemInt(__pyx_v_c, 2, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(__pyx_t_3 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 130; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; __Pyx_GOTREF(__pyx_t_3); __pyx_t_9 = __Pyx_PyInt_As_uint8_t(__pyx_t_3); if (unlikely((__pyx_t_9 == (Uint8)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 130; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_3 = __Pyx_GetItemInt(__pyx_v_c, 3, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(__pyx_t_3 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 130; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; __Pyx_GOTREF(__pyx_t_3); __pyx_t_10 = __Pyx_PyInt_As_uint8_t(__pyx_t_3); if (unlikely((__pyx_t_10 == (Uint8)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 130; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_3 = ((struct __pyx_vtabstruct_11pygame_sdl2_5color_Color *)__pyx_v_self->__pyx_vtab)->from_rgba(__pyx_v_self, __pyx_t_7, __pyx_t_8, __pyx_t_9, __pyx_t_10); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 130; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "pygame_sdl2/color.pyx":129 * self.from_name(c) * elif isinstance(c, (tuple, list, Color)): * if len(c) == 4: # <<<<<<<<<<<<<< * self.from_rgba(c[0], c[1], c[2], c[3]) * elif len(c) == 3: */ goto __pyx_L9; } /* "pygame_sdl2/color.pyx":131 * if len(c) == 4: * self.from_rgba(c[0], c[1], c[2], c[3]) * elif len(c) == 3: # <<<<<<<<<<<<<< * self.from_rgba(c[0], c[1], c[2], 255) * else: */ __pyx_t_1 = PyObject_Length(__pyx_v_c); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 131; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_t_6 = ((__pyx_t_1 == 3) != 0); if (__pyx_t_6) { /* "pygame_sdl2/color.pyx":132 * self.from_rgba(c[0], c[1], c[2], c[3]) * elif len(c) == 3: * self.from_rgba(c[0], c[1], c[2], 255) # <<<<<<<<<<<<<< * else: * raise ValueError(c) */ __pyx_t_3 = __Pyx_GetItemInt(__pyx_v_c, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(__pyx_t_3 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 132; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; __Pyx_GOTREF(__pyx_t_3); __pyx_t_10 = __Pyx_PyInt_As_uint8_t(__pyx_t_3); if (unlikely((__pyx_t_10 == (Uint8)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 132; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_3 = __Pyx_GetItemInt(__pyx_v_c, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(__pyx_t_3 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 132; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; __Pyx_GOTREF(__pyx_t_3); __pyx_t_9 = __Pyx_PyInt_As_uint8_t(__pyx_t_3); if (unlikely((__pyx_t_9 == (Uint8)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 132; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_3 = __Pyx_GetItemInt(__pyx_v_c, 2, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(__pyx_t_3 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 132; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; __Pyx_GOTREF(__pyx_t_3); __pyx_t_8 = __Pyx_PyInt_As_uint8_t(__pyx_t_3); if (unlikely((__pyx_t_8 == (Uint8)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 132; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_3 = ((struct __pyx_vtabstruct_11pygame_sdl2_5color_Color *)__pyx_v_self->__pyx_vtab)->from_rgba(__pyx_v_self, __pyx_t_10, __pyx_t_9, __pyx_t_8, 0xFF); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 132; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "pygame_sdl2/color.pyx":131 * if len(c) == 4: * self.from_rgba(c[0], c[1], c[2], c[3]) * elif len(c) == 3: # <<<<<<<<<<<<<< * self.from_rgba(c[0], c[1], c[2], 255) * else: */ goto __pyx_L9; } /* "pygame_sdl2/color.pyx":134 * self.from_rgba(c[0], c[1], c[2], 255) * else: * raise ValueError(c) # <<<<<<<<<<<<<< * else: * self.from_hex("%08x" % c) */ /*else*/ { __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 134; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __Pyx_INCREF(__pyx_v_c); __Pyx_GIVEREF(__pyx_v_c); PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_c); __pyx_t_5 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_t_3, NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 134; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_Raise(__pyx_t_5, 0, 0, 0); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; {__pyx_filename = __pyx_f[0]; __pyx_lineno = 134; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } __pyx_L9:; /* "pygame_sdl2/color.pyx":128 * else: * self.from_name(c) * elif isinstance(c, (tuple, list, Color)): # <<<<<<<<<<<<<< * if len(c) == 4: * self.from_rgba(c[0], c[1], c[2], c[3]) */ goto __pyx_L4; } /* "pygame_sdl2/color.pyx":136 * raise ValueError(c) * else: * self.from_hex("%08x" % c) # <<<<<<<<<<<<<< * * elif len(args) == 3: */ /*else*/ { __pyx_t_5 = __Pyx_PyString_Format(__pyx_kp_s_08x, __pyx_v_c); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 136; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); __pyx_t_3 = ((struct __pyx_vtabstruct_11pygame_sdl2_5color_Color *)__pyx_v_self->__pyx_vtab)->from_hex(__pyx_v_self, __pyx_t_5); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 136; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } __pyx_L4:; /* "pygame_sdl2/color.pyx":119 * self.length = 4 * * if len(args) == 1: # <<<<<<<<<<<<<< * c = args[0] * if isinstance(c, basestring): */ goto __pyx_L3; } /* "pygame_sdl2/color.pyx":138 * self.from_hex("%08x" % c) * * elif len(args) == 3: # <<<<<<<<<<<<<< * r, g, b = args * self.from_rgba(r, g, b, 255) */ __pyx_t_1 = PyTuple_GET_SIZE(__pyx_v_args); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 138; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_t_6 = ((__pyx_t_1 == 3) != 0); if (__pyx_t_6) { /* "pygame_sdl2/color.pyx":139 * * elif len(args) == 3: * r, g, b = args # <<<<<<<<<<<<<< * self.from_rgba(r, g, b, 255) * elif len(args) == 4: */ if (1) { PyObject* sequence = __pyx_v_args; #if CYTHON_COMPILING_IN_CPYTHON Py_ssize_t size = Py_SIZE(sequence); #else Py_ssize_t size = PySequence_Size(sequence); #endif if (unlikely(size != 3)) { if (size > 3) __Pyx_RaiseTooManyValuesError(3); else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 139; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } #if CYTHON_COMPILING_IN_CPYTHON __pyx_t_3 = PyTuple_GET_ITEM(sequence, 0); __pyx_t_5 = PyTuple_GET_ITEM(sequence, 1); __pyx_t_11 = PyTuple_GET_ITEM(sequence, 2); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(__pyx_t_5); __Pyx_INCREF(__pyx_t_11); #else __pyx_t_3 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 139; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __pyx_t_5 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 139; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); __pyx_t_11 = PySequence_ITEM(sequence, 2); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 139; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_11); #endif } __pyx_v_r = __pyx_t_3; __pyx_t_3 = 0; __pyx_v_g = __pyx_t_5; __pyx_t_5 = 0; __pyx_v_b = __pyx_t_11; __pyx_t_11 = 0; /* "pygame_sdl2/color.pyx":140 * elif len(args) == 3: * r, g, b = args * self.from_rgba(r, g, b, 255) # <<<<<<<<<<<<<< * elif len(args) == 4: * r, g, b, a = args */ __pyx_t_8 = __Pyx_PyInt_As_uint8_t(__pyx_v_r); if (unlikely((__pyx_t_8 == (Uint8)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 140; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_t_9 = __Pyx_PyInt_As_uint8_t(__pyx_v_g); if (unlikely((__pyx_t_9 == (Uint8)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 140; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_t_10 = __Pyx_PyInt_As_uint8_t(__pyx_v_b); if (unlikely((__pyx_t_10 == (Uint8)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 140; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_t_11 = ((struct __pyx_vtabstruct_11pygame_sdl2_5color_Color *)__pyx_v_self->__pyx_vtab)->from_rgba(__pyx_v_self, __pyx_t_8, __pyx_t_9, __pyx_t_10, 0xFF); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 140; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_11); __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; /* "pygame_sdl2/color.pyx":138 * self.from_hex("%08x" % c) * * elif len(args) == 3: # <<<<<<<<<<<<<< * r, g, b = args * self.from_rgba(r, g, b, 255) */ goto __pyx_L3; } /* "pygame_sdl2/color.pyx":141 * r, g, b = args * self.from_rgba(r, g, b, 255) * elif len(args) == 4: # <<<<<<<<<<<<<< * r, g, b, a = args * self.from_rgba(r, g, b, a) */ __pyx_t_1 = PyTuple_GET_SIZE(__pyx_v_args); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 141; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_t_6 = ((__pyx_t_1 == 4) != 0); if (__pyx_t_6) { /* "pygame_sdl2/color.pyx":142 * self.from_rgba(r, g, b, 255) * elif len(args) == 4: * r, g, b, a = args # <<<<<<<<<<<<<< * self.from_rgba(r, g, b, a) * */ if (1) { PyObject* sequence = __pyx_v_args; #if CYTHON_COMPILING_IN_CPYTHON Py_ssize_t size = Py_SIZE(sequence); #else Py_ssize_t size = PySequence_Size(sequence); #endif if (unlikely(size != 4)) { if (size > 4) __Pyx_RaiseTooManyValuesError(4); else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 142; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } #if CYTHON_COMPILING_IN_CPYTHON __pyx_t_11 = PyTuple_GET_ITEM(sequence, 0); __pyx_t_5 = PyTuple_GET_ITEM(sequence, 1); __pyx_t_3 = PyTuple_GET_ITEM(sequence, 2); __pyx_t_12 = PyTuple_GET_ITEM(sequence, 3); __Pyx_INCREF(__pyx_t_11); __Pyx_INCREF(__pyx_t_5); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(__pyx_t_12); #else { Py_ssize_t i; PyObject** temps[4] = {&__pyx_t_11,&__pyx_t_5,&__pyx_t_3,&__pyx_t_12}; for (i=0; i < 4; i++) { PyObject* item = PySequence_ITEM(sequence, i); if (unlikely(!item)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 142; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(item); *(temps[i]) = item; } } #endif } __pyx_v_r = __pyx_t_11; __pyx_t_11 = 0; __pyx_v_g = __pyx_t_5; __pyx_t_5 = 0; __pyx_v_b = __pyx_t_3; __pyx_t_3 = 0; __pyx_v_a = __pyx_t_12; __pyx_t_12 = 0; /* "pygame_sdl2/color.pyx":143 * elif len(args) == 4: * r, g, b, a = args * self.from_rgba(r, g, b, a) # <<<<<<<<<<<<<< * * def __repr__(self): */ __pyx_t_10 = __Pyx_PyInt_As_uint8_t(__pyx_v_r); if (unlikely((__pyx_t_10 == (Uint8)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 143; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_t_9 = __Pyx_PyInt_As_uint8_t(__pyx_v_g); if (unlikely((__pyx_t_9 == (Uint8)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 143; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_t_8 = __Pyx_PyInt_As_uint8_t(__pyx_v_b); if (unlikely((__pyx_t_8 == (Uint8)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 143; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_t_7 = __Pyx_PyInt_As_uint8_t(__pyx_v_a); if (unlikely((__pyx_t_7 == (Uint8)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 143; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_t_12 = ((struct __pyx_vtabstruct_11pygame_sdl2_5color_Color *)__pyx_v_self->__pyx_vtab)->from_rgba(__pyx_v_self, __pyx_t_10, __pyx_t_9, __pyx_t_8, __pyx_t_7); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 143; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_12); __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; /* "pygame_sdl2/color.pyx":141 * r, g, b = args * self.from_rgba(r, g, b, 255) * elif len(args) == 4: # <<<<<<<<<<<<<< * r, g, b, a = args * self.from_rgba(r, g, b, a) */ } __pyx_L3:; /* "pygame_sdl2/color.pyx":116 * self.a = 255 * * def __init__(self, *args): # <<<<<<<<<<<<<< * self.length = 4 * */ /* function exit code */ __pyx_r = 0; goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_5); __Pyx_XDECREF(__pyx_t_11); __Pyx_XDECREF(__pyx_t_12); __Pyx_AddTraceback("pygame_sdl2.color.Color.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = -1; __pyx_L0:; __Pyx_XDECREF(__pyx_v_c); __Pyx_XDECREF(__pyx_v_r); __Pyx_XDECREF(__pyx_v_g); __Pyx_XDECREF(__pyx_v_b); __Pyx_XDECREF(__pyx_v_a); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/color.pyx":145 * self.from_rgba(r, g, b, a) * * def __repr__(self): # <<<<<<<<<<<<<< * return str((self.r, self.g, self.b, self.a)) * */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_5color_5Color_7__repr__(PyObject *__pyx_v_self); /*proto*/ static PyObject *__pyx_pw_11pygame_sdl2_5color_5Color_7__repr__(PyObject *__pyx_v_self) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__repr__ (wrapper)", 0); __pyx_r = __pyx_pf_11pygame_sdl2_5color_5Color_6__repr__(((struct __pyx_obj_11pygame_sdl2_5color_Color *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_5color_5Color_6__repr__(struct __pyx_obj_11pygame_sdl2_5color_Color *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; PyObject *__pyx_t_5 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__repr__", 0); /* "pygame_sdl2/color.pyx":146 * * def __repr__(self): * return str((self.r, self.g, self.b, self.a)) # <<<<<<<<<<<<<< * * def __int__(self): */ __Pyx_XDECREF(__pyx_r); __pyx_t_1 = __Pyx_PyInt_From_uint8_t(__pyx_v_self->r); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 146; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = __Pyx_PyInt_From_uint8_t(__pyx_v_self->g); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 146; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = __Pyx_PyInt_From_uint8_t(__pyx_v_self->b); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 146; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = __Pyx_PyInt_From_uint8_t(__pyx_v_self->a); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 146; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); __pyx_t_5 = PyTuple_New(4); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 146; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); __Pyx_GIVEREF(__pyx_t_1); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_1); __Pyx_GIVEREF(__pyx_t_2); PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_t_2); __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_5, 2, __pyx_t_3); __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_5, 3, __pyx_t_4); __pyx_t_1 = 0; __pyx_t_2 = 0; __pyx_t_3 = 0; __pyx_t_4 = 0; __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 146; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_5); __pyx_t_5 = 0; __pyx_t_5 = __Pyx_PyObject_Call(((PyObject *)(&PyString_Type)), __pyx_t_4, NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 146; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_r = __pyx_t_5; __pyx_t_5 = 0; goto __pyx_L0; /* "pygame_sdl2/color.pyx":145 * self.from_rgba(r, g, b, a) * * def __repr__(self): # <<<<<<<<<<<<<< * return str((self.r, self.g, self.b, self.a)) * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_5); __Pyx_AddTraceback("pygame_sdl2.color.Color.__repr__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/color.pyx":148 * return str((self.r, self.g, self.b, self.a)) * * def __int__(self): # <<<<<<<<<<<<<< * packed = struct.pack('BBBB', self.r, self.g, self.b, self.a) * return struct.unpack('>L', packed)[0] */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_5color_5Color_9__int__(PyObject *__pyx_v_self); /*proto*/ static PyObject *__pyx_pw_11pygame_sdl2_5color_5Color_9__int__(PyObject *__pyx_v_self) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__int__ (wrapper)", 0); __pyx_r = __pyx_pf_11pygame_sdl2_5color_5Color_8__int__(((struct __pyx_obj_11pygame_sdl2_5color_Color *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_5color_5Color_8__int__(struct __pyx_obj_11pygame_sdl2_5color_Color *__pyx_v_self) { PyObject *__pyx_v_packed = NULL; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; PyObject *__pyx_t_5 = NULL; PyObject *__pyx_t_6 = NULL; PyObject *__pyx_t_7 = NULL; Py_ssize_t __pyx_t_8; PyObject *__pyx_t_9 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__int__", 0); /* "pygame_sdl2/color.pyx":149 * * def __int__(self): * packed = struct.pack('BBBB', self.r, self.g, self.b, self.a) # <<<<<<<<<<<<<< * return struct.unpack('>L', packed)[0] * */ __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_struct); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 149; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_pack); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 149; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_2 = __Pyx_PyInt_From_uint8_t(__pyx_v_self->r); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 149; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __pyx_t_4 = __Pyx_PyInt_From_uint8_t(__pyx_v_self->g); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 149; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); __pyx_t_5 = __Pyx_PyInt_From_uint8_t(__pyx_v_self->b); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 149; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); __pyx_t_6 = __Pyx_PyInt_From_uint8_t(__pyx_v_self->a); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 149; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_6); __pyx_t_7 = NULL; __pyx_t_8 = 0; if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_3))) { __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_3); if (likely(__pyx_t_7)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); __Pyx_INCREF(__pyx_t_7); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_3, function); __pyx_t_8 = 1; } } __pyx_t_9 = PyTuple_New(5+__pyx_t_8); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 149; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_9); if (__pyx_t_7) { __Pyx_GIVEREF(__pyx_t_7); PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_t_7); __pyx_t_7 = NULL; } __Pyx_INCREF(__pyx_n_s_BBBB); __Pyx_GIVEREF(__pyx_n_s_BBBB); PyTuple_SET_ITEM(__pyx_t_9, 0+__pyx_t_8, __pyx_n_s_BBBB); __Pyx_GIVEREF(__pyx_t_2); PyTuple_SET_ITEM(__pyx_t_9, 1+__pyx_t_8, __pyx_t_2); __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_9, 2+__pyx_t_8, __pyx_t_4); __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_9, 3+__pyx_t_8, __pyx_t_5); __Pyx_GIVEREF(__pyx_t_6); PyTuple_SET_ITEM(__pyx_t_9, 4+__pyx_t_8, __pyx_t_6); __pyx_t_2 = 0; __pyx_t_4 = 0; __pyx_t_5 = 0; __pyx_t_6 = 0; __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_9, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 149; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_v_packed = __pyx_t_1; __pyx_t_1 = 0; /* "pygame_sdl2/color.pyx":150 * def __int__(self): * packed = struct.pack('BBBB', self.r, self.g, self.b, self.a) * return struct.unpack('>L', packed)[0] # <<<<<<<<<<<<<< * * def __hex__(self): */ __Pyx_XDECREF(__pyx_r); __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_struct); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 150; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_unpack); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 150; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_9); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_3 = NULL; __pyx_t_8 = 0; if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_9))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_9); if (likely(__pyx_t_3)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_9); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_9, function); __pyx_t_8 = 1; } } __pyx_t_6 = PyTuple_New(2+__pyx_t_8); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 150; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_6); if (__pyx_t_3) { __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_3); __pyx_t_3 = NULL; } __Pyx_INCREF(__pyx_kp_s_L); __Pyx_GIVEREF(__pyx_kp_s_L); PyTuple_SET_ITEM(__pyx_t_6, 0+__pyx_t_8, __pyx_kp_s_L); __Pyx_INCREF(__pyx_v_packed); __Pyx_GIVEREF(__pyx_v_packed); PyTuple_SET_ITEM(__pyx_t_6, 1+__pyx_t_8, __pyx_v_packed); __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_9, __pyx_t_6, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 150; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; __pyx_t_9 = __Pyx_GetItemInt(__pyx_t_1, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(__pyx_t_9 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 150; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; __Pyx_GOTREF(__pyx_t_9); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_r = __pyx_t_9; __pyx_t_9 = 0; goto __pyx_L0; /* "pygame_sdl2/color.pyx":148 * return str((self.r, self.g, self.b, self.a)) * * def __int__(self): # <<<<<<<<<<<<<< * packed = struct.pack('BBBB', self.r, self.g, self.b, self.a) * return struct.unpack('>L', packed)[0] */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_5); __Pyx_XDECREF(__pyx_t_6); __Pyx_XDECREF(__pyx_t_7); __Pyx_XDECREF(__pyx_t_9); __Pyx_AddTraceback("pygame_sdl2.color.Color.__int__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF(__pyx_v_packed); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/color.pyx":152 * return struct.unpack('>L', packed)[0] * * def __hex__(self): # <<<<<<<<<<<<<< * return hex(int(self)) * */ /* Python wrapper */ #if PY_MAJOR_VERSION < 3 || CYTHON_COMPILING_IN_PYPY static PyObject *__pyx_pw_11pygame_sdl2_5color_5Color_11__hex__(PyObject *__pyx_v_self); /*proto*/ static PyObject *__pyx_pw_11pygame_sdl2_5color_5Color_11__hex__(PyObject *__pyx_v_self) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__hex__ (wrapper)", 0); __pyx_r = __pyx_pf_11pygame_sdl2_5color_5Color_10__hex__(((struct __pyx_obj_11pygame_sdl2_5color_Color *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } #endif /*!(#if PY_MAJOR_VERSION < 3 || CYTHON_COMPILING_IN_PYPY)*/ #if PY_MAJOR_VERSION < 3 || CYTHON_COMPILING_IN_PYPY static PyObject *__pyx_pf_11pygame_sdl2_5color_5Color_10__hex__(struct __pyx_obj_11pygame_sdl2_5color_Color *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__hex__", 0); /* "pygame_sdl2/color.pyx":153 * * def __hex__(self): * return hex(int(self)) # <<<<<<<<<<<<<< * * def __oct__(self): */ __Pyx_XDECREF(__pyx_r); __pyx_t_1 = PyNumber_Int(((PyObject *)__pyx_v_self)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 153; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 153; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __Pyx_GIVEREF(__pyx_t_1); PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_1); __pyx_t_1 = 0; __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_hex, __pyx_t_2, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 153; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "pygame_sdl2/color.pyx":152 * return struct.unpack('>L', packed)[0] * * def __hex__(self): # <<<<<<<<<<<<<< * return hex(int(self)) * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_AddTraceback("pygame_sdl2.color.Color.__hex__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } #endif /*!(#if PY_MAJOR_VERSION < 3 || CYTHON_COMPILING_IN_PYPY)*/ /* "pygame_sdl2/color.pyx":155 * return hex(int(self)) * * def __oct__(self): # <<<<<<<<<<<<<< * return oct(int(self)) * */ /* Python wrapper */ #if PY_MAJOR_VERSION < 3 || CYTHON_COMPILING_IN_PYPY static PyObject *__pyx_pw_11pygame_sdl2_5color_5Color_13__oct__(PyObject *__pyx_v_self); /*proto*/ static PyObject *__pyx_pw_11pygame_sdl2_5color_5Color_13__oct__(PyObject *__pyx_v_self) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__oct__ (wrapper)", 0); __pyx_r = __pyx_pf_11pygame_sdl2_5color_5Color_12__oct__(((struct __pyx_obj_11pygame_sdl2_5color_Color *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } #endif /*!(#if PY_MAJOR_VERSION < 3 || CYTHON_COMPILING_IN_PYPY)*/ #if PY_MAJOR_VERSION < 3 || CYTHON_COMPILING_IN_PYPY static PyObject *__pyx_pf_11pygame_sdl2_5color_5Color_12__oct__(struct __pyx_obj_11pygame_sdl2_5color_Color *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__oct__", 0); /* "pygame_sdl2/color.pyx":156 * * def __oct__(self): * return oct(int(self)) # <<<<<<<<<<<<<< * * def __float__(self): */ __Pyx_XDECREF(__pyx_r); __pyx_t_1 = PyNumber_Int(((PyObject *)__pyx_v_self)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 156; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 156; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __Pyx_GIVEREF(__pyx_t_1); PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_1); __pyx_t_1 = 0; __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_oct, __pyx_t_2, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 156; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "pygame_sdl2/color.pyx":155 * return hex(int(self)) * * def __oct__(self): # <<<<<<<<<<<<<< * return oct(int(self)) * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_AddTraceback("pygame_sdl2.color.Color.__oct__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } #endif /*!(#if PY_MAJOR_VERSION < 3 || CYTHON_COMPILING_IN_PYPY)*/ /* "pygame_sdl2/color.pyx":158 * return oct(int(self)) * * def __float__(self): # <<<<<<<<<<<<<< * return float(int(self)) * */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_5color_5Color_15__float__(PyObject *__pyx_v_self); /*proto*/ static PyObject *__pyx_pw_11pygame_sdl2_5color_5Color_15__float__(PyObject *__pyx_v_self) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__float__ (wrapper)", 0); __pyx_r = __pyx_pf_11pygame_sdl2_5color_5Color_14__float__(((struct __pyx_obj_11pygame_sdl2_5color_Color *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_5color_5Color_14__float__(struct __pyx_obj_11pygame_sdl2_5color_Color *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; double __pyx_t_2; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__float__", 0); /* "pygame_sdl2/color.pyx":159 * * def __float__(self): * return float(int(self)) # <<<<<<<<<<<<<< * * def __reduce__(self): */ __Pyx_XDECREF(__pyx_r); __pyx_t_1 = PyNumber_Int(((PyObject *)__pyx_v_self)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 159; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = __Pyx_PyObject_AsDouble(__pyx_t_1); if (unlikely(__pyx_t_2 == ((double)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 159; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_1 = PyFloat_FromDouble(__pyx_t_2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 159; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "pygame_sdl2/color.pyx":158 * return oct(int(self)) * * def __float__(self): # <<<<<<<<<<<<<< * return float(int(self)) * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("pygame_sdl2.color.Color.__float__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/color.pyx":161 * return float(int(self)) * * def __reduce__(self): # <<<<<<<<<<<<<< * d = {} * d['rgba'] = (self.r, self.g, self.b, self.a) */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_5color_5Color_17__reduce__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/ static PyObject *__pyx_pw_11pygame_sdl2_5color_5Color_17__reduce__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__reduce__ (wrapper)", 0); __pyx_r = __pyx_pf_11pygame_sdl2_5color_5Color_16__reduce__(((struct __pyx_obj_11pygame_sdl2_5color_Color *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_5color_5Color_16__reduce__(struct __pyx_obj_11pygame_sdl2_5color_Color *__pyx_v_self) { PyObject *__pyx_v_d = NULL; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; PyObject *__pyx_t_5 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__reduce__", 0); /* "pygame_sdl2/color.pyx":162 * * def __reduce__(self): * d = {} # <<<<<<<<<<<<<< * d['rgba'] = (self.r, self.g, self.b, self.a) * return (Color, (), d) */ __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 162; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_v_d = ((PyObject*)__pyx_t_1); __pyx_t_1 = 0; /* "pygame_sdl2/color.pyx":163 * def __reduce__(self): * d = {} * d['rgba'] = (self.r, self.g, self.b, self.a) # <<<<<<<<<<<<<< * return (Color, (), d) * */ __pyx_t_1 = __Pyx_PyInt_From_uint8_t(__pyx_v_self->r); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 163; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = __Pyx_PyInt_From_uint8_t(__pyx_v_self->g); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 163; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = __Pyx_PyInt_From_uint8_t(__pyx_v_self->b); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 163; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = __Pyx_PyInt_From_uint8_t(__pyx_v_self->a); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 163; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); __pyx_t_5 = PyTuple_New(4); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 163; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); __Pyx_GIVEREF(__pyx_t_1); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_1); __Pyx_GIVEREF(__pyx_t_2); PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_t_2); __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_5, 2, __pyx_t_3); __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_5, 3, __pyx_t_4); __pyx_t_1 = 0; __pyx_t_2 = 0; __pyx_t_3 = 0; __pyx_t_4 = 0; if (unlikely(PyDict_SetItem(__pyx_v_d, __pyx_n_s_rgba, __pyx_t_5) < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 163; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; /* "pygame_sdl2/color.pyx":164 * d = {} * d['rgba'] = (self.r, self.g, self.b, self.a) * return (Color, (), d) # <<<<<<<<<<<<<< * * def __setstate__(self, d): */ __Pyx_XDECREF(__pyx_r); __pyx_t_5 = PyTuple_New(3); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 164; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); __Pyx_INCREF(((PyObject *)__pyx_ptype_11pygame_sdl2_5color_Color)); __Pyx_GIVEREF(((PyObject *)__pyx_ptype_11pygame_sdl2_5color_Color)); PyTuple_SET_ITEM(__pyx_t_5, 0, ((PyObject *)__pyx_ptype_11pygame_sdl2_5color_Color)); __Pyx_INCREF(__pyx_empty_tuple); __Pyx_GIVEREF(__pyx_empty_tuple); PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_empty_tuple); __Pyx_INCREF(__pyx_v_d); __Pyx_GIVEREF(__pyx_v_d); PyTuple_SET_ITEM(__pyx_t_5, 2, __pyx_v_d); __pyx_r = __pyx_t_5; __pyx_t_5 = 0; goto __pyx_L0; /* "pygame_sdl2/color.pyx":161 * return float(int(self)) * * def __reduce__(self): # <<<<<<<<<<<<<< * d = {} * d['rgba'] = (self.r, self.g, self.b, self.a) */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_5); __Pyx_AddTraceback("pygame_sdl2.color.Color.__reduce__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF(__pyx_v_d); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/color.pyx":166 * return (Color, (), d) * * def __setstate__(self, d): # <<<<<<<<<<<<<< * self.r, self.g, self.b, self.a = d['rgba'] * */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_5color_5Color_19__setstate__(PyObject *__pyx_v_self, PyObject *__pyx_v_d); /*proto*/ static PyObject *__pyx_pw_11pygame_sdl2_5color_5Color_19__setstate__(PyObject *__pyx_v_self, PyObject *__pyx_v_d) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__setstate__ (wrapper)", 0); __pyx_r = __pyx_pf_11pygame_sdl2_5color_5Color_18__setstate__(((struct __pyx_obj_11pygame_sdl2_5color_Color *)__pyx_v_self), ((PyObject *)__pyx_v_d)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_5color_5Color_18__setstate__(struct __pyx_obj_11pygame_sdl2_5color_Color *__pyx_v_self, PyObject *__pyx_v_d) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; PyObject *__pyx_t_5 = NULL; PyObject *__pyx_t_6 = NULL; PyObject *(*__pyx_t_7)(PyObject *); Uint8 __pyx_t_8; Uint8 __pyx_t_9; Uint8 __pyx_t_10; Uint8 __pyx_t_11; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__setstate__", 0); /* "pygame_sdl2/color.pyx":167 * * def __setstate__(self, d): * self.r, self.g, self.b, self.a = d['rgba'] # <<<<<<<<<<<<<< * * def __setitem__(self, key, val): */ __pyx_t_1 = PyObject_GetItem(__pyx_v_d, __pyx_n_s_rgba); if (unlikely(__pyx_t_1 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 167; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; __Pyx_GOTREF(__pyx_t_1); if ((likely(PyTuple_CheckExact(__pyx_t_1))) || (PyList_CheckExact(__pyx_t_1))) { PyObject* sequence = __pyx_t_1; #if CYTHON_COMPILING_IN_CPYTHON Py_ssize_t size = Py_SIZE(sequence); #else Py_ssize_t size = PySequence_Size(sequence); #endif if (unlikely(size != 4)) { if (size > 4) __Pyx_RaiseTooManyValuesError(4); else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 167; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } #if CYTHON_COMPILING_IN_CPYTHON if (likely(PyTuple_CheckExact(sequence))) { __pyx_t_2 = PyTuple_GET_ITEM(sequence, 0); __pyx_t_3 = PyTuple_GET_ITEM(sequence, 1); __pyx_t_4 = PyTuple_GET_ITEM(sequence, 2); __pyx_t_5 = PyTuple_GET_ITEM(sequence, 3); } else { __pyx_t_2 = PyList_GET_ITEM(sequence, 0); __pyx_t_3 = PyList_GET_ITEM(sequence, 1); __pyx_t_4 = PyList_GET_ITEM(sequence, 2); __pyx_t_5 = PyList_GET_ITEM(sequence, 3); } __Pyx_INCREF(__pyx_t_2); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(__pyx_t_4); __Pyx_INCREF(__pyx_t_5); #else { Py_ssize_t i; PyObject** temps[4] = {&__pyx_t_2,&__pyx_t_3,&__pyx_t_4,&__pyx_t_5}; for (i=0; i < 4; i++) { PyObject* item = PySequence_ITEM(sequence, i); if (unlikely(!item)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 167; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(item); *(temps[i]) = item; } } #endif __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; } else { Py_ssize_t index = -1; PyObject** temps[4] = {&__pyx_t_2,&__pyx_t_3,&__pyx_t_4,&__pyx_t_5}; __pyx_t_6 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 167; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_7 = Py_TYPE(__pyx_t_6)->tp_iternext; for (index=0; index < 4; index++) { PyObject* item = __pyx_t_7(__pyx_t_6); if (unlikely(!item)) goto __pyx_L3_unpacking_failed; __Pyx_GOTREF(item); *(temps[index]) = item; } if (__Pyx_IternextUnpackEndCheck(__pyx_t_7(__pyx_t_6), 4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 167; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_t_7 = NULL; __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; goto __pyx_L4_unpacking_done; __pyx_L3_unpacking_failed:; __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __pyx_t_7 = NULL; if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 167; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_L4_unpacking_done:; } __pyx_t_8 = __Pyx_PyInt_As_uint8_t(__pyx_t_2); if (unlikely((__pyx_t_8 == (Uint8)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 167; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_9 = __Pyx_PyInt_As_uint8_t(__pyx_t_3); if (unlikely((__pyx_t_9 == (Uint8)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 167; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_10 = __Pyx_PyInt_As_uint8_t(__pyx_t_4); if (unlikely((__pyx_t_10 == (Uint8)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 167; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_t_11 = __Pyx_PyInt_As_uint8_t(__pyx_t_5); if (unlikely((__pyx_t_11 == (Uint8)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 167; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __pyx_v_self->r = __pyx_t_8; __pyx_v_self->g = __pyx_t_9; __pyx_v_self->b = __pyx_t_10; __pyx_v_self->a = __pyx_t_11; /* "pygame_sdl2/color.pyx":166 * return (Color, (), d) * * def __setstate__(self, d): # <<<<<<<<<<<<<< * self.r, self.g, self.b, self.a = d['rgba'] * */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_5); __Pyx_XDECREF(__pyx_t_6); __Pyx_AddTraceback("pygame_sdl2.color.Color.__setstate__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/color.pyx":169 * self.r, self.g, self.b, self.a = d['rgba'] * * def __setitem__(self, key, val): # <<<<<<<<<<<<<< * if not isinstance(val, int): * raise ValueError(val) */ /* Python wrapper */ static int __pyx_pw_11pygame_sdl2_5color_5Color_21__setitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_key, PyObject *__pyx_v_val); /*proto*/ static int __pyx_pw_11pygame_sdl2_5color_5Color_21__setitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_key, PyObject *__pyx_v_val) { int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__setitem__ (wrapper)", 0); __pyx_r = __pyx_pf_11pygame_sdl2_5color_5Color_20__setitem__(((struct __pyx_obj_11pygame_sdl2_5color_Color *)__pyx_v_self), ((PyObject *)__pyx_v_key), ((PyObject *)__pyx_v_val)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static int __pyx_pf_11pygame_sdl2_5color_5Color_20__setitem__(struct __pyx_obj_11pygame_sdl2_5color_Color *__pyx_v_self, PyObject *__pyx_v_key, PyObject *__pyx_v_val) { int __pyx_r; __Pyx_RefNannyDeclarations int __pyx_t_1; int __pyx_t_2; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; Uint8 __pyx_t_5; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__setitem__", 0); /* "pygame_sdl2/color.pyx":170 * * def __setitem__(self, key, val): * if not isinstance(val, int): # <<<<<<<<<<<<<< * raise ValueError(val) * if key >= self.length: */ __pyx_t_1 = PyInt_Check(__pyx_v_val); __pyx_t_2 = ((!(__pyx_t_1 != 0)) != 0); if (__pyx_t_2) { /* "pygame_sdl2/color.pyx":171 * def __setitem__(self, key, val): * if not isinstance(val, int): * raise ValueError(val) # <<<<<<<<<<<<<< * if key >= self.length: * raise IndexError(key) */ __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 171; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __Pyx_INCREF(__pyx_v_val); __Pyx_GIVEREF(__pyx_v_val); PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_val); __pyx_t_4 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_t_3, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 171; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_Raise(__pyx_t_4, 0, 0, 0); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; {__pyx_filename = __pyx_f[0]; __pyx_lineno = 171; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "pygame_sdl2/color.pyx":170 * * def __setitem__(self, key, val): * if not isinstance(val, int): # <<<<<<<<<<<<<< * raise ValueError(val) * if key >= self.length: */ } /* "pygame_sdl2/color.pyx":172 * if not isinstance(val, int): * raise ValueError(val) * if key >= self.length: # <<<<<<<<<<<<<< * raise IndexError(key) * if val < 0 or val > 255: */ __pyx_t_4 = __Pyx_PyInt_From_uint8_t(__pyx_v_self->length); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 172; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); __pyx_t_3 = PyObject_RichCompare(__pyx_v_key, __pyx_t_4, Py_GE); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 172; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 172; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; if (__pyx_t_2) { /* "pygame_sdl2/color.pyx":173 * raise ValueError(val) * if key >= self.length: * raise IndexError(key) # <<<<<<<<<<<<<< * if val < 0 or val > 255: * raise ValueError(val) */ __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 173; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __Pyx_INCREF(__pyx_v_key); __Pyx_GIVEREF(__pyx_v_key); PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_key); __pyx_t_4 = __Pyx_PyObject_Call(__pyx_builtin_IndexError, __pyx_t_3, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 173; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_Raise(__pyx_t_4, 0, 0, 0); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; {__pyx_filename = __pyx_f[0]; __pyx_lineno = 173; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "pygame_sdl2/color.pyx":172 * if not isinstance(val, int): * raise ValueError(val) * if key >= self.length: # <<<<<<<<<<<<<< * raise IndexError(key) * if val < 0 or val > 255: */ } /* "pygame_sdl2/color.pyx":174 * if key >= self.length: * raise IndexError(key) * if val < 0 or val > 255: # <<<<<<<<<<<<<< * raise ValueError(val) * */ __pyx_t_4 = PyObject_RichCompare(__pyx_v_val, __pyx_int_0, Py_LT); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 174; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_1 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 174; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; if (!__pyx_t_1) { } else { __pyx_t_2 = __pyx_t_1; goto __pyx_L6_bool_binop_done; } __pyx_t_4 = PyObject_RichCompare(__pyx_v_val, __pyx_int_255, Py_GT); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 174; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_1 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 174; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_t_2 = __pyx_t_1; __pyx_L6_bool_binop_done:; if (__pyx_t_2) { /* "pygame_sdl2/color.pyx":175 * raise IndexError(key) * if val < 0 or val > 255: * raise ValueError(val) # <<<<<<<<<<<<<< * * if key == 0: self.r = val */ __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 175; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); __Pyx_INCREF(__pyx_v_val); __Pyx_GIVEREF(__pyx_v_val); PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_v_val); __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_t_4, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 175; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_Raise(__pyx_t_3, 0, 0, 0); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; {__pyx_filename = __pyx_f[0]; __pyx_lineno = 175; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "pygame_sdl2/color.pyx":174 * if key >= self.length: * raise IndexError(key) * if val < 0 or val > 255: # <<<<<<<<<<<<<< * raise ValueError(val) * */ } /* "pygame_sdl2/color.pyx":177 * raise ValueError(val) * * if key == 0: self.r = val # <<<<<<<<<<<<<< * elif key == 1: self.g = val * elif key == 2: self.b = val */ __pyx_t_3 = __Pyx_PyInt_EqObjC(__pyx_v_key, __pyx_int_0, 0, 0); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 177; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 177; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; if (__pyx_t_2) { __pyx_t_5 = __Pyx_PyInt_As_uint8_t(__pyx_v_val); if (unlikely((__pyx_t_5 == (Uint8)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 177; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_v_self->r = __pyx_t_5; goto __pyx_L8; } /* "pygame_sdl2/color.pyx":178 * * if key == 0: self.r = val * elif key == 1: self.g = val # <<<<<<<<<<<<<< * elif key == 2: self.b = val * elif key == 3: self.a = val */ __pyx_t_3 = __Pyx_PyInt_EqObjC(__pyx_v_key, __pyx_int_1, 1, 0); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 178; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 178; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; if (__pyx_t_2) { __pyx_t_5 = __Pyx_PyInt_As_uint8_t(__pyx_v_val); if (unlikely((__pyx_t_5 == (Uint8)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 178; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_v_self->g = __pyx_t_5; goto __pyx_L8; } /* "pygame_sdl2/color.pyx":179 * if key == 0: self.r = val * elif key == 1: self.g = val * elif key == 2: self.b = val # <<<<<<<<<<<<<< * elif key == 3: self.a = val * else: */ __pyx_t_3 = __Pyx_PyInt_EqObjC(__pyx_v_key, __pyx_int_2, 2, 0); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 179; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 179; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; if (__pyx_t_2) { __pyx_t_5 = __Pyx_PyInt_As_uint8_t(__pyx_v_val); if (unlikely((__pyx_t_5 == (Uint8)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 179; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_v_self->b = __pyx_t_5; goto __pyx_L8; } /* "pygame_sdl2/color.pyx":180 * elif key == 1: self.g = val * elif key == 2: self.b = val * elif key == 3: self.a = val # <<<<<<<<<<<<<< * else: * raise IndexError(key) */ __pyx_t_3 = __Pyx_PyInt_EqObjC(__pyx_v_key, __pyx_int_3, 3, 0); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 180; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 180; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; if (__pyx_t_2) { __pyx_t_5 = __Pyx_PyInt_As_uint8_t(__pyx_v_val); if (unlikely((__pyx_t_5 == (Uint8)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 180; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_v_self->a = __pyx_t_5; goto __pyx_L8; } /* "pygame_sdl2/color.pyx":182 * elif key == 3: self.a = val * else: * raise IndexError(key) # <<<<<<<<<<<<<< * * def __getitem__(self, key): */ /*else*/ { __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 182; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __Pyx_INCREF(__pyx_v_key); __Pyx_GIVEREF(__pyx_v_key); PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_key); __pyx_t_4 = __Pyx_PyObject_Call(__pyx_builtin_IndexError, __pyx_t_3, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 182; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_Raise(__pyx_t_4, 0, 0, 0); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; {__pyx_filename = __pyx_f[0]; __pyx_lineno = 182; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } __pyx_L8:; /* "pygame_sdl2/color.pyx":169 * self.r, self.g, self.b, self.a = d['rgba'] * * def __setitem__(self, key, val): # <<<<<<<<<<<<<< * if not isinstance(val, int): * raise ValueError(val) */ /* function exit code */ __pyx_r = 0; goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_AddTraceback("pygame_sdl2.color.Color.__setitem__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = -1; __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/color.pyx":184 * raise IndexError(key) * * def __getitem__(self, key): # <<<<<<<<<<<<<< * if isinstance(key, slice): * return tuple(self)[key] */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_5color_5Color_23__getitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_key); /*proto*/ static PyObject *__pyx_pw_11pygame_sdl2_5color_5Color_23__getitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_key) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__getitem__ (wrapper)", 0); __pyx_r = __pyx_pf_11pygame_sdl2_5color_5Color_22__getitem__(((struct __pyx_obj_11pygame_sdl2_5color_Color *)__pyx_v_self), ((PyObject *)__pyx_v_key)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_5color_5Color_22__getitem__(struct __pyx_obj_11pygame_sdl2_5color_Color *__pyx_v_self, PyObject *__pyx_v_key) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; int __pyx_t_2; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__getitem__", 0); /* "pygame_sdl2/color.pyx":185 * * def __getitem__(self, key): * if isinstance(key, slice): # <<<<<<<<<<<<<< * return tuple(self)[key] * if key >= self.length: */ __pyx_t_1 = PySlice_Check(__pyx_v_key); __pyx_t_2 = (__pyx_t_1 != 0); if (__pyx_t_2) { /* "pygame_sdl2/color.pyx":186 * def __getitem__(self, key): * if isinstance(key, slice): * return tuple(self)[key] # <<<<<<<<<<<<<< * if key >= self.length: * raise IndexError(key) */ __Pyx_XDECREF(__pyx_r); __pyx_t_3 = PySequence_Tuple(((PyObject *)__pyx_v_self)); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 186; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = PyObject_GetItem(__pyx_t_3, __pyx_v_key); if (unlikely(__pyx_t_4 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 186; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_r = __pyx_t_4; __pyx_t_4 = 0; goto __pyx_L0; /* "pygame_sdl2/color.pyx":185 * * def __getitem__(self, key): * if isinstance(key, slice): # <<<<<<<<<<<<<< * return tuple(self)[key] * if key >= self.length: */ } /* "pygame_sdl2/color.pyx":187 * if isinstance(key, slice): * return tuple(self)[key] * if key >= self.length: # <<<<<<<<<<<<<< * raise IndexError(key) * if key == 0: return self.r */ __pyx_t_4 = __Pyx_PyInt_From_uint8_t(__pyx_v_self->length); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 187; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); __pyx_t_3 = PyObject_RichCompare(__pyx_v_key, __pyx_t_4, Py_GE); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 187; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 187; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; if (__pyx_t_2) { /* "pygame_sdl2/color.pyx":188 * return tuple(self)[key] * if key >= self.length: * raise IndexError(key) # <<<<<<<<<<<<<< * if key == 0: return self.r * elif key == 1: return self.g */ __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 188; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __Pyx_INCREF(__pyx_v_key); __Pyx_GIVEREF(__pyx_v_key); PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_key); __pyx_t_4 = __Pyx_PyObject_Call(__pyx_builtin_IndexError, __pyx_t_3, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 188; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_Raise(__pyx_t_4, 0, 0, 0); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; {__pyx_filename = __pyx_f[0]; __pyx_lineno = 188; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "pygame_sdl2/color.pyx":187 * if isinstance(key, slice): * return tuple(self)[key] * if key >= self.length: # <<<<<<<<<<<<<< * raise IndexError(key) * if key == 0: return self.r */ } /* "pygame_sdl2/color.pyx":189 * if key >= self.length: * raise IndexError(key) * if key == 0: return self.r # <<<<<<<<<<<<<< * elif key == 1: return self.g * elif key == 2: return self.b */ __pyx_t_4 = __Pyx_PyInt_EqObjC(__pyx_v_key, __pyx_int_0, 0, 0); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 189; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 189; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; if (__pyx_t_2) { __Pyx_XDECREF(__pyx_r); __pyx_t_4 = __Pyx_PyInt_From_uint8_t(__pyx_v_self->r); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 189; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); __pyx_r = __pyx_t_4; __pyx_t_4 = 0; goto __pyx_L0; } /* "pygame_sdl2/color.pyx":190 * raise IndexError(key) * if key == 0: return self.r * elif key == 1: return self.g # <<<<<<<<<<<<<< * elif key == 2: return self.b * elif key == 3: return self.a */ __pyx_t_4 = __Pyx_PyInt_EqObjC(__pyx_v_key, __pyx_int_1, 1, 0); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 190; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 190; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; if (__pyx_t_2) { __Pyx_XDECREF(__pyx_r); __pyx_t_4 = __Pyx_PyInt_From_uint8_t(__pyx_v_self->g); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 190; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); __pyx_r = __pyx_t_4; __pyx_t_4 = 0; goto __pyx_L0; } /* "pygame_sdl2/color.pyx":191 * if key == 0: return self.r * elif key == 1: return self.g * elif key == 2: return self.b # <<<<<<<<<<<<<< * elif key == 3: return self.a * else: */ __pyx_t_4 = __Pyx_PyInt_EqObjC(__pyx_v_key, __pyx_int_2, 2, 0); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 191; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 191; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; if (__pyx_t_2) { __Pyx_XDECREF(__pyx_r); __pyx_t_4 = __Pyx_PyInt_From_uint8_t(__pyx_v_self->b); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 191; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); __pyx_r = __pyx_t_4; __pyx_t_4 = 0; goto __pyx_L0; } /* "pygame_sdl2/color.pyx":192 * elif key == 1: return self.g * elif key == 2: return self.b * elif key == 3: return self.a # <<<<<<<<<<<<<< * else: * raise IndexError(key) */ __pyx_t_4 = __Pyx_PyInt_EqObjC(__pyx_v_key, __pyx_int_3, 3, 0); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 192; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 192; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; if (__pyx_t_2) { __Pyx_XDECREF(__pyx_r); __pyx_t_4 = __Pyx_PyInt_From_uint8_t(__pyx_v_self->a); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 192; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); __pyx_r = __pyx_t_4; __pyx_t_4 = 0; goto __pyx_L0; } /* "pygame_sdl2/color.pyx":194 * elif key == 3: return self.a * else: * raise IndexError(key) # <<<<<<<<<<<<<< * * def __len__(self): */ /*else*/ { __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 194; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); __Pyx_INCREF(__pyx_v_key); __Pyx_GIVEREF(__pyx_v_key); PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_v_key); __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_IndexError, __pyx_t_4, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 194; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_Raise(__pyx_t_3, 0, 0, 0); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; {__pyx_filename = __pyx_f[0]; __pyx_lineno = 194; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } /* "pygame_sdl2/color.pyx":184 * raise IndexError(key) * * def __getitem__(self, key): # <<<<<<<<<<<<<< * if isinstance(key, slice): * return tuple(self)[key] */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_AddTraceback("pygame_sdl2.color.Color.__getitem__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/color.pyx":196 * raise IndexError(key) * * def __len__(self): # <<<<<<<<<<<<<< * return self.length * */ /* Python wrapper */ static Py_ssize_t __pyx_pw_11pygame_sdl2_5color_5Color_25__len__(PyObject *__pyx_v_self); /*proto*/ static Py_ssize_t __pyx_pw_11pygame_sdl2_5color_5Color_25__len__(PyObject *__pyx_v_self) { Py_ssize_t __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__len__ (wrapper)", 0); __pyx_r = __pyx_pf_11pygame_sdl2_5color_5Color_24__len__(((struct __pyx_obj_11pygame_sdl2_5color_Color *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static Py_ssize_t __pyx_pf_11pygame_sdl2_5color_5Color_24__len__(struct __pyx_obj_11pygame_sdl2_5color_Color *__pyx_v_self) { Py_ssize_t __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__len__", 0); /* "pygame_sdl2/color.pyx":197 * * def __len__(self): * return self.length # <<<<<<<<<<<<<< * * def __mul__(self not None, Color rhs not None): */ __pyx_r = __pyx_v_self->length; goto __pyx_L0; /* "pygame_sdl2/color.pyx":196 * raise IndexError(key) * * def __len__(self): # <<<<<<<<<<<<<< * return self.length * */ /* function exit code */ __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/color.pyx":199 * return self.length * * def __mul__(self not None, Color rhs not None): # <<<<<<<<<<<<<< * # Multiplying this way doesn't make much sense, * # but it's how pygame does it. */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_5color_5Color_27__mul__(PyObject *__pyx_v_self, PyObject *__pyx_v_rhs); /*proto*/ static PyObject *__pyx_pw_11pygame_sdl2_5color_5Color_27__mul__(PyObject *__pyx_v_self, PyObject *__pyx_v_rhs) { CYTHON_UNUSED int __pyx_lineno = 0; CYTHON_UNUSED const char *__pyx_filename = NULL; CYTHON_UNUSED int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__mul__ (wrapper)", 0); if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) { PyErr_Format(PyExc_TypeError, "Argument '%.200s' must not be None", "self"); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 199; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_rhs), __pyx_ptype_11pygame_sdl2_5color_Color, 0, "rhs", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 199; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_r = __pyx_pf_11pygame_sdl2_5color_5Color_26__mul__(((PyObject *)__pyx_v_self), ((struct __pyx_obj_11pygame_sdl2_5color_Color *)__pyx_v_rhs)); /* function exit code */ goto __pyx_L0; __pyx_L1_error:; __pyx_r = NULL; __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_5color_5Color_26__mul__(PyObject *__pyx_v_self, struct __pyx_obj_11pygame_sdl2_5color_Color *__pyx_v_rhs) { PyObject *__pyx_v_r = NULL; PyObject *__pyx_v_g = NULL; PyObject *__pyx_v_b = NULL; PyObject *__pyx_v_a = NULL; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; long __pyx_t_4; PyObject *__pyx_t_5 = NULL; int __pyx_t_6; Py_ssize_t __pyx_t_7; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__mul__", 0); /* "pygame_sdl2/color.pyx":203 * # but it's how pygame does it. * * r = min(255, self.r * rhs.r) # <<<<<<<<<<<<<< * g = min(255, self.g * rhs.g) * b = min(255, self.b * rhs.b) */ __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_r); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 203; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = __Pyx_PyInt_From_uint8_t(__pyx_v_rhs->r); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 203; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = PyNumber_Multiply(__pyx_t_1, __pyx_t_2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 203; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_4 = 0xFF; __pyx_t_1 = __Pyx_PyInt_From_long(__pyx_t_4); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 203; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_t_5 = PyObject_RichCompare(__pyx_t_3, __pyx_t_1, Py_LT); __Pyx_XGOTREF(__pyx_t_5); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 203; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 203; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; if (__pyx_t_6) { __Pyx_INCREF(__pyx_t_3); __pyx_t_2 = __pyx_t_3; } else { __pyx_t_5 = __Pyx_PyInt_From_long(__pyx_t_4); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 203; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); __pyx_t_2 = __pyx_t_5; __pyx_t_5 = 0; } __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_3 = __pyx_t_2; __Pyx_INCREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_v_r = __pyx_t_3; __pyx_t_3 = 0; /* "pygame_sdl2/color.pyx":204 * * r = min(255, self.r * rhs.r) * g = min(255, self.g * rhs.g) # <<<<<<<<<<<<<< * b = min(255, self.b * rhs.b) * a = min(255, self.a * rhs.a) */ __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_g); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 204; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __pyx_t_2 = __Pyx_PyInt_From_uint8_t(__pyx_v_rhs->g); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 204; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __pyx_t_5 = PyNumber_Multiply(__pyx_t_3, __pyx_t_2); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 204; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_4 = 0xFF; __pyx_t_3 = __Pyx_PyInt_From_long(__pyx_t_4); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 204; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __pyx_t_1 = PyObject_RichCompare(__pyx_t_5, __pyx_t_3, Py_LT); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 204; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 204; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (__pyx_t_6) { __Pyx_INCREF(__pyx_t_5); __pyx_t_2 = __pyx_t_5; } else { __pyx_t_1 = __Pyx_PyInt_From_long(__pyx_t_4); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 204; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = __pyx_t_1; __pyx_t_1 = 0; } __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __pyx_t_5 = __pyx_t_2; __Pyx_INCREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_v_g = __pyx_t_5; __pyx_t_5 = 0; /* "pygame_sdl2/color.pyx":205 * r = min(255, self.r * rhs.r) * g = min(255, self.g * rhs.g) * b = min(255, self.b * rhs.b) # <<<<<<<<<<<<<< * a = min(255, self.a * rhs.a) * */ __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_b); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 205; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); __pyx_t_2 = __Pyx_PyInt_From_uint8_t(__pyx_v_rhs->b); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 205; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __pyx_t_1 = PyNumber_Multiply(__pyx_t_5, __pyx_t_2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 205; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_4 = 0xFF; __pyx_t_5 = __Pyx_PyInt_From_long(__pyx_t_4); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 205; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); __pyx_t_3 = PyObject_RichCompare(__pyx_t_1, __pyx_t_5, Py_LT); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 205; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 205; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; if (__pyx_t_6) { __Pyx_INCREF(__pyx_t_1); __pyx_t_2 = __pyx_t_1; } else { __pyx_t_3 = __Pyx_PyInt_From_long(__pyx_t_4); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 205; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __pyx_t_2 = __pyx_t_3; __pyx_t_3 = 0; } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_1 = __pyx_t_2; __Pyx_INCREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_v_b = __pyx_t_1; __pyx_t_1 = 0; /* "pygame_sdl2/color.pyx":206 * g = min(255, self.g * rhs.g) * b = min(255, self.b * rhs.b) * a = min(255, self.a * rhs.a) # <<<<<<<<<<<<<< * * return type(self)(r, g, b, a) */ __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_a); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 206; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = __Pyx_PyInt_From_uint8_t(__pyx_v_rhs->a); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 206; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = PyNumber_Multiply(__pyx_t_1, __pyx_t_2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 206; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_4 = 0xFF; __pyx_t_1 = __Pyx_PyInt_From_long(__pyx_t_4); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 206; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_t_5 = PyObject_RichCompare(__pyx_t_3, __pyx_t_1, Py_LT); __Pyx_XGOTREF(__pyx_t_5); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 206; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 206; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; if (__pyx_t_6) { __Pyx_INCREF(__pyx_t_3); __pyx_t_2 = __pyx_t_3; } else { __pyx_t_5 = __Pyx_PyInt_From_long(__pyx_t_4); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 206; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); __pyx_t_2 = __pyx_t_5; __pyx_t_5 = 0; } __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_3 = __pyx_t_2; __Pyx_INCREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_v_a = __pyx_t_3; __pyx_t_3 = 0; /* "pygame_sdl2/color.pyx":208 * a = min(255, self.a * rhs.a) * * return type(self)(r, g, b, a) # <<<<<<<<<<<<<< * * def __add__(self not None, Color rhs not None): */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(((PyObject *)Py_TYPE(__pyx_v_self))); __pyx_t_2 = ((PyObject *)Py_TYPE(__pyx_v_self)); __pyx_t_5 = NULL; __pyx_t_7 = 0; if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_2))) { __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_2); if (likely(__pyx_t_5)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_5); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); __pyx_t_7 = 1; } } __pyx_t_1 = PyTuple_New(4+__pyx_t_7); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 208; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); if (__pyx_t_5) { __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_5); __pyx_t_5 = NULL; } __Pyx_INCREF(__pyx_v_r); __Pyx_GIVEREF(__pyx_v_r); PyTuple_SET_ITEM(__pyx_t_1, 0+__pyx_t_7, __pyx_v_r); __Pyx_INCREF(__pyx_v_g); __Pyx_GIVEREF(__pyx_v_g); PyTuple_SET_ITEM(__pyx_t_1, 1+__pyx_t_7, __pyx_v_g); __Pyx_INCREF(__pyx_v_b); __Pyx_GIVEREF(__pyx_v_b); PyTuple_SET_ITEM(__pyx_t_1, 2+__pyx_t_7, __pyx_v_b); __Pyx_INCREF(__pyx_v_a); __Pyx_GIVEREF(__pyx_v_a); PyTuple_SET_ITEM(__pyx_t_1, 3+__pyx_t_7, __pyx_v_a); __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_1, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 208; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_r = __pyx_t_3; __pyx_t_3 = 0; goto __pyx_L0; /* "pygame_sdl2/color.pyx":199 * return self.length * * def __mul__(self not None, Color rhs not None): # <<<<<<<<<<<<<< * # Multiplying this way doesn't make much sense, * # but it's how pygame does it. */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_5); __Pyx_AddTraceback("pygame_sdl2.color.Color.__mul__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF(__pyx_v_r); __Pyx_XDECREF(__pyx_v_g); __Pyx_XDECREF(__pyx_v_b); __Pyx_XDECREF(__pyx_v_a); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/color.pyx":210 * return type(self)(r, g, b, a) * * def __add__(self not None, Color rhs not None): # <<<<<<<<<<<<<< * r = min(255, self.r + rhs.r) * g = min(255, self.g + rhs.g) */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_5color_5Color_29__add__(PyObject *__pyx_v_self, PyObject *__pyx_v_rhs); /*proto*/ static PyObject *__pyx_pw_11pygame_sdl2_5color_5Color_29__add__(PyObject *__pyx_v_self, PyObject *__pyx_v_rhs) { CYTHON_UNUSED int __pyx_lineno = 0; CYTHON_UNUSED const char *__pyx_filename = NULL; CYTHON_UNUSED int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__add__ (wrapper)", 0); if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) { PyErr_Format(PyExc_TypeError, "Argument '%.200s' must not be None", "self"); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 210; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_rhs), __pyx_ptype_11pygame_sdl2_5color_Color, 0, "rhs", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 210; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_r = __pyx_pf_11pygame_sdl2_5color_5Color_28__add__(((PyObject *)__pyx_v_self), ((struct __pyx_obj_11pygame_sdl2_5color_Color *)__pyx_v_rhs)); /* function exit code */ goto __pyx_L0; __pyx_L1_error:; __pyx_r = NULL; __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_5color_5Color_28__add__(PyObject *__pyx_v_self, struct __pyx_obj_11pygame_sdl2_5color_Color *__pyx_v_rhs) { PyObject *__pyx_v_r = NULL; PyObject *__pyx_v_g = NULL; PyObject *__pyx_v_b = NULL; PyObject *__pyx_v_a = NULL; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; long __pyx_t_4; PyObject *__pyx_t_5 = NULL; int __pyx_t_6; Py_ssize_t __pyx_t_7; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__add__", 0); /* "pygame_sdl2/color.pyx":211 * * def __add__(self not None, Color rhs not None): * r = min(255, self.r + rhs.r) # <<<<<<<<<<<<<< * g = min(255, self.g + rhs.g) * b = min(255, self.b + rhs.b) */ __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_r); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 211; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = __Pyx_PyInt_From_uint8_t(__pyx_v_rhs->r); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 211; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = PyNumber_Add(__pyx_t_1, __pyx_t_2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 211; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_4 = 0xFF; __pyx_t_1 = __Pyx_PyInt_From_long(__pyx_t_4); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 211; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_t_5 = PyObject_RichCompare(__pyx_t_3, __pyx_t_1, Py_LT); __Pyx_XGOTREF(__pyx_t_5); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 211; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 211; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; if (__pyx_t_6) { __Pyx_INCREF(__pyx_t_3); __pyx_t_2 = __pyx_t_3; } else { __pyx_t_5 = __Pyx_PyInt_From_long(__pyx_t_4); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 211; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); __pyx_t_2 = __pyx_t_5; __pyx_t_5 = 0; } __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_3 = __pyx_t_2; __Pyx_INCREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_v_r = __pyx_t_3; __pyx_t_3 = 0; /* "pygame_sdl2/color.pyx":212 * def __add__(self not None, Color rhs not None): * r = min(255, self.r + rhs.r) * g = min(255, self.g + rhs.g) # <<<<<<<<<<<<<< * b = min(255, self.b + rhs.b) * a = min(255, self.a + rhs.a) */ __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_g); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 212; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __pyx_t_2 = __Pyx_PyInt_From_uint8_t(__pyx_v_rhs->g); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 212; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __pyx_t_5 = PyNumber_Add(__pyx_t_3, __pyx_t_2); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 212; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_4 = 0xFF; __pyx_t_3 = __Pyx_PyInt_From_long(__pyx_t_4); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 212; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __pyx_t_1 = PyObject_RichCompare(__pyx_t_5, __pyx_t_3, Py_LT); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 212; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 212; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (__pyx_t_6) { __Pyx_INCREF(__pyx_t_5); __pyx_t_2 = __pyx_t_5; } else { __pyx_t_1 = __Pyx_PyInt_From_long(__pyx_t_4); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 212; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = __pyx_t_1; __pyx_t_1 = 0; } __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __pyx_t_5 = __pyx_t_2; __Pyx_INCREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_v_g = __pyx_t_5; __pyx_t_5 = 0; /* "pygame_sdl2/color.pyx":213 * r = min(255, self.r + rhs.r) * g = min(255, self.g + rhs.g) * b = min(255, self.b + rhs.b) # <<<<<<<<<<<<<< * a = min(255, self.a + rhs.a) * */ __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_b); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 213; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); __pyx_t_2 = __Pyx_PyInt_From_uint8_t(__pyx_v_rhs->b); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 213; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __pyx_t_1 = PyNumber_Add(__pyx_t_5, __pyx_t_2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 213; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_4 = 0xFF; __pyx_t_5 = __Pyx_PyInt_From_long(__pyx_t_4); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 213; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); __pyx_t_3 = PyObject_RichCompare(__pyx_t_1, __pyx_t_5, Py_LT); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 213; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 213; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; if (__pyx_t_6) { __Pyx_INCREF(__pyx_t_1); __pyx_t_2 = __pyx_t_1; } else { __pyx_t_3 = __Pyx_PyInt_From_long(__pyx_t_4); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 213; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __pyx_t_2 = __pyx_t_3; __pyx_t_3 = 0; } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_1 = __pyx_t_2; __Pyx_INCREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_v_b = __pyx_t_1; __pyx_t_1 = 0; /* "pygame_sdl2/color.pyx":214 * g = min(255, self.g + rhs.g) * b = min(255, self.b + rhs.b) * a = min(255, self.a + rhs.a) # <<<<<<<<<<<<<< * * return type(self)(r, g, b, a) */ __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_a); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 214; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = __Pyx_PyInt_From_uint8_t(__pyx_v_rhs->a); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 214; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = PyNumber_Add(__pyx_t_1, __pyx_t_2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 214; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_4 = 0xFF; __pyx_t_1 = __Pyx_PyInt_From_long(__pyx_t_4); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 214; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_t_5 = PyObject_RichCompare(__pyx_t_3, __pyx_t_1, Py_LT); __Pyx_XGOTREF(__pyx_t_5); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 214; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 214; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; if (__pyx_t_6) { __Pyx_INCREF(__pyx_t_3); __pyx_t_2 = __pyx_t_3; } else { __pyx_t_5 = __Pyx_PyInt_From_long(__pyx_t_4); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 214; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); __pyx_t_2 = __pyx_t_5; __pyx_t_5 = 0; } __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_3 = __pyx_t_2; __Pyx_INCREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_v_a = __pyx_t_3; __pyx_t_3 = 0; /* "pygame_sdl2/color.pyx":216 * a = min(255, self.a + rhs.a) * * return type(self)(r, g, b, a) # <<<<<<<<<<<<<< * * def __sub__(self not None, Color rhs not None): */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(((PyObject *)Py_TYPE(__pyx_v_self))); __pyx_t_2 = ((PyObject *)Py_TYPE(__pyx_v_self)); __pyx_t_5 = NULL; __pyx_t_7 = 0; if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_2))) { __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_2); if (likely(__pyx_t_5)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_5); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); __pyx_t_7 = 1; } } __pyx_t_1 = PyTuple_New(4+__pyx_t_7); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 216; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); if (__pyx_t_5) { __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_5); __pyx_t_5 = NULL; } __Pyx_INCREF(__pyx_v_r); __Pyx_GIVEREF(__pyx_v_r); PyTuple_SET_ITEM(__pyx_t_1, 0+__pyx_t_7, __pyx_v_r); __Pyx_INCREF(__pyx_v_g); __Pyx_GIVEREF(__pyx_v_g); PyTuple_SET_ITEM(__pyx_t_1, 1+__pyx_t_7, __pyx_v_g); __Pyx_INCREF(__pyx_v_b); __Pyx_GIVEREF(__pyx_v_b); PyTuple_SET_ITEM(__pyx_t_1, 2+__pyx_t_7, __pyx_v_b); __Pyx_INCREF(__pyx_v_a); __Pyx_GIVEREF(__pyx_v_a); PyTuple_SET_ITEM(__pyx_t_1, 3+__pyx_t_7, __pyx_v_a); __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_1, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 216; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_r = __pyx_t_3; __pyx_t_3 = 0; goto __pyx_L0; /* "pygame_sdl2/color.pyx":210 * return type(self)(r, g, b, a) * * def __add__(self not None, Color rhs not None): # <<<<<<<<<<<<<< * r = min(255, self.r + rhs.r) * g = min(255, self.g + rhs.g) */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_5); __Pyx_AddTraceback("pygame_sdl2.color.Color.__add__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF(__pyx_v_r); __Pyx_XDECREF(__pyx_v_g); __Pyx_XDECREF(__pyx_v_b); __Pyx_XDECREF(__pyx_v_a); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/color.pyx":218 * return type(self)(r, g, b, a) * * def __sub__(self not None, Color rhs not None): # <<<<<<<<<<<<<< * r = max(0, self.r - rhs.r) * g = max(0, self.g - rhs.g) */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_5color_5Color_31__sub__(PyObject *__pyx_v_self, PyObject *__pyx_v_rhs); /*proto*/ static PyObject *__pyx_pw_11pygame_sdl2_5color_5Color_31__sub__(PyObject *__pyx_v_self, PyObject *__pyx_v_rhs) { CYTHON_UNUSED int __pyx_lineno = 0; CYTHON_UNUSED const char *__pyx_filename = NULL; CYTHON_UNUSED int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__sub__ (wrapper)", 0); if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) { PyErr_Format(PyExc_TypeError, "Argument '%.200s' must not be None", "self"); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 218; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_rhs), __pyx_ptype_11pygame_sdl2_5color_Color, 0, "rhs", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 218; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_r = __pyx_pf_11pygame_sdl2_5color_5Color_30__sub__(((PyObject *)__pyx_v_self), ((struct __pyx_obj_11pygame_sdl2_5color_Color *)__pyx_v_rhs)); /* function exit code */ goto __pyx_L0; __pyx_L1_error:; __pyx_r = NULL; __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_5color_5Color_30__sub__(PyObject *__pyx_v_self, struct __pyx_obj_11pygame_sdl2_5color_Color *__pyx_v_rhs) { PyObject *__pyx_v_r = NULL; PyObject *__pyx_v_g = NULL; PyObject *__pyx_v_b = NULL; PyObject *__pyx_v_a = NULL; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; long __pyx_t_4; PyObject *__pyx_t_5 = NULL; int __pyx_t_6; Py_ssize_t __pyx_t_7; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__sub__", 0); /* "pygame_sdl2/color.pyx":219 * * def __sub__(self not None, Color rhs not None): * r = max(0, self.r - rhs.r) # <<<<<<<<<<<<<< * g = max(0, self.g - rhs.g) * b = max(0, self.b - rhs.b) */ __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_r); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 219; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = __Pyx_PyInt_From_uint8_t(__pyx_v_rhs->r); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 219; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = PyNumber_Subtract(__pyx_t_1, __pyx_t_2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 219; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_4 = 0; __pyx_t_1 = __Pyx_PyInt_From_long(__pyx_t_4); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 219; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_t_5 = PyObject_RichCompare(__pyx_t_3, __pyx_t_1, Py_GT); __Pyx_XGOTREF(__pyx_t_5); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 219; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 219; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; if (__pyx_t_6) { __Pyx_INCREF(__pyx_t_3); __pyx_t_2 = __pyx_t_3; } else { __pyx_t_5 = __Pyx_PyInt_From_long(__pyx_t_4); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 219; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); __pyx_t_2 = __pyx_t_5; __pyx_t_5 = 0; } __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_3 = __pyx_t_2; __Pyx_INCREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_v_r = __pyx_t_3; __pyx_t_3 = 0; /* "pygame_sdl2/color.pyx":220 * def __sub__(self not None, Color rhs not None): * r = max(0, self.r - rhs.r) * g = max(0, self.g - rhs.g) # <<<<<<<<<<<<<< * b = max(0, self.b - rhs.b) * a = max(0, self.a - rhs.a) */ __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_g); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 220; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __pyx_t_2 = __Pyx_PyInt_From_uint8_t(__pyx_v_rhs->g); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 220; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __pyx_t_5 = PyNumber_Subtract(__pyx_t_3, __pyx_t_2); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 220; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_4 = 0; __pyx_t_3 = __Pyx_PyInt_From_long(__pyx_t_4); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 220; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __pyx_t_1 = PyObject_RichCompare(__pyx_t_5, __pyx_t_3, Py_GT); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 220; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 220; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (__pyx_t_6) { __Pyx_INCREF(__pyx_t_5); __pyx_t_2 = __pyx_t_5; } else { __pyx_t_1 = __Pyx_PyInt_From_long(__pyx_t_4); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 220; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = __pyx_t_1; __pyx_t_1 = 0; } __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __pyx_t_5 = __pyx_t_2; __Pyx_INCREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_v_g = __pyx_t_5; __pyx_t_5 = 0; /* "pygame_sdl2/color.pyx":221 * r = max(0, self.r - rhs.r) * g = max(0, self.g - rhs.g) * b = max(0, self.b - rhs.b) # <<<<<<<<<<<<<< * a = max(0, self.a - rhs.a) * */ __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_b); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 221; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); __pyx_t_2 = __Pyx_PyInt_From_uint8_t(__pyx_v_rhs->b); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 221; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __pyx_t_1 = PyNumber_Subtract(__pyx_t_5, __pyx_t_2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 221; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_4 = 0; __pyx_t_5 = __Pyx_PyInt_From_long(__pyx_t_4); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 221; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); __pyx_t_3 = PyObject_RichCompare(__pyx_t_1, __pyx_t_5, Py_GT); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 221; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 221; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; if (__pyx_t_6) { __Pyx_INCREF(__pyx_t_1); __pyx_t_2 = __pyx_t_1; } else { __pyx_t_3 = __Pyx_PyInt_From_long(__pyx_t_4); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 221; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __pyx_t_2 = __pyx_t_3; __pyx_t_3 = 0; } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_1 = __pyx_t_2; __Pyx_INCREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_v_b = __pyx_t_1; __pyx_t_1 = 0; /* "pygame_sdl2/color.pyx":222 * g = max(0, self.g - rhs.g) * b = max(0, self.b - rhs.b) * a = max(0, self.a - rhs.a) # <<<<<<<<<<<<<< * * return type(self)(r, g, b, a) */ __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_a); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 222; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = __Pyx_PyInt_From_uint8_t(__pyx_v_rhs->a); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 222; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = PyNumber_Subtract(__pyx_t_1, __pyx_t_2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 222; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_4 = 0; __pyx_t_1 = __Pyx_PyInt_From_long(__pyx_t_4); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 222; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_t_5 = PyObject_RichCompare(__pyx_t_3, __pyx_t_1, Py_GT); __Pyx_XGOTREF(__pyx_t_5); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 222; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 222; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; if (__pyx_t_6) { __Pyx_INCREF(__pyx_t_3); __pyx_t_2 = __pyx_t_3; } else { __pyx_t_5 = __Pyx_PyInt_From_long(__pyx_t_4); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 222; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); __pyx_t_2 = __pyx_t_5; __pyx_t_5 = 0; } __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_3 = __pyx_t_2; __Pyx_INCREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_v_a = __pyx_t_3; __pyx_t_3 = 0; /* "pygame_sdl2/color.pyx":224 * a = max(0, self.a - rhs.a) * * return type(self)(r, g, b, a) # <<<<<<<<<<<<<< * * def __mod__(self not None, Color rhs not None): */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(((PyObject *)Py_TYPE(__pyx_v_self))); __pyx_t_2 = ((PyObject *)Py_TYPE(__pyx_v_self)); __pyx_t_5 = NULL; __pyx_t_7 = 0; if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_2))) { __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_2); if (likely(__pyx_t_5)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_5); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); __pyx_t_7 = 1; } } __pyx_t_1 = PyTuple_New(4+__pyx_t_7); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 224; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); if (__pyx_t_5) { __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_5); __pyx_t_5 = NULL; } __Pyx_INCREF(__pyx_v_r); __Pyx_GIVEREF(__pyx_v_r); PyTuple_SET_ITEM(__pyx_t_1, 0+__pyx_t_7, __pyx_v_r); __Pyx_INCREF(__pyx_v_g); __Pyx_GIVEREF(__pyx_v_g); PyTuple_SET_ITEM(__pyx_t_1, 1+__pyx_t_7, __pyx_v_g); __Pyx_INCREF(__pyx_v_b); __Pyx_GIVEREF(__pyx_v_b); PyTuple_SET_ITEM(__pyx_t_1, 2+__pyx_t_7, __pyx_v_b); __Pyx_INCREF(__pyx_v_a); __Pyx_GIVEREF(__pyx_v_a); PyTuple_SET_ITEM(__pyx_t_1, 3+__pyx_t_7, __pyx_v_a); __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_1, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 224; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_r = __pyx_t_3; __pyx_t_3 = 0; goto __pyx_L0; /* "pygame_sdl2/color.pyx":218 * return type(self)(r, g, b, a) * * def __sub__(self not None, Color rhs not None): # <<<<<<<<<<<<<< * r = max(0, self.r - rhs.r) * g = max(0, self.g - rhs.g) */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_5); __Pyx_AddTraceback("pygame_sdl2.color.Color.__sub__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF(__pyx_v_r); __Pyx_XDECREF(__pyx_v_g); __Pyx_XDECREF(__pyx_v_b); __Pyx_XDECREF(__pyx_v_a); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/color.pyx":226 * return type(self)(r, g, b, a) * * def __mod__(self not None, Color rhs not None): # <<<<<<<<<<<<<< * * def mod(l, r): */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_5color_5Color_33__mod__(PyObject *__pyx_v_self, PyObject *__pyx_v_rhs); /*proto*/ static PyObject *__pyx_pw_11pygame_sdl2_5color_5Color_33__mod__(PyObject *__pyx_v_self, PyObject *__pyx_v_rhs) { CYTHON_UNUSED int __pyx_lineno = 0; CYTHON_UNUSED const char *__pyx_filename = NULL; CYTHON_UNUSED int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__mod__ (wrapper)", 0); if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) { PyErr_Format(PyExc_TypeError, "Argument '%.200s' must not be None", "self"); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 226; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_rhs), __pyx_ptype_11pygame_sdl2_5color_Color, 0, "rhs", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 226; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_r = __pyx_pf_11pygame_sdl2_5color_5Color_32__mod__(((PyObject *)__pyx_v_self), ((struct __pyx_obj_11pygame_sdl2_5color_Color *)__pyx_v_rhs)); /* function exit code */ goto __pyx_L0; __pyx_L1_error:; __pyx_r = NULL; __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/color.pyx":228 * def __mod__(self not None, Color rhs not None): * * def mod(l, r): # <<<<<<<<<<<<<< * if r == 0: * return 0 */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_5color_5Color_7__mod___1mod(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static PyMethodDef __pyx_mdef_11pygame_sdl2_5color_5Color_7__mod___1mod = {"mod", (PyCFunction)__pyx_pw_11pygame_sdl2_5color_5Color_7__mod___1mod, METH_VARARGS|METH_KEYWORDS, 0}; static PyObject *__pyx_pw_11pygame_sdl2_5color_5Color_7__mod___1mod(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_l = 0; PyObject *__pyx_v_r = 0; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("mod (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_l,&__pyx_n_s_r,0}; PyObject* values[2] = {0,0}; if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_l)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; case 1: if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_r)) != 0)) kw_args--; else { __Pyx_RaiseArgtupleInvalid("mod", 1, 2, 2, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 228; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "mod") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 228; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } } else if (PyTuple_GET_SIZE(__pyx_args) != 2) { goto __pyx_L5_argtuple_error; } else { values[0] = PyTuple_GET_ITEM(__pyx_args, 0); values[1] = PyTuple_GET_ITEM(__pyx_args, 1); } __pyx_v_l = values[0]; __pyx_v_r = values[1]; } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("mod", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 228; __pyx_clineno = __LINE__; goto __pyx_L3_error;} __pyx_L3_error:; __Pyx_AddTraceback("pygame_sdl2.color.Color.__mod__.mod", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_11pygame_sdl2_5color_5Color_7__mod___mod(__pyx_self, __pyx_v_l, __pyx_v_r); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_5color_5Color_7__mod___mod(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_l, PyObject *__pyx_v_r) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_t_2; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("mod", 0); /* "pygame_sdl2/color.pyx":229 * * def mod(l, r): * if r == 0: # <<<<<<<<<<<<<< * return 0 * */ __pyx_t_1 = __Pyx_PyInt_EqObjC(__pyx_v_r, __pyx_int_0, 0, 0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 229; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 229; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (__pyx_t_2) { /* "pygame_sdl2/color.pyx":230 * def mod(l, r): * if r == 0: * return 0 # <<<<<<<<<<<<<< * * return l % r */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(__pyx_int_0); __pyx_r = __pyx_int_0; goto __pyx_L0; /* "pygame_sdl2/color.pyx":229 * * def mod(l, r): * if r == 0: # <<<<<<<<<<<<<< * return 0 * */ } /* "pygame_sdl2/color.pyx":232 * return 0 * * return l % r # <<<<<<<<<<<<<< * * r = mod(self.r, rhs.r) */ __Pyx_XDECREF(__pyx_r); __pyx_t_1 = PyNumber_Remainder(__pyx_v_l, __pyx_v_r); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 232; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "pygame_sdl2/color.pyx":228 * def __mod__(self not None, Color rhs not None): * * def mod(l, r): # <<<<<<<<<<<<<< * if r == 0: * return 0 */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("pygame_sdl2.color.Color.__mod__.mod", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/color.pyx":226 * return type(self)(r, g, b, a) * * def __mod__(self not None, Color rhs not None): # <<<<<<<<<<<<<< * * def mod(l, r): */ static PyObject *__pyx_pf_11pygame_sdl2_5color_5Color_32__mod__(PyObject *__pyx_v_self, struct __pyx_obj_11pygame_sdl2_5color_Color *__pyx_v_rhs) { PyObject *__pyx_v_mod = 0; PyObject *__pyx_v_r = NULL; PyObject *__pyx_v_g = NULL; PyObject *__pyx_v_b = NULL; PyObject *__pyx_v_a = NULL; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; Py_ssize_t __pyx_t_4; PyObject *__pyx_t_5 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__mod__", 0); /* "pygame_sdl2/color.pyx":228 * def __mod__(self not None, Color rhs not None): * * def mod(l, r): # <<<<<<<<<<<<<< * if r == 0: * return 0 */ __pyx_t_1 = __Pyx_CyFunction_NewEx(&__pyx_mdef_11pygame_sdl2_5color_5Color_7__mod___1mod, 0, __pyx_n_s_mod___locals_mod, NULL, __pyx_n_s_pygame_sdl2_color, __pyx_d, ((PyObject *)__pyx_codeobj__9)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 228; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_v_mod = __pyx_t_1; __pyx_t_1 = 0; /* "pygame_sdl2/color.pyx":234 * return l % r * * r = mod(self.r, rhs.r) # <<<<<<<<<<<<<< * g = mod(self.g, rhs.g) * b = mod(self.b, rhs.b) */ __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_r); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 234; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = __Pyx_PyInt_From_uint8_t(__pyx_v_rhs->r); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 234; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = __pyx_pf_11pygame_sdl2_5color_5Color_7__mod___mod(__pyx_v_mod, __pyx_t_1, __pyx_t_2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 234; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_v_r = __pyx_t_3; __pyx_t_3 = 0; /* "pygame_sdl2/color.pyx":235 * * r = mod(self.r, rhs.r) * g = mod(self.g, rhs.g) # <<<<<<<<<<<<<< * b = mod(self.b, rhs.b) * a = mod(self.a, rhs.a) */ __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_g); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 235; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __pyx_t_2 = __Pyx_PyInt_From_uint8_t(__pyx_v_rhs->g); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 235; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __pyx_t_1 = __pyx_pf_11pygame_sdl2_5color_5Color_7__mod___mod(__pyx_v_mod, __pyx_t_3, __pyx_t_2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 235; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_v_g = __pyx_t_1; __pyx_t_1 = 0; /* "pygame_sdl2/color.pyx":236 * r = mod(self.r, rhs.r) * g = mod(self.g, rhs.g) * b = mod(self.b, rhs.b) # <<<<<<<<<<<<<< * a = mod(self.a, rhs.a) * */ __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_b); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 236; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = __Pyx_PyInt_From_uint8_t(__pyx_v_rhs->b); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 236; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = __pyx_pf_11pygame_sdl2_5color_5Color_7__mod___mod(__pyx_v_mod, __pyx_t_1, __pyx_t_2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 236; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_v_b = __pyx_t_3; __pyx_t_3 = 0; /* "pygame_sdl2/color.pyx":237 * g = mod(self.g, rhs.g) * b = mod(self.b, rhs.b) * a = mod(self.a, rhs.a) # <<<<<<<<<<<<<< * * return type(self)(r, g, b, a) */ __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_a); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 237; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __pyx_t_2 = __Pyx_PyInt_From_uint8_t(__pyx_v_rhs->a); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 237; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __pyx_t_1 = __pyx_pf_11pygame_sdl2_5color_5Color_7__mod___mod(__pyx_v_mod, __pyx_t_3, __pyx_t_2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 237; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_v_a = __pyx_t_1; __pyx_t_1 = 0; /* "pygame_sdl2/color.pyx":239 * a = mod(self.a, rhs.a) * * return type(self)(r, g, b, a) # <<<<<<<<<<<<<< * * def __div__(self not None, Color rhs not None): */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(((PyObject *)Py_TYPE(__pyx_v_self))); __pyx_t_2 = ((PyObject *)Py_TYPE(__pyx_v_self)); __pyx_t_3 = NULL; __pyx_t_4 = 0; if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_2))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); if (likely(__pyx_t_3)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); __pyx_t_4 = 1; } } __pyx_t_5 = PyTuple_New(4+__pyx_t_4); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 239; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); if (__pyx_t_3) { __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_3); __pyx_t_3 = NULL; } __Pyx_INCREF(__pyx_v_r); __Pyx_GIVEREF(__pyx_v_r); PyTuple_SET_ITEM(__pyx_t_5, 0+__pyx_t_4, __pyx_v_r); __Pyx_INCREF(__pyx_v_g); __Pyx_GIVEREF(__pyx_v_g); PyTuple_SET_ITEM(__pyx_t_5, 1+__pyx_t_4, __pyx_v_g); __Pyx_INCREF(__pyx_v_b); __Pyx_GIVEREF(__pyx_v_b); PyTuple_SET_ITEM(__pyx_t_5, 2+__pyx_t_4, __pyx_v_b); __Pyx_INCREF(__pyx_v_a); __Pyx_GIVEREF(__pyx_v_a); PyTuple_SET_ITEM(__pyx_t_5, 3+__pyx_t_4, __pyx_v_a); __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_5, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 239; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "pygame_sdl2/color.pyx":226 * return type(self)(r, g, b, a) * * def __mod__(self not None, Color rhs not None): # <<<<<<<<<<<<<< * * def mod(l, r): */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_5); __Pyx_AddTraceback("pygame_sdl2.color.Color.__mod__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF(__pyx_v_mod); __Pyx_XDECREF(__pyx_v_r); __Pyx_XDECREF(__pyx_v_g); __Pyx_XDECREF(__pyx_v_b); __Pyx_XDECREF(__pyx_v_a); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/color.pyx":241 * return type(self)(r, g, b, a) * * def __div__(self not None, Color rhs not None): # <<<<<<<<<<<<<< * r = min(255, self.r / rhs.r) * g = min(255, self.g / rhs.g) */ /* Python wrapper */ #if PY_MAJOR_VERSION < 3 || CYTHON_COMPILING_IN_PYPY static PyObject *__pyx_pw_11pygame_sdl2_5color_5Color_35__div__(PyObject *__pyx_v_self, PyObject *__pyx_v_rhs); /*proto*/ static PyObject *__pyx_pw_11pygame_sdl2_5color_5Color_35__div__(PyObject *__pyx_v_self, PyObject *__pyx_v_rhs) { CYTHON_UNUSED int __pyx_lineno = 0; CYTHON_UNUSED const char *__pyx_filename = NULL; CYTHON_UNUSED int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__div__ (wrapper)", 0); if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) { PyErr_Format(PyExc_TypeError, "Argument '%.200s' must not be None", "self"); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 241; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_rhs), __pyx_ptype_11pygame_sdl2_5color_Color, 0, "rhs", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 241; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_r = __pyx_pf_11pygame_sdl2_5color_5Color_34__div__(((PyObject *)__pyx_v_self), ((struct __pyx_obj_11pygame_sdl2_5color_Color *)__pyx_v_rhs)); /* function exit code */ goto __pyx_L0; __pyx_L1_error:; __pyx_r = NULL; __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; } #endif /*!(#if PY_MAJOR_VERSION < 3 || CYTHON_COMPILING_IN_PYPY)*/ #if PY_MAJOR_VERSION < 3 || CYTHON_COMPILING_IN_PYPY static PyObject *__pyx_pf_11pygame_sdl2_5color_5Color_34__div__(PyObject *__pyx_v_self, struct __pyx_obj_11pygame_sdl2_5color_Color *__pyx_v_rhs) { PyObject *__pyx_v_r = NULL; PyObject *__pyx_v_g = NULL; PyObject *__pyx_v_b = NULL; PyObject *__pyx_v_a = NULL; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; long __pyx_t_4; PyObject *__pyx_t_5 = NULL; int __pyx_t_6; Py_ssize_t __pyx_t_7; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__div__", 0); /* "pygame_sdl2/color.pyx":242 * * def __div__(self not None, Color rhs not None): * r = min(255, self.r / rhs.r) # <<<<<<<<<<<<<< * g = min(255, self.g / rhs.g) * b = min(255, self.b / rhs.b) */ __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_r); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 242; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = __Pyx_PyInt_From_uint8_t(__pyx_v_rhs->r); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 242; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = __Pyx_PyNumber_Divide(__pyx_t_1, __pyx_t_2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 242; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_4 = 0xFF; __pyx_t_1 = __Pyx_PyInt_From_long(__pyx_t_4); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 242; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_t_5 = PyObject_RichCompare(__pyx_t_3, __pyx_t_1, Py_LT); __Pyx_XGOTREF(__pyx_t_5); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 242; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 242; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; if (__pyx_t_6) { __Pyx_INCREF(__pyx_t_3); __pyx_t_2 = __pyx_t_3; } else { __pyx_t_5 = __Pyx_PyInt_From_long(__pyx_t_4); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 242; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); __pyx_t_2 = __pyx_t_5; __pyx_t_5 = 0; } __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_3 = __pyx_t_2; __Pyx_INCREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_v_r = __pyx_t_3; __pyx_t_3 = 0; /* "pygame_sdl2/color.pyx":243 * def __div__(self not None, Color rhs not None): * r = min(255, self.r / rhs.r) * g = min(255, self.g / rhs.g) # <<<<<<<<<<<<<< * b = min(255, self.b / rhs.b) * a = min(255, self.a / rhs.a) */ __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_g); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 243; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __pyx_t_2 = __Pyx_PyInt_From_uint8_t(__pyx_v_rhs->g); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 243; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __pyx_t_5 = __Pyx_PyNumber_Divide(__pyx_t_3, __pyx_t_2); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 243; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_4 = 0xFF; __pyx_t_3 = __Pyx_PyInt_From_long(__pyx_t_4); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 243; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __pyx_t_1 = PyObject_RichCompare(__pyx_t_5, __pyx_t_3, Py_LT); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 243; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 243; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (__pyx_t_6) { __Pyx_INCREF(__pyx_t_5); __pyx_t_2 = __pyx_t_5; } else { __pyx_t_1 = __Pyx_PyInt_From_long(__pyx_t_4); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 243; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = __pyx_t_1; __pyx_t_1 = 0; } __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __pyx_t_5 = __pyx_t_2; __Pyx_INCREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_v_g = __pyx_t_5; __pyx_t_5 = 0; /* "pygame_sdl2/color.pyx":244 * r = min(255, self.r / rhs.r) * g = min(255, self.g / rhs.g) * b = min(255, self.b / rhs.b) # <<<<<<<<<<<<<< * a = min(255, self.a / rhs.a) * */ __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_b); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 244; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); __pyx_t_2 = __Pyx_PyInt_From_uint8_t(__pyx_v_rhs->b); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 244; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __pyx_t_1 = __Pyx_PyNumber_Divide(__pyx_t_5, __pyx_t_2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 244; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_4 = 0xFF; __pyx_t_5 = __Pyx_PyInt_From_long(__pyx_t_4); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 244; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); __pyx_t_3 = PyObject_RichCompare(__pyx_t_1, __pyx_t_5, Py_LT); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 244; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 244; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; if (__pyx_t_6) { __Pyx_INCREF(__pyx_t_1); __pyx_t_2 = __pyx_t_1; } else { __pyx_t_3 = __Pyx_PyInt_From_long(__pyx_t_4); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 244; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __pyx_t_2 = __pyx_t_3; __pyx_t_3 = 0; } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_1 = __pyx_t_2; __Pyx_INCREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_v_b = __pyx_t_1; __pyx_t_1 = 0; /* "pygame_sdl2/color.pyx":245 * g = min(255, self.g / rhs.g) * b = min(255, self.b / rhs.b) * a = min(255, self.a / rhs.a) # <<<<<<<<<<<<<< * * return type(self)(r, g, b, a) */ __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_a); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 245; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = __Pyx_PyInt_From_uint8_t(__pyx_v_rhs->a); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 245; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = __Pyx_PyNumber_Divide(__pyx_t_1, __pyx_t_2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 245; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_4 = 0xFF; __pyx_t_1 = __Pyx_PyInt_From_long(__pyx_t_4); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 245; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_t_5 = PyObject_RichCompare(__pyx_t_3, __pyx_t_1, Py_LT); __Pyx_XGOTREF(__pyx_t_5); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 245; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 245; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; if (__pyx_t_6) { __Pyx_INCREF(__pyx_t_3); __pyx_t_2 = __pyx_t_3; } else { __pyx_t_5 = __Pyx_PyInt_From_long(__pyx_t_4); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 245; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); __pyx_t_2 = __pyx_t_5; __pyx_t_5 = 0; } __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_3 = __pyx_t_2; __Pyx_INCREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_v_a = __pyx_t_3; __pyx_t_3 = 0; /* "pygame_sdl2/color.pyx":247 * a = min(255, self.a / rhs.a) * * return type(self)(r, g, b, a) # <<<<<<<<<<<<<< * * def __floordiv__(self not None, Color rhs not None): */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(((PyObject *)Py_TYPE(__pyx_v_self))); __pyx_t_2 = ((PyObject *)Py_TYPE(__pyx_v_self)); __pyx_t_5 = NULL; __pyx_t_7 = 0; if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_2))) { __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_2); if (likely(__pyx_t_5)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_5); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); __pyx_t_7 = 1; } } __pyx_t_1 = PyTuple_New(4+__pyx_t_7); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 247; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); if (__pyx_t_5) { __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_5); __pyx_t_5 = NULL; } __Pyx_INCREF(__pyx_v_r); __Pyx_GIVEREF(__pyx_v_r); PyTuple_SET_ITEM(__pyx_t_1, 0+__pyx_t_7, __pyx_v_r); __Pyx_INCREF(__pyx_v_g); __Pyx_GIVEREF(__pyx_v_g); PyTuple_SET_ITEM(__pyx_t_1, 1+__pyx_t_7, __pyx_v_g); __Pyx_INCREF(__pyx_v_b); __Pyx_GIVEREF(__pyx_v_b); PyTuple_SET_ITEM(__pyx_t_1, 2+__pyx_t_7, __pyx_v_b); __Pyx_INCREF(__pyx_v_a); __Pyx_GIVEREF(__pyx_v_a); PyTuple_SET_ITEM(__pyx_t_1, 3+__pyx_t_7, __pyx_v_a); __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_1, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 247; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_r = __pyx_t_3; __pyx_t_3 = 0; goto __pyx_L0; /* "pygame_sdl2/color.pyx":241 * return type(self)(r, g, b, a) * * def __div__(self not None, Color rhs not None): # <<<<<<<<<<<<<< * r = min(255, self.r / rhs.r) * g = min(255, self.g / rhs.g) */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_5); __Pyx_AddTraceback("pygame_sdl2.color.Color.__div__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF(__pyx_v_r); __Pyx_XDECREF(__pyx_v_g); __Pyx_XDECREF(__pyx_v_b); __Pyx_XDECREF(__pyx_v_a); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } #endif /*!(#if PY_MAJOR_VERSION < 3 || CYTHON_COMPILING_IN_PYPY)*/ /* "pygame_sdl2/color.pyx":249 * return type(self)(r, g, b, a) * * def __floordiv__(self not None, Color rhs not None): # <<<<<<<<<<<<<< * * def div(a, b): */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_5color_5Color_37__floordiv__(PyObject *__pyx_v_self, PyObject *__pyx_v_rhs); /*proto*/ static PyObject *__pyx_pw_11pygame_sdl2_5color_5Color_37__floordiv__(PyObject *__pyx_v_self, PyObject *__pyx_v_rhs) { CYTHON_UNUSED int __pyx_lineno = 0; CYTHON_UNUSED const char *__pyx_filename = NULL; CYTHON_UNUSED int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__floordiv__ (wrapper)", 0); if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) { PyErr_Format(PyExc_TypeError, "Argument '%.200s' must not be None", "self"); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 249; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_rhs), __pyx_ptype_11pygame_sdl2_5color_Color, 0, "rhs", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 249; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_r = __pyx_pf_11pygame_sdl2_5color_5Color_36__floordiv__(((PyObject *)__pyx_v_self), ((struct __pyx_obj_11pygame_sdl2_5color_Color *)__pyx_v_rhs)); /* function exit code */ goto __pyx_L0; __pyx_L1_error:; __pyx_r = NULL; __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/color.pyx":251 * def __floordiv__(self not None, Color rhs not None): * * def div(a, b): # <<<<<<<<<<<<<< * if b == 0: * return b */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_5color_5Color_12__floordiv___1div(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static PyMethodDef __pyx_mdef_11pygame_sdl2_5color_5Color_12__floordiv___1div = {"div", (PyCFunction)__pyx_pw_11pygame_sdl2_5color_5Color_12__floordiv___1div, METH_VARARGS|METH_KEYWORDS, 0}; static PyObject *__pyx_pw_11pygame_sdl2_5color_5Color_12__floordiv___1div(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_a = 0; PyObject *__pyx_v_b = 0; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("div (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_a,&__pyx_n_s_b,0}; PyObject* values[2] = {0,0}; if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_a)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; case 1: if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_b)) != 0)) kw_args--; else { __Pyx_RaiseArgtupleInvalid("div", 1, 2, 2, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 251; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "div") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 251; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } } else if (PyTuple_GET_SIZE(__pyx_args) != 2) { goto __pyx_L5_argtuple_error; } else { values[0] = PyTuple_GET_ITEM(__pyx_args, 0); values[1] = PyTuple_GET_ITEM(__pyx_args, 1); } __pyx_v_a = values[0]; __pyx_v_b = values[1]; } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("div", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 251; __pyx_clineno = __LINE__; goto __pyx_L3_error;} __pyx_L3_error:; __Pyx_AddTraceback("pygame_sdl2.color.Color.__floordiv__.div", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_11pygame_sdl2_5color_5Color_12__floordiv___div(__pyx_self, __pyx_v_a, __pyx_v_b); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_5color_5Color_12__floordiv___div(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_a, PyObject *__pyx_v_b) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_t_2; long __pyx_t_3; PyObject *__pyx_t_4 = NULL; PyObject *__pyx_t_5 = NULL; PyObject *__pyx_t_6 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("div", 0); /* "pygame_sdl2/color.pyx":252 * * def div(a, b): * if b == 0: # <<<<<<<<<<<<<< * return b * */ __pyx_t_1 = __Pyx_PyInt_EqObjC(__pyx_v_b, __pyx_int_0, 0, 0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 252; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 252; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (__pyx_t_2) { /* "pygame_sdl2/color.pyx":253 * def div(a, b): * if b == 0: * return b # <<<<<<<<<<<<<< * * return min(255, a // b) */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(__pyx_v_b); __pyx_r = __pyx_v_b; goto __pyx_L0; /* "pygame_sdl2/color.pyx":252 * * def div(a, b): * if b == 0: # <<<<<<<<<<<<<< * return b * */ } /* "pygame_sdl2/color.pyx":255 * return b * * return min(255, a // b) # <<<<<<<<<<<<<< * * r = div(self.r, rhs.r) */ __Pyx_XDECREF(__pyx_r); __pyx_t_1 = PyNumber_FloorDivide(__pyx_v_a, __pyx_v_b); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 255; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_t_3 = 0xFF; __pyx_t_5 = __Pyx_PyInt_From_long(__pyx_t_3); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 255; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); __pyx_t_6 = PyObject_RichCompare(__pyx_t_1, __pyx_t_5, Py_LT); __Pyx_XGOTREF(__pyx_t_6); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 255; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_6); if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 255; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; if (__pyx_t_2) { __Pyx_INCREF(__pyx_t_1); __pyx_t_4 = __pyx_t_1; } else { __pyx_t_6 = __Pyx_PyInt_From_long(__pyx_t_3); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 255; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_6); __pyx_t_4 = __pyx_t_6; __pyx_t_6 = 0; } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_INCREF(__pyx_t_4); __pyx_r = __pyx_t_4; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; goto __pyx_L0; /* "pygame_sdl2/color.pyx":251 * def __floordiv__(self not None, Color rhs not None): * * def div(a, b): # <<<<<<<<<<<<<< * if b == 0: * return b */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_5); __Pyx_XDECREF(__pyx_t_6); __Pyx_AddTraceback("pygame_sdl2.color.Color.__floordiv__.div", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/color.pyx":249 * return type(self)(r, g, b, a) * * def __floordiv__(self not None, Color rhs not None): # <<<<<<<<<<<<<< * * def div(a, b): */ static PyObject *__pyx_pf_11pygame_sdl2_5color_5Color_36__floordiv__(PyObject *__pyx_v_self, struct __pyx_obj_11pygame_sdl2_5color_Color *__pyx_v_rhs) { PyObject *__pyx_v_div = 0; PyObject *__pyx_v_r = NULL; PyObject *__pyx_v_g = NULL; PyObject *__pyx_v_b = NULL; PyObject *__pyx_v_a = NULL; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; Py_ssize_t __pyx_t_4; PyObject *__pyx_t_5 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__floordiv__", 0); /* "pygame_sdl2/color.pyx":251 * def __floordiv__(self not None, Color rhs not None): * * def div(a, b): # <<<<<<<<<<<<<< * if b == 0: * return b */ __pyx_t_1 = __Pyx_CyFunction_NewEx(&__pyx_mdef_11pygame_sdl2_5color_5Color_12__floordiv___1div, 0, __pyx_n_s_floordiv___locals_div, NULL, __pyx_n_s_pygame_sdl2_color, __pyx_d, ((PyObject *)__pyx_codeobj__11)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 251; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_v_div = __pyx_t_1; __pyx_t_1 = 0; /* "pygame_sdl2/color.pyx":257 * return min(255, a // b) * * r = div(self.r, rhs.r) # <<<<<<<<<<<<<< * g = div(self.g, rhs.g) * b = div(self.b, rhs.b) */ __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_r); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 257; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = __Pyx_PyInt_From_uint8_t(__pyx_v_rhs->r); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 257; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = __pyx_pf_11pygame_sdl2_5color_5Color_12__floordiv___div(__pyx_v_div, __pyx_t_1, __pyx_t_2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 257; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_v_r = __pyx_t_3; __pyx_t_3 = 0; /* "pygame_sdl2/color.pyx":258 * * r = div(self.r, rhs.r) * g = div(self.g, rhs.g) # <<<<<<<<<<<<<< * b = div(self.b, rhs.b) * a = div(self.a, rhs.a) */ __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_g); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 258; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __pyx_t_2 = __Pyx_PyInt_From_uint8_t(__pyx_v_rhs->g); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 258; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __pyx_t_1 = __pyx_pf_11pygame_sdl2_5color_5Color_12__floordiv___div(__pyx_v_div, __pyx_t_3, __pyx_t_2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 258; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_v_g = __pyx_t_1; __pyx_t_1 = 0; /* "pygame_sdl2/color.pyx":259 * r = div(self.r, rhs.r) * g = div(self.g, rhs.g) * b = div(self.b, rhs.b) # <<<<<<<<<<<<<< * a = div(self.a, rhs.a) * */ __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_b); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 259; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = __Pyx_PyInt_From_uint8_t(__pyx_v_rhs->b); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 259; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = __pyx_pf_11pygame_sdl2_5color_5Color_12__floordiv___div(__pyx_v_div, __pyx_t_1, __pyx_t_2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 259; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_v_b = __pyx_t_3; __pyx_t_3 = 0; /* "pygame_sdl2/color.pyx":260 * g = div(self.g, rhs.g) * b = div(self.b, rhs.b) * a = div(self.a, rhs.a) # <<<<<<<<<<<<<< * * return type(self)(r, g, b, a) */ __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_a); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 260; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __pyx_t_2 = __Pyx_PyInt_From_uint8_t(__pyx_v_rhs->a); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 260; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __pyx_t_1 = __pyx_pf_11pygame_sdl2_5color_5Color_12__floordiv___div(__pyx_v_div, __pyx_t_3, __pyx_t_2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 260; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_v_a = __pyx_t_1; __pyx_t_1 = 0; /* "pygame_sdl2/color.pyx":262 * a = div(self.a, rhs.a) * * return type(self)(r, g, b, a) # <<<<<<<<<<<<<< * * property cmy: */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(((PyObject *)Py_TYPE(__pyx_v_self))); __pyx_t_2 = ((PyObject *)Py_TYPE(__pyx_v_self)); __pyx_t_3 = NULL; __pyx_t_4 = 0; if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_2))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); if (likely(__pyx_t_3)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); __pyx_t_4 = 1; } } __pyx_t_5 = PyTuple_New(4+__pyx_t_4); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 262; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); if (__pyx_t_3) { __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_3); __pyx_t_3 = NULL; } __Pyx_INCREF(__pyx_v_r); __Pyx_GIVEREF(__pyx_v_r); PyTuple_SET_ITEM(__pyx_t_5, 0+__pyx_t_4, __pyx_v_r); __Pyx_INCREF(__pyx_v_g); __Pyx_GIVEREF(__pyx_v_g); PyTuple_SET_ITEM(__pyx_t_5, 1+__pyx_t_4, __pyx_v_g); __Pyx_INCREF(__pyx_v_b); __Pyx_GIVEREF(__pyx_v_b); PyTuple_SET_ITEM(__pyx_t_5, 2+__pyx_t_4, __pyx_v_b); __Pyx_INCREF(__pyx_v_a); __Pyx_GIVEREF(__pyx_v_a); PyTuple_SET_ITEM(__pyx_t_5, 3+__pyx_t_4, __pyx_v_a); __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_5, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 262; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "pygame_sdl2/color.pyx":249 * return type(self)(r, g, b, a) * * def __floordiv__(self not None, Color rhs not None): # <<<<<<<<<<<<<< * * def div(a, b): */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_5); __Pyx_AddTraceback("pygame_sdl2.color.Color.__floordiv__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF(__pyx_v_div); __Pyx_XDECREF(__pyx_v_r); __Pyx_XDECREF(__pyx_v_g); __Pyx_XDECREF(__pyx_v_b); __Pyx_XDECREF(__pyx_v_a); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/color.pyx":265 * * property cmy: * def __get__(self): # <<<<<<<<<<<<<< * return 1 - (self.r / 255.0), 1 - (self.g / 255.0), 1 - (self.b / 255.0) * */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_5color_5Color_3cmy_1__get__(PyObject *__pyx_v_self); /*proto*/ static PyObject *__pyx_pw_11pygame_sdl2_5color_5Color_3cmy_1__get__(PyObject *__pyx_v_self) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); __pyx_r = __pyx_pf_11pygame_sdl2_5color_5Color_3cmy___get__(((struct __pyx_obj_11pygame_sdl2_5color_Color *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_5color_5Color_3cmy___get__(struct __pyx_obj_11pygame_sdl2_5color_Color *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__get__", 0); /* "pygame_sdl2/color.pyx":266 * property cmy: * def __get__(self): * return 1 - (self.r / 255.0), 1 - (self.g / 255.0), 1 - (self.b / 255.0) # <<<<<<<<<<<<<< * * def __set__(self, val): */ __Pyx_XDECREF(__pyx_r); __pyx_t_1 = PyFloat_FromDouble((1.0 - (__pyx_v_self->r / 255.0))); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 266; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = PyFloat_FromDouble((1.0 - (__pyx_v_self->g / 255.0))); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 266; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = PyFloat_FromDouble((1.0 - (__pyx_v_self->b / 255.0))); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 266; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = PyTuple_New(3); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 266; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); __Pyx_GIVEREF(__pyx_t_1); PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_1); __Pyx_GIVEREF(__pyx_t_2); PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_2); __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_4, 2, __pyx_t_3); __pyx_t_1 = 0; __pyx_t_2 = 0; __pyx_t_3 = 0; __pyx_r = __pyx_t_4; __pyx_t_4 = 0; goto __pyx_L0; /* "pygame_sdl2/color.pyx":265 * * property cmy: * def __get__(self): # <<<<<<<<<<<<<< * return 1 - (self.r / 255.0), 1 - (self.g / 255.0), 1 - (self.b / 255.0) * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_AddTraceback("pygame_sdl2.color.Color.cmy.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/color.pyx":268 * return 1 - (self.r / 255.0), 1 - (self.g / 255.0), 1 - (self.b / 255.0) * * def __set__(self, val): # <<<<<<<<<<<<<< * c, m, y = val * self.r = (1 - c) * 255 */ /* Python wrapper */ static int __pyx_pw_11pygame_sdl2_5color_5Color_3cmy_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_val); /*proto*/ static int __pyx_pw_11pygame_sdl2_5color_5Color_3cmy_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_val) { int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__set__ (wrapper)", 0); __pyx_r = __pyx_pf_11pygame_sdl2_5color_5Color_3cmy_2__set__(((struct __pyx_obj_11pygame_sdl2_5color_Color *)__pyx_v_self), ((PyObject *)__pyx_v_val)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static int __pyx_pf_11pygame_sdl2_5color_5Color_3cmy_2__set__(struct __pyx_obj_11pygame_sdl2_5color_Color *__pyx_v_self, PyObject *__pyx_v_val) { PyObject *__pyx_v_c = NULL; PyObject *__pyx_v_m = NULL; PyObject *__pyx_v_y = NULL; int __pyx_r; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; PyObject *(*__pyx_t_5)(PyObject *); Uint8 __pyx_t_6; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__set__", 0); /* "pygame_sdl2/color.pyx":269 * * def __set__(self, val): * c, m, y = val # <<<<<<<<<<<<<< * self.r = (1 - c) * 255 * self.g = (1 - m) * 255 */ if ((likely(PyTuple_CheckExact(__pyx_v_val))) || (PyList_CheckExact(__pyx_v_val))) { PyObject* sequence = __pyx_v_val; #if CYTHON_COMPILING_IN_CPYTHON Py_ssize_t size = Py_SIZE(sequence); #else Py_ssize_t size = PySequence_Size(sequence); #endif if (unlikely(size != 3)) { if (size > 3) __Pyx_RaiseTooManyValuesError(3); else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 269; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } #if CYTHON_COMPILING_IN_CPYTHON if (likely(PyTuple_CheckExact(sequence))) { __pyx_t_1 = PyTuple_GET_ITEM(sequence, 0); __pyx_t_2 = PyTuple_GET_ITEM(sequence, 1); __pyx_t_3 = PyTuple_GET_ITEM(sequence, 2); } else { __pyx_t_1 = PyList_GET_ITEM(sequence, 0); __pyx_t_2 = PyList_GET_ITEM(sequence, 1); __pyx_t_3 = PyList_GET_ITEM(sequence, 2); } __Pyx_INCREF(__pyx_t_1); __Pyx_INCREF(__pyx_t_2); __Pyx_INCREF(__pyx_t_3); #else __pyx_t_1 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 269; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 269; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = PySequence_ITEM(sequence, 2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 269; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); #endif } else { Py_ssize_t index = -1; __pyx_t_4 = PyObject_GetIter(__pyx_v_val); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 269; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); __pyx_t_5 = Py_TYPE(__pyx_t_4)->tp_iternext; index = 0; __pyx_t_1 = __pyx_t_5(__pyx_t_4); if (unlikely(!__pyx_t_1)) goto __pyx_L3_unpacking_failed; __Pyx_GOTREF(__pyx_t_1); index = 1; __pyx_t_2 = __pyx_t_5(__pyx_t_4); if (unlikely(!__pyx_t_2)) goto __pyx_L3_unpacking_failed; __Pyx_GOTREF(__pyx_t_2); index = 2; __pyx_t_3 = __pyx_t_5(__pyx_t_4); if (unlikely(!__pyx_t_3)) goto __pyx_L3_unpacking_failed; __Pyx_GOTREF(__pyx_t_3); if (__Pyx_IternextUnpackEndCheck(__pyx_t_5(__pyx_t_4), 3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 269; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_t_5 = NULL; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; goto __pyx_L4_unpacking_done; __pyx_L3_unpacking_failed:; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_t_5 = NULL; if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 269; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_L4_unpacking_done:; } __pyx_v_c = __pyx_t_1; __pyx_t_1 = 0; __pyx_v_m = __pyx_t_2; __pyx_t_2 = 0; __pyx_v_y = __pyx_t_3; __pyx_t_3 = 0; /* "pygame_sdl2/color.pyx":270 * def __set__(self, val): * c, m, y = val * self.r = (1 - c) * 255 # <<<<<<<<<<<<<< * self.g = (1 - m) * 255 * self.b = (1 - y) * 255 */ __pyx_t_3 = __Pyx_PyInt_SubtractCObj(__pyx_int_1, __pyx_v_c, 1, 0); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 270; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __pyx_t_2 = PyNumber_Multiply(__pyx_t_3, __pyx_int_255); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 270; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_6 = __Pyx_PyInt_As_uint8_t(__pyx_t_2); if (unlikely((__pyx_t_6 == (Uint8)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 270; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_v_self->r = __pyx_t_6; /* "pygame_sdl2/color.pyx":271 * c, m, y = val * self.r = (1 - c) * 255 * self.g = (1 - m) * 255 # <<<<<<<<<<<<<< * self.b = (1 - y) * 255 * */ __pyx_t_2 = __Pyx_PyInt_SubtractCObj(__pyx_int_1, __pyx_v_m, 1, 0); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 271; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = PyNumber_Multiply(__pyx_t_2, __pyx_int_255); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 271; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_6 = __Pyx_PyInt_As_uint8_t(__pyx_t_3); if (unlikely((__pyx_t_6 == (Uint8)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 271; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_v_self->g = __pyx_t_6; /* "pygame_sdl2/color.pyx":272 * self.r = (1 - c) * 255 * self.g = (1 - m) * 255 * self.b = (1 - y) * 255 # <<<<<<<<<<<<<< * * property hsva: */ __pyx_t_3 = __Pyx_PyInt_SubtractCObj(__pyx_int_1, __pyx_v_y, 1, 0); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 272; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __pyx_t_2 = PyNumber_Multiply(__pyx_t_3, __pyx_int_255); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 272; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_6 = __Pyx_PyInt_As_uint8_t(__pyx_t_2); if (unlikely((__pyx_t_6 == (Uint8)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 272; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_v_self->b = __pyx_t_6; /* "pygame_sdl2/color.pyx":268 * return 1 - (self.r / 255.0), 1 - (self.g / 255.0), 1 - (self.b / 255.0) * * def __set__(self, val): # <<<<<<<<<<<<<< * c, m, y = val * self.r = (1 - c) * 255 */ /* function exit code */ __pyx_r = 0; goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_AddTraceback("pygame_sdl2.color.Color.cmy.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = -1; __pyx_L0:; __Pyx_XDECREF(__pyx_v_c); __Pyx_XDECREF(__pyx_v_m); __Pyx_XDECREF(__pyx_v_y); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/color.pyx":275 * * property hsva: * def __get__(self): # <<<<<<<<<<<<<< * cdef double r = self.r / 255.0 * cdef double g = self.g / 255.0 */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_5color_5Color_4hsva_1__get__(PyObject *__pyx_v_self); /*proto*/ static PyObject *__pyx_pw_11pygame_sdl2_5color_5Color_4hsva_1__get__(PyObject *__pyx_v_self) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); __pyx_r = __pyx_pf_11pygame_sdl2_5color_5Color_4hsva___get__(((struct __pyx_obj_11pygame_sdl2_5color_Color *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_5color_5Color_4hsva___get__(struct __pyx_obj_11pygame_sdl2_5color_Color *__pyx_v_self) { double __pyx_v_r; double __pyx_v_g; double __pyx_v_b; double __pyx_v_cmax; double __pyx_v_cmin; double __pyx_v_delta; double __pyx_v_h; double __pyx_v_s; double __pyx_v_v; double __pyx_v_a; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations double __pyx_t_1; double __pyx_t_2; double __pyx_t_3; double __pyx_t_4; int __pyx_t_5; int __pyx_t_6; PyObject *__pyx_t_7 = NULL; PyObject *__pyx_t_8 = NULL; PyObject *__pyx_t_9 = NULL; PyObject *__pyx_t_10 = NULL; PyObject *__pyx_t_11 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__get__", 0); /* "pygame_sdl2/color.pyx":276 * property hsva: * def __get__(self): * cdef double r = self.r / 255.0 # <<<<<<<<<<<<<< * cdef double g = self.g / 255.0 * cdef double b = self.b / 255.0 */ __pyx_v_r = (__pyx_v_self->r / 255.0); /* "pygame_sdl2/color.pyx":277 * def __get__(self): * cdef double r = self.r / 255.0 * cdef double g = self.g / 255.0 # <<<<<<<<<<<<<< * cdef double b = self.b / 255.0 * */ __pyx_v_g = (__pyx_v_self->g / 255.0); /* "pygame_sdl2/color.pyx":278 * cdef double r = self.r / 255.0 * cdef double g = self.g / 255.0 * cdef double b = self.b / 255.0 # <<<<<<<<<<<<<< * * cdef double cmax = max(r, g, b) */ __pyx_v_b = (__pyx_v_self->b / 255.0); /* "pygame_sdl2/color.pyx":280 * cdef double b = self.b / 255.0 * * cdef double cmax = max(r, g, b) # <<<<<<<<<<<<<< * cdef double cmin = min(r, g, b) * cdef double delta = cmax - cmin */ __pyx_t_1 = __pyx_v_g; __pyx_t_2 = __pyx_v_b; __pyx_t_3 = __pyx_v_r; if (((__pyx_t_1 > __pyx_t_3) != 0)) { __pyx_t_4 = __pyx_t_1; } else { __pyx_t_4 = __pyx_t_3; } __pyx_t_3 = __pyx_t_4; if (((__pyx_t_2 > __pyx_t_3) != 0)) { __pyx_t_4 = __pyx_t_2; } else { __pyx_t_4 = __pyx_t_3; } __pyx_v_cmax = __pyx_t_4; /* "pygame_sdl2/color.pyx":281 * * cdef double cmax = max(r, g, b) * cdef double cmin = min(r, g, b) # <<<<<<<<<<<<<< * cdef double delta = cmax - cmin * */ __pyx_t_4 = __pyx_v_g; __pyx_t_1 = __pyx_v_b; __pyx_t_2 = __pyx_v_r; if (((__pyx_t_4 < __pyx_t_2) != 0)) { __pyx_t_3 = __pyx_t_4; } else { __pyx_t_3 = __pyx_t_2; } __pyx_t_2 = __pyx_t_3; if (((__pyx_t_1 < __pyx_t_2) != 0)) { __pyx_t_3 = __pyx_t_1; } else { __pyx_t_3 = __pyx_t_2; } __pyx_v_cmin = __pyx_t_3; /* "pygame_sdl2/color.pyx":282 * cdef double cmax = max(r, g, b) * cdef double cmin = min(r, g, b) * cdef double delta = cmax - cmin # <<<<<<<<<<<<<< * * cdef double h, s, v, a */ __pyx_v_delta = (__pyx_v_cmax - __pyx_v_cmin); /* "pygame_sdl2/color.pyx":286 * cdef double h, s, v, a * * if r == g == b: # <<<<<<<<<<<<<< * h = 0.0 * s = 0.0 */ __pyx_t_5 = (__pyx_v_r == __pyx_v_g); if (__pyx_t_5) { __pyx_t_5 = (__pyx_v_g == __pyx_v_b); } __pyx_t_6 = (__pyx_t_5 != 0); if (__pyx_t_6) { /* "pygame_sdl2/color.pyx":287 * * if r == g == b: * h = 0.0 # <<<<<<<<<<<<<< * s = 0.0 * else: */ __pyx_v_h = 0.0; /* "pygame_sdl2/color.pyx":288 * if r == g == b: * h = 0.0 * s = 0.0 # <<<<<<<<<<<<<< * else: * if cmax == r: */ __pyx_v_s = 0.0; /* "pygame_sdl2/color.pyx":286 * cdef double h, s, v, a * * if r == g == b: # <<<<<<<<<<<<<< * h = 0.0 * s = 0.0 */ goto __pyx_L3; } /* "pygame_sdl2/color.pyx":290 * s = 0.0 * else: * if cmax == r: # <<<<<<<<<<<<<< * h = 60.0 * ((g - b) / delta % 6) * elif cmax == g: */ /*else*/ { __pyx_t_6 = ((__pyx_v_cmax == __pyx_v_r) != 0); if (__pyx_t_6) { /* "pygame_sdl2/color.pyx":291 * else: * if cmax == r: * h = 60.0 * ((g - b) / delta % 6) # <<<<<<<<<<<<<< * elif cmax == g: * h = 60.0 * ((b - r) / delta + 2) */ __pyx_t_3 = (__pyx_v_g - __pyx_v_b); if (unlikely(__pyx_v_delta == 0)) { PyErr_SetString(PyExc_ZeroDivisionError, "float division"); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 291; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } __pyx_v_h = (60.0 * __Pyx_mod_double((__pyx_t_3 / __pyx_v_delta), 6.0)); /* "pygame_sdl2/color.pyx":290 * s = 0.0 * else: * if cmax == r: # <<<<<<<<<<<<<< * h = 60.0 * ((g - b) / delta % 6) * elif cmax == g: */ goto __pyx_L4; } /* "pygame_sdl2/color.pyx":292 * if cmax == r: * h = 60.0 * ((g - b) / delta % 6) * elif cmax == g: # <<<<<<<<<<<<<< * h = 60.0 * ((b - r) / delta + 2) * else: */ __pyx_t_6 = ((__pyx_v_cmax == __pyx_v_g) != 0); if (__pyx_t_6) { /* "pygame_sdl2/color.pyx":293 * h = 60.0 * ((g - b) / delta % 6) * elif cmax == g: * h = 60.0 * ((b - r) / delta + 2) # <<<<<<<<<<<<<< * else: * h = 60.0 * ((r - g) / delta + 4) */ __pyx_t_3 = (__pyx_v_b - __pyx_v_r); if (unlikely(__pyx_v_delta == 0)) { PyErr_SetString(PyExc_ZeroDivisionError, "float division"); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 293; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } __pyx_v_h = (60.0 * ((__pyx_t_3 / __pyx_v_delta) + 2.0)); /* "pygame_sdl2/color.pyx":292 * if cmax == r: * h = 60.0 * ((g - b) / delta % 6) * elif cmax == g: # <<<<<<<<<<<<<< * h = 60.0 * ((b - r) / delta + 2) * else: */ goto __pyx_L4; } /* "pygame_sdl2/color.pyx":295 * h = 60.0 * ((b - r) / delta + 2) * else: * h = 60.0 * ((r - g) / delta + 4) # <<<<<<<<<<<<<< * * if cmax == 0.0: */ /*else*/ { __pyx_t_3 = (__pyx_v_r - __pyx_v_g); if (unlikely(__pyx_v_delta == 0)) { PyErr_SetString(PyExc_ZeroDivisionError, "float division"); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 295; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } __pyx_v_h = (60.0 * ((__pyx_t_3 / __pyx_v_delta) + 4.0)); } __pyx_L4:; /* "pygame_sdl2/color.pyx":297 * h = 60.0 * ((r - g) / delta + 4) * * if cmax == 0.0: # <<<<<<<<<<<<<< * s = 0.0 * else: */ __pyx_t_6 = ((__pyx_v_cmax == 0.0) != 0); if (__pyx_t_6) { /* "pygame_sdl2/color.pyx":298 * * if cmax == 0.0: * s = 0.0 # <<<<<<<<<<<<<< * else: * s = delta / cmax * 100 */ __pyx_v_s = 0.0; /* "pygame_sdl2/color.pyx":297 * h = 60.0 * ((r - g) / delta + 4) * * if cmax == 0.0: # <<<<<<<<<<<<<< * s = 0.0 * else: */ goto __pyx_L5; } /* "pygame_sdl2/color.pyx":300 * s = 0.0 * else: * s = delta / cmax * 100 # <<<<<<<<<<<<<< * * v = cmax * 100 */ /*else*/ { if (unlikely(__pyx_v_cmax == 0)) { PyErr_SetString(PyExc_ZeroDivisionError, "float division"); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 300; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } __pyx_v_s = ((__pyx_v_delta / __pyx_v_cmax) * 100.0); } __pyx_L5:; } __pyx_L3:; /* "pygame_sdl2/color.pyx":302 * s = delta / cmax * 100 * * v = cmax * 100 # <<<<<<<<<<<<<< * a = self.a / 255.0 * 100 * return h, s, v, a */ __pyx_v_v = (__pyx_v_cmax * 100.0); /* "pygame_sdl2/color.pyx":303 * * v = cmax * 100 * a = self.a / 255.0 * 100 # <<<<<<<<<<<<<< * return h, s, v, a * */ __pyx_v_a = ((__pyx_v_self->a / 255.0) * 100.0); /* "pygame_sdl2/color.pyx":304 * v = cmax * 100 * a = self.a / 255.0 * 100 * return h, s, v, a # <<<<<<<<<<<<<< * * def __set__(self, val): */ __Pyx_XDECREF(__pyx_r); __pyx_t_7 = PyFloat_FromDouble(__pyx_v_h); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 304; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_7); __pyx_t_8 = PyFloat_FromDouble(__pyx_v_s); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 304; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_8); __pyx_t_9 = PyFloat_FromDouble(__pyx_v_v); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 304; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_9); __pyx_t_10 = PyFloat_FromDouble(__pyx_v_a); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 304; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_10); __pyx_t_11 = PyTuple_New(4); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 304; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_11); __Pyx_GIVEREF(__pyx_t_7); PyTuple_SET_ITEM(__pyx_t_11, 0, __pyx_t_7); __Pyx_GIVEREF(__pyx_t_8); PyTuple_SET_ITEM(__pyx_t_11, 1, __pyx_t_8); __Pyx_GIVEREF(__pyx_t_9); PyTuple_SET_ITEM(__pyx_t_11, 2, __pyx_t_9); __Pyx_GIVEREF(__pyx_t_10); PyTuple_SET_ITEM(__pyx_t_11, 3, __pyx_t_10); __pyx_t_7 = 0; __pyx_t_8 = 0; __pyx_t_9 = 0; __pyx_t_10 = 0; __pyx_r = __pyx_t_11; __pyx_t_11 = 0; goto __pyx_L0; /* "pygame_sdl2/color.pyx":275 * * property hsva: * def __get__(self): # <<<<<<<<<<<<<< * cdef double r = self.r / 255.0 * cdef double g = self.g / 255.0 */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_7); __Pyx_XDECREF(__pyx_t_8); __Pyx_XDECREF(__pyx_t_9); __Pyx_XDECREF(__pyx_t_10); __Pyx_XDECREF(__pyx_t_11); __Pyx_AddTraceback("pygame_sdl2.color.Color.hsva.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/color.pyx":306 * return h, s, v, a * * def __set__(self, val): # <<<<<<<<<<<<<< * cdef double h, s, v, a * if len(val) == 3: */ /* Python wrapper */ static int __pyx_pw_11pygame_sdl2_5color_5Color_4hsva_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_val); /*proto*/ static int __pyx_pw_11pygame_sdl2_5color_5Color_4hsva_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_val) { int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__set__ (wrapper)", 0); __pyx_r = __pyx_pf_11pygame_sdl2_5color_5Color_4hsva_2__set__(((struct __pyx_obj_11pygame_sdl2_5color_Color *)__pyx_v_self), ((PyObject *)__pyx_v_val)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static int __pyx_pf_11pygame_sdl2_5color_5Color_4hsva_2__set__(struct __pyx_obj_11pygame_sdl2_5color_Color *__pyx_v_self, PyObject *__pyx_v_val) { double __pyx_v_h; double __pyx_v_s; double __pyx_v_v; double __pyx_v_a; double __pyx_v_c; double __pyx_v_x; double __pyx_v_m; double __pyx_v_r; double __pyx_v_g; double __pyx_v_b; int __pyx_r; __Pyx_RefNannyDeclarations Py_ssize_t __pyx_t_1; int __pyx_t_2; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; PyObject *__pyx_t_5 = NULL; PyObject *__pyx_t_6 = NULL; PyObject *(*__pyx_t_7)(PyObject *); double __pyx_t_8; double __pyx_t_9; double __pyx_t_10; PyObject *__pyx_t_11 = NULL; double __pyx_t_12; int __pyx_t_13; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__set__", 0); /* "pygame_sdl2/color.pyx":308 * def __set__(self, val): * cdef double h, s, v, a * if len(val) == 3: # <<<<<<<<<<<<<< * h, s, v = val * a = 0.0 */ __pyx_t_1 = PyObject_Length(__pyx_v_val); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 308; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_t_2 = ((__pyx_t_1 == 3) != 0); if (__pyx_t_2) { /* "pygame_sdl2/color.pyx":309 * cdef double h, s, v, a * if len(val) == 3: * h, s, v = val # <<<<<<<<<<<<<< * a = 0.0 * else: */ if ((likely(PyTuple_CheckExact(__pyx_v_val))) || (PyList_CheckExact(__pyx_v_val))) { PyObject* sequence = __pyx_v_val; #if CYTHON_COMPILING_IN_CPYTHON Py_ssize_t size = Py_SIZE(sequence); #else Py_ssize_t size = PySequence_Size(sequence); #endif if (unlikely(size != 3)) { if (size > 3) __Pyx_RaiseTooManyValuesError(3); else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 309; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } #if CYTHON_COMPILING_IN_CPYTHON if (likely(PyTuple_CheckExact(sequence))) { __pyx_t_3 = PyTuple_GET_ITEM(sequence, 0); __pyx_t_4 = PyTuple_GET_ITEM(sequence, 1); __pyx_t_5 = PyTuple_GET_ITEM(sequence, 2); } else { __pyx_t_3 = PyList_GET_ITEM(sequence, 0); __pyx_t_4 = PyList_GET_ITEM(sequence, 1); __pyx_t_5 = PyList_GET_ITEM(sequence, 2); } __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(__pyx_t_4); __Pyx_INCREF(__pyx_t_5); #else __pyx_t_3 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 309; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 309; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); __pyx_t_5 = PySequence_ITEM(sequence, 2); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 309; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); #endif } else { Py_ssize_t index = -1; __pyx_t_6 = PyObject_GetIter(__pyx_v_val); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 309; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_6); __pyx_t_7 = Py_TYPE(__pyx_t_6)->tp_iternext; index = 0; __pyx_t_3 = __pyx_t_7(__pyx_t_6); if (unlikely(!__pyx_t_3)) goto __pyx_L4_unpacking_failed; __Pyx_GOTREF(__pyx_t_3); index = 1; __pyx_t_4 = __pyx_t_7(__pyx_t_6); if (unlikely(!__pyx_t_4)) goto __pyx_L4_unpacking_failed; __Pyx_GOTREF(__pyx_t_4); index = 2; __pyx_t_5 = __pyx_t_7(__pyx_t_6); if (unlikely(!__pyx_t_5)) goto __pyx_L4_unpacking_failed; __Pyx_GOTREF(__pyx_t_5); if (__Pyx_IternextUnpackEndCheck(__pyx_t_7(__pyx_t_6), 3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 309; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_t_7 = NULL; __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; goto __pyx_L5_unpacking_done; __pyx_L4_unpacking_failed:; __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __pyx_t_7 = NULL; if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 309; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_L5_unpacking_done:; } __pyx_t_8 = __pyx_PyFloat_AsDouble(__pyx_t_3); if (unlikely((__pyx_t_8 == (double)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 309; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_9 = __pyx_PyFloat_AsDouble(__pyx_t_4); if (unlikely((__pyx_t_9 == (double)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 309; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_t_10 = __pyx_PyFloat_AsDouble(__pyx_t_5); if (unlikely((__pyx_t_10 == (double)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 309; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __pyx_v_h = __pyx_t_8; __pyx_v_s = __pyx_t_9; __pyx_v_v = __pyx_t_10; /* "pygame_sdl2/color.pyx":310 * if len(val) == 3: * h, s, v = val * a = 0.0 # <<<<<<<<<<<<<< * else: * h, s, v, a = val */ __pyx_v_a = 0.0; /* "pygame_sdl2/color.pyx":308 * def __set__(self, val): * cdef double h, s, v, a * if len(val) == 3: # <<<<<<<<<<<<<< * h, s, v = val * a = 0.0 */ goto __pyx_L3; } /* "pygame_sdl2/color.pyx":312 * a = 0.0 * else: * h, s, v, a = val # <<<<<<<<<<<<<< * * h = h % 360.0 */ /*else*/ { if ((likely(PyTuple_CheckExact(__pyx_v_val))) || (PyList_CheckExact(__pyx_v_val))) { PyObject* sequence = __pyx_v_val; #if CYTHON_COMPILING_IN_CPYTHON Py_ssize_t size = Py_SIZE(sequence); #else Py_ssize_t size = PySequence_Size(sequence); #endif if (unlikely(size != 4)) { if (size > 4) __Pyx_RaiseTooManyValuesError(4); else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 312; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } #if CYTHON_COMPILING_IN_CPYTHON if (likely(PyTuple_CheckExact(sequence))) { __pyx_t_5 = PyTuple_GET_ITEM(sequence, 0); __pyx_t_4 = PyTuple_GET_ITEM(sequence, 1); __pyx_t_3 = PyTuple_GET_ITEM(sequence, 2); __pyx_t_6 = PyTuple_GET_ITEM(sequence, 3); } else { __pyx_t_5 = PyList_GET_ITEM(sequence, 0); __pyx_t_4 = PyList_GET_ITEM(sequence, 1); __pyx_t_3 = PyList_GET_ITEM(sequence, 2); __pyx_t_6 = PyList_GET_ITEM(sequence, 3); } __Pyx_INCREF(__pyx_t_5); __Pyx_INCREF(__pyx_t_4); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(__pyx_t_6); #else { Py_ssize_t i; PyObject** temps[4] = {&__pyx_t_5,&__pyx_t_4,&__pyx_t_3,&__pyx_t_6}; for (i=0; i < 4; i++) { PyObject* item = PySequence_ITEM(sequence, i); if (unlikely(!item)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 312; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(item); *(temps[i]) = item; } } #endif } else { Py_ssize_t index = -1; PyObject** temps[4] = {&__pyx_t_5,&__pyx_t_4,&__pyx_t_3,&__pyx_t_6}; __pyx_t_11 = PyObject_GetIter(__pyx_v_val); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 312; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_11); __pyx_t_7 = Py_TYPE(__pyx_t_11)->tp_iternext; for (index=0; index < 4; index++) { PyObject* item = __pyx_t_7(__pyx_t_11); if (unlikely(!item)) goto __pyx_L6_unpacking_failed; __Pyx_GOTREF(item); *(temps[index]) = item; } if (__Pyx_IternextUnpackEndCheck(__pyx_t_7(__pyx_t_11), 4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 312; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_t_7 = NULL; __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; goto __pyx_L7_unpacking_done; __pyx_L6_unpacking_failed:; __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; __pyx_t_7 = NULL; if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 312; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_L7_unpacking_done:; } __pyx_t_10 = __pyx_PyFloat_AsDouble(__pyx_t_5); if (unlikely((__pyx_t_10 == (double)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 312; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __pyx_t_9 = __pyx_PyFloat_AsDouble(__pyx_t_4); if (unlikely((__pyx_t_9 == (double)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 312; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_t_8 = __pyx_PyFloat_AsDouble(__pyx_t_3); if (unlikely((__pyx_t_8 == (double)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 312; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_12 = __pyx_PyFloat_AsDouble(__pyx_t_6); if (unlikely((__pyx_t_12 == (double)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 312; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __pyx_v_h = __pyx_t_10; __pyx_v_s = __pyx_t_9; __pyx_v_v = __pyx_t_8; __pyx_v_a = __pyx_t_12; } __pyx_L3:; /* "pygame_sdl2/color.pyx":314 * h, s, v, a = val * * h = h % 360.0 # <<<<<<<<<<<<<< * * # These should be in a range of [0.0, 1.0] */ __pyx_v_h = __Pyx_mod_double(__pyx_v_h, 360.0); /* "pygame_sdl2/color.pyx":317 * * # These should be in a range of [0.0, 1.0] * s /= 100.0 # <<<<<<<<<<<<<< * v /= 100.0 * a /= 100.0 */ __pyx_v_s = (__pyx_v_s / 100.0); /* "pygame_sdl2/color.pyx":318 * # These should be in a range of [0.0, 1.0] * s /= 100.0 * v /= 100.0 # <<<<<<<<<<<<<< * a /= 100.0 * */ __pyx_v_v = (__pyx_v_v / 100.0); /* "pygame_sdl2/color.pyx":319 * s /= 100.0 * v /= 100.0 * a /= 100.0 # <<<<<<<<<<<<<< * * cdef double c = v * s */ __pyx_v_a = (__pyx_v_a / 100.0); /* "pygame_sdl2/color.pyx":321 * a /= 100.0 * * cdef double c = v * s # <<<<<<<<<<<<<< * cdef double x = c * (1 - abs((h / 60.0) % 2 - 1)) * cdef double m = v - c */ __pyx_v_c = (__pyx_v_v * __pyx_v_s); /* "pygame_sdl2/color.pyx":322 * * cdef double c = v * s * cdef double x = c * (1 - abs((h / 60.0) % 2 - 1)) # <<<<<<<<<<<<<< * cdef double m = v - c * */ __pyx_v_x = (__pyx_v_c * (1.0 - fabs((__Pyx_mod_double((__pyx_v_h / 60.0), 2.0) - 1.0)))); /* "pygame_sdl2/color.pyx":323 * cdef double c = v * s * cdef double x = c * (1 - abs((h / 60.0) % 2 - 1)) * cdef double m = v - c # <<<<<<<<<<<<<< * * cdef double r, g, b */ __pyx_v_m = (__pyx_v_v - __pyx_v_c); /* "pygame_sdl2/color.pyx":327 * cdef double r, g, b * * if 0 <= h < 60: # <<<<<<<<<<<<<< * r, g, b = c, x, 0 * elif 60 <= h < 120: */ __pyx_t_2 = (0.0 <= __pyx_v_h); if (__pyx_t_2) { __pyx_t_2 = (__pyx_v_h < 60.0); } __pyx_t_13 = (__pyx_t_2 != 0); if (__pyx_t_13) { /* "pygame_sdl2/color.pyx":328 * * if 0 <= h < 60: * r, g, b = c, x, 0 # <<<<<<<<<<<<<< * elif 60 <= h < 120: * r, g, b = x, c, 0 */ __pyx_t_12 = __pyx_v_c; __pyx_t_8 = __pyx_v_x; __pyx_t_9 = 0.0; __pyx_v_r = __pyx_t_12; __pyx_v_g = __pyx_t_8; __pyx_v_b = __pyx_t_9; /* "pygame_sdl2/color.pyx":327 * cdef double r, g, b * * if 0 <= h < 60: # <<<<<<<<<<<<<< * r, g, b = c, x, 0 * elif 60 <= h < 120: */ goto __pyx_L8; } /* "pygame_sdl2/color.pyx":329 * if 0 <= h < 60: * r, g, b = c, x, 0 * elif 60 <= h < 120: # <<<<<<<<<<<<<< * r, g, b = x, c, 0 * elif 120 <= h < 180: */ __pyx_t_13 = (60.0 <= __pyx_v_h); if (__pyx_t_13) { __pyx_t_13 = (__pyx_v_h < 120.0); } __pyx_t_2 = (__pyx_t_13 != 0); if (__pyx_t_2) { /* "pygame_sdl2/color.pyx":330 * r, g, b = c, x, 0 * elif 60 <= h < 120: * r, g, b = x, c, 0 # <<<<<<<<<<<<<< * elif 120 <= h < 180: * r, g, b = 0, c, x */ __pyx_t_9 = __pyx_v_x; __pyx_t_8 = __pyx_v_c; __pyx_t_12 = 0.0; __pyx_v_r = __pyx_t_9; __pyx_v_g = __pyx_t_8; __pyx_v_b = __pyx_t_12; /* "pygame_sdl2/color.pyx":329 * if 0 <= h < 60: * r, g, b = c, x, 0 * elif 60 <= h < 120: # <<<<<<<<<<<<<< * r, g, b = x, c, 0 * elif 120 <= h < 180: */ goto __pyx_L8; } /* "pygame_sdl2/color.pyx":331 * elif 60 <= h < 120: * r, g, b = x, c, 0 * elif 120 <= h < 180: # <<<<<<<<<<<<<< * r, g, b = 0, c, x * elif 180 <= h < 240: */ __pyx_t_2 = (120.0 <= __pyx_v_h); if (__pyx_t_2) { __pyx_t_2 = (__pyx_v_h < 180.0); } __pyx_t_13 = (__pyx_t_2 != 0); if (__pyx_t_13) { /* "pygame_sdl2/color.pyx":332 * r, g, b = x, c, 0 * elif 120 <= h < 180: * r, g, b = 0, c, x # <<<<<<<<<<<<<< * elif 180 <= h < 240: * r, g, b = 0, x, c */ __pyx_t_12 = 0.0; __pyx_t_8 = __pyx_v_c; __pyx_t_9 = __pyx_v_x; __pyx_v_r = __pyx_t_12; __pyx_v_g = __pyx_t_8; __pyx_v_b = __pyx_t_9; /* "pygame_sdl2/color.pyx":331 * elif 60 <= h < 120: * r, g, b = x, c, 0 * elif 120 <= h < 180: # <<<<<<<<<<<<<< * r, g, b = 0, c, x * elif 180 <= h < 240: */ goto __pyx_L8; } /* "pygame_sdl2/color.pyx":333 * elif 120 <= h < 180: * r, g, b = 0, c, x * elif 180 <= h < 240: # <<<<<<<<<<<<<< * r, g, b = 0, x, c * elif 240 <= h < 300: */ __pyx_t_13 = (180.0 <= __pyx_v_h); if (__pyx_t_13) { __pyx_t_13 = (__pyx_v_h < 240.0); } __pyx_t_2 = (__pyx_t_13 != 0); if (__pyx_t_2) { /* "pygame_sdl2/color.pyx":334 * r, g, b = 0, c, x * elif 180 <= h < 240: * r, g, b = 0, x, c # <<<<<<<<<<<<<< * elif 240 <= h < 300: * r, g, b = x, 0, c */ __pyx_t_9 = 0.0; __pyx_t_8 = __pyx_v_x; __pyx_t_12 = __pyx_v_c; __pyx_v_r = __pyx_t_9; __pyx_v_g = __pyx_t_8; __pyx_v_b = __pyx_t_12; /* "pygame_sdl2/color.pyx":333 * elif 120 <= h < 180: * r, g, b = 0, c, x * elif 180 <= h < 240: # <<<<<<<<<<<<<< * r, g, b = 0, x, c * elif 240 <= h < 300: */ goto __pyx_L8; } /* "pygame_sdl2/color.pyx":335 * elif 180 <= h < 240: * r, g, b = 0, x, c * elif 240 <= h < 300: # <<<<<<<<<<<<<< * r, g, b = x, 0, c * elif 300 <= h < 360: */ __pyx_t_2 = (240.0 <= __pyx_v_h); if (__pyx_t_2) { __pyx_t_2 = (__pyx_v_h < 300.0); } __pyx_t_13 = (__pyx_t_2 != 0); if (__pyx_t_13) { /* "pygame_sdl2/color.pyx":336 * r, g, b = 0, x, c * elif 240 <= h < 300: * r, g, b = x, 0, c # <<<<<<<<<<<<<< * elif 300 <= h < 360: * r, g, b = c, 0, x */ __pyx_t_12 = __pyx_v_x; __pyx_t_8 = 0.0; __pyx_t_9 = __pyx_v_c; __pyx_v_r = __pyx_t_12; __pyx_v_g = __pyx_t_8; __pyx_v_b = __pyx_t_9; /* "pygame_sdl2/color.pyx":335 * elif 180 <= h < 240: * r, g, b = 0, x, c * elif 240 <= h < 300: # <<<<<<<<<<<<<< * r, g, b = x, 0, c * elif 300 <= h < 360: */ goto __pyx_L8; } /* "pygame_sdl2/color.pyx":337 * elif 240 <= h < 300: * r, g, b = x, 0, c * elif 300 <= h < 360: # <<<<<<<<<<<<<< * r, g, b = c, 0, x * else: */ __pyx_t_13 = (300.0 <= __pyx_v_h); if (__pyx_t_13) { __pyx_t_13 = (__pyx_v_h < 360.0); } __pyx_t_2 = (__pyx_t_13 != 0); if (__pyx_t_2) { /* "pygame_sdl2/color.pyx":338 * r, g, b = x, 0, c * elif 300 <= h < 360: * r, g, b = c, 0, x # <<<<<<<<<<<<<< * else: * raise ValueError() */ __pyx_t_9 = __pyx_v_c; __pyx_t_8 = 0.0; __pyx_t_12 = __pyx_v_x; __pyx_v_r = __pyx_t_9; __pyx_v_g = __pyx_t_8; __pyx_v_b = __pyx_t_12; /* "pygame_sdl2/color.pyx":337 * elif 240 <= h < 300: * r, g, b = x, 0, c * elif 300 <= h < 360: # <<<<<<<<<<<<<< * r, g, b = c, 0, x * else: */ goto __pyx_L8; } /* "pygame_sdl2/color.pyx":340 * r, g, b = c, 0, x * else: * raise ValueError() # <<<<<<<<<<<<<< * * self.r = int(255 * (r + m)) */ /*else*/ { __pyx_t_6 = __Pyx_PyObject_CallNoArg(__pyx_builtin_ValueError); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 340; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_6); __Pyx_Raise(__pyx_t_6, 0, 0, 0); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; {__pyx_filename = __pyx_f[0]; __pyx_lineno = 340; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } __pyx_L8:; /* "pygame_sdl2/color.pyx":342 * raise ValueError() * * self.r = int(255 * (r + m)) # <<<<<<<<<<<<<< * self.g = int(255 * (g + m)) * self.b = int(255 * (b + m)) */ __pyx_v_self->r = ((Uint8)(255.0 * (__pyx_v_r + __pyx_v_m))); /* "pygame_sdl2/color.pyx":343 * * self.r = int(255 * (r + m)) * self.g = int(255 * (g + m)) # <<<<<<<<<<<<<< * self.b = int(255 * (b + m)) * self.a = int(255 * a) */ __pyx_v_self->g = ((Uint8)(255.0 * (__pyx_v_g + __pyx_v_m))); /* "pygame_sdl2/color.pyx":344 * self.r = int(255 * (r + m)) * self.g = int(255 * (g + m)) * self.b = int(255 * (b + m)) # <<<<<<<<<<<<<< * self.a = int(255 * a) * */ __pyx_v_self->b = ((Uint8)(255.0 * (__pyx_v_b + __pyx_v_m))); /* "pygame_sdl2/color.pyx":345 * self.g = int(255 * (g + m)) * self.b = int(255 * (b + m)) * self.a = int(255 * a) # <<<<<<<<<<<<<< * * property hsla: */ __pyx_v_self->a = ((Uint8)(255.0 * __pyx_v_a)); /* "pygame_sdl2/color.pyx":306 * return h, s, v, a * * def __set__(self, val): # <<<<<<<<<<<<<< * cdef double h, s, v, a * if len(val) == 3: */ /* function exit code */ __pyx_r = 0; goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_5); __Pyx_XDECREF(__pyx_t_6); __Pyx_XDECREF(__pyx_t_11); __Pyx_AddTraceback("pygame_sdl2.color.Color.hsva.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = -1; __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/color.pyx":348 * * property hsla: * def __get__(self): # <<<<<<<<<<<<<< * cdef double h, s, l, a * cdef double r, g, b */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_5color_5Color_4hsla_1__get__(PyObject *__pyx_v_self); /*proto*/ static PyObject *__pyx_pw_11pygame_sdl2_5color_5Color_4hsla_1__get__(PyObject *__pyx_v_self) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); __pyx_r = __pyx_pf_11pygame_sdl2_5color_5Color_4hsla___get__(((struct __pyx_obj_11pygame_sdl2_5color_Color *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_5color_5Color_4hsla___get__(struct __pyx_obj_11pygame_sdl2_5color_Color *__pyx_v_self) { double __pyx_v_h; double __pyx_v_s; double __pyx_v_l; double __pyx_v_a; double __pyx_v_r; double __pyx_v_g; double __pyx_v_b; double __pyx_v_cmin; double __pyx_v_cmax; double __pyx_v_delta; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; double __pyx_t_3; double __pyx_t_4; double __pyx_t_5; double __pyx_t_6; int __pyx_t_7; PyObject *__pyx_t_8 = NULL; PyObject *__pyx_t_9 = NULL; PyObject *__pyx_t_10 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__get__", 0); /* "pygame_sdl2/color.pyx":353 * cdef double cmin, cmax, delta * * h = self.hsva[0] % 360.0 # <<<<<<<<<<<<<< * * r = self.r / 255.0 */ __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_hsva); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 353; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = __Pyx_GetItemInt(__pyx_t_1, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(__pyx_t_2 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 353; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_1 = __Pyx_PyFloat_RemainderObjC(__pyx_t_2, __pyx_float_360_0, 360.0, 0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 353; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_3 = __pyx_PyFloat_AsDouble(__pyx_t_1); if (unlikely((__pyx_t_3 == (double)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 353; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_v_h = __pyx_t_3; /* "pygame_sdl2/color.pyx":355 * h = self.hsva[0] % 360.0 * * r = self.r / 255.0 # <<<<<<<<<<<<<< * g = self.g / 255.0 * b = self.b / 255.0 */ __pyx_v_r = (__pyx_v_self->r / 255.0); /* "pygame_sdl2/color.pyx":356 * * r = self.r / 255.0 * g = self.g / 255.0 # <<<<<<<<<<<<<< * b = self.b / 255.0 * */ __pyx_v_g = (__pyx_v_self->g / 255.0); /* "pygame_sdl2/color.pyx":357 * r = self.r / 255.0 * g = self.g / 255.0 * b = self.b / 255.0 # <<<<<<<<<<<<<< * * cmin = min(r, g, b) */ __pyx_v_b = (__pyx_v_self->b / 255.0); /* "pygame_sdl2/color.pyx":359 * b = self.b / 255.0 * * cmin = min(r, g, b) # <<<<<<<<<<<<<< * cmax = max(r, g, b) * delta = cmax - cmin */ __pyx_t_3 = __pyx_v_g; __pyx_t_4 = __pyx_v_b; __pyx_t_5 = __pyx_v_r; if (((__pyx_t_3 < __pyx_t_5) != 0)) { __pyx_t_6 = __pyx_t_3; } else { __pyx_t_6 = __pyx_t_5; } __pyx_t_5 = __pyx_t_6; if (((__pyx_t_4 < __pyx_t_5) != 0)) { __pyx_t_6 = __pyx_t_4; } else { __pyx_t_6 = __pyx_t_5; } __pyx_v_cmin = __pyx_t_6; /* "pygame_sdl2/color.pyx":360 * * cmin = min(r, g, b) * cmax = max(r, g, b) # <<<<<<<<<<<<<< * delta = cmax - cmin * */ __pyx_t_6 = __pyx_v_g; __pyx_t_3 = __pyx_v_b; __pyx_t_4 = __pyx_v_r; if (((__pyx_t_6 > __pyx_t_4) != 0)) { __pyx_t_5 = __pyx_t_6; } else { __pyx_t_5 = __pyx_t_4; } __pyx_t_4 = __pyx_t_5; if (((__pyx_t_3 > __pyx_t_4) != 0)) { __pyx_t_5 = __pyx_t_3; } else { __pyx_t_5 = __pyx_t_4; } __pyx_v_cmax = __pyx_t_5; /* "pygame_sdl2/color.pyx":361 * cmin = min(r, g, b) * cmax = max(r, g, b) * delta = cmax - cmin # <<<<<<<<<<<<<< * * l = (cmax + cmin) / 2.0 */ __pyx_v_delta = (__pyx_v_cmax - __pyx_v_cmin); /* "pygame_sdl2/color.pyx":363 * delta = cmax - cmin * * l = (cmax + cmin) / 2.0 # <<<<<<<<<<<<<< * * if delta == 0: */ __pyx_v_l = ((__pyx_v_cmax + __pyx_v_cmin) / 2.0); /* "pygame_sdl2/color.pyx":365 * l = (cmax + cmin) / 2.0 * * if delta == 0: # <<<<<<<<<<<<<< * s = 0.0 * else: */ __pyx_t_7 = ((__pyx_v_delta == 0.0) != 0); if (__pyx_t_7) { /* "pygame_sdl2/color.pyx":366 * * if delta == 0: * s = 0.0 # <<<<<<<<<<<<<< * else: * s = delta / (1 - abs(2 * l - 1)) */ __pyx_v_s = 0.0; /* "pygame_sdl2/color.pyx":365 * l = (cmax + cmin) / 2.0 * * if delta == 0: # <<<<<<<<<<<<<< * s = 0.0 * else: */ goto __pyx_L3; } /* "pygame_sdl2/color.pyx":368 * s = 0.0 * else: * s = delta / (1 - abs(2 * l - 1)) # <<<<<<<<<<<<<< * * a = self.a / 255.0 * 100 */ /*else*/ { __pyx_t_5 = (1.0 - fabs(((2.0 * __pyx_v_l) - 1.0))); if (unlikely(__pyx_t_5 == 0)) { PyErr_SetString(PyExc_ZeroDivisionError, "float division"); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 368; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } __pyx_v_s = (__pyx_v_delta / __pyx_t_5); } __pyx_L3:; /* "pygame_sdl2/color.pyx":370 * s = delta / (1 - abs(2 * l - 1)) * * a = self.a / 255.0 * 100 # <<<<<<<<<<<<<< * * s = min(100.0, s * 100) */ __pyx_v_a = ((__pyx_v_self->a / 255.0) * 100.0); /* "pygame_sdl2/color.pyx":372 * a = self.a / 255.0 * 100 * * s = min(100.0, s * 100) # <<<<<<<<<<<<<< * l = min(100.0, l * 100) * */ __pyx_t_5 = (__pyx_v_s * 100.0); __pyx_t_6 = 100.0; if (((__pyx_t_5 < __pyx_t_6) != 0)) { __pyx_t_3 = __pyx_t_5; } else { __pyx_t_3 = __pyx_t_6; } __pyx_v_s = __pyx_t_3; /* "pygame_sdl2/color.pyx":373 * * s = min(100.0, s * 100) * l = min(100.0, l * 100) # <<<<<<<<<<<<<< * * return h, s, l, a */ __pyx_t_3 = (__pyx_v_l * 100.0); __pyx_t_5 = 100.0; if (((__pyx_t_3 < __pyx_t_5) != 0)) { __pyx_t_6 = __pyx_t_3; } else { __pyx_t_6 = __pyx_t_5; } __pyx_v_l = __pyx_t_6; /* "pygame_sdl2/color.pyx":375 * l = min(100.0, l * 100) * * return h, s, l, a # <<<<<<<<<<<<<< * * def __set__(self, val): */ __Pyx_XDECREF(__pyx_r); __pyx_t_1 = PyFloat_FromDouble(__pyx_v_h); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 375; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = PyFloat_FromDouble(__pyx_v_s); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 375; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __pyx_t_8 = PyFloat_FromDouble(__pyx_v_l); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 375; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_8); __pyx_t_9 = PyFloat_FromDouble(__pyx_v_a); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 375; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_9); __pyx_t_10 = PyTuple_New(4); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 375; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_10); __Pyx_GIVEREF(__pyx_t_1); PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_t_1); __Pyx_GIVEREF(__pyx_t_2); PyTuple_SET_ITEM(__pyx_t_10, 1, __pyx_t_2); __Pyx_GIVEREF(__pyx_t_8); PyTuple_SET_ITEM(__pyx_t_10, 2, __pyx_t_8); __Pyx_GIVEREF(__pyx_t_9); PyTuple_SET_ITEM(__pyx_t_10, 3, __pyx_t_9); __pyx_t_1 = 0; __pyx_t_2 = 0; __pyx_t_8 = 0; __pyx_t_9 = 0; __pyx_r = __pyx_t_10; __pyx_t_10 = 0; goto __pyx_L0; /* "pygame_sdl2/color.pyx":348 * * property hsla: * def __get__(self): # <<<<<<<<<<<<<< * cdef double h, s, l, a * cdef double r, g, b */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_8); __Pyx_XDECREF(__pyx_t_9); __Pyx_XDECREF(__pyx_t_10); __Pyx_AddTraceback("pygame_sdl2.color.Color.hsla.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/color.pyx":377 * return h, s, l, a * * def __set__(self, val): # <<<<<<<<<<<<<< * cdef double h, s, l, a * if len(val) == 3: */ /* Python wrapper */ static int __pyx_pw_11pygame_sdl2_5color_5Color_4hsla_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_val); /*proto*/ static int __pyx_pw_11pygame_sdl2_5color_5Color_4hsla_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_val) { int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__set__ (wrapper)", 0); __pyx_r = __pyx_pf_11pygame_sdl2_5color_5Color_4hsla_2__set__(((struct __pyx_obj_11pygame_sdl2_5color_Color *)__pyx_v_self), ((PyObject *)__pyx_v_val)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static int __pyx_pf_11pygame_sdl2_5color_5Color_4hsla_2__set__(struct __pyx_obj_11pygame_sdl2_5color_Color *__pyx_v_self, PyObject *__pyx_v_val) { double __pyx_v_h; double __pyx_v_s; double __pyx_v_l; double __pyx_v_a; double __pyx_v_c; double __pyx_v_x; double __pyx_v_m; double __pyx_v_r; double __pyx_v_g; double __pyx_v_b; int __pyx_r; __Pyx_RefNannyDeclarations Py_ssize_t __pyx_t_1; int __pyx_t_2; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; PyObject *__pyx_t_5 = NULL; PyObject *__pyx_t_6 = NULL; PyObject *(*__pyx_t_7)(PyObject *); double __pyx_t_8; double __pyx_t_9; double __pyx_t_10; PyObject *__pyx_t_11 = NULL; double __pyx_t_12; int __pyx_t_13; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__set__", 0); /* "pygame_sdl2/color.pyx":379 * def __set__(self, val): * cdef double h, s, l, a * if len(val) == 3: # <<<<<<<<<<<<<< * h, s, l = val * a = 0.0 */ __pyx_t_1 = PyObject_Length(__pyx_v_val); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 379; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_t_2 = ((__pyx_t_1 == 3) != 0); if (__pyx_t_2) { /* "pygame_sdl2/color.pyx":380 * cdef double h, s, l, a * if len(val) == 3: * h, s, l = val # <<<<<<<<<<<<<< * a = 0.0 * else: */ if ((likely(PyTuple_CheckExact(__pyx_v_val))) || (PyList_CheckExact(__pyx_v_val))) { PyObject* sequence = __pyx_v_val; #if CYTHON_COMPILING_IN_CPYTHON Py_ssize_t size = Py_SIZE(sequence); #else Py_ssize_t size = PySequence_Size(sequence); #endif if (unlikely(size != 3)) { if (size > 3) __Pyx_RaiseTooManyValuesError(3); else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 380; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } #if CYTHON_COMPILING_IN_CPYTHON if (likely(PyTuple_CheckExact(sequence))) { __pyx_t_3 = PyTuple_GET_ITEM(sequence, 0); __pyx_t_4 = PyTuple_GET_ITEM(sequence, 1); __pyx_t_5 = PyTuple_GET_ITEM(sequence, 2); } else { __pyx_t_3 = PyList_GET_ITEM(sequence, 0); __pyx_t_4 = PyList_GET_ITEM(sequence, 1); __pyx_t_5 = PyList_GET_ITEM(sequence, 2); } __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(__pyx_t_4); __Pyx_INCREF(__pyx_t_5); #else __pyx_t_3 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 380; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 380; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); __pyx_t_5 = PySequence_ITEM(sequence, 2); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 380; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); #endif } else { Py_ssize_t index = -1; __pyx_t_6 = PyObject_GetIter(__pyx_v_val); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 380; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_6); __pyx_t_7 = Py_TYPE(__pyx_t_6)->tp_iternext; index = 0; __pyx_t_3 = __pyx_t_7(__pyx_t_6); if (unlikely(!__pyx_t_3)) goto __pyx_L4_unpacking_failed; __Pyx_GOTREF(__pyx_t_3); index = 1; __pyx_t_4 = __pyx_t_7(__pyx_t_6); if (unlikely(!__pyx_t_4)) goto __pyx_L4_unpacking_failed; __Pyx_GOTREF(__pyx_t_4); index = 2; __pyx_t_5 = __pyx_t_7(__pyx_t_6); if (unlikely(!__pyx_t_5)) goto __pyx_L4_unpacking_failed; __Pyx_GOTREF(__pyx_t_5); if (__Pyx_IternextUnpackEndCheck(__pyx_t_7(__pyx_t_6), 3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 380; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_t_7 = NULL; __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; goto __pyx_L5_unpacking_done; __pyx_L4_unpacking_failed:; __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __pyx_t_7 = NULL; if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 380; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_L5_unpacking_done:; } __pyx_t_8 = __pyx_PyFloat_AsDouble(__pyx_t_3); if (unlikely((__pyx_t_8 == (double)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 380; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_9 = __pyx_PyFloat_AsDouble(__pyx_t_4); if (unlikely((__pyx_t_9 == (double)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 380; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_t_10 = __pyx_PyFloat_AsDouble(__pyx_t_5); if (unlikely((__pyx_t_10 == (double)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 380; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __pyx_v_h = __pyx_t_8; __pyx_v_s = __pyx_t_9; __pyx_v_l = __pyx_t_10; /* "pygame_sdl2/color.pyx":381 * if len(val) == 3: * h, s, l = val * a = 0.0 # <<<<<<<<<<<<<< * else: * h, s, l, a = val */ __pyx_v_a = 0.0; /* "pygame_sdl2/color.pyx":379 * def __set__(self, val): * cdef double h, s, l, a * if len(val) == 3: # <<<<<<<<<<<<<< * h, s, l = val * a = 0.0 */ goto __pyx_L3; } /* "pygame_sdl2/color.pyx":383 * a = 0.0 * else: * h, s, l, a = val # <<<<<<<<<<<<<< * * s /= 100.0 */ /*else*/ { if ((likely(PyTuple_CheckExact(__pyx_v_val))) || (PyList_CheckExact(__pyx_v_val))) { PyObject* sequence = __pyx_v_val; #if CYTHON_COMPILING_IN_CPYTHON Py_ssize_t size = Py_SIZE(sequence); #else Py_ssize_t size = PySequence_Size(sequence); #endif if (unlikely(size != 4)) { if (size > 4) __Pyx_RaiseTooManyValuesError(4); else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 383; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } #if CYTHON_COMPILING_IN_CPYTHON if (likely(PyTuple_CheckExact(sequence))) { __pyx_t_5 = PyTuple_GET_ITEM(sequence, 0); __pyx_t_4 = PyTuple_GET_ITEM(sequence, 1); __pyx_t_3 = PyTuple_GET_ITEM(sequence, 2); __pyx_t_6 = PyTuple_GET_ITEM(sequence, 3); } else { __pyx_t_5 = PyList_GET_ITEM(sequence, 0); __pyx_t_4 = PyList_GET_ITEM(sequence, 1); __pyx_t_3 = PyList_GET_ITEM(sequence, 2); __pyx_t_6 = PyList_GET_ITEM(sequence, 3); } __Pyx_INCREF(__pyx_t_5); __Pyx_INCREF(__pyx_t_4); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(__pyx_t_6); #else { Py_ssize_t i; PyObject** temps[4] = {&__pyx_t_5,&__pyx_t_4,&__pyx_t_3,&__pyx_t_6}; for (i=0; i < 4; i++) { PyObject* item = PySequence_ITEM(sequence, i); if (unlikely(!item)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 383; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(item); *(temps[i]) = item; } } #endif } else { Py_ssize_t index = -1; PyObject** temps[4] = {&__pyx_t_5,&__pyx_t_4,&__pyx_t_3,&__pyx_t_6}; __pyx_t_11 = PyObject_GetIter(__pyx_v_val); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 383; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_11); __pyx_t_7 = Py_TYPE(__pyx_t_11)->tp_iternext; for (index=0; index < 4; index++) { PyObject* item = __pyx_t_7(__pyx_t_11); if (unlikely(!item)) goto __pyx_L6_unpacking_failed; __Pyx_GOTREF(item); *(temps[index]) = item; } if (__Pyx_IternextUnpackEndCheck(__pyx_t_7(__pyx_t_11), 4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 383; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_t_7 = NULL; __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; goto __pyx_L7_unpacking_done; __pyx_L6_unpacking_failed:; __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; __pyx_t_7 = NULL; if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 383; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_L7_unpacking_done:; } __pyx_t_10 = __pyx_PyFloat_AsDouble(__pyx_t_5); if (unlikely((__pyx_t_10 == (double)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 383; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __pyx_t_9 = __pyx_PyFloat_AsDouble(__pyx_t_4); if (unlikely((__pyx_t_9 == (double)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 383; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_t_8 = __pyx_PyFloat_AsDouble(__pyx_t_3); if (unlikely((__pyx_t_8 == (double)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 383; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_12 = __pyx_PyFloat_AsDouble(__pyx_t_6); if (unlikely((__pyx_t_12 == (double)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 383; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __pyx_v_h = __pyx_t_10; __pyx_v_s = __pyx_t_9; __pyx_v_l = __pyx_t_8; __pyx_v_a = __pyx_t_12; } __pyx_L3:; /* "pygame_sdl2/color.pyx":385 * h, s, l, a = val * * s /= 100.0 # <<<<<<<<<<<<<< * l /= 100.0 * a /= 100.0 */ __pyx_v_s = (__pyx_v_s / 100.0); /* "pygame_sdl2/color.pyx":386 * * s /= 100.0 * l /= 100.0 # <<<<<<<<<<<<<< * a /= 100.0 * */ __pyx_v_l = (__pyx_v_l / 100.0); /* "pygame_sdl2/color.pyx":387 * s /= 100.0 * l /= 100.0 * a /= 100.0 # <<<<<<<<<<<<<< * * cdef double c = (1 - abs(2*l - 1)) * s */ __pyx_v_a = (__pyx_v_a / 100.0); /* "pygame_sdl2/color.pyx":389 * a /= 100.0 * * cdef double c = (1 - abs(2*l - 1)) * s # <<<<<<<<<<<<<< * cdef double x = c * (1 - abs((h / 60.0) % 2 - 1)) * cdef double m = l - c / 2.0 */ __pyx_v_c = ((1.0 - fabs(((2.0 * __pyx_v_l) - 1.0))) * __pyx_v_s); /* "pygame_sdl2/color.pyx":390 * * cdef double c = (1 - abs(2*l - 1)) * s * cdef double x = c * (1 - abs((h / 60.0) % 2 - 1)) # <<<<<<<<<<<<<< * cdef double m = l - c / 2.0 * */ __pyx_v_x = (__pyx_v_c * (1.0 - fabs((__Pyx_mod_double((__pyx_v_h / 60.0), 2.0) - 1.0)))); /* "pygame_sdl2/color.pyx":391 * cdef double c = (1 - abs(2*l - 1)) * s * cdef double x = c * (1 - abs((h / 60.0) % 2 - 1)) * cdef double m = l - c / 2.0 # <<<<<<<<<<<<<< * * cdef double r, g, b */ __pyx_v_m = (__pyx_v_l - (__pyx_v_c / 2.0)); /* "pygame_sdl2/color.pyx":394 * * cdef double r, g, b * if 0 <= h < 60: # <<<<<<<<<<<<<< * r, g, b = c, x, 0 * elif 60 <= h < 120: */ __pyx_t_2 = (0.0 <= __pyx_v_h); if (__pyx_t_2) { __pyx_t_2 = (__pyx_v_h < 60.0); } __pyx_t_13 = (__pyx_t_2 != 0); if (__pyx_t_13) { /* "pygame_sdl2/color.pyx":395 * cdef double r, g, b * if 0 <= h < 60: * r, g, b = c, x, 0 # <<<<<<<<<<<<<< * elif 60 <= h < 120: * r, g, b = x, c, 0 */ __pyx_t_12 = __pyx_v_c; __pyx_t_8 = __pyx_v_x; __pyx_t_9 = 0.0; __pyx_v_r = __pyx_t_12; __pyx_v_g = __pyx_t_8; __pyx_v_b = __pyx_t_9; /* "pygame_sdl2/color.pyx":394 * * cdef double r, g, b * if 0 <= h < 60: # <<<<<<<<<<<<<< * r, g, b = c, x, 0 * elif 60 <= h < 120: */ goto __pyx_L8; } /* "pygame_sdl2/color.pyx":396 * if 0 <= h < 60: * r, g, b = c, x, 0 * elif 60 <= h < 120: # <<<<<<<<<<<<<< * r, g, b = x, c, 0 * elif 120 <= h < 180: */ __pyx_t_13 = (60.0 <= __pyx_v_h); if (__pyx_t_13) { __pyx_t_13 = (__pyx_v_h < 120.0); } __pyx_t_2 = (__pyx_t_13 != 0); if (__pyx_t_2) { /* "pygame_sdl2/color.pyx":397 * r, g, b = c, x, 0 * elif 60 <= h < 120: * r, g, b = x, c, 0 # <<<<<<<<<<<<<< * elif 120 <= h < 180: * r, g, b = 0, c, x */ __pyx_t_9 = __pyx_v_x; __pyx_t_8 = __pyx_v_c; __pyx_t_12 = 0.0; __pyx_v_r = __pyx_t_9; __pyx_v_g = __pyx_t_8; __pyx_v_b = __pyx_t_12; /* "pygame_sdl2/color.pyx":396 * if 0 <= h < 60: * r, g, b = c, x, 0 * elif 60 <= h < 120: # <<<<<<<<<<<<<< * r, g, b = x, c, 0 * elif 120 <= h < 180: */ goto __pyx_L8; } /* "pygame_sdl2/color.pyx":398 * elif 60 <= h < 120: * r, g, b = x, c, 0 * elif 120 <= h < 180: # <<<<<<<<<<<<<< * r, g, b = 0, c, x * elif 180 <= h < 240: */ __pyx_t_2 = (120.0 <= __pyx_v_h); if (__pyx_t_2) { __pyx_t_2 = (__pyx_v_h < 180.0); } __pyx_t_13 = (__pyx_t_2 != 0); if (__pyx_t_13) { /* "pygame_sdl2/color.pyx":399 * r, g, b = x, c, 0 * elif 120 <= h < 180: * r, g, b = 0, c, x # <<<<<<<<<<<<<< * elif 180 <= h < 240: * r, g, b = 0, x, c */ __pyx_t_12 = 0.0; __pyx_t_8 = __pyx_v_c; __pyx_t_9 = __pyx_v_x; __pyx_v_r = __pyx_t_12; __pyx_v_g = __pyx_t_8; __pyx_v_b = __pyx_t_9; /* "pygame_sdl2/color.pyx":398 * elif 60 <= h < 120: * r, g, b = x, c, 0 * elif 120 <= h < 180: # <<<<<<<<<<<<<< * r, g, b = 0, c, x * elif 180 <= h < 240: */ goto __pyx_L8; } /* "pygame_sdl2/color.pyx":400 * elif 120 <= h < 180: * r, g, b = 0, c, x * elif 180 <= h < 240: # <<<<<<<<<<<<<< * r, g, b = 0, x, c * elif 240 <= h < 300: */ __pyx_t_13 = (180.0 <= __pyx_v_h); if (__pyx_t_13) { __pyx_t_13 = (__pyx_v_h < 240.0); } __pyx_t_2 = (__pyx_t_13 != 0); if (__pyx_t_2) { /* "pygame_sdl2/color.pyx":401 * r, g, b = 0, c, x * elif 180 <= h < 240: * r, g, b = 0, x, c # <<<<<<<<<<<<<< * elif 240 <= h < 300: * r, g, b = x, 0, c */ __pyx_t_9 = 0.0; __pyx_t_8 = __pyx_v_x; __pyx_t_12 = __pyx_v_c; __pyx_v_r = __pyx_t_9; __pyx_v_g = __pyx_t_8; __pyx_v_b = __pyx_t_12; /* "pygame_sdl2/color.pyx":400 * elif 120 <= h < 180: * r, g, b = 0, c, x * elif 180 <= h < 240: # <<<<<<<<<<<<<< * r, g, b = 0, x, c * elif 240 <= h < 300: */ goto __pyx_L8; } /* "pygame_sdl2/color.pyx":402 * elif 180 <= h < 240: * r, g, b = 0, x, c * elif 240 <= h < 300: # <<<<<<<<<<<<<< * r, g, b = x, 0, c * elif 300 <= h < 360: */ __pyx_t_2 = (240.0 <= __pyx_v_h); if (__pyx_t_2) { __pyx_t_2 = (__pyx_v_h < 300.0); } __pyx_t_13 = (__pyx_t_2 != 0); if (__pyx_t_13) { /* "pygame_sdl2/color.pyx":403 * r, g, b = 0, x, c * elif 240 <= h < 300: * r, g, b = x, 0, c # <<<<<<<<<<<<<< * elif 300 <= h < 360: * r, g, b = c, 0, x */ __pyx_t_12 = __pyx_v_x; __pyx_t_8 = 0.0; __pyx_t_9 = __pyx_v_c; __pyx_v_r = __pyx_t_12; __pyx_v_g = __pyx_t_8; __pyx_v_b = __pyx_t_9; /* "pygame_sdl2/color.pyx":402 * elif 180 <= h < 240: * r, g, b = 0, x, c * elif 240 <= h < 300: # <<<<<<<<<<<<<< * r, g, b = x, 0, c * elif 300 <= h < 360: */ goto __pyx_L8; } /* "pygame_sdl2/color.pyx":404 * elif 240 <= h < 300: * r, g, b = x, 0, c * elif 300 <= h < 360: # <<<<<<<<<<<<<< * r, g, b = c, 0, x * else: */ __pyx_t_13 = (300.0 <= __pyx_v_h); if (__pyx_t_13) { __pyx_t_13 = (__pyx_v_h < 360.0); } __pyx_t_2 = (__pyx_t_13 != 0); if (__pyx_t_2) { /* "pygame_sdl2/color.pyx":405 * r, g, b = x, 0, c * elif 300 <= h < 360: * r, g, b = c, 0, x # <<<<<<<<<<<<<< * else: * raise ValueError() */ __pyx_t_9 = __pyx_v_c; __pyx_t_8 = 0.0; __pyx_t_12 = __pyx_v_x; __pyx_v_r = __pyx_t_9; __pyx_v_g = __pyx_t_8; __pyx_v_b = __pyx_t_12; /* "pygame_sdl2/color.pyx":404 * elif 240 <= h < 300: * r, g, b = x, 0, c * elif 300 <= h < 360: # <<<<<<<<<<<<<< * r, g, b = c, 0, x * else: */ goto __pyx_L8; } /* "pygame_sdl2/color.pyx":407 * r, g, b = c, 0, x * else: * raise ValueError() # <<<<<<<<<<<<<< * * self.r = int(255 * (r + m)) */ /*else*/ { __pyx_t_6 = __Pyx_PyObject_CallNoArg(__pyx_builtin_ValueError); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 407; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_6); __Pyx_Raise(__pyx_t_6, 0, 0, 0); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; {__pyx_filename = __pyx_f[0]; __pyx_lineno = 407; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } __pyx_L8:; /* "pygame_sdl2/color.pyx":409 * raise ValueError() * * self.r = int(255 * (r + m)) # <<<<<<<<<<<<<< * self.g = int(255 * (g + m)) * self.b = int(255 * (b + m)) */ __pyx_v_self->r = ((Uint8)(255.0 * (__pyx_v_r + __pyx_v_m))); /* "pygame_sdl2/color.pyx":410 * * self.r = int(255 * (r + m)) * self.g = int(255 * (g + m)) # <<<<<<<<<<<<<< * self.b = int(255 * (b + m)) * self.a = int(255 * a) */ __pyx_v_self->g = ((Uint8)(255.0 * (__pyx_v_g + __pyx_v_m))); /* "pygame_sdl2/color.pyx":411 * self.r = int(255 * (r + m)) * self.g = int(255 * (g + m)) * self.b = int(255 * (b + m)) # <<<<<<<<<<<<<< * self.a = int(255 * a) * */ __pyx_v_self->b = ((Uint8)(255.0 * (__pyx_v_b + __pyx_v_m))); /* "pygame_sdl2/color.pyx":412 * self.g = int(255 * (g + m)) * self.b = int(255 * (b + m)) * self.a = int(255 * a) # <<<<<<<<<<<<<< * * property i1i2i3: */ __pyx_v_self->a = ((Uint8)(255.0 * __pyx_v_a)); /* "pygame_sdl2/color.pyx":377 * return h, s, l, a * * def __set__(self, val): # <<<<<<<<<<<<<< * cdef double h, s, l, a * if len(val) == 3: */ /* function exit code */ __pyx_r = 0; goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_5); __Pyx_XDECREF(__pyx_t_6); __Pyx_XDECREF(__pyx_t_11); __Pyx_AddTraceback("pygame_sdl2.color.Color.hsla.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = -1; __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/color.pyx":415 * * property i1i2i3: * def __get__(self): # <<<<<<<<<<<<<< * # Take the dot product as described here: * # http://de.wikipedia.org/wiki/I1I2I3-Farbraum */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_5color_5Color_6i1i2i3_1__get__(PyObject *__pyx_v_self); /*proto*/ static PyObject *__pyx_pw_11pygame_sdl2_5color_5Color_6i1i2i3_1__get__(PyObject *__pyx_v_self) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); __pyx_r = __pyx_pf_11pygame_sdl2_5color_5Color_6i1i2i3___get__(((struct __pyx_obj_11pygame_sdl2_5color_Color *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_5color_5Color_6i1i2i3___get__(struct __pyx_obj_11pygame_sdl2_5color_Color *__pyx_v_self) { double __pyx_v_i1; double __pyx_v_i2; double __pyx_v_i3; double __pyx_v_r; double __pyx_v_g; double __pyx_v_b; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__get__", 0); /* "pygame_sdl2/color.pyx":422 * cdef double r, g, b * * r = self.r / 255.0 # <<<<<<<<<<<<<< * g = self.g / 255.0 * b = self.b / 255.0 */ __pyx_v_r = (__pyx_v_self->r / 255.0); /* "pygame_sdl2/color.pyx":423 * * r = self.r / 255.0 * g = self.g / 255.0 # <<<<<<<<<<<<<< * b = self.b / 255.0 * */ __pyx_v_g = (__pyx_v_self->g / 255.0); /* "pygame_sdl2/color.pyx":424 * r = self.r / 255.0 * g = self.g / 255.0 * b = self.b / 255.0 # <<<<<<<<<<<<<< * * i1 = (r + g + b) / 3.0 */ __pyx_v_b = (__pyx_v_self->b / 255.0); /* "pygame_sdl2/color.pyx":426 * b = self.b / 255.0 * * i1 = (r + g + b) / 3.0 # <<<<<<<<<<<<<< * i2 = (r - b) / 2.0 * i3 = (2*g - r - b) / 4.0 */ __pyx_v_i1 = (((__pyx_v_r + __pyx_v_g) + __pyx_v_b) / 3.0); /* "pygame_sdl2/color.pyx":427 * * i1 = (r + g + b) / 3.0 * i2 = (r - b) / 2.0 # <<<<<<<<<<<<<< * i3 = (2*g - r - b) / 4.0 * */ __pyx_v_i2 = ((__pyx_v_r - __pyx_v_b) / 2.0); /* "pygame_sdl2/color.pyx":428 * i1 = (r + g + b) / 3.0 * i2 = (r - b) / 2.0 * i3 = (2*g - r - b) / 4.0 # <<<<<<<<<<<<<< * * return i1, i2, i3 */ __pyx_v_i3 = ((((2.0 * __pyx_v_g) - __pyx_v_r) - __pyx_v_b) / 4.0); /* "pygame_sdl2/color.pyx":430 * i3 = (2*g - r - b) / 4.0 * * return i1, i2, i3 # <<<<<<<<<<<<<< * * def __set__(self, val): */ __Pyx_XDECREF(__pyx_r); __pyx_t_1 = PyFloat_FromDouble(__pyx_v_i1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 430; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = PyFloat_FromDouble(__pyx_v_i2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 430; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = PyFloat_FromDouble(__pyx_v_i3); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 430; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = PyTuple_New(3); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 430; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); __Pyx_GIVEREF(__pyx_t_1); PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_1); __Pyx_GIVEREF(__pyx_t_2); PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_2); __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_4, 2, __pyx_t_3); __pyx_t_1 = 0; __pyx_t_2 = 0; __pyx_t_3 = 0; __pyx_r = __pyx_t_4; __pyx_t_4 = 0; goto __pyx_L0; /* "pygame_sdl2/color.pyx":415 * * property i1i2i3: * def __get__(self): # <<<<<<<<<<<<<< * # Take the dot product as described here: * # http://de.wikipedia.org/wiki/I1I2I3-Farbraum */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_AddTraceback("pygame_sdl2.color.Color.i1i2i3.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/color.pyx":432 * return i1, i2, i3 * * def __set__(self, val): # <<<<<<<<<<<<<< * # Dot product with the inverted matrix. * */ /* Python wrapper */ static int __pyx_pw_11pygame_sdl2_5color_5Color_6i1i2i3_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_val); /*proto*/ static int __pyx_pw_11pygame_sdl2_5color_5Color_6i1i2i3_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_val) { int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__set__ (wrapper)", 0); __pyx_r = __pyx_pf_11pygame_sdl2_5color_5Color_6i1i2i3_2__set__(((struct __pyx_obj_11pygame_sdl2_5color_Color *)__pyx_v_self), ((PyObject *)__pyx_v_val)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static int __pyx_pf_11pygame_sdl2_5color_5Color_6i1i2i3_2__set__(struct __pyx_obj_11pygame_sdl2_5color_Color *__pyx_v_self, PyObject *__pyx_v_val) { double __pyx_v_i1; double __pyx_v_i2; double __pyx_v_i3; double __pyx_v_r; double __pyx_v_g; double __pyx_v_b; int __pyx_r; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; PyObject *(*__pyx_t_5)(PyObject *); double __pyx_t_6; double __pyx_t_7; double __pyx_t_8; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__set__", 0); /* "pygame_sdl2/color.pyx":438 * cdef double r, g, b * * i1, i2, i3 = val # <<<<<<<<<<<<<< * * r = i1 + i2 - (2.0/3.0 * i3) */ if ((likely(PyTuple_CheckExact(__pyx_v_val))) || (PyList_CheckExact(__pyx_v_val))) { PyObject* sequence = __pyx_v_val; #if CYTHON_COMPILING_IN_CPYTHON Py_ssize_t size = Py_SIZE(sequence); #else Py_ssize_t size = PySequence_Size(sequence); #endif if (unlikely(size != 3)) { if (size > 3) __Pyx_RaiseTooManyValuesError(3); else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 438; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } #if CYTHON_COMPILING_IN_CPYTHON if (likely(PyTuple_CheckExact(sequence))) { __pyx_t_1 = PyTuple_GET_ITEM(sequence, 0); __pyx_t_2 = PyTuple_GET_ITEM(sequence, 1); __pyx_t_3 = PyTuple_GET_ITEM(sequence, 2); } else { __pyx_t_1 = PyList_GET_ITEM(sequence, 0); __pyx_t_2 = PyList_GET_ITEM(sequence, 1); __pyx_t_3 = PyList_GET_ITEM(sequence, 2); } __Pyx_INCREF(__pyx_t_1); __Pyx_INCREF(__pyx_t_2); __Pyx_INCREF(__pyx_t_3); #else __pyx_t_1 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 438; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 438; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = PySequence_ITEM(sequence, 2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 438; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); #endif } else { Py_ssize_t index = -1; __pyx_t_4 = PyObject_GetIter(__pyx_v_val); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 438; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); __pyx_t_5 = Py_TYPE(__pyx_t_4)->tp_iternext; index = 0; __pyx_t_1 = __pyx_t_5(__pyx_t_4); if (unlikely(!__pyx_t_1)) goto __pyx_L3_unpacking_failed; __Pyx_GOTREF(__pyx_t_1); index = 1; __pyx_t_2 = __pyx_t_5(__pyx_t_4); if (unlikely(!__pyx_t_2)) goto __pyx_L3_unpacking_failed; __Pyx_GOTREF(__pyx_t_2); index = 2; __pyx_t_3 = __pyx_t_5(__pyx_t_4); if (unlikely(!__pyx_t_3)) goto __pyx_L3_unpacking_failed; __Pyx_GOTREF(__pyx_t_3); if (__Pyx_IternextUnpackEndCheck(__pyx_t_5(__pyx_t_4), 3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 438; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_t_5 = NULL; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; goto __pyx_L4_unpacking_done; __pyx_L3_unpacking_failed:; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_t_5 = NULL; if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 438; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_L4_unpacking_done:; } __pyx_t_6 = __pyx_PyFloat_AsDouble(__pyx_t_1); if (unlikely((__pyx_t_6 == (double)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 438; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_7 = __pyx_PyFloat_AsDouble(__pyx_t_2); if (unlikely((__pyx_t_7 == (double)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 438; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_8 = __pyx_PyFloat_AsDouble(__pyx_t_3); if (unlikely((__pyx_t_8 == (double)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 438; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_v_i1 = __pyx_t_6; __pyx_v_i2 = __pyx_t_7; __pyx_v_i3 = __pyx_t_8; /* "pygame_sdl2/color.pyx":440 * i1, i2, i3 = val * * r = i1 + i2 - (2.0/3.0 * i3) # <<<<<<<<<<<<<< * g = i1 + (4.0/3.0 * i3) * b = i1 - i2 - (2.0/3.0 * i3) */ __pyx_v_r = ((__pyx_v_i1 + __pyx_v_i2) - ((2.0 / 3.0) * __pyx_v_i3)); /* "pygame_sdl2/color.pyx":441 * * r = i1 + i2 - (2.0/3.0 * i3) * g = i1 + (4.0/3.0 * i3) # <<<<<<<<<<<<<< * b = i1 - i2 - (2.0/3.0 * i3) * */ __pyx_v_g = (__pyx_v_i1 + ((4.0 / 3.0) * __pyx_v_i3)); /* "pygame_sdl2/color.pyx":442 * r = i1 + i2 - (2.0/3.0 * i3) * g = i1 + (4.0/3.0 * i3) * b = i1 - i2 - (2.0/3.0 * i3) # <<<<<<<<<<<<<< * * # Don't change alpha. */ __pyx_v_b = ((__pyx_v_i1 - __pyx_v_i2) - ((2.0 / 3.0) * __pyx_v_i3)); /* "pygame_sdl2/color.pyx":445 * * # Don't change alpha. * self.r = int(r * 255) # <<<<<<<<<<<<<< * self.g = int(g * 255) * self.b = int(b * 255) */ __pyx_v_self->r = ((Uint8)(__pyx_v_r * 255.0)); /* "pygame_sdl2/color.pyx":446 * # Don't change alpha. * self.r = int(r * 255) * self.g = int(g * 255) # <<<<<<<<<<<<<< * self.b = int(b * 255) * */ __pyx_v_self->g = ((Uint8)(__pyx_v_g * 255.0)); /* "pygame_sdl2/color.pyx":447 * self.r = int(r * 255) * self.g = int(g * 255) * self.b = int(b * 255) # <<<<<<<<<<<<<< * * def normalize(self): */ __pyx_v_self->b = ((Uint8)(__pyx_v_b * 255.0)); /* "pygame_sdl2/color.pyx":432 * return i1, i2, i3 * * def __set__(self, val): # <<<<<<<<<<<<<< * # Dot product with the inverted matrix. * */ /* function exit code */ __pyx_r = 0; goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_AddTraceback("pygame_sdl2.color.Color.i1i2i3.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = -1; __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/color.pyx":449 * self.b = int(b * 255) * * def normalize(self): # <<<<<<<<<<<<<< * return self.r / 255.0, self.g / 255.0, self.b / 255.0, self.a / 255.0 * */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_5color_5Color_39normalize(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/ static PyObject *__pyx_pw_11pygame_sdl2_5color_5Color_39normalize(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("normalize (wrapper)", 0); __pyx_r = __pyx_pf_11pygame_sdl2_5color_5Color_38normalize(((struct __pyx_obj_11pygame_sdl2_5color_Color *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_5color_5Color_38normalize(struct __pyx_obj_11pygame_sdl2_5color_Color *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; PyObject *__pyx_t_5 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("normalize", 0); /* "pygame_sdl2/color.pyx":450 * * def normalize(self): * return self.r / 255.0, self.g / 255.0, self.b / 255.0, self.a / 255.0 # <<<<<<<<<<<<<< * * def correct_gamma(self, gamma): */ __Pyx_XDECREF(__pyx_r); __pyx_t_1 = PyFloat_FromDouble((__pyx_v_self->r / 255.0)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 450; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = PyFloat_FromDouble((__pyx_v_self->g / 255.0)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 450; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = PyFloat_FromDouble((__pyx_v_self->b / 255.0)); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 450; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = PyFloat_FromDouble((__pyx_v_self->a / 255.0)); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 450; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); __pyx_t_5 = PyTuple_New(4); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 450; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); __Pyx_GIVEREF(__pyx_t_1); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_1); __Pyx_GIVEREF(__pyx_t_2); PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_t_2); __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_5, 2, __pyx_t_3); __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_5, 3, __pyx_t_4); __pyx_t_1 = 0; __pyx_t_2 = 0; __pyx_t_3 = 0; __pyx_t_4 = 0; __pyx_r = __pyx_t_5; __pyx_t_5 = 0; goto __pyx_L0; /* "pygame_sdl2/color.pyx":449 * self.b = int(b * 255) * * def normalize(self): # <<<<<<<<<<<<<< * return self.r / 255.0, self.g / 255.0, self.b / 255.0, self.a / 255.0 * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_5); __Pyx_AddTraceback("pygame_sdl2.color.Color.normalize", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/color.pyx":452 * return self.r / 255.0, self.g / 255.0, self.b / 255.0, self.a / 255.0 * * def correct_gamma(self, gamma): # <<<<<<<<<<<<<< * m = map(lambda x: int(round(pow(x / 255.0, gamma) * 255)), tuple(self)) * c = type(self)(tuple(m)) */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_5color_5Color_41correct_gamma(PyObject *__pyx_v_self, PyObject *__pyx_v_gamma); /*proto*/ static PyObject *__pyx_pw_11pygame_sdl2_5color_5Color_41correct_gamma(PyObject *__pyx_v_self, PyObject *__pyx_v_gamma) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("correct_gamma (wrapper)", 0); __pyx_r = __pyx_pf_11pygame_sdl2_5color_5Color_40correct_gamma(((struct __pyx_obj_11pygame_sdl2_5color_Color *)__pyx_v_self), ((PyObject *)__pyx_v_gamma)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/color.pyx":453 * * def correct_gamma(self, gamma): * m = map(lambda x: int(round(pow(x / 255.0, gamma) * 255)), tuple(self)) # <<<<<<<<<<<<<< * c = type(self)(tuple(m)) * return c */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_5color_5Color_13correct_gamma_lambda1(PyObject *__pyx_self, PyObject *__pyx_v_x); /*proto*/ static PyMethodDef __pyx_mdef_11pygame_sdl2_5color_5Color_13correct_gamma_lambda1 = {"lambda1", (PyCFunction)__pyx_pw_11pygame_sdl2_5color_5Color_13correct_gamma_lambda1, METH_O, 0}; static PyObject *__pyx_pw_11pygame_sdl2_5color_5Color_13correct_gamma_lambda1(PyObject *__pyx_self, PyObject *__pyx_v_x) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("lambda1 (wrapper)", 0); __pyx_r = __pyx_lambda_funcdef_lambda1(__pyx_self, ((PyObject *)__pyx_v_x)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_lambda_funcdef_lambda1(PyObject *__pyx_self, PyObject *__pyx_v_x) { struct __pyx_obj_11pygame_sdl2_5color___pyx_scope_struct__correct_gamma *__pyx_cur_scope; struct __pyx_obj_11pygame_sdl2_5color___pyx_scope_struct__correct_gamma *__pyx_outer_scope; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("lambda1", 0); __pyx_outer_scope = (struct __pyx_obj_11pygame_sdl2_5color___pyx_scope_struct__correct_gamma *) __Pyx_CyFunction_GetClosure(__pyx_self); __pyx_cur_scope = __pyx_outer_scope; __Pyx_XDECREF(__pyx_r); __pyx_t_1 = __Pyx_PyFloat_DivideObjC(__pyx_v_x, __pyx_float_255_0, 255.0, 0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 453; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); if (unlikely(!__pyx_cur_scope->__pyx_v_gamma)) { __Pyx_RaiseClosureNameError("gamma"); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 453; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } __pyx_t_2 = __pyx_cur_scope->__pyx_v_gamma; __Pyx_INCREF(__pyx_t_2); __pyx_t_3 = __Pyx_PyNumber_Power2(__pyx_t_1, __pyx_t_2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 453; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_2 = PyNumber_Multiply(__pyx_t_3, __pyx_int_255); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 453; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 453; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __Pyx_GIVEREF(__pyx_t_2); PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_2); __pyx_t_2 = 0; __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_round, __pyx_t_3, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 453; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_3 = PyNumber_Int(__pyx_t_2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 453; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_r = __pyx_t_3; __pyx_t_3 = 0; goto __pyx_L0; /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("pygame_sdl2.color.Color.correct_gamma.lambda1", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/color.pyx":452 * return self.r / 255.0, self.g / 255.0, self.b / 255.0, self.a / 255.0 * * def correct_gamma(self, gamma): # <<<<<<<<<<<<<< * m = map(lambda x: int(round(pow(x / 255.0, gamma) * 255)), tuple(self)) * c = type(self)(tuple(m)) */ static PyObject *__pyx_pf_11pygame_sdl2_5color_5Color_40correct_gamma(struct __pyx_obj_11pygame_sdl2_5color_Color *__pyx_v_self, PyObject *__pyx_v_gamma) { struct __pyx_obj_11pygame_sdl2_5color___pyx_scope_struct__correct_gamma *__pyx_cur_scope; PyObject *__pyx_v_m = NULL; PyObject *__pyx_v_c = NULL; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; PyObject *__pyx_t_5 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("correct_gamma", 0); __pyx_cur_scope = (struct __pyx_obj_11pygame_sdl2_5color___pyx_scope_struct__correct_gamma *)__pyx_tp_new_11pygame_sdl2_5color___pyx_scope_struct__correct_gamma(__pyx_ptype_11pygame_sdl2_5color___pyx_scope_struct__correct_gamma, __pyx_empty_tuple, NULL); if (unlikely(!__pyx_cur_scope)) { __Pyx_RefNannyFinishContext(); return NULL; } __Pyx_GOTREF(__pyx_cur_scope); __pyx_cur_scope->__pyx_v_gamma = __pyx_v_gamma; __Pyx_INCREF(__pyx_cur_scope->__pyx_v_gamma); __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_gamma); /* "pygame_sdl2/color.pyx":453 * * def correct_gamma(self, gamma): * m = map(lambda x: int(round(pow(x / 255.0, gamma) * 255)), tuple(self)) # <<<<<<<<<<<<<< * c = type(self)(tuple(m)) * return c */ __pyx_t_1 = __Pyx_CyFunction_NewEx(&__pyx_mdef_11pygame_sdl2_5color_5Color_13correct_gamma_lambda1, 0, __pyx_n_s_correct_gamma_locals_lambda, ((PyObject*)__pyx_cur_scope), __pyx_n_s_pygame_sdl2_color, __pyx_d, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 453; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = PySequence_Tuple(((PyObject *)__pyx_v_self)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 453; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 453; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __Pyx_GIVEREF(__pyx_t_1); PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_1); __Pyx_GIVEREF(__pyx_t_2); PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_2); __pyx_t_1 = 0; __pyx_t_2 = 0; __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_map, __pyx_t_3, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 453; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_v_m = __pyx_t_2; __pyx_t_2 = 0; /* "pygame_sdl2/color.pyx":454 * def correct_gamma(self, gamma): * m = map(lambda x: int(round(pow(x / 255.0, gamma) * 255)), tuple(self)) * c = type(self)(tuple(m)) # <<<<<<<<<<<<<< * return c * */ __pyx_t_3 = PySequence_Tuple(__pyx_v_m); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 454; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __Pyx_INCREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self)))); __pyx_t_1 = ((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))); __pyx_t_4 = NULL; if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_1))) { __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_1); if (likely(__pyx_t_4)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1); __Pyx_INCREF(__pyx_t_4); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_1, function); } } if (!__pyx_t_4) { __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_1, __pyx_t_3); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 454; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_GOTREF(__pyx_t_2); } else { __pyx_t_5 = PyTuple_New(1+1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 454; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_4); __pyx_t_4 = NULL; __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_5, 0+1, __pyx_t_3); __pyx_t_3 = 0; __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_5, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 454; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_v_c = __pyx_t_2; __pyx_t_2 = 0; /* "pygame_sdl2/color.pyx":455 * m = map(lambda x: int(round(pow(x / 255.0, gamma) * 255)), tuple(self)) * c = type(self)(tuple(m)) * return c # <<<<<<<<<<<<<< * * def set_length(self, n): */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(__pyx_v_c); __pyx_r = __pyx_v_c; goto __pyx_L0; /* "pygame_sdl2/color.pyx":452 * return self.r / 255.0, self.g / 255.0, self.b / 255.0, self.a / 255.0 * * def correct_gamma(self, gamma): # <<<<<<<<<<<<<< * m = map(lambda x: int(round(pow(x / 255.0, gamma) * 255)), tuple(self)) * c = type(self)(tuple(m)) */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_5); __Pyx_AddTraceback("pygame_sdl2.color.Color.correct_gamma", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF(__pyx_v_m); __Pyx_XDECREF(__pyx_v_c); __Pyx_DECREF(((PyObject *)__pyx_cur_scope)); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/color.pyx":457 * return c * * def set_length(self, n): # <<<<<<<<<<<<<< * if n > 4 or n < 1: * raise ValueError(n) */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_5color_5Color_43set_length(PyObject *__pyx_v_self, PyObject *__pyx_v_n); /*proto*/ static PyObject *__pyx_pw_11pygame_sdl2_5color_5Color_43set_length(PyObject *__pyx_v_self, PyObject *__pyx_v_n) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("set_length (wrapper)", 0); __pyx_r = __pyx_pf_11pygame_sdl2_5color_5Color_42set_length(((struct __pyx_obj_11pygame_sdl2_5color_Color *)__pyx_v_self), ((PyObject *)__pyx_v_n)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_5color_5Color_42set_length(struct __pyx_obj_11pygame_sdl2_5color_Color *__pyx_v_self, PyObject *__pyx_v_n) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; PyObject *__pyx_t_2 = NULL; int __pyx_t_3; PyObject *__pyx_t_4 = NULL; uint8_t __pyx_t_5; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("set_length", 0); /* "pygame_sdl2/color.pyx":458 * * def set_length(self, n): * if n > 4 or n < 1: # <<<<<<<<<<<<<< * raise ValueError(n) * self.length = n */ __pyx_t_2 = PyObject_RichCompare(__pyx_v_n, __pyx_int_4, Py_GT); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 458; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 458; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; if (!__pyx_t_3) { } else { __pyx_t_1 = __pyx_t_3; goto __pyx_L4_bool_binop_done; } __pyx_t_2 = PyObject_RichCompare(__pyx_v_n, __pyx_int_1, Py_LT); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 458; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 458; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_1 = __pyx_t_3; __pyx_L4_bool_binop_done:; if (__pyx_t_1) { /* "pygame_sdl2/color.pyx":459 * def set_length(self, n): * if n > 4 or n < 1: * raise ValueError(n) # <<<<<<<<<<<<<< * self.length = n */ __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 459; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __Pyx_INCREF(__pyx_v_n); __Pyx_GIVEREF(__pyx_v_n); PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_n); __pyx_t_4 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_t_2, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 459; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_Raise(__pyx_t_4, 0, 0, 0); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; {__pyx_filename = __pyx_f[0]; __pyx_lineno = 459; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "pygame_sdl2/color.pyx":458 * * def set_length(self, n): * if n > 4 or n < 1: # <<<<<<<<<<<<<< * raise ValueError(n) * self.length = n */ } /* "pygame_sdl2/color.pyx":460 * if n > 4 or n < 1: * raise ValueError(n) * self.length = n # <<<<<<<<<<<<<< */ __pyx_t_5 = __Pyx_PyInt_As_uint8_t(__pyx_v_n); if (unlikely((__pyx_t_5 == (uint8_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 460; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_v_self->length = __pyx_t_5; /* "pygame_sdl2/color.pyx":457 * return c * * def set_length(self, n): # <<<<<<<<<<<<<< * if n > 4 or n < 1: * raise ValueError(n) */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_4); __Pyx_AddTraceback("pygame_sdl2.color.Color.set_length", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/color.pxd":30 * cdef object __weakref__ * * cdef public Uint8 r, g, b, a # <<<<<<<<<<<<<< * cdef uint8_t length * */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_5color_5Color_1r_1__get__(PyObject *__pyx_v_self); /*proto*/ static PyObject *__pyx_pw_11pygame_sdl2_5color_5Color_1r_1__get__(PyObject *__pyx_v_self) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); __pyx_r = __pyx_pf_11pygame_sdl2_5color_5Color_1r___get__(((struct __pyx_obj_11pygame_sdl2_5color_Color *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_5color_5Color_1r___get__(struct __pyx_obj_11pygame_sdl2_5color_Color *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__get__", 0); __Pyx_XDECREF(__pyx_r); __pyx_t_1 = __Pyx_PyInt_From_uint8_t(__pyx_v_self->r); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 30; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("pygame_sdl2.color.Color.r.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* Python wrapper */ static int __pyx_pw_11pygame_sdl2_5color_5Color_1r_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/ static int __pyx_pw_11pygame_sdl2_5color_5Color_1r_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) { int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__set__ (wrapper)", 0); __pyx_r = __pyx_pf_11pygame_sdl2_5color_5Color_1r_2__set__(((struct __pyx_obj_11pygame_sdl2_5color_Color *)__pyx_v_self), ((PyObject *)__pyx_v_value)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static int __pyx_pf_11pygame_sdl2_5color_5Color_1r_2__set__(struct __pyx_obj_11pygame_sdl2_5color_Color *__pyx_v_self, PyObject *__pyx_v_value) { int __pyx_r; __Pyx_RefNannyDeclarations Uint8 __pyx_t_1; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__set__", 0); __pyx_t_1 = __Pyx_PyInt_As_uint8_t(__pyx_v_value); if (unlikely((__pyx_t_1 == (Uint8)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 30; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_v_self->r = __pyx_t_1; /* function exit code */ __pyx_r = 0; goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("pygame_sdl2.color.Color.r.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = -1; __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; } /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_5color_5Color_1g_1__get__(PyObject *__pyx_v_self); /*proto*/ static PyObject *__pyx_pw_11pygame_sdl2_5color_5Color_1g_1__get__(PyObject *__pyx_v_self) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); __pyx_r = __pyx_pf_11pygame_sdl2_5color_5Color_1g___get__(((struct __pyx_obj_11pygame_sdl2_5color_Color *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_5color_5Color_1g___get__(struct __pyx_obj_11pygame_sdl2_5color_Color *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__get__", 0); __Pyx_XDECREF(__pyx_r); __pyx_t_1 = __Pyx_PyInt_From_uint8_t(__pyx_v_self->g); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 30; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("pygame_sdl2.color.Color.g.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* Python wrapper */ static int __pyx_pw_11pygame_sdl2_5color_5Color_1g_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/ static int __pyx_pw_11pygame_sdl2_5color_5Color_1g_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) { int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__set__ (wrapper)", 0); __pyx_r = __pyx_pf_11pygame_sdl2_5color_5Color_1g_2__set__(((struct __pyx_obj_11pygame_sdl2_5color_Color *)__pyx_v_self), ((PyObject *)__pyx_v_value)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static int __pyx_pf_11pygame_sdl2_5color_5Color_1g_2__set__(struct __pyx_obj_11pygame_sdl2_5color_Color *__pyx_v_self, PyObject *__pyx_v_value) { int __pyx_r; __Pyx_RefNannyDeclarations Uint8 __pyx_t_1; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__set__", 0); __pyx_t_1 = __Pyx_PyInt_As_uint8_t(__pyx_v_value); if (unlikely((__pyx_t_1 == (Uint8)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 30; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_v_self->g = __pyx_t_1; /* function exit code */ __pyx_r = 0; goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("pygame_sdl2.color.Color.g.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = -1; __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; } /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_5color_5Color_1b_1__get__(PyObject *__pyx_v_self); /*proto*/ static PyObject *__pyx_pw_11pygame_sdl2_5color_5Color_1b_1__get__(PyObject *__pyx_v_self) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); __pyx_r = __pyx_pf_11pygame_sdl2_5color_5Color_1b___get__(((struct __pyx_obj_11pygame_sdl2_5color_Color *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_5color_5Color_1b___get__(struct __pyx_obj_11pygame_sdl2_5color_Color *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__get__", 0); __Pyx_XDECREF(__pyx_r); __pyx_t_1 = __Pyx_PyInt_From_uint8_t(__pyx_v_self->b); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 30; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("pygame_sdl2.color.Color.b.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* Python wrapper */ static int __pyx_pw_11pygame_sdl2_5color_5Color_1b_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/ static int __pyx_pw_11pygame_sdl2_5color_5Color_1b_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) { int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__set__ (wrapper)", 0); __pyx_r = __pyx_pf_11pygame_sdl2_5color_5Color_1b_2__set__(((struct __pyx_obj_11pygame_sdl2_5color_Color *)__pyx_v_self), ((PyObject *)__pyx_v_value)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static int __pyx_pf_11pygame_sdl2_5color_5Color_1b_2__set__(struct __pyx_obj_11pygame_sdl2_5color_Color *__pyx_v_self, PyObject *__pyx_v_value) { int __pyx_r; __Pyx_RefNannyDeclarations Uint8 __pyx_t_1; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__set__", 0); __pyx_t_1 = __Pyx_PyInt_As_uint8_t(__pyx_v_value); if (unlikely((__pyx_t_1 == (Uint8)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 30; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_v_self->b = __pyx_t_1; /* function exit code */ __pyx_r = 0; goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("pygame_sdl2.color.Color.b.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = -1; __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; } /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_5color_5Color_1a_1__get__(PyObject *__pyx_v_self); /*proto*/ static PyObject *__pyx_pw_11pygame_sdl2_5color_5Color_1a_1__get__(PyObject *__pyx_v_self) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); __pyx_r = __pyx_pf_11pygame_sdl2_5color_5Color_1a___get__(((struct __pyx_obj_11pygame_sdl2_5color_Color *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_5color_5Color_1a___get__(struct __pyx_obj_11pygame_sdl2_5color_Color *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__get__", 0); __Pyx_XDECREF(__pyx_r); __pyx_t_1 = __Pyx_PyInt_From_uint8_t(__pyx_v_self->a); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 30; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("pygame_sdl2.color.Color.a.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* Python wrapper */ static int __pyx_pw_11pygame_sdl2_5color_5Color_1a_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/ static int __pyx_pw_11pygame_sdl2_5color_5Color_1a_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) { int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__set__ (wrapper)", 0); __pyx_r = __pyx_pf_11pygame_sdl2_5color_5Color_1a_2__set__(((struct __pyx_obj_11pygame_sdl2_5color_Color *)__pyx_v_self), ((PyObject *)__pyx_v_value)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static int __pyx_pf_11pygame_sdl2_5color_5Color_1a_2__set__(struct __pyx_obj_11pygame_sdl2_5color_Color *__pyx_v_self, PyObject *__pyx_v_value) { int __pyx_r; __Pyx_RefNannyDeclarations Uint8 __pyx_t_1; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__set__", 0); __pyx_t_1 = __Pyx_PyInt_As_uint8_t(__pyx_v_value); if (unlikely((__pyx_t_1 == (Uint8)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 30; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_v_self->a = __pyx_t_1; /* function exit code */ __pyx_r = 0; goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("pygame_sdl2.color.Color.a.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = -1; __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; } static struct __pyx_vtabstruct_11pygame_sdl2_5color_Color __pyx_vtable_11pygame_sdl2_5color_Color; static PyObject *__pyx_tp_new_11pygame_sdl2_5color_Color(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) { struct __pyx_obj_11pygame_sdl2_5color_Color *p; PyObject *o; if (likely((t->tp_flags & Py_TPFLAGS_IS_ABSTRACT) == 0)) { o = (*t->tp_alloc)(t, 0); } else { o = (PyObject *) PyBaseObject_Type.tp_new(t, __pyx_empty_tuple, 0); } if (unlikely(!o)) return 0; p = ((struct __pyx_obj_11pygame_sdl2_5color_Color *)o); p->__pyx_vtab = __pyx_vtabptr_11pygame_sdl2_5color_Color; if (unlikely(__pyx_pw_11pygame_sdl2_5color_5Color_3__cinit__(o, __pyx_empty_tuple, NULL) < 0)) { Py_DECREF(o); o = 0; } return o; } static void __pyx_tp_dealloc_11pygame_sdl2_5color_Color(PyObject *o) { struct __pyx_obj_11pygame_sdl2_5color_Color *p = (struct __pyx_obj_11pygame_sdl2_5color_Color *)o; #if PY_VERSION_HEX >= 0x030400a1 if (unlikely(Py_TYPE(o)->tp_finalize) && (!PyType_IS_GC(Py_TYPE(o)) || !_PyGC_FINALIZED(o))) { if (PyObject_CallFinalizerFromDealloc(o)) return; } #endif if (p->__weakref__) PyObject_ClearWeakRefs(o); (*Py_TYPE(o)->tp_free)(o); } static PyObject *__pyx_sq_item_11pygame_sdl2_5color_Color(PyObject *o, Py_ssize_t i) { PyObject *r; PyObject *x = PyInt_FromSsize_t(i); if(!x) return 0; r = Py_TYPE(o)->tp_as_mapping->mp_subscript(o, x); Py_DECREF(x); return r; } static int __pyx_mp_ass_subscript_11pygame_sdl2_5color_Color(PyObject *o, PyObject *i, PyObject *v) { if (v) { return __pyx_pw_11pygame_sdl2_5color_5Color_21__setitem__(o, i, v); } else { PyErr_Format(PyExc_NotImplementedError, "Subscript deletion not supported by %.200s", Py_TYPE(o)->tp_name); return -1; } } static PyObject *__pyx_getprop_11pygame_sdl2_5color_5Color_cmy(PyObject *o, CYTHON_UNUSED void *x) { return __pyx_pw_11pygame_sdl2_5color_5Color_3cmy_1__get__(o); } static int __pyx_setprop_11pygame_sdl2_5color_5Color_cmy(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) { if (v) { return __pyx_pw_11pygame_sdl2_5color_5Color_3cmy_3__set__(o, v); } else { PyErr_SetString(PyExc_NotImplementedError, "__del__"); return -1; } } static PyObject *__pyx_getprop_11pygame_sdl2_5color_5Color_hsva(PyObject *o, CYTHON_UNUSED void *x) { return __pyx_pw_11pygame_sdl2_5color_5Color_4hsva_1__get__(o); } static int __pyx_setprop_11pygame_sdl2_5color_5Color_hsva(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) { if (v) { return __pyx_pw_11pygame_sdl2_5color_5Color_4hsva_3__set__(o, v); } else { PyErr_SetString(PyExc_NotImplementedError, "__del__"); return -1; } } static PyObject *__pyx_getprop_11pygame_sdl2_5color_5Color_hsla(PyObject *o, CYTHON_UNUSED void *x) { return __pyx_pw_11pygame_sdl2_5color_5Color_4hsla_1__get__(o); } static int __pyx_setprop_11pygame_sdl2_5color_5Color_hsla(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) { if (v) { return __pyx_pw_11pygame_sdl2_5color_5Color_4hsla_3__set__(o, v); } else { PyErr_SetString(PyExc_NotImplementedError, "__del__"); return -1; } } static PyObject *__pyx_getprop_11pygame_sdl2_5color_5Color_i1i2i3(PyObject *o, CYTHON_UNUSED void *x) { return __pyx_pw_11pygame_sdl2_5color_5Color_6i1i2i3_1__get__(o); } static int __pyx_setprop_11pygame_sdl2_5color_5Color_i1i2i3(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) { if (v) { return __pyx_pw_11pygame_sdl2_5color_5Color_6i1i2i3_3__set__(o, v); } else { PyErr_SetString(PyExc_NotImplementedError, "__del__"); return -1; } } static PyObject *__pyx_getprop_11pygame_sdl2_5color_5Color_r(PyObject *o, CYTHON_UNUSED void *x) { return __pyx_pw_11pygame_sdl2_5color_5Color_1r_1__get__(o); } static int __pyx_setprop_11pygame_sdl2_5color_5Color_r(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) { if (v) { return __pyx_pw_11pygame_sdl2_5color_5Color_1r_3__set__(o, v); } else { PyErr_SetString(PyExc_NotImplementedError, "__del__"); return -1; } } static PyObject *__pyx_getprop_11pygame_sdl2_5color_5Color_g(PyObject *o, CYTHON_UNUSED void *x) { return __pyx_pw_11pygame_sdl2_5color_5Color_1g_1__get__(o); } static int __pyx_setprop_11pygame_sdl2_5color_5Color_g(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) { if (v) { return __pyx_pw_11pygame_sdl2_5color_5Color_1g_3__set__(o, v); } else { PyErr_SetString(PyExc_NotImplementedError, "__del__"); return -1; } } static PyObject *__pyx_getprop_11pygame_sdl2_5color_5Color_b(PyObject *o, CYTHON_UNUSED void *x) { return __pyx_pw_11pygame_sdl2_5color_5Color_1b_1__get__(o); } static int __pyx_setprop_11pygame_sdl2_5color_5Color_b(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) { if (v) { return __pyx_pw_11pygame_sdl2_5color_5Color_1b_3__set__(o, v); } else { PyErr_SetString(PyExc_NotImplementedError, "__del__"); return -1; } } static PyObject *__pyx_getprop_11pygame_sdl2_5color_5Color_a(PyObject *o, CYTHON_UNUSED void *x) { return __pyx_pw_11pygame_sdl2_5color_5Color_1a_1__get__(o); } static int __pyx_setprop_11pygame_sdl2_5color_5Color_a(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) { if (v) { return __pyx_pw_11pygame_sdl2_5color_5Color_1a_3__set__(o, v); } else { PyErr_SetString(PyExc_NotImplementedError, "__del__"); return -1; } } static PyMethodDef __pyx_methods_11pygame_sdl2_5color_Color[] = { {"__reduce__", (PyCFunction)__pyx_pw_11pygame_sdl2_5color_5Color_17__reduce__, METH_NOARGS, 0}, {"__setstate__", (PyCFunction)__pyx_pw_11pygame_sdl2_5color_5Color_19__setstate__, METH_O, 0}, {"normalize", (PyCFunction)__pyx_pw_11pygame_sdl2_5color_5Color_39normalize, METH_NOARGS, 0}, {"correct_gamma", (PyCFunction)__pyx_pw_11pygame_sdl2_5color_5Color_41correct_gamma, METH_O, 0}, {"set_length", (PyCFunction)__pyx_pw_11pygame_sdl2_5color_5Color_43set_length, METH_O, 0}, {0, 0, 0, 0} }; static struct PyGetSetDef __pyx_getsets_11pygame_sdl2_5color_Color[] = { {(char *)"cmy", __pyx_getprop_11pygame_sdl2_5color_5Color_cmy, __pyx_setprop_11pygame_sdl2_5color_5Color_cmy, 0, 0}, {(char *)"hsva", __pyx_getprop_11pygame_sdl2_5color_5Color_hsva, __pyx_setprop_11pygame_sdl2_5color_5Color_hsva, 0, 0}, {(char *)"hsla", __pyx_getprop_11pygame_sdl2_5color_5Color_hsla, __pyx_setprop_11pygame_sdl2_5color_5Color_hsla, 0, 0}, {(char *)"i1i2i3", __pyx_getprop_11pygame_sdl2_5color_5Color_i1i2i3, __pyx_setprop_11pygame_sdl2_5color_5Color_i1i2i3, 0, 0}, {(char *)"r", __pyx_getprop_11pygame_sdl2_5color_5Color_r, __pyx_setprop_11pygame_sdl2_5color_5Color_r, 0, 0}, {(char *)"g", __pyx_getprop_11pygame_sdl2_5color_5Color_g, __pyx_setprop_11pygame_sdl2_5color_5Color_g, 0, 0}, {(char *)"b", __pyx_getprop_11pygame_sdl2_5color_5Color_b, __pyx_setprop_11pygame_sdl2_5color_5Color_b, 0, 0}, {(char *)"a", __pyx_getprop_11pygame_sdl2_5color_5Color_a, __pyx_setprop_11pygame_sdl2_5color_5Color_a, 0, 0}, {0, 0, 0, 0, 0} }; static PyNumberMethods __pyx_tp_as_number_Color = { __pyx_pw_11pygame_sdl2_5color_5Color_29__add__, /*nb_add*/ __pyx_pw_11pygame_sdl2_5color_5Color_31__sub__, /*nb_subtract*/ __pyx_pw_11pygame_sdl2_5color_5Color_27__mul__, /*nb_multiply*/ #if PY_MAJOR_VERSION < 3 || CYTHON_COMPILING_IN_PYPY __pyx_pw_11pygame_sdl2_5color_5Color_35__div__, /*nb_divide*/ #endif __pyx_pw_11pygame_sdl2_5color_5Color_33__mod__, /*nb_remainder*/ 0, /*nb_divmod*/ 0, /*nb_power*/ 0, /*nb_negative*/ 0, /*nb_positive*/ 0, /*nb_absolute*/ 0, /*nb_nonzero*/ 0, /*nb_invert*/ 0, /*nb_lshift*/ 0, /*nb_rshift*/ 0, /*nb_and*/ 0, /*nb_xor*/ 0, /*nb_or*/ #if PY_MAJOR_VERSION < 3 || CYTHON_COMPILING_IN_PYPY 0, /*nb_coerce*/ #endif __pyx_pw_11pygame_sdl2_5color_5Color_9__int__, /*nb_int*/ #if PY_MAJOR_VERSION < 3 __pyx_pw_11pygame_sdl2_5color_5Color_9__int__, /*nb_long*/ #else 0, /*reserved*/ #endif __pyx_pw_11pygame_sdl2_5color_5Color_15__float__, /*nb_float*/ #if PY_MAJOR_VERSION < 3 || CYTHON_COMPILING_IN_PYPY __pyx_pw_11pygame_sdl2_5color_5Color_13__oct__, /*nb_oct*/ #endif #if PY_MAJOR_VERSION < 3 || CYTHON_COMPILING_IN_PYPY __pyx_pw_11pygame_sdl2_5color_5Color_11__hex__, /*nb_hex*/ #endif 0, /*nb_inplace_add*/ 0, /*nb_inplace_subtract*/ 0, /*nb_inplace_multiply*/ #if PY_MAJOR_VERSION < 3 || CYTHON_COMPILING_IN_PYPY 0, /*nb_inplace_divide*/ #endif 0, /*nb_inplace_remainder*/ 0, /*nb_inplace_power*/ 0, /*nb_inplace_lshift*/ 0, /*nb_inplace_rshift*/ 0, /*nb_inplace_and*/ 0, /*nb_inplace_xor*/ 0, /*nb_inplace_or*/ __pyx_pw_11pygame_sdl2_5color_5Color_37__floordiv__, /*nb_floor_divide*/ 0, /*nb_true_divide*/ 0, /*nb_inplace_floor_divide*/ 0, /*nb_inplace_true_divide*/ 0, /*nb_index*/ #if PY_VERSION_HEX >= 0x03050000 0, /*nb_matrix_multiply*/ #endif #if PY_VERSION_HEX >= 0x03050000 0, /*nb_inplace_matrix_multiply*/ #endif }; static PySequenceMethods __pyx_tp_as_sequence_Color = { __pyx_pw_11pygame_sdl2_5color_5Color_25__len__, /*sq_length*/ 0, /*sq_concat*/ 0, /*sq_repeat*/ __pyx_sq_item_11pygame_sdl2_5color_Color, /*sq_item*/ 0, /*sq_slice*/ 0, /*sq_ass_item*/ 0, /*sq_ass_slice*/ 0, /*sq_contains*/ 0, /*sq_inplace_concat*/ 0, /*sq_inplace_repeat*/ }; static PyMappingMethods __pyx_tp_as_mapping_Color = { __pyx_pw_11pygame_sdl2_5color_5Color_25__len__, /*mp_length*/ __pyx_pw_11pygame_sdl2_5color_5Color_23__getitem__, /*mp_subscript*/ __pyx_mp_ass_subscript_11pygame_sdl2_5color_Color, /*mp_ass_subscript*/ }; static PyTypeObject __pyx_type_11pygame_sdl2_5color_Color = { PyVarObject_HEAD_INIT(0, 0) "pygame_sdl2.color.Color", /*tp_name*/ sizeof(struct __pyx_obj_11pygame_sdl2_5color_Color), /*tp_basicsize*/ 0, /*tp_itemsize*/ __pyx_tp_dealloc_11pygame_sdl2_5color_Color, /*tp_dealloc*/ 0, /*tp_print*/ 0, /*tp_getattr*/ 0, /*tp_setattr*/ #if PY_MAJOR_VERSION < 3 0, /*tp_compare*/ #endif #if PY_MAJOR_VERSION >= 3 0, /*tp_as_async*/ #endif __pyx_pw_11pygame_sdl2_5color_5Color_7__repr__, /*tp_repr*/ &__pyx_tp_as_number_Color, /*tp_as_number*/ &__pyx_tp_as_sequence_Color, /*tp_as_sequence*/ &__pyx_tp_as_mapping_Color, /*tp_as_mapping*/ 0, /*tp_hash*/ 0, /*tp_call*/ 0, /*tp_str*/ 0, /*tp_getattro*/ 0, /*tp_setattro*/ 0, /*tp_as_buffer*/ Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE, /*tp_flags*/ 0, /*tp_doc*/ 0, /*tp_traverse*/ 0, /*tp_clear*/ __pyx_pw_11pygame_sdl2_5color_5Color_1__richcmp__, /*tp_richcompare*/ 0, /*tp_weaklistoffset*/ 0, /*tp_iter*/ 0, /*tp_iternext*/ __pyx_methods_11pygame_sdl2_5color_Color, /*tp_methods*/ 0, /*tp_members*/ __pyx_getsets_11pygame_sdl2_5color_Color, /*tp_getset*/ 0, /*tp_base*/ 0, /*tp_dict*/ 0, /*tp_descr_get*/ 0, /*tp_descr_set*/ 0, /*tp_dictoffset*/ __pyx_pw_11pygame_sdl2_5color_5Color_5__init__, /*tp_init*/ 0, /*tp_alloc*/ __pyx_tp_new_11pygame_sdl2_5color_Color, /*tp_new*/ 0, /*tp_free*/ 0, /*tp_is_gc*/ 0, /*tp_bases*/ 0, /*tp_mro*/ 0, /*tp_cache*/ 0, /*tp_subclasses*/ 0, /*tp_weaklist*/ 0, /*tp_del*/ 0, /*tp_version_tag*/ #if PY_VERSION_HEX >= 0x030400a1 0, /*tp_finalize*/ #endif }; static struct __pyx_obj_11pygame_sdl2_5color___pyx_scope_struct__correct_gamma *__pyx_freelist_11pygame_sdl2_5color___pyx_scope_struct__correct_gamma[8]; static int __pyx_freecount_11pygame_sdl2_5color___pyx_scope_struct__correct_gamma = 0; static PyObject *__pyx_tp_new_11pygame_sdl2_5color___pyx_scope_struct__correct_gamma(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) { PyObject *o; if (CYTHON_COMPILING_IN_CPYTHON && likely((__pyx_freecount_11pygame_sdl2_5color___pyx_scope_struct__correct_gamma > 0) & (t->tp_basicsize == sizeof(struct __pyx_obj_11pygame_sdl2_5color___pyx_scope_struct__correct_gamma)))) { o = (PyObject*)__pyx_freelist_11pygame_sdl2_5color___pyx_scope_struct__correct_gamma[--__pyx_freecount_11pygame_sdl2_5color___pyx_scope_struct__correct_gamma]; memset(o, 0, sizeof(struct __pyx_obj_11pygame_sdl2_5color___pyx_scope_struct__correct_gamma)); (void) PyObject_INIT(o, t); PyObject_GC_Track(o); } else { o = (*t->tp_alloc)(t, 0); if (unlikely(!o)) return 0; } return o; } static void __pyx_tp_dealloc_11pygame_sdl2_5color___pyx_scope_struct__correct_gamma(PyObject *o) { struct __pyx_obj_11pygame_sdl2_5color___pyx_scope_struct__correct_gamma *p = (struct __pyx_obj_11pygame_sdl2_5color___pyx_scope_struct__correct_gamma *)o; PyObject_GC_UnTrack(o); Py_CLEAR(p->__pyx_v_gamma); if (CYTHON_COMPILING_IN_CPYTHON && ((__pyx_freecount_11pygame_sdl2_5color___pyx_scope_struct__correct_gamma < 8) & (Py_TYPE(o)->tp_basicsize == sizeof(struct __pyx_obj_11pygame_sdl2_5color___pyx_scope_struct__correct_gamma)))) { __pyx_freelist_11pygame_sdl2_5color___pyx_scope_struct__correct_gamma[__pyx_freecount_11pygame_sdl2_5color___pyx_scope_struct__correct_gamma++] = ((struct __pyx_obj_11pygame_sdl2_5color___pyx_scope_struct__correct_gamma *)o); } else { (*Py_TYPE(o)->tp_free)(o); } } static int __pyx_tp_traverse_11pygame_sdl2_5color___pyx_scope_struct__correct_gamma(PyObject *o, visitproc v, void *a) { int e; struct __pyx_obj_11pygame_sdl2_5color___pyx_scope_struct__correct_gamma *p = (struct __pyx_obj_11pygame_sdl2_5color___pyx_scope_struct__correct_gamma *)o; if (p->__pyx_v_gamma) { e = (*v)(p->__pyx_v_gamma, a); if (e) return e; } return 0; } static int __pyx_tp_clear_11pygame_sdl2_5color___pyx_scope_struct__correct_gamma(PyObject *o) { PyObject* tmp; struct __pyx_obj_11pygame_sdl2_5color___pyx_scope_struct__correct_gamma *p = (struct __pyx_obj_11pygame_sdl2_5color___pyx_scope_struct__correct_gamma *)o; tmp = ((PyObject*)p->__pyx_v_gamma); p->__pyx_v_gamma = Py_None; Py_INCREF(Py_None); Py_XDECREF(tmp); return 0; } static PyTypeObject __pyx_type_11pygame_sdl2_5color___pyx_scope_struct__correct_gamma = { PyVarObject_HEAD_INIT(0, 0) "pygame_sdl2.color.__pyx_scope_struct__correct_gamma", /*tp_name*/ sizeof(struct __pyx_obj_11pygame_sdl2_5color___pyx_scope_struct__correct_gamma), /*tp_basicsize*/ 0, /*tp_itemsize*/ __pyx_tp_dealloc_11pygame_sdl2_5color___pyx_scope_struct__correct_gamma, /*tp_dealloc*/ 0, /*tp_print*/ 0, /*tp_getattr*/ 0, /*tp_setattr*/ #if PY_MAJOR_VERSION < 3 0, /*tp_compare*/ #endif #if PY_MAJOR_VERSION >= 3 0, /*tp_as_async*/ #endif 0, /*tp_repr*/ 0, /*tp_as_number*/ 0, /*tp_as_sequence*/ 0, /*tp_as_mapping*/ 0, /*tp_hash*/ 0, /*tp_call*/ 0, /*tp_str*/ 0, /*tp_getattro*/ 0, /*tp_setattro*/ 0, /*tp_as_buffer*/ Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC, /*tp_flags*/ 0, /*tp_doc*/ __pyx_tp_traverse_11pygame_sdl2_5color___pyx_scope_struct__correct_gamma, /*tp_traverse*/ __pyx_tp_clear_11pygame_sdl2_5color___pyx_scope_struct__correct_gamma, /*tp_clear*/ 0, /*tp_richcompare*/ 0, /*tp_weaklistoffset*/ 0, /*tp_iter*/ 0, /*tp_iternext*/ 0, /*tp_methods*/ 0, /*tp_members*/ 0, /*tp_getset*/ 0, /*tp_base*/ 0, /*tp_dict*/ 0, /*tp_descr_get*/ 0, /*tp_descr_set*/ 0, /*tp_dictoffset*/ 0, /*tp_init*/ 0, /*tp_alloc*/ __pyx_tp_new_11pygame_sdl2_5color___pyx_scope_struct__correct_gamma, /*tp_new*/ 0, /*tp_free*/ 0, /*tp_is_gc*/ 0, /*tp_bases*/ 0, /*tp_mro*/ 0, /*tp_cache*/ 0, /*tp_subclasses*/ 0, /*tp_weaklist*/ 0, /*tp_del*/ 0, /*tp_version_tag*/ #if PY_VERSION_HEX >= 0x030400a1 0, /*tp_finalize*/ #endif }; static PyMethodDef __pyx_methods[] = { {0, 0, 0, 0} }; #if PY_MAJOR_VERSION >= 3 static struct PyModuleDef __pyx_moduledef = { #if PY_VERSION_HEX < 0x03020000 { PyObject_HEAD_INIT(NULL) NULL, 0, NULL }, #else PyModuleDef_HEAD_INIT, #endif "color", 0, /* m_doc */ -1, /* m_size */ __pyx_methods /* m_methods */, NULL, /* m_reload */ NULL, /* m_traverse */ NULL, /* m_clear */ NULL /* m_free */ }; #endif static __Pyx_StringTabEntry __pyx_string_tab[] = { {&__pyx_kp_s_08x, __pyx_k_08x, sizeof(__pyx_k_08x), 0, 0, 1, 0}, {&__pyx_kp_s_0x, __pyx_k_0x, sizeof(__pyx_k_0x), 0, 0, 1, 0}, {&__pyx_n_s_BBB, __pyx_k_BBB, sizeof(__pyx_k_BBB), 0, 0, 1, 1}, {&__pyx_n_s_BBBB, __pyx_k_BBBB, sizeof(__pyx_k_BBBB), 0, 0, 1, 1}, {&__pyx_n_s_Color_from_hex_locals_lambda, __pyx_k_Color_from_hex_locals_lambda, sizeof(__pyx_k_Color_from_hex_locals_lambda), 0, 0, 1, 1}, {&__pyx_kp_s_Expected_a_color, __pyx_k_Expected_a_color, sizeof(__pyx_k_Expected_a_color), 0, 0, 1, 0}, {&__pyx_n_s_IndexError, __pyx_k_IndexError, sizeof(__pyx_k_IndexError), 0, 0, 1, 1}, {&__pyx_n_s_KeyError, __pyx_k_KeyError, sizeof(__pyx_k_KeyError), 0, 0, 1, 1}, {&__pyx_kp_s_L, __pyx_k_L, sizeof(__pyx_k_L), 0, 0, 1, 0}, {&__pyx_n_s_TypeError, __pyx_k_TypeError, sizeof(__pyx_k_TypeError), 0, 0, 1, 1}, {&__pyx_n_s_ValueError, __pyx_k_ValueError, sizeof(__pyx_k_ValueError), 0, 0, 1, 1}, {&__pyx_kp_s__2, __pyx_k__2, sizeof(__pyx_k__2), 0, 0, 1, 0}, {&__pyx_kp_s__3, __pyx_k__3, sizeof(__pyx_k__3), 0, 0, 1, 0}, {&__pyx_n_s_a, __pyx_k_a, sizeof(__pyx_k_a), 0, 0, 1, 1}, {&__pyx_n_s_aliceblue, __pyx_k_aliceblue, sizeof(__pyx_k_aliceblue), 0, 0, 1, 1}, {&__pyx_n_s_antiquewhite, __pyx_k_antiquewhite, sizeof(__pyx_k_antiquewhite), 0, 0, 1, 1}, {&__pyx_n_s_antiquewhite1, __pyx_k_antiquewhite1, sizeof(__pyx_k_antiquewhite1), 0, 0, 1, 1}, {&__pyx_n_s_antiquewhite2, __pyx_k_antiquewhite2, sizeof(__pyx_k_antiquewhite2), 0, 0, 1, 1}, {&__pyx_n_s_antiquewhite3, __pyx_k_antiquewhite3, sizeof(__pyx_k_antiquewhite3), 0, 0, 1, 1}, {&__pyx_n_s_antiquewhite4, __pyx_k_antiquewhite4, sizeof(__pyx_k_antiquewhite4), 0, 0, 1, 1}, {&__pyx_n_s_aqua, __pyx_k_aqua, sizeof(__pyx_k_aqua), 0, 0, 1, 1}, {&__pyx_n_s_aquamarine, __pyx_k_aquamarine, sizeof(__pyx_k_aquamarine), 0, 0, 1, 1}, {&__pyx_n_s_aquamarine1, __pyx_k_aquamarine1, sizeof(__pyx_k_aquamarine1), 0, 0, 1, 1}, {&__pyx_n_s_aquamarine2, __pyx_k_aquamarine2, sizeof(__pyx_k_aquamarine2), 0, 0, 1, 1}, {&__pyx_n_s_aquamarine3, __pyx_k_aquamarine3, sizeof(__pyx_k_aquamarine3), 0, 0, 1, 1}, {&__pyx_n_s_aquamarine4, __pyx_k_aquamarine4, sizeof(__pyx_k_aquamarine4), 0, 0, 1, 1}, {&__pyx_n_s_azure, __pyx_k_azure, sizeof(__pyx_k_azure), 0, 0, 1, 1}, {&__pyx_n_s_azure1, __pyx_k_azure1, sizeof(__pyx_k_azure1), 0, 0, 1, 1}, {&__pyx_n_s_azure2, __pyx_k_azure2, sizeof(__pyx_k_azure2), 0, 0, 1, 1}, {&__pyx_n_s_azure3, __pyx_k_azure3, sizeof(__pyx_k_azure3), 0, 0, 1, 1}, {&__pyx_n_s_azure4, __pyx_k_azure4, sizeof(__pyx_k_azure4), 0, 0, 1, 1}, {&__pyx_n_s_b, __pyx_k_b, sizeof(__pyx_k_b), 0, 0, 1, 1}, {&__pyx_n_s_beige, __pyx_k_beige, sizeof(__pyx_k_beige), 0, 0, 1, 1}, {&__pyx_n_s_binascii, __pyx_k_binascii, sizeof(__pyx_k_binascii), 0, 0, 1, 1}, {&__pyx_n_s_bisque, __pyx_k_bisque, sizeof(__pyx_k_bisque), 0, 0, 1, 1}, {&__pyx_n_s_bisque1, __pyx_k_bisque1, sizeof(__pyx_k_bisque1), 0, 0, 1, 1}, {&__pyx_n_s_bisque2, __pyx_k_bisque2, sizeof(__pyx_k_bisque2), 0, 0, 1, 1}, {&__pyx_n_s_bisque3, __pyx_k_bisque3, sizeof(__pyx_k_bisque3), 0, 0, 1, 1}, {&__pyx_n_s_bisque4, __pyx_k_bisque4, sizeof(__pyx_k_bisque4), 0, 0, 1, 1}, {&__pyx_n_s_black, __pyx_k_black, sizeof(__pyx_k_black), 0, 0, 1, 1}, {&__pyx_n_s_blanchedalmond, __pyx_k_blanchedalmond, sizeof(__pyx_k_blanchedalmond), 0, 0, 1, 1}, {&__pyx_n_s_blue, __pyx_k_blue, sizeof(__pyx_k_blue), 0, 0, 1, 1}, {&__pyx_n_s_blue1, __pyx_k_blue1, sizeof(__pyx_k_blue1), 0, 0, 1, 1}, {&__pyx_n_s_blue2, __pyx_k_blue2, sizeof(__pyx_k_blue2), 0, 0, 1, 1}, {&__pyx_n_s_blue3, __pyx_k_blue3, sizeof(__pyx_k_blue3), 0, 0, 1, 1}, {&__pyx_n_s_blue4, __pyx_k_blue4, sizeof(__pyx_k_blue4), 0, 0, 1, 1}, {&__pyx_n_s_blueviolet, __pyx_k_blueviolet, sizeof(__pyx_k_blueviolet), 0, 0, 1, 1}, {&__pyx_n_s_brown, __pyx_k_brown, sizeof(__pyx_k_brown), 0, 0, 1, 1}, {&__pyx_n_s_brown1, __pyx_k_brown1, sizeof(__pyx_k_brown1), 0, 0, 1, 1}, {&__pyx_n_s_brown2, __pyx_k_brown2, sizeof(__pyx_k_brown2), 0, 0, 1, 1}, {&__pyx_n_s_brown3, __pyx_k_brown3, sizeof(__pyx_k_brown3), 0, 0, 1, 1}, {&__pyx_n_s_brown4, __pyx_k_brown4, sizeof(__pyx_k_brown4), 0, 0, 1, 1}, {&__pyx_n_s_burlywood, __pyx_k_burlywood, sizeof(__pyx_k_burlywood), 0, 0, 1, 1}, {&__pyx_n_s_burlywood1, __pyx_k_burlywood1, sizeof(__pyx_k_burlywood1), 0, 0, 1, 1}, {&__pyx_n_s_burlywood2, __pyx_k_burlywood2, sizeof(__pyx_k_burlywood2), 0, 0, 1, 1}, {&__pyx_n_s_burlywood3, __pyx_k_burlywood3, sizeof(__pyx_k_burlywood3), 0, 0, 1, 1}, {&__pyx_n_s_burlywood4, __pyx_k_burlywood4, sizeof(__pyx_k_burlywood4), 0, 0, 1, 1}, {&__pyx_n_s_cadetblue, __pyx_k_cadetblue, sizeof(__pyx_k_cadetblue), 0, 0, 1, 1}, {&__pyx_n_s_cadetblue1, __pyx_k_cadetblue1, sizeof(__pyx_k_cadetblue1), 0, 0, 1, 1}, {&__pyx_n_s_cadetblue2, __pyx_k_cadetblue2, sizeof(__pyx_k_cadetblue2), 0, 0, 1, 1}, {&__pyx_n_s_cadetblue3, __pyx_k_cadetblue3, sizeof(__pyx_k_cadetblue3), 0, 0, 1, 1}, {&__pyx_n_s_cadetblue4, __pyx_k_cadetblue4, sizeof(__pyx_k_cadetblue4), 0, 0, 1, 1}, {&__pyx_n_s_chartreuse, __pyx_k_chartreuse, sizeof(__pyx_k_chartreuse), 0, 0, 1, 1}, {&__pyx_n_s_chartreuse1, __pyx_k_chartreuse1, sizeof(__pyx_k_chartreuse1), 0, 0, 1, 1}, {&__pyx_n_s_chartreuse2, __pyx_k_chartreuse2, sizeof(__pyx_k_chartreuse2), 0, 0, 1, 1}, {&__pyx_n_s_chartreuse3, __pyx_k_chartreuse3, sizeof(__pyx_k_chartreuse3), 0, 0, 1, 1}, {&__pyx_n_s_chartreuse4, __pyx_k_chartreuse4, sizeof(__pyx_k_chartreuse4), 0, 0, 1, 1}, {&__pyx_n_s_chocolate, __pyx_k_chocolate, sizeof(__pyx_k_chocolate), 0, 0, 1, 1}, {&__pyx_n_s_chocolate1, __pyx_k_chocolate1, sizeof(__pyx_k_chocolate1), 0, 0, 1, 1}, {&__pyx_n_s_chocolate2, __pyx_k_chocolate2, sizeof(__pyx_k_chocolate2), 0, 0, 1, 1}, {&__pyx_n_s_chocolate3, __pyx_k_chocolate3, sizeof(__pyx_k_chocolate3), 0, 0, 1, 1}, {&__pyx_n_s_chocolate4, __pyx_k_chocolate4, sizeof(__pyx_k_chocolate4), 0, 0, 1, 1}, {&__pyx_n_s_coral, __pyx_k_coral, sizeof(__pyx_k_coral), 0, 0, 1, 1}, {&__pyx_n_s_coral1, __pyx_k_coral1, sizeof(__pyx_k_coral1), 0, 0, 1, 1}, {&__pyx_n_s_coral2, __pyx_k_coral2, sizeof(__pyx_k_coral2), 0, 0, 1, 1}, {&__pyx_n_s_coral3, __pyx_k_coral3, sizeof(__pyx_k_coral3), 0, 0, 1, 1}, {&__pyx_n_s_coral4, __pyx_k_coral4, sizeof(__pyx_k_coral4), 0, 0, 1, 1}, {&__pyx_n_s_cornflowerblue, __pyx_k_cornflowerblue, sizeof(__pyx_k_cornflowerblue), 0, 0, 1, 1}, {&__pyx_n_s_cornsilk, __pyx_k_cornsilk, sizeof(__pyx_k_cornsilk), 0, 0, 1, 1}, {&__pyx_n_s_cornsilk1, __pyx_k_cornsilk1, sizeof(__pyx_k_cornsilk1), 0, 0, 1, 1}, {&__pyx_n_s_cornsilk2, __pyx_k_cornsilk2, sizeof(__pyx_k_cornsilk2), 0, 0, 1, 1}, {&__pyx_n_s_cornsilk3, __pyx_k_cornsilk3, sizeof(__pyx_k_cornsilk3), 0, 0, 1, 1}, {&__pyx_n_s_cornsilk4, __pyx_k_cornsilk4, sizeof(__pyx_k_cornsilk4), 0, 0, 1, 1}, {&__pyx_n_s_correct_gamma_locals_lambda, __pyx_k_correct_gamma_locals_lambda, sizeof(__pyx_k_correct_gamma_locals_lambda), 0, 0, 1, 1}, {&__pyx_n_s_crimson, __pyx_k_crimson, sizeof(__pyx_k_crimson), 0, 0, 1, 1}, {&__pyx_n_s_cyan, __pyx_k_cyan, sizeof(__pyx_k_cyan), 0, 0, 1, 1}, {&__pyx_n_s_cyan1, __pyx_k_cyan1, sizeof(__pyx_k_cyan1), 0, 0, 1, 1}, {&__pyx_n_s_cyan2, __pyx_k_cyan2, sizeof(__pyx_k_cyan2), 0, 0, 1, 1}, {&__pyx_n_s_cyan3, __pyx_k_cyan3, sizeof(__pyx_k_cyan3), 0, 0, 1, 1}, {&__pyx_n_s_cyan4, __pyx_k_cyan4, sizeof(__pyx_k_cyan4), 0, 0, 1, 1}, {&__pyx_n_s_darkblue, __pyx_k_darkblue, sizeof(__pyx_k_darkblue), 0, 0, 1, 1}, {&__pyx_n_s_darkcyan, __pyx_k_darkcyan, sizeof(__pyx_k_darkcyan), 0, 0, 1, 1}, {&__pyx_n_s_darkgoldenrod, __pyx_k_darkgoldenrod, sizeof(__pyx_k_darkgoldenrod), 0, 0, 1, 1}, {&__pyx_n_s_darkgoldenrod1, __pyx_k_darkgoldenrod1, sizeof(__pyx_k_darkgoldenrod1), 0, 0, 1, 1}, {&__pyx_n_s_darkgoldenrod2, __pyx_k_darkgoldenrod2, sizeof(__pyx_k_darkgoldenrod2), 0, 0, 1, 1}, {&__pyx_n_s_darkgoldenrod3, __pyx_k_darkgoldenrod3, sizeof(__pyx_k_darkgoldenrod3), 0, 0, 1, 1}, {&__pyx_n_s_darkgoldenrod4, __pyx_k_darkgoldenrod4, sizeof(__pyx_k_darkgoldenrod4), 0, 0, 1, 1}, {&__pyx_n_s_darkgray, __pyx_k_darkgray, sizeof(__pyx_k_darkgray), 0, 0, 1, 1}, {&__pyx_n_s_darkgreen, __pyx_k_darkgreen, sizeof(__pyx_k_darkgreen), 0, 0, 1, 1}, {&__pyx_n_s_darkgrey, __pyx_k_darkgrey, sizeof(__pyx_k_darkgrey), 0, 0, 1, 1}, {&__pyx_n_s_darkkhaki, __pyx_k_darkkhaki, sizeof(__pyx_k_darkkhaki), 0, 0, 1, 1}, {&__pyx_n_s_darkmagenta, __pyx_k_darkmagenta, sizeof(__pyx_k_darkmagenta), 0, 0, 1, 1}, {&__pyx_n_s_darkolivegreen, __pyx_k_darkolivegreen, sizeof(__pyx_k_darkolivegreen), 0, 0, 1, 1}, {&__pyx_n_s_darkolivegreen1, __pyx_k_darkolivegreen1, sizeof(__pyx_k_darkolivegreen1), 0, 0, 1, 1}, {&__pyx_n_s_darkolivegreen2, __pyx_k_darkolivegreen2, sizeof(__pyx_k_darkolivegreen2), 0, 0, 1, 1}, {&__pyx_n_s_darkolivegreen3, __pyx_k_darkolivegreen3, sizeof(__pyx_k_darkolivegreen3), 0, 0, 1, 1}, {&__pyx_n_s_darkolivegreen4, __pyx_k_darkolivegreen4, sizeof(__pyx_k_darkolivegreen4), 0, 0, 1, 1}, {&__pyx_n_s_darkorange, __pyx_k_darkorange, sizeof(__pyx_k_darkorange), 0, 0, 1, 1}, {&__pyx_n_s_darkorange1, __pyx_k_darkorange1, sizeof(__pyx_k_darkorange1), 0, 0, 1, 1}, {&__pyx_n_s_darkorange2, __pyx_k_darkorange2, sizeof(__pyx_k_darkorange2), 0, 0, 1, 1}, {&__pyx_n_s_darkorange3, __pyx_k_darkorange3, sizeof(__pyx_k_darkorange3), 0, 0, 1, 1}, {&__pyx_n_s_darkorange4, __pyx_k_darkorange4, sizeof(__pyx_k_darkorange4), 0, 0, 1, 1}, {&__pyx_n_s_darkorchid, __pyx_k_darkorchid, sizeof(__pyx_k_darkorchid), 0, 0, 1, 1}, {&__pyx_n_s_darkorchid1, __pyx_k_darkorchid1, sizeof(__pyx_k_darkorchid1), 0, 0, 1, 1}, {&__pyx_n_s_darkorchid2, __pyx_k_darkorchid2, sizeof(__pyx_k_darkorchid2), 0, 0, 1, 1}, {&__pyx_n_s_darkorchid3, __pyx_k_darkorchid3, sizeof(__pyx_k_darkorchid3), 0, 0, 1, 1}, {&__pyx_n_s_darkorchid4, __pyx_k_darkorchid4, sizeof(__pyx_k_darkorchid4), 0, 0, 1, 1}, {&__pyx_n_s_darkred, __pyx_k_darkred, sizeof(__pyx_k_darkred), 0, 0, 1, 1}, {&__pyx_n_s_darksalmon, __pyx_k_darksalmon, sizeof(__pyx_k_darksalmon), 0, 0, 1, 1}, {&__pyx_n_s_darkseagreen, __pyx_k_darkseagreen, sizeof(__pyx_k_darkseagreen), 0, 0, 1, 1}, {&__pyx_n_s_darkseagreen1, __pyx_k_darkseagreen1, sizeof(__pyx_k_darkseagreen1), 0, 0, 1, 1}, {&__pyx_n_s_darkseagreen2, __pyx_k_darkseagreen2, sizeof(__pyx_k_darkseagreen2), 0, 0, 1, 1}, {&__pyx_n_s_darkseagreen3, __pyx_k_darkseagreen3, sizeof(__pyx_k_darkseagreen3), 0, 0, 1, 1}, {&__pyx_n_s_darkseagreen4, __pyx_k_darkseagreen4, sizeof(__pyx_k_darkseagreen4), 0, 0, 1, 1}, {&__pyx_n_s_darkslateblue, __pyx_k_darkslateblue, sizeof(__pyx_k_darkslateblue), 0, 0, 1, 1}, {&__pyx_n_s_darkslategray, __pyx_k_darkslategray, sizeof(__pyx_k_darkslategray), 0, 0, 1, 1}, {&__pyx_n_s_darkslategray1, __pyx_k_darkslategray1, sizeof(__pyx_k_darkslategray1), 0, 0, 1, 1}, {&__pyx_n_s_darkslategray2, __pyx_k_darkslategray2, sizeof(__pyx_k_darkslategray2), 0, 0, 1, 1}, {&__pyx_n_s_darkslategray3, __pyx_k_darkslategray3, sizeof(__pyx_k_darkslategray3), 0, 0, 1, 1}, {&__pyx_n_s_darkslategray4, __pyx_k_darkslategray4, sizeof(__pyx_k_darkslategray4), 0, 0, 1, 1}, {&__pyx_n_s_darkslategrey, __pyx_k_darkslategrey, sizeof(__pyx_k_darkslategrey), 0, 0, 1, 1}, {&__pyx_n_s_darkturquoise, __pyx_k_darkturquoise, sizeof(__pyx_k_darkturquoise), 0, 0, 1, 1}, {&__pyx_n_s_darkviolet, __pyx_k_darkviolet, sizeof(__pyx_k_darkviolet), 0, 0, 1, 1}, {&__pyx_n_s_deeppink, __pyx_k_deeppink, sizeof(__pyx_k_deeppink), 0, 0, 1, 1}, {&__pyx_n_s_deeppink1, __pyx_k_deeppink1, sizeof(__pyx_k_deeppink1), 0, 0, 1, 1}, {&__pyx_n_s_deeppink2, __pyx_k_deeppink2, sizeof(__pyx_k_deeppink2), 0, 0, 1, 1}, {&__pyx_n_s_deeppink3, __pyx_k_deeppink3, sizeof(__pyx_k_deeppink3), 0, 0, 1, 1}, {&__pyx_n_s_deeppink4, __pyx_k_deeppink4, sizeof(__pyx_k_deeppink4), 0, 0, 1, 1}, {&__pyx_n_s_deepskyblue, __pyx_k_deepskyblue, sizeof(__pyx_k_deepskyblue), 0, 0, 1, 1}, {&__pyx_n_s_deepskyblue1, __pyx_k_deepskyblue1, sizeof(__pyx_k_deepskyblue1), 0, 0, 1, 1}, {&__pyx_n_s_deepskyblue2, __pyx_k_deepskyblue2, sizeof(__pyx_k_deepskyblue2), 0, 0, 1, 1}, {&__pyx_n_s_deepskyblue3, __pyx_k_deepskyblue3, sizeof(__pyx_k_deepskyblue3), 0, 0, 1, 1}, {&__pyx_n_s_deepskyblue4, __pyx_k_deepskyblue4, sizeof(__pyx_k_deepskyblue4), 0, 0, 1, 1}, {&__pyx_n_s_dimgray, __pyx_k_dimgray, sizeof(__pyx_k_dimgray), 0, 0, 1, 1}, {&__pyx_n_s_dimgrey, __pyx_k_dimgrey, sizeof(__pyx_k_dimgrey), 0, 0, 1, 1}, {&__pyx_n_s_div, __pyx_k_div, sizeof(__pyx_k_div), 0, 0, 1, 1}, {&__pyx_n_s_dodgerblue, __pyx_k_dodgerblue, sizeof(__pyx_k_dodgerblue), 0, 0, 1, 1}, {&__pyx_n_s_dodgerblue1, __pyx_k_dodgerblue1, sizeof(__pyx_k_dodgerblue1), 0, 0, 1, 1}, {&__pyx_n_s_dodgerblue2, __pyx_k_dodgerblue2, sizeof(__pyx_k_dodgerblue2), 0, 0, 1, 1}, {&__pyx_n_s_dodgerblue3, __pyx_k_dodgerblue3, sizeof(__pyx_k_dodgerblue3), 0, 0, 1, 1}, {&__pyx_n_s_dodgerblue4, __pyx_k_dodgerblue4, sizeof(__pyx_k_dodgerblue4), 0, 0, 1, 1}, {&__pyx_n_s_firebrick, __pyx_k_firebrick, sizeof(__pyx_k_firebrick), 0, 0, 1, 1}, {&__pyx_n_s_firebrick1, __pyx_k_firebrick1, sizeof(__pyx_k_firebrick1), 0, 0, 1, 1}, {&__pyx_n_s_firebrick2, __pyx_k_firebrick2, sizeof(__pyx_k_firebrick2), 0, 0, 1, 1}, {&__pyx_n_s_firebrick3, __pyx_k_firebrick3, sizeof(__pyx_k_firebrick3), 0, 0, 1, 1}, {&__pyx_n_s_firebrick4, __pyx_k_firebrick4, sizeof(__pyx_k_firebrick4), 0, 0, 1, 1}, {&__pyx_n_s_floordiv___locals_div, __pyx_k_floordiv___locals_div, sizeof(__pyx_k_floordiv___locals_div), 0, 0, 1, 1}, {&__pyx_n_s_floralwhite, __pyx_k_floralwhite, sizeof(__pyx_k_floralwhite), 0, 0, 1, 1}, {&__pyx_n_s_forestgreen, __pyx_k_forestgreen, sizeof(__pyx_k_forestgreen), 0, 0, 1, 1}, {&__pyx_n_s_fuchsia, __pyx_k_fuchsia, sizeof(__pyx_k_fuchsia), 0, 0, 1, 1}, {&__pyx_n_s_g, __pyx_k_g, sizeof(__pyx_k_g), 0, 0, 1, 1}, {&__pyx_n_s_gainsboro, __pyx_k_gainsboro, sizeof(__pyx_k_gainsboro), 0, 0, 1, 1}, {&__pyx_n_s_ghostwhite, __pyx_k_ghostwhite, sizeof(__pyx_k_ghostwhite), 0, 0, 1, 1}, {&__pyx_n_s_gold, __pyx_k_gold, sizeof(__pyx_k_gold), 0, 0, 1, 1}, {&__pyx_n_s_gold1, __pyx_k_gold1, sizeof(__pyx_k_gold1), 0, 0, 1, 1}, {&__pyx_n_s_gold2, __pyx_k_gold2, sizeof(__pyx_k_gold2), 0, 0, 1, 1}, {&__pyx_n_s_gold3, __pyx_k_gold3, sizeof(__pyx_k_gold3), 0, 0, 1, 1}, {&__pyx_n_s_gold4, __pyx_k_gold4, sizeof(__pyx_k_gold4), 0, 0, 1, 1}, {&__pyx_n_s_goldenrod, __pyx_k_goldenrod, sizeof(__pyx_k_goldenrod), 0, 0, 1, 1}, {&__pyx_n_s_goldenrod1, __pyx_k_goldenrod1, sizeof(__pyx_k_goldenrod1), 0, 0, 1, 1}, {&__pyx_n_s_goldenrod2, __pyx_k_goldenrod2, sizeof(__pyx_k_goldenrod2), 0, 0, 1, 1}, {&__pyx_n_s_goldenrod3, __pyx_k_goldenrod3, sizeof(__pyx_k_goldenrod3), 0, 0, 1, 1}, {&__pyx_n_s_goldenrod4, __pyx_k_goldenrod4, sizeof(__pyx_k_goldenrod4), 0, 0, 1, 1}, {&__pyx_n_s_gray, __pyx_k_gray, sizeof(__pyx_k_gray), 0, 0, 1, 1}, {&__pyx_n_s_gray0, __pyx_k_gray0, sizeof(__pyx_k_gray0), 0, 0, 1, 1}, {&__pyx_n_s_gray1, __pyx_k_gray1, sizeof(__pyx_k_gray1), 0, 0, 1, 1}, {&__pyx_n_s_gray10, __pyx_k_gray10, sizeof(__pyx_k_gray10), 0, 0, 1, 1}, {&__pyx_n_s_gray100, __pyx_k_gray100, sizeof(__pyx_k_gray100), 0, 0, 1, 1}, {&__pyx_n_s_gray11, __pyx_k_gray11, sizeof(__pyx_k_gray11), 0, 0, 1, 1}, {&__pyx_n_s_gray12, __pyx_k_gray12, sizeof(__pyx_k_gray12), 0, 0, 1, 1}, {&__pyx_n_s_gray13, __pyx_k_gray13, sizeof(__pyx_k_gray13), 0, 0, 1, 1}, {&__pyx_n_s_gray14, __pyx_k_gray14, sizeof(__pyx_k_gray14), 0, 0, 1, 1}, {&__pyx_n_s_gray15, __pyx_k_gray15, sizeof(__pyx_k_gray15), 0, 0, 1, 1}, {&__pyx_n_s_gray16, __pyx_k_gray16, sizeof(__pyx_k_gray16), 0, 0, 1, 1}, {&__pyx_n_s_gray17, __pyx_k_gray17, sizeof(__pyx_k_gray17), 0, 0, 1, 1}, {&__pyx_n_s_gray18, __pyx_k_gray18, sizeof(__pyx_k_gray18), 0, 0, 1, 1}, {&__pyx_n_s_gray19, __pyx_k_gray19, sizeof(__pyx_k_gray19), 0, 0, 1, 1}, {&__pyx_n_s_gray2, __pyx_k_gray2, sizeof(__pyx_k_gray2), 0, 0, 1, 1}, {&__pyx_n_s_gray20, __pyx_k_gray20, sizeof(__pyx_k_gray20), 0, 0, 1, 1}, {&__pyx_n_s_gray21, __pyx_k_gray21, sizeof(__pyx_k_gray21), 0, 0, 1, 1}, {&__pyx_n_s_gray22, __pyx_k_gray22, sizeof(__pyx_k_gray22), 0, 0, 1, 1}, {&__pyx_n_s_gray23, __pyx_k_gray23, sizeof(__pyx_k_gray23), 0, 0, 1, 1}, {&__pyx_n_s_gray24, __pyx_k_gray24, sizeof(__pyx_k_gray24), 0, 0, 1, 1}, {&__pyx_n_s_gray25, __pyx_k_gray25, sizeof(__pyx_k_gray25), 0, 0, 1, 1}, {&__pyx_n_s_gray26, __pyx_k_gray26, sizeof(__pyx_k_gray26), 0, 0, 1, 1}, {&__pyx_n_s_gray27, __pyx_k_gray27, sizeof(__pyx_k_gray27), 0, 0, 1, 1}, {&__pyx_n_s_gray28, __pyx_k_gray28, sizeof(__pyx_k_gray28), 0, 0, 1, 1}, {&__pyx_n_s_gray29, __pyx_k_gray29, sizeof(__pyx_k_gray29), 0, 0, 1, 1}, {&__pyx_n_s_gray3, __pyx_k_gray3, sizeof(__pyx_k_gray3), 0, 0, 1, 1}, {&__pyx_n_s_gray30, __pyx_k_gray30, sizeof(__pyx_k_gray30), 0, 0, 1, 1}, {&__pyx_n_s_gray31, __pyx_k_gray31, sizeof(__pyx_k_gray31), 0, 0, 1, 1}, {&__pyx_n_s_gray32, __pyx_k_gray32, sizeof(__pyx_k_gray32), 0, 0, 1, 1}, {&__pyx_n_s_gray33, __pyx_k_gray33, sizeof(__pyx_k_gray33), 0, 0, 1, 1}, {&__pyx_n_s_gray34, __pyx_k_gray34, sizeof(__pyx_k_gray34), 0, 0, 1, 1}, {&__pyx_n_s_gray35, __pyx_k_gray35, sizeof(__pyx_k_gray35), 0, 0, 1, 1}, {&__pyx_n_s_gray36, __pyx_k_gray36, sizeof(__pyx_k_gray36), 0, 0, 1, 1}, {&__pyx_n_s_gray37, __pyx_k_gray37, sizeof(__pyx_k_gray37), 0, 0, 1, 1}, {&__pyx_n_s_gray38, __pyx_k_gray38, sizeof(__pyx_k_gray38), 0, 0, 1, 1}, {&__pyx_n_s_gray39, __pyx_k_gray39, sizeof(__pyx_k_gray39), 0, 0, 1, 1}, {&__pyx_n_s_gray4, __pyx_k_gray4, sizeof(__pyx_k_gray4), 0, 0, 1, 1}, {&__pyx_n_s_gray40, __pyx_k_gray40, sizeof(__pyx_k_gray40), 0, 0, 1, 1}, {&__pyx_n_s_gray41, __pyx_k_gray41, sizeof(__pyx_k_gray41), 0, 0, 1, 1}, {&__pyx_n_s_gray42, __pyx_k_gray42, sizeof(__pyx_k_gray42), 0, 0, 1, 1}, {&__pyx_n_s_gray43, __pyx_k_gray43, sizeof(__pyx_k_gray43), 0, 0, 1, 1}, {&__pyx_n_s_gray44, __pyx_k_gray44, sizeof(__pyx_k_gray44), 0, 0, 1, 1}, {&__pyx_n_s_gray45, __pyx_k_gray45, sizeof(__pyx_k_gray45), 0, 0, 1, 1}, {&__pyx_n_s_gray46, __pyx_k_gray46, sizeof(__pyx_k_gray46), 0, 0, 1, 1}, {&__pyx_n_s_gray47, __pyx_k_gray47, sizeof(__pyx_k_gray47), 0, 0, 1, 1}, {&__pyx_n_s_gray48, __pyx_k_gray48, sizeof(__pyx_k_gray48), 0, 0, 1, 1}, {&__pyx_n_s_gray49, __pyx_k_gray49, sizeof(__pyx_k_gray49), 0, 0, 1, 1}, {&__pyx_n_s_gray5, __pyx_k_gray5, sizeof(__pyx_k_gray5), 0, 0, 1, 1}, {&__pyx_n_s_gray50, __pyx_k_gray50, sizeof(__pyx_k_gray50), 0, 0, 1, 1}, {&__pyx_n_s_gray51, __pyx_k_gray51, sizeof(__pyx_k_gray51), 0, 0, 1, 1}, {&__pyx_n_s_gray52, __pyx_k_gray52, sizeof(__pyx_k_gray52), 0, 0, 1, 1}, {&__pyx_n_s_gray53, __pyx_k_gray53, sizeof(__pyx_k_gray53), 0, 0, 1, 1}, {&__pyx_n_s_gray54, __pyx_k_gray54, sizeof(__pyx_k_gray54), 0, 0, 1, 1}, {&__pyx_n_s_gray55, __pyx_k_gray55, sizeof(__pyx_k_gray55), 0, 0, 1, 1}, {&__pyx_n_s_gray56, __pyx_k_gray56, sizeof(__pyx_k_gray56), 0, 0, 1, 1}, {&__pyx_n_s_gray57, __pyx_k_gray57, sizeof(__pyx_k_gray57), 0, 0, 1, 1}, {&__pyx_n_s_gray58, __pyx_k_gray58, sizeof(__pyx_k_gray58), 0, 0, 1, 1}, {&__pyx_n_s_gray59, __pyx_k_gray59, sizeof(__pyx_k_gray59), 0, 0, 1, 1}, {&__pyx_n_s_gray6, __pyx_k_gray6, sizeof(__pyx_k_gray6), 0, 0, 1, 1}, {&__pyx_n_s_gray60, __pyx_k_gray60, sizeof(__pyx_k_gray60), 0, 0, 1, 1}, {&__pyx_n_s_gray61, __pyx_k_gray61, sizeof(__pyx_k_gray61), 0, 0, 1, 1}, {&__pyx_n_s_gray62, __pyx_k_gray62, sizeof(__pyx_k_gray62), 0, 0, 1, 1}, {&__pyx_n_s_gray63, __pyx_k_gray63, sizeof(__pyx_k_gray63), 0, 0, 1, 1}, {&__pyx_n_s_gray64, __pyx_k_gray64, sizeof(__pyx_k_gray64), 0, 0, 1, 1}, {&__pyx_n_s_gray65, __pyx_k_gray65, sizeof(__pyx_k_gray65), 0, 0, 1, 1}, {&__pyx_n_s_gray66, __pyx_k_gray66, sizeof(__pyx_k_gray66), 0, 0, 1, 1}, {&__pyx_n_s_gray67, __pyx_k_gray67, sizeof(__pyx_k_gray67), 0, 0, 1, 1}, {&__pyx_n_s_gray68, __pyx_k_gray68, sizeof(__pyx_k_gray68), 0, 0, 1, 1}, {&__pyx_n_s_gray69, __pyx_k_gray69, sizeof(__pyx_k_gray69), 0, 0, 1, 1}, {&__pyx_n_s_gray7, __pyx_k_gray7, sizeof(__pyx_k_gray7), 0, 0, 1, 1}, {&__pyx_n_s_gray70, __pyx_k_gray70, sizeof(__pyx_k_gray70), 0, 0, 1, 1}, {&__pyx_n_s_gray71, __pyx_k_gray71, sizeof(__pyx_k_gray71), 0, 0, 1, 1}, {&__pyx_n_s_gray72, __pyx_k_gray72, sizeof(__pyx_k_gray72), 0, 0, 1, 1}, {&__pyx_n_s_gray73, __pyx_k_gray73, sizeof(__pyx_k_gray73), 0, 0, 1, 1}, {&__pyx_n_s_gray74, __pyx_k_gray74, sizeof(__pyx_k_gray74), 0, 0, 1, 1}, {&__pyx_n_s_gray75, __pyx_k_gray75, sizeof(__pyx_k_gray75), 0, 0, 1, 1}, {&__pyx_n_s_gray76, __pyx_k_gray76, sizeof(__pyx_k_gray76), 0, 0, 1, 1}, {&__pyx_n_s_gray77, __pyx_k_gray77, sizeof(__pyx_k_gray77), 0, 0, 1, 1}, {&__pyx_n_s_gray78, __pyx_k_gray78, sizeof(__pyx_k_gray78), 0, 0, 1, 1}, {&__pyx_n_s_gray79, __pyx_k_gray79, sizeof(__pyx_k_gray79), 0, 0, 1, 1}, {&__pyx_n_s_gray8, __pyx_k_gray8, sizeof(__pyx_k_gray8), 0, 0, 1, 1}, {&__pyx_n_s_gray80, __pyx_k_gray80, sizeof(__pyx_k_gray80), 0, 0, 1, 1}, {&__pyx_n_s_gray81, __pyx_k_gray81, sizeof(__pyx_k_gray81), 0, 0, 1, 1}, {&__pyx_n_s_gray82, __pyx_k_gray82, sizeof(__pyx_k_gray82), 0, 0, 1, 1}, {&__pyx_n_s_gray83, __pyx_k_gray83, sizeof(__pyx_k_gray83), 0, 0, 1, 1}, {&__pyx_n_s_gray84, __pyx_k_gray84, sizeof(__pyx_k_gray84), 0, 0, 1, 1}, {&__pyx_n_s_gray85, __pyx_k_gray85, sizeof(__pyx_k_gray85), 0, 0, 1, 1}, {&__pyx_n_s_gray86, __pyx_k_gray86, sizeof(__pyx_k_gray86), 0, 0, 1, 1}, {&__pyx_n_s_gray87, __pyx_k_gray87, sizeof(__pyx_k_gray87), 0, 0, 1, 1}, {&__pyx_n_s_gray88, __pyx_k_gray88, sizeof(__pyx_k_gray88), 0, 0, 1, 1}, {&__pyx_n_s_gray89, __pyx_k_gray89, sizeof(__pyx_k_gray89), 0, 0, 1, 1}, {&__pyx_n_s_gray9, __pyx_k_gray9, sizeof(__pyx_k_gray9), 0, 0, 1, 1}, {&__pyx_n_s_gray90, __pyx_k_gray90, sizeof(__pyx_k_gray90), 0, 0, 1, 1}, {&__pyx_n_s_gray91, __pyx_k_gray91, sizeof(__pyx_k_gray91), 0, 0, 1, 1}, {&__pyx_n_s_gray92, __pyx_k_gray92, sizeof(__pyx_k_gray92), 0, 0, 1, 1}, {&__pyx_n_s_gray93, __pyx_k_gray93, sizeof(__pyx_k_gray93), 0, 0, 1, 1}, {&__pyx_n_s_gray94, __pyx_k_gray94, sizeof(__pyx_k_gray94), 0, 0, 1, 1}, {&__pyx_n_s_gray95, __pyx_k_gray95, sizeof(__pyx_k_gray95), 0, 0, 1, 1}, {&__pyx_n_s_gray96, __pyx_k_gray96, sizeof(__pyx_k_gray96), 0, 0, 1, 1}, {&__pyx_n_s_gray97, __pyx_k_gray97, sizeof(__pyx_k_gray97), 0, 0, 1, 1}, {&__pyx_n_s_gray98, __pyx_k_gray98, sizeof(__pyx_k_gray98), 0, 0, 1, 1}, {&__pyx_n_s_gray99, __pyx_k_gray99, sizeof(__pyx_k_gray99), 0, 0, 1, 1}, {&__pyx_n_s_green, __pyx_k_green, sizeof(__pyx_k_green), 0, 0, 1, 1}, {&__pyx_n_s_green1, __pyx_k_green1, sizeof(__pyx_k_green1), 0, 0, 1, 1}, {&__pyx_n_s_green2, __pyx_k_green2, sizeof(__pyx_k_green2), 0, 0, 1, 1}, {&__pyx_n_s_green3, __pyx_k_green3, sizeof(__pyx_k_green3), 0, 0, 1, 1}, {&__pyx_n_s_green4, __pyx_k_green4, sizeof(__pyx_k_green4), 0, 0, 1, 1}, {&__pyx_n_s_greenyellow, __pyx_k_greenyellow, sizeof(__pyx_k_greenyellow), 0, 0, 1, 1}, {&__pyx_n_s_grey, __pyx_k_grey, sizeof(__pyx_k_grey), 0, 0, 1, 1}, {&__pyx_n_s_grey0, __pyx_k_grey0, sizeof(__pyx_k_grey0), 0, 0, 1, 1}, {&__pyx_n_s_grey1, __pyx_k_grey1, sizeof(__pyx_k_grey1), 0, 0, 1, 1}, {&__pyx_n_s_grey10, __pyx_k_grey10, sizeof(__pyx_k_grey10), 0, 0, 1, 1}, {&__pyx_n_s_grey100, __pyx_k_grey100, sizeof(__pyx_k_grey100), 0, 0, 1, 1}, {&__pyx_n_s_grey11, __pyx_k_grey11, sizeof(__pyx_k_grey11), 0, 0, 1, 1}, {&__pyx_n_s_grey12, __pyx_k_grey12, sizeof(__pyx_k_grey12), 0, 0, 1, 1}, {&__pyx_n_s_grey13, __pyx_k_grey13, sizeof(__pyx_k_grey13), 0, 0, 1, 1}, {&__pyx_n_s_grey14, __pyx_k_grey14, sizeof(__pyx_k_grey14), 0, 0, 1, 1}, {&__pyx_n_s_grey15, __pyx_k_grey15, sizeof(__pyx_k_grey15), 0, 0, 1, 1}, {&__pyx_n_s_grey16, __pyx_k_grey16, sizeof(__pyx_k_grey16), 0, 0, 1, 1}, {&__pyx_n_s_grey17, __pyx_k_grey17, sizeof(__pyx_k_grey17), 0, 0, 1, 1}, {&__pyx_n_s_grey18, __pyx_k_grey18, sizeof(__pyx_k_grey18), 0, 0, 1, 1}, {&__pyx_n_s_grey19, __pyx_k_grey19, sizeof(__pyx_k_grey19), 0, 0, 1, 1}, {&__pyx_n_s_grey2, __pyx_k_grey2, sizeof(__pyx_k_grey2), 0, 0, 1, 1}, {&__pyx_n_s_grey20, __pyx_k_grey20, sizeof(__pyx_k_grey20), 0, 0, 1, 1}, {&__pyx_n_s_grey21, __pyx_k_grey21, sizeof(__pyx_k_grey21), 0, 0, 1, 1}, {&__pyx_n_s_grey22, __pyx_k_grey22, sizeof(__pyx_k_grey22), 0, 0, 1, 1}, {&__pyx_n_s_grey23, __pyx_k_grey23, sizeof(__pyx_k_grey23), 0, 0, 1, 1}, {&__pyx_n_s_grey24, __pyx_k_grey24, sizeof(__pyx_k_grey24), 0, 0, 1, 1}, {&__pyx_n_s_grey25, __pyx_k_grey25, sizeof(__pyx_k_grey25), 0, 0, 1, 1}, {&__pyx_n_s_grey26, __pyx_k_grey26, sizeof(__pyx_k_grey26), 0, 0, 1, 1}, {&__pyx_n_s_grey27, __pyx_k_grey27, sizeof(__pyx_k_grey27), 0, 0, 1, 1}, {&__pyx_n_s_grey28, __pyx_k_grey28, sizeof(__pyx_k_grey28), 0, 0, 1, 1}, {&__pyx_n_s_grey29, __pyx_k_grey29, sizeof(__pyx_k_grey29), 0, 0, 1, 1}, {&__pyx_n_s_grey3, __pyx_k_grey3, sizeof(__pyx_k_grey3), 0, 0, 1, 1}, {&__pyx_n_s_grey30, __pyx_k_grey30, sizeof(__pyx_k_grey30), 0, 0, 1, 1}, {&__pyx_n_s_grey31, __pyx_k_grey31, sizeof(__pyx_k_grey31), 0, 0, 1, 1}, {&__pyx_n_s_grey32, __pyx_k_grey32, sizeof(__pyx_k_grey32), 0, 0, 1, 1}, {&__pyx_n_s_grey33, __pyx_k_grey33, sizeof(__pyx_k_grey33), 0, 0, 1, 1}, {&__pyx_n_s_grey34, __pyx_k_grey34, sizeof(__pyx_k_grey34), 0, 0, 1, 1}, {&__pyx_n_s_grey35, __pyx_k_grey35, sizeof(__pyx_k_grey35), 0, 0, 1, 1}, {&__pyx_n_s_grey36, __pyx_k_grey36, sizeof(__pyx_k_grey36), 0, 0, 1, 1}, {&__pyx_n_s_grey37, __pyx_k_grey37, sizeof(__pyx_k_grey37), 0, 0, 1, 1}, {&__pyx_n_s_grey38, __pyx_k_grey38, sizeof(__pyx_k_grey38), 0, 0, 1, 1}, {&__pyx_n_s_grey39, __pyx_k_grey39, sizeof(__pyx_k_grey39), 0, 0, 1, 1}, {&__pyx_n_s_grey4, __pyx_k_grey4, sizeof(__pyx_k_grey4), 0, 0, 1, 1}, {&__pyx_n_s_grey40, __pyx_k_grey40, sizeof(__pyx_k_grey40), 0, 0, 1, 1}, {&__pyx_n_s_grey41, __pyx_k_grey41, sizeof(__pyx_k_grey41), 0, 0, 1, 1}, {&__pyx_n_s_grey42, __pyx_k_grey42, sizeof(__pyx_k_grey42), 0, 0, 1, 1}, {&__pyx_n_s_grey43, __pyx_k_grey43, sizeof(__pyx_k_grey43), 0, 0, 1, 1}, {&__pyx_n_s_grey44, __pyx_k_grey44, sizeof(__pyx_k_grey44), 0, 0, 1, 1}, {&__pyx_n_s_grey45, __pyx_k_grey45, sizeof(__pyx_k_grey45), 0, 0, 1, 1}, {&__pyx_n_s_grey46, __pyx_k_grey46, sizeof(__pyx_k_grey46), 0, 0, 1, 1}, {&__pyx_n_s_grey47, __pyx_k_grey47, sizeof(__pyx_k_grey47), 0, 0, 1, 1}, {&__pyx_n_s_grey48, __pyx_k_grey48, sizeof(__pyx_k_grey48), 0, 0, 1, 1}, {&__pyx_n_s_grey49, __pyx_k_grey49, sizeof(__pyx_k_grey49), 0, 0, 1, 1}, {&__pyx_n_s_grey5, __pyx_k_grey5, sizeof(__pyx_k_grey5), 0, 0, 1, 1}, {&__pyx_n_s_grey50, __pyx_k_grey50, sizeof(__pyx_k_grey50), 0, 0, 1, 1}, {&__pyx_n_s_grey51, __pyx_k_grey51, sizeof(__pyx_k_grey51), 0, 0, 1, 1}, {&__pyx_n_s_grey52, __pyx_k_grey52, sizeof(__pyx_k_grey52), 0, 0, 1, 1}, {&__pyx_n_s_grey53, __pyx_k_grey53, sizeof(__pyx_k_grey53), 0, 0, 1, 1}, {&__pyx_n_s_grey54, __pyx_k_grey54, sizeof(__pyx_k_grey54), 0, 0, 1, 1}, {&__pyx_n_s_grey55, __pyx_k_grey55, sizeof(__pyx_k_grey55), 0, 0, 1, 1}, {&__pyx_n_s_grey56, __pyx_k_grey56, sizeof(__pyx_k_grey56), 0, 0, 1, 1}, {&__pyx_n_s_grey57, __pyx_k_grey57, sizeof(__pyx_k_grey57), 0, 0, 1, 1}, {&__pyx_n_s_grey58, __pyx_k_grey58, sizeof(__pyx_k_grey58), 0, 0, 1, 1}, {&__pyx_n_s_grey59, __pyx_k_grey59, sizeof(__pyx_k_grey59), 0, 0, 1, 1}, {&__pyx_n_s_grey6, __pyx_k_grey6, sizeof(__pyx_k_grey6), 0, 0, 1, 1}, {&__pyx_n_s_grey60, __pyx_k_grey60, sizeof(__pyx_k_grey60), 0, 0, 1, 1}, {&__pyx_n_s_grey61, __pyx_k_grey61, sizeof(__pyx_k_grey61), 0, 0, 1, 1}, {&__pyx_n_s_grey62, __pyx_k_grey62, sizeof(__pyx_k_grey62), 0, 0, 1, 1}, {&__pyx_n_s_grey63, __pyx_k_grey63, sizeof(__pyx_k_grey63), 0, 0, 1, 1}, {&__pyx_n_s_grey64, __pyx_k_grey64, sizeof(__pyx_k_grey64), 0, 0, 1, 1}, {&__pyx_n_s_grey65, __pyx_k_grey65, sizeof(__pyx_k_grey65), 0, 0, 1, 1}, {&__pyx_n_s_grey66, __pyx_k_grey66, sizeof(__pyx_k_grey66), 0, 0, 1, 1}, {&__pyx_n_s_grey67, __pyx_k_grey67, sizeof(__pyx_k_grey67), 0, 0, 1, 1}, {&__pyx_n_s_grey68, __pyx_k_grey68, sizeof(__pyx_k_grey68), 0, 0, 1, 1}, {&__pyx_n_s_grey69, __pyx_k_grey69, sizeof(__pyx_k_grey69), 0, 0, 1, 1}, {&__pyx_n_s_grey7, __pyx_k_grey7, sizeof(__pyx_k_grey7), 0, 0, 1, 1}, {&__pyx_n_s_grey70, __pyx_k_grey70, sizeof(__pyx_k_grey70), 0, 0, 1, 1}, {&__pyx_n_s_grey71, __pyx_k_grey71, sizeof(__pyx_k_grey71), 0, 0, 1, 1}, {&__pyx_n_s_grey72, __pyx_k_grey72, sizeof(__pyx_k_grey72), 0, 0, 1, 1}, {&__pyx_n_s_grey73, __pyx_k_grey73, sizeof(__pyx_k_grey73), 0, 0, 1, 1}, {&__pyx_n_s_grey74, __pyx_k_grey74, sizeof(__pyx_k_grey74), 0, 0, 1, 1}, {&__pyx_n_s_grey75, __pyx_k_grey75, sizeof(__pyx_k_grey75), 0, 0, 1, 1}, {&__pyx_n_s_grey76, __pyx_k_grey76, sizeof(__pyx_k_grey76), 0, 0, 1, 1}, {&__pyx_n_s_grey77, __pyx_k_grey77, sizeof(__pyx_k_grey77), 0, 0, 1, 1}, {&__pyx_n_s_grey78, __pyx_k_grey78, sizeof(__pyx_k_grey78), 0, 0, 1, 1}, {&__pyx_n_s_grey79, __pyx_k_grey79, sizeof(__pyx_k_grey79), 0, 0, 1, 1}, {&__pyx_n_s_grey8, __pyx_k_grey8, sizeof(__pyx_k_grey8), 0, 0, 1, 1}, {&__pyx_n_s_grey80, __pyx_k_grey80, sizeof(__pyx_k_grey80), 0, 0, 1, 1}, {&__pyx_n_s_grey81, __pyx_k_grey81, sizeof(__pyx_k_grey81), 0, 0, 1, 1}, {&__pyx_n_s_grey82, __pyx_k_grey82, sizeof(__pyx_k_grey82), 0, 0, 1, 1}, {&__pyx_n_s_grey83, __pyx_k_grey83, sizeof(__pyx_k_grey83), 0, 0, 1, 1}, {&__pyx_n_s_grey84, __pyx_k_grey84, sizeof(__pyx_k_grey84), 0, 0, 1, 1}, {&__pyx_n_s_grey85, __pyx_k_grey85, sizeof(__pyx_k_grey85), 0, 0, 1, 1}, {&__pyx_n_s_grey86, __pyx_k_grey86, sizeof(__pyx_k_grey86), 0, 0, 1, 1}, {&__pyx_n_s_grey87, __pyx_k_grey87, sizeof(__pyx_k_grey87), 0, 0, 1, 1}, {&__pyx_n_s_grey88, __pyx_k_grey88, sizeof(__pyx_k_grey88), 0, 0, 1, 1}, {&__pyx_n_s_grey89, __pyx_k_grey89, sizeof(__pyx_k_grey89), 0, 0, 1, 1}, {&__pyx_n_s_grey9, __pyx_k_grey9, sizeof(__pyx_k_grey9), 0, 0, 1, 1}, {&__pyx_n_s_grey90, __pyx_k_grey90, sizeof(__pyx_k_grey90), 0, 0, 1, 1}, {&__pyx_n_s_grey91, __pyx_k_grey91, sizeof(__pyx_k_grey91), 0, 0, 1, 1}, {&__pyx_n_s_grey92, __pyx_k_grey92, sizeof(__pyx_k_grey92), 0, 0, 1, 1}, {&__pyx_n_s_grey93, __pyx_k_grey93, sizeof(__pyx_k_grey93), 0, 0, 1, 1}, {&__pyx_n_s_grey94, __pyx_k_grey94, sizeof(__pyx_k_grey94), 0, 0, 1, 1}, {&__pyx_n_s_grey95, __pyx_k_grey95, sizeof(__pyx_k_grey95), 0, 0, 1, 1}, {&__pyx_n_s_grey96, __pyx_k_grey96, sizeof(__pyx_k_grey96), 0, 0, 1, 1}, {&__pyx_n_s_grey97, __pyx_k_grey97, sizeof(__pyx_k_grey97), 0, 0, 1, 1}, {&__pyx_n_s_grey98, __pyx_k_grey98, sizeof(__pyx_k_grey98), 0, 0, 1, 1}, {&__pyx_n_s_grey99, __pyx_k_grey99, sizeof(__pyx_k_grey99), 0, 0, 1, 1}, {&__pyx_n_s_hex, __pyx_k_hex, sizeof(__pyx_k_hex), 0, 0, 1, 1}, {&__pyx_kp_s_home_tom_ab_pygame_sdl2_src_pyg, __pyx_k_home_tom_ab_pygame_sdl2_src_pyg, sizeof(__pyx_k_home_tom_ab_pygame_sdl2_src_pyg), 0, 0, 1, 0}, {&__pyx_n_s_honeydew, __pyx_k_honeydew, sizeof(__pyx_k_honeydew), 0, 0, 1, 1}, {&__pyx_n_s_honeydew1, __pyx_k_honeydew1, sizeof(__pyx_k_honeydew1), 0, 0, 1, 1}, {&__pyx_n_s_honeydew2, __pyx_k_honeydew2, sizeof(__pyx_k_honeydew2), 0, 0, 1, 1}, {&__pyx_n_s_honeydew3, __pyx_k_honeydew3, sizeof(__pyx_k_honeydew3), 0, 0, 1, 1}, {&__pyx_n_s_honeydew4, __pyx_k_honeydew4, sizeof(__pyx_k_honeydew4), 0, 0, 1, 1}, {&__pyx_n_s_hotpink, __pyx_k_hotpink, sizeof(__pyx_k_hotpink), 0, 0, 1, 1}, {&__pyx_n_s_hotpink1, __pyx_k_hotpink1, sizeof(__pyx_k_hotpink1), 0, 0, 1, 1}, {&__pyx_n_s_hotpink2, __pyx_k_hotpink2, sizeof(__pyx_k_hotpink2), 0, 0, 1, 1}, {&__pyx_n_s_hotpink3, __pyx_k_hotpink3, sizeof(__pyx_k_hotpink3), 0, 0, 1, 1}, {&__pyx_n_s_hotpink4, __pyx_k_hotpink4, sizeof(__pyx_k_hotpink4), 0, 0, 1, 1}, {&__pyx_n_s_hsva, __pyx_k_hsva, sizeof(__pyx_k_hsva), 0, 0, 1, 1}, {&__pyx_n_s_import, __pyx_k_import, sizeof(__pyx_k_import), 0, 0, 1, 1}, {&__pyx_n_s_indianred, __pyx_k_indianred, sizeof(__pyx_k_indianred), 0, 0, 1, 1}, {&__pyx_n_s_indianred1, __pyx_k_indianred1, sizeof(__pyx_k_indianred1), 0, 0, 1, 1}, {&__pyx_n_s_indianred2, __pyx_k_indianred2, sizeof(__pyx_k_indianred2), 0, 0, 1, 1}, {&__pyx_n_s_indianred3, __pyx_k_indianred3, sizeof(__pyx_k_indianred3), 0, 0, 1, 1}, {&__pyx_n_s_indianred4, __pyx_k_indianred4, sizeof(__pyx_k_indianred4), 0, 0, 1, 1}, {&__pyx_n_s_indigo, __pyx_k_indigo, sizeof(__pyx_k_indigo), 0, 0, 1, 1}, {&__pyx_n_s_ivory, __pyx_k_ivory, sizeof(__pyx_k_ivory), 0, 0, 1, 1}, {&__pyx_n_s_ivory1, __pyx_k_ivory1, sizeof(__pyx_k_ivory1), 0, 0, 1, 1}, {&__pyx_n_s_ivory2, __pyx_k_ivory2, sizeof(__pyx_k_ivory2), 0, 0, 1, 1}, {&__pyx_n_s_ivory3, __pyx_k_ivory3, sizeof(__pyx_k_ivory3), 0, 0, 1, 1}, {&__pyx_n_s_ivory4, __pyx_k_ivory4, sizeof(__pyx_k_ivory4), 0, 0, 1, 1}, {&__pyx_n_s_join, __pyx_k_join, sizeof(__pyx_k_join), 0, 0, 1, 1}, {&__pyx_n_s_khaki, __pyx_k_khaki, sizeof(__pyx_k_khaki), 0, 0, 1, 1}, {&__pyx_n_s_khaki1, __pyx_k_khaki1, sizeof(__pyx_k_khaki1), 0, 0, 1, 1}, {&__pyx_n_s_khaki2, __pyx_k_khaki2, sizeof(__pyx_k_khaki2), 0, 0, 1, 1}, {&__pyx_n_s_khaki3, __pyx_k_khaki3, sizeof(__pyx_k_khaki3), 0, 0, 1, 1}, {&__pyx_n_s_khaki4, __pyx_k_khaki4, sizeof(__pyx_k_khaki4), 0, 0, 1, 1}, {&__pyx_n_s_l, __pyx_k_l, sizeof(__pyx_k_l), 0, 0, 1, 1}, {&__pyx_n_s_lavender, __pyx_k_lavender, sizeof(__pyx_k_lavender), 0, 0, 1, 1}, {&__pyx_n_s_lavenderblush, __pyx_k_lavenderblush, sizeof(__pyx_k_lavenderblush), 0, 0, 1, 1}, {&__pyx_n_s_lavenderblush1, __pyx_k_lavenderblush1, sizeof(__pyx_k_lavenderblush1), 0, 0, 1, 1}, {&__pyx_n_s_lavenderblush2, __pyx_k_lavenderblush2, sizeof(__pyx_k_lavenderblush2), 0, 0, 1, 1}, {&__pyx_n_s_lavenderblush3, __pyx_k_lavenderblush3, sizeof(__pyx_k_lavenderblush3), 0, 0, 1, 1}, {&__pyx_n_s_lavenderblush4, __pyx_k_lavenderblush4, sizeof(__pyx_k_lavenderblush4), 0, 0, 1, 1}, {&__pyx_n_s_lawngreen, __pyx_k_lawngreen, sizeof(__pyx_k_lawngreen), 0, 0, 1, 1}, {&__pyx_n_s_lemonchiffon, __pyx_k_lemonchiffon, sizeof(__pyx_k_lemonchiffon), 0, 0, 1, 1}, {&__pyx_n_s_lemonchiffon1, __pyx_k_lemonchiffon1, sizeof(__pyx_k_lemonchiffon1), 0, 0, 1, 1}, {&__pyx_n_s_lemonchiffon2, __pyx_k_lemonchiffon2, sizeof(__pyx_k_lemonchiffon2), 0, 0, 1, 1}, {&__pyx_n_s_lemonchiffon3, __pyx_k_lemonchiffon3, sizeof(__pyx_k_lemonchiffon3), 0, 0, 1, 1}, {&__pyx_n_s_lemonchiffon4, __pyx_k_lemonchiffon4, sizeof(__pyx_k_lemonchiffon4), 0, 0, 1, 1}, {&__pyx_n_s_lightblue, __pyx_k_lightblue, sizeof(__pyx_k_lightblue), 0, 0, 1, 1}, {&__pyx_n_s_lightblue1, __pyx_k_lightblue1, sizeof(__pyx_k_lightblue1), 0, 0, 1, 1}, {&__pyx_n_s_lightblue2, __pyx_k_lightblue2, sizeof(__pyx_k_lightblue2), 0, 0, 1, 1}, {&__pyx_n_s_lightblue3, __pyx_k_lightblue3, sizeof(__pyx_k_lightblue3), 0, 0, 1, 1}, {&__pyx_n_s_lightblue4, __pyx_k_lightblue4, sizeof(__pyx_k_lightblue4), 0, 0, 1, 1}, {&__pyx_n_s_lightcoral, __pyx_k_lightcoral, sizeof(__pyx_k_lightcoral), 0, 0, 1, 1}, {&__pyx_n_s_lightcyan, __pyx_k_lightcyan, sizeof(__pyx_k_lightcyan), 0, 0, 1, 1}, {&__pyx_n_s_lightcyan1, __pyx_k_lightcyan1, sizeof(__pyx_k_lightcyan1), 0, 0, 1, 1}, {&__pyx_n_s_lightcyan2, __pyx_k_lightcyan2, sizeof(__pyx_k_lightcyan2), 0, 0, 1, 1}, {&__pyx_n_s_lightcyan3, __pyx_k_lightcyan3, sizeof(__pyx_k_lightcyan3), 0, 0, 1, 1}, {&__pyx_n_s_lightcyan4, __pyx_k_lightcyan4, sizeof(__pyx_k_lightcyan4), 0, 0, 1, 1}, {&__pyx_n_s_lightgoldenrod, __pyx_k_lightgoldenrod, sizeof(__pyx_k_lightgoldenrod), 0, 0, 1, 1}, {&__pyx_n_s_lightgoldenrod1, __pyx_k_lightgoldenrod1, sizeof(__pyx_k_lightgoldenrod1), 0, 0, 1, 1}, {&__pyx_n_s_lightgoldenrod2, __pyx_k_lightgoldenrod2, sizeof(__pyx_k_lightgoldenrod2), 0, 0, 1, 1}, {&__pyx_n_s_lightgoldenrod3, __pyx_k_lightgoldenrod3, sizeof(__pyx_k_lightgoldenrod3), 0, 0, 1, 1}, {&__pyx_n_s_lightgoldenrod4, __pyx_k_lightgoldenrod4, sizeof(__pyx_k_lightgoldenrod4), 0, 0, 1, 1}, {&__pyx_n_s_lightgoldenrodyellow, __pyx_k_lightgoldenrodyellow, sizeof(__pyx_k_lightgoldenrodyellow), 0, 0, 1, 1}, {&__pyx_n_s_lightgray, __pyx_k_lightgray, sizeof(__pyx_k_lightgray), 0, 0, 1, 1}, {&__pyx_n_s_lightgreen, __pyx_k_lightgreen, sizeof(__pyx_k_lightgreen), 0, 0, 1, 1}, {&__pyx_n_s_lightgrey, __pyx_k_lightgrey, sizeof(__pyx_k_lightgrey), 0, 0, 1, 1}, {&__pyx_n_s_lightpink, __pyx_k_lightpink, sizeof(__pyx_k_lightpink), 0, 0, 1, 1}, {&__pyx_n_s_lightpink1, __pyx_k_lightpink1, sizeof(__pyx_k_lightpink1), 0, 0, 1, 1}, {&__pyx_n_s_lightpink2, __pyx_k_lightpink2, sizeof(__pyx_k_lightpink2), 0, 0, 1, 1}, {&__pyx_n_s_lightpink3, __pyx_k_lightpink3, sizeof(__pyx_k_lightpink3), 0, 0, 1, 1}, {&__pyx_n_s_lightpink4, __pyx_k_lightpink4, sizeof(__pyx_k_lightpink4), 0, 0, 1, 1}, {&__pyx_n_s_lightsalmon, __pyx_k_lightsalmon, sizeof(__pyx_k_lightsalmon), 0, 0, 1, 1}, {&__pyx_n_s_lightsalmon1, __pyx_k_lightsalmon1, sizeof(__pyx_k_lightsalmon1), 0, 0, 1, 1}, {&__pyx_n_s_lightsalmon2, __pyx_k_lightsalmon2, sizeof(__pyx_k_lightsalmon2), 0, 0, 1, 1}, {&__pyx_n_s_lightsalmon3, __pyx_k_lightsalmon3, sizeof(__pyx_k_lightsalmon3), 0, 0, 1, 1}, {&__pyx_n_s_lightsalmon4, __pyx_k_lightsalmon4, sizeof(__pyx_k_lightsalmon4), 0, 0, 1, 1}, {&__pyx_n_s_lightseagreen, __pyx_k_lightseagreen, sizeof(__pyx_k_lightseagreen), 0, 0, 1, 1}, {&__pyx_n_s_lightskyblue, __pyx_k_lightskyblue, sizeof(__pyx_k_lightskyblue), 0, 0, 1, 1}, {&__pyx_n_s_lightskyblue1, __pyx_k_lightskyblue1, sizeof(__pyx_k_lightskyblue1), 0, 0, 1, 1}, {&__pyx_n_s_lightskyblue2, __pyx_k_lightskyblue2, sizeof(__pyx_k_lightskyblue2), 0, 0, 1, 1}, {&__pyx_n_s_lightskyblue3, __pyx_k_lightskyblue3, sizeof(__pyx_k_lightskyblue3), 0, 0, 1, 1}, {&__pyx_n_s_lightskyblue4, __pyx_k_lightskyblue4, sizeof(__pyx_k_lightskyblue4), 0, 0, 1, 1}, {&__pyx_n_s_lightslateblue, __pyx_k_lightslateblue, sizeof(__pyx_k_lightslateblue), 0, 0, 1, 1}, {&__pyx_n_s_lightslategray, __pyx_k_lightslategray, sizeof(__pyx_k_lightslategray), 0, 0, 1, 1}, {&__pyx_n_s_lightslategrey, __pyx_k_lightslategrey, sizeof(__pyx_k_lightslategrey), 0, 0, 1, 1}, {&__pyx_n_s_lightsteelblue, __pyx_k_lightsteelblue, sizeof(__pyx_k_lightsteelblue), 0, 0, 1, 1}, {&__pyx_n_s_lightsteelblue1, __pyx_k_lightsteelblue1, sizeof(__pyx_k_lightsteelblue1), 0, 0, 1, 1}, {&__pyx_n_s_lightsteelblue2, __pyx_k_lightsteelblue2, sizeof(__pyx_k_lightsteelblue2), 0, 0, 1, 1}, {&__pyx_n_s_lightsteelblue3, __pyx_k_lightsteelblue3, sizeof(__pyx_k_lightsteelblue3), 0, 0, 1, 1}, {&__pyx_n_s_lightsteelblue4, __pyx_k_lightsteelblue4, sizeof(__pyx_k_lightsteelblue4), 0, 0, 1, 1}, {&__pyx_n_s_lightyellow, __pyx_k_lightyellow, sizeof(__pyx_k_lightyellow), 0, 0, 1, 1}, {&__pyx_n_s_lightyellow1, __pyx_k_lightyellow1, sizeof(__pyx_k_lightyellow1), 0, 0, 1, 1}, {&__pyx_n_s_lightyellow2, __pyx_k_lightyellow2, sizeof(__pyx_k_lightyellow2), 0, 0, 1, 1}, {&__pyx_n_s_lightyellow3, __pyx_k_lightyellow3, sizeof(__pyx_k_lightyellow3), 0, 0, 1, 1}, {&__pyx_n_s_lightyellow4, __pyx_k_lightyellow4, sizeof(__pyx_k_lightyellow4), 0, 0, 1, 1}, {&__pyx_n_s_lime, __pyx_k_lime, sizeof(__pyx_k_lime), 0, 0, 1, 1}, {&__pyx_n_s_limegreen, __pyx_k_limegreen, sizeof(__pyx_k_limegreen), 0, 0, 1, 1}, {&__pyx_n_s_linen, __pyx_k_linen, sizeof(__pyx_k_linen), 0, 0, 1, 1}, {&__pyx_n_s_lower, __pyx_k_lower, sizeof(__pyx_k_lower), 0, 0, 1, 1}, {&__pyx_n_s_magenta, __pyx_k_magenta, sizeof(__pyx_k_magenta), 0, 0, 1, 1}, {&__pyx_n_s_magenta1, __pyx_k_magenta1, sizeof(__pyx_k_magenta1), 0, 0, 1, 1}, {&__pyx_n_s_magenta2, __pyx_k_magenta2, sizeof(__pyx_k_magenta2), 0, 0, 1, 1}, {&__pyx_n_s_magenta3, __pyx_k_magenta3, sizeof(__pyx_k_magenta3), 0, 0, 1, 1}, {&__pyx_n_s_magenta4, __pyx_k_magenta4, sizeof(__pyx_k_magenta4), 0, 0, 1, 1}, {&__pyx_n_s_main, __pyx_k_main, sizeof(__pyx_k_main), 0, 0, 1, 1}, {&__pyx_n_s_map, __pyx_k_map, sizeof(__pyx_k_map), 0, 0, 1, 1}, {&__pyx_n_s_maroon, __pyx_k_maroon, sizeof(__pyx_k_maroon), 0, 0, 1, 1}, {&__pyx_n_s_maroon1, __pyx_k_maroon1, sizeof(__pyx_k_maroon1), 0, 0, 1, 1}, {&__pyx_n_s_maroon2, __pyx_k_maroon2, sizeof(__pyx_k_maroon2), 0, 0, 1, 1}, {&__pyx_n_s_maroon3, __pyx_k_maroon3, sizeof(__pyx_k_maroon3), 0, 0, 1, 1}, {&__pyx_n_s_maroon4, __pyx_k_maroon4, sizeof(__pyx_k_maroon4), 0, 0, 1, 1}, {&__pyx_n_s_mediumaquamarine, __pyx_k_mediumaquamarine, sizeof(__pyx_k_mediumaquamarine), 0, 0, 1, 1}, {&__pyx_n_s_mediumblue, __pyx_k_mediumblue, sizeof(__pyx_k_mediumblue), 0, 0, 1, 1}, {&__pyx_n_s_mediumorchid, __pyx_k_mediumorchid, sizeof(__pyx_k_mediumorchid), 0, 0, 1, 1}, {&__pyx_n_s_mediumorchid1, __pyx_k_mediumorchid1, sizeof(__pyx_k_mediumorchid1), 0, 0, 1, 1}, {&__pyx_n_s_mediumorchid2, __pyx_k_mediumorchid2, sizeof(__pyx_k_mediumorchid2), 0, 0, 1, 1}, {&__pyx_n_s_mediumorchid3, __pyx_k_mediumorchid3, sizeof(__pyx_k_mediumorchid3), 0, 0, 1, 1}, {&__pyx_n_s_mediumorchid4, __pyx_k_mediumorchid4, sizeof(__pyx_k_mediumorchid4), 0, 0, 1, 1}, {&__pyx_n_s_mediumpurple, __pyx_k_mediumpurple, sizeof(__pyx_k_mediumpurple), 0, 0, 1, 1}, {&__pyx_n_s_mediumpurple1, __pyx_k_mediumpurple1, sizeof(__pyx_k_mediumpurple1), 0, 0, 1, 1}, {&__pyx_n_s_mediumpurple2, __pyx_k_mediumpurple2, sizeof(__pyx_k_mediumpurple2), 0, 0, 1, 1}, {&__pyx_n_s_mediumpurple3, __pyx_k_mediumpurple3, sizeof(__pyx_k_mediumpurple3), 0, 0, 1, 1}, {&__pyx_n_s_mediumpurple4, __pyx_k_mediumpurple4, sizeof(__pyx_k_mediumpurple4), 0, 0, 1, 1}, {&__pyx_n_s_mediumseagreen, __pyx_k_mediumseagreen, sizeof(__pyx_k_mediumseagreen), 0, 0, 1, 1}, {&__pyx_n_s_mediumslateblue, __pyx_k_mediumslateblue, sizeof(__pyx_k_mediumslateblue), 0, 0, 1, 1}, {&__pyx_n_s_mediumspringgreen, __pyx_k_mediumspringgreen, sizeof(__pyx_k_mediumspringgreen), 0, 0, 1, 1}, {&__pyx_n_s_mediumturquoise, __pyx_k_mediumturquoise, sizeof(__pyx_k_mediumturquoise), 0, 0, 1, 1}, {&__pyx_n_s_mediumvioletred, __pyx_k_mediumvioletred, sizeof(__pyx_k_mediumvioletred), 0, 0, 1, 1}, {&__pyx_n_s_midnightblue, __pyx_k_midnightblue, sizeof(__pyx_k_midnightblue), 0, 0, 1, 1}, {&__pyx_n_s_mintcream, __pyx_k_mintcream, sizeof(__pyx_k_mintcream), 0, 0, 1, 1}, {&__pyx_n_s_mistyrose, __pyx_k_mistyrose, sizeof(__pyx_k_mistyrose), 0, 0, 1, 1}, {&__pyx_n_s_mistyrose1, __pyx_k_mistyrose1, sizeof(__pyx_k_mistyrose1), 0, 0, 1, 1}, {&__pyx_n_s_mistyrose2, __pyx_k_mistyrose2, sizeof(__pyx_k_mistyrose2), 0, 0, 1, 1}, {&__pyx_n_s_mistyrose3, __pyx_k_mistyrose3, sizeof(__pyx_k_mistyrose3), 0, 0, 1, 1}, {&__pyx_n_s_mistyrose4, __pyx_k_mistyrose4, sizeof(__pyx_k_mistyrose4), 0, 0, 1, 1}, {&__pyx_n_s_moccasin, __pyx_k_moccasin, sizeof(__pyx_k_moccasin), 0, 0, 1, 1}, {&__pyx_n_s_mod, __pyx_k_mod, sizeof(__pyx_k_mod), 0, 0, 1, 1}, {&__pyx_n_s_mod___locals_mod, __pyx_k_mod___locals_mod, sizeof(__pyx_k_mod___locals_mod), 0, 0, 1, 1}, {&__pyx_n_s_navajowhite, __pyx_k_navajowhite, sizeof(__pyx_k_navajowhite), 0, 0, 1, 1}, {&__pyx_n_s_navajowhite1, __pyx_k_navajowhite1, sizeof(__pyx_k_navajowhite1), 0, 0, 1, 1}, {&__pyx_n_s_navajowhite2, __pyx_k_navajowhite2, sizeof(__pyx_k_navajowhite2), 0, 0, 1, 1}, {&__pyx_n_s_navajowhite3, __pyx_k_navajowhite3, sizeof(__pyx_k_navajowhite3), 0, 0, 1, 1}, {&__pyx_n_s_navajowhite4, __pyx_k_navajowhite4, sizeof(__pyx_k_navajowhite4), 0, 0, 1, 1}, {&__pyx_n_s_navy, __pyx_k_navy, sizeof(__pyx_k_navy), 0, 0, 1, 1}, {&__pyx_n_s_navyblue, __pyx_k_navyblue, sizeof(__pyx_k_navyblue), 0, 0, 1, 1}, {&__pyx_n_s_oct, __pyx_k_oct, sizeof(__pyx_k_oct), 0, 0, 1, 1}, {&__pyx_n_s_oldlace, __pyx_k_oldlace, sizeof(__pyx_k_oldlace), 0, 0, 1, 1}, {&__pyx_n_s_olive, __pyx_k_olive, sizeof(__pyx_k_olive), 0, 0, 1, 1}, {&__pyx_n_s_olivedrab, __pyx_k_olivedrab, sizeof(__pyx_k_olivedrab), 0, 0, 1, 1}, {&__pyx_n_s_olivedrab1, __pyx_k_olivedrab1, sizeof(__pyx_k_olivedrab1), 0, 0, 1, 1}, {&__pyx_n_s_olivedrab2, __pyx_k_olivedrab2, sizeof(__pyx_k_olivedrab2), 0, 0, 1, 1}, {&__pyx_n_s_olivedrab3, __pyx_k_olivedrab3, sizeof(__pyx_k_olivedrab3), 0, 0, 1, 1}, {&__pyx_n_s_olivedrab4, __pyx_k_olivedrab4, sizeof(__pyx_k_olivedrab4), 0, 0, 1, 1}, {&__pyx_n_s_orange, __pyx_k_orange, sizeof(__pyx_k_orange), 0, 0, 1, 1}, {&__pyx_n_s_orange1, __pyx_k_orange1, sizeof(__pyx_k_orange1), 0, 0, 1, 1}, {&__pyx_n_s_orange2, __pyx_k_orange2, sizeof(__pyx_k_orange2), 0, 0, 1, 1}, {&__pyx_n_s_orange3, __pyx_k_orange3, sizeof(__pyx_k_orange3), 0, 0, 1, 1}, {&__pyx_n_s_orange4, __pyx_k_orange4, sizeof(__pyx_k_orange4), 0, 0, 1, 1}, {&__pyx_n_s_orangered, __pyx_k_orangered, sizeof(__pyx_k_orangered), 0, 0, 1, 1}, {&__pyx_n_s_orangered1, __pyx_k_orangered1, sizeof(__pyx_k_orangered1), 0, 0, 1, 1}, {&__pyx_n_s_orangered2, __pyx_k_orangered2, sizeof(__pyx_k_orangered2), 0, 0, 1, 1}, {&__pyx_n_s_orangered3, __pyx_k_orangered3, sizeof(__pyx_k_orangered3), 0, 0, 1, 1}, {&__pyx_n_s_orangered4, __pyx_k_orangered4, sizeof(__pyx_k_orangered4), 0, 0, 1, 1}, {&__pyx_n_s_orchid, __pyx_k_orchid, sizeof(__pyx_k_orchid), 0, 0, 1, 1}, {&__pyx_n_s_orchid1, __pyx_k_orchid1, sizeof(__pyx_k_orchid1), 0, 0, 1, 1}, {&__pyx_n_s_orchid2, __pyx_k_orchid2, sizeof(__pyx_k_orchid2), 0, 0, 1, 1}, {&__pyx_n_s_orchid3, __pyx_k_orchid3, sizeof(__pyx_k_orchid3), 0, 0, 1, 1}, {&__pyx_n_s_orchid4, __pyx_k_orchid4, sizeof(__pyx_k_orchid4), 0, 0, 1, 1}, {&__pyx_n_s_pack, __pyx_k_pack, sizeof(__pyx_k_pack), 0, 0, 1, 1}, {&__pyx_n_s_palegoldenrod, __pyx_k_palegoldenrod, sizeof(__pyx_k_palegoldenrod), 0, 0, 1, 1}, {&__pyx_n_s_palegreen, __pyx_k_palegreen, sizeof(__pyx_k_palegreen), 0, 0, 1, 1}, {&__pyx_n_s_palegreen1, __pyx_k_palegreen1, sizeof(__pyx_k_palegreen1), 0, 0, 1, 1}, {&__pyx_n_s_palegreen2, __pyx_k_palegreen2, sizeof(__pyx_k_palegreen2), 0, 0, 1, 1}, {&__pyx_n_s_palegreen3, __pyx_k_palegreen3, sizeof(__pyx_k_palegreen3), 0, 0, 1, 1}, {&__pyx_n_s_palegreen4, __pyx_k_palegreen4, sizeof(__pyx_k_palegreen4), 0, 0, 1, 1}, {&__pyx_n_s_paleturquoise, __pyx_k_paleturquoise, sizeof(__pyx_k_paleturquoise), 0, 0, 1, 1}, {&__pyx_n_s_paleturquoise1, __pyx_k_paleturquoise1, sizeof(__pyx_k_paleturquoise1), 0, 0, 1, 1}, {&__pyx_n_s_paleturquoise2, __pyx_k_paleturquoise2, sizeof(__pyx_k_paleturquoise2), 0, 0, 1, 1}, {&__pyx_n_s_paleturquoise3, __pyx_k_paleturquoise3, sizeof(__pyx_k_paleturquoise3), 0, 0, 1, 1}, {&__pyx_n_s_paleturquoise4, __pyx_k_paleturquoise4, sizeof(__pyx_k_paleturquoise4), 0, 0, 1, 1}, {&__pyx_n_s_palevioletred, __pyx_k_palevioletred, sizeof(__pyx_k_palevioletred), 0, 0, 1, 1}, {&__pyx_n_s_palevioletred1, __pyx_k_palevioletred1, sizeof(__pyx_k_palevioletred1), 0, 0, 1, 1}, {&__pyx_n_s_palevioletred2, __pyx_k_palevioletred2, sizeof(__pyx_k_palevioletred2), 0, 0, 1, 1}, {&__pyx_n_s_palevioletred3, __pyx_k_palevioletred3, sizeof(__pyx_k_palevioletred3), 0, 0, 1, 1}, {&__pyx_n_s_palevioletred4, __pyx_k_palevioletred4, sizeof(__pyx_k_palevioletred4), 0, 0, 1, 1}, {&__pyx_n_s_papayawhip, __pyx_k_papayawhip, sizeof(__pyx_k_papayawhip), 0, 0, 1, 1}, {&__pyx_n_s_peachpuff, __pyx_k_peachpuff, sizeof(__pyx_k_peachpuff), 0, 0, 1, 1}, {&__pyx_n_s_peachpuff1, __pyx_k_peachpuff1, sizeof(__pyx_k_peachpuff1), 0, 0, 1, 1}, {&__pyx_n_s_peachpuff2, __pyx_k_peachpuff2, sizeof(__pyx_k_peachpuff2), 0, 0, 1, 1}, {&__pyx_n_s_peachpuff3, __pyx_k_peachpuff3, sizeof(__pyx_k_peachpuff3), 0, 0, 1, 1}, {&__pyx_n_s_peachpuff4, __pyx_k_peachpuff4, sizeof(__pyx_k_peachpuff4), 0, 0, 1, 1}, {&__pyx_n_s_peru, __pyx_k_peru, sizeof(__pyx_k_peru), 0, 0, 1, 1}, {&__pyx_n_s_pink, __pyx_k_pink, sizeof(__pyx_k_pink), 0, 0, 1, 1}, {&__pyx_n_s_pink1, __pyx_k_pink1, sizeof(__pyx_k_pink1), 0, 0, 1, 1}, {&__pyx_n_s_pink2, __pyx_k_pink2, sizeof(__pyx_k_pink2), 0, 0, 1, 1}, {&__pyx_n_s_pink3, __pyx_k_pink3, sizeof(__pyx_k_pink3), 0, 0, 1, 1}, {&__pyx_n_s_pink4, __pyx_k_pink4, sizeof(__pyx_k_pink4), 0, 0, 1, 1}, {&__pyx_n_s_plum, __pyx_k_plum, sizeof(__pyx_k_plum), 0, 0, 1, 1}, {&__pyx_n_s_plum1, __pyx_k_plum1, sizeof(__pyx_k_plum1), 0, 0, 1, 1}, {&__pyx_n_s_plum2, __pyx_k_plum2, sizeof(__pyx_k_plum2), 0, 0, 1, 1}, {&__pyx_n_s_plum3, __pyx_k_plum3, sizeof(__pyx_k_plum3), 0, 0, 1, 1}, {&__pyx_n_s_plum4, __pyx_k_plum4, sizeof(__pyx_k_plum4), 0, 0, 1, 1}, {&__pyx_n_s_powderblue, __pyx_k_powderblue, sizeof(__pyx_k_powderblue), 0, 0, 1, 1}, {&__pyx_n_s_purple, __pyx_k_purple, sizeof(__pyx_k_purple), 0, 0, 1, 1}, {&__pyx_n_s_purple1, __pyx_k_purple1, sizeof(__pyx_k_purple1), 0, 0, 1, 1}, {&__pyx_n_s_purple2, __pyx_k_purple2, sizeof(__pyx_k_purple2), 0, 0, 1, 1}, {&__pyx_n_s_purple3, __pyx_k_purple3, sizeof(__pyx_k_purple3), 0, 0, 1, 1}, {&__pyx_n_s_purple4, __pyx_k_purple4, sizeof(__pyx_k_purple4), 0, 0, 1, 1}, {&__pyx_n_s_pygame_sdl2_color, __pyx_k_pygame_sdl2_color, sizeof(__pyx_k_pygame_sdl2_color), 0, 0, 1, 1}, {&__pyx_n_s_pyx_vtable, __pyx_k_pyx_vtable, sizeof(__pyx_k_pyx_vtable), 0, 0, 1, 1}, {&__pyx_n_s_r, __pyx_k_r, sizeof(__pyx_k_r), 0, 0, 1, 1}, {&__pyx_n_s_rebeccapurple, __pyx_k_rebeccapurple, sizeof(__pyx_k_rebeccapurple), 0, 0, 1, 1}, {&__pyx_n_s_red, __pyx_k_red, sizeof(__pyx_k_red), 0, 0, 1, 1}, {&__pyx_n_s_red1, __pyx_k_red1, sizeof(__pyx_k_red1), 0, 0, 1, 1}, {&__pyx_n_s_red2, __pyx_k_red2, sizeof(__pyx_k_red2), 0, 0, 1, 1}, {&__pyx_n_s_red3, __pyx_k_red3, sizeof(__pyx_k_red3), 0, 0, 1, 1}, {&__pyx_n_s_red4, __pyx_k_red4, sizeof(__pyx_k_red4), 0, 0, 1, 1}, {&__pyx_n_s_rgba, __pyx_k_rgba, sizeof(__pyx_k_rgba), 0, 0, 1, 1}, {&__pyx_n_s_rosybrown, __pyx_k_rosybrown, sizeof(__pyx_k_rosybrown), 0, 0, 1, 1}, {&__pyx_n_s_rosybrown1, __pyx_k_rosybrown1, sizeof(__pyx_k_rosybrown1), 0, 0, 1, 1}, {&__pyx_n_s_rosybrown2, __pyx_k_rosybrown2, sizeof(__pyx_k_rosybrown2), 0, 0, 1, 1}, {&__pyx_n_s_rosybrown3, __pyx_k_rosybrown3, sizeof(__pyx_k_rosybrown3), 0, 0, 1, 1}, {&__pyx_n_s_rosybrown4, __pyx_k_rosybrown4, sizeof(__pyx_k_rosybrown4), 0, 0, 1, 1}, {&__pyx_n_s_round, __pyx_k_round, sizeof(__pyx_k_round), 0, 0, 1, 1}, {&__pyx_n_s_royalblue, __pyx_k_royalblue, sizeof(__pyx_k_royalblue), 0, 0, 1, 1}, {&__pyx_n_s_royalblue1, __pyx_k_royalblue1, sizeof(__pyx_k_royalblue1), 0, 0, 1, 1}, {&__pyx_n_s_royalblue2, __pyx_k_royalblue2, sizeof(__pyx_k_royalblue2), 0, 0, 1, 1}, {&__pyx_n_s_royalblue3, __pyx_k_royalblue3, sizeof(__pyx_k_royalblue3), 0, 0, 1, 1}, {&__pyx_n_s_royalblue4, __pyx_k_royalblue4, sizeof(__pyx_k_royalblue4), 0, 0, 1, 1}, {&__pyx_n_s_saddlebrown, __pyx_k_saddlebrown, sizeof(__pyx_k_saddlebrown), 0, 0, 1, 1}, {&__pyx_n_s_salmon, __pyx_k_salmon, sizeof(__pyx_k_salmon), 0, 0, 1, 1}, {&__pyx_n_s_salmon1, __pyx_k_salmon1, sizeof(__pyx_k_salmon1), 0, 0, 1, 1}, {&__pyx_n_s_salmon2, __pyx_k_salmon2, sizeof(__pyx_k_salmon2), 0, 0, 1, 1}, {&__pyx_n_s_salmon3, __pyx_k_salmon3, sizeof(__pyx_k_salmon3), 0, 0, 1, 1}, {&__pyx_n_s_salmon4, __pyx_k_salmon4, sizeof(__pyx_k_salmon4), 0, 0, 1, 1}, {&__pyx_n_s_sandybrown, __pyx_k_sandybrown, sizeof(__pyx_k_sandybrown), 0, 0, 1, 1}, {&__pyx_n_s_seagreen, __pyx_k_seagreen, sizeof(__pyx_k_seagreen), 0, 0, 1, 1}, {&__pyx_n_s_seagreen1, __pyx_k_seagreen1, sizeof(__pyx_k_seagreen1), 0, 0, 1, 1}, {&__pyx_n_s_seagreen2, __pyx_k_seagreen2, sizeof(__pyx_k_seagreen2), 0, 0, 1, 1}, {&__pyx_n_s_seagreen3, __pyx_k_seagreen3, sizeof(__pyx_k_seagreen3), 0, 0, 1, 1}, {&__pyx_n_s_seagreen4, __pyx_k_seagreen4, sizeof(__pyx_k_seagreen4), 0, 0, 1, 1}, {&__pyx_n_s_seashell, __pyx_k_seashell, sizeof(__pyx_k_seashell), 0, 0, 1, 1}, {&__pyx_n_s_seashell1, __pyx_k_seashell1, sizeof(__pyx_k_seashell1), 0, 0, 1, 1}, {&__pyx_n_s_seashell2, __pyx_k_seashell2, sizeof(__pyx_k_seashell2), 0, 0, 1, 1}, {&__pyx_n_s_seashell3, __pyx_k_seashell3, sizeof(__pyx_k_seashell3), 0, 0, 1, 1}, {&__pyx_n_s_seashell4, __pyx_k_seashell4, sizeof(__pyx_k_seashell4), 0, 0, 1, 1}, {&__pyx_n_s_sienna, __pyx_k_sienna, sizeof(__pyx_k_sienna), 0, 0, 1, 1}, {&__pyx_n_s_sienna1, __pyx_k_sienna1, sizeof(__pyx_k_sienna1), 0, 0, 1, 1}, {&__pyx_n_s_sienna2, __pyx_k_sienna2, sizeof(__pyx_k_sienna2), 0, 0, 1, 1}, {&__pyx_n_s_sienna3, __pyx_k_sienna3, sizeof(__pyx_k_sienna3), 0, 0, 1, 1}, {&__pyx_n_s_sienna4, __pyx_k_sienna4, sizeof(__pyx_k_sienna4), 0, 0, 1, 1}, {&__pyx_n_s_silver, __pyx_k_silver, sizeof(__pyx_k_silver), 0, 0, 1, 1}, {&__pyx_n_s_skyblue, __pyx_k_skyblue, sizeof(__pyx_k_skyblue), 0, 0, 1, 1}, {&__pyx_n_s_skyblue1, __pyx_k_skyblue1, sizeof(__pyx_k_skyblue1), 0, 0, 1, 1}, {&__pyx_n_s_skyblue2, __pyx_k_skyblue2, sizeof(__pyx_k_skyblue2), 0, 0, 1, 1}, {&__pyx_n_s_skyblue3, __pyx_k_skyblue3, sizeof(__pyx_k_skyblue3), 0, 0, 1, 1}, {&__pyx_n_s_skyblue4, __pyx_k_skyblue4, sizeof(__pyx_k_skyblue4), 0, 0, 1, 1}, {&__pyx_n_s_slateblue, __pyx_k_slateblue, sizeof(__pyx_k_slateblue), 0, 0, 1, 1}, {&__pyx_n_s_slateblue1, __pyx_k_slateblue1, sizeof(__pyx_k_slateblue1), 0, 0, 1, 1}, {&__pyx_n_s_slateblue2, __pyx_k_slateblue2, sizeof(__pyx_k_slateblue2), 0, 0, 1, 1}, {&__pyx_n_s_slateblue3, __pyx_k_slateblue3, sizeof(__pyx_k_slateblue3), 0, 0, 1, 1}, {&__pyx_n_s_slateblue4, __pyx_k_slateblue4, sizeof(__pyx_k_slateblue4), 0, 0, 1, 1}, {&__pyx_n_s_slategray, __pyx_k_slategray, sizeof(__pyx_k_slategray), 0, 0, 1, 1}, {&__pyx_n_s_slategray1, __pyx_k_slategray1, sizeof(__pyx_k_slategray1), 0, 0, 1, 1}, {&__pyx_n_s_slategray2, __pyx_k_slategray2, sizeof(__pyx_k_slategray2), 0, 0, 1, 1}, {&__pyx_n_s_slategray3, __pyx_k_slategray3, sizeof(__pyx_k_slategray3), 0, 0, 1, 1}, {&__pyx_n_s_slategray4, __pyx_k_slategray4, sizeof(__pyx_k_slategray4), 0, 0, 1, 1}, {&__pyx_n_s_slategrey, __pyx_k_slategrey, sizeof(__pyx_k_slategrey), 0, 0, 1, 1}, {&__pyx_n_s_snow, __pyx_k_snow, sizeof(__pyx_k_snow), 0, 0, 1, 1}, {&__pyx_n_s_snow1, __pyx_k_snow1, sizeof(__pyx_k_snow1), 0, 0, 1, 1}, {&__pyx_n_s_snow2, __pyx_k_snow2, sizeof(__pyx_k_snow2), 0, 0, 1, 1}, {&__pyx_n_s_snow3, __pyx_k_snow3, sizeof(__pyx_k_snow3), 0, 0, 1, 1}, {&__pyx_n_s_snow4, __pyx_k_snow4, sizeof(__pyx_k_snow4), 0, 0, 1, 1}, {&__pyx_n_s_split, __pyx_k_split, sizeof(__pyx_k_split), 0, 0, 1, 1}, {&__pyx_n_s_springgreen, __pyx_k_springgreen, sizeof(__pyx_k_springgreen), 0, 0, 1, 1}, {&__pyx_n_s_springgreen1, __pyx_k_springgreen1, sizeof(__pyx_k_springgreen1), 0, 0, 1, 1}, {&__pyx_n_s_springgreen2, __pyx_k_springgreen2, sizeof(__pyx_k_springgreen2), 0, 0, 1, 1}, {&__pyx_n_s_springgreen3, __pyx_k_springgreen3, sizeof(__pyx_k_springgreen3), 0, 0, 1, 1}, {&__pyx_n_s_springgreen4, __pyx_k_springgreen4, sizeof(__pyx_k_springgreen4), 0, 0, 1, 1}, {&__pyx_n_s_startswith, __pyx_k_startswith, sizeof(__pyx_k_startswith), 0, 0, 1, 1}, {&__pyx_n_s_steelblue, __pyx_k_steelblue, sizeof(__pyx_k_steelblue), 0, 0, 1, 1}, {&__pyx_n_s_steelblue1, __pyx_k_steelblue1, sizeof(__pyx_k_steelblue1), 0, 0, 1, 1}, {&__pyx_n_s_steelblue2, __pyx_k_steelblue2, sizeof(__pyx_k_steelblue2), 0, 0, 1, 1}, {&__pyx_n_s_steelblue3, __pyx_k_steelblue3, sizeof(__pyx_k_steelblue3), 0, 0, 1, 1}, {&__pyx_n_s_steelblue4, __pyx_k_steelblue4, sizeof(__pyx_k_steelblue4), 0, 0, 1, 1}, {&__pyx_n_s_struct, __pyx_k_struct, sizeof(__pyx_k_struct), 0, 0, 1, 1}, {&__pyx_n_s_tan, __pyx_k_tan, sizeof(__pyx_k_tan), 0, 0, 1, 1}, {&__pyx_n_s_tan1, __pyx_k_tan1, sizeof(__pyx_k_tan1), 0, 0, 1, 1}, {&__pyx_n_s_tan2, __pyx_k_tan2, sizeof(__pyx_k_tan2), 0, 0, 1, 1}, {&__pyx_n_s_tan3, __pyx_k_tan3, sizeof(__pyx_k_tan3), 0, 0, 1, 1}, {&__pyx_n_s_tan4, __pyx_k_tan4, sizeof(__pyx_k_tan4), 0, 0, 1, 1}, {&__pyx_n_s_teal, __pyx_k_teal, sizeof(__pyx_k_teal), 0, 0, 1, 1}, {&__pyx_n_s_test, __pyx_k_test, sizeof(__pyx_k_test), 0, 0, 1, 1}, {&__pyx_n_s_thistle, __pyx_k_thistle, sizeof(__pyx_k_thistle), 0, 0, 1, 1}, {&__pyx_n_s_thistle1, __pyx_k_thistle1, sizeof(__pyx_k_thistle1), 0, 0, 1, 1}, {&__pyx_n_s_thistle2, __pyx_k_thistle2, sizeof(__pyx_k_thistle2), 0, 0, 1, 1}, {&__pyx_n_s_thistle3, __pyx_k_thistle3, sizeof(__pyx_k_thistle3), 0, 0, 1, 1}, {&__pyx_n_s_thistle4, __pyx_k_thistle4, sizeof(__pyx_k_thistle4), 0, 0, 1, 1}, {&__pyx_n_s_tomato, __pyx_k_tomato, sizeof(__pyx_k_tomato), 0, 0, 1, 1}, {&__pyx_n_s_tomato1, __pyx_k_tomato1, sizeof(__pyx_k_tomato1), 0, 0, 1, 1}, {&__pyx_n_s_tomato2, __pyx_k_tomato2, sizeof(__pyx_k_tomato2), 0, 0, 1, 1}, {&__pyx_n_s_tomato3, __pyx_k_tomato3, sizeof(__pyx_k_tomato3), 0, 0, 1, 1}, {&__pyx_n_s_tomato4, __pyx_k_tomato4, sizeof(__pyx_k_tomato4), 0, 0, 1, 1}, {&__pyx_n_s_turquoise, __pyx_k_turquoise, sizeof(__pyx_k_turquoise), 0, 0, 1, 1}, {&__pyx_n_s_turquoise1, __pyx_k_turquoise1, sizeof(__pyx_k_turquoise1), 0, 0, 1, 1}, {&__pyx_n_s_turquoise2, __pyx_k_turquoise2, sizeof(__pyx_k_turquoise2), 0, 0, 1, 1}, {&__pyx_n_s_turquoise3, __pyx_k_turquoise3, sizeof(__pyx_k_turquoise3), 0, 0, 1, 1}, {&__pyx_n_s_turquoise4, __pyx_k_turquoise4, sizeof(__pyx_k_turquoise4), 0, 0, 1, 1}, {&__pyx_n_s_unhexlify, __pyx_k_unhexlify, sizeof(__pyx_k_unhexlify), 0, 0, 1, 1}, {&__pyx_n_s_unpack, __pyx_k_unpack, sizeof(__pyx_k_unpack), 0, 0, 1, 1}, {&__pyx_n_s_violet, __pyx_k_violet, sizeof(__pyx_k_violet), 0, 0, 1, 1}, {&__pyx_n_s_violetred, __pyx_k_violetred, sizeof(__pyx_k_violetred), 0, 0, 1, 1}, {&__pyx_n_s_violetred1, __pyx_k_violetred1, sizeof(__pyx_k_violetred1), 0, 0, 1, 1}, {&__pyx_n_s_violetred2, __pyx_k_violetred2, sizeof(__pyx_k_violetred2), 0, 0, 1, 1}, {&__pyx_n_s_violetred3, __pyx_k_violetred3, sizeof(__pyx_k_violetred3), 0, 0, 1, 1}, {&__pyx_n_s_violetred4, __pyx_k_violetred4, sizeof(__pyx_k_violetred4), 0, 0, 1, 1}, {&__pyx_n_s_webgray, __pyx_k_webgray, sizeof(__pyx_k_webgray), 0, 0, 1, 1}, {&__pyx_n_s_webgreen, __pyx_k_webgreen, sizeof(__pyx_k_webgreen), 0, 0, 1, 1}, {&__pyx_n_s_webgrey, __pyx_k_webgrey, sizeof(__pyx_k_webgrey), 0, 0, 1, 1}, {&__pyx_n_s_webmaroon, __pyx_k_webmaroon, sizeof(__pyx_k_webmaroon), 0, 0, 1, 1}, {&__pyx_n_s_webpurple, __pyx_k_webpurple, sizeof(__pyx_k_webpurple), 0, 0, 1, 1}, {&__pyx_n_s_wheat, __pyx_k_wheat, sizeof(__pyx_k_wheat), 0, 0, 1, 1}, {&__pyx_n_s_wheat1, __pyx_k_wheat1, sizeof(__pyx_k_wheat1), 0, 0, 1, 1}, {&__pyx_n_s_wheat2, __pyx_k_wheat2, sizeof(__pyx_k_wheat2), 0, 0, 1, 1}, {&__pyx_n_s_wheat3, __pyx_k_wheat3, sizeof(__pyx_k_wheat3), 0, 0, 1, 1}, {&__pyx_n_s_wheat4, __pyx_k_wheat4, sizeof(__pyx_k_wheat4), 0, 0, 1, 1}, {&__pyx_n_s_white, __pyx_k_white, sizeof(__pyx_k_white), 0, 0, 1, 1}, {&__pyx_n_s_whitesmoke, __pyx_k_whitesmoke, sizeof(__pyx_k_whitesmoke), 0, 0, 1, 1}, {&__pyx_n_s_x11gray, __pyx_k_x11gray, sizeof(__pyx_k_x11gray), 0, 0, 1, 1}, {&__pyx_n_s_x11green, __pyx_k_x11green, sizeof(__pyx_k_x11green), 0, 0, 1, 1}, {&__pyx_n_s_x11grey, __pyx_k_x11grey, sizeof(__pyx_k_x11grey), 0, 0, 1, 1}, {&__pyx_n_s_x11maroon, __pyx_k_x11maroon, sizeof(__pyx_k_x11maroon), 0, 0, 1, 1}, {&__pyx_n_s_x11purple, __pyx_k_x11purple, sizeof(__pyx_k_x11purple), 0, 0, 1, 1}, {&__pyx_n_s_yellow, __pyx_k_yellow, sizeof(__pyx_k_yellow), 0, 0, 1, 1}, {&__pyx_n_s_yellow1, __pyx_k_yellow1, sizeof(__pyx_k_yellow1), 0, 0, 1, 1}, {&__pyx_n_s_yellow2, __pyx_k_yellow2, sizeof(__pyx_k_yellow2), 0, 0, 1, 1}, {&__pyx_n_s_yellow3, __pyx_k_yellow3, sizeof(__pyx_k_yellow3), 0, 0, 1, 1}, {&__pyx_n_s_yellow4, __pyx_k_yellow4, sizeof(__pyx_k_yellow4), 0, 0, 1, 1}, {&__pyx_n_s_yellowgreen, __pyx_k_yellowgreen, sizeof(__pyx_k_yellowgreen), 0, 0, 1, 1}, {0, 0, 0, 0, 0, 0, 0} }; static int __Pyx_InitCachedBuiltins(void) { __pyx_builtin_TypeError = __Pyx_GetBuiltinName(__pyx_n_s_TypeError); if (!__pyx_builtin_TypeError) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 41; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_builtin_map = __Pyx_GetBuiltinName(__pyx_n_s_map); if (!__pyx_builtin_map) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 73; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_builtin_ValueError = __Pyx_GetBuiltinName(__pyx_n_s_ValueError); if (!__pyx_builtin_ValueError) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 82; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_builtin_KeyError = __Pyx_GetBuiltinName(__pyx_n_s_KeyError); if (!__pyx_builtin_KeyError) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 94; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_builtin_hex = __Pyx_GetBuiltinName(__pyx_n_s_hex); if (!__pyx_builtin_hex) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 153; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_builtin_oct = __Pyx_GetBuiltinName(__pyx_n_s_oct); if (!__pyx_builtin_oct) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 156; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_builtin_IndexError = __Pyx_GetBuiltinName(__pyx_n_s_IndexError); if (!__pyx_builtin_IndexError) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 173; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_builtin_round = __Pyx_GetBuiltinName(__pyx_n_s_round); if (!__pyx_builtin_round) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 453; __pyx_clineno = __LINE__; goto __pyx_L1_error;} return 0; __pyx_L1_error:; return -1; } static int __Pyx_InitCachedConstants(void) { __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__Pyx_InitCachedConstants", 0); /* "pygame_sdl2/color.pyx":41 * return color * else: * raise TypeError("Expected a color.") # <<<<<<<<<<<<<< * * return SDL_MapRGBA(surface.format, r, g, b, a) */ __pyx_tuple_ = PyTuple_Pack(1, __pyx_kp_s_Expected_a_color); if (unlikely(!__pyx_tuple_)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 41; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_tuple_); __Pyx_GIVEREF(__pyx_tuple_); /* "pygame_sdl2/color.pyx":122 * c = args[0] * if isinstance(c, basestring): * if c.startswith('#'): # <<<<<<<<<<<<<< * self.from_hex(c[1:]) * elif c.startswith('0x'): */ __pyx_tuple__4 = PyTuple_Pack(1, __pyx_kp_s__3); if (unlikely(!__pyx_tuple__4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 122; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_tuple__4); __Pyx_GIVEREF(__pyx_tuple__4); /* "pygame_sdl2/color.pyx":123 * if isinstance(c, basestring): * if c.startswith('#'): * self.from_hex(c[1:]) # <<<<<<<<<<<<<< * elif c.startswith('0x'): * self.from_hex(c[2:]) */ __pyx_slice__5 = PySlice_New(__pyx_int_1, Py_None, Py_None); if (unlikely(!__pyx_slice__5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 123; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_slice__5); __Pyx_GIVEREF(__pyx_slice__5); /* "pygame_sdl2/color.pyx":124 * if c.startswith('#'): * self.from_hex(c[1:]) * elif c.startswith('0x'): # <<<<<<<<<<<<<< * self.from_hex(c[2:]) * else: */ __pyx_tuple__6 = PyTuple_Pack(1, __pyx_kp_s_0x); if (unlikely(!__pyx_tuple__6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 124; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_tuple__6); __Pyx_GIVEREF(__pyx_tuple__6); /* "pygame_sdl2/color.pyx":125 * self.from_hex(c[1:]) * elif c.startswith('0x'): * self.from_hex(c[2:]) # <<<<<<<<<<<<<< * else: * self.from_name(c) */ __pyx_slice__7 = PySlice_New(__pyx_int_2, Py_None, Py_None); if (unlikely(!__pyx_slice__7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 125; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_slice__7); __Pyx_GIVEREF(__pyx_slice__7); /* "pygame_sdl2/color.pyx":228 * def __mod__(self not None, Color rhs not None): * * def mod(l, r): # <<<<<<<<<<<<<< * if r == 0: * return 0 */ __pyx_tuple__8 = PyTuple_Pack(2, __pyx_n_s_l, __pyx_n_s_r); if (unlikely(!__pyx_tuple__8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 228; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_tuple__8); __Pyx_GIVEREF(__pyx_tuple__8); __pyx_codeobj__9 = (PyObject*)__Pyx_PyCode_New(2, 0, 2, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__8, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_tom_ab_pygame_sdl2_src_pyg, __pyx_n_s_mod, 228, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 228; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "pygame_sdl2/color.pyx":251 * def __floordiv__(self not None, Color rhs not None): * * def div(a, b): # <<<<<<<<<<<<<< * if b == 0: * return b */ __pyx_tuple__10 = PyTuple_Pack(2, __pyx_n_s_a, __pyx_n_s_b); if (unlikely(!__pyx_tuple__10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 251; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_tuple__10); __Pyx_GIVEREF(__pyx_tuple__10); __pyx_codeobj__11 = (PyObject*)__Pyx_PyCode_New(2, 0, 2, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__10, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_tom_ab_pygame_sdl2_src_pyg, __pyx_n_s_div, 251, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 251; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "include/color_dict.pxi":5 * * cdef object colors = { * 'aliceblue' : (240, 248, 255), # <<<<<<<<<<<<<< * 'antiquewhite' : (250, 235, 215), * 'antiquewhite1' : (255, 239, 219), */ __pyx_tuple__12 = PyTuple_Pack(3, __pyx_int_240, __pyx_int_248, __pyx_int_255); if (unlikely(!__pyx_tuple__12)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_tuple__12); __Pyx_GIVEREF(__pyx_tuple__12); /* "include/color_dict.pxi":6 * cdef object colors = { * 'aliceblue' : (240, 248, 255), * 'antiquewhite' : (250, 235, 215), # <<<<<<<<<<<<<< * 'antiquewhite1' : (255, 239, 219), * 'antiquewhite2' : (238, 223, 204), */ __pyx_tuple__13 = PyTuple_Pack(3, __pyx_int_250, __pyx_int_235, __pyx_int_215); if (unlikely(!__pyx_tuple__13)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_tuple__13); __Pyx_GIVEREF(__pyx_tuple__13); /* "include/color_dict.pxi":7 * 'aliceblue' : (240, 248, 255), * 'antiquewhite' : (250, 235, 215), * 'antiquewhite1' : (255, 239, 219), # <<<<<<<<<<<<<< * 'antiquewhite2' : (238, 223, 204), * 'antiquewhite3' : (205, 192, 176), */ __pyx_tuple__14 = PyTuple_Pack(3, __pyx_int_255, __pyx_int_239, __pyx_int_219); if (unlikely(!__pyx_tuple__14)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_tuple__14); __Pyx_GIVEREF(__pyx_tuple__14); /* "include/color_dict.pxi":8 * 'antiquewhite' : (250, 235, 215), * 'antiquewhite1' : (255, 239, 219), * 'antiquewhite2' : (238, 223, 204), # <<<<<<<<<<<<<< * 'antiquewhite3' : (205, 192, 176), * 'antiquewhite4' : (139, 131, 120), */ __pyx_tuple__15 = PyTuple_Pack(3, __pyx_int_238, __pyx_int_223, __pyx_int_204); if (unlikely(!__pyx_tuple__15)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_tuple__15); __Pyx_GIVEREF(__pyx_tuple__15); /* "include/color_dict.pxi":9 * 'antiquewhite1' : (255, 239, 219), * 'antiquewhite2' : (238, 223, 204), * 'antiquewhite3' : (205, 192, 176), # <<<<<<<<<<<<<< * 'antiquewhite4' : (139, 131, 120), * 'aqua' : (0, 255, 255), */ __pyx_tuple__16 = PyTuple_Pack(3, __pyx_int_205, __pyx_int_192, __pyx_int_176); if (unlikely(!__pyx_tuple__16)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 9; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_tuple__16); __Pyx_GIVEREF(__pyx_tuple__16); /* "include/color_dict.pxi":10 * 'antiquewhite2' : (238, 223, 204), * 'antiquewhite3' : (205, 192, 176), * 'antiquewhite4' : (139, 131, 120), # <<<<<<<<<<<<<< * 'aqua' : (0, 255, 255), * 'aquamarine' : (127, 255, 212), */ __pyx_tuple__17 = PyTuple_Pack(3, __pyx_int_139, __pyx_int_131, __pyx_int_120); if (unlikely(!__pyx_tuple__17)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 10; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_tuple__17); __Pyx_GIVEREF(__pyx_tuple__17); /* "include/color_dict.pxi":11 * 'antiquewhite3' : (205, 192, 176), * 'antiquewhite4' : (139, 131, 120), * 'aqua' : (0, 255, 255), # <<<<<<<<<<<<<< * 'aquamarine' : (127, 255, 212), * 'aquamarine1' : (127, 255, 212), */ __pyx_tuple__18 = PyTuple_Pack(3, __pyx_int_0, __pyx_int_255, __pyx_int_255); if (unlikely(!__pyx_tuple__18)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 11; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_tuple__18); __Pyx_GIVEREF(__pyx_tuple__18); /* "include/color_dict.pxi":12 * 'antiquewhite4' : (139, 131, 120), * 'aqua' : (0, 255, 255), * 'aquamarine' : (127, 255, 212), # <<<<<<<<<<<<<< * 'aquamarine1' : (127, 255, 212), * 'aquamarine2' : (118, 238, 198), */ __pyx_tuple__19 = PyTuple_Pack(3, __pyx_int_127, __pyx_int_255, __pyx_int_212); if (unlikely(!__pyx_tuple__19)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 12; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_tuple__19); __Pyx_GIVEREF(__pyx_tuple__19); /* "include/color_dict.pxi":13 * 'aqua' : (0, 255, 255), * 'aquamarine' : (127, 255, 212), * 'aquamarine1' : (127, 255, 212), # <<<<<<<<<<<<<< * 'aquamarine2' : (118, 238, 198), * 'aquamarine3' : (102, 205, 170), */ __pyx_tuple__20 = PyTuple_Pack(3, __pyx_int_127, __pyx_int_255, __pyx_int_212); if (unlikely(!__pyx_tuple__20)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 13; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_tuple__20); __Pyx_GIVEREF(__pyx_tuple__20); /* "include/color_dict.pxi":14 * 'aquamarine' : (127, 255, 212), * 'aquamarine1' : (127, 255, 212), * 'aquamarine2' : (118, 238, 198), # <<<<<<<<<<<<<< * 'aquamarine3' : (102, 205, 170), * 'aquamarine4' : (69, 139, 116), */ __pyx_tuple__21 = PyTuple_Pack(3, __pyx_int_118, __pyx_int_238, __pyx_int_198); if (unlikely(!__pyx_tuple__21)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 14; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_tuple__21); __Pyx_GIVEREF(__pyx_tuple__21); /* "include/color_dict.pxi":15 * 'aquamarine1' : (127, 255, 212), * 'aquamarine2' : (118, 238, 198), * 'aquamarine3' : (102, 205, 170), # <<<<<<<<<<<<<< * 'aquamarine4' : (69, 139, 116), * 'azure' : (240, 255, 255), */ __pyx_tuple__22 = PyTuple_Pack(3, __pyx_int_102, __pyx_int_205, __pyx_int_170); if (unlikely(!__pyx_tuple__22)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 15; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_tuple__22); __Pyx_GIVEREF(__pyx_tuple__22); /* "include/color_dict.pxi":16 * 'aquamarine2' : (118, 238, 198), * 'aquamarine3' : (102, 205, 170), * 'aquamarine4' : (69, 139, 116), # <<<<<<<<<<<<<< * 'azure' : (240, 255, 255), * 'azure1' : (240, 255, 255), */ __pyx_tuple__23 = PyTuple_Pack(3, __pyx_int_69, __pyx_int_139, __pyx_int_116); if (unlikely(!__pyx_tuple__23)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 16; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_tuple__23); __Pyx_GIVEREF(__pyx_tuple__23); /* "include/color_dict.pxi":17 * 'aquamarine3' : (102, 205, 170), * 'aquamarine4' : (69, 139, 116), * 'azure' : (240, 255, 255), # <<<<<<<<<<<<<< * 'azure1' : (240, 255, 255), * 'azure2' : (224, 238, 238), */ __pyx_tuple__24 = PyTuple_Pack(3, __pyx_int_240, __pyx_int_255, __pyx_int_255); if (unlikely(!__pyx_tuple__24)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 17; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_tuple__24); __Pyx_GIVEREF(__pyx_tuple__24); /* "include/color_dict.pxi":18 * 'aquamarine4' : (69, 139, 116), * 'azure' : (240, 255, 255), * 'azure1' : (240, 255, 255), # <<<<<<<<<<<<<< * 'azure2' : (224, 238, 238), * 'azure3' : (193, 205, 205), */ __pyx_tuple__25 = PyTuple_Pack(3, __pyx_int_240, __pyx_int_255, __pyx_int_255); if (unlikely(!__pyx_tuple__25)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 18; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_tuple__25); __Pyx_GIVEREF(__pyx_tuple__25); /* "include/color_dict.pxi":19 * 'azure' : (240, 255, 255), * 'azure1' : (240, 255, 255), * 'azure2' : (224, 238, 238), # <<<<<<<<<<<<<< * 'azure3' : (193, 205, 205), * 'azure4' : (131, 139, 139), */ __pyx_tuple__26 = PyTuple_Pack(3, __pyx_int_224, __pyx_int_238, __pyx_int_238); if (unlikely(!__pyx_tuple__26)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 19; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_tuple__26); __Pyx_GIVEREF(__pyx_tuple__26); /* "include/color_dict.pxi":20 * 'azure1' : (240, 255, 255), * 'azure2' : (224, 238, 238), * 'azure3' : (193, 205, 205), # <<<<<<<<<<<<<< * 'azure4' : (131, 139, 139), * 'beige' : (245, 245, 220), */ __pyx_tuple__27 = PyTuple_Pack(3, __pyx_int_193, __pyx_int_205, __pyx_int_205); if (unlikely(!__pyx_tuple__27)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 20; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_tuple__27); __Pyx_GIVEREF(__pyx_tuple__27); /* "include/color_dict.pxi":21 * 'azure2' : (224, 238, 238), * 'azure3' : (193, 205, 205), * 'azure4' : (131, 139, 139), # <<<<<<<<<<<<<< * 'beige' : (245, 245, 220), * 'bisque' : (255, 228, 196), */ __pyx_tuple__28 = PyTuple_Pack(3, __pyx_int_131, __pyx_int_139, __pyx_int_139); if (unlikely(!__pyx_tuple__28)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 21; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_tuple__28); __Pyx_GIVEREF(__pyx_tuple__28); /* "include/color_dict.pxi":22 * 'azure3' : (193, 205, 205), * 'azure4' : (131, 139, 139), * 'beige' : (245, 245, 220), # <<<<<<<<<<<<<< * 'bisque' : (255, 228, 196), * 'bisque1' : (255, 228, 196), */ __pyx_tuple__29 = PyTuple_Pack(3, __pyx_int_245, __pyx_int_245, __pyx_int_220); if (unlikely(!__pyx_tuple__29)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 22; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_tuple__29); __Pyx_GIVEREF(__pyx_tuple__29); /* "include/color_dict.pxi":23 * 'azure4' : (131, 139, 139), * 'beige' : (245, 245, 220), * 'bisque' : (255, 228, 196), # <<<<<<<<<<<<<< * 'bisque1' : (255, 228, 196), * 'bisque2' : (238, 213, 183), */ __pyx_tuple__30 = PyTuple_Pack(3, __pyx_int_255, __pyx_int_228, __pyx_int_196); if (unlikely(!__pyx_tuple__30)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 23; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_tuple__30); __Pyx_GIVEREF(__pyx_tuple__30); /* "include/color_dict.pxi":24 * 'beige' : (245, 245, 220), * 'bisque' : (255, 228, 196), * 'bisque1' : (255, 228, 196), # <<<<<<<<<<<<<< * 'bisque2' : (238, 213, 183), * 'bisque3' : (205, 183, 158), */ __pyx_tuple__31 = PyTuple_Pack(3, __pyx_int_255, __pyx_int_228, __pyx_int_196); if (unlikely(!__pyx_tuple__31)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 24; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_tuple__31); __Pyx_GIVEREF(__pyx_tuple__31); /* "include/color_dict.pxi":25 * 'bisque' : (255, 228, 196), * 'bisque1' : (255, 228, 196), * 'bisque2' : (238, 213, 183), # <<<<<<<<<<<<<< * 'bisque3' : (205, 183, 158), * 'bisque4' : (139, 125, 107), */ __pyx_tuple__32 = PyTuple_Pack(3, __pyx_int_238, __pyx_int_213, __pyx_int_183); if (unlikely(!__pyx_tuple__32)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 25; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_tuple__32); __Pyx_GIVEREF(__pyx_tuple__32); /* "include/color_dict.pxi":26 * 'bisque1' : (255, 228, 196), * 'bisque2' : (238, 213, 183), * 'bisque3' : (205, 183, 158), # <<<<<<<<<<<<<< * 'bisque4' : (139, 125, 107), * 'black' : (0, 0, 0), */ __pyx_tuple__33 = PyTuple_Pack(3, __pyx_int_205, __pyx_int_183, __pyx_int_158); if (unlikely(!__pyx_tuple__33)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 26; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_tuple__33); __Pyx_GIVEREF(__pyx_tuple__33); /* "include/color_dict.pxi":27 * 'bisque2' : (238, 213, 183), * 'bisque3' : (205, 183, 158), * 'bisque4' : (139, 125, 107), # <<<<<<<<<<<<<< * 'black' : (0, 0, 0), * 'blanchedalmond' : (255, 235, 205), */ __pyx_tuple__34 = PyTuple_Pack(3, __pyx_int_139, __pyx_int_125, __pyx_int_107); if (unlikely(!__pyx_tuple__34)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 27; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_tuple__34); __Pyx_GIVEREF(__pyx_tuple__34); /* "include/color_dict.pxi":28 * 'bisque3' : (205, 183, 158), * 'bisque4' : (139, 125, 107), * 'black' : (0, 0, 0), # <<<<<<<<<<<<<< * 'blanchedalmond' : (255, 235, 205), * 'blue' : (0, 0, 255), */ __pyx_tuple__35 = PyTuple_Pack(3, __pyx_int_0, __pyx_int_0, __pyx_int_0); if (unlikely(!__pyx_tuple__35)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 28; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_tuple__35); __Pyx_GIVEREF(__pyx_tuple__35); /* "include/color_dict.pxi":29 * 'bisque4' : (139, 125, 107), * 'black' : (0, 0, 0), * 'blanchedalmond' : (255, 235, 205), # <<<<<<<<<<<<<< * 'blue' : (0, 0, 255), * 'blue1' : (0, 0, 255), */ __pyx_tuple__36 = PyTuple_Pack(3, __pyx_int_255, __pyx_int_235, __pyx_int_205); if (unlikely(!__pyx_tuple__36)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 29; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_tuple__36); __Pyx_GIVEREF(__pyx_tuple__36); /* "include/color_dict.pxi":30 * 'black' : (0, 0, 0), * 'blanchedalmond' : (255, 235, 205), * 'blue' : (0, 0, 255), # <<<<<<<<<<<<<< * 'blue1' : (0, 0, 255), * 'blue2' : (0, 0, 238), */ __pyx_tuple__37 = PyTuple_Pack(3, __pyx_int_0, __pyx_int_0, __pyx_int_255); if (unlikely(!__pyx_tuple__37)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 30; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_tuple__37); __Pyx_GIVEREF(__pyx_tuple__37); /* "include/color_dict.pxi":31 * 'blanchedalmond' : (255, 235, 205), * 'blue' : (0, 0, 255), * 'blue1' : (0, 0, 255), # <<<<<<<<<<<<<< * 'blue2' : (0, 0, 238), * 'blue3' : (0, 0, 205), */ __pyx_tuple__38 = PyTuple_Pack(3, __pyx_int_0, __pyx_int_0, __pyx_int_255); if (unlikely(!__pyx_tuple__38)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 31; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_tuple__38); __Pyx_GIVEREF(__pyx_tuple__38); /* "include/color_dict.pxi":32 * 'blue' : (0, 0, 255), * 'blue1' : (0, 0, 255), * 'blue2' : (0, 0, 238), # <<<<<<<<<<<<<< * 'blue3' : (0, 0, 205), * 'blue4' : (0, 0, 139), */ __pyx_tuple__39 = PyTuple_Pack(3, __pyx_int_0, __pyx_int_0, __pyx_int_238); if (unlikely(!__pyx_tuple__39)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 32; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_tuple__39); __Pyx_GIVEREF(__pyx_tuple__39); /* "include/color_dict.pxi":33 * 'blue1' : (0, 0, 255), * 'blue2' : (0, 0, 238), * 'blue3' : (0, 0, 205), # <<<<<<<<<<<<<< * 'blue4' : (0, 0, 139), * 'blueviolet' : (138, 43, 226), */ __pyx_tuple__40 = PyTuple_Pack(3, __pyx_int_0, __pyx_int_0, __pyx_int_205); if (unlikely(!__pyx_tuple__40)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 33; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_tuple__40); __Pyx_GIVEREF(__pyx_tuple__40); /* "include/color_dict.pxi":34 * 'blue2' : (0, 0, 238), * 'blue3' : (0, 0, 205), * 'blue4' : (0, 0, 139), # <<<<<<<<<<<<<< * 'blueviolet' : (138, 43, 226), * 'brown' : (165, 42, 42), */ __pyx_tuple__41 = PyTuple_Pack(3, __pyx_int_0, __pyx_int_0, __pyx_int_139); if (unlikely(!__pyx_tuple__41)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 34; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_tuple__41); __Pyx_GIVEREF(__pyx_tuple__41); /* "include/color_dict.pxi":35 * 'blue3' : (0, 0, 205), * 'blue4' : (0, 0, 139), * 'blueviolet' : (138, 43, 226), # <<<<<<<<<<<<<< * 'brown' : (165, 42, 42), * 'brown1' : (255, 64, 64), */ __pyx_tuple__42 = PyTuple_Pack(3, __pyx_int_138, __pyx_int_43, __pyx_int_226); if (unlikely(!__pyx_tuple__42)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 35; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_tuple__42); __Pyx_GIVEREF(__pyx_tuple__42); /* "include/color_dict.pxi":36 * 'blue4' : (0, 0, 139), * 'blueviolet' : (138, 43, 226), * 'brown' : (165, 42, 42), # <<<<<<<<<<<<<< * 'brown1' : (255, 64, 64), * 'brown2' : (238, 59, 59), */ __pyx_tuple__43 = PyTuple_Pack(3, __pyx_int_165, __pyx_int_42, __pyx_int_42); if (unlikely(!__pyx_tuple__43)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 36; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_tuple__43); __Pyx_GIVEREF(__pyx_tuple__43); /* "include/color_dict.pxi":37 * 'blueviolet' : (138, 43, 226), * 'brown' : (165, 42, 42), * 'brown1' : (255, 64, 64), # <<<<<<<<<<<<<< * 'brown2' : (238, 59, 59), * 'brown3' : (205, 51, 51), */ __pyx_tuple__44 = PyTuple_Pack(3, __pyx_int_255, __pyx_int_64, __pyx_int_64); if (unlikely(!__pyx_tuple__44)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 37; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_tuple__44); __Pyx_GIVEREF(__pyx_tuple__44); /* "include/color_dict.pxi":38 * 'brown' : (165, 42, 42), * 'brown1' : (255, 64, 64), * 'brown2' : (238, 59, 59), # <<<<<<<<<<<<<< * 'brown3' : (205, 51, 51), * 'brown4' : (139, 35, 35), */ __pyx_tuple__45 = PyTuple_Pack(3, __pyx_int_238, __pyx_int_59, __pyx_int_59); if (unlikely(!__pyx_tuple__45)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 38; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_tuple__45); __Pyx_GIVEREF(__pyx_tuple__45); /* "include/color_dict.pxi":39 * 'brown1' : (255, 64, 64), * 'brown2' : (238, 59, 59), * 'brown3' : (205, 51, 51), # <<<<<<<<<<<<<< * 'brown4' : (139, 35, 35), * 'burlywood' : (222, 184, 135), */ __pyx_tuple__46 = PyTuple_Pack(3, __pyx_int_205, __pyx_int_51, __pyx_int_51); if (unlikely(!__pyx_tuple__46)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 39; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_tuple__46); __Pyx_GIVEREF(__pyx_tuple__46); /* "include/color_dict.pxi":40 * 'brown2' : (238, 59, 59), * 'brown3' : (205, 51, 51), * 'brown4' : (139, 35, 35), # <<<<<<<<<<<<<< * 'burlywood' : (222, 184, 135), * 'burlywood1' : (255, 211, 155), */ __pyx_tuple__47 = PyTuple_Pack(3, __pyx_int_139, __pyx_int_35, __pyx_int_35); if (unlikely(!__pyx_tuple__47)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 40; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_tuple__47); __Pyx_GIVEREF(__pyx_tuple__47); /* "include/color_dict.pxi":41 * 'brown3' : (205, 51, 51), * 'brown4' : (139, 35, 35), * 'burlywood' : (222, 184, 135), # <<<<<<<<<<<<<< * 'burlywood1' : (255, 211, 155), * 'burlywood2' : (238, 197, 145), */ __pyx_tuple__48 = PyTuple_Pack(3, __pyx_int_222, __pyx_int_184, __pyx_int_135); if (unlikely(!__pyx_tuple__48)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 41; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_tuple__48); __Pyx_GIVEREF(__pyx_tuple__48); /* "include/color_dict.pxi":42 * 'brown4' : (139, 35, 35), * 'burlywood' : (222, 184, 135), * 'burlywood1' : (255, 211, 155), # <<<<<<<<<<<<<< * 'burlywood2' : (238, 197, 145), * 'burlywood3' : (205, 170, 125), */ __pyx_tuple__49 = PyTuple_Pack(3, __pyx_int_255, __pyx_int_211, __pyx_int_155); if (unlikely(!__pyx_tuple__49)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 42; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_tuple__49); __Pyx_GIVEREF(__pyx_tuple__49); /* "include/color_dict.pxi":43 * 'burlywood' : (222, 184, 135), * 'burlywood1' : (255, 211, 155), * 'burlywood2' : (238, 197, 145), # <<<<<<<<<<<<<< * 'burlywood3' : (205, 170, 125), * 'burlywood4' : (139, 115, 85), */ __pyx_tuple__50 = PyTuple_Pack(3, __pyx_int_238, __pyx_int_197, __pyx_int_145); if (unlikely(!__pyx_tuple__50)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 43; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_tuple__50); __Pyx_GIVEREF(__pyx_tuple__50); /* "include/color_dict.pxi":44 * 'burlywood1' : (255, 211, 155), * 'burlywood2' : (238, 197, 145), * 'burlywood3' : (205, 170, 125), # <<<<<<<<<<<<<< * 'burlywood4' : (139, 115, 85), * 'cadetblue' : (95, 158, 160), */ __pyx_tuple__51 = PyTuple_Pack(3, __pyx_int_205, __pyx_int_170, __pyx_int_125); if (unlikely(!__pyx_tuple__51)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 44; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_tuple__51); __Pyx_GIVEREF(__pyx_tuple__51); /* "include/color_dict.pxi":45 * 'burlywood2' : (238, 197, 145), * 'burlywood3' : (205, 170, 125), * 'burlywood4' : (139, 115, 85), # <<<<<<<<<<<<<< * 'cadetblue' : (95, 158, 160), * 'cadetblue1' : (152, 245, 255), */ __pyx_tuple__52 = PyTuple_Pack(3, __pyx_int_139, __pyx_int_115, __pyx_int_85); if (unlikely(!__pyx_tuple__52)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 45; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_tuple__52); __Pyx_GIVEREF(__pyx_tuple__52); /* "include/color_dict.pxi":46 * 'burlywood3' : (205, 170, 125), * 'burlywood4' : (139, 115, 85), * 'cadetblue' : (95, 158, 160), # <<<<<<<<<<<<<< * 'cadetblue1' : (152, 245, 255), * 'cadetblue2' : (142, 229, 238), */ __pyx_tuple__53 = PyTuple_Pack(3, __pyx_int_95, __pyx_int_158, __pyx_int_160); if (unlikely(!__pyx_tuple__53)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 46; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_tuple__53); __Pyx_GIVEREF(__pyx_tuple__53); /* "include/color_dict.pxi":47 * 'burlywood4' : (139, 115, 85), * 'cadetblue' : (95, 158, 160), * 'cadetblue1' : (152, 245, 255), # <<<<<<<<<<<<<< * 'cadetblue2' : (142, 229, 238), * 'cadetblue3' : (122, 197, 205), */ __pyx_tuple__54 = PyTuple_Pack(3, __pyx_int_152, __pyx_int_245, __pyx_int_255); if (unlikely(!__pyx_tuple__54)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 47; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_tuple__54); __Pyx_GIVEREF(__pyx_tuple__54); /* "include/color_dict.pxi":48 * 'cadetblue' : (95, 158, 160), * 'cadetblue1' : (152, 245, 255), * 'cadetblue2' : (142, 229, 238), # <<<<<<<<<<<<<< * 'cadetblue3' : (122, 197, 205), * 'cadetblue4' : (83, 134, 139), */ __pyx_tuple__55 = PyTuple_Pack(3, __pyx_int_142, __pyx_int_229, __pyx_int_238); if (unlikely(!__pyx_tuple__55)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 48; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_tuple__55); __Pyx_GIVEREF(__pyx_tuple__55); /* "include/color_dict.pxi":49 * 'cadetblue1' : (152, 245, 255), * 'cadetblue2' : (142, 229, 238), * 'cadetblue3' : (122, 197, 205), # <<<<<<<<<<<<<< * 'cadetblue4' : (83, 134, 139), * 'chartreuse' : (127, 255, 0), */ __pyx_tuple__56 = PyTuple_Pack(3, __pyx_int_122, __pyx_int_197, __pyx_int_205); if (unlikely(!__pyx_tuple__56)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 49; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_tuple__56); __Pyx_GIVEREF(__pyx_tuple__56); /* "include/color_dict.pxi":50 * 'cadetblue2' : (142, 229, 238), * 'cadetblue3' : (122, 197, 205), * 'cadetblue4' : (83, 134, 139), # <<<<<<<<<<<<<< * 'chartreuse' : (127, 255, 0), * 'chartreuse1' : (127, 255, 0), */ __pyx_tuple__57 = PyTuple_Pack(3, __pyx_int_83, __pyx_int_134, __pyx_int_139); if (unlikely(!__pyx_tuple__57)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 50; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_tuple__57); __Pyx_GIVEREF(__pyx_tuple__57); /* "include/color_dict.pxi":51 * 'cadetblue3' : (122, 197, 205), * 'cadetblue4' : (83, 134, 139), * 'chartreuse' : (127, 255, 0), # <<<<<<<<<<<<<< * 'chartreuse1' : (127, 255, 0), * 'chartreuse2' : (118, 238, 0), */ __pyx_tuple__58 = PyTuple_Pack(3, __pyx_int_127, __pyx_int_255, __pyx_int_0); if (unlikely(!__pyx_tuple__58)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 51; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_tuple__58); __Pyx_GIVEREF(__pyx_tuple__58); /* "include/color_dict.pxi":52 * 'cadetblue4' : (83, 134, 139), * 'chartreuse' : (127, 255, 0), * 'chartreuse1' : (127, 255, 0), # <<<<<<<<<<<<<< * 'chartreuse2' : (118, 238, 0), * 'chartreuse3' : (102, 205, 0), */ __pyx_tuple__59 = PyTuple_Pack(3, __pyx_int_127, __pyx_int_255, __pyx_int_0); if (unlikely(!__pyx_tuple__59)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 52; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_tuple__59); __Pyx_GIVEREF(__pyx_tuple__59); /* "include/color_dict.pxi":53 * 'chartreuse' : (127, 255, 0), * 'chartreuse1' : (127, 255, 0), * 'chartreuse2' : (118, 238, 0), # <<<<<<<<<<<<<< * 'chartreuse3' : (102, 205, 0), * 'chartreuse4' : (69, 139, 0), */ __pyx_tuple__60 = PyTuple_Pack(3, __pyx_int_118, __pyx_int_238, __pyx_int_0); if (unlikely(!__pyx_tuple__60)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 53; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_tuple__60); __Pyx_GIVEREF(__pyx_tuple__60); /* "include/color_dict.pxi":54 * 'chartreuse1' : (127, 255, 0), * 'chartreuse2' : (118, 238, 0), * 'chartreuse3' : (102, 205, 0), # <<<<<<<<<<<<<< * 'chartreuse4' : (69, 139, 0), * 'chocolate' : (210, 105, 30), */ __pyx_tuple__61 = PyTuple_Pack(3, __pyx_int_102, __pyx_int_205, __pyx_int_0); if (unlikely(!__pyx_tuple__61)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 54; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_tuple__61); __Pyx_GIVEREF(__pyx_tuple__61); /* "include/color_dict.pxi":55 * 'chartreuse2' : (118, 238, 0), * 'chartreuse3' : (102, 205, 0), * 'chartreuse4' : (69, 139, 0), # <<<<<<<<<<<<<< * 'chocolate' : (210, 105, 30), * 'chocolate1' : (255, 127, 36), */ __pyx_tuple__62 = PyTuple_Pack(3, __pyx_int_69, __pyx_int_139, __pyx_int_0); if (unlikely(!__pyx_tuple__62)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 55; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_tuple__62); __Pyx_GIVEREF(__pyx_tuple__62); /* "include/color_dict.pxi":56 * 'chartreuse3' : (102, 205, 0), * 'chartreuse4' : (69, 139, 0), * 'chocolate' : (210, 105, 30), # <<<<<<<<<<<<<< * 'chocolate1' : (255, 127, 36), * 'chocolate2' : (238, 118, 33), */ __pyx_tuple__63 = PyTuple_Pack(3, __pyx_int_210, __pyx_int_105, __pyx_int_30); if (unlikely(!__pyx_tuple__63)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 56; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_tuple__63); __Pyx_GIVEREF(__pyx_tuple__63); /* "include/color_dict.pxi":57 * 'chartreuse4' : (69, 139, 0), * 'chocolate' : (210, 105, 30), * 'chocolate1' : (255, 127, 36), # <<<<<<<<<<<<<< * 'chocolate2' : (238, 118, 33), * 'chocolate3' : (205, 102, 29), */ __pyx_tuple__64 = PyTuple_Pack(3, __pyx_int_255, __pyx_int_127, __pyx_int_36); if (unlikely(!__pyx_tuple__64)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 57; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_tuple__64); __Pyx_GIVEREF(__pyx_tuple__64); /* "include/color_dict.pxi":58 * 'chocolate' : (210, 105, 30), * 'chocolate1' : (255, 127, 36), * 'chocolate2' : (238, 118, 33), # <<<<<<<<<<<<<< * 'chocolate3' : (205, 102, 29), * 'chocolate4' : (139, 69, 19), */ __pyx_tuple__65 = PyTuple_Pack(3, __pyx_int_238, __pyx_int_118, __pyx_int_33); if (unlikely(!__pyx_tuple__65)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 58; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_tuple__65); __Pyx_GIVEREF(__pyx_tuple__65); /* "include/color_dict.pxi":59 * 'chocolate1' : (255, 127, 36), * 'chocolate2' : (238, 118, 33), * 'chocolate3' : (205, 102, 29), # <<<<<<<<<<<<<< * 'chocolate4' : (139, 69, 19), * 'coral' : (255, 127, 80), */ __pyx_tuple__66 = PyTuple_Pack(3, __pyx_int_205, __pyx_int_102, __pyx_int_29); if (unlikely(!__pyx_tuple__66)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 59; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_tuple__66); __Pyx_GIVEREF(__pyx_tuple__66); /* "include/color_dict.pxi":60 * 'chocolate2' : (238, 118, 33), * 'chocolate3' : (205, 102, 29), * 'chocolate4' : (139, 69, 19), # <<<<<<<<<<<<<< * 'coral' : (255, 127, 80), * 'coral1' : (255, 114, 86), */ __pyx_tuple__67 = PyTuple_Pack(3, __pyx_int_139, __pyx_int_69, __pyx_int_19); if (unlikely(!__pyx_tuple__67)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 60; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_tuple__67); __Pyx_GIVEREF(__pyx_tuple__67); /* "include/color_dict.pxi":61 * 'chocolate3' : (205, 102, 29), * 'chocolate4' : (139, 69, 19), * 'coral' : (255, 127, 80), # <<<<<<<<<<<<<< * 'coral1' : (255, 114, 86), * 'coral2' : (238, 106, 80), */ __pyx_tuple__68 = PyTuple_Pack(3, __pyx_int_255, __pyx_int_127, __pyx_int_80); if (unlikely(!__pyx_tuple__68)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 61; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_tuple__68); __Pyx_GIVEREF(__pyx_tuple__68); /* "include/color_dict.pxi":62 * 'chocolate4' : (139, 69, 19), * 'coral' : (255, 127, 80), * 'coral1' : (255, 114, 86), # <<<<<<<<<<<<<< * 'coral2' : (238, 106, 80), * 'coral3' : (205, 91, 69), */ __pyx_tuple__69 = PyTuple_Pack(3, __pyx_int_255, __pyx_int_114, __pyx_int_86); if (unlikely(!__pyx_tuple__69)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 62; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_tuple__69); __Pyx_GIVEREF(__pyx_tuple__69); /* "include/color_dict.pxi":63 * 'coral' : (255, 127, 80), * 'coral1' : (255, 114, 86), * 'coral2' : (238, 106, 80), # <<<<<<<<<<<<<< * 'coral3' : (205, 91, 69), * 'coral4' : (139, 62, 47), */ __pyx_tuple__70 = PyTuple_Pack(3, __pyx_int_238, __pyx_int_106, __pyx_int_80); if (unlikely(!__pyx_tuple__70)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 63; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_tuple__70); __Pyx_GIVEREF(__pyx_tuple__70); /* "include/color_dict.pxi":64 * 'coral1' : (255, 114, 86), * 'coral2' : (238, 106, 80), * 'coral3' : (205, 91, 69), # <<<<<<<<<<<<<< * 'coral4' : (139, 62, 47), * 'cornflowerblue' : (100, 149, 237), */ __pyx_tuple__71 = PyTuple_Pack(3, __pyx_int_205, __pyx_int_91, __pyx_int_69); if (unlikely(!__pyx_tuple__71)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 64; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_tuple__71); __Pyx_GIVEREF(__pyx_tuple__71); /* "include/color_dict.pxi":65 * 'coral2' : (238, 106, 80), * 'coral3' : (205, 91, 69), * 'coral4' : (139, 62, 47), # <<<<<<<<<<<<<< * 'cornflowerblue' : (100, 149, 237), * 'cornsilk' : (255, 248, 220), */ __pyx_tuple__72 = PyTuple_Pack(3, __pyx_int_139, __pyx_int_62, __pyx_int_47); if (unlikely(!__pyx_tuple__72)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 65; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_tuple__72); __Pyx_GIVEREF(__pyx_tuple__72); /* "include/color_dict.pxi":66 * 'coral3' : (205, 91, 69), * 'coral4' : (139, 62, 47), * 'cornflowerblue' : (100, 149, 237), # <<<<<<<<<<<<<< * 'cornsilk' : (255, 248, 220), * 'cornsilk1' : (255, 248, 220), */ __pyx_tuple__73 = PyTuple_Pack(3, __pyx_int_100, __pyx_int_149, __pyx_int_237); if (unlikely(!__pyx_tuple__73)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 66; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_tuple__73); __Pyx_GIVEREF(__pyx_tuple__73); /* "include/color_dict.pxi":67 * 'coral4' : (139, 62, 47), * 'cornflowerblue' : (100, 149, 237), * 'cornsilk' : (255, 248, 220), # <<<<<<<<<<<<<< * 'cornsilk1' : (255, 248, 220), * 'cornsilk2' : (238, 232, 205), */ __pyx_tuple__74 = PyTuple_Pack(3, __pyx_int_255, __pyx_int_248, __pyx_int_220); if (unlikely(!__pyx_tuple__74)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 67; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_tuple__74); __Pyx_GIVEREF(__pyx_tuple__74); /* "include/color_dict.pxi":68 * 'cornflowerblue' : (100, 149, 237), * 'cornsilk' : (255, 248, 220), * 'cornsilk1' : (255, 248, 220), # <<<<<<<<<<<<<< * 'cornsilk2' : (238, 232, 205), * 'cornsilk3' : (205, 200, 177), */ __pyx_tuple__75 = PyTuple_Pack(3, __pyx_int_255, __pyx_int_248, __pyx_int_220); if (unlikely(!__pyx_tuple__75)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 68; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_tuple__75); __Pyx_GIVEREF(__pyx_tuple__75); /* "include/color_dict.pxi":69 * 'cornsilk' : (255, 248, 220), * 'cornsilk1' : (255, 248, 220), * 'cornsilk2' : (238, 232, 205), # <<<<<<<<<<<<<< * 'cornsilk3' : (205, 200, 177), * 'cornsilk4' : (139, 136, 120), */ __pyx_tuple__76 = PyTuple_Pack(3, __pyx_int_238, __pyx_int_232, __pyx_int_205); if (unlikely(!__pyx_tuple__76)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 69; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_tuple__76); __Pyx_GIVEREF(__pyx_tuple__76); /* "include/color_dict.pxi":70 * 'cornsilk1' : (255, 248, 220), * 'cornsilk2' : (238, 232, 205), * 'cornsilk3' : (205, 200, 177), # <<<<<<<<<<<<<< * 'cornsilk4' : (139, 136, 120), * 'crimson' : (220, 20, 60), */ __pyx_tuple__77 = PyTuple_Pack(3, __pyx_int_205, __pyx_int_200, __pyx_int_177); if (unlikely(!__pyx_tuple__77)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 70; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_tuple__77); __Pyx_GIVEREF(__pyx_tuple__77); /* "include/color_dict.pxi":71 * 'cornsilk2' : (238, 232, 205), * 'cornsilk3' : (205, 200, 177), * 'cornsilk4' : (139, 136, 120), # <<<<<<<<<<<<<< * 'crimson' : (220, 20, 60), * 'cyan' : (0, 255, 255), */ __pyx_tuple__78 = PyTuple_Pack(3, __pyx_int_139, __pyx_int_136, __pyx_int_120); if (unlikely(!__pyx_tuple__78)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 71; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_tuple__78); __Pyx_GIVEREF(__pyx_tuple__78); /* "include/color_dict.pxi":72 * 'cornsilk3' : (205, 200, 177), * 'cornsilk4' : (139, 136, 120), * 'crimson' : (220, 20, 60), # <<<<<<<<<<<<<< * 'cyan' : (0, 255, 255), * 'cyan1' : (0, 255, 255), */ __pyx_tuple__79 = PyTuple_Pack(3, __pyx_int_220, __pyx_int_20, __pyx_int_60); if (unlikely(!__pyx_tuple__79)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 72; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_tuple__79); __Pyx_GIVEREF(__pyx_tuple__79); /* "include/color_dict.pxi":73 * 'cornsilk4' : (139, 136, 120), * 'crimson' : (220, 20, 60), * 'cyan' : (0, 255, 255), # <<<<<<<<<<<<<< * 'cyan1' : (0, 255, 255), * 'cyan2' : (0, 238, 238), */ __pyx_tuple__80 = PyTuple_Pack(3, __pyx_int_0, __pyx_int_255, __pyx_int_255); if (unlikely(!__pyx_tuple__80)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 73; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_tuple__80); __Pyx_GIVEREF(__pyx_tuple__80); /* "include/color_dict.pxi":74 * 'crimson' : (220, 20, 60), * 'cyan' : (0, 255, 255), * 'cyan1' : (0, 255, 255), # <<<<<<<<<<<<<< * 'cyan2' : (0, 238, 238), * 'cyan3' : (0, 205, 205), */ __pyx_tuple__81 = PyTuple_Pack(3, __pyx_int_0, __pyx_int_255, __pyx_int_255); if (unlikely(!__pyx_tuple__81)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 74; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_tuple__81); __Pyx_GIVEREF(__pyx_tuple__81); /* "include/color_dict.pxi":75 * 'cyan' : (0, 255, 255), * 'cyan1' : (0, 255, 255), * 'cyan2' : (0, 238, 238), # <<<<<<<<<<<<<< * 'cyan3' : (0, 205, 205), * 'cyan4' : (0, 139, 139), */ __pyx_tuple__82 = PyTuple_Pack(3, __pyx_int_0, __pyx_int_238, __pyx_int_238); if (unlikely(!__pyx_tuple__82)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 75; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_tuple__82); __Pyx_GIVEREF(__pyx_tuple__82); /* "include/color_dict.pxi":76 * 'cyan1' : (0, 255, 255), * 'cyan2' : (0, 238, 238), * 'cyan3' : (0, 205, 205), # <<<<<<<<<<<<<< * 'cyan4' : (0, 139, 139), * 'darkblue' : (0, 0, 139), */ __pyx_tuple__83 = PyTuple_Pack(3, __pyx_int_0, __pyx_int_205, __pyx_int_205); if (unlikely(!__pyx_tuple__83)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 76; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_tuple__83); __Pyx_GIVEREF(__pyx_tuple__83); /* "include/color_dict.pxi":77 * 'cyan2' : (0, 238, 238), * 'cyan3' : (0, 205, 205), * 'cyan4' : (0, 139, 139), # <<<<<<<<<<<<<< * 'darkblue' : (0, 0, 139), * 'darkcyan' : (0, 139, 139), */ __pyx_tuple__84 = PyTuple_Pack(3, __pyx_int_0, __pyx_int_139, __pyx_int_139); if (unlikely(!__pyx_tuple__84)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 77; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_tuple__84); __Pyx_GIVEREF(__pyx_tuple__84); /* "include/color_dict.pxi":78 * 'cyan3' : (0, 205, 205), * 'cyan4' : (0, 139, 139), * 'darkblue' : (0, 0, 139), # <<<<<<<<<<<<<< * 'darkcyan' : (0, 139, 139), * 'darkgoldenrod' : (184, 134, 11), */ __pyx_tuple__85 = PyTuple_Pack(3, __pyx_int_0, __pyx_int_0, __pyx_int_139); if (unlikely(!__pyx_tuple__85)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 78; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_tuple__85); __Pyx_GIVEREF(__pyx_tuple__85); /* "include/color_dict.pxi":79 * 'cyan4' : (0, 139, 139), * 'darkblue' : (0, 0, 139), * 'darkcyan' : (0, 139, 139), # <<<<<<<<<<<<<< * 'darkgoldenrod' : (184, 134, 11), * 'darkgoldenrod1' : (255, 185, 15), */ __pyx_tuple__86 = PyTuple_Pack(3, __pyx_int_0, __pyx_int_139, __pyx_int_139); if (unlikely(!__pyx_tuple__86)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 79; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_tuple__86); __Pyx_GIVEREF(__pyx_tuple__86); /* "include/color_dict.pxi":80 * 'darkblue' : (0, 0, 139), * 'darkcyan' : (0, 139, 139), * 'darkgoldenrod' : (184, 134, 11), # <<<<<<<<<<<<<< * 'darkgoldenrod1' : (255, 185, 15), * 'darkgoldenrod2' : (238, 173, 14), */ __pyx_tuple__87 = PyTuple_Pack(3, __pyx_int_184, __pyx_int_134, __pyx_int_11); if (unlikely(!__pyx_tuple__87)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 80; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_tuple__87); __Pyx_GIVEREF(__pyx_tuple__87); /* "include/color_dict.pxi":81 * 'darkcyan' : (0, 139, 139), * 'darkgoldenrod' : (184, 134, 11), * 'darkgoldenrod1' : (255, 185, 15), # <<<<<<<<<<<<<< * 'darkgoldenrod2' : (238, 173, 14), * 'darkgoldenrod3' : (205, 149, 12), */ __pyx_tuple__88 = PyTuple_Pack(3, __pyx_int_255, __pyx_int_185, __pyx_int_15); if (unlikely(!__pyx_tuple__88)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 81; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_tuple__88); __Pyx_GIVEREF(__pyx_tuple__88); /* "include/color_dict.pxi":82 * 'darkgoldenrod' : (184, 134, 11), * 'darkgoldenrod1' : (255, 185, 15), * 'darkgoldenrod2' : (238, 173, 14), # <<<<<<<<<<<<<< * 'darkgoldenrod3' : (205, 149, 12), * 'darkgoldenrod4' : (139, 101, 8), */ __pyx_tuple__89 = PyTuple_Pack(3, __pyx_int_238, __pyx_int_173, __pyx_int_14); if (unlikely(!__pyx_tuple__89)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 82; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_tuple__89); __Pyx_GIVEREF(__pyx_tuple__89); /* "include/color_dict.pxi":83 * 'darkgoldenrod1' : (255, 185, 15), * 'darkgoldenrod2' : (238, 173, 14), * 'darkgoldenrod3' : (205, 149, 12), # <<<<<<<<<<<<<< * 'darkgoldenrod4' : (139, 101, 8), * 'darkgray' : (169, 169, 169), */ __pyx_tuple__90 = PyTuple_Pack(3, __pyx_int_205, __pyx_int_149, __pyx_int_12); if (unlikely(!__pyx_tuple__90)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 83; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_tuple__90); __Pyx_GIVEREF(__pyx_tuple__90); /* "include/color_dict.pxi":84 * 'darkgoldenrod2' : (238, 173, 14), * 'darkgoldenrod3' : (205, 149, 12), * 'darkgoldenrod4' : (139, 101, 8), # <<<<<<<<<<<<<< * 'darkgray' : (169, 169, 169), * 'darkgreen' : (0, 100, 0), */ __pyx_tuple__91 = PyTuple_Pack(3, __pyx_int_139, __pyx_int_101, __pyx_int_8); if (unlikely(!__pyx_tuple__91)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 84; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_tuple__91); __Pyx_GIVEREF(__pyx_tuple__91); /* "include/color_dict.pxi":85 * 'darkgoldenrod3' : (205, 149, 12), * 'darkgoldenrod4' : (139, 101, 8), * 'darkgray' : (169, 169, 169), # <<<<<<<<<<<<<< * 'darkgreen' : (0, 100, 0), * 'darkgrey' : (169, 169, 169), */ __pyx_tuple__92 = PyTuple_Pack(3, __pyx_int_169, __pyx_int_169, __pyx_int_169); if (unlikely(!__pyx_tuple__92)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 85; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_tuple__92); __Pyx_GIVEREF(__pyx_tuple__92); /* "include/color_dict.pxi":86 * 'darkgoldenrod4' : (139, 101, 8), * 'darkgray' : (169, 169, 169), * 'darkgreen' : (0, 100, 0), # <<<<<<<<<<<<<< * 'darkgrey' : (169, 169, 169), * 'darkkhaki' : (189, 183, 107), */ __pyx_tuple__93 = PyTuple_Pack(3, __pyx_int_0, __pyx_int_100, __pyx_int_0); if (unlikely(!__pyx_tuple__93)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 86; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_tuple__93); __Pyx_GIVEREF(__pyx_tuple__93); /* "include/color_dict.pxi":87 * 'darkgray' : (169, 169, 169), * 'darkgreen' : (0, 100, 0), * 'darkgrey' : (169, 169, 169), # <<<<<<<<<<<<<< * 'darkkhaki' : (189, 183, 107), * 'darkmagenta' : (139, 0, 139), */ __pyx_tuple__94 = PyTuple_Pack(3, __pyx_int_169, __pyx_int_169, __pyx_int_169); if (unlikely(!__pyx_tuple__94)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 87; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_tuple__94); __Pyx_GIVEREF(__pyx_tuple__94); /* "include/color_dict.pxi":88 * 'darkgreen' : (0, 100, 0), * 'darkgrey' : (169, 169, 169), * 'darkkhaki' : (189, 183, 107), # <<<<<<<<<<<<<< * 'darkmagenta' : (139, 0, 139), * 'darkolivegreen' : (85, 107, 47), */ __pyx_tuple__95 = PyTuple_Pack(3, __pyx_int_189, __pyx_int_183, __pyx_int_107); if (unlikely(!__pyx_tuple__95)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 88; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_tuple__95); __Pyx_GIVEREF(__pyx_tuple__95); /* "include/color_dict.pxi":89 * 'darkgrey' : (169, 169, 169), * 'darkkhaki' : (189, 183, 107), * 'darkmagenta' : (139, 0, 139), # <<<<<<<<<<<<<< * 'darkolivegreen' : (85, 107, 47), * 'darkolivegreen1' : (202, 255, 112), */ __pyx_tuple__96 = PyTuple_Pack(3, __pyx_int_139, __pyx_int_0, __pyx_int_139); if (unlikely(!__pyx_tuple__96)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 89; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_tuple__96); __Pyx_GIVEREF(__pyx_tuple__96); /* "include/color_dict.pxi":90 * 'darkkhaki' : (189, 183, 107), * 'darkmagenta' : (139, 0, 139), * 'darkolivegreen' : (85, 107, 47), # <<<<<<<<<<<<<< * 'darkolivegreen1' : (202, 255, 112), * 'darkolivegreen2' : (188, 238, 104), */ __pyx_tuple__97 = PyTuple_Pack(3, __pyx_int_85, __pyx_int_107, __pyx_int_47); if (unlikely(!__pyx_tuple__97)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 90; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_tuple__97); __Pyx_GIVEREF(__pyx_tuple__97); /* "include/color_dict.pxi":91 * 'darkmagenta' : (139, 0, 139), * 'darkolivegreen' : (85, 107, 47), * 'darkolivegreen1' : (202, 255, 112), # <<<<<<<<<<<<<< * 'darkolivegreen2' : (188, 238, 104), * 'darkolivegreen3' : (162, 205, 90), */ __pyx_tuple__98 = PyTuple_Pack(3, __pyx_int_202, __pyx_int_255, __pyx_int_112); if (unlikely(!__pyx_tuple__98)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 91; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_tuple__98); __Pyx_GIVEREF(__pyx_tuple__98); /* "include/color_dict.pxi":92 * 'darkolivegreen' : (85, 107, 47), * 'darkolivegreen1' : (202, 255, 112), * 'darkolivegreen2' : (188, 238, 104), # <<<<<<<<<<<<<< * 'darkolivegreen3' : (162, 205, 90), * 'darkolivegreen4' : (110, 139, 61), */ __pyx_tuple__99 = PyTuple_Pack(3, __pyx_int_188, __pyx_int_238, __pyx_int_104); if (unlikely(!__pyx_tuple__99)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 92; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_tuple__99); __Pyx_GIVEREF(__pyx_tuple__99); /* "include/color_dict.pxi":93 * 'darkolivegreen1' : (202, 255, 112), * 'darkolivegreen2' : (188, 238, 104), * 'darkolivegreen3' : (162, 205, 90), # <<<<<<<<<<<<<< * 'darkolivegreen4' : (110, 139, 61), * 'darkorange' : (255, 140, 0), */ __pyx_tuple__100 = PyTuple_Pack(3, __pyx_int_162, __pyx_int_205, __pyx_int_90); if (unlikely(!__pyx_tuple__100)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 93; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_tuple__100); __Pyx_GIVEREF(__pyx_tuple__100); /* "include/color_dict.pxi":94 * 'darkolivegreen2' : (188, 238, 104), * 'darkolivegreen3' : (162, 205, 90), * 'darkolivegreen4' : (110, 139, 61), # <<<<<<<<<<<<<< * 'darkorange' : (255, 140, 0), * 'darkorange1' : (255, 127, 0), */ __pyx_tuple__101 = PyTuple_Pack(3, __pyx_int_110, __pyx_int_139, __pyx_int_61); if (unlikely(!__pyx_tuple__101)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 94; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_tuple__101); __Pyx_GIVEREF(__pyx_tuple__101); /* "include/color_dict.pxi":95 * 'darkolivegreen3' : (162, 205, 90), * 'darkolivegreen4' : (110, 139, 61), * 'darkorange' : (255, 140, 0), # <<<<<<<<<<<<<< * 'darkorange1' : (255, 127, 0), * 'darkorange2' : (238, 118, 0), */ __pyx_tuple__102 = PyTuple_Pack(3, __pyx_int_255, __pyx_int_140, __pyx_int_0); if (unlikely(!__pyx_tuple__102)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 95; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_tuple__102); __Pyx_GIVEREF(__pyx_tuple__102); /* "include/color_dict.pxi":96 * 'darkolivegreen4' : (110, 139, 61), * 'darkorange' : (255, 140, 0), * 'darkorange1' : (255, 127, 0), # <<<<<<<<<<<<<< * 'darkorange2' : (238, 118, 0), * 'darkorange3' : (205, 102, 0), */ __pyx_tuple__103 = PyTuple_Pack(3, __pyx_int_255, __pyx_int_127, __pyx_int_0); if (unlikely(!__pyx_tuple__103)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 96; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_tuple__103); __Pyx_GIVEREF(__pyx_tuple__103); /* "include/color_dict.pxi":97 * 'darkorange' : (255, 140, 0), * 'darkorange1' : (255, 127, 0), * 'darkorange2' : (238, 118, 0), # <<<<<<<<<<<<<< * 'darkorange3' : (205, 102, 0), * 'darkorange4' : (139, 69, 0), */ __pyx_tuple__104 = PyTuple_Pack(3, __pyx_int_238, __pyx_int_118, __pyx_int_0); if (unlikely(!__pyx_tuple__104)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 97; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_tuple__104); __Pyx_GIVEREF(__pyx_tuple__104); /* "include/color_dict.pxi":98 * 'darkorange1' : (255, 127, 0), * 'darkorange2' : (238, 118, 0), * 'darkorange3' : (205, 102, 0), # <<<<<<<<<<<<<< * 'darkorange4' : (139, 69, 0), * 'darkorchid' : (153, 50, 204), */ __pyx_tuple__105 = PyTuple_Pack(3, __pyx_int_205, __pyx_int_102, __pyx_int_0); if (unlikely(!__pyx_tuple__105)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 98; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_tuple__105); __Pyx_GIVEREF(__pyx_tuple__105); /* "include/color_dict.pxi":99 * 'darkorange2' : (238, 118, 0), * 'darkorange3' : (205, 102, 0), * 'darkorange4' : (139, 69, 0), # <<<<<<<<<<<<<< * 'darkorchid' : (153, 50, 204), * 'darkorchid1' : (191, 62, 255), */ __pyx_tuple__106 = PyTuple_Pack(3, __pyx_int_139, __pyx_int_69, __pyx_int_0); if (unlikely(!__pyx_tuple__106)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 99; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_tuple__106); __Pyx_GIVEREF(__pyx_tuple__106); /* "include/color_dict.pxi":100 * 'darkorange3' : (205, 102, 0), * 'darkorange4' : (139, 69, 0), * 'darkorchid' : (153, 50, 204), # <<<<<<<<<<<<<< * 'darkorchid1' : (191, 62, 255), * 'darkorchid2' : (178, 58, 238), */ __pyx_tuple__107 = PyTuple_Pack(3, __pyx_int_153, __pyx_int_50, __pyx_int_204); if (unlikely(!__pyx_tuple__107)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 100; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_tuple__107); __Pyx_GIVEREF(__pyx_tuple__107); /* "include/color_dict.pxi":101 * 'darkorange4' : (139, 69, 0), * 'darkorchid' : (153, 50, 204), * 'darkorchid1' : (191, 62, 255), # <<<<<<<<<<<<<< * 'darkorchid2' : (178, 58, 238), * 'darkorchid3' : (154, 50, 205), */ __pyx_tuple__108 = PyTuple_Pack(3, __pyx_int_191, __pyx_int_62, __pyx_int_255); if (unlikely(!__pyx_tuple__108)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 101; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_tuple__108); __Pyx_GIVEREF(__pyx_tuple__108); /* "include/color_dict.pxi":102 * 'darkorchid' : (153, 50, 204), * 'darkorchid1' : (191, 62, 255), * 'darkorchid2' : (178, 58, 238), # <<<<<<<<<<<<<< * 'darkorchid3' : (154, 50, 205), * 'darkorchid4' : (104, 34, 139), */ __pyx_tuple__109 = PyTuple_Pack(3, __pyx_int_178, __pyx_int_58, __pyx_int_238); if (unlikely(!__pyx_tuple__109)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 102; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_tuple__109); __Pyx_GIVEREF(__pyx_tuple__109); /* "include/color_dict.pxi":103 * 'darkorchid1' : (191, 62, 255), * 'darkorchid2' : (178, 58, 238), * 'darkorchid3' : (154, 50, 205), # <<<<<<<<<<<<<< * 'darkorchid4' : (104, 34, 139), * 'darkred' : (139, 0, 0), */ __pyx_tuple__110 = PyTuple_Pack(3, __pyx_int_154, __pyx_int_50, __pyx_int_205); if (unlikely(!__pyx_tuple__110)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 103; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_tuple__110); __Pyx_GIVEREF(__pyx_tuple__110); /* "include/color_dict.pxi":104 * 'darkorchid2' : (178, 58, 238), * 'darkorchid3' : (154, 50, 205), * 'darkorchid4' : (104, 34, 139), # <<<<<<<<<<<<<< * 'darkred' : (139, 0, 0), * 'darksalmon' : (233, 150, 122), */ __pyx_tuple__111 = PyTuple_Pack(3, __pyx_int_104, __pyx_int_34, __pyx_int_139); if (unlikely(!__pyx_tuple__111)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 104; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_tuple__111); __Pyx_GIVEREF(__pyx_tuple__111); /* "include/color_dict.pxi":105 * 'darkorchid3' : (154, 50, 205), * 'darkorchid4' : (104, 34, 139), * 'darkred' : (139, 0, 0), # <<<<<<<<<<<<<< * 'darksalmon' : (233, 150, 122), * 'darkseagreen' : (143, 188, 143), */ __pyx_tuple__112 = PyTuple_Pack(3, __pyx_int_139, __pyx_int_0, __pyx_int_0); if (unlikely(!__pyx_tuple__112)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 105; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_tuple__112); __Pyx_GIVEREF(__pyx_tuple__112); /* "include/color_dict.pxi":106 * 'darkorchid4' : (104, 34, 139), * 'darkred' : (139, 0, 0), * 'darksalmon' : (233, 150, 122), # <<<<<<<<<<<<<< * 'darkseagreen' : (143, 188, 143), * 'darkseagreen1' : (193, 255, 193), */ __pyx_tuple__113 = PyTuple_Pack(3, __pyx_int_233, __pyx_int_150, __pyx_int_122); if (unlikely(!__pyx_tuple__113)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 106; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_tuple__113); __Pyx_GIVEREF(__pyx_tuple__113); /* "include/color_dict.pxi":107 * 'darkred' : (139, 0, 0), * 'darksalmon' : (233, 150, 122), * 'darkseagreen' : (143, 188, 143), # <<<<<<<<<<<<<< * 'darkseagreen1' : (193, 255, 193), * 'darkseagreen2' : (180, 238, 180), */ __pyx_tuple__114 = PyTuple_Pack(3, __pyx_int_143, __pyx_int_188, __pyx_int_143); if (unlikely(!__pyx_tuple__114)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 107; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_tuple__114); __Pyx_GIVEREF(__pyx_tuple__114); /* "include/color_dict.pxi":108 * 'darksalmon' : (233, 150, 122), * 'darkseagreen' : (143, 188, 143), * 'darkseagreen1' : (193, 255, 193), # <<<<<<<<<<<<<< * 'darkseagreen2' : (180, 238, 180), * 'darkseagreen3' : (155, 205, 155), */ __pyx_tuple__115 = PyTuple_Pack(3, __pyx_int_193, __pyx_int_255, __pyx_int_193); if (unlikely(!__pyx_tuple__115)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 108; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_tuple__115); __Pyx_GIVEREF(__pyx_tuple__115); /* "include/color_dict.pxi":109 * 'darkseagreen' : (143, 188, 143), * 'darkseagreen1' : (193, 255, 193), * 'darkseagreen2' : (180, 238, 180), # <<<<<<<<<<<<<< * 'darkseagreen3' : (155, 205, 155), * 'darkseagreen4' : (105, 139, 105), */ __pyx_tuple__116 = PyTuple_Pack(3, __pyx_int_180, __pyx_int_238, __pyx_int_180); if (unlikely(!__pyx_tuple__116)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 109; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_tuple__116); __Pyx_GIVEREF(__pyx_tuple__116); /* "include/color_dict.pxi":110 * 'darkseagreen1' : (193, 255, 193), * 'darkseagreen2' : (180, 238, 180), * 'darkseagreen3' : (155, 205, 155), # <<<<<<<<<<<<<< * 'darkseagreen4' : (105, 139, 105), * 'darkslateblue' : (72, 61, 139), */ __pyx_tuple__117 = PyTuple_Pack(3, __pyx_int_155, __pyx_int_205, __pyx_int_155); if (unlikely(!__pyx_tuple__117)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 110; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_tuple__117); __Pyx_GIVEREF(__pyx_tuple__117); /* "include/color_dict.pxi":111 * 'darkseagreen2' : (180, 238, 180), * 'darkseagreen3' : (155, 205, 155), * 'darkseagreen4' : (105, 139, 105), # <<<<<<<<<<<<<< * 'darkslateblue' : (72, 61, 139), * 'darkslategray' : (47, 79, 79), */ __pyx_tuple__118 = PyTuple_Pack(3, __pyx_int_105, __pyx_int_139, __pyx_int_105); if (unlikely(!__pyx_tuple__118)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 111; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_tuple__118); __Pyx_GIVEREF(__pyx_tuple__118); /* "include/color_dict.pxi":112 * 'darkseagreen3' : (155, 205, 155), * 'darkseagreen4' : (105, 139, 105), * 'darkslateblue' : (72, 61, 139), # <<<<<<<<<<<<<< * 'darkslategray' : (47, 79, 79), * 'darkslategray1' : (151, 255, 255), */ __pyx_tuple__119 = PyTuple_Pack(3, __pyx_int_72, __pyx_int_61, __pyx_int_139); if (unlikely(!__pyx_tuple__119)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 112; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_tuple__119); __Pyx_GIVEREF(__pyx_tuple__119); /* "include/color_dict.pxi":113 * 'darkseagreen4' : (105, 139, 105), * 'darkslateblue' : (72, 61, 139), * 'darkslategray' : (47, 79, 79), # <<<<<<<<<<<<<< * 'darkslategray1' : (151, 255, 255), * 'darkslategray2' : (141, 238, 238), */ __pyx_tuple__120 = PyTuple_Pack(3, __pyx_int_47, __pyx_int_79, __pyx_int_79); if (unlikely(!__pyx_tuple__120)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 113; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_tuple__120); __Pyx_GIVEREF(__pyx_tuple__120); /* "include/color_dict.pxi":114 * 'darkslateblue' : (72, 61, 139), * 'darkslategray' : (47, 79, 79), * 'darkslategray1' : (151, 255, 255), # <<<<<<<<<<<<<< * 'darkslategray2' : (141, 238, 238), * 'darkslategray3' : (121, 205, 205), */ __pyx_tuple__121 = PyTuple_Pack(3, __pyx_int_151, __pyx_int_255, __pyx_int_255); if (unlikely(!__pyx_tuple__121)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 114; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_tuple__121); __Pyx_GIVEREF(__pyx_tuple__121); /* "include/color_dict.pxi":115 * 'darkslategray' : (47, 79, 79), * 'darkslategray1' : (151, 255, 255), * 'darkslategray2' : (141, 238, 238), # <<<<<<<<<<<<<< * 'darkslategray3' : (121, 205, 205), * 'darkslategray4' : (82, 139, 139), */ __pyx_tuple__122 = PyTuple_Pack(3, __pyx_int_141, __pyx_int_238, __pyx_int_238); if (unlikely(!__pyx_tuple__122)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 115; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_tuple__122); __Pyx_GIVEREF(__pyx_tuple__122); /* "include/color_dict.pxi":116 * 'darkslategray1' : (151, 255, 255), * 'darkslategray2' : (141, 238, 238), * 'darkslategray3' : (121, 205, 205), # <<<<<<<<<<<<<< * 'darkslategray4' : (82, 139, 139), * 'darkslategrey' : (47, 79, 79), */ __pyx_tuple__123 = PyTuple_Pack(3, __pyx_int_121, __pyx_int_205, __pyx_int_205); if (unlikely(!__pyx_tuple__123)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 116; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_tuple__123); __Pyx_GIVEREF(__pyx_tuple__123); /* "include/color_dict.pxi":117 * 'darkslategray2' : (141, 238, 238), * 'darkslategray3' : (121, 205, 205), * 'darkslategray4' : (82, 139, 139), # <<<<<<<<<<<<<< * 'darkslategrey' : (47, 79, 79), * 'darkturquoise' : (0, 206, 209), */ __pyx_tuple__124 = PyTuple_Pack(3, __pyx_int_82, __pyx_int_139, __pyx_int_139); if (unlikely(!__pyx_tuple__124)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 117; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_tuple__124); __Pyx_GIVEREF(__pyx_tuple__124); /* "include/color_dict.pxi":118 * 'darkslategray3' : (121, 205, 205), * 'darkslategray4' : (82, 139, 139), * 'darkslategrey' : (47, 79, 79), # <<<<<<<<<<<<<< * 'darkturquoise' : (0, 206, 209), * 'darkviolet' : (148, 0, 211), */ __pyx_tuple__125 = PyTuple_Pack(3, __pyx_int_47, __pyx_int_79, __pyx_int_79); if (unlikely(!__pyx_tuple__125)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 118; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_tuple__125); __Pyx_GIVEREF(__pyx_tuple__125); /* "include/color_dict.pxi":119 * 'darkslategray4' : (82, 139, 139), * 'darkslategrey' : (47, 79, 79), * 'darkturquoise' : (0, 206, 209), # <<<<<<<<<<<<<< * 'darkviolet' : (148, 0, 211), * 'deeppink' : (255, 20, 147), */ __pyx_tuple__126 = PyTuple_Pack(3, __pyx_int_0, __pyx_int_206, __pyx_int_209); if (unlikely(!__pyx_tuple__126)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 119; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_tuple__126); __Pyx_GIVEREF(__pyx_tuple__126); /* "include/color_dict.pxi":120 * 'darkslategrey' : (47, 79, 79), * 'darkturquoise' : (0, 206, 209), * 'darkviolet' : (148, 0, 211), # <<<<<<<<<<<<<< * 'deeppink' : (255, 20, 147), * 'deeppink1' : (255, 20, 147), */ __pyx_tuple__127 = PyTuple_Pack(3, __pyx_int_148, __pyx_int_0, __pyx_int_211); if (unlikely(!__pyx_tuple__127)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 120; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_tuple__127); __Pyx_GIVEREF(__pyx_tuple__127); /* "include/color_dict.pxi":121 * 'darkturquoise' : (0, 206, 209), * 'darkviolet' : (148, 0, 211), * 'deeppink' : (255, 20, 147), # <<<<<<<<<<<<<< * 'deeppink1' : (255, 20, 147), * 'deeppink2' : (238, 18, 137), */ __pyx_tuple__128 = PyTuple_Pack(3, __pyx_int_255, __pyx_int_20, __pyx_int_147); if (unlikely(!__pyx_tuple__128)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 121; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_tuple__128); __Pyx_GIVEREF(__pyx_tuple__128); /* "include/color_dict.pxi":122 * 'darkviolet' : (148, 0, 211), * 'deeppink' : (255, 20, 147), * 'deeppink1' : (255, 20, 147), # <<<<<<<<<<<<<< * 'deeppink2' : (238, 18, 137), * 'deeppink3' : (205, 16, 118), */ __pyx_tuple__129 = PyTuple_Pack(3, __pyx_int_255, __pyx_int_20, __pyx_int_147); if (unlikely(!__pyx_tuple__129)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 122; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_tuple__129); __Pyx_GIVEREF(__pyx_tuple__129); /* "include/color_dict.pxi":123 * 'deeppink' : (255, 20, 147), * 'deeppink1' : (255, 20, 147), * 'deeppink2' : (238, 18, 137), # <<<<<<<<<<<<<< * 'deeppink3' : (205, 16, 118), * 'deeppink4' : (139, 10, 80), */ __pyx_tuple__130 = PyTuple_Pack(3, __pyx_int_238, __pyx_int_18, __pyx_int_137); if (unlikely(!__pyx_tuple__130)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 123; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_tuple__130); __Pyx_GIVEREF(__pyx_tuple__130); /* "include/color_dict.pxi":124 * 'deeppink1' : (255, 20, 147), * 'deeppink2' : (238, 18, 137), * 'deeppink3' : (205, 16, 118), # <<<<<<<<<<<<<< * 'deeppink4' : (139, 10, 80), * 'deepskyblue' : (0, 191, 255), */ __pyx_tuple__131 = PyTuple_Pack(3, __pyx_int_205, __pyx_int_16, __pyx_int_118); if (unlikely(!__pyx_tuple__131)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 124; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_tuple__131); __Pyx_GIVEREF(__pyx_tuple__131); /* "include/color_dict.pxi":125 * 'deeppink2' : (238, 18, 137), * 'deeppink3' : (205, 16, 118), * 'deeppink4' : (139, 10, 80), # <<<<<<<<<<<<<< * 'deepskyblue' : (0, 191, 255), * 'deepskyblue1' : (0, 191, 255), */ __pyx_tuple__132 = PyTuple_Pack(3, __pyx_int_139, __pyx_int_10, __pyx_int_80); if (unlikely(!__pyx_tuple__132)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 125; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_tuple__132); __Pyx_GIVEREF(__pyx_tuple__132); /* "include/color_dict.pxi":126 * 'deeppink3' : (205, 16, 118), * 'deeppink4' : (139, 10, 80), * 'deepskyblue' : (0, 191, 255), # <<<<<<<<<<<<<< * 'deepskyblue1' : (0, 191, 255), * 'deepskyblue2' : (0, 178, 238), */ __pyx_tuple__133 = PyTuple_Pack(3, __pyx_int_0, __pyx_int_191, __pyx_int_255); if (unlikely(!__pyx_tuple__133)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 126; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_tuple__133); __Pyx_GIVEREF(__pyx_tuple__133); /* "include/color_dict.pxi":127 * 'deeppink4' : (139, 10, 80), * 'deepskyblue' : (0, 191, 255), * 'deepskyblue1' : (0, 191, 255), # <<<<<<<<<<<<<< * 'deepskyblue2' : (0, 178, 238), * 'deepskyblue3' : (0, 154, 205), */ __pyx_tuple__134 = PyTuple_Pack(3, __pyx_int_0, __pyx_int_191, __pyx_int_255); if (unlikely(!__pyx_tuple__134)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 127; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_tuple__134); __Pyx_GIVEREF(__pyx_tuple__134); /* "include/color_dict.pxi":128 * 'deepskyblue' : (0, 191, 255), * 'deepskyblue1' : (0, 191, 255), * 'deepskyblue2' : (0, 178, 238), # <<<<<<<<<<<<<< * 'deepskyblue3' : (0, 154, 205), * 'deepskyblue4' : (0, 104, 139), */ __pyx_tuple__135 = PyTuple_Pack(3, __pyx_int_0, __pyx_int_178, __pyx_int_238); if (unlikely(!__pyx_tuple__135)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 128; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_tuple__135); __Pyx_GIVEREF(__pyx_tuple__135); /* "include/color_dict.pxi":129 * 'deepskyblue1' : (0, 191, 255), * 'deepskyblue2' : (0, 178, 238), * 'deepskyblue3' : (0, 154, 205), # <<<<<<<<<<<<<< * 'deepskyblue4' : (0, 104, 139), * 'dimgray' : (105, 105, 105), */ __pyx_tuple__136 = PyTuple_Pack(3, __pyx_int_0, __pyx_int_154, __pyx_int_205); if (unlikely(!__pyx_tuple__136)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 129; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_tuple__136); __Pyx_GIVEREF(__pyx_tuple__136); /* "include/color_dict.pxi":130 * 'deepskyblue2' : (0, 178, 238), * 'deepskyblue3' : (0, 154, 205), * 'deepskyblue4' : (0, 104, 139), # <<<<<<<<<<<<<< * 'dimgray' : (105, 105, 105), * 'dimgrey' : (105, 105, 105), */ __pyx_tuple__137 = PyTuple_Pack(3, __pyx_int_0, __pyx_int_104, __pyx_int_139); if (unlikely(!__pyx_tuple__137)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 130; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_tuple__137); __Pyx_GIVEREF(__pyx_tuple__137); /* "include/color_dict.pxi":131 * 'deepskyblue3' : (0, 154, 205), * 'deepskyblue4' : (0, 104, 139), * 'dimgray' : (105, 105, 105), # <<<<<<<<<<<<<< * 'dimgrey' : (105, 105, 105), * 'dodgerblue' : (30, 144, 255), */ __pyx_tuple__138 = PyTuple_Pack(3, __pyx_int_105, __pyx_int_105, __pyx_int_105); if (unlikely(!__pyx_tuple__138)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 131; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_tuple__138); __Pyx_GIVEREF(__pyx_tuple__138); /* "include/color_dict.pxi":132 * 'deepskyblue4' : (0, 104, 139), * 'dimgray' : (105, 105, 105), * 'dimgrey' : (105, 105, 105), # <<<<<<<<<<<<<< * 'dodgerblue' : (30, 144, 255), * 'dodgerblue1' : (30, 144, 255), */ __pyx_tuple__139 = PyTuple_Pack(3, __pyx_int_105, __pyx_int_105, __pyx_int_105); if (unlikely(!__pyx_tuple__139)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 132; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_tuple__139); __Pyx_GIVEREF(__pyx_tuple__139); /* "include/color_dict.pxi":133 * 'dimgray' : (105, 105, 105), * 'dimgrey' : (105, 105, 105), * 'dodgerblue' : (30, 144, 255), # <<<<<<<<<<<<<< * 'dodgerblue1' : (30, 144, 255), * 'dodgerblue2' : (28, 134, 238), */ __pyx_tuple__140 = PyTuple_Pack(3, __pyx_int_30, __pyx_int_144, __pyx_int_255); if (unlikely(!__pyx_tuple__140)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 133; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_tuple__140); __Pyx_GIVEREF(__pyx_tuple__140); /* "include/color_dict.pxi":134 * 'dimgrey' : (105, 105, 105), * 'dodgerblue' : (30, 144, 255), * 'dodgerblue1' : (30, 144, 255), # <<<<<<<<<<<<<< * 'dodgerblue2' : (28, 134, 238), * 'dodgerblue3' : (24, 116, 205), */ __pyx_tuple__141 = PyTuple_Pack(3, __pyx_int_30, __pyx_int_144, __pyx_int_255); if (unlikely(!__pyx_tuple__141)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 134; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_tuple__141); __Pyx_GIVEREF(__pyx_tuple__141); /* "include/color_dict.pxi":135 * 'dodgerblue' : (30, 144, 255), * 'dodgerblue1' : (30, 144, 255), * 'dodgerblue2' : (28, 134, 238), # <<<<<<<<<<<<<< * 'dodgerblue3' : (24, 116, 205), * 'dodgerblue4' : (16, 78, 139), */ __pyx_tuple__142 = PyTuple_Pack(3, __pyx_int_28, __pyx_int_134, __pyx_int_238); if (unlikely(!__pyx_tuple__142)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 135; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_tuple__142); __Pyx_GIVEREF(__pyx_tuple__142); /* "include/color_dict.pxi":136 * 'dodgerblue1' : (30, 144, 255), * 'dodgerblue2' : (28, 134, 238), * 'dodgerblue3' : (24, 116, 205), # <<<<<<<<<<<<<< * 'dodgerblue4' : (16, 78, 139), * 'firebrick' : (178, 34, 34), */ __pyx_tuple__143 = PyTuple_Pack(3, __pyx_int_24, __pyx_int_116, __pyx_int_205); if (unlikely(!__pyx_tuple__143)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 136; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_tuple__143); __Pyx_GIVEREF(__pyx_tuple__143); /* "include/color_dict.pxi":137 * 'dodgerblue2' : (28, 134, 238), * 'dodgerblue3' : (24, 116, 205), * 'dodgerblue4' : (16, 78, 139), # <<<<<<<<<<<<<< * 'firebrick' : (178, 34, 34), * 'firebrick1' : (255, 48, 48), */ __pyx_tuple__144 = PyTuple_Pack(3, __pyx_int_16, __pyx_int_78, __pyx_int_139); if (unlikely(!__pyx_tuple__144)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 137; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_tuple__144); __Pyx_GIVEREF(__pyx_tuple__144); /* "include/color_dict.pxi":138 * 'dodgerblue3' : (24, 116, 205), * 'dodgerblue4' : (16, 78, 139), * 'firebrick' : (178, 34, 34), # <<<<<<<<<<<<<< * 'firebrick1' : (255, 48, 48), * 'firebrick2' : (238, 44, 44), */ __pyx_tuple__145 = PyTuple_Pack(3, __pyx_int_178, __pyx_int_34, __pyx_int_34); if (unlikely(!__pyx_tuple__145)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 138; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_tuple__145); __Pyx_GIVEREF(__pyx_tuple__145); /* "include/color_dict.pxi":139 * 'dodgerblue4' : (16, 78, 139), * 'firebrick' : (178, 34, 34), * 'firebrick1' : (255, 48, 48), # <<<<<<<<<<<<<< * 'firebrick2' : (238, 44, 44), * 'firebrick3' : (205, 38, 38), */ __pyx_tuple__146 = PyTuple_Pack(3, __pyx_int_255, __pyx_int_48, __pyx_int_48); if (unlikely(!__pyx_tuple__146)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 139; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_tuple__146); __Pyx_GIVEREF(__pyx_tuple__146); /* "include/color_dict.pxi":140 * 'firebrick' : (178, 34, 34), * 'firebrick1' : (255, 48, 48), * 'firebrick2' : (238, 44, 44), # <<<<<<<<<<<<<< * 'firebrick3' : (205, 38, 38), * 'firebrick4' : (139, 26, 26), */ __pyx_tuple__147 = PyTuple_Pack(3, __pyx_int_238, __pyx_int_44, __pyx_int_44); if (unlikely(!__pyx_tuple__147)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 140; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_tuple__147); __Pyx_GIVEREF(__pyx_tuple__147); /* "include/color_dict.pxi":141 * 'firebrick1' : (255, 48, 48), * 'firebrick2' : (238, 44, 44), * 'firebrick3' : (205, 38, 38), # <<<<<<<<<<<<<< * 'firebrick4' : (139, 26, 26), * 'floralwhite' : (255, 250, 240), */ __pyx_tuple__148 = PyTuple_Pack(3, __pyx_int_205, __pyx_int_38, __pyx_int_38); if (unlikely(!__pyx_tuple__148)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 141; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_tuple__148); __Pyx_GIVEREF(__pyx_tuple__148); /* "include/color_dict.pxi":142 * 'firebrick2' : (238, 44, 44), * 'firebrick3' : (205, 38, 38), * 'firebrick4' : (139, 26, 26), # <<<<<<<<<<<<<< * 'floralwhite' : (255, 250, 240), * 'forestgreen' : (34, 139, 34), */ __pyx_tuple__149 = PyTuple_Pack(3, __pyx_int_139, __pyx_int_26, __pyx_int_26); if (unlikely(!__pyx_tuple__149)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 142; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_tuple__149); __Pyx_GIVEREF(__pyx_tuple__149); /* "include/color_dict.pxi":143 * 'firebrick3' : (205, 38, 38), * 'firebrick4' : (139, 26, 26), * 'floralwhite' : (255, 250, 240), # <<<<<<<<<<<<<< * 'forestgreen' : (34, 139, 34), * 'fuchsia' : (255, 0, 255), */ __pyx_tuple__150 = PyTuple_Pack(3, __pyx_int_255, __pyx_int_250, __pyx_int_240); if (unlikely(!__pyx_tuple__150)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 143; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_tuple__150); __Pyx_GIVEREF(__pyx_tuple__150); /* "include/color_dict.pxi":144 * 'firebrick4' : (139, 26, 26), * 'floralwhite' : (255, 250, 240), * 'forestgreen' : (34, 139, 34), # <<<<<<<<<<<<<< * 'fuchsia' : (255, 0, 255), * 'gainsboro' : (220, 220, 220), */ __pyx_tuple__151 = PyTuple_Pack(3, __pyx_int_34, __pyx_int_139, __pyx_int_34); if (unlikely(!__pyx_tuple__151)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 144; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_tuple__151); __Pyx_GIVEREF(__pyx_tuple__151); /* "include/color_dict.pxi":145 * 'floralwhite' : (255, 250, 240), * 'forestgreen' : (34, 139, 34), * 'fuchsia' : (255, 0, 255), # <<<<<<<<<<<<<< * 'gainsboro' : (220, 220, 220), * 'ghostwhite' : (248, 248, 255), */ __pyx_tuple__152 = PyTuple_Pack(3, __pyx_int_255, __pyx_int_0, __pyx_int_255); if (unlikely(!__pyx_tuple__152)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 145; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_tuple__152); __Pyx_GIVEREF(__pyx_tuple__152); /* "include/color_dict.pxi":146 * 'forestgreen' : (34, 139, 34), * 'fuchsia' : (255, 0, 255), * 'gainsboro' : (220, 220, 220), # <<<<<<<<<<<<<< * 'ghostwhite' : (248, 248, 255), * 'gold' : (255, 215, 0), */ __pyx_tuple__153 = PyTuple_Pack(3, __pyx_int_220, __pyx_int_220, __pyx_int_220); if (unlikely(!__pyx_tuple__153)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 146; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_tuple__153); __Pyx_GIVEREF(__pyx_tuple__153); /* "include/color_dict.pxi":147 * 'fuchsia' : (255, 0, 255), * 'gainsboro' : (220, 220, 220), * 'ghostwhite' : (248, 248, 255), # <<<<<<<<<<<<<< * 'gold' : (255, 215, 0), * 'gold1' : (255, 215, 0), */ __pyx_tuple__154 = PyTuple_Pack(3, __pyx_int_248, __pyx_int_248, __pyx_int_255); if (unlikely(!__pyx_tuple__154)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 147; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_tuple__154); __Pyx_GIVEREF(__pyx_tuple__154); /* "include/color_dict.pxi":148 * 'gainsboro' : (220, 220, 220), * 'ghostwhite' : (248, 248, 255), * 'gold' : (255, 215, 0), # <<<<<<<<<<<<<< * 'gold1' : (255, 215, 0), * 'gold2' : (238, 201, 0), */ __pyx_tuple__155 = PyTuple_Pack(3, __pyx_int_255, __pyx_int_215, __pyx_int_0); if (unlikely(!__pyx_tuple__155)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 148; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_tuple__155); __Pyx_GIVEREF(__pyx_tuple__155); /* "include/color_dict.pxi":149 * 'ghostwhite' : (248, 248, 255), * 'gold' : (255, 215, 0), * 'gold1' : (255, 215, 0), # <<<<<<<<<<<<<< * 'gold2' : (238, 201, 0), * 'gold3' : (205, 173, 0), */ __pyx_tuple__156 = PyTuple_Pack(3, __pyx_int_255, __pyx_int_215, __pyx_int_0); if (unlikely(!__pyx_tuple__156)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 149; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_tuple__156); __Pyx_GIVEREF(__pyx_tuple__156); /* "include/color_dict.pxi":150 * 'gold' : (255, 215, 0), * 'gold1' : (255, 215, 0), * 'gold2' : (238, 201, 0), # <<<<<<<<<<<<<< * 'gold3' : (205, 173, 0), * 'gold4' : (139, 117, 0), */ __pyx_tuple__157 = PyTuple_Pack(3, __pyx_int_238, __pyx_int_201, __pyx_int_0); if (unlikely(!__pyx_tuple__157)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 150; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_tuple__157); __Pyx_GIVEREF(__pyx_tuple__157); /* "include/color_dict.pxi":151 * 'gold1' : (255, 215, 0), * 'gold2' : (238, 201, 0), * 'gold3' : (205, 173, 0), # <<<<<<<<<<<<<< * 'gold4' : (139, 117, 0), * 'goldenrod' : (218, 165, 32), */ __pyx_tuple__158 = PyTuple_Pack(3, __pyx_int_205, __pyx_int_173, __pyx_int_0); if (unlikely(!__pyx_tuple__158)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 151; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_tuple__158); __Pyx_GIVEREF(__pyx_tuple__158); /* "include/color_dict.pxi":152 * 'gold2' : (238, 201, 0), * 'gold3' : (205, 173, 0), * 'gold4' : (139, 117, 0), # <<<<<<<<<<<<<< * 'goldenrod' : (218, 165, 32), * 'goldenrod1' : (255, 193, 37), */ __pyx_tuple__159 = PyTuple_Pack(3, __pyx_int_139, __pyx_int_117, __pyx_int_0); if (unlikely(!__pyx_tuple__159)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 152; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_tuple__159); __Pyx_GIVEREF(__pyx_tuple__159); /* "include/color_dict.pxi":153 * 'gold3' : (205, 173, 0), * 'gold4' : (139, 117, 0), * 'goldenrod' : (218, 165, 32), # <<<<<<<<<<<<<< * 'goldenrod1' : (255, 193, 37), * 'goldenrod2' : (238, 180, 34), */ __pyx_tuple__160 = PyTuple_Pack(3, __pyx_int_218, __pyx_int_165, __pyx_int_32); if (unlikely(!__pyx_tuple__160)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 153; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_tuple__160); __Pyx_GIVEREF(__pyx_tuple__160); /* "include/color_dict.pxi":154 * 'gold4' : (139, 117, 0), * 'goldenrod' : (218, 165, 32), * 'goldenrod1' : (255, 193, 37), # <<<<<<<<<<<<<< * 'goldenrod2' : (238, 180, 34), * 'goldenrod3' : (205, 155, 29), */ __pyx_tuple__161 = PyTuple_Pack(3, __pyx_int_255, __pyx_int_193, __pyx_int_37); if (unlikely(!__pyx_tuple__161)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 154; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_tuple__161); __Pyx_GIVEREF(__pyx_tuple__161); /* "include/color_dict.pxi":155 * 'goldenrod' : (218, 165, 32), * 'goldenrod1' : (255, 193, 37), * 'goldenrod2' : (238, 180, 34), # <<<<<<<<<<<<<< * 'goldenrod3' : (205, 155, 29), * 'goldenrod4' : (139, 105, 20), */ __pyx_tuple__162 = PyTuple_Pack(3, __pyx_int_238, __pyx_int_180, __pyx_int_34); if (unlikely(!__pyx_tuple__162)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 155; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_tuple__162); __Pyx_GIVEREF(__pyx_tuple__162); /* "include/color_dict.pxi":156 * 'goldenrod1' : (255, 193, 37), * 'goldenrod2' : (238, 180, 34), * 'goldenrod3' : (205, 155, 29), # <<<<<<<<<<<<<< * 'goldenrod4' : (139, 105, 20), * 'gray' : (190, 190, 190), */ __pyx_tuple__163 = PyTuple_Pack(3, __pyx_int_205, __pyx_int_155, __pyx_int_29); if (unlikely(!__pyx_tuple__163)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 156; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_tuple__163); __Pyx_GIVEREF(__pyx_tuple__163); /* "include/color_dict.pxi":157 * 'goldenrod2' : (238, 180, 34), * 'goldenrod3' : (205, 155, 29), * 'goldenrod4' : (139, 105, 20), # <<<<<<<<<<<<<< * 'gray' : (190, 190, 190), * 'gray0' : (0, 0, 0), */ __pyx_tuple__164 = PyTuple_Pack(3, __pyx_int_139, __pyx_int_105, __pyx_int_20); if (unlikely(!__pyx_tuple__164)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 157; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_tuple__164); __Pyx_GIVEREF(__pyx_tuple__164); /* "include/color_dict.pxi":158 * 'goldenrod3' : (205, 155, 29), * 'goldenrod4' : (139, 105, 20), * 'gray' : (190, 190, 190), # <<<<<<<<<<<<<< * 'gray0' : (0, 0, 0), * 'gray1' : (3, 3, 3), */ __pyx_tuple__165 = PyTuple_Pack(3, __pyx_int_190, __pyx_int_190, __pyx_int_190); if (unlikely(!__pyx_tuple__165)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 158; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_tuple__165); __Pyx_GIVEREF(__pyx_tuple__165); /* "include/color_dict.pxi":159 * 'goldenrod4' : (139, 105, 20), * 'gray' : (190, 190, 190), * 'gray0' : (0, 0, 0), # <<<<<<<<<<<<<< * 'gray1' : (3, 3, 3), * 'gray10' : (26, 26, 26), */ __pyx_tuple__166 = PyTuple_Pack(3, __pyx_int_0, __pyx_int_0, __pyx_int_0); if (unlikely(!__pyx_tuple__166)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 159; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_tuple__166); __Pyx_GIVEREF(__pyx_tuple__166); /* "include/color_dict.pxi":160 * 'gray' : (190, 190, 190), * 'gray0' : (0, 0, 0), * 'gray1' : (3, 3, 3), # <<<<<<<<<<<<<< * 'gray10' : (26, 26, 26), * 'gray100' : (255, 255, 255), */ __pyx_tuple__167 = PyTuple_Pack(3, __pyx_int_3, __pyx_int_3, __pyx_int_3); if (unlikely(!__pyx_tuple__167)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 160; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_tuple__167); __Pyx_GIVEREF(__pyx_tuple__167); /* "include/color_dict.pxi":161 * 'gray0' : (0, 0, 0), * 'gray1' : (3, 3, 3), * 'gray10' : (26, 26, 26), # <<<<<<<<<<<<<< * 'gray100' : (255, 255, 255), * 'gray11' : (28, 28, 28), */ __pyx_tuple__168 = PyTuple_Pack(3, __pyx_int_26, __pyx_int_26, __pyx_int_26); if (unlikely(!__pyx_tuple__168)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 161; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_tuple__168); __Pyx_GIVEREF(__pyx_tuple__168); /* "include/color_dict.pxi":162 * 'gray1' : (3, 3, 3), * 'gray10' : (26, 26, 26), * 'gray100' : (255, 255, 255), # <<<<<<<<<<<<<< * 'gray11' : (28, 28, 28), * 'gray12' : (31, 31, 31), */ __pyx_tuple__169 = PyTuple_Pack(3, __pyx_int_255, __pyx_int_255, __pyx_int_255); if (unlikely(!__pyx_tuple__169)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 162; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_tuple__169); __Pyx_GIVEREF(__pyx_tuple__169); /* "include/color_dict.pxi":163 * 'gray10' : (26, 26, 26), * 'gray100' : (255, 255, 255), * 'gray11' : (28, 28, 28), # <<<<<<<<<<<<<< * 'gray12' : (31, 31, 31), * 'gray13' : (33, 33, 33), */ __pyx_tuple__170 = PyTuple_Pack(3, __pyx_int_28, __pyx_int_28, __pyx_int_28); if (unlikely(!__pyx_tuple__170)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 163; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_tuple__170); __Pyx_GIVEREF(__pyx_tuple__170); /* "include/color_dict.pxi":164 * 'gray100' : (255, 255, 255), * 'gray11' : (28, 28, 28), * 'gray12' : (31, 31, 31), # <<<<<<<<<<<<<< * 'gray13' : (33, 33, 33), * 'gray14' : (36, 36, 36), */ __pyx_tuple__171 = PyTuple_Pack(3, __pyx_int_31, __pyx_int_31, __pyx_int_31); if (unlikely(!__pyx_tuple__171)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 164; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_tuple__171); __Pyx_GIVEREF(__pyx_tuple__171); /* "include/color_dict.pxi":165 * 'gray11' : (28, 28, 28), * 'gray12' : (31, 31, 31), * 'gray13' : (33, 33, 33), # <<<<<<<<<<<<<< * 'gray14' : (36, 36, 36), * 'gray15' : (38, 38, 38), */ __pyx_tuple__172 = PyTuple_Pack(3, __pyx_int_33, __pyx_int_33, __pyx_int_33); if (unlikely(!__pyx_tuple__172)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 165; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_tuple__172); __Pyx_GIVEREF(__pyx_tuple__172); /* "include/color_dict.pxi":166 * 'gray12' : (31, 31, 31), * 'gray13' : (33, 33, 33), * 'gray14' : (36, 36, 36), # <<<<<<<<<<<<<< * 'gray15' : (38, 38, 38), * 'gray16' : (41, 41, 41), */ __pyx_tuple__173 = PyTuple_Pack(3, __pyx_int_36, __pyx_int_36, __pyx_int_36); if (unlikely(!__pyx_tuple__173)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 166; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_tuple__173); __Pyx_GIVEREF(__pyx_tuple__173); /* "include/color_dict.pxi":167 * 'gray13' : (33, 33, 33), * 'gray14' : (36, 36, 36), * 'gray15' : (38, 38, 38), # <<<<<<<<<<<<<< * 'gray16' : (41, 41, 41), * 'gray17' : (43, 43, 43), */ __pyx_tuple__174 = PyTuple_Pack(3, __pyx_int_38, __pyx_int_38, __pyx_int_38); if (unlikely(!__pyx_tuple__174)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 167; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_tuple__174); __Pyx_GIVEREF(__pyx_tuple__174); /* "include/color_dict.pxi":168 * 'gray14' : (36, 36, 36), * 'gray15' : (38, 38, 38), * 'gray16' : (41, 41, 41), # <<<<<<<<<<<<<< * 'gray17' : (43, 43, 43), * 'gray18' : (46, 46, 46), */ __pyx_tuple__175 = PyTuple_Pack(3, __pyx_int_41, __pyx_int_41, __pyx_int_41); if (unlikely(!__pyx_tuple__175)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 168; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_tuple__175); __Pyx_GIVEREF(__pyx_tuple__175); /* "include/color_dict.pxi":169 * 'gray15' : (38, 38, 38), * 'gray16' : (41, 41, 41), * 'gray17' : (43, 43, 43), # <<<<<<<<<<<<<< * 'gray18' : (46, 46, 46), * 'gray19' : (48, 48, 48), */ __pyx_tuple__176 = PyTuple_Pack(3, __pyx_int_43, __pyx_int_43, __pyx_int_43); if (unlikely(!__pyx_tuple__176)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 169; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_tuple__176); __Pyx_GIVEREF(__pyx_tuple__176); /* "include/color_dict.pxi":170 * 'gray16' : (41, 41, 41), * 'gray17' : (43, 43, 43), * 'gray18' : (46, 46, 46), # <<<<<<<<<<<<<< * 'gray19' : (48, 48, 48), * 'gray2' : (5, 5, 5), */ __pyx_tuple__177 = PyTuple_Pack(3, __pyx_int_46, __pyx_int_46, __pyx_int_46); if (unlikely(!__pyx_tuple__177)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 170; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_tuple__177); __Pyx_GIVEREF(__pyx_tuple__177); /* "include/color_dict.pxi":171 * 'gray17' : (43, 43, 43), * 'gray18' : (46, 46, 46), * 'gray19' : (48, 48, 48), # <<<<<<<<<<<<<< * 'gray2' : (5, 5, 5), * 'gray20' : (51, 51, 51), */ __pyx_tuple__178 = PyTuple_Pack(3, __pyx_int_48, __pyx_int_48, __pyx_int_48); if (unlikely(!__pyx_tuple__178)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 171; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_tuple__178); __Pyx_GIVEREF(__pyx_tuple__178); /* "include/color_dict.pxi":172 * 'gray18' : (46, 46, 46), * 'gray19' : (48, 48, 48), * 'gray2' : (5, 5, 5), # <<<<<<<<<<<<<< * 'gray20' : (51, 51, 51), * 'gray21' : (54, 54, 54), */ __pyx_tuple__179 = PyTuple_Pack(3, __pyx_int_5, __pyx_int_5, __pyx_int_5); if (unlikely(!__pyx_tuple__179)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 172; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_tuple__179); __Pyx_GIVEREF(__pyx_tuple__179); /* "include/color_dict.pxi":173 * 'gray19' : (48, 48, 48), * 'gray2' : (5, 5, 5), * 'gray20' : (51, 51, 51), # <<<<<<<<<<<<<< * 'gray21' : (54, 54, 54), * 'gray22' : (56, 56, 56), */ __pyx_tuple__180 = PyTuple_Pack(3, __pyx_int_51, __pyx_int_51, __pyx_int_51); if (unlikely(!__pyx_tuple__180)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 173; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_tuple__180); __Pyx_GIVEREF(__pyx_tuple__180); /* "include/color_dict.pxi":174 * 'gray2' : (5, 5, 5), * 'gray20' : (51, 51, 51), * 'gray21' : (54, 54, 54), # <<<<<<<<<<<<<< * 'gray22' : (56, 56, 56), * 'gray23' : (59, 59, 59), */ __pyx_tuple__181 = PyTuple_Pack(3, __pyx_int_54, __pyx_int_54, __pyx_int_54); if (unlikely(!__pyx_tuple__181)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 174; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_tuple__181); __Pyx_GIVEREF(__pyx_tuple__181); /* "include/color_dict.pxi":175 * 'gray20' : (51, 51, 51), * 'gray21' : (54, 54, 54), * 'gray22' : (56, 56, 56), # <<<<<<<<<<<<<< * 'gray23' : (59, 59, 59), * 'gray24' : (61, 61, 61), */ __pyx_tuple__182 = PyTuple_Pack(3, __pyx_int_56, __pyx_int_56, __pyx_int_56); if (unlikely(!__pyx_tuple__182)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 175; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_tuple__182); __Pyx_GIVEREF(__pyx_tuple__182); /* "include/color_dict.pxi":176 * 'gray21' : (54, 54, 54), * 'gray22' : (56, 56, 56), * 'gray23' : (59, 59, 59), # <<<<<<<<<<<<<< * 'gray24' : (61, 61, 61), * 'gray25' : (64, 64, 64), */ __pyx_tuple__183 = PyTuple_Pack(3, __pyx_int_59, __pyx_int_59, __pyx_int_59); if (unlikely(!__pyx_tuple__183)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 176; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_tuple__183); __Pyx_GIVEREF(__pyx_tuple__183); /* "include/color_dict.pxi":177 * 'gray22' : (56, 56, 56), * 'gray23' : (59, 59, 59), * 'gray24' : (61, 61, 61), # <<<<<<<<<<<<<< * 'gray25' : (64, 64, 64), * 'gray26' : (66, 66, 66), */ __pyx_tuple__184 = PyTuple_Pack(3, __pyx_int_61, __pyx_int_61, __pyx_int_61); if (unlikely(!__pyx_tuple__184)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 177; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_tuple__184); __Pyx_GIVEREF(__pyx_tuple__184); /* "include/color_dict.pxi":178 * 'gray23' : (59, 59, 59), * 'gray24' : (61, 61, 61), * 'gray25' : (64, 64, 64), # <<<<<<<<<<<<<< * 'gray26' : (66, 66, 66), * 'gray27' : (69, 69, 69), */ __pyx_tuple__185 = PyTuple_Pack(3, __pyx_int_64, __pyx_int_64, __pyx_int_64); if (unlikely(!__pyx_tuple__185)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 178; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_tuple__185); __Pyx_GIVEREF(__pyx_tuple__185); /* "include/color_dict.pxi":179 * 'gray24' : (61, 61, 61), * 'gray25' : (64, 64, 64), * 'gray26' : (66, 66, 66), # <<<<<<<<<<<<<< * 'gray27' : (69, 69, 69), * 'gray28' : (71, 71, 71), */ __pyx_tuple__186 = PyTuple_Pack(3, __pyx_int_66, __pyx_int_66, __pyx_int_66); if (unlikely(!__pyx_tuple__186)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 179; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_tuple__186); __Pyx_GIVEREF(__pyx_tuple__186); /* "include/color_dict.pxi":180 * 'gray25' : (64, 64, 64), * 'gray26' : (66, 66, 66), * 'gray27' : (69, 69, 69), # <<<<<<<<<<<<<< * 'gray28' : (71, 71, 71), * 'gray29' : (74, 74, 74), */ __pyx_tuple__187 = PyTuple_Pack(3, __pyx_int_69, __pyx_int_69, __pyx_int_69); if (unlikely(!__pyx_tuple__187)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 180; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_tuple__187); __Pyx_GIVEREF(__pyx_tuple__187); /* "include/color_dict.pxi":181 * 'gray26' : (66, 66, 66), * 'gray27' : (69, 69, 69), * 'gray28' : (71, 71, 71), # <<<<<<<<<<<<<< * 'gray29' : (74, 74, 74), * 'gray3' : (8, 8, 8), */ __pyx_tuple__188 = PyTuple_Pack(3, __pyx_int_71, __pyx_int_71, __pyx_int_71); if (unlikely(!__pyx_tuple__188)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 181; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_tuple__188); __Pyx_GIVEREF(__pyx_tuple__188); /* "include/color_dict.pxi":182 * 'gray27' : (69, 69, 69), * 'gray28' : (71, 71, 71), * 'gray29' : (74, 74, 74), # <<<<<<<<<<<<<< * 'gray3' : (8, 8, 8), * 'gray30' : (77, 77, 77), */ __pyx_tuple__189 = PyTuple_Pack(3, __pyx_int_74, __pyx_int_74, __pyx_int_74); if (unlikely(!__pyx_tuple__189)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 182; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_tuple__189); __Pyx_GIVEREF(__pyx_tuple__189); /* "include/color_dict.pxi":183 * 'gray28' : (71, 71, 71), * 'gray29' : (74, 74, 74), * 'gray3' : (8, 8, 8), # <<<<<<<<<<<<<< * 'gray30' : (77, 77, 77), * 'gray31' : (79, 79, 79), */ __pyx_tuple__190 = PyTuple_Pack(3, __pyx_int_8, __pyx_int_8, __pyx_int_8); if (unlikely(!__pyx_tuple__190)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 183; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_tuple__190); __Pyx_GIVEREF(__pyx_tuple__190); /* "include/color_dict.pxi":184 * 'gray29' : (74, 74, 74), * 'gray3' : (8, 8, 8), * 'gray30' : (77, 77, 77), # <<<<<<<<<<<<<< * 'gray31' : (79, 79, 79), * 'gray32' : (82, 82, 82), */ __pyx_tuple__191 = PyTuple_Pack(3, __pyx_int_77, __pyx_int_77, __pyx_int_77); if (unlikely(!__pyx_tuple__191)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 184; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_tuple__191); __Pyx_GIVEREF(__pyx_tuple__191); /* "include/color_dict.pxi":185 * 'gray3' : (8, 8, 8), * 'gray30' : (77, 77, 77), * 'gray31' : (79, 79, 79), # <<<<<<<<<<<<<< * 'gray32' : (82, 82, 82), * 'gray33' : (84, 84, 84), */ __pyx_tuple__192 = PyTuple_Pack(3, __pyx_int_79, __pyx_int_79, __pyx_int_79); if (unlikely(!__pyx_tuple__192)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 185; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_tuple__192); __Pyx_GIVEREF(__pyx_tuple__192); /* "include/color_dict.pxi":186 * 'gray30' : (77, 77, 77), * 'gray31' : (79, 79, 79), * 'gray32' : (82, 82, 82), # <<<<<<<<<<<<<< * 'gray33' : (84, 84, 84), * 'gray34' : (87, 87, 87), */ __pyx_tuple__193 = PyTuple_Pack(3, __pyx_int_82, __pyx_int_82, __pyx_int_82); if (unlikely(!__pyx_tuple__193)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 186; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_tuple__193); __Pyx_GIVEREF(__pyx_tuple__193); /* "include/color_dict.pxi":187 * 'gray31' : (79, 79, 79), * 'gray32' : (82, 82, 82), * 'gray33' : (84, 84, 84), # <<<<<<<<<<<<<< * 'gray34' : (87, 87, 87), * 'gray35' : (89, 89, 89), */ __pyx_tuple__194 = PyTuple_Pack(3, __pyx_int_84, __pyx_int_84, __pyx_int_84); if (unlikely(!__pyx_tuple__194)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 187; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_tuple__194); __Pyx_GIVEREF(__pyx_tuple__194); /* "include/color_dict.pxi":188 * 'gray32' : (82, 82, 82), * 'gray33' : (84, 84, 84), * 'gray34' : (87, 87, 87), # <<<<<<<<<<<<<< * 'gray35' : (89, 89, 89), * 'gray36' : (92, 92, 92), */ __pyx_tuple__195 = PyTuple_Pack(3, __pyx_int_87, __pyx_int_87, __pyx_int_87); if (unlikely(!__pyx_tuple__195)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 188; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_tuple__195); __Pyx_GIVEREF(__pyx_tuple__195); /* "include/color_dict.pxi":189 * 'gray33' : (84, 84, 84), * 'gray34' : (87, 87, 87), * 'gray35' : (89, 89, 89), # <<<<<<<<<<<<<< * 'gray36' : (92, 92, 92), * 'gray37' : (94, 94, 94), */ __pyx_tuple__196 = PyTuple_Pack(3, __pyx_int_89, __pyx_int_89, __pyx_int_89); if (unlikely(!__pyx_tuple__196)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 189; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_tuple__196); __Pyx_GIVEREF(__pyx_tuple__196); /* "include/color_dict.pxi":190 * 'gray34' : (87, 87, 87), * 'gray35' : (89, 89, 89), * 'gray36' : (92, 92, 92), # <<<<<<<<<<<<<< * 'gray37' : (94, 94, 94), * 'gray38' : (97, 97, 97), */ __pyx_tuple__197 = PyTuple_Pack(3, __pyx_int_92, __pyx_int_92, __pyx_int_92); if (unlikely(!__pyx_tuple__197)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 190; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_tuple__197); __Pyx_GIVEREF(__pyx_tuple__197); /* "include/color_dict.pxi":191 * 'gray35' : (89, 89, 89), * 'gray36' : (92, 92, 92), * 'gray37' : (94, 94, 94), # <<<<<<<<<<<<<< * 'gray38' : (97, 97, 97), * 'gray39' : (99, 99, 99), */ __pyx_tuple__198 = PyTuple_Pack(3, __pyx_int_94, __pyx_int_94, __pyx_int_94); if (unlikely(!__pyx_tuple__198)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 191; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_tuple__198); __Pyx_GIVEREF(__pyx_tuple__198); /* "include/color_dict.pxi":192 * 'gray36' : (92, 92, 92), * 'gray37' : (94, 94, 94), * 'gray38' : (97, 97, 97), # <<<<<<<<<<<<<< * 'gray39' : (99, 99, 99), * 'gray4' : (10, 10, 10), */ __pyx_tuple__199 = PyTuple_Pack(3, __pyx_int_97, __pyx_int_97, __pyx_int_97); if (unlikely(!__pyx_tuple__199)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 192; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_tuple__199); __Pyx_GIVEREF(__pyx_tuple__199); /* "include/color_dict.pxi":193 * 'gray37' : (94, 94, 94), * 'gray38' : (97, 97, 97), * 'gray39' : (99, 99, 99), # <<<<<<<<<<<<<< * 'gray4' : (10, 10, 10), * 'gray40' : (102, 102, 102), */ __pyx_tuple__200 = PyTuple_Pack(3, __pyx_int_99, __pyx_int_99, __pyx_int_99); if (unlikely(!__pyx_tuple__200)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 193; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_tuple__200); __Pyx_GIVEREF(__pyx_tuple__200); /* "include/color_dict.pxi":194 * 'gray38' : (97, 97, 97), * 'gray39' : (99, 99, 99), * 'gray4' : (10, 10, 10), # <<<<<<<<<<<<<< * 'gray40' : (102, 102, 102), * 'gray41' : (105, 105, 105), */ __pyx_tuple__201 = PyTuple_Pack(3, __pyx_int_10, __pyx_int_10, __pyx_int_10); if (unlikely(!__pyx_tuple__201)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 194; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_tuple__201); __Pyx_GIVEREF(__pyx_tuple__201); /* "include/color_dict.pxi":195 * 'gray39' : (99, 99, 99), * 'gray4' : (10, 10, 10), * 'gray40' : (102, 102, 102), # <<<<<<<<<<<<<< * 'gray41' : (105, 105, 105), * 'gray42' : (107, 107, 107), */ __pyx_tuple__202 = PyTuple_Pack(3, __pyx_int_102, __pyx_int_102, __pyx_int_102); if (unlikely(!__pyx_tuple__202)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 195; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_tuple__202); __Pyx_GIVEREF(__pyx_tuple__202); /* "include/color_dict.pxi":196 * 'gray4' : (10, 10, 10), * 'gray40' : (102, 102, 102), * 'gray41' : (105, 105, 105), # <<<<<<<<<<<<<< * 'gray42' : (107, 107, 107), * 'gray43' : (110, 110, 110), */ __pyx_tuple__203 = PyTuple_Pack(3, __pyx_int_105, __pyx_int_105, __pyx_int_105); if (unlikely(!__pyx_tuple__203)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 196; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_tuple__203); __Pyx_GIVEREF(__pyx_tuple__203); /* "include/color_dict.pxi":197 * 'gray40' : (102, 102, 102), * 'gray41' : (105, 105, 105), * 'gray42' : (107, 107, 107), # <<<<<<<<<<<<<< * 'gray43' : (110, 110, 110), * 'gray44' : (112, 112, 112), */ __pyx_tuple__204 = PyTuple_Pack(3, __pyx_int_107, __pyx_int_107, __pyx_int_107); if (unlikely(!__pyx_tuple__204)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 197; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_tuple__204); __Pyx_GIVEREF(__pyx_tuple__204); /* "include/color_dict.pxi":198 * 'gray41' : (105, 105, 105), * 'gray42' : (107, 107, 107), * 'gray43' : (110, 110, 110), # <<<<<<<<<<<<<< * 'gray44' : (112, 112, 112), * 'gray45' : (115, 115, 115), */ __pyx_tuple__205 = PyTuple_Pack(3, __pyx_int_110, __pyx_int_110, __pyx_int_110); if (unlikely(!__pyx_tuple__205)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 198; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_tuple__205); __Pyx_GIVEREF(__pyx_tuple__205); /* "include/color_dict.pxi":199 * 'gray42' : (107, 107, 107), * 'gray43' : (110, 110, 110), * 'gray44' : (112, 112, 112), # <<<<<<<<<<<<<< * 'gray45' : (115, 115, 115), * 'gray46' : (117, 117, 117), */ __pyx_tuple__206 = PyTuple_Pack(3, __pyx_int_112, __pyx_int_112, __pyx_int_112); if (unlikely(!__pyx_tuple__206)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 199; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_tuple__206); __Pyx_GIVEREF(__pyx_tuple__206); /* "include/color_dict.pxi":200 * 'gray43' : (110, 110, 110), * 'gray44' : (112, 112, 112), * 'gray45' : (115, 115, 115), # <<<<<<<<<<<<<< * 'gray46' : (117, 117, 117), * 'gray47' : (120, 120, 120), */ __pyx_tuple__207 = PyTuple_Pack(3, __pyx_int_115, __pyx_int_115, __pyx_int_115); if (unlikely(!__pyx_tuple__207)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 200; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_tuple__207); __Pyx_GIVEREF(__pyx_tuple__207); /* "include/color_dict.pxi":201 * 'gray44' : (112, 112, 112), * 'gray45' : (115, 115, 115), * 'gray46' : (117, 117, 117), # <<<<<<<<<<<<<< * 'gray47' : (120, 120, 120), * 'gray48' : (122, 122, 122), */ __pyx_tuple__208 = PyTuple_Pack(3, __pyx_int_117, __pyx_int_117, __pyx_int_117); if (unlikely(!__pyx_tuple__208)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 201; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_tuple__208); __Pyx_GIVEREF(__pyx_tuple__208); /* "include/color_dict.pxi":202 * 'gray45' : (115, 115, 115), * 'gray46' : (117, 117, 117), * 'gray47' : (120, 120, 120), # <<<<<<<<<<<<<< * 'gray48' : (122, 122, 122), * 'gray49' : (125, 125, 125), */ __pyx_tuple__209 = PyTuple_Pack(3, __pyx_int_120, __pyx_int_120, __pyx_int_120); if (unlikely(!__pyx_tuple__209)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 202; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_tuple__209); __Pyx_GIVEREF(__pyx_tuple__209); /* "include/color_dict.pxi":203 * 'gray46' : (117, 117, 117), * 'gray47' : (120, 120, 120), * 'gray48' : (122, 122, 122), # <<<<<<<<<<<<<< * 'gray49' : (125, 125, 125), * 'gray5' : (13, 13, 13), */ __pyx_tuple__210 = PyTuple_Pack(3, __pyx_int_122, __pyx_int_122, __pyx_int_122); if (unlikely(!__pyx_tuple__210)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 203; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_tuple__210); __Pyx_GIVEREF(__pyx_tuple__210); /* "include/color_dict.pxi":204 * 'gray47' : (120, 120, 120), * 'gray48' : (122, 122, 122), * 'gray49' : (125, 125, 125), # <<<<<<<<<<<<<< * 'gray5' : (13, 13, 13), * 'gray50' : (127, 127, 127), */ __pyx_tuple__211 = PyTuple_Pack(3, __pyx_int_125, __pyx_int_125, __pyx_int_125); if (unlikely(!__pyx_tuple__211)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 204; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_tuple__211); __Pyx_GIVEREF(__pyx_tuple__211); /* "include/color_dict.pxi":205 * 'gray48' : (122, 122, 122), * 'gray49' : (125, 125, 125), * 'gray5' : (13, 13, 13), # <<<<<<<<<<<<<< * 'gray50' : (127, 127, 127), * 'gray51' : (130, 130, 130), */ __pyx_tuple__212 = PyTuple_Pack(3, __pyx_int_13, __pyx_int_13, __pyx_int_13); if (unlikely(!__pyx_tuple__212)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 205; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_tuple__212); __Pyx_GIVEREF(__pyx_tuple__212); /* "include/color_dict.pxi":206 * 'gray49' : (125, 125, 125), * 'gray5' : (13, 13, 13), * 'gray50' : (127, 127, 127), # <<<<<<<<<<<<<< * 'gray51' : (130, 130, 130), * 'gray52' : (133, 133, 133), */ __pyx_tuple__213 = PyTuple_Pack(3, __pyx_int_127, __pyx_int_127, __pyx_int_127); if (unlikely(!__pyx_tuple__213)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 206; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_tuple__213); __Pyx_GIVEREF(__pyx_tuple__213); /* "include/color_dict.pxi":207 * 'gray5' : (13, 13, 13), * 'gray50' : (127, 127, 127), * 'gray51' : (130, 130, 130), # <<<<<<<<<<<<<< * 'gray52' : (133, 133, 133), * 'gray53' : (135, 135, 135), */ __pyx_tuple__214 = PyTuple_Pack(3, __pyx_int_130, __pyx_int_130, __pyx_int_130); if (unlikely(!__pyx_tuple__214)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 207; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_tuple__214); __Pyx_GIVEREF(__pyx_tuple__214); /* "include/color_dict.pxi":208 * 'gray50' : (127, 127, 127), * 'gray51' : (130, 130, 130), * 'gray52' : (133, 133, 133), # <<<<<<<<<<<<<< * 'gray53' : (135, 135, 135), * 'gray54' : (138, 138, 138), */ __pyx_tuple__215 = PyTuple_Pack(3, __pyx_int_133, __pyx_int_133, __pyx_int_133); if (unlikely(!__pyx_tuple__215)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 208; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_tuple__215); __Pyx_GIVEREF(__pyx_tuple__215); /* "include/color_dict.pxi":209 * 'gray51' : (130, 130, 130), * 'gray52' : (133, 133, 133), * 'gray53' : (135, 135, 135), # <<<<<<<<<<<<<< * 'gray54' : (138, 138, 138), * 'gray55' : (140, 140, 140), */ __pyx_tuple__216 = PyTuple_Pack(3, __pyx_int_135, __pyx_int_135, __pyx_int_135); if (unlikely(!__pyx_tuple__216)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 209; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_tuple__216); __Pyx_GIVEREF(__pyx_tuple__216); /* "include/color_dict.pxi":210 * 'gray52' : (133, 133, 133), * 'gray53' : (135, 135, 135), * 'gray54' : (138, 138, 138), # <<<<<<<<<<<<<< * 'gray55' : (140, 140, 140), * 'gray56' : (143, 143, 143), */ __pyx_tuple__217 = PyTuple_Pack(3, __pyx_int_138, __pyx_int_138, __pyx_int_138); if (unlikely(!__pyx_tuple__217)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 210; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_tuple__217); __Pyx_GIVEREF(__pyx_tuple__217); /* "include/color_dict.pxi":211 * 'gray53' : (135, 135, 135), * 'gray54' : (138, 138, 138), * 'gray55' : (140, 140, 140), # <<<<<<<<<<<<<< * 'gray56' : (143, 143, 143), * 'gray57' : (145, 145, 145), */ __pyx_tuple__218 = PyTuple_Pack(3, __pyx_int_140, __pyx_int_140, __pyx_int_140); if (unlikely(!__pyx_tuple__218)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 211; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_tuple__218); __Pyx_GIVEREF(__pyx_tuple__218); /* "include/color_dict.pxi":212 * 'gray54' : (138, 138, 138), * 'gray55' : (140, 140, 140), * 'gray56' : (143, 143, 143), # <<<<<<<<<<<<<< * 'gray57' : (145, 145, 145), * 'gray58' : (148, 148, 148), */ __pyx_tuple__219 = PyTuple_Pack(3, __pyx_int_143, __pyx_int_143, __pyx_int_143); if (unlikely(!__pyx_tuple__219)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 212; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_tuple__219); __Pyx_GIVEREF(__pyx_tuple__219); /* "include/color_dict.pxi":213 * 'gray55' : (140, 140, 140), * 'gray56' : (143, 143, 143), * 'gray57' : (145, 145, 145), # <<<<<<<<<<<<<< * 'gray58' : (148, 148, 148), * 'gray59' : (150, 150, 150), */ __pyx_tuple__220 = PyTuple_Pack(3, __pyx_int_145, __pyx_int_145, __pyx_int_145); if (unlikely(!__pyx_tuple__220)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 213; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_tuple__220); __Pyx_GIVEREF(__pyx_tuple__220); /* "include/color_dict.pxi":214 * 'gray56' : (143, 143, 143), * 'gray57' : (145, 145, 145), * 'gray58' : (148, 148, 148), # <<<<<<<<<<<<<< * 'gray59' : (150, 150, 150), * 'gray6' : (15, 15, 15), */ __pyx_tuple__221 = PyTuple_Pack(3, __pyx_int_148, __pyx_int_148, __pyx_int_148); if (unlikely(!__pyx_tuple__221)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 214; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_tuple__221); __Pyx_GIVEREF(__pyx_tuple__221); /* "include/color_dict.pxi":215 * 'gray57' : (145, 145, 145), * 'gray58' : (148, 148, 148), * 'gray59' : (150, 150, 150), # <<<<<<<<<<<<<< * 'gray6' : (15, 15, 15), * 'gray60' : (153, 153, 153), */ __pyx_tuple__222 = PyTuple_Pack(3, __pyx_int_150, __pyx_int_150, __pyx_int_150); if (unlikely(!__pyx_tuple__222)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 215; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_tuple__222); __Pyx_GIVEREF(__pyx_tuple__222); /* "include/color_dict.pxi":216 * 'gray58' : (148, 148, 148), * 'gray59' : (150, 150, 150), * 'gray6' : (15, 15, 15), # <<<<<<<<<<<<<< * 'gray60' : (153, 153, 153), * 'gray61' : (156, 156, 156), */ __pyx_tuple__223 = PyTuple_Pack(3, __pyx_int_15, __pyx_int_15, __pyx_int_15); if (unlikely(!__pyx_tuple__223)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 216; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_tuple__223); __Pyx_GIVEREF(__pyx_tuple__223); /* "include/color_dict.pxi":217 * 'gray59' : (150, 150, 150), * 'gray6' : (15, 15, 15), * 'gray60' : (153, 153, 153), # <<<<<<<<<<<<<< * 'gray61' : (156, 156, 156), * 'gray62' : (158, 158, 158), */ __pyx_tuple__224 = PyTuple_Pack(3, __pyx_int_153, __pyx_int_153, __pyx_int_153); if (unlikely(!__pyx_tuple__224)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 217; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_tuple__224); __Pyx_GIVEREF(__pyx_tuple__224); /* "include/color_dict.pxi":218 * 'gray6' : (15, 15, 15), * 'gray60' : (153, 153, 153), * 'gray61' : (156, 156, 156), # <<<<<<<<<<<<<< * 'gray62' : (158, 158, 158), * 'gray63' : (161, 161, 161), */ __pyx_tuple__225 = PyTuple_Pack(3, __pyx_int_156, __pyx_int_156, __pyx_int_156); if (unlikely(!__pyx_tuple__225)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 218; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_tuple__225); __Pyx_GIVEREF(__pyx_tuple__225); /* "include/color_dict.pxi":219 * 'gray60' : (153, 153, 153), * 'gray61' : (156, 156, 156), * 'gray62' : (158, 158, 158), # <<<<<<<<<<<<<< * 'gray63' : (161, 161, 161), * 'gray64' : (163, 163, 163), */ __pyx_tuple__226 = PyTuple_Pack(3, __pyx_int_158, __pyx_int_158, __pyx_int_158); if (unlikely(!__pyx_tuple__226)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 219; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_tuple__226); __Pyx_GIVEREF(__pyx_tuple__226); /* "include/color_dict.pxi":220 * 'gray61' : (156, 156, 156), * 'gray62' : (158, 158, 158), * 'gray63' : (161, 161, 161), # <<<<<<<<<<<<<< * 'gray64' : (163, 163, 163), * 'gray65' : (166, 166, 166), */ __pyx_tuple__227 = PyTuple_Pack(3, __pyx_int_161, __pyx_int_161, __pyx_int_161); if (unlikely(!__pyx_tuple__227)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 220; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_tuple__227); __Pyx_GIVEREF(__pyx_tuple__227); /* "include/color_dict.pxi":221 * 'gray62' : (158, 158, 158), * 'gray63' : (161, 161, 161), * 'gray64' : (163, 163, 163), # <<<<<<<<<<<<<< * 'gray65' : (166, 166, 166), * 'gray66' : (168, 168, 168), */ __pyx_tuple__228 = PyTuple_Pack(3, __pyx_int_163, __pyx_int_163, __pyx_int_163); if (unlikely(!__pyx_tuple__228)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 221; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_tuple__228); __Pyx_GIVEREF(__pyx_tuple__228); /* "include/color_dict.pxi":222 * 'gray63' : (161, 161, 161), * 'gray64' : (163, 163, 163), * 'gray65' : (166, 166, 166), # <<<<<<<<<<<<<< * 'gray66' : (168, 168, 168), * 'gray67' : (171, 171, 171), */ __pyx_tuple__229 = PyTuple_Pack(3, __pyx_int_166, __pyx_int_166, __pyx_int_166); if (unlikely(!__pyx_tuple__229)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 222; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_tuple__229); __Pyx_GIVEREF(__pyx_tuple__229); /* "include/color_dict.pxi":223 * 'gray64' : (163, 163, 163), * 'gray65' : (166, 166, 166), * 'gray66' : (168, 168, 168), # <<<<<<<<<<<<<< * 'gray67' : (171, 171, 171), * 'gray68' : (173, 173, 173), */ __pyx_tuple__230 = PyTuple_Pack(3, __pyx_int_168, __pyx_int_168, __pyx_int_168); if (unlikely(!__pyx_tuple__230)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 223; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_tuple__230); __Pyx_GIVEREF(__pyx_tuple__230); /* "include/color_dict.pxi":224 * 'gray65' : (166, 166, 166), * 'gray66' : (168, 168, 168), * 'gray67' : (171, 171, 171), # <<<<<<<<<<<<<< * 'gray68' : (173, 173, 173), * 'gray69' : (176, 176, 176), */ __pyx_tuple__231 = PyTuple_Pack(3, __pyx_int_171, __pyx_int_171, __pyx_int_171); if (unlikely(!__pyx_tuple__231)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 224; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_tuple__231); __Pyx_GIVEREF(__pyx_tuple__231); /* "include/color_dict.pxi":225 * 'gray66' : (168, 168, 168), * 'gray67' : (171, 171, 171), * 'gray68' : (173, 173, 173), # <<<<<<<<<<<<<< * 'gray69' : (176, 176, 176), * 'gray7' : (18, 18, 18), */ __pyx_tuple__232 = PyTuple_Pack(3, __pyx_int_173, __pyx_int_173, __pyx_int_173); if (unlikely(!__pyx_tuple__232)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 225; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_tuple__232); __Pyx_GIVEREF(__pyx_tuple__232); /* "include/color_dict.pxi":226 * 'gray67' : (171, 171, 171), * 'gray68' : (173, 173, 173), * 'gray69' : (176, 176, 176), # <<<<<<<<<<<<<< * 'gray7' : (18, 18, 18), * 'gray70' : (179, 179, 179), */ __pyx_tuple__233 = PyTuple_Pack(3, __pyx_int_176, __pyx_int_176, __pyx_int_176); if (unlikely(!__pyx_tuple__233)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 226; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_tuple__233); __Pyx_GIVEREF(__pyx_tuple__233); /* "include/color_dict.pxi":227 * 'gray68' : (173, 173, 173), * 'gray69' : (176, 176, 176), * 'gray7' : (18, 18, 18), # <<<<<<<<<<<<<< * 'gray70' : (179, 179, 179), * 'gray71' : (181, 181, 181), */ __pyx_tuple__234 = PyTuple_Pack(3, __pyx_int_18, __pyx_int_18, __pyx_int_18); if (unlikely(!__pyx_tuple__234)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 227; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_tuple__234); __Pyx_GIVEREF(__pyx_tuple__234); /* "include/color_dict.pxi":228 * 'gray69' : (176, 176, 176), * 'gray7' : (18, 18, 18), * 'gray70' : (179, 179, 179), # <<<<<<<<<<<<<< * 'gray71' : (181, 181, 181), * 'gray72' : (184, 184, 184), */ __pyx_tuple__235 = PyTuple_Pack(3, __pyx_int_179, __pyx_int_179, __pyx_int_179); if (unlikely(!__pyx_tuple__235)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 228; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_tuple__235); __Pyx_GIVEREF(__pyx_tuple__235); /* "include/color_dict.pxi":229 * 'gray7' : (18, 18, 18), * 'gray70' : (179, 179, 179), * 'gray71' : (181, 181, 181), # <<<<<<<<<<<<<< * 'gray72' : (184, 184, 184), * 'gray73' : (186, 186, 186), */ __pyx_tuple__236 = PyTuple_Pack(3, __pyx_int_181, __pyx_int_181, __pyx_int_181); if (unlikely(!__pyx_tuple__236)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 229; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_tuple__236); __Pyx_GIVEREF(__pyx_tuple__236); /* "include/color_dict.pxi":230 * 'gray70' : (179, 179, 179), * 'gray71' : (181, 181, 181), * 'gray72' : (184, 184, 184), # <<<<<<<<<<<<<< * 'gray73' : (186, 186, 186), * 'gray74' : (189, 189, 189), */ __pyx_tuple__237 = PyTuple_Pack(3, __pyx_int_184, __pyx_int_184, __pyx_int_184); if (unlikely(!__pyx_tuple__237)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 230; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_tuple__237); __Pyx_GIVEREF(__pyx_tuple__237); /* "include/color_dict.pxi":231 * 'gray71' : (181, 181, 181), * 'gray72' : (184, 184, 184), * 'gray73' : (186, 186, 186), # <<<<<<<<<<<<<< * 'gray74' : (189, 189, 189), * 'gray75' : (191, 191, 191), */ __pyx_tuple__238 = PyTuple_Pack(3, __pyx_int_186, __pyx_int_186, __pyx_int_186); if (unlikely(!__pyx_tuple__238)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 231; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_tuple__238); __Pyx_GIVEREF(__pyx_tuple__238); /* "include/color_dict.pxi":232 * 'gray72' : (184, 184, 184), * 'gray73' : (186, 186, 186), * 'gray74' : (189, 189, 189), # <<<<<<<<<<<<<< * 'gray75' : (191, 191, 191), * 'gray76' : (194, 194, 194), */ __pyx_tuple__239 = PyTuple_Pack(3, __pyx_int_189, __pyx_int_189, __pyx_int_189); if (unlikely(!__pyx_tuple__239)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 232; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_tuple__239); __Pyx_GIVEREF(__pyx_tuple__239); /* "include/color_dict.pxi":233 * 'gray73' : (186, 186, 186), * 'gray74' : (189, 189, 189), * 'gray75' : (191, 191, 191), # <<<<<<<<<<<<<< * 'gray76' : (194, 194, 194), * 'gray77' : (196, 196, 196), */ __pyx_tuple__240 = PyTuple_Pack(3, __pyx_int_191, __pyx_int_191, __pyx_int_191); if (unlikely(!__pyx_tuple__240)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 233; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_tuple__240); __Pyx_GIVEREF(__pyx_tuple__240); /* "include/color_dict.pxi":234 * 'gray74' : (189, 189, 189), * 'gray75' : (191, 191, 191), * 'gray76' : (194, 194, 194), # <<<<<<<<<<<<<< * 'gray77' : (196, 196, 196), * 'gray78' : (199, 199, 199), */ __pyx_tuple__241 = PyTuple_Pack(3, __pyx_int_194, __pyx_int_194, __pyx_int_194); if (unlikely(!__pyx_tuple__241)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 234; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_tuple__241); __Pyx_GIVEREF(__pyx_tuple__241); /* "include/color_dict.pxi":235 * 'gray75' : (191, 191, 191), * 'gray76' : (194, 194, 194), * 'gray77' : (196, 196, 196), # <<<<<<<<<<<<<< * 'gray78' : (199, 199, 199), * 'gray79' : (201, 201, 201), */ __pyx_tuple__242 = PyTuple_Pack(3, __pyx_int_196, __pyx_int_196, __pyx_int_196); if (unlikely(!__pyx_tuple__242)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 235; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_tuple__242); __Pyx_GIVEREF(__pyx_tuple__242); /* "include/color_dict.pxi":236 * 'gray76' : (194, 194, 194), * 'gray77' : (196, 196, 196), * 'gray78' : (199, 199, 199), # <<<<<<<<<<<<<< * 'gray79' : (201, 201, 201), * 'gray8' : (20, 20, 20), */ __pyx_tuple__243 = PyTuple_Pack(3, __pyx_int_199, __pyx_int_199, __pyx_int_199); if (unlikely(!__pyx_tuple__243)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 236; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_tuple__243); __Pyx_GIVEREF(__pyx_tuple__243); /* "include/color_dict.pxi":237 * 'gray77' : (196, 196, 196), * 'gray78' : (199, 199, 199), * 'gray79' : (201, 201, 201), # <<<<<<<<<<<<<< * 'gray8' : (20, 20, 20), * 'gray80' : (204, 204, 204), */ __pyx_tuple__244 = PyTuple_Pack(3, __pyx_int_201, __pyx_int_201, __pyx_int_201); if (unlikely(!__pyx_tuple__244)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 237; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_tuple__244); __Pyx_GIVEREF(__pyx_tuple__244); /* "include/color_dict.pxi":238 * 'gray78' : (199, 199, 199), * 'gray79' : (201, 201, 201), * 'gray8' : (20, 20, 20), # <<<<<<<<<<<<<< * 'gray80' : (204, 204, 204), * 'gray81' : (207, 207, 207), */ __pyx_tuple__245 = PyTuple_Pack(3, __pyx_int_20, __pyx_int_20, __pyx_int_20); if (unlikely(!__pyx_tuple__245)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 238; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_tuple__245); __Pyx_GIVEREF(__pyx_tuple__245); /* "include/color_dict.pxi":239 * 'gray79' : (201, 201, 201), * 'gray8' : (20, 20, 20), * 'gray80' : (204, 204, 204), # <<<<<<<<<<<<<< * 'gray81' : (207, 207, 207), * 'gray82' : (209, 209, 209), */ __pyx_tuple__246 = PyTuple_Pack(3, __pyx_int_204, __pyx_int_204, __pyx_int_204); if (unlikely(!__pyx_tuple__246)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 239; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_tuple__246); __Pyx_GIVEREF(__pyx_tuple__246); /* "include/color_dict.pxi":240 * 'gray8' : (20, 20, 20), * 'gray80' : (204, 204, 204), * 'gray81' : (207, 207, 207), # <<<<<<<<<<<<<< * 'gray82' : (209, 209, 209), * 'gray83' : (212, 212, 212), */ __pyx_tuple__247 = PyTuple_Pack(3, __pyx_int_207, __pyx_int_207, __pyx_int_207); if (unlikely(!__pyx_tuple__247)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 240; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_tuple__247); __Pyx_GIVEREF(__pyx_tuple__247); /* "include/color_dict.pxi":241 * 'gray80' : (204, 204, 204), * 'gray81' : (207, 207, 207), * 'gray82' : (209, 209, 209), # <<<<<<<<<<<<<< * 'gray83' : (212, 212, 212), * 'gray84' : (214, 214, 214), */ __pyx_tuple__248 = PyTuple_Pack(3, __pyx_int_209, __pyx_int_209, __pyx_int_209); if (unlikely(!__pyx_tuple__248)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 241; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_tuple__248); __Pyx_GIVEREF(__pyx_tuple__248); /* "include/color_dict.pxi":242 * 'gray81' : (207, 207, 207), * 'gray82' : (209, 209, 209), * 'gray83' : (212, 212, 212), # <<<<<<<<<<<<<< * 'gray84' : (214, 214, 214), * 'gray85' : (217, 217, 217), */ __pyx_tuple__249 = PyTuple_Pack(3, __pyx_int_212, __pyx_int_212, __pyx_int_212); if (unlikely(!__pyx_tuple__249)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 242; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_tuple__249); __Pyx_GIVEREF(__pyx_tuple__249); /* "include/color_dict.pxi":243 * 'gray82' : (209, 209, 209), * 'gray83' : (212, 212, 212), * 'gray84' : (214, 214, 214), # <<<<<<<<<<<<<< * 'gray85' : (217, 217, 217), * 'gray86' : (219, 219, 219), */ __pyx_tuple__250 = PyTuple_Pack(3, __pyx_int_214, __pyx_int_214, __pyx_int_214); if (unlikely(!__pyx_tuple__250)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 243; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_tuple__250); __Pyx_GIVEREF(__pyx_tuple__250); /* "include/color_dict.pxi":244 * 'gray83' : (212, 212, 212), * 'gray84' : (214, 214, 214), * 'gray85' : (217, 217, 217), # <<<<<<<<<<<<<< * 'gray86' : (219, 219, 219), * 'gray87' : (222, 222, 222), */ __pyx_tuple__251 = PyTuple_Pack(3, __pyx_int_217, __pyx_int_217, __pyx_int_217); if (unlikely(!__pyx_tuple__251)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 244; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_tuple__251); __Pyx_GIVEREF(__pyx_tuple__251); /* "include/color_dict.pxi":245 * 'gray84' : (214, 214, 214), * 'gray85' : (217, 217, 217), * 'gray86' : (219, 219, 219), # <<<<<<<<<<<<<< * 'gray87' : (222, 222, 222), * 'gray88' : (224, 224, 224), */ __pyx_tuple__252 = PyTuple_Pack(3, __pyx_int_219, __pyx_int_219, __pyx_int_219); if (unlikely(!__pyx_tuple__252)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 245; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_tuple__252); __Pyx_GIVEREF(__pyx_tuple__252); /* "include/color_dict.pxi":246 * 'gray85' : (217, 217, 217), * 'gray86' : (219, 219, 219), * 'gray87' : (222, 222, 222), # <<<<<<<<<<<<<< * 'gray88' : (224, 224, 224), * 'gray89' : (227, 227, 227), */ __pyx_tuple__253 = PyTuple_Pack(3, __pyx_int_222, __pyx_int_222, __pyx_int_222); if (unlikely(!__pyx_tuple__253)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 246; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_tuple__253); __Pyx_GIVEREF(__pyx_tuple__253); /* "include/color_dict.pxi":247 * 'gray86' : (219, 219, 219), * 'gray87' : (222, 222, 222), * 'gray88' : (224, 224, 224), # <<<<<<<<<<<<<< * 'gray89' : (227, 227, 227), * 'gray9' : (23, 23, 23), */ __pyx_tuple__254 = PyTuple_Pack(3, __pyx_int_224, __pyx_int_224, __pyx_int_224); if (unlikely(!__pyx_tuple__254)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 247; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_tuple__254); __Pyx_GIVEREF(__pyx_tuple__254); /* "include/color_dict.pxi":248 * 'gray87' : (222, 222, 222), * 'gray88' : (224, 224, 224), * 'gray89' : (227, 227, 227), # <<<<<<<<<<<<<< * 'gray9' : (23, 23, 23), * 'gray90' : (229, 229, 229), */ __pyx_tuple__255 = PyTuple_Pack(3, __pyx_int_227, __pyx_int_227, __pyx_int_227); if (unlikely(!__pyx_tuple__255)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 248; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_tuple__255); __Pyx_GIVEREF(__pyx_tuple__255); /* "include/color_dict.pxi":249 * 'gray88' : (224, 224, 224), * 'gray89' : (227, 227, 227), * 'gray9' : (23, 23, 23), # <<<<<<<<<<<<<< * 'gray90' : (229, 229, 229), * 'gray91' : (232, 232, 232), */ __pyx_tuple__256 = PyTuple_Pack(3, __pyx_int_23, __pyx_int_23, __pyx_int_23); if (unlikely(!__pyx_tuple__256)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 249; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_tuple__256); __Pyx_GIVEREF(__pyx_tuple__256); /* "include/color_dict.pxi":250 * 'gray89' : (227, 227, 227), * 'gray9' : (23, 23, 23), * 'gray90' : (229, 229, 229), # <<<<<<<<<<<<<< * 'gray91' : (232, 232, 232), * 'gray92' : (235, 235, 235), */ __pyx_tuple__257 = PyTuple_Pack(3, __pyx_int_229, __pyx_int_229, __pyx_int_229); if (unlikely(!__pyx_tuple__257)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 250; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_tuple__257); __Pyx_GIVEREF(__pyx_tuple__257); /* "include/color_dict.pxi":251 * 'gray9' : (23, 23, 23), * 'gray90' : (229, 229, 229), * 'gray91' : (232, 232, 232), # <<<<<<<<<<<<<< * 'gray92' : (235, 235, 235), * 'gray93' : (237, 237, 237), */ __pyx_tuple__258 = PyTuple_Pack(3, __pyx_int_232, __pyx_int_232, __pyx_int_232); if (unlikely(!__pyx_tuple__258)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 251; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_tuple__258); __Pyx_GIVEREF(__pyx_tuple__258); /* "include/color_dict.pxi":252 * 'gray90' : (229, 229, 229), * 'gray91' : (232, 232, 232), * 'gray92' : (235, 235, 235), # <<<<<<<<<<<<<< * 'gray93' : (237, 237, 237), * 'gray94' : (240, 240, 240), */ __pyx_tuple__259 = PyTuple_Pack(3, __pyx_int_235, __pyx_int_235, __pyx_int_235); if (unlikely(!__pyx_tuple__259)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 252; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_tuple__259); __Pyx_GIVEREF(__pyx_tuple__259); /* "include/color_dict.pxi":253 * 'gray91' : (232, 232, 232), * 'gray92' : (235, 235, 235), * 'gray93' : (237, 237, 237), # <<<<<<<<<<<<<< * 'gray94' : (240, 240, 240), * 'gray95' : (242, 242, 242), */ __pyx_tuple__260 = PyTuple_Pack(3, __pyx_int_237, __pyx_int_237, __pyx_int_237); if (unlikely(!__pyx_tuple__260)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 253; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_tuple__260); __Pyx_GIVEREF(__pyx_tuple__260); /* "include/color_dict.pxi":254 * 'gray92' : (235, 235, 235), * 'gray93' : (237, 237, 237), * 'gray94' : (240, 240, 240), # <<<<<<<<<<<<<< * 'gray95' : (242, 242, 242), * 'gray96' : (245, 245, 245), */ __pyx_tuple__261 = PyTuple_Pack(3, __pyx_int_240, __pyx_int_240, __pyx_int_240); if (unlikely(!__pyx_tuple__261)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 254; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_tuple__261); __Pyx_GIVEREF(__pyx_tuple__261); /* "include/color_dict.pxi":255 * 'gray93' : (237, 237, 237), * 'gray94' : (240, 240, 240), * 'gray95' : (242, 242, 242), # <<<<<<<<<<<<<< * 'gray96' : (245, 245, 245), * 'gray97' : (247, 247, 247), */ __pyx_tuple__262 = PyTuple_Pack(3, __pyx_int_242, __pyx_int_242, __pyx_int_242); if (unlikely(!__pyx_tuple__262)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 255; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_tuple__262); __Pyx_GIVEREF(__pyx_tuple__262); /* "include/color_dict.pxi":256 * 'gray94' : (240, 240, 240), * 'gray95' : (242, 242, 242), * 'gray96' : (245, 245, 245), # <<<<<<<<<<<<<< * 'gray97' : (247, 247, 247), * 'gray98' : (250, 250, 250), */ __pyx_tuple__263 = PyTuple_Pack(3, __pyx_int_245, __pyx_int_245, __pyx_int_245); if (unlikely(!__pyx_tuple__263)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 256; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_tuple__263); __Pyx_GIVEREF(__pyx_tuple__263); /* "include/color_dict.pxi":257 * 'gray95' : (242, 242, 242), * 'gray96' : (245, 245, 245), * 'gray97' : (247, 247, 247), # <<<<<<<<<<<<<< * 'gray98' : (250, 250, 250), * 'gray99' : (252, 252, 252), */ __pyx_tuple__264 = PyTuple_Pack(3, __pyx_int_247, __pyx_int_247, __pyx_int_247); if (unlikely(!__pyx_tuple__264)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 257; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_tuple__264); __Pyx_GIVEREF(__pyx_tuple__264); /* "include/color_dict.pxi":258 * 'gray96' : (245, 245, 245), * 'gray97' : (247, 247, 247), * 'gray98' : (250, 250, 250), # <<<<<<<<<<<<<< * 'gray99' : (252, 252, 252), * 'green' : (0, 255, 0), */ __pyx_tuple__265 = PyTuple_Pack(3, __pyx_int_250, __pyx_int_250, __pyx_int_250); if (unlikely(!__pyx_tuple__265)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 258; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_tuple__265); __Pyx_GIVEREF(__pyx_tuple__265); /* "include/color_dict.pxi":259 * 'gray97' : (247, 247, 247), * 'gray98' : (250, 250, 250), * 'gray99' : (252, 252, 252), # <<<<<<<<<<<<<< * 'green' : (0, 255, 0), * 'green1' : (0, 255, 0), */ __pyx_tuple__266 = PyTuple_Pack(3, __pyx_int_252, __pyx_int_252, __pyx_int_252); if (unlikely(!__pyx_tuple__266)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 259; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_tuple__266); __Pyx_GIVEREF(__pyx_tuple__266); /* "include/color_dict.pxi":260 * 'gray98' : (250, 250, 250), * 'gray99' : (252, 252, 252), * 'green' : (0, 255, 0), # <<<<<<<<<<<<<< * 'green1' : (0, 255, 0), * 'green2' : (0, 238, 0), */ __pyx_tuple__267 = PyTuple_Pack(3, __pyx_int_0, __pyx_int_255, __pyx_int_0); if (unlikely(!__pyx_tuple__267)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 260; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_tuple__267); __Pyx_GIVEREF(__pyx_tuple__267); /* "include/color_dict.pxi":261 * 'gray99' : (252, 252, 252), * 'green' : (0, 255, 0), * 'green1' : (0, 255, 0), # <<<<<<<<<<<<<< * 'green2' : (0, 238, 0), * 'green3' : (0, 205, 0), */ __pyx_tuple__268 = PyTuple_Pack(3, __pyx_int_0, __pyx_int_255, __pyx_int_0); if (unlikely(!__pyx_tuple__268)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 261; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_tuple__268); __Pyx_GIVEREF(__pyx_tuple__268); /* "include/color_dict.pxi":262 * 'green' : (0, 255, 0), * 'green1' : (0, 255, 0), * 'green2' : (0, 238, 0), # <<<<<<<<<<<<<< * 'green3' : (0, 205, 0), * 'green4' : (0, 139, 0), */ __pyx_tuple__269 = PyTuple_Pack(3, __pyx_int_0, __pyx_int_238, __pyx_int_0); if (unlikely(!__pyx_tuple__269)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 262; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_tuple__269); __Pyx_GIVEREF(__pyx_tuple__269); /* "include/color_dict.pxi":263 * 'green1' : (0, 255, 0), * 'green2' : (0, 238, 0), * 'green3' : (0, 205, 0), # <<<<<<<<<<<<<< * 'green4' : (0, 139, 0), * 'greenyellow' : (173, 255, 47), */ __pyx_tuple__270 = PyTuple_Pack(3, __pyx_int_0, __pyx_int_205, __pyx_int_0); if (unlikely(!__pyx_tuple__270)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 263; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_tuple__270); __Pyx_GIVEREF(__pyx_tuple__270); /* "include/color_dict.pxi":264 * 'green2' : (0, 238, 0), * 'green3' : (0, 205, 0), * 'green4' : (0, 139, 0), # <<<<<<<<<<<<<< * 'greenyellow' : (173, 255, 47), * 'grey' : (190, 190, 190), */ __pyx_tuple__271 = PyTuple_Pack(3, __pyx_int_0, __pyx_int_139, __pyx_int_0); if (unlikely(!__pyx_tuple__271)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 264; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_tuple__271); __Pyx_GIVEREF(__pyx_tuple__271); /* "include/color_dict.pxi":265 * 'green3' : (0, 205, 0), * 'green4' : (0, 139, 0), * 'greenyellow' : (173, 255, 47), # <<<<<<<<<<<<<< * 'grey' : (190, 190, 190), * 'grey0' : (0, 0, 0), */ __pyx_tuple__272 = PyTuple_Pack(3, __pyx_int_173, __pyx_int_255, __pyx_int_47); if (unlikely(!__pyx_tuple__272)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 265; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_tuple__272); __Pyx_GIVEREF(__pyx_tuple__272); /* "include/color_dict.pxi":266 * 'green4' : (0, 139, 0), * 'greenyellow' : (173, 255, 47), * 'grey' : (190, 190, 190), # <<<<<<<<<<<<<< * 'grey0' : (0, 0, 0), * 'grey1' : (3, 3, 3), */ __pyx_tuple__273 = PyTuple_Pack(3, __pyx_int_190, __pyx_int_190, __pyx_int_190); if (unlikely(!__pyx_tuple__273)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 266; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_tuple__273); __Pyx_GIVEREF(__pyx_tuple__273); /* "include/color_dict.pxi":267 * 'greenyellow' : (173, 255, 47), * 'grey' : (190, 190, 190), * 'grey0' : (0, 0, 0), # <<<<<<<<<<<<<< * 'grey1' : (3, 3, 3), * 'grey10' : (26, 26, 26), */ __pyx_tuple__274 = PyTuple_Pack(3, __pyx_int_0, __pyx_int_0, __pyx_int_0); if (unlikely(!__pyx_tuple__274)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 267; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_tuple__274); __Pyx_GIVEREF(__pyx_tuple__274); /* "include/color_dict.pxi":268 * 'grey' : (190, 190, 190), * 'grey0' : (0, 0, 0), * 'grey1' : (3, 3, 3), # <<<<<<<<<<<<<< * 'grey10' : (26, 26, 26), * 'grey100' : (255, 255, 255), */ __pyx_tuple__275 = PyTuple_Pack(3, __pyx_int_3, __pyx_int_3, __pyx_int_3); if (unlikely(!__pyx_tuple__275)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 268; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_tuple__275); __Pyx_GIVEREF(__pyx_tuple__275); /* "include/color_dict.pxi":269 * 'grey0' : (0, 0, 0), * 'grey1' : (3, 3, 3), * 'grey10' : (26, 26, 26), # <<<<<<<<<<<<<< * 'grey100' : (255, 255, 255), * 'grey11' : (28, 28, 28), */ __pyx_tuple__276 = PyTuple_Pack(3, __pyx_int_26, __pyx_int_26, __pyx_int_26); if (unlikely(!__pyx_tuple__276)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 269; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_tuple__276); __Pyx_GIVEREF(__pyx_tuple__276); /* "include/color_dict.pxi":270 * 'grey1' : (3, 3, 3), * 'grey10' : (26, 26, 26), * 'grey100' : (255, 255, 255), # <<<<<<<<<<<<<< * 'grey11' : (28, 28, 28), * 'grey12' : (31, 31, 31), */ __pyx_tuple__277 = PyTuple_Pack(3, __pyx_int_255, __pyx_int_255, __pyx_int_255); if (unlikely(!__pyx_tuple__277)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 270; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_tuple__277); __Pyx_GIVEREF(__pyx_tuple__277); /* "include/color_dict.pxi":271 * 'grey10' : (26, 26, 26), * 'grey100' : (255, 255, 255), * 'grey11' : (28, 28, 28), # <<<<<<<<<<<<<< * 'grey12' : (31, 31, 31), * 'grey13' : (33, 33, 33), */ __pyx_tuple__278 = PyTuple_Pack(3, __pyx_int_28, __pyx_int_28, __pyx_int_28); if (unlikely(!__pyx_tuple__278)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 271; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_tuple__278); __Pyx_GIVEREF(__pyx_tuple__278); /* "include/color_dict.pxi":272 * 'grey100' : (255, 255, 255), * 'grey11' : (28, 28, 28), * 'grey12' : (31, 31, 31), # <<<<<<<<<<<<<< * 'grey13' : (33, 33, 33), * 'grey14' : (36, 36, 36), */ __pyx_tuple__279 = PyTuple_Pack(3, __pyx_int_31, __pyx_int_31, __pyx_int_31); if (unlikely(!__pyx_tuple__279)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 272; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_tuple__279); __Pyx_GIVEREF(__pyx_tuple__279); /* "include/color_dict.pxi":273 * 'grey11' : (28, 28, 28), * 'grey12' : (31, 31, 31), * 'grey13' : (33, 33, 33), # <<<<<<<<<<<<<< * 'grey14' : (36, 36, 36), * 'grey15' : (38, 38, 38), */ __pyx_tuple__280 = PyTuple_Pack(3, __pyx_int_33, __pyx_int_33, __pyx_int_33); if (unlikely(!__pyx_tuple__280)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 273; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_tuple__280); __Pyx_GIVEREF(__pyx_tuple__280); /* "include/color_dict.pxi":274 * 'grey12' : (31, 31, 31), * 'grey13' : (33, 33, 33), * 'grey14' : (36, 36, 36), # <<<<<<<<<<<<<< * 'grey15' : (38, 38, 38), * 'grey16' : (41, 41, 41), */ __pyx_tuple__281 = PyTuple_Pack(3, __pyx_int_36, __pyx_int_36, __pyx_int_36); if (unlikely(!__pyx_tuple__281)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 274; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_tuple__281); __Pyx_GIVEREF(__pyx_tuple__281); /* "include/color_dict.pxi":275 * 'grey13' : (33, 33, 33), * 'grey14' : (36, 36, 36), * 'grey15' : (38, 38, 38), # <<<<<<<<<<<<<< * 'grey16' : (41, 41, 41), * 'grey17' : (43, 43, 43), */ __pyx_tuple__282 = PyTuple_Pack(3, __pyx_int_38, __pyx_int_38, __pyx_int_38); if (unlikely(!__pyx_tuple__282)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 275; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_tuple__282); __Pyx_GIVEREF(__pyx_tuple__282); /* "include/color_dict.pxi":276 * 'grey14' : (36, 36, 36), * 'grey15' : (38, 38, 38), * 'grey16' : (41, 41, 41), # <<<<<<<<<<<<<< * 'grey17' : (43, 43, 43), * 'grey18' : (46, 46, 46), */ __pyx_tuple__283 = PyTuple_Pack(3, __pyx_int_41, __pyx_int_41, __pyx_int_41); if (unlikely(!__pyx_tuple__283)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 276; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_tuple__283); __Pyx_GIVEREF(__pyx_tuple__283); /* "include/color_dict.pxi":277 * 'grey15' : (38, 38, 38), * 'grey16' : (41, 41, 41), * 'grey17' : (43, 43, 43), # <<<<<<<<<<<<<< * 'grey18' : (46, 46, 46), * 'grey19' : (48, 48, 48), */ __pyx_tuple__284 = PyTuple_Pack(3, __pyx_int_43, __pyx_int_43, __pyx_int_43); if (unlikely(!__pyx_tuple__284)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 277; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_tuple__284); __Pyx_GIVEREF(__pyx_tuple__284); /* "include/color_dict.pxi":278 * 'grey16' : (41, 41, 41), * 'grey17' : (43, 43, 43), * 'grey18' : (46, 46, 46), # <<<<<<<<<<<<<< * 'grey19' : (48, 48, 48), * 'grey2' : (5, 5, 5), */ __pyx_tuple__285 = PyTuple_Pack(3, __pyx_int_46, __pyx_int_46, __pyx_int_46); if (unlikely(!__pyx_tuple__285)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 278; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_tuple__285); __Pyx_GIVEREF(__pyx_tuple__285); /* "include/color_dict.pxi":279 * 'grey17' : (43, 43, 43), * 'grey18' : (46, 46, 46), * 'grey19' : (48, 48, 48), # <<<<<<<<<<<<<< * 'grey2' : (5, 5, 5), * 'grey20' : (51, 51, 51), */ __pyx_tuple__286 = PyTuple_Pack(3, __pyx_int_48, __pyx_int_48, __pyx_int_48); if (unlikely(!__pyx_tuple__286)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 279; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_tuple__286); __Pyx_GIVEREF(__pyx_tuple__286); /* "include/color_dict.pxi":280 * 'grey18' : (46, 46, 46), * 'grey19' : (48, 48, 48), * 'grey2' : (5, 5, 5), # <<<<<<<<<<<<<< * 'grey20' : (51, 51, 51), * 'grey21' : (54, 54, 54), */ __pyx_tuple__287 = PyTuple_Pack(3, __pyx_int_5, __pyx_int_5, __pyx_int_5); if (unlikely(!__pyx_tuple__287)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 280; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_tuple__287); __Pyx_GIVEREF(__pyx_tuple__287); /* "include/color_dict.pxi":281 * 'grey19' : (48, 48, 48), * 'grey2' : (5, 5, 5), * 'grey20' : (51, 51, 51), # <<<<<<<<<<<<<< * 'grey21' : (54, 54, 54), * 'grey22' : (56, 56, 56), */ __pyx_tuple__288 = PyTuple_Pack(3, __pyx_int_51, __pyx_int_51, __pyx_int_51); if (unlikely(!__pyx_tuple__288)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 281; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_tuple__288); __Pyx_GIVEREF(__pyx_tuple__288); /* "include/color_dict.pxi":282 * 'grey2' : (5, 5, 5), * 'grey20' : (51, 51, 51), * 'grey21' : (54, 54, 54), # <<<<<<<<<<<<<< * 'grey22' : (56, 56, 56), * 'grey23' : (59, 59, 59), */ __pyx_tuple__289 = PyTuple_Pack(3, __pyx_int_54, __pyx_int_54, __pyx_int_54); if (unlikely(!__pyx_tuple__289)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 282; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_tuple__289); __Pyx_GIVEREF(__pyx_tuple__289); /* "include/color_dict.pxi":283 * 'grey20' : (51, 51, 51), * 'grey21' : (54, 54, 54), * 'grey22' : (56, 56, 56), # <<<<<<<<<<<<<< * 'grey23' : (59, 59, 59), * 'grey24' : (61, 61, 61), */ __pyx_tuple__290 = PyTuple_Pack(3, __pyx_int_56, __pyx_int_56, __pyx_int_56); if (unlikely(!__pyx_tuple__290)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 283; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_tuple__290); __Pyx_GIVEREF(__pyx_tuple__290); /* "include/color_dict.pxi":284 * 'grey21' : (54, 54, 54), * 'grey22' : (56, 56, 56), * 'grey23' : (59, 59, 59), # <<<<<<<<<<<<<< * 'grey24' : (61, 61, 61), * 'grey25' : (64, 64, 64), */ __pyx_tuple__291 = PyTuple_Pack(3, __pyx_int_59, __pyx_int_59, __pyx_int_59); if (unlikely(!__pyx_tuple__291)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 284; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_tuple__291); __Pyx_GIVEREF(__pyx_tuple__291); /* "include/color_dict.pxi":285 * 'grey22' : (56, 56, 56), * 'grey23' : (59, 59, 59), * 'grey24' : (61, 61, 61), # <<<<<<<<<<<<<< * 'grey25' : (64, 64, 64), * 'grey26' : (66, 66, 66), */ __pyx_tuple__292 = PyTuple_Pack(3, __pyx_int_61, __pyx_int_61, __pyx_int_61); if (unlikely(!__pyx_tuple__292)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 285; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_tuple__292); __Pyx_GIVEREF(__pyx_tuple__292); /* "include/color_dict.pxi":286 * 'grey23' : (59, 59, 59), * 'grey24' : (61, 61, 61), * 'grey25' : (64, 64, 64), # <<<<<<<<<<<<<< * 'grey26' : (66, 66, 66), * 'grey27' : (69, 69, 69), */ __pyx_tuple__293 = PyTuple_Pack(3, __pyx_int_64, __pyx_int_64, __pyx_int_64); if (unlikely(!__pyx_tuple__293)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 286; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_tuple__293); __Pyx_GIVEREF(__pyx_tuple__293); /* "include/color_dict.pxi":287 * 'grey24' : (61, 61, 61), * 'grey25' : (64, 64, 64), * 'grey26' : (66, 66, 66), # <<<<<<<<<<<<<< * 'grey27' : (69, 69, 69), * 'grey28' : (71, 71, 71), */ __pyx_tuple__294 = PyTuple_Pack(3, __pyx_int_66, __pyx_int_66, __pyx_int_66); if (unlikely(!__pyx_tuple__294)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 287; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_tuple__294); __Pyx_GIVEREF(__pyx_tuple__294); /* "include/color_dict.pxi":288 * 'grey25' : (64, 64, 64), * 'grey26' : (66, 66, 66), * 'grey27' : (69, 69, 69), # <<<<<<<<<<<<<< * 'grey28' : (71, 71, 71), * 'grey29' : (74, 74, 74), */ __pyx_tuple__295 = PyTuple_Pack(3, __pyx_int_69, __pyx_int_69, __pyx_int_69); if (unlikely(!__pyx_tuple__295)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 288; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_tuple__295); __Pyx_GIVEREF(__pyx_tuple__295); /* "include/color_dict.pxi":289 * 'grey26' : (66, 66, 66), * 'grey27' : (69, 69, 69), * 'grey28' : (71, 71, 71), # <<<<<<<<<<<<<< * 'grey29' : (74, 74, 74), * 'grey3' : (8, 8, 8), */ __pyx_tuple__296 = PyTuple_Pack(3, __pyx_int_71, __pyx_int_71, __pyx_int_71); if (unlikely(!__pyx_tuple__296)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 289; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_tuple__296); __Pyx_GIVEREF(__pyx_tuple__296); /* "include/color_dict.pxi":290 * 'grey27' : (69, 69, 69), * 'grey28' : (71, 71, 71), * 'grey29' : (74, 74, 74), # <<<<<<<<<<<<<< * 'grey3' : (8, 8, 8), * 'grey30' : (77, 77, 77), */ __pyx_tuple__297 = PyTuple_Pack(3, __pyx_int_74, __pyx_int_74, __pyx_int_74); if (unlikely(!__pyx_tuple__297)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 290; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_tuple__297); __Pyx_GIVEREF(__pyx_tuple__297); /* "include/color_dict.pxi":291 * 'grey28' : (71, 71, 71), * 'grey29' : (74, 74, 74), * 'grey3' : (8, 8, 8), # <<<<<<<<<<<<<< * 'grey30' : (77, 77, 77), * 'grey31' : (79, 79, 79), */ __pyx_tuple__298 = PyTuple_Pack(3, __pyx_int_8, __pyx_int_8, __pyx_int_8); if (unlikely(!__pyx_tuple__298)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 291; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_tuple__298); __Pyx_GIVEREF(__pyx_tuple__298); /* "include/color_dict.pxi":292 * 'grey29' : (74, 74, 74), * 'grey3' : (8, 8, 8), * 'grey30' : (77, 77, 77), # <<<<<<<<<<<<<< * 'grey31' : (79, 79, 79), * 'grey32' : (82, 82, 82), */ __pyx_tuple__299 = PyTuple_Pack(3, __pyx_int_77, __pyx_int_77, __pyx_int_77); if (unlikely(!__pyx_tuple__299)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 292; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_tuple__299); __Pyx_GIVEREF(__pyx_tuple__299); /* "include/color_dict.pxi":293 * 'grey3' : (8, 8, 8), * 'grey30' : (77, 77, 77), * 'grey31' : (79, 79, 79), # <<<<<<<<<<<<<< * 'grey32' : (82, 82, 82), * 'grey33' : (84, 84, 84), */ __pyx_tuple__300 = PyTuple_Pack(3, __pyx_int_79, __pyx_int_79, __pyx_int_79); if (unlikely(!__pyx_tuple__300)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 293; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_tuple__300); __Pyx_GIVEREF(__pyx_tuple__300); /* "include/color_dict.pxi":294 * 'grey30' : (77, 77, 77), * 'grey31' : (79, 79, 79), * 'grey32' : (82, 82, 82), # <<<<<<<<<<<<<< * 'grey33' : (84, 84, 84), * 'grey34' : (87, 87, 87), */ __pyx_tuple__301 = PyTuple_Pack(3, __pyx_int_82, __pyx_int_82, __pyx_int_82); if (unlikely(!__pyx_tuple__301)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 294; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_tuple__301); __Pyx_GIVEREF(__pyx_tuple__301); /* "include/color_dict.pxi":295 * 'grey31' : (79, 79, 79), * 'grey32' : (82, 82, 82), * 'grey33' : (84, 84, 84), # <<<<<<<<<<<<<< * 'grey34' : (87, 87, 87), * 'grey35' : (89, 89, 89), */ __pyx_tuple__302 = PyTuple_Pack(3, __pyx_int_84, __pyx_int_84, __pyx_int_84); if (unlikely(!__pyx_tuple__302)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 295; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_tuple__302); __Pyx_GIVEREF(__pyx_tuple__302); /* "include/color_dict.pxi":296 * 'grey32' : (82, 82, 82), * 'grey33' : (84, 84, 84), * 'grey34' : (87, 87, 87), # <<<<<<<<<<<<<< * 'grey35' : (89, 89, 89), * 'grey36' : (92, 92, 92), */ __pyx_tuple__303 = PyTuple_Pack(3, __pyx_int_87, __pyx_int_87, __pyx_int_87); if (unlikely(!__pyx_tuple__303)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 296; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_tuple__303); __Pyx_GIVEREF(__pyx_tuple__303); /* "include/color_dict.pxi":297 * 'grey33' : (84, 84, 84), * 'grey34' : (87, 87, 87), * 'grey35' : (89, 89, 89), # <<<<<<<<<<<<<< * 'grey36' : (92, 92, 92), * 'grey37' : (94, 94, 94), */ __pyx_tuple__304 = PyTuple_Pack(3, __pyx_int_89, __pyx_int_89, __pyx_int_89); if (unlikely(!__pyx_tuple__304)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 297; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_tuple__304); __Pyx_GIVEREF(__pyx_tuple__304); /* "include/color_dict.pxi":298 * 'grey34' : (87, 87, 87), * 'grey35' : (89, 89, 89), * 'grey36' : (92, 92, 92), # <<<<<<<<<<<<<< * 'grey37' : (94, 94, 94), * 'grey38' : (97, 97, 97), */ __pyx_tuple__305 = PyTuple_Pack(3, __pyx_int_92, __pyx_int_92, __pyx_int_92); if (unlikely(!__pyx_tuple__305)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 298; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_tuple__305); __Pyx_GIVEREF(__pyx_tuple__305); /* "include/color_dict.pxi":299 * 'grey35' : (89, 89, 89), * 'grey36' : (92, 92, 92), * 'grey37' : (94, 94, 94), # <<<<<<<<<<<<<< * 'grey38' : (97, 97, 97), * 'grey39' : (99, 99, 99), */ __pyx_tuple__306 = PyTuple_Pack(3, __pyx_int_94, __pyx_int_94, __pyx_int_94); if (unlikely(!__pyx_tuple__306)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 299; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_tuple__306); __Pyx_GIVEREF(__pyx_tuple__306); /* "include/color_dict.pxi":300 * 'grey36' : (92, 92, 92), * 'grey37' : (94, 94, 94), * 'grey38' : (97, 97, 97), # <<<<<<<<<<<<<< * 'grey39' : (99, 99, 99), * 'grey4' : (10, 10, 10), */ __pyx_tuple__307 = PyTuple_Pack(3, __pyx_int_97, __pyx_int_97, __pyx_int_97); if (unlikely(!__pyx_tuple__307)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 300; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_tuple__307); __Pyx_GIVEREF(__pyx_tuple__307); /* "include/color_dict.pxi":301 * 'grey37' : (94, 94, 94), * 'grey38' : (97, 97, 97), * 'grey39' : (99, 99, 99), # <<<<<<<<<<<<<< * 'grey4' : (10, 10, 10), * 'grey40' : (102, 102, 102), */ __pyx_tuple__308 = PyTuple_Pack(3, __pyx_int_99, __pyx_int_99, __pyx_int_99); if (unlikely(!__pyx_tuple__308)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 301; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_tuple__308); __Pyx_GIVEREF(__pyx_tuple__308); /* "include/color_dict.pxi":302 * 'grey38' : (97, 97, 97), * 'grey39' : (99, 99, 99), * 'grey4' : (10, 10, 10), # <<<<<<<<<<<<<< * 'grey40' : (102, 102, 102), * 'grey41' : (105, 105, 105), */ __pyx_tuple__309 = PyTuple_Pack(3, __pyx_int_10, __pyx_int_10, __pyx_int_10); if (unlikely(!__pyx_tuple__309)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 302; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_tuple__309); __Pyx_GIVEREF(__pyx_tuple__309); /* "include/color_dict.pxi":303 * 'grey39' : (99, 99, 99), * 'grey4' : (10, 10, 10), * 'grey40' : (102, 102, 102), # <<<<<<<<<<<<<< * 'grey41' : (105, 105, 105), * 'grey42' : (107, 107, 107), */ __pyx_tuple__310 = PyTuple_Pack(3, __pyx_int_102, __pyx_int_102, __pyx_int_102); if (unlikely(!__pyx_tuple__310)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 303; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_tuple__310); __Pyx_GIVEREF(__pyx_tuple__310); /* "include/color_dict.pxi":304 * 'grey4' : (10, 10, 10), * 'grey40' : (102, 102, 102), * 'grey41' : (105, 105, 105), # <<<<<<<<<<<<<< * 'grey42' : (107, 107, 107), * 'grey43' : (110, 110, 110), */ __pyx_tuple__311 = PyTuple_Pack(3, __pyx_int_105, __pyx_int_105, __pyx_int_105); if (unlikely(!__pyx_tuple__311)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 304; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_tuple__311); __Pyx_GIVEREF(__pyx_tuple__311); /* "include/color_dict.pxi":305 * 'grey40' : (102, 102, 102), * 'grey41' : (105, 105, 105), * 'grey42' : (107, 107, 107), # <<<<<<<<<<<<<< * 'grey43' : (110, 110, 110), * 'grey44' : (112, 112, 112), */ __pyx_tuple__312 = PyTuple_Pack(3, __pyx_int_107, __pyx_int_107, __pyx_int_107); if (unlikely(!__pyx_tuple__312)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 305; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_tuple__312); __Pyx_GIVEREF(__pyx_tuple__312); /* "include/color_dict.pxi":306 * 'grey41' : (105, 105, 105), * 'grey42' : (107, 107, 107), * 'grey43' : (110, 110, 110), # <<<<<<<<<<<<<< * 'grey44' : (112, 112, 112), * 'grey45' : (115, 115, 115), */ __pyx_tuple__313 = PyTuple_Pack(3, __pyx_int_110, __pyx_int_110, __pyx_int_110); if (unlikely(!__pyx_tuple__313)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 306; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_tuple__313); __Pyx_GIVEREF(__pyx_tuple__313); /* "include/color_dict.pxi":307 * 'grey42' : (107, 107, 107), * 'grey43' : (110, 110, 110), * 'grey44' : (112, 112, 112), # <<<<<<<<<<<<<< * 'grey45' : (115, 115, 115), * 'grey46' : (117, 117, 117), */ __pyx_tuple__314 = PyTuple_Pack(3, __pyx_int_112, __pyx_int_112, __pyx_int_112); if (unlikely(!__pyx_tuple__314)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 307; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_tuple__314); __Pyx_GIVEREF(__pyx_tuple__314); /* "include/color_dict.pxi":308 * 'grey43' : (110, 110, 110), * 'grey44' : (112, 112, 112), * 'grey45' : (115, 115, 115), # <<<<<<<<<<<<<< * 'grey46' : (117, 117, 117), * 'grey47' : (120, 120, 120), */ __pyx_tuple__315 = PyTuple_Pack(3, __pyx_int_115, __pyx_int_115, __pyx_int_115); if (unlikely(!__pyx_tuple__315)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 308; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_tuple__315); __Pyx_GIVEREF(__pyx_tuple__315); /* "include/color_dict.pxi":309 * 'grey44' : (112, 112, 112), * 'grey45' : (115, 115, 115), * 'grey46' : (117, 117, 117), # <<<<<<<<<<<<<< * 'grey47' : (120, 120, 120), * 'grey48' : (122, 122, 122), */ __pyx_tuple__316 = PyTuple_Pack(3, __pyx_int_117, __pyx_int_117, __pyx_int_117); if (unlikely(!__pyx_tuple__316)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 309; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_tuple__316); __Pyx_GIVEREF(__pyx_tuple__316); /* "include/color_dict.pxi":310 * 'grey45' : (115, 115, 115), * 'grey46' : (117, 117, 117), * 'grey47' : (120, 120, 120), # <<<<<<<<<<<<<< * 'grey48' : (122, 122, 122), * 'grey49' : (125, 125, 125), */ __pyx_tuple__317 = PyTuple_Pack(3, __pyx_int_120, __pyx_int_120, __pyx_int_120); if (unlikely(!__pyx_tuple__317)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 310; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_tuple__317); __Pyx_GIVEREF(__pyx_tuple__317); /* "include/color_dict.pxi":311 * 'grey46' : (117, 117, 117), * 'grey47' : (120, 120, 120), * 'grey48' : (122, 122, 122), # <<<<<<<<<<<<<< * 'grey49' : (125, 125, 125), * 'grey5' : (13, 13, 13), */ __pyx_tuple__318 = PyTuple_Pack(3, __pyx_int_122, __pyx_int_122, __pyx_int_122); if (unlikely(!__pyx_tuple__318)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 311; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_tuple__318); __Pyx_GIVEREF(__pyx_tuple__318); /* "include/color_dict.pxi":312 * 'grey47' : (120, 120, 120), * 'grey48' : (122, 122, 122), * 'grey49' : (125, 125, 125), # <<<<<<<<<<<<<< * 'grey5' : (13, 13, 13), * 'grey50' : (127, 127, 127), */ __pyx_tuple__319 = PyTuple_Pack(3, __pyx_int_125, __pyx_int_125, __pyx_int_125); if (unlikely(!__pyx_tuple__319)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 312; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_tuple__319); __Pyx_GIVEREF(__pyx_tuple__319); /* "include/color_dict.pxi":313 * 'grey48' : (122, 122, 122), * 'grey49' : (125, 125, 125), * 'grey5' : (13, 13, 13), # <<<<<<<<<<<<<< * 'grey50' : (127, 127, 127), * 'grey51' : (130, 130, 130), */ __pyx_tuple__320 = PyTuple_Pack(3, __pyx_int_13, __pyx_int_13, __pyx_int_13); if (unlikely(!__pyx_tuple__320)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 313; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_tuple__320); __Pyx_GIVEREF(__pyx_tuple__320); /* "include/color_dict.pxi":314 * 'grey49' : (125, 125, 125), * 'grey5' : (13, 13, 13), * 'grey50' : (127, 127, 127), # <<<<<<<<<<<<<< * 'grey51' : (130, 130, 130), * 'grey52' : (133, 133, 133), */ __pyx_tuple__321 = PyTuple_Pack(3, __pyx_int_127, __pyx_int_127, __pyx_int_127); if (unlikely(!__pyx_tuple__321)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 314; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_tuple__321); __Pyx_GIVEREF(__pyx_tuple__321); /* "include/color_dict.pxi":315 * 'grey5' : (13, 13, 13), * 'grey50' : (127, 127, 127), * 'grey51' : (130, 130, 130), # <<<<<<<<<<<<<< * 'grey52' : (133, 133, 133), * 'grey53' : (135, 135, 135), */ __pyx_tuple__322 = PyTuple_Pack(3, __pyx_int_130, __pyx_int_130, __pyx_int_130); if (unlikely(!__pyx_tuple__322)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 315; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_tuple__322); __Pyx_GIVEREF(__pyx_tuple__322); /* "include/color_dict.pxi":316 * 'grey50' : (127, 127, 127), * 'grey51' : (130, 130, 130), * 'grey52' : (133, 133, 133), # <<<<<<<<<<<<<< * 'grey53' : (135, 135, 135), * 'grey54' : (138, 138, 138), */ __pyx_tuple__323 = PyTuple_Pack(3, __pyx_int_133, __pyx_int_133, __pyx_int_133); if (unlikely(!__pyx_tuple__323)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 316; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_tuple__323); __Pyx_GIVEREF(__pyx_tuple__323); /* "include/color_dict.pxi":317 * 'grey51' : (130, 130, 130), * 'grey52' : (133, 133, 133), * 'grey53' : (135, 135, 135), # <<<<<<<<<<<<<< * 'grey54' : (138, 138, 138), * 'grey55' : (140, 140, 140), */ __pyx_tuple__324 = PyTuple_Pack(3, __pyx_int_135, __pyx_int_135, __pyx_int_135); if (unlikely(!__pyx_tuple__324)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 317; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_tuple__324); __Pyx_GIVEREF(__pyx_tuple__324); /* "include/color_dict.pxi":318 * 'grey52' : (133, 133, 133), * 'grey53' : (135, 135, 135), * 'grey54' : (138, 138, 138), # <<<<<<<<<<<<<< * 'grey55' : (140, 140, 140), * 'grey56' : (143, 143, 143), */ __pyx_tuple__325 = PyTuple_Pack(3, __pyx_int_138, __pyx_int_138, __pyx_int_138); if (unlikely(!__pyx_tuple__325)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 318; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_tuple__325); __Pyx_GIVEREF(__pyx_tuple__325); /* "include/color_dict.pxi":319 * 'grey53' : (135, 135, 135), * 'grey54' : (138, 138, 138), * 'grey55' : (140, 140, 140), # <<<<<<<<<<<<<< * 'grey56' : (143, 143, 143), * 'grey57' : (145, 145, 145), */ __pyx_tuple__326 = PyTuple_Pack(3, __pyx_int_140, __pyx_int_140, __pyx_int_140); if (unlikely(!__pyx_tuple__326)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 319; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_tuple__326); __Pyx_GIVEREF(__pyx_tuple__326); /* "include/color_dict.pxi":320 * 'grey54' : (138, 138, 138), * 'grey55' : (140, 140, 140), * 'grey56' : (143, 143, 143), # <<<<<<<<<<<<<< * 'grey57' : (145, 145, 145), * 'grey58' : (148, 148, 148), */ __pyx_tuple__327 = PyTuple_Pack(3, __pyx_int_143, __pyx_int_143, __pyx_int_143); if (unlikely(!__pyx_tuple__327)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 320; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_tuple__327); __Pyx_GIVEREF(__pyx_tuple__327); /* "include/color_dict.pxi":321 * 'grey55' : (140, 140, 140), * 'grey56' : (143, 143, 143), * 'grey57' : (145, 145, 145), # <<<<<<<<<<<<<< * 'grey58' : (148, 148, 148), * 'grey59' : (150, 150, 150), */ __pyx_tuple__328 = PyTuple_Pack(3, __pyx_int_145, __pyx_int_145, __pyx_int_145); if (unlikely(!__pyx_tuple__328)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 321; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_tuple__328); __Pyx_GIVEREF(__pyx_tuple__328); /* "include/color_dict.pxi":322 * 'grey56' : (143, 143, 143), * 'grey57' : (145, 145, 145), * 'grey58' : (148, 148, 148), # <<<<<<<<<<<<<< * 'grey59' : (150, 150, 150), * 'grey6' : (15, 15, 15), */ __pyx_tuple__329 = PyTuple_Pack(3, __pyx_int_148, __pyx_int_148, __pyx_int_148); if (unlikely(!__pyx_tuple__329)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 322; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_tuple__329); __Pyx_GIVEREF(__pyx_tuple__329); /* "include/color_dict.pxi":323 * 'grey57' : (145, 145, 145), * 'grey58' : (148, 148, 148), * 'grey59' : (150, 150, 150), # <<<<<<<<<<<<<< * 'grey6' : (15, 15, 15), * 'grey60' : (153, 153, 153), */ __pyx_tuple__330 = PyTuple_Pack(3, __pyx_int_150, __pyx_int_150, __pyx_int_150); if (unlikely(!__pyx_tuple__330)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 323; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_tuple__330); __Pyx_GIVEREF(__pyx_tuple__330); /* "include/color_dict.pxi":324 * 'grey58' : (148, 148, 148), * 'grey59' : (150, 150, 150), * 'grey6' : (15, 15, 15), # <<<<<<<<<<<<<< * 'grey60' : (153, 153, 153), * 'grey61' : (156, 156, 156), */ __pyx_tuple__331 = PyTuple_Pack(3, __pyx_int_15, __pyx_int_15, __pyx_int_15); if (unlikely(!__pyx_tuple__331)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 324; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_tuple__331); __Pyx_GIVEREF(__pyx_tuple__331); /* "include/color_dict.pxi":325 * 'grey59' : (150, 150, 150), * 'grey6' : (15, 15, 15), * 'grey60' : (153, 153, 153), # <<<<<<<<<<<<<< * 'grey61' : (156, 156, 156), * 'grey62' : (158, 158, 158), */ __pyx_tuple__332 = PyTuple_Pack(3, __pyx_int_153, __pyx_int_153, __pyx_int_153); if (unlikely(!__pyx_tuple__332)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 325; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_tuple__332); __Pyx_GIVEREF(__pyx_tuple__332); /* "include/color_dict.pxi":326 * 'grey6' : (15, 15, 15), * 'grey60' : (153, 153, 153), * 'grey61' : (156, 156, 156), # <<<<<<<<<<<<<< * 'grey62' : (158, 158, 158), * 'grey63' : (161, 161, 161), */ __pyx_tuple__333 = PyTuple_Pack(3, __pyx_int_156, __pyx_int_156, __pyx_int_156); if (unlikely(!__pyx_tuple__333)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 326; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_tuple__333); __Pyx_GIVEREF(__pyx_tuple__333); /* "include/color_dict.pxi":327 * 'grey60' : (153, 153, 153), * 'grey61' : (156, 156, 156), * 'grey62' : (158, 158, 158), # <<<<<<<<<<<<<< * 'grey63' : (161, 161, 161), * 'grey64' : (163, 163, 163), */ __pyx_tuple__334 = PyTuple_Pack(3, __pyx_int_158, __pyx_int_158, __pyx_int_158); if (unlikely(!__pyx_tuple__334)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 327; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_tuple__334); __Pyx_GIVEREF(__pyx_tuple__334); /* "include/color_dict.pxi":328 * 'grey61' : (156, 156, 156), * 'grey62' : (158, 158, 158), * 'grey63' : (161, 161, 161), # <<<<<<<<<<<<<< * 'grey64' : (163, 163, 163), * 'grey65' : (166, 166, 166), */ __pyx_tuple__335 = PyTuple_Pack(3, __pyx_int_161, __pyx_int_161, __pyx_int_161); if (unlikely(!__pyx_tuple__335)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 328; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_tuple__335); __Pyx_GIVEREF(__pyx_tuple__335); /* "include/color_dict.pxi":329 * 'grey62' : (158, 158, 158), * 'grey63' : (161, 161, 161), * 'grey64' : (163, 163, 163), # <<<<<<<<<<<<<< * 'grey65' : (166, 166, 166), * 'grey66' : (168, 168, 168), */ __pyx_tuple__336 = PyTuple_Pack(3, __pyx_int_163, __pyx_int_163, __pyx_int_163); if (unlikely(!__pyx_tuple__336)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 329; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_tuple__336); __Pyx_GIVEREF(__pyx_tuple__336); /* "include/color_dict.pxi":330 * 'grey63' : (161, 161, 161), * 'grey64' : (163, 163, 163), * 'grey65' : (166, 166, 166), # <<<<<<<<<<<<<< * 'grey66' : (168, 168, 168), * 'grey67' : (171, 171, 171), */ __pyx_tuple__337 = PyTuple_Pack(3, __pyx_int_166, __pyx_int_166, __pyx_int_166); if (unlikely(!__pyx_tuple__337)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 330; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_tuple__337); __Pyx_GIVEREF(__pyx_tuple__337); /* "include/color_dict.pxi":331 * 'grey64' : (163, 163, 163), * 'grey65' : (166, 166, 166), * 'grey66' : (168, 168, 168), # <<<<<<<<<<<<<< * 'grey67' : (171, 171, 171), * 'grey68' : (173, 173, 173), */ __pyx_tuple__338 = PyTuple_Pack(3, __pyx_int_168, __pyx_int_168, __pyx_int_168); if (unlikely(!__pyx_tuple__338)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 331; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_tuple__338); __Pyx_GIVEREF(__pyx_tuple__338); /* "include/color_dict.pxi":332 * 'grey65' : (166, 166, 166), * 'grey66' : (168, 168, 168), * 'grey67' : (171, 171, 171), # <<<<<<<<<<<<<< * 'grey68' : (173, 173, 173), * 'grey69' : (176, 176, 176), */ __pyx_tuple__339 = PyTuple_Pack(3, __pyx_int_171, __pyx_int_171, __pyx_int_171); if (unlikely(!__pyx_tuple__339)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 332; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_tuple__339); __Pyx_GIVEREF(__pyx_tuple__339); /* "include/color_dict.pxi":333 * 'grey66' : (168, 168, 168), * 'grey67' : (171, 171, 171), * 'grey68' : (173, 173, 173), # <<<<<<<<<<<<<< * 'grey69' : (176, 176, 176), * 'grey7' : (18, 18, 18), */ __pyx_tuple__340 = PyTuple_Pack(3, __pyx_int_173, __pyx_int_173, __pyx_int_173); if (unlikely(!__pyx_tuple__340)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 333; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_tuple__340); __Pyx_GIVEREF(__pyx_tuple__340); /* "include/color_dict.pxi":334 * 'grey67' : (171, 171, 171), * 'grey68' : (173, 173, 173), * 'grey69' : (176, 176, 176), # <<<<<<<<<<<<<< * 'grey7' : (18, 18, 18), * 'grey70' : (179, 179, 179), */ __pyx_tuple__341 = PyTuple_Pack(3, __pyx_int_176, __pyx_int_176, __pyx_int_176); if (unlikely(!__pyx_tuple__341)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 334; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_tuple__341); __Pyx_GIVEREF(__pyx_tuple__341); /* "include/color_dict.pxi":335 * 'grey68' : (173, 173, 173), * 'grey69' : (176, 176, 176), * 'grey7' : (18, 18, 18), # <<<<<<<<<<<<<< * 'grey70' : (179, 179, 179), * 'grey71' : (181, 181, 181), */ __pyx_tuple__342 = PyTuple_Pack(3, __pyx_int_18, __pyx_int_18, __pyx_int_18); if (unlikely(!__pyx_tuple__342)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 335; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_tuple__342); __Pyx_GIVEREF(__pyx_tuple__342); /* "include/color_dict.pxi":336 * 'grey69' : (176, 176, 176), * 'grey7' : (18, 18, 18), * 'grey70' : (179, 179, 179), # <<<<<<<<<<<<<< * 'grey71' : (181, 181, 181), * 'grey72' : (184, 184, 184), */ __pyx_tuple__343 = PyTuple_Pack(3, __pyx_int_179, __pyx_int_179, __pyx_int_179); if (unlikely(!__pyx_tuple__343)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 336; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_tuple__343); __Pyx_GIVEREF(__pyx_tuple__343); /* "include/color_dict.pxi":337 * 'grey7' : (18, 18, 18), * 'grey70' : (179, 179, 179), * 'grey71' : (181, 181, 181), # <<<<<<<<<<<<<< * 'grey72' : (184, 184, 184), * 'grey73' : (186, 186, 186), */ __pyx_tuple__344 = PyTuple_Pack(3, __pyx_int_181, __pyx_int_181, __pyx_int_181); if (unlikely(!__pyx_tuple__344)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 337; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_tuple__344); __Pyx_GIVEREF(__pyx_tuple__344); /* "include/color_dict.pxi":338 * 'grey70' : (179, 179, 179), * 'grey71' : (181, 181, 181), * 'grey72' : (184, 184, 184), # <<<<<<<<<<<<<< * 'grey73' : (186, 186, 186), * 'grey74' : (189, 189, 189), */ __pyx_tuple__345 = PyTuple_Pack(3, __pyx_int_184, __pyx_int_184, __pyx_int_184); if (unlikely(!__pyx_tuple__345)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 338; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_tuple__345); __Pyx_GIVEREF(__pyx_tuple__345); /* "include/color_dict.pxi":339 * 'grey71' : (181, 181, 181), * 'grey72' : (184, 184, 184), * 'grey73' : (186, 186, 186), # <<<<<<<<<<<<<< * 'grey74' : (189, 189, 189), * 'grey75' : (191, 191, 191), */ __pyx_tuple__346 = PyTuple_Pack(3, __pyx_int_186, __pyx_int_186, __pyx_int_186); if (unlikely(!__pyx_tuple__346)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 339; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_tuple__346); __Pyx_GIVEREF(__pyx_tuple__346); /* "include/color_dict.pxi":340 * 'grey72' : (184, 184, 184), * 'grey73' : (186, 186, 186), * 'grey74' : (189, 189, 189), # <<<<<<<<<<<<<< * 'grey75' : (191, 191, 191), * 'grey76' : (194, 194, 194), */ __pyx_tuple__347 = PyTuple_Pack(3, __pyx_int_189, __pyx_int_189, __pyx_int_189); if (unlikely(!__pyx_tuple__347)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 340; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_tuple__347); __Pyx_GIVEREF(__pyx_tuple__347); /* "include/color_dict.pxi":341 * 'grey73' : (186, 186, 186), * 'grey74' : (189, 189, 189), * 'grey75' : (191, 191, 191), # <<<<<<<<<<<<<< * 'grey76' : (194, 194, 194), * 'grey77' : (196, 196, 196), */ __pyx_tuple__348 = PyTuple_Pack(3, __pyx_int_191, __pyx_int_191, __pyx_int_191); if (unlikely(!__pyx_tuple__348)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 341; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_tuple__348); __Pyx_GIVEREF(__pyx_tuple__348); /* "include/color_dict.pxi":342 * 'grey74' : (189, 189, 189), * 'grey75' : (191, 191, 191), * 'grey76' : (194, 194, 194), # <<<<<<<<<<<<<< * 'grey77' : (196, 196, 196), * 'grey78' : (199, 199, 199), */ __pyx_tuple__349 = PyTuple_Pack(3, __pyx_int_194, __pyx_int_194, __pyx_int_194); if (unlikely(!__pyx_tuple__349)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 342; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_tuple__349); __Pyx_GIVEREF(__pyx_tuple__349); /* "include/color_dict.pxi":343 * 'grey75' : (191, 191, 191), * 'grey76' : (194, 194, 194), * 'grey77' : (196, 196, 196), # <<<<<<<<<<<<<< * 'grey78' : (199, 199, 199), * 'grey79' : (201, 201, 201), */ __pyx_tuple__350 = PyTuple_Pack(3, __pyx_int_196, __pyx_int_196, __pyx_int_196); if (unlikely(!__pyx_tuple__350)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 343; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_tuple__350); __Pyx_GIVEREF(__pyx_tuple__350); /* "include/color_dict.pxi":344 * 'grey76' : (194, 194, 194), * 'grey77' : (196, 196, 196), * 'grey78' : (199, 199, 199), # <<<<<<<<<<<<<< * 'grey79' : (201, 201, 201), * 'grey8' : (20, 20, 20), */ __pyx_tuple__351 = PyTuple_Pack(3, __pyx_int_199, __pyx_int_199, __pyx_int_199); if (unlikely(!__pyx_tuple__351)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 344; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_tuple__351); __Pyx_GIVEREF(__pyx_tuple__351); /* "include/color_dict.pxi":345 * 'grey77' : (196, 196, 196), * 'grey78' : (199, 199, 199), * 'grey79' : (201, 201, 201), # <<<<<<<<<<<<<< * 'grey8' : (20, 20, 20), * 'grey80' : (204, 204, 204), */ __pyx_tuple__352 = PyTuple_Pack(3, __pyx_int_201, __pyx_int_201, __pyx_int_201); if (unlikely(!__pyx_tuple__352)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 345; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_tuple__352); __Pyx_GIVEREF(__pyx_tuple__352); /* "include/color_dict.pxi":346 * 'grey78' : (199, 199, 199), * 'grey79' : (201, 201, 201), * 'grey8' : (20, 20, 20), # <<<<<<<<<<<<<< * 'grey80' : (204, 204, 204), * 'grey81' : (207, 207, 207), */ __pyx_tuple__353 = PyTuple_Pack(3, __pyx_int_20, __pyx_int_20, __pyx_int_20); if (unlikely(!__pyx_tuple__353)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 346; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_tuple__353); __Pyx_GIVEREF(__pyx_tuple__353); /* "include/color_dict.pxi":347 * 'grey79' : (201, 201, 201), * 'grey8' : (20, 20, 20), * 'grey80' : (204, 204, 204), # <<<<<<<<<<<<<< * 'grey81' : (207, 207, 207), * 'grey82' : (209, 209, 209), */ __pyx_tuple__354 = PyTuple_Pack(3, __pyx_int_204, __pyx_int_204, __pyx_int_204); if (unlikely(!__pyx_tuple__354)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 347; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_tuple__354); __Pyx_GIVEREF(__pyx_tuple__354); /* "include/color_dict.pxi":348 * 'grey8' : (20, 20, 20), * 'grey80' : (204, 204, 204), * 'grey81' : (207, 207, 207), # <<<<<<<<<<<<<< * 'grey82' : (209, 209, 209), * 'grey83' : (212, 212, 212), */ __pyx_tuple__355 = PyTuple_Pack(3, __pyx_int_207, __pyx_int_207, __pyx_int_207); if (unlikely(!__pyx_tuple__355)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 348; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_tuple__355); __Pyx_GIVEREF(__pyx_tuple__355); /* "include/color_dict.pxi":349 * 'grey80' : (204, 204, 204), * 'grey81' : (207, 207, 207), * 'grey82' : (209, 209, 209), # <<<<<<<<<<<<<< * 'grey83' : (212, 212, 212), * 'grey84' : (214, 214, 214), */ __pyx_tuple__356 = PyTuple_Pack(3, __pyx_int_209, __pyx_int_209, __pyx_int_209); if (unlikely(!__pyx_tuple__356)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 349; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_tuple__356); __Pyx_GIVEREF(__pyx_tuple__356); /* "include/color_dict.pxi":350 * 'grey81' : (207, 207, 207), * 'grey82' : (209, 209, 209), * 'grey83' : (212, 212, 212), # <<<<<<<<<<<<<< * 'grey84' : (214, 214, 214), * 'grey85' : (217, 217, 217), */ __pyx_tuple__357 = PyTuple_Pack(3, __pyx_int_212, __pyx_int_212, __pyx_int_212); if (unlikely(!__pyx_tuple__357)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 350; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_tuple__357); __Pyx_GIVEREF(__pyx_tuple__357); /* "include/color_dict.pxi":351 * 'grey82' : (209, 209, 209), * 'grey83' : (212, 212, 212), * 'grey84' : (214, 214, 214), # <<<<<<<<<<<<<< * 'grey85' : (217, 217, 217), * 'grey86' : (219, 219, 219), */ __pyx_tuple__358 = PyTuple_Pack(3, __pyx_int_214, __pyx_int_214, __pyx_int_214); if (unlikely(!__pyx_tuple__358)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 351; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_tuple__358); __Pyx_GIVEREF(__pyx_tuple__358); /* "include/color_dict.pxi":352 * 'grey83' : (212, 212, 212), * 'grey84' : (214, 214, 214), * 'grey85' : (217, 217, 217), # <<<<<<<<<<<<<< * 'grey86' : (219, 219, 219), * 'grey87' : (222, 222, 222), */ __pyx_tuple__359 = PyTuple_Pack(3, __pyx_int_217, __pyx_int_217, __pyx_int_217); if (unlikely(!__pyx_tuple__359)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 352; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_tuple__359); __Pyx_GIVEREF(__pyx_tuple__359); /* "include/color_dict.pxi":353 * 'grey84' : (214, 214, 214), * 'grey85' : (217, 217, 217), * 'grey86' : (219, 219, 219), # <<<<<<<<<<<<<< * 'grey87' : (222, 222, 222), * 'grey88' : (224, 224, 224), */ __pyx_tuple__360 = PyTuple_Pack(3, __pyx_int_219, __pyx_int_219, __pyx_int_219); if (unlikely(!__pyx_tuple__360)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 353; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_tuple__360); __Pyx_GIVEREF(__pyx_tuple__360); /* "include/color_dict.pxi":354 * 'grey85' : (217, 217, 217), * 'grey86' : (219, 219, 219), * 'grey87' : (222, 222, 222), # <<<<<<<<<<<<<< * 'grey88' : (224, 224, 224), * 'grey89' : (227, 227, 227), */ __pyx_tuple__361 = PyTuple_Pack(3, __pyx_int_222, __pyx_int_222, __pyx_int_222); if (unlikely(!__pyx_tuple__361)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 354; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_tuple__361); __Pyx_GIVEREF(__pyx_tuple__361); /* "include/color_dict.pxi":355 * 'grey86' : (219, 219, 219), * 'grey87' : (222, 222, 222), * 'grey88' : (224, 224, 224), # <<<<<<<<<<<<<< * 'grey89' : (227, 227, 227), * 'grey9' : (23, 23, 23), */ __pyx_tuple__362 = PyTuple_Pack(3, __pyx_int_224, __pyx_int_224, __pyx_int_224); if (unlikely(!__pyx_tuple__362)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 355; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_tuple__362); __Pyx_GIVEREF(__pyx_tuple__362); /* "include/color_dict.pxi":356 * 'grey87' : (222, 222, 222), * 'grey88' : (224, 224, 224), * 'grey89' : (227, 227, 227), # <<<<<<<<<<<<<< * 'grey9' : (23, 23, 23), * 'grey90' : (229, 229, 229), */ __pyx_tuple__363 = PyTuple_Pack(3, __pyx_int_227, __pyx_int_227, __pyx_int_227); if (unlikely(!__pyx_tuple__363)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 356; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_tuple__363); __Pyx_GIVEREF(__pyx_tuple__363); /* "include/color_dict.pxi":357 * 'grey88' : (224, 224, 224), * 'grey89' : (227, 227, 227), * 'grey9' : (23, 23, 23), # <<<<<<<<<<<<<< * 'grey90' : (229, 229, 229), * 'grey91' : (232, 232, 232), */ __pyx_tuple__364 = PyTuple_Pack(3, __pyx_int_23, __pyx_int_23, __pyx_int_23); if (unlikely(!__pyx_tuple__364)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 357; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_tuple__364); __Pyx_GIVEREF(__pyx_tuple__364); /* "include/color_dict.pxi":358 * 'grey89' : (227, 227, 227), * 'grey9' : (23, 23, 23), * 'grey90' : (229, 229, 229), # <<<<<<<<<<<<<< * 'grey91' : (232, 232, 232), * 'grey92' : (235, 235, 235), */ __pyx_tuple__365 = PyTuple_Pack(3, __pyx_int_229, __pyx_int_229, __pyx_int_229); if (unlikely(!__pyx_tuple__365)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 358; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_tuple__365); __Pyx_GIVEREF(__pyx_tuple__365); /* "include/color_dict.pxi":359 * 'grey9' : (23, 23, 23), * 'grey90' : (229, 229, 229), * 'grey91' : (232, 232, 232), # <<<<<<<<<<<<<< * 'grey92' : (235, 235, 235), * 'grey93' : (237, 237, 237), */ __pyx_tuple__366 = PyTuple_Pack(3, __pyx_int_232, __pyx_int_232, __pyx_int_232); if (unlikely(!__pyx_tuple__366)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 359; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_tuple__366); __Pyx_GIVEREF(__pyx_tuple__366); /* "include/color_dict.pxi":360 * 'grey90' : (229, 229, 229), * 'grey91' : (232, 232, 232), * 'grey92' : (235, 235, 235), # <<<<<<<<<<<<<< * 'grey93' : (237, 237, 237), * 'grey94' : (240, 240, 240), */ __pyx_tuple__367 = PyTuple_Pack(3, __pyx_int_235, __pyx_int_235, __pyx_int_235); if (unlikely(!__pyx_tuple__367)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 360; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_tuple__367); __Pyx_GIVEREF(__pyx_tuple__367); /* "include/color_dict.pxi":361 * 'grey91' : (232, 232, 232), * 'grey92' : (235, 235, 235), * 'grey93' : (237, 237, 237), # <<<<<<<<<<<<<< * 'grey94' : (240, 240, 240), * 'grey95' : (242, 242, 242), */ __pyx_tuple__368 = PyTuple_Pack(3, __pyx_int_237, __pyx_int_237, __pyx_int_237); if (unlikely(!__pyx_tuple__368)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 361; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_tuple__368); __Pyx_GIVEREF(__pyx_tuple__368); /* "include/color_dict.pxi":362 * 'grey92' : (235, 235, 235), * 'grey93' : (237, 237, 237), * 'grey94' : (240, 240, 240), # <<<<<<<<<<<<<< * 'grey95' : (242, 242, 242), * 'grey96' : (245, 245, 245), */ __pyx_tuple__369 = PyTuple_Pack(3, __pyx_int_240, __pyx_int_240, __pyx_int_240); if (unlikely(!__pyx_tuple__369)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 362; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_tuple__369); __Pyx_GIVEREF(__pyx_tuple__369); /* "include/color_dict.pxi":363 * 'grey93' : (237, 237, 237), * 'grey94' : (240, 240, 240), * 'grey95' : (242, 242, 242), # <<<<<<<<<<<<<< * 'grey96' : (245, 245, 245), * 'grey97' : (247, 247, 247), */ __pyx_tuple__370 = PyTuple_Pack(3, __pyx_int_242, __pyx_int_242, __pyx_int_242); if (unlikely(!__pyx_tuple__370)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 363; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_tuple__370); __Pyx_GIVEREF(__pyx_tuple__370); /* "include/color_dict.pxi":364 * 'grey94' : (240, 240, 240), * 'grey95' : (242, 242, 242), * 'grey96' : (245, 245, 245), # <<<<<<<<<<<<<< * 'grey97' : (247, 247, 247), * 'grey98' : (250, 250, 250), */ __pyx_tuple__371 = PyTuple_Pack(3, __pyx_int_245, __pyx_int_245, __pyx_int_245); if (unlikely(!__pyx_tuple__371)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 364; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_tuple__371); __Pyx_GIVEREF(__pyx_tuple__371); /* "include/color_dict.pxi":365 * 'grey95' : (242, 242, 242), * 'grey96' : (245, 245, 245), * 'grey97' : (247, 247, 247), # <<<<<<<<<<<<<< * 'grey98' : (250, 250, 250), * 'grey99' : (252, 252, 252), */ __pyx_tuple__372 = PyTuple_Pack(3, __pyx_int_247, __pyx_int_247, __pyx_int_247); if (unlikely(!__pyx_tuple__372)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 365; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_tuple__372); __Pyx_GIVEREF(__pyx_tuple__372); /* "include/color_dict.pxi":366 * 'grey96' : (245, 245, 245), * 'grey97' : (247, 247, 247), * 'grey98' : (250, 250, 250), # <<<<<<<<<<<<<< * 'grey99' : (252, 252, 252), * 'honeydew' : (240, 255, 240), */ __pyx_tuple__373 = PyTuple_Pack(3, __pyx_int_250, __pyx_int_250, __pyx_int_250); if (unlikely(!__pyx_tuple__373)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 366; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_tuple__373); __Pyx_GIVEREF(__pyx_tuple__373); /* "include/color_dict.pxi":367 * 'grey97' : (247, 247, 247), * 'grey98' : (250, 250, 250), * 'grey99' : (252, 252, 252), # <<<<<<<<<<<<<< * 'honeydew' : (240, 255, 240), * 'honeydew1' : (240, 255, 240), */ __pyx_tuple__374 = PyTuple_Pack(3, __pyx_int_252, __pyx_int_252, __pyx_int_252); if (unlikely(!__pyx_tuple__374)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 367; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_tuple__374); __Pyx_GIVEREF(__pyx_tuple__374); /* "include/color_dict.pxi":368 * 'grey98' : (250, 250, 250), * 'grey99' : (252, 252, 252), * 'honeydew' : (240, 255, 240), # <<<<<<<<<<<<<< * 'honeydew1' : (240, 255, 240), * 'honeydew2' : (224, 238, 224), */ __pyx_tuple__375 = PyTuple_Pack(3, __pyx_int_240, __pyx_int_255, __pyx_int_240); if (unlikely(!__pyx_tuple__375)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 368; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_tuple__375); __Pyx_GIVEREF(__pyx_tuple__375); /* "include/color_dict.pxi":369 * 'grey99' : (252, 252, 252), * 'honeydew' : (240, 255, 240), * 'honeydew1' : (240, 255, 240), # <<<<<<<<<<<<<< * 'honeydew2' : (224, 238, 224), * 'honeydew3' : (193, 205, 193), */ __pyx_tuple__376 = PyTuple_Pack(3, __pyx_int_240, __pyx_int_255, __pyx_int_240); if (unlikely(!__pyx_tuple__376)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 369; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_tuple__376); __Pyx_GIVEREF(__pyx_tuple__376); /* "include/color_dict.pxi":370 * 'honeydew' : (240, 255, 240), * 'honeydew1' : (240, 255, 240), * 'honeydew2' : (224, 238, 224), # <<<<<<<<<<<<<< * 'honeydew3' : (193, 205, 193), * 'honeydew4' : (131, 139, 131), */ __pyx_tuple__377 = PyTuple_Pack(3, __pyx_int_224, __pyx_int_238, __pyx_int_224); if (unlikely(!__pyx_tuple__377)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 370; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_tuple__377); __Pyx_GIVEREF(__pyx_tuple__377); /* "include/color_dict.pxi":371 * 'honeydew1' : (240, 255, 240), * 'honeydew2' : (224, 238, 224), * 'honeydew3' : (193, 205, 193), # <<<<<<<<<<<<<< * 'honeydew4' : (131, 139, 131), * 'hotpink' : (255, 105, 180), */ __pyx_tuple__378 = PyTuple_Pack(3, __pyx_int_193, __pyx_int_205, __pyx_int_193); if (unlikely(!__pyx_tuple__378)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 371; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_tuple__378); __Pyx_GIVEREF(__pyx_tuple__378); /* "include/color_dict.pxi":372 * 'honeydew2' : (224, 238, 224), * 'honeydew3' : (193, 205, 193), * 'honeydew4' : (131, 139, 131), # <<<<<<<<<<<<<< * 'hotpink' : (255, 105, 180), * 'hotpink1' : (255, 110, 180), */ __pyx_tuple__379 = PyTuple_Pack(3, __pyx_int_131, __pyx_int_139, __pyx_int_131); if (unlikely(!__pyx_tuple__379)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 372; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_tuple__379); __Pyx_GIVEREF(__pyx_tuple__379); /* "include/color_dict.pxi":373 * 'honeydew3' : (193, 205, 193), * 'honeydew4' : (131, 139, 131), * 'hotpink' : (255, 105, 180), # <<<<<<<<<<<<<< * 'hotpink1' : (255, 110, 180), * 'hotpink2' : (238, 106, 167), */ __pyx_tuple__380 = PyTuple_Pack(3, __pyx_int_255, __pyx_int_105, __pyx_int_180); if (unlikely(!__pyx_tuple__380)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 373; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_tuple__380); __Pyx_GIVEREF(__pyx_tuple__380); /* "include/color_dict.pxi":374 * 'honeydew4' : (131, 139, 131), * 'hotpink' : (255, 105, 180), * 'hotpink1' : (255, 110, 180), # <<<<<<<<<<<<<< * 'hotpink2' : (238, 106, 167), * 'hotpink3' : (205, 96, 144), */ __pyx_tuple__381 = PyTuple_Pack(3, __pyx_int_255, __pyx_int_110, __pyx_int_180); if (unlikely(!__pyx_tuple__381)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 374; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_tuple__381); __Pyx_GIVEREF(__pyx_tuple__381); /* "include/color_dict.pxi":375 * 'hotpink' : (255, 105, 180), * 'hotpink1' : (255, 110, 180), * 'hotpink2' : (238, 106, 167), # <<<<<<<<<<<<<< * 'hotpink3' : (205, 96, 144), * 'hotpink4' : (139, 58, 98), */ __pyx_tuple__382 = PyTuple_Pack(3, __pyx_int_238, __pyx_int_106, __pyx_int_167); if (unlikely(!__pyx_tuple__382)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 375; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_tuple__382); __Pyx_GIVEREF(__pyx_tuple__382); /* "include/color_dict.pxi":376 * 'hotpink1' : (255, 110, 180), * 'hotpink2' : (238, 106, 167), * 'hotpink3' : (205, 96, 144), # <<<<<<<<<<<<<< * 'hotpink4' : (139, 58, 98), * 'indianred' : (205, 92, 92), */ __pyx_tuple__383 = PyTuple_Pack(3, __pyx_int_205, __pyx_int_96, __pyx_int_144); if (unlikely(!__pyx_tuple__383)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 376; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_tuple__383); __Pyx_GIVEREF(__pyx_tuple__383); /* "include/color_dict.pxi":377 * 'hotpink2' : (238, 106, 167), * 'hotpink3' : (205, 96, 144), * 'hotpink4' : (139, 58, 98), # <<<<<<<<<<<<<< * 'indianred' : (205, 92, 92), * 'indianred1' : (255, 106, 106), */ __pyx_tuple__384 = PyTuple_Pack(3, __pyx_int_139, __pyx_int_58, __pyx_int_98); if (unlikely(!__pyx_tuple__384)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 377; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_tuple__384); __Pyx_GIVEREF(__pyx_tuple__384); /* "include/color_dict.pxi":378 * 'hotpink3' : (205, 96, 144), * 'hotpink4' : (139, 58, 98), * 'indianred' : (205, 92, 92), # <<<<<<<<<<<<<< * 'indianred1' : (255, 106, 106), * 'indianred2' : (238, 99, 99), */ __pyx_tuple__385 = PyTuple_Pack(3, __pyx_int_205, __pyx_int_92, __pyx_int_92); if (unlikely(!__pyx_tuple__385)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 378; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_tuple__385); __Pyx_GIVEREF(__pyx_tuple__385); /* "include/color_dict.pxi":379 * 'hotpink4' : (139, 58, 98), * 'indianred' : (205, 92, 92), * 'indianred1' : (255, 106, 106), # <<<<<<<<<<<<<< * 'indianred2' : (238, 99, 99), * 'indianred3' : (205, 85, 85), */ __pyx_tuple__386 = PyTuple_Pack(3, __pyx_int_255, __pyx_int_106, __pyx_int_106); if (unlikely(!__pyx_tuple__386)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 379; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_tuple__386); __Pyx_GIVEREF(__pyx_tuple__386); /* "include/color_dict.pxi":380 * 'indianred' : (205, 92, 92), * 'indianred1' : (255, 106, 106), * 'indianred2' : (238, 99, 99), # <<<<<<<<<<<<<< * 'indianred3' : (205, 85, 85), * 'indianred4' : (139, 58, 58), */ __pyx_tuple__387 = PyTuple_Pack(3, __pyx_int_238, __pyx_int_99, __pyx_int_99); if (unlikely(!__pyx_tuple__387)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 380; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_tuple__387); __Pyx_GIVEREF(__pyx_tuple__387); /* "include/color_dict.pxi":381 * 'indianred1' : (255, 106, 106), * 'indianred2' : (238, 99, 99), * 'indianred3' : (205, 85, 85), # <<<<<<<<<<<<<< * 'indianred4' : (139, 58, 58), * 'indigo' : (75, 0, 130), */ __pyx_tuple__388 = PyTuple_Pack(3, __pyx_int_205, __pyx_int_85, __pyx_int_85); if (unlikely(!__pyx_tuple__388)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 381; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_tuple__388); __Pyx_GIVEREF(__pyx_tuple__388); /* "include/color_dict.pxi":382 * 'indianred2' : (238, 99, 99), * 'indianred3' : (205, 85, 85), * 'indianred4' : (139, 58, 58), # <<<<<<<<<<<<<< * 'indigo' : (75, 0, 130), * 'ivory' : (255, 255, 240), */ __pyx_tuple__389 = PyTuple_Pack(3, __pyx_int_139, __pyx_int_58, __pyx_int_58); if (unlikely(!__pyx_tuple__389)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 382; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_tuple__389); __Pyx_GIVEREF(__pyx_tuple__389); /* "include/color_dict.pxi":383 * 'indianred3' : (205, 85, 85), * 'indianred4' : (139, 58, 58), * 'indigo' : (75, 0, 130), # <<<<<<<<<<<<<< * 'ivory' : (255, 255, 240), * 'ivory1' : (255, 255, 240), */ __pyx_tuple__390 = PyTuple_Pack(3, __pyx_int_75, __pyx_int_0, __pyx_int_130); if (unlikely(!__pyx_tuple__390)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 383; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_tuple__390); __Pyx_GIVEREF(__pyx_tuple__390); /* "include/color_dict.pxi":384 * 'indianred4' : (139, 58, 58), * 'indigo' : (75, 0, 130), * 'ivory' : (255, 255, 240), # <<<<<<<<<<<<<< * 'ivory1' : (255, 255, 240), * 'ivory2' : (238, 238, 224), */ __pyx_tuple__391 = PyTuple_Pack(3, __pyx_int_255, __pyx_int_255, __pyx_int_240); if (unlikely(!__pyx_tuple__391)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 384; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_tuple__391); __Pyx_GIVEREF(__pyx_tuple__391); /* "include/color_dict.pxi":385 * 'indigo' : (75, 0, 130), * 'ivory' : (255, 255, 240), * 'ivory1' : (255, 255, 240), # <<<<<<<<<<<<<< * 'ivory2' : (238, 238, 224), * 'ivory3' : (205, 205, 193), */ __pyx_tuple__392 = PyTuple_Pack(3, __pyx_int_255, __pyx_int_255, __pyx_int_240); if (unlikely(!__pyx_tuple__392)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 385; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_tuple__392); __Pyx_GIVEREF(__pyx_tuple__392); /* "include/color_dict.pxi":386 * 'ivory' : (255, 255, 240), * 'ivory1' : (255, 255, 240), * 'ivory2' : (238, 238, 224), # <<<<<<<<<<<<<< * 'ivory3' : (205, 205, 193), * 'ivory4' : (139, 139, 131), */ __pyx_tuple__393 = PyTuple_Pack(3, __pyx_int_238, __pyx_int_238, __pyx_int_224); if (unlikely(!__pyx_tuple__393)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 386; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_tuple__393); __Pyx_GIVEREF(__pyx_tuple__393); /* "include/color_dict.pxi":387 * 'ivory1' : (255, 255, 240), * 'ivory2' : (238, 238, 224), * 'ivory3' : (205, 205, 193), # <<<<<<<<<<<<<< * 'ivory4' : (139, 139, 131), * 'khaki' : (240, 230, 140), */ __pyx_tuple__394 = PyTuple_Pack(3, __pyx_int_205, __pyx_int_205, __pyx_int_193); if (unlikely(!__pyx_tuple__394)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 387; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_tuple__394); __Pyx_GIVEREF(__pyx_tuple__394); /* "include/color_dict.pxi":388 * 'ivory2' : (238, 238, 224), * 'ivory3' : (205, 205, 193), * 'ivory4' : (139, 139, 131), # <<<<<<<<<<<<<< * 'khaki' : (240, 230, 140), * 'khaki1' : (255, 246, 143), */ __pyx_tuple__395 = PyTuple_Pack(3, __pyx_int_139, __pyx_int_139, __pyx_int_131); if (unlikely(!__pyx_tuple__395)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 388; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_tuple__395); __Pyx_GIVEREF(__pyx_tuple__395); /* "include/color_dict.pxi":389 * 'ivory3' : (205, 205, 193), * 'ivory4' : (139, 139, 131), * 'khaki' : (240, 230, 140), # <<<<<<<<<<<<<< * 'khaki1' : (255, 246, 143), * 'khaki2' : (238, 230, 133), */ __pyx_tuple__396 = PyTuple_Pack(3, __pyx_int_240, __pyx_int_230, __pyx_int_140); if (unlikely(!__pyx_tuple__396)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 389; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_tuple__396); __Pyx_GIVEREF(__pyx_tuple__396); /* "include/color_dict.pxi":390 * 'ivory4' : (139, 139, 131), * 'khaki' : (240, 230, 140), * 'khaki1' : (255, 246, 143), # <<<<<<<<<<<<<< * 'khaki2' : (238, 230, 133), * 'khaki3' : (205, 198, 115), */ __pyx_tuple__397 = PyTuple_Pack(3, __pyx_int_255, __pyx_int_246, __pyx_int_143); if (unlikely(!__pyx_tuple__397)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 390; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_tuple__397); __Pyx_GIVEREF(__pyx_tuple__397); /* "include/color_dict.pxi":391 * 'khaki' : (240, 230, 140), * 'khaki1' : (255, 246, 143), * 'khaki2' : (238, 230, 133), # <<<<<<<<<<<<<< * 'khaki3' : (205, 198, 115), * 'khaki4' : (139, 134, 78), */ __pyx_tuple__398 = PyTuple_Pack(3, __pyx_int_238, __pyx_int_230, __pyx_int_133); if (unlikely(!__pyx_tuple__398)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 391; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_tuple__398); __Pyx_GIVEREF(__pyx_tuple__398); /* "include/color_dict.pxi":392 * 'khaki1' : (255, 246, 143), * 'khaki2' : (238, 230, 133), * 'khaki3' : (205, 198, 115), # <<<<<<<<<<<<<< * 'khaki4' : (139, 134, 78), * 'lavender' : (230, 230, 250), */ __pyx_tuple__399 = PyTuple_Pack(3, __pyx_int_205, __pyx_int_198, __pyx_int_115); if (unlikely(!__pyx_tuple__399)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 392; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_tuple__399); __Pyx_GIVEREF(__pyx_tuple__399); /* "include/color_dict.pxi":393 * 'khaki2' : (238, 230, 133), * 'khaki3' : (205, 198, 115), * 'khaki4' : (139, 134, 78), # <<<<<<<<<<<<<< * 'lavender' : (230, 230, 250), * 'lavenderblush' : (255, 240, 245), */ __pyx_tuple__400 = PyTuple_Pack(3, __pyx_int_139, __pyx_int_134, __pyx_int_78); if (unlikely(!__pyx_tuple__400)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 393; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_tuple__400); __Pyx_GIVEREF(__pyx_tuple__400); /* "include/color_dict.pxi":394 * 'khaki3' : (205, 198, 115), * 'khaki4' : (139, 134, 78), * 'lavender' : (230, 230, 250), # <<<<<<<<<<<<<< * 'lavenderblush' : (255, 240, 245), * 'lavenderblush1' : (255, 240, 245), */ __pyx_tuple__401 = PyTuple_Pack(3, __pyx_int_230, __pyx_int_230, __pyx_int_250); if (unlikely(!__pyx_tuple__401)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 394; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_tuple__401); __Pyx_GIVEREF(__pyx_tuple__401); /* "include/color_dict.pxi":395 * 'khaki4' : (139, 134, 78), * 'lavender' : (230, 230, 250), * 'lavenderblush' : (255, 240, 245), # <<<<<<<<<<<<<< * 'lavenderblush1' : (255, 240, 245), * 'lavenderblush2' : (238, 224, 229), */ __pyx_tuple__402 = PyTuple_Pack(3, __pyx_int_255, __pyx_int_240, __pyx_int_245); if (unlikely(!__pyx_tuple__402)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 395; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_tuple__402); __Pyx_GIVEREF(__pyx_tuple__402); /* "include/color_dict.pxi":396 * 'lavender' : (230, 230, 250), * 'lavenderblush' : (255, 240, 245), * 'lavenderblush1' : (255, 240, 245), # <<<<<<<<<<<<<< * 'lavenderblush2' : (238, 224, 229), * 'lavenderblush3' : (205, 193, 197), */ __pyx_tuple__403 = PyTuple_Pack(3, __pyx_int_255, __pyx_int_240, __pyx_int_245); if (unlikely(!__pyx_tuple__403)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 396; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_tuple__403); __Pyx_GIVEREF(__pyx_tuple__403); /* "include/color_dict.pxi":397 * 'lavenderblush' : (255, 240, 245), * 'lavenderblush1' : (255, 240, 245), * 'lavenderblush2' : (238, 224, 229), # <<<<<<<<<<<<<< * 'lavenderblush3' : (205, 193, 197), * 'lavenderblush4' : (139, 131, 134), */ __pyx_tuple__404 = PyTuple_Pack(3, __pyx_int_238, __pyx_int_224, __pyx_int_229); if (unlikely(!__pyx_tuple__404)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 397; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_tuple__404); __Pyx_GIVEREF(__pyx_tuple__404); /* "include/color_dict.pxi":398 * 'lavenderblush1' : (255, 240, 245), * 'lavenderblush2' : (238, 224, 229), * 'lavenderblush3' : (205, 193, 197), # <<<<<<<<<<<<<< * 'lavenderblush4' : (139, 131, 134), * 'lawngreen' : (124, 252, 0), */ __pyx_tuple__405 = PyTuple_Pack(3, __pyx_int_205, __pyx_int_193, __pyx_int_197); if (unlikely(!__pyx_tuple__405)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 398; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_tuple__405); __Pyx_GIVEREF(__pyx_tuple__405); /* "include/color_dict.pxi":399 * 'lavenderblush2' : (238, 224, 229), * 'lavenderblush3' : (205, 193, 197), * 'lavenderblush4' : (139, 131, 134), # <<<<<<<<<<<<<< * 'lawngreen' : (124, 252, 0), * 'lemonchiffon' : (255, 250, 205), */ __pyx_tuple__406 = PyTuple_Pack(3, __pyx_int_139, __pyx_int_131, __pyx_int_134); if (unlikely(!__pyx_tuple__406)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 399; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_tuple__406); __Pyx_GIVEREF(__pyx_tuple__406); /* "include/color_dict.pxi":400 * 'lavenderblush3' : (205, 193, 197), * 'lavenderblush4' : (139, 131, 134), * 'lawngreen' : (124, 252, 0), # <<<<<<<<<<<<<< * 'lemonchiffon' : (255, 250, 205), * 'lemonchiffon1' : (255, 250, 205), */ __pyx_tuple__407 = PyTuple_Pack(3, __pyx_int_124, __pyx_int_252, __pyx_int_0); if (unlikely(!__pyx_tuple__407)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 400; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_tuple__407); __Pyx_GIVEREF(__pyx_tuple__407); /* "include/color_dict.pxi":401 * 'lavenderblush4' : (139, 131, 134), * 'lawngreen' : (124, 252, 0), * 'lemonchiffon' : (255, 250, 205), # <<<<<<<<<<<<<< * 'lemonchiffon1' : (255, 250, 205), * 'lemonchiffon2' : (238, 233, 191), */ __pyx_tuple__408 = PyTuple_Pack(3, __pyx_int_255, __pyx_int_250, __pyx_int_205); if (unlikely(!__pyx_tuple__408)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 401; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_tuple__408); __Pyx_GIVEREF(__pyx_tuple__408); /* "include/color_dict.pxi":402 * 'lawngreen' : (124, 252, 0), * 'lemonchiffon' : (255, 250, 205), * 'lemonchiffon1' : (255, 250, 205), # <<<<<<<<<<<<<< * 'lemonchiffon2' : (238, 233, 191), * 'lemonchiffon3' : (205, 201, 165), */ __pyx_tuple__409 = PyTuple_Pack(3, __pyx_int_255, __pyx_int_250, __pyx_int_205); if (unlikely(!__pyx_tuple__409)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 402; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_tuple__409); __Pyx_GIVEREF(__pyx_tuple__409); /* "include/color_dict.pxi":403 * 'lemonchiffon' : (255, 250, 205), * 'lemonchiffon1' : (255, 250, 205), * 'lemonchiffon2' : (238, 233, 191), # <<<<<<<<<<<<<< * 'lemonchiffon3' : (205, 201, 165), * 'lemonchiffon4' : (139, 137, 112), */ __pyx_tuple__410 = PyTuple_Pack(3, __pyx_int_238, __pyx_int_233, __pyx_int_191); if (unlikely(!__pyx_tuple__410)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 403; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_tuple__410); __Pyx_GIVEREF(__pyx_tuple__410); /* "include/color_dict.pxi":404 * 'lemonchiffon1' : (255, 250, 205), * 'lemonchiffon2' : (238, 233, 191), * 'lemonchiffon3' : (205, 201, 165), # <<<<<<<<<<<<<< * 'lemonchiffon4' : (139, 137, 112), * 'lightblue' : (173, 216, 230), */ __pyx_tuple__411 = PyTuple_Pack(3, __pyx_int_205, __pyx_int_201, __pyx_int_165); if (unlikely(!__pyx_tuple__411)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 404; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_tuple__411); __Pyx_GIVEREF(__pyx_tuple__411); /* "include/color_dict.pxi":405 * 'lemonchiffon2' : (238, 233, 191), * 'lemonchiffon3' : (205, 201, 165), * 'lemonchiffon4' : (139, 137, 112), # <<<<<<<<<<<<<< * 'lightblue' : (173, 216, 230), * 'lightblue1' : (191, 239, 255), */ __pyx_tuple__412 = PyTuple_Pack(3, __pyx_int_139, __pyx_int_137, __pyx_int_112); if (unlikely(!__pyx_tuple__412)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 405; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_tuple__412); __Pyx_GIVEREF(__pyx_tuple__412); /* "include/color_dict.pxi":406 * 'lemonchiffon3' : (205, 201, 165), * 'lemonchiffon4' : (139, 137, 112), * 'lightblue' : (173, 216, 230), # <<<<<<<<<<<<<< * 'lightblue1' : (191, 239, 255), * 'lightblue2' : (178, 223, 238), */ __pyx_tuple__413 = PyTuple_Pack(3, __pyx_int_173, __pyx_int_216, __pyx_int_230); if (unlikely(!__pyx_tuple__413)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 406; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_tuple__413); __Pyx_GIVEREF(__pyx_tuple__413); /* "include/color_dict.pxi":407 * 'lemonchiffon4' : (139, 137, 112), * 'lightblue' : (173, 216, 230), * 'lightblue1' : (191, 239, 255), # <<<<<<<<<<<<<< * 'lightblue2' : (178, 223, 238), * 'lightblue3' : (154, 192, 205), */ __pyx_tuple__414 = PyTuple_Pack(3, __pyx_int_191, __pyx_int_239, __pyx_int_255); if (unlikely(!__pyx_tuple__414)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 407; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_tuple__414); __Pyx_GIVEREF(__pyx_tuple__414); /* "include/color_dict.pxi":408 * 'lightblue' : (173, 216, 230), * 'lightblue1' : (191, 239, 255), * 'lightblue2' : (178, 223, 238), # <<<<<<<<<<<<<< * 'lightblue3' : (154, 192, 205), * 'lightblue4' : (104, 131, 139), */ __pyx_tuple__415 = PyTuple_Pack(3, __pyx_int_178, __pyx_int_223, __pyx_int_238); if (unlikely(!__pyx_tuple__415)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 408; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_tuple__415); __Pyx_GIVEREF(__pyx_tuple__415); /* "include/color_dict.pxi":409 * 'lightblue1' : (191, 239, 255), * 'lightblue2' : (178, 223, 238), * 'lightblue3' : (154, 192, 205), # <<<<<<<<<<<<<< * 'lightblue4' : (104, 131, 139), * 'lightcoral' : (240, 128, 128), */ __pyx_tuple__416 = PyTuple_Pack(3, __pyx_int_154, __pyx_int_192, __pyx_int_205); if (unlikely(!__pyx_tuple__416)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 409; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_tuple__416); __Pyx_GIVEREF(__pyx_tuple__416); /* "include/color_dict.pxi":410 * 'lightblue2' : (178, 223, 238), * 'lightblue3' : (154, 192, 205), * 'lightblue4' : (104, 131, 139), # <<<<<<<<<<<<<< * 'lightcoral' : (240, 128, 128), * 'lightcyan' : (224, 255, 255), */ __pyx_tuple__417 = PyTuple_Pack(3, __pyx_int_104, __pyx_int_131, __pyx_int_139); if (unlikely(!__pyx_tuple__417)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 410; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_tuple__417); __Pyx_GIVEREF(__pyx_tuple__417); /* "include/color_dict.pxi":411 * 'lightblue3' : (154, 192, 205), * 'lightblue4' : (104, 131, 139), * 'lightcoral' : (240, 128, 128), # <<<<<<<<<<<<<< * 'lightcyan' : (224, 255, 255), * 'lightcyan1' : (224, 255, 255), */ __pyx_tuple__418 = PyTuple_Pack(3, __pyx_int_240, __pyx_int_128, __pyx_int_128); if (unlikely(!__pyx_tuple__418)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 411; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_tuple__418); __Pyx_GIVEREF(__pyx_tuple__418); /* "include/color_dict.pxi":412 * 'lightblue4' : (104, 131, 139), * 'lightcoral' : (240, 128, 128), * 'lightcyan' : (224, 255, 255), # <<<<<<<<<<<<<< * 'lightcyan1' : (224, 255, 255), * 'lightcyan2' : (209, 238, 238), */ __pyx_tuple__419 = PyTuple_Pack(3, __pyx_int_224, __pyx_int_255, __pyx_int_255); if (unlikely(!__pyx_tuple__419)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 412; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_tuple__419); __Pyx_GIVEREF(__pyx_tuple__419); /* "include/color_dict.pxi":413 * 'lightcoral' : (240, 128, 128), * 'lightcyan' : (224, 255, 255), * 'lightcyan1' : (224, 255, 255), # <<<<<<<<<<<<<< * 'lightcyan2' : (209, 238, 238), * 'lightcyan3' : (180, 205, 205), */ __pyx_tuple__420 = PyTuple_Pack(3, __pyx_int_224, __pyx_int_255, __pyx_int_255); if (unlikely(!__pyx_tuple__420)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 413; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_tuple__420); __Pyx_GIVEREF(__pyx_tuple__420); /* "include/color_dict.pxi":414 * 'lightcyan' : (224, 255, 255), * 'lightcyan1' : (224, 255, 255), * 'lightcyan2' : (209, 238, 238), # <<<<<<<<<<<<<< * 'lightcyan3' : (180, 205, 205), * 'lightcyan4' : (122, 139, 139), */ __pyx_tuple__421 = PyTuple_Pack(3, __pyx_int_209, __pyx_int_238, __pyx_int_238); if (unlikely(!__pyx_tuple__421)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 414; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_tuple__421); __Pyx_GIVEREF(__pyx_tuple__421); /* "include/color_dict.pxi":415 * 'lightcyan1' : (224, 255, 255), * 'lightcyan2' : (209, 238, 238), * 'lightcyan3' : (180, 205, 205), # <<<<<<<<<<<<<< * 'lightcyan4' : (122, 139, 139), * 'lightgoldenrod' : (238, 221, 130), */ __pyx_tuple__422 = PyTuple_Pack(3, __pyx_int_180, __pyx_int_205, __pyx_int_205); if (unlikely(!__pyx_tuple__422)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 415; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_tuple__422); __Pyx_GIVEREF(__pyx_tuple__422); /* "include/color_dict.pxi":416 * 'lightcyan2' : (209, 238, 238), * 'lightcyan3' : (180, 205, 205), * 'lightcyan4' : (122, 139, 139), # <<<<<<<<<<<<<< * 'lightgoldenrod' : (238, 221, 130), * 'lightgoldenrod1' : (255, 236, 139), */ __pyx_tuple__423 = PyTuple_Pack(3, __pyx_int_122, __pyx_int_139, __pyx_int_139); if (unlikely(!__pyx_tuple__423)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 416; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_tuple__423); __Pyx_GIVEREF(__pyx_tuple__423); /* "include/color_dict.pxi":417 * 'lightcyan3' : (180, 205, 205), * 'lightcyan4' : (122, 139, 139), * 'lightgoldenrod' : (238, 221, 130), # <<<<<<<<<<<<<< * 'lightgoldenrod1' : (255, 236, 139), * 'lightgoldenrod2' : (238, 220, 130), */ __pyx_tuple__424 = PyTuple_Pack(3, __pyx_int_238, __pyx_int_221, __pyx_int_130); if (unlikely(!__pyx_tuple__424)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 417; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_tuple__424); __Pyx_GIVEREF(__pyx_tuple__424); /* "include/color_dict.pxi":418 * 'lightcyan4' : (122, 139, 139), * 'lightgoldenrod' : (238, 221, 130), * 'lightgoldenrod1' : (255, 236, 139), # <<<<<<<<<<<<<< * 'lightgoldenrod2' : (238, 220, 130), * 'lightgoldenrod3' : (205, 190, 112), */ __pyx_tuple__425 = PyTuple_Pack(3, __pyx_int_255, __pyx_int_236, __pyx_int_139); if (unlikely(!__pyx_tuple__425)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 418; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_tuple__425); __Pyx_GIVEREF(__pyx_tuple__425); /* "include/color_dict.pxi":419 * 'lightgoldenrod' : (238, 221, 130), * 'lightgoldenrod1' : (255, 236, 139), * 'lightgoldenrod2' : (238, 220, 130), # <<<<<<<<<<<<<< * 'lightgoldenrod3' : (205, 190, 112), * 'lightgoldenrod4' : (139, 129, 76), */ __pyx_tuple__426 = PyTuple_Pack(3, __pyx_int_238, __pyx_int_220, __pyx_int_130); if (unlikely(!__pyx_tuple__426)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 419; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_tuple__426); __Pyx_GIVEREF(__pyx_tuple__426); /* "include/color_dict.pxi":420 * 'lightgoldenrod1' : (255, 236, 139), * 'lightgoldenrod2' : (238, 220, 130), * 'lightgoldenrod3' : (205, 190, 112), # <<<<<<<<<<<<<< * 'lightgoldenrod4' : (139, 129, 76), * 'lightgoldenrodyellow' : (250, 250, 210), */ __pyx_tuple__427 = PyTuple_Pack(3, __pyx_int_205, __pyx_int_190, __pyx_int_112); if (unlikely(!__pyx_tuple__427)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 420; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_tuple__427); __Pyx_GIVEREF(__pyx_tuple__427); /* "include/color_dict.pxi":421 * 'lightgoldenrod2' : (238, 220, 130), * 'lightgoldenrod3' : (205, 190, 112), * 'lightgoldenrod4' : (139, 129, 76), # <<<<<<<<<<<<<< * 'lightgoldenrodyellow' : (250, 250, 210), * 'lightgray' : (211, 211, 211), */ __pyx_tuple__428 = PyTuple_Pack(3, __pyx_int_139, __pyx_int_129, __pyx_int_76); if (unlikely(!__pyx_tuple__428)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 421; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_tuple__428); __Pyx_GIVEREF(__pyx_tuple__428); /* "include/color_dict.pxi":422 * 'lightgoldenrod3' : (205, 190, 112), * 'lightgoldenrod4' : (139, 129, 76), * 'lightgoldenrodyellow' : (250, 250, 210), # <<<<<<<<<<<<<< * 'lightgray' : (211, 211, 211), * 'lightgreen' : (144, 238, 144), */ __pyx_tuple__429 = PyTuple_Pack(3, __pyx_int_250, __pyx_int_250, __pyx_int_210); if (unlikely(!__pyx_tuple__429)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 422; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_tuple__429); __Pyx_GIVEREF(__pyx_tuple__429); /* "include/color_dict.pxi":423 * 'lightgoldenrod4' : (139, 129, 76), * 'lightgoldenrodyellow' : (250, 250, 210), * 'lightgray' : (211, 211, 211), # <<<<<<<<<<<<<< * 'lightgreen' : (144, 238, 144), * 'lightgrey' : (211, 211, 211), */ __pyx_tuple__430 = PyTuple_Pack(3, __pyx_int_211, __pyx_int_211, __pyx_int_211); if (unlikely(!__pyx_tuple__430)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 423; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_tuple__430); __Pyx_GIVEREF(__pyx_tuple__430); /* "include/color_dict.pxi":424 * 'lightgoldenrodyellow' : (250, 250, 210), * 'lightgray' : (211, 211, 211), * 'lightgreen' : (144, 238, 144), # <<<<<<<<<<<<<< * 'lightgrey' : (211, 211, 211), * 'lightpink' : (255, 182, 193), */ __pyx_tuple__431 = PyTuple_Pack(3, __pyx_int_144, __pyx_int_238, __pyx_int_144); if (unlikely(!__pyx_tuple__431)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 424; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_tuple__431); __Pyx_GIVEREF(__pyx_tuple__431); /* "include/color_dict.pxi":425 * 'lightgray' : (211, 211, 211), * 'lightgreen' : (144, 238, 144), * 'lightgrey' : (211, 211, 211), # <<<<<<<<<<<<<< * 'lightpink' : (255, 182, 193), * 'lightpink1' : (255, 174, 185), */ __pyx_tuple__432 = PyTuple_Pack(3, __pyx_int_211, __pyx_int_211, __pyx_int_211); if (unlikely(!__pyx_tuple__432)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 425; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_tuple__432); __Pyx_GIVEREF(__pyx_tuple__432); /* "include/color_dict.pxi":426 * 'lightgreen' : (144, 238, 144), * 'lightgrey' : (211, 211, 211), * 'lightpink' : (255, 182, 193), # <<<<<<<<<<<<<< * 'lightpink1' : (255, 174, 185), * 'lightpink2' : (238, 162, 173), */ __pyx_tuple__433 = PyTuple_Pack(3, __pyx_int_255, __pyx_int_182, __pyx_int_193); if (unlikely(!__pyx_tuple__433)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 426; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_tuple__433); __Pyx_GIVEREF(__pyx_tuple__433); /* "include/color_dict.pxi":427 * 'lightgrey' : (211, 211, 211), * 'lightpink' : (255, 182, 193), * 'lightpink1' : (255, 174, 185), # <<<<<<<<<<<<<< * 'lightpink2' : (238, 162, 173), * 'lightpink3' : (205, 140, 149), */ __pyx_tuple__434 = PyTuple_Pack(3, __pyx_int_255, __pyx_int_174, __pyx_int_185); if (unlikely(!__pyx_tuple__434)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 427; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_tuple__434); __Pyx_GIVEREF(__pyx_tuple__434); /* "include/color_dict.pxi":428 * 'lightpink' : (255, 182, 193), * 'lightpink1' : (255, 174, 185), * 'lightpink2' : (238, 162, 173), # <<<<<<<<<<<<<< * 'lightpink3' : (205, 140, 149), * 'lightpink4' : (139, 95, 101), */ __pyx_tuple__435 = PyTuple_Pack(3, __pyx_int_238, __pyx_int_162, __pyx_int_173); if (unlikely(!__pyx_tuple__435)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 428; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_tuple__435); __Pyx_GIVEREF(__pyx_tuple__435); /* "include/color_dict.pxi":429 * 'lightpink1' : (255, 174, 185), * 'lightpink2' : (238, 162, 173), * 'lightpink3' : (205, 140, 149), # <<<<<<<<<<<<<< * 'lightpink4' : (139, 95, 101), * 'lightsalmon' : (255, 160, 122), */ __pyx_tuple__436 = PyTuple_Pack(3, __pyx_int_205, __pyx_int_140, __pyx_int_149); if (unlikely(!__pyx_tuple__436)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 429; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_tuple__436); __Pyx_GIVEREF(__pyx_tuple__436); /* "include/color_dict.pxi":430 * 'lightpink2' : (238, 162, 173), * 'lightpink3' : (205, 140, 149), * 'lightpink4' : (139, 95, 101), # <<<<<<<<<<<<<< * 'lightsalmon' : (255, 160, 122), * 'lightsalmon1' : (255, 160, 122), */ __pyx_tuple__437 = PyTuple_Pack(3, __pyx_int_139, __pyx_int_95, __pyx_int_101); if (unlikely(!__pyx_tuple__437)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 430; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_tuple__437); __Pyx_GIVEREF(__pyx_tuple__437); /* "include/color_dict.pxi":431 * 'lightpink3' : (205, 140, 149), * 'lightpink4' : (139, 95, 101), * 'lightsalmon' : (255, 160, 122), # <<<<<<<<<<<<<< * 'lightsalmon1' : (255, 160, 122), * 'lightsalmon2' : (238, 149, 114), */ __pyx_tuple__438 = PyTuple_Pack(3, __pyx_int_255, __pyx_int_160, __pyx_int_122); if (unlikely(!__pyx_tuple__438)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 431; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_tuple__438); __Pyx_GIVEREF(__pyx_tuple__438); /* "include/color_dict.pxi":432 * 'lightpink4' : (139, 95, 101), * 'lightsalmon' : (255, 160, 122), * 'lightsalmon1' : (255, 160, 122), # <<<<<<<<<<<<<< * 'lightsalmon2' : (238, 149, 114), * 'lightsalmon3' : (205, 129, 98), */ __pyx_tuple__439 = PyTuple_Pack(3, __pyx_int_255, __pyx_int_160, __pyx_int_122); if (unlikely(!__pyx_tuple__439)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 432; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_tuple__439); __Pyx_GIVEREF(__pyx_tuple__439); /* "include/color_dict.pxi":433 * 'lightsalmon' : (255, 160, 122), * 'lightsalmon1' : (255, 160, 122), * 'lightsalmon2' : (238, 149, 114), # <<<<<<<<<<<<<< * 'lightsalmon3' : (205, 129, 98), * 'lightsalmon4' : (139, 87, 66), */ __pyx_tuple__440 = PyTuple_Pack(3, __pyx_int_238, __pyx_int_149, __pyx_int_114); if (unlikely(!__pyx_tuple__440)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 433; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_tuple__440); __Pyx_GIVEREF(__pyx_tuple__440); /* "include/color_dict.pxi":434 * 'lightsalmon1' : (255, 160, 122), * 'lightsalmon2' : (238, 149, 114), * 'lightsalmon3' : (205, 129, 98), # <<<<<<<<<<<<<< * 'lightsalmon4' : (139, 87, 66), * 'lightseagreen' : (32, 178, 170), */ __pyx_tuple__441 = PyTuple_Pack(3, __pyx_int_205, __pyx_int_129, __pyx_int_98); if (unlikely(!__pyx_tuple__441)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 434; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_tuple__441); __Pyx_GIVEREF(__pyx_tuple__441); /* "include/color_dict.pxi":435 * 'lightsalmon2' : (238, 149, 114), * 'lightsalmon3' : (205, 129, 98), * 'lightsalmon4' : (139, 87, 66), # <<<<<<<<<<<<<< * 'lightseagreen' : (32, 178, 170), * 'lightskyblue' : (135, 206, 250), */ __pyx_tuple__442 = PyTuple_Pack(3, __pyx_int_139, __pyx_int_87, __pyx_int_66); if (unlikely(!__pyx_tuple__442)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 435; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_tuple__442); __Pyx_GIVEREF(__pyx_tuple__442); /* "include/color_dict.pxi":436 * 'lightsalmon3' : (205, 129, 98), * 'lightsalmon4' : (139, 87, 66), * 'lightseagreen' : (32, 178, 170), # <<<<<<<<<<<<<< * 'lightskyblue' : (135, 206, 250), * 'lightskyblue1' : (176, 226, 255), */ __pyx_tuple__443 = PyTuple_Pack(3, __pyx_int_32, __pyx_int_178, __pyx_int_170); if (unlikely(!__pyx_tuple__443)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 436; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_tuple__443); __Pyx_GIVEREF(__pyx_tuple__443); /* "include/color_dict.pxi":437 * 'lightsalmon4' : (139, 87, 66), * 'lightseagreen' : (32, 178, 170), * 'lightskyblue' : (135, 206, 250), # <<<<<<<<<<<<<< * 'lightskyblue1' : (176, 226, 255), * 'lightskyblue2' : (164, 211, 238), */ __pyx_tuple__444 = PyTuple_Pack(3, __pyx_int_135, __pyx_int_206, __pyx_int_250); if (unlikely(!__pyx_tuple__444)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 437; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_tuple__444); __Pyx_GIVEREF(__pyx_tuple__444); /* "include/color_dict.pxi":438 * 'lightseagreen' : (32, 178, 170), * 'lightskyblue' : (135, 206, 250), * 'lightskyblue1' : (176, 226, 255), # <<<<<<<<<<<<<< * 'lightskyblue2' : (164, 211, 238), * 'lightskyblue3' : (141, 182, 205), */ __pyx_tuple__445 = PyTuple_Pack(3, __pyx_int_176, __pyx_int_226, __pyx_int_255); if (unlikely(!__pyx_tuple__445)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 438; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_tuple__445); __Pyx_GIVEREF(__pyx_tuple__445); /* "include/color_dict.pxi":439 * 'lightskyblue' : (135, 206, 250), * 'lightskyblue1' : (176, 226, 255), * 'lightskyblue2' : (164, 211, 238), # <<<<<<<<<<<<<< * 'lightskyblue3' : (141, 182, 205), * 'lightskyblue4' : (96, 123, 139), */ __pyx_tuple__446 = PyTuple_Pack(3, __pyx_int_164, __pyx_int_211, __pyx_int_238); if (unlikely(!__pyx_tuple__446)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 439; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_tuple__446); __Pyx_GIVEREF(__pyx_tuple__446); /* "include/color_dict.pxi":440 * 'lightskyblue1' : (176, 226, 255), * 'lightskyblue2' : (164, 211, 238), * 'lightskyblue3' : (141, 182, 205), # <<<<<<<<<<<<<< * 'lightskyblue4' : (96, 123, 139), * 'lightslateblue' : (132, 112, 255), */ __pyx_tuple__447 = PyTuple_Pack(3, __pyx_int_141, __pyx_int_182, __pyx_int_205); if (unlikely(!__pyx_tuple__447)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 440; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_tuple__447); __Pyx_GIVEREF(__pyx_tuple__447); /* "include/color_dict.pxi":441 * 'lightskyblue2' : (164, 211, 238), * 'lightskyblue3' : (141, 182, 205), * 'lightskyblue4' : (96, 123, 139), # <<<<<<<<<<<<<< * 'lightslateblue' : (132, 112, 255), * 'lightslategray' : (119, 136, 153), */ __pyx_tuple__448 = PyTuple_Pack(3, __pyx_int_96, __pyx_int_123, __pyx_int_139); if (unlikely(!__pyx_tuple__448)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 441; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_tuple__448); __Pyx_GIVEREF(__pyx_tuple__448); /* "include/color_dict.pxi":442 * 'lightskyblue3' : (141, 182, 205), * 'lightskyblue4' : (96, 123, 139), * 'lightslateblue' : (132, 112, 255), # <<<<<<<<<<<<<< * 'lightslategray' : (119, 136, 153), * 'lightslategrey' : (119, 136, 153), */ __pyx_tuple__449 = PyTuple_Pack(3, __pyx_int_132, __pyx_int_112, __pyx_int_255); if (unlikely(!__pyx_tuple__449)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 442; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_tuple__449); __Pyx_GIVEREF(__pyx_tuple__449); /* "include/color_dict.pxi":443 * 'lightskyblue4' : (96, 123, 139), * 'lightslateblue' : (132, 112, 255), * 'lightslategray' : (119, 136, 153), # <<<<<<<<<<<<<< * 'lightslategrey' : (119, 136, 153), * 'lightsteelblue' : (176, 196, 222), */ __pyx_tuple__450 = PyTuple_Pack(3, __pyx_int_119, __pyx_int_136, __pyx_int_153); if (unlikely(!__pyx_tuple__450)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 443; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_tuple__450); __Pyx_GIVEREF(__pyx_tuple__450); /* "include/color_dict.pxi":444 * 'lightslateblue' : (132, 112, 255), * 'lightslategray' : (119, 136, 153), * 'lightslategrey' : (119, 136, 153), # <<<<<<<<<<<<<< * 'lightsteelblue' : (176, 196, 222), * 'lightsteelblue1' : (202, 225, 255), */ __pyx_tuple__451 = PyTuple_Pack(3, __pyx_int_119, __pyx_int_136, __pyx_int_153); if (unlikely(!__pyx_tuple__451)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 444; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_tuple__451); __Pyx_GIVEREF(__pyx_tuple__451); /* "include/color_dict.pxi":445 * 'lightslategray' : (119, 136, 153), * 'lightslategrey' : (119, 136, 153), * 'lightsteelblue' : (176, 196, 222), # <<<<<<<<<<<<<< * 'lightsteelblue1' : (202, 225, 255), * 'lightsteelblue2' : (188, 210, 238), */ __pyx_tuple__452 = PyTuple_Pack(3, __pyx_int_176, __pyx_int_196, __pyx_int_222); if (unlikely(!__pyx_tuple__452)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 445; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_tuple__452); __Pyx_GIVEREF(__pyx_tuple__452); /* "include/color_dict.pxi":446 * 'lightslategrey' : (119, 136, 153), * 'lightsteelblue' : (176, 196, 222), * 'lightsteelblue1' : (202, 225, 255), # <<<<<<<<<<<<<< * 'lightsteelblue2' : (188, 210, 238), * 'lightsteelblue3' : (162, 181, 205), */ __pyx_tuple__453 = PyTuple_Pack(3, __pyx_int_202, __pyx_int_225, __pyx_int_255); if (unlikely(!__pyx_tuple__453)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 446; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_tuple__453); __Pyx_GIVEREF(__pyx_tuple__453); /* "include/color_dict.pxi":447 * 'lightsteelblue' : (176, 196, 222), * 'lightsteelblue1' : (202, 225, 255), * 'lightsteelblue2' : (188, 210, 238), # <<<<<<<<<<<<<< * 'lightsteelblue3' : (162, 181, 205), * 'lightsteelblue4' : (110, 123, 139), */ __pyx_tuple__454 = PyTuple_Pack(3, __pyx_int_188, __pyx_int_210, __pyx_int_238); if (unlikely(!__pyx_tuple__454)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 447; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_tuple__454); __Pyx_GIVEREF(__pyx_tuple__454); /* "include/color_dict.pxi":448 * 'lightsteelblue1' : (202, 225, 255), * 'lightsteelblue2' : (188, 210, 238), * 'lightsteelblue3' : (162, 181, 205), # <<<<<<<<<<<<<< * 'lightsteelblue4' : (110, 123, 139), * 'lightyellow' : (255, 255, 224), */ __pyx_tuple__455 = PyTuple_Pack(3, __pyx_int_162, __pyx_int_181, __pyx_int_205); if (unlikely(!__pyx_tuple__455)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 448; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_tuple__455); __Pyx_GIVEREF(__pyx_tuple__455); /* "include/color_dict.pxi":449 * 'lightsteelblue2' : (188, 210, 238), * 'lightsteelblue3' : (162, 181, 205), * 'lightsteelblue4' : (110, 123, 139), # <<<<<<<<<<<<<< * 'lightyellow' : (255, 255, 224), * 'lightyellow1' : (255, 255, 224), */ __pyx_tuple__456 = PyTuple_Pack(3, __pyx_int_110, __pyx_int_123, __pyx_int_139); if (unlikely(!__pyx_tuple__456)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 449; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_tuple__456); __Pyx_GIVEREF(__pyx_tuple__456); /* "include/color_dict.pxi":450 * 'lightsteelblue3' : (162, 181, 205), * 'lightsteelblue4' : (110, 123, 139), * 'lightyellow' : (255, 255, 224), # <<<<<<<<<<<<<< * 'lightyellow1' : (255, 255, 224), * 'lightyellow2' : (238, 238, 209), */ __pyx_tuple__457 = PyTuple_Pack(3, __pyx_int_255, __pyx_int_255, __pyx_int_224); if (unlikely(!__pyx_tuple__457)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 450; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_tuple__457); __Pyx_GIVEREF(__pyx_tuple__457); /* "include/color_dict.pxi":451 * 'lightsteelblue4' : (110, 123, 139), * 'lightyellow' : (255, 255, 224), * 'lightyellow1' : (255, 255, 224), # <<<<<<<<<<<<<< * 'lightyellow2' : (238, 238, 209), * 'lightyellow3' : (205, 205, 180), */ __pyx_tuple__458 = PyTuple_Pack(3, __pyx_int_255, __pyx_int_255, __pyx_int_224); if (unlikely(!__pyx_tuple__458)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 451; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_tuple__458); __Pyx_GIVEREF(__pyx_tuple__458); /* "include/color_dict.pxi":452 * 'lightyellow' : (255, 255, 224), * 'lightyellow1' : (255, 255, 224), * 'lightyellow2' : (238, 238, 209), # <<<<<<<<<<<<<< * 'lightyellow3' : (205, 205, 180), * 'lightyellow4' : (139, 139, 122), */ __pyx_tuple__459 = PyTuple_Pack(3, __pyx_int_238, __pyx_int_238, __pyx_int_209); if (unlikely(!__pyx_tuple__459)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 452; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_tuple__459); __Pyx_GIVEREF(__pyx_tuple__459); /* "include/color_dict.pxi":453 * 'lightyellow1' : (255, 255, 224), * 'lightyellow2' : (238, 238, 209), * 'lightyellow3' : (205, 205, 180), # <<<<<<<<<<<<<< * 'lightyellow4' : (139, 139, 122), * 'lime' : (0, 255, 0), */ __pyx_tuple__460 = PyTuple_Pack(3, __pyx_int_205, __pyx_int_205, __pyx_int_180); if (unlikely(!__pyx_tuple__460)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 453; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_tuple__460); __Pyx_GIVEREF(__pyx_tuple__460); /* "include/color_dict.pxi":454 * 'lightyellow2' : (238, 238, 209), * 'lightyellow3' : (205, 205, 180), * 'lightyellow4' : (139, 139, 122), # <<<<<<<<<<<<<< * 'lime' : (0, 255, 0), * 'limegreen' : (50, 205, 50), */ __pyx_tuple__461 = PyTuple_Pack(3, __pyx_int_139, __pyx_int_139, __pyx_int_122); if (unlikely(!__pyx_tuple__461)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 454; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_tuple__461); __Pyx_GIVEREF(__pyx_tuple__461); /* "include/color_dict.pxi":455 * 'lightyellow3' : (205, 205, 180), * 'lightyellow4' : (139, 139, 122), * 'lime' : (0, 255, 0), # <<<<<<<<<<<<<< * 'limegreen' : (50, 205, 50), * 'linen' : (250, 240, 230), */ __pyx_tuple__462 = PyTuple_Pack(3, __pyx_int_0, __pyx_int_255, __pyx_int_0); if (unlikely(!__pyx_tuple__462)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 455; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_tuple__462); __Pyx_GIVEREF(__pyx_tuple__462); /* "include/color_dict.pxi":456 * 'lightyellow4' : (139, 139, 122), * 'lime' : (0, 255, 0), * 'limegreen' : (50, 205, 50), # <<<<<<<<<<<<<< * 'linen' : (250, 240, 230), * 'magenta' : (255, 0, 255), */ __pyx_tuple__463 = PyTuple_Pack(3, __pyx_int_50, __pyx_int_205, __pyx_int_50); if (unlikely(!__pyx_tuple__463)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 456; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_tuple__463); __Pyx_GIVEREF(__pyx_tuple__463); /* "include/color_dict.pxi":457 * 'lime' : (0, 255, 0), * 'limegreen' : (50, 205, 50), * 'linen' : (250, 240, 230), # <<<<<<<<<<<<<< * 'magenta' : (255, 0, 255), * 'magenta1' : (255, 0, 255), */ __pyx_tuple__464 = PyTuple_Pack(3, __pyx_int_250, __pyx_int_240, __pyx_int_230); if (unlikely(!__pyx_tuple__464)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 457; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_tuple__464); __Pyx_GIVEREF(__pyx_tuple__464); /* "include/color_dict.pxi":458 * 'limegreen' : (50, 205, 50), * 'linen' : (250, 240, 230), * 'magenta' : (255, 0, 255), # <<<<<<<<<<<<<< * 'magenta1' : (255, 0, 255), * 'magenta2' : (238, 0, 238), */ __pyx_tuple__465 = PyTuple_Pack(3, __pyx_int_255, __pyx_int_0, __pyx_int_255); if (unlikely(!__pyx_tuple__465)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 458; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_tuple__465); __Pyx_GIVEREF(__pyx_tuple__465); /* "include/color_dict.pxi":459 * 'linen' : (250, 240, 230), * 'magenta' : (255, 0, 255), * 'magenta1' : (255, 0, 255), # <<<<<<<<<<<<<< * 'magenta2' : (238, 0, 238), * 'magenta3' : (205, 0, 205), */ __pyx_tuple__466 = PyTuple_Pack(3, __pyx_int_255, __pyx_int_0, __pyx_int_255); if (unlikely(!__pyx_tuple__466)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 459; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_tuple__466); __Pyx_GIVEREF(__pyx_tuple__466); /* "include/color_dict.pxi":460 * 'magenta' : (255, 0, 255), * 'magenta1' : (255, 0, 255), * 'magenta2' : (238, 0, 238), # <<<<<<<<<<<<<< * 'magenta3' : (205, 0, 205), * 'magenta4' : (139, 0, 139), */ __pyx_tuple__467 = PyTuple_Pack(3, __pyx_int_238, __pyx_int_0, __pyx_int_238); if (unlikely(!__pyx_tuple__467)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 460; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_tuple__467); __Pyx_GIVEREF(__pyx_tuple__467); /* "include/color_dict.pxi":461 * 'magenta1' : (255, 0, 255), * 'magenta2' : (238, 0, 238), * 'magenta3' : (205, 0, 205), # <<<<<<<<<<<<<< * 'magenta4' : (139, 0, 139), * 'maroon' : (176, 48, 96), */ __pyx_tuple__468 = PyTuple_Pack(3, __pyx_int_205, __pyx_int_0, __pyx_int_205); if (unlikely(!__pyx_tuple__468)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 461; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_tuple__468); __Pyx_GIVEREF(__pyx_tuple__468); /* "include/color_dict.pxi":462 * 'magenta2' : (238, 0, 238), * 'magenta3' : (205, 0, 205), * 'magenta4' : (139, 0, 139), # <<<<<<<<<<<<<< * 'maroon' : (176, 48, 96), * 'maroon1' : (255, 52, 179), */ __pyx_tuple__469 = PyTuple_Pack(3, __pyx_int_139, __pyx_int_0, __pyx_int_139); if (unlikely(!__pyx_tuple__469)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 462; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_tuple__469); __Pyx_GIVEREF(__pyx_tuple__469); /* "include/color_dict.pxi":463 * 'magenta3' : (205, 0, 205), * 'magenta4' : (139, 0, 139), * 'maroon' : (176, 48, 96), # <<<<<<<<<<<<<< * 'maroon1' : (255, 52, 179), * 'maroon2' : (238, 48, 167), */ __pyx_tuple__470 = PyTuple_Pack(3, __pyx_int_176, __pyx_int_48, __pyx_int_96); if (unlikely(!__pyx_tuple__470)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 463; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_tuple__470); __Pyx_GIVEREF(__pyx_tuple__470); /* "include/color_dict.pxi":464 * 'magenta4' : (139, 0, 139), * 'maroon' : (176, 48, 96), * 'maroon1' : (255, 52, 179), # <<<<<<<<<<<<<< * 'maroon2' : (238, 48, 167), * 'maroon3' : (205, 41, 144), */ __pyx_tuple__471 = PyTuple_Pack(3, __pyx_int_255, __pyx_int_52, __pyx_int_179); if (unlikely(!__pyx_tuple__471)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 464; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_tuple__471); __Pyx_GIVEREF(__pyx_tuple__471); /* "include/color_dict.pxi":465 * 'maroon' : (176, 48, 96), * 'maroon1' : (255, 52, 179), * 'maroon2' : (238, 48, 167), # <<<<<<<<<<<<<< * 'maroon3' : (205, 41, 144), * 'maroon4' : (139, 28, 98), */ __pyx_tuple__472 = PyTuple_Pack(3, __pyx_int_238, __pyx_int_48, __pyx_int_167); if (unlikely(!__pyx_tuple__472)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 465; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_tuple__472); __Pyx_GIVEREF(__pyx_tuple__472); /* "include/color_dict.pxi":466 * 'maroon1' : (255, 52, 179), * 'maroon2' : (238, 48, 167), * 'maroon3' : (205, 41, 144), # <<<<<<<<<<<<<< * 'maroon4' : (139, 28, 98), * 'mediumaquamarine' : (102, 205, 170), */ __pyx_tuple__473 = PyTuple_Pack(3, __pyx_int_205, __pyx_int_41, __pyx_int_144); if (unlikely(!__pyx_tuple__473)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 466; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_tuple__473); __Pyx_GIVEREF(__pyx_tuple__473); /* "include/color_dict.pxi":467 * 'maroon2' : (238, 48, 167), * 'maroon3' : (205, 41, 144), * 'maroon4' : (139, 28, 98), # <<<<<<<<<<<<<< * 'mediumaquamarine' : (102, 205, 170), * 'mediumblue' : (0, 0, 205), */ __pyx_tuple__474 = PyTuple_Pack(3, __pyx_int_139, __pyx_int_28, __pyx_int_98); if (unlikely(!__pyx_tuple__474)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 467; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_tuple__474); __Pyx_GIVEREF(__pyx_tuple__474); /* "include/color_dict.pxi":468 * 'maroon3' : (205, 41, 144), * 'maroon4' : (139, 28, 98), * 'mediumaquamarine' : (102, 205, 170), # <<<<<<<<<<<<<< * 'mediumblue' : (0, 0, 205), * 'mediumorchid' : (186, 85, 211), */ __pyx_tuple__475 = PyTuple_Pack(3, __pyx_int_102, __pyx_int_205, __pyx_int_170); if (unlikely(!__pyx_tuple__475)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 468; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_tuple__475); __Pyx_GIVEREF(__pyx_tuple__475); /* "include/color_dict.pxi":469 * 'maroon4' : (139, 28, 98), * 'mediumaquamarine' : (102, 205, 170), * 'mediumblue' : (0, 0, 205), # <<<<<<<<<<<<<< * 'mediumorchid' : (186, 85, 211), * 'mediumorchid1' : (224, 102, 255), */ __pyx_tuple__476 = PyTuple_Pack(3, __pyx_int_0, __pyx_int_0, __pyx_int_205); if (unlikely(!__pyx_tuple__476)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 469; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_tuple__476); __Pyx_GIVEREF(__pyx_tuple__476); /* "include/color_dict.pxi":470 * 'mediumaquamarine' : (102, 205, 170), * 'mediumblue' : (0, 0, 205), * 'mediumorchid' : (186, 85, 211), # <<<<<<<<<<<<<< * 'mediumorchid1' : (224, 102, 255), * 'mediumorchid2' : (209, 95, 238), */ __pyx_tuple__477 = PyTuple_Pack(3, __pyx_int_186, __pyx_int_85, __pyx_int_211); if (unlikely(!__pyx_tuple__477)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 470; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_tuple__477); __Pyx_GIVEREF(__pyx_tuple__477); /* "include/color_dict.pxi":471 * 'mediumblue' : (0, 0, 205), * 'mediumorchid' : (186, 85, 211), * 'mediumorchid1' : (224, 102, 255), # <<<<<<<<<<<<<< * 'mediumorchid2' : (209, 95, 238), * 'mediumorchid3' : (180, 82, 205), */ __pyx_tuple__478 = PyTuple_Pack(3, __pyx_int_224, __pyx_int_102, __pyx_int_255); if (unlikely(!__pyx_tuple__478)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 471; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_tuple__478); __Pyx_GIVEREF(__pyx_tuple__478); /* "include/color_dict.pxi":472 * 'mediumorchid' : (186, 85, 211), * 'mediumorchid1' : (224, 102, 255), * 'mediumorchid2' : (209, 95, 238), # <<<<<<<<<<<<<< * 'mediumorchid3' : (180, 82, 205), * 'mediumorchid4' : (122, 55, 139), */ __pyx_tuple__479 = PyTuple_Pack(3, __pyx_int_209, __pyx_int_95, __pyx_int_238); if (unlikely(!__pyx_tuple__479)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 472; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_tuple__479); __Pyx_GIVEREF(__pyx_tuple__479); /* "include/color_dict.pxi":473 * 'mediumorchid1' : (224, 102, 255), * 'mediumorchid2' : (209, 95, 238), * 'mediumorchid3' : (180, 82, 205), # <<<<<<<<<<<<<< * 'mediumorchid4' : (122, 55, 139), * 'mediumpurple' : (147, 112, 219), */ __pyx_tuple__480 = PyTuple_Pack(3, __pyx_int_180, __pyx_int_82, __pyx_int_205); if (unlikely(!__pyx_tuple__480)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 473; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_tuple__480); __Pyx_GIVEREF(__pyx_tuple__480); /* "include/color_dict.pxi":474 * 'mediumorchid2' : (209, 95, 238), * 'mediumorchid3' : (180, 82, 205), * 'mediumorchid4' : (122, 55, 139), # <<<<<<<<<<<<<< * 'mediumpurple' : (147, 112, 219), * 'mediumpurple1' : (171, 130, 255), */ __pyx_tuple__481 = PyTuple_Pack(3, __pyx_int_122, __pyx_int_55, __pyx_int_139); if (unlikely(!__pyx_tuple__481)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 474; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_tuple__481); __Pyx_GIVEREF(__pyx_tuple__481); /* "include/color_dict.pxi":475 * 'mediumorchid3' : (180, 82, 205), * 'mediumorchid4' : (122, 55, 139), * 'mediumpurple' : (147, 112, 219), # <<<<<<<<<<<<<< * 'mediumpurple1' : (171, 130, 255), * 'mediumpurple2' : (159, 121, 238), */ __pyx_tuple__482 = PyTuple_Pack(3, __pyx_int_147, __pyx_int_112, __pyx_int_219); if (unlikely(!__pyx_tuple__482)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 475; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_tuple__482); __Pyx_GIVEREF(__pyx_tuple__482); /* "include/color_dict.pxi":476 * 'mediumorchid4' : (122, 55, 139), * 'mediumpurple' : (147, 112, 219), * 'mediumpurple1' : (171, 130, 255), # <<<<<<<<<<<<<< * 'mediumpurple2' : (159, 121, 238), * 'mediumpurple3' : (137, 104, 205), */ __pyx_tuple__483 = PyTuple_Pack(3, __pyx_int_171, __pyx_int_130, __pyx_int_255); if (unlikely(!__pyx_tuple__483)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 476; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_tuple__483); __Pyx_GIVEREF(__pyx_tuple__483); /* "include/color_dict.pxi":477 * 'mediumpurple' : (147, 112, 219), * 'mediumpurple1' : (171, 130, 255), * 'mediumpurple2' : (159, 121, 238), # <<<<<<<<<<<<<< * 'mediumpurple3' : (137, 104, 205), * 'mediumpurple4' : (93, 71, 139), */ __pyx_tuple__484 = PyTuple_Pack(3, __pyx_int_159, __pyx_int_121, __pyx_int_238); if (unlikely(!__pyx_tuple__484)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 477; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_tuple__484); __Pyx_GIVEREF(__pyx_tuple__484); /* "include/color_dict.pxi":478 * 'mediumpurple1' : (171, 130, 255), * 'mediumpurple2' : (159, 121, 238), * 'mediumpurple3' : (137, 104, 205), # <<<<<<<<<<<<<< * 'mediumpurple4' : (93, 71, 139), * 'mediumseagreen' : (60, 179, 113), */ __pyx_tuple__485 = PyTuple_Pack(3, __pyx_int_137, __pyx_int_104, __pyx_int_205); if (unlikely(!__pyx_tuple__485)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 478; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_tuple__485); __Pyx_GIVEREF(__pyx_tuple__485); /* "include/color_dict.pxi":479 * 'mediumpurple2' : (159, 121, 238), * 'mediumpurple3' : (137, 104, 205), * 'mediumpurple4' : (93, 71, 139), # <<<<<<<<<<<<<< * 'mediumseagreen' : (60, 179, 113), * 'mediumslateblue' : (123, 104, 238), */ __pyx_tuple__486 = PyTuple_Pack(3, __pyx_int_93, __pyx_int_71, __pyx_int_139); if (unlikely(!__pyx_tuple__486)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 479; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_tuple__486); __Pyx_GIVEREF(__pyx_tuple__486); /* "include/color_dict.pxi":480 * 'mediumpurple3' : (137, 104, 205), * 'mediumpurple4' : (93, 71, 139), * 'mediumseagreen' : (60, 179, 113), # <<<<<<<<<<<<<< * 'mediumslateblue' : (123, 104, 238), * 'mediumspringgreen' : (0, 250, 154), */ __pyx_tuple__487 = PyTuple_Pack(3, __pyx_int_60, __pyx_int_179, __pyx_int_113); if (unlikely(!__pyx_tuple__487)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 480; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_tuple__487); __Pyx_GIVEREF(__pyx_tuple__487); /* "include/color_dict.pxi":481 * 'mediumpurple4' : (93, 71, 139), * 'mediumseagreen' : (60, 179, 113), * 'mediumslateblue' : (123, 104, 238), # <<<<<<<<<<<<<< * 'mediumspringgreen' : (0, 250, 154), * 'mediumturquoise' : (72, 209, 204), */ __pyx_tuple__488 = PyTuple_Pack(3, __pyx_int_123, __pyx_int_104, __pyx_int_238); if (unlikely(!__pyx_tuple__488)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 481; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_tuple__488); __Pyx_GIVEREF(__pyx_tuple__488); /* "include/color_dict.pxi":482 * 'mediumseagreen' : (60, 179, 113), * 'mediumslateblue' : (123, 104, 238), * 'mediumspringgreen' : (0, 250, 154), # <<<<<<<<<<<<<< * 'mediumturquoise' : (72, 209, 204), * 'mediumvioletred' : (199, 21, 133), */ __pyx_tuple__489 = PyTuple_Pack(3, __pyx_int_0, __pyx_int_250, __pyx_int_154); if (unlikely(!__pyx_tuple__489)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 482; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_tuple__489); __Pyx_GIVEREF(__pyx_tuple__489); /* "include/color_dict.pxi":483 * 'mediumslateblue' : (123, 104, 238), * 'mediumspringgreen' : (0, 250, 154), * 'mediumturquoise' : (72, 209, 204), # <<<<<<<<<<<<<< * 'mediumvioletred' : (199, 21, 133), * 'midnightblue' : (25, 25, 112), */ __pyx_tuple__490 = PyTuple_Pack(3, __pyx_int_72, __pyx_int_209, __pyx_int_204); if (unlikely(!__pyx_tuple__490)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 483; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_tuple__490); __Pyx_GIVEREF(__pyx_tuple__490); /* "include/color_dict.pxi":484 * 'mediumspringgreen' : (0, 250, 154), * 'mediumturquoise' : (72, 209, 204), * 'mediumvioletred' : (199, 21, 133), # <<<<<<<<<<<<<< * 'midnightblue' : (25, 25, 112), * 'mintcream' : (245, 255, 250), */ __pyx_tuple__491 = PyTuple_Pack(3, __pyx_int_199, __pyx_int_21, __pyx_int_133); if (unlikely(!__pyx_tuple__491)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 484; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_tuple__491); __Pyx_GIVEREF(__pyx_tuple__491); /* "include/color_dict.pxi":485 * 'mediumturquoise' : (72, 209, 204), * 'mediumvioletred' : (199, 21, 133), * 'midnightblue' : (25, 25, 112), # <<<<<<<<<<<<<< * 'mintcream' : (245, 255, 250), * 'mistyrose' : (255, 228, 225), */ __pyx_tuple__492 = PyTuple_Pack(3, __pyx_int_25, __pyx_int_25, __pyx_int_112); if (unlikely(!__pyx_tuple__492)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 485; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_tuple__492); __Pyx_GIVEREF(__pyx_tuple__492); /* "include/color_dict.pxi":486 * 'mediumvioletred' : (199, 21, 133), * 'midnightblue' : (25, 25, 112), * 'mintcream' : (245, 255, 250), # <<<<<<<<<<<<<< * 'mistyrose' : (255, 228, 225), * 'mistyrose1' : (255, 228, 225), */ __pyx_tuple__493 = PyTuple_Pack(3, __pyx_int_245, __pyx_int_255, __pyx_int_250); if (unlikely(!__pyx_tuple__493)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 486; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_tuple__493); __Pyx_GIVEREF(__pyx_tuple__493); /* "include/color_dict.pxi":487 * 'midnightblue' : (25, 25, 112), * 'mintcream' : (245, 255, 250), * 'mistyrose' : (255, 228, 225), # <<<<<<<<<<<<<< * 'mistyrose1' : (255, 228, 225), * 'mistyrose2' : (238, 213, 210), */ __pyx_tuple__494 = PyTuple_Pack(3, __pyx_int_255, __pyx_int_228, __pyx_int_225); if (unlikely(!__pyx_tuple__494)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 487; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_tuple__494); __Pyx_GIVEREF(__pyx_tuple__494); /* "include/color_dict.pxi":488 * 'mintcream' : (245, 255, 250), * 'mistyrose' : (255, 228, 225), * 'mistyrose1' : (255, 228, 225), # <<<<<<<<<<<<<< * 'mistyrose2' : (238, 213, 210), * 'mistyrose3' : (205, 183, 181), */ __pyx_tuple__495 = PyTuple_Pack(3, __pyx_int_255, __pyx_int_228, __pyx_int_225); if (unlikely(!__pyx_tuple__495)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 488; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_tuple__495); __Pyx_GIVEREF(__pyx_tuple__495); /* "include/color_dict.pxi":489 * 'mistyrose' : (255, 228, 225), * 'mistyrose1' : (255, 228, 225), * 'mistyrose2' : (238, 213, 210), # <<<<<<<<<<<<<< * 'mistyrose3' : (205, 183, 181), * 'mistyrose4' : (139, 125, 123), */ __pyx_tuple__496 = PyTuple_Pack(3, __pyx_int_238, __pyx_int_213, __pyx_int_210); if (unlikely(!__pyx_tuple__496)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 489; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_tuple__496); __Pyx_GIVEREF(__pyx_tuple__496); /* "include/color_dict.pxi":490 * 'mistyrose1' : (255, 228, 225), * 'mistyrose2' : (238, 213, 210), * 'mistyrose3' : (205, 183, 181), # <<<<<<<<<<<<<< * 'mistyrose4' : (139, 125, 123), * 'moccasin' : (255, 228, 181), */ __pyx_tuple__497 = PyTuple_Pack(3, __pyx_int_205, __pyx_int_183, __pyx_int_181); if (unlikely(!__pyx_tuple__497)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 490; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_tuple__497); __Pyx_GIVEREF(__pyx_tuple__497); /* "include/color_dict.pxi":491 * 'mistyrose2' : (238, 213, 210), * 'mistyrose3' : (205, 183, 181), * 'mistyrose4' : (139, 125, 123), # <<<<<<<<<<<<<< * 'moccasin' : (255, 228, 181), * 'navajowhite' : (255, 222, 173), */ __pyx_tuple__498 = PyTuple_Pack(3, __pyx_int_139, __pyx_int_125, __pyx_int_123); if (unlikely(!__pyx_tuple__498)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 491; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_tuple__498); __Pyx_GIVEREF(__pyx_tuple__498); /* "include/color_dict.pxi":492 * 'mistyrose3' : (205, 183, 181), * 'mistyrose4' : (139, 125, 123), * 'moccasin' : (255, 228, 181), # <<<<<<<<<<<<<< * 'navajowhite' : (255, 222, 173), * 'navajowhite1' : (255, 222, 173), */ __pyx_tuple__499 = PyTuple_Pack(3, __pyx_int_255, __pyx_int_228, __pyx_int_181); if (unlikely(!__pyx_tuple__499)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 492; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_tuple__499); __Pyx_GIVEREF(__pyx_tuple__499); /* "include/color_dict.pxi":493 * 'mistyrose4' : (139, 125, 123), * 'moccasin' : (255, 228, 181), * 'navajowhite' : (255, 222, 173), # <<<<<<<<<<<<<< * 'navajowhite1' : (255, 222, 173), * 'navajowhite2' : (238, 207, 161), */ __pyx_tuple__500 = PyTuple_Pack(3, __pyx_int_255, __pyx_int_222, __pyx_int_173); if (unlikely(!__pyx_tuple__500)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 493; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_tuple__500); __Pyx_GIVEREF(__pyx_tuple__500); /* "include/color_dict.pxi":494 * 'moccasin' : (255, 228, 181), * 'navajowhite' : (255, 222, 173), * 'navajowhite1' : (255, 222, 173), # <<<<<<<<<<<<<< * 'navajowhite2' : (238, 207, 161), * 'navajowhite3' : (205, 179, 139), */ __pyx_tuple__501 = PyTuple_Pack(3, __pyx_int_255, __pyx_int_222, __pyx_int_173); if (unlikely(!__pyx_tuple__501)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 494; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_tuple__501); __Pyx_GIVEREF(__pyx_tuple__501); /* "include/color_dict.pxi":495 * 'navajowhite' : (255, 222, 173), * 'navajowhite1' : (255, 222, 173), * 'navajowhite2' : (238, 207, 161), # <<<<<<<<<<<<<< * 'navajowhite3' : (205, 179, 139), * 'navajowhite4' : (139, 121, 94), */ __pyx_tuple__502 = PyTuple_Pack(3, __pyx_int_238, __pyx_int_207, __pyx_int_161); if (unlikely(!__pyx_tuple__502)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 495; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_tuple__502); __Pyx_GIVEREF(__pyx_tuple__502); /* "include/color_dict.pxi":496 * 'navajowhite1' : (255, 222, 173), * 'navajowhite2' : (238, 207, 161), * 'navajowhite3' : (205, 179, 139), # <<<<<<<<<<<<<< * 'navajowhite4' : (139, 121, 94), * 'navy' : (0, 0, 128), */ __pyx_tuple__503 = PyTuple_Pack(3, __pyx_int_205, __pyx_int_179, __pyx_int_139); if (unlikely(!__pyx_tuple__503)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 496; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_tuple__503); __Pyx_GIVEREF(__pyx_tuple__503); /* "include/color_dict.pxi":497 * 'navajowhite2' : (238, 207, 161), * 'navajowhite3' : (205, 179, 139), * 'navajowhite4' : (139, 121, 94), # <<<<<<<<<<<<<< * 'navy' : (0, 0, 128), * 'navyblue' : (0, 0, 128), */ __pyx_tuple__504 = PyTuple_Pack(3, __pyx_int_139, __pyx_int_121, __pyx_int_94); if (unlikely(!__pyx_tuple__504)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 497; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_tuple__504); __Pyx_GIVEREF(__pyx_tuple__504); /* "include/color_dict.pxi":498 * 'navajowhite3' : (205, 179, 139), * 'navajowhite4' : (139, 121, 94), * 'navy' : (0, 0, 128), # <<<<<<<<<<<<<< * 'navyblue' : (0, 0, 128), * 'oldlace' : (253, 245, 230), */ __pyx_tuple__505 = PyTuple_Pack(3, __pyx_int_0, __pyx_int_0, __pyx_int_128); if (unlikely(!__pyx_tuple__505)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 498; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_tuple__505); __Pyx_GIVEREF(__pyx_tuple__505); /* "include/color_dict.pxi":499 * 'navajowhite4' : (139, 121, 94), * 'navy' : (0, 0, 128), * 'navyblue' : (0, 0, 128), # <<<<<<<<<<<<<< * 'oldlace' : (253, 245, 230), * 'olive' : (128, 128, 0), */ __pyx_tuple__506 = PyTuple_Pack(3, __pyx_int_0, __pyx_int_0, __pyx_int_128); if (unlikely(!__pyx_tuple__506)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 499; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_tuple__506); __Pyx_GIVEREF(__pyx_tuple__506); /* "include/color_dict.pxi":500 * 'navy' : (0, 0, 128), * 'navyblue' : (0, 0, 128), * 'oldlace' : (253, 245, 230), # <<<<<<<<<<<<<< * 'olive' : (128, 128, 0), * 'olivedrab' : (107, 142, 35), */ __pyx_tuple__507 = PyTuple_Pack(3, __pyx_int_253, __pyx_int_245, __pyx_int_230); if (unlikely(!__pyx_tuple__507)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 500; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_tuple__507); __Pyx_GIVEREF(__pyx_tuple__507); /* "include/color_dict.pxi":501 * 'navyblue' : (0, 0, 128), * 'oldlace' : (253, 245, 230), * 'olive' : (128, 128, 0), # <<<<<<<<<<<<<< * 'olivedrab' : (107, 142, 35), * 'olivedrab1' : (192, 255, 62), */ __pyx_tuple__508 = PyTuple_Pack(3, __pyx_int_128, __pyx_int_128, __pyx_int_0); if (unlikely(!__pyx_tuple__508)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 501; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_tuple__508); __Pyx_GIVEREF(__pyx_tuple__508); /* "include/color_dict.pxi":502 * 'oldlace' : (253, 245, 230), * 'olive' : (128, 128, 0), * 'olivedrab' : (107, 142, 35), # <<<<<<<<<<<<<< * 'olivedrab1' : (192, 255, 62), * 'olivedrab2' : (179, 238, 58), */ __pyx_tuple__509 = PyTuple_Pack(3, __pyx_int_107, __pyx_int_142, __pyx_int_35); if (unlikely(!__pyx_tuple__509)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 502; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_tuple__509); __Pyx_GIVEREF(__pyx_tuple__509); /* "include/color_dict.pxi":503 * 'olive' : (128, 128, 0), * 'olivedrab' : (107, 142, 35), * 'olivedrab1' : (192, 255, 62), # <<<<<<<<<<<<<< * 'olivedrab2' : (179, 238, 58), * 'olivedrab3' : (154, 205, 50), */ __pyx_tuple__510 = PyTuple_Pack(3, __pyx_int_192, __pyx_int_255, __pyx_int_62); if (unlikely(!__pyx_tuple__510)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 503; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_tuple__510); __Pyx_GIVEREF(__pyx_tuple__510); /* "include/color_dict.pxi":504 * 'olivedrab' : (107, 142, 35), * 'olivedrab1' : (192, 255, 62), * 'olivedrab2' : (179, 238, 58), # <<<<<<<<<<<<<< * 'olivedrab3' : (154, 205, 50), * 'olivedrab4' : (105, 139, 34), */ __pyx_tuple__511 = PyTuple_Pack(3, __pyx_int_179, __pyx_int_238, __pyx_int_58); if (unlikely(!__pyx_tuple__511)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 504; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_tuple__511); __Pyx_GIVEREF(__pyx_tuple__511); /* "include/color_dict.pxi":505 * 'olivedrab1' : (192, 255, 62), * 'olivedrab2' : (179, 238, 58), * 'olivedrab3' : (154, 205, 50), # <<<<<<<<<<<<<< * 'olivedrab4' : (105, 139, 34), * 'orange' : (255, 165, 0), */ __pyx_tuple__512 = PyTuple_Pack(3, __pyx_int_154, __pyx_int_205, __pyx_int_50); if (unlikely(!__pyx_tuple__512)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 505; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_tuple__512); __Pyx_GIVEREF(__pyx_tuple__512); /* "include/color_dict.pxi":506 * 'olivedrab2' : (179, 238, 58), * 'olivedrab3' : (154, 205, 50), * 'olivedrab4' : (105, 139, 34), # <<<<<<<<<<<<<< * 'orange' : (255, 165, 0), * 'orange1' : (255, 165, 0), */ __pyx_tuple__513 = PyTuple_Pack(3, __pyx_int_105, __pyx_int_139, __pyx_int_34); if (unlikely(!__pyx_tuple__513)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 506; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_tuple__513); __Pyx_GIVEREF(__pyx_tuple__513); /* "include/color_dict.pxi":507 * 'olivedrab3' : (154, 205, 50), * 'olivedrab4' : (105, 139, 34), * 'orange' : (255, 165, 0), # <<<<<<<<<<<<<< * 'orange1' : (255, 165, 0), * 'orange2' : (238, 154, 0), */ __pyx_tuple__514 = PyTuple_Pack(3, __pyx_int_255, __pyx_int_165, __pyx_int_0); if (unlikely(!__pyx_tuple__514)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 507; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_tuple__514); __Pyx_GIVEREF(__pyx_tuple__514); /* "include/color_dict.pxi":508 * 'olivedrab4' : (105, 139, 34), * 'orange' : (255, 165, 0), * 'orange1' : (255, 165, 0), # <<<<<<<<<<<<<< * 'orange2' : (238, 154, 0), * 'orange3' : (205, 133, 0), */ __pyx_tuple__515 = PyTuple_Pack(3, __pyx_int_255, __pyx_int_165, __pyx_int_0); if (unlikely(!__pyx_tuple__515)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 508; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_tuple__515); __Pyx_GIVEREF(__pyx_tuple__515); /* "include/color_dict.pxi":509 * 'orange' : (255, 165, 0), * 'orange1' : (255, 165, 0), * 'orange2' : (238, 154, 0), # <<<<<<<<<<<<<< * 'orange3' : (205, 133, 0), * 'orange4' : (139, 90, 0), */ __pyx_tuple__516 = PyTuple_Pack(3, __pyx_int_238, __pyx_int_154, __pyx_int_0); if (unlikely(!__pyx_tuple__516)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 509; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_tuple__516); __Pyx_GIVEREF(__pyx_tuple__516); /* "include/color_dict.pxi":510 * 'orange1' : (255, 165, 0), * 'orange2' : (238, 154, 0), * 'orange3' : (205, 133, 0), # <<<<<<<<<<<<<< * 'orange4' : (139, 90, 0), * 'orangered' : (255, 69, 0), */ __pyx_tuple__517 = PyTuple_Pack(3, __pyx_int_205, __pyx_int_133, __pyx_int_0); if (unlikely(!__pyx_tuple__517)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 510; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_tuple__517); __Pyx_GIVEREF(__pyx_tuple__517); /* "include/color_dict.pxi":511 * 'orange2' : (238, 154, 0), * 'orange3' : (205, 133, 0), * 'orange4' : (139, 90, 0), # <<<<<<<<<<<<<< * 'orangered' : (255, 69, 0), * 'orangered1' : (255, 69, 0), */ __pyx_tuple__518 = PyTuple_Pack(3, __pyx_int_139, __pyx_int_90, __pyx_int_0); if (unlikely(!__pyx_tuple__518)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 511; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_tuple__518); __Pyx_GIVEREF(__pyx_tuple__518); /* "include/color_dict.pxi":512 * 'orange3' : (205, 133, 0), * 'orange4' : (139, 90, 0), * 'orangered' : (255, 69, 0), # <<<<<<<<<<<<<< * 'orangered1' : (255, 69, 0), * 'orangered2' : (238, 64, 0), */ __pyx_tuple__519 = PyTuple_Pack(3, __pyx_int_255, __pyx_int_69, __pyx_int_0); if (unlikely(!__pyx_tuple__519)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 512; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_tuple__519); __Pyx_GIVEREF(__pyx_tuple__519); /* "include/color_dict.pxi":513 * 'orange4' : (139, 90, 0), * 'orangered' : (255, 69, 0), * 'orangered1' : (255, 69, 0), # <<<<<<<<<<<<<< * 'orangered2' : (238, 64, 0), * 'orangered3' : (205, 55, 0), */ __pyx_tuple__520 = PyTuple_Pack(3, __pyx_int_255, __pyx_int_69, __pyx_int_0); if (unlikely(!__pyx_tuple__520)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 513; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_tuple__520); __Pyx_GIVEREF(__pyx_tuple__520); /* "include/color_dict.pxi":514 * 'orangered' : (255, 69, 0), * 'orangered1' : (255, 69, 0), * 'orangered2' : (238, 64, 0), # <<<<<<<<<<<<<< * 'orangered3' : (205, 55, 0), * 'orangered4' : (139, 37, 0), */ __pyx_tuple__521 = PyTuple_Pack(3, __pyx_int_238, __pyx_int_64, __pyx_int_0); if (unlikely(!__pyx_tuple__521)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 514; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_tuple__521); __Pyx_GIVEREF(__pyx_tuple__521); /* "include/color_dict.pxi":515 * 'orangered1' : (255, 69, 0), * 'orangered2' : (238, 64, 0), * 'orangered3' : (205, 55, 0), # <<<<<<<<<<<<<< * 'orangered4' : (139, 37, 0), * 'orchid' : (218, 112, 214), */ __pyx_tuple__522 = PyTuple_Pack(3, __pyx_int_205, __pyx_int_55, __pyx_int_0); if (unlikely(!__pyx_tuple__522)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 515; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_tuple__522); __Pyx_GIVEREF(__pyx_tuple__522); /* "include/color_dict.pxi":516 * 'orangered2' : (238, 64, 0), * 'orangered3' : (205, 55, 0), * 'orangered4' : (139, 37, 0), # <<<<<<<<<<<<<< * 'orchid' : (218, 112, 214), * 'orchid1' : (255, 131, 250), */ __pyx_tuple__523 = PyTuple_Pack(3, __pyx_int_139, __pyx_int_37, __pyx_int_0); if (unlikely(!__pyx_tuple__523)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 516; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_tuple__523); __Pyx_GIVEREF(__pyx_tuple__523); /* "include/color_dict.pxi":517 * 'orangered3' : (205, 55, 0), * 'orangered4' : (139, 37, 0), * 'orchid' : (218, 112, 214), # <<<<<<<<<<<<<< * 'orchid1' : (255, 131, 250), * 'orchid2' : (238, 122, 233), */ __pyx_tuple__524 = PyTuple_Pack(3, __pyx_int_218, __pyx_int_112, __pyx_int_214); if (unlikely(!__pyx_tuple__524)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 517; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_tuple__524); __Pyx_GIVEREF(__pyx_tuple__524); /* "include/color_dict.pxi":518 * 'orangered4' : (139, 37, 0), * 'orchid' : (218, 112, 214), * 'orchid1' : (255, 131, 250), # <<<<<<<<<<<<<< * 'orchid2' : (238, 122, 233), * 'orchid3' : (205, 105, 201), */ __pyx_tuple__525 = PyTuple_Pack(3, __pyx_int_255, __pyx_int_131, __pyx_int_250); if (unlikely(!__pyx_tuple__525)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 518; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_tuple__525); __Pyx_GIVEREF(__pyx_tuple__525); /* "include/color_dict.pxi":519 * 'orchid' : (218, 112, 214), * 'orchid1' : (255, 131, 250), * 'orchid2' : (238, 122, 233), # <<<<<<<<<<<<<< * 'orchid3' : (205, 105, 201), * 'orchid4' : (139, 71, 137), */ __pyx_tuple__526 = PyTuple_Pack(3, __pyx_int_238, __pyx_int_122, __pyx_int_233); if (unlikely(!__pyx_tuple__526)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 519; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_tuple__526); __Pyx_GIVEREF(__pyx_tuple__526); /* "include/color_dict.pxi":520 * 'orchid1' : (255, 131, 250), * 'orchid2' : (238, 122, 233), * 'orchid3' : (205, 105, 201), # <<<<<<<<<<<<<< * 'orchid4' : (139, 71, 137), * 'palegoldenrod' : (238, 232, 170), */ __pyx_tuple__527 = PyTuple_Pack(3, __pyx_int_205, __pyx_int_105, __pyx_int_201); if (unlikely(!__pyx_tuple__527)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 520; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_tuple__527); __Pyx_GIVEREF(__pyx_tuple__527); /* "include/color_dict.pxi":521 * 'orchid2' : (238, 122, 233), * 'orchid3' : (205, 105, 201), * 'orchid4' : (139, 71, 137), # <<<<<<<<<<<<<< * 'palegoldenrod' : (238, 232, 170), * 'palegreen' : (152, 251, 152), */ __pyx_tuple__528 = PyTuple_Pack(3, __pyx_int_139, __pyx_int_71, __pyx_int_137); if (unlikely(!__pyx_tuple__528)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 521; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_tuple__528); __Pyx_GIVEREF(__pyx_tuple__528); /* "include/color_dict.pxi":522 * 'orchid3' : (205, 105, 201), * 'orchid4' : (139, 71, 137), * 'palegoldenrod' : (238, 232, 170), # <<<<<<<<<<<<<< * 'palegreen' : (152, 251, 152), * 'palegreen1' : (154, 255, 154), */ __pyx_tuple__529 = PyTuple_Pack(3, __pyx_int_238, __pyx_int_232, __pyx_int_170); if (unlikely(!__pyx_tuple__529)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 522; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_tuple__529); __Pyx_GIVEREF(__pyx_tuple__529); /* "include/color_dict.pxi":523 * 'orchid4' : (139, 71, 137), * 'palegoldenrod' : (238, 232, 170), * 'palegreen' : (152, 251, 152), # <<<<<<<<<<<<<< * 'palegreen1' : (154, 255, 154), * 'palegreen2' : (144, 238, 144), */ __pyx_tuple__530 = PyTuple_Pack(3, __pyx_int_152, __pyx_int_251, __pyx_int_152); if (unlikely(!__pyx_tuple__530)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 523; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_tuple__530); __Pyx_GIVEREF(__pyx_tuple__530); /* "include/color_dict.pxi":524 * 'palegoldenrod' : (238, 232, 170), * 'palegreen' : (152, 251, 152), * 'palegreen1' : (154, 255, 154), # <<<<<<<<<<<<<< * 'palegreen2' : (144, 238, 144), * 'palegreen3' : (124, 205, 124), */ __pyx_tuple__531 = PyTuple_Pack(3, __pyx_int_154, __pyx_int_255, __pyx_int_154); if (unlikely(!__pyx_tuple__531)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 524; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_tuple__531); __Pyx_GIVEREF(__pyx_tuple__531); /* "include/color_dict.pxi":525 * 'palegreen' : (152, 251, 152), * 'palegreen1' : (154, 255, 154), * 'palegreen2' : (144, 238, 144), # <<<<<<<<<<<<<< * 'palegreen3' : (124, 205, 124), * 'palegreen4' : (84, 139, 84), */ __pyx_tuple__532 = PyTuple_Pack(3, __pyx_int_144, __pyx_int_238, __pyx_int_144); if (unlikely(!__pyx_tuple__532)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 525; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_tuple__532); __Pyx_GIVEREF(__pyx_tuple__532); /* "include/color_dict.pxi":526 * 'palegreen1' : (154, 255, 154), * 'palegreen2' : (144, 238, 144), * 'palegreen3' : (124, 205, 124), # <<<<<<<<<<<<<< * 'palegreen4' : (84, 139, 84), * 'paleturquoise' : (175, 238, 238), */ __pyx_tuple__533 = PyTuple_Pack(3, __pyx_int_124, __pyx_int_205, __pyx_int_124); if (unlikely(!__pyx_tuple__533)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 526; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_tuple__533); __Pyx_GIVEREF(__pyx_tuple__533); /* "include/color_dict.pxi":527 * 'palegreen2' : (144, 238, 144), * 'palegreen3' : (124, 205, 124), * 'palegreen4' : (84, 139, 84), # <<<<<<<<<<<<<< * 'paleturquoise' : (175, 238, 238), * 'paleturquoise1' : (187, 255, 255), */ __pyx_tuple__534 = PyTuple_Pack(3, __pyx_int_84, __pyx_int_139, __pyx_int_84); if (unlikely(!__pyx_tuple__534)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 527; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_tuple__534); __Pyx_GIVEREF(__pyx_tuple__534); /* "include/color_dict.pxi":528 * 'palegreen3' : (124, 205, 124), * 'palegreen4' : (84, 139, 84), * 'paleturquoise' : (175, 238, 238), # <<<<<<<<<<<<<< * 'paleturquoise1' : (187, 255, 255), * 'paleturquoise2' : (174, 238, 238), */ __pyx_tuple__535 = PyTuple_Pack(3, __pyx_int_175, __pyx_int_238, __pyx_int_238); if (unlikely(!__pyx_tuple__535)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 528; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_tuple__535); __Pyx_GIVEREF(__pyx_tuple__535); /* "include/color_dict.pxi":529 * 'palegreen4' : (84, 139, 84), * 'paleturquoise' : (175, 238, 238), * 'paleturquoise1' : (187, 255, 255), # <<<<<<<<<<<<<< * 'paleturquoise2' : (174, 238, 238), * 'paleturquoise3' : (150, 205, 205), */ __pyx_tuple__536 = PyTuple_Pack(3, __pyx_int_187, __pyx_int_255, __pyx_int_255); if (unlikely(!__pyx_tuple__536)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 529; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_tuple__536); __Pyx_GIVEREF(__pyx_tuple__536); /* "include/color_dict.pxi":530 * 'paleturquoise' : (175, 238, 238), * 'paleturquoise1' : (187, 255, 255), * 'paleturquoise2' : (174, 238, 238), # <<<<<<<<<<<<<< * 'paleturquoise3' : (150, 205, 205), * 'paleturquoise4' : (102, 139, 139), */ __pyx_tuple__537 = PyTuple_Pack(3, __pyx_int_174, __pyx_int_238, __pyx_int_238); if (unlikely(!__pyx_tuple__537)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 530; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_tuple__537); __Pyx_GIVEREF(__pyx_tuple__537); /* "include/color_dict.pxi":531 * 'paleturquoise1' : (187, 255, 255), * 'paleturquoise2' : (174, 238, 238), * 'paleturquoise3' : (150, 205, 205), # <<<<<<<<<<<<<< * 'paleturquoise4' : (102, 139, 139), * 'palevioletred' : (219, 112, 147), */ __pyx_tuple__538 = PyTuple_Pack(3, __pyx_int_150, __pyx_int_205, __pyx_int_205); if (unlikely(!__pyx_tuple__538)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 531; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_tuple__538); __Pyx_GIVEREF(__pyx_tuple__538); /* "include/color_dict.pxi":532 * 'paleturquoise2' : (174, 238, 238), * 'paleturquoise3' : (150, 205, 205), * 'paleturquoise4' : (102, 139, 139), # <<<<<<<<<<<<<< * 'palevioletred' : (219, 112, 147), * 'palevioletred1' : (255, 130, 171), */ __pyx_tuple__539 = PyTuple_Pack(3, __pyx_int_102, __pyx_int_139, __pyx_int_139); if (unlikely(!__pyx_tuple__539)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 532; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_tuple__539); __Pyx_GIVEREF(__pyx_tuple__539); /* "include/color_dict.pxi":533 * 'paleturquoise3' : (150, 205, 205), * 'paleturquoise4' : (102, 139, 139), * 'palevioletred' : (219, 112, 147), # <<<<<<<<<<<<<< * 'palevioletred1' : (255, 130, 171), * 'palevioletred2' : (238, 121, 159), */ __pyx_tuple__540 = PyTuple_Pack(3, __pyx_int_219, __pyx_int_112, __pyx_int_147); if (unlikely(!__pyx_tuple__540)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 533; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_tuple__540); __Pyx_GIVEREF(__pyx_tuple__540); /* "include/color_dict.pxi":534 * 'paleturquoise4' : (102, 139, 139), * 'palevioletred' : (219, 112, 147), * 'palevioletred1' : (255, 130, 171), # <<<<<<<<<<<<<< * 'palevioletred2' : (238, 121, 159), * 'palevioletred3' : (205, 104, 137), */ __pyx_tuple__541 = PyTuple_Pack(3, __pyx_int_255, __pyx_int_130, __pyx_int_171); if (unlikely(!__pyx_tuple__541)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 534; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_tuple__541); __Pyx_GIVEREF(__pyx_tuple__541); /* "include/color_dict.pxi":535 * 'palevioletred' : (219, 112, 147), * 'palevioletred1' : (255, 130, 171), * 'palevioletred2' : (238, 121, 159), # <<<<<<<<<<<<<< * 'palevioletred3' : (205, 104, 137), * 'palevioletred4' : (139, 71, 93), */ __pyx_tuple__542 = PyTuple_Pack(3, __pyx_int_238, __pyx_int_121, __pyx_int_159); if (unlikely(!__pyx_tuple__542)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 535; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_tuple__542); __Pyx_GIVEREF(__pyx_tuple__542); /* "include/color_dict.pxi":536 * 'palevioletred1' : (255, 130, 171), * 'palevioletred2' : (238, 121, 159), * 'palevioletred3' : (205, 104, 137), # <<<<<<<<<<<<<< * 'palevioletred4' : (139, 71, 93), * 'papayawhip' : (255, 239, 213), */ __pyx_tuple__543 = PyTuple_Pack(3, __pyx_int_205, __pyx_int_104, __pyx_int_137); if (unlikely(!__pyx_tuple__543)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 536; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_tuple__543); __Pyx_GIVEREF(__pyx_tuple__543); /* "include/color_dict.pxi":537 * 'palevioletred2' : (238, 121, 159), * 'palevioletred3' : (205, 104, 137), * 'palevioletred4' : (139, 71, 93), # <<<<<<<<<<<<<< * 'papayawhip' : (255, 239, 213), * 'peachpuff' : (255, 218, 185), */ __pyx_tuple__544 = PyTuple_Pack(3, __pyx_int_139, __pyx_int_71, __pyx_int_93); if (unlikely(!__pyx_tuple__544)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 537; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_tuple__544); __Pyx_GIVEREF(__pyx_tuple__544); /* "include/color_dict.pxi":538 * 'palevioletred3' : (205, 104, 137), * 'palevioletred4' : (139, 71, 93), * 'papayawhip' : (255, 239, 213), # <<<<<<<<<<<<<< * 'peachpuff' : (255, 218, 185), * 'peachpuff1' : (255, 218, 185), */ __pyx_tuple__545 = PyTuple_Pack(3, __pyx_int_255, __pyx_int_239, __pyx_int_213); if (unlikely(!__pyx_tuple__545)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 538; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_tuple__545); __Pyx_GIVEREF(__pyx_tuple__545); /* "include/color_dict.pxi":539 * 'palevioletred4' : (139, 71, 93), * 'papayawhip' : (255, 239, 213), * 'peachpuff' : (255, 218, 185), # <<<<<<<<<<<<<< * 'peachpuff1' : (255, 218, 185), * 'peachpuff2' : (238, 203, 173), */ __pyx_tuple__546 = PyTuple_Pack(3, __pyx_int_255, __pyx_int_218, __pyx_int_185); if (unlikely(!__pyx_tuple__546)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 539; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_tuple__546); __Pyx_GIVEREF(__pyx_tuple__546); /* "include/color_dict.pxi":540 * 'papayawhip' : (255, 239, 213), * 'peachpuff' : (255, 218, 185), * 'peachpuff1' : (255, 218, 185), # <<<<<<<<<<<<<< * 'peachpuff2' : (238, 203, 173), * 'peachpuff3' : (205, 175, 149), */ __pyx_tuple__547 = PyTuple_Pack(3, __pyx_int_255, __pyx_int_218, __pyx_int_185); if (unlikely(!__pyx_tuple__547)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 540; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_tuple__547); __Pyx_GIVEREF(__pyx_tuple__547); /* "include/color_dict.pxi":541 * 'peachpuff' : (255, 218, 185), * 'peachpuff1' : (255, 218, 185), * 'peachpuff2' : (238, 203, 173), # <<<<<<<<<<<<<< * 'peachpuff3' : (205, 175, 149), * 'peachpuff4' : (139, 119, 101), */ __pyx_tuple__548 = PyTuple_Pack(3, __pyx_int_238, __pyx_int_203, __pyx_int_173); if (unlikely(!__pyx_tuple__548)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 541; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_tuple__548); __Pyx_GIVEREF(__pyx_tuple__548); /* "include/color_dict.pxi":542 * 'peachpuff1' : (255, 218, 185), * 'peachpuff2' : (238, 203, 173), * 'peachpuff3' : (205, 175, 149), # <<<<<<<<<<<<<< * 'peachpuff4' : (139, 119, 101), * 'peru' : (205, 133, 63), */ __pyx_tuple__549 = PyTuple_Pack(3, __pyx_int_205, __pyx_int_175, __pyx_int_149); if (unlikely(!__pyx_tuple__549)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 542; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_tuple__549); __Pyx_GIVEREF(__pyx_tuple__549); /* "include/color_dict.pxi":543 * 'peachpuff2' : (238, 203, 173), * 'peachpuff3' : (205, 175, 149), * 'peachpuff4' : (139, 119, 101), # <<<<<<<<<<<<<< * 'peru' : (205, 133, 63), * 'pink' : (255, 192, 203), */ __pyx_tuple__550 = PyTuple_Pack(3, __pyx_int_139, __pyx_int_119, __pyx_int_101); if (unlikely(!__pyx_tuple__550)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 543; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_tuple__550); __Pyx_GIVEREF(__pyx_tuple__550); /* "include/color_dict.pxi":544 * 'peachpuff3' : (205, 175, 149), * 'peachpuff4' : (139, 119, 101), * 'peru' : (205, 133, 63), # <<<<<<<<<<<<<< * 'pink' : (255, 192, 203), * 'pink1' : (255, 181, 197), */ __pyx_tuple__551 = PyTuple_Pack(3, __pyx_int_205, __pyx_int_133, __pyx_int_63); if (unlikely(!__pyx_tuple__551)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 544; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_tuple__551); __Pyx_GIVEREF(__pyx_tuple__551); /* "include/color_dict.pxi":545 * 'peachpuff4' : (139, 119, 101), * 'peru' : (205, 133, 63), * 'pink' : (255, 192, 203), # <<<<<<<<<<<<<< * 'pink1' : (255, 181, 197), * 'pink2' : (238, 169, 184), */ __pyx_tuple__552 = PyTuple_Pack(3, __pyx_int_255, __pyx_int_192, __pyx_int_203); if (unlikely(!__pyx_tuple__552)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 545; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_tuple__552); __Pyx_GIVEREF(__pyx_tuple__552); /* "include/color_dict.pxi":546 * 'peru' : (205, 133, 63), * 'pink' : (255, 192, 203), * 'pink1' : (255, 181, 197), # <<<<<<<<<<<<<< * 'pink2' : (238, 169, 184), * 'pink3' : (205, 145, 158), */ __pyx_tuple__553 = PyTuple_Pack(3, __pyx_int_255, __pyx_int_181, __pyx_int_197); if (unlikely(!__pyx_tuple__553)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 546; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_tuple__553); __Pyx_GIVEREF(__pyx_tuple__553); /* "include/color_dict.pxi":547 * 'pink' : (255, 192, 203), * 'pink1' : (255, 181, 197), * 'pink2' : (238, 169, 184), # <<<<<<<<<<<<<< * 'pink3' : (205, 145, 158), * 'pink4' : (139, 99, 108), */ __pyx_tuple__554 = PyTuple_Pack(3, __pyx_int_238, __pyx_int_169, __pyx_int_184); if (unlikely(!__pyx_tuple__554)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 547; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_tuple__554); __Pyx_GIVEREF(__pyx_tuple__554); /* "include/color_dict.pxi":548 * 'pink1' : (255, 181, 197), * 'pink2' : (238, 169, 184), * 'pink3' : (205, 145, 158), # <<<<<<<<<<<<<< * 'pink4' : (139, 99, 108), * 'plum' : (221, 160, 221), */ __pyx_tuple__555 = PyTuple_Pack(3, __pyx_int_205, __pyx_int_145, __pyx_int_158); if (unlikely(!__pyx_tuple__555)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 548; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_tuple__555); __Pyx_GIVEREF(__pyx_tuple__555); /* "include/color_dict.pxi":549 * 'pink2' : (238, 169, 184), * 'pink3' : (205, 145, 158), * 'pink4' : (139, 99, 108), # <<<<<<<<<<<<<< * 'plum' : (221, 160, 221), * 'plum1' : (255, 187, 255), */ __pyx_tuple__556 = PyTuple_Pack(3, __pyx_int_139, __pyx_int_99, __pyx_int_108); if (unlikely(!__pyx_tuple__556)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 549; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_tuple__556); __Pyx_GIVEREF(__pyx_tuple__556); /* "include/color_dict.pxi":550 * 'pink3' : (205, 145, 158), * 'pink4' : (139, 99, 108), * 'plum' : (221, 160, 221), # <<<<<<<<<<<<<< * 'plum1' : (255, 187, 255), * 'plum2' : (238, 174, 238), */ __pyx_tuple__557 = PyTuple_Pack(3, __pyx_int_221, __pyx_int_160, __pyx_int_221); if (unlikely(!__pyx_tuple__557)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 550; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_tuple__557); __Pyx_GIVEREF(__pyx_tuple__557); /* "include/color_dict.pxi":551 * 'pink4' : (139, 99, 108), * 'plum' : (221, 160, 221), * 'plum1' : (255, 187, 255), # <<<<<<<<<<<<<< * 'plum2' : (238, 174, 238), * 'plum3' : (205, 150, 205), */ __pyx_tuple__558 = PyTuple_Pack(3, __pyx_int_255, __pyx_int_187, __pyx_int_255); if (unlikely(!__pyx_tuple__558)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 551; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_tuple__558); __Pyx_GIVEREF(__pyx_tuple__558); /* "include/color_dict.pxi":552 * 'plum' : (221, 160, 221), * 'plum1' : (255, 187, 255), * 'plum2' : (238, 174, 238), # <<<<<<<<<<<<<< * 'plum3' : (205, 150, 205), * 'plum4' : (139, 102, 139), */ __pyx_tuple__559 = PyTuple_Pack(3, __pyx_int_238, __pyx_int_174, __pyx_int_238); if (unlikely(!__pyx_tuple__559)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 552; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_tuple__559); __Pyx_GIVEREF(__pyx_tuple__559); /* "include/color_dict.pxi":553 * 'plum1' : (255, 187, 255), * 'plum2' : (238, 174, 238), * 'plum3' : (205, 150, 205), # <<<<<<<<<<<<<< * 'plum4' : (139, 102, 139), * 'powderblue' : (176, 224, 230), */ __pyx_tuple__560 = PyTuple_Pack(3, __pyx_int_205, __pyx_int_150, __pyx_int_205); if (unlikely(!__pyx_tuple__560)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 553; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_tuple__560); __Pyx_GIVEREF(__pyx_tuple__560); /* "include/color_dict.pxi":554 * 'plum2' : (238, 174, 238), * 'plum3' : (205, 150, 205), * 'plum4' : (139, 102, 139), # <<<<<<<<<<<<<< * 'powderblue' : (176, 224, 230), * 'purple' : (160, 32, 240), */ __pyx_tuple__561 = PyTuple_Pack(3, __pyx_int_139, __pyx_int_102, __pyx_int_139); if (unlikely(!__pyx_tuple__561)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 554; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_tuple__561); __Pyx_GIVEREF(__pyx_tuple__561); /* "include/color_dict.pxi":555 * 'plum3' : (205, 150, 205), * 'plum4' : (139, 102, 139), * 'powderblue' : (176, 224, 230), # <<<<<<<<<<<<<< * 'purple' : (160, 32, 240), * 'purple1' : (155, 48, 255), */ __pyx_tuple__562 = PyTuple_Pack(3, __pyx_int_176, __pyx_int_224, __pyx_int_230); if (unlikely(!__pyx_tuple__562)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 555; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_tuple__562); __Pyx_GIVEREF(__pyx_tuple__562); /* "include/color_dict.pxi":556 * 'plum4' : (139, 102, 139), * 'powderblue' : (176, 224, 230), * 'purple' : (160, 32, 240), # <<<<<<<<<<<<<< * 'purple1' : (155, 48, 255), * 'purple2' : (145, 44, 238), */ __pyx_tuple__563 = PyTuple_Pack(3, __pyx_int_160, __pyx_int_32, __pyx_int_240); if (unlikely(!__pyx_tuple__563)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 556; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_tuple__563); __Pyx_GIVEREF(__pyx_tuple__563); /* "include/color_dict.pxi":557 * 'powderblue' : (176, 224, 230), * 'purple' : (160, 32, 240), * 'purple1' : (155, 48, 255), # <<<<<<<<<<<<<< * 'purple2' : (145, 44, 238), * 'purple3' : (125, 38, 205), */ __pyx_tuple__564 = PyTuple_Pack(3, __pyx_int_155, __pyx_int_48, __pyx_int_255); if (unlikely(!__pyx_tuple__564)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 557; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_tuple__564); __Pyx_GIVEREF(__pyx_tuple__564); /* "include/color_dict.pxi":558 * 'purple' : (160, 32, 240), * 'purple1' : (155, 48, 255), * 'purple2' : (145, 44, 238), # <<<<<<<<<<<<<< * 'purple3' : (125, 38, 205), * 'purple4' : (85, 26, 139), */ __pyx_tuple__565 = PyTuple_Pack(3, __pyx_int_145, __pyx_int_44, __pyx_int_238); if (unlikely(!__pyx_tuple__565)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 558; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_tuple__565); __Pyx_GIVEREF(__pyx_tuple__565); /* "include/color_dict.pxi":559 * 'purple1' : (155, 48, 255), * 'purple2' : (145, 44, 238), * 'purple3' : (125, 38, 205), # <<<<<<<<<<<<<< * 'purple4' : (85, 26, 139), * 'rebeccapurple' : (102, 51, 153), */ __pyx_tuple__566 = PyTuple_Pack(3, __pyx_int_125, __pyx_int_38, __pyx_int_205); if (unlikely(!__pyx_tuple__566)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 559; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_tuple__566); __Pyx_GIVEREF(__pyx_tuple__566); /* "include/color_dict.pxi":560 * 'purple2' : (145, 44, 238), * 'purple3' : (125, 38, 205), * 'purple4' : (85, 26, 139), # <<<<<<<<<<<<<< * 'rebeccapurple' : (102, 51, 153), * 'red' : (255, 0, 0), */ __pyx_tuple__567 = PyTuple_Pack(3, __pyx_int_85, __pyx_int_26, __pyx_int_139); if (unlikely(!__pyx_tuple__567)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 560; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_tuple__567); __Pyx_GIVEREF(__pyx_tuple__567); /* "include/color_dict.pxi":561 * 'purple3' : (125, 38, 205), * 'purple4' : (85, 26, 139), * 'rebeccapurple' : (102, 51, 153), # <<<<<<<<<<<<<< * 'red' : (255, 0, 0), * 'red1' : (255, 0, 0), */ __pyx_tuple__568 = PyTuple_Pack(3, __pyx_int_102, __pyx_int_51, __pyx_int_153); if (unlikely(!__pyx_tuple__568)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 561; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_tuple__568); __Pyx_GIVEREF(__pyx_tuple__568); /* "include/color_dict.pxi":562 * 'purple4' : (85, 26, 139), * 'rebeccapurple' : (102, 51, 153), * 'red' : (255, 0, 0), # <<<<<<<<<<<<<< * 'red1' : (255, 0, 0), * 'red2' : (238, 0, 0), */ __pyx_tuple__569 = PyTuple_Pack(3, __pyx_int_255, __pyx_int_0, __pyx_int_0); if (unlikely(!__pyx_tuple__569)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 562; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_tuple__569); __Pyx_GIVEREF(__pyx_tuple__569); /* "include/color_dict.pxi":563 * 'rebeccapurple' : (102, 51, 153), * 'red' : (255, 0, 0), * 'red1' : (255, 0, 0), # <<<<<<<<<<<<<< * 'red2' : (238, 0, 0), * 'red3' : (205, 0, 0), */ __pyx_tuple__570 = PyTuple_Pack(3, __pyx_int_255, __pyx_int_0, __pyx_int_0); if (unlikely(!__pyx_tuple__570)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 563; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_tuple__570); __Pyx_GIVEREF(__pyx_tuple__570); /* "include/color_dict.pxi":564 * 'red' : (255, 0, 0), * 'red1' : (255, 0, 0), * 'red2' : (238, 0, 0), # <<<<<<<<<<<<<< * 'red3' : (205, 0, 0), * 'red4' : (139, 0, 0), */ __pyx_tuple__571 = PyTuple_Pack(3, __pyx_int_238, __pyx_int_0, __pyx_int_0); if (unlikely(!__pyx_tuple__571)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 564; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_tuple__571); __Pyx_GIVEREF(__pyx_tuple__571); /* "include/color_dict.pxi":565 * 'red1' : (255, 0, 0), * 'red2' : (238, 0, 0), * 'red3' : (205, 0, 0), # <<<<<<<<<<<<<< * 'red4' : (139, 0, 0), * 'rosybrown' : (188, 143, 143), */ __pyx_tuple__572 = PyTuple_Pack(3, __pyx_int_205, __pyx_int_0, __pyx_int_0); if (unlikely(!__pyx_tuple__572)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 565; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_tuple__572); __Pyx_GIVEREF(__pyx_tuple__572); /* "include/color_dict.pxi":566 * 'red2' : (238, 0, 0), * 'red3' : (205, 0, 0), * 'red4' : (139, 0, 0), # <<<<<<<<<<<<<< * 'rosybrown' : (188, 143, 143), * 'rosybrown1' : (255, 193, 193), */ __pyx_tuple__573 = PyTuple_Pack(3, __pyx_int_139, __pyx_int_0, __pyx_int_0); if (unlikely(!__pyx_tuple__573)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 566; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_tuple__573); __Pyx_GIVEREF(__pyx_tuple__573); /* "include/color_dict.pxi":567 * 'red3' : (205, 0, 0), * 'red4' : (139, 0, 0), * 'rosybrown' : (188, 143, 143), # <<<<<<<<<<<<<< * 'rosybrown1' : (255, 193, 193), * 'rosybrown2' : (238, 180, 180), */ __pyx_tuple__574 = PyTuple_Pack(3, __pyx_int_188, __pyx_int_143, __pyx_int_143); if (unlikely(!__pyx_tuple__574)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 567; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_tuple__574); __Pyx_GIVEREF(__pyx_tuple__574); /* "include/color_dict.pxi":568 * 'red4' : (139, 0, 0), * 'rosybrown' : (188, 143, 143), * 'rosybrown1' : (255, 193, 193), # <<<<<<<<<<<<<< * 'rosybrown2' : (238, 180, 180), * 'rosybrown3' : (205, 155, 155), */ __pyx_tuple__575 = PyTuple_Pack(3, __pyx_int_255, __pyx_int_193, __pyx_int_193); if (unlikely(!__pyx_tuple__575)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 568; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_tuple__575); __Pyx_GIVEREF(__pyx_tuple__575); /* "include/color_dict.pxi":569 * 'rosybrown' : (188, 143, 143), * 'rosybrown1' : (255, 193, 193), * 'rosybrown2' : (238, 180, 180), # <<<<<<<<<<<<<< * 'rosybrown3' : (205, 155, 155), * 'rosybrown4' : (139, 105, 105), */ __pyx_tuple__576 = PyTuple_Pack(3, __pyx_int_238, __pyx_int_180, __pyx_int_180); if (unlikely(!__pyx_tuple__576)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 569; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_tuple__576); __Pyx_GIVEREF(__pyx_tuple__576); /* "include/color_dict.pxi":570 * 'rosybrown1' : (255, 193, 193), * 'rosybrown2' : (238, 180, 180), * 'rosybrown3' : (205, 155, 155), # <<<<<<<<<<<<<< * 'rosybrown4' : (139, 105, 105), * 'royalblue' : (65, 105, 225), */ __pyx_tuple__577 = PyTuple_Pack(3, __pyx_int_205, __pyx_int_155, __pyx_int_155); if (unlikely(!__pyx_tuple__577)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 570; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_tuple__577); __Pyx_GIVEREF(__pyx_tuple__577); /* "include/color_dict.pxi":571 * 'rosybrown2' : (238, 180, 180), * 'rosybrown3' : (205, 155, 155), * 'rosybrown4' : (139, 105, 105), # <<<<<<<<<<<<<< * 'royalblue' : (65, 105, 225), * 'royalblue1' : (72, 118, 255), */ __pyx_tuple__578 = PyTuple_Pack(3, __pyx_int_139, __pyx_int_105, __pyx_int_105); if (unlikely(!__pyx_tuple__578)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 571; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_tuple__578); __Pyx_GIVEREF(__pyx_tuple__578); /* "include/color_dict.pxi":572 * 'rosybrown3' : (205, 155, 155), * 'rosybrown4' : (139, 105, 105), * 'royalblue' : (65, 105, 225), # <<<<<<<<<<<<<< * 'royalblue1' : (72, 118, 255), * 'royalblue2' : (67, 110, 238), */ __pyx_tuple__579 = PyTuple_Pack(3, __pyx_int_65, __pyx_int_105, __pyx_int_225); if (unlikely(!__pyx_tuple__579)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 572; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_tuple__579); __Pyx_GIVEREF(__pyx_tuple__579); /* "include/color_dict.pxi":573 * 'rosybrown4' : (139, 105, 105), * 'royalblue' : (65, 105, 225), * 'royalblue1' : (72, 118, 255), # <<<<<<<<<<<<<< * 'royalblue2' : (67, 110, 238), * 'royalblue3' : (58, 95, 205), */ __pyx_tuple__580 = PyTuple_Pack(3, __pyx_int_72, __pyx_int_118, __pyx_int_255); if (unlikely(!__pyx_tuple__580)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 573; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_tuple__580); __Pyx_GIVEREF(__pyx_tuple__580); /* "include/color_dict.pxi":574 * 'royalblue' : (65, 105, 225), * 'royalblue1' : (72, 118, 255), * 'royalblue2' : (67, 110, 238), # <<<<<<<<<<<<<< * 'royalblue3' : (58, 95, 205), * 'royalblue4' : (39, 64, 139), */ __pyx_tuple__581 = PyTuple_Pack(3, __pyx_int_67, __pyx_int_110, __pyx_int_238); if (unlikely(!__pyx_tuple__581)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 574; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_tuple__581); __Pyx_GIVEREF(__pyx_tuple__581); /* "include/color_dict.pxi":575 * 'royalblue1' : (72, 118, 255), * 'royalblue2' : (67, 110, 238), * 'royalblue3' : (58, 95, 205), # <<<<<<<<<<<<<< * 'royalblue4' : (39, 64, 139), * 'saddlebrown' : (139, 69, 19), */ __pyx_tuple__582 = PyTuple_Pack(3, __pyx_int_58, __pyx_int_95, __pyx_int_205); if (unlikely(!__pyx_tuple__582)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 575; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_tuple__582); __Pyx_GIVEREF(__pyx_tuple__582); /* "include/color_dict.pxi":576 * 'royalblue2' : (67, 110, 238), * 'royalblue3' : (58, 95, 205), * 'royalblue4' : (39, 64, 139), # <<<<<<<<<<<<<< * 'saddlebrown' : (139, 69, 19), * 'salmon' : (250, 128, 114), */ __pyx_tuple__583 = PyTuple_Pack(3, __pyx_int_39, __pyx_int_64, __pyx_int_139); if (unlikely(!__pyx_tuple__583)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 576; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_tuple__583); __Pyx_GIVEREF(__pyx_tuple__583); /* "include/color_dict.pxi":577 * 'royalblue3' : (58, 95, 205), * 'royalblue4' : (39, 64, 139), * 'saddlebrown' : (139, 69, 19), # <<<<<<<<<<<<<< * 'salmon' : (250, 128, 114), * 'salmon1' : (255, 140, 105), */ __pyx_tuple__584 = PyTuple_Pack(3, __pyx_int_139, __pyx_int_69, __pyx_int_19); if (unlikely(!__pyx_tuple__584)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 577; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_tuple__584); __Pyx_GIVEREF(__pyx_tuple__584); /* "include/color_dict.pxi":578 * 'royalblue4' : (39, 64, 139), * 'saddlebrown' : (139, 69, 19), * 'salmon' : (250, 128, 114), # <<<<<<<<<<<<<< * 'salmon1' : (255, 140, 105), * 'salmon2' : (238, 130, 98), */ __pyx_tuple__585 = PyTuple_Pack(3, __pyx_int_250, __pyx_int_128, __pyx_int_114); if (unlikely(!__pyx_tuple__585)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 578; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_tuple__585); __Pyx_GIVEREF(__pyx_tuple__585); /* "include/color_dict.pxi":579 * 'saddlebrown' : (139, 69, 19), * 'salmon' : (250, 128, 114), * 'salmon1' : (255, 140, 105), # <<<<<<<<<<<<<< * 'salmon2' : (238, 130, 98), * 'salmon3' : (205, 112, 84), */ __pyx_tuple__586 = PyTuple_Pack(3, __pyx_int_255, __pyx_int_140, __pyx_int_105); if (unlikely(!__pyx_tuple__586)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 579; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_tuple__586); __Pyx_GIVEREF(__pyx_tuple__586); /* "include/color_dict.pxi":580 * 'salmon' : (250, 128, 114), * 'salmon1' : (255, 140, 105), * 'salmon2' : (238, 130, 98), # <<<<<<<<<<<<<< * 'salmon3' : (205, 112, 84), * 'salmon4' : (139, 76, 57), */ __pyx_tuple__587 = PyTuple_Pack(3, __pyx_int_238, __pyx_int_130, __pyx_int_98); if (unlikely(!__pyx_tuple__587)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 580; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_tuple__587); __Pyx_GIVEREF(__pyx_tuple__587); /* "include/color_dict.pxi":581 * 'salmon1' : (255, 140, 105), * 'salmon2' : (238, 130, 98), * 'salmon3' : (205, 112, 84), # <<<<<<<<<<<<<< * 'salmon4' : (139, 76, 57), * 'sandybrown' : (244, 164, 96), */ __pyx_tuple__588 = PyTuple_Pack(3, __pyx_int_205, __pyx_int_112, __pyx_int_84); if (unlikely(!__pyx_tuple__588)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 581; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_tuple__588); __Pyx_GIVEREF(__pyx_tuple__588); /* "include/color_dict.pxi":582 * 'salmon2' : (238, 130, 98), * 'salmon3' : (205, 112, 84), * 'salmon4' : (139, 76, 57), # <<<<<<<<<<<<<< * 'sandybrown' : (244, 164, 96), * 'seagreen' : (46, 139, 87), */ __pyx_tuple__589 = PyTuple_Pack(3, __pyx_int_139, __pyx_int_76, __pyx_int_57); if (unlikely(!__pyx_tuple__589)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 582; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_tuple__589); __Pyx_GIVEREF(__pyx_tuple__589); /* "include/color_dict.pxi":583 * 'salmon3' : (205, 112, 84), * 'salmon4' : (139, 76, 57), * 'sandybrown' : (244, 164, 96), # <<<<<<<<<<<<<< * 'seagreen' : (46, 139, 87), * 'seagreen1' : (84, 255, 159), */ __pyx_tuple__590 = PyTuple_Pack(3, __pyx_int_244, __pyx_int_164, __pyx_int_96); if (unlikely(!__pyx_tuple__590)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 583; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_tuple__590); __Pyx_GIVEREF(__pyx_tuple__590); /* "include/color_dict.pxi":584 * 'salmon4' : (139, 76, 57), * 'sandybrown' : (244, 164, 96), * 'seagreen' : (46, 139, 87), # <<<<<<<<<<<<<< * 'seagreen1' : (84, 255, 159), * 'seagreen2' : (78, 238, 148), */ __pyx_tuple__591 = PyTuple_Pack(3, __pyx_int_46, __pyx_int_139, __pyx_int_87); if (unlikely(!__pyx_tuple__591)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 584; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_tuple__591); __Pyx_GIVEREF(__pyx_tuple__591); /* "include/color_dict.pxi":585 * 'sandybrown' : (244, 164, 96), * 'seagreen' : (46, 139, 87), * 'seagreen1' : (84, 255, 159), # <<<<<<<<<<<<<< * 'seagreen2' : (78, 238, 148), * 'seagreen3' : (67, 205, 128), */ __pyx_tuple__592 = PyTuple_Pack(3, __pyx_int_84, __pyx_int_255, __pyx_int_159); if (unlikely(!__pyx_tuple__592)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 585; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_tuple__592); __Pyx_GIVEREF(__pyx_tuple__592); /* "include/color_dict.pxi":586 * 'seagreen' : (46, 139, 87), * 'seagreen1' : (84, 255, 159), * 'seagreen2' : (78, 238, 148), # <<<<<<<<<<<<<< * 'seagreen3' : (67, 205, 128), * 'seagreen4' : (46, 139, 87), */ __pyx_tuple__593 = PyTuple_Pack(3, __pyx_int_78, __pyx_int_238, __pyx_int_148); if (unlikely(!__pyx_tuple__593)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 586; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_tuple__593); __Pyx_GIVEREF(__pyx_tuple__593); /* "include/color_dict.pxi":587 * 'seagreen1' : (84, 255, 159), * 'seagreen2' : (78, 238, 148), * 'seagreen3' : (67, 205, 128), # <<<<<<<<<<<<<< * 'seagreen4' : (46, 139, 87), * 'seashell' : (255, 245, 238), */ __pyx_tuple__594 = PyTuple_Pack(3, __pyx_int_67, __pyx_int_205, __pyx_int_128); if (unlikely(!__pyx_tuple__594)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 587; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_tuple__594); __Pyx_GIVEREF(__pyx_tuple__594); /* "include/color_dict.pxi":588 * 'seagreen2' : (78, 238, 148), * 'seagreen3' : (67, 205, 128), * 'seagreen4' : (46, 139, 87), # <<<<<<<<<<<<<< * 'seashell' : (255, 245, 238), * 'seashell1' : (255, 245, 238), */ __pyx_tuple__595 = PyTuple_Pack(3, __pyx_int_46, __pyx_int_139, __pyx_int_87); if (unlikely(!__pyx_tuple__595)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 588; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_tuple__595); __Pyx_GIVEREF(__pyx_tuple__595); /* "include/color_dict.pxi":589 * 'seagreen3' : (67, 205, 128), * 'seagreen4' : (46, 139, 87), * 'seashell' : (255, 245, 238), # <<<<<<<<<<<<<< * 'seashell1' : (255, 245, 238), * 'seashell2' : (238, 229, 222), */ __pyx_tuple__596 = PyTuple_Pack(3, __pyx_int_255, __pyx_int_245, __pyx_int_238); if (unlikely(!__pyx_tuple__596)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 589; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_tuple__596); __Pyx_GIVEREF(__pyx_tuple__596); /* "include/color_dict.pxi":590 * 'seagreen4' : (46, 139, 87), * 'seashell' : (255, 245, 238), * 'seashell1' : (255, 245, 238), # <<<<<<<<<<<<<< * 'seashell2' : (238, 229, 222), * 'seashell3' : (205, 197, 191), */ __pyx_tuple__597 = PyTuple_Pack(3, __pyx_int_255, __pyx_int_245, __pyx_int_238); if (unlikely(!__pyx_tuple__597)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 590; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_tuple__597); __Pyx_GIVEREF(__pyx_tuple__597); /* "include/color_dict.pxi":591 * 'seashell' : (255, 245, 238), * 'seashell1' : (255, 245, 238), * 'seashell2' : (238, 229, 222), # <<<<<<<<<<<<<< * 'seashell3' : (205, 197, 191), * 'seashell4' : (139, 134, 130), */ __pyx_tuple__598 = PyTuple_Pack(3, __pyx_int_238, __pyx_int_229, __pyx_int_222); if (unlikely(!__pyx_tuple__598)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 591; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_tuple__598); __Pyx_GIVEREF(__pyx_tuple__598); /* "include/color_dict.pxi":592 * 'seashell1' : (255, 245, 238), * 'seashell2' : (238, 229, 222), * 'seashell3' : (205, 197, 191), # <<<<<<<<<<<<<< * 'seashell4' : (139, 134, 130), * 'sienna' : (160, 82, 45), */ __pyx_tuple__599 = PyTuple_Pack(3, __pyx_int_205, __pyx_int_197, __pyx_int_191); if (unlikely(!__pyx_tuple__599)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 592; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_tuple__599); __Pyx_GIVEREF(__pyx_tuple__599); /* "include/color_dict.pxi":593 * 'seashell2' : (238, 229, 222), * 'seashell3' : (205, 197, 191), * 'seashell4' : (139, 134, 130), # <<<<<<<<<<<<<< * 'sienna' : (160, 82, 45), * 'sienna1' : (255, 130, 71), */ __pyx_tuple__600 = PyTuple_Pack(3, __pyx_int_139, __pyx_int_134, __pyx_int_130); if (unlikely(!__pyx_tuple__600)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 593; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_tuple__600); __Pyx_GIVEREF(__pyx_tuple__600); /* "include/color_dict.pxi":594 * 'seashell3' : (205, 197, 191), * 'seashell4' : (139, 134, 130), * 'sienna' : (160, 82, 45), # <<<<<<<<<<<<<< * 'sienna1' : (255, 130, 71), * 'sienna2' : (238, 121, 66), */ __pyx_tuple__601 = PyTuple_Pack(3, __pyx_int_160, __pyx_int_82, __pyx_int_45); if (unlikely(!__pyx_tuple__601)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 594; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_tuple__601); __Pyx_GIVEREF(__pyx_tuple__601); /* "include/color_dict.pxi":595 * 'seashell4' : (139, 134, 130), * 'sienna' : (160, 82, 45), * 'sienna1' : (255, 130, 71), # <<<<<<<<<<<<<< * 'sienna2' : (238, 121, 66), * 'sienna3' : (205, 104, 57), */ __pyx_tuple__602 = PyTuple_Pack(3, __pyx_int_255, __pyx_int_130, __pyx_int_71); if (unlikely(!__pyx_tuple__602)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 595; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_tuple__602); __Pyx_GIVEREF(__pyx_tuple__602); /* "include/color_dict.pxi":596 * 'sienna' : (160, 82, 45), * 'sienna1' : (255, 130, 71), * 'sienna2' : (238, 121, 66), # <<<<<<<<<<<<<< * 'sienna3' : (205, 104, 57), * 'sienna4' : (139, 71, 38), */ __pyx_tuple__603 = PyTuple_Pack(3, __pyx_int_238, __pyx_int_121, __pyx_int_66); if (unlikely(!__pyx_tuple__603)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 596; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_tuple__603); __Pyx_GIVEREF(__pyx_tuple__603); /* "include/color_dict.pxi":597 * 'sienna1' : (255, 130, 71), * 'sienna2' : (238, 121, 66), * 'sienna3' : (205, 104, 57), # <<<<<<<<<<<<<< * 'sienna4' : (139, 71, 38), * 'silver' : (192, 192, 192), */ __pyx_tuple__604 = PyTuple_Pack(3, __pyx_int_205, __pyx_int_104, __pyx_int_57); if (unlikely(!__pyx_tuple__604)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 597; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_tuple__604); __Pyx_GIVEREF(__pyx_tuple__604); /* "include/color_dict.pxi":598 * 'sienna2' : (238, 121, 66), * 'sienna3' : (205, 104, 57), * 'sienna4' : (139, 71, 38), # <<<<<<<<<<<<<< * 'silver' : (192, 192, 192), * 'skyblue' : (135, 206, 235), */ __pyx_tuple__605 = PyTuple_Pack(3, __pyx_int_139, __pyx_int_71, __pyx_int_38); if (unlikely(!__pyx_tuple__605)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 598; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_tuple__605); __Pyx_GIVEREF(__pyx_tuple__605); /* "include/color_dict.pxi":599 * 'sienna3' : (205, 104, 57), * 'sienna4' : (139, 71, 38), * 'silver' : (192, 192, 192), # <<<<<<<<<<<<<< * 'skyblue' : (135, 206, 235), * 'skyblue1' : (135, 206, 255), */ __pyx_tuple__606 = PyTuple_Pack(3, __pyx_int_192, __pyx_int_192, __pyx_int_192); if (unlikely(!__pyx_tuple__606)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 599; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_tuple__606); __Pyx_GIVEREF(__pyx_tuple__606); /* "include/color_dict.pxi":600 * 'sienna4' : (139, 71, 38), * 'silver' : (192, 192, 192), * 'skyblue' : (135, 206, 235), # <<<<<<<<<<<<<< * 'skyblue1' : (135, 206, 255), * 'skyblue2' : (126, 192, 238), */ __pyx_tuple__607 = PyTuple_Pack(3, __pyx_int_135, __pyx_int_206, __pyx_int_235); if (unlikely(!__pyx_tuple__607)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 600; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_tuple__607); __Pyx_GIVEREF(__pyx_tuple__607); /* "include/color_dict.pxi":601 * 'silver' : (192, 192, 192), * 'skyblue' : (135, 206, 235), * 'skyblue1' : (135, 206, 255), # <<<<<<<<<<<<<< * 'skyblue2' : (126, 192, 238), * 'skyblue3' : (108, 166, 205), */ __pyx_tuple__608 = PyTuple_Pack(3, __pyx_int_135, __pyx_int_206, __pyx_int_255); if (unlikely(!__pyx_tuple__608)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 601; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_tuple__608); __Pyx_GIVEREF(__pyx_tuple__608); /* "include/color_dict.pxi":602 * 'skyblue' : (135, 206, 235), * 'skyblue1' : (135, 206, 255), * 'skyblue2' : (126, 192, 238), # <<<<<<<<<<<<<< * 'skyblue3' : (108, 166, 205), * 'skyblue4' : (74, 112, 139), */ __pyx_tuple__609 = PyTuple_Pack(3, __pyx_int_126, __pyx_int_192, __pyx_int_238); if (unlikely(!__pyx_tuple__609)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 602; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_tuple__609); __Pyx_GIVEREF(__pyx_tuple__609); /* "include/color_dict.pxi":603 * 'skyblue1' : (135, 206, 255), * 'skyblue2' : (126, 192, 238), * 'skyblue3' : (108, 166, 205), # <<<<<<<<<<<<<< * 'skyblue4' : (74, 112, 139), * 'slateblue' : (106, 90, 205), */ __pyx_tuple__610 = PyTuple_Pack(3, __pyx_int_108, __pyx_int_166, __pyx_int_205); if (unlikely(!__pyx_tuple__610)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 603; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_tuple__610); __Pyx_GIVEREF(__pyx_tuple__610); /* "include/color_dict.pxi":604 * 'skyblue2' : (126, 192, 238), * 'skyblue3' : (108, 166, 205), * 'skyblue4' : (74, 112, 139), # <<<<<<<<<<<<<< * 'slateblue' : (106, 90, 205), * 'slateblue1' : (131, 111, 255), */ __pyx_tuple__611 = PyTuple_Pack(3, __pyx_int_74, __pyx_int_112, __pyx_int_139); if (unlikely(!__pyx_tuple__611)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 604; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_tuple__611); __Pyx_GIVEREF(__pyx_tuple__611); /* "include/color_dict.pxi":605 * 'skyblue3' : (108, 166, 205), * 'skyblue4' : (74, 112, 139), * 'slateblue' : (106, 90, 205), # <<<<<<<<<<<<<< * 'slateblue1' : (131, 111, 255), * 'slateblue2' : (122, 103, 238), */ __pyx_tuple__612 = PyTuple_Pack(3, __pyx_int_106, __pyx_int_90, __pyx_int_205); if (unlikely(!__pyx_tuple__612)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 605; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_tuple__612); __Pyx_GIVEREF(__pyx_tuple__612); /* "include/color_dict.pxi":606 * 'skyblue4' : (74, 112, 139), * 'slateblue' : (106, 90, 205), * 'slateblue1' : (131, 111, 255), # <<<<<<<<<<<<<< * 'slateblue2' : (122, 103, 238), * 'slateblue3' : (105, 89, 205), */ __pyx_tuple__613 = PyTuple_Pack(3, __pyx_int_131, __pyx_int_111, __pyx_int_255); if (unlikely(!__pyx_tuple__613)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 606; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_tuple__613); __Pyx_GIVEREF(__pyx_tuple__613); /* "include/color_dict.pxi":607 * 'slateblue' : (106, 90, 205), * 'slateblue1' : (131, 111, 255), * 'slateblue2' : (122, 103, 238), # <<<<<<<<<<<<<< * 'slateblue3' : (105, 89, 205), * 'slateblue4' : (71, 60, 139), */ __pyx_tuple__614 = PyTuple_Pack(3, __pyx_int_122, __pyx_int_103, __pyx_int_238); if (unlikely(!__pyx_tuple__614)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 607; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_tuple__614); __Pyx_GIVEREF(__pyx_tuple__614); /* "include/color_dict.pxi":608 * 'slateblue1' : (131, 111, 255), * 'slateblue2' : (122, 103, 238), * 'slateblue3' : (105, 89, 205), # <<<<<<<<<<<<<< * 'slateblue4' : (71, 60, 139), * 'slategray' : (112, 128, 144), */ __pyx_tuple__615 = PyTuple_Pack(3, __pyx_int_105, __pyx_int_89, __pyx_int_205); if (unlikely(!__pyx_tuple__615)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 608; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_tuple__615); __Pyx_GIVEREF(__pyx_tuple__615); /* "include/color_dict.pxi":609 * 'slateblue2' : (122, 103, 238), * 'slateblue3' : (105, 89, 205), * 'slateblue4' : (71, 60, 139), # <<<<<<<<<<<<<< * 'slategray' : (112, 128, 144), * 'slategray1' : (198, 226, 255), */ __pyx_tuple__616 = PyTuple_Pack(3, __pyx_int_71, __pyx_int_60, __pyx_int_139); if (unlikely(!__pyx_tuple__616)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 609; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_tuple__616); __Pyx_GIVEREF(__pyx_tuple__616); /* "include/color_dict.pxi":610 * 'slateblue3' : (105, 89, 205), * 'slateblue4' : (71, 60, 139), * 'slategray' : (112, 128, 144), # <<<<<<<<<<<<<< * 'slategray1' : (198, 226, 255), * 'slategray2' : (185, 211, 238), */ __pyx_tuple__617 = PyTuple_Pack(3, __pyx_int_112, __pyx_int_128, __pyx_int_144); if (unlikely(!__pyx_tuple__617)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 610; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_tuple__617); __Pyx_GIVEREF(__pyx_tuple__617); /* "include/color_dict.pxi":611 * 'slateblue4' : (71, 60, 139), * 'slategray' : (112, 128, 144), * 'slategray1' : (198, 226, 255), # <<<<<<<<<<<<<< * 'slategray2' : (185, 211, 238), * 'slategray3' : (159, 182, 205), */ __pyx_tuple__618 = PyTuple_Pack(3, __pyx_int_198, __pyx_int_226, __pyx_int_255); if (unlikely(!__pyx_tuple__618)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 611; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_tuple__618); __Pyx_GIVEREF(__pyx_tuple__618); /* "include/color_dict.pxi":612 * 'slategray' : (112, 128, 144), * 'slategray1' : (198, 226, 255), * 'slategray2' : (185, 211, 238), # <<<<<<<<<<<<<< * 'slategray3' : (159, 182, 205), * 'slategray4' : (108, 123, 139), */ __pyx_tuple__619 = PyTuple_Pack(3, __pyx_int_185, __pyx_int_211, __pyx_int_238); if (unlikely(!__pyx_tuple__619)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 612; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_tuple__619); __Pyx_GIVEREF(__pyx_tuple__619); /* "include/color_dict.pxi":613 * 'slategray1' : (198, 226, 255), * 'slategray2' : (185, 211, 238), * 'slategray3' : (159, 182, 205), # <<<<<<<<<<<<<< * 'slategray4' : (108, 123, 139), * 'slategrey' : (112, 128, 144), */ __pyx_tuple__620 = PyTuple_Pack(3, __pyx_int_159, __pyx_int_182, __pyx_int_205); if (unlikely(!__pyx_tuple__620)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 613; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_tuple__620); __Pyx_GIVEREF(__pyx_tuple__620); /* "include/color_dict.pxi":614 * 'slategray2' : (185, 211, 238), * 'slategray3' : (159, 182, 205), * 'slategray4' : (108, 123, 139), # <<<<<<<<<<<<<< * 'slategrey' : (112, 128, 144), * 'snow' : (255, 250, 250), */ __pyx_tuple__621 = PyTuple_Pack(3, __pyx_int_108, __pyx_int_123, __pyx_int_139); if (unlikely(!__pyx_tuple__621)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 614; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_tuple__621); __Pyx_GIVEREF(__pyx_tuple__621); /* "include/color_dict.pxi":615 * 'slategray3' : (159, 182, 205), * 'slategray4' : (108, 123, 139), * 'slategrey' : (112, 128, 144), # <<<<<<<<<<<<<< * 'snow' : (255, 250, 250), * 'snow1' : (255, 250, 250), */ __pyx_tuple__622 = PyTuple_Pack(3, __pyx_int_112, __pyx_int_128, __pyx_int_144); if (unlikely(!__pyx_tuple__622)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 615; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_tuple__622); __Pyx_GIVEREF(__pyx_tuple__622); /* "include/color_dict.pxi":616 * 'slategray4' : (108, 123, 139), * 'slategrey' : (112, 128, 144), * 'snow' : (255, 250, 250), # <<<<<<<<<<<<<< * 'snow1' : (255, 250, 250), * 'snow2' : (238, 233, 233), */ __pyx_tuple__623 = PyTuple_Pack(3, __pyx_int_255, __pyx_int_250, __pyx_int_250); if (unlikely(!__pyx_tuple__623)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 616; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_tuple__623); __Pyx_GIVEREF(__pyx_tuple__623); /* "include/color_dict.pxi":617 * 'slategrey' : (112, 128, 144), * 'snow' : (255, 250, 250), * 'snow1' : (255, 250, 250), # <<<<<<<<<<<<<< * 'snow2' : (238, 233, 233), * 'snow3' : (205, 201, 201), */ __pyx_tuple__624 = PyTuple_Pack(3, __pyx_int_255, __pyx_int_250, __pyx_int_250); if (unlikely(!__pyx_tuple__624)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 617; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_tuple__624); __Pyx_GIVEREF(__pyx_tuple__624); /* "include/color_dict.pxi":618 * 'snow' : (255, 250, 250), * 'snow1' : (255, 250, 250), * 'snow2' : (238, 233, 233), # <<<<<<<<<<<<<< * 'snow3' : (205, 201, 201), * 'snow4' : (139, 137, 137), */ __pyx_tuple__625 = PyTuple_Pack(3, __pyx_int_238, __pyx_int_233, __pyx_int_233); if (unlikely(!__pyx_tuple__625)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 618; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_tuple__625); __Pyx_GIVEREF(__pyx_tuple__625); /* "include/color_dict.pxi":619 * 'snow1' : (255, 250, 250), * 'snow2' : (238, 233, 233), * 'snow3' : (205, 201, 201), # <<<<<<<<<<<<<< * 'snow4' : (139, 137, 137), * 'springgreen' : (0, 255, 127), */ __pyx_tuple__626 = PyTuple_Pack(3, __pyx_int_205, __pyx_int_201, __pyx_int_201); if (unlikely(!__pyx_tuple__626)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 619; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_tuple__626); __Pyx_GIVEREF(__pyx_tuple__626); /* "include/color_dict.pxi":620 * 'snow2' : (238, 233, 233), * 'snow3' : (205, 201, 201), * 'snow4' : (139, 137, 137), # <<<<<<<<<<<<<< * 'springgreen' : (0, 255, 127), * 'springgreen1' : (0, 255, 127), */ __pyx_tuple__627 = PyTuple_Pack(3, __pyx_int_139, __pyx_int_137, __pyx_int_137); if (unlikely(!__pyx_tuple__627)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 620; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_tuple__627); __Pyx_GIVEREF(__pyx_tuple__627); /* "include/color_dict.pxi":621 * 'snow3' : (205, 201, 201), * 'snow4' : (139, 137, 137), * 'springgreen' : (0, 255, 127), # <<<<<<<<<<<<<< * 'springgreen1' : (0, 255, 127), * 'springgreen2' : (0, 238, 118), */ __pyx_tuple__628 = PyTuple_Pack(3, __pyx_int_0, __pyx_int_255, __pyx_int_127); if (unlikely(!__pyx_tuple__628)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 621; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_tuple__628); __Pyx_GIVEREF(__pyx_tuple__628); /* "include/color_dict.pxi":622 * 'snow4' : (139, 137, 137), * 'springgreen' : (0, 255, 127), * 'springgreen1' : (0, 255, 127), # <<<<<<<<<<<<<< * 'springgreen2' : (0, 238, 118), * 'springgreen3' : (0, 205, 102), */ __pyx_tuple__629 = PyTuple_Pack(3, __pyx_int_0, __pyx_int_255, __pyx_int_127); if (unlikely(!__pyx_tuple__629)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 622; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_tuple__629); __Pyx_GIVEREF(__pyx_tuple__629); /* "include/color_dict.pxi":623 * 'springgreen' : (0, 255, 127), * 'springgreen1' : (0, 255, 127), * 'springgreen2' : (0, 238, 118), # <<<<<<<<<<<<<< * 'springgreen3' : (0, 205, 102), * 'springgreen4' : (0, 139, 69), */ __pyx_tuple__630 = PyTuple_Pack(3, __pyx_int_0, __pyx_int_238, __pyx_int_118); if (unlikely(!__pyx_tuple__630)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 623; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_tuple__630); __Pyx_GIVEREF(__pyx_tuple__630); /* "include/color_dict.pxi":624 * 'springgreen1' : (0, 255, 127), * 'springgreen2' : (0, 238, 118), * 'springgreen3' : (0, 205, 102), # <<<<<<<<<<<<<< * 'springgreen4' : (0, 139, 69), * 'steelblue' : (70, 130, 180), */ __pyx_tuple__631 = PyTuple_Pack(3, __pyx_int_0, __pyx_int_205, __pyx_int_102); if (unlikely(!__pyx_tuple__631)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 624; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_tuple__631); __Pyx_GIVEREF(__pyx_tuple__631); /* "include/color_dict.pxi":625 * 'springgreen2' : (0, 238, 118), * 'springgreen3' : (0, 205, 102), * 'springgreen4' : (0, 139, 69), # <<<<<<<<<<<<<< * 'steelblue' : (70, 130, 180), * 'steelblue1' : (99, 184, 255), */ __pyx_tuple__632 = PyTuple_Pack(3, __pyx_int_0, __pyx_int_139, __pyx_int_69); if (unlikely(!__pyx_tuple__632)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 625; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_tuple__632); __Pyx_GIVEREF(__pyx_tuple__632); /* "include/color_dict.pxi":626 * 'springgreen3' : (0, 205, 102), * 'springgreen4' : (0, 139, 69), * 'steelblue' : (70, 130, 180), # <<<<<<<<<<<<<< * 'steelblue1' : (99, 184, 255), * 'steelblue2' : (92, 172, 238), */ __pyx_tuple__633 = PyTuple_Pack(3, __pyx_int_70, __pyx_int_130, __pyx_int_180); if (unlikely(!__pyx_tuple__633)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 626; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_tuple__633); __Pyx_GIVEREF(__pyx_tuple__633); /* "include/color_dict.pxi":627 * 'springgreen4' : (0, 139, 69), * 'steelblue' : (70, 130, 180), * 'steelblue1' : (99, 184, 255), # <<<<<<<<<<<<<< * 'steelblue2' : (92, 172, 238), * 'steelblue3' : (79, 148, 205), */ __pyx_tuple__634 = PyTuple_Pack(3, __pyx_int_99, __pyx_int_184, __pyx_int_255); if (unlikely(!__pyx_tuple__634)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 627; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_tuple__634); __Pyx_GIVEREF(__pyx_tuple__634); /* "include/color_dict.pxi":628 * 'steelblue' : (70, 130, 180), * 'steelblue1' : (99, 184, 255), * 'steelblue2' : (92, 172, 238), # <<<<<<<<<<<<<< * 'steelblue3' : (79, 148, 205), * 'steelblue4' : (54, 100, 139), */ __pyx_tuple__635 = PyTuple_Pack(3, __pyx_int_92, __pyx_int_172, __pyx_int_238); if (unlikely(!__pyx_tuple__635)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 628; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_tuple__635); __Pyx_GIVEREF(__pyx_tuple__635); /* "include/color_dict.pxi":629 * 'steelblue1' : (99, 184, 255), * 'steelblue2' : (92, 172, 238), * 'steelblue3' : (79, 148, 205), # <<<<<<<<<<<<<< * 'steelblue4' : (54, 100, 139), * 'tan' : (210, 180, 140), */ __pyx_tuple__636 = PyTuple_Pack(3, __pyx_int_79, __pyx_int_148, __pyx_int_205); if (unlikely(!__pyx_tuple__636)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 629; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_tuple__636); __Pyx_GIVEREF(__pyx_tuple__636); /* "include/color_dict.pxi":630 * 'steelblue2' : (92, 172, 238), * 'steelblue3' : (79, 148, 205), * 'steelblue4' : (54, 100, 139), # <<<<<<<<<<<<<< * 'tan' : (210, 180, 140), * 'tan1' : (255, 165, 79), */ __pyx_tuple__637 = PyTuple_Pack(3, __pyx_int_54, __pyx_int_100, __pyx_int_139); if (unlikely(!__pyx_tuple__637)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 630; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_tuple__637); __Pyx_GIVEREF(__pyx_tuple__637); /* "include/color_dict.pxi":631 * 'steelblue3' : (79, 148, 205), * 'steelblue4' : (54, 100, 139), * 'tan' : (210, 180, 140), # <<<<<<<<<<<<<< * 'tan1' : (255, 165, 79), * 'tan2' : (238, 154, 73), */ __pyx_tuple__638 = PyTuple_Pack(3, __pyx_int_210, __pyx_int_180, __pyx_int_140); if (unlikely(!__pyx_tuple__638)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 631; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_tuple__638); __Pyx_GIVEREF(__pyx_tuple__638); /* "include/color_dict.pxi":632 * 'steelblue4' : (54, 100, 139), * 'tan' : (210, 180, 140), * 'tan1' : (255, 165, 79), # <<<<<<<<<<<<<< * 'tan2' : (238, 154, 73), * 'tan3' : (205, 133, 63), */ __pyx_tuple__639 = PyTuple_Pack(3, __pyx_int_255, __pyx_int_165, __pyx_int_79); if (unlikely(!__pyx_tuple__639)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 632; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_tuple__639); __Pyx_GIVEREF(__pyx_tuple__639); /* "include/color_dict.pxi":633 * 'tan' : (210, 180, 140), * 'tan1' : (255, 165, 79), * 'tan2' : (238, 154, 73), # <<<<<<<<<<<<<< * 'tan3' : (205, 133, 63), * 'tan4' : (139, 90, 43), */ __pyx_tuple__640 = PyTuple_Pack(3, __pyx_int_238, __pyx_int_154, __pyx_int_73); if (unlikely(!__pyx_tuple__640)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 633; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_tuple__640); __Pyx_GIVEREF(__pyx_tuple__640); /* "include/color_dict.pxi":634 * 'tan1' : (255, 165, 79), * 'tan2' : (238, 154, 73), * 'tan3' : (205, 133, 63), # <<<<<<<<<<<<<< * 'tan4' : (139, 90, 43), * 'teal' : (0, 128, 128), */ __pyx_tuple__641 = PyTuple_Pack(3, __pyx_int_205, __pyx_int_133, __pyx_int_63); if (unlikely(!__pyx_tuple__641)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 634; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_tuple__641); __Pyx_GIVEREF(__pyx_tuple__641); /* "include/color_dict.pxi":635 * 'tan2' : (238, 154, 73), * 'tan3' : (205, 133, 63), * 'tan4' : (139, 90, 43), # <<<<<<<<<<<<<< * 'teal' : (0, 128, 128), * 'thistle' : (216, 191, 216), */ __pyx_tuple__642 = PyTuple_Pack(3, __pyx_int_139, __pyx_int_90, __pyx_int_43); if (unlikely(!__pyx_tuple__642)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 635; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_tuple__642); __Pyx_GIVEREF(__pyx_tuple__642); /* "include/color_dict.pxi":636 * 'tan3' : (205, 133, 63), * 'tan4' : (139, 90, 43), * 'teal' : (0, 128, 128), # <<<<<<<<<<<<<< * 'thistle' : (216, 191, 216), * 'thistle1' : (255, 225, 255), */ __pyx_tuple__643 = PyTuple_Pack(3, __pyx_int_0, __pyx_int_128, __pyx_int_128); if (unlikely(!__pyx_tuple__643)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 636; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_tuple__643); __Pyx_GIVEREF(__pyx_tuple__643); /* "include/color_dict.pxi":637 * 'tan4' : (139, 90, 43), * 'teal' : (0, 128, 128), * 'thistle' : (216, 191, 216), # <<<<<<<<<<<<<< * 'thistle1' : (255, 225, 255), * 'thistle2' : (238, 210, 238), */ __pyx_tuple__644 = PyTuple_Pack(3, __pyx_int_216, __pyx_int_191, __pyx_int_216); if (unlikely(!__pyx_tuple__644)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 637; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_tuple__644); __Pyx_GIVEREF(__pyx_tuple__644); /* "include/color_dict.pxi":638 * 'teal' : (0, 128, 128), * 'thistle' : (216, 191, 216), * 'thistle1' : (255, 225, 255), # <<<<<<<<<<<<<< * 'thistle2' : (238, 210, 238), * 'thistle3' : (205, 181, 205), */ __pyx_tuple__645 = PyTuple_Pack(3, __pyx_int_255, __pyx_int_225, __pyx_int_255); if (unlikely(!__pyx_tuple__645)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 638; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_tuple__645); __Pyx_GIVEREF(__pyx_tuple__645); /* "include/color_dict.pxi":639 * 'thistle' : (216, 191, 216), * 'thistle1' : (255, 225, 255), * 'thistle2' : (238, 210, 238), # <<<<<<<<<<<<<< * 'thistle3' : (205, 181, 205), * 'thistle4' : (139, 123, 139), */ __pyx_tuple__646 = PyTuple_Pack(3, __pyx_int_238, __pyx_int_210, __pyx_int_238); if (unlikely(!__pyx_tuple__646)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 639; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_tuple__646); __Pyx_GIVEREF(__pyx_tuple__646); /* "include/color_dict.pxi":640 * 'thistle1' : (255, 225, 255), * 'thistle2' : (238, 210, 238), * 'thistle3' : (205, 181, 205), # <<<<<<<<<<<<<< * 'thistle4' : (139, 123, 139), * 'tomato' : (255, 99, 71), */ __pyx_tuple__647 = PyTuple_Pack(3, __pyx_int_205, __pyx_int_181, __pyx_int_205); if (unlikely(!__pyx_tuple__647)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 640; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_tuple__647); __Pyx_GIVEREF(__pyx_tuple__647); /* "include/color_dict.pxi":641 * 'thistle2' : (238, 210, 238), * 'thistle3' : (205, 181, 205), * 'thistle4' : (139, 123, 139), # <<<<<<<<<<<<<< * 'tomato' : (255, 99, 71), * 'tomato1' : (255, 99, 71), */ __pyx_tuple__648 = PyTuple_Pack(3, __pyx_int_139, __pyx_int_123, __pyx_int_139); if (unlikely(!__pyx_tuple__648)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 641; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_tuple__648); __Pyx_GIVEREF(__pyx_tuple__648); /* "include/color_dict.pxi":642 * 'thistle3' : (205, 181, 205), * 'thistle4' : (139, 123, 139), * 'tomato' : (255, 99, 71), # <<<<<<<<<<<<<< * 'tomato1' : (255, 99, 71), * 'tomato2' : (238, 92, 66), */ __pyx_tuple__649 = PyTuple_Pack(3, __pyx_int_255, __pyx_int_99, __pyx_int_71); if (unlikely(!__pyx_tuple__649)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 642; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_tuple__649); __Pyx_GIVEREF(__pyx_tuple__649); /* "include/color_dict.pxi":643 * 'thistle4' : (139, 123, 139), * 'tomato' : (255, 99, 71), * 'tomato1' : (255, 99, 71), # <<<<<<<<<<<<<< * 'tomato2' : (238, 92, 66), * 'tomato3' : (205, 79, 57), */ __pyx_tuple__650 = PyTuple_Pack(3, __pyx_int_255, __pyx_int_99, __pyx_int_71); if (unlikely(!__pyx_tuple__650)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 643; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_tuple__650); __Pyx_GIVEREF(__pyx_tuple__650); /* "include/color_dict.pxi":644 * 'tomato' : (255, 99, 71), * 'tomato1' : (255, 99, 71), * 'tomato2' : (238, 92, 66), # <<<<<<<<<<<<<< * 'tomato3' : (205, 79, 57), * 'tomato4' : (139, 54, 38), */ __pyx_tuple__651 = PyTuple_Pack(3, __pyx_int_238, __pyx_int_92, __pyx_int_66); if (unlikely(!__pyx_tuple__651)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 644; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_tuple__651); __Pyx_GIVEREF(__pyx_tuple__651); /* "include/color_dict.pxi":645 * 'tomato1' : (255, 99, 71), * 'tomato2' : (238, 92, 66), * 'tomato3' : (205, 79, 57), # <<<<<<<<<<<<<< * 'tomato4' : (139, 54, 38), * 'turquoise' : (64, 224, 208), */ __pyx_tuple__652 = PyTuple_Pack(3, __pyx_int_205, __pyx_int_79, __pyx_int_57); if (unlikely(!__pyx_tuple__652)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 645; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_tuple__652); __Pyx_GIVEREF(__pyx_tuple__652); /* "include/color_dict.pxi":646 * 'tomato2' : (238, 92, 66), * 'tomato3' : (205, 79, 57), * 'tomato4' : (139, 54, 38), # <<<<<<<<<<<<<< * 'turquoise' : (64, 224, 208), * 'turquoise1' : (0, 245, 255), */ __pyx_tuple__653 = PyTuple_Pack(3, __pyx_int_139, __pyx_int_54, __pyx_int_38); if (unlikely(!__pyx_tuple__653)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 646; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_tuple__653); __Pyx_GIVEREF(__pyx_tuple__653); /* "include/color_dict.pxi":647 * 'tomato3' : (205, 79, 57), * 'tomato4' : (139, 54, 38), * 'turquoise' : (64, 224, 208), # <<<<<<<<<<<<<< * 'turquoise1' : (0, 245, 255), * 'turquoise2' : (0, 229, 238), */ __pyx_tuple__654 = PyTuple_Pack(3, __pyx_int_64, __pyx_int_224, __pyx_int_208); if (unlikely(!__pyx_tuple__654)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 647; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_tuple__654); __Pyx_GIVEREF(__pyx_tuple__654); /* "include/color_dict.pxi":648 * 'tomato4' : (139, 54, 38), * 'turquoise' : (64, 224, 208), * 'turquoise1' : (0, 245, 255), # <<<<<<<<<<<<<< * 'turquoise2' : (0, 229, 238), * 'turquoise3' : (0, 197, 205), */ __pyx_tuple__655 = PyTuple_Pack(3, __pyx_int_0, __pyx_int_245, __pyx_int_255); if (unlikely(!__pyx_tuple__655)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 648; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_tuple__655); __Pyx_GIVEREF(__pyx_tuple__655); /* "include/color_dict.pxi":649 * 'turquoise' : (64, 224, 208), * 'turquoise1' : (0, 245, 255), * 'turquoise2' : (0, 229, 238), # <<<<<<<<<<<<<< * 'turquoise3' : (0, 197, 205), * 'turquoise4' : (0, 134, 139), */ __pyx_tuple__656 = PyTuple_Pack(3, __pyx_int_0, __pyx_int_229, __pyx_int_238); if (unlikely(!__pyx_tuple__656)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 649; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_tuple__656); __Pyx_GIVEREF(__pyx_tuple__656); /* "include/color_dict.pxi":650 * 'turquoise1' : (0, 245, 255), * 'turquoise2' : (0, 229, 238), * 'turquoise3' : (0, 197, 205), # <<<<<<<<<<<<<< * 'turquoise4' : (0, 134, 139), * 'violet' : (238, 130, 238), */ __pyx_tuple__657 = PyTuple_Pack(3, __pyx_int_0, __pyx_int_197, __pyx_int_205); if (unlikely(!__pyx_tuple__657)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 650; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_tuple__657); __Pyx_GIVEREF(__pyx_tuple__657); /* "include/color_dict.pxi":651 * 'turquoise2' : (0, 229, 238), * 'turquoise3' : (0, 197, 205), * 'turquoise4' : (0, 134, 139), # <<<<<<<<<<<<<< * 'violet' : (238, 130, 238), * 'violetred' : (208, 32, 144), */ __pyx_tuple__658 = PyTuple_Pack(3, __pyx_int_0, __pyx_int_134, __pyx_int_139); if (unlikely(!__pyx_tuple__658)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 651; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_tuple__658); __Pyx_GIVEREF(__pyx_tuple__658); /* "include/color_dict.pxi":652 * 'turquoise3' : (0, 197, 205), * 'turquoise4' : (0, 134, 139), * 'violet' : (238, 130, 238), # <<<<<<<<<<<<<< * 'violetred' : (208, 32, 144), * 'violetred1' : (255, 62, 150), */ __pyx_tuple__659 = PyTuple_Pack(3, __pyx_int_238, __pyx_int_130, __pyx_int_238); if (unlikely(!__pyx_tuple__659)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 652; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_tuple__659); __Pyx_GIVEREF(__pyx_tuple__659); /* "include/color_dict.pxi":653 * 'turquoise4' : (0, 134, 139), * 'violet' : (238, 130, 238), * 'violetred' : (208, 32, 144), # <<<<<<<<<<<<<< * 'violetred1' : (255, 62, 150), * 'violetred2' : (238, 58, 140), */ __pyx_tuple__660 = PyTuple_Pack(3, __pyx_int_208, __pyx_int_32, __pyx_int_144); if (unlikely(!__pyx_tuple__660)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 653; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_tuple__660); __Pyx_GIVEREF(__pyx_tuple__660); /* "include/color_dict.pxi":654 * 'violet' : (238, 130, 238), * 'violetred' : (208, 32, 144), * 'violetred1' : (255, 62, 150), # <<<<<<<<<<<<<< * 'violetred2' : (238, 58, 140), * 'violetred3' : (205, 50, 120), */ __pyx_tuple__661 = PyTuple_Pack(3, __pyx_int_255, __pyx_int_62, __pyx_int_150); if (unlikely(!__pyx_tuple__661)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 654; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_tuple__661); __Pyx_GIVEREF(__pyx_tuple__661); /* "include/color_dict.pxi":655 * 'violetred' : (208, 32, 144), * 'violetred1' : (255, 62, 150), * 'violetred2' : (238, 58, 140), # <<<<<<<<<<<<<< * 'violetred3' : (205, 50, 120), * 'violetred4' : (139, 34, 82), */ __pyx_tuple__662 = PyTuple_Pack(3, __pyx_int_238, __pyx_int_58, __pyx_int_140); if (unlikely(!__pyx_tuple__662)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 655; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_tuple__662); __Pyx_GIVEREF(__pyx_tuple__662); /* "include/color_dict.pxi":656 * 'violetred1' : (255, 62, 150), * 'violetred2' : (238, 58, 140), * 'violetred3' : (205, 50, 120), # <<<<<<<<<<<<<< * 'violetred4' : (139, 34, 82), * 'webgray' : (128, 128, 128), */ __pyx_tuple__663 = PyTuple_Pack(3, __pyx_int_205, __pyx_int_50, __pyx_int_120); if (unlikely(!__pyx_tuple__663)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 656; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_tuple__663); __Pyx_GIVEREF(__pyx_tuple__663); /* "include/color_dict.pxi":657 * 'violetred2' : (238, 58, 140), * 'violetred3' : (205, 50, 120), * 'violetred4' : (139, 34, 82), # <<<<<<<<<<<<<< * 'webgray' : (128, 128, 128), * 'webgreen' : (0, 128, 0), */ __pyx_tuple__664 = PyTuple_Pack(3, __pyx_int_139, __pyx_int_34, __pyx_int_82); if (unlikely(!__pyx_tuple__664)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 657; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_tuple__664); __Pyx_GIVEREF(__pyx_tuple__664); /* "include/color_dict.pxi":658 * 'violetred3' : (205, 50, 120), * 'violetred4' : (139, 34, 82), * 'webgray' : (128, 128, 128), # <<<<<<<<<<<<<< * 'webgreen' : (0, 128, 0), * 'webgrey' : (128, 128, 128), */ __pyx_tuple__665 = PyTuple_Pack(3, __pyx_int_128, __pyx_int_128, __pyx_int_128); if (unlikely(!__pyx_tuple__665)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 658; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_tuple__665); __Pyx_GIVEREF(__pyx_tuple__665); /* "include/color_dict.pxi":659 * 'violetred4' : (139, 34, 82), * 'webgray' : (128, 128, 128), * 'webgreen' : (0, 128, 0), # <<<<<<<<<<<<<< * 'webgrey' : (128, 128, 128), * 'webmaroon' : (128, 0, 0), */ __pyx_tuple__666 = PyTuple_Pack(3, __pyx_int_0, __pyx_int_128, __pyx_int_0); if (unlikely(!__pyx_tuple__666)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 659; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_tuple__666); __Pyx_GIVEREF(__pyx_tuple__666); /* "include/color_dict.pxi":660 * 'webgray' : (128, 128, 128), * 'webgreen' : (0, 128, 0), * 'webgrey' : (128, 128, 128), # <<<<<<<<<<<<<< * 'webmaroon' : (128, 0, 0), * 'webpurple' : (128, 0, 128), */ __pyx_tuple__667 = PyTuple_Pack(3, __pyx_int_128, __pyx_int_128, __pyx_int_128); if (unlikely(!__pyx_tuple__667)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 660; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_tuple__667); __Pyx_GIVEREF(__pyx_tuple__667); /* "include/color_dict.pxi":661 * 'webgreen' : (0, 128, 0), * 'webgrey' : (128, 128, 128), * 'webmaroon' : (128, 0, 0), # <<<<<<<<<<<<<< * 'webpurple' : (128, 0, 128), * 'wheat' : (245, 222, 179), */ __pyx_tuple__668 = PyTuple_Pack(3, __pyx_int_128, __pyx_int_0, __pyx_int_0); if (unlikely(!__pyx_tuple__668)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 661; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_tuple__668); __Pyx_GIVEREF(__pyx_tuple__668); /* "include/color_dict.pxi":662 * 'webgrey' : (128, 128, 128), * 'webmaroon' : (128, 0, 0), * 'webpurple' : (128, 0, 128), # <<<<<<<<<<<<<< * 'wheat' : (245, 222, 179), * 'wheat1' : (255, 231, 186), */ __pyx_tuple__669 = PyTuple_Pack(3, __pyx_int_128, __pyx_int_0, __pyx_int_128); if (unlikely(!__pyx_tuple__669)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 662; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_tuple__669); __Pyx_GIVEREF(__pyx_tuple__669); /* "include/color_dict.pxi":663 * 'webmaroon' : (128, 0, 0), * 'webpurple' : (128, 0, 128), * 'wheat' : (245, 222, 179), # <<<<<<<<<<<<<< * 'wheat1' : (255, 231, 186), * 'wheat2' : (238, 216, 174), */ __pyx_tuple__670 = PyTuple_Pack(3, __pyx_int_245, __pyx_int_222, __pyx_int_179); if (unlikely(!__pyx_tuple__670)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 663; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_tuple__670); __Pyx_GIVEREF(__pyx_tuple__670); /* "include/color_dict.pxi":664 * 'webpurple' : (128, 0, 128), * 'wheat' : (245, 222, 179), * 'wheat1' : (255, 231, 186), # <<<<<<<<<<<<<< * 'wheat2' : (238, 216, 174), * 'wheat3' : (205, 186, 150), */ __pyx_tuple__671 = PyTuple_Pack(3, __pyx_int_255, __pyx_int_231, __pyx_int_186); if (unlikely(!__pyx_tuple__671)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 664; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_tuple__671); __Pyx_GIVEREF(__pyx_tuple__671); /* "include/color_dict.pxi":665 * 'wheat' : (245, 222, 179), * 'wheat1' : (255, 231, 186), * 'wheat2' : (238, 216, 174), # <<<<<<<<<<<<<< * 'wheat3' : (205, 186, 150), * 'wheat4' : (139, 126, 102), */ __pyx_tuple__672 = PyTuple_Pack(3, __pyx_int_238, __pyx_int_216, __pyx_int_174); if (unlikely(!__pyx_tuple__672)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 665; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_tuple__672); __Pyx_GIVEREF(__pyx_tuple__672); /* "include/color_dict.pxi":666 * 'wheat1' : (255, 231, 186), * 'wheat2' : (238, 216, 174), * 'wheat3' : (205, 186, 150), # <<<<<<<<<<<<<< * 'wheat4' : (139, 126, 102), * 'white' : (255, 255, 255), */ __pyx_tuple__673 = PyTuple_Pack(3, __pyx_int_205, __pyx_int_186, __pyx_int_150); if (unlikely(!__pyx_tuple__673)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 666; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_tuple__673); __Pyx_GIVEREF(__pyx_tuple__673); /* "include/color_dict.pxi":667 * 'wheat2' : (238, 216, 174), * 'wheat3' : (205, 186, 150), * 'wheat4' : (139, 126, 102), # <<<<<<<<<<<<<< * 'white' : (255, 255, 255), * 'whitesmoke' : (245, 245, 245), */ __pyx_tuple__674 = PyTuple_Pack(3, __pyx_int_139, __pyx_int_126, __pyx_int_102); if (unlikely(!__pyx_tuple__674)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 667; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_tuple__674); __Pyx_GIVEREF(__pyx_tuple__674); /* "include/color_dict.pxi":668 * 'wheat3' : (205, 186, 150), * 'wheat4' : (139, 126, 102), * 'white' : (255, 255, 255), # <<<<<<<<<<<<<< * 'whitesmoke' : (245, 245, 245), * 'x11gray' : (190, 190, 190), */ __pyx_tuple__675 = PyTuple_Pack(3, __pyx_int_255, __pyx_int_255, __pyx_int_255); if (unlikely(!__pyx_tuple__675)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 668; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_tuple__675); __Pyx_GIVEREF(__pyx_tuple__675); /* "include/color_dict.pxi":669 * 'wheat4' : (139, 126, 102), * 'white' : (255, 255, 255), * 'whitesmoke' : (245, 245, 245), # <<<<<<<<<<<<<< * 'x11gray' : (190, 190, 190), * 'x11green' : (0, 255, 0), */ __pyx_tuple__676 = PyTuple_Pack(3, __pyx_int_245, __pyx_int_245, __pyx_int_245); if (unlikely(!__pyx_tuple__676)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 669; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_tuple__676); __Pyx_GIVEREF(__pyx_tuple__676); /* "include/color_dict.pxi":670 * 'white' : (255, 255, 255), * 'whitesmoke' : (245, 245, 245), * 'x11gray' : (190, 190, 190), # <<<<<<<<<<<<<< * 'x11green' : (0, 255, 0), * 'x11grey' : (190, 190, 190), */ __pyx_tuple__677 = PyTuple_Pack(3, __pyx_int_190, __pyx_int_190, __pyx_int_190); if (unlikely(!__pyx_tuple__677)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 670; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_tuple__677); __Pyx_GIVEREF(__pyx_tuple__677); /* "include/color_dict.pxi":671 * 'whitesmoke' : (245, 245, 245), * 'x11gray' : (190, 190, 190), * 'x11green' : (0, 255, 0), # <<<<<<<<<<<<<< * 'x11grey' : (190, 190, 190), * 'x11maroon' : (176, 48, 96), */ __pyx_tuple__678 = PyTuple_Pack(3, __pyx_int_0, __pyx_int_255, __pyx_int_0); if (unlikely(!__pyx_tuple__678)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 671; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_tuple__678); __Pyx_GIVEREF(__pyx_tuple__678); /* "include/color_dict.pxi":672 * 'x11gray' : (190, 190, 190), * 'x11green' : (0, 255, 0), * 'x11grey' : (190, 190, 190), # <<<<<<<<<<<<<< * 'x11maroon' : (176, 48, 96), * 'x11purple' : (160, 32, 240), */ __pyx_tuple__679 = PyTuple_Pack(3, __pyx_int_190, __pyx_int_190, __pyx_int_190); if (unlikely(!__pyx_tuple__679)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 672; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_tuple__679); __Pyx_GIVEREF(__pyx_tuple__679); /* "include/color_dict.pxi":673 * 'x11green' : (0, 255, 0), * 'x11grey' : (190, 190, 190), * 'x11maroon' : (176, 48, 96), # <<<<<<<<<<<<<< * 'x11purple' : (160, 32, 240), * 'yellow' : (255, 255, 0), */ __pyx_tuple__680 = PyTuple_Pack(3, __pyx_int_176, __pyx_int_48, __pyx_int_96); if (unlikely(!__pyx_tuple__680)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 673; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_tuple__680); __Pyx_GIVEREF(__pyx_tuple__680); /* "include/color_dict.pxi":674 * 'x11grey' : (190, 190, 190), * 'x11maroon' : (176, 48, 96), * 'x11purple' : (160, 32, 240), # <<<<<<<<<<<<<< * 'yellow' : (255, 255, 0), * 'yellow1' : (255, 255, 0), */ __pyx_tuple__681 = PyTuple_Pack(3, __pyx_int_160, __pyx_int_32, __pyx_int_240); if (unlikely(!__pyx_tuple__681)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 674; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_tuple__681); __Pyx_GIVEREF(__pyx_tuple__681); /* "include/color_dict.pxi":675 * 'x11maroon' : (176, 48, 96), * 'x11purple' : (160, 32, 240), * 'yellow' : (255, 255, 0), # <<<<<<<<<<<<<< * 'yellow1' : (255, 255, 0), * 'yellow2' : (238, 238, 0), */ __pyx_tuple__682 = PyTuple_Pack(3, __pyx_int_255, __pyx_int_255, __pyx_int_0); if (unlikely(!__pyx_tuple__682)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 675; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_tuple__682); __Pyx_GIVEREF(__pyx_tuple__682); /* "include/color_dict.pxi":676 * 'x11purple' : (160, 32, 240), * 'yellow' : (255, 255, 0), * 'yellow1' : (255, 255, 0), # <<<<<<<<<<<<<< * 'yellow2' : (238, 238, 0), * 'yellow3' : (205, 205, 0), */ __pyx_tuple__683 = PyTuple_Pack(3, __pyx_int_255, __pyx_int_255, __pyx_int_0); if (unlikely(!__pyx_tuple__683)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 676; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_tuple__683); __Pyx_GIVEREF(__pyx_tuple__683); /* "include/color_dict.pxi":677 * 'yellow' : (255, 255, 0), * 'yellow1' : (255, 255, 0), * 'yellow2' : (238, 238, 0), # <<<<<<<<<<<<<< * 'yellow3' : (205, 205, 0), * 'yellow4' : (139, 139, 0), */ __pyx_tuple__684 = PyTuple_Pack(3, __pyx_int_238, __pyx_int_238, __pyx_int_0); if (unlikely(!__pyx_tuple__684)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 677; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_tuple__684); __Pyx_GIVEREF(__pyx_tuple__684); /* "include/color_dict.pxi":678 * 'yellow1' : (255, 255, 0), * 'yellow2' : (238, 238, 0), * 'yellow3' : (205, 205, 0), # <<<<<<<<<<<<<< * 'yellow4' : (139, 139, 0), * 'yellowgreen' : (154, 205, 50), */ __pyx_tuple__685 = PyTuple_Pack(3, __pyx_int_205, __pyx_int_205, __pyx_int_0); if (unlikely(!__pyx_tuple__685)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 678; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_tuple__685); __Pyx_GIVEREF(__pyx_tuple__685); /* "include/color_dict.pxi":679 * 'yellow2' : (238, 238, 0), * 'yellow3' : (205, 205, 0), * 'yellow4' : (139, 139, 0), # <<<<<<<<<<<<<< * 'yellowgreen' : (154, 205, 50), * } */ __pyx_tuple__686 = PyTuple_Pack(3, __pyx_int_139, __pyx_int_139, __pyx_int_0); if (unlikely(!__pyx_tuple__686)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 679; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_tuple__686); __Pyx_GIVEREF(__pyx_tuple__686); /* "include/color_dict.pxi":680 * 'yellow3' : (205, 205, 0), * 'yellow4' : (139, 139, 0), * 'yellowgreen' : (154, 205, 50), # <<<<<<<<<<<<<< * } */ __pyx_tuple__687 = PyTuple_Pack(3, __pyx_int_154, __pyx_int_205, __pyx_int_50); if (unlikely(!__pyx_tuple__687)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 680; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_tuple__687); __Pyx_GIVEREF(__pyx_tuple__687); __Pyx_RefNannyFinishContext(); return 0; __pyx_L1_error:; __Pyx_RefNannyFinishContext(); return -1; } static int __Pyx_InitGlobals(void) { if (__Pyx_InitStrings(__pyx_string_tab) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; __pyx_float_255_0 = PyFloat_FromDouble(255.0); if (unlikely(!__pyx_float_255_0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_float_360_0 = PyFloat_FromDouble(360.0); if (unlikely(!__pyx_float_360_0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_int_0 = PyInt_FromLong(0); if (unlikely(!__pyx_int_0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_int_1 = PyInt_FromLong(1); if (unlikely(!__pyx_int_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_int_2 = PyInt_FromLong(2); if (unlikely(!__pyx_int_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_int_3 = PyInt_FromLong(3); if (unlikely(!__pyx_int_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_int_4 = PyInt_FromLong(4); if (unlikely(!__pyx_int_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_int_5 = PyInt_FromLong(5); if (unlikely(!__pyx_int_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_int_8 = PyInt_FromLong(8); if (unlikely(!__pyx_int_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_int_10 = PyInt_FromLong(10); if (unlikely(!__pyx_int_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_int_11 = PyInt_FromLong(11); if (unlikely(!__pyx_int_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_int_12 = PyInt_FromLong(12); if (unlikely(!__pyx_int_12)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_int_13 = PyInt_FromLong(13); if (unlikely(!__pyx_int_13)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_int_14 = PyInt_FromLong(14); if (unlikely(!__pyx_int_14)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_int_15 = PyInt_FromLong(15); if (unlikely(!__pyx_int_15)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_int_16 = PyInt_FromLong(16); if (unlikely(!__pyx_int_16)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_int_18 = PyInt_FromLong(18); if (unlikely(!__pyx_int_18)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_int_19 = PyInt_FromLong(19); if (unlikely(!__pyx_int_19)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_int_20 = PyInt_FromLong(20); if (unlikely(!__pyx_int_20)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_int_21 = PyInt_FromLong(21); if (unlikely(!__pyx_int_21)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_int_23 = PyInt_FromLong(23); if (unlikely(!__pyx_int_23)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_int_24 = PyInt_FromLong(24); if (unlikely(!__pyx_int_24)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_int_25 = PyInt_FromLong(25); if (unlikely(!__pyx_int_25)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_int_26 = PyInt_FromLong(26); if (unlikely(!__pyx_int_26)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_int_28 = PyInt_FromLong(28); if (unlikely(!__pyx_int_28)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_int_29 = PyInt_FromLong(29); if (unlikely(!__pyx_int_29)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_int_30 = PyInt_FromLong(30); if (unlikely(!__pyx_int_30)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_int_31 = PyInt_FromLong(31); if (unlikely(!__pyx_int_31)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_int_32 = PyInt_FromLong(32); if (unlikely(!__pyx_int_32)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_int_33 = PyInt_FromLong(33); if (unlikely(!__pyx_int_33)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_int_34 = PyInt_FromLong(34); if (unlikely(!__pyx_int_34)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_int_35 = PyInt_FromLong(35); if (unlikely(!__pyx_int_35)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_int_36 = PyInt_FromLong(36); if (unlikely(!__pyx_int_36)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_int_37 = PyInt_FromLong(37); if (unlikely(!__pyx_int_37)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_int_38 = PyInt_FromLong(38); if (unlikely(!__pyx_int_38)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_int_39 = PyInt_FromLong(39); if (unlikely(!__pyx_int_39)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_int_41 = PyInt_FromLong(41); if (unlikely(!__pyx_int_41)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_int_42 = PyInt_FromLong(42); if (unlikely(!__pyx_int_42)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_int_43 = PyInt_FromLong(43); if (unlikely(!__pyx_int_43)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_int_44 = PyInt_FromLong(44); if (unlikely(!__pyx_int_44)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_int_45 = PyInt_FromLong(45); if (unlikely(!__pyx_int_45)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_int_46 = PyInt_FromLong(46); if (unlikely(!__pyx_int_46)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_int_47 = PyInt_FromLong(47); if (unlikely(!__pyx_int_47)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_int_48 = PyInt_FromLong(48); if (unlikely(!__pyx_int_48)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_int_50 = PyInt_FromLong(50); if (unlikely(!__pyx_int_50)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_int_51 = PyInt_FromLong(51); if (unlikely(!__pyx_int_51)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_int_52 = PyInt_FromLong(52); if (unlikely(!__pyx_int_52)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_int_54 = PyInt_FromLong(54); if (unlikely(!__pyx_int_54)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_int_55 = PyInt_FromLong(55); if (unlikely(!__pyx_int_55)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_int_56 = PyInt_FromLong(56); if (unlikely(!__pyx_int_56)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_int_57 = PyInt_FromLong(57); if (unlikely(!__pyx_int_57)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_int_58 = PyInt_FromLong(58); if (unlikely(!__pyx_int_58)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_int_59 = PyInt_FromLong(59); if (unlikely(!__pyx_int_59)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_int_60 = PyInt_FromLong(60); if (unlikely(!__pyx_int_60)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_int_61 = PyInt_FromLong(61); if (unlikely(!__pyx_int_61)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_int_62 = PyInt_FromLong(62); if (unlikely(!__pyx_int_62)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_int_63 = PyInt_FromLong(63); if (unlikely(!__pyx_int_63)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_int_64 = PyInt_FromLong(64); if (unlikely(!__pyx_int_64)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_int_65 = PyInt_FromLong(65); if (unlikely(!__pyx_int_65)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_int_66 = PyInt_FromLong(66); if (unlikely(!__pyx_int_66)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_int_67 = PyInt_FromLong(67); if (unlikely(!__pyx_int_67)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_int_69 = PyInt_FromLong(69); if (unlikely(!__pyx_int_69)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_int_70 = PyInt_FromLong(70); if (unlikely(!__pyx_int_70)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_int_71 = PyInt_FromLong(71); if (unlikely(!__pyx_int_71)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_int_72 = PyInt_FromLong(72); if (unlikely(!__pyx_int_72)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_int_73 = PyInt_FromLong(73); if (unlikely(!__pyx_int_73)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_int_74 = PyInt_FromLong(74); if (unlikely(!__pyx_int_74)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_int_75 = PyInt_FromLong(75); if (unlikely(!__pyx_int_75)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_int_76 = PyInt_FromLong(76); if (unlikely(!__pyx_int_76)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_int_77 = PyInt_FromLong(77); if (unlikely(!__pyx_int_77)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_int_78 = PyInt_FromLong(78); if (unlikely(!__pyx_int_78)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_int_79 = PyInt_FromLong(79); if (unlikely(!__pyx_int_79)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_int_80 = PyInt_FromLong(80); if (unlikely(!__pyx_int_80)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_int_82 = PyInt_FromLong(82); if (unlikely(!__pyx_int_82)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_int_83 = PyInt_FromLong(83); if (unlikely(!__pyx_int_83)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_int_84 = PyInt_FromLong(84); if (unlikely(!__pyx_int_84)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_int_85 = PyInt_FromLong(85); if (unlikely(!__pyx_int_85)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_int_86 = PyInt_FromLong(86); if (unlikely(!__pyx_int_86)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_int_87 = PyInt_FromLong(87); if (unlikely(!__pyx_int_87)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_int_89 = PyInt_FromLong(89); if (unlikely(!__pyx_int_89)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_int_90 = PyInt_FromLong(90); if (unlikely(!__pyx_int_90)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_int_91 = PyInt_FromLong(91); if (unlikely(!__pyx_int_91)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_int_92 = PyInt_FromLong(92); if (unlikely(!__pyx_int_92)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_int_93 = PyInt_FromLong(93); if (unlikely(!__pyx_int_93)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_int_94 = PyInt_FromLong(94); if (unlikely(!__pyx_int_94)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_int_95 = PyInt_FromLong(95); if (unlikely(!__pyx_int_95)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_int_96 = PyInt_FromLong(96); if (unlikely(!__pyx_int_96)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_int_97 = PyInt_FromLong(97); if (unlikely(!__pyx_int_97)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_int_98 = PyInt_FromLong(98); if (unlikely(!__pyx_int_98)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_int_99 = PyInt_FromLong(99); if (unlikely(!__pyx_int_99)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_int_100 = PyInt_FromLong(100); if (unlikely(!__pyx_int_100)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_int_101 = PyInt_FromLong(101); if (unlikely(!__pyx_int_101)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_int_102 = PyInt_FromLong(102); if (unlikely(!__pyx_int_102)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_int_103 = PyInt_FromLong(103); if (unlikely(!__pyx_int_103)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_int_104 = PyInt_FromLong(104); if (unlikely(!__pyx_int_104)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_int_105 = PyInt_FromLong(105); if (unlikely(!__pyx_int_105)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_int_106 = PyInt_FromLong(106); if (unlikely(!__pyx_int_106)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_int_107 = PyInt_FromLong(107); if (unlikely(!__pyx_int_107)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_int_108 = PyInt_FromLong(108); if (unlikely(!__pyx_int_108)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_int_110 = PyInt_FromLong(110); if (unlikely(!__pyx_int_110)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_int_111 = PyInt_FromLong(111); if (unlikely(!__pyx_int_111)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_int_112 = PyInt_FromLong(112); if (unlikely(!__pyx_int_112)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_int_113 = PyInt_FromLong(113); if (unlikely(!__pyx_int_113)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_int_114 = PyInt_FromLong(114); if (unlikely(!__pyx_int_114)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_int_115 = PyInt_FromLong(115); if (unlikely(!__pyx_int_115)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_int_116 = PyInt_FromLong(116); if (unlikely(!__pyx_int_116)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_int_117 = PyInt_FromLong(117); if (unlikely(!__pyx_int_117)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_int_118 = PyInt_FromLong(118); if (unlikely(!__pyx_int_118)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_int_119 = PyInt_FromLong(119); if (unlikely(!__pyx_int_119)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_int_120 = PyInt_FromLong(120); if (unlikely(!__pyx_int_120)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_int_121 = PyInt_FromLong(121); if (unlikely(!__pyx_int_121)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_int_122 = PyInt_FromLong(122); if (unlikely(!__pyx_int_122)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_int_123 = PyInt_FromLong(123); if (unlikely(!__pyx_int_123)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_int_124 = PyInt_FromLong(124); if (unlikely(!__pyx_int_124)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_int_125 = PyInt_FromLong(125); if (unlikely(!__pyx_int_125)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_int_126 = PyInt_FromLong(126); if (unlikely(!__pyx_int_126)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_int_127 = PyInt_FromLong(127); if (unlikely(!__pyx_int_127)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_int_128 = PyInt_FromLong(128); if (unlikely(!__pyx_int_128)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_int_129 = PyInt_FromLong(129); if (unlikely(!__pyx_int_129)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_int_130 = PyInt_FromLong(130); if (unlikely(!__pyx_int_130)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_int_131 = PyInt_FromLong(131); if (unlikely(!__pyx_int_131)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_int_132 = PyInt_FromLong(132); if (unlikely(!__pyx_int_132)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_int_133 = PyInt_FromLong(133); if (unlikely(!__pyx_int_133)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_int_134 = PyInt_FromLong(134); if (unlikely(!__pyx_int_134)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_int_135 = PyInt_FromLong(135); if (unlikely(!__pyx_int_135)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_int_136 = PyInt_FromLong(136); if (unlikely(!__pyx_int_136)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_int_137 = PyInt_FromLong(137); if (unlikely(!__pyx_int_137)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_int_138 = PyInt_FromLong(138); if (unlikely(!__pyx_int_138)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_int_139 = PyInt_FromLong(139); if (unlikely(!__pyx_int_139)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_int_140 = PyInt_FromLong(140); if (unlikely(!__pyx_int_140)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_int_141 = PyInt_FromLong(141); if (unlikely(!__pyx_int_141)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_int_142 = PyInt_FromLong(142); if (unlikely(!__pyx_int_142)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_int_143 = PyInt_FromLong(143); if (unlikely(!__pyx_int_143)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_int_144 = PyInt_FromLong(144); if (unlikely(!__pyx_int_144)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_int_145 = PyInt_FromLong(145); if (unlikely(!__pyx_int_145)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_int_147 = PyInt_FromLong(147); if (unlikely(!__pyx_int_147)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_int_148 = PyInt_FromLong(148); if (unlikely(!__pyx_int_148)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_int_149 = PyInt_FromLong(149); if (unlikely(!__pyx_int_149)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_int_150 = PyInt_FromLong(150); if (unlikely(!__pyx_int_150)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_int_151 = PyInt_FromLong(151); if (unlikely(!__pyx_int_151)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_int_152 = PyInt_FromLong(152); if (unlikely(!__pyx_int_152)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_int_153 = PyInt_FromLong(153); if (unlikely(!__pyx_int_153)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_int_154 = PyInt_FromLong(154); if (unlikely(!__pyx_int_154)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_int_155 = PyInt_FromLong(155); if (unlikely(!__pyx_int_155)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_int_156 = PyInt_FromLong(156); if (unlikely(!__pyx_int_156)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_int_158 = PyInt_FromLong(158); if (unlikely(!__pyx_int_158)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_int_159 = PyInt_FromLong(159); if (unlikely(!__pyx_int_159)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_int_160 = PyInt_FromLong(160); if (unlikely(!__pyx_int_160)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_int_161 = PyInt_FromLong(161); if (unlikely(!__pyx_int_161)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_int_162 = PyInt_FromLong(162); if (unlikely(!__pyx_int_162)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_int_163 = PyInt_FromLong(163); if (unlikely(!__pyx_int_163)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_int_164 = PyInt_FromLong(164); if (unlikely(!__pyx_int_164)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_int_165 = PyInt_FromLong(165); if (unlikely(!__pyx_int_165)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_int_166 = PyInt_FromLong(166); if (unlikely(!__pyx_int_166)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_int_167 = PyInt_FromLong(167); if (unlikely(!__pyx_int_167)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_int_168 = PyInt_FromLong(168); if (unlikely(!__pyx_int_168)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_int_169 = PyInt_FromLong(169); if (unlikely(!__pyx_int_169)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_int_170 = PyInt_FromLong(170); if (unlikely(!__pyx_int_170)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_int_171 = PyInt_FromLong(171); if (unlikely(!__pyx_int_171)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_int_172 = PyInt_FromLong(172); if (unlikely(!__pyx_int_172)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_int_173 = PyInt_FromLong(173); if (unlikely(!__pyx_int_173)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_int_174 = PyInt_FromLong(174); if (unlikely(!__pyx_int_174)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_int_175 = PyInt_FromLong(175); if (unlikely(!__pyx_int_175)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_int_176 = PyInt_FromLong(176); if (unlikely(!__pyx_int_176)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_int_177 = PyInt_FromLong(177); if (unlikely(!__pyx_int_177)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_int_178 = PyInt_FromLong(178); if (unlikely(!__pyx_int_178)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_int_179 = PyInt_FromLong(179); if (unlikely(!__pyx_int_179)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_int_180 = PyInt_FromLong(180); if (unlikely(!__pyx_int_180)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_int_181 = PyInt_FromLong(181); if (unlikely(!__pyx_int_181)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_int_182 = PyInt_FromLong(182); if (unlikely(!__pyx_int_182)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_int_183 = PyInt_FromLong(183); if (unlikely(!__pyx_int_183)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_int_184 = PyInt_FromLong(184); if (unlikely(!__pyx_int_184)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_int_185 = PyInt_FromLong(185); if (unlikely(!__pyx_int_185)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_int_186 = PyInt_FromLong(186); if (unlikely(!__pyx_int_186)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_int_187 = PyInt_FromLong(187); if (unlikely(!__pyx_int_187)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_int_188 = PyInt_FromLong(188); if (unlikely(!__pyx_int_188)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_int_189 = PyInt_FromLong(189); if (unlikely(!__pyx_int_189)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_int_190 = PyInt_FromLong(190); if (unlikely(!__pyx_int_190)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_int_191 = PyInt_FromLong(191); if (unlikely(!__pyx_int_191)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_int_192 = PyInt_FromLong(192); if (unlikely(!__pyx_int_192)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_int_193 = PyInt_FromLong(193); if (unlikely(!__pyx_int_193)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_int_194 = PyInt_FromLong(194); if (unlikely(!__pyx_int_194)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_int_196 = PyInt_FromLong(196); if (unlikely(!__pyx_int_196)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_int_197 = PyInt_FromLong(197); if (unlikely(!__pyx_int_197)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_int_198 = PyInt_FromLong(198); if (unlikely(!__pyx_int_198)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_int_199 = PyInt_FromLong(199); if (unlikely(!__pyx_int_199)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_int_200 = PyInt_FromLong(200); if (unlikely(!__pyx_int_200)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_int_201 = PyInt_FromLong(201); if (unlikely(!__pyx_int_201)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_int_202 = PyInt_FromLong(202); if (unlikely(!__pyx_int_202)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_int_203 = PyInt_FromLong(203); if (unlikely(!__pyx_int_203)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_int_204 = PyInt_FromLong(204); if (unlikely(!__pyx_int_204)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_int_205 = PyInt_FromLong(205); if (unlikely(!__pyx_int_205)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_int_206 = PyInt_FromLong(206); if (unlikely(!__pyx_int_206)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_int_207 = PyInt_FromLong(207); if (unlikely(!__pyx_int_207)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_int_208 = PyInt_FromLong(208); if (unlikely(!__pyx_int_208)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_int_209 = PyInt_FromLong(209); if (unlikely(!__pyx_int_209)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_int_210 = PyInt_FromLong(210); if (unlikely(!__pyx_int_210)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_int_211 = PyInt_FromLong(211); if (unlikely(!__pyx_int_211)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_int_212 = PyInt_FromLong(212); if (unlikely(!__pyx_int_212)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_int_213 = PyInt_FromLong(213); if (unlikely(!__pyx_int_213)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_int_214 = PyInt_FromLong(214); if (unlikely(!__pyx_int_214)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_int_215 = PyInt_FromLong(215); if (unlikely(!__pyx_int_215)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_int_216 = PyInt_FromLong(216); if (unlikely(!__pyx_int_216)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_int_217 = PyInt_FromLong(217); if (unlikely(!__pyx_int_217)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_int_218 = PyInt_FromLong(218); if (unlikely(!__pyx_int_218)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_int_219 = PyInt_FromLong(219); if (unlikely(!__pyx_int_219)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_int_220 = PyInt_FromLong(220); if (unlikely(!__pyx_int_220)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_int_221 = PyInt_FromLong(221); if (unlikely(!__pyx_int_221)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_int_222 = PyInt_FromLong(222); if (unlikely(!__pyx_int_222)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_int_223 = PyInt_FromLong(223); if (unlikely(!__pyx_int_223)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_int_224 = PyInt_FromLong(224); if (unlikely(!__pyx_int_224)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_int_225 = PyInt_FromLong(225); if (unlikely(!__pyx_int_225)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_int_226 = PyInt_FromLong(226); if (unlikely(!__pyx_int_226)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_int_227 = PyInt_FromLong(227); if (unlikely(!__pyx_int_227)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_int_228 = PyInt_FromLong(228); if (unlikely(!__pyx_int_228)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_int_229 = PyInt_FromLong(229); if (unlikely(!__pyx_int_229)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_int_230 = PyInt_FromLong(230); if (unlikely(!__pyx_int_230)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_int_231 = PyInt_FromLong(231); if (unlikely(!__pyx_int_231)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_int_232 = PyInt_FromLong(232); if (unlikely(!__pyx_int_232)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_int_233 = PyInt_FromLong(233); if (unlikely(!__pyx_int_233)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_int_235 = PyInt_FromLong(235); if (unlikely(!__pyx_int_235)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_int_236 = PyInt_FromLong(236); if (unlikely(!__pyx_int_236)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_int_237 = PyInt_FromLong(237); if (unlikely(!__pyx_int_237)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_int_238 = PyInt_FromLong(238); if (unlikely(!__pyx_int_238)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_int_239 = PyInt_FromLong(239); if (unlikely(!__pyx_int_239)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_int_240 = PyInt_FromLong(240); if (unlikely(!__pyx_int_240)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_int_242 = PyInt_FromLong(242); if (unlikely(!__pyx_int_242)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_int_244 = PyInt_FromLong(244); if (unlikely(!__pyx_int_244)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_int_245 = PyInt_FromLong(245); if (unlikely(!__pyx_int_245)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_int_246 = PyInt_FromLong(246); if (unlikely(!__pyx_int_246)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_int_247 = PyInt_FromLong(247); if (unlikely(!__pyx_int_247)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_int_248 = PyInt_FromLong(248); if (unlikely(!__pyx_int_248)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_int_250 = PyInt_FromLong(250); if (unlikely(!__pyx_int_250)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_int_251 = PyInt_FromLong(251); if (unlikely(!__pyx_int_251)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_int_252 = PyInt_FromLong(252); if (unlikely(!__pyx_int_252)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_int_253 = PyInt_FromLong(253); if (unlikely(!__pyx_int_253)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_int_255 = PyInt_FromLong(255); if (unlikely(!__pyx_int_255)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} return 0; __pyx_L1_error:; return -1; } #if PY_MAJOR_VERSION < 3 PyMODINIT_FUNC initcolor(void); /*proto*/ PyMODINIT_FUNC initcolor(void) #else PyMODINIT_FUNC PyInit_color(void); /*proto*/ PyMODINIT_FUNC PyInit_color(void) #endif { PyObject *__pyx_t_1 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannyDeclarations #if CYTHON_REFNANNY __Pyx_RefNanny = __Pyx_RefNannyImportAPI("refnanny"); if (!__Pyx_RefNanny) { PyErr_Clear(); __Pyx_RefNanny = __Pyx_RefNannyImportAPI("Cython.Runtime.refnanny"); if (!__Pyx_RefNanny) Py_FatalError("failed to import 'refnanny' module"); } #endif __Pyx_RefNannySetupContext("PyMODINIT_FUNC PyInit_color(void)", 0); if (__Pyx_check_binary_version() < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_empty_tuple = PyTuple_New(0); if (unlikely(!__pyx_empty_tuple)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_empty_bytes = PyBytes_FromStringAndSize("", 0); if (unlikely(!__pyx_empty_bytes)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} #ifdef __Pyx_CyFunction_USED if (__pyx_CyFunction_init() < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} #endif #ifdef __Pyx_FusedFunction_USED if (__pyx_FusedFunction_init() < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} #endif #ifdef __Pyx_Coroutine_USED if (__pyx_Coroutine_init() < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} #endif #ifdef __Pyx_Generator_USED if (__pyx_Generator_init() < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} #endif #ifdef __Pyx_StopAsyncIteration_USED if (__pyx_StopAsyncIteration_init() < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} #endif /*--- Library function declarations ---*/ /*--- Threads initialization code ---*/ #if defined(__PYX_FORCE_INIT_THREADS) && __PYX_FORCE_INIT_THREADS #ifdef WITH_THREAD /* Python build with threading support? */ PyEval_InitThreads(); #endif #endif /*--- Module creation code ---*/ #if PY_MAJOR_VERSION < 3 __pyx_m = Py_InitModule4("color", __pyx_methods, 0, 0, PYTHON_API_VERSION); Py_XINCREF(__pyx_m); #else __pyx_m = PyModule_Create(&__pyx_moduledef); #endif if (unlikely(!__pyx_m)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_d = PyModule_GetDict(__pyx_m); if (unlikely(!__pyx_d)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} Py_INCREF(__pyx_d); __pyx_b = PyImport_AddModule(__Pyx_BUILTIN_MODULE_NAME); if (unlikely(!__pyx_b)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} #if CYTHON_COMPILING_IN_PYPY Py_INCREF(__pyx_b); #endif if (PyObject_SetAttrString(__pyx_m, "__builtins__", __pyx_b) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; /*--- Initialize various global constants etc. ---*/ if (__Pyx_InitGlobals() < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} #if PY_MAJOR_VERSION < 3 && (__PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT) if (__Pyx_init_sys_getdefaultencoding_params() < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} #endif if (__pyx_module_is_main_pygame_sdl2__color) { if (PyObject_SetAttrString(__pyx_m, "__name__", __pyx_n_s_main) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } #if PY_MAJOR_VERSION >= 3 { PyObject *modules = PyImport_GetModuleDict(); if (unlikely(!modules)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} if (!PyDict_GetItemString(modules, "pygame_sdl2.color")) { if (unlikely(PyDict_SetItemString(modules, "pygame_sdl2.color", __pyx_m) < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } } #endif /*--- Builtin init code ---*/ if (__Pyx_InitCachedBuiltins() < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /*--- Constants init code ---*/ if (__Pyx_InitCachedConstants() < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /*--- Global init code ---*/ __pyx_v_11pygame_sdl2_5color_colors = Py_None; Py_INCREF(Py_None); /*--- Variable export code ---*/ /*--- Function export code ---*/ if (__Pyx_ExportFunction("map_color", (void (*)(void))__pyx_f_11pygame_sdl2_5color_map_color, "Uint32 (SDL_Surface *, PyObject *)") < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} if (__Pyx_ExportFunction("get_color", (void (*)(void))__pyx_f_11pygame_sdl2_5color_get_color, "PyObject *(Uint32, SDL_Surface *)") < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} if (__Pyx_ExportFunction("to_sdl_color", (void (*)(void))__pyx_f_11pygame_sdl2_5color_to_sdl_color, "PyObject *(PyObject *, SDL_Color *)") < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /*--- Type init code ---*/ __pyx_vtabptr_11pygame_sdl2_5color_Color = &__pyx_vtable_11pygame_sdl2_5color_Color; __pyx_vtable_11pygame_sdl2_5color_Color.from_rgba = (PyObject *(*)(struct __pyx_obj_11pygame_sdl2_5color_Color *, Uint8, Uint8, Uint8, Uint8))__pyx_f_11pygame_sdl2_5color_5Color_from_rgba; __pyx_vtable_11pygame_sdl2_5color_Color.from_name = (PyObject *(*)(struct __pyx_obj_11pygame_sdl2_5color_Color *, PyObject *))__pyx_f_11pygame_sdl2_5color_5Color_from_name; __pyx_vtable_11pygame_sdl2_5color_Color.from_hex = (PyObject *(*)(struct __pyx_obj_11pygame_sdl2_5color_Color *, PyObject *))__pyx_f_11pygame_sdl2_5color_5Color_from_hex; if (PyType_Ready(&__pyx_type_11pygame_sdl2_5color_Color) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 63; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_type_11pygame_sdl2_5color_Color.tp_print = 0; if (__Pyx_SetVtable(__pyx_type_11pygame_sdl2_5color_Color.tp_dict, __pyx_vtabptr_11pygame_sdl2_5color_Color) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 63; __pyx_clineno = __LINE__; goto __pyx_L1_error;} if (PyObject_SetAttrString(__pyx_m, "Color", (PyObject *)&__pyx_type_11pygame_sdl2_5color_Color) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 63; __pyx_clineno = __LINE__; goto __pyx_L1_error;} if (__pyx_type_11pygame_sdl2_5color_Color.tp_weaklistoffset == 0) __pyx_type_11pygame_sdl2_5color_Color.tp_weaklistoffset = offsetof(struct __pyx_obj_11pygame_sdl2_5color_Color, __weakref__); __pyx_ptype_11pygame_sdl2_5color_Color = &__pyx_type_11pygame_sdl2_5color_Color; if (PyType_Ready(&__pyx_type_11pygame_sdl2_5color___pyx_scope_struct__correct_gamma) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 452; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_type_11pygame_sdl2_5color___pyx_scope_struct__correct_gamma.tp_print = 0; __pyx_ptype_11pygame_sdl2_5color___pyx_scope_struct__correct_gamma = &__pyx_type_11pygame_sdl2_5color___pyx_scope_struct__correct_gamma; /*--- Type import code ---*/ /*--- Variable import code ---*/ /*--- Function import code ---*/ /*--- Execution code ---*/ #if defined(__Pyx_Generator_USED) || defined(__Pyx_Coroutine_USED) if (__Pyx_patch_abc() < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} #endif /* "pygame_sdl2/color.pyx":21 * * from sdl2 cimport * * import binascii # <<<<<<<<<<<<<< * import struct * */ __pyx_t_1 = __Pyx_Import(__pyx_n_s_binascii, 0, -1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 21; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); if (PyDict_SetItem(__pyx_d, __pyx_n_s_binascii, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 21; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "pygame_sdl2/color.pyx":22 * from sdl2 cimport * * import binascii * import struct # <<<<<<<<<<<<<< * * include "color_dict.pxi" */ __pyx_t_1 = __Pyx_Import(__pyx_n_s_struct, 0, -1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 22; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); if (PyDict_SetItem(__pyx_d, __pyx_n_s_struct, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 22; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "include/color_dict.pxi":5 * * cdef object colors = { * 'aliceblue' : (240, 248, 255), # <<<<<<<<<<<<<< * 'antiquewhite' : (250, 235, 215), * 'antiquewhite1' : (255, 239, 219), */ __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_aliceblue, __pyx_tuple__12) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "include/color_dict.pxi":6 * cdef object colors = { * 'aliceblue' : (240, 248, 255), * 'antiquewhite' : (250, 235, 215), # <<<<<<<<<<<<<< * 'antiquewhite1' : (255, 239, 219), * 'antiquewhite2' : (238, 223, 204), */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_antiquewhite, __pyx_tuple__13) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "include/color_dict.pxi":7 * 'aliceblue' : (240, 248, 255), * 'antiquewhite' : (250, 235, 215), * 'antiquewhite1' : (255, 239, 219), # <<<<<<<<<<<<<< * 'antiquewhite2' : (238, 223, 204), * 'antiquewhite3' : (205, 192, 176), */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_antiquewhite1, __pyx_tuple__14) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "include/color_dict.pxi":8 * 'antiquewhite' : (250, 235, 215), * 'antiquewhite1' : (255, 239, 219), * 'antiquewhite2' : (238, 223, 204), # <<<<<<<<<<<<<< * 'antiquewhite3' : (205, 192, 176), * 'antiquewhite4' : (139, 131, 120), */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_antiquewhite2, __pyx_tuple__15) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "include/color_dict.pxi":9 * 'antiquewhite1' : (255, 239, 219), * 'antiquewhite2' : (238, 223, 204), * 'antiquewhite3' : (205, 192, 176), # <<<<<<<<<<<<<< * 'antiquewhite4' : (139, 131, 120), * 'aqua' : (0, 255, 255), */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_antiquewhite3, __pyx_tuple__16) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "include/color_dict.pxi":10 * 'antiquewhite2' : (238, 223, 204), * 'antiquewhite3' : (205, 192, 176), * 'antiquewhite4' : (139, 131, 120), # <<<<<<<<<<<<<< * 'aqua' : (0, 255, 255), * 'aquamarine' : (127, 255, 212), */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_antiquewhite4, __pyx_tuple__17) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "include/color_dict.pxi":11 * 'antiquewhite3' : (205, 192, 176), * 'antiquewhite4' : (139, 131, 120), * 'aqua' : (0, 255, 255), # <<<<<<<<<<<<<< * 'aquamarine' : (127, 255, 212), * 'aquamarine1' : (127, 255, 212), */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_aqua, __pyx_tuple__18) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "include/color_dict.pxi":12 * 'antiquewhite4' : (139, 131, 120), * 'aqua' : (0, 255, 255), * 'aquamarine' : (127, 255, 212), # <<<<<<<<<<<<<< * 'aquamarine1' : (127, 255, 212), * 'aquamarine2' : (118, 238, 198), */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_aquamarine, __pyx_tuple__19) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "include/color_dict.pxi":13 * 'aqua' : (0, 255, 255), * 'aquamarine' : (127, 255, 212), * 'aquamarine1' : (127, 255, 212), # <<<<<<<<<<<<<< * 'aquamarine2' : (118, 238, 198), * 'aquamarine3' : (102, 205, 170), */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_aquamarine1, __pyx_tuple__20) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "include/color_dict.pxi":14 * 'aquamarine' : (127, 255, 212), * 'aquamarine1' : (127, 255, 212), * 'aquamarine2' : (118, 238, 198), # <<<<<<<<<<<<<< * 'aquamarine3' : (102, 205, 170), * 'aquamarine4' : (69, 139, 116), */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_aquamarine2, __pyx_tuple__21) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "include/color_dict.pxi":15 * 'aquamarine1' : (127, 255, 212), * 'aquamarine2' : (118, 238, 198), * 'aquamarine3' : (102, 205, 170), # <<<<<<<<<<<<<< * 'aquamarine4' : (69, 139, 116), * 'azure' : (240, 255, 255), */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_aquamarine3, __pyx_tuple__22) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "include/color_dict.pxi":16 * 'aquamarine2' : (118, 238, 198), * 'aquamarine3' : (102, 205, 170), * 'aquamarine4' : (69, 139, 116), # <<<<<<<<<<<<<< * 'azure' : (240, 255, 255), * 'azure1' : (240, 255, 255), */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_aquamarine4, __pyx_tuple__23) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "include/color_dict.pxi":17 * 'aquamarine3' : (102, 205, 170), * 'aquamarine4' : (69, 139, 116), * 'azure' : (240, 255, 255), # <<<<<<<<<<<<<< * 'azure1' : (240, 255, 255), * 'azure2' : (224, 238, 238), */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_azure, __pyx_tuple__24) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "include/color_dict.pxi":18 * 'aquamarine4' : (69, 139, 116), * 'azure' : (240, 255, 255), * 'azure1' : (240, 255, 255), # <<<<<<<<<<<<<< * 'azure2' : (224, 238, 238), * 'azure3' : (193, 205, 205), */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_azure1, __pyx_tuple__25) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "include/color_dict.pxi":19 * 'azure' : (240, 255, 255), * 'azure1' : (240, 255, 255), * 'azure2' : (224, 238, 238), # <<<<<<<<<<<<<< * 'azure3' : (193, 205, 205), * 'azure4' : (131, 139, 139), */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_azure2, __pyx_tuple__26) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "include/color_dict.pxi":20 * 'azure1' : (240, 255, 255), * 'azure2' : (224, 238, 238), * 'azure3' : (193, 205, 205), # <<<<<<<<<<<<<< * 'azure4' : (131, 139, 139), * 'beige' : (245, 245, 220), */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_azure3, __pyx_tuple__27) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "include/color_dict.pxi":21 * 'azure2' : (224, 238, 238), * 'azure3' : (193, 205, 205), * 'azure4' : (131, 139, 139), # <<<<<<<<<<<<<< * 'beige' : (245, 245, 220), * 'bisque' : (255, 228, 196), */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_azure4, __pyx_tuple__28) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "include/color_dict.pxi":22 * 'azure3' : (193, 205, 205), * 'azure4' : (131, 139, 139), * 'beige' : (245, 245, 220), # <<<<<<<<<<<<<< * 'bisque' : (255, 228, 196), * 'bisque1' : (255, 228, 196), */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_beige, __pyx_tuple__29) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "include/color_dict.pxi":23 * 'azure4' : (131, 139, 139), * 'beige' : (245, 245, 220), * 'bisque' : (255, 228, 196), # <<<<<<<<<<<<<< * 'bisque1' : (255, 228, 196), * 'bisque2' : (238, 213, 183), */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_bisque, __pyx_tuple__30) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "include/color_dict.pxi":24 * 'beige' : (245, 245, 220), * 'bisque' : (255, 228, 196), * 'bisque1' : (255, 228, 196), # <<<<<<<<<<<<<< * 'bisque2' : (238, 213, 183), * 'bisque3' : (205, 183, 158), */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_bisque1, __pyx_tuple__31) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "include/color_dict.pxi":25 * 'bisque' : (255, 228, 196), * 'bisque1' : (255, 228, 196), * 'bisque2' : (238, 213, 183), # <<<<<<<<<<<<<< * 'bisque3' : (205, 183, 158), * 'bisque4' : (139, 125, 107), */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_bisque2, __pyx_tuple__32) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "include/color_dict.pxi":26 * 'bisque1' : (255, 228, 196), * 'bisque2' : (238, 213, 183), * 'bisque3' : (205, 183, 158), # <<<<<<<<<<<<<< * 'bisque4' : (139, 125, 107), * 'black' : (0, 0, 0), */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_bisque3, __pyx_tuple__33) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "include/color_dict.pxi":27 * 'bisque2' : (238, 213, 183), * 'bisque3' : (205, 183, 158), * 'bisque4' : (139, 125, 107), # <<<<<<<<<<<<<< * 'black' : (0, 0, 0), * 'blanchedalmond' : (255, 235, 205), */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_bisque4, __pyx_tuple__34) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "include/color_dict.pxi":28 * 'bisque3' : (205, 183, 158), * 'bisque4' : (139, 125, 107), * 'black' : (0, 0, 0), # <<<<<<<<<<<<<< * 'blanchedalmond' : (255, 235, 205), * 'blue' : (0, 0, 255), */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_black, __pyx_tuple__35) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "include/color_dict.pxi":29 * 'bisque4' : (139, 125, 107), * 'black' : (0, 0, 0), * 'blanchedalmond' : (255, 235, 205), # <<<<<<<<<<<<<< * 'blue' : (0, 0, 255), * 'blue1' : (0, 0, 255), */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_blanchedalmond, __pyx_tuple__36) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "include/color_dict.pxi":30 * 'black' : (0, 0, 0), * 'blanchedalmond' : (255, 235, 205), * 'blue' : (0, 0, 255), # <<<<<<<<<<<<<< * 'blue1' : (0, 0, 255), * 'blue2' : (0, 0, 238), */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_blue, __pyx_tuple__37) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "include/color_dict.pxi":31 * 'blanchedalmond' : (255, 235, 205), * 'blue' : (0, 0, 255), * 'blue1' : (0, 0, 255), # <<<<<<<<<<<<<< * 'blue2' : (0, 0, 238), * 'blue3' : (0, 0, 205), */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_blue1, __pyx_tuple__38) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "include/color_dict.pxi":32 * 'blue' : (0, 0, 255), * 'blue1' : (0, 0, 255), * 'blue2' : (0, 0, 238), # <<<<<<<<<<<<<< * 'blue3' : (0, 0, 205), * 'blue4' : (0, 0, 139), */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_blue2, __pyx_tuple__39) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "include/color_dict.pxi":33 * 'blue1' : (0, 0, 255), * 'blue2' : (0, 0, 238), * 'blue3' : (0, 0, 205), # <<<<<<<<<<<<<< * 'blue4' : (0, 0, 139), * 'blueviolet' : (138, 43, 226), */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_blue3, __pyx_tuple__40) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "include/color_dict.pxi":34 * 'blue2' : (0, 0, 238), * 'blue3' : (0, 0, 205), * 'blue4' : (0, 0, 139), # <<<<<<<<<<<<<< * 'blueviolet' : (138, 43, 226), * 'brown' : (165, 42, 42), */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_blue4, __pyx_tuple__41) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "include/color_dict.pxi":35 * 'blue3' : (0, 0, 205), * 'blue4' : (0, 0, 139), * 'blueviolet' : (138, 43, 226), # <<<<<<<<<<<<<< * 'brown' : (165, 42, 42), * 'brown1' : (255, 64, 64), */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_blueviolet, __pyx_tuple__42) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "include/color_dict.pxi":36 * 'blue4' : (0, 0, 139), * 'blueviolet' : (138, 43, 226), * 'brown' : (165, 42, 42), # <<<<<<<<<<<<<< * 'brown1' : (255, 64, 64), * 'brown2' : (238, 59, 59), */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_brown, __pyx_tuple__43) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "include/color_dict.pxi":37 * 'blueviolet' : (138, 43, 226), * 'brown' : (165, 42, 42), * 'brown1' : (255, 64, 64), # <<<<<<<<<<<<<< * 'brown2' : (238, 59, 59), * 'brown3' : (205, 51, 51), */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_brown1, __pyx_tuple__44) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "include/color_dict.pxi":38 * 'brown' : (165, 42, 42), * 'brown1' : (255, 64, 64), * 'brown2' : (238, 59, 59), # <<<<<<<<<<<<<< * 'brown3' : (205, 51, 51), * 'brown4' : (139, 35, 35), */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_brown2, __pyx_tuple__45) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "include/color_dict.pxi":39 * 'brown1' : (255, 64, 64), * 'brown2' : (238, 59, 59), * 'brown3' : (205, 51, 51), # <<<<<<<<<<<<<< * 'brown4' : (139, 35, 35), * 'burlywood' : (222, 184, 135), */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_brown3, __pyx_tuple__46) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "include/color_dict.pxi":40 * 'brown2' : (238, 59, 59), * 'brown3' : (205, 51, 51), * 'brown4' : (139, 35, 35), # <<<<<<<<<<<<<< * 'burlywood' : (222, 184, 135), * 'burlywood1' : (255, 211, 155), */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_brown4, __pyx_tuple__47) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "include/color_dict.pxi":41 * 'brown3' : (205, 51, 51), * 'brown4' : (139, 35, 35), * 'burlywood' : (222, 184, 135), # <<<<<<<<<<<<<< * 'burlywood1' : (255, 211, 155), * 'burlywood2' : (238, 197, 145), */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_burlywood, __pyx_tuple__48) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "include/color_dict.pxi":42 * 'brown4' : (139, 35, 35), * 'burlywood' : (222, 184, 135), * 'burlywood1' : (255, 211, 155), # <<<<<<<<<<<<<< * 'burlywood2' : (238, 197, 145), * 'burlywood3' : (205, 170, 125), */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_burlywood1, __pyx_tuple__49) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "include/color_dict.pxi":43 * 'burlywood' : (222, 184, 135), * 'burlywood1' : (255, 211, 155), * 'burlywood2' : (238, 197, 145), # <<<<<<<<<<<<<< * 'burlywood3' : (205, 170, 125), * 'burlywood4' : (139, 115, 85), */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_burlywood2, __pyx_tuple__50) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "include/color_dict.pxi":44 * 'burlywood1' : (255, 211, 155), * 'burlywood2' : (238, 197, 145), * 'burlywood3' : (205, 170, 125), # <<<<<<<<<<<<<< * 'burlywood4' : (139, 115, 85), * 'cadetblue' : (95, 158, 160), */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_burlywood3, __pyx_tuple__51) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "include/color_dict.pxi":45 * 'burlywood2' : (238, 197, 145), * 'burlywood3' : (205, 170, 125), * 'burlywood4' : (139, 115, 85), # <<<<<<<<<<<<<< * 'cadetblue' : (95, 158, 160), * 'cadetblue1' : (152, 245, 255), */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_burlywood4, __pyx_tuple__52) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "include/color_dict.pxi":46 * 'burlywood3' : (205, 170, 125), * 'burlywood4' : (139, 115, 85), * 'cadetblue' : (95, 158, 160), # <<<<<<<<<<<<<< * 'cadetblue1' : (152, 245, 255), * 'cadetblue2' : (142, 229, 238), */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_cadetblue, __pyx_tuple__53) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "include/color_dict.pxi":47 * 'burlywood4' : (139, 115, 85), * 'cadetblue' : (95, 158, 160), * 'cadetblue1' : (152, 245, 255), # <<<<<<<<<<<<<< * 'cadetblue2' : (142, 229, 238), * 'cadetblue3' : (122, 197, 205), */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_cadetblue1, __pyx_tuple__54) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "include/color_dict.pxi":48 * 'cadetblue' : (95, 158, 160), * 'cadetblue1' : (152, 245, 255), * 'cadetblue2' : (142, 229, 238), # <<<<<<<<<<<<<< * 'cadetblue3' : (122, 197, 205), * 'cadetblue4' : (83, 134, 139), */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_cadetblue2, __pyx_tuple__55) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "include/color_dict.pxi":49 * 'cadetblue1' : (152, 245, 255), * 'cadetblue2' : (142, 229, 238), * 'cadetblue3' : (122, 197, 205), # <<<<<<<<<<<<<< * 'cadetblue4' : (83, 134, 139), * 'chartreuse' : (127, 255, 0), */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_cadetblue3, __pyx_tuple__56) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "include/color_dict.pxi":50 * 'cadetblue2' : (142, 229, 238), * 'cadetblue3' : (122, 197, 205), * 'cadetblue4' : (83, 134, 139), # <<<<<<<<<<<<<< * 'chartreuse' : (127, 255, 0), * 'chartreuse1' : (127, 255, 0), */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_cadetblue4, __pyx_tuple__57) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "include/color_dict.pxi":51 * 'cadetblue3' : (122, 197, 205), * 'cadetblue4' : (83, 134, 139), * 'chartreuse' : (127, 255, 0), # <<<<<<<<<<<<<< * 'chartreuse1' : (127, 255, 0), * 'chartreuse2' : (118, 238, 0), */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_chartreuse, __pyx_tuple__58) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "include/color_dict.pxi":52 * 'cadetblue4' : (83, 134, 139), * 'chartreuse' : (127, 255, 0), * 'chartreuse1' : (127, 255, 0), # <<<<<<<<<<<<<< * 'chartreuse2' : (118, 238, 0), * 'chartreuse3' : (102, 205, 0), */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_chartreuse1, __pyx_tuple__59) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "include/color_dict.pxi":53 * 'chartreuse' : (127, 255, 0), * 'chartreuse1' : (127, 255, 0), * 'chartreuse2' : (118, 238, 0), # <<<<<<<<<<<<<< * 'chartreuse3' : (102, 205, 0), * 'chartreuse4' : (69, 139, 0), */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_chartreuse2, __pyx_tuple__60) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "include/color_dict.pxi":54 * 'chartreuse1' : (127, 255, 0), * 'chartreuse2' : (118, 238, 0), * 'chartreuse3' : (102, 205, 0), # <<<<<<<<<<<<<< * 'chartreuse4' : (69, 139, 0), * 'chocolate' : (210, 105, 30), */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_chartreuse3, __pyx_tuple__61) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "include/color_dict.pxi":55 * 'chartreuse2' : (118, 238, 0), * 'chartreuse3' : (102, 205, 0), * 'chartreuse4' : (69, 139, 0), # <<<<<<<<<<<<<< * 'chocolate' : (210, 105, 30), * 'chocolate1' : (255, 127, 36), */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_chartreuse4, __pyx_tuple__62) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "include/color_dict.pxi":56 * 'chartreuse3' : (102, 205, 0), * 'chartreuse4' : (69, 139, 0), * 'chocolate' : (210, 105, 30), # <<<<<<<<<<<<<< * 'chocolate1' : (255, 127, 36), * 'chocolate2' : (238, 118, 33), */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_chocolate, __pyx_tuple__63) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "include/color_dict.pxi":57 * 'chartreuse4' : (69, 139, 0), * 'chocolate' : (210, 105, 30), * 'chocolate1' : (255, 127, 36), # <<<<<<<<<<<<<< * 'chocolate2' : (238, 118, 33), * 'chocolate3' : (205, 102, 29), */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_chocolate1, __pyx_tuple__64) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "include/color_dict.pxi":58 * 'chocolate' : (210, 105, 30), * 'chocolate1' : (255, 127, 36), * 'chocolate2' : (238, 118, 33), # <<<<<<<<<<<<<< * 'chocolate3' : (205, 102, 29), * 'chocolate4' : (139, 69, 19), */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_chocolate2, __pyx_tuple__65) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "include/color_dict.pxi":59 * 'chocolate1' : (255, 127, 36), * 'chocolate2' : (238, 118, 33), * 'chocolate3' : (205, 102, 29), # <<<<<<<<<<<<<< * 'chocolate4' : (139, 69, 19), * 'coral' : (255, 127, 80), */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_chocolate3, __pyx_tuple__66) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "include/color_dict.pxi":60 * 'chocolate2' : (238, 118, 33), * 'chocolate3' : (205, 102, 29), * 'chocolate4' : (139, 69, 19), # <<<<<<<<<<<<<< * 'coral' : (255, 127, 80), * 'coral1' : (255, 114, 86), */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_chocolate4, __pyx_tuple__67) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "include/color_dict.pxi":61 * 'chocolate3' : (205, 102, 29), * 'chocolate4' : (139, 69, 19), * 'coral' : (255, 127, 80), # <<<<<<<<<<<<<< * 'coral1' : (255, 114, 86), * 'coral2' : (238, 106, 80), */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_coral, __pyx_tuple__68) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "include/color_dict.pxi":62 * 'chocolate4' : (139, 69, 19), * 'coral' : (255, 127, 80), * 'coral1' : (255, 114, 86), # <<<<<<<<<<<<<< * 'coral2' : (238, 106, 80), * 'coral3' : (205, 91, 69), */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_coral1, __pyx_tuple__69) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "include/color_dict.pxi":63 * 'coral' : (255, 127, 80), * 'coral1' : (255, 114, 86), * 'coral2' : (238, 106, 80), # <<<<<<<<<<<<<< * 'coral3' : (205, 91, 69), * 'coral4' : (139, 62, 47), */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_coral2, __pyx_tuple__70) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "include/color_dict.pxi":64 * 'coral1' : (255, 114, 86), * 'coral2' : (238, 106, 80), * 'coral3' : (205, 91, 69), # <<<<<<<<<<<<<< * 'coral4' : (139, 62, 47), * 'cornflowerblue' : (100, 149, 237), */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_coral3, __pyx_tuple__71) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "include/color_dict.pxi":65 * 'coral2' : (238, 106, 80), * 'coral3' : (205, 91, 69), * 'coral4' : (139, 62, 47), # <<<<<<<<<<<<<< * 'cornflowerblue' : (100, 149, 237), * 'cornsilk' : (255, 248, 220), */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_coral4, __pyx_tuple__72) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "include/color_dict.pxi":66 * 'coral3' : (205, 91, 69), * 'coral4' : (139, 62, 47), * 'cornflowerblue' : (100, 149, 237), # <<<<<<<<<<<<<< * 'cornsilk' : (255, 248, 220), * 'cornsilk1' : (255, 248, 220), */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_cornflowerblue, __pyx_tuple__73) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "include/color_dict.pxi":67 * 'coral4' : (139, 62, 47), * 'cornflowerblue' : (100, 149, 237), * 'cornsilk' : (255, 248, 220), # <<<<<<<<<<<<<< * 'cornsilk1' : (255, 248, 220), * 'cornsilk2' : (238, 232, 205), */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_cornsilk, __pyx_tuple__74) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "include/color_dict.pxi":68 * 'cornflowerblue' : (100, 149, 237), * 'cornsilk' : (255, 248, 220), * 'cornsilk1' : (255, 248, 220), # <<<<<<<<<<<<<< * 'cornsilk2' : (238, 232, 205), * 'cornsilk3' : (205, 200, 177), */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_cornsilk1, __pyx_tuple__75) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "include/color_dict.pxi":69 * 'cornsilk' : (255, 248, 220), * 'cornsilk1' : (255, 248, 220), * 'cornsilk2' : (238, 232, 205), # <<<<<<<<<<<<<< * 'cornsilk3' : (205, 200, 177), * 'cornsilk4' : (139, 136, 120), */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_cornsilk2, __pyx_tuple__76) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "include/color_dict.pxi":70 * 'cornsilk1' : (255, 248, 220), * 'cornsilk2' : (238, 232, 205), * 'cornsilk3' : (205, 200, 177), # <<<<<<<<<<<<<< * 'cornsilk4' : (139, 136, 120), * 'crimson' : (220, 20, 60), */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_cornsilk3, __pyx_tuple__77) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "include/color_dict.pxi":71 * 'cornsilk2' : (238, 232, 205), * 'cornsilk3' : (205, 200, 177), * 'cornsilk4' : (139, 136, 120), # <<<<<<<<<<<<<< * 'crimson' : (220, 20, 60), * 'cyan' : (0, 255, 255), */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_cornsilk4, __pyx_tuple__78) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "include/color_dict.pxi":72 * 'cornsilk3' : (205, 200, 177), * 'cornsilk4' : (139, 136, 120), * 'crimson' : (220, 20, 60), # <<<<<<<<<<<<<< * 'cyan' : (0, 255, 255), * 'cyan1' : (0, 255, 255), */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_crimson, __pyx_tuple__79) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "include/color_dict.pxi":73 * 'cornsilk4' : (139, 136, 120), * 'crimson' : (220, 20, 60), * 'cyan' : (0, 255, 255), # <<<<<<<<<<<<<< * 'cyan1' : (0, 255, 255), * 'cyan2' : (0, 238, 238), */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_cyan, __pyx_tuple__80) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "include/color_dict.pxi":74 * 'crimson' : (220, 20, 60), * 'cyan' : (0, 255, 255), * 'cyan1' : (0, 255, 255), # <<<<<<<<<<<<<< * 'cyan2' : (0, 238, 238), * 'cyan3' : (0, 205, 205), */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_cyan1, __pyx_tuple__81) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "include/color_dict.pxi":75 * 'cyan' : (0, 255, 255), * 'cyan1' : (0, 255, 255), * 'cyan2' : (0, 238, 238), # <<<<<<<<<<<<<< * 'cyan3' : (0, 205, 205), * 'cyan4' : (0, 139, 139), */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_cyan2, __pyx_tuple__82) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "include/color_dict.pxi":76 * 'cyan1' : (0, 255, 255), * 'cyan2' : (0, 238, 238), * 'cyan3' : (0, 205, 205), # <<<<<<<<<<<<<< * 'cyan4' : (0, 139, 139), * 'darkblue' : (0, 0, 139), */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_cyan3, __pyx_tuple__83) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "include/color_dict.pxi":77 * 'cyan2' : (0, 238, 238), * 'cyan3' : (0, 205, 205), * 'cyan4' : (0, 139, 139), # <<<<<<<<<<<<<< * 'darkblue' : (0, 0, 139), * 'darkcyan' : (0, 139, 139), */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_cyan4, __pyx_tuple__84) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "include/color_dict.pxi":78 * 'cyan3' : (0, 205, 205), * 'cyan4' : (0, 139, 139), * 'darkblue' : (0, 0, 139), # <<<<<<<<<<<<<< * 'darkcyan' : (0, 139, 139), * 'darkgoldenrod' : (184, 134, 11), */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_darkblue, __pyx_tuple__85) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "include/color_dict.pxi":79 * 'cyan4' : (0, 139, 139), * 'darkblue' : (0, 0, 139), * 'darkcyan' : (0, 139, 139), # <<<<<<<<<<<<<< * 'darkgoldenrod' : (184, 134, 11), * 'darkgoldenrod1' : (255, 185, 15), */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_darkcyan, __pyx_tuple__86) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "include/color_dict.pxi":80 * 'darkblue' : (0, 0, 139), * 'darkcyan' : (0, 139, 139), * 'darkgoldenrod' : (184, 134, 11), # <<<<<<<<<<<<<< * 'darkgoldenrod1' : (255, 185, 15), * 'darkgoldenrod2' : (238, 173, 14), */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_darkgoldenrod, __pyx_tuple__87) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "include/color_dict.pxi":81 * 'darkcyan' : (0, 139, 139), * 'darkgoldenrod' : (184, 134, 11), * 'darkgoldenrod1' : (255, 185, 15), # <<<<<<<<<<<<<< * 'darkgoldenrod2' : (238, 173, 14), * 'darkgoldenrod3' : (205, 149, 12), */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_darkgoldenrod1, __pyx_tuple__88) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "include/color_dict.pxi":82 * 'darkgoldenrod' : (184, 134, 11), * 'darkgoldenrod1' : (255, 185, 15), * 'darkgoldenrod2' : (238, 173, 14), # <<<<<<<<<<<<<< * 'darkgoldenrod3' : (205, 149, 12), * 'darkgoldenrod4' : (139, 101, 8), */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_darkgoldenrod2, __pyx_tuple__89) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "include/color_dict.pxi":83 * 'darkgoldenrod1' : (255, 185, 15), * 'darkgoldenrod2' : (238, 173, 14), * 'darkgoldenrod3' : (205, 149, 12), # <<<<<<<<<<<<<< * 'darkgoldenrod4' : (139, 101, 8), * 'darkgray' : (169, 169, 169), */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_darkgoldenrod3, __pyx_tuple__90) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "include/color_dict.pxi":84 * 'darkgoldenrod2' : (238, 173, 14), * 'darkgoldenrod3' : (205, 149, 12), * 'darkgoldenrod4' : (139, 101, 8), # <<<<<<<<<<<<<< * 'darkgray' : (169, 169, 169), * 'darkgreen' : (0, 100, 0), */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_darkgoldenrod4, __pyx_tuple__91) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "include/color_dict.pxi":85 * 'darkgoldenrod3' : (205, 149, 12), * 'darkgoldenrod4' : (139, 101, 8), * 'darkgray' : (169, 169, 169), # <<<<<<<<<<<<<< * 'darkgreen' : (0, 100, 0), * 'darkgrey' : (169, 169, 169), */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_darkgray, __pyx_tuple__92) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "include/color_dict.pxi":86 * 'darkgoldenrod4' : (139, 101, 8), * 'darkgray' : (169, 169, 169), * 'darkgreen' : (0, 100, 0), # <<<<<<<<<<<<<< * 'darkgrey' : (169, 169, 169), * 'darkkhaki' : (189, 183, 107), */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_darkgreen, __pyx_tuple__93) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "include/color_dict.pxi":87 * 'darkgray' : (169, 169, 169), * 'darkgreen' : (0, 100, 0), * 'darkgrey' : (169, 169, 169), # <<<<<<<<<<<<<< * 'darkkhaki' : (189, 183, 107), * 'darkmagenta' : (139, 0, 139), */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_darkgrey, __pyx_tuple__94) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "include/color_dict.pxi":88 * 'darkgreen' : (0, 100, 0), * 'darkgrey' : (169, 169, 169), * 'darkkhaki' : (189, 183, 107), # <<<<<<<<<<<<<< * 'darkmagenta' : (139, 0, 139), * 'darkolivegreen' : (85, 107, 47), */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_darkkhaki, __pyx_tuple__95) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "include/color_dict.pxi":89 * 'darkgrey' : (169, 169, 169), * 'darkkhaki' : (189, 183, 107), * 'darkmagenta' : (139, 0, 139), # <<<<<<<<<<<<<< * 'darkolivegreen' : (85, 107, 47), * 'darkolivegreen1' : (202, 255, 112), */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_darkmagenta, __pyx_tuple__96) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "include/color_dict.pxi":90 * 'darkkhaki' : (189, 183, 107), * 'darkmagenta' : (139, 0, 139), * 'darkolivegreen' : (85, 107, 47), # <<<<<<<<<<<<<< * 'darkolivegreen1' : (202, 255, 112), * 'darkolivegreen2' : (188, 238, 104), */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_darkolivegreen, __pyx_tuple__97) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "include/color_dict.pxi":91 * 'darkmagenta' : (139, 0, 139), * 'darkolivegreen' : (85, 107, 47), * 'darkolivegreen1' : (202, 255, 112), # <<<<<<<<<<<<<< * 'darkolivegreen2' : (188, 238, 104), * 'darkolivegreen3' : (162, 205, 90), */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_darkolivegreen1, __pyx_tuple__98) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "include/color_dict.pxi":92 * 'darkolivegreen' : (85, 107, 47), * 'darkolivegreen1' : (202, 255, 112), * 'darkolivegreen2' : (188, 238, 104), # <<<<<<<<<<<<<< * 'darkolivegreen3' : (162, 205, 90), * 'darkolivegreen4' : (110, 139, 61), */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_darkolivegreen2, __pyx_tuple__99) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "include/color_dict.pxi":93 * 'darkolivegreen1' : (202, 255, 112), * 'darkolivegreen2' : (188, 238, 104), * 'darkolivegreen3' : (162, 205, 90), # <<<<<<<<<<<<<< * 'darkolivegreen4' : (110, 139, 61), * 'darkorange' : (255, 140, 0), */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_darkolivegreen3, __pyx_tuple__100) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "include/color_dict.pxi":94 * 'darkolivegreen2' : (188, 238, 104), * 'darkolivegreen3' : (162, 205, 90), * 'darkolivegreen4' : (110, 139, 61), # <<<<<<<<<<<<<< * 'darkorange' : (255, 140, 0), * 'darkorange1' : (255, 127, 0), */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_darkolivegreen4, __pyx_tuple__101) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "include/color_dict.pxi":95 * 'darkolivegreen3' : (162, 205, 90), * 'darkolivegreen4' : (110, 139, 61), * 'darkorange' : (255, 140, 0), # <<<<<<<<<<<<<< * 'darkorange1' : (255, 127, 0), * 'darkorange2' : (238, 118, 0), */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_darkorange, __pyx_tuple__102) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "include/color_dict.pxi":96 * 'darkolivegreen4' : (110, 139, 61), * 'darkorange' : (255, 140, 0), * 'darkorange1' : (255, 127, 0), # <<<<<<<<<<<<<< * 'darkorange2' : (238, 118, 0), * 'darkorange3' : (205, 102, 0), */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_darkorange1, __pyx_tuple__103) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "include/color_dict.pxi":97 * 'darkorange' : (255, 140, 0), * 'darkorange1' : (255, 127, 0), * 'darkorange2' : (238, 118, 0), # <<<<<<<<<<<<<< * 'darkorange3' : (205, 102, 0), * 'darkorange4' : (139, 69, 0), */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_darkorange2, __pyx_tuple__104) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "include/color_dict.pxi":98 * 'darkorange1' : (255, 127, 0), * 'darkorange2' : (238, 118, 0), * 'darkorange3' : (205, 102, 0), # <<<<<<<<<<<<<< * 'darkorange4' : (139, 69, 0), * 'darkorchid' : (153, 50, 204), */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_darkorange3, __pyx_tuple__105) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "include/color_dict.pxi":99 * 'darkorange2' : (238, 118, 0), * 'darkorange3' : (205, 102, 0), * 'darkorange4' : (139, 69, 0), # <<<<<<<<<<<<<< * 'darkorchid' : (153, 50, 204), * 'darkorchid1' : (191, 62, 255), */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_darkorange4, __pyx_tuple__106) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "include/color_dict.pxi":100 * 'darkorange3' : (205, 102, 0), * 'darkorange4' : (139, 69, 0), * 'darkorchid' : (153, 50, 204), # <<<<<<<<<<<<<< * 'darkorchid1' : (191, 62, 255), * 'darkorchid2' : (178, 58, 238), */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_darkorchid, __pyx_tuple__107) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "include/color_dict.pxi":101 * 'darkorange4' : (139, 69, 0), * 'darkorchid' : (153, 50, 204), * 'darkorchid1' : (191, 62, 255), # <<<<<<<<<<<<<< * 'darkorchid2' : (178, 58, 238), * 'darkorchid3' : (154, 50, 205), */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_darkorchid1, __pyx_tuple__108) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "include/color_dict.pxi":102 * 'darkorchid' : (153, 50, 204), * 'darkorchid1' : (191, 62, 255), * 'darkorchid2' : (178, 58, 238), # <<<<<<<<<<<<<< * 'darkorchid3' : (154, 50, 205), * 'darkorchid4' : (104, 34, 139), */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_darkorchid2, __pyx_tuple__109) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "include/color_dict.pxi":103 * 'darkorchid1' : (191, 62, 255), * 'darkorchid2' : (178, 58, 238), * 'darkorchid3' : (154, 50, 205), # <<<<<<<<<<<<<< * 'darkorchid4' : (104, 34, 139), * 'darkred' : (139, 0, 0), */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_darkorchid3, __pyx_tuple__110) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "include/color_dict.pxi":104 * 'darkorchid2' : (178, 58, 238), * 'darkorchid3' : (154, 50, 205), * 'darkorchid4' : (104, 34, 139), # <<<<<<<<<<<<<< * 'darkred' : (139, 0, 0), * 'darksalmon' : (233, 150, 122), */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_darkorchid4, __pyx_tuple__111) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "include/color_dict.pxi":105 * 'darkorchid3' : (154, 50, 205), * 'darkorchid4' : (104, 34, 139), * 'darkred' : (139, 0, 0), # <<<<<<<<<<<<<< * 'darksalmon' : (233, 150, 122), * 'darkseagreen' : (143, 188, 143), */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_darkred, __pyx_tuple__112) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "include/color_dict.pxi":106 * 'darkorchid4' : (104, 34, 139), * 'darkred' : (139, 0, 0), * 'darksalmon' : (233, 150, 122), # <<<<<<<<<<<<<< * 'darkseagreen' : (143, 188, 143), * 'darkseagreen1' : (193, 255, 193), */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_darksalmon, __pyx_tuple__113) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "include/color_dict.pxi":107 * 'darkred' : (139, 0, 0), * 'darksalmon' : (233, 150, 122), * 'darkseagreen' : (143, 188, 143), # <<<<<<<<<<<<<< * 'darkseagreen1' : (193, 255, 193), * 'darkseagreen2' : (180, 238, 180), */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_darkseagreen, __pyx_tuple__114) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "include/color_dict.pxi":108 * 'darksalmon' : (233, 150, 122), * 'darkseagreen' : (143, 188, 143), * 'darkseagreen1' : (193, 255, 193), # <<<<<<<<<<<<<< * 'darkseagreen2' : (180, 238, 180), * 'darkseagreen3' : (155, 205, 155), */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_darkseagreen1, __pyx_tuple__115) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "include/color_dict.pxi":109 * 'darkseagreen' : (143, 188, 143), * 'darkseagreen1' : (193, 255, 193), * 'darkseagreen2' : (180, 238, 180), # <<<<<<<<<<<<<< * 'darkseagreen3' : (155, 205, 155), * 'darkseagreen4' : (105, 139, 105), */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_darkseagreen2, __pyx_tuple__116) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "include/color_dict.pxi":110 * 'darkseagreen1' : (193, 255, 193), * 'darkseagreen2' : (180, 238, 180), * 'darkseagreen3' : (155, 205, 155), # <<<<<<<<<<<<<< * 'darkseagreen4' : (105, 139, 105), * 'darkslateblue' : (72, 61, 139), */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_darkseagreen3, __pyx_tuple__117) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "include/color_dict.pxi":111 * 'darkseagreen2' : (180, 238, 180), * 'darkseagreen3' : (155, 205, 155), * 'darkseagreen4' : (105, 139, 105), # <<<<<<<<<<<<<< * 'darkslateblue' : (72, 61, 139), * 'darkslategray' : (47, 79, 79), */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_darkseagreen4, __pyx_tuple__118) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "include/color_dict.pxi":112 * 'darkseagreen3' : (155, 205, 155), * 'darkseagreen4' : (105, 139, 105), * 'darkslateblue' : (72, 61, 139), # <<<<<<<<<<<<<< * 'darkslategray' : (47, 79, 79), * 'darkslategray1' : (151, 255, 255), */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_darkslateblue, __pyx_tuple__119) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "include/color_dict.pxi":113 * 'darkseagreen4' : (105, 139, 105), * 'darkslateblue' : (72, 61, 139), * 'darkslategray' : (47, 79, 79), # <<<<<<<<<<<<<< * 'darkslategray1' : (151, 255, 255), * 'darkslategray2' : (141, 238, 238), */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_darkslategray, __pyx_tuple__120) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "include/color_dict.pxi":114 * 'darkslateblue' : (72, 61, 139), * 'darkslategray' : (47, 79, 79), * 'darkslategray1' : (151, 255, 255), # <<<<<<<<<<<<<< * 'darkslategray2' : (141, 238, 238), * 'darkslategray3' : (121, 205, 205), */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_darkslategray1, __pyx_tuple__121) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "include/color_dict.pxi":115 * 'darkslategray' : (47, 79, 79), * 'darkslategray1' : (151, 255, 255), * 'darkslategray2' : (141, 238, 238), # <<<<<<<<<<<<<< * 'darkslategray3' : (121, 205, 205), * 'darkslategray4' : (82, 139, 139), */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_darkslategray2, __pyx_tuple__122) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "include/color_dict.pxi":116 * 'darkslategray1' : (151, 255, 255), * 'darkslategray2' : (141, 238, 238), * 'darkslategray3' : (121, 205, 205), # <<<<<<<<<<<<<< * 'darkslategray4' : (82, 139, 139), * 'darkslategrey' : (47, 79, 79), */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_darkslategray3, __pyx_tuple__123) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "include/color_dict.pxi":117 * 'darkslategray2' : (141, 238, 238), * 'darkslategray3' : (121, 205, 205), * 'darkslategray4' : (82, 139, 139), # <<<<<<<<<<<<<< * 'darkslategrey' : (47, 79, 79), * 'darkturquoise' : (0, 206, 209), */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_darkslategray4, __pyx_tuple__124) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "include/color_dict.pxi":118 * 'darkslategray3' : (121, 205, 205), * 'darkslategray4' : (82, 139, 139), * 'darkslategrey' : (47, 79, 79), # <<<<<<<<<<<<<< * 'darkturquoise' : (0, 206, 209), * 'darkviolet' : (148, 0, 211), */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_darkslategrey, __pyx_tuple__125) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "include/color_dict.pxi":119 * 'darkslategray4' : (82, 139, 139), * 'darkslategrey' : (47, 79, 79), * 'darkturquoise' : (0, 206, 209), # <<<<<<<<<<<<<< * 'darkviolet' : (148, 0, 211), * 'deeppink' : (255, 20, 147), */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_darkturquoise, __pyx_tuple__126) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "include/color_dict.pxi":120 * 'darkslategrey' : (47, 79, 79), * 'darkturquoise' : (0, 206, 209), * 'darkviolet' : (148, 0, 211), # <<<<<<<<<<<<<< * 'deeppink' : (255, 20, 147), * 'deeppink1' : (255, 20, 147), */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_darkviolet, __pyx_tuple__127) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "include/color_dict.pxi":121 * 'darkturquoise' : (0, 206, 209), * 'darkviolet' : (148, 0, 211), * 'deeppink' : (255, 20, 147), # <<<<<<<<<<<<<< * 'deeppink1' : (255, 20, 147), * 'deeppink2' : (238, 18, 137), */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_deeppink, __pyx_tuple__128) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "include/color_dict.pxi":122 * 'darkviolet' : (148, 0, 211), * 'deeppink' : (255, 20, 147), * 'deeppink1' : (255, 20, 147), # <<<<<<<<<<<<<< * 'deeppink2' : (238, 18, 137), * 'deeppink3' : (205, 16, 118), */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_deeppink1, __pyx_tuple__129) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "include/color_dict.pxi":123 * 'deeppink' : (255, 20, 147), * 'deeppink1' : (255, 20, 147), * 'deeppink2' : (238, 18, 137), # <<<<<<<<<<<<<< * 'deeppink3' : (205, 16, 118), * 'deeppink4' : (139, 10, 80), */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_deeppink2, __pyx_tuple__130) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "include/color_dict.pxi":124 * 'deeppink1' : (255, 20, 147), * 'deeppink2' : (238, 18, 137), * 'deeppink3' : (205, 16, 118), # <<<<<<<<<<<<<< * 'deeppink4' : (139, 10, 80), * 'deepskyblue' : (0, 191, 255), */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_deeppink3, __pyx_tuple__131) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "include/color_dict.pxi":125 * 'deeppink2' : (238, 18, 137), * 'deeppink3' : (205, 16, 118), * 'deeppink4' : (139, 10, 80), # <<<<<<<<<<<<<< * 'deepskyblue' : (0, 191, 255), * 'deepskyblue1' : (0, 191, 255), */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_deeppink4, __pyx_tuple__132) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "include/color_dict.pxi":126 * 'deeppink3' : (205, 16, 118), * 'deeppink4' : (139, 10, 80), * 'deepskyblue' : (0, 191, 255), # <<<<<<<<<<<<<< * 'deepskyblue1' : (0, 191, 255), * 'deepskyblue2' : (0, 178, 238), */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_deepskyblue, __pyx_tuple__133) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "include/color_dict.pxi":127 * 'deeppink4' : (139, 10, 80), * 'deepskyblue' : (0, 191, 255), * 'deepskyblue1' : (0, 191, 255), # <<<<<<<<<<<<<< * 'deepskyblue2' : (0, 178, 238), * 'deepskyblue3' : (0, 154, 205), */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_deepskyblue1, __pyx_tuple__134) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "include/color_dict.pxi":128 * 'deepskyblue' : (0, 191, 255), * 'deepskyblue1' : (0, 191, 255), * 'deepskyblue2' : (0, 178, 238), # <<<<<<<<<<<<<< * 'deepskyblue3' : (0, 154, 205), * 'deepskyblue4' : (0, 104, 139), */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_deepskyblue2, __pyx_tuple__135) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "include/color_dict.pxi":129 * 'deepskyblue1' : (0, 191, 255), * 'deepskyblue2' : (0, 178, 238), * 'deepskyblue3' : (0, 154, 205), # <<<<<<<<<<<<<< * 'deepskyblue4' : (0, 104, 139), * 'dimgray' : (105, 105, 105), */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_deepskyblue3, __pyx_tuple__136) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "include/color_dict.pxi":130 * 'deepskyblue2' : (0, 178, 238), * 'deepskyblue3' : (0, 154, 205), * 'deepskyblue4' : (0, 104, 139), # <<<<<<<<<<<<<< * 'dimgray' : (105, 105, 105), * 'dimgrey' : (105, 105, 105), */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_deepskyblue4, __pyx_tuple__137) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "include/color_dict.pxi":131 * 'deepskyblue3' : (0, 154, 205), * 'deepskyblue4' : (0, 104, 139), * 'dimgray' : (105, 105, 105), # <<<<<<<<<<<<<< * 'dimgrey' : (105, 105, 105), * 'dodgerblue' : (30, 144, 255), */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_dimgray, __pyx_tuple__138) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "include/color_dict.pxi":132 * 'deepskyblue4' : (0, 104, 139), * 'dimgray' : (105, 105, 105), * 'dimgrey' : (105, 105, 105), # <<<<<<<<<<<<<< * 'dodgerblue' : (30, 144, 255), * 'dodgerblue1' : (30, 144, 255), */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_dimgrey, __pyx_tuple__139) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "include/color_dict.pxi":133 * 'dimgray' : (105, 105, 105), * 'dimgrey' : (105, 105, 105), * 'dodgerblue' : (30, 144, 255), # <<<<<<<<<<<<<< * 'dodgerblue1' : (30, 144, 255), * 'dodgerblue2' : (28, 134, 238), */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_dodgerblue, __pyx_tuple__140) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "include/color_dict.pxi":134 * 'dimgrey' : (105, 105, 105), * 'dodgerblue' : (30, 144, 255), * 'dodgerblue1' : (30, 144, 255), # <<<<<<<<<<<<<< * 'dodgerblue2' : (28, 134, 238), * 'dodgerblue3' : (24, 116, 205), */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_dodgerblue1, __pyx_tuple__141) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "include/color_dict.pxi":135 * 'dodgerblue' : (30, 144, 255), * 'dodgerblue1' : (30, 144, 255), * 'dodgerblue2' : (28, 134, 238), # <<<<<<<<<<<<<< * 'dodgerblue3' : (24, 116, 205), * 'dodgerblue4' : (16, 78, 139), */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_dodgerblue2, __pyx_tuple__142) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "include/color_dict.pxi":136 * 'dodgerblue1' : (30, 144, 255), * 'dodgerblue2' : (28, 134, 238), * 'dodgerblue3' : (24, 116, 205), # <<<<<<<<<<<<<< * 'dodgerblue4' : (16, 78, 139), * 'firebrick' : (178, 34, 34), */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_dodgerblue3, __pyx_tuple__143) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "include/color_dict.pxi":137 * 'dodgerblue2' : (28, 134, 238), * 'dodgerblue3' : (24, 116, 205), * 'dodgerblue4' : (16, 78, 139), # <<<<<<<<<<<<<< * 'firebrick' : (178, 34, 34), * 'firebrick1' : (255, 48, 48), */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_dodgerblue4, __pyx_tuple__144) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "include/color_dict.pxi":138 * 'dodgerblue3' : (24, 116, 205), * 'dodgerblue4' : (16, 78, 139), * 'firebrick' : (178, 34, 34), # <<<<<<<<<<<<<< * 'firebrick1' : (255, 48, 48), * 'firebrick2' : (238, 44, 44), */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_firebrick, __pyx_tuple__145) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "include/color_dict.pxi":139 * 'dodgerblue4' : (16, 78, 139), * 'firebrick' : (178, 34, 34), * 'firebrick1' : (255, 48, 48), # <<<<<<<<<<<<<< * 'firebrick2' : (238, 44, 44), * 'firebrick3' : (205, 38, 38), */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_firebrick1, __pyx_tuple__146) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "include/color_dict.pxi":140 * 'firebrick' : (178, 34, 34), * 'firebrick1' : (255, 48, 48), * 'firebrick2' : (238, 44, 44), # <<<<<<<<<<<<<< * 'firebrick3' : (205, 38, 38), * 'firebrick4' : (139, 26, 26), */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_firebrick2, __pyx_tuple__147) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "include/color_dict.pxi":141 * 'firebrick1' : (255, 48, 48), * 'firebrick2' : (238, 44, 44), * 'firebrick3' : (205, 38, 38), # <<<<<<<<<<<<<< * 'firebrick4' : (139, 26, 26), * 'floralwhite' : (255, 250, 240), */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_firebrick3, __pyx_tuple__148) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "include/color_dict.pxi":142 * 'firebrick2' : (238, 44, 44), * 'firebrick3' : (205, 38, 38), * 'firebrick4' : (139, 26, 26), # <<<<<<<<<<<<<< * 'floralwhite' : (255, 250, 240), * 'forestgreen' : (34, 139, 34), */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_firebrick4, __pyx_tuple__149) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "include/color_dict.pxi":143 * 'firebrick3' : (205, 38, 38), * 'firebrick4' : (139, 26, 26), * 'floralwhite' : (255, 250, 240), # <<<<<<<<<<<<<< * 'forestgreen' : (34, 139, 34), * 'fuchsia' : (255, 0, 255), */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_floralwhite, __pyx_tuple__150) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "include/color_dict.pxi":144 * 'firebrick4' : (139, 26, 26), * 'floralwhite' : (255, 250, 240), * 'forestgreen' : (34, 139, 34), # <<<<<<<<<<<<<< * 'fuchsia' : (255, 0, 255), * 'gainsboro' : (220, 220, 220), */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_forestgreen, __pyx_tuple__151) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "include/color_dict.pxi":145 * 'floralwhite' : (255, 250, 240), * 'forestgreen' : (34, 139, 34), * 'fuchsia' : (255, 0, 255), # <<<<<<<<<<<<<< * 'gainsboro' : (220, 220, 220), * 'ghostwhite' : (248, 248, 255), */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_fuchsia, __pyx_tuple__152) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "include/color_dict.pxi":146 * 'forestgreen' : (34, 139, 34), * 'fuchsia' : (255, 0, 255), * 'gainsboro' : (220, 220, 220), # <<<<<<<<<<<<<< * 'ghostwhite' : (248, 248, 255), * 'gold' : (255, 215, 0), */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_gainsboro, __pyx_tuple__153) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "include/color_dict.pxi":147 * 'fuchsia' : (255, 0, 255), * 'gainsboro' : (220, 220, 220), * 'ghostwhite' : (248, 248, 255), # <<<<<<<<<<<<<< * 'gold' : (255, 215, 0), * 'gold1' : (255, 215, 0), */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_ghostwhite, __pyx_tuple__154) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "include/color_dict.pxi":148 * 'gainsboro' : (220, 220, 220), * 'ghostwhite' : (248, 248, 255), * 'gold' : (255, 215, 0), # <<<<<<<<<<<<<< * 'gold1' : (255, 215, 0), * 'gold2' : (238, 201, 0), */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_gold, __pyx_tuple__155) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "include/color_dict.pxi":149 * 'ghostwhite' : (248, 248, 255), * 'gold' : (255, 215, 0), * 'gold1' : (255, 215, 0), # <<<<<<<<<<<<<< * 'gold2' : (238, 201, 0), * 'gold3' : (205, 173, 0), */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_gold1, __pyx_tuple__156) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "include/color_dict.pxi":150 * 'gold' : (255, 215, 0), * 'gold1' : (255, 215, 0), * 'gold2' : (238, 201, 0), # <<<<<<<<<<<<<< * 'gold3' : (205, 173, 0), * 'gold4' : (139, 117, 0), */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_gold2, __pyx_tuple__157) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "include/color_dict.pxi":151 * 'gold1' : (255, 215, 0), * 'gold2' : (238, 201, 0), * 'gold3' : (205, 173, 0), # <<<<<<<<<<<<<< * 'gold4' : (139, 117, 0), * 'goldenrod' : (218, 165, 32), */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_gold3, __pyx_tuple__158) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "include/color_dict.pxi":152 * 'gold2' : (238, 201, 0), * 'gold3' : (205, 173, 0), * 'gold4' : (139, 117, 0), # <<<<<<<<<<<<<< * 'goldenrod' : (218, 165, 32), * 'goldenrod1' : (255, 193, 37), */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_gold4, __pyx_tuple__159) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "include/color_dict.pxi":153 * 'gold3' : (205, 173, 0), * 'gold4' : (139, 117, 0), * 'goldenrod' : (218, 165, 32), # <<<<<<<<<<<<<< * 'goldenrod1' : (255, 193, 37), * 'goldenrod2' : (238, 180, 34), */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_goldenrod, __pyx_tuple__160) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "include/color_dict.pxi":154 * 'gold4' : (139, 117, 0), * 'goldenrod' : (218, 165, 32), * 'goldenrod1' : (255, 193, 37), # <<<<<<<<<<<<<< * 'goldenrod2' : (238, 180, 34), * 'goldenrod3' : (205, 155, 29), */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_goldenrod1, __pyx_tuple__161) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "include/color_dict.pxi":155 * 'goldenrod' : (218, 165, 32), * 'goldenrod1' : (255, 193, 37), * 'goldenrod2' : (238, 180, 34), # <<<<<<<<<<<<<< * 'goldenrod3' : (205, 155, 29), * 'goldenrod4' : (139, 105, 20), */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_goldenrod2, __pyx_tuple__162) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "include/color_dict.pxi":156 * 'goldenrod1' : (255, 193, 37), * 'goldenrod2' : (238, 180, 34), * 'goldenrod3' : (205, 155, 29), # <<<<<<<<<<<<<< * 'goldenrod4' : (139, 105, 20), * 'gray' : (190, 190, 190), */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_goldenrod3, __pyx_tuple__163) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "include/color_dict.pxi":157 * 'goldenrod2' : (238, 180, 34), * 'goldenrod3' : (205, 155, 29), * 'goldenrod4' : (139, 105, 20), # <<<<<<<<<<<<<< * 'gray' : (190, 190, 190), * 'gray0' : (0, 0, 0), */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_goldenrod4, __pyx_tuple__164) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "include/color_dict.pxi":158 * 'goldenrod3' : (205, 155, 29), * 'goldenrod4' : (139, 105, 20), * 'gray' : (190, 190, 190), # <<<<<<<<<<<<<< * 'gray0' : (0, 0, 0), * 'gray1' : (3, 3, 3), */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_gray, __pyx_tuple__165) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "include/color_dict.pxi":159 * 'goldenrod4' : (139, 105, 20), * 'gray' : (190, 190, 190), * 'gray0' : (0, 0, 0), # <<<<<<<<<<<<<< * 'gray1' : (3, 3, 3), * 'gray10' : (26, 26, 26), */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_gray0, __pyx_tuple__166) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "include/color_dict.pxi":160 * 'gray' : (190, 190, 190), * 'gray0' : (0, 0, 0), * 'gray1' : (3, 3, 3), # <<<<<<<<<<<<<< * 'gray10' : (26, 26, 26), * 'gray100' : (255, 255, 255), */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_gray1, __pyx_tuple__167) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "include/color_dict.pxi":161 * 'gray0' : (0, 0, 0), * 'gray1' : (3, 3, 3), * 'gray10' : (26, 26, 26), # <<<<<<<<<<<<<< * 'gray100' : (255, 255, 255), * 'gray11' : (28, 28, 28), */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_gray10, __pyx_tuple__168) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "include/color_dict.pxi":162 * 'gray1' : (3, 3, 3), * 'gray10' : (26, 26, 26), * 'gray100' : (255, 255, 255), # <<<<<<<<<<<<<< * 'gray11' : (28, 28, 28), * 'gray12' : (31, 31, 31), */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_gray100, __pyx_tuple__169) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "include/color_dict.pxi":163 * 'gray10' : (26, 26, 26), * 'gray100' : (255, 255, 255), * 'gray11' : (28, 28, 28), # <<<<<<<<<<<<<< * 'gray12' : (31, 31, 31), * 'gray13' : (33, 33, 33), */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_gray11, __pyx_tuple__170) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "include/color_dict.pxi":164 * 'gray100' : (255, 255, 255), * 'gray11' : (28, 28, 28), * 'gray12' : (31, 31, 31), # <<<<<<<<<<<<<< * 'gray13' : (33, 33, 33), * 'gray14' : (36, 36, 36), */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_gray12, __pyx_tuple__171) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "include/color_dict.pxi":165 * 'gray11' : (28, 28, 28), * 'gray12' : (31, 31, 31), * 'gray13' : (33, 33, 33), # <<<<<<<<<<<<<< * 'gray14' : (36, 36, 36), * 'gray15' : (38, 38, 38), */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_gray13, __pyx_tuple__172) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "include/color_dict.pxi":166 * 'gray12' : (31, 31, 31), * 'gray13' : (33, 33, 33), * 'gray14' : (36, 36, 36), # <<<<<<<<<<<<<< * 'gray15' : (38, 38, 38), * 'gray16' : (41, 41, 41), */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_gray14, __pyx_tuple__173) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "include/color_dict.pxi":167 * 'gray13' : (33, 33, 33), * 'gray14' : (36, 36, 36), * 'gray15' : (38, 38, 38), # <<<<<<<<<<<<<< * 'gray16' : (41, 41, 41), * 'gray17' : (43, 43, 43), */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_gray15, __pyx_tuple__174) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "include/color_dict.pxi":168 * 'gray14' : (36, 36, 36), * 'gray15' : (38, 38, 38), * 'gray16' : (41, 41, 41), # <<<<<<<<<<<<<< * 'gray17' : (43, 43, 43), * 'gray18' : (46, 46, 46), */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_gray16, __pyx_tuple__175) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "include/color_dict.pxi":169 * 'gray15' : (38, 38, 38), * 'gray16' : (41, 41, 41), * 'gray17' : (43, 43, 43), # <<<<<<<<<<<<<< * 'gray18' : (46, 46, 46), * 'gray19' : (48, 48, 48), */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_gray17, __pyx_tuple__176) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "include/color_dict.pxi":170 * 'gray16' : (41, 41, 41), * 'gray17' : (43, 43, 43), * 'gray18' : (46, 46, 46), # <<<<<<<<<<<<<< * 'gray19' : (48, 48, 48), * 'gray2' : (5, 5, 5), */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_gray18, __pyx_tuple__177) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "include/color_dict.pxi":171 * 'gray17' : (43, 43, 43), * 'gray18' : (46, 46, 46), * 'gray19' : (48, 48, 48), # <<<<<<<<<<<<<< * 'gray2' : (5, 5, 5), * 'gray20' : (51, 51, 51), */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_gray19, __pyx_tuple__178) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "include/color_dict.pxi":172 * 'gray18' : (46, 46, 46), * 'gray19' : (48, 48, 48), * 'gray2' : (5, 5, 5), # <<<<<<<<<<<<<< * 'gray20' : (51, 51, 51), * 'gray21' : (54, 54, 54), */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_gray2, __pyx_tuple__179) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "include/color_dict.pxi":173 * 'gray19' : (48, 48, 48), * 'gray2' : (5, 5, 5), * 'gray20' : (51, 51, 51), # <<<<<<<<<<<<<< * 'gray21' : (54, 54, 54), * 'gray22' : (56, 56, 56), */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_gray20, __pyx_tuple__180) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "include/color_dict.pxi":174 * 'gray2' : (5, 5, 5), * 'gray20' : (51, 51, 51), * 'gray21' : (54, 54, 54), # <<<<<<<<<<<<<< * 'gray22' : (56, 56, 56), * 'gray23' : (59, 59, 59), */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_gray21, __pyx_tuple__181) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "include/color_dict.pxi":175 * 'gray20' : (51, 51, 51), * 'gray21' : (54, 54, 54), * 'gray22' : (56, 56, 56), # <<<<<<<<<<<<<< * 'gray23' : (59, 59, 59), * 'gray24' : (61, 61, 61), */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_gray22, __pyx_tuple__182) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "include/color_dict.pxi":176 * 'gray21' : (54, 54, 54), * 'gray22' : (56, 56, 56), * 'gray23' : (59, 59, 59), # <<<<<<<<<<<<<< * 'gray24' : (61, 61, 61), * 'gray25' : (64, 64, 64), */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_gray23, __pyx_tuple__183) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "include/color_dict.pxi":177 * 'gray22' : (56, 56, 56), * 'gray23' : (59, 59, 59), * 'gray24' : (61, 61, 61), # <<<<<<<<<<<<<< * 'gray25' : (64, 64, 64), * 'gray26' : (66, 66, 66), */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_gray24, __pyx_tuple__184) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "include/color_dict.pxi":178 * 'gray23' : (59, 59, 59), * 'gray24' : (61, 61, 61), * 'gray25' : (64, 64, 64), # <<<<<<<<<<<<<< * 'gray26' : (66, 66, 66), * 'gray27' : (69, 69, 69), */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_gray25, __pyx_tuple__185) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "include/color_dict.pxi":179 * 'gray24' : (61, 61, 61), * 'gray25' : (64, 64, 64), * 'gray26' : (66, 66, 66), # <<<<<<<<<<<<<< * 'gray27' : (69, 69, 69), * 'gray28' : (71, 71, 71), */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_gray26, __pyx_tuple__186) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "include/color_dict.pxi":180 * 'gray25' : (64, 64, 64), * 'gray26' : (66, 66, 66), * 'gray27' : (69, 69, 69), # <<<<<<<<<<<<<< * 'gray28' : (71, 71, 71), * 'gray29' : (74, 74, 74), */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_gray27, __pyx_tuple__187) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "include/color_dict.pxi":181 * 'gray26' : (66, 66, 66), * 'gray27' : (69, 69, 69), * 'gray28' : (71, 71, 71), # <<<<<<<<<<<<<< * 'gray29' : (74, 74, 74), * 'gray3' : (8, 8, 8), */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_gray28, __pyx_tuple__188) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "include/color_dict.pxi":182 * 'gray27' : (69, 69, 69), * 'gray28' : (71, 71, 71), * 'gray29' : (74, 74, 74), # <<<<<<<<<<<<<< * 'gray3' : (8, 8, 8), * 'gray30' : (77, 77, 77), */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_gray29, __pyx_tuple__189) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "include/color_dict.pxi":183 * 'gray28' : (71, 71, 71), * 'gray29' : (74, 74, 74), * 'gray3' : (8, 8, 8), # <<<<<<<<<<<<<< * 'gray30' : (77, 77, 77), * 'gray31' : (79, 79, 79), */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_gray3, __pyx_tuple__190) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "include/color_dict.pxi":184 * 'gray29' : (74, 74, 74), * 'gray3' : (8, 8, 8), * 'gray30' : (77, 77, 77), # <<<<<<<<<<<<<< * 'gray31' : (79, 79, 79), * 'gray32' : (82, 82, 82), */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_gray30, __pyx_tuple__191) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "include/color_dict.pxi":185 * 'gray3' : (8, 8, 8), * 'gray30' : (77, 77, 77), * 'gray31' : (79, 79, 79), # <<<<<<<<<<<<<< * 'gray32' : (82, 82, 82), * 'gray33' : (84, 84, 84), */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_gray31, __pyx_tuple__192) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "include/color_dict.pxi":186 * 'gray30' : (77, 77, 77), * 'gray31' : (79, 79, 79), * 'gray32' : (82, 82, 82), # <<<<<<<<<<<<<< * 'gray33' : (84, 84, 84), * 'gray34' : (87, 87, 87), */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_gray32, __pyx_tuple__193) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "include/color_dict.pxi":187 * 'gray31' : (79, 79, 79), * 'gray32' : (82, 82, 82), * 'gray33' : (84, 84, 84), # <<<<<<<<<<<<<< * 'gray34' : (87, 87, 87), * 'gray35' : (89, 89, 89), */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_gray33, __pyx_tuple__194) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "include/color_dict.pxi":188 * 'gray32' : (82, 82, 82), * 'gray33' : (84, 84, 84), * 'gray34' : (87, 87, 87), # <<<<<<<<<<<<<< * 'gray35' : (89, 89, 89), * 'gray36' : (92, 92, 92), */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_gray34, __pyx_tuple__195) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "include/color_dict.pxi":189 * 'gray33' : (84, 84, 84), * 'gray34' : (87, 87, 87), * 'gray35' : (89, 89, 89), # <<<<<<<<<<<<<< * 'gray36' : (92, 92, 92), * 'gray37' : (94, 94, 94), */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_gray35, __pyx_tuple__196) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "include/color_dict.pxi":190 * 'gray34' : (87, 87, 87), * 'gray35' : (89, 89, 89), * 'gray36' : (92, 92, 92), # <<<<<<<<<<<<<< * 'gray37' : (94, 94, 94), * 'gray38' : (97, 97, 97), */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_gray36, __pyx_tuple__197) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "include/color_dict.pxi":191 * 'gray35' : (89, 89, 89), * 'gray36' : (92, 92, 92), * 'gray37' : (94, 94, 94), # <<<<<<<<<<<<<< * 'gray38' : (97, 97, 97), * 'gray39' : (99, 99, 99), */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_gray37, __pyx_tuple__198) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "include/color_dict.pxi":192 * 'gray36' : (92, 92, 92), * 'gray37' : (94, 94, 94), * 'gray38' : (97, 97, 97), # <<<<<<<<<<<<<< * 'gray39' : (99, 99, 99), * 'gray4' : (10, 10, 10), */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_gray38, __pyx_tuple__199) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "include/color_dict.pxi":193 * 'gray37' : (94, 94, 94), * 'gray38' : (97, 97, 97), * 'gray39' : (99, 99, 99), # <<<<<<<<<<<<<< * 'gray4' : (10, 10, 10), * 'gray40' : (102, 102, 102), */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_gray39, __pyx_tuple__200) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "include/color_dict.pxi":194 * 'gray38' : (97, 97, 97), * 'gray39' : (99, 99, 99), * 'gray4' : (10, 10, 10), # <<<<<<<<<<<<<< * 'gray40' : (102, 102, 102), * 'gray41' : (105, 105, 105), */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_gray4, __pyx_tuple__201) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "include/color_dict.pxi":195 * 'gray39' : (99, 99, 99), * 'gray4' : (10, 10, 10), * 'gray40' : (102, 102, 102), # <<<<<<<<<<<<<< * 'gray41' : (105, 105, 105), * 'gray42' : (107, 107, 107), */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_gray40, __pyx_tuple__202) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "include/color_dict.pxi":196 * 'gray4' : (10, 10, 10), * 'gray40' : (102, 102, 102), * 'gray41' : (105, 105, 105), # <<<<<<<<<<<<<< * 'gray42' : (107, 107, 107), * 'gray43' : (110, 110, 110), */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_gray41, __pyx_tuple__203) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "include/color_dict.pxi":197 * 'gray40' : (102, 102, 102), * 'gray41' : (105, 105, 105), * 'gray42' : (107, 107, 107), # <<<<<<<<<<<<<< * 'gray43' : (110, 110, 110), * 'gray44' : (112, 112, 112), */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_gray42, __pyx_tuple__204) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "include/color_dict.pxi":198 * 'gray41' : (105, 105, 105), * 'gray42' : (107, 107, 107), * 'gray43' : (110, 110, 110), # <<<<<<<<<<<<<< * 'gray44' : (112, 112, 112), * 'gray45' : (115, 115, 115), */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_gray43, __pyx_tuple__205) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "include/color_dict.pxi":199 * 'gray42' : (107, 107, 107), * 'gray43' : (110, 110, 110), * 'gray44' : (112, 112, 112), # <<<<<<<<<<<<<< * 'gray45' : (115, 115, 115), * 'gray46' : (117, 117, 117), */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_gray44, __pyx_tuple__206) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "include/color_dict.pxi":200 * 'gray43' : (110, 110, 110), * 'gray44' : (112, 112, 112), * 'gray45' : (115, 115, 115), # <<<<<<<<<<<<<< * 'gray46' : (117, 117, 117), * 'gray47' : (120, 120, 120), */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_gray45, __pyx_tuple__207) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "include/color_dict.pxi":201 * 'gray44' : (112, 112, 112), * 'gray45' : (115, 115, 115), * 'gray46' : (117, 117, 117), # <<<<<<<<<<<<<< * 'gray47' : (120, 120, 120), * 'gray48' : (122, 122, 122), */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_gray46, __pyx_tuple__208) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "include/color_dict.pxi":202 * 'gray45' : (115, 115, 115), * 'gray46' : (117, 117, 117), * 'gray47' : (120, 120, 120), # <<<<<<<<<<<<<< * 'gray48' : (122, 122, 122), * 'gray49' : (125, 125, 125), */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_gray47, __pyx_tuple__209) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "include/color_dict.pxi":203 * 'gray46' : (117, 117, 117), * 'gray47' : (120, 120, 120), * 'gray48' : (122, 122, 122), # <<<<<<<<<<<<<< * 'gray49' : (125, 125, 125), * 'gray5' : (13, 13, 13), */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_gray48, __pyx_tuple__210) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "include/color_dict.pxi":204 * 'gray47' : (120, 120, 120), * 'gray48' : (122, 122, 122), * 'gray49' : (125, 125, 125), # <<<<<<<<<<<<<< * 'gray5' : (13, 13, 13), * 'gray50' : (127, 127, 127), */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_gray49, __pyx_tuple__211) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "include/color_dict.pxi":205 * 'gray48' : (122, 122, 122), * 'gray49' : (125, 125, 125), * 'gray5' : (13, 13, 13), # <<<<<<<<<<<<<< * 'gray50' : (127, 127, 127), * 'gray51' : (130, 130, 130), */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_gray5, __pyx_tuple__212) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "include/color_dict.pxi":206 * 'gray49' : (125, 125, 125), * 'gray5' : (13, 13, 13), * 'gray50' : (127, 127, 127), # <<<<<<<<<<<<<< * 'gray51' : (130, 130, 130), * 'gray52' : (133, 133, 133), */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_gray50, __pyx_tuple__213) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "include/color_dict.pxi":207 * 'gray5' : (13, 13, 13), * 'gray50' : (127, 127, 127), * 'gray51' : (130, 130, 130), # <<<<<<<<<<<<<< * 'gray52' : (133, 133, 133), * 'gray53' : (135, 135, 135), */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_gray51, __pyx_tuple__214) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "include/color_dict.pxi":208 * 'gray50' : (127, 127, 127), * 'gray51' : (130, 130, 130), * 'gray52' : (133, 133, 133), # <<<<<<<<<<<<<< * 'gray53' : (135, 135, 135), * 'gray54' : (138, 138, 138), */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_gray52, __pyx_tuple__215) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "include/color_dict.pxi":209 * 'gray51' : (130, 130, 130), * 'gray52' : (133, 133, 133), * 'gray53' : (135, 135, 135), # <<<<<<<<<<<<<< * 'gray54' : (138, 138, 138), * 'gray55' : (140, 140, 140), */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_gray53, __pyx_tuple__216) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "include/color_dict.pxi":210 * 'gray52' : (133, 133, 133), * 'gray53' : (135, 135, 135), * 'gray54' : (138, 138, 138), # <<<<<<<<<<<<<< * 'gray55' : (140, 140, 140), * 'gray56' : (143, 143, 143), */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_gray54, __pyx_tuple__217) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "include/color_dict.pxi":211 * 'gray53' : (135, 135, 135), * 'gray54' : (138, 138, 138), * 'gray55' : (140, 140, 140), # <<<<<<<<<<<<<< * 'gray56' : (143, 143, 143), * 'gray57' : (145, 145, 145), */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_gray55, __pyx_tuple__218) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "include/color_dict.pxi":212 * 'gray54' : (138, 138, 138), * 'gray55' : (140, 140, 140), * 'gray56' : (143, 143, 143), # <<<<<<<<<<<<<< * 'gray57' : (145, 145, 145), * 'gray58' : (148, 148, 148), */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_gray56, __pyx_tuple__219) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "include/color_dict.pxi":213 * 'gray55' : (140, 140, 140), * 'gray56' : (143, 143, 143), * 'gray57' : (145, 145, 145), # <<<<<<<<<<<<<< * 'gray58' : (148, 148, 148), * 'gray59' : (150, 150, 150), */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_gray57, __pyx_tuple__220) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "include/color_dict.pxi":214 * 'gray56' : (143, 143, 143), * 'gray57' : (145, 145, 145), * 'gray58' : (148, 148, 148), # <<<<<<<<<<<<<< * 'gray59' : (150, 150, 150), * 'gray6' : (15, 15, 15), */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_gray58, __pyx_tuple__221) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "include/color_dict.pxi":215 * 'gray57' : (145, 145, 145), * 'gray58' : (148, 148, 148), * 'gray59' : (150, 150, 150), # <<<<<<<<<<<<<< * 'gray6' : (15, 15, 15), * 'gray60' : (153, 153, 153), */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_gray59, __pyx_tuple__222) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "include/color_dict.pxi":216 * 'gray58' : (148, 148, 148), * 'gray59' : (150, 150, 150), * 'gray6' : (15, 15, 15), # <<<<<<<<<<<<<< * 'gray60' : (153, 153, 153), * 'gray61' : (156, 156, 156), */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_gray6, __pyx_tuple__223) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "include/color_dict.pxi":217 * 'gray59' : (150, 150, 150), * 'gray6' : (15, 15, 15), * 'gray60' : (153, 153, 153), # <<<<<<<<<<<<<< * 'gray61' : (156, 156, 156), * 'gray62' : (158, 158, 158), */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_gray60, __pyx_tuple__224) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "include/color_dict.pxi":218 * 'gray6' : (15, 15, 15), * 'gray60' : (153, 153, 153), * 'gray61' : (156, 156, 156), # <<<<<<<<<<<<<< * 'gray62' : (158, 158, 158), * 'gray63' : (161, 161, 161), */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_gray61, __pyx_tuple__225) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "include/color_dict.pxi":219 * 'gray60' : (153, 153, 153), * 'gray61' : (156, 156, 156), * 'gray62' : (158, 158, 158), # <<<<<<<<<<<<<< * 'gray63' : (161, 161, 161), * 'gray64' : (163, 163, 163), */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_gray62, __pyx_tuple__226) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "include/color_dict.pxi":220 * 'gray61' : (156, 156, 156), * 'gray62' : (158, 158, 158), * 'gray63' : (161, 161, 161), # <<<<<<<<<<<<<< * 'gray64' : (163, 163, 163), * 'gray65' : (166, 166, 166), */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_gray63, __pyx_tuple__227) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "include/color_dict.pxi":221 * 'gray62' : (158, 158, 158), * 'gray63' : (161, 161, 161), * 'gray64' : (163, 163, 163), # <<<<<<<<<<<<<< * 'gray65' : (166, 166, 166), * 'gray66' : (168, 168, 168), */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_gray64, __pyx_tuple__228) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "include/color_dict.pxi":222 * 'gray63' : (161, 161, 161), * 'gray64' : (163, 163, 163), * 'gray65' : (166, 166, 166), # <<<<<<<<<<<<<< * 'gray66' : (168, 168, 168), * 'gray67' : (171, 171, 171), */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_gray65, __pyx_tuple__229) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "include/color_dict.pxi":223 * 'gray64' : (163, 163, 163), * 'gray65' : (166, 166, 166), * 'gray66' : (168, 168, 168), # <<<<<<<<<<<<<< * 'gray67' : (171, 171, 171), * 'gray68' : (173, 173, 173), */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_gray66, __pyx_tuple__230) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "include/color_dict.pxi":224 * 'gray65' : (166, 166, 166), * 'gray66' : (168, 168, 168), * 'gray67' : (171, 171, 171), # <<<<<<<<<<<<<< * 'gray68' : (173, 173, 173), * 'gray69' : (176, 176, 176), */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_gray67, __pyx_tuple__231) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "include/color_dict.pxi":225 * 'gray66' : (168, 168, 168), * 'gray67' : (171, 171, 171), * 'gray68' : (173, 173, 173), # <<<<<<<<<<<<<< * 'gray69' : (176, 176, 176), * 'gray7' : (18, 18, 18), */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_gray68, __pyx_tuple__232) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "include/color_dict.pxi":226 * 'gray67' : (171, 171, 171), * 'gray68' : (173, 173, 173), * 'gray69' : (176, 176, 176), # <<<<<<<<<<<<<< * 'gray7' : (18, 18, 18), * 'gray70' : (179, 179, 179), */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_gray69, __pyx_tuple__233) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "include/color_dict.pxi":227 * 'gray68' : (173, 173, 173), * 'gray69' : (176, 176, 176), * 'gray7' : (18, 18, 18), # <<<<<<<<<<<<<< * 'gray70' : (179, 179, 179), * 'gray71' : (181, 181, 181), */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_gray7, __pyx_tuple__234) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "include/color_dict.pxi":228 * 'gray69' : (176, 176, 176), * 'gray7' : (18, 18, 18), * 'gray70' : (179, 179, 179), # <<<<<<<<<<<<<< * 'gray71' : (181, 181, 181), * 'gray72' : (184, 184, 184), */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_gray70, __pyx_tuple__235) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "include/color_dict.pxi":229 * 'gray7' : (18, 18, 18), * 'gray70' : (179, 179, 179), * 'gray71' : (181, 181, 181), # <<<<<<<<<<<<<< * 'gray72' : (184, 184, 184), * 'gray73' : (186, 186, 186), */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_gray71, __pyx_tuple__236) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "include/color_dict.pxi":230 * 'gray70' : (179, 179, 179), * 'gray71' : (181, 181, 181), * 'gray72' : (184, 184, 184), # <<<<<<<<<<<<<< * 'gray73' : (186, 186, 186), * 'gray74' : (189, 189, 189), */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_gray72, __pyx_tuple__237) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "include/color_dict.pxi":231 * 'gray71' : (181, 181, 181), * 'gray72' : (184, 184, 184), * 'gray73' : (186, 186, 186), # <<<<<<<<<<<<<< * 'gray74' : (189, 189, 189), * 'gray75' : (191, 191, 191), */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_gray73, __pyx_tuple__238) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "include/color_dict.pxi":232 * 'gray72' : (184, 184, 184), * 'gray73' : (186, 186, 186), * 'gray74' : (189, 189, 189), # <<<<<<<<<<<<<< * 'gray75' : (191, 191, 191), * 'gray76' : (194, 194, 194), */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_gray74, __pyx_tuple__239) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "include/color_dict.pxi":233 * 'gray73' : (186, 186, 186), * 'gray74' : (189, 189, 189), * 'gray75' : (191, 191, 191), # <<<<<<<<<<<<<< * 'gray76' : (194, 194, 194), * 'gray77' : (196, 196, 196), */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_gray75, __pyx_tuple__240) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "include/color_dict.pxi":234 * 'gray74' : (189, 189, 189), * 'gray75' : (191, 191, 191), * 'gray76' : (194, 194, 194), # <<<<<<<<<<<<<< * 'gray77' : (196, 196, 196), * 'gray78' : (199, 199, 199), */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_gray76, __pyx_tuple__241) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "include/color_dict.pxi":235 * 'gray75' : (191, 191, 191), * 'gray76' : (194, 194, 194), * 'gray77' : (196, 196, 196), # <<<<<<<<<<<<<< * 'gray78' : (199, 199, 199), * 'gray79' : (201, 201, 201), */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_gray77, __pyx_tuple__242) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "include/color_dict.pxi":236 * 'gray76' : (194, 194, 194), * 'gray77' : (196, 196, 196), * 'gray78' : (199, 199, 199), # <<<<<<<<<<<<<< * 'gray79' : (201, 201, 201), * 'gray8' : (20, 20, 20), */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_gray78, __pyx_tuple__243) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "include/color_dict.pxi":237 * 'gray77' : (196, 196, 196), * 'gray78' : (199, 199, 199), * 'gray79' : (201, 201, 201), # <<<<<<<<<<<<<< * 'gray8' : (20, 20, 20), * 'gray80' : (204, 204, 204), */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_gray79, __pyx_tuple__244) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "include/color_dict.pxi":238 * 'gray78' : (199, 199, 199), * 'gray79' : (201, 201, 201), * 'gray8' : (20, 20, 20), # <<<<<<<<<<<<<< * 'gray80' : (204, 204, 204), * 'gray81' : (207, 207, 207), */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_gray8, __pyx_tuple__245) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "include/color_dict.pxi":239 * 'gray79' : (201, 201, 201), * 'gray8' : (20, 20, 20), * 'gray80' : (204, 204, 204), # <<<<<<<<<<<<<< * 'gray81' : (207, 207, 207), * 'gray82' : (209, 209, 209), */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_gray80, __pyx_tuple__246) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "include/color_dict.pxi":240 * 'gray8' : (20, 20, 20), * 'gray80' : (204, 204, 204), * 'gray81' : (207, 207, 207), # <<<<<<<<<<<<<< * 'gray82' : (209, 209, 209), * 'gray83' : (212, 212, 212), */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_gray81, __pyx_tuple__247) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "include/color_dict.pxi":241 * 'gray80' : (204, 204, 204), * 'gray81' : (207, 207, 207), * 'gray82' : (209, 209, 209), # <<<<<<<<<<<<<< * 'gray83' : (212, 212, 212), * 'gray84' : (214, 214, 214), */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_gray82, __pyx_tuple__248) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "include/color_dict.pxi":242 * 'gray81' : (207, 207, 207), * 'gray82' : (209, 209, 209), * 'gray83' : (212, 212, 212), # <<<<<<<<<<<<<< * 'gray84' : (214, 214, 214), * 'gray85' : (217, 217, 217), */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_gray83, __pyx_tuple__249) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "include/color_dict.pxi":243 * 'gray82' : (209, 209, 209), * 'gray83' : (212, 212, 212), * 'gray84' : (214, 214, 214), # <<<<<<<<<<<<<< * 'gray85' : (217, 217, 217), * 'gray86' : (219, 219, 219), */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_gray84, __pyx_tuple__250) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "include/color_dict.pxi":244 * 'gray83' : (212, 212, 212), * 'gray84' : (214, 214, 214), * 'gray85' : (217, 217, 217), # <<<<<<<<<<<<<< * 'gray86' : (219, 219, 219), * 'gray87' : (222, 222, 222), */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_gray85, __pyx_tuple__251) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "include/color_dict.pxi":245 * 'gray84' : (214, 214, 214), * 'gray85' : (217, 217, 217), * 'gray86' : (219, 219, 219), # <<<<<<<<<<<<<< * 'gray87' : (222, 222, 222), * 'gray88' : (224, 224, 224), */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_gray86, __pyx_tuple__252) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "include/color_dict.pxi":246 * 'gray85' : (217, 217, 217), * 'gray86' : (219, 219, 219), * 'gray87' : (222, 222, 222), # <<<<<<<<<<<<<< * 'gray88' : (224, 224, 224), * 'gray89' : (227, 227, 227), */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_gray87, __pyx_tuple__253) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "include/color_dict.pxi":247 * 'gray86' : (219, 219, 219), * 'gray87' : (222, 222, 222), * 'gray88' : (224, 224, 224), # <<<<<<<<<<<<<< * 'gray89' : (227, 227, 227), * 'gray9' : (23, 23, 23), */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_gray88, __pyx_tuple__254) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "include/color_dict.pxi":248 * 'gray87' : (222, 222, 222), * 'gray88' : (224, 224, 224), * 'gray89' : (227, 227, 227), # <<<<<<<<<<<<<< * 'gray9' : (23, 23, 23), * 'gray90' : (229, 229, 229), */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_gray89, __pyx_tuple__255) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "include/color_dict.pxi":249 * 'gray88' : (224, 224, 224), * 'gray89' : (227, 227, 227), * 'gray9' : (23, 23, 23), # <<<<<<<<<<<<<< * 'gray90' : (229, 229, 229), * 'gray91' : (232, 232, 232), */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_gray9, __pyx_tuple__256) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "include/color_dict.pxi":250 * 'gray89' : (227, 227, 227), * 'gray9' : (23, 23, 23), * 'gray90' : (229, 229, 229), # <<<<<<<<<<<<<< * 'gray91' : (232, 232, 232), * 'gray92' : (235, 235, 235), */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_gray90, __pyx_tuple__257) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "include/color_dict.pxi":251 * 'gray9' : (23, 23, 23), * 'gray90' : (229, 229, 229), * 'gray91' : (232, 232, 232), # <<<<<<<<<<<<<< * 'gray92' : (235, 235, 235), * 'gray93' : (237, 237, 237), */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_gray91, __pyx_tuple__258) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "include/color_dict.pxi":252 * 'gray90' : (229, 229, 229), * 'gray91' : (232, 232, 232), * 'gray92' : (235, 235, 235), # <<<<<<<<<<<<<< * 'gray93' : (237, 237, 237), * 'gray94' : (240, 240, 240), */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_gray92, __pyx_tuple__259) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "include/color_dict.pxi":253 * 'gray91' : (232, 232, 232), * 'gray92' : (235, 235, 235), * 'gray93' : (237, 237, 237), # <<<<<<<<<<<<<< * 'gray94' : (240, 240, 240), * 'gray95' : (242, 242, 242), */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_gray93, __pyx_tuple__260) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "include/color_dict.pxi":254 * 'gray92' : (235, 235, 235), * 'gray93' : (237, 237, 237), * 'gray94' : (240, 240, 240), # <<<<<<<<<<<<<< * 'gray95' : (242, 242, 242), * 'gray96' : (245, 245, 245), */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_gray94, __pyx_tuple__261) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "include/color_dict.pxi":255 * 'gray93' : (237, 237, 237), * 'gray94' : (240, 240, 240), * 'gray95' : (242, 242, 242), # <<<<<<<<<<<<<< * 'gray96' : (245, 245, 245), * 'gray97' : (247, 247, 247), */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_gray95, __pyx_tuple__262) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "include/color_dict.pxi":256 * 'gray94' : (240, 240, 240), * 'gray95' : (242, 242, 242), * 'gray96' : (245, 245, 245), # <<<<<<<<<<<<<< * 'gray97' : (247, 247, 247), * 'gray98' : (250, 250, 250), */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_gray96, __pyx_tuple__263) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "include/color_dict.pxi":257 * 'gray95' : (242, 242, 242), * 'gray96' : (245, 245, 245), * 'gray97' : (247, 247, 247), # <<<<<<<<<<<<<< * 'gray98' : (250, 250, 250), * 'gray99' : (252, 252, 252), */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_gray97, __pyx_tuple__264) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "include/color_dict.pxi":258 * 'gray96' : (245, 245, 245), * 'gray97' : (247, 247, 247), * 'gray98' : (250, 250, 250), # <<<<<<<<<<<<<< * 'gray99' : (252, 252, 252), * 'green' : (0, 255, 0), */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_gray98, __pyx_tuple__265) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "include/color_dict.pxi":259 * 'gray97' : (247, 247, 247), * 'gray98' : (250, 250, 250), * 'gray99' : (252, 252, 252), # <<<<<<<<<<<<<< * 'green' : (0, 255, 0), * 'green1' : (0, 255, 0), */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_gray99, __pyx_tuple__266) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "include/color_dict.pxi":260 * 'gray98' : (250, 250, 250), * 'gray99' : (252, 252, 252), * 'green' : (0, 255, 0), # <<<<<<<<<<<<<< * 'green1' : (0, 255, 0), * 'green2' : (0, 238, 0), */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_green, __pyx_tuple__267) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "include/color_dict.pxi":261 * 'gray99' : (252, 252, 252), * 'green' : (0, 255, 0), * 'green1' : (0, 255, 0), # <<<<<<<<<<<<<< * 'green2' : (0, 238, 0), * 'green3' : (0, 205, 0), */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_green1, __pyx_tuple__268) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "include/color_dict.pxi":262 * 'green' : (0, 255, 0), * 'green1' : (0, 255, 0), * 'green2' : (0, 238, 0), # <<<<<<<<<<<<<< * 'green3' : (0, 205, 0), * 'green4' : (0, 139, 0), */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_green2, __pyx_tuple__269) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "include/color_dict.pxi":263 * 'green1' : (0, 255, 0), * 'green2' : (0, 238, 0), * 'green3' : (0, 205, 0), # <<<<<<<<<<<<<< * 'green4' : (0, 139, 0), * 'greenyellow' : (173, 255, 47), */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_green3, __pyx_tuple__270) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "include/color_dict.pxi":264 * 'green2' : (0, 238, 0), * 'green3' : (0, 205, 0), * 'green4' : (0, 139, 0), # <<<<<<<<<<<<<< * 'greenyellow' : (173, 255, 47), * 'grey' : (190, 190, 190), */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_green4, __pyx_tuple__271) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "include/color_dict.pxi":265 * 'green3' : (0, 205, 0), * 'green4' : (0, 139, 0), * 'greenyellow' : (173, 255, 47), # <<<<<<<<<<<<<< * 'grey' : (190, 190, 190), * 'grey0' : (0, 0, 0), */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_greenyellow, __pyx_tuple__272) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "include/color_dict.pxi":266 * 'green4' : (0, 139, 0), * 'greenyellow' : (173, 255, 47), * 'grey' : (190, 190, 190), # <<<<<<<<<<<<<< * 'grey0' : (0, 0, 0), * 'grey1' : (3, 3, 3), */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_grey, __pyx_tuple__273) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "include/color_dict.pxi":267 * 'greenyellow' : (173, 255, 47), * 'grey' : (190, 190, 190), * 'grey0' : (0, 0, 0), # <<<<<<<<<<<<<< * 'grey1' : (3, 3, 3), * 'grey10' : (26, 26, 26), */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_grey0, __pyx_tuple__274) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "include/color_dict.pxi":268 * 'grey' : (190, 190, 190), * 'grey0' : (0, 0, 0), * 'grey1' : (3, 3, 3), # <<<<<<<<<<<<<< * 'grey10' : (26, 26, 26), * 'grey100' : (255, 255, 255), */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_grey1, __pyx_tuple__275) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "include/color_dict.pxi":269 * 'grey0' : (0, 0, 0), * 'grey1' : (3, 3, 3), * 'grey10' : (26, 26, 26), # <<<<<<<<<<<<<< * 'grey100' : (255, 255, 255), * 'grey11' : (28, 28, 28), */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_grey10, __pyx_tuple__276) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "include/color_dict.pxi":270 * 'grey1' : (3, 3, 3), * 'grey10' : (26, 26, 26), * 'grey100' : (255, 255, 255), # <<<<<<<<<<<<<< * 'grey11' : (28, 28, 28), * 'grey12' : (31, 31, 31), */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_grey100, __pyx_tuple__277) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "include/color_dict.pxi":271 * 'grey10' : (26, 26, 26), * 'grey100' : (255, 255, 255), * 'grey11' : (28, 28, 28), # <<<<<<<<<<<<<< * 'grey12' : (31, 31, 31), * 'grey13' : (33, 33, 33), */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_grey11, __pyx_tuple__278) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "include/color_dict.pxi":272 * 'grey100' : (255, 255, 255), * 'grey11' : (28, 28, 28), * 'grey12' : (31, 31, 31), # <<<<<<<<<<<<<< * 'grey13' : (33, 33, 33), * 'grey14' : (36, 36, 36), */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_grey12, __pyx_tuple__279) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "include/color_dict.pxi":273 * 'grey11' : (28, 28, 28), * 'grey12' : (31, 31, 31), * 'grey13' : (33, 33, 33), # <<<<<<<<<<<<<< * 'grey14' : (36, 36, 36), * 'grey15' : (38, 38, 38), */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_grey13, __pyx_tuple__280) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "include/color_dict.pxi":274 * 'grey12' : (31, 31, 31), * 'grey13' : (33, 33, 33), * 'grey14' : (36, 36, 36), # <<<<<<<<<<<<<< * 'grey15' : (38, 38, 38), * 'grey16' : (41, 41, 41), */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_grey14, __pyx_tuple__281) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "include/color_dict.pxi":275 * 'grey13' : (33, 33, 33), * 'grey14' : (36, 36, 36), * 'grey15' : (38, 38, 38), # <<<<<<<<<<<<<< * 'grey16' : (41, 41, 41), * 'grey17' : (43, 43, 43), */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_grey15, __pyx_tuple__282) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "include/color_dict.pxi":276 * 'grey14' : (36, 36, 36), * 'grey15' : (38, 38, 38), * 'grey16' : (41, 41, 41), # <<<<<<<<<<<<<< * 'grey17' : (43, 43, 43), * 'grey18' : (46, 46, 46), */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_grey16, __pyx_tuple__283) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "include/color_dict.pxi":277 * 'grey15' : (38, 38, 38), * 'grey16' : (41, 41, 41), * 'grey17' : (43, 43, 43), # <<<<<<<<<<<<<< * 'grey18' : (46, 46, 46), * 'grey19' : (48, 48, 48), */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_grey17, __pyx_tuple__284) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "include/color_dict.pxi":278 * 'grey16' : (41, 41, 41), * 'grey17' : (43, 43, 43), * 'grey18' : (46, 46, 46), # <<<<<<<<<<<<<< * 'grey19' : (48, 48, 48), * 'grey2' : (5, 5, 5), */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_grey18, __pyx_tuple__285) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "include/color_dict.pxi":279 * 'grey17' : (43, 43, 43), * 'grey18' : (46, 46, 46), * 'grey19' : (48, 48, 48), # <<<<<<<<<<<<<< * 'grey2' : (5, 5, 5), * 'grey20' : (51, 51, 51), */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_grey19, __pyx_tuple__286) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "include/color_dict.pxi":280 * 'grey18' : (46, 46, 46), * 'grey19' : (48, 48, 48), * 'grey2' : (5, 5, 5), # <<<<<<<<<<<<<< * 'grey20' : (51, 51, 51), * 'grey21' : (54, 54, 54), */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_grey2, __pyx_tuple__287) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "include/color_dict.pxi":281 * 'grey19' : (48, 48, 48), * 'grey2' : (5, 5, 5), * 'grey20' : (51, 51, 51), # <<<<<<<<<<<<<< * 'grey21' : (54, 54, 54), * 'grey22' : (56, 56, 56), */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_grey20, __pyx_tuple__288) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "include/color_dict.pxi":282 * 'grey2' : (5, 5, 5), * 'grey20' : (51, 51, 51), * 'grey21' : (54, 54, 54), # <<<<<<<<<<<<<< * 'grey22' : (56, 56, 56), * 'grey23' : (59, 59, 59), */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_grey21, __pyx_tuple__289) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "include/color_dict.pxi":283 * 'grey20' : (51, 51, 51), * 'grey21' : (54, 54, 54), * 'grey22' : (56, 56, 56), # <<<<<<<<<<<<<< * 'grey23' : (59, 59, 59), * 'grey24' : (61, 61, 61), */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_grey22, __pyx_tuple__290) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "include/color_dict.pxi":284 * 'grey21' : (54, 54, 54), * 'grey22' : (56, 56, 56), * 'grey23' : (59, 59, 59), # <<<<<<<<<<<<<< * 'grey24' : (61, 61, 61), * 'grey25' : (64, 64, 64), */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_grey23, __pyx_tuple__291) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "include/color_dict.pxi":285 * 'grey22' : (56, 56, 56), * 'grey23' : (59, 59, 59), * 'grey24' : (61, 61, 61), # <<<<<<<<<<<<<< * 'grey25' : (64, 64, 64), * 'grey26' : (66, 66, 66), */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_grey24, __pyx_tuple__292) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "include/color_dict.pxi":286 * 'grey23' : (59, 59, 59), * 'grey24' : (61, 61, 61), * 'grey25' : (64, 64, 64), # <<<<<<<<<<<<<< * 'grey26' : (66, 66, 66), * 'grey27' : (69, 69, 69), */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_grey25, __pyx_tuple__293) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "include/color_dict.pxi":287 * 'grey24' : (61, 61, 61), * 'grey25' : (64, 64, 64), * 'grey26' : (66, 66, 66), # <<<<<<<<<<<<<< * 'grey27' : (69, 69, 69), * 'grey28' : (71, 71, 71), */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_grey26, __pyx_tuple__294) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "include/color_dict.pxi":288 * 'grey25' : (64, 64, 64), * 'grey26' : (66, 66, 66), * 'grey27' : (69, 69, 69), # <<<<<<<<<<<<<< * 'grey28' : (71, 71, 71), * 'grey29' : (74, 74, 74), */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_grey27, __pyx_tuple__295) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "include/color_dict.pxi":289 * 'grey26' : (66, 66, 66), * 'grey27' : (69, 69, 69), * 'grey28' : (71, 71, 71), # <<<<<<<<<<<<<< * 'grey29' : (74, 74, 74), * 'grey3' : (8, 8, 8), */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_grey28, __pyx_tuple__296) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "include/color_dict.pxi":290 * 'grey27' : (69, 69, 69), * 'grey28' : (71, 71, 71), * 'grey29' : (74, 74, 74), # <<<<<<<<<<<<<< * 'grey3' : (8, 8, 8), * 'grey30' : (77, 77, 77), */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_grey29, __pyx_tuple__297) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "include/color_dict.pxi":291 * 'grey28' : (71, 71, 71), * 'grey29' : (74, 74, 74), * 'grey3' : (8, 8, 8), # <<<<<<<<<<<<<< * 'grey30' : (77, 77, 77), * 'grey31' : (79, 79, 79), */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_grey3, __pyx_tuple__298) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "include/color_dict.pxi":292 * 'grey29' : (74, 74, 74), * 'grey3' : (8, 8, 8), * 'grey30' : (77, 77, 77), # <<<<<<<<<<<<<< * 'grey31' : (79, 79, 79), * 'grey32' : (82, 82, 82), */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_grey30, __pyx_tuple__299) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "include/color_dict.pxi":293 * 'grey3' : (8, 8, 8), * 'grey30' : (77, 77, 77), * 'grey31' : (79, 79, 79), # <<<<<<<<<<<<<< * 'grey32' : (82, 82, 82), * 'grey33' : (84, 84, 84), */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_grey31, __pyx_tuple__300) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "include/color_dict.pxi":294 * 'grey30' : (77, 77, 77), * 'grey31' : (79, 79, 79), * 'grey32' : (82, 82, 82), # <<<<<<<<<<<<<< * 'grey33' : (84, 84, 84), * 'grey34' : (87, 87, 87), */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_grey32, __pyx_tuple__301) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "include/color_dict.pxi":295 * 'grey31' : (79, 79, 79), * 'grey32' : (82, 82, 82), * 'grey33' : (84, 84, 84), # <<<<<<<<<<<<<< * 'grey34' : (87, 87, 87), * 'grey35' : (89, 89, 89), */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_grey33, __pyx_tuple__302) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "include/color_dict.pxi":296 * 'grey32' : (82, 82, 82), * 'grey33' : (84, 84, 84), * 'grey34' : (87, 87, 87), # <<<<<<<<<<<<<< * 'grey35' : (89, 89, 89), * 'grey36' : (92, 92, 92), */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_grey34, __pyx_tuple__303) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "include/color_dict.pxi":297 * 'grey33' : (84, 84, 84), * 'grey34' : (87, 87, 87), * 'grey35' : (89, 89, 89), # <<<<<<<<<<<<<< * 'grey36' : (92, 92, 92), * 'grey37' : (94, 94, 94), */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_grey35, __pyx_tuple__304) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "include/color_dict.pxi":298 * 'grey34' : (87, 87, 87), * 'grey35' : (89, 89, 89), * 'grey36' : (92, 92, 92), # <<<<<<<<<<<<<< * 'grey37' : (94, 94, 94), * 'grey38' : (97, 97, 97), */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_grey36, __pyx_tuple__305) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "include/color_dict.pxi":299 * 'grey35' : (89, 89, 89), * 'grey36' : (92, 92, 92), * 'grey37' : (94, 94, 94), # <<<<<<<<<<<<<< * 'grey38' : (97, 97, 97), * 'grey39' : (99, 99, 99), */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_grey37, __pyx_tuple__306) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "include/color_dict.pxi":300 * 'grey36' : (92, 92, 92), * 'grey37' : (94, 94, 94), * 'grey38' : (97, 97, 97), # <<<<<<<<<<<<<< * 'grey39' : (99, 99, 99), * 'grey4' : (10, 10, 10), */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_grey38, __pyx_tuple__307) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "include/color_dict.pxi":301 * 'grey37' : (94, 94, 94), * 'grey38' : (97, 97, 97), * 'grey39' : (99, 99, 99), # <<<<<<<<<<<<<< * 'grey4' : (10, 10, 10), * 'grey40' : (102, 102, 102), */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_grey39, __pyx_tuple__308) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "include/color_dict.pxi":302 * 'grey38' : (97, 97, 97), * 'grey39' : (99, 99, 99), * 'grey4' : (10, 10, 10), # <<<<<<<<<<<<<< * 'grey40' : (102, 102, 102), * 'grey41' : (105, 105, 105), */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_grey4, __pyx_tuple__309) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "include/color_dict.pxi":303 * 'grey39' : (99, 99, 99), * 'grey4' : (10, 10, 10), * 'grey40' : (102, 102, 102), # <<<<<<<<<<<<<< * 'grey41' : (105, 105, 105), * 'grey42' : (107, 107, 107), */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_grey40, __pyx_tuple__310) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "include/color_dict.pxi":304 * 'grey4' : (10, 10, 10), * 'grey40' : (102, 102, 102), * 'grey41' : (105, 105, 105), # <<<<<<<<<<<<<< * 'grey42' : (107, 107, 107), * 'grey43' : (110, 110, 110), */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_grey41, __pyx_tuple__311) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "include/color_dict.pxi":305 * 'grey40' : (102, 102, 102), * 'grey41' : (105, 105, 105), * 'grey42' : (107, 107, 107), # <<<<<<<<<<<<<< * 'grey43' : (110, 110, 110), * 'grey44' : (112, 112, 112), */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_grey42, __pyx_tuple__312) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "include/color_dict.pxi":306 * 'grey41' : (105, 105, 105), * 'grey42' : (107, 107, 107), * 'grey43' : (110, 110, 110), # <<<<<<<<<<<<<< * 'grey44' : (112, 112, 112), * 'grey45' : (115, 115, 115), */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_grey43, __pyx_tuple__313) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "include/color_dict.pxi":307 * 'grey42' : (107, 107, 107), * 'grey43' : (110, 110, 110), * 'grey44' : (112, 112, 112), # <<<<<<<<<<<<<< * 'grey45' : (115, 115, 115), * 'grey46' : (117, 117, 117), */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_grey44, __pyx_tuple__314) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "include/color_dict.pxi":308 * 'grey43' : (110, 110, 110), * 'grey44' : (112, 112, 112), * 'grey45' : (115, 115, 115), # <<<<<<<<<<<<<< * 'grey46' : (117, 117, 117), * 'grey47' : (120, 120, 120), */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_grey45, __pyx_tuple__315) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "include/color_dict.pxi":309 * 'grey44' : (112, 112, 112), * 'grey45' : (115, 115, 115), * 'grey46' : (117, 117, 117), # <<<<<<<<<<<<<< * 'grey47' : (120, 120, 120), * 'grey48' : (122, 122, 122), */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_grey46, __pyx_tuple__316) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "include/color_dict.pxi":310 * 'grey45' : (115, 115, 115), * 'grey46' : (117, 117, 117), * 'grey47' : (120, 120, 120), # <<<<<<<<<<<<<< * 'grey48' : (122, 122, 122), * 'grey49' : (125, 125, 125), */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_grey47, __pyx_tuple__317) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "include/color_dict.pxi":311 * 'grey46' : (117, 117, 117), * 'grey47' : (120, 120, 120), * 'grey48' : (122, 122, 122), # <<<<<<<<<<<<<< * 'grey49' : (125, 125, 125), * 'grey5' : (13, 13, 13), */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_grey48, __pyx_tuple__318) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "include/color_dict.pxi":312 * 'grey47' : (120, 120, 120), * 'grey48' : (122, 122, 122), * 'grey49' : (125, 125, 125), # <<<<<<<<<<<<<< * 'grey5' : (13, 13, 13), * 'grey50' : (127, 127, 127), */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_grey49, __pyx_tuple__319) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "include/color_dict.pxi":313 * 'grey48' : (122, 122, 122), * 'grey49' : (125, 125, 125), * 'grey5' : (13, 13, 13), # <<<<<<<<<<<<<< * 'grey50' : (127, 127, 127), * 'grey51' : (130, 130, 130), */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_grey5, __pyx_tuple__320) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "include/color_dict.pxi":314 * 'grey49' : (125, 125, 125), * 'grey5' : (13, 13, 13), * 'grey50' : (127, 127, 127), # <<<<<<<<<<<<<< * 'grey51' : (130, 130, 130), * 'grey52' : (133, 133, 133), */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_grey50, __pyx_tuple__321) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "include/color_dict.pxi":315 * 'grey5' : (13, 13, 13), * 'grey50' : (127, 127, 127), * 'grey51' : (130, 130, 130), # <<<<<<<<<<<<<< * 'grey52' : (133, 133, 133), * 'grey53' : (135, 135, 135), */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_grey51, __pyx_tuple__322) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "include/color_dict.pxi":316 * 'grey50' : (127, 127, 127), * 'grey51' : (130, 130, 130), * 'grey52' : (133, 133, 133), # <<<<<<<<<<<<<< * 'grey53' : (135, 135, 135), * 'grey54' : (138, 138, 138), */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_grey52, __pyx_tuple__323) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "include/color_dict.pxi":317 * 'grey51' : (130, 130, 130), * 'grey52' : (133, 133, 133), * 'grey53' : (135, 135, 135), # <<<<<<<<<<<<<< * 'grey54' : (138, 138, 138), * 'grey55' : (140, 140, 140), */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_grey53, __pyx_tuple__324) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "include/color_dict.pxi":318 * 'grey52' : (133, 133, 133), * 'grey53' : (135, 135, 135), * 'grey54' : (138, 138, 138), # <<<<<<<<<<<<<< * 'grey55' : (140, 140, 140), * 'grey56' : (143, 143, 143), */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_grey54, __pyx_tuple__325) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "include/color_dict.pxi":319 * 'grey53' : (135, 135, 135), * 'grey54' : (138, 138, 138), * 'grey55' : (140, 140, 140), # <<<<<<<<<<<<<< * 'grey56' : (143, 143, 143), * 'grey57' : (145, 145, 145), */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_grey55, __pyx_tuple__326) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "include/color_dict.pxi":320 * 'grey54' : (138, 138, 138), * 'grey55' : (140, 140, 140), * 'grey56' : (143, 143, 143), # <<<<<<<<<<<<<< * 'grey57' : (145, 145, 145), * 'grey58' : (148, 148, 148), */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_grey56, __pyx_tuple__327) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "include/color_dict.pxi":321 * 'grey55' : (140, 140, 140), * 'grey56' : (143, 143, 143), * 'grey57' : (145, 145, 145), # <<<<<<<<<<<<<< * 'grey58' : (148, 148, 148), * 'grey59' : (150, 150, 150), */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_grey57, __pyx_tuple__328) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "include/color_dict.pxi":322 * 'grey56' : (143, 143, 143), * 'grey57' : (145, 145, 145), * 'grey58' : (148, 148, 148), # <<<<<<<<<<<<<< * 'grey59' : (150, 150, 150), * 'grey6' : (15, 15, 15), */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_grey58, __pyx_tuple__329) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "include/color_dict.pxi":323 * 'grey57' : (145, 145, 145), * 'grey58' : (148, 148, 148), * 'grey59' : (150, 150, 150), # <<<<<<<<<<<<<< * 'grey6' : (15, 15, 15), * 'grey60' : (153, 153, 153), */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_grey59, __pyx_tuple__330) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "include/color_dict.pxi":324 * 'grey58' : (148, 148, 148), * 'grey59' : (150, 150, 150), * 'grey6' : (15, 15, 15), # <<<<<<<<<<<<<< * 'grey60' : (153, 153, 153), * 'grey61' : (156, 156, 156), */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_grey6, __pyx_tuple__331) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "include/color_dict.pxi":325 * 'grey59' : (150, 150, 150), * 'grey6' : (15, 15, 15), * 'grey60' : (153, 153, 153), # <<<<<<<<<<<<<< * 'grey61' : (156, 156, 156), * 'grey62' : (158, 158, 158), */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_grey60, __pyx_tuple__332) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "include/color_dict.pxi":326 * 'grey6' : (15, 15, 15), * 'grey60' : (153, 153, 153), * 'grey61' : (156, 156, 156), # <<<<<<<<<<<<<< * 'grey62' : (158, 158, 158), * 'grey63' : (161, 161, 161), */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_grey61, __pyx_tuple__333) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "include/color_dict.pxi":327 * 'grey60' : (153, 153, 153), * 'grey61' : (156, 156, 156), * 'grey62' : (158, 158, 158), # <<<<<<<<<<<<<< * 'grey63' : (161, 161, 161), * 'grey64' : (163, 163, 163), */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_grey62, __pyx_tuple__334) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "include/color_dict.pxi":328 * 'grey61' : (156, 156, 156), * 'grey62' : (158, 158, 158), * 'grey63' : (161, 161, 161), # <<<<<<<<<<<<<< * 'grey64' : (163, 163, 163), * 'grey65' : (166, 166, 166), */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_grey63, __pyx_tuple__335) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "include/color_dict.pxi":329 * 'grey62' : (158, 158, 158), * 'grey63' : (161, 161, 161), * 'grey64' : (163, 163, 163), # <<<<<<<<<<<<<< * 'grey65' : (166, 166, 166), * 'grey66' : (168, 168, 168), */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_grey64, __pyx_tuple__336) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "include/color_dict.pxi":330 * 'grey63' : (161, 161, 161), * 'grey64' : (163, 163, 163), * 'grey65' : (166, 166, 166), # <<<<<<<<<<<<<< * 'grey66' : (168, 168, 168), * 'grey67' : (171, 171, 171), */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_grey65, __pyx_tuple__337) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "include/color_dict.pxi":331 * 'grey64' : (163, 163, 163), * 'grey65' : (166, 166, 166), * 'grey66' : (168, 168, 168), # <<<<<<<<<<<<<< * 'grey67' : (171, 171, 171), * 'grey68' : (173, 173, 173), */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_grey66, __pyx_tuple__338) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "include/color_dict.pxi":332 * 'grey65' : (166, 166, 166), * 'grey66' : (168, 168, 168), * 'grey67' : (171, 171, 171), # <<<<<<<<<<<<<< * 'grey68' : (173, 173, 173), * 'grey69' : (176, 176, 176), */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_grey67, __pyx_tuple__339) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "include/color_dict.pxi":333 * 'grey66' : (168, 168, 168), * 'grey67' : (171, 171, 171), * 'grey68' : (173, 173, 173), # <<<<<<<<<<<<<< * 'grey69' : (176, 176, 176), * 'grey7' : (18, 18, 18), */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_grey68, __pyx_tuple__340) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "include/color_dict.pxi":334 * 'grey67' : (171, 171, 171), * 'grey68' : (173, 173, 173), * 'grey69' : (176, 176, 176), # <<<<<<<<<<<<<< * 'grey7' : (18, 18, 18), * 'grey70' : (179, 179, 179), */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_grey69, __pyx_tuple__341) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "include/color_dict.pxi":335 * 'grey68' : (173, 173, 173), * 'grey69' : (176, 176, 176), * 'grey7' : (18, 18, 18), # <<<<<<<<<<<<<< * 'grey70' : (179, 179, 179), * 'grey71' : (181, 181, 181), */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_grey7, __pyx_tuple__342) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "include/color_dict.pxi":336 * 'grey69' : (176, 176, 176), * 'grey7' : (18, 18, 18), * 'grey70' : (179, 179, 179), # <<<<<<<<<<<<<< * 'grey71' : (181, 181, 181), * 'grey72' : (184, 184, 184), */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_grey70, __pyx_tuple__343) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "include/color_dict.pxi":337 * 'grey7' : (18, 18, 18), * 'grey70' : (179, 179, 179), * 'grey71' : (181, 181, 181), # <<<<<<<<<<<<<< * 'grey72' : (184, 184, 184), * 'grey73' : (186, 186, 186), */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_grey71, __pyx_tuple__344) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "include/color_dict.pxi":338 * 'grey70' : (179, 179, 179), * 'grey71' : (181, 181, 181), * 'grey72' : (184, 184, 184), # <<<<<<<<<<<<<< * 'grey73' : (186, 186, 186), * 'grey74' : (189, 189, 189), */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_grey72, __pyx_tuple__345) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "include/color_dict.pxi":339 * 'grey71' : (181, 181, 181), * 'grey72' : (184, 184, 184), * 'grey73' : (186, 186, 186), # <<<<<<<<<<<<<< * 'grey74' : (189, 189, 189), * 'grey75' : (191, 191, 191), */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_grey73, __pyx_tuple__346) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "include/color_dict.pxi":340 * 'grey72' : (184, 184, 184), * 'grey73' : (186, 186, 186), * 'grey74' : (189, 189, 189), # <<<<<<<<<<<<<< * 'grey75' : (191, 191, 191), * 'grey76' : (194, 194, 194), */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_grey74, __pyx_tuple__347) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "include/color_dict.pxi":341 * 'grey73' : (186, 186, 186), * 'grey74' : (189, 189, 189), * 'grey75' : (191, 191, 191), # <<<<<<<<<<<<<< * 'grey76' : (194, 194, 194), * 'grey77' : (196, 196, 196), */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_grey75, __pyx_tuple__348) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "include/color_dict.pxi":342 * 'grey74' : (189, 189, 189), * 'grey75' : (191, 191, 191), * 'grey76' : (194, 194, 194), # <<<<<<<<<<<<<< * 'grey77' : (196, 196, 196), * 'grey78' : (199, 199, 199), */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_grey76, __pyx_tuple__349) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "include/color_dict.pxi":343 * 'grey75' : (191, 191, 191), * 'grey76' : (194, 194, 194), * 'grey77' : (196, 196, 196), # <<<<<<<<<<<<<< * 'grey78' : (199, 199, 199), * 'grey79' : (201, 201, 201), */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_grey77, __pyx_tuple__350) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "include/color_dict.pxi":344 * 'grey76' : (194, 194, 194), * 'grey77' : (196, 196, 196), * 'grey78' : (199, 199, 199), # <<<<<<<<<<<<<< * 'grey79' : (201, 201, 201), * 'grey8' : (20, 20, 20), */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_grey78, __pyx_tuple__351) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "include/color_dict.pxi":345 * 'grey77' : (196, 196, 196), * 'grey78' : (199, 199, 199), * 'grey79' : (201, 201, 201), # <<<<<<<<<<<<<< * 'grey8' : (20, 20, 20), * 'grey80' : (204, 204, 204), */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_grey79, __pyx_tuple__352) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "include/color_dict.pxi":346 * 'grey78' : (199, 199, 199), * 'grey79' : (201, 201, 201), * 'grey8' : (20, 20, 20), # <<<<<<<<<<<<<< * 'grey80' : (204, 204, 204), * 'grey81' : (207, 207, 207), */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_grey8, __pyx_tuple__353) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "include/color_dict.pxi":347 * 'grey79' : (201, 201, 201), * 'grey8' : (20, 20, 20), * 'grey80' : (204, 204, 204), # <<<<<<<<<<<<<< * 'grey81' : (207, 207, 207), * 'grey82' : (209, 209, 209), */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_grey80, __pyx_tuple__354) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "include/color_dict.pxi":348 * 'grey8' : (20, 20, 20), * 'grey80' : (204, 204, 204), * 'grey81' : (207, 207, 207), # <<<<<<<<<<<<<< * 'grey82' : (209, 209, 209), * 'grey83' : (212, 212, 212), */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_grey81, __pyx_tuple__355) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "include/color_dict.pxi":349 * 'grey80' : (204, 204, 204), * 'grey81' : (207, 207, 207), * 'grey82' : (209, 209, 209), # <<<<<<<<<<<<<< * 'grey83' : (212, 212, 212), * 'grey84' : (214, 214, 214), */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_grey82, __pyx_tuple__356) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "include/color_dict.pxi":350 * 'grey81' : (207, 207, 207), * 'grey82' : (209, 209, 209), * 'grey83' : (212, 212, 212), # <<<<<<<<<<<<<< * 'grey84' : (214, 214, 214), * 'grey85' : (217, 217, 217), */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_grey83, __pyx_tuple__357) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "include/color_dict.pxi":351 * 'grey82' : (209, 209, 209), * 'grey83' : (212, 212, 212), * 'grey84' : (214, 214, 214), # <<<<<<<<<<<<<< * 'grey85' : (217, 217, 217), * 'grey86' : (219, 219, 219), */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_grey84, __pyx_tuple__358) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "include/color_dict.pxi":352 * 'grey83' : (212, 212, 212), * 'grey84' : (214, 214, 214), * 'grey85' : (217, 217, 217), # <<<<<<<<<<<<<< * 'grey86' : (219, 219, 219), * 'grey87' : (222, 222, 222), */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_grey85, __pyx_tuple__359) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "include/color_dict.pxi":353 * 'grey84' : (214, 214, 214), * 'grey85' : (217, 217, 217), * 'grey86' : (219, 219, 219), # <<<<<<<<<<<<<< * 'grey87' : (222, 222, 222), * 'grey88' : (224, 224, 224), */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_grey86, __pyx_tuple__360) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "include/color_dict.pxi":354 * 'grey85' : (217, 217, 217), * 'grey86' : (219, 219, 219), * 'grey87' : (222, 222, 222), # <<<<<<<<<<<<<< * 'grey88' : (224, 224, 224), * 'grey89' : (227, 227, 227), */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_grey87, __pyx_tuple__361) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "include/color_dict.pxi":355 * 'grey86' : (219, 219, 219), * 'grey87' : (222, 222, 222), * 'grey88' : (224, 224, 224), # <<<<<<<<<<<<<< * 'grey89' : (227, 227, 227), * 'grey9' : (23, 23, 23), */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_grey88, __pyx_tuple__362) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "include/color_dict.pxi":356 * 'grey87' : (222, 222, 222), * 'grey88' : (224, 224, 224), * 'grey89' : (227, 227, 227), # <<<<<<<<<<<<<< * 'grey9' : (23, 23, 23), * 'grey90' : (229, 229, 229), */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_grey89, __pyx_tuple__363) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "include/color_dict.pxi":357 * 'grey88' : (224, 224, 224), * 'grey89' : (227, 227, 227), * 'grey9' : (23, 23, 23), # <<<<<<<<<<<<<< * 'grey90' : (229, 229, 229), * 'grey91' : (232, 232, 232), */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_grey9, __pyx_tuple__364) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "include/color_dict.pxi":358 * 'grey89' : (227, 227, 227), * 'grey9' : (23, 23, 23), * 'grey90' : (229, 229, 229), # <<<<<<<<<<<<<< * 'grey91' : (232, 232, 232), * 'grey92' : (235, 235, 235), */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_grey90, __pyx_tuple__365) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "include/color_dict.pxi":359 * 'grey9' : (23, 23, 23), * 'grey90' : (229, 229, 229), * 'grey91' : (232, 232, 232), # <<<<<<<<<<<<<< * 'grey92' : (235, 235, 235), * 'grey93' : (237, 237, 237), */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_grey91, __pyx_tuple__366) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "include/color_dict.pxi":360 * 'grey90' : (229, 229, 229), * 'grey91' : (232, 232, 232), * 'grey92' : (235, 235, 235), # <<<<<<<<<<<<<< * 'grey93' : (237, 237, 237), * 'grey94' : (240, 240, 240), */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_grey92, __pyx_tuple__367) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "include/color_dict.pxi":361 * 'grey91' : (232, 232, 232), * 'grey92' : (235, 235, 235), * 'grey93' : (237, 237, 237), # <<<<<<<<<<<<<< * 'grey94' : (240, 240, 240), * 'grey95' : (242, 242, 242), */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_grey93, __pyx_tuple__368) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "include/color_dict.pxi":362 * 'grey92' : (235, 235, 235), * 'grey93' : (237, 237, 237), * 'grey94' : (240, 240, 240), # <<<<<<<<<<<<<< * 'grey95' : (242, 242, 242), * 'grey96' : (245, 245, 245), */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_grey94, __pyx_tuple__369) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "include/color_dict.pxi":363 * 'grey93' : (237, 237, 237), * 'grey94' : (240, 240, 240), * 'grey95' : (242, 242, 242), # <<<<<<<<<<<<<< * 'grey96' : (245, 245, 245), * 'grey97' : (247, 247, 247), */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_grey95, __pyx_tuple__370) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "include/color_dict.pxi":364 * 'grey94' : (240, 240, 240), * 'grey95' : (242, 242, 242), * 'grey96' : (245, 245, 245), # <<<<<<<<<<<<<< * 'grey97' : (247, 247, 247), * 'grey98' : (250, 250, 250), */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_grey96, __pyx_tuple__371) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "include/color_dict.pxi":365 * 'grey95' : (242, 242, 242), * 'grey96' : (245, 245, 245), * 'grey97' : (247, 247, 247), # <<<<<<<<<<<<<< * 'grey98' : (250, 250, 250), * 'grey99' : (252, 252, 252), */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_grey97, __pyx_tuple__372) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "include/color_dict.pxi":366 * 'grey96' : (245, 245, 245), * 'grey97' : (247, 247, 247), * 'grey98' : (250, 250, 250), # <<<<<<<<<<<<<< * 'grey99' : (252, 252, 252), * 'honeydew' : (240, 255, 240), */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_grey98, __pyx_tuple__373) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "include/color_dict.pxi":367 * 'grey97' : (247, 247, 247), * 'grey98' : (250, 250, 250), * 'grey99' : (252, 252, 252), # <<<<<<<<<<<<<< * 'honeydew' : (240, 255, 240), * 'honeydew1' : (240, 255, 240), */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_grey99, __pyx_tuple__374) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "include/color_dict.pxi":368 * 'grey98' : (250, 250, 250), * 'grey99' : (252, 252, 252), * 'honeydew' : (240, 255, 240), # <<<<<<<<<<<<<< * 'honeydew1' : (240, 255, 240), * 'honeydew2' : (224, 238, 224), */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_honeydew, __pyx_tuple__375) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "include/color_dict.pxi":369 * 'grey99' : (252, 252, 252), * 'honeydew' : (240, 255, 240), * 'honeydew1' : (240, 255, 240), # <<<<<<<<<<<<<< * 'honeydew2' : (224, 238, 224), * 'honeydew3' : (193, 205, 193), */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_honeydew1, __pyx_tuple__376) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "include/color_dict.pxi":370 * 'honeydew' : (240, 255, 240), * 'honeydew1' : (240, 255, 240), * 'honeydew2' : (224, 238, 224), # <<<<<<<<<<<<<< * 'honeydew3' : (193, 205, 193), * 'honeydew4' : (131, 139, 131), */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_honeydew2, __pyx_tuple__377) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "include/color_dict.pxi":371 * 'honeydew1' : (240, 255, 240), * 'honeydew2' : (224, 238, 224), * 'honeydew3' : (193, 205, 193), # <<<<<<<<<<<<<< * 'honeydew4' : (131, 139, 131), * 'hotpink' : (255, 105, 180), */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_honeydew3, __pyx_tuple__378) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "include/color_dict.pxi":372 * 'honeydew2' : (224, 238, 224), * 'honeydew3' : (193, 205, 193), * 'honeydew4' : (131, 139, 131), # <<<<<<<<<<<<<< * 'hotpink' : (255, 105, 180), * 'hotpink1' : (255, 110, 180), */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_honeydew4, __pyx_tuple__379) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "include/color_dict.pxi":373 * 'honeydew3' : (193, 205, 193), * 'honeydew4' : (131, 139, 131), * 'hotpink' : (255, 105, 180), # <<<<<<<<<<<<<< * 'hotpink1' : (255, 110, 180), * 'hotpink2' : (238, 106, 167), */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_hotpink, __pyx_tuple__380) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "include/color_dict.pxi":374 * 'honeydew4' : (131, 139, 131), * 'hotpink' : (255, 105, 180), * 'hotpink1' : (255, 110, 180), # <<<<<<<<<<<<<< * 'hotpink2' : (238, 106, 167), * 'hotpink3' : (205, 96, 144), */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_hotpink1, __pyx_tuple__381) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "include/color_dict.pxi":375 * 'hotpink' : (255, 105, 180), * 'hotpink1' : (255, 110, 180), * 'hotpink2' : (238, 106, 167), # <<<<<<<<<<<<<< * 'hotpink3' : (205, 96, 144), * 'hotpink4' : (139, 58, 98), */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_hotpink2, __pyx_tuple__382) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "include/color_dict.pxi":376 * 'hotpink1' : (255, 110, 180), * 'hotpink2' : (238, 106, 167), * 'hotpink3' : (205, 96, 144), # <<<<<<<<<<<<<< * 'hotpink4' : (139, 58, 98), * 'indianred' : (205, 92, 92), */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_hotpink3, __pyx_tuple__383) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "include/color_dict.pxi":377 * 'hotpink2' : (238, 106, 167), * 'hotpink3' : (205, 96, 144), * 'hotpink4' : (139, 58, 98), # <<<<<<<<<<<<<< * 'indianred' : (205, 92, 92), * 'indianred1' : (255, 106, 106), */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_hotpink4, __pyx_tuple__384) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "include/color_dict.pxi":378 * 'hotpink3' : (205, 96, 144), * 'hotpink4' : (139, 58, 98), * 'indianred' : (205, 92, 92), # <<<<<<<<<<<<<< * 'indianred1' : (255, 106, 106), * 'indianred2' : (238, 99, 99), */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_indianred, __pyx_tuple__385) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "include/color_dict.pxi":379 * 'hotpink4' : (139, 58, 98), * 'indianred' : (205, 92, 92), * 'indianred1' : (255, 106, 106), # <<<<<<<<<<<<<< * 'indianred2' : (238, 99, 99), * 'indianred3' : (205, 85, 85), */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_indianred1, __pyx_tuple__386) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "include/color_dict.pxi":380 * 'indianred' : (205, 92, 92), * 'indianred1' : (255, 106, 106), * 'indianred2' : (238, 99, 99), # <<<<<<<<<<<<<< * 'indianred3' : (205, 85, 85), * 'indianred4' : (139, 58, 58), */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_indianred2, __pyx_tuple__387) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "include/color_dict.pxi":381 * 'indianred1' : (255, 106, 106), * 'indianred2' : (238, 99, 99), * 'indianred3' : (205, 85, 85), # <<<<<<<<<<<<<< * 'indianred4' : (139, 58, 58), * 'indigo' : (75, 0, 130), */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_indianred3, __pyx_tuple__388) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "include/color_dict.pxi":382 * 'indianred2' : (238, 99, 99), * 'indianred3' : (205, 85, 85), * 'indianred4' : (139, 58, 58), # <<<<<<<<<<<<<< * 'indigo' : (75, 0, 130), * 'ivory' : (255, 255, 240), */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_indianred4, __pyx_tuple__389) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "include/color_dict.pxi":383 * 'indianred3' : (205, 85, 85), * 'indianred4' : (139, 58, 58), * 'indigo' : (75, 0, 130), # <<<<<<<<<<<<<< * 'ivory' : (255, 255, 240), * 'ivory1' : (255, 255, 240), */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_indigo, __pyx_tuple__390) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "include/color_dict.pxi":384 * 'indianred4' : (139, 58, 58), * 'indigo' : (75, 0, 130), * 'ivory' : (255, 255, 240), # <<<<<<<<<<<<<< * 'ivory1' : (255, 255, 240), * 'ivory2' : (238, 238, 224), */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_ivory, __pyx_tuple__391) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "include/color_dict.pxi":385 * 'indigo' : (75, 0, 130), * 'ivory' : (255, 255, 240), * 'ivory1' : (255, 255, 240), # <<<<<<<<<<<<<< * 'ivory2' : (238, 238, 224), * 'ivory3' : (205, 205, 193), */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_ivory1, __pyx_tuple__392) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "include/color_dict.pxi":386 * 'ivory' : (255, 255, 240), * 'ivory1' : (255, 255, 240), * 'ivory2' : (238, 238, 224), # <<<<<<<<<<<<<< * 'ivory3' : (205, 205, 193), * 'ivory4' : (139, 139, 131), */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_ivory2, __pyx_tuple__393) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "include/color_dict.pxi":387 * 'ivory1' : (255, 255, 240), * 'ivory2' : (238, 238, 224), * 'ivory3' : (205, 205, 193), # <<<<<<<<<<<<<< * 'ivory4' : (139, 139, 131), * 'khaki' : (240, 230, 140), */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_ivory3, __pyx_tuple__394) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "include/color_dict.pxi":388 * 'ivory2' : (238, 238, 224), * 'ivory3' : (205, 205, 193), * 'ivory4' : (139, 139, 131), # <<<<<<<<<<<<<< * 'khaki' : (240, 230, 140), * 'khaki1' : (255, 246, 143), */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_ivory4, __pyx_tuple__395) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "include/color_dict.pxi":389 * 'ivory3' : (205, 205, 193), * 'ivory4' : (139, 139, 131), * 'khaki' : (240, 230, 140), # <<<<<<<<<<<<<< * 'khaki1' : (255, 246, 143), * 'khaki2' : (238, 230, 133), */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_khaki, __pyx_tuple__396) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "include/color_dict.pxi":390 * 'ivory4' : (139, 139, 131), * 'khaki' : (240, 230, 140), * 'khaki1' : (255, 246, 143), # <<<<<<<<<<<<<< * 'khaki2' : (238, 230, 133), * 'khaki3' : (205, 198, 115), */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_khaki1, __pyx_tuple__397) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "include/color_dict.pxi":391 * 'khaki' : (240, 230, 140), * 'khaki1' : (255, 246, 143), * 'khaki2' : (238, 230, 133), # <<<<<<<<<<<<<< * 'khaki3' : (205, 198, 115), * 'khaki4' : (139, 134, 78), */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_khaki2, __pyx_tuple__398) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "include/color_dict.pxi":392 * 'khaki1' : (255, 246, 143), * 'khaki2' : (238, 230, 133), * 'khaki3' : (205, 198, 115), # <<<<<<<<<<<<<< * 'khaki4' : (139, 134, 78), * 'lavender' : (230, 230, 250), */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_khaki3, __pyx_tuple__399) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "include/color_dict.pxi":393 * 'khaki2' : (238, 230, 133), * 'khaki3' : (205, 198, 115), * 'khaki4' : (139, 134, 78), # <<<<<<<<<<<<<< * 'lavender' : (230, 230, 250), * 'lavenderblush' : (255, 240, 245), */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_khaki4, __pyx_tuple__400) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "include/color_dict.pxi":394 * 'khaki3' : (205, 198, 115), * 'khaki4' : (139, 134, 78), * 'lavender' : (230, 230, 250), # <<<<<<<<<<<<<< * 'lavenderblush' : (255, 240, 245), * 'lavenderblush1' : (255, 240, 245), */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_lavender, __pyx_tuple__401) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "include/color_dict.pxi":395 * 'khaki4' : (139, 134, 78), * 'lavender' : (230, 230, 250), * 'lavenderblush' : (255, 240, 245), # <<<<<<<<<<<<<< * 'lavenderblush1' : (255, 240, 245), * 'lavenderblush2' : (238, 224, 229), */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_lavenderblush, __pyx_tuple__402) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "include/color_dict.pxi":396 * 'lavender' : (230, 230, 250), * 'lavenderblush' : (255, 240, 245), * 'lavenderblush1' : (255, 240, 245), # <<<<<<<<<<<<<< * 'lavenderblush2' : (238, 224, 229), * 'lavenderblush3' : (205, 193, 197), */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_lavenderblush1, __pyx_tuple__403) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "include/color_dict.pxi":397 * 'lavenderblush' : (255, 240, 245), * 'lavenderblush1' : (255, 240, 245), * 'lavenderblush2' : (238, 224, 229), # <<<<<<<<<<<<<< * 'lavenderblush3' : (205, 193, 197), * 'lavenderblush4' : (139, 131, 134), */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_lavenderblush2, __pyx_tuple__404) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "include/color_dict.pxi":398 * 'lavenderblush1' : (255, 240, 245), * 'lavenderblush2' : (238, 224, 229), * 'lavenderblush3' : (205, 193, 197), # <<<<<<<<<<<<<< * 'lavenderblush4' : (139, 131, 134), * 'lawngreen' : (124, 252, 0), */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_lavenderblush3, __pyx_tuple__405) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "include/color_dict.pxi":399 * 'lavenderblush2' : (238, 224, 229), * 'lavenderblush3' : (205, 193, 197), * 'lavenderblush4' : (139, 131, 134), # <<<<<<<<<<<<<< * 'lawngreen' : (124, 252, 0), * 'lemonchiffon' : (255, 250, 205), */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_lavenderblush4, __pyx_tuple__406) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "include/color_dict.pxi":400 * 'lavenderblush3' : (205, 193, 197), * 'lavenderblush4' : (139, 131, 134), * 'lawngreen' : (124, 252, 0), # <<<<<<<<<<<<<< * 'lemonchiffon' : (255, 250, 205), * 'lemonchiffon1' : (255, 250, 205), */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_lawngreen, __pyx_tuple__407) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "include/color_dict.pxi":401 * 'lavenderblush4' : (139, 131, 134), * 'lawngreen' : (124, 252, 0), * 'lemonchiffon' : (255, 250, 205), # <<<<<<<<<<<<<< * 'lemonchiffon1' : (255, 250, 205), * 'lemonchiffon2' : (238, 233, 191), */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_lemonchiffon, __pyx_tuple__408) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "include/color_dict.pxi":402 * 'lawngreen' : (124, 252, 0), * 'lemonchiffon' : (255, 250, 205), * 'lemonchiffon1' : (255, 250, 205), # <<<<<<<<<<<<<< * 'lemonchiffon2' : (238, 233, 191), * 'lemonchiffon3' : (205, 201, 165), */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_lemonchiffon1, __pyx_tuple__409) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "include/color_dict.pxi":403 * 'lemonchiffon' : (255, 250, 205), * 'lemonchiffon1' : (255, 250, 205), * 'lemonchiffon2' : (238, 233, 191), # <<<<<<<<<<<<<< * 'lemonchiffon3' : (205, 201, 165), * 'lemonchiffon4' : (139, 137, 112), */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_lemonchiffon2, __pyx_tuple__410) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "include/color_dict.pxi":404 * 'lemonchiffon1' : (255, 250, 205), * 'lemonchiffon2' : (238, 233, 191), * 'lemonchiffon3' : (205, 201, 165), # <<<<<<<<<<<<<< * 'lemonchiffon4' : (139, 137, 112), * 'lightblue' : (173, 216, 230), */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_lemonchiffon3, __pyx_tuple__411) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "include/color_dict.pxi":405 * 'lemonchiffon2' : (238, 233, 191), * 'lemonchiffon3' : (205, 201, 165), * 'lemonchiffon4' : (139, 137, 112), # <<<<<<<<<<<<<< * 'lightblue' : (173, 216, 230), * 'lightblue1' : (191, 239, 255), */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_lemonchiffon4, __pyx_tuple__412) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "include/color_dict.pxi":406 * 'lemonchiffon3' : (205, 201, 165), * 'lemonchiffon4' : (139, 137, 112), * 'lightblue' : (173, 216, 230), # <<<<<<<<<<<<<< * 'lightblue1' : (191, 239, 255), * 'lightblue2' : (178, 223, 238), */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_lightblue, __pyx_tuple__413) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "include/color_dict.pxi":407 * 'lemonchiffon4' : (139, 137, 112), * 'lightblue' : (173, 216, 230), * 'lightblue1' : (191, 239, 255), # <<<<<<<<<<<<<< * 'lightblue2' : (178, 223, 238), * 'lightblue3' : (154, 192, 205), */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_lightblue1, __pyx_tuple__414) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "include/color_dict.pxi":408 * 'lightblue' : (173, 216, 230), * 'lightblue1' : (191, 239, 255), * 'lightblue2' : (178, 223, 238), # <<<<<<<<<<<<<< * 'lightblue3' : (154, 192, 205), * 'lightblue4' : (104, 131, 139), */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_lightblue2, __pyx_tuple__415) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "include/color_dict.pxi":409 * 'lightblue1' : (191, 239, 255), * 'lightblue2' : (178, 223, 238), * 'lightblue3' : (154, 192, 205), # <<<<<<<<<<<<<< * 'lightblue4' : (104, 131, 139), * 'lightcoral' : (240, 128, 128), */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_lightblue3, __pyx_tuple__416) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "include/color_dict.pxi":410 * 'lightblue2' : (178, 223, 238), * 'lightblue3' : (154, 192, 205), * 'lightblue4' : (104, 131, 139), # <<<<<<<<<<<<<< * 'lightcoral' : (240, 128, 128), * 'lightcyan' : (224, 255, 255), */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_lightblue4, __pyx_tuple__417) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "include/color_dict.pxi":411 * 'lightblue3' : (154, 192, 205), * 'lightblue4' : (104, 131, 139), * 'lightcoral' : (240, 128, 128), # <<<<<<<<<<<<<< * 'lightcyan' : (224, 255, 255), * 'lightcyan1' : (224, 255, 255), */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_lightcoral, __pyx_tuple__418) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "include/color_dict.pxi":412 * 'lightblue4' : (104, 131, 139), * 'lightcoral' : (240, 128, 128), * 'lightcyan' : (224, 255, 255), # <<<<<<<<<<<<<< * 'lightcyan1' : (224, 255, 255), * 'lightcyan2' : (209, 238, 238), */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_lightcyan, __pyx_tuple__419) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "include/color_dict.pxi":413 * 'lightcoral' : (240, 128, 128), * 'lightcyan' : (224, 255, 255), * 'lightcyan1' : (224, 255, 255), # <<<<<<<<<<<<<< * 'lightcyan2' : (209, 238, 238), * 'lightcyan3' : (180, 205, 205), */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_lightcyan1, __pyx_tuple__420) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "include/color_dict.pxi":414 * 'lightcyan' : (224, 255, 255), * 'lightcyan1' : (224, 255, 255), * 'lightcyan2' : (209, 238, 238), # <<<<<<<<<<<<<< * 'lightcyan3' : (180, 205, 205), * 'lightcyan4' : (122, 139, 139), */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_lightcyan2, __pyx_tuple__421) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "include/color_dict.pxi":415 * 'lightcyan1' : (224, 255, 255), * 'lightcyan2' : (209, 238, 238), * 'lightcyan3' : (180, 205, 205), # <<<<<<<<<<<<<< * 'lightcyan4' : (122, 139, 139), * 'lightgoldenrod' : (238, 221, 130), */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_lightcyan3, __pyx_tuple__422) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "include/color_dict.pxi":416 * 'lightcyan2' : (209, 238, 238), * 'lightcyan3' : (180, 205, 205), * 'lightcyan4' : (122, 139, 139), # <<<<<<<<<<<<<< * 'lightgoldenrod' : (238, 221, 130), * 'lightgoldenrod1' : (255, 236, 139), */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_lightcyan4, __pyx_tuple__423) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "include/color_dict.pxi":417 * 'lightcyan3' : (180, 205, 205), * 'lightcyan4' : (122, 139, 139), * 'lightgoldenrod' : (238, 221, 130), # <<<<<<<<<<<<<< * 'lightgoldenrod1' : (255, 236, 139), * 'lightgoldenrod2' : (238, 220, 130), */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_lightgoldenrod, __pyx_tuple__424) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "include/color_dict.pxi":418 * 'lightcyan4' : (122, 139, 139), * 'lightgoldenrod' : (238, 221, 130), * 'lightgoldenrod1' : (255, 236, 139), # <<<<<<<<<<<<<< * 'lightgoldenrod2' : (238, 220, 130), * 'lightgoldenrod3' : (205, 190, 112), */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_lightgoldenrod1, __pyx_tuple__425) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "include/color_dict.pxi":419 * 'lightgoldenrod' : (238, 221, 130), * 'lightgoldenrod1' : (255, 236, 139), * 'lightgoldenrod2' : (238, 220, 130), # <<<<<<<<<<<<<< * 'lightgoldenrod3' : (205, 190, 112), * 'lightgoldenrod4' : (139, 129, 76), */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_lightgoldenrod2, __pyx_tuple__426) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "include/color_dict.pxi":420 * 'lightgoldenrod1' : (255, 236, 139), * 'lightgoldenrod2' : (238, 220, 130), * 'lightgoldenrod3' : (205, 190, 112), # <<<<<<<<<<<<<< * 'lightgoldenrod4' : (139, 129, 76), * 'lightgoldenrodyellow' : (250, 250, 210), */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_lightgoldenrod3, __pyx_tuple__427) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "include/color_dict.pxi":421 * 'lightgoldenrod2' : (238, 220, 130), * 'lightgoldenrod3' : (205, 190, 112), * 'lightgoldenrod4' : (139, 129, 76), # <<<<<<<<<<<<<< * 'lightgoldenrodyellow' : (250, 250, 210), * 'lightgray' : (211, 211, 211), */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_lightgoldenrod4, __pyx_tuple__428) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "include/color_dict.pxi":422 * 'lightgoldenrod3' : (205, 190, 112), * 'lightgoldenrod4' : (139, 129, 76), * 'lightgoldenrodyellow' : (250, 250, 210), # <<<<<<<<<<<<<< * 'lightgray' : (211, 211, 211), * 'lightgreen' : (144, 238, 144), */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_lightgoldenrodyellow, __pyx_tuple__429) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "include/color_dict.pxi":423 * 'lightgoldenrod4' : (139, 129, 76), * 'lightgoldenrodyellow' : (250, 250, 210), * 'lightgray' : (211, 211, 211), # <<<<<<<<<<<<<< * 'lightgreen' : (144, 238, 144), * 'lightgrey' : (211, 211, 211), */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_lightgray, __pyx_tuple__430) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "include/color_dict.pxi":424 * 'lightgoldenrodyellow' : (250, 250, 210), * 'lightgray' : (211, 211, 211), * 'lightgreen' : (144, 238, 144), # <<<<<<<<<<<<<< * 'lightgrey' : (211, 211, 211), * 'lightpink' : (255, 182, 193), */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_lightgreen, __pyx_tuple__431) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "include/color_dict.pxi":425 * 'lightgray' : (211, 211, 211), * 'lightgreen' : (144, 238, 144), * 'lightgrey' : (211, 211, 211), # <<<<<<<<<<<<<< * 'lightpink' : (255, 182, 193), * 'lightpink1' : (255, 174, 185), */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_lightgrey, __pyx_tuple__432) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "include/color_dict.pxi":426 * 'lightgreen' : (144, 238, 144), * 'lightgrey' : (211, 211, 211), * 'lightpink' : (255, 182, 193), # <<<<<<<<<<<<<< * 'lightpink1' : (255, 174, 185), * 'lightpink2' : (238, 162, 173), */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_lightpink, __pyx_tuple__433) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "include/color_dict.pxi":427 * 'lightgrey' : (211, 211, 211), * 'lightpink' : (255, 182, 193), * 'lightpink1' : (255, 174, 185), # <<<<<<<<<<<<<< * 'lightpink2' : (238, 162, 173), * 'lightpink3' : (205, 140, 149), */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_lightpink1, __pyx_tuple__434) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "include/color_dict.pxi":428 * 'lightpink' : (255, 182, 193), * 'lightpink1' : (255, 174, 185), * 'lightpink2' : (238, 162, 173), # <<<<<<<<<<<<<< * 'lightpink3' : (205, 140, 149), * 'lightpink4' : (139, 95, 101), */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_lightpink2, __pyx_tuple__435) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "include/color_dict.pxi":429 * 'lightpink1' : (255, 174, 185), * 'lightpink2' : (238, 162, 173), * 'lightpink3' : (205, 140, 149), # <<<<<<<<<<<<<< * 'lightpink4' : (139, 95, 101), * 'lightsalmon' : (255, 160, 122), */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_lightpink3, __pyx_tuple__436) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "include/color_dict.pxi":430 * 'lightpink2' : (238, 162, 173), * 'lightpink3' : (205, 140, 149), * 'lightpink4' : (139, 95, 101), # <<<<<<<<<<<<<< * 'lightsalmon' : (255, 160, 122), * 'lightsalmon1' : (255, 160, 122), */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_lightpink4, __pyx_tuple__437) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "include/color_dict.pxi":431 * 'lightpink3' : (205, 140, 149), * 'lightpink4' : (139, 95, 101), * 'lightsalmon' : (255, 160, 122), # <<<<<<<<<<<<<< * 'lightsalmon1' : (255, 160, 122), * 'lightsalmon2' : (238, 149, 114), */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_lightsalmon, __pyx_tuple__438) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "include/color_dict.pxi":432 * 'lightpink4' : (139, 95, 101), * 'lightsalmon' : (255, 160, 122), * 'lightsalmon1' : (255, 160, 122), # <<<<<<<<<<<<<< * 'lightsalmon2' : (238, 149, 114), * 'lightsalmon3' : (205, 129, 98), */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_lightsalmon1, __pyx_tuple__439) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "include/color_dict.pxi":433 * 'lightsalmon' : (255, 160, 122), * 'lightsalmon1' : (255, 160, 122), * 'lightsalmon2' : (238, 149, 114), # <<<<<<<<<<<<<< * 'lightsalmon3' : (205, 129, 98), * 'lightsalmon4' : (139, 87, 66), */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_lightsalmon2, __pyx_tuple__440) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "include/color_dict.pxi":434 * 'lightsalmon1' : (255, 160, 122), * 'lightsalmon2' : (238, 149, 114), * 'lightsalmon3' : (205, 129, 98), # <<<<<<<<<<<<<< * 'lightsalmon4' : (139, 87, 66), * 'lightseagreen' : (32, 178, 170), */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_lightsalmon3, __pyx_tuple__441) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "include/color_dict.pxi":435 * 'lightsalmon2' : (238, 149, 114), * 'lightsalmon3' : (205, 129, 98), * 'lightsalmon4' : (139, 87, 66), # <<<<<<<<<<<<<< * 'lightseagreen' : (32, 178, 170), * 'lightskyblue' : (135, 206, 250), */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_lightsalmon4, __pyx_tuple__442) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "include/color_dict.pxi":436 * 'lightsalmon3' : (205, 129, 98), * 'lightsalmon4' : (139, 87, 66), * 'lightseagreen' : (32, 178, 170), # <<<<<<<<<<<<<< * 'lightskyblue' : (135, 206, 250), * 'lightskyblue1' : (176, 226, 255), */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_lightseagreen, __pyx_tuple__443) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "include/color_dict.pxi":437 * 'lightsalmon4' : (139, 87, 66), * 'lightseagreen' : (32, 178, 170), * 'lightskyblue' : (135, 206, 250), # <<<<<<<<<<<<<< * 'lightskyblue1' : (176, 226, 255), * 'lightskyblue2' : (164, 211, 238), */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_lightskyblue, __pyx_tuple__444) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "include/color_dict.pxi":438 * 'lightseagreen' : (32, 178, 170), * 'lightskyblue' : (135, 206, 250), * 'lightskyblue1' : (176, 226, 255), # <<<<<<<<<<<<<< * 'lightskyblue2' : (164, 211, 238), * 'lightskyblue3' : (141, 182, 205), */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_lightskyblue1, __pyx_tuple__445) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "include/color_dict.pxi":439 * 'lightskyblue' : (135, 206, 250), * 'lightskyblue1' : (176, 226, 255), * 'lightskyblue2' : (164, 211, 238), # <<<<<<<<<<<<<< * 'lightskyblue3' : (141, 182, 205), * 'lightskyblue4' : (96, 123, 139), */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_lightskyblue2, __pyx_tuple__446) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "include/color_dict.pxi":440 * 'lightskyblue1' : (176, 226, 255), * 'lightskyblue2' : (164, 211, 238), * 'lightskyblue3' : (141, 182, 205), # <<<<<<<<<<<<<< * 'lightskyblue4' : (96, 123, 139), * 'lightslateblue' : (132, 112, 255), */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_lightskyblue3, __pyx_tuple__447) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "include/color_dict.pxi":441 * 'lightskyblue2' : (164, 211, 238), * 'lightskyblue3' : (141, 182, 205), * 'lightskyblue4' : (96, 123, 139), # <<<<<<<<<<<<<< * 'lightslateblue' : (132, 112, 255), * 'lightslategray' : (119, 136, 153), */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_lightskyblue4, __pyx_tuple__448) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "include/color_dict.pxi":442 * 'lightskyblue3' : (141, 182, 205), * 'lightskyblue4' : (96, 123, 139), * 'lightslateblue' : (132, 112, 255), # <<<<<<<<<<<<<< * 'lightslategray' : (119, 136, 153), * 'lightslategrey' : (119, 136, 153), */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_lightslateblue, __pyx_tuple__449) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "include/color_dict.pxi":443 * 'lightskyblue4' : (96, 123, 139), * 'lightslateblue' : (132, 112, 255), * 'lightslategray' : (119, 136, 153), # <<<<<<<<<<<<<< * 'lightslategrey' : (119, 136, 153), * 'lightsteelblue' : (176, 196, 222), */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_lightslategray, __pyx_tuple__450) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "include/color_dict.pxi":444 * 'lightslateblue' : (132, 112, 255), * 'lightslategray' : (119, 136, 153), * 'lightslategrey' : (119, 136, 153), # <<<<<<<<<<<<<< * 'lightsteelblue' : (176, 196, 222), * 'lightsteelblue1' : (202, 225, 255), */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_lightslategrey, __pyx_tuple__451) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "include/color_dict.pxi":445 * 'lightslategray' : (119, 136, 153), * 'lightslategrey' : (119, 136, 153), * 'lightsteelblue' : (176, 196, 222), # <<<<<<<<<<<<<< * 'lightsteelblue1' : (202, 225, 255), * 'lightsteelblue2' : (188, 210, 238), */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_lightsteelblue, __pyx_tuple__452) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "include/color_dict.pxi":446 * 'lightslategrey' : (119, 136, 153), * 'lightsteelblue' : (176, 196, 222), * 'lightsteelblue1' : (202, 225, 255), # <<<<<<<<<<<<<< * 'lightsteelblue2' : (188, 210, 238), * 'lightsteelblue3' : (162, 181, 205), */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_lightsteelblue1, __pyx_tuple__453) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "include/color_dict.pxi":447 * 'lightsteelblue' : (176, 196, 222), * 'lightsteelblue1' : (202, 225, 255), * 'lightsteelblue2' : (188, 210, 238), # <<<<<<<<<<<<<< * 'lightsteelblue3' : (162, 181, 205), * 'lightsteelblue4' : (110, 123, 139), */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_lightsteelblue2, __pyx_tuple__454) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "include/color_dict.pxi":448 * 'lightsteelblue1' : (202, 225, 255), * 'lightsteelblue2' : (188, 210, 238), * 'lightsteelblue3' : (162, 181, 205), # <<<<<<<<<<<<<< * 'lightsteelblue4' : (110, 123, 139), * 'lightyellow' : (255, 255, 224), */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_lightsteelblue3, __pyx_tuple__455) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "include/color_dict.pxi":449 * 'lightsteelblue2' : (188, 210, 238), * 'lightsteelblue3' : (162, 181, 205), * 'lightsteelblue4' : (110, 123, 139), # <<<<<<<<<<<<<< * 'lightyellow' : (255, 255, 224), * 'lightyellow1' : (255, 255, 224), */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_lightsteelblue4, __pyx_tuple__456) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "include/color_dict.pxi":450 * 'lightsteelblue3' : (162, 181, 205), * 'lightsteelblue4' : (110, 123, 139), * 'lightyellow' : (255, 255, 224), # <<<<<<<<<<<<<< * 'lightyellow1' : (255, 255, 224), * 'lightyellow2' : (238, 238, 209), */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_lightyellow, __pyx_tuple__457) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "include/color_dict.pxi":451 * 'lightsteelblue4' : (110, 123, 139), * 'lightyellow' : (255, 255, 224), * 'lightyellow1' : (255, 255, 224), # <<<<<<<<<<<<<< * 'lightyellow2' : (238, 238, 209), * 'lightyellow3' : (205, 205, 180), */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_lightyellow1, __pyx_tuple__458) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "include/color_dict.pxi":452 * 'lightyellow' : (255, 255, 224), * 'lightyellow1' : (255, 255, 224), * 'lightyellow2' : (238, 238, 209), # <<<<<<<<<<<<<< * 'lightyellow3' : (205, 205, 180), * 'lightyellow4' : (139, 139, 122), */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_lightyellow2, __pyx_tuple__459) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "include/color_dict.pxi":453 * 'lightyellow1' : (255, 255, 224), * 'lightyellow2' : (238, 238, 209), * 'lightyellow3' : (205, 205, 180), # <<<<<<<<<<<<<< * 'lightyellow4' : (139, 139, 122), * 'lime' : (0, 255, 0), */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_lightyellow3, __pyx_tuple__460) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "include/color_dict.pxi":454 * 'lightyellow2' : (238, 238, 209), * 'lightyellow3' : (205, 205, 180), * 'lightyellow4' : (139, 139, 122), # <<<<<<<<<<<<<< * 'lime' : (0, 255, 0), * 'limegreen' : (50, 205, 50), */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_lightyellow4, __pyx_tuple__461) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "include/color_dict.pxi":455 * 'lightyellow3' : (205, 205, 180), * 'lightyellow4' : (139, 139, 122), * 'lime' : (0, 255, 0), # <<<<<<<<<<<<<< * 'limegreen' : (50, 205, 50), * 'linen' : (250, 240, 230), */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_lime, __pyx_tuple__462) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "include/color_dict.pxi":456 * 'lightyellow4' : (139, 139, 122), * 'lime' : (0, 255, 0), * 'limegreen' : (50, 205, 50), # <<<<<<<<<<<<<< * 'linen' : (250, 240, 230), * 'magenta' : (255, 0, 255), */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_limegreen, __pyx_tuple__463) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "include/color_dict.pxi":457 * 'lime' : (0, 255, 0), * 'limegreen' : (50, 205, 50), * 'linen' : (250, 240, 230), # <<<<<<<<<<<<<< * 'magenta' : (255, 0, 255), * 'magenta1' : (255, 0, 255), */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_linen, __pyx_tuple__464) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "include/color_dict.pxi":458 * 'limegreen' : (50, 205, 50), * 'linen' : (250, 240, 230), * 'magenta' : (255, 0, 255), # <<<<<<<<<<<<<< * 'magenta1' : (255, 0, 255), * 'magenta2' : (238, 0, 238), */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_magenta, __pyx_tuple__465) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "include/color_dict.pxi":459 * 'linen' : (250, 240, 230), * 'magenta' : (255, 0, 255), * 'magenta1' : (255, 0, 255), # <<<<<<<<<<<<<< * 'magenta2' : (238, 0, 238), * 'magenta3' : (205, 0, 205), */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_magenta1, __pyx_tuple__466) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "include/color_dict.pxi":460 * 'magenta' : (255, 0, 255), * 'magenta1' : (255, 0, 255), * 'magenta2' : (238, 0, 238), # <<<<<<<<<<<<<< * 'magenta3' : (205, 0, 205), * 'magenta4' : (139, 0, 139), */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_magenta2, __pyx_tuple__467) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "include/color_dict.pxi":461 * 'magenta1' : (255, 0, 255), * 'magenta2' : (238, 0, 238), * 'magenta3' : (205, 0, 205), # <<<<<<<<<<<<<< * 'magenta4' : (139, 0, 139), * 'maroon' : (176, 48, 96), */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_magenta3, __pyx_tuple__468) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "include/color_dict.pxi":462 * 'magenta2' : (238, 0, 238), * 'magenta3' : (205, 0, 205), * 'magenta4' : (139, 0, 139), # <<<<<<<<<<<<<< * 'maroon' : (176, 48, 96), * 'maroon1' : (255, 52, 179), */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_magenta4, __pyx_tuple__469) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "include/color_dict.pxi":463 * 'magenta3' : (205, 0, 205), * 'magenta4' : (139, 0, 139), * 'maroon' : (176, 48, 96), # <<<<<<<<<<<<<< * 'maroon1' : (255, 52, 179), * 'maroon2' : (238, 48, 167), */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_maroon, __pyx_tuple__470) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "include/color_dict.pxi":464 * 'magenta4' : (139, 0, 139), * 'maroon' : (176, 48, 96), * 'maroon1' : (255, 52, 179), # <<<<<<<<<<<<<< * 'maroon2' : (238, 48, 167), * 'maroon3' : (205, 41, 144), */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_maroon1, __pyx_tuple__471) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "include/color_dict.pxi":465 * 'maroon' : (176, 48, 96), * 'maroon1' : (255, 52, 179), * 'maroon2' : (238, 48, 167), # <<<<<<<<<<<<<< * 'maroon3' : (205, 41, 144), * 'maroon4' : (139, 28, 98), */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_maroon2, __pyx_tuple__472) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "include/color_dict.pxi":466 * 'maroon1' : (255, 52, 179), * 'maroon2' : (238, 48, 167), * 'maroon3' : (205, 41, 144), # <<<<<<<<<<<<<< * 'maroon4' : (139, 28, 98), * 'mediumaquamarine' : (102, 205, 170), */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_maroon3, __pyx_tuple__473) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "include/color_dict.pxi":467 * 'maroon2' : (238, 48, 167), * 'maroon3' : (205, 41, 144), * 'maroon4' : (139, 28, 98), # <<<<<<<<<<<<<< * 'mediumaquamarine' : (102, 205, 170), * 'mediumblue' : (0, 0, 205), */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_maroon4, __pyx_tuple__474) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "include/color_dict.pxi":468 * 'maroon3' : (205, 41, 144), * 'maroon4' : (139, 28, 98), * 'mediumaquamarine' : (102, 205, 170), # <<<<<<<<<<<<<< * 'mediumblue' : (0, 0, 205), * 'mediumorchid' : (186, 85, 211), */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_mediumaquamarine, __pyx_tuple__475) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "include/color_dict.pxi":469 * 'maroon4' : (139, 28, 98), * 'mediumaquamarine' : (102, 205, 170), * 'mediumblue' : (0, 0, 205), # <<<<<<<<<<<<<< * 'mediumorchid' : (186, 85, 211), * 'mediumorchid1' : (224, 102, 255), */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_mediumblue, __pyx_tuple__476) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "include/color_dict.pxi":470 * 'mediumaquamarine' : (102, 205, 170), * 'mediumblue' : (0, 0, 205), * 'mediumorchid' : (186, 85, 211), # <<<<<<<<<<<<<< * 'mediumorchid1' : (224, 102, 255), * 'mediumorchid2' : (209, 95, 238), */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_mediumorchid, __pyx_tuple__477) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "include/color_dict.pxi":471 * 'mediumblue' : (0, 0, 205), * 'mediumorchid' : (186, 85, 211), * 'mediumorchid1' : (224, 102, 255), # <<<<<<<<<<<<<< * 'mediumorchid2' : (209, 95, 238), * 'mediumorchid3' : (180, 82, 205), */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_mediumorchid1, __pyx_tuple__478) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "include/color_dict.pxi":472 * 'mediumorchid' : (186, 85, 211), * 'mediumorchid1' : (224, 102, 255), * 'mediumorchid2' : (209, 95, 238), # <<<<<<<<<<<<<< * 'mediumorchid3' : (180, 82, 205), * 'mediumorchid4' : (122, 55, 139), */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_mediumorchid2, __pyx_tuple__479) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "include/color_dict.pxi":473 * 'mediumorchid1' : (224, 102, 255), * 'mediumorchid2' : (209, 95, 238), * 'mediumorchid3' : (180, 82, 205), # <<<<<<<<<<<<<< * 'mediumorchid4' : (122, 55, 139), * 'mediumpurple' : (147, 112, 219), */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_mediumorchid3, __pyx_tuple__480) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "include/color_dict.pxi":474 * 'mediumorchid2' : (209, 95, 238), * 'mediumorchid3' : (180, 82, 205), * 'mediumorchid4' : (122, 55, 139), # <<<<<<<<<<<<<< * 'mediumpurple' : (147, 112, 219), * 'mediumpurple1' : (171, 130, 255), */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_mediumorchid4, __pyx_tuple__481) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "include/color_dict.pxi":475 * 'mediumorchid3' : (180, 82, 205), * 'mediumorchid4' : (122, 55, 139), * 'mediumpurple' : (147, 112, 219), # <<<<<<<<<<<<<< * 'mediumpurple1' : (171, 130, 255), * 'mediumpurple2' : (159, 121, 238), */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_mediumpurple, __pyx_tuple__482) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "include/color_dict.pxi":476 * 'mediumorchid4' : (122, 55, 139), * 'mediumpurple' : (147, 112, 219), * 'mediumpurple1' : (171, 130, 255), # <<<<<<<<<<<<<< * 'mediumpurple2' : (159, 121, 238), * 'mediumpurple3' : (137, 104, 205), */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_mediumpurple1, __pyx_tuple__483) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "include/color_dict.pxi":477 * 'mediumpurple' : (147, 112, 219), * 'mediumpurple1' : (171, 130, 255), * 'mediumpurple2' : (159, 121, 238), # <<<<<<<<<<<<<< * 'mediumpurple3' : (137, 104, 205), * 'mediumpurple4' : (93, 71, 139), */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_mediumpurple2, __pyx_tuple__484) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "include/color_dict.pxi":478 * 'mediumpurple1' : (171, 130, 255), * 'mediumpurple2' : (159, 121, 238), * 'mediumpurple3' : (137, 104, 205), # <<<<<<<<<<<<<< * 'mediumpurple4' : (93, 71, 139), * 'mediumseagreen' : (60, 179, 113), */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_mediumpurple3, __pyx_tuple__485) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "include/color_dict.pxi":479 * 'mediumpurple2' : (159, 121, 238), * 'mediumpurple3' : (137, 104, 205), * 'mediumpurple4' : (93, 71, 139), # <<<<<<<<<<<<<< * 'mediumseagreen' : (60, 179, 113), * 'mediumslateblue' : (123, 104, 238), */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_mediumpurple4, __pyx_tuple__486) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "include/color_dict.pxi":480 * 'mediumpurple3' : (137, 104, 205), * 'mediumpurple4' : (93, 71, 139), * 'mediumseagreen' : (60, 179, 113), # <<<<<<<<<<<<<< * 'mediumslateblue' : (123, 104, 238), * 'mediumspringgreen' : (0, 250, 154), */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_mediumseagreen, __pyx_tuple__487) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "include/color_dict.pxi":481 * 'mediumpurple4' : (93, 71, 139), * 'mediumseagreen' : (60, 179, 113), * 'mediumslateblue' : (123, 104, 238), # <<<<<<<<<<<<<< * 'mediumspringgreen' : (0, 250, 154), * 'mediumturquoise' : (72, 209, 204), */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_mediumslateblue, __pyx_tuple__488) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "include/color_dict.pxi":482 * 'mediumseagreen' : (60, 179, 113), * 'mediumslateblue' : (123, 104, 238), * 'mediumspringgreen' : (0, 250, 154), # <<<<<<<<<<<<<< * 'mediumturquoise' : (72, 209, 204), * 'mediumvioletred' : (199, 21, 133), */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_mediumspringgreen, __pyx_tuple__489) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "include/color_dict.pxi":483 * 'mediumslateblue' : (123, 104, 238), * 'mediumspringgreen' : (0, 250, 154), * 'mediumturquoise' : (72, 209, 204), # <<<<<<<<<<<<<< * 'mediumvioletred' : (199, 21, 133), * 'midnightblue' : (25, 25, 112), */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_mediumturquoise, __pyx_tuple__490) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "include/color_dict.pxi":484 * 'mediumspringgreen' : (0, 250, 154), * 'mediumturquoise' : (72, 209, 204), * 'mediumvioletred' : (199, 21, 133), # <<<<<<<<<<<<<< * 'midnightblue' : (25, 25, 112), * 'mintcream' : (245, 255, 250), */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_mediumvioletred, __pyx_tuple__491) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "include/color_dict.pxi":485 * 'mediumturquoise' : (72, 209, 204), * 'mediumvioletred' : (199, 21, 133), * 'midnightblue' : (25, 25, 112), # <<<<<<<<<<<<<< * 'mintcream' : (245, 255, 250), * 'mistyrose' : (255, 228, 225), */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_midnightblue, __pyx_tuple__492) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "include/color_dict.pxi":486 * 'mediumvioletred' : (199, 21, 133), * 'midnightblue' : (25, 25, 112), * 'mintcream' : (245, 255, 250), # <<<<<<<<<<<<<< * 'mistyrose' : (255, 228, 225), * 'mistyrose1' : (255, 228, 225), */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_mintcream, __pyx_tuple__493) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "include/color_dict.pxi":487 * 'midnightblue' : (25, 25, 112), * 'mintcream' : (245, 255, 250), * 'mistyrose' : (255, 228, 225), # <<<<<<<<<<<<<< * 'mistyrose1' : (255, 228, 225), * 'mistyrose2' : (238, 213, 210), */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_mistyrose, __pyx_tuple__494) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "include/color_dict.pxi":488 * 'mintcream' : (245, 255, 250), * 'mistyrose' : (255, 228, 225), * 'mistyrose1' : (255, 228, 225), # <<<<<<<<<<<<<< * 'mistyrose2' : (238, 213, 210), * 'mistyrose3' : (205, 183, 181), */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_mistyrose1, __pyx_tuple__495) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "include/color_dict.pxi":489 * 'mistyrose' : (255, 228, 225), * 'mistyrose1' : (255, 228, 225), * 'mistyrose2' : (238, 213, 210), # <<<<<<<<<<<<<< * 'mistyrose3' : (205, 183, 181), * 'mistyrose4' : (139, 125, 123), */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_mistyrose2, __pyx_tuple__496) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "include/color_dict.pxi":490 * 'mistyrose1' : (255, 228, 225), * 'mistyrose2' : (238, 213, 210), * 'mistyrose3' : (205, 183, 181), # <<<<<<<<<<<<<< * 'mistyrose4' : (139, 125, 123), * 'moccasin' : (255, 228, 181), */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_mistyrose3, __pyx_tuple__497) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "include/color_dict.pxi":491 * 'mistyrose2' : (238, 213, 210), * 'mistyrose3' : (205, 183, 181), * 'mistyrose4' : (139, 125, 123), # <<<<<<<<<<<<<< * 'moccasin' : (255, 228, 181), * 'navajowhite' : (255, 222, 173), */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_mistyrose4, __pyx_tuple__498) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "include/color_dict.pxi":492 * 'mistyrose3' : (205, 183, 181), * 'mistyrose4' : (139, 125, 123), * 'moccasin' : (255, 228, 181), # <<<<<<<<<<<<<< * 'navajowhite' : (255, 222, 173), * 'navajowhite1' : (255, 222, 173), */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_moccasin, __pyx_tuple__499) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "include/color_dict.pxi":493 * 'mistyrose4' : (139, 125, 123), * 'moccasin' : (255, 228, 181), * 'navajowhite' : (255, 222, 173), # <<<<<<<<<<<<<< * 'navajowhite1' : (255, 222, 173), * 'navajowhite2' : (238, 207, 161), */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_navajowhite, __pyx_tuple__500) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "include/color_dict.pxi":494 * 'moccasin' : (255, 228, 181), * 'navajowhite' : (255, 222, 173), * 'navajowhite1' : (255, 222, 173), # <<<<<<<<<<<<<< * 'navajowhite2' : (238, 207, 161), * 'navajowhite3' : (205, 179, 139), */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_navajowhite1, __pyx_tuple__501) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "include/color_dict.pxi":495 * 'navajowhite' : (255, 222, 173), * 'navajowhite1' : (255, 222, 173), * 'navajowhite2' : (238, 207, 161), # <<<<<<<<<<<<<< * 'navajowhite3' : (205, 179, 139), * 'navajowhite4' : (139, 121, 94), */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_navajowhite2, __pyx_tuple__502) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "include/color_dict.pxi":496 * 'navajowhite1' : (255, 222, 173), * 'navajowhite2' : (238, 207, 161), * 'navajowhite3' : (205, 179, 139), # <<<<<<<<<<<<<< * 'navajowhite4' : (139, 121, 94), * 'navy' : (0, 0, 128), */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_navajowhite3, __pyx_tuple__503) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "include/color_dict.pxi":497 * 'navajowhite2' : (238, 207, 161), * 'navajowhite3' : (205, 179, 139), * 'navajowhite4' : (139, 121, 94), # <<<<<<<<<<<<<< * 'navy' : (0, 0, 128), * 'navyblue' : (0, 0, 128), */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_navajowhite4, __pyx_tuple__504) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "include/color_dict.pxi":498 * 'navajowhite3' : (205, 179, 139), * 'navajowhite4' : (139, 121, 94), * 'navy' : (0, 0, 128), # <<<<<<<<<<<<<< * 'navyblue' : (0, 0, 128), * 'oldlace' : (253, 245, 230), */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_navy, __pyx_tuple__505) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "include/color_dict.pxi":499 * 'navajowhite4' : (139, 121, 94), * 'navy' : (0, 0, 128), * 'navyblue' : (0, 0, 128), # <<<<<<<<<<<<<< * 'oldlace' : (253, 245, 230), * 'olive' : (128, 128, 0), */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_navyblue, __pyx_tuple__506) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "include/color_dict.pxi":500 * 'navy' : (0, 0, 128), * 'navyblue' : (0, 0, 128), * 'oldlace' : (253, 245, 230), # <<<<<<<<<<<<<< * 'olive' : (128, 128, 0), * 'olivedrab' : (107, 142, 35), */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_oldlace, __pyx_tuple__507) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "include/color_dict.pxi":501 * 'navyblue' : (0, 0, 128), * 'oldlace' : (253, 245, 230), * 'olive' : (128, 128, 0), # <<<<<<<<<<<<<< * 'olivedrab' : (107, 142, 35), * 'olivedrab1' : (192, 255, 62), */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_olive, __pyx_tuple__508) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "include/color_dict.pxi":502 * 'oldlace' : (253, 245, 230), * 'olive' : (128, 128, 0), * 'olivedrab' : (107, 142, 35), # <<<<<<<<<<<<<< * 'olivedrab1' : (192, 255, 62), * 'olivedrab2' : (179, 238, 58), */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_olivedrab, __pyx_tuple__509) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "include/color_dict.pxi":503 * 'olive' : (128, 128, 0), * 'olivedrab' : (107, 142, 35), * 'olivedrab1' : (192, 255, 62), # <<<<<<<<<<<<<< * 'olivedrab2' : (179, 238, 58), * 'olivedrab3' : (154, 205, 50), */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_olivedrab1, __pyx_tuple__510) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "include/color_dict.pxi":504 * 'olivedrab' : (107, 142, 35), * 'olivedrab1' : (192, 255, 62), * 'olivedrab2' : (179, 238, 58), # <<<<<<<<<<<<<< * 'olivedrab3' : (154, 205, 50), * 'olivedrab4' : (105, 139, 34), */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_olivedrab2, __pyx_tuple__511) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "include/color_dict.pxi":505 * 'olivedrab1' : (192, 255, 62), * 'olivedrab2' : (179, 238, 58), * 'olivedrab3' : (154, 205, 50), # <<<<<<<<<<<<<< * 'olivedrab4' : (105, 139, 34), * 'orange' : (255, 165, 0), */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_olivedrab3, __pyx_tuple__512) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "include/color_dict.pxi":506 * 'olivedrab2' : (179, 238, 58), * 'olivedrab3' : (154, 205, 50), * 'olivedrab4' : (105, 139, 34), # <<<<<<<<<<<<<< * 'orange' : (255, 165, 0), * 'orange1' : (255, 165, 0), */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_olivedrab4, __pyx_tuple__513) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "include/color_dict.pxi":507 * 'olivedrab3' : (154, 205, 50), * 'olivedrab4' : (105, 139, 34), * 'orange' : (255, 165, 0), # <<<<<<<<<<<<<< * 'orange1' : (255, 165, 0), * 'orange2' : (238, 154, 0), */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_orange, __pyx_tuple__514) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "include/color_dict.pxi":508 * 'olivedrab4' : (105, 139, 34), * 'orange' : (255, 165, 0), * 'orange1' : (255, 165, 0), # <<<<<<<<<<<<<< * 'orange2' : (238, 154, 0), * 'orange3' : (205, 133, 0), */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_orange1, __pyx_tuple__515) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "include/color_dict.pxi":509 * 'orange' : (255, 165, 0), * 'orange1' : (255, 165, 0), * 'orange2' : (238, 154, 0), # <<<<<<<<<<<<<< * 'orange3' : (205, 133, 0), * 'orange4' : (139, 90, 0), */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_orange2, __pyx_tuple__516) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "include/color_dict.pxi":510 * 'orange1' : (255, 165, 0), * 'orange2' : (238, 154, 0), * 'orange3' : (205, 133, 0), # <<<<<<<<<<<<<< * 'orange4' : (139, 90, 0), * 'orangered' : (255, 69, 0), */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_orange3, __pyx_tuple__517) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "include/color_dict.pxi":511 * 'orange2' : (238, 154, 0), * 'orange3' : (205, 133, 0), * 'orange4' : (139, 90, 0), # <<<<<<<<<<<<<< * 'orangered' : (255, 69, 0), * 'orangered1' : (255, 69, 0), */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_orange4, __pyx_tuple__518) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "include/color_dict.pxi":512 * 'orange3' : (205, 133, 0), * 'orange4' : (139, 90, 0), * 'orangered' : (255, 69, 0), # <<<<<<<<<<<<<< * 'orangered1' : (255, 69, 0), * 'orangered2' : (238, 64, 0), */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_orangered, __pyx_tuple__519) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "include/color_dict.pxi":513 * 'orange4' : (139, 90, 0), * 'orangered' : (255, 69, 0), * 'orangered1' : (255, 69, 0), # <<<<<<<<<<<<<< * 'orangered2' : (238, 64, 0), * 'orangered3' : (205, 55, 0), */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_orangered1, __pyx_tuple__520) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "include/color_dict.pxi":514 * 'orangered' : (255, 69, 0), * 'orangered1' : (255, 69, 0), * 'orangered2' : (238, 64, 0), # <<<<<<<<<<<<<< * 'orangered3' : (205, 55, 0), * 'orangered4' : (139, 37, 0), */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_orangered2, __pyx_tuple__521) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "include/color_dict.pxi":515 * 'orangered1' : (255, 69, 0), * 'orangered2' : (238, 64, 0), * 'orangered3' : (205, 55, 0), # <<<<<<<<<<<<<< * 'orangered4' : (139, 37, 0), * 'orchid' : (218, 112, 214), */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_orangered3, __pyx_tuple__522) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "include/color_dict.pxi":516 * 'orangered2' : (238, 64, 0), * 'orangered3' : (205, 55, 0), * 'orangered4' : (139, 37, 0), # <<<<<<<<<<<<<< * 'orchid' : (218, 112, 214), * 'orchid1' : (255, 131, 250), */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_orangered4, __pyx_tuple__523) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "include/color_dict.pxi":517 * 'orangered3' : (205, 55, 0), * 'orangered4' : (139, 37, 0), * 'orchid' : (218, 112, 214), # <<<<<<<<<<<<<< * 'orchid1' : (255, 131, 250), * 'orchid2' : (238, 122, 233), */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_orchid, __pyx_tuple__524) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "include/color_dict.pxi":518 * 'orangered4' : (139, 37, 0), * 'orchid' : (218, 112, 214), * 'orchid1' : (255, 131, 250), # <<<<<<<<<<<<<< * 'orchid2' : (238, 122, 233), * 'orchid3' : (205, 105, 201), */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_orchid1, __pyx_tuple__525) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "include/color_dict.pxi":519 * 'orchid' : (218, 112, 214), * 'orchid1' : (255, 131, 250), * 'orchid2' : (238, 122, 233), # <<<<<<<<<<<<<< * 'orchid3' : (205, 105, 201), * 'orchid4' : (139, 71, 137), */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_orchid2, __pyx_tuple__526) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "include/color_dict.pxi":520 * 'orchid1' : (255, 131, 250), * 'orchid2' : (238, 122, 233), * 'orchid3' : (205, 105, 201), # <<<<<<<<<<<<<< * 'orchid4' : (139, 71, 137), * 'palegoldenrod' : (238, 232, 170), */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_orchid3, __pyx_tuple__527) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "include/color_dict.pxi":521 * 'orchid2' : (238, 122, 233), * 'orchid3' : (205, 105, 201), * 'orchid4' : (139, 71, 137), # <<<<<<<<<<<<<< * 'palegoldenrod' : (238, 232, 170), * 'palegreen' : (152, 251, 152), */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_orchid4, __pyx_tuple__528) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "include/color_dict.pxi":522 * 'orchid3' : (205, 105, 201), * 'orchid4' : (139, 71, 137), * 'palegoldenrod' : (238, 232, 170), # <<<<<<<<<<<<<< * 'palegreen' : (152, 251, 152), * 'palegreen1' : (154, 255, 154), */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_palegoldenrod, __pyx_tuple__529) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "include/color_dict.pxi":523 * 'orchid4' : (139, 71, 137), * 'palegoldenrod' : (238, 232, 170), * 'palegreen' : (152, 251, 152), # <<<<<<<<<<<<<< * 'palegreen1' : (154, 255, 154), * 'palegreen2' : (144, 238, 144), */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_palegreen, __pyx_tuple__530) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "include/color_dict.pxi":524 * 'palegoldenrod' : (238, 232, 170), * 'palegreen' : (152, 251, 152), * 'palegreen1' : (154, 255, 154), # <<<<<<<<<<<<<< * 'palegreen2' : (144, 238, 144), * 'palegreen3' : (124, 205, 124), */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_palegreen1, __pyx_tuple__531) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "include/color_dict.pxi":525 * 'palegreen' : (152, 251, 152), * 'palegreen1' : (154, 255, 154), * 'palegreen2' : (144, 238, 144), # <<<<<<<<<<<<<< * 'palegreen3' : (124, 205, 124), * 'palegreen4' : (84, 139, 84), */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_palegreen2, __pyx_tuple__532) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "include/color_dict.pxi":526 * 'palegreen1' : (154, 255, 154), * 'palegreen2' : (144, 238, 144), * 'palegreen3' : (124, 205, 124), # <<<<<<<<<<<<<< * 'palegreen4' : (84, 139, 84), * 'paleturquoise' : (175, 238, 238), */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_palegreen3, __pyx_tuple__533) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "include/color_dict.pxi":527 * 'palegreen2' : (144, 238, 144), * 'palegreen3' : (124, 205, 124), * 'palegreen4' : (84, 139, 84), # <<<<<<<<<<<<<< * 'paleturquoise' : (175, 238, 238), * 'paleturquoise1' : (187, 255, 255), */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_palegreen4, __pyx_tuple__534) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "include/color_dict.pxi":528 * 'palegreen3' : (124, 205, 124), * 'palegreen4' : (84, 139, 84), * 'paleturquoise' : (175, 238, 238), # <<<<<<<<<<<<<< * 'paleturquoise1' : (187, 255, 255), * 'paleturquoise2' : (174, 238, 238), */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_paleturquoise, __pyx_tuple__535) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "include/color_dict.pxi":529 * 'palegreen4' : (84, 139, 84), * 'paleturquoise' : (175, 238, 238), * 'paleturquoise1' : (187, 255, 255), # <<<<<<<<<<<<<< * 'paleturquoise2' : (174, 238, 238), * 'paleturquoise3' : (150, 205, 205), */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_paleturquoise1, __pyx_tuple__536) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "include/color_dict.pxi":530 * 'paleturquoise' : (175, 238, 238), * 'paleturquoise1' : (187, 255, 255), * 'paleturquoise2' : (174, 238, 238), # <<<<<<<<<<<<<< * 'paleturquoise3' : (150, 205, 205), * 'paleturquoise4' : (102, 139, 139), */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_paleturquoise2, __pyx_tuple__537) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "include/color_dict.pxi":531 * 'paleturquoise1' : (187, 255, 255), * 'paleturquoise2' : (174, 238, 238), * 'paleturquoise3' : (150, 205, 205), # <<<<<<<<<<<<<< * 'paleturquoise4' : (102, 139, 139), * 'palevioletred' : (219, 112, 147), */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_paleturquoise3, __pyx_tuple__538) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "include/color_dict.pxi":532 * 'paleturquoise2' : (174, 238, 238), * 'paleturquoise3' : (150, 205, 205), * 'paleturquoise4' : (102, 139, 139), # <<<<<<<<<<<<<< * 'palevioletred' : (219, 112, 147), * 'palevioletred1' : (255, 130, 171), */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_paleturquoise4, __pyx_tuple__539) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "include/color_dict.pxi":533 * 'paleturquoise3' : (150, 205, 205), * 'paleturquoise4' : (102, 139, 139), * 'palevioletred' : (219, 112, 147), # <<<<<<<<<<<<<< * 'palevioletred1' : (255, 130, 171), * 'palevioletred2' : (238, 121, 159), */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_palevioletred, __pyx_tuple__540) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "include/color_dict.pxi":534 * 'paleturquoise4' : (102, 139, 139), * 'palevioletred' : (219, 112, 147), * 'palevioletred1' : (255, 130, 171), # <<<<<<<<<<<<<< * 'palevioletred2' : (238, 121, 159), * 'palevioletred3' : (205, 104, 137), */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_palevioletred1, __pyx_tuple__541) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "include/color_dict.pxi":535 * 'palevioletred' : (219, 112, 147), * 'palevioletred1' : (255, 130, 171), * 'palevioletred2' : (238, 121, 159), # <<<<<<<<<<<<<< * 'palevioletred3' : (205, 104, 137), * 'palevioletred4' : (139, 71, 93), */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_palevioletred2, __pyx_tuple__542) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "include/color_dict.pxi":536 * 'palevioletred1' : (255, 130, 171), * 'palevioletred2' : (238, 121, 159), * 'palevioletred3' : (205, 104, 137), # <<<<<<<<<<<<<< * 'palevioletred4' : (139, 71, 93), * 'papayawhip' : (255, 239, 213), */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_palevioletred3, __pyx_tuple__543) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "include/color_dict.pxi":537 * 'palevioletred2' : (238, 121, 159), * 'palevioletred3' : (205, 104, 137), * 'palevioletred4' : (139, 71, 93), # <<<<<<<<<<<<<< * 'papayawhip' : (255, 239, 213), * 'peachpuff' : (255, 218, 185), */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_palevioletred4, __pyx_tuple__544) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "include/color_dict.pxi":538 * 'palevioletred3' : (205, 104, 137), * 'palevioletred4' : (139, 71, 93), * 'papayawhip' : (255, 239, 213), # <<<<<<<<<<<<<< * 'peachpuff' : (255, 218, 185), * 'peachpuff1' : (255, 218, 185), */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_papayawhip, __pyx_tuple__545) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "include/color_dict.pxi":539 * 'palevioletred4' : (139, 71, 93), * 'papayawhip' : (255, 239, 213), * 'peachpuff' : (255, 218, 185), # <<<<<<<<<<<<<< * 'peachpuff1' : (255, 218, 185), * 'peachpuff2' : (238, 203, 173), */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_peachpuff, __pyx_tuple__546) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "include/color_dict.pxi":540 * 'papayawhip' : (255, 239, 213), * 'peachpuff' : (255, 218, 185), * 'peachpuff1' : (255, 218, 185), # <<<<<<<<<<<<<< * 'peachpuff2' : (238, 203, 173), * 'peachpuff3' : (205, 175, 149), */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_peachpuff1, __pyx_tuple__547) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "include/color_dict.pxi":541 * 'peachpuff' : (255, 218, 185), * 'peachpuff1' : (255, 218, 185), * 'peachpuff2' : (238, 203, 173), # <<<<<<<<<<<<<< * 'peachpuff3' : (205, 175, 149), * 'peachpuff4' : (139, 119, 101), */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_peachpuff2, __pyx_tuple__548) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "include/color_dict.pxi":542 * 'peachpuff1' : (255, 218, 185), * 'peachpuff2' : (238, 203, 173), * 'peachpuff3' : (205, 175, 149), # <<<<<<<<<<<<<< * 'peachpuff4' : (139, 119, 101), * 'peru' : (205, 133, 63), */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_peachpuff3, __pyx_tuple__549) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "include/color_dict.pxi":543 * 'peachpuff2' : (238, 203, 173), * 'peachpuff3' : (205, 175, 149), * 'peachpuff4' : (139, 119, 101), # <<<<<<<<<<<<<< * 'peru' : (205, 133, 63), * 'pink' : (255, 192, 203), */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_peachpuff4, __pyx_tuple__550) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "include/color_dict.pxi":544 * 'peachpuff3' : (205, 175, 149), * 'peachpuff4' : (139, 119, 101), * 'peru' : (205, 133, 63), # <<<<<<<<<<<<<< * 'pink' : (255, 192, 203), * 'pink1' : (255, 181, 197), */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_peru, __pyx_tuple__551) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "include/color_dict.pxi":545 * 'peachpuff4' : (139, 119, 101), * 'peru' : (205, 133, 63), * 'pink' : (255, 192, 203), # <<<<<<<<<<<<<< * 'pink1' : (255, 181, 197), * 'pink2' : (238, 169, 184), */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_pink, __pyx_tuple__552) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "include/color_dict.pxi":546 * 'peru' : (205, 133, 63), * 'pink' : (255, 192, 203), * 'pink1' : (255, 181, 197), # <<<<<<<<<<<<<< * 'pink2' : (238, 169, 184), * 'pink3' : (205, 145, 158), */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_pink1, __pyx_tuple__553) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "include/color_dict.pxi":547 * 'pink' : (255, 192, 203), * 'pink1' : (255, 181, 197), * 'pink2' : (238, 169, 184), # <<<<<<<<<<<<<< * 'pink3' : (205, 145, 158), * 'pink4' : (139, 99, 108), */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_pink2, __pyx_tuple__554) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "include/color_dict.pxi":548 * 'pink1' : (255, 181, 197), * 'pink2' : (238, 169, 184), * 'pink3' : (205, 145, 158), # <<<<<<<<<<<<<< * 'pink4' : (139, 99, 108), * 'plum' : (221, 160, 221), */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_pink3, __pyx_tuple__555) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "include/color_dict.pxi":549 * 'pink2' : (238, 169, 184), * 'pink3' : (205, 145, 158), * 'pink4' : (139, 99, 108), # <<<<<<<<<<<<<< * 'plum' : (221, 160, 221), * 'plum1' : (255, 187, 255), */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_pink4, __pyx_tuple__556) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "include/color_dict.pxi":550 * 'pink3' : (205, 145, 158), * 'pink4' : (139, 99, 108), * 'plum' : (221, 160, 221), # <<<<<<<<<<<<<< * 'plum1' : (255, 187, 255), * 'plum2' : (238, 174, 238), */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_plum, __pyx_tuple__557) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "include/color_dict.pxi":551 * 'pink4' : (139, 99, 108), * 'plum' : (221, 160, 221), * 'plum1' : (255, 187, 255), # <<<<<<<<<<<<<< * 'plum2' : (238, 174, 238), * 'plum3' : (205, 150, 205), */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_plum1, __pyx_tuple__558) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "include/color_dict.pxi":552 * 'plum' : (221, 160, 221), * 'plum1' : (255, 187, 255), * 'plum2' : (238, 174, 238), # <<<<<<<<<<<<<< * 'plum3' : (205, 150, 205), * 'plum4' : (139, 102, 139), */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_plum2, __pyx_tuple__559) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "include/color_dict.pxi":553 * 'plum1' : (255, 187, 255), * 'plum2' : (238, 174, 238), * 'plum3' : (205, 150, 205), # <<<<<<<<<<<<<< * 'plum4' : (139, 102, 139), * 'powderblue' : (176, 224, 230), */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_plum3, __pyx_tuple__560) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "include/color_dict.pxi":554 * 'plum2' : (238, 174, 238), * 'plum3' : (205, 150, 205), * 'plum4' : (139, 102, 139), # <<<<<<<<<<<<<< * 'powderblue' : (176, 224, 230), * 'purple' : (160, 32, 240), */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_plum4, __pyx_tuple__561) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "include/color_dict.pxi":555 * 'plum3' : (205, 150, 205), * 'plum4' : (139, 102, 139), * 'powderblue' : (176, 224, 230), # <<<<<<<<<<<<<< * 'purple' : (160, 32, 240), * 'purple1' : (155, 48, 255), */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_powderblue, __pyx_tuple__562) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "include/color_dict.pxi":556 * 'plum4' : (139, 102, 139), * 'powderblue' : (176, 224, 230), * 'purple' : (160, 32, 240), # <<<<<<<<<<<<<< * 'purple1' : (155, 48, 255), * 'purple2' : (145, 44, 238), */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_purple, __pyx_tuple__563) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "include/color_dict.pxi":557 * 'powderblue' : (176, 224, 230), * 'purple' : (160, 32, 240), * 'purple1' : (155, 48, 255), # <<<<<<<<<<<<<< * 'purple2' : (145, 44, 238), * 'purple3' : (125, 38, 205), */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_purple1, __pyx_tuple__564) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "include/color_dict.pxi":558 * 'purple' : (160, 32, 240), * 'purple1' : (155, 48, 255), * 'purple2' : (145, 44, 238), # <<<<<<<<<<<<<< * 'purple3' : (125, 38, 205), * 'purple4' : (85, 26, 139), */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_purple2, __pyx_tuple__565) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "include/color_dict.pxi":559 * 'purple1' : (155, 48, 255), * 'purple2' : (145, 44, 238), * 'purple3' : (125, 38, 205), # <<<<<<<<<<<<<< * 'purple4' : (85, 26, 139), * 'rebeccapurple' : (102, 51, 153), */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_purple3, __pyx_tuple__566) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "include/color_dict.pxi":560 * 'purple2' : (145, 44, 238), * 'purple3' : (125, 38, 205), * 'purple4' : (85, 26, 139), # <<<<<<<<<<<<<< * 'rebeccapurple' : (102, 51, 153), * 'red' : (255, 0, 0), */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_purple4, __pyx_tuple__567) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "include/color_dict.pxi":561 * 'purple3' : (125, 38, 205), * 'purple4' : (85, 26, 139), * 'rebeccapurple' : (102, 51, 153), # <<<<<<<<<<<<<< * 'red' : (255, 0, 0), * 'red1' : (255, 0, 0), */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_rebeccapurple, __pyx_tuple__568) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "include/color_dict.pxi":562 * 'purple4' : (85, 26, 139), * 'rebeccapurple' : (102, 51, 153), * 'red' : (255, 0, 0), # <<<<<<<<<<<<<< * 'red1' : (255, 0, 0), * 'red2' : (238, 0, 0), */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_red, __pyx_tuple__569) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "include/color_dict.pxi":563 * 'rebeccapurple' : (102, 51, 153), * 'red' : (255, 0, 0), * 'red1' : (255, 0, 0), # <<<<<<<<<<<<<< * 'red2' : (238, 0, 0), * 'red3' : (205, 0, 0), */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_red1, __pyx_tuple__570) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "include/color_dict.pxi":564 * 'red' : (255, 0, 0), * 'red1' : (255, 0, 0), * 'red2' : (238, 0, 0), # <<<<<<<<<<<<<< * 'red3' : (205, 0, 0), * 'red4' : (139, 0, 0), */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_red2, __pyx_tuple__571) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "include/color_dict.pxi":565 * 'red1' : (255, 0, 0), * 'red2' : (238, 0, 0), * 'red3' : (205, 0, 0), # <<<<<<<<<<<<<< * 'red4' : (139, 0, 0), * 'rosybrown' : (188, 143, 143), */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_red3, __pyx_tuple__572) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "include/color_dict.pxi":566 * 'red2' : (238, 0, 0), * 'red3' : (205, 0, 0), * 'red4' : (139, 0, 0), # <<<<<<<<<<<<<< * 'rosybrown' : (188, 143, 143), * 'rosybrown1' : (255, 193, 193), */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_red4, __pyx_tuple__573) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "include/color_dict.pxi":567 * 'red3' : (205, 0, 0), * 'red4' : (139, 0, 0), * 'rosybrown' : (188, 143, 143), # <<<<<<<<<<<<<< * 'rosybrown1' : (255, 193, 193), * 'rosybrown2' : (238, 180, 180), */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_rosybrown, __pyx_tuple__574) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "include/color_dict.pxi":568 * 'red4' : (139, 0, 0), * 'rosybrown' : (188, 143, 143), * 'rosybrown1' : (255, 193, 193), # <<<<<<<<<<<<<< * 'rosybrown2' : (238, 180, 180), * 'rosybrown3' : (205, 155, 155), */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_rosybrown1, __pyx_tuple__575) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "include/color_dict.pxi":569 * 'rosybrown' : (188, 143, 143), * 'rosybrown1' : (255, 193, 193), * 'rosybrown2' : (238, 180, 180), # <<<<<<<<<<<<<< * 'rosybrown3' : (205, 155, 155), * 'rosybrown4' : (139, 105, 105), */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_rosybrown2, __pyx_tuple__576) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "include/color_dict.pxi":570 * 'rosybrown1' : (255, 193, 193), * 'rosybrown2' : (238, 180, 180), * 'rosybrown3' : (205, 155, 155), # <<<<<<<<<<<<<< * 'rosybrown4' : (139, 105, 105), * 'royalblue' : (65, 105, 225), */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_rosybrown3, __pyx_tuple__577) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "include/color_dict.pxi":571 * 'rosybrown2' : (238, 180, 180), * 'rosybrown3' : (205, 155, 155), * 'rosybrown4' : (139, 105, 105), # <<<<<<<<<<<<<< * 'royalblue' : (65, 105, 225), * 'royalblue1' : (72, 118, 255), */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_rosybrown4, __pyx_tuple__578) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "include/color_dict.pxi":572 * 'rosybrown3' : (205, 155, 155), * 'rosybrown4' : (139, 105, 105), * 'royalblue' : (65, 105, 225), # <<<<<<<<<<<<<< * 'royalblue1' : (72, 118, 255), * 'royalblue2' : (67, 110, 238), */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_royalblue, __pyx_tuple__579) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "include/color_dict.pxi":573 * 'rosybrown4' : (139, 105, 105), * 'royalblue' : (65, 105, 225), * 'royalblue1' : (72, 118, 255), # <<<<<<<<<<<<<< * 'royalblue2' : (67, 110, 238), * 'royalblue3' : (58, 95, 205), */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_royalblue1, __pyx_tuple__580) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "include/color_dict.pxi":574 * 'royalblue' : (65, 105, 225), * 'royalblue1' : (72, 118, 255), * 'royalblue2' : (67, 110, 238), # <<<<<<<<<<<<<< * 'royalblue3' : (58, 95, 205), * 'royalblue4' : (39, 64, 139), */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_royalblue2, __pyx_tuple__581) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "include/color_dict.pxi":575 * 'royalblue1' : (72, 118, 255), * 'royalblue2' : (67, 110, 238), * 'royalblue3' : (58, 95, 205), # <<<<<<<<<<<<<< * 'royalblue4' : (39, 64, 139), * 'saddlebrown' : (139, 69, 19), */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_royalblue3, __pyx_tuple__582) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "include/color_dict.pxi":576 * 'royalblue2' : (67, 110, 238), * 'royalblue3' : (58, 95, 205), * 'royalblue4' : (39, 64, 139), # <<<<<<<<<<<<<< * 'saddlebrown' : (139, 69, 19), * 'salmon' : (250, 128, 114), */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_royalblue4, __pyx_tuple__583) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "include/color_dict.pxi":577 * 'royalblue3' : (58, 95, 205), * 'royalblue4' : (39, 64, 139), * 'saddlebrown' : (139, 69, 19), # <<<<<<<<<<<<<< * 'salmon' : (250, 128, 114), * 'salmon1' : (255, 140, 105), */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_saddlebrown, __pyx_tuple__584) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "include/color_dict.pxi":578 * 'royalblue4' : (39, 64, 139), * 'saddlebrown' : (139, 69, 19), * 'salmon' : (250, 128, 114), # <<<<<<<<<<<<<< * 'salmon1' : (255, 140, 105), * 'salmon2' : (238, 130, 98), */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_salmon, __pyx_tuple__585) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "include/color_dict.pxi":579 * 'saddlebrown' : (139, 69, 19), * 'salmon' : (250, 128, 114), * 'salmon1' : (255, 140, 105), # <<<<<<<<<<<<<< * 'salmon2' : (238, 130, 98), * 'salmon3' : (205, 112, 84), */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_salmon1, __pyx_tuple__586) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "include/color_dict.pxi":580 * 'salmon' : (250, 128, 114), * 'salmon1' : (255, 140, 105), * 'salmon2' : (238, 130, 98), # <<<<<<<<<<<<<< * 'salmon3' : (205, 112, 84), * 'salmon4' : (139, 76, 57), */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_salmon2, __pyx_tuple__587) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "include/color_dict.pxi":581 * 'salmon1' : (255, 140, 105), * 'salmon2' : (238, 130, 98), * 'salmon3' : (205, 112, 84), # <<<<<<<<<<<<<< * 'salmon4' : (139, 76, 57), * 'sandybrown' : (244, 164, 96), */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_salmon3, __pyx_tuple__588) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "include/color_dict.pxi":582 * 'salmon2' : (238, 130, 98), * 'salmon3' : (205, 112, 84), * 'salmon4' : (139, 76, 57), # <<<<<<<<<<<<<< * 'sandybrown' : (244, 164, 96), * 'seagreen' : (46, 139, 87), */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_salmon4, __pyx_tuple__589) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "include/color_dict.pxi":583 * 'salmon3' : (205, 112, 84), * 'salmon4' : (139, 76, 57), * 'sandybrown' : (244, 164, 96), # <<<<<<<<<<<<<< * 'seagreen' : (46, 139, 87), * 'seagreen1' : (84, 255, 159), */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_sandybrown, __pyx_tuple__590) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "include/color_dict.pxi":584 * 'salmon4' : (139, 76, 57), * 'sandybrown' : (244, 164, 96), * 'seagreen' : (46, 139, 87), # <<<<<<<<<<<<<< * 'seagreen1' : (84, 255, 159), * 'seagreen2' : (78, 238, 148), */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_seagreen, __pyx_tuple__591) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "include/color_dict.pxi":585 * 'sandybrown' : (244, 164, 96), * 'seagreen' : (46, 139, 87), * 'seagreen1' : (84, 255, 159), # <<<<<<<<<<<<<< * 'seagreen2' : (78, 238, 148), * 'seagreen3' : (67, 205, 128), */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_seagreen1, __pyx_tuple__592) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "include/color_dict.pxi":586 * 'seagreen' : (46, 139, 87), * 'seagreen1' : (84, 255, 159), * 'seagreen2' : (78, 238, 148), # <<<<<<<<<<<<<< * 'seagreen3' : (67, 205, 128), * 'seagreen4' : (46, 139, 87), */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_seagreen2, __pyx_tuple__593) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "include/color_dict.pxi":587 * 'seagreen1' : (84, 255, 159), * 'seagreen2' : (78, 238, 148), * 'seagreen3' : (67, 205, 128), # <<<<<<<<<<<<<< * 'seagreen4' : (46, 139, 87), * 'seashell' : (255, 245, 238), */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_seagreen3, __pyx_tuple__594) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "include/color_dict.pxi":588 * 'seagreen2' : (78, 238, 148), * 'seagreen3' : (67, 205, 128), * 'seagreen4' : (46, 139, 87), # <<<<<<<<<<<<<< * 'seashell' : (255, 245, 238), * 'seashell1' : (255, 245, 238), */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_seagreen4, __pyx_tuple__595) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "include/color_dict.pxi":589 * 'seagreen3' : (67, 205, 128), * 'seagreen4' : (46, 139, 87), * 'seashell' : (255, 245, 238), # <<<<<<<<<<<<<< * 'seashell1' : (255, 245, 238), * 'seashell2' : (238, 229, 222), */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_seashell, __pyx_tuple__596) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "include/color_dict.pxi":590 * 'seagreen4' : (46, 139, 87), * 'seashell' : (255, 245, 238), * 'seashell1' : (255, 245, 238), # <<<<<<<<<<<<<< * 'seashell2' : (238, 229, 222), * 'seashell3' : (205, 197, 191), */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_seashell1, __pyx_tuple__597) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "include/color_dict.pxi":591 * 'seashell' : (255, 245, 238), * 'seashell1' : (255, 245, 238), * 'seashell2' : (238, 229, 222), # <<<<<<<<<<<<<< * 'seashell3' : (205, 197, 191), * 'seashell4' : (139, 134, 130), */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_seashell2, __pyx_tuple__598) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "include/color_dict.pxi":592 * 'seashell1' : (255, 245, 238), * 'seashell2' : (238, 229, 222), * 'seashell3' : (205, 197, 191), # <<<<<<<<<<<<<< * 'seashell4' : (139, 134, 130), * 'sienna' : (160, 82, 45), */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_seashell3, __pyx_tuple__599) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "include/color_dict.pxi":593 * 'seashell2' : (238, 229, 222), * 'seashell3' : (205, 197, 191), * 'seashell4' : (139, 134, 130), # <<<<<<<<<<<<<< * 'sienna' : (160, 82, 45), * 'sienna1' : (255, 130, 71), */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_seashell4, __pyx_tuple__600) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "include/color_dict.pxi":594 * 'seashell3' : (205, 197, 191), * 'seashell4' : (139, 134, 130), * 'sienna' : (160, 82, 45), # <<<<<<<<<<<<<< * 'sienna1' : (255, 130, 71), * 'sienna2' : (238, 121, 66), */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_sienna, __pyx_tuple__601) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "include/color_dict.pxi":595 * 'seashell4' : (139, 134, 130), * 'sienna' : (160, 82, 45), * 'sienna1' : (255, 130, 71), # <<<<<<<<<<<<<< * 'sienna2' : (238, 121, 66), * 'sienna3' : (205, 104, 57), */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_sienna1, __pyx_tuple__602) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "include/color_dict.pxi":596 * 'sienna' : (160, 82, 45), * 'sienna1' : (255, 130, 71), * 'sienna2' : (238, 121, 66), # <<<<<<<<<<<<<< * 'sienna3' : (205, 104, 57), * 'sienna4' : (139, 71, 38), */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_sienna2, __pyx_tuple__603) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "include/color_dict.pxi":597 * 'sienna1' : (255, 130, 71), * 'sienna2' : (238, 121, 66), * 'sienna3' : (205, 104, 57), # <<<<<<<<<<<<<< * 'sienna4' : (139, 71, 38), * 'silver' : (192, 192, 192), */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_sienna3, __pyx_tuple__604) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "include/color_dict.pxi":598 * 'sienna2' : (238, 121, 66), * 'sienna3' : (205, 104, 57), * 'sienna4' : (139, 71, 38), # <<<<<<<<<<<<<< * 'silver' : (192, 192, 192), * 'skyblue' : (135, 206, 235), */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_sienna4, __pyx_tuple__605) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "include/color_dict.pxi":599 * 'sienna3' : (205, 104, 57), * 'sienna4' : (139, 71, 38), * 'silver' : (192, 192, 192), # <<<<<<<<<<<<<< * 'skyblue' : (135, 206, 235), * 'skyblue1' : (135, 206, 255), */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_silver, __pyx_tuple__606) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "include/color_dict.pxi":600 * 'sienna4' : (139, 71, 38), * 'silver' : (192, 192, 192), * 'skyblue' : (135, 206, 235), # <<<<<<<<<<<<<< * 'skyblue1' : (135, 206, 255), * 'skyblue2' : (126, 192, 238), */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_skyblue, __pyx_tuple__607) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "include/color_dict.pxi":601 * 'silver' : (192, 192, 192), * 'skyblue' : (135, 206, 235), * 'skyblue1' : (135, 206, 255), # <<<<<<<<<<<<<< * 'skyblue2' : (126, 192, 238), * 'skyblue3' : (108, 166, 205), */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_skyblue1, __pyx_tuple__608) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "include/color_dict.pxi":602 * 'skyblue' : (135, 206, 235), * 'skyblue1' : (135, 206, 255), * 'skyblue2' : (126, 192, 238), # <<<<<<<<<<<<<< * 'skyblue3' : (108, 166, 205), * 'skyblue4' : (74, 112, 139), */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_skyblue2, __pyx_tuple__609) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "include/color_dict.pxi":603 * 'skyblue1' : (135, 206, 255), * 'skyblue2' : (126, 192, 238), * 'skyblue3' : (108, 166, 205), # <<<<<<<<<<<<<< * 'skyblue4' : (74, 112, 139), * 'slateblue' : (106, 90, 205), */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_skyblue3, __pyx_tuple__610) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "include/color_dict.pxi":604 * 'skyblue2' : (126, 192, 238), * 'skyblue3' : (108, 166, 205), * 'skyblue4' : (74, 112, 139), # <<<<<<<<<<<<<< * 'slateblue' : (106, 90, 205), * 'slateblue1' : (131, 111, 255), */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_skyblue4, __pyx_tuple__611) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "include/color_dict.pxi":605 * 'skyblue3' : (108, 166, 205), * 'skyblue4' : (74, 112, 139), * 'slateblue' : (106, 90, 205), # <<<<<<<<<<<<<< * 'slateblue1' : (131, 111, 255), * 'slateblue2' : (122, 103, 238), */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_slateblue, __pyx_tuple__612) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "include/color_dict.pxi":606 * 'skyblue4' : (74, 112, 139), * 'slateblue' : (106, 90, 205), * 'slateblue1' : (131, 111, 255), # <<<<<<<<<<<<<< * 'slateblue2' : (122, 103, 238), * 'slateblue3' : (105, 89, 205), */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_slateblue1, __pyx_tuple__613) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "include/color_dict.pxi":607 * 'slateblue' : (106, 90, 205), * 'slateblue1' : (131, 111, 255), * 'slateblue2' : (122, 103, 238), # <<<<<<<<<<<<<< * 'slateblue3' : (105, 89, 205), * 'slateblue4' : (71, 60, 139), */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_slateblue2, __pyx_tuple__614) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "include/color_dict.pxi":608 * 'slateblue1' : (131, 111, 255), * 'slateblue2' : (122, 103, 238), * 'slateblue3' : (105, 89, 205), # <<<<<<<<<<<<<< * 'slateblue4' : (71, 60, 139), * 'slategray' : (112, 128, 144), */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_slateblue3, __pyx_tuple__615) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "include/color_dict.pxi":609 * 'slateblue2' : (122, 103, 238), * 'slateblue3' : (105, 89, 205), * 'slateblue4' : (71, 60, 139), # <<<<<<<<<<<<<< * 'slategray' : (112, 128, 144), * 'slategray1' : (198, 226, 255), */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_slateblue4, __pyx_tuple__616) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "include/color_dict.pxi":610 * 'slateblue3' : (105, 89, 205), * 'slateblue4' : (71, 60, 139), * 'slategray' : (112, 128, 144), # <<<<<<<<<<<<<< * 'slategray1' : (198, 226, 255), * 'slategray2' : (185, 211, 238), */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_slategray, __pyx_tuple__617) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "include/color_dict.pxi":611 * 'slateblue4' : (71, 60, 139), * 'slategray' : (112, 128, 144), * 'slategray1' : (198, 226, 255), # <<<<<<<<<<<<<< * 'slategray2' : (185, 211, 238), * 'slategray3' : (159, 182, 205), */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_slategray1, __pyx_tuple__618) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "include/color_dict.pxi":612 * 'slategray' : (112, 128, 144), * 'slategray1' : (198, 226, 255), * 'slategray2' : (185, 211, 238), # <<<<<<<<<<<<<< * 'slategray3' : (159, 182, 205), * 'slategray4' : (108, 123, 139), */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_slategray2, __pyx_tuple__619) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "include/color_dict.pxi":613 * 'slategray1' : (198, 226, 255), * 'slategray2' : (185, 211, 238), * 'slategray3' : (159, 182, 205), # <<<<<<<<<<<<<< * 'slategray4' : (108, 123, 139), * 'slategrey' : (112, 128, 144), */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_slategray3, __pyx_tuple__620) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "include/color_dict.pxi":614 * 'slategray2' : (185, 211, 238), * 'slategray3' : (159, 182, 205), * 'slategray4' : (108, 123, 139), # <<<<<<<<<<<<<< * 'slategrey' : (112, 128, 144), * 'snow' : (255, 250, 250), */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_slategray4, __pyx_tuple__621) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "include/color_dict.pxi":615 * 'slategray3' : (159, 182, 205), * 'slategray4' : (108, 123, 139), * 'slategrey' : (112, 128, 144), # <<<<<<<<<<<<<< * 'snow' : (255, 250, 250), * 'snow1' : (255, 250, 250), */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_slategrey, __pyx_tuple__622) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "include/color_dict.pxi":616 * 'slategray4' : (108, 123, 139), * 'slategrey' : (112, 128, 144), * 'snow' : (255, 250, 250), # <<<<<<<<<<<<<< * 'snow1' : (255, 250, 250), * 'snow2' : (238, 233, 233), */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_snow, __pyx_tuple__623) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "include/color_dict.pxi":617 * 'slategrey' : (112, 128, 144), * 'snow' : (255, 250, 250), * 'snow1' : (255, 250, 250), # <<<<<<<<<<<<<< * 'snow2' : (238, 233, 233), * 'snow3' : (205, 201, 201), */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_snow1, __pyx_tuple__624) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "include/color_dict.pxi":618 * 'snow' : (255, 250, 250), * 'snow1' : (255, 250, 250), * 'snow2' : (238, 233, 233), # <<<<<<<<<<<<<< * 'snow3' : (205, 201, 201), * 'snow4' : (139, 137, 137), */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_snow2, __pyx_tuple__625) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "include/color_dict.pxi":619 * 'snow1' : (255, 250, 250), * 'snow2' : (238, 233, 233), * 'snow3' : (205, 201, 201), # <<<<<<<<<<<<<< * 'snow4' : (139, 137, 137), * 'springgreen' : (0, 255, 127), */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_snow3, __pyx_tuple__626) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "include/color_dict.pxi":620 * 'snow2' : (238, 233, 233), * 'snow3' : (205, 201, 201), * 'snow4' : (139, 137, 137), # <<<<<<<<<<<<<< * 'springgreen' : (0, 255, 127), * 'springgreen1' : (0, 255, 127), */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_snow4, __pyx_tuple__627) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "include/color_dict.pxi":621 * 'snow3' : (205, 201, 201), * 'snow4' : (139, 137, 137), * 'springgreen' : (0, 255, 127), # <<<<<<<<<<<<<< * 'springgreen1' : (0, 255, 127), * 'springgreen2' : (0, 238, 118), */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_springgreen, __pyx_tuple__628) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "include/color_dict.pxi":622 * 'snow4' : (139, 137, 137), * 'springgreen' : (0, 255, 127), * 'springgreen1' : (0, 255, 127), # <<<<<<<<<<<<<< * 'springgreen2' : (0, 238, 118), * 'springgreen3' : (0, 205, 102), */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_springgreen1, __pyx_tuple__629) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "include/color_dict.pxi":623 * 'springgreen' : (0, 255, 127), * 'springgreen1' : (0, 255, 127), * 'springgreen2' : (0, 238, 118), # <<<<<<<<<<<<<< * 'springgreen3' : (0, 205, 102), * 'springgreen4' : (0, 139, 69), */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_springgreen2, __pyx_tuple__630) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "include/color_dict.pxi":624 * 'springgreen1' : (0, 255, 127), * 'springgreen2' : (0, 238, 118), * 'springgreen3' : (0, 205, 102), # <<<<<<<<<<<<<< * 'springgreen4' : (0, 139, 69), * 'steelblue' : (70, 130, 180), */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_springgreen3, __pyx_tuple__631) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "include/color_dict.pxi":625 * 'springgreen2' : (0, 238, 118), * 'springgreen3' : (0, 205, 102), * 'springgreen4' : (0, 139, 69), # <<<<<<<<<<<<<< * 'steelblue' : (70, 130, 180), * 'steelblue1' : (99, 184, 255), */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_springgreen4, __pyx_tuple__632) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "include/color_dict.pxi":626 * 'springgreen3' : (0, 205, 102), * 'springgreen4' : (0, 139, 69), * 'steelblue' : (70, 130, 180), # <<<<<<<<<<<<<< * 'steelblue1' : (99, 184, 255), * 'steelblue2' : (92, 172, 238), */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_steelblue, __pyx_tuple__633) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "include/color_dict.pxi":627 * 'springgreen4' : (0, 139, 69), * 'steelblue' : (70, 130, 180), * 'steelblue1' : (99, 184, 255), # <<<<<<<<<<<<<< * 'steelblue2' : (92, 172, 238), * 'steelblue3' : (79, 148, 205), */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_steelblue1, __pyx_tuple__634) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "include/color_dict.pxi":628 * 'steelblue' : (70, 130, 180), * 'steelblue1' : (99, 184, 255), * 'steelblue2' : (92, 172, 238), # <<<<<<<<<<<<<< * 'steelblue3' : (79, 148, 205), * 'steelblue4' : (54, 100, 139), */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_steelblue2, __pyx_tuple__635) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "include/color_dict.pxi":629 * 'steelblue1' : (99, 184, 255), * 'steelblue2' : (92, 172, 238), * 'steelblue3' : (79, 148, 205), # <<<<<<<<<<<<<< * 'steelblue4' : (54, 100, 139), * 'tan' : (210, 180, 140), */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_steelblue3, __pyx_tuple__636) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "include/color_dict.pxi":630 * 'steelblue2' : (92, 172, 238), * 'steelblue3' : (79, 148, 205), * 'steelblue4' : (54, 100, 139), # <<<<<<<<<<<<<< * 'tan' : (210, 180, 140), * 'tan1' : (255, 165, 79), */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_steelblue4, __pyx_tuple__637) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "include/color_dict.pxi":631 * 'steelblue3' : (79, 148, 205), * 'steelblue4' : (54, 100, 139), * 'tan' : (210, 180, 140), # <<<<<<<<<<<<<< * 'tan1' : (255, 165, 79), * 'tan2' : (238, 154, 73), */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_tan, __pyx_tuple__638) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "include/color_dict.pxi":632 * 'steelblue4' : (54, 100, 139), * 'tan' : (210, 180, 140), * 'tan1' : (255, 165, 79), # <<<<<<<<<<<<<< * 'tan2' : (238, 154, 73), * 'tan3' : (205, 133, 63), */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_tan1, __pyx_tuple__639) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "include/color_dict.pxi":633 * 'tan' : (210, 180, 140), * 'tan1' : (255, 165, 79), * 'tan2' : (238, 154, 73), # <<<<<<<<<<<<<< * 'tan3' : (205, 133, 63), * 'tan4' : (139, 90, 43), */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_tan2, __pyx_tuple__640) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "include/color_dict.pxi":634 * 'tan1' : (255, 165, 79), * 'tan2' : (238, 154, 73), * 'tan3' : (205, 133, 63), # <<<<<<<<<<<<<< * 'tan4' : (139, 90, 43), * 'teal' : (0, 128, 128), */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_tan3, __pyx_tuple__641) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "include/color_dict.pxi":635 * 'tan2' : (238, 154, 73), * 'tan3' : (205, 133, 63), * 'tan4' : (139, 90, 43), # <<<<<<<<<<<<<< * 'teal' : (0, 128, 128), * 'thistle' : (216, 191, 216), */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_tan4, __pyx_tuple__642) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "include/color_dict.pxi":636 * 'tan3' : (205, 133, 63), * 'tan4' : (139, 90, 43), * 'teal' : (0, 128, 128), # <<<<<<<<<<<<<< * 'thistle' : (216, 191, 216), * 'thistle1' : (255, 225, 255), */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_teal, __pyx_tuple__643) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "include/color_dict.pxi":637 * 'tan4' : (139, 90, 43), * 'teal' : (0, 128, 128), * 'thistle' : (216, 191, 216), # <<<<<<<<<<<<<< * 'thistle1' : (255, 225, 255), * 'thistle2' : (238, 210, 238), */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_thistle, __pyx_tuple__644) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "include/color_dict.pxi":638 * 'teal' : (0, 128, 128), * 'thistle' : (216, 191, 216), * 'thistle1' : (255, 225, 255), # <<<<<<<<<<<<<< * 'thistle2' : (238, 210, 238), * 'thistle3' : (205, 181, 205), */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_thistle1, __pyx_tuple__645) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "include/color_dict.pxi":639 * 'thistle' : (216, 191, 216), * 'thistle1' : (255, 225, 255), * 'thistle2' : (238, 210, 238), # <<<<<<<<<<<<<< * 'thistle3' : (205, 181, 205), * 'thistle4' : (139, 123, 139), */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_thistle2, __pyx_tuple__646) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "include/color_dict.pxi":640 * 'thistle1' : (255, 225, 255), * 'thistle2' : (238, 210, 238), * 'thistle3' : (205, 181, 205), # <<<<<<<<<<<<<< * 'thistle4' : (139, 123, 139), * 'tomato' : (255, 99, 71), */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_thistle3, __pyx_tuple__647) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "include/color_dict.pxi":641 * 'thistle2' : (238, 210, 238), * 'thistle3' : (205, 181, 205), * 'thistle4' : (139, 123, 139), # <<<<<<<<<<<<<< * 'tomato' : (255, 99, 71), * 'tomato1' : (255, 99, 71), */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_thistle4, __pyx_tuple__648) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "include/color_dict.pxi":642 * 'thistle3' : (205, 181, 205), * 'thistle4' : (139, 123, 139), * 'tomato' : (255, 99, 71), # <<<<<<<<<<<<<< * 'tomato1' : (255, 99, 71), * 'tomato2' : (238, 92, 66), */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_tomato, __pyx_tuple__649) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "include/color_dict.pxi":643 * 'thistle4' : (139, 123, 139), * 'tomato' : (255, 99, 71), * 'tomato1' : (255, 99, 71), # <<<<<<<<<<<<<< * 'tomato2' : (238, 92, 66), * 'tomato3' : (205, 79, 57), */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_tomato1, __pyx_tuple__650) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "include/color_dict.pxi":644 * 'tomato' : (255, 99, 71), * 'tomato1' : (255, 99, 71), * 'tomato2' : (238, 92, 66), # <<<<<<<<<<<<<< * 'tomato3' : (205, 79, 57), * 'tomato4' : (139, 54, 38), */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_tomato2, __pyx_tuple__651) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "include/color_dict.pxi":645 * 'tomato1' : (255, 99, 71), * 'tomato2' : (238, 92, 66), * 'tomato3' : (205, 79, 57), # <<<<<<<<<<<<<< * 'tomato4' : (139, 54, 38), * 'turquoise' : (64, 224, 208), */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_tomato3, __pyx_tuple__652) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "include/color_dict.pxi":646 * 'tomato2' : (238, 92, 66), * 'tomato3' : (205, 79, 57), * 'tomato4' : (139, 54, 38), # <<<<<<<<<<<<<< * 'turquoise' : (64, 224, 208), * 'turquoise1' : (0, 245, 255), */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_tomato4, __pyx_tuple__653) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "include/color_dict.pxi":647 * 'tomato3' : (205, 79, 57), * 'tomato4' : (139, 54, 38), * 'turquoise' : (64, 224, 208), # <<<<<<<<<<<<<< * 'turquoise1' : (0, 245, 255), * 'turquoise2' : (0, 229, 238), */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_turquoise, __pyx_tuple__654) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "include/color_dict.pxi":648 * 'tomato4' : (139, 54, 38), * 'turquoise' : (64, 224, 208), * 'turquoise1' : (0, 245, 255), # <<<<<<<<<<<<<< * 'turquoise2' : (0, 229, 238), * 'turquoise3' : (0, 197, 205), */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_turquoise1, __pyx_tuple__655) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "include/color_dict.pxi":649 * 'turquoise' : (64, 224, 208), * 'turquoise1' : (0, 245, 255), * 'turquoise2' : (0, 229, 238), # <<<<<<<<<<<<<< * 'turquoise3' : (0, 197, 205), * 'turquoise4' : (0, 134, 139), */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_turquoise2, __pyx_tuple__656) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "include/color_dict.pxi":650 * 'turquoise1' : (0, 245, 255), * 'turquoise2' : (0, 229, 238), * 'turquoise3' : (0, 197, 205), # <<<<<<<<<<<<<< * 'turquoise4' : (0, 134, 139), * 'violet' : (238, 130, 238), */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_turquoise3, __pyx_tuple__657) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "include/color_dict.pxi":651 * 'turquoise2' : (0, 229, 238), * 'turquoise3' : (0, 197, 205), * 'turquoise4' : (0, 134, 139), # <<<<<<<<<<<<<< * 'violet' : (238, 130, 238), * 'violetred' : (208, 32, 144), */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_turquoise4, __pyx_tuple__658) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "include/color_dict.pxi":652 * 'turquoise3' : (0, 197, 205), * 'turquoise4' : (0, 134, 139), * 'violet' : (238, 130, 238), # <<<<<<<<<<<<<< * 'violetred' : (208, 32, 144), * 'violetred1' : (255, 62, 150), */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_violet, __pyx_tuple__659) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "include/color_dict.pxi":653 * 'turquoise4' : (0, 134, 139), * 'violet' : (238, 130, 238), * 'violetred' : (208, 32, 144), # <<<<<<<<<<<<<< * 'violetred1' : (255, 62, 150), * 'violetred2' : (238, 58, 140), */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_violetred, __pyx_tuple__660) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "include/color_dict.pxi":654 * 'violet' : (238, 130, 238), * 'violetred' : (208, 32, 144), * 'violetred1' : (255, 62, 150), # <<<<<<<<<<<<<< * 'violetred2' : (238, 58, 140), * 'violetred3' : (205, 50, 120), */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_violetred1, __pyx_tuple__661) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "include/color_dict.pxi":655 * 'violetred' : (208, 32, 144), * 'violetred1' : (255, 62, 150), * 'violetred2' : (238, 58, 140), # <<<<<<<<<<<<<< * 'violetred3' : (205, 50, 120), * 'violetred4' : (139, 34, 82), */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_violetred2, __pyx_tuple__662) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "include/color_dict.pxi":656 * 'violetred1' : (255, 62, 150), * 'violetred2' : (238, 58, 140), * 'violetred3' : (205, 50, 120), # <<<<<<<<<<<<<< * 'violetred4' : (139, 34, 82), * 'webgray' : (128, 128, 128), */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_violetred3, __pyx_tuple__663) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "include/color_dict.pxi":657 * 'violetred2' : (238, 58, 140), * 'violetred3' : (205, 50, 120), * 'violetred4' : (139, 34, 82), # <<<<<<<<<<<<<< * 'webgray' : (128, 128, 128), * 'webgreen' : (0, 128, 0), */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_violetred4, __pyx_tuple__664) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "include/color_dict.pxi":658 * 'violetred3' : (205, 50, 120), * 'violetred4' : (139, 34, 82), * 'webgray' : (128, 128, 128), # <<<<<<<<<<<<<< * 'webgreen' : (0, 128, 0), * 'webgrey' : (128, 128, 128), */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_webgray, __pyx_tuple__665) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "include/color_dict.pxi":659 * 'violetred4' : (139, 34, 82), * 'webgray' : (128, 128, 128), * 'webgreen' : (0, 128, 0), # <<<<<<<<<<<<<< * 'webgrey' : (128, 128, 128), * 'webmaroon' : (128, 0, 0), */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_webgreen, __pyx_tuple__666) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "include/color_dict.pxi":660 * 'webgray' : (128, 128, 128), * 'webgreen' : (0, 128, 0), * 'webgrey' : (128, 128, 128), # <<<<<<<<<<<<<< * 'webmaroon' : (128, 0, 0), * 'webpurple' : (128, 0, 128), */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_webgrey, __pyx_tuple__667) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "include/color_dict.pxi":661 * 'webgreen' : (0, 128, 0), * 'webgrey' : (128, 128, 128), * 'webmaroon' : (128, 0, 0), # <<<<<<<<<<<<<< * 'webpurple' : (128, 0, 128), * 'wheat' : (245, 222, 179), */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_webmaroon, __pyx_tuple__668) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "include/color_dict.pxi":662 * 'webgrey' : (128, 128, 128), * 'webmaroon' : (128, 0, 0), * 'webpurple' : (128, 0, 128), # <<<<<<<<<<<<<< * 'wheat' : (245, 222, 179), * 'wheat1' : (255, 231, 186), */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_webpurple, __pyx_tuple__669) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "include/color_dict.pxi":663 * 'webmaroon' : (128, 0, 0), * 'webpurple' : (128, 0, 128), * 'wheat' : (245, 222, 179), # <<<<<<<<<<<<<< * 'wheat1' : (255, 231, 186), * 'wheat2' : (238, 216, 174), */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_wheat, __pyx_tuple__670) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "include/color_dict.pxi":664 * 'webpurple' : (128, 0, 128), * 'wheat' : (245, 222, 179), * 'wheat1' : (255, 231, 186), # <<<<<<<<<<<<<< * 'wheat2' : (238, 216, 174), * 'wheat3' : (205, 186, 150), */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_wheat1, __pyx_tuple__671) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "include/color_dict.pxi":665 * 'wheat' : (245, 222, 179), * 'wheat1' : (255, 231, 186), * 'wheat2' : (238, 216, 174), # <<<<<<<<<<<<<< * 'wheat3' : (205, 186, 150), * 'wheat4' : (139, 126, 102), */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_wheat2, __pyx_tuple__672) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "include/color_dict.pxi":666 * 'wheat1' : (255, 231, 186), * 'wheat2' : (238, 216, 174), * 'wheat3' : (205, 186, 150), # <<<<<<<<<<<<<< * 'wheat4' : (139, 126, 102), * 'white' : (255, 255, 255), */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_wheat3, __pyx_tuple__673) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "include/color_dict.pxi":667 * 'wheat2' : (238, 216, 174), * 'wheat3' : (205, 186, 150), * 'wheat4' : (139, 126, 102), # <<<<<<<<<<<<<< * 'white' : (255, 255, 255), * 'whitesmoke' : (245, 245, 245), */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_wheat4, __pyx_tuple__674) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "include/color_dict.pxi":668 * 'wheat3' : (205, 186, 150), * 'wheat4' : (139, 126, 102), * 'white' : (255, 255, 255), # <<<<<<<<<<<<<< * 'whitesmoke' : (245, 245, 245), * 'x11gray' : (190, 190, 190), */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_white, __pyx_tuple__675) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "include/color_dict.pxi":669 * 'wheat4' : (139, 126, 102), * 'white' : (255, 255, 255), * 'whitesmoke' : (245, 245, 245), # <<<<<<<<<<<<<< * 'x11gray' : (190, 190, 190), * 'x11green' : (0, 255, 0), */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_whitesmoke, __pyx_tuple__676) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "include/color_dict.pxi":670 * 'white' : (255, 255, 255), * 'whitesmoke' : (245, 245, 245), * 'x11gray' : (190, 190, 190), # <<<<<<<<<<<<<< * 'x11green' : (0, 255, 0), * 'x11grey' : (190, 190, 190), */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_x11gray, __pyx_tuple__677) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "include/color_dict.pxi":671 * 'whitesmoke' : (245, 245, 245), * 'x11gray' : (190, 190, 190), * 'x11green' : (0, 255, 0), # <<<<<<<<<<<<<< * 'x11grey' : (190, 190, 190), * 'x11maroon' : (176, 48, 96), */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_x11green, __pyx_tuple__678) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "include/color_dict.pxi":672 * 'x11gray' : (190, 190, 190), * 'x11green' : (0, 255, 0), * 'x11grey' : (190, 190, 190), # <<<<<<<<<<<<<< * 'x11maroon' : (176, 48, 96), * 'x11purple' : (160, 32, 240), */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_x11grey, __pyx_tuple__679) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "include/color_dict.pxi":673 * 'x11green' : (0, 255, 0), * 'x11grey' : (190, 190, 190), * 'x11maroon' : (176, 48, 96), # <<<<<<<<<<<<<< * 'x11purple' : (160, 32, 240), * 'yellow' : (255, 255, 0), */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_x11maroon, __pyx_tuple__680) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "include/color_dict.pxi":674 * 'x11grey' : (190, 190, 190), * 'x11maroon' : (176, 48, 96), * 'x11purple' : (160, 32, 240), # <<<<<<<<<<<<<< * 'yellow' : (255, 255, 0), * 'yellow1' : (255, 255, 0), */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_x11purple, __pyx_tuple__681) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "include/color_dict.pxi":675 * 'x11maroon' : (176, 48, 96), * 'x11purple' : (160, 32, 240), * 'yellow' : (255, 255, 0), # <<<<<<<<<<<<<< * 'yellow1' : (255, 255, 0), * 'yellow2' : (238, 238, 0), */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_yellow, __pyx_tuple__682) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "include/color_dict.pxi":676 * 'x11purple' : (160, 32, 240), * 'yellow' : (255, 255, 0), * 'yellow1' : (255, 255, 0), # <<<<<<<<<<<<<< * 'yellow2' : (238, 238, 0), * 'yellow3' : (205, 205, 0), */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_yellow1, __pyx_tuple__683) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "include/color_dict.pxi":677 * 'yellow' : (255, 255, 0), * 'yellow1' : (255, 255, 0), * 'yellow2' : (238, 238, 0), # <<<<<<<<<<<<<< * 'yellow3' : (205, 205, 0), * 'yellow4' : (139, 139, 0), */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_yellow2, __pyx_tuple__684) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "include/color_dict.pxi":678 * 'yellow1' : (255, 255, 0), * 'yellow2' : (238, 238, 0), * 'yellow3' : (205, 205, 0), # <<<<<<<<<<<<<< * 'yellow4' : (139, 139, 0), * 'yellowgreen' : (154, 205, 50), */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_yellow3, __pyx_tuple__685) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "include/color_dict.pxi":679 * 'yellow2' : (238, 238, 0), * 'yellow3' : (205, 205, 0), * 'yellow4' : (139, 139, 0), # <<<<<<<<<<<<<< * 'yellowgreen' : (154, 205, 50), * } */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_yellow4, __pyx_tuple__686) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "include/color_dict.pxi":680 * 'yellow3' : (205, 205, 0), * 'yellow4' : (139, 139, 0), * 'yellowgreen' : (154, 205, 50), # <<<<<<<<<<<<<< * } */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_yellowgreen, __pyx_tuple__687) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_XGOTREF(__pyx_v_11pygame_sdl2_5color_colors); __Pyx_DECREF_SET(__pyx_v_11pygame_sdl2_5color_colors, __pyx_t_1); __Pyx_GIVEREF(__pyx_t_1); __pyx_t_1 = 0; /* "pygame_sdl2/color.pyx":1 * # Copyright 2014 Tom Rothamel # <<<<<<<<<<<<<< * # Copyright 2014 Patrick Dawson * # */ __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); if (PyDict_SetItem(__pyx_d, __pyx_n_s_test, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /*--- Wrapped vars code ---*/ goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); if (__pyx_m) { if (__pyx_d) { __Pyx_AddTraceback("init pygame_sdl2.color", __pyx_clineno, __pyx_lineno, __pyx_filename); } Py_DECREF(__pyx_m); __pyx_m = 0; } else if (!PyErr_Occurred()) { PyErr_SetString(PyExc_ImportError, "init pygame_sdl2.color"); } __pyx_L0:; __Pyx_RefNannyFinishContext(); #if PY_MAJOR_VERSION < 3 return; #else return __pyx_m; #endif } /* --- Runtime support code --- */ #if CYTHON_REFNANNY static __Pyx_RefNannyAPIStruct *__Pyx_RefNannyImportAPI(const char *modname) { PyObject *m = NULL, *p = NULL; void *r = NULL; m = PyImport_ImportModule((char *)modname); if (!m) goto end; p = PyObject_GetAttrString(m, (char *)"RefNannyAPI"); if (!p) goto end; r = PyLong_AsVoidPtr(p); end: Py_XDECREF(p); Py_XDECREF(m); return (__Pyx_RefNannyAPIStruct *)r; } #endif static PyObject *__Pyx_GetBuiltinName(PyObject *name) { PyObject* result = __Pyx_PyObject_GetAttrStr(__pyx_b, name); if (unlikely(!result)) { PyErr_Format(PyExc_NameError, #if PY_MAJOR_VERSION >= 3 "name '%U' is not defined", name); #else "name '%.200s' is not defined", PyString_AS_STRING(name)); #endif } return result; } static CYTHON_INLINE void __Pyx_RaiseTooManyValuesError(Py_ssize_t expected) { PyErr_Format(PyExc_ValueError, "too many values to unpack (expected %" CYTHON_FORMAT_SSIZE_T "d)", expected); } static CYTHON_INLINE void __Pyx_RaiseNeedMoreValuesError(Py_ssize_t index) { PyErr_Format(PyExc_ValueError, "need more than %" CYTHON_FORMAT_SSIZE_T "d value%.1s to unpack", index, (index == 1) ? "" : "s"); } static CYTHON_INLINE int __Pyx_IterFinish(void) { #if CYTHON_COMPILING_IN_CPYTHON PyThreadState *tstate = PyThreadState_GET(); PyObject* exc_type = tstate->curexc_type; if (unlikely(exc_type)) { if (likely(exc_type == PyExc_StopIteration) || PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration)) { PyObject *exc_value, *exc_tb; exc_value = tstate->curexc_value; exc_tb = tstate->curexc_traceback; tstate->curexc_type = 0; tstate->curexc_value = 0; tstate->curexc_traceback = 0; Py_DECREF(exc_type); Py_XDECREF(exc_value); Py_XDECREF(exc_tb); return 0; } else { return -1; } } return 0; #else if (unlikely(PyErr_Occurred())) { if (likely(PyErr_ExceptionMatches(PyExc_StopIteration))) { PyErr_Clear(); return 0; } else { return -1; } } return 0; #endif } static int __Pyx_IternextUnpackEndCheck(PyObject *retval, Py_ssize_t expected) { if (unlikely(retval)) { Py_DECREF(retval); __Pyx_RaiseTooManyValuesError(expected); return -1; } else { return __Pyx_IterFinish(); } return 0; } #if CYTHON_COMPILING_IN_CPYTHON static CYTHON_INLINE PyObject* __Pyx_PyObject_Call(PyObject *func, PyObject *arg, PyObject *kw) { PyObject *result; ternaryfunc call = func->ob_type->tp_call; if (unlikely(!call)) return PyObject_Call(func, arg, kw); if (unlikely(Py_EnterRecursiveCall((char*)" while calling a Python object"))) return NULL; result = (*call)(func, arg, kw); Py_LeaveRecursiveCall(); if (unlikely(!result) && unlikely(!PyErr_Occurred())) { PyErr_SetString( PyExc_SystemError, "NULL result without error in PyObject_Call"); } return result; } #endif static CYTHON_INLINE void __Pyx_ErrRestore(PyObject *type, PyObject *value, PyObject *tb) { #if CYTHON_COMPILING_IN_CPYTHON PyObject *tmp_type, *tmp_value, *tmp_tb; PyThreadState *tstate = PyThreadState_GET(); tmp_type = tstate->curexc_type; tmp_value = tstate->curexc_value; tmp_tb = tstate->curexc_traceback; tstate->curexc_type = type; tstate->curexc_value = value; tstate->curexc_traceback = tb; Py_XDECREF(tmp_type); Py_XDECREF(tmp_value); Py_XDECREF(tmp_tb); #else PyErr_Restore(type, value, tb); #endif } static CYTHON_INLINE void __Pyx_ErrFetch(PyObject **type, PyObject **value, PyObject **tb) { #if CYTHON_COMPILING_IN_CPYTHON PyThreadState *tstate = PyThreadState_GET(); *type = tstate->curexc_type; *value = tstate->curexc_value; *tb = tstate->curexc_traceback; tstate->curexc_type = 0; tstate->curexc_value = 0; tstate->curexc_traceback = 0; #else PyErr_Fetch(type, value, tb); #endif } #if PY_MAJOR_VERSION < 3 static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, CYTHON_UNUSED PyObject *cause) { Py_XINCREF(type); if (!value || value == Py_None) value = NULL; else Py_INCREF(value); if (!tb || tb == Py_None) tb = NULL; else { Py_INCREF(tb); if (!PyTraceBack_Check(tb)) { PyErr_SetString(PyExc_TypeError, "raise: arg 3 must be a traceback or None"); goto raise_error; } } if (PyType_Check(type)) { #if CYTHON_COMPILING_IN_PYPY if (!value) { Py_INCREF(Py_None); value = Py_None; } #endif PyErr_NormalizeException(&type, &value, &tb); } else { if (value) { PyErr_SetString(PyExc_TypeError, "instance exception may not have a separate value"); goto raise_error; } value = type; type = (PyObject*) Py_TYPE(type); Py_INCREF(type); if (!PyType_IsSubtype((PyTypeObject *)type, (PyTypeObject *)PyExc_BaseException)) { PyErr_SetString(PyExc_TypeError, "raise: exception class must be a subclass of BaseException"); goto raise_error; } } __Pyx_ErrRestore(type, value, tb); return; raise_error: Py_XDECREF(value); Py_XDECREF(type); Py_XDECREF(tb); return; } #else static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, PyObject *cause) { PyObject* owned_instance = NULL; if (tb == Py_None) { tb = 0; } else if (tb && !PyTraceBack_Check(tb)) { PyErr_SetString(PyExc_TypeError, "raise: arg 3 must be a traceback or None"); goto bad; } if (value == Py_None) value = 0; if (PyExceptionInstance_Check(type)) { if (value) { PyErr_SetString(PyExc_TypeError, "instance exception may not have a separate value"); goto bad; } value = type; type = (PyObject*) Py_TYPE(value); } else if (PyExceptionClass_Check(type)) { PyObject *instance_class = NULL; if (value && PyExceptionInstance_Check(value)) { instance_class = (PyObject*) Py_TYPE(value); if (instance_class != type) { int is_subclass = PyObject_IsSubclass(instance_class, type); if (!is_subclass) { instance_class = NULL; } else if (unlikely(is_subclass == -1)) { goto bad; } else { type = instance_class; } } } if (!instance_class) { PyObject *args; if (!value) args = PyTuple_New(0); else if (PyTuple_Check(value)) { Py_INCREF(value); args = value; } else args = PyTuple_Pack(1, value); if (!args) goto bad; owned_instance = PyObject_Call(type, args, NULL); Py_DECREF(args); if (!owned_instance) goto bad; value = owned_instance; if (!PyExceptionInstance_Check(value)) { PyErr_Format(PyExc_TypeError, "calling %R should have returned an instance of " "BaseException, not %R", type, Py_TYPE(value)); goto bad; } } } else { PyErr_SetString(PyExc_TypeError, "raise: exception class must be a subclass of BaseException"); goto bad; } #if PY_VERSION_HEX >= 0x03030000 if (cause) { #else if (cause && cause != Py_None) { #endif PyObject *fixed_cause; if (cause == Py_None) { fixed_cause = NULL; } else if (PyExceptionClass_Check(cause)) { fixed_cause = PyObject_CallObject(cause, NULL); if (fixed_cause == NULL) goto bad; } else if (PyExceptionInstance_Check(cause)) { fixed_cause = cause; Py_INCREF(fixed_cause); } else { PyErr_SetString(PyExc_TypeError, "exception causes must derive from " "BaseException"); goto bad; } PyException_SetCause(value, fixed_cause); } PyErr_SetObject(type, value); if (tb) { #if CYTHON_COMPILING_IN_PYPY PyObject *tmp_type, *tmp_value, *tmp_tb; PyErr_Fetch(&tmp_type, &tmp_value, &tmp_tb); Py_INCREF(tb); PyErr_Restore(tmp_type, tmp_value, tb); Py_XDECREF(tmp_tb); #else PyThreadState *tstate = PyThreadState_GET(); PyObject* tmp_tb = tstate->curexc_traceback; if (tb != tmp_tb) { Py_INCREF(tb); tstate->curexc_traceback = tb; Py_XDECREF(tmp_tb); } #endif } bad: Py_XDECREF(owned_instance); return; } #endif #if !CYTHON_COMPILING_IN_CPYTHON static CYTHON_INLINE PyObject* __Pyx_PyBytes_Join(PyObject* sep, PyObject* values) { return PyObject_CallMethodObjArgs(sep, __pyx_n_s_join, values, NULL); } #endif static PyTypeObject* __Pyx_FetchCommonType(PyTypeObject* type) { PyObject* fake_module; PyTypeObject* cached_type = NULL; fake_module = PyImport_AddModule((char*) "_cython_" CYTHON_ABI); if (!fake_module) return NULL; Py_INCREF(fake_module); cached_type = (PyTypeObject*) PyObject_GetAttrString(fake_module, type->tp_name); if (cached_type) { if (!PyType_Check((PyObject*)cached_type)) { PyErr_Format(PyExc_TypeError, "Shared Cython type %.200s is not a type object", type->tp_name); goto bad; } if (cached_type->tp_basicsize != type->tp_basicsize) { PyErr_Format(PyExc_TypeError, "Shared Cython type %.200s has the wrong size, try recompiling", type->tp_name); goto bad; } } else { if (!PyErr_ExceptionMatches(PyExc_AttributeError)) goto bad; PyErr_Clear(); if (PyType_Ready(type) < 0) goto bad; if (PyObject_SetAttrString(fake_module, type->tp_name, (PyObject*) type) < 0) goto bad; Py_INCREF(type); cached_type = type; } done: Py_DECREF(fake_module); return cached_type; bad: Py_XDECREF(cached_type); cached_type = NULL; goto done; } static PyObject * __Pyx_CyFunction_get_doc(__pyx_CyFunctionObject *op, CYTHON_UNUSED void *closure) { if (unlikely(op->func_doc == NULL)) { if (op->func.m_ml->ml_doc) { #if PY_MAJOR_VERSION >= 3 op->func_doc = PyUnicode_FromString(op->func.m_ml->ml_doc); #else op->func_doc = PyString_FromString(op->func.m_ml->ml_doc); #endif if (unlikely(op->func_doc == NULL)) return NULL; } else { Py_INCREF(Py_None); return Py_None; } } Py_INCREF(op->func_doc); return op->func_doc; } static int __Pyx_CyFunction_set_doc(__pyx_CyFunctionObject *op, PyObject *value) { PyObject *tmp = op->func_doc; if (value == NULL) { value = Py_None; } Py_INCREF(value); op->func_doc = value; Py_XDECREF(tmp); return 0; } static PyObject * __Pyx_CyFunction_get_name(__pyx_CyFunctionObject *op) { if (unlikely(op->func_name == NULL)) { #if PY_MAJOR_VERSION >= 3 op->func_name = PyUnicode_InternFromString(op->func.m_ml->ml_name); #else op->func_name = PyString_InternFromString(op->func.m_ml->ml_name); #endif if (unlikely(op->func_name == NULL)) return NULL; } Py_INCREF(op->func_name); return op->func_name; } static int __Pyx_CyFunction_set_name(__pyx_CyFunctionObject *op, PyObject *value) { PyObject *tmp; #if PY_MAJOR_VERSION >= 3 if (unlikely(value == NULL || !PyUnicode_Check(value))) { #else if (unlikely(value == NULL || !PyString_Check(value))) { #endif PyErr_SetString(PyExc_TypeError, "__name__ must be set to a string object"); return -1; } tmp = op->func_name; Py_INCREF(value); op->func_name = value; Py_XDECREF(tmp); return 0; } static PyObject * __Pyx_CyFunction_get_qualname(__pyx_CyFunctionObject *op) { Py_INCREF(op->func_qualname); return op->func_qualname; } static int __Pyx_CyFunction_set_qualname(__pyx_CyFunctionObject *op, PyObject *value) { PyObject *tmp; #if PY_MAJOR_VERSION >= 3 if (unlikely(value == NULL || !PyUnicode_Check(value))) { #else if (unlikely(value == NULL || !PyString_Check(value))) { #endif PyErr_SetString(PyExc_TypeError, "__qualname__ must be set to a string object"); return -1; } tmp = op->func_qualname; Py_INCREF(value); op->func_qualname = value; Py_XDECREF(tmp); return 0; } static PyObject * __Pyx_CyFunction_get_self(__pyx_CyFunctionObject *m, CYTHON_UNUSED void *closure) { PyObject *self; self = m->func_closure; if (self == NULL) self = Py_None; Py_INCREF(self); return self; } static PyObject * __Pyx_CyFunction_get_dict(__pyx_CyFunctionObject *op) { if (unlikely(op->func_dict == NULL)) { op->func_dict = PyDict_New(); if (unlikely(op->func_dict == NULL)) return NULL; } Py_INCREF(op->func_dict); return op->func_dict; } static int __Pyx_CyFunction_set_dict(__pyx_CyFunctionObject *op, PyObject *value) { PyObject *tmp; if (unlikely(value == NULL)) { PyErr_SetString(PyExc_TypeError, "function's dictionary may not be deleted"); return -1; } if (unlikely(!PyDict_Check(value))) { PyErr_SetString(PyExc_TypeError, "setting function's dictionary to a non-dict"); return -1; } tmp = op->func_dict; Py_INCREF(value); op->func_dict = value; Py_XDECREF(tmp); return 0; } static PyObject * __Pyx_CyFunction_get_globals(__pyx_CyFunctionObject *op) { Py_INCREF(op->func_globals); return op->func_globals; } static PyObject * __Pyx_CyFunction_get_closure(CYTHON_UNUSED __pyx_CyFunctionObject *op) { Py_INCREF(Py_None); return Py_None; } static PyObject * __Pyx_CyFunction_get_code(__pyx_CyFunctionObject *op) { PyObject* result = (op->func_code) ? op->func_code : Py_None; Py_INCREF(result); return result; } static int __Pyx_CyFunction_init_defaults(__pyx_CyFunctionObject *op) { int result = 0; PyObject *res = op->defaults_getter((PyObject *) op); if (unlikely(!res)) return -1; #if CYTHON_COMPILING_IN_CPYTHON op->defaults_tuple = PyTuple_GET_ITEM(res, 0); Py_INCREF(op->defaults_tuple); op->defaults_kwdict = PyTuple_GET_ITEM(res, 1); Py_INCREF(op->defaults_kwdict); #else op->defaults_tuple = PySequence_ITEM(res, 0); if (unlikely(!op->defaults_tuple)) result = -1; else { op->defaults_kwdict = PySequence_ITEM(res, 1); if (unlikely(!op->defaults_kwdict)) result = -1; } #endif Py_DECREF(res); return result; } static int __Pyx_CyFunction_set_defaults(__pyx_CyFunctionObject *op, PyObject* value) { PyObject* tmp; if (!value) { value = Py_None; } else if (value != Py_None && !PyTuple_Check(value)) { PyErr_SetString(PyExc_TypeError, "__defaults__ must be set to a tuple object"); return -1; } Py_INCREF(value); tmp = op->defaults_tuple; op->defaults_tuple = value; Py_XDECREF(tmp); return 0; } static PyObject * __Pyx_CyFunction_get_defaults(__pyx_CyFunctionObject *op) { PyObject* result = op->defaults_tuple; if (unlikely(!result)) { if (op->defaults_getter) { if (__Pyx_CyFunction_init_defaults(op) < 0) return NULL; result = op->defaults_tuple; } else { result = Py_None; } } Py_INCREF(result); return result; } static int __Pyx_CyFunction_set_kwdefaults(__pyx_CyFunctionObject *op, PyObject* value) { PyObject* tmp; if (!value) { value = Py_None; } else if (value != Py_None && !PyDict_Check(value)) { PyErr_SetString(PyExc_TypeError, "__kwdefaults__ must be set to a dict object"); return -1; } Py_INCREF(value); tmp = op->defaults_kwdict; op->defaults_kwdict = value; Py_XDECREF(tmp); return 0; } static PyObject * __Pyx_CyFunction_get_kwdefaults(__pyx_CyFunctionObject *op) { PyObject* result = op->defaults_kwdict; if (unlikely(!result)) { if (op->defaults_getter) { if (__Pyx_CyFunction_init_defaults(op) < 0) return NULL; result = op->defaults_kwdict; } else { result = Py_None; } } Py_INCREF(result); return result; } static int __Pyx_CyFunction_set_annotations(__pyx_CyFunctionObject *op, PyObject* value) { PyObject* tmp; if (!value || value == Py_None) { value = NULL; } else if (!PyDict_Check(value)) { PyErr_SetString(PyExc_TypeError, "__annotations__ must be set to a dict object"); return -1; } Py_XINCREF(value); tmp = op->func_annotations; op->func_annotations = value; Py_XDECREF(tmp); return 0; } static PyObject * __Pyx_CyFunction_get_annotations(__pyx_CyFunctionObject *op) { PyObject* result = op->func_annotations; if (unlikely(!result)) { result = PyDict_New(); if (unlikely(!result)) return NULL; op->func_annotations = result; } Py_INCREF(result); return result; } static PyGetSetDef __pyx_CyFunction_getsets[] = { {(char *) "func_doc", (getter)__Pyx_CyFunction_get_doc, (setter)__Pyx_CyFunction_set_doc, 0, 0}, {(char *) "__doc__", (getter)__Pyx_CyFunction_get_doc, (setter)__Pyx_CyFunction_set_doc, 0, 0}, {(char *) "func_name", (getter)__Pyx_CyFunction_get_name, (setter)__Pyx_CyFunction_set_name, 0, 0}, {(char *) "__name__", (getter)__Pyx_CyFunction_get_name, (setter)__Pyx_CyFunction_set_name, 0, 0}, {(char *) "__qualname__", (getter)__Pyx_CyFunction_get_qualname, (setter)__Pyx_CyFunction_set_qualname, 0, 0}, {(char *) "__self__", (getter)__Pyx_CyFunction_get_self, 0, 0, 0}, {(char *) "func_dict", (getter)__Pyx_CyFunction_get_dict, (setter)__Pyx_CyFunction_set_dict, 0, 0}, {(char *) "__dict__", (getter)__Pyx_CyFunction_get_dict, (setter)__Pyx_CyFunction_set_dict, 0, 0}, {(char *) "func_globals", (getter)__Pyx_CyFunction_get_globals, 0, 0, 0}, {(char *) "__globals__", (getter)__Pyx_CyFunction_get_globals, 0, 0, 0}, {(char *) "func_closure", (getter)__Pyx_CyFunction_get_closure, 0, 0, 0}, {(char *) "__closure__", (getter)__Pyx_CyFunction_get_closure, 0, 0, 0}, {(char *) "func_code", (getter)__Pyx_CyFunction_get_code, 0, 0, 0}, {(char *) "__code__", (getter)__Pyx_CyFunction_get_code, 0, 0, 0}, {(char *) "func_defaults", (getter)__Pyx_CyFunction_get_defaults, (setter)__Pyx_CyFunction_set_defaults, 0, 0}, {(char *) "__defaults__", (getter)__Pyx_CyFunction_get_defaults, (setter)__Pyx_CyFunction_set_defaults, 0, 0}, {(char *) "__kwdefaults__", (getter)__Pyx_CyFunction_get_kwdefaults, (setter)__Pyx_CyFunction_set_kwdefaults, 0, 0}, {(char *) "__annotations__", (getter)__Pyx_CyFunction_get_annotations, (setter)__Pyx_CyFunction_set_annotations, 0, 0}, {0, 0, 0, 0, 0} }; static PyMemberDef __pyx_CyFunction_members[] = { {(char *) "__module__", T_OBJECT, offsetof(__pyx_CyFunctionObject, func.m_module), PY_WRITE_RESTRICTED, 0}, {0, 0, 0, 0, 0} }; static PyObject * __Pyx_CyFunction_reduce(__pyx_CyFunctionObject *m, CYTHON_UNUSED PyObject *args) { #if PY_MAJOR_VERSION >= 3 return PyUnicode_FromString(m->func.m_ml->ml_name); #else return PyString_FromString(m->func.m_ml->ml_name); #endif } static PyMethodDef __pyx_CyFunction_methods[] = { {"__reduce__", (PyCFunction)__Pyx_CyFunction_reduce, METH_VARARGS, 0}, {0, 0, 0, 0} }; #if PY_VERSION_HEX < 0x030500A0 #define __Pyx_CyFunction_weakreflist(cyfunc) ((cyfunc)->func_weakreflist) #else #define __Pyx_CyFunction_weakreflist(cyfunc) ((cyfunc)->func.m_weakreflist) #endif static PyObject *__Pyx_CyFunction_New(PyTypeObject *type, PyMethodDef *ml, int flags, PyObject* qualname, PyObject *closure, PyObject *module, PyObject* globals, PyObject* code) { __pyx_CyFunctionObject *op = PyObject_GC_New(__pyx_CyFunctionObject, type); if (op == NULL) return NULL; op->flags = flags; __Pyx_CyFunction_weakreflist(op) = NULL; op->func.m_ml = ml; op->func.m_self = (PyObject *) op; Py_XINCREF(closure); op->func_closure = closure; Py_XINCREF(module); op->func.m_module = module; op->func_dict = NULL; op->func_name = NULL; Py_INCREF(qualname); op->func_qualname = qualname; op->func_doc = NULL; op->func_classobj = NULL; op->func_globals = globals; Py_INCREF(op->func_globals); Py_XINCREF(code); op->func_code = code; op->defaults_pyobjects = 0; op->defaults = NULL; op->defaults_tuple = NULL; op->defaults_kwdict = NULL; op->defaults_getter = NULL; op->func_annotations = NULL; PyObject_GC_Track(op); return (PyObject *) op; } static int __Pyx_CyFunction_clear(__pyx_CyFunctionObject *m) { Py_CLEAR(m->func_closure); Py_CLEAR(m->func.m_module); Py_CLEAR(m->func_dict); Py_CLEAR(m->func_name); Py_CLEAR(m->func_qualname); Py_CLEAR(m->func_doc); Py_CLEAR(m->func_globals); Py_CLEAR(m->func_code); Py_CLEAR(m->func_classobj); Py_CLEAR(m->defaults_tuple); Py_CLEAR(m->defaults_kwdict); Py_CLEAR(m->func_annotations); if (m->defaults) { PyObject **pydefaults = __Pyx_CyFunction_Defaults(PyObject *, m); int i; for (i = 0; i < m->defaults_pyobjects; i++) Py_XDECREF(pydefaults[i]); PyMem_Free(m->defaults); m->defaults = NULL; } return 0; } static void __Pyx_CyFunction_dealloc(__pyx_CyFunctionObject *m) { PyObject_GC_UnTrack(m); if (__Pyx_CyFunction_weakreflist(m) != NULL) PyObject_ClearWeakRefs((PyObject *) m); __Pyx_CyFunction_clear(m); PyObject_GC_Del(m); } static int __Pyx_CyFunction_traverse(__pyx_CyFunctionObject *m, visitproc visit, void *arg) { Py_VISIT(m->func_closure); Py_VISIT(m->func.m_module); Py_VISIT(m->func_dict); Py_VISIT(m->func_name); Py_VISIT(m->func_qualname); Py_VISIT(m->func_doc); Py_VISIT(m->func_globals); Py_VISIT(m->func_code); Py_VISIT(m->func_classobj); Py_VISIT(m->defaults_tuple); Py_VISIT(m->defaults_kwdict); if (m->defaults) { PyObject **pydefaults = __Pyx_CyFunction_Defaults(PyObject *, m); int i; for (i = 0; i < m->defaults_pyobjects; i++) Py_VISIT(pydefaults[i]); } return 0; } static PyObject *__Pyx_CyFunction_descr_get(PyObject *func, PyObject *obj, PyObject *type) { __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func; if (m->flags & __Pyx_CYFUNCTION_STATICMETHOD) { Py_INCREF(func); return func; } if (m->flags & __Pyx_CYFUNCTION_CLASSMETHOD) { if (type == NULL) type = (PyObject *)(Py_TYPE(obj)); return __Pyx_PyMethod_New(func, type, (PyObject *)(Py_TYPE(type))); } if (obj == Py_None) obj = NULL; return __Pyx_PyMethod_New(func, obj, type); } static PyObject* __Pyx_CyFunction_repr(__pyx_CyFunctionObject *op) { #if PY_MAJOR_VERSION >= 3 return PyUnicode_FromFormat("", op->func_qualname, (void *)op); #else return PyString_FromFormat("", PyString_AsString(op->func_qualname), (void *)op); #endif } #if CYTHON_COMPILING_IN_PYPY static PyObject * __Pyx_CyFunction_Call(PyObject *func, PyObject *arg, PyObject *kw) { PyCFunctionObject* f = (PyCFunctionObject*)func; PyCFunction meth = f->m_ml->ml_meth; PyObject *self = f->m_self; Py_ssize_t size; switch (f->m_ml->ml_flags & (METH_VARARGS | METH_KEYWORDS | METH_NOARGS | METH_O)) { case METH_VARARGS: if (likely(kw == NULL || PyDict_Size(kw) == 0)) return (*meth)(self, arg); break; case METH_VARARGS | METH_KEYWORDS: return (*(PyCFunctionWithKeywords)meth)(self, arg, kw); case METH_NOARGS: if (likely(kw == NULL || PyDict_Size(kw) == 0)) { size = PyTuple_GET_SIZE(arg); if (likely(size == 0)) return (*meth)(self, NULL); PyErr_Format(PyExc_TypeError, "%.200s() takes no arguments (%" CYTHON_FORMAT_SSIZE_T "d given)", f->m_ml->ml_name, size); return NULL; } break; case METH_O: if (likely(kw == NULL || PyDict_Size(kw) == 0)) { size = PyTuple_GET_SIZE(arg); if (likely(size == 1)) { PyObject *result, *arg0 = PySequence_ITEM(arg, 0); if (unlikely(!arg0)) return NULL; result = (*meth)(self, arg0); Py_DECREF(arg0); return result; } PyErr_Format(PyExc_TypeError, "%.200s() takes exactly one argument (%" CYTHON_FORMAT_SSIZE_T "d given)", f->m_ml->ml_name, size); return NULL; } break; default: PyErr_SetString(PyExc_SystemError, "Bad call flags in " "__Pyx_CyFunction_Call. METH_OLDARGS is no " "longer supported!"); return NULL; } PyErr_Format(PyExc_TypeError, "%.200s() takes no keyword arguments", f->m_ml->ml_name); return NULL; } #else static PyObject * __Pyx_CyFunction_Call(PyObject *func, PyObject *arg, PyObject *kw) { return PyCFunction_Call(func, arg, kw); } #endif static PyTypeObject __pyx_CyFunctionType_type = { PyVarObject_HEAD_INIT(0, 0) "cython_function_or_method", sizeof(__pyx_CyFunctionObject), 0, (destructor) __Pyx_CyFunction_dealloc, 0, 0, 0, #if PY_MAJOR_VERSION < 3 0, #else 0, #endif (reprfunc) __Pyx_CyFunction_repr, 0, 0, 0, 0, __Pyx_CyFunction_Call, 0, 0, 0, 0, Py_TPFLAGS_DEFAULT | Py_TPFLAGS_HAVE_GC, 0, (traverseproc) __Pyx_CyFunction_traverse, (inquiry) __Pyx_CyFunction_clear, 0, #if PY_VERSION_HEX < 0x030500A0 offsetof(__pyx_CyFunctionObject, func_weakreflist), #else offsetof(PyCFunctionObject, m_weakreflist), #endif 0, 0, __pyx_CyFunction_methods, __pyx_CyFunction_members, __pyx_CyFunction_getsets, 0, 0, __Pyx_CyFunction_descr_get, 0, offsetof(__pyx_CyFunctionObject, func_dict), 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, #if PY_VERSION_HEX >= 0x030400a1 0, #endif }; static int __pyx_CyFunction_init(void) { #if !CYTHON_COMPILING_IN_PYPY __pyx_CyFunctionType_type.tp_call = PyCFunction_Call; #endif __pyx_CyFunctionType = __Pyx_FetchCommonType(&__pyx_CyFunctionType_type); if (__pyx_CyFunctionType == NULL) { return -1; } return 0; } static CYTHON_INLINE void *__Pyx_CyFunction_InitDefaults(PyObject *func, size_t size, int pyobjects) { __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func; m->defaults = PyMem_Malloc(size); if (!m->defaults) return PyErr_NoMemory(); memset(m->defaults, 0, size); m->defaults_pyobjects = pyobjects; return m->defaults; } static CYTHON_INLINE void __Pyx_CyFunction_SetDefaultsTuple(PyObject *func, PyObject *tuple) { __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func; m->defaults_tuple = tuple; Py_INCREF(tuple); } static CYTHON_INLINE void __Pyx_CyFunction_SetDefaultsKwDict(PyObject *func, PyObject *dict) { __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func; m->defaults_kwdict = dict; Py_INCREF(dict); } static CYTHON_INLINE void __Pyx_CyFunction_SetAnnotationsDict(PyObject *func, PyObject *dict) { __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func; m->func_annotations = dict; Py_INCREF(dict); } static CYTHON_INLINE PyObject *__Pyx_GetModuleGlobalName(PyObject *name) { PyObject *result; #if CYTHON_COMPILING_IN_CPYTHON result = PyDict_GetItem(__pyx_d, name); if (likely(result)) { Py_INCREF(result); } else { #else result = PyObject_GetItem(__pyx_d, name); if (!result) { PyErr_Clear(); #endif result = __Pyx_GetBuiltinName(name); } return result; } #if CYTHON_COMPILING_IN_CPYTHON static CYTHON_INLINE PyObject* __Pyx_PyObject_CallMethO(PyObject *func, PyObject *arg) { PyObject *self, *result; PyCFunction cfunc; cfunc = PyCFunction_GET_FUNCTION(func); self = PyCFunction_GET_SELF(func); if (unlikely(Py_EnterRecursiveCall((char*)" while calling a Python object"))) return NULL; result = cfunc(self, arg); Py_LeaveRecursiveCall(); if (unlikely(!result) && unlikely(!PyErr_Occurred())) { PyErr_SetString( PyExc_SystemError, "NULL result without error in PyObject_Call"); } return result; } #endif #if CYTHON_COMPILING_IN_CPYTHON static PyObject* __Pyx__PyObject_CallOneArg(PyObject *func, PyObject *arg) { PyObject *result; PyObject *args = PyTuple_New(1); if (unlikely(!args)) return NULL; Py_INCREF(arg); PyTuple_SET_ITEM(args, 0, arg); result = __Pyx_PyObject_Call(func, args, NULL); Py_DECREF(args); return result; } static CYTHON_INLINE PyObject* __Pyx_PyObject_CallOneArg(PyObject *func, PyObject *arg) { #ifdef __Pyx_CyFunction_USED if (likely(PyCFunction_Check(func) || PyObject_TypeCheck(func, __pyx_CyFunctionType))) { #else if (likely(PyCFunction_Check(func))) { #endif if (likely(PyCFunction_GET_FLAGS(func) & METH_O)) { return __Pyx_PyObject_CallMethO(func, arg); } } return __Pyx__PyObject_CallOneArg(func, arg); } #else static CYTHON_INLINE PyObject* __Pyx_PyObject_CallOneArg(PyObject *func, PyObject *arg) { PyObject *result; PyObject *args = PyTuple_Pack(1, arg); if (unlikely(!args)) return NULL; result = __Pyx_PyObject_Call(func, args, NULL); Py_DECREF(args); return result; } #endif static CYTHON_INLINE void __Pyx_ExceptionSave(PyObject **type, PyObject **value, PyObject **tb) { #if CYTHON_COMPILING_IN_CPYTHON PyThreadState *tstate = PyThreadState_GET(); *type = tstate->exc_type; *value = tstate->exc_value; *tb = tstate->exc_traceback; Py_XINCREF(*type); Py_XINCREF(*value); Py_XINCREF(*tb); #else PyErr_GetExcInfo(type, value, tb); #endif } static void __Pyx_ExceptionReset(PyObject *type, PyObject *value, PyObject *tb) { #if CYTHON_COMPILING_IN_CPYTHON PyObject *tmp_type, *tmp_value, *tmp_tb; PyThreadState *tstate = PyThreadState_GET(); tmp_type = tstate->exc_type; tmp_value = tstate->exc_value; tmp_tb = tstate->exc_traceback; tstate->exc_type = type; tstate->exc_value = value; tstate->exc_traceback = tb; Py_XDECREF(tmp_type); Py_XDECREF(tmp_value); Py_XDECREF(tmp_tb); #else PyErr_SetExcInfo(type, value, tb); #endif } static int __Pyx_GetException(PyObject **type, PyObject **value, PyObject **tb) { PyObject *local_type, *local_value, *local_tb; #if CYTHON_COMPILING_IN_CPYTHON PyObject *tmp_type, *tmp_value, *tmp_tb; PyThreadState *tstate = PyThreadState_GET(); local_type = tstate->curexc_type; local_value = tstate->curexc_value; local_tb = tstate->curexc_traceback; tstate->curexc_type = 0; tstate->curexc_value = 0; tstate->curexc_traceback = 0; #else PyErr_Fetch(&local_type, &local_value, &local_tb); #endif PyErr_NormalizeException(&local_type, &local_value, &local_tb); #if CYTHON_COMPILING_IN_CPYTHON if (unlikely(tstate->curexc_type)) #else if (unlikely(PyErr_Occurred())) #endif goto bad; #if PY_MAJOR_VERSION >= 3 if (local_tb) { if (unlikely(PyException_SetTraceback(local_value, local_tb) < 0)) goto bad; } #endif Py_XINCREF(local_tb); Py_XINCREF(local_type); Py_XINCREF(local_value); *type = local_type; *value = local_value; *tb = local_tb; #if CYTHON_COMPILING_IN_CPYTHON tmp_type = tstate->exc_type; tmp_value = tstate->exc_value; tmp_tb = tstate->exc_traceback; tstate->exc_type = local_type; tstate->exc_value = local_value; tstate->exc_traceback = local_tb; Py_XDECREF(tmp_type); Py_XDECREF(tmp_value); Py_XDECREF(tmp_tb); #else PyErr_SetExcInfo(local_type, local_value, local_tb); #endif return 0; bad: *type = 0; *value = 0; *tb = 0; Py_XDECREF(local_type); Py_XDECREF(local_value); Py_XDECREF(local_tb); return -1; } #if CYTHON_COMPILING_IN_CPYTHON static CYTHON_INLINE PyObject* __Pyx_PyObject_CallNoArg(PyObject *func) { #ifdef __Pyx_CyFunction_USED if (likely(PyCFunction_Check(func) || PyObject_TypeCheck(func, __pyx_CyFunctionType))) { #else if (likely(PyCFunction_Check(func))) { #endif if (likely(PyCFunction_GET_FLAGS(func) & METH_NOARGS)) { return __Pyx_PyObject_CallMethO(func, NULL); } } return __Pyx_PyObject_Call(func, __pyx_empty_tuple, NULL); } #endif static void __Pyx_RaiseArgumentTypeInvalid(const char* name, PyObject *obj, PyTypeObject *type) { PyErr_Format(PyExc_TypeError, "Argument '%.200s' has incorrect type (expected %.200s, got %.200s)", name, type->tp_name, Py_TYPE(obj)->tp_name); } static CYTHON_INLINE int __Pyx_ArgTypeTest(PyObject *obj, PyTypeObject *type, int none_allowed, const char *name, int exact) { if (unlikely(!type)) { PyErr_SetString(PyExc_SystemError, "Missing type object"); return 0; } if (none_allowed && obj == Py_None) return 1; else if (exact) { if (likely(Py_TYPE(obj) == type)) return 1; #if PY_MAJOR_VERSION == 2 else if ((type == &PyBaseString_Type) && likely(__Pyx_PyBaseString_CheckExact(obj))) return 1; #endif } else { if (likely(PyObject_TypeCheck(obj, type))) return 1; } __Pyx_RaiseArgumentTypeInvalid(name, obj, type); return 0; } static void __Pyx_RaiseArgtupleInvalid( const char* func_name, int exact, Py_ssize_t num_min, Py_ssize_t num_max, Py_ssize_t num_found) { Py_ssize_t num_expected; const char *more_or_less; if (num_found < num_min) { num_expected = num_min; more_or_less = "at least"; } else { num_expected = num_max; more_or_less = "at most"; } if (exact) { more_or_less = "exactly"; } PyErr_Format(PyExc_TypeError, "%.200s() takes %.8s %" CYTHON_FORMAT_SSIZE_T "d positional argument%.1s (%" CYTHON_FORMAT_SSIZE_T "d given)", func_name, more_or_less, num_expected, (num_expected == 1) ? "" : "s", num_found); } static CYTHON_INLINE int __Pyx_CheckKeywordStrings( PyObject *kwdict, const char* function_name, int kw_allowed) { PyObject* key = 0; Py_ssize_t pos = 0; #if CYTHON_COMPILING_IN_PYPY if (!kw_allowed && PyDict_Next(kwdict, &pos, &key, 0)) goto invalid_keyword; return 1; #else while (PyDict_Next(kwdict, &pos, &key, 0)) { #if PY_MAJOR_VERSION < 3 if (unlikely(!PyString_CheckExact(key)) && unlikely(!PyString_Check(key))) #endif if (unlikely(!PyUnicode_Check(key))) goto invalid_keyword_type; } if ((!kw_allowed) && unlikely(key)) goto invalid_keyword; return 1; invalid_keyword_type: PyErr_Format(PyExc_TypeError, "%.200s() keywords must be strings", function_name); return 0; #endif invalid_keyword: PyErr_Format(PyExc_TypeError, #if PY_MAJOR_VERSION < 3 "%.200s() got an unexpected keyword argument '%.200s'", function_name, PyString_AsString(key)); #else "%s() got an unexpected keyword argument '%U'", function_name, key); #endif return 0; } static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Generic(PyObject *o, PyObject* j) { PyObject *r; if (!j) return NULL; r = PyObject_GetItem(o, j); Py_DECREF(j); return r; } static CYTHON_INLINE PyObject *__Pyx_GetItemInt_List_Fast(PyObject *o, Py_ssize_t i, CYTHON_NCP_UNUSED int wraparound, CYTHON_NCP_UNUSED int boundscheck) { #if CYTHON_COMPILING_IN_CPYTHON if (wraparound & unlikely(i < 0)) i += PyList_GET_SIZE(o); if ((!boundscheck) || likely((0 <= i) & (i < PyList_GET_SIZE(o)))) { PyObject *r = PyList_GET_ITEM(o, i); Py_INCREF(r); return r; } return __Pyx_GetItemInt_Generic(o, PyInt_FromSsize_t(i)); #else return PySequence_GetItem(o, i); #endif } static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Tuple_Fast(PyObject *o, Py_ssize_t i, CYTHON_NCP_UNUSED int wraparound, CYTHON_NCP_UNUSED int boundscheck) { #if CYTHON_COMPILING_IN_CPYTHON if (wraparound & unlikely(i < 0)) i += PyTuple_GET_SIZE(o); if ((!boundscheck) || likely((0 <= i) & (i < PyTuple_GET_SIZE(o)))) { PyObject *r = PyTuple_GET_ITEM(o, i); Py_INCREF(r); return r; } return __Pyx_GetItemInt_Generic(o, PyInt_FromSsize_t(i)); #else return PySequence_GetItem(o, i); #endif } static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Fast(PyObject *o, Py_ssize_t i, int is_list, CYTHON_NCP_UNUSED int wraparound, CYTHON_NCP_UNUSED int boundscheck) { #if CYTHON_COMPILING_IN_CPYTHON if (is_list || PyList_CheckExact(o)) { Py_ssize_t n = ((!wraparound) | likely(i >= 0)) ? i : i + PyList_GET_SIZE(o); if ((!boundscheck) || (likely((n >= 0) & (n < PyList_GET_SIZE(o))))) { PyObject *r = PyList_GET_ITEM(o, n); Py_INCREF(r); return r; } } else if (PyTuple_CheckExact(o)) { Py_ssize_t n = ((!wraparound) | likely(i >= 0)) ? i : i + PyTuple_GET_SIZE(o); if ((!boundscheck) || likely((n >= 0) & (n < PyTuple_GET_SIZE(o)))) { PyObject *r = PyTuple_GET_ITEM(o, n); Py_INCREF(r); return r; } } else { PySequenceMethods *m = Py_TYPE(o)->tp_as_sequence; if (likely(m && m->sq_item)) { if (wraparound && unlikely(i < 0) && likely(m->sq_length)) { Py_ssize_t l = m->sq_length(o); if (likely(l >= 0)) { i += l; } else { if (PyErr_ExceptionMatches(PyExc_OverflowError)) PyErr_Clear(); else return NULL; } } return m->sq_item(o, i); } } #else if (is_list || PySequence_Check(o)) { return PySequence_GetItem(o, i); } #endif return __Pyx_GetItemInt_Generic(o, PyInt_FromSsize_t(i)); } static CYTHON_INLINE PyObject* __Pyx_PyObject_GetSlice(PyObject* obj, Py_ssize_t cstart, Py_ssize_t cstop, PyObject** _py_start, PyObject** _py_stop, PyObject** _py_slice, int has_cstart, int has_cstop, CYTHON_UNUSED int wraparound) { #if CYTHON_COMPILING_IN_CPYTHON PyMappingMethods* mp; #if PY_MAJOR_VERSION < 3 PySequenceMethods* ms = Py_TYPE(obj)->tp_as_sequence; if (likely(ms && ms->sq_slice)) { if (!has_cstart) { if (_py_start && (*_py_start != Py_None)) { cstart = __Pyx_PyIndex_AsSsize_t(*_py_start); if ((cstart == (Py_ssize_t)-1) && PyErr_Occurred()) goto bad; } else cstart = 0; } if (!has_cstop) { if (_py_stop && (*_py_stop != Py_None)) { cstop = __Pyx_PyIndex_AsSsize_t(*_py_stop); if ((cstop == (Py_ssize_t)-1) && PyErr_Occurred()) goto bad; } else cstop = PY_SSIZE_T_MAX; } if (wraparound && unlikely((cstart < 0) | (cstop < 0)) && likely(ms->sq_length)) { Py_ssize_t l = ms->sq_length(obj); if (likely(l >= 0)) { if (cstop < 0) { cstop += l; if (cstop < 0) cstop = 0; } if (cstart < 0) { cstart += l; if (cstart < 0) cstart = 0; } } else { if (PyErr_ExceptionMatches(PyExc_OverflowError)) PyErr_Clear(); else goto bad; } } return ms->sq_slice(obj, cstart, cstop); } #endif mp = Py_TYPE(obj)->tp_as_mapping; if (likely(mp && mp->mp_subscript)) #endif { PyObject* result; PyObject *py_slice, *py_start, *py_stop; if (_py_slice) { py_slice = *_py_slice; } else { PyObject* owned_start = NULL; PyObject* owned_stop = NULL; if (_py_start) { py_start = *_py_start; } else { if (has_cstart) { owned_start = py_start = PyInt_FromSsize_t(cstart); if (unlikely(!py_start)) goto bad; } else py_start = Py_None; } if (_py_stop) { py_stop = *_py_stop; } else { if (has_cstop) { owned_stop = py_stop = PyInt_FromSsize_t(cstop); if (unlikely(!py_stop)) { Py_XDECREF(owned_start); goto bad; } } else py_stop = Py_None; } py_slice = PySlice_New(py_start, py_stop, Py_None); Py_XDECREF(owned_start); Py_XDECREF(owned_stop); if (unlikely(!py_slice)) goto bad; } #if CYTHON_COMPILING_IN_CPYTHON result = mp->mp_subscript(obj, py_slice); #else result = PyObject_GetItem(obj, py_slice); #endif if (!_py_slice) { Py_DECREF(py_slice); } return result; } PyErr_Format(PyExc_TypeError, "'%.200s' object is unsliceable", Py_TYPE(obj)->tp_name); bad: return NULL; } static double __Pyx__PyObject_AsDouble(PyObject* obj) { PyObject* float_value; #if CYTHON_COMPILING_IN_PYPY float_value = PyNumber_Float(obj); if (0) goto bad; #else PyNumberMethods *nb = Py_TYPE(obj)->tp_as_number; if (likely(nb) && likely(nb->nb_float)) { float_value = nb->nb_float(obj); if (likely(float_value) && unlikely(!PyFloat_Check(float_value))) { PyErr_Format(PyExc_TypeError, "__float__ returned non-float (type %.200s)", Py_TYPE(float_value)->tp_name); Py_DECREF(float_value); goto bad; } } else if (PyUnicode_CheckExact(obj) || PyBytes_CheckExact(obj)) { #if PY_MAJOR_VERSION >= 3 float_value = PyFloat_FromString(obj); #else float_value = PyFloat_FromString(obj, 0); #endif } else { PyObject* args = PyTuple_New(1); if (unlikely(!args)) goto bad; PyTuple_SET_ITEM(args, 0, obj); float_value = PyObject_Call((PyObject*)&PyFloat_Type, args, 0); PyTuple_SET_ITEM(args, 0, 0); Py_DECREF(args); } #endif if (likely(float_value)) { double value = PyFloat_AS_DOUBLE(float_value); Py_DECREF(float_value); return value; } bad: return (double)-1; } #if CYTHON_USE_PYLONG_INTERNALS #include "longintrepr.h" #endif #if CYTHON_COMPILING_IN_CPYTHON static PyObject* __Pyx_PyInt_EqObjC(PyObject *op1, PyObject *op2, CYTHON_UNUSED long intval, CYTHON_UNUSED int inplace) { if (op1 == op2) { Py_RETURN_TRUE; } #if PY_MAJOR_VERSION < 3 if (likely(PyInt_CheckExact(op1))) { const long b = intval; long a = PyInt_AS_LONG(op1); if (a == b) { Py_RETURN_TRUE; } else { Py_RETURN_FALSE; } } #endif #if CYTHON_USE_PYLONG_INTERNALS && PY_MAJOR_VERSION >= 3 if (likely(PyLong_CheckExact(op1))) { const long b = intval; long a; const digit* digits = ((PyLongObject*)op1)->ob_digit; const Py_ssize_t size = Py_SIZE(op1); if (likely(__Pyx_sst_abs(size) <= 1)) { a = likely(size) ? digits[0] : 0; if (size == -1) a = -a; } else { switch (size) { case -2: if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) { a = -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])); break; } case 2: if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) { a = (long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])); break; } case -3: if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) { a = -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])); break; } case 3: if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) { a = (long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])); break; } case -4: if (8 * sizeof(long) - 1 > 4 * PyLong_SHIFT) { a = -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])); break; } case 4: if (8 * sizeof(long) - 1 > 4 * PyLong_SHIFT) { a = (long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])); break; } #if PyLong_SHIFT < 30 && PyLong_SHIFT != 15 default: return PyLong_Type.tp_richcompare(op1, op2, Py_EQ); #else default: Py_RETURN_FALSE; #endif } } if (a == b) { Py_RETURN_TRUE; } else { Py_RETURN_FALSE; } } #endif if (PyFloat_CheckExact(op1)) { const long b = intval; double a = PyFloat_AS_DOUBLE(op1); if ((double)a == (double)b) { Py_RETURN_TRUE; } else { Py_RETURN_FALSE; } } return PyObject_RichCompare(op1, op2, Py_EQ); } #endif static void __Pyx_RaiseDoubleKeywordsError( const char* func_name, PyObject* kw_name) { PyErr_Format(PyExc_TypeError, #if PY_MAJOR_VERSION >= 3 "%s() got multiple values for keyword argument '%U'", func_name, kw_name); #else "%s() got multiple values for keyword argument '%s'", func_name, PyString_AsString(kw_name)); #endif } static int __Pyx_ParseOptionalKeywords( PyObject *kwds, PyObject **argnames[], PyObject *kwds2, PyObject *values[], Py_ssize_t num_pos_args, const char* function_name) { PyObject *key = 0, *value = 0; Py_ssize_t pos = 0; PyObject*** name; PyObject*** first_kw_arg = argnames + num_pos_args; while (PyDict_Next(kwds, &pos, &key, &value)) { name = first_kw_arg; while (*name && (**name != key)) name++; if (*name) { values[name-argnames] = value; continue; } name = first_kw_arg; #if PY_MAJOR_VERSION < 3 if (likely(PyString_CheckExact(key)) || likely(PyString_Check(key))) { while (*name) { if ((CYTHON_COMPILING_IN_PYPY || PyString_GET_SIZE(**name) == PyString_GET_SIZE(key)) && _PyString_Eq(**name, key)) { values[name-argnames] = value; break; } name++; } if (*name) continue; else { PyObject*** argname = argnames; while (argname != first_kw_arg) { if ((**argname == key) || ( (CYTHON_COMPILING_IN_PYPY || PyString_GET_SIZE(**argname) == PyString_GET_SIZE(key)) && _PyString_Eq(**argname, key))) { goto arg_passed_twice; } argname++; } } } else #endif if (likely(PyUnicode_Check(key))) { while (*name) { int cmp = (**name == key) ? 0 : #if !CYTHON_COMPILING_IN_PYPY && PY_MAJOR_VERSION >= 3 (PyUnicode_GET_SIZE(**name) != PyUnicode_GET_SIZE(key)) ? 1 : #endif PyUnicode_Compare(**name, key); if (cmp < 0 && unlikely(PyErr_Occurred())) goto bad; if (cmp == 0) { values[name-argnames] = value; break; } name++; } if (*name) continue; else { PyObject*** argname = argnames; while (argname != first_kw_arg) { int cmp = (**argname == key) ? 0 : #if !CYTHON_COMPILING_IN_PYPY && PY_MAJOR_VERSION >= 3 (PyUnicode_GET_SIZE(**argname) != PyUnicode_GET_SIZE(key)) ? 1 : #endif PyUnicode_Compare(**argname, key); if (cmp < 0 && unlikely(PyErr_Occurred())) goto bad; if (cmp == 0) goto arg_passed_twice; argname++; } } } else goto invalid_keyword_type; if (kwds2) { if (unlikely(PyDict_SetItem(kwds2, key, value))) goto bad; } else { goto invalid_keyword; } } return 0; arg_passed_twice: __Pyx_RaiseDoubleKeywordsError(function_name, key); goto bad; invalid_keyword_type: PyErr_Format(PyExc_TypeError, "%.200s() keywords must be strings", function_name); goto bad; invalid_keyword: PyErr_Format(PyExc_TypeError, #if PY_MAJOR_VERSION < 3 "%.200s() got an unexpected keyword argument '%.200s'", function_name, PyString_AsString(key)); #else "%s() got an unexpected keyword argument '%U'", function_name, key); #endif bad: return -1; } #if CYTHON_COMPILING_IN_CPYTHON static PyObject* __Pyx_PyInt_SubtractCObj(PyObject *op1, PyObject *op2, CYTHON_UNUSED long intval, CYTHON_UNUSED int inplace) { #if PY_MAJOR_VERSION < 3 if (likely(PyInt_CheckExact(op2))) { const long a = intval; long x; long b = PyInt_AS_LONG(op2); x = (long)((unsigned long)a - b); if (likely((x^a) >= 0 || (x^~b) >= 0)) return PyInt_FromLong(x); return PyLong_Type.tp_as_number->nb_subtract(op1, op2); } #endif #if CYTHON_USE_PYLONG_INTERNALS && PY_MAJOR_VERSION >= 3 if (likely(PyLong_CheckExact(op2))) { const long a = intval; long b, x; const PY_LONG_LONG lla = intval; PY_LONG_LONG llb, llx; const digit* digits = ((PyLongObject*)op2)->ob_digit; const Py_ssize_t size = Py_SIZE(op2); if (likely(__Pyx_sst_abs(size) <= 1)) { b = likely(size) ? digits[0] : 0; if (size == -1) b = -b; } else { switch (size) { case -2: if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) { b = -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])); break; } else if (8 * sizeof(PY_LONG_LONG) - 1 > 2 * PyLong_SHIFT) { llb = -(PY_LONG_LONG) (((((unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0])); goto long_long; } case 2: if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) { b = (long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])); break; } else if (8 * sizeof(PY_LONG_LONG) - 1 > 2 * PyLong_SHIFT) { llb = (PY_LONG_LONG) (((((unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0])); goto long_long; } case -3: if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) { b = -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])); break; } else if (8 * sizeof(PY_LONG_LONG) - 1 > 3 * PyLong_SHIFT) { llb = -(PY_LONG_LONG) (((((((unsigned PY_LONG_LONG)digits[2]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0])); goto long_long; } case 3: if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) { b = (long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])); break; } else if (8 * sizeof(PY_LONG_LONG) - 1 > 3 * PyLong_SHIFT) { llb = (PY_LONG_LONG) (((((((unsigned PY_LONG_LONG)digits[2]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0])); goto long_long; } case -4: if (8 * sizeof(long) - 1 > 4 * PyLong_SHIFT) { b = -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])); break; } else if (8 * sizeof(PY_LONG_LONG) - 1 > 4 * PyLong_SHIFT) { llb = -(PY_LONG_LONG) (((((((((unsigned PY_LONG_LONG)digits[3]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[2]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0])); goto long_long; } case 4: if (8 * sizeof(long) - 1 > 4 * PyLong_SHIFT) { b = (long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])); break; } else if (8 * sizeof(PY_LONG_LONG) - 1 > 4 * PyLong_SHIFT) { llb = (PY_LONG_LONG) (((((((((unsigned PY_LONG_LONG)digits[3]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[2]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0])); goto long_long; } default: return PyLong_Type.tp_as_number->nb_subtract(op1, op2); } } x = a - b; return PyLong_FromLong(x); long_long: llx = lla - llb; return PyLong_FromLongLong(llx); } #endif if (PyFloat_CheckExact(op2)) { const long a = intval; double b = PyFloat_AS_DOUBLE(op2); double result; PyFPE_START_PROTECT("subtract", return NULL) result = ((double)a) - (double)b; PyFPE_END_PROTECT(result) return PyFloat_FromDouble(result); } return (inplace ? PyNumber_InPlaceSubtract : PyNumber_Subtract)(op1, op2); } #endif static CYTHON_INLINE double __Pyx_mod_double(double a, double b) { double r = fmod(a, b); r += ((r != 0) & ((r < 0) ^ (b < 0))) * b; return r; } #if CYTHON_COMPILING_IN_CPYTHON static PyObject* __Pyx_PyFloat_RemainderObjC(PyObject *op1, PyObject *op2, double floatval, CYTHON_UNUSED int inplace) { const double b = floatval; double a, result; if (likely(PyFloat_CheckExact(op1))) { a = PyFloat_AS_DOUBLE(op1); } else #if PY_MAJOR_VERSION < 3 if (likely(PyInt_CheckExact(op1))) { a = (double) PyInt_AS_LONG(op1); } else #endif if (likely(PyLong_CheckExact(op1))) { #if CYTHON_USE_PYLONG_INTERNALS && PY_MAJOR_VERSION >= 3 const digit* digits = ((PyLongObject*)op1)->ob_digit; const Py_ssize_t size = Py_SIZE(op1); switch (size) { case 0: a = 0.0; break; case -1: a = -(double) digits[0]; break; case 1: a = (double) digits[0]; break; case -2: case 2: if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT && ((8 * sizeof(unsigned long) < 53) || (1 * PyLong_SHIFT < 53))) { a = (double) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])); if ((8 * sizeof(unsigned long) < 53) || (2 * PyLong_SHIFT < 53) || (a < (double) (1L<<53))) { if (size == -2) a = -a; break; } } case -3: case 3: if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT && ((8 * sizeof(unsigned long) < 53) || (2 * PyLong_SHIFT < 53))) { a = (double) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])); if ((8 * sizeof(unsigned long) < 53) || (3 * PyLong_SHIFT < 53) || (a < (double) (1L<<53))) { if (size == -3) a = -a; break; } } case -4: case 4: if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT && ((8 * sizeof(unsigned long) < 53) || (3 * PyLong_SHIFT < 53))) { a = (double) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])); if ((8 * sizeof(unsigned long) < 53) || (4 * PyLong_SHIFT < 53) || (a < (double) (1L<<53))) { if (size == -4) a = -a; break; } } default: #else { #endif a = PyLong_AsDouble(op1); if (unlikely(a == -1.0 && PyErr_Occurred())) return NULL; } } else { return (inplace ? PyNumber_InPlaceRemainder : PyNumber_Remainder)(op1, op2); } PyFPE_START_PROTECT("remainder", return NULL) result = fmod(a, b); if (result) result += ((result < 0) ^ (b < 0)) * b; else result = copysign(0.0, b); PyFPE_END_PROTECT(result) return PyFloat_FromDouble(result); } #endif #if CYTHON_COMPILING_IN_CPYTHON static PyObject* __Pyx_PyFloat_DivideObjC(PyObject *op1, PyObject *op2, double floatval, CYTHON_UNUSED int inplace) { const double b = floatval; double a, result; if (likely(PyFloat_CheckExact(op1))) { a = PyFloat_AS_DOUBLE(op1); } else #if PY_MAJOR_VERSION < 3 if (likely(PyInt_CheckExact(op1))) { a = (double) PyInt_AS_LONG(op1); } else #endif if (likely(PyLong_CheckExact(op1))) { #if CYTHON_USE_PYLONG_INTERNALS && PY_MAJOR_VERSION >= 3 const digit* digits = ((PyLongObject*)op1)->ob_digit; const Py_ssize_t size = Py_SIZE(op1); switch (size) { case 0: a = 0.0; break; case -1: a = -(double) digits[0]; break; case 1: a = (double) digits[0]; break; case -2: case 2: if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT && ((8 * sizeof(unsigned long) < 53) || (1 * PyLong_SHIFT < 53))) { a = (double) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])); if ((8 * sizeof(unsigned long) < 53) || (2 * PyLong_SHIFT < 53) || (a < (double) (1L<<53))) { if (size == -2) a = -a; break; } } case -3: case 3: if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT && ((8 * sizeof(unsigned long) < 53) || (2 * PyLong_SHIFT < 53))) { a = (double) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])); if ((8 * sizeof(unsigned long) < 53) || (3 * PyLong_SHIFT < 53) || (a < (double) (1L<<53))) { if (size == -3) a = -a; break; } } case -4: case 4: if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT && ((8 * sizeof(unsigned long) < 53) || (3 * PyLong_SHIFT < 53))) { a = (double) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])); if ((8 * sizeof(unsigned long) < 53) || (4 * PyLong_SHIFT < 53) || (a < (double) (1L<<53))) { if (size == -4) a = -a; break; } } default: #else { #endif a = PyLong_AsDouble(op1); if (unlikely(a == -1.0 && PyErr_Occurred())) return NULL; } } else { return (inplace ? __Pyx_PyNumber_InPlaceDivide(op1, op2) : __Pyx_PyNumber_Divide(op1, op2)); } PyFPE_START_PROTECT("divide", return NULL) result = a / b; PyFPE_END_PROTECT(result) return PyFloat_FromDouble(result); } #endif static CYTHON_INLINE void __Pyx_RaiseClosureNameError(const char *varname) { PyErr_Format(PyExc_NameError, "free variable '%s' referenced before assignment in enclosing scope", varname); } static int __Pyx_SetVtable(PyObject *dict, void *vtable) { #if PY_VERSION_HEX >= 0x02070000 PyObject *ob = PyCapsule_New(vtable, 0, 0); #else PyObject *ob = PyCObject_FromVoidPtr(vtable, 0); #endif if (!ob) goto bad; if (PyDict_SetItem(dict, __pyx_n_s_pyx_vtable, ob) < 0) goto bad; Py_DECREF(ob); return 0; bad: Py_XDECREF(ob); return -1; } static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list, int level) { PyObject *empty_list = 0; PyObject *module = 0; PyObject *global_dict = 0; PyObject *empty_dict = 0; PyObject *list; #if PY_VERSION_HEX < 0x03030000 PyObject *py_import; py_import = __Pyx_PyObject_GetAttrStr(__pyx_b, __pyx_n_s_import); if (!py_import) goto bad; #endif if (from_list) list = from_list; else { empty_list = PyList_New(0); if (!empty_list) goto bad; list = empty_list; } global_dict = PyModule_GetDict(__pyx_m); if (!global_dict) goto bad; empty_dict = PyDict_New(); if (!empty_dict) goto bad; { #if PY_MAJOR_VERSION >= 3 if (level == -1) { if (strchr(__Pyx_MODULE_NAME, '.')) { #if PY_VERSION_HEX < 0x03030000 PyObject *py_level = PyInt_FromLong(1); if (!py_level) goto bad; module = PyObject_CallFunctionObjArgs(py_import, name, global_dict, empty_dict, list, py_level, NULL); Py_DECREF(py_level); #else module = PyImport_ImportModuleLevelObject( name, global_dict, empty_dict, list, 1); #endif if (!module) { if (!PyErr_ExceptionMatches(PyExc_ImportError)) goto bad; PyErr_Clear(); } } level = 0; } #endif if (!module) { #if PY_VERSION_HEX < 0x03030000 PyObject *py_level = PyInt_FromLong(level); if (!py_level) goto bad; module = PyObject_CallFunctionObjArgs(py_import, name, global_dict, empty_dict, list, py_level, NULL); Py_DECREF(py_level); #else module = PyImport_ImportModuleLevelObject( name, global_dict, empty_dict, list, level); #endif } } bad: #if PY_VERSION_HEX < 0x03030000 Py_XDECREF(py_import); #endif Py_XDECREF(empty_list); Py_XDECREF(empty_dict); return module; } static int __pyx_bisect_code_objects(__Pyx_CodeObjectCacheEntry* entries, int count, int code_line) { int start = 0, mid = 0, end = count - 1; if (end >= 0 && code_line > entries[end].code_line) { return count; } while (start < end) { mid = start + (end - start) / 2; if (code_line < entries[mid].code_line) { end = mid; } else if (code_line > entries[mid].code_line) { start = mid + 1; } else { return mid; } } if (code_line <= entries[mid].code_line) { return mid; } else { return mid + 1; } } static PyCodeObject *__pyx_find_code_object(int code_line) { PyCodeObject* code_object; int pos; if (unlikely(!code_line) || unlikely(!__pyx_code_cache.entries)) { return NULL; } pos = __pyx_bisect_code_objects(__pyx_code_cache.entries, __pyx_code_cache.count, code_line); if (unlikely(pos >= __pyx_code_cache.count) || unlikely(__pyx_code_cache.entries[pos].code_line != code_line)) { return NULL; } code_object = __pyx_code_cache.entries[pos].code_object; Py_INCREF(code_object); return code_object; } static void __pyx_insert_code_object(int code_line, PyCodeObject* code_object) { int pos, i; __Pyx_CodeObjectCacheEntry* entries = __pyx_code_cache.entries; if (unlikely(!code_line)) { return; } if (unlikely(!entries)) { entries = (__Pyx_CodeObjectCacheEntry*)PyMem_Malloc(64*sizeof(__Pyx_CodeObjectCacheEntry)); if (likely(entries)) { __pyx_code_cache.entries = entries; __pyx_code_cache.max_count = 64; __pyx_code_cache.count = 1; entries[0].code_line = code_line; entries[0].code_object = code_object; Py_INCREF(code_object); } return; } pos = __pyx_bisect_code_objects(__pyx_code_cache.entries, __pyx_code_cache.count, code_line); if ((pos < __pyx_code_cache.count) && unlikely(__pyx_code_cache.entries[pos].code_line == code_line)) { PyCodeObject* tmp = entries[pos].code_object; entries[pos].code_object = code_object; Py_DECREF(tmp); return; } if (__pyx_code_cache.count == __pyx_code_cache.max_count) { int new_max = __pyx_code_cache.max_count + 64; entries = (__Pyx_CodeObjectCacheEntry*)PyMem_Realloc( __pyx_code_cache.entries, (size_t)new_max*sizeof(__Pyx_CodeObjectCacheEntry)); if (unlikely(!entries)) { return; } __pyx_code_cache.entries = entries; __pyx_code_cache.max_count = new_max; } for (i=__pyx_code_cache.count; i>pos; i--) { entries[i] = entries[i-1]; } entries[pos].code_line = code_line; entries[pos].code_object = code_object; __pyx_code_cache.count++; Py_INCREF(code_object); } #include "compile.h" #include "frameobject.h" #include "traceback.h" static PyCodeObject* __Pyx_CreateCodeObjectForTraceback( const char *funcname, int c_line, int py_line, const char *filename) { PyCodeObject *py_code = 0; PyObject *py_srcfile = 0; PyObject *py_funcname = 0; #if PY_MAJOR_VERSION < 3 py_srcfile = PyString_FromString(filename); #else py_srcfile = PyUnicode_FromString(filename); #endif if (!py_srcfile) goto bad; if (c_line) { #if PY_MAJOR_VERSION < 3 py_funcname = PyString_FromFormat( "%s (%s:%d)", funcname, __pyx_cfilenm, c_line); #else py_funcname = PyUnicode_FromFormat( "%s (%s:%d)", funcname, __pyx_cfilenm, c_line); #endif } else { #if PY_MAJOR_VERSION < 3 py_funcname = PyString_FromString(funcname); #else py_funcname = PyUnicode_FromString(funcname); #endif } if (!py_funcname) goto bad; py_code = __Pyx_PyCode_New( 0, 0, 0, 0, 0, __pyx_empty_bytes, /*PyObject *code,*/ __pyx_empty_tuple, /*PyObject *consts,*/ __pyx_empty_tuple, /*PyObject *names,*/ __pyx_empty_tuple, /*PyObject *varnames,*/ __pyx_empty_tuple, /*PyObject *freevars,*/ __pyx_empty_tuple, /*PyObject *cellvars,*/ py_srcfile, /*PyObject *filename,*/ py_funcname, /*PyObject *name,*/ py_line, __pyx_empty_bytes /*PyObject *lnotab*/ ); Py_DECREF(py_srcfile); Py_DECREF(py_funcname); return py_code; bad: Py_XDECREF(py_srcfile); Py_XDECREF(py_funcname); return NULL; } static void __Pyx_AddTraceback(const char *funcname, int c_line, int py_line, const char *filename) { PyCodeObject *py_code = 0; PyFrameObject *py_frame = 0; py_code = __pyx_find_code_object(c_line ? c_line : py_line); if (!py_code) { py_code = __Pyx_CreateCodeObjectForTraceback( funcname, c_line, py_line, filename); if (!py_code) goto bad; __pyx_insert_code_object(c_line ? c_line : py_line, py_code); } py_frame = PyFrame_New( PyThreadState_GET(), /*PyThreadState *tstate,*/ py_code, /*PyCodeObject *code,*/ __pyx_d, /*PyObject *globals,*/ 0 /*PyObject *locals*/ ); if (!py_frame) goto bad; py_frame->f_lineno = py_line; PyTraceBack_Here(py_frame); bad: Py_XDECREF(py_code); Py_XDECREF(py_frame); } #define __PYX_VERIFY_RETURN_INT(target_type, func_type, func_value)\ __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, 0) #define __PYX_VERIFY_RETURN_INT_EXC(target_type, func_type, func_value)\ __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, 1) #define __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, exc)\ {\ func_type value = func_value;\ if (sizeof(target_type) < sizeof(func_type)) {\ if (unlikely(value != (func_type) (target_type) value)) {\ func_type zero = 0;\ if (exc && unlikely(value == (func_type)-1 && PyErr_Occurred()))\ return (target_type) -1;\ if (is_unsigned && unlikely(value < zero))\ goto raise_neg_overflow;\ else\ goto raise_overflow;\ }\ }\ return (target_type) value;\ } static CYTHON_INLINE int __Pyx_PyInt_As_int(PyObject *x) { const int neg_one = (int) -1, const_zero = (int) 0; const int is_unsigned = neg_one > const_zero; #if PY_MAJOR_VERSION < 3 if (likely(PyInt_Check(x))) { if (sizeof(int) < sizeof(long)) { __PYX_VERIFY_RETURN_INT(int, long, PyInt_AS_LONG(x)) } else { long val = PyInt_AS_LONG(x); if (is_unsigned && unlikely(val < 0)) { goto raise_neg_overflow; } return (int) val; } } else #endif if (likely(PyLong_Check(x))) { if (is_unsigned) { #if CYTHON_USE_PYLONG_INTERNALS const digit* digits = ((PyLongObject*)x)->ob_digit; switch (Py_SIZE(x)) { case 0: return (int) 0; case 1: __PYX_VERIFY_RETURN_INT(int, digit, digits[0]) case 2: if (8 * sizeof(int) > 1 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(int) >= 2 * PyLong_SHIFT) { return (int) (((((int)digits[1]) << PyLong_SHIFT) | (int)digits[0])); } } break; case 3: if (8 * sizeof(int) > 2 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(int) >= 3 * PyLong_SHIFT) { return (int) (((((((int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0])); } } break; case 4: if (8 * sizeof(int) > 3 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(int) >= 4 * PyLong_SHIFT) { return (int) (((((((((int)digits[3]) << PyLong_SHIFT) | (int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0])); } } break; } #endif #if CYTHON_COMPILING_IN_CPYTHON if (unlikely(Py_SIZE(x) < 0)) { goto raise_neg_overflow; } #else { int result = PyObject_RichCompareBool(x, Py_False, Py_LT); if (unlikely(result < 0)) return (int) -1; if (unlikely(result == 1)) goto raise_neg_overflow; } #endif if (sizeof(int) <= sizeof(unsigned long)) { __PYX_VERIFY_RETURN_INT_EXC(int, unsigned long, PyLong_AsUnsignedLong(x)) } else if (sizeof(int) <= sizeof(unsigned PY_LONG_LONG)) { __PYX_VERIFY_RETURN_INT_EXC(int, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x)) } } else { #if CYTHON_USE_PYLONG_INTERNALS const digit* digits = ((PyLongObject*)x)->ob_digit; switch (Py_SIZE(x)) { case 0: return (int) 0; case -1: __PYX_VERIFY_RETURN_INT(int, sdigit, (sdigit) (-(sdigit)digits[0])) case 1: __PYX_VERIFY_RETURN_INT(int, digit, +digits[0]) case -2: if (8 * sizeof(int) - 1 > 1 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(int, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(int) - 1 > 2 * PyLong_SHIFT) { return (int) (((int)-1)*(((((int)digits[1]) << PyLong_SHIFT) | (int)digits[0]))); } } break; case 2: if (8 * sizeof(int) > 1 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(int) - 1 > 2 * PyLong_SHIFT) { return (int) ((((((int)digits[1]) << PyLong_SHIFT) | (int)digits[0]))); } } break; case -3: if (8 * sizeof(int) - 1 > 2 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(int, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(int) - 1 > 3 * PyLong_SHIFT) { return (int) (((int)-1)*(((((((int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0]))); } } break; case 3: if (8 * sizeof(int) > 2 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(int) - 1 > 3 * PyLong_SHIFT) { return (int) ((((((((int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0]))); } } break; case -4: if (8 * sizeof(int) - 1 > 3 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(int, long, -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(int) - 1 > 4 * PyLong_SHIFT) { return (int) (((int)-1)*(((((((((int)digits[3]) << PyLong_SHIFT) | (int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0]))); } } break; case 4: if (8 * sizeof(int) > 3 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(int) - 1 > 4 * PyLong_SHIFT) { return (int) ((((((((((int)digits[3]) << PyLong_SHIFT) | (int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0]))); } } break; } #endif if (sizeof(int) <= sizeof(long)) { __PYX_VERIFY_RETURN_INT_EXC(int, long, PyLong_AsLong(x)) } else if (sizeof(int) <= sizeof(PY_LONG_LONG)) { __PYX_VERIFY_RETURN_INT_EXC(int, PY_LONG_LONG, PyLong_AsLongLong(x)) } } { #if CYTHON_COMPILING_IN_PYPY && !defined(_PyLong_AsByteArray) PyErr_SetString(PyExc_RuntimeError, "_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers"); #else int val; PyObject *v = __Pyx_PyNumber_Int(x); #if PY_MAJOR_VERSION < 3 if (likely(v) && !PyLong_Check(v)) { PyObject *tmp = v; v = PyNumber_Long(tmp); Py_DECREF(tmp); } #endif if (likely(v)) { int one = 1; int is_little = (int)*(unsigned char *)&one; unsigned char *bytes = (unsigned char *)&val; int ret = _PyLong_AsByteArray((PyLongObject *)v, bytes, sizeof(val), is_little, !is_unsigned); Py_DECREF(v); if (likely(!ret)) return val; } #endif return (int) -1; } } else { int val; PyObject *tmp = __Pyx_PyNumber_Int(x); if (!tmp) return (int) -1; val = __Pyx_PyInt_As_int(tmp); Py_DECREF(tmp); return val; } raise_overflow: PyErr_SetString(PyExc_OverflowError, "value too large to convert to int"); return (int) -1; raise_neg_overflow: PyErr_SetString(PyExc_OverflowError, "can't convert negative value to int"); return (int) -1; } static CYTHON_INLINE uint8_t __Pyx_PyInt_As_uint8_t(PyObject *x) { const uint8_t neg_one = (uint8_t) -1, const_zero = (uint8_t) 0; const int is_unsigned = neg_one > const_zero; #if PY_MAJOR_VERSION < 3 if (likely(PyInt_Check(x))) { if (sizeof(uint8_t) < sizeof(long)) { __PYX_VERIFY_RETURN_INT(uint8_t, long, PyInt_AS_LONG(x)) } else { long val = PyInt_AS_LONG(x); if (is_unsigned && unlikely(val < 0)) { goto raise_neg_overflow; } return (uint8_t) val; } } else #endif if (likely(PyLong_Check(x))) { if (is_unsigned) { #if CYTHON_USE_PYLONG_INTERNALS const digit* digits = ((PyLongObject*)x)->ob_digit; switch (Py_SIZE(x)) { case 0: return (uint8_t) 0; case 1: __PYX_VERIFY_RETURN_INT(uint8_t, digit, digits[0]) case 2: if (8 * sizeof(uint8_t) > 1 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(uint8_t, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(uint8_t) >= 2 * PyLong_SHIFT) { return (uint8_t) (((((uint8_t)digits[1]) << PyLong_SHIFT) | (uint8_t)digits[0])); } } break; case 3: if (8 * sizeof(uint8_t) > 2 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(uint8_t, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(uint8_t) >= 3 * PyLong_SHIFT) { return (uint8_t) (((((((uint8_t)digits[2]) << PyLong_SHIFT) | (uint8_t)digits[1]) << PyLong_SHIFT) | (uint8_t)digits[0])); } } break; case 4: if (8 * sizeof(uint8_t) > 3 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(uint8_t, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(uint8_t) >= 4 * PyLong_SHIFT) { return (uint8_t) (((((((((uint8_t)digits[3]) << PyLong_SHIFT) | (uint8_t)digits[2]) << PyLong_SHIFT) | (uint8_t)digits[1]) << PyLong_SHIFT) | (uint8_t)digits[0])); } } break; } #endif #if CYTHON_COMPILING_IN_CPYTHON if (unlikely(Py_SIZE(x) < 0)) { goto raise_neg_overflow; } #else { int result = PyObject_RichCompareBool(x, Py_False, Py_LT); if (unlikely(result < 0)) return (uint8_t) -1; if (unlikely(result == 1)) goto raise_neg_overflow; } #endif if (sizeof(uint8_t) <= sizeof(unsigned long)) { __PYX_VERIFY_RETURN_INT_EXC(uint8_t, unsigned long, PyLong_AsUnsignedLong(x)) } else if (sizeof(uint8_t) <= sizeof(unsigned PY_LONG_LONG)) { __PYX_VERIFY_RETURN_INT_EXC(uint8_t, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x)) } } else { #if CYTHON_USE_PYLONG_INTERNALS const digit* digits = ((PyLongObject*)x)->ob_digit; switch (Py_SIZE(x)) { case 0: return (uint8_t) 0; case -1: __PYX_VERIFY_RETURN_INT(uint8_t, sdigit, (sdigit) (-(sdigit)digits[0])) case 1: __PYX_VERIFY_RETURN_INT(uint8_t, digit, +digits[0]) case -2: if (8 * sizeof(uint8_t) - 1 > 1 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(uint8_t, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(uint8_t) - 1 > 2 * PyLong_SHIFT) { return (uint8_t) (((uint8_t)-1)*(((((uint8_t)digits[1]) << PyLong_SHIFT) | (uint8_t)digits[0]))); } } break; case 2: if (8 * sizeof(uint8_t) > 1 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(uint8_t, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(uint8_t) - 1 > 2 * PyLong_SHIFT) { return (uint8_t) ((((((uint8_t)digits[1]) << PyLong_SHIFT) | (uint8_t)digits[0]))); } } break; case -3: if (8 * sizeof(uint8_t) - 1 > 2 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(uint8_t, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(uint8_t) - 1 > 3 * PyLong_SHIFT) { return (uint8_t) (((uint8_t)-1)*(((((((uint8_t)digits[2]) << PyLong_SHIFT) | (uint8_t)digits[1]) << PyLong_SHIFT) | (uint8_t)digits[0]))); } } break; case 3: if (8 * sizeof(uint8_t) > 2 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(uint8_t, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(uint8_t) - 1 > 3 * PyLong_SHIFT) { return (uint8_t) ((((((((uint8_t)digits[2]) << PyLong_SHIFT) | (uint8_t)digits[1]) << PyLong_SHIFT) | (uint8_t)digits[0]))); } } break; case -4: if (8 * sizeof(uint8_t) - 1 > 3 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(uint8_t, long, -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(uint8_t) - 1 > 4 * PyLong_SHIFT) { return (uint8_t) (((uint8_t)-1)*(((((((((uint8_t)digits[3]) << PyLong_SHIFT) | (uint8_t)digits[2]) << PyLong_SHIFT) | (uint8_t)digits[1]) << PyLong_SHIFT) | (uint8_t)digits[0]))); } } break; case 4: if (8 * sizeof(uint8_t) > 3 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(uint8_t, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(uint8_t) - 1 > 4 * PyLong_SHIFT) { return (uint8_t) ((((((((((uint8_t)digits[3]) << PyLong_SHIFT) | (uint8_t)digits[2]) << PyLong_SHIFT) | (uint8_t)digits[1]) << PyLong_SHIFT) | (uint8_t)digits[0]))); } } break; } #endif if (sizeof(uint8_t) <= sizeof(long)) { __PYX_VERIFY_RETURN_INT_EXC(uint8_t, long, PyLong_AsLong(x)) } else if (sizeof(uint8_t) <= sizeof(PY_LONG_LONG)) { __PYX_VERIFY_RETURN_INT_EXC(uint8_t, PY_LONG_LONG, PyLong_AsLongLong(x)) } } { #if CYTHON_COMPILING_IN_PYPY && !defined(_PyLong_AsByteArray) PyErr_SetString(PyExc_RuntimeError, "_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers"); #else uint8_t val; PyObject *v = __Pyx_PyNumber_Int(x); #if PY_MAJOR_VERSION < 3 if (likely(v) && !PyLong_Check(v)) { PyObject *tmp = v; v = PyNumber_Long(tmp); Py_DECREF(tmp); } #endif if (likely(v)) { int one = 1; int is_little = (int)*(unsigned char *)&one; unsigned char *bytes = (unsigned char *)&val; int ret = _PyLong_AsByteArray((PyLongObject *)v, bytes, sizeof(val), is_little, !is_unsigned); Py_DECREF(v); if (likely(!ret)) return val; } #endif return (uint8_t) -1; } } else { uint8_t val; PyObject *tmp = __Pyx_PyNumber_Int(x); if (!tmp) return (uint8_t) -1; val = __Pyx_PyInt_As_uint8_t(tmp); Py_DECREF(tmp); return val; } raise_overflow: PyErr_SetString(PyExc_OverflowError, "value too large to convert to uint8_t"); return (uint8_t) -1; raise_neg_overflow: PyErr_SetString(PyExc_OverflowError, "can't convert negative value to uint8_t"); return (uint8_t) -1; } static CYTHON_INLINE uint32_t __Pyx_PyInt_As_uint32_t(PyObject *x) { const uint32_t neg_one = (uint32_t) -1, const_zero = (uint32_t) 0; const int is_unsigned = neg_one > const_zero; #if PY_MAJOR_VERSION < 3 if (likely(PyInt_Check(x))) { if (sizeof(uint32_t) < sizeof(long)) { __PYX_VERIFY_RETURN_INT(uint32_t, long, PyInt_AS_LONG(x)) } else { long val = PyInt_AS_LONG(x); if (is_unsigned && unlikely(val < 0)) { goto raise_neg_overflow; } return (uint32_t) val; } } else #endif if (likely(PyLong_Check(x))) { if (is_unsigned) { #if CYTHON_USE_PYLONG_INTERNALS const digit* digits = ((PyLongObject*)x)->ob_digit; switch (Py_SIZE(x)) { case 0: return (uint32_t) 0; case 1: __PYX_VERIFY_RETURN_INT(uint32_t, digit, digits[0]) case 2: if (8 * sizeof(uint32_t) > 1 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(uint32_t, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(uint32_t) >= 2 * PyLong_SHIFT) { return (uint32_t) (((((uint32_t)digits[1]) << PyLong_SHIFT) | (uint32_t)digits[0])); } } break; case 3: if (8 * sizeof(uint32_t) > 2 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(uint32_t, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(uint32_t) >= 3 * PyLong_SHIFT) { return (uint32_t) (((((((uint32_t)digits[2]) << PyLong_SHIFT) | (uint32_t)digits[1]) << PyLong_SHIFT) | (uint32_t)digits[0])); } } break; case 4: if (8 * sizeof(uint32_t) > 3 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(uint32_t, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(uint32_t) >= 4 * PyLong_SHIFT) { return (uint32_t) (((((((((uint32_t)digits[3]) << PyLong_SHIFT) | (uint32_t)digits[2]) << PyLong_SHIFT) | (uint32_t)digits[1]) << PyLong_SHIFT) | (uint32_t)digits[0])); } } break; } #endif #if CYTHON_COMPILING_IN_CPYTHON if (unlikely(Py_SIZE(x) < 0)) { goto raise_neg_overflow; } #else { int result = PyObject_RichCompareBool(x, Py_False, Py_LT); if (unlikely(result < 0)) return (uint32_t) -1; if (unlikely(result == 1)) goto raise_neg_overflow; } #endif if (sizeof(uint32_t) <= sizeof(unsigned long)) { __PYX_VERIFY_RETURN_INT_EXC(uint32_t, unsigned long, PyLong_AsUnsignedLong(x)) } else if (sizeof(uint32_t) <= sizeof(unsigned PY_LONG_LONG)) { __PYX_VERIFY_RETURN_INT_EXC(uint32_t, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x)) } } else { #if CYTHON_USE_PYLONG_INTERNALS const digit* digits = ((PyLongObject*)x)->ob_digit; switch (Py_SIZE(x)) { case 0: return (uint32_t) 0; case -1: __PYX_VERIFY_RETURN_INT(uint32_t, sdigit, (sdigit) (-(sdigit)digits[0])) case 1: __PYX_VERIFY_RETURN_INT(uint32_t, digit, +digits[0]) case -2: if (8 * sizeof(uint32_t) - 1 > 1 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(uint32_t, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(uint32_t) - 1 > 2 * PyLong_SHIFT) { return (uint32_t) (((uint32_t)-1)*(((((uint32_t)digits[1]) << PyLong_SHIFT) | (uint32_t)digits[0]))); } } break; case 2: if (8 * sizeof(uint32_t) > 1 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(uint32_t, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(uint32_t) - 1 > 2 * PyLong_SHIFT) { return (uint32_t) ((((((uint32_t)digits[1]) << PyLong_SHIFT) | (uint32_t)digits[0]))); } } break; case -3: if (8 * sizeof(uint32_t) - 1 > 2 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(uint32_t, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(uint32_t) - 1 > 3 * PyLong_SHIFT) { return (uint32_t) (((uint32_t)-1)*(((((((uint32_t)digits[2]) << PyLong_SHIFT) | (uint32_t)digits[1]) << PyLong_SHIFT) | (uint32_t)digits[0]))); } } break; case 3: if (8 * sizeof(uint32_t) > 2 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(uint32_t, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(uint32_t) - 1 > 3 * PyLong_SHIFT) { return (uint32_t) ((((((((uint32_t)digits[2]) << PyLong_SHIFT) | (uint32_t)digits[1]) << PyLong_SHIFT) | (uint32_t)digits[0]))); } } break; case -4: if (8 * sizeof(uint32_t) - 1 > 3 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(uint32_t, long, -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(uint32_t) - 1 > 4 * PyLong_SHIFT) { return (uint32_t) (((uint32_t)-1)*(((((((((uint32_t)digits[3]) << PyLong_SHIFT) | (uint32_t)digits[2]) << PyLong_SHIFT) | (uint32_t)digits[1]) << PyLong_SHIFT) | (uint32_t)digits[0]))); } } break; case 4: if (8 * sizeof(uint32_t) > 3 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(uint32_t, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(uint32_t) - 1 > 4 * PyLong_SHIFT) { return (uint32_t) ((((((((((uint32_t)digits[3]) << PyLong_SHIFT) | (uint32_t)digits[2]) << PyLong_SHIFT) | (uint32_t)digits[1]) << PyLong_SHIFT) | (uint32_t)digits[0]))); } } break; } #endif if (sizeof(uint32_t) <= sizeof(long)) { __PYX_VERIFY_RETURN_INT_EXC(uint32_t, long, PyLong_AsLong(x)) } else if (sizeof(uint32_t) <= sizeof(PY_LONG_LONG)) { __PYX_VERIFY_RETURN_INT_EXC(uint32_t, PY_LONG_LONG, PyLong_AsLongLong(x)) } } { #if CYTHON_COMPILING_IN_PYPY && !defined(_PyLong_AsByteArray) PyErr_SetString(PyExc_RuntimeError, "_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers"); #else uint32_t val; PyObject *v = __Pyx_PyNumber_Int(x); #if PY_MAJOR_VERSION < 3 if (likely(v) && !PyLong_Check(v)) { PyObject *tmp = v; v = PyNumber_Long(tmp); Py_DECREF(tmp); } #endif if (likely(v)) { int one = 1; int is_little = (int)*(unsigned char *)&one; unsigned char *bytes = (unsigned char *)&val; int ret = _PyLong_AsByteArray((PyLongObject *)v, bytes, sizeof(val), is_little, !is_unsigned); Py_DECREF(v); if (likely(!ret)) return val; } #endif return (uint32_t) -1; } } else { uint32_t val; PyObject *tmp = __Pyx_PyNumber_Int(x); if (!tmp) return (uint32_t) -1; val = __Pyx_PyInt_As_uint32_t(tmp); Py_DECREF(tmp); return val; } raise_overflow: PyErr_SetString(PyExc_OverflowError, "value too large to convert to uint32_t"); return (uint32_t) -1; raise_neg_overflow: PyErr_SetString(PyExc_OverflowError, "can't convert negative value to uint32_t"); return (uint32_t) -1; } static CYTHON_INLINE PyObject* __Pyx_PyInt_From_uint8_t(uint8_t value) { const uint8_t neg_one = (uint8_t) -1, const_zero = (uint8_t) 0; const int is_unsigned = neg_one > const_zero; if (is_unsigned) { if (sizeof(uint8_t) < sizeof(long)) { return PyInt_FromLong((long) value); } else if (sizeof(uint8_t) <= sizeof(unsigned long)) { return PyLong_FromUnsignedLong((unsigned long) value); } else if (sizeof(uint8_t) <= sizeof(unsigned PY_LONG_LONG)) { return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value); } } else { if (sizeof(uint8_t) <= sizeof(long)) { return PyInt_FromLong((long) value); } else if (sizeof(uint8_t) <= sizeof(PY_LONG_LONG)) { return PyLong_FromLongLong((PY_LONG_LONG) value); } } { int one = 1; int little = (int)*(unsigned char *)&one; unsigned char *bytes = (unsigned char *)&value; return _PyLong_FromByteArray(bytes, sizeof(uint8_t), little, !is_unsigned); } } static CYTHON_INLINE PyObject* __Pyx_PyInt_From_long(long value) { const long neg_one = (long) -1, const_zero = (long) 0; const int is_unsigned = neg_one > const_zero; if (is_unsigned) { if (sizeof(long) < sizeof(long)) { return PyInt_FromLong((long) value); } else if (sizeof(long) <= sizeof(unsigned long)) { return PyLong_FromUnsignedLong((unsigned long) value); } else if (sizeof(long) <= sizeof(unsigned PY_LONG_LONG)) { return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value); } } else { if (sizeof(long) <= sizeof(long)) { return PyInt_FromLong((long) value); } else if (sizeof(long) <= sizeof(PY_LONG_LONG)) { return PyLong_FromLongLong((PY_LONG_LONG) value); } } { int one = 1; int little = (int)*(unsigned char *)&one; unsigned char *bytes = (unsigned char *)&value; return _PyLong_FromByteArray(bytes, sizeof(long), little, !is_unsigned); } } static CYTHON_INLINE long __Pyx_PyInt_As_long(PyObject *x) { const long neg_one = (long) -1, const_zero = (long) 0; const int is_unsigned = neg_one > const_zero; #if PY_MAJOR_VERSION < 3 if (likely(PyInt_Check(x))) { if (sizeof(long) < sizeof(long)) { __PYX_VERIFY_RETURN_INT(long, long, PyInt_AS_LONG(x)) } else { long val = PyInt_AS_LONG(x); if (is_unsigned && unlikely(val < 0)) { goto raise_neg_overflow; } return (long) val; } } else #endif if (likely(PyLong_Check(x))) { if (is_unsigned) { #if CYTHON_USE_PYLONG_INTERNALS const digit* digits = ((PyLongObject*)x)->ob_digit; switch (Py_SIZE(x)) { case 0: return (long) 0; case 1: __PYX_VERIFY_RETURN_INT(long, digit, digits[0]) case 2: if (8 * sizeof(long) > 1 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(long) >= 2 * PyLong_SHIFT) { return (long) (((((long)digits[1]) << PyLong_SHIFT) | (long)digits[0])); } } break; case 3: if (8 * sizeof(long) > 2 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(long) >= 3 * PyLong_SHIFT) { return (long) (((((((long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0])); } } break; case 4: if (8 * sizeof(long) > 3 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(long) >= 4 * PyLong_SHIFT) { return (long) (((((((((long)digits[3]) << PyLong_SHIFT) | (long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0])); } } break; } #endif #if CYTHON_COMPILING_IN_CPYTHON if (unlikely(Py_SIZE(x) < 0)) { goto raise_neg_overflow; } #else { int result = PyObject_RichCompareBool(x, Py_False, Py_LT); if (unlikely(result < 0)) return (long) -1; if (unlikely(result == 1)) goto raise_neg_overflow; } #endif if (sizeof(long) <= sizeof(unsigned long)) { __PYX_VERIFY_RETURN_INT_EXC(long, unsigned long, PyLong_AsUnsignedLong(x)) } else if (sizeof(long) <= sizeof(unsigned PY_LONG_LONG)) { __PYX_VERIFY_RETURN_INT_EXC(long, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x)) } } else { #if CYTHON_USE_PYLONG_INTERNALS const digit* digits = ((PyLongObject*)x)->ob_digit; switch (Py_SIZE(x)) { case 0: return (long) 0; case -1: __PYX_VERIFY_RETURN_INT(long, sdigit, (sdigit) (-(sdigit)digits[0])) case 1: __PYX_VERIFY_RETURN_INT(long, digit, +digits[0]) case -2: if (8 * sizeof(long) - 1 > 1 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(long, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) { return (long) (((long)-1)*(((((long)digits[1]) << PyLong_SHIFT) | (long)digits[0]))); } } break; case 2: if (8 * sizeof(long) > 1 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) { return (long) ((((((long)digits[1]) << PyLong_SHIFT) | (long)digits[0]))); } } break; case -3: if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(long, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) { return (long) (((long)-1)*(((((((long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0]))); } } break; case 3: if (8 * sizeof(long) > 2 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) { return (long) ((((((((long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0]))); } } break; case -4: if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(long, long, -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(long) - 1 > 4 * PyLong_SHIFT) { return (long) (((long)-1)*(((((((((long)digits[3]) << PyLong_SHIFT) | (long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0]))); } } break; case 4: if (8 * sizeof(long) > 3 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(long) - 1 > 4 * PyLong_SHIFT) { return (long) ((((((((((long)digits[3]) << PyLong_SHIFT) | (long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0]))); } } break; } #endif if (sizeof(long) <= sizeof(long)) { __PYX_VERIFY_RETURN_INT_EXC(long, long, PyLong_AsLong(x)) } else if (sizeof(long) <= sizeof(PY_LONG_LONG)) { __PYX_VERIFY_RETURN_INT_EXC(long, PY_LONG_LONG, PyLong_AsLongLong(x)) } } { #if CYTHON_COMPILING_IN_PYPY && !defined(_PyLong_AsByteArray) PyErr_SetString(PyExc_RuntimeError, "_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers"); #else long val; PyObject *v = __Pyx_PyNumber_Int(x); #if PY_MAJOR_VERSION < 3 if (likely(v) && !PyLong_Check(v)) { PyObject *tmp = v; v = PyNumber_Long(tmp); Py_DECREF(tmp); } #endif if (likely(v)) { int one = 1; int is_little = (int)*(unsigned char *)&one; unsigned char *bytes = (unsigned char *)&val; int ret = _PyLong_AsByteArray((PyLongObject *)v, bytes, sizeof(val), is_little, !is_unsigned); Py_DECREF(v); if (likely(!ret)) return val; } #endif return (long) -1; } } else { long val; PyObject *tmp = __Pyx_PyNumber_Int(x); if (!tmp) return (long) -1; val = __Pyx_PyInt_As_long(tmp); Py_DECREF(tmp); return val; } raise_overflow: PyErr_SetString(PyExc_OverflowError, "value too large to convert to long"); return (long) -1; raise_neg_overflow: PyErr_SetString(PyExc_OverflowError, "can't convert negative value to long"); return (long) -1; } static int __Pyx_check_binary_version(void) { char ctversion[4], rtversion[4]; PyOS_snprintf(ctversion, 4, "%d.%d", PY_MAJOR_VERSION, PY_MINOR_VERSION); PyOS_snprintf(rtversion, 4, "%s", Py_GetVersion()); if (ctversion[0] != rtversion[0] || ctversion[2] != rtversion[2]) { char message[200]; PyOS_snprintf(message, sizeof(message), "compiletime version %s of module '%.100s' " "does not match runtime version %s", ctversion, __Pyx_MODULE_NAME, rtversion); return PyErr_WarnEx(NULL, message, 1); } return 0; } static int __Pyx_ExportFunction(const char *name, void (*f)(void), const char *sig) { PyObject *d = 0; PyObject *cobj = 0; union { void (*fp)(void); void *p; } tmp; d = PyObject_GetAttrString(__pyx_m, (char *)"__pyx_capi__"); if (!d) { PyErr_Clear(); d = PyDict_New(); if (!d) goto bad; Py_INCREF(d); if (PyModule_AddObject(__pyx_m, (char *)"__pyx_capi__", d) < 0) goto bad; } tmp.fp = f; #if PY_VERSION_HEX >= 0x02070000 cobj = PyCapsule_New(tmp.p, sig, 0); #else cobj = PyCObject_FromVoidPtrAndDesc(tmp.p, (void *)sig, 0); #endif if (!cobj) goto bad; if (PyDict_SetItemString(d, name, cobj) < 0) goto bad; Py_DECREF(cobj); Py_DECREF(d); return 0; bad: Py_XDECREF(cobj); Py_XDECREF(d); return -1; } static int __Pyx_InitStrings(__Pyx_StringTabEntry *t) { while (t->p) { #if PY_MAJOR_VERSION < 3 if (t->is_unicode) { *t->p = PyUnicode_DecodeUTF8(t->s, t->n - 1, NULL); } else if (t->intern) { *t->p = PyString_InternFromString(t->s); } else { *t->p = PyString_FromStringAndSize(t->s, t->n - 1); } #else if (t->is_unicode | t->is_str) { if (t->intern) { *t->p = PyUnicode_InternFromString(t->s); } else if (t->encoding) { *t->p = PyUnicode_Decode(t->s, t->n - 1, t->encoding, NULL); } else { *t->p = PyUnicode_FromStringAndSize(t->s, t->n - 1); } } else { *t->p = PyBytes_FromStringAndSize(t->s, t->n - 1); } #endif if (!*t->p) return -1; ++t; } return 0; } static CYTHON_INLINE PyObject* __Pyx_PyUnicode_FromString(const char* c_str) { return __Pyx_PyUnicode_FromStringAndSize(c_str, (Py_ssize_t)strlen(c_str)); } static CYTHON_INLINE char* __Pyx_PyObject_AsString(PyObject* o) { Py_ssize_t ignore; return __Pyx_PyObject_AsStringAndSize(o, &ignore); } static CYTHON_INLINE char* __Pyx_PyObject_AsStringAndSize(PyObject* o, Py_ssize_t *length) { #if CYTHON_COMPILING_IN_CPYTHON && (__PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT) if ( #if PY_MAJOR_VERSION < 3 && __PYX_DEFAULT_STRING_ENCODING_IS_ASCII __Pyx_sys_getdefaultencoding_not_ascii && #endif PyUnicode_Check(o)) { #if PY_VERSION_HEX < 0x03030000 char* defenc_c; PyObject* defenc = _PyUnicode_AsDefaultEncodedString(o, NULL); if (!defenc) return NULL; defenc_c = PyBytes_AS_STRING(defenc); #if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII { char* end = defenc_c + PyBytes_GET_SIZE(defenc); char* c; for (c = defenc_c; c < end; c++) { if ((unsigned char) (*c) >= 128) { PyUnicode_AsASCIIString(o); return NULL; } } } #endif *length = PyBytes_GET_SIZE(defenc); return defenc_c; #else if (__Pyx_PyUnicode_READY(o) == -1) return NULL; #if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII if (PyUnicode_IS_ASCII(o)) { *length = PyUnicode_GET_LENGTH(o); return PyUnicode_AsUTF8(o); } else { PyUnicode_AsASCIIString(o); return NULL; } #else return PyUnicode_AsUTF8AndSize(o, length); #endif #endif } else #endif #if (!CYTHON_COMPILING_IN_PYPY) || (defined(PyByteArray_AS_STRING) && defined(PyByteArray_GET_SIZE)) if (PyByteArray_Check(o)) { *length = PyByteArray_GET_SIZE(o); return PyByteArray_AS_STRING(o); } else #endif { char* result; int r = PyBytes_AsStringAndSize(o, &result, length); if (unlikely(r < 0)) { return NULL; } else { return result; } } } static CYTHON_INLINE int __Pyx_PyObject_IsTrue(PyObject* x) { int is_true = x == Py_True; if (is_true | (x == Py_False) | (x == Py_None)) return is_true; else return PyObject_IsTrue(x); } static CYTHON_INLINE PyObject* __Pyx_PyNumber_Int(PyObject* x) { PyNumberMethods *m; const char *name = NULL; PyObject *res = NULL; #if PY_MAJOR_VERSION < 3 if (PyInt_Check(x) || PyLong_Check(x)) #else if (PyLong_Check(x)) #endif return __Pyx_NewRef(x); m = Py_TYPE(x)->tp_as_number; #if PY_MAJOR_VERSION < 3 if (m && m->nb_int) { name = "int"; res = PyNumber_Int(x); } else if (m && m->nb_long) { name = "long"; res = PyNumber_Long(x); } #else if (m && m->nb_int) { name = "int"; res = PyNumber_Long(x); } #endif if (res) { #if PY_MAJOR_VERSION < 3 if (!PyInt_Check(res) && !PyLong_Check(res)) { #else if (!PyLong_Check(res)) { #endif PyErr_Format(PyExc_TypeError, "__%.4s__ returned non-%.4s (type %.200s)", name, name, Py_TYPE(res)->tp_name); Py_DECREF(res); return NULL; } } else if (!PyErr_Occurred()) { PyErr_SetString(PyExc_TypeError, "an integer is required"); } return res; } static CYTHON_INLINE Py_ssize_t __Pyx_PyIndex_AsSsize_t(PyObject* b) { Py_ssize_t ival; PyObject *x; #if PY_MAJOR_VERSION < 3 if (likely(PyInt_CheckExact(b))) { if (sizeof(Py_ssize_t) >= sizeof(long)) return PyInt_AS_LONG(b); else return PyInt_AsSsize_t(x); } #endif if (likely(PyLong_CheckExact(b))) { #if CYTHON_USE_PYLONG_INTERNALS const digit* digits = ((PyLongObject*)b)->ob_digit; const Py_ssize_t size = Py_SIZE(b); if (likely(__Pyx_sst_abs(size) <= 1)) { ival = likely(size) ? digits[0] : 0; if (size == -1) ival = -ival; return ival; } else { switch (size) { case 2: if (8 * sizeof(Py_ssize_t) > 2 * PyLong_SHIFT) { return (Py_ssize_t) (((((size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])); } break; case -2: if (8 * sizeof(Py_ssize_t) > 2 * PyLong_SHIFT) { return -(Py_ssize_t) (((((size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])); } break; case 3: if (8 * sizeof(Py_ssize_t) > 3 * PyLong_SHIFT) { return (Py_ssize_t) (((((((size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])); } break; case -3: if (8 * sizeof(Py_ssize_t) > 3 * PyLong_SHIFT) { return -(Py_ssize_t) (((((((size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])); } break; case 4: if (8 * sizeof(Py_ssize_t) > 4 * PyLong_SHIFT) { return (Py_ssize_t) (((((((((size_t)digits[3]) << PyLong_SHIFT) | (size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])); } break; case -4: if (8 * sizeof(Py_ssize_t) > 4 * PyLong_SHIFT) { return -(Py_ssize_t) (((((((((size_t)digits[3]) << PyLong_SHIFT) | (size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])); } break; } } #endif return PyLong_AsSsize_t(b); } x = PyNumber_Index(b); if (!x) return -1; ival = PyInt_AsSsize_t(x); Py_DECREF(x); return ival; } static CYTHON_INLINE PyObject * __Pyx_PyInt_FromSize_t(size_t ival) { return PyInt_FromSize_t(ival); } #endif /* Py_PYTHON_H */ pygame_sdl2-2.1.0-for-renpy-6.99.14.1/gen/pygame_sdl2.power.c0000644000175000017500000034167713205033347022544 0ustar tomtom00000000000000/* Generated by Cython 0.21.1 */ #define PY_SSIZE_T_CLEAN #ifndef CYTHON_USE_PYLONG_INTERNALS #ifdef PYLONG_BITS_IN_DIGIT #define CYTHON_USE_PYLONG_INTERNALS 0 #else #include "pyconfig.h" #ifdef PYLONG_BITS_IN_DIGIT #define CYTHON_USE_PYLONG_INTERNALS 1 #else #define CYTHON_USE_PYLONG_INTERNALS 0 #endif #endif #endif #include "Python.h" #ifndef Py_PYTHON_H #error Python headers needed to compile C extensions, please install development version of Python. #elif PY_VERSION_HEX < 0x02060000 || (0x03000000 <= PY_VERSION_HEX && PY_VERSION_HEX < 0x03020000) #error Cython requires Python 2.6+ or Python 3.2+. #else #define CYTHON_ABI "0_21_1" #include #ifndef offsetof #define offsetof(type, member) ( (size_t) & ((type*)0) -> member ) #endif #if !defined(WIN32) && !defined(MS_WINDOWS) #ifndef __stdcall #define __stdcall #endif #ifndef __cdecl #define __cdecl #endif #ifndef __fastcall #define __fastcall #endif #endif #ifndef DL_IMPORT #define DL_IMPORT(t) t #endif #ifndef DL_EXPORT #define DL_EXPORT(t) t #endif #ifndef PY_LONG_LONG #define PY_LONG_LONG LONG_LONG #endif #ifndef Py_HUGE_VAL #define Py_HUGE_VAL HUGE_VAL #endif #ifdef PYPY_VERSION #define CYTHON_COMPILING_IN_PYPY 1 #define CYTHON_COMPILING_IN_CPYTHON 0 #else #define CYTHON_COMPILING_IN_PYPY 0 #define CYTHON_COMPILING_IN_CPYTHON 1 #endif #if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX < 0x02070600 #define Py_OptimizeFlag 0 #endif #define __PYX_BUILD_PY_SSIZE_T "n" #define CYTHON_FORMAT_SSIZE_T "z" #if PY_MAJOR_VERSION < 3 #define __Pyx_BUILTIN_MODULE_NAME "__builtin__" #define __Pyx_PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos) \ PyCode_New(a+k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos) #define __Pyx_DefaultClassType PyClass_Type #else #define __Pyx_BUILTIN_MODULE_NAME "builtins" #define __Pyx_PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos) \ PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos) #define __Pyx_DefaultClassType PyType_Type #endif #if PY_MAJOR_VERSION >= 3 #define Py_TPFLAGS_CHECKTYPES 0 #define Py_TPFLAGS_HAVE_INDEX 0 #define Py_TPFLAGS_HAVE_NEWBUFFER 0 #endif #if PY_VERSION_HEX < 0x030400a1 && !defined(Py_TPFLAGS_HAVE_FINALIZE) #define Py_TPFLAGS_HAVE_FINALIZE 0 #endif #if PY_VERSION_HEX > 0x03030000 && defined(PyUnicode_KIND) #define CYTHON_PEP393_ENABLED 1 #define __Pyx_PyUnicode_READY(op) (likely(PyUnicode_IS_READY(op)) ? \ 0 : _PyUnicode_Ready((PyObject *)(op))) #define __Pyx_PyUnicode_GET_LENGTH(u) PyUnicode_GET_LENGTH(u) #define __Pyx_PyUnicode_READ_CHAR(u, i) PyUnicode_READ_CHAR(u, i) #define __Pyx_PyUnicode_KIND(u) PyUnicode_KIND(u) #define __Pyx_PyUnicode_DATA(u) PyUnicode_DATA(u) #define __Pyx_PyUnicode_READ(k, d, i) PyUnicode_READ(k, d, i) #else #define CYTHON_PEP393_ENABLED 0 #define __Pyx_PyUnicode_READY(op) (0) #define __Pyx_PyUnicode_GET_LENGTH(u) PyUnicode_GET_SIZE(u) #define __Pyx_PyUnicode_READ_CHAR(u, i) ((Py_UCS4)(PyUnicode_AS_UNICODE(u)[i])) #define __Pyx_PyUnicode_KIND(u) (sizeof(Py_UNICODE)) #define __Pyx_PyUnicode_DATA(u) ((void*)PyUnicode_AS_UNICODE(u)) #define __Pyx_PyUnicode_READ(k, d, i) ((void)(k), (Py_UCS4)(((Py_UNICODE*)d)[i])) #endif #if CYTHON_COMPILING_IN_PYPY #define __Pyx_PyUnicode_Concat(a, b) PyNumber_Add(a, b) #define __Pyx_PyUnicode_ConcatSafe(a, b) PyNumber_Add(a, b) #define __Pyx_PyFrozenSet_Size(s) PyObject_Size(s) #else #define __Pyx_PyUnicode_Concat(a, b) PyUnicode_Concat(a, b) #define __Pyx_PyUnicode_ConcatSafe(a, b) ((unlikely((a) == Py_None) || unlikely((b) == Py_None)) ? \ PyNumber_Add(a, b) : __Pyx_PyUnicode_Concat(a, b)) #define __Pyx_PyFrozenSet_Size(s) PySet_Size(s) #endif #define __Pyx_PyString_FormatSafe(a, b) ((unlikely((a) == Py_None)) ? PyNumber_Remainder(a, b) : __Pyx_PyString_Format(a, b)) #define __Pyx_PyUnicode_FormatSafe(a, b) ((unlikely((a) == Py_None)) ? PyNumber_Remainder(a, b) : PyUnicode_Format(a, b)) #if PY_MAJOR_VERSION >= 3 #define __Pyx_PyString_Format(a, b) PyUnicode_Format(a, b) #else #define __Pyx_PyString_Format(a, b) PyString_Format(a, b) #endif #if PY_MAJOR_VERSION >= 3 #define PyBaseString_Type PyUnicode_Type #define PyStringObject PyUnicodeObject #define PyString_Type PyUnicode_Type #define PyString_Check PyUnicode_Check #define PyString_CheckExact PyUnicode_CheckExact #endif #if PY_MAJOR_VERSION >= 3 #define __Pyx_PyBaseString_Check(obj) PyUnicode_Check(obj) #define __Pyx_PyBaseString_CheckExact(obj) PyUnicode_CheckExact(obj) #else #define __Pyx_PyBaseString_Check(obj) (PyString_Check(obj) || PyUnicode_Check(obj)) #define __Pyx_PyBaseString_CheckExact(obj) (PyString_CheckExact(obj) || PyUnicode_CheckExact(obj)) #endif #ifndef PySet_CheckExact #define PySet_CheckExact(obj) (Py_TYPE(obj) == &PySet_Type) #endif #define __Pyx_TypeCheck(obj, type) PyObject_TypeCheck(obj, (PyTypeObject *)type) #if PY_MAJOR_VERSION >= 3 #define PyIntObject PyLongObject #define PyInt_Type PyLong_Type #define PyInt_Check(op) PyLong_Check(op) #define PyInt_CheckExact(op) PyLong_CheckExact(op) #define PyInt_FromString PyLong_FromString #define PyInt_FromUnicode PyLong_FromUnicode #define PyInt_FromLong PyLong_FromLong #define PyInt_FromSize_t PyLong_FromSize_t #define PyInt_FromSsize_t PyLong_FromSsize_t #define PyInt_AsLong PyLong_AsLong #define PyInt_AS_LONG PyLong_AS_LONG #define PyInt_AsSsize_t PyLong_AsSsize_t #define PyInt_AsUnsignedLongMask PyLong_AsUnsignedLongMask #define PyInt_AsUnsignedLongLongMask PyLong_AsUnsignedLongLongMask #define PyNumber_Int PyNumber_Long #endif #if PY_MAJOR_VERSION >= 3 #define PyBoolObject PyLongObject #endif #if PY_MAJOR_VERSION >= 3 && CYTHON_COMPILING_IN_PYPY #ifndef PyUnicode_InternFromString #define PyUnicode_InternFromString(s) PyUnicode_FromString(s) #endif #endif #if PY_VERSION_HEX < 0x030200A4 typedef long Py_hash_t; #define __Pyx_PyInt_FromHash_t PyInt_FromLong #define __Pyx_PyInt_AsHash_t PyInt_AsLong #else #define __Pyx_PyInt_FromHash_t PyInt_FromSsize_t #define __Pyx_PyInt_AsHash_t PyInt_AsSsize_t #endif #if PY_MAJOR_VERSION >= 3 #define __Pyx_PyMethod_New(func, self, klass) ((self) ? PyMethod_New(func, self) : PyInstanceMethod_New(func)) #else #define __Pyx_PyMethod_New(func, self, klass) PyMethod_New(func, self, klass) #endif #ifndef CYTHON_INLINE #if defined(__GNUC__) #define CYTHON_INLINE __inline__ #elif defined(_MSC_VER) #define CYTHON_INLINE __inline #elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L #define CYTHON_INLINE inline #else #define CYTHON_INLINE #endif #endif #ifndef CYTHON_RESTRICT #if defined(__GNUC__) #define CYTHON_RESTRICT __restrict__ #elif defined(_MSC_VER) && _MSC_VER >= 1400 #define CYTHON_RESTRICT __restrict #elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L #define CYTHON_RESTRICT restrict #else #define CYTHON_RESTRICT #endif #endif #ifdef NAN #define __PYX_NAN() ((float) NAN) #else static CYTHON_INLINE float __PYX_NAN() { /* Initialize NaN. The sign is irrelevant, an exponent with all bits 1 and a nonzero mantissa means NaN. If the first bit in the mantissa is 1, it is a quiet NaN. */ float value; memset(&value, 0xFF, sizeof(value)); return value; } #endif #ifdef __cplusplus template void __Pyx_call_destructor(T* x) { x->~T(); } #endif #if PY_MAJOR_VERSION >= 3 #define __Pyx_PyNumber_Divide(x,y) PyNumber_TrueDivide(x,y) #define __Pyx_PyNumber_InPlaceDivide(x,y) PyNumber_InPlaceTrueDivide(x,y) #else #define __Pyx_PyNumber_Divide(x,y) PyNumber_Divide(x,y) #define __Pyx_PyNumber_InPlaceDivide(x,y) PyNumber_InPlaceDivide(x,y) #endif #ifndef __PYX_EXTERN_C #ifdef __cplusplus #define __PYX_EXTERN_C extern "C" #else #define __PYX_EXTERN_C extern #endif #endif #if defined(WIN32) || defined(MS_WINDOWS) #define _USE_MATH_DEFINES #endif #include #define __PYX_HAVE__pygame_sdl2__power #define __PYX_HAVE_API__pygame_sdl2__power #include "stdint.h" #include "string.h" #include "stdio.h" #include "stddef.h" #include "SDL.h" #ifdef _OPENMP #include #endif /* _OPENMP */ #ifdef PYREX_WITHOUT_ASSERTIONS #define CYTHON_WITHOUT_ASSERTIONS #endif #ifndef CYTHON_UNUSED # if defined(__GNUC__) # if !(defined(__cplusplus)) || (__GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 4)) # define CYTHON_UNUSED __attribute__ ((__unused__)) # else # define CYTHON_UNUSED # endif # elif defined(__ICC) || (defined(__INTEL_COMPILER) && !defined(_MSC_VER)) # define CYTHON_UNUSED __attribute__ ((__unused__)) # else # define CYTHON_UNUSED # endif #endif typedef struct {PyObject **p; char *s; const Py_ssize_t n; const char* encoding; const char is_unicode; const char is_str; const char intern; } __Pyx_StringTabEntry; #define __PYX_DEFAULT_STRING_ENCODING_IS_ASCII 0 #define __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT 0 #define __PYX_DEFAULT_STRING_ENCODING "" #define __Pyx_PyObject_FromString __Pyx_PyBytes_FromString #define __Pyx_PyObject_FromStringAndSize __Pyx_PyBytes_FromStringAndSize #define __Pyx_fits_Py_ssize_t(v, type, is_signed) ( \ (sizeof(type) < sizeof(Py_ssize_t)) || \ (sizeof(type) > sizeof(Py_ssize_t) && \ likely(v < (type)PY_SSIZE_T_MAX || \ v == (type)PY_SSIZE_T_MAX) && \ (!is_signed || likely(v > (type)PY_SSIZE_T_MIN || \ v == (type)PY_SSIZE_T_MIN))) || \ (sizeof(type) == sizeof(Py_ssize_t) && \ (is_signed || likely(v < (type)PY_SSIZE_T_MAX || \ v == (type)PY_SSIZE_T_MAX))) ) static CYTHON_INLINE char* __Pyx_PyObject_AsString(PyObject*); static CYTHON_INLINE char* __Pyx_PyObject_AsStringAndSize(PyObject*, Py_ssize_t* length); #define __Pyx_PyByteArray_FromString(s) PyByteArray_FromStringAndSize((const char*)s, strlen((const char*)s)) #define __Pyx_PyByteArray_FromStringAndSize(s, l) PyByteArray_FromStringAndSize((const char*)s, l) #define __Pyx_PyBytes_FromString PyBytes_FromString #define __Pyx_PyBytes_FromStringAndSize PyBytes_FromStringAndSize static CYTHON_INLINE PyObject* __Pyx_PyUnicode_FromString(const char*); #if PY_MAJOR_VERSION < 3 #define __Pyx_PyStr_FromString __Pyx_PyBytes_FromString #define __Pyx_PyStr_FromStringAndSize __Pyx_PyBytes_FromStringAndSize #else #define __Pyx_PyStr_FromString __Pyx_PyUnicode_FromString #define __Pyx_PyStr_FromStringAndSize __Pyx_PyUnicode_FromStringAndSize #endif #define __Pyx_PyObject_AsSString(s) ((signed char*) __Pyx_PyObject_AsString(s)) #define __Pyx_PyObject_AsUString(s) ((unsigned char*) __Pyx_PyObject_AsString(s)) #define __Pyx_PyObject_FromUString(s) __Pyx_PyObject_FromString((const char*)s) #define __Pyx_PyBytes_FromUString(s) __Pyx_PyBytes_FromString((const char*)s) #define __Pyx_PyByteArray_FromUString(s) __Pyx_PyByteArray_FromString((const char*)s) #define __Pyx_PyStr_FromUString(s) __Pyx_PyStr_FromString((const char*)s) #define __Pyx_PyUnicode_FromUString(s) __Pyx_PyUnicode_FromString((const char*)s) #if PY_MAJOR_VERSION < 3 static CYTHON_INLINE size_t __Pyx_Py_UNICODE_strlen(const Py_UNICODE *u) { const Py_UNICODE *u_end = u; while (*u_end++) ; return (size_t)(u_end - u - 1); } #else #define __Pyx_Py_UNICODE_strlen Py_UNICODE_strlen #endif #define __Pyx_PyUnicode_FromUnicode(u) PyUnicode_FromUnicode(u, __Pyx_Py_UNICODE_strlen(u)) #define __Pyx_PyUnicode_FromUnicodeAndLength PyUnicode_FromUnicode #define __Pyx_PyUnicode_AsUnicode PyUnicode_AsUnicode #define __Pyx_Owned_Py_None(b) (Py_INCREF(Py_None), Py_None) #define __Pyx_PyBool_FromLong(b) ((b) ? (Py_INCREF(Py_True), Py_True) : (Py_INCREF(Py_False), Py_False)) static CYTHON_INLINE int __Pyx_PyObject_IsTrue(PyObject*); static CYTHON_INLINE PyObject* __Pyx_PyNumber_Int(PyObject* x); static CYTHON_INLINE Py_ssize_t __Pyx_PyIndex_AsSsize_t(PyObject*); static CYTHON_INLINE PyObject * __Pyx_PyInt_FromSize_t(size_t); #if CYTHON_COMPILING_IN_CPYTHON #define __pyx_PyFloat_AsDouble(x) (PyFloat_CheckExact(x) ? PyFloat_AS_DOUBLE(x) : PyFloat_AsDouble(x)) #else #define __pyx_PyFloat_AsDouble(x) PyFloat_AsDouble(x) #endif #define __pyx_PyFloat_AsFloat(x) ((float) __pyx_PyFloat_AsDouble(x)) #if PY_MAJOR_VERSION < 3 && __PYX_DEFAULT_STRING_ENCODING_IS_ASCII static int __Pyx_sys_getdefaultencoding_not_ascii; static int __Pyx_init_sys_getdefaultencoding_params(void) { PyObject* sys; PyObject* default_encoding = NULL; PyObject* ascii_chars_u = NULL; PyObject* ascii_chars_b = NULL; const char* default_encoding_c; sys = PyImport_ImportModule("sys"); if (!sys) goto bad; default_encoding = PyObject_CallMethod(sys, (char*) (const char*) "getdefaultencoding", NULL); Py_DECREF(sys); if (!default_encoding) goto bad; default_encoding_c = PyBytes_AsString(default_encoding); if (!default_encoding_c) goto bad; if (strcmp(default_encoding_c, "ascii") == 0) { __Pyx_sys_getdefaultencoding_not_ascii = 0; } else { char ascii_chars[128]; int c; for (c = 0; c < 128; c++) { ascii_chars[c] = c; } __Pyx_sys_getdefaultencoding_not_ascii = 1; ascii_chars_u = PyUnicode_DecodeASCII(ascii_chars, 128, NULL); if (!ascii_chars_u) goto bad; ascii_chars_b = PyUnicode_AsEncodedString(ascii_chars_u, default_encoding_c, NULL); if (!ascii_chars_b || !PyBytes_Check(ascii_chars_b) || memcmp(ascii_chars, PyBytes_AS_STRING(ascii_chars_b), 128) != 0) { PyErr_Format( PyExc_ValueError, "This module compiled with c_string_encoding=ascii, but default encoding '%.200s' is not a superset of ascii.", default_encoding_c); goto bad; } Py_DECREF(ascii_chars_u); Py_DECREF(ascii_chars_b); } Py_DECREF(default_encoding); return 0; bad: Py_XDECREF(default_encoding); Py_XDECREF(ascii_chars_u); Py_XDECREF(ascii_chars_b); return -1; } #endif #if __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT && PY_MAJOR_VERSION >= 3 #define __Pyx_PyUnicode_FromStringAndSize(c_str, size) PyUnicode_DecodeUTF8(c_str, size, NULL) #else #define __Pyx_PyUnicode_FromStringAndSize(c_str, size) PyUnicode_Decode(c_str, size, __PYX_DEFAULT_STRING_ENCODING, NULL) #if __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT static char* __PYX_DEFAULT_STRING_ENCODING; static int __Pyx_init_sys_getdefaultencoding_params(void) { PyObject* sys; PyObject* default_encoding = NULL; char* default_encoding_c; sys = PyImport_ImportModule("sys"); if (!sys) goto bad; default_encoding = PyObject_CallMethod(sys, (char*) (const char*) "getdefaultencoding", NULL); Py_DECREF(sys); if (!default_encoding) goto bad; default_encoding_c = PyBytes_AsString(default_encoding); if (!default_encoding_c) goto bad; __PYX_DEFAULT_STRING_ENCODING = (char*) malloc(strlen(default_encoding_c)); if (!__PYX_DEFAULT_STRING_ENCODING) goto bad; strcpy(__PYX_DEFAULT_STRING_ENCODING, default_encoding_c); Py_DECREF(default_encoding); return 0; bad: Py_XDECREF(default_encoding); return -1; } #endif #endif /* Test for GCC > 2.95 */ #if defined(__GNUC__) && (__GNUC__ > 2 || (__GNUC__ == 2 && (__GNUC_MINOR__ > 95))) #define likely(x) __builtin_expect(!!(x), 1) #define unlikely(x) __builtin_expect(!!(x), 0) #else /* !__GNUC__ or GCC < 2.95 */ #define likely(x) (x) #define unlikely(x) (x) #endif /* __GNUC__ */ static PyObject *__pyx_m; static PyObject *__pyx_d; static PyObject *__pyx_b; static PyObject *__pyx_empty_tuple; static PyObject *__pyx_empty_bytes; static int __pyx_lineno; static int __pyx_clineno = 0; static const char * __pyx_cfilenm= __FILE__; static const char *__pyx_filename; static const char *__pyx_f[] = { "pygame_sdl2/power.pyx", }; /*--- Type declarations ---*/ #ifndef CYTHON_REFNANNY #define CYTHON_REFNANNY 0 #endif #if CYTHON_REFNANNY typedef struct { void (*INCREF)(void*, PyObject*, int); void (*DECREF)(void*, PyObject*, int); void (*GOTREF)(void*, PyObject*, int); void (*GIVEREF)(void*, PyObject*, int); void* (*SetupContext)(const char*, int, const char*); void (*FinishContext)(void**); } __Pyx_RefNannyAPIStruct; static __Pyx_RefNannyAPIStruct *__Pyx_RefNanny = NULL; static __Pyx_RefNannyAPIStruct *__Pyx_RefNannyImportAPI(const char *modname); #define __Pyx_RefNannyDeclarations void *__pyx_refnanny = NULL; #ifdef WITH_THREAD #define __Pyx_RefNannySetupContext(name, acquire_gil) \ if (acquire_gil) { \ PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure(); \ __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), __LINE__, __FILE__); \ PyGILState_Release(__pyx_gilstate_save); \ } else { \ __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), __LINE__, __FILE__); \ } #else #define __Pyx_RefNannySetupContext(name, acquire_gil) \ __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), __LINE__, __FILE__) #endif #define __Pyx_RefNannyFinishContext() \ __Pyx_RefNanny->FinishContext(&__pyx_refnanny) #define __Pyx_INCREF(r) __Pyx_RefNanny->INCREF(__pyx_refnanny, (PyObject *)(r), __LINE__) #define __Pyx_DECREF(r) __Pyx_RefNanny->DECREF(__pyx_refnanny, (PyObject *)(r), __LINE__) #define __Pyx_GOTREF(r) __Pyx_RefNanny->GOTREF(__pyx_refnanny, (PyObject *)(r), __LINE__) #define __Pyx_GIVEREF(r) __Pyx_RefNanny->GIVEREF(__pyx_refnanny, (PyObject *)(r), __LINE__) #define __Pyx_XINCREF(r) do { if((r) != NULL) {__Pyx_INCREF(r); }} while(0) #define __Pyx_XDECREF(r) do { if((r) != NULL) {__Pyx_DECREF(r); }} while(0) #define __Pyx_XGOTREF(r) do { if((r) != NULL) {__Pyx_GOTREF(r); }} while(0) #define __Pyx_XGIVEREF(r) do { if((r) != NULL) {__Pyx_GIVEREF(r);}} while(0) #else #define __Pyx_RefNannyDeclarations #define __Pyx_RefNannySetupContext(name, acquire_gil) #define __Pyx_RefNannyFinishContext() #define __Pyx_INCREF(r) Py_INCREF(r) #define __Pyx_DECREF(r) Py_DECREF(r) #define __Pyx_GOTREF(r) #define __Pyx_GIVEREF(r) #define __Pyx_XINCREF(r) Py_XINCREF(r) #define __Pyx_XDECREF(r) Py_XDECREF(r) #define __Pyx_XGOTREF(r) #define __Pyx_XGIVEREF(r) #endif #define __Pyx_XDECREF_SET(r, v) do { \ PyObject *tmp = (PyObject *) r; \ r = v; __Pyx_XDECREF(tmp); \ } while (0) #define __Pyx_DECREF_SET(r, v) do { \ PyObject *tmp = (PyObject *) r; \ r = v; __Pyx_DECREF(tmp); \ } while (0) #define __Pyx_CLEAR(r) do { PyObject* tmp = ((PyObject*)(r)); r = NULL; __Pyx_DECREF(tmp);} while(0) #define __Pyx_XCLEAR(r) do { if((r) != NULL) {PyObject* tmp = ((PyObject*)(r)); r = NULL; __Pyx_DECREF(tmp);}} while(0) #if CYTHON_COMPILING_IN_CPYTHON static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStr(PyObject* obj, PyObject* attr_name) { PyTypeObject* tp = Py_TYPE(obj); if (likely(tp->tp_getattro)) return tp->tp_getattro(obj, attr_name); #if PY_MAJOR_VERSION < 3 if (likely(tp->tp_getattr)) return tp->tp_getattr(obj, PyString_AS_STRING(attr_name)); #endif return PyObject_GetAttr(obj, attr_name); } #else #define __Pyx_PyObject_GetAttrStr(o,n) PyObject_GetAttr(o,n) #endif static PyObject *__Pyx_GetBuiltinName(PyObject *name); static CYTHON_INLINE PyObject *__Pyx_GetModuleGlobalName(PyObject *name); #if CYTHON_COMPILING_IN_CPYTHON static CYTHON_INLINE PyObject* __Pyx_PyObject_Call(PyObject *func, PyObject *arg, PyObject *kw); #else #define __Pyx_PyObject_Call(func, arg, kw) PyObject_Call(func, arg, kw) #endif #if CYTHON_COMPILING_IN_CPYTHON static CYTHON_INLINE PyObject* __Pyx_PyObject_CallMethO(PyObject *func, PyObject *arg); #endif static CYTHON_INLINE PyObject* __Pyx_PyObject_CallOneArg(PyObject *func, PyObject *arg); #if CYTHON_COMPILING_IN_CPYTHON static CYTHON_INLINE PyObject* __Pyx_PyObject_CallNoArg(PyObject *func); #else #define __Pyx_PyObject_CallNoArg(func) __Pyx_PyObject_Call(func, __pyx_empty_tuple, NULL) #endif #if CYTHON_COMPILING_IN_CPYTHON #define __Pyx_PyObject_DelAttrStr(o,n) __Pyx_PyObject_SetAttrStr(o,n,NULL) static CYTHON_INLINE int __Pyx_PyObject_SetAttrStr(PyObject* obj, PyObject* attr_name, PyObject* value) { PyTypeObject* tp = Py_TYPE(obj); if (likely(tp->tp_setattro)) return tp->tp_setattro(obj, attr_name, value); #if PY_MAJOR_VERSION < 3 if (likely(tp->tp_setattr)) return tp->tp_setattr(obj, PyString_AS_STRING(attr_name), value); #endif return PyObject_SetAttr(obj, attr_name, value); } #else #define __Pyx_PyObject_DelAttrStr(o,n) PyObject_DelAttr(o,n) #define __Pyx_PyObject_SetAttrStr(o,n,v) PyObject_SetAttr(o,n,v) #endif static PyObject* __Pyx_ImportFrom(PyObject* module, PyObject* name); static PyObject *__Pyx_CalculateMetaclass(PyTypeObject *metaclass, PyObject *bases); static PyTypeObject* __Pyx_FetchCommonType(PyTypeObject* type); #define __Pyx_CyFunction_USED 1 #include #define __Pyx_CYFUNCTION_STATICMETHOD 0x01 #define __Pyx_CYFUNCTION_CLASSMETHOD 0x02 #define __Pyx_CYFUNCTION_CCLASS 0x04 #define __Pyx_CyFunction_GetClosure(f) \ (((__pyx_CyFunctionObject *) (f))->func_closure) #define __Pyx_CyFunction_GetClassObj(f) \ (((__pyx_CyFunctionObject *) (f))->func_classobj) #define __Pyx_CyFunction_Defaults(type, f) \ ((type *)(((__pyx_CyFunctionObject *) (f))->defaults)) #define __Pyx_CyFunction_SetDefaultsGetter(f, g) \ ((__pyx_CyFunctionObject *) (f))->defaults_getter = (g) typedef struct { PyCFunctionObject func; #if PY_VERSION_HEX < 0x030500A0 PyObject *func_weakreflist; #endif PyObject *func_dict; PyObject *func_name; PyObject *func_qualname; PyObject *func_doc; PyObject *func_globals; PyObject *func_code; PyObject *func_closure; PyObject *func_classobj; void *defaults; int defaults_pyobjects; int flags; PyObject *defaults_tuple; PyObject *defaults_kwdict; PyObject *(*defaults_getter)(PyObject *); PyObject *func_annotations; } __pyx_CyFunctionObject; static PyTypeObject *__pyx_CyFunctionType = 0; #define __Pyx_CyFunction_NewEx(ml, flags, qualname, self, module, globals, code) \ __Pyx_CyFunction_New(__pyx_CyFunctionType, ml, flags, qualname, self, module, globals, code) static PyObject *__Pyx_CyFunction_New(PyTypeObject *, PyMethodDef *ml, int flags, PyObject* qualname, PyObject *self, PyObject *module, PyObject *globals, PyObject* code); static CYTHON_INLINE void *__Pyx_CyFunction_InitDefaults(PyObject *m, size_t size, int pyobjects); static CYTHON_INLINE void __Pyx_CyFunction_SetDefaultsTuple(PyObject *m, PyObject *tuple); static CYTHON_INLINE void __Pyx_CyFunction_SetDefaultsKwDict(PyObject *m, PyObject *dict); static CYTHON_INLINE void __Pyx_CyFunction_SetAnnotationsDict(PyObject *m, PyObject *dict); static int __Pyx_CyFunction_init(void); static PyObject *__Pyx_Py3MetaclassPrepare(PyObject *metaclass, PyObject *bases, PyObject *name, PyObject *qualname, PyObject *mkw, PyObject *modname, PyObject *doc); static PyObject *__Pyx_Py3ClassCreate(PyObject *metaclass, PyObject *name, PyObject *bases, PyObject *dict, PyObject *mkw, int calculate_metaclass, int allow_py2_metaclass); typedef struct { int code_line; PyCodeObject* code_object; } __Pyx_CodeObjectCacheEntry; struct __Pyx_CodeObjectCache { int count; int max_count; __Pyx_CodeObjectCacheEntry* entries; }; static struct __Pyx_CodeObjectCache __pyx_code_cache = {0,0,NULL}; static int __pyx_bisect_code_objects(__Pyx_CodeObjectCacheEntry* entries, int count, int code_line); static PyCodeObject *__pyx_find_code_object(int code_line); static void __pyx_insert_code_object(int code_line, PyCodeObject* code_object); static void __Pyx_AddTraceback(const char *funcname, int c_line, int py_line, const char *filename); static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list, int level); static CYTHON_INLINE PyObject* __Pyx_PyInt_From_int(int value); static CYTHON_INLINE PyObject* __Pyx_PyInt_From_long(long value); static CYTHON_INLINE long __Pyx_PyInt_As_long(PyObject *); static CYTHON_INLINE int __Pyx_PyInt_As_int(PyObject *); static int __Pyx_check_binary_version(void); static int __Pyx_InitStrings(__Pyx_StringTabEntry *t); /* Module declarations from 'libc.stdint' */ /* Module declarations from 'libc.string' */ /* Module declarations from 'libc.stdio' */ /* Module declarations from 'libc.stddef' */ /* Module declarations from 'sdl2' */ /* Module declarations from 'pygame_sdl2.power' */ #define __Pyx_MODULE_NAME "pygame_sdl2.power" int __pyx_module_is_main_pygame_sdl2__power = 0; /* Implementation of 'pygame_sdl2.power' */ static PyObject *__pyx_builtin_object; static PyObject *__pyx_pf_11pygame_sdl2_5power_9PowerInfo___repr__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_5power_get_power_info(CYTHON_UNUSED PyObject *__pyx_self); /* proto */ static char __pyx_k_rv[] = "rv"; static char __pyx_k_doc[] = "__doc__"; static char __pyx_k_get[] = "get"; static char __pyx_k_main[] = "__main__"; static char __pyx_k_repr[] = "__repr__"; static char __pyx_k_self[] = "self"; static char __pyx_k_test[] = "__test__"; static char __pyx_k_state[] = "state"; static char __pyx_k_format[] = "format"; static char __pyx_k_import[] = "__import__"; static char __pyx_k_module[] = "__module__"; static char __pyx_k_object[] = "object"; static char __pyx_k_INVALID[] = "INVALID"; static char __pyx_k_percent[] = "percent"; static char __pyx_k_prepare[] = "__prepare__"; static char __pyx_k_seconds[] = "seconds"; static char __pyx_k_qualname[] = "__qualname__"; static char __pyx_k_PowerInfo[] = "PowerInfo"; static char __pyx_k_metaclass[] = "__metaclass__"; static char __pyx_k_get_power_info[] = "get_power_info"; static char __pyx_k_PowerInfo___repr[] = "PowerInfo.__repr__"; static char __pyx_k_pygame_sdl2_power[] = "pygame_sdl2.power"; static char __pyx_k_POWERSTATE_CHARGED[] = "POWERSTATE_CHARGED"; static char __pyx_k_POWERSTATE_UNKNOWN[] = "POWERSTATE_UNKNOWN"; static char __pyx_k_powerstate_to_name[] = "powerstate_to_name"; static char __pyx_k_pygame_sdl2_locals[] = "pygame_sdl2.locals"; static char __pyx_k_POWERSTATE_CHARGING[] = "POWERSTATE_CHARGING"; static char __pyx_k_POWERSTATE_NO_BATTERY[] = "POWERSTATE_NO_BATTERY"; static char __pyx_k_POWERSTATE_ON_BATTERY[] = "POWERSTATE_ON_BATTERY"; static char __pyx_k_PowerInfo_state_seconds_percent[] = ""; static char __pyx_k_Users_tom_ab_pygame_sdl2_src_py[] = "/Users/tom/ab/pygame_sdl2/src/pygame_sdl2/power.pyx"; static PyObject *__pyx_n_s_INVALID; static PyObject *__pyx_n_s_POWERSTATE_CHARGED; static PyObject *__pyx_n_s_POWERSTATE_CHARGING; static PyObject *__pyx_n_s_POWERSTATE_NO_BATTERY; static PyObject *__pyx_n_s_POWERSTATE_ON_BATTERY; static PyObject *__pyx_n_s_POWERSTATE_UNKNOWN; static PyObject *__pyx_n_s_PowerInfo; static PyObject *__pyx_n_s_PowerInfo___repr; static PyObject *__pyx_kp_s_PowerInfo_state_seconds_percent; static PyObject *__pyx_kp_s_Users_tom_ab_pygame_sdl2_src_py; static PyObject *__pyx_n_s_doc; static PyObject *__pyx_n_s_format; static PyObject *__pyx_n_s_get; static PyObject *__pyx_n_s_get_power_info; static PyObject *__pyx_n_s_import; static PyObject *__pyx_n_s_main; static PyObject *__pyx_n_s_metaclass; static PyObject *__pyx_n_s_module; static PyObject *__pyx_n_s_object; static PyObject *__pyx_n_s_percent; static PyObject *__pyx_n_s_powerstate_to_name; static PyObject *__pyx_n_s_prepare; static PyObject *__pyx_n_s_pygame_sdl2_locals; static PyObject *__pyx_n_s_pygame_sdl2_power; static PyObject *__pyx_n_s_qualname; static PyObject *__pyx_n_s_repr; static PyObject *__pyx_n_s_rv; static PyObject *__pyx_n_s_seconds; static PyObject *__pyx_n_s_self; static PyObject *__pyx_n_s_state; static PyObject *__pyx_n_s_test; static PyObject *__pyx_tuple_; static PyObject *__pyx_tuple__3; static PyObject *__pyx_codeobj__2; static PyObject *__pyx_codeobj__4; /* "pygame_sdl2/power.pyx":33 * * class PowerInfo(object): * def __repr__(self): # <<<<<<<<<<<<<< * return "".format( * powerstate_to_name.get(self.state, "INVALID"), */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_5power_9PowerInfo_1__repr__(PyObject *__pyx_self, PyObject *__pyx_v_self); /*proto*/ static PyMethodDef __pyx_mdef_11pygame_sdl2_5power_9PowerInfo_1__repr__ = {"__repr__", (PyCFunction)__pyx_pw_11pygame_sdl2_5power_9PowerInfo_1__repr__, METH_O, 0}; static PyObject *__pyx_pw_11pygame_sdl2_5power_9PowerInfo_1__repr__(PyObject *__pyx_self, PyObject *__pyx_v_self) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__repr__ (wrapper)", 0); __pyx_r = __pyx_pf_11pygame_sdl2_5power_9PowerInfo___repr__(__pyx_self, ((PyObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_5power_9PowerInfo___repr__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; PyObject *__pyx_t_5 = NULL; PyObject *__pyx_t_6 = NULL; Py_ssize_t __pyx_t_7; PyObject *__pyx_t_8 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__repr__", 0); /* "pygame_sdl2/power.pyx":34 * class PowerInfo(object): * def __repr__(self): * return "".format( # <<<<<<<<<<<<<< * powerstate_to_name.get(self.state, "INVALID"), * self.seconds, */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_kp_s_PowerInfo_state_seconds_percent, __pyx_n_s_format); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 34; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); /* "pygame_sdl2/power.pyx":35 * def __repr__(self): * return "".format( * powerstate_to_name.get(self.state, "INVALID"), # <<<<<<<<<<<<<< * self.seconds, * self.percent) */ __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_powerstate_to_name); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 35; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_get); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 35; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_state); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 35; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); __pyx_t_6 = NULL; __pyx_t_7 = 0; if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_5))) { __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_5); if (likely(__pyx_t_6)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5); __Pyx_INCREF(__pyx_t_6); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_5, function); __pyx_t_7 = 1; } } __pyx_t_8 = PyTuple_New(2+__pyx_t_7); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 35; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_8); if (__pyx_t_6) { PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_6); __Pyx_GIVEREF(__pyx_t_6); __pyx_t_6 = NULL; } PyTuple_SET_ITEM(__pyx_t_8, 0+__pyx_t_7, __pyx_t_4); __Pyx_GIVEREF(__pyx_t_4); __Pyx_INCREF(__pyx_n_s_INVALID); PyTuple_SET_ITEM(__pyx_t_8, 1+__pyx_t_7, __pyx_n_s_INVALID); __Pyx_GIVEREF(__pyx_n_s_INVALID); __pyx_t_4 = 0; __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_8, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 35; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; /* "pygame_sdl2/power.pyx":36 * return "".format( * powerstate_to_name.get(self.state, "INVALID"), * self.seconds, # <<<<<<<<<<<<<< * self.percent) * */ __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_seconds); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 36; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); /* "pygame_sdl2/power.pyx":37 * powerstate_to_name.get(self.state, "INVALID"), * self.seconds, * self.percent) # <<<<<<<<<<<<<< * * def get_power_info(): */ __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_percent); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 37; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_8); __pyx_t_4 = NULL; __pyx_t_7 = 0; if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_2))) { __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_2); if (likely(__pyx_t_4)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_4); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); __pyx_t_7 = 1; } } __pyx_t_6 = PyTuple_New(3+__pyx_t_7); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 34; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_6); if (__pyx_t_4) { PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_4); __Pyx_GIVEREF(__pyx_t_4); __pyx_t_4 = NULL; } PyTuple_SET_ITEM(__pyx_t_6, 0+__pyx_t_7, __pyx_t_3); __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_6, 1+__pyx_t_7, __pyx_t_5); __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_6, 2+__pyx_t_7, __pyx_t_8); __Pyx_GIVEREF(__pyx_t_8); __pyx_t_3 = 0; __pyx_t_5 = 0; __pyx_t_8 = 0; __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_6, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 34; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "pygame_sdl2/power.pyx":33 * * class PowerInfo(object): * def __repr__(self): # <<<<<<<<<<<<<< * return "".format( * powerstate_to_name.get(self.state, "INVALID"), */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_5); __Pyx_XDECREF(__pyx_t_6); __Pyx_XDECREF(__pyx_t_8); __Pyx_AddTraceback("pygame_sdl2.power.PowerInfo.__repr__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/power.pyx":39 * self.percent) * * def get_power_info(): # <<<<<<<<<<<<<< * * cdef int seconds */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_5power_1get_power_info(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused); /*proto*/ static PyMethodDef __pyx_mdef_11pygame_sdl2_5power_1get_power_info = {"get_power_info", (PyCFunction)__pyx_pw_11pygame_sdl2_5power_1get_power_info, METH_NOARGS, 0}; static PyObject *__pyx_pw_11pygame_sdl2_5power_1get_power_info(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("get_power_info (wrapper)", 0); __pyx_r = __pyx_pf_11pygame_sdl2_5power_get_power_info(__pyx_self); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_5power_get_power_info(CYTHON_UNUSED PyObject *__pyx_self) { int __pyx_v_seconds; int __pyx_v_percent; SDL_PowerState __pyx_v_state; PyObject *__pyx_v_rv = NULL; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("get_power_info", 0); /* "pygame_sdl2/power.pyx":44 * cdef int percent * * state = SDL_GetPowerInfo(&seconds, &percent) # <<<<<<<<<<<<<< * * rv = PowerInfo() */ __pyx_v_state = SDL_GetPowerInfo((&__pyx_v_seconds), (&__pyx_v_percent)); /* "pygame_sdl2/power.pyx":46 * state = SDL_GetPowerInfo(&seconds, &percent) * * rv = PowerInfo() # <<<<<<<<<<<<<< * rv.state = state * rv.seconds = seconds */ __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_PowerInfo); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 46; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = NULL; if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_2))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); if (likely(__pyx_t_3)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); } } if (__pyx_t_3) { __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 46; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } else { __pyx_t_1 = __Pyx_PyObject_CallNoArg(__pyx_t_2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 46; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_v_rv = __pyx_t_1; __pyx_t_1 = 0; /* "pygame_sdl2/power.pyx":47 * * rv = PowerInfo() * rv.state = state # <<<<<<<<<<<<<< * rv.seconds = seconds * rv.percent = percent */ __pyx_t_1 = PyInt_FromLong(__pyx_v_state); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 47; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); if (__Pyx_PyObject_SetAttrStr(__pyx_v_rv, __pyx_n_s_state, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 47; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "pygame_sdl2/power.pyx":48 * rv = PowerInfo() * rv.state = state * rv.seconds = seconds # <<<<<<<<<<<<<< * rv.percent = percent * */ __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_seconds); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 48; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); if (__Pyx_PyObject_SetAttrStr(__pyx_v_rv, __pyx_n_s_seconds, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 48; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "pygame_sdl2/power.pyx":49 * rv.state = state * rv.seconds = seconds * rv.percent = percent # <<<<<<<<<<<<<< * * return rv */ __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_percent); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 49; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); if (__Pyx_PyObject_SetAttrStr(__pyx_v_rv, __pyx_n_s_percent, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 49; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "pygame_sdl2/power.pyx":51 * rv.percent = percent * * return rv # <<<<<<<<<<<<<< * * */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(__pyx_v_rv); __pyx_r = __pyx_v_rv; goto __pyx_L0; /* "pygame_sdl2/power.pyx":39 * self.percent) * * def get_power_info(): # <<<<<<<<<<<<<< * * cdef int seconds */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("pygame_sdl2.power.get_power_info", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF(__pyx_v_rv); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyMethodDef __pyx_methods[] = { {0, 0, 0, 0} }; #if PY_MAJOR_VERSION >= 3 static struct PyModuleDef __pyx_moduledef = { #if PY_VERSION_HEX < 0x03020000 { PyObject_HEAD_INIT(NULL) NULL, 0, NULL }, #else PyModuleDef_HEAD_INIT, #endif "power", 0, /* m_doc */ -1, /* m_size */ __pyx_methods /* m_methods */, NULL, /* m_reload */ NULL, /* m_traverse */ NULL, /* m_clear */ NULL /* m_free */ }; #endif static __Pyx_StringTabEntry __pyx_string_tab[] = { {&__pyx_n_s_INVALID, __pyx_k_INVALID, sizeof(__pyx_k_INVALID), 0, 0, 1, 1}, {&__pyx_n_s_POWERSTATE_CHARGED, __pyx_k_POWERSTATE_CHARGED, sizeof(__pyx_k_POWERSTATE_CHARGED), 0, 0, 1, 1}, {&__pyx_n_s_POWERSTATE_CHARGING, __pyx_k_POWERSTATE_CHARGING, sizeof(__pyx_k_POWERSTATE_CHARGING), 0, 0, 1, 1}, {&__pyx_n_s_POWERSTATE_NO_BATTERY, __pyx_k_POWERSTATE_NO_BATTERY, sizeof(__pyx_k_POWERSTATE_NO_BATTERY), 0, 0, 1, 1}, {&__pyx_n_s_POWERSTATE_ON_BATTERY, __pyx_k_POWERSTATE_ON_BATTERY, sizeof(__pyx_k_POWERSTATE_ON_BATTERY), 0, 0, 1, 1}, {&__pyx_n_s_POWERSTATE_UNKNOWN, __pyx_k_POWERSTATE_UNKNOWN, sizeof(__pyx_k_POWERSTATE_UNKNOWN), 0, 0, 1, 1}, {&__pyx_n_s_PowerInfo, __pyx_k_PowerInfo, sizeof(__pyx_k_PowerInfo), 0, 0, 1, 1}, {&__pyx_n_s_PowerInfo___repr, __pyx_k_PowerInfo___repr, sizeof(__pyx_k_PowerInfo___repr), 0, 0, 1, 1}, {&__pyx_kp_s_PowerInfo_state_seconds_percent, __pyx_k_PowerInfo_state_seconds_percent, sizeof(__pyx_k_PowerInfo_state_seconds_percent), 0, 0, 1, 0}, {&__pyx_kp_s_Users_tom_ab_pygame_sdl2_src_py, __pyx_k_Users_tom_ab_pygame_sdl2_src_py, sizeof(__pyx_k_Users_tom_ab_pygame_sdl2_src_py), 0, 0, 1, 0}, {&__pyx_n_s_doc, __pyx_k_doc, sizeof(__pyx_k_doc), 0, 0, 1, 1}, {&__pyx_n_s_format, __pyx_k_format, sizeof(__pyx_k_format), 0, 0, 1, 1}, {&__pyx_n_s_get, __pyx_k_get, sizeof(__pyx_k_get), 0, 0, 1, 1}, {&__pyx_n_s_get_power_info, __pyx_k_get_power_info, sizeof(__pyx_k_get_power_info), 0, 0, 1, 1}, {&__pyx_n_s_import, __pyx_k_import, sizeof(__pyx_k_import), 0, 0, 1, 1}, {&__pyx_n_s_main, __pyx_k_main, sizeof(__pyx_k_main), 0, 0, 1, 1}, {&__pyx_n_s_metaclass, __pyx_k_metaclass, sizeof(__pyx_k_metaclass), 0, 0, 1, 1}, {&__pyx_n_s_module, __pyx_k_module, sizeof(__pyx_k_module), 0, 0, 1, 1}, {&__pyx_n_s_object, __pyx_k_object, sizeof(__pyx_k_object), 0, 0, 1, 1}, {&__pyx_n_s_percent, __pyx_k_percent, sizeof(__pyx_k_percent), 0, 0, 1, 1}, {&__pyx_n_s_powerstate_to_name, __pyx_k_powerstate_to_name, sizeof(__pyx_k_powerstate_to_name), 0, 0, 1, 1}, {&__pyx_n_s_prepare, __pyx_k_prepare, sizeof(__pyx_k_prepare), 0, 0, 1, 1}, {&__pyx_n_s_pygame_sdl2_locals, __pyx_k_pygame_sdl2_locals, sizeof(__pyx_k_pygame_sdl2_locals), 0, 0, 1, 1}, {&__pyx_n_s_pygame_sdl2_power, __pyx_k_pygame_sdl2_power, sizeof(__pyx_k_pygame_sdl2_power), 0, 0, 1, 1}, {&__pyx_n_s_qualname, __pyx_k_qualname, sizeof(__pyx_k_qualname), 0, 0, 1, 1}, {&__pyx_n_s_repr, __pyx_k_repr, sizeof(__pyx_k_repr), 0, 0, 1, 1}, {&__pyx_n_s_rv, __pyx_k_rv, sizeof(__pyx_k_rv), 0, 0, 1, 1}, {&__pyx_n_s_seconds, __pyx_k_seconds, sizeof(__pyx_k_seconds), 0, 0, 1, 1}, {&__pyx_n_s_self, __pyx_k_self, sizeof(__pyx_k_self), 0, 0, 1, 1}, {&__pyx_n_s_state, __pyx_k_state, sizeof(__pyx_k_state), 0, 0, 1, 1}, {&__pyx_n_s_test, __pyx_k_test, sizeof(__pyx_k_test), 0, 0, 1, 1}, {0, 0, 0, 0, 0, 0, 0} }; static int __Pyx_InitCachedBuiltins(void) { __pyx_builtin_object = __Pyx_GetBuiltinName(__pyx_n_s_object); if (!__pyx_builtin_object) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 32; __pyx_clineno = __LINE__; goto __pyx_L1_error;} return 0; __pyx_L1_error:; return -1; } static int __Pyx_InitCachedConstants(void) { __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__Pyx_InitCachedConstants", 0); /* "pygame_sdl2/power.pyx":33 * * class PowerInfo(object): * def __repr__(self): # <<<<<<<<<<<<<< * return "".format( * powerstate_to_name.get(self.state, "INVALID"), */ __pyx_tuple_ = PyTuple_Pack(1, __pyx_n_s_self); if (unlikely(!__pyx_tuple_)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 33; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_tuple_); __Pyx_GIVEREF(__pyx_tuple_); __pyx_codeobj__2 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple_, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_tom_ab_pygame_sdl2_src_py, __pyx_n_s_repr, 33, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 33; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "pygame_sdl2/power.pyx":39 * self.percent) * * def get_power_info(): # <<<<<<<<<<<<<< * * cdef int seconds */ __pyx_tuple__3 = PyTuple_Pack(4, __pyx_n_s_seconds, __pyx_n_s_percent, __pyx_n_s_state, __pyx_n_s_rv); if (unlikely(!__pyx_tuple__3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 39; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_tuple__3); __Pyx_GIVEREF(__pyx_tuple__3); __pyx_codeobj__4 = (PyObject*)__Pyx_PyCode_New(0, 0, 4, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__3, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_tom_ab_pygame_sdl2_src_py, __pyx_n_s_get_power_info, 39, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 39; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_RefNannyFinishContext(); return 0; __pyx_L1_error:; __Pyx_RefNannyFinishContext(); return -1; } static int __Pyx_InitGlobals(void) { if (__Pyx_InitStrings(__pyx_string_tab) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; return 0; __pyx_L1_error:; return -1; } #if PY_MAJOR_VERSION < 3 PyMODINIT_FUNC initpower(void); /*proto*/ PyMODINIT_FUNC initpower(void) #else PyMODINIT_FUNC PyInit_power(void); /*proto*/ PyMODINIT_FUNC PyInit_power(void) #endif { PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannyDeclarations #if CYTHON_REFNANNY __Pyx_RefNanny = __Pyx_RefNannyImportAPI("refnanny"); if (!__Pyx_RefNanny) { PyErr_Clear(); __Pyx_RefNanny = __Pyx_RefNannyImportAPI("Cython.Runtime.refnanny"); if (!__Pyx_RefNanny) Py_FatalError("failed to import 'refnanny' module"); } #endif __Pyx_RefNannySetupContext("PyMODINIT_FUNC PyInit_power(void)", 0); if ( __Pyx_check_binary_version() < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_empty_tuple = PyTuple_New(0); if (unlikely(!__pyx_empty_tuple)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_empty_bytes = PyBytes_FromStringAndSize("", 0); if (unlikely(!__pyx_empty_bytes)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} #ifdef __Pyx_CyFunction_USED if (__Pyx_CyFunction_init() < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} #endif #ifdef __Pyx_FusedFunction_USED if (__pyx_FusedFunction_init() < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} #endif #ifdef __Pyx_Generator_USED if (__pyx_Generator_init() < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} #endif /*--- Library function declarations ---*/ /*--- Threads initialization code ---*/ #if defined(__PYX_FORCE_INIT_THREADS) && __PYX_FORCE_INIT_THREADS #ifdef WITH_THREAD /* Python build with threading support? */ PyEval_InitThreads(); #endif #endif /*--- Module creation code ---*/ #if PY_MAJOR_VERSION < 3 __pyx_m = Py_InitModule4("power", __pyx_methods, 0, 0, PYTHON_API_VERSION); Py_XINCREF(__pyx_m); #else __pyx_m = PyModule_Create(&__pyx_moduledef); #endif if (unlikely(!__pyx_m)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_d = PyModule_GetDict(__pyx_m); if (unlikely(!__pyx_d)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} Py_INCREF(__pyx_d); __pyx_b = PyImport_AddModule(__Pyx_BUILTIN_MODULE_NAME); if (unlikely(!__pyx_b)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} #if CYTHON_COMPILING_IN_PYPY Py_INCREF(__pyx_b); #endif if (PyObject_SetAttrString(__pyx_m, "__builtins__", __pyx_b) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; /*--- Initialize various global constants etc. ---*/ if (unlikely(__Pyx_InitGlobals() < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} #if PY_MAJOR_VERSION < 3 && (__PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT) if (__Pyx_init_sys_getdefaultencoding_params() < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} #endif if (__pyx_module_is_main_pygame_sdl2__power) { if (PyObject_SetAttrString(__pyx_m, "__name__", __pyx_n_s_main) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; } #if PY_MAJOR_VERSION >= 3 { PyObject *modules = PyImport_GetModuleDict(); if (unlikely(!modules)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} if (!PyDict_GetItemString(modules, "pygame_sdl2.power")) { if (unlikely(PyDict_SetItemString(modules, "pygame_sdl2.power", __pyx_m) < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } } #endif /*--- Builtin init code ---*/ if (unlikely(__Pyx_InitCachedBuiltins() < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /*--- Constants init code ---*/ if (unlikely(__Pyx_InitCachedConstants() < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /*--- Global init code ---*/ /*--- Variable export code ---*/ /*--- Function export code ---*/ /*--- Type init code ---*/ /*--- Type import code ---*/ /*--- Variable import code ---*/ /*--- Function import code ---*/ /*--- Execution code ---*/ /* "pygame_sdl2/power.pyx":19 * # 3. This notice may not be removed or altered from any source distribution. * * from pygame_sdl2.locals import POWERSTATE_UNKNOWN, POWERSTATE_ON_BATTERY, POWERSTATE_NO_BATTERY, POWERSTATE_CHARGING, POWERSTATE_CHARGED # <<<<<<<<<<<<<< * * from sdl2 cimport * */ __pyx_t_1 = PyList_New(5); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 19; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __Pyx_INCREF(__pyx_n_s_POWERSTATE_UNKNOWN); PyList_SET_ITEM(__pyx_t_1, 0, __pyx_n_s_POWERSTATE_UNKNOWN); __Pyx_GIVEREF(__pyx_n_s_POWERSTATE_UNKNOWN); __Pyx_INCREF(__pyx_n_s_POWERSTATE_ON_BATTERY); PyList_SET_ITEM(__pyx_t_1, 1, __pyx_n_s_POWERSTATE_ON_BATTERY); __Pyx_GIVEREF(__pyx_n_s_POWERSTATE_ON_BATTERY); __Pyx_INCREF(__pyx_n_s_POWERSTATE_NO_BATTERY); PyList_SET_ITEM(__pyx_t_1, 2, __pyx_n_s_POWERSTATE_NO_BATTERY); __Pyx_GIVEREF(__pyx_n_s_POWERSTATE_NO_BATTERY); __Pyx_INCREF(__pyx_n_s_POWERSTATE_CHARGING); PyList_SET_ITEM(__pyx_t_1, 3, __pyx_n_s_POWERSTATE_CHARGING); __Pyx_GIVEREF(__pyx_n_s_POWERSTATE_CHARGING); __Pyx_INCREF(__pyx_n_s_POWERSTATE_CHARGED); PyList_SET_ITEM(__pyx_t_1, 4, __pyx_n_s_POWERSTATE_CHARGED); __Pyx_GIVEREF(__pyx_n_s_POWERSTATE_CHARGED); __pyx_t_2 = __Pyx_Import(__pyx_n_s_pygame_sdl2_locals, __pyx_t_1, -1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 19; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_1 = __Pyx_ImportFrom(__pyx_t_2, __pyx_n_s_POWERSTATE_UNKNOWN); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 19; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); if (PyDict_SetItem(__pyx_d, __pyx_n_s_POWERSTATE_UNKNOWN, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 19; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_1 = __Pyx_ImportFrom(__pyx_t_2, __pyx_n_s_POWERSTATE_ON_BATTERY); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 19; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); if (PyDict_SetItem(__pyx_d, __pyx_n_s_POWERSTATE_ON_BATTERY, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 19; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_1 = __Pyx_ImportFrom(__pyx_t_2, __pyx_n_s_POWERSTATE_NO_BATTERY); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 19; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); if (PyDict_SetItem(__pyx_d, __pyx_n_s_POWERSTATE_NO_BATTERY, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 19; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_1 = __Pyx_ImportFrom(__pyx_t_2, __pyx_n_s_POWERSTATE_CHARGING); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 19; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); if (PyDict_SetItem(__pyx_d, __pyx_n_s_POWERSTATE_CHARGING, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 19; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_1 = __Pyx_ImportFrom(__pyx_t_2, __pyx_n_s_POWERSTATE_CHARGED); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 19; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); if (PyDict_SetItem(__pyx_d, __pyx_n_s_POWERSTATE_CHARGED, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 19; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "pygame_sdl2/power.pyx":23 * from sdl2 cimport * * * powerstate_to_name = { # <<<<<<<<<<<<<< * POWERSTATE_UNKNOWN : "POWERSTATE_UNKNOWN", * POWERSTATE_ON_BATTERY : "POWERSTATE_ON_BATTERY", */ __pyx_t_2 = PyDict_New(); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 23; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); /* "pygame_sdl2/power.pyx":24 * * powerstate_to_name = { * POWERSTATE_UNKNOWN : "POWERSTATE_UNKNOWN", # <<<<<<<<<<<<<< * POWERSTATE_ON_BATTERY : "POWERSTATE_ON_BATTERY", * POWERSTATE_NO_BATTERY : "POWERSTATE_NO_BATTERY", */ __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_POWERSTATE_UNKNOWN); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 24; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); if (PyDict_SetItem(__pyx_t_2, __pyx_t_1, __pyx_n_s_POWERSTATE_UNKNOWN) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 23; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "pygame_sdl2/power.pyx":25 * powerstate_to_name = { * POWERSTATE_UNKNOWN : "POWERSTATE_UNKNOWN", * POWERSTATE_ON_BATTERY : "POWERSTATE_ON_BATTERY", # <<<<<<<<<<<<<< * POWERSTATE_NO_BATTERY : "POWERSTATE_NO_BATTERY", * POWERSTATE_CHARGING : "POWERSTATE_CHARGING", */ __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_POWERSTATE_ON_BATTERY); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 25; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); if (PyDict_SetItem(__pyx_t_2, __pyx_t_1, __pyx_n_s_POWERSTATE_ON_BATTERY) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 23; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "pygame_sdl2/power.pyx":26 * POWERSTATE_UNKNOWN : "POWERSTATE_UNKNOWN", * POWERSTATE_ON_BATTERY : "POWERSTATE_ON_BATTERY", * POWERSTATE_NO_BATTERY : "POWERSTATE_NO_BATTERY", # <<<<<<<<<<<<<< * POWERSTATE_CHARGING : "POWERSTATE_CHARGING", * POWERSTATE_CHARGED : "POWERSTATE_CHARGED", */ __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_POWERSTATE_NO_BATTERY); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 26; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); if (PyDict_SetItem(__pyx_t_2, __pyx_t_1, __pyx_n_s_POWERSTATE_NO_BATTERY) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 23; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "pygame_sdl2/power.pyx":27 * POWERSTATE_ON_BATTERY : "POWERSTATE_ON_BATTERY", * POWERSTATE_NO_BATTERY : "POWERSTATE_NO_BATTERY", * POWERSTATE_CHARGING : "POWERSTATE_CHARGING", # <<<<<<<<<<<<<< * POWERSTATE_CHARGED : "POWERSTATE_CHARGED", * } */ __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_POWERSTATE_CHARGING); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 27; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); if (PyDict_SetItem(__pyx_t_2, __pyx_t_1, __pyx_n_s_POWERSTATE_CHARGING) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 23; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "pygame_sdl2/power.pyx":28 * POWERSTATE_NO_BATTERY : "POWERSTATE_NO_BATTERY", * POWERSTATE_CHARGING : "POWERSTATE_CHARGING", * POWERSTATE_CHARGED : "POWERSTATE_CHARGED", # <<<<<<<<<<<<<< * } * */ __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_POWERSTATE_CHARGED); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 28; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); if (PyDict_SetItem(__pyx_t_2, __pyx_t_1, __pyx_n_s_POWERSTATE_CHARGED) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 23; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (PyDict_SetItem(__pyx_d, __pyx_n_s_powerstate_to_name, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 23; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "pygame_sdl2/power.pyx":32 * * * class PowerInfo(object): # <<<<<<<<<<<<<< * def __repr__(self): * return "".format( */ __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 32; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __Pyx_INCREF(__pyx_builtin_object); PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_builtin_object); __Pyx_GIVEREF(__pyx_builtin_object); __pyx_t_1 = __Pyx_CalculateMetaclass(NULL, __pyx_t_2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 32; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_t_3 = __Pyx_Py3MetaclassPrepare(__pyx_t_1, __pyx_t_2, __pyx_n_s_PowerInfo, __pyx_n_s_PowerInfo, (PyObject *) NULL, __pyx_n_s_pygame_sdl2_power, (PyObject *) NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 32; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); /* "pygame_sdl2/power.pyx":33 * * class PowerInfo(object): * def __repr__(self): # <<<<<<<<<<<<<< * return "".format( * powerstate_to_name.get(self.state, "INVALID"), */ __pyx_t_4 = __Pyx_CyFunction_NewEx(&__pyx_mdef_11pygame_sdl2_5power_9PowerInfo_1__repr__, 0, __pyx_n_s_PowerInfo___repr, NULL, __pyx_n_s_pygame_sdl2_power, __pyx_d, ((PyObject *)__pyx_codeobj__2)); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 33; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); if (PyObject_SetItem(__pyx_t_3, __pyx_n_s_repr, __pyx_t_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 33; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; /* "pygame_sdl2/power.pyx":32 * * * class PowerInfo(object): # <<<<<<<<<<<<<< * def __repr__(self): * return "".format( */ __pyx_t_4 = __Pyx_Py3ClassCreate(__pyx_t_1, __pyx_n_s_PowerInfo, __pyx_t_2, __pyx_t_3, NULL, 0, 1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 32; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); if (PyDict_SetItem(__pyx_d, __pyx_n_s_PowerInfo, __pyx_t_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 32; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "pygame_sdl2/power.pyx":39 * self.percent) * * def get_power_info(): # <<<<<<<<<<<<<< * * cdef int seconds */ __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_11pygame_sdl2_5power_1get_power_info, NULL, __pyx_n_s_pygame_sdl2_power); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 39; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_get_power_info, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 39; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "pygame_sdl2/power.pyx":1 * # Copyright 2017 Tom Rothamel # <<<<<<<<<<<<<< * # * # This software is provided 'as-is', without any express or implied */ __pyx_t_2 = PyDict_New(); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_test, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /*--- Wrapped vars code ---*/ goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); if (__pyx_m) { if (__pyx_d) { __Pyx_AddTraceback("init pygame_sdl2.power", __pyx_clineno, __pyx_lineno, __pyx_filename); } Py_DECREF(__pyx_m); __pyx_m = 0; } else if (!PyErr_Occurred()) { PyErr_SetString(PyExc_ImportError, "init pygame_sdl2.power"); } __pyx_L0:; __Pyx_RefNannyFinishContext(); #if PY_MAJOR_VERSION < 3 return; #else return __pyx_m; #endif } /* Runtime support code */ #if CYTHON_REFNANNY static __Pyx_RefNannyAPIStruct *__Pyx_RefNannyImportAPI(const char *modname) { PyObject *m = NULL, *p = NULL; void *r = NULL; m = PyImport_ImportModule((char *)modname); if (!m) goto end; p = PyObject_GetAttrString(m, (char *)"RefNannyAPI"); if (!p) goto end; r = PyLong_AsVoidPtr(p); end: Py_XDECREF(p); Py_XDECREF(m); return (__Pyx_RefNannyAPIStruct *)r; } #endif static PyObject *__Pyx_GetBuiltinName(PyObject *name) { PyObject* result = __Pyx_PyObject_GetAttrStr(__pyx_b, name); if (unlikely(!result)) { PyErr_Format(PyExc_NameError, #if PY_MAJOR_VERSION >= 3 "name '%U' is not defined", name); #else "name '%.200s' is not defined", PyString_AS_STRING(name)); #endif } return result; } static CYTHON_INLINE PyObject *__Pyx_GetModuleGlobalName(PyObject *name) { PyObject *result; #if CYTHON_COMPILING_IN_CPYTHON result = PyDict_GetItem(__pyx_d, name); if (likely(result)) { Py_INCREF(result); } else { #else result = PyObject_GetItem(__pyx_d, name); if (!result) { PyErr_Clear(); #endif result = __Pyx_GetBuiltinName(name); } return result; } #if CYTHON_COMPILING_IN_CPYTHON static CYTHON_INLINE PyObject* __Pyx_PyObject_Call(PyObject *func, PyObject *arg, PyObject *kw) { PyObject *result; ternaryfunc call = func->ob_type->tp_call; if (unlikely(!call)) return PyObject_Call(func, arg, kw); if (unlikely(Py_EnterRecursiveCall((char*)" while calling a Python object"))) return NULL; result = (*call)(func, arg, kw); Py_LeaveRecursiveCall(); if (unlikely(!result) && unlikely(!PyErr_Occurred())) { PyErr_SetString( PyExc_SystemError, "NULL result without error in PyObject_Call"); } return result; } #endif #if CYTHON_COMPILING_IN_CPYTHON static CYTHON_INLINE PyObject* __Pyx_PyObject_CallMethO(PyObject *func, PyObject *arg) { PyObject *self, *result; PyCFunction cfunc; cfunc = PyCFunction_GET_FUNCTION(func); self = PyCFunction_GET_SELF(func); if (unlikely(Py_EnterRecursiveCall((char*)" while calling a Python object"))) return NULL; result = cfunc(self, arg); Py_LeaveRecursiveCall(); if (unlikely(!result) && unlikely(!PyErr_Occurred())) { PyErr_SetString( PyExc_SystemError, "NULL result without error in PyObject_Call"); } return result; } #endif #if CYTHON_COMPILING_IN_CPYTHON static PyObject* __Pyx__PyObject_CallOneArg(PyObject *func, PyObject *arg) { PyObject *result; PyObject *args = PyTuple_New(1); if (unlikely(!args)) return NULL; Py_INCREF(arg); PyTuple_SET_ITEM(args, 0, arg); result = __Pyx_PyObject_Call(func, args, NULL); Py_DECREF(args); return result; } static CYTHON_INLINE PyObject* __Pyx_PyObject_CallOneArg(PyObject *func, PyObject *arg) { #ifdef __Pyx_CyFunction_USED if (likely(PyCFunction_Check(func) || PyObject_TypeCheck(func, __pyx_CyFunctionType))) { #else if (likely(PyCFunction_Check(func))) { #endif if (likely(PyCFunction_GET_FLAGS(func) & METH_O)) { return __Pyx_PyObject_CallMethO(func, arg); } } return __Pyx__PyObject_CallOneArg(func, arg); } #else static CYTHON_INLINE PyObject* __Pyx_PyObject_CallOneArg(PyObject *func, PyObject *arg) { PyObject* args = PyTuple_Pack(1, arg); return (likely(args)) ? __Pyx_PyObject_Call(func, args, NULL) : NULL; } #endif #if CYTHON_COMPILING_IN_CPYTHON static CYTHON_INLINE PyObject* __Pyx_PyObject_CallNoArg(PyObject *func) { #ifdef __Pyx_CyFunction_USED if (likely(PyCFunction_Check(func) || PyObject_TypeCheck(func, __pyx_CyFunctionType))) { #else if (likely(PyCFunction_Check(func))) { #endif if (likely(PyCFunction_GET_FLAGS(func) & METH_NOARGS)) { return __Pyx_PyObject_CallMethO(func, NULL); } } return __Pyx_PyObject_Call(func, __pyx_empty_tuple, NULL); } #endif static PyObject* __Pyx_ImportFrom(PyObject* module, PyObject* name) { PyObject* value = __Pyx_PyObject_GetAttrStr(module, name); if (unlikely(!value) && PyErr_ExceptionMatches(PyExc_AttributeError)) { PyErr_Format(PyExc_ImportError, #if PY_MAJOR_VERSION < 3 "cannot import name %.230s", PyString_AS_STRING(name)); #else "cannot import name %S", name); #endif } return value; } static PyObject *__Pyx_CalculateMetaclass(PyTypeObject *metaclass, PyObject *bases) { Py_ssize_t i, nbases = PyTuple_GET_SIZE(bases); for (i=0; i < nbases; i++) { PyTypeObject *tmptype; PyObject *tmp = PyTuple_GET_ITEM(bases, i); tmptype = Py_TYPE(tmp); #if PY_MAJOR_VERSION < 3 if (tmptype == &PyClass_Type) continue; #endif if (!metaclass) { metaclass = tmptype; continue; } if (PyType_IsSubtype(metaclass, tmptype)) continue; if (PyType_IsSubtype(tmptype, metaclass)) { metaclass = tmptype; continue; } PyErr_SetString(PyExc_TypeError, "metaclass conflict: " "the metaclass of a derived class " "must be a (non-strict) subclass " "of the metaclasses of all its bases"); return NULL; } if (!metaclass) { #if PY_MAJOR_VERSION < 3 metaclass = &PyClass_Type; #else metaclass = &PyType_Type; #endif } Py_INCREF((PyObject*) metaclass); return (PyObject*) metaclass; } static PyTypeObject* __Pyx_FetchCommonType(PyTypeObject* type) { PyObject* fake_module; PyTypeObject* cached_type = NULL; fake_module = PyImport_AddModule((char*) "_cython_" CYTHON_ABI); if (!fake_module) return NULL; Py_INCREF(fake_module); cached_type = (PyTypeObject*) PyObject_GetAttrString(fake_module, type->tp_name); if (cached_type) { if (!PyType_Check((PyObject*)cached_type)) { PyErr_Format(PyExc_TypeError, "Shared Cython type %.200s is not a type object", type->tp_name); goto bad; } if (cached_type->tp_basicsize != type->tp_basicsize) { PyErr_Format(PyExc_TypeError, "Shared Cython type %.200s has the wrong size, try recompiling", type->tp_name); goto bad; } } else { if (!PyErr_ExceptionMatches(PyExc_AttributeError)) goto bad; PyErr_Clear(); if (PyType_Ready(type) < 0) goto bad; if (PyObject_SetAttrString(fake_module, type->tp_name, (PyObject*) type) < 0) goto bad; Py_INCREF(type); cached_type = type; } done: Py_DECREF(fake_module); return cached_type; bad: Py_XDECREF(cached_type); cached_type = NULL; goto done; } static PyObject * __Pyx_CyFunction_get_doc(__pyx_CyFunctionObject *op, CYTHON_UNUSED void *closure) { if (unlikely(op->func_doc == NULL)) { if (op->func.m_ml->ml_doc) { #if PY_MAJOR_VERSION >= 3 op->func_doc = PyUnicode_FromString(op->func.m_ml->ml_doc); #else op->func_doc = PyString_FromString(op->func.m_ml->ml_doc); #endif if (unlikely(op->func_doc == NULL)) return NULL; } else { Py_INCREF(Py_None); return Py_None; } } Py_INCREF(op->func_doc); return op->func_doc; } static int __Pyx_CyFunction_set_doc(__pyx_CyFunctionObject *op, PyObject *value) { PyObject *tmp = op->func_doc; if (value == NULL) { value = Py_None; } Py_INCREF(value); op->func_doc = value; Py_XDECREF(tmp); return 0; } static PyObject * __Pyx_CyFunction_get_name(__pyx_CyFunctionObject *op) { if (unlikely(op->func_name == NULL)) { #if PY_MAJOR_VERSION >= 3 op->func_name = PyUnicode_InternFromString(op->func.m_ml->ml_name); #else op->func_name = PyString_InternFromString(op->func.m_ml->ml_name); #endif if (unlikely(op->func_name == NULL)) return NULL; } Py_INCREF(op->func_name); return op->func_name; } static int __Pyx_CyFunction_set_name(__pyx_CyFunctionObject *op, PyObject *value) { PyObject *tmp; #if PY_MAJOR_VERSION >= 3 if (unlikely(value == NULL || !PyUnicode_Check(value))) { #else if (unlikely(value == NULL || !PyString_Check(value))) { #endif PyErr_SetString(PyExc_TypeError, "__name__ must be set to a string object"); return -1; } tmp = op->func_name; Py_INCREF(value); op->func_name = value; Py_XDECREF(tmp); return 0; } static PyObject * __Pyx_CyFunction_get_qualname(__pyx_CyFunctionObject *op) { Py_INCREF(op->func_qualname); return op->func_qualname; } static int __Pyx_CyFunction_set_qualname(__pyx_CyFunctionObject *op, PyObject *value) { PyObject *tmp; #if PY_MAJOR_VERSION >= 3 if (unlikely(value == NULL || !PyUnicode_Check(value))) { #else if (unlikely(value == NULL || !PyString_Check(value))) { #endif PyErr_SetString(PyExc_TypeError, "__qualname__ must be set to a string object"); return -1; } tmp = op->func_qualname; Py_INCREF(value); op->func_qualname = value; Py_XDECREF(tmp); return 0; } static PyObject * __Pyx_CyFunction_get_self(__pyx_CyFunctionObject *m, CYTHON_UNUSED void *closure) { PyObject *self; self = m->func_closure; if (self == NULL) self = Py_None; Py_INCREF(self); return self; } static PyObject * __Pyx_CyFunction_get_dict(__pyx_CyFunctionObject *op) { if (unlikely(op->func_dict == NULL)) { op->func_dict = PyDict_New(); if (unlikely(op->func_dict == NULL)) return NULL; } Py_INCREF(op->func_dict); return op->func_dict; } static int __Pyx_CyFunction_set_dict(__pyx_CyFunctionObject *op, PyObject *value) { PyObject *tmp; if (unlikely(value == NULL)) { PyErr_SetString(PyExc_TypeError, "function's dictionary may not be deleted"); return -1; } if (unlikely(!PyDict_Check(value))) { PyErr_SetString(PyExc_TypeError, "setting function's dictionary to a non-dict"); return -1; } tmp = op->func_dict; Py_INCREF(value); op->func_dict = value; Py_XDECREF(tmp); return 0; } static PyObject * __Pyx_CyFunction_get_globals(__pyx_CyFunctionObject *op) { Py_INCREF(op->func_globals); return op->func_globals; } static PyObject * __Pyx_CyFunction_get_closure(CYTHON_UNUSED __pyx_CyFunctionObject *op) { Py_INCREF(Py_None); return Py_None; } static PyObject * __Pyx_CyFunction_get_code(__pyx_CyFunctionObject *op) { PyObject* result = (op->func_code) ? op->func_code : Py_None; Py_INCREF(result); return result; } static int __Pyx_CyFunction_init_defaults(__pyx_CyFunctionObject *op) { PyObject *res = op->defaults_getter((PyObject *) op); if (unlikely(!res)) return -1; op->defaults_tuple = PyTuple_GET_ITEM(res, 0); Py_INCREF(op->defaults_tuple); op->defaults_kwdict = PyTuple_GET_ITEM(res, 1); Py_INCREF(op->defaults_kwdict); Py_DECREF(res); return 0; } static int __Pyx_CyFunction_set_defaults(__pyx_CyFunctionObject *op, PyObject* value) { PyObject* tmp; if (!value) { value = Py_None; } else if (value != Py_None && !PyTuple_Check(value)) { PyErr_SetString(PyExc_TypeError, "__defaults__ must be set to a tuple object"); return -1; } Py_INCREF(value); tmp = op->defaults_tuple; op->defaults_tuple = value; Py_XDECREF(tmp); return 0; } static PyObject * __Pyx_CyFunction_get_defaults(__pyx_CyFunctionObject *op) { PyObject* result = op->defaults_tuple; if (unlikely(!result)) { if (op->defaults_getter) { if (__Pyx_CyFunction_init_defaults(op) < 0) return NULL; result = op->defaults_tuple; } else { result = Py_None; } } Py_INCREF(result); return result; } static int __Pyx_CyFunction_set_kwdefaults(__pyx_CyFunctionObject *op, PyObject* value) { PyObject* tmp; if (!value) { value = Py_None; } else if (value != Py_None && !PyDict_Check(value)) { PyErr_SetString(PyExc_TypeError, "__kwdefaults__ must be set to a dict object"); return -1; } Py_INCREF(value); tmp = op->defaults_kwdict; op->defaults_kwdict = value; Py_XDECREF(tmp); return 0; } static PyObject * __Pyx_CyFunction_get_kwdefaults(__pyx_CyFunctionObject *op) { PyObject* result = op->defaults_kwdict; if (unlikely(!result)) { if (op->defaults_getter) { if (__Pyx_CyFunction_init_defaults(op) < 0) return NULL; result = op->defaults_kwdict; } else { result = Py_None; } } Py_INCREF(result); return result; } static int __Pyx_CyFunction_set_annotations(__pyx_CyFunctionObject *op, PyObject* value) { PyObject* tmp; if (!value || value == Py_None) { value = NULL; } else if (!PyDict_Check(value)) { PyErr_SetString(PyExc_TypeError, "__annotations__ must be set to a dict object"); return -1; } Py_XINCREF(value); tmp = op->func_annotations; op->func_annotations = value; Py_XDECREF(tmp); return 0; } static PyObject * __Pyx_CyFunction_get_annotations(__pyx_CyFunctionObject *op) { PyObject* result = op->func_annotations; if (unlikely(!result)) { result = PyDict_New(); if (unlikely(!result)) return NULL; op->func_annotations = result; } Py_INCREF(result); return result; } static PyGetSetDef __pyx_CyFunction_getsets[] = { {(char *) "func_doc", (getter)__Pyx_CyFunction_get_doc, (setter)__Pyx_CyFunction_set_doc, 0, 0}, {(char *) "__doc__", (getter)__Pyx_CyFunction_get_doc, (setter)__Pyx_CyFunction_set_doc, 0, 0}, {(char *) "func_name", (getter)__Pyx_CyFunction_get_name, (setter)__Pyx_CyFunction_set_name, 0, 0}, {(char *) "__name__", (getter)__Pyx_CyFunction_get_name, (setter)__Pyx_CyFunction_set_name, 0, 0}, {(char *) "__qualname__", (getter)__Pyx_CyFunction_get_qualname, (setter)__Pyx_CyFunction_set_qualname, 0, 0}, {(char *) "__self__", (getter)__Pyx_CyFunction_get_self, 0, 0, 0}, {(char *) "func_dict", (getter)__Pyx_CyFunction_get_dict, (setter)__Pyx_CyFunction_set_dict, 0, 0}, {(char *) "__dict__", (getter)__Pyx_CyFunction_get_dict, (setter)__Pyx_CyFunction_set_dict, 0, 0}, {(char *) "func_globals", (getter)__Pyx_CyFunction_get_globals, 0, 0, 0}, {(char *) "__globals__", (getter)__Pyx_CyFunction_get_globals, 0, 0, 0}, {(char *) "func_closure", (getter)__Pyx_CyFunction_get_closure, 0, 0, 0}, {(char *) "__closure__", (getter)__Pyx_CyFunction_get_closure, 0, 0, 0}, {(char *) "func_code", (getter)__Pyx_CyFunction_get_code, 0, 0, 0}, {(char *) "__code__", (getter)__Pyx_CyFunction_get_code, 0, 0, 0}, {(char *) "func_defaults", (getter)__Pyx_CyFunction_get_defaults, (setter)__Pyx_CyFunction_set_defaults, 0, 0}, {(char *) "__defaults__", (getter)__Pyx_CyFunction_get_defaults, (setter)__Pyx_CyFunction_set_defaults, 0, 0}, {(char *) "__kwdefaults__", (getter)__Pyx_CyFunction_get_kwdefaults, (setter)__Pyx_CyFunction_set_kwdefaults, 0, 0}, {(char *) "__annotations__", (getter)__Pyx_CyFunction_get_annotations, (setter)__Pyx_CyFunction_set_annotations, 0, 0}, {0, 0, 0, 0, 0} }; #ifndef PY_WRITE_RESTRICTED #define PY_WRITE_RESTRICTED WRITE_RESTRICTED #endif static PyMemberDef __pyx_CyFunction_members[] = { {(char *) "__module__", T_OBJECT, offsetof(__pyx_CyFunctionObject, func.m_module), PY_WRITE_RESTRICTED, 0}, {0, 0, 0, 0, 0} }; static PyObject * __Pyx_CyFunction_reduce(__pyx_CyFunctionObject *m, CYTHON_UNUSED PyObject *args) { #if PY_MAJOR_VERSION >= 3 return PyUnicode_FromString(m->func.m_ml->ml_name); #else return PyString_FromString(m->func.m_ml->ml_name); #endif } static PyMethodDef __pyx_CyFunction_methods[] = { {"__reduce__", (PyCFunction)__Pyx_CyFunction_reduce, METH_VARARGS, 0}, {0, 0, 0, 0} }; #if PY_VERSION_HEX < 0x030500A0 #define __Pyx_CyFunction_weakreflist(cyfunc) ((cyfunc)->func_weakreflist) #else #define __Pyx_CyFunction_weakreflist(cyfunc) ((cyfunc)->func.m_weakreflist) #endif static PyObject *__Pyx_CyFunction_New(PyTypeObject *type, PyMethodDef *ml, int flags, PyObject* qualname, PyObject *closure, PyObject *module, PyObject* globals, PyObject* code) { __pyx_CyFunctionObject *op = PyObject_GC_New(__pyx_CyFunctionObject, type); if (op == NULL) return NULL; op->flags = flags; __Pyx_CyFunction_weakreflist(op) = NULL; op->func.m_ml = ml; op->func.m_self = (PyObject *) op; Py_XINCREF(closure); op->func_closure = closure; Py_XINCREF(module); op->func.m_module = module; op->func_dict = NULL; op->func_name = NULL; Py_INCREF(qualname); op->func_qualname = qualname; op->func_doc = NULL; op->func_classobj = NULL; op->func_globals = globals; Py_INCREF(op->func_globals); Py_XINCREF(code); op->func_code = code; op->defaults_pyobjects = 0; op->defaults = NULL; op->defaults_tuple = NULL; op->defaults_kwdict = NULL; op->defaults_getter = NULL; op->func_annotations = NULL; PyObject_GC_Track(op); return (PyObject *) op; } static int __Pyx_CyFunction_clear(__pyx_CyFunctionObject *m) { Py_CLEAR(m->func_closure); Py_CLEAR(m->func.m_module); Py_CLEAR(m->func_dict); Py_CLEAR(m->func_name); Py_CLEAR(m->func_qualname); Py_CLEAR(m->func_doc); Py_CLEAR(m->func_globals); Py_CLEAR(m->func_code); Py_CLEAR(m->func_classobj); Py_CLEAR(m->defaults_tuple); Py_CLEAR(m->defaults_kwdict); Py_CLEAR(m->func_annotations); if (m->defaults) { PyObject **pydefaults = __Pyx_CyFunction_Defaults(PyObject *, m); int i; for (i = 0; i < m->defaults_pyobjects; i++) Py_XDECREF(pydefaults[i]); PyMem_Free(m->defaults); m->defaults = NULL; } return 0; } static void __Pyx_CyFunction_dealloc(__pyx_CyFunctionObject *m) { PyObject_GC_UnTrack(m); if (__Pyx_CyFunction_weakreflist(m) != NULL) PyObject_ClearWeakRefs((PyObject *) m); __Pyx_CyFunction_clear(m); PyObject_GC_Del(m); } static int __Pyx_CyFunction_traverse(__pyx_CyFunctionObject *m, visitproc visit, void *arg) { Py_VISIT(m->func_closure); Py_VISIT(m->func.m_module); Py_VISIT(m->func_dict); Py_VISIT(m->func_name); Py_VISIT(m->func_qualname); Py_VISIT(m->func_doc); Py_VISIT(m->func_globals); Py_VISIT(m->func_code); Py_VISIT(m->func_classobj); Py_VISIT(m->defaults_tuple); Py_VISIT(m->defaults_kwdict); if (m->defaults) { PyObject **pydefaults = __Pyx_CyFunction_Defaults(PyObject *, m); int i; for (i = 0; i < m->defaults_pyobjects; i++) Py_VISIT(pydefaults[i]); } return 0; } static PyObject *__Pyx_CyFunction_descr_get(PyObject *func, PyObject *obj, PyObject *type) { __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func; if (m->flags & __Pyx_CYFUNCTION_STATICMETHOD) { Py_INCREF(func); return func; } if (m->flags & __Pyx_CYFUNCTION_CLASSMETHOD) { if (type == NULL) type = (PyObject *)(Py_TYPE(obj)); return __Pyx_PyMethod_New(func, type, (PyObject *)(Py_TYPE(type))); } if (obj == Py_None) obj = NULL; return __Pyx_PyMethod_New(func, obj, type); } static PyObject* __Pyx_CyFunction_repr(__pyx_CyFunctionObject *op) { #if PY_MAJOR_VERSION >= 3 return PyUnicode_FromFormat("", op->func_qualname, (void *)op); #else return PyString_FromFormat("", PyString_AsString(op->func_qualname), (void *)op); #endif } #if CYTHON_COMPILING_IN_PYPY static PyObject * __Pyx_CyFunction_Call(PyObject *func, PyObject *arg, PyObject *kw) { PyCFunctionObject* f = (PyCFunctionObject*)func; PyCFunction meth = PyCFunction_GET_FUNCTION(func); PyObject *self = PyCFunction_GET_SELF(func); Py_ssize_t size; switch (PyCFunction_GET_FLAGS(func) & ~(METH_CLASS | METH_STATIC | METH_COEXIST)) { case METH_VARARGS: if (likely(kw == NULL) || PyDict_Size(kw) == 0) return (*meth)(self, arg); break; case METH_VARARGS | METH_KEYWORDS: return (*(PyCFunctionWithKeywords)meth)(self, arg, kw); case METH_NOARGS: if (likely(kw == NULL) || PyDict_Size(kw) == 0) { size = PyTuple_GET_SIZE(arg); if (size == 0) return (*meth)(self, NULL); PyErr_Format(PyExc_TypeError, "%.200s() takes no arguments (%zd given)", f->m_ml->ml_name, size); return NULL; } break; case METH_O: if (likely(kw == NULL) || PyDict_Size(kw) == 0) { size = PyTuple_GET_SIZE(arg); if (size == 1) return (*meth)(self, PyTuple_GET_ITEM(arg, 0)); PyErr_Format(PyExc_TypeError, "%.200s() takes exactly one argument (%zd given)", f->m_ml->ml_name, size); return NULL; } break; default: PyErr_SetString(PyExc_SystemError, "Bad call flags in " "__Pyx_CyFunction_Call. METH_OLDARGS is no " "longer supported!"); return NULL; } PyErr_Format(PyExc_TypeError, "%.200s() takes no keyword arguments", f->m_ml->ml_name); return NULL; } #else static PyObject * __Pyx_CyFunction_Call(PyObject *func, PyObject *arg, PyObject *kw) { return PyCFunction_Call(func, arg, kw); } #endif static PyTypeObject __pyx_CyFunctionType_type = { PyVarObject_HEAD_INIT(0, 0) "cython_function_or_method", sizeof(__pyx_CyFunctionObject), 0, (destructor) __Pyx_CyFunction_dealloc, 0, 0, 0, #if PY_MAJOR_VERSION < 3 0, #else 0, #endif (reprfunc) __Pyx_CyFunction_repr, 0, 0, 0, 0, __Pyx_CyFunction_Call, 0, 0, 0, 0, Py_TPFLAGS_DEFAULT | Py_TPFLAGS_HAVE_GC, 0, (traverseproc) __Pyx_CyFunction_traverse, (inquiry) __Pyx_CyFunction_clear, 0, #if PY_VERSION_HEX < 0x030500A0 offsetof(__pyx_CyFunctionObject, func_weakreflist), #else offsetof(PyCFunctionObject, m_weakreflist), #endif 0, 0, __pyx_CyFunction_methods, __pyx_CyFunction_members, __pyx_CyFunction_getsets, 0, 0, __Pyx_CyFunction_descr_get, 0, offsetof(__pyx_CyFunctionObject, func_dict), 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, #if PY_VERSION_HEX >= 0x030400a1 0, #endif }; static int __Pyx_CyFunction_init(void) { #if !CYTHON_COMPILING_IN_PYPY __pyx_CyFunctionType_type.tp_call = PyCFunction_Call; #endif __pyx_CyFunctionType = __Pyx_FetchCommonType(&__pyx_CyFunctionType_type); if (__pyx_CyFunctionType == NULL) { return -1; } return 0; } static CYTHON_INLINE void *__Pyx_CyFunction_InitDefaults(PyObject *func, size_t size, int pyobjects) { __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func; m->defaults = PyMem_Malloc(size); if (!m->defaults) return PyErr_NoMemory(); memset(m->defaults, 0, size); m->defaults_pyobjects = pyobjects; return m->defaults; } static CYTHON_INLINE void __Pyx_CyFunction_SetDefaultsTuple(PyObject *func, PyObject *tuple) { __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func; m->defaults_tuple = tuple; Py_INCREF(tuple); } static CYTHON_INLINE void __Pyx_CyFunction_SetDefaultsKwDict(PyObject *func, PyObject *dict) { __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func; m->defaults_kwdict = dict; Py_INCREF(dict); } static CYTHON_INLINE void __Pyx_CyFunction_SetAnnotationsDict(PyObject *func, PyObject *dict) { __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func; m->func_annotations = dict; Py_INCREF(dict); } static PyObject *__Pyx_Py3MetaclassPrepare(PyObject *metaclass, PyObject *bases, PyObject *name, PyObject *qualname, PyObject *mkw, PyObject *modname, PyObject *doc) { PyObject *ns; if (metaclass) { PyObject *prep = __Pyx_PyObject_GetAttrStr(metaclass, __pyx_n_s_prepare); if (prep) { PyObject *pargs = PyTuple_Pack(2, name, bases); if (unlikely(!pargs)) { Py_DECREF(prep); return NULL; } ns = PyObject_Call(prep, pargs, mkw); Py_DECREF(prep); Py_DECREF(pargs); } else { if (unlikely(!PyErr_ExceptionMatches(PyExc_AttributeError))) return NULL; PyErr_Clear(); ns = PyDict_New(); } } else { ns = PyDict_New(); } if (unlikely(!ns)) return NULL; if (unlikely(PyObject_SetItem(ns, __pyx_n_s_module, modname) < 0)) goto bad; if (unlikely(PyObject_SetItem(ns, __pyx_n_s_qualname, qualname) < 0)) goto bad; if (unlikely(doc && PyObject_SetItem(ns, __pyx_n_s_doc, doc) < 0)) goto bad; return ns; bad: Py_DECREF(ns); return NULL; } static PyObject *__Pyx_Py3ClassCreate(PyObject *metaclass, PyObject *name, PyObject *bases, PyObject *dict, PyObject *mkw, int calculate_metaclass, int allow_py2_metaclass) { PyObject *result, *margs; PyObject *owned_metaclass = NULL; if (allow_py2_metaclass) { owned_metaclass = PyObject_GetItem(dict, __pyx_n_s_metaclass); if (owned_metaclass) { metaclass = owned_metaclass; } else if (likely(PyErr_ExceptionMatches(PyExc_KeyError))) { PyErr_Clear(); } else { return NULL; } } if (calculate_metaclass && (!metaclass || PyType_Check(metaclass))) { metaclass = __Pyx_CalculateMetaclass((PyTypeObject*) metaclass, bases); Py_XDECREF(owned_metaclass); if (unlikely(!metaclass)) return NULL; owned_metaclass = metaclass; } margs = PyTuple_Pack(3, name, bases, dict); if (unlikely(!margs)) { result = NULL; } else { result = PyObject_Call(metaclass, margs, mkw); Py_DECREF(margs); } Py_XDECREF(owned_metaclass); return result; } static int __pyx_bisect_code_objects(__Pyx_CodeObjectCacheEntry* entries, int count, int code_line) { int start = 0, mid = 0, end = count - 1; if (end >= 0 && code_line > entries[end].code_line) { return count; } while (start < end) { mid = (start + end) / 2; if (code_line < entries[mid].code_line) { end = mid; } else if (code_line > entries[mid].code_line) { start = mid + 1; } else { return mid; } } if (code_line <= entries[mid].code_line) { return mid; } else { return mid + 1; } } static PyCodeObject *__pyx_find_code_object(int code_line) { PyCodeObject* code_object; int pos; if (unlikely(!code_line) || unlikely(!__pyx_code_cache.entries)) { return NULL; } pos = __pyx_bisect_code_objects(__pyx_code_cache.entries, __pyx_code_cache.count, code_line); if (unlikely(pos >= __pyx_code_cache.count) || unlikely(__pyx_code_cache.entries[pos].code_line != code_line)) { return NULL; } code_object = __pyx_code_cache.entries[pos].code_object; Py_INCREF(code_object); return code_object; } static void __pyx_insert_code_object(int code_line, PyCodeObject* code_object) { int pos, i; __Pyx_CodeObjectCacheEntry* entries = __pyx_code_cache.entries; if (unlikely(!code_line)) { return; } if (unlikely(!entries)) { entries = (__Pyx_CodeObjectCacheEntry*)PyMem_Malloc(64*sizeof(__Pyx_CodeObjectCacheEntry)); if (likely(entries)) { __pyx_code_cache.entries = entries; __pyx_code_cache.max_count = 64; __pyx_code_cache.count = 1; entries[0].code_line = code_line; entries[0].code_object = code_object; Py_INCREF(code_object); } return; } pos = __pyx_bisect_code_objects(__pyx_code_cache.entries, __pyx_code_cache.count, code_line); if ((pos < __pyx_code_cache.count) && unlikely(__pyx_code_cache.entries[pos].code_line == code_line)) { PyCodeObject* tmp = entries[pos].code_object; entries[pos].code_object = code_object; Py_DECREF(tmp); return; } if (__pyx_code_cache.count == __pyx_code_cache.max_count) { int new_max = __pyx_code_cache.max_count + 64; entries = (__Pyx_CodeObjectCacheEntry*)PyMem_Realloc( __pyx_code_cache.entries, (size_t)new_max*sizeof(__Pyx_CodeObjectCacheEntry)); if (unlikely(!entries)) { return; } __pyx_code_cache.entries = entries; __pyx_code_cache.max_count = new_max; } for (i=__pyx_code_cache.count; i>pos; i--) { entries[i] = entries[i-1]; } entries[pos].code_line = code_line; entries[pos].code_object = code_object; __pyx_code_cache.count++; Py_INCREF(code_object); } #include "compile.h" #include "frameobject.h" #include "traceback.h" static PyCodeObject* __Pyx_CreateCodeObjectForTraceback( const char *funcname, int c_line, int py_line, const char *filename) { PyCodeObject *py_code = 0; PyObject *py_srcfile = 0; PyObject *py_funcname = 0; #if PY_MAJOR_VERSION < 3 py_srcfile = PyString_FromString(filename); #else py_srcfile = PyUnicode_FromString(filename); #endif if (!py_srcfile) goto bad; if (c_line) { #if PY_MAJOR_VERSION < 3 py_funcname = PyString_FromFormat( "%s (%s:%d)", funcname, __pyx_cfilenm, c_line); #else py_funcname = PyUnicode_FromFormat( "%s (%s:%d)", funcname, __pyx_cfilenm, c_line); #endif } else { #if PY_MAJOR_VERSION < 3 py_funcname = PyString_FromString(funcname); #else py_funcname = PyUnicode_FromString(funcname); #endif } if (!py_funcname) goto bad; py_code = __Pyx_PyCode_New( 0, 0, 0, 0, 0, __pyx_empty_bytes, /*PyObject *code,*/ __pyx_empty_tuple, /*PyObject *consts,*/ __pyx_empty_tuple, /*PyObject *names,*/ __pyx_empty_tuple, /*PyObject *varnames,*/ __pyx_empty_tuple, /*PyObject *freevars,*/ __pyx_empty_tuple, /*PyObject *cellvars,*/ py_srcfile, /*PyObject *filename,*/ py_funcname, /*PyObject *name,*/ py_line, __pyx_empty_bytes /*PyObject *lnotab*/ ); Py_DECREF(py_srcfile); Py_DECREF(py_funcname); return py_code; bad: Py_XDECREF(py_srcfile); Py_XDECREF(py_funcname); return NULL; } static void __Pyx_AddTraceback(const char *funcname, int c_line, int py_line, const char *filename) { PyCodeObject *py_code = 0; PyFrameObject *py_frame = 0; py_code = __pyx_find_code_object(c_line ? c_line : py_line); if (!py_code) { py_code = __Pyx_CreateCodeObjectForTraceback( funcname, c_line, py_line, filename); if (!py_code) goto bad; __pyx_insert_code_object(c_line ? c_line : py_line, py_code); } py_frame = PyFrame_New( PyThreadState_GET(), /*PyThreadState *tstate,*/ py_code, /*PyCodeObject *code,*/ __pyx_d, /*PyObject *globals,*/ 0 /*PyObject *locals*/ ); if (!py_frame) goto bad; py_frame->f_lineno = py_line; PyTraceBack_Here(py_frame); bad: Py_XDECREF(py_code); Py_XDECREF(py_frame); } static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list, int level) { PyObject *empty_list = 0; PyObject *module = 0; PyObject *global_dict = 0; PyObject *empty_dict = 0; PyObject *list; #if PY_VERSION_HEX < 0x03030000 PyObject *py_import; py_import = __Pyx_PyObject_GetAttrStr(__pyx_b, __pyx_n_s_import); if (!py_import) goto bad; #endif if (from_list) list = from_list; else { empty_list = PyList_New(0); if (!empty_list) goto bad; list = empty_list; } global_dict = PyModule_GetDict(__pyx_m); if (!global_dict) goto bad; empty_dict = PyDict_New(); if (!empty_dict) goto bad; { #if PY_MAJOR_VERSION >= 3 if (level == -1) { if (strchr(__Pyx_MODULE_NAME, '.')) { #if PY_VERSION_HEX < 0x03030000 PyObject *py_level = PyInt_FromLong(1); if (!py_level) goto bad; module = PyObject_CallFunctionObjArgs(py_import, name, global_dict, empty_dict, list, py_level, NULL); Py_DECREF(py_level); #else module = PyImport_ImportModuleLevelObject( name, global_dict, empty_dict, list, 1); #endif if (!module) { if (!PyErr_ExceptionMatches(PyExc_ImportError)) goto bad; PyErr_Clear(); } } level = 0; } #endif if (!module) { #if PY_VERSION_HEX < 0x03030000 PyObject *py_level = PyInt_FromLong(level); if (!py_level) goto bad; module = PyObject_CallFunctionObjArgs(py_import, name, global_dict, empty_dict, list, py_level, NULL); Py_DECREF(py_level); #else module = PyImport_ImportModuleLevelObject( name, global_dict, empty_dict, list, level); #endif } } bad: #if PY_VERSION_HEX < 0x03030000 Py_XDECREF(py_import); #endif Py_XDECREF(empty_list); Py_XDECREF(empty_dict); return module; } static CYTHON_INLINE PyObject* __Pyx_PyInt_From_int(int value) { const int neg_one = (int) -1, const_zero = 0; const int is_unsigned = neg_one > const_zero; if (is_unsigned) { if (sizeof(int) < sizeof(long)) { return PyInt_FromLong((long) value); } else if (sizeof(int) <= sizeof(unsigned long)) { return PyLong_FromUnsignedLong((unsigned long) value); } else if (sizeof(int) <= sizeof(unsigned long long)) { return PyLong_FromUnsignedLongLong((unsigned long long) value); } } else { if (sizeof(int) <= sizeof(long)) { return PyInt_FromLong((long) value); } else if (sizeof(int) <= sizeof(long long)) { return PyLong_FromLongLong((long long) value); } } { int one = 1; int little = (int)*(unsigned char *)&one; unsigned char *bytes = (unsigned char *)&value; return _PyLong_FromByteArray(bytes, sizeof(int), little, !is_unsigned); } } static CYTHON_INLINE PyObject* __Pyx_PyInt_From_long(long value) { const long neg_one = (long) -1, const_zero = 0; const int is_unsigned = neg_one > const_zero; if (is_unsigned) { if (sizeof(long) < sizeof(long)) { return PyInt_FromLong((long) value); } else if (sizeof(long) <= sizeof(unsigned long)) { return PyLong_FromUnsignedLong((unsigned long) value); } else if (sizeof(long) <= sizeof(unsigned long long)) { return PyLong_FromUnsignedLongLong((unsigned long long) value); } } else { if (sizeof(long) <= sizeof(long)) { return PyInt_FromLong((long) value); } else if (sizeof(long) <= sizeof(long long)) { return PyLong_FromLongLong((long long) value); } } { int one = 1; int little = (int)*(unsigned char *)&one; unsigned char *bytes = (unsigned char *)&value; return _PyLong_FromByteArray(bytes, sizeof(long), little, !is_unsigned); } } #define __PYX_VERIFY_RETURN_INT(target_type, func_type, func_value) \ { \ func_type value = func_value; \ if (sizeof(target_type) < sizeof(func_type)) { \ if (unlikely(value != (func_type) (target_type) value)) { \ func_type zero = 0; \ if (is_unsigned && unlikely(value < zero)) \ goto raise_neg_overflow; \ else \ goto raise_overflow; \ } \ } \ return (target_type) value; \ } #if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3 #if CYTHON_USE_PYLONG_INTERNALS #include "longintrepr.h" #endif #endif static CYTHON_INLINE long __Pyx_PyInt_As_long(PyObject *x) { const long neg_one = (long) -1, const_zero = 0; const int is_unsigned = neg_one > const_zero; #if PY_MAJOR_VERSION < 3 if (likely(PyInt_Check(x))) { if (sizeof(long) < sizeof(long)) { __PYX_VERIFY_RETURN_INT(long, long, PyInt_AS_LONG(x)) } else { long val = PyInt_AS_LONG(x); if (is_unsigned && unlikely(val < 0)) { goto raise_neg_overflow; } return (long) val; } } else #endif if (likely(PyLong_Check(x))) { if (is_unsigned) { #if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3 #if CYTHON_USE_PYLONG_INTERNALS switch (Py_SIZE(x)) { case 0: return 0; case 1: __PYX_VERIFY_RETURN_INT(long, digit, ((PyLongObject*)x)->ob_digit[0]); } #endif #endif if (unlikely(Py_SIZE(x) < 0)) { goto raise_neg_overflow; } if (sizeof(long) <= sizeof(unsigned long)) { __PYX_VERIFY_RETURN_INT(long, unsigned long, PyLong_AsUnsignedLong(x)) } else if (sizeof(long) <= sizeof(unsigned long long)) { __PYX_VERIFY_RETURN_INT(long, unsigned long long, PyLong_AsUnsignedLongLong(x)) } } else { #if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3 #if CYTHON_USE_PYLONG_INTERNALS switch (Py_SIZE(x)) { case 0: return 0; case 1: __PYX_VERIFY_RETURN_INT(long, digit, +(((PyLongObject*)x)->ob_digit[0])); case -1: __PYX_VERIFY_RETURN_INT(long, sdigit, -(sdigit) ((PyLongObject*)x)->ob_digit[0]); } #endif #endif if (sizeof(long) <= sizeof(long)) { __PYX_VERIFY_RETURN_INT(long, long, PyLong_AsLong(x)) } else if (sizeof(long) <= sizeof(long long)) { __PYX_VERIFY_RETURN_INT(long, long long, PyLong_AsLongLong(x)) } } { #if CYTHON_COMPILING_IN_PYPY && !defined(_PyLong_AsByteArray) PyErr_SetString(PyExc_RuntimeError, "_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers"); #else long val; PyObject *v = __Pyx_PyNumber_Int(x); #if PY_MAJOR_VERSION < 3 if (likely(v) && !PyLong_Check(v)) { PyObject *tmp = v; v = PyNumber_Long(tmp); Py_DECREF(tmp); } #endif if (likely(v)) { int one = 1; int is_little = (int)*(unsigned char *)&one; unsigned char *bytes = (unsigned char *)&val; int ret = _PyLong_AsByteArray((PyLongObject *)v, bytes, sizeof(val), is_little, !is_unsigned); Py_DECREF(v); if (likely(!ret)) return val; } #endif return (long) -1; } } else { long val; PyObject *tmp = __Pyx_PyNumber_Int(x); if (!tmp) return (long) -1; val = __Pyx_PyInt_As_long(tmp); Py_DECREF(tmp); return val; } raise_overflow: PyErr_SetString(PyExc_OverflowError, "value too large to convert to long"); return (long) -1; raise_neg_overflow: PyErr_SetString(PyExc_OverflowError, "can't convert negative value to long"); return (long) -1; } static CYTHON_INLINE int __Pyx_PyInt_As_int(PyObject *x) { const int neg_one = (int) -1, const_zero = 0; const int is_unsigned = neg_one > const_zero; #if PY_MAJOR_VERSION < 3 if (likely(PyInt_Check(x))) { if (sizeof(int) < sizeof(long)) { __PYX_VERIFY_RETURN_INT(int, long, PyInt_AS_LONG(x)) } else { long val = PyInt_AS_LONG(x); if (is_unsigned && unlikely(val < 0)) { goto raise_neg_overflow; } return (int) val; } } else #endif if (likely(PyLong_Check(x))) { if (is_unsigned) { #if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3 #if CYTHON_USE_PYLONG_INTERNALS switch (Py_SIZE(x)) { case 0: return 0; case 1: __PYX_VERIFY_RETURN_INT(int, digit, ((PyLongObject*)x)->ob_digit[0]); } #endif #endif if (unlikely(Py_SIZE(x) < 0)) { goto raise_neg_overflow; } if (sizeof(int) <= sizeof(unsigned long)) { __PYX_VERIFY_RETURN_INT(int, unsigned long, PyLong_AsUnsignedLong(x)) } else if (sizeof(int) <= sizeof(unsigned long long)) { __PYX_VERIFY_RETURN_INT(int, unsigned long long, PyLong_AsUnsignedLongLong(x)) } } else { #if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3 #if CYTHON_USE_PYLONG_INTERNALS switch (Py_SIZE(x)) { case 0: return 0; case 1: __PYX_VERIFY_RETURN_INT(int, digit, +(((PyLongObject*)x)->ob_digit[0])); case -1: __PYX_VERIFY_RETURN_INT(int, sdigit, -(sdigit) ((PyLongObject*)x)->ob_digit[0]); } #endif #endif if (sizeof(int) <= sizeof(long)) { __PYX_VERIFY_RETURN_INT(int, long, PyLong_AsLong(x)) } else if (sizeof(int) <= sizeof(long long)) { __PYX_VERIFY_RETURN_INT(int, long long, PyLong_AsLongLong(x)) } } { #if CYTHON_COMPILING_IN_PYPY && !defined(_PyLong_AsByteArray) PyErr_SetString(PyExc_RuntimeError, "_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers"); #else int val; PyObject *v = __Pyx_PyNumber_Int(x); #if PY_MAJOR_VERSION < 3 if (likely(v) && !PyLong_Check(v)) { PyObject *tmp = v; v = PyNumber_Long(tmp); Py_DECREF(tmp); } #endif if (likely(v)) { int one = 1; int is_little = (int)*(unsigned char *)&one; unsigned char *bytes = (unsigned char *)&val; int ret = _PyLong_AsByteArray((PyLongObject *)v, bytes, sizeof(val), is_little, !is_unsigned); Py_DECREF(v); if (likely(!ret)) return val; } #endif return (int) -1; } } else { int val; PyObject *tmp = __Pyx_PyNumber_Int(x); if (!tmp) return (int) -1; val = __Pyx_PyInt_As_int(tmp); Py_DECREF(tmp); return val; } raise_overflow: PyErr_SetString(PyExc_OverflowError, "value too large to convert to int"); return (int) -1; raise_neg_overflow: PyErr_SetString(PyExc_OverflowError, "can't convert negative value to int"); return (int) -1; } static int __Pyx_check_binary_version(void) { char ctversion[4], rtversion[4]; PyOS_snprintf(ctversion, 4, "%d.%d", PY_MAJOR_VERSION, PY_MINOR_VERSION); PyOS_snprintf(rtversion, 4, "%s", Py_GetVersion()); if (ctversion[0] != rtversion[0] || ctversion[2] != rtversion[2]) { char message[200]; PyOS_snprintf(message, sizeof(message), "compiletime version %s of module '%.100s' " "does not match runtime version %s", ctversion, __Pyx_MODULE_NAME, rtversion); return PyErr_WarnEx(NULL, message, 1); } return 0; } static int __Pyx_InitStrings(__Pyx_StringTabEntry *t) { while (t->p) { #if PY_MAJOR_VERSION < 3 if (t->is_unicode) { *t->p = PyUnicode_DecodeUTF8(t->s, t->n - 1, NULL); } else if (t->intern) { *t->p = PyString_InternFromString(t->s); } else { *t->p = PyString_FromStringAndSize(t->s, t->n - 1); } #else if (t->is_unicode | t->is_str) { if (t->intern) { *t->p = PyUnicode_InternFromString(t->s); } else if (t->encoding) { *t->p = PyUnicode_Decode(t->s, t->n - 1, t->encoding, NULL); } else { *t->p = PyUnicode_FromStringAndSize(t->s, t->n - 1); } } else { *t->p = PyBytes_FromStringAndSize(t->s, t->n - 1); } #endif if (!*t->p) return -1; ++t; } return 0; } static CYTHON_INLINE PyObject* __Pyx_PyUnicode_FromString(const char* c_str) { return __Pyx_PyUnicode_FromStringAndSize(c_str, (Py_ssize_t)strlen(c_str)); } static CYTHON_INLINE char* __Pyx_PyObject_AsString(PyObject* o) { Py_ssize_t ignore; return __Pyx_PyObject_AsStringAndSize(o, &ignore); } static CYTHON_INLINE char* __Pyx_PyObject_AsStringAndSize(PyObject* o, Py_ssize_t *length) { #if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT if ( #if PY_MAJOR_VERSION < 3 && __PYX_DEFAULT_STRING_ENCODING_IS_ASCII __Pyx_sys_getdefaultencoding_not_ascii && #endif PyUnicode_Check(o)) { #if PY_VERSION_HEX < 0x03030000 char* defenc_c; PyObject* defenc = _PyUnicode_AsDefaultEncodedString(o, NULL); if (!defenc) return NULL; defenc_c = PyBytes_AS_STRING(defenc); #if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII { char* end = defenc_c + PyBytes_GET_SIZE(defenc); char* c; for (c = defenc_c; c < end; c++) { if ((unsigned char) (*c) >= 128) { PyUnicode_AsASCIIString(o); return NULL; } } } #endif *length = PyBytes_GET_SIZE(defenc); return defenc_c; #else if (__Pyx_PyUnicode_READY(o) == -1) return NULL; #if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII if (PyUnicode_IS_ASCII(o)) { *length = PyUnicode_GET_LENGTH(o); return PyUnicode_AsUTF8(o); } else { PyUnicode_AsASCIIString(o); return NULL; } #else return PyUnicode_AsUTF8AndSize(o, length); #endif #endif } else #endif #if !CYTHON_COMPILING_IN_PYPY if (PyByteArray_Check(o)) { *length = PyByteArray_GET_SIZE(o); return PyByteArray_AS_STRING(o); } else #endif { char* result; int r = PyBytes_AsStringAndSize(o, &result, length); if (unlikely(r < 0)) { return NULL; } else { return result; } } } static CYTHON_INLINE int __Pyx_PyObject_IsTrue(PyObject* x) { int is_true = x == Py_True; if (is_true | (x == Py_False) | (x == Py_None)) return is_true; else return PyObject_IsTrue(x); } static CYTHON_INLINE PyObject* __Pyx_PyNumber_Int(PyObject* x) { PyNumberMethods *m; const char *name = NULL; PyObject *res = NULL; #if PY_MAJOR_VERSION < 3 if (PyInt_Check(x) || PyLong_Check(x)) #else if (PyLong_Check(x)) #endif return Py_INCREF(x), x; m = Py_TYPE(x)->tp_as_number; #if PY_MAJOR_VERSION < 3 if (m && m->nb_int) { name = "int"; res = PyNumber_Int(x); } else if (m && m->nb_long) { name = "long"; res = PyNumber_Long(x); } #else if (m && m->nb_int) { name = "int"; res = PyNumber_Long(x); } #endif if (res) { #if PY_MAJOR_VERSION < 3 if (!PyInt_Check(res) && !PyLong_Check(res)) { #else if (!PyLong_Check(res)) { #endif PyErr_Format(PyExc_TypeError, "__%.4s__ returned non-%.4s (type %.200s)", name, name, Py_TYPE(res)->tp_name); Py_DECREF(res); return NULL; } } else if (!PyErr_Occurred()) { PyErr_SetString(PyExc_TypeError, "an integer is required"); } return res; } static CYTHON_INLINE Py_ssize_t __Pyx_PyIndex_AsSsize_t(PyObject* b) { Py_ssize_t ival; PyObject *x; #if PY_MAJOR_VERSION < 3 if (likely(PyInt_CheckExact(b))) return PyInt_AS_LONG(b); #endif if (likely(PyLong_CheckExact(b))) { #if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3 #if CYTHON_USE_PYLONG_INTERNALS switch (Py_SIZE(b)) { case -1: return -(sdigit)((PyLongObject*)b)->ob_digit[0]; case 0: return 0; case 1: return ((PyLongObject*)b)->ob_digit[0]; } #endif #endif return PyLong_AsSsize_t(b); } x = PyNumber_Index(b); if (!x) return -1; ival = PyInt_AsSsize_t(x); Py_DECREF(x); return ival; } static CYTHON_INLINE PyObject * __Pyx_PyInt_FromSize_t(size_t ival) { return PyInt_FromSize_t(ival); } #endif /* Py_PYTHON_H */ pygame_sdl2-2.1.0-for-renpy-6.99.14.1/gen/pygame_sdl2.font.c0000664000175000017500000070205612660477776022376 0ustar tomtom00000000000000/* Generated by Cython 0.23.4 */ #define PY_SSIZE_T_CLEAN #include "Python.h" #ifndef Py_PYTHON_H #error Python headers needed to compile C extensions, please install development version of Python. #elif PY_VERSION_HEX < 0x02060000 || (0x03000000 <= PY_VERSION_HEX && PY_VERSION_HEX < 0x03020000) #error Cython requires Python 2.6+ or Python 3.2+. #else #define CYTHON_ABI "0_23_4" #include #ifndef offsetof #define offsetof(type, member) ( (size_t) & ((type*)0) -> member ) #endif #if !defined(WIN32) && !defined(MS_WINDOWS) #ifndef __stdcall #define __stdcall #endif #ifndef __cdecl #define __cdecl #endif #ifndef __fastcall #define __fastcall #endif #endif #ifndef DL_IMPORT #define DL_IMPORT(t) t #endif #ifndef DL_EXPORT #define DL_EXPORT(t) t #endif #ifndef PY_LONG_LONG #define PY_LONG_LONG LONG_LONG #endif #ifndef Py_HUGE_VAL #define Py_HUGE_VAL HUGE_VAL #endif #ifdef PYPY_VERSION #define CYTHON_COMPILING_IN_PYPY 1 #define CYTHON_COMPILING_IN_CPYTHON 0 #else #define CYTHON_COMPILING_IN_PYPY 0 #define CYTHON_COMPILING_IN_CPYTHON 1 #endif #if !defined(CYTHON_USE_PYLONG_INTERNALS) && CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x02070000 #define CYTHON_USE_PYLONG_INTERNALS 1 #endif #if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX < 0x02070600 && !defined(Py_OptimizeFlag) #define Py_OptimizeFlag 0 #endif #define __PYX_BUILD_PY_SSIZE_T "n" #define CYTHON_FORMAT_SSIZE_T "z" #if PY_MAJOR_VERSION < 3 #define __Pyx_BUILTIN_MODULE_NAME "__builtin__" #define __Pyx_PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)\ PyCode_New(a+k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos) #define __Pyx_DefaultClassType PyClass_Type #else #define __Pyx_BUILTIN_MODULE_NAME "builtins" #define __Pyx_PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)\ PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos) #define __Pyx_DefaultClassType PyType_Type #endif #ifndef Py_TPFLAGS_CHECKTYPES #define Py_TPFLAGS_CHECKTYPES 0 #endif #ifndef Py_TPFLAGS_HAVE_INDEX #define Py_TPFLAGS_HAVE_INDEX 0 #endif #ifndef Py_TPFLAGS_HAVE_NEWBUFFER #define Py_TPFLAGS_HAVE_NEWBUFFER 0 #endif #ifndef Py_TPFLAGS_HAVE_FINALIZE #define Py_TPFLAGS_HAVE_FINALIZE 0 #endif #if PY_VERSION_HEX > 0x03030000 && defined(PyUnicode_KIND) #define CYTHON_PEP393_ENABLED 1 #define __Pyx_PyUnicode_READY(op) (likely(PyUnicode_IS_READY(op)) ?\ 0 : _PyUnicode_Ready((PyObject *)(op))) #define __Pyx_PyUnicode_GET_LENGTH(u) PyUnicode_GET_LENGTH(u) #define __Pyx_PyUnicode_READ_CHAR(u, i) PyUnicode_READ_CHAR(u, i) #define __Pyx_PyUnicode_KIND(u) PyUnicode_KIND(u) #define __Pyx_PyUnicode_DATA(u) PyUnicode_DATA(u) #define __Pyx_PyUnicode_READ(k, d, i) PyUnicode_READ(k, d, i) #else #define CYTHON_PEP393_ENABLED 0 #define __Pyx_PyUnicode_READY(op) (0) #define __Pyx_PyUnicode_GET_LENGTH(u) PyUnicode_GET_SIZE(u) #define __Pyx_PyUnicode_READ_CHAR(u, i) ((Py_UCS4)(PyUnicode_AS_UNICODE(u)[i])) #define __Pyx_PyUnicode_KIND(u) (sizeof(Py_UNICODE)) #define __Pyx_PyUnicode_DATA(u) ((void*)PyUnicode_AS_UNICODE(u)) #define __Pyx_PyUnicode_READ(k, d, i) ((void)(k), (Py_UCS4)(((Py_UNICODE*)d)[i])) #endif #if CYTHON_COMPILING_IN_PYPY #define __Pyx_PyUnicode_Concat(a, b) PyNumber_Add(a, b) #define __Pyx_PyUnicode_ConcatSafe(a, b) PyNumber_Add(a, b) #else #define __Pyx_PyUnicode_Concat(a, b) PyUnicode_Concat(a, b) #define __Pyx_PyUnicode_ConcatSafe(a, b) ((unlikely((a) == Py_None) || unlikely((b) == Py_None)) ?\ PyNumber_Add(a, b) : __Pyx_PyUnicode_Concat(a, b)) #endif #if CYTHON_COMPILING_IN_PYPY && !defined(PyUnicode_Contains) #define PyUnicode_Contains(u, s) PySequence_Contains(u, s) #endif #define __Pyx_PyString_FormatSafe(a, b) ((unlikely((a) == Py_None)) ? PyNumber_Remainder(a, b) : __Pyx_PyString_Format(a, b)) #define __Pyx_PyUnicode_FormatSafe(a, b) ((unlikely((a) == Py_None)) ? PyNumber_Remainder(a, b) : PyUnicode_Format(a, b)) #if PY_MAJOR_VERSION >= 3 #define __Pyx_PyString_Format(a, b) PyUnicode_Format(a, b) #else #define __Pyx_PyString_Format(a, b) PyString_Format(a, b) #endif #if PY_MAJOR_VERSION >= 3 #define PyBaseString_Type PyUnicode_Type #define PyStringObject PyUnicodeObject #define PyString_Type PyUnicode_Type #define PyString_Check PyUnicode_Check #define PyString_CheckExact PyUnicode_CheckExact #endif #if PY_MAJOR_VERSION >= 3 #define __Pyx_PyBaseString_Check(obj) PyUnicode_Check(obj) #define __Pyx_PyBaseString_CheckExact(obj) PyUnicode_CheckExact(obj) #else #define __Pyx_PyBaseString_Check(obj) (PyString_Check(obj) || PyUnicode_Check(obj)) #define __Pyx_PyBaseString_CheckExact(obj) (PyString_CheckExact(obj) || PyUnicode_CheckExact(obj)) #endif #ifndef PySet_CheckExact #define PySet_CheckExact(obj) (Py_TYPE(obj) == &PySet_Type) #endif #define __Pyx_TypeCheck(obj, type) PyObject_TypeCheck(obj, (PyTypeObject *)type) #if PY_MAJOR_VERSION >= 3 #define PyIntObject PyLongObject #define PyInt_Type PyLong_Type #define PyInt_Check(op) PyLong_Check(op) #define PyInt_CheckExact(op) PyLong_CheckExact(op) #define PyInt_FromString PyLong_FromString #define PyInt_FromUnicode PyLong_FromUnicode #define PyInt_FromLong PyLong_FromLong #define PyInt_FromSize_t PyLong_FromSize_t #define PyInt_FromSsize_t PyLong_FromSsize_t #define PyInt_AsLong PyLong_AsLong #define PyInt_AS_LONG PyLong_AS_LONG #define PyInt_AsSsize_t PyLong_AsSsize_t #define PyInt_AsUnsignedLongMask PyLong_AsUnsignedLongMask #define PyInt_AsUnsignedLongLongMask PyLong_AsUnsignedLongLongMask #define PyNumber_Int PyNumber_Long #endif #if PY_MAJOR_VERSION >= 3 #define PyBoolObject PyLongObject #endif #if PY_MAJOR_VERSION >= 3 && CYTHON_COMPILING_IN_PYPY #ifndef PyUnicode_InternFromString #define PyUnicode_InternFromString(s) PyUnicode_FromString(s) #endif #endif #if PY_VERSION_HEX < 0x030200A4 typedef long Py_hash_t; #define __Pyx_PyInt_FromHash_t PyInt_FromLong #define __Pyx_PyInt_AsHash_t PyInt_AsLong #else #define __Pyx_PyInt_FromHash_t PyInt_FromSsize_t #define __Pyx_PyInt_AsHash_t PyInt_AsSsize_t #endif #if PY_MAJOR_VERSION >= 3 #define __Pyx_PyMethod_New(func, self, klass) ((self) ? PyMethod_New(func, self) : PyInstanceMethod_New(func)) #else #define __Pyx_PyMethod_New(func, self, klass) PyMethod_New(func, self, klass) #endif #if PY_VERSION_HEX >= 0x030500B1 #define __Pyx_PyAsyncMethodsStruct PyAsyncMethods #define __Pyx_PyType_AsAsync(obj) (Py_TYPE(obj)->tp_as_async) #elif CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3 typedef struct { unaryfunc am_await; unaryfunc am_aiter; unaryfunc am_anext; } __Pyx_PyAsyncMethodsStruct; #define __Pyx_PyType_AsAsync(obj) ((__Pyx_PyAsyncMethodsStruct*) (Py_TYPE(obj)->tp_reserved)) #else #define __Pyx_PyType_AsAsync(obj) NULL #endif #ifndef CYTHON_RESTRICT #if defined(__GNUC__) #define CYTHON_RESTRICT __restrict__ #elif defined(_MSC_VER) && _MSC_VER >= 1400 #define CYTHON_RESTRICT __restrict #elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L #define CYTHON_RESTRICT restrict #else #define CYTHON_RESTRICT #endif #endif #define __Pyx_void_to_None(void_result) ((void)(void_result), Py_INCREF(Py_None), Py_None) #ifndef CYTHON_INLINE #if defined(__GNUC__) #define CYTHON_INLINE __inline__ #elif defined(_MSC_VER) #define CYTHON_INLINE __inline #elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L #define CYTHON_INLINE inline #else #define CYTHON_INLINE #endif #endif #if defined(WIN32) || defined(MS_WINDOWS) #define _USE_MATH_DEFINES #endif #include #ifdef NAN #define __PYX_NAN() ((float) NAN) #else static CYTHON_INLINE float __PYX_NAN() { float value; memset(&value, 0xFF, sizeof(value)); return value; } #endif #if PY_MAJOR_VERSION >= 3 #define __Pyx_PyNumber_Divide(x,y) PyNumber_TrueDivide(x,y) #define __Pyx_PyNumber_InPlaceDivide(x,y) PyNumber_InPlaceTrueDivide(x,y) #else #define __Pyx_PyNumber_Divide(x,y) PyNumber_Divide(x,y) #define __Pyx_PyNumber_InPlaceDivide(x,y) PyNumber_InPlaceDivide(x,y) #endif #ifndef __PYX_EXTERN_C #ifdef __cplusplus #define __PYX_EXTERN_C extern "C" #else #define __PYX_EXTERN_C extern #endif #endif #define __PYX_HAVE__pygame_sdl2__font #define __PYX_HAVE_API__pygame_sdl2__font #include "stdint.h" #include "string.h" #include "stdio.h" #include "stddef.h" #include "SDL.h" #include "SDL_ttf.h" #ifdef _OPENMP #include #endif /* _OPENMP */ #ifdef PYREX_WITHOUT_ASSERTIONS #define CYTHON_WITHOUT_ASSERTIONS #endif #ifndef CYTHON_UNUSED # if defined(__GNUC__) # if !(defined(__cplusplus)) || (__GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 4)) # define CYTHON_UNUSED __attribute__ ((__unused__)) # else # define CYTHON_UNUSED # endif # elif defined(__ICC) || (defined(__INTEL_COMPILER) && !defined(_MSC_VER)) # define CYTHON_UNUSED __attribute__ ((__unused__)) # else # define CYTHON_UNUSED # endif #endif #ifndef CYTHON_NCP_UNUSED # if CYTHON_COMPILING_IN_CPYTHON # define CYTHON_NCP_UNUSED # else # define CYTHON_NCP_UNUSED CYTHON_UNUSED # endif #endif typedef struct {PyObject **p; char *s; const Py_ssize_t n; const char* encoding; const char is_unicode; const char is_str; const char intern; } __Pyx_StringTabEntry; #define __PYX_DEFAULT_STRING_ENCODING_IS_ASCII 0 #define __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT 0 #define __PYX_DEFAULT_STRING_ENCODING "" #define __Pyx_PyObject_FromString __Pyx_PyBytes_FromString #define __Pyx_PyObject_FromStringAndSize __Pyx_PyBytes_FromStringAndSize #define __Pyx_uchar_cast(c) ((unsigned char)c) #define __Pyx_long_cast(x) ((long)x) #define __Pyx_fits_Py_ssize_t(v, type, is_signed) (\ (sizeof(type) < sizeof(Py_ssize_t)) ||\ (sizeof(type) > sizeof(Py_ssize_t) &&\ likely(v < (type)PY_SSIZE_T_MAX ||\ v == (type)PY_SSIZE_T_MAX) &&\ (!is_signed || likely(v > (type)PY_SSIZE_T_MIN ||\ v == (type)PY_SSIZE_T_MIN))) ||\ (sizeof(type) == sizeof(Py_ssize_t) &&\ (is_signed || likely(v < (type)PY_SSIZE_T_MAX ||\ v == (type)PY_SSIZE_T_MAX))) ) #if defined (__cplusplus) && __cplusplus >= 201103L #include #define __Pyx_sst_abs(value) std::abs(value) #elif SIZEOF_INT >= SIZEOF_SIZE_T #define __Pyx_sst_abs(value) abs(value) #elif SIZEOF_LONG >= SIZEOF_SIZE_T #define __Pyx_sst_abs(value) labs(value) #elif defined (_MSC_VER) && defined (_M_X64) #define __Pyx_sst_abs(value) _abs64(value) #elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L #define __Pyx_sst_abs(value) llabs(value) #elif defined (__GNUC__) #define __Pyx_sst_abs(value) __builtin_llabs(value) #else #define __Pyx_sst_abs(value) ((value<0) ? -value : value) #endif static CYTHON_INLINE char* __Pyx_PyObject_AsString(PyObject*); static CYTHON_INLINE char* __Pyx_PyObject_AsStringAndSize(PyObject*, Py_ssize_t* length); #define __Pyx_PyByteArray_FromString(s) PyByteArray_FromStringAndSize((const char*)s, strlen((const char*)s)) #define __Pyx_PyByteArray_FromStringAndSize(s, l) PyByteArray_FromStringAndSize((const char*)s, l) #define __Pyx_PyBytes_FromString PyBytes_FromString #define __Pyx_PyBytes_FromStringAndSize PyBytes_FromStringAndSize static CYTHON_INLINE PyObject* __Pyx_PyUnicode_FromString(const char*); #if PY_MAJOR_VERSION < 3 #define __Pyx_PyStr_FromString __Pyx_PyBytes_FromString #define __Pyx_PyStr_FromStringAndSize __Pyx_PyBytes_FromStringAndSize #else #define __Pyx_PyStr_FromString __Pyx_PyUnicode_FromString #define __Pyx_PyStr_FromStringAndSize __Pyx_PyUnicode_FromStringAndSize #endif #define __Pyx_PyObject_AsSString(s) ((signed char*) __Pyx_PyObject_AsString(s)) #define __Pyx_PyObject_AsUString(s) ((unsigned char*) __Pyx_PyObject_AsString(s)) #define __Pyx_PyObject_FromCString(s) __Pyx_PyObject_FromString((const char*)s) #define __Pyx_PyBytes_FromCString(s) __Pyx_PyBytes_FromString((const char*)s) #define __Pyx_PyByteArray_FromCString(s) __Pyx_PyByteArray_FromString((const char*)s) #define __Pyx_PyStr_FromCString(s) __Pyx_PyStr_FromString((const char*)s) #define __Pyx_PyUnicode_FromCString(s) __Pyx_PyUnicode_FromString((const char*)s) #if PY_MAJOR_VERSION < 3 static CYTHON_INLINE size_t __Pyx_Py_UNICODE_strlen(const Py_UNICODE *u) { const Py_UNICODE *u_end = u; while (*u_end++) ; return (size_t)(u_end - u - 1); } #else #define __Pyx_Py_UNICODE_strlen Py_UNICODE_strlen #endif #define __Pyx_PyUnicode_FromUnicode(u) PyUnicode_FromUnicode(u, __Pyx_Py_UNICODE_strlen(u)) #define __Pyx_PyUnicode_FromUnicodeAndLength PyUnicode_FromUnicode #define __Pyx_PyUnicode_AsUnicode PyUnicode_AsUnicode #define __Pyx_NewRef(obj) (Py_INCREF(obj), obj) #define __Pyx_Owned_Py_None(b) __Pyx_NewRef(Py_None) #define __Pyx_PyBool_FromLong(b) ((b) ? __Pyx_NewRef(Py_True) : __Pyx_NewRef(Py_False)) static CYTHON_INLINE int __Pyx_PyObject_IsTrue(PyObject*); static CYTHON_INLINE PyObject* __Pyx_PyNumber_Int(PyObject* x); static CYTHON_INLINE Py_ssize_t __Pyx_PyIndex_AsSsize_t(PyObject*); static CYTHON_INLINE PyObject * __Pyx_PyInt_FromSize_t(size_t); #if CYTHON_COMPILING_IN_CPYTHON #define __pyx_PyFloat_AsDouble(x) (PyFloat_CheckExact(x) ? PyFloat_AS_DOUBLE(x) : PyFloat_AsDouble(x)) #else #define __pyx_PyFloat_AsDouble(x) PyFloat_AsDouble(x) #endif #define __pyx_PyFloat_AsFloat(x) ((float) __pyx_PyFloat_AsDouble(x)) #if PY_MAJOR_VERSION < 3 && __PYX_DEFAULT_STRING_ENCODING_IS_ASCII static int __Pyx_sys_getdefaultencoding_not_ascii; static int __Pyx_init_sys_getdefaultencoding_params(void) { PyObject* sys; PyObject* default_encoding = NULL; PyObject* ascii_chars_u = NULL; PyObject* ascii_chars_b = NULL; const char* default_encoding_c; sys = PyImport_ImportModule("sys"); if (!sys) goto bad; default_encoding = PyObject_CallMethod(sys, (char*) "getdefaultencoding", NULL); Py_DECREF(sys); if (!default_encoding) goto bad; default_encoding_c = PyBytes_AsString(default_encoding); if (!default_encoding_c) goto bad; if (strcmp(default_encoding_c, "ascii") == 0) { __Pyx_sys_getdefaultencoding_not_ascii = 0; } else { char ascii_chars[128]; int c; for (c = 0; c < 128; c++) { ascii_chars[c] = c; } __Pyx_sys_getdefaultencoding_not_ascii = 1; ascii_chars_u = PyUnicode_DecodeASCII(ascii_chars, 128, NULL); if (!ascii_chars_u) goto bad; ascii_chars_b = PyUnicode_AsEncodedString(ascii_chars_u, default_encoding_c, NULL); if (!ascii_chars_b || !PyBytes_Check(ascii_chars_b) || memcmp(ascii_chars, PyBytes_AS_STRING(ascii_chars_b), 128) != 0) { PyErr_Format( PyExc_ValueError, "This module compiled with c_string_encoding=ascii, but default encoding '%.200s' is not a superset of ascii.", default_encoding_c); goto bad; } Py_DECREF(ascii_chars_u); Py_DECREF(ascii_chars_b); } Py_DECREF(default_encoding); return 0; bad: Py_XDECREF(default_encoding); Py_XDECREF(ascii_chars_u); Py_XDECREF(ascii_chars_b); return -1; } #endif #if __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT && PY_MAJOR_VERSION >= 3 #define __Pyx_PyUnicode_FromStringAndSize(c_str, size) PyUnicode_DecodeUTF8(c_str, size, NULL) #else #define __Pyx_PyUnicode_FromStringAndSize(c_str, size) PyUnicode_Decode(c_str, size, __PYX_DEFAULT_STRING_ENCODING, NULL) #if __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT static char* __PYX_DEFAULT_STRING_ENCODING; static int __Pyx_init_sys_getdefaultencoding_params(void) { PyObject* sys; PyObject* default_encoding = NULL; char* default_encoding_c; sys = PyImport_ImportModule("sys"); if (!sys) goto bad; default_encoding = PyObject_CallMethod(sys, (char*) (const char*) "getdefaultencoding", NULL); Py_DECREF(sys); if (!default_encoding) goto bad; default_encoding_c = PyBytes_AsString(default_encoding); if (!default_encoding_c) goto bad; __PYX_DEFAULT_STRING_ENCODING = (char*) malloc(strlen(default_encoding_c)); if (!__PYX_DEFAULT_STRING_ENCODING) goto bad; strcpy(__PYX_DEFAULT_STRING_ENCODING, default_encoding_c); Py_DECREF(default_encoding); return 0; bad: Py_XDECREF(default_encoding); return -1; } #endif #endif /* Test for GCC > 2.95 */ #if defined(__GNUC__) && (__GNUC__ > 2 || (__GNUC__ == 2 && (__GNUC_MINOR__ > 95))) #define likely(x) __builtin_expect(!!(x), 1) #define unlikely(x) __builtin_expect(!!(x), 0) #else /* !__GNUC__ or GCC < 2.95 */ #define likely(x) (x) #define unlikely(x) (x) #endif /* __GNUC__ */ static PyObject *__pyx_m; static PyObject *__pyx_d; static PyObject *__pyx_b; static PyObject *__pyx_empty_tuple; static PyObject *__pyx_empty_bytes; static int __pyx_lineno; static int __pyx_clineno = 0; static const char * __pyx_cfilenm= __FILE__; static const char *__pyx_filename; static const char *__pyx_f[] = { "src/pygame_sdl2/font.pyx", "src/pygame_sdl2/surface.pxd", "src/pygame_sdl2/color.pxd", }; /*--- Type declarations ---*/ struct __pyx_obj_11pygame_sdl2_7surface_Surface; struct __pyx_obj_11pygame_sdl2_5color_Color; struct __pyx_obj_11pygame_sdl2_4font_Font; struct __pyx_opt_args_11pygame_sdl2_8rwobject_to_rwops; /* "pygame_sdl2/rwobject.pxd":21 * from sdl2 cimport SDL_RWops * * cdef SDL_RWops *to_rwops(filelike, mode=*) except NULL # <<<<<<<<<<<<<< * */ struct __pyx_opt_args_11pygame_sdl2_8rwobject_to_rwops { int __pyx_n; PyObject *mode; }; /* "pygame_sdl2/surface.pxd":23 * from sdl2 cimport SDL_Surface * * cdef class Surface: # <<<<<<<<<<<<<< * # Allow weak references. * cdef object __weakref__ */ struct __pyx_obj_11pygame_sdl2_7surface_Surface { PyObject_HEAD struct __pyx_vtabstruct_11pygame_sdl2_7surface_Surface *__pyx_vtab; PyObject *__weakref__; SDL_Surface *surface; int owns_surface; int window_surface; PyObject *locklist; struct __pyx_obj_11pygame_sdl2_7surface_Surface *parent; struct __pyx_obj_11pygame_sdl2_7surface_Surface *root; int offset_x; int offset_y; PyObject *get_window_flags; int has_alpha; }; /* "pygame_sdl2/color.pxd":26 * cdef to_sdl_color(color, SDL_Color *out) * * cdef class Color: # <<<<<<<<<<<<<< * # Allow weak references. * cdef object __weakref__ */ struct __pyx_obj_11pygame_sdl2_5color_Color { PyObject_HEAD struct __pyx_vtabstruct_11pygame_sdl2_5color_Color *__pyx_vtab; PyObject *__weakref__; Uint8 r; Uint8 g; Uint8 b; Uint8 a; uint8_t length; }; /* "pygame_sdl2/font.pyx":50 * return match_font("sans") * * cdef class Font: # <<<<<<<<<<<<<< * cdef TTF_Font *font * cdef int style */ struct __pyx_obj_11pygame_sdl2_4font_Font { PyObject_HEAD struct __pyx_vtabstruct_11pygame_sdl2_4font_Font *__pyx_vtab; TTF_Font *font; int style; }; /* "pygame_sdl2/surface.pxd":23 * from sdl2 cimport SDL_Surface * * cdef class Surface: # <<<<<<<<<<<<<< * # Allow weak references. * cdef object __weakref__ */ struct __pyx_vtabstruct_11pygame_sdl2_7surface_Surface { void (*take_surface)(struct __pyx_obj_11pygame_sdl2_7surface_Surface *, SDL_Surface *); }; static struct __pyx_vtabstruct_11pygame_sdl2_7surface_Surface *__pyx_vtabptr_11pygame_sdl2_7surface_Surface; /* "pygame_sdl2/color.pxd":26 * cdef to_sdl_color(color, SDL_Color *out) * * cdef class Color: # <<<<<<<<<<<<<< * # Allow weak references. * cdef object __weakref__ */ struct __pyx_vtabstruct_11pygame_sdl2_5color_Color { PyObject *(*from_rgba)(struct __pyx_obj_11pygame_sdl2_5color_Color *, Uint8, Uint8, Uint8, Uint8); PyObject *(*from_name)(struct __pyx_obj_11pygame_sdl2_5color_Color *, PyObject *); PyObject *(*from_hex)(struct __pyx_obj_11pygame_sdl2_5color_Color *, PyObject *); }; static struct __pyx_vtabstruct_11pygame_sdl2_5color_Color *__pyx_vtabptr_11pygame_sdl2_5color_Color; /* "pygame_sdl2/font.pyx":50 * return match_font("sans") * * cdef class Font: # <<<<<<<<<<<<<< * cdef TTF_Font *font * cdef int style */ struct __pyx_vtabstruct_11pygame_sdl2_4font_Font { PyObject *(*set_style)(struct __pyx_obj_11pygame_sdl2_4font_Font *, PyObject *, PyObject *); }; static struct __pyx_vtabstruct_11pygame_sdl2_4font_Font *__pyx_vtabptr_11pygame_sdl2_4font_Font; /* --- Runtime support code (head) --- */ #ifndef CYTHON_REFNANNY #define CYTHON_REFNANNY 0 #endif #if CYTHON_REFNANNY typedef struct { void (*INCREF)(void*, PyObject*, int); void (*DECREF)(void*, PyObject*, int); void (*GOTREF)(void*, PyObject*, int); void (*GIVEREF)(void*, PyObject*, int); void* (*SetupContext)(const char*, int, const char*); void (*FinishContext)(void**); } __Pyx_RefNannyAPIStruct; static __Pyx_RefNannyAPIStruct *__Pyx_RefNanny = NULL; static __Pyx_RefNannyAPIStruct *__Pyx_RefNannyImportAPI(const char *modname); #define __Pyx_RefNannyDeclarations void *__pyx_refnanny = NULL; #ifdef WITH_THREAD #define __Pyx_RefNannySetupContext(name, acquire_gil)\ if (acquire_gil) {\ PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure();\ __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), __LINE__, __FILE__);\ PyGILState_Release(__pyx_gilstate_save);\ } else {\ __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), __LINE__, __FILE__);\ } #else #define __Pyx_RefNannySetupContext(name, acquire_gil)\ __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), __LINE__, __FILE__) #endif #define __Pyx_RefNannyFinishContext()\ __Pyx_RefNanny->FinishContext(&__pyx_refnanny) #define __Pyx_INCREF(r) __Pyx_RefNanny->INCREF(__pyx_refnanny, (PyObject *)(r), __LINE__) #define __Pyx_DECREF(r) __Pyx_RefNanny->DECREF(__pyx_refnanny, (PyObject *)(r), __LINE__) #define __Pyx_GOTREF(r) __Pyx_RefNanny->GOTREF(__pyx_refnanny, (PyObject *)(r), __LINE__) #define __Pyx_GIVEREF(r) __Pyx_RefNanny->GIVEREF(__pyx_refnanny, (PyObject *)(r), __LINE__) #define __Pyx_XINCREF(r) do { if((r) != NULL) {__Pyx_INCREF(r); }} while(0) #define __Pyx_XDECREF(r) do { if((r) != NULL) {__Pyx_DECREF(r); }} while(0) #define __Pyx_XGOTREF(r) do { if((r) != NULL) {__Pyx_GOTREF(r); }} while(0) #define __Pyx_XGIVEREF(r) do { if((r) != NULL) {__Pyx_GIVEREF(r);}} while(0) #else #define __Pyx_RefNannyDeclarations #define __Pyx_RefNannySetupContext(name, acquire_gil) #define __Pyx_RefNannyFinishContext() #define __Pyx_INCREF(r) Py_INCREF(r) #define __Pyx_DECREF(r) Py_DECREF(r) #define __Pyx_GOTREF(r) #define __Pyx_GIVEREF(r) #define __Pyx_XINCREF(r) Py_XINCREF(r) #define __Pyx_XDECREF(r) Py_XDECREF(r) #define __Pyx_XGOTREF(r) #define __Pyx_XGIVEREF(r) #endif #define __Pyx_XDECREF_SET(r, v) do {\ PyObject *tmp = (PyObject *) r;\ r = v; __Pyx_XDECREF(tmp);\ } while (0) #define __Pyx_DECREF_SET(r, v) do {\ PyObject *tmp = (PyObject *) r;\ r = v; __Pyx_DECREF(tmp);\ } while (0) #define __Pyx_CLEAR(r) do { PyObject* tmp = ((PyObject*)(r)); r = NULL; __Pyx_DECREF(tmp);} while(0) #define __Pyx_XCLEAR(r) do { if((r) != NULL) {PyObject* tmp = ((PyObject*)(r)); r = NULL; __Pyx_DECREF(tmp);}} while(0) #if CYTHON_COMPILING_IN_CPYTHON static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStr(PyObject* obj, PyObject* attr_name) { PyTypeObject* tp = Py_TYPE(obj); if (likely(tp->tp_getattro)) return tp->tp_getattro(obj, attr_name); #if PY_MAJOR_VERSION < 3 if (likely(tp->tp_getattr)) return tp->tp_getattr(obj, PyString_AS_STRING(attr_name)); #endif return PyObject_GetAttr(obj, attr_name); } #else #define __Pyx_PyObject_GetAttrStr(o,n) PyObject_GetAttr(o,n) #endif static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list, int level); static PyObject *__Pyx_GetBuiltinName(PyObject *name); static CYTHON_INLINE PyObject *__Pyx_GetModuleGlobalName(PyObject *name); #if CYTHON_COMPILING_IN_CPYTHON static CYTHON_INLINE PyObject* __Pyx_PyObject_Call(PyObject *func, PyObject *arg, PyObject *kw); #else #define __Pyx_PyObject_Call(func, arg, kw) PyObject_Call(func, arg, kw) #endif #if CYTHON_COMPILING_IN_CPYTHON static CYTHON_INLINE PyObject* __Pyx_PyObject_CallMethO(PyObject *func, PyObject *arg); #endif static CYTHON_INLINE PyObject* __Pyx_PyObject_CallOneArg(PyObject *func, PyObject *arg); static void __Pyx_RaiseArgtupleInvalid(const char* func_name, int exact, Py_ssize_t num_min, Py_ssize_t num_max, Py_ssize_t num_found); static CYTHON_INLINE int __Pyx_CheckKeywordStrings(PyObject *kwdict, const char* function_name, int kw_allowed); static void __Pyx_RaiseDoubleKeywordsError(const char* func_name, PyObject* kw_name); static int __Pyx_ParseOptionalKeywords(PyObject *kwds, PyObject **argnames[],\ PyObject *kwds2, PyObject *values[], Py_ssize_t num_pos_args,\ const char* function_name); #if CYTHON_COMPILING_IN_CPYTHON static CYTHON_INLINE PyObject* __Pyx_PyObject_CallNoArg(PyObject *func); #else #define __Pyx_PyObject_CallNoArg(func) __Pyx_PyObject_Call(func, __pyx_empty_tuple, NULL) #endif static CYTHON_INLINE void __Pyx_ErrRestore(PyObject *type, PyObject *value, PyObject *tb); static CYTHON_INLINE void __Pyx_ErrFetch(PyObject **type, PyObject **value, PyObject **tb); static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, PyObject *cause); static CYTHON_INLINE void __Pyx_RaiseTooManyValuesError(Py_ssize_t expected); static CYTHON_INLINE void __Pyx_RaiseNeedMoreValuesError(Py_ssize_t index); static CYTHON_INLINE int __Pyx_IterFinish(void); static int __Pyx_IternextUnpackEndCheck(PyObject *retval, Py_ssize_t expected); static CYTHON_INLINE int __Pyx_TypeTest(PyObject *obj, PyTypeObject *type); static CYTHON_INLINE Py_UCS4 __Pyx_PyUnicode_AsPy_UCS4(PyObject*); #if PY_MAJOR_VERSION >= 3 #define __Pyx_PyObject_Ord(c)\ (likely(PyUnicode_Check(c)) ? (long)__Pyx_PyUnicode_AsPy_UCS4(c) : __Pyx__PyObject_Ord(c)) #else #define __Pyx_PyObject_Ord(c) __Pyx__PyObject_Ord(c) #endif static long __Pyx__PyObject_Ord(PyObject* c); #if CYTHON_COMPILING_IN_CPYTHON static CYTHON_INLINE int __Pyx_PyList_Append(PyObject* list, PyObject* x) { PyListObject* L = (PyListObject*) list; Py_ssize_t len = Py_SIZE(list); if (likely(L->allocated > len) & likely(len > (L->allocated >> 1))) { Py_INCREF(x); PyList_SET_ITEM(list, len, x); Py_SIZE(list) = len+1; return 0; } return PyList_Append(list, x); } #else #define __Pyx_PyList_Append(L,x) PyList_Append(L,x) #endif static int __Pyx_SetVtable(PyObject *dict, void *vtable); static void* __Pyx_GetVtable(PyObject *dict); static PyObject* __Pyx_ImportFrom(PyObject* module, PyObject* name); typedef struct { int code_line; PyCodeObject* code_object; } __Pyx_CodeObjectCacheEntry; struct __Pyx_CodeObjectCache { int count; int max_count; __Pyx_CodeObjectCacheEntry* entries; }; static struct __Pyx_CodeObjectCache __pyx_code_cache = {0,0,NULL}; static int __pyx_bisect_code_objects(__Pyx_CodeObjectCacheEntry* entries, int count, int code_line); static PyCodeObject *__pyx_find_code_object(int code_line); static void __pyx_insert_code_object(int code_line, PyCodeObject* code_object); static void __Pyx_AddTraceback(const char *funcname, int c_line, int py_line, const char *filename); static CYTHON_INLINE int __Pyx_PyInt_As_int(PyObject *); static CYTHON_INLINE PyObject* __Pyx_PyInt_From_int(int value); static CYTHON_INLINE PyObject* __Pyx_PyInt_From_long(long value); static CYTHON_INLINE long __Pyx_PyInt_As_long(PyObject *); static int __Pyx_check_binary_version(void); #if !defined(__Pyx_PyIdentifier_FromString) #if PY_MAJOR_VERSION < 3 #define __Pyx_PyIdentifier_FromString(s) PyString_FromString(s) #else #define __Pyx_PyIdentifier_FromString(s) PyUnicode_FromString(s) #endif #endif static PyObject *__Pyx_ImportModule(const char *name); static PyTypeObject *__Pyx_ImportType(const char *module_name, const char *class_name, size_t size, int strict); static int __Pyx_ImportFunction(PyObject *module, const char *funcname, void (**f)(void), const char *sig); static int __Pyx_InitStrings(__Pyx_StringTabEntry *t); static PyObject *__pyx_f_11pygame_sdl2_4font_4Font_set_style(struct __pyx_obj_11pygame_sdl2_4font_Font *__pyx_v_self, PyObject *__pyx_v_flag, PyObject *__pyx_v_on); /* proto*/ /* Module declarations from 'libc.stdint' */ /* Module declarations from 'libc.string' */ /* Module declarations from 'libc.stdio' */ /* Module declarations from 'libc.stddef' */ /* Module declarations from 'sdl2' */ /* Module declarations from 'sdl2_ttf' */ /* Module declarations from 'pygame_sdl2.surface' */ static PyTypeObject *__pyx_ptype_11pygame_sdl2_7surface_Surface = 0; /* Module declarations from 'pygame_sdl2.color' */ static PyTypeObject *__pyx_ptype_11pygame_sdl2_5color_Color = 0; static PyObject *(*__pyx_f_11pygame_sdl2_5color_to_sdl_color)(PyObject *, SDL_Color *); /*proto*/ /* Module declarations from 'pygame_sdl2.rwobject' */ static SDL_RWops *(*__pyx_f_11pygame_sdl2_8rwobject_to_rwops)(PyObject *, struct __pyx_opt_args_11pygame_sdl2_8rwobject_to_rwops *__pyx_optional_args); /*proto*/ /* Module declarations from 'pygame_sdl2.font' */ static PyTypeObject *__pyx_ptype_11pygame_sdl2_4font_Font = 0; #define __Pyx_MODULE_NAME "pygame_sdl2.font" int __pyx_module_is_main_pygame_sdl2__font = 0; /* Implementation of 'pygame_sdl2.font' */ static char __pyx_k__2[] = " "; static char __pyx_k_fi[] = "fi"; static char __pyx_k_os[] = "os"; static char __pyx_k_blit[] = "blit"; static char __pyx_k_copy[] = "copy"; static char __pyx_k_file[] = "__file__"; static char __pyx_k_fill[] = "fill"; static char __pyx_k_init[] = "init"; static char __pyx_k_join[] = "join"; static char __pyx_k_main[] = "__main__"; static char __pyx_k_path[] = "path"; static char __pyx_k_quit[] = "quit"; static char __pyx_k_sans[] = "sans"; static char __pyx_k_size[] = "size"; static char __pyx_k_test[] = "__test__"; static char __pyx_k_text[] = "text"; static char __pyx_k_color[] = "color"; static char __pyx_k_error[] = "error"; static char __pyx_k_utf_8[] = "utf-8"; static char __pyx_k_encode[] = "encode"; static char __pyx_k_exists[] = "exists"; static char __pyx_k_import[] = "__import__"; static char __pyx_k_SysFont[] = "SysFont"; static char __pyx_k_convert[] = "convert"; static char __pyx_k_default[] = "default"; static char __pyx_k_dirname[] = "dirname"; static char __pyx_k_get_init[] = "get_init"; static char __pyx_k_antialias[] = "antialias"; static char __pyx_k_get_fonts[] = "get_fonts"; static char __pyx_k_background[] = "background"; static char __pyx_k_match_font[] = "match_font"; static char __pyx_k_pyx_vtable[] = "__pyx_vtable__"; static char __pyx_k_pygame_sdl2[] = "pygame_sdl2"; static char __pyx_k_register_init[] = "register_init"; static char __pyx_k_register_quit[] = "register_quit"; static char __pyx_k_DejaVuSans_ttf[] = "DejaVuSans.ttf"; static char __pyx_k_get_default_font[] = "get_default_font"; static char __pyx_k_pygame_sdl2_font[] = "pygame_sdl2.font"; static char __pyx_k_pygame_sdl2_error[] = "pygame_sdl2.error"; static char __pyx_k_pygame_sdl2_sysfont[] = "pygame_sdl2.sysfont"; static char __pyx_k_home_tom_ab_pygame_sdl2_src_pyg[] = "/home/tom/ab/pygame_sdl2/src/pygame_sdl2/font.pyx"; static PyObject *__pyx_kp_s_DejaVuSans_ttf; static PyObject *__pyx_n_s_SysFont; static PyObject *__pyx_kp_s__2; static PyObject *__pyx_n_s_antialias; static PyObject *__pyx_n_s_background; static PyObject *__pyx_n_s_blit; static PyObject *__pyx_n_s_color; static PyObject *__pyx_n_s_convert; static PyObject *__pyx_n_s_copy; static PyObject *__pyx_n_s_default; static PyObject *__pyx_n_s_dirname; static PyObject *__pyx_n_s_encode; static PyObject *__pyx_n_s_error; static PyObject *__pyx_n_s_exists; static PyObject *__pyx_n_s_fi; static PyObject *__pyx_n_s_file; static PyObject *__pyx_n_s_fill; static PyObject *__pyx_n_s_get_default_font; static PyObject *__pyx_n_s_get_fonts; static PyObject *__pyx_n_s_get_init; static PyObject *__pyx_kp_s_home_tom_ab_pygame_sdl2_src_pyg; static PyObject *__pyx_n_s_import; static PyObject *__pyx_n_s_init; static PyObject *__pyx_n_s_join; static PyObject *__pyx_n_s_main; static PyObject *__pyx_n_s_match_font; static PyObject *__pyx_n_s_os; static PyObject *__pyx_n_s_path; static PyObject *__pyx_n_s_pygame_sdl2; static PyObject *__pyx_n_s_pygame_sdl2_error; static PyObject *__pyx_n_s_pygame_sdl2_font; static PyObject *__pyx_n_s_pygame_sdl2_sysfont; static PyObject *__pyx_n_s_pyx_vtable; static PyObject *__pyx_n_s_quit; static PyObject *__pyx_n_s_register_init; static PyObject *__pyx_n_s_register_quit; static PyObject *__pyx_n_s_sans; static PyObject *__pyx_n_s_size; static PyObject *__pyx_n_s_test; static PyObject *__pyx_n_s_text; static PyObject *__pyx_kp_s_utf_8; static PyObject *__pyx_pf_11pygame_sdl2_4font_init(CYTHON_UNUSED PyObject *__pyx_self); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_4font_2quit(CYTHON_UNUSED PyObject *__pyx_self); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_4font_4get_init(CYTHON_UNUSED PyObject *__pyx_self); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_4font_6get_default_font(CYTHON_UNUSED PyObject *__pyx_self); /* proto */ static int __pyx_pf_11pygame_sdl2_4font_4Font___cinit__(struct __pyx_obj_11pygame_sdl2_4font_Font *__pyx_v_self); /* proto */ static void __pyx_pf_11pygame_sdl2_4font_4Font_2__dealloc__(struct __pyx_obj_11pygame_sdl2_4font_Font *__pyx_v_self); /* proto */ static int __pyx_pf_11pygame_sdl2_4font_4Font_4__init__(struct __pyx_obj_11pygame_sdl2_4font_Font *__pyx_v_self, PyObject *__pyx_v_fi, PyObject *__pyx_v_size); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_4font_4Font_6render(struct __pyx_obj_11pygame_sdl2_4font_Font *__pyx_v_self, PyObject *__pyx_v_text, PyObject *__pyx_v_antialias, PyObject *__pyx_v_color, PyObject *__pyx_v_background); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_4font_4Font_8size(struct __pyx_obj_11pygame_sdl2_4font_Font *__pyx_v_self, PyObject *__pyx_v_text); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_4font_4Font_10set_underline(struct __pyx_obj_11pygame_sdl2_4font_Font *__pyx_v_self, PyObject *__pyx_v_on); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_4font_4Font_12get_underline(struct __pyx_obj_11pygame_sdl2_4font_Font *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_4font_4Font_14set_bold(struct __pyx_obj_11pygame_sdl2_4font_Font *__pyx_v_self, PyObject *__pyx_v_on); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_4font_4Font_16get_bold(struct __pyx_obj_11pygame_sdl2_4font_Font *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_4font_4Font_18set_italic(struct __pyx_obj_11pygame_sdl2_4font_Font *__pyx_v_self, PyObject *__pyx_v_on); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_4font_4Font_20get_italic(struct __pyx_obj_11pygame_sdl2_4font_Font *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_4font_4Font_22get_linesize(struct __pyx_obj_11pygame_sdl2_4font_Font *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_4font_4Font_24get_height(struct __pyx_obj_11pygame_sdl2_4font_Font *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_4font_4Font_26get_ascent(struct __pyx_obj_11pygame_sdl2_4font_Font *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_4font_4Font_28get_descent(struct __pyx_obj_11pygame_sdl2_4font_Font *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_4font_4Font_30metrics(struct __pyx_obj_11pygame_sdl2_4font_Font *__pyx_v_self, PyObject *__pyx_v_text); /* proto */ static PyObject *__pyx_tp_new_11pygame_sdl2_4font_Font(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ static PyObject *__pyx_int_0; static PyObject *__pyx_tuple_; static PyObject *__pyx_tuple__3; static PyObject *__pyx_tuple__4; static PyObject *__pyx_tuple__5; static PyObject *__pyx_tuple__6; static PyObject *__pyx_tuple__7; static PyObject *__pyx_tuple__8; static PyObject *__pyx_tuple__12; static PyObject *__pyx_codeobj__9; static PyObject *__pyx_codeobj__10; static PyObject *__pyx_codeobj__11; static PyObject *__pyx_codeobj__13; /* "pygame_sdl2/font.pyx":30 * * @pygame_sdl2.register_init * def init(): # <<<<<<<<<<<<<< * TTF_Init() * */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_4font_1init(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused); /*proto*/ static PyMethodDef __pyx_mdef_11pygame_sdl2_4font_1init = {"init", (PyCFunction)__pyx_pw_11pygame_sdl2_4font_1init, METH_NOARGS, 0}; static PyObject *__pyx_pw_11pygame_sdl2_4font_1init(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("init (wrapper)", 0); __pyx_r = __pyx_pf_11pygame_sdl2_4font_init(__pyx_self); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_4font_init(CYTHON_UNUSED PyObject *__pyx_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("init", 0); /* "pygame_sdl2/font.pyx":31 * @pygame_sdl2.register_init * def init(): * TTF_Init() # <<<<<<<<<<<<<< * * @pygame_sdl2.register_quit */ TTF_Init(); /* "pygame_sdl2/font.pyx":30 * * @pygame_sdl2.register_init * def init(): # <<<<<<<<<<<<<< * TTF_Init() * */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/font.pyx":34 * * @pygame_sdl2.register_quit * def quit(): # @ReservedAssignment # <<<<<<<<<<<<<< * TTF_Quit() * */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_4font_3quit(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused); /*proto*/ static PyMethodDef __pyx_mdef_11pygame_sdl2_4font_3quit = {"quit", (PyCFunction)__pyx_pw_11pygame_sdl2_4font_3quit, METH_NOARGS, 0}; static PyObject *__pyx_pw_11pygame_sdl2_4font_3quit(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("quit (wrapper)", 0); __pyx_r = __pyx_pf_11pygame_sdl2_4font_2quit(__pyx_self); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_4font_2quit(CYTHON_UNUSED PyObject *__pyx_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("quit", 0); /* "pygame_sdl2/font.pyx":35 * @pygame_sdl2.register_quit * def quit(): # @ReservedAssignment * TTF_Quit() # <<<<<<<<<<<<<< * * def get_init(): */ TTF_Quit(); /* "pygame_sdl2/font.pyx":34 * * @pygame_sdl2.register_quit * def quit(): # @ReservedAssignment # <<<<<<<<<<<<<< * TTF_Quit() * */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/font.pyx":37 * TTF_Quit() * * def get_init(): # <<<<<<<<<<<<<< * return TTF_WasInit() != 0 * */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_4font_5get_init(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused); /*proto*/ static PyMethodDef __pyx_mdef_11pygame_sdl2_4font_5get_init = {"get_init", (PyCFunction)__pyx_pw_11pygame_sdl2_4font_5get_init, METH_NOARGS, 0}; static PyObject *__pyx_pw_11pygame_sdl2_4font_5get_init(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("get_init (wrapper)", 0); __pyx_r = __pyx_pf_11pygame_sdl2_4font_4get_init(__pyx_self); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_4font_4get_init(CYTHON_UNUSED PyObject *__pyx_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("get_init", 0); /* "pygame_sdl2/font.pyx":38 * * def get_init(): * return TTF_WasInit() != 0 # <<<<<<<<<<<<<< * * def get_default_font(): */ __Pyx_XDECREF(__pyx_r); __pyx_t_1 = __Pyx_PyBool_FromLong((TTF_WasInit() != 0)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 38; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "pygame_sdl2/font.pyx":37 * TTF_Quit() * * def get_init(): # <<<<<<<<<<<<<< * return TTF_WasInit() != 0 * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("pygame_sdl2.font.get_init", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/font.pyx":40 * return TTF_WasInit() != 0 * * def get_default_font(): # <<<<<<<<<<<<<< * import os * */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_4font_7get_default_font(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused); /*proto*/ static PyMethodDef __pyx_mdef_11pygame_sdl2_4font_7get_default_font = {"get_default_font", (PyCFunction)__pyx_pw_11pygame_sdl2_4font_7get_default_font, METH_NOARGS, 0}; static PyObject *__pyx_pw_11pygame_sdl2_4font_7get_default_font(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("get_default_font (wrapper)", 0); __pyx_r = __pyx_pf_11pygame_sdl2_4font_6get_default_font(__pyx_self); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_4font_6get_default_font(CYTHON_UNUSED PyObject *__pyx_self) { PyObject *__pyx_v_os = NULL; PyObject *__pyx_v_default = NULL; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; PyObject *__pyx_t_5 = NULL; PyObject *__pyx_t_6 = NULL; PyObject *__pyx_t_7 = NULL; Py_ssize_t __pyx_t_8; int __pyx_t_9; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("get_default_font", 0); /* "pygame_sdl2/font.pyx":41 * * def get_default_font(): * import os # <<<<<<<<<<<<<< * * default = os.path.join(os.path.dirname(__file__), "DejaVuSans.ttf") */ __pyx_t_1 = __Pyx_Import(__pyx_n_s_os, 0, -1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 41; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_v_os = __pyx_t_1; __pyx_t_1 = 0; /* "pygame_sdl2/font.pyx":43 * import os * * default = os.path.join(os.path.dirname(__file__), "DejaVuSans.ttf") # <<<<<<<<<<<<<< * * if os.path.exists(default): */ __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_os, __pyx_n_s_path); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 43; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_join); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 43; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_os, __pyx_n_s_path); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 43; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_dirname); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 43; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_file); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 43; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); __pyx_t_6 = NULL; if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_5))) { __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_5); if (likely(__pyx_t_6)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5); __Pyx_INCREF(__pyx_t_6); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_5, function); } } if (!__pyx_t_6) { __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_t_4); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 43; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_GOTREF(__pyx_t_2); } else { __pyx_t_7 = PyTuple_New(1+1); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 43; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_7); __Pyx_GIVEREF(__pyx_t_6); PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_6); __pyx_t_6 = NULL; __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_7, 0+1, __pyx_t_4); __pyx_t_4 = 0; __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_7, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 43; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; } __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __pyx_t_5 = NULL; __pyx_t_8 = 0; if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_3))) { __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_3); if (likely(__pyx_t_5)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); __Pyx_INCREF(__pyx_t_5); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_3, function); __pyx_t_8 = 1; } } __pyx_t_7 = PyTuple_New(2+__pyx_t_8); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 43; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_7); if (__pyx_t_5) { __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_5); __pyx_t_5 = NULL; } __Pyx_GIVEREF(__pyx_t_2); PyTuple_SET_ITEM(__pyx_t_7, 0+__pyx_t_8, __pyx_t_2); __Pyx_INCREF(__pyx_kp_s_DejaVuSans_ttf); __Pyx_GIVEREF(__pyx_kp_s_DejaVuSans_ttf); PyTuple_SET_ITEM(__pyx_t_7, 1+__pyx_t_8, __pyx_kp_s_DejaVuSans_ttf); __pyx_t_2 = 0; __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_7, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 43; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_v_default = __pyx_t_1; __pyx_t_1 = 0; /* "pygame_sdl2/font.pyx":45 * default = os.path.join(os.path.dirname(__file__), "DejaVuSans.ttf") * * if os.path.exists(default): # <<<<<<<<<<<<<< * return default * */ __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_os, __pyx_n_s_path); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 45; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_exists); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 45; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_3 = NULL; if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_7))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_7); if (likely(__pyx_t_3)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_7); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_7, function); } } if (!__pyx_t_3) { __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_7, __pyx_v_default); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 45; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); } else { __pyx_t_2 = PyTuple_New(1+1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 45; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_3); __pyx_t_3 = NULL; __Pyx_INCREF(__pyx_v_default); __Pyx_GIVEREF(__pyx_v_default); PyTuple_SET_ITEM(__pyx_t_2, 0+1, __pyx_v_default); __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_7, __pyx_t_2, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 45; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __pyx_t_9 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_9 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 45; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (__pyx_t_9) { /* "pygame_sdl2/font.pyx":46 * * if os.path.exists(default): * return default # <<<<<<<<<<<<<< * * return match_font("sans") */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(__pyx_v_default); __pyx_r = __pyx_v_default; goto __pyx_L0; /* "pygame_sdl2/font.pyx":45 * default = os.path.join(os.path.dirname(__file__), "DejaVuSans.ttf") * * if os.path.exists(default): # <<<<<<<<<<<<<< * return default * */ } /* "pygame_sdl2/font.pyx":48 * return default * * return match_font("sans") # <<<<<<<<<<<<<< * * cdef class Font: */ __Pyx_XDECREF(__pyx_r); __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_match_font); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 48; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_t_7 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_tuple_, NULL); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 48; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_r = __pyx_t_7; __pyx_t_7 = 0; goto __pyx_L0; /* "pygame_sdl2/font.pyx":40 * return TTF_WasInit() != 0 * * def get_default_font(): # <<<<<<<<<<<<<< * import os * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_5); __Pyx_XDECREF(__pyx_t_6); __Pyx_XDECREF(__pyx_t_7); __Pyx_AddTraceback("pygame_sdl2.font.get_default_font", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF(__pyx_v_os); __Pyx_XDECREF(__pyx_v_default); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/font.pyx":54 * cdef int style * * def __cinit__(self): # <<<<<<<<<<<<<< * self.font = NULL * self.style = TTF_STYLE_NORMAL */ /* Python wrapper */ static int __pyx_pw_11pygame_sdl2_4font_4Font_1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static int __pyx_pw_11pygame_sdl2_4font_4Font_1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__cinit__ (wrapper)", 0); if (unlikely(PyTuple_GET_SIZE(__pyx_args) > 0)) { __Pyx_RaiseArgtupleInvalid("__cinit__", 1, 0, 0, PyTuple_GET_SIZE(__pyx_args)); return -1;} if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "__cinit__", 0))) return -1; __pyx_r = __pyx_pf_11pygame_sdl2_4font_4Font___cinit__(((struct __pyx_obj_11pygame_sdl2_4font_Font *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static int __pyx_pf_11pygame_sdl2_4font_4Font___cinit__(struct __pyx_obj_11pygame_sdl2_4font_Font *__pyx_v_self) { int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__cinit__", 0); /* "pygame_sdl2/font.pyx":55 * * def __cinit__(self): * self.font = NULL # <<<<<<<<<<<<<< * self.style = TTF_STYLE_NORMAL * */ __pyx_v_self->font = NULL; /* "pygame_sdl2/font.pyx":56 * def __cinit__(self): * self.font = NULL * self.style = TTF_STYLE_NORMAL # <<<<<<<<<<<<<< * * def __dealloc__(self): */ __pyx_v_self->style = TTF_STYLE_NORMAL; /* "pygame_sdl2/font.pyx":54 * cdef int style * * def __cinit__(self): # <<<<<<<<<<<<<< * self.font = NULL * self.style = TTF_STYLE_NORMAL */ /* function exit code */ __pyx_r = 0; __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/font.pyx":58 * self.style = TTF_STYLE_NORMAL * * def __dealloc__(self): # <<<<<<<<<<<<<< * if self.font: * TTF_CloseFont(self.font) */ /* Python wrapper */ static void __pyx_pw_11pygame_sdl2_4font_4Font_3__dealloc__(PyObject *__pyx_v_self); /*proto*/ static void __pyx_pw_11pygame_sdl2_4font_4Font_3__dealloc__(PyObject *__pyx_v_self) { __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__dealloc__ (wrapper)", 0); __pyx_pf_11pygame_sdl2_4font_4Font_2__dealloc__(((struct __pyx_obj_11pygame_sdl2_4font_Font *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); } static void __pyx_pf_11pygame_sdl2_4font_4Font_2__dealloc__(struct __pyx_obj_11pygame_sdl2_4font_Font *__pyx_v_self) { __Pyx_RefNannyDeclarations int __pyx_t_1; __Pyx_RefNannySetupContext("__dealloc__", 0); /* "pygame_sdl2/font.pyx":59 * * def __dealloc__(self): * if self.font: # <<<<<<<<<<<<<< * TTF_CloseFont(self.font) * */ __pyx_t_1 = (__pyx_v_self->font != 0); if (__pyx_t_1) { /* "pygame_sdl2/font.pyx":60 * def __dealloc__(self): * if self.font: * TTF_CloseFont(self.font) # <<<<<<<<<<<<<< * * def __init__(self, fi, size): */ TTF_CloseFont(__pyx_v_self->font); /* "pygame_sdl2/font.pyx":59 * * def __dealloc__(self): * if self.font: # <<<<<<<<<<<<<< * TTF_CloseFont(self.font) * */ } /* "pygame_sdl2/font.pyx":58 * self.style = TTF_STYLE_NORMAL * * def __dealloc__(self): # <<<<<<<<<<<<<< * if self.font: * TTF_CloseFont(self.font) */ /* function exit code */ __Pyx_RefNannyFinishContext(); } /* "pygame_sdl2/font.pyx":62 * TTF_CloseFont(self.font) * * def __init__(self, fi, size): # <<<<<<<<<<<<<< * if fi is None: * fi = get_default_font() */ /* Python wrapper */ static int __pyx_pw_11pygame_sdl2_4font_4Font_5__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static int __pyx_pw_11pygame_sdl2_4font_4Font_5__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_fi = 0; PyObject *__pyx_v_size = 0; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__init__ (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_fi,&__pyx_n_s_size,0}; PyObject* values[2] = {0,0}; if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_fi)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; case 1: if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_size)) != 0)) kw_args--; else { __Pyx_RaiseArgtupleInvalid("__init__", 1, 2, 2, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 62; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__init__") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 62; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } } else if (PyTuple_GET_SIZE(__pyx_args) != 2) { goto __pyx_L5_argtuple_error; } else { values[0] = PyTuple_GET_ITEM(__pyx_args, 0); values[1] = PyTuple_GET_ITEM(__pyx_args, 1); } __pyx_v_fi = values[0]; __pyx_v_size = values[1]; } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("__init__", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 62; __pyx_clineno = __LINE__; goto __pyx_L3_error;} __pyx_L3_error:; __Pyx_AddTraceback("pygame_sdl2.font.Font.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return -1; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_11pygame_sdl2_4font_4Font_4__init__(((struct __pyx_obj_11pygame_sdl2_4font_Font *)__pyx_v_self), __pyx_v_fi, __pyx_v_size); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static int __pyx_pf_11pygame_sdl2_4font_4Font_4__init__(struct __pyx_obj_11pygame_sdl2_4font_Font *__pyx_v_self, PyObject *__pyx_v_fi, PyObject *__pyx_v_size) { int __pyx_r; __Pyx_RefNannyDeclarations int __pyx_t_1; int __pyx_t_2; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; PyObject *__pyx_t_5 = NULL; SDL_RWops *__pyx_t_6; int __pyx_t_7; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__init__", 0); __Pyx_INCREF(__pyx_v_fi); /* "pygame_sdl2/font.pyx":63 * * def __init__(self, fi, size): * if fi is None: # <<<<<<<<<<<<<< * fi = get_default_font() * self.font = TTF_OpenFontRW(to_rwops(fi), 1, size) */ __pyx_t_1 = (__pyx_v_fi == Py_None); __pyx_t_2 = (__pyx_t_1 != 0); if (__pyx_t_2) { /* "pygame_sdl2/font.pyx":64 * def __init__(self, fi, size): * if fi is None: * fi = get_default_font() # <<<<<<<<<<<<<< * self.font = TTF_OpenFontRW(to_rwops(fi), 1, size) * if self.font == NULL: */ __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_get_default_font); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 64; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); __pyx_t_5 = NULL; if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_4))) { __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4); if (likely(__pyx_t_5)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4); __Pyx_INCREF(__pyx_t_5); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_4, function); } } if (__pyx_t_5) { __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_5); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 64; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; } else { __pyx_t_3 = __Pyx_PyObject_CallNoArg(__pyx_t_4); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 64; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF_SET(__pyx_v_fi, __pyx_t_3); __pyx_t_3 = 0; /* "pygame_sdl2/font.pyx":63 * * def __init__(self, fi, size): * if fi is None: # <<<<<<<<<<<<<< * fi = get_default_font() * self.font = TTF_OpenFontRW(to_rwops(fi), 1, size) */ } /* "pygame_sdl2/font.pyx":65 * if fi is None: * fi = get_default_font() * self.font = TTF_OpenFontRW(to_rwops(fi), 1, size) # <<<<<<<<<<<<<< * if self.font == NULL: * raise error() */ __pyx_t_6 = __pyx_f_11pygame_sdl2_8rwobject_to_rwops(__pyx_v_fi, NULL); if (unlikely(__pyx_t_6 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 65; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_t_7 = __Pyx_PyInt_As_int(__pyx_v_size); if (unlikely((__pyx_t_7 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 65; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_v_self->font = TTF_OpenFontRW(__pyx_t_6, 1, __pyx_t_7); /* "pygame_sdl2/font.pyx":66 * fi = get_default_font() * self.font = TTF_OpenFontRW(to_rwops(fi), 1, size) * if self.font == NULL: # <<<<<<<<<<<<<< * raise error() * */ __pyx_t_2 = ((__pyx_v_self->font == NULL) != 0); if (__pyx_t_2) { /* "pygame_sdl2/font.pyx":67 * self.font = TTF_OpenFontRW(to_rwops(fi), 1, size) * if self.font == NULL: * raise error() # <<<<<<<<<<<<<< * * def render(self, text, antialias, color, background=None): */ __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_error); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 67; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); __pyx_t_5 = NULL; if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_4))) { __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4); if (likely(__pyx_t_5)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4); __Pyx_INCREF(__pyx_t_5); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_4, function); } } if (__pyx_t_5) { __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_5); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 67; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; } else { __pyx_t_3 = __Pyx_PyObject_CallNoArg(__pyx_t_4); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 67; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_Raise(__pyx_t_3, 0, 0, 0); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; {__pyx_filename = __pyx_f[0]; __pyx_lineno = 67; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "pygame_sdl2/font.pyx":66 * fi = get_default_font() * self.font = TTF_OpenFontRW(to_rwops(fi), 1, size) * if self.font == NULL: # <<<<<<<<<<<<<< * raise error() * */ } /* "pygame_sdl2/font.pyx":62 * TTF_CloseFont(self.font) * * def __init__(self, fi, size): # <<<<<<<<<<<<<< * if fi is None: * fi = get_default_font() */ /* function exit code */ __pyx_r = 0; goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_5); __Pyx_AddTraceback("pygame_sdl2.font.Font.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = -1; __pyx_L0:; __Pyx_XDECREF(__pyx_v_fi); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/font.pyx":69 * raise error() * * def render(self, text, antialias, color, background=None): # <<<<<<<<<<<<<< * cdef SDL_Surface *surf * cdef SDL_Color fg */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_4font_4Font_7render(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static PyObject *__pyx_pw_11pygame_sdl2_4font_4Font_7render(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_text = 0; PyObject *__pyx_v_antialias = 0; PyObject *__pyx_v_color = 0; PyObject *__pyx_v_background = 0; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("render (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_text,&__pyx_n_s_antialias,&__pyx_n_s_color,&__pyx_n_s_background,0}; PyObject* values[4] = {0,0,0,0}; values[3] = ((PyObject *)Py_None); if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_text)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; case 1: if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_antialias)) != 0)) kw_args--; else { __Pyx_RaiseArgtupleInvalid("render", 0, 3, 4, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 69; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } case 2: if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_color)) != 0)) kw_args--; else { __Pyx_RaiseArgtupleInvalid("render", 0, 3, 4, 2); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 69; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } case 3: if (kw_args > 0) { PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_background); if (value) { values[3] = value; kw_args--; } } } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "render") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 69; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } } else { switch (PyTuple_GET_SIZE(__pyx_args)) { case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); values[1] = PyTuple_GET_ITEM(__pyx_args, 1); values[0] = PyTuple_GET_ITEM(__pyx_args, 0); break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_text = values[0]; __pyx_v_antialias = values[1]; __pyx_v_color = values[2]; __pyx_v_background = values[3]; } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("render", 0, 3, 4, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 69; __pyx_clineno = __LINE__; goto __pyx_L3_error;} __pyx_L3_error:; __Pyx_AddTraceback("pygame_sdl2.font.Font.render", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_11pygame_sdl2_4font_4Font_6render(((struct __pyx_obj_11pygame_sdl2_4font_Font *)__pyx_v_self), __pyx_v_text, __pyx_v_antialias, __pyx_v_color, __pyx_v_background); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_4font_4Font_6render(struct __pyx_obj_11pygame_sdl2_4font_Font *__pyx_v_self, PyObject *__pyx_v_text, PyObject *__pyx_v_antialias, PyObject *__pyx_v_color, PyObject *__pyx_v_background) { SDL_Surface *__pyx_v_surf; SDL_Color __pyx_v_fg; CYTHON_UNUSED PyObject *__pyx_v_w = NULL; PyObject *__pyx_v_h = NULL; struct __pyx_obj_11pygame_sdl2_7surface_Surface *__pyx_v_rv = 0; PyObject *__pyx_v_bgsurf = NULL; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; int __pyx_t_2; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; PyObject *__pyx_t_5 = NULL; PyObject *__pyx_t_6 = NULL; PyObject *(*__pyx_t_7)(PyObject *); char const *__pyx_t_8; char const *__pyx_t_9; Py_ssize_t __pyx_t_10; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("render", 0); /* "pygame_sdl2/font.pyx":73 * cdef SDL_Color fg * * if not text: # <<<<<<<<<<<<<< * w, h = self.size(" ") * return Surface((0, h)) */ __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_text); if (unlikely(__pyx_t_1 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 73; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_t_2 = ((!__pyx_t_1) != 0); if (__pyx_t_2) { /* "pygame_sdl2/font.pyx":74 * * if not text: * w, h = self.size(" ") # <<<<<<<<<<<<<< * return Surface((0, h)) * */ __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_size); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 74; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_tuple__3, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 74; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; if ((likely(PyTuple_CheckExact(__pyx_t_4))) || (PyList_CheckExact(__pyx_t_4))) { PyObject* sequence = __pyx_t_4; #if CYTHON_COMPILING_IN_CPYTHON Py_ssize_t size = Py_SIZE(sequence); #else Py_ssize_t size = PySequence_Size(sequence); #endif if (unlikely(size != 2)) { if (size > 2) __Pyx_RaiseTooManyValuesError(2); else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 74; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } #if CYTHON_COMPILING_IN_CPYTHON if (likely(PyTuple_CheckExact(sequence))) { __pyx_t_3 = PyTuple_GET_ITEM(sequence, 0); __pyx_t_5 = PyTuple_GET_ITEM(sequence, 1); } else { __pyx_t_3 = PyList_GET_ITEM(sequence, 0); __pyx_t_5 = PyList_GET_ITEM(sequence, 1); } __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(__pyx_t_5); #else __pyx_t_3 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 74; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __pyx_t_5 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 74; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); #endif __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; } else { Py_ssize_t index = -1; __pyx_t_6 = PyObject_GetIter(__pyx_t_4); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 74; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_t_7 = Py_TYPE(__pyx_t_6)->tp_iternext; index = 0; __pyx_t_3 = __pyx_t_7(__pyx_t_6); if (unlikely(!__pyx_t_3)) goto __pyx_L4_unpacking_failed; __Pyx_GOTREF(__pyx_t_3); index = 1; __pyx_t_5 = __pyx_t_7(__pyx_t_6); if (unlikely(!__pyx_t_5)) goto __pyx_L4_unpacking_failed; __Pyx_GOTREF(__pyx_t_5); if (__Pyx_IternextUnpackEndCheck(__pyx_t_7(__pyx_t_6), 2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 74; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_t_7 = NULL; __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; goto __pyx_L5_unpacking_done; __pyx_L4_unpacking_failed:; __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __pyx_t_7 = NULL; if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 74; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_L5_unpacking_done:; } __pyx_v_w = __pyx_t_3; __pyx_t_3 = 0; __pyx_v_h = __pyx_t_5; __pyx_t_5 = 0; /* "pygame_sdl2/font.pyx":75 * if not text: * w, h = self.size(" ") * return Surface((0, h)) # <<<<<<<<<<<<<< * * to_sdl_color(color, &fg) */ __Pyx_XDECREF(__pyx_r); __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 75; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); __Pyx_INCREF(__pyx_int_0); __Pyx_GIVEREF(__pyx_int_0); PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_int_0); __Pyx_INCREF(__pyx_v_h); __Pyx_GIVEREF(__pyx_v_h); PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_v_h); __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 75; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_4); __pyx_t_4 = 0; __pyx_t_4 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_11pygame_sdl2_7surface_Surface), __pyx_t_5, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 75; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __pyx_r = __pyx_t_4; __pyx_t_4 = 0; goto __pyx_L0; /* "pygame_sdl2/font.pyx":73 * cdef SDL_Color fg * * if not text: # <<<<<<<<<<<<<< * w, h = self.size(" ") * return Surface((0, h)) */ } /* "pygame_sdl2/font.pyx":77 * return Surface((0, h)) * * to_sdl_color(color, &fg) # <<<<<<<<<<<<<< * * TTF_SetFontStyle(self.font, self.style) */ __pyx_t_4 = __pyx_f_11pygame_sdl2_5color_to_sdl_color(__pyx_v_color, (&__pyx_v_fg)); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 77; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; /* "pygame_sdl2/font.pyx":79 * to_sdl_color(color, &fg) * * TTF_SetFontStyle(self.font, self.style) # <<<<<<<<<<<<<< * if antialias: * surf = TTF_RenderUTF8_Blended(self.font, text.encode('utf-8'), fg) */ TTF_SetFontStyle(__pyx_v_self->font, __pyx_v_self->style); /* "pygame_sdl2/font.pyx":80 * * TTF_SetFontStyle(self.font, self.style) * if antialias: # <<<<<<<<<<<<<< * surf = TTF_RenderUTF8_Blended(self.font, text.encode('utf-8'), fg) * else: */ __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_v_antialias); if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 80; __pyx_clineno = __LINE__; goto __pyx_L1_error;} if (__pyx_t_2) { /* "pygame_sdl2/font.pyx":81 * TTF_SetFontStyle(self.font, self.style) * if antialias: * surf = TTF_RenderUTF8_Blended(self.font, text.encode('utf-8'), fg) # <<<<<<<<<<<<<< * else: * surf = TTF_RenderUTF8_Solid(self.font, text.encode('utf-8'), fg) */ __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_text, __pyx_n_s_encode); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 81; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_tuple__4, NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 81; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_t_8 = __Pyx_PyObject_AsString(__pyx_t_5); if (unlikely((!__pyx_t_8) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 81; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_v_surf = TTF_RenderUTF8_Blended(__pyx_v_self->font, __pyx_t_8, __pyx_v_fg); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; /* "pygame_sdl2/font.pyx":80 * * TTF_SetFontStyle(self.font, self.style) * if antialias: # <<<<<<<<<<<<<< * surf = TTF_RenderUTF8_Blended(self.font, text.encode('utf-8'), fg) * else: */ goto __pyx_L6; } /* "pygame_sdl2/font.pyx":83 * surf = TTF_RenderUTF8_Blended(self.font, text.encode('utf-8'), fg) * else: * surf = TTF_RenderUTF8_Solid(self.font, text.encode('utf-8'), fg) # <<<<<<<<<<<<<< * * if surf == NULL: */ /*else*/ { __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_text, __pyx_n_s_encode); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 83; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_tuple__5, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 83; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __pyx_t_9 = __Pyx_PyObject_AsString(__pyx_t_4); if (unlikely((!__pyx_t_9) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 83; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_v_surf = TTF_RenderUTF8_Solid(__pyx_v_self->font, __pyx_t_9, __pyx_v_fg); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; } __pyx_L6:; /* "pygame_sdl2/font.pyx":85 * surf = TTF_RenderUTF8_Solid(self.font, text.encode('utf-8'), fg) * * if surf == NULL: # <<<<<<<<<<<<<< * raise error() * */ __pyx_t_2 = ((__pyx_v_surf == NULL) != 0); if (__pyx_t_2) { /* "pygame_sdl2/font.pyx":86 * * if surf == NULL: * raise error() # <<<<<<<<<<<<<< * * cdef Surface rv = Surface(()) */ __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_error); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 86; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); __pyx_t_3 = NULL; if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_5))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_5); if (likely(__pyx_t_3)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_5, function); } } if (__pyx_t_3) { __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_t_3); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 86; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } else { __pyx_t_4 = __Pyx_PyObject_CallNoArg(__pyx_t_5); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 86; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_Raise(__pyx_t_4, 0, 0, 0); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; {__pyx_filename = __pyx_f[0]; __pyx_lineno = 86; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "pygame_sdl2/font.pyx":85 * surf = TTF_RenderUTF8_Solid(self.font, text.encode('utf-8'), fg) * * if surf == NULL: # <<<<<<<<<<<<<< * raise error() * */ } /* "pygame_sdl2/font.pyx":88 * raise error() * * cdef Surface rv = Surface(()) # <<<<<<<<<<<<<< * rv.take_surface(surf) * */ __pyx_t_4 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_11pygame_sdl2_7surface_Surface), __pyx_tuple__6, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 88; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); __pyx_v_rv = ((struct __pyx_obj_11pygame_sdl2_7surface_Surface *)__pyx_t_4); __pyx_t_4 = 0; /* "pygame_sdl2/font.pyx":89 * * cdef Surface rv = Surface(()) * rv.take_surface(surf) # <<<<<<<<<<<<<< * * if rv.surface.format.BitsPerPixel != 32: */ ((struct __pyx_vtabstruct_11pygame_sdl2_7surface_Surface *)__pyx_v_rv->__pyx_vtab)->take_surface(__pyx_v_rv, __pyx_v_surf); /* "pygame_sdl2/font.pyx":91 * rv.take_surface(surf) * * if rv.surface.format.BitsPerPixel != 32: # <<<<<<<<<<<<<< * rv = rv.convert() * */ __pyx_t_2 = ((__pyx_v_rv->surface->format->BitsPerPixel != 32) != 0); if (__pyx_t_2) { /* "pygame_sdl2/font.pyx":92 * * if rv.surface.format.BitsPerPixel != 32: * rv = rv.convert() # <<<<<<<<<<<<<< * * if background is not None: */ __pyx_t_5 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_rv), __pyx_n_s_convert); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 92; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); __pyx_t_3 = NULL; if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_5))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_5); if (likely(__pyx_t_3)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_5, function); } } if (__pyx_t_3) { __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_t_3); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 92; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } else { __pyx_t_4 = __Pyx_PyObject_CallNoArg(__pyx_t_5); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 92; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; if (!(likely(((__pyx_t_4) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_4, __pyx_ptype_11pygame_sdl2_7surface_Surface))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 92; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF_SET(__pyx_v_rv, ((struct __pyx_obj_11pygame_sdl2_7surface_Surface *)__pyx_t_4)); __pyx_t_4 = 0; /* "pygame_sdl2/font.pyx":91 * rv.take_surface(surf) * * if rv.surface.format.BitsPerPixel != 32: # <<<<<<<<<<<<<< * rv = rv.convert() * */ } /* "pygame_sdl2/font.pyx":94 * rv = rv.convert() * * if background is not None: # <<<<<<<<<<<<<< * bgsurf = rv.copy() * bgsurf.fill(background) */ __pyx_t_2 = (__pyx_v_background != Py_None); __pyx_t_1 = (__pyx_t_2 != 0); if (__pyx_t_1) { /* "pygame_sdl2/font.pyx":95 * * if background is not None: * bgsurf = rv.copy() # <<<<<<<<<<<<<< * bgsurf.fill(background) * bgsurf.blit(rv, (0,0)) */ __pyx_t_5 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_rv), __pyx_n_s_copy); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 95; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); __pyx_t_3 = NULL; if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_5))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_5); if (likely(__pyx_t_3)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_5, function); } } if (__pyx_t_3) { __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_t_3); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 95; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } else { __pyx_t_4 = __Pyx_PyObject_CallNoArg(__pyx_t_5); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 95; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __pyx_v_bgsurf = __pyx_t_4; __pyx_t_4 = 0; /* "pygame_sdl2/font.pyx":96 * if background is not None: * bgsurf = rv.copy() * bgsurf.fill(background) # <<<<<<<<<<<<<< * bgsurf.blit(rv, (0,0)) * return bgsurf */ __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_bgsurf, __pyx_n_s_fill); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 96; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); __pyx_t_3 = NULL; if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_5))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_5); if (likely(__pyx_t_3)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_5, function); } } if (!__pyx_t_3) { __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_v_background); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 96; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); } else { __pyx_t_6 = PyTuple_New(1+1); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 96; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_6); __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_3); __pyx_t_3 = NULL; __Pyx_INCREF(__pyx_v_background); __Pyx_GIVEREF(__pyx_v_background); PyTuple_SET_ITEM(__pyx_t_6, 0+1, __pyx_v_background); __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_6, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 96; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; } __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; /* "pygame_sdl2/font.pyx":97 * bgsurf = rv.copy() * bgsurf.fill(background) * bgsurf.blit(rv, (0,0)) # <<<<<<<<<<<<<< * return bgsurf * return rv */ __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_bgsurf, __pyx_n_s_blit); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 97; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); __pyx_t_6 = NULL; __pyx_t_10 = 0; if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_5))) { __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_5); if (likely(__pyx_t_6)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5); __Pyx_INCREF(__pyx_t_6); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_5, function); __pyx_t_10 = 1; } } __pyx_t_3 = PyTuple_New(2+__pyx_t_10); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 97; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); if (__pyx_t_6) { __Pyx_GIVEREF(__pyx_t_6); PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_6); __pyx_t_6 = NULL; } __Pyx_INCREF(((PyObject *)__pyx_v_rv)); __Pyx_GIVEREF(((PyObject *)__pyx_v_rv)); PyTuple_SET_ITEM(__pyx_t_3, 0+__pyx_t_10, ((PyObject *)__pyx_v_rv)); __Pyx_INCREF(__pyx_tuple__7); __Pyx_GIVEREF(__pyx_tuple__7); PyTuple_SET_ITEM(__pyx_t_3, 1+__pyx_t_10, __pyx_tuple__7); __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_3, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 97; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; /* "pygame_sdl2/font.pyx":98 * bgsurf.fill(background) * bgsurf.blit(rv, (0,0)) * return bgsurf # <<<<<<<<<<<<<< * return rv * */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(__pyx_v_bgsurf); __pyx_r = __pyx_v_bgsurf; goto __pyx_L0; /* "pygame_sdl2/font.pyx":94 * rv = rv.convert() * * if background is not None: # <<<<<<<<<<<<<< * bgsurf = rv.copy() * bgsurf.fill(background) */ } /* "pygame_sdl2/font.pyx":99 * bgsurf.blit(rv, (0,0)) * return bgsurf * return rv # <<<<<<<<<<<<<< * * def size(self, text): */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(((PyObject *)__pyx_v_rv)); __pyx_r = ((PyObject *)__pyx_v_rv); goto __pyx_L0; /* "pygame_sdl2/font.pyx":69 * raise error() * * def render(self, text, antialias, color, background=None): # <<<<<<<<<<<<<< * cdef SDL_Surface *surf * cdef SDL_Color fg */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_5); __Pyx_XDECREF(__pyx_t_6); __Pyx_AddTraceback("pygame_sdl2.font.Font.render", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF(__pyx_v_w); __Pyx_XDECREF(__pyx_v_h); __Pyx_XDECREF((PyObject *)__pyx_v_rv); __Pyx_XDECREF(__pyx_v_bgsurf); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/font.pyx":101 * return rv * * def size(self, text): # <<<<<<<<<<<<<< * cdef int w, h * if TTF_SizeUTF8(self.font, text.encode('utf-8'), &w, &h) != 0: */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_4font_4Font_9size(PyObject *__pyx_v_self, PyObject *__pyx_v_text); /*proto*/ static PyObject *__pyx_pw_11pygame_sdl2_4font_4Font_9size(PyObject *__pyx_v_self, PyObject *__pyx_v_text) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("size (wrapper)", 0); __pyx_r = __pyx_pf_11pygame_sdl2_4font_4Font_8size(((struct __pyx_obj_11pygame_sdl2_4font_Font *)__pyx_v_self), ((PyObject *)__pyx_v_text)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_4font_4Font_8size(struct __pyx_obj_11pygame_sdl2_4font_Font *__pyx_v_self, PyObject *__pyx_v_text) { int __pyx_v_w; int __pyx_v_h; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; char const *__pyx_t_3; int __pyx_t_4; PyObject *__pyx_t_5 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("size", 0); /* "pygame_sdl2/font.pyx":103 * def size(self, text): * cdef int w, h * if TTF_SizeUTF8(self.font, text.encode('utf-8'), &w, &h) != 0: # <<<<<<<<<<<<<< * raise error() * return w, h */ __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_text, __pyx_n_s_encode); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 103; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_tuple__8, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 103; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_3 = __Pyx_PyObject_AsString(__pyx_t_2); if (unlikely((!__pyx_t_3) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 103; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_t_4 = ((TTF_SizeUTF8(__pyx_v_self->font, __pyx_t_3, (&__pyx_v_w), (&__pyx_v_h)) != 0) != 0); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; if (__pyx_t_4) { /* "pygame_sdl2/font.pyx":104 * cdef int w, h * if TTF_SizeUTF8(self.font, text.encode('utf-8'), &w, &h) != 0: * raise error() # <<<<<<<<<<<<<< * return w, h * */ __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_error); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 104; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_t_5 = NULL; if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_1))) { __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_1); if (likely(__pyx_t_5)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1); __Pyx_INCREF(__pyx_t_5); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_1, function); } } if (__pyx_t_5) { __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_1, __pyx_t_5); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 104; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; } else { __pyx_t_2 = __Pyx_PyObject_CallNoArg(__pyx_t_1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 104; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_Raise(__pyx_t_2, 0, 0, 0); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; {__pyx_filename = __pyx_f[0]; __pyx_lineno = 104; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "pygame_sdl2/font.pyx":103 * def size(self, text): * cdef int w, h * if TTF_SizeUTF8(self.font, text.encode('utf-8'), &w, &h) != 0: # <<<<<<<<<<<<<< * raise error() * return w, h */ } /* "pygame_sdl2/font.pyx":105 * if TTF_SizeUTF8(self.font, text.encode('utf-8'), &w, &h) != 0: * raise error() * return w, h # <<<<<<<<<<<<<< * * cdef set_style(self, flag, on): */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_v_w); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 105; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_h); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 105; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_t_5 = PyTuple_New(2); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 105; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); __Pyx_GIVEREF(__pyx_t_2); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_2); __Pyx_GIVEREF(__pyx_t_1); PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_t_1); __pyx_t_2 = 0; __pyx_t_1 = 0; __pyx_r = __pyx_t_5; __pyx_t_5 = 0; goto __pyx_L0; /* "pygame_sdl2/font.pyx":101 * return rv * * def size(self, text): # <<<<<<<<<<<<<< * cdef int w, h * if TTF_SizeUTF8(self.font, text.encode('utf-8'), &w, &h) != 0: */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_5); __Pyx_AddTraceback("pygame_sdl2.font.Font.size", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/font.pyx":107 * return w, h * * cdef set_style(self, flag, on): # <<<<<<<<<<<<<< * if on: * self.style |= flag */ static PyObject *__pyx_f_11pygame_sdl2_4font_4Font_set_style(struct __pyx_obj_11pygame_sdl2_4font_Font *__pyx_v_self, PyObject *__pyx_v_flag, PyObject *__pyx_v_on) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; int __pyx_t_4; PyObject *__pyx_t_5 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("set_style", 0); /* "pygame_sdl2/font.pyx":108 * * cdef set_style(self, flag, on): * if on: # <<<<<<<<<<<<<< * self.style |= flag * else: */ __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_on); if (unlikely(__pyx_t_1 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 108; __pyx_clineno = __LINE__; goto __pyx_L1_error;} if (__pyx_t_1) { /* "pygame_sdl2/font.pyx":109 * cdef set_style(self, flag, on): * if on: * self.style |= flag # <<<<<<<<<<<<<< * else: * self.style &= ~flag */ __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_v_self->style); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 109; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = PyNumber_InPlaceOr(__pyx_t_2, __pyx_v_flag); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 109; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_4 = __Pyx_PyInt_As_int(__pyx_t_3); if (unlikely((__pyx_t_4 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 109; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_v_self->style = __pyx_t_4; /* "pygame_sdl2/font.pyx":108 * * cdef set_style(self, flag, on): * if on: # <<<<<<<<<<<<<< * self.style |= flag * else: */ goto __pyx_L3; } /* "pygame_sdl2/font.pyx":111 * self.style |= flag * else: * self.style &= ~flag # <<<<<<<<<<<<<< * * def set_underline(self, on): */ /*else*/ { __pyx_t_3 = __Pyx_PyInt_From_int(__pyx_v_self->style); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 111; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __pyx_t_2 = PyNumber_Invert(__pyx_v_flag); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 111; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __pyx_t_5 = PyNumber_InPlaceAnd(__pyx_t_3, __pyx_t_2); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 111; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_4 = __Pyx_PyInt_As_int(__pyx_t_5); if (unlikely((__pyx_t_4 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 111; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __pyx_v_self->style = __pyx_t_4; } __pyx_L3:; /* "pygame_sdl2/font.pyx":107 * return w, h * * cdef set_style(self, flag, on): # <<<<<<<<<<<<<< * if on: * self.style |= flag */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_5); __Pyx_AddTraceback("pygame_sdl2.font.Font.set_style", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/font.pyx":113 * self.style &= ~flag * * def set_underline(self, on): # <<<<<<<<<<<<<< * self.set_style(TTF_STYLE_UNDERLINE, on) * */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_4font_4Font_11set_underline(PyObject *__pyx_v_self, PyObject *__pyx_v_on); /*proto*/ static PyObject *__pyx_pw_11pygame_sdl2_4font_4Font_11set_underline(PyObject *__pyx_v_self, PyObject *__pyx_v_on) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("set_underline (wrapper)", 0); __pyx_r = __pyx_pf_11pygame_sdl2_4font_4Font_10set_underline(((struct __pyx_obj_11pygame_sdl2_4font_Font *)__pyx_v_self), ((PyObject *)__pyx_v_on)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_4font_4Font_10set_underline(struct __pyx_obj_11pygame_sdl2_4font_Font *__pyx_v_self, PyObject *__pyx_v_on) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("set_underline", 0); /* "pygame_sdl2/font.pyx":114 * * def set_underline(self, on): * self.set_style(TTF_STYLE_UNDERLINE, on) # <<<<<<<<<<<<<< * * def get_underline(self): */ __pyx_t_1 = __Pyx_PyInt_From_int(TTF_STYLE_UNDERLINE); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 114; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = ((struct __pyx_vtabstruct_11pygame_sdl2_4font_Font *)__pyx_v_self->__pyx_vtab)->set_style(__pyx_v_self, __pyx_t_1, __pyx_v_on); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 114; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "pygame_sdl2/font.pyx":113 * self.style &= ~flag * * def set_underline(self, on): # <<<<<<<<<<<<<< * self.set_style(TTF_STYLE_UNDERLINE, on) * */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_AddTraceback("pygame_sdl2.font.Font.set_underline", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/font.pyx":116 * self.set_style(TTF_STYLE_UNDERLINE, on) * * def get_underline(self): # <<<<<<<<<<<<<< * return self.style & TTF_STYLE_UNDERLINE * */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_4font_4Font_13get_underline(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/ static PyObject *__pyx_pw_11pygame_sdl2_4font_4Font_13get_underline(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("get_underline (wrapper)", 0); __pyx_r = __pyx_pf_11pygame_sdl2_4font_4Font_12get_underline(((struct __pyx_obj_11pygame_sdl2_4font_Font *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_4font_4Font_12get_underline(struct __pyx_obj_11pygame_sdl2_4font_Font *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("get_underline", 0); /* "pygame_sdl2/font.pyx":117 * * def get_underline(self): * return self.style & TTF_STYLE_UNDERLINE # <<<<<<<<<<<<<< * * def set_bold(self, on): */ __Pyx_XDECREF(__pyx_r); __pyx_t_1 = __Pyx_PyInt_From_int((__pyx_v_self->style & TTF_STYLE_UNDERLINE)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 117; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "pygame_sdl2/font.pyx":116 * self.set_style(TTF_STYLE_UNDERLINE, on) * * def get_underline(self): # <<<<<<<<<<<<<< * return self.style & TTF_STYLE_UNDERLINE * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("pygame_sdl2.font.Font.get_underline", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/font.pyx":119 * return self.style & TTF_STYLE_UNDERLINE * * def set_bold(self, on): # <<<<<<<<<<<<<< * self.set_style(TTF_STYLE_BOLD, on) * */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_4font_4Font_15set_bold(PyObject *__pyx_v_self, PyObject *__pyx_v_on); /*proto*/ static PyObject *__pyx_pw_11pygame_sdl2_4font_4Font_15set_bold(PyObject *__pyx_v_self, PyObject *__pyx_v_on) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("set_bold (wrapper)", 0); __pyx_r = __pyx_pf_11pygame_sdl2_4font_4Font_14set_bold(((struct __pyx_obj_11pygame_sdl2_4font_Font *)__pyx_v_self), ((PyObject *)__pyx_v_on)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_4font_4Font_14set_bold(struct __pyx_obj_11pygame_sdl2_4font_Font *__pyx_v_self, PyObject *__pyx_v_on) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("set_bold", 0); /* "pygame_sdl2/font.pyx":120 * * def set_bold(self, on): * self.set_style(TTF_STYLE_BOLD, on) # <<<<<<<<<<<<<< * * def get_bold(self): */ __pyx_t_1 = __Pyx_PyInt_From_int(TTF_STYLE_BOLD); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 120; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = ((struct __pyx_vtabstruct_11pygame_sdl2_4font_Font *)__pyx_v_self->__pyx_vtab)->set_style(__pyx_v_self, __pyx_t_1, __pyx_v_on); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 120; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "pygame_sdl2/font.pyx":119 * return self.style & TTF_STYLE_UNDERLINE * * def set_bold(self, on): # <<<<<<<<<<<<<< * self.set_style(TTF_STYLE_BOLD, on) * */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_AddTraceback("pygame_sdl2.font.Font.set_bold", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/font.pyx":122 * self.set_style(TTF_STYLE_BOLD, on) * * def get_bold(self): # <<<<<<<<<<<<<< * return self.style & TTF_STYLE_BOLD * */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_4font_4Font_17get_bold(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/ static PyObject *__pyx_pw_11pygame_sdl2_4font_4Font_17get_bold(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("get_bold (wrapper)", 0); __pyx_r = __pyx_pf_11pygame_sdl2_4font_4Font_16get_bold(((struct __pyx_obj_11pygame_sdl2_4font_Font *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_4font_4Font_16get_bold(struct __pyx_obj_11pygame_sdl2_4font_Font *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("get_bold", 0); /* "pygame_sdl2/font.pyx":123 * * def get_bold(self): * return self.style & TTF_STYLE_BOLD # <<<<<<<<<<<<<< * * def set_italic(self, on): */ __Pyx_XDECREF(__pyx_r); __pyx_t_1 = __Pyx_PyInt_From_int((__pyx_v_self->style & TTF_STYLE_BOLD)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 123; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "pygame_sdl2/font.pyx":122 * self.set_style(TTF_STYLE_BOLD, on) * * def get_bold(self): # <<<<<<<<<<<<<< * return self.style & TTF_STYLE_BOLD * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("pygame_sdl2.font.Font.get_bold", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/font.pyx":125 * return self.style & TTF_STYLE_BOLD * * def set_italic(self, on): # <<<<<<<<<<<<<< * self.set_style(TTF_STYLE_ITALIC, on) * */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_4font_4Font_19set_italic(PyObject *__pyx_v_self, PyObject *__pyx_v_on); /*proto*/ static PyObject *__pyx_pw_11pygame_sdl2_4font_4Font_19set_italic(PyObject *__pyx_v_self, PyObject *__pyx_v_on) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("set_italic (wrapper)", 0); __pyx_r = __pyx_pf_11pygame_sdl2_4font_4Font_18set_italic(((struct __pyx_obj_11pygame_sdl2_4font_Font *)__pyx_v_self), ((PyObject *)__pyx_v_on)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_4font_4Font_18set_italic(struct __pyx_obj_11pygame_sdl2_4font_Font *__pyx_v_self, PyObject *__pyx_v_on) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("set_italic", 0); /* "pygame_sdl2/font.pyx":126 * * def set_italic(self, on): * self.set_style(TTF_STYLE_ITALIC, on) # <<<<<<<<<<<<<< * * def get_italic(self): */ __pyx_t_1 = __Pyx_PyInt_From_int(TTF_STYLE_ITALIC); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 126; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = ((struct __pyx_vtabstruct_11pygame_sdl2_4font_Font *)__pyx_v_self->__pyx_vtab)->set_style(__pyx_v_self, __pyx_t_1, __pyx_v_on); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 126; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "pygame_sdl2/font.pyx":125 * return self.style & TTF_STYLE_BOLD * * def set_italic(self, on): # <<<<<<<<<<<<<< * self.set_style(TTF_STYLE_ITALIC, on) * */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_AddTraceback("pygame_sdl2.font.Font.set_italic", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/font.pyx":128 * self.set_style(TTF_STYLE_ITALIC, on) * * def get_italic(self): # <<<<<<<<<<<<<< * return self.style & TTF_STYLE_ITALIC * */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_4font_4Font_21get_italic(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/ static PyObject *__pyx_pw_11pygame_sdl2_4font_4Font_21get_italic(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("get_italic (wrapper)", 0); __pyx_r = __pyx_pf_11pygame_sdl2_4font_4Font_20get_italic(((struct __pyx_obj_11pygame_sdl2_4font_Font *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_4font_4Font_20get_italic(struct __pyx_obj_11pygame_sdl2_4font_Font *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("get_italic", 0); /* "pygame_sdl2/font.pyx":129 * * def get_italic(self): * return self.style & TTF_STYLE_ITALIC # <<<<<<<<<<<<<< * * def get_linesize(self): */ __Pyx_XDECREF(__pyx_r); __pyx_t_1 = __Pyx_PyInt_From_int((__pyx_v_self->style & TTF_STYLE_ITALIC)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 129; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "pygame_sdl2/font.pyx":128 * self.set_style(TTF_STYLE_ITALIC, on) * * def get_italic(self): # <<<<<<<<<<<<<< * return self.style & TTF_STYLE_ITALIC * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("pygame_sdl2.font.Font.get_italic", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/font.pyx":131 * return self.style & TTF_STYLE_ITALIC * * def get_linesize(self): # <<<<<<<<<<<<<< * return TTF_FontLineSkip(self.font) * */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_4font_4Font_23get_linesize(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/ static PyObject *__pyx_pw_11pygame_sdl2_4font_4Font_23get_linesize(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("get_linesize (wrapper)", 0); __pyx_r = __pyx_pf_11pygame_sdl2_4font_4Font_22get_linesize(((struct __pyx_obj_11pygame_sdl2_4font_Font *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_4font_4Font_22get_linesize(struct __pyx_obj_11pygame_sdl2_4font_Font *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("get_linesize", 0); /* "pygame_sdl2/font.pyx":132 * * def get_linesize(self): * return TTF_FontLineSkip(self.font) # <<<<<<<<<<<<<< * * def get_height(self): */ __Pyx_XDECREF(__pyx_r); __pyx_t_1 = __Pyx_PyInt_From_int(TTF_FontLineSkip(__pyx_v_self->font)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 132; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "pygame_sdl2/font.pyx":131 * return self.style & TTF_STYLE_ITALIC * * def get_linesize(self): # <<<<<<<<<<<<<< * return TTF_FontLineSkip(self.font) * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("pygame_sdl2.font.Font.get_linesize", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/font.pyx":134 * return TTF_FontLineSkip(self.font) * * def get_height(self): # <<<<<<<<<<<<<< * return TTF_FontHeight(self.font) * */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_4font_4Font_25get_height(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/ static PyObject *__pyx_pw_11pygame_sdl2_4font_4Font_25get_height(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("get_height (wrapper)", 0); __pyx_r = __pyx_pf_11pygame_sdl2_4font_4Font_24get_height(((struct __pyx_obj_11pygame_sdl2_4font_Font *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_4font_4Font_24get_height(struct __pyx_obj_11pygame_sdl2_4font_Font *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("get_height", 0); /* "pygame_sdl2/font.pyx":135 * * def get_height(self): * return TTF_FontHeight(self.font) # <<<<<<<<<<<<<< * * def get_ascent(self): */ __Pyx_XDECREF(__pyx_r); __pyx_t_1 = __Pyx_PyInt_From_int(TTF_FontHeight(__pyx_v_self->font)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 135; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "pygame_sdl2/font.pyx":134 * return TTF_FontLineSkip(self.font) * * def get_height(self): # <<<<<<<<<<<<<< * return TTF_FontHeight(self.font) * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("pygame_sdl2.font.Font.get_height", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/font.pyx":137 * return TTF_FontHeight(self.font) * * def get_ascent(self): # <<<<<<<<<<<<<< * return TTF_FontAscent(self.font) * */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_4font_4Font_27get_ascent(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/ static PyObject *__pyx_pw_11pygame_sdl2_4font_4Font_27get_ascent(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("get_ascent (wrapper)", 0); __pyx_r = __pyx_pf_11pygame_sdl2_4font_4Font_26get_ascent(((struct __pyx_obj_11pygame_sdl2_4font_Font *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_4font_4Font_26get_ascent(struct __pyx_obj_11pygame_sdl2_4font_Font *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("get_ascent", 0); /* "pygame_sdl2/font.pyx":138 * * def get_ascent(self): * return TTF_FontAscent(self.font) # <<<<<<<<<<<<<< * * def get_descent(self): */ __Pyx_XDECREF(__pyx_r); __pyx_t_1 = __Pyx_PyInt_From_int(TTF_FontAscent(__pyx_v_self->font)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 138; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "pygame_sdl2/font.pyx":137 * return TTF_FontHeight(self.font) * * def get_ascent(self): # <<<<<<<<<<<<<< * return TTF_FontAscent(self.font) * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("pygame_sdl2.font.Font.get_ascent", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/font.pyx":140 * return TTF_FontAscent(self.font) * * def get_descent(self): # <<<<<<<<<<<<<< * return TTF_FontDescent(self.font) * */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_4font_4Font_29get_descent(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/ static PyObject *__pyx_pw_11pygame_sdl2_4font_4Font_29get_descent(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("get_descent (wrapper)", 0); __pyx_r = __pyx_pf_11pygame_sdl2_4font_4Font_28get_descent(((struct __pyx_obj_11pygame_sdl2_4font_Font *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_4font_4Font_28get_descent(struct __pyx_obj_11pygame_sdl2_4font_Font *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("get_descent", 0); /* "pygame_sdl2/font.pyx":141 * * def get_descent(self): * return TTF_FontDescent(self.font) # <<<<<<<<<<<<<< * * def metrics(self, text not None): */ __Pyx_XDECREF(__pyx_r); __pyx_t_1 = __Pyx_PyInt_From_int(TTF_FontDescent(__pyx_v_self->font)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 141; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "pygame_sdl2/font.pyx":140 * return TTF_FontAscent(self.font) * * def get_descent(self): # <<<<<<<<<<<<<< * return TTF_FontDescent(self.font) * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("pygame_sdl2.font.Font.get_descent", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/font.pyx":143 * return TTF_FontDescent(self.font) * * def metrics(self, text not None): # <<<<<<<<<<<<<< * cdef int minx, maxx, miny, maxy, advance * cdef uint16_t chnum */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_4font_4Font_31metrics(PyObject *__pyx_v_self, PyObject *__pyx_v_text); /*proto*/ static PyObject *__pyx_pw_11pygame_sdl2_4font_4Font_31metrics(PyObject *__pyx_v_self, PyObject *__pyx_v_text) { CYTHON_UNUSED int __pyx_lineno = 0; CYTHON_UNUSED const char *__pyx_filename = NULL; CYTHON_UNUSED int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("metrics (wrapper)", 0); if (unlikely(((PyObject *)__pyx_v_text) == Py_None)) { PyErr_Format(PyExc_TypeError, "Argument '%.200s' must not be None", "text"); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 143; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } __pyx_r = __pyx_pf_11pygame_sdl2_4font_4Font_30metrics(((struct __pyx_obj_11pygame_sdl2_4font_Font *)__pyx_v_self), ((PyObject *)__pyx_v_text)); /* function exit code */ goto __pyx_L0; __pyx_L1_error:; __pyx_r = NULL; __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_4font_4Font_30metrics(struct __pyx_obj_11pygame_sdl2_4font_Font *__pyx_v_self, PyObject *__pyx_v_text) { int __pyx_v_minx; int __pyx_v_maxx; int __pyx_v_miny; int __pyx_v_maxy; int __pyx_v_advance; uint16_t __pyx_v_chnum; PyObject *__pyx_v_rv = NULL; PyObject *__pyx_v_ch = NULL; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; Py_ssize_t __pyx_t_2; PyObject *(*__pyx_t_3)(PyObject *); PyObject *__pyx_t_4 = NULL; long __pyx_t_5; int __pyx_t_6; PyObject *__pyx_t_7 = NULL; PyObject *__pyx_t_8 = NULL; PyObject *__pyx_t_9 = NULL; PyObject *__pyx_t_10 = NULL; PyObject *__pyx_t_11 = NULL; int __pyx_t_12; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("metrics", 0); /* "pygame_sdl2/font.pyx":146 * cdef int minx, maxx, miny, maxy, advance * cdef uint16_t chnum * rv = [] # <<<<<<<<<<<<<< * * for ch in text: */ __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 146; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_v_rv = ((PyObject*)__pyx_t_1); __pyx_t_1 = 0; /* "pygame_sdl2/font.pyx":148 * rv = [] * * for ch in text: # <<<<<<<<<<<<<< * chnum = ord(ch) * */ if (likely(PyList_CheckExact(__pyx_v_text)) || PyTuple_CheckExact(__pyx_v_text)) { __pyx_t_1 = __pyx_v_text; __Pyx_INCREF(__pyx_t_1); __pyx_t_2 = 0; __pyx_t_3 = NULL; } else { __pyx_t_2 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_v_text); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 148; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_t_3 = Py_TYPE(__pyx_t_1)->tp_iternext; if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 148; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } for (;;) { if (likely(!__pyx_t_3)) { if (likely(PyList_CheckExact(__pyx_t_1))) { if (__pyx_t_2 >= PyList_GET_SIZE(__pyx_t_1)) break; #if CYTHON_COMPILING_IN_CPYTHON __pyx_t_4 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_2); __Pyx_INCREF(__pyx_t_4); __pyx_t_2++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 148; __pyx_clineno = __LINE__; goto __pyx_L1_error;} #else __pyx_t_4 = PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 148; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); #endif } else { if (__pyx_t_2 >= PyTuple_GET_SIZE(__pyx_t_1)) break; #if CYTHON_COMPILING_IN_CPYTHON __pyx_t_4 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_2); __Pyx_INCREF(__pyx_t_4); __pyx_t_2++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 148; __pyx_clineno = __LINE__; goto __pyx_L1_error;} #else __pyx_t_4 = PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 148; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); #endif } } else { __pyx_t_4 = __pyx_t_3(__pyx_t_1); if (unlikely(!__pyx_t_4)) { PyObject* exc_type = PyErr_Occurred(); if (exc_type) { if (likely(exc_type == PyExc_StopIteration || PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); else {__pyx_filename = __pyx_f[0]; __pyx_lineno = 148; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } break; } __Pyx_GOTREF(__pyx_t_4); } __Pyx_XDECREF_SET(__pyx_v_ch, __pyx_t_4); __pyx_t_4 = 0; /* "pygame_sdl2/font.pyx":149 * * for ch in text: * chnum = ord(ch) # <<<<<<<<<<<<<< * * if TTF_GlyphMetrics(self.font, chnum, &minx, &maxx, &miny, &maxy, &advance) == 0: */ __pyx_t_5 = __Pyx_PyObject_Ord(__pyx_v_ch); if (unlikely(__pyx_t_5 == (long)(Py_UCS4)-1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 149; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_v_chnum = __pyx_t_5; /* "pygame_sdl2/font.pyx":151 * chnum = ord(ch) * * if TTF_GlyphMetrics(self.font, chnum, &minx, &maxx, &miny, &maxy, &advance) == 0: # <<<<<<<<<<<<<< * rv.append((minx, maxx, miny, maxy, advance)) * else: */ __pyx_t_6 = ((TTF_GlyphMetrics(__pyx_v_self->font, __pyx_v_chnum, (&__pyx_v_minx), (&__pyx_v_maxx), (&__pyx_v_miny), (&__pyx_v_maxy), (&__pyx_v_advance)) == 0) != 0); if (__pyx_t_6) { /* "pygame_sdl2/font.pyx":152 * * if TTF_GlyphMetrics(self.font, chnum, &minx, &maxx, &miny, &maxy, &advance) == 0: * rv.append((minx, maxx, miny, maxy, advance)) # <<<<<<<<<<<<<< * else: * rv.append(None) */ __pyx_t_4 = __Pyx_PyInt_From_int(__pyx_v_minx); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 152; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); __pyx_t_7 = __Pyx_PyInt_From_int(__pyx_v_maxx); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 152; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_7); __pyx_t_8 = __Pyx_PyInt_From_int(__pyx_v_miny); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 152; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_8); __pyx_t_9 = __Pyx_PyInt_From_int(__pyx_v_maxy); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 152; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_9); __pyx_t_10 = __Pyx_PyInt_From_int(__pyx_v_advance); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 152; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_10); __pyx_t_11 = PyTuple_New(5); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 152; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_11); __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_11, 0, __pyx_t_4); __Pyx_GIVEREF(__pyx_t_7); PyTuple_SET_ITEM(__pyx_t_11, 1, __pyx_t_7); __Pyx_GIVEREF(__pyx_t_8); PyTuple_SET_ITEM(__pyx_t_11, 2, __pyx_t_8); __Pyx_GIVEREF(__pyx_t_9); PyTuple_SET_ITEM(__pyx_t_11, 3, __pyx_t_9); __Pyx_GIVEREF(__pyx_t_10); PyTuple_SET_ITEM(__pyx_t_11, 4, __pyx_t_10); __pyx_t_4 = 0; __pyx_t_7 = 0; __pyx_t_8 = 0; __pyx_t_9 = 0; __pyx_t_10 = 0; __pyx_t_12 = __Pyx_PyList_Append(__pyx_v_rv, __pyx_t_11); if (unlikely(__pyx_t_12 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 152; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; /* "pygame_sdl2/font.pyx":151 * chnum = ord(ch) * * if TTF_GlyphMetrics(self.font, chnum, &minx, &maxx, &miny, &maxy, &advance) == 0: # <<<<<<<<<<<<<< * rv.append((minx, maxx, miny, maxy, advance)) * else: */ goto __pyx_L5; } /* "pygame_sdl2/font.pyx":154 * rv.append((minx, maxx, miny, maxy, advance)) * else: * rv.append(None) # <<<<<<<<<<<<<< * * return rv */ /*else*/ { __pyx_t_12 = __Pyx_PyList_Append(__pyx_v_rv, Py_None); if (unlikely(__pyx_t_12 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 154; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } __pyx_L5:; /* "pygame_sdl2/font.pyx":148 * rv = [] * * for ch in text: # <<<<<<<<<<<<<< * chnum = ord(ch) * */ } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "pygame_sdl2/font.pyx":156 * rv.append(None) * * return rv # <<<<<<<<<<<<<< */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(__pyx_v_rv); __pyx_r = __pyx_v_rv; goto __pyx_L0; /* "pygame_sdl2/font.pyx":143 * return TTF_FontDescent(self.font) * * def metrics(self, text not None): # <<<<<<<<<<<<<< * cdef int minx, maxx, miny, maxy, advance * cdef uint16_t chnum */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_7); __Pyx_XDECREF(__pyx_t_8); __Pyx_XDECREF(__pyx_t_9); __Pyx_XDECREF(__pyx_t_10); __Pyx_XDECREF(__pyx_t_11); __Pyx_AddTraceback("pygame_sdl2.font.Font.metrics", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF(__pyx_v_rv); __Pyx_XDECREF(__pyx_v_ch); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } static struct __pyx_vtabstruct_11pygame_sdl2_4font_Font __pyx_vtable_11pygame_sdl2_4font_Font; static PyObject *__pyx_tp_new_11pygame_sdl2_4font_Font(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) { struct __pyx_obj_11pygame_sdl2_4font_Font *p; PyObject *o; if (likely((t->tp_flags & Py_TPFLAGS_IS_ABSTRACT) == 0)) { o = (*t->tp_alloc)(t, 0); } else { o = (PyObject *) PyBaseObject_Type.tp_new(t, __pyx_empty_tuple, 0); } if (unlikely(!o)) return 0; p = ((struct __pyx_obj_11pygame_sdl2_4font_Font *)o); p->__pyx_vtab = __pyx_vtabptr_11pygame_sdl2_4font_Font; if (unlikely(__pyx_pw_11pygame_sdl2_4font_4Font_1__cinit__(o, __pyx_empty_tuple, NULL) < 0)) { Py_DECREF(o); o = 0; } return o; } static void __pyx_tp_dealloc_11pygame_sdl2_4font_Font(PyObject *o) { #if PY_VERSION_HEX >= 0x030400a1 if (unlikely(Py_TYPE(o)->tp_finalize) && (!PyType_IS_GC(Py_TYPE(o)) || !_PyGC_FINALIZED(o))) { if (PyObject_CallFinalizerFromDealloc(o)) return; } #endif { PyObject *etype, *eval, *etb; PyErr_Fetch(&etype, &eval, &etb); ++Py_REFCNT(o); __pyx_pw_11pygame_sdl2_4font_4Font_3__dealloc__(o); --Py_REFCNT(o); PyErr_Restore(etype, eval, etb); } (*Py_TYPE(o)->tp_free)(o); } static PyMethodDef __pyx_methods_11pygame_sdl2_4font_Font[] = { {"render", (PyCFunction)__pyx_pw_11pygame_sdl2_4font_4Font_7render, METH_VARARGS|METH_KEYWORDS, 0}, {"size", (PyCFunction)__pyx_pw_11pygame_sdl2_4font_4Font_9size, METH_O, 0}, {"set_underline", (PyCFunction)__pyx_pw_11pygame_sdl2_4font_4Font_11set_underline, METH_O, 0}, {"get_underline", (PyCFunction)__pyx_pw_11pygame_sdl2_4font_4Font_13get_underline, METH_NOARGS, 0}, {"set_bold", (PyCFunction)__pyx_pw_11pygame_sdl2_4font_4Font_15set_bold, METH_O, 0}, {"get_bold", (PyCFunction)__pyx_pw_11pygame_sdl2_4font_4Font_17get_bold, METH_NOARGS, 0}, {"set_italic", (PyCFunction)__pyx_pw_11pygame_sdl2_4font_4Font_19set_italic, METH_O, 0}, {"get_italic", (PyCFunction)__pyx_pw_11pygame_sdl2_4font_4Font_21get_italic, METH_NOARGS, 0}, {"get_linesize", (PyCFunction)__pyx_pw_11pygame_sdl2_4font_4Font_23get_linesize, METH_NOARGS, 0}, {"get_height", (PyCFunction)__pyx_pw_11pygame_sdl2_4font_4Font_25get_height, METH_NOARGS, 0}, {"get_ascent", (PyCFunction)__pyx_pw_11pygame_sdl2_4font_4Font_27get_ascent, METH_NOARGS, 0}, {"get_descent", (PyCFunction)__pyx_pw_11pygame_sdl2_4font_4Font_29get_descent, METH_NOARGS, 0}, {"metrics", (PyCFunction)__pyx_pw_11pygame_sdl2_4font_4Font_31metrics, METH_O, 0}, {0, 0, 0, 0} }; static PyTypeObject __pyx_type_11pygame_sdl2_4font_Font = { PyVarObject_HEAD_INIT(0, 0) "pygame_sdl2.font.Font", /*tp_name*/ sizeof(struct __pyx_obj_11pygame_sdl2_4font_Font), /*tp_basicsize*/ 0, /*tp_itemsize*/ __pyx_tp_dealloc_11pygame_sdl2_4font_Font, /*tp_dealloc*/ 0, /*tp_print*/ 0, /*tp_getattr*/ 0, /*tp_setattr*/ #if PY_MAJOR_VERSION < 3 0, /*tp_compare*/ #endif #if PY_MAJOR_VERSION >= 3 0, /*tp_as_async*/ #endif 0, /*tp_repr*/ 0, /*tp_as_number*/ 0, /*tp_as_sequence*/ 0, /*tp_as_mapping*/ 0, /*tp_hash*/ 0, /*tp_call*/ 0, /*tp_str*/ 0, /*tp_getattro*/ 0, /*tp_setattro*/ 0, /*tp_as_buffer*/ Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE, /*tp_flags*/ 0, /*tp_doc*/ 0, /*tp_traverse*/ 0, /*tp_clear*/ 0, /*tp_richcompare*/ 0, /*tp_weaklistoffset*/ 0, /*tp_iter*/ 0, /*tp_iternext*/ __pyx_methods_11pygame_sdl2_4font_Font, /*tp_methods*/ 0, /*tp_members*/ 0, /*tp_getset*/ 0, /*tp_base*/ 0, /*tp_dict*/ 0, /*tp_descr_get*/ 0, /*tp_descr_set*/ 0, /*tp_dictoffset*/ __pyx_pw_11pygame_sdl2_4font_4Font_5__init__, /*tp_init*/ 0, /*tp_alloc*/ __pyx_tp_new_11pygame_sdl2_4font_Font, /*tp_new*/ 0, /*tp_free*/ 0, /*tp_is_gc*/ 0, /*tp_bases*/ 0, /*tp_mro*/ 0, /*tp_cache*/ 0, /*tp_subclasses*/ 0, /*tp_weaklist*/ 0, /*tp_del*/ 0, /*tp_version_tag*/ #if PY_VERSION_HEX >= 0x030400a1 0, /*tp_finalize*/ #endif }; static PyMethodDef __pyx_methods[] = { {0, 0, 0, 0} }; #if PY_MAJOR_VERSION >= 3 static struct PyModuleDef __pyx_moduledef = { #if PY_VERSION_HEX < 0x03020000 { PyObject_HEAD_INIT(NULL) NULL, 0, NULL }, #else PyModuleDef_HEAD_INIT, #endif "font", 0, /* m_doc */ -1, /* m_size */ __pyx_methods /* m_methods */, NULL, /* m_reload */ NULL, /* m_traverse */ NULL, /* m_clear */ NULL /* m_free */ }; #endif static __Pyx_StringTabEntry __pyx_string_tab[] = { {&__pyx_kp_s_DejaVuSans_ttf, __pyx_k_DejaVuSans_ttf, sizeof(__pyx_k_DejaVuSans_ttf), 0, 0, 1, 0}, {&__pyx_n_s_SysFont, __pyx_k_SysFont, sizeof(__pyx_k_SysFont), 0, 0, 1, 1}, {&__pyx_kp_s__2, __pyx_k__2, sizeof(__pyx_k__2), 0, 0, 1, 0}, {&__pyx_n_s_antialias, __pyx_k_antialias, sizeof(__pyx_k_antialias), 0, 0, 1, 1}, {&__pyx_n_s_background, __pyx_k_background, sizeof(__pyx_k_background), 0, 0, 1, 1}, {&__pyx_n_s_blit, __pyx_k_blit, sizeof(__pyx_k_blit), 0, 0, 1, 1}, {&__pyx_n_s_color, __pyx_k_color, sizeof(__pyx_k_color), 0, 0, 1, 1}, {&__pyx_n_s_convert, __pyx_k_convert, sizeof(__pyx_k_convert), 0, 0, 1, 1}, {&__pyx_n_s_copy, __pyx_k_copy, sizeof(__pyx_k_copy), 0, 0, 1, 1}, {&__pyx_n_s_default, __pyx_k_default, sizeof(__pyx_k_default), 0, 0, 1, 1}, {&__pyx_n_s_dirname, __pyx_k_dirname, sizeof(__pyx_k_dirname), 0, 0, 1, 1}, {&__pyx_n_s_encode, __pyx_k_encode, sizeof(__pyx_k_encode), 0, 0, 1, 1}, {&__pyx_n_s_error, __pyx_k_error, sizeof(__pyx_k_error), 0, 0, 1, 1}, {&__pyx_n_s_exists, __pyx_k_exists, sizeof(__pyx_k_exists), 0, 0, 1, 1}, {&__pyx_n_s_fi, __pyx_k_fi, sizeof(__pyx_k_fi), 0, 0, 1, 1}, {&__pyx_n_s_file, __pyx_k_file, sizeof(__pyx_k_file), 0, 0, 1, 1}, {&__pyx_n_s_fill, __pyx_k_fill, sizeof(__pyx_k_fill), 0, 0, 1, 1}, {&__pyx_n_s_get_default_font, __pyx_k_get_default_font, sizeof(__pyx_k_get_default_font), 0, 0, 1, 1}, {&__pyx_n_s_get_fonts, __pyx_k_get_fonts, sizeof(__pyx_k_get_fonts), 0, 0, 1, 1}, {&__pyx_n_s_get_init, __pyx_k_get_init, sizeof(__pyx_k_get_init), 0, 0, 1, 1}, {&__pyx_kp_s_home_tom_ab_pygame_sdl2_src_pyg, __pyx_k_home_tom_ab_pygame_sdl2_src_pyg, sizeof(__pyx_k_home_tom_ab_pygame_sdl2_src_pyg), 0, 0, 1, 0}, {&__pyx_n_s_import, __pyx_k_import, sizeof(__pyx_k_import), 0, 0, 1, 1}, {&__pyx_n_s_init, __pyx_k_init, sizeof(__pyx_k_init), 0, 0, 1, 1}, {&__pyx_n_s_join, __pyx_k_join, sizeof(__pyx_k_join), 0, 0, 1, 1}, {&__pyx_n_s_main, __pyx_k_main, sizeof(__pyx_k_main), 0, 0, 1, 1}, {&__pyx_n_s_match_font, __pyx_k_match_font, sizeof(__pyx_k_match_font), 0, 0, 1, 1}, {&__pyx_n_s_os, __pyx_k_os, sizeof(__pyx_k_os), 0, 0, 1, 1}, {&__pyx_n_s_path, __pyx_k_path, sizeof(__pyx_k_path), 0, 0, 1, 1}, {&__pyx_n_s_pygame_sdl2, __pyx_k_pygame_sdl2, sizeof(__pyx_k_pygame_sdl2), 0, 0, 1, 1}, {&__pyx_n_s_pygame_sdl2_error, __pyx_k_pygame_sdl2_error, sizeof(__pyx_k_pygame_sdl2_error), 0, 0, 1, 1}, {&__pyx_n_s_pygame_sdl2_font, __pyx_k_pygame_sdl2_font, sizeof(__pyx_k_pygame_sdl2_font), 0, 0, 1, 1}, {&__pyx_n_s_pygame_sdl2_sysfont, __pyx_k_pygame_sdl2_sysfont, sizeof(__pyx_k_pygame_sdl2_sysfont), 0, 0, 1, 1}, {&__pyx_n_s_pyx_vtable, __pyx_k_pyx_vtable, sizeof(__pyx_k_pyx_vtable), 0, 0, 1, 1}, {&__pyx_n_s_quit, __pyx_k_quit, sizeof(__pyx_k_quit), 0, 0, 1, 1}, {&__pyx_n_s_register_init, __pyx_k_register_init, sizeof(__pyx_k_register_init), 0, 0, 1, 1}, {&__pyx_n_s_register_quit, __pyx_k_register_quit, sizeof(__pyx_k_register_quit), 0, 0, 1, 1}, {&__pyx_n_s_sans, __pyx_k_sans, sizeof(__pyx_k_sans), 0, 0, 1, 1}, {&__pyx_n_s_size, __pyx_k_size, sizeof(__pyx_k_size), 0, 0, 1, 1}, {&__pyx_n_s_test, __pyx_k_test, sizeof(__pyx_k_test), 0, 0, 1, 1}, {&__pyx_n_s_text, __pyx_k_text, sizeof(__pyx_k_text), 0, 0, 1, 1}, {&__pyx_kp_s_utf_8, __pyx_k_utf_8, sizeof(__pyx_k_utf_8), 0, 0, 1, 0}, {0, 0, 0, 0, 0, 0, 0} }; static int __Pyx_InitCachedBuiltins(void) { return 0; } static int __Pyx_InitCachedConstants(void) { __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__Pyx_InitCachedConstants", 0); /* "pygame_sdl2/font.pyx":48 * return default * * return match_font("sans") # <<<<<<<<<<<<<< * * cdef class Font: */ __pyx_tuple_ = PyTuple_Pack(1, __pyx_n_s_sans); if (unlikely(!__pyx_tuple_)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 48; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_tuple_); __Pyx_GIVEREF(__pyx_tuple_); /* "pygame_sdl2/font.pyx":74 * * if not text: * w, h = self.size(" ") # <<<<<<<<<<<<<< * return Surface((0, h)) * */ __pyx_tuple__3 = PyTuple_Pack(1, __pyx_kp_s__2); if (unlikely(!__pyx_tuple__3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 74; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_tuple__3); __Pyx_GIVEREF(__pyx_tuple__3); /* "pygame_sdl2/font.pyx":81 * TTF_SetFontStyle(self.font, self.style) * if antialias: * surf = TTF_RenderUTF8_Blended(self.font, text.encode('utf-8'), fg) # <<<<<<<<<<<<<< * else: * surf = TTF_RenderUTF8_Solid(self.font, text.encode('utf-8'), fg) */ __pyx_tuple__4 = PyTuple_Pack(1, __pyx_kp_s_utf_8); if (unlikely(!__pyx_tuple__4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 81; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_tuple__4); __Pyx_GIVEREF(__pyx_tuple__4); /* "pygame_sdl2/font.pyx":83 * surf = TTF_RenderUTF8_Blended(self.font, text.encode('utf-8'), fg) * else: * surf = TTF_RenderUTF8_Solid(self.font, text.encode('utf-8'), fg) # <<<<<<<<<<<<<< * * if surf == NULL: */ __pyx_tuple__5 = PyTuple_Pack(1, __pyx_kp_s_utf_8); if (unlikely(!__pyx_tuple__5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 83; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_tuple__5); __Pyx_GIVEREF(__pyx_tuple__5); /* "pygame_sdl2/font.pyx":88 * raise error() * * cdef Surface rv = Surface(()) # <<<<<<<<<<<<<< * rv.take_surface(surf) * */ __pyx_tuple__6 = PyTuple_Pack(1, __pyx_empty_tuple); if (unlikely(!__pyx_tuple__6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 88; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_tuple__6); __Pyx_GIVEREF(__pyx_tuple__6); /* "pygame_sdl2/font.pyx":97 * bgsurf = rv.copy() * bgsurf.fill(background) * bgsurf.blit(rv, (0,0)) # <<<<<<<<<<<<<< * return bgsurf * return rv */ __pyx_tuple__7 = PyTuple_Pack(2, __pyx_int_0, __pyx_int_0); if (unlikely(!__pyx_tuple__7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 97; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_tuple__7); __Pyx_GIVEREF(__pyx_tuple__7); /* "pygame_sdl2/font.pyx":103 * def size(self, text): * cdef int w, h * if TTF_SizeUTF8(self.font, text.encode('utf-8'), &w, &h) != 0: # <<<<<<<<<<<<<< * raise error() * return w, h */ __pyx_tuple__8 = PyTuple_Pack(1, __pyx_kp_s_utf_8); if (unlikely(!__pyx_tuple__8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 103; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_tuple__8); __Pyx_GIVEREF(__pyx_tuple__8); /* "pygame_sdl2/font.pyx":30 * * @pygame_sdl2.register_init * def init(): # <<<<<<<<<<<<<< * TTF_Init() * */ __pyx_codeobj__9 = (PyObject*)__Pyx_PyCode_New(0, 0, 0, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_tom_ab_pygame_sdl2_src_pyg, __pyx_n_s_init, 30, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 30; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "pygame_sdl2/font.pyx":34 * * @pygame_sdl2.register_quit * def quit(): # @ReservedAssignment # <<<<<<<<<<<<<< * TTF_Quit() * */ __pyx_codeobj__10 = (PyObject*)__Pyx_PyCode_New(0, 0, 0, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_tom_ab_pygame_sdl2_src_pyg, __pyx_n_s_quit, 34, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 34; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "pygame_sdl2/font.pyx":37 * TTF_Quit() * * def get_init(): # <<<<<<<<<<<<<< * return TTF_WasInit() != 0 * */ __pyx_codeobj__11 = (PyObject*)__Pyx_PyCode_New(0, 0, 0, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_tom_ab_pygame_sdl2_src_pyg, __pyx_n_s_get_init, 37, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 37; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "pygame_sdl2/font.pyx":40 * return TTF_WasInit() != 0 * * def get_default_font(): # <<<<<<<<<<<<<< * import os * */ __pyx_tuple__12 = PyTuple_Pack(2, __pyx_n_s_os, __pyx_n_s_default); if (unlikely(!__pyx_tuple__12)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 40; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_tuple__12); __Pyx_GIVEREF(__pyx_tuple__12); __pyx_codeobj__13 = (PyObject*)__Pyx_PyCode_New(0, 0, 2, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__12, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_tom_ab_pygame_sdl2_src_pyg, __pyx_n_s_get_default_font, 40, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__13)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 40; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_RefNannyFinishContext(); return 0; __pyx_L1_error:; __Pyx_RefNannyFinishContext(); return -1; } static int __Pyx_InitGlobals(void) { if (__Pyx_InitStrings(__pyx_string_tab) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; __pyx_int_0 = PyInt_FromLong(0); if (unlikely(!__pyx_int_0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} return 0; __pyx_L1_error:; return -1; } #if PY_MAJOR_VERSION < 3 PyMODINIT_FUNC initfont(void); /*proto*/ PyMODINIT_FUNC initfont(void) #else PyMODINIT_FUNC PyInit_font(void); /*proto*/ PyMODINIT_FUNC PyInit_font(void) #endif { PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; PyObject *__pyx_t_5 = NULL; PyObject *__pyx_t_6 = NULL; PyObject *__pyx_t_7 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannyDeclarations #if CYTHON_REFNANNY __Pyx_RefNanny = __Pyx_RefNannyImportAPI("refnanny"); if (!__Pyx_RefNanny) { PyErr_Clear(); __Pyx_RefNanny = __Pyx_RefNannyImportAPI("Cython.Runtime.refnanny"); if (!__Pyx_RefNanny) Py_FatalError("failed to import 'refnanny' module"); } #endif __Pyx_RefNannySetupContext("PyMODINIT_FUNC PyInit_font(void)", 0); if (__Pyx_check_binary_version() < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_empty_tuple = PyTuple_New(0); if (unlikely(!__pyx_empty_tuple)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_empty_bytes = PyBytes_FromStringAndSize("", 0); if (unlikely(!__pyx_empty_bytes)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} #ifdef __Pyx_CyFunction_USED if (__pyx_CyFunction_init() < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} #endif #ifdef __Pyx_FusedFunction_USED if (__pyx_FusedFunction_init() < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} #endif #ifdef __Pyx_Coroutine_USED if (__pyx_Coroutine_init() < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} #endif #ifdef __Pyx_Generator_USED if (__pyx_Generator_init() < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} #endif #ifdef __Pyx_StopAsyncIteration_USED if (__pyx_StopAsyncIteration_init() < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} #endif /*--- Library function declarations ---*/ /*--- Threads initialization code ---*/ #if defined(__PYX_FORCE_INIT_THREADS) && __PYX_FORCE_INIT_THREADS #ifdef WITH_THREAD /* Python build with threading support? */ PyEval_InitThreads(); #endif #endif /*--- Module creation code ---*/ #if PY_MAJOR_VERSION < 3 __pyx_m = Py_InitModule4("font", __pyx_methods, 0, 0, PYTHON_API_VERSION); Py_XINCREF(__pyx_m); #else __pyx_m = PyModule_Create(&__pyx_moduledef); #endif if (unlikely(!__pyx_m)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_d = PyModule_GetDict(__pyx_m); if (unlikely(!__pyx_d)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} Py_INCREF(__pyx_d); __pyx_b = PyImport_AddModule(__Pyx_BUILTIN_MODULE_NAME); if (unlikely(!__pyx_b)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} #if CYTHON_COMPILING_IN_PYPY Py_INCREF(__pyx_b); #endif if (PyObject_SetAttrString(__pyx_m, "__builtins__", __pyx_b) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; /*--- Initialize various global constants etc. ---*/ if (__Pyx_InitGlobals() < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} #if PY_MAJOR_VERSION < 3 && (__PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT) if (__Pyx_init_sys_getdefaultencoding_params() < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} #endif if (__pyx_module_is_main_pygame_sdl2__font) { if (PyObject_SetAttrString(__pyx_m, "__name__", __pyx_n_s_main) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } #if PY_MAJOR_VERSION >= 3 { PyObject *modules = PyImport_GetModuleDict(); if (unlikely(!modules)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} if (!PyDict_GetItemString(modules, "pygame_sdl2.font")) { if (unlikely(PyDict_SetItemString(modules, "pygame_sdl2.font", __pyx_m) < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } } #endif /*--- Builtin init code ---*/ if (__Pyx_InitCachedBuiltins() < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /*--- Constants init code ---*/ if (__Pyx_InitCachedConstants() < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /*--- Global init code ---*/ /*--- Variable export code ---*/ /*--- Function export code ---*/ /*--- Type init code ---*/ __pyx_vtabptr_11pygame_sdl2_4font_Font = &__pyx_vtable_11pygame_sdl2_4font_Font; __pyx_vtable_11pygame_sdl2_4font_Font.set_style = (PyObject *(*)(struct __pyx_obj_11pygame_sdl2_4font_Font *, PyObject *, PyObject *))__pyx_f_11pygame_sdl2_4font_4Font_set_style; if (PyType_Ready(&__pyx_type_11pygame_sdl2_4font_Font) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 50; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_type_11pygame_sdl2_4font_Font.tp_print = 0; if (__Pyx_SetVtable(__pyx_type_11pygame_sdl2_4font_Font.tp_dict, __pyx_vtabptr_11pygame_sdl2_4font_Font) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 50; __pyx_clineno = __LINE__; goto __pyx_L1_error;} if (PyObject_SetAttrString(__pyx_m, "Font", (PyObject *)&__pyx_type_11pygame_sdl2_4font_Font) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 50; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_ptype_11pygame_sdl2_4font_Font = &__pyx_type_11pygame_sdl2_4font_Font; /*--- Type import code ---*/ __pyx_ptype_11pygame_sdl2_7surface_Surface = __Pyx_ImportType("pygame_sdl2.surface", "Surface", sizeof(struct __pyx_obj_11pygame_sdl2_7surface_Surface), 1); if (unlikely(!__pyx_ptype_11pygame_sdl2_7surface_Surface)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 23; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_vtabptr_11pygame_sdl2_7surface_Surface = (struct __pyx_vtabstruct_11pygame_sdl2_7surface_Surface*)__Pyx_GetVtable(__pyx_ptype_11pygame_sdl2_7surface_Surface->tp_dict); if (unlikely(!__pyx_vtabptr_11pygame_sdl2_7surface_Surface)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 23; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_ptype_11pygame_sdl2_5color_Color = __Pyx_ImportType("pygame_sdl2.color", "Color", sizeof(struct __pyx_obj_11pygame_sdl2_5color_Color), 1); if (unlikely(!__pyx_ptype_11pygame_sdl2_5color_Color)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 26; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_vtabptr_11pygame_sdl2_5color_Color = (struct __pyx_vtabstruct_11pygame_sdl2_5color_Color*)__Pyx_GetVtable(__pyx_ptype_11pygame_sdl2_5color_Color->tp_dict); if (unlikely(!__pyx_vtabptr_11pygame_sdl2_5color_Color)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 26; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /*--- Variable import code ---*/ /*--- Function import code ---*/ __pyx_t_1 = __Pyx_ImportModule("pygame_sdl2.color"); if (!__pyx_t_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} if (__Pyx_ImportFunction(__pyx_t_1, "to_sdl_color", (void (**)(void))&__pyx_f_11pygame_sdl2_5color_to_sdl_color, "PyObject *(PyObject *, SDL_Color *)") < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} Py_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_2 = __Pyx_ImportModule("pygame_sdl2.rwobject"); if (!__pyx_t_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} if (__Pyx_ImportFunction(__pyx_t_2, "to_rwops", (void (**)(void))&__pyx_f_11pygame_sdl2_8rwobject_to_rwops, "SDL_RWops *(PyObject *, struct __pyx_opt_args_11pygame_sdl2_8rwobject_to_rwops *__pyx_optional_args)") < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} Py_DECREF(__pyx_t_2); __pyx_t_2 = 0; /*--- Execution code ---*/ #if defined(__Pyx_Generator_USED) || defined(__Pyx_Coroutine_USED) if (__Pyx_patch_abc() < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} #endif /* "pygame_sdl2/font.pyx":25 * from pygame_sdl2.rwobject cimport to_rwops * * from pygame_sdl2.sysfont import SysFont, match_font, get_fonts # <<<<<<<<<<<<<< * from pygame_sdl2.error import error * import pygame_sdl2 */ __pyx_t_3 = PyList_New(3); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 25; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __Pyx_INCREF(__pyx_n_s_SysFont); __Pyx_GIVEREF(__pyx_n_s_SysFont); PyList_SET_ITEM(__pyx_t_3, 0, __pyx_n_s_SysFont); __Pyx_INCREF(__pyx_n_s_match_font); __Pyx_GIVEREF(__pyx_n_s_match_font); PyList_SET_ITEM(__pyx_t_3, 1, __pyx_n_s_match_font); __Pyx_INCREF(__pyx_n_s_get_fonts); __Pyx_GIVEREF(__pyx_n_s_get_fonts); PyList_SET_ITEM(__pyx_t_3, 2, __pyx_n_s_get_fonts); __pyx_t_4 = __Pyx_Import(__pyx_n_s_pygame_sdl2_sysfont, __pyx_t_3, -1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 25; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_3 = __Pyx_ImportFrom(__pyx_t_4, __pyx_n_s_SysFont); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 25; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); if (PyDict_SetItem(__pyx_d, __pyx_n_s_SysFont, __pyx_t_3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 25; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_3 = __Pyx_ImportFrom(__pyx_t_4, __pyx_n_s_match_font); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 25; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); if (PyDict_SetItem(__pyx_d, __pyx_n_s_match_font, __pyx_t_3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 25; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_3 = __Pyx_ImportFrom(__pyx_t_4, __pyx_n_s_get_fonts); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 25; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); if (PyDict_SetItem(__pyx_d, __pyx_n_s_get_fonts, __pyx_t_3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 25; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; /* "pygame_sdl2/font.pyx":26 * * from pygame_sdl2.sysfont import SysFont, match_font, get_fonts * from pygame_sdl2.error import error # <<<<<<<<<<<<<< * import pygame_sdl2 * */ __pyx_t_4 = PyList_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 26; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); __Pyx_INCREF(__pyx_n_s_error); __Pyx_GIVEREF(__pyx_n_s_error); PyList_SET_ITEM(__pyx_t_4, 0, __pyx_n_s_error); __pyx_t_3 = __Pyx_Import(__pyx_n_s_pygame_sdl2_error, __pyx_t_4, -1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 26; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_t_4 = __Pyx_ImportFrom(__pyx_t_3, __pyx_n_s_error); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 26; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); if (PyDict_SetItem(__pyx_d, __pyx_n_s_error, __pyx_t_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 26; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "pygame_sdl2/font.pyx":27 * from pygame_sdl2.sysfont import SysFont, match_font, get_fonts * from pygame_sdl2.error import error * import pygame_sdl2 # <<<<<<<<<<<<<< * * @pygame_sdl2.register_init */ __pyx_t_3 = __Pyx_Import(__pyx_n_s_pygame_sdl2, 0, -1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 27; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); if (PyDict_SetItem(__pyx_d, __pyx_n_s_pygame_sdl2, __pyx_t_3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 27; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "pygame_sdl2/font.pyx":29 * import pygame_sdl2 * * @pygame_sdl2.register_init # <<<<<<<<<<<<<< * def init(): * TTF_Init() */ __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_pygame_sdl2); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 29; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_register_init); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 29; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; /* "pygame_sdl2/font.pyx":30 * * @pygame_sdl2.register_init * def init(): # <<<<<<<<<<<<<< * TTF_Init() * */ __pyx_t_4 = PyCFunction_NewEx(&__pyx_mdef_11pygame_sdl2_4font_1init, NULL, __pyx_n_s_pygame_sdl2_font); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 30; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); __pyx_t_6 = NULL; if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_5))) { __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_5); if (likely(__pyx_t_6)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5); __Pyx_INCREF(__pyx_t_6); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_5, function); } } if (!__pyx_t_6) { __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_t_4); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 29; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_GOTREF(__pyx_t_3); } else { __pyx_t_7 = PyTuple_New(1+1); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 29; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_7); __Pyx_GIVEREF(__pyx_t_6); PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_6); __pyx_t_6 = NULL; __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_7, 0+1, __pyx_t_4); __pyx_t_4 = 0; __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_7, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 29; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; } __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; if (PyDict_SetItem(__pyx_d, __pyx_n_s_init, __pyx_t_3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 30; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "pygame_sdl2/font.pyx":33 * TTF_Init() * * @pygame_sdl2.register_quit # <<<<<<<<<<<<<< * def quit(): # @ReservedAssignment * TTF_Quit() */ __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_pygame_sdl2); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 33; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_register_quit); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 33; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; /* "pygame_sdl2/font.pyx":34 * * @pygame_sdl2.register_quit * def quit(): # @ReservedAssignment # <<<<<<<<<<<<<< * TTF_Quit() * */ __pyx_t_5 = PyCFunction_NewEx(&__pyx_mdef_11pygame_sdl2_4font_3quit, NULL, __pyx_n_s_pygame_sdl2_font); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 34; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); __pyx_t_4 = NULL; if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_7))) { __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_7); if (likely(__pyx_t_4)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_7); __Pyx_INCREF(__pyx_t_4); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_7, function); } } if (!__pyx_t_4) { __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_t_7, __pyx_t_5); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 33; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_GOTREF(__pyx_t_3); } else { __pyx_t_6 = PyTuple_New(1+1); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 33; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_6); __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_4); __pyx_t_4 = NULL; __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_6, 0+1, __pyx_t_5); __pyx_t_5 = 0; __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_7, __pyx_t_6, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 33; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; } __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; if (PyDict_SetItem(__pyx_d, __pyx_n_s_quit, __pyx_t_3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 34; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "pygame_sdl2/font.pyx":37 * TTF_Quit() * * def get_init(): # <<<<<<<<<<<<<< * return TTF_WasInit() != 0 * */ __pyx_t_3 = PyCFunction_NewEx(&__pyx_mdef_11pygame_sdl2_4font_5get_init, NULL, __pyx_n_s_pygame_sdl2_font); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 37; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); if (PyDict_SetItem(__pyx_d, __pyx_n_s_get_init, __pyx_t_3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 37; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "pygame_sdl2/font.pyx":40 * return TTF_WasInit() != 0 * * def get_default_font(): # <<<<<<<<<<<<<< * import os * */ __pyx_t_3 = PyCFunction_NewEx(&__pyx_mdef_11pygame_sdl2_4font_7get_default_font, NULL, __pyx_n_s_pygame_sdl2_font); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 40; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); if (PyDict_SetItem(__pyx_d, __pyx_n_s_get_default_font, __pyx_t_3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 40; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "pygame_sdl2/font.pyx":1 * # Copyright 2014 Patrick Dawson # <<<<<<<<<<<<<< * # * # This software is provided 'as-is', without any express or implied */ __pyx_t_3 = PyDict_New(); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); if (PyDict_SetItem(__pyx_d, __pyx_n_s_test, __pyx_t_3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /*--- Wrapped vars code ---*/ goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_5); __Pyx_XDECREF(__pyx_t_6); __Pyx_XDECREF(__pyx_t_7); if (__pyx_m) { if (__pyx_d) { __Pyx_AddTraceback("init pygame_sdl2.font", __pyx_clineno, __pyx_lineno, __pyx_filename); } Py_DECREF(__pyx_m); __pyx_m = 0; } else if (!PyErr_Occurred()) { PyErr_SetString(PyExc_ImportError, "init pygame_sdl2.font"); } __pyx_L0:; __Pyx_RefNannyFinishContext(); #if PY_MAJOR_VERSION < 3 return; #else return __pyx_m; #endif } /* --- Runtime support code --- */ #if CYTHON_REFNANNY static __Pyx_RefNannyAPIStruct *__Pyx_RefNannyImportAPI(const char *modname) { PyObject *m = NULL, *p = NULL; void *r = NULL; m = PyImport_ImportModule((char *)modname); if (!m) goto end; p = PyObject_GetAttrString(m, (char *)"RefNannyAPI"); if (!p) goto end; r = PyLong_AsVoidPtr(p); end: Py_XDECREF(p); Py_XDECREF(m); return (__Pyx_RefNannyAPIStruct *)r; } #endif static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list, int level) { PyObject *empty_list = 0; PyObject *module = 0; PyObject *global_dict = 0; PyObject *empty_dict = 0; PyObject *list; #if PY_VERSION_HEX < 0x03030000 PyObject *py_import; py_import = __Pyx_PyObject_GetAttrStr(__pyx_b, __pyx_n_s_import); if (!py_import) goto bad; #endif if (from_list) list = from_list; else { empty_list = PyList_New(0); if (!empty_list) goto bad; list = empty_list; } global_dict = PyModule_GetDict(__pyx_m); if (!global_dict) goto bad; empty_dict = PyDict_New(); if (!empty_dict) goto bad; { #if PY_MAJOR_VERSION >= 3 if (level == -1) { if (strchr(__Pyx_MODULE_NAME, '.')) { #if PY_VERSION_HEX < 0x03030000 PyObject *py_level = PyInt_FromLong(1); if (!py_level) goto bad; module = PyObject_CallFunctionObjArgs(py_import, name, global_dict, empty_dict, list, py_level, NULL); Py_DECREF(py_level); #else module = PyImport_ImportModuleLevelObject( name, global_dict, empty_dict, list, 1); #endif if (!module) { if (!PyErr_ExceptionMatches(PyExc_ImportError)) goto bad; PyErr_Clear(); } } level = 0; } #endif if (!module) { #if PY_VERSION_HEX < 0x03030000 PyObject *py_level = PyInt_FromLong(level); if (!py_level) goto bad; module = PyObject_CallFunctionObjArgs(py_import, name, global_dict, empty_dict, list, py_level, NULL); Py_DECREF(py_level); #else module = PyImport_ImportModuleLevelObject( name, global_dict, empty_dict, list, level); #endif } } bad: #if PY_VERSION_HEX < 0x03030000 Py_XDECREF(py_import); #endif Py_XDECREF(empty_list); Py_XDECREF(empty_dict); return module; } static PyObject *__Pyx_GetBuiltinName(PyObject *name) { PyObject* result = __Pyx_PyObject_GetAttrStr(__pyx_b, name); if (unlikely(!result)) { PyErr_Format(PyExc_NameError, #if PY_MAJOR_VERSION >= 3 "name '%U' is not defined", name); #else "name '%.200s' is not defined", PyString_AS_STRING(name)); #endif } return result; } static CYTHON_INLINE PyObject *__Pyx_GetModuleGlobalName(PyObject *name) { PyObject *result; #if CYTHON_COMPILING_IN_CPYTHON result = PyDict_GetItem(__pyx_d, name); if (likely(result)) { Py_INCREF(result); } else { #else result = PyObject_GetItem(__pyx_d, name); if (!result) { PyErr_Clear(); #endif result = __Pyx_GetBuiltinName(name); } return result; } #if CYTHON_COMPILING_IN_CPYTHON static CYTHON_INLINE PyObject* __Pyx_PyObject_Call(PyObject *func, PyObject *arg, PyObject *kw) { PyObject *result; ternaryfunc call = func->ob_type->tp_call; if (unlikely(!call)) return PyObject_Call(func, arg, kw); if (unlikely(Py_EnterRecursiveCall((char*)" while calling a Python object"))) return NULL; result = (*call)(func, arg, kw); Py_LeaveRecursiveCall(); if (unlikely(!result) && unlikely(!PyErr_Occurred())) { PyErr_SetString( PyExc_SystemError, "NULL result without error in PyObject_Call"); } return result; } #endif #if CYTHON_COMPILING_IN_CPYTHON static CYTHON_INLINE PyObject* __Pyx_PyObject_CallMethO(PyObject *func, PyObject *arg) { PyObject *self, *result; PyCFunction cfunc; cfunc = PyCFunction_GET_FUNCTION(func); self = PyCFunction_GET_SELF(func); if (unlikely(Py_EnterRecursiveCall((char*)" while calling a Python object"))) return NULL; result = cfunc(self, arg); Py_LeaveRecursiveCall(); if (unlikely(!result) && unlikely(!PyErr_Occurred())) { PyErr_SetString( PyExc_SystemError, "NULL result without error in PyObject_Call"); } return result; } #endif #if CYTHON_COMPILING_IN_CPYTHON static PyObject* __Pyx__PyObject_CallOneArg(PyObject *func, PyObject *arg) { PyObject *result; PyObject *args = PyTuple_New(1); if (unlikely(!args)) return NULL; Py_INCREF(arg); PyTuple_SET_ITEM(args, 0, arg); result = __Pyx_PyObject_Call(func, args, NULL); Py_DECREF(args); return result; } static CYTHON_INLINE PyObject* __Pyx_PyObject_CallOneArg(PyObject *func, PyObject *arg) { #ifdef __Pyx_CyFunction_USED if (likely(PyCFunction_Check(func) || PyObject_TypeCheck(func, __pyx_CyFunctionType))) { #else if (likely(PyCFunction_Check(func))) { #endif if (likely(PyCFunction_GET_FLAGS(func) & METH_O)) { return __Pyx_PyObject_CallMethO(func, arg); } } return __Pyx__PyObject_CallOneArg(func, arg); } #else static CYTHON_INLINE PyObject* __Pyx_PyObject_CallOneArg(PyObject *func, PyObject *arg) { PyObject *result; PyObject *args = PyTuple_Pack(1, arg); if (unlikely(!args)) return NULL; result = __Pyx_PyObject_Call(func, args, NULL); Py_DECREF(args); return result; } #endif static void __Pyx_RaiseArgtupleInvalid( const char* func_name, int exact, Py_ssize_t num_min, Py_ssize_t num_max, Py_ssize_t num_found) { Py_ssize_t num_expected; const char *more_or_less; if (num_found < num_min) { num_expected = num_min; more_or_less = "at least"; } else { num_expected = num_max; more_or_less = "at most"; } if (exact) { more_or_less = "exactly"; } PyErr_Format(PyExc_TypeError, "%.200s() takes %.8s %" CYTHON_FORMAT_SSIZE_T "d positional argument%.1s (%" CYTHON_FORMAT_SSIZE_T "d given)", func_name, more_or_less, num_expected, (num_expected == 1) ? "" : "s", num_found); } static CYTHON_INLINE int __Pyx_CheckKeywordStrings( PyObject *kwdict, const char* function_name, int kw_allowed) { PyObject* key = 0; Py_ssize_t pos = 0; #if CYTHON_COMPILING_IN_PYPY if (!kw_allowed && PyDict_Next(kwdict, &pos, &key, 0)) goto invalid_keyword; return 1; #else while (PyDict_Next(kwdict, &pos, &key, 0)) { #if PY_MAJOR_VERSION < 3 if (unlikely(!PyString_CheckExact(key)) && unlikely(!PyString_Check(key))) #endif if (unlikely(!PyUnicode_Check(key))) goto invalid_keyword_type; } if ((!kw_allowed) && unlikely(key)) goto invalid_keyword; return 1; invalid_keyword_type: PyErr_Format(PyExc_TypeError, "%.200s() keywords must be strings", function_name); return 0; #endif invalid_keyword: PyErr_Format(PyExc_TypeError, #if PY_MAJOR_VERSION < 3 "%.200s() got an unexpected keyword argument '%.200s'", function_name, PyString_AsString(key)); #else "%s() got an unexpected keyword argument '%U'", function_name, key); #endif return 0; } static void __Pyx_RaiseDoubleKeywordsError( const char* func_name, PyObject* kw_name) { PyErr_Format(PyExc_TypeError, #if PY_MAJOR_VERSION >= 3 "%s() got multiple values for keyword argument '%U'", func_name, kw_name); #else "%s() got multiple values for keyword argument '%s'", func_name, PyString_AsString(kw_name)); #endif } static int __Pyx_ParseOptionalKeywords( PyObject *kwds, PyObject **argnames[], PyObject *kwds2, PyObject *values[], Py_ssize_t num_pos_args, const char* function_name) { PyObject *key = 0, *value = 0; Py_ssize_t pos = 0; PyObject*** name; PyObject*** first_kw_arg = argnames + num_pos_args; while (PyDict_Next(kwds, &pos, &key, &value)) { name = first_kw_arg; while (*name && (**name != key)) name++; if (*name) { values[name-argnames] = value; continue; } name = first_kw_arg; #if PY_MAJOR_VERSION < 3 if (likely(PyString_CheckExact(key)) || likely(PyString_Check(key))) { while (*name) { if ((CYTHON_COMPILING_IN_PYPY || PyString_GET_SIZE(**name) == PyString_GET_SIZE(key)) && _PyString_Eq(**name, key)) { values[name-argnames] = value; break; } name++; } if (*name) continue; else { PyObject*** argname = argnames; while (argname != first_kw_arg) { if ((**argname == key) || ( (CYTHON_COMPILING_IN_PYPY || PyString_GET_SIZE(**argname) == PyString_GET_SIZE(key)) && _PyString_Eq(**argname, key))) { goto arg_passed_twice; } argname++; } } } else #endif if (likely(PyUnicode_Check(key))) { while (*name) { int cmp = (**name == key) ? 0 : #if !CYTHON_COMPILING_IN_PYPY && PY_MAJOR_VERSION >= 3 (PyUnicode_GET_SIZE(**name) != PyUnicode_GET_SIZE(key)) ? 1 : #endif PyUnicode_Compare(**name, key); if (cmp < 0 && unlikely(PyErr_Occurred())) goto bad; if (cmp == 0) { values[name-argnames] = value; break; } name++; } if (*name) continue; else { PyObject*** argname = argnames; while (argname != first_kw_arg) { int cmp = (**argname == key) ? 0 : #if !CYTHON_COMPILING_IN_PYPY && PY_MAJOR_VERSION >= 3 (PyUnicode_GET_SIZE(**argname) != PyUnicode_GET_SIZE(key)) ? 1 : #endif PyUnicode_Compare(**argname, key); if (cmp < 0 && unlikely(PyErr_Occurred())) goto bad; if (cmp == 0) goto arg_passed_twice; argname++; } } } else goto invalid_keyword_type; if (kwds2) { if (unlikely(PyDict_SetItem(kwds2, key, value))) goto bad; } else { goto invalid_keyword; } } return 0; arg_passed_twice: __Pyx_RaiseDoubleKeywordsError(function_name, key); goto bad; invalid_keyword_type: PyErr_Format(PyExc_TypeError, "%.200s() keywords must be strings", function_name); goto bad; invalid_keyword: PyErr_Format(PyExc_TypeError, #if PY_MAJOR_VERSION < 3 "%.200s() got an unexpected keyword argument '%.200s'", function_name, PyString_AsString(key)); #else "%s() got an unexpected keyword argument '%U'", function_name, key); #endif bad: return -1; } #if CYTHON_COMPILING_IN_CPYTHON static CYTHON_INLINE PyObject* __Pyx_PyObject_CallNoArg(PyObject *func) { #ifdef __Pyx_CyFunction_USED if (likely(PyCFunction_Check(func) || PyObject_TypeCheck(func, __pyx_CyFunctionType))) { #else if (likely(PyCFunction_Check(func))) { #endif if (likely(PyCFunction_GET_FLAGS(func) & METH_NOARGS)) { return __Pyx_PyObject_CallMethO(func, NULL); } } return __Pyx_PyObject_Call(func, __pyx_empty_tuple, NULL); } #endif static CYTHON_INLINE void __Pyx_ErrRestore(PyObject *type, PyObject *value, PyObject *tb) { #if CYTHON_COMPILING_IN_CPYTHON PyObject *tmp_type, *tmp_value, *tmp_tb; PyThreadState *tstate = PyThreadState_GET(); tmp_type = tstate->curexc_type; tmp_value = tstate->curexc_value; tmp_tb = tstate->curexc_traceback; tstate->curexc_type = type; tstate->curexc_value = value; tstate->curexc_traceback = tb; Py_XDECREF(tmp_type); Py_XDECREF(tmp_value); Py_XDECREF(tmp_tb); #else PyErr_Restore(type, value, tb); #endif } static CYTHON_INLINE void __Pyx_ErrFetch(PyObject **type, PyObject **value, PyObject **tb) { #if CYTHON_COMPILING_IN_CPYTHON PyThreadState *tstate = PyThreadState_GET(); *type = tstate->curexc_type; *value = tstate->curexc_value; *tb = tstate->curexc_traceback; tstate->curexc_type = 0; tstate->curexc_value = 0; tstate->curexc_traceback = 0; #else PyErr_Fetch(type, value, tb); #endif } #if PY_MAJOR_VERSION < 3 static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, CYTHON_UNUSED PyObject *cause) { Py_XINCREF(type); if (!value || value == Py_None) value = NULL; else Py_INCREF(value); if (!tb || tb == Py_None) tb = NULL; else { Py_INCREF(tb); if (!PyTraceBack_Check(tb)) { PyErr_SetString(PyExc_TypeError, "raise: arg 3 must be a traceback or None"); goto raise_error; } } if (PyType_Check(type)) { #if CYTHON_COMPILING_IN_PYPY if (!value) { Py_INCREF(Py_None); value = Py_None; } #endif PyErr_NormalizeException(&type, &value, &tb); } else { if (value) { PyErr_SetString(PyExc_TypeError, "instance exception may not have a separate value"); goto raise_error; } value = type; type = (PyObject*) Py_TYPE(type); Py_INCREF(type); if (!PyType_IsSubtype((PyTypeObject *)type, (PyTypeObject *)PyExc_BaseException)) { PyErr_SetString(PyExc_TypeError, "raise: exception class must be a subclass of BaseException"); goto raise_error; } } __Pyx_ErrRestore(type, value, tb); return; raise_error: Py_XDECREF(value); Py_XDECREF(type); Py_XDECREF(tb); return; } #else static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, PyObject *cause) { PyObject* owned_instance = NULL; if (tb == Py_None) { tb = 0; } else if (tb && !PyTraceBack_Check(tb)) { PyErr_SetString(PyExc_TypeError, "raise: arg 3 must be a traceback or None"); goto bad; } if (value == Py_None) value = 0; if (PyExceptionInstance_Check(type)) { if (value) { PyErr_SetString(PyExc_TypeError, "instance exception may not have a separate value"); goto bad; } value = type; type = (PyObject*) Py_TYPE(value); } else if (PyExceptionClass_Check(type)) { PyObject *instance_class = NULL; if (value && PyExceptionInstance_Check(value)) { instance_class = (PyObject*) Py_TYPE(value); if (instance_class != type) { int is_subclass = PyObject_IsSubclass(instance_class, type); if (!is_subclass) { instance_class = NULL; } else if (unlikely(is_subclass == -1)) { goto bad; } else { type = instance_class; } } } if (!instance_class) { PyObject *args; if (!value) args = PyTuple_New(0); else if (PyTuple_Check(value)) { Py_INCREF(value); args = value; } else args = PyTuple_Pack(1, value); if (!args) goto bad; owned_instance = PyObject_Call(type, args, NULL); Py_DECREF(args); if (!owned_instance) goto bad; value = owned_instance; if (!PyExceptionInstance_Check(value)) { PyErr_Format(PyExc_TypeError, "calling %R should have returned an instance of " "BaseException, not %R", type, Py_TYPE(value)); goto bad; } } } else { PyErr_SetString(PyExc_TypeError, "raise: exception class must be a subclass of BaseException"); goto bad; } #if PY_VERSION_HEX >= 0x03030000 if (cause) { #else if (cause && cause != Py_None) { #endif PyObject *fixed_cause; if (cause == Py_None) { fixed_cause = NULL; } else if (PyExceptionClass_Check(cause)) { fixed_cause = PyObject_CallObject(cause, NULL); if (fixed_cause == NULL) goto bad; } else if (PyExceptionInstance_Check(cause)) { fixed_cause = cause; Py_INCREF(fixed_cause); } else { PyErr_SetString(PyExc_TypeError, "exception causes must derive from " "BaseException"); goto bad; } PyException_SetCause(value, fixed_cause); } PyErr_SetObject(type, value); if (tb) { #if CYTHON_COMPILING_IN_PYPY PyObject *tmp_type, *tmp_value, *tmp_tb; PyErr_Fetch(&tmp_type, &tmp_value, &tmp_tb); Py_INCREF(tb); PyErr_Restore(tmp_type, tmp_value, tb); Py_XDECREF(tmp_tb); #else PyThreadState *tstate = PyThreadState_GET(); PyObject* tmp_tb = tstate->curexc_traceback; if (tb != tmp_tb) { Py_INCREF(tb); tstate->curexc_traceback = tb; Py_XDECREF(tmp_tb); } #endif } bad: Py_XDECREF(owned_instance); return; } #endif static CYTHON_INLINE void __Pyx_RaiseTooManyValuesError(Py_ssize_t expected) { PyErr_Format(PyExc_ValueError, "too many values to unpack (expected %" CYTHON_FORMAT_SSIZE_T "d)", expected); } static CYTHON_INLINE void __Pyx_RaiseNeedMoreValuesError(Py_ssize_t index) { PyErr_Format(PyExc_ValueError, "need more than %" CYTHON_FORMAT_SSIZE_T "d value%.1s to unpack", index, (index == 1) ? "" : "s"); } static CYTHON_INLINE int __Pyx_IterFinish(void) { #if CYTHON_COMPILING_IN_CPYTHON PyThreadState *tstate = PyThreadState_GET(); PyObject* exc_type = tstate->curexc_type; if (unlikely(exc_type)) { if (likely(exc_type == PyExc_StopIteration) || PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration)) { PyObject *exc_value, *exc_tb; exc_value = tstate->curexc_value; exc_tb = tstate->curexc_traceback; tstate->curexc_type = 0; tstate->curexc_value = 0; tstate->curexc_traceback = 0; Py_DECREF(exc_type); Py_XDECREF(exc_value); Py_XDECREF(exc_tb); return 0; } else { return -1; } } return 0; #else if (unlikely(PyErr_Occurred())) { if (likely(PyErr_ExceptionMatches(PyExc_StopIteration))) { PyErr_Clear(); return 0; } else { return -1; } } return 0; #endif } static int __Pyx_IternextUnpackEndCheck(PyObject *retval, Py_ssize_t expected) { if (unlikely(retval)) { Py_DECREF(retval); __Pyx_RaiseTooManyValuesError(expected); return -1; } else { return __Pyx_IterFinish(); } return 0; } static CYTHON_INLINE int __Pyx_TypeTest(PyObject *obj, PyTypeObject *type) { if (unlikely(!type)) { PyErr_SetString(PyExc_SystemError, "Missing type object"); return 0; } if (likely(PyObject_TypeCheck(obj, type))) return 1; PyErr_Format(PyExc_TypeError, "Cannot convert %.200s to %.200s", Py_TYPE(obj)->tp_name, type->tp_name); return 0; } static CYTHON_INLINE Py_UCS4 __Pyx_PyUnicode_AsPy_UCS4(PyObject* x) { Py_ssize_t length; #if CYTHON_PEP393_ENABLED length = PyUnicode_GET_LENGTH(x); if (likely(length == 1)) { return PyUnicode_READ_CHAR(x, 0); } #else length = PyUnicode_GET_SIZE(x); if (likely(length == 1)) { return PyUnicode_AS_UNICODE(x)[0]; } #if Py_UNICODE_SIZE == 2 else if (PyUnicode_GET_SIZE(x) == 2) { Py_UCS4 high_val = PyUnicode_AS_UNICODE(x)[0]; if (high_val >= 0xD800 && high_val <= 0xDBFF) { Py_UCS4 low_val = PyUnicode_AS_UNICODE(x)[1]; if (low_val >= 0xDC00 && low_val <= 0xDFFF) { return 0x10000 + (((high_val & ((1<<10)-1)) << 10) | (low_val & ((1<<10)-1))); } } } #endif #endif PyErr_Format(PyExc_ValueError, "only single character unicode strings can be converted to Py_UCS4, " "got length %" CYTHON_FORMAT_SSIZE_T "d", length); return (Py_UCS4)-1; } static long __Pyx__PyObject_Ord(PyObject* c) { Py_ssize_t size; if (PyBytes_Check(c)) { size = PyBytes_GET_SIZE(c); if (likely(size == 1)) { return (unsigned char) PyBytes_AS_STRING(c)[0]; } #if PY_MAJOR_VERSION < 3 } else if (PyUnicode_Check(c)) { return (long)__Pyx_PyUnicode_AsPy_UCS4(c); #endif #if (!CYTHON_COMPILING_IN_PYPY) || (defined(PyByteArray_AS_STRING) && defined(PyByteArray_GET_SIZE)) } else if (PyByteArray_Check(c)) { size = PyByteArray_GET_SIZE(c); if (likely(size == 1)) { return (unsigned char) PyByteArray_AS_STRING(c)[0]; } #endif } else { PyErr_Format(PyExc_TypeError, "ord() expected string of length 1, but %.200s found", c->ob_type->tp_name); return (long)(Py_UCS4)-1; } PyErr_Format(PyExc_TypeError, "ord() expected a character, but string of length %zd found", size); return (long)(Py_UCS4)-1; } static int __Pyx_SetVtable(PyObject *dict, void *vtable) { #if PY_VERSION_HEX >= 0x02070000 PyObject *ob = PyCapsule_New(vtable, 0, 0); #else PyObject *ob = PyCObject_FromVoidPtr(vtable, 0); #endif if (!ob) goto bad; if (PyDict_SetItem(dict, __pyx_n_s_pyx_vtable, ob) < 0) goto bad; Py_DECREF(ob); return 0; bad: Py_XDECREF(ob); return -1; } static void* __Pyx_GetVtable(PyObject *dict) { void* ptr; PyObject *ob = PyObject_GetItem(dict, __pyx_n_s_pyx_vtable); if (!ob) goto bad; #if PY_VERSION_HEX >= 0x02070000 ptr = PyCapsule_GetPointer(ob, 0); #else ptr = PyCObject_AsVoidPtr(ob); #endif if (!ptr && !PyErr_Occurred()) PyErr_SetString(PyExc_RuntimeError, "invalid vtable found for imported type"); Py_DECREF(ob); return ptr; bad: Py_XDECREF(ob); return NULL; } static PyObject* __Pyx_ImportFrom(PyObject* module, PyObject* name) { PyObject* value = __Pyx_PyObject_GetAttrStr(module, name); if (unlikely(!value) && PyErr_ExceptionMatches(PyExc_AttributeError)) { PyErr_Format(PyExc_ImportError, #if PY_MAJOR_VERSION < 3 "cannot import name %.230s", PyString_AS_STRING(name)); #else "cannot import name %S", name); #endif } return value; } static int __pyx_bisect_code_objects(__Pyx_CodeObjectCacheEntry* entries, int count, int code_line) { int start = 0, mid = 0, end = count - 1; if (end >= 0 && code_line > entries[end].code_line) { return count; } while (start < end) { mid = start + (end - start) / 2; if (code_line < entries[mid].code_line) { end = mid; } else if (code_line > entries[mid].code_line) { start = mid + 1; } else { return mid; } } if (code_line <= entries[mid].code_line) { return mid; } else { return mid + 1; } } static PyCodeObject *__pyx_find_code_object(int code_line) { PyCodeObject* code_object; int pos; if (unlikely(!code_line) || unlikely(!__pyx_code_cache.entries)) { return NULL; } pos = __pyx_bisect_code_objects(__pyx_code_cache.entries, __pyx_code_cache.count, code_line); if (unlikely(pos >= __pyx_code_cache.count) || unlikely(__pyx_code_cache.entries[pos].code_line != code_line)) { return NULL; } code_object = __pyx_code_cache.entries[pos].code_object; Py_INCREF(code_object); return code_object; } static void __pyx_insert_code_object(int code_line, PyCodeObject* code_object) { int pos, i; __Pyx_CodeObjectCacheEntry* entries = __pyx_code_cache.entries; if (unlikely(!code_line)) { return; } if (unlikely(!entries)) { entries = (__Pyx_CodeObjectCacheEntry*)PyMem_Malloc(64*sizeof(__Pyx_CodeObjectCacheEntry)); if (likely(entries)) { __pyx_code_cache.entries = entries; __pyx_code_cache.max_count = 64; __pyx_code_cache.count = 1; entries[0].code_line = code_line; entries[0].code_object = code_object; Py_INCREF(code_object); } return; } pos = __pyx_bisect_code_objects(__pyx_code_cache.entries, __pyx_code_cache.count, code_line); if ((pos < __pyx_code_cache.count) && unlikely(__pyx_code_cache.entries[pos].code_line == code_line)) { PyCodeObject* tmp = entries[pos].code_object; entries[pos].code_object = code_object; Py_DECREF(tmp); return; } if (__pyx_code_cache.count == __pyx_code_cache.max_count) { int new_max = __pyx_code_cache.max_count + 64; entries = (__Pyx_CodeObjectCacheEntry*)PyMem_Realloc( __pyx_code_cache.entries, (size_t)new_max*sizeof(__Pyx_CodeObjectCacheEntry)); if (unlikely(!entries)) { return; } __pyx_code_cache.entries = entries; __pyx_code_cache.max_count = new_max; } for (i=__pyx_code_cache.count; i>pos; i--) { entries[i] = entries[i-1]; } entries[pos].code_line = code_line; entries[pos].code_object = code_object; __pyx_code_cache.count++; Py_INCREF(code_object); } #include "compile.h" #include "frameobject.h" #include "traceback.h" static PyCodeObject* __Pyx_CreateCodeObjectForTraceback( const char *funcname, int c_line, int py_line, const char *filename) { PyCodeObject *py_code = 0; PyObject *py_srcfile = 0; PyObject *py_funcname = 0; #if PY_MAJOR_VERSION < 3 py_srcfile = PyString_FromString(filename); #else py_srcfile = PyUnicode_FromString(filename); #endif if (!py_srcfile) goto bad; if (c_line) { #if PY_MAJOR_VERSION < 3 py_funcname = PyString_FromFormat( "%s (%s:%d)", funcname, __pyx_cfilenm, c_line); #else py_funcname = PyUnicode_FromFormat( "%s (%s:%d)", funcname, __pyx_cfilenm, c_line); #endif } else { #if PY_MAJOR_VERSION < 3 py_funcname = PyString_FromString(funcname); #else py_funcname = PyUnicode_FromString(funcname); #endif } if (!py_funcname) goto bad; py_code = __Pyx_PyCode_New( 0, 0, 0, 0, 0, __pyx_empty_bytes, /*PyObject *code,*/ __pyx_empty_tuple, /*PyObject *consts,*/ __pyx_empty_tuple, /*PyObject *names,*/ __pyx_empty_tuple, /*PyObject *varnames,*/ __pyx_empty_tuple, /*PyObject *freevars,*/ __pyx_empty_tuple, /*PyObject *cellvars,*/ py_srcfile, /*PyObject *filename,*/ py_funcname, /*PyObject *name,*/ py_line, __pyx_empty_bytes /*PyObject *lnotab*/ ); Py_DECREF(py_srcfile); Py_DECREF(py_funcname); return py_code; bad: Py_XDECREF(py_srcfile); Py_XDECREF(py_funcname); return NULL; } static void __Pyx_AddTraceback(const char *funcname, int c_line, int py_line, const char *filename) { PyCodeObject *py_code = 0; PyFrameObject *py_frame = 0; py_code = __pyx_find_code_object(c_line ? c_line : py_line); if (!py_code) { py_code = __Pyx_CreateCodeObjectForTraceback( funcname, c_line, py_line, filename); if (!py_code) goto bad; __pyx_insert_code_object(c_line ? c_line : py_line, py_code); } py_frame = PyFrame_New( PyThreadState_GET(), /*PyThreadState *tstate,*/ py_code, /*PyCodeObject *code,*/ __pyx_d, /*PyObject *globals,*/ 0 /*PyObject *locals*/ ); if (!py_frame) goto bad; py_frame->f_lineno = py_line; PyTraceBack_Here(py_frame); bad: Py_XDECREF(py_code); Py_XDECREF(py_frame); } #define __PYX_VERIFY_RETURN_INT(target_type, func_type, func_value)\ __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, 0) #define __PYX_VERIFY_RETURN_INT_EXC(target_type, func_type, func_value)\ __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, 1) #define __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, exc)\ {\ func_type value = func_value;\ if (sizeof(target_type) < sizeof(func_type)) {\ if (unlikely(value != (func_type) (target_type) value)) {\ func_type zero = 0;\ if (exc && unlikely(value == (func_type)-1 && PyErr_Occurred()))\ return (target_type) -1;\ if (is_unsigned && unlikely(value < zero))\ goto raise_neg_overflow;\ else\ goto raise_overflow;\ }\ }\ return (target_type) value;\ } #if CYTHON_USE_PYLONG_INTERNALS #include "longintrepr.h" #endif static CYTHON_INLINE int __Pyx_PyInt_As_int(PyObject *x) { const int neg_one = (int) -1, const_zero = (int) 0; const int is_unsigned = neg_one > const_zero; #if PY_MAJOR_VERSION < 3 if (likely(PyInt_Check(x))) { if (sizeof(int) < sizeof(long)) { __PYX_VERIFY_RETURN_INT(int, long, PyInt_AS_LONG(x)) } else { long val = PyInt_AS_LONG(x); if (is_unsigned && unlikely(val < 0)) { goto raise_neg_overflow; } return (int) val; } } else #endif if (likely(PyLong_Check(x))) { if (is_unsigned) { #if CYTHON_USE_PYLONG_INTERNALS const digit* digits = ((PyLongObject*)x)->ob_digit; switch (Py_SIZE(x)) { case 0: return (int) 0; case 1: __PYX_VERIFY_RETURN_INT(int, digit, digits[0]) case 2: if (8 * sizeof(int) > 1 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(int) >= 2 * PyLong_SHIFT) { return (int) (((((int)digits[1]) << PyLong_SHIFT) | (int)digits[0])); } } break; case 3: if (8 * sizeof(int) > 2 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(int) >= 3 * PyLong_SHIFT) { return (int) (((((((int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0])); } } break; case 4: if (8 * sizeof(int) > 3 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(int) >= 4 * PyLong_SHIFT) { return (int) (((((((((int)digits[3]) << PyLong_SHIFT) | (int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0])); } } break; } #endif #if CYTHON_COMPILING_IN_CPYTHON if (unlikely(Py_SIZE(x) < 0)) { goto raise_neg_overflow; } #else { int result = PyObject_RichCompareBool(x, Py_False, Py_LT); if (unlikely(result < 0)) return (int) -1; if (unlikely(result == 1)) goto raise_neg_overflow; } #endif if (sizeof(int) <= sizeof(unsigned long)) { __PYX_VERIFY_RETURN_INT_EXC(int, unsigned long, PyLong_AsUnsignedLong(x)) } else if (sizeof(int) <= sizeof(unsigned PY_LONG_LONG)) { __PYX_VERIFY_RETURN_INT_EXC(int, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x)) } } else { #if CYTHON_USE_PYLONG_INTERNALS const digit* digits = ((PyLongObject*)x)->ob_digit; switch (Py_SIZE(x)) { case 0: return (int) 0; case -1: __PYX_VERIFY_RETURN_INT(int, sdigit, -(sdigit) digits[0]) case 1: __PYX_VERIFY_RETURN_INT(int, digit, +digits[0]) case -2: if (8 * sizeof(int) - 1 > 1 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(int, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(int) - 1 > 2 * PyLong_SHIFT) { return (int) (((int)-1)*(((((int)digits[1]) << PyLong_SHIFT) | (int)digits[0]))); } } break; case 2: if (8 * sizeof(int) > 1 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(int) - 1 > 2 * PyLong_SHIFT) { return (int) ((((((int)digits[1]) << PyLong_SHIFT) | (int)digits[0]))); } } break; case -3: if (8 * sizeof(int) - 1 > 2 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(int, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(int) - 1 > 3 * PyLong_SHIFT) { return (int) (((int)-1)*(((((((int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0]))); } } break; case 3: if (8 * sizeof(int) > 2 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(int) - 1 > 3 * PyLong_SHIFT) { return (int) ((((((((int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0]))); } } break; case -4: if (8 * sizeof(int) - 1 > 3 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(int, long, -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(int) - 1 > 4 * PyLong_SHIFT) { return (int) (((int)-1)*(((((((((int)digits[3]) << PyLong_SHIFT) | (int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0]))); } } break; case 4: if (8 * sizeof(int) > 3 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(int) - 1 > 4 * PyLong_SHIFT) { return (int) ((((((((((int)digits[3]) << PyLong_SHIFT) | (int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0]))); } } break; } #endif if (sizeof(int) <= sizeof(long)) { __PYX_VERIFY_RETURN_INT_EXC(int, long, PyLong_AsLong(x)) } else if (sizeof(int) <= sizeof(PY_LONG_LONG)) { __PYX_VERIFY_RETURN_INT_EXC(int, PY_LONG_LONG, PyLong_AsLongLong(x)) } } { #if CYTHON_COMPILING_IN_PYPY && !defined(_PyLong_AsByteArray) PyErr_SetString(PyExc_RuntimeError, "_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers"); #else int val; PyObject *v = __Pyx_PyNumber_Int(x); #if PY_MAJOR_VERSION < 3 if (likely(v) && !PyLong_Check(v)) { PyObject *tmp = v; v = PyNumber_Long(tmp); Py_DECREF(tmp); } #endif if (likely(v)) { int one = 1; int is_little = (int)*(unsigned char *)&one; unsigned char *bytes = (unsigned char *)&val; int ret = _PyLong_AsByteArray((PyLongObject *)v, bytes, sizeof(val), is_little, !is_unsigned); Py_DECREF(v); if (likely(!ret)) return val; } #endif return (int) -1; } } else { int val; PyObject *tmp = __Pyx_PyNumber_Int(x); if (!tmp) return (int) -1; val = __Pyx_PyInt_As_int(tmp); Py_DECREF(tmp); return val; } raise_overflow: PyErr_SetString(PyExc_OverflowError, "value too large to convert to int"); return (int) -1; raise_neg_overflow: PyErr_SetString(PyExc_OverflowError, "can't convert negative value to int"); return (int) -1; } static CYTHON_INLINE PyObject* __Pyx_PyInt_From_int(int value) { const int neg_one = (int) -1, const_zero = (int) 0; const int is_unsigned = neg_one > const_zero; if (is_unsigned) { if (sizeof(int) < sizeof(long)) { return PyInt_FromLong((long) value); } else if (sizeof(int) <= sizeof(unsigned long)) { return PyLong_FromUnsignedLong((unsigned long) value); } else if (sizeof(int) <= sizeof(unsigned PY_LONG_LONG)) { return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value); } } else { if (sizeof(int) <= sizeof(long)) { return PyInt_FromLong((long) value); } else if (sizeof(int) <= sizeof(PY_LONG_LONG)) { return PyLong_FromLongLong((PY_LONG_LONG) value); } } { int one = 1; int little = (int)*(unsigned char *)&one; unsigned char *bytes = (unsigned char *)&value; return _PyLong_FromByteArray(bytes, sizeof(int), little, !is_unsigned); } } static CYTHON_INLINE PyObject* __Pyx_PyInt_From_long(long value) { const long neg_one = (long) -1, const_zero = (long) 0; const int is_unsigned = neg_one > const_zero; if (is_unsigned) { if (sizeof(long) < sizeof(long)) { return PyInt_FromLong((long) value); } else if (sizeof(long) <= sizeof(unsigned long)) { return PyLong_FromUnsignedLong((unsigned long) value); } else if (sizeof(long) <= sizeof(unsigned PY_LONG_LONG)) { return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value); } } else { if (sizeof(long) <= sizeof(long)) { return PyInt_FromLong((long) value); } else if (sizeof(long) <= sizeof(PY_LONG_LONG)) { return PyLong_FromLongLong((PY_LONG_LONG) value); } } { int one = 1; int little = (int)*(unsigned char *)&one; unsigned char *bytes = (unsigned char *)&value; return _PyLong_FromByteArray(bytes, sizeof(long), little, !is_unsigned); } } static CYTHON_INLINE long __Pyx_PyInt_As_long(PyObject *x) { const long neg_one = (long) -1, const_zero = (long) 0; const int is_unsigned = neg_one > const_zero; #if PY_MAJOR_VERSION < 3 if (likely(PyInt_Check(x))) { if (sizeof(long) < sizeof(long)) { __PYX_VERIFY_RETURN_INT(long, long, PyInt_AS_LONG(x)) } else { long val = PyInt_AS_LONG(x); if (is_unsigned && unlikely(val < 0)) { goto raise_neg_overflow; } return (long) val; } } else #endif if (likely(PyLong_Check(x))) { if (is_unsigned) { #if CYTHON_USE_PYLONG_INTERNALS const digit* digits = ((PyLongObject*)x)->ob_digit; switch (Py_SIZE(x)) { case 0: return (long) 0; case 1: __PYX_VERIFY_RETURN_INT(long, digit, digits[0]) case 2: if (8 * sizeof(long) > 1 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(long) >= 2 * PyLong_SHIFT) { return (long) (((((long)digits[1]) << PyLong_SHIFT) | (long)digits[0])); } } break; case 3: if (8 * sizeof(long) > 2 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(long) >= 3 * PyLong_SHIFT) { return (long) (((((((long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0])); } } break; case 4: if (8 * sizeof(long) > 3 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(long) >= 4 * PyLong_SHIFT) { return (long) (((((((((long)digits[3]) << PyLong_SHIFT) | (long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0])); } } break; } #endif #if CYTHON_COMPILING_IN_CPYTHON if (unlikely(Py_SIZE(x) < 0)) { goto raise_neg_overflow; } #else { int result = PyObject_RichCompareBool(x, Py_False, Py_LT); if (unlikely(result < 0)) return (long) -1; if (unlikely(result == 1)) goto raise_neg_overflow; } #endif if (sizeof(long) <= sizeof(unsigned long)) { __PYX_VERIFY_RETURN_INT_EXC(long, unsigned long, PyLong_AsUnsignedLong(x)) } else if (sizeof(long) <= sizeof(unsigned PY_LONG_LONG)) { __PYX_VERIFY_RETURN_INT_EXC(long, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x)) } } else { #if CYTHON_USE_PYLONG_INTERNALS const digit* digits = ((PyLongObject*)x)->ob_digit; switch (Py_SIZE(x)) { case 0: return (long) 0; case -1: __PYX_VERIFY_RETURN_INT(long, sdigit, -(sdigit) digits[0]) case 1: __PYX_VERIFY_RETURN_INT(long, digit, +digits[0]) case -2: if (8 * sizeof(long) - 1 > 1 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(long, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) { return (long) (((long)-1)*(((((long)digits[1]) << PyLong_SHIFT) | (long)digits[0]))); } } break; case 2: if (8 * sizeof(long) > 1 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) { return (long) ((((((long)digits[1]) << PyLong_SHIFT) | (long)digits[0]))); } } break; case -3: if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(long, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) { return (long) (((long)-1)*(((((((long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0]))); } } break; case 3: if (8 * sizeof(long) > 2 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) { return (long) ((((((((long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0]))); } } break; case -4: if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(long, long, -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(long) - 1 > 4 * PyLong_SHIFT) { return (long) (((long)-1)*(((((((((long)digits[3]) << PyLong_SHIFT) | (long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0]))); } } break; case 4: if (8 * sizeof(long) > 3 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(long) - 1 > 4 * PyLong_SHIFT) { return (long) ((((((((((long)digits[3]) << PyLong_SHIFT) | (long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0]))); } } break; } #endif if (sizeof(long) <= sizeof(long)) { __PYX_VERIFY_RETURN_INT_EXC(long, long, PyLong_AsLong(x)) } else if (sizeof(long) <= sizeof(PY_LONG_LONG)) { __PYX_VERIFY_RETURN_INT_EXC(long, PY_LONG_LONG, PyLong_AsLongLong(x)) } } { #if CYTHON_COMPILING_IN_PYPY && !defined(_PyLong_AsByteArray) PyErr_SetString(PyExc_RuntimeError, "_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers"); #else long val; PyObject *v = __Pyx_PyNumber_Int(x); #if PY_MAJOR_VERSION < 3 if (likely(v) && !PyLong_Check(v)) { PyObject *tmp = v; v = PyNumber_Long(tmp); Py_DECREF(tmp); } #endif if (likely(v)) { int one = 1; int is_little = (int)*(unsigned char *)&one; unsigned char *bytes = (unsigned char *)&val; int ret = _PyLong_AsByteArray((PyLongObject *)v, bytes, sizeof(val), is_little, !is_unsigned); Py_DECREF(v); if (likely(!ret)) return val; } #endif return (long) -1; } } else { long val; PyObject *tmp = __Pyx_PyNumber_Int(x); if (!tmp) return (long) -1; val = __Pyx_PyInt_As_long(tmp); Py_DECREF(tmp); return val; } raise_overflow: PyErr_SetString(PyExc_OverflowError, "value too large to convert to long"); return (long) -1; raise_neg_overflow: PyErr_SetString(PyExc_OverflowError, "can't convert negative value to long"); return (long) -1; } static int __Pyx_check_binary_version(void) { char ctversion[4], rtversion[4]; PyOS_snprintf(ctversion, 4, "%d.%d", PY_MAJOR_VERSION, PY_MINOR_VERSION); PyOS_snprintf(rtversion, 4, "%s", Py_GetVersion()); if (ctversion[0] != rtversion[0] || ctversion[2] != rtversion[2]) { char message[200]; PyOS_snprintf(message, sizeof(message), "compiletime version %s of module '%.100s' " "does not match runtime version %s", ctversion, __Pyx_MODULE_NAME, rtversion); return PyErr_WarnEx(NULL, message, 1); } return 0; } #ifndef __PYX_HAVE_RT_ImportModule #define __PYX_HAVE_RT_ImportModule static PyObject *__Pyx_ImportModule(const char *name) { PyObject *py_name = 0; PyObject *py_module = 0; py_name = __Pyx_PyIdentifier_FromString(name); if (!py_name) goto bad; py_module = PyImport_Import(py_name); Py_DECREF(py_name); return py_module; bad: Py_XDECREF(py_name); return 0; } #endif #ifndef __PYX_HAVE_RT_ImportType #define __PYX_HAVE_RT_ImportType static PyTypeObject *__Pyx_ImportType(const char *module_name, const char *class_name, size_t size, int strict) { PyObject *py_module = 0; PyObject *result = 0; PyObject *py_name = 0; char warning[200]; Py_ssize_t basicsize; #ifdef Py_LIMITED_API PyObject *py_basicsize; #endif py_module = __Pyx_ImportModule(module_name); if (!py_module) goto bad; py_name = __Pyx_PyIdentifier_FromString(class_name); if (!py_name) goto bad; result = PyObject_GetAttr(py_module, py_name); Py_DECREF(py_name); py_name = 0; Py_DECREF(py_module); py_module = 0; if (!result) goto bad; if (!PyType_Check(result)) { PyErr_Format(PyExc_TypeError, "%.200s.%.200s is not a type object", module_name, class_name); goto bad; } #ifndef Py_LIMITED_API basicsize = ((PyTypeObject *)result)->tp_basicsize; #else py_basicsize = PyObject_GetAttrString(result, "__basicsize__"); if (!py_basicsize) goto bad; basicsize = PyLong_AsSsize_t(py_basicsize); Py_DECREF(py_basicsize); py_basicsize = 0; if (basicsize == (Py_ssize_t)-1 && PyErr_Occurred()) goto bad; #endif if (!strict && (size_t)basicsize > size) { PyOS_snprintf(warning, sizeof(warning), "%s.%s size changed, may indicate binary incompatibility", module_name, class_name); if (PyErr_WarnEx(NULL, warning, 0) < 0) goto bad; } else if ((size_t)basicsize != size) { PyErr_Format(PyExc_ValueError, "%.200s.%.200s has the wrong size, try recompiling", module_name, class_name); goto bad; } return (PyTypeObject *)result; bad: Py_XDECREF(py_module); Py_XDECREF(result); return NULL; } #endif #ifndef __PYX_HAVE_RT_ImportFunction #define __PYX_HAVE_RT_ImportFunction static int __Pyx_ImportFunction(PyObject *module, const char *funcname, void (**f)(void), const char *sig) { PyObject *d = 0; PyObject *cobj = 0; union { void (*fp)(void); void *p; } tmp; d = PyObject_GetAttrString(module, (char *)"__pyx_capi__"); if (!d) goto bad; cobj = PyDict_GetItemString(d, funcname); if (!cobj) { PyErr_Format(PyExc_ImportError, "%.200s does not export expected C function %.200s", PyModule_GetName(module), funcname); goto bad; } #if PY_VERSION_HEX >= 0x02070000 if (!PyCapsule_IsValid(cobj, sig)) { PyErr_Format(PyExc_TypeError, "C function %.200s.%.200s has wrong signature (expected %.500s, got %.500s)", PyModule_GetName(module), funcname, sig, PyCapsule_GetName(cobj)); goto bad; } tmp.p = PyCapsule_GetPointer(cobj, sig); #else {const char *desc, *s1, *s2; desc = (const char *)PyCObject_GetDesc(cobj); if (!desc) goto bad; s1 = desc; s2 = sig; while (*s1 != '\0' && *s1 == *s2) { s1++; s2++; } if (*s1 != *s2) { PyErr_Format(PyExc_TypeError, "C function %.200s.%.200s has wrong signature (expected %.500s, got %.500s)", PyModule_GetName(module), funcname, sig, desc); goto bad; } tmp.p = PyCObject_AsVoidPtr(cobj);} #endif *f = tmp.fp; if (!(*f)) goto bad; Py_DECREF(d); return 0; bad: Py_XDECREF(d); return -1; } #endif static int __Pyx_InitStrings(__Pyx_StringTabEntry *t) { while (t->p) { #if PY_MAJOR_VERSION < 3 if (t->is_unicode) { *t->p = PyUnicode_DecodeUTF8(t->s, t->n - 1, NULL); } else if (t->intern) { *t->p = PyString_InternFromString(t->s); } else { *t->p = PyString_FromStringAndSize(t->s, t->n - 1); } #else if (t->is_unicode | t->is_str) { if (t->intern) { *t->p = PyUnicode_InternFromString(t->s); } else if (t->encoding) { *t->p = PyUnicode_Decode(t->s, t->n - 1, t->encoding, NULL); } else { *t->p = PyUnicode_FromStringAndSize(t->s, t->n - 1); } } else { *t->p = PyBytes_FromStringAndSize(t->s, t->n - 1); } #endif if (!*t->p) return -1; ++t; } return 0; } static CYTHON_INLINE PyObject* __Pyx_PyUnicode_FromString(const char* c_str) { return __Pyx_PyUnicode_FromStringAndSize(c_str, (Py_ssize_t)strlen(c_str)); } static CYTHON_INLINE char* __Pyx_PyObject_AsString(PyObject* o) { Py_ssize_t ignore; return __Pyx_PyObject_AsStringAndSize(o, &ignore); } static CYTHON_INLINE char* __Pyx_PyObject_AsStringAndSize(PyObject* o, Py_ssize_t *length) { #if CYTHON_COMPILING_IN_CPYTHON && (__PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT) if ( #if PY_MAJOR_VERSION < 3 && __PYX_DEFAULT_STRING_ENCODING_IS_ASCII __Pyx_sys_getdefaultencoding_not_ascii && #endif PyUnicode_Check(o)) { #if PY_VERSION_HEX < 0x03030000 char* defenc_c; PyObject* defenc = _PyUnicode_AsDefaultEncodedString(o, NULL); if (!defenc) return NULL; defenc_c = PyBytes_AS_STRING(defenc); #if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII { char* end = defenc_c + PyBytes_GET_SIZE(defenc); char* c; for (c = defenc_c; c < end; c++) { if ((unsigned char) (*c) >= 128) { PyUnicode_AsASCIIString(o); return NULL; } } } #endif *length = PyBytes_GET_SIZE(defenc); return defenc_c; #else if (__Pyx_PyUnicode_READY(o) == -1) return NULL; #if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII if (PyUnicode_IS_ASCII(o)) { *length = PyUnicode_GET_LENGTH(o); return PyUnicode_AsUTF8(o); } else { PyUnicode_AsASCIIString(o); return NULL; } #else return PyUnicode_AsUTF8AndSize(o, length); #endif #endif } else #endif #if (!CYTHON_COMPILING_IN_PYPY) || (defined(PyByteArray_AS_STRING) && defined(PyByteArray_GET_SIZE)) if (PyByteArray_Check(o)) { *length = PyByteArray_GET_SIZE(o); return PyByteArray_AS_STRING(o); } else #endif { char* result; int r = PyBytes_AsStringAndSize(o, &result, length); if (unlikely(r < 0)) { return NULL; } else { return result; } } } static CYTHON_INLINE int __Pyx_PyObject_IsTrue(PyObject* x) { int is_true = x == Py_True; if (is_true | (x == Py_False) | (x == Py_None)) return is_true; else return PyObject_IsTrue(x); } static CYTHON_INLINE PyObject* __Pyx_PyNumber_Int(PyObject* x) { PyNumberMethods *m; const char *name = NULL; PyObject *res = NULL; #if PY_MAJOR_VERSION < 3 if (PyInt_Check(x) || PyLong_Check(x)) #else if (PyLong_Check(x)) #endif return __Pyx_NewRef(x); m = Py_TYPE(x)->tp_as_number; #if PY_MAJOR_VERSION < 3 if (m && m->nb_int) { name = "int"; res = PyNumber_Int(x); } else if (m && m->nb_long) { name = "long"; res = PyNumber_Long(x); } #else if (m && m->nb_int) { name = "int"; res = PyNumber_Long(x); } #endif if (res) { #if PY_MAJOR_VERSION < 3 if (!PyInt_Check(res) && !PyLong_Check(res)) { #else if (!PyLong_Check(res)) { #endif PyErr_Format(PyExc_TypeError, "__%.4s__ returned non-%.4s (type %.200s)", name, name, Py_TYPE(res)->tp_name); Py_DECREF(res); return NULL; } } else if (!PyErr_Occurred()) { PyErr_SetString(PyExc_TypeError, "an integer is required"); } return res; } static CYTHON_INLINE Py_ssize_t __Pyx_PyIndex_AsSsize_t(PyObject* b) { Py_ssize_t ival; PyObject *x; #if PY_MAJOR_VERSION < 3 if (likely(PyInt_CheckExact(b))) { if (sizeof(Py_ssize_t) >= sizeof(long)) return PyInt_AS_LONG(b); else return PyInt_AsSsize_t(x); } #endif if (likely(PyLong_CheckExact(b))) { #if CYTHON_USE_PYLONG_INTERNALS const digit* digits = ((PyLongObject*)b)->ob_digit; const Py_ssize_t size = Py_SIZE(b); if (likely(__Pyx_sst_abs(size) <= 1)) { ival = likely(size) ? digits[0] : 0; if (size == -1) ival = -ival; return ival; } else { switch (size) { case 2: if (8 * sizeof(Py_ssize_t) > 2 * PyLong_SHIFT) { return (Py_ssize_t) (((((size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])); } break; case -2: if (8 * sizeof(Py_ssize_t) > 2 * PyLong_SHIFT) { return -(Py_ssize_t) (((((size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])); } break; case 3: if (8 * sizeof(Py_ssize_t) > 3 * PyLong_SHIFT) { return (Py_ssize_t) (((((((size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])); } break; case -3: if (8 * sizeof(Py_ssize_t) > 3 * PyLong_SHIFT) { return -(Py_ssize_t) (((((((size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])); } break; case 4: if (8 * sizeof(Py_ssize_t) > 4 * PyLong_SHIFT) { return (Py_ssize_t) (((((((((size_t)digits[3]) << PyLong_SHIFT) | (size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])); } break; case -4: if (8 * sizeof(Py_ssize_t) > 4 * PyLong_SHIFT) { return -(Py_ssize_t) (((((((((size_t)digits[3]) << PyLong_SHIFT) | (size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])); } break; } } #endif return PyLong_AsSsize_t(b); } x = PyNumber_Index(b); if (!x) return -1; ival = PyInt_AsSsize_t(x); Py_DECREF(x); return ival; } static CYTHON_INLINE PyObject * __Pyx_PyInt_FromSize_t(size_t ival) { return PyInt_FromSize_t(ival); } #endif /* Py_PYTHON_H */ pygame_sdl2-2.1.0-for-renpy-6.99.14.1/gen/pygame_sdl2.rect.c0000664000175000017500000213302513042556067022343 0ustar tomtom00000000000000/* Generated by Cython 0.23.5 */ #define PY_SSIZE_T_CLEAN #include "Python.h" #ifndef Py_PYTHON_H #error Python headers needed to compile C extensions, please install development version of Python. #elif PY_VERSION_HEX < 0x02060000 || (0x03000000 <= PY_VERSION_HEX && PY_VERSION_HEX < 0x03020000) #error Cython requires Python 2.6+ or Python 3.2+. #else #define CYTHON_ABI "0_23_5" #include #ifndef offsetof #define offsetof(type, member) ( (size_t) & ((type*)0) -> member ) #endif #if !defined(WIN32) && !defined(MS_WINDOWS) #ifndef __stdcall #define __stdcall #endif #ifndef __cdecl #define __cdecl #endif #ifndef __fastcall #define __fastcall #endif #endif #ifndef DL_IMPORT #define DL_IMPORT(t) t #endif #ifndef DL_EXPORT #define DL_EXPORT(t) t #endif #ifndef PY_LONG_LONG #define PY_LONG_LONG LONG_LONG #endif #ifndef Py_HUGE_VAL #define Py_HUGE_VAL HUGE_VAL #endif #ifdef PYPY_VERSION #define CYTHON_COMPILING_IN_PYPY 1 #define CYTHON_COMPILING_IN_CPYTHON 0 #else #define CYTHON_COMPILING_IN_PYPY 0 #define CYTHON_COMPILING_IN_CPYTHON 1 #endif #if !defined(CYTHON_USE_PYLONG_INTERNALS) && CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x02070000 #define CYTHON_USE_PYLONG_INTERNALS 1 #endif #if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX < 0x02070600 && !defined(Py_OptimizeFlag) #define Py_OptimizeFlag 0 #endif #define __PYX_BUILD_PY_SSIZE_T "n" #define CYTHON_FORMAT_SSIZE_T "z" #if PY_MAJOR_VERSION < 3 #define __Pyx_BUILTIN_MODULE_NAME "__builtin__" #define __Pyx_PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)\ PyCode_New(a+k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos) #define __Pyx_DefaultClassType PyClass_Type #else #define __Pyx_BUILTIN_MODULE_NAME "builtins" #define __Pyx_PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)\ PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos) #define __Pyx_DefaultClassType PyType_Type #endif #ifndef Py_TPFLAGS_CHECKTYPES #define Py_TPFLAGS_CHECKTYPES 0 #endif #ifndef Py_TPFLAGS_HAVE_INDEX #define Py_TPFLAGS_HAVE_INDEX 0 #endif #ifndef Py_TPFLAGS_HAVE_NEWBUFFER #define Py_TPFLAGS_HAVE_NEWBUFFER 0 #endif #ifndef Py_TPFLAGS_HAVE_FINALIZE #define Py_TPFLAGS_HAVE_FINALIZE 0 #endif #if PY_VERSION_HEX > 0x03030000 && defined(PyUnicode_KIND) #define CYTHON_PEP393_ENABLED 1 #define __Pyx_PyUnicode_READY(op) (likely(PyUnicode_IS_READY(op)) ?\ 0 : _PyUnicode_Ready((PyObject *)(op))) #define __Pyx_PyUnicode_GET_LENGTH(u) PyUnicode_GET_LENGTH(u) #define __Pyx_PyUnicode_READ_CHAR(u, i) PyUnicode_READ_CHAR(u, i) #define __Pyx_PyUnicode_KIND(u) PyUnicode_KIND(u) #define __Pyx_PyUnicode_DATA(u) PyUnicode_DATA(u) #define __Pyx_PyUnicode_READ(k, d, i) PyUnicode_READ(k, d, i) #else #define CYTHON_PEP393_ENABLED 0 #define __Pyx_PyUnicode_READY(op) (0) #define __Pyx_PyUnicode_GET_LENGTH(u) PyUnicode_GET_SIZE(u) #define __Pyx_PyUnicode_READ_CHAR(u, i) ((Py_UCS4)(PyUnicode_AS_UNICODE(u)[i])) #define __Pyx_PyUnicode_KIND(u) (sizeof(Py_UNICODE)) #define __Pyx_PyUnicode_DATA(u) ((void*)PyUnicode_AS_UNICODE(u)) #define __Pyx_PyUnicode_READ(k, d, i) ((void)(k), (Py_UCS4)(((Py_UNICODE*)d)[i])) #endif #if CYTHON_COMPILING_IN_PYPY #define __Pyx_PyUnicode_Concat(a, b) PyNumber_Add(a, b) #define __Pyx_PyUnicode_ConcatSafe(a, b) PyNumber_Add(a, b) #else #define __Pyx_PyUnicode_Concat(a, b) PyUnicode_Concat(a, b) #define __Pyx_PyUnicode_ConcatSafe(a, b) ((unlikely((a) == Py_None) || unlikely((b) == Py_None)) ?\ PyNumber_Add(a, b) : __Pyx_PyUnicode_Concat(a, b)) #endif #if CYTHON_COMPILING_IN_PYPY && !defined(PyUnicode_Contains) #define PyUnicode_Contains(u, s) PySequence_Contains(u, s) #endif #define __Pyx_PyString_FormatSafe(a, b) ((unlikely((a) == Py_None)) ? PyNumber_Remainder(a, b) : __Pyx_PyString_Format(a, b)) #define __Pyx_PyUnicode_FormatSafe(a, b) ((unlikely((a) == Py_None)) ? PyNumber_Remainder(a, b) : PyUnicode_Format(a, b)) #if PY_MAJOR_VERSION >= 3 #define __Pyx_PyString_Format(a, b) PyUnicode_Format(a, b) #else #define __Pyx_PyString_Format(a, b) PyString_Format(a, b) #endif #if PY_MAJOR_VERSION >= 3 #define PyBaseString_Type PyUnicode_Type #define PyStringObject PyUnicodeObject #define PyString_Type PyUnicode_Type #define PyString_Check PyUnicode_Check #define PyString_CheckExact PyUnicode_CheckExact #endif #if PY_MAJOR_VERSION >= 3 #define __Pyx_PyBaseString_Check(obj) PyUnicode_Check(obj) #define __Pyx_PyBaseString_CheckExact(obj) PyUnicode_CheckExact(obj) #else #define __Pyx_PyBaseString_Check(obj) (PyString_Check(obj) || PyUnicode_Check(obj)) #define __Pyx_PyBaseString_CheckExact(obj) (PyString_CheckExact(obj) || PyUnicode_CheckExact(obj)) #endif #ifndef PySet_CheckExact #define PySet_CheckExact(obj) (Py_TYPE(obj) == &PySet_Type) #endif #define __Pyx_TypeCheck(obj, type) PyObject_TypeCheck(obj, (PyTypeObject *)type) #if PY_MAJOR_VERSION >= 3 #define PyIntObject PyLongObject #define PyInt_Type PyLong_Type #define PyInt_Check(op) PyLong_Check(op) #define PyInt_CheckExact(op) PyLong_CheckExact(op) #define PyInt_FromString PyLong_FromString #define PyInt_FromUnicode PyLong_FromUnicode #define PyInt_FromLong PyLong_FromLong #define PyInt_FromSize_t PyLong_FromSize_t #define PyInt_FromSsize_t PyLong_FromSsize_t #define PyInt_AsLong PyLong_AsLong #define PyInt_AS_LONG PyLong_AS_LONG #define PyInt_AsSsize_t PyLong_AsSsize_t #define PyInt_AsUnsignedLongMask PyLong_AsUnsignedLongMask #define PyInt_AsUnsignedLongLongMask PyLong_AsUnsignedLongLongMask #define PyNumber_Int PyNumber_Long #endif #if PY_MAJOR_VERSION >= 3 #define PyBoolObject PyLongObject #endif #if PY_MAJOR_VERSION >= 3 && CYTHON_COMPILING_IN_PYPY #ifndef PyUnicode_InternFromString #define PyUnicode_InternFromString(s) PyUnicode_FromString(s) #endif #endif #if PY_VERSION_HEX < 0x030200A4 typedef long Py_hash_t; #define __Pyx_PyInt_FromHash_t PyInt_FromLong #define __Pyx_PyInt_AsHash_t PyInt_AsLong #else #define __Pyx_PyInt_FromHash_t PyInt_FromSsize_t #define __Pyx_PyInt_AsHash_t PyInt_AsSsize_t #endif #if PY_MAJOR_VERSION >= 3 #define __Pyx_PyMethod_New(func, self, klass) ((self) ? PyMethod_New(func, self) : PyInstanceMethod_New(func)) #else #define __Pyx_PyMethod_New(func, self, klass) PyMethod_New(func, self, klass) #endif #if PY_VERSION_HEX >= 0x030500B1 #define __Pyx_PyAsyncMethodsStruct PyAsyncMethods #define __Pyx_PyType_AsAsync(obj) (Py_TYPE(obj)->tp_as_async) #elif CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3 typedef struct { unaryfunc am_await; unaryfunc am_aiter; unaryfunc am_anext; } __Pyx_PyAsyncMethodsStruct; #define __Pyx_PyType_AsAsync(obj) ((__Pyx_PyAsyncMethodsStruct*) (Py_TYPE(obj)->tp_reserved)) #else #define __Pyx_PyType_AsAsync(obj) NULL #endif #ifndef CYTHON_RESTRICT #if defined(__GNUC__) #define CYTHON_RESTRICT __restrict__ #elif defined(_MSC_VER) && _MSC_VER >= 1400 #define CYTHON_RESTRICT __restrict #elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L #define CYTHON_RESTRICT restrict #else #define CYTHON_RESTRICT #endif #endif #define __Pyx_void_to_None(void_result) ((void)(void_result), Py_INCREF(Py_None), Py_None) #ifndef CYTHON_INLINE #if defined(__GNUC__) #define CYTHON_INLINE __inline__ #elif defined(_MSC_VER) #define CYTHON_INLINE __inline #elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L #define CYTHON_INLINE inline #else #define CYTHON_INLINE #endif #endif #if defined(WIN32) || defined(MS_WINDOWS) #define _USE_MATH_DEFINES #endif #include #ifdef NAN #define __PYX_NAN() ((float) NAN) #else static CYTHON_INLINE float __PYX_NAN() { float value; memset(&value, 0xFF, sizeof(value)); return value; } #endif #if PY_MAJOR_VERSION >= 3 #define __Pyx_PyNumber_Divide(x,y) PyNumber_TrueDivide(x,y) #define __Pyx_PyNumber_InPlaceDivide(x,y) PyNumber_InPlaceTrueDivide(x,y) #else #define __Pyx_PyNumber_Divide(x,y) PyNumber_Divide(x,y) #define __Pyx_PyNumber_InPlaceDivide(x,y) PyNumber_InPlaceDivide(x,y) #endif #ifndef __PYX_EXTERN_C #ifdef __cplusplus #define __PYX_EXTERN_C extern "C" #else #define __PYX_EXTERN_C extern #endif #endif #define __PYX_HAVE__pygame_sdl2__rect #define __PYX_HAVE_API__pygame_sdl2__rect #include "stdint.h" #include "string.h" #include "stdio.h" #include "stddef.h" #include "SDL.h" #ifdef _OPENMP #include #endif /* _OPENMP */ #ifdef PYREX_WITHOUT_ASSERTIONS #define CYTHON_WITHOUT_ASSERTIONS #endif #ifndef CYTHON_UNUSED # if defined(__GNUC__) # if !(defined(__cplusplus)) || (__GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 4)) # define CYTHON_UNUSED __attribute__ ((__unused__)) # else # define CYTHON_UNUSED # endif # elif defined(__ICC) || (defined(__INTEL_COMPILER) && !defined(_MSC_VER)) # define CYTHON_UNUSED __attribute__ ((__unused__)) # else # define CYTHON_UNUSED # endif #endif #ifndef CYTHON_NCP_UNUSED # if CYTHON_COMPILING_IN_CPYTHON # define CYTHON_NCP_UNUSED # else # define CYTHON_NCP_UNUSED CYTHON_UNUSED # endif #endif typedef struct {PyObject **p; char *s; const Py_ssize_t n; const char* encoding; const char is_unicode; const char is_str; const char intern; } __Pyx_StringTabEntry; #define __PYX_DEFAULT_STRING_ENCODING_IS_ASCII 0 #define __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT 0 #define __PYX_DEFAULT_STRING_ENCODING "" #define __Pyx_PyObject_FromString __Pyx_PyBytes_FromString #define __Pyx_PyObject_FromStringAndSize __Pyx_PyBytes_FromStringAndSize #define __Pyx_uchar_cast(c) ((unsigned char)c) #define __Pyx_long_cast(x) ((long)x) #define __Pyx_fits_Py_ssize_t(v, type, is_signed) (\ (sizeof(type) < sizeof(Py_ssize_t)) ||\ (sizeof(type) > sizeof(Py_ssize_t) &&\ likely(v < (type)PY_SSIZE_T_MAX ||\ v == (type)PY_SSIZE_T_MAX) &&\ (!is_signed || likely(v > (type)PY_SSIZE_T_MIN ||\ v == (type)PY_SSIZE_T_MIN))) ||\ (sizeof(type) == sizeof(Py_ssize_t) &&\ (is_signed || likely(v < (type)PY_SSIZE_T_MAX ||\ v == (type)PY_SSIZE_T_MAX))) ) #if defined (__cplusplus) && __cplusplus >= 201103L #include #define __Pyx_sst_abs(value) std::abs(value) #elif SIZEOF_INT >= SIZEOF_SIZE_T #define __Pyx_sst_abs(value) abs(value) #elif SIZEOF_LONG >= SIZEOF_SIZE_T #define __Pyx_sst_abs(value) labs(value) #elif defined (_MSC_VER) && defined (_M_X64) #define __Pyx_sst_abs(value) _abs64(value) #elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L #define __Pyx_sst_abs(value) llabs(value) #elif defined (__GNUC__) #define __Pyx_sst_abs(value) __builtin_llabs(value) #else #define __Pyx_sst_abs(value) ((value<0) ? -value : value) #endif static CYTHON_INLINE char* __Pyx_PyObject_AsString(PyObject*); static CYTHON_INLINE char* __Pyx_PyObject_AsStringAndSize(PyObject*, Py_ssize_t* length); #define __Pyx_PyByteArray_FromString(s) PyByteArray_FromStringAndSize((const char*)s, strlen((const char*)s)) #define __Pyx_PyByteArray_FromStringAndSize(s, l) PyByteArray_FromStringAndSize((const char*)s, l) #define __Pyx_PyBytes_FromString PyBytes_FromString #define __Pyx_PyBytes_FromStringAndSize PyBytes_FromStringAndSize static CYTHON_INLINE PyObject* __Pyx_PyUnicode_FromString(const char*); #if PY_MAJOR_VERSION < 3 #define __Pyx_PyStr_FromString __Pyx_PyBytes_FromString #define __Pyx_PyStr_FromStringAndSize __Pyx_PyBytes_FromStringAndSize #else #define __Pyx_PyStr_FromString __Pyx_PyUnicode_FromString #define __Pyx_PyStr_FromStringAndSize __Pyx_PyUnicode_FromStringAndSize #endif #define __Pyx_PyObject_AsSString(s) ((signed char*) __Pyx_PyObject_AsString(s)) #define __Pyx_PyObject_AsUString(s) ((unsigned char*) __Pyx_PyObject_AsString(s)) #define __Pyx_PyObject_FromCString(s) __Pyx_PyObject_FromString((const char*)s) #define __Pyx_PyBytes_FromCString(s) __Pyx_PyBytes_FromString((const char*)s) #define __Pyx_PyByteArray_FromCString(s) __Pyx_PyByteArray_FromString((const char*)s) #define __Pyx_PyStr_FromCString(s) __Pyx_PyStr_FromString((const char*)s) #define __Pyx_PyUnicode_FromCString(s) __Pyx_PyUnicode_FromString((const char*)s) #if PY_MAJOR_VERSION < 3 static CYTHON_INLINE size_t __Pyx_Py_UNICODE_strlen(const Py_UNICODE *u) { const Py_UNICODE *u_end = u; while (*u_end++) ; return (size_t)(u_end - u - 1); } #else #define __Pyx_Py_UNICODE_strlen Py_UNICODE_strlen #endif #define __Pyx_PyUnicode_FromUnicode(u) PyUnicode_FromUnicode(u, __Pyx_Py_UNICODE_strlen(u)) #define __Pyx_PyUnicode_FromUnicodeAndLength PyUnicode_FromUnicode #define __Pyx_PyUnicode_AsUnicode PyUnicode_AsUnicode #define __Pyx_NewRef(obj) (Py_INCREF(obj), obj) #define __Pyx_Owned_Py_None(b) __Pyx_NewRef(Py_None) #define __Pyx_PyBool_FromLong(b) ((b) ? __Pyx_NewRef(Py_True) : __Pyx_NewRef(Py_False)) static CYTHON_INLINE int __Pyx_PyObject_IsTrue(PyObject*); static CYTHON_INLINE PyObject* __Pyx_PyNumber_Int(PyObject* x); static CYTHON_INLINE Py_ssize_t __Pyx_PyIndex_AsSsize_t(PyObject*); static CYTHON_INLINE PyObject * __Pyx_PyInt_FromSize_t(size_t); #if CYTHON_COMPILING_IN_CPYTHON #define __pyx_PyFloat_AsDouble(x) (PyFloat_CheckExact(x) ? PyFloat_AS_DOUBLE(x) : PyFloat_AsDouble(x)) #else #define __pyx_PyFloat_AsDouble(x) PyFloat_AsDouble(x) #endif #define __pyx_PyFloat_AsFloat(x) ((float) __pyx_PyFloat_AsDouble(x)) #if PY_MAJOR_VERSION < 3 && __PYX_DEFAULT_STRING_ENCODING_IS_ASCII static int __Pyx_sys_getdefaultencoding_not_ascii; static int __Pyx_init_sys_getdefaultencoding_params(void) { PyObject* sys; PyObject* default_encoding = NULL; PyObject* ascii_chars_u = NULL; PyObject* ascii_chars_b = NULL; const char* default_encoding_c; sys = PyImport_ImportModule("sys"); if (!sys) goto bad; default_encoding = PyObject_CallMethod(sys, (char*) "getdefaultencoding", NULL); Py_DECREF(sys); if (!default_encoding) goto bad; default_encoding_c = PyBytes_AsString(default_encoding); if (!default_encoding_c) goto bad; if (strcmp(default_encoding_c, "ascii") == 0) { __Pyx_sys_getdefaultencoding_not_ascii = 0; } else { char ascii_chars[128]; int c; for (c = 0; c < 128; c++) { ascii_chars[c] = c; } __Pyx_sys_getdefaultencoding_not_ascii = 1; ascii_chars_u = PyUnicode_DecodeASCII(ascii_chars, 128, NULL); if (!ascii_chars_u) goto bad; ascii_chars_b = PyUnicode_AsEncodedString(ascii_chars_u, default_encoding_c, NULL); if (!ascii_chars_b || !PyBytes_Check(ascii_chars_b) || memcmp(ascii_chars, PyBytes_AS_STRING(ascii_chars_b), 128) != 0) { PyErr_Format( PyExc_ValueError, "This module compiled with c_string_encoding=ascii, but default encoding '%.200s' is not a superset of ascii.", default_encoding_c); goto bad; } Py_DECREF(ascii_chars_u); Py_DECREF(ascii_chars_b); } Py_DECREF(default_encoding); return 0; bad: Py_XDECREF(default_encoding); Py_XDECREF(ascii_chars_u); Py_XDECREF(ascii_chars_b); return -1; } #endif #if __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT && PY_MAJOR_VERSION >= 3 #define __Pyx_PyUnicode_FromStringAndSize(c_str, size) PyUnicode_DecodeUTF8(c_str, size, NULL) #else #define __Pyx_PyUnicode_FromStringAndSize(c_str, size) PyUnicode_Decode(c_str, size, __PYX_DEFAULT_STRING_ENCODING, NULL) #if __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT static char* __PYX_DEFAULT_STRING_ENCODING; static int __Pyx_init_sys_getdefaultencoding_params(void) { PyObject* sys; PyObject* default_encoding = NULL; char* default_encoding_c; sys = PyImport_ImportModule("sys"); if (!sys) goto bad; default_encoding = PyObject_CallMethod(sys, (char*) (const char*) "getdefaultencoding", NULL); Py_DECREF(sys); if (!default_encoding) goto bad; default_encoding_c = PyBytes_AsString(default_encoding); if (!default_encoding_c) goto bad; __PYX_DEFAULT_STRING_ENCODING = (char*) malloc(strlen(default_encoding_c)); if (!__PYX_DEFAULT_STRING_ENCODING) goto bad; strcpy(__PYX_DEFAULT_STRING_ENCODING, default_encoding_c); Py_DECREF(default_encoding); return 0; bad: Py_XDECREF(default_encoding); return -1; } #endif #endif /* Test for GCC > 2.95 */ #if defined(__GNUC__) && (__GNUC__ > 2 || (__GNUC__ == 2 && (__GNUC_MINOR__ > 95))) #define likely(x) __builtin_expect(!!(x), 1) #define unlikely(x) __builtin_expect(!!(x), 0) #else /* !__GNUC__ or GCC < 2.95 */ #define likely(x) (x) #define unlikely(x) (x) #endif /* __GNUC__ */ static PyObject *__pyx_m; static PyObject *__pyx_d; static PyObject *__pyx_b; static PyObject *__pyx_empty_tuple; static PyObject *__pyx_empty_bytes; static int __pyx_lineno; static int __pyx_clineno = 0; static const char * __pyx_cfilenm= __FILE__; static const char *__pyx_filename; static const char *__pyx_f[] = { "src/pygame_sdl2/rect.pyx", "src/pygame_sdl2/rect.pxd", }; /*--- Type declarations ---*/ struct __pyx_obj_11pygame_sdl2_4rect_Rect; struct __pyx_opt_args_11pygame_sdl2_4rect_to_sdl_rect; /* "pygame_sdl2/rect.pxd":31 * * * cdef int to_sdl_rect(rectlike, SDL_Rect *rect, argname=*) except -1 # <<<<<<<<<<<<<< */ struct __pyx_opt_args_11pygame_sdl2_4rect_to_sdl_rect { int __pyx_n; PyObject *argname; }; /* "pygame_sdl2/rect.pxd":21 * from sdl2 cimport * * * cdef class Rect: # <<<<<<<<<<<<<< * # Allow weak references. * cdef object __weakref__ */ struct __pyx_obj_11pygame_sdl2_4rect_Rect { PyObject_HEAD PyObject *__weakref__; int x; int y; int w; int h; }; /* --- Runtime support code (head) --- */ #ifndef CYTHON_REFNANNY #define CYTHON_REFNANNY 0 #endif #if CYTHON_REFNANNY typedef struct { void (*INCREF)(void*, PyObject*, int); void (*DECREF)(void*, PyObject*, int); void (*GOTREF)(void*, PyObject*, int); void (*GIVEREF)(void*, PyObject*, int); void* (*SetupContext)(const char*, int, const char*); void (*FinishContext)(void**); } __Pyx_RefNannyAPIStruct; static __Pyx_RefNannyAPIStruct *__Pyx_RefNanny = NULL; static __Pyx_RefNannyAPIStruct *__Pyx_RefNannyImportAPI(const char *modname); #define __Pyx_RefNannyDeclarations void *__pyx_refnanny = NULL; #ifdef WITH_THREAD #define __Pyx_RefNannySetupContext(name, acquire_gil)\ if (acquire_gil) {\ PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure();\ __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), __LINE__, __FILE__);\ PyGILState_Release(__pyx_gilstate_save);\ } else {\ __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), __LINE__, __FILE__);\ } #else #define __Pyx_RefNannySetupContext(name, acquire_gil)\ __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), __LINE__, __FILE__) #endif #define __Pyx_RefNannyFinishContext()\ __Pyx_RefNanny->FinishContext(&__pyx_refnanny) #define __Pyx_INCREF(r) __Pyx_RefNanny->INCREF(__pyx_refnanny, (PyObject *)(r), __LINE__) #define __Pyx_DECREF(r) __Pyx_RefNanny->DECREF(__pyx_refnanny, (PyObject *)(r), __LINE__) #define __Pyx_GOTREF(r) __Pyx_RefNanny->GOTREF(__pyx_refnanny, (PyObject *)(r), __LINE__) #define __Pyx_GIVEREF(r) __Pyx_RefNanny->GIVEREF(__pyx_refnanny, (PyObject *)(r), __LINE__) #define __Pyx_XINCREF(r) do { if((r) != NULL) {__Pyx_INCREF(r); }} while(0) #define __Pyx_XDECREF(r) do { if((r) != NULL) {__Pyx_DECREF(r); }} while(0) #define __Pyx_XGOTREF(r) do { if((r) != NULL) {__Pyx_GOTREF(r); }} while(0) #define __Pyx_XGIVEREF(r) do { if((r) != NULL) {__Pyx_GIVEREF(r);}} while(0) #else #define __Pyx_RefNannyDeclarations #define __Pyx_RefNannySetupContext(name, acquire_gil) #define __Pyx_RefNannyFinishContext() #define __Pyx_INCREF(r) Py_INCREF(r) #define __Pyx_DECREF(r) Py_DECREF(r) #define __Pyx_GOTREF(r) #define __Pyx_GIVEREF(r) #define __Pyx_XINCREF(r) Py_XINCREF(r) #define __Pyx_XDECREF(r) Py_XDECREF(r) #define __Pyx_XGOTREF(r) #define __Pyx_XGIVEREF(r) #endif #define __Pyx_XDECREF_SET(r, v) do {\ PyObject *tmp = (PyObject *) r;\ r = v; __Pyx_XDECREF(tmp);\ } while (0) #define __Pyx_DECREF_SET(r, v) do {\ PyObject *tmp = (PyObject *) r;\ r = v; __Pyx_DECREF(tmp);\ } while (0) #define __Pyx_CLEAR(r) do { PyObject* tmp = ((PyObject*)(r)); r = NULL; __Pyx_DECREF(tmp);} while(0) #define __Pyx_XCLEAR(r) do { if((r) != NULL) {PyObject* tmp = ((PyObject*)(r)); r = NULL; __Pyx_DECREF(tmp);}} while(0) #if CYTHON_COMPILING_IN_CPYTHON static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStr(PyObject* obj, PyObject* attr_name) { PyTypeObject* tp = Py_TYPE(obj); if (likely(tp->tp_getattro)) return tp->tp_getattro(obj, attr_name); #if PY_MAJOR_VERSION < 3 if (likely(tp->tp_getattr)) return tp->tp_getattr(obj, PyString_AS_STRING(attr_name)); #endif return PyObject_GetAttr(obj, attr_name); } #else #define __Pyx_PyObject_GetAttrStr(o,n) PyObject_GetAttr(o,n) #endif static PyObject *__Pyx_GetBuiltinName(PyObject *name); static CYTHON_INLINE int __Pyx_CheckKeywordStrings(PyObject *kwdict, const char* function_name, int kw_allowed); #define __Pyx_GetItemInt(o, i, type, is_signed, to_py_func, is_list, wraparound, boundscheck)\ (__Pyx_fits_Py_ssize_t(i, type, is_signed) ?\ __Pyx_GetItemInt_Fast(o, (Py_ssize_t)i, is_list, wraparound, boundscheck) :\ (is_list ? (PyErr_SetString(PyExc_IndexError, "list index out of range"), (PyObject*)NULL) :\ __Pyx_GetItemInt_Generic(o, to_py_func(i)))) #define __Pyx_GetItemInt_List(o, i, type, is_signed, to_py_func, is_list, wraparound, boundscheck)\ (__Pyx_fits_Py_ssize_t(i, type, is_signed) ?\ __Pyx_GetItemInt_List_Fast(o, (Py_ssize_t)i, wraparound, boundscheck) :\ (PyErr_SetString(PyExc_IndexError, "list index out of range"), (PyObject*)NULL)) static CYTHON_INLINE PyObject *__Pyx_GetItemInt_List_Fast(PyObject *o, Py_ssize_t i, int wraparound, int boundscheck); #define __Pyx_GetItemInt_Tuple(o, i, type, is_signed, to_py_func, is_list, wraparound, boundscheck)\ (__Pyx_fits_Py_ssize_t(i, type, is_signed) ?\ __Pyx_GetItemInt_Tuple_Fast(o, (Py_ssize_t)i, wraparound, boundscheck) :\ (PyErr_SetString(PyExc_IndexError, "tuple index out of range"), (PyObject*)NULL)) static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Tuple_Fast(PyObject *o, Py_ssize_t i, int wraparound, int boundscheck); static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Generic(PyObject *o, PyObject* j); static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Fast(PyObject *o, Py_ssize_t i, int is_list, int wraparound, int boundscheck); static CYTHON_INLINE int __Pyx_TypeTest(PyObject *obj, PyTypeObject *type); static CYTHON_INLINE void __Pyx_RaiseTooManyValuesError(Py_ssize_t expected); static CYTHON_INLINE void __Pyx_RaiseNeedMoreValuesError(Py_ssize_t index); static CYTHON_INLINE int __Pyx_IterFinish(void); static int __Pyx_IternextUnpackEndCheck(PyObject *retval, Py_ssize_t expected); #if CYTHON_COMPILING_IN_CPYTHON static CYTHON_INLINE PyObject* __Pyx_PyObject_Call(PyObject *func, PyObject *arg, PyObject *kw); #else #define __Pyx_PyObject_Call(func, arg, kw) PyObject_Call(func, arg, kw) #endif static CYTHON_INLINE void __Pyx_ErrRestore(PyObject *type, PyObject *value, PyObject *tb); static CYTHON_INLINE void __Pyx_ErrFetch(PyObject **type, PyObject **value, PyObject **tb); static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, PyObject *cause); static CYTHON_INLINE int __Pyx_ArgTypeTest(PyObject *obj, PyTypeObject *type, int none_allowed, const char *name, int exact); #if CYTHON_COMPILING_IN_CPYTHON static PyObject* __Pyx_PyInt_EqObjC(PyObject *op1, PyObject *op2, long intval, int inplace); #else #define __Pyx_PyInt_EqObjC(op1, op2, intval, inplace)\ PyObject_RichCompare(op1, op2, Py_EQ) #endif #if CYTHON_COMPILING_IN_CPYTHON #define __Pyx_PyObject_DelAttrStr(o,n) __Pyx_PyObject_SetAttrStr(o,n,NULL) static CYTHON_INLINE int __Pyx_PyObject_SetAttrStr(PyObject* obj, PyObject* attr_name, PyObject* value) { PyTypeObject* tp = Py_TYPE(obj); if (likely(tp->tp_setattro)) return tp->tp_setattro(obj, attr_name, value); #if PY_MAJOR_VERSION < 3 if (likely(tp->tp_setattr)) return tp->tp_setattr(obj, PyString_AS_STRING(attr_name), value); #endif return PyObject_SetAttr(obj, attr_name, value); } #else #define __Pyx_PyObject_DelAttrStr(o,n) PyObject_DelAttr(o,n) #define __Pyx_PyObject_SetAttrStr(o,n,v) PyObject_SetAttr(o,n,v) #endif static CYTHON_INLINE long __Pyx_div_long(long, long); #if CYTHON_COMPILING_IN_CPYTHON static CYTHON_INLINE PyObject* __Pyx_PyObject_CallMethO(PyObject *func, PyObject *arg); #endif static CYTHON_INLINE PyObject* __Pyx_PyObject_CallOneArg(PyObject *func, PyObject *arg); #if CYTHON_COMPILING_IN_CPYTHON static CYTHON_INLINE PyObject* __Pyx_PyObject_CallNoArg(PyObject *func); #else #define __Pyx_PyObject_CallNoArg(func) __Pyx_PyObject_Call(func, __pyx_empty_tuple, NULL) #endif static CYTHON_INLINE PyObject *__Pyx_GetModuleGlobalName(PyObject *name); static void __Pyx_RaiseDoubleKeywordsError(const char* func_name, PyObject* kw_name); static int __Pyx_ParseOptionalKeywords(PyObject *kwds, PyObject **argnames[],\ PyObject *kwds2, PyObject *values[], Py_ssize_t num_pos_args,\ const char* function_name); static void __Pyx_RaiseArgtupleInvalid(const char* func_name, int exact, Py_ssize_t num_min, Py_ssize_t num_max, Py_ssize_t num_found); static double __Pyx__PyObject_AsDouble(PyObject* obj); #if CYTHON_COMPILING_IN_PYPY #define __Pyx_PyObject_AsDouble(obj)\ (likely(PyFloat_CheckExact(obj)) ? PyFloat_AS_DOUBLE(obj) :\ likely(PyInt_CheckExact(obj)) ?\ PyFloat_AsDouble(obj) : __Pyx__PyObject_AsDouble(obj)) #else #define __Pyx_PyObject_AsDouble(obj)\ ((likely(PyFloat_CheckExact(obj))) ?\ PyFloat_AS_DOUBLE(obj) : __Pyx__PyObject_AsDouble(obj)) #endif #if CYTHON_COMPILING_IN_CPYTHON static CYTHON_INLINE int __Pyx_PyList_Append(PyObject* list, PyObject* x) { PyListObject* L = (PyListObject*) list; Py_ssize_t len = Py_SIZE(list); if (likely(L->allocated > len) & likely(len > (L->allocated >> 1))) { Py_INCREF(x); PyList_SET_ITEM(list, len, x); Py_SIZE(list) = len+1; return 0; } return PyList_Append(list, x); } #else #define __Pyx_PyList_Append(L,x) PyList_Append(L,x) #endif static PyObject* __Pyx_PyObject_CallMethod0(PyObject* obj, PyObject* method_name); static CYTHON_INLINE void __Pyx_RaiseNoneNotIterableError(void); static void __Pyx_UnpackTupleError(PyObject *, Py_ssize_t index); static CYTHON_INLINE int __Pyx_unpack_tuple2(PyObject* tuple, PyObject** value1, PyObject** value2, int is_tuple, int has_known_size, int decref_tuple); static CYTHON_INLINE PyObject* __Pyx_dict_iterator(PyObject* dict, int is_dict, PyObject* method_name, Py_ssize_t* p_orig_length, int* p_is_dict); static CYTHON_INLINE int __Pyx_dict_iter_next(PyObject* dict_or_iter, Py_ssize_t orig_length, Py_ssize_t* ppos, PyObject** pkey, PyObject** pvalue, PyObject** pitem, int is_dict); static CYTHON_INLINE void __Pyx_ExceptionSave(PyObject **type, PyObject **value, PyObject **tb); static void __Pyx_ExceptionReset(PyObject *type, PyObject *value, PyObject *tb); static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list, int level); typedef struct { int code_line; PyCodeObject* code_object; } __Pyx_CodeObjectCacheEntry; struct __Pyx_CodeObjectCache { int count; int max_count; __Pyx_CodeObjectCacheEntry* entries; }; static struct __Pyx_CodeObjectCache __pyx_code_cache = {0,0,NULL}; static int __pyx_bisect_code_objects(__Pyx_CodeObjectCacheEntry* entries, int count, int code_line); static PyCodeObject *__pyx_find_code_object(int code_line); static void __pyx_insert_code_object(int code_line, PyCodeObject* code_object); static void __Pyx_AddTraceback(const char *funcname, int c_line, int py_line, const char *filename); static CYTHON_INLINE int __Pyx_PyInt_As_int(PyObject *); static CYTHON_INLINE PyObject* __Pyx_PyInt_From_long(long value); static CYTHON_INLINE PyObject* __Pyx_PyInt_From_int(int value); static CYTHON_INLINE long __Pyx_PyInt_As_long(PyObject *); static int __Pyx_check_binary_version(void); static int __Pyx_ExportFunction(const char *name, void (*f)(void), const char *sig); static int __Pyx_InitStrings(__Pyx_StringTabEntry *t); /* Module declarations from 'libc.stdint' */ /* Module declarations from 'libc.string' */ /* Module declarations from 'libc.stdio' */ /* Module declarations from 'libc.stddef' */ /* Module declarations from 'sdl2' */ /* Module declarations from 'pygame_sdl2.rect' */ static PyTypeObject *__pyx_ptype_11pygame_sdl2_4rect_Rect = 0; #define __Pyx_MODULE_NAME "pygame_sdl2.rect" int __pyx_module_is_main_pygame_sdl2__rect = 0; /* Implementation of 'pygame_sdl2.rect' */ static PyObject *__pyx_builtin_TypeError; static PyObject *__pyx_builtin_IndexError; static PyObject *__pyx_builtin_zip; static PyObject *__pyx_builtin_range; static char __pyx_k_h[] = "h"; static char __pyx_k_w[] = "w"; static char __pyx_k_x[] = "x"; static char __pyx_k_y[] = "y"; static char __pyx_k_top[] = "top"; static char __pyx_k_zip[] = "zip"; static char __pyx_k_args[] = "args"; static char __pyx_k_copy[] = "copy"; static char __pyx_k_left[] = "left"; static char __pyx_k_main[] = "__main__"; static char __pyx_k_test[] = "__test__"; static char __pyx_k_other[] = "other"; static char __pyx_k_range[] = "range"; static char __pyx_k_right[] = "right"; static char __pyx_k_width[] = "width"; static char __pyx_k_bottom[] = "bottom"; static char __pyx_k_center[] = "center"; static char __pyx_k_format[] = "format"; static char __pyx_k_height[] = "height"; static char __pyx_k_import[] = "__import__"; static char __pyx_k_centerx[] = "centerx"; static char __pyx_k_centery[] = "centery"; static char __pyx_k_flatten[] = "flatten"; static char __pyx_k_move_ip[] = "move_ip"; static char __pyx_k_topleft[] = "topleft"; static char __pyx_k_clamp_ip[] = "clamp_ip"; static char __pyx_k_union_ip[] = "union_ip"; static char __pyx_k_TypeError[] = "TypeError"; static char __pyx_k_iteritems[] = "iteritems"; static char __pyx_k_IndexError[] = "IndexError"; static char __pyx_k_inflate_ip[] = "inflate_ip"; static char __pyx_k_other_dict[] = "other_dict"; static char __pyx_k_collections[] = "collections"; static char __pyx_k_colliderect[] = "colliderect"; static char __pyx_k_unionall_ip[] = "unionall_ip"; static char __pyx_k_rect_d_d_d_d[] = ""; static char __pyx_k_rects_values[] = "rects_values"; static char __pyx_k_pygame_sdl2_rect[] = "pygame_sdl2.rect"; static char __pyx_k_home_tom_ab_pygame_sdl2_src_pyg[] = "/home/tom/ab/pygame_sdl2/src/pygame_sdl2/rect.pyx"; static char __pyx_k_Argument_must_be_a_rect_style_ob[] = "Argument must be a rect style object."; static char __pyx_k_Argument_must_be_a_rect_style_ob_2[] = "Argument {} must be a rect style object."; static PyObject *__pyx_kp_s_Argument_must_be_a_rect_style_ob; static PyObject *__pyx_kp_s_Argument_must_be_a_rect_style_ob_2; static PyObject *__pyx_n_s_IndexError; static PyObject *__pyx_n_s_TypeError; static PyObject *__pyx_n_s_args; static PyObject *__pyx_n_s_bottom; static PyObject *__pyx_n_s_center; static PyObject *__pyx_n_s_centerx; static PyObject *__pyx_n_s_centery; static PyObject *__pyx_n_s_clamp_ip; static PyObject *__pyx_n_s_collections; static PyObject *__pyx_n_s_colliderect; static PyObject *__pyx_n_s_copy; static PyObject *__pyx_n_s_flatten; static PyObject *__pyx_n_s_format; static PyObject *__pyx_n_s_h; static PyObject *__pyx_n_s_height; static PyObject *__pyx_kp_s_home_tom_ab_pygame_sdl2_src_pyg; static PyObject *__pyx_n_s_import; static PyObject *__pyx_n_s_inflate_ip; static PyObject *__pyx_n_s_iteritems; static PyObject *__pyx_n_s_left; static PyObject *__pyx_n_s_main; static PyObject *__pyx_n_s_move_ip; static PyObject *__pyx_n_s_other; static PyObject *__pyx_n_s_other_dict; static PyObject *__pyx_n_s_pygame_sdl2_rect; static PyObject *__pyx_n_s_range; static PyObject *__pyx_kp_s_rect_d_d_d_d; static PyObject *__pyx_n_s_rects_values; static PyObject *__pyx_n_s_right; static PyObject *__pyx_n_s_test; static PyObject *__pyx_n_s_top; static PyObject *__pyx_n_s_topleft; static PyObject *__pyx_n_s_union_ip; static PyObject *__pyx_n_s_unionall_ip; static PyObject *__pyx_n_s_w; static PyObject *__pyx_n_s_width; static PyObject *__pyx_n_s_x; static PyObject *__pyx_n_s_y; static PyObject *__pyx_n_s_zip; static PyObject *__pyx_pf_11pygame_sdl2_4rect_flatten(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_args); /* proto */ static int __pyx_pf_11pygame_sdl2_4rect_4Rect___init__(struct __pyx_obj_11pygame_sdl2_4rect_Rect *__pyx_v_self, PyObject *__pyx_v_args); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_4rect_4Rect_2__reduce__(struct __pyx_obj_11pygame_sdl2_4rect_Rect *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_4rect_4Rect_4__repr__(struct __pyx_obj_11pygame_sdl2_4rect_Rect *__pyx_v_self); /* proto */ static Py_ssize_t __pyx_pf_11pygame_sdl2_4rect_4Rect_6__len__(CYTHON_UNUSED struct __pyx_obj_11pygame_sdl2_4rect_Rect *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_4rect_4Rect_8__iter__(struct __pyx_obj_11pygame_sdl2_4rect_Rect *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_4rect_4Rect_10__richcmp__(struct __pyx_obj_11pygame_sdl2_4rect_Rect *__pyx_v_a, PyObject *__pyx_v_b, int __pyx_v_op); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_4rect_4Rect_12__getitem__(struct __pyx_obj_11pygame_sdl2_4rect_Rect *__pyx_v_self, PyObject *__pyx_v_key); /* proto */ static int __pyx_pf_11pygame_sdl2_4rect_4Rect_14__setitem__(struct __pyx_obj_11pygame_sdl2_4rect_Rect *__pyx_v_self, PyObject *__pyx_v_key, PyObject *__pyx_v_val); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_4rect_4Rect_4left___get__(struct __pyx_obj_11pygame_sdl2_4rect_Rect *__pyx_v_self); /* proto */ static int __pyx_pf_11pygame_sdl2_4rect_4Rect_4left_2__set__(struct __pyx_obj_11pygame_sdl2_4rect_Rect *__pyx_v_self, PyObject *__pyx_v_val); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_4rect_4Rect_3top___get__(struct __pyx_obj_11pygame_sdl2_4rect_Rect *__pyx_v_self); /* proto */ static int __pyx_pf_11pygame_sdl2_4rect_4Rect_3top_2__set__(struct __pyx_obj_11pygame_sdl2_4rect_Rect *__pyx_v_self, PyObject *__pyx_v_val); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_4rect_4Rect_5width___get__(struct __pyx_obj_11pygame_sdl2_4rect_Rect *__pyx_v_self); /* proto */ static int __pyx_pf_11pygame_sdl2_4rect_4Rect_5width_2__set__(struct __pyx_obj_11pygame_sdl2_4rect_Rect *__pyx_v_self, PyObject *__pyx_v_val); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_4rect_4Rect_6height___get__(struct __pyx_obj_11pygame_sdl2_4rect_Rect *__pyx_v_self); /* proto */ static int __pyx_pf_11pygame_sdl2_4rect_4Rect_6height_2__set__(struct __pyx_obj_11pygame_sdl2_4rect_Rect *__pyx_v_self, PyObject *__pyx_v_val); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_4rect_4Rect_5right___get__(struct __pyx_obj_11pygame_sdl2_4rect_Rect *__pyx_v_self); /* proto */ static int __pyx_pf_11pygame_sdl2_4rect_4Rect_5right_2__set__(struct __pyx_obj_11pygame_sdl2_4rect_Rect *__pyx_v_self, PyObject *__pyx_v_val); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_4rect_4Rect_6bottom___get__(struct __pyx_obj_11pygame_sdl2_4rect_Rect *__pyx_v_self); /* proto */ static int __pyx_pf_11pygame_sdl2_4rect_4Rect_6bottom_2__set__(struct __pyx_obj_11pygame_sdl2_4rect_Rect *__pyx_v_self, PyObject *__pyx_v_val); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_4rect_4Rect_4size___get__(struct __pyx_obj_11pygame_sdl2_4rect_Rect *__pyx_v_self); /* proto */ static int __pyx_pf_11pygame_sdl2_4rect_4Rect_4size_2__set__(struct __pyx_obj_11pygame_sdl2_4rect_Rect *__pyx_v_self, PyObject *__pyx_v_val); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_4rect_4Rect_7topleft___get__(struct __pyx_obj_11pygame_sdl2_4rect_Rect *__pyx_v_self); /* proto */ static int __pyx_pf_11pygame_sdl2_4rect_4Rect_7topleft_2__set__(struct __pyx_obj_11pygame_sdl2_4rect_Rect *__pyx_v_self, PyObject *__pyx_v_val); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_4rect_4Rect_8topright___get__(struct __pyx_obj_11pygame_sdl2_4rect_Rect *__pyx_v_self); /* proto */ static int __pyx_pf_11pygame_sdl2_4rect_4Rect_8topright_2__set__(struct __pyx_obj_11pygame_sdl2_4rect_Rect *__pyx_v_self, PyObject *__pyx_v_val); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_4rect_4Rect_11bottomright___get__(struct __pyx_obj_11pygame_sdl2_4rect_Rect *__pyx_v_self); /* proto */ static int __pyx_pf_11pygame_sdl2_4rect_4Rect_11bottomright_2__set__(struct __pyx_obj_11pygame_sdl2_4rect_Rect *__pyx_v_self, PyObject *__pyx_v_val); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_4rect_4Rect_10bottomleft___get__(struct __pyx_obj_11pygame_sdl2_4rect_Rect *__pyx_v_self); /* proto */ static int __pyx_pf_11pygame_sdl2_4rect_4Rect_10bottomleft_2__set__(struct __pyx_obj_11pygame_sdl2_4rect_Rect *__pyx_v_self, PyObject *__pyx_v_val); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_4rect_4Rect_7centerx___get__(struct __pyx_obj_11pygame_sdl2_4rect_Rect *__pyx_v_self); /* proto */ static int __pyx_pf_11pygame_sdl2_4rect_4Rect_7centerx_2__set__(struct __pyx_obj_11pygame_sdl2_4rect_Rect *__pyx_v_self, PyObject *__pyx_v_val); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_4rect_4Rect_7centery___get__(struct __pyx_obj_11pygame_sdl2_4rect_Rect *__pyx_v_self); /* proto */ static int __pyx_pf_11pygame_sdl2_4rect_4Rect_7centery_2__set__(struct __pyx_obj_11pygame_sdl2_4rect_Rect *__pyx_v_self, PyObject *__pyx_v_val); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_4rect_4Rect_6center___get__(struct __pyx_obj_11pygame_sdl2_4rect_Rect *__pyx_v_self); /* proto */ static int __pyx_pf_11pygame_sdl2_4rect_4Rect_6center_2__set__(struct __pyx_obj_11pygame_sdl2_4rect_Rect *__pyx_v_self, PyObject *__pyx_v_val); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_4rect_4Rect_6midtop___get__(struct __pyx_obj_11pygame_sdl2_4rect_Rect *__pyx_v_self); /* proto */ static int __pyx_pf_11pygame_sdl2_4rect_4Rect_6midtop_2__set__(struct __pyx_obj_11pygame_sdl2_4rect_Rect *__pyx_v_self, PyObject *__pyx_v_val); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_4rect_4Rect_7midleft___get__(struct __pyx_obj_11pygame_sdl2_4rect_Rect *__pyx_v_self); /* proto */ static int __pyx_pf_11pygame_sdl2_4rect_4Rect_7midleft_2__set__(struct __pyx_obj_11pygame_sdl2_4rect_Rect *__pyx_v_self, PyObject *__pyx_v_val); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_4rect_4Rect_9midbottom___get__(struct __pyx_obj_11pygame_sdl2_4rect_Rect *__pyx_v_self); /* proto */ static int __pyx_pf_11pygame_sdl2_4rect_4Rect_9midbottom_2__set__(struct __pyx_obj_11pygame_sdl2_4rect_Rect *__pyx_v_self, PyObject *__pyx_v_val); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_4rect_4Rect_8midright___get__(struct __pyx_obj_11pygame_sdl2_4rect_Rect *__pyx_v_self); /* proto */ static int __pyx_pf_11pygame_sdl2_4rect_4Rect_8midright_2__set__(struct __pyx_obj_11pygame_sdl2_4rect_Rect *__pyx_v_self, PyObject *__pyx_v_val); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_4rect_4Rect_16copy(struct __pyx_obj_11pygame_sdl2_4rect_Rect *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_4rect_4Rect_18move(struct __pyx_obj_11pygame_sdl2_4rect_Rect *__pyx_v_self, PyObject *__pyx_v_args); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_4rect_4Rect_20move_ip(struct __pyx_obj_11pygame_sdl2_4rect_Rect *__pyx_v_self, PyObject *__pyx_v_args); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_4rect_4Rect_22inflate(struct __pyx_obj_11pygame_sdl2_4rect_Rect *__pyx_v_self, PyObject *__pyx_v_args); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_4rect_4Rect_24inflate_ip(struct __pyx_obj_11pygame_sdl2_4rect_Rect *__pyx_v_self, PyObject *__pyx_v_args); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_4rect_4Rect_26clamp(struct __pyx_obj_11pygame_sdl2_4rect_Rect *__pyx_v_self, PyObject *__pyx_v_other); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_4rect_4Rect_28clamp_ip(struct __pyx_obj_11pygame_sdl2_4rect_Rect *__pyx_v_self, PyObject *__pyx_v_other); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_4rect_4Rect_30clip(struct __pyx_obj_11pygame_sdl2_4rect_Rect *__pyx_v_self, PyObject *__pyx_v_other, PyObject *__pyx_v_y, PyObject *__pyx_v_w, PyObject *__pyx_v_h); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_4rect_4Rect_32union(struct __pyx_obj_11pygame_sdl2_4rect_Rect *__pyx_v_self, PyObject *__pyx_v_other); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_4rect_4Rect_34union_ip(struct __pyx_obj_11pygame_sdl2_4rect_Rect *__pyx_v_self, PyObject *__pyx_v_other); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_4rect_4Rect_36unionall(struct __pyx_obj_11pygame_sdl2_4rect_Rect *__pyx_v_self, PyObject *__pyx_v_other_seq); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_4rect_4Rect_38unionall_ip(struct __pyx_obj_11pygame_sdl2_4rect_Rect *__pyx_v_self, PyObject *__pyx_v_other_seq); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_4rect_4Rect_40fit(struct __pyx_obj_11pygame_sdl2_4rect_Rect *__pyx_v_self, PyObject *__pyx_v_other); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_4rect_4Rect_42normalize(struct __pyx_obj_11pygame_sdl2_4rect_Rect *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_4rect_4Rect_44contains(struct __pyx_obj_11pygame_sdl2_4rect_Rect *__pyx_v_self, PyObject *__pyx_v_other); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_4rect_4Rect_46collidepoint(struct __pyx_obj_11pygame_sdl2_4rect_Rect *__pyx_v_self, PyObject *__pyx_v_x, PyObject *__pyx_v_y); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_4rect_4Rect_48colliderect(struct __pyx_obj_11pygame_sdl2_4rect_Rect *__pyx_v_self, PyObject *__pyx_v_other); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_4rect_4Rect_50collidelist(struct __pyx_obj_11pygame_sdl2_4rect_Rect *__pyx_v_self, PyObject *__pyx_v_other_list); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_4rect_4Rect_52collidelistall(struct __pyx_obj_11pygame_sdl2_4rect_Rect *__pyx_v_self, PyObject *__pyx_v_other_list); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_4rect_4Rect_54collidedict(struct __pyx_obj_11pygame_sdl2_4rect_Rect *__pyx_v_self, PyObject *__pyx_v_other_dict, CYTHON_UNUSED PyObject *__pyx_v_rects_values); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_4rect_4Rect_56collidedictall(struct __pyx_obj_11pygame_sdl2_4rect_Rect *__pyx_v_self, PyObject *__pyx_v_other_dict, CYTHON_UNUSED PyObject *__pyx_v_rects_values); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_4rect_4Rect_1x___get__(struct __pyx_obj_11pygame_sdl2_4rect_Rect *__pyx_v_self); /* proto */ static int __pyx_pf_11pygame_sdl2_4rect_4Rect_1x_2__set__(struct __pyx_obj_11pygame_sdl2_4rect_Rect *__pyx_v_self, PyObject *__pyx_v_value); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_4rect_4Rect_1y___get__(struct __pyx_obj_11pygame_sdl2_4rect_Rect *__pyx_v_self); /* proto */ static int __pyx_pf_11pygame_sdl2_4rect_4Rect_1y_2__set__(struct __pyx_obj_11pygame_sdl2_4rect_Rect *__pyx_v_self, PyObject *__pyx_v_value); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_4rect_4Rect_1w___get__(struct __pyx_obj_11pygame_sdl2_4rect_Rect *__pyx_v_self); /* proto */ static int __pyx_pf_11pygame_sdl2_4rect_4Rect_1w_2__set__(struct __pyx_obj_11pygame_sdl2_4rect_Rect *__pyx_v_self, PyObject *__pyx_v_value); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_4rect_4Rect_1h___get__(struct __pyx_obj_11pygame_sdl2_4rect_Rect *__pyx_v_self); /* proto */ static int __pyx_pf_11pygame_sdl2_4rect_4Rect_1h_2__set__(struct __pyx_obj_11pygame_sdl2_4rect_Rect *__pyx_v_self, PyObject *__pyx_v_value); /* proto */ static PyObject *__pyx_tp_new_11pygame_sdl2_4rect_Rect(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ static PyObject *__pyx_int_0; static PyObject *__pyx_int_1; static PyObject *__pyx_int_2; static PyObject *__pyx_int_3; static PyObject *__pyx_int_neg_1; static PyObject *__pyx_tuple_; static PyObject *__pyx_tuple__2; static PyObject *__pyx_tuple__3; static PyObject *__pyx_tuple__4; static PyObject *__pyx_codeobj__5; /* "pygame_sdl2/rect.pyx":22 * import collections * * def flatten(*args): # <<<<<<<<<<<<<< * if len(args) == 1: * return args[0] */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_4rect_1flatten(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static PyMethodDef __pyx_mdef_11pygame_sdl2_4rect_1flatten = {"flatten", (PyCFunction)__pyx_pw_11pygame_sdl2_4rect_1flatten, METH_VARARGS|METH_KEYWORDS, 0}; static PyObject *__pyx_pw_11pygame_sdl2_4rect_1flatten(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_args = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("flatten (wrapper)", 0); if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "flatten", 0))) return NULL; __Pyx_INCREF(__pyx_args); __pyx_v_args = __pyx_args; __pyx_r = __pyx_pf_11pygame_sdl2_4rect_flatten(__pyx_self, __pyx_v_args); /* function exit code */ __Pyx_XDECREF(__pyx_v_args); __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_4rect_flatten(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_args) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations Py_ssize_t __pyx_t_1; int __pyx_t_2; PyObject *__pyx_t_3 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("flatten", 0); /* "pygame_sdl2/rect.pyx":23 * * def flatten(*args): * if len(args) == 1: # <<<<<<<<<<<<<< * return args[0] * else: */ __pyx_t_1 = PyTuple_GET_SIZE(__pyx_v_args); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 23; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_t_2 = ((__pyx_t_1 == 1) != 0); if (__pyx_t_2) { /* "pygame_sdl2/rect.pyx":24 * def flatten(*args): * if len(args) == 1: * return args[0] # <<<<<<<<<<<<<< * else: * return args */ __Pyx_XDECREF(__pyx_r); __pyx_t_3 = __Pyx_GetItemInt_Tuple(__pyx_v_args, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(__pyx_t_3 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 24; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; __Pyx_GOTREF(__pyx_t_3); __pyx_r = __pyx_t_3; __pyx_t_3 = 0; goto __pyx_L0; /* "pygame_sdl2/rect.pyx":23 * * def flatten(*args): * if len(args) == 1: # <<<<<<<<<<<<<< * return args[0] * else: */ } /* "pygame_sdl2/rect.pyx":26 * return args[0] * else: * return args # <<<<<<<<<<<<<< * * cdef class Rect: */ /*else*/ { __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(__pyx_v_args); __pyx_r = __pyx_v_args; goto __pyx_L0; } /* "pygame_sdl2/rect.pyx":22 * import collections * * def flatten(*args): # <<<<<<<<<<<<<< * if len(args) == 1: * return args[0] */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("pygame_sdl2.rect.flatten", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/rect.pyx":30 * cdef class Rect: * * def __init__(self, *args): # <<<<<<<<<<<<<< * * cdef int x, y, w, h */ /* Python wrapper */ static int __pyx_pw_11pygame_sdl2_4rect_4Rect_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static int __pyx_pw_11pygame_sdl2_4rect_4Rect_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_args = 0; int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__init__ (wrapper)", 0); if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "__init__", 0))) return -1; __Pyx_INCREF(__pyx_args); __pyx_v_args = __pyx_args; __pyx_r = __pyx_pf_11pygame_sdl2_4rect_4Rect___init__(((struct __pyx_obj_11pygame_sdl2_4rect_Rect *)__pyx_v_self), __pyx_v_args); /* function exit code */ __Pyx_XDECREF(__pyx_v_args); __Pyx_RefNannyFinishContext(); return __pyx_r; } static int __pyx_pf_11pygame_sdl2_4rect_4Rect___init__(struct __pyx_obj_11pygame_sdl2_4rect_Rect *__pyx_v_self, PyObject *__pyx_v_args) { int __pyx_v_x; int __pyx_v_y; int __pyx_v_w; int __pyx_v_h; int __pyx_v_len_args; struct __pyx_obj_11pygame_sdl2_4rect_Rect *__pyx_v_rect = 0; int __pyx_r; __Pyx_RefNannyDeclarations Py_ssize_t __pyx_t_1; int __pyx_t_2; int __pyx_t_3; PyObject *__pyx_t_4 = NULL; int __pyx_t_5; int __pyx_t_6; PyObject *__pyx_t_7 = NULL; PyObject *__pyx_t_8 = NULL; PyObject *__pyx_t_9 = NULL; PyObject *__pyx_t_10 = NULL; PyObject *__pyx_t_11 = NULL; PyObject *(*__pyx_t_12)(PyObject *); int __pyx_t_13; int __pyx_t_14; int __pyx_t_15; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__init__", 0); /* "pygame_sdl2/rect.pyx":36 * cdef Rect rect * * len_args = len(args) # <<<<<<<<<<<<<< * * if len_args == 1 and isinstance(args[0], Rect): */ __pyx_t_1 = PyTuple_GET_SIZE(__pyx_v_args); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 36; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_v_len_args = __pyx_t_1; /* "pygame_sdl2/rect.pyx":38 * len_args = len(args) * * if len_args == 1 and isinstance(args[0], Rect): # <<<<<<<<<<<<<< * rect = args[0] * x = rect.x */ __pyx_t_3 = ((__pyx_v_len_args == 1) != 0); if (__pyx_t_3) { } else { __pyx_t_2 = __pyx_t_3; goto __pyx_L4_bool_binop_done; } __pyx_t_4 = __Pyx_GetItemInt_Tuple(__pyx_v_args, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(__pyx_t_4 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 38; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; __Pyx_GOTREF(__pyx_t_4); __pyx_t_3 = __Pyx_TypeCheck(__pyx_t_4, __pyx_ptype_11pygame_sdl2_4rect_Rect); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_t_5 = (__pyx_t_3 != 0); __pyx_t_2 = __pyx_t_5; __pyx_L4_bool_binop_done:; if (__pyx_t_2) { /* "pygame_sdl2/rect.pyx":39 * * if len_args == 1 and isinstance(args[0], Rect): * rect = args[0] # <<<<<<<<<<<<<< * x = rect.x * y = rect.y */ __pyx_t_4 = __Pyx_GetItemInt_Tuple(__pyx_v_args, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(__pyx_t_4 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 39; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; __Pyx_GOTREF(__pyx_t_4); if (!(likely(((__pyx_t_4) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_4, __pyx_ptype_11pygame_sdl2_4rect_Rect))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 39; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_v_rect = ((struct __pyx_obj_11pygame_sdl2_4rect_Rect *)__pyx_t_4); __pyx_t_4 = 0; /* "pygame_sdl2/rect.pyx":40 * if len_args == 1 and isinstance(args[0], Rect): * rect = args[0] * x = rect.x # <<<<<<<<<<<<<< * y = rect.y * w = rect.w */ __pyx_t_6 = __pyx_v_rect->x; __pyx_v_x = __pyx_t_6; /* "pygame_sdl2/rect.pyx":41 * rect = args[0] * x = rect.x * y = rect.y # <<<<<<<<<<<<<< * w = rect.w * h = rect.h */ __pyx_t_6 = __pyx_v_rect->y; __pyx_v_y = __pyx_t_6; /* "pygame_sdl2/rect.pyx":42 * x = rect.x * y = rect.y * w = rect.w # <<<<<<<<<<<<<< * h = rect.h * */ __pyx_t_6 = __pyx_v_rect->w; __pyx_v_w = __pyx_t_6; /* "pygame_sdl2/rect.pyx":43 * y = rect.y * w = rect.w * h = rect.h # <<<<<<<<<<<<<< * * elif len_args == 1 and len(args[0]) == 4: */ __pyx_t_6 = __pyx_v_rect->h; __pyx_v_h = __pyx_t_6; /* "pygame_sdl2/rect.pyx":38 * len_args = len(args) * * if len_args == 1 and isinstance(args[0], Rect): # <<<<<<<<<<<<<< * rect = args[0] * x = rect.x */ goto __pyx_L3; } /* "pygame_sdl2/rect.pyx":45 * h = rect.h * * elif len_args == 1 and len(args[0]) == 4: # <<<<<<<<<<<<<< * x, y, w, h = args[0] * */ __pyx_t_5 = ((__pyx_v_len_args == 1) != 0); if (__pyx_t_5) { } else { __pyx_t_2 = __pyx_t_5; goto __pyx_L6_bool_binop_done; } __pyx_t_4 = __Pyx_GetItemInt_Tuple(__pyx_v_args, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(__pyx_t_4 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 45; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; __Pyx_GOTREF(__pyx_t_4); __pyx_t_1 = PyObject_Length(__pyx_t_4); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 45; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_t_5 = ((__pyx_t_1 == 4) != 0); __pyx_t_2 = __pyx_t_5; __pyx_L6_bool_binop_done:; if (__pyx_t_2) { /* "pygame_sdl2/rect.pyx":46 * * elif len_args == 1 and len(args[0]) == 4: * x, y, w, h = args[0] # <<<<<<<<<<<<<< * * elif len_args == 1 and len(args[0]) == 2: */ __pyx_t_4 = __Pyx_GetItemInt_Tuple(__pyx_v_args, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(__pyx_t_4 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 46; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; __Pyx_GOTREF(__pyx_t_4); if ((likely(PyTuple_CheckExact(__pyx_t_4))) || (PyList_CheckExact(__pyx_t_4))) { PyObject* sequence = __pyx_t_4; #if CYTHON_COMPILING_IN_CPYTHON Py_ssize_t size = Py_SIZE(sequence); #else Py_ssize_t size = PySequence_Size(sequence); #endif if (unlikely(size != 4)) { if (size > 4) __Pyx_RaiseTooManyValuesError(4); else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 46; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } #if CYTHON_COMPILING_IN_CPYTHON if (likely(PyTuple_CheckExact(sequence))) { __pyx_t_7 = PyTuple_GET_ITEM(sequence, 0); __pyx_t_8 = PyTuple_GET_ITEM(sequence, 1); __pyx_t_9 = PyTuple_GET_ITEM(sequence, 2); __pyx_t_10 = PyTuple_GET_ITEM(sequence, 3); } else { __pyx_t_7 = PyList_GET_ITEM(sequence, 0); __pyx_t_8 = PyList_GET_ITEM(sequence, 1); __pyx_t_9 = PyList_GET_ITEM(sequence, 2); __pyx_t_10 = PyList_GET_ITEM(sequence, 3); } __Pyx_INCREF(__pyx_t_7); __Pyx_INCREF(__pyx_t_8); __Pyx_INCREF(__pyx_t_9); __Pyx_INCREF(__pyx_t_10); #else { Py_ssize_t i; PyObject** temps[4] = {&__pyx_t_7,&__pyx_t_8,&__pyx_t_9,&__pyx_t_10}; for (i=0; i < 4; i++) { PyObject* item = PySequence_ITEM(sequence, i); if (unlikely(!item)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 46; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(item); *(temps[i]) = item; } } #endif __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; } else { Py_ssize_t index = -1; PyObject** temps[4] = {&__pyx_t_7,&__pyx_t_8,&__pyx_t_9,&__pyx_t_10}; __pyx_t_11 = PyObject_GetIter(__pyx_t_4); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 46; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_11); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_t_12 = Py_TYPE(__pyx_t_11)->tp_iternext; for (index=0; index < 4; index++) { PyObject* item = __pyx_t_12(__pyx_t_11); if (unlikely(!item)) goto __pyx_L8_unpacking_failed; __Pyx_GOTREF(item); *(temps[index]) = item; } if (__Pyx_IternextUnpackEndCheck(__pyx_t_12(__pyx_t_11), 4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 46; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_t_12 = NULL; __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; goto __pyx_L9_unpacking_done; __pyx_L8_unpacking_failed:; __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; __pyx_t_12 = NULL; if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 46; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_L9_unpacking_done:; } __pyx_t_6 = __Pyx_PyInt_As_int(__pyx_t_7); if (unlikely((__pyx_t_6 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 46; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __pyx_t_13 = __Pyx_PyInt_As_int(__pyx_t_8); if (unlikely((__pyx_t_13 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 46; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; __pyx_t_14 = __Pyx_PyInt_As_int(__pyx_t_9); if (unlikely((__pyx_t_14 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 46; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; __pyx_t_15 = __Pyx_PyInt_As_int(__pyx_t_10); if (unlikely((__pyx_t_15 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 46; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; __pyx_v_x = __pyx_t_6; __pyx_v_y = __pyx_t_13; __pyx_v_w = __pyx_t_14; __pyx_v_h = __pyx_t_15; /* "pygame_sdl2/rect.pyx":45 * h = rect.h * * elif len_args == 1 and len(args[0]) == 4: # <<<<<<<<<<<<<< * x, y, w, h = args[0] * */ goto __pyx_L3; } /* "pygame_sdl2/rect.pyx":48 * x, y, w, h = args[0] * * elif len_args == 1 and len(args[0]) == 2: # <<<<<<<<<<<<<< * x, y = args[0] * w = 0 */ __pyx_t_5 = ((__pyx_v_len_args == 1) != 0); if (__pyx_t_5) { } else { __pyx_t_2 = __pyx_t_5; goto __pyx_L10_bool_binop_done; } __pyx_t_4 = __Pyx_GetItemInt_Tuple(__pyx_v_args, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(__pyx_t_4 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 48; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; __Pyx_GOTREF(__pyx_t_4); __pyx_t_1 = PyObject_Length(__pyx_t_4); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 48; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_t_5 = ((__pyx_t_1 == 2) != 0); __pyx_t_2 = __pyx_t_5; __pyx_L10_bool_binop_done:; if (__pyx_t_2) { /* "pygame_sdl2/rect.pyx":49 * * elif len_args == 1 and len(args[0]) == 2: * x, y = args[0] # <<<<<<<<<<<<<< * w = 0 * h = 0 */ __pyx_t_4 = __Pyx_GetItemInt_Tuple(__pyx_v_args, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(__pyx_t_4 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 49; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; __Pyx_GOTREF(__pyx_t_4); if ((likely(PyTuple_CheckExact(__pyx_t_4))) || (PyList_CheckExact(__pyx_t_4))) { PyObject* sequence = __pyx_t_4; #if CYTHON_COMPILING_IN_CPYTHON Py_ssize_t size = Py_SIZE(sequence); #else Py_ssize_t size = PySequence_Size(sequence); #endif if (unlikely(size != 2)) { if (size > 2) __Pyx_RaiseTooManyValuesError(2); else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 49; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } #if CYTHON_COMPILING_IN_CPYTHON if (likely(PyTuple_CheckExact(sequence))) { __pyx_t_10 = PyTuple_GET_ITEM(sequence, 0); __pyx_t_9 = PyTuple_GET_ITEM(sequence, 1); } else { __pyx_t_10 = PyList_GET_ITEM(sequence, 0); __pyx_t_9 = PyList_GET_ITEM(sequence, 1); } __Pyx_INCREF(__pyx_t_10); __Pyx_INCREF(__pyx_t_9); #else __pyx_t_10 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 49; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_10); __pyx_t_9 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 49; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_9); #endif __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; } else { Py_ssize_t index = -1; __pyx_t_8 = PyObject_GetIter(__pyx_t_4); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 49; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_8); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_t_12 = Py_TYPE(__pyx_t_8)->tp_iternext; index = 0; __pyx_t_10 = __pyx_t_12(__pyx_t_8); if (unlikely(!__pyx_t_10)) goto __pyx_L12_unpacking_failed; __Pyx_GOTREF(__pyx_t_10); index = 1; __pyx_t_9 = __pyx_t_12(__pyx_t_8); if (unlikely(!__pyx_t_9)) goto __pyx_L12_unpacking_failed; __Pyx_GOTREF(__pyx_t_9); if (__Pyx_IternextUnpackEndCheck(__pyx_t_12(__pyx_t_8), 2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 49; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_t_12 = NULL; __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; goto __pyx_L13_unpacking_done; __pyx_L12_unpacking_failed:; __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; __pyx_t_12 = NULL; if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 49; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_L13_unpacking_done:; } __pyx_t_15 = __Pyx_PyInt_As_int(__pyx_t_10); if (unlikely((__pyx_t_15 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 49; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; __pyx_t_14 = __Pyx_PyInt_As_int(__pyx_t_9); if (unlikely((__pyx_t_14 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 49; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; __pyx_v_x = __pyx_t_15; __pyx_v_y = __pyx_t_14; /* "pygame_sdl2/rect.pyx":50 * elif len_args == 1 and len(args[0]) == 2: * x, y = args[0] * w = 0 # <<<<<<<<<<<<<< * h = 0 * */ __pyx_v_w = 0; /* "pygame_sdl2/rect.pyx":51 * x, y = args[0] * w = 0 * h = 0 # <<<<<<<<<<<<<< * * elif len_args == 2: */ __pyx_v_h = 0; /* "pygame_sdl2/rect.pyx":48 * x, y, w, h = args[0] * * elif len_args == 1 and len(args[0]) == 2: # <<<<<<<<<<<<<< * x, y = args[0] * w = 0 */ goto __pyx_L3; } /* "pygame_sdl2/rect.pyx":53 * h = 0 * * elif len_args == 2: # <<<<<<<<<<<<<< * x, y = args[0] * w, h = args[1] */ __pyx_t_2 = ((__pyx_v_len_args == 2) != 0); if (__pyx_t_2) { /* "pygame_sdl2/rect.pyx":54 * * elif len_args == 2: * x, y = args[0] # <<<<<<<<<<<<<< * w, h = args[1] * */ __pyx_t_4 = __Pyx_GetItemInt_Tuple(__pyx_v_args, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(__pyx_t_4 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 54; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; __Pyx_GOTREF(__pyx_t_4); if ((likely(PyTuple_CheckExact(__pyx_t_4))) || (PyList_CheckExact(__pyx_t_4))) { PyObject* sequence = __pyx_t_4; #if CYTHON_COMPILING_IN_CPYTHON Py_ssize_t size = Py_SIZE(sequence); #else Py_ssize_t size = PySequence_Size(sequence); #endif if (unlikely(size != 2)) { if (size > 2) __Pyx_RaiseTooManyValuesError(2); else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 54; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } #if CYTHON_COMPILING_IN_CPYTHON if (likely(PyTuple_CheckExact(sequence))) { __pyx_t_9 = PyTuple_GET_ITEM(sequence, 0); __pyx_t_10 = PyTuple_GET_ITEM(sequence, 1); } else { __pyx_t_9 = PyList_GET_ITEM(sequence, 0); __pyx_t_10 = PyList_GET_ITEM(sequence, 1); } __Pyx_INCREF(__pyx_t_9); __Pyx_INCREF(__pyx_t_10); #else __pyx_t_9 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 54; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_9); __pyx_t_10 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 54; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_10); #endif __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; } else { Py_ssize_t index = -1; __pyx_t_8 = PyObject_GetIter(__pyx_t_4); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 54; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_8); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_t_12 = Py_TYPE(__pyx_t_8)->tp_iternext; index = 0; __pyx_t_9 = __pyx_t_12(__pyx_t_8); if (unlikely(!__pyx_t_9)) goto __pyx_L14_unpacking_failed; __Pyx_GOTREF(__pyx_t_9); index = 1; __pyx_t_10 = __pyx_t_12(__pyx_t_8); if (unlikely(!__pyx_t_10)) goto __pyx_L14_unpacking_failed; __Pyx_GOTREF(__pyx_t_10); if (__Pyx_IternextUnpackEndCheck(__pyx_t_12(__pyx_t_8), 2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 54; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_t_12 = NULL; __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; goto __pyx_L15_unpacking_done; __pyx_L14_unpacking_failed:; __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; __pyx_t_12 = NULL; if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 54; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_L15_unpacking_done:; } __pyx_t_14 = __Pyx_PyInt_As_int(__pyx_t_9); if (unlikely((__pyx_t_14 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 54; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; __pyx_t_15 = __Pyx_PyInt_As_int(__pyx_t_10); if (unlikely((__pyx_t_15 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 54; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; __pyx_v_x = __pyx_t_14; __pyx_v_y = __pyx_t_15; /* "pygame_sdl2/rect.pyx":55 * elif len_args == 2: * x, y = args[0] * w, h = args[1] # <<<<<<<<<<<<<< * * elif len_args == 4: */ __pyx_t_4 = __Pyx_GetItemInt_Tuple(__pyx_v_args, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(__pyx_t_4 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 55; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; __Pyx_GOTREF(__pyx_t_4); if ((likely(PyTuple_CheckExact(__pyx_t_4))) || (PyList_CheckExact(__pyx_t_4))) { PyObject* sequence = __pyx_t_4; #if CYTHON_COMPILING_IN_CPYTHON Py_ssize_t size = Py_SIZE(sequence); #else Py_ssize_t size = PySequence_Size(sequence); #endif if (unlikely(size != 2)) { if (size > 2) __Pyx_RaiseTooManyValuesError(2); else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 55; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } #if CYTHON_COMPILING_IN_CPYTHON if (likely(PyTuple_CheckExact(sequence))) { __pyx_t_10 = PyTuple_GET_ITEM(sequence, 0); __pyx_t_9 = PyTuple_GET_ITEM(sequence, 1); } else { __pyx_t_10 = PyList_GET_ITEM(sequence, 0); __pyx_t_9 = PyList_GET_ITEM(sequence, 1); } __Pyx_INCREF(__pyx_t_10); __Pyx_INCREF(__pyx_t_9); #else __pyx_t_10 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 55; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_10); __pyx_t_9 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 55; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_9); #endif __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; } else { Py_ssize_t index = -1; __pyx_t_8 = PyObject_GetIter(__pyx_t_4); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 55; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_8); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_t_12 = Py_TYPE(__pyx_t_8)->tp_iternext; index = 0; __pyx_t_10 = __pyx_t_12(__pyx_t_8); if (unlikely(!__pyx_t_10)) goto __pyx_L16_unpacking_failed; __Pyx_GOTREF(__pyx_t_10); index = 1; __pyx_t_9 = __pyx_t_12(__pyx_t_8); if (unlikely(!__pyx_t_9)) goto __pyx_L16_unpacking_failed; __Pyx_GOTREF(__pyx_t_9); if (__Pyx_IternextUnpackEndCheck(__pyx_t_12(__pyx_t_8), 2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 55; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_t_12 = NULL; __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; goto __pyx_L17_unpacking_done; __pyx_L16_unpacking_failed:; __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; __pyx_t_12 = NULL; if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 55; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_L17_unpacking_done:; } __pyx_t_15 = __Pyx_PyInt_As_int(__pyx_t_10); if (unlikely((__pyx_t_15 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 55; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; __pyx_t_14 = __Pyx_PyInt_As_int(__pyx_t_9); if (unlikely((__pyx_t_14 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 55; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; __pyx_v_w = __pyx_t_15; __pyx_v_h = __pyx_t_14; /* "pygame_sdl2/rect.pyx":53 * h = 0 * * elif len_args == 2: # <<<<<<<<<<<<<< * x, y = args[0] * w, h = args[1] */ goto __pyx_L3; } /* "pygame_sdl2/rect.pyx":57 * w, h = args[1] * * elif len_args == 4: # <<<<<<<<<<<<<< * x, y, w, h = args * */ __pyx_t_2 = ((__pyx_v_len_args == 4) != 0); if (__pyx_t_2) { /* "pygame_sdl2/rect.pyx":58 * * elif len_args == 4: * x, y, w, h = args # <<<<<<<<<<<<<< * * else: */ if (1) { PyObject* sequence = __pyx_v_args; #if CYTHON_COMPILING_IN_CPYTHON Py_ssize_t size = Py_SIZE(sequence); #else Py_ssize_t size = PySequence_Size(sequence); #endif if (unlikely(size != 4)) { if (size > 4) __Pyx_RaiseTooManyValuesError(4); else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 58; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } #if CYTHON_COMPILING_IN_CPYTHON __pyx_t_4 = PyTuple_GET_ITEM(sequence, 0); __pyx_t_9 = PyTuple_GET_ITEM(sequence, 1); __pyx_t_10 = PyTuple_GET_ITEM(sequence, 2); __pyx_t_8 = PyTuple_GET_ITEM(sequence, 3); __Pyx_INCREF(__pyx_t_4); __Pyx_INCREF(__pyx_t_9); __Pyx_INCREF(__pyx_t_10); __Pyx_INCREF(__pyx_t_8); #else { Py_ssize_t i; PyObject** temps[4] = {&__pyx_t_4,&__pyx_t_9,&__pyx_t_10,&__pyx_t_8}; for (i=0; i < 4; i++) { PyObject* item = PySequence_ITEM(sequence, i); if (unlikely(!item)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 58; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(item); *(temps[i]) = item; } } #endif } __pyx_t_14 = __Pyx_PyInt_As_int(__pyx_t_4); if (unlikely((__pyx_t_14 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 58; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_t_15 = __Pyx_PyInt_As_int(__pyx_t_9); if (unlikely((__pyx_t_15 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 58; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; __pyx_t_13 = __Pyx_PyInt_As_int(__pyx_t_10); if (unlikely((__pyx_t_13 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 58; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; __pyx_t_6 = __Pyx_PyInt_As_int(__pyx_t_8); if (unlikely((__pyx_t_6 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 58; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; __pyx_v_x = __pyx_t_14; __pyx_v_y = __pyx_t_15; __pyx_v_w = __pyx_t_13; __pyx_v_h = __pyx_t_6; /* "pygame_sdl2/rect.pyx":57 * w, h = args[1] * * elif len_args == 4: # <<<<<<<<<<<<<< * x, y, w, h = args * */ goto __pyx_L3; } /* "pygame_sdl2/rect.pyx":61 * * else: * raise TypeError("Argument must be a rect style object.") # <<<<<<<<<<<<<< * * self.x = x */ /*else*/ { __pyx_t_8 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple_, NULL); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 61; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_8); __Pyx_Raise(__pyx_t_8, 0, 0, 0); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; {__pyx_filename = __pyx_f[0]; __pyx_lineno = 61; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } __pyx_L3:; /* "pygame_sdl2/rect.pyx":63 * raise TypeError("Argument must be a rect style object.") * * self.x = x # <<<<<<<<<<<<<< * self.y = y * self.w = w */ __pyx_v_self->x = __pyx_v_x; /* "pygame_sdl2/rect.pyx":64 * * self.x = x * self.y = y # <<<<<<<<<<<<<< * self.w = w * self.h = h */ __pyx_v_self->y = __pyx_v_y; /* "pygame_sdl2/rect.pyx":65 * self.x = x * self.y = y * self.w = w # <<<<<<<<<<<<<< * self.h = h * */ __pyx_v_self->w = __pyx_v_w; /* "pygame_sdl2/rect.pyx":66 * self.y = y * self.w = w * self.h = h # <<<<<<<<<<<<<< * * def __reduce__(self): */ __pyx_v_self->h = __pyx_v_h; /* "pygame_sdl2/rect.pyx":30 * cdef class Rect: * * def __init__(self, *args): # <<<<<<<<<<<<<< * * cdef int x, y, w, h */ /* function exit code */ __pyx_r = 0; goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_7); __Pyx_XDECREF(__pyx_t_8); __Pyx_XDECREF(__pyx_t_9); __Pyx_XDECREF(__pyx_t_10); __Pyx_XDECREF(__pyx_t_11); __Pyx_AddTraceback("pygame_sdl2.rect.Rect.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = -1; __pyx_L0:; __Pyx_XDECREF((PyObject *)__pyx_v_rect); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/rect.pyx":68 * self.h = h * * def __reduce__(self): # <<<<<<<<<<<<<< * return (Rect, (self.x, self.y, self.w, self.h)) * */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_4rect_4Rect_3__reduce__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/ static PyObject *__pyx_pw_11pygame_sdl2_4rect_4Rect_3__reduce__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__reduce__ (wrapper)", 0); __pyx_r = __pyx_pf_11pygame_sdl2_4rect_4Rect_2__reduce__(((struct __pyx_obj_11pygame_sdl2_4rect_Rect *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_4rect_4Rect_2__reduce__(struct __pyx_obj_11pygame_sdl2_4rect_Rect *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; PyObject *__pyx_t_5 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__reduce__", 0); /* "pygame_sdl2/rect.pyx":69 * * def __reduce__(self): * return (Rect, (self.x, self.y, self.w, self.h)) # <<<<<<<<<<<<<< * * def __repr__(self): */ __Pyx_XDECREF(__pyx_r); __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_self->x); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 69; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_v_self->y); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 69; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = __Pyx_PyInt_From_int(__pyx_v_self->w); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 69; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = __Pyx_PyInt_From_int(__pyx_v_self->h); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 69; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); __pyx_t_5 = PyTuple_New(4); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 69; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); __Pyx_GIVEREF(__pyx_t_1); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_1); __Pyx_GIVEREF(__pyx_t_2); PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_t_2); __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_5, 2, __pyx_t_3); __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_5, 3, __pyx_t_4); __pyx_t_1 = 0; __pyx_t_2 = 0; __pyx_t_3 = 0; __pyx_t_4 = 0; __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 69; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); __Pyx_INCREF(((PyObject *)__pyx_ptype_11pygame_sdl2_4rect_Rect)); __Pyx_GIVEREF(((PyObject *)__pyx_ptype_11pygame_sdl2_4rect_Rect)); PyTuple_SET_ITEM(__pyx_t_4, 0, ((PyObject *)__pyx_ptype_11pygame_sdl2_4rect_Rect)); __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_5); __pyx_t_5 = 0; __pyx_r = __pyx_t_4; __pyx_t_4 = 0; goto __pyx_L0; /* "pygame_sdl2/rect.pyx":68 * self.h = h * * def __reduce__(self): # <<<<<<<<<<<<<< * return (Rect, (self.x, self.y, self.w, self.h)) * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_5); __Pyx_AddTraceback("pygame_sdl2.rect.Rect.__reduce__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/rect.pyx":71 * return (Rect, (self.x, self.y, self.w, self.h)) * * def __repr__(self): # <<<<<<<<<<<<<< * return "" % (self.x, self.y, self.w, self.h) * */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_4rect_4Rect_5__repr__(PyObject *__pyx_v_self); /*proto*/ static PyObject *__pyx_pw_11pygame_sdl2_4rect_4Rect_5__repr__(PyObject *__pyx_v_self) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__repr__ (wrapper)", 0); __pyx_r = __pyx_pf_11pygame_sdl2_4rect_4Rect_4__repr__(((struct __pyx_obj_11pygame_sdl2_4rect_Rect *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_4rect_4Rect_4__repr__(struct __pyx_obj_11pygame_sdl2_4rect_Rect *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; PyObject *__pyx_t_5 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__repr__", 0); /* "pygame_sdl2/rect.pyx":72 * * def __repr__(self): * return "" % (self.x, self.y, self.w, self.h) # <<<<<<<<<<<<<< * * def __len__(self): */ __Pyx_XDECREF(__pyx_r); __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_self->x); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 72; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_v_self->y); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 72; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = __Pyx_PyInt_From_int(__pyx_v_self->w); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 72; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = __Pyx_PyInt_From_int(__pyx_v_self->h); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 72; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); __pyx_t_5 = PyTuple_New(4); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 72; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); __Pyx_GIVEREF(__pyx_t_1); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_1); __Pyx_GIVEREF(__pyx_t_2); PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_t_2); __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_5, 2, __pyx_t_3); __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_5, 3, __pyx_t_4); __pyx_t_1 = 0; __pyx_t_2 = 0; __pyx_t_3 = 0; __pyx_t_4 = 0; __pyx_t_4 = __Pyx_PyString_Format(__pyx_kp_s_rect_d_d_d_d, __pyx_t_5); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 72; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __pyx_r = __pyx_t_4; __pyx_t_4 = 0; goto __pyx_L0; /* "pygame_sdl2/rect.pyx":71 * return (Rect, (self.x, self.y, self.w, self.h)) * * def __repr__(self): # <<<<<<<<<<<<<< * return "" % (self.x, self.y, self.w, self.h) * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_5); __Pyx_AddTraceback("pygame_sdl2.rect.Rect.__repr__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/rect.pyx":74 * return "" % (self.x, self.y, self.w, self.h) * * def __len__(self): # <<<<<<<<<<<<<< * return 4 * */ /* Python wrapper */ static Py_ssize_t __pyx_pw_11pygame_sdl2_4rect_4Rect_7__len__(PyObject *__pyx_v_self); /*proto*/ static Py_ssize_t __pyx_pw_11pygame_sdl2_4rect_4Rect_7__len__(PyObject *__pyx_v_self) { Py_ssize_t __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__len__ (wrapper)", 0); __pyx_r = __pyx_pf_11pygame_sdl2_4rect_4Rect_6__len__(((struct __pyx_obj_11pygame_sdl2_4rect_Rect *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static Py_ssize_t __pyx_pf_11pygame_sdl2_4rect_4Rect_6__len__(CYTHON_UNUSED struct __pyx_obj_11pygame_sdl2_4rect_Rect *__pyx_v_self) { Py_ssize_t __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__len__", 0); /* "pygame_sdl2/rect.pyx":75 * * def __len__(self): * return 4 # <<<<<<<<<<<<<< * * def __iter__(self): */ __pyx_r = 4; goto __pyx_L0; /* "pygame_sdl2/rect.pyx":74 * return "" % (self.x, self.y, self.w, self.h) * * def __len__(self): # <<<<<<<<<<<<<< * return 4 * */ /* function exit code */ __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/rect.pyx":77 * return 4 * * def __iter__(self): # <<<<<<<<<<<<<< * return iter((self.x, self.y, self.w, self.h)) * */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_4rect_4Rect_9__iter__(PyObject *__pyx_v_self); /*proto*/ static PyObject *__pyx_pw_11pygame_sdl2_4rect_4Rect_9__iter__(PyObject *__pyx_v_self) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__iter__ (wrapper)", 0); __pyx_r = __pyx_pf_11pygame_sdl2_4rect_4Rect_8__iter__(((struct __pyx_obj_11pygame_sdl2_4rect_Rect *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_4rect_4Rect_8__iter__(struct __pyx_obj_11pygame_sdl2_4rect_Rect *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; PyObject *__pyx_t_5 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__iter__", 0); /* "pygame_sdl2/rect.pyx":78 * * def __iter__(self): * return iter((self.x, self.y, self.w, self.h)) # <<<<<<<<<<<<<< * * def __richcmp__(Rect a, b, int op): */ __Pyx_XDECREF(__pyx_r); __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_self->x); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 78; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_v_self->y); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 78; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = __Pyx_PyInt_From_int(__pyx_v_self->w); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 78; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = __Pyx_PyInt_From_int(__pyx_v_self->h); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 78; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); __pyx_t_5 = PyTuple_New(4); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 78; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); __Pyx_GIVEREF(__pyx_t_1); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_1); __Pyx_GIVEREF(__pyx_t_2); PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_t_2); __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_5, 2, __pyx_t_3); __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_5, 3, __pyx_t_4); __pyx_t_1 = 0; __pyx_t_2 = 0; __pyx_t_3 = 0; __pyx_t_4 = 0; __pyx_t_4 = PyObject_GetIter(__pyx_t_5); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 78; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __pyx_r = __pyx_t_4; __pyx_t_4 = 0; goto __pyx_L0; /* "pygame_sdl2/rect.pyx":77 * return 4 * * def __iter__(self): # <<<<<<<<<<<<<< * return iter((self.x, self.y, self.w, self.h)) * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_5); __Pyx_AddTraceback("pygame_sdl2.rect.Rect.__iter__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/rect.pyx":80 * return iter((self.x, self.y, self.w, self.h)) * * def __richcmp__(Rect a, b, int op): # <<<<<<<<<<<<<< * if not isinstance(b, Rect): * b = Rect(b) */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_4rect_4Rect_11__richcmp__(PyObject *__pyx_v_a, PyObject *__pyx_v_b, int __pyx_v_op); /*proto*/ static PyObject *__pyx_pw_11pygame_sdl2_4rect_4Rect_11__richcmp__(PyObject *__pyx_v_a, PyObject *__pyx_v_b, int __pyx_v_op) { CYTHON_UNUSED int __pyx_lineno = 0; CYTHON_UNUSED const char *__pyx_filename = NULL; CYTHON_UNUSED int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__richcmp__ (wrapper)", 0); if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_a), __pyx_ptype_11pygame_sdl2_4rect_Rect, 1, "a", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 80; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_r = __pyx_pf_11pygame_sdl2_4rect_4Rect_10__richcmp__(((struct __pyx_obj_11pygame_sdl2_4rect_Rect *)__pyx_v_a), ((PyObject *)__pyx_v_b), ((int)__pyx_v_op)); /* function exit code */ goto __pyx_L0; __pyx_L1_error:; __pyx_r = NULL; __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_4rect_4Rect_10__richcmp__(struct __pyx_obj_11pygame_sdl2_4rect_Rect *__pyx_v_a, PyObject *__pyx_v_b, int __pyx_v_op) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; int __pyx_t_2; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; PyObject *__pyx_t_5 = NULL; PyObject *__pyx_t_6 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__richcmp__", 0); __Pyx_INCREF(__pyx_v_b); /* "pygame_sdl2/rect.pyx":81 * * def __richcmp__(Rect a, b, int op): * if not isinstance(b, Rect): # <<<<<<<<<<<<<< * b = Rect(b) * if op == 2: */ __pyx_t_1 = __Pyx_TypeCheck(__pyx_v_b, __pyx_ptype_11pygame_sdl2_4rect_Rect); __pyx_t_2 = ((!(__pyx_t_1 != 0)) != 0); if (__pyx_t_2) { /* "pygame_sdl2/rect.pyx":82 * def __richcmp__(Rect a, b, int op): * if not isinstance(b, Rect): * b = Rect(b) # <<<<<<<<<<<<<< * if op == 2: * return a.x == b.x and a.y == b.y and a.w == b.w and a.h == b.h */ __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 82; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __Pyx_INCREF(__pyx_v_b); __Pyx_GIVEREF(__pyx_v_b); PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_b); __pyx_t_4 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_11pygame_sdl2_4rect_Rect), __pyx_t_3, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 82; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF_SET(__pyx_v_b, __pyx_t_4); __pyx_t_4 = 0; /* "pygame_sdl2/rect.pyx":81 * * def __richcmp__(Rect a, b, int op): * if not isinstance(b, Rect): # <<<<<<<<<<<<<< * b = Rect(b) * if op == 2: */ } /* "pygame_sdl2/rect.pyx":83 * if not isinstance(b, Rect): * b = Rect(b) * if op == 2: # <<<<<<<<<<<<<< * return a.x == b.x and a.y == b.y and a.w == b.w and a.h == b.h * */ __pyx_t_2 = ((__pyx_v_op == 2) != 0); if (__pyx_t_2) { /* "pygame_sdl2/rect.pyx":84 * b = Rect(b) * if op == 2: * return a.x == b.x and a.y == b.y and a.w == b.w and a.h == b.h # <<<<<<<<<<<<<< * * def __getitem__(self, key): */ __Pyx_XDECREF(__pyx_r); __pyx_t_3 = __Pyx_PyInt_From_int(__pyx_v_a->x); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 84; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_b, __pyx_n_s_x); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 84; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); __pyx_t_6 = PyObject_RichCompare(__pyx_t_3, __pyx_t_5, Py_EQ); __Pyx_XGOTREF(__pyx_t_6); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 84; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_6); if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 84; __pyx_clineno = __LINE__; goto __pyx_L1_error;} if (__pyx_t_2) { __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; } else { __Pyx_INCREF(__pyx_t_6); __pyx_t_4 = __pyx_t_6; __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; goto __pyx_L5_bool_binop_done; } __pyx_t_6 = __Pyx_PyInt_From_int(__pyx_v_a->y); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 84; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_6); __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_b, __pyx_n_s_y); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 84; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); __pyx_t_3 = PyObject_RichCompare(__pyx_t_6, __pyx_t_5, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 84; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 84; __pyx_clineno = __LINE__; goto __pyx_L1_error;} if (__pyx_t_2) { __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } else { __Pyx_INCREF(__pyx_t_3); __pyx_t_4 = __pyx_t_3; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; goto __pyx_L5_bool_binop_done; } __pyx_t_3 = __Pyx_PyInt_From_int(__pyx_v_a->w); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 84; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_b, __pyx_n_s_w); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 84; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); __pyx_t_6 = PyObject_RichCompare(__pyx_t_3, __pyx_t_5, Py_EQ); __Pyx_XGOTREF(__pyx_t_6); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 84; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_6); if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 84; __pyx_clineno = __LINE__; goto __pyx_L1_error;} if (__pyx_t_2) { __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; } else { __Pyx_INCREF(__pyx_t_6); __pyx_t_4 = __pyx_t_6; __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; goto __pyx_L5_bool_binop_done; } __pyx_t_6 = __Pyx_PyInt_From_int(__pyx_v_a->h); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 84; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_6); __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_b, __pyx_n_s_h); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 84; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); __pyx_t_3 = PyObject_RichCompare(__pyx_t_6, __pyx_t_5, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 84; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_INCREF(__pyx_t_3); __pyx_t_4 = __pyx_t_3; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_L5_bool_binop_done:; __pyx_r = __pyx_t_4; __pyx_t_4 = 0; goto __pyx_L0; /* "pygame_sdl2/rect.pyx":83 * if not isinstance(b, Rect): * b = Rect(b) * if op == 2: # <<<<<<<<<<<<<< * return a.x == b.x and a.y == b.y and a.w == b.w and a.h == b.h * */ } /* "pygame_sdl2/rect.pyx":80 * return iter((self.x, self.y, self.w, self.h)) * * def __richcmp__(Rect a, b, int op): # <<<<<<<<<<<<<< * if not isinstance(b, Rect): * b = Rect(b) */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_5); __Pyx_XDECREF(__pyx_t_6); __Pyx_AddTraceback("pygame_sdl2.rect.Rect.__richcmp__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF(__pyx_v_b); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/rect.pyx":86 * return a.x == b.x and a.y == b.y and a.w == b.w and a.h == b.h * * def __getitem__(self, key): # <<<<<<<<<<<<<< * return (self.x, self.y, self.w, self.h)[key] * */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_4rect_4Rect_13__getitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_key); /*proto*/ static PyObject *__pyx_pw_11pygame_sdl2_4rect_4Rect_13__getitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_key) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__getitem__ (wrapper)", 0); __pyx_r = __pyx_pf_11pygame_sdl2_4rect_4Rect_12__getitem__(((struct __pyx_obj_11pygame_sdl2_4rect_Rect *)__pyx_v_self), ((PyObject *)__pyx_v_key)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_4rect_4Rect_12__getitem__(struct __pyx_obj_11pygame_sdl2_4rect_Rect *__pyx_v_self, PyObject *__pyx_v_key) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; PyObject *__pyx_t_5 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__getitem__", 0); /* "pygame_sdl2/rect.pyx":87 * * def __getitem__(self, key): * return (self.x, self.y, self.w, self.h)[key] # <<<<<<<<<<<<<< * * def __setitem__(self, key, val): */ __Pyx_XDECREF(__pyx_r); __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_self->x); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 87; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_v_self->y); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 87; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = __Pyx_PyInt_From_int(__pyx_v_self->w); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 87; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = __Pyx_PyInt_From_int(__pyx_v_self->h); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 87; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); __pyx_t_5 = PyTuple_New(4); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 87; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); __Pyx_GIVEREF(__pyx_t_1); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_1); __Pyx_GIVEREF(__pyx_t_2); PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_t_2); __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_5, 2, __pyx_t_3); __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_5, 3, __pyx_t_4); __pyx_t_1 = 0; __pyx_t_2 = 0; __pyx_t_3 = 0; __pyx_t_4 = 0; __pyx_t_4 = PyObject_GetItem(__pyx_t_5, __pyx_v_key); if (unlikely(__pyx_t_4 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 87; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __pyx_r = __pyx_t_4; __pyx_t_4 = 0; goto __pyx_L0; /* "pygame_sdl2/rect.pyx":86 * return a.x == b.x and a.y == b.y and a.w == b.w and a.h == b.h * * def __getitem__(self, key): # <<<<<<<<<<<<<< * return (self.x, self.y, self.w, self.h)[key] * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_5); __Pyx_AddTraceback("pygame_sdl2.rect.Rect.__getitem__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/rect.pyx":89 * return (self.x, self.y, self.w, self.h)[key] * * def __setitem__(self, key, val): # <<<<<<<<<<<<<< * if key == 0: * self.x = val */ /* Python wrapper */ static int __pyx_pw_11pygame_sdl2_4rect_4Rect_15__setitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_key, PyObject *__pyx_v_val); /*proto*/ static int __pyx_pw_11pygame_sdl2_4rect_4Rect_15__setitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_key, PyObject *__pyx_v_val) { int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__setitem__ (wrapper)", 0); __pyx_r = __pyx_pf_11pygame_sdl2_4rect_4Rect_14__setitem__(((struct __pyx_obj_11pygame_sdl2_4rect_Rect *)__pyx_v_self), ((PyObject *)__pyx_v_key), ((PyObject *)__pyx_v_val)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static int __pyx_pf_11pygame_sdl2_4rect_4Rect_14__setitem__(struct __pyx_obj_11pygame_sdl2_4rect_Rect *__pyx_v_self, PyObject *__pyx_v_key, PyObject *__pyx_v_val) { int __pyx_r; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_t_2; int __pyx_t_3; PyObject *__pyx_t_4 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__setitem__", 0); /* "pygame_sdl2/rect.pyx":90 * * def __setitem__(self, key, val): * if key == 0: # <<<<<<<<<<<<<< * self.x = val * elif key == 1: */ __pyx_t_1 = __Pyx_PyInt_EqObjC(__pyx_v_key, __pyx_int_0, 0, 0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 90; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 90; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (__pyx_t_2) { /* "pygame_sdl2/rect.pyx":91 * def __setitem__(self, key, val): * if key == 0: * self.x = val # <<<<<<<<<<<<<< * elif key == 1: * self.y = val */ __pyx_t_3 = __Pyx_PyInt_As_int(__pyx_v_val); if (unlikely((__pyx_t_3 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 91; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_v_self->x = __pyx_t_3; /* "pygame_sdl2/rect.pyx":90 * * def __setitem__(self, key, val): * if key == 0: # <<<<<<<<<<<<<< * self.x = val * elif key == 1: */ goto __pyx_L3; } /* "pygame_sdl2/rect.pyx":92 * if key == 0: * self.x = val * elif key == 1: # <<<<<<<<<<<<<< * self.y = val * elif key == 2: */ __pyx_t_1 = __Pyx_PyInt_EqObjC(__pyx_v_key, __pyx_int_1, 1, 0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 92; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 92; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (__pyx_t_2) { /* "pygame_sdl2/rect.pyx":93 * self.x = val * elif key == 1: * self.y = val # <<<<<<<<<<<<<< * elif key == 2: * self.w = val */ __pyx_t_3 = __Pyx_PyInt_As_int(__pyx_v_val); if (unlikely((__pyx_t_3 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 93; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_v_self->y = __pyx_t_3; /* "pygame_sdl2/rect.pyx":92 * if key == 0: * self.x = val * elif key == 1: # <<<<<<<<<<<<<< * self.y = val * elif key == 2: */ goto __pyx_L3; } /* "pygame_sdl2/rect.pyx":94 * elif key == 1: * self.y = val * elif key == 2: # <<<<<<<<<<<<<< * self.w = val * elif key == 3: */ __pyx_t_1 = __Pyx_PyInt_EqObjC(__pyx_v_key, __pyx_int_2, 2, 0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 94; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 94; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (__pyx_t_2) { /* "pygame_sdl2/rect.pyx":95 * self.y = val * elif key == 2: * self.w = val # <<<<<<<<<<<<<< * elif key == 3: * self.h = val */ __pyx_t_3 = __Pyx_PyInt_As_int(__pyx_v_val); if (unlikely((__pyx_t_3 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 95; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_v_self->w = __pyx_t_3; /* "pygame_sdl2/rect.pyx":94 * elif key == 1: * self.y = val * elif key == 2: # <<<<<<<<<<<<<< * self.w = val * elif key == 3: */ goto __pyx_L3; } /* "pygame_sdl2/rect.pyx":96 * elif key == 2: * self.w = val * elif key == 3: # <<<<<<<<<<<<<< * self.h = val * else: */ __pyx_t_1 = __Pyx_PyInt_EqObjC(__pyx_v_key, __pyx_int_3, 3, 0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 96; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 96; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (__pyx_t_2) { /* "pygame_sdl2/rect.pyx":97 * self.w = val * elif key == 3: * self.h = val # <<<<<<<<<<<<<< * else: * raise IndexError(key) */ __pyx_t_3 = __Pyx_PyInt_As_int(__pyx_v_val); if (unlikely((__pyx_t_3 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 97; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_v_self->h = __pyx_t_3; /* "pygame_sdl2/rect.pyx":96 * elif key == 2: * self.w = val * elif key == 3: # <<<<<<<<<<<<<< * self.h = val * else: */ goto __pyx_L3; } /* "pygame_sdl2/rect.pyx":99 * self.h = val * else: * raise IndexError(key) # <<<<<<<<<<<<<< * * property left: */ /*else*/ { __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 99; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __Pyx_INCREF(__pyx_v_key); __Pyx_GIVEREF(__pyx_v_key); PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_key); __pyx_t_4 = __Pyx_PyObject_Call(__pyx_builtin_IndexError, __pyx_t_1, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 99; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_Raise(__pyx_t_4, 0, 0, 0); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; {__pyx_filename = __pyx_f[0]; __pyx_lineno = 99; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } __pyx_L3:; /* "pygame_sdl2/rect.pyx":89 * return (self.x, self.y, self.w, self.h)[key] * * def __setitem__(self, key, val): # <<<<<<<<<<<<<< * if key == 0: * self.x = val */ /* function exit code */ __pyx_r = 0; goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_4); __Pyx_AddTraceback("pygame_sdl2.rect.Rect.__setitem__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = -1; __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/rect.pyx":102 * * property left: * def __get__(self): # <<<<<<<<<<<<<< * return self.x * def __set__(self, val): */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_4rect_4Rect_4left_1__get__(PyObject *__pyx_v_self); /*proto*/ static PyObject *__pyx_pw_11pygame_sdl2_4rect_4Rect_4left_1__get__(PyObject *__pyx_v_self) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); __pyx_r = __pyx_pf_11pygame_sdl2_4rect_4Rect_4left___get__(((struct __pyx_obj_11pygame_sdl2_4rect_Rect *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_4rect_4Rect_4left___get__(struct __pyx_obj_11pygame_sdl2_4rect_Rect *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__get__", 0); /* "pygame_sdl2/rect.pyx":103 * property left: * def __get__(self): * return self.x # <<<<<<<<<<<<<< * def __set__(self, val): * self.x = val */ __Pyx_XDECREF(__pyx_r); __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_self->x); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 103; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "pygame_sdl2/rect.pyx":102 * * property left: * def __get__(self): # <<<<<<<<<<<<<< * return self.x * def __set__(self, val): */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("pygame_sdl2.rect.Rect.left.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/rect.pyx":104 * def __get__(self): * return self.x * def __set__(self, val): # <<<<<<<<<<<<<< * self.x = val * */ /* Python wrapper */ static int __pyx_pw_11pygame_sdl2_4rect_4Rect_4left_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_val); /*proto*/ static int __pyx_pw_11pygame_sdl2_4rect_4Rect_4left_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_val) { int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__set__ (wrapper)", 0); __pyx_r = __pyx_pf_11pygame_sdl2_4rect_4Rect_4left_2__set__(((struct __pyx_obj_11pygame_sdl2_4rect_Rect *)__pyx_v_self), ((PyObject *)__pyx_v_val)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static int __pyx_pf_11pygame_sdl2_4rect_4Rect_4left_2__set__(struct __pyx_obj_11pygame_sdl2_4rect_Rect *__pyx_v_self, PyObject *__pyx_v_val) { int __pyx_r; __Pyx_RefNannyDeclarations int __pyx_t_1; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__set__", 0); /* "pygame_sdl2/rect.pyx":105 * return self.x * def __set__(self, val): * self.x = val # <<<<<<<<<<<<<< * * property top: */ __pyx_t_1 = __Pyx_PyInt_As_int(__pyx_v_val); if (unlikely((__pyx_t_1 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 105; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_v_self->x = __pyx_t_1; /* "pygame_sdl2/rect.pyx":104 * def __get__(self): * return self.x * def __set__(self, val): # <<<<<<<<<<<<<< * self.x = val * */ /* function exit code */ __pyx_r = 0; goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("pygame_sdl2.rect.Rect.left.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = -1; __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/rect.pyx":108 * * property top: * def __get__(self): # <<<<<<<<<<<<<< * return self.y * def __set__(self, val): */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_4rect_4Rect_3top_1__get__(PyObject *__pyx_v_self); /*proto*/ static PyObject *__pyx_pw_11pygame_sdl2_4rect_4Rect_3top_1__get__(PyObject *__pyx_v_self) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); __pyx_r = __pyx_pf_11pygame_sdl2_4rect_4Rect_3top___get__(((struct __pyx_obj_11pygame_sdl2_4rect_Rect *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_4rect_4Rect_3top___get__(struct __pyx_obj_11pygame_sdl2_4rect_Rect *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__get__", 0); /* "pygame_sdl2/rect.pyx":109 * property top: * def __get__(self): * return self.y # <<<<<<<<<<<<<< * def __set__(self, val): * self.y = val */ __Pyx_XDECREF(__pyx_r); __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_self->y); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 109; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "pygame_sdl2/rect.pyx":108 * * property top: * def __get__(self): # <<<<<<<<<<<<<< * return self.y * def __set__(self, val): */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("pygame_sdl2.rect.Rect.top.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/rect.pyx":110 * def __get__(self): * return self.y * def __set__(self, val): # <<<<<<<<<<<<<< * self.y = val * */ /* Python wrapper */ static int __pyx_pw_11pygame_sdl2_4rect_4Rect_3top_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_val); /*proto*/ static int __pyx_pw_11pygame_sdl2_4rect_4Rect_3top_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_val) { int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__set__ (wrapper)", 0); __pyx_r = __pyx_pf_11pygame_sdl2_4rect_4Rect_3top_2__set__(((struct __pyx_obj_11pygame_sdl2_4rect_Rect *)__pyx_v_self), ((PyObject *)__pyx_v_val)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static int __pyx_pf_11pygame_sdl2_4rect_4Rect_3top_2__set__(struct __pyx_obj_11pygame_sdl2_4rect_Rect *__pyx_v_self, PyObject *__pyx_v_val) { int __pyx_r; __Pyx_RefNannyDeclarations int __pyx_t_1; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__set__", 0); /* "pygame_sdl2/rect.pyx":111 * return self.y * def __set__(self, val): * self.y = val # <<<<<<<<<<<<<< * * property width: */ __pyx_t_1 = __Pyx_PyInt_As_int(__pyx_v_val); if (unlikely((__pyx_t_1 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 111; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_v_self->y = __pyx_t_1; /* "pygame_sdl2/rect.pyx":110 * def __get__(self): * return self.y * def __set__(self, val): # <<<<<<<<<<<<<< * self.y = val * */ /* function exit code */ __pyx_r = 0; goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("pygame_sdl2.rect.Rect.top.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = -1; __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/rect.pyx":114 * * property width: * def __get__(self): # <<<<<<<<<<<<<< * return self.w * def __set__(self, val): */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_4rect_4Rect_5width_1__get__(PyObject *__pyx_v_self); /*proto*/ static PyObject *__pyx_pw_11pygame_sdl2_4rect_4Rect_5width_1__get__(PyObject *__pyx_v_self) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); __pyx_r = __pyx_pf_11pygame_sdl2_4rect_4Rect_5width___get__(((struct __pyx_obj_11pygame_sdl2_4rect_Rect *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_4rect_4Rect_5width___get__(struct __pyx_obj_11pygame_sdl2_4rect_Rect *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__get__", 0); /* "pygame_sdl2/rect.pyx":115 * property width: * def __get__(self): * return self.w # <<<<<<<<<<<<<< * def __set__(self, val): * self.w = val */ __Pyx_XDECREF(__pyx_r); __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_self->w); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 115; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "pygame_sdl2/rect.pyx":114 * * property width: * def __get__(self): # <<<<<<<<<<<<<< * return self.w * def __set__(self, val): */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("pygame_sdl2.rect.Rect.width.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/rect.pyx":116 * def __get__(self): * return self.w * def __set__(self, val): # <<<<<<<<<<<<<< * self.w = val * */ /* Python wrapper */ static int __pyx_pw_11pygame_sdl2_4rect_4Rect_5width_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_val); /*proto*/ static int __pyx_pw_11pygame_sdl2_4rect_4Rect_5width_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_val) { int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__set__ (wrapper)", 0); __pyx_r = __pyx_pf_11pygame_sdl2_4rect_4Rect_5width_2__set__(((struct __pyx_obj_11pygame_sdl2_4rect_Rect *)__pyx_v_self), ((PyObject *)__pyx_v_val)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static int __pyx_pf_11pygame_sdl2_4rect_4Rect_5width_2__set__(struct __pyx_obj_11pygame_sdl2_4rect_Rect *__pyx_v_self, PyObject *__pyx_v_val) { int __pyx_r; __Pyx_RefNannyDeclarations int __pyx_t_1; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__set__", 0); /* "pygame_sdl2/rect.pyx":117 * return self.w * def __set__(self, val): * self.w = val # <<<<<<<<<<<<<< * * property height: */ __pyx_t_1 = __Pyx_PyInt_As_int(__pyx_v_val); if (unlikely((__pyx_t_1 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 117; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_v_self->w = __pyx_t_1; /* "pygame_sdl2/rect.pyx":116 * def __get__(self): * return self.w * def __set__(self, val): # <<<<<<<<<<<<<< * self.w = val * */ /* function exit code */ __pyx_r = 0; goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("pygame_sdl2.rect.Rect.width.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = -1; __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/rect.pyx":120 * * property height: * def __get__(self): # <<<<<<<<<<<<<< * return self.h * def __set__(self, val): */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_4rect_4Rect_6height_1__get__(PyObject *__pyx_v_self); /*proto*/ static PyObject *__pyx_pw_11pygame_sdl2_4rect_4Rect_6height_1__get__(PyObject *__pyx_v_self) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); __pyx_r = __pyx_pf_11pygame_sdl2_4rect_4Rect_6height___get__(((struct __pyx_obj_11pygame_sdl2_4rect_Rect *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_4rect_4Rect_6height___get__(struct __pyx_obj_11pygame_sdl2_4rect_Rect *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__get__", 0); /* "pygame_sdl2/rect.pyx":121 * property height: * def __get__(self): * return self.h # <<<<<<<<<<<<<< * def __set__(self, val): * self.h = val */ __Pyx_XDECREF(__pyx_r); __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_self->h); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 121; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "pygame_sdl2/rect.pyx":120 * * property height: * def __get__(self): # <<<<<<<<<<<<<< * return self.h * def __set__(self, val): */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("pygame_sdl2.rect.Rect.height.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/rect.pyx":122 * def __get__(self): * return self.h * def __set__(self, val): # <<<<<<<<<<<<<< * self.h = val * */ /* Python wrapper */ static int __pyx_pw_11pygame_sdl2_4rect_4Rect_6height_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_val); /*proto*/ static int __pyx_pw_11pygame_sdl2_4rect_4Rect_6height_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_val) { int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__set__ (wrapper)", 0); __pyx_r = __pyx_pf_11pygame_sdl2_4rect_4Rect_6height_2__set__(((struct __pyx_obj_11pygame_sdl2_4rect_Rect *)__pyx_v_self), ((PyObject *)__pyx_v_val)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static int __pyx_pf_11pygame_sdl2_4rect_4Rect_6height_2__set__(struct __pyx_obj_11pygame_sdl2_4rect_Rect *__pyx_v_self, PyObject *__pyx_v_val) { int __pyx_r; __Pyx_RefNannyDeclarations int __pyx_t_1; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__set__", 0); /* "pygame_sdl2/rect.pyx":123 * return self.h * def __set__(self, val): * self.h = val # <<<<<<<<<<<<<< * * property right: */ __pyx_t_1 = __Pyx_PyInt_As_int(__pyx_v_val); if (unlikely((__pyx_t_1 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 123; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_v_self->h = __pyx_t_1; /* "pygame_sdl2/rect.pyx":122 * def __get__(self): * return self.h * def __set__(self, val): # <<<<<<<<<<<<<< * self.h = val * */ /* function exit code */ __pyx_r = 0; goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("pygame_sdl2.rect.Rect.height.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = -1; __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/rect.pyx":126 * * property right: * def __get__(self): # <<<<<<<<<<<<<< * return self.x + self.width * def __set__(self, val): */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_4rect_4Rect_5right_1__get__(PyObject *__pyx_v_self); /*proto*/ static PyObject *__pyx_pw_11pygame_sdl2_4rect_4Rect_5right_1__get__(PyObject *__pyx_v_self) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); __pyx_r = __pyx_pf_11pygame_sdl2_4rect_4Rect_5right___get__(((struct __pyx_obj_11pygame_sdl2_4rect_Rect *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_4rect_4Rect_5right___get__(struct __pyx_obj_11pygame_sdl2_4rect_Rect *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__get__", 0); /* "pygame_sdl2/rect.pyx":127 * property right: * def __get__(self): * return self.x + self.width # <<<<<<<<<<<<<< * def __set__(self, val): * self.x += val - self.right */ __Pyx_XDECREF(__pyx_r); __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_self->x); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 127; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_width); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 127; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = PyNumber_Add(__pyx_t_1, __pyx_t_2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 127; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_r = __pyx_t_3; __pyx_t_3 = 0; goto __pyx_L0; /* "pygame_sdl2/rect.pyx":126 * * property right: * def __get__(self): # <<<<<<<<<<<<<< * return self.x + self.width * def __set__(self, val): */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("pygame_sdl2.rect.Rect.right.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/rect.pyx":128 * def __get__(self): * return self.x + self.width * def __set__(self, val): # <<<<<<<<<<<<<< * self.x += val - self.right * */ /* Python wrapper */ static int __pyx_pw_11pygame_sdl2_4rect_4Rect_5right_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_val); /*proto*/ static int __pyx_pw_11pygame_sdl2_4rect_4Rect_5right_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_val) { int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__set__ (wrapper)", 0); __pyx_r = __pyx_pf_11pygame_sdl2_4rect_4Rect_5right_2__set__(((struct __pyx_obj_11pygame_sdl2_4rect_Rect *)__pyx_v_self), ((PyObject *)__pyx_v_val)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static int __pyx_pf_11pygame_sdl2_4rect_4Rect_5right_2__set__(struct __pyx_obj_11pygame_sdl2_4rect_Rect *__pyx_v_self, PyObject *__pyx_v_val) { int __pyx_r; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; int __pyx_t_4; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__set__", 0); /* "pygame_sdl2/rect.pyx":129 * return self.x + self.width * def __set__(self, val): * self.x += val - self.right # <<<<<<<<<<<<<< * * property bottom: */ __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_self->x); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 129; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_right); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 129; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = PyNumber_Subtract(__pyx_v_val, __pyx_t_2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 129; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_2 = PyNumber_InPlaceAdd(__pyx_t_1, __pyx_t_3); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 129; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_4 = __Pyx_PyInt_As_int(__pyx_t_2); if (unlikely((__pyx_t_4 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 129; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_v_self->x = __pyx_t_4; /* "pygame_sdl2/rect.pyx":128 * def __get__(self): * return self.x + self.width * def __set__(self, val): # <<<<<<<<<<<<<< * self.x += val - self.right * */ /* function exit code */ __pyx_r = 0; goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("pygame_sdl2.rect.Rect.right.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = -1; __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/rect.pyx":132 * * property bottom: * def __get__(self): # <<<<<<<<<<<<<< * return self.y + self.height * def __set__(self, val): */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_4rect_4Rect_6bottom_1__get__(PyObject *__pyx_v_self); /*proto*/ static PyObject *__pyx_pw_11pygame_sdl2_4rect_4Rect_6bottom_1__get__(PyObject *__pyx_v_self) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); __pyx_r = __pyx_pf_11pygame_sdl2_4rect_4Rect_6bottom___get__(((struct __pyx_obj_11pygame_sdl2_4rect_Rect *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_4rect_4Rect_6bottom___get__(struct __pyx_obj_11pygame_sdl2_4rect_Rect *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__get__", 0); /* "pygame_sdl2/rect.pyx":133 * property bottom: * def __get__(self): * return self.y + self.height # <<<<<<<<<<<<<< * def __set__(self, val): * self.y += val - self.bottom */ __Pyx_XDECREF(__pyx_r); __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_self->y); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 133; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_height); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 133; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = PyNumber_Add(__pyx_t_1, __pyx_t_2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 133; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_r = __pyx_t_3; __pyx_t_3 = 0; goto __pyx_L0; /* "pygame_sdl2/rect.pyx":132 * * property bottom: * def __get__(self): # <<<<<<<<<<<<<< * return self.y + self.height * def __set__(self, val): */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("pygame_sdl2.rect.Rect.bottom.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/rect.pyx":134 * def __get__(self): * return self.y + self.height * def __set__(self, val): # <<<<<<<<<<<<<< * self.y += val - self.bottom * */ /* Python wrapper */ static int __pyx_pw_11pygame_sdl2_4rect_4Rect_6bottom_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_val); /*proto*/ static int __pyx_pw_11pygame_sdl2_4rect_4Rect_6bottom_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_val) { int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__set__ (wrapper)", 0); __pyx_r = __pyx_pf_11pygame_sdl2_4rect_4Rect_6bottom_2__set__(((struct __pyx_obj_11pygame_sdl2_4rect_Rect *)__pyx_v_self), ((PyObject *)__pyx_v_val)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static int __pyx_pf_11pygame_sdl2_4rect_4Rect_6bottom_2__set__(struct __pyx_obj_11pygame_sdl2_4rect_Rect *__pyx_v_self, PyObject *__pyx_v_val) { int __pyx_r; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; int __pyx_t_4; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__set__", 0); /* "pygame_sdl2/rect.pyx":135 * return self.y + self.height * def __set__(self, val): * self.y += val - self.bottom # <<<<<<<<<<<<<< * * property size: */ __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_self->y); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 135; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_bottom); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 135; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = PyNumber_Subtract(__pyx_v_val, __pyx_t_2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 135; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_2 = PyNumber_InPlaceAdd(__pyx_t_1, __pyx_t_3); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 135; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_4 = __Pyx_PyInt_As_int(__pyx_t_2); if (unlikely((__pyx_t_4 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 135; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_v_self->y = __pyx_t_4; /* "pygame_sdl2/rect.pyx":134 * def __get__(self): * return self.y + self.height * def __set__(self, val): # <<<<<<<<<<<<<< * self.y += val - self.bottom * */ /* function exit code */ __pyx_r = 0; goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("pygame_sdl2.rect.Rect.bottom.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = -1; __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/rect.pyx":138 * * property size: * def __get__(self): # <<<<<<<<<<<<<< * return (self.w, self.h) * def __set__(self, val): */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_4rect_4Rect_4size_1__get__(PyObject *__pyx_v_self); /*proto*/ static PyObject *__pyx_pw_11pygame_sdl2_4rect_4Rect_4size_1__get__(PyObject *__pyx_v_self) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); __pyx_r = __pyx_pf_11pygame_sdl2_4rect_4Rect_4size___get__(((struct __pyx_obj_11pygame_sdl2_4rect_Rect *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_4rect_4Rect_4size___get__(struct __pyx_obj_11pygame_sdl2_4rect_Rect *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__get__", 0); /* "pygame_sdl2/rect.pyx":139 * property size: * def __get__(self): * return (self.w, self.h) # <<<<<<<<<<<<<< * def __set__(self, val): * self.w, self.h = val */ __Pyx_XDECREF(__pyx_r); __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_self->w); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 139; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_v_self->h); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 139; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 139; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __Pyx_GIVEREF(__pyx_t_1); PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_1); __Pyx_GIVEREF(__pyx_t_2); PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_2); __pyx_t_1 = 0; __pyx_t_2 = 0; __pyx_r = __pyx_t_3; __pyx_t_3 = 0; goto __pyx_L0; /* "pygame_sdl2/rect.pyx":138 * * property size: * def __get__(self): # <<<<<<<<<<<<<< * return (self.w, self.h) * def __set__(self, val): */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("pygame_sdl2.rect.Rect.size.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/rect.pyx":140 * def __get__(self): * return (self.w, self.h) * def __set__(self, val): # <<<<<<<<<<<<<< * self.w, self.h = val * */ /* Python wrapper */ static int __pyx_pw_11pygame_sdl2_4rect_4Rect_4size_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_val); /*proto*/ static int __pyx_pw_11pygame_sdl2_4rect_4Rect_4size_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_val) { int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__set__ (wrapper)", 0); __pyx_r = __pyx_pf_11pygame_sdl2_4rect_4Rect_4size_2__set__(((struct __pyx_obj_11pygame_sdl2_4rect_Rect *)__pyx_v_self), ((PyObject *)__pyx_v_val)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static int __pyx_pf_11pygame_sdl2_4rect_4Rect_4size_2__set__(struct __pyx_obj_11pygame_sdl2_4rect_Rect *__pyx_v_self, PyObject *__pyx_v_val) { int __pyx_r; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; PyObject *(*__pyx_t_4)(PyObject *); int __pyx_t_5; int __pyx_t_6; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__set__", 0); /* "pygame_sdl2/rect.pyx":141 * return (self.w, self.h) * def __set__(self, val): * self.w, self.h = val # <<<<<<<<<<<<<< * * property topleft: */ if ((likely(PyTuple_CheckExact(__pyx_v_val))) || (PyList_CheckExact(__pyx_v_val))) { PyObject* sequence = __pyx_v_val; #if CYTHON_COMPILING_IN_CPYTHON Py_ssize_t size = Py_SIZE(sequence); #else Py_ssize_t size = PySequence_Size(sequence); #endif if (unlikely(size != 2)) { if (size > 2) __Pyx_RaiseTooManyValuesError(2); else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 141; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } #if CYTHON_COMPILING_IN_CPYTHON if (likely(PyTuple_CheckExact(sequence))) { __pyx_t_1 = PyTuple_GET_ITEM(sequence, 0); __pyx_t_2 = PyTuple_GET_ITEM(sequence, 1); } else { __pyx_t_1 = PyList_GET_ITEM(sequence, 0); __pyx_t_2 = PyList_GET_ITEM(sequence, 1); } __Pyx_INCREF(__pyx_t_1); __Pyx_INCREF(__pyx_t_2); #else __pyx_t_1 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 141; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 141; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); #endif } else { Py_ssize_t index = -1; __pyx_t_3 = PyObject_GetIter(__pyx_v_val); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 141; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = Py_TYPE(__pyx_t_3)->tp_iternext; index = 0; __pyx_t_1 = __pyx_t_4(__pyx_t_3); if (unlikely(!__pyx_t_1)) goto __pyx_L3_unpacking_failed; __Pyx_GOTREF(__pyx_t_1); index = 1; __pyx_t_2 = __pyx_t_4(__pyx_t_3); if (unlikely(!__pyx_t_2)) goto __pyx_L3_unpacking_failed; __Pyx_GOTREF(__pyx_t_2); if (__Pyx_IternextUnpackEndCheck(__pyx_t_4(__pyx_t_3), 2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 141; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_t_4 = NULL; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; goto __pyx_L4_unpacking_done; __pyx_L3_unpacking_failed:; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_4 = NULL; if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 141; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_L4_unpacking_done:; } __pyx_t_5 = __Pyx_PyInt_As_int(__pyx_t_1); if (unlikely((__pyx_t_5 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 141; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_6 = __Pyx_PyInt_As_int(__pyx_t_2); if (unlikely((__pyx_t_6 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 141; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_v_self->w = __pyx_t_5; __pyx_v_self->h = __pyx_t_6; /* "pygame_sdl2/rect.pyx":140 * def __get__(self): * return (self.w, self.h) * def __set__(self, val): # <<<<<<<<<<<<<< * self.w, self.h = val * */ /* function exit code */ __pyx_r = 0; goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("pygame_sdl2.rect.Rect.size.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = -1; __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/rect.pyx":144 * * property topleft: * def __get__(self): # <<<<<<<<<<<<<< * return (self.left, self.top) * def __set__(self, val): */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_4rect_4Rect_7topleft_1__get__(PyObject *__pyx_v_self); /*proto*/ static PyObject *__pyx_pw_11pygame_sdl2_4rect_4Rect_7topleft_1__get__(PyObject *__pyx_v_self) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); __pyx_r = __pyx_pf_11pygame_sdl2_4rect_4Rect_7topleft___get__(((struct __pyx_obj_11pygame_sdl2_4rect_Rect *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_4rect_4Rect_7topleft___get__(struct __pyx_obj_11pygame_sdl2_4rect_Rect *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__get__", 0); /* "pygame_sdl2/rect.pyx":145 * property topleft: * def __get__(self): * return (self.left, self.top) # <<<<<<<<<<<<<< * def __set__(self, val): * self.left, self.top = val */ __Pyx_XDECREF(__pyx_r); __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_left); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 145; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_top); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 145; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 145; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __Pyx_GIVEREF(__pyx_t_1); PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_1); __Pyx_GIVEREF(__pyx_t_2); PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_2); __pyx_t_1 = 0; __pyx_t_2 = 0; __pyx_r = __pyx_t_3; __pyx_t_3 = 0; goto __pyx_L0; /* "pygame_sdl2/rect.pyx":144 * * property topleft: * def __get__(self): # <<<<<<<<<<<<<< * return (self.left, self.top) * def __set__(self, val): */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("pygame_sdl2.rect.Rect.topleft.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/rect.pyx":146 * def __get__(self): * return (self.left, self.top) * def __set__(self, val): # <<<<<<<<<<<<<< * self.left, self.top = val * */ /* Python wrapper */ static int __pyx_pw_11pygame_sdl2_4rect_4Rect_7topleft_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_val); /*proto*/ static int __pyx_pw_11pygame_sdl2_4rect_4Rect_7topleft_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_val) { int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__set__ (wrapper)", 0); __pyx_r = __pyx_pf_11pygame_sdl2_4rect_4Rect_7topleft_2__set__(((struct __pyx_obj_11pygame_sdl2_4rect_Rect *)__pyx_v_self), ((PyObject *)__pyx_v_val)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static int __pyx_pf_11pygame_sdl2_4rect_4Rect_7topleft_2__set__(struct __pyx_obj_11pygame_sdl2_4rect_Rect *__pyx_v_self, PyObject *__pyx_v_val) { int __pyx_r; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; PyObject *(*__pyx_t_4)(PyObject *); int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__set__", 0); /* "pygame_sdl2/rect.pyx":147 * return (self.left, self.top) * def __set__(self, val): * self.left, self.top = val # <<<<<<<<<<<<<< * * property topright: */ if ((likely(PyTuple_CheckExact(__pyx_v_val))) || (PyList_CheckExact(__pyx_v_val))) { PyObject* sequence = __pyx_v_val; #if CYTHON_COMPILING_IN_CPYTHON Py_ssize_t size = Py_SIZE(sequence); #else Py_ssize_t size = PySequence_Size(sequence); #endif if (unlikely(size != 2)) { if (size > 2) __Pyx_RaiseTooManyValuesError(2); else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 147; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } #if CYTHON_COMPILING_IN_CPYTHON if (likely(PyTuple_CheckExact(sequence))) { __pyx_t_1 = PyTuple_GET_ITEM(sequence, 0); __pyx_t_2 = PyTuple_GET_ITEM(sequence, 1); } else { __pyx_t_1 = PyList_GET_ITEM(sequence, 0); __pyx_t_2 = PyList_GET_ITEM(sequence, 1); } __Pyx_INCREF(__pyx_t_1); __Pyx_INCREF(__pyx_t_2); #else __pyx_t_1 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 147; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 147; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); #endif } else { Py_ssize_t index = -1; __pyx_t_3 = PyObject_GetIter(__pyx_v_val); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 147; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = Py_TYPE(__pyx_t_3)->tp_iternext; index = 0; __pyx_t_1 = __pyx_t_4(__pyx_t_3); if (unlikely(!__pyx_t_1)) goto __pyx_L3_unpacking_failed; __Pyx_GOTREF(__pyx_t_1); index = 1; __pyx_t_2 = __pyx_t_4(__pyx_t_3); if (unlikely(!__pyx_t_2)) goto __pyx_L3_unpacking_failed; __Pyx_GOTREF(__pyx_t_2); if (__Pyx_IternextUnpackEndCheck(__pyx_t_4(__pyx_t_3), 2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 147; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_t_4 = NULL; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; goto __pyx_L4_unpacking_done; __pyx_L3_unpacking_failed:; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_4 = NULL; if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 147; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_L4_unpacking_done:; } if (__Pyx_PyObject_SetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_left, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 147; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (__Pyx_PyObject_SetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_top, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 147; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "pygame_sdl2/rect.pyx":146 * def __get__(self): * return (self.left, self.top) * def __set__(self, val): # <<<<<<<<<<<<<< * self.left, self.top = val * */ /* function exit code */ __pyx_r = 0; goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("pygame_sdl2.rect.Rect.topleft.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = -1; __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/rect.pyx":150 * * property topright: * def __get__(self): # <<<<<<<<<<<<<< * return (self.right, self.top) * def __set__(self, val): */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_4rect_4Rect_8topright_1__get__(PyObject *__pyx_v_self); /*proto*/ static PyObject *__pyx_pw_11pygame_sdl2_4rect_4Rect_8topright_1__get__(PyObject *__pyx_v_self) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); __pyx_r = __pyx_pf_11pygame_sdl2_4rect_4Rect_8topright___get__(((struct __pyx_obj_11pygame_sdl2_4rect_Rect *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_4rect_4Rect_8topright___get__(struct __pyx_obj_11pygame_sdl2_4rect_Rect *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__get__", 0); /* "pygame_sdl2/rect.pyx":151 * property topright: * def __get__(self): * return (self.right, self.top) # <<<<<<<<<<<<<< * def __set__(self, val): * self.right, self.top = val */ __Pyx_XDECREF(__pyx_r); __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_right); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 151; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_top); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 151; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 151; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __Pyx_GIVEREF(__pyx_t_1); PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_1); __Pyx_GIVEREF(__pyx_t_2); PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_2); __pyx_t_1 = 0; __pyx_t_2 = 0; __pyx_r = __pyx_t_3; __pyx_t_3 = 0; goto __pyx_L0; /* "pygame_sdl2/rect.pyx":150 * * property topright: * def __get__(self): # <<<<<<<<<<<<<< * return (self.right, self.top) * def __set__(self, val): */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("pygame_sdl2.rect.Rect.topright.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/rect.pyx":152 * def __get__(self): * return (self.right, self.top) * def __set__(self, val): # <<<<<<<<<<<<<< * self.right, self.top = val * */ /* Python wrapper */ static int __pyx_pw_11pygame_sdl2_4rect_4Rect_8topright_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_val); /*proto*/ static int __pyx_pw_11pygame_sdl2_4rect_4Rect_8topright_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_val) { int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__set__ (wrapper)", 0); __pyx_r = __pyx_pf_11pygame_sdl2_4rect_4Rect_8topright_2__set__(((struct __pyx_obj_11pygame_sdl2_4rect_Rect *)__pyx_v_self), ((PyObject *)__pyx_v_val)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static int __pyx_pf_11pygame_sdl2_4rect_4Rect_8topright_2__set__(struct __pyx_obj_11pygame_sdl2_4rect_Rect *__pyx_v_self, PyObject *__pyx_v_val) { int __pyx_r; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; PyObject *(*__pyx_t_4)(PyObject *); int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__set__", 0); /* "pygame_sdl2/rect.pyx":153 * return (self.right, self.top) * def __set__(self, val): * self.right, self.top = val # <<<<<<<<<<<<<< * * property bottomright: */ if ((likely(PyTuple_CheckExact(__pyx_v_val))) || (PyList_CheckExact(__pyx_v_val))) { PyObject* sequence = __pyx_v_val; #if CYTHON_COMPILING_IN_CPYTHON Py_ssize_t size = Py_SIZE(sequence); #else Py_ssize_t size = PySequence_Size(sequence); #endif if (unlikely(size != 2)) { if (size > 2) __Pyx_RaiseTooManyValuesError(2); else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 153; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } #if CYTHON_COMPILING_IN_CPYTHON if (likely(PyTuple_CheckExact(sequence))) { __pyx_t_1 = PyTuple_GET_ITEM(sequence, 0); __pyx_t_2 = PyTuple_GET_ITEM(sequence, 1); } else { __pyx_t_1 = PyList_GET_ITEM(sequence, 0); __pyx_t_2 = PyList_GET_ITEM(sequence, 1); } __Pyx_INCREF(__pyx_t_1); __Pyx_INCREF(__pyx_t_2); #else __pyx_t_1 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 153; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 153; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); #endif } else { Py_ssize_t index = -1; __pyx_t_3 = PyObject_GetIter(__pyx_v_val); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 153; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = Py_TYPE(__pyx_t_3)->tp_iternext; index = 0; __pyx_t_1 = __pyx_t_4(__pyx_t_3); if (unlikely(!__pyx_t_1)) goto __pyx_L3_unpacking_failed; __Pyx_GOTREF(__pyx_t_1); index = 1; __pyx_t_2 = __pyx_t_4(__pyx_t_3); if (unlikely(!__pyx_t_2)) goto __pyx_L3_unpacking_failed; __Pyx_GOTREF(__pyx_t_2); if (__Pyx_IternextUnpackEndCheck(__pyx_t_4(__pyx_t_3), 2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 153; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_t_4 = NULL; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; goto __pyx_L4_unpacking_done; __pyx_L3_unpacking_failed:; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_4 = NULL; if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 153; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_L4_unpacking_done:; } if (__Pyx_PyObject_SetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_right, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 153; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (__Pyx_PyObject_SetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_top, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 153; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "pygame_sdl2/rect.pyx":152 * def __get__(self): * return (self.right, self.top) * def __set__(self, val): # <<<<<<<<<<<<<< * self.right, self.top = val * */ /* function exit code */ __pyx_r = 0; goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("pygame_sdl2.rect.Rect.topright.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = -1; __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/rect.pyx":156 * * property bottomright: * def __get__(self): # <<<<<<<<<<<<<< * return (self.right, self.bottom) * def __set__(self, val): */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_4rect_4Rect_11bottomright_1__get__(PyObject *__pyx_v_self); /*proto*/ static PyObject *__pyx_pw_11pygame_sdl2_4rect_4Rect_11bottomright_1__get__(PyObject *__pyx_v_self) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); __pyx_r = __pyx_pf_11pygame_sdl2_4rect_4Rect_11bottomright___get__(((struct __pyx_obj_11pygame_sdl2_4rect_Rect *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_4rect_4Rect_11bottomright___get__(struct __pyx_obj_11pygame_sdl2_4rect_Rect *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__get__", 0); /* "pygame_sdl2/rect.pyx":157 * property bottomright: * def __get__(self): * return (self.right, self.bottom) # <<<<<<<<<<<<<< * def __set__(self, val): * self.right, self.bottom = val */ __Pyx_XDECREF(__pyx_r); __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_right); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 157; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_bottom); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 157; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 157; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __Pyx_GIVEREF(__pyx_t_1); PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_1); __Pyx_GIVEREF(__pyx_t_2); PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_2); __pyx_t_1 = 0; __pyx_t_2 = 0; __pyx_r = __pyx_t_3; __pyx_t_3 = 0; goto __pyx_L0; /* "pygame_sdl2/rect.pyx":156 * * property bottomright: * def __get__(self): # <<<<<<<<<<<<<< * return (self.right, self.bottom) * def __set__(self, val): */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("pygame_sdl2.rect.Rect.bottomright.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/rect.pyx":158 * def __get__(self): * return (self.right, self.bottom) * def __set__(self, val): # <<<<<<<<<<<<<< * self.right, self.bottom = val * */ /* Python wrapper */ static int __pyx_pw_11pygame_sdl2_4rect_4Rect_11bottomright_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_val); /*proto*/ static int __pyx_pw_11pygame_sdl2_4rect_4Rect_11bottomright_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_val) { int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__set__ (wrapper)", 0); __pyx_r = __pyx_pf_11pygame_sdl2_4rect_4Rect_11bottomright_2__set__(((struct __pyx_obj_11pygame_sdl2_4rect_Rect *)__pyx_v_self), ((PyObject *)__pyx_v_val)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static int __pyx_pf_11pygame_sdl2_4rect_4Rect_11bottomright_2__set__(struct __pyx_obj_11pygame_sdl2_4rect_Rect *__pyx_v_self, PyObject *__pyx_v_val) { int __pyx_r; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; PyObject *(*__pyx_t_4)(PyObject *); int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__set__", 0); /* "pygame_sdl2/rect.pyx":159 * return (self.right, self.bottom) * def __set__(self, val): * self.right, self.bottom = val # <<<<<<<<<<<<<< * * property bottomleft: */ if ((likely(PyTuple_CheckExact(__pyx_v_val))) || (PyList_CheckExact(__pyx_v_val))) { PyObject* sequence = __pyx_v_val; #if CYTHON_COMPILING_IN_CPYTHON Py_ssize_t size = Py_SIZE(sequence); #else Py_ssize_t size = PySequence_Size(sequence); #endif if (unlikely(size != 2)) { if (size > 2) __Pyx_RaiseTooManyValuesError(2); else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 159; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } #if CYTHON_COMPILING_IN_CPYTHON if (likely(PyTuple_CheckExact(sequence))) { __pyx_t_1 = PyTuple_GET_ITEM(sequence, 0); __pyx_t_2 = PyTuple_GET_ITEM(sequence, 1); } else { __pyx_t_1 = PyList_GET_ITEM(sequence, 0); __pyx_t_2 = PyList_GET_ITEM(sequence, 1); } __Pyx_INCREF(__pyx_t_1); __Pyx_INCREF(__pyx_t_2); #else __pyx_t_1 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 159; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 159; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); #endif } else { Py_ssize_t index = -1; __pyx_t_3 = PyObject_GetIter(__pyx_v_val); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 159; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = Py_TYPE(__pyx_t_3)->tp_iternext; index = 0; __pyx_t_1 = __pyx_t_4(__pyx_t_3); if (unlikely(!__pyx_t_1)) goto __pyx_L3_unpacking_failed; __Pyx_GOTREF(__pyx_t_1); index = 1; __pyx_t_2 = __pyx_t_4(__pyx_t_3); if (unlikely(!__pyx_t_2)) goto __pyx_L3_unpacking_failed; __Pyx_GOTREF(__pyx_t_2); if (__Pyx_IternextUnpackEndCheck(__pyx_t_4(__pyx_t_3), 2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 159; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_t_4 = NULL; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; goto __pyx_L4_unpacking_done; __pyx_L3_unpacking_failed:; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_4 = NULL; if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 159; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_L4_unpacking_done:; } if (__Pyx_PyObject_SetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_right, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 159; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (__Pyx_PyObject_SetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_bottom, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 159; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "pygame_sdl2/rect.pyx":158 * def __get__(self): * return (self.right, self.bottom) * def __set__(self, val): # <<<<<<<<<<<<<< * self.right, self.bottom = val * */ /* function exit code */ __pyx_r = 0; goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("pygame_sdl2.rect.Rect.bottomright.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = -1; __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/rect.pyx":162 * * property bottomleft: * def __get__(self): # <<<<<<<<<<<<<< * return (self.left, self.bottom) * def __set__(self, val): */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_4rect_4Rect_10bottomleft_1__get__(PyObject *__pyx_v_self); /*proto*/ static PyObject *__pyx_pw_11pygame_sdl2_4rect_4Rect_10bottomleft_1__get__(PyObject *__pyx_v_self) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); __pyx_r = __pyx_pf_11pygame_sdl2_4rect_4Rect_10bottomleft___get__(((struct __pyx_obj_11pygame_sdl2_4rect_Rect *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_4rect_4Rect_10bottomleft___get__(struct __pyx_obj_11pygame_sdl2_4rect_Rect *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__get__", 0); /* "pygame_sdl2/rect.pyx":163 * property bottomleft: * def __get__(self): * return (self.left, self.bottom) # <<<<<<<<<<<<<< * def __set__(self, val): * self.left, self.bottom = val */ __Pyx_XDECREF(__pyx_r); __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_left); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 163; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_bottom); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 163; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 163; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __Pyx_GIVEREF(__pyx_t_1); PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_1); __Pyx_GIVEREF(__pyx_t_2); PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_2); __pyx_t_1 = 0; __pyx_t_2 = 0; __pyx_r = __pyx_t_3; __pyx_t_3 = 0; goto __pyx_L0; /* "pygame_sdl2/rect.pyx":162 * * property bottomleft: * def __get__(self): # <<<<<<<<<<<<<< * return (self.left, self.bottom) * def __set__(self, val): */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("pygame_sdl2.rect.Rect.bottomleft.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/rect.pyx":164 * def __get__(self): * return (self.left, self.bottom) * def __set__(self, val): # <<<<<<<<<<<<<< * self.left, self.bottom = val * */ /* Python wrapper */ static int __pyx_pw_11pygame_sdl2_4rect_4Rect_10bottomleft_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_val); /*proto*/ static int __pyx_pw_11pygame_sdl2_4rect_4Rect_10bottomleft_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_val) { int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__set__ (wrapper)", 0); __pyx_r = __pyx_pf_11pygame_sdl2_4rect_4Rect_10bottomleft_2__set__(((struct __pyx_obj_11pygame_sdl2_4rect_Rect *)__pyx_v_self), ((PyObject *)__pyx_v_val)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static int __pyx_pf_11pygame_sdl2_4rect_4Rect_10bottomleft_2__set__(struct __pyx_obj_11pygame_sdl2_4rect_Rect *__pyx_v_self, PyObject *__pyx_v_val) { int __pyx_r; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; PyObject *(*__pyx_t_4)(PyObject *); int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__set__", 0); /* "pygame_sdl2/rect.pyx":165 * return (self.left, self.bottom) * def __set__(self, val): * self.left, self.bottom = val # <<<<<<<<<<<<<< * * property centerx: */ if ((likely(PyTuple_CheckExact(__pyx_v_val))) || (PyList_CheckExact(__pyx_v_val))) { PyObject* sequence = __pyx_v_val; #if CYTHON_COMPILING_IN_CPYTHON Py_ssize_t size = Py_SIZE(sequence); #else Py_ssize_t size = PySequence_Size(sequence); #endif if (unlikely(size != 2)) { if (size > 2) __Pyx_RaiseTooManyValuesError(2); else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 165; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } #if CYTHON_COMPILING_IN_CPYTHON if (likely(PyTuple_CheckExact(sequence))) { __pyx_t_1 = PyTuple_GET_ITEM(sequence, 0); __pyx_t_2 = PyTuple_GET_ITEM(sequence, 1); } else { __pyx_t_1 = PyList_GET_ITEM(sequence, 0); __pyx_t_2 = PyList_GET_ITEM(sequence, 1); } __Pyx_INCREF(__pyx_t_1); __Pyx_INCREF(__pyx_t_2); #else __pyx_t_1 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 165; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 165; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); #endif } else { Py_ssize_t index = -1; __pyx_t_3 = PyObject_GetIter(__pyx_v_val); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 165; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = Py_TYPE(__pyx_t_3)->tp_iternext; index = 0; __pyx_t_1 = __pyx_t_4(__pyx_t_3); if (unlikely(!__pyx_t_1)) goto __pyx_L3_unpacking_failed; __Pyx_GOTREF(__pyx_t_1); index = 1; __pyx_t_2 = __pyx_t_4(__pyx_t_3); if (unlikely(!__pyx_t_2)) goto __pyx_L3_unpacking_failed; __Pyx_GOTREF(__pyx_t_2); if (__Pyx_IternextUnpackEndCheck(__pyx_t_4(__pyx_t_3), 2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 165; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_t_4 = NULL; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; goto __pyx_L4_unpacking_done; __pyx_L3_unpacking_failed:; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_4 = NULL; if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 165; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_L4_unpacking_done:; } if (__Pyx_PyObject_SetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_left, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 165; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (__Pyx_PyObject_SetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_bottom, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 165; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "pygame_sdl2/rect.pyx":164 * def __get__(self): * return (self.left, self.bottom) * def __set__(self, val): # <<<<<<<<<<<<<< * self.left, self.bottom = val * */ /* function exit code */ __pyx_r = 0; goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("pygame_sdl2.rect.Rect.bottomleft.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = -1; __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/rect.pyx":168 * * property centerx: * def __get__(self): # <<<<<<<<<<<<<< * return self.x + (self.w / 2) * def __set__(self, val): */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_4rect_4Rect_7centerx_1__get__(PyObject *__pyx_v_self); /*proto*/ static PyObject *__pyx_pw_11pygame_sdl2_4rect_4Rect_7centerx_1__get__(PyObject *__pyx_v_self) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); __pyx_r = __pyx_pf_11pygame_sdl2_4rect_4Rect_7centerx___get__(((struct __pyx_obj_11pygame_sdl2_4rect_Rect *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_4rect_4Rect_7centerx___get__(struct __pyx_obj_11pygame_sdl2_4rect_Rect *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__get__", 0); /* "pygame_sdl2/rect.pyx":169 * property centerx: * def __get__(self): * return self.x + (self.w / 2) # <<<<<<<<<<<<<< * def __set__(self, val): * self.x += val - self.centerx */ __Pyx_XDECREF(__pyx_r); __pyx_t_1 = __Pyx_PyInt_From_long((__pyx_v_self->x + __Pyx_div_long(__pyx_v_self->w, 2))); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 169; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "pygame_sdl2/rect.pyx":168 * * property centerx: * def __get__(self): # <<<<<<<<<<<<<< * return self.x + (self.w / 2) * def __set__(self, val): */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("pygame_sdl2.rect.Rect.centerx.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/rect.pyx":170 * def __get__(self): * return self.x + (self.w / 2) * def __set__(self, val): # <<<<<<<<<<<<<< * self.x += val - self.centerx * */ /* Python wrapper */ static int __pyx_pw_11pygame_sdl2_4rect_4Rect_7centerx_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_val); /*proto*/ static int __pyx_pw_11pygame_sdl2_4rect_4Rect_7centerx_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_val) { int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__set__ (wrapper)", 0); __pyx_r = __pyx_pf_11pygame_sdl2_4rect_4Rect_7centerx_2__set__(((struct __pyx_obj_11pygame_sdl2_4rect_Rect *)__pyx_v_self), ((PyObject *)__pyx_v_val)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static int __pyx_pf_11pygame_sdl2_4rect_4Rect_7centerx_2__set__(struct __pyx_obj_11pygame_sdl2_4rect_Rect *__pyx_v_self, PyObject *__pyx_v_val) { int __pyx_r; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; int __pyx_t_4; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__set__", 0); /* "pygame_sdl2/rect.pyx":171 * return self.x + (self.w / 2) * def __set__(self, val): * self.x += val - self.centerx # <<<<<<<<<<<<<< * * property centery: */ __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_self->x); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 171; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_centerx); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 171; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = PyNumber_Subtract(__pyx_v_val, __pyx_t_2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 171; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_2 = PyNumber_InPlaceAdd(__pyx_t_1, __pyx_t_3); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 171; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_4 = __Pyx_PyInt_As_int(__pyx_t_2); if (unlikely((__pyx_t_4 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 171; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_v_self->x = __pyx_t_4; /* "pygame_sdl2/rect.pyx":170 * def __get__(self): * return self.x + (self.w / 2) * def __set__(self, val): # <<<<<<<<<<<<<< * self.x += val - self.centerx * */ /* function exit code */ __pyx_r = 0; goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("pygame_sdl2.rect.Rect.centerx.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = -1; __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/rect.pyx":174 * * property centery: * def __get__(self): # <<<<<<<<<<<<<< * return self.y + (self.h / 2) * def __set__(self, val): */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_4rect_4Rect_7centery_1__get__(PyObject *__pyx_v_self); /*proto*/ static PyObject *__pyx_pw_11pygame_sdl2_4rect_4Rect_7centery_1__get__(PyObject *__pyx_v_self) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); __pyx_r = __pyx_pf_11pygame_sdl2_4rect_4Rect_7centery___get__(((struct __pyx_obj_11pygame_sdl2_4rect_Rect *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_4rect_4Rect_7centery___get__(struct __pyx_obj_11pygame_sdl2_4rect_Rect *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__get__", 0); /* "pygame_sdl2/rect.pyx":175 * property centery: * def __get__(self): * return self.y + (self.h / 2) # <<<<<<<<<<<<<< * def __set__(self, val): * self.y += val - self.centery */ __Pyx_XDECREF(__pyx_r); __pyx_t_1 = __Pyx_PyInt_From_long((__pyx_v_self->y + __Pyx_div_long(__pyx_v_self->h, 2))); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 175; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "pygame_sdl2/rect.pyx":174 * * property centery: * def __get__(self): # <<<<<<<<<<<<<< * return self.y + (self.h / 2) * def __set__(self, val): */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("pygame_sdl2.rect.Rect.centery.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/rect.pyx":176 * def __get__(self): * return self.y + (self.h / 2) * def __set__(self, val): # <<<<<<<<<<<<<< * self.y += val - self.centery * */ /* Python wrapper */ static int __pyx_pw_11pygame_sdl2_4rect_4Rect_7centery_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_val); /*proto*/ static int __pyx_pw_11pygame_sdl2_4rect_4Rect_7centery_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_val) { int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__set__ (wrapper)", 0); __pyx_r = __pyx_pf_11pygame_sdl2_4rect_4Rect_7centery_2__set__(((struct __pyx_obj_11pygame_sdl2_4rect_Rect *)__pyx_v_self), ((PyObject *)__pyx_v_val)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static int __pyx_pf_11pygame_sdl2_4rect_4Rect_7centery_2__set__(struct __pyx_obj_11pygame_sdl2_4rect_Rect *__pyx_v_self, PyObject *__pyx_v_val) { int __pyx_r; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; int __pyx_t_4; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__set__", 0); /* "pygame_sdl2/rect.pyx":177 * return self.y + (self.h / 2) * def __set__(self, val): * self.y += val - self.centery # <<<<<<<<<<<<<< * * property center: */ __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_self->y); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 177; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_centery); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 177; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = PyNumber_Subtract(__pyx_v_val, __pyx_t_2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 177; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_2 = PyNumber_InPlaceAdd(__pyx_t_1, __pyx_t_3); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 177; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_4 = __Pyx_PyInt_As_int(__pyx_t_2); if (unlikely((__pyx_t_4 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 177; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_v_self->y = __pyx_t_4; /* "pygame_sdl2/rect.pyx":176 * def __get__(self): * return self.y + (self.h / 2) * def __set__(self, val): # <<<<<<<<<<<<<< * self.y += val - self.centery * */ /* function exit code */ __pyx_r = 0; goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("pygame_sdl2.rect.Rect.centery.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = -1; __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/rect.pyx":180 * * property center: * def __get__(self): # <<<<<<<<<<<<<< * return (self.centerx, self.centery) * def __set__(self, val): */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_4rect_4Rect_6center_1__get__(PyObject *__pyx_v_self); /*proto*/ static PyObject *__pyx_pw_11pygame_sdl2_4rect_4Rect_6center_1__get__(PyObject *__pyx_v_self) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); __pyx_r = __pyx_pf_11pygame_sdl2_4rect_4Rect_6center___get__(((struct __pyx_obj_11pygame_sdl2_4rect_Rect *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_4rect_4Rect_6center___get__(struct __pyx_obj_11pygame_sdl2_4rect_Rect *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__get__", 0); /* "pygame_sdl2/rect.pyx":181 * property center: * def __get__(self): * return (self.centerx, self.centery) # <<<<<<<<<<<<<< * def __set__(self, val): * self.centerx, self.centery = val */ __Pyx_XDECREF(__pyx_r); __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_centerx); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 181; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_centery); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 181; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 181; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __Pyx_GIVEREF(__pyx_t_1); PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_1); __Pyx_GIVEREF(__pyx_t_2); PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_2); __pyx_t_1 = 0; __pyx_t_2 = 0; __pyx_r = __pyx_t_3; __pyx_t_3 = 0; goto __pyx_L0; /* "pygame_sdl2/rect.pyx":180 * * property center: * def __get__(self): # <<<<<<<<<<<<<< * return (self.centerx, self.centery) * def __set__(self, val): */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("pygame_sdl2.rect.Rect.center.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/rect.pyx":182 * def __get__(self): * return (self.centerx, self.centery) * def __set__(self, val): # <<<<<<<<<<<<<< * self.centerx, self.centery = val * */ /* Python wrapper */ static int __pyx_pw_11pygame_sdl2_4rect_4Rect_6center_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_val); /*proto*/ static int __pyx_pw_11pygame_sdl2_4rect_4Rect_6center_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_val) { int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__set__ (wrapper)", 0); __pyx_r = __pyx_pf_11pygame_sdl2_4rect_4Rect_6center_2__set__(((struct __pyx_obj_11pygame_sdl2_4rect_Rect *)__pyx_v_self), ((PyObject *)__pyx_v_val)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static int __pyx_pf_11pygame_sdl2_4rect_4Rect_6center_2__set__(struct __pyx_obj_11pygame_sdl2_4rect_Rect *__pyx_v_self, PyObject *__pyx_v_val) { int __pyx_r; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; PyObject *(*__pyx_t_4)(PyObject *); int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__set__", 0); /* "pygame_sdl2/rect.pyx":183 * return (self.centerx, self.centery) * def __set__(self, val): * self.centerx, self.centery = val # <<<<<<<<<<<<<< * * property midtop: */ if ((likely(PyTuple_CheckExact(__pyx_v_val))) || (PyList_CheckExact(__pyx_v_val))) { PyObject* sequence = __pyx_v_val; #if CYTHON_COMPILING_IN_CPYTHON Py_ssize_t size = Py_SIZE(sequence); #else Py_ssize_t size = PySequence_Size(sequence); #endif if (unlikely(size != 2)) { if (size > 2) __Pyx_RaiseTooManyValuesError(2); else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 183; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } #if CYTHON_COMPILING_IN_CPYTHON if (likely(PyTuple_CheckExact(sequence))) { __pyx_t_1 = PyTuple_GET_ITEM(sequence, 0); __pyx_t_2 = PyTuple_GET_ITEM(sequence, 1); } else { __pyx_t_1 = PyList_GET_ITEM(sequence, 0); __pyx_t_2 = PyList_GET_ITEM(sequence, 1); } __Pyx_INCREF(__pyx_t_1); __Pyx_INCREF(__pyx_t_2); #else __pyx_t_1 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 183; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 183; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); #endif } else { Py_ssize_t index = -1; __pyx_t_3 = PyObject_GetIter(__pyx_v_val); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 183; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = Py_TYPE(__pyx_t_3)->tp_iternext; index = 0; __pyx_t_1 = __pyx_t_4(__pyx_t_3); if (unlikely(!__pyx_t_1)) goto __pyx_L3_unpacking_failed; __Pyx_GOTREF(__pyx_t_1); index = 1; __pyx_t_2 = __pyx_t_4(__pyx_t_3); if (unlikely(!__pyx_t_2)) goto __pyx_L3_unpacking_failed; __Pyx_GOTREF(__pyx_t_2); if (__Pyx_IternextUnpackEndCheck(__pyx_t_4(__pyx_t_3), 2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 183; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_t_4 = NULL; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; goto __pyx_L4_unpacking_done; __pyx_L3_unpacking_failed:; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_4 = NULL; if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 183; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_L4_unpacking_done:; } if (__Pyx_PyObject_SetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_centerx, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 183; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (__Pyx_PyObject_SetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_centery, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 183; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "pygame_sdl2/rect.pyx":182 * def __get__(self): * return (self.centerx, self.centery) * def __set__(self, val): # <<<<<<<<<<<<<< * self.centerx, self.centery = val * */ /* function exit code */ __pyx_r = 0; goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("pygame_sdl2.rect.Rect.center.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = -1; __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/rect.pyx":186 * * property midtop: * def __get__(self): # <<<<<<<<<<<<<< * return (self.centerx, self.top) * def __set__(self, val): */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_4rect_4Rect_6midtop_1__get__(PyObject *__pyx_v_self); /*proto*/ static PyObject *__pyx_pw_11pygame_sdl2_4rect_4Rect_6midtop_1__get__(PyObject *__pyx_v_self) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); __pyx_r = __pyx_pf_11pygame_sdl2_4rect_4Rect_6midtop___get__(((struct __pyx_obj_11pygame_sdl2_4rect_Rect *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_4rect_4Rect_6midtop___get__(struct __pyx_obj_11pygame_sdl2_4rect_Rect *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__get__", 0); /* "pygame_sdl2/rect.pyx":187 * property midtop: * def __get__(self): * return (self.centerx, self.top) # <<<<<<<<<<<<<< * def __set__(self, val): * self.centerx, self.top = val */ __Pyx_XDECREF(__pyx_r); __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_centerx); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 187; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_top); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 187; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 187; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __Pyx_GIVEREF(__pyx_t_1); PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_1); __Pyx_GIVEREF(__pyx_t_2); PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_2); __pyx_t_1 = 0; __pyx_t_2 = 0; __pyx_r = __pyx_t_3; __pyx_t_3 = 0; goto __pyx_L0; /* "pygame_sdl2/rect.pyx":186 * * property midtop: * def __get__(self): # <<<<<<<<<<<<<< * return (self.centerx, self.top) * def __set__(self, val): */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("pygame_sdl2.rect.Rect.midtop.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/rect.pyx":188 * def __get__(self): * return (self.centerx, self.top) * def __set__(self, val): # <<<<<<<<<<<<<< * self.centerx, self.top = val * */ /* Python wrapper */ static int __pyx_pw_11pygame_sdl2_4rect_4Rect_6midtop_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_val); /*proto*/ static int __pyx_pw_11pygame_sdl2_4rect_4Rect_6midtop_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_val) { int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__set__ (wrapper)", 0); __pyx_r = __pyx_pf_11pygame_sdl2_4rect_4Rect_6midtop_2__set__(((struct __pyx_obj_11pygame_sdl2_4rect_Rect *)__pyx_v_self), ((PyObject *)__pyx_v_val)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static int __pyx_pf_11pygame_sdl2_4rect_4Rect_6midtop_2__set__(struct __pyx_obj_11pygame_sdl2_4rect_Rect *__pyx_v_self, PyObject *__pyx_v_val) { int __pyx_r; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; PyObject *(*__pyx_t_4)(PyObject *); int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__set__", 0); /* "pygame_sdl2/rect.pyx":189 * return (self.centerx, self.top) * def __set__(self, val): * self.centerx, self.top = val # <<<<<<<<<<<<<< * * property midleft: */ if ((likely(PyTuple_CheckExact(__pyx_v_val))) || (PyList_CheckExact(__pyx_v_val))) { PyObject* sequence = __pyx_v_val; #if CYTHON_COMPILING_IN_CPYTHON Py_ssize_t size = Py_SIZE(sequence); #else Py_ssize_t size = PySequence_Size(sequence); #endif if (unlikely(size != 2)) { if (size > 2) __Pyx_RaiseTooManyValuesError(2); else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 189; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } #if CYTHON_COMPILING_IN_CPYTHON if (likely(PyTuple_CheckExact(sequence))) { __pyx_t_1 = PyTuple_GET_ITEM(sequence, 0); __pyx_t_2 = PyTuple_GET_ITEM(sequence, 1); } else { __pyx_t_1 = PyList_GET_ITEM(sequence, 0); __pyx_t_2 = PyList_GET_ITEM(sequence, 1); } __Pyx_INCREF(__pyx_t_1); __Pyx_INCREF(__pyx_t_2); #else __pyx_t_1 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 189; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 189; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); #endif } else { Py_ssize_t index = -1; __pyx_t_3 = PyObject_GetIter(__pyx_v_val); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 189; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = Py_TYPE(__pyx_t_3)->tp_iternext; index = 0; __pyx_t_1 = __pyx_t_4(__pyx_t_3); if (unlikely(!__pyx_t_1)) goto __pyx_L3_unpacking_failed; __Pyx_GOTREF(__pyx_t_1); index = 1; __pyx_t_2 = __pyx_t_4(__pyx_t_3); if (unlikely(!__pyx_t_2)) goto __pyx_L3_unpacking_failed; __Pyx_GOTREF(__pyx_t_2); if (__Pyx_IternextUnpackEndCheck(__pyx_t_4(__pyx_t_3), 2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 189; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_t_4 = NULL; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; goto __pyx_L4_unpacking_done; __pyx_L3_unpacking_failed:; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_4 = NULL; if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 189; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_L4_unpacking_done:; } if (__Pyx_PyObject_SetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_centerx, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 189; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (__Pyx_PyObject_SetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_top, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 189; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "pygame_sdl2/rect.pyx":188 * def __get__(self): * return (self.centerx, self.top) * def __set__(self, val): # <<<<<<<<<<<<<< * self.centerx, self.top = val * */ /* function exit code */ __pyx_r = 0; goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("pygame_sdl2.rect.Rect.midtop.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = -1; __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/rect.pyx":192 * * property midleft: * def __get__(self): # <<<<<<<<<<<<<< * return (self.left, self.centery) * def __set__(self, val): */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_4rect_4Rect_7midleft_1__get__(PyObject *__pyx_v_self); /*proto*/ static PyObject *__pyx_pw_11pygame_sdl2_4rect_4Rect_7midleft_1__get__(PyObject *__pyx_v_self) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); __pyx_r = __pyx_pf_11pygame_sdl2_4rect_4Rect_7midleft___get__(((struct __pyx_obj_11pygame_sdl2_4rect_Rect *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_4rect_4Rect_7midleft___get__(struct __pyx_obj_11pygame_sdl2_4rect_Rect *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__get__", 0); /* "pygame_sdl2/rect.pyx":193 * property midleft: * def __get__(self): * return (self.left, self.centery) # <<<<<<<<<<<<<< * def __set__(self, val): * self.left, self.centery = val */ __Pyx_XDECREF(__pyx_r); __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_left); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 193; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_centery); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 193; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 193; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __Pyx_GIVEREF(__pyx_t_1); PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_1); __Pyx_GIVEREF(__pyx_t_2); PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_2); __pyx_t_1 = 0; __pyx_t_2 = 0; __pyx_r = __pyx_t_3; __pyx_t_3 = 0; goto __pyx_L0; /* "pygame_sdl2/rect.pyx":192 * * property midleft: * def __get__(self): # <<<<<<<<<<<<<< * return (self.left, self.centery) * def __set__(self, val): */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("pygame_sdl2.rect.Rect.midleft.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/rect.pyx":194 * def __get__(self): * return (self.left, self.centery) * def __set__(self, val): # <<<<<<<<<<<<<< * self.left, self.centery = val * */ /* Python wrapper */ static int __pyx_pw_11pygame_sdl2_4rect_4Rect_7midleft_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_val); /*proto*/ static int __pyx_pw_11pygame_sdl2_4rect_4Rect_7midleft_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_val) { int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__set__ (wrapper)", 0); __pyx_r = __pyx_pf_11pygame_sdl2_4rect_4Rect_7midleft_2__set__(((struct __pyx_obj_11pygame_sdl2_4rect_Rect *)__pyx_v_self), ((PyObject *)__pyx_v_val)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static int __pyx_pf_11pygame_sdl2_4rect_4Rect_7midleft_2__set__(struct __pyx_obj_11pygame_sdl2_4rect_Rect *__pyx_v_self, PyObject *__pyx_v_val) { int __pyx_r; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; PyObject *(*__pyx_t_4)(PyObject *); int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__set__", 0); /* "pygame_sdl2/rect.pyx":195 * return (self.left, self.centery) * def __set__(self, val): * self.left, self.centery = val # <<<<<<<<<<<<<< * * property midbottom: */ if ((likely(PyTuple_CheckExact(__pyx_v_val))) || (PyList_CheckExact(__pyx_v_val))) { PyObject* sequence = __pyx_v_val; #if CYTHON_COMPILING_IN_CPYTHON Py_ssize_t size = Py_SIZE(sequence); #else Py_ssize_t size = PySequence_Size(sequence); #endif if (unlikely(size != 2)) { if (size > 2) __Pyx_RaiseTooManyValuesError(2); else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 195; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } #if CYTHON_COMPILING_IN_CPYTHON if (likely(PyTuple_CheckExact(sequence))) { __pyx_t_1 = PyTuple_GET_ITEM(sequence, 0); __pyx_t_2 = PyTuple_GET_ITEM(sequence, 1); } else { __pyx_t_1 = PyList_GET_ITEM(sequence, 0); __pyx_t_2 = PyList_GET_ITEM(sequence, 1); } __Pyx_INCREF(__pyx_t_1); __Pyx_INCREF(__pyx_t_2); #else __pyx_t_1 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 195; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 195; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); #endif } else { Py_ssize_t index = -1; __pyx_t_3 = PyObject_GetIter(__pyx_v_val); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 195; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = Py_TYPE(__pyx_t_3)->tp_iternext; index = 0; __pyx_t_1 = __pyx_t_4(__pyx_t_3); if (unlikely(!__pyx_t_1)) goto __pyx_L3_unpacking_failed; __Pyx_GOTREF(__pyx_t_1); index = 1; __pyx_t_2 = __pyx_t_4(__pyx_t_3); if (unlikely(!__pyx_t_2)) goto __pyx_L3_unpacking_failed; __Pyx_GOTREF(__pyx_t_2); if (__Pyx_IternextUnpackEndCheck(__pyx_t_4(__pyx_t_3), 2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 195; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_t_4 = NULL; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; goto __pyx_L4_unpacking_done; __pyx_L3_unpacking_failed:; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_4 = NULL; if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 195; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_L4_unpacking_done:; } if (__Pyx_PyObject_SetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_left, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 195; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (__Pyx_PyObject_SetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_centery, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 195; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "pygame_sdl2/rect.pyx":194 * def __get__(self): * return (self.left, self.centery) * def __set__(self, val): # <<<<<<<<<<<<<< * self.left, self.centery = val * */ /* function exit code */ __pyx_r = 0; goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("pygame_sdl2.rect.Rect.midleft.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = -1; __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/rect.pyx":198 * * property midbottom: * def __get__(self): # <<<<<<<<<<<<<< * return (self.centerx, self.bottom) * def __set__(self, val): */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_4rect_4Rect_9midbottom_1__get__(PyObject *__pyx_v_self); /*proto*/ static PyObject *__pyx_pw_11pygame_sdl2_4rect_4Rect_9midbottom_1__get__(PyObject *__pyx_v_self) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); __pyx_r = __pyx_pf_11pygame_sdl2_4rect_4Rect_9midbottom___get__(((struct __pyx_obj_11pygame_sdl2_4rect_Rect *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_4rect_4Rect_9midbottom___get__(struct __pyx_obj_11pygame_sdl2_4rect_Rect *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__get__", 0); /* "pygame_sdl2/rect.pyx":199 * property midbottom: * def __get__(self): * return (self.centerx, self.bottom) # <<<<<<<<<<<<<< * def __set__(self, val): * self.centerx, self.bottom = val */ __Pyx_XDECREF(__pyx_r); __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_centerx); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 199; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_bottom); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 199; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 199; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __Pyx_GIVEREF(__pyx_t_1); PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_1); __Pyx_GIVEREF(__pyx_t_2); PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_2); __pyx_t_1 = 0; __pyx_t_2 = 0; __pyx_r = __pyx_t_3; __pyx_t_3 = 0; goto __pyx_L0; /* "pygame_sdl2/rect.pyx":198 * * property midbottom: * def __get__(self): # <<<<<<<<<<<<<< * return (self.centerx, self.bottom) * def __set__(self, val): */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("pygame_sdl2.rect.Rect.midbottom.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/rect.pyx":200 * def __get__(self): * return (self.centerx, self.bottom) * def __set__(self, val): # <<<<<<<<<<<<<< * self.centerx, self.bottom = val * */ /* Python wrapper */ static int __pyx_pw_11pygame_sdl2_4rect_4Rect_9midbottom_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_val); /*proto*/ static int __pyx_pw_11pygame_sdl2_4rect_4Rect_9midbottom_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_val) { int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__set__ (wrapper)", 0); __pyx_r = __pyx_pf_11pygame_sdl2_4rect_4Rect_9midbottom_2__set__(((struct __pyx_obj_11pygame_sdl2_4rect_Rect *)__pyx_v_self), ((PyObject *)__pyx_v_val)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static int __pyx_pf_11pygame_sdl2_4rect_4Rect_9midbottom_2__set__(struct __pyx_obj_11pygame_sdl2_4rect_Rect *__pyx_v_self, PyObject *__pyx_v_val) { int __pyx_r; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; PyObject *(*__pyx_t_4)(PyObject *); int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__set__", 0); /* "pygame_sdl2/rect.pyx":201 * return (self.centerx, self.bottom) * def __set__(self, val): * self.centerx, self.bottom = val # <<<<<<<<<<<<<< * * property midright: */ if ((likely(PyTuple_CheckExact(__pyx_v_val))) || (PyList_CheckExact(__pyx_v_val))) { PyObject* sequence = __pyx_v_val; #if CYTHON_COMPILING_IN_CPYTHON Py_ssize_t size = Py_SIZE(sequence); #else Py_ssize_t size = PySequence_Size(sequence); #endif if (unlikely(size != 2)) { if (size > 2) __Pyx_RaiseTooManyValuesError(2); else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 201; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } #if CYTHON_COMPILING_IN_CPYTHON if (likely(PyTuple_CheckExact(sequence))) { __pyx_t_1 = PyTuple_GET_ITEM(sequence, 0); __pyx_t_2 = PyTuple_GET_ITEM(sequence, 1); } else { __pyx_t_1 = PyList_GET_ITEM(sequence, 0); __pyx_t_2 = PyList_GET_ITEM(sequence, 1); } __Pyx_INCREF(__pyx_t_1); __Pyx_INCREF(__pyx_t_2); #else __pyx_t_1 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 201; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 201; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); #endif } else { Py_ssize_t index = -1; __pyx_t_3 = PyObject_GetIter(__pyx_v_val); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 201; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = Py_TYPE(__pyx_t_3)->tp_iternext; index = 0; __pyx_t_1 = __pyx_t_4(__pyx_t_3); if (unlikely(!__pyx_t_1)) goto __pyx_L3_unpacking_failed; __Pyx_GOTREF(__pyx_t_1); index = 1; __pyx_t_2 = __pyx_t_4(__pyx_t_3); if (unlikely(!__pyx_t_2)) goto __pyx_L3_unpacking_failed; __Pyx_GOTREF(__pyx_t_2); if (__Pyx_IternextUnpackEndCheck(__pyx_t_4(__pyx_t_3), 2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 201; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_t_4 = NULL; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; goto __pyx_L4_unpacking_done; __pyx_L3_unpacking_failed:; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_4 = NULL; if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 201; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_L4_unpacking_done:; } if (__Pyx_PyObject_SetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_centerx, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 201; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (__Pyx_PyObject_SetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_bottom, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 201; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "pygame_sdl2/rect.pyx":200 * def __get__(self): * return (self.centerx, self.bottom) * def __set__(self, val): # <<<<<<<<<<<<<< * self.centerx, self.bottom = val * */ /* function exit code */ __pyx_r = 0; goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("pygame_sdl2.rect.Rect.midbottom.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = -1; __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/rect.pyx":204 * * property midright: * def __get__(self): # <<<<<<<<<<<<<< * return (self.right, self.centery) * def __set__(self, val): */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_4rect_4Rect_8midright_1__get__(PyObject *__pyx_v_self); /*proto*/ static PyObject *__pyx_pw_11pygame_sdl2_4rect_4Rect_8midright_1__get__(PyObject *__pyx_v_self) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); __pyx_r = __pyx_pf_11pygame_sdl2_4rect_4Rect_8midright___get__(((struct __pyx_obj_11pygame_sdl2_4rect_Rect *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_4rect_4Rect_8midright___get__(struct __pyx_obj_11pygame_sdl2_4rect_Rect *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__get__", 0); /* "pygame_sdl2/rect.pyx":205 * property midright: * def __get__(self): * return (self.right, self.centery) # <<<<<<<<<<<<<< * def __set__(self, val): * self.right, self.centery = val */ __Pyx_XDECREF(__pyx_r); __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_right); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 205; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_centery); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 205; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 205; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __Pyx_GIVEREF(__pyx_t_1); PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_1); __Pyx_GIVEREF(__pyx_t_2); PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_2); __pyx_t_1 = 0; __pyx_t_2 = 0; __pyx_r = __pyx_t_3; __pyx_t_3 = 0; goto __pyx_L0; /* "pygame_sdl2/rect.pyx":204 * * property midright: * def __get__(self): # <<<<<<<<<<<<<< * return (self.right, self.centery) * def __set__(self, val): */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("pygame_sdl2.rect.Rect.midright.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/rect.pyx":206 * def __get__(self): * return (self.right, self.centery) * def __set__(self, val): # <<<<<<<<<<<<<< * self.right, self.centery = val * */ /* Python wrapper */ static int __pyx_pw_11pygame_sdl2_4rect_4Rect_8midright_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_val); /*proto*/ static int __pyx_pw_11pygame_sdl2_4rect_4Rect_8midright_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_val) { int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__set__ (wrapper)", 0); __pyx_r = __pyx_pf_11pygame_sdl2_4rect_4Rect_8midright_2__set__(((struct __pyx_obj_11pygame_sdl2_4rect_Rect *)__pyx_v_self), ((PyObject *)__pyx_v_val)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static int __pyx_pf_11pygame_sdl2_4rect_4Rect_8midright_2__set__(struct __pyx_obj_11pygame_sdl2_4rect_Rect *__pyx_v_self, PyObject *__pyx_v_val) { int __pyx_r; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; PyObject *(*__pyx_t_4)(PyObject *); int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__set__", 0); /* "pygame_sdl2/rect.pyx":207 * return (self.right, self.centery) * def __set__(self, val): * self.right, self.centery = val # <<<<<<<<<<<<<< * * def copy(self): */ if ((likely(PyTuple_CheckExact(__pyx_v_val))) || (PyList_CheckExact(__pyx_v_val))) { PyObject* sequence = __pyx_v_val; #if CYTHON_COMPILING_IN_CPYTHON Py_ssize_t size = Py_SIZE(sequence); #else Py_ssize_t size = PySequence_Size(sequence); #endif if (unlikely(size != 2)) { if (size > 2) __Pyx_RaiseTooManyValuesError(2); else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 207; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } #if CYTHON_COMPILING_IN_CPYTHON if (likely(PyTuple_CheckExact(sequence))) { __pyx_t_1 = PyTuple_GET_ITEM(sequence, 0); __pyx_t_2 = PyTuple_GET_ITEM(sequence, 1); } else { __pyx_t_1 = PyList_GET_ITEM(sequence, 0); __pyx_t_2 = PyList_GET_ITEM(sequence, 1); } __Pyx_INCREF(__pyx_t_1); __Pyx_INCREF(__pyx_t_2); #else __pyx_t_1 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 207; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 207; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); #endif } else { Py_ssize_t index = -1; __pyx_t_3 = PyObject_GetIter(__pyx_v_val); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 207; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = Py_TYPE(__pyx_t_3)->tp_iternext; index = 0; __pyx_t_1 = __pyx_t_4(__pyx_t_3); if (unlikely(!__pyx_t_1)) goto __pyx_L3_unpacking_failed; __Pyx_GOTREF(__pyx_t_1); index = 1; __pyx_t_2 = __pyx_t_4(__pyx_t_3); if (unlikely(!__pyx_t_2)) goto __pyx_L3_unpacking_failed; __Pyx_GOTREF(__pyx_t_2); if (__Pyx_IternextUnpackEndCheck(__pyx_t_4(__pyx_t_3), 2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 207; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_t_4 = NULL; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; goto __pyx_L4_unpacking_done; __pyx_L3_unpacking_failed:; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_4 = NULL; if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 207; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_L4_unpacking_done:; } if (__Pyx_PyObject_SetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_right, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 207; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (__Pyx_PyObject_SetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_centery, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 207; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "pygame_sdl2/rect.pyx":206 * def __get__(self): * return (self.right, self.centery) * def __set__(self, val): # <<<<<<<<<<<<<< * self.right, self.centery = val * */ /* function exit code */ __pyx_r = 0; goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("pygame_sdl2.rect.Rect.midright.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = -1; __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/rect.pyx":209 * self.right, self.centery = val * * def copy(self): # <<<<<<<<<<<<<< * return Rect(self) * */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_4rect_4Rect_17copy(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/ static PyObject *__pyx_pw_11pygame_sdl2_4rect_4Rect_17copy(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("copy (wrapper)", 0); __pyx_r = __pyx_pf_11pygame_sdl2_4rect_4Rect_16copy(((struct __pyx_obj_11pygame_sdl2_4rect_Rect *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_4rect_4Rect_16copy(struct __pyx_obj_11pygame_sdl2_4rect_Rect *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("copy", 0); /* "pygame_sdl2/rect.pyx":210 * * def copy(self): * return Rect(self) # <<<<<<<<<<<<<< * * def move(self, *args): */ __Pyx_XDECREF(__pyx_r); __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 210; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __Pyx_INCREF(((PyObject *)__pyx_v_self)); __Pyx_GIVEREF(((PyObject *)__pyx_v_self)); PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)__pyx_v_self)); __pyx_t_2 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_11pygame_sdl2_4rect_Rect), __pyx_t_1, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 210; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; /* "pygame_sdl2/rect.pyx":209 * self.right, self.centery = val * * def copy(self): # <<<<<<<<<<<<<< * return Rect(self) * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_AddTraceback("pygame_sdl2.rect.Rect.copy", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/rect.pyx":212 * return Rect(self) * * def move(self, *args): # <<<<<<<<<<<<<< * r = self.copy() * r.move_ip(*args) */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_4rect_4Rect_19move(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static PyObject *__pyx_pw_11pygame_sdl2_4rect_4Rect_19move(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_args = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("move (wrapper)", 0); if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "move", 0))) return NULL; __Pyx_INCREF(__pyx_args); __pyx_v_args = __pyx_args; __pyx_r = __pyx_pf_11pygame_sdl2_4rect_4Rect_18move(((struct __pyx_obj_11pygame_sdl2_4rect_Rect *)__pyx_v_self), __pyx_v_args); /* function exit code */ __Pyx_XDECREF(__pyx_v_args); __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_4rect_4Rect_18move(struct __pyx_obj_11pygame_sdl2_4rect_Rect *__pyx_v_self, PyObject *__pyx_v_args) { PyObject *__pyx_v_r = NULL; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("move", 0); /* "pygame_sdl2/rect.pyx":213 * * def move(self, *args): * r = self.copy() # <<<<<<<<<<<<<< * r.move_ip(*args) * return r */ __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_copy); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 213; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = NULL; if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_2))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); if (likely(__pyx_t_3)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); } } if (__pyx_t_3) { __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 213; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } else { __pyx_t_1 = __Pyx_PyObject_CallNoArg(__pyx_t_2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 213; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_v_r = __pyx_t_1; __pyx_t_1 = 0; /* "pygame_sdl2/rect.pyx":214 * def move(self, *args): * r = self.copy() * r.move_ip(*args) # <<<<<<<<<<<<<< * return r * */ __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_r, __pyx_n_s_move_ip); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 214; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_v_args, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 214; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "pygame_sdl2/rect.pyx":215 * r = self.copy() * r.move_ip(*args) * return r # <<<<<<<<<<<<<< * * def move_ip(self, *args): */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(__pyx_v_r); __pyx_r = __pyx_v_r; goto __pyx_L0; /* "pygame_sdl2/rect.pyx":212 * return Rect(self) * * def move(self, *args): # <<<<<<<<<<<<<< * r = self.copy() * r.move_ip(*args) */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("pygame_sdl2.rect.Rect.move", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF(__pyx_v_r); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/rect.pyx":217 * return r * * def move_ip(self, *args): # <<<<<<<<<<<<<< * x, y = flatten(args) * self.x += x */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_4rect_4Rect_21move_ip(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static PyObject *__pyx_pw_11pygame_sdl2_4rect_4Rect_21move_ip(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_args = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("move_ip (wrapper)", 0); if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "move_ip", 0))) return NULL; __Pyx_INCREF(__pyx_args); __pyx_v_args = __pyx_args; __pyx_r = __pyx_pf_11pygame_sdl2_4rect_4Rect_20move_ip(((struct __pyx_obj_11pygame_sdl2_4rect_Rect *)__pyx_v_self), __pyx_v_args); /* function exit code */ __Pyx_XDECREF(__pyx_v_args); __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_4rect_4Rect_20move_ip(struct __pyx_obj_11pygame_sdl2_4rect_Rect *__pyx_v_self, PyObject *__pyx_v_args) { PyObject *__pyx_v_x = NULL; PyObject *__pyx_v_y = NULL; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; PyObject *(*__pyx_t_5)(PyObject *); int __pyx_t_6; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("move_ip", 0); /* "pygame_sdl2/rect.pyx":218 * * def move_ip(self, *args): * x, y = flatten(args) # <<<<<<<<<<<<<< * self.x += x * self.y += y */ __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_flatten); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 218; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = NULL; if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_2))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); if (likely(__pyx_t_3)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); } } if (!__pyx_t_3) { __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_v_args); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 218; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); } else { __pyx_t_4 = PyTuple_New(1+1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 218; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_3); __pyx_t_3 = NULL; __Pyx_INCREF(__pyx_v_args); __Pyx_GIVEREF(__pyx_v_args); PyTuple_SET_ITEM(__pyx_t_4, 0+1, __pyx_v_args); __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_4, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 218; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; } __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; if ((likely(PyTuple_CheckExact(__pyx_t_1))) || (PyList_CheckExact(__pyx_t_1))) { PyObject* sequence = __pyx_t_1; #if CYTHON_COMPILING_IN_CPYTHON Py_ssize_t size = Py_SIZE(sequence); #else Py_ssize_t size = PySequence_Size(sequence); #endif if (unlikely(size != 2)) { if (size > 2) __Pyx_RaiseTooManyValuesError(2); else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 218; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } #if CYTHON_COMPILING_IN_CPYTHON if (likely(PyTuple_CheckExact(sequence))) { __pyx_t_2 = PyTuple_GET_ITEM(sequence, 0); __pyx_t_4 = PyTuple_GET_ITEM(sequence, 1); } else { __pyx_t_2 = PyList_GET_ITEM(sequence, 0); __pyx_t_4 = PyList_GET_ITEM(sequence, 1); } __Pyx_INCREF(__pyx_t_2); __Pyx_INCREF(__pyx_t_4); #else __pyx_t_2 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 218; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __pyx_t_4 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 218; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); #endif __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; } else { Py_ssize_t index = -1; __pyx_t_3 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 218; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_5 = Py_TYPE(__pyx_t_3)->tp_iternext; index = 0; __pyx_t_2 = __pyx_t_5(__pyx_t_3); if (unlikely(!__pyx_t_2)) goto __pyx_L3_unpacking_failed; __Pyx_GOTREF(__pyx_t_2); index = 1; __pyx_t_4 = __pyx_t_5(__pyx_t_3); if (unlikely(!__pyx_t_4)) goto __pyx_L3_unpacking_failed; __Pyx_GOTREF(__pyx_t_4); if (__Pyx_IternextUnpackEndCheck(__pyx_t_5(__pyx_t_3), 2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 218; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_t_5 = NULL; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; goto __pyx_L4_unpacking_done; __pyx_L3_unpacking_failed:; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_5 = NULL; if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 218; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_L4_unpacking_done:; } __pyx_v_x = __pyx_t_2; __pyx_t_2 = 0; __pyx_v_y = __pyx_t_4; __pyx_t_4 = 0; /* "pygame_sdl2/rect.pyx":219 * def move_ip(self, *args): * x, y = flatten(args) * self.x += x # <<<<<<<<<<<<<< * self.y += y * */ __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_self->x); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 219; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_t_4 = PyNumber_InPlaceAdd(__pyx_t_1, __pyx_v_x); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 219; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_6 = __Pyx_PyInt_As_int(__pyx_t_4); if (unlikely((__pyx_t_6 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 219; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_v_self->x = __pyx_t_6; /* "pygame_sdl2/rect.pyx":220 * x, y = flatten(args) * self.x += x * self.y += y # <<<<<<<<<<<<<< * * def inflate(self, *args): */ __pyx_t_4 = __Pyx_PyInt_From_int(__pyx_v_self->y); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 220; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); __pyx_t_1 = PyNumber_InPlaceAdd(__pyx_t_4, __pyx_v_y); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 220; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_t_6 = __Pyx_PyInt_As_int(__pyx_t_1); if (unlikely((__pyx_t_6 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 220; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_v_self->y = __pyx_t_6; /* "pygame_sdl2/rect.pyx":217 * return r * * def move_ip(self, *args): # <<<<<<<<<<<<<< * x, y = flatten(args) * self.x += x */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_AddTraceback("pygame_sdl2.rect.Rect.move_ip", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF(__pyx_v_x); __Pyx_XDECREF(__pyx_v_y); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/rect.pyx":222 * self.y += y * * def inflate(self, *args): # <<<<<<<<<<<<<< * r = self.copy() * r.inflate_ip(*args) */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_4rect_4Rect_23inflate(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static PyObject *__pyx_pw_11pygame_sdl2_4rect_4Rect_23inflate(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_args = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("inflate (wrapper)", 0); if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "inflate", 0))) return NULL; __Pyx_INCREF(__pyx_args); __pyx_v_args = __pyx_args; __pyx_r = __pyx_pf_11pygame_sdl2_4rect_4Rect_22inflate(((struct __pyx_obj_11pygame_sdl2_4rect_Rect *)__pyx_v_self), __pyx_v_args); /* function exit code */ __Pyx_XDECREF(__pyx_v_args); __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_4rect_4Rect_22inflate(struct __pyx_obj_11pygame_sdl2_4rect_Rect *__pyx_v_self, PyObject *__pyx_v_args) { PyObject *__pyx_v_r = NULL; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("inflate", 0); /* "pygame_sdl2/rect.pyx":223 * * def inflate(self, *args): * r = self.copy() # <<<<<<<<<<<<<< * r.inflate_ip(*args) * return r */ __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_copy); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 223; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = NULL; if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_2))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); if (likely(__pyx_t_3)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); } } if (__pyx_t_3) { __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 223; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } else { __pyx_t_1 = __Pyx_PyObject_CallNoArg(__pyx_t_2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 223; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_v_r = __pyx_t_1; __pyx_t_1 = 0; /* "pygame_sdl2/rect.pyx":224 * def inflate(self, *args): * r = self.copy() * r.inflate_ip(*args) # <<<<<<<<<<<<<< * return r * */ __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_r, __pyx_n_s_inflate_ip); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 224; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_v_args, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 224; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "pygame_sdl2/rect.pyx":225 * r = self.copy() * r.inflate_ip(*args) * return r # <<<<<<<<<<<<<< * * def inflate_ip(self, *args): */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(__pyx_v_r); __pyx_r = __pyx_v_r; goto __pyx_L0; /* "pygame_sdl2/rect.pyx":222 * self.y += y * * def inflate(self, *args): # <<<<<<<<<<<<<< * r = self.copy() * r.inflate_ip(*args) */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("pygame_sdl2.rect.Rect.inflate", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF(__pyx_v_r); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/rect.pyx":227 * return r * * def inflate_ip(self, *args): # <<<<<<<<<<<<<< * x, y = flatten(args) * c = self.center */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_4rect_4Rect_25inflate_ip(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static PyObject *__pyx_pw_11pygame_sdl2_4rect_4Rect_25inflate_ip(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_args = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("inflate_ip (wrapper)", 0); if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "inflate_ip", 0))) return NULL; __Pyx_INCREF(__pyx_args); __pyx_v_args = __pyx_args; __pyx_r = __pyx_pf_11pygame_sdl2_4rect_4Rect_24inflate_ip(((struct __pyx_obj_11pygame_sdl2_4rect_Rect *)__pyx_v_self), __pyx_v_args); /* function exit code */ __Pyx_XDECREF(__pyx_v_args); __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_4rect_4Rect_24inflate_ip(struct __pyx_obj_11pygame_sdl2_4rect_Rect *__pyx_v_self, PyObject *__pyx_v_args) { PyObject *__pyx_v_x = NULL; PyObject *__pyx_v_y = NULL; PyObject *__pyx_v_c = NULL; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; PyObject *(*__pyx_t_5)(PyObject *); int __pyx_t_6; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("inflate_ip", 0); /* "pygame_sdl2/rect.pyx":228 * * def inflate_ip(self, *args): * x, y = flatten(args) # <<<<<<<<<<<<<< * c = self.center * self.w += x */ __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_flatten); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 228; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = NULL; if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_2))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); if (likely(__pyx_t_3)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); } } if (!__pyx_t_3) { __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_v_args); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 228; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); } else { __pyx_t_4 = PyTuple_New(1+1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 228; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_3); __pyx_t_3 = NULL; __Pyx_INCREF(__pyx_v_args); __Pyx_GIVEREF(__pyx_v_args); PyTuple_SET_ITEM(__pyx_t_4, 0+1, __pyx_v_args); __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_4, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 228; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; } __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; if ((likely(PyTuple_CheckExact(__pyx_t_1))) || (PyList_CheckExact(__pyx_t_1))) { PyObject* sequence = __pyx_t_1; #if CYTHON_COMPILING_IN_CPYTHON Py_ssize_t size = Py_SIZE(sequence); #else Py_ssize_t size = PySequence_Size(sequence); #endif if (unlikely(size != 2)) { if (size > 2) __Pyx_RaiseTooManyValuesError(2); else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 228; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } #if CYTHON_COMPILING_IN_CPYTHON if (likely(PyTuple_CheckExact(sequence))) { __pyx_t_2 = PyTuple_GET_ITEM(sequence, 0); __pyx_t_4 = PyTuple_GET_ITEM(sequence, 1); } else { __pyx_t_2 = PyList_GET_ITEM(sequence, 0); __pyx_t_4 = PyList_GET_ITEM(sequence, 1); } __Pyx_INCREF(__pyx_t_2); __Pyx_INCREF(__pyx_t_4); #else __pyx_t_2 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 228; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __pyx_t_4 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 228; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); #endif __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; } else { Py_ssize_t index = -1; __pyx_t_3 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 228; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_5 = Py_TYPE(__pyx_t_3)->tp_iternext; index = 0; __pyx_t_2 = __pyx_t_5(__pyx_t_3); if (unlikely(!__pyx_t_2)) goto __pyx_L3_unpacking_failed; __Pyx_GOTREF(__pyx_t_2); index = 1; __pyx_t_4 = __pyx_t_5(__pyx_t_3); if (unlikely(!__pyx_t_4)) goto __pyx_L3_unpacking_failed; __Pyx_GOTREF(__pyx_t_4); if (__Pyx_IternextUnpackEndCheck(__pyx_t_5(__pyx_t_3), 2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 228; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_t_5 = NULL; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; goto __pyx_L4_unpacking_done; __pyx_L3_unpacking_failed:; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_5 = NULL; if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 228; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_L4_unpacking_done:; } __pyx_v_x = __pyx_t_2; __pyx_t_2 = 0; __pyx_v_y = __pyx_t_4; __pyx_t_4 = 0; /* "pygame_sdl2/rect.pyx":229 * def inflate_ip(self, *args): * x, y = flatten(args) * c = self.center # <<<<<<<<<<<<<< * self.w += x * self.h += y */ __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_center); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 229; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_v_c = __pyx_t_1; __pyx_t_1 = 0; /* "pygame_sdl2/rect.pyx":230 * x, y = flatten(args) * c = self.center * self.w += x # <<<<<<<<<<<<<< * self.h += y * self.center = c */ __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_self->w); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 230; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_t_4 = PyNumber_InPlaceAdd(__pyx_t_1, __pyx_v_x); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 230; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_6 = __Pyx_PyInt_As_int(__pyx_t_4); if (unlikely((__pyx_t_6 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 230; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_v_self->w = __pyx_t_6; /* "pygame_sdl2/rect.pyx":231 * c = self.center * self.w += x * self.h += y # <<<<<<<<<<<<<< * self.center = c * */ __pyx_t_4 = __Pyx_PyInt_From_int(__pyx_v_self->h); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 231; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); __pyx_t_1 = PyNumber_InPlaceAdd(__pyx_t_4, __pyx_v_y); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 231; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_t_6 = __Pyx_PyInt_As_int(__pyx_t_1); if (unlikely((__pyx_t_6 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 231; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_v_self->h = __pyx_t_6; /* "pygame_sdl2/rect.pyx":232 * self.w += x * self.h += y * self.center = c # <<<<<<<<<<<<<< * * def clamp(self, other): */ if (__Pyx_PyObject_SetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_center, __pyx_v_c) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 232; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "pygame_sdl2/rect.pyx":227 * return r * * def inflate_ip(self, *args): # <<<<<<<<<<<<<< * x, y = flatten(args) * c = self.center */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_AddTraceback("pygame_sdl2.rect.Rect.inflate_ip", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF(__pyx_v_x); __Pyx_XDECREF(__pyx_v_y); __Pyx_XDECREF(__pyx_v_c); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/rect.pyx":234 * self.center = c * * def clamp(self, other): # <<<<<<<<<<<<<< * r = self.copy() * r.clamp_ip(other) */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_4rect_4Rect_27clamp(PyObject *__pyx_v_self, PyObject *__pyx_v_other); /*proto*/ static PyObject *__pyx_pw_11pygame_sdl2_4rect_4Rect_27clamp(PyObject *__pyx_v_self, PyObject *__pyx_v_other) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("clamp (wrapper)", 0); __pyx_r = __pyx_pf_11pygame_sdl2_4rect_4Rect_26clamp(((struct __pyx_obj_11pygame_sdl2_4rect_Rect *)__pyx_v_self), ((PyObject *)__pyx_v_other)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_4rect_4Rect_26clamp(struct __pyx_obj_11pygame_sdl2_4rect_Rect *__pyx_v_self, PyObject *__pyx_v_other) { PyObject *__pyx_v_r = NULL; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("clamp", 0); /* "pygame_sdl2/rect.pyx":235 * * def clamp(self, other): * r = self.copy() # <<<<<<<<<<<<<< * r.clamp_ip(other) * return r */ __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_copy); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 235; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = NULL; if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_2))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); if (likely(__pyx_t_3)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); } } if (__pyx_t_3) { __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 235; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } else { __pyx_t_1 = __Pyx_PyObject_CallNoArg(__pyx_t_2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 235; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_v_r = __pyx_t_1; __pyx_t_1 = 0; /* "pygame_sdl2/rect.pyx":236 * def clamp(self, other): * r = self.copy() * r.clamp_ip(other) # <<<<<<<<<<<<<< * return r * */ __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_r, __pyx_n_s_clamp_ip); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 236; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = NULL; if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_2))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); if (likely(__pyx_t_3)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); } } if (!__pyx_t_3) { __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_v_other); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 236; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); } else { __pyx_t_4 = PyTuple_New(1+1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 236; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_3); __pyx_t_3 = NULL; __Pyx_INCREF(__pyx_v_other); __Pyx_GIVEREF(__pyx_v_other); PyTuple_SET_ITEM(__pyx_t_4, 0+1, __pyx_v_other); __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_4, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 236; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; } __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "pygame_sdl2/rect.pyx":237 * r = self.copy() * r.clamp_ip(other) * return r # <<<<<<<<<<<<<< * * def clamp_ip(self, other): */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(__pyx_v_r); __pyx_r = __pyx_v_r; goto __pyx_L0; /* "pygame_sdl2/rect.pyx":234 * self.center = c * * def clamp(self, other): # <<<<<<<<<<<<<< * r = self.copy() * r.clamp_ip(other) */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_AddTraceback("pygame_sdl2.rect.Rect.clamp", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF(__pyx_v_r); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/rect.pyx":239 * return r * * def clamp_ip(self, other): # <<<<<<<<<<<<<< * if not isinstance(other, Rect): * other = Rect(other) */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_4rect_4Rect_29clamp_ip(PyObject *__pyx_v_self, PyObject *__pyx_v_other); /*proto*/ static PyObject *__pyx_pw_11pygame_sdl2_4rect_4Rect_29clamp_ip(PyObject *__pyx_v_self, PyObject *__pyx_v_other) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("clamp_ip (wrapper)", 0); __pyx_r = __pyx_pf_11pygame_sdl2_4rect_4Rect_28clamp_ip(((struct __pyx_obj_11pygame_sdl2_4rect_Rect *)__pyx_v_self), ((PyObject *)__pyx_v_other)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_4rect_4Rect_28clamp_ip(struct __pyx_obj_11pygame_sdl2_4rect_Rect *__pyx_v_self, PyObject *__pyx_v_other) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; int __pyx_t_2; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; PyObject *__pyx_t_5 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("clamp_ip", 0); __Pyx_INCREF(__pyx_v_other); /* "pygame_sdl2/rect.pyx":240 * * def clamp_ip(self, other): * if not isinstance(other, Rect): # <<<<<<<<<<<<<< * other = Rect(other) * */ __pyx_t_1 = __Pyx_TypeCheck(__pyx_v_other, __pyx_ptype_11pygame_sdl2_4rect_Rect); __pyx_t_2 = ((!(__pyx_t_1 != 0)) != 0); if (__pyx_t_2) { /* "pygame_sdl2/rect.pyx":241 * def clamp_ip(self, other): * if not isinstance(other, Rect): * other = Rect(other) # <<<<<<<<<<<<<< * * if self.w > other.w or self.h > other.h: */ __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 241; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __Pyx_INCREF(__pyx_v_other); __Pyx_GIVEREF(__pyx_v_other); PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_other); __pyx_t_4 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_11pygame_sdl2_4rect_Rect), __pyx_t_3, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 241; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF_SET(__pyx_v_other, __pyx_t_4); __pyx_t_4 = 0; /* "pygame_sdl2/rect.pyx":240 * * def clamp_ip(self, other): * if not isinstance(other, Rect): # <<<<<<<<<<<<<< * other = Rect(other) * */ } /* "pygame_sdl2/rect.pyx":243 * other = Rect(other) * * if self.w > other.w or self.h > other.h: # <<<<<<<<<<<<<< * self.center = other.center * else: */ __pyx_t_4 = __Pyx_PyInt_From_int(__pyx_v_self->w); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 243; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_other, __pyx_n_s_w); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 243; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __pyx_t_5 = PyObject_RichCompare(__pyx_t_4, __pyx_t_3, Py_GT); __Pyx_XGOTREF(__pyx_t_5); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 243; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_1 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 243; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; if (!__pyx_t_1) { } else { __pyx_t_2 = __pyx_t_1; goto __pyx_L5_bool_binop_done; } __pyx_t_5 = __Pyx_PyInt_From_int(__pyx_v_self->h); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 243; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_other, __pyx_n_s_h); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 243; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = PyObject_RichCompare(__pyx_t_5, __pyx_t_3, Py_GT); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 243; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_1 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 243; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_t_2 = __pyx_t_1; __pyx_L5_bool_binop_done:; if (__pyx_t_2) { /* "pygame_sdl2/rect.pyx":244 * * if self.w > other.w or self.h > other.h: * self.center = other.center # <<<<<<<<<<<<<< * else: * if self.left < other.left: */ __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_other, __pyx_n_s_center); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 244; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); if (__Pyx_PyObject_SetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_center, __pyx_t_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 244; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; /* "pygame_sdl2/rect.pyx":243 * other = Rect(other) * * if self.w > other.w or self.h > other.h: # <<<<<<<<<<<<<< * self.center = other.center * else: */ goto __pyx_L4; } /* "pygame_sdl2/rect.pyx":246 * self.center = other.center * else: * if self.left < other.left: # <<<<<<<<<<<<<< * self.left = other.left * elif self.right > other.right: */ /*else*/ { __pyx_t_4 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_left); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 246; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_other, __pyx_n_s_left); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 246; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __pyx_t_5 = PyObject_RichCompare(__pyx_t_4, __pyx_t_3, Py_LT); __Pyx_XGOTREF(__pyx_t_5); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 246; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 246; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; if (__pyx_t_2) { /* "pygame_sdl2/rect.pyx":247 * else: * if self.left < other.left: * self.left = other.left # <<<<<<<<<<<<<< * elif self.right > other.right: * self.right = other.right */ __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_other, __pyx_n_s_left); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 247; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); if (__Pyx_PyObject_SetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_left, __pyx_t_5) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 247; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; /* "pygame_sdl2/rect.pyx":246 * self.center = other.center * else: * if self.left < other.left: # <<<<<<<<<<<<<< * self.left = other.left * elif self.right > other.right: */ goto __pyx_L7; } /* "pygame_sdl2/rect.pyx":248 * if self.left < other.left: * self.left = other.left * elif self.right > other.right: # <<<<<<<<<<<<<< * self.right = other.right * if self.top < other.top: */ __pyx_t_5 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_right); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 248; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_other, __pyx_n_s_right); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 248; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = PyObject_RichCompare(__pyx_t_5, __pyx_t_3, Py_GT); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 248; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 248; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; if (__pyx_t_2) { /* "pygame_sdl2/rect.pyx":249 * self.left = other.left * elif self.right > other.right: * self.right = other.right # <<<<<<<<<<<<<< * if self.top < other.top: * self.top = other.top */ __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_other, __pyx_n_s_right); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 249; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); if (__Pyx_PyObject_SetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_right, __pyx_t_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 249; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; /* "pygame_sdl2/rect.pyx":248 * if self.left < other.left: * self.left = other.left * elif self.right > other.right: # <<<<<<<<<<<<<< * self.right = other.right * if self.top < other.top: */ } __pyx_L7:; /* "pygame_sdl2/rect.pyx":250 * elif self.right > other.right: * self.right = other.right * if self.top < other.top: # <<<<<<<<<<<<<< * self.top = other.top * elif self.bottom > other.bottom: */ __pyx_t_4 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_top); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 250; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_other, __pyx_n_s_top); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 250; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __pyx_t_5 = PyObject_RichCompare(__pyx_t_4, __pyx_t_3, Py_LT); __Pyx_XGOTREF(__pyx_t_5); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 250; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 250; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; if (__pyx_t_2) { /* "pygame_sdl2/rect.pyx":251 * self.right = other.right * if self.top < other.top: * self.top = other.top # <<<<<<<<<<<<<< * elif self.bottom > other.bottom: * self.bottom = other.bottom */ __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_other, __pyx_n_s_top); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 251; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); if (__Pyx_PyObject_SetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_top, __pyx_t_5) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 251; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; /* "pygame_sdl2/rect.pyx":250 * elif self.right > other.right: * self.right = other.right * if self.top < other.top: # <<<<<<<<<<<<<< * self.top = other.top * elif self.bottom > other.bottom: */ goto __pyx_L8; } /* "pygame_sdl2/rect.pyx":252 * if self.top < other.top: * self.top = other.top * elif self.bottom > other.bottom: # <<<<<<<<<<<<<< * self.bottom = other.bottom * */ __pyx_t_5 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_bottom); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 252; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_other, __pyx_n_s_bottom); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 252; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = PyObject_RichCompare(__pyx_t_5, __pyx_t_3, Py_GT); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 252; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 252; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; if (__pyx_t_2) { /* "pygame_sdl2/rect.pyx":253 * self.top = other.top * elif self.bottom > other.bottom: * self.bottom = other.bottom # <<<<<<<<<<<<<< * * def clip(self, other, y=None, w=None, h=None): */ __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_other, __pyx_n_s_bottom); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 253; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); if (__Pyx_PyObject_SetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_bottom, __pyx_t_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 253; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; /* "pygame_sdl2/rect.pyx":252 * if self.top < other.top: * self.top = other.top * elif self.bottom > other.bottom: # <<<<<<<<<<<<<< * self.bottom = other.bottom * */ } __pyx_L8:; } __pyx_L4:; /* "pygame_sdl2/rect.pyx":239 * return r * * def clamp_ip(self, other): # <<<<<<<<<<<<<< * if not isinstance(other, Rect): * other = Rect(other) */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_5); __Pyx_AddTraceback("pygame_sdl2.rect.Rect.clamp_ip", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF(__pyx_v_other); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/rect.pyx":255 * self.bottom = other.bottom * * def clip(self, other, y=None, w=None, h=None): # <<<<<<<<<<<<<< * if type(other) == int: * other = Rect(other, y, w, h) */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_4rect_4Rect_31clip(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static PyObject *__pyx_pw_11pygame_sdl2_4rect_4Rect_31clip(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_other = 0; PyObject *__pyx_v_y = 0; PyObject *__pyx_v_w = 0; PyObject *__pyx_v_h = 0; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("clip (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_other,&__pyx_n_s_y,&__pyx_n_s_w,&__pyx_n_s_h,0}; PyObject* values[4] = {0,0,0,0}; values[1] = ((PyObject *)Py_None); values[2] = ((PyObject *)Py_None); values[3] = ((PyObject *)Py_None); if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_other)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; case 1: if (kw_args > 0) { PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_y); if (value) { values[1] = value; kw_args--; } } case 2: if (kw_args > 0) { PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_w); if (value) { values[2] = value; kw_args--; } } case 3: if (kw_args > 0) { PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_h); if (value) { values[3] = value; kw_args--; } } } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "clip") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 255; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } } else { switch (PyTuple_GET_SIZE(__pyx_args)) { case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_other = values[0]; __pyx_v_y = values[1]; __pyx_v_w = values[2]; __pyx_v_h = values[3]; } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("clip", 0, 1, 4, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 255; __pyx_clineno = __LINE__; goto __pyx_L3_error;} __pyx_L3_error:; __Pyx_AddTraceback("pygame_sdl2.rect.Rect.clip", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_11pygame_sdl2_4rect_4Rect_30clip(((struct __pyx_obj_11pygame_sdl2_4rect_Rect *)__pyx_v_self), __pyx_v_other, __pyx_v_y, __pyx_v_w, __pyx_v_h); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_4rect_4Rect_30clip(struct __pyx_obj_11pygame_sdl2_4rect_Rect *__pyx_v_self, PyObject *__pyx_v_other, PyObject *__pyx_v_y, PyObject *__pyx_v_w, PyObject *__pyx_v_h) { PyObject *__pyx_v_r = NULL; PyObject *__pyx_v_d = NULL; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_t_2; PyObject *__pyx_t_3 = NULL; int __pyx_t_4; PyObject *__pyx_t_5 = NULL; PyObject *__pyx_t_6 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("clip", 0); __Pyx_INCREF(__pyx_v_other); /* "pygame_sdl2/rect.pyx":256 * * def clip(self, other, y=None, w=None, h=None): * if type(other) == int: # <<<<<<<<<<<<<< * other = Rect(other, y, w, h) * */ __pyx_t_1 = PyObject_RichCompare(((PyObject *)Py_TYPE(__pyx_v_other)), ((PyObject *)(&PyInt_Type)), Py_EQ); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 256; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 256; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (__pyx_t_2) { /* "pygame_sdl2/rect.pyx":257 * def clip(self, other, y=None, w=None, h=None): * if type(other) == int: * other = Rect(other, y, w, h) # <<<<<<<<<<<<<< * * if not isinstance(other, Rect): */ __pyx_t_1 = PyTuple_New(4); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 257; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __Pyx_INCREF(__pyx_v_other); __Pyx_GIVEREF(__pyx_v_other); PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_other); __Pyx_INCREF(__pyx_v_y); __Pyx_GIVEREF(__pyx_v_y); PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_v_y); __Pyx_INCREF(__pyx_v_w); __Pyx_GIVEREF(__pyx_v_w); PyTuple_SET_ITEM(__pyx_t_1, 2, __pyx_v_w); __Pyx_INCREF(__pyx_v_h); __Pyx_GIVEREF(__pyx_v_h); PyTuple_SET_ITEM(__pyx_t_1, 3, __pyx_v_h); __pyx_t_3 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_11pygame_sdl2_4rect_Rect), __pyx_t_1, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 257; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF_SET(__pyx_v_other, __pyx_t_3); __pyx_t_3 = 0; /* "pygame_sdl2/rect.pyx":256 * * def clip(self, other, y=None, w=None, h=None): * if type(other) == int: # <<<<<<<<<<<<<< * other = Rect(other, y, w, h) * */ } /* "pygame_sdl2/rect.pyx":259 * other = Rect(other, y, w, h) * * if not isinstance(other, Rect): # <<<<<<<<<<<<<< * other = Rect(other) * */ __pyx_t_2 = __Pyx_TypeCheck(__pyx_v_other, __pyx_ptype_11pygame_sdl2_4rect_Rect); __pyx_t_4 = ((!(__pyx_t_2 != 0)) != 0); if (__pyx_t_4) { /* "pygame_sdl2/rect.pyx":260 * * if not isinstance(other, Rect): * other = Rect(other) # <<<<<<<<<<<<<< * * if not self.colliderect(other): */ __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 260; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __Pyx_INCREF(__pyx_v_other); __Pyx_GIVEREF(__pyx_v_other); PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_other); __pyx_t_1 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_11pygame_sdl2_4rect_Rect), __pyx_t_3, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 260; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF_SET(__pyx_v_other, __pyx_t_1); __pyx_t_1 = 0; /* "pygame_sdl2/rect.pyx":259 * other = Rect(other, y, w, h) * * if not isinstance(other, Rect): # <<<<<<<<<<<<<< * other = Rect(other) * */ } /* "pygame_sdl2/rect.pyx":262 * other = Rect(other) * * if not self.colliderect(other): # <<<<<<<<<<<<<< * return Rect(0,0,0,0) * */ __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_colliderect); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 262; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __pyx_t_5 = NULL; if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_3))) { __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_3); if (likely(__pyx_t_5)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); __Pyx_INCREF(__pyx_t_5); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_3, function); } } if (!__pyx_t_5) { __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_v_other); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 262; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); } else { __pyx_t_6 = PyTuple_New(1+1); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 262; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_6); __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_5); __pyx_t_5 = NULL; __Pyx_INCREF(__pyx_v_other); __Pyx_GIVEREF(__pyx_v_other); PyTuple_SET_ITEM(__pyx_t_6, 0+1, __pyx_v_other); __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_6, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 262; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; } __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_4 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 262; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_2 = ((!__pyx_t_4) != 0); if (__pyx_t_2) { /* "pygame_sdl2/rect.pyx":263 * * if not self.colliderect(other): * return Rect(0,0,0,0) # <<<<<<<<<<<<<< * * r = self.copy() */ __Pyx_XDECREF(__pyx_r); __pyx_t_1 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_11pygame_sdl2_4rect_Rect), __pyx_tuple__2, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 263; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "pygame_sdl2/rect.pyx":262 * other = Rect(other) * * if not self.colliderect(other): # <<<<<<<<<<<<<< * return Rect(0,0,0,0) * */ } /* "pygame_sdl2/rect.pyx":265 * return Rect(0,0,0,0) * * r = self.copy() # <<<<<<<<<<<<<< * * # Remember that (0,0) is the top left. */ __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_copy); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 265; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __pyx_t_6 = NULL; if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_3))) { __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_3); if (likely(__pyx_t_6)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); __Pyx_INCREF(__pyx_t_6); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_3, function); } } if (__pyx_t_6) { __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_6); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 265; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; } else { __pyx_t_1 = __Pyx_PyObject_CallNoArg(__pyx_t_3); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 265; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_v_r = __pyx_t_1; __pyx_t_1 = 0; /* "pygame_sdl2/rect.pyx":268 * * # Remember that (0,0) is the top left. * if r.left < other.left: # <<<<<<<<<<<<<< * d = other.left - r.left * r.left += d */ __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_r, __pyx_n_s_left); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 268; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_other, __pyx_n_s_left); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 268; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __pyx_t_6 = PyObject_RichCompare(__pyx_t_1, __pyx_t_3, Py_LT); __Pyx_XGOTREF(__pyx_t_6); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 268; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_6); if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 268; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; if (__pyx_t_2) { /* "pygame_sdl2/rect.pyx":269 * # Remember that (0,0) is the top left. * if r.left < other.left: * d = other.left - r.left # <<<<<<<<<<<<<< * r.left += d * r.width -= d */ __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_other, __pyx_n_s_left); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 269; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_6); __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_r, __pyx_n_s_left); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 269; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __pyx_t_1 = PyNumber_Subtract(__pyx_t_6, __pyx_t_3); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 269; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_v_d = __pyx_t_1; __pyx_t_1 = 0; /* "pygame_sdl2/rect.pyx":270 * if r.left < other.left: * d = other.left - r.left * r.left += d # <<<<<<<<<<<<<< * r.width -= d * if r.right > other.right: */ __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_r, __pyx_n_s_left); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 270; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_t_3 = PyNumber_InPlaceAdd(__pyx_t_1, __pyx_v_d); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 270; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (__Pyx_PyObject_SetAttrStr(__pyx_v_r, __pyx_n_s_left, __pyx_t_3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 270; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "pygame_sdl2/rect.pyx":271 * d = other.left - r.left * r.left += d * r.width -= d # <<<<<<<<<<<<<< * if r.right > other.right: * d = r.right - other.right */ __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_r, __pyx_n_s_width); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 271; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __pyx_t_1 = PyNumber_InPlaceSubtract(__pyx_t_3, __pyx_v_d); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 271; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; if (__Pyx_PyObject_SetAttrStr(__pyx_v_r, __pyx_n_s_width, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 271; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "pygame_sdl2/rect.pyx":268 * * # Remember that (0,0) is the top left. * if r.left < other.left: # <<<<<<<<<<<<<< * d = other.left - r.left * r.left += d */ } /* "pygame_sdl2/rect.pyx":272 * r.left += d * r.width -= d * if r.right > other.right: # <<<<<<<<<<<<<< * d = r.right - other.right * r.width -=d */ __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_r, __pyx_n_s_right); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 272; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_other, __pyx_n_s_right); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 272; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __pyx_t_6 = PyObject_RichCompare(__pyx_t_1, __pyx_t_3, Py_GT); __Pyx_XGOTREF(__pyx_t_6); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 272; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_6); if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 272; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; if (__pyx_t_2) { /* "pygame_sdl2/rect.pyx":273 * r.width -= d * if r.right > other.right: * d = r.right - other.right # <<<<<<<<<<<<<< * r.width -=d * if r.top < other.top: */ __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_r, __pyx_n_s_right); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 273; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_6); __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_other, __pyx_n_s_right); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 273; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __pyx_t_1 = PyNumber_Subtract(__pyx_t_6, __pyx_t_3); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 273; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_XDECREF_SET(__pyx_v_d, __pyx_t_1); __pyx_t_1 = 0; /* "pygame_sdl2/rect.pyx":274 * if r.right > other.right: * d = r.right - other.right * r.width -=d # <<<<<<<<<<<<<< * if r.top < other.top: * d = other.top - r.top */ __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_r, __pyx_n_s_width); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 274; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_t_3 = PyNumber_InPlaceSubtract(__pyx_t_1, __pyx_v_d); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 274; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (__Pyx_PyObject_SetAttrStr(__pyx_v_r, __pyx_n_s_width, __pyx_t_3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 274; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "pygame_sdl2/rect.pyx":272 * r.left += d * r.width -= d * if r.right > other.right: # <<<<<<<<<<<<<< * d = r.right - other.right * r.width -=d */ } /* "pygame_sdl2/rect.pyx":275 * d = r.right - other.right * r.width -=d * if r.top < other.top: # <<<<<<<<<<<<<< * d = other.top - r.top * r.top += d */ __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_r, __pyx_n_s_top); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 275; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_other, __pyx_n_s_top); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 275; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_t_6 = PyObject_RichCompare(__pyx_t_3, __pyx_t_1, Py_LT); __Pyx_XGOTREF(__pyx_t_6); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 275; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_6); if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 275; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; if (__pyx_t_2) { /* "pygame_sdl2/rect.pyx":276 * r.width -=d * if r.top < other.top: * d = other.top - r.top # <<<<<<<<<<<<<< * r.top += d * r.height -= d */ __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_other, __pyx_n_s_top); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 276; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_6); __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_r, __pyx_n_s_top); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 276; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_t_3 = PyNumber_Subtract(__pyx_t_6, __pyx_t_1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 276; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_XDECREF_SET(__pyx_v_d, __pyx_t_3); __pyx_t_3 = 0; /* "pygame_sdl2/rect.pyx":277 * if r.top < other.top: * d = other.top - r.top * r.top += d # <<<<<<<<<<<<<< * r.height -= d * if r.bottom > other.bottom: */ __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_r, __pyx_n_s_top); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 277; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __pyx_t_1 = PyNumber_InPlaceAdd(__pyx_t_3, __pyx_v_d); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 277; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; if (__Pyx_PyObject_SetAttrStr(__pyx_v_r, __pyx_n_s_top, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 277; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "pygame_sdl2/rect.pyx":278 * d = other.top - r.top * r.top += d * r.height -= d # <<<<<<<<<<<<<< * if r.bottom > other.bottom: * d = r.bottom - other.bottom */ __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_r, __pyx_n_s_height); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 278; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_t_3 = PyNumber_InPlaceSubtract(__pyx_t_1, __pyx_v_d); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 278; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (__Pyx_PyObject_SetAttrStr(__pyx_v_r, __pyx_n_s_height, __pyx_t_3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 278; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "pygame_sdl2/rect.pyx":275 * d = r.right - other.right * r.width -=d * if r.top < other.top: # <<<<<<<<<<<<<< * d = other.top - r.top * r.top += d */ } /* "pygame_sdl2/rect.pyx":279 * r.top += d * r.height -= d * if r.bottom > other.bottom: # <<<<<<<<<<<<<< * d = r.bottom - other.bottom * r.height -= d */ __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_r, __pyx_n_s_bottom); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 279; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_other, __pyx_n_s_bottom); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 279; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_t_6 = PyObject_RichCompare(__pyx_t_3, __pyx_t_1, Py_GT); __Pyx_XGOTREF(__pyx_t_6); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 279; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_6); if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 279; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; if (__pyx_t_2) { /* "pygame_sdl2/rect.pyx":280 * r.height -= d * if r.bottom > other.bottom: * d = r.bottom - other.bottom # <<<<<<<<<<<<<< * r.height -= d * */ __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_r, __pyx_n_s_bottom); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 280; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_6); __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_other, __pyx_n_s_bottom); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 280; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_t_3 = PyNumber_Subtract(__pyx_t_6, __pyx_t_1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 280; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_XDECREF_SET(__pyx_v_d, __pyx_t_3); __pyx_t_3 = 0; /* "pygame_sdl2/rect.pyx":281 * if r.bottom > other.bottom: * d = r.bottom - other.bottom * r.height -= d # <<<<<<<<<<<<<< * * return r */ __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_r, __pyx_n_s_height); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 281; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __pyx_t_1 = PyNumber_InPlaceSubtract(__pyx_t_3, __pyx_v_d); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 281; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; if (__Pyx_PyObject_SetAttrStr(__pyx_v_r, __pyx_n_s_height, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 281; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "pygame_sdl2/rect.pyx":279 * r.top += d * r.height -= d * if r.bottom > other.bottom: # <<<<<<<<<<<<<< * d = r.bottom - other.bottom * r.height -= d */ } /* "pygame_sdl2/rect.pyx":283 * r.height -= d * * return r # <<<<<<<<<<<<<< * * def union(self, other): */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(__pyx_v_r); __pyx_r = __pyx_v_r; goto __pyx_L0; /* "pygame_sdl2/rect.pyx":255 * self.bottom = other.bottom * * def clip(self, other, y=None, w=None, h=None): # <<<<<<<<<<<<<< * if type(other) == int: * other = Rect(other, y, w, h) */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_5); __Pyx_XDECREF(__pyx_t_6); __Pyx_AddTraceback("pygame_sdl2.rect.Rect.clip", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF(__pyx_v_r); __Pyx_XDECREF(__pyx_v_d); __Pyx_XDECREF(__pyx_v_other); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/rect.pyx":285 * return r * * def union(self, other): # <<<<<<<<<<<<<< * r = self.copy() * r.union_ip(other) */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_4rect_4Rect_33union(PyObject *__pyx_v_self, PyObject *__pyx_v_other); /*proto*/ static PyObject *__pyx_pw_11pygame_sdl2_4rect_4Rect_33union(PyObject *__pyx_v_self, PyObject *__pyx_v_other) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("union (wrapper)", 0); __pyx_r = __pyx_pf_11pygame_sdl2_4rect_4Rect_32union(((struct __pyx_obj_11pygame_sdl2_4rect_Rect *)__pyx_v_self), ((PyObject *)__pyx_v_other)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_4rect_4Rect_32union(struct __pyx_obj_11pygame_sdl2_4rect_Rect *__pyx_v_self, PyObject *__pyx_v_other) { PyObject *__pyx_v_r = NULL; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("union", 0); /* "pygame_sdl2/rect.pyx":286 * * def union(self, other): * r = self.copy() # <<<<<<<<<<<<<< * r.union_ip(other) * return r */ __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_copy); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 286; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = NULL; if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_2))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); if (likely(__pyx_t_3)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); } } if (__pyx_t_3) { __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 286; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } else { __pyx_t_1 = __Pyx_PyObject_CallNoArg(__pyx_t_2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 286; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_v_r = __pyx_t_1; __pyx_t_1 = 0; /* "pygame_sdl2/rect.pyx":287 * def union(self, other): * r = self.copy() * r.union_ip(other) # <<<<<<<<<<<<<< * return r * */ __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_r, __pyx_n_s_union_ip); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 287; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = NULL; if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_2))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); if (likely(__pyx_t_3)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); } } if (!__pyx_t_3) { __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_v_other); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 287; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); } else { __pyx_t_4 = PyTuple_New(1+1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 287; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_3); __pyx_t_3 = NULL; __Pyx_INCREF(__pyx_v_other); __Pyx_GIVEREF(__pyx_v_other); PyTuple_SET_ITEM(__pyx_t_4, 0+1, __pyx_v_other); __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_4, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 287; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; } __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "pygame_sdl2/rect.pyx":288 * r = self.copy() * r.union_ip(other) * return r # <<<<<<<<<<<<<< * * def union_ip(self, other): */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(__pyx_v_r); __pyx_r = __pyx_v_r; goto __pyx_L0; /* "pygame_sdl2/rect.pyx":285 * return r * * def union(self, other): # <<<<<<<<<<<<<< * r = self.copy() * r.union_ip(other) */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_AddTraceback("pygame_sdl2.rect.Rect.union", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF(__pyx_v_r); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/rect.pyx":290 * return r * * def union_ip(self, other): # <<<<<<<<<<<<<< * if not isinstance(other, Rect): * other = Rect(other) */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_4rect_4Rect_35union_ip(PyObject *__pyx_v_self, PyObject *__pyx_v_other); /*proto*/ static PyObject *__pyx_pw_11pygame_sdl2_4rect_4Rect_35union_ip(PyObject *__pyx_v_self, PyObject *__pyx_v_other) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("union_ip (wrapper)", 0); __pyx_r = __pyx_pf_11pygame_sdl2_4rect_4Rect_34union_ip(((struct __pyx_obj_11pygame_sdl2_4rect_Rect *)__pyx_v_self), ((PyObject *)__pyx_v_other)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_4rect_4Rect_34union_ip(struct __pyx_obj_11pygame_sdl2_4rect_Rect *__pyx_v_self, PyObject *__pyx_v_other) { PyObject *__pyx_v_x = NULL; PyObject *__pyx_v_y = NULL; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; int __pyx_t_2; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; int __pyx_t_5; PyObject *__pyx_t_6 = NULL; PyObject *__pyx_t_7 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("union_ip", 0); __Pyx_INCREF(__pyx_v_other); /* "pygame_sdl2/rect.pyx":291 * * def union_ip(self, other): * if not isinstance(other, Rect): # <<<<<<<<<<<<<< * other = Rect(other) * */ __pyx_t_1 = __Pyx_TypeCheck(__pyx_v_other, __pyx_ptype_11pygame_sdl2_4rect_Rect); __pyx_t_2 = ((!(__pyx_t_1 != 0)) != 0); if (__pyx_t_2) { /* "pygame_sdl2/rect.pyx":292 * def union_ip(self, other): * if not isinstance(other, Rect): * other = Rect(other) # <<<<<<<<<<<<<< * * x = min(self.x, other.x) */ __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 292; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __Pyx_INCREF(__pyx_v_other); __Pyx_GIVEREF(__pyx_v_other); PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_other); __pyx_t_4 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_11pygame_sdl2_4rect_Rect), __pyx_t_3, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 292; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF_SET(__pyx_v_other, __pyx_t_4); __pyx_t_4 = 0; /* "pygame_sdl2/rect.pyx":291 * * def union_ip(self, other): * if not isinstance(other, Rect): # <<<<<<<<<<<<<< * other = Rect(other) * */ } /* "pygame_sdl2/rect.pyx":294 * other = Rect(other) * * x = min(self.x, other.x) # <<<<<<<<<<<<<< * y = min(self.y, other.y) * self.w = max(self.right, other.right) - x */ __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_other, __pyx_n_s_x); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 294; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); __pyx_t_5 = __pyx_v_self->x; __pyx_t_6 = __Pyx_PyInt_From_int(__pyx_t_5); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 294; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_6); __pyx_t_7 = PyObject_RichCompare(__pyx_t_4, __pyx_t_6, Py_LT); __Pyx_XGOTREF(__pyx_t_7); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 294; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_7); if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 294; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; if (__pyx_t_2) { __Pyx_INCREF(__pyx_t_4); __pyx_t_3 = __pyx_t_4; } else { __pyx_t_7 = __Pyx_PyInt_From_int(__pyx_t_5); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 294; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_7); __pyx_t_3 = __pyx_t_7; __pyx_t_7 = 0; } __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_t_4 = __pyx_t_3; __Pyx_INCREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_v_x = __pyx_t_4; __pyx_t_4 = 0; /* "pygame_sdl2/rect.pyx":295 * * x = min(self.x, other.x) * y = min(self.y, other.y) # <<<<<<<<<<<<<< * self.w = max(self.right, other.right) - x * self.h = max(self.bottom, other.bottom) - y */ __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_other, __pyx_n_s_y); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 295; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); __pyx_t_5 = __pyx_v_self->y; __pyx_t_7 = __Pyx_PyInt_From_int(__pyx_t_5); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 295; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_7); __pyx_t_6 = PyObject_RichCompare(__pyx_t_4, __pyx_t_7, Py_LT); __Pyx_XGOTREF(__pyx_t_6); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 295; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_6); if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 295; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; if (__pyx_t_2) { __Pyx_INCREF(__pyx_t_4); __pyx_t_3 = __pyx_t_4; } else { __pyx_t_6 = __Pyx_PyInt_From_int(__pyx_t_5); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 295; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_6); __pyx_t_3 = __pyx_t_6; __pyx_t_6 = 0; } __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_t_4 = __pyx_t_3; __Pyx_INCREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_v_y = __pyx_t_4; __pyx_t_4 = 0; /* "pygame_sdl2/rect.pyx":296 * x = min(self.x, other.x) * y = min(self.y, other.y) * self.w = max(self.right, other.right) - x # <<<<<<<<<<<<<< * self.h = max(self.bottom, other.bottom) - y * self.x = x */ __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_other, __pyx_n_s_right); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 296; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_right); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 296; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __pyx_t_7 = PyObject_RichCompare(__pyx_t_4, __pyx_t_3, Py_GT); __Pyx_XGOTREF(__pyx_t_7); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 296; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_7); if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 296; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; if (__pyx_t_2) { __Pyx_INCREF(__pyx_t_4); __pyx_t_6 = __pyx_t_4; } else { __Pyx_INCREF(__pyx_t_3); __pyx_t_6 = __pyx_t_3; } __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_t_4 = PyNumber_Subtract(__pyx_t_6, __pyx_v_x); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 296; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __pyx_t_5 = __Pyx_PyInt_As_int(__pyx_t_4); if (unlikely((__pyx_t_5 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 296; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_v_self->w = __pyx_t_5; /* "pygame_sdl2/rect.pyx":297 * y = min(self.y, other.y) * self.w = max(self.right, other.right) - x * self.h = max(self.bottom, other.bottom) - y # <<<<<<<<<<<<<< * self.x = x * self.y = y */ __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_other, __pyx_n_s_bottom); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 297; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); __pyx_t_6 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_bottom); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 297; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_6); __pyx_t_7 = PyObject_RichCompare(__pyx_t_4, __pyx_t_6, Py_GT); __Pyx_XGOTREF(__pyx_t_7); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 297; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_7); if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 297; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; if (__pyx_t_2) { __Pyx_INCREF(__pyx_t_4); __pyx_t_3 = __pyx_t_4; } else { __Pyx_INCREF(__pyx_t_6); __pyx_t_3 = __pyx_t_6; } __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_t_4 = PyNumber_Subtract(__pyx_t_3, __pyx_v_y); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 297; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_5 = __Pyx_PyInt_As_int(__pyx_t_4); if (unlikely((__pyx_t_5 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 297; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_v_self->h = __pyx_t_5; /* "pygame_sdl2/rect.pyx":298 * self.w = max(self.right, other.right) - x * self.h = max(self.bottom, other.bottom) - y * self.x = x # <<<<<<<<<<<<<< * self.y = y * */ __pyx_t_5 = __Pyx_PyInt_As_int(__pyx_v_x); if (unlikely((__pyx_t_5 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 298; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_v_self->x = __pyx_t_5; /* "pygame_sdl2/rect.pyx":299 * self.h = max(self.bottom, other.bottom) - y * self.x = x * self.y = y # <<<<<<<<<<<<<< * * def unionall(self, other_seq): */ __pyx_t_5 = __Pyx_PyInt_As_int(__pyx_v_y); if (unlikely((__pyx_t_5 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 299; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_v_self->y = __pyx_t_5; /* "pygame_sdl2/rect.pyx":290 * return r * * def union_ip(self, other): # <<<<<<<<<<<<<< * if not isinstance(other, Rect): * other = Rect(other) */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_6); __Pyx_XDECREF(__pyx_t_7); __Pyx_AddTraceback("pygame_sdl2.rect.Rect.union_ip", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF(__pyx_v_x); __Pyx_XDECREF(__pyx_v_y); __Pyx_XDECREF(__pyx_v_other); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/rect.pyx":301 * self.y = y * * def unionall(self, other_seq): # <<<<<<<<<<<<<< * r = self.copy() * r.unionall_ip(other_seq) */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_4rect_4Rect_37unionall(PyObject *__pyx_v_self, PyObject *__pyx_v_other_seq); /*proto*/ static PyObject *__pyx_pw_11pygame_sdl2_4rect_4Rect_37unionall(PyObject *__pyx_v_self, PyObject *__pyx_v_other_seq) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("unionall (wrapper)", 0); __pyx_r = __pyx_pf_11pygame_sdl2_4rect_4Rect_36unionall(((struct __pyx_obj_11pygame_sdl2_4rect_Rect *)__pyx_v_self), ((PyObject *)__pyx_v_other_seq)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_4rect_4Rect_36unionall(struct __pyx_obj_11pygame_sdl2_4rect_Rect *__pyx_v_self, PyObject *__pyx_v_other_seq) { PyObject *__pyx_v_r = NULL; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("unionall", 0); /* "pygame_sdl2/rect.pyx":302 * * def unionall(self, other_seq): * r = self.copy() # <<<<<<<<<<<<<< * r.unionall_ip(other_seq) * return r */ __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_copy); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 302; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = NULL; if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_2))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); if (likely(__pyx_t_3)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); } } if (__pyx_t_3) { __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 302; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } else { __pyx_t_1 = __Pyx_PyObject_CallNoArg(__pyx_t_2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 302; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_v_r = __pyx_t_1; __pyx_t_1 = 0; /* "pygame_sdl2/rect.pyx":303 * def unionall(self, other_seq): * r = self.copy() * r.unionall_ip(other_seq) # <<<<<<<<<<<<<< * return r * */ __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_r, __pyx_n_s_unionall_ip); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 303; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = NULL; if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_2))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); if (likely(__pyx_t_3)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); } } if (!__pyx_t_3) { __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_v_other_seq); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 303; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); } else { __pyx_t_4 = PyTuple_New(1+1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 303; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_3); __pyx_t_3 = NULL; __Pyx_INCREF(__pyx_v_other_seq); __Pyx_GIVEREF(__pyx_v_other_seq); PyTuple_SET_ITEM(__pyx_t_4, 0+1, __pyx_v_other_seq); __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_4, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 303; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; } __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "pygame_sdl2/rect.pyx":304 * r = self.copy() * r.unionall_ip(other_seq) * return r # <<<<<<<<<<<<<< * * def unionall_ip(self, other_seq): */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(__pyx_v_r); __pyx_r = __pyx_v_r; goto __pyx_L0; /* "pygame_sdl2/rect.pyx":301 * self.y = y * * def unionall(self, other_seq): # <<<<<<<<<<<<<< * r = self.copy() * r.unionall_ip(other_seq) */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_AddTraceback("pygame_sdl2.rect.Rect.unionall", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF(__pyx_v_r); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/rect.pyx":306 * return r * * def unionall_ip(self, other_seq): # <<<<<<<<<<<<<< * for other in other_seq: * self.union_ip(other) */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_4rect_4Rect_39unionall_ip(PyObject *__pyx_v_self, PyObject *__pyx_v_other_seq); /*proto*/ static PyObject *__pyx_pw_11pygame_sdl2_4rect_4Rect_39unionall_ip(PyObject *__pyx_v_self, PyObject *__pyx_v_other_seq) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("unionall_ip (wrapper)", 0); __pyx_r = __pyx_pf_11pygame_sdl2_4rect_4Rect_38unionall_ip(((struct __pyx_obj_11pygame_sdl2_4rect_Rect *)__pyx_v_self), ((PyObject *)__pyx_v_other_seq)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_4rect_4Rect_38unionall_ip(struct __pyx_obj_11pygame_sdl2_4rect_Rect *__pyx_v_self, PyObject *__pyx_v_other_seq) { PyObject *__pyx_v_other = NULL; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; Py_ssize_t __pyx_t_2; PyObject *(*__pyx_t_3)(PyObject *); PyObject *__pyx_t_4 = NULL; PyObject *__pyx_t_5 = NULL; PyObject *__pyx_t_6 = NULL; PyObject *__pyx_t_7 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("unionall_ip", 0); /* "pygame_sdl2/rect.pyx":307 * * def unionall_ip(self, other_seq): * for other in other_seq: # <<<<<<<<<<<<<< * self.union_ip(other) * */ if (likely(PyList_CheckExact(__pyx_v_other_seq)) || PyTuple_CheckExact(__pyx_v_other_seq)) { __pyx_t_1 = __pyx_v_other_seq; __Pyx_INCREF(__pyx_t_1); __pyx_t_2 = 0; __pyx_t_3 = NULL; } else { __pyx_t_2 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_v_other_seq); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 307; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_t_3 = Py_TYPE(__pyx_t_1)->tp_iternext; if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 307; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } for (;;) { if (likely(!__pyx_t_3)) { if (likely(PyList_CheckExact(__pyx_t_1))) { if (__pyx_t_2 >= PyList_GET_SIZE(__pyx_t_1)) break; #if CYTHON_COMPILING_IN_CPYTHON __pyx_t_4 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_2); __Pyx_INCREF(__pyx_t_4); __pyx_t_2++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 307; __pyx_clineno = __LINE__; goto __pyx_L1_error;} #else __pyx_t_4 = PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 307; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); #endif } else { if (__pyx_t_2 >= PyTuple_GET_SIZE(__pyx_t_1)) break; #if CYTHON_COMPILING_IN_CPYTHON __pyx_t_4 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_2); __Pyx_INCREF(__pyx_t_4); __pyx_t_2++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 307; __pyx_clineno = __LINE__; goto __pyx_L1_error;} #else __pyx_t_4 = PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 307; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); #endif } } else { __pyx_t_4 = __pyx_t_3(__pyx_t_1); if (unlikely(!__pyx_t_4)) { PyObject* exc_type = PyErr_Occurred(); if (exc_type) { if (likely(exc_type == PyExc_StopIteration || PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); else {__pyx_filename = __pyx_f[0]; __pyx_lineno = 307; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } break; } __Pyx_GOTREF(__pyx_t_4); } __Pyx_XDECREF_SET(__pyx_v_other, __pyx_t_4); __pyx_t_4 = 0; /* "pygame_sdl2/rect.pyx":308 * def unionall_ip(self, other_seq): * for other in other_seq: * self.union_ip(other) # <<<<<<<<<<<<<< * * def fit(self, other): */ __pyx_t_5 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_union_ip); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 308; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); __pyx_t_6 = NULL; if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_5))) { __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_5); if (likely(__pyx_t_6)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5); __Pyx_INCREF(__pyx_t_6); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_5, function); } } if (!__pyx_t_6) { __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_v_other); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 308; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); } else { __pyx_t_7 = PyTuple_New(1+1); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 308; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_7); __Pyx_GIVEREF(__pyx_t_6); PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_6); __pyx_t_6 = NULL; __Pyx_INCREF(__pyx_v_other); __Pyx_GIVEREF(__pyx_v_other); PyTuple_SET_ITEM(__pyx_t_7, 0+1, __pyx_v_other); __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_7, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 308; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; } __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; /* "pygame_sdl2/rect.pyx":307 * * def unionall_ip(self, other_seq): * for other in other_seq: # <<<<<<<<<<<<<< * self.union_ip(other) * */ } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "pygame_sdl2/rect.pyx":306 * return r * * def unionall_ip(self, other_seq): # <<<<<<<<<<<<<< * for other in other_seq: * self.union_ip(other) */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_5); __Pyx_XDECREF(__pyx_t_6); __Pyx_XDECREF(__pyx_t_7); __Pyx_AddTraceback("pygame_sdl2.rect.Rect.unionall_ip", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF(__pyx_v_other); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/rect.pyx":310 * self.union_ip(other) * * def fit(self, other): # <<<<<<<<<<<<<< * if not isinstance(other, Rect): * other = Rect(other) */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_4rect_4Rect_41fit(PyObject *__pyx_v_self, PyObject *__pyx_v_other); /*proto*/ static PyObject *__pyx_pw_11pygame_sdl2_4rect_4Rect_41fit(PyObject *__pyx_v_self, PyObject *__pyx_v_other) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("fit (wrapper)", 0); __pyx_r = __pyx_pf_11pygame_sdl2_4rect_4Rect_40fit(((struct __pyx_obj_11pygame_sdl2_4rect_Rect *)__pyx_v_self), ((PyObject *)__pyx_v_other)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_4rect_4Rect_40fit(struct __pyx_obj_11pygame_sdl2_4rect_Rect *__pyx_v_self, PyObject *__pyx_v_other) { PyObject *__pyx_v_r = NULL; PyObject *__pyx_v_w_ratio = NULL; PyObject *__pyx_v_h_ratio = NULL; PyObject *__pyx_v_factor = NULL; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; int __pyx_t_2; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; PyObject *__pyx_t_5 = NULL; double __pyx_t_6; PyObject *__pyx_t_7 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("fit", 0); __Pyx_INCREF(__pyx_v_other); /* "pygame_sdl2/rect.pyx":311 * * def fit(self, other): * if not isinstance(other, Rect): # <<<<<<<<<<<<<< * other = Rect(other) * */ __pyx_t_1 = __Pyx_TypeCheck(__pyx_v_other, __pyx_ptype_11pygame_sdl2_4rect_Rect); __pyx_t_2 = ((!(__pyx_t_1 != 0)) != 0); if (__pyx_t_2) { /* "pygame_sdl2/rect.pyx":312 * def fit(self, other): * if not isinstance(other, Rect): * other = Rect(other) # <<<<<<<<<<<<<< * * # Not sure if this is entirely correct. Docs and tests are ambiguous. */ __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 312; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __Pyx_INCREF(__pyx_v_other); __Pyx_GIVEREF(__pyx_v_other); PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_other); __pyx_t_4 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_11pygame_sdl2_4rect_Rect), __pyx_t_3, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 312; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF_SET(__pyx_v_other, __pyx_t_4); __pyx_t_4 = 0; /* "pygame_sdl2/rect.pyx":311 * * def fit(self, other): * if not isinstance(other, Rect): # <<<<<<<<<<<<<< * other = Rect(other) * */ } /* "pygame_sdl2/rect.pyx":315 * * # Not sure if this is entirely correct. Docs and tests are ambiguous. * r = self.copy() # <<<<<<<<<<<<<< * r.topleft = other.topleft * w_ratio = other.w / float(r.w) */ __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_copy); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 315; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __pyx_t_5 = NULL; if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_3))) { __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_3); if (likely(__pyx_t_5)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); __Pyx_INCREF(__pyx_t_5); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_3, function); } } if (__pyx_t_5) { __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_5); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 315; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; } else { __pyx_t_4 = __Pyx_PyObject_CallNoArg(__pyx_t_3); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 315; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_v_r = __pyx_t_4; __pyx_t_4 = 0; /* "pygame_sdl2/rect.pyx":316 * # Not sure if this is entirely correct. Docs and tests are ambiguous. * r = self.copy() * r.topleft = other.topleft # <<<<<<<<<<<<<< * w_ratio = other.w / float(r.w) * h_ratio = other.h / float(r.h) */ __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_other, __pyx_n_s_topleft); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 316; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); if (__Pyx_PyObject_SetAttrStr(__pyx_v_r, __pyx_n_s_topleft, __pyx_t_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 316; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; /* "pygame_sdl2/rect.pyx":317 * r = self.copy() * r.topleft = other.topleft * w_ratio = other.w / float(r.w) # <<<<<<<<<<<<<< * h_ratio = other.h / float(r.h) * factor = min(w_ratio, h_ratio) */ __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_other, __pyx_n_s_w); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 317; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_r, __pyx_n_s_w); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 317; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __pyx_t_6 = __Pyx_PyObject_AsDouble(__pyx_t_3); if (unlikely(__pyx_t_6 == ((double)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 317; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_3 = PyFloat_FromDouble(__pyx_t_6); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 317; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __pyx_t_5 = __Pyx_PyNumber_Divide(__pyx_t_4, __pyx_t_3); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 317; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_v_w_ratio = __pyx_t_5; __pyx_t_5 = 0; /* "pygame_sdl2/rect.pyx":318 * r.topleft = other.topleft * w_ratio = other.w / float(r.w) * h_ratio = other.h / float(r.h) # <<<<<<<<<<<<<< * factor = min(w_ratio, h_ratio) * r.w *= factor */ __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_other, __pyx_n_s_h); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 318; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_r, __pyx_n_s_h); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 318; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __pyx_t_6 = __Pyx_PyObject_AsDouble(__pyx_t_3); if (unlikely(__pyx_t_6 == ((double)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 318; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_3 = PyFloat_FromDouble(__pyx_t_6); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 318; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = __Pyx_PyNumber_Divide(__pyx_t_5, __pyx_t_3); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 318; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_v_h_ratio = __pyx_t_4; __pyx_t_4 = 0; /* "pygame_sdl2/rect.pyx":319 * w_ratio = other.w / float(r.w) * h_ratio = other.h / float(r.h) * factor = min(w_ratio, h_ratio) # <<<<<<<<<<<<<< * r.w *= factor * r.h *= factor */ __Pyx_INCREF(__pyx_v_h_ratio); __pyx_t_4 = __pyx_v_h_ratio; __Pyx_INCREF(__pyx_v_w_ratio); __pyx_t_3 = __pyx_v_w_ratio; __pyx_t_7 = PyObject_RichCompare(__pyx_t_4, __pyx_t_3, Py_LT); __Pyx_XGOTREF(__pyx_t_7); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 319; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_7); if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 319; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; if (__pyx_t_2) { __Pyx_INCREF(__pyx_t_4); __pyx_t_5 = __pyx_t_4; } else { __Pyx_INCREF(__pyx_t_3); __pyx_t_5 = __pyx_t_3; } __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_t_4 = __pyx_t_5; __Pyx_INCREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __pyx_v_factor = __pyx_t_4; __pyx_t_4 = 0; /* "pygame_sdl2/rect.pyx":320 * h_ratio = other.h / float(r.h) * factor = min(w_ratio, h_ratio) * r.w *= factor # <<<<<<<<<<<<<< * r.h *= factor * return r */ __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_r, __pyx_n_s_w); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 320; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); __pyx_t_5 = PyNumber_InPlaceMultiply(__pyx_t_4, __pyx_v_factor); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 320; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; if (__Pyx_PyObject_SetAttrStr(__pyx_v_r, __pyx_n_s_w, __pyx_t_5) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 320; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; /* "pygame_sdl2/rect.pyx":321 * factor = min(w_ratio, h_ratio) * r.w *= factor * r.h *= factor # <<<<<<<<<<<<<< * return r * */ __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_r, __pyx_n_s_h); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 321; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); __pyx_t_4 = PyNumber_InPlaceMultiply(__pyx_t_5, __pyx_v_factor); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 321; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; if (__Pyx_PyObject_SetAttrStr(__pyx_v_r, __pyx_n_s_h, __pyx_t_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 321; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; /* "pygame_sdl2/rect.pyx":322 * r.w *= factor * r.h *= factor * return r # <<<<<<<<<<<<<< * * def normalize(self): */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(__pyx_v_r); __pyx_r = __pyx_v_r; goto __pyx_L0; /* "pygame_sdl2/rect.pyx":310 * self.union_ip(other) * * def fit(self, other): # <<<<<<<<<<<<<< * if not isinstance(other, Rect): * other = Rect(other) */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_5); __Pyx_XDECREF(__pyx_t_7); __Pyx_AddTraceback("pygame_sdl2.rect.Rect.fit", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF(__pyx_v_r); __Pyx_XDECREF(__pyx_v_w_ratio); __Pyx_XDECREF(__pyx_v_h_ratio); __Pyx_XDECREF(__pyx_v_factor); __Pyx_XDECREF(__pyx_v_other); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/rect.pyx":324 * return r * * def normalize(self): # <<<<<<<<<<<<<< * if self.w < 0: * self.x += self.w */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_4rect_4Rect_43normalize(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/ static PyObject *__pyx_pw_11pygame_sdl2_4rect_4Rect_43normalize(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("normalize (wrapper)", 0); __pyx_r = __pyx_pf_11pygame_sdl2_4rect_4Rect_42normalize(((struct __pyx_obj_11pygame_sdl2_4rect_Rect *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_4rect_4Rect_42normalize(struct __pyx_obj_11pygame_sdl2_4rect_Rect *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; __Pyx_RefNannySetupContext("normalize", 0); /* "pygame_sdl2/rect.pyx":325 * * def normalize(self): * if self.w < 0: # <<<<<<<<<<<<<< * self.x += self.w * self.w = -self.w */ __pyx_t_1 = ((__pyx_v_self->w < 0) != 0); if (__pyx_t_1) { /* "pygame_sdl2/rect.pyx":326 * def normalize(self): * if self.w < 0: * self.x += self.w # <<<<<<<<<<<<<< * self.w = -self.w * if self.h < 0: */ __pyx_v_self->x = (__pyx_v_self->x + __pyx_v_self->w); /* "pygame_sdl2/rect.pyx":327 * if self.w < 0: * self.x += self.w * self.w = -self.w # <<<<<<<<<<<<<< * if self.h < 0: * self.y += self.h */ __pyx_v_self->w = (-__pyx_v_self->w); /* "pygame_sdl2/rect.pyx":325 * * def normalize(self): * if self.w < 0: # <<<<<<<<<<<<<< * self.x += self.w * self.w = -self.w */ } /* "pygame_sdl2/rect.pyx":328 * self.x += self.w * self.w = -self.w * if self.h < 0: # <<<<<<<<<<<<<< * self.y += self.h * self.h = -self.h */ __pyx_t_1 = ((__pyx_v_self->h < 0) != 0); if (__pyx_t_1) { /* "pygame_sdl2/rect.pyx":329 * self.w = -self.w * if self.h < 0: * self.y += self.h # <<<<<<<<<<<<<< * self.h = -self.h * */ __pyx_v_self->y = (__pyx_v_self->y + __pyx_v_self->h); /* "pygame_sdl2/rect.pyx":330 * if self.h < 0: * self.y += self.h * self.h = -self.h # <<<<<<<<<<<<<< * * def contains(self, other): */ __pyx_v_self->h = (-__pyx_v_self->h); /* "pygame_sdl2/rect.pyx":328 * self.x += self.w * self.w = -self.w * if self.h < 0: # <<<<<<<<<<<<<< * self.y += self.h * self.h = -self.h */ } /* "pygame_sdl2/rect.pyx":324 * return r * * def normalize(self): # <<<<<<<<<<<<<< * if self.w < 0: * self.x += self.w */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/rect.pyx":332 * self.h = -self.h * * def contains(self, other): # <<<<<<<<<<<<<< * if not isinstance(other, Rect): * other = Rect(other) */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_4rect_4Rect_45contains(PyObject *__pyx_v_self, PyObject *__pyx_v_other); /*proto*/ static PyObject *__pyx_pw_11pygame_sdl2_4rect_4Rect_45contains(PyObject *__pyx_v_self, PyObject *__pyx_v_other) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("contains (wrapper)", 0); __pyx_r = __pyx_pf_11pygame_sdl2_4rect_4Rect_44contains(((struct __pyx_obj_11pygame_sdl2_4rect_Rect *)__pyx_v_self), ((PyObject *)__pyx_v_other)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_4rect_4Rect_44contains(struct __pyx_obj_11pygame_sdl2_4rect_Rect *__pyx_v_self, PyObject *__pyx_v_other) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; int __pyx_t_2; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; PyObject *__pyx_t_5 = NULL; PyObject *__pyx_t_6 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("contains", 0); __Pyx_INCREF(__pyx_v_other); /* "pygame_sdl2/rect.pyx":333 * * def contains(self, other): * if not isinstance(other, Rect): # <<<<<<<<<<<<<< * other = Rect(other) * */ __pyx_t_1 = __Pyx_TypeCheck(__pyx_v_other, __pyx_ptype_11pygame_sdl2_4rect_Rect); __pyx_t_2 = ((!(__pyx_t_1 != 0)) != 0); if (__pyx_t_2) { /* "pygame_sdl2/rect.pyx":334 * def contains(self, other): * if not isinstance(other, Rect): * other = Rect(other) # <<<<<<<<<<<<<< * * return other.x >= self.x and other.right <= self.right and \ */ __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 334; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __Pyx_INCREF(__pyx_v_other); __Pyx_GIVEREF(__pyx_v_other); PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_other); __pyx_t_4 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_11pygame_sdl2_4rect_Rect), __pyx_t_3, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 334; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF_SET(__pyx_v_other, __pyx_t_4); __pyx_t_4 = 0; /* "pygame_sdl2/rect.pyx":333 * * def contains(self, other): * if not isinstance(other, Rect): # <<<<<<<<<<<<<< * other = Rect(other) * */ } /* "pygame_sdl2/rect.pyx":336 * other = Rect(other) * * return other.x >= self.x and other.right <= self.right and \ # <<<<<<<<<<<<<< * other.y >= self.y and other.bottom <= self.bottom and \ * other.left < self.right and other.top < self.bottom */ __Pyx_XDECREF(__pyx_r); __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_other, __pyx_n_s_x); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 336; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __pyx_t_5 = __Pyx_PyInt_From_int(__pyx_v_self->x); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 336; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); __pyx_t_6 = PyObject_RichCompare(__pyx_t_3, __pyx_t_5, Py_GE); __Pyx_XGOTREF(__pyx_t_6); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 336; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_6); if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 336; __pyx_clineno = __LINE__; goto __pyx_L1_error;} if (__pyx_t_2) { __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; } else { __Pyx_INCREF(__pyx_t_6); __pyx_t_4 = __pyx_t_6; __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; goto __pyx_L4_bool_binop_done; } __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_other, __pyx_n_s_right); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 336; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_6); __pyx_t_5 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_right); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 336; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); __pyx_t_3 = PyObject_RichCompare(__pyx_t_6, __pyx_t_5, Py_LE); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 336; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 336; __pyx_clineno = __LINE__; goto __pyx_L1_error;} if (__pyx_t_2) { __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } else { __Pyx_INCREF(__pyx_t_3); __pyx_t_4 = __pyx_t_3; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; goto __pyx_L4_bool_binop_done; } /* "pygame_sdl2/rect.pyx":337 * * return other.x >= self.x and other.right <= self.right and \ * other.y >= self.y and other.bottom <= self.bottom and \ # <<<<<<<<<<<<<< * other.left < self.right and other.top < self.bottom * */ __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_other, __pyx_n_s_y); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 337; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __pyx_t_5 = __Pyx_PyInt_From_int(__pyx_v_self->y); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 337; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); __pyx_t_6 = PyObject_RichCompare(__pyx_t_3, __pyx_t_5, Py_GE); __Pyx_XGOTREF(__pyx_t_6); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 337; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_6); if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 337; __pyx_clineno = __LINE__; goto __pyx_L1_error;} if (__pyx_t_2) { __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; } else { __Pyx_INCREF(__pyx_t_6); __pyx_t_4 = __pyx_t_6; __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; goto __pyx_L4_bool_binop_done; } __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_other, __pyx_n_s_bottom); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 337; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_6); __pyx_t_5 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_bottom); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 337; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); __pyx_t_3 = PyObject_RichCompare(__pyx_t_6, __pyx_t_5, Py_LE); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 337; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 337; __pyx_clineno = __LINE__; goto __pyx_L1_error;} if (__pyx_t_2) { __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } else { __Pyx_INCREF(__pyx_t_3); __pyx_t_4 = __pyx_t_3; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; goto __pyx_L4_bool_binop_done; } /* "pygame_sdl2/rect.pyx":338 * return other.x >= self.x and other.right <= self.right and \ * other.y >= self.y and other.bottom <= self.bottom and \ * other.left < self.right and other.top < self.bottom # <<<<<<<<<<<<<< * * def collidepoint(self, x, y=None): */ __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_other, __pyx_n_s_left); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 338; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __pyx_t_5 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_right); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 338; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); __pyx_t_6 = PyObject_RichCompare(__pyx_t_3, __pyx_t_5, Py_LT); __Pyx_XGOTREF(__pyx_t_6); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 338; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_6); if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 338; __pyx_clineno = __LINE__; goto __pyx_L1_error;} if (__pyx_t_2) { __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; } else { __Pyx_INCREF(__pyx_t_6); __pyx_t_4 = __pyx_t_6; __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; goto __pyx_L4_bool_binop_done; } __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_other, __pyx_n_s_top); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 338; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_6); __pyx_t_5 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_bottom); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 338; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); __pyx_t_3 = PyObject_RichCompare(__pyx_t_6, __pyx_t_5, Py_LT); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 338; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_INCREF(__pyx_t_3); __pyx_t_4 = __pyx_t_3; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_L4_bool_binop_done:; __pyx_r = __pyx_t_4; __pyx_t_4 = 0; goto __pyx_L0; /* "pygame_sdl2/rect.pyx":332 * self.h = -self.h * * def contains(self, other): # <<<<<<<<<<<<<< * if not isinstance(other, Rect): * other = Rect(other) */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_5); __Pyx_XDECREF(__pyx_t_6); __Pyx_AddTraceback("pygame_sdl2.rect.Rect.contains", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF(__pyx_v_other); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/rect.pyx":340 * other.left < self.right and other.top < self.bottom * * def collidepoint(self, x, y=None): # <<<<<<<<<<<<<< * if type(x) == tuple: * x, y = x */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_4rect_4Rect_47collidepoint(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static PyObject *__pyx_pw_11pygame_sdl2_4rect_4Rect_47collidepoint(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_x = 0; PyObject *__pyx_v_y = 0; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("collidepoint (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_x,&__pyx_n_s_y,0}; PyObject* values[2] = {0,0}; values[1] = ((PyObject *)Py_None); if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_x)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; case 1: if (kw_args > 0) { PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_y); if (value) { values[1] = value; kw_args--; } } } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "collidepoint") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 340; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } } else { switch (PyTuple_GET_SIZE(__pyx_args)) { case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_x = values[0]; __pyx_v_y = values[1]; } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("collidepoint", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 340; __pyx_clineno = __LINE__; goto __pyx_L3_error;} __pyx_L3_error:; __Pyx_AddTraceback("pygame_sdl2.rect.Rect.collidepoint", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_11pygame_sdl2_4rect_4Rect_46collidepoint(((struct __pyx_obj_11pygame_sdl2_4rect_Rect *)__pyx_v_self), __pyx_v_x, __pyx_v_y); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_4rect_4Rect_46collidepoint(struct __pyx_obj_11pygame_sdl2_4rect_Rect *__pyx_v_self, PyObject *__pyx_v_x, PyObject *__pyx_v_y) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_t_2; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; PyObject *(*__pyx_t_5)(PyObject *); int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("collidepoint", 0); __Pyx_INCREF(__pyx_v_x); __Pyx_INCREF(__pyx_v_y); /* "pygame_sdl2/rect.pyx":341 * * def collidepoint(self, x, y=None): * if type(x) == tuple: # <<<<<<<<<<<<<< * x, y = x * return x >= self.x and y >= self.y and \ */ __pyx_t_1 = PyObject_RichCompare(((PyObject *)Py_TYPE(__pyx_v_x)), ((PyObject *)(&PyTuple_Type)), Py_EQ); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 341; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 341; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (__pyx_t_2) { /* "pygame_sdl2/rect.pyx":342 * def collidepoint(self, x, y=None): * if type(x) == tuple: * x, y = x # <<<<<<<<<<<<<< * return x >= self.x and y >= self.y and \ * x < self.right and y < self.bottom */ if ((likely(PyTuple_CheckExact(__pyx_v_x))) || (PyList_CheckExact(__pyx_v_x))) { PyObject* sequence = __pyx_v_x; #if CYTHON_COMPILING_IN_CPYTHON Py_ssize_t size = Py_SIZE(sequence); #else Py_ssize_t size = PySequence_Size(sequence); #endif if (unlikely(size != 2)) { if (size > 2) __Pyx_RaiseTooManyValuesError(2); else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 342; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } #if CYTHON_COMPILING_IN_CPYTHON if (likely(PyTuple_CheckExact(sequence))) { __pyx_t_1 = PyTuple_GET_ITEM(sequence, 0); __pyx_t_3 = PyTuple_GET_ITEM(sequence, 1); } else { __pyx_t_1 = PyList_GET_ITEM(sequence, 0); __pyx_t_3 = PyList_GET_ITEM(sequence, 1); } __Pyx_INCREF(__pyx_t_1); __Pyx_INCREF(__pyx_t_3); #else __pyx_t_1 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 342; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_t_3 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 342; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); #endif } else { Py_ssize_t index = -1; __pyx_t_4 = PyObject_GetIter(__pyx_v_x); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 342; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); __pyx_t_5 = Py_TYPE(__pyx_t_4)->tp_iternext; index = 0; __pyx_t_1 = __pyx_t_5(__pyx_t_4); if (unlikely(!__pyx_t_1)) goto __pyx_L4_unpacking_failed; __Pyx_GOTREF(__pyx_t_1); index = 1; __pyx_t_3 = __pyx_t_5(__pyx_t_4); if (unlikely(!__pyx_t_3)) goto __pyx_L4_unpacking_failed; __Pyx_GOTREF(__pyx_t_3); if (__Pyx_IternextUnpackEndCheck(__pyx_t_5(__pyx_t_4), 2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 342; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_t_5 = NULL; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; goto __pyx_L5_unpacking_done; __pyx_L4_unpacking_failed:; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_t_5 = NULL; if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 342; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_L5_unpacking_done:; } __Pyx_DECREF_SET(__pyx_v_x, __pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF_SET(__pyx_v_y, __pyx_t_3); __pyx_t_3 = 0; /* "pygame_sdl2/rect.pyx":341 * * def collidepoint(self, x, y=None): * if type(x) == tuple: # <<<<<<<<<<<<<< * x, y = x * return x >= self.x and y >= self.y and \ */ } /* "pygame_sdl2/rect.pyx":343 * if type(x) == tuple: * x, y = x * return x >= self.x and y >= self.y and \ # <<<<<<<<<<<<<< * x < self.right and y < self.bottom * */ __Pyx_XDECREF(__pyx_r); __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_self->x); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 343; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_t_4 = PyObject_RichCompare(__pyx_v_x, __pyx_t_1, Py_GE); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 343; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 343; __pyx_clineno = __LINE__; goto __pyx_L1_error;} if (__pyx_t_2) { __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; } else { __Pyx_INCREF(__pyx_t_4); __pyx_t_3 = __pyx_t_4; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; goto __pyx_L6_bool_binop_done; } __pyx_t_4 = __Pyx_PyInt_From_int(__pyx_v_self->y); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 343; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); __pyx_t_1 = PyObject_RichCompare(__pyx_v_y, __pyx_t_4, Py_GE); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 343; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 343; __pyx_clineno = __LINE__; goto __pyx_L1_error;} if (__pyx_t_2) { __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; } else { __Pyx_INCREF(__pyx_t_1); __pyx_t_3 = __pyx_t_1; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; goto __pyx_L6_bool_binop_done; } /* "pygame_sdl2/rect.pyx":344 * x, y = x * return x >= self.x and y >= self.y and \ * x < self.right and y < self.bottom # <<<<<<<<<<<<<< * * def colliderect(self, other): */ __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_right); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 344; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_t_4 = PyObject_RichCompare(__pyx_v_x, __pyx_t_1, Py_LT); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 344; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 344; __pyx_clineno = __LINE__; goto __pyx_L1_error;} if (__pyx_t_2) { __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; } else { __Pyx_INCREF(__pyx_t_4); __pyx_t_3 = __pyx_t_4; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; goto __pyx_L6_bool_binop_done; } __pyx_t_4 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_bottom); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 344; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); __pyx_t_1 = PyObject_RichCompare(__pyx_v_y, __pyx_t_4, Py_LT); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 344; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_INCREF(__pyx_t_1); __pyx_t_3 = __pyx_t_1; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_L6_bool_binop_done:; __pyx_r = __pyx_t_3; __pyx_t_3 = 0; goto __pyx_L0; /* "pygame_sdl2/rect.pyx":340 * other.left < self.right and other.top < self.bottom * * def collidepoint(self, x, y=None): # <<<<<<<<<<<<<< * if type(x) == tuple: * x, y = x */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_AddTraceback("pygame_sdl2.rect.Rect.collidepoint", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF(__pyx_v_x); __Pyx_XDECREF(__pyx_v_y); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/rect.pyx":346 * x < self.right and y < self.bottom * * def colliderect(self, other): # <<<<<<<<<<<<<< * if not isinstance(other, Rect): * other = Rect(other) */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_4rect_4Rect_49colliderect(PyObject *__pyx_v_self, PyObject *__pyx_v_other); /*proto*/ static PyObject *__pyx_pw_11pygame_sdl2_4rect_4Rect_49colliderect(PyObject *__pyx_v_self, PyObject *__pyx_v_other) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("colliderect (wrapper)", 0); __pyx_r = __pyx_pf_11pygame_sdl2_4rect_4Rect_48colliderect(((struct __pyx_obj_11pygame_sdl2_4rect_Rect *)__pyx_v_self), ((PyObject *)__pyx_v_other)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_4rect_4Rect_48colliderect(struct __pyx_obj_11pygame_sdl2_4rect_Rect *__pyx_v_self, PyObject *__pyx_v_other) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; int __pyx_t_2; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; PyObject *__pyx_t_5 = NULL; PyObject *__pyx_t_6 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("colliderect", 0); __Pyx_INCREF(__pyx_v_other); /* "pygame_sdl2/rect.pyx":347 * * def colliderect(self, other): * if not isinstance(other, Rect): # <<<<<<<<<<<<<< * other = Rect(other) * */ __pyx_t_1 = __Pyx_TypeCheck(__pyx_v_other, __pyx_ptype_11pygame_sdl2_4rect_Rect); __pyx_t_2 = ((!(__pyx_t_1 != 0)) != 0); if (__pyx_t_2) { /* "pygame_sdl2/rect.pyx":348 * def colliderect(self, other): * if not isinstance(other, Rect): * other = Rect(other) # <<<<<<<<<<<<<< * * return self.left < other.right and self.top < other.bottom and \ */ __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 348; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __Pyx_INCREF(__pyx_v_other); __Pyx_GIVEREF(__pyx_v_other); PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_other); __pyx_t_4 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_11pygame_sdl2_4rect_Rect), __pyx_t_3, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 348; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF_SET(__pyx_v_other, __pyx_t_4); __pyx_t_4 = 0; /* "pygame_sdl2/rect.pyx":347 * * def colliderect(self, other): * if not isinstance(other, Rect): # <<<<<<<<<<<<<< * other = Rect(other) * */ } /* "pygame_sdl2/rect.pyx":350 * other = Rect(other) * * return self.left < other.right and self.top < other.bottom and \ # <<<<<<<<<<<<<< * self.right > other.left and self.bottom > other.top * */ __Pyx_XDECREF(__pyx_r); __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_left); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 350; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_other, __pyx_n_s_right); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 350; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); __pyx_t_6 = PyObject_RichCompare(__pyx_t_3, __pyx_t_5, Py_LT); __Pyx_XGOTREF(__pyx_t_6); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 350; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_6); if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 350; __pyx_clineno = __LINE__; goto __pyx_L1_error;} if (__pyx_t_2) { __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; } else { __Pyx_INCREF(__pyx_t_6); __pyx_t_4 = __pyx_t_6; __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; goto __pyx_L4_bool_binop_done; } __pyx_t_6 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_top); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 350; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_6); __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_other, __pyx_n_s_bottom); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 350; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); __pyx_t_3 = PyObject_RichCompare(__pyx_t_6, __pyx_t_5, Py_LT); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 350; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 350; __pyx_clineno = __LINE__; goto __pyx_L1_error;} if (__pyx_t_2) { __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } else { __Pyx_INCREF(__pyx_t_3); __pyx_t_4 = __pyx_t_3; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; goto __pyx_L4_bool_binop_done; } /* "pygame_sdl2/rect.pyx":351 * * return self.left < other.right and self.top < other.bottom and \ * self.right > other.left and self.bottom > other.top # <<<<<<<<<<<<<< * * def collidelist(self, other_list): */ __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_right); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 351; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_other, __pyx_n_s_left); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 351; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); __pyx_t_6 = PyObject_RichCompare(__pyx_t_3, __pyx_t_5, Py_GT); __Pyx_XGOTREF(__pyx_t_6); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 351; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_6); if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 351; __pyx_clineno = __LINE__; goto __pyx_L1_error;} if (__pyx_t_2) { __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; } else { __Pyx_INCREF(__pyx_t_6); __pyx_t_4 = __pyx_t_6; __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; goto __pyx_L4_bool_binop_done; } __pyx_t_6 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_bottom); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 351; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_6); __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_other, __pyx_n_s_top); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 351; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); __pyx_t_3 = PyObject_RichCompare(__pyx_t_6, __pyx_t_5, Py_GT); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 351; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_INCREF(__pyx_t_3); __pyx_t_4 = __pyx_t_3; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_L4_bool_binop_done:; __pyx_r = __pyx_t_4; __pyx_t_4 = 0; goto __pyx_L0; /* "pygame_sdl2/rect.pyx":346 * x < self.right and y < self.bottom * * def colliderect(self, other): # <<<<<<<<<<<<<< * if not isinstance(other, Rect): * other = Rect(other) */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_5); __Pyx_XDECREF(__pyx_t_6); __Pyx_AddTraceback("pygame_sdl2.rect.Rect.colliderect", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF(__pyx_v_other); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/rect.pyx":353 * self.right > other.left and self.bottom > other.top * * def collidelist(self, other_list): # <<<<<<<<<<<<<< * for n, other in zip(range(len(other_list)), other_list): * if self.colliderect(other): */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_4rect_4Rect_51collidelist(PyObject *__pyx_v_self, PyObject *__pyx_v_other_list); /*proto*/ static PyObject *__pyx_pw_11pygame_sdl2_4rect_4Rect_51collidelist(PyObject *__pyx_v_self, PyObject *__pyx_v_other_list) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("collidelist (wrapper)", 0); __pyx_r = __pyx_pf_11pygame_sdl2_4rect_4Rect_50collidelist(((struct __pyx_obj_11pygame_sdl2_4rect_Rect *)__pyx_v_self), ((PyObject *)__pyx_v_other_list)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_4rect_4Rect_50collidelist(struct __pyx_obj_11pygame_sdl2_4rect_Rect *__pyx_v_self, PyObject *__pyx_v_other_list) { PyObject *__pyx_v_n = NULL; PyObject *__pyx_v_other = NULL; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations Py_ssize_t __pyx_t_1; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; PyObject *(*__pyx_t_4)(PyObject *); PyObject *__pyx_t_5 = NULL; PyObject *__pyx_t_6 = NULL; PyObject *__pyx_t_7 = NULL; PyObject *(*__pyx_t_8)(PyObject *); int __pyx_t_9; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("collidelist", 0); /* "pygame_sdl2/rect.pyx":354 * * def collidelist(self, other_list): * for n, other in zip(range(len(other_list)), other_list): # <<<<<<<<<<<<<< * if self.colliderect(other): * return n */ __pyx_t_1 = PyObject_Length(__pyx_v_other_list); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 354; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_t_2 = PyInt_FromSsize_t(__pyx_t_1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 354; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 354; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __Pyx_GIVEREF(__pyx_t_2); PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_2); __pyx_t_2 = 0; __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_range, __pyx_t_3, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 354; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 354; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __Pyx_GIVEREF(__pyx_t_2); PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_2); __Pyx_INCREF(__pyx_v_other_list); __Pyx_GIVEREF(__pyx_v_other_list); PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_v_other_list); __pyx_t_2 = 0; __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_zip, __pyx_t_3, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 354; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; if (likely(PyList_CheckExact(__pyx_t_2)) || PyTuple_CheckExact(__pyx_t_2)) { __pyx_t_3 = __pyx_t_2; __Pyx_INCREF(__pyx_t_3); __pyx_t_1 = 0; __pyx_t_4 = NULL; } else { __pyx_t_1 = -1; __pyx_t_3 = PyObject_GetIter(__pyx_t_2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 354; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = Py_TYPE(__pyx_t_3)->tp_iternext; if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 354; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; for (;;) { if (likely(!__pyx_t_4)) { if (likely(PyList_CheckExact(__pyx_t_3))) { if (__pyx_t_1 >= PyList_GET_SIZE(__pyx_t_3)) break; #if CYTHON_COMPILING_IN_CPYTHON __pyx_t_2 = PyList_GET_ITEM(__pyx_t_3, __pyx_t_1); __Pyx_INCREF(__pyx_t_2); __pyx_t_1++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 354; __pyx_clineno = __LINE__; goto __pyx_L1_error;} #else __pyx_t_2 = PySequence_ITEM(__pyx_t_3, __pyx_t_1); __pyx_t_1++; if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 354; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); #endif } else { if (__pyx_t_1 >= PyTuple_GET_SIZE(__pyx_t_3)) break; #if CYTHON_COMPILING_IN_CPYTHON __pyx_t_2 = PyTuple_GET_ITEM(__pyx_t_3, __pyx_t_1); __Pyx_INCREF(__pyx_t_2); __pyx_t_1++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 354; __pyx_clineno = __LINE__; goto __pyx_L1_error;} #else __pyx_t_2 = PySequence_ITEM(__pyx_t_3, __pyx_t_1); __pyx_t_1++; if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 354; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); #endif } } else { __pyx_t_2 = __pyx_t_4(__pyx_t_3); if (unlikely(!__pyx_t_2)) { PyObject* exc_type = PyErr_Occurred(); if (exc_type) { if (likely(exc_type == PyExc_StopIteration || PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); else {__pyx_filename = __pyx_f[0]; __pyx_lineno = 354; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } break; } __Pyx_GOTREF(__pyx_t_2); } if ((likely(PyTuple_CheckExact(__pyx_t_2))) || (PyList_CheckExact(__pyx_t_2))) { PyObject* sequence = __pyx_t_2; #if CYTHON_COMPILING_IN_CPYTHON Py_ssize_t size = Py_SIZE(sequence); #else Py_ssize_t size = PySequence_Size(sequence); #endif if (unlikely(size != 2)) { if (size > 2) __Pyx_RaiseTooManyValuesError(2); else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 354; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } #if CYTHON_COMPILING_IN_CPYTHON if (likely(PyTuple_CheckExact(sequence))) { __pyx_t_5 = PyTuple_GET_ITEM(sequence, 0); __pyx_t_6 = PyTuple_GET_ITEM(sequence, 1); } else { __pyx_t_5 = PyList_GET_ITEM(sequence, 0); __pyx_t_6 = PyList_GET_ITEM(sequence, 1); } __Pyx_INCREF(__pyx_t_5); __Pyx_INCREF(__pyx_t_6); #else __pyx_t_5 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 354; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); __pyx_t_6 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 354; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_6); #endif __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } else { Py_ssize_t index = -1; __pyx_t_7 = PyObject_GetIter(__pyx_t_2); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 354; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_8 = Py_TYPE(__pyx_t_7)->tp_iternext; index = 0; __pyx_t_5 = __pyx_t_8(__pyx_t_7); if (unlikely(!__pyx_t_5)) goto __pyx_L5_unpacking_failed; __Pyx_GOTREF(__pyx_t_5); index = 1; __pyx_t_6 = __pyx_t_8(__pyx_t_7); if (unlikely(!__pyx_t_6)) goto __pyx_L5_unpacking_failed; __Pyx_GOTREF(__pyx_t_6); if (__Pyx_IternextUnpackEndCheck(__pyx_t_8(__pyx_t_7), 2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 354; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_t_8 = NULL; __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; goto __pyx_L6_unpacking_done; __pyx_L5_unpacking_failed:; __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __pyx_t_8 = NULL; if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 354; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_L6_unpacking_done:; } __Pyx_XDECREF_SET(__pyx_v_n, __pyx_t_5); __pyx_t_5 = 0; __Pyx_XDECREF_SET(__pyx_v_other, __pyx_t_6); __pyx_t_6 = 0; /* "pygame_sdl2/rect.pyx":355 * def collidelist(self, other_list): * for n, other in zip(range(len(other_list)), other_list): * if self.colliderect(other): # <<<<<<<<<<<<<< * return n * return -1 */ __pyx_t_6 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_colliderect); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 355; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_6); __pyx_t_5 = NULL; if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_6))) { __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_6); if (likely(__pyx_t_5)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6); __Pyx_INCREF(__pyx_t_5); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_6, function); } } if (!__pyx_t_5) { __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_6, __pyx_v_other); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 355; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); } else { __pyx_t_7 = PyTuple_New(1+1); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 355; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_7); __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_5); __pyx_t_5 = NULL; __Pyx_INCREF(__pyx_v_other); __Pyx_GIVEREF(__pyx_v_other); PyTuple_SET_ITEM(__pyx_t_7, 0+1, __pyx_v_other); __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_7, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 355; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; } __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __pyx_t_9 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_9 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 355; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; if (__pyx_t_9) { /* "pygame_sdl2/rect.pyx":356 * for n, other in zip(range(len(other_list)), other_list): * if self.colliderect(other): * return n # <<<<<<<<<<<<<< * return -1 * */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(__pyx_v_n); __pyx_r = __pyx_v_n; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; goto __pyx_L0; /* "pygame_sdl2/rect.pyx":355 * def collidelist(self, other_list): * for n, other in zip(range(len(other_list)), other_list): * if self.colliderect(other): # <<<<<<<<<<<<<< * return n * return -1 */ } /* "pygame_sdl2/rect.pyx":354 * * def collidelist(self, other_list): * for n, other in zip(range(len(other_list)), other_list): # <<<<<<<<<<<<<< * if self.colliderect(other): * return n */ } __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "pygame_sdl2/rect.pyx":357 * if self.colliderect(other): * return n * return -1 # <<<<<<<<<<<<<< * * def collidelistall(self, other_list): */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(__pyx_int_neg_1); __pyx_r = __pyx_int_neg_1; goto __pyx_L0; /* "pygame_sdl2/rect.pyx":353 * self.right > other.left and self.bottom > other.top * * def collidelist(self, other_list): # <<<<<<<<<<<<<< * for n, other in zip(range(len(other_list)), other_list): * if self.colliderect(other): */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_5); __Pyx_XDECREF(__pyx_t_6); __Pyx_XDECREF(__pyx_t_7); __Pyx_AddTraceback("pygame_sdl2.rect.Rect.collidelist", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF(__pyx_v_n); __Pyx_XDECREF(__pyx_v_other); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/rect.pyx":359 * return -1 * * def collidelistall(self, other_list): # <<<<<<<<<<<<<< * ret = [] * for n, other in zip(range(len(other_list)), other_list): */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_4rect_4Rect_53collidelistall(PyObject *__pyx_v_self, PyObject *__pyx_v_other_list); /*proto*/ static PyObject *__pyx_pw_11pygame_sdl2_4rect_4Rect_53collidelistall(PyObject *__pyx_v_self, PyObject *__pyx_v_other_list) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("collidelistall (wrapper)", 0); __pyx_r = __pyx_pf_11pygame_sdl2_4rect_4Rect_52collidelistall(((struct __pyx_obj_11pygame_sdl2_4rect_Rect *)__pyx_v_self), ((PyObject *)__pyx_v_other_list)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_4rect_4Rect_52collidelistall(struct __pyx_obj_11pygame_sdl2_4rect_Rect *__pyx_v_self, PyObject *__pyx_v_other_list) { PyObject *__pyx_v_ret = NULL; PyObject *__pyx_v_n = NULL; PyObject *__pyx_v_other = NULL; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; Py_ssize_t __pyx_t_2; PyObject *__pyx_t_3 = NULL; PyObject *(*__pyx_t_4)(PyObject *); PyObject *__pyx_t_5 = NULL; PyObject *__pyx_t_6 = NULL; PyObject *__pyx_t_7 = NULL; PyObject *(*__pyx_t_8)(PyObject *); int __pyx_t_9; int __pyx_t_10; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("collidelistall", 0); /* "pygame_sdl2/rect.pyx":360 * * def collidelistall(self, other_list): * ret = [] # <<<<<<<<<<<<<< * for n, other in zip(range(len(other_list)), other_list): * if self.colliderect(other): */ __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 360; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_v_ret = ((PyObject*)__pyx_t_1); __pyx_t_1 = 0; /* "pygame_sdl2/rect.pyx":361 * def collidelistall(self, other_list): * ret = [] * for n, other in zip(range(len(other_list)), other_list): # <<<<<<<<<<<<<< * if self.colliderect(other): * ret.append(n) */ __pyx_t_2 = PyObject_Length(__pyx_v_other_list); if (unlikely(__pyx_t_2 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 361; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_t_1 = PyInt_FromSsize_t(__pyx_t_2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 361; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 361; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __Pyx_GIVEREF(__pyx_t_1); PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_1); __pyx_t_1 = 0; __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_range, __pyx_t_3, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 361; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 361; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __Pyx_GIVEREF(__pyx_t_1); PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_1); __Pyx_INCREF(__pyx_v_other_list); __Pyx_GIVEREF(__pyx_v_other_list); PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_v_other_list); __pyx_t_1 = 0; __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_zip, __pyx_t_3, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 361; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; if (likely(PyList_CheckExact(__pyx_t_1)) || PyTuple_CheckExact(__pyx_t_1)) { __pyx_t_3 = __pyx_t_1; __Pyx_INCREF(__pyx_t_3); __pyx_t_2 = 0; __pyx_t_4 = NULL; } else { __pyx_t_2 = -1; __pyx_t_3 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 361; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = Py_TYPE(__pyx_t_3)->tp_iternext; if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 361; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; for (;;) { if (likely(!__pyx_t_4)) { if (likely(PyList_CheckExact(__pyx_t_3))) { if (__pyx_t_2 >= PyList_GET_SIZE(__pyx_t_3)) break; #if CYTHON_COMPILING_IN_CPYTHON __pyx_t_1 = PyList_GET_ITEM(__pyx_t_3, __pyx_t_2); __Pyx_INCREF(__pyx_t_1); __pyx_t_2++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 361; __pyx_clineno = __LINE__; goto __pyx_L1_error;} #else __pyx_t_1 = PySequence_ITEM(__pyx_t_3, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 361; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); #endif } else { if (__pyx_t_2 >= PyTuple_GET_SIZE(__pyx_t_3)) break; #if CYTHON_COMPILING_IN_CPYTHON __pyx_t_1 = PyTuple_GET_ITEM(__pyx_t_3, __pyx_t_2); __Pyx_INCREF(__pyx_t_1); __pyx_t_2++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 361; __pyx_clineno = __LINE__; goto __pyx_L1_error;} #else __pyx_t_1 = PySequence_ITEM(__pyx_t_3, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 361; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); #endif } } else { __pyx_t_1 = __pyx_t_4(__pyx_t_3); if (unlikely(!__pyx_t_1)) { PyObject* exc_type = PyErr_Occurred(); if (exc_type) { if (likely(exc_type == PyExc_StopIteration || PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); else {__pyx_filename = __pyx_f[0]; __pyx_lineno = 361; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } break; } __Pyx_GOTREF(__pyx_t_1); } if ((likely(PyTuple_CheckExact(__pyx_t_1))) || (PyList_CheckExact(__pyx_t_1))) { PyObject* sequence = __pyx_t_1; #if CYTHON_COMPILING_IN_CPYTHON Py_ssize_t size = Py_SIZE(sequence); #else Py_ssize_t size = PySequence_Size(sequence); #endif if (unlikely(size != 2)) { if (size > 2) __Pyx_RaiseTooManyValuesError(2); else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 361; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } #if CYTHON_COMPILING_IN_CPYTHON if (likely(PyTuple_CheckExact(sequence))) { __pyx_t_5 = PyTuple_GET_ITEM(sequence, 0); __pyx_t_6 = PyTuple_GET_ITEM(sequence, 1); } else { __pyx_t_5 = PyList_GET_ITEM(sequence, 0); __pyx_t_6 = PyList_GET_ITEM(sequence, 1); } __Pyx_INCREF(__pyx_t_5); __Pyx_INCREF(__pyx_t_6); #else __pyx_t_5 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 361; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); __pyx_t_6 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 361; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_6); #endif __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; } else { Py_ssize_t index = -1; __pyx_t_7 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 361; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_8 = Py_TYPE(__pyx_t_7)->tp_iternext; index = 0; __pyx_t_5 = __pyx_t_8(__pyx_t_7); if (unlikely(!__pyx_t_5)) goto __pyx_L5_unpacking_failed; __Pyx_GOTREF(__pyx_t_5); index = 1; __pyx_t_6 = __pyx_t_8(__pyx_t_7); if (unlikely(!__pyx_t_6)) goto __pyx_L5_unpacking_failed; __Pyx_GOTREF(__pyx_t_6); if (__Pyx_IternextUnpackEndCheck(__pyx_t_8(__pyx_t_7), 2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 361; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_t_8 = NULL; __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; goto __pyx_L6_unpacking_done; __pyx_L5_unpacking_failed:; __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __pyx_t_8 = NULL; if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 361; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_L6_unpacking_done:; } __Pyx_XDECREF_SET(__pyx_v_n, __pyx_t_5); __pyx_t_5 = 0; __Pyx_XDECREF_SET(__pyx_v_other, __pyx_t_6); __pyx_t_6 = 0; /* "pygame_sdl2/rect.pyx":362 * ret = [] * for n, other in zip(range(len(other_list)), other_list): * if self.colliderect(other): # <<<<<<<<<<<<<< * ret.append(n) * return ret */ __pyx_t_6 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_colliderect); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 362; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_6); __pyx_t_5 = NULL; if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_6))) { __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_6); if (likely(__pyx_t_5)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6); __Pyx_INCREF(__pyx_t_5); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_6, function); } } if (!__pyx_t_5) { __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_6, __pyx_v_other); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 362; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); } else { __pyx_t_7 = PyTuple_New(1+1); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 362; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_7); __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_5); __pyx_t_5 = NULL; __Pyx_INCREF(__pyx_v_other); __Pyx_GIVEREF(__pyx_v_other); PyTuple_SET_ITEM(__pyx_t_7, 0+1, __pyx_v_other); __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_7, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 362; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; } __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __pyx_t_9 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_9 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 362; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (__pyx_t_9) { /* "pygame_sdl2/rect.pyx":363 * for n, other in zip(range(len(other_list)), other_list): * if self.colliderect(other): * ret.append(n) # <<<<<<<<<<<<<< * return ret * */ __pyx_t_10 = __Pyx_PyList_Append(__pyx_v_ret, __pyx_v_n); if (unlikely(__pyx_t_10 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 363; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "pygame_sdl2/rect.pyx":362 * ret = [] * for n, other in zip(range(len(other_list)), other_list): * if self.colliderect(other): # <<<<<<<<<<<<<< * ret.append(n) * return ret */ } /* "pygame_sdl2/rect.pyx":361 * def collidelistall(self, other_list): * ret = [] * for n, other in zip(range(len(other_list)), other_list): # <<<<<<<<<<<<<< * if self.colliderect(other): * ret.append(n) */ } __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "pygame_sdl2/rect.pyx":364 * if self.colliderect(other): * ret.append(n) * return ret # <<<<<<<<<<<<<< * * def collidedict(self, other_dict, rects_values=0): */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(__pyx_v_ret); __pyx_r = __pyx_v_ret; goto __pyx_L0; /* "pygame_sdl2/rect.pyx":359 * return -1 * * def collidelistall(self, other_list): # <<<<<<<<<<<<<< * ret = [] * for n, other in zip(range(len(other_list)), other_list): */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_5); __Pyx_XDECREF(__pyx_t_6); __Pyx_XDECREF(__pyx_t_7); __Pyx_AddTraceback("pygame_sdl2.rect.Rect.collidelistall", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF(__pyx_v_ret); __Pyx_XDECREF(__pyx_v_n); __Pyx_XDECREF(__pyx_v_other); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/rect.pyx":366 * return ret * * def collidedict(self, other_dict, rects_values=0): # <<<<<<<<<<<<<< * # What is rects_values supposed to do? Not in docs. * for key, val in other_dict.iteritems(): */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_4rect_4Rect_55collidedict(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static PyObject *__pyx_pw_11pygame_sdl2_4rect_4Rect_55collidedict(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_other_dict = 0; CYTHON_UNUSED PyObject *__pyx_v_rects_values = 0; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("collidedict (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_other_dict,&__pyx_n_s_rects_values,0}; PyObject* values[2] = {0,0}; values[1] = ((PyObject *)__pyx_int_0); if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_other_dict)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; case 1: if (kw_args > 0) { PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_rects_values); if (value) { values[1] = value; kw_args--; } } } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "collidedict") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 366; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } } else { switch (PyTuple_GET_SIZE(__pyx_args)) { case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_other_dict = values[0]; __pyx_v_rects_values = values[1]; } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("collidedict", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 366; __pyx_clineno = __LINE__; goto __pyx_L3_error;} __pyx_L3_error:; __Pyx_AddTraceback("pygame_sdl2.rect.Rect.collidedict", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_11pygame_sdl2_4rect_4Rect_54collidedict(((struct __pyx_obj_11pygame_sdl2_4rect_Rect *)__pyx_v_self), __pyx_v_other_dict, __pyx_v_rects_values); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_4rect_4Rect_54collidedict(struct __pyx_obj_11pygame_sdl2_4rect_Rect *__pyx_v_self, PyObject *__pyx_v_other_dict, CYTHON_UNUSED PyObject *__pyx_v_rects_values) { PyObject *__pyx_v_key = NULL; PyObject *__pyx_v_val = NULL; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; Py_ssize_t __pyx_t_2; Py_ssize_t __pyx_t_3; int __pyx_t_4; PyObject *__pyx_t_5 = NULL; PyObject *__pyx_t_6 = NULL; int __pyx_t_7; PyObject *__pyx_t_8 = NULL; PyObject *__pyx_t_9 = NULL; int __pyx_t_10; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("collidedict", 0); /* "pygame_sdl2/rect.pyx":368 * def collidedict(self, other_dict, rects_values=0): * # What is rects_values supposed to do? Not in docs. * for key, val in other_dict.iteritems(): # <<<<<<<<<<<<<< * if self.colliderect(val): * return key, val */ __pyx_t_2 = 0; if (unlikely(__pyx_v_other_dict == Py_None)) { PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%s'", "iteritems"); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 368; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } __pyx_t_5 = __Pyx_dict_iterator(__pyx_v_other_dict, 0, __pyx_n_s_iteritems, (&__pyx_t_3), (&__pyx_t_4)); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 368; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = __pyx_t_5; __pyx_t_5 = 0; while (1) { __pyx_t_7 = __Pyx_dict_iter_next(__pyx_t_1, __pyx_t_3, &__pyx_t_2, &__pyx_t_5, &__pyx_t_6, NULL, __pyx_t_4); if (unlikely(__pyx_t_7 == 0)) break; if (unlikely(__pyx_t_7 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 368; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); __Pyx_GOTREF(__pyx_t_6); __Pyx_XDECREF_SET(__pyx_v_key, __pyx_t_5); __pyx_t_5 = 0; __Pyx_XDECREF_SET(__pyx_v_val, __pyx_t_6); __pyx_t_6 = 0; /* "pygame_sdl2/rect.pyx":369 * # What is rects_values supposed to do? Not in docs. * for key, val in other_dict.iteritems(): * if self.colliderect(val): # <<<<<<<<<<<<<< * return key, val * return None */ __pyx_t_5 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_colliderect); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 369; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); __pyx_t_8 = NULL; if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_5))) { __pyx_t_8 = PyMethod_GET_SELF(__pyx_t_5); if (likely(__pyx_t_8)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5); __Pyx_INCREF(__pyx_t_8); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_5, function); } } if (!__pyx_t_8) { __pyx_t_6 = __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_v_val); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 369; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_6); } else { __pyx_t_9 = PyTuple_New(1+1); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 369; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_9); __Pyx_GIVEREF(__pyx_t_8); PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_t_8); __pyx_t_8 = NULL; __Pyx_INCREF(__pyx_v_val); __Pyx_GIVEREF(__pyx_v_val); PyTuple_SET_ITEM(__pyx_t_9, 0+1, __pyx_v_val); __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_9, NULL); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 369; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; } __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __pyx_t_10 = __Pyx_PyObject_IsTrue(__pyx_t_6); if (unlikely(__pyx_t_10 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 369; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; if (__pyx_t_10) { /* "pygame_sdl2/rect.pyx":370 * for key, val in other_dict.iteritems(): * if self.colliderect(val): * return key, val # <<<<<<<<<<<<<< * return None * */ __Pyx_XDECREF(__pyx_r); __pyx_t_6 = PyTuple_New(2); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 370; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_6); __Pyx_INCREF(__pyx_v_key); __Pyx_GIVEREF(__pyx_v_key); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_v_key); __Pyx_INCREF(__pyx_v_val); __Pyx_GIVEREF(__pyx_v_val); PyTuple_SET_ITEM(__pyx_t_6, 1, __pyx_v_val); __pyx_r = __pyx_t_6; __pyx_t_6 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; goto __pyx_L0; /* "pygame_sdl2/rect.pyx":369 * # What is rects_values supposed to do? Not in docs. * for key, val in other_dict.iteritems(): * if self.colliderect(val): # <<<<<<<<<<<<<< * return key, val * return None */ } } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "pygame_sdl2/rect.pyx":371 * if self.colliderect(val): * return key, val * return None # <<<<<<<<<<<<<< * * def collidedictall(self, other_dict, rects_values=0): */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(Py_None); __pyx_r = Py_None; goto __pyx_L0; /* "pygame_sdl2/rect.pyx":366 * return ret * * def collidedict(self, other_dict, rects_values=0): # <<<<<<<<<<<<<< * # What is rects_values supposed to do? Not in docs. * for key, val in other_dict.iteritems(): */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_5); __Pyx_XDECREF(__pyx_t_6); __Pyx_XDECREF(__pyx_t_8); __Pyx_XDECREF(__pyx_t_9); __Pyx_AddTraceback("pygame_sdl2.rect.Rect.collidedict", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF(__pyx_v_key); __Pyx_XDECREF(__pyx_v_val); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/rect.pyx":373 * return None * * def collidedictall(self, other_dict, rects_values=0): # <<<<<<<<<<<<<< * ret = [] * for key, val in other_dict.iteritems(): */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_4rect_4Rect_57collidedictall(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static PyObject *__pyx_pw_11pygame_sdl2_4rect_4Rect_57collidedictall(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_other_dict = 0; CYTHON_UNUSED PyObject *__pyx_v_rects_values = 0; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("collidedictall (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_other_dict,&__pyx_n_s_rects_values,0}; PyObject* values[2] = {0,0}; values[1] = ((PyObject *)__pyx_int_0); if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_other_dict)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; case 1: if (kw_args > 0) { PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_rects_values); if (value) { values[1] = value; kw_args--; } } } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "collidedictall") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 373; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } } else { switch (PyTuple_GET_SIZE(__pyx_args)) { case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_other_dict = values[0]; __pyx_v_rects_values = values[1]; } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("collidedictall", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 373; __pyx_clineno = __LINE__; goto __pyx_L3_error;} __pyx_L3_error:; __Pyx_AddTraceback("pygame_sdl2.rect.Rect.collidedictall", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_11pygame_sdl2_4rect_4Rect_56collidedictall(((struct __pyx_obj_11pygame_sdl2_4rect_Rect *)__pyx_v_self), __pyx_v_other_dict, __pyx_v_rects_values); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_4rect_4Rect_56collidedictall(struct __pyx_obj_11pygame_sdl2_4rect_Rect *__pyx_v_self, PyObject *__pyx_v_other_dict, CYTHON_UNUSED PyObject *__pyx_v_rects_values) { PyObject *__pyx_v_ret = NULL; PyObject *__pyx_v_key = NULL; PyObject *__pyx_v_val = NULL; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; Py_ssize_t __pyx_t_2; Py_ssize_t __pyx_t_3; int __pyx_t_4; PyObject *__pyx_t_5 = NULL; PyObject *__pyx_t_6 = NULL; int __pyx_t_7; PyObject *__pyx_t_8 = NULL; PyObject *__pyx_t_9 = NULL; int __pyx_t_10; int __pyx_t_11; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("collidedictall", 0); /* "pygame_sdl2/rect.pyx":374 * * def collidedictall(self, other_dict, rects_values=0): * ret = [] # <<<<<<<<<<<<<< * for key, val in other_dict.iteritems(): * if self.colliderect(val): */ __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 374; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_v_ret = ((PyObject*)__pyx_t_1); __pyx_t_1 = 0; /* "pygame_sdl2/rect.pyx":375 * def collidedictall(self, other_dict, rects_values=0): * ret = [] * for key, val in other_dict.iteritems(): # <<<<<<<<<<<<<< * if self.colliderect(val): * ret.append((key,val)) */ __pyx_t_2 = 0; if (unlikely(__pyx_v_other_dict == Py_None)) { PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%s'", "iteritems"); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 375; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } __pyx_t_5 = __Pyx_dict_iterator(__pyx_v_other_dict, 0, __pyx_n_s_iteritems, (&__pyx_t_3), (&__pyx_t_4)); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 375; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = __pyx_t_5; __pyx_t_5 = 0; while (1) { __pyx_t_7 = __Pyx_dict_iter_next(__pyx_t_1, __pyx_t_3, &__pyx_t_2, &__pyx_t_5, &__pyx_t_6, NULL, __pyx_t_4); if (unlikely(__pyx_t_7 == 0)) break; if (unlikely(__pyx_t_7 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 375; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); __Pyx_GOTREF(__pyx_t_6); __Pyx_XDECREF_SET(__pyx_v_key, __pyx_t_5); __pyx_t_5 = 0; __Pyx_XDECREF_SET(__pyx_v_val, __pyx_t_6); __pyx_t_6 = 0; /* "pygame_sdl2/rect.pyx":376 * ret = [] * for key, val in other_dict.iteritems(): * if self.colliderect(val): # <<<<<<<<<<<<<< * ret.append((key,val)) * return ret */ __pyx_t_5 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_colliderect); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 376; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); __pyx_t_8 = NULL; if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_5))) { __pyx_t_8 = PyMethod_GET_SELF(__pyx_t_5); if (likely(__pyx_t_8)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5); __Pyx_INCREF(__pyx_t_8); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_5, function); } } if (!__pyx_t_8) { __pyx_t_6 = __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_v_val); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 376; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_6); } else { __pyx_t_9 = PyTuple_New(1+1); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 376; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_9); __Pyx_GIVEREF(__pyx_t_8); PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_t_8); __pyx_t_8 = NULL; __Pyx_INCREF(__pyx_v_val); __Pyx_GIVEREF(__pyx_v_val); PyTuple_SET_ITEM(__pyx_t_9, 0+1, __pyx_v_val); __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_9, NULL); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 376; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; } __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __pyx_t_10 = __Pyx_PyObject_IsTrue(__pyx_t_6); if (unlikely(__pyx_t_10 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 376; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; if (__pyx_t_10) { /* "pygame_sdl2/rect.pyx":377 * for key, val in other_dict.iteritems(): * if self.colliderect(val): * ret.append((key,val)) # <<<<<<<<<<<<<< * return ret * */ __pyx_t_6 = PyTuple_New(2); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 377; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_6); __Pyx_INCREF(__pyx_v_key); __Pyx_GIVEREF(__pyx_v_key); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_v_key); __Pyx_INCREF(__pyx_v_val); __Pyx_GIVEREF(__pyx_v_val); PyTuple_SET_ITEM(__pyx_t_6, 1, __pyx_v_val); __pyx_t_11 = __Pyx_PyList_Append(__pyx_v_ret, __pyx_t_6); if (unlikely(__pyx_t_11 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 377; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; /* "pygame_sdl2/rect.pyx":376 * ret = [] * for key, val in other_dict.iteritems(): * if self.colliderect(val): # <<<<<<<<<<<<<< * ret.append((key,val)) * return ret */ } } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "pygame_sdl2/rect.pyx":378 * if self.colliderect(val): * ret.append((key,val)) * return ret # <<<<<<<<<<<<<< * * */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(__pyx_v_ret); __pyx_r = __pyx_v_ret; goto __pyx_L0; /* "pygame_sdl2/rect.pyx":373 * return None * * def collidedictall(self, other_dict, rects_values=0): # <<<<<<<<<<<<<< * ret = [] * for key, val in other_dict.iteritems(): */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_5); __Pyx_XDECREF(__pyx_t_6); __Pyx_XDECREF(__pyx_t_8); __Pyx_XDECREF(__pyx_t_9); __Pyx_AddTraceback("pygame_sdl2.rect.Rect.collidedictall", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF(__pyx_v_ret); __Pyx_XDECREF(__pyx_v_key); __Pyx_XDECREF(__pyx_v_val); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/rect.pxd":25 * cdef object __weakref__ * * cdef public int x # <<<<<<<<<<<<<< * cdef public int y * cdef public int w */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_4rect_4Rect_1x_1__get__(PyObject *__pyx_v_self); /*proto*/ static PyObject *__pyx_pw_11pygame_sdl2_4rect_4Rect_1x_1__get__(PyObject *__pyx_v_self) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); __pyx_r = __pyx_pf_11pygame_sdl2_4rect_4Rect_1x___get__(((struct __pyx_obj_11pygame_sdl2_4rect_Rect *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_4rect_4Rect_1x___get__(struct __pyx_obj_11pygame_sdl2_4rect_Rect *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__get__", 0); __Pyx_XDECREF(__pyx_r); __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_self->x); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 25; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("pygame_sdl2.rect.Rect.x.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* Python wrapper */ static int __pyx_pw_11pygame_sdl2_4rect_4Rect_1x_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/ static int __pyx_pw_11pygame_sdl2_4rect_4Rect_1x_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) { int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__set__ (wrapper)", 0); __pyx_r = __pyx_pf_11pygame_sdl2_4rect_4Rect_1x_2__set__(((struct __pyx_obj_11pygame_sdl2_4rect_Rect *)__pyx_v_self), ((PyObject *)__pyx_v_value)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static int __pyx_pf_11pygame_sdl2_4rect_4Rect_1x_2__set__(struct __pyx_obj_11pygame_sdl2_4rect_Rect *__pyx_v_self, PyObject *__pyx_v_value) { int __pyx_r; __Pyx_RefNannyDeclarations int __pyx_t_1; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__set__", 0); __pyx_t_1 = __Pyx_PyInt_As_int(__pyx_v_value); if (unlikely((__pyx_t_1 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 25; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_v_self->x = __pyx_t_1; /* function exit code */ __pyx_r = 0; goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("pygame_sdl2.rect.Rect.x.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = -1; __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/rect.pxd":26 * * cdef public int x * cdef public int y # <<<<<<<<<<<<<< * cdef public int w * cdef public int h */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_4rect_4Rect_1y_1__get__(PyObject *__pyx_v_self); /*proto*/ static PyObject *__pyx_pw_11pygame_sdl2_4rect_4Rect_1y_1__get__(PyObject *__pyx_v_self) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); __pyx_r = __pyx_pf_11pygame_sdl2_4rect_4Rect_1y___get__(((struct __pyx_obj_11pygame_sdl2_4rect_Rect *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_4rect_4Rect_1y___get__(struct __pyx_obj_11pygame_sdl2_4rect_Rect *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__get__", 0); __Pyx_XDECREF(__pyx_r); __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_self->y); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 26; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("pygame_sdl2.rect.Rect.y.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* Python wrapper */ static int __pyx_pw_11pygame_sdl2_4rect_4Rect_1y_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/ static int __pyx_pw_11pygame_sdl2_4rect_4Rect_1y_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) { int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__set__ (wrapper)", 0); __pyx_r = __pyx_pf_11pygame_sdl2_4rect_4Rect_1y_2__set__(((struct __pyx_obj_11pygame_sdl2_4rect_Rect *)__pyx_v_self), ((PyObject *)__pyx_v_value)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static int __pyx_pf_11pygame_sdl2_4rect_4Rect_1y_2__set__(struct __pyx_obj_11pygame_sdl2_4rect_Rect *__pyx_v_self, PyObject *__pyx_v_value) { int __pyx_r; __Pyx_RefNannyDeclarations int __pyx_t_1; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__set__", 0); __pyx_t_1 = __Pyx_PyInt_As_int(__pyx_v_value); if (unlikely((__pyx_t_1 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 26; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_v_self->y = __pyx_t_1; /* function exit code */ __pyx_r = 0; goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("pygame_sdl2.rect.Rect.y.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = -1; __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/rect.pxd":27 * cdef public int x * cdef public int y * cdef public int w # <<<<<<<<<<<<<< * cdef public int h * */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_4rect_4Rect_1w_1__get__(PyObject *__pyx_v_self); /*proto*/ static PyObject *__pyx_pw_11pygame_sdl2_4rect_4Rect_1w_1__get__(PyObject *__pyx_v_self) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); __pyx_r = __pyx_pf_11pygame_sdl2_4rect_4Rect_1w___get__(((struct __pyx_obj_11pygame_sdl2_4rect_Rect *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_4rect_4Rect_1w___get__(struct __pyx_obj_11pygame_sdl2_4rect_Rect *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__get__", 0); __Pyx_XDECREF(__pyx_r); __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_self->w); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 27; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("pygame_sdl2.rect.Rect.w.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* Python wrapper */ static int __pyx_pw_11pygame_sdl2_4rect_4Rect_1w_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/ static int __pyx_pw_11pygame_sdl2_4rect_4Rect_1w_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) { int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__set__ (wrapper)", 0); __pyx_r = __pyx_pf_11pygame_sdl2_4rect_4Rect_1w_2__set__(((struct __pyx_obj_11pygame_sdl2_4rect_Rect *)__pyx_v_self), ((PyObject *)__pyx_v_value)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static int __pyx_pf_11pygame_sdl2_4rect_4Rect_1w_2__set__(struct __pyx_obj_11pygame_sdl2_4rect_Rect *__pyx_v_self, PyObject *__pyx_v_value) { int __pyx_r; __Pyx_RefNannyDeclarations int __pyx_t_1; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__set__", 0); __pyx_t_1 = __Pyx_PyInt_As_int(__pyx_v_value); if (unlikely((__pyx_t_1 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 27; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_v_self->w = __pyx_t_1; /* function exit code */ __pyx_r = 0; goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("pygame_sdl2.rect.Rect.w.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = -1; __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/rect.pxd":28 * cdef public int y * cdef public int w * cdef public int h # <<<<<<<<<<<<<< * * */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_4rect_4Rect_1h_1__get__(PyObject *__pyx_v_self); /*proto*/ static PyObject *__pyx_pw_11pygame_sdl2_4rect_4Rect_1h_1__get__(PyObject *__pyx_v_self) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); __pyx_r = __pyx_pf_11pygame_sdl2_4rect_4Rect_1h___get__(((struct __pyx_obj_11pygame_sdl2_4rect_Rect *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_4rect_4Rect_1h___get__(struct __pyx_obj_11pygame_sdl2_4rect_Rect *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__get__", 0); __Pyx_XDECREF(__pyx_r); __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_self->h); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 28; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("pygame_sdl2.rect.Rect.h.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* Python wrapper */ static int __pyx_pw_11pygame_sdl2_4rect_4Rect_1h_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/ static int __pyx_pw_11pygame_sdl2_4rect_4Rect_1h_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) { int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__set__ (wrapper)", 0); __pyx_r = __pyx_pf_11pygame_sdl2_4rect_4Rect_1h_2__set__(((struct __pyx_obj_11pygame_sdl2_4rect_Rect *)__pyx_v_self), ((PyObject *)__pyx_v_value)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static int __pyx_pf_11pygame_sdl2_4rect_4Rect_1h_2__set__(struct __pyx_obj_11pygame_sdl2_4rect_Rect *__pyx_v_self, PyObject *__pyx_v_value) { int __pyx_r; __Pyx_RefNannyDeclarations int __pyx_t_1; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__set__", 0); __pyx_t_1 = __Pyx_PyInt_As_int(__pyx_v_value); if (unlikely((__pyx_t_1 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 28; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_v_self->h = __pyx_t_1; /* function exit code */ __pyx_r = 0; goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("pygame_sdl2.rect.Rect.h.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = -1; __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/rect.pyx":381 * * * cdef int to_sdl_rect(rectlike, SDL_Rect *rect, argname=None) except -1: # <<<<<<<<<<<<<< * """ * Converts `rectlike` to the SDL_Rect `rect`. */ static int __pyx_f_11pygame_sdl2_4rect_to_sdl_rect(PyObject *__pyx_v_rectlike, SDL_Rect *__pyx_v_rect, struct __pyx_opt_args_11pygame_sdl2_4rect_to_sdl_rect *__pyx_optional_args) { PyObject *__pyx_v_argname = ((PyObject *)Py_None); struct __pyx_obj_11pygame_sdl2_4rect_Rect *__pyx_v_rl = 0; int __pyx_r; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; int __pyx_t_4; int __pyx_t_5; PyObject *__pyx_t_6 = NULL; int __pyx_t_7; Py_ssize_t __pyx_t_8; PyObject *__pyx_t_9 = NULL; PyObject *__pyx_t_10 = NULL; PyObject *__pyx_t_11 = NULL; PyObject *__pyx_t_12 = NULL; PyObject *(*__pyx_t_13)(PyObject *); int __pyx_t_14; int __pyx_t_15; int __pyx_t_16; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("to_sdl_rect", 0); if (__pyx_optional_args) { if (__pyx_optional_args->__pyx_n > 0) { __pyx_v_argname = __pyx_optional_args->argname; } } /* "pygame_sdl2/rect.pyx":391 * cdef Rect rl * * try: # <<<<<<<<<<<<<< * if isinstance(rectlike, Rect): * rl = rectlike */ { __Pyx_ExceptionSave(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3); __Pyx_XGOTREF(__pyx_t_1); __Pyx_XGOTREF(__pyx_t_2); __Pyx_XGOTREF(__pyx_t_3); /*try:*/ { /* "pygame_sdl2/rect.pyx":392 * * try: * if isinstance(rectlike, Rect): # <<<<<<<<<<<<<< * rl = rectlike * */ __pyx_t_4 = __Pyx_TypeCheck(__pyx_v_rectlike, __pyx_ptype_11pygame_sdl2_4rect_Rect); __pyx_t_5 = (__pyx_t_4 != 0); if (__pyx_t_5) { /* "pygame_sdl2/rect.pyx":393 * try: * if isinstance(rectlike, Rect): * rl = rectlike # <<<<<<<<<<<<<< * * rect.x = rl.x */ if (!(likely(((__pyx_v_rectlike) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_rectlike, __pyx_ptype_11pygame_sdl2_4rect_Rect))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 393; __pyx_clineno = __LINE__; goto __pyx_L3_error;} __pyx_t_6 = __pyx_v_rectlike; __Pyx_INCREF(__pyx_t_6); __pyx_v_rl = ((struct __pyx_obj_11pygame_sdl2_4rect_Rect *)__pyx_t_6); __pyx_t_6 = 0; /* "pygame_sdl2/rect.pyx":395 * rl = rectlike * * rect.x = rl.x # <<<<<<<<<<<<<< * rect.y = rl.y * rect.w = rl.w */ __pyx_t_7 = __pyx_v_rl->x; __pyx_v_rect->x = __pyx_t_7; /* "pygame_sdl2/rect.pyx":396 * * rect.x = rl.x * rect.y = rl.y # <<<<<<<<<<<<<< * rect.w = rl.w * rect.h = rl.h */ __pyx_t_7 = __pyx_v_rl->y; __pyx_v_rect->y = __pyx_t_7; /* "pygame_sdl2/rect.pyx":397 * rect.x = rl.x * rect.y = rl.y * rect.w = rl.w # <<<<<<<<<<<<<< * rect.h = rl.h * */ __pyx_t_7 = __pyx_v_rl->w; __pyx_v_rect->w = __pyx_t_7; /* "pygame_sdl2/rect.pyx":398 * rect.y = rl.y * rect.w = rl.w * rect.h = rl.h # <<<<<<<<<<<<<< * * return 0 */ __pyx_t_7 = __pyx_v_rl->h; __pyx_v_rect->h = __pyx_t_7; /* "pygame_sdl2/rect.pyx":400 * rect.h = rl.h * * return 0 # <<<<<<<<<<<<<< * * elif len(rectlike) == 4: */ __pyx_r = 0; goto __pyx_L7_try_return; /* "pygame_sdl2/rect.pyx":392 * * try: * if isinstance(rectlike, Rect): # <<<<<<<<<<<<<< * rl = rectlike * */ } /* "pygame_sdl2/rect.pyx":402 * return 0 * * elif len(rectlike) == 4: # <<<<<<<<<<<<<< * rect.x, rect.y, rect.w, rect.h = rectlike * return 0 */ __pyx_t_8 = PyObject_Length(__pyx_v_rectlike); if (unlikely(__pyx_t_8 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 402; __pyx_clineno = __LINE__; goto __pyx_L3_error;} __pyx_t_5 = ((__pyx_t_8 == 4) != 0); if (__pyx_t_5) { /* "pygame_sdl2/rect.pyx":403 * * elif len(rectlike) == 4: * rect.x, rect.y, rect.w, rect.h = rectlike # <<<<<<<<<<<<<< * return 0 * */ if ((likely(PyTuple_CheckExact(__pyx_v_rectlike))) || (PyList_CheckExact(__pyx_v_rectlike))) { PyObject* sequence = __pyx_v_rectlike; #if CYTHON_COMPILING_IN_CPYTHON Py_ssize_t size = Py_SIZE(sequence); #else Py_ssize_t size = PySequence_Size(sequence); #endif if (unlikely(size != 4)) { if (size > 4) __Pyx_RaiseTooManyValuesError(4); else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 403; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } #if CYTHON_COMPILING_IN_CPYTHON if (likely(PyTuple_CheckExact(sequence))) { __pyx_t_6 = PyTuple_GET_ITEM(sequence, 0); __pyx_t_9 = PyTuple_GET_ITEM(sequence, 1); __pyx_t_10 = PyTuple_GET_ITEM(sequence, 2); __pyx_t_11 = PyTuple_GET_ITEM(sequence, 3); } else { __pyx_t_6 = PyList_GET_ITEM(sequence, 0); __pyx_t_9 = PyList_GET_ITEM(sequence, 1); __pyx_t_10 = PyList_GET_ITEM(sequence, 2); __pyx_t_11 = PyList_GET_ITEM(sequence, 3); } __Pyx_INCREF(__pyx_t_6); __Pyx_INCREF(__pyx_t_9); __Pyx_INCREF(__pyx_t_10); __Pyx_INCREF(__pyx_t_11); #else { Py_ssize_t i; PyObject** temps[4] = {&__pyx_t_6,&__pyx_t_9,&__pyx_t_10,&__pyx_t_11}; for (i=0; i < 4; i++) { PyObject* item = PySequence_ITEM(sequence, i); if (unlikely(!item)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 403; __pyx_clineno = __LINE__; goto __pyx_L3_error;} __Pyx_GOTREF(item); *(temps[i]) = item; } } #endif } else { Py_ssize_t index = -1; PyObject** temps[4] = {&__pyx_t_6,&__pyx_t_9,&__pyx_t_10,&__pyx_t_11}; __pyx_t_12 = PyObject_GetIter(__pyx_v_rectlike); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 403; __pyx_clineno = __LINE__; goto __pyx_L3_error;} __Pyx_GOTREF(__pyx_t_12); __pyx_t_13 = Py_TYPE(__pyx_t_12)->tp_iternext; for (index=0; index < 4; index++) { PyObject* item = __pyx_t_13(__pyx_t_12); if (unlikely(!item)) goto __pyx_L12_unpacking_failed; __Pyx_GOTREF(item); *(temps[index]) = item; } if (__Pyx_IternextUnpackEndCheck(__pyx_t_13(__pyx_t_12), 4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 403; __pyx_clineno = __LINE__; goto __pyx_L3_error;} __pyx_t_13 = NULL; __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; goto __pyx_L13_unpacking_done; __pyx_L12_unpacking_failed:; __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; __pyx_t_13 = NULL; if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 403; __pyx_clineno = __LINE__; goto __pyx_L3_error;} __pyx_L13_unpacking_done:; } __pyx_t_7 = __Pyx_PyInt_As_int(__pyx_t_6); if (unlikely((__pyx_t_7 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 403; __pyx_clineno = __LINE__; goto __pyx_L3_error;} __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __pyx_t_14 = __Pyx_PyInt_As_int(__pyx_t_9); if (unlikely((__pyx_t_14 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 403; __pyx_clineno = __LINE__; goto __pyx_L3_error;} __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; __pyx_t_15 = __Pyx_PyInt_As_int(__pyx_t_10); if (unlikely((__pyx_t_15 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 403; __pyx_clineno = __LINE__; goto __pyx_L3_error;} __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; __pyx_t_16 = __Pyx_PyInt_As_int(__pyx_t_11); if (unlikely((__pyx_t_16 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 403; __pyx_clineno = __LINE__; goto __pyx_L3_error;} __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; __pyx_v_rect->x = __pyx_t_7; __pyx_v_rect->y = __pyx_t_14; __pyx_v_rect->w = __pyx_t_15; __pyx_v_rect->h = __pyx_t_16; /* "pygame_sdl2/rect.pyx":404 * elif len(rectlike) == 4: * rect.x, rect.y, rect.w, rect.h = rectlike * return 0 # <<<<<<<<<<<<<< * * elif len(rectlike) == 2: */ __pyx_r = 0; goto __pyx_L7_try_return; /* "pygame_sdl2/rect.pyx":402 * return 0 * * elif len(rectlike) == 4: # <<<<<<<<<<<<<< * rect.x, rect.y, rect.w, rect.h = rectlike * return 0 */ } /* "pygame_sdl2/rect.pyx":406 * return 0 * * elif len(rectlike) == 2: # <<<<<<<<<<<<<< * rect.x, rect.y = rectlike * rect.w, rect.h = rectlike */ __pyx_t_8 = PyObject_Length(__pyx_v_rectlike); if (unlikely(__pyx_t_8 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 406; __pyx_clineno = __LINE__; goto __pyx_L3_error;} __pyx_t_5 = ((__pyx_t_8 == 2) != 0); if (__pyx_t_5) { /* "pygame_sdl2/rect.pyx":407 * * elif len(rectlike) == 2: * rect.x, rect.y = rectlike # <<<<<<<<<<<<<< * rect.w, rect.h = rectlike * return 0 */ if ((likely(PyTuple_CheckExact(__pyx_v_rectlike))) || (PyList_CheckExact(__pyx_v_rectlike))) { PyObject* sequence = __pyx_v_rectlike; #if CYTHON_COMPILING_IN_CPYTHON Py_ssize_t size = Py_SIZE(sequence); #else Py_ssize_t size = PySequence_Size(sequence); #endif if (unlikely(size != 2)) { if (size > 2) __Pyx_RaiseTooManyValuesError(2); else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 407; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } #if CYTHON_COMPILING_IN_CPYTHON if (likely(PyTuple_CheckExact(sequence))) { __pyx_t_11 = PyTuple_GET_ITEM(sequence, 0); __pyx_t_10 = PyTuple_GET_ITEM(sequence, 1); } else { __pyx_t_11 = PyList_GET_ITEM(sequence, 0); __pyx_t_10 = PyList_GET_ITEM(sequence, 1); } __Pyx_INCREF(__pyx_t_11); __Pyx_INCREF(__pyx_t_10); #else __pyx_t_11 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 407; __pyx_clineno = __LINE__; goto __pyx_L3_error;} __Pyx_GOTREF(__pyx_t_11); __pyx_t_10 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 407; __pyx_clineno = __LINE__; goto __pyx_L3_error;} __Pyx_GOTREF(__pyx_t_10); #endif } else { Py_ssize_t index = -1; __pyx_t_9 = PyObject_GetIter(__pyx_v_rectlike); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 407; __pyx_clineno = __LINE__; goto __pyx_L3_error;} __Pyx_GOTREF(__pyx_t_9); __pyx_t_13 = Py_TYPE(__pyx_t_9)->tp_iternext; index = 0; __pyx_t_11 = __pyx_t_13(__pyx_t_9); if (unlikely(!__pyx_t_11)) goto __pyx_L14_unpacking_failed; __Pyx_GOTREF(__pyx_t_11); index = 1; __pyx_t_10 = __pyx_t_13(__pyx_t_9); if (unlikely(!__pyx_t_10)) goto __pyx_L14_unpacking_failed; __Pyx_GOTREF(__pyx_t_10); if (__Pyx_IternextUnpackEndCheck(__pyx_t_13(__pyx_t_9), 2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 407; __pyx_clineno = __LINE__; goto __pyx_L3_error;} __pyx_t_13 = NULL; __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; goto __pyx_L15_unpacking_done; __pyx_L14_unpacking_failed:; __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; __pyx_t_13 = NULL; if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 407; __pyx_clineno = __LINE__; goto __pyx_L3_error;} __pyx_L15_unpacking_done:; } __pyx_t_16 = __Pyx_PyInt_As_int(__pyx_t_11); if (unlikely((__pyx_t_16 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 407; __pyx_clineno = __LINE__; goto __pyx_L3_error;} __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; __pyx_t_15 = __Pyx_PyInt_As_int(__pyx_t_10); if (unlikely((__pyx_t_15 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 407; __pyx_clineno = __LINE__; goto __pyx_L3_error;} __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; __pyx_v_rect->x = __pyx_t_16; __pyx_v_rect->y = __pyx_t_15; /* "pygame_sdl2/rect.pyx":408 * elif len(rectlike) == 2: * rect.x, rect.y = rectlike * rect.w, rect.h = rectlike # <<<<<<<<<<<<<< * return 0 * */ if ((likely(PyTuple_CheckExact(__pyx_v_rectlike))) || (PyList_CheckExact(__pyx_v_rectlike))) { PyObject* sequence = __pyx_v_rectlike; #if CYTHON_COMPILING_IN_CPYTHON Py_ssize_t size = Py_SIZE(sequence); #else Py_ssize_t size = PySequence_Size(sequence); #endif if (unlikely(size != 2)) { if (size > 2) __Pyx_RaiseTooManyValuesError(2); else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 408; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } #if CYTHON_COMPILING_IN_CPYTHON if (likely(PyTuple_CheckExact(sequence))) { __pyx_t_10 = PyTuple_GET_ITEM(sequence, 0); __pyx_t_11 = PyTuple_GET_ITEM(sequence, 1); } else { __pyx_t_10 = PyList_GET_ITEM(sequence, 0); __pyx_t_11 = PyList_GET_ITEM(sequence, 1); } __Pyx_INCREF(__pyx_t_10); __Pyx_INCREF(__pyx_t_11); #else __pyx_t_10 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 408; __pyx_clineno = __LINE__; goto __pyx_L3_error;} __Pyx_GOTREF(__pyx_t_10); __pyx_t_11 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 408; __pyx_clineno = __LINE__; goto __pyx_L3_error;} __Pyx_GOTREF(__pyx_t_11); #endif } else { Py_ssize_t index = -1; __pyx_t_9 = PyObject_GetIter(__pyx_v_rectlike); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 408; __pyx_clineno = __LINE__; goto __pyx_L3_error;} __Pyx_GOTREF(__pyx_t_9); __pyx_t_13 = Py_TYPE(__pyx_t_9)->tp_iternext; index = 0; __pyx_t_10 = __pyx_t_13(__pyx_t_9); if (unlikely(!__pyx_t_10)) goto __pyx_L16_unpacking_failed; __Pyx_GOTREF(__pyx_t_10); index = 1; __pyx_t_11 = __pyx_t_13(__pyx_t_9); if (unlikely(!__pyx_t_11)) goto __pyx_L16_unpacking_failed; __Pyx_GOTREF(__pyx_t_11); if (__Pyx_IternextUnpackEndCheck(__pyx_t_13(__pyx_t_9), 2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 408; __pyx_clineno = __LINE__; goto __pyx_L3_error;} __pyx_t_13 = NULL; __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; goto __pyx_L17_unpacking_done; __pyx_L16_unpacking_failed:; __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; __pyx_t_13 = NULL; if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 408; __pyx_clineno = __LINE__; goto __pyx_L3_error;} __pyx_L17_unpacking_done:; } __pyx_t_15 = __Pyx_PyInt_As_int(__pyx_t_10); if (unlikely((__pyx_t_15 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 408; __pyx_clineno = __LINE__; goto __pyx_L3_error;} __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; __pyx_t_16 = __Pyx_PyInt_As_int(__pyx_t_11); if (unlikely((__pyx_t_16 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 408; __pyx_clineno = __LINE__; goto __pyx_L3_error;} __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; __pyx_v_rect->w = __pyx_t_15; __pyx_v_rect->h = __pyx_t_16; /* "pygame_sdl2/rect.pyx":409 * rect.x, rect.y = rectlike * rect.w, rect.h = rectlike * return 0 # <<<<<<<<<<<<<< * * except: */ __pyx_r = 0; goto __pyx_L7_try_return; /* "pygame_sdl2/rect.pyx":406 * return 0 * * elif len(rectlike) == 2: # <<<<<<<<<<<<<< * rect.x, rect.y = rectlike * rect.w, rect.h = rectlike */ } /* "pygame_sdl2/rect.pyx":391 * cdef Rect rl * * try: # <<<<<<<<<<<<<< * if isinstance(rectlike, Rect): * rl = rectlike */ } __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; goto __pyx_L10_try_end; __pyx_L3_error:; __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0; __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0; __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0; __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0; /* "pygame_sdl2/rect.pyx":411 * return 0 * * except: # <<<<<<<<<<<<<< * pass * */ /*except:*/ { PyErr_Restore(0,0,0); goto __pyx_L4_exception_handled; } __pyx_L7_try_return:; /* "pygame_sdl2/rect.pyx":391 * cdef Rect rl * * try: # <<<<<<<<<<<<<< * if isinstance(rectlike, Rect): * rl = rectlike */ __Pyx_XGIVEREF(__pyx_t_1); __Pyx_XGIVEREF(__pyx_t_2); __Pyx_XGIVEREF(__pyx_t_3); __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3); goto __pyx_L0; __pyx_L4_exception_handled:; __Pyx_XGIVEREF(__pyx_t_1); __Pyx_XGIVEREF(__pyx_t_2); __Pyx_XGIVEREF(__pyx_t_3); __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3); __pyx_L10_try_end:; } /* "pygame_sdl2/rect.pyx":414 * pass * * if argname: # <<<<<<<<<<<<<< * raise TypeError("Argument {} must be a rect style object.".format(argname)) * else: */ __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_v_argname); if (unlikely(__pyx_t_5 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 414; __pyx_clineno = __LINE__; goto __pyx_L1_error;} if (__pyx_t_5) { /* "pygame_sdl2/rect.pyx":415 * * if argname: * raise TypeError("Argument {} must be a rect style object.".format(argname)) # <<<<<<<<<<<<<< * else: * raise TypeError("Argument must be a rect style object.") */ __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_kp_s_Argument_must_be_a_rect_style_ob_2, __pyx_n_s_format); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 415; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_10); __pyx_t_9 = NULL; if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_10))) { __pyx_t_9 = PyMethod_GET_SELF(__pyx_t_10); if (likely(__pyx_t_9)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_10); __Pyx_INCREF(__pyx_t_9); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_10, function); } } if (!__pyx_t_9) { __pyx_t_11 = __Pyx_PyObject_CallOneArg(__pyx_t_10, __pyx_v_argname); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 415; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_11); } else { __pyx_t_6 = PyTuple_New(1+1); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 415; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_6); __Pyx_GIVEREF(__pyx_t_9); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_9); __pyx_t_9 = NULL; __Pyx_INCREF(__pyx_v_argname); __Pyx_GIVEREF(__pyx_v_argname); PyTuple_SET_ITEM(__pyx_t_6, 0+1, __pyx_v_argname); __pyx_t_11 = __Pyx_PyObject_Call(__pyx_t_10, __pyx_t_6, NULL); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 415; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_11); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; } __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; __pyx_t_10 = PyTuple_New(1); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 415; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_10); __Pyx_GIVEREF(__pyx_t_11); PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_t_11); __pyx_t_11 = 0; __pyx_t_11 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_t_10, NULL); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 415; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_11); __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; __Pyx_Raise(__pyx_t_11, 0, 0, 0); __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; {__pyx_filename = __pyx_f[0]; __pyx_lineno = 415; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "pygame_sdl2/rect.pyx":414 * pass * * if argname: # <<<<<<<<<<<<<< * raise TypeError("Argument {} must be a rect style object.".format(argname)) * else: */ } /* "pygame_sdl2/rect.pyx":417 * raise TypeError("Argument {} must be a rect style object.".format(argname)) * else: * raise TypeError("Argument must be a rect style object.") # <<<<<<<<<<<<<< */ /*else*/ { __pyx_t_11 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__3, NULL); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 417; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_11); __Pyx_Raise(__pyx_t_11, 0, 0, 0); __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; {__pyx_filename = __pyx_f[0]; __pyx_lineno = 417; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } /* "pygame_sdl2/rect.pyx":381 * * * cdef int to_sdl_rect(rectlike, SDL_Rect *rect, argname=None) except -1: # <<<<<<<<<<<<<< * """ * Converts `rectlike` to the SDL_Rect `rect`. */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_6); __Pyx_XDECREF(__pyx_t_9); __Pyx_XDECREF(__pyx_t_10); __Pyx_XDECREF(__pyx_t_11); __Pyx_XDECREF(__pyx_t_12); __Pyx_AddTraceback("pygame_sdl2.rect.to_sdl_rect", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = -1; __pyx_L0:; __Pyx_XDECREF((PyObject *)__pyx_v_rl); __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_tp_new_11pygame_sdl2_4rect_Rect(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) { PyObject *o; if (likely((t->tp_flags & Py_TPFLAGS_IS_ABSTRACT) == 0)) { o = (*t->tp_alloc)(t, 0); } else { o = (PyObject *) PyBaseObject_Type.tp_new(t, __pyx_empty_tuple, 0); } if (unlikely(!o)) return 0; return o; } static void __pyx_tp_dealloc_11pygame_sdl2_4rect_Rect(PyObject *o) { struct __pyx_obj_11pygame_sdl2_4rect_Rect *p = (struct __pyx_obj_11pygame_sdl2_4rect_Rect *)o; #if PY_VERSION_HEX >= 0x030400a1 if (unlikely(Py_TYPE(o)->tp_finalize) && (!PyType_IS_GC(Py_TYPE(o)) || !_PyGC_FINALIZED(o))) { if (PyObject_CallFinalizerFromDealloc(o)) return; } #endif if (p->__weakref__) PyObject_ClearWeakRefs(o); (*Py_TYPE(o)->tp_free)(o); } static PyObject *__pyx_sq_item_11pygame_sdl2_4rect_Rect(PyObject *o, Py_ssize_t i) { PyObject *r; PyObject *x = PyInt_FromSsize_t(i); if(!x) return 0; r = Py_TYPE(o)->tp_as_mapping->mp_subscript(o, x); Py_DECREF(x); return r; } static int __pyx_mp_ass_subscript_11pygame_sdl2_4rect_Rect(PyObject *o, PyObject *i, PyObject *v) { if (v) { return __pyx_pw_11pygame_sdl2_4rect_4Rect_15__setitem__(o, i, v); } else { PyErr_Format(PyExc_NotImplementedError, "Subscript deletion not supported by %.200s", Py_TYPE(o)->tp_name); return -1; } } static PyObject *__pyx_getprop_11pygame_sdl2_4rect_4Rect_left(PyObject *o, CYTHON_UNUSED void *x) { return __pyx_pw_11pygame_sdl2_4rect_4Rect_4left_1__get__(o); } static int __pyx_setprop_11pygame_sdl2_4rect_4Rect_left(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) { if (v) { return __pyx_pw_11pygame_sdl2_4rect_4Rect_4left_3__set__(o, v); } else { PyErr_SetString(PyExc_NotImplementedError, "__del__"); return -1; } } static PyObject *__pyx_getprop_11pygame_sdl2_4rect_4Rect_top(PyObject *o, CYTHON_UNUSED void *x) { return __pyx_pw_11pygame_sdl2_4rect_4Rect_3top_1__get__(o); } static int __pyx_setprop_11pygame_sdl2_4rect_4Rect_top(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) { if (v) { return __pyx_pw_11pygame_sdl2_4rect_4Rect_3top_3__set__(o, v); } else { PyErr_SetString(PyExc_NotImplementedError, "__del__"); return -1; } } static PyObject *__pyx_getprop_11pygame_sdl2_4rect_4Rect_width(PyObject *o, CYTHON_UNUSED void *x) { return __pyx_pw_11pygame_sdl2_4rect_4Rect_5width_1__get__(o); } static int __pyx_setprop_11pygame_sdl2_4rect_4Rect_width(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) { if (v) { return __pyx_pw_11pygame_sdl2_4rect_4Rect_5width_3__set__(o, v); } else { PyErr_SetString(PyExc_NotImplementedError, "__del__"); return -1; } } static PyObject *__pyx_getprop_11pygame_sdl2_4rect_4Rect_height(PyObject *o, CYTHON_UNUSED void *x) { return __pyx_pw_11pygame_sdl2_4rect_4Rect_6height_1__get__(o); } static int __pyx_setprop_11pygame_sdl2_4rect_4Rect_height(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) { if (v) { return __pyx_pw_11pygame_sdl2_4rect_4Rect_6height_3__set__(o, v); } else { PyErr_SetString(PyExc_NotImplementedError, "__del__"); return -1; } } static PyObject *__pyx_getprop_11pygame_sdl2_4rect_4Rect_right(PyObject *o, CYTHON_UNUSED void *x) { return __pyx_pw_11pygame_sdl2_4rect_4Rect_5right_1__get__(o); } static int __pyx_setprop_11pygame_sdl2_4rect_4Rect_right(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) { if (v) { return __pyx_pw_11pygame_sdl2_4rect_4Rect_5right_3__set__(o, v); } else { PyErr_SetString(PyExc_NotImplementedError, "__del__"); return -1; } } static PyObject *__pyx_getprop_11pygame_sdl2_4rect_4Rect_bottom(PyObject *o, CYTHON_UNUSED void *x) { return __pyx_pw_11pygame_sdl2_4rect_4Rect_6bottom_1__get__(o); } static int __pyx_setprop_11pygame_sdl2_4rect_4Rect_bottom(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) { if (v) { return __pyx_pw_11pygame_sdl2_4rect_4Rect_6bottom_3__set__(o, v); } else { PyErr_SetString(PyExc_NotImplementedError, "__del__"); return -1; } } static PyObject *__pyx_getprop_11pygame_sdl2_4rect_4Rect_size(PyObject *o, CYTHON_UNUSED void *x) { return __pyx_pw_11pygame_sdl2_4rect_4Rect_4size_1__get__(o); } static int __pyx_setprop_11pygame_sdl2_4rect_4Rect_size(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) { if (v) { return __pyx_pw_11pygame_sdl2_4rect_4Rect_4size_3__set__(o, v); } else { PyErr_SetString(PyExc_NotImplementedError, "__del__"); return -1; } } static PyObject *__pyx_getprop_11pygame_sdl2_4rect_4Rect_topleft(PyObject *o, CYTHON_UNUSED void *x) { return __pyx_pw_11pygame_sdl2_4rect_4Rect_7topleft_1__get__(o); } static int __pyx_setprop_11pygame_sdl2_4rect_4Rect_topleft(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) { if (v) { return __pyx_pw_11pygame_sdl2_4rect_4Rect_7topleft_3__set__(o, v); } else { PyErr_SetString(PyExc_NotImplementedError, "__del__"); return -1; } } static PyObject *__pyx_getprop_11pygame_sdl2_4rect_4Rect_topright(PyObject *o, CYTHON_UNUSED void *x) { return __pyx_pw_11pygame_sdl2_4rect_4Rect_8topright_1__get__(o); } static int __pyx_setprop_11pygame_sdl2_4rect_4Rect_topright(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) { if (v) { return __pyx_pw_11pygame_sdl2_4rect_4Rect_8topright_3__set__(o, v); } else { PyErr_SetString(PyExc_NotImplementedError, "__del__"); return -1; } } static PyObject *__pyx_getprop_11pygame_sdl2_4rect_4Rect_bottomright(PyObject *o, CYTHON_UNUSED void *x) { return __pyx_pw_11pygame_sdl2_4rect_4Rect_11bottomright_1__get__(o); } static int __pyx_setprop_11pygame_sdl2_4rect_4Rect_bottomright(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) { if (v) { return __pyx_pw_11pygame_sdl2_4rect_4Rect_11bottomright_3__set__(o, v); } else { PyErr_SetString(PyExc_NotImplementedError, "__del__"); return -1; } } static PyObject *__pyx_getprop_11pygame_sdl2_4rect_4Rect_bottomleft(PyObject *o, CYTHON_UNUSED void *x) { return __pyx_pw_11pygame_sdl2_4rect_4Rect_10bottomleft_1__get__(o); } static int __pyx_setprop_11pygame_sdl2_4rect_4Rect_bottomleft(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) { if (v) { return __pyx_pw_11pygame_sdl2_4rect_4Rect_10bottomleft_3__set__(o, v); } else { PyErr_SetString(PyExc_NotImplementedError, "__del__"); return -1; } } static PyObject *__pyx_getprop_11pygame_sdl2_4rect_4Rect_centerx(PyObject *o, CYTHON_UNUSED void *x) { return __pyx_pw_11pygame_sdl2_4rect_4Rect_7centerx_1__get__(o); } static int __pyx_setprop_11pygame_sdl2_4rect_4Rect_centerx(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) { if (v) { return __pyx_pw_11pygame_sdl2_4rect_4Rect_7centerx_3__set__(o, v); } else { PyErr_SetString(PyExc_NotImplementedError, "__del__"); return -1; } } static PyObject *__pyx_getprop_11pygame_sdl2_4rect_4Rect_centery(PyObject *o, CYTHON_UNUSED void *x) { return __pyx_pw_11pygame_sdl2_4rect_4Rect_7centery_1__get__(o); } static int __pyx_setprop_11pygame_sdl2_4rect_4Rect_centery(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) { if (v) { return __pyx_pw_11pygame_sdl2_4rect_4Rect_7centery_3__set__(o, v); } else { PyErr_SetString(PyExc_NotImplementedError, "__del__"); return -1; } } static PyObject *__pyx_getprop_11pygame_sdl2_4rect_4Rect_center(PyObject *o, CYTHON_UNUSED void *x) { return __pyx_pw_11pygame_sdl2_4rect_4Rect_6center_1__get__(o); } static int __pyx_setprop_11pygame_sdl2_4rect_4Rect_center(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) { if (v) { return __pyx_pw_11pygame_sdl2_4rect_4Rect_6center_3__set__(o, v); } else { PyErr_SetString(PyExc_NotImplementedError, "__del__"); return -1; } } static PyObject *__pyx_getprop_11pygame_sdl2_4rect_4Rect_midtop(PyObject *o, CYTHON_UNUSED void *x) { return __pyx_pw_11pygame_sdl2_4rect_4Rect_6midtop_1__get__(o); } static int __pyx_setprop_11pygame_sdl2_4rect_4Rect_midtop(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) { if (v) { return __pyx_pw_11pygame_sdl2_4rect_4Rect_6midtop_3__set__(o, v); } else { PyErr_SetString(PyExc_NotImplementedError, "__del__"); return -1; } } static PyObject *__pyx_getprop_11pygame_sdl2_4rect_4Rect_midleft(PyObject *o, CYTHON_UNUSED void *x) { return __pyx_pw_11pygame_sdl2_4rect_4Rect_7midleft_1__get__(o); } static int __pyx_setprop_11pygame_sdl2_4rect_4Rect_midleft(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) { if (v) { return __pyx_pw_11pygame_sdl2_4rect_4Rect_7midleft_3__set__(o, v); } else { PyErr_SetString(PyExc_NotImplementedError, "__del__"); return -1; } } static PyObject *__pyx_getprop_11pygame_sdl2_4rect_4Rect_midbottom(PyObject *o, CYTHON_UNUSED void *x) { return __pyx_pw_11pygame_sdl2_4rect_4Rect_9midbottom_1__get__(o); } static int __pyx_setprop_11pygame_sdl2_4rect_4Rect_midbottom(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) { if (v) { return __pyx_pw_11pygame_sdl2_4rect_4Rect_9midbottom_3__set__(o, v); } else { PyErr_SetString(PyExc_NotImplementedError, "__del__"); return -1; } } static PyObject *__pyx_getprop_11pygame_sdl2_4rect_4Rect_midright(PyObject *o, CYTHON_UNUSED void *x) { return __pyx_pw_11pygame_sdl2_4rect_4Rect_8midright_1__get__(o); } static int __pyx_setprop_11pygame_sdl2_4rect_4Rect_midright(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) { if (v) { return __pyx_pw_11pygame_sdl2_4rect_4Rect_8midright_3__set__(o, v); } else { PyErr_SetString(PyExc_NotImplementedError, "__del__"); return -1; } } static PyObject *__pyx_getprop_11pygame_sdl2_4rect_4Rect_x(PyObject *o, CYTHON_UNUSED void *x) { return __pyx_pw_11pygame_sdl2_4rect_4Rect_1x_1__get__(o); } static int __pyx_setprop_11pygame_sdl2_4rect_4Rect_x(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) { if (v) { return __pyx_pw_11pygame_sdl2_4rect_4Rect_1x_3__set__(o, v); } else { PyErr_SetString(PyExc_NotImplementedError, "__del__"); return -1; } } static PyObject *__pyx_getprop_11pygame_sdl2_4rect_4Rect_y(PyObject *o, CYTHON_UNUSED void *x) { return __pyx_pw_11pygame_sdl2_4rect_4Rect_1y_1__get__(o); } static int __pyx_setprop_11pygame_sdl2_4rect_4Rect_y(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) { if (v) { return __pyx_pw_11pygame_sdl2_4rect_4Rect_1y_3__set__(o, v); } else { PyErr_SetString(PyExc_NotImplementedError, "__del__"); return -1; } } static PyObject *__pyx_getprop_11pygame_sdl2_4rect_4Rect_w(PyObject *o, CYTHON_UNUSED void *x) { return __pyx_pw_11pygame_sdl2_4rect_4Rect_1w_1__get__(o); } static int __pyx_setprop_11pygame_sdl2_4rect_4Rect_w(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) { if (v) { return __pyx_pw_11pygame_sdl2_4rect_4Rect_1w_3__set__(o, v); } else { PyErr_SetString(PyExc_NotImplementedError, "__del__"); return -1; } } static PyObject *__pyx_getprop_11pygame_sdl2_4rect_4Rect_h(PyObject *o, CYTHON_UNUSED void *x) { return __pyx_pw_11pygame_sdl2_4rect_4Rect_1h_1__get__(o); } static int __pyx_setprop_11pygame_sdl2_4rect_4Rect_h(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) { if (v) { return __pyx_pw_11pygame_sdl2_4rect_4Rect_1h_3__set__(o, v); } else { PyErr_SetString(PyExc_NotImplementedError, "__del__"); return -1; } } static PyMethodDef __pyx_methods_11pygame_sdl2_4rect_Rect[] = { {"__reduce__", (PyCFunction)__pyx_pw_11pygame_sdl2_4rect_4Rect_3__reduce__, METH_NOARGS, 0}, {"copy", (PyCFunction)__pyx_pw_11pygame_sdl2_4rect_4Rect_17copy, METH_NOARGS, 0}, {"move", (PyCFunction)__pyx_pw_11pygame_sdl2_4rect_4Rect_19move, METH_VARARGS|METH_KEYWORDS, 0}, {"move_ip", (PyCFunction)__pyx_pw_11pygame_sdl2_4rect_4Rect_21move_ip, METH_VARARGS|METH_KEYWORDS, 0}, {"inflate", (PyCFunction)__pyx_pw_11pygame_sdl2_4rect_4Rect_23inflate, METH_VARARGS|METH_KEYWORDS, 0}, {"inflate_ip", (PyCFunction)__pyx_pw_11pygame_sdl2_4rect_4Rect_25inflate_ip, METH_VARARGS|METH_KEYWORDS, 0}, {"clamp", (PyCFunction)__pyx_pw_11pygame_sdl2_4rect_4Rect_27clamp, METH_O, 0}, {"clamp_ip", (PyCFunction)__pyx_pw_11pygame_sdl2_4rect_4Rect_29clamp_ip, METH_O, 0}, {"clip", (PyCFunction)__pyx_pw_11pygame_sdl2_4rect_4Rect_31clip, METH_VARARGS|METH_KEYWORDS, 0}, {"union", (PyCFunction)__pyx_pw_11pygame_sdl2_4rect_4Rect_33union, METH_O, 0}, {"union_ip", (PyCFunction)__pyx_pw_11pygame_sdl2_4rect_4Rect_35union_ip, METH_O, 0}, {"unionall", (PyCFunction)__pyx_pw_11pygame_sdl2_4rect_4Rect_37unionall, METH_O, 0}, {"unionall_ip", (PyCFunction)__pyx_pw_11pygame_sdl2_4rect_4Rect_39unionall_ip, METH_O, 0}, {"fit", (PyCFunction)__pyx_pw_11pygame_sdl2_4rect_4Rect_41fit, METH_O, 0}, {"normalize", (PyCFunction)__pyx_pw_11pygame_sdl2_4rect_4Rect_43normalize, METH_NOARGS, 0}, {"contains", (PyCFunction)__pyx_pw_11pygame_sdl2_4rect_4Rect_45contains, METH_O, 0}, {"collidepoint", (PyCFunction)__pyx_pw_11pygame_sdl2_4rect_4Rect_47collidepoint, METH_VARARGS|METH_KEYWORDS, 0}, {"colliderect", (PyCFunction)__pyx_pw_11pygame_sdl2_4rect_4Rect_49colliderect, METH_O, 0}, {"collidelist", (PyCFunction)__pyx_pw_11pygame_sdl2_4rect_4Rect_51collidelist, METH_O, 0}, {"collidelistall", (PyCFunction)__pyx_pw_11pygame_sdl2_4rect_4Rect_53collidelistall, METH_O, 0}, {"collidedict", (PyCFunction)__pyx_pw_11pygame_sdl2_4rect_4Rect_55collidedict, METH_VARARGS|METH_KEYWORDS, 0}, {"collidedictall", (PyCFunction)__pyx_pw_11pygame_sdl2_4rect_4Rect_57collidedictall, METH_VARARGS|METH_KEYWORDS, 0}, {0, 0, 0, 0} }; static struct PyGetSetDef __pyx_getsets_11pygame_sdl2_4rect_Rect[] = { {(char *)"left", __pyx_getprop_11pygame_sdl2_4rect_4Rect_left, __pyx_setprop_11pygame_sdl2_4rect_4Rect_left, 0, 0}, {(char *)"top", __pyx_getprop_11pygame_sdl2_4rect_4Rect_top, __pyx_setprop_11pygame_sdl2_4rect_4Rect_top, 0, 0}, {(char *)"width", __pyx_getprop_11pygame_sdl2_4rect_4Rect_width, __pyx_setprop_11pygame_sdl2_4rect_4Rect_width, 0, 0}, {(char *)"height", __pyx_getprop_11pygame_sdl2_4rect_4Rect_height, __pyx_setprop_11pygame_sdl2_4rect_4Rect_height, 0, 0}, {(char *)"right", __pyx_getprop_11pygame_sdl2_4rect_4Rect_right, __pyx_setprop_11pygame_sdl2_4rect_4Rect_right, 0, 0}, {(char *)"bottom", __pyx_getprop_11pygame_sdl2_4rect_4Rect_bottom, __pyx_setprop_11pygame_sdl2_4rect_4Rect_bottom, 0, 0}, {(char *)"size", __pyx_getprop_11pygame_sdl2_4rect_4Rect_size, __pyx_setprop_11pygame_sdl2_4rect_4Rect_size, 0, 0}, {(char *)"topleft", __pyx_getprop_11pygame_sdl2_4rect_4Rect_topleft, __pyx_setprop_11pygame_sdl2_4rect_4Rect_topleft, 0, 0}, {(char *)"topright", __pyx_getprop_11pygame_sdl2_4rect_4Rect_topright, __pyx_setprop_11pygame_sdl2_4rect_4Rect_topright, 0, 0}, {(char *)"bottomright", __pyx_getprop_11pygame_sdl2_4rect_4Rect_bottomright, __pyx_setprop_11pygame_sdl2_4rect_4Rect_bottomright, 0, 0}, {(char *)"bottomleft", __pyx_getprop_11pygame_sdl2_4rect_4Rect_bottomleft, __pyx_setprop_11pygame_sdl2_4rect_4Rect_bottomleft, 0, 0}, {(char *)"centerx", __pyx_getprop_11pygame_sdl2_4rect_4Rect_centerx, __pyx_setprop_11pygame_sdl2_4rect_4Rect_centerx, 0, 0}, {(char *)"centery", __pyx_getprop_11pygame_sdl2_4rect_4Rect_centery, __pyx_setprop_11pygame_sdl2_4rect_4Rect_centery, 0, 0}, {(char *)"center", __pyx_getprop_11pygame_sdl2_4rect_4Rect_center, __pyx_setprop_11pygame_sdl2_4rect_4Rect_center, 0, 0}, {(char *)"midtop", __pyx_getprop_11pygame_sdl2_4rect_4Rect_midtop, __pyx_setprop_11pygame_sdl2_4rect_4Rect_midtop, 0, 0}, {(char *)"midleft", __pyx_getprop_11pygame_sdl2_4rect_4Rect_midleft, __pyx_setprop_11pygame_sdl2_4rect_4Rect_midleft, 0, 0}, {(char *)"midbottom", __pyx_getprop_11pygame_sdl2_4rect_4Rect_midbottom, __pyx_setprop_11pygame_sdl2_4rect_4Rect_midbottom, 0, 0}, {(char *)"midright", __pyx_getprop_11pygame_sdl2_4rect_4Rect_midright, __pyx_setprop_11pygame_sdl2_4rect_4Rect_midright, 0, 0}, {(char *)"x", __pyx_getprop_11pygame_sdl2_4rect_4Rect_x, __pyx_setprop_11pygame_sdl2_4rect_4Rect_x, 0, 0}, {(char *)"y", __pyx_getprop_11pygame_sdl2_4rect_4Rect_y, __pyx_setprop_11pygame_sdl2_4rect_4Rect_y, 0, 0}, {(char *)"w", __pyx_getprop_11pygame_sdl2_4rect_4Rect_w, __pyx_setprop_11pygame_sdl2_4rect_4Rect_w, 0, 0}, {(char *)"h", __pyx_getprop_11pygame_sdl2_4rect_4Rect_h, __pyx_setprop_11pygame_sdl2_4rect_4Rect_h, 0, 0}, {0, 0, 0, 0, 0} }; static PySequenceMethods __pyx_tp_as_sequence_Rect = { __pyx_pw_11pygame_sdl2_4rect_4Rect_7__len__, /*sq_length*/ 0, /*sq_concat*/ 0, /*sq_repeat*/ __pyx_sq_item_11pygame_sdl2_4rect_Rect, /*sq_item*/ 0, /*sq_slice*/ 0, /*sq_ass_item*/ 0, /*sq_ass_slice*/ 0, /*sq_contains*/ 0, /*sq_inplace_concat*/ 0, /*sq_inplace_repeat*/ }; static PyMappingMethods __pyx_tp_as_mapping_Rect = { __pyx_pw_11pygame_sdl2_4rect_4Rect_7__len__, /*mp_length*/ __pyx_pw_11pygame_sdl2_4rect_4Rect_13__getitem__, /*mp_subscript*/ __pyx_mp_ass_subscript_11pygame_sdl2_4rect_Rect, /*mp_ass_subscript*/ }; static PyTypeObject __pyx_type_11pygame_sdl2_4rect_Rect = { PyVarObject_HEAD_INIT(0, 0) "pygame_sdl2.rect.Rect", /*tp_name*/ sizeof(struct __pyx_obj_11pygame_sdl2_4rect_Rect), /*tp_basicsize*/ 0, /*tp_itemsize*/ __pyx_tp_dealloc_11pygame_sdl2_4rect_Rect, /*tp_dealloc*/ 0, /*tp_print*/ 0, /*tp_getattr*/ 0, /*tp_setattr*/ #if PY_MAJOR_VERSION < 3 0, /*tp_compare*/ #endif #if PY_MAJOR_VERSION >= 3 0, /*tp_as_async*/ #endif __pyx_pw_11pygame_sdl2_4rect_4Rect_5__repr__, /*tp_repr*/ 0, /*tp_as_number*/ &__pyx_tp_as_sequence_Rect, /*tp_as_sequence*/ &__pyx_tp_as_mapping_Rect, /*tp_as_mapping*/ 0, /*tp_hash*/ 0, /*tp_call*/ 0, /*tp_str*/ 0, /*tp_getattro*/ 0, /*tp_setattro*/ 0, /*tp_as_buffer*/ Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE, /*tp_flags*/ 0, /*tp_doc*/ 0, /*tp_traverse*/ 0, /*tp_clear*/ __pyx_pw_11pygame_sdl2_4rect_4Rect_11__richcmp__, /*tp_richcompare*/ 0, /*tp_weaklistoffset*/ __pyx_pw_11pygame_sdl2_4rect_4Rect_9__iter__, /*tp_iter*/ 0, /*tp_iternext*/ __pyx_methods_11pygame_sdl2_4rect_Rect, /*tp_methods*/ 0, /*tp_members*/ __pyx_getsets_11pygame_sdl2_4rect_Rect, /*tp_getset*/ 0, /*tp_base*/ 0, /*tp_dict*/ 0, /*tp_descr_get*/ 0, /*tp_descr_set*/ 0, /*tp_dictoffset*/ __pyx_pw_11pygame_sdl2_4rect_4Rect_1__init__, /*tp_init*/ 0, /*tp_alloc*/ __pyx_tp_new_11pygame_sdl2_4rect_Rect, /*tp_new*/ 0, /*tp_free*/ 0, /*tp_is_gc*/ 0, /*tp_bases*/ 0, /*tp_mro*/ 0, /*tp_cache*/ 0, /*tp_subclasses*/ 0, /*tp_weaklist*/ 0, /*tp_del*/ 0, /*tp_version_tag*/ #if PY_VERSION_HEX >= 0x030400a1 0, /*tp_finalize*/ #endif }; static PyMethodDef __pyx_methods[] = { {0, 0, 0, 0} }; #if PY_MAJOR_VERSION >= 3 static struct PyModuleDef __pyx_moduledef = { #if PY_VERSION_HEX < 0x03020000 { PyObject_HEAD_INIT(NULL) NULL, 0, NULL }, #else PyModuleDef_HEAD_INIT, #endif "rect", 0, /* m_doc */ -1, /* m_size */ __pyx_methods /* m_methods */, NULL, /* m_reload */ NULL, /* m_traverse */ NULL, /* m_clear */ NULL /* m_free */ }; #endif static __Pyx_StringTabEntry __pyx_string_tab[] = { {&__pyx_kp_s_Argument_must_be_a_rect_style_ob, __pyx_k_Argument_must_be_a_rect_style_ob, sizeof(__pyx_k_Argument_must_be_a_rect_style_ob), 0, 0, 1, 0}, {&__pyx_kp_s_Argument_must_be_a_rect_style_ob_2, __pyx_k_Argument_must_be_a_rect_style_ob_2, sizeof(__pyx_k_Argument_must_be_a_rect_style_ob_2), 0, 0, 1, 0}, {&__pyx_n_s_IndexError, __pyx_k_IndexError, sizeof(__pyx_k_IndexError), 0, 0, 1, 1}, {&__pyx_n_s_TypeError, __pyx_k_TypeError, sizeof(__pyx_k_TypeError), 0, 0, 1, 1}, {&__pyx_n_s_args, __pyx_k_args, sizeof(__pyx_k_args), 0, 0, 1, 1}, {&__pyx_n_s_bottom, __pyx_k_bottom, sizeof(__pyx_k_bottom), 0, 0, 1, 1}, {&__pyx_n_s_center, __pyx_k_center, sizeof(__pyx_k_center), 0, 0, 1, 1}, {&__pyx_n_s_centerx, __pyx_k_centerx, sizeof(__pyx_k_centerx), 0, 0, 1, 1}, {&__pyx_n_s_centery, __pyx_k_centery, sizeof(__pyx_k_centery), 0, 0, 1, 1}, {&__pyx_n_s_clamp_ip, __pyx_k_clamp_ip, sizeof(__pyx_k_clamp_ip), 0, 0, 1, 1}, {&__pyx_n_s_collections, __pyx_k_collections, sizeof(__pyx_k_collections), 0, 0, 1, 1}, {&__pyx_n_s_colliderect, __pyx_k_colliderect, sizeof(__pyx_k_colliderect), 0, 0, 1, 1}, {&__pyx_n_s_copy, __pyx_k_copy, sizeof(__pyx_k_copy), 0, 0, 1, 1}, {&__pyx_n_s_flatten, __pyx_k_flatten, sizeof(__pyx_k_flatten), 0, 0, 1, 1}, {&__pyx_n_s_format, __pyx_k_format, sizeof(__pyx_k_format), 0, 0, 1, 1}, {&__pyx_n_s_h, __pyx_k_h, sizeof(__pyx_k_h), 0, 0, 1, 1}, {&__pyx_n_s_height, __pyx_k_height, sizeof(__pyx_k_height), 0, 0, 1, 1}, {&__pyx_kp_s_home_tom_ab_pygame_sdl2_src_pyg, __pyx_k_home_tom_ab_pygame_sdl2_src_pyg, sizeof(__pyx_k_home_tom_ab_pygame_sdl2_src_pyg), 0, 0, 1, 0}, {&__pyx_n_s_import, __pyx_k_import, sizeof(__pyx_k_import), 0, 0, 1, 1}, {&__pyx_n_s_inflate_ip, __pyx_k_inflate_ip, sizeof(__pyx_k_inflate_ip), 0, 0, 1, 1}, {&__pyx_n_s_iteritems, __pyx_k_iteritems, sizeof(__pyx_k_iteritems), 0, 0, 1, 1}, {&__pyx_n_s_left, __pyx_k_left, sizeof(__pyx_k_left), 0, 0, 1, 1}, {&__pyx_n_s_main, __pyx_k_main, sizeof(__pyx_k_main), 0, 0, 1, 1}, {&__pyx_n_s_move_ip, __pyx_k_move_ip, sizeof(__pyx_k_move_ip), 0, 0, 1, 1}, {&__pyx_n_s_other, __pyx_k_other, sizeof(__pyx_k_other), 0, 0, 1, 1}, {&__pyx_n_s_other_dict, __pyx_k_other_dict, sizeof(__pyx_k_other_dict), 0, 0, 1, 1}, {&__pyx_n_s_pygame_sdl2_rect, __pyx_k_pygame_sdl2_rect, sizeof(__pyx_k_pygame_sdl2_rect), 0, 0, 1, 1}, {&__pyx_n_s_range, __pyx_k_range, sizeof(__pyx_k_range), 0, 0, 1, 1}, {&__pyx_kp_s_rect_d_d_d_d, __pyx_k_rect_d_d_d_d, sizeof(__pyx_k_rect_d_d_d_d), 0, 0, 1, 0}, {&__pyx_n_s_rects_values, __pyx_k_rects_values, sizeof(__pyx_k_rects_values), 0, 0, 1, 1}, {&__pyx_n_s_right, __pyx_k_right, sizeof(__pyx_k_right), 0, 0, 1, 1}, {&__pyx_n_s_test, __pyx_k_test, sizeof(__pyx_k_test), 0, 0, 1, 1}, {&__pyx_n_s_top, __pyx_k_top, sizeof(__pyx_k_top), 0, 0, 1, 1}, {&__pyx_n_s_topleft, __pyx_k_topleft, sizeof(__pyx_k_topleft), 0, 0, 1, 1}, {&__pyx_n_s_union_ip, __pyx_k_union_ip, sizeof(__pyx_k_union_ip), 0, 0, 1, 1}, {&__pyx_n_s_unionall_ip, __pyx_k_unionall_ip, sizeof(__pyx_k_unionall_ip), 0, 0, 1, 1}, {&__pyx_n_s_w, __pyx_k_w, sizeof(__pyx_k_w), 0, 0, 1, 1}, {&__pyx_n_s_width, __pyx_k_width, sizeof(__pyx_k_width), 0, 0, 1, 1}, {&__pyx_n_s_x, __pyx_k_x, sizeof(__pyx_k_x), 0, 0, 1, 1}, {&__pyx_n_s_y, __pyx_k_y, sizeof(__pyx_k_y), 0, 0, 1, 1}, {&__pyx_n_s_zip, __pyx_k_zip, sizeof(__pyx_k_zip), 0, 0, 1, 1}, {0, 0, 0, 0, 0, 0, 0} }; static int __Pyx_InitCachedBuiltins(void) { __pyx_builtin_TypeError = __Pyx_GetBuiltinName(__pyx_n_s_TypeError); if (!__pyx_builtin_TypeError) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 61; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_builtin_IndexError = __Pyx_GetBuiltinName(__pyx_n_s_IndexError); if (!__pyx_builtin_IndexError) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 99; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_builtin_zip = __Pyx_GetBuiltinName(__pyx_n_s_zip); if (!__pyx_builtin_zip) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 354; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_builtin_range = __Pyx_GetBuiltinName(__pyx_n_s_range); if (!__pyx_builtin_range) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 354; __pyx_clineno = __LINE__; goto __pyx_L1_error;} return 0; __pyx_L1_error:; return -1; } static int __Pyx_InitCachedConstants(void) { __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__Pyx_InitCachedConstants", 0); /* "pygame_sdl2/rect.pyx":61 * * else: * raise TypeError("Argument must be a rect style object.") # <<<<<<<<<<<<<< * * self.x = x */ __pyx_tuple_ = PyTuple_Pack(1, __pyx_kp_s_Argument_must_be_a_rect_style_ob); if (unlikely(!__pyx_tuple_)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 61; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_tuple_); __Pyx_GIVEREF(__pyx_tuple_); /* "pygame_sdl2/rect.pyx":263 * * if not self.colliderect(other): * return Rect(0,0,0,0) # <<<<<<<<<<<<<< * * r = self.copy() */ __pyx_tuple__2 = PyTuple_Pack(4, __pyx_int_0, __pyx_int_0, __pyx_int_0, __pyx_int_0); if (unlikely(!__pyx_tuple__2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 263; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_tuple__2); __Pyx_GIVEREF(__pyx_tuple__2); /* "pygame_sdl2/rect.pyx":417 * raise TypeError("Argument {} must be a rect style object.".format(argname)) * else: * raise TypeError("Argument must be a rect style object.") # <<<<<<<<<<<<<< */ __pyx_tuple__3 = PyTuple_Pack(1, __pyx_kp_s_Argument_must_be_a_rect_style_ob); if (unlikely(!__pyx_tuple__3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 417; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_tuple__3); __Pyx_GIVEREF(__pyx_tuple__3); /* "pygame_sdl2/rect.pyx":22 * import collections * * def flatten(*args): # <<<<<<<<<<<<<< * if len(args) == 1: * return args[0] */ __pyx_tuple__4 = PyTuple_Pack(1, __pyx_n_s_args); if (unlikely(!__pyx_tuple__4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 22; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_tuple__4); __Pyx_GIVEREF(__pyx_tuple__4); __pyx_codeobj__5 = (PyObject*)__Pyx_PyCode_New(0, 0, 1, 0, CO_VARARGS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__4, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_tom_ab_pygame_sdl2_src_pyg, __pyx_n_s_flatten, 22, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 22; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_RefNannyFinishContext(); return 0; __pyx_L1_error:; __Pyx_RefNannyFinishContext(); return -1; } static int __Pyx_InitGlobals(void) { if (__Pyx_InitStrings(__pyx_string_tab) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; __pyx_int_0 = PyInt_FromLong(0); if (unlikely(!__pyx_int_0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_int_1 = PyInt_FromLong(1); if (unlikely(!__pyx_int_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_int_2 = PyInt_FromLong(2); if (unlikely(!__pyx_int_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_int_3 = PyInt_FromLong(3); if (unlikely(!__pyx_int_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_int_neg_1 = PyInt_FromLong(-1); if (unlikely(!__pyx_int_neg_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} return 0; __pyx_L1_error:; return -1; } #if PY_MAJOR_VERSION < 3 PyMODINIT_FUNC initrect(void); /*proto*/ PyMODINIT_FUNC initrect(void) #else PyMODINIT_FUNC PyInit_rect(void); /*proto*/ PyMODINIT_FUNC PyInit_rect(void) #endif { PyObject *__pyx_t_1 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannyDeclarations #if CYTHON_REFNANNY __Pyx_RefNanny = __Pyx_RefNannyImportAPI("refnanny"); if (!__Pyx_RefNanny) { PyErr_Clear(); __Pyx_RefNanny = __Pyx_RefNannyImportAPI("Cython.Runtime.refnanny"); if (!__Pyx_RefNanny) Py_FatalError("failed to import 'refnanny' module"); } #endif __Pyx_RefNannySetupContext("PyMODINIT_FUNC PyInit_rect(void)", 0); if (__Pyx_check_binary_version() < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_empty_tuple = PyTuple_New(0); if (unlikely(!__pyx_empty_tuple)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_empty_bytes = PyBytes_FromStringAndSize("", 0); if (unlikely(!__pyx_empty_bytes)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} #ifdef __Pyx_CyFunction_USED if (__pyx_CyFunction_init() < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} #endif #ifdef __Pyx_FusedFunction_USED if (__pyx_FusedFunction_init() < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} #endif #ifdef __Pyx_Coroutine_USED if (__pyx_Coroutine_init() < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} #endif #ifdef __Pyx_Generator_USED if (__pyx_Generator_init() < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} #endif #ifdef __Pyx_StopAsyncIteration_USED if (__pyx_StopAsyncIteration_init() < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} #endif /*--- Library function declarations ---*/ /*--- Threads initialization code ---*/ #if defined(__PYX_FORCE_INIT_THREADS) && __PYX_FORCE_INIT_THREADS #ifdef WITH_THREAD /* Python build with threading support? */ PyEval_InitThreads(); #endif #endif /*--- Module creation code ---*/ #if PY_MAJOR_VERSION < 3 __pyx_m = Py_InitModule4("rect", __pyx_methods, 0, 0, PYTHON_API_VERSION); Py_XINCREF(__pyx_m); #else __pyx_m = PyModule_Create(&__pyx_moduledef); #endif if (unlikely(!__pyx_m)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_d = PyModule_GetDict(__pyx_m); if (unlikely(!__pyx_d)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} Py_INCREF(__pyx_d); __pyx_b = PyImport_AddModule(__Pyx_BUILTIN_MODULE_NAME); if (unlikely(!__pyx_b)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} #if CYTHON_COMPILING_IN_PYPY Py_INCREF(__pyx_b); #endif if (PyObject_SetAttrString(__pyx_m, "__builtins__", __pyx_b) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; /*--- Initialize various global constants etc. ---*/ if (__Pyx_InitGlobals() < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} #if PY_MAJOR_VERSION < 3 && (__PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT) if (__Pyx_init_sys_getdefaultencoding_params() < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} #endif if (__pyx_module_is_main_pygame_sdl2__rect) { if (PyObject_SetAttrString(__pyx_m, "__name__", __pyx_n_s_main) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } #if PY_MAJOR_VERSION >= 3 { PyObject *modules = PyImport_GetModuleDict(); if (unlikely(!modules)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} if (!PyDict_GetItemString(modules, "pygame_sdl2.rect")) { if (unlikely(PyDict_SetItemString(modules, "pygame_sdl2.rect", __pyx_m) < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } } #endif /*--- Builtin init code ---*/ if (__Pyx_InitCachedBuiltins() < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /*--- Constants init code ---*/ if (__Pyx_InitCachedConstants() < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /*--- Global init code ---*/ /*--- Variable export code ---*/ /*--- Function export code ---*/ if (__Pyx_ExportFunction("to_sdl_rect", (void (*)(void))__pyx_f_11pygame_sdl2_4rect_to_sdl_rect, "int (PyObject *, SDL_Rect *, struct __pyx_opt_args_11pygame_sdl2_4rect_to_sdl_rect *__pyx_optional_args)") < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /*--- Type init code ---*/ if (PyType_Ready(&__pyx_type_11pygame_sdl2_4rect_Rect) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 28; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_type_11pygame_sdl2_4rect_Rect.tp_print = 0; if (PyObject_SetAttrString(__pyx_m, "Rect", (PyObject *)&__pyx_type_11pygame_sdl2_4rect_Rect) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 28; __pyx_clineno = __LINE__; goto __pyx_L1_error;} if (__pyx_type_11pygame_sdl2_4rect_Rect.tp_weaklistoffset == 0) __pyx_type_11pygame_sdl2_4rect_Rect.tp_weaklistoffset = offsetof(struct __pyx_obj_11pygame_sdl2_4rect_Rect, __weakref__); __pyx_ptype_11pygame_sdl2_4rect_Rect = &__pyx_type_11pygame_sdl2_4rect_Rect; /*--- Type import code ---*/ /*--- Variable import code ---*/ /*--- Function import code ---*/ /*--- Execution code ---*/ #if defined(__Pyx_Generator_USED) || defined(__Pyx_Coroutine_USED) if (__Pyx_patch_abc() < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} #endif /* "pygame_sdl2/rect.pyx":20 * # 3. This notice may not be removed or altered from any source distribution. * * import collections # <<<<<<<<<<<<<< * * def flatten(*args): */ __pyx_t_1 = __Pyx_Import(__pyx_n_s_collections, 0, -1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 20; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); if (PyDict_SetItem(__pyx_d, __pyx_n_s_collections, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 20; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "pygame_sdl2/rect.pyx":22 * import collections * * def flatten(*args): # <<<<<<<<<<<<<< * if len(args) == 1: * return args[0] */ __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_11pygame_sdl2_4rect_1flatten, NULL, __pyx_n_s_pygame_sdl2_rect); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 22; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); if (PyDict_SetItem(__pyx_d, __pyx_n_s_flatten, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 22; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "pygame_sdl2/rect.pyx":1 * # Copyright 2014 Tom Rothamel # <<<<<<<<<<<<<< * # Copyright 2014 Patrick Dawson * # */ __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); if (PyDict_SetItem(__pyx_d, __pyx_n_s_test, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /*--- Wrapped vars code ---*/ goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); if (__pyx_m) { if (__pyx_d) { __Pyx_AddTraceback("init pygame_sdl2.rect", __pyx_clineno, __pyx_lineno, __pyx_filename); } Py_DECREF(__pyx_m); __pyx_m = 0; } else if (!PyErr_Occurred()) { PyErr_SetString(PyExc_ImportError, "init pygame_sdl2.rect"); } __pyx_L0:; __Pyx_RefNannyFinishContext(); #if PY_MAJOR_VERSION < 3 return; #else return __pyx_m; #endif } /* --- Runtime support code --- */ #if CYTHON_REFNANNY static __Pyx_RefNannyAPIStruct *__Pyx_RefNannyImportAPI(const char *modname) { PyObject *m = NULL, *p = NULL; void *r = NULL; m = PyImport_ImportModule((char *)modname); if (!m) goto end; p = PyObject_GetAttrString(m, (char *)"RefNannyAPI"); if (!p) goto end; r = PyLong_AsVoidPtr(p); end: Py_XDECREF(p); Py_XDECREF(m); return (__Pyx_RefNannyAPIStruct *)r; } #endif static PyObject *__Pyx_GetBuiltinName(PyObject *name) { PyObject* result = __Pyx_PyObject_GetAttrStr(__pyx_b, name); if (unlikely(!result)) { PyErr_Format(PyExc_NameError, #if PY_MAJOR_VERSION >= 3 "name '%U' is not defined", name); #else "name '%.200s' is not defined", PyString_AS_STRING(name)); #endif } return result; } static CYTHON_INLINE int __Pyx_CheckKeywordStrings( PyObject *kwdict, const char* function_name, int kw_allowed) { PyObject* key = 0; Py_ssize_t pos = 0; #if CYTHON_COMPILING_IN_PYPY if (!kw_allowed && PyDict_Next(kwdict, &pos, &key, 0)) goto invalid_keyword; return 1; #else while (PyDict_Next(kwdict, &pos, &key, 0)) { #if PY_MAJOR_VERSION < 3 if (unlikely(!PyString_CheckExact(key)) && unlikely(!PyString_Check(key))) #endif if (unlikely(!PyUnicode_Check(key))) goto invalid_keyword_type; } if ((!kw_allowed) && unlikely(key)) goto invalid_keyword; return 1; invalid_keyword_type: PyErr_Format(PyExc_TypeError, "%.200s() keywords must be strings", function_name); return 0; #endif invalid_keyword: PyErr_Format(PyExc_TypeError, #if PY_MAJOR_VERSION < 3 "%.200s() got an unexpected keyword argument '%.200s'", function_name, PyString_AsString(key)); #else "%s() got an unexpected keyword argument '%U'", function_name, key); #endif return 0; } static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Generic(PyObject *o, PyObject* j) { PyObject *r; if (!j) return NULL; r = PyObject_GetItem(o, j); Py_DECREF(j); return r; } static CYTHON_INLINE PyObject *__Pyx_GetItemInt_List_Fast(PyObject *o, Py_ssize_t i, CYTHON_NCP_UNUSED int wraparound, CYTHON_NCP_UNUSED int boundscheck) { #if CYTHON_COMPILING_IN_CPYTHON if (wraparound & unlikely(i < 0)) i += PyList_GET_SIZE(o); if ((!boundscheck) || likely((0 <= i) & (i < PyList_GET_SIZE(o)))) { PyObject *r = PyList_GET_ITEM(o, i); Py_INCREF(r); return r; } return __Pyx_GetItemInt_Generic(o, PyInt_FromSsize_t(i)); #else return PySequence_GetItem(o, i); #endif } static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Tuple_Fast(PyObject *o, Py_ssize_t i, CYTHON_NCP_UNUSED int wraparound, CYTHON_NCP_UNUSED int boundscheck) { #if CYTHON_COMPILING_IN_CPYTHON if (wraparound & unlikely(i < 0)) i += PyTuple_GET_SIZE(o); if ((!boundscheck) || likely((0 <= i) & (i < PyTuple_GET_SIZE(o)))) { PyObject *r = PyTuple_GET_ITEM(o, i); Py_INCREF(r); return r; } return __Pyx_GetItemInt_Generic(o, PyInt_FromSsize_t(i)); #else return PySequence_GetItem(o, i); #endif } static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Fast(PyObject *o, Py_ssize_t i, int is_list, CYTHON_NCP_UNUSED int wraparound, CYTHON_NCP_UNUSED int boundscheck) { #if CYTHON_COMPILING_IN_CPYTHON if (is_list || PyList_CheckExact(o)) { Py_ssize_t n = ((!wraparound) | likely(i >= 0)) ? i : i + PyList_GET_SIZE(o); if ((!boundscheck) || (likely((n >= 0) & (n < PyList_GET_SIZE(o))))) { PyObject *r = PyList_GET_ITEM(o, n); Py_INCREF(r); return r; } } else if (PyTuple_CheckExact(o)) { Py_ssize_t n = ((!wraparound) | likely(i >= 0)) ? i : i + PyTuple_GET_SIZE(o); if ((!boundscheck) || likely((n >= 0) & (n < PyTuple_GET_SIZE(o)))) { PyObject *r = PyTuple_GET_ITEM(o, n); Py_INCREF(r); return r; } } else { PySequenceMethods *m = Py_TYPE(o)->tp_as_sequence; if (likely(m && m->sq_item)) { if (wraparound && unlikely(i < 0) && likely(m->sq_length)) { Py_ssize_t l = m->sq_length(o); if (likely(l >= 0)) { i += l; } else { if (PyErr_ExceptionMatches(PyExc_OverflowError)) PyErr_Clear(); else return NULL; } } return m->sq_item(o, i); } } #else if (is_list || PySequence_Check(o)) { return PySequence_GetItem(o, i); } #endif return __Pyx_GetItemInt_Generic(o, PyInt_FromSsize_t(i)); } static CYTHON_INLINE int __Pyx_TypeTest(PyObject *obj, PyTypeObject *type) { if (unlikely(!type)) { PyErr_SetString(PyExc_SystemError, "Missing type object"); return 0; } if (likely(PyObject_TypeCheck(obj, type))) return 1; PyErr_Format(PyExc_TypeError, "Cannot convert %.200s to %.200s", Py_TYPE(obj)->tp_name, type->tp_name); return 0; } static CYTHON_INLINE void __Pyx_RaiseTooManyValuesError(Py_ssize_t expected) { PyErr_Format(PyExc_ValueError, "too many values to unpack (expected %" CYTHON_FORMAT_SSIZE_T "d)", expected); } static CYTHON_INLINE void __Pyx_RaiseNeedMoreValuesError(Py_ssize_t index) { PyErr_Format(PyExc_ValueError, "need more than %" CYTHON_FORMAT_SSIZE_T "d value%.1s to unpack", index, (index == 1) ? "" : "s"); } static CYTHON_INLINE int __Pyx_IterFinish(void) { #if CYTHON_COMPILING_IN_CPYTHON PyThreadState *tstate = PyThreadState_GET(); PyObject* exc_type = tstate->curexc_type; if (unlikely(exc_type)) { if (likely(exc_type == PyExc_StopIteration) || PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration)) { PyObject *exc_value, *exc_tb; exc_value = tstate->curexc_value; exc_tb = tstate->curexc_traceback; tstate->curexc_type = 0; tstate->curexc_value = 0; tstate->curexc_traceback = 0; Py_DECREF(exc_type); Py_XDECREF(exc_value); Py_XDECREF(exc_tb); return 0; } else { return -1; } } return 0; #else if (unlikely(PyErr_Occurred())) { if (likely(PyErr_ExceptionMatches(PyExc_StopIteration))) { PyErr_Clear(); return 0; } else { return -1; } } return 0; #endif } static int __Pyx_IternextUnpackEndCheck(PyObject *retval, Py_ssize_t expected) { if (unlikely(retval)) { Py_DECREF(retval); __Pyx_RaiseTooManyValuesError(expected); return -1; } else { return __Pyx_IterFinish(); } return 0; } #if CYTHON_COMPILING_IN_CPYTHON static CYTHON_INLINE PyObject* __Pyx_PyObject_Call(PyObject *func, PyObject *arg, PyObject *kw) { PyObject *result; ternaryfunc call = func->ob_type->tp_call; if (unlikely(!call)) return PyObject_Call(func, arg, kw); if (unlikely(Py_EnterRecursiveCall((char*)" while calling a Python object"))) return NULL; result = (*call)(func, arg, kw); Py_LeaveRecursiveCall(); if (unlikely(!result) && unlikely(!PyErr_Occurred())) { PyErr_SetString( PyExc_SystemError, "NULL result without error in PyObject_Call"); } return result; } #endif static CYTHON_INLINE void __Pyx_ErrRestore(PyObject *type, PyObject *value, PyObject *tb) { #if CYTHON_COMPILING_IN_CPYTHON PyObject *tmp_type, *tmp_value, *tmp_tb; PyThreadState *tstate = PyThreadState_GET(); tmp_type = tstate->curexc_type; tmp_value = tstate->curexc_value; tmp_tb = tstate->curexc_traceback; tstate->curexc_type = type; tstate->curexc_value = value; tstate->curexc_traceback = tb; Py_XDECREF(tmp_type); Py_XDECREF(tmp_value); Py_XDECREF(tmp_tb); #else PyErr_Restore(type, value, tb); #endif } static CYTHON_INLINE void __Pyx_ErrFetch(PyObject **type, PyObject **value, PyObject **tb) { #if CYTHON_COMPILING_IN_CPYTHON PyThreadState *tstate = PyThreadState_GET(); *type = tstate->curexc_type; *value = tstate->curexc_value; *tb = tstate->curexc_traceback; tstate->curexc_type = 0; tstate->curexc_value = 0; tstate->curexc_traceback = 0; #else PyErr_Fetch(type, value, tb); #endif } #if PY_MAJOR_VERSION < 3 static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, CYTHON_UNUSED PyObject *cause) { Py_XINCREF(type); if (!value || value == Py_None) value = NULL; else Py_INCREF(value); if (!tb || tb == Py_None) tb = NULL; else { Py_INCREF(tb); if (!PyTraceBack_Check(tb)) { PyErr_SetString(PyExc_TypeError, "raise: arg 3 must be a traceback or None"); goto raise_error; } } if (PyType_Check(type)) { #if CYTHON_COMPILING_IN_PYPY if (!value) { Py_INCREF(Py_None); value = Py_None; } #endif PyErr_NormalizeException(&type, &value, &tb); } else { if (value) { PyErr_SetString(PyExc_TypeError, "instance exception may not have a separate value"); goto raise_error; } value = type; type = (PyObject*) Py_TYPE(type); Py_INCREF(type); if (!PyType_IsSubtype((PyTypeObject *)type, (PyTypeObject *)PyExc_BaseException)) { PyErr_SetString(PyExc_TypeError, "raise: exception class must be a subclass of BaseException"); goto raise_error; } } __Pyx_ErrRestore(type, value, tb); return; raise_error: Py_XDECREF(value); Py_XDECREF(type); Py_XDECREF(tb); return; } #else static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, PyObject *cause) { PyObject* owned_instance = NULL; if (tb == Py_None) { tb = 0; } else if (tb && !PyTraceBack_Check(tb)) { PyErr_SetString(PyExc_TypeError, "raise: arg 3 must be a traceback or None"); goto bad; } if (value == Py_None) value = 0; if (PyExceptionInstance_Check(type)) { if (value) { PyErr_SetString(PyExc_TypeError, "instance exception may not have a separate value"); goto bad; } value = type; type = (PyObject*) Py_TYPE(value); } else if (PyExceptionClass_Check(type)) { PyObject *instance_class = NULL; if (value && PyExceptionInstance_Check(value)) { instance_class = (PyObject*) Py_TYPE(value); if (instance_class != type) { int is_subclass = PyObject_IsSubclass(instance_class, type); if (!is_subclass) { instance_class = NULL; } else if (unlikely(is_subclass == -1)) { goto bad; } else { type = instance_class; } } } if (!instance_class) { PyObject *args; if (!value) args = PyTuple_New(0); else if (PyTuple_Check(value)) { Py_INCREF(value); args = value; } else args = PyTuple_Pack(1, value); if (!args) goto bad; owned_instance = PyObject_Call(type, args, NULL); Py_DECREF(args); if (!owned_instance) goto bad; value = owned_instance; if (!PyExceptionInstance_Check(value)) { PyErr_Format(PyExc_TypeError, "calling %R should have returned an instance of " "BaseException, not %R", type, Py_TYPE(value)); goto bad; } } } else { PyErr_SetString(PyExc_TypeError, "raise: exception class must be a subclass of BaseException"); goto bad; } #if PY_VERSION_HEX >= 0x03030000 if (cause) { #else if (cause && cause != Py_None) { #endif PyObject *fixed_cause; if (cause == Py_None) { fixed_cause = NULL; } else if (PyExceptionClass_Check(cause)) { fixed_cause = PyObject_CallObject(cause, NULL); if (fixed_cause == NULL) goto bad; } else if (PyExceptionInstance_Check(cause)) { fixed_cause = cause; Py_INCREF(fixed_cause); } else { PyErr_SetString(PyExc_TypeError, "exception causes must derive from " "BaseException"); goto bad; } PyException_SetCause(value, fixed_cause); } PyErr_SetObject(type, value); if (tb) { #if CYTHON_COMPILING_IN_PYPY PyObject *tmp_type, *tmp_value, *tmp_tb; PyErr_Fetch(&tmp_type, &tmp_value, &tmp_tb); Py_INCREF(tb); PyErr_Restore(tmp_type, tmp_value, tb); Py_XDECREF(tmp_tb); #else PyThreadState *tstate = PyThreadState_GET(); PyObject* tmp_tb = tstate->curexc_traceback; if (tb != tmp_tb) { Py_INCREF(tb); tstate->curexc_traceback = tb; Py_XDECREF(tmp_tb); } #endif } bad: Py_XDECREF(owned_instance); return; } #endif static void __Pyx_RaiseArgumentTypeInvalid(const char* name, PyObject *obj, PyTypeObject *type) { PyErr_Format(PyExc_TypeError, "Argument '%.200s' has incorrect type (expected %.200s, got %.200s)", name, type->tp_name, Py_TYPE(obj)->tp_name); } static CYTHON_INLINE int __Pyx_ArgTypeTest(PyObject *obj, PyTypeObject *type, int none_allowed, const char *name, int exact) { if (unlikely(!type)) { PyErr_SetString(PyExc_SystemError, "Missing type object"); return 0; } if (none_allowed && obj == Py_None) return 1; else if (exact) { if (likely(Py_TYPE(obj) == type)) return 1; #if PY_MAJOR_VERSION == 2 else if ((type == &PyBaseString_Type) && likely(__Pyx_PyBaseString_CheckExact(obj))) return 1; #endif } else { if (likely(PyObject_TypeCheck(obj, type))) return 1; } __Pyx_RaiseArgumentTypeInvalid(name, obj, type); return 0; } #if CYTHON_USE_PYLONG_INTERNALS #include "longintrepr.h" #endif #if CYTHON_COMPILING_IN_CPYTHON static PyObject* __Pyx_PyInt_EqObjC(PyObject *op1, PyObject *op2, CYTHON_UNUSED long intval, CYTHON_UNUSED int inplace) { if (op1 == op2) { Py_RETURN_TRUE; } #if PY_MAJOR_VERSION < 3 if (likely(PyInt_CheckExact(op1))) { const long b = intval; long a = PyInt_AS_LONG(op1); if (a == b) { Py_RETURN_TRUE; } else { Py_RETURN_FALSE; } } #endif #if CYTHON_USE_PYLONG_INTERNALS && PY_MAJOR_VERSION >= 3 if (likely(PyLong_CheckExact(op1))) { const long b = intval; long a; const digit* digits = ((PyLongObject*)op1)->ob_digit; const Py_ssize_t size = Py_SIZE(op1); if (likely(__Pyx_sst_abs(size) <= 1)) { a = likely(size) ? digits[0] : 0; if (size == -1) a = -a; } else { switch (size) { case -2: if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) { a = -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])); break; } case 2: if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) { a = (long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])); break; } case -3: if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) { a = -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])); break; } case 3: if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) { a = (long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])); break; } case -4: if (8 * sizeof(long) - 1 > 4 * PyLong_SHIFT) { a = -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])); break; } case 4: if (8 * sizeof(long) - 1 > 4 * PyLong_SHIFT) { a = (long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])); break; } #if PyLong_SHIFT < 30 && PyLong_SHIFT != 15 default: return PyLong_Type.tp_richcompare(op1, op2, Py_EQ); #else default: Py_RETURN_FALSE; #endif } } if (a == b) { Py_RETURN_TRUE; } else { Py_RETURN_FALSE; } } #endif if (PyFloat_CheckExact(op1)) { const long b = intval; double a = PyFloat_AS_DOUBLE(op1); if ((double)a == (double)b) { Py_RETURN_TRUE; } else { Py_RETURN_FALSE; } } return PyObject_RichCompare(op1, op2, Py_EQ); } #endif static CYTHON_INLINE long __Pyx_div_long(long a, long b) { long q = a / b; long r = a - q*b; q -= ((r != 0) & ((r ^ b) < 0)); return q; } #if CYTHON_COMPILING_IN_CPYTHON static CYTHON_INLINE PyObject* __Pyx_PyObject_CallMethO(PyObject *func, PyObject *arg) { PyObject *self, *result; PyCFunction cfunc; cfunc = PyCFunction_GET_FUNCTION(func); self = PyCFunction_GET_SELF(func); if (unlikely(Py_EnterRecursiveCall((char*)" while calling a Python object"))) return NULL; result = cfunc(self, arg); Py_LeaveRecursiveCall(); if (unlikely(!result) && unlikely(!PyErr_Occurred())) { PyErr_SetString( PyExc_SystemError, "NULL result without error in PyObject_Call"); } return result; } #endif #if CYTHON_COMPILING_IN_CPYTHON static PyObject* __Pyx__PyObject_CallOneArg(PyObject *func, PyObject *arg) { PyObject *result; PyObject *args = PyTuple_New(1); if (unlikely(!args)) return NULL; Py_INCREF(arg); PyTuple_SET_ITEM(args, 0, arg); result = __Pyx_PyObject_Call(func, args, NULL); Py_DECREF(args); return result; } static CYTHON_INLINE PyObject* __Pyx_PyObject_CallOneArg(PyObject *func, PyObject *arg) { #ifdef __Pyx_CyFunction_USED if (likely(PyCFunction_Check(func) || PyObject_TypeCheck(func, __pyx_CyFunctionType))) { #else if (likely(PyCFunction_Check(func))) { #endif if (likely(PyCFunction_GET_FLAGS(func) & METH_O)) { return __Pyx_PyObject_CallMethO(func, arg); } } return __Pyx__PyObject_CallOneArg(func, arg); } #else static CYTHON_INLINE PyObject* __Pyx_PyObject_CallOneArg(PyObject *func, PyObject *arg) { PyObject *result; PyObject *args = PyTuple_Pack(1, arg); if (unlikely(!args)) return NULL; result = __Pyx_PyObject_Call(func, args, NULL); Py_DECREF(args); return result; } #endif #if CYTHON_COMPILING_IN_CPYTHON static CYTHON_INLINE PyObject* __Pyx_PyObject_CallNoArg(PyObject *func) { #ifdef __Pyx_CyFunction_USED if (likely(PyCFunction_Check(func) || PyObject_TypeCheck(func, __pyx_CyFunctionType))) { #else if (likely(PyCFunction_Check(func))) { #endif if (likely(PyCFunction_GET_FLAGS(func) & METH_NOARGS)) { return __Pyx_PyObject_CallMethO(func, NULL); } } return __Pyx_PyObject_Call(func, __pyx_empty_tuple, NULL); } #endif static CYTHON_INLINE PyObject *__Pyx_GetModuleGlobalName(PyObject *name) { PyObject *result; #if CYTHON_COMPILING_IN_CPYTHON result = PyDict_GetItem(__pyx_d, name); if (likely(result)) { Py_INCREF(result); } else { #else result = PyObject_GetItem(__pyx_d, name); if (!result) { PyErr_Clear(); #endif result = __Pyx_GetBuiltinName(name); } return result; } static void __Pyx_RaiseDoubleKeywordsError( const char* func_name, PyObject* kw_name) { PyErr_Format(PyExc_TypeError, #if PY_MAJOR_VERSION >= 3 "%s() got multiple values for keyword argument '%U'", func_name, kw_name); #else "%s() got multiple values for keyword argument '%s'", func_name, PyString_AsString(kw_name)); #endif } static int __Pyx_ParseOptionalKeywords( PyObject *kwds, PyObject **argnames[], PyObject *kwds2, PyObject *values[], Py_ssize_t num_pos_args, const char* function_name) { PyObject *key = 0, *value = 0; Py_ssize_t pos = 0; PyObject*** name; PyObject*** first_kw_arg = argnames + num_pos_args; while (PyDict_Next(kwds, &pos, &key, &value)) { name = first_kw_arg; while (*name && (**name != key)) name++; if (*name) { values[name-argnames] = value; continue; } name = first_kw_arg; #if PY_MAJOR_VERSION < 3 if (likely(PyString_CheckExact(key)) || likely(PyString_Check(key))) { while (*name) { if ((CYTHON_COMPILING_IN_PYPY || PyString_GET_SIZE(**name) == PyString_GET_SIZE(key)) && _PyString_Eq(**name, key)) { values[name-argnames] = value; break; } name++; } if (*name) continue; else { PyObject*** argname = argnames; while (argname != first_kw_arg) { if ((**argname == key) || ( (CYTHON_COMPILING_IN_PYPY || PyString_GET_SIZE(**argname) == PyString_GET_SIZE(key)) && _PyString_Eq(**argname, key))) { goto arg_passed_twice; } argname++; } } } else #endif if (likely(PyUnicode_Check(key))) { while (*name) { int cmp = (**name == key) ? 0 : #if !CYTHON_COMPILING_IN_PYPY && PY_MAJOR_VERSION >= 3 (PyUnicode_GET_SIZE(**name) != PyUnicode_GET_SIZE(key)) ? 1 : #endif PyUnicode_Compare(**name, key); if (cmp < 0 && unlikely(PyErr_Occurred())) goto bad; if (cmp == 0) { values[name-argnames] = value; break; } name++; } if (*name) continue; else { PyObject*** argname = argnames; while (argname != first_kw_arg) { int cmp = (**argname == key) ? 0 : #if !CYTHON_COMPILING_IN_PYPY && PY_MAJOR_VERSION >= 3 (PyUnicode_GET_SIZE(**argname) != PyUnicode_GET_SIZE(key)) ? 1 : #endif PyUnicode_Compare(**argname, key); if (cmp < 0 && unlikely(PyErr_Occurred())) goto bad; if (cmp == 0) goto arg_passed_twice; argname++; } } } else goto invalid_keyword_type; if (kwds2) { if (unlikely(PyDict_SetItem(kwds2, key, value))) goto bad; } else { goto invalid_keyword; } } return 0; arg_passed_twice: __Pyx_RaiseDoubleKeywordsError(function_name, key); goto bad; invalid_keyword_type: PyErr_Format(PyExc_TypeError, "%.200s() keywords must be strings", function_name); goto bad; invalid_keyword: PyErr_Format(PyExc_TypeError, #if PY_MAJOR_VERSION < 3 "%.200s() got an unexpected keyword argument '%.200s'", function_name, PyString_AsString(key)); #else "%s() got an unexpected keyword argument '%U'", function_name, key); #endif bad: return -1; } static void __Pyx_RaiseArgtupleInvalid( const char* func_name, int exact, Py_ssize_t num_min, Py_ssize_t num_max, Py_ssize_t num_found) { Py_ssize_t num_expected; const char *more_or_less; if (num_found < num_min) { num_expected = num_min; more_or_less = "at least"; } else { num_expected = num_max; more_or_less = "at most"; } if (exact) { more_or_less = "exactly"; } PyErr_Format(PyExc_TypeError, "%.200s() takes %.8s %" CYTHON_FORMAT_SSIZE_T "d positional argument%.1s (%" CYTHON_FORMAT_SSIZE_T "d given)", func_name, more_or_less, num_expected, (num_expected == 1) ? "" : "s", num_found); } static double __Pyx__PyObject_AsDouble(PyObject* obj) { PyObject* float_value; #if CYTHON_COMPILING_IN_PYPY float_value = PyNumber_Float(obj); if (0) goto bad; #else PyNumberMethods *nb = Py_TYPE(obj)->tp_as_number; if (likely(nb) && likely(nb->nb_float)) { float_value = nb->nb_float(obj); if (likely(float_value) && unlikely(!PyFloat_Check(float_value))) { PyErr_Format(PyExc_TypeError, "__float__ returned non-float (type %.200s)", Py_TYPE(float_value)->tp_name); Py_DECREF(float_value); goto bad; } } else if (PyUnicode_CheckExact(obj) || PyBytes_CheckExact(obj)) { #if PY_MAJOR_VERSION >= 3 float_value = PyFloat_FromString(obj); #else float_value = PyFloat_FromString(obj, 0); #endif } else { PyObject* args = PyTuple_New(1); if (unlikely(!args)) goto bad; PyTuple_SET_ITEM(args, 0, obj); float_value = PyObject_Call((PyObject*)&PyFloat_Type, args, 0); PyTuple_SET_ITEM(args, 0, 0); Py_DECREF(args); } #endif if (likely(float_value)) { double value = PyFloat_AS_DOUBLE(float_value); Py_DECREF(float_value); return value; } bad: return (double)-1; } static PyObject* __Pyx_PyObject_CallMethod0(PyObject* obj, PyObject* method_name) { PyObject *method, *result = NULL; method = __Pyx_PyObject_GetAttrStr(obj, method_name); if (unlikely(!method)) goto bad; #if CYTHON_COMPILING_IN_CPYTHON if (likely(PyMethod_Check(method))) { PyObject *self = PyMethod_GET_SELF(method); if (likely(self)) { PyObject *function = PyMethod_GET_FUNCTION(method); result = __Pyx_PyObject_CallOneArg(function, self); Py_DECREF(method); return result; } } #endif result = __Pyx_PyObject_CallNoArg(method); Py_DECREF(method); bad: return result; } static CYTHON_INLINE void __Pyx_RaiseNoneNotIterableError(void) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable"); } static void __Pyx_UnpackTupleError(PyObject *t, Py_ssize_t index) { if (t == Py_None) { __Pyx_RaiseNoneNotIterableError(); } else if (PyTuple_GET_SIZE(t) < index) { __Pyx_RaiseNeedMoreValuesError(PyTuple_GET_SIZE(t)); } else { __Pyx_RaiseTooManyValuesError(index); } } static CYTHON_INLINE int __Pyx_unpack_tuple2(PyObject* tuple, PyObject** pvalue1, PyObject** pvalue2, int is_tuple, int has_known_size, int decref_tuple) { Py_ssize_t index; PyObject *value1 = NULL, *value2 = NULL, *iter = NULL; if (!is_tuple && unlikely(!PyTuple_Check(tuple))) { iternextfunc iternext; iter = PyObject_GetIter(tuple); if (unlikely(!iter)) goto bad; if (decref_tuple) { Py_DECREF(tuple); tuple = NULL; } iternext = Py_TYPE(iter)->tp_iternext; value1 = iternext(iter); if (unlikely(!value1)) { index = 0; goto unpacking_failed; } value2 = iternext(iter); if (unlikely(!value2)) { index = 1; goto unpacking_failed; } if (!has_known_size && unlikely(__Pyx_IternextUnpackEndCheck(iternext(iter), 2))) goto bad; Py_DECREF(iter); } else { if (!has_known_size && unlikely(PyTuple_GET_SIZE(tuple) != 2)) { __Pyx_UnpackTupleError(tuple, 2); goto bad; } #if CYTHON_COMPILING_IN_PYPY value1 = PySequence_ITEM(tuple, 0); if (unlikely(!value1)) goto bad; value2 = PySequence_ITEM(tuple, 1); if (unlikely(!value2)) goto bad; #else value1 = PyTuple_GET_ITEM(tuple, 0); value2 = PyTuple_GET_ITEM(tuple, 1); Py_INCREF(value1); Py_INCREF(value2); #endif if (decref_tuple) { Py_DECREF(tuple); } } *pvalue1 = value1; *pvalue2 = value2; return 0; unpacking_failed: if (!has_known_size && __Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); bad: Py_XDECREF(iter); Py_XDECREF(value1); Py_XDECREF(value2); if (decref_tuple) { Py_XDECREF(tuple); } return -1; } static CYTHON_INLINE PyObject* __Pyx_dict_iterator(PyObject* iterable, int is_dict, PyObject* method_name, Py_ssize_t* p_orig_length, int* p_source_is_dict) { is_dict = is_dict || likely(PyDict_CheckExact(iterable)); *p_source_is_dict = is_dict; #if !CYTHON_COMPILING_IN_PYPY if (is_dict) { *p_orig_length = PyDict_Size(iterable); Py_INCREF(iterable); return iterable; } #endif *p_orig_length = 0; if (method_name) { PyObject* iter; iterable = __Pyx_PyObject_CallMethod0(iterable, method_name); if (!iterable) return NULL; #if !CYTHON_COMPILING_IN_PYPY if (PyTuple_CheckExact(iterable) || PyList_CheckExact(iterable)) return iterable; #endif iter = PyObject_GetIter(iterable); Py_DECREF(iterable); return iter; } return PyObject_GetIter(iterable); } static CYTHON_INLINE int __Pyx_dict_iter_next( PyObject* iter_obj, CYTHON_NCP_UNUSED Py_ssize_t orig_length, CYTHON_NCP_UNUSED Py_ssize_t* ppos, PyObject** pkey, PyObject** pvalue, PyObject** pitem, int source_is_dict) { PyObject* next_item; #if !CYTHON_COMPILING_IN_PYPY if (source_is_dict) { PyObject *key, *value; if (unlikely(orig_length != PyDict_Size(iter_obj))) { PyErr_SetString(PyExc_RuntimeError, "dictionary changed size during iteration"); return -1; } if (unlikely(!PyDict_Next(iter_obj, ppos, &key, &value))) { return 0; } if (pitem) { PyObject* tuple = PyTuple_New(2); if (unlikely(!tuple)) { return -1; } Py_INCREF(key); Py_INCREF(value); PyTuple_SET_ITEM(tuple, 0, key); PyTuple_SET_ITEM(tuple, 1, value); *pitem = tuple; } else { if (pkey) { Py_INCREF(key); *pkey = key; } if (pvalue) { Py_INCREF(value); *pvalue = value; } } return 1; } else if (PyTuple_CheckExact(iter_obj)) { Py_ssize_t pos = *ppos; if (unlikely(pos >= PyTuple_GET_SIZE(iter_obj))) return 0; *ppos = pos + 1; next_item = PyTuple_GET_ITEM(iter_obj, pos); Py_INCREF(next_item); } else if (PyList_CheckExact(iter_obj)) { Py_ssize_t pos = *ppos; if (unlikely(pos >= PyList_GET_SIZE(iter_obj))) return 0; *ppos = pos + 1; next_item = PyList_GET_ITEM(iter_obj, pos); Py_INCREF(next_item); } else #endif { next_item = PyIter_Next(iter_obj); if (unlikely(!next_item)) { return __Pyx_IterFinish(); } } if (pitem) { *pitem = next_item; } else if (pkey && pvalue) { if (__Pyx_unpack_tuple2(next_item, pkey, pvalue, source_is_dict, source_is_dict, 1)) return -1; } else if (pkey) { *pkey = next_item; } else { *pvalue = next_item; } return 1; } static CYTHON_INLINE void __Pyx_ExceptionSave(PyObject **type, PyObject **value, PyObject **tb) { #if CYTHON_COMPILING_IN_CPYTHON PyThreadState *tstate = PyThreadState_GET(); *type = tstate->exc_type; *value = tstate->exc_value; *tb = tstate->exc_traceback; Py_XINCREF(*type); Py_XINCREF(*value); Py_XINCREF(*tb); #else PyErr_GetExcInfo(type, value, tb); #endif } static void __Pyx_ExceptionReset(PyObject *type, PyObject *value, PyObject *tb) { #if CYTHON_COMPILING_IN_CPYTHON PyObject *tmp_type, *tmp_value, *tmp_tb; PyThreadState *tstate = PyThreadState_GET(); tmp_type = tstate->exc_type; tmp_value = tstate->exc_value; tmp_tb = tstate->exc_traceback; tstate->exc_type = type; tstate->exc_value = value; tstate->exc_traceback = tb; Py_XDECREF(tmp_type); Py_XDECREF(tmp_value); Py_XDECREF(tmp_tb); #else PyErr_SetExcInfo(type, value, tb); #endif } static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list, int level) { PyObject *empty_list = 0; PyObject *module = 0; PyObject *global_dict = 0; PyObject *empty_dict = 0; PyObject *list; #if PY_VERSION_HEX < 0x03030000 PyObject *py_import; py_import = __Pyx_PyObject_GetAttrStr(__pyx_b, __pyx_n_s_import); if (!py_import) goto bad; #endif if (from_list) list = from_list; else { empty_list = PyList_New(0); if (!empty_list) goto bad; list = empty_list; } global_dict = PyModule_GetDict(__pyx_m); if (!global_dict) goto bad; empty_dict = PyDict_New(); if (!empty_dict) goto bad; { #if PY_MAJOR_VERSION >= 3 if (level == -1) { if (strchr(__Pyx_MODULE_NAME, '.')) { #if PY_VERSION_HEX < 0x03030000 PyObject *py_level = PyInt_FromLong(1); if (!py_level) goto bad; module = PyObject_CallFunctionObjArgs(py_import, name, global_dict, empty_dict, list, py_level, NULL); Py_DECREF(py_level); #else module = PyImport_ImportModuleLevelObject( name, global_dict, empty_dict, list, 1); #endif if (!module) { if (!PyErr_ExceptionMatches(PyExc_ImportError)) goto bad; PyErr_Clear(); } } level = 0; } #endif if (!module) { #if PY_VERSION_HEX < 0x03030000 PyObject *py_level = PyInt_FromLong(level); if (!py_level) goto bad; module = PyObject_CallFunctionObjArgs(py_import, name, global_dict, empty_dict, list, py_level, NULL); Py_DECREF(py_level); #else module = PyImport_ImportModuleLevelObject( name, global_dict, empty_dict, list, level); #endif } } bad: #if PY_VERSION_HEX < 0x03030000 Py_XDECREF(py_import); #endif Py_XDECREF(empty_list); Py_XDECREF(empty_dict); return module; } static int __pyx_bisect_code_objects(__Pyx_CodeObjectCacheEntry* entries, int count, int code_line) { int start = 0, mid = 0, end = count - 1; if (end >= 0 && code_line > entries[end].code_line) { return count; } while (start < end) { mid = start + (end - start) / 2; if (code_line < entries[mid].code_line) { end = mid; } else if (code_line > entries[mid].code_line) { start = mid + 1; } else { return mid; } } if (code_line <= entries[mid].code_line) { return mid; } else { return mid + 1; } } static PyCodeObject *__pyx_find_code_object(int code_line) { PyCodeObject* code_object; int pos; if (unlikely(!code_line) || unlikely(!__pyx_code_cache.entries)) { return NULL; } pos = __pyx_bisect_code_objects(__pyx_code_cache.entries, __pyx_code_cache.count, code_line); if (unlikely(pos >= __pyx_code_cache.count) || unlikely(__pyx_code_cache.entries[pos].code_line != code_line)) { return NULL; } code_object = __pyx_code_cache.entries[pos].code_object; Py_INCREF(code_object); return code_object; } static void __pyx_insert_code_object(int code_line, PyCodeObject* code_object) { int pos, i; __Pyx_CodeObjectCacheEntry* entries = __pyx_code_cache.entries; if (unlikely(!code_line)) { return; } if (unlikely(!entries)) { entries = (__Pyx_CodeObjectCacheEntry*)PyMem_Malloc(64*sizeof(__Pyx_CodeObjectCacheEntry)); if (likely(entries)) { __pyx_code_cache.entries = entries; __pyx_code_cache.max_count = 64; __pyx_code_cache.count = 1; entries[0].code_line = code_line; entries[0].code_object = code_object; Py_INCREF(code_object); } return; } pos = __pyx_bisect_code_objects(__pyx_code_cache.entries, __pyx_code_cache.count, code_line); if ((pos < __pyx_code_cache.count) && unlikely(__pyx_code_cache.entries[pos].code_line == code_line)) { PyCodeObject* tmp = entries[pos].code_object; entries[pos].code_object = code_object; Py_DECREF(tmp); return; } if (__pyx_code_cache.count == __pyx_code_cache.max_count) { int new_max = __pyx_code_cache.max_count + 64; entries = (__Pyx_CodeObjectCacheEntry*)PyMem_Realloc( __pyx_code_cache.entries, (size_t)new_max*sizeof(__Pyx_CodeObjectCacheEntry)); if (unlikely(!entries)) { return; } __pyx_code_cache.entries = entries; __pyx_code_cache.max_count = new_max; } for (i=__pyx_code_cache.count; i>pos; i--) { entries[i] = entries[i-1]; } entries[pos].code_line = code_line; entries[pos].code_object = code_object; __pyx_code_cache.count++; Py_INCREF(code_object); } #include "compile.h" #include "frameobject.h" #include "traceback.h" static PyCodeObject* __Pyx_CreateCodeObjectForTraceback( const char *funcname, int c_line, int py_line, const char *filename) { PyCodeObject *py_code = 0; PyObject *py_srcfile = 0; PyObject *py_funcname = 0; #if PY_MAJOR_VERSION < 3 py_srcfile = PyString_FromString(filename); #else py_srcfile = PyUnicode_FromString(filename); #endif if (!py_srcfile) goto bad; if (c_line) { #if PY_MAJOR_VERSION < 3 py_funcname = PyString_FromFormat( "%s (%s:%d)", funcname, __pyx_cfilenm, c_line); #else py_funcname = PyUnicode_FromFormat( "%s (%s:%d)", funcname, __pyx_cfilenm, c_line); #endif } else { #if PY_MAJOR_VERSION < 3 py_funcname = PyString_FromString(funcname); #else py_funcname = PyUnicode_FromString(funcname); #endif } if (!py_funcname) goto bad; py_code = __Pyx_PyCode_New( 0, 0, 0, 0, 0, __pyx_empty_bytes, /*PyObject *code,*/ __pyx_empty_tuple, /*PyObject *consts,*/ __pyx_empty_tuple, /*PyObject *names,*/ __pyx_empty_tuple, /*PyObject *varnames,*/ __pyx_empty_tuple, /*PyObject *freevars,*/ __pyx_empty_tuple, /*PyObject *cellvars,*/ py_srcfile, /*PyObject *filename,*/ py_funcname, /*PyObject *name,*/ py_line, __pyx_empty_bytes /*PyObject *lnotab*/ ); Py_DECREF(py_srcfile); Py_DECREF(py_funcname); return py_code; bad: Py_XDECREF(py_srcfile); Py_XDECREF(py_funcname); return NULL; } static void __Pyx_AddTraceback(const char *funcname, int c_line, int py_line, const char *filename) { PyCodeObject *py_code = 0; PyFrameObject *py_frame = 0; py_code = __pyx_find_code_object(c_line ? c_line : py_line); if (!py_code) { py_code = __Pyx_CreateCodeObjectForTraceback( funcname, c_line, py_line, filename); if (!py_code) goto bad; __pyx_insert_code_object(c_line ? c_line : py_line, py_code); } py_frame = PyFrame_New( PyThreadState_GET(), /*PyThreadState *tstate,*/ py_code, /*PyCodeObject *code,*/ __pyx_d, /*PyObject *globals,*/ 0 /*PyObject *locals*/ ); if (!py_frame) goto bad; py_frame->f_lineno = py_line; PyTraceBack_Here(py_frame); bad: Py_XDECREF(py_code); Py_XDECREF(py_frame); } #define __PYX_VERIFY_RETURN_INT(target_type, func_type, func_value)\ __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, 0) #define __PYX_VERIFY_RETURN_INT_EXC(target_type, func_type, func_value)\ __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, 1) #define __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, exc)\ {\ func_type value = func_value;\ if (sizeof(target_type) < sizeof(func_type)) {\ if (unlikely(value != (func_type) (target_type) value)) {\ func_type zero = 0;\ if (exc && unlikely(value == (func_type)-1 && PyErr_Occurred()))\ return (target_type) -1;\ if (is_unsigned && unlikely(value < zero))\ goto raise_neg_overflow;\ else\ goto raise_overflow;\ }\ }\ return (target_type) value;\ } static CYTHON_INLINE int __Pyx_PyInt_As_int(PyObject *x) { const int neg_one = (int) -1, const_zero = (int) 0; const int is_unsigned = neg_one > const_zero; #if PY_MAJOR_VERSION < 3 if (likely(PyInt_Check(x))) { if (sizeof(int) < sizeof(long)) { __PYX_VERIFY_RETURN_INT(int, long, PyInt_AS_LONG(x)) } else { long val = PyInt_AS_LONG(x); if (is_unsigned && unlikely(val < 0)) { goto raise_neg_overflow; } return (int) val; } } else #endif if (likely(PyLong_Check(x))) { if (is_unsigned) { #if CYTHON_USE_PYLONG_INTERNALS const digit* digits = ((PyLongObject*)x)->ob_digit; switch (Py_SIZE(x)) { case 0: return (int) 0; case 1: __PYX_VERIFY_RETURN_INT(int, digit, digits[0]) case 2: if (8 * sizeof(int) > 1 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(int) >= 2 * PyLong_SHIFT) { return (int) (((((int)digits[1]) << PyLong_SHIFT) | (int)digits[0])); } } break; case 3: if (8 * sizeof(int) > 2 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(int) >= 3 * PyLong_SHIFT) { return (int) (((((((int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0])); } } break; case 4: if (8 * sizeof(int) > 3 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(int) >= 4 * PyLong_SHIFT) { return (int) (((((((((int)digits[3]) << PyLong_SHIFT) | (int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0])); } } break; } #endif #if CYTHON_COMPILING_IN_CPYTHON if (unlikely(Py_SIZE(x) < 0)) { goto raise_neg_overflow; } #else { int result = PyObject_RichCompareBool(x, Py_False, Py_LT); if (unlikely(result < 0)) return (int) -1; if (unlikely(result == 1)) goto raise_neg_overflow; } #endif if (sizeof(int) <= sizeof(unsigned long)) { __PYX_VERIFY_RETURN_INT_EXC(int, unsigned long, PyLong_AsUnsignedLong(x)) } else if (sizeof(int) <= sizeof(unsigned PY_LONG_LONG)) { __PYX_VERIFY_RETURN_INT_EXC(int, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x)) } } else { #if CYTHON_USE_PYLONG_INTERNALS const digit* digits = ((PyLongObject*)x)->ob_digit; switch (Py_SIZE(x)) { case 0: return (int) 0; case -1: __PYX_VERIFY_RETURN_INT(int, sdigit, (sdigit) (-(sdigit)digits[0])) case 1: __PYX_VERIFY_RETURN_INT(int, digit, +digits[0]) case -2: if (8 * sizeof(int) - 1 > 1 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(int, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(int) - 1 > 2 * PyLong_SHIFT) { return (int) (((int)-1)*(((((int)digits[1]) << PyLong_SHIFT) | (int)digits[0]))); } } break; case 2: if (8 * sizeof(int) > 1 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(int) - 1 > 2 * PyLong_SHIFT) { return (int) ((((((int)digits[1]) << PyLong_SHIFT) | (int)digits[0]))); } } break; case -3: if (8 * sizeof(int) - 1 > 2 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(int, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(int) - 1 > 3 * PyLong_SHIFT) { return (int) (((int)-1)*(((((((int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0]))); } } break; case 3: if (8 * sizeof(int) > 2 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(int) - 1 > 3 * PyLong_SHIFT) { return (int) ((((((((int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0]))); } } break; case -4: if (8 * sizeof(int) - 1 > 3 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(int, long, -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(int) - 1 > 4 * PyLong_SHIFT) { return (int) (((int)-1)*(((((((((int)digits[3]) << PyLong_SHIFT) | (int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0]))); } } break; case 4: if (8 * sizeof(int) > 3 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(int) - 1 > 4 * PyLong_SHIFT) { return (int) ((((((((((int)digits[3]) << PyLong_SHIFT) | (int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0]))); } } break; } #endif if (sizeof(int) <= sizeof(long)) { __PYX_VERIFY_RETURN_INT_EXC(int, long, PyLong_AsLong(x)) } else if (sizeof(int) <= sizeof(PY_LONG_LONG)) { __PYX_VERIFY_RETURN_INT_EXC(int, PY_LONG_LONG, PyLong_AsLongLong(x)) } } { #if CYTHON_COMPILING_IN_PYPY && !defined(_PyLong_AsByteArray) PyErr_SetString(PyExc_RuntimeError, "_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers"); #else int val; PyObject *v = __Pyx_PyNumber_Int(x); #if PY_MAJOR_VERSION < 3 if (likely(v) && !PyLong_Check(v)) { PyObject *tmp = v; v = PyNumber_Long(tmp); Py_DECREF(tmp); } #endif if (likely(v)) { int one = 1; int is_little = (int)*(unsigned char *)&one; unsigned char *bytes = (unsigned char *)&val; int ret = _PyLong_AsByteArray((PyLongObject *)v, bytes, sizeof(val), is_little, !is_unsigned); Py_DECREF(v); if (likely(!ret)) return val; } #endif return (int) -1; } } else { int val; PyObject *tmp = __Pyx_PyNumber_Int(x); if (!tmp) return (int) -1; val = __Pyx_PyInt_As_int(tmp); Py_DECREF(tmp); return val; } raise_overflow: PyErr_SetString(PyExc_OverflowError, "value too large to convert to int"); return (int) -1; raise_neg_overflow: PyErr_SetString(PyExc_OverflowError, "can't convert negative value to int"); return (int) -1; } static CYTHON_INLINE PyObject* __Pyx_PyInt_From_long(long value) { const long neg_one = (long) -1, const_zero = (long) 0; const int is_unsigned = neg_one > const_zero; if (is_unsigned) { if (sizeof(long) < sizeof(long)) { return PyInt_FromLong((long) value); } else if (sizeof(long) <= sizeof(unsigned long)) { return PyLong_FromUnsignedLong((unsigned long) value); } else if (sizeof(long) <= sizeof(unsigned PY_LONG_LONG)) { return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value); } } else { if (sizeof(long) <= sizeof(long)) { return PyInt_FromLong((long) value); } else if (sizeof(long) <= sizeof(PY_LONG_LONG)) { return PyLong_FromLongLong((PY_LONG_LONG) value); } } { int one = 1; int little = (int)*(unsigned char *)&one; unsigned char *bytes = (unsigned char *)&value; return _PyLong_FromByteArray(bytes, sizeof(long), little, !is_unsigned); } } static CYTHON_INLINE PyObject* __Pyx_PyInt_From_int(int value) { const int neg_one = (int) -1, const_zero = (int) 0; const int is_unsigned = neg_one > const_zero; if (is_unsigned) { if (sizeof(int) < sizeof(long)) { return PyInt_FromLong((long) value); } else if (sizeof(int) <= sizeof(unsigned long)) { return PyLong_FromUnsignedLong((unsigned long) value); } else if (sizeof(int) <= sizeof(unsigned PY_LONG_LONG)) { return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value); } } else { if (sizeof(int) <= sizeof(long)) { return PyInt_FromLong((long) value); } else if (sizeof(int) <= sizeof(PY_LONG_LONG)) { return PyLong_FromLongLong((PY_LONG_LONG) value); } } { int one = 1; int little = (int)*(unsigned char *)&one; unsigned char *bytes = (unsigned char *)&value; return _PyLong_FromByteArray(bytes, sizeof(int), little, !is_unsigned); } } static CYTHON_INLINE long __Pyx_PyInt_As_long(PyObject *x) { const long neg_one = (long) -1, const_zero = (long) 0; const int is_unsigned = neg_one > const_zero; #if PY_MAJOR_VERSION < 3 if (likely(PyInt_Check(x))) { if (sizeof(long) < sizeof(long)) { __PYX_VERIFY_RETURN_INT(long, long, PyInt_AS_LONG(x)) } else { long val = PyInt_AS_LONG(x); if (is_unsigned && unlikely(val < 0)) { goto raise_neg_overflow; } return (long) val; } } else #endif if (likely(PyLong_Check(x))) { if (is_unsigned) { #if CYTHON_USE_PYLONG_INTERNALS const digit* digits = ((PyLongObject*)x)->ob_digit; switch (Py_SIZE(x)) { case 0: return (long) 0; case 1: __PYX_VERIFY_RETURN_INT(long, digit, digits[0]) case 2: if (8 * sizeof(long) > 1 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(long) >= 2 * PyLong_SHIFT) { return (long) (((((long)digits[1]) << PyLong_SHIFT) | (long)digits[0])); } } break; case 3: if (8 * sizeof(long) > 2 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(long) >= 3 * PyLong_SHIFT) { return (long) (((((((long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0])); } } break; case 4: if (8 * sizeof(long) > 3 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(long) >= 4 * PyLong_SHIFT) { return (long) (((((((((long)digits[3]) << PyLong_SHIFT) | (long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0])); } } break; } #endif #if CYTHON_COMPILING_IN_CPYTHON if (unlikely(Py_SIZE(x) < 0)) { goto raise_neg_overflow; } #else { int result = PyObject_RichCompareBool(x, Py_False, Py_LT); if (unlikely(result < 0)) return (long) -1; if (unlikely(result == 1)) goto raise_neg_overflow; } #endif if (sizeof(long) <= sizeof(unsigned long)) { __PYX_VERIFY_RETURN_INT_EXC(long, unsigned long, PyLong_AsUnsignedLong(x)) } else if (sizeof(long) <= sizeof(unsigned PY_LONG_LONG)) { __PYX_VERIFY_RETURN_INT_EXC(long, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x)) } } else { #if CYTHON_USE_PYLONG_INTERNALS const digit* digits = ((PyLongObject*)x)->ob_digit; switch (Py_SIZE(x)) { case 0: return (long) 0; case -1: __PYX_VERIFY_RETURN_INT(long, sdigit, (sdigit) (-(sdigit)digits[0])) case 1: __PYX_VERIFY_RETURN_INT(long, digit, +digits[0]) case -2: if (8 * sizeof(long) - 1 > 1 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(long, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) { return (long) (((long)-1)*(((((long)digits[1]) << PyLong_SHIFT) | (long)digits[0]))); } } break; case 2: if (8 * sizeof(long) > 1 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) { return (long) ((((((long)digits[1]) << PyLong_SHIFT) | (long)digits[0]))); } } break; case -3: if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(long, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) { return (long) (((long)-1)*(((((((long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0]))); } } break; case 3: if (8 * sizeof(long) > 2 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) { return (long) ((((((((long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0]))); } } break; case -4: if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(long, long, -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(long) - 1 > 4 * PyLong_SHIFT) { return (long) (((long)-1)*(((((((((long)digits[3]) << PyLong_SHIFT) | (long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0]))); } } break; case 4: if (8 * sizeof(long) > 3 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(long) - 1 > 4 * PyLong_SHIFT) { return (long) ((((((((((long)digits[3]) << PyLong_SHIFT) | (long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0]))); } } break; } #endif if (sizeof(long) <= sizeof(long)) { __PYX_VERIFY_RETURN_INT_EXC(long, long, PyLong_AsLong(x)) } else if (sizeof(long) <= sizeof(PY_LONG_LONG)) { __PYX_VERIFY_RETURN_INT_EXC(long, PY_LONG_LONG, PyLong_AsLongLong(x)) } } { #if CYTHON_COMPILING_IN_PYPY && !defined(_PyLong_AsByteArray) PyErr_SetString(PyExc_RuntimeError, "_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers"); #else long val; PyObject *v = __Pyx_PyNumber_Int(x); #if PY_MAJOR_VERSION < 3 if (likely(v) && !PyLong_Check(v)) { PyObject *tmp = v; v = PyNumber_Long(tmp); Py_DECREF(tmp); } #endif if (likely(v)) { int one = 1; int is_little = (int)*(unsigned char *)&one; unsigned char *bytes = (unsigned char *)&val; int ret = _PyLong_AsByteArray((PyLongObject *)v, bytes, sizeof(val), is_little, !is_unsigned); Py_DECREF(v); if (likely(!ret)) return val; } #endif return (long) -1; } } else { long val; PyObject *tmp = __Pyx_PyNumber_Int(x); if (!tmp) return (long) -1; val = __Pyx_PyInt_As_long(tmp); Py_DECREF(tmp); return val; } raise_overflow: PyErr_SetString(PyExc_OverflowError, "value too large to convert to long"); return (long) -1; raise_neg_overflow: PyErr_SetString(PyExc_OverflowError, "can't convert negative value to long"); return (long) -1; } static int __Pyx_check_binary_version(void) { char ctversion[4], rtversion[4]; PyOS_snprintf(ctversion, 4, "%d.%d", PY_MAJOR_VERSION, PY_MINOR_VERSION); PyOS_snprintf(rtversion, 4, "%s", Py_GetVersion()); if (ctversion[0] != rtversion[0] || ctversion[2] != rtversion[2]) { char message[200]; PyOS_snprintf(message, sizeof(message), "compiletime version %s of module '%.100s' " "does not match runtime version %s", ctversion, __Pyx_MODULE_NAME, rtversion); return PyErr_WarnEx(NULL, message, 1); } return 0; } static int __Pyx_ExportFunction(const char *name, void (*f)(void), const char *sig) { PyObject *d = 0; PyObject *cobj = 0; union { void (*fp)(void); void *p; } tmp; d = PyObject_GetAttrString(__pyx_m, (char *)"__pyx_capi__"); if (!d) { PyErr_Clear(); d = PyDict_New(); if (!d) goto bad; Py_INCREF(d); if (PyModule_AddObject(__pyx_m, (char *)"__pyx_capi__", d) < 0) goto bad; } tmp.fp = f; #if PY_VERSION_HEX >= 0x02070000 cobj = PyCapsule_New(tmp.p, sig, 0); #else cobj = PyCObject_FromVoidPtrAndDesc(tmp.p, (void *)sig, 0); #endif if (!cobj) goto bad; if (PyDict_SetItemString(d, name, cobj) < 0) goto bad; Py_DECREF(cobj); Py_DECREF(d); return 0; bad: Py_XDECREF(cobj); Py_XDECREF(d); return -1; } static int __Pyx_InitStrings(__Pyx_StringTabEntry *t) { while (t->p) { #if PY_MAJOR_VERSION < 3 if (t->is_unicode) { *t->p = PyUnicode_DecodeUTF8(t->s, t->n - 1, NULL); } else if (t->intern) { *t->p = PyString_InternFromString(t->s); } else { *t->p = PyString_FromStringAndSize(t->s, t->n - 1); } #else if (t->is_unicode | t->is_str) { if (t->intern) { *t->p = PyUnicode_InternFromString(t->s); } else if (t->encoding) { *t->p = PyUnicode_Decode(t->s, t->n - 1, t->encoding, NULL); } else { *t->p = PyUnicode_FromStringAndSize(t->s, t->n - 1); } } else { *t->p = PyBytes_FromStringAndSize(t->s, t->n - 1); } #endif if (!*t->p) return -1; ++t; } return 0; } static CYTHON_INLINE PyObject* __Pyx_PyUnicode_FromString(const char* c_str) { return __Pyx_PyUnicode_FromStringAndSize(c_str, (Py_ssize_t)strlen(c_str)); } static CYTHON_INLINE char* __Pyx_PyObject_AsString(PyObject* o) { Py_ssize_t ignore; return __Pyx_PyObject_AsStringAndSize(o, &ignore); } static CYTHON_INLINE char* __Pyx_PyObject_AsStringAndSize(PyObject* o, Py_ssize_t *length) { #if CYTHON_COMPILING_IN_CPYTHON && (__PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT) if ( #if PY_MAJOR_VERSION < 3 && __PYX_DEFAULT_STRING_ENCODING_IS_ASCII __Pyx_sys_getdefaultencoding_not_ascii && #endif PyUnicode_Check(o)) { #if PY_VERSION_HEX < 0x03030000 char* defenc_c; PyObject* defenc = _PyUnicode_AsDefaultEncodedString(o, NULL); if (!defenc) return NULL; defenc_c = PyBytes_AS_STRING(defenc); #if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII { char* end = defenc_c + PyBytes_GET_SIZE(defenc); char* c; for (c = defenc_c; c < end; c++) { if ((unsigned char) (*c) >= 128) { PyUnicode_AsASCIIString(o); return NULL; } } } #endif *length = PyBytes_GET_SIZE(defenc); return defenc_c; #else if (__Pyx_PyUnicode_READY(o) == -1) return NULL; #if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII if (PyUnicode_IS_ASCII(o)) { *length = PyUnicode_GET_LENGTH(o); return PyUnicode_AsUTF8(o); } else { PyUnicode_AsASCIIString(o); return NULL; } #else return PyUnicode_AsUTF8AndSize(o, length); #endif #endif } else #endif #if (!CYTHON_COMPILING_IN_PYPY) || (defined(PyByteArray_AS_STRING) && defined(PyByteArray_GET_SIZE)) if (PyByteArray_Check(o)) { *length = PyByteArray_GET_SIZE(o); return PyByteArray_AS_STRING(o); } else #endif { char* result; int r = PyBytes_AsStringAndSize(o, &result, length); if (unlikely(r < 0)) { return NULL; } else { return result; } } } static CYTHON_INLINE int __Pyx_PyObject_IsTrue(PyObject* x) { int is_true = x == Py_True; if (is_true | (x == Py_False) | (x == Py_None)) return is_true; else return PyObject_IsTrue(x); } static CYTHON_INLINE PyObject* __Pyx_PyNumber_Int(PyObject* x) { PyNumberMethods *m; const char *name = NULL; PyObject *res = NULL; #if PY_MAJOR_VERSION < 3 if (PyInt_Check(x) || PyLong_Check(x)) #else if (PyLong_Check(x)) #endif return __Pyx_NewRef(x); m = Py_TYPE(x)->tp_as_number; #if PY_MAJOR_VERSION < 3 if (m && m->nb_int) { name = "int"; res = PyNumber_Int(x); } else if (m && m->nb_long) { name = "long"; res = PyNumber_Long(x); } #else if (m && m->nb_int) { name = "int"; res = PyNumber_Long(x); } #endif if (res) { #if PY_MAJOR_VERSION < 3 if (!PyInt_Check(res) && !PyLong_Check(res)) { #else if (!PyLong_Check(res)) { #endif PyErr_Format(PyExc_TypeError, "__%.4s__ returned non-%.4s (type %.200s)", name, name, Py_TYPE(res)->tp_name); Py_DECREF(res); return NULL; } } else if (!PyErr_Occurred()) { PyErr_SetString(PyExc_TypeError, "an integer is required"); } return res; } static CYTHON_INLINE Py_ssize_t __Pyx_PyIndex_AsSsize_t(PyObject* b) { Py_ssize_t ival; PyObject *x; #if PY_MAJOR_VERSION < 3 if (likely(PyInt_CheckExact(b))) { if (sizeof(Py_ssize_t) >= sizeof(long)) return PyInt_AS_LONG(b); else return PyInt_AsSsize_t(x); } #endif if (likely(PyLong_CheckExact(b))) { #if CYTHON_USE_PYLONG_INTERNALS const digit* digits = ((PyLongObject*)b)->ob_digit; const Py_ssize_t size = Py_SIZE(b); if (likely(__Pyx_sst_abs(size) <= 1)) { ival = likely(size) ? digits[0] : 0; if (size == -1) ival = -ival; return ival; } else { switch (size) { case 2: if (8 * sizeof(Py_ssize_t) > 2 * PyLong_SHIFT) { return (Py_ssize_t) (((((size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])); } break; case -2: if (8 * sizeof(Py_ssize_t) > 2 * PyLong_SHIFT) { return -(Py_ssize_t) (((((size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])); } break; case 3: if (8 * sizeof(Py_ssize_t) > 3 * PyLong_SHIFT) { return (Py_ssize_t) (((((((size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])); } break; case -3: if (8 * sizeof(Py_ssize_t) > 3 * PyLong_SHIFT) { return -(Py_ssize_t) (((((((size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])); } break; case 4: if (8 * sizeof(Py_ssize_t) > 4 * PyLong_SHIFT) { return (Py_ssize_t) (((((((((size_t)digits[3]) << PyLong_SHIFT) | (size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])); } break; case -4: if (8 * sizeof(Py_ssize_t) > 4 * PyLong_SHIFT) { return -(Py_ssize_t) (((((((((size_t)digits[3]) << PyLong_SHIFT) | (size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])); } break; } } #endif return PyLong_AsSsize_t(b); } x = PyNumber_Index(b); if (!x) return -1; ival = PyInt_AsSsize_t(x); Py_DECREF(x); return ival; } static CYTHON_INLINE PyObject * __Pyx_PyInt_FromSize_t(size_t ival) { return PyInt_FromSize_t(ival); } #endif /* Py_PYTHON_H */ pygame_sdl2-2.1.0-for-renpy-6.99.14.1/gen/pygame_sdl2.surface.c0000644000175000017500000214276613231545015023037 0ustar tomtom00000000000000/* Generated by Cython 0.25.2 */ #define PY_SSIZE_T_CLEAN #include "Python.h" #ifndef Py_PYTHON_H #error Python headers needed to compile C extensions, please install development version of Python. #elif PY_VERSION_HEX < 0x02060000 || (0x03000000 <= PY_VERSION_HEX && PY_VERSION_HEX < 0x03020000) #error Cython requires Python 2.6+ or Python 3.2+. #else #define CYTHON_ABI "0_25_2" #include #ifndef offsetof #define offsetof(type, member) ( (size_t) & ((type*)0) -> member ) #endif #if !defined(WIN32) && !defined(MS_WINDOWS) #ifndef __stdcall #define __stdcall #endif #ifndef __cdecl #define __cdecl #endif #ifndef __fastcall #define __fastcall #endif #endif #ifndef DL_IMPORT #define DL_IMPORT(t) t #endif #ifndef DL_EXPORT #define DL_EXPORT(t) t #endif #ifndef HAVE_LONG_LONG #if PY_VERSION_HEX >= 0x03030000 || (PY_MAJOR_VERSION == 2 && PY_VERSION_HEX >= 0x02070000) #define HAVE_LONG_LONG #endif #endif #ifndef PY_LONG_LONG #define PY_LONG_LONG LONG_LONG #endif #ifndef Py_HUGE_VAL #define Py_HUGE_VAL HUGE_VAL #endif #ifdef PYPY_VERSION #define CYTHON_COMPILING_IN_PYPY 1 #define CYTHON_COMPILING_IN_PYSTON 0 #define CYTHON_COMPILING_IN_CPYTHON 0 #undef CYTHON_USE_TYPE_SLOTS #define CYTHON_USE_TYPE_SLOTS 0 #undef CYTHON_USE_ASYNC_SLOTS #define CYTHON_USE_ASYNC_SLOTS 0 #undef CYTHON_USE_PYLIST_INTERNALS #define CYTHON_USE_PYLIST_INTERNALS 0 #undef CYTHON_USE_UNICODE_INTERNALS #define CYTHON_USE_UNICODE_INTERNALS 0 #undef CYTHON_USE_UNICODE_WRITER #define CYTHON_USE_UNICODE_WRITER 0 #undef CYTHON_USE_PYLONG_INTERNALS #define CYTHON_USE_PYLONG_INTERNALS 0 #undef CYTHON_AVOID_BORROWED_REFS #define CYTHON_AVOID_BORROWED_REFS 1 #undef CYTHON_ASSUME_SAFE_MACROS #define CYTHON_ASSUME_SAFE_MACROS 0 #undef CYTHON_UNPACK_METHODS #define CYTHON_UNPACK_METHODS 0 #undef CYTHON_FAST_THREAD_STATE #define CYTHON_FAST_THREAD_STATE 0 #undef CYTHON_FAST_PYCALL #define CYTHON_FAST_PYCALL 0 #elif defined(PYSTON_VERSION) #define CYTHON_COMPILING_IN_PYPY 0 #define CYTHON_COMPILING_IN_PYSTON 1 #define CYTHON_COMPILING_IN_CPYTHON 0 #ifndef CYTHON_USE_TYPE_SLOTS #define CYTHON_USE_TYPE_SLOTS 1 #endif #undef CYTHON_USE_ASYNC_SLOTS #define CYTHON_USE_ASYNC_SLOTS 0 #undef CYTHON_USE_PYLIST_INTERNALS #define CYTHON_USE_PYLIST_INTERNALS 0 #ifndef CYTHON_USE_UNICODE_INTERNALS #define CYTHON_USE_UNICODE_INTERNALS 1 #endif #undef CYTHON_USE_UNICODE_WRITER #define CYTHON_USE_UNICODE_WRITER 0 #undef CYTHON_USE_PYLONG_INTERNALS #define CYTHON_USE_PYLONG_INTERNALS 0 #ifndef CYTHON_AVOID_BORROWED_REFS #define CYTHON_AVOID_BORROWED_REFS 0 #endif #ifndef CYTHON_ASSUME_SAFE_MACROS #define CYTHON_ASSUME_SAFE_MACROS 1 #endif #ifndef CYTHON_UNPACK_METHODS #define CYTHON_UNPACK_METHODS 1 #endif #undef CYTHON_FAST_THREAD_STATE #define CYTHON_FAST_THREAD_STATE 0 #undef CYTHON_FAST_PYCALL #define CYTHON_FAST_PYCALL 0 #else #define CYTHON_COMPILING_IN_PYPY 0 #define CYTHON_COMPILING_IN_PYSTON 0 #define CYTHON_COMPILING_IN_CPYTHON 1 #ifndef CYTHON_USE_TYPE_SLOTS #define CYTHON_USE_TYPE_SLOTS 1 #endif #if PY_MAJOR_VERSION < 3 #undef CYTHON_USE_ASYNC_SLOTS #define CYTHON_USE_ASYNC_SLOTS 0 #elif !defined(CYTHON_USE_ASYNC_SLOTS) #define CYTHON_USE_ASYNC_SLOTS 1 #endif #if PY_VERSION_HEX < 0x02070000 #undef CYTHON_USE_PYLONG_INTERNALS #define CYTHON_USE_PYLONG_INTERNALS 0 #elif !defined(CYTHON_USE_PYLONG_INTERNALS) #define CYTHON_USE_PYLONG_INTERNALS 1 #endif #ifndef CYTHON_USE_PYLIST_INTERNALS #define CYTHON_USE_PYLIST_INTERNALS 1 #endif #ifndef CYTHON_USE_UNICODE_INTERNALS #define CYTHON_USE_UNICODE_INTERNALS 1 #endif #if PY_VERSION_HEX < 0x030300F0 #undef CYTHON_USE_UNICODE_WRITER #define CYTHON_USE_UNICODE_WRITER 0 #elif !defined(CYTHON_USE_UNICODE_WRITER) #define CYTHON_USE_UNICODE_WRITER 1 #endif #ifndef CYTHON_AVOID_BORROWED_REFS #define CYTHON_AVOID_BORROWED_REFS 0 #endif #ifndef CYTHON_ASSUME_SAFE_MACROS #define CYTHON_ASSUME_SAFE_MACROS 1 #endif #ifndef CYTHON_UNPACK_METHODS #define CYTHON_UNPACK_METHODS 1 #endif #ifndef CYTHON_FAST_THREAD_STATE #define CYTHON_FAST_THREAD_STATE 1 #endif #ifndef CYTHON_FAST_PYCALL #define CYTHON_FAST_PYCALL 1 #endif #endif #if !defined(CYTHON_FAST_PYCCALL) #define CYTHON_FAST_PYCCALL (CYTHON_FAST_PYCALL && PY_VERSION_HEX >= 0x030600B1) #endif #if CYTHON_USE_PYLONG_INTERNALS #include "longintrepr.h" #undef SHIFT #undef BASE #undef MASK #endif #if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX < 0x02070600 && !defined(Py_OptimizeFlag) #define Py_OptimizeFlag 0 #endif #define __PYX_BUILD_PY_SSIZE_T "n" #define CYTHON_FORMAT_SSIZE_T "z" #if PY_MAJOR_VERSION < 3 #define __Pyx_BUILTIN_MODULE_NAME "__builtin__" #define __Pyx_PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)\ PyCode_New(a+k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos) #define __Pyx_DefaultClassType PyClass_Type #else #define __Pyx_BUILTIN_MODULE_NAME "builtins" #define __Pyx_PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)\ PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos) #define __Pyx_DefaultClassType PyType_Type #endif #ifndef Py_TPFLAGS_CHECKTYPES #define Py_TPFLAGS_CHECKTYPES 0 #endif #ifndef Py_TPFLAGS_HAVE_INDEX #define Py_TPFLAGS_HAVE_INDEX 0 #endif #ifndef Py_TPFLAGS_HAVE_NEWBUFFER #define Py_TPFLAGS_HAVE_NEWBUFFER 0 #endif #ifndef Py_TPFLAGS_HAVE_FINALIZE #define Py_TPFLAGS_HAVE_FINALIZE 0 #endif #ifndef METH_FASTCALL #define METH_FASTCALL 0x80 typedef PyObject *(*__Pyx_PyCFunctionFast) (PyObject *self, PyObject **args, Py_ssize_t nargs, PyObject *kwnames); #else #define __Pyx_PyCFunctionFast _PyCFunctionFast #endif #if CYTHON_FAST_PYCCALL #define __Pyx_PyFastCFunction_Check(func)\ ((PyCFunction_Check(func) && (METH_FASTCALL == (PyCFunction_GET_FLAGS(func) & ~(METH_CLASS | METH_STATIC | METH_COEXIST))))) #else #define __Pyx_PyFastCFunction_Check(func) 0 #endif #if PY_VERSION_HEX > 0x03030000 && defined(PyUnicode_KIND) #define CYTHON_PEP393_ENABLED 1 #define __Pyx_PyUnicode_READY(op) (likely(PyUnicode_IS_READY(op)) ?\ 0 : _PyUnicode_Ready((PyObject *)(op))) #define __Pyx_PyUnicode_GET_LENGTH(u) PyUnicode_GET_LENGTH(u) #define __Pyx_PyUnicode_READ_CHAR(u, i) PyUnicode_READ_CHAR(u, i) #define __Pyx_PyUnicode_MAX_CHAR_VALUE(u) PyUnicode_MAX_CHAR_VALUE(u) #define __Pyx_PyUnicode_KIND(u) PyUnicode_KIND(u) #define __Pyx_PyUnicode_DATA(u) PyUnicode_DATA(u) #define __Pyx_PyUnicode_READ(k, d, i) PyUnicode_READ(k, d, i) #define __Pyx_PyUnicode_WRITE(k, d, i, ch) PyUnicode_WRITE(k, d, i, ch) #define __Pyx_PyUnicode_IS_TRUE(u) (0 != (likely(PyUnicode_IS_READY(u)) ? PyUnicode_GET_LENGTH(u) : PyUnicode_GET_SIZE(u))) #else #define CYTHON_PEP393_ENABLED 0 #define PyUnicode_1BYTE_KIND 1 #define PyUnicode_2BYTE_KIND 2 #define PyUnicode_4BYTE_KIND 4 #define __Pyx_PyUnicode_READY(op) (0) #define __Pyx_PyUnicode_GET_LENGTH(u) PyUnicode_GET_SIZE(u) #define __Pyx_PyUnicode_READ_CHAR(u, i) ((Py_UCS4)(PyUnicode_AS_UNICODE(u)[i])) #define __Pyx_PyUnicode_MAX_CHAR_VALUE(u) ((sizeof(Py_UNICODE) == 2) ? 65535 : 1114111) #define __Pyx_PyUnicode_KIND(u) (sizeof(Py_UNICODE)) #define __Pyx_PyUnicode_DATA(u) ((void*)PyUnicode_AS_UNICODE(u)) #define __Pyx_PyUnicode_READ(k, d, i) ((void)(k), (Py_UCS4)(((Py_UNICODE*)d)[i])) #define __Pyx_PyUnicode_WRITE(k, d, i, ch) (((void)(k)), ((Py_UNICODE*)d)[i] = ch) #define __Pyx_PyUnicode_IS_TRUE(u) (0 != PyUnicode_GET_SIZE(u)) #endif #if CYTHON_COMPILING_IN_PYPY #define __Pyx_PyUnicode_Concat(a, b) PyNumber_Add(a, b) #define __Pyx_PyUnicode_ConcatSafe(a, b) PyNumber_Add(a, b) #else #define __Pyx_PyUnicode_Concat(a, b) PyUnicode_Concat(a, b) #define __Pyx_PyUnicode_ConcatSafe(a, b) ((unlikely((a) == Py_None) || unlikely((b) == Py_None)) ?\ PyNumber_Add(a, b) : __Pyx_PyUnicode_Concat(a, b)) #endif #if CYTHON_COMPILING_IN_PYPY && !defined(PyUnicode_Contains) #define PyUnicode_Contains(u, s) PySequence_Contains(u, s) #endif #if CYTHON_COMPILING_IN_PYPY && !defined(PyByteArray_Check) #define PyByteArray_Check(obj) PyObject_TypeCheck(obj, &PyByteArray_Type) #endif #if CYTHON_COMPILING_IN_PYPY && !defined(PyObject_Format) #define PyObject_Format(obj, fmt) PyObject_CallMethod(obj, "__format__", "O", fmt) #endif #if CYTHON_COMPILING_IN_PYPY && !defined(PyObject_Malloc) #define PyObject_Malloc(s) PyMem_Malloc(s) #define PyObject_Free(p) PyMem_Free(p) #define PyObject_Realloc(p) PyMem_Realloc(p) #endif #if CYTHON_COMPILING_IN_PYSTON #define __Pyx_PyCode_HasFreeVars(co) PyCode_HasFreeVars(co) #define __Pyx_PyFrame_SetLineNumber(frame, lineno) PyFrame_SetLineNumber(frame, lineno) #else #define __Pyx_PyCode_HasFreeVars(co) (PyCode_GetNumFree(co) > 0) #define __Pyx_PyFrame_SetLineNumber(frame, lineno) (frame)->f_lineno = (lineno) #endif #define __Pyx_PyString_FormatSafe(a, b) ((unlikely((a) == Py_None)) ? PyNumber_Remainder(a, b) : __Pyx_PyString_Format(a, b)) #define __Pyx_PyUnicode_FormatSafe(a, b) ((unlikely((a) == Py_None)) ? PyNumber_Remainder(a, b) : PyUnicode_Format(a, b)) #if PY_MAJOR_VERSION >= 3 #define __Pyx_PyString_Format(a, b) PyUnicode_Format(a, b) #else #define __Pyx_PyString_Format(a, b) PyString_Format(a, b) #endif #if PY_MAJOR_VERSION < 3 && !defined(PyObject_ASCII) #define PyObject_ASCII(o) PyObject_Repr(o) #endif #if PY_MAJOR_VERSION >= 3 #define PyBaseString_Type PyUnicode_Type #define PyStringObject PyUnicodeObject #define PyString_Type PyUnicode_Type #define PyString_Check PyUnicode_Check #define PyString_CheckExact PyUnicode_CheckExact #endif #if PY_MAJOR_VERSION >= 3 #define __Pyx_PyBaseString_Check(obj) PyUnicode_Check(obj) #define __Pyx_PyBaseString_CheckExact(obj) PyUnicode_CheckExact(obj) #else #define __Pyx_PyBaseString_Check(obj) (PyString_Check(obj) || PyUnicode_Check(obj)) #define __Pyx_PyBaseString_CheckExact(obj) (PyString_CheckExact(obj) || PyUnicode_CheckExact(obj)) #endif #ifndef PySet_CheckExact #define PySet_CheckExact(obj) (Py_TYPE(obj) == &PySet_Type) #endif #define __Pyx_TypeCheck(obj, type) PyObject_TypeCheck(obj, (PyTypeObject *)type) #define __Pyx_PyException_Check(obj) __Pyx_TypeCheck(obj, PyExc_Exception) #if PY_MAJOR_VERSION >= 3 #define PyIntObject PyLongObject #define PyInt_Type PyLong_Type #define PyInt_Check(op) PyLong_Check(op) #define PyInt_CheckExact(op) PyLong_CheckExact(op) #define PyInt_FromString PyLong_FromString #define PyInt_FromUnicode PyLong_FromUnicode #define PyInt_FromLong PyLong_FromLong #define PyInt_FromSize_t PyLong_FromSize_t #define PyInt_FromSsize_t PyLong_FromSsize_t #define PyInt_AsLong PyLong_AsLong #define PyInt_AS_LONG PyLong_AS_LONG #define PyInt_AsSsize_t PyLong_AsSsize_t #define PyInt_AsUnsignedLongMask PyLong_AsUnsignedLongMask #define PyInt_AsUnsignedLongLongMask PyLong_AsUnsignedLongLongMask #define PyNumber_Int PyNumber_Long #endif #if PY_MAJOR_VERSION >= 3 #define PyBoolObject PyLongObject #endif #if PY_MAJOR_VERSION >= 3 && CYTHON_COMPILING_IN_PYPY #ifndef PyUnicode_InternFromString #define PyUnicode_InternFromString(s) PyUnicode_FromString(s) #endif #endif #if PY_VERSION_HEX < 0x030200A4 typedef long Py_hash_t; #define __Pyx_PyInt_FromHash_t PyInt_FromLong #define __Pyx_PyInt_AsHash_t PyInt_AsLong #else #define __Pyx_PyInt_FromHash_t PyInt_FromSsize_t #define __Pyx_PyInt_AsHash_t PyInt_AsSsize_t #endif #if PY_MAJOR_VERSION >= 3 #define __Pyx_PyMethod_New(func, self, klass) ((self) ? PyMethod_New(func, self) : PyInstanceMethod_New(func)) #else #define __Pyx_PyMethod_New(func, self, klass) PyMethod_New(func, self, klass) #endif #if CYTHON_USE_ASYNC_SLOTS #if PY_VERSION_HEX >= 0x030500B1 #define __Pyx_PyAsyncMethodsStruct PyAsyncMethods #define __Pyx_PyType_AsAsync(obj) (Py_TYPE(obj)->tp_as_async) #else typedef struct { unaryfunc am_await; unaryfunc am_aiter; unaryfunc am_anext; } __Pyx_PyAsyncMethodsStruct; #define __Pyx_PyType_AsAsync(obj) ((__Pyx_PyAsyncMethodsStruct*) (Py_TYPE(obj)->tp_reserved)) #endif #else #define __Pyx_PyType_AsAsync(obj) NULL #endif #ifndef CYTHON_RESTRICT #if defined(__GNUC__) #define CYTHON_RESTRICT __restrict__ #elif defined(_MSC_VER) && _MSC_VER >= 1400 #define CYTHON_RESTRICT __restrict #elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L #define CYTHON_RESTRICT restrict #else #define CYTHON_RESTRICT #endif #endif #ifndef CYTHON_UNUSED # if defined(__GNUC__) # if !(defined(__cplusplus)) || (__GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 4)) # define CYTHON_UNUSED __attribute__ ((__unused__)) # else # define CYTHON_UNUSED # endif # elif defined(__ICC) || (defined(__INTEL_COMPILER) && !defined(_MSC_VER)) # define CYTHON_UNUSED __attribute__ ((__unused__)) # else # define CYTHON_UNUSED # endif #endif #ifndef CYTHON_MAYBE_UNUSED_VAR # if defined(__cplusplus) template void CYTHON_MAYBE_UNUSED_VAR( const T& ) { } # else # define CYTHON_MAYBE_UNUSED_VAR(x) (void)(x) # endif #endif #ifndef CYTHON_NCP_UNUSED # if CYTHON_COMPILING_IN_CPYTHON # define CYTHON_NCP_UNUSED # else # define CYTHON_NCP_UNUSED CYTHON_UNUSED # endif #endif #define __Pyx_void_to_None(void_result) ((void)(void_result), Py_INCREF(Py_None), Py_None) #ifndef CYTHON_INLINE #if defined(__clang__) #define CYTHON_INLINE __inline__ __attribute__ ((__unused__)) #elif defined(__GNUC__) #define CYTHON_INLINE __inline__ #elif defined(_MSC_VER) #define CYTHON_INLINE __inline #elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L #define CYTHON_INLINE inline #else #define CYTHON_INLINE #endif #endif #if defined(WIN32) || defined(MS_WINDOWS) #define _USE_MATH_DEFINES #endif #include #ifdef NAN #define __PYX_NAN() ((float) NAN) #else static CYTHON_INLINE float __PYX_NAN() { float value; memset(&value, 0xFF, sizeof(value)); return value; } #endif #if defined(__CYGWIN__) && defined(_LDBL_EQ_DBL) #define __Pyx_truncl trunc #else #define __Pyx_truncl truncl #endif #define __PYX_ERR(f_index, lineno, Ln_error) \ { \ __pyx_filename = __pyx_f[f_index]; __pyx_lineno = lineno; __pyx_clineno = __LINE__; goto Ln_error; \ } #if PY_MAJOR_VERSION >= 3 #define __Pyx_PyNumber_Divide(x,y) PyNumber_TrueDivide(x,y) #define __Pyx_PyNumber_InPlaceDivide(x,y) PyNumber_InPlaceTrueDivide(x,y) #else #define __Pyx_PyNumber_Divide(x,y) PyNumber_Divide(x,y) #define __Pyx_PyNumber_InPlaceDivide(x,y) PyNumber_InPlaceDivide(x,y) #endif #ifndef __PYX_EXTERN_C #ifdef __cplusplus #define __PYX_EXTERN_C extern "C" #else #define __PYX_EXTERN_C extern #endif #endif #define __PYX_HAVE__pygame_sdl2__surface #define __PYX_HAVE_API__pygame_sdl2__surface #include #include #include #include #include "SDL.h" #include "src/surface.h" #ifdef _OPENMP #include #endif /* _OPENMP */ #ifdef PYREX_WITHOUT_ASSERTIONS #define CYTHON_WITHOUT_ASSERTIONS #endif typedef struct {PyObject **p; const char *s; const Py_ssize_t n; const char* encoding; const char is_unicode; const char is_str; const char intern; } __Pyx_StringTabEntry; #define __PYX_DEFAULT_STRING_ENCODING_IS_ASCII 0 #define __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT 0 #define __PYX_DEFAULT_STRING_ENCODING "" #define __Pyx_PyObject_FromString __Pyx_PyBytes_FromString #define __Pyx_PyObject_FromStringAndSize __Pyx_PyBytes_FromStringAndSize #define __Pyx_uchar_cast(c) ((unsigned char)c) #define __Pyx_long_cast(x) ((long)x) #define __Pyx_fits_Py_ssize_t(v, type, is_signed) (\ (sizeof(type) < sizeof(Py_ssize_t)) ||\ (sizeof(type) > sizeof(Py_ssize_t) &&\ likely(v < (type)PY_SSIZE_T_MAX ||\ v == (type)PY_SSIZE_T_MAX) &&\ (!is_signed || likely(v > (type)PY_SSIZE_T_MIN ||\ v == (type)PY_SSIZE_T_MIN))) ||\ (sizeof(type) == sizeof(Py_ssize_t) &&\ (is_signed || likely(v < (type)PY_SSIZE_T_MAX ||\ v == (type)PY_SSIZE_T_MAX))) ) #if defined (__cplusplus) && __cplusplus >= 201103L #include #define __Pyx_sst_abs(value) std::abs(value) #elif SIZEOF_INT >= SIZEOF_SIZE_T #define __Pyx_sst_abs(value) abs(value) #elif SIZEOF_LONG >= SIZEOF_SIZE_T #define __Pyx_sst_abs(value) labs(value) #elif defined (_MSC_VER) && defined (_M_X64) #define __Pyx_sst_abs(value) _abs64(value) #elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L #define __Pyx_sst_abs(value) llabs(value) #elif defined (__GNUC__) #define __Pyx_sst_abs(value) __builtin_llabs(value) #else #define __Pyx_sst_abs(value) ((value<0) ? -value : value) #endif static CYTHON_INLINE char* __Pyx_PyObject_AsString(PyObject*); static CYTHON_INLINE char* __Pyx_PyObject_AsStringAndSize(PyObject*, Py_ssize_t* length); #define __Pyx_PyByteArray_FromString(s) PyByteArray_FromStringAndSize((const char*)s, strlen((const char*)s)) #define __Pyx_PyByteArray_FromStringAndSize(s, l) PyByteArray_FromStringAndSize((const char*)s, l) #define __Pyx_PyBytes_FromString PyBytes_FromString #define __Pyx_PyBytes_FromStringAndSize PyBytes_FromStringAndSize static CYTHON_INLINE PyObject* __Pyx_PyUnicode_FromString(const char*); #if PY_MAJOR_VERSION < 3 #define __Pyx_PyStr_FromString __Pyx_PyBytes_FromString #define __Pyx_PyStr_FromStringAndSize __Pyx_PyBytes_FromStringAndSize #else #define __Pyx_PyStr_FromString __Pyx_PyUnicode_FromString #define __Pyx_PyStr_FromStringAndSize __Pyx_PyUnicode_FromStringAndSize #endif #define __Pyx_PyObject_AsSString(s) ((signed char*) __Pyx_PyObject_AsString(s)) #define __Pyx_PyObject_AsUString(s) ((unsigned char*) __Pyx_PyObject_AsString(s)) #define __Pyx_PyObject_FromCString(s) __Pyx_PyObject_FromString((const char*)s) #define __Pyx_PyBytes_FromCString(s) __Pyx_PyBytes_FromString((const char*)s) #define __Pyx_PyByteArray_FromCString(s) __Pyx_PyByteArray_FromString((const char*)s) #define __Pyx_PyStr_FromCString(s) __Pyx_PyStr_FromString((const char*)s) #define __Pyx_PyUnicode_FromCString(s) __Pyx_PyUnicode_FromString((const char*)s) #if PY_MAJOR_VERSION < 3 static CYTHON_INLINE size_t __Pyx_Py_UNICODE_strlen(const Py_UNICODE *u) { const Py_UNICODE *u_end = u; while (*u_end++) ; return (size_t)(u_end - u - 1); } #else #define __Pyx_Py_UNICODE_strlen Py_UNICODE_strlen #endif #define __Pyx_PyUnicode_FromUnicode(u) PyUnicode_FromUnicode(u, __Pyx_Py_UNICODE_strlen(u)) #define __Pyx_PyUnicode_FromUnicodeAndLength PyUnicode_FromUnicode #define __Pyx_PyUnicode_AsUnicode PyUnicode_AsUnicode #define __Pyx_NewRef(obj) (Py_INCREF(obj), obj) #define __Pyx_Owned_Py_None(b) __Pyx_NewRef(Py_None) #define __Pyx_PyBool_FromLong(b) ((b) ? __Pyx_NewRef(Py_True) : __Pyx_NewRef(Py_False)) static CYTHON_INLINE int __Pyx_PyObject_IsTrue(PyObject*); static CYTHON_INLINE PyObject* __Pyx_PyNumber_IntOrLong(PyObject* x); static CYTHON_INLINE Py_ssize_t __Pyx_PyIndex_AsSsize_t(PyObject*); static CYTHON_INLINE PyObject * __Pyx_PyInt_FromSize_t(size_t); #if CYTHON_ASSUME_SAFE_MACROS #define __pyx_PyFloat_AsDouble(x) (PyFloat_CheckExact(x) ? PyFloat_AS_DOUBLE(x) : PyFloat_AsDouble(x)) #else #define __pyx_PyFloat_AsDouble(x) PyFloat_AsDouble(x) #endif #define __pyx_PyFloat_AsFloat(x) ((float) __pyx_PyFloat_AsDouble(x)) #if PY_MAJOR_VERSION >= 3 #define __Pyx_PyNumber_Int(x) (PyLong_CheckExact(x) ? __Pyx_NewRef(x) : PyNumber_Long(x)) #else #define __Pyx_PyNumber_Int(x) (PyInt_CheckExact(x) ? __Pyx_NewRef(x) : PyNumber_Int(x)) #endif #define __Pyx_PyNumber_Float(x) (PyFloat_CheckExact(x) ? __Pyx_NewRef(x) : PyNumber_Float(x)) #if PY_MAJOR_VERSION < 3 && __PYX_DEFAULT_STRING_ENCODING_IS_ASCII static int __Pyx_sys_getdefaultencoding_not_ascii; static int __Pyx_init_sys_getdefaultencoding_params(void) { PyObject* sys; PyObject* default_encoding = NULL; PyObject* ascii_chars_u = NULL; PyObject* ascii_chars_b = NULL; const char* default_encoding_c; sys = PyImport_ImportModule("sys"); if (!sys) goto bad; default_encoding = PyObject_CallMethod(sys, (char*) "getdefaultencoding", NULL); Py_DECREF(sys); if (!default_encoding) goto bad; default_encoding_c = PyBytes_AsString(default_encoding); if (!default_encoding_c) goto bad; if (strcmp(default_encoding_c, "ascii") == 0) { __Pyx_sys_getdefaultencoding_not_ascii = 0; } else { char ascii_chars[128]; int c; for (c = 0; c < 128; c++) { ascii_chars[c] = c; } __Pyx_sys_getdefaultencoding_not_ascii = 1; ascii_chars_u = PyUnicode_DecodeASCII(ascii_chars, 128, NULL); if (!ascii_chars_u) goto bad; ascii_chars_b = PyUnicode_AsEncodedString(ascii_chars_u, default_encoding_c, NULL); if (!ascii_chars_b || !PyBytes_Check(ascii_chars_b) || memcmp(ascii_chars, PyBytes_AS_STRING(ascii_chars_b), 128) != 0) { PyErr_Format( PyExc_ValueError, "This module compiled with c_string_encoding=ascii, but default encoding '%.200s' is not a superset of ascii.", default_encoding_c); goto bad; } Py_DECREF(ascii_chars_u); Py_DECREF(ascii_chars_b); } Py_DECREF(default_encoding); return 0; bad: Py_XDECREF(default_encoding); Py_XDECREF(ascii_chars_u); Py_XDECREF(ascii_chars_b); return -1; } #endif #if __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT && PY_MAJOR_VERSION >= 3 #define __Pyx_PyUnicode_FromStringAndSize(c_str, size) PyUnicode_DecodeUTF8(c_str, size, NULL) #else #define __Pyx_PyUnicode_FromStringAndSize(c_str, size) PyUnicode_Decode(c_str, size, __PYX_DEFAULT_STRING_ENCODING, NULL) #if __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT static char* __PYX_DEFAULT_STRING_ENCODING; static int __Pyx_init_sys_getdefaultencoding_params(void) { PyObject* sys; PyObject* default_encoding = NULL; char* default_encoding_c; sys = PyImport_ImportModule("sys"); if (!sys) goto bad; default_encoding = PyObject_CallMethod(sys, (char*) (const char*) "getdefaultencoding", NULL); Py_DECREF(sys); if (!default_encoding) goto bad; default_encoding_c = PyBytes_AsString(default_encoding); if (!default_encoding_c) goto bad; __PYX_DEFAULT_STRING_ENCODING = (char*) malloc(strlen(default_encoding_c)); if (!__PYX_DEFAULT_STRING_ENCODING) goto bad; strcpy(__PYX_DEFAULT_STRING_ENCODING, default_encoding_c); Py_DECREF(default_encoding); return 0; bad: Py_XDECREF(default_encoding); return -1; } #endif #endif /* Test for GCC > 2.95 */ #if defined(__GNUC__) && (__GNUC__ > 2 || (__GNUC__ == 2 && (__GNUC_MINOR__ > 95))) #define likely(x) __builtin_expect(!!(x), 1) #define unlikely(x) __builtin_expect(!!(x), 0) #else /* !__GNUC__ or GCC < 2.95 */ #define likely(x) (x) #define unlikely(x) (x) #endif /* __GNUC__ */ static PyObject *__pyx_m; static PyObject *__pyx_d; static PyObject *__pyx_b; static PyObject *__pyx_empty_tuple; static PyObject *__pyx_empty_bytes; static PyObject *__pyx_empty_unicode; static int __pyx_lineno; static int __pyx_clineno = 0; static const char * __pyx_cfilenm= __FILE__; static const char *__pyx_filename; static const char *__pyx_f[] = { "src/pygame_sdl2/surface.pyx", "src/pygame_sdl2/color.pxd", "src/pygame_sdl2/rect.pxd", }; /*--- Type declarations ---*/ struct __pyx_obj_11pygame_sdl2_5color_Color; struct __pyx_obj_11pygame_sdl2_4rect_Rect; struct __pyx_obj_11pygame_sdl2_7surface_Surface; struct __pyx_opt_args_11pygame_sdl2_4rect_to_sdl_rect; /* "pygame_sdl2/rect.pxd":31 * * * cdef int to_sdl_rect(rectlike, SDL_Rect *rect, argname=*) except -1 # <<<<<<<<<<<<<< */ struct __pyx_opt_args_11pygame_sdl2_4rect_to_sdl_rect { int __pyx_n; PyObject *argname; }; /* "pygame_sdl2/color.pxd":26 * cdef to_sdl_color(color, SDL_Color *out) * * cdef class Color: # <<<<<<<<<<<<<< * # Allow weak references. * cdef object __weakref__ */ struct __pyx_obj_11pygame_sdl2_5color_Color { PyObject_HEAD struct __pyx_vtabstruct_11pygame_sdl2_5color_Color *__pyx_vtab; PyObject *__weakref__; Uint8 r; Uint8 g; Uint8 b; Uint8 a; uint8_t length; }; /* "pygame_sdl2/rect.pxd":21 * from sdl2 cimport * * * cdef class Rect: # <<<<<<<<<<<<<< * # Allow weak references. * cdef object __weakref__ */ struct __pyx_obj_11pygame_sdl2_4rect_Rect { PyObject_HEAD PyObject *__weakref__; int x; int y; int w; int h; }; /* "pygame_sdl2/surface.pxd":23 * from sdl2 cimport SDL_Surface * * cdef class Surface: # <<<<<<<<<<<<<< * # Allow weak references. * cdef object __weakref__ */ struct __pyx_obj_11pygame_sdl2_7surface_Surface { PyObject_HEAD struct __pyx_vtabstruct_11pygame_sdl2_7surface_Surface *__pyx_vtab; PyObject *__weakref__; SDL_Surface *surface; int owns_surface; int window_surface; PyObject *locklist; struct __pyx_obj_11pygame_sdl2_7surface_Surface *parent; struct __pyx_obj_11pygame_sdl2_7surface_Surface *root; int offset_x; int offset_y; PyObject *get_window_flags; int has_alpha; }; /* "pygame_sdl2/color.pxd":26 * cdef to_sdl_color(color, SDL_Color *out) * * cdef class Color: # <<<<<<<<<<<<<< * # Allow weak references. * cdef object __weakref__ */ struct __pyx_vtabstruct_11pygame_sdl2_5color_Color { PyObject *(*from_rgba)(struct __pyx_obj_11pygame_sdl2_5color_Color *, Uint8, Uint8, Uint8, Uint8); PyObject *(*from_name)(struct __pyx_obj_11pygame_sdl2_5color_Color *, PyObject *); PyObject *(*from_hex)(struct __pyx_obj_11pygame_sdl2_5color_Color *, PyObject *); }; static struct __pyx_vtabstruct_11pygame_sdl2_5color_Color *__pyx_vtabptr_11pygame_sdl2_5color_Color; /* "pygame_sdl2/surface.pyx":53 * total_size = 0 * * cdef class Surface: # <<<<<<<<<<<<<< * * def __cinit__(self): */ struct __pyx_vtabstruct_11pygame_sdl2_7surface_Surface { void (*take_surface)(struct __pyx_obj_11pygame_sdl2_7surface_Surface *, SDL_Surface *); }; static struct __pyx_vtabstruct_11pygame_sdl2_7surface_Surface *__pyx_vtabptr_11pygame_sdl2_7surface_Surface; /* --- Runtime support code (head) --- */ /* Refnanny.proto */ #ifndef CYTHON_REFNANNY #define CYTHON_REFNANNY 0 #endif #if CYTHON_REFNANNY typedef struct { void (*INCREF)(void*, PyObject*, int); void (*DECREF)(void*, PyObject*, int); void (*GOTREF)(void*, PyObject*, int); void (*GIVEREF)(void*, PyObject*, int); void* (*SetupContext)(const char*, int, const char*); void (*FinishContext)(void**); } __Pyx_RefNannyAPIStruct; static __Pyx_RefNannyAPIStruct *__Pyx_RefNanny = NULL; static __Pyx_RefNannyAPIStruct *__Pyx_RefNannyImportAPI(const char *modname); #define __Pyx_RefNannyDeclarations void *__pyx_refnanny = NULL; #ifdef WITH_THREAD #define __Pyx_RefNannySetupContext(name, acquire_gil)\ if (acquire_gil) {\ PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure();\ __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), __LINE__, __FILE__);\ PyGILState_Release(__pyx_gilstate_save);\ } else {\ __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), __LINE__, __FILE__);\ } #else #define __Pyx_RefNannySetupContext(name, acquire_gil)\ __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), __LINE__, __FILE__) #endif #define __Pyx_RefNannyFinishContext()\ __Pyx_RefNanny->FinishContext(&__pyx_refnanny) #define __Pyx_INCREF(r) __Pyx_RefNanny->INCREF(__pyx_refnanny, (PyObject *)(r), __LINE__) #define __Pyx_DECREF(r) __Pyx_RefNanny->DECREF(__pyx_refnanny, (PyObject *)(r), __LINE__) #define __Pyx_GOTREF(r) __Pyx_RefNanny->GOTREF(__pyx_refnanny, (PyObject *)(r), __LINE__) #define __Pyx_GIVEREF(r) __Pyx_RefNanny->GIVEREF(__pyx_refnanny, (PyObject *)(r), __LINE__) #define __Pyx_XINCREF(r) do { if((r) != NULL) {__Pyx_INCREF(r); }} while(0) #define __Pyx_XDECREF(r) do { if((r) != NULL) {__Pyx_DECREF(r); }} while(0) #define __Pyx_XGOTREF(r) do { if((r) != NULL) {__Pyx_GOTREF(r); }} while(0) #define __Pyx_XGIVEREF(r) do { if((r) != NULL) {__Pyx_GIVEREF(r);}} while(0) #else #define __Pyx_RefNannyDeclarations #define __Pyx_RefNannySetupContext(name, acquire_gil) #define __Pyx_RefNannyFinishContext() #define __Pyx_INCREF(r) Py_INCREF(r) #define __Pyx_DECREF(r) Py_DECREF(r) #define __Pyx_GOTREF(r) #define __Pyx_GIVEREF(r) #define __Pyx_XINCREF(r) Py_XINCREF(r) #define __Pyx_XDECREF(r) Py_XDECREF(r) #define __Pyx_XGOTREF(r) #define __Pyx_XGIVEREF(r) #endif #define __Pyx_XDECREF_SET(r, v) do {\ PyObject *tmp = (PyObject *) r;\ r = v; __Pyx_XDECREF(tmp);\ } while (0) #define __Pyx_DECREF_SET(r, v) do {\ PyObject *tmp = (PyObject *) r;\ r = v; __Pyx_DECREF(tmp);\ } while (0) #define __Pyx_CLEAR(r) do { PyObject* tmp = ((PyObject*)(r)); r = NULL; __Pyx_DECREF(tmp);} while(0) #define __Pyx_XCLEAR(r) do { if((r) != NULL) {PyObject* tmp = ((PyObject*)(r)); r = NULL; __Pyx_DECREF(tmp);}} while(0) /* PyObjectGetAttrStr.proto */ #if CYTHON_USE_TYPE_SLOTS static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStr(PyObject* obj, PyObject* attr_name) { PyTypeObject* tp = Py_TYPE(obj); if (likely(tp->tp_getattro)) return tp->tp_getattro(obj, attr_name); #if PY_MAJOR_VERSION < 3 if (likely(tp->tp_getattr)) return tp->tp_getattr(obj, PyString_AS_STRING(attr_name)); #endif return PyObject_GetAttr(obj, attr_name); } #else #define __Pyx_PyObject_GetAttrStr(o,n) PyObject_GetAttr(o,n) #endif /* GetBuiltinName.proto */ static PyObject *__Pyx_GetBuiltinName(PyObject *name); /* RaiseArgTupleInvalid.proto */ static void __Pyx_RaiseArgtupleInvalid(const char* func_name, int exact, Py_ssize_t num_min, Py_ssize_t num_max, Py_ssize_t num_found); /* KeywordStringCheck.proto */ static CYTHON_INLINE int __Pyx_CheckKeywordStrings(PyObject *kwdict, const char* function_name, int kw_allowed); /* GetModuleGlobalName.proto */ static CYTHON_INLINE PyObject *__Pyx_GetModuleGlobalName(PyObject *name); /* PyObjectCall.proto */ #if CYTHON_COMPILING_IN_CPYTHON static CYTHON_INLINE PyObject* __Pyx_PyObject_Call(PyObject *func, PyObject *arg, PyObject *kw); #else #define __Pyx_PyObject_Call(func, arg, kw) PyObject_Call(func, arg, kw) #endif /* PyThreadStateGet.proto */ #if CYTHON_FAST_THREAD_STATE #define __Pyx_PyThreadState_declare PyThreadState *__pyx_tstate; #define __Pyx_PyThreadState_assign __pyx_tstate = PyThreadState_GET(); #else #define __Pyx_PyThreadState_declare #define __Pyx_PyThreadState_assign #endif /* PyErrFetchRestore.proto */ #if CYTHON_FAST_THREAD_STATE #define __Pyx_ErrRestoreWithState(type, value, tb) __Pyx_ErrRestoreInState(PyThreadState_GET(), type, value, tb) #define __Pyx_ErrFetchWithState(type, value, tb) __Pyx_ErrFetchInState(PyThreadState_GET(), type, value, tb) #define __Pyx_ErrRestore(type, value, tb) __Pyx_ErrRestoreInState(__pyx_tstate, type, value, tb) #define __Pyx_ErrFetch(type, value, tb) __Pyx_ErrFetchInState(__pyx_tstate, type, value, tb) static CYTHON_INLINE void __Pyx_ErrRestoreInState(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb); static CYTHON_INLINE void __Pyx_ErrFetchInState(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb); #else #define __Pyx_ErrRestoreWithState(type, value, tb) PyErr_Restore(type, value, tb) #define __Pyx_ErrFetchWithState(type, value, tb) PyErr_Fetch(type, value, tb) #define __Pyx_ErrRestore(type, value, tb) PyErr_Restore(type, value, tb) #define __Pyx_ErrFetch(type, value, tb) PyErr_Fetch(type, value, tb) #endif /* WriteUnraisableException.proto */ static void __Pyx_WriteUnraisable(const char *name, int clineno, int lineno, const char *filename, int full_traceback, int nogil); /* RaiseDoubleKeywords.proto */ static void __Pyx_RaiseDoubleKeywordsError(const char* func_name, PyObject* kw_name); /* ParseKeywords.proto */ static int __Pyx_ParseOptionalKeywords(PyObject *kwds, PyObject **argnames[],\ PyObject *kwds2, PyObject *values[], Py_ssize_t num_pos_args,\ const char* function_name); /* RaiseTooManyValuesToUnpack.proto */ static CYTHON_INLINE void __Pyx_RaiseTooManyValuesError(Py_ssize_t expected); /* RaiseNeedMoreValuesToUnpack.proto */ static CYTHON_INLINE void __Pyx_RaiseNeedMoreValuesError(Py_ssize_t index); /* IterFinish.proto */ static CYTHON_INLINE int __Pyx_IterFinish(void); /* UnpackItemEndCheck.proto */ static int __Pyx_IternextUnpackEndCheck(PyObject *retval, Py_ssize_t expected); /* ExtTypeTest.proto */ static CYTHON_INLINE int __Pyx_TypeTest(PyObject *obj, PyTypeObject *type); /* PyCFunctionFastCall.proto */ #if CYTHON_FAST_PYCCALL static CYTHON_INLINE PyObject *__Pyx_PyCFunction_FastCall(PyObject *func, PyObject **args, Py_ssize_t nargs); #else #define __Pyx_PyCFunction_FastCall(func, args, nargs) (assert(0), NULL) #endif /* PyFunctionFastCall.proto */ #if CYTHON_FAST_PYCALL #define __Pyx_PyFunction_FastCall(func, args, nargs)\ __Pyx_PyFunction_FastCallDict((func), (args), (nargs), NULL) #if 1 || PY_VERSION_HEX < 0x030600B1 static PyObject *__Pyx_PyFunction_FastCallDict(PyObject *func, PyObject **args, int nargs, PyObject *kwargs); #else #define __Pyx_PyFunction_FastCallDict(func, args, nargs, kwargs) _PyFunction_FastCallDict(func, args, nargs, kwargs) #endif #endif /* PyObjectCallMethO.proto */ #if CYTHON_COMPILING_IN_CPYTHON static CYTHON_INLINE PyObject* __Pyx_PyObject_CallMethO(PyObject *func, PyObject *arg); #endif /* PyObjectCallOneArg.proto */ static CYTHON_INLINE PyObject* __Pyx_PyObject_CallOneArg(PyObject *func, PyObject *arg); /* PyObjectCallNoArg.proto */ #if CYTHON_COMPILING_IN_CPYTHON static CYTHON_INLINE PyObject* __Pyx_PyObject_CallNoArg(PyObject *func); #else #define __Pyx_PyObject_CallNoArg(func) __Pyx_PyObject_Call(func, __pyx_empty_tuple, NULL) #endif /* RaiseException.proto */ static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, PyObject *cause); /* ArgTypeTest.proto */ static CYTHON_INLINE int __Pyx_ArgTypeTest(PyObject *obj, PyTypeObject *type, int none_allowed, const char *name, int exact); /* GetItemInt.proto */ #define __Pyx_GetItemInt(o, i, type, is_signed, to_py_func, is_list, wraparound, boundscheck)\ (__Pyx_fits_Py_ssize_t(i, type, is_signed) ?\ __Pyx_GetItemInt_Fast(o, (Py_ssize_t)i, is_list, wraparound, boundscheck) :\ (is_list ? (PyErr_SetString(PyExc_IndexError, "list index out of range"), (PyObject*)NULL) :\ __Pyx_GetItemInt_Generic(o, to_py_func(i)))) #define __Pyx_GetItemInt_List(o, i, type, is_signed, to_py_func, is_list, wraparound, boundscheck)\ (__Pyx_fits_Py_ssize_t(i, type, is_signed) ?\ __Pyx_GetItemInt_List_Fast(o, (Py_ssize_t)i, wraparound, boundscheck) :\ (PyErr_SetString(PyExc_IndexError, "list index out of range"), (PyObject*)NULL)) static CYTHON_INLINE PyObject *__Pyx_GetItemInt_List_Fast(PyObject *o, Py_ssize_t i, int wraparound, int boundscheck); #define __Pyx_GetItemInt_Tuple(o, i, type, is_signed, to_py_func, is_list, wraparound, boundscheck)\ (__Pyx_fits_Py_ssize_t(i, type, is_signed) ?\ __Pyx_GetItemInt_Tuple_Fast(o, (Py_ssize_t)i, wraparound, boundscheck) :\ (PyErr_SetString(PyExc_IndexError, "tuple index out of range"), (PyObject*)NULL)) static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Tuple_Fast(PyObject *o, Py_ssize_t i, int wraparound, int boundscheck); static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Generic(PyObject *o, PyObject* j); static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Fast(PyObject *o, Py_ssize_t i, int is_list, int wraparound, int boundscheck); /* ListAppend.proto */ #if CYTHON_USE_PYLIST_INTERNALS && CYTHON_ASSUME_SAFE_MACROS static CYTHON_INLINE int __Pyx_PyList_Append(PyObject* list, PyObject* x) { PyListObject* L = (PyListObject*) list; Py_ssize_t len = Py_SIZE(list); if (likely(L->allocated > len) & likely(len > (L->allocated >> 1))) { Py_INCREF(x); PyList_SET_ITEM(list, len, x); Py_SIZE(list) = len+1; return 0; } return PyList_Append(list, x); } #else #define __Pyx_PyList_Append(L,x) PyList_Append(L,x) #endif /* PyObjectCallMethod1.proto */ static PyObject* __Pyx_PyObject_CallMethod1(PyObject* obj, PyObject* method_name, PyObject* arg); /* append.proto */ static CYTHON_INLINE int __Pyx_PyObject_Append(PyObject* L, PyObject* x); /* py_dict_items.proto */ static CYTHON_INLINE PyObject* __Pyx_PyDict_Items(PyObject* d); /* UnpackUnboundCMethod.proto */ typedef struct { PyObject *type; PyObject **method_name; PyCFunction func; PyObject *method; int flag; } __Pyx_CachedCFunction; /* CallUnboundCMethod0.proto */ static PyObject* __Pyx__CallUnboundCMethod0(__Pyx_CachedCFunction* cfunc, PyObject* self); #if CYTHON_COMPILING_IN_CPYTHON #define __Pyx_CallUnboundCMethod0(cfunc, self)\ ((likely((cfunc)->func)) ?\ (likely((cfunc)->flag == METH_NOARGS) ? (*((cfunc)->func))(self, NULL) :\ (likely((cfunc)->flag == (METH_VARARGS | METH_KEYWORDS)) ? ((*(PyCFunctionWithKeywords)(cfunc)->func)(self, __pyx_empty_tuple, NULL)) :\ ((cfunc)->flag == METH_VARARGS ? (*((cfunc)->func))(self, __pyx_empty_tuple) :\ (PY_VERSION_HEX >= 0x030600B1 && (cfunc)->flag == METH_FASTCALL ? (*(__Pyx_PyCFunctionFast)(cfunc)->func)(self, &PyTuple_GET_ITEM(__pyx_empty_tuple, 0), 0, NULL) :\ __Pyx__CallUnboundCMethod0(cfunc, self))))) :\ __Pyx__CallUnboundCMethod0(cfunc, self)) #else #define __Pyx_CallUnboundCMethod0(cfunc, self) __Pyx__CallUnboundCMethod0(cfunc, self) #endif /* SetVTable.proto */ static int __Pyx_SetVtable(PyObject *dict, void *vtable); /* GetVTable.proto */ static void* __Pyx_GetVtable(PyObject *dict); /* Import.proto */ static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list, int level); /* ImportFrom.proto */ static PyObject* __Pyx_ImportFrom(PyObject* module, PyObject* name); /* CodeObjectCache.proto */ typedef struct { PyCodeObject* code_object; int code_line; } __Pyx_CodeObjectCacheEntry; struct __Pyx_CodeObjectCache { int count; int max_count; __Pyx_CodeObjectCacheEntry* entries; }; static struct __Pyx_CodeObjectCache __pyx_code_cache = {0,0,NULL}; static int __pyx_bisect_code_objects(__Pyx_CodeObjectCacheEntry* entries, int count, int code_line); static PyCodeObject *__pyx_find_code_object(int code_line); static void __pyx_insert_code_object(int code_line, PyCodeObject* code_object); /* AddTraceback.proto */ static void __Pyx_AddTraceback(const char *funcname, int c_line, int py_line, const char *filename); /* CIntToPy.proto */ static CYTHON_INLINE PyObject* __Pyx_PyInt_From_int(int value); /* CIntToPy.proto */ static CYTHON_INLINE PyObject* __Pyx_PyInt_From_uint32_t(uint32_t value); /* ForceInitThreads.proto */ #ifndef __PYX_FORCE_INIT_THREADS #define __PYX_FORCE_INIT_THREADS 0 #endif /* CIntToPy.proto */ static CYTHON_INLINE PyObject* __Pyx_PyInt_From_uint8_t(uint8_t value); /* CIntToPy.proto */ static CYTHON_INLINE PyObject* __Pyx_PyInt_From_long(long value); /* CIntToPy.proto */ static CYTHON_INLINE PyObject* __Pyx_PyInt_From_uint64_t(uint64_t value); /* CIntFromPy.proto */ static CYTHON_INLINE int __Pyx_PyInt_As_int(PyObject *); /* CIntFromPy.proto */ static CYTHON_INLINE uint32_t __Pyx_PyInt_As_uint32_t(PyObject *); /* CIntFromPy.proto */ static CYTHON_INLINE uint8_t __Pyx_PyInt_As_uint8_t(PyObject *); /* CIntFromPy.proto */ static CYTHON_INLINE long __Pyx_PyInt_As_long(PyObject *); /* CheckBinaryVersion.proto */ static int __Pyx_check_binary_version(void); /* FunctionExport.proto */ static int __Pyx_ExportFunction(const char *name, void (*f)(void), const char *sig); /* PyIdentifierFromString.proto */ #if !defined(__Pyx_PyIdentifier_FromString) #if PY_MAJOR_VERSION < 3 #define __Pyx_PyIdentifier_FromString(s) PyString_FromString(s) #else #define __Pyx_PyIdentifier_FromString(s) PyUnicode_FromString(s) #endif #endif /* ModuleImport.proto */ static PyObject *__Pyx_ImportModule(const char *name); /* TypeImport.proto */ static PyTypeObject *__Pyx_ImportType(const char *module_name, const char *class_name, size_t size, int strict); /* FunctionImport.proto */ static int __Pyx_ImportFunction(PyObject *module, const char *funcname, void (**f)(void), const char *sig); /* InitStrings.proto */ static int __Pyx_InitStrings(__Pyx_StringTabEntry *t); static void __pyx_f_11pygame_sdl2_7surface_7Surface_take_surface(struct __pyx_obj_11pygame_sdl2_7surface_Surface *__pyx_v_self, SDL_Surface *__pyx_v_surface); /* proto*/ /* Module declarations from 'libc.stdint' */ /* Module declarations from 'libc.string' */ /* Module declarations from 'libc.stdio' */ /* Module declarations from 'libc.stddef' */ /* Module declarations from 'sdl2' */ /* Module declarations from 'pygame_sdl2.color' */ static PyTypeObject *__pyx_ptype_11pygame_sdl2_5color_Color = 0; static Uint32 (*__pyx_f_11pygame_sdl2_5color_map_color)(SDL_Surface *, PyObject *); /*proto*/ static PyObject *(*__pyx_f_11pygame_sdl2_5color_get_color)(Uint32, SDL_Surface *); /*proto*/ /* Module declarations from 'pygame_sdl2.rect' */ static PyTypeObject *__pyx_ptype_11pygame_sdl2_4rect_Rect = 0; static int (*__pyx_f_11pygame_sdl2_4rect_to_sdl_rect)(PyObject *, SDL_Rect *, struct __pyx_opt_args_11pygame_sdl2_4rect_to_sdl_rect *__pyx_optional_args); /*proto*/ /* Module declarations from 'pygame_sdl2.surface' */ static PyTypeObject *__pyx_ptype_11pygame_sdl2_7surface_Surface = 0; static void __pyx_f_11pygame_sdl2_7surface_move_pixels(Uint8 *, Uint8 *, int, int, int, int); /*proto*/ static SDL_Surface *__pyx_f_11pygame_sdl2_7surface_PySurface_AsSurface(PyObject *); /*proto*/ static PyObject *__pyx_f_11pygame_sdl2_7surface_PySurface_New(SDL_Surface *); /*proto*/ #define __Pyx_MODULE_NAME "pygame_sdl2.surface" int __pyx_module_is_main_pygame_sdl2__surface = 0; /* Implementation of 'pygame_sdl2.surface' */ static PyObject *__pyx_builtin_IndexError; static PyObject *__pyx_builtin_ValueError; static const char __pyx_k_2[] = "2"; static const char __pyx_k_dx[] = "dx"; static const char __pyx_k_dy[] = "dy"; static const char __pyx_k_pos[] = "pos"; static const char __pyx_k_Rect[] = "Rect"; static const char __pyx_k_area[] = "area"; static const char __pyx_k_clip[] = "clip"; static const char __pyx_k_dest[] = "dest"; static const char __pyx_k_kind[] = "kind"; static const char __pyx_k_lock[] = "lock"; static const char __pyx_k_main[] = "__main__"; static const char __pyx_k_rect[] = "rect"; static const char __pyx_k_size[] = "size"; static const char __pyx_k_test[] = "__test__"; static const char __pyx_k_warn[] = "warn"; static const char __pyx_k_color[] = "color"; static const char __pyx_k_depth[] = "depth"; static const char __pyx_k_error[] = "error"; static const char __pyx_k_flags[] = "flags"; static const char __pyx_k_items[] = "items"; static const char __pyx_k_masks[] = "masks"; static const char __pyx_k_value[] = "value"; static const char __pyx_k_append[] = "append"; static const char __pyx_k_format[] = "format"; static const char __pyx_k_import[] = "__import__"; static const char __pyx_k_remove[] = "remove"; static const char __pyx_k_source[] = "source"; static const char __pyx_k_unlock[] = "unlock"; static const char __pyx_k_convert[] = "convert"; static const char __pyx_k_display[] = "display"; static const char __pyx_k_surface[] = "surface"; static const char __pyx_k_SRCALPHA[] = "SRCALPHA"; static const char __pyx_k_get_rect[] = "get_rect"; static const char __pyx_k_get_size[] = "get_size"; static const char __pyx_k_warnings[] = "warnings"; static const char __pyx_k_get_alpha[] = "get_alpha"; static const char __pyx_k_min_alpha[] = "min_alpha"; static const char __pyx_k_set_alpha[] = "set_alpha"; static const char __pyx_k_IndexError[] = "IndexError"; static const char __pyx_k_ValueError[] = "ValueError"; static const char __pyx_k_pyx_vtable[] = "__pyx_vtable__"; static const char __pyx_k_subsurface[] = "subsurface"; static const char __pyx_k_total_size[] = "total_size"; static const char __pyx_k_Surface_x_x[] = ""; static const char __pyx_k_get_surface[] = "get_surface"; static const char __pyx_k_pygame_sdl2[] = "pygame_sdl2"; static const char __pyx_k_convert_alpha[] = "convert_alpha"; static const char __pyx_k_special_flags[] = "special_flags"; static const char __pyx_k_pygame_sdl2_rect[] = "pygame_sdl2.rect"; static const char __pyx_k_pygame_sdl2_error[] = "pygame_sdl2.error"; static const char __pyx_k_pygame_sdl2_locals[] = "pygame_sdl2.locals"; static const char __pyx_k_Position_outside_surface[] = "Position outside surface."; static const char __pyx_k_No_video_mode_has_been_set[] = "No video mode has been set."; static const char __pyx_k_Memory_leak_via_Surface_in_pygam[] = "Memory leak via Surface in pygame_sdl2."; static const char __pyx_k_Surface_get_view_is_not_supporte[] = "Surface.get_view is not supported."; static const char __pyx_k_Surface_has_unsupported_bytesize[] = "Surface has unsupported bytesize."; static const char __pyx_k_Surface_set_masks_is_not_support[] = "Surface.set_masks is not supported."; static const char __pyx_k_Surface_set_shifts_is_not_suppor[] = "Surface.set_shifts is not supported."; static const char __pyx_k_subsurface_rectangle_outside_sur[] = "subsurface rectangle outside surface area."; static const char __pyx_k_subsurface_size_must_be_non_nega[] = "subsurface size must be non-negative."; static PyObject *__pyx_kp_s_2; static PyObject *__pyx_n_s_IndexError; static PyObject *__pyx_kp_s_Memory_leak_via_Surface_in_pygam; static PyObject *__pyx_kp_s_No_video_mode_has_been_set; static PyObject *__pyx_kp_s_Position_outside_surface; static PyObject *__pyx_n_s_Rect; static PyObject *__pyx_n_s_SRCALPHA; static PyObject *__pyx_kp_s_Surface_get_view_is_not_supporte; static PyObject *__pyx_kp_s_Surface_has_unsupported_bytesize; static PyObject *__pyx_kp_s_Surface_set_masks_is_not_support; static PyObject *__pyx_kp_s_Surface_set_shifts_is_not_suppor; static PyObject *__pyx_kp_s_Surface_x_x; static PyObject *__pyx_n_s_ValueError; static PyObject *__pyx_n_s_append; static PyObject *__pyx_n_s_area; static PyObject *__pyx_n_s_clip; static PyObject *__pyx_n_s_color; static PyObject *__pyx_n_s_convert; static PyObject *__pyx_n_s_convert_alpha; static PyObject *__pyx_n_s_depth; static PyObject *__pyx_n_s_dest; static PyObject *__pyx_n_s_display; static PyObject *__pyx_n_s_dx; static PyObject *__pyx_n_s_dy; static PyObject *__pyx_n_s_error; static PyObject *__pyx_n_s_flags; static PyObject *__pyx_n_s_format; static PyObject *__pyx_n_s_get_alpha; static PyObject *__pyx_n_s_get_rect; static PyObject *__pyx_n_s_get_size; static PyObject *__pyx_n_s_get_surface; static PyObject *__pyx_n_s_import; static PyObject *__pyx_n_s_items; static PyObject *__pyx_n_s_kind; static PyObject *__pyx_n_s_lock; static PyObject *__pyx_n_s_main; static PyObject *__pyx_n_s_masks; static PyObject *__pyx_n_s_min_alpha; static PyObject *__pyx_n_s_pos; static PyObject *__pyx_n_s_pygame_sdl2; static PyObject *__pyx_n_s_pygame_sdl2_error; static PyObject *__pyx_n_s_pygame_sdl2_locals; static PyObject *__pyx_n_s_pygame_sdl2_rect; static PyObject *__pyx_n_s_pyx_vtable; static PyObject *__pyx_n_s_rect; static PyObject *__pyx_n_s_remove; static PyObject *__pyx_n_s_set_alpha; static PyObject *__pyx_n_s_size; static PyObject *__pyx_n_s_source; static PyObject *__pyx_n_s_special_flags; static PyObject *__pyx_n_s_subsurface; static PyObject *__pyx_kp_s_subsurface_rectangle_outside_sur; static PyObject *__pyx_kp_s_subsurface_size_must_be_non_nega; static PyObject *__pyx_n_s_surface; static PyObject *__pyx_n_s_test; static PyObject *__pyx_n_s_total_size; static PyObject *__pyx_n_s_unlock; static PyObject *__pyx_n_s_value; static PyObject *__pyx_n_s_warn; static PyObject *__pyx_n_s_warnings; static int __pyx_pf_11pygame_sdl2_7surface_7Surface___cinit__(struct __pyx_obj_11pygame_sdl2_7surface_Surface *__pyx_v_self); /* proto */ static void __pyx_pf_11pygame_sdl2_7surface_7Surface_2__dealloc__(struct __pyx_obj_11pygame_sdl2_7surface_Surface *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_7surface_7Surface_4__sizeof__(struct __pyx_obj_11pygame_sdl2_7surface_Surface *__pyx_v_self); /* proto */ static int __pyx_pf_11pygame_sdl2_7surface_7Surface_6__init__(struct __pyx_obj_11pygame_sdl2_7surface_Surface *__pyx_v_self, PyObject *__pyx_v_size, PyObject *__pyx_v_flags, PyObject *__pyx_v_depth, PyObject *__pyx_v_masks); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_7surface_7Surface_8__repr__(struct __pyx_obj_11pygame_sdl2_7surface_Surface *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_7surface_7Surface_10blit(struct __pyx_obj_11pygame_sdl2_7surface_Surface *__pyx_v_self, struct __pyx_obj_11pygame_sdl2_7surface_Surface *__pyx_v_source, PyObject *__pyx_v_dest, PyObject *__pyx_v_area, int __pyx_v_special_flags); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_7surface_7Surface_12convert(struct __pyx_obj_11pygame_sdl2_7surface_Surface *__pyx_v_self, PyObject *__pyx_v_surface); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_7surface_7Surface_14convert_alpha(struct __pyx_obj_11pygame_sdl2_7surface_Surface *__pyx_v_self, struct __pyx_obj_11pygame_sdl2_7surface_Surface *__pyx_v_surface); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_7surface_7Surface_16copy(struct __pyx_obj_11pygame_sdl2_7surface_Surface *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_7surface_7Surface_18fill(struct __pyx_obj_11pygame_sdl2_7surface_Surface *__pyx_v_self, PyObject *__pyx_v_color, PyObject *__pyx_v_rect, CYTHON_UNUSED PyObject *__pyx_v_special_flags); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_7surface_7Surface_20scroll(struct __pyx_obj_11pygame_sdl2_7surface_Surface *__pyx_v_self, int __pyx_v_dx, int __pyx_v_dy); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_7surface_7Surface_22set_colorkey(struct __pyx_obj_11pygame_sdl2_7surface_Surface *__pyx_v_self, PyObject *__pyx_v_color, CYTHON_UNUSED PyObject *__pyx_v_flags); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_7surface_7Surface_24get_colorkey(struct __pyx_obj_11pygame_sdl2_7surface_Surface *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_7surface_7Surface_26set_alpha(struct __pyx_obj_11pygame_sdl2_7surface_Surface *__pyx_v_self, PyObject *__pyx_v_value, CYTHON_UNUSED PyObject *__pyx_v_flags); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_7surface_7Surface_28get_alpha(struct __pyx_obj_11pygame_sdl2_7surface_Surface *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_7surface_7Surface_30lock(struct __pyx_obj_11pygame_sdl2_7surface_Surface *__pyx_v_self, PyObject *__pyx_v_lock); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_7surface_7Surface_32unlock(struct __pyx_obj_11pygame_sdl2_7surface_Surface *__pyx_v_self, PyObject *__pyx_v_lock); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_7surface_7Surface_34mustlock(struct __pyx_obj_11pygame_sdl2_7surface_Surface *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_7surface_7Surface_36get_locked(struct __pyx_obj_11pygame_sdl2_7surface_Surface *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_7surface_7Surface_38get_locks(struct __pyx_obj_11pygame_sdl2_7surface_Surface *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_7surface_7Surface_40get_at(struct __pyx_obj_11pygame_sdl2_7surface_Surface *__pyx_v_self, PyObject *__pyx_v_pos); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_7surface_7Surface_42set_at(struct __pyx_obj_11pygame_sdl2_7surface_Surface *__pyx_v_self, PyObject *__pyx_v_pos, PyObject *__pyx_v_color); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_7surface_7Surface_44get_at_mapped(struct __pyx_obj_11pygame_sdl2_7surface_Surface *__pyx_v_self, PyObject *__pyx_v_pos); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_7surface_7Surface_46map_rgb(struct __pyx_obj_11pygame_sdl2_7surface_Surface *__pyx_v_self, PyObject *__pyx_v_color); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_7surface_7Surface_48unmap_rgb(struct __pyx_obj_11pygame_sdl2_7surface_Surface *__pyx_v_self, PyObject *__pyx_v_pixel); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_7surface_7Surface_50set_clip(struct __pyx_obj_11pygame_sdl2_7surface_Surface *__pyx_v_self, PyObject *__pyx_v_rect); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_7surface_7Surface_52get_clip(struct __pyx_obj_11pygame_sdl2_7surface_Surface *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_7surface_7Surface_54subsurface(struct __pyx_obj_11pygame_sdl2_7surface_Surface *__pyx_v_self, PyObject *__pyx_v_args); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_7surface_7Surface_56get_parent(struct __pyx_obj_11pygame_sdl2_7surface_Surface *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_7surface_7Surface_58get_abs_parent(struct __pyx_obj_11pygame_sdl2_7surface_Surface *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_7surface_7Surface_60get_offset(struct __pyx_obj_11pygame_sdl2_7surface_Surface *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_7surface_7Surface_62get_abs_offset(struct __pyx_obj_11pygame_sdl2_7surface_Surface *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_7surface_7Surface_64get_size(struct __pyx_obj_11pygame_sdl2_7surface_Surface *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_7surface_7Surface_66get_width(struct __pyx_obj_11pygame_sdl2_7surface_Surface *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_7surface_7Surface_68get_height(struct __pyx_obj_11pygame_sdl2_7surface_Surface *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_7surface_7Surface_70get_rect(struct __pyx_obj_11pygame_sdl2_7surface_Surface *__pyx_v_self, PyObject *__pyx_v_kwargs); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_7surface_7Surface_72get_bitsize(struct __pyx_obj_11pygame_sdl2_7surface_Surface *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_7surface_7Surface_74get_bytesize(struct __pyx_obj_11pygame_sdl2_7surface_Surface *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_7surface_7Surface_76get_flags(struct __pyx_obj_11pygame_sdl2_7surface_Surface *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_7surface_7Surface_78get_pitch(struct __pyx_obj_11pygame_sdl2_7surface_Surface *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_7surface_7Surface_80get_masks(struct __pyx_obj_11pygame_sdl2_7surface_Surface *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_7surface_7Surface_82set_masks(CYTHON_UNUSED struct __pyx_obj_11pygame_sdl2_7surface_Surface *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v_masks); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_7surface_7Surface_84get_shifts(struct __pyx_obj_11pygame_sdl2_7surface_Surface *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_7surface_7Surface_86set_shifts(CYTHON_UNUSED struct __pyx_obj_11pygame_sdl2_7surface_Surface *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v_shifts); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_7surface_7Surface_88get_shifts(struct __pyx_obj_11pygame_sdl2_7surface_Surface *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_7surface_7Surface_90get_losses(struct __pyx_obj_11pygame_sdl2_7surface_Surface *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_7surface_7Surface_92get_bounding_rect(struct __pyx_obj_11pygame_sdl2_7surface_Surface *__pyx_v_self, PyObject *__pyx_v_min_alpha); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_7surface_7Surface_94get_view(CYTHON_UNUSED struct __pyx_obj_11pygame_sdl2_7surface_Surface *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v_kind); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_7surface_7Surface_96get_buffer(struct __pyx_obj_11pygame_sdl2_7surface_Surface *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_7surface_7Surface_15_pixels_address___get__(struct __pyx_obj_11pygame_sdl2_7surface_Surface *__pyx_v_self); /* proto */ static PyObject *__pyx_tp_new_11pygame_sdl2_7surface_Surface(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ static __Pyx_CachedCFunction __pyx_umethod_PyDict_Type_items = {0, &__pyx_n_s_items, 0, 0, 0}; static PyObject *__pyx_int_0; static PyObject *__pyx_int_1; static PyObject *__pyx_int_32; static PyObject *__pyx_int_255; static PyObject *__pyx_int_16843009; static PyObject *__pyx_int_4294967295; static PyObject *__pyx_tuple_; static PyObject *__pyx_tuple__2; static PyObject *__pyx_tuple__3; static PyObject *__pyx_tuple__4; static PyObject *__pyx_tuple__5; static PyObject *__pyx_tuple__6; static PyObject *__pyx_tuple__7; static PyObject *__pyx_tuple__8; static PyObject *__pyx_tuple__9; static PyObject *__pyx_tuple__10; static PyObject *__pyx_tuple__11; static PyObject *__pyx_tuple__12; static PyObject *__pyx_tuple__13; static PyObject *__pyx_tuple__14; static PyObject *__pyx_tuple__15; static PyObject *__pyx_tuple__16; static PyObject *__pyx_tuple__17; static PyObject *__pyx_tuple__18; static PyObject *__pyx_tuple__19; static PyObject *__pyx_tuple__20; static PyObject *__pyx_tuple__21; /* "pygame_sdl2/surface.pyx":37 * SDL_Surface * dst, SDL_Rect * dstrect, int the_args); * * cdef void move_pixels(Uint8 *src, Uint8 *dst, int h, int span, int srcpitch, int dstpitch) nogil: # <<<<<<<<<<<<<< * if src < dst: * src += (h - 1) * srcpitch; */ static void __pyx_f_11pygame_sdl2_7surface_move_pixels(Uint8 *__pyx_v_src, Uint8 *__pyx_v_dst, int __pyx_v_h, int __pyx_v_span, int __pyx_v_srcpitch, int __pyx_v_dstpitch) { int __pyx_t_1; /* "pygame_sdl2/surface.pyx":38 * * cdef void move_pixels(Uint8 *src, Uint8 *dst, int h, int span, int srcpitch, int dstpitch) nogil: * if src < dst: # <<<<<<<<<<<<<< * src += (h - 1) * srcpitch; * dst += (h - 1) * dstpitch; */ __pyx_t_1 = ((__pyx_v_src < __pyx_v_dst) != 0); if (__pyx_t_1) { /* "pygame_sdl2/surface.pyx":39 * cdef void move_pixels(Uint8 *src, Uint8 *dst, int h, int span, int srcpitch, int dstpitch) nogil: * if src < dst: * src += (h - 1) * srcpitch; # <<<<<<<<<<<<<< * dst += (h - 1) * dstpitch; * srcpitch = -srcpitch; */ __pyx_v_src = (__pyx_v_src + ((__pyx_v_h - 1) * __pyx_v_srcpitch)); /* "pygame_sdl2/surface.pyx":40 * if src < dst: * src += (h - 1) * srcpitch; * dst += (h - 1) * dstpitch; # <<<<<<<<<<<<<< * srcpitch = -srcpitch; * dstpitch = -dstpitch; */ __pyx_v_dst = (__pyx_v_dst + ((__pyx_v_h - 1) * __pyx_v_dstpitch)); /* "pygame_sdl2/surface.pyx":41 * src += (h - 1) * srcpitch; * dst += (h - 1) * dstpitch; * srcpitch = -srcpitch; # <<<<<<<<<<<<<< * dstpitch = -dstpitch; * */ __pyx_v_srcpitch = (-__pyx_v_srcpitch); /* "pygame_sdl2/surface.pyx":42 * dst += (h - 1) * dstpitch; * srcpitch = -srcpitch; * dstpitch = -dstpitch; # <<<<<<<<<<<<<< * * while h: */ __pyx_v_dstpitch = (-__pyx_v_dstpitch); /* "pygame_sdl2/surface.pyx":38 * * cdef void move_pixels(Uint8 *src, Uint8 *dst, int h, int span, int srcpitch, int dstpitch) nogil: * if src < dst: # <<<<<<<<<<<<<< * src += (h - 1) * srcpitch; * dst += (h - 1) * dstpitch; */ } /* "pygame_sdl2/surface.pyx":44 * dstpitch = -dstpitch; * * while h: # <<<<<<<<<<<<<< * h -= 1 * memmove(dst, src, span); */ while (1) { __pyx_t_1 = (__pyx_v_h != 0); if (!__pyx_t_1) break; /* "pygame_sdl2/surface.pyx":45 * * while h: * h -= 1 # <<<<<<<<<<<<<< * memmove(dst, src, span); * src += srcpitch; */ __pyx_v_h = (__pyx_v_h - 1); /* "pygame_sdl2/surface.pyx":46 * while h: * h -= 1 * memmove(dst, src, span); # <<<<<<<<<<<<<< * src += srcpitch; * dst += dstpitch; */ memmove(__pyx_v_dst, __pyx_v_src, __pyx_v_span); /* "pygame_sdl2/surface.pyx":47 * h -= 1 * memmove(dst, src, span); * src += srcpitch; # <<<<<<<<<<<<<< * dst += dstpitch; * */ __pyx_v_src = (__pyx_v_src + __pyx_v_srcpitch); /* "pygame_sdl2/surface.pyx":48 * memmove(dst, src, span); * src += srcpitch; * dst += dstpitch; # <<<<<<<<<<<<<< * * # The total size of all allocated surfaces */ __pyx_v_dst = (__pyx_v_dst + __pyx_v_dstpitch); } /* "pygame_sdl2/surface.pyx":37 * SDL_Surface * dst, SDL_Rect * dstrect, int the_args); * * cdef void move_pixels(Uint8 *src, Uint8 *dst, int h, int span, int srcpitch, int dstpitch) nogil: # <<<<<<<<<<<<<< * if src < dst: * src += (h - 1) * srcpitch; */ /* function exit code */ } /* "pygame_sdl2/surface.pyx":55 * cdef class Surface: * * def __cinit__(self): # <<<<<<<<<<<<<< * self.surface = NULL * self.owns_surface = False */ /* Python wrapper */ static int __pyx_pw_11pygame_sdl2_7surface_7Surface_1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static int __pyx_pw_11pygame_sdl2_7surface_7Surface_1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__cinit__ (wrapper)", 0); if (unlikely(PyTuple_GET_SIZE(__pyx_args) > 0)) { __Pyx_RaiseArgtupleInvalid("__cinit__", 1, 0, 0, PyTuple_GET_SIZE(__pyx_args)); return -1;} if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "__cinit__", 0))) return -1; __pyx_r = __pyx_pf_11pygame_sdl2_7surface_7Surface___cinit__(((struct __pyx_obj_11pygame_sdl2_7surface_Surface *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static int __pyx_pf_11pygame_sdl2_7surface_7Surface___cinit__(struct __pyx_obj_11pygame_sdl2_7surface_Surface *__pyx_v_self) { int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__cinit__", 0); /* "pygame_sdl2/surface.pyx":56 * * def __cinit__(self): * self.surface = NULL # <<<<<<<<<<<<<< * self.owns_surface = False * self.window_surface = False */ __pyx_v_self->surface = NULL; /* "pygame_sdl2/surface.pyx":57 * def __cinit__(self): * self.surface = NULL * self.owns_surface = False # <<<<<<<<<<<<<< * self.window_surface = False * self.has_alpha = False */ __pyx_v_self->owns_surface = 0; /* "pygame_sdl2/surface.pyx":58 * self.surface = NULL * self.owns_surface = False * self.window_surface = False # <<<<<<<<<<<<<< * self.has_alpha = False * */ __pyx_v_self->window_surface = 0; /* "pygame_sdl2/surface.pyx":59 * self.owns_surface = False * self.window_surface = False * self.has_alpha = False # <<<<<<<<<<<<<< * * def __dealloc__(self): */ __pyx_v_self->has_alpha = 0; /* "pygame_sdl2/surface.pyx":55 * cdef class Surface: * * def __cinit__(self): # <<<<<<<<<<<<<< * self.surface = NULL * self.owns_surface = False */ /* function exit code */ __pyx_r = 0; __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/surface.pyx":61 * self.has_alpha = False * * def __dealloc__(self): # <<<<<<<<<<<<<< * global total_size * */ /* Python wrapper */ static void __pyx_pw_11pygame_sdl2_7surface_7Surface_3__dealloc__(PyObject *__pyx_v_self); /*proto*/ static void __pyx_pw_11pygame_sdl2_7surface_7Surface_3__dealloc__(PyObject *__pyx_v_self) { __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__dealloc__ (wrapper)", 0); __pyx_pf_11pygame_sdl2_7surface_7Surface_2__dealloc__(((struct __pyx_obj_11pygame_sdl2_7surface_Surface *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); } static void __pyx_pf_11pygame_sdl2_7surface_7Surface_2__dealloc__(struct __pyx_obj_11pygame_sdl2_7surface_Surface *__pyx_v_self) { __Pyx_RefNannyDeclarations int __pyx_t_1; int __pyx_t_2; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; PyObject *__pyx_t_5 = NULL; __Pyx_RefNannySetupContext("__dealloc__", 0); /* "pygame_sdl2/surface.pyx":64 * global total_size * * if self.surface and self.owns_surface: # <<<<<<<<<<<<<< * if total_size: * total_size -= self.surface.pitch * self.surface.h */ __pyx_t_2 = (__pyx_v_self->surface != 0); if (__pyx_t_2) { } else { __pyx_t_1 = __pyx_t_2; goto __pyx_L4_bool_binop_done; } __pyx_t_2 = (__pyx_v_self->owns_surface != 0); __pyx_t_1 = __pyx_t_2; __pyx_L4_bool_binop_done:; if (__pyx_t_1) { /* "pygame_sdl2/surface.pyx":65 * * if self.surface and self.owns_surface: * if total_size: # <<<<<<<<<<<<<< * total_size -= self.surface.pitch * self.surface.h * */ __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_total_size); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 65, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(0, 65, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; if (__pyx_t_1) { /* "pygame_sdl2/surface.pyx":66 * if self.surface and self.owns_surface: * if total_size: * total_size -= self.surface.pitch * self.surface.h # <<<<<<<<<<<<<< * * SDL_FreeSurface(self.surface) */ __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_total_size); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 66, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = __Pyx_PyInt_From_int((__pyx_v_self->surface->pitch * __pyx_v_self->surface->h)); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 66, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_5 = PyNumber_InPlaceSubtract(__pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 66, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; if (PyDict_SetItem(__pyx_d, __pyx_n_s_total_size, __pyx_t_5) < 0) __PYX_ERR(0, 66, __pyx_L1_error) __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; /* "pygame_sdl2/surface.pyx":65 * * if self.surface and self.owns_surface: * if total_size: # <<<<<<<<<<<<<< * total_size -= self.surface.pitch * self.surface.h * */ } /* "pygame_sdl2/surface.pyx":68 * total_size -= self.surface.pitch * self.surface.h * * SDL_FreeSurface(self.surface) # <<<<<<<<<<<<<< * return * elif self.window_surface: */ SDL_FreeSurface(__pyx_v_self->surface); /* "pygame_sdl2/surface.pyx":69 * * SDL_FreeSurface(self.surface) * return # <<<<<<<<<<<<<< * elif self.window_surface: * return */ goto __pyx_L0; /* "pygame_sdl2/surface.pyx":64 * global total_size * * if self.surface and self.owns_surface: # <<<<<<<<<<<<<< * if total_size: * total_size -= self.surface.pitch * self.surface.h */ } /* "pygame_sdl2/surface.pyx":70 * SDL_FreeSurface(self.surface) * return * elif self.window_surface: # <<<<<<<<<<<<<< * return * elif self.parent: */ __pyx_t_1 = (__pyx_v_self->window_surface != 0); if (__pyx_t_1) { /* "pygame_sdl2/surface.pyx":71 * return * elif self.window_surface: * return # <<<<<<<<<<<<<< * elif self.parent: * SDL_FreeSurface(self.surface) */ goto __pyx_L0; /* "pygame_sdl2/surface.pyx":70 * SDL_FreeSurface(self.surface) * return * elif self.window_surface: # <<<<<<<<<<<<<< * return * elif self.parent: */ } /* "pygame_sdl2/surface.pyx":72 * elif self.window_surface: * return * elif self.parent: # <<<<<<<<<<<<<< * SDL_FreeSurface(self.surface) * return */ __pyx_t_1 = __Pyx_PyObject_IsTrue(((PyObject *)__pyx_v_self->parent)); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(0, 72, __pyx_L1_error) if (__pyx_t_1) { /* "pygame_sdl2/surface.pyx":73 * return * elif self.parent: * SDL_FreeSurface(self.surface) # <<<<<<<<<<<<<< * return * */ SDL_FreeSurface(__pyx_v_self->surface); /* "pygame_sdl2/surface.pyx":74 * elif self.parent: * SDL_FreeSurface(self.surface) * return # <<<<<<<<<<<<<< * * warnings.warn("Memory leak via Surface in pygame_sdl2.") */ goto __pyx_L0; /* "pygame_sdl2/surface.pyx":72 * elif self.window_surface: * return * elif self.parent: # <<<<<<<<<<<<<< * SDL_FreeSurface(self.surface) * return */ } /* "pygame_sdl2/surface.pyx":76 * return * * warnings.warn("Memory leak via Surface in pygame_sdl2.") # <<<<<<<<<<<<<< * * def __sizeof__(self): */ __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_warnings); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 76, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_warn); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 76, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_tuple_, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 76, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; /* "pygame_sdl2/surface.pyx":61 * self.has_alpha = False * * def __dealloc__(self): # <<<<<<<<<<<<<< * global total_size * */ /* function exit code */ goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_5); __Pyx_WriteUnraisable("pygame_sdl2.surface.Surface.__dealloc__", __pyx_clineno, __pyx_lineno, __pyx_filename, 0, 0); __pyx_L0:; __Pyx_RefNannyFinishContext(); } /* "pygame_sdl2/surface.pyx":78 * warnings.warn("Memory leak via Surface in pygame_sdl2.") * * def __sizeof__(self): # <<<<<<<<<<<<<< * if self.surface and self.owns_surface: * return self.surface.pitch * self.surface.h */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_7surface_7Surface_5__sizeof__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/ static PyObject *__pyx_pw_11pygame_sdl2_7surface_7Surface_5__sizeof__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__sizeof__ (wrapper)", 0); __pyx_r = __pyx_pf_11pygame_sdl2_7surface_7Surface_4__sizeof__(((struct __pyx_obj_11pygame_sdl2_7surface_Surface *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_7surface_7Surface_4__sizeof__(struct __pyx_obj_11pygame_sdl2_7surface_Surface *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; int __pyx_t_2; PyObject *__pyx_t_3 = NULL; __Pyx_RefNannySetupContext("__sizeof__", 0); /* "pygame_sdl2/surface.pyx":79 * * def __sizeof__(self): * if self.surface and self.owns_surface: # <<<<<<<<<<<<<< * return self.surface.pitch * self.surface.h * else: */ __pyx_t_2 = (__pyx_v_self->surface != 0); if (__pyx_t_2) { } else { __pyx_t_1 = __pyx_t_2; goto __pyx_L4_bool_binop_done; } __pyx_t_2 = (__pyx_v_self->owns_surface != 0); __pyx_t_1 = __pyx_t_2; __pyx_L4_bool_binop_done:; if (__pyx_t_1) { /* "pygame_sdl2/surface.pyx":80 * def __sizeof__(self): * if self.surface and self.owns_surface: * return self.surface.pitch * self.surface.h # <<<<<<<<<<<<<< * else: * return 0 */ __Pyx_XDECREF(__pyx_r); __pyx_t_3 = __Pyx_PyInt_From_int((__pyx_v_self->surface->pitch * __pyx_v_self->surface->h)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 80, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_r = __pyx_t_3; __pyx_t_3 = 0; goto __pyx_L0; /* "pygame_sdl2/surface.pyx":79 * * def __sizeof__(self): * if self.surface and self.owns_surface: # <<<<<<<<<<<<<< * return self.surface.pitch * self.surface.h * else: */ } /* "pygame_sdl2/surface.pyx":82 * return self.surface.pitch * self.surface.h * else: * return 0 # <<<<<<<<<<<<<< * * def __init__(self, size, flags=0, depth=32, masks=None): */ /*else*/ { __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(__pyx_int_0); __pyx_r = __pyx_int_0; goto __pyx_L0; } /* "pygame_sdl2/surface.pyx":78 * warnings.warn("Memory leak via Surface in pygame_sdl2.") * * def __sizeof__(self): # <<<<<<<<<<<<<< * if self.surface and self.owns_surface: * return self.surface.pitch * self.surface.h */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("pygame_sdl2.surface.Surface.__sizeof__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/surface.pyx":84 * return 0 * * def __init__(self, size, flags=0, depth=32, masks=None): # <<<<<<<<<<<<<< * * self.locklist = None */ /* Python wrapper */ static int __pyx_pw_11pygame_sdl2_7surface_7Surface_7__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static int __pyx_pw_11pygame_sdl2_7surface_7Surface_7__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_size = 0; PyObject *__pyx_v_flags = 0; PyObject *__pyx_v_depth = 0; PyObject *__pyx_v_masks = 0; int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__init__ (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_size,&__pyx_n_s_flags,&__pyx_n_s_depth,&__pyx_n_s_masks,0}; PyObject* values[4] = {0,0,0,0}; values[1] = ((PyObject *)__pyx_int_0); values[2] = ((PyObject *)__pyx_int_32); values[3] = ((PyObject *)Py_None); if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_size)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; case 1: if (kw_args > 0) { PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_flags); if (value) { values[1] = value; kw_args--; } } case 2: if (kw_args > 0) { PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_depth); if (value) { values[2] = value; kw_args--; } } case 3: if (kw_args > 0) { PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_masks); if (value) { values[3] = value; kw_args--; } } } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__init__") < 0)) __PYX_ERR(0, 84, __pyx_L3_error) } } else { switch (PyTuple_GET_SIZE(__pyx_args)) { case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_size = values[0]; __pyx_v_flags = values[1]; __pyx_v_depth = values[2]; __pyx_v_masks = values[3]; } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("__init__", 0, 1, 4, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 84, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("pygame_sdl2.surface.Surface.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return -1; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_11pygame_sdl2_7surface_7Surface_6__init__(((struct __pyx_obj_11pygame_sdl2_7surface_Surface *)__pyx_v_self), __pyx_v_size, __pyx_v_flags, __pyx_v_depth, __pyx_v_masks); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static int __pyx_pf_11pygame_sdl2_7surface_7Surface_6__init__(struct __pyx_obj_11pygame_sdl2_7surface_Surface *__pyx_v_self, PyObject *__pyx_v_size, PyObject *__pyx_v_flags, PyObject *__pyx_v_depth, PyObject *__pyx_v_masks) { int __pyx_v_w; int __pyx_v_h; Uint32 __pyx_v_Rmask; Uint32 __pyx_v_Gmask; Uint32 __pyx_v_Bmask; Uint32 __pyx_v_Amask; SDL_Surface *__pyx_v_sample; struct __pyx_obj_11pygame_sdl2_7surface_Surface *__pyx_v_pysample = 0; int __pyx_v_depth_int; SDL_Surface *__pyx_v_surface; int __pyx_r; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_t_2; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; PyObject *(*__pyx_t_5)(PyObject *); int __pyx_t_6; int __pyx_t_7; int __pyx_t_8; PyObject *__pyx_t_9 = NULL; PyObject *__pyx_t_10 = NULL; Uint32 __pyx_t_11; Uint32 __pyx_t_12; Uint32 __pyx_t_13; Uint32 __pyx_t_14; SDL_Surface *__pyx_t_15; Uint8 __pyx_t_16; __Pyx_RefNannySetupContext("__init__", 0); /* "pygame_sdl2/surface.pyx":86 * def __init__(self, size, flags=0, depth=32, masks=None): * * self.locklist = None # <<<<<<<<<<<<<< * self.parent = None * */ __Pyx_INCREF(Py_None); __Pyx_GIVEREF(Py_None); __Pyx_GOTREF(__pyx_v_self->locklist); __Pyx_DECREF(__pyx_v_self->locklist); __pyx_v_self->locklist = Py_None; /* "pygame_sdl2/surface.pyx":87 * * self.locklist = None * self.parent = None # <<<<<<<<<<<<<< * * self.offset_x = 0 */ __Pyx_INCREF(Py_None); __Pyx_GIVEREF(Py_None); __Pyx_GOTREF(__pyx_v_self->parent); __Pyx_DECREF(((PyObject *)__pyx_v_self->parent)); __pyx_v_self->parent = ((struct __pyx_obj_11pygame_sdl2_7surface_Surface *)Py_None); /* "pygame_sdl2/surface.pyx":89 * self.parent = None * * self.offset_x = 0 # <<<<<<<<<<<<<< * self.offset_y = 0 * */ __pyx_v_self->offset_x = 0; /* "pygame_sdl2/surface.pyx":90 * * self.offset_x = 0 * self.offset_y = 0 # <<<<<<<<<<<<<< * * self.get_window_flags = None */ __pyx_v_self->offset_y = 0; /* "pygame_sdl2/surface.pyx":92 * self.offset_y = 0 * * self.get_window_flags = None # <<<<<<<<<<<<<< * * # When size is an empty tuple, we do not create a surface, and */ __Pyx_INCREF(Py_None); __Pyx_GIVEREF(Py_None); __Pyx_GOTREF(__pyx_v_self->get_window_flags); __Pyx_DECREF(__pyx_v_self->get_window_flags); __pyx_v_self->get_window_flags = Py_None; /* "pygame_sdl2/surface.pyx":96 * # When size is an empty tuple, we do not create a surface, and * # expect our caller to set this object up. * if size == (): # <<<<<<<<<<<<<< * return * */ __pyx_t_1 = PyObject_RichCompare(__pyx_v_size, __pyx_empty_tuple, Py_EQ); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 96, __pyx_L1_error) __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 96, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (__pyx_t_2) { /* "pygame_sdl2/surface.pyx":97 * # expect our caller to set this object up. * if size == (): * return # <<<<<<<<<<<<<< * * cdef int w */ __pyx_r = 0; goto __pyx_L0; /* "pygame_sdl2/surface.pyx":96 * # When size is an empty tuple, we do not create a surface, and * # expect our caller to set this object up. * if size == (): # <<<<<<<<<<<<<< * return * */ } /* "pygame_sdl2/surface.pyx":102 * cdef int h * * w, h = size # <<<<<<<<<<<<<< * assert w >= 0 * assert h >= 0 */ if ((likely(PyTuple_CheckExact(__pyx_v_size))) || (PyList_CheckExact(__pyx_v_size))) { PyObject* sequence = __pyx_v_size; #if !CYTHON_COMPILING_IN_PYPY Py_ssize_t size = Py_SIZE(sequence); #else Py_ssize_t size = PySequence_Size(sequence); #endif if (unlikely(size != 2)) { if (size > 2) __Pyx_RaiseTooManyValuesError(2); else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); __PYX_ERR(0, 102, __pyx_L1_error) } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS if (likely(PyTuple_CheckExact(sequence))) { __pyx_t_1 = PyTuple_GET_ITEM(sequence, 0); __pyx_t_3 = PyTuple_GET_ITEM(sequence, 1); } else { __pyx_t_1 = PyList_GET_ITEM(sequence, 0); __pyx_t_3 = PyList_GET_ITEM(sequence, 1); } __Pyx_INCREF(__pyx_t_1); __Pyx_INCREF(__pyx_t_3); #else __pyx_t_1 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 102, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_3 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 102, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); #endif } else { Py_ssize_t index = -1; __pyx_t_4 = PyObject_GetIter(__pyx_v_size); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 102, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_5 = Py_TYPE(__pyx_t_4)->tp_iternext; index = 0; __pyx_t_1 = __pyx_t_5(__pyx_t_4); if (unlikely(!__pyx_t_1)) goto __pyx_L4_unpacking_failed; __Pyx_GOTREF(__pyx_t_1); index = 1; __pyx_t_3 = __pyx_t_5(__pyx_t_4); if (unlikely(!__pyx_t_3)) goto __pyx_L4_unpacking_failed; __Pyx_GOTREF(__pyx_t_3); if (__Pyx_IternextUnpackEndCheck(__pyx_t_5(__pyx_t_4), 2) < 0) __PYX_ERR(0, 102, __pyx_L1_error) __pyx_t_5 = NULL; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; goto __pyx_L5_unpacking_done; __pyx_L4_unpacking_failed:; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_t_5 = NULL; if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); __PYX_ERR(0, 102, __pyx_L1_error) __pyx_L5_unpacking_done:; } __pyx_t_6 = __Pyx_PyInt_As_int(__pyx_t_1); if (unlikely((__pyx_t_6 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 102, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_7 = __Pyx_PyInt_As_int(__pyx_t_3); if (unlikely((__pyx_t_7 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 102, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_v_w = __pyx_t_6; __pyx_v_h = __pyx_t_7; /* "pygame_sdl2/surface.pyx":103 * * w, h = size * assert w >= 0 # <<<<<<<<<<<<<< * assert h >= 0 * */ #ifndef CYTHON_WITHOUT_ASSERTIONS if (unlikely(!Py_OptimizeFlag)) { if (unlikely(!((__pyx_v_w >= 0) != 0))) { PyErr_SetNone(PyExc_AssertionError); __PYX_ERR(0, 103, __pyx_L1_error) } } #endif /* "pygame_sdl2/surface.pyx":104 * w, h = size * assert w >= 0 * assert h >= 0 # <<<<<<<<<<<<<< * * cdef Uint32 Rmask, Gmask, Bmask, Amask */ #ifndef CYTHON_WITHOUT_ASSERTIONS if (unlikely(!Py_OptimizeFlag)) { if (unlikely(!((__pyx_v_h >= 0) != 0))) { PyErr_SetNone(PyExc_AssertionError); __PYX_ERR(0, 104, __pyx_L1_error) } } #endif /* "pygame_sdl2/surface.pyx":111 * cdef int depth_int * * if masks is not None: # <<<<<<<<<<<<<< * Rmask, Gmask, Bmask, Amask = masks * depth_int = depth */ __pyx_t_2 = (__pyx_v_masks != Py_None); __pyx_t_8 = (__pyx_t_2 != 0); if (__pyx_t_8) { /* "pygame_sdl2/surface.pyx":112 * * if masks is not None: * Rmask, Gmask, Bmask, Amask = masks # <<<<<<<<<<<<<< * depth_int = depth * */ if ((likely(PyTuple_CheckExact(__pyx_v_masks))) || (PyList_CheckExact(__pyx_v_masks))) { PyObject* sequence = __pyx_v_masks; #if !CYTHON_COMPILING_IN_PYPY Py_ssize_t size = Py_SIZE(sequence); #else Py_ssize_t size = PySequence_Size(sequence); #endif if (unlikely(size != 4)) { if (size > 4) __Pyx_RaiseTooManyValuesError(4); else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); __PYX_ERR(0, 112, __pyx_L1_error) } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS if (likely(PyTuple_CheckExact(sequence))) { __pyx_t_3 = PyTuple_GET_ITEM(sequence, 0); __pyx_t_1 = PyTuple_GET_ITEM(sequence, 1); __pyx_t_4 = PyTuple_GET_ITEM(sequence, 2); __pyx_t_9 = PyTuple_GET_ITEM(sequence, 3); } else { __pyx_t_3 = PyList_GET_ITEM(sequence, 0); __pyx_t_1 = PyList_GET_ITEM(sequence, 1); __pyx_t_4 = PyList_GET_ITEM(sequence, 2); __pyx_t_9 = PyList_GET_ITEM(sequence, 3); } __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(__pyx_t_1); __Pyx_INCREF(__pyx_t_4); __Pyx_INCREF(__pyx_t_9); #else { Py_ssize_t i; PyObject** temps[4] = {&__pyx_t_3,&__pyx_t_1,&__pyx_t_4,&__pyx_t_9}; for (i=0; i < 4; i++) { PyObject* item = PySequence_ITEM(sequence, i); if (unlikely(!item)) __PYX_ERR(0, 112, __pyx_L1_error) __Pyx_GOTREF(item); *(temps[i]) = item; } } #endif } else { Py_ssize_t index = -1; PyObject** temps[4] = {&__pyx_t_3,&__pyx_t_1,&__pyx_t_4,&__pyx_t_9}; __pyx_t_10 = PyObject_GetIter(__pyx_v_masks); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 112, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_10); __pyx_t_5 = Py_TYPE(__pyx_t_10)->tp_iternext; for (index=0; index < 4; index++) { PyObject* item = __pyx_t_5(__pyx_t_10); if (unlikely(!item)) goto __pyx_L7_unpacking_failed; __Pyx_GOTREF(item); *(temps[index]) = item; } if (__Pyx_IternextUnpackEndCheck(__pyx_t_5(__pyx_t_10), 4) < 0) __PYX_ERR(0, 112, __pyx_L1_error) __pyx_t_5 = NULL; __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; goto __pyx_L8_unpacking_done; __pyx_L7_unpacking_failed:; __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; __pyx_t_5 = NULL; if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); __PYX_ERR(0, 112, __pyx_L1_error) __pyx_L8_unpacking_done:; } __pyx_t_11 = __Pyx_PyInt_As_uint32_t(__pyx_t_3); if (unlikely((__pyx_t_11 == ((Uint32)-1)) && PyErr_Occurred())) __PYX_ERR(0, 112, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_12 = __Pyx_PyInt_As_uint32_t(__pyx_t_1); if (unlikely((__pyx_t_12 == ((Uint32)-1)) && PyErr_Occurred())) __PYX_ERR(0, 112, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_13 = __Pyx_PyInt_As_uint32_t(__pyx_t_4); if (unlikely((__pyx_t_13 == ((Uint32)-1)) && PyErr_Occurred())) __PYX_ERR(0, 112, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_t_14 = __Pyx_PyInt_As_uint32_t(__pyx_t_9); if (unlikely((__pyx_t_14 == ((Uint32)-1)) && PyErr_Occurred())) __PYX_ERR(0, 112, __pyx_L1_error) __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; __pyx_v_Rmask = __pyx_t_11; __pyx_v_Gmask = __pyx_t_12; __pyx_v_Bmask = __pyx_t_13; __pyx_v_Amask = __pyx_t_14; /* "pygame_sdl2/surface.pyx":113 * if masks is not None: * Rmask, Gmask, Bmask, Amask = masks * depth_int = depth # <<<<<<<<<<<<<< * * elif isinstance(depth, Surface): */ __pyx_t_7 = __Pyx_PyInt_As_int(__pyx_v_depth); if (unlikely((__pyx_t_7 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 113, __pyx_L1_error) __pyx_v_depth_int = __pyx_t_7; /* "pygame_sdl2/surface.pyx":111 * cdef int depth_int * * if masks is not None: # <<<<<<<<<<<<<< * Rmask, Gmask, Bmask, Amask = masks * depth_int = depth */ goto __pyx_L6; } /* "pygame_sdl2/surface.pyx":115 * depth_int = depth * * elif isinstance(depth, Surface): # <<<<<<<<<<<<<< * * pysample = depth */ __pyx_t_8 = __Pyx_TypeCheck(__pyx_v_depth, __pyx_ptype_11pygame_sdl2_7surface_Surface); __pyx_t_2 = (__pyx_t_8 != 0); if (__pyx_t_2) { /* "pygame_sdl2/surface.pyx":117 * elif isinstance(depth, Surface): * * pysample = depth # <<<<<<<<<<<<<< * sample = pysample.surface * Rmask = sample.format.Rmask */ if (!(likely(((__pyx_v_depth) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_depth, __pyx_ptype_11pygame_sdl2_7surface_Surface))))) __PYX_ERR(0, 117, __pyx_L1_error) __pyx_t_9 = __pyx_v_depth; __Pyx_INCREF(__pyx_t_9); __pyx_v_pysample = ((struct __pyx_obj_11pygame_sdl2_7surface_Surface *)__pyx_t_9); __pyx_t_9 = 0; /* "pygame_sdl2/surface.pyx":118 * * pysample = depth * sample = pysample.surface # <<<<<<<<<<<<<< * Rmask = sample.format.Rmask * Gmask = sample.format.Gmask */ __pyx_t_15 = __pyx_v_pysample->surface; __pyx_v_sample = __pyx_t_15; /* "pygame_sdl2/surface.pyx":119 * pysample = depth * sample = pysample.surface * Rmask = sample.format.Rmask # <<<<<<<<<<<<<< * Gmask = sample.format.Gmask * Bmask = sample.format.Bmask */ __pyx_t_14 = __pyx_v_sample->format->Rmask; __pyx_v_Rmask = __pyx_t_14; /* "pygame_sdl2/surface.pyx":120 * sample = pysample.surface * Rmask = sample.format.Rmask * Gmask = sample.format.Gmask # <<<<<<<<<<<<<< * Bmask = sample.format.Bmask * Amask = sample.format.Amask */ __pyx_t_14 = __pyx_v_sample->format->Gmask; __pyx_v_Gmask = __pyx_t_14; /* "pygame_sdl2/surface.pyx":121 * Rmask = sample.format.Rmask * Gmask = sample.format.Gmask * Bmask = sample.format.Bmask # <<<<<<<<<<<<<< * Amask = sample.format.Amask * depth_int = sample.format.BitsPerPixel */ __pyx_t_14 = __pyx_v_sample->format->Bmask; __pyx_v_Bmask = __pyx_t_14; /* "pygame_sdl2/surface.pyx":122 * Gmask = sample.format.Gmask * Bmask = sample.format.Bmask * Amask = sample.format.Amask # <<<<<<<<<<<<<< * depth_int = sample.format.BitsPerPixel * */ __pyx_t_14 = __pyx_v_sample->format->Amask; __pyx_v_Amask = __pyx_t_14; /* "pygame_sdl2/surface.pyx":123 * Bmask = sample.format.Bmask * Amask = sample.format.Amask * depth_int = sample.format.BitsPerPixel # <<<<<<<<<<<<<< * * else: */ __pyx_t_16 = __pyx_v_sample->format->BitsPerPixel; __pyx_v_depth_int = __pyx_t_16; /* "pygame_sdl2/surface.pyx":115 * depth_int = depth * * elif isinstance(depth, Surface): # <<<<<<<<<<<<<< * * pysample = depth */ goto __pyx_L6; } /* "pygame_sdl2/surface.pyx":127 * else: * * pysample = pygame_sdl2.display.get_surface() # <<<<<<<<<<<<<< * * if pysample and pysample.surface.format.BitsPerPixel == 32: */ /*else*/ { __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_pygame_sdl2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 127, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_display); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 127, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_get_surface); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 127, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_1 = NULL; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_4))) { __pyx_t_1 = PyMethod_GET_SELF(__pyx_t_4); if (likely(__pyx_t_1)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4); __Pyx_INCREF(__pyx_t_1); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_4, function); } } if (__pyx_t_1) { __pyx_t_9 = __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_1); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 127, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; } else { __pyx_t_9 = __Pyx_PyObject_CallNoArg(__pyx_t_4); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 127, __pyx_L1_error) } __Pyx_GOTREF(__pyx_t_9); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; if (!(likely(((__pyx_t_9) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_9, __pyx_ptype_11pygame_sdl2_7surface_Surface))))) __PYX_ERR(0, 127, __pyx_L1_error) __pyx_v_pysample = ((struct __pyx_obj_11pygame_sdl2_7surface_Surface *)__pyx_t_9); __pyx_t_9 = 0; /* "pygame_sdl2/surface.pyx":129 * pysample = pygame_sdl2.display.get_surface() * * if pysample and pysample.surface.format.BitsPerPixel == 32: # <<<<<<<<<<<<<< * sample = pysample.surface * Rmask = sample.format.Rmask */ __pyx_t_8 = __Pyx_PyObject_IsTrue(((PyObject *)__pyx_v_pysample)); if (unlikely(__pyx_t_8 < 0)) __PYX_ERR(0, 129, __pyx_L1_error) if (__pyx_t_8) { } else { __pyx_t_2 = __pyx_t_8; goto __pyx_L10_bool_binop_done; } __pyx_t_8 = ((__pyx_v_pysample->surface->format->BitsPerPixel == 32) != 0); __pyx_t_2 = __pyx_t_8; __pyx_L10_bool_binop_done:; if (__pyx_t_2) { /* "pygame_sdl2/surface.pyx":130 * * if pysample and pysample.surface.format.BitsPerPixel == 32: * sample = pysample.surface # <<<<<<<<<<<<<< * Rmask = sample.format.Rmask * Gmask = sample.format.Gmask */ __pyx_t_15 = __pyx_v_pysample->surface; __pyx_v_sample = __pyx_t_15; /* "pygame_sdl2/surface.pyx":131 * if pysample and pysample.surface.format.BitsPerPixel == 32: * sample = pysample.surface * Rmask = sample.format.Rmask # <<<<<<<<<<<<<< * Gmask = sample.format.Gmask * Bmask = sample.format.Bmask */ __pyx_t_14 = __pyx_v_sample->format->Rmask; __pyx_v_Rmask = __pyx_t_14; /* "pygame_sdl2/surface.pyx":132 * sample = pysample.surface * Rmask = sample.format.Rmask * Gmask = sample.format.Gmask # <<<<<<<<<<<<<< * Bmask = sample.format.Bmask * Amask = sample.format.Amask */ __pyx_t_14 = __pyx_v_sample->format->Gmask; __pyx_v_Gmask = __pyx_t_14; /* "pygame_sdl2/surface.pyx":133 * Rmask = sample.format.Rmask * Gmask = sample.format.Gmask * Bmask = sample.format.Bmask # <<<<<<<<<<<<<< * Amask = sample.format.Amask * */ __pyx_t_14 = __pyx_v_sample->format->Bmask; __pyx_v_Bmask = __pyx_t_14; /* "pygame_sdl2/surface.pyx":134 * Gmask = sample.format.Gmask * Bmask = sample.format.Bmask * Amask = sample.format.Amask # <<<<<<<<<<<<<< * * else: */ __pyx_t_14 = __pyx_v_sample->format->Amask; __pyx_v_Amask = __pyx_t_14; /* "pygame_sdl2/surface.pyx":129 * pysample = pygame_sdl2.display.get_surface() * * if pysample and pysample.surface.format.BitsPerPixel == 32: # <<<<<<<<<<<<<< * sample = pysample.surface * Rmask = sample.format.Rmask */ goto __pyx_L9; } /* "pygame_sdl2/surface.pyx":139 * * # RGB(A) * if SDL_BYTEORDER == SDL_BIG_ENDIAN: # <<<<<<<<<<<<<< * Rmask = 0xff000000 * Gmask = 0x00ff0000 */ /*else*/ { __pyx_t_2 = ((SDL_BYTEORDER == SDL_BIG_ENDIAN) != 0); if (__pyx_t_2) { /* "pygame_sdl2/surface.pyx":140 * # RGB(A) * if SDL_BYTEORDER == SDL_BIG_ENDIAN: * Rmask = 0xff000000 # <<<<<<<<<<<<<< * Gmask = 0x00ff0000 * Bmask = 0x0000ff00 */ __pyx_v_Rmask = 0xff000000; /* "pygame_sdl2/surface.pyx":141 * if SDL_BYTEORDER == SDL_BIG_ENDIAN: * Rmask = 0xff000000 * Gmask = 0x00ff0000 # <<<<<<<<<<<<<< * Bmask = 0x0000ff00 * Amask = 0 */ __pyx_v_Gmask = 0x00ff0000; /* "pygame_sdl2/surface.pyx":142 * Rmask = 0xff000000 * Gmask = 0x00ff0000 * Bmask = 0x0000ff00 # <<<<<<<<<<<<<< * Amask = 0 * else: */ __pyx_v_Bmask = 0x0000ff00; /* "pygame_sdl2/surface.pyx":143 * Gmask = 0x00ff0000 * Bmask = 0x0000ff00 * Amask = 0 # <<<<<<<<<<<<<< * else: * Rmask = 0x000000ff */ __pyx_v_Amask = 0; /* "pygame_sdl2/surface.pyx":139 * * # RGB(A) * if SDL_BYTEORDER == SDL_BIG_ENDIAN: # <<<<<<<<<<<<<< * Rmask = 0xff000000 * Gmask = 0x00ff0000 */ goto __pyx_L12; } /* "pygame_sdl2/surface.pyx":145 * Amask = 0 * else: * Rmask = 0x000000ff # <<<<<<<<<<<<<< * Gmask = 0x0000ff00 * Bmask = 0x00ff0000 */ /*else*/ { __pyx_v_Rmask = 0x000000ff; /* "pygame_sdl2/surface.pyx":146 * else: * Rmask = 0x000000ff * Gmask = 0x0000ff00 # <<<<<<<<<<<<<< * Bmask = 0x00ff0000 * Amask = 0 */ __pyx_v_Gmask = 0x0000ff00; /* "pygame_sdl2/surface.pyx":147 * Rmask = 0x000000ff * Gmask = 0x0000ff00 * Bmask = 0x00ff0000 # <<<<<<<<<<<<<< * Amask = 0 * */ __pyx_v_Bmask = 0x00ff0000; /* "pygame_sdl2/surface.pyx":148 * Gmask = 0x0000ff00 * Bmask = 0x00ff0000 * Amask = 0 # <<<<<<<<<<<<<< * * if (flags & SRCALPHA): */ __pyx_v_Amask = 0; } __pyx_L12:; } __pyx_L9:; /* "pygame_sdl2/surface.pyx":150 * Amask = 0 * * if (flags & SRCALPHA): # <<<<<<<<<<<<<< * if not Amask: * Amask = 0xffffffff & ~(Rmask | Gmask | Bmask) */ __pyx_t_9 = __Pyx_GetModuleGlobalName(__pyx_n_s_SRCALPHA); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 150, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); __pyx_t_4 = PyNumber_And(__pyx_v_flags, __pyx_t_9); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 150, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 150, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; if (__pyx_t_2) { /* "pygame_sdl2/surface.pyx":151 * * if (flags & SRCALPHA): * if not Amask: # <<<<<<<<<<<<<< * Amask = 0xffffffff & ~(Rmask | Gmask | Bmask) * else: */ __pyx_t_2 = ((!(__pyx_v_Amask != 0)) != 0); if (__pyx_t_2) { /* "pygame_sdl2/surface.pyx":152 * if (flags & SRCALPHA): * if not Amask: * Amask = 0xffffffff & ~(Rmask | Gmask | Bmask) # <<<<<<<<<<<<<< * else: * Amask = 0 */ __pyx_t_4 = __Pyx_PyInt_From_uint32_t((~((__pyx_v_Rmask | __pyx_v_Gmask) | __pyx_v_Bmask))); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 152, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_9 = PyNumber_And(__pyx_int_4294967295, __pyx_t_4); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 152, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_t_14 = __Pyx_PyInt_As_uint32_t(__pyx_t_9); if (unlikely((__pyx_t_14 == ((Uint32)-1)) && PyErr_Occurred())) __PYX_ERR(0, 152, __pyx_L1_error) __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; __pyx_v_Amask = __pyx_t_14; /* "pygame_sdl2/surface.pyx":151 * * if (flags & SRCALPHA): * if not Amask: # <<<<<<<<<<<<<< * Amask = 0xffffffff & ~(Rmask | Gmask | Bmask) * else: */ } /* "pygame_sdl2/surface.pyx":150 * Amask = 0 * * if (flags & SRCALPHA): # <<<<<<<<<<<<<< * if not Amask: * Amask = 0xffffffff & ~(Rmask | Gmask | Bmask) */ goto __pyx_L13; } /* "pygame_sdl2/surface.pyx":154 * Amask = 0xffffffff & ~(Rmask | Gmask | Bmask) * else: * Amask = 0 # <<<<<<<<<<<<<< * * depth_int = 32 */ /*else*/ { __pyx_v_Amask = 0; } __pyx_L13:; /* "pygame_sdl2/surface.pyx":156 * Amask = 0 * * depth_int = 32 # <<<<<<<<<<<<<< * * cdef SDL_Surface *surface */ __pyx_v_depth_int = 32; } __pyx_L6:; /* "pygame_sdl2/surface.pyx":160 * cdef SDL_Surface *surface * * with nogil: # <<<<<<<<<<<<<< * surface = SDL_CreateRGBSurface(0, w, h, depth_int, Rmask, Gmask, Bmask, Amask) * */ { #ifdef WITH_THREAD PyThreadState *_save; Py_UNBLOCK_THREADS #endif /*try:*/ { /* "pygame_sdl2/surface.pyx":161 * * with nogil: * surface = SDL_CreateRGBSurface(0, w, h, depth_int, Rmask, Gmask, Bmask, Amask) # <<<<<<<<<<<<<< * * if not surface: */ __pyx_v_surface = SDL_CreateRGBSurface(0, __pyx_v_w, __pyx_v_h, __pyx_v_depth_int, __pyx_v_Rmask, __pyx_v_Gmask, __pyx_v_Bmask, __pyx_v_Amask); } /* "pygame_sdl2/surface.pyx":160 * cdef SDL_Surface *surface * * with nogil: # <<<<<<<<<<<<<< * surface = SDL_CreateRGBSurface(0, w, h, depth_int, Rmask, Gmask, Bmask, Amask) * */ /*finally:*/ { /*normal exit:*/{ #ifdef WITH_THREAD Py_BLOCK_THREADS #endif goto __pyx_L17; } __pyx_L17:; } } /* "pygame_sdl2/surface.pyx":163 * surface = SDL_CreateRGBSurface(0, w, h, depth_int, Rmask, Gmask, Bmask, Amask) * * if not surface: # <<<<<<<<<<<<<< * raise error() * */ __pyx_t_2 = ((!(__pyx_v_surface != 0)) != 0); if (__pyx_t_2) { /* "pygame_sdl2/surface.pyx":164 * * if not surface: * raise error() # <<<<<<<<<<<<<< * * self.take_surface(surface) */ __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_error); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 164, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_1 = NULL; if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_4))) { __pyx_t_1 = PyMethod_GET_SELF(__pyx_t_4); if (likely(__pyx_t_1)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4); __Pyx_INCREF(__pyx_t_1); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_4, function); } } if (__pyx_t_1) { __pyx_t_9 = __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_1); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 164, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; } else { __pyx_t_9 = __Pyx_PyObject_CallNoArg(__pyx_t_4); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 164, __pyx_L1_error) } __Pyx_GOTREF(__pyx_t_9); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_Raise(__pyx_t_9, 0, 0, 0); __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; __PYX_ERR(0, 164, __pyx_L1_error) /* "pygame_sdl2/surface.pyx":163 * surface = SDL_CreateRGBSurface(0, w, h, depth_int, Rmask, Gmask, Bmask, Amask) * * if not surface: # <<<<<<<<<<<<<< * raise error() * */ } /* "pygame_sdl2/surface.pyx":166 * raise error() * * self.take_surface(surface) # <<<<<<<<<<<<<< * * cdef void take_surface(self, SDL_Surface *surface): */ ((struct __pyx_vtabstruct_11pygame_sdl2_7surface_Surface *)__pyx_v_self->__pyx_vtab)->take_surface(__pyx_v_self, __pyx_v_surface); /* "pygame_sdl2/surface.pyx":84 * return 0 * * def __init__(self, size, flags=0, depth=32, masks=None): # <<<<<<<<<<<<<< * * self.locklist = None */ /* function exit code */ __pyx_r = 0; goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_9); __Pyx_XDECREF(__pyx_t_10); __Pyx_AddTraceback("pygame_sdl2.surface.Surface.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = -1; __pyx_L0:; __Pyx_XDECREF((PyObject *)__pyx_v_pysample); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/surface.pyx":168 * self.take_surface(surface) * * cdef void take_surface(self, SDL_Surface *surface): # <<<<<<<<<<<<<< * self.surface = surface * self.owns_surface = True */ static void __pyx_f_11pygame_sdl2_7surface_7Surface_take_surface(struct __pyx_obj_11pygame_sdl2_7surface_Surface *__pyx_v_self, SDL_Surface *__pyx_v_surface) { __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; __Pyx_RefNannySetupContext("take_surface", 0); /* "pygame_sdl2/surface.pyx":169 * * cdef void take_surface(self, SDL_Surface *surface): * self.surface = surface # <<<<<<<<<<<<<< * self.owns_surface = True * */ __pyx_v_self->surface = __pyx_v_surface; /* "pygame_sdl2/surface.pyx":170 * cdef void take_surface(self, SDL_Surface *surface): * self.surface = surface * self.owns_surface = True # <<<<<<<<<<<<<< * * global total_size */ __pyx_v_self->owns_surface = 1; /* "pygame_sdl2/surface.pyx":174 * global total_size * * total_size += self.surface.pitch * self.surface.h # <<<<<<<<<<<<<< * * def __repr__(self): */ __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_total_size); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 174, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = __Pyx_PyInt_From_int((__pyx_v_self->surface->pitch * __pyx_v_self->surface->h)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 174, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = PyNumber_InPlaceAdd(__pyx_t_1, __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 174, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; if (PyDict_SetItem(__pyx_d, __pyx_n_s_total_size, __pyx_t_3) < 0) __PYX_ERR(0, 174, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "pygame_sdl2/surface.pyx":168 * self.take_surface(surface) * * cdef void take_surface(self, SDL_Surface *surface): # <<<<<<<<<<<<<< * self.surface = surface * self.owns_surface = True */ /* function exit code */ goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_WriteUnraisable("pygame_sdl2.surface.Surface.take_surface", __pyx_clineno, __pyx_lineno, __pyx_filename, 0, 0); __pyx_L0:; __Pyx_RefNannyFinishContext(); } /* "pygame_sdl2/surface.pyx":176 * total_size += self.surface.pitch * self.surface.h * * def __repr__(self): # <<<<<<<<<<<<<< * return "".format(self.surface.w, self.surface.h, self.surface.format.BitsPerPixel) * */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_7surface_7Surface_9__repr__(PyObject *__pyx_v_self); /*proto*/ static PyObject *__pyx_pw_11pygame_sdl2_7surface_7Surface_9__repr__(PyObject *__pyx_v_self) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__repr__ (wrapper)", 0); __pyx_r = __pyx_pf_11pygame_sdl2_7surface_7Surface_8__repr__(((struct __pyx_obj_11pygame_sdl2_7surface_Surface *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_7surface_7Surface_8__repr__(struct __pyx_obj_11pygame_sdl2_7surface_Surface *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; PyObject *__pyx_t_5 = NULL; PyObject *__pyx_t_6 = NULL; int __pyx_t_7; PyObject *__pyx_t_8 = NULL; __Pyx_RefNannySetupContext("__repr__", 0); /* "pygame_sdl2/surface.pyx":177 * * def __repr__(self): * return "".format(self.surface.w, self.surface.h, self.surface.format.BitsPerPixel) # <<<<<<<<<<<<<< * * def blit(self, Surface source, dest, area=None, int special_flags=0): */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_kp_s_Surface_x_x, __pyx_n_s_format); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 177, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = __Pyx_PyInt_From_int(__pyx_v_self->surface->w); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 177, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = __Pyx_PyInt_From_int(__pyx_v_self->surface->h); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 177, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_5 = __Pyx_PyInt_From_uint8_t(__pyx_v_self->surface->format->BitsPerPixel); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 177, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_6 = NULL; __pyx_t_7 = 0; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) { __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_2); if (likely(__pyx_t_6)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_6); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); __pyx_t_7 = 1; } } #if CYTHON_FAST_PYCALL if (PyFunction_Check(__pyx_t_2)) { PyObject *__pyx_temp[4] = {__pyx_t_6, __pyx_t_3, __pyx_t_4, __pyx_t_5}; __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_7, 3+__pyx_t_7); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 177, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; } else #endif #if CYTHON_FAST_PYCCALL if (__Pyx_PyFastCFunction_Check(__pyx_t_2)) { PyObject *__pyx_temp[4] = {__pyx_t_6, __pyx_t_3, __pyx_t_4, __pyx_t_5}; __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_7, 3+__pyx_t_7); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 177, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; } else #endif { __pyx_t_8 = PyTuple_New(3+__pyx_t_7); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 177, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); if (__pyx_t_6) { __Pyx_GIVEREF(__pyx_t_6); PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_6); __pyx_t_6 = NULL; } __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_8, 0+__pyx_t_7, __pyx_t_3); __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_8, 1+__pyx_t_7, __pyx_t_4); __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_8, 2+__pyx_t_7, __pyx_t_5); __pyx_t_3 = 0; __pyx_t_4 = 0; __pyx_t_5 = 0; __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_8, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 177, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; } __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "pygame_sdl2/surface.pyx":176 * total_size += self.surface.pitch * self.surface.h * * def __repr__(self): # <<<<<<<<<<<<<< * return "".format(self.surface.w, self.surface.h, self.surface.format.BitsPerPixel) * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_5); __Pyx_XDECREF(__pyx_t_6); __Pyx_XDECREF(__pyx_t_8); __Pyx_AddTraceback("pygame_sdl2.surface.Surface.__repr__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/surface.pyx":179 * return "".format(self.surface.w, self.surface.h, self.surface.format.BitsPerPixel) * * def blit(self, Surface source, dest, area=None, int special_flags=0): # <<<<<<<<<<<<<< * cdef SDL_Rect dest_rect * cdef SDL_Rect area_rect */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_7surface_7Surface_11blit(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static PyObject *__pyx_pw_11pygame_sdl2_7surface_7Surface_11blit(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { struct __pyx_obj_11pygame_sdl2_7surface_Surface *__pyx_v_source = 0; PyObject *__pyx_v_dest = 0; PyObject *__pyx_v_area = 0; int __pyx_v_special_flags; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("blit (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_source,&__pyx_n_s_dest,&__pyx_n_s_area,&__pyx_n_s_special_flags,0}; PyObject* values[4] = {0,0,0,0}; values[2] = ((PyObject *)Py_None); if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_source)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; case 1: if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_dest)) != 0)) kw_args--; else { __Pyx_RaiseArgtupleInvalid("blit", 0, 2, 4, 1); __PYX_ERR(0, 179, __pyx_L3_error) } case 2: if (kw_args > 0) { PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_area); if (value) { values[2] = value; kw_args--; } } case 3: if (kw_args > 0) { PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_special_flags); if (value) { values[3] = value; kw_args--; } } } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "blit") < 0)) __PYX_ERR(0, 179, __pyx_L3_error) } } else { switch (PyTuple_GET_SIZE(__pyx_args)) { case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); values[0] = PyTuple_GET_ITEM(__pyx_args, 0); break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_source = ((struct __pyx_obj_11pygame_sdl2_7surface_Surface *)values[0]); __pyx_v_dest = values[1]; __pyx_v_area = values[2]; if (values[3]) { __pyx_v_special_flags = __Pyx_PyInt_As_int(values[3]); if (unlikely((__pyx_v_special_flags == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 179, __pyx_L3_error) } else { __pyx_v_special_flags = ((int)0); } } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("blit", 0, 2, 4, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 179, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("pygame_sdl2.surface.Surface.blit", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_source), __pyx_ptype_11pygame_sdl2_7surface_Surface, 1, "source", 0))) __PYX_ERR(0, 179, __pyx_L1_error) __pyx_r = __pyx_pf_11pygame_sdl2_7surface_7Surface_10blit(((struct __pyx_obj_11pygame_sdl2_7surface_Surface *)__pyx_v_self), __pyx_v_source, __pyx_v_dest, __pyx_v_area, __pyx_v_special_flags); /* function exit code */ goto __pyx_L0; __pyx_L1_error:; __pyx_r = NULL; __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_7surface_7Surface_10blit(struct __pyx_obj_11pygame_sdl2_7surface_Surface *__pyx_v_self, struct __pyx_obj_11pygame_sdl2_7surface_Surface *__pyx_v_source, PyObject *__pyx_v_dest, PyObject *__pyx_v_area, int __pyx_v_special_flags) { SDL_Rect __pyx_v_dest_rect; SDL_Rect __pyx_v_area_rect; SDL_Rect *__pyx_v_area_ptr; struct __pyx_obj_11pygame_sdl2_7surface_Surface *__pyx_v_temp = 0; int __pyx_v_err; Uint32 __pyx_v_key; Uint8 __pyx_v_alpha; int __pyx_v_colorkey; PyObject *__pyx_v_dirty = NULL; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; int __pyx_t_5; PyObject *__pyx_t_6 = NULL; int __pyx_t_7; struct __pyx_opt_args_11pygame_sdl2_4rect_to_sdl_rect __pyx_t_8; PyObject *__pyx_t_9 = NULL; PyObject *__pyx_t_10 = NULL; PyObject *__pyx_t_11 = NULL; PyObject *__pyx_t_12 = NULL; __Pyx_RefNannySetupContext("blit", 0); __Pyx_INCREF((PyObject *)__pyx_v_source); __Pyx_INCREF(__pyx_v_area); /* "pygame_sdl2/surface.pyx":182 * cdef SDL_Rect dest_rect * cdef SDL_Rect area_rect * cdef SDL_Rect *area_ptr = NULL # <<<<<<<<<<<<<< * * cdef Surface temp */ __pyx_v_area_ptr = NULL; /* "pygame_sdl2/surface.pyx":191 * cdef bint colorkey * * colorkey = (SDL_GetColorKey(source.surface, &key) == 0) # <<<<<<<<<<<<<< * * if not source.surface.format.Amask: */ __pyx_v_colorkey = (SDL_GetColorKey(__pyx_v_source->surface, (&__pyx_v_key)) == 0); /* "pygame_sdl2/surface.pyx":193 * colorkey = (SDL_GetColorKey(source.surface, &key) == 0) * * if not source.surface.format.Amask: # <<<<<<<<<<<<<< * if SDL_GetSurfaceAlphaMod(source.surface, &alpha): * raise error() */ __pyx_t_1 = ((!(__pyx_v_source->surface->format->Amask != 0)) != 0); if (__pyx_t_1) { /* "pygame_sdl2/surface.pyx":194 * * if not source.surface.format.Amask: * if SDL_GetSurfaceAlphaMod(source.surface, &alpha): # <<<<<<<<<<<<<< * raise error() * */ __pyx_t_1 = (SDL_GetSurfaceAlphaMod(__pyx_v_source->surface, (&__pyx_v_alpha)) != 0); if (__pyx_t_1) { /* "pygame_sdl2/surface.pyx":195 * if not source.surface.format.Amask: * if SDL_GetSurfaceAlphaMod(source.surface, &alpha): * raise error() # <<<<<<<<<<<<<< * * if alpha != 255 and (self.surface.format.Amask or colorkey): */ __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_error); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 195, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = NULL; if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) { __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3); if (likely(__pyx_t_4)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); __Pyx_INCREF(__pyx_t_4); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_3, function); } } if (__pyx_t_4) { __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 195, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; } else { __pyx_t_2 = __Pyx_PyObject_CallNoArg(__pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 195, __pyx_L1_error) } __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_Raise(__pyx_t_2, 0, 0, 0); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __PYX_ERR(0, 195, __pyx_L1_error) /* "pygame_sdl2/surface.pyx":194 * * if not source.surface.format.Amask: * if SDL_GetSurfaceAlphaMod(source.surface, &alpha): # <<<<<<<<<<<<<< * raise error() * */ } /* "pygame_sdl2/surface.pyx":197 * raise error() * * if alpha != 255 and (self.surface.format.Amask or colorkey): # <<<<<<<<<<<<<< * * if area: */ __pyx_t_5 = ((__pyx_v_alpha != 0xFF) != 0); if (__pyx_t_5) { } else { __pyx_t_1 = __pyx_t_5; goto __pyx_L6_bool_binop_done; } __pyx_t_5 = (__pyx_v_self->surface->format->Amask != 0); if (!__pyx_t_5) { } else { __pyx_t_1 = __pyx_t_5; goto __pyx_L6_bool_binop_done; } __pyx_t_5 = (__pyx_v_colorkey != 0); __pyx_t_1 = __pyx_t_5; __pyx_L6_bool_binop_done:; if (__pyx_t_1) { /* "pygame_sdl2/surface.pyx":199 * if alpha != 255 and (self.surface.format.Amask or colorkey): * * if area: # <<<<<<<<<<<<<< * source = source.subsurface(area) * area = None */ __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_area); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(0, 199, __pyx_L1_error) if (__pyx_t_1) { /* "pygame_sdl2/surface.pyx":200 * * if area: * source = source.subsurface(area) # <<<<<<<<<<<<<< * area = None * */ __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_source), __pyx_n_s_subsurface); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 200, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = NULL; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) { __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3); if (likely(__pyx_t_4)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); __Pyx_INCREF(__pyx_t_4); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_3, function); } } if (!__pyx_t_4) { __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_v_area); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 200, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); } else { #if CYTHON_FAST_PYCALL if (PyFunction_Check(__pyx_t_3)) { PyObject *__pyx_temp[2] = {__pyx_t_4, __pyx_v_area}; __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_3, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 200, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_GOTREF(__pyx_t_2); } else #endif #if CYTHON_FAST_PYCCALL if (__Pyx_PyFastCFunction_Check(__pyx_t_3)) { PyObject *__pyx_temp[2] = {__pyx_t_4, __pyx_v_area}; __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 200, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_GOTREF(__pyx_t_2); } else #endif { __pyx_t_6 = PyTuple_New(1+1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 200, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_4); __pyx_t_4 = NULL; __Pyx_INCREF(__pyx_v_area); __Pyx_GIVEREF(__pyx_v_area); PyTuple_SET_ITEM(__pyx_t_6, 0+1, __pyx_v_area); __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_6, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 200, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; } } __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_11pygame_sdl2_7surface_Surface))))) __PYX_ERR(0, 200, __pyx_L1_error) __Pyx_DECREF_SET(__pyx_v_source, ((struct __pyx_obj_11pygame_sdl2_7surface_Surface *)__pyx_t_2)); __pyx_t_2 = 0; /* "pygame_sdl2/surface.pyx":201 * if area: * source = source.subsurface(area) * area = None # <<<<<<<<<<<<<< * * SDL_SetSurfaceBlendMode(source.surface, SDL_BLENDMODE_NONE) */ __Pyx_INCREF(Py_None); __Pyx_DECREF_SET(__pyx_v_area, Py_None); /* "pygame_sdl2/surface.pyx":199 * if alpha != 255 and (self.surface.format.Amask or colorkey): * * if area: # <<<<<<<<<<<<<< * source = source.subsurface(area) * area = None */ } /* "pygame_sdl2/surface.pyx":203 * area = None * * SDL_SetSurfaceBlendMode(source.surface, SDL_BLENDMODE_NONE) # <<<<<<<<<<<<<< * temp = Surface(source.get_size(), SRCALPHA) * */ SDL_SetSurfaceBlendMode(__pyx_v_source->surface, SDL_BLENDMODE_NONE); /* "pygame_sdl2/surface.pyx":204 * * SDL_SetSurfaceBlendMode(source.surface, SDL_BLENDMODE_NONE) * temp = Surface(source.get_size(), SRCALPHA) # <<<<<<<<<<<<<< * * with nogil: */ __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_source), __pyx_n_s_get_size); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 204, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_6 = NULL; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) { __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_3); if (likely(__pyx_t_6)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); __Pyx_INCREF(__pyx_t_6); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_3, function); } } if (__pyx_t_6) { __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_6); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 204, __pyx_L1_error) __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; } else { __pyx_t_2 = __Pyx_PyObject_CallNoArg(__pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 204, __pyx_L1_error) } __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_SRCALPHA); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 204, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_6 = PyTuple_New(2); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 204, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_GIVEREF(__pyx_t_2); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_2); __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_6, 1, __pyx_t_3); __pyx_t_2 = 0; __pyx_t_3 = 0; __pyx_t_3 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_11pygame_sdl2_7surface_Surface), __pyx_t_6, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 204, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __pyx_v_temp = ((struct __pyx_obj_11pygame_sdl2_7surface_Surface *)__pyx_t_3); __pyx_t_3 = 0; /* "pygame_sdl2/surface.pyx":206 * temp = Surface(source.get_size(), SRCALPHA) * * with nogil: # <<<<<<<<<<<<<< * SDL_UpperBlit(source.surface, NULL, temp.surface, NULL) * */ { #ifdef WITH_THREAD PyThreadState *_save; Py_UNBLOCK_THREADS #endif /*try:*/ { /* "pygame_sdl2/surface.pyx":207 * * with nogil: * SDL_UpperBlit(source.surface, NULL, temp.surface, NULL) # <<<<<<<<<<<<<< * * source = temp */ SDL_UpperBlit(__pyx_v_source->surface, NULL, __pyx_v_temp->surface, NULL); } /* "pygame_sdl2/surface.pyx":206 * temp = Surface(source.get_size(), SRCALPHA) * * with nogil: # <<<<<<<<<<<<<< * SDL_UpperBlit(source.surface, NULL, temp.surface, NULL) * */ /*finally:*/ { /*normal exit:*/{ #ifdef WITH_THREAD Py_BLOCK_THREADS #endif goto __pyx_L12; } __pyx_L12:; } } /* "pygame_sdl2/surface.pyx":209 * SDL_UpperBlit(source.surface, NULL, temp.surface, NULL) * * source = temp # <<<<<<<<<<<<<< * colorkey = False * */ __Pyx_INCREF(((PyObject *)__pyx_v_temp)); __Pyx_DECREF_SET(__pyx_v_source, __pyx_v_temp); /* "pygame_sdl2/surface.pyx":210 * * source = temp * colorkey = False # <<<<<<<<<<<<<< * * if colorkey: */ __pyx_v_colorkey = 0; /* "pygame_sdl2/surface.pyx":197 * raise error() * * if alpha != 255 and (self.surface.format.Amask or colorkey): # <<<<<<<<<<<<<< * * if area: */ } /* "pygame_sdl2/surface.pyx":193 * colorkey = (SDL_GetColorKey(source.surface, &key) == 0) * * if not source.surface.format.Amask: # <<<<<<<<<<<<<< * if SDL_GetSurfaceAlphaMod(source.surface, &alpha): * raise error() */ } /* "pygame_sdl2/surface.pyx":212 * colorkey = False * * if colorkey: # <<<<<<<<<<<<<< * SDL_SetSurfaceBlendMode(source.surface, SDL_BLENDMODE_NONE) * else: */ __pyx_t_1 = (__pyx_v_colorkey != 0); if (__pyx_t_1) { /* "pygame_sdl2/surface.pyx":213 * * if colorkey: * SDL_SetSurfaceBlendMode(source.surface, SDL_BLENDMODE_NONE) # <<<<<<<<<<<<<< * else: * SDL_SetSurfaceBlendMode(source.surface, SDL_BLENDMODE_BLEND) */ SDL_SetSurfaceBlendMode(__pyx_v_source->surface, SDL_BLENDMODE_NONE); /* "pygame_sdl2/surface.pyx":212 * colorkey = False * * if colorkey: # <<<<<<<<<<<<<< * SDL_SetSurfaceBlendMode(source.surface, SDL_BLENDMODE_NONE) * else: */ goto __pyx_L13; } /* "pygame_sdl2/surface.pyx":215 * SDL_SetSurfaceBlendMode(source.surface, SDL_BLENDMODE_NONE) * else: * SDL_SetSurfaceBlendMode(source.surface, SDL_BLENDMODE_BLEND) # <<<<<<<<<<<<<< * * to_sdl_rect(dest, &dest_rect, "dest") */ /*else*/ { SDL_SetSurfaceBlendMode(__pyx_v_source->surface, SDL_BLENDMODE_BLEND); } __pyx_L13:; /* "pygame_sdl2/surface.pyx":217 * SDL_SetSurfaceBlendMode(source.surface, SDL_BLENDMODE_BLEND) * * to_sdl_rect(dest, &dest_rect, "dest") # <<<<<<<<<<<<<< * * if area is not None: */ __pyx_t_8.__pyx_n = 1; __pyx_t_8.argname = __pyx_n_s_dest; __pyx_t_7 = __pyx_f_11pygame_sdl2_4rect_to_sdl_rect(__pyx_v_dest, (&__pyx_v_dest_rect), &__pyx_t_8); if (unlikely(__pyx_t_7 == -1)) __PYX_ERR(0, 217, __pyx_L1_error) /* "pygame_sdl2/surface.pyx":219 * to_sdl_rect(dest, &dest_rect, "dest") * * if area is not None: # <<<<<<<<<<<<<< * to_sdl_rect(area, &area_rect, "area") * area_ptr = &area_rect */ __pyx_t_1 = (__pyx_v_area != Py_None); __pyx_t_5 = (__pyx_t_1 != 0); if (__pyx_t_5) { /* "pygame_sdl2/surface.pyx":220 * * if area is not None: * to_sdl_rect(area, &area_rect, "area") # <<<<<<<<<<<<<< * area_ptr = &area_rect * */ __pyx_t_8.__pyx_n = 1; __pyx_t_8.argname = __pyx_n_s_area; __pyx_t_7 = __pyx_f_11pygame_sdl2_4rect_to_sdl_rect(__pyx_v_area, (&__pyx_v_area_rect), &__pyx_t_8); if (unlikely(__pyx_t_7 == -1)) __PYX_ERR(0, 220, __pyx_L1_error) /* "pygame_sdl2/surface.pyx":221 * if area is not None: * to_sdl_rect(area, &area_rect, "area") * area_ptr = &area_rect # <<<<<<<<<<<<<< * * with nogil: */ __pyx_v_area_ptr = (&__pyx_v_area_rect); /* "pygame_sdl2/surface.pyx":219 * to_sdl_rect(dest, &dest_rect, "dest") * * if area is not None: # <<<<<<<<<<<<<< * to_sdl_rect(area, &area_rect, "area") * area_ptr = &area_rect */ } /* "pygame_sdl2/surface.pyx":223 * area_ptr = &area_rect * * with nogil: # <<<<<<<<<<<<<< * * if source.surface.format.Amask or special_flags: */ { #ifdef WITH_THREAD PyThreadState *_save; Py_UNBLOCK_THREADS #endif /*try:*/ { /* "pygame_sdl2/surface.pyx":225 * with nogil: * * if source.surface.format.Amask or special_flags: # <<<<<<<<<<<<<< * err = pygame_Blit(source.surface, area_ptr, self.surface, &dest_rect, special_flags) * else: */ __pyx_t_1 = (__pyx_v_source->surface->format->Amask != 0); if (!__pyx_t_1) { } else { __pyx_t_5 = __pyx_t_1; goto __pyx_L19_bool_binop_done; } __pyx_t_1 = (__pyx_v_special_flags != 0); __pyx_t_5 = __pyx_t_1; __pyx_L19_bool_binop_done:; if (__pyx_t_5) { /* "pygame_sdl2/surface.pyx":226 * * if source.surface.format.Amask or special_flags: * err = pygame_Blit(source.surface, area_ptr, self.surface, &dest_rect, special_flags) # <<<<<<<<<<<<<< * else: * err = SDL_UpperBlit(source.surface, area_ptr, self.surface, &dest_rect) */ __pyx_v_err = pygame_Blit(__pyx_v_source->surface, __pyx_v_area_ptr, __pyx_v_self->surface, (&__pyx_v_dest_rect), __pyx_v_special_flags); /* "pygame_sdl2/surface.pyx":225 * with nogil: * * if source.surface.format.Amask or special_flags: # <<<<<<<<<<<<<< * err = pygame_Blit(source.surface, area_ptr, self.surface, &dest_rect, special_flags) * else: */ goto __pyx_L18; } /* "pygame_sdl2/surface.pyx":228 * err = pygame_Blit(source.surface, area_ptr, self.surface, &dest_rect, special_flags) * else: * err = SDL_UpperBlit(source.surface, area_ptr, self.surface, &dest_rect) # <<<<<<<<<<<<<< * * if err: */ /*else*/ { __pyx_v_err = SDL_UpperBlit(__pyx_v_source->surface, __pyx_v_area_ptr, __pyx_v_self->surface, (&__pyx_v_dest_rect)); } __pyx_L18:; } /* "pygame_sdl2/surface.pyx":223 * area_ptr = &area_rect * * with nogil: # <<<<<<<<<<<<<< * * if source.surface.format.Amask or special_flags: */ /*finally:*/ { /*normal exit:*/{ #ifdef WITH_THREAD Py_BLOCK_THREADS #endif goto __pyx_L17; } __pyx_L17:; } } /* "pygame_sdl2/surface.pyx":230 * err = SDL_UpperBlit(source.surface, area_ptr, self.surface, &dest_rect) * * if err: # <<<<<<<<<<<<<< * raise error() * */ __pyx_t_5 = (__pyx_v_err != 0); if (__pyx_t_5) { /* "pygame_sdl2/surface.pyx":231 * * if err: * raise error() # <<<<<<<<<<<<<< * * dirty = Rect(dest[0], dest[1], source.surface.w, source.surface.h) */ __pyx_t_6 = __Pyx_GetModuleGlobalName(__pyx_n_s_error); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 231, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __pyx_t_2 = NULL; if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_6))) { __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_6); if (likely(__pyx_t_2)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6); __Pyx_INCREF(__pyx_t_2); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_6, function); } } if (__pyx_t_2) { __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_t_6, __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 231, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } else { __pyx_t_3 = __Pyx_PyObject_CallNoArg(__pyx_t_6); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 231, __pyx_L1_error) } __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_Raise(__pyx_t_3, 0, 0, 0); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __PYX_ERR(0, 231, __pyx_L1_error) /* "pygame_sdl2/surface.pyx":230 * err = SDL_UpperBlit(source.surface, area_ptr, self.surface, &dest_rect) * * if err: # <<<<<<<<<<<<<< * raise error() * */ } /* "pygame_sdl2/surface.pyx":233 * raise error() * * dirty = Rect(dest[0], dest[1], source.surface.w, source.surface.h) # <<<<<<<<<<<<<< * return dirty.clip(self.get_rect()) * */ __pyx_t_6 = __Pyx_GetModuleGlobalName(__pyx_n_s_Rect); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 233, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __pyx_t_2 = __Pyx_GetItemInt(__pyx_v_dest, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 233, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_4 = __Pyx_GetItemInt(__pyx_v_dest, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 233, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_9 = __Pyx_PyInt_From_int(__pyx_v_source->surface->w); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 233, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); __pyx_t_10 = __Pyx_PyInt_From_int(__pyx_v_source->surface->h); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 233, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_10); __pyx_t_11 = NULL; __pyx_t_7 = 0; if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_6))) { __pyx_t_11 = PyMethod_GET_SELF(__pyx_t_6); if (likely(__pyx_t_11)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6); __Pyx_INCREF(__pyx_t_11); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_6, function); __pyx_t_7 = 1; } } #if CYTHON_FAST_PYCALL if (PyFunction_Check(__pyx_t_6)) { PyObject *__pyx_temp[5] = {__pyx_t_11, __pyx_t_2, __pyx_t_4, __pyx_t_9, __pyx_t_10}; __pyx_t_3 = __Pyx_PyFunction_FastCall(__pyx_t_6, __pyx_temp+1-__pyx_t_7, 4+__pyx_t_7); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 233, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0; __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; } else #endif #if CYTHON_FAST_PYCCALL if (__Pyx_PyFastCFunction_Check(__pyx_t_6)) { PyObject *__pyx_temp[5] = {__pyx_t_11, __pyx_t_2, __pyx_t_4, __pyx_t_9, __pyx_t_10}; __pyx_t_3 = __Pyx_PyCFunction_FastCall(__pyx_t_6, __pyx_temp+1-__pyx_t_7, 4+__pyx_t_7); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 233, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0; __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; } else #endif { __pyx_t_12 = PyTuple_New(4+__pyx_t_7); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 233, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_12); if (__pyx_t_11) { __Pyx_GIVEREF(__pyx_t_11); PyTuple_SET_ITEM(__pyx_t_12, 0, __pyx_t_11); __pyx_t_11 = NULL; } __Pyx_GIVEREF(__pyx_t_2); PyTuple_SET_ITEM(__pyx_t_12, 0+__pyx_t_7, __pyx_t_2); __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_12, 1+__pyx_t_7, __pyx_t_4); __Pyx_GIVEREF(__pyx_t_9); PyTuple_SET_ITEM(__pyx_t_12, 2+__pyx_t_7, __pyx_t_9); __Pyx_GIVEREF(__pyx_t_10); PyTuple_SET_ITEM(__pyx_t_12, 3+__pyx_t_7, __pyx_t_10); __pyx_t_2 = 0; __pyx_t_4 = 0; __pyx_t_9 = 0; __pyx_t_10 = 0; __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_12, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 233, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; } __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __pyx_v_dirty = __pyx_t_3; __pyx_t_3 = 0; /* "pygame_sdl2/surface.pyx":234 * * dirty = Rect(dest[0], dest[1], source.surface.w, source.surface.h) * return dirty.clip(self.get_rect()) # <<<<<<<<<<<<<< * * def convert(self, surface=None): */ __Pyx_XDECREF(__pyx_r); __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_dirty, __pyx_n_s_clip); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 234, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __pyx_t_10 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_get_rect); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 234, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_10); __pyx_t_9 = NULL; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_10))) { __pyx_t_9 = PyMethod_GET_SELF(__pyx_t_10); if (likely(__pyx_t_9)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_10); __Pyx_INCREF(__pyx_t_9); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_10, function); } } if (__pyx_t_9) { __pyx_t_12 = __Pyx_PyObject_CallOneArg(__pyx_t_10, __pyx_t_9); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 234, __pyx_L1_error) __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; } else { __pyx_t_12 = __Pyx_PyObject_CallNoArg(__pyx_t_10); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 234, __pyx_L1_error) } __Pyx_GOTREF(__pyx_t_12); __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; __pyx_t_10 = NULL; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_6))) { __pyx_t_10 = PyMethod_GET_SELF(__pyx_t_6); if (likely(__pyx_t_10)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6); __Pyx_INCREF(__pyx_t_10); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_6, function); } } if (!__pyx_t_10) { __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_t_6, __pyx_t_12); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 234, __pyx_L1_error) __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; __Pyx_GOTREF(__pyx_t_3); } else { #if CYTHON_FAST_PYCALL if (PyFunction_Check(__pyx_t_6)) { PyObject *__pyx_temp[2] = {__pyx_t_10, __pyx_t_12}; __pyx_t_3 = __Pyx_PyFunction_FastCall(__pyx_t_6, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 234, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0; __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; } else #endif #if CYTHON_FAST_PYCCALL if (__Pyx_PyFastCFunction_Check(__pyx_t_6)) { PyObject *__pyx_temp[2] = {__pyx_t_10, __pyx_t_12}; __pyx_t_3 = __Pyx_PyCFunction_FastCall(__pyx_t_6, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 234, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0; __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; } else #endif { __pyx_t_9 = PyTuple_New(1+1); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 234, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); __Pyx_GIVEREF(__pyx_t_10); PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_t_10); __pyx_t_10 = NULL; __Pyx_GIVEREF(__pyx_t_12); PyTuple_SET_ITEM(__pyx_t_9, 0+1, __pyx_t_12); __pyx_t_12 = 0; __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_9, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 234, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; } } __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __pyx_r = __pyx_t_3; __pyx_t_3 = 0; goto __pyx_L0; /* "pygame_sdl2/surface.pyx":179 * return "".format(self.surface.w, self.surface.h, self.surface.format.BitsPerPixel) * * def blit(self, Surface source, dest, area=None, int special_flags=0): # <<<<<<<<<<<<<< * cdef SDL_Rect dest_rect * cdef SDL_Rect area_rect */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_6); __Pyx_XDECREF(__pyx_t_9); __Pyx_XDECREF(__pyx_t_10); __Pyx_XDECREF(__pyx_t_11); __Pyx_XDECREF(__pyx_t_12); __Pyx_AddTraceback("pygame_sdl2.surface.Surface.blit", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF((PyObject *)__pyx_v_temp); __Pyx_XDECREF(__pyx_v_dirty); __Pyx_XDECREF((PyObject *)__pyx_v_source); __Pyx_XDECREF(__pyx_v_area); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/surface.pyx":236 * return dirty.clip(self.get_rect()) * * def convert(self, surface=None): # <<<<<<<<<<<<<< * if not isinstance(surface, Surface): * surface = pygame_sdl2.display.get_surface() */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_7surface_7Surface_13convert(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static PyObject *__pyx_pw_11pygame_sdl2_7surface_7Surface_13convert(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_surface = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("convert (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_surface,0}; PyObject* values[1] = {0}; values[0] = ((PyObject *)Py_None); if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (kw_args > 0) { PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_surface); if (value) { values[0] = value; kw_args--; } } } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "convert") < 0)) __PYX_ERR(0, 236, __pyx_L3_error) } } else { switch (PyTuple_GET_SIZE(__pyx_args)) { case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); case 0: break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_surface = values[0]; } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("convert", 0, 0, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 236, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("pygame_sdl2.surface.Surface.convert", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_11pygame_sdl2_7surface_7Surface_12convert(((struct __pyx_obj_11pygame_sdl2_7surface_Surface *)__pyx_v_self), __pyx_v_surface); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_7surface_7Surface_12convert(struct __pyx_obj_11pygame_sdl2_7surface_Surface *__pyx_v_self, PyObject *__pyx_v_surface) { SDL_PixelFormat *__pyx_v_sample_format; Uint32 __pyx_v_amask; Uint32 __pyx_v_rmask; Uint32 __pyx_v_gmask; Uint32 __pyx_v_bmask; Uint32 __pyx_v_pixel_format; SDL_Surface *__pyx_v_new_surface; CYTHON_UNUSED SDL_PixelFormat *__pyx_v_use_format; struct __pyx_obj_11pygame_sdl2_7surface_Surface *__pyx_v_rv = 0; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; int __pyx_t_2; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; PyObject *__pyx_t_5 = NULL; SDL_PixelFormat *__pyx_t_6; Uint32 __pyx_t_7; __Pyx_RefNannySetupContext("convert", 0); __Pyx_INCREF(__pyx_v_surface); /* "pygame_sdl2/surface.pyx":237 * * def convert(self, surface=None): * if not isinstance(surface, Surface): # <<<<<<<<<<<<<< * surface = pygame_sdl2.display.get_surface() * */ __pyx_t_1 = __Pyx_TypeCheck(__pyx_v_surface, __pyx_ptype_11pygame_sdl2_7surface_Surface); __pyx_t_2 = ((!(__pyx_t_1 != 0)) != 0); if (__pyx_t_2) { /* "pygame_sdl2/surface.pyx":238 * def convert(self, surface=None): * if not isinstance(surface, Surface): * surface = pygame_sdl2.display.get_surface() # <<<<<<<<<<<<<< * * if surface is None: */ __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_pygame_sdl2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 238, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_display); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 238, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_get_surface); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 238, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __pyx_t_5 = NULL; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_4))) { __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4); if (likely(__pyx_t_5)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4); __Pyx_INCREF(__pyx_t_5); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_4, function); } } if (__pyx_t_5) { __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_5); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 238, __pyx_L1_error) __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; } else { __pyx_t_3 = __Pyx_PyObject_CallNoArg(__pyx_t_4); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 238, __pyx_L1_error) } __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF_SET(__pyx_v_surface, __pyx_t_3); __pyx_t_3 = 0; /* "pygame_sdl2/surface.pyx":237 * * def convert(self, surface=None): * if not isinstance(surface, Surface): # <<<<<<<<<<<<<< * surface = pygame_sdl2.display.get_surface() * */ } /* "pygame_sdl2/surface.pyx":240 * surface = pygame_sdl2.display.get_surface() * * if surface is None: # <<<<<<<<<<<<<< * raise error("No video mode has been set.") * */ __pyx_t_2 = (__pyx_v_surface == Py_None); __pyx_t_1 = (__pyx_t_2 != 0); if (__pyx_t_1) { /* "pygame_sdl2/surface.pyx":241 * * if surface is None: * raise error("No video mode has been set.") # <<<<<<<<<<<<<< * * cdef SDL_PixelFormat *sample_format = ( surface).surface.format */ __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_error); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 241, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_tuple__2, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 241, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_Raise(__pyx_t_4, 0, 0, 0); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __PYX_ERR(0, 241, __pyx_L1_error) /* "pygame_sdl2/surface.pyx":240 * surface = pygame_sdl2.display.get_surface() * * if surface is None: # <<<<<<<<<<<<<< * raise error("No video mode has been set.") * */ } /* "pygame_sdl2/surface.pyx":243 * raise error("No video mode has been set.") * * cdef SDL_PixelFormat *sample_format = ( surface).surface.format # <<<<<<<<<<<<<< * * cdef Uint32 amask */ __pyx_t_6 = ((struct __pyx_obj_11pygame_sdl2_7surface_Surface *)__pyx_v_surface)->surface->format; __pyx_v_sample_format = __pyx_t_6; /* "pygame_sdl2/surface.pyx":254 * * # If the sample surface has alpha, use it. * if not sample_format.Amask: # <<<<<<<<<<<<<< * use_format = sample_format * */ __pyx_t_1 = ((!(__pyx_v_sample_format->Amask != 0)) != 0); if (__pyx_t_1) { /* "pygame_sdl2/surface.pyx":255 * # If the sample surface has alpha, use it. * if not sample_format.Amask: * use_format = sample_format # <<<<<<<<<<<<<< * * with nogil: */ __pyx_v_use_format = __pyx_v_sample_format; /* "pygame_sdl2/surface.pyx":257 * use_format = sample_format * * with nogil: # <<<<<<<<<<<<<< * new_surface = SDL_ConvertSurface(self.surface, sample_format, 0) * */ { #ifdef WITH_THREAD PyThreadState *_save; Py_UNBLOCK_THREADS #endif /*try:*/ { /* "pygame_sdl2/surface.pyx":258 * * with nogil: * new_surface = SDL_ConvertSurface(self.surface, sample_format, 0) # <<<<<<<<<<<<<< * * else: */ __pyx_v_new_surface = SDL_ConvertSurface(__pyx_v_self->surface, __pyx_v_sample_format, 0); } /* "pygame_sdl2/surface.pyx":257 * use_format = sample_format * * with nogil: # <<<<<<<<<<<<<< * new_surface = SDL_ConvertSurface(self.surface, sample_format, 0) * */ /*finally:*/ { /*normal exit:*/{ #ifdef WITH_THREAD Py_BLOCK_THREADS #endif goto __pyx_L8; } __pyx_L8:; } } /* "pygame_sdl2/surface.pyx":254 * * # If the sample surface has alpha, use it. * if not sample_format.Amask: # <<<<<<<<<<<<<< * use_format = sample_format * */ goto __pyx_L5; } /* "pygame_sdl2/surface.pyx":262 * else: * * rmask = sample_format.Rmask # <<<<<<<<<<<<<< * gmask = sample_format.Gmask * bmask = sample_format.Bmask */ /*else*/ { __pyx_t_7 = __pyx_v_sample_format->Rmask; __pyx_v_rmask = __pyx_t_7; /* "pygame_sdl2/surface.pyx":263 * * rmask = sample_format.Rmask * gmask = sample_format.Gmask # <<<<<<<<<<<<<< * bmask = sample_format.Bmask * amask = 0 */ __pyx_t_7 = __pyx_v_sample_format->Gmask; __pyx_v_gmask = __pyx_t_7; /* "pygame_sdl2/surface.pyx":264 * rmask = sample_format.Rmask * gmask = sample_format.Gmask * bmask = sample_format.Bmask # <<<<<<<<<<<<<< * amask = 0 * */ __pyx_t_7 = __pyx_v_sample_format->Bmask; __pyx_v_bmask = __pyx_t_7; /* "pygame_sdl2/surface.pyx":265 * gmask = sample_format.Gmask * bmask = sample_format.Bmask * amask = 0 # <<<<<<<<<<<<<< * * pixel_format = SDL_MasksToPixelFormatEnum(32, rmask, gmask, bmask, amask) */ __pyx_v_amask = 0; /* "pygame_sdl2/surface.pyx":267 * amask = 0 * * pixel_format = SDL_MasksToPixelFormatEnum(32, rmask, gmask, bmask, amask) # <<<<<<<<<<<<<< * * with nogil: */ __pyx_v_pixel_format = SDL_MasksToPixelFormatEnum(32, __pyx_v_rmask, __pyx_v_gmask, __pyx_v_bmask, __pyx_v_amask); /* "pygame_sdl2/surface.pyx":269 * pixel_format = SDL_MasksToPixelFormatEnum(32, rmask, gmask, bmask, amask) * * with nogil: # <<<<<<<<<<<<<< * new_surface = SDL_ConvertSurfaceFormat(self.surface, pixel_format, 0) * */ { #ifdef WITH_THREAD PyThreadState *_save; Py_UNBLOCK_THREADS #endif /*try:*/ { /* "pygame_sdl2/surface.pyx":270 * * with nogil: * new_surface = SDL_ConvertSurfaceFormat(self.surface, pixel_format, 0) # <<<<<<<<<<<<<< * * cdef Surface rv = Surface(()) */ __pyx_v_new_surface = SDL_ConvertSurfaceFormat(__pyx_v_self->surface, __pyx_v_pixel_format, 0); } /* "pygame_sdl2/surface.pyx":269 * pixel_format = SDL_MasksToPixelFormatEnum(32, rmask, gmask, bmask, amask) * * with nogil: # <<<<<<<<<<<<<< * new_surface = SDL_ConvertSurfaceFormat(self.surface, pixel_format, 0) * */ /*finally:*/ { /*normal exit:*/{ #ifdef WITH_THREAD Py_BLOCK_THREADS #endif goto __pyx_L11; } __pyx_L11:; } } } __pyx_L5:; /* "pygame_sdl2/surface.pyx":272 * new_surface = SDL_ConvertSurfaceFormat(self.surface, pixel_format, 0) * * cdef Surface rv = Surface(()) # <<<<<<<<<<<<<< * rv.take_surface(new_surface) * */ __pyx_t_4 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_11pygame_sdl2_7surface_Surface), __pyx_tuple__3, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 272, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_v_rv = ((struct __pyx_obj_11pygame_sdl2_7surface_Surface *)__pyx_t_4); __pyx_t_4 = 0; /* "pygame_sdl2/surface.pyx":273 * * cdef Surface rv = Surface(()) * rv.take_surface(new_surface) # <<<<<<<<<<<<<< * * return rv */ ((struct __pyx_vtabstruct_11pygame_sdl2_7surface_Surface *)__pyx_v_rv->__pyx_vtab)->take_surface(__pyx_v_rv, __pyx_v_new_surface); /* "pygame_sdl2/surface.pyx":275 * rv.take_surface(new_surface) * * return rv # <<<<<<<<<<<<<< * * def convert_alpha(self, Surface surface=None): */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(((PyObject *)__pyx_v_rv)); __pyx_r = ((PyObject *)__pyx_v_rv); goto __pyx_L0; /* "pygame_sdl2/surface.pyx":236 * return dirty.clip(self.get_rect()) * * def convert(self, surface=None): # <<<<<<<<<<<<<< * if not isinstance(surface, Surface): * surface = pygame_sdl2.display.get_surface() */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_5); __Pyx_AddTraceback("pygame_sdl2.surface.Surface.convert", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF((PyObject *)__pyx_v_rv); __Pyx_XDECREF(__pyx_v_surface); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/surface.pyx":277 * return rv * * def convert_alpha(self, Surface surface=None): # <<<<<<<<<<<<<< * if surface is None: * surface = pygame_sdl2.display.get_surface() */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_7surface_7Surface_15convert_alpha(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static PyObject *__pyx_pw_11pygame_sdl2_7surface_7Surface_15convert_alpha(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { struct __pyx_obj_11pygame_sdl2_7surface_Surface *__pyx_v_surface = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("convert_alpha (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_surface,0}; PyObject* values[1] = {0}; values[0] = (PyObject *)((struct __pyx_obj_11pygame_sdl2_7surface_Surface *)Py_None); if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (kw_args > 0) { PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_surface); if (value) { values[0] = value; kw_args--; } } } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "convert_alpha") < 0)) __PYX_ERR(0, 277, __pyx_L3_error) } } else { switch (PyTuple_GET_SIZE(__pyx_args)) { case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); case 0: break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_surface = ((struct __pyx_obj_11pygame_sdl2_7surface_Surface *)values[0]); } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("convert_alpha", 0, 0, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 277, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("pygame_sdl2.surface.Surface.convert_alpha", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_surface), __pyx_ptype_11pygame_sdl2_7surface_Surface, 1, "surface", 0))) __PYX_ERR(0, 277, __pyx_L1_error) __pyx_r = __pyx_pf_11pygame_sdl2_7surface_7Surface_14convert_alpha(((struct __pyx_obj_11pygame_sdl2_7surface_Surface *)__pyx_v_self), __pyx_v_surface); /* function exit code */ goto __pyx_L0; __pyx_L1_error:; __pyx_r = NULL; __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_7surface_7Surface_14convert_alpha(struct __pyx_obj_11pygame_sdl2_7surface_Surface *__pyx_v_self, struct __pyx_obj_11pygame_sdl2_7surface_Surface *__pyx_v_surface) { SDL_PixelFormat *__pyx_v_sample_format; Uint32 __pyx_v_amask; Uint32 __pyx_v_rmask; Uint32 __pyx_v_gmask; Uint32 __pyx_v_bmask; Uint32 __pyx_v_pixel_format; SDL_Surface *__pyx_v_new_surface; CYTHON_UNUSED SDL_PixelFormat *__pyx_v_use_format; struct __pyx_obj_11pygame_sdl2_7surface_Surface *__pyx_v_rv = 0; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; int __pyx_t_2; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; PyObject *__pyx_t_5 = NULL; SDL_PixelFormat *__pyx_t_6; Uint32 __pyx_t_7; __Pyx_RefNannySetupContext("convert_alpha", 0); __Pyx_INCREF((PyObject *)__pyx_v_surface); /* "pygame_sdl2/surface.pyx":278 * * def convert_alpha(self, Surface surface=None): * if surface is None: # <<<<<<<<<<<<<< * surface = pygame_sdl2.display.get_surface() * */ __pyx_t_1 = (((PyObject *)__pyx_v_surface) == Py_None); __pyx_t_2 = (__pyx_t_1 != 0); if (__pyx_t_2) { /* "pygame_sdl2/surface.pyx":279 * def convert_alpha(self, Surface surface=None): * if surface is None: * surface = pygame_sdl2.display.get_surface() # <<<<<<<<<<<<<< * * if surface is None: */ __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_pygame_sdl2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 279, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_display); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 279, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_get_surface); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 279, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __pyx_t_5 = NULL; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_4))) { __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4); if (likely(__pyx_t_5)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4); __Pyx_INCREF(__pyx_t_5); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_4, function); } } if (__pyx_t_5) { __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_5); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 279, __pyx_L1_error) __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; } else { __pyx_t_3 = __Pyx_PyObject_CallNoArg(__pyx_t_4); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 279, __pyx_L1_error) } __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_ptype_11pygame_sdl2_7surface_Surface))))) __PYX_ERR(0, 279, __pyx_L1_error) __Pyx_DECREF_SET(__pyx_v_surface, ((struct __pyx_obj_11pygame_sdl2_7surface_Surface *)__pyx_t_3)); __pyx_t_3 = 0; /* "pygame_sdl2/surface.pyx":278 * * def convert_alpha(self, Surface surface=None): * if surface is None: # <<<<<<<<<<<<<< * surface = pygame_sdl2.display.get_surface() * */ } /* "pygame_sdl2/surface.pyx":281 * surface = pygame_sdl2.display.get_surface() * * if surface is None: # <<<<<<<<<<<<<< * raise error("No video mode has been set.") * */ __pyx_t_2 = (((PyObject *)__pyx_v_surface) == Py_None); __pyx_t_1 = (__pyx_t_2 != 0); if (__pyx_t_1) { /* "pygame_sdl2/surface.pyx":282 * * if surface is None: * raise error("No video mode has been set.") # <<<<<<<<<<<<<< * * cdef SDL_PixelFormat *sample_format = surface.surface.format */ __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_error); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 282, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_tuple__4, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 282, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_Raise(__pyx_t_4, 0, 0, 0); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __PYX_ERR(0, 282, __pyx_L1_error) /* "pygame_sdl2/surface.pyx":281 * surface = pygame_sdl2.display.get_surface() * * if surface is None: # <<<<<<<<<<<<<< * raise error("No video mode has been set.") * */ } /* "pygame_sdl2/surface.pyx":284 * raise error("No video mode has been set.") * * cdef SDL_PixelFormat *sample_format = surface.surface.format # <<<<<<<<<<<<<< * * cdef Uint32 amask = 0xff000000 */ __pyx_t_6 = __pyx_v_surface->surface->format; __pyx_v_sample_format = __pyx_t_6; /* "pygame_sdl2/surface.pyx":286 * cdef SDL_PixelFormat *sample_format = surface.surface.format * * cdef Uint32 amask = 0xff000000 # <<<<<<<<<<<<<< * cdef Uint32 rmask = 0x00ff0000 * cdef Uint32 gmask = 0x0000ff00 */ __pyx_v_amask = 0xff000000; /* "pygame_sdl2/surface.pyx":287 * * cdef Uint32 amask = 0xff000000 * cdef Uint32 rmask = 0x00ff0000 # <<<<<<<<<<<<<< * cdef Uint32 gmask = 0x0000ff00 * cdef Uint32 bmask = 0x000000ff */ __pyx_v_rmask = 0x00ff0000; /* "pygame_sdl2/surface.pyx":288 * cdef Uint32 amask = 0xff000000 * cdef Uint32 rmask = 0x00ff0000 * cdef Uint32 gmask = 0x0000ff00 # <<<<<<<<<<<<<< * cdef Uint32 bmask = 0x000000ff * */ __pyx_v_gmask = 0x0000ff00; /* "pygame_sdl2/surface.pyx":289 * cdef Uint32 rmask = 0x00ff0000 * cdef Uint32 gmask = 0x0000ff00 * cdef Uint32 bmask = 0x000000ff # <<<<<<<<<<<<<< * * cdef Uint32 pixel_format */ __pyx_v_bmask = 0x000000ff; /* "pygame_sdl2/surface.pyx":295 * * # If the sample surface has alpha, use it. * if sample_format.Amask: # <<<<<<<<<<<<<< * use_format = sample_format * */ __pyx_t_1 = (__pyx_v_sample_format->Amask != 0); if (__pyx_t_1) { /* "pygame_sdl2/surface.pyx":296 * # If the sample surface has alpha, use it. * if sample_format.Amask: * use_format = sample_format # <<<<<<<<<<<<<< * * with nogil: */ __pyx_v_use_format = __pyx_v_sample_format; /* "pygame_sdl2/surface.pyx":298 * use_format = sample_format * * with nogil: # <<<<<<<<<<<<<< * new_surface = SDL_ConvertSurface(self.surface, sample_format, 0) * */ { #ifdef WITH_THREAD PyThreadState *_save; Py_UNBLOCK_THREADS #endif /*try:*/ { /* "pygame_sdl2/surface.pyx":299 * * with nogil: * new_surface = SDL_ConvertSurface(self.surface, sample_format, 0) # <<<<<<<<<<<<<< * * else: */ __pyx_v_new_surface = SDL_ConvertSurface(__pyx_v_self->surface, __pyx_v_sample_format, 0); } /* "pygame_sdl2/surface.pyx":298 * use_format = sample_format * * with nogil: # <<<<<<<<<<<<<< * new_surface = SDL_ConvertSurface(self.surface, sample_format, 0) * */ /*finally:*/ { /*normal exit:*/{ #ifdef WITH_THREAD Py_BLOCK_THREADS #endif goto __pyx_L8; } __pyx_L8:; } } /* "pygame_sdl2/surface.pyx":295 * * # If the sample surface has alpha, use it. * if sample_format.Amask: # <<<<<<<<<<<<<< * use_format = sample_format * */ goto __pyx_L5; } /* "pygame_sdl2/surface.pyx":303 * else: * * if sample_format.BytesPerPixel == 4: # <<<<<<<<<<<<<< * rmask = sample_format.Rmask * gmask = sample_format.Gmask */ /*else*/ { __pyx_t_1 = ((__pyx_v_sample_format->BytesPerPixel == 4) != 0); if (__pyx_t_1) { /* "pygame_sdl2/surface.pyx":304 * * if sample_format.BytesPerPixel == 4: * rmask = sample_format.Rmask # <<<<<<<<<<<<<< * gmask = sample_format.Gmask * bmask = sample_format.Bmask */ __pyx_t_7 = __pyx_v_sample_format->Rmask; __pyx_v_rmask = __pyx_t_7; /* "pygame_sdl2/surface.pyx":305 * if sample_format.BytesPerPixel == 4: * rmask = sample_format.Rmask * gmask = sample_format.Gmask # <<<<<<<<<<<<<< * bmask = sample_format.Bmask * amask = 0xffffffff & ~(rmask | gmask | bmask) */ __pyx_t_7 = __pyx_v_sample_format->Gmask; __pyx_v_gmask = __pyx_t_7; /* "pygame_sdl2/surface.pyx":306 * rmask = sample_format.Rmask * gmask = sample_format.Gmask * bmask = sample_format.Bmask # <<<<<<<<<<<<<< * amask = 0xffffffff & ~(rmask | gmask | bmask) * */ __pyx_t_7 = __pyx_v_sample_format->Bmask; __pyx_v_bmask = __pyx_t_7; /* "pygame_sdl2/surface.pyx":307 * gmask = sample_format.Gmask * bmask = sample_format.Bmask * amask = 0xffffffff & ~(rmask | gmask | bmask) # <<<<<<<<<<<<<< * * pixel_format = SDL_MasksToPixelFormatEnum(32, rmask, gmask, bmask, amask) */ __pyx_t_4 = __Pyx_PyInt_From_uint32_t((~((__pyx_v_rmask | __pyx_v_gmask) | __pyx_v_bmask))); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 307, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_3 = PyNumber_And(__pyx_int_4294967295, __pyx_t_4); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 307, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_t_7 = __Pyx_PyInt_As_uint32_t(__pyx_t_3); if (unlikely((__pyx_t_7 == ((Uint32)-1)) && PyErr_Occurred())) __PYX_ERR(0, 307, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_v_amask = __pyx_t_7; /* "pygame_sdl2/surface.pyx":303 * else: * * if sample_format.BytesPerPixel == 4: # <<<<<<<<<<<<<< * rmask = sample_format.Rmask * gmask = sample_format.Gmask */ } /* "pygame_sdl2/surface.pyx":309 * amask = 0xffffffff & ~(rmask | gmask | bmask) * * pixel_format = SDL_MasksToPixelFormatEnum(32, rmask, gmask, bmask, amask) # <<<<<<<<<<<<<< * * with nogil: */ __pyx_v_pixel_format = SDL_MasksToPixelFormatEnum(32, __pyx_v_rmask, __pyx_v_gmask, __pyx_v_bmask, __pyx_v_amask); /* "pygame_sdl2/surface.pyx":311 * pixel_format = SDL_MasksToPixelFormatEnum(32, rmask, gmask, bmask, amask) * * with nogil: # <<<<<<<<<<<<<< * new_surface = SDL_ConvertSurfaceFormat(self.surface, pixel_format, 0) * */ { #ifdef WITH_THREAD PyThreadState *_save; Py_UNBLOCK_THREADS #endif /*try:*/ { /* "pygame_sdl2/surface.pyx":312 * * with nogil: * new_surface = SDL_ConvertSurfaceFormat(self.surface, pixel_format, 0) # <<<<<<<<<<<<<< * * cdef Surface rv = Surface(()) */ __pyx_v_new_surface = SDL_ConvertSurfaceFormat(__pyx_v_self->surface, __pyx_v_pixel_format, 0); } /* "pygame_sdl2/surface.pyx":311 * pixel_format = SDL_MasksToPixelFormatEnum(32, rmask, gmask, bmask, amask) * * with nogil: # <<<<<<<<<<<<<< * new_surface = SDL_ConvertSurfaceFormat(self.surface, pixel_format, 0) * */ /*finally:*/ { /*normal exit:*/{ #ifdef WITH_THREAD Py_BLOCK_THREADS #endif goto __pyx_L12; } __pyx_L12:; } } } __pyx_L5:; /* "pygame_sdl2/surface.pyx":314 * new_surface = SDL_ConvertSurfaceFormat(self.surface, pixel_format, 0) * * cdef Surface rv = Surface(()) # <<<<<<<<<<<<<< * rv.take_surface(new_surface) * */ __pyx_t_3 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_11pygame_sdl2_7surface_Surface), __pyx_tuple__5, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 314, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_v_rv = ((struct __pyx_obj_11pygame_sdl2_7surface_Surface *)__pyx_t_3); __pyx_t_3 = 0; /* "pygame_sdl2/surface.pyx":315 * * cdef Surface rv = Surface(()) * rv.take_surface(new_surface) # <<<<<<<<<<<<<< * * return rv */ ((struct __pyx_vtabstruct_11pygame_sdl2_7surface_Surface *)__pyx_v_rv->__pyx_vtab)->take_surface(__pyx_v_rv, __pyx_v_new_surface); /* "pygame_sdl2/surface.pyx":317 * rv.take_surface(new_surface) * * return rv # <<<<<<<<<<<<<< * * def copy(self): */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(((PyObject *)__pyx_v_rv)); __pyx_r = ((PyObject *)__pyx_v_rv); goto __pyx_L0; /* "pygame_sdl2/surface.pyx":277 * return rv * * def convert_alpha(self, Surface surface=None): # <<<<<<<<<<<<<< * if surface is None: * surface = pygame_sdl2.display.get_surface() */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_5); __Pyx_AddTraceback("pygame_sdl2.surface.Surface.convert_alpha", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF((PyObject *)__pyx_v_rv); __Pyx_XDECREF((PyObject *)__pyx_v_surface); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/surface.pyx":319 * return rv * * def copy(self): # <<<<<<<<<<<<<< * if self.surface.format.Amask: * return self.convert_alpha(self) */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_7surface_7Surface_17copy(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/ static PyObject *__pyx_pw_11pygame_sdl2_7surface_7Surface_17copy(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("copy (wrapper)", 0); __pyx_r = __pyx_pf_11pygame_sdl2_7surface_7Surface_16copy(((struct __pyx_obj_11pygame_sdl2_7surface_Surface *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_7surface_7Surface_16copy(struct __pyx_obj_11pygame_sdl2_7surface_Surface *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; PyObject *__pyx_t_5 = NULL; __Pyx_RefNannySetupContext("copy", 0); /* "pygame_sdl2/surface.pyx":320 * * def copy(self): * if self.surface.format.Amask: # <<<<<<<<<<<<<< * return self.convert_alpha(self) * else: */ __pyx_t_1 = (__pyx_v_self->surface->format->Amask != 0); if (__pyx_t_1) { /* "pygame_sdl2/surface.pyx":321 * def copy(self): * if self.surface.format.Amask: * return self.convert_alpha(self) # <<<<<<<<<<<<<< * else: * return self.convert(self) */ __Pyx_XDECREF(__pyx_r); __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_convert_alpha); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 321, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = NULL; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) { __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3); if (likely(__pyx_t_4)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); __Pyx_INCREF(__pyx_t_4); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_3, function); } } if (!__pyx_t_4) { __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_3, ((PyObject *)__pyx_v_self)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 321, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); } else { #if CYTHON_FAST_PYCALL if (PyFunction_Check(__pyx_t_3)) { PyObject *__pyx_temp[2] = {__pyx_t_4, ((PyObject *)__pyx_v_self)}; __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_3, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 321, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_GOTREF(__pyx_t_2); } else #endif #if CYTHON_FAST_PYCCALL if (__Pyx_PyFastCFunction_Check(__pyx_t_3)) { PyObject *__pyx_temp[2] = {__pyx_t_4, ((PyObject *)__pyx_v_self)}; __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 321, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_GOTREF(__pyx_t_2); } else #endif { __pyx_t_5 = PyTuple_New(1+1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 321, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_4); __pyx_t_4 = NULL; __Pyx_INCREF(((PyObject *)__pyx_v_self)); __Pyx_GIVEREF(((PyObject *)__pyx_v_self)); PyTuple_SET_ITEM(__pyx_t_5, 0+1, ((PyObject *)__pyx_v_self)); __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_5, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 321, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; } } __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; /* "pygame_sdl2/surface.pyx":320 * * def copy(self): * if self.surface.format.Amask: # <<<<<<<<<<<<<< * return self.convert_alpha(self) * else: */ } /* "pygame_sdl2/surface.pyx":323 * return self.convert_alpha(self) * else: * return self.convert(self) # <<<<<<<<<<<<<< * * def fill(self, color, rect=None, special_flags=0): */ /*else*/ { __Pyx_XDECREF(__pyx_r); __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_convert); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 323, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_5 = NULL; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) { __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_3); if (likely(__pyx_t_5)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); __Pyx_INCREF(__pyx_t_5); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_3, function); } } if (!__pyx_t_5) { __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_3, ((PyObject *)__pyx_v_self)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 323, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); } else { #if CYTHON_FAST_PYCALL if (PyFunction_Check(__pyx_t_3)) { PyObject *__pyx_temp[2] = {__pyx_t_5, ((PyObject *)__pyx_v_self)}; __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_3, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 323, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_GOTREF(__pyx_t_2); } else #endif #if CYTHON_FAST_PYCCALL if (__Pyx_PyFastCFunction_Check(__pyx_t_3)) { PyObject *__pyx_temp[2] = {__pyx_t_5, ((PyObject *)__pyx_v_self)}; __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 323, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_GOTREF(__pyx_t_2); } else #endif { __pyx_t_4 = PyTuple_New(1+1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 323, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_5); __pyx_t_5 = NULL; __Pyx_INCREF(((PyObject *)__pyx_v_self)); __Pyx_GIVEREF(((PyObject *)__pyx_v_self)); PyTuple_SET_ITEM(__pyx_t_4, 0+1, ((PyObject *)__pyx_v_self)); __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_4, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 323, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; } } __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; } /* "pygame_sdl2/surface.pyx":319 * return rv * * def copy(self): # <<<<<<<<<<<<<< * if self.surface.format.Amask: * return self.convert_alpha(self) */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_5); __Pyx_AddTraceback("pygame_sdl2.surface.Surface.copy", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/surface.pyx":325 * return self.convert(self) * * def fill(self, color, rect=None, special_flags=0): # <<<<<<<<<<<<<< * * cdef SDL_Rect sdl_rect */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_7surface_7Surface_19fill(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static PyObject *__pyx_pw_11pygame_sdl2_7surface_7Surface_19fill(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_color = 0; PyObject *__pyx_v_rect = 0; CYTHON_UNUSED PyObject *__pyx_v_special_flags = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("fill (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_color,&__pyx_n_s_rect,&__pyx_n_s_special_flags,0}; PyObject* values[3] = {0,0,0}; values[1] = ((PyObject *)Py_None); values[2] = ((PyObject *)__pyx_int_0); if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_color)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; case 1: if (kw_args > 0) { PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_rect); if (value) { values[1] = value; kw_args--; } } case 2: if (kw_args > 0) { PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_special_flags); if (value) { values[2] = value; kw_args--; } } } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "fill") < 0)) __PYX_ERR(0, 325, __pyx_L3_error) } } else { switch (PyTuple_GET_SIZE(__pyx_args)) { case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_color = values[0]; __pyx_v_rect = values[1]; __pyx_v_special_flags = values[2]; } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("fill", 0, 1, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 325, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("pygame_sdl2.surface.Surface.fill", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_11pygame_sdl2_7surface_7Surface_18fill(((struct __pyx_obj_11pygame_sdl2_7surface_Surface *)__pyx_v_self), __pyx_v_color, __pyx_v_rect, __pyx_v_special_flags); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_7surface_7Surface_18fill(struct __pyx_obj_11pygame_sdl2_7surface_Surface *__pyx_v_self, PyObject *__pyx_v_color, PyObject *__pyx_v_rect, CYTHON_UNUSED PyObject *__pyx_v_special_flags) { SDL_Rect __pyx_v_sdl_rect; Uint32 __pyx_v_pixel; int __pyx_v_err; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations Uint32 __pyx_t_1; int __pyx_t_2; int __pyx_t_3; int __pyx_t_4; PyObject *__pyx_t_5 = NULL; PyObject *__pyx_t_6 = NULL; PyObject *__pyx_t_7 = NULL; PyObject *__pyx_t_8 = NULL; PyObject *__pyx_t_9 = NULL; PyObject *__pyx_t_10 = NULL; PyObject *__pyx_t_11 = NULL; PyObject *__pyx_t_12 = NULL; __Pyx_RefNannySetupContext("fill", 0); /* "pygame_sdl2/surface.pyx":328 * * cdef SDL_Rect sdl_rect * cdef Uint32 pixel = map_color(self.surface, color) # <<<<<<<<<<<<<< * cdef int err * */ __pyx_t_1 = __pyx_f_11pygame_sdl2_5color_map_color(__pyx_v_self->surface, __pyx_v_color); if (unlikely(__pyx_t_1 == 0xaabbccdd && PyErr_Occurred())) __PYX_ERR(0, 328, __pyx_L1_error) __pyx_v_pixel = __pyx_t_1; /* "pygame_sdl2/surface.pyx":331 * cdef int err * * if rect is not None: # <<<<<<<<<<<<<< * to_sdl_rect(rect, &sdl_rect) * */ __pyx_t_2 = (__pyx_v_rect != Py_None); __pyx_t_3 = (__pyx_t_2 != 0); if (__pyx_t_3) { /* "pygame_sdl2/surface.pyx":332 * * if rect is not None: * to_sdl_rect(rect, &sdl_rect) # <<<<<<<<<<<<<< * * if sdl_rect.x < 0: */ __pyx_t_4 = __pyx_f_11pygame_sdl2_4rect_to_sdl_rect(__pyx_v_rect, (&__pyx_v_sdl_rect), NULL); if (unlikely(__pyx_t_4 == -1)) __PYX_ERR(0, 332, __pyx_L1_error) /* "pygame_sdl2/surface.pyx":334 * to_sdl_rect(rect, &sdl_rect) * * if sdl_rect.x < 0: # <<<<<<<<<<<<<< * sdl_rect.w = sdl_rect.w + sdl_rect.x * sdl_rect.x = 0 */ __pyx_t_3 = ((__pyx_v_sdl_rect.x < 0) != 0); if (__pyx_t_3) { /* "pygame_sdl2/surface.pyx":335 * * if sdl_rect.x < 0: * sdl_rect.w = sdl_rect.w + sdl_rect.x # <<<<<<<<<<<<<< * sdl_rect.x = 0 * */ __pyx_v_sdl_rect.w = (__pyx_v_sdl_rect.w + __pyx_v_sdl_rect.x); /* "pygame_sdl2/surface.pyx":336 * if sdl_rect.x < 0: * sdl_rect.w = sdl_rect.w + sdl_rect.x * sdl_rect.x = 0 # <<<<<<<<<<<<<< * * if sdl_rect.y < 0: */ __pyx_v_sdl_rect.x = 0; /* "pygame_sdl2/surface.pyx":334 * to_sdl_rect(rect, &sdl_rect) * * if sdl_rect.x < 0: # <<<<<<<<<<<<<< * sdl_rect.w = sdl_rect.w + sdl_rect.x * sdl_rect.x = 0 */ } /* "pygame_sdl2/surface.pyx":338 * sdl_rect.x = 0 * * if sdl_rect.y < 0: # <<<<<<<<<<<<<< * sdl_rect.w = sdl_rect.h + sdl_rect.y * sdl_rect.y = 0 */ __pyx_t_3 = ((__pyx_v_sdl_rect.y < 0) != 0); if (__pyx_t_3) { /* "pygame_sdl2/surface.pyx":339 * * if sdl_rect.y < 0: * sdl_rect.w = sdl_rect.h + sdl_rect.y # <<<<<<<<<<<<<< * sdl_rect.y = 0 * */ __pyx_v_sdl_rect.w = (__pyx_v_sdl_rect.h + __pyx_v_sdl_rect.y); /* "pygame_sdl2/surface.pyx":340 * if sdl_rect.y < 0: * sdl_rect.w = sdl_rect.h + sdl_rect.y * sdl_rect.y = 0 # <<<<<<<<<<<<<< * * if sdl_rect.w <= 0 or sdl_rect.h <= 0: */ __pyx_v_sdl_rect.y = 0; /* "pygame_sdl2/surface.pyx":338 * sdl_rect.x = 0 * * if sdl_rect.y < 0: # <<<<<<<<<<<<<< * sdl_rect.w = sdl_rect.h + sdl_rect.y * sdl_rect.y = 0 */ } /* "pygame_sdl2/surface.pyx":342 * sdl_rect.y = 0 * * if sdl_rect.w <= 0 or sdl_rect.h <= 0: # <<<<<<<<<<<<<< * return Rect(0, 0, 0, 0) * */ __pyx_t_2 = ((__pyx_v_sdl_rect.w <= 0) != 0); if (!__pyx_t_2) { } else { __pyx_t_3 = __pyx_t_2; goto __pyx_L7_bool_binop_done; } __pyx_t_2 = ((__pyx_v_sdl_rect.h <= 0) != 0); __pyx_t_3 = __pyx_t_2; __pyx_L7_bool_binop_done:; if (__pyx_t_3) { /* "pygame_sdl2/surface.pyx":343 * * if sdl_rect.w <= 0 or sdl_rect.h <= 0: * return Rect(0, 0, 0, 0) # <<<<<<<<<<<<<< * * with nogil: */ __Pyx_XDECREF(__pyx_r); __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_Rect); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 343, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_tuple__6, NULL); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 343, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __pyx_r = __pyx_t_6; __pyx_t_6 = 0; goto __pyx_L0; /* "pygame_sdl2/surface.pyx":342 * sdl_rect.y = 0 * * if sdl_rect.w <= 0 or sdl_rect.h <= 0: # <<<<<<<<<<<<<< * return Rect(0, 0, 0, 0) * */ } /* "pygame_sdl2/surface.pyx":345 * return Rect(0, 0, 0, 0) * * with nogil: # <<<<<<<<<<<<<< * err = SDL_FillRect(self.surface, &sdl_rect, pixel) * */ { #ifdef WITH_THREAD PyThreadState *_save; Py_UNBLOCK_THREADS #endif /*try:*/ { /* "pygame_sdl2/surface.pyx":346 * * with nogil: * err = SDL_FillRect(self.surface, &sdl_rect, pixel) # <<<<<<<<<<<<<< * * if err: */ __pyx_v_err = SDL_FillRect(__pyx_v_self->surface, (&__pyx_v_sdl_rect), __pyx_v_pixel); } /* "pygame_sdl2/surface.pyx":345 * return Rect(0, 0, 0, 0) * * with nogil: # <<<<<<<<<<<<<< * err = SDL_FillRect(self.surface, &sdl_rect, pixel) * */ /*finally:*/ { /*normal exit:*/{ #ifdef WITH_THREAD Py_BLOCK_THREADS #endif goto __pyx_L11; } __pyx_L11:; } } /* "pygame_sdl2/surface.pyx":348 * err = SDL_FillRect(self.surface, &sdl_rect, pixel) * * if err: # <<<<<<<<<<<<<< * raise error() * */ __pyx_t_3 = (__pyx_v_err != 0); if (__pyx_t_3) { /* "pygame_sdl2/surface.pyx":349 * * if err: * raise error() # <<<<<<<<<<<<<< * * return Rect(sdl_rect.x, sdl_rect.y, sdl_rect.w, sdl_rect.h) */ __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_error); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 349, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_7 = NULL; if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_5))) { __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_5); if (likely(__pyx_t_7)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5); __Pyx_INCREF(__pyx_t_7); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_5, function); } } if (__pyx_t_7) { __pyx_t_6 = __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_t_7); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 349, __pyx_L1_error) __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; } else { __pyx_t_6 = __Pyx_PyObject_CallNoArg(__pyx_t_5); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 349, __pyx_L1_error) } __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_Raise(__pyx_t_6, 0, 0, 0); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __PYX_ERR(0, 349, __pyx_L1_error) /* "pygame_sdl2/surface.pyx":348 * err = SDL_FillRect(self.surface, &sdl_rect, pixel) * * if err: # <<<<<<<<<<<<<< * raise error() * */ } /* "pygame_sdl2/surface.pyx":351 * raise error() * * return Rect(sdl_rect.x, sdl_rect.y, sdl_rect.w, sdl_rect.h) # <<<<<<<<<<<<<< * * else: */ __Pyx_XDECREF(__pyx_r); __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_Rect); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 351, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_7 = __Pyx_PyInt_From_int(__pyx_v_sdl_rect.x); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 351, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __pyx_t_8 = __Pyx_PyInt_From_int(__pyx_v_sdl_rect.y); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 351, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __pyx_t_9 = __Pyx_PyInt_From_int(__pyx_v_sdl_rect.w); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 351, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); __pyx_t_10 = __Pyx_PyInt_From_int(__pyx_v_sdl_rect.h); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 351, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_10); __pyx_t_11 = NULL; __pyx_t_4 = 0; if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_5))) { __pyx_t_11 = PyMethod_GET_SELF(__pyx_t_5); if (likely(__pyx_t_11)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5); __Pyx_INCREF(__pyx_t_11); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_5, function); __pyx_t_4 = 1; } } #if CYTHON_FAST_PYCALL if (PyFunction_Check(__pyx_t_5)) { PyObject *__pyx_temp[5] = {__pyx_t_11, __pyx_t_7, __pyx_t_8, __pyx_t_9, __pyx_t_10}; __pyx_t_6 = __Pyx_PyFunction_FastCall(__pyx_t_5, __pyx_temp+1-__pyx_t_4, 4+__pyx_t_4); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 351, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0; __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; } else #endif #if CYTHON_FAST_PYCCALL if (__Pyx_PyFastCFunction_Check(__pyx_t_5)) { PyObject *__pyx_temp[5] = {__pyx_t_11, __pyx_t_7, __pyx_t_8, __pyx_t_9, __pyx_t_10}; __pyx_t_6 = __Pyx_PyCFunction_FastCall(__pyx_t_5, __pyx_temp+1-__pyx_t_4, 4+__pyx_t_4); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 351, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0; __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; } else #endif { __pyx_t_12 = PyTuple_New(4+__pyx_t_4); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 351, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_12); if (__pyx_t_11) { __Pyx_GIVEREF(__pyx_t_11); PyTuple_SET_ITEM(__pyx_t_12, 0, __pyx_t_11); __pyx_t_11 = NULL; } __Pyx_GIVEREF(__pyx_t_7); PyTuple_SET_ITEM(__pyx_t_12, 0+__pyx_t_4, __pyx_t_7); __Pyx_GIVEREF(__pyx_t_8); PyTuple_SET_ITEM(__pyx_t_12, 1+__pyx_t_4, __pyx_t_8); __Pyx_GIVEREF(__pyx_t_9); PyTuple_SET_ITEM(__pyx_t_12, 2+__pyx_t_4, __pyx_t_9); __Pyx_GIVEREF(__pyx_t_10); PyTuple_SET_ITEM(__pyx_t_12, 3+__pyx_t_4, __pyx_t_10); __pyx_t_7 = 0; __pyx_t_8 = 0; __pyx_t_9 = 0; __pyx_t_10 = 0; __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_12, NULL); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 351, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; } __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __pyx_r = __pyx_t_6; __pyx_t_6 = 0; goto __pyx_L0; /* "pygame_sdl2/surface.pyx":331 * cdef int err * * if rect is not None: # <<<<<<<<<<<<<< * to_sdl_rect(rect, &sdl_rect) * */ } /* "pygame_sdl2/surface.pyx":354 * * else: * with nogil: # <<<<<<<<<<<<<< * err = SDL_FillRect(self.surface, NULL, pixel) * */ /*else*/ { { #ifdef WITH_THREAD PyThreadState *_save; Py_UNBLOCK_THREADS #endif /*try:*/ { /* "pygame_sdl2/surface.pyx":355 * else: * with nogil: * err = SDL_FillRect(self.surface, NULL, pixel) # <<<<<<<<<<<<<< * * if err: */ __pyx_v_err = SDL_FillRect(__pyx_v_self->surface, NULL, __pyx_v_pixel); } /* "pygame_sdl2/surface.pyx":354 * * else: * with nogil: # <<<<<<<<<<<<<< * err = SDL_FillRect(self.surface, NULL, pixel) * */ /*finally:*/ { /*normal exit:*/{ #ifdef WITH_THREAD Py_BLOCK_THREADS #endif goto __pyx_L15; } __pyx_L15:; } } /* "pygame_sdl2/surface.pyx":357 * err = SDL_FillRect(self.surface, NULL, pixel) * * if err: # <<<<<<<<<<<<<< * raise error() * */ __pyx_t_3 = (__pyx_v_err != 0); if (__pyx_t_3) { /* "pygame_sdl2/surface.pyx":358 * * if err: * raise error() # <<<<<<<<<<<<<< * * return Rect(0, 0, self.surface.w, self.surface.h) */ __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_error); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 358, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_12 = NULL; if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_5))) { __pyx_t_12 = PyMethod_GET_SELF(__pyx_t_5); if (likely(__pyx_t_12)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5); __Pyx_INCREF(__pyx_t_12); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_5, function); } } if (__pyx_t_12) { __pyx_t_6 = __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_t_12); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 358, __pyx_L1_error) __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; } else { __pyx_t_6 = __Pyx_PyObject_CallNoArg(__pyx_t_5); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 358, __pyx_L1_error) } __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_Raise(__pyx_t_6, 0, 0, 0); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __PYX_ERR(0, 358, __pyx_L1_error) /* "pygame_sdl2/surface.pyx":357 * err = SDL_FillRect(self.surface, NULL, pixel) * * if err: # <<<<<<<<<<<<<< * raise error() * */ } /* "pygame_sdl2/surface.pyx":360 * raise error() * * return Rect(0, 0, self.surface.w, self.surface.h) # <<<<<<<<<<<<<< * * */ __Pyx_XDECREF(__pyx_r); __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_Rect); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 360, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_12 = __Pyx_PyInt_From_int(__pyx_v_self->surface->w); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 360, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_12); __pyx_t_10 = __Pyx_PyInt_From_int(__pyx_v_self->surface->h); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 360, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_10); __pyx_t_9 = NULL; __pyx_t_4 = 0; if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_5))) { __pyx_t_9 = PyMethod_GET_SELF(__pyx_t_5); if (likely(__pyx_t_9)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5); __Pyx_INCREF(__pyx_t_9); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_5, function); __pyx_t_4 = 1; } } #if CYTHON_FAST_PYCALL if (PyFunction_Check(__pyx_t_5)) { PyObject *__pyx_temp[5] = {__pyx_t_9, __pyx_int_0, __pyx_int_0, __pyx_t_12, __pyx_t_10}; __pyx_t_6 = __Pyx_PyFunction_FastCall(__pyx_t_5, __pyx_temp+1-__pyx_t_4, 4+__pyx_t_4); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 360, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0; __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; } else #endif #if CYTHON_FAST_PYCCALL if (__Pyx_PyFastCFunction_Check(__pyx_t_5)) { PyObject *__pyx_temp[5] = {__pyx_t_9, __pyx_int_0, __pyx_int_0, __pyx_t_12, __pyx_t_10}; __pyx_t_6 = __Pyx_PyCFunction_FastCall(__pyx_t_5, __pyx_temp+1-__pyx_t_4, 4+__pyx_t_4); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 360, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0; __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; } else #endif { __pyx_t_8 = PyTuple_New(4+__pyx_t_4); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 360, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); if (__pyx_t_9) { __Pyx_GIVEREF(__pyx_t_9); PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_9); __pyx_t_9 = NULL; } __Pyx_INCREF(__pyx_int_0); __Pyx_GIVEREF(__pyx_int_0); PyTuple_SET_ITEM(__pyx_t_8, 0+__pyx_t_4, __pyx_int_0); __Pyx_INCREF(__pyx_int_0); __Pyx_GIVEREF(__pyx_int_0); PyTuple_SET_ITEM(__pyx_t_8, 1+__pyx_t_4, __pyx_int_0); __Pyx_GIVEREF(__pyx_t_12); PyTuple_SET_ITEM(__pyx_t_8, 2+__pyx_t_4, __pyx_t_12); __Pyx_GIVEREF(__pyx_t_10); PyTuple_SET_ITEM(__pyx_t_8, 3+__pyx_t_4, __pyx_t_10); __pyx_t_12 = 0; __pyx_t_10 = 0; __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_8, NULL); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 360, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; } __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __pyx_r = __pyx_t_6; __pyx_t_6 = 0; goto __pyx_L0; } /* "pygame_sdl2/surface.pyx":325 * return self.convert(self) * * def fill(self, color, rect=None, special_flags=0): # <<<<<<<<<<<<<< * * cdef SDL_Rect sdl_rect */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_5); __Pyx_XDECREF(__pyx_t_6); __Pyx_XDECREF(__pyx_t_7); __Pyx_XDECREF(__pyx_t_8); __Pyx_XDECREF(__pyx_t_9); __Pyx_XDECREF(__pyx_t_10); __Pyx_XDECREF(__pyx_t_11); __Pyx_XDECREF(__pyx_t_12); __Pyx_AddTraceback("pygame_sdl2.surface.Surface.fill", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/surface.pyx":363 * * * def scroll(self, int dx=0, int dy=0): # <<<<<<<<<<<<<< * cdef int srcx, destx, move_width * cdef int srcy, desty, move_height */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_7surface_7Surface_21scroll(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static PyObject *__pyx_pw_11pygame_sdl2_7surface_7Surface_21scroll(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { int __pyx_v_dx; int __pyx_v_dy; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("scroll (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_dx,&__pyx_n_s_dy,0}; PyObject* values[2] = {0,0}; if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (kw_args > 0) { PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_dx); if (value) { values[0] = value; kw_args--; } } case 1: if (kw_args > 0) { PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_dy); if (value) { values[1] = value; kw_args--; } } } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "scroll") < 0)) __PYX_ERR(0, 363, __pyx_L3_error) } } else { switch (PyTuple_GET_SIZE(__pyx_args)) { case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); case 0: break; default: goto __pyx_L5_argtuple_error; } } if (values[0]) { __pyx_v_dx = __Pyx_PyInt_As_int(values[0]); if (unlikely((__pyx_v_dx == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 363, __pyx_L3_error) } else { __pyx_v_dx = ((int)0); } if (values[1]) { __pyx_v_dy = __Pyx_PyInt_As_int(values[1]); if (unlikely((__pyx_v_dy == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 363, __pyx_L3_error) } else { __pyx_v_dy = ((int)0); } } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("scroll", 0, 0, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 363, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("pygame_sdl2.surface.Surface.scroll", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_11pygame_sdl2_7surface_7Surface_20scroll(((struct __pyx_obj_11pygame_sdl2_7surface_Surface *)__pyx_v_self), __pyx_v_dx, __pyx_v_dy); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_7surface_7Surface_20scroll(struct __pyx_obj_11pygame_sdl2_7surface_Surface *__pyx_v_self, int __pyx_v_dx, int __pyx_v_dy) { int __pyx_v_srcx; int __pyx_v_destx; int __pyx_v_move_width; int __pyx_v_srcy; int __pyx_v_desty; int __pyx_v_move_height; int __pyx_v_width; int __pyx_v_height; int __pyx_v_per_pixel; Uint8 *__pyx_v_srcptr; Uint8 *__pyx_v_destptr; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; Uint8 __pyx_t_2; int __pyx_t_3; PyObject *__pyx_t_4 = NULL; PyObject *__pyx_t_5 = NULL; PyObject *__pyx_t_6 = NULL; __Pyx_RefNannySetupContext("scroll", 0); /* "pygame_sdl2/surface.pyx":367 * cdef int srcy, desty, move_height * * cdef int width = self.surface.w # <<<<<<<<<<<<<< * cdef int height = self.surface.h * */ __pyx_t_1 = __pyx_v_self->surface->w; __pyx_v_width = __pyx_t_1; /* "pygame_sdl2/surface.pyx":368 * * cdef int width = self.surface.w * cdef int height = self.surface.h # <<<<<<<<<<<<<< * * cdef int per_pixel = self.surface.format.BytesPerPixel */ __pyx_t_1 = __pyx_v_self->surface->h; __pyx_v_height = __pyx_t_1; /* "pygame_sdl2/surface.pyx":370 * cdef int height = self.surface.h * * cdef int per_pixel = self.surface.format.BytesPerPixel # <<<<<<<<<<<<<< * * if dx >= 0: */ __pyx_t_2 = __pyx_v_self->surface->format->BytesPerPixel; __pyx_v_per_pixel = __pyx_t_2; /* "pygame_sdl2/surface.pyx":372 * cdef int per_pixel = self.surface.format.BytesPerPixel * * if dx >= 0: # <<<<<<<<<<<<<< * srcx = 0 * destx = dx */ __pyx_t_3 = ((__pyx_v_dx >= 0) != 0); if (__pyx_t_3) { /* "pygame_sdl2/surface.pyx":373 * * if dx >= 0: * srcx = 0 # <<<<<<<<<<<<<< * destx = dx * move_width = width - dx */ __pyx_v_srcx = 0; /* "pygame_sdl2/surface.pyx":374 * if dx >= 0: * srcx = 0 * destx = dx # <<<<<<<<<<<<<< * move_width = width - dx * else: */ __pyx_v_destx = __pyx_v_dx; /* "pygame_sdl2/surface.pyx":375 * srcx = 0 * destx = dx * move_width = width - dx # <<<<<<<<<<<<<< * else: * srcx = -dx */ __pyx_v_move_width = (__pyx_v_width - __pyx_v_dx); /* "pygame_sdl2/surface.pyx":372 * cdef int per_pixel = self.surface.format.BytesPerPixel * * if dx >= 0: # <<<<<<<<<<<<<< * srcx = 0 * destx = dx */ goto __pyx_L3; } /* "pygame_sdl2/surface.pyx":377 * move_width = width - dx * else: * srcx = -dx # <<<<<<<<<<<<<< * destx = 0 * move_width = width + dx */ /*else*/ { __pyx_v_srcx = (-__pyx_v_dx); /* "pygame_sdl2/surface.pyx":378 * else: * srcx = -dx * destx = 0 # <<<<<<<<<<<<<< * move_width = width + dx * */ __pyx_v_destx = 0; /* "pygame_sdl2/surface.pyx":379 * srcx = -dx * destx = 0 * move_width = width + dx # <<<<<<<<<<<<<< * * if dy >= 0: */ __pyx_v_move_width = (__pyx_v_width + __pyx_v_dx); } __pyx_L3:; /* "pygame_sdl2/surface.pyx":381 * move_width = width + dx * * if dy >= 0: # <<<<<<<<<<<<<< * srcy = 0 * desty = dy */ __pyx_t_3 = ((__pyx_v_dy >= 0) != 0); if (__pyx_t_3) { /* "pygame_sdl2/surface.pyx":382 * * if dy >= 0: * srcy = 0 # <<<<<<<<<<<<<< * desty = dy * move_height = height - dy */ __pyx_v_srcy = 0; /* "pygame_sdl2/surface.pyx":383 * if dy >= 0: * srcy = 0 * desty = dy # <<<<<<<<<<<<<< * move_height = height - dy * else: */ __pyx_v_desty = __pyx_v_dy; /* "pygame_sdl2/surface.pyx":384 * srcy = 0 * desty = dy * move_height = height - dy # <<<<<<<<<<<<<< * else: * srcy = -dy */ __pyx_v_move_height = (__pyx_v_height - __pyx_v_dy); /* "pygame_sdl2/surface.pyx":381 * move_width = width + dx * * if dy >= 0: # <<<<<<<<<<<<<< * srcy = 0 * desty = dy */ goto __pyx_L4; } /* "pygame_sdl2/surface.pyx":386 * move_height = height - dy * else: * srcy = -dy # <<<<<<<<<<<<<< * desty = 0 * move_height = height + dy */ /*else*/ { __pyx_v_srcy = (-__pyx_v_dy); /* "pygame_sdl2/surface.pyx":387 * else: * srcy = -dy * desty = 0 # <<<<<<<<<<<<<< * move_height = height + dy * */ __pyx_v_desty = 0; /* "pygame_sdl2/surface.pyx":388 * srcy = -dy * desty = 0 * move_height = height + dy # <<<<<<<<<<<<<< * * cdef Uint8 *srcptr = self.surface.pixels */ __pyx_v_move_height = (__pyx_v_height + __pyx_v_dy); } __pyx_L4:; /* "pygame_sdl2/surface.pyx":390 * move_height = height + dy * * cdef Uint8 *srcptr = self.surface.pixels # <<<<<<<<<<<<<< * cdef Uint8 *destptr = self.surface.pixels * */ __pyx_v_srcptr = ((Uint8 *)__pyx_v_self->surface->pixels); /* "pygame_sdl2/surface.pyx":391 * * cdef Uint8 *srcptr = self.surface.pixels * cdef Uint8 *destptr = self.surface.pixels # <<<<<<<<<<<<<< * * srcptr += srcy * self.surface.pitch + srcx * per_pixel */ __pyx_v_destptr = ((Uint8 *)__pyx_v_self->surface->pixels); /* "pygame_sdl2/surface.pyx":393 * cdef Uint8 *destptr = self.surface.pixels * * srcptr += srcy * self.surface.pitch + srcx * per_pixel # <<<<<<<<<<<<<< * destptr += desty * self.surface.pitch + destx * per_pixel * */ __pyx_v_srcptr = (__pyx_v_srcptr + ((__pyx_v_srcy * __pyx_v_self->surface->pitch) + (__pyx_v_srcx * __pyx_v_per_pixel))); /* "pygame_sdl2/surface.pyx":394 * * srcptr += srcy * self.surface.pitch + srcx * per_pixel * destptr += desty * self.surface.pitch + destx * per_pixel # <<<<<<<<<<<<<< * * self.lock() */ __pyx_v_destptr = (__pyx_v_destptr + ((__pyx_v_desty * __pyx_v_self->surface->pitch) + (__pyx_v_destx * __pyx_v_per_pixel))); /* "pygame_sdl2/surface.pyx":396 * destptr += desty * self.surface.pitch + destx * per_pixel * * self.lock() # <<<<<<<<<<<<<< * * with nogil: */ __pyx_t_5 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_lock); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 396, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_6 = NULL; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_5))) { __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_5); if (likely(__pyx_t_6)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5); __Pyx_INCREF(__pyx_t_6); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_5, function); } } if (__pyx_t_6) { __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_t_6); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 396, __pyx_L1_error) __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; } else { __pyx_t_4 = __Pyx_PyObject_CallNoArg(__pyx_t_5); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 396, __pyx_L1_error) } __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; /* "pygame_sdl2/surface.pyx":398 * self.lock() * * with nogil: # <<<<<<<<<<<<<< * move_pixels( * srcptr, */ { #ifdef WITH_THREAD PyThreadState *_save; Py_UNBLOCK_THREADS #endif /*try:*/ { /* "pygame_sdl2/surface.pyx":399 * * with nogil: * move_pixels( # <<<<<<<<<<<<<< * srcptr, * destptr, */ __pyx_f_11pygame_sdl2_7surface_move_pixels(__pyx_v_srcptr, __pyx_v_destptr, __pyx_v_move_height, (__pyx_v_move_width * __pyx_v_per_pixel), __pyx_v_self->surface->pitch, __pyx_v_self->surface->pitch); } /* "pygame_sdl2/surface.pyx":398 * self.lock() * * with nogil: # <<<<<<<<<<<<<< * move_pixels( * srcptr, */ /*finally:*/ { /*normal exit:*/{ #ifdef WITH_THREAD Py_BLOCK_THREADS #endif goto __pyx_L7; } __pyx_L7:; } } /* "pygame_sdl2/surface.pyx":407 * self.surface.pitch) * * self.unlock() # <<<<<<<<<<<<<< * * def set_colorkey(self, color, flags=0): */ __pyx_t_5 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_unlock); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 407, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_6 = NULL; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_5))) { __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_5); if (likely(__pyx_t_6)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5); __Pyx_INCREF(__pyx_t_6); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_5, function); } } if (__pyx_t_6) { __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_t_6); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 407, __pyx_L1_error) __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; } else { __pyx_t_4 = __Pyx_PyObject_CallNoArg(__pyx_t_5); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 407, __pyx_L1_error) } __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; /* "pygame_sdl2/surface.pyx":363 * * * def scroll(self, int dx=0, int dy=0): # <<<<<<<<<<<<<< * cdef int srcx, destx, move_width * cdef int srcy, desty, move_height */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_5); __Pyx_XDECREF(__pyx_t_6); __Pyx_AddTraceback("pygame_sdl2.surface.Surface.scroll", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/surface.pyx":409 * self.unlock() * * def set_colorkey(self, color, flags=0): # <<<<<<<<<<<<<< * * if color is None: */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_7surface_7Surface_23set_colorkey(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static PyObject *__pyx_pw_11pygame_sdl2_7surface_7Surface_23set_colorkey(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_color = 0; CYTHON_UNUSED PyObject *__pyx_v_flags = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("set_colorkey (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_color,&__pyx_n_s_flags,0}; PyObject* values[2] = {0,0}; values[1] = ((PyObject *)__pyx_int_0); if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_color)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; case 1: if (kw_args > 0) { PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_flags); if (value) { values[1] = value; kw_args--; } } } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "set_colorkey") < 0)) __PYX_ERR(0, 409, __pyx_L3_error) } } else { switch (PyTuple_GET_SIZE(__pyx_args)) { case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_color = values[0]; __pyx_v_flags = values[1]; } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("set_colorkey", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 409, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("pygame_sdl2.surface.Surface.set_colorkey", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_11pygame_sdl2_7surface_7Surface_22set_colorkey(((struct __pyx_obj_11pygame_sdl2_7surface_Surface *)__pyx_v_self), __pyx_v_color, __pyx_v_flags); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_7surface_7Surface_22set_colorkey(struct __pyx_obj_11pygame_sdl2_7surface_Surface *__pyx_v_self, PyObject *__pyx_v_color, CYTHON_UNUSED PyObject *__pyx_v_flags) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; int __pyx_t_2; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; PyObject *__pyx_t_5 = NULL; Uint32 __pyx_t_6; __Pyx_RefNannySetupContext("set_colorkey", 0); /* "pygame_sdl2/surface.pyx":411 * def set_colorkey(self, color, flags=0): * * if color is None: # <<<<<<<<<<<<<< * if SDL_SetColorKey(self.surface, SDL_FALSE, 0): * raise error() */ __pyx_t_1 = (__pyx_v_color == Py_None); __pyx_t_2 = (__pyx_t_1 != 0); if (__pyx_t_2) { /* "pygame_sdl2/surface.pyx":412 * * if color is None: * if SDL_SetColorKey(self.surface, SDL_FALSE, 0): # <<<<<<<<<<<<<< * raise error() * */ __pyx_t_2 = (SDL_SetColorKey(__pyx_v_self->surface, SDL_FALSE, 0) != 0); if (__pyx_t_2) { /* "pygame_sdl2/surface.pyx":413 * if color is None: * if SDL_SetColorKey(self.surface, SDL_FALSE, 0): * raise error() # <<<<<<<<<<<<<< * * else: */ __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_error); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 413, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_5 = NULL; if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_4))) { __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4); if (likely(__pyx_t_5)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4); __Pyx_INCREF(__pyx_t_5); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_4, function); } } if (__pyx_t_5) { __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_5); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 413, __pyx_L1_error) __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; } else { __pyx_t_3 = __Pyx_PyObject_CallNoArg(__pyx_t_4); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 413, __pyx_L1_error) } __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_Raise(__pyx_t_3, 0, 0, 0); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __PYX_ERR(0, 413, __pyx_L1_error) /* "pygame_sdl2/surface.pyx":412 * * if color is None: * if SDL_SetColorKey(self.surface, SDL_FALSE, 0): # <<<<<<<<<<<<<< * raise error() * */ } /* "pygame_sdl2/surface.pyx":411 * def set_colorkey(self, color, flags=0): * * if color is None: # <<<<<<<<<<<<<< * if SDL_SetColorKey(self.surface, SDL_FALSE, 0): * raise error() */ goto __pyx_L3; } /* "pygame_sdl2/surface.pyx":416 * * else: * if SDL_SetColorKey(self.surface, SDL_TRUE, map_color(self.surface, color)): # <<<<<<<<<<<<<< * raise error() * */ /*else*/ { __pyx_t_6 = __pyx_f_11pygame_sdl2_5color_map_color(__pyx_v_self->surface, __pyx_v_color); if (unlikely(__pyx_t_6 == 0xaabbccdd && PyErr_Occurred())) __PYX_ERR(0, 416, __pyx_L1_error) __pyx_t_2 = (SDL_SetColorKey(__pyx_v_self->surface, SDL_TRUE, __pyx_t_6) != 0); if (__pyx_t_2) { /* "pygame_sdl2/surface.pyx":417 * else: * if SDL_SetColorKey(self.surface, SDL_TRUE, map_color(self.surface, color)): * raise error() # <<<<<<<<<<<<<< * * def get_colorkey(self): */ __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_error); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 417, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_5 = NULL; if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_4))) { __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4); if (likely(__pyx_t_5)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4); __Pyx_INCREF(__pyx_t_5); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_4, function); } } if (__pyx_t_5) { __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_5); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 417, __pyx_L1_error) __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; } else { __pyx_t_3 = __Pyx_PyObject_CallNoArg(__pyx_t_4); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 417, __pyx_L1_error) } __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_Raise(__pyx_t_3, 0, 0, 0); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __PYX_ERR(0, 417, __pyx_L1_error) /* "pygame_sdl2/surface.pyx":416 * * else: * if SDL_SetColorKey(self.surface, SDL_TRUE, map_color(self.surface, color)): # <<<<<<<<<<<<<< * raise error() * */ } } __pyx_L3:; /* "pygame_sdl2/surface.pyx":409 * self.unlock() * * def set_colorkey(self, color, flags=0): # <<<<<<<<<<<<<< * * if color is None: */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_5); __Pyx_AddTraceback("pygame_sdl2.surface.Surface.set_colorkey", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/surface.pyx":419 * raise error() * * def get_colorkey(self): # <<<<<<<<<<<<<< * cdef Uint32 key * */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_7surface_7Surface_25get_colorkey(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/ static PyObject *__pyx_pw_11pygame_sdl2_7surface_7Surface_25get_colorkey(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("get_colorkey (wrapper)", 0); __pyx_r = __pyx_pf_11pygame_sdl2_7surface_7Surface_24get_colorkey(((struct __pyx_obj_11pygame_sdl2_7surface_Surface *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_7surface_7Surface_24get_colorkey(struct __pyx_obj_11pygame_sdl2_7surface_Surface *__pyx_v_self) { Uint32 __pyx_v_key; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; PyObject *__pyx_t_2 = NULL; __Pyx_RefNannySetupContext("get_colorkey", 0); /* "pygame_sdl2/surface.pyx":422 * cdef Uint32 key * * if SDL_GetColorKey(self.surface, &key): # <<<<<<<<<<<<<< * return None * */ __pyx_t_1 = (SDL_GetColorKey(__pyx_v_self->surface, (&__pyx_v_key)) != 0); if (__pyx_t_1) { /* "pygame_sdl2/surface.pyx":423 * * if SDL_GetColorKey(self.surface, &key): * return None # <<<<<<<<<<<<<< * * return get_color(key, self.surface) */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(Py_None); __pyx_r = Py_None; goto __pyx_L0; /* "pygame_sdl2/surface.pyx":422 * cdef Uint32 key * * if SDL_GetColorKey(self.surface, &key): # <<<<<<<<<<<<<< * return None * */ } /* "pygame_sdl2/surface.pyx":425 * return None * * return get_color(key, self.surface) # <<<<<<<<<<<<<< * * def set_alpha(self, value, flags=0): */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __pyx_f_11pygame_sdl2_5color_get_color(__pyx_v_key, __pyx_v_self->surface); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 425, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; /* "pygame_sdl2/surface.pyx":419 * raise error() * * def get_colorkey(self): # <<<<<<<<<<<<<< * cdef Uint32 key * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_AddTraceback("pygame_sdl2.surface.Surface.get_colorkey", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/surface.pyx":427 * return get_color(key, self.surface) * * def set_alpha(self, value, flags=0): # <<<<<<<<<<<<<< * if value is None: * value = 255 */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_7surface_7Surface_27set_alpha(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static PyObject *__pyx_pw_11pygame_sdl2_7surface_7Surface_27set_alpha(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_value = 0; CYTHON_UNUSED PyObject *__pyx_v_flags = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("set_alpha (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_value,&__pyx_n_s_flags,0}; PyObject* values[2] = {0,0}; values[1] = ((PyObject *)__pyx_int_0); if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_value)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; case 1: if (kw_args > 0) { PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_flags); if (value) { values[1] = value; kw_args--; } } } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "set_alpha") < 0)) __PYX_ERR(0, 427, __pyx_L3_error) } } else { switch (PyTuple_GET_SIZE(__pyx_args)) { case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_value = values[0]; __pyx_v_flags = values[1]; } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("set_alpha", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 427, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("pygame_sdl2.surface.Surface.set_alpha", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_11pygame_sdl2_7surface_7Surface_26set_alpha(((struct __pyx_obj_11pygame_sdl2_7surface_Surface *)__pyx_v_self), __pyx_v_value, __pyx_v_flags); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_7surface_7Surface_26set_alpha(struct __pyx_obj_11pygame_sdl2_7surface_Surface *__pyx_v_self, PyObject *__pyx_v_value, CYTHON_UNUSED PyObject *__pyx_v_flags) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; int __pyx_t_2; Uint8 __pyx_t_3; PyObject *__pyx_t_4 = NULL; PyObject *__pyx_t_5 = NULL; PyObject *__pyx_t_6 = NULL; __Pyx_RefNannySetupContext("set_alpha", 0); __Pyx_INCREF(__pyx_v_value); /* "pygame_sdl2/surface.pyx":428 * * def set_alpha(self, value, flags=0): * if value is None: # <<<<<<<<<<<<<< * value = 255 * self.has_alpha = False */ __pyx_t_1 = (__pyx_v_value == Py_None); __pyx_t_2 = (__pyx_t_1 != 0); if (__pyx_t_2) { /* "pygame_sdl2/surface.pyx":429 * def set_alpha(self, value, flags=0): * if value is None: * value = 255 # <<<<<<<<<<<<<< * self.has_alpha = False * else: */ __Pyx_INCREF(__pyx_int_255); __Pyx_DECREF_SET(__pyx_v_value, __pyx_int_255); /* "pygame_sdl2/surface.pyx":430 * if value is None: * value = 255 * self.has_alpha = False # <<<<<<<<<<<<<< * else: * self.has_alpha = True */ __pyx_v_self->has_alpha = 0; /* "pygame_sdl2/surface.pyx":428 * * def set_alpha(self, value, flags=0): * if value is None: # <<<<<<<<<<<<<< * value = 255 * self.has_alpha = False */ goto __pyx_L3; } /* "pygame_sdl2/surface.pyx":432 * self.has_alpha = False * else: * self.has_alpha = True # <<<<<<<<<<<<<< * * if SDL_SetSurfaceAlphaMod(self.surface, value): */ /*else*/ { __pyx_v_self->has_alpha = 1; } __pyx_L3:; /* "pygame_sdl2/surface.pyx":434 * self.has_alpha = True * * if SDL_SetSurfaceAlphaMod(self.surface, value): # <<<<<<<<<<<<<< * raise error() * */ __pyx_t_3 = __Pyx_PyInt_As_uint8_t(__pyx_v_value); if (unlikely((__pyx_t_3 == ((Uint8)-1)) && PyErr_Occurred())) __PYX_ERR(0, 434, __pyx_L1_error) __pyx_t_2 = (SDL_SetSurfaceAlphaMod(__pyx_v_self->surface, __pyx_t_3) != 0); if (__pyx_t_2) { /* "pygame_sdl2/surface.pyx":435 * * if SDL_SetSurfaceAlphaMod(self.surface, value): * raise error() # <<<<<<<<<<<<<< * * def get_alpha(self): */ __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_error); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 435, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_6 = NULL; if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_5))) { __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_5); if (likely(__pyx_t_6)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5); __Pyx_INCREF(__pyx_t_6); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_5, function); } } if (__pyx_t_6) { __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_t_6); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 435, __pyx_L1_error) __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; } else { __pyx_t_4 = __Pyx_PyObject_CallNoArg(__pyx_t_5); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 435, __pyx_L1_error) } __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_Raise(__pyx_t_4, 0, 0, 0); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __PYX_ERR(0, 435, __pyx_L1_error) /* "pygame_sdl2/surface.pyx":434 * self.has_alpha = True * * if SDL_SetSurfaceAlphaMod(self.surface, value): # <<<<<<<<<<<<<< * raise error() * */ } /* "pygame_sdl2/surface.pyx":427 * return get_color(key, self.surface) * * def set_alpha(self, value, flags=0): # <<<<<<<<<<<<<< * if value is None: * value = 255 */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_5); __Pyx_XDECREF(__pyx_t_6); __Pyx_AddTraceback("pygame_sdl2.surface.Surface.set_alpha", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF(__pyx_v_value); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/surface.pyx":437 * raise error() * * def get_alpha(self): # <<<<<<<<<<<<<< * cdef Uint8 rv * */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_7surface_7Surface_29get_alpha(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/ static PyObject *__pyx_pw_11pygame_sdl2_7surface_7Surface_29get_alpha(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("get_alpha (wrapper)", 0); __pyx_r = __pyx_pf_11pygame_sdl2_7surface_7Surface_28get_alpha(((struct __pyx_obj_11pygame_sdl2_7surface_Surface *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_7surface_7Surface_28get_alpha(struct __pyx_obj_11pygame_sdl2_7surface_Surface *__pyx_v_self) { Uint8 __pyx_v_rv; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; int __pyx_t_2; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; PyObject *__pyx_t_5 = NULL; __Pyx_RefNannySetupContext("get_alpha", 0); /* "pygame_sdl2/surface.pyx":440 * cdef Uint8 rv * * if self.has_alpha or self.surface.format.Amask: # <<<<<<<<<<<<<< * * if SDL_GetSurfaceAlphaMod(self.surface, &rv): */ __pyx_t_2 = (__pyx_v_self->has_alpha != 0); if (!__pyx_t_2) { } else { __pyx_t_1 = __pyx_t_2; goto __pyx_L4_bool_binop_done; } __pyx_t_2 = (__pyx_v_self->surface->format->Amask != 0); __pyx_t_1 = __pyx_t_2; __pyx_L4_bool_binop_done:; if (__pyx_t_1) { /* "pygame_sdl2/surface.pyx":442 * if self.has_alpha or self.surface.format.Amask: * * if SDL_GetSurfaceAlphaMod(self.surface, &rv): # <<<<<<<<<<<<<< * raise error() * */ __pyx_t_1 = (SDL_GetSurfaceAlphaMod(__pyx_v_self->surface, (&__pyx_v_rv)) != 0); if (__pyx_t_1) { /* "pygame_sdl2/surface.pyx":443 * * if SDL_GetSurfaceAlphaMod(self.surface, &rv): * raise error() # <<<<<<<<<<<<<< * * return rv */ __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_error); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 443, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_5 = NULL; if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_4))) { __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4); if (likely(__pyx_t_5)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4); __Pyx_INCREF(__pyx_t_5); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_4, function); } } if (__pyx_t_5) { __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_5); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 443, __pyx_L1_error) __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; } else { __pyx_t_3 = __Pyx_PyObject_CallNoArg(__pyx_t_4); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 443, __pyx_L1_error) } __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_Raise(__pyx_t_3, 0, 0, 0); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __PYX_ERR(0, 443, __pyx_L1_error) /* "pygame_sdl2/surface.pyx":442 * if self.has_alpha or self.surface.format.Amask: * * if SDL_GetSurfaceAlphaMod(self.surface, &rv): # <<<<<<<<<<<<<< * raise error() * */ } /* "pygame_sdl2/surface.pyx":445 * raise error() * * return rv # <<<<<<<<<<<<<< * * else: */ __Pyx_XDECREF(__pyx_r); __pyx_t_3 = __Pyx_PyInt_From_uint8_t(__pyx_v_rv); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 445, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_r = __pyx_t_3; __pyx_t_3 = 0; goto __pyx_L0; /* "pygame_sdl2/surface.pyx":440 * cdef Uint8 rv * * if self.has_alpha or self.surface.format.Amask: # <<<<<<<<<<<<<< * * if SDL_GetSurfaceAlphaMod(self.surface, &rv): */ } /* "pygame_sdl2/surface.pyx":448 * * else: * return None # <<<<<<<<<<<<<< * * def lock(self, lock=None): */ /*else*/ { __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(Py_None); __pyx_r = Py_None; goto __pyx_L0; } /* "pygame_sdl2/surface.pyx":437 * raise error() * * def get_alpha(self): # <<<<<<<<<<<<<< * cdef Uint8 rv * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_5); __Pyx_AddTraceback("pygame_sdl2.surface.Surface.get_alpha", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/surface.pyx":450 * return None * * def lock(self, lock=None): # <<<<<<<<<<<<<< * cdef Surface root = self * */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_7surface_7Surface_31lock(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static PyObject *__pyx_pw_11pygame_sdl2_7surface_7Surface_31lock(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_lock = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("lock (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_lock,0}; PyObject* values[1] = {0}; values[0] = ((PyObject *)Py_None); if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (kw_args > 0) { PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_lock); if (value) { values[0] = value; kw_args--; } } } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "lock") < 0)) __PYX_ERR(0, 450, __pyx_L3_error) } } else { switch (PyTuple_GET_SIZE(__pyx_args)) { case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); case 0: break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_lock = values[0]; } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("lock", 0, 0, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 450, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("pygame_sdl2.surface.Surface.lock", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_11pygame_sdl2_7surface_7Surface_30lock(((struct __pyx_obj_11pygame_sdl2_7surface_Surface *)__pyx_v_self), __pyx_v_lock); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_7surface_7Surface_30lock(struct __pyx_obj_11pygame_sdl2_7surface_Surface *__pyx_v_self, PyObject *__pyx_v_lock) { struct __pyx_obj_11pygame_sdl2_7surface_Surface *__pyx_v_root = 0; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; PyObject *__pyx_t_2 = NULL; int __pyx_t_3; int __pyx_t_4; __Pyx_RefNannySetupContext("lock", 0); __Pyx_INCREF(__pyx_v_lock); /* "pygame_sdl2/surface.pyx":451 * * def lock(self, lock=None): * cdef Surface root = self # <<<<<<<<<<<<<< * * while root.parent: */ __Pyx_INCREF(((PyObject *)__pyx_v_self)); __pyx_v_root = __pyx_v_self; /* "pygame_sdl2/surface.pyx":453 * cdef Surface root = self * * while root.parent: # <<<<<<<<<<<<<< * root = root.parent * */ while (1) { __pyx_t_1 = __Pyx_PyObject_IsTrue(((PyObject *)__pyx_v_root->parent)); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(0, 453, __pyx_L1_error) if (!__pyx_t_1) break; /* "pygame_sdl2/surface.pyx":454 * * while root.parent: * root = root.parent # <<<<<<<<<<<<<< * * if lock is None: */ __pyx_t_2 = ((PyObject *)__pyx_v_root->parent); __Pyx_INCREF(__pyx_t_2); __Pyx_DECREF_SET(__pyx_v_root, ((struct __pyx_obj_11pygame_sdl2_7surface_Surface *)__pyx_t_2)); __pyx_t_2 = 0; } /* "pygame_sdl2/surface.pyx":456 * root = root.parent * * if lock is None: # <<<<<<<<<<<<<< * lock = self * */ __pyx_t_1 = (__pyx_v_lock == Py_None); __pyx_t_3 = (__pyx_t_1 != 0); if (__pyx_t_3) { /* "pygame_sdl2/surface.pyx":457 * * if lock is None: * lock = self # <<<<<<<<<<<<<< * * if root.locklist is None: */ __Pyx_INCREF(((PyObject *)__pyx_v_self)); __Pyx_DECREF_SET(__pyx_v_lock, ((PyObject *)__pyx_v_self)); /* "pygame_sdl2/surface.pyx":456 * root = root.parent * * if lock is None: # <<<<<<<<<<<<<< * lock = self * */ } /* "pygame_sdl2/surface.pyx":459 * lock = self * * if root.locklist is None: # <<<<<<<<<<<<<< * root.locklist = [ ] * */ __pyx_t_3 = (__pyx_v_root->locklist == Py_None); __pyx_t_1 = (__pyx_t_3 != 0); if (__pyx_t_1) { /* "pygame_sdl2/surface.pyx":460 * * if root.locklist is None: * root.locklist = [ ] # <<<<<<<<<<<<<< * * root.locklist.append(lock) */ __pyx_t_2 = PyList_New(0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 460, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_GIVEREF(__pyx_t_2); __Pyx_GOTREF(__pyx_v_root->locklist); __Pyx_DECREF(__pyx_v_root->locklist); __pyx_v_root->locklist = __pyx_t_2; __pyx_t_2 = 0; /* "pygame_sdl2/surface.pyx":459 * lock = self * * if root.locklist is None: # <<<<<<<<<<<<<< * root.locklist = [ ] * */ } /* "pygame_sdl2/surface.pyx":462 * root.locklist = [ ] * * root.locklist.append(lock) # <<<<<<<<<<<<<< * * SDL_LockSurface(root.surface) */ __pyx_t_4 = __Pyx_PyObject_Append(__pyx_v_root->locklist, __pyx_v_lock); if (unlikely(__pyx_t_4 == -1)) __PYX_ERR(0, 462, __pyx_L1_error) /* "pygame_sdl2/surface.pyx":464 * root.locklist.append(lock) * * SDL_LockSurface(root.surface) # <<<<<<<<<<<<<< * * def unlock(self, lock=None): */ SDL_LockSurface(__pyx_v_root->surface); /* "pygame_sdl2/surface.pyx":450 * return None * * def lock(self, lock=None): # <<<<<<<<<<<<<< * cdef Surface root = self * */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_AddTraceback("pygame_sdl2.surface.Surface.lock", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF((PyObject *)__pyx_v_root); __Pyx_XDECREF(__pyx_v_lock); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/surface.pyx":466 * SDL_LockSurface(root.surface) * * def unlock(self, lock=None): # <<<<<<<<<<<<<< * cdef Surface root = self * */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_7surface_7Surface_33unlock(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static PyObject *__pyx_pw_11pygame_sdl2_7surface_7Surface_33unlock(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_lock = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("unlock (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_lock,0}; PyObject* values[1] = {0}; values[0] = ((PyObject *)Py_None); if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (kw_args > 0) { PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_lock); if (value) { values[0] = value; kw_args--; } } } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "unlock") < 0)) __PYX_ERR(0, 466, __pyx_L3_error) } } else { switch (PyTuple_GET_SIZE(__pyx_args)) { case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); case 0: break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_lock = values[0]; } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("unlock", 0, 0, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 466, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("pygame_sdl2.surface.Surface.unlock", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_11pygame_sdl2_7surface_7Surface_32unlock(((struct __pyx_obj_11pygame_sdl2_7surface_Surface *)__pyx_v_self), __pyx_v_lock); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_7surface_7Surface_32unlock(struct __pyx_obj_11pygame_sdl2_7surface_Surface *__pyx_v_self, PyObject *__pyx_v_lock) { struct __pyx_obj_11pygame_sdl2_7surface_Surface *__pyx_v_root = 0; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; PyObject *__pyx_t_2 = NULL; int __pyx_t_3; PyObject *__pyx_t_4 = NULL; PyObject *__pyx_t_5 = NULL; PyObject *__pyx_t_6 = NULL; __Pyx_RefNannySetupContext("unlock", 0); __Pyx_INCREF(__pyx_v_lock); /* "pygame_sdl2/surface.pyx":467 * * def unlock(self, lock=None): * cdef Surface root = self # <<<<<<<<<<<<<< * * while root.parent: */ __Pyx_INCREF(((PyObject *)__pyx_v_self)); __pyx_v_root = __pyx_v_self; /* "pygame_sdl2/surface.pyx":469 * cdef Surface root = self * * while root.parent: # <<<<<<<<<<<<<< * root = root.parent * */ while (1) { __pyx_t_1 = __Pyx_PyObject_IsTrue(((PyObject *)__pyx_v_root->parent)); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(0, 469, __pyx_L1_error) if (!__pyx_t_1) break; /* "pygame_sdl2/surface.pyx":470 * * while root.parent: * root = root.parent # <<<<<<<<<<<<<< * * if lock is None: */ __pyx_t_2 = ((PyObject *)__pyx_v_root->parent); __Pyx_INCREF(__pyx_t_2); __Pyx_DECREF_SET(__pyx_v_root, ((struct __pyx_obj_11pygame_sdl2_7surface_Surface *)__pyx_t_2)); __pyx_t_2 = 0; } /* "pygame_sdl2/surface.pyx":472 * root = root.parent * * if lock is None: # <<<<<<<<<<<<<< * lock = self * */ __pyx_t_1 = (__pyx_v_lock == Py_None); __pyx_t_3 = (__pyx_t_1 != 0); if (__pyx_t_3) { /* "pygame_sdl2/surface.pyx":473 * * if lock is None: * lock = self # <<<<<<<<<<<<<< * * if root.locklist is None: */ __Pyx_INCREF(((PyObject *)__pyx_v_self)); __Pyx_DECREF_SET(__pyx_v_lock, ((PyObject *)__pyx_v_self)); /* "pygame_sdl2/surface.pyx":472 * root = root.parent * * if lock is None: # <<<<<<<<<<<<<< * lock = self * */ } /* "pygame_sdl2/surface.pyx":475 * lock = self * * if root.locklist is None: # <<<<<<<<<<<<<< * root.locklist = [ ] * */ __pyx_t_3 = (__pyx_v_root->locklist == Py_None); __pyx_t_1 = (__pyx_t_3 != 0); if (__pyx_t_1) { /* "pygame_sdl2/surface.pyx":476 * * if root.locklist is None: * root.locklist = [ ] # <<<<<<<<<<<<<< * * root.locklist.remove(lock) */ __pyx_t_2 = PyList_New(0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 476, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_GIVEREF(__pyx_t_2); __Pyx_GOTREF(__pyx_v_root->locklist); __Pyx_DECREF(__pyx_v_root->locklist); __pyx_v_root->locklist = __pyx_t_2; __pyx_t_2 = 0; /* "pygame_sdl2/surface.pyx":475 * lock = self * * if root.locklist is None: # <<<<<<<<<<<<<< * root.locklist = [ ] * */ } /* "pygame_sdl2/surface.pyx":478 * root.locklist = [ ] * * root.locklist.remove(lock) # <<<<<<<<<<<<<< * * SDL_UnlockSurface(root.surface) */ __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_root->locklist, __pyx_n_s_remove); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 478, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_5 = NULL; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_4))) { __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4); if (likely(__pyx_t_5)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4); __Pyx_INCREF(__pyx_t_5); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_4, function); } } if (!__pyx_t_5) { __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_v_lock); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 478, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); } else { #if CYTHON_FAST_PYCALL if (PyFunction_Check(__pyx_t_4)) { PyObject *__pyx_temp[2] = {__pyx_t_5, __pyx_v_lock}; __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_4, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 478, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_GOTREF(__pyx_t_2); } else #endif #if CYTHON_FAST_PYCCALL if (__Pyx_PyFastCFunction_Check(__pyx_t_4)) { PyObject *__pyx_temp[2] = {__pyx_t_5, __pyx_v_lock}; __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_4, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 478, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_GOTREF(__pyx_t_2); } else #endif { __pyx_t_6 = PyTuple_New(1+1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 478, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_5); __pyx_t_5 = NULL; __Pyx_INCREF(__pyx_v_lock); __Pyx_GIVEREF(__pyx_v_lock); PyTuple_SET_ITEM(__pyx_t_6, 0+1, __pyx_v_lock); __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_6, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 478, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; } } __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "pygame_sdl2/surface.pyx":480 * root.locklist.remove(lock) * * SDL_UnlockSurface(root.surface) # <<<<<<<<<<<<<< * * def mustlock(self): */ SDL_UnlockSurface(__pyx_v_root->surface); /* "pygame_sdl2/surface.pyx":466 * SDL_LockSurface(root.surface) * * def unlock(self, lock=None): # <<<<<<<<<<<<<< * cdef Surface root = self * */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_5); __Pyx_XDECREF(__pyx_t_6); __Pyx_AddTraceback("pygame_sdl2.surface.Surface.unlock", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF((PyObject *)__pyx_v_root); __Pyx_XDECREF(__pyx_v_lock); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/surface.pyx":482 * SDL_UnlockSurface(root.surface) * * def mustlock(self): # <<<<<<<<<<<<<< * cdef Surface root = self * */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_7surface_7Surface_35mustlock(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/ static PyObject *__pyx_pw_11pygame_sdl2_7surface_7Surface_35mustlock(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("mustlock (wrapper)", 0); __pyx_r = __pyx_pf_11pygame_sdl2_7surface_7Surface_34mustlock(((struct __pyx_obj_11pygame_sdl2_7surface_Surface *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_7surface_7Surface_34mustlock(struct __pyx_obj_11pygame_sdl2_7surface_Surface *__pyx_v_self) { struct __pyx_obj_11pygame_sdl2_7surface_Surface *__pyx_v_root = 0; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; PyObject *__pyx_t_2 = NULL; __Pyx_RefNannySetupContext("mustlock", 0); /* "pygame_sdl2/surface.pyx":483 * * def mustlock(self): * cdef Surface root = self # <<<<<<<<<<<<<< * * while root.parent: */ __Pyx_INCREF(((PyObject *)__pyx_v_self)); __pyx_v_root = __pyx_v_self; /* "pygame_sdl2/surface.pyx":485 * cdef Surface root = self * * while root.parent: # <<<<<<<<<<<<<< * root = root.parent * */ while (1) { __pyx_t_1 = __Pyx_PyObject_IsTrue(((PyObject *)__pyx_v_root->parent)); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(0, 485, __pyx_L1_error) if (!__pyx_t_1) break; /* "pygame_sdl2/surface.pyx":486 * * while root.parent: * root = root.parent # <<<<<<<<<<<<<< * * return SDL_MUSTLOCK(root.surface) */ __pyx_t_2 = ((PyObject *)__pyx_v_root->parent); __Pyx_INCREF(__pyx_t_2); __Pyx_DECREF_SET(__pyx_v_root, ((struct __pyx_obj_11pygame_sdl2_7surface_Surface *)__pyx_t_2)); __pyx_t_2 = 0; } /* "pygame_sdl2/surface.pyx":488 * root = root.parent * * return SDL_MUSTLOCK(root.surface) # <<<<<<<<<<<<<< * * def get_locked(self): */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __Pyx_PyInt_From_int(SDL_MUSTLOCK(__pyx_v_root->surface)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 488, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; /* "pygame_sdl2/surface.pyx":482 * SDL_UnlockSurface(root.surface) * * def mustlock(self): # <<<<<<<<<<<<<< * cdef Surface root = self * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_AddTraceback("pygame_sdl2.surface.Surface.mustlock", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF((PyObject *)__pyx_v_root); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/surface.pyx":490 * return SDL_MUSTLOCK(root.surface) * * def get_locked(self): # <<<<<<<<<<<<<< * if self.locklist: * return True */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_7surface_7Surface_37get_locked(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/ static PyObject *__pyx_pw_11pygame_sdl2_7surface_7Surface_37get_locked(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("get_locked (wrapper)", 0); __pyx_r = __pyx_pf_11pygame_sdl2_7surface_7Surface_36get_locked(((struct __pyx_obj_11pygame_sdl2_7surface_Surface *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_7surface_7Surface_36get_locked(struct __pyx_obj_11pygame_sdl2_7surface_Surface *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; __Pyx_RefNannySetupContext("get_locked", 0); /* "pygame_sdl2/surface.pyx":491 * * def get_locked(self): * if self.locklist: # <<<<<<<<<<<<<< * return True * */ __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_self->locklist); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(0, 491, __pyx_L1_error) if (__pyx_t_1) { /* "pygame_sdl2/surface.pyx":492 * def get_locked(self): * if self.locklist: * return True # <<<<<<<<<<<<<< * * def get_locks(self): */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(Py_True); __pyx_r = Py_True; goto __pyx_L0; /* "pygame_sdl2/surface.pyx":491 * * def get_locked(self): * if self.locklist: # <<<<<<<<<<<<<< * return True * */ } /* "pygame_sdl2/surface.pyx":490 * return SDL_MUSTLOCK(root.surface) * * def get_locked(self): # <<<<<<<<<<<<<< * if self.locklist: * return True */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("pygame_sdl2.surface.Surface.get_locked", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/surface.pyx":494 * return True * * def get_locks(self): # <<<<<<<<<<<<<< * cdef Surface root = self * */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_7surface_7Surface_39get_locks(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/ static PyObject *__pyx_pw_11pygame_sdl2_7surface_7Surface_39get_locks(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("get_locks (wrapper)", 0); __pyx_r = __pyx_pf_11pygame_sdl2_7surface_7Surface_38get_locks(((struct __pyx_obj_11pygame_sdl2_7surface_Surface *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_7surface_7Surface_38get_locks(struct __pyx_obj_11pygame_sdl2_7surface_Surface *__pyx_v_self) { struct __pyx_obj_11pygame_sdl2_7surface_Surface *__pyx_v_root = 0; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; PyObject *__pyx_t_2 = NULL; int __pyx_t_3; __Pyx_RefNannySetupContext("get_locks", 0); /* "pygame_sdl2/surface.pyx":495 * * def get_locks(self): * cdef Surface root = self # <<<<<<<<<<<<<< * * while root.parent: */ __Pyx_INCREF(((PyObject *)__pyx_v_self)); __pyx_v_root = __pyx_v_self; /* "pygame_sdl2/surface.pyx":497 * cdef Surface root = self * * while root.parent: # <<<<<<<<<<<<<< * root = root.parent * */ while (1) { __pyx_t_1 = __Pyx_PyObject_IsTrue(((PyObject *)__pyx_v_root->parent)); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(0, 497, __pyx_L1_error) if (!__pyx_t_1) break; /* "pygame_sdl2/surface.pyx":498 * * while root.parent: * root = root.parent # <<<<<<<<<<<<<< * * if root.locklist is None: */ __pyx_t_2 = ((PyObject *)__pyx_v_root->parent); __Pyx_INCREF(__pyx_t_2); __Pyx_DECREF_SET(__pyx_v_root, ((struct __pyx_obj_11pygame_sdl2_7surface_Surface *)__pyx_t_2)); __pyx_t_2 = 0; } /* "pygame_sdl2/surface.pyx":500 * root = root.parent * * if root.locklist is None: # <<<<<<<<<<<<<< * root.locklist = [ ] * */ __pyx_t_1 = (__pyx_v_root->locklist == Py_None); __pyx_t_3 = (__pyx_t_1 != 0); if (__pyx_t_3) { /* "pygame_sdl2/surface.pyx":501 * * if root.locklist is None: * root.locklist = [ ] # <<<<<<<<<<<<<< * * return root.locklist */ __pyx_t_2 = PyList_New(0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 501, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_GIVEREF(__pyx_t_2); __Pyx_GOTREF(__pyx_v_root->locklist); __Pyx_DECREF(__pyx_v_root->locklist); __pyx_v_root->locklist = __pyx_t_2; __pyx_t_2 = 0; /* "pygame_sdl2/surface.pyx":500 * root = root.parent * * if root.locklist is None: # <<<<<<<<<<<<<< * root.locklist = [ ] * */ } /* "pygame_sdl2/surface.pyx":503 * root.locklist = [ ] * * return root.locklist # <<<<<<<<<<<<<< * * def get_at(self, pos): */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(__pyx_v_root->locklist); __pyx_r = __pyx_v_root->locklist; goto __pyx_L0; /* "pygame_sdl2/surface.pyx":494 * return True * * def get_locks(self): # <<<<<<<<<<<<<< * cdef Surface root = self * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_AddTraceback("pygame_sdl2.surface.Surface.get_locks", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF((PyObject *)__pyx_v_root); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/surface.pyx":505 * return root.locklist * * def get_at(self, pos): # <<<<<<<<<<<<<< * cdef int x, y * cdef Uint8 *p */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_7surface_7Surface_41get_at(PyObject *__pyx_v_self, PyObject *__pyx_v_pos); /*proto*/ static PyObject *__pyx_pw_11pygame_sdl2_7surface_7Surface_41get_at(PyObject *__pyx_v_self, PyObject *__pyx_v_pos) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("get_at (wrapper)", 0); __pyx_r = __pyx_pf_11pygame_sdl2_7surface_7Surface_40get_at(((struct __pyx_obj_11pygame_sdl2_7surface_Surface *)__pyx_v_self), ((PyObject *)__pyx_v_pos)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_7surface_7Surface_40get_at(struct __pyx_obj_11pygame_sdl2_7surface_Surface *__pyx_v_self, PyObject *__pyx_v_pos) { int __pyx_v_x; int __pyx_v_y; Uint8 *__pyx_v_p; Uint32 __pyx_v_pixel; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; PyObject *(*__pyx_t_4)(PyObject *); int __pyx_t_5; int __pyx_t_6; int __pyx_t_7; int __pyx_t_8; int __pyx_t_9; __Pyx_RefNannySetupContext("get_at", 0); /* "pygame_sdl2/surface.pyx":509 * cdef Uint8 *p * * x, y = pos # <<<<<<<<<<<<<< * * if not (0 <= x < self.surface.w) or not (0 <= y < self.surface.h): */ if ((likely(PyTuple_CheckExact(__pyx_v_pos))) || (PyList_CheckExact(__pyx_v_pos))) { PyObject* sequence = __pyx_v_pos; #if !CYTHON_COMPILING_IN_PYPY Py_ssize_t size = Py_SIZE(sequence); #else Py_ssize_t size = PySequence_Size(sequence); #endif if (unlikely(size != 2)) { if (size > 2) __Pyx_RaiseTooManyValuesError(2); else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); __PYX_ERR(0, 509, __pyx_L1_error) } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS if (likely(PyTuple_CheckExact(sequence))) { __pyx_t_1 = PyTuple_GET_ITEM(sequence, 0); __pyx_t_2 = PyTuple_GET_ITEM(sequence, 1); } else { __pyx_t_1 = PyList_GET_ITEM(sequence, 0); __pyx_t_2 = PyList_GET_ITEM(sequence, 1); } __Pyx_INCREF(__pyx_t_1); __Pyx_INCREF(__pyx_t_2); #else __pyx_t_1 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 509, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 509, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); #endif } else { Py_ssize_t index = -1; __pyx_t_3 = PyObject_GetIter(__pyx_v_pos); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 509, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = Py_TYPE(__pyx_t_3)->tp_iternext; index = 0; __pyx_t_1 = __pyx_t_4(__pyx_t_3); if (unlikely(!__pyx_t_1)) goto __pyx_L3_unpacking_failed; __Pyx_GOTREF(__pyx_t_1); index = 1; __pyx_t_2 = __pyx_t_4(__pyx_t_3); if (unlikely(!__pyx_t_2)) goto __pyx_L3_unpacking_failed; __Pyx_GOTREF(__pyx_t_2); if (__Pyx_IternextUnpackEndCheck(__pyx_t_4(__pyx_t_3), 2) < 0) __PYX_ERR(0, 509, __pyx_L1_error) __pyx_t_4 = NULL; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; goto __pyx_L4_unpacking_done; __pyx_L3_unpacking_failed:; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_4 = NULL; if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); __PYX_ERR(0, 509, __pyx_L1_error) __pyx_L4_unpacking_done:; } __pyx_t_5 = __Pyx_PyInt_As_int(__pyx_t_1); if (unlikely((__pyx_t_5 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 509, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_6 = __Pyx_PyInt_As_int(__pyx_t_2); if (unlikely((__pyx_t_6 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 509, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_v_x = __pyx_t_5; __pyx_v_y = __pyx_t_6; /* "pygame_sdl2/surface.pyx":511 * x, y = pos * * if not (0 <= x < self.surface.w) or not (0 <= y < self.surface.h): # <<<<<<<<<<<<<< * raise IndexError("Position outside surface.") * */ __pyx_t_8 = (0 <= __pyx_v_x); if (__pyx_t_8) { __pyx_t_8 = (__pyx_v_x < __pyx_v_self->surface->w); } __pyx_t_9 = ((!(__pyx_t_8 != 0)) != 0); if (!__pyx_t_9) { } else { __pyx_t_7 = __pyx_t_9; goto __pyx_L6_bool_binop_done; } __pyx_t_9 = (0 <= __pyx_v_y); if (__pyx_t_9) { __pyx_t_9 = (__pyx_v_y < __pyx_v_self->surface->h); } __pyx_t_8 = ((!(__pyx_t_9 != 0)) != 0); __pyx_t_7 = __pyx_t_8; __pyx_L6_bool_binop_done:; if (__pyx_t_7) { /* "pygame_sdl2/surface.pyx":512 * * if not (0 <= x < self.surface.w) or not (0 <= y < self.surface.h): * raise IndexError("Position outside surface.") # <<<<<<<<<<<<<< * * if self.surface.format.BytesPerPixel != 4: */ __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_IndexError, __pyx_tuple__7, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 512, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_Raise(__pyx_t_2, 0, 0, 0); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __PYX_ERR(0, 512, __pyx_L1_error) /* "pygame_sdl2/surface.pyx":511 * x, y = pos * * if not (0 <= x < self.surface.w) or not (0 <= y < self.surface.h): # <<<<<<<<<<<<<< * raise IndexError("Position outside surface.") * */ } /* "pygame_sdl2/surface.pyx":514 * raise IndexError("Position outside surface.") * * if self.surface.format.BytesPerPixel != 4: # <<<<<<<<<<<<<< * raise error("Surface has unsupported bytesize.") * */ __pyx_t_7 = ((__pyx_v_self->surface->format->BytesPerPixel != 4) != 0); if (__pyx_t_7) { /* "pygame_sdl2/surface.pyx":515 * * if self.surface.format.BytesPerPixel != 4: * raise error("Surface has unsupported bytesize.") # <<<<<<<<<<<<<< * * self.lock() */ __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_error); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 515, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_tuple__8, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 515, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_Raise(__pyx_t_1, 0, 0, 0); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __PYX_ERR(0, 515, __pyx_L1_error) /* "pygame_sdl2/surface.pyx":514 * raise IndexError("Position outside surface.") * * if self.surface.format.BytesPerPixel != 4: # <<<<<<<<<<<<<< * raise error("Surface has unsupported bytesize.") * */ } /* "pygame_sdl2/surface.pyx":517 * raise error("Surface has unsupported bytesize.") * * self.lock() # <<<<<<<<<<<<<< * * p = self.surface.pixels */ __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_lock); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 517, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = NULL; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); if (likely(__pyx_t_3)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); } } if (__pyx_t_3) { __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 517, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } else { __pyx_t_1 = __Pyx_PyObject_CallNoArg(__pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 517, __pyx_L1_error) } __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "pygame_sdl2/surface.pyx":519 * self.lock() * * p = self.surface.pixels # <<<<<<<<<<<<<< * p += y * self.surface.pitch * p += x * 4 */ __pyx_v_p = ((Uint8 *)__pyx_v_self->surface->pixels); /* "pygame_sdl2/surface.pyx":520 * * p = self.surface.pixels * p += y * self.surface.pitch # <<<<<<<<<<<<<< * p += x * 4 * */ __pyx_v_p = (__pyx_v_p + (__pyx_v_y * __pyx_v_self->surface->pitch)); /* "pygame_sdl2/surface.pyx":521 * p = self.surface.pixels * p += y * self.surface.pitch * p += x * 4 # <<<<<<<<<<<<<< * * cdef Uint32 pixel = ( p)[0] */ __pyx_v_p = (__pyx_v_p + (__pyx_v_x * 4)); /* "pygame_sdl2/surface.pyx":523 * p += x * 4 * * cdef Uint32 pixel = ( p)[0] # <<<<<<<<<<<<<< * * self.unlock() */ __pyx_v_pixel = (((Uint32 *)__pyx_v_p)[0]); /* "pygame_sdl2/surface.pyx":525 * cdef Uint32 pixel = ( p)[0] * * self.unlock() # <<<<<<<<<<<<<< * * return get_color(pixel, self.surface) */ __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_unlock); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 525, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = NULL; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); if (likely(__pyx_t_3)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); } } if (__pyx_t_3) { __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 525, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } else { __pyx_t_1 = __Pyx_PyObject_CallNoArg(__pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 525, __pyx_L1_error) } __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "pygame_sdl2/surface.pyx":527 * self.unlock() * * return get_color(pixel, self.surface) # <<<<<<<<<<<<<< * * def set_at(self, pos, color): */ __Pyx_XDECREF(__pyx_r); __pyx_t_1 = __pyx_f_11pygame_sdl2_5color_get_color(__pyx_v_pixel, __pyx_v_self->surface); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 527, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "pygame_sdl2/surface.pyx":505 * return root.locklist * * def get_at(self, pos): # <<<<<<<<<<<<<< * cdef int x, y * cdef Uint8 *p */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("pygame_sdl2.surface.Surface.get_at", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/surface.pyx":529 * return get_color(pixel, self.surface) * * def set_at(self, pos, color): # <<<<<<<<<<<<<< * cdef int x, y * cdef Uint8 *p */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_7surface_7Surface_43set_at(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static PyObject *__pyx_pw_11pygame_sdl2_7surface_7Surface_43set_at(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_pos = 0; PyObject *__pyx_v_color = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("set_at (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_pos,&__pyx_n_s_color,0}; PyObject* values[2] = {0,0}; if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_pos)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; case 1: if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_color)) != 0)) kw_args--; else { __Pyx_RaiseArgtupleInvalid("set_at", 1, 2, 2, 1); __PYX_ERR(0, 529, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "set_at") < 0)) __PYX_ERR(0, 529, __pyx_L3_error) } } else if (PyTuple_GET_SIZE(__pyx_args) != 2) { goto __pyx_L5_argtuple_error; } else { values[0] = PyTuple_GET_ITEM(__pyx_args, 0); values[1] = PyTuple_GET_ITEM(__pyx_args, 1); } __pyx_v_pos = values[0]; __pyx_v_color = values[1]; } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("set_at", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 529, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("pygame_sdl2.surface.Surface.set_at", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_11pygame_sdl2_7surface_7Surface_42set_at(((struct __pyx_obj_11pygame_sdl2_7surface_Surface *)__pyx_v_self), __pyx_v_pos, __pyx_v_color); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_7surface_7Surface_42set_at(struct __pyx_obj_11pygame_sdl2_7surface_Surface *__pyx_v_self, PyObject *__pyx_v_pos, PyObject *__pyx_v_color) { int __pyx_v_x; int __pyx_v_y; Uint8 *__pyx_v_p; Uint32 __pyx_v_pixel; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; PyObject *(*__pyx_t_4)(PyObject *); int __pyx_t_5; int __pyx_t_6; int __pyx_t_7; int __pyx_t_8; int __pyx_t_9; Uint32 __pyx_t_10; __Pyx_RefNannySetupContext("set_at", 0); /* "pygame_sdl2/surface.pyx":534 * cdef Uint32 pixel * * x, y = pos # <<<<<<<<<<<<<< * * if not (0 <= x < self.surface.w) or not (0 <= y < self.surface.h): */ if ((likely(PyTuple_CheckExact(__pyx_v_pos))) || (PyList_CheckExact(__pyx_v_pos))) { PyObject* sequence = __pyx_v_pos; #if !CYTHON_COMPILING_IN_PYPY Py_ssize_t size = Py_SIZE(sequence); #else Py_ssize_t size = PySequence_Size(sequence); #endif if (unlikely(size != 2)) { if (size > 2) __Pyx_RaiseTooManyValuesError(2); else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); __PYX_ERR(0, 534, __pyx_L1_error) } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS if (likely(PyTuple_CheckExact(sequence))) { __pyx_t_1 = PyTuple_GET_ITEM(sequence, 0); __pyx_t_2 = PyTuple_GET_ITEM(sequence, 1); } else { __pyx_t_1 = PyList_GET_ITEM(sequence, 0); __pyx_t_2 = PyList_GET_ITEM(sequence, 1); } __Pyx_INCREF(__pyx_t_1); __Pyx_INCREF(__pyx_t_2); #else __pyx_t_1 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 534, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 534, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); #endif } else { Py_ssize_t index = -1; __pyx_t_3 = PyObject_GetIter(__pyx_v_pos); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 534, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = Py_TYPE(__pyx_t_3)->tp_iternext; index = 0; __pyx_t_1 = __pyx_t_4(__pyx_t_3); if (unlikely(!__pyx_t_1)) goto __pyx_L3_unpacking_failed; __Pyx_GOTREF(__pyx_t_1); index = 1; __pyx_t_2 = __pyx_t_4(__pyx_t_3); if (unlikely(!__pyx_t_2)) goto __pyx_L3_unpacking_failed; __Pyx_GOTREF(__pyx_t_2); if (__Pyx_IternextUnpackEndCheck(__pyx_t_4(__pyx_t_3), 2) < 0) __PYX_ERR(0, 534, __pyx_L1_error) __pyx_t_4 = NULL; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; goto __pyx_L4_unpacking_done; __pyx_L3_unpacking_failed:; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_4 = NULL; if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); __PYX_ERR(0, 534, __pyx_L1_error) __pyx_L4_unpacking_done:; } __pyx_t_5 = __Pyx_PyInt_As_int(__pyx_t_1); if (unlikely((__pyx_t_5 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 534, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_6 = __Pyx_PyInt_As_int(__pyx_t_2); if (unlikely((__pyx_t_6 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 534, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_v_x = __pyx_t_5; __pyx_v_y = __pyx_t_6; /* "pygame_sdl2/surface.pyx":536 * x, y = pos * * if not (0 <= x < self.surface.w) or not (0 <= y < self.surface.h): # <<<<<<<<<<<<<< * raise ValueError("Position outside surface.") * */ __pyx_t_8 = (0 <= __pyx_v_x); if (__pyx_t_8) { __pyx_t_8 = (__pyx_v_x < __pyx_v_self->surface->w); } __pyx_t_9 = ((!(__pyx_t_8 != 0)) != 0); if (!__pyx_t_9) { } else { __pyx_t_7 = __pyx_t_9; goto __pyx_L6_bool_binop_done; } __pyx_t_9 = (0 <= __pyx_v_y); if (__pyx_t_9) { __pyx_t_9 = (__pyx_v_y < __pyx_v_self->surface->h); } __pyx_t_8 = ((!(__pyx_t_9 != 0)) != 0); __pyx_t_7 = __pyx_t_8; __pyx_L6_bool_binop_done:; if (__pyx_t_7) { /* "pygame_sdl2/surface.pyx":537 * * if not (0 <= x < self.surface.w) or not (0 <= y < self.surface.h): * raise ValueError("Position outside surface.") # <<<<<<<<<<<<<< * * if self.surface.format.BytesPerPixel != 4: */ __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__9, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 537, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_Raise(__pyx_t_2, 0, 0, 0); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __PYX_ERR(0, 537, __pyx_L1_error) /* "pygame_sdl2/surface.pyx":536 * x, y = pos * * if not (0 <= x < self.surface.w) or not (0 <= y < self.surface.h): # <<<<<<<<<<<<<< * raise ValueError("Position outside surface.") * */ } /* "pygame_sdl2/surface.pyx":539 * raise ValueError("Position outside surface.") * * if self.surface.format.BytesPerPixel != 4: # <<<<<<<<<<<<<< * raise error("Surface has unsupported bytesize.") * */ __pyx_t_7 = ((__pyx_v_self->surface->format->BytesPerPixel != 4) != 0); if (__pyx_t_7) { /* "pygame_sdl2/surface.pyx":540 * * if self.surface.format.BytesPerPixel != 4: * raise error("Surface has unsupported bytesize.") # <<<<<<<<<<<<<< * * pixel = map_color(self.surface, color) */ __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_error); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 540, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_tuple__10, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 540, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_Raise(__pyx_t_1, 0, 0, 0); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __PYX_ERR(0, 540, __pyx_L1_error) /* "pygame_sdl2/surface.pyx":539 * raise ValueError("Position outside surface.") * * if self.surface.format.BytesPerPixel != 4: # <<<<<<<<<<<<<< * raise error("Surface has unsupported bytesize.") * */ } /* "pygame_sdl2/surface.pyx":542 * raise error("Surface has unsupported bytesize.") * * pixel = map_color(self.surface, color) # <<<<<<<<<<<<<< * * self.lock() */ __pyx_t_10 = __pyx_f_11pygame_sdl2_5color_map_color(__pyx_v_self->surface, __pyx_v_color); if (unlikely(__pyx_t_10 == 0xaabbccdd && PyErr_Occurred())) __PYX_ERR(0, 542, __pyx_L1_error) __pyx_v_pixel = __pyx_t_10; /* "pygame_sdl2/surface.pyx":544 * pixel = map_color(self.surface, color) * * self.lock() # <<<<<<<<<<<<<< * * p = self.surface.pixels */ __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_lock); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 544, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = NULL; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); if (likely(__pyx_t_3)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); } } if (__pyx_t_3) { __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 544, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } else { __pyx_t_1 = __Pyx_PyObject_CallNoArg(__pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 544, __pyx_L1_error) } __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "pygame_sdl2/surface.pyx":546 * self.lock() * * p = self.surface.pixels # <<<<<<<<<<<<<< * p += y * self.surface.pitch * p += x * 4 */ __pyx_v_p = ((Uint8 *)__pyx_v_self->surface->pixels); /* "pygame_sdl2/surface.pyx":547 * * p = self.surface.pixels * p += y * self.surface.pitch # <<<<<<<<<<<<<< * p += x * 4 * */ __pyx_v_p = (__pyx_v_p + (__pyx_v_y * __pyx_v_self->surface->pitch)); /* "pygame_sdl2/surface.pyx":548 * p = self.surface.pixels * p += y * self.surface.pitch * p += x * 4 # <<<<<<<<<<<<<< * * ( p)[0] = pixel */ __pyx_v_p = (__pyx_v_p + (__pyx_v_x * 4)); /* "pygame_sdl2/surface.pyx":550 * p += x * 4 * * ( p)[0] = pixel # <<<<<<<<<<<<<< * * self.unlock() */ (((Uint32 *)__pyx_v_p)[0]) = __pyx_v_pixel; /* "pygame_sdl2/surface.pyx":552 * ( p)[0] = pixel * * self.unlock() # <<<<<<<<<<<<<< * * def get_at_mapped(self, pos): */ __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_unlock); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 552, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = NULL; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); if (likely(__pyx_t_3)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); } } if (__pyx_t_3) { __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 552, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } else { __pyx_t_1 = __Pyx_PyObject_CallNoArg(__pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 552, __pyx_L1_error) } __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "pygame_sdl2/surface.pyx":529 * return get_color(pixel, self.surface) * * def set_at(self, pos, color): # <<<<<<<<<<<<<< * cdef int x, y * cdef Uint8 *p */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("pygame_sdl2.surface.Surface.set_at", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/surface.pyx":554 * self.unlock() * * def get_at_mapped(self, pos): # <<<<<<<<<<<<<< * cdef int x, y * cdef Uint8 *p */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_7surface_7Surface_45get_at_mapped(PyObject *__pyx_v_self, PyObject *__pyx_v_pos); /*proto*/ static PyObject *__pyx_pw_11pygame_sdl2_7surface_7Surface_45get_at_mapped(PyObject *__pyx_v_self, PyObject *__pyx_v_pos) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("get_at_mapped (wrapper)", 0); __pyx_r = __pyx_pf_11pygame_sdl2_7surface_7Surface_44get_at_mapped(((struct __pyx_obj_11pygame_sdl2_7surface_Surface *)__pyx_v_self), ((PyObject *)__pyx_v_pos)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_7surface_7Surface_44get_at_mapped(struct __pyx_obj_11pygame_sdl2_7surface_Surface *__pyx_v_self, PyObject *__pyx_v_pos) { int __pyx_v_x; int __pyx_v_y; Uint8 *__pyx_v_p; Uint32 __pyx_v_pixel; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; PyObject *(*__pyx_t_4)(PyObject *); int __pyx_t_5; int __pyx_t_6; int __pyx_t_7; int __pyx_t_8; int __pyx_t_9; __Pyx_RefNannySetupContext("get_at_mapped", 0); /* "pygame_sdl2/surface.pyx":558 * cdef Uint8 *p * * x, y = pos # <<<<<<<<<<<<<< * * if not (0 <= x < self.surface.w) or not (0 <= y < self.surface.h): */ if ((likely(PyTuple_CheckExact(__pyx_v_pos))) || (PyList_CheckExact(__pyx_v_pos))) { PyObject* sequence = __pyx_v_pos; #if !CYTHON_COMPILING_IN_PYPY Py_ssize_t size = Py_SIZE(sequence); #else Py_ssize_t size = PySequence_Size(sequence); #endif if (unlikely(size != 2)) { if (size > 2) __Pyx_RaiseTooManyValuesError(2); else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); __PYX_ERR(0, 558, __pyx_L1_error) } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS if (likely(PyTuple_CheckExact(sequence))) { __pyx_t_1 = PyTuple_GET_ITEM(sequence, 0); __pyx_t_2 = PyTuple_GET_ITEM(sequence, 1); } else { __pyx_t_1 = PyList_GET_ITEM(sequence, 0); __pyx_t_2 = PyList_GET_ITEM(sequence, 1); } __Pyx_INCREF(__pyx_t_1); __Pyx_INCREF(__pyx_t_2); #else __pyx_t_1 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 558, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 558, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); #endif } else { Py_ssize_t index = -1; __pyx_t_3 = PyObject_GetIter(__pyx_v_pos); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 558, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = Py_TYPE(__pyx_t_3)->tp_iternext; index = 0; __pyx_t_1 = __pyx_t_4(__pyx_t_3); if (unlikely(!__pyx_t_1)) goto __pyx_L3_unpacking_failed; __Pyx_GOTREF(__pyx_t_1); index = 1; __pyx_t_2 = __pyx_t_4(__pyx_t_3); if (unlikely(!__pyx_t_2)) goto __pyx_L3_unpacking_failed; __Pyx_GOTREF(__pyx_t_2); if (__Pyx_IternextUnpackEndCheck(__pyx_t_4(__pyx_t_3), 2) < 0) __PYX_ERR(0, 558, __pyx_L1_error) __pyx_t_4 = NULL; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; goto __pyx_L4_unpacking_done; __pyx_L3_unpacking_failed:; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_4 = NULL; if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); __PYX_ERR(0, 558, __pyx_L1_error) __pyx_L4_unpacking_done:; } __pyx_t_5 = __Pyx_PyInt_As_int(__pyx_t_1); if (unlikely((__pyx_t_5 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 558, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_6 = __Pyx_PyInt_As_int(__pyx_t_2); if (unlikely((__pyx_t_6 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 558, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_v_x = __pyx_t_5; __pyx_v_y = __pyx_t_6; /* "pygame_sdl2/surface.pyx":560 * x, y = pos * * if not (0 <= x < self.surface.w) or not (0 <= y < self.surface.h): # <<<<<<<<<<<<<< * raise ValueError("Position outside surface.") * */ __pyx_t_8 = (0 <= __pyx_v_x); if (__pyx_t_8) { __pyx_t_8 = (__pyx_v_x < __pyx_v_self->surface->w); } __pyx_t_9 = ((!(__pyx_t_8 != 0)) != 0); if (!__pyx_t_9) { } else { __pyx_t_7 = __pyx_t_9; goto __pyx_L6_bool_binop_done; } __pyx_t_9 = (0 <= __pyx_v_y); if (__pyx_t_9) { __pyx_t_9 = (__pyx_v_y < __pyx_v_self->surface->h); } __pyx_t_8 = ((!(__pyx_t_9 != 0)) != 0); __pyx_t_7 = __pyx_t_8; __pyx_L6_bool_binop_done:; if (__pyx_t_7) { /* "pygame_sdl2/surface.pyx":561 * * if not (0 <= x < self.surface.w) or not (0 <= y < self.surface.h): * raise ValueError("Position outside surface.") # <<<<<<<<<<<<<< * * if self.surface.format.BytesPerPixel != 4: */ __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__11, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 561, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_Raise(__pyx_t_2, 0, 0, 0); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __PYX_ERR(0, 561, __pyx_L1_error) /* "pygame_sdl2/surface.pyx":560 * x, y = pos * * if not (0 <= x < self.surface.w) or not (0 <= y < self.surface.h): # <<<<<<<<<<<<<< * raise ValueError("Position outside surface.") * */ } /* "pygame_sdl2/surface.pyx":563 * raise ValueError("Position outside surface.") * * if self.surface.format.BytesPerPixel != 4: # <<<<<<<<<<<<<< * raise error("Surface has unsupported bytesize.") * */ __pyx_t_7 = ((__pyx_v_self->surface->format->BytesPerPixel != 4) != 0); if (__pyx_t_7) { /* "pygame_sdl2/surface.pyx":564 * * if self.surface.format.BytesPerPixel != 4: * raise error("Surface has unsupported bytesize.") # <<<<<<<<<<<<<< * * self.lock() */ __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_error); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 564, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_tuple__12, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 564, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_Raise(__pyx_t_1, 0, 0, 0); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __PYX_ERR(0, 564, __pyx_L1_error) /* "pygame_sdl2/surface.pyx":563 * raise ValueError("Position outside surface.") * * if self.surface.format.BytesPerPixel != 4: # <<<<<<<<<<<<<< * raise error("Surface has unsupported bytesize.") * */ } /* "pygame_sdl2/surface.pyx":566 * raise error("Surface has unsupported bytesize.") * * self.lock() # <<<<<<<<<<<<<< * * p = self.surface.pixels */ __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_lock); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 566, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = NULL; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); if (likely(__pyx_t_3)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); } } if (__pyx_t_3) { __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 566, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } else { __pyx_t_1 = __Pyx_PyObject_CallNoArg(__pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 566, __pyx_L1_error) } __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "pygame_sdl2/surface.pyx":568 * self.lock() * * p = self.surface.pixels # <<<<<<<<<<<<<< * p += y * self.surface.pitch * p += x * 4 */ __pyx_v_p = ((Uint8 *)__pyx_v_self->surface->pixels); /* "pygame_sdl2/surface.pyx":569 * * p = self.surface.pixels * p += y * self.surface.pitch # <<<<<<<<<<<<<< * p += x * 4 * */ __pyx_v_p = (__pyx_v_p + (__pyx_v_y * __pyx_v_self->surface->pitch)); /* "pygame_sdl2/surface.pyx":570 * p = self.surface.pixels * p += y * self.surface.pitch * p += x * 4 # <<<<<<<<<<<<<< * * cdef Uint32 pixel = ( p)[0] */ __pyx_v_p = (__pyx_v_p + (__pyx_v_x * 4)); /* "pygame_sdl2/surface.pyx":572 * p += x * 4 * * cdef Uint32 pixel = ( p)[0] # <<<<<<<<<<<<<< * * self.unlock() */ __pyx_v_pixel = (((Uint32 *)__pyx_v_p)[0]); /* "pygame_sdl2/surface.pyx":574 * cdef Uint32 pixel = ( p)[0] * * self.unlock() # <<<<<<<<<<<<<< * * return pixel */ __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_unlock); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 574, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = NULL; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); if (likely(__pyx_t_3)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); } } if (__pyx_t_3) { __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 574, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } else { __pyx_t_1 = __Pyx_PyObject_CallNoArg(__pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 574, __pyx_L1_error) } __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "pygame_sdl2/surface.pyx":576 * self.unlock() * * return pixel # <<<<<<<<<<<<<< * * def map_rgb(self, color): */ __Pyx_XDECREF(__pyx_r); __pyx_t_1 = __Pyx_PyInt_From_uint32_t(__pyx_v_pixel); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 576, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "pygame_sdl2/surface.pyx":554 * self.unlock() * * def get_at_mapped(self, pos): # <<<<<<<<<<<<<< * cdef int x, y * cdef Uint8 *p */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("pygame_sdl2.surface.Surface.get_at_mapped", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/surface.pyx":578 * return pixel * * def map_rgb(self, color): # <<<<<<<<<<<<<< * return map_color(self.surface, color) * */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_7surface_7Surface_47map_rgb(PyObject *__pyx_v_self, PyObject *__pyx_v_color); /*proto*/ static PyObject *__pyx_pw_11pygame_sdl2_7surface_7Surface_47map_rgb(PyObject *__pyx_v_self, PyObject *__pyx_v_color) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("map_rgb (wrapper)", 0); __pyx_r = __pyx_pf_11pygame_sdl2_7surface_7Surface_46map_rgb(((struct __pyx_obj_11pygame_sdl2_7surface_Surface *)__pyx_v_self), ((PyObject *)__pyx_v_color)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_7surface_7Surface_46map_rgb(struct __pyx_obj_11pygame_sdl2_7surface_Surface *__pyx_v_self, PyObject *__pyx_v_color) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations Uint32 __pyx_t_1; PyObject *__pyx_t_2 = NULL; __Pyx_RefNannySetupContext("map_rgb", 0); /* "pygame_sdl2/surface.pyx":579 * * def map_rgb(self, color): * return map_color(self.surface, color) # <<<<<<<<<<<<<< * * def unmap_rgb(self, pixel): */ __Pyx_XDECREF(__pyx_r); __pyx_t_1 = __pyx_f_11pygame_sdl2_5color_map_color(__pyx_v_self->surface, __pyx_v_color); if (unlikely(__pyx_t_1 == 0xaabbccdd && PyErr_Occurred())) __PYX_ERR(0, 579, __pyx_L1_error) __pyx_t_2 = __Pyx_PyInt_From_uint32_t(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 579, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; /* "pygame_sdl2/surface.pyx":578 * return pixel * * def map_rgb(self, color): # <<<<<<<<<<<<<< * return map_color(self.surface, color) * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_AddTraceback("pygame_sdl2.surface.Surface.map_rgb", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/surface.pyx":581 * return map_color(self.surface, color) * * def unmap_rgb(self, pixel): # <<<<<<<<<<<<<< * return get_color(pixel, self.surface) * */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_7surface_7Surface_49unmap_rgb(PyObject *__pyx_v_self, PyObject *__pyx_v_pixel); /*proto*/ static PyObject *__pyx_pw_11pygame_sdl2_7surface_7Surface_49unmap_rgb(PyObject *__pyx_v_self, PyObject *__pyx_v_pixel) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("unmap_rgb (wrapper)", 0); __pyx_r = __pyx_pf_11pygame_sdl2_7surface_7Surface_48unmap_rgb(((struct __pyx_obj_11pygame_sdl2_7surface_Surface *)__pyx_v_self), ((PyObject *)__pyx_v_pixel)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_7surface_7Surface_48unmap_rgb(struct __pyx_obj_11pygame_sdl2_7surface_Surface *__pyx_v_self, PyObject *__pyx_v_pixel) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations Uint32 __pyx_t_1; PyObject *__pyx_t_2 = NULL; __Pyx_RefNannySetupContext("unmap_rgb", 0); /* "pygame_sdl2/surface.pyx":582 * * def unmap_rgb(self, pixel): * return get_color(pixel, self.surface) # <<<<<<<<<<<<<< * * def set_clip(self, rect): */ __Pyx_XDECREF(__pyx_r); __pyx_t_1 = __Pyx_PyInt_As_uint32_t(__pyx_v_pixel); if (unlikely((__pyx_t_1 == ((Uint32)-1)) && PyErr_Occurred())) __PYX_ERR(0, 582, __pyx_L1_error) __pyx_t_2 = __pyx_f_11pygame_sdl2_5color_get_color(__pyx_t_1, __pyx_v_self->surface); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 582, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; /* "pygame_sdl2/surface.pyx":581 * return map_color(self.surface, color) * * def unmap_rgb(self, pixel): # <<<<<<<<<<<<<< * return get_color(pixel, self.surface) * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_AddTraceback("pygame_sdl2.surface.Surface.unmap_rgb", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/surface.pyx":584 * return get_color(pixel, self.surface) * * def set_clip(self, rect): # <<<<<<<<<<<<<< * cdef SDL_Rect sdl_rect * */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_7surface_7Surface_51set_clip(PyObject *__pyx_v_self, PyObject *__pyx_v_rect); /*proto*/ static PyObject *__pyx_pw_11pygame_sdl2_7surface_7Surface_51set_clip(PyObject *__pyx_v_self, PyObject *__pyx_v_rect) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("set_clip (wrapper)", 0); __pyx_r = __pyx_pf_11pygame_sdl2_7surface_7Surface_50set_clip(((struct __pyx_obj_11pygame_sdl2_7surface_Surface *)__pyx_v_self), ((PyObject *)__pyx_v_rect)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_7surface_7Surface_50set_clip(struct __pyx_obj_11pygame_sdl2_7surface_Surface *__pyx_v_self, PyObject *__pyx_v_rect) { SDL_Rect __pyx_v_sdl_rect; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; int __pyx_t_2; int __pyx_t_3; __Pyx_RefNannySetupContext("set_clip", 0); /* "pygame_sdl2/surface.pyx":587 * cdef SDL_Rect sdl_rect * * if rect is None: # <<<<<<<<<<<<<< * SDL_SetClipRect(self.surface, NULL) * else: */ __pyx_t_1 = (__pyx_v_rect == Py_None); __pyx_t_2 = (__pyx_t_1 != 0); if (__pyx_t_2) { /* "pygame_sdl2/surface.pyx":588 * * if rect is None: * SDL_SetClipRect(self.surface, NULL) # <<<<<<<<<<<<<< * else: * to_sdl_rect(rect, &sdl_rect) */ SDL_SetClipRect(__pyx_v_self->surface, NULL); /* "pygame_sdl2/surface.pyx":587 * cdef SDL_Rect sdl_rect * * if rect is None: # <<<<<<<<<<<<<< * SDL_SetClipRect(self.surface, NULL) * else: */ goto __pyx_L3; } /* "pygame_sdl2/surface.pyx":590 * SDL_SetClipRect(self.surface, NULL) * else: * to_sdl_rect(rect, &sdl_rect) # <<<<<<<<<<<<<< * SDL_SetClipRect(self.surface, &sdl_rect) * */ /*else*/ { __pyx_t_3 = __pyx_f_11pygame_sdl2_4rect_to_sdl_rect(__pyx_v_rect, (&__pyx_v_sdl_rect), NULL); if (unlikely(__pyx_t_3 == -1)) __PYX_ERR(0, 590, __pyx_L1_error) /* "pygame_sdl2/surface.pyx":591 * else: * to_sdl_rect(rect, &sdl_rect) * SDL_SetClipRect(self.surface, &sdl_rect) # <<<<<<<<<<<<<< * * def get_clip(self): */ SDL_SetClipRect(__pyx_v_self->surface, (&__pyx_v_sdl_rect)); } __pyx_L3:; /* "pygame_sdl2/surface.pyx":584 * return get_color(pixel, self.surface) * * def set_clip(self, rect): # <<<<<<<<<<<<<< * cdef SDL_Rect sdl_rect * */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("pygame_sdl2.surface.Surface.set_clip", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/surface.pyx":593 * SDL_SetClipRect(self.surface, &sdl_rect) * * def get_clip(self): # <<<<<<<<<<<<<< * cdef SDL_Rect sdl_rect * */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_7surface_7Surface_53get_clip(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/ static PyObject *__pyx_pw_11pygame_sdl2_7surface_7Surface_53get_clip(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("get_clip (wrapper)", 0); __pyx_r = __pyx_pf_11pygame_sdl2_7surface_7Surface_52get_clip(((struct __pyx_obj_11pygame_sdl2_7surface_Surface *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_7surface_7Surface_52get_clip(struct __pyx_obj_11pygame_sdl2_7surface_Surface *__pyx_v_self) { SDL_Rect __pyx_v_sdl_rect; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; PyObject *__pyx_t_5 = NULL; __Pyx_RefNannySetupContext("get_clip", 0); /* "pygame_sdl2/surface.pyx":596 * cdef SDL_Rect sdl_rect * * SDL_GetClipRect(self.surface, &sdl_rect) # <<<<<<<<<<<<<< * * return (sdl_rect.x, sdl_rect.y, sdl_rect.w, sdl_rect.h) */ SDL_GetClipRect(__pyx_v_self->surface, (&__pyx_v_sdl_rect)); /* "pygame_sdl2/surface.pyx":598 * SDL_GetClipRect(self.surface, &sdl_rect) * * return (sdl_rect.x, sdl_rect.y, sdl_rect.w, sdl_rect.h) # <<<<<<<<<<<<<< * * def subsurface(self, *args): */ __Pyx_XDECREF(__pyx_r); __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_sdl_rect.x); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 598, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_v_sdl_rect.y); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 598, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = __Pyx_PyInt_From_int(__pyx_v_sdl_rect.w); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 598, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = __Pyx_PyInt_From_int(__pyx_v_sdl_rect.h); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 598, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_5 = PyTuple_New(4); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 598, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_GIVEREF(__pyx_t_1); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_1); __Pyx_GIVEREF(__pyx_t_2); PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_t_2); __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_5, 2, __pyx_t_3); __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_5, 3, __pyx_t_4); __pyx_t_1 = 0; __pyx_t_2 = 0; __pyx_t_3 = 0; __pyx_t_4 = 0; __pyx_r = __pyx_t_5; __pyx_t_5 = 0; goto __pyx_L0; /* "pygame_sdl2/surface.pyx":593 * SDL_SetClipRect(self.surface, &sdl_rect) * * def get_clip(self): # <<<<<<<<<<<<<< * cdef SDL_Rect sdl_rect * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_5); __Pyx_AddTraceback("pygame_sdl2.surface.Surface.get_clip", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/surface.pyx":600 * return (sdl_rect.x, sdl_rect.y, sdl_rect.w, sdl_rect.h) * * def subsurface(self, *args): # <<<<<<<<<<<<<< * cdef SDL_Rect sdl_rect * */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_7surface_7Surface_55subsurface(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static PyObject *__pyx_pw_11pygame_sdl2_7surface_7Surface_55subsurface(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_args = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("subsurface (wrapper)", 0); if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "subsurface", 0))) return NULL; __Pyx_INCREF(__pyx_args); __pyx_v_args = __pyx_args; __pyx_r = __pyx_pf_11pygame_sdl2_7surface_7Surface_54subsurface(((struct __pyx_obj_11pygame_sdl2_7surface_Surface *)__pyx_v_self), __pyx_v_args); /* function exit code */ __Pyx_XDECREF(__pyx_v_args); __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_7surface_7Surface_54subsurface(struct __pyx_obj_11pygame_sdl2_7surface_Surface *__pyx_v_self, PyObject *__pyx_v_args) { SDL_Rect __pyx_v_sdl_rect; Uint8 *__pyx_v_pixels; SDL_Surface *__pyx_v_new_surface; struct __pyx_obj_11pygame_sdl2_7surface_Surface *__pyx_v_rv = 0; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations Py_ssize_t __pyx_t_1; int __pyx_t_2; PyObject *__pyx_t_3 = NULL; int __pyx_t_4; int __pyx_t_5; PyObject *__pyx_t_6 = NULL; PyObject *__pyx_t_7 = NULL; PyObject *__pyx_t_8 = NULL; PyObject *__pyx_t_9 = NULL; __Pyx_RefNannySetupContext("subsurface", 0); /* "pygame_sdl2/surface.pyx":603 * cdef SDL_Rect sdl_rect * * if len(args) == 1: # <<<<<<<<<<<<<< * to_sdl_rect(args[0], &sdl_rect) * else: */ __pyx_t_1 = PyTuple_GET_SIZE(__pyx_v_args); if (unlikely(__pyx_t_1 == -1)) __PYX_ERR(0, 603, __pyx_L1_error) __pyx_t_2 = ((__pyx_t_1 == 1) != 0); if (__pyx_t_2) { /* "pygame_sdl2/surface.pyx":604 * * if len(args) == 1: * to_sdl_rect(args[0], &sdl_rect) # <<<<<<<<<<<<<< * else: * to_sdl_rect(args, &sdl_rect) */ __pyx_t_3 = __Pyx_GetItemInt_Tuple(__pyx_v_args, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 604, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = __pyx_f_11pygame_sdl2_4rect_to_sdl_rect(__pyx_t_3, (&__pyx_v_sdl_rect), NULL); if (unlikely(__pyx_t_4 == -1)) __PYX_ERR(0, 604, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "pygame_sdl2/surface.pyx":603 * cdef SDL_Rect sdl_rect * * if len(args) == 1: # <<<<<<<<<<<<<< * to_sdl_rect(args[0], &sdl_rect) * else: */ goto __pyx_L3; } /* "pygame_sdl2/surface.pyx":606 * to_sdl_rect(args[0], &sdl_rect) * else: * to_sdl_rect(args, &sdl_rect) # <<<<<<<<<<<<<< * * if sdl_rect.w < 0 or sdl_rect.h < 0: */ /*else*/ { __pyx_t_4 = __pyx_f_11pygame_sdl2_4rect_to_sdl_rect(__pyx_v_args, (&__pyx_v_sdl_rect), NULL); if (unlikely(__pyx_t_4 == -1)) __PYX_ERR(0, 606, __pyx_L1_error) } __pyx_L3:; /* "pygame_sdl2/surface.pyx":608 * to_sdl_rect(args, &sdl_rect) * * if sdl_rect.w < 0 or sdl_rect.h < 0: # <<<<<<<<<<<<<< * raise error("subsurface size must be non-negative.") * */ __pyx_t_5 = ((__pyx_v_sdl_rect.w < 0) != 0); if (!__pyx_t_5) { } else { __pyx_t_2 = __pyx_t_5; goto __pyx_L5_bool_binop_done; } __pyx_t_5 = ((__pyx_v_sdl_rect.h < 0) != 0); __pyx_t_2 = __pyx_t_5; __pyx_L5_bool_binop_done:; if (__pyx_t_2) { /* "pygame_sdl2/surface.pyx":609 * * if sdl_rect.w < 0 or sdl_rect.h < 0: * raise error("subsurface size must be non-negative.") # <<<<<<<<<<<<<< * * if ((sdl_rect.x < 0) */ __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_error); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 609, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_tuple__13, NULL); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 609, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_Raise(__pyx_t_6, 0, 0, 0); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __PYX_ERR(0, 609, __pyx_L1_error) /* "pygame_sdl2/surface.pyx":608 * to_sdl_rect(args, &sdl_rect) * * if sdl_rect.w < 0 or sdl_rect.h < 0: # <<<<<<<<<<<<<< * raise error("subsurface size must be non-negative.") * */ } /* "pygame_sdl2/surface.pyx":611 * raise error("subsurface size must be non-negative.") * * if ((sdl_rect.x < 0) # <<<<<<<<<<<<<< * or (sdl_rect.y < 0) * or (sdl_rect.x + sdl_rect.w > self.surface.w) */ __pyx_t_5 = ((__pyx_v_sdl_rect.x < 0) != 0); if (!__pyx_t_5) { } else { __pyx_t_2 = __pyx_t_5; goto __pyx_L8_bool_binop_done; } /* "pygame_sdl2/surface.pyx":612 * * if ((sdl_rect.x < 0) * or (sdl_rect.y < 0) # <<<<<<<<<<<<<< * or (sdl_rect.x + sdl_rect.w > self.surface.w) * or (sdl_rect.y + sdl_rect.h > self.surface.h)): */ __pyx_t_5 = ((__pyx_v_sdl_rect.y < 0) != 0); if (!__pyx_t_5) { } else { __pyx_t_2 = __pyx_t_5; goto __pyx_L8_bool_binop_done; } /* "pygame_sdl2/surface.pyx":613 * if ((sdl_rect.x < 0) * or (sdl_rect.y < 0) * or (sdl_rect.x + sdl_rect.w > self.surface.w) # <<<<<<<<<<<<<< * or (sdl_rect.y + sdl_rect.h > self.surface.h)): * */ __pyx_t_5 = (((__pyx_v_sdl_rect.x + __pyx_v_sdl_rect.w) > __pyx_v_self->surface->w) != 0); if (!__pyx_t_5) { } else { __pyx_t_2 = __pyx_t_5; goto __pyx_L8_bool_binop_done; } /* "pygame_sdl2/surface.pyx":614 * or (sdl_rect.y < 0) * or (sdl_rect.x + sdl_rect.w > self.surface.w) * or (sdl_rect.y + sdl_rect.h > self.surface.h)): # <<<<<<<<<<<<<< * * raise error("subsurface rectangle outside surface area.") */ __pyx_t_5 = (((__pyx_v_sdl_rect.y + __pyx_v_sdl_rect.h) > __pyx_v_self->surface->h) != 0); __pyx_t_2 = __pyx_t_5; __pyx_L8_bool_binop_done:; /* "pygame_sdl2/surface.pyx":611 * raise error("subsurface size must be non-negative.") * * if ((sdl_rect.x < 0) # <<<<<<<<<<<<<< * or (sdl_rect.y < 0) * or (sdl_rect.x + sdl_rect.w > self.surface.w) */ if (__pyx_t_2) { /* "pygame_sdl2/surface.pyx":616 * or (sdl_rect.y + sdl_rect.h > self.surface.h)): * * raise error("subsurface rectangle outside surface area.") # <<<<<<<<<<<<<< * * cdef Uint8 *pixels = self.surface.pixels */ __pyx_t_6 = __Pyx_GetModuleGlobalName(__pyx_n_s_error); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 616, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_tuple__14, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 616, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_Raise(__pyx_t_3, 0, 0, 0); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __PYX_ERR(0, 616, __pyx_L1_error) /* "pygame_sdl2/surface.pyx":611 * raise error("subsurface size must be non-negative.") * * if ((sdl_rect.x < 0) # <<<<<<<<<<<<<< * or (sdl_rect.y < 0) * or (sdl_rect.x + sdl_rect.w > self.surface.w) */ } /* "pygame_sdl2/surface.pyx":618 * raise error("subsurface rectangle outside surface area.") * * cdef Uint8 *pixels = self.surface.pixels # <<<<<<<<<<<<<< * pixels += sdl_rect.y * self.surface.pitch * pixels += sdl_rect.x * self.surface.format.BytesPerPixel */ __pyx_v_pixels = ((Uint8 *)__pyx_v_self->surface->pixels); /* "pygame_sdl2/surface.pyx":619 * * cdef Uint8 *pixels = self.surface.pixels * pixels += sdl_rect.y * self.surface.pitch # <<<<<<<<<<<<<< * pixels += sdl_rect.x * self.surface.format.BytesPerPixel * */ __pyx_v_pixels = (__pyx_v_pixels + (__pyx_v_sdl_rect.y * __pyx_v_self->surface->pitch)); /* "pygame_sdl2/surface.pyx":620 * cdef Uint8 *pixels = self.surface.pixels * pixels += sdl_rect.y * self.surface.pitch * pixels += sdl_rect.x * self.surface.format.BytesPerPixel # <<<<<<<<<<<<<< * * cdef SDL_Surface *new_surface = SDL_CreateRGBSurfaceFrom( */ __pyx_v_pixels = (__pyx_v_pixels + (__pyx_v_sdl_rect.x * __pyx_v_self->surface->format->BytesPerPixel)); /* "pygame_sdl2/surface.pyx":622 * pixels += sdl_rect.x * self.surface.format.BytesPerPixel * * cdef SDL_Surface *new_surface = SDL_CreateRGBSurfaceFrom( # <<<<<<<<<<<<<< * pixels, * sdl_rect.w, */ __pyx_v_new_surface = SDL_CreateRGBSurfaceFrom(__pyx_v_pixels, __pyx_v_sdl_rect.w, __pyx_v_sdl_rect.h, __pyx_v_self->surface->format->BitsPerPixel, __pyx_v_self->surface->pitch, __pyx_v_self->surface->format->Rmask, __pyx_v_self->surface->format->Gmask, __pyx_v_self->surface->format->Bmask, __pyx_v_self->surface->format->Amask); /* "pygame_sdl2/surface.pyx":633 * self.surface.format.Amask) * * cdef Surface rv = Surface(()) # <<<<<<<<<<<<<< * * rv.surface = new_surface */ __pyx_t_3 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_11pygame_sdl2_7surface_Surface), __pyx_tuple__15, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 633, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_v_rv = ((struct __pyx_obj_11pygame_sdl2_7surface_Surface *)__pyx_t_3); __pyx_t_3 = 0; /* "pygame_sdl2/surface.pyx":635 * cdef Surface rv = Surface(()) * * rv.surface = new_surface # <<<<<<<<<<<<<< * rv.parent = self * rv.offset_x = sdl_rect.x */ __pyx_v_rv->surface = __pyx_v_new_surface; /* "pygame_sdl2/surface.pyx":636 * * rv.surface = new_surface * rv.parent = self # <<<<<<<<<<<<<< * rv.offset_x = sdl_rect.x * rv.offset_y = sdl_rect.y */ __Pyx_INCREF(((PyObject *)__pyx_v_self)); __Pyx_GIVEREF(((PyObject *)__pyx_v_self)); __Pyx_GOTREF(__pyx_v_rv->parent); __Pyx_DECREF(((PyObject *)__pyx_v_rv->parent)); __pyx_v_rv->parent = __pyx_v_self; /* "pygame_sdl2/surface.pyx":637 * rv.surface = new_surface * rv.parent = self * rv.offset_x = sdl_rect.x # <<<<<<<<<<<<<< * rv.offset_y = sdl_rect.y * */ __pyx_t_4 = __pyx_v_sdl_rect.x; __pyx_v_rv->offset_x = __pyx_t_4; /* "pygame_sdl2/surface.pyx":638 * rv.parent = self * rv.offset_x = sdl_rect.x * rv.offset_y = sdl_rect.y # <<<<<<<<<<<<<< * * if self.has_alpha: */ __pyx_t_4 = __pyx_v_sdl_rect.y; __pyx_v_rv->offset_y = __pyx_t_4; /* "pygame_sdl2/surface.pyx":640 * rv.offset_y = sdl_rect.y * * if self.has_alpha: # <<<<<<<<<<<<<< * rv.set_alpha(self.get_alpha()) * */ __pyx_t_2 = (__pyx_v_self->has_alpha != 0); if (__pyx_t_2) { /* "pygame_sdl2/surface.pyx":641 * * if self.has_alpha: * rv.set_alpha(self.get_alpha()) # <<<<<<<<<<<<<< * * return rv */ __pyx_t_6 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_rv), __pyx_n_s_set_alpha); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 641, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __pyx_t_8 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_get_alpha); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 641, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __pyx_t_9 = NULL; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_8))) { __pyx_t_9 = PyMethod_GET_SELF(__pyx_t_8); if (likely(__pyx_t_9)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_8); __Pyx_INCREF(__pyx_t_9); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_8, function); } } if (__pyx_t_9) { __pyx_t_7 = __Pyx_PyObject_CallOneArg(__pyx_t_8, __pyx_t_9); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 641, __pyx_L1_error) __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; } else { __pyx_t_7 = __Pyx_PyObject_CallNoArg(__pyx_t_8); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 641, __pyx_L1_error) } __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; __pyx_t_8 = NULL; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_6))) { __pyx_t_8 = PyMethod_GET_SELF(__pyx_t_6); if (likely(__pyx_t_8)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6); __Pyx_INCREF(__pyx_t_8); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_6, function); } } if (!__pyx_t_8) { __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_t_6, __pyx_t_7); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 641, __pyx_L1_error) __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_GOTREF(__pyx_t_3); } else { #if CYTHON_FAST_PYCALL if (PyFunction_Check(__pyx_t_6)) { PyObject *__pyx_temp[2] = {__pyx_t_8, __pyx_t_7}; __pyx_t_3 = __Pyx_PyFunction_FastCall(__pyx_t_6, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 641, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0; __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; } else #endif #if CYTHON_FAST_PYCCALL if (__Pyx_PyFastCFunction_Check(__pyx_t_6)) { PyObject *__pyx_temp[2] = {__pyx_t_8, __pyx_t_7}; __pyx_t_3 = __Pyx_PyCFunction_FastCall(__pyx_t_6, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 641, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0; __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; } else #endif { __pyx_t_9 = PyTuple_New(1+1); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 641, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); __Pyx_GIVEREF(__pyx_t_8); PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_t_8); __pyx_t_8 = NULL; __Pyx_GIVEREF(__pyx_t_7); PyTuple_SET_ITEM(__pyx_t_9, 0+1, __pyx_t_7); __pyx_t_7 = 0; __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_9, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 641, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; } } __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "pygame_sdl2/surface.pyx":640 * rv.offset_y = sdl_rect.y * * if self.has_alpha: # <<<<<<<<<<<<<< * rv.set_alpha(self.get_alpha()) * */ } /* "pygame_sdl2/surface.pyx":643 * rv.set_alpha(self.get_alpha()) * * return rv # <<<<<<<<<<<<<< * * def get_parent(self): */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(((PyObject *)__pyx_v_rv)); __pyx_r = ((PyObject *)__pyx_v_rv); goto __pyx_L0; /* "pygame_sdl2/surface.pyx":600 * return (sdl_rect.x, sdl_rect.y, sdl_rect.w, sdl_rect.h) * * def subsurface(self, *args): # <<<<<<<<<<<<<< * cdef SDL_Rect sdl_rect * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_6); __Pyx_XDECREF(__pyx_t_7); __Pyx_XDECREF(__pyx_t_8); __Pyx_XDECREF(__pyx_t_9); __Pyx_AddTraceback("pygame_sdl2.surface.Surface.subsurface", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF((PyObject *)__pyx_v_rv); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/surface.pyx":645 * return rv * * def get_parent(self): # <<<<<<<<<<<<<< * return self.parent * */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_7surface_7Surface_57get_parent(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/ static PyObject *__pyx_pw_11pygame_sdl2_7surface_7Surface_57get_parent(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("get_parent (wrapper)", 0); __pyx_r = __pyx_pf_11pygame_sdl2_7surface_7Surface_56get_parent(((struct __pyx_obj_11pygame_sdl2_7surface_Surface *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_7surface_7Surface_56get_parent(struct __pyx_obj_11pygame_sdl2_7surface_Surface *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("get_parent", 0); /* "pygame_sdl2/surface.pyx":646 * * def get_parent(self): * return self.parent # <<<<<<<<<<<<<< * * def get_abs_parent(self): */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(((PyObject *)__pyx_v_self->parent)); __pyx_r = ((PyObject *)__pyx_v_self->parent); goto __pyx_L0; /* "pygame_sdl2/surface.pyx":645 * return rv * * def get_parent(self): # <<<<<<<<<<<<<< * return self.parent * */ /* function exit code */ __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/surface.pyx":648 * return self.parent * * def get_abs_parent(self): # <<<<<<<<<<<<<< * rv = self * */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_7surface_7Surface_59get_abs_parent(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/ static PyObject *__pyx_pw_11pygame_sdl2_7surface_7Surface_59get_abs_parent(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("get_abs_parent (wrapper)", 0); __pyx_r = __pyx_pf_11pygame_sdl2_7surface_7Surface_58get_abs_parent(((struct __pyx_obj_11pygame_sdl2_7surface_Surface *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_7surface_7Surface_58get_abs_parent(struct __pyx_obj_11pygame_sdl2_7surface_Surface *__pyx_v_self) { struct __pyx_obj_11pygame_sdl2_7surface_Surface *__pyx_v_rv = NULL; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; PyObject *__pyx_t_2 = NULL; __Pyx_RefNannySetupContext("get_abs_parent", 0); /* "pygame_sdl2/surface.pyx":649 * * def get_abs_parent(self): * rv = self # <<<<<<<<<<<<<< * * while rv.parent: */ __Pyx_INCREF(((PyObject *)__pyx_v_self)); __pyx_v_rv = __pyx_v_self; /* "pygame_sdl2/surface.pyx":651 * rv = self * * while rv.parent: # <<<<<<<<<<<<<< * rv = rv.parent * */ while (1) { __pyx_t_1 = __Pyx_PyObject_IsTrue(((PyObject *)__pyx_v_rv->parent)); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(0, 651, __pyx_L1_error) if (!__pyx_t_1) break; /* "pygame_sdl2/surface.pyx":652 * * while rv.parent: * rv = rv.parent # <<<<<<<<<<<<<< * * return rv */ __pyx_t_2 = ((PyObject *)__pyx_v_rv->parent); __Pyx_INCREF(__pyx_t_2); __Pyx_DECREF_SET(__pyx_v_rv, ((struct __pyx_obj_11pygame_sdl2_7surface_Surface *)__pyx_t_2)); __pyx_t_2 = 0; } /* "pygame_sdl2/surface.pyx":654 * rv = rv.parent * * return rv # <<<<<<<<<<<<<< * * def get_offset(self): */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(((PyObject *)__pyx_v_rv)); __pyx_r = ((PyObject *)__pyx_v_rv); goto __pyx_L0; /* "pygame_sdl2/surface.pyx":648 * return self.parent * * def get_abs_parent(self): # <<<<<<<<<<<<<< * rv = self * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_AddTraceback("pygame_sdl2.surface.Surface.get_abs_parent", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF((PyObject *)__pyx_v_rv); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/surface.pyx":656 * return rv * * def get_offset(self): # <<<<<<<<<<<<<< * return (self.offset_x, self.offset_y) * */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_7surface_7Surface_61get_offset(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/ static PyObject *__pyx_pw_11pygame_sdl2_7surface_7Surface_61get_offset(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("get_offset (wrapper)", 0); __pyx_r = __pyx_pf_11pygame_sdl2_7surface_7Surface_60get_offset(((struct __pyx_obj_11pygame_sdl2_7surface_Surface *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_7surface_7Surface_60get_offset(struct __pyx_obj_11pygame_sdl2_7surface_Surface *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; __Pyx_RefNannySetupContext("get_offset", 0); /* "pygame_sdl2/surface.pyx":657 * * def get_offset(self): * return (self.offset_x, self.offset_y) # <<<<<<<<<<<<<< * * def get_abs_offset(self): */ __Pyx_XDECREF(__pyx_r); __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_self->offset_x); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 657, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_v_self->offset_y); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 657, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 657, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_GIVEREF(__pyx_t_1); PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_1); __Pyx_GIVEREF(__pyx_t_2); PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_2); __pyx_t_1 = 0; __pyx_t_2 = 0; __pyx_r = __pyx_t_3; __pyx_t_3 = 0; goto __pyx_L0; /* "pygame_sdl2/surface.pyx":656 * return rv * * def get_offset(self): # <<<<<<<<<<<<<< * return (self.offset_x, self.offset_y) * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("pygame_sdl2.surface.Surface.get_offset", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/surface.pyx":659 * return (self.offset_x, self.offset_y) * * def get_abs_offset(self): # <<<<<<<<<<<<<< * cdef Surface surf = self * */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_7surface_7Surface_63get_abs_offset(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/ static PyObject *__pyx_pw_11pygame_sdl2_7surface_7Surface_63get_abs_offset(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("get_abs_offset (wrapper)", 0); __pyx_r = __pyx_pf_11pygame_sdl2_7surface_7Surface_62get_abs_offset(((struct __pyx_obj_11pygame_sdl2_7surface_Surface *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_7surface_7Surface_62get_abs_offset(struct __pyx_obj_11pygame_sdl2_7surface_Surface *__pyx_v_self) { struct __pyx_obj_11pygame_sdl2_7surface_Surface *__pyx_v_surf = 0; int __pyx_v_offset_x; int __pyx_v_offset_y; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; __Pyx_RefNannySetupContext("get_abs_offset", 0); /* "pygame_sdl2/surface.pyx":660 * * def get_abs_offset(self): * cdef Surface surf = self # <<<<<<<<<<<<<< * * cdef int offset_x = 0 */ __Pyx_INCREF(((PyObject *)__pyx_v_self)); __pyx_v_surf = __pyx_v_self; /* "pygame_sdl2/surface.pyx":662 * cdef Surface surf = self * * cdef int offset_x = 0 # <<<<<<<<<<<<<< * cdef int offset_y = 0 * */ __pyx_v_offset_x = 0; /* "pygame_sdl2/surface.pyx":663 * * cdef int offset_x = 0 * cdef int offset_y = 0 # <<<<<<<<<<<<<< * * while surf: */ __pyx_v_offset_y = 0; /* "pygame_sdl2/surface.pyx":665 * cdef int offset_y = 0 * * while surf: # <<<<<<<<<<<<<< * offset_x += surf.offset_x * offset_y += surf.offset_y */ while (1) { __pyx_t_1 = __Pyx_PyObject_IsTrue(((PyObject *)__pyx_v_surf)); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(0, 665, __pyx_L1_error) if (!__pyx_t_1) break; /* "pygame_sdl2/surface.pyx":666 * * while surf: * offset_x += surf.offset_x # <<<<<<<<<<<<<< * offset_y += surf.offset_y * surf = surf.parent */ __pyx_v_offset_x = (__pyx_v_offset_x + __pyx_v_surf->offset_x); /* "pygame_sdl2/surface.pyx":667 * while surf: * offset_x += surf.offset_x * offset_y += surf.offset_y # <<<<<<<<<<<<<< * surf = surf.parent * */ __pyx_v_offset_y = (__pyx_v_offset_y + __pyx_v_surf->offset_y); /* "pygame_sdl2/surface.pyx":668 * offset_x += surf.offset_x * offset_y += surf.offset_y * surf = surf.parent # <<<<<<<<<<<<<< * * return (offset_x, offset_y) */ __pyx_t_2 = ((PyObject *)__pyx_v_surf->parent); __Pyx_INCREF(__pyx_t_2); __Pyx_DECREF_SET(__pyx_v_surf, ((struct __pyx_obj_11pygame_sdl2_7surface_Surface *)__pyx_t_2)); __pyx_t_2 = 0; } /* "pygame_sdl2/surface.pyx":670 * surf = surf.parent * * return (offset_x, offset_y) # <<<<<<<<<<<<<< * * def get_size(self): */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_v_offset_x); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 670, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = __Pyx_PyInt_From_int(__pyx_v_offset_y); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 670, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 670, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_GIVEREF(__pyx_t_2); PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_2); __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_3); __pyx_t_2 = 0; __pyx_t_3 = 0; __pyx_r = __pyx_t_4; __pyx_t_4 = 0; goto __pyx_L0; /* "pygame_sdl2/surface.pyx":659 * return (self.offset_x, self.offset_y) * * def get_abs_offset(self): # <<<<<<<<<<<<<< * cdef Surface surf = self * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_AddTraceback("pygame_sdl2.surface.Surface.get_abs_offset", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF((PyObject *)__pyx_v_surf); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/surface.pyx":672 * return (offset_x, offset_y) * * def get_size(self): # <<<<<<<<<<<<<< * return self.surface.w, self.surface.h * */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_7surface_7Surface_65get_size(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/ static PyObject *__pyx_pw_11pygame_sdl2_7surface_7Surface_65get_size(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("get_size (wrapper)", 0); __pyx_r = __pyx_pf_11pygame_sdl2_7surface_7Surface_64get_size(((struct __pyx_obj_11pygame_sdl2_7surface_Surface *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_7surface_7Surface_64get_size(struct __pyx_obj_11pygame_sdl2_7surface_Surface *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; __Pyx_RefNannySetupContext("get_size", 0); /* "pygame_sdl2/surface.pyx":673 * * def get_size(self): * return self.surface.w, self.surface.h # <<<<<<<<<<<<<< * * def get_width(self): */ __Pyx_XDECREF(__pyx_r); __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_self->surface->w); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 673, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_v_self->surface->h); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 673, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 673, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_GIVEREF(__pyx_t_1); PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_1); __Pyx_GIVEREF(__pyx_t_2); PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_2); __pyx_t_1 = 0; __pyx_t_2 = 0; __pyx_r = __pyx_t_3; __pyx_t_3 = 0; goto __pyx_L0; /* "pygame_sdl2/surface.pyx":672 * return (offset_x, offset_y) * * def get_size(self): # <<<<<<<<<<<<<< * return self.surface.w, self.surface.h * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("pygame_sdl2.surface.Surface.get_size", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/surface.pyx":675 * return self.surface.w, self.surface.h * * def get_width(self): # <<<<<<<<<<<<<< * return self.surface.w * */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_7surface_7Surface_67get_width(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/ static PyObject *__pyx_pw_11pygame_sdl2_7surface_7Surface_67get_width(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("get_width (wrapper)", 0); __pyx_r = __pyx_pf_11pygame_sdl2_7surface_7Surface_66get_width(((struct __pyx_obj_11pygame_sdl2_7surface_Surface *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_7surface_7Surface_66get_width(struct __pyx_obj_11pygame_sdl2_7surface_Surface *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; __Pyx_RefNannySetupContext("get_width", 0); /* "pygame_sdl2/surface.pyx":676 * * def get_width(self): * return self.surface.w # <<<<<<<<<<<<<< * * def get_height(self): */ __Pyx_XDECREF(__pyx_r); __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_self->surface->w); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 676, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "pygame_sdl2/surface.pyx":675 * return self.surface.w, self.surface.h * * def get_width(self): # <<<<<<<<<<<<<< * return self.surface.w * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("pygame_sdl2.surface.Surface.get_width", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/surface.pyx":678 * return self.surface.w * * def get_height(self): # <<<<<<<<<<<<<< * return self.surface.h * */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_7surface_7Surface_69get_height(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/ static PyObject *__pyx_pw_11pygame_sdl2_7surface_7Surface_69get_height(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("get_height (wrapper)", 0); __pyx_r = __pyx_pf_11pygame_sdl2_7surface_7Surface_68get_height(((struct __pyx_obj_11pygame_sdl2_7surface_Surface *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_7surface_7Surface_68get_height(struct __pyx_obj_11pygame_sdl2_7surface_Surface *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; __Pyx_RefNannySetupContext("get_height", 0); /* "pygame_sdl2/surface.pyx":679 * * def get_height(self): * return self.surface.h # <<<<<<<<<<<<<< * * def get_rect(self, **kwargs): */ __Pyx_XDECREF(__pyx_r); __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_self->surface->h); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 679, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "pygame_sdl2/surface.pyx":678 * return self.surface.w * * def get_height(self): # <<<<<<<<<<<<<< * return self.surface.h * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("pygame_sdl2.surface.Surface.get_height", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/surface.pyx":681 * return self.surface.h * * def get_rect(self, **kwargs): # <<<<<<<<<<<<<< * rv = Rect((0, 0, self.surface.w, self.surface.h)) * */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_7surface_7Surface_71get_rect(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static PyObject *__pyx_pw_11pygame_sdl2_7surface_7Surface_71get_rect(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_kwargs = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("get_rect (wrapper)", 0); if (unlikely(PyTuple_GET_SIZE(__pyx_args) > 0)) { __Pyx_RaiseArgtupleInvalid("get_rect", 1, 0, 0, PyTuple_GET_SIZE(__pyx_args)); return NULL;} if (__pyx_kwds && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "get_rect", 1))) return NULL; __pyx_v_kwargs = (__pyx_kwds) ? PyDict_Copy(__pyx_kwds) : PyDict_New(); if (unlikely(!__pyx_v_kwargs)) return NULL; __Pyx_GOTREF(__pyx_v_kwargs); __pyx_r = __pyx_pf_11pygame_sdl2_7surface_7Surface_70get_rect(((struct __pyx_obj_11pygame_sdl2_7surface_Surface *)__pyx_v_self), __pyx_v_kwargs); /* function exit code */ __Pyx_XDECREF(__pyx_v_kwargs); __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_7surface_7Surface_70get_rect(struct __pyx_obj_11pygame_sdl2_7surface_Surface *__pyx_v_self, PyObject *__pyx_v_kwargs) { PyObject *__pyx_v_rv = NULL; PyObject *__pyx_v_k = NULL; PyObject *__pyx_v_v = NULL; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; PyObject *__pyx_t_5 = NULL; Py_ssize_t __pyx_t_6; PyObject *(*__pyx_t_7)(PyObject *); PyObject *(*__pyx_t_8)(PyObject *); int __pyx_t_9; __Pyx_RefNannySetupContext("get_rect", 0); /* "pygame_sdl2/surface.pyx":682 * * def get_rect(self, **kwargs): * rv = Rect((0, 0, self.surface.w, self.surface.h)) # <<<<<<<<<<<<<< * * for k, v in kwargs.items(): */ __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_Rect); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 682, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = __Pyx_PyInt_From_int(__pyx_v_self->surface->w); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 682, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = __Pyx_PyInt_From_int(__pyx_v_self->surface->h); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 682, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_5 = PyTuple_New(4); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 682, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_INCREF(__pyx_int_0); __Pyx_GIVEREF(__pyx_int_0); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_int_0); __Pyx_INCREF(__pyx_int_0); __Pyx_GIVEREF(__pyx_int_0); PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_int_0); __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_5, 2, __pyx_t_3); __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_5, 3, __pyx_t_4); __pyx_t_3 = 0; __pyx_t_4 = 0; __pyx_t_4 = NULL; if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) { __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_2); if (likely(__pyx_t_4)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_4); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); } } if (!__pyx_t_4) { __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_5); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 682, __pyx_L1_error) __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_GOTREF(__pyx_t_1); } else { #if CYTHON_FAST_PYCALL if (PyFunction_Check(__pyx_t_2)) { PyObject *__pyx_temp[2] = {__pyx_t_4, __pyx_t_5}; __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_2, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 682, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; } else #endif #if CYTHON_FAST_PYCCALL if (__Pyx_PyFastCFunction_Check(__pyx_t_2)) { PyObject *__pyx_temp[2] = {__pyx_t_4, __pyx_t_5}; __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_2, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 682, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; } else #endif { __pyx_t_3 = PyTuple_New(1+1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 682, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_4); __pyx_t_4 = NULL; __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_3, 0+1, __pyx_t_5); __pyx_t_5 = 0; __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_3, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 682, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } } __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_v_rv = __pyx_t_1; __pyx_t_1 = 0; /* "pygame_sdl2/surface.pyx":684 * rv = Rect((0, 0, self.surface.w, self.surface.h)) * * for k, v in kwargs.items(): # <<<<<<<<<<<<<< * setattr(rv, k, v) * */ __pyx_t_1 = __Pyx_PyDict_Items(__pyx_v_kwargs); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 684, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (likely(PyList_CheckExact(__pyx_t_1)) || PyTuple_CheckExact(__pyx_t_1)) { __pyx_t_2 = __pyx_t_1; __Pyx_INCREF(__pyx_t_2); __pyx_t_6 = 0; __pyx_t_7 = NULL; } else { __pyx_t_6 = -1; __pyx_t_2 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 684, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_7 = Py_TYPE(__pyx_t_2)->tp_iternext; if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 684, __pyx_L1_error) } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; for (;;) { if (likely(!__pyx_t_7)) { if (likely(PyList_CheckExact(__pyx_t_2))) { if (__pyx_t_6 >= PyList_GET_SIZE(__pyx_t_2)) break; #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS __pyx_t_1 = PyList_GET_ITEM(__pyx_t_2, __pyx_t_6); __Pyx_INCREF(__pyx_t_1); __pyx_t_6++; if (unlikely(0 < 0)) __PYX_ERR(0, 684, __pyx_L1_error) #else __pyx_t_1 = PySequence_ITEM(__pyx_t_2, __pyx_t_6); __pyx_t_6++; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 684, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); #endif } else { if (__pyx_t_6 >= PyTuple_GET_SIZE(__pyx_t_2)) break; #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS __pyx_t_1 = PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_6); __Pyx_INCREF(__pyx_t_1); __pyx_t_6++; if (unlikely(0 < 0)) __PYX_ERR(0, 684, __pyx_L1_error) #else __pyx_t_1 = PySequence_ITEM(__pyx_t_2, __pyx_t_6); __pyx_t_6++; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 684, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); #endif } } else { __pyx_t_1 = __pyx_t_7(__pyx_t_2); if (unlikely(!__pyx_t_1)) { PyObject* exc_type = PyErr_Occurred(); if (exc_type) { if (likely(exc_type == PyExc_StopIteration || PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); else __PYX_ERR(0, 684, __pyx_L1_error) } break; } __Pyx_GOTREF(__pyx_t_1); } if ((likely(PyTuple_CheckExact(__pyx_t_1))) || (PyList_CheckExact(__pyx_t_1))) { PyObject* sequence = __pyx_t_1; #if !CYTHON_COMPILING_IN_PYPY Py_ssize_t size = Py_SIZE(sequence); #else Py_ssize_t size = PySequence_Size(sequence); #endif if (unlikely(size != 2)) { if (size > 2) __Pyx_RaiseTooManyValuesError(2); else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); __PYX_ERR(0, 684, __pyx_L1_error) } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS if (likely(PyTuple_CheckExact(sequence))) { __pyx_t_3 = PyTuple_GET_ITEM(sequence, 0); __pyx_t_5 = PyTuple_GET_ITEM(sequence, 1); } else { __pyx_t_3 = PyList_GET_ITEM(sequence, 0); __pyx_t_5 = PyList_GET_ITEM(sequence, 1); } __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(__pyx_t_5); #else __pyx_t_3 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 684, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_5 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 684, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); #endif __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; } else { Py_ssize_t index = -1; __pyx_t_4 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 684, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_8 = Py_TYPE(__pyx_t_4)->tp_iternext; index = 0; __pyx_t_3 = __pyx_t_8(__pyx_t_4); if (unlikely(!__pyx_t_3)) goto __pyx_L5_unpacking_failed; __Pyx_GOTREF(__pyx_t_3); index = 1; __pyx_t_5 = __pyx_t_8(__pyx_t_4); if (unlikely(!__pyx_t_5)) goto __pyx_L5_unpacking_failed; __Pyx_GOTREF(__pyx_t_5); if (__Pyx_IternextUnpackEndCheck(__pyx_t_8(__pyx_t_4), 2) < 0) __PYX_ERR(0, 684, __pyx_L1_error) __pyx_t_8 = NULL; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; goto __pyx_L6_unpacking_done; __pyx_L5_unpacking_failed:; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_t_8 = NULL; if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); __PYX_ERR(0, 684, __pyx_L1_error) __pyx_L6_unpacking_done:; } __Pyx_XDECREF_SET(__pyx_v_k, __pyx_t_3); __pyx_t_3 = 0; __Pyx_XDECREF_SET(__pyx_v_v, __pyx_t_5); __pyx_t_5 = 0; /* "pygame_sdl2/surface.pyx":685 * * for k, v in kwargs.items(): * setattr(rv, k, v) # <<<<<<<<<<<<<< * * return rv */ __pyx_t_9 = PyObject_SetAttr(__pyx_v_rv, __pyx_v_k, __pyx_v_v); if (unlikely(__pyx_t_9 == -1)) __PYX_ERR(0, 685, __pyx_L1_error) /* "pygame_sdl2/surface.pyx":684 * rv = Rect((0, 0, self.surface.w, self.surface.h)) * * for k, v in kwargs.items(): # <<<<<<<<<<<<<< * setattr(rv, k, v) * */ } __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "pygame_sdl2/surface.pyx":687 * setattr(rv, k, v) * * return rv # <<<<<<<<<<<<<< * * def get_bitsize(self): */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(__pyx_v_rv); __pyx_r = __pyx_v_rv; goto __pyx_L0; /* "pygame_sdl2/surface.pyx":681 * return self.surface.h * * def get_rect(self, **kwargs): # <<<<<<<<<<<<<< * rv = Rect((0, 0, self.surface.w, self.surface.h)) * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_5); __Pyx_AddTraceback("pygame_sdl2.surface.Surface.get_rect", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF(__pyx_v_rv); __Pyx_XDECREF(__pyx_v_k); __Pyx_XDECREF(__pyx_v_v); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/surface.pyx":689 * return rv * * def get_bitsize(self): # <<<<<<<<<<<<<< * return self.surface.format.BitsPerPixel * */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_7surface_7Surface_73get_bitsize(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/ static PyObject *__pyx_pw_11pygame_sdl2_7surface_7Surface_73get_bitsize(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("get_bitsize (wrapper)", 0); __pyx_r = __pyx_pf_11pygame_sdl2_7surface_7Surface_72get_bitsize(((struct __pyx_obj_11pygame_sdl2_7surface_Surface *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_7surface_7Surface_72get_bitsize(struct __pyx_obj_11pygame_sdl2_7surface_Surface *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; __Pyx_RefNannySetupContext("get_bitsize", 0); /* "pygame_sdl2/surface.pyx":690 * * def get_bitsize(self): * return self.surface.format.BitsPerPixel # <<<<<<<<<<<<<< * * def get_bytesize(self): */ __Pyx_XDECREF(__pyx_r); __pyx_t_1 = __Pyx_PyInt_From_uint8_t(__pyx_v_self->surface->format->BitsPerPixel); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 690, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "pygame_sdl2/surface.pyx":689 * return rv * * def get_bitsize(self): # <<<<<<<<<<<<<< * return self.surface.format.BitsPerPixel * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("pygame_sdl2.surface.Surface.get_bitsize", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/surface.pyx":692 * return self.surface.format.BitsPerPixel * * def get_bytesize(self): # <<<<<<<<<<<<<< * return self.surface.format.BytesPerPixel * */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_7surface_7Surface_75get_bytesize(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/ static PyObject *__pyx_pw_11pygame_sdl2_7surface_7Surface_75get_bytesize(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("get_bytesize (wrapper)", 0); __pyx_r = __pyx_pf_11pygame_sdl2_7surface_7Surface_74get_bytesize(((struct __pyx_obj_11pygame_sdl2_7surface_Surface *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_7surface_7Surface_74get_bytesize(struct __pyx_obj_11pygame_sdl2_7surface_Surface *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; __Pyx_RefNannySetupContext("get_bytesize", 0); /* "pygame_sdl2/surface.pyx":693 * * def get_bytesize(self): * return self.surface.format.BytesPerPixel # <<<<<<<<<<<<<< * * def get_flags(self): */ __Pyx_XDECREF(__pyx_r); __pyx_t_1 = __Pyx_PyInt_From_uint8_t(__pyx_v_self->surface->format->BytesPerPixel); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 693, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "pygame_sdl2/surface.pyx":692 * return self.surface.format.BitsPerPixel * * def get_bytesize(self): # <<<<<<<<<<<<<< * return self.surface.format.BytesPerPixel * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("pygame_sdl2.surface.Surface.get_bytesize", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/surface.pyx":695 * return self.surface.format.BytesPerPixel * * def get_flags(self): # <<<<<<<<<<<<<< * * if self.get_window_flags: */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_7surface_7Surface_77get_flags(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/ static PyObject *__pyx_pw_11pygame_sdl2_7surface_7Surface_77get_flags(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("get_flags (wrapper)", 0); __pyx_r = __pyx_pf_11pygame_sdl2_7surface_7Surface_76get_flags(((struct __pyx_obj_11pygame_sdl2_7surface_Surface *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_7surface_7Surface_76get_flags(struct __pyx_obj_11pygame_sdl2_7surface_Surface *__pyx_v_self) { PyObject *__pyx_v_rv = NULL; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; int __pyx_t_5; __Pyx_RefNannySetupContext("get_flags", 0); /* "pygame_sdl2/surface.pyx":697 * def get_flags(self): * * if self.get_window_flags: # <<<<<<<<<<<<<< * rv = self.get_window_flags() * else: */ __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_self->get_window_flags); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(0, 697, __pyx_L1_error) if (__pyx_t_1) { /* "pygame_sdl2/surface.pyx":698 * * if self.get_window_flags: * rv = self.get_window_flags() # <<<<<<<<<<<<<< * else: * rv = 0 */ __Pyx_INCREF(__pyx_v_self->get_window_flags); __pyx_t_3 = __pyx_v_self->get_window_flags; __pyx_t_4 = NULL; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) { __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3); if (likely(__pyx_t_4)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); __Pyx_INCREF(__pyx_t_4); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_3, function); } } if (__pyx_t_4) { __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 698, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; } else { __pyx_t_2 = __Pyx_PyObject_CallNoArg(__pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 698, __pyx_L1_error) } __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_v_rv = __pyx_t_2; __pyx_t_2 = 0; /* "pygame_sdl2/surface.pyx":697 * def get_flags(self): * * if self.get_window_flags: # <<<<<<<<<<<<<< * rv = self.get_window_flags() * else: */ goto __pyx_L3; } /* "pygame_sdl2/surface.pyx":700 * rv = self.get_window_flags() * else: * rv = 0 # <<<<<<<<<<<<<< * * if self.surface.format.Amask or self.has_alpha: */ /*else*/ { __Pyx_INCREF(__pyx_int_0); __pyx_v_rv = __pyx_int_0; } __pyx_L3:; /* "pygame_sdl2/surface.pyx":702 * rv = 0 * * if self.surface.format.Amask or self.has_alpha: # <<<<<<<<<<<<<< * rv = rv | SRCALPHA * */ __pyx_t_5 = (__pyx_v_self->surface->format->Amask != 0); if (!__pyx_t_5) { } else { __pyx_t_1 = __pyx_t_5; goto __pyx_L5_bool_binop_done; } __pyx_t_5 = (__pyx_v_self->has_alpha != 0); __pyx_t_1 = __pyx_t_5; __pyx_L5_bool_binop_done:; if (__pyx_t_1) { /* "pygame_sdl2/surface.pyx":703 * * if self.surface.format.Amask or self.has_alpha: * rv = rv | SRCALPHA # <<<<<<<<<<<<<< * * return rv */ __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_SRCALPHA); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 703, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = PyNumber_Or(__pyx_v_rv, __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 703, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF_SET(__pyx_v_rv, __pyx_t_3); __pyx_t_3 = 0; /* "pygame_sdl2/surface.pyx":702 * rv = 0 * * if self.surface.format.Amask or self.has_alpha: # <<<<<<<<<<<<<< * rv = rv | SRCALPHA * */ } /* "pygame_sdl2/surface.pyx":705 * rv = rv | SRCALPHA * * return rv # <<<<<<<<<<<<<< * * def get_pitch(self): */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(__pyx_v_rv); __pyx_r = __pyx_v_rv; goto __pyx_L0; /* "pygame_sdl2/surface.pyx":695 * return self.surface.format.BytesPerPixel * * def get_flags(self): # <<<<<<<<<<<<<< * * if self.get_window_flags: */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_AddTraceback("pygame_sdl2.surface.Surface.get_flags", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF(__pyx_v_rv); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/surface.pyx":707 * return rv * * def get_pitch(self): # <<<<<<<<<<<<<< * return self.surface.pitch * */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_7surface_7Surface_79get_pitch(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/ static PyObject *__pyx_pw_11pygame_sdl2_7surface_7Surface_79get_pitch(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("get_pitch (wrapper)", 0); __pyx_r = __pyx_pf_11pygame_sdl2_7surface_7Surface_78get_pitch(((struct __pyx_obj_11pygame_sdl2_7surface_Surface *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_7surface_7Surface_78get_pitch(struct __pyx_obj_11pygame_sdl2_7surface_Surface *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; __Pyx_RefNannySetupContext("get_pitch", 0); /* "pygame_sdl2/surface.pyx":708 * * def get_pitch(self): * return self.surface.pitch # <<<<<<<<<<<<<< * * def get_masks(self): */ __Pyx_XDECREF(__pyx_r); __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_self->surface->pitch); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 708, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "pygame_sdl2/surface.pyx":707 * return rv * * def get_pitch(self): # <<<<<<<<<<<<<< * return self.surface.pitch * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("pygame_sdl2.surface.Surface.get_pitch", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/surface.pyx":710 * return self.surface.pitch * * def get_masks(self): # <<<<<<<<<<<<<< * cdef SDL_PixelFormat *format = self.surface.format * return (format.Rmask, format.Gmask, format.Bmask, format.Amask) */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_7surface_7Surface_81get_masks(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/ static PyObject *__pyx_pw_11pygame_sdl2_7surface_7Surface_81get_masks(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("get_masks (wrapper)", 0); __pyx_r = __pyx_pf_11pygame_sdl2_7surface_7Surface_80get_masks(((struct __pyx_obj_11pygame_sdl2_7surface_Surface *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_7surface_7Surface_80get_masks(struct __pyx_obj_11pygame_sdl2_7surface_Surface *__pyx_v_self) { SDL_PixelFormat *__pyx_v_format; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations SDL_PixelFormat *__pyx_t_1; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; PyObject *__pyx_t_5 = NULL; PyObject *__pyx_t_6 = NULL; __Pyx_RefNannySetupContext("get_masks", 0); /* "pygame_sdl2/surface.pyx":711 * * def get_masks(self): * cdef SDL_PixelFormat *format = self.surface.format # <<<<<<<<<<<<<< * return (format.Rmask, format.Gmask, format.Bmask, format.Amask) * */ __pyx_t_1 = __pyx_v_self->surface->format; __pyx_v_format = __pyx_t_1; /* "pygame_sdl2/surface.pyx":712 * def get_masks(self): * cdef SDL_PixelFormat *format = self.surface.format * return (format.Rmask, format.Gmask, format.Bmask, format.Amask) # <<<<<<<<<<<<<< * * def set_masks(self, masks): */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __Pyx_PyInt_From_uint32_t(__pyx_v_format->Rmask); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 712, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = __Pyx_PyInt_From_uint32_t(__pyx_v_format->Gmask); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 712, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = __Pyx_PyInt_From_uint32_t(__pyx_v_format->Bmask); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 712, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_5 = __Pyx_PyInt_From_uint32_t(__pyx_v_format->Amask); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 712, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_6 = PyTuple_New(4); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 712, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_GIVEREF(__pyx_t_2); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_2); __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_6, 1, __pyx_t_3); __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_6, 2, __pyx_t_4); __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_6, 3, __pyx_t_5); __pyx_t_2 = 0; __pyx_t_3 = 0; __pyx_t_4 = 0; __pyx_t_5 = 0; __pyx_r = __pyx_t_6; __pyx_t_6 = 0; goto __pyx_L0; /* "pygame_sdl2/surface.pyx":710 * return self.surface.pitch * * def get_masks(self): # <<<<<<<<<<<<<< * cdef SDL_PixelFormat *format = self.surface.format * return (format.Rmask, format.Gmask, format.Bmask, format.Amask) */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_5); __Pyx_XDECREF(__pyx_t_6); __Pyx_AddTraceback("pygame_sdl2.surface.Surface.get_masks", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/surface.pyx":714 * return (format.Rmask, format.Gmask, format.Bmask, format.Amask) * * def set_masks(self, masks): # <<<<<<<<<<<<<< * warnings.warn("Surface.set_masks is not supported.") * */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_7surface_7Surface_83set_masks(PyObject *__pyx_v_self, PyObject *__pyx_v_masks); /*proto*/ static PyObject *__pyx_pw_11pygame_sdl2_7surface_7Surface_83set_masks(PyObject *__pyx_v_self, PyObject *__pyx_v_masks) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("set_masks (wrapper)", 0); __pyx_r = __pyx_pf_11pygame_sdl2_7surface_7Surface_82set_masks(((struct __pyx_obj_11pygame_sdl2_7surface_Surface *)__pyx_v_self), ((PyObject *)__pyx_v_masks)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_7surface_7Surface_82set_masks(CYTHON_UNUSED struct __pyx_obj_11pygame_sdl2_7surface_Surface *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v_masks) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; __Pyx_RefNannySetupContext("set_masks", 0); /* "pygame_sdl2/surface.pyx":715 * * def set_masks(self, masks): * warnings.warn("Surface.set_masks is not supported.") # <<<<<<<<<<<<<< * * def get_shifts(self): */ __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_warnings); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 715, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_warn); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 715, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_tuple__16, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 715, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "pygame_sdl2/surface.pyx":714 * return (format.Rmask, format.Gmask, format.Bmask, format.Amask) * * def set_masks(self, masks): # <<<<<<<<<<<<<< * warnings.warn("Surface.set_masks is not supported.") * */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_AddTraceback("pygame_sdl2.surface.Surface.set_masks", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/surface.pyx":717 * warnings.warn("Surface.set_masks is not supported.") * * def get_shifts(self): # <<<<<<<<<<<<<< * cdef SDL_PixelFormat *format = self.surface.format * return (format.Rshift, format.Gshift, format.Bshift, format.Ashift) */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_7surface_7Surface_85get_shifts(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/ static PyObject *__pyx_pw_11pygame_sdl2_7surface_7Surface_85get_shifts(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("get_shifts (wrapper)", 0); __pyx_r = __pyx_pf_11pygame_sdl2_7surface_7Surface_84get_shifts(((struct __pyx_obj_11pygame_sdl2_7surface_Surface *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_7surface_7Surface_84get_shifts(struct __pyx_obj_11pygame_sdl2_7surface_Surface *__pyx_v_self) { SDL_PixelFormat *__pyx_v_format; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations SDL_PixelFormat *__pyx_t_1; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; PyObject *__pyx_t_5 = NULL; PyObject *__pyx_t_6 = NULL; __Pyx_RefNannySetupContext("get_shifts", 0); /* "pygame_sdl2/surface.pyx":718 * * def get_shifts(self): * cdef SDL_PixelFormat *format = self.surface.format # <<<<<<<<<<<<<< * return (format.Rshift, format.Gshift, format.Bshift, format.Ashift) * */ __pyx_t_1 = __pyx_v_self->surface->format; __pyx_v_format = __pyx_t_1; /* "pygame_sdl2/surface.pyx":719 * def get_shifts(self): * cdef SDL_PixelFormat *format = self.surface.format * return (format.Rshift, format.Gshift, format.Bshift, format.Ashift) # <<<<<<<<<<<<<< * * def set_shifts(self, shifts): */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __Pyx_PyInt_From_uint8_t(__pyx_v_format->Rshift); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 719, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = __Pyx_PyInt_From_uint8_t(__pyx_v_format->Gshift); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 719, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = __Pyx_PyInt_From_uint8_t(__pyx_v_format->Bshift); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 719, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_5 = __Pyx_PyInt_From_uint8_t(__pyx_v_format->Ashift); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 719, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_6 = PyTuple_New(4); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 719, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_GIVEREF(__pyx_t_2); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_2); __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_6, 1, __pyx_t_3); __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_6, 2, __pyx_t_4); __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_6, 3, __pyx_t_5); __pyx_t_2 = 0; __pyx_t_3 = 0; __pyx_t_4 = 0; __pyx_t_5 = 0; __pyx_r = __pyx_t_6; __pyx_t_6 = 0; goto __pyx_L0; /* "pygame_sdl2/surface.pyx":717 * warnings.warn("Surface.set_masks is not supported.") * * def get_shifts(self): # <<<<<<<<<<<<<< * cdef SDL_PixelFormat *format = self.surface.format * return (format.Rshift, format.Gshift, format.Bshift, format.Ashift) */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_5); __Pyx_XDECREF(__pyx_t_6); __Pyx_AddTraceback("pygame_sdl2.surface.Surface.get_shifts", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/surface.pyx":721 * return (format.Rshift, format.Gshift, format.Bshift, format.Ashift) * * def set_shifts(self, shifts): # <<<<<<<<<<<<<< * warnings.warn("Surface.set_shifts is not supported.") * */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_7surface_7Surface_87set_shifts(PyObject *__pyx_v_self, PyObject *__pyx_v_shifts); /*proto*/ static PyObject *__pyx_pw_11pygame_sdl2_7surface_7Surface_87set_shifts(PyObject *__pyx_v_self, PyObject *__pyx_v_shifts) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("set_shifts (wrapper)", 0); __pyx_r = __pyx_pf_11pygame_sdl2_7surface_7Surface_86set_shifts(((struct __pyx_obj_11pygame_sdl2_7surface_Surface *)__pyx_v_self), ((PyObject *)__pyx_v_shifts)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_7surface_7Surface_86set_shifts(CYTHON_UNUSED struct __pyx_obj_11pygame_sdl2_7surface_Surface *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v_shifts) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; __Pyx_RefNannySetupContext("set_shifts", 0); /* "pygame_sdl2/surface.pyx":722 * * def set_shifts(self, shifts): * warnings.warn("Surface.set_shifts is not supported.") # <<<<<<<<<<<<<< * * def get_shifts(self): */ __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_warnings); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 722, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_warn); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 722, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_tuple__17, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 722, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "pygame_sdl2/surface.pyx":721 * return (format.Rshift, format.Gshift, format.Bshift, format.Ashift) * * def set_shifts(self, shifts): # <<<<<<<<<<<<<< * warnings.warn("Surface.set_shifts is not supported.") * */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_AddTraceback("pygame_sdl2.surface.Surface.set_shifts", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/surface.pyx":724 * warnings.warn("Surface.set_shifts is not supported.") * * def get_shifts(self): # <<<<<<<<<<<<<< * cdef SDL_PixelFormat *format = self.surface.format * return (format.Rshift, format.Gshift, format.Bshift, format.Ashift) */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_7surface_7Surface_89get_shifts(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/ static PyObject *__pyx_pw_11pygame_sdl2_7surface_7Surface_89get_shifts(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("get_shifts (wrapper)", 0); __pyx_r = __pyx_pf_11pygame_sdl2_7surface_7Surface_88get_shifts(((struct __pyx_obj_11pygame_sdl2_7surface_Surface *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_7surface_7Surface_88get_shifts(struct __pyx_obj_11pygame_sdl2_7surface_Surface *__pyx_v_self) { SDL_PixelFormat *__pyx_v_format; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations SDL_PixelFormat *__pyx_t_1; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; PyObject *__pyx_t_5 = NULL; PyObject *__pyx_t_6 = NULL; __Pyx_RefNannySetupContext("get_shifts", 0); /* "pygame_sdl2/surface.pyx":725 * * def get_shifts(self): * cdef SDL_PixelFormat *format = self.surface.format # <<<<<<<<<<<<<< * return (format.Rshift, format.Gshift, format.Bshift, format.Ashift) * */ __pyx_t_1 = __pyx_v_self->surface->format; __pyx_v_format = __pyx_t_1; /* "pygame_sdl2/surface.pyx":726 * def get_shifts(self): * cdef SDL_PixelFormat *format = self.surface.format * return (format.Rshift, format.Gshift, format.Bshift, format.Ashift) # <<<<<<<<<<<<<< * * def get_losses(self): */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __Pyx_PyInt_From_uint8_t(__pyx_v_format->Rshift); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 726, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = __Pyx_PyInt_From_uint8_t(__pyx_v_format->Gshift); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 726, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = __Pyx_PyInt_From_uint8_t(__pyx_v_format->Bshift); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 726, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_5 = __Pyx_PyInt_From_uint8_t(__pyx_v_format->Ashift); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 726, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_6 = PyTuple_New(4); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 726, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_GIVEREF(__pyx_t_2); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_2); __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_6, 1, __pyx_t_3); __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_6, 2, __pyx_t_4); __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_6, 3, __pyx_t_5); __pyx_t_2 = 0; __pyx_t_3 = 0; __pyx_t_4 = 0; __pyx_t_5 = 0; __pyx_r = __pyx_t_6; __pyx_t_6 = 0; goto __pyx_L0; /* "pygame_sdl2/surface.pyx":724 * warnings.warn("Surface.set_shifts is not supported.") * * def get_shifts(self): # <<<<<<<<<<<<<< * cdef SDL_PixelFormat *format = self.surface.format * return (format.Rshift, format.Gshift, format.Bshift, format.Ashift) */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_5); __Pyx_XDECREF(__pyx_t_6); __Pyx_AddTraceback("pygame_sdl2.surface.Surface.get_shifts", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/surface.pyx":728 * return (format.Rshift, format.Gshift, format.Bshift, format.Ashift) * * def get_losses(self): # <<<<<<<<<<<<<< * cdef SDL_PixelFormat *format = self.surface.format * return (format.Rloss, format.Gloss, format.Bloss, format.Aloss) */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_7surface_7Surface_91get_losses(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/ static PyObject *__pyx_pw_11pygame_sdl2_7surface_7Surface_91get_losses(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("get_losses (wrapper)", 0); __pyx_r = __pyx_pf_11pygame_sdl2_7surface_7Surface_90get_losses(((struct __pyx_obj_11pygame_sdl2_7surface_Surface *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_7surface_7Surface_90get_losses(struct __pyx_obj_11pygame_sdl2_7surface_Surface *__pyx_v_self) { SDL_PixelFormat *__pyx_v_format; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations SDL_PixelFormat *__pyx_t_1; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; PyObject *__pyx_t_5 = NULL; PyObject *__pyx_t_6 = NULL; __Pyx_RefNannySetupContext("get_losses", 0); /* "pygame_sdl2/surface.pyx":729 * * def get_losses(self): * cdef SDL_PixelFormat *format = self.surface.format # <<<<<<<<<<<<<< * return (format.Rloss, format.Gloss, format.Bloss, format.Aloss) * */ __pyx_t_1 = __pyx_v_self->surface->format; __pyx_v_format = __pyx_t_1; /* "pygame_sdl2/surface.pyx":730 * def get_losses(self): * cdef SDL_PixelFormat *format = self.surface.format * return (format.Rloss, format.Gloss, format.Bloss, format.Aloss) # <<<<<<<<<<<<<< * * def get_bounding_rect(self, min_alpha=1): */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __Pyx_PyInt_From_uint8_t(__pyx_v_format->Rloss); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 730, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = __Pyx_PyInt_From_uint8_t(__pyx_v_format->Gloss); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 730, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = __Pyx_PyInt_From_uint8_t(__pyx_v_format->Bloss); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 730, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_5 = __Pyx_PyInt_From_uint8_t(__pyx_v_format->Aloss); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 730, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_6 = PyTuple_New(4); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 730, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_GIVEREF(__pyx_t_2); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_2); __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_6, 1, __pyx_t_3); __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_6, 2, __pyx_t_4); __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_6, 3, __pyx_t_5); __pyx_t_2 = 0; __pyx_t_3 = 0; __pyx_t_4 = 0; __pyx_t_5 = 0; __pyx_r = __pyx_t_6; __pyx_t_6 = 0; goto __pyx_L0; /* "pygame_sdl2/surface.pyx":728 * return (format.Rshift, format.Gshift, format.Bshift, format.Ashift) * * def get_losses(self): # <<<<<<<<<<<<<< * cdef SDL_PixelFormat *format = self.surface.format * return (format.Rloss, format.Gloss, format.Bloss, format.Aloss) */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_5); __Pyx_XDECREF(__pyx_t_6); __Pyx_AddTraceback("pygame_sdl2.surface.Surface.get_losses", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/surface.pyx":732 * return (format.Rloss, format.Gloss, format.Bloss, format.Aloss) * * def get_bounding_rect(self, min_alpha=1): # <<<<<<<<<<<<<< * * cdef Uint32 amask = self.surface.format.Amask */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_7surface_7Surface_93get_bounding_rect(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static PyObject *__pyx_pw_11pygame_sdl2_7surface_7Surface_93get_bounding_rect(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_min_alpha = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("get_bounding_rect (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_min_alpha,0}; PyObject* values[1] = {0}; values[0] = ((PyObject *)__pyx_int_1); if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (kw_args > 0) { PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_min_alpha); if (value) { values[0] = value; kw_args--; } } } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "get_bounding_rect") < 0)) __PYX_ERR(0, 732, __pyx_L3_error) } } else { switch (PyTuple_GET_SIZE(__pyx_args)) { case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); case 0: break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_min_alpha = values[0]; } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("get_bounding_rect", 0, 0, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 732, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("pygame_sdl2.surface.Surface.get_bounding_rect", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_11pygame_sdl2_7surface_7Surface_92get_bounding_rect(((struct __pyx_obj_11pygame_sdl2_7surface_Surface *)__pyx_v_self), __pyx_v_min_alpha); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_7surface_7Surface_92get_bounding_rect(struct __pyx_obj_11pygame_sdl2_7surface_Surface *__pyx_v_self, PyObject *__pyx_v_min_alpha) { Uint32 __pyx_v_amask; Uint32 __pyx_v_amin; int __pyx_v_x; int __pyx_v_y; int __pyx_v_w; int __pyx_v_h; int __pyx_v_minx; int __pyx_v_maxx; int __pyx_v_miny; int __pyx_v_maxy; Uint32 *__pyx_v_row; Uint32 __pyx_v_topleft; Uint32 __pyx_v_botright; Uint8 *__pyx_v_pixels; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations Uint32 __pyx_t_1; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; int __pyx_t_5; int __pyx_t_6; PyObject *__pyx_t_7 = NULL; PyObject *__pyx_t_8 = NULL; int __pyx_t_9; int __pyx_t_10; long __pyx_t_11; long __pyx_t_12; PyObject *__pyx_t_13 = NULL; PyObject *__pyx_t_14 = NULL; __Pyx_RefNannySetupContext("get_bounding_rect", 0); /* "pygame_sdl2/surface.pyx":734 * def get_bounding_rect(self, min_alpha=1): * * cdef Uint32 amask = self.surface.format.Amask # <<<<<<<<<<<<<< * cdef Uint32 amin = (0x01010101 * min_alpha) & amask * */ __pyx_t_1 = __pyx_v_self->surface->format->Amask; __pyx_v_amask = __pyx_t_1; /* "pygame_sdl2/surface.pyx":735 * * cdef Uint32 amask = self.surface.format.Amask * cdef Uint32 amin = (0x01010101 * min_alpha) & amask # <<<<<<<<<<<<<< * * cdef int x */ __pyx_t_2 = PyNumber_Multiply(__pyx_int_16843009, __pyx_v_min_alpha); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 735, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = __Pyx_PyInt_From_uint32_t(__pyx_v_amask); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 735, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = PyNumber_And(__pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 735, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_1 = __Pyx_PyInt_As_uint32_t(__pyx_t_4); if (unlikely((__pyx_t_1 == ((Uint32)-1)) && PyErr_Occurred())) __PYX_ERR(0, 735, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_v_amin = __pyx_t_1; /* "pygame_sdl2/surface.pyx":742 * cdef int h * * cdef int minx = self.surface.w - 1 # <<<<<<<<<<<<<< * cdef int maxx = 0 * cdef int miny = self.surface.h - 1 */ __pyx_v_minx = (__pyx_v_self->surface->w - 1); /* "pygame_sdl2/surface.pyx":743 * * cdef int minx = self.surface.w - 1 * cdef int maxx = 0 # <<<<<<<<<<<<<< * cdef int miny = self.surface.h - 1 * cdef int maxy = 0 */ __pyx_v_maxx = 0; /* "pygame_sdl2/surface.pyx":744 * cdef int minx = self.surface.w - 1 * cdef int maxx = 0 * cdef int miny = self.surface.h - 1 # <<<<<<<<<<<<<< * cdef int maxy = 0 * */ __pyx_v_miny = (__pyx_v_self->surface->h - 1); /* "pygame_sdl2/surface.pyx":745 * cdef int maxx = 0 * cdef int miny = self.surface.h - 1 * cdef int maxy = 0 # <<<<<<<<<<<<<< * * cdef Uint32 *row */ __pyx_v_maxy = 0; /* "pygame_sdl2/surface.pyx":752 * cdef Uint32 botright * * if (not amask) or (self.surface.w == 0) or (self.surface.h == 0): # <<<<<<<<<<<<<< * return Rect((0, 0, self.surface.w, self.surface.h)) * */ __pyx_t_6 = ((!(__pyx_v_amask != 0)) != 0); if (!__pyx_t_6) { } else { __pyx_t_5 = __pyx_t_6; goto __pyx_L4_bool_binop_done; } __pyx_t_6 = ((__pyx_v_self->surface->w == 0) != 0); if (!__pyx_t_6) { } else { __pyx_t_5 = __pyx_t_6; goto __pyx_L4_bool_binop_done; } __pyx_t_6 = ((__pyx_v_self->surface->h == 0) != 0); __pyx_t_5 = __pyx_t_6; __pyx_L4_bool_binop_done:; if (__pyx_t_5) { /* "pygame_sdl2/surface.pyx":753 * * if (not amask) or (self.surface.w == 0) or (self.surface.h == 0): * return Rect((0, 0, self.surface.w, self.surface.h)) # <<<<<<<<<<<<<< * * self.lock() */ __Pyx_XDECREF(__pyx_r); __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_Rect); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 753, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_v_self->surface->w); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 753, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_7 = __Pyx_PyInt_From_int(__pyx_v_self->surface->h); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 753, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __pyx_t_8 = PyTuple_New(4); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 753, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __Pyx_INCREF(__pyx_int_0); __Pyx_GIVEREF(__pyx_int_0); PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_int_0); __Pyx_INCREF(__pyx_int_0); __Pyx_GIVEREF(__pyx_int_0); PyTuple_SET_ITEM(__pyx_t_8, 1, __pyx_int_0); __Pyx_GIVEREF(__pyx_t_2); PyTuple_SET_ITEM(__pyx_t_8, 2, __pyx_t_2); __Pyx_GIVEREF(__pyx_t_7); PyTuple_SET_ITEM(__pyx_t_8, 3, __pyx_t_7); __pyx_t_2 = 0; __pyx_t_7 = 0; __pyx_t_7 = NULL; if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) { __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_3); if (likely(__pyx_t_7)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); __Pyx_INCREF(__pyx_t_7); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_3, function); } } if (!__pyx_t_7) { __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_8); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 753, __pyx_L1_error) __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; __Pyx_GOTREF(__pyx_t_4); } else { #if CYTHON_FAST_PYCALL if (PyFunction_Check(__pyx_t_3)) { PyObject *__pyx_temp[2] = {__pyx_t_7, __pyx_t_8}; __pyx_t_4 = __Pyx_PyFunction_FastCall(__pyx_t_3, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 753, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; } else #endif #if CYTHON_FAST_PYCCALL if (__Pyx_PyFastCFunction_Check(__pyx_t_3)) { PyObject *__pyx_temp[2] = {__pyx_t_7, __pyx_t_8}; __pyx_t_4 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 753, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; } else #endif { __pyx_t_2 = PyTuple_New(1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 753, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_GIVEREF(__pyx_t_7); PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_7); __pyx_t_7 = NULL; __Pyx_GIVEREF(__pyx_t_8); PyTuple_SET_ITEM(__pyx_t_2, 0+1, __pyx_t_8); __pyx_t_8 = 0; __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_2, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 753, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } } __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_r = __pyx_t_4; __pyx_t_4 = 0; goto __pyx_L0; /* "pygame_sdl2/surface.pyx":752 * cdef Uint32 botright * * if (not amask) or (self.surface.w == 0) or (self.surface.h == 0): # <<<<<<<<<<<<<< * return Rect((0, 0, self.surface.w, self.surface.h)) * */ } /* "pygame_sdl2/surface.pyx":755 * return Rect((0, 0, self.surface.w, self.surface.h)) * * self.lock() # <<<<<<<<<<<<<< * * cdef Uint8 *pixels = self.surface.pixels */ __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_lock); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 755, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_2 = NULL; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) { __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_3); if (likely(__pyx_t_2)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); __Pyx_INCREF(__pyx_t_2); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_3, function); } } if (__pyx_t_2) { __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 755, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } else { __pyx_t_4 = __Pyx_PyObject_CallNoArg(__pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 755, __pyx_L1_error) } __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; /* "pygame_sdl2/surface.pyx":757 * self.lock() * * cdef Uint8 *pixels = self.surface.pixels # <<<<<<<<<<<<<< * * with nogil: */ __pyx_v_pixels = ((Uint8 *)__pyx_v_self->surface->pixels); /* "pygame_sdl2/surface.pyx":759 * cdef Uint8 *pixels = self.surface.pixels * * with nogil: # <<<<<<<<<<<<<< * * topleft = ( pixels)[0] */ { #ifdef WITH_THREAD PyThreadState *_save; Py_UNBLOCK_THREADS #endif /*try:*/ { /* "pygame_sdl2/surface.pyx":761 * with nogil: * * topleft = ( pixels)[0] # <<<<<<<<<<<<<< * botright = ( (pixels + self.surface.pitch * (self.surface.h - 1)))[self.surface.w - 1] * */ __pyx_v_topleft = (((Uint32 *)__pyx_v_pixels)[0]); /* "pygame_sdl2/surface.pyx":762 * * topleft = ( pixels)[0] * botright = ( (pixels + self.surface.pitch * (self.surface.h - 1)))[self.surface.w - 1] # <<<<<<<<<<<<<< * * if ((topleft & amask) > amin) and ((botright & amask) > amin): */ __pyx_v_botright = (((Uint32 *)(__pyx_v_pixels + (__pyx_v_self->surface->pitch * (__pyx_v_self->surface->h - 1))))[(__pyx_v_self->surface->w - 1)]); /* "pygame_sdl2/surface.pyx":764 * botright = ( (pixels + self.surface.pitch * (self.surface.h - 1)))[self.surface.w - 1] * * if ((topleft & amask) > amin) and ((botright & amask) > amin): # <<<<<<<<<<<<<< * * # Bounding box covers image. */ __pyx_t_6 = (((__pyx_v_topleft & __pyx_v_amask) > __pyx_v_amin) != 0); if (__pyx_t_6) { } else { __pyx_t_5 = __pyx_t_6; goto __pyx_L11_bool_binop_done; } __pyx_t_6 = (((__pyx_v_botright & __pyx_v_amask) > __pyx_v_amin) != 0); __pyx_t_5 = __pyx_t_6; __pyx_L11_bool_binop_done:; if (__pyx_t_5) { /* "pygame_sdl2/surface.pyx":768 * # Bounding box covers image. * * minx = 0 # <<<<<<<<<<<<<< * miny = 0 * maxx = self.surface.w - 1 */ __pyx_v_minx = 0; /* "pygame_sdl2/surface.pyx":769 * * minx = 0 * miny = 0 # <<<<<<<<<<<<<< * maxx = self.surface.w - 1 * maxy = self.surface.h - 1 */ __pyx_v_miny = 0; /* "pygame_sdl2/surface.pyx":770 * minx = 0 * miny = 0 * maxx = self.surface.w - 1 # <<<<<<<<<<<<<< * maxy = self.surface.h - 1 * */ __pyx_v_maxx = (__pyx_v_self->surface->w - 1); /* "pygame_sdl2/surface.pyx":771 * miny = 0 * maxx = self.surface.w - 1 * maxy = self.surface.h - 1 # <<<<<<<<<<<<<< * * else: */ __pyx_v_maxy = (__pyx_v_self->surface->h - 1); /* "pygame_sdl2/surface.pyx":764 * botright = ( (pixels + self.surface.pitch * (self.surface.h - 1)))[self.surface.w - 1] * * if ((topleft & amask) > amin) and ((botright & amask) > amin): # <<<<<<<<<<<<<< * * # Bounding box covers image. */ goto __pyx_L10; } /* "pygame_sdl2/surface.pyx":777 * # Bounding box is smaller than image. * * for 0 <= y < self.surface.h: # <<<<<<<<<<<<<< * row = (pixels + self.surface.pitch * y) * */ /*else*/ { __pyx_t_9 = __pyx_v_self->surface->h; for (__pyx_v_y = 0; __pyx_v_y < __pyx_t_9; __pyx_v_y++) { /* "pygame_sdl2/surface.pyx":778 * * for 0 <= y < self.surface.h: * row = (pixels + self.surface.pitch * y) # <<<<<<<<<<<<<< * * for 0 <= x < self.surface.w: */ __pyx_v_row = ((Uint32 *)(__pyx_v_pixels + (__pyx_v_self->surface->pitch * __pyx_v_y))); /* "pygame_sdl2/surface.pyx":780 * row = (pixels + self.surface.pitch * y) * * for 0 <= x < self.surface.w: # <<<<<<<<<<<<<< * * if (row[x] & amask) >= amin: */ __pyx_t_10 = __pyx_v_self->surface->w; for (__pyx_v_x = 0; __pyx_v_x < __pyx_t_10; __pyx_v_x++) { /* "pygame_sdl2/surface.pyx":782 * for 0 <= x < self.surface.w: * * if (row[x] & amask) >= amin: # <<<<<<<<<<<<<< * * if minx > x: */ __pyx_t_5 = ((((__pyx_v_row[__pyx_v_x]) & __pyx_v_amask) >= __pyx_v_amin) != 0); if (__pyx_t_5) { /* "pygame_sdl2/surface.pyx":784 * if (row[x] & amask) >= amin: * * if minx > x: # <<<<<<<<<<<<<< * minx = x * if miny > y: */ __pyx_t_5 = ((__pyx_v_minx > __pyx_v_x) != 0); if (__pyx_t_5) { /* "pygame_sdl2/surface.pyx":785 * * if minx > x: * minx = x # <<<<<<<<<<<<<< * if miny > y: * miny = y */ __pyx_v_minx = __pyx_v_x; /* "pygame_sdl2/surface.pyx":784 * if (row[x] & amask) >= amin: * * if minx > x: # <<<<<<<<<<<<<< * minx = x * if miny > y: */ } /* "pygame_sdl2/surface.pyx":786 * if minx > x: * minx = x * if miny > y: # <<<<<<<<<<<<<< * miny = y * if maxx < x: */ __pyx_t_5 = ((__pyx_v_miny > __pyx_v_y) != 0); if (__pyx_t_5) { /* "pygame_sdl2/surface.pyx":787 * minx = x * if miny > y: * miny = y # <<<<<<<<<<<<<< * if maxx < x: * maxx = x */ __pyx_v_miny = __pyx_v_y; /* "pygame_sdl2/surface.pyx":786 * if minx > x: * minx = x * if miny > y: # <<<<<<<<<<<<<< * miny = y * if maxx < x: */ } /* "pygame_sdl2/surface.pyx":788 * if miny > y: * miny = y * if maxx < x: # <<<<<<<<<<<<<< * maxx = x * if maxy < y: */ __pyx_t_5 = ((__pyx_v_maxx < __pyx_v_x) != 0); if (__pyx_t_5) { /* "pygame_sdl2/surface.pyx":789 * miny = y * if maxx < x: * maxx = x # <<<<<<<<<<<<<< * if maxy < y: * maxy = y */ __pyx_v_maxx = __pyx_v_x; /* "pygame_sdl2/surface.pyx":788 * if miny > y: * miny = y * if maxx < x: # <<<<<<<<<<<<<< * maxx = x * if maxy < y: */ } /* "pygame_sdl2/surface.pyx":790 * if maxx < x: * maxx = x * if maxy < y: # <<<<<<<<<<<<<< * maxy = y * */ __pyx_t_5 = ((__pyx_v_maxy < __pyx_v_y) != 0); if (__pyx_t_5) { /* "pygame_sdl2/surface.pyx":791 * maxx = x * if maxy < y: * maxy = y # <<<<<<<<<<<<<< * * self.unlock() */ __pyx_v_maxy = __pyx_v_y; /* "pygame_sdl2/surface.pyx":790 * if maxx < x: * maxx = x * if maxy < y: # <<<<<<<<<<<<<< * maxy = y * */ } /* "pygame_sdl2/surface.pyx":782 * for 0 <= x < self.surface.w: * * if (row[x] & amask) >= amin: # <<<<<<<<<<<<<< * * if minx > x: */ } } } } __pyx_L10:; } /* "pygame_sdl2/surface.pyx":759 * cdef Uint8 *pixels = self.surface.pixels * * with nogil: # <<<<<<<<<<<<<< * * topleft = ( pixels)[0] */ /*finally:*/ { /*normal exit:*/{ #ifdef WITH_THREAD Py_BLOCK_THREADS #endif goto __pyx_L9; } __pyx_L9:; } } /* "pygame_sdl2/surface.pyx":793 * maxy = y * * self.unlock() # <<<<<<<<<<<<<< * * # Totally empty surface. */ __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_unlock); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 793, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_2 = NULL; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) { __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_3); if (likely(__pyx_t_2)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); __Pyx_INCREF(__pyx_t_2); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_3, function); } } if (__pyx_t_2) { __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 793, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } else { __pyx_t_4 = __Pyx_PyObject_CallNoArg(__pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 793, __pyx_L1_error) } __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; /* "pygame_sdl2/surface.pyx":796 * * # Totally empty surface. * if minx > maxx: # <<<<<<<<<<<<<< * return Rect((0, 0, 0, 0)) * */ __pyx_t_5 = ((__pyx_v_minx > __pyx_v_maxx) != 0); if (__pyx_t_5) { /* "pygame_sdl2/surface.pyx":797 * # Totally empty surface. * if minx > maxx: * return Rect((0, 0, 0, 0)) # <<<<<<<<<<<<<< * * x = minx */ __Pyx_XDECREF(__pyx_r); __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_Rect); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 797, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_tuple__19, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 797, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_r = __pyx_t_3; __pyx_t_3 = 0; goto __pyx_L0; /* "pygame_sdl2/surface.pyx":796 * * # Totally empty surface. * if minx > maxx: # <<<<<<<<<<<<<< * return Rect((0, 0, 0, 0)) * */ } /* "pygame_sdl2/surface.pyx":799 * return Rect((0, 0, 0, 0)) * * x = minx # <<<<<<<<<<<<<< * y = miny * w = min(maxx - minx + 1, self.surface.w - x) */ __pyx_v_x = __pyx_v_minx; /* "pygame_sdl2/surface.pyx":800 * * x = minx * y = miny # <<<<<<<<<<<<<< * w = min(maxx - minx + 1, self.surface.w - x) * h = min(maxy - miny + 1, self.surface.h - y) */ __pyx_v_y = __pyx_v_miny; /* "pygame_sdl2/surface.pyx":801 * x = minx * y = miny * w = min(maxx - minx + 1, self.surface.w - x) # <<<<<<<<<<<<<< * h = min(maxy - miny + 1, self.surface.h - y) * */ __pyx_t_9 = (__pyx_v_self->surface->w - __pyx_v_x); __pyx_t_11 = ((__pyx_v_maxx - __pyx_v_minx) + 1); if (((__pyx_t_9 < __pyx_t_11) != 0)) { __pyx_t_12 = __pyx_t_9; } else { __pyx_t_12 = __pyx_t_11; } __pyx_v_w = __pyx_t_12; /* "pygame_sdl2/surface.pyx":802 * y = miny * w = min(maxx - minx + 1, self.surface.w - x) * h = min(maxy - miny + 1, self.surface.h - y) # <<<<<<<<<<<<<< * * return Rect((x, y, w, h)) */ __pyx_t_9 = (__pyx_v_self->surface->h - __pyx_v_y); __pyx_t_12 = ((__pyx_v_maxy - __pyx_v_miny) + 1); if (((__pyx_t_9 < __pyx_t_12) != 0)) { __pyx_t_11 = __pyx_t_9; } else { __pyx_t_11 = __pyx_t_12; } __pyx_v_h = __pyx_t_11; /* "pygame_sdl2/surface.pyx":804 * h = min(maxy - miny + 1, self.surface.h - y) * * return Rect((x, y, w, h)) # <<<<<<<<<<<<<< * * def get_view(self, kind='2'): */ __Pyx_XDECREF(__pyx_r); __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_Rect); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 804, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_v_x); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 804, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_8 = __Pyx_PyInt_From_int(__pyx_v_y); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 804, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __pyx_t_7 = __Pyx_PyInt_From_int(__pyx_v_w); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 804, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __pyx_t_13 = __Pyx_PyInt_From_int(__pyx_v_h); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 804, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_13); __pyx_t_14 = PyTuple_New(4); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 804, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_14); __Pyx_GIVEREF(__pyx_t_2); PyTuple_SET_ITEM(__pyx_t_14, 0, __pyx_t_2); __Pyx_GIVEREF(__pyx_t_8); PyTuple_SET_ITEM(__pyx_t_14, 1, __pyx_t_8); __Pyx_GIVEREF(__pyx_t_7); PyTuple_SET_ITEM(__pyx_t_14, 2, __pyx_t_7); __Pyx_GIVEREF(__pyx_t_13); PyTuple_SET_ITEM(__pyx_t_14, 3, __pyx_t_13); __pyx_t_2 = 0; __pyx_t_8 = 0; __pyx_t_7 = 0; __pyx_t_13 = 0; __pyx_t_13 = NULL; if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_4))) { __pyx_t_13 = PyMethod_GET_SELF(__pyx_t_4); if (likely(__pyx_t_13)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4); __Pyx_INCREF(__pyx_t_13); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_4, function); } } if (!__pyx_t_13) { __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_14); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 804, __pyx_L1_error) __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0; __Pyx_GOTREF(__pyx_t_3); } else { #if CYTHON_FAST_PYCALL if (PyFunction_Check(__pyx_t_4)) { PyObject *__pyx_temp[2] = {__pyx_t_13, __pyx_t_14}; __pyx_t_3 = __Pyx_PyFunction_FastCall(__pyx_t_4, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 804, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0; __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0; } else #endif #if CYTHON_FAST_PYCCALL if (__Pyx_PyFastCFunction_Check(__pyx_t_4)) { PyObject *__pyx_temp[2] = {__pyx_t_13, __pyx_t_14}; __pyx_t_3 = __Pyx_PyCFunction_FastCall(__pyx_t_4, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 804, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0; __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0; } else #endif { __pyx_t_7 = PyTuple_New(1+1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 804, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_GIVEREF(__pyx_t_13); PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_13); __pyx_t_13 = NULL; __Pyx_GIVEREF(__pyx_t_14); PyTuple_SET_ITEM(__pyx_t_7, 0+1, __pyx_t_14); __pyx_t_14 = 0; __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_7, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 804, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; } } __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_r = __pyx_t_3; __pyx_t_3 = 0; goto __pyx_L0; /* "pygame_sdl2/surface.pyx":732 * return (format.Rloss, format.Gloss, format.Bloss, format.Aloss) * * def get_bounding_rect(self, min_alpha=1): # <<<<<<<<<<<<<< * * cdef Uint32 amask = self.surface.format.Amask */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_7); __Pyx_XDECREF(__pyx_t_8); __Pyx_XDECREF(__pyx_t_13); __Pyx_XDECREF(__pyx_t_14); __Pyx_AddTraceback("pygame_sdl2.surface.Surface.get_bounding_rect", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/surface.pyx":806 * return Rect((x, y, w, h)) * * def get_view(self, kind='2'): # <<<<<<<<<<<<<< * raise error("Surface.get_view is not supported.") * */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_7surface_7Surface_95get_view(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static PyObject *__pyx_pw_11pygame_sdl2_7surface_7Surface_95get_view(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { CYTHON_UNUSED PyObject *__pyx_v_kind = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("get_view (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_kind,0}; PyObject* values[1] = {0}; values[0] = ((PyObject *)__pyx_kp_s_2); if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (kw_args > 0) { PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_kind); if (value) { values[0] = value; kw_args--; } } } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "get_view") < 0)) __PYX_ERR(0, 806, __pyx_L3_error) } } else { switch (PyTuple_GET_SIZE(__pyx_args)) { case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); case 0: break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_kind = values[0]; } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("get_view", 0, 0, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 806, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("pygame_sdl2.surface.Surface.get_view", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_11pygame_sdl2_7surface_7Surface_94get_view(((struct __pyx_obj_11pygame_sdl2_7surface_Surface *)__pyx_v_self), __pyx_v_kind); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_7surface_7Surface_94get_view(CYTHON_UNUSED struct __pyx_obj_11pygame_sdl2_7surface_Surface *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v_kind) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; __Pyx_RefNannySetupContext("get_view", 0); /* "pygame_sdl2/surface.pyx":807 * * def get_view(self, kind='2'): * raise error("Surface.get_view is not supported.") # <<<<<<<<<<<<<< * * def get_buffer(self): */ __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_error); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 807, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_tuple__20, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 807, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_Raise(__pyx_t_2, 0, 0, 0); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __PYX_ERR(0, 807, __pyx_L1_error) /* "pygame_sdl2/surface.pyx":806 * return Rect((x, y, w, h)) * * def get_view(self, kind='2'): # <<<<<<<<<<<<<< * raise error("Surface.get_view is not supported.") * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_AddTraceback("pygame_sdl2.surface.Surface.get_view", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/surface.pyx":809 * raise error("Surface.get_view is not supported.") * * def get_buffer(self): # <<<<<<<<<<<<<< * cdef Uint8 *pixels = self.surface.pixels * return pixels[self.surface.h * self.surface.pitch] */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_7surface_7Surface_97get_buffer(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/ static PyObject *__pyx_pw_11pygame_sdl2_7surface_7Surface_97get_buffer(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("get_buffer (wrapper)", 0); __pyx_r = __pyx_pf_11pygame_sdl2_7surface_7Surface_96get_buffer(((struct __pyx_obj_11pygame_sdl2_7surface_Surface *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_7surface_7Surface_96get_buffer(struct __pyx_obj_11pygame_sdl2_7surface_Surface *__pyx_v_self) { Uint8 *__pyx_v_pixels; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; __Pyx_RefNannySetupContext("get_buffer", 0); /* "pygame_sdl2/surface.pyx":810 * * def get_buffer(self): * cdef Uint8 *pixels = self.surface.pixels # <<<<<<<<<<<<<< * return pixels[self.surface.h * self.surface.pitch] * */ __pyx_v_pixels = ((Uint8 *)__pyx_v_self->surface->pixels); /* "pygame_sdl2/surface.pyx":811 * def get_buffer(self): * cdef Uint8 *pixels = self.surface.pixels * return pixels[self.surface.h * self.surface.pitch] # <<<<<<<<<<<<<< * * property _pixels_address: */ __Pyx_XDECREF(__pyx_r); __pyx_t_1 = __Pyx_PyInt_From_uint8_t((__pyx_v_pixels[(__pyx_v_self->surface->h * __pyx_v_self->surface->pitch)])); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 811, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "pygame_sdl2/surface.pyx":809 * raise error("Surface.get_view is not supported.") * * def get_buffer(self): # <<<<<<<<<<<<<< * cdef Uint8 *pixels = self.surface.pixels * return pixels[self.surface.h * self.surface.pitch] */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("pygame_sdl2.surface.Surface.get_buffer", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/surface.pyx":814 * * property _pixels_address: * def __get__(self): # <<<<<<<<<<<<<< * return self.surface.pixels * */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_7surface_7Surface_15_pixels_address_1__get__(PyObject *__pyx_v_self); /*proto*/ static PyObject *__pyx_pw_11pygame_sdl2_7surface_7Surface_15_pixels_address_1__get__(PyObject *__pyx_v_self) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); __pyx_r = __pyx_pf_11pygame_sdl2_7surface_7Surface_15_pixels_address___get__(((struct __pyx_obj_11pygame_sdl2_7surface_Surface *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_7surface_7Surface_15_pixels_address___get__(struct __pyx_obj_11pygame_sdl2_7surface_Surface *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; __Pyx_RefNannySetupContext("__get__", 0); /* "pygame_sdl2/surface.pyx":815 * property _pixels_address: * def __get__(self): * return self.surface.pixels # <<<<<<<<<<<<<< * * */ __Pyx_XDECREF(__pyx_r); __pyx_t_1 = __Pyx_PyInt_From_uint64_t(((Uint64)__pyx_v_self->surface->pixels)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 815, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "pygame_sdl2/surface.pyx":814 * * property _pixels_address: * def __get__(self): # <<<<<<<<<<<<<< * return self.surface.pixels * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("pygame_sdl2.surface.Surface._pixels_address.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/surface.pyx":818 * * * cdef api SDL_Surface *PySurface_AsSurface(surface): # <<<<<<<<<<<<<< * return ( surface).surface * */ static SDL_Surface *__pyx_f_11pygame_sdl2_7surface_PySurface_AsSurface(PyObject *__pyx_v_surface) { SDL_Surface *__pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("PySurface_AsSurface", 0); /* "pygame_sdl2/surface.pyx":819 * * cdef api SDL_Surface *PySurface_AsSurface(surface): * return ( surface).surface # <<<<<<<<<<<<<< * * cdef api object PySurface_New(SDL_Surface *surf): */ __pyx_r = ((struct __pyx_obj_11pygame_sdl2_7surface_Surface *)__pyx_v_surface)->surface; goto __pyx_L0; /* "pygame_sdl2/surface.pyx":818 * * * cdef api SDL_Surface *PySurface_AsSurface(surface): # <<<<<<<<<<<<<< * return ( surface).surface * */ /* function exit code */ __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/surface.pyx":821 * return ( surface).surface * * cdef api object PySurface_New(SDL_Surface *surf): # <<<<<<<<<<<<<< * cdef Surface rv = Surface(()) * rv.take_surface(surf) */ static PyObject *__pyx_f_11pygame_sdl2_7surface_PySurface_New(SDL_Surface *__pyx_v_surf) { struct __pyx_obj_11pygame_sdl2_7surface_Surface *__pyx_v_rv = 0; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; __Pyx_RefNannySetupContext("PySurface_New", 0); /* "pygame_sdl2/surface.pyx":822 * * cdef api object PySurface_New(SDL_Surface *surf): * cdef Surface rv = Surface(()) # <<<<<<<<<<<<<< * rv.take_surface(surf) * return rv */ __pyx_t_1 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_11pygame_sdl2_7surface_Surface), __pyx_tuple__21, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 822, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_rv = ((struct __pyx_obj_11pygame_sdl2_7surface_Surface *)__pyx_t_1); __pyx_t_1 = 0; /* "pygame_sdl2/surface.pyx":823 * cdef api object PySurface_New(SDL_Surface *surf): * cdef Surface rv = Surface(()) * rv.take_surface(surf) # <<<<<<<<<<<<<< * return rv */ ((struct __pyx_vtabstruct_11pygame_sdl2_7surface_Surface *)__pyx_v_rv->__pyx_vtab)->take_surface(__pyx_v_rv, __pyx_v_surf); /* "pygame_sdl2/surface.pyx":824 * cdef Surface rv = Surface(()) * rv.take_surface(surf) * return rv # <<<<<<<<<<<<<< */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(((PyObject *)__pyx_v_rv)); __pyx_r = ((PyObject *)__pyx_v_rv); goto __pyx_L0; /* "pygame_sdl2/surface.pyx":821 * return ( surface).surface * * cdef api object PySurface_New(SDL_Surface *surf): # <<<<<<<<<<<<<< * cdef Surface rv = Surface(()) * rv.take_surface(surf) */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("pygame_sdl2.surface.PySurface_New", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XDECREF((PyObject *)__pyx_v_rv); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } static struct __pyx_vtabstruct_11pygame_sdl2_7surface_Surface __pyx_vtable_11pygame_sdl2_7surface_Surface; static PyObject *__pyx_tp_new_11pygame_sdl2_7surface_Surface(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) { struct __pyx_obj_11pygame_sdl2_7surface_Surface *p; PyObject *o; if (likely((t->tp_flags & Py_TPFLAGS_IS_ABSTRACT) == 0)) { o = (*t->tp_alloc)(t, 0); } else { o = (PyObject *) PyBaseObject_Type.tp_new(t, __pyx_empty_tuple, 0); } if (unlikely(!o)) return 0; p = ((struct __pyx_obj_11pygame_sdl2_7surface_Surface *)o); p->__pyx_vtab = __pyx_vtabptr_11pygame_sdl2_7surface_Surface; p->locklist = Py_None; Py_INCREF(Py_None); p->parent = ((struct __pyx_obj_11pygame_sdl2_7surface_Surface *)Py_None); Py_INCREF(Py_None); p->root = ((struct __pyx_obj_11pygame_sdl2_7surface_Surface *)Py_None); Py_INCREF(Py_None); p->get_window_flags = Py_None; Py_INCREF(Py_None); if (unlikely(__pyx_pw_11pygame_sdl2_7surface_7Surface_1__cinit__(o, __pyx_empty_tuple, NULL) < 0)) goto bad; return o; bad: Py_DECREF(o); o = 0; return NULL; } static void __pyx_tp_dealloc_11pygame_sdl2_7surface_Surface(PyObject *o) { struct __pyx_obj_11pygame_sdl2_7surface_Surface *p = (struct __pyx_obj_11pygame_sdl2_7surface_Surface *)o; #if PY_VERSION_HEX >= 0x030400a1 if (unlikely(Py_TYPE(o)->tp_finalize) && !_PyGC_FINALIZED(o)) { if (PyObject_CallFinalizerFromDealloc(o)) return; } #endif PyObject_GC_UnTrack(o); { PyObject *etype, *eval, *etb; PyErr_Fetch(&etype, &eval, &etb); ++Py_REFCNT(o); __pyx_pw_11pygame_sdl2_7surface_7Surface_3__dealloc__(o); --Py_REFCNT(o); PyErr_Restore(etype, eval, etb); } if (p->__weakref__) PyObject_ClearWeakRefs(o); Py_CLEAR(p->locklist); Py_CLEAR(p->parent); Py_CLEAR(p->root); Py_CLEAR(p->get_window_flags); (*Py_TYPE(o)->tp_free)(o); } static int __pyx_tp_traverse_11pygame_sdl2_7surface_Surface(PyObject *o, visitproc v, void *a) { int e; struct __pyx_obj_11pygame_sdl2_7surface_Surface *p = (struct __pyx_obj_11pygame_sdl2_7surface_Surface *)o; if (p->locklist) { e = (*v)(p->locklist, a); if (e) return e; } if (p->parent) { e = (*v)(((PyObject*)p->parent), a); if (e) return e; } if (p->root) { e = (*v)(((PyObject*)p->root), a); if (e) return e; } if (p->get_window_flags) { e = (*v)(p->get_window_flags, a); if (e) return e; } return 0; } static int __pyx_tp_clear_11pygame_sdl2_7surface_Surface(PyObject *o) { PyObject* tmp; struct __pyx_obj_11pygame_sdl2_7surface_Surface *p = (struct __pyx_obj_11pygame_sdl2_7surface_Surface *)o; tmp = ((PyObject*)p->locklist); p->locklist = Py_None; Py_INCREF(Py_None); Py_XDECREF(tmp); tmp = ((PyObject*)p->parent); p->parent = ((struct __pyx_obj_11pygame_sdl2_7surface_Surface *)Py_None); Py_INCREF(Py_None); Py_XDECREF(tmp); tmp = ((PyObject*)p->root); p->root = ((struct __pyx_obj_11pygame_sdl2_7surface_Surface *)Py_None); Py_INCREF(Py_None); Py_XDECREF(tmp); tmp = ((PyObject*)p->get_window_flags); p->get_window_flags = Py_None; Py_INCREF(Py_None); Py_XDECREF(tmp); return 0; } static PyObject *__pyx_getprop_11pygame_sdl2_7surface_7Surface__pixels_address(PyObject *o, CYTHON_UNUSED void *x) { return __pyx_pw_11pygame_sdl2_7surface_7Surface_15_pixels_address_1__get__(o); } static PyMethodDef __pyx_methods_11pygame_sdl2_7surface_Surface[] = { {"__sizeof__", (PyCFunction)__pyx_pw_11pygame_sdl2_7surface_7Surface_5__sizeof__, METH_NOARGS, 0}, {"blit", (PyCFunction)__pyx_pw_11pygame_sdl2_7surface_7Surface_11blit, METH_VARARGS|METH_KEYWORDS, 0}, {"convert", (PyCFunction)__pyx_pw_11pygame_sdl2_7surface_7Surface_13convert, METH_VARARGS|METH_KEYWORDS, 0}, {"convert_alpha", (PyCFunction)__pyx_pw_11pygame_sdl2_7surface_7Surface_15convert_alpha, METH_VARARGS|METH_KEYWORDS, 0}, {"copy", (PyCFunction)__pyx_pw_11pygame_sdl2_7surface_7Surface_17copy, METH_NOARGS, 0}, {"fill", (PyCFunction)__pyx_pw_11pygame_sdl2_7surface_7Surface_19fill, METH_VARARGS|METH_KEYWORDS, 0}, {"scroll", (PyCFunction)__pyx_pw_11pygame_sdl2_7surface_7Surface_21scroll, METH_VARARGS|METH_KEYWORDS, 0}, {"set_colorkey", (PyCFunction)__pyx_pw_11pygame_sdl2_7surface_7Surface_23set_colorkey, METH_VARARGS|METH_KEYWORDS, 0}, {"get_colorkey", (PyCFunction)__pyx_pw_11pygame_sdl2_7surface_7Surface_25get_colorkey, METH_NOARGS, 0}, {"set_alpha", (PyCFunction)__pyx_pw_11pygame_sdl2_7surface_7Surface_27set_alpha, METH_VARARGS|METH_KEYWORDS, 0}, {"get_alpha", (PyCFunction)__pyx_pw_11pygame_sdl2_7surface_7Surface_29get_alpha, METH_NOARGS, 0}, {"lock", (PyCFunction)__pyx_pw_11pygame_sdl2_7surface_7Surface_31lock, METH_VARARGS|METH_KEYWORDS, 0}, {"unlock", (PyCFunction)__pyx_pw_11pygame_sdl2_7surface_7Surface_33unlock, METH_VARARGS|METH_KEYWORDS, 0}, {"mustlock", (PyCFunction)__pyx_pw_11pygame_sdl2_7surface_7Surface_35mustlock, METH_NOARGS, 0}, {"get_locked", (PyCFunction)__pyx_pw_11pygame_sdl2_7surface_7Surface_37get_locked, METH_NOARGS, 0}, {"get_locks", (PyCFunction)__pyx_pw_11pygame_sdl2_7surface_7Surface_39get_locks, METH_NOARGS, 0}, {"get_at", (PyCFunction)__pyx_pw_11pygame_sdl2_7surface_7Surface_41get_at, METH_O, 0}, {"set_at", (PyCFunction)__pyx_pw_11pygame_sdl2_7surface_7Surface_43set_at, METH_VARARGS|METH_KEYWORDS, 0}, {"get_at_mapped", (PyCFunction)__pyx_pw_11pygame_sdl2_7surface_7Surface_45get_at_mapped, METH_O, 0}, {"map_rgb", (PyCFunction)__pyx_pw_11pygame_sdl2_7surface_7Surface_47map_rgb, METH_O, 0}, {"unmap_rgb", (PyCFunction)__pyx_pw_11pygame_sdl2_7surface_7Surface_49unmap_rgb, METH_O, 0}, {"set_clip", (PyCFunction)__pyx_pw_11pygame_sdl2_7surface_7Surface_51set_clip, METH_O, 0}, {"get_clip", (PyCFunction)__pyx_pw_11pygame_sdl2_7surface_7Surface_53get_clip, METH_NOARGS, 0}, {"subsurface", (PyCFunction)__pyx_pw_11pygame_sdl2_7surface_7Surface_55subsurface, METH_VARARGS|METH_KEYWORDS, 0}, {"get_parent", (PyCFunction)__pyx_pw_11pygame_sdl2_7surface_7Surface_57get_parent, METH_NOARGS, 0}, {"get_abs_parent", (PyCFunction)__pyx_pw_11pygame_sdl2_7surface_7Surface_59get_abs_parent, METH_NOARGS, 0}, {"get_offset", (PyCFunction)__pyx_pw_11pygame_sdl2_7surface_7Surface_61get_offset, METH_NOARGS, 0}, {"get_abs_offset", (PyCFunction)__pyx_pw_11pygame_sdl2_7surface_7Surface_63get_abs_offset, METH_NOARGS, 0}, {"get_size", (PyCFunction)__pyx_pw_11pygame_sdl2_7surface_7Surface_65get_size, METH_NOARGS, 0}, {"get_width", (PyCFunction)__pyx_pw_11pygame_sdl2_7surface_7Surface_67get_width, METH_NOARGS, 0}, {"get_height", (PyCFunction)__pyx_pw_11pygame_sdl2_7surface_7Surface_69get_height, METH_NOARGS, 0}, {"get_rect", (PyCFunction)__pyx_pw_11pygame_sdl2_7surface_7Surface_71get_rect, METH_VARARGS|METH_KEYWORDS, 0}, {"get_bitsize", (PyCFunction)__pyx_pw_11pygame_sdl2_7surface_7Surface_73get_bitsize, METH_NOARGS, 0}, {"get_bytesize", (PyCFunction)__pyx_pw_11pygame_sdl2_7surface_7Surface_75get_bytesize, METH_NOARGS, 0}, {"get_flags", (PyCFunction)__pyx_pw_11pygame_sdl2_7surface_7Surface_77get_flags, METH_NOARGS, 0}, {"get_pitch", (PyCFunction)__pyx_pw_11pygame_sdl2_7surface_7Surface_79get_pitch, METH_NOARGS, 0}, {"get_masks", (PyCFunction)__pyx_pw_11pygame_sdl2_7surface_7Surface_81get_masks, METH_NOARGS, 0}, {"set_masks", (PyCFunction)__pyx_pw_11pygame_sdl2_7surface_7Surface_83set_masks, METH_O, 0}, {"get_shifts", (PyCFunction)__pyx_pw_11pygame_sdl2_7surface_7Surface_85get_shifts, METH_NOARGS, 0}, {"set_shifts", (PyCFunction)__pyx_pw_11pygame_sdl2_7surface_7Surface_87set_shifts, METH_O, 0}, {"get_shifts", (PyCFunction)__pyx_pw_11pygame_sdl2_7surface_7Surface_89get_shifts, METH_NOARGS, 0}, {"get_losses", (PyCFunction)__pyx_pw_11pygame_sdl2_7surface_7Surface_91get_losses, METH_NOARGS, 0}, {"get_bounding_rect", (PyCFunction)__pyx_pw_11pygame_sdl2_7surface_7Surface_93get_bounding_rect, METH_VARARGS|METH_KEYWORDS, 0}, {"get_view", (PyCFunction)__pyx_pw_11pygame_sdl2_7surface_7Surface_95get_view, METH_VARARGS|METH_KEYWORDS, 0}, {"get_buffer", (PyCFunction)__pyx_pw_11pygame_sdl2_7surface_7Surface_97get_buffer, METH_NOARGS, 0}, {0, 0, 0, 0} }; static struct PyGetSetDef __pyx_getsets_11pygame_sdl2_7surface_Surface[] = { {(char *)"_pixels_address", __pyx_getprop_11pygame_sdl2_7surface_7Surface__pixels_address, 0, (char *)0, 0}, {0, 0, 0, 0, 0} }; static PyTypeObject __pyx_type_11pygame_sdl2_7surface_Surface = { PyVarObject_HEAD_INIT(0, 0) "pygame_sdl2.surface.Surface", /*tp_name*/ sizeof(struct __pyx_obj_11pygame_sdl2_7surface_Surface), /*tp_basicsize*/ 0, /*tp_itemsize*/ __pyx_tp_dealloc_11pygame_sdl2_7surface_Surface, /*tp_dealloc*/ 0, /*tp_print*/ 0, /*tp_getattr*/ 0, /*tp_setattr*/ #if PY_MAJOR_VERSION < 3 0, /*tp_compare*/ #endif #if PY_MAJOR_VERSION >= 3 0, /*tp_as_async*/ #endif __pyx_pw_11pygame_sdl2_7surface_7Surface_9__repr__, /*tp_repr*/ 0, /*tp_as_number*/ 0, /*tp_as_sequence*/ 0, /*tp_as_mapping*/ 0, /*tp_hash*/ 0, /*tp_call*/ 0, /*tp_str*/ 0, /*tp_getattro*/ 0, /*tp_setattro*/ 0, /*tp_as_buffer*/ Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/ 0, /*tp_doc*/ __pyx_tp_traverse_11pygame_sdl2_7surface_Surface, /*tp_traverse*/ __pyx_tp_clear_11pygame_sdl2_7surface_Surface, /*tp_clear*/ 0, /*tp_richcompare*/ 0, /*tp_weaklistoffset*/ 0, /*tp_iter*/ 0, /*tp_iternext*/ __pyx_methods_11pygame_sdl2_7surface_Surface, /*tp_methods*/ 0, /*tp_members*/ __pyx_getsets_11pygame_sdl2_7surface_Surface, /*tp_getset*/ 0, /*tp_base*/ 0, /*tp_dict*/ 0, /*tp_descr_get*/ 0, /*tp_descr_set*/ 0, /*tp_dictoffset*/ __pyx_pw_11pygame_sdl2_7surface_7Surface_7__init__, /*tp_init*/ 0, /*tp_alloc*/ __pyx_tp_new_11pygame_sdl2_7surface_Surface, /*tp_new*/ 0, /*tp_free*/ 0, /*tp_is_gc*/ 0, /*tp_bases*/ 0, /*tp_mro*/ 0, /*tp_cache*/ 0, /*tp_subclasses*/ 0, /*tp_weaklist*/ 0, /*tp_del*/ 0, /*tp_version_tag*/ #if PY_VERSION_HEX >= 0x030400a1 0, /*tp_finalize*/ #endif }; static PyMethodDef __pyx_methods[] = { {0, 0, 0, 0} }; #if PY_MAJOR_VERSION >= 3 static struct PyModuleDef __pyx_moduledef = { #if PY_VERSION_HEX < 0x03020000 { PyObject_HEAD_INIT(NULL) NULL, 0, NULL }, #else PyModuleDef_HEAD_INIT, #endif "surface", 0, /* m_doc */ -1, /* m_size */ __pyx_methods /* m_methods */, NULL, /* m_reload */ NULL, /* m_traverse */ NULL, /* m_clear */ NULL /* m_free */ }; #endif static __Pyx_StringTabEntry __pyx_string_tab[] = { {&__pyx_kp_s_2, __pyx_k_2, sizeof(__pyx_k_2), 0, 0, 1, 0}, {&__pyx_n_s_IndexError, __pyx_k_IndexError, sizeof(__pyx_k_IndexError), 0, 0, 1, 1}, {&__pyx_kp_s_Memory_leak_via_Surface_in_pygam, __pyx_k_Memory_leak_via_Surface_in_pygam, sizeof(__pyx_k_Memory_leak_via_Surface_in_pygam), 0, 0, 1, 0}, {&__pyx_kp_s_No_video_mode_has_been_set, __pyx_k_No_video_mode_has_been_set, sizeof(__pyx_k_No_video_mode_has_been_set), 0, 0, 1, 0}, {&__pyx_kp_s_Position_outside_surface, __pyx_k_Position_outside_surface, sizeof(__pyx_k_Position_outside_surface), 0, 0, 1, 0}, {&__pyx_n_s_Rect, __pyx_k_Rect, sizeof(__pyx_k_Rect), 0, 0, 1, 1}, {&__pyx_n_s_SRCALPHA, __pyx_k_SRCALPHA, sizeof(__pyx_k_SRCALPHA), 0, 0, 1, 1}, {&__pyx_kp_s_Surface_get_view_is_not_supporte, __pyx_k_Surface_get_view_is_not_supporte, sizeof(__pyx_k_Surface_get_view_is_not_supporte), 0, 0, 1, 0}, {&__pyx_kp_s_Surface_has_unsupported_bytesize, __pyx_k_Surface_has_unsupported_bytesize, sizeof(__pyx_k_Surface_has_unsupported_bytesize), 0, 0, 1, 0}, {&__pyx_kp_s_Surface_set_masks_is_not_support, __pyx_k_Surface_set_masks_is_not_support, sizeof(__pyx_k_Surface_set_masks_is_not_support), 0, 0, 1, 0}, {&__pyx_kp_s_Surface_set_shifts_is_not_suppor, __pyx_k_Surface_set_shifts_is_not_suppor, sizeof(__pyx_k_Surface_set_shifts_is_not_suppor), 0, 0, 1, 0}, {&__pyx_kp_s_Surface_x_x, __pyx_k_Surface_x_x, sizeof(__pyx_k_Surface_x_x), 0, 0, 1, 0}, {&__pyx_n_s_ValueError, __pyx_k_ValueError, sizeof(__pyx_k_ValueError), 0, 0, 1, 1}, {&__pyx_n_s_append, __pyx_k_append, sizeof(__pyx_k_append), 0, 0, 1, 1}, {&__pyx_n_s_area, __pyx_k_area, sizeof(__pyx_k_area), 0, 0, 1, 1}, {&__pyx_n_s_clip, __pyx_k_clip, sizeof(__pyx_k_clip), 0, 0, 1, 1}, {&__pyx_n_s_color, __pyx_k_color, sizeof(__pyx_k_color), 0, 0, 1, 1}, {&__pyx_n_s_convert, __pyx_k_convert, sizeof(__pyx_k_convert), 0, 0, 1, 1}, {&__pyx_n_s_convert_alpha, __pyx_k_convert_alpha, sizeof(__pyx_k_convert_alpha), 0, 0, 1, 1}, {&__pyx_n_s_depth, __pyx_k_depth, sizeof(__pyx_k_depth), 0, 0, 1, 1}, {&__pyx_n_s_dest, __pyx_k_dest, sizeof(__pyx_k_dest), 0, 0, 1, 1}, {&__pyx_n_s_display, __pyx_k_display, sizeof(__pyx_k_display), 0, 0, 1, 1}, {&__pyx_n_s_dx, __pyx_k_dx, sizeof(__pyx_k_dx), 0, 0, 1, 1}, {&__pyx_n_s_dy, __pyx_k_dy, sizeof(__pyx_k_dy), 0, 0, 1, 1}, {&__pyx_n_s_error, __pyx_k_error, sizeof(__pyx_k_error), 0, 0, 1, 1}, {&__pyx_n_s_flags, __pyx_k_flags, sizeof(__pyx_k_flags), 0, 0, 1, 1}, {&__pyx_n_s_format, __pyx_k_format, sizeof(__pyx_k_format), 0, 0, 1, 1}, {&__pyx_n_s_get_alpha, __pyx_k_get_alpha, sizeof(__pyx_k_get_alpha), 0, 0, 1, 1}, {&__pyx_n_s_get_rect, __pyx_k_get_rect, sizeof(__pyx_k_get_rect), 0, 0, 1, 1}, {&__pyx_n_s_get_size, __pyx_k_get_size, sizeof(__pyx_k_get_size), 0, 0, 1, 1}, {&__pyx_n_s_get_surface, __pyx_k_get_surface, sizeof(__pyx_k_get_surface), 0, 0, 1, 1}, {&__pyx_n_s_import, __pyx_k_import, sizeof(__pyx_k_import), 0, 0, 1, 1}, {&__pyx_n_s_items, __pyx_k_items, sizeof(__pyx_k_items), 0, 0, 1, 1}, {&__pyx_n_s_kind, __pyx_k_kind, sizeof(__pyx_k_kind), 0, 0, 1, 1}, {&__pyx_n_s_lock, __pyx_k_lock, sizeof(__pyx_k_lock), 0, 0, 1, 1}, {&__pyx_n_s_main, __pyx_k_main, sizeof(__pyx_k_main), 0, 0, 1, 1}, {&__pyx_n_s_masks, __pyx_k_masks, sizeof(__pyx_k_masks), 0, 0, 1, 1}, {&__pyx_n_s_min_alpha, __pyx_k_min_alpha, sizeof(__pyx_k_min_alpha), 0, 0, 1, 1}, {&__pyx_n_s_pos, __pyx_k_pos, sizeof(__pyx_k_pos), 0, 0, 1, 1}, {&__pyx_n_s_pygame_sdl2, __pyx_k_pygame_sdl2, sizeof(__pyx_k_pygame_sdl2), 0, 0, 1, 1}, {&__pyx_n_s_pygame_sdl2_error, __pyx_k_pygame_sdl2_error, sizeof(__pyx_k_pygame_sdl2_error), 0, 0, 1, 1}, {&__pyx_n_s_pygame_sdl2_locals, __pyx_k_pygame_sdl2_locals, sizeof(__pyx_k_pygame_sdl2_locals), 0, 0, 1, 1}, {&__pyx_n_s_pygame_sdl2_rect, __pyx_k_pygame_sdl2_rect, sizeof(__pyx_k_pygame_sdl2_rect), 0, 0, 1, 1}, {&__pyx_n_s_pyx_vtable, __pyx_k_pyx_vtable, sizeof(__pyx_k_pyx_vtable), 0, 0, 1, 1}, {&__pyx_n_s_rect, __pyx_k_rect, sizeof(__pyx_k_rect), 0, 0, 1, 1}, {&__pyx_n_s_remove, __pyx_k_remove, sizeof(__pyx_k_remove), 0, 0, 1, 1}, {&__pyx_n_s_set_alpha, __pyx_k_set_alpha, sizeof(__pyx_k_set_alpha), 0, 0, 1, 1}, {&__pyx_n_s_size, __pyx_k_size, sizeof(__pyx_k_size), 0, 0, 1, 1}, {&__pyx_n_s_source, __pyx_k_source, sizeof(__pyx_k_source), 0, 0, 1, 1}, {&__pyx_n_s_special_flags, __pyx_k_special_flags, sizeof(__pyx_k_special_flags), 0, 0, 1, 1}, {&__pyx_n_s_subsurface, __pyx_k_subsurface, sizeof(__pyx_k_subsurface), 0, 0, 1, 1}, {&__pyx_kp_s_subsurface_rectangle_outside_sur, __pyx_k_subsurface_rectangle_outside_sur, sizeof(__pyx_k_subsurface_rectangle_outside_sur), 0, 0, 1, 0}, {&__pyx_kp_s_subsurface_size_must_be_non_nega, __pyx_k_subsurface_size_must_be_non_nega, sizeof(__pyx_k_subsurface_size_must_be_non_nega), 0, 0, 1, 0}, {&__pyx_n_s_surface, __pyx_k_surface, sizeof(__pyx_k_surface), 0, 0, 1, 1}, {&__pyx_n_s_test, __pyx_k_test, sizeof(__pyx_k_test), 0, 0, 1, 1}, {&__pyx_n_s_total_size, __pyx_k_total_size, sizeof(__pyx_k_total_size), 0, 0, 1, 1}, {&__pyx_n_s_unlock, __pyx_k_unlock, sizeof(__pyx_k_unlock), 0, 0, 1, 1}, {&__pyx_n_s_value, __pyx_k_value, sizeof(__pyx_k_value), 0, 0, 1, 1}, {&__pyx_n_s_warn, __pyx_k_warn, sizeof(__pyx_k_warn), 0, 0, 1, 1}, {&__pyx_n_s_warnings, __pyx_k_warnings, sizeof(__pyx_k_warnings), 0, 0, 1, 1}, {0, 0, 0, 0, 0, 0, 0} }; static int __Pyx_InitCachedBuiltins(void) { __pyx_builtin_IndexError = __Pyx_GetBuiltinName(__pyx_n_s_IndexError); if (!__pyx_builtin_IndexError) __PYX_ERR(0, 512, __pyx_L1_error) __pyx_builtin_ValueError = __Pyx_GetBuiltinName(__pyx_n_s_ValueError); if (!__pyx_builtin_ValueError) __PYX_ERR(0, 537, __pyx_L1_error) return 0; __pyx_L1_error:; return -1; } static int __Pyx_InitCachedConstants(void) { __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__Pyx_InitCachedConstants", 0); /* "pygame_sdl2/surface.pyx":76 * return * * warnings.warn("Memory leak via Surface in pygame_sdl2.") # <<<<<<<<<<<<<< * * def __sizeof__(self): */ __pyx_tuple_ = PyTuple_Pack(1, __pyx_kp_s_Memory_leak_via_Surface_in_pygam); if (unlikely(!__pyx_tuple_)) __PYX_ERR(0, 76, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple_); __Pyx_GIVEREF(__pyx_tuple_); /* "pygame_sdl2/surface.pyx":241 * * if surface is None: * raise error("No video mode has been set.") # <<<<<<<<<<<<<< * * cdef SDL_PixelFormat *sample_format = ( surface).surface.format */ __pyx_tuple__2 = PyTuple_Pack(1, __pyx_kp_s_No_video_mode_has_been_set); if (unlikely(!__pyx_tuple__2)) __PYX_ERR(0, 241, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__2); __Pyx_GIVEREF(__pyx_tuple__2); /* "pygame_sdl2/surface.pyx":272 * new_surface = SDL_ConvertSurfaceFormat(self.surface, pixel_format, 0) * * cdef Surface rv = Surface(()) # <<<<<<<<<<<<<< * rv.take_surface(new_surface) * */ __pyx_tuple__3 = PyTuple_Pack(1, __pyx_empty_tuple); if (unlikely(!__pyx_tuple__3)) __PYX_ERR(0, 272, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__3); __Pyx_GIVEREF(__pyx_tuple__3); /* "pygame_sdl2/surface.pyx":282 * * if surface is None: * raise error("No video mode has been set.") # <<<<<<<<<<<<<< * * cdef SDL_PixelFormat *sample_format = surface.surface.format */ __pyx_tuple__4 = PyTuple_Pack(1, __pyx_kp_s_No_video_mode_has_been_set); if (unlikely(!__pyx_tuple__4)) __PYX_ERR(0, 282, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__4); __Pyx_GIVEREF(__pyx_tuple__4); /* "pygame_sdl2/surface.pyx":314 * new_surface = SDL_ConvertSurfaceFormat(self.surface, pixel_format, 0) * * cdef Surface rv = Surface(()) # <<<<<<<<<<<<<< * rv.take_surface(new_surface) * */ __pyx_tuple__5 = PyTuple_Pack(1, __pyx_empty_tuple); if (unlikely(!__pyx_tuple__5)) __PYX_ERR(0, 314, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__5); __Pyx_GIVEREF(__pyx_tuple__5); /* "pygame_sdl2/surface.pyx":343 * * if sdl_rect.w <= 0 or sdl_rect.h <= 0: * return Rect(0, 0, 0, 0) # <<<<<<<<<<<<<< * * with nogil: */ __pyx_tuple__6 = PyTuple_Pack(4, __pyx_int_0, __pyx_int_0, __pyx_int_0, __pyx_int_0); if (unlikely(!__pyx_tuple__6)) __PYX_ERR(0, 343, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__6); __Pyx_GIVEREF(__pyx_tuple__6); /* "pygame_sdl2/surface.pyx":512 * * if not (0 <= x < self.surface.w) or not (0 <= y < self.surface.h): * raise IndexError("Position outside surface.") # <<<<<<<<<<<<<< * * if self.surface.format.BytesPerPixel != 4: */ __pyx_tuple__7 = PyTuple_Pack(1, __pyx_kp_s_Position_outside_surface); if (unlikely(!__pyx_tuple__7)) __PYX_ERR(0, 512, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__7); __Pyx_GIVEREF(__pyx_tuple__7); /* "pygame_sdl2/surface.pyx":515 * * if self.surface.format.BytesPerPixel != 4: * raise error("Surface has unsupported bytesize.") # <<<<<<<<<<<<<< * * self.lock() */ __pyx_tuple__8 = PyTuple_Pack(1, __pyx_kp_s_Surface_has_unsupported_bytesize); if (unlikely(!__pyx_tuple__8)) __PYX_ERR(0, 515, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__8); __Pyx_GIVEREF(__pyx_tuple__8); /* "pygame_sdl2/surface.pyx":537 * * if not (0 <= x < self.surface.w) or not (0 <= y < self.surface.h): * raise ValueError("Position outside surface.") # <<<<<<<<<<<<<< * * if self.surface.format.BytesPerPixel != 4: */ __pyx_tuple__9 = PyTuple_Pack(1, __pyx_kp_s_Position_outside_surface); if (unlikely(!__pyx_tuple__9)) __PYX_ERR(0, 537, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__9); __Pyx_GIVEREF(__pyx_tuple__9); /* "pygame_sdl2/surface.pyx":540 * * if self.surface.format.BytesPerPixel != 4: * raise error("Surface has unsupported bytesize.") # <<<<<<<<<<<<<< * * pixel = map_color(self.surface, color) */ __pyx_tuple__10 = PyTuple_Pack(1, __pyx_kp_s_Surface_has_unsupported_bytesize); if (unlikely(!__pyx_tuple__10)) __PYX_ERR(0, 540, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__10); __Pyx_GIVEREF(__pyx_tuple__10); /* "pygame_sdl2/surface.pyx":561 * * if not (0 <= x < self.surface.w) or not (0 <= y < self.surface.h): * raise ValueError("Position outside surface.") # <<<<<<<<<<<<<< * * if self.surface.format.BytesPerPixel != 4: */ __pyx_tuple__11 = PyTuple_Pack(1, __pyx_kp_s_Position_outside_surface); if (unlikely(!__pyx_tuple__11)) __PYX_ERR(0, 561, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__11); __Pyx_GIVEREF(__pyx_tuple__11); /* "pygame_sdl2/surface.pyx":564 * * if self.surface.format.BytesPerPixel != 4: * raise error("Surface has unsupported bytesize.") # <<<<<<<<<<<<<< * * self.lock() */ __pyx_tuple__12 = PyTuple_Pack(1, __pyx_kp_s_Surface_has_unsupported_bytesize); if (unlikely(!__pyx_tuple__12)) __PYX_ERR(0, 564, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__12); __Pyx_GIVEREF(__pyx_tuple__12); /* "pygame_sdl2/surface.pyx":609 * * if sdl_rect.w < 0 or sdl_rect.h < 0: * raise error("subsurface size must be non-negative.") # <<<<<<<<<<<<<< * * if ((sdl_rect.x < 0) */ __pyx_tuple__13 = PyTuple_Pack(1, __pyx_kp_s_subsurface_size_must_be_non_nega); if (unlikely(!__pyx_tuple__13)) __PYX_ERR(0, 609, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__13); __Pyx_GIVEREF(__pyx_tuple__13); /* "pygame_sdl2/surface.pyx":616 * or (sdl_rect.y + sdl_rect.h > self.surface.h)): * * raise error("subsurface rectangle outside surface area.") # <<<<<<<<<<<<<< * * cdef Uint8 *pixels = self.surface.pixels */ __pyx_tuple__14 = PyTuple_Pack(1, __pyx_kp_s_subsurface_rectangle_outside_sur); if (unlikely(!__pyx_tuple__14)) __PYX_ERR(0, 616, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__14); __Pyx_GIVEREF(__pyx_tuple__14); /* "pygame_sdl2/surface.pyx":633 * self.surface.format.Amask) * * cdef Surface rv = Surface(()) # <<<<<<<<<<<<<< * * rv.surface = new_surface */ __pyx_tuple__15 = PyTuple_Pack(1, __pyx_empty_tuple); if (unlikely(!__pyx_tuple__15)) __PYX_ERR(0, 633, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__15); __Pyx_GIVEREF(__pyx_tuple__15); /* "pygame_sdl2/surface.pyx":715 * * def set_masks(self, masks): * warnings.warn("Surface.set_masks is not supported.") # <<<<<<<<<<<<<< * * def get_shifts(self): */ __pyx_tuple__16 = PyTuple_Pack(1, __pyx_kp_s_Surface_set_masks_is_not_support); if (unlikely(!__pyx_tuple__16)) __PYX_ERR(0, 715, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__16); __Pyx_GIVEREF(__pyx_tuple__16); /* "pygame_sdl2/surface.pyx":722 * * def set_shifts(self, shifts): * warnings.warn("Surface.set_shifts is not supported.") # <<<<<<<<<<<<<< * * def get_shifts(self): */ __pyx_tuple__17 = PyTuple_Pack(1, __pyx_kp_s_Surface_set_shifts_is_not_suppor); if (unlikely(!__pyx_tuple__17)) __PYX_ERR(0, 722, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__17); __Pyx_GIVEREF(__pyx_tuple__17); /* "pygame_sdl2/surface.pyx":797 * # Totally empty surface. * if minx > maxx: * return Rect((0, 0, 0, 0)) # <<<<<<<<<<<<<< * * x = minx */ __pyx_tuple__18 = PyTuple_Pack(4, __pyx_int_0, __pyx_int_0, __pyx_int_0, __pyx_int_0); if (unlikely(!__pyx_tuple__18)) __PYX_ERR(0, 797, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__18); __Pyx_GIVEREF(__pyx_tuple__18); __pyx_tuple__19 = PyTuple_Pack(1, __pyx_tuple__18); if (unlikely(!__pyx_tuple__19)) __PYX_ERR(0, 797, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__19); __Pyx_GIVEREF(__pyx_tuple__19); /* "pygame_sdl2/surface.pyx":807 * * def get_view(self, kind='2'): * raise error("Surface.get_view is not supported.") # <<<<<<<<<<<<<< * * def get_buffer(self): */ __pyx_tuple__20 = PyTuple_Pack(1, __pyx_kp_s_Surface_get_view_is_not_supporte); if (unlikely(!__pyx_tuple__20)) __PYX_ERR(0, 807, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__20); __Pyx_GIVEREF(__pyx_tuple__20); /* "pygame_sdl2/surface.pyx":822 * * cdef api object PySurface_New(SDL_Surface *surf): * cdef Surface rv = Surface(()) # <<<<<<<<<<<<<< * rv.take_surface(surf) * return rv */ __pyx_tuple__21 = PyTuple_Pack(1, __pyx_empty_tuple); if (unlikely(!__pyx_tuple__21)) __PYX_ERR(0, 822, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__21); __Pyx_GIVEREF(__pyx_tuple__21); __Pyx_RefNannyFinishContext(); return 0; __pyx_L1_error:; __Pyx_RefNannyFinishContext(); return -1; } static int __Pyx_InitGlobals(void) { __pyx_umethod_PyDict_Type_items.type = (PyObject*)&PyDict_Type; if (__Pyx_InitStrings(__pyx_string_tab) < 0) __PYX_ERR(0, 1, __pyx_L1_error); __pyx_int_0 = PyInt_FromLong(0); if (unlikely(!__pyx_int_0)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_int_1 = PyInt_FromLong(1); if (unlikely(!__pyx_int_1)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_int_32 = PyInt_FromLong(32); if (unlikely(!__pyx_int_32)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_int_255 = PyInt_FromLong(255); if (unlikely(!__pyx_int_255)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_int_16843009 = PyInt_FromLong(16843009L); if (unlikely(!__pyx_int_16843009)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_int_4294967295 = PyInt_FromString((char *)"4294967295", 0, 0); if (unlikely(!__pyx_int_4294967295)) __PYX_ERR(0, 1, __pyx_L1_error) return 0; __pyx_L1_error:; return -1; } #if PY_MAJOR_VERSION < 3 PyMODINIT_FUNC initsurface(void); /*proto*/ PyMODINIT_FUNC initsurface(void) #else PyMODINIT_FUNC PyInit_surface(void); /*proto*/ PyMODINIT_FUNC PyInit_surface(void) #endif { PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; __Pyx_RefNannyDeclarations #if CYTHON_REFNANNY __Pyx_RefNanny = __Pyx_RefNannyImportAPI("refnanny"); if (!__Pyx_RefNanny) { PyErr_Clear(); __Pyx_RefNanny = __Pyx_RefNannyImportAPI("Cython.Runtime.refnanny"); if (!__Pyx_RefNanny) Py_FatalError("failed to import 'refnanny' module"); } #endif __Pyx_RefNannySetupContext("PyMODINIT_FUNC PyInit_surface(void)", 0); if (__Pyx_check_binary_version() < 0) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_empty_tuple = PyTuple_New(0); if (unlikely(!__pyx_empty_tuple)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_empty_bytes = PyBytes_FromStringAndSize("", 0); if (unlikely(!__pyx_empty_bytes)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_empty_unicode = PyUnicode_FromStringAndSize("", 0); if (unlikely(!__pyx_empty_unicode)) __PYX_ERR(0, 1, __pyx_L1_error) #ifdef __Pyx_CyFunction_USED if (__pyx_CyFunction_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error) #endif #ifdef __Pyx_FusedFunction_USED if (__pyx_FusedFunction_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error) #endif #ifdef __Pyx_Coroutine_USED if (__pyx_Coroutine_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error) #endif #ifdef __Pyx_Generator_USED if (__pyx_Generator_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error) #endif #ifdef __Pyx_StopAsyncIteration_USED if (__pyx_StopAsyncIteration_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error) #endif /*--- Library function declarations ---*/ /*--- Threads initialization code ---*/ #if defined(__PYX_FORCE_INIT_THREADS) && __PYX_FORCE_INIT_THREADS #ifdef WITH_THREAD /* Python build with threading support? */ PyEval_InitThreads(); #endif #endif /*--- Module creation code ---*/ #if PY_MAJOR_VERSION < 3 __pyx_m = Py_InitModule4("surface", __pyx_methods, 0, 0, PYTHON_API_VERSION); Py_XINCREF(__pyx_m); #else __pyx_m = PyModule_Create(&__pyx_moduledef); #endif if (unlikely(!__pyx_m)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_d = PyModule_GetDict(__pyx_m); if (unlikely(!__pyx_d)) __PYX_ERR(0, 1, __pyx_L1_error) Py_INCREF(__pyx_d); __pyx_b = PyImport_AddModule(__Pyx_BUILTIN_MODULE_NAME); if (unlikely(!__pyx_b)) __PYX_ERR(0, 1, __pyx_L1_error) #if CYTHON_COMPILING_IN_PYPY Py_INCREF(__pyx_b); #endif if (PyObject_SetAttrString(__pyx_m, "__builtins__", __pyx_b) < 0) __PYX_ERR(0, 1, __pyx_L1_error); /*--- Initialize various global constants etc. ---*/ if (__Pyx_InitGlobals() < 0) __PYX_ERR(0, 1, __pyx_L1_error) #if PY_MAJOR_VERSION < 3 && (__PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT) if (__Pyx_init_sys_getdefaultencoding_params() < 0) __PYX_ERR(0, 1, __pyx_L1_error) #endif if (__pyx_module_is_main_pygame_sdl2__surface) { if (PyObject_SetAttrString(__pyx_m, "__name__", __pyx_n_s_main) < 0) __PYX_ERR(0, 1, __pyx_L1_error) } #if PY_MAJOR_VERSION >= 3 { PyObject *modules = PyImport_GetModuleDict(); if (unlikely(!modules)) __PYX_ERR(0, 1, __pyx_L1_error) if (!PyDict_GetItemString(modules, "pygame_sdl2.surface")) { if (unlikely(PyDict_SetItemString(modules, "pygame_sdl2.surface", __pyx_m) < 0)) __PYX_ERR(0, 1, __pyx_L1_error) } } #endif /*--- Builtin init code ---*/ if (__Pyx_InitCachedBuiltins() < 0) __PYX_ERR(0, 1, __pyx_L1_error) /*--- Constants init code ---*/ if (__Pyx_InitCachedConstants() < 0) __PYX_ERR(0, 1, __pyx_L1_error) /*--- Global init code ---*/ /*--- Variable export code ---*/ /*--- Function export code ---*/ if (__Pyx_ExportFunction("PySurface_AsSurface", (void (*)(void))__pyx_f_11pygame_sdl2_7surface_PySurface_AsSurface, "SDL_Surface *(PyObject *)") < 0) __PYX_ERR(0, 1, __pyx_L1_error) if (__Pyx_ExportFunction("PySurface_New", (void (*)(void))__pyx_f_11pygame_sdl2_7surface_PySurface_New, "PyObject *(SDL_Surface *)") < 0) __PYX_ERR(0, 1, __pyx_L1_error) /*--- Type init code ---*/ __pyx_vtabptr_11pygame_sdl2_7surface_Surface = &__pyx_vtable_11pygame_sdl2_7surface_Surface; __pyx_vtable_11pygame_sdl2_7surface_Surface.take_surface = (void (*)(struct __pyx_obj_11pygame_sdl2_7surface_Surface *, SDL_Surface *))__pyx_f_11pygame_sdl2_7surface_7Surface_take_surface; if (PyType_Ready(&__pyx_type_11pygame_sdl2_7surface_Surface) < 0) __PYX_ERR(0, 53, __pyx_L1_error) __pyx_type_11pygame_sdl2_7surface_Surface.tp_print = 0; if (__Pyx_SetVtable(__pyx_type_11pygame_sdl2_7surface_Surface.tp_dict, __pyx_vtabptr_11pygame_sdl2_7surface_Surface) < 0) __PYX_ERR(0, 53, __pyx_L1_error) if (PyObject_SetAttrString(__pyx_m, "Surface", (PyObject *)&__pyx_type_11pygame_sdl2_7surface_Surface) < 0) __PYX_ERR(0, 53, __pyx_L1_error) if (__pyx_type_11pygame_sdl2_7surface_Surface.tp_weaklistoffset == 0) __pyx_type_11pygame_sdl2_7surface_Surface.tp_weaklistoffset = offsetof(struct __pyx_obj_11pygame_sdl2_7surface_Surface, __weakref__); __pyx_ptype_11pygame_sdl2_7surface_Surface = &__pyx_type_11pygame_sdl2_7surface_Surface; /*--- Type import code ---*/ __pyx_ptype_11pygame_sdl2_5color_Color = __Pyx_ImportType("pygame_sdl2.color", "Color", sizeof(struct __pyx_obj_11pygame_sdl2_5color_Color), 1); if (unlikely(!__pyx_ptype_11pygame_sdl2_5color_Color)) __PYX_ERR(1, 26, __pyx_L1_error) __pyx_vtabptr_11pygame_sdl2_5color_Color = (struct __pyx_vtabstruct_11pygame_sdl2_5color_Color*)__Pyx_GetVtable(__pyx_ptype_11pygame_sdl2_5color_Color->tp_dict); if (unlikely(!__pyx_vtabptr_11pygame_sdl2_5color_Color)) __PYX_ERR(1, 26, __pyx_L1_error) __pyx_ptype_11pygame_sdl2_4rect_Rect = __Pyx_ImportType("pygame_sdl2.rect", "Rect", sizeof(struct __pyx_obj_11pygame_sdl2_4rect_Rect), 1); if (unlikely(!__pyx_ptype_11pygame_sdl2_4rect_Rect)) __PYX_ERR(2, 21, __pyx_L1_error) /*--- Variable import code ---*/ /*--- Function import code ---*/ __pyx_t_1 = __Pyx_ImportModule("pygame_sdl2.color"); if (!__pyx_t_1) __PYX_ERR(0, 1, __pyx_L1_error) if (__Pyx_ImportFunction(__pyx_t_1, "map_color", (void (**)(void))&__pyx_f_11pygame_sdl2_5color_map_color, "Uint32 (SDL_Surface *, PyObject *)") < 0) __PYX_ERR(0, 1, __pyx_L1_error) if (__Pyx_ImportFunction(__pyx_t_1, "get_color", (void (**)(void))&__pyx_f_11pygame_sdl2_5color_get_color, "PyObject *(Uint32, SDL_Surface *)") < 0) __PYX_ERR(0, 1, __pyx_L1_error) Py_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_2 = __Pyx_ImportModule("pygame_sdl2.rect"); if (!__pyx_t_2) __PYX_ERR(0, 1, __pyx_L1_error) if (__Pyx_ImportFunction(__pyx_t_2, "to_sdl_rect", (void (**)(void))&__pyx_f_11pygame_sdl2_4rect_to_sdl_rect, "int (PyObject *, SDL_Rect *, struct __pyx_opt_args_11pygame_sdl2_4rect_to_sdl_rect *__pyx_optional_args)") < 0) __PYX_ERR(0, 1, __pyx_L1_error) Py_DECREF(__pyx_t_2); __pyx_t_2 = 0; /*--- Execution code ---*/ #if defined(__Pyx_Generator_USED) || defined(__Pyx_Coroutine_USED) if (__Pyx_patch_abc() < 0) __PYX_ERR(0, 1, __pyx_L1_error) #endif /* "pygame_sdl2/surface.pyx":25 * from pygame_sdl2.color cimport map_color, get_color * from pygame_sdl2.rect cimport to_sdl_rect * from pygame_sdl2.rect import Rect # <<<<<<<<<<<<<< * * from pygame_sdl2.error import error */ __pyx_t_3 = PyList_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 25, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_INCREF(__pyx_n_s_Rect); __Pyx_GIVEREF(__pyx_n_s_Rect); PyList_SET_ITEM(__pyx_t_3, 0, __pyx_n_s_Rect); __pyx_t_4 = __Pyx_Import(__pyx_n_s_pygame_sdl2_rect, __pyx_t_3, -1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 25, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_3 = __Pyx_ImportFrom(__pyx_t_4, __pyx_n_s_Rect); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 25, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); if (PyDict_SetItem(__pyx_d, __pyx_n_s_Rect, __pyx_t_3) < 0) __PYX_ERR(0, 25, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; /* "pygame_sdl2/surface.pyx":27 * from pygame_sdl2.rect import Rect * * from pygame_sdl2.error import error # <<<<<<<<<<<<<< * from pygame_sdl2.locals import SRCALPHA * import pygame_sdl2 */ __pyx_t_4 = PyList_New(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 27, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_INCREF(__pyx_n_s_error); __Pyx_GIVEREF(__pyx_n_s_error); PyList_SET_ITEM(__pyx_t_4, 0, __pyx_n_s_error); __pyx_t_3 = __Pyx_Import(__pyx_n_s_pygame_sdl2_error, __pyx_t_4, -1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 27, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_t_4 = __Pyx_ImportFrom(__pyx_t_3, __pyx_n_s_error); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 27, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); if (PyDict_SetItem(__pyx_d, __pyx_n_s_error, __pyx_t_4) < 0) __PYX_ERR(0, 27, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "pygame_sdl2/surface.pyx":28 * * from pygame_sdl2.error import error * from pygame_sdl2.locals import SRCALPHA # <<<<<<<<<<<<<< * import pygame_sdl2 * */ __pyx_t_3 = PyList_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 28, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_INCREF(__pyx_n_s_SRCALPHA); __Pyx_GIVEREF(__pyx_n_s_SRCALPHA); PyList_SET_ITEM(__pyx_t_3, 0, __pyx_n_s_SRCALPHA); __pyx_t_4 = __Pyx_Import(__pyx_n_s_pygame_sdl2_locals, __pyx_t_3, -1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 28, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_3 = __Pyx_ImportFrom(__pyx_t_4, __pyx_n_s_SRCALPHA); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 28, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); if (PyDict_SetItem(__pyx_d, __pyx_n_s_SRCALPHA, __pyx_t_3) < 0) __PYX_ERR(0, 28, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; /* "pygame_sdl2/surface.pyx":29 * from pygame_sdl2.error import error * from pygame_sdl2.locals import SRCALPHA * import pygame_sdl2 # <<<<<<<<<<<<<< * * import warnings */ __pyx_t_4 = __Pyx_Import(__pyx_n_s_pygame_sdl2, 0, -1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 29, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); if (PyDict_SetItem(__pyx_d, __pyx_n_s_pygame_sdl2, __pyx_t_4) < 0) __PYX_ERR(0, 29, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; /* "pygame_sdl2/surface.pyx":31 * import pygame_sdl2 * * import warnings # <<<<<<<<<<<<<< * * cdef extern from "src/surface.h" nogil: */ __pyx_t_4 = __Pyx_Import(__pyx_n_s_warnings, 0, -1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 31, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); if (PyDict_SetItem(__pyx_d, __pyx_n_s_warnings, __pyx_t_4) < 0) __PYX_ERR(0, 31, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; /* "pygame_sdl2/surface.pyx":51 * * # The total size of all allocated surfaces * total_size = 0 # <<<<<<<<<<<<<< * * cdef class Surface: */ if (PyDict_SetItem(__pyx_d, __pyx_n_s_total_size, __pyx_int_0) < 0) __PYX_ERR(0, 51, __pyx_L1_error) /* "pygame_sdl2/surface.pyx":1 * # Copyright 2014 Patrick Dawson # <<<<<<<<<<<<<< * # Copyright 2014 Tom Rothamel * # */ __pyx_t_4 = PyDict_New(); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); if (PyDict_SetItem(__pyx_d, __pyx_n_s_test, __pyx_t_4) < 0) __PYX_ERR(0, 1, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; /*--- Wrapped vars code ---*/ goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); if (__pyx_m) { if (__pyx_d) { __Pyx_AddTraceback("init pygame_sdl2.surface", __pyx_clineno, __pyx_lineno, __pyx_filename); } Py_DECREF(__pyx_m); __pyx_m = 0; } else if (!PyErr_Occurred()) { PyErr_SetString(PyExc_ImportError, "init pygame_sdl2.surface"); } __pyx_L0:; __Pyx_RefNannyFinishContext(); #if PY_MAJOR_VERSION < 3 return; #else return __pyx_m; #endif } /* --- Runtime support code --- */ /* Refnanny */ #if CYTHON_REFNANNY static __Pyx_RefNannyAPIStruct *__Pyx_RefNannyImportAPI(const char *modname) { PyObject *m = NULL, *p = NULL; void *r = NULL; m = PyImport_ImportModule((char *)modname); if (!m) goto end; p = PyObject_GetAttrString(m, (char *)"RefNannyAPI"); if (!p) goto end; r = PyLong_AsVoidPtr(p); end: Py_XDECREF(p); Py_XDECREF(m); return (__Pyx_RefNannyAPIStruct *)r; } #endif /* GetBuiltinName */ static PyObject *__Pyx_GetBuiltinName(PyObject *name) { PyObject* result = __Pyx_PyObject_GetAttrStr(__pyx_b, name); if (unlikely(!result)) { PyErr_Format(PyExc_NameError, #if PY_MAJOR_VERSION >= 3 "name '%U' is not defined", name); #else "name '%.200s' is not defined", PyString_AS_STRING(name)); #endif } return result; } /* RaiseArgTupleInvalid */ static void __Pyx_RaiseArgtupleInvalid( const char* func_name, int exact, Py_ssize_t num_min, Py_ssize_t num_max, Py_ssize_t num_found) { Py_ssize_t num_expected; const char *more_or_less; if (num_found < num_min) { num_expected = num_min; more_or_less = "at least"; } else { num_expected = num_max; more_or_less = "at most"; } if (exact) { more_or_less = "exactly"; } PyErr_Format(PyExc_TypeError, "%.200s() takes %.8s %" CYTHON_FORMAT_SSIZE_T "d positional argument%.1s (%" CYTHON_FORMAT_SSIZE_T "d given)", func_name, more_or_less, num_expected, (num_expected == 1) ? "" : "s", num_found); } /* KeywordStringCheck */ static CYTHON_INLINE int __Pyx_CheckKeywordStrings( PyObject *kwdict, const char* function_name, int kw_allowed) { PyObject* key = 0; Py_ssize_t pos = 0; #if CYTHON_COMPILING_IN_PYPY if (!kw_allowed && PyDict_Next(kwdict, &pos, &key, 0)) goto invalid_keyword; return 1; #else while (PyDict_Next(kwdict, &pos, &key, 0)) { #if PY_MAJOR_VERSION < 3 if (unlikely(!PyString_CheckExact(key)) && unlikely(!PyString_Check(key))) #endif if (unlikely(!PyUnicode_Check(key))) goto invalid_keyword_type; } if ((!kw_allowed) && unlikely(key)) goto invalid_keyword; return 1; invalid_keyword_type: PyErr_Format(PyExc_TypeError, "%.200s() keywords must be strings", function_name); return 0; #endif invalid_keyword: PyErr_Format(PyExc_TypeError, #if PY_MAJOR_VERSION < 3 "%.200s() got an unexpected keyword argument '%.200s'", function_name, PyString_AsString(key)); #else "%s() got an unexpected keyword argument '%U'", function_name, key); #endif return 0; } /* GetModuleGlobalName */ static CYTHON_INLINE PyObject *__Pyx_GetModuleGlobalName(PyObject *name) { PyObject *result; #if !CYTHON_AVOID_BORROWED_REFS result = PyDict_GetItem(__pyx_d, name); if (likely(result)) { Py_INCREF(result); } else { #else result = PyObject_GetItem(__pyx_d, name); if (!result) { PyErr_Clear(); #endif result = __Pyx_GetBuiltinName(name); } return result; } /* PyObjectCall */ #if CYTHON_COMPILING_IN_CPYTHON static CYTHON_INLINE PyObject* __Pyx_PyObject_Call(PyObject *func, PyObject *arg, PyObject *kw) { PyObject *result; ternaryfunc call = func->ob_type->tp_call; if (unlikely(!call)) return PyObject_Call(func, arg, kw); if (unlikely(Py_EnterRecursiveCall((char*)" while calling a Python object"))) return NULL; result = (*call)(func, arg, kw); Py_LeaveRecursiveCall(); if (unlikely(!result) && unlikely(!PyErr_Occurred())) { PyErr_SetString( PyExc_SystemError, "NULL result without error in PyObject_Call"); } return result; } #endif /* PyErrFetchRestore */ #if CYTHON_FAST_THREAD_STATE static CYTHON_INLINE void __Pyx_ErrRestoreInState(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb) { PyObject *tmp_type, *tmp_value, *tmp_tb; tmp_type = tstate->curexc_type; tmp_value = tstate->curexc_value; tmp_tb = tstate->curexc_traceback; tstate->curexc_type = type; tstate->curexc_value = value; tstate->curexc_traceback = tb; Py_XDECREF(tmp_type); Py_XDECREF(tmp_value); Py_XDECREF(tmp_tb); } static CYTHON_INLINE void __Pyx_ErrFetchInState(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb) { *type = tstate->curexc_type; *value = tstate->curexc_value; *tb = tstate->curexc_traceback; tstate->curexc_type = 0; tstate->curexc_value = 0; tstate->curexc_traceback = 0; } #endif /* WriteUnraisableException */ static void __Pyx_WriteUnraisable(const char *name, CYTHON_UNUSED int clineno, CYTHON_UNUSED int lineno, CYTHON_UNUSED const char *filename, int full_traceback, CYTHON_UNUSED int nogil) { PyObject *old_exc, *old_val, *old_tb; PyObject *ctx; __Pyx_PyThreadState_declare #ifdef WITH_THREAD PyGILState_STATE state; if (nogil) state = PyGILState_Ensure(); #ifdef _MSC_VER else state = (PyGILState_STATE)-1; #endif #endif __Pyx_PyThreadState_assign __Pyx_ErrFetch(&old_exc, &old_val, &old_tb); if (full_traceback) { Py_XINCREF(old_exc); Py_XINCREF(old_val); Py_XINCREF(old_tb); __Pyx_ErrRestore(old_exc, old_val, old_tb); PyErr_PrintEx(1); } #if PY_MAJOR_VERSION < 3 ctx = PyString_FromString(name); #else ctx = PyUnicode_FromString(name); #endif __Pyx_ErrRestore(old_exc, old_val, old_tb); if (!ctx) { PyErr_WriteUnraisable(Py_None); } else { PyErr_WriteUnraisable(ctx); Py_DECREF(ctx); } #ifdef WITH_THREAD if (nogil) PyGILState_Release(state); #endif } /* RaiseDoubleKeywords */ static void __Pyx_RaiseDoubleKeywordsError( const char* func_name, PyObject* kw_name) { PyErr_Format(PyExc_TypeError, #if PY_MAJOR_VERSION >= 3 "%s() got multiple values for keyword argument '%U'", func_name, kw_name); #else "%s() got multiple values for keyword argument '%s'", func_name, PyString_AsString(kw_name)); #endif } /* ParseKeywords */ static int __Pyx_ParseOptionalKeywords( PyObject *kwds, PyObject **argnames[], PyObject *kwds2, PyObject *values[], Py_ssize_t num_pos_args, const char* function_name) { PyObject *key = 0, *value = 0; Py_ssize_t pos = 0; PyObject*** name; PyObject*** first_kw_arg = argnames + num_pos_args; while (PyDict_Next(kwds, &pos, &key, &value)) { name = first_kw_arg; while (*name && (**name != key)) name++; if (*name) { values[name-argnames] = value; continue; } name = first_kw_arg; #if PY_MAJOR_VERSION < 3 if (likely(PyString_CheckExact(key)) || likely(PyString_Check(key))) { while (*name) { if ((CYTHON_COMPILING_IN_PYPY || PyString_GET_SIZE(**name) == PyString_GET_SIZE(key)) && _PyString_Eq(**name, key)) { values[name-argnames] = value; break; } name++; } if (*name) continue; else { PyObject*** argname = argnames; while (argname != first_kw_arg) { if ((**argname == key) || ( (CYTHON_COMPILING_IN_PYPY || PyString_GET_SIZE(**argname) == PyString_GET_SIZE(key)) && _PyString_Eq(**argname, key))) { goto arg_passed_twice; } argname++; } } } else #endif if (likely(PyUnicode_Check(key))) { while (*name) { int cmp = (**name == key) ? 0 : #if !CYTHON_COMPILING_IN_PYPY && PY_MAJOR_VERSION >= 3 (PyUnicode_GET_SIZE(**name) != PyUnicode_GET_SIZE(key)) ? 1 : #endif PyUnicode_Compare(**name, key); if (cmp < 0 && unlikely(PyErr_Occurred())) goto bad; if (cmp == 0) { values[name-argnames] = value; break; } name++; } if (*name) continue; else { PyObject*** argname = argnames; while (argname != first_kw_arg) { int cmp = (**argname == key) ? 0 : #if !CYTHON_COMPILING_IN_PYPY && PY_MAJOR_VERSION >= 3 (PyUnicode_GET_SIZE(**argname) != PyUnicode_GET_SIZE(key)) ? 1 : #endif PyUnicode_Compare(**argname, key); if (cmp < 0 && unlikely(PyErr_Occurred())) goto bad; if (cmp == 0) goto arg_passed_twice; argname++; } } } else goto invalid_keyword_type; if (kwds2) { if (unlikely(PyDict_SetItem(kwds2, key, value))) goto bad; } else { goto invalid_keyword; } } return 0; arg_passed_twice: __Pyx_RaiseDoubleKeywordsError(function_name, key); goto bad; invalid_keyword_type: PyErr_Format(PyExc_TypeError, "%.200s() keywords must be strings", function_name); goto bad; invalid_keyword: PyErr_Format(PyExc_TypeError, #if PY_MAJOR_VERSION < 3 "%.200s() got an unexpected keyword argument '%.200s'", function_name, PyString_AsString(key)); #else "%s() got an unexpected keyword argument '%U'", function_name, key); #endif bad: return -1; } /* RaiseTooManyValuesToUnpack */ static CYTHON_INLINE void __Pyx_RaiseTooManyValuesError(Py_ssize_t expected) { PyErr_Format(PyExc_ValueError, "too many values to unpack (expected %" CYTHON_FORMAT_SSIZE_T "d)", expected); } /* RaiseNeedMoreValuesToUnpack */ static CYTHON_INLINE void __Pyx_RaiseNeedMoreValuesError(Py_ssize_t index) { PyErr_Format(PyExc_ValueError, "need more than %" CYTHON_FORMAT_SSIZE_T "d value%.1s to unpack", index, (index == 1) ? "" : "s"); } /* IterFinish */ static CYTHON_INLINE int __Pyx_IterFinish(void) { #if CYTHON_FAST_THREAD_STATE PyThreadState *tstate = PyThreadState_GET(); PyObject* exc_type = tstate->curexc_type; if (unlikely(exc_type)) { if (likely(exc_type == PyExc_StopIteration) || PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration)) { PyObject *exc_value, *exc_tb; exc_value = tstate->curexc_value; exc_tb = tstate->curexc_traceback; tstate->curexc_type = 0; tstate->curexc_value = 0; tstate->curexc_traceback = 0; Py_DECREF(exc_type); Py_XDECREF(exc_value); Py_XDECREF(exc_tb); return 0; } else { return -1; } } return 0; #else if (unlikely(PyErr_Occurred())) { if (likely(PyErr_ExceptionMatches(PyExc_StopIteration))) { PyErr_Clear(); return 0; } else { return -1; } } return 0; #endif } /* UnpackItemEndCheck */ static int __Pyx_IternextUnpackEndCheck(PyObject *retval, Py_ssize_t expected) { if (unlikely(retval)) { Py_DECREF(retval); __Pyx_RaiseTooManyValuesError(expected); return -1; } else { return __Pyx_IterFinish(); } return 0; } /* ExtTypeTest */ static CYTHON_INLINE int __Pyx_TypeTest(PyObject *obj, PyTypeObject *type) { if (unlikely(!type)) { PyErr_SetString(PyExc_SystemError, "Missing type object"); return 0; } if (likely(PyObject_TypeCheck(obj, type))) return 1; PyErr_Format(PyExc_TypeError, "Cannot convert %.200s to %.200s", Py_TYPE(obj)->tp_name, type->tp_name); return 0; } /* PyCFunctionFastCall */ #if CYTHON_FAST_PYCCALL static CYTHON_INLINE PyObject * __Pyx_PyCFunction_FastCall(PyObject *func_obj, PyObject **args, Py_ssize_t nargs) { PyCFunctionObject *func = (PyCFunctionObject*)func_obj; PyCFunction meth = PyCFunction_GET_FUNCTION(func); PyObject *self = PyCFunction_GET_SELF(func); assert(PyCFunction_Check(func)); assert(METH_FASTCALL == (PyCFunction_GET_FLAGS(func) & ~(METH_CLASS | METH_STATIC | METH_COEXIST))); assert(nargs >= 0); assert(nargs == 0 || args != NULL); /* _PyCFunction_FastCallDict() must not be called with an exception set, because it may clear it (directly or indirectly) and so the caller loses its exception */ assert(!PyErr_Occurred()); return (*((__Pyx_PyCFunctionFast)meth)) (self, args, nargs, NULL); } #endif // CYTHON_FAST_PYCCALL /* PyFunctionFastCall */ #if CYTHON_FAST_PYCALL #include "frameobject.h" static PyObject* __Pyx_PyFunction_FastCallNoKw(PyCodeObject *co, PyObject **args, Py_ssize_t na, PyObject *globals) { PyFrameObject *f; PyThreadState *tstate = PyThreadState_GET(); PyObject **fastlocals; Py_ssize_t i; PyObject *result; assert(globals != NULL); /* XXX Perhaps we should create a specialized PyFrame_New() that doesn't take locals, but does take builtins without sanity checking them. */ assert(tstate != NULL); f = PyFrame_New(tstate, co, globals, NULL); if (f == NULL) { return NULL; } fastlocals = f->f_localsplus; for (i = 0; i < na; i++) { Py_INCREF(*args); fastlocals[i] = *args++; } result = PyEval_EvalFrameEx(f,0); ++tstate->recursion_depth; Py_DECREF(f); --tstate->recursion_depth; return result; } #if 1 || PY_VERSION_HEX < 0x030600B1 static PyObject *__Pyx_PyFunction_FastCallDict(PyObject *func, PyObject **args, int nargs, PyObject *kwargs) { PyCodeObject *co = (PyCodeObject *)PyFunction_GET_CODE(func); PyObject *globals = PyFunction_GET_GLOBALS(func); PyObject *argdefs = PyFunction_GET_DEFAULTS(func); PyObject *closure; #if PY_MAJOR_VERSION >= 3 PyObject *kwdefs; #endif PyObject *kwtuple, **k; PyObject **d; Py_ssize_t nd; Py_ssize_t nk; PyObject *result; assert(kwargs == NULL || PyDict_Check(kwargs)); nk = kwargs ? PyDict_Size(kwargs) : 0; if (Py_EnterRecursiveCall((char*)" while calling a Python object")) { return NULL; } if ( #if PY_MAJOR_VERSION >= 3 co->co_kwonlyargcount == 0 && #endif likely(kwargs == NULL || nk == 0) && co->co_flags == (CO_OPTIMIZED | CO_NEWLOCALS | CO_NOFREE)) { if (argdefs == NULL && co->co_argcount == nargs) { result = __Pyx_PyFunction_FastCallNoKw(co, args, nargs, globals); goto done; } else if (nargs == 0 && argdefs != NULL && co->co_argcount == Py_SIZE(argdefs)) { /* function called with no arguments, but all parameters have a default value: use default values as arguments .*/ args = &PyTuple_GET_ITEM(argdefs, 0); result =__Pyx_PyFunction_FastCallNoKw(co, args, Py_SIZE(argdefs), globals); goto done; } } if (kwargs != NULL) { Py_ssize_t pos, i; kwtuple = PyTuple_New(2 * nk); if (kwtuple == NULL) { result = NULL; goto done; } k = &PyTuple_GET_ITEM(kwtuple, 0); pos = i = 0; while (PyDict_Next(kwargs, &pos, &k[i], &k[i+1])) { Py_INCREF(k[i]); Py_INCREF(k[i+1]); i += 2; } nk = i / 2; } else { kwtuple = NULL; k = NULL; } closure = PyFunction_GET_CLOSURE(func); #if PY_MAJOR_VERSION >= 3 kwdefs = PyFunction_GET_KW_DEFAULTS(func); #endif if (argdefs != NULL) { d = &PyTuple_GET_ITEM(argdefs, 0); nd = Py_SIZE(argdefs); } else { d = NULL; nd = 0; } #if PY_MAJOR_VERSION >= 3 result = PyEval_EvalCodeEx((PyObject*)co, globals, (PyObject *)NULL, args, nargs, k, (int)nk, d, (int)nd, kwdefs, closure); #else result = PyEval_EvalCodeEx(co, globals, (PyObject *)NULL, args, nargs, k, (int)nk, d, (int)nd, closure); #endif Py_XDECREF(kwtuple); done: Py_LeaveRecursiveCall(); return result; } #endif // CPython < 3.6 #endif // CYTHON_FAST_PYCALL /* PyObjectCallMethO */ #if CYTHON_COMPILING_IN_CPYTHON static CYTHON_INLINE PyObject* __Pyx_PyObject_CallMethO(PyObject *func, PyObject *arg) { PyObject *self, *result; PyCFunction cfunc; cfunc = PyCFunction_GET_FUNCTION(func); self = PyCFunction_GET_SELF(func); if (unlikely(Py_EnterRecursiveCall((char*)" while calling a Python object"))) return NULL; result = cfunc(self, arg); Py_LeaveRecursiveCall(); if (unlikely(!result) && unlikely(!PyErr_Occurred())) { PyErr_SetString( PyExc_SystemError, "NULL result without error in PyObject_Call"); } return result; } #endif /* PyObjectCallOneArg */ #if CYTHON_COMPILING_IN_CPYTHON static PyObject* __Pyx__PyObject_CallOneArg(PyObject *func, PyObject *arg) { PyObject *result; PyObject *args = PyTuple_New(1); if (unlikely(!args)) return NULL; Py_INCREF(arg); PyTuple_SET_ITEM(args, 0, arg); result = __Pyx_PyObject_Call(func, args, NULL); Py_DECREF(args); return result; } static CYTHON_INLINE PyObject* __Pyx_PyObject_CallOneArg(PyObject *func, PyObject *arg) { #if CYTHON_FAST_PYCALL if (PyFunction_Check(func)) { return __Pyx_PyFunction_FastCall(func, &arg, 1); } #endif #ifdef __Pyx_CyFunction_USED if (likely(PyCFunction_Check(func) || PyObject_TypeCheck(func, __pyx_CyFunctionType))) { #else if (likely(PyCFunction_Check(func))) { #endif if (likely(PyCFunction_GET_FLAGS(func) & METH_O)) { return __Pyx_PyObject_CallMethO(func, arg); #if CYTHON_FAST_PYCCALL } else if (PyCFunction_GET_FLAGS(func) & METH_FASTCALL) { return __Pyx_PyCFunction_FastCall(func, &arg, 1); #endif } } return __Pyx__PyObject_CallOneArg(func, arg); } #else static CYTHON_INLINE PyObject* __Pyx_PyObject_CallOneArg(PyObject *func, PyObject *arg) { PyObject *result; PyObject *args = PyTuple_Pack(1, arg); if (unlikely(!args)) return NULL; result = __Pyx_PyObject_Call(func, args, NULL); Py_DECREF(args); return result; } #endif /* PyObjectCallNoArg */ #if CYTHON_COMPILING_IN_CPYTHON static CYTHON_INLINE PyObject* __Pyx_PyObject_CallNoArg(PyObject *func) { #if CYTHON_FAST_PYCALL if (PyFunction_Check(func)) { return __Pyx_PyFunction_FastCall(func, NULL, 0); } #endif #ifdef __Pyx_CyFunction_USED if (likely(PyCFunction_Check(func) || PyObject_TypeCheck(func, __pyx_CyFunctionType))) { #else if (likely(PyCFunction_Check(func))) { #endif if (likely(PyCFunction_GET_FLAGS(func) & METH_NOARGS)) { return __Pyx_PyObject_CallMethO(func, NULL); } } return __Pyx_PyObject_Call(func, __pyx_empty_tuple, NULL); } #endif /* RaiseException */ #if PY_MAJOR_VERSION < 3 static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, CYTHON_UNUSED PyObject *cause) { __Pyx_PyThreadState_declare Py_XINCREF(type); if (!value || value == Py_None) value = NULL; else Py_INCREF(value); if (!tb || tb == Py_None) tb = NULL; else { Py_INCREF(tb); if (!PyTraceBack_Check(tb)) { PyErr_SetString(PyExc_TypeError, "raise: arg 3 must be a traceback or None"); goto raise_error; } } if (PyType_Check(type)) { #if CYTHON_COMPILING_IN_PYPY if (!value) { Py_INCREF(Py_None); value = Py_None; } #endif PyErr_NormalizeException(&type, &value, &tb); } else { if (value) { PyErr_SetString(PyExc_TypeError, "instance exception may not have a separate value"); goto raise_error; } value = type; type = (PyObject*) Py_TYPE(type); Py_INCREF(type); if (!PyType_IsSubtype((PyTypeObject *)type, (PyTypeObject *)PyExc_BaseException)) { PyErr_SetString(PyExc_TypeError, "raise: exception class must be a subclass of BaseException"); goto raise_error; } } __Pyx_PyThreadState_assign __Pyx_ErrRestore(type, value, tb); return; raise_error: Py_XDECREF(value); Py_XDECREF(type); Py_XDECREF(tb); return; } #else static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, PyObject *cause) { PyObject* owned_instance = NULL; if (tb == Py_None) { tb = 0; } else if (tb && !PyTraceBack_Check(tb)) { PyErr_SetString(PyExc_TypeError, "raise: arg 3 must be a traceback or None"); goto bad; } if (value == Py_None) value = 0; if (PyExceptionInstance_Check(type)) { if (value) { PyErr_SetString(PyExc_TypeError, "instance exception may not have a separate value"); goto bad; } value = type; type = (PyObject*) Py_TYPE(value); } else if (PyExceptionClass_Check(type)) { PyObject *instance_class = NULL; if (value && PyExceptionInstance_Check(value)) { instance_class = (PyObject*) Py_TYPE(value); if (instance_class != type) { int is_subclass = PyObject_IsSubclass(instance_class, type); if (!is_subclass) { instance_class = NULL; } else if (unlikely(is_subclass == -1)) { goto bad; } else { type = instance_class; } } } if (!instance_class) { PyObject *args; if (!value) args = PyTuple_New(0); else if (PyTuple_Check(value)) { Py_INCREF(value); args = value; } else args = PyTuple_Pack(1, value); if (!args) goto bad; owned_instance = PyObject_Call(type, args, NULL); Py_DECREF(args); if (!owned_instance) goto bad; value = owned_instance; if (!PyExceptionInstance_Check(value)) { PyErr_Format(PyExc_TypeError, "calling %R should have returned an instance of " "BaseException, not %R", type, Py_TYPE(value)); goto bad; } } } else { PyErr_SetString(PyExc_TypeError, "raise: exception class must be a subclass of BaseException"); goto bad; } #if PY_VERSION_HEX >= 0x03030000 if (cause) { #else if (cause && cause != Py_None) { #endif PyObject *fixed_cause; if (cause == Py_None) { fixed_cause = NULL; } else if (PyExceptionClass_Check(cause)) { fixed_cause = PyObject_CallObject(cause, NULL); if (fixed_cause == NULL) goto bad; } else if (PyExceptionInstance_Check(cause)) { fixed_cause = cause; Py_INCREF(fixed_cause); } else { PyErr_SetString(PyExc_TypeError, "exception causes must derive from " "BaseException"); goto bad; } PyException_SetCause(value, fixed_cause); } PyErr_SetObject(type, value); if (tb) { #if CYTHON_COMPILING_IN_PYPY PyObject *tmp_type, *tmp_value, *tmp_tb; PyErr_Fetch(&tmp_type, &tmp_value, &tmp_tb); Py_INCREF(tb); PyErr_Restore(tmp_type, tmp_value, tb); Py_XDECREF(tmp_tb); #else PyThreadState *tstate = PyThreadState_GET(); PyObject* tmp_tb = tstate->curexc_traceback; if (tb != tmp_tb) { Py_INCREF(tb); tstate->curexc_traceback = tb; Py_XDECREF(tmp_tb); } #endif } bad: Py_XDECREF(owned_instance); return; } #endif /* ArgTypeTest */ static void __Pyx_RaiseArgumentTypeInvalid(const char* name, PyObject *obj, PyTypeObject *type) { PyErr_Format(PyExc_TypeError, "Argument '%.200s' has incorrect type (expected %.200s, got %.200s)", name, type->tp_name, Py_TYPE(obj)->tp_name); } static CYTHON_INLINE int __Pyx_ArgTypeTest(PyObject *obj, PyTypeObject *type, int none_allowed, const char *name, int exact) { if (unlikely(!type)) { PyErr_SetString(PyExc_SystemError, "Missing type object"); return 0; } if (none_allowed && obj == Py_None) return 1; else if (exact) { if (likely(Py_TYPE(obj) == type)) return 1; #if PY_MAJOR_VERSION == 2 else if ((type == &PyBaseString_Type) && likely(__Pyx_PyBaseString_CheckExact(obj))) return 1; #endif } else { if (likely(PyObject_TypeCheck(obj, type))) return 1; } __Pyx_RaiseArgumentTypeInvalid(name, obj, type); return 0; } /* GetItemInt */ static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Generic(PyObject *o, PyObject* j) { PyObject *r; if (!j) return NULL; r = PyObject_GetItem(o, j); Py_DECREF(j); return r; } static CYTHON_INLINE PyObject *__Pyx_GetItemInt_List_Fast(PyObject *o, Py_ssize_t i, CYTHON_NCP_UNUSED int wraparound, CYTHON_NCP_UNUSED int boundscheck) { #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS if (wraparound & unlikely(i < 0)) i += PyList_GET_SIZE(o); if ((!boundscheck) || likely((0 <= i) & (i < PyList_GET_SIZE(o)))) { PyObject *r = PyList_GET_ITEM(o, i); Py_INCREF(r); return r; } return __Pyx_GetItemInt_Generic(o, PyInt_FromSsize_t(i)); #else return PySequence_GetItem(o, i); #endif } static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Tuple_Fast(PyObject *o, Py_ssize_t i, CYTHON_NCP_UNUSED int wraparound, CYTHON_NCP_UNUSED int boundscheck) { #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS if (wraparound & unlikely(i < 0)) i += PyTuple_GET_SIZE(o); if ((!boundscheck) || likely((0 <= i) & (i < PyTuple_GET_SIZE(o)))) { PyObject *r = PyTuple_GET_ITEM(o, i); Py_INCREF(r); return r; } return __Pyx_GetItemInt_Generic(o, PyInt_FromSsize_t(i)); #else return PySequence_GetItem(o, i); #endif } static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Fast(PyObject *o, Py_ssize_t i, int is_list, CYTHON_NCP_UNUSED int wraparound, CYTHON_NCP_UNUSED int boundscheck) { #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS && CYTHON_USE_TYPE_SLOTS if (is_list || PyList_CheckExact(o)) { Py_ssize_t n = ((!wraparound) | likely(i >= 0)) ? i : i + PyList_GET_SIZE(o); if ((!boundscheck) || (likely((n >= 0) & (n < PyList_GET_SIZE(o))))) { PyObject *r = PyList_GET_ITEM(o, n); Py_INCREF(r); return r; } } else if (PyTuple_CheckExact(o)) { Py_ssize_t n = ((!wraparound) | likely(i >= 0)) ? i : i + PyTuple_GET_SIZE(o); if ((!boundscheck) || likely((n >= 0) & (n < PyTuple_GET_SIZE(o)))) { PyObject *r = PyTuple_GET_ITEM(o, n); Py_INCREF(r); return r; } } else { PySequenceMethods *m = Py_TYPE(o)->tp_as_sequence; if (likely(m && m->sq_item)) { if (wraparound && unlikely(i < 0) && likely(m->sq_length)) { Py_ssize_t l = m->sq_length(o); if (likely(l >= 0)) { i += l; } else { if (!PyErr_ExceptionMatches(PyExc_OverflowError)) return NULL; PyErr_Clear(); } } return m->sq_item(o, i); } } #else if (is_list || PySequence_Check(o)) { return PySequence_GetItem(o, i); } #endif return __Pyx_GetItemInt_Generic(o, PyInt_FromSsize_t(i)); } /* PyObjectCallMethod1 */ static PyObject* __Pyx_PyObject_CallMethod1(PyObject* obj, PyObject* method_name, PyObject* arg) { PyObject *method, *result = NULL; method = __Pyx_PyObject_GetAttrStr(obj, method_name); if (unlikely(!method)) goto done; #if CYTHON_UNPACK_METHODS if (likely(PyMethod_Check(method))) { PyObject *self = PyMethod_GET_SELF(method); if (likely(self)) { PyObject *args; PyObject *function = PyMethod_GET_FUNCTION(method); #if CYTHON_FAST_PYCALL if (PyFunction_Check(function)) { PyObject *args[2] = {self, arg}; result = __Pyx_PyFunction_FastCall(function, args, 2); goto done; } #endif #if CYTHON_FAST_PYCCALL if (__Pyx_PyFastCFunction_Check(function)) { PyObject *args[2] = {self, arg}; result = __Pyx_PyCFunction_FastCall(function, args, 2); goto done; } #endif args = PyTuple_New(2); if (unlikely(!args)) goto done; Py_INCREF(self); PyTuple_SET_ITEM(args, 0, self); Py_INCREF(arg); PyTuple_SET_ITEM(args, 1, arg); Py_INCREF(function); Py_DECREF(method); method = NULL; result = __Pyx_PyObject_Call(function, args, NULL); Py_DECREF(args); Py_DECREF(function); return result; } } #endif result = __Pyx_PyObject_CallOneArg(method, arg); done: Py_XDECREF(method); return result; } /* append */ static CYTHON_INLINE int __Pyx_PyObject_Append(PyObject* L, PyObject* x) { if (likely(PyList_CheckExact(L))) { if (unlikely(__Pyx_PyList_Append(L, x) < 0)) return -1; } else { PyObject* retval = __Pyx_PyObject_CallMethod1(L, __pyx_n_s_append, x); if (unlikely(!retval)) return -1; Py_DECREF(retval); } return 0; } /* UnpackUnboundCMethod */ static int __Pyx_TryUnpackUnboundCMethod(__Pyx_CachedCFunction* target) { PyObject *method; method = __Pyx_PyObject_GetAttrStr(target->type, *target->method_name); if (unlikely(!method)) return -1; target->method = method; #if CYTHON_COMPILING_IN_CPYTHON #if PY_MAJOR_VERSION >= 3 if (likely(PyObject_TypeCheck(method, &PyMethodDescr_Type))) #endif { PyMethodDescrObject *descr = (PyMethodDescrObject*) method; target->func = descr->d_method->ml_meth; target->flag = descr->d_method->ml_flags & ~(METH_CLASS | METH_STATIC | METH_COEXIST); } #endif return 0; } /* CallUnboundCMethod0 */ static PyObject* __Pyx__CallUnboundCMethod0(__Pyx_CachedCFunction* cfunc, PyObject* self) { PyObject *args, *result = NULL; if (unlikely(!cfunc->method) && unlikely(__Pyx_TryUnpackUnboundCMethod(cfunc) < 0)) return NULL; #if CYTHON_ASSUME_SAFE_MACROS args = PyTuple_New(1); if (unlikely(!args)) goto bad; Py_INCREF(self); PyTuple_SET_ITEM(args, 0, self); #else args = PyTuple_Pack(1, self); if (unlikely(!args)) goto bad; #endif result = __Pyx_PyObject_Call(cfunc->method, args, NULL); Py_DECREF(args); bad: return result; } /* py_dict_items */ static CYTHON_INLINE PyObject* __Pyx_PyDict_Items(PyObject* d) { if (PY_MAJOR_VERSION >= 3) return __Pyx_CallUnboundCMethod0(&__pyx_umethod_PyDict_Type_items, d); else return PyDict_Items(d); } /* SetVTable */ static int __Pyx_SetVtable(PyObject *dict, void *vtable) { #if PY_VERSION_HEX >= 0x02070000 PyObject *ob = PyCapsule_New(vtable, 0, 0); #else PyObject *ob = PyCObject_FromVoidPtr(vtable, 0); #endif if (!ob) goto bad; if (PyDict_SetItem(dict, __pyx_n_s_pyx_vtable, ob) < 0) goto bad; Py_DECREF(ob); return 0; bad: Py_XDECREF(ob); return -1; } /* GetVTable */ static void* __Pyx_GetVtable(PyObject *dict) { void* ptr; PyObject *ob = PyObject_GetItem(dict, __pyx_n_s_pyx_vtable); if (!ob) goto bad; #if PY_VERSION_HEX >= 0x02070000 ptr = PyCapsule_GetPointer(ob, 0); #else ptr = PyCObject_AsVoidPtr(ob); #endif if (!ptr && !PyErr_Occurred()) PyErr_SetString(PyExc_RuntimeError, "invalid vtable found for imported type"); Py_DECREF(ob); return ptr; bad: Py_XDECREF(ob); return NULL; } /* Import */ static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list, int level) { PyObject *empty_list = 0; PyObject *module = 0; PyObject *global_dict = 0; PyObject *empty_dict = 0; PyObject *list; #if PY_VERSION_HEX < 0x03030000 PyObject *py_import; py_import = __Pyx_PyObject_GetAttrStr(__pyx_b, __pyx_n_s_import); if (!py_import) goto bad; #endif if (from_list) list = from_list; else { empty_list = PyList_New(0); if (!empty_list) goto bad; list = empty_list; } global_dict = PyModule_GetDict(__pyx_m); if (!global_dict) goto bad; empty_dict = PyDict_New(); if (!empty_dict) goto bad; { #if PY_MAJOR_VERSION >= 3 if (level == -1) { if (strchr(__Pyx_MODULE_NAME, '.')) { #if PY_VERSION_HEX < 0x03030000 PyObject *py_level = PyInt_FromLong(1); if (!py_level) goto bad; module = PyObject_CallFunctionObjArgs(py_import, name, global_dict, empty_dict, list, py_level, NULL); Py_DECREF(py_level); #else module = PyImport_ImportModuleLevelObject( name, global_dict, empty_dict, list, 1); #endif if (!module) { if (!PyErr_ExceptionMatches(PyExc_ImportError)) goto bad; PyErr_Clear(); } } level = 0; } #endif if (!module) { #if PY_VERSION_HEX < 0x03030000 PyObject *py_level = PyInt_FromLong(level); if (!py_level) goto bad; module = PyObject_CallFunctionObjArgs(py_import, name, global_dict, empty_dict, list, py_level, NULL); Py_DECREF(py_level); #else module = PyImport_ImportModuleLevelObject( name, global_dict, empty_dict, list, level); #endif } } bad: #if PY_VERSION_HEX < 0x03030000 Py_XDECREF(py_import); #endif Py_XDECREF(empty_list); Py_XDECREF(empty_dict); return module; } /* ImportFrom */ static PyObject* __Pyx_ImportFrom(PyObject* module, PyObject* name) { PyObject* value = __Pyx_PyObject_GetAttrStr(module, name); if (unlikely(!value) && PyErr_ExceptionMatches(PyExc_AttributeError)) { PyErr_Format(PyExc_ImportError, #if PY_MAJOR_VERSION < 3 "cannot import name %.230s", PyString_AS_STRING(name)); #else "cannot import name %S", name); #endif } return value; } /* CodeObjectCache */ static int __pyx_bisect_code_objects(__Pyx_CodeObjectCacheEntry* entries, int count, int code_line) { int start = 0, mid = 0, end = count - 1; if (end >= 0 && code_line > entries[end].code_line) { return count; } while (start < end) { mid = start + (end - start) / 2; if (code_line < entries[mid].code_line) { end = mid; } else if (code_line > entries[mid].code_line) { start = mid + 1; } else { return mid; } } if (code_line <= entries[mid].code_line) { return mid; } else { return mid + 1; } } static PyCodeObject *__pyx_find_code_object(int code_line) { PyCodeObject* code_object; int pos; if (unlikely(!code_line) || unlikely(!__pyx_code_cache.entries)) { return NULL; } pos = __pyx_bisect_code_objects(__pyx_code_cache.entries, __pyx_code_cache.count, code_line); if (unlikely(pos >= __pyx_code_cache.count) || unlikely(__pyx_code_cache.entries[pos].code_line != code_line)) { return NULL; } code_object = __pyx_code_cache.entries[pos].code_object; Py_INCREF(code_object); return code_object; } static void __pyx_insert_code_object(int code_line, PyCodeObject* code_object) { int pos, i; __Pyx_CodeObjectCacheEntry* entries = __pyx_code_cache.entries; if (unlikely(!code_line)) { return; } if (unlikely(!entries)) { entries = (__Pyx_CodeObjectCacheEntry*)PyMem_Malloc(64*sizeof(__Pyx_CodeObjectCacheEntry)); if (likely(entries)) { __pyx_code_cache.entries = entries; __pyx_code_cache.max_count = 64; __pyx_code_cache.count = 1; entries[0].code_line = code_line; entries[0].code_object = code_object; Py_INCREF(code_object); } return; } pos = __pyx_bisect_code_objects(__pyx_code_cache.entries, __pyx_code_cache.count, code_line); if ((pos < __pyx_code_cache.count) && unlikely(__pyx_code_cache.entries[pos].code_line == code_line)) { PyCodeObject* tmp = entries[pos].code_object; entries[pos].code_object = code_object; Py_DECREF(tmp); return; } if (__pyx_code_cache.count == __pyx_code_cache.max_count) { int new_max = __pyx_code_cache.max_count + 64; entries = (__Pyx_CodeObjectCacheEntry*)PyMem_Realloc( __pyx_code_cache.entries, (size_t)new_max*sizeof(__Pyx_CodeObjectCacheEntry)); if (unlikely(!entries)) { return; } __pyx_code_cache.entries = entries; __pyx_code_cache.max_count = new_max; } for (i=__pyx_code_cache.count; i>pos; i--) { entries[i] = entries[i-1]; } entries[pos].code_line = code_line; entries[pos].code_object = code_object; __pyx_code_cache.count++; Py_INCREF(code_object); } /* AddTraceback */ #include "compile.h" #include "frameobject.h" #include "traceback.h" static PyCodeObject* __Pyx_CreateCodeObjectForTraceback( const char *funcname, int c_line, int py_line, const char *filename) { PyCodeObject *py_code = 0; PyObject *py_srcfile = 0; PyObject *py_funcname = 0; #if PY_MAJOR_VERSION < 3 py_srcfile = PyString_FromString(filename); #else py_srcfile = PyUnicode_FromString(filename); #endif if (!py_srcfile) goto bad; if (c_line) { #if PY_MAJOR_VERSION < 3 py_funcname = PyString_FromFormat( "%s (%s:%d)", funcname, __pyx_cfilenm, c_line); #else py_funcname = PyUnicode_FromFormat( "%s (%s:%d)", funcname, __pyx_cfilenm, c_line); #endif } else { #if PY_MAJOR_VERSION < 3 py_funcname = PyString_FromString(funcname); #else py_funcname = PyUnicode_FromString(funcname); #endif } if (!py_funcname) goto bad; py_code = __Pyx_PyCode_New( 0, 0, 0, 0, 0, __pyx_empty_bytes, /*PyObject *code,*/ __pyx_empty_tuple, /*PyObject *consts,*/ __pyx_empty_tuple, /*PyObject *names,*/ __pyx_empty_tuple, /*PyObject *varnames,*/ __pyx_empty_tuple, /*PyObject *freevars,*/ __pyx_empty_tuple, /*PyObject *cellvars,*/ py_srcfile, /*PyObject *filename,*/ py_funcname, /*PyObject *name,*/ py_line, __pyx_empty_bytes /*PyObject *lnotab*/ ); Py_DECREF(py_srcfile); Py_DECREF(py_funcname); return py_code; bad: Py_XDECREF(py_srcfile); Py_XDECREF(py_funcname); return NULL; } static void __Pyx_AddTraceback(const char *funcname, int c_line, int py_line, const char *filename) { PyCodeObject *py_code = 0; PyFrameObject *py_frame = 0; py_code = __pyx_find_code_object(c_line ? c_line : py_line); if (!py_code) { py_code = __Pyx_CreateCodeObjectForTraceback( funcname, c_line, py_line, filename); if (!py_code) goto bad; __pyx_insert_code_object(c_line ? c_line : py_line, py_code); } py_frame = PyFrame_New( PyThreadState_GET(), /*PyThreadState *tstate,*/ py_code, /*PyCodeObject *code,*/ __pyx_d, /*PyObject *globals,*/ 0 /*PyObject *locals*/ ); if (!py_frame) goto bad; __Pyx_PyFrame_SetLineNumber(py_frame, py_line); PyTraceBack_Here(py_frame); bad: Py_XDECREF(py_code); Py_XDECREF(py_frame); } /* CIntFromPyVerify */ #define __PYX_VERIFY_RETURN_INT(target_type, func_type, func_value)\ __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, 0) #define __PYX_VERIFY_RETURN_INT_EXC(target_type, func_type, func_value)\ __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, 1) #define __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, exc)\ {\ func_type value = func_value;\ if (sizeof(target_type) < sizeof(func_type)) {\ if (unlikely(value != (func_type) (target_type) value)) {\ func_type zero = 0;\ if (exc && unlikely(value == (func_type)-1 && PyErr_Occurred()))\ return (target_type) -1;\ if (is_unsigned && unlikely(value < zero))\ goto raise_neg_overflow;\ else\ goto raise_overflow;\ }\ }\ return (target_type) value;\ } /* CIntToPy */ static CYTHON_INLINE PyObject* __Pyx_PyInt_From_int(int value) { const int neg_one = (int) -1, const_zero = (int) 0; const int is_unsigned = neg_one > const_zero; if (is_unsigned) { if (sizeof(int) < sizeof(long)) { return PyInt_FromLong((long) value); } else if (sizeof(int) <= sizeof(unsigned long)) { return PyLong_FromUnsignedLong((unsigned long) value); #ifdef HAVE_LONG_LONG } else if (sizeof(int) <= sizeof(unsigned PY_LONG_LONG)) { return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value); #endif } } else { if (sizeof(int) <= sizeof(long)) { return PyInt_FromLong((long) value); #ifdef HAVE_LONG_LONG } else if (sizeof(int) <= sizeof(PY_LONG_LONG)) { return PyLong_FromLongLong((PY_LONG_LONG) value); #endif } } { int one = 1; int little = (int)*(unsigned char *)&one; unsigned char *bytes = (unsigned char *)&value; return _PyLong_FromByteArray(bytes, sizeof(int), little, !is_unsigned); } } /* CIntToPy */ static CYTHON_INLINE PyObject* __Pyx_PyInt_From_uint32_t(uint32_t value) { const uint32_t neg_one = (uint32_t) -1, const_zero = (uint32_t) 0; const int is_unsigned = neg_one > const_zero; if (is_unsigned) { if (sizeof(uint32_t) < sizeof(long)) { return PyInt_FromLong((long) value); } else if (sizeof(uint32_t) <= sizeof(unsigned long)) { return PyLong_FromUnsignedLong((unsigned long) value); #ifdef HAVE_LONG_LONG } else if (sizeof(uint32_t) <= sizeof(unsigned PY_LONG_LONG)) { return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value); #endif } } else { if (sizeof(uint32_t) <= sizeof(long)) { return PyInt_FromLong((long) value); #ifdef HAVE_LONG_LONG } else if (sizeof(uint32_t) <= sizeof(PY_LONG_LONG)) { return PyLong_FromLongLong((PY_LONG_LONG) value); #endif } } { int one = 1; int little = (int)*(unsigned char *)&one; unsigned char *bytes = (unsigned char *)&value; return _PyLong_FromByteArray(bytes, sizeof(uint32_t), little, !is_unsigned); } } /* CIntToPy */ static CYTHON_INLINE PyObject* __Pyx_PyInt_From_uint8_t(uint8_t value) { const uint8_t neg_one = (uint8_t) -1, const_zero = (uint8_t) 0; const int is_unsigned = neg_one > const_zero; if (is_unsigned) { if (sizeof(uint8_t) < sizeof(long)) { return PyInt_FromLong((long) value); } else if (sizeof(uint8_t) <= sizeof(unsigned long)) { return PyLong_FromUnsignedLong((unsigned long) value); #ifdef HAVE_LONG_LONG } else if (sizeof(uint8_t) <= sizeof(unsigned PY_LONG_LONG)) { return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value); #endif } } else { if (sizeof(uint8_t) <= sizeof(long)) { return PyInt_FromLong((long) value); #ifdef HAVE_LONG_LONG } else if (sizeof(uint8_t) <= sizeof(PY_LONG_LONG)) { return PyLong_FromLongLong((PY_LONG_LONG) value); #endif } } { int one = 1; int little = (int)*(unsigned char *)&one; unsigned char *bytes = (unsigned char *)&value; return _PyLong_FromByteArray(bytes, sizeof(uint8_t), little, !is_unsigned); } } /* CIntToPy */ static CYTHON_INLINE PyObject* __Pyx_PyInt_From_long(long value) { const long neg_one = (long) -1, const_zero = (long) 0; const int is_unsigned = neg_one > const_zero; if (is_unsigned) { if (sizeof(long) < sizeof(long)) { return PyInt_FromLong((long) value); } else if (sizeof(long) <= sizeof(unsigned long)) { return PyLong_FromUnsignedLong((unsigned long) value); #ifdef HAVE_LONG_LONG } else if (sizeof(long) <= sizeof(unsigned PY_LONG_LONG)) { return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value); #endif } } else { if (sizeof(long) <= sizeof(long)) { return PyInt_FromLong((long) value); #ifdef HAVE_LONG_LONG } else if (sizeof(long) <= sizeof(PY_LONG_LONG)) { return PyLong_FromLongLong((PY_LONG_LONG) value); #endif } } { int one = 1; int little = (int)*(unsigned char *)&one; unsigned char *bytes = (unsigned char *)&value; return _PyLong_FromByteArray(bytes, sizeof(long), little, !is_unsigned); } } /* CIntToPy */ static CYTHON_INLINE PyObject* __Pyx_PyInt_From_uint64_t(uint64_t value) { const uint64_t neg_one = (uint64_t) -1, const_zero = (uint64_t) 0; const int is_unsigned = neg_one > const_zero; if (is_unsigned) { if (sizeof(uint64_t) < sizeof(long)) { return PyInt_FromLong((long) value); } else if (sizeof(uint64_t) <= sizeof(unsigned long)) { return PyLong_FromUnsignedLong((unsigned long) value); #ifdef HAVE_LONG_LONG } else if (sizeof(uint64_t) <= sizeof(unsigned PY_LONG_LONG)) { return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value); #endif } } else { if (sizeof(uint64_t) <= sizeof(long)) { return PyInt_FromLong((long) value); #ifdef HAVE_LONG_LONG } else if (sizeof(uint64_t) <= sizeof(PY_LONG_LONG)) { return PyLong_FromLongLong((PY_LONG_LONG) value); #endif } } { int one = 1; int little = (int)*(unsigned char *)&one; unsigned char *bytes = (unsigned char *)&value; return _PyLong_FromByteArray(bytes, sizeof(uint64_t), little, !is_unsigned); } } /* CIntFromPy */ static CYTHON_INLINE int __Pyx_PyInt_As_int(PyObject *x) { const int neg_one = (int) -1, const_zero = (int) 0; const int is_unsigned = neg_one > const_zero; #if PY_MAJOR_VERSION < 3 if (likely(PyInt_Check(x))) { if (sizeof(int) < sizeof(long)) { __PYX_VERIFY_RETURN_INT(int, long, PyInt_AS_LONG(x)) } else { long val = PyInt_AS_LONG(x); if (is_unsigned && unlikely(val < 0)) { goto raise_neg_overflow; } return (int) val; } } else #endif if (likely(PyLong_Check(x))) { if (is_unsigned) { #if CYTHON_USE_PYLONG_INTERNALS const digit* digits = ((PyLongObject*)x)->ob_digit; switch (Py_SIZE(x)) { case 0: return (int) 0; case 1: __PYX_VERIFY_RETURN_INT(int, digit, digits[0]) case 2: if (8 * sizeof(int) > 1 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(int) >= 2 * PyLong_SHIFT) { return (int) (((((int)digits[1]) << PyLong_SHIFT) | (int)digits[0])); } } break; case 3: if (8 * sizeof(int) > 2 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(int) >= 3 * PyLong_SHIFT) { return (int) (((((((int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0])); } } break; case 4: if (8 * sizeof(int) > 3 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(int) >= 4 * PyLong_SHIFT) { return (int) (((((((((int)digits[3]) << PyLong_SHIFT) | (int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0])); } } break; } #endif #if CYTHON_COMPILING_IN_CPYTHON if (unlikely(Py_SIZE(x) < 0)) { goto raise_neg_overflow; } #else { int result = PyObject_RichCompareBool(x, Py_False, Py_LT); if (unlikely(result < 0)) return (int) -1; if (unlikely(result == 1)) goto raise_neg_overflow; } #endif if (sizeof(int) <= sizeof(unsigned long)) { __PYX_VERIFY_RETURN_INT_EXC(int, unsigned long, PyLong_AsUnsignedLong(x)) #ifdef HAVE_LONG_LONG } else if (sizeof(int) <= sizeof(unsigned PY_LONG_LONG)) { __PYX_VERIFY_RETURN_INT_EXC(int, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x)) #endif } } else { #if CYTHON_USE_PYLONG_INTERNALS const digit* digits = ((PyLongObject*)x)->ob_digit; switch (Py_SIZE(x)) { case 0: return (int) 0; case -1: __PYX_VERIFY_RETURN_INT(int, sdigit, (sdigit) (-(sdigit)digits[0])) case 1: __PYX_VERIFY_RETURN_INT(int, digit, +digits[0]) case -2: if (8 * sizeof(int) - 1 > 1 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(int, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(int) - 1 > 2 * PyLong_SHIFT) { return (int) (((int)-1)*(((((int)digits[1]) << PyLong_SHIFT) | (int)digits[0]))); } } break; case 2: if (8 * sizeof(int) > 1 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(int) - 1 > 2 * PyLong_SHIFT) { return (int) ((((((int)digits[1]) << PyLong_SHIFT) | (int)digits[0]))); } } break; case -3: if (8 * sizeof(int) - 1 > 2 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(int, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(int) - 1 > 3 * PyLong_SHIFT) { return (int) (((int)-1)*(((((((int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0]))); } } break; case 3: if (8 * sizeof(int) > 2 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(int) - 1 > 3 * PyLong_SHIFT) { return (int) ((((((((int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0]))); } } break; case -4: if (8 * sizeof(int) - 1 > 3 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(int, long, -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(int) - 1 > 4 * PyLong_SHIFT) { return (int) (((int)-1)*(((((((((int)digits[3]) << PyLong_SHIFT) | (int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0]))); } } break; case 4: if (8 * sizeof(int) > 3 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(int) - 1 > 4 * PyLong_SHIFT) { return (int) ((((((((((int)digits[3]) << PyLong_SHIFT) | (int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0]))); } } break; } #endif if (sizeof(int) <= sizeof(long)) { __PYX_VERIFY_RETURN_INT_EXC(int, long, PyLong_AsLong(x)) #ifdef HAVE_LONG_LONG } else if (sizeof(int) <= sizeof(PY_LONG_LONG)) { __PYX_VERIFY_RETURN_INT_EXC(int, PY_LONG_LONG, PyLong_AsLongLong(x)) #endif } } { #if CYTHON_COMPILING_IN_PYPY && !defined(_PyLong_AsByteArray) PyErr_SetString(PyExc_RuntimeError, "_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers"); #else int val; PyObject *v = __Pyx_PyNumber_IntOrLong(x); #if PY_MAJOR_VERSION < 3 if (likely(v) && !PyLong_Check(v)) { PyObject *tmp = v; v = PyNumber_Long(tmp); Py_DECREF(tmp); } #endif if (likely(v)) { int one = 1; int is_little = (int)*(unsigned char *)&one; unsigned char *bytes = (unsigned char *)&val; int ret = _PyLong_AsByteArray((PyLongObject *)v, bytes, sizeof(val), is_little, !is_unsigned); Py_DECREF(v); if (likely(!ret)) return val; } #endif return (int) -1; } } else { int val; PyObject *tmp = __Pyx_PyNumber_IntOrLong(x); if (!tmp) return (int) -1; val = __Pyx_PyInt_As_int(tmp); Py_DECREF(tmp); return val; } raise_overflow: PyErr_SetString(PyExc_OverflowError, "value too large to convert to int"); return (int) -1; raise_neg_overflow: PyErr_SetString(PyExc_OverflowError, "can't convert negative value to int"); return (int) -1; } /* CIntFromPy */ static CYTHON_INLINE uint32_t __Pyx_PyInt_As_uint32_t(PyObject *x) { const uint32_t neg_one = (uint32_t) -1, const_zero = (uint32_t) 0; const int is_unsigned = neg_one > const_zero; #if PY_MAJOR_VERSION < 3 if (likely(PyInt_Check(x))) { if (sizeof(uint32_t) < sizeof(long)) { __PYX_VERIFY_RETURN_INT(uint32_t, long, PyInt_AS_LONG(x)) } else { long val = PyInt_AS_LONG(x); if (is_unsigned && unlikely(val < 0)) { goto raise_neg_overflow; } return (uint32_t) val; } } else #endif if (likely(PyLong_Check(x))) { if (is_unsigned) { #if CYTHON_USE_PYLONG_INTERNALS const digit* digits = ((PyLongObject*)x)->ob_digit; switch (Py_SIZE(x)) { case 0: return (uint32_t) 0; case 1: __PYX_VERIFY_RETURN_INT(uint32_t, digit, digits[0]) case 2: if (8 * sizeof(uint32_t) > 1 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(uint32_t, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(uint32_t) >= 2 * PyLong_SHIFT) { return (uint32_t) (((((uint32_t)digits[1]) << PyLong_SHIFT) | (uint32_t)digits[0])); } } break; case 3: if (8 * sizeof(uint32_t) > 2 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(uint32_t, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(uint32_t) >= 3 * PyLong_SHIFT) { return (uint32_t) (((((((uint32_t)digits[2]) << PyLong_SHIFT) | (uint32_t)digits[1]) << PyLong_SHIFT) | (uint32_t)digits[0])); } } break; case 4: if (8 * sizeof(uint32_t) > 3 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(uint32_t, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(uint32_t) >= 4 * PyLong_SHIFT) { return (uint32_t) (((((((((uint32_t)digits[3]) << PyLong_SHIFT) | (uint32_t)digits[2]) << PyLong_SHIFT) | (uint32_t)digits[1]) << PyLong_SHIFT) | (uint32_t)digits[0])); } } break; } #endif #if CYTHON_COMPILING_IN_CPYTHON if (unlikely(Py_SIZE(x) < 0)) { goto raise_neg_overflow; } #else { int result = PyObject_RichCompareBool(x, Py_False, Py_LT); if (unlikely(result < 0)) return (uint32_t) -1; if (unlikely(result == 1)) goto raise_neg_overflow; } #endif if (sizeof(uint32_t) <= sizeof(unsigned long)) { __PYX_VERIFY_RETURN_INT_EXC(uint32_t, unsigned long, PyLong_AsUnsignedLong(x)) #ifdef HAVE_LONG_LONG } else if (sizeof(uint32_t) <= sizeof(unsigned PY_LONG_LONG)) { __PYX_VERIFY_RETURN_INT_EXC(uint32_t, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x)) #endif } } else { #if CYTHON_USE_PYLONG_INTERNALS const digit* digits = ((PyLongObject*)x)->ob_digit; switch (Py_SIZE(x)) { case 0: return (uint32_t) 0; case -1: __PYX_VERIFY_RETURN_INT(uint32_t, sdigit, (sdigit) (-(sdigit)digits[0])) case 1: __PYX_VERIFY_RETURN_INT(uint32_t, digit, +digits[0]) case -2: if (8 * sizeof(uint32_t) - 1 > 1 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(uint32_t, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(uint32_t) - 1 > 2 * PyLong_SHIFT) { return (uint32_t) (((uint32_t)-1)*(((((uint32_t)digits[1]) << PyLong_SHIFT) | (uint32_t)digits[0]))); } } break; case 2: if (8 * sizeof(uint32_t) > 1 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(uint32_t, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(uint32_t) - 1 > 2 * PyLong_SHIFT) { return (uint32_t) ((((((uint32_t)digits[1]) << PyLong_SHIFT) | (uint32_t)digits[0]))); } } break; case -3: if (8 * sizeof(uint32_t) - 1 > 2 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(uint32_t, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(uint32_t) - 1 > 3 * PyLong_SHIFT) { return (uint32_t) (((uint32_t)-1)*(((((((uint32_t)digits[2]) << PyLong_SHIFT) | (uint32_t)digits[1]) << PyLong_SHIFT) | (uint32_t)digits[0]))); } } break; case 3: if (8 * sizeof(uint32_t) > 2 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(uint32_t, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(uint32_t) - 1 > 3 * PyLong_SHIFT) { return (uint32_t) ((((((((uint32_t)digits[2]) << PyLong_SHIFT) | (uint32_t)digits[1]) << PyLong_SHIFT) | (uint32_t)digits[0]))); } } break; case -4: if (8 * sizeof(uint32_t) - 1 > 3 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(uint32_t, long, -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(uint32_t) - 1 > 4 * PyLong_SHIFT) { return (uint32_t) (((uint32_t)-1)*(((((((((uint32_t)digits[3]) << PyLong_SHIFT) | (uint32_t)digits[2]) << PyLong_SHIFT) | (uint32_t)digits[1]) << PyLong_SHIFT) | (uint32_t)digits[0]))); } } break; case 4: if (8 * sizeof(uint32_t) > 3 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(uint32_t, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(uint32_t) - 1 > 4 * PyLong_SHIFT) { return (uint32_t) ((((((((((uint32_t)digits[3]) << PyLong_SHIFT) | (uint32_t)digits[2]) << PyLong_SHIFT) | (uint32_t)digits[1]) << PyLong_SHIFT) | (uint32_t)digits[0]))); } } break; } #endif if (sizeof(uint32_t) <= sizeof(long)) { __PYX_VERIFY_RETURN_INT_EXC(uint32_t, long, PyLong_AsLong(x)) #ifdef HAVE_LONG_LONG } else if (sizeof(uint32_t) <= sizeof(PY_LONG_LONG)) { __PYX_VERIFY_RETURN_INT_EXC(uint32_t, PY_LONG_LONG, PyLong_AsLongLong(x)) #endif } } { #if CYTHON_COMPILING_IN_PYPY && !defined(_PyLong_AsByteArray) PyErr_SetString(PyExc_RuntimeError, "_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers"); #else uint32_t val; PyObject *v = __Pyx_PyNumber_IntOrLong(x); #if PY_MAJOR_VERSION < 3 if (likely(v) && !PyLong_Check(v)) { PyObject *tmp = v; v = PyNumber_Long(tmp); Py_DECREF(tmp); } #endif if (likely(v)) { int one = 1; int is_little = (int)*(unsigned char *)&one; unsigned char *bytes = (unsigned char *)&val; int ret = _PyLong_AsByteArray((PyLongObject *)v, bytes, sizeof(val), is_little, !is_unsigned); Py_DECREF(v); if (likely(!ret)) return val; } #endif return (uint32_t) -1; } } else { uint32_t val; PyObject *tmp = __Pyx_PyNumber_IntOrLong(x); if (!tmp) return (uint32_t) -1; val = __Pyx_PyInt_As_uint32_t(tmp); Py_DECREF(tmp); return val; } raise_overflow: PyErr_SetString(PyExc_OverflowError, "value too large to convert to uint32_t"); return (uint32_t) -1; raise_neg_overflow: PyErr_SetString(PyExc_OverflowError, "can't convert negative value to uint32_t"); return (uint32_t) -1; } /* CIntFromPy */ static CYTHON_INLINE uint8_t __Pyx_PyInt_As_uint8_t(PyObject *x) { const uint8_t neg_one = (uint8_t) -1, const_zero = (uint8_t) 0; const int is_unsigned = neg_one > const_zero; #if PY_MAJOR_VERSION < 3 if (likely(PyInt_Check(x))) { if (sizeof(uint8_t) < sizeof(long)) { __PYX_VERIFY_RETURN_INT(uint8_t, long, PyInt_AS_LONG(x)) } else { long val = PyInt_AS_LONG(x); if (is_unsigned && unlikely(val < 0)) { goto raise_neg_overflow; } return (uint8_t) val; } } else #endif if (likely(PyLong_Check(x))) { if (is_unsigned) { #if CYTHON_USE_PYLONG_INTERNALS const digit* digits = ((PyLongObject*)x)->ob_digit; switch (Py_SIZE(x)) { case 0: return (uint8_t) 0; case 1: __PYX_VERIFY_RETURN_INT(uint8_t, digit, digits[0]) case 2: if (8 * sizeof(uint8_t) > 1 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(uint8_t, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(uint8_t) >= 2 * PyLong_SHIFT) { return (uint8_t) (((((uint8_t)digits[1]) << PyLong_SHIFT) | (uint8_t)digits[0])); } } break; case 3: if (8 * sizeof(uint8_t) > 2 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(uint8_t, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(uint8_t) >= 3 * PyLong_SHIFT) { return (uint8_t) (((((((uint8_t)digits[2]) << PyLong_SHIFT) | (uint8_t)digits[1]) << PyLong_SHIFT) | (uint8_t)digits[0])); } } break; case 4: if (8 * sizeof(uint8_t) > 3 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(uint8_t, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(uint8_t) >= 4 * PyLong_SHIFT) { return (uint8_t) (((((((((uint8_t)digits[3]) << PyLong_SHIFT) | (uint8_t)digits[2]) << PyLong_SHIFT) | (uint8_t)digits[1]) << PyLong_SHIFT) | (uint8_t)digits[0])); } } break; } #endif #if CYTHON_COMPILING_IN_CPYTHON if (unlikely(Py_SIZE(x) < 0)) { goto raise_neg_overflow; } #else { int result = PyObject_RichCompareBool(x, Py_False, Py_LT); if (unlikely(result < 0)) return (uint8_t) -1; if (unlikely(result == 1)) goto raise_neg_overflow; } #endif if (sizeof(uint8_t) <= sizeof(unsigned long)) { __PYX_VERIFY_RETURN_INT_EXC(uint8_t, unsigned long, PyLong_AsUnsignedLong(x)) #ifdef HAVE_LONG_LONG } else if (sizeof(uint8_t) <= sizeof(unsigned PY_LONG_LONG)) { __PYX_VERIFY_RETURN_INT_EXC(uint8_t, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x)) #endif } } else { #if CYTHON_USE_PYLONG_INTERNALS const digit* digits = ((PyLongObject*)x)->ob_digit; switch (Py_SIZE(x)) { case 0: return (uint8_t) 0; case -1: __PYX_VERIFY_RETURN_INT(uint8_t, sdigit, (sdigit) (-(sdigit)digits[0])) case 1: __PYX_VERIFY_RETURN_INT(uint8_t, digit, +digits[0]) case -2: if (8 * sizeof(uint8_t) - 1 > 1 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(uint8_t, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(uint8_t) - 1 > 2 * PyLong_SHIFT) { return (uint8_t) (((uint8_t)-1)*(((((uint8_t)digits[1]) << PyLong_SHIFT) | (uint8_t)digits[0]))); } } break; case 2: if (8 * sizeof(uint8_t) > 1 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(uint8_t, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(uint8_t) - 1 > 2 * PyLong_SHIFT) { return (uint8_t) ((((((uint8_t)digits[1]) << PyLong_SHIFT) | (uint8_t)digits[0]))); } } break; case -3: if (8 * sizeof(uint8_t) - 1 > 2 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(uint8_t, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(uint8_t) - 1 > 3 * PyLong_SHIFT) { return (uint8_t) (((uint8_t)-1)*(((((((uint8_t)digits[2]) << PyLong_SHIFT) | (uint8_t)digits[1]) << PyLong_SHIFT) | (uint8_t)digits[0]))); } } break; case 3: if (8 * sizeof(uint8_t) > 2 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(uint8_t, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(uint8_t) - 1 > 3 * PyLong_SHIFT) { return (uint8_t) ((((((((uint8_t)digits[2]) << PyLong_SHIFT) | (uint8_t)digits[1]) << PyLong_SHIFT) | (uint8_t)digits[0]))); } } break; case -4: if (8 * sizeof(uint8_t) - 1 > 3 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(uint8_t, long, -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(uint8_t) - 1 > 4 * PyLong_SHIFT) { return (uint8_t) (((uint8_t)-1)*(((((((((uint8_t)digits[3]) << PyLong_SHIFT) | (uint8_t)digits[2]) << PyLong_SHIFT) | (uint8_t)digits[1]) << PyLong_SHIFT) | (uint8_t)digits[0]))); } } break; case 4: if (8 * sizeof(uint8_t) > 3 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(uint8_t, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(uint8_t) - 1 > 4 * PyLong_SHIFT) { return (uint8_t) ((((((((((uint8_t)digits[3]) << PyLong_SHIFT) | (uint8_t)digits[2]) << PyLong_SHIFT) | (uint8_t)digits[1]) << PyLong_SHIFT) | (uint8_t)digits[0]))); } } break; } #endif if (sizeof(uint8_t) <= sizeof(long)) { __PYX_VERIFY_RETURN_INT_EXC(uint8_t, long, PyLong_AsLong(x)) #ifdef HAVE_LONG_LONG } else if (sizeof(uint8_t) <= sizeof(PY_LONG_LONG)) { __PYX_VERIFY_RETURN_INT_EXC(uint8_t, PY_LONG_LONG, PyLong_AsLongLong(x)) #endif } } { #if CYTHON_COMPILING_IN_PYPY && !defined(_PyLong_AsByteArray) PyErr_SetString(PyExc_RuntimeError, "_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers"); #else uint8_t val; PyObject *v = __Pyx_PyNumber_IntOrLong(x); #if PY_MAJOR_VERSION < 3 if (likely(v) && !PyLong_Check(v)) { PyObject *tmp = v; v = PyNumber_Long(tmp); Py_DECREF(tmp); } #endif if (likely(v)) { int one = 1; int is_little = (int)*(unsigned char *)&one; unsigned char *bytes = (unsigned char *)&val; int ret = _PyLong_AsByteArray((PyLongObject *)v, bytes, sizeof(val), is_little, !is_unsigned); Py_DECREF(v); if (likely(!ret)) return val; } #endif return (uint8_t) -1; } } else { uint8_t val; PyObject *tmp = __Pyx_PyNumber_IntOrLong(x); if (!tmp) return (uint8_t) -1; val = __Pyx_PyInt_As_uint8_t(tmp); Py_DECREF(tmp); return val; } raise_overflow: PyErr_SetString(PyExc_OverflowError, "value too large to convert to uint8_t"); return (uint8_t) -1; raise_neg_overflow: PyErr_SetString(PyExc_OverflowError, "can't convert negative value to uint8_t"); return (uint8_t) -1; } /* CIntFromPy */ static CYTHON_INLINE long __Pyx_PyInt_As_long(PyObject *x) { const long neg_one = (long) -1, const_zero = (long) 0; const int is_unsigned = neg_one > const_zero; #if PY_MAJOR_VERSION < 3 if (likely(PyInt_Check(x))) { if (sizeof(long) < sizeof(long)) { __PYX_VERIFY_RETURN_INT(long, long, PyInt_AS_LONG(x)) } else { long val = PyInt_AS_LONG(x); if (is_unsigned && unlikely(val < 0)) { goto raise_neg_overflow; } return (long) val; } } else #endif if (likely(PyLong_Check(x))) { if (is_unsigned) { #if CYTHON_USE_PYLONG_INTERNALS const digit* digits = ((PyLongObject*)x)->ob_digit; switch (Py_SIZE(x)) { case 0: return (long) 0; case 1: __PYX_VERIFY_RETURN_INT(long, digit, digits[0]) case 2: if (8 * sizeof(long) > 1 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(long) >= 2 * PyLong_SHIFT) { return (long) (((((long)digits[1]) << PyLong_SHIFT) | (long)digits[0])); } } break; case 3: if (8 * sizeof(long) > 2 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(long) >= 3 * PyLong_SHIFT) { return (long) (((((((long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0])); } } break; case 4: if (8 * sizeof(long) > 3 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(long) >= 4 * PyLong_SHIFT) { return (long) (((((((((long)digits[3]) << PyLong_SHIFT) | (long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0])); } } break; } #endif #if CYTHON_COMPILING_IN_CPYTHON if (unlikely(Py_SIZE(x) < 0)) { goto raise_neg_overflow; } #else { int result = PyObject_RichCompareBool(x, Py_False, Py_LT); if (unlikely(result < 0)) return (long) -1; if (unlikely(result == 1)) goto raise_neg_overflow; } #endif if (sizeof(long) <= sizeof(unsigned long)) { __PYX_VERIFY_RETURN_INT_EXC(long, unsigned long, PyLong_AsUnsignedLong(x)) #ifdef HAVE_LONG_LONG } else if (sizeof(long) <= sizeof(unsigned PY_LONG_LONG)) { __PYX_VERIFY_RETURN_INT_EXC(long, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x)) #endif } } else { #if CYTHON_USE_PYLONG_INTERNALS const digit* digits = ((PyLongObject*)x)->ob_digit; switch (Py_SIZE(x)) { case 0: return (long) 0; case -1: __PYX_VERIFY_RETURN_INT(long, sdigit, (sdigit) (-(sdigit)digits[0])) case 1: __PYX_VERIFY_RETURN_INT(long, digit, +digits[0]) case -2: if (8 * sizeof(long) - 1 > 1 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(long, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) { return (long) (((long)-1)*(((((long)digits[1]) << PyLong_SHIFT) | (long)digits[0]))); } } break; case 2: if (8 * sizeof(long) > 1 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) { return (long) ((((((long)digits[1]) << PyLong_SHIFT) | (long)digits[0]))); } } break; case -3: if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(long, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) { return (long) (((long)-1)*(((((((long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0]))); } } break; case 3: if (8 * sizeof(long) > 2 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) { return (long) ((((((((long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0]))); } } break; case -4: if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(long, long, -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(long) - 1 > 4 * PyLong_SHIFT) { return (long) (((long)-1)*(((((((((long)digits[3]) << PyLong_SHIFT) | (long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0]))); } } break; case 4: if (8 * sizeof(long) > 3 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(long) - 1 > 4 * PyLong_SHIFT) { return (long) ((((((((((long)digits[3]) << PyLong_SHIFT) | (long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0]))); } } break; } #endif if (sizeof(long) <= sizeof(long)) { __PYX_VERIFY_RETURN_INT_EXC(long, long, PyLong_AsLong(x)) #ifdef HAVE_LONG_LONG } else if (sizeof(long) <= sizeof(PY_LONG_LONG)) { __PYX_VERIFY_RETURN_INT_EXC(long, PY_LONG_LONG, PyLong_AsLongLong(x)) #endif } } { #if CYTHON_COMPILING_IN_PYPY && !defined(_PyLong_AsByteArray) PyErr_SetString(PyExc_RuntimeError, "_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers"); #else long val; PyObject *v = __Pyx_PyNumber_IntOrLong(x); #if PY_MAJOR_VERSION < 3 if (likely(v) && !PyLong_Check(v)) { PyObject *tmp = v; v = PyNumber_Long(tmp); Py_DECREF(tmp); } #endif if (likely(v)) { int one = 1; int is_little = (int)*(unsigned char *)&one; unsigned char *bytes = (unsigned char *)&val; int ret = _PyLong_AsByteArray((PyLongObject *)v, bytes, sizeof(val), is_little, !is_unsigned); Py_DECREF(v); if (likely(!ret)) return val; } #endif return (long) -1; } } else { long val; PyObject *tmp = __Pyx_PyNumber_IntOrLong(x); if (!tmp) return (long) -1; val = __Pyx_PyInt_As_long(tmp); Py_DECREF(tmp); return val; } raise_overflow: PyErr_SetString(PyExc_OverflowError, "value too large to convert to long"); return (long) -1; raise_neg_overflow: PyErr_SetString(PyExc_OverflowError, "can't convert negative value to long"); return (long) -1; } /* CheckBinaryVersion */ static int __Pyx_check_binary_version(void) { char ctversion[4], rtversion[4]; PyOS_snprintf(ctversion, 4, "%d.%d", PY_MAJOR_VERSION, PY_MINOR_VERSION); PyOS_snprintf(rtversion, 4, "%s", Py_GetVersion()); if (ctversion[0] != rtversion[0] || ctversion[2] != rtversion[2]) { char message[200]; PyOS_snprintf(message, sizeof(message), "compiletime version %s of module '%.100s' " "does not match runtime version %s", ctversion, __Pyx_MODULE_NAME, rtversion); return PyErr_WarnEx(NULL, message, 1); } return 0; } /* FunctionExport */ static int __Pyx_ExportFunction(const char *name, void (*f)(void), const char *sig) { PyObject *d = 0; PyObject *cobj = 0; union { void (*fp)(void); void *p; } tmp; d = PyObject_GetAttrString(__pyx_m, (char *)"__pyx_capi__"); if (!d) { PyErr_Clear(); d = PyDict_New(); if (!d) goto bad; Py_INCREF(d); if (PyModule_AddObject(__pyx_m, (char *)"__pyx_capi__", d) < 0) goto bad; } tmp.fp = f; #if PY_VERSION_HEX >= 0x02070000 cobj = PyCapsule_New(tmp.p, sig, 0); #else cobj = PyCObject_FromVoidPtrAndDesc(tmp.p, (void *)sig, 0); #endif if (!cobj) goto bad; if (PyDict_SetItemString(d, name, cobj) < 0) goto bad; Py_DECREF(cobj); Py_DECREF(d); return 0; bad: Py_XDECREF(cobj); Py_XDECREF(d); return -1; } /* ModuleImport */ #ifndef __PYX_HAVE_RT_ImportModule #define __PYX_HAVE_RT_ImportModule static PyObject *__Pyx_ImportModule(const char *name) { PyObject *py_name = 0; PyObject *py_module = 0; py_name = __Pyx_PyIdentifier_FromString(name); if (!py_name) goto bad; py_module = PyImport_Import(py_name); Py_DECREF(py_name); return py_module; bad: Py_XDECREF(py_name); return 0; } #endif /* TypeImport */ #ifndef __PYX_HAVE_RT_ImportType #define __PYX_HAVE_RT_ImportType static PyTypeObject *__Pyx_ImportType(const char *module_name, const char *class_name, size_t size, int strict) { PyObject *py_module = 0; PyObject *result = 0; PyObject *py_name = 0; char warning[200]; Py_ssize_t basicsize; #ifdef Py_LIMITED_API PyObject *py_basicsize; #endif py_module = __Pyx_ImportModule(module_name); if (!py_module) goto bad; py_name = __Pyx_PyIdentifier_FromString(class_name); if (!py_name) goto bad; result = PyObject_GetAttr(py_module, py_name); Py_DECREF(py_name); py_name = 0; Py_DECREF(py_module); py_module = 0; if (!result) goto bad; if (!PyType_Check(result)) { PyErr_Format(PyExc_TypeError, "%.200s.%.200s is not a type object", module_name, class_name); goto bad; } #ifndef Py_LIMITED_API basicsize = ((PyTypeObject *)result)->tp_basicsize; #else py_basicsize = PyObject_GetAttrString(result, "__basicsize__"); if (!py_basicsize) goto bad; basicsize = PyLong_AsSsize_t(py_basicsize); Py_DECREF(py_basicsize); py_basicsize = 0; if (basicsize == (Py_ssize_t)-1 && PyErr_Occurred()) goto bad; #endif if (!strict && (size_t)basicsize > size) { PyOS_snprintf(warning, sizeof(warning), "%s.%s size changed, may indicate binary incompatibility. Expected %zd, got %zd", module_name, class_name, basicsize, size); if (PyErr_WarnEx(NULL, warning, 0) < 0) goto bad; } else if ((size_t)basicsize != size) { PyErr_Format(PyExc_ValueError, "%.200s.%.200s has the wrong size, try recompiling. Expected %zd, got %zd", module_name, class_name, basicsize, size); goto bad; } return (PyTypeObject *)result; bad: Py_XDECREF(py_module); Py_XDECREF(result); return NULL; } #endif /* FunctionImport */ #ifndef __PYX_HAVE_RT_ImportFunction #define __PYX_HAVE_RT_ImportFunction static int __Pyx_ImportFunction(PyObject *module, const char *funcname, void (**f)(void), const char *sig) { PyObject *d = 0; PyObject *cobj = 0; union { void (*fp)(void); void *p; } tmp; d = PyObject_GetAttrString(module, (char *)"__pyx_capi__"); if (!d) goto bad; cobj = PyDict_GetItemString(d, funcname); if (!cobj) { PyErr_Format(PyExc_ImportError, "%.200s does not export expected C function %.200s", PyModule_GetName(module), funcname); goto bad; } #if PY_VERSION_HEX >= 0x02070000 if (!PyCapsule_IsValid(cobj, sig)) { PyErr_Format(PyExc_TypeError, "C function %.200s.%.200s has wrong signature (expected %.500s, got %.500s)", PyModule_GetName(module), funcname, sig, PyCapsule_GetName(cobj)); goto bad; } tmp.p = PyCapsule_GetPointer(cobj, sig); #else {const char *desc, *s1, *s2; desc = (const char *)PyCObject_GetDesc(cobj); if (!desc) goto bad; s1 = desc; s2 = sig; while (*s1 != '\0' && *s1 == *s2) { s1++; s2++; } if (*s1 != *s2) { PyErr_Format(PyExc_TypeError, "C function %.200s.%.200s has wrong signature (expected %.500s, got %.500s)", PyModule_GetName(module), funcname, sig, desc); goto bad; } tmp.p = PyCObject_AsVoidPtr(cobj);} #endif *f = tmp.fp; if (!(*f)) goto bad; Py_DECREF(d); return 0; bad: Py_XDECREF(d); return -1; } #endif /* InitStrings */ static int __Pyx_InitStrings(__Pyx_StringTabEntry *t) { while (t->p) { #if PY_MAJOR_VERSION < 3 if (t->is_unicode) { *t->p = PyUnicode_DecodeUTF8(t->s, t->n - 1, NULL); } else if (t->intern) { *t->p = PyString_InternFromString(t->s); } else { *t->p = PyString_FromStringAndSize(t->s, t->n - 1); } #else if (t->is_unicode | t->is_str) { if (t->intern) { *t->p = PyUnicode_InternFromString(t->s); } else if (t->encoding) { *t->p = PyUnicode_Decode(t->s, t->n - 1, t->encoding, NULL); } else { *t->p = PyUnicode_FromStringAndSize(t->s, t->n - 1); } } else { *t->p = PyBytes_FromStringAndSize(t->s, t->n - 1); } #endif if (!*t->p) return -1; ++t; } return 0; } static CYTHON_INLINE PyObject* __Pyx_PyUnicode_FromString(const char* c_str) { return __Pyx_PyUnicode_FromStringAndSize(c_str, (Py_ssize_t)strlen(c_str)); } static CYTHON_INLINE char* __Pyx_PyObject_AsString(PyObject* o) { Py_ssize_t ignore; return __Pyx_PyObject_AsStringAndSize(o, &ignore); } static CYTHON_INLINE char* __Pyx_PyObject_AsStringAndSize(PyObject* o, Py_ssize_t *length) { #if CYTHON_COMPILING_IN_CPYTHON && (__PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT) if ( #if PY_MAJOR_VERSION < 3 && __PYX_DEFAULT_STRING_ENCODING_IS_ASCII __Pyx_sys_getdefaultencoding_not_ascii && #endif PyUnicode_Check(o)) { #if PY_VERSION_HEX < 0x03030000 char* defenc_c; PyObject* defenc = _PyUnicode_AsDefaultEncodedString(o, NULL); if (!defenc) return NULL; defenc_c = PyBytes_AS_STRING(defenc); #if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII { char* end = defenc_c + PyBytes_GET_SIZE(defenc); char* c; for (c = defenc_c; c < end; c++) { if ((unsigned char) (*c) >= 128) { PyUnicode_AsASCIIString(o); return NULL; } } } #endif *length = PyBytes_GET_SIZE(defenc); return defenc_c; #else if (__Pyx_PyUnicode_READY(o) == -1) return NULL; #if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII if (PyUnicode_IS_ASCII(o)) { *length = PyUnicode_GET_LENGTH(o); return PyUnicode_AsUTF8(o); } else { PyUnicode_AsASCIIString(o); return NULL; } #else return PyUnicode_AsUTF8AndSize(o, length); #endif #endif } else #endif #if (!CYTHON_COMPILING_IN_PYPY) || (defined(PyByteArray_AS_STRING) && defined(PyByteArray_GET_SIZE)) if (PyByteArray_Check(o)) { *length = PyByteArray_GET_SIZE(o); return PyByteArray_AS_STRING(o); } else #endif { char* result; int r = PyBytes_AsStringAndSize(o, &result, length); if (unlikely(r < 0)) { return NULL; } else { return result; } } } static CYTHON_INLINE int __Pyx_PyObject_IsTrue(PyObject* x) { int is_true = x == Py_True; if (is_true | (x == Py_False) | (x == Py_None)) return is_true; else return PyObject_IsTrue(x); } static CYTHON_INLINE PyObject* __Pyx_PyNumber_IntOrLong(PyObject* x) { #if CYTHON_USE_TYPE_SLOTS PyNumberMethods *m; #endif const char *name = NULL; PyObject *res = NULL; #if PY_MAJOR_VERSION < 3 if (PyInt_Check(x) || PyLong_Check(x)) #else if (PyLong_Check(x)) #endif return __Pyx_NewRef(x); #if CYTHON_USE_TYPE_SLOTS m = Py_TYPE(x)->tp_as_number; #if PY_MAJOR_VERSION < 3 if (m && m->nb_int) { name = "int"; res = PyNumber_Int(x); } else if (m && m->nb_long) { name = "long"; res = PyNumber_Long(x); } #else if (m && m->nb_int) { name = "int"; res = PyNumber_Long(x); } #endif #else res = PyNumber_Int(x); #endif if (res) { #if PY_MAJOR_VERSION < 3 if (!PyInt_Check(res) && !PyLong_Check(res)) { #else if (!PyLong_Check(res)) { #endif PyErr_Format(PyExc_TypeError, "__%.4s__ returned non-%.4s (type %.200s)", name, name, Py_TYPE(res)->tp_name); Py_DECREF(res); return NULL; } } else if (!PyErr_Occurred()) { PyErr_SetString(PyExc_TypeError, "an integer is required"); } return res; } static CYTHON_INLINE Py_ssize_t __Pyx_PyIndex_AsSsize_t(PyObject* b) { Py_ssize_t ival; PyObject *x; #if PY_MAJOR_VERSION < 3 if (likely(PyInt_CheckExact(b))) { if (sizeof(Py_ssize_t) >= sizeof(long)) return PyInt_AS_LONG(b); else return PyInt_AsSsize_t(x); } #endif if (likely(PyLong_CheckExact(b))) { #if CYTHON_USE_PYLONG_INTERNALS const digit* digits = ((PyLongObject*)b)->ob_digit; const Py_ssize_t size = Py_SIZE(b); if (likely(__Pyx_sst_abs(size) <= 1)) { ival = likely(size) ? digits[0] : 0; if (size == -1) ival = -ival; return ival; } else { switch (size) { case 2: if (8 * sizeof(Py_ssize_t) > 2 * PyLong_SHIFT) { return (Py_ssize_t) (((((size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])); } break; case -2: if (8 * sizeof(Py_ssize_t) > 2 * PyLong_SHIFT) { return -(Py_ssize_t) (((((size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])); } break; case 3: if (8 * sizeof(Py_ssize_t) > 3 * PyLong_SHIFT) { return (Py_ssize_t) (((((((size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])); } break; case -3: if (8 * sizeof(Py_ssize_t) > 3 * PyLong_SHIFT) { return -(Py_ssize_t) (((((((size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])); } break; case 4: if (8 * sizeof(Py_ssize_t) > 4 * PyLong_SHIFT) { return (Py_ssize_t) (((((((((size_t)digits[3]) << PyLong_SHIFT) | (size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])); } break; case -4: if (8 * sizeof(Py_ssize_t) > 4 * PyLong_SHIFT) { return -(Py_ssize_t) (((((((((size_t)digits[3]) << PyLong_SHIFT) | (size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])); } break; } } #endif return PyLong_AsSsize_t(b); } x = PyNumber_Index(b); if (!x) return -1; ival = PyInt_AsSsize_t(x); Py_DECREF(x); return ival; } static CYTHON_INLINE PyObject * __Pyx_PyInt_FromSize_t(size_t ival) { return PyInt_FromSize_t(ival); } #endif /* Py_PYTHON_H */ pygame_sdl2-2.1.0-for-renpy-6.99.14.1/gen/pygame_sdl2.error.c0000664000175000017500000035600212660477764022552 0ustar tomtom00000000000000/* Generated by Cython 0.23.4 */ #define PY_SSIZE_T_CLEAN #include "Python.h" #ifndef Py_PYTHON_H #error Python headers needed to compile C extensions, please install development version of Python. #elif PY_VERSION_HEX < 0x02060000 || (0x03000000 <= PY_VERSION_HEX && PY_VERSION_HEX < 0x03020000) #error Cython requires Python 2.6+ or Python 3.2+. #else #define CYTHON_ABI "0_23_4" #include #ifndef offsetof #define offsetof(type, member) ( (size_t) & ((type*)0) -> member ) #endif #if !defined(WIN32) && !defined(MS_WINDOWS) #ifndef __stdcall #define __stdcall #endif #ifndef __cdecl #define __cdecl #endif #ifndef __fastcall #define __fastcall #endif #endif #ifndef DL_IMPORT #define DL_IMPORT(t) t #endif #ifndef DL_EXPORT #define DL_EXPORT(t) t #endif #ifndef PY_LONG_LONG #define PY_LONG_LONG LONG_LONG #endif #ifndef Py_HUGE_VAL #define Py_HUGE_VAL HUGE_VAL #endif #ifdef PYPY_VERSION #define CYTHON_COMPILING_IN_PYPY 1 #define CYTHON_COMPILING_IN_CPYTHON 0 #else #define CYTHON_COMPILING_IN_PYPY 0 #define CYTHON_COMPILING_IN_CPYTHON 1 #endif #if !defined(CYTHON_USE_PYLONG_INTERNALS) && CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x02070000 #define CYTHON_USE_PYLONG_INTERNALS 1 #endif #if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX < 0x02070600 && !defined(Py_OptimizeFlag) #define Py_OptimizeFlag 0 #endif #define __PYX_BUILD_PY_SSIZE_T "n" #define CYTHON_FORMAT_SSIZE_T "z" #if PY_MAJOR_VERSION < 3 #define __Pyx_BUILTIN_MODULE_NAME "__builtin__" #define __Pyx_PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)\ PyCode_New(a+k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos) #define __Pyx_DefaultClassType PyClass_Type #else #define __Pyx_BUILTIN_MODULE_NAME "builtins" #define __Pyx_PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)\ PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos) #define __Pyx_DefaultClassType PyType_Type #endif #ifndef Py_TPFLAGS_CHECKTYPES #define Py_TPFLAGS_CHECKTYPES 0 #endif #ifndef Py_TPFLAGS_HAVE_INDEX #define Py_TPFLAGS_HAVE_INDEX 0 #endif #ifndef Py_TPFLAGS_HAVE_NEWBUFFER #define Py_TPFLAGS_HAVE_NEWBUFFER 0 #endif #ifndef Py_TPFLAGS_HAVE_FINALIZE #define Py_TPFLAGS_HAVE_FINALIZE 0 #endif #if PY_VERSION_HEX > 0x03030000 && defined(PyUnicode_KIND) #define CYTHON_PEP393_ENABLED 1 #define __Pyx_PyUnicode_READY(op) (likely(PyUnicode_IS_READY(op)) ?\ 0 : _PyUnicode_Ready((PyObject *)(op))) #define __Pyx_PyUnicode_GET_LENGTH(u) PyUnicode_GET_LENGTH(u) #define __Pyx_PyUnicode_READ_CHAR(u, i) PyUnicode_READ_CHAR(u, i) #define __Pyx_PyUnicode_KIND(u) PyUnicode_KIND(u) #define __Pyx_PyUnicode_DATA(u) PyUnicode_DATA(u) #define __Pyx_PyUnicode_READ(k, d, i) PyUnicode_READ(k, d, i) #else #define CYTHON_PEP393_ENABLED 0 #define __Pyx_PyUnicode_READY(op) (0) #define __Pyx_PyUnicode_GET_LENGTH(u) PyUnicode_GET_SIZE(u) #define __Pyx_PyUnicode_READ_CHAR(u, i) ((Py_UCS4)(PyUnicode_AS_UNICODE(u)[i])) #define __Pyx_PyUnicode_KIND(u) (sizeof(Py_UNICODE)) #define __Pyx_PyUnicode_DATA(u) ((void*)PyUnicode_AS_UNICODE(u)) #define __Pyx_PyUnicode_READ(k, d, i) ((void)(k), (Py_UCS4)(((Py_UNICODE*)d)[i])) #endif #if CYTHON_COMPILING_IN_PYPY #define __Pyx_PyUnicode_Concat(a, b) PyNumber_Add(a, b) #define __Pyx_PyUnicode_ConcatSafe(a, b) PyNumber_Add(a, b) #else #define __Pyx_PyUnicode_Concat(a, b) PyUnicode_Concat(a, b) #define __Pyx_PyUnicode_ConcatSafe(a, b) ((unlikely((a) == Py_None) || unlikely((b) == Py_None)) ?\ PyNumber_Add(a, b) : __Pyx_PyUnicode_Concat(a, b)) #endif #if CYTHON_COMPILING_IN_PYPY && !defined(PyUnicode_Contains) #define PyUnicode_Contains(u, s) PySequence_Contains(u, s) #endif #define __Pyx_PyString_FormatSafe(a, b) ((unlikely((a) == Py_None)) ? PyNumber_Remainder(a, b) : __Pyx_PyString_Format(a, b)) #define __Pyx_PyUnicode_FormatSafe(a, b) ((unlikely((a) == Py_None)) ? PyNumber_Remainder(a, b) : PyUnicode_Format(a, b)) #if PY_MAJOR_VERSION >= 3 #define __Pyx_PyString_Format(a, b) PyUnicode_Format(a, b) #else #define __Pyx_PyString_Format(a, b) PyString_Format(a, b) #endif #if PY_MAJOR_VERSION >= 3 #define PyBaseString_Type PyUnicode_Type #define PyStringObject PyUnicodeObject #define PyString_Type PyUnicode_Type #define PyString_Check PyUnicode_Check #define PyString_CheckExact PyUnicode_CheckExact #endif #if PY_MAJOR_VERSION >= 3 #define __Pyx_PyBaseString_Check(obj) PyUnicode_Check(obj) #define __Pyx_PyBaseString_CheckExact(obj) PyUnicode_CheckExact(obj) #else #define __Pyx_PyBaseString_Check(obj) (PyString_Check(obj) || PyUnicode_Check(obj)) #define __Pyx_PyBaseString_CheckExact(obj) (PyString_CheckExact(obj) || PyUnicode_CheckExact(obj)) #endif #ifndef PySet_CheckExact #define PySet_CheckExact(obj) (Py_TYPE(obj) == &PySet_Type) #endif #define __Pyx_TypeCheck(obj, type) PyObject_TypeCheck(obj, (PyTypeObject *)type) #if PY_MAJOR_VERSION >= 3 #define PyIntObject PyLongObject #define PyInt_Type PyLong_Type #define PyInt_Check(op) PyLong_Check(op) #define PyInt_CheckExact(op) PyLong_CheckExact(op) #define PyInt_FromString PyLong_FromString #define PyInt_FromUnicode PyLong_FromUnicode #define PyInt_FromLong PyLong_FromLong #define PyInt_FromSize_t PyLong_FromSize_t #define PyInt_FromSsize_t PyLong_FromSsize_t #define PyInt_AsLong PyLong_AsLong #define PyInt_AS_LONG PyLong_AS_LONG #define PyInt_AsSsize_t PyLong_AsSsize_t #define PyInt_AsUnsignedLongMask PyLong_AsUnsignedLongMask #define PyInt_AsUnsignedLongLongMask PyLong_AsUnsignedLongLongMask #define PyNumber_Int PyNumber_Long #endif #if PY_MAJOR_VERSION >= 3 #define PyBoolObject PyLongObject #endif #if PY_MAJOR_VERSION >= 3 && CYTHON_COMPILING_IN_PYPY #ifndef PyUnicode_InternFromString #define PyUnicode_InternFromString(s) PyUnicode_FromString(s) #endif #endif #if PY_VERSION_HEX < 0x030200A4 typedef long Py_hash_t; #define __Pyx_PyInt_FromHash_t PyInt_FromLong #define __Pyx_PyInt_AsHash_t PyInt_AsLong #else #define __Pyx_PyInt_FromHash_t PyInt_FromSsize_t #define __Pyx_PyInt_AsHash_t PyInt_AsSsize_t #endif #if PY_MAJOR_VERSION >= 3 #define __Pyx_PyMethod_New(func, self, klass) ((self) ? PyMethod_New(func, self) : PyInstanceMethod_New(func)) #else #define __Pyx_PyMethod_New(func, self, klass) PyMethod_New(func, self, klass) #endif #if PY_VERSION_HEX >= 0x030500B1 #define __Pyx_PyAsyncMethodsStruct PyAsyncMethods #define __Pyx_PyType_AsAsync(obj) (Py_TYPE(obj)->tp_as_async) #elif CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3 typedef struct { unaryfunc am_await; unaryfunc am_aiter; unaryfunc am_anext; } __Pyx_PyAsyncMethodsStruct; #define __Pyx_PyType_AsAsync(obj) ((__Pyx_PyAsyncMethodsStruct*) (Py_TYPE(obj)->tp_reserved)) #else #define __Pyx_PyType_AsAsync(obj) NULL #endif #ifndef CYTHON_RESTRICT #if defined(__GNUC__) #define CYTHON_RESTRICT __restrict__ #elif defined(_MSC_VER) && _MSC_VER >= 1400 #define CYTHON_RESTRICT __restrict #elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L #define CYTHON_RESTRICT restrict #else #define CYTHON_RESTRICT #endif #endif #define __Pyx_void_to_None(void_result) ((void)(void_result), Py_INCREF(Py_None), Py_None) #ifndef CYTHON_INLINE #if defined(__GNUC__) #define CYTHON_INLINE __inline__ #elif defined(_MSC_VER) #define CYTHON_INLINE __inline #elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L #define CYTHON_INLINE inline #else #define CYTHON_INLINE #endif #endif #if defined(WIN32) || defined(MS_WINDOWS) #define _USE_MATH_DEFINES #endif #include #ifdef NAN #define __PYX_NAN() ((float) NAN) #else static CYTHON_INLINE float __PYX_NAN() { float value; memset(&value, 0xFF, sizeof(value)); return value; } #endif #if PY_MAJOR_VERSION >= 3 #define __Pyx_PyNumber_Divide(x,y) PyNumber_TrueDivide(x,y) #define __Pyx_PyNumber_InPlaceDivide(x,y) PyNumber_InPlaceTrueDivide(x,y) #else #define __Pyx_PyNumber_Divide(x,y) PyNumber_Divide(x,y) #define __Pyx_PyNumber_InPlaceDivide(x,y) PyNumber_InPlaceDivide(x,y) #endif #ifndef __PYX_EXTERN_C #ifdef __cplusplus #define __PYX_EXTERN_C extern "C" #else #define __PYX_EXTERN_C extern #endif #endif #define __PYX_HAVE__pygame_sdl2__error #define __PYX_HAVE_API__pygame_sdl2__error #include "stdint.h" #include "string.h" #include "stdio.h" #include "stddef.h" #include "SDL.h" #ifdef _OPENMP #include #endif /* _OPENMP */ #ifdef PYREX_WITHOUT_ASSERTIONS #define CYTHON_WITHOUT_ASSERTIONS #endif #ifndef CYTHON_UNUSED # if defined(__GNUC__) # if !(defined(__cplusplus)) || (__GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 4)) # define CYTHON_UNUSED __attribute__ ((__unused__)) # else # define CYTHON_UNUSED # endif # elif defined(__ICC) || (defined(__INTEL_COMPILER) && !defined(_MSC_VER)) # define CYTHON_UNUSED __attribute__ ((__unused__)) # else # define CYTHON_UNUSED # endif #endif #ifndef CYTHON_NCP_UNUSED # if CYTHON_COMPILING_IN_CPYTHON # define CYTHON_NCP_UNUSED # else # define CYTHON_NCP_UNUSED CYTHON_UNUSED # endif #endif typedef struct {PyObject **p; char *s; const Py_ssize_t n; const char* encoding; const char is_unicode; const char is_str; const char intern; } __Pyx_StringTabEntry; #define __PYX_DEFAULT_STRING_ENCODING_IS_ASCII 0 #define __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT 0 #define __PYX_DEFAULT_STRING_ENCODING "" #define __Pyx_PyObject_FromString __Pyx_PyBytes_FromString #define __Pyx_PyObject_FromStringAndSize __Pyx_PyBytes_FromStringAndSize #define __Pyx_uchar_cast(c) ((unsigned char)c) #define __Pyx_long_cast(x) ((long)x) #define __Pyx_fits_Py_ssize_t(v, type, is_signed) (\ (sizeof(type) < sizeof(Py_ssize_t)) ||\ (sizeof(type) > sizeof(Py_ssize_t) &&\ likely(v < (type)PY_SSIZE_T_MAX ||\ v == (type)PY_SSIZE_T_MAX) &&\ (!is_signed || likely(v > (type)PY_SSIZE_T_MIN ||\ v == (type)PY_SSIZE_T_MIN))) ||\ (sizeof(type) == sizeof(Py_ssize_t) &&\ (is_signed || likely(v < (type)PY_SSIZE_T_MAX ||\ v == (type)PY_SSIZE_T_MAX))) ) #if defined (__cplusplus) && __cplusplus >= 201103L #include #define __Pyx_sst_abs(value) std::abs(value) #elif SIZEOF_INT >= SIZEOF_SIZE_T #define __Pyx_sst_abs(value) abs(value) #elif SIZEOF_LONG >= SIZEOF_SIZE_T #define __Pyx_sst_abs(value) labs(value) #elif defined (_MSC_VER) && defined (_M_X64) #define __Pyx_sst_abs(value) _abs64(value) #elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L #define __Pyx_sst_abs(value) llabs(value) #elif defined (__GNUC__) #define __Pyx_sst_abs(value) __builtin_llabs(value) #else #define __Pyx_sst_abs(value) ((value<0) ? -value : value) #endif static CYTHON_INLINE char* __Pyx_PyObject_AsString(PyObject*); static CYTHON_INLINE char* __Pyx_PyObject_AsStringAndSize(PyObject*, Py_ssize_t* length); #define __Pyx_PyByteArray_FromString(s) PyByteArray_FromStringAndSize((const char*)s, strlen((const char*)s)) #define __Pyx_PyByteArray_FromStringAndSize(s, l) PyByteArray_FromStringAndSize((const char*)s, l) #define __Pyx_PyBytes_FromString PyBytes_FromString #define __Pyx_PyBytes_FromStringAndSize PyBytes_FromStringAndSize static CYTHON_INLINE PyObject* __Pyx_PyUnicode_FromString(const char*); #if PY_MAJOR_VERSION < 3 #define __Pyx_PyStr_FromString __Pyx_PyBytes_FromString #define __Pyx_PyStr_FromStringAndSize __Pyx_PyBytes_FromStringAndSize #else #define __Pyx_PyStr_FromString __Pyx_PyUnicode_FromString #define __Pyx_PyStr_FromStringAndSize __Pyx_PyUnicode_FromStringAndSize #endif #define __Pyx_PyObject_AsSString(s) ((signed char*) __Pyx_PyObject_AsString(s)) #define __Pyx_PyObject_AsUString(s) ((unsigned char*) __Pyx_PyObject_AsString(s)) #define __Pyx_PyObject_FromCString(s) __Pyx_PyObject_FromString((const char*)s) #define __Pyx_PyBytes_FromCString(s) __Pyx_PyBytes_FromString((const char*)s) #define __Pyx_PyByteArray_FromCString(s) __Pyx_PyByteArray_FromString((const char*)s) #define __Pyx_PyStr_FromCString(s) __Pyx_PyStr_FromString((const char*)s) #define __Pyx_PyUnicode_FromCString(s) __Pyx_PyUnicode_FromString((const char*)s) #if PY_MAJOR_VERSION < 3 static CYTHON_INLINE size_t __Pyx_Py_UNICODE_strlen(const Py_UNICODE *u) { const Py_UNICODE *u_end = u; while (*u_end++) ; return (size_t)(u_end - u - 1); } #else #define __Pyx_Py_UNICODE_strlen Py_UNICODE_strlen #endif #define __Pyx_PyUnicode_FromUnicode(u) PyUnicode_FromUnicode(u, __Pyx_Py_UNICODE_strlen(u)) #define __Pyx_PyUnicode_FromUnicodeAndLength PyUnicode_FromUnicode #define __Pyx_PyUnicode_AsUnicode PyUnicode_AsUnicode #define __Pyx_NewRef(obj) (Py_INCREF(obj), obj) #define __Pyx_Owned_Py_None(b) __Pyx_NewRef(Py_None) #define __Pyx_PyBool_FromLong(b) ((b) ? __Pyx_NewRef(Py_True) : __Pyx_NewRef(Py_False)) static CYTHON_INLINE int __Pyx_PyObject_IsTrue(PyObject*); static CYTHON_INLINE PyObject* __Pyx_PyNumber_Int(PyObject* x); static CYTHON_INLINE Py_ssize_t __Pyx_PyIndex_AsSsize_t(PyObject*); static CYTHON_INLINE PyObject * __Pyx_PyInt_FromSize_t(size_t); #if CYTHON_COMPILING_IN_CPYTHON #define __pyx_PyFloat_AsDouble(x) (PyFloat_CheckExact(x) ? PyFloat_AS_DOUBLE(x) : PyFloat_AsDouble(x)) #else #define __pyx_PyFloat_AsDouble(x) PyFloat_AsDouble(x) #endif #define __pyx_PyFloat_AsFloat(x) ((float) __pyx_PyFloat_AsDouble(x)) #if PY_MAJOR_VERSION < 3 && __PYX_DEFAULT_STRING_ENCODING_IS_ASCII static int __Pyx_sys_getdefaultencoding_not_ascii; static int __Pyx_init_sys_getdefaultencoding_params(void) { PyObject* sys; PyObject* default_encoding = NULL; PyObject* ascii_chars_u = NULL; PyObject* ascii_chars_b = NULL; const char* default_encoding_c; sys = PyImport_ImportModule("sys"); if (!sys) goto bad; default_encoding = PyObject_CallMethod(sys, (char*) "getdefaultencoding", NULL); Py_DECREF(sys); if (!default_encoding) goto bad; default_encoding_c = PyBytes_AsString(default_encoding); if (!default_encoding_c) goto bad; if (strcmp(default_encoding_c, "ascii") == 0) { __Pyx_sys_getdefaultencoding_not_ascii = 0; } else { char ascii_chars[128]; int c; for (c = 0; c < 128; c++) { ascii_chars[c] = c; } __Pyx_sys_getdefaultencoding_not_ascii = 1; ascii_chars_u = PyUnicode_DecodeASCII(ascii_chars, 128, NULL); if (!ascii_chars_u) goto bad; ascii_chars_b = PyUnicode_AsEncodedString(ascii_chars_u, default_encoding_c, NULL); if (!ascii_chars_b || !PyBytes_Check(ascii_chars_b) || memcmp(ascii_chars, PyBytes_AS_STRING(ascii_chars_b), 128) != 0) { PyErr_Format( PyExc_ValueError, "This module compiled with c_string_encoding=ascii, but default encoding '%.200s' is not a superset of ascii.", default_encoding_c); goto bad; } Py_DECREF(ascii_chars_u); Py_DECREF(ascii_chars_b); } Py_DECREF(default_encoding); return 0; bad: Py_XDECREF(default_encoding); Py_XDECREF(ascii_chars_u); Py_XDECREF(ascii_chars_b); return -1; } #endif #if __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT && PY_MAJOR_VERSION >= 3 #define __Pyx_PyUnicode_FromStringAndSize(c_str, size) PyUnicode_DecodeUTF8(c_str, size, NULL) #else #define __Pyx_PyUnicode_FromStringAndSize(c_str, size) PyUnicode_Decode(c_str, size, __PYX_DEFAULT_STRING_ENCODING, NULL) #if __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT static char* __PYX_DEFAULT_STRING_ENCODING; static int __Pyx_init_sys_getdefaultencoding_params(void) { PyObject* sys; PyObject* default_encoding = NULL; char* default_encoding_c; sys = PyImport_ImportModule("sys"); if (!sys) goto bad; default_encoding = PyObject_CallMethod(sys, (char*) (const char*) "getdefaultencoding", NULL); Py_DECREF(sys); if (!default_encoding) goto bad; default_encoding_c = PyBytes_AsString(default_encoding); if (!default_encoding_c) goto bad; __PYX_DEFAULT_STRING_ENCODING = (char*) malloc(strlen(default_encoding_c)); if (!__PYX_DEFAULT_STRING_ENCODING) goto bad; strcpy(__PYX_DEFAULT_STRING_ENCODING, default_encoding_c); Py_DECREF(default_encoding); return 0; bad: Py_XDECREF(default_encoding); return -1; } #endif #endif /* Test for GCC > 2.95 */ #if defined(__GNUC__) && (__GNUC__ > 2 || (__GNUC__ == 2 && (__GNUC_MINOR__ > 95))) #define likely(x) __builtin_expect(!!(x), 1) #define unlikely(x) __builtin_expect(!!(x), 0) #else /* !__GNUC__ or GCC < 2.95 */ #define likely(x) (x) #define unlikely(x) (x) #endif /* __GNUC__ */ static PyObject *__pyx_m; static PyObject *__pyx_d; static PyObject *__pyx_b; static PyObject *__pyx_empty_tuple; static PyObject *__pyx_empty_bytes; static int __pyx_lineno; static int __pyx_clineno = 0; static const char * __pyx_cfilenm= __FILE__; static const char *__pyx_filename; static const char *__pyx_f[] = { "src/pygame_sdl2/error.pyx", }; /*--- Type declarations ---*/ /* --- Runtime support code (head) --- */ #ifndef CYTHON_REFNANNY #define CYTHON_REFNANNY 0 #endif #if CYTHON_REFNANNY typedef struct { void (*INCREF)(void*, PyObject*, int); void (*DECREF)(void*, PyObject*, int); void (*GOTREF)(void*, PyObject*, int); void (*GIVEREF)(void*, PyObject*, int); void* (*SetupContext)(const char*, int, const char*); void (*FinishContext)(void**); } __Pyx_RefNannyAPIStruct; static __Pyx_RefNannyAPIStruct *__Pyx_RefNanny = NULL; static __Pyx_RefNannyAPIStruct *__Pyx_RefNannyImportAPI(const char *modname); #define __Pyx_RefNannyDeclarations void *__pyx_refnanny = NULL; #ifdef WITH_THREAD #define __Pyx_RefNannySetupContext(name, acquire_gil)\ if (acquire_gil) {\ PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure();\ __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), __LINE__, __FILE__);\ PyGILState_Release(__pyx_gilstate_save);\ } else {\ __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), __LINE__, __FILE__);\ } #else #define __Pyx_RefNannySetupContext(name, acquire_gil)\ __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), __LINE__, __FILE__) #endif #define __Pyx_RefNannyFinishContext()\ __Pyx_RefNanny->FinishContext(&__pyx_refnanny) #define __Pyx_INCREF(r) __Pyx_RefNanny->INCREF(__pyx_refnanny, (PyObject *)(r), __LINE__) #define __Pyx_DECREF(r) __Pyx_RefNanny->DECREF(__pyx_refnanny, (PyObject *)(r), __LINE__) #define __Pyx_GOTREF(r) __Pyx_RefNanny->GOTREF(__pyx_refnanny, (PyObject *)(r), __LINE__) #define __Pyx_GIVEREF(r) __Pyx_RefNanny->GIVEREF(__pyx_refnanny, (PyObject *)(r), __LINE__) #define __Pyx_XINCREF(r) do { if((r) != NULL) {__Pyx_INCREF(r); }} while(0) #define __Pyx_XDECREF(r) do { if((r) != NULL) {__Pyx_DECREF(r); }} while(0) #define __Pyx_XGOTREF(r) do { if((r) != NULL) {__Pyx_GOTREF(r); }} while(0) #define __Pyx_XGIVEREF(r) do { if((r) != NULL) {__Pyx_GIVEREF(r);}} while(0) #else #define __Pyx_RefNannyDeclarations #define __Pyx_RefNannySetupContext(name, acquire_gil) #define __Pyx_RefNannyFinishContext() #define __Pyx_INCREF(r) Py_INCREF(r) #define __Pyx_DECREF(r) Py_DECREF(r) #define __Pyx_GOTREF(r) #define __Pyx_GIVEREF(r) #define __Pyx_XINCREF(r) Py_XINCREF(r) #define __Pyx_XDECREF(r) Py_XDECREF(r) #define __Pyx_XGOTREF(r) #define __Pyx_XGIVEREF(r) #endif #define __Pyx_XDECREF_SET(r, v) do {\ PyObject *tmp = (PyObject *) r;\ r = v; __Pyx_XDECREF(tmp);\ } while (0) #define __Pyx_DECREF_SET(r, v) do {\ PyObject *tmp = (PyObject *) r;\ r = v; __Pyx_DECREF(tmp);\ } while (0) #define __Pyx_CLEAR(r) do { PyObject* tmp = ((PyObject*)(r)); r = NULL; __Pyx_DECREF(tmp);} while(0) #define __Pyx_XCLEAR(r) do { if((r) != NULL) {PyObject* tmp = ((PyObject*)(r)); r = NULL; __Pyx_DECREF(tmp);}} while(0) #if CYTHON_COMPILING_IN_CPYTHON static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStr(PyObject* obj, PyObject* attr_name) { PyTypeObject* tp = Py_TYPE(obj); if (likely(tp->tp_getattro)) return tp->tp_getattro(obj, attr_name); #if PY_MAJOR_VERSION < 3 if (likely(tp->tp_getattr)) return tp->tp_getattr(obj, PyString_AS_STRING(attr_name)); #endif return PyObject_GetAttr(obj, attr_name); } #else #define __Pyx_PyObject_GetAttrStr(o,n) PyObject_GetAttr(o,n) #endif static PyObject *__Pyx_GetBuiltinName(PyObject *name); static void __Pyx_RaiseDoubleKeywordsError(const char* func_name, PyObject* kw_name); static int __Pyx_ParseOptionalKeywords(PyObject *kwds, PyObject **argnames[],\ PyObject *kwds2, PyObject *values[], Py_ssize_t num_pos_args,\ const char* function_name); static void __Pyx_RaiseArgtupleInvalid(const char* func_name, int exact, Py_ssize_t num_min, Py_ssize_t num_max, Py_ssize_t num_found); #if CYTHON_COMPILING_IN_CPYTHON static CYTHON_INLINE PyObject* __Pyx_PyObject_Call(PyObject *func, PyObject *arg, PyObject *kw); #else #define __Pyx_PyObject_Call(func, arg, kw) PyObject_Call(func, arg, kw) #endif static PyObject *__Pyx_CalculateMetaclass(PyTypeObject *metaclass, PyObject *bases); static PyTypeObject* __Pyx_FetchCommonType(PyTypeObject* type); #define __Pyx_CyFunction_USED 1 #include #define __Pyx_CYFUNCTION_STATICMETHOD 0x01 #define __Pyx_CYFUNCTION_CLASSMETHOD 0x02 #define __Pyx_CYFUNCTION_CCLASS 0x04 #define __Pyx_CyFunction_GetClosure(f)\ (((__pyx_CyFunctionObject *) (f))->func_closure) #define __Pyx_CyFunction_GetClassObj(f)\ (((__pyx_CyFunctionObject *) (f))->func_classobj) #define __Pyx_CyFunction_Defaults(type, f)\ ((type *)(((__pyx_CyFunctionObject *) (f))->defaults)) #define __Pyx_CyFunction_SetDefaultsGetter(f, g)\ ((__pyx_CyFunctionObject *) (f))->defaults_getter = (g) typedef struct { PyCFunctionObject func; #if PY_VERSION_HEX < 0x030500A0 PyObject *func_weakreflist; #endif PyObject *func_dict; PyObject *func_name; PyObject *func_qualname; PyObject *func_doc; PyObject *func_globals; PyObject *func_code; PyObject *func_closure; PyObject *func_classobj; void *defaults; int defaults_pyobjects; int flags; PyObject *defaults_tuple; PyObject *defaults_kwdict; PyObject *(*defaults_getter)(PyObject *); PyObject *func_annotations; } __pyx_CyFunctionObject; static PyTypeObject *__pyx_CyFunctionType = 0; #define __Pyx_CyFunction_NewEx(ml, flags, qualname, self, module, globals, code)\ __Pyx_CyFunction_New(__pyx_CyFunctionType, ml, flags, qualname, self, module, globals, code) static PyObject *__Pyx_CyFunction_New(PyTypeObject *, PyMethodDef *ml, int flags, PyObject* qualname, PyObject *self, PyObject *module, PyObject *globals, PyObject* code); static CYTHON_INLINE void *__Pyx_CyFunction_InitDefaults(PyObject *m, size_t size, int pyobjects); static CYTHON_INLINE void __Pyx_CyFunction_SetDefaultsTuple(PyObject *m, PyObject *tuple); static CYTHON_INLINE void __Pyx_CyFunction_SetDefaultsKwDict(PyObject *m, PyObject *dict); static CYTHON_INLINE void __Pyx_CyFunction_SetAnnotationsDict(PyObject *m, PyObject *dict); static int __pyx_CyFunction_init(void); static PyObject *__Pyx_Py3MetaclassPrepare(PyObject *metaclass, PyObject *bases, PyObject *name, PyObject *qualname, PyObject *mkw, PyObject *modname, PyObject *doc); static PyObject *__Pyx_Py3ClassCreate(PyObject *metaclass, PyObject *name, PyObject *bases, PyObject *dict, PyObject *mkw, int calculate_metaclass, int allow_py2_metaclass); typedef struct { int code_line; PyCodeObject* code_object; } __Pyx_CodeObjectCacheEntry; struct __Pyx_CodeObjectCache { int count; int max_count; __Pyx_CodeObjectCacheEntry* entries; }; static struct __Pyx_CodeObjectCache __pyx_code_cache = {0,0,NULL}; static int __pyx_bisect_code_objects(__Pyx_CodeObjectCacheEntry* entries, int count, int code_line); static PyCodeObject *__pyx_find_code_object(int code_line); static void __pyx_insert_code_object(int code_line, PyCodeObject* code_object); static void __Pyx_AddTraceback(const char *funcname, int c_line, int py_line, const char *filename); static CYTHON_INLINE PyObject* __Pyx_PyInt_From_long(long value); static CYTHON_INLINE long __Pyx_PyInt_As_long(PyObject *); static CYTHON_INLINE int __Pyx_PyInt_As_int(PyObject *); static int __Pyx_check_binary_version(void); static int __Pyx_InitStrings(__Pyx_StringTabEntry *t); /* Module declarations from 'libc.stdint' */ /* Module declarations from 'libc.string' */ /* Module declarations from 'libc.stdio' */ /* Module declarations from 'libc.stddef' */ /* Module declarations from 'sdl2' */ /* Module declarations from 'pygame_sdl2.error' */ #define __Pyx_MODULE_NAME "pygame_sdl2.error" int __pyx_module_is_main_pygame_sdl2__error = 0; /* Implementation of 'pygame_sdl2.error' */ static PyObject *__pyx_builtin_RuntimeError; static char __pyx_k_[] = ""; static char __pyx_k_s[] = "%s"; static char __pyx_k_doc[] = "__doc__"; static char __pyx_k_init[] = "__init__"; static char __pyx_k_main[] = "__main__"; static char __pyx_k_self[] = "self"; static char __pyx_k_test[] = "__test__"; static char __pyx_k_error[] = "error"; static char __pyx_k_module[] = "__module__"; static char __pyx_k_message[] = "message"; static char __pyx_k_prepare[] = "__prepare__"; static char __pyx_k_qualname[] = "__qualname__"; static char __pyx_k_get_error[] = "get_error"; static char __pyx_k_metaclass[] = "__metaclass__"; static char __pyx_k_set_error[] = "set_error"; static char __pyx_k_RuntimeError[] = "RuntimeError"; static char __pyx_k_error___init[] = "error.__init__"; static char __pyx_k_pygame_sdl2_error[] = "pygame_sdl2.error"; static char __pyx_k_home_tom_ab_pygame_sdl2_src_pyg[] = "/home/tom/ab/pygame_sdl2/src/pygame_sdl2/error.pyx"; static PyObject *__pyx_kp_s_; static PyObject *__pyx_n_s_RuntimeError; static PyObject *__pyx_n_s_doc; static PyObject *__pyx_n_s_error; static PyObject *__pyx_n_s_error___init; static PyObject *__pyx_n_s_get_error; static PyObject *__pyx_kp_s_home_tom_ab_pygame_sdl2_src_pyg; static PyObject *__pyx_n_s_init; static PyObject *__pyx_n_s_main; static PyObject *__pyx_n_s_message; static PyObject *__pyx_n_s_metaclass; static PyObject *__pyx_n_s_module; static PyObject *__pyx_n_s_prepare; static PyObject *__pyx_n_s_pygame_sdl2_error; static PyObject *__pyx_n_s_qualname; static PyObject *__pyx_n_s_self; static PyObject *__pyx_n_s_set_error; static PyObject *__pyx_n_s_test; static PyObject *__pyx_pf_11pygame_sdl2_5error_5error___init__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_message); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_5error_get_error(CYTHON_UNUSED PyObject *__pyx_self); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_5error_2set_error(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_message); /* proto */ static PyObject *__pyx_tuple__2; static PyObject *__pyx_tuple__4; static PyObject *__pyx_tuple__5; static PyObject *__pyx_tuple__7; static PyObject *__pyx_codeobj__3; static PyObject *__pyx_codeobj__6; static PyObject *__pyx_codeobj__8; /* "pygame_sdl2/error.pyx":23 * class error(RuntimeError): * * def __init__(self, message=None): # <<<<<<<<<<<<<< * if message is None: * message = str(SDL_GetError()) */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_5error_5error_1__init__(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static PyMethodDef __pyx_mdef_11pygame_sdl2_5error_5error_1__init__ = {"__init__", (PyCFunction)__pyx_pw_11pygame_sdl2_5error_5error_1__init__, METH_VARARGS|METH_KEYWORDS, 0}; static PyObject *__pyx_pw_11pygame_sdl2_5error_5error_1__init__(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_self = 0; PyObject *__pyx_v_message = 0; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__init__ (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_message,0}; PyObject* values[2] = {0,0}; values[1] = ((PyObject *)((PyObject *)Py_None)); if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_self)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; case 1: if (kw_args > 0) { PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_message); if (value) { values[1] = value; kw_args--; } } } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__init__") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 23; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } } else { switch (PyTuple_GET_SIZE(__pyx_args)) { case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_self = values[0]; __pyx_v_message = values[1]; } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("__init__", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 23; __pyx_clineno = __LINE__; goto __pyx_L3_error;} __pyx_L3_error:; __Pyx_AddTraceback("pygame_sdl2.error.error.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_11pygame_sdl2_5error_5error___init__(__pyx_self, __pyx_v_self, __pyx_v_message); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_5error_5error___init__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_message) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; int __pyx_t_2; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; PyObject *__pyx_t_5 = NULL; Py_ssize_t __pyx_t_6; PyObject *__pyx_t_7 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__init__", 0); __Pyx_INCREF(__pyx_v_message); /* "pygame_sdl2/error.pyx":24 * * def __init__(self, message=None): * if message is None: # <<<<<<<<<<<<<< * message = str(SDL_GetError()) * */ __pyx_t_1 = (__pyx_v_message == Py_None); __pyx_t_2 = (__pyx_t_1 != 0); if (__pyx_t_2) { /* "pygame_sdl2/error.pyx":25 * def __init__(self, message=None): * if message is None: * message = str(SDL_GetError()) # <<<<<<<<<<<<<< * * RuntimeError.__init__(self, message) */ __pyx_t_3 = __Pyx_PyBytes_FromString(SDL_GetError()); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 25; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 25; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_3); __pyx_t_3 = 0; __pyx_t_3 = __Pyx_PyObject_Call(((PyObject *)(&PyString_Type)), __pyx_t_4, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 25; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF_SET(__pyx_v_message, __pyx_t_3); __pyx_t_3 = 0; /* "pygame_sdl2/error.pyx":24 * * def __init__(self, message=None): * if message is None: # <<<<<<<<<<<<<< * message = str(SDL_GetError()) * */ } /* "pygame_sdl2/error.pyx":27 * message = str(SDL_GetError()) * * RuntimeError.__init__(self, message) # <<<<<<<<<<<<<< * * def get_error(): */ __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_builtin_RuntimeError, __pyx_n_s_init); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 27; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); __pyx_t_5 = NULL; __pyx_t_6 = 0; if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_4))) { __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4); if (likely(__pyx_t_5)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4); __Pyx_INCREF(__pyx_t_5); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_4, function); __pyx_t_6 = 1; } } __pyx_t_7 = PyTuple_New(2+__pyx_t_6); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 27; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_7); if (__pyx_t_5) { __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_5); __pyx_t_5 = NULL; } __Pyx_INCREF(__pyx_v_self); __Pyx_GIVEREF(__pyx_v_self); PyTuple_SET_ITEM(__pyx_t_7, 0+__pyx_t_6, __pyx_v_self); __Pyx_INCREF(__pyx_v_message); __Pyx_GIVEREF(__pyx_v_message); PyTuple_SET_ITEM(__pyx_t_7, 1+__pyx_t_6, __pyx_v_message); __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_7, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 27; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "pygame_sdl2/error.pyx":23 * class error(RuntimeError): * * def __init__(self, message=None): # <<<<<<<<<<<<<< * if message is None: * message = str(SDL_GetError()) */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_5); __Pyx_XDECREF(__pyx_t_7); __Pyx_AddTraceback("pygame_sdl2.error.error.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF(__pyx_v_message); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/error.pyx":29 * RuntimeError.__init__(self, message) * * def get_error(): # <<<<<<<<<<<<<< * cdef const char *message = SDL_GetError() * */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_5error_1get_error(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused); /*proto*/ static PyMethodDef __pyx_mdef_11pygame_sdl2_5error_1get_error = {"get_error", (PyCFunction)__pyx_pw_11pygame_sdl2_5error_1get_error, METH_NOARGS, 0}; static PyObject *__pyx_pw_11pygame_sdl2_5error_1get_error(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("get_error (wrapper)", 0); __pyx_r = __pyx_pf_11pygame_sdl2_5error_get_error(__pyx_self); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_5error_get_error(CYTHON_UNUSED PyObject *__pyx_self) { char const *__pyx_v_message; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("get_error", 0); /* "pygame_sdl2/error.pyx":30 * * def get_error(): * cdef const char *message = SDL_GetError() # <<<<<<<<<<<<<< * * if message: */ __pyx_v_message = SDL_GetError(); /* "pygame_sdl2/error.pyx":32 * cdef const char *message = SDL_GetError() * * if message: # <<<<<<<<<<<<<< * return str(message) * else: */ __pyx_t_1 = (__pyx_v_message != 0); if (__pyx_t_1) { /* "pygame_sdl2/error.pyx":33 * * if message: * return str(message) # <<<<<<<<<<<<<< * else: * return '' */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __Pyx_PyBytes_FromString(__pyx_v_message); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 33; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 33; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __Pyx_GIVEREF(__pyx_t_2); PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_2); __pyx_t_2 = 0; __pyx_t_2 = __Pyx_PyObject_Call(((PyObject *)(&PyString_Type)), __pyx_t_3, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 33; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; /* "pygame_sdl2/error.pyx":32 * cdef const char *message = SDL_GetError() * * if message: # <<<<<<<<<<<<<< * return str(message) * else: */ } /* "pygame_sdl2/error.pyx":35 * return str(message) * else: * return '' # <<<<<<<<<<<<<< * * def set_error(message): */ /*else*/ { __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(__pyx_kp_s_); __pyx_r = __pyx_kp_s_; goto __pyx_L0; } /* "pygame_sdl2/error.pyx":29 * RuntimeError.__init__(self, message) * * def get_error(): # <<<<<<<<<<<<<< * cdef const char *message = SDL_GetError() * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("pygame_sdl2.error.get_error", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/error.pyx":37 * return '' * * def set_error(message): # <<<<<<<<<<<<<< * message = bytes(message) * SDL_SetError("%s", message) */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_5error_3set_error(PyObject *__pyx_self, PyObject *__pyx_v_message); /*proto*/ static PyMethodDef __pyx_mdef_11pygame_sdl2_5error_3set_error = {"set_error", (PyCFunction)__pyx_pw_11pygame_sdl2_5error_3set_error, METH_O, 0}; static PyObject *__pyx_pw_11pygame_sdl2_5error_3set_error(PyObject *__pyx_self, PyObject *__pyx_v_message) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("set_error (wrapper)", 0); __pyx_r = __pyx_pf_11pygame_sdl2_5error_2set_error(__pyx_self, ((PyObject *)__pyx_v_message)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_5error_2set_error(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_message) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; char *__pyx_t_3; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("set_error", 0); __Pyx_INCREF(__pyx_v_message); /* "pygame_sdl2/error.pyx":38 * * def set_error(message): * message = bytes(message) # <<<<<<<<<<<<<< * SDL_SetError("%s", message) */ __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 38; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __Pyx_INCREF(__pyx_v_message); __Pyx_GIVEREF(__pyx_v_message); PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_message); __pyx_t_2 = __Pyx_PyObject_Call(((PyObject *)(&PyBytes_Type)), __pyx_t_1, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 38; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF_SET(__pyx_v_message, __pyx_t_2); __pyx_t_2 = 0; /* "pygame_sdl2/error.pyx":39 * def set_error(message): * message = bytes(message) * SDL_SetError("%s", message) # <<<<<<<<<<<<<< */ __pyx_t_3 = __Pyx_PyObject_AsString(__pyx_v_message); if (unlikely((!__pyx_t_3) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 39; __pyx_clineno = __LINE__; goto __pyx_L1_error;} SDL_SetError(__pyx_k_s, ((char *)__pyx_t_3)); /* "pygame_sdl2/error.pyx":37 * return '' * * def set_error(message): # <<<<<<<<<<<<<< * message = bytes(message) * SDL_SetError("%s", message) */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_AddTraceback("pygame_sdl2.error.set_error", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF(__pyx_v_message); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyMethodDef __pyx_methods[] = { {0, 0, 0, 0} }; #if PY_MAJOR_VERSION >= 3 static struct PyModuleDef __pyx_moduledef = { #if PY_VERSION_HEX < 0x03020000 { PyObject_HEAD_INIT(NULL) NULL, 0, NULL }, #else PyModuleDef_HEAD_INIT, #endif "error", 0, /* m_doc */ -1, /* m_size */ __pyx_methods /* m_methods */, NULL, /* m_reload */ NULL, /* m_traverse */ NULL, /* m_clear */ NULL /* m_free */ }; #endif static __Pyx_StringTabEntry __pyx_string_tab[] = { {&__pyx_kp_s_, __pyx_k_, sizeof(__pyx_k_), 0, 0, 1, 0}, {&__pyx_n_s_RuntimeError, __pyx_k_RuntimeError, sizeof(__pyx_k_RuntimeError), 0, 0, 1, 1}, {&__pyx_n_s_doc, __pyx_k_doc, sizeof(__pyx_k_doc), 0, 0, 1, 1}, {&__pyx_n_s_error, __pyx_k_error, sizeof(__pyx_k_error), 0, 0, 1, 1}, {&__pyx_n_s_error___init, __pyx_k_error___init, sizeof(__pyx_k_error___init), 0, 0, 1, 1}, {&__pyx_n_s_get_error, __pyx_k_get_error, sizeof(__pyx_k_get_error), 0, 0, 1, 1}, {&__pyx_kp_s_home_tom_ab_pygame_sdl2_src_pyg, __pyx_k_home_tom_ab_pygame_sdl2_src_pyg, sizeof(__pyx_k_home_tom_ab_pygame_sdl2_src_pyg), 0, 0, 1, 0}, {&__pyx_n_s_init, __pyx_k_init, sizeof(__pyx_k_init), 0, 0, 1, 1}, {&__pyx_n_s_main, __pyx_k_main, sizeof(__pyx_k_main), 0, 0, 1, 1}, {&__pyx_n_s_message, __pyx_k_message, sizeof(__pyx_k_message), 0, 0, 1, 1}, {&__pyx_n_s_metaclass, __pyx_k_metaclass, sizeof(__pyx_k_metaclass), 0, 0, 1, 1}, {&__pyx_n_s_module, __pyx_k_module, sizeof(__pyx_k_module), 0, 0, 1, 1}, {&__pyx_n_s_prepare, __pyx_k_prepare, sizeof(__pyx_k_prepare), 0, 0, 1, 1}, {&__pyx_n_s_pygame_sdl2_error, __pyx_k_pygame_sdl2_error, sizeof(__pyx_k_pygame_sdl2_error), 0, 0, 1, 1}, {&__pyx_n_s_qualname, __pyx_k_qualname, sizeof(__pyx_k_qualname), 0, 0, 1, 1}, {&__pyx_n_s_self, __pyx_k_self, sizeof(__pyx_k_self), 0, 0, 1, 1}, {&__pyx_n_s_set_error, __pyx_k_set_error, sizeof(__pyx_k_set_error), 0, 0, 1, 1}, {&__pyx_n_s_test, __pyx_k_test, sizeof(__pyx_k_test), 0, 0, 1, 1}, {0, 0, 0, 0, 0, 0, 0} }; static int __Pyx_InitCachedBuiltins(void) { __pyx_builtin_RuntimeError = __Pyx_GetBuiltinName(__pyx_n_s_RuntimeError); if (!__pyx_builtin_RuntimeError) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 21; __pyx_clineno = __LINE__; goto __pyx_L1_error;} return 0; __pyx_L1_error:; return -1; } static int __Pyx_InitCachedConstants(void) { __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__Pyx_InitCachedConstants", 0); /* "pygame_sdl2/error.pyx":23 * class error(RuntimeError): * * def __init__(self, message=None): # <<<<<<<<<<<<<< * if message is None: * message = str(SDL_GetError()) */ __pyx_tuple__2 = PyTuple_Pack(2, __pyx_n_s_self, __pyx_n_s_message); if (unlikely(!__pyx_tuple__2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 23; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_tuple__2); __Pyx_GIVEREF(__pyx_tuple__2); __pyx_codeobj__3 = (PyObject*)__Pyx_PyCode_New(2, 0, 2, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__2, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_tom_ab_pygame_sdl2_src_pyg, __pyx_n_s_init, 23, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 23; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_tuple__4 = PyTuple_Pack(1, ((PyObject *)Py_None)); if (unlikely(!__pyx_tuple__4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 23; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_tuple__4); __Pyx_GIVEREF(__pyx_tuple__4); /* "pygame_sdl2/error.pyx":29 * RuntimeError.__init__(self, message) * * def get_error(): # <<<<<<<<<<<<<< * cdef const char *message = SDL_GetError() * */ __pyx_tuple__5 = PyTuple_Pack(1, __pyx_n_s_message); if (unlikely(!__pyx_tuple__5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 29; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_tuple__5); __Pyx_GIVEREF(__pyx_tuple__5); __pyx_codeobj__6 = (PyObject*)__Pyx_PyCode_New(0, 0, 1, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__5, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_tom_ab_pygame_sdl2_src_pyg, __pyx_n_s_get_error, 29, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 29; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "pygame_sdl2/error.pyx":37 * return '' * * def set_error(message): # <<<<<<<<<<<<<< * message = bytes(message) * SDL_SetError("%s", message) */ __pyx_tuple__7 = PyTuple_Pack(1, __pyx_n_s_message); if (unlikely(!__pyx_tuple__7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 37; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_tuple__7); __Pyx_GIVEREF(__pyx_tuple__7); __pyx_codeobj__8 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__7, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_tom_ab_pygame_sdl2_src_pyg, __pyx_n_s_set_error, 37, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 37; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_RefNannyFinishContext(); return 0; __pyx_L1_error:; __Pyx_RefNannyFinishContext(); return -1; } static int __Pyx_InitGlobals(void) { if (__Pyx_InitStrings(__pyx_string_tab) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; return 0; __pyx_L1_error:; return -1; } #if PY_MAJOR_VERSION < 3 PyMODINIT_FUNC initerror(void); /*proto*/ PyMODINIT_FUNC initerror(void) #else PyMODINIT_FUNC PyInit_error(void); /*proto*/ PyMODINIT_FUNC PyInit_error(void) #endif { PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannyDeclarations #if CYTHON_REFNANNY __Pyx_RefNanny = __Pyx_RefNannyImportAPI("refnanny"); if (!__Pyx_RefNanny) { PyErr_Clear(); __Pyx_RefNanny = __Pyx_RefNannyImportAPI("Cython.Runtime.refnanny"); if (!__Pyx_RefNanny) Py_FatalError("failed to import 'refnanny' module"); } #endif __Pyx_RefNannySetupContext("PyMODINIT_FUNC PyInit_error(void)", 0); if (__Pyx_check_binary_version() < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_empty_tuple = PyTuple_New(0); if (unlikely(!__pyx_empty_tuple)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_empty_bytes = PyBytes_FromStringAndSize("", 0); if (unlikely(!__pyx_empty_bytes)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} #ifdef __Pyx_CyFunction_USED if (__pyx_CyFunction_init() < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} #endif #ifdef __Pyx_FusedFunction_USED if (__pyx_FusedFunction_init() < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} #endif #ifdef __Pyx_Coroutine_USED if (__pyx_Coroutine_init() < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} #endif #ifdef __Pyx_Generator_USED if (__pyx_Generator_init() < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} #endif #ifdef __Pyx_StopAsyncIteration_USED if (__pyx_StopAsyncIteration_init() < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} #endif /*--- Library function declarations ---*/ /*--- Threads initialization code ---*/ #if defined(__PYX_FORCE_INIT_THREADS) && __PYX_FORCE_INIT_THREADS #ifdef WITH_THREAD /* Python build with threading support? */ PyEval_InitThreads(); #endif #endif /*--- Module creation code ---*/ #if PY_MAJOR_VERSION < 3 __pyx_m = Py_InitModule4("error", __pyx_methods, 0, 0, PYTHON_API_VERSION); Py_XINCREF(__pyx_m); #else __pyx_m = PyModule_Create(&__pyx_moduledef); #endif if (unlikely(!__pyx_m)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_d = PyModule_GetDict(__pyx_m); if (unlikely(!__pyx_d)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} Py_INCREF(__pyx_d); __pyx_b = PyImport_AddModule(__Pyx_BUILTIN_MODULE_NAME); if (unlikely(!__pyx_b)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} #if CYTHON_COMPILING_IN_PYPY Py_INCREF(__pyx_b); #endif if (PyObject_SetAttrString(__pyx_m, "__builtins__", __pyx_b) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; /*--- Initialize various global constants etc. ---*/ if (__Pyx_InitGlobals() < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} #if PY_MAJOR_VERSION < 3 && (__PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT) if (__Pyx_init_sys_getdefaultencoding_params() < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} #endif if (__pyx_module_is_main_pygame_sdl2__error) { if (PyObject_SetAttrString(__pyx_m, "__name__", __pyx_n_s_main) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } #if PY_MAJOR_VERSION >= 3 { PyObject *modules = PyImport_GetModuleDict(); if (unlikely(!modules)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} if (!PyDict_GetItemString(modules, "pygame_sdl2.error")) { if (unlikely(PyDict_SetItemString(modules, "pygame_sdl2.error", __pyx_m) < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } } #endif /*--- Builtin init code ---*/ if (__Pyx_InitCachedBuiltins() < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /*--- Constants init code ---*/ if (__Pyx_InitCachedConstants() < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /*--- Global init code ---*/ /*--- Variable export code ---*/ /*--- Function export code ---*/ /*--- Type init code ---*/ /*--- Type import code ---*/ /*--- Variable import code ---*/ /*--- Function import code ---*/ /*--- Execution code ---*/ #if defined(__Pyx_Generator_USED) || defined(__Pyx_Coroutine_USED) if (__Pyx_patch_abc() < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} #endif /* "pygame_sdl2/error.pyx":21 * from sdl2 cimport * * * class error(RuntimeError): # <<<<<<<<<<<<<< * * def __init__(self, message=None): */ __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 21; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __Pyx_INCREF(__pyx_builtin_RuntimeError); __Pyx_GIVEREF(__pyx_builtin_RuntimeError); PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_builtin_RuntimeError); __pyx_t_2 = __Pyx_CalculateMetaclass(NULL, __pyx_t_1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 21; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = __Pyx_Py3MetaclassPrepare(__pyx_t_2, __pyx_t_1, __pyx_n_s_error, __pyx_n_s_error, (PyObject *) NULL, __pyx_n_s_pygame_sdl2_error, (PyObject *) NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 21; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); /* "pygame_sdl2/error.pyx":23 * class error(RuntimeError): * * def __init__(self, message=None): # <<<<<<<<<<<<<< * if message is None: * message = str(SDL_GetError()) */ __pyx_t_4 = __Pyx_CyFunction_NewEx(&__pyx_mdef_11pygame_sdl2_5error_5error_1__init__, 0, __pyx_n_s_error___init, NULL, __pyx_n_s_pygame_sdl2_error, __pyx_d, ((PyObject *)__pyx_codeobj__3)); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 23; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_4, __pyx_tuple__4); if (PyObject_SetItem(__pyx_t_3, __pyx_n_s_init, __pyx_t_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 23; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; /* "pygame_sdl2/error.pyx":21 * from sdl2 cimport * * * class error(RuntimeError): # <<<<<<<<<<<<<< * * def __init__(self, message=None): */ __pyx_t_4 = __Pyx_Py3ClassCreate(__pyx_t_2, __pyx_n_s_error, __pyx_t_1, __pyx_t_3, NULL, 0, 1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 21; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); if (PyDict_SetItem(__pyx_d, __pyx_n_s_error, __pyx_t_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 21; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "pygame_sdl2/error.pyx":29 * RuntimeError.__init__(self, message) * * def get_error(): # <<<<<<<<<<<<<< * cdef const char *message = SDL_GetError() * */ __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_11pygame_sdl2_5error_1get_error, NULL, __pyx_n_s_pygame_sdl2_error); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 29; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); if (PyDict_SetItem(__pyx_d, __pyx_n_s_get_error, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 29; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "pygame_sdl2/error.pyx":37 * return '' * * def set_error(message): # <<<<<<<<<<<<<< * message = bytes(message) * SDL_SetError("%s", message) */ __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_11pygame_sdl2_5error_3set_error, NULL, __pyx_n_s_pygame_sdl2_error); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 37; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); if (PyDict_SetItem(__pyx_d, __pyx_n_s_set_error, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 37; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "pygame_sdl2/error.pyx":1 * # Copyright 2014 Tom Rothamel # <<<<<<<<<<<<<< * # * # This software is provided 'as-is', without any express or implied */ __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); if (PyDict_SetItem(__pyx_d, __pyx_n_s_test, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /*--- Wrapped vars code ---*/ goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); if (__pyx_m) { if (__pyx_d) { __Pyx_AddTraceback("init pygame_sdl2.error", __pyx_clineno, __pyx_lineno, __pyx_filename); } Py_DECREF(__pyx_m); __pyx_m = 0; } else if (!PyErr_Occurred()) { PyErr_SetString(PyExc_ImportError, "init pygame_sdl2.error"); } __pyx_L0:; __Pyx_RefNannyFinishContext(); #if PY_MAJOR_VERSION < 3 return; #else return __pyx_m; #endif } /* --- Runtime support code --- */ #if CYTHON_REFNANNY static __Pyx_RefNannyAPIStruct *__Pyx_RefNannyImportAPI(const char *modname) { PyObject *m = NULL, *p = NULL; void *r = NULL; m = PyImport_ImportModule((char *)modname); if (!m) goto end; p = PyObject_GetAttrString(m, (char *)"RefNannyAPI"); if (!p) goto end; r = PyLong_AsVoidPtr(p); end: Py_XDECREF(p); Py_XDECREF(m); return (__Pyx_RefNannyAPIStruct *)r; } #endif static PyObject *__Pyx_GetBuiltinName(PyObject *name) { PyObject* result = __Pyx_PyObject_GetAttrStr(__pyx_b, name); if (unlikely(!result)) { PyErr_Format(PyExc_NameError, #if PY_MAJOR_VERSION >= 3 "name '%U' is not defined", name); #else "name '%.200s' is not defined", PyString_AS_STRING(name)); #endif } return result; } static void __Pyx_RaiseDoubleKeywordsError( const char* func_name, PyObject* kw_name) { PyErr_Format(PyExc_TypeError, #if PY_MAJOR_VERSION >= 3 "%s() got multiple values for keyword argument '%U'", func_name, kw_name); #else "%s() got multiple values for keyword argument '%s'", func_name, PyString_AsString(kw_name)); #endif } static int __Pyx_ParseOptionalKeywords( PyObject *kwds, PyObject **argnames[], PyObject *kwds2, PyObject *values[], Py_ssize_t num_pos_args, const char* function_name) { PyObject *key = 0, *value = 0; Py_ssize_t pos = 0; PyObject*** name; PyObject*** first_kw_arg = argnames + num_pos_args; while (PyDict_Next(kwds, &pos, &key, &value)) { name = first_kw_arg; while (*name && (**name != key)) name++; if (*name) { values[name-argnames] = value; continue; } name = first_kw_arg; #if PY_MAJOR_VERSION < 3 if (likely(PyString_CheckExact(key)) || likely(PyString_Check(key))) { while (*name) { if ((CYTHON_COMPILING_IN_PYPY || PyString_GET_SIZE(**name) == PyString_GET_SIZE(key)) && _PyString_Eq(**name, key)) { values[name-argnames] = value; break; } name++; } if (*name) continue; else { PyObject*** argname = argnames; while (argname != first_kw_arg) { if ((**argname == key) || ( (CYTHON_COMPILING_IN_PYPY || PyString_GET_SIZE(**argname) == PyString_GET_SIZE(key)) && _PyString_Eq(**argname, key))) { goto arg_passed_twice; } argname++; } } } else #endif if (likely(PyUnicode_Check(key))) { while (*name) { int cmp = (**name == key) ? 0 : #if !CYTHON_COMPILING_IN_PYPY && PY_MAJOR_VERSION >= 3 (PyUnicode_GET_SIZE(**name) != PyUnicode_GET_SIZE(key)) ? 1 : #endif PyUnicode_Compare(**name, key); if (cmp < 0 && unlikely(PyErr_Occurred())) goto bad; if (cmp == 0) { values[name-argnames] = value; break; } name++; } if (*name) continue; else { PyObject*** argname = argnames; while (argname != first_kw_arg) { int cmp = (**argname == key) ? 0 : #if !CYTHON_COMPILING_IN_PYPY && PY_MAJOR_VERSION >= 3 (PyUnicode_GET_SIZE(**argname) != PyUnicode_GET_SIZE(key)) ? 1 : #endif PyUnicode_Compare(**argname, key); if (cmp < 0 && unlikely(PyErr_Occurred())) goto bad; if (cmp == 0) goto arg_passed_twice; argname++; } } } else goto invalid_keyword_type; if (kwds2) { if (unlikely(PyDict_SetItem(kwds2, key, value))) goto bad; } else { goto invalid_keyword; } } return 0; arg_passed_twice: __Pyx_RaiseDoubleKeywordsError(function_name, key); goto bad; invalid_keyword_type: PyErr_Format(PyExc_TypeError, "%.200s() keywords must be strings", function_name); goto bad; invalid_keyword: PyErr_Format(PyExc_TypeError, #if PY_MAJOR_VERSION < 3 "%.200s() got an unexpected keyword argument '%.200s'", function_name, PyString_AsString(key)); #else "%s() got an unexpected keyword argument '%U'", function_name, key); #endif bad: return -1; } static void __Pyx_RaiseArgtupleInvalid( const char* func_name, int exact, Py_ssize_t num_min, Py_ssize_t num_max, Py_ssize_t num_found) { Py_ssize_t num_expected; const char *more_or_less; if (num_found < num_min) { num_expected = num_min; more_or_less = "at least"; } else { num_expected = num_max; more_or_less = "at most"; } if (exact) { more_or_less = "exactly"; } PyErr_Format(PyExc_TypeError, "%.200s() takes %.8s %" CYTHON_FORMAT_SSIZE_T "d positional argument%.1s (%" CYTHON_FORMAT_SSIZE_T "d given)", func_name, more_or_less, num_expected, (num_expected == 1) ? "" : "s", num_found); } #if CYTHON_COMPILING_IN_CPYTHON static CYTHON_INLINE PyObject* __Pyx_PyObject_Call(PyObject *func, PyObject *arg, PyObject *kw) { PyObject *result; ternaryfunc call = func->ob_type->tp_call; if (unlikely(!call)) return PyObject_Call(func, arg, kw); if (unlikely(Py_EnterRecursiveCall((char*)" while calling a Python object"))) return NULL; result = (*call)(func, arg, kw); Py_LeaveRecursiveCall(); if (unlikely(!result) && unlikely(!PyErr_Occurred())) { PyErr_SetString( PyExc_SystemError, "NULL result without error in PyObject_Call"); } return result; } #endif static PyObject *__Pyx_CalculateMetaclass(PyTypeObject *metaclass, PyObject *bases) { Py_ssize_t i, nbases = PyTuple_GET_SIZE(bases); for (i=0; i < nbases; i++) { PyTypeObject *tmptype; PyObject *tmp = PyTuple_GET_ITEM(bases, i); tmptype = Py_TYPE(tmp); #if PY_MAJOR_VERSION < 3 if (tmptype == &PyClass_Type) continue; #endif if (!metaclass) { metaclass = tmptype; continue; } if (PyType_IsSubtype(metaclass, tmptype)) continue; if (PyType_IsSubtype(tmptype, metaclass)) { metaclass = tmptype; continue; } PyErr_SetString(PyExc_TypeError, "metaclass conflict: " "the metaclass of a derived class " "must be a (non-strict) subclass " "of the metaclasses of all its bases"); return NULL; } if (!metaclass) { #if PY_MAJOR_VERSION < 3 metaclass = &PyClass_Type; #else metaclass = &PyType_Type; #endif } Py_INCREF((PyObject*) metaclass); return (PyObject*) metaclass; } static PyTypeObject* __Pyx_FetchCommonType(PyTypeObject* type) { PyObject* fake_module; PyTypeObject* cached_type = NULL; fake_module = PyImport_AddModule((char*) "_cython_" CYTHON_ABI); if (!fake_module) return NULL; Py_INCREF(fake_module); cached_type = (PyTypeObject*) PyObject_GetAttrString(fake_module, type->tp_name); if (cached_type) { if (!PyType_Check((PyObject*)cached_type)) { PyErr_Format(PyExc_TypeError, "Shared Cython type %.200s is not a type object", type->tp_name); goto bad; } if (cached_type->tp_basicsize != type->tp_basicsize) { PyErr_Format(PyExc_TypeError, "Shared Cython type %.200s has the wrong size, try recompiling", type->tp_name); goto bad; } } else { if (!PyErr_ExceptionMatches(PyExc_AttributeError)) goto bad; PyErr_Clear(); if (PyType_Ready(type) < 0) goto bad; if (PyObject_SetAttrString(fake_module, type->tp_name, (PyObject*) type) < 0) goto bad; Py_INCREF(type); cached_type = type; } done: Py_DECREF(fake_module); return cached_type; bad: Py_XDECREF(cached_type); cached_type = NULL; goto done; } static PyObject * __Pyx_CyFunction_get_doc(__pyx_CyFunctionObject *op, CYTHON_UNUSED void *closure) { if (unlikely(op->func_doc == NULL)) { if (op->func.m_ml->ml_doc) { #if PY_MAJOR_VERSION >= 3 op->func_doc = PyUnicode_FromString(op->func.m_ml->ml_doc); #else op->func_doc = PyString_FromString(op->func.m_ml->ml_doc); #endif if (unlikely(op->func_doc == NULL)) return NULL; } else { Py_INCREF(Py_None); return Py_None; } } Py_INCREF(op->func_doc); return op->func_doc; } static int __Pyx_CyFunction_set_doc(__pyx_CyFunctionObject *op, PyObject *value) { PyObject *tmp = op->func_doc; if (value == NULL) { value = Py_None; } Py_INCREF(value); op->func_doc = value; Py_XDECREF(tmp); return 0; } static PyObject * __Pyx_CyFunction_get_name(__pyx_CyFunctionObject *op) { if (unlikely(op->func_name == NULL)) { #if PY_MAJOR_VERSION >= 3 op->func_name = PyUnicode_InternFromString(op->func.m_ml->ml_name); #else op->func_name = PyString_InternFromString(op->func.m_ml->ml_name); #endif if (unlikely(op->func_name == NULL)) return NULL; } Py_INCREF(op->func_name); return op->func_name; } static int __Pyx_CyFunction_set_name(__pyx_CyFunctionObject *op, PyObject *value) { PyObject *tmp; #if PY_MAJOR_VERSION >= 3 if (unlikely(value == NULL || !PyUnicode_Check(value))) { #else if (unlikely(value == NULL || !PyString_Check(value))) { #endif PyErr_SetString(PyExc_TypeError, "__name__ must be set to a string object"); return -1; } tmp = op->func_name; Py_INCREF(value); op->func_name = value; Py_XDECREF(tmp); return 0; } static PyObject * __Pyx_CyFunction_get_qualname(__pyx_CyFunctionObject *op) { Py_INCREF(op->func_qualname); return op->func_qualname; } static int __Pyx_CyFunction_set_qualname(__pyx_CyFunctionObject *op, PyObject *value) { PyObject *tmp; #if PY_MAJOR_VERSION >= 3 if (unlikely(value == NULL || !PyUnicode_Check(value))) { #else if (unlikely(value == NULL || !PyString_Check(value))) { #endif PyErr_SetString(PyExc_TypeError, "__qualname__ must be set to a string object"); return -1; } tmp = op->func_qualname; Py_INCREF(value); op->func_qualname = value; Py_XDECREF(tmp); return 0; } static PyObject * __Pyx_CyFunction_get_self(__pyx_CyFunctionObject *m, CYTHON_UNUSED void *closure) { PyObject *self; self = m->func_closure; if (self == NULL) self = Py_None; Py_INCREF(self); return self; } static PyObject * __Pyx_CyFunction_get_dict(__pyx_CyFunctionObject *op) { if (unlikely(op->func_dict == NULL)) { op->func_dict = PyDict_New(); if (unlikely(op->func_dict == NULL)) return NULL; } Py_INCREF(op->func_dict); return op->func_dict; } static int __Pyx_CyFunction_set_dict(__pyx_CyFunctionObject *op, PyObject *value) { PyObject *tmp; if (unlikely(value == NULL)) { PyErr_SetString(PyExc_TypeError, "function's dictionary may not be deleted"); return -1; } if (unlikely(!PyDict_Check(value))) { PyErr_SetString(PyExc_TypeError, "setting function's dictionary to a non-dict"); return -1; } tmp = op->func_dict; Py_INCREF(value); op->func_dict = value; Py_XDECREF(tmp); return 0; } static PyObject * __Pyx_CyFunction_get_globals(__pyx_CyFunctionObject *op) { Py_INCREF(op->func_globals); return op->func_globals; } static PyObject * __Pyx_CyFunction_get_closure(CYTHON_UNUSED __pyx_CyFunctionObject *op) { Py_INCREF(Py_None); return Py_None; } static PyObject * __Pyx_CyFunction_get_code(__pyx_CyFunctionObject *op) { PyObject* result = (op->func_code) ? op->func_code : Py_None; Py_INCREF(result); return result; } static int __Pyx_CyFunction_init_defaults(__pyx_CyFunctionObject *op) { int result = 0; PyObject *res = op->defaults_getter((PyObject *) op); if (unlikely(!res)) return -1; #if CYTHON_COMPILING_IN_CPYTHON op->defaults_tuple = PyTuple_GET_ITEM(res, 0); Py_INCREF(op->defaults_tuple); op->defaults_kwdict = PyTuple_GET_ITEM(res, 1); Py_INCREF(op->defaults_kwdict); #else op->defaults_tuple = PySequence_ITEM(res, 0); if (unlikely(!op->defaults_tuple)) result = -1; else { op->defaults_kwdict = PySequence_ITEM(res, 1); if (unlikely(!op->defaults_kwdict)) result = -1; } #endif Py_DECREF(res); return result; } static int __Pyx_CyFunction_set_defaults(__pyx_CyFunctionObject *op, PyObject* value) { PyObject* tmp; if (!value) { value = Py_None; } else if (value != Py_None && !PyTuple_Check(value)) { PyErr_SetString(PyExc_TypeError, "__defaults__ must be set to a tuple object"); return -1; } Py_INCREF(value); tmp = op->defaults_tuple; op->defaults_tuple = value; Py_XDECREF(tmp); return 0; } static PyObject * __Pyx_CyFunction_get_defaults(__pyx_CyFunctionObject *op) { PyObject* result = op->defaults_tuple; if (unlikely(!result)) { if (op->defaults_getter) { if (__Pyx_CyFunction_init_defaults(op) < 0) return NULL; result = op->defaults_tuple; } else { result = Py_None; } } Py_INCREF(result); return result; } static int __Pyx_CyFunction_set_kwdefaults(__pyx_CyFunctionObject *op, PyObject* value) { PyObject* tmp; if (!value) { value = Py_None; } else if (value != Py_None && !PyDict_Check(value)) { PyErr_SetString(PyExc_TypeError, "__kwdefaults__ must be set to a dict object"); return -1; } Py_INCREF(value); tmp = op->defaults_kwdict; op->defaults_kwdict = value; Py_XDECREF(tmp); return 0; } static PyObject * __Pyx_CyFunction_get_kwdefaults(__pyx_CyFunctionObject *op) { PyObject* result = op->defaults_kwdict; if (unlikely(!result)) { if (op->defaults_getter) { if (__Pyx_CyFunction_init_defaults(op) < 0) return NULL; result = op->defaults_kwdict; } else { result = Py_None; } } Py_INCREF(result); return result; } static int __Pyx_CyFunction_set_annotations(__pyx_CyFunctionObject *op, PyObject* value) { PyObject* tmp; if (!value || value == Py_None) { value = NULL; } else if (!PyDict_Check(value)) { PyErr_SetString(PyExc_TypeError, "__annotations__ must be set to a dict object"); return -1; } Py_XINCREF(value); tmp = op->func_annotations; op->func_annotations = value; Py_XDECREF(tmp); return 0; } static PyObject * __Pyx_CyFunction_get_annotations(__pyx_CyFunctionObject *op) { PyObject* result = op->func_annotations; if (unlikely(!result)) { result = PyDict_New(); if (unlikely(!result)) return NULL; op->func_annotations = result; } Py_INCREF(result); return result; } static PyGetSetDef __pyx_CyFunction_getsets[] = { {(char *) "func_doc", (getter)__Pyx_CyFunction_get_doc, (setter)__Pyx_CyFunction_set_doc, 0, 0}, {(char *) "__doc__", (getter)__Pyx_CyFunction_get_doc, (setter)__Pyx_CyFunction_set_doc, 0, 0}, {(char *) "func_name", (getter)__Pyx_CyFunction_get_name, (setter)__Pyx_CyFunction_set_name, 0, 0}, {(char *) "__name__", (getter)__Pyx_CyFunction_get_name, (setter)__Pyx_CyFunction_set_name, 0, 0}, {(char *) "__qualname__", (getter)__Pyx_CyFunction_get_qualname, (setter)__Pyx_CyFunction_set_qualname, 0, 0}, {(char *) "__self__", (getter)__Pyx_CyFunction_get_self, 0, 0, 0}, {(char *) "func_dict", (getter)__Pyx_CyFunction_get_dict, (setter)__Pyx_CyFunction_set_dict, 0, 0}, {(char *) "__dict__", (getter)__Pyx_CyFunction_get_dict, (setter)__Pyx_CyFunction_set_dict, 0, 0}, {(char *) "func_globals", (getter)__Pyx_CyFunction_get_globals, 0, 0, 0}, {(char *) "__globals__", (getter)__Pyx_CyFunction_get_globals, 0, 0, 0}, {(char *) "func_closure", (getter)__Pyx_CyFunction_get_closure, 0, 0, 0}, {(char *) "__closure__", (getter)__Pyx_CyFunction_get_closure, 0, 0, 0}, {(char *) "func_code", (getter)__Pyx_CyFunction_get_code, 0, 0, 0}, {(char *) "__code__", (getter)__Pyx_CyFunction_get_code, 0, 0, 0}, {(char *) "func_defaults", (getter)__Pyx_CyFunction_get_defaults, (setter)__Pyx_CyFunction_set_defaults, 0, 0}, {(char *) "__defaults__", (getter)__Pyx_CyFunction_get_defaults, (setter)__Pyx_CyFunction_set_defaults, 0, 0}, {(char *) "__kwdefaults__", (getter)__Pyx_CyFunction_get_kwdefaults, (setter)__Pyx_CyFunction_set_kwdefaults, 0, 0}, {(char *) "__annotations__", (getter)__Pyx_CyFunction_get_annotations, (setter)__Pyx_CyFunction_set_annotations, 0, 0}, {0, 0, 0, 0, 0} }; static PyMemberDef __pyx_CyFunction_members[] = { {(char *) "__module__", T_OBJECT, offsetof(__pyx_CyFunctionObject, func.m_module), PY_WRITE_RESTRICTED, 0}, {0, 0, 0, 0, 0} }; static PyObject * __Pyx_CyFunction_reduce(__pyx_CyFunctionObject *m, CYTHON_UNUSED PyObject *args) { #if PY_MAJOR_VERSION >= 3 return PyUnicode_FromString(m->func.m_ml->ml_name); #else return PyString_FromString(m->func.m_ml->ml_name); #endif } static PyMethodDef __pyx_CyFunction_methods[] = { {"__reduce__", (PyCFunction)__Pyx_CyFunction_reduce, METH_VARARGS, 0}, {0, 0, 0, 0} }; #if PY_VERSION_HEX < 0x030500A0 #define __Pyx_CyFunction_weakreflist(cyfunc) ((cyfunc)->func_weakreflist) #else #define __Pyx_CyFunction_weakreflist(cyfunc) ((cyfunc)->func.m_weakreflist) #endif static PyObject *__Pyx_CyFunction_New(PyTypeObject *type, PyMethodDef *ml, int flags, PyObject* qualname, PyObject *closure, PyObject *module, PyObject* globals, PyObject* code) { __pyx_CyFunctionObject *op = PyObject_GC_New(__pyx_CyFunctionObject, type); if (op == NULL) return NULL; op->flags = flags; __Pyx_CyFunction_weakreflist(op) = NULL; op->func.m_ml = ml; op->func.m_self = (PyObject *) op; Py_XINCREF(closure); op->func_closure = closure; Py_XINCREF(module); op->func.m_module = module; op->func_dict = NULL; op->func_name = NULL; Py_INCREF(qualname); op->func_qualname = qualname; op->func_doc = NULL; op->func_classobj = NULL; op->func_globals = globals; Py_INCREF(op->func_globals); Py_XINCREF(code); op->func_code = code; op->defaults_pyobjects = 0; op->defaults = NULL; op->defaults_tuple = NULL; op->defaults_kwdict = NULL; op->defaults_getter = NULL; op->func_annotations = NULL; PyObject_GC_Track(op); return (PyObject *) op; } static int __Pyx_CyFunction_clear(__pyx_CyFunctionObject *m) { Py_CLEAR(m->func_closure); Py_CLEAR(m->func.m_module); Py_CLEAR(m->func_dict); Py_CLEAR(m->func_name); Py_CLEAR(m->func_qualname); Py_CLEAR(m->func_doc); Py_CLEAR(m->func_globals); Py_CLEAR(m->func_code); Py_CLEAR(m->func_classobj); Py_CLEAR(m->defaults_tuple); Py_CLEAR(m->defaults_kwdict); Py_CLEAR(m->func_annotations); if (m->defaults) { PyObject **pydefaults = __Pyx_CyFunction_Defaults(PyObject *, m); int i; for (i = 0; i < m->defaults_pyobjects; i++) Py_XDECREF(pydefaults[i]); PyMem_Free(m->defaults); m->defaults = NULL; } return 0; } static void __Pyx_CyFunction_dealloc(__pyx_CyFunctionObject *m) { PyObject_GC_UnTrack(m); if (__Pyx_CyFunction_weakreflist(m) != NULL) PyObject_ClearWeakRefs((PyObject *) m); __Pyx_CyFunction_clear(m); PyObject_GC_Del(m); } static int __Pyx_CyFunction_traverse(__pyx_CyFunctionObject *m, visitproc visit, void *arg) { Py_VISIT(m->func_closure); Py_VISIT(m->func.m_module); Py_VISIT(m->func_dict); Py_VISIT(m->func_name); Py_VISIT(m->func_qualname); Py_VISIT(m->func_doc); Py_VISIT(m->func_globals); Py_VISIT(m->func_code); Py_VISIT(m->func_classobj); Py_VISIT(m->defaults_tuple); Py_VISIT(m->defaults_kwdict); if (m->defaults) { PyObject **pydefaults = __Pyx_CyFunction_Defaults(PyObject *, m); int i; for (i = 0; i < m->defaults_pyobjects; i++) Py_VISIT(pydefaults[i]); } return 0; } static PyObject *__Pyx_CyFunction_descr_get(PyObject *func, PyObject *obj, PyObject *type) { __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func; if (m->flags & __Pyx_CYFUNCTION_STATICMETHOD) { Py_INCREF(func); return func; } if (m->flags & __Pyx_CYFUNCTION_CLASSMETHOD) { if (type == NULL) type = (PyObject *)(Py_TYPE(obj)); return __Pyx_PyMethod_New(func, type, (PyObject *)(Py_TYPE(type))); } if (obj == Py_None) obj = NULL; return __Pyx_PyMethod_New(func, obj, type); } static PyObject* __Pyx_CyFunction_repr(__pyx_CyFunctionObject *op) { #if PY_MAJOR_VERSION >= 3 return PyUnicode_FromFormat("", op->func_qualname, (void *)op); #else return PyString_FromFormat("", PyString_AsString(op->func_qualname), (void *)op); #endif } #if CYTHON_COMPILING_IN_PYPY static PyObject * __Pyx_CyFunction_Call(PyObject *func, PyObject *arg, PyObject *kw) { PyCFunctionObject* f = (PyCFunctionObject*)func; PyCFunction meth = f->m_ml->ml_meth; PyObject *self = f->m_self; Py_ssize_t size; switch (f->m_ml->ml_flags & (METH_VARARGS | METH_KEYWORDS | METH_NOARGS | METH_O)) { case METH_VARARGS: if (likely(kw == NULL || PyDict_Size(kw) == 0)) return (*meth)(self, arg); break; case METH_VARARGS | METH_KEYWORDS: return (*(PyCFunctionWithKeywords)meth)(self, arg, kw); case METH_NOARGS: if (likely(kw == NULL || PyDict_Size(kw) == 0)) { size = PyTuple_GET_SIZE(arg); if (likely(size == 0)) return (*meth)(self, NULL); PyErr_Format(PyExc_TypeError, "%.200s() takes no arguments (%" CYTHON_FORMAT_SSIZE_T "d given)", f->m_ml->ml_name, size); return NULL; } break; case METH_O: if (likely(kw == NULL || PyDict_Size(kw) == 0)) { size = PyTuple_GET_SIZE(arg); if (likely(size == 1)) { PyObject *result, *arg0 = PySequence_ITEM(arg, 0); if (unlikely(!arg0)) return NULL; result = (*meth)(self, arg0); Py_DECREF(arg0); return result; } PyErr_Format(PyExc_TypeError, "%.200s() takes exactly one argument (%" CYTHON_FORMAT_SSIZE_T "d given)", f->m_ml->ml_name, size); return NULL; } break; default: PyErr_SetString(PyExc_SystemError, "Bad call flags in " "__Pyx_CyFunction_Call. METH_OLDARGS is no " "longer supported!"); return NULL; } PyErr_Format(PyExc_TypeError, "%.200s() takes no keyword arguments", f->m_ml->ml_name); return NULL; } #else static PyObject * __Pyx_CyFunction_Call(PyObject *func, PyObject *arg, PyObject *kw) { return PyCFunction_Call(func, arg, kw); } #endif static PyTypeObject __pyx_CyFunctionType_type = { PyVarObject_HEAD_INIT(0, 0) "cython_function_or_method", sizeof(__pyx_CyFunctionObject), 0, (destructor) __Pyx_CyFunction_dealloc, 0, 0, 0, #if PY_MAJOR_VERSION < 3 0, #else 0, #endif (reprfunc) __Pyx_CyFunction_repr, 0, 0, 0, 0, __Pyx_CyFunction_Call, 0, 0, 0, 0, Py_TPFLAGS_DEFAULT | Py_TPFLAGS_HAVE_GC, 0, (traverseproc) __Pyx_CyFunction_traverse, (inquiry) __Pyx_CyFunction_clear, 0, #if PY_VERSION_HEX < 0x030500A0 offsetof(__pyx_CyFunctionObject, func_weakreflist), #else offsetof(PyCFunctionObject, m_weakreflist), #endif 0, 0, __pyx_CyFunction_methods, __pyx_CyFunction_members, __pyx_CyFunction_getsets, 0, 0, __Pyx_CyFunction_descr_get, 0, offsetof(__pyx_CyFunctionObject, func_dict), 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, #if PY_VERSION_HEX >= 0x030400a1 0, #endif }; static int __pyx_CyFunction_init(void) { #if !CYTHON_COMPILING_IN_PYPY __pyx_CyFunctionType_type.tp_call = PyCFunction_Call; #endif __pyx_CyFunctionType = __Pyx_FetchCommonType(&__pyx_CyFunctionType_type); if (__pyx_CyFunctionType == NULL) { return -1; } return 0; } static CYTHON_INLINE void *__Pyx_CyFunction_InitDefaults(PyObject *func, size_t size, int pyobjects) { __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func; m->defaults = PyMem_Malloc(size); if (!m->defaults) return PyErr_NoMemory(); memset(m->defaults, 0, size); m->defaults_pyobjects = pyobjects; return m->defaults; } static CYTHON_INLINE void __Pyx_CyFunction_SetDefaultsTuple(PyObject *func, PyObject *tuple) { __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func; m->defaults_tuple = tuple; Py_INCREF(tuple); } static CYTHON_INLINE void __Pyx_CyFunction_SetDefaultsKwDict(PyObject *func, PyObject *dict) { __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func; m->defaults_kwdict = dict; Py_INCREF(dict); } static CYTHON_INLINE void __Pyx_CyFunction_SetAnnotationsDict(PyObject *func, PyObject *dict) { __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func; m->func_annotations = dict; Py_INCREF(dict); } static PyObject *__Pyx_Py3MetaclassPrepare(PyObject *metaclass, PyObject *bases, PyObject *name, PyObject *qualname, PyObject *mkw, PyObject *modname, PyObject *doc) { PyObject *ns; if (metaclass) { PyObject *prep = __Pyx_PyObject_GetAttrStr(metaclass, __pyx_n_s_prepare); if (prep) { PyObject *pargs = PyTuple_Pack(2, name, bases); if (unlikely(!pargs)) { Py_DECREF(prep); return NULL; } ns = PyObject_Call(prep, pargs, mkw); Py_DECREF(prep); Py_DECREF(pargs); } else { if (unlikely(!PyErr_ExceptionMatches(PyExc_AttributeError))) return NULL; PyErr_Clear(); ns = PyDict_New(); } } else { ns = PyDict_New(); } if (unlikely(!ns)) return NULL; if (unlikely(PyObject_SetItem(ns, __pyx_n_s_module, modname) < 0)) goto bad; if (unlikely(PyObject_SetItem(ns, __pyx_n_s_qualname, qualname) < 0)) goto bad; if (unlikely(doc && PyObject_SetItem(ns, __pyx_n_s_doc, doc) < 0)) goto bad; return ns; bad: Py_DECREF(ns); return NULL; } static PyObject *__Pyx_Py3ClassCreate(PyObject *metaclass, PyObject *name, PyObject *bases, PyObject *dict, PyObject *mkw, int calculate_metaclass, int allow_py2_metaclass) { PyObject *result, *margs; PyObject *owned_metaclass = NULL; if (allow_py2_metaclass) { owned_metaclass = PyObject_GetItem(dict, __pyx_n_s_metaclass); if (owned_metaclass) { metaclass = owned_metaclass; } else if (likely(PyErr_ExceptionMatches(PyExc_KeyError))) { PyErr_Clear(); } else { return NULL; } } if (calculate_metaclass && (!metaclass || PyType_Check(metaclass))) { metaclass = __Pyx_CalculateMetaclass((PyTypeObject*) metaclass, bases); Py_XDECREF(owned_metaclass); if (unlikely(!metaclass)) return NULL; owned_metaclass = metaclass; } margs = PyTuple_Pack(3, name, bases, dict); if (unlikely(!margs)) { result = NULL; } else { result = PyObject_Call(metaclass, margs, mkw); Py_DECREF(margs); } Py_XDECREF(owned_metaclass); return result; } static int __pyx_bisect_code_objects(__Pyx_CodeObjectCacheEntry* entries, int count, int code_line) { int start = 0, mid = 0, end = count - 1; if (end >= 0 && code_line > entries[end].code_line) { return count; } while (start < end) { mid = start + (end - start) / 2; if (code_line < entries[mid].code_line) { end = mid; } else if (code_line > entries[mid].code_line) { start = mid + 1; } else { return mid; } } if (code_line <= entries[mid].code_line) { return mid; } else { return mid + 1; } } static PyCodeObject *__pyx_find_code_object(int code_line) { PyCodeObject* code_object; int pos; if (unlikely(!code_line) || unlikely(!__pyx_code_cache.entries)) { return NULL; } pos = __pyx_bisect_code_objects(__pyx_code_cache.entries, __pyx_code_cache.count, code_line); if (unlikely(pos >= __pyx_code_cache.count) || unlikely(__pyx_code_cache.entries[pos].code_line != code_line)) { return NULL; } code_object = __pyx_code_cache.entries[pos].code_object; Py_INCREF(code_object); return code_object; } static void __pyx_insert_code_object(int code_line, PyCodeObject* code_object) { int pos, i; __Pyx_CodeObjectCacheEntry* entries = __pyx_code_cache.entries; if (unlikely(!code_line)) { return; } if (unlikely(!entries)) { entries = (__Pyx_CodeObjectCacheEntry*)PyMem_Malloc(64*sizeof(__Pyx_CodeObjectCacheEntry)); if (likely(entries)) { __pyx_code_cache.entries = entries; __pyx_code_cache.max_count = 64; __pyx_code_cache.count = 1; entries[0].code_line = code_line; entries[0].code_object = code_object; Py_INCREF(code_object); } return; } pos = __pyx_bisect_code_objects(__pyx_code_cache.entries, __pyx_code_cache.count, code_line); if ((pos < __pyx_code_cache.count) && unlikely(__pyx_code_cache.entries[pos].code_line == code_line)) { PyCodeObject* tmp = entries[pos].code_object; entries[pos].code_object = code_object; Py_DECREF(tmp); return; } if (__pyx_code_cache.count == __pyx_code_cache.max_count) { int new_max = __pyx_code_cache.max_count + 64; entries = (__Pyx_CodeObjectCacheEntry*)PyMem_Realloc( __pyx_code_cache.entries, (size_t)new_max*sizeof(__Pyx_CodeObjectCacheEntry)); if (unlikely(!entries)) { return; } __pyx_code_cache.entries = entries; __pyx_code_cache.max_count = new_max; } for (i=__pyx_code_cache.count; i>pos; i--) { entries[i] = entries[i-1]; } entries[pos].code_line = code_line; entries[pos].code_object = code_object; __pyx_code_cache.count++; Py_INCREF(code_object); } #include "compile.h" #include "frameobject.h" #include "traceback.h" static PyCodeObject* __Pyx_CreateCodeObjectForTraceback( const char *funcname, int c_line, int py_line, const char *filename) { PyCodeObject *py_code = 0; PyObject *py_srcfile = 0; PyObject *py_funcname = 0; #if PY_MAJOR_VERSION < 3 py_srcfile = PyString_FromString(filename); #else py_srcfile = PyUnicode_FromString(filename); #endif if (!py_srcfile) goto bad; if (c_line) { #if PY_MAJOR_VERSION < 3 py_funcname = PyString_FromFormat( "%s (%s:%d)", funcname, __pyx_cfilenm, c_line); #else py_funcname = PyUnicode_FromFormat( "%s (%s:%d)", funcname, __pyx_cfilenm, c_line); #endif } else { #if PY_MAJOR_VERSION < 3 py_funcname = PyString_FromString(funcname); #else py_funcname = PyUnicode_FromString(funcname); #endif } if (!py_funcname) goto bad; py_code = __Pyx_PyCode_New( 0, 0, 0, 0, 0, __pyx_empty_bytes, /*PyObject *code,*/ __pyx_empty_tuple, /*PyObject *consts,*/ __pyx_empty_tuple, /*PyObject *names,*/ __pyx_empty_tuple, /*PyObject *varnames,*/ __pyx_empty_tuple, /*PyObject *freevars,*/ __pyx_empty_tuple, /*PyObject *cellvars,*/ py_srcfile, /*PyObject *filename,*/ py_funcname, /*PyObject *name,*/ py_line, __pyx_empty_bytes /*PyObject *lnotab*/ ); Py_DECREF(py_srcfile); Py_DECREF(py_funcname); return py_code; bad: Py_XDECREF(py_srcfile); Py_XDECREF(py_funcname); return NULL; } static void __Pyx_AddTraceback(const char *funcname, int c_line, int py_line, const char *filename) { PyCodeObject *py_code = 0; PyFrameObject *py_frame = 0; py_code = __pyx_find_code_object(c_line ? c_line : py_line); if (!py_code) { py_code = __Pyx_CreateCodeObjectForTraceback( funcname, c_line, py_line, filename); if (!py_code) goto bad; __pyx_insert_code_object(c_line ? c_line : py_line, py_code); } py_frame = PyFrame_New( PyThreadState_GET(), /*PyThreadState *tstate,*/ py_code, /*PyCodeObject *code,*/ __pyx_d, /*PyObject *globals,*/ 0 /*PyObject *locals*/ ); if (!py_frame) goto bad; py_frame->f_lineno = py_line; PyTraceBack_Here(py_frame); bad: Py_XDECREF(py_code); Py_XDECREF(py_frame); } static CYTHON_INLINE PyObject* __Pyx_PyInt_From_long(long value) { const long neg_one = (long) -1, const_zero = (long) 0; const int is_unsigned = neg_one > const_zero; if (is_unsigned) { if (sizeof(long) < sizeof(long)) { return PyInt_FromLong((long) value); } else if (sizeof(long) <= sizeof(unsigned long)) { return PyLong_FromUnsignedLong((unsigned long) value); } else if (sizeof(long) <= sizeof(unsigned PY_LONG_LONG)) { return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value); } } else { if (sizeof(long) <= sizeof(long)) { return PyInt_FromLong((long) value); } else if (sizeof(long) <= sizeof(PY_LONG_LONG)) { return PyLong_FromLongLong((PY_LONG_LONG) value); } } { int one = 1; int little = (int)*(unsigned char *)&one; unsigned char *bytes = (unsigned char *)&value; return _PyLong_FromByteArray(bytes, sizeof(long), little, !is_unsigned); } } #define __PYX_VERIFY_RETURN_INT(target_type, func_type, func_value)\ __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, 0) #define __PYX_VERIFY_RETURN_INT_EXC(target_type, func_type, func_value)\ __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, 1) #define __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, exc)\ {\ func_type value = func_value;\ if (sizeof(target_type) < sizeof(func_type)) {\ if (unlikely(value != (func_type) (target_type) value)) {\ func_type zero = 0;\ if (exc && unlikely(value == (func_type)-1 && PyErr_Occurred()))\ return (target_type) -1;\ if (is_unsigned && unlikely(value < zero))\ goto raise_neg_overflow;\ else\ goto raise_overflow;\ }\ }\ return (target_type) value;\ } #if CYTHON_USE_PYLONG_INTERNALS #include "longintrepr.h" #endif static CYTHON_INLINE long __Pyx_PyInt_As_long(PyObject *x) { const long neg_one = (long) -1, const_zero = (long) 0; const int is_unsigned = neg_one > const_zero; #if PY_MAJOR_VERSION < 3 if (likely(PyInt_Check(x))) { if (sizeof(long) < sizeof(long)) { __PYX_VERIFY_RETURN_INT(long, long, PyInt_AS_LONG(x)) } else { long val = PyInt_AS_LONG(x); if (is_unsigned && unlikely(val < 0)) { goto raise_neg_overflow; } return (long) val; } } else #endif if (likely(PyLong_Check(x))) { if (is_unsigned) { #if CYTHON_USE_PYLONG_INTERNALS const digit* digits = ((PyLongObject*)x)->ob_digit; switch (Py_SIZE(x)) { case 0: return (long) 0; case 1: __PYX_VERIFY_RETURN_INT(long, digit, digits[0]) case 2: if (8 * sizeof(long) > 1 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(long) >= 2 * PyLong_SHIFT) { return (long) (((((long)digits[1]) << PyLong_SHIFT) | (long)digits[0])); } } break; case 3: if (8 * sizeof(long) > 2 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(long) >= 3 * PyLong_SHIFT) { return (long) (((((((long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0])); } } break; case 4: if (8 * sizeof(long) > 3 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(long) >= 4 * PyLong_SHIFT) { return (long) (((((((((long)digits[3]) << PyLong_SHIFT) | (long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0])); } } break; } #endif #if CYTHON_COMPILING_IN_CPYTHON if (unlikely(Py_SIZE(x) < 0)) { goto raise_neg_overflow; } #else { int result = PyObject_RichCompareBool(x, Py_False, Py_LT); if (unlikely(result < 0)) return (long) -1; if (unlikely(result == 1)) goto raise_neg_overflow; } #endif if (sizeof(long) <= sizeof(unsigned long)) { __PYX_VERIFY_RETURN_INT_EXC(long, unsigned long, PyLong_AsUnsignedLong(x)) } else if (sizeof(long) <= sizeof(unsigned PY_LONG_LONG)) { __PYX_VERIFY_RETURN_INT_EXC(long, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x)) } } else { #if CYTHON_USE_PYLONG_INTERNALS const digit* digits = ((PyLongObject*)x)->ob_digit; switch (Py_SIZE(x)) { case 0: return (long) 0; case -1: __PYX_VERIFY_RETURN_INT(long, sdigit, -(sdigit) digits[0]) case 1: __PYX_VERIFY_RETURN_INT(long, digit, +digits[0]) case -2: if (8 * sizeof(long) - 1 > 1 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(long, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) { return (long) (((long)-1)*(((((long)digits[1]) << PyLong_SHIFT) | (long)digits[0]))); } } break; case 2: if (8 * sizeof(long) > 1 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) { return (long) ((((((long)digits[1]) << PyLong_SHIFT) | (long)digits[0]))); } } break; case -3: if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(long, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) { return (long) (((long)-1)*(((((((long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0]))); } } break; case 3: if (8 * sizeof(long) > 2 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) { return (long) ((((((((long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0]))); } } break; case -4: if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(long, long, -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(long) - 1 > 4 * PyLong_SHIFT) { return (long) (((long)-1)*(((((((((long)digits[3]) << PyLong_SHIFT) | (long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0]))); } } break; case 4: if (8 * sizeof(long) > 3 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(long) - 1 > 4 * PyLong_SHIFT) { return (long) ((((((((((long)digits[3]) << PyLong_SHIFT) | (long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0]))); } } break; } #endif if (sizeof(long) <= sizeof(long)) { __PYX_VERIFY_RETURN_INT_EXC(long, long, PyLong_AsLong(x)) } else if (sizeof(long) <= sizeof(PY_LONG_LONG)) { __PYX_VERIFY_RETURN_INT_EXC(long, PY_LONG_LONG, PyLong_AsLongLong(x)) } } { #if CYTHON_COMPILING_IN_PYPY && !defined(_PyLong_AsByteArray) PyErr_SetString(PyExc_RuntimeError, "_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers"); #else long val; PyObject *v = __Pyx_PyNumber_Int(x); #if PY_MAJOR_VERSION < 3 if (likely(v) && !PyLong_Check(v)) { PyObject *tmp = v; v = PyNumber_Long(tmp); Py_DECREF(tmp); } #endif if (likely(v)) { int one = 1; int is_little = (int)*(unsigned char *)&one; unsigned char *bytes = (unsigned char *)&val; int ret = _PyLong_AsByteArray((PyLongObject *)v, bytes, sizeof(val), is_little, !is_unsigned); Py_DECREF(v); if (likely(!ret)) return val; } #endif return (long) -1; } } else { long val; PyObject *tmp = __Pyx_PyNumber_Int(x); if (!tmp) return (long) -1; val = __Pyx_PyInt_As_long(tmp); Py_DECREF(tmp); return val; } raise_overflow: PyErr_SetString(PyExc_OverflowError, "value too large to convert to long"); return (long) -1; raise_neg_overflow: PyErr_SetString(PyExc_OverflowError, "can't convert negative value to long"); return (long) -1; } static CYTHON_INLINE int __Pyx_PyInt_As_int(PyObject *x) { const int neg_one = (int) -1, const_zero = (int) 0; const int is_unsigned = neg_one > const_zero; #if PY_MAJOR_VERSION < 3 if (likely(PyInt_Check(x))) { if (sizeof(int) < sizeof(long)) { __PYX_VERIFY_RETURN_INT(int, long, PyInt_AS_LONG(x)) } else { long val = PyInt_AS_LONG(x); if (is_unsigned && unlikely(val < 0)) { goto raise_neg_overflow; } return (int) val; } } else #endif if (likely(PyLong_Check(x))) { if (is_unsigned) { #if CYTHON_USE_PYLONG_INTERNALS const digit* digits = ((PyLongObject*)x)->ob_digit; switch (Py_SIZE(x)) { case 0: return (int) 0; case 1: __PYX_VERIFY_RETURN_INT(int, digit, digits[0]) case 2: if (8 * sizeof(int) > 1 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(int) >= 2 * PyLong_SHIFT) { return (int) (((((int)digits[1]) << PyLong_SHIFT) | (int)digits[0])); } } break; case 3: if (8 * sizeof(int) > 2 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(int) >= 3 * PyLong_SHIFT) { return (int) (((((((int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0])); } } break; case 4: if (8 * sizeof(int) > 3 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(int) >= 4 * PyLong_SHIFT) { return (int) (((((((((int)digits[3]) << PyLong_SHIFT) | (int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0])); } } break; } #endif #if CYTHON_COMPILING_IN_CPYTHON if (unlikely(Py_SIZE(x) < 0)) { goto raise_neg_overflow; } #else { int result = PyObject_RichCompareBool(x, Py_False, Py_LT); if (unlikely(result < 0)) return (int) -1; if (unlikely(result == 1)) goto raise_neg_overflow; } #endif if (sizeof(int) <= sizeof(unsigned long)) { __PYX_VERIFY_RETURN_INT_EXC(int, unsigned long, PyLong_AsUnsignedLong(x)) } else if (sizeof(int) <= sizeof(unsigned PY_LONG_LONG)) { __PYX_VERIFY_RETURN_INT_EXC(int, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x)) } } else { #if CYTHON_USE_PYLONG_INTERNALS const digit* digits = ((PyLongObject*)x)->ob_digit; switch (Py_SIZE(x)) { case 0: return (int) 0; case -1: __PYX_VERIFY_RETURN_INT(int, sdigit, -(sdigit) digits[0]) case 1: __PYX_VERIFY_RETURN_INT(int, digit, +digits[0]) case -2: if (8 * sizeof(int) - 1 > 1 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(int, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(int) - 1 > 2 * PyLong_SHIFT) { return (int) (((int)-1)*(((((int)digits[1]) << PyLong_SHIFT) | (int)digits[0]))); } } break; case 2: if (8 * sizeof(int) > 1 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(int) - 1 > 2 * PyLong_SHIFT) { return (int) ((((((int)digits[1]) << PyLong_SHIFT) | (int)digits[0]))); } } break; case -3: if (8 * sizeof(int) - 1 > 2 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(int, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(int) - 1 > 3 * PyLong_SHIFT) { return (int) (((int)-1)*(((((((int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0]))); } } break; case 3: if (8 * sizeof(int) > 2 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(int) - 1 > 3 * PyLong_SHIFT) { return (int) ((((((((int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0]))); } } break; case -4: if (8 * sizeof(int) - 1 > 3 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(int, long, -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(int) - 1 > 4 * PyLong_SHIFT) { return (int) (((int)-1)*(((((((((int)digits[3]) << PyLong_SHIFT) | (int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0]))); } } break; case 4: if (8 * sizeof(int) > 3 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(int) - 1 > 4 * PyLong_SHIFT) { return (int) ((((((((((int)digits[3]) << PyLong_SHIFT) | (int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0]))); } } break; } #endif if (sizeof(int) <= sizeof(long)) { __PYX_VERIFY_RETURN_INT_EXC(int, long, PyLong_AsLong(x)) } else if (sizeof(int) <= sizeof(PY_LONG_LONG)) { __PYX_VERIFY_RETURN_INT_EXC(int, PY_LONG_LONG, PyLong_AsLongLong(x)) } } { #if CYTHON_COMPILING_IN_PYPY && !defined(_PyLong_AsByteArray) PyErr_SetString(PyExc_RuntimeError, "_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers"); #else int val; PyObject *v = __Pyx_PyNumber_Int(x); #if PY_MAJOR_VERSION < 3 if (likely(v) && !PyLong_Check(v)) { PyObject *tmp = v; v = PyNumber_Long(tmp); Py_DECREF(tmp); } #endif if (likely(v)) { int one = 1; int is_little = (int)*(unsigned char *)&one; unsigned char *bytes = (unsigned char *)&val; int ret = _PyLong_AsByteArray((PyLongObject *)v, bytes, sizeof(val), is_little, !is_unsigned); Py_DECREF(v); if (likely(!ret)) return val; } #endif return (int) -1; } } else { int val; PyObject *tmp = __Pyx_PyNumber_Int(x); if (!tmp) return (int) -1; val = __Pyx_PyInt_As_int(tmp); Py_DECREF(tmp); return val; } raise_overflow: PyErr_SetString(PyExc_OverflowError, "value too large to convert to int"); return (int) -1; raise_neg_overflow: PyErr_SetString(PyExc_OverflowError, "can't convert negative value to int"); return (int) -1; } static int __Pyx_check_binary_version(void) { char ctversion[4], rtversion[4]; PyOS_snprintf(ctversion, 4, "%d.%d", PY_MAJOR_VERSION, PY_MINOR_VERSION); PyOS_snprintf(rtversion, 4, "%s", Py_GetVersion()); if (ctversion[0] != rtversion[0] || ctversion[2] != rtversion[2]) { char message[200]; PyOS_snprintf(message, sizeof(message), "compiletime version %s of module '%.100s' " "does not match runtime version %s", ctversion, __Pyx_MODULE_NAME, rtversion); return PyErr_WarnEx(NULL, message, 1); } return 0; } static int __Pyx_InitStrings(__Pyx_StringTabEntry *t) { while (t->p) { #if PY_MAJOR_VERSION < 3 if (t->is_unicode) { *t->p = PyUnicode_DecodeUTF8(t->s, t->n - 1, NULL); } else if (t->intern) { *t->p = PyString_InternFromString(t->s); } else { *t->p = PyString_FromStringAndSize(t->s, t->n - 1); } #else if (t->is_unicode | t->is_str) { if (t->intern) { *t->p = PyUnicode_InternFromString(t->s); } else if (t->encoding) { *t->p = PyUnicode_Decode(t->s, t->n - 1, t->encoding, NULL); } else { *t->p = PyUnicode_FromStringAndSize(t->s, t->n - 1); } } else { *t->p = PyBytes_FromStringAndSize(t->s, t->n - 1); } #endif if (!*t->p) return -1; ++t; } return 0; } static CYTHON_INLINE PyObject* __Pyx_PyUnicode_FromString(const char* c_str) { return __Pyx_PyUnicode_FromStringAndSize(c_str, (Py_ssize_t)strlen(c_str)); } static CYTHON_INLINE char* __Pyx_PyObject_AsString(PyObject* o) { Py_ssize_t ignore; return __Pyx_PyObject_AsStringAndSize(o, &ignore); } static CYTHON_INLINE char* __Pyx_PyObject_AsStringAndSize(PyObject* o, Py_ssize_t *length) { #if CYTHON_COMPILING_IN_CPYTHON && (__PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT) if ( #if PY_MAJOR_VERSION < 3 && __PYX_DEFAULT_STRING_ENCODING_IS_ASCII __Pyx_sys_getdefaultencoding_not_ascii && #endif PyUnicode_Check(o)) { #if PY_VERSION_HEX < 0x03030000 char* defenc_c; PyObject* defenc = _PyUnicode_AsDefaultEncodedString(o, NULL); if (!defenc) return NULL; defenc_c = PyBytes_AS_STRING(defenc); #if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII { char* end = defenc_c + PyBytes_GET_SIZE(defenc); char* c; for (c = defenc_c; c < end; c++) { if ((unsigned char) (*c) >= 128) { PyUnicode_AsASCIIString(o); return NULL; } } } #endif *length = PyBytes_GET_SIZE(defenc); return defenc_c; #else if (__Pyx_PyUnicode_READY(o) == -1) return NULL; #if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII if (PyUnicode_IS_ASCII(o)) { *length = PyUnicode_GET_LENGTH(o); return PyUnicode_AsUTF8(o); } else { PyUnicode_AsASCIIString(o); return NULL; } #else return PyUnicode_AsUTF8AndSize(o, length); #endif #endif } else #endif #if (!CYTHON_COMPILING_IN_PYPY) || (defined(PyByteArray_AS_STRING) && defined(PyByteArray_GET_SIZE)) if (PyByteArray_Check(o)) { *length = PyByteArray_GET_SIZE(o); return PyByteArray_AS_STRING(o); } else #endif { char* result; int r = PyBytes_AsStringAndSize(o, &result, length); if (unlikely(r < 0)) { return NULL; } else { return result; } } } static CYTHON_INLINE int __Pyx_PyObject_IsTrue(PyObject* x) { int is_true = x == Py_True; if (is_true | (x == Py_False) | (x == Py_None)) return is_true; else return PyObject_IsTrue(x); } static CYTHON_INLINE PyObject* __Pyx_PyNumber_Int(PyObject* x) { PyNumberMethods *m; const char *name = NULL; PyObject *res = NULL; #if PY_MAJOR_VERSION < 3 if (PyInt_Check(x) || PyLong_Check(x)) #else if (PyLong_Check(x)) #endif return __Pyx_NewRef(x); m = Py_TYPE(x)->tp_as_number; #if PY_MAJOR_VERSION < 3 if (m && m->nb_int) { name = "int"; res = PyNumber_Int(x); } else if (m && m->nb_long) { name = "long"; res = PyNumber_Long(x); } #else if (m && m->nb_int) { name = "int"; res = PyNumber_Long(x); } #endif if (res) { #if PY_MAJOR_VERSION < 3 if (!PyInt_Check(res) && !PyLong_Check(res)) { #else if (!PyLong_Check(res)) { #endif PyErr_Format(PyExc_TypeError, "__%.4s__ returned non-%.4s (type %.200s)", name, name, Py_TYPE(res)->tp_name); Py_DECREF(res); return NULL; } } else if (!PyErr_Occurred()) { PyErr_SetString(PyExc_TypeError, "an integer is required"); } return res; } static CYTHON_INLINE Py_ssize_t __Pyx_PyIndex_AsSsize_t(PyObject* b) { Py_ssize_t ival; PyObject *x; #if PY_MAJOR_VERSION < 3 if (likely(PyInt_CheckExact(b))) { if (sizeof(Py_ssize_t) >= sizeof(long)) return PyInt_AS_LONG(b); else return PyInt_AsSsize_t(x); } #endif if (likely(PyLong_CheckExact(b))) { #if CYTHON_USE_PYLONG_INTERNALS const digit* digits = ((PyLongObject*)b)->ob_digit; const Py_ssize_t size = Py_SIZE(b); if (likely(__Pyx_sst_abs(size) <= 1)) { ival = likely(size) ? digits[0] : 0; if (size == -1) ival = -ival; return ival; } else { switch (size) { case 2: if (8 * sizeof(Py_ssize_t) > 2 * PyLong_SHIFT) { return (Py_ssize_t) (((((size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])); } break; case -2: if (8 * sizeof(Py_ssize_t) > 2 * PyLong_SHIFT) { return -(Py_ssize_t) (((((size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])); } break; case 3: if (8 * sizeof(Py_ssize_t) > 3 * PyLong_SHIFT) { return (Py_ssize_t) (((((((size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])); } break; case -3: if (8 * sizeof(Py_ssize_t) > 3 * PyLong_SHIFT) { return -(Py_ssize_t) (((((((size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])); } break; case 4: if (8 * sizeof(Py_ssize_t) > 4 * PyLong_SHIFT) { return (Py_ssize_t) (((((((((size_t)digits[3]) << PyLong_SHIFT) | (size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])); } break; case -4: if (8 * sizeof(Py_ssize_t) > 4 * PyLong_SHIFT) { return -(Py_ssize_t) (((((((((size_t)digits[3]) << PyLong_SHIFT) | (size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])); } break; } } #endif return PyLong_AsSsize_t(b); } x = PyNumber_Index(b); if (!x) return -1; ival = PyInt_AsSsize_t(x); Py_DECREF(x); return ival; } static CYTHON_INLINE PyObject * __Pyx_PyInt_FromSize_t(size_t ival) { return PyInt_FromSize_t(ival); } #endif /* Py_PYTHON_H */ pygame_sdl2-2.1.0-for-renpy-6.99.14.1/gen/pygame_sdl2.render.c0000664000175000017500000163737012660500000022655 0ustar tomtom00000000000000/* Generated by Cython 0.23.4 */ #define PY_SSIZE_T_CLEAN #include "Python.h" #ifndef Py_PYTHON_H #error Python headers needed to compile C extensions, please install development version of Python. #elif PY_VERSION_HEX < 0x02060000 || (0x03000000 <= PY_VERSION_HEX && PY_VERSION_HEX < 0x03020000) #error Cython requires Python 2.6+ or Python 3.2+. #else #define CYTHON_ABI "0_23_4" #include #ifndef offsetof #define offsetof(type, member) ( (size_t) & ((type*)0) -> member ) #endif #if !defined(WIN32) && !defined(MS_WINDOWS) #ifndef __stdcall #define __stdcall #endif #ifndef __cdecl #define __cdecl #endif #ifndef __fastcall #define __fastcall #endif #endif #ifndef DL_IMPORT #define DL_IMPORT(t) t #endif #ifndef DL_EXPORT #define DL_EXPORT(t) t #endif #ifndef PY_LONG_LONG #define PY_LONG_LONG LONG_LONG #endif #ifndef Py_HUGE_VAL #define Py_HUGE_VAL HUGE_VAL #endif #ifdef PYPY_VERSION #define CYTHON_COMPILING_IN_PYPY 1 #define CYTHON_COMPILING_IN_CPYTHON 0 #else #define CYTHON_COMPILING_IN_PYPY 0 #define CYTHON_COMPILING_IN_CPYTHON 1 #endif #if !defined(CYTHON_USE_PYLONG_INTERNALS) && CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x02070000 #define CYTHON_USE_PYLONG_INTERNALS 1 #endif #if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX < 0x02070600 && !defined(Py_OptimizeFlag) #define Py_OptimizeFlag 0 #endif #define __PYX_BUILD_PY_SSIZE_T "n" #define CYTHON_FORMAT_SSIZE_T "z" #if PY_MAJOR_VERSION < 3 #define __Pyx_BUILTIN_MODULE_NAME "__builtin__" #define __Pyx_PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)\ PyCode_New(a+k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos) #define __Pyx_DefaultClassType PyClass_Type #else #define __Pyx_BUILTIN_MODULE_NAME "builtins" #define __Pyx_PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)\ PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos) #define __Pyx_DefaultClassType PyType_Type #endif #ifndef Py_TPFLAGS_CHECKTYPES #define Py_TPFLAGS_CHECKTYPES 0 #endif #ifndef Py_TPFLAGS_HAVE_INDEX #define Py_TPFLAGS_HAVE_INDEX 0 #endif #ifndef Py_TPFLAGS_HAVE_NEWBUFFER #define Py_TPFLAGS_HAVE_NEWBUFFER 0 #endif #ifndef Py_TPFLAGS_HAVE_FINALIZE #define Py_TPFLAGS_HAVE_FINALIZE 0 #endif #if PY_VERSION_HEX > 0x03030000 && defined(PyUnicode_KIND) #define CYTHON_PEP393_ENABLED 1 #define __Pyx_PyUnicode_READY(op) (likely(PyUnicode_IS_READY(op)) ?\ 0 : _PyUnicode_Ready((PyObject *)(op))) #define __Pyx_PyUnicode_GET_LENGTH(u) PyUnicode_GET_LENGTH(u) #define __Pyx_PyUnicode_READ_CHAR(u, i) PyUnicode_READ_CHAR(u, i) #define __Pyx_PyUnicode_KIND(u) PyUnicode_KIND(u) #define __Pyx_PyUnicode_DATA(u) PyUnicode_DATA(u) #define __Pyx_PyUnicode_READ(k, d, i) PyUnicode_READ(k, d, i) #else #define CYTHON_PEP393_ENABLED 0 #define __Pyx_PyUnicode_READY(op) (0) #define __Pyx_PyUnicode_GET_LENGTH(u) PyUnicode_GET_SIZE(u) #define __Pyx_PyUnicode_READ_CHAR(u, i) ((Py_UCS4)(PyUnicode_AS_UNICODE(u)[i])) #define __Pyx_PyUnicode_KIND(u) (sizeof(Py_UNICODE)) #define __Pyx_PyUnicode_DATA(u) ((void*)PyUnicode_AS_UNICODE(u)) #define __Pyx_PyUnicode_READ(k, d, i) ((void)(k), (Py_UCS4)(((Py_UNICODE*)d)[i])) #endif #if CYTHON_COMPILING_IN_PYPY #define __Pyx_PyUnicode_Concat(a, b) PyNumber_Add(a, b) #define __Pyx_PyUnicode_ConcatSafe(a, b) PyNumber_Add(a, b) #else #define __Pyx_PyUnicode_Concat(a, b) PyUnicode_Concat(a, b) #define __Pyx_PyUnicode_ConcatSafe(a, b) ((unlikely((a) == Py_None) || unlikely((b) == Py_None)) ?\ PyNumber_Add(a, b) : __Pyx_PyUnicode_Concat(a, b)) #endif #if CYTHON_COMPILING_IN_PYPY && !defined(PyUnicode_Contains) #define PyUnicode_Contains(u, s) PySequence_Contains(u, s) #endif #define __Pyx_PyString_FormatSafe(a, b) ((unlikely((a) == Py_None)) ? PyNumber_Remainder(a, b) : __Pyx_PyString_Format(a, b)) #define __Pyx_PyUnicode_FormatSafe(a, b) ((unlikely((a) == Py_None)) ? PyNumber_Remainder(a, b) : PyUnicode_Format(a, b)) #if PY_MAJOR_VERSION >= 3 #define __Pyx_PyString_Format(a, b) PyUnicode_Format(a, b) #else #define __Pyx_PyString_Format(a, b) PyString_Format(a, b) #endif #if PY_MAJOR_VERSION >= 3 #define PyBaseString_Type PyUnicode_Type #define PyStringObject PyUnicodeObject #define PyString_Type PyUnicode_Type #define PyString_Check PyUnicode_Check #define PyString_CheckExact PyUnicode_CheckExact #endif #if PY_MAJOR_VERSION >= 3 #define __Pyx_PyBaseString_Check(obj) PyUnicode_Check(obj) #define __Pyx_PyBaseString_CheckExact(obj) PyUnicode_CheckExact(obj) #else #define __Pyx_PyBaseString_Check(obj) (PyString_Check(obj) || PyUnicode_Check(obj)) #define __Pyx_PyBaseString_CheckExact(obj) (PyString_CheckExact(obj) || PyUnicode_CheckExact(obj)) #endif #ifndef PySet_CheckExact #define PySet_CheckExact(obj) (Py_TYPE(obj) == &PySet_Type) #endif #define __Pyx_TypeCheck(obj, type) PyObject_TypeCheck(obj, (PyTypeObject *)type) #if PY_MAJOR_VERSION >= 3 #define PyIntObject PyLongObject #define PyInt_Type PyLong_Type #define PyInt_Check(op) PyLong_Check(op) #define PyInt_CheckExact(op) PyLong_CheckExact(op) #define PyInt_FromString PyLong_FromString #define PyInt_FromUnicode PyLong_FromUnicode #define PyInt_FromLong PyLong_FromLong #define PyInt_FromSize_t PyLong_FromSize_t #define PyInt_FromSsize_t PyLong_FromSsize_t #define PyInt_AsLong PyLong_AsLong #define PyInt_AS_LONG PyLong_AS_LONG #define PyInt_AsSsize_t PyLong_AsSsize_t #define PyInt_AsUnsignedLongMask PyLong_AsUnsignedLongMask #define PyInt_AsUnsignedLongLongMask PyLong_AsUnsignedLongLongMask #define PyNumber_Int PyNumber_Long #endif #if PY_MAJOR_VERSION >= 3 #define PyBoolObject PyLongObject #endif #if PY_MAJOR_VERSION >= 3 && CYTHON_COMPILING_IN_PYPY #ifndef PyUnicode_InternFromString #define PyUnicode_InternFromString(s) PyUnicode_FromString(s) #endif #endif #if PY_VERSION_HEX < 0x030200A4 typedef long Py_hash_t; #define __Pyx_PyInt_FromHash_t PyInt_FromLong #define __Pyx_PyInt_AsHash_t PyInt_AsLong #else #define __Pyx_PyInt_FromHash_t PyInt_FromSsize_t #define __Pyx_PyInt_AsHash_t PyInt_AsSsize_t #endif #if PY_MAJOR_VERSION >= 3 #define __Pyx_PyMethod_New(func, self, klass) ((self) ? PyMethod_New(func, self) : PyInstanceMethod_New(func)) #else #define __Pyx_PyMethod_New(func, self, klass) PyMethod_New(func, self, klass) #endif #if PY_VERSION_HEX >= 0x030500B1 #define __Pyx_PyAsyncMethodsStruct PyAsyncMethods #define __Pyx_PyType_AsAsync(obj) (Py_TYPE(obj)->tp_as_async) #elif CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3 typedef struct { unaryfunc am_await; unaryfunc am_aiter; unaryfunc am_anext; } __Pyx_PyAsyncMethodsStruct; #define __Pyx_PyType_AsAsync(obj) ((__Pyx_PyAsyncMethodsStruct*) (Py_TYPE(obj)->tp_reserved)) #else #define __Pyx_PyType_AsAsync(obj) NULL #endif #ifndef CYTHON_RESTRICT #if defined(__GNUC__) #define CYTHON_RESTRICT __restrict__ #elif defined(_MSC_VER) && _MSC_VER >= 1400 #define CYTHON_RESTRICT __restrict #elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L #define CYTHON_RESTRICT restrict #else #define CYTHON_RESTRICT #endif #endif #define __Pyx_void_to_None(void_result) ((void)(void_result), Py_INCREF(Py_None), Py_None) #ifndef CYTHON_INLINE #if defined(__GNUC__) #define CYTHON_INLINE __inline__ #elif defined(_MSC_VER) #define CYTHON_INLINE __inline #elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L #define CYTHON_INLINE inline #else #define CYTHON_INLINE #endif #endif #if defined(WIN32) || defined(MS_WINDOWS) #define _USE_MATH_DEFINES #endif #include #ifdef NAN #define __PYX_NAN() ((float) NAN) #else static CYTHON_INLINE float __PYX_NAN() { float value; memset(&value, 0xFF, sizeof(value)); return value; } #endif #if PY_MAJOR_VERSION >= 3 #define __Pyx_PyNumber_Divide(x,y) PyNumber_TrueDivide(x,y) #define __Pyx_PyNumber_InPlaceDivide(x,y) PyNumber_InPlaceTrueDivide(x,y) #else #define __Pyx_PyNumber_Divide(x,y) PyNumber_Divide(x,y) #define __Pyx_PyNumber_InPlaceDivide(x,y) PyNumber_InPlaceDivide(x,y) #endif #ifndef __PYX_EXTERN_C #ifdef __cplusplus #define __PYX_EXTERN_C extern "C" #else #define __PYX_EXTERN_C extern #endif #endif #define __PYX_HAVE__pygame_sdl2__render #define __PYX_HAVE_API__pygame_sdl2__render #include "stdint.h" #include "string.h" #include "stdio.h" #include "stddef.h" #include "SDL.h" #include "SDL_image.h" #ifdef _OPENMP #include #endif /* _OPENMP */ #ifdef PYREX_WITHOUT_ASSERTIONS #define CYTHON_WITHOUT_ASSERTIONS #endif #ifndef CYTHON_UNUSED # if defined(__GNUC__) # if !(defined(__cplusplus)) || (__GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 4)) # define CYTHON_UNUSED __attribute__ ((__unused__)) # else # define CYTHON_UNUSED # endif # elif defined(__ICC) || (defined(__INTEL_COMPILER) && !defined(_MSC_VER)) # define CYTHON_UNUSED __attribute__ ((__unused__)) # else # define CYTHON_UNUSED # endif #endif #ifndef CYTHON_NCP_UNUSED # if CYTHON_COMPILING_IN_CPYTHON # define CYTHON_NCP_UNUSED # else # define CYTHON_NCP_UNUSED CYTHON_UNUSED # endif #endif typedef struct {PyObject **p; char *s; const Py_ssize_t n; const char* encoding; const char is_unicode; const char is_str; const char intern; } __Pyx_StringTabEntry; #define __PYX_DEFAULT_STRING_ENCODING_IS_ASCII 0 #define __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT 0 #define __PYX_DEFAULT_STRING_ENCODING "" #define __Pyx_PyObject_FromString __Pyx_PyBytes_FromString #define __Pyx_PyObject_FromStringAndSize __Pyx_PyBytes_FromStringAndSize #define __Pyx_uchar_cast(c) ((unsigned char)c) #define __Pyx_long_cast(x) ((long)x) #define __Pyx_fits_Py_ssize_t(v, type, is_signed) (\ (sizeof(type) < sizeof(Py_ssize_t)) ||\ (sizeof(type) > sizeof(Py_ssize_t) &&\ likely(v < (type)PY_SSIZE_T_MAX ||\ v == (type)PY_SSIZE_T_MAX) &&\ (!is_signed || likely(v > (type)PY_SSIZE_T_MIN ||\ v == (type)PY_SSIZE_T_MIN))) ||\ (sizeof(type) == sizeof(Py_ssize_t) &&\ (is_signed || likely(v < (type)PY_SSIZE_T_MAX ||\ v == (type)PY_SSIZE_T_MAX))) ) #if defined (__cplusplus) && __cplusplus >= 201103L #include #define __Pyx_sst_abs(value) std::abs(value) #elif SIZEOF_INT >= SIZEOF_SIZE_T #define __Pyx_sst_abs(value) abs(value) #elif SIZEOF_LONG >= SIZEOF_SIZE_T #define __Pyx_sst_abs(value) labs(value) #elif defined (_MSC_VER) && defined (_M_X64) #define __Pyx_sst_abs(value) _abs64(value) #elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L #define __Pyx_sst_abs(value) llabs(value) #elif defined (__GNUC__) #define __Pyx_sst_abs(value) __builtin_llabs(value) #else #define __Pyx_sst_abs(value) ((value<0) ? -value : value) #endif static CYTHON_INLINE char* __Pyx_PyObject_AsString(PyObject*); static CYTHON_INLINE char* __Pyx_PyObject_AsStringAndSize(PyObject*, Py_ssize_t* length); #define __Pyx_PyByteArray_FromString(s) PyByteArray_FromStringAndSize((const char*)s, strlen((const char*)s)) #define __Pyx_PyByteArray_FromStringAndSize(s, l) PyByteArray_FromStringAndSize((const char*)s, l) #define __Pyx_PyBytes_FromString PyBytes_FromString #define __Pyx_PyBytes_FromStringAndSize PyBytes_FromStringAndSize static CYTHON_INLINE PyObject* __Pyx_PyUnicode_FromString(const char*); #if PY_MAJOR_VERSION < 3 #define __Pyx_PyStr_FromString __Pyx_PyBytes_FromString #define __Pyx_PyStr_FromStringAndSize __Pyx_PyBytes_FromStringAndSize #else #define __Pyx_PyStr_FromString __Pyx_PyUnicode_FromString #define __Pyx_PyStr_FromStringAndSize __Pyx_PyUnicode_FromStringAndSize #endif #define __Pyx_PyObject_AsSString(s) ((signed char*) __Pyx_PyObject_AsString(s)) #define __Pyx_PyObject_AsUString(s) ((unsigned char*) __Pyx_PyObject_AsString(s)) #define __Pyx_PyObject_FromCString(s) __Pyx_PyObject_FromString((const char*)s) #define __Pyx_PyBytes_FromCString(s) __Pyx_PyBytes_FromString((const char*)s) #define __Pyx_PyByteArray_FromCString(s) __Pyx_PyByteArray_FromString((const char*)s) #define __Pyx_PyStr_FromCString(s) __Pyx_PyStr_FromString((const char*)s) #define __Pyx_PyUnicode_FromCString(s) __Pyx_PyUnicode_FromString((const char*)s) #if PY_MAJOR_VERSION < 3 static CYTHON_INLINE size_t __Pyx_Py_UNICODE_strlen(const Py_UNICODE *u) { const Py_UNICODE *u_end = u; while (*u_end++) ; return (size_t)(u_end - u - 1); } #else #define __Pyx_Py_UNICODE_strlen Py_UNICODE_strlen #endif #define __Pyx_PyUnicode_FromUnicode(u) PyUnicode_FromUnicode(u, __Pyx_Py_UNICODE_strlen(u)) #define __Pyx_PyUnicode_FromUnicodeAndLength PyUnicode_FromUnicode #define __Pyx_PyUnicode_AsUnicode PyUnicode_AsUnicode #define __Pyx_NewRef(obj) (Py_INCREF(obj), obj) #define __Pyx_Owned_Py_None(b) __Pyx_NewRef(Py_None) #define __Pyx_PyBool_FromLong(b) ((b) ? __Pyx_NewRef(Py_True) : __Pyx_NewRef(Py_False)) static CYTHON_INLINE int __Pyx_PyObject_IsTrue(PyObject*); static CYTHON_INLINE PyObject* __Pyx_PyNumber_Int(PyObject* x); static CYTHON_INLINE Py_ssize_t __Pyx_PyIndex_AsSsize_t(PyObject*); static CYTHON_INLINE PyObject * __Pyx_PyInt_FromSize_t(size_t); #if CYTHON_COMPILING_IN_CPYTHON #define __pyx_PyFloat_AsDouble(x) (PyFloat_CheckExact(x) ? PyFloat_AS_DOUBLE(x) : PyFloat_AsDouble(x)) #else #define __pyx_PyFloat_AsDouble(x) PyFloat_AsDouble(x) #endif #define __pyx_PyFloat_AsFloat(x) ((float) __pyx_PyFloat_AsDouble(x)) #if PY_MAJOR_VERSION < 3 && __PYX_DEFAULT_STRING_ENCODING_IS_ASCII static int __Pyx_sys_getdefaultencoding_not_ascii; static int __Pyx_init_sys_getdefaultencoding_params(void) { PyObject* sys; PyObject* default_encoding = NULL; PyObject* ascii_chars_u = NULL; PyObject* ascii_chars_b = NULL; const char* default_encoding_c; sys = PyImport_ImportModule("sys"); if (!sys) goto bad; default_encoding = PyObject_CallMethod(sys, (char*) "getdefaultencoding", NULL); Py_DECREF(sys); if (!default_encoding) goto bad; default_encoding_c = PyBytes_AsString(default_encoding); if (!default_encoding_c) goto bad; if (strcmp(default_encoding_c, "ascii") == 0) { __Pyx_sys_getdefaultencoding_not_ascii = 0; } else { char ascii_chars[128]; int c; for (c = 0; c < 128; c++) { ascii_chars[c] = c; } __Pyx_sys_getdefaultencoding_not_ascii = 1; ascii_chars_u = PyUnicode_DecodeASCII(ascii_chars, 128, NULL); if (!ascii_chars_u) goto bad; ascii_chars_b = PyUnicode_AsEncodedString(ascii_chars_u, default_encoding_c, NULL); if (!ascii_chars_b || !PyBytes_Check(ascii_chars_b) || memcmp(ascii_chars, PyBytes_AS_STRING(ascii_chars_b), 128) != 0) { PyErr_Format( PyExc_ValueError, "This module compiled with c_string_encoding=ascii, but default encoding '%.200s' is not a superset of ascii.", default_encoding_c); goto bad; } Py_DECREF(ascii_chars_u); Py_DECREF(ascii_chars_b); } Py_DECREF(default_encoding); return 0; bad: Py_XDECREF(default_encoding); Py_XDECREF(ascii_chars_u); Py_XDECREF(ascii_chars_b); return -1; } #endif #if __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT && PY_MAJOR_VERSION >= 3 #define __Pyx_PyUnicode_FromStringAndSize(c_str, size) PyUnicode_DecodeUTF8(c_str, size, NULL) #else #define __Pyx_PyUnicode_FromStringAndSize(c_str, size) PyUnicode_Decode(c_str, size, __PYX_DEFAULT_STRING_ENCODING, NULL) #if __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT static char* __PYX_DEFAULT_STRING_ENCODING; static int __Pyx_init_sys_getdefaultencoding_params(void) { PyObject* sys; PyObject* default_encoding = NULL; char* default_encoding_c; sys = PyImport_ImportModule("sys"); if (!sys) goto bad; default_encoding = PyObject_CallMethod(sys, (char*) (const char*) "getdefaultencoding", NULL); Py_DECREF(sys); if (!default_encoding) goto bad; default_encoding_c = PyBytes_AsString(default_encoding); if (!default_encoding_c) goto bad; __PYX_DEFAULT_STRING_ENCODING = (char*) malloc(strlen(default_encoding_c)); if (!__PYX_DEFAULT_STRING_ENCODING) goto bad; strcpy(__PYX_DEFAULT_STRING_ENCODING, default_encoding_c); Py_DECREF(default_encoding); return 0; bad: Py_XDECREF(default_encoding); return -1; } #endif #endif /* Test for GCC > 2.95 */ #if defined(__GNUC__) && (__GNUC__ > 2 || (__GNUC__ == 2 && (__GNUC_MINOR__ > 95))) #define likely(x) __builtin_expect(!!(x), 1) #define unlikely(x) __builtin_expect(!!(x), 0) #else /* !__GNUC__ or GCC < 2.95 */ #define likely(x) (x) #define unlikely(x) (x) #endif /* __GNUC__ */ static PyObject *__pyx_m; static PyObject *__pyx_d; static PyObject *__pyx_b; static PyObject *__pyx_empty_tuple; static PyObject *__pyx_empty_bytes; static int __pyx_lineno; static int __pyx_clineno = 0; static const char * __pyx_cfilenm= __FILE__; static const char *__pyx_filename; static const char *__pyx_f[] = { "src/pygame_sdl2/render.pyx", "src/pygame_sdl2/surface.pxd", "src/pygame_sdl2/display.pxd", "src/pygame_sdl2/rect.pxd", }; /*--- Type declarations ---*/ struct __pyx_obj_11pygame_sdl2_7surface_Surface; struct __pyx_obj_11pygame_sdl2_7display_Window; struct __pyx_obj_11pygame_sdl2_4rect_Rect; struct __pyx_obj_11pygame_sdl2_6render_Renderer; struct __pyx_obj_11pygame_sdl2_6render_Texture; struct __pyx_obj_11pygame_sdl2_6render_TextureNode; struct __pyx_obj_11pygame_sdl2_6render_TextureAtlas; struct __pyx_obj_11pygame_sdl2_6render_Sprite; struct __pyx_obj_11pygame_sdl2_6render_Container; struct __pyx_opt_args_11pygame_sdl2_8rwobject_to_rwops; /* "pygame_sdl2/rwobject.pxd":21 * from sdl2 cimport SDL_RWops * * cdef SDL_RWops *to_rwops(filelike, mode=*) except NULL # <<<<<<<<<<<<<< * */ struct __pyx_opt_args_11pygame_sdl2_8rwobject_to_rwops { int __pyx_n; PyObject *mode; }; struct __pyx_opt_args_11pygame_sdl2_4rect_to_sdl_rect; /* "pygame_sdl2/rect.pxd":31 * * * cdef int to_sdl_rect(rectlike, SDL_Rect *rect, argname=*) except -1 # <<<<<<<<<<<<<< */ struct __pyx_opt_args_11pygame_sdl2_4rect_to_sdl_rect { int __pyx_n; PyObject *argname; }; /* "pygame_sdl2/surface.pxd":23 * from sdl2 cimport SDL_Surface * * cdef class Surface: # <<<<<<<<<<<<<< * # Allow weak references. * cdef object __weakref__ */ struct __pyx_obj_11pygame_sdl2_7surface_Surface { PyObject_HEAD struct __pyx_vtabstruct_11pygame_sdl2_7surface_Surface *__pyx_vtab; PyObject *__weakref__; SDL_Surface *surface; int owns_surface; int window_surface; PyObject *locklist; struct __pyx_obj_11pygame_sdl2_7surface_Surface *parent; struct __pyx_obj_11pygame_sdl2_7surface_Surface *root; int offset_x; int offset_y; PyObject *get_window_flags; int has_alpha; }; /* "pygame_sdl2/display.pxd":23 * from pygame_sdl2.surface cimport Surface * * cdef class Window: # <<<<<<<<<<<<<< * # Allow weak references. * cdef object __weakref__ */ struct __pyx_obj_11pygame_sdl2_7display_Window { PyObject_HEAD PyObject *__weakref__; SDL_Window *window; SDL_Surface *window_surface; struct __pyx_obj_11pygame_sdl2_7surface_Surface *surface; SDL_GLContext gl_context; Uint32 create_flags; }; /* "pygame_sdl2/rect.pxd":21 * from sdl2 cimport * * * cdef class Rect: # <<<<<<<<<<<<<< * # Allow weak references. * cdef object __weakref__ */ struct __pyx_obj_11pygame_sdl2_4rect_Rect { PyObject_HEAD PyObject *__weakref__; int x; int y; int w; int h; }; /* "pygame_sdl2/render.pyx":67 * * * cdef class Renderer: # <<<<<<<<<<<<<< * cdef SDL_Renderer *renderer * cdef dict _info */ struct __pyx_obj_11pygame_sdl2_6render_Renderer { PyObject_HEAD struct __pyx_vtabstruct_11pygame_sdl2_6render_Renderer *__pyx_vtab; SDL_Renderer *renderer; PyObject *_info; }; /* "pygame_sdl2/render.pyx":172 * * * cdef class Texture: # <<<<<<<<<<<<<< * """ Mostly for internal use. Users should only see this for RTT. """ * */ struct __pyx_obj_11pygame_sdl2_6render_Texture { PyObject_HEAD struct __pyx_vtabstruct_11pygame_sdl2_6render_Texture *__pyx_vtab; SDL_Renderer *renderer; SDL_Texture *texture; int w; int h; }; /* "pygame_sdl2/render.pyx":200 * * * cdef class TextureNode: # <<<<<<<<<<<<<< * """ A specified area of a texture. """ * */ struct __pyx_obj_11pygame_sdl2_6render_TextureNode { PyObject_HEAD struct __pyx_obj_11pygame_sdl2_6render_Texture *texture; SDL_Rect source_rect; SDL_Rect trimmed_rect; int source_w; int source_h; }; /* "pygame_sdl2/render.pyx":245 * * * cdef class TextureAtlas: # <<<<<<<<<<<<<< * cdef object frames * */ struct __pyx_obj_11pygame_sdl2_6render_TextureAtlas { PyObject_HEAD PyObject *frames; }; /* "pygame_sdl2/render.pyx":278 * * * cdef class Sprite: # <<<<<<<<<<<<<< * """ One or more TextureNodes, with possible transforms applied. """ * */ struct __pyx_obj_11pygame_sdl2_6render_Sprite { PyObject_HEAD struct __pyx_vtabstruct_11pygame_sdl2_6render_Sprite *__pyx_vtab; PyObject *nodes; SDL_Rect _pos; SDL_Rect bounding_box; double _rotation; int _flip; SDL_Color _color; double _scalex; double _scaley; }; /* "pygame_sdl2/render.pyx":434 * * * cdef class Container: # <<<<<<<<<<<<<< * """ Multiple sprites, positioned relative to the container. """ * */ struct __pyx_obj_11pygame_sdl2_6render_Container { PyObject_HEAD SDL_Rect _rect; PyObject *sprites; }; /* "pygame_sdl2/surface.pxd":23 * from sdl2 cimport SDL_Surface * * cdef class Surface: # <<<<<<<<<<<<<< * # Allow weak references. * cdef object __weakref__ */ struct __pyx_vtabstruct_11pygame_sdl2_7surface_Surface { void (*take_surface)(struct __pyx_obj_11pygame_sdl2_7surface_Surface *, SDL_Surface *); }; static struct __pyx_vtabstruct_11pygame_sdl2_7surface_Surface *__pyx_vtabptr_11pygame_sdl2_7surface_Surface; /* "pygame_sdl2/render.pyx":67 * * * cdef class Renderer: # <<<<<<<<<<<<<< * cdef SDL_Renderer *renderer * cdef dict _info */ struct __pyx_vtabstruct_11pygame_sdl2_6render_Renderer { PyObject *(*set_drawcolor)(struct __pyx_obj_11pygame_sdl2_6render_Renderer *, PyObject *); }; static struct __pyx_vtabstruct_11pygame_sdl2_6render_Renderer *__pyx_vtabptr_11pygame_sdl2_6render_Renderer; /* "pygame_sdl2/render.pyx":172 * * * cdef class Texture: # <<<<<<<<<<<<<< * """ Mostly for internal use. Users should only see this for RTT. """ * */ struct __pyx_vtabstruct_11pygame_sdl2_6render_Texture { PyObject *(*set)(struct __pyx_obj_11pygame_sdl2_6render_Texture *, SDL_Renderer *, SDL_Texture *); }; static struct __pyx_vtabstruct_11pygame_sdl2_6render_Texture *__pyx_vtabptr_11pygame_sdl2_6render_Texture; /* "pygame_sdl2/render.pyx":278 * * * cdef class Sprite: # <<<<<<<<<<<<<< * """ One or more TextureNodes, with possible transforms applied. """ * */ struct __pyx_vtabstruct_11pygame_sdl2_6render_Sprite { void (*adjust_rect)(struct __pyx_obj_11pygame_sdl2_6render_Sprite *, SDL_Rect const *, SDL_Rect const *, SDL_Rect *); }; static struct __pyx_vtabstruct_11pygame_sdl2_6render_Sprite *__pyx_vtabptr_11pygame_sdl2_6render_Sprite; /* --- Runtime support code (head) --- */ #ifndef CYTHON_REFNANNY #define CYTHON_REFNANNY 0 #endif #if CYTHON_REFNANNY typedef struct { void (*INCREF)(void*, PyObject*, int); void (*DECREF)(void*, PyObject*, int); void (*GOTREF)(void*, PyObject*, int); void (*GIVEREF)(void*, PyObject*, int); void* (*SetupContext)(const char*, int, const char*); void (*FinishContext)(void**); } __Pyx_RefNannyAPIStruct; static __Pyx_RefNannyAPIStruct *__Pyx_RefNanny = NULL; static __Pyx_RefNannyAPIStruct *__Pyx_RefNannyImportAPI(const char *modname); #define __Pyx_RefNannyDeclarations void *__pyx_refnanny = NULL; #ifdef WITH_THREAD #define __Pyx_RefNannySetupContext(name, acquire_gil)\ if (acquire_gil) {\ PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure();\ __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), __LINE__, __FILE__);\ PyGILState_Release(__pyx_gilstate_save);\ } else {\ __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), __LINE__, __FILE__);\ } #else #define __Pyx_RefNannySetupContext(name, acquire_gil)\ __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), __LINE__, __FILE__) #endif #define __Pyx_RefNannyFinishContext()\ __Pyx_RefNanny->FinishContext(&__pyx_refnanny) #define __Pyx_INCREF(r) __Pyx_RefNanny->INCREF(__pyx_refnanny, (PyObject *)(r), __LINE__) #define __Pyx_DECREF(r) __Pyx_RefNanny->DECREF(__pyx_refnanny, (PyObject *)(r), __LINE__) #define __Pyx_GOTREF(r) __Pyx_RefNanny->GOTREF(__pyx_refnanny, (PyObject *)(r), __LINE__) #define __Pyx_GIVEREF(r) __Pyx_RefNanny->GIVEREF(__pyx_refnanny, (PyObject *)(r), __LINE__) #define __Pyx_XINCREF(r) do { if((r) != NULL) {__Pyx_INCREF(r); }} while(0) #define __Pyx_XDECREF(r) do { if((r) != NULL) {__Pyx_DECREF(r); }} while(0) #define __Pyx_XGOTREF(r) do { if((r) != NULL) {__Pyx_GOTREF(r); }} while(0) #define __Pyx_XGIVEREF(r) do { if((r) != NULL) {__Pyx_GIVEREF(r);}} while(0) #else #define __Pyx_RefNannyDeclarations #define __Pyx_RefNannySetupContext(name, acquire_gil) #define __Pyx_RefNannyFinishContext() #define __Pyx_INCREF(r) Py_INCREF(r) #define __Pyx_DECREF(r) Py_DECREF(r) #define __Pyx_GOTREF(r) #define __Pyx_GIVEREF(r) #define __Pyx_XINCREF(r) Py_XINCREF(r) #define __Pyx_XDECREF(r) Py_XDECREF(r) #define __Pyx_XGOTREF(r) #define __Pyx_XGIVEREF(r) #endif #define __Pyx_XDECREF_SET(r, v) do {\ PyObject *tmp = (PyObject *) r;\ r = v; __Pyx_XDECREF(tmp);\ } while (0) #define __Pyx_DECREF_SET(r, v) do {\ PyObject *tmp = (PyObject *) r;\ r = v; __Pyx_DECREF(tmp);\ } while (0) #define __Pyx_CLEAR(r) do { PyObject* tmp = ((PyObject*)(r)); r = NULL; __Pyx_DECREF(tmp);} while(0) #define __Pyx_XCLEAR(r) do { if((r) != NULL) {PyObject* tmp = ((PyObject*)(r)); r = NULL; __Pyx_DECREF(tmp);}} while(0) #if CYTHON_COMPILING_IN_CPYTHON static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStr(PyObject* obj, PyObject* attr_name) { PyTypeObject* tp = Py_TYPE(obj); if (likely(tp->tp_getattro)) return tp->tp_getattro(obj, attr_name); #if PY_MAJOR_VERSION < 3 if (likely(tp->tp_getattr)) return tp->tp_getattr(obj, PyString_AS_STRING(attr_name)); #endif return PyObject_GetAttr(obj, attr_name); } #else #define __Pyx_PyObject_GetAttrStr(o,n) PyObject_GetAttr(o,n) #endif static PyObject *__Pyx_GetBuiltinName(PyObject *name); static CYTHON_INLINE PyObject *__Pyx_GetModuleGlobalName(PyObject *name); #if CYTHON_COMPILING_IN_CPYTHON static CYTHON_INLINE PyObject* __Pyx_PyObject_Call(PyObject *func, PyObject *arg, PyObject *kw); #else #define __Pyx_PyObject_Call(func, arg, kw) PyObject_Call(func, arg, kw) #endif #if CYTHON_COMPILING_IN_CPYTHON static CYTHON_INLINE PyObject* __Pyx_PyObject_CallMethO(PyObject *func, PyObject *arg); #endif static CYTHON_INLINE PyObject* __Pyx_PyObject_CallOneArg(PyObject *func, PyObject *arg); #if CYTHON_COMPILING_IN_CPYTHON static CYTHON_INLINE PyObject* __Pyx_PyObject_CallNoArg(PyObject *func); #else #define __Pyx_PyObject_CallNoArg(func) __Pyx_PyObject_Call(func, __pyx_empty_tuple, NULL) #endif static CYTHON_INLINE void __Pyx_ErrRestore(PyObject *type, PyObject *value, PyObject *tb); static CYTHON_INLINE void __Pyx_ErrFetch(PyObject **type, PyObject **value, PyObject **tb); static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, PyObject *cause); #if CYTHON_COMPILING_IN_CPYTHON static CYTHON_INLINE int __Pyx_PyList_Append(PyObject* list, PyObject* x) { PyListObject* L = (PyListObject*) list; Py_ssize_t len = Py_SIZE(list); if (likely(L->allocated > len) & likely(len > (L->allocated >> 1))) { Py_INCREF(x); PyList_SET_ITEM(list, len, x); Py_SIZE(list) = len+1; return 0; } return PyList_Append(list, x); } #else #define __Pyx_PyList_Append(L,x) PyList_Append(L,x) #endif static void __Pyx_RaiseArgtupleInvalid(const char* func_name, int exact, Py_ssize_t num_min, Py_ssize_t num_max, Py_ssize_t num_found); static CYTHON_INLINE int __Pyx_CheckKeywordStrings(PyObject *kwdict, const char* function_name, int kw_allowed); static void __Pyx_RaiseDoubleKeywordsError(const char* func_name, PyObject* kw_name); static int __Pyx_ParseOptionalKeywords(PyObject *kwds, PyObject **argnames[],\ PyObject *kwds2, PyObject *values[], Py_ssize_t num_pos_args,\ const char* function_name); static CYTHON_INLINE int __Pyx_ArgTypeTest(PyObject *obj, PyTypeObject *type, int none_allowed, const char *name, int exact); static CYTHON_INLINE int __Pyx_TypeTest(PyObject *obj, PyTypeObject *type); static CYTHON_INLINE int __Pyx_IterFinish(void); static PyObject* __Pyx_PyObject_CallMethod0(PyObject* obj, PyObject* method_name); static CYTHON_INLINE void __Pyx_RaiseNeedMoreValuesError(Py_ssize_t index); static CYTHON_INLINE void __Pyx_RaiseTooManyValuesError(Py_ssize_t expected); static int __Pyx_IternextUnpackEndCheck(PyObject *retval, Py_ssize_t expected); static CYTHON_INLINE void __Pyx_RaiseNoneNotIterableError(void); static void __Pyx_UnpackTupleError(PyObject *, Py_ssize_t index); static CYTHON_INLINE int __Pyx_unpack_tuple2(PyObject* tuple, PyObject** value1, PyObject** value2, int is_tuple, int has_known_size, int decref_tuple); static CYTHON_INLINE PyObject* __Pyx_dict_iterator(PyObject* dict, int is_dict, PyObject* method_name, Py_ssize_t* p_orig_length, int* p_is_dict); static CYTHON_INLINE int __Pyx_dict_iter_next(PyObject* dict_or_iter, Py_ssize_t orig_length, Py_ssize_t* ppos, PyObject** pkey, PyObject** pvalue, PyObject** pitem, int is_dict); #define __Pyx_GetItemInt(o, i, type, is_signed, to_py_func, is_list, wraparound, boundscheck)\ (__Pyx_fits_Py_ssize_t(i, type, is_signed) ?\ __Pyx_GetItemInt_Fast(o, (Py_ssize_t)i, is_list, wraparound, boundscheck) :\ (is_list ? (PyErr_SetString(PyExc_IndexError, "list index out of range"), (PyObject*)NULL) :\ __Pyx_GetItemInt_Generic(o, to_py_func(i)))) #define __Pyx_GetItemInt_List(o, i, type, is_signed, to_py_func, is_list, wraparound, boundscheck)\ (__Pyx_fits_Py_ssize_t(i, type, is_signed) ?\ __Pyx_GetItemInt_List_Fast(o, (Py_ssize_t)i, wraparound, boundscheck) :\ (PyErr_SetString(PyExc_IndexError, "list index out of range"), (PyObject*)NULL)) static CYTHON_INLINE PyObject *__Pyx_GetItemInt_List_Fast(PyObject *o, Py_ssize_t i, int wraparound, int boundscheck); #define __Pyx_GetItemInt_Tuple(o, i, type, is_signed, to_py_func, is_list, wraparound, boundscheck)\ (__Pyx_fits_Py_ssize_t(i, type, is_signed) ?\ __Pyx_GetItemInt_Tuple_Fast(o, (Py_ssize_t)i, wraparound, boundscheck) :\ (PyErr_SetString(PyExc_IndexError, "tuple index out of range"), (PyObject*)NULL)) static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Tuple_Fast(PyObject *o, Py_ssize_t i, int wraparound, int boundscheck); static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Generic(PyObject *o, PyObject* j); static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Fast(PyObject *o, Py_ssize_t i, int is_list, int wraparound, int boundscheck); static CYTHON_INLINE long __Pyx_div_long(long, long); static int __Pyx_SetVtable(PyObject *dict, void *vtable); static void* __Pyx_GetVtable(PyObject *dict); static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list, int level); static PyObject* __Pyx_ImportFrom(PyObject* module, PyObject* name); typedef struct { int code_line; PyCodeObject* code_object; } __Pyx_CodeObjectCacheEntry; struct __Pyx_CodeObjectCache { int count; int max_count; __Pyx_CodeObjectCacheEntry* entries; }; static struct __Pyx_CodeObjectCache __pyx_code_cache = {0,0,NULL}; static int __pyx_bisect_code_objects(__Pyx_CodeObjectCacheEntry* entries, int count, int code_line); static PyCodeObject *__pyx_find_code_object(int code_line); static void __pyx_insert_code_object(int code_line, PyCodeObject* code_object); static void __Pyx_AddTraceback(const char *funcname, int c_line, int py_line, const char *filename); static CYTHON_INLINE PyObject* __Pyx_PyInt_From_SDL_BlendMode(SDL_BlendMode value); static CYTHON_INLINE PyObject* __Pyx_PyInt_From_int(int value); static CYTHON_INLINE int __Pyx_PyInt_As_int(PyObject *); #ifndef __PYX_FORCE_INIT_THREADS #define __PYX_FORCE_INIT_THREADS 0 #endif static CYTHON_INLINE uint8_t __Pyx_PyInt_As_uint8_t(PyObject *); static CYTHON_INLINE PyObject* __Pyx_PyInt_From_long(long value); static CYTHON_INLINE PyObject* __Pyx_PyInt_From_uint8_t(uint8_t value); static CYTHON_INLINE long __Pyx_PyInt_As_long(PyObject *); static int __Pyx_check_binary_version(void); #if !defined(__Pyx_PyIdentifier_FromString) #if PY_MAJOR_VERSION < 3 #define __Pyx_PyIdentifier_FromString(s) PyString_FromString(s) #else #define __Pyx_PyIdentifier_FromString(s) PyUnicode_FromString(s) #endif #endif static PyObject *__Pyx_ImportModule(const char *name); static PyTypeObject *__Pyx_ImportType(const char *module_name, const char *class_name, size_t size, int strict); static int __Pyx_ImportVoidPtr(PyObject *module, const char *name, void **p, const char *sig); static int __Pyx_ImportFunction(PyObject *module, const char *funcname, void (**f)(void), const char *sig); static int __Pyx_InitStrings(__Pyx_StringTabEntry *t); static PyObject *__pyx_f_11pygame_sdl2_6render_8Renderer_set_drawcolor(struct __pyx_obj_11pygame_sdl2_6render_Renderer *__pyx_v_self, PyObject *__pyx_v_col); /* proto*/ static PyObject *__pyx_f_11pygame_sdl2_6render_7Texture_set(struct __pyx_obj_11pygame_sdl2_6render_Texture *__pyx_v_self, SDL_Renderer *__pyx_v_ren, SDL_Texture *__pyx_v_tex); /* proto*/ static void __pyx_f_11pygame_sdl2_6render_6Sprite_adjust_rect(struct __pyx_obj_11pygame_sdl2_6render_Sprite *__pyx_v_self, SDL_Rect const *__pyx_v_dest, SDL_Rect const *__pyx_v_rin, SDL_Rect *__pyx_v_rout); /* proto*/ /* Module declarations from 'libc.stdint' */ /* Module declarations from 'libc.string' */ /* Module declarations from 'libc.stdio' */ /* Module declarations from 'libc.stddef' */ /* Module declarations from 'sdl2' */ /* Module declarations from 'sdl2_image' */ /* Module declarations from 'pygame_sdl2.surface' */ static PyTypeObject *__pyx_ptype_11pygame_sdl2_7surface_Surface = 0; /* Module declarations from 'pygame_sdl2.display' */ static PyTypeObject *__pyx_ptype_11pygame_sdl2_7display_Window = 0; static struct __pyx_obj_11pygame_sdl2_7display_Window **__pyx_vp_11pygame_sdl2_7display_main_window = 0; #define __pyx_v_11pygame_sdl2_7display_main_window (*__pyx_vp_11pygame_sdl2_7display_main_window) /* Module declarations from 'pygame_sdl2.rwobject' */ static SDL_RWops *(*__pyx_f_11pygame_sdl2_8rwobject_to_rwops)(PyObject *, struct __pyx_opt_args_11pygame_sdl2_8rwobject_to_rwops *__pyx_optional_args); /*proto*/ /* Module declarations from 'pygame_sdl2.rect' */ static PyTypeObject *__pyx_ptype_11pygame_sdl2_4rect_Rect = 0; static int (*__pyx_f_11pygame_sdl2_4rect_to_sdl_rect)(PyObject *, SDL_Rect *, struct __pyx_opt_args_11pygame_sdl2_4rect_to_sdl_rect *__pyx_optional_args); /*proto*/ /* Module declarations from 'pygame_sdl2.render' */ static PyTypeObject *__pyx_ptype_11pygame_sdl2_6render_Renderer = 0; static PyTypeObject *__pyx_ptype_11pygame_sdl2_6render_Texture = 0; static PyTypeObject *__pyx_ptype_11pygame_sdl2_6render_TextureNode = 0; static PyTypeObject *__pyx_ptype_11pygame_sdl2_6render_TextureAtlas = 0; static PyTypeObject *__pyx_ptype_11pygame_sdl2_6render_Sprite = 0; static PyTypeObject *__pyx_ptype_11pygame_sdl2_6render_Container = 0; static int __pyx_v_11pygame_sdl2_6render_DEBUG_DRAW_BBOX; static PyObject *__pyx_f_11pygame_sdl2_6render_rinfo_to_dict(SDL_RendererInfo *); /*proto*/ #define __Pyx_MODULE_NAME "pygame_sdl2.render" int __pyx_module_is_main_pygame_sdl2__render = 0; /* Implementation of 'pygame_sdl2.render' */ static PyObject *__pyx_builtin_range; static PyObject *__pyx_builtin_ValueError; static PyObject *__pyx_builtin_open; static char __pyx_k_a[] = "a"; static char __pyx_k_b[] = "b"; static char __pyx_k_g[] = "g"; static char __pyx_k_h[] = "h"; static char __pyx_k_n[] = "n"; static char __pyx_k_r[] = "r"; static char __pyx_k_w[] = "w"; static char __pyx_k_x[] = "x"; static char __pyx_k_y[] = "y"; static char __pyx_k_fi[] = "fi"; static char __pyx_k_rv[] = "rv"; static char __pyx_k_x1[] = "x1"; static char __pyx_k_x2[] = "x2"; static char __pyx_k_y1[] = "y1"; static char __pyx_k_y2[] = "y2"; static char __pyx_k_pos[] = "pos"; static char __pyx_k_ren[] = "ren"; static char __pyx_k_rtt[] = "rtt"; static char __pyx_k_tex[] = "tex"; static char __pyx_k_Rect[] = "Rect"; static char __pyx_k_dest[] = "dest"; static char __pyx_k_info[] = "info"; static char __pyx_k_json[] = "json"; static char __pyx_k_keys[] = "keys"; static char __pyx_k_load[] = "load"; static char __pyx_k_main[] = "__main__"; static char __pyx_k_meta[] = "meta"; static char __pyx_k_name[] = "name"; static char __pyx_k_open[] = "open"; static char __pyx_k_rect[] = "rect"; static char __pyx_k_test[] = "__test__"; static char __pyx_k_warn[] = "warn"; static char __pyx_k_Color[] = "Color"; static char __pyx_k_color[] = "color"; static char __pyx_k_error[] = "error"; static char __pyx_k_frame[] = "frame"; static char __pyx_k_image[] = "image"; static char __pyx_k_nodes[] = "nodes"; static char __pyx_k_range[] = "range"; static char __pyx_k_rinfo[] = "rinfo"; static char __pyx_k_vsync[] = "vsync"; static char __pyx_k_driver[] = "driver"; static char __pyx_k_frames[] = "frames"; static char __pyx_k_import[] = "__import__"; static char __pyx_k_render[] = "render"; static char __pyx_k_window[] = "window"; static char __pyx_k_rotated[] = "rotated"; static char __pyx_k_software[] = "software"; static char __pyx_k_warnings[] = "warnings"; static char __pyx_k_iteritems[] = "iteritems"; static char __pyx_k_ValueError[] = "ValueError"; static char __pyx_k_pyx_vtable[] = "__pyx_vtable__"; static char __pyx_k_sourceSize[] = "sourceSize"; static char __pyx_k_accelerated[] = "accelerated"; static char __pyx_k_get_drivers[] = "get_drivers"; static char __pyx_k_num_drivers[] = "num_drivers"; static char __pyx_k_load_texture[] = "load_texture"; static char __pyx_k_BLENDMODE_ADD[] = "BLENDMODE_ADD"; static char __pyx_k_BLENDMODE_MOD[] = "BLENDMODE_MOD"; static char __pyx_k_BLENDMODE_NONE[] = "BLENDMODE_NONE"; static char __pyx_k_BLENDMODE_BLEND[] = "BLENDMODE_BLEND"; static char __pyx_k_pygame_sdl2_rect[] = "pygame_sdl2.rect"; static char __pyx_k_spriteSourceSize[] = "spriteSourceSize"; static char __pyx_k_max_texture_width[] = "max_texture_width"; static char __pyx_k_pygame_sdl2_color[] = "pygame_sdl2.color"; static char __pyx_k_pygame_sdl2_error[] = "pygame_sdl2.error"; static char __pyx_k_Invalid_argument_s[] = "Invalid argument: %s"; static char __pyx_k_max_texture_height[] = "max_texture_height"; static char __pyx_k_pygame_sdl2_render[] = "pygame_sdl2.render"; static char __pyx_k_Rotation_not_supported_yet[] = "Rotation not supported yet."; static char __pyx_k_Renderer_is_not_accelerated[] = "Renderer is not accelerated."; static char __pyx_k_home_tom_ab_pygame_sdl2_src_pyg[] = "/home/tom/ab/pygame_sdl2/src/pygame_sdl2/render.pyx"; static PyObject *__pyx_n_s_BLENDMODE_ADD; static PyObject *__pyx_n_s_BLENDMODE_BLEND; static PyObject *__pyx_n_s_BLENDMODE_MOD; static PyObject *__pyx_n_s_BLENDMODE_NONE; static PyObject *__pyx_n_s_Color; static PyObject *__pyx_kp_s_Invalid_argument_s; static PyObject *__pyx_n_s_Rect; static PyObject *__pyx_kp_s_Renderer_is_not_accelerated; static PyObject *__pyx_kp_s_Rotation_not_supported_yet; static PyObject *__pyx_n_s_ValueError; static PyObject *__pyx_n_s_a; static PyObject *__pyx_n_s_accelerated; static PyObject *__pyx_n_s_b; static PyObject *__pyx_n_s_color; static PyObject *__pyx_n_s_dest; static PyObject *__pyx_n_s_driver; static PyObject *__pyx_n_s_error; static PyObject *__pyx_n_s_fi; static PyObject *__pyx_n_s_frame; static PyObject *__pyx_n_s_frames; static PyObject *__pyx_n_s_g; static PyObject *__pyx_n_s_get_drivers; static PyObject *__pyx_n_s_h; static PyObject *__pyx_kp_s_home_tom_ab_pygame_sdl2_src_pyg; static PyObject *__pyx_n_s_image; static PyObject *__pyx_n_s_import; static PyObject *__pyx_n_s_info; static PyObject *__pyx_n_s_iteritems; static PyObject *__pyx_n_s_json; static PyObject *__pyx_n_s_keys; static PyObject *__pyx_n_s_load; static PyObject *__pyx_n_s_load_texture; static PyObject *__pyx_n_s_main; static PyObject *__pyx_n_s_max_texture_height; static PyObject *__pyx_n_s_max_texture_width; static PyObject *__pyx_n_s_meta; static PyObject *__pyx_n_s_n; static PyObject *__pyx_n_s_name; static PyObject *__pyx_n_s_nodes; static PyObject *__pyx_n_s_num_drivers; static PyObject *__pyx_n_s_open; static PyObject *__pyx_n_s_pos; static PyObject *__pyx_n_s_pygame_sdl2_color; static PyObject *__pyx_n_s_pygame_sdl2_error; static PyObject *__pyx_n_s_pygame_sdl2_rect; static PyObject *__pyx_n_s_pygame_sdl2_render; static PyObject *__pyx_n_s_pyx_vtable; static PyObject *__pyx_n_s_r; static PyObject *__pyx_n_s_range; static PyObject *__pyx_n_s_rect; static PyObject *__pyx_n_s_ren; static PyObject *__pyx_n_s_render; static PyObject *__pyx_n_s_rinfo; static PyObject *__pyx_n_s_rotated; static PyObject *__pyx_n_s_rtt; static PyObject *__pyx_n_s_rv; static PyObject *__pyx_n_s_software; static PyObject *__pyx_n_s_sourceSize; static PyObject *__pyx_n_s_spriteSourceSize; static PyObject *__pyx_n_s_test; static PyObject *__pyx_n_s_tex; static PyObject *__pyx_n_s_vsync; static PyObject *__pyx_n_s_w; static PyObject *__pyx_n_s_warn; static PyObject *__pyx_n_s_warnings; static PyObject *__pyx_n_s_window; static PyObject *__pyx_n_s_x; static PyObject *__pyx_n_s_x1; static PyObject *__pyx_n_s_x2; static PyObject *__pyx_n_s_y; static PyObject *__pyx_n_s_y1; static PyObject *__pyx_n_s_y2; static PyObject *__pyx_pf_11pygame_sdl2_6render_get_drivers(CYTHON_UNUSED PyObject *__pyx_self); /* proto */ static int __pyx_pf_11pygame_sdl2_6render_8Renderer___cinit__(struct __pyx_obj_11pygame_sdl2_6render_Renderer *__pyx_v_self); /* proto */ static void __pyx_pf_11pygame_sdl2_6render_8Renderer_2__dealloc__(struct __pyx_obj_11pygame_sdl2_6render_Renderer *__pyx_v_self); /* proto */ static int __pyx_pf_11pygame_sdl2_6render_8Renderer_4__init__(struct __pyx_obj_11pygame_sdl2_6render_Renderer *__pyx_v_self, struct __pyx_obj_11pygame_sdl2_7display_Window *__pyx_v_window, PyObject *__pyx_v_vsync, PyObject *__pyx_v_driver); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_6render_8Renderer_6load_texture(struct __pyx_obj_11pygame_sdl2_6render_Renderer *__pyx_v_self, PyObject *__pyx_v_fi); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_6render_8Renderer_8load_atlas(struct __pyx_obj_11pygame_sdl2_6render_Renderer *__pyx_v_self, PyObject *__pyx_v_filename); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_6render_8Renderer_10render_present(struct __pyx_obj_11pygame_sdl2_6render_Renderer *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_6render_8Renderer_12info(struct __pyx_obj_11pygame_sdl2_6render_Renderer *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_6render_8Renderer_14clear(struct __pyx_obj_11pygame_sdl2_6render_Renderer *__pyx_v_self, PyObject *__pyx_v_color); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_6render_8Renderer_16draw_line(struct __pyx_obj_11pygame_sdl2_6render_Renderer *__pyx_v_self, PyObject *__pyx_v_color, PyObject *__pyx_v_x1, PyObject *__pyx_v_y1, PyObject *__pyx_v_x2, PyObject *__pyx_v_y2); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_6render_8Renderer_18draw_point(struct __pyx_obj_11pygame_sdl2_6render_Renderer *__pyx_v_self, PyObject *__pyx_v_color, PyObject *__pyx_v_x, PyObject *__pyx_v_y); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_6render_8Renderer_20draw_rect(struct __pyx_obj_11pygame_sdl2_6render_Renderer *__pyx_v_self, PyObject *__pyx_v_color, PyObject *__pyx_v_rect); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_6render_8Renderer_22fill_rect(struct __pyx_obj_11pygame_sdl2_6render_Renderer *__pyx_v_self, PyObject *__pyx_v_color, PyObject *__pyx_v_rect); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_6render_8Renderer_24set_viewport(struct __pyx_obj_11pygame_sdl2_6render_Renderer *__pyx_v_self, PyObject *__pyx_v_rect); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_6render_8Renderer_26create_texture(struct __pyx_obj_11pygame_sdl2_6render_Renderer *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v_size); /* proto */ static int __pyx_pf_11pygame_sdl2_6render_7Texture___cinit__(struct __pyx_obj_11pygame_sdl2_6render_Texture *__pyx_v_self); /* proto */ static void __pyx_pf_11pygame_sdl2_6render_7Texture_2__dealloc__(struct __pyx_obj_11pygame_sdl2_6render_Texture *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_6render_7Texture_1w___get__(struct __pyx_obj_11pygame_sdl2_6render_Texture *__pyx_v_self); /* proto */ static int __pyx_pf_11pygame_sdl2_6render_7Texture_1w_2__set__(struct __pyx_obj_11pygame_sdl2_6render_Texture *__pyx_v_self, PyObject *__pyx_v_value); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_6render_7Texture_1h___get__(struct __pyx_obj_11pygame_sdl2_6render_Texture *__pyx_v_self); /* proto */ static int __pyx_pf_11pygame_sdl2_6render_7Texture_1h_2__set__(struct __pyx_obj_11pygame_sdl2_6render_Texture *__pyx_v_self, PyObject *__pyx_v_value); /* proto */ static int __pyx_pf_11pygame_sdl2_6render_11TextureNode___init__(struct __pyx_obj_11pygame_sdl2_6render_TextureNode *__pyx_v_self, PyObject *__pyx_v_tex); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_6render_11TextureNode_2render(struct __pyx_obj_11pygame_sdl2_6render_TextureNode *__pyx_v_self, PyObject *__pyx_v_dest); /* proto */ static int __pyx_pf_11pygame_sdl2_6render_12TextureAtlas___init__(struct __pyx_obj_11pygame_sdl2_6render_TextureAtlas *__pyx_v_self, struct __pyx_obj_11pygame_sdl2_6render_Renderer *__pyx_v_ren, PyObject *__pyx_v_fi); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_6render_12TextureAtlas_2__getitem__(struct __pyx_obj_11pygame_sdl2_6render_TextureAtlas *__pyx_v_self, PyObject *__pyx_v_key); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_6render_12TextureAtlas_4keys(struct __pyx_obj_11pygame_sdl2_6render_TextureAtlas *__pyx_v_self); /* proto */ static int __pyx_pf_11pygame_sdl2_6render_6Sprite___init__(struct __pyx_obj_11pygame_sdl2_6render_Sprite *__pyx_v_self, PyObject *__pyx_v_nodes); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_6render_6Sprite_2render(struct __pyx_obj_11pygame_sdl2_6render_Sprite *__pyx_v_self, PyObject *__pyx_v_dest); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_6render_6Sprite_4collides(struct __pyx_obj_11pygame_sdl2_6render_Sprite *__pyx_v_self, struct __pyx_obj_11pygame_sdl2_6render_Sprite *__pyx_v_other); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_6render_6Sprite_3pos___get__(struct __pyx_obj_11pygame_sdl2_6render_Sprite *__pyx_v_self); /* proto */ static int __pyx_pf_11pygame_sdl2_6render_6Sprite_3pos_2__set__(struct __pyx_obj_11pygame_sdl2_6render_Sprite *__pyx_v_self, PyObject *__pyx_v_val); /* proto */ static int __pyx_pf_11pygame_sdl2_6render_6Sprite_5color___set__(struct __pyx_obj_11pygame_sdl2_6render_Sprite *__pyx_v_self, PyObject *__pyx_v_val); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_6render_6Sprite_5alpha___get__(struct __pyx_obj_11pygame_sdl2_6render_Sprite *__pyx_v_self); /* proto */ static int __pyx_pf_11pygame_sdl2_6render_6Sprite_5alpha_2__set__(struct __pyx_obj_11pygame_sdl2_6render_Sprite *__pyx_v_self, PyObject *__pyx_v_val); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_6render_6Sprite_8rotation___get__(struct __pyx_obj_11pygame_sdl2_6render_Sprite *__pyx_v_self); /* proto */ static int __pyx_pf_11pygame_sdl2_6render_6Sprite_8rotation_2__set__(struct __pyx_obj_11pygame_sdl2_6render_Sprite *__pyx_v_self, PyObject *__pyx_v_val); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_6render_6Sprite_5scale___get__(struct __pyx_obj_11pygame_sdl2_6render_Sprite *__pyx_v_self); /* proto */ static int __pyx_pf_11pygame_sdl2_6render_6Sprite_5scale_2__set__(struct __pyx_obj_11pygame_sdl2_6render_Sprite *__pyx_v_self, PyObject *__pyx_v_arg); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_6render_6Sprite_5hflip___get__(struct __pyx_obj_11pygame_sdl2_6render_Sprite *__pyx_v_self); /* proto */ static int __pyx_pf_11pygame_sdl2_6render_6Sprite_5hflip_2__set__(struct __pyx_obj_11pygame_sdl2_6render_Sprite *__pyx_v_self, PyObject *__pyx_v_val); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_6render_6Sprite_5vflip___get__(struct __pyx_obj_11pygame_sdl2_6render_Sprite *__pyx_v_self); /* proto */ static int __pyx_pf_11pygame_sdl2_6render_6Sprite_5vflip_2__set__(struct __pyx_obj_11pygame_sdl2_6render_Sprite *__pyx_v_self, PyObject *__pyx_v_val); /* proto */ static int __pyx_pf_11pygame_sdl2_6render_9Container___init__(struct __pyx_obj_11pygame_sdl2_6render_Container *__pyx_v_self, PyObject *__pyx_v_rect); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_6render_9Container_2add(struct __pyx_obj_11pygame_sdl2_6render_Container *__pyx_v_self, struct __pyx_obj_11pygame_sdl2_6render_Sprite *__pyx_v_sprite); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_6render_9Container_4render(struct __pyx_obj_11pygame_sdl2_6render_Container *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v_dest); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_6render_9Container_3pos___get__(struct __pyx_obj_11pygame_sdl2_6render_Container *__pyx_v_self); /* proto */ static int __pyx_pf_11pygame_sdl2_6render_9Container_3pos_2__set__(struct __pyx_obj_11pygame_sdl2_6render_Container *__pyx_v_self, PyObject *__pyx_v_val); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_6render_9Container_4rect___get__(struct __pyx_obj_11pygame_sdl2_6render_Container *__pyx_v_self); /* proto */ static int __pyx_pf_11pygame_sdl2_6render_9Container_4rect_2__set__(struct __pyx_obj_11pygame_sdl2_6render_Container *__pyx_v_self, PyObject *__pyx_v_val); /* proto */ static PyObject *__pyx_tp_new_11pygame_sdl2_6render_Renderer(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ static PyObject *__pyx_tp_new_11pygame_sdl2_6render_Texture(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ static PyObject *__pyx_tp_new_11pygame_sdl2_6render_TextureNode(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ static PyObject *__pyx_tp_new_11pygame_sdl2_6render_TextureAtlas(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ static PyObject *__pyx_tp_new_11pygame_sdl2_6render_Sprite(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ static PyObject *__pyx_tp_new_11pygame_sdl2_6render_Container(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ static PyObject *__pyx_int_0; static PyObject *__pyx_int_neg_1; static PyObject *__pyx_tuple_; static PyObject *__pyx_tuple__2; static PyObject *__pyx_tuple__3; static PyObject *__pyx_codeobj__4; /* "pygame_sdl2/render.pyx":40 * cdef bint DEBUG_DRAW_BBOX = True * * cdef rinfo_to_dict(SDL_RendererInfo *rinfo): # <<<<<<<<<<<<<< * # Ignore texture_formats for now. * return { */ static PyObject *__pyx_f_11pygame_sdl2_6render_rinfo_to_dict(SDL_RendererInfo *__pyx_v_rinfo) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("rinfo_to_dict", 0); /* "pygame_sdl2/render.pyx":42 * cdef rinfo_to_dict(SDL_RendererInfo *rinfo): * # Ignore texture_formats for now. * return { # <<<<<<<<<<<<<< * "name" : rinfo.name, * "software" : rinfo.flags & SDL_RENDERER_SOFTWARE != 0, */ __Pyx_XDECREF(__pyx_r); /* "pygame_sdl2/render.pyx":43 * # Ignore texture_formats for now. * return { * "name" : rinfo.name, # <<<<<<<<<<<<<< * "software" : rinfo.flags & SDL_RENDERER_SOFTWARE != 0, * "accelerated" : rinfo.flags & SDL_RENDERER_ACCELERATED != 0, */ __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 43; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = __Pyx_PyBytes_FromString(__pyx_v_rinfo->name); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 43; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_name, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 43; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "pygame_sdl2/render.pyx":44 * return { * "name" : rinfo.name, * "software" : rinfo.flags & SDL_RENDERER_SOFTWARE != 0, # <<<<<<<<<<<<<< * "accelerated" : rinfo.flags & SDL_RENDERER_ACCELERATED != 0, * "vsync" : rinfo.flags & SDL_RENDERER_PRESENTVSYNC != 0, */ __pyx_t_2 = __Pyx_PyBool_FromLong(((__pyx_v_rinfo->flags & SDL_RENDERER_SOFTWARE) != 0)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 44; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_software, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 43; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "pygame_sdl2/render.pyx":45 * "name" : rinfo.name, * "software" : rinfo.flags & SDL_RENDERER_SOFTWARE != 0, * "accelerated" : rinfo.flags & SDL_RENDERER_ACCELERATED != 0, # <<<<<<<<<<<<<< * "vsync" : rinfo.flags & SDL_RENDERER_PRESENTVSYNC != 0, * "rtt" : rinfo.flags & SDL_RENDERER_TARGETTEXTURE != 0, */ __pyx_t_2 = __Pyx_PyBool_FromLong(((__pyx_v_rinfo->flags & SDL_RENDERER_ACCELERATED) != 0)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 45; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_accelerated, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 43; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "pygame_sdl2/render.pyx":46 * "software" : rinfo.flags & SDL_RENDERER_SOFTWARE != 0, * "accelerated" : rinfo.flags & SDL_RENDERER_ACCELERATED != 0, * "vsync" : rinfo.flags & SDL_RENDERER_PRESENTVSYNC != 0, # <<<<<<<<<<<<<< * "rtt" : rinfo.flags & SDL_RENDERER_TARGETTEXTURE != 0, * "max_texture_width" : rinfo.max_texture_width, */ __pyx_t_2 = __Pyx_PyBool_FromLong(((__pyx_v_rinfo->flags & SDL_RENDERER_PRESENTVSYNC) != 0)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 46; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_vsync, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 43; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "pygame_sdl2/render.pyx":47 * "accelerated" : rinfo.flags & SDL_RENDERER_ACCELERATED != 0, * "vsync" : rinfo.flags & SDL_RENDERER_PRESENTVSYNC != 0, * "rtt" : rinfo.flags & SDL_RENDERER_TARGETTEXTURE != 0, # <<<<<<<<<<<<<< * "max_texture_width" : rinfo.max_texture_width, * "max_texture_height" : rinfo.max_texture_height, */ __pyx_t_2 = __Pyx_PyBool_FromLong(((__pyx_v_rinfo->flags & SDL_RENDERER_TARGETTEXTURE) != 0)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 47; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_rtt, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 43; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "pygame_sdl2/render.pyx":48 * "vsync" : rinfo.flags & SDL_RENDERER_PRESENTVSYNC != 0, * "rtt" : rinfo.flags & SDL_RENDERER_TARGETTEXTURE != 0, * "max_texture_width" : rinfo.max_texture_width, # <<<<<<<<<<<<<< * "max_texture_height" : rinfo.max_texture_height, * } */ __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_v_rinfo->max_texture_width); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 48; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_max_texture_width, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 43; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "pygame_sdl2/render.pyx":49 * "rtt" : rinfo.flags & SDL_RENDERER_TARGETTEXTURE != 0, * "max_texture_width" : rinfo.max_texture_width, * "max_texture_height" : rinfo.max_texture_height, # <<<<<<<<<<<<<< * } * */ __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_v_rinfo->max_texture_height); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 49; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_max_texture_height, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 43; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "pygame_sdl2/render.pyx":40 * cdef bint DEBUG_DRAW_BBOX = True * * cdef rinfo_to_dict(SDL_RendererInfo *rinfo): # <<<<<<<<<<<<<< * # Ignore texture_formats for now. * return { */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_AddTraceback("pygame_sdl2.render.rinfo_to_dict", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/render.pyx":52 * } * * def get_drivers(): # <<<<<<<<<<<<<< * cdef SDL_RendererInfo rinfo * cdef int num_drivers */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_6render_1get_drivers(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused); /*proto*/ static PyMethodDef __pyx_mdef_11pygame_sdl2_6render_1get_drivers = {"get_drivers", (PyCFunction)__pyx_pw_11pygame_sdl2_6render_1get_drivers, METH_NOARGS, 0}; static PyObject *__pyx_pw_11pygame_sdl2_6render_1get_drivers(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("get_drivers (wrapper)", 0); __pyx_r = __pyx_pf_11pygame_sdl2_6render_get_drivers(__pyx_self); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_6render_get_drivers(CYTHON_UNUSED PyObject *__pyx_self) { SDL_RendererInfo __pyx_v_rinfo; int __pyx_v_num_drivers; PyObject *__pyx_v_rv = NULL; int __pyx_v_n; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_t_2; int __pyx_t_3; int __pyx_t_4; PyObject *__pyx_t_5 = NULL; PyObject *__pyx_t_6 = NULL; int __pyx_t_7; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("get_drivers", 0); /* "pygame_sdl2/render.pyx":55 * cdef SDL_RendererInfo rinfo * cdef int num_drivers * rv = [] # <<<<<<<<<<<<<< * * num_drivers = SDL_GetNumRenderDrivers() */ __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 55; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_v_rv = ((PyObject*)__pyx_t_1); __pyx_t_1 = 0; /* "pygame_sdl2/render.pyx":57 * rv = [] * * num_drivers = SDL_GetNumRenderDrivers() # <<<<<<<<<<<<<< * for n in range(num_drivers): * if SDL_GetRenderDriverInfo(n, &rinfo) != 0: */ __pyx_v_num_drivers = SDL_GetNumRenderDrivers(); /* "pygame_sdl2/render.pyx":58 * * num_drivers = SDL_GetNumRenderDrivers() * for n in range(num_drivers): # <<<<<<<<<<<<<< * if SDL_GetRenderDriverInfo(n, &rinfo) != 0: * raise error() */ __pyx_t_2 = __pyx_v_num_drivers; for (__pyx_t_3 = 0; __pyx_t_3 < __pyx_t_2; __pyx_t_3+=1) { __pyx_v_n = __pyx_t_3; /* "pygame_sdl2/render.pyx":59 * num_drivers = SDL_GetNumRenderDrivers() * for n in range(num_drivers): * if SDL_GetRenderDriverInfo(n, &rinfo) != 0: # <<<<<<<<<<<<<< * raise error() * */ __pyx_t_4 = ((SDL_GetRenderDriverInfo(__pyx_v_n, (&__pyx_v_rinfo)) != 0) != 0); if (__pyx_t_4) { /* "pygame_sdl2/render.pyx":60 * for n in range(num_drivers): * if SDL_GetRenderDriverInfo(n, &rinfo) != 0: * raise error() # <<<<<<<<<<<<<< * * rv.append(rinfo_to_dict(&rinfo)) */ __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_error); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 60; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); __pyx_t_6 = NULL; if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_5))) { __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_5); if (likely(__pyx_t_6)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5); __Pyx_INCREF(__pyx_t_6); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_5, function); } } if (__pyx_t_6) { __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_t_6); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 60; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; } else { __pyx_t_1 = __Pyx_PyObject_CallNoArg(__pyx_t_5); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 60; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_Raise(__pyx_t_1, 0, 0, 0); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; {__pyx_filename = __pyx_f[0]; __pyx_lineno = 60; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "pygame_sdl2/render.pyx":59 * num_drivers = SDL_GetNumRenderDrivers() * for n in range(num_drivers): * if SDL_GetRenderDriverInfo(n, &rinfo) != 0: # <<<<<<<<<<<<<< * raise error() * */ } /* "pygame_sdl2/render.pyx":62 * raise error() * * rv.append(rinfo_to_dict(&rinfo)) # <<<<<<<<<<<<<< * * return rv */ __pyx_t_1 = __pyx_f_11pygame_sdl2_6render_rinfo_to_dict((&__pyx_v_rinfo)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 62; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_t_7 = __Pyx_PyList_Append(__pyx_v_rv, __pyx_t_1); if (unlikely(__pyx_t_7 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 62; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; } /* "pygame_sdl2/render.pyx":64 * rv.append(rinfo_to_dict(&rinfo)) * * return rv # <<<<<<<<<<<<<< * * */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(__pyx_v_rv); __pyx_r = __pyx_v_rv; goto __pyx_L0; /* "pygame_sdl2/render.pyx":52 * } * * def get_drivers(): # <<<<<<<<<<<<<< * cdef SDL_RendererInfo rinfo * cdef int num_drivers */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_5); __Pyx_XDECREF(__pyx_t_6); __Pyx_AddTraceback("pygame_sdl2.render.get_drivers", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF(__pyx_v_rv); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/render.pyx":71 * cdef dict _info * * def __cinit__(self): # <<<<<<<<<<<<<< * self.renderer = NULL * */ /* Python wrapper */ static int __pyx_pw_11pygame_sdl2_6render_8Renderer_1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static int __pyx_pw_11pygame_sdl2_6render_8Renderer_1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__cinit__ (wrapper)", 0); if (unlikely(PyTuple_GET_SIZE(__pyx_args) > 0)) { __Pyx_RaiseArgtupleInvalid("__cinit__", 1, 0, 0, PyTuple_GET_SIZE(__pyx_args)); return -1;} if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "__cinit__", 0))) return -1; __pyx_r = __pyx_pf_11pygame_sdl2_6render_8Renderer___cinit__(((struct __pyx_obj_11pygame_sdl2_6render_Renderer *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static int __pyx_pf_11pygame_sdl2_6render_8Renderer___cinit__(struct __pyx_obj_11pygame_sdl2_6render_Renderer *__pyx_v_self) { int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__cinit__", 0); /* "pygame_sdl2/render.pyx":72 * * def __cinit__(self): * self.renderer = NULL # <<<<<<<<<<<<<< * * def __dealloc__(self): */ __pyx_v_self->renderer = NULL; /* "pygame_sdl2/render.pyx":71 * cdef dict _info * * def __cinit__(self): # <<<<<<<<<<<<<< * self.renderer = NULL * */ /* function exit code */ __pyx_r = 0; __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/render.pyx":74 * self.renderer = NULL * * def __dealloc__(self): # <<<<<<<<<<<<<< * if self.renderer: * SDL_DestroyRenderer(self.renderer) */ /* Python wrapper */ static void __pyx_pw_11pygame_sdl2_6render_8Renderer_3__dealloc__(PyObject *__pyx_v_self); /*proto*/ static void __pyx_pw_11pygame_sdl2_6render_8Renderer_3__dealloc__(PyObject *__pyx_v_self) { __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__dealloc__ (wrapper)", 0); __pyx_pf_11pygame_sdl2_6render_8Renderer_2__dealloc__(((struct __pyx_obj_11pygame_sdl2_6render_Renderer *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); } static void __pyx_pf_11pygame_sdl2_6render_8Renderer_2__dealloc__(struct __pyx_obj_11pygame_sdl2_6render_Renderer *__pyx_v_self) { __Pyx_RefNannyDeclarations int __pyx_t_1; __Pyx_RefNannySetupContext("__dealloc__", 0); /* "pygame_sdl2/render.pyx":75 * * def __dealloc__(self): * if self.renderer: # <<<<<<<<<<<<<< * SDL_DestroyRenderer(self.renderer) * */ __pyx_t_1 = (__pyx_v_self->renderer != 0); if (__pyx_t_1) { /* "pygame_sdl2/render.pyx":76 * def __dealloc__(self): * if self.renderer: * SDL_DestroyRenderer(self.renderer) # <<<<<<<<<<<<<< * * def __init__(self, Window window=None, vsync=False, driver=-1): */ SDL_DestroyRenderer(__pyx_v_self->renderer); /* "pygame_sdl2/render.pyx":75 * * def __dealloc__(self): * if self.renderer: # <<<<<<<<<<<<<< * SDL_DestroyRenderer(self.renderer) * */ } /* "pygame_sdl2/render.pyx":74 * self.renderer = NULL * * def __dealloc__(self): # <<<<<<<<<<<<<< * if self.renderer: * SDL_DestroyRenderer(self.renderer) */ /* function exit code */ __Pyx_RefNannyFinishContext(); } /* "pygame_sdl2/render.pyx":78 * SDL_DestroyRenderer(self.renderer) * * def __init__(self, Window window=None, vsync=False, driver=-1): # <<<<<<<<<<<<<< * if window is None: * window = main_window */ /* Python wrapper */ static int __pyx_pw_11pygame_sdl2_6render_8Renderer_5__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static int __pyx_pw_11pygame_sdl2_6render_8Renderer_5__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { struct __pyx_obj_11pygame_sdl2_7display_Window *__pyx_v_window = 0; PyObject *__pyx_v_vsync = 0; PyObject *__pyx_v_driver = 0; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__init__ (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_window,&__pyx_n_s_vsync,&__pyx_n_s_driver,0}; PyObject* values[3] = {0,0,0}; values[0] = (PyObject *)((struct __pyx_obj_11pygame_sdl2_7display_Window *)Py_None); values[1] = ((PyObject *)Py_False); values[2] = ((PyObject *)__pyx_int_neg_1); if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (kw_args > 0) { PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_window); if (value) { values[0] = value; kw_args--; } } case 1: if (kw_args > 0) { PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_vsync); if (value) { values[1] = value; kw_args--; } } case 2: if (kw_args > 0) { PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_driver); if (value) { values[2] = value; kw_args--; } } } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__init__") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 78; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } } else { switch (PyTuple_GET_SIZE(__pyx_args)) { case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); case 0: break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_window = ((struct __pyx_obj_11pygame_sdl2_7display_Window *)values[0]); __pyx_v_vsync = values[1]; __pyx_v_driver = values[2]; } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("__init__", 0, 0, 3, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 78; __pyx_clineno = __LINE__; goto __pyx_L3_error;} __pyx_L3_error:; __Pyx_AddTraceback("pygame_sdl2.render.Renderer.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return -1; __pyx_L4_argument_unpacking_done:; if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_window), __pyx_ptype_11pygame_sdl2_7display_Window, 1, "window", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 78; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_r = __pyx_pf_11pygame_sdl2_6render_8Renderer_4__init__(((struct __pyx_obj_11pygame_sdl2_6render_Renderer *)__pyx_v_self), __pyx_v_window, __pyx_v_vsync, __pyx_v_driver); /* function exit code */ goto __pyx_L0; __pyx_L1_error:; __pyx_r = -1; __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; } static int __pyx_pf_11pygame_sdl2_6render_8Renderer_4__init__(struct __pyx_obj_11pygame_sdl2_6render_Renderer *__pyx_v_self, struct __pyx_obj_11pygame_sdl2_7display_Window *__pyx_v_window, PyObject *__pyx_v_vsync, PyObject *__pyx_v_driver) { uint32_t __pyx_v_flags; SDL_RendererInfo __pyx_v_rinfo; int __pyx_r; __Pyx_RefNannyDeclarations int __pyx_t_1; int __pyx_t_2; int __pyx_t_3; PyObject *__pyx_t_4 = NULL; PyObject *__pyx_t_5 = NULL; PyObject *__pyx_t_6 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__init__", 0); __Pyx_INCREF((PyObject *)__pyx_v_window); /* "pygame_sdl2/render.pyx":79 * * def __init__(self, Window window=None, vsync=False, driver=-1): * if window is None: # <<<<<<<<<<<<<< * window = main_window * */ __pyx_t_1 = (((PyObject *)__pyx_v_window) == Py_None); __pyx_t_2 = (__pyx_t_1 != 0); if (__pyx_t_2) { /* "pygame_sdl2/render.pyx":80 * def __init__(self, Window window=None, vsync=False, driver=-1): * if window is None: * window = main_window # <<<<<<<<<<<<<< * * cdef uint32_t flags = SDL_RENDERER_ACCELERATED */ __Pyx_INCREF(((PyObject *)__pyx_v_11pygame_sdl2_7display_main_window)); __Pyx_DECREF_SET(__pyx_v_window, __pyx_v_11pygame_sdl2_7display_main_window); /* "pygame_sdl2/render.pyx":79 * * def __init__(self, Window window=None, vsync=False, driver=-1): * if window is None: # <<<<<<<<<<<<<< * window = main_window * */ } /* "pygame_sdl2/render.pyx":82 * window = main_window * * cdef uint32_t flags = SDL_RENDERER_ACCELERATED # <<<<<<<<<<<<<< * if vsync: * flags |= SDL_RENDERER_PRESENTVSYNC */ __pyx_v_flags = SDL_RENDERER_ACCELERATED; /* "pygame_sdl2/render.pyx":83 * * cdef uint32_t flags = SDL_RENDERER_ACCELERATED * if vsync: # <<<<<<<<<<<<<< * flags |= SDL_RENDERER_PRESENTVSYNC * */ __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_v_vsync); if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 83; __pyx_clineno = __LINE__; goto __pyx_L1_error;} if (__pyx_t_2) { /* "pygame_sdl2/render.pyx":84 * cdef uint32_t flags = SDL_RENDERER_ACCELERATED * if vsync: * flags |= SDL_RENDERER_PRESENTVSYNC # <<<<<<<<<<<<<< * * self.renderer = SDL_CreateRenderer(window.window, driver, flags) */ __pyx_v_flags = (__pyx_v_flags | SDL_RENDERER_PRESENTVSYNC); /* "pygame_sdl2/render.pyx":83 * * cdef uint32_t flags = SDL_RENDERER_ACCELERATED * if vsync: # <<<<<<<<<<<<<< * flags |= SDL_RENDERER_PRESENTVSYNC * */ } /* "pygame_sdl2/render.pyx":86 * flags |= SDL_RENDERER_PRESENTVSYNC * * self.renderer = SDL_CreateRenderer(window.window, driver, flags) # <<<<<<<<<<<<<< * if self.renderer == NULL: * self.renderer = SDL_GetRenderer(window.window) */ __pyx_t_3 = __Pyx_PyInt_As_int(__pyx_v_driver); if (unlikely((__pyx_t_3 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 86; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_v_self->renderer = SDL_CreateRenderer(__pyx_v_window->window, __pyx_t_3, __pyx_v_flags); /* "pygame_sdl2/render.pyx":87 * * self.renderer = SDL_CreateRenderer(window.window, driver, flags) * if self.renderer == NULL: # <<<<<<<<<<<<<< * self.renderer = SDL_GetRenderer(window.window) * if self.renderer == NULL: */ __pyx_t_2 = ((__pyx_v_self->renderer == NULL) != 0); if (__pyx_t_2) { /* "pygame_sdl2/render.pyx":88 * self.renderer = SDL_CreateRenderer(window.window, driver, flags) * if self.renderer == NULL: * self.renderer = SDL_GetRenderer(window.window) # <<<<<<<<<<<<<< * if self.renderer == NULL: * raise error() */ __pyx_v_self->renderer = SDL_GetRenderer(__pyx_v_window->window); /* "pygame_sdl2/render.pyx":89 * if self.renderer == NULL: * self.renderer = SDL_GetRenderer(window.window) * if self.renderer == NULL: # <<<<<<<<<<<<<< * raise error() * */ __pyx_t_2 = ((__pyx_v_self->renderer == NULL) != 0); if (__pyx_t_2) { /* "pygame_sdl2/render.pyx":90 * self.renderer = SDL_GetRenderer(window.window) * if self.renderer == NULL: * raise error() # <<<<<<<<<<<<<< * * cdef SDL_RendererInfo rinfo */ __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_error); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 90; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); __pyx_t_6 = NULL; if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_5))) { __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_5); if (likely(__pyx_t_6)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5); __Pyx_INCREF(__pyx_t_6); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_5, function); } } if (__pyx_t_6) { __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_t_6); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 90; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; } else { __pyx_t_4 = __Pyx_PyObject_CallNoArg(__pyx_t_5); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 90; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_Raise(__pyx_t_4, 0, 0, 0); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; {__pyx_filename = __pyx_f[0]; __pyx_lineno = 90; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "pygame_sdl2/render.pyx":89 * if self.renderer == NULL: * self.renderer = SDL_GetRenderer(window.window) * if self.renderer == NULL: # <<<<<<<<<<<<<< * raise error() * */ } /* "pygame_sdl2/render.pyx":87 * * self.renderer = SDL_CreateRenderer(window.window, driver, flags) * if self.renderer == NULL: # <<<<<<<<<<<<<< * self.renderer = SDL_GetRenderer(window.window) * if self.renderer == NULL: */ } /* "pygame_sdl2/render.pyx":93 * * cdef SDL_RendererInfo rinfo * if SDL_GetRendererInfo(self.renderer, &rinfo) != 0: # <<<<<<<<<<<<<< * raise error() * */ __pyx_t_2 = ((SDL_GetRendererInfo(__pyx_v_self->renderer, (&__pyx_v_rinfo)) != 0) != 0); if (__pyx_t_2) { /* "pygame_sdl2/render.pyx":94 * cdef SDL_RendererInfo rinfo * if SDL_GetRendererInfo(self.renderer, &rinfo) != 0: * raise error() # <<<<<<<<<<<<<< * * self._info = rinfo_to_dict(&rinfo) */ __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_error); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 94; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); __pyx_t_6 = NULL; if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_5))) { __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_5); if (likely(__pyx_t_6)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5); __Pyx_INCREF(__pyx_t_6); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_5, function); } } if (__pyx_t_6) { __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_t_6); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 94; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; } else { __pyx_t_4 = __Pyx_PyObject_CallNoArg(__pyx_t_5); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 94; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_Raise(__pyx_t_4, 0, 0, 0); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; {__pyx_filename = __pyx_f[0]; __pyx_lineno = 94; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "pygame_sdl2/render.pyx":93 * * cdef SDL_RendererInfo rinfo * if SDL_GetRendererInfo(self.renderer, &rinfo) != 0: # <<<<<<<<<<<<<< * raise error() * */ } /* "pygame_sdl2/render.pyx":96 * raise error() * * self._info = rinfo_to_dict(&rinfo) # <<<<<<<<<<<<<< * * if not self.info()["accelerated"]: */ __pyx_t_4 = __pyx_f_11pygame_sdl2_6render_rinfo_to_dict((&__pyx_v_rinfo)); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 96; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); if (!(likely(PyDict_CheckExact(__pyx_t_4))||((__pyx_t_4) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "dict", Py_TYPE(__pyx_t_4)->tp_name), 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 96; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GIVEREF(__pyx_t_4); __Pyx_GOTREF(__pyx_v_self->_info); __Pyx_DECREF(__pyx_v_self->_info); __pyx_v_self->_info = ((PyObject*)__pyx_t_4); __pyx_t_4 = 0; /* "pygame_sdl2/render.pyx":98 * self._info = rinfo_to_dict(&rinfo) * * if not self.info()["accelerated"]: # <<<<<<<<<<<<<< * warnings.warn("Renderer is not accelerated.") * */ __pyx_t_5 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_info); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 98; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); __pyx_t_6 = NULL; if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_5))) { __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_5); if (likely(__pyx_t_6)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5); __Pyx_INCREF(__pyx_t_6); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_5, function); } } if (__pyx_t_6) { __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_t_6); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 98; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; } else { __pyx_t_4 = __Pyx_PyObject_CallNoArg(__pyx_t_5); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 98; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __pyx_t_5 = PyObject_GetItem(__pyx_t_4, __pyx_n_s_accelerated); if (unlikely(__pyx_t_5 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 98; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 98; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __pyx_t_1 = ((!__pyx_t_2) != 0); if (__pyx_t_1) { /* "pygame_sdl2/render.pyx":99 * * if not self.info()["accelerated"]: * warnings.warn("Renderer is not accelerated.") # <<<<<<<<<<<<<< * * def load_texture(self, fi): */ __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_warnings); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 99; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_warn); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 99; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_tuple_, NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 99; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; /* "pygame_sdl2/render.pyx":98 * self._info = rinfo_to_dict(&rinfo) * * if not self.info()["accelerated"]: # <<<<<<<<<<<<<< * warnings.warn("Renderer is not accelerated.") * */ } /* "pygame_sdl2/render.pyx":78 * SDL_DestroyRenderer(self.renderer) * * def __init__(self, Window window=None, vsync=False, driver=-1): # <<<<<<<<<<<<<< * if window is None: * window = main_window */ /* function exit code */ __pyx_r = 0; goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_5); __Pyx_XDECREF(__pyx_t_6); __Pyx_AddTraceback("pygame_sdl2.render.Renderer.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = -1; __pyx_L0:; __Pyx_XDECREF((PyObject *)__pyx_v_window); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/render.pyx":101 * warnings.warn("Renderer is not accelerated.") * * def load_texture(self, fi): # <<<<<<<<<<<<<< * cdef SDL_Texture *tex * cdef Texture t = Texture() */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_6render_8Renderer_7load_texture(PyObject *__pyx_v_self, PyObject *__pyx_v_fi); /*proto*/ static PyObject *__pyx_pw_11pygame_sdl2_6render_8Renderer_7load_texture(PyObject *__pyx_v_self, PyObject *__pyx_v_fi) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("load_texture (wrapper)", 0); __pyx_r = __pyx_pf_11pygame_sdl2_6render_8Renderer_6load_texture(((struct __pyx_obj_11pygame_sdl2_6render_Renderer *)__pyx_v_self), ((PyObject *)__pyx_v_fi)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_6render_8Renderer_6load_texture(struct __pyx_obj_11pygame_sdl2_6render_Renderer *__pyx_v_self, PyObject *__pyx_v_fi) { SDL_Texture *__pyx_v_tex; struct __pyx_obj_11pygame_sdl2_6render_Texture *__pyx_v_t = 0; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_t_2; int __pyx_t_3; SDL_RWops *__pyx_t_4; PyObject *__pyx_t_5 = NULL; PyObject *__pyx_t_6 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("load_texture", 0); /* "pygame_sdl2/render.pyx":103 * def load_texture(self, fi): * cdef SDL_Texture *tex * cdef Texture t = Texture() # <<<<<<<<<<<<<< * * if isinstance(fi, Surface): */ __pyx_t_1 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_11pygame_sdl2_6render_Texture), __pyx_empty_tuple, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 103; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_v_t = ((struct __pyx_obj_11pygame_sdl2_6render_Texture *)__pyx_t_1); __pyx_t_1 = 0; /* "pygame_sdl2/render.pyx":105 * cdef Texture t = Texture() * * if isinstance(fi, Surface): # <<<<<<<<<<<<<< * tex = SDL_CreateTextureFromSurface(self.renderer, (fi).surface) * else: */ __pyx_t_2 = __Pyx_TypeCheck(__pyx_v_fi, __pyx_ptype_11pygame_sdl2_7surface_Surface); __pyx_t_3 = (__pyx_t_2 != 0); if (__pyx_t_3) { /* "pygame_sdl2/render.pyx":106 * * if isinstance(fi, Surface): * tex = SDL_CreateTextureFromSurface(self.renderer, (fi).surface) # <<<<<<<<<<<<<< * else: * tex = IMG_LoadTexture_RW(self.renderer, to_rwops(fi), 1) */ __pyx_v_tex = SDL_CreateTextureFromSurface(__pyx_v_self->renderer, ((struct __pyx_obj_11pygame_sdl2_7surface_Surface *)__pyx_v_fi)->surface); /* "pygame_sdl2/render.pyx":105 * cdef Texture t = Texture() * * if isinstance(fi, Surface): # <<<<<<<<<<<<<< * tex = SDL_CreateTextureFromSurface(self.renderer, (fi).surface) * else: */ goto __pyx_L3; } /* "pygame_sdl2/render.pyx":108 * tex = SDL_CreateTextureFromSurface(self.renderer, (fi).surface) * else: * tex = IMG_LoadTexture_RW(self.renderer, to_rwops(fi), 1) # <<<<<<<<<<<<<< * * if tex == NULL: */ /*else*/ { __pyx_t_4 = __pyx_f_11pygame_sdl2_8rwobject_to_rwops(__pyx_v_fi, NULL); if (unlikely(__pyx_t_4 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 108; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_v_tex = IMG_LoadTexture_RW(__pyx_v_self->renderer, __pyx_t_4, 1); } __pyx_L3:; /* "pygame_sdl2/render.pyx":110 * tex = IMG_LoadTexture_RW(self.renderer, to_rwops(fi), 1) * * if tex == NULL: # <<<<<<<<<<<<<< * raise error() * */ __pyx_t_3 = ((__pyx_v_tex == NULL) != 0); if (__pyx_t_3) { /* "pygame_sdl2/render.pyx":111 * * if tex == NULL: * raise error() # <<<<<<<<<<<<<< * * t.set(self.renderer, tex) */ __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_error); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 111; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); __pyx_t_6 = NULL; if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_5))) { __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_5); if (likely(__pyx_t_6)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5); __Pyx_INCREF(__pyx_t_6); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_5, function); } } if (__pyx_t_6) { __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_t_6); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 111; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; } else { __pyx_t_1 = __Pyx_PyObject_CallNoArg(__pyx_t_5); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 111; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_Raise(__pyx_t_1, 0, 0, 0); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; {__pyx_filename = __pyx_f[0]; __pyx_lineno = 111; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "pygame_sdl2/render.pyx":110 * tex = IMG_LoadTexture_RW(self.renderer, to_rwops(fi), 1) * * if tex == NULL: # <<<<<<<<<<<<<< * raise error() * */ } /* "pygame_sdl2/render.pyx":113 * raise error() * * t.set(self.renderer, tex) # <<<<<<<<<<<<<< * return TextureNode(t) * */ __pyx_t_1 = ((struct __pyx_vtabstruct_11pygame_sdl2_6render_Texture *)__pyx_v_t->__pyx_vtab)->set(__pyx_v_t, __pyx_v_self->renderer, __pyx_v_tex); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 113; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "pygame_sdl2/render.pyx":114 * * t.set(self.renderer, tex) * return TextureNode(t) # <<<<<<<<<<<<<< * * def load_atlas(self, filename): */ __Pyx_XDECREF(__pyx_r); __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 114; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __Pyx_INCREF(((PyObject *)__pyx_v_t)); __Pyx_GIVEREF(((PyObject *)__pyx_v_t)); PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)__pyx_v_t)); __pyx_t_5 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_11pygame_sdl2_6render_TextureNode), __pyx_t_1, NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 114; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_r = __pyx_t_5; __pyx_t_5 = 0; goto __pyx_L0; /* "pygame_sdl2/render.pyx":101 * warnings.warn("Renderer is not accelerated.") * * def load_texture(self, fi): # <<<<<<<<<<<<<< * cdef SDL_Texture *tex * cdef Texture t = Texture() */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_5); __Pyx_XDECREF(__pyx_t_6); __Pyx_AddTraceback("pygame_sdl2.render.Renderer.load_texture", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF((PyObject *)__pyx_v_t); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/render.pyx":116 * return TextureNode(t) * * def load_atlas(self, filename): # <<<<<<<<<<<<<< * """ Loads a file in the popular JSON (Hash) format exported by * TexturePacker and other software. """ */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_6render_8Renderer_9load_atlas(PyObject *__pyx_v_self, PyObject *__pyx_v_filename); /*proto*/ static char __pyx_doc_11pygame_sdl2_6render_8Renderer_8load_atlas[] = " Loads a file in the popular JSON (Hash) format exported by\n TexturePacker and other software. "; static PyObject *__pyx_pw_11pygame_sdl2_6render_8Renderer_9load_atlas(PyObject *__pyx_v_self, PyObject *__pyx_v_filename) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("load_atlas (wrapper)", 0); __pyx_r = __pyx_pf_11pygame_sdl2_6render_8Renderer_8load_atlas(((struct __pyx_obj_11pygame_sdl2_6render_Renderer *)__pyx_v_self), ((PyObject *)__pyx_v_filename)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_6render_8Renderer_8load_atlas(struct __pyx_obj_11pygame_sdl2_6render_Renderer *__pyx_v_self, PyObject *__pyx_v_filename) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("load_atlas", 0); /* "pygame_sdl2/render.pyx":120 * TexturePacker and other software. """ * * return TextureAtlas(self, filename) # <<<<<<<<<<<<<< * * def render_present(self): */ __Pyx_XDECREF(__pyx_r); __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 120; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __Pyx_INCREF(((PyObject *)__pyx_v_self)); __Pyx_GIVEREF(((PyObject *)__pyx_v_self)); PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)__pyx_v_self)); __Pyx_INCREF(__pyx_v_filename); __Pyx_GIVEREF(__pyx_v_filename); PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_v_filename); __pyx_t_2 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_11pygame_sdl2_6render_TextureAtlas), __pyx_t_1, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 120; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; /* "pygame_sdl2/render.pyx":116 * return TextureNode(t) * * def load_atlas(self, filename): # <<<<<<<<<<<<<< * """ Loads a file in the popular JSON (Hash) format exported by * TexturePacker and other software. """ */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_AddTraceback("pygame_sdl2.render.Renderer.load_atlas", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/render.pyx":122 * return TextureAtlas(self, filename) * * def render_present(self): # <<<<<<<<<<<<<< * with nogil: * SDL_RenderPresent(self.renderer) */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_6render_8Renderer_11render_present(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/ static PyObject *__pyx_pw_11pygame_sdl2_6render_8Renderer_11render_present(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("render_present (wrapper)", 0); __pyx_r = __pyx_pf_11pygame_sdl2_6render_8Renderer_10render_present(((struct __pyx_obj_11pygame_sdl2_6render_Renderer *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_6render_8Renderer_10render_present(struct __pyx_obj_11pygame_sdl2_6render_Renderer *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("render_present", 0); /* "pygame_sdl2/render.pyx":123 * * def render_present(self): * with nogil: # <<<<<<<<<<<<<< * SDL_RenderPresent(self.renderer) * */ { #ifdef WITH_THREAD PyThreadState *_save; Py_UNBLOCK_THREADS #endif /*try:*/ { /* "pygame_sdl2/render.pyx":124 * def render_present(self): * with nogil: * SDL_RenderPresent(self.renderer) # <<<<<<<<<<<<<< * * def info(self): */ SDL_RenderPresent(__pyx_v_self->renderer); } /* "pygame_sdl2/render.pyx":123 * * def render_present(self): * with nogil: # <<<<<<<<<<<<<< * SDL_RenderPresent(self.renderer) * */ /*finally:*/ { /*normal exit:*/{ #ifdef WITH_THREAD Py_BLOCK_THREADS #endif goto __pyx_L5; } __pyx_L5:; } } /* "pygame_sdl2/render.pyx":122 * return TextureAtlas(self, filename) * * def render_present(self): # <<<<<<<<<<<<<< * with nogil: * SDL_RenderPresent(self.renderer) */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/render.pyx":126 * SDL_RenderPresent(self.renderer) * * def info(self): # <<<<<<<<<<<<<< * return self._info * */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_6render_8Renderer_13info(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/ static PyObject *__pyx_pw_11pygame_sdl2_6render_8Renderer_13info(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("info (wrapper)", 0); __pyx_r = __pyx_pf_11pygame_sdl2_6render_8Renderer_12info(((struct __pyx_obj_11pygame_sdl2_6render_Renderer *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_6render_8Renderer_12info(struct __pyx_obj_11pygame_sdl2_6render_Renderer *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("info", 0); /* "pygame_sdl2/render.pyx":127 * * def info(self): * return self._info # <<<<<<<<<<<<<< * * cdef set_drawcolor(self, col): */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(__pyx_v_self->_info); __pyx_r = __pyx_v_self->_info; goto __pyx_L0; /* "pygame_sdl2/render.pyx":126 * SDL_RenderPresent(self.renderer) * * def info(self): # <<<<<<<<<<<<<< * return self._info * */ /* function exit code */ __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/render.pyx":129 * return self._info * * cdef set_drawcolor(self, col): # <<<<<<<<<<<<<< * if not isinstance(col, Color): * col = Color(col) */ static PyObject *__pyx_f_11pygame_sdl2_6render_8Renderer_set_drawcolor(struct __pyx_obj_11pygame_sdl2_6render_Renderer *__pyx_v_self, PyObject *__pyx_v_col) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_t_2; int __pyx_t_3; PyObject *__pyx_t_4 = NULL; PyObject *__pyx_t_5 = NULL; PyObject *__pyx_t_6 = NULL; Uint8 __pyx_t_7; Uint8 __pyx_t_8; Uint8 __pyx_t_9; Uint8 __pyx_t_10; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("set_drawcolor", 0); __Pyx_INCREF(__pyx_v_col); /* "pygame_sdl2/render.pyx":130 * * cdef set_drawcolor(self, col): * if not isinstance(col, Color): # <<<<<<<<<<<<<< * col = Color(col) * SDL_SetRenderDrawColor(self.renderer, col.r, col.g, col.b, col.a) */ __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_Color); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 130; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = PyObject_IsInstance(__pyx_v_col, __pyx_t_1); if (unlikely(__pyx_t_2 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 130; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_3 = ((!(__pyx_t_2 != 0)) != 0); if (__pyx_t_3) { /* "pygame_sdl2/render.pyx":131 * cdef set_drawcolor(self, col): * if not isinstance(col, Color): * col = Color(col) # <<<<<<<<<<<<<< * SDL_SetRenderDrawColor(self.renderer, col.r, col.g, col.b, col.a) * */ __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_Color); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 131; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); __pyx_t_5 = NULL; if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_4))) { __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4); if (likely(__pyx_t_5)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4); __Pyx_INCREF(__pyx_t_5); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_4, function); } } if (!__pyx_t_5) { __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_v_col); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 131; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); } else { __pyx_t_6 = PyTuple_New(1+1); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 131; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_6); __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_5); __pyx_t_5 = NULL; __Pyx_INCREF(__pyx_v_col); __Pyx_GIVEREF(__pyx_v_col); PyTuple_SET_ITEM(__pyx_t_6, 0+1, __pyx_v_col); __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_6, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 131; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; } __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF_SET(__pyx_v_col, __pyx_t_1); __pyx_t_1 = 0; /* "pygame_sdl2/render.pyx":130 * * cdef set_drawcolor(self, col): * if not isinstance(col, Color): # <<<<<<<<<<<<<< * col = Color(col) * SDL_SetRenderDrawColor(self.renderer, col.r, col.g, col.b, col.a) */ } /* "pygame_sdl2/render.pyx":132 * if not isinstance(col, Color): * col = Color(col) * SDL_SetRenderDrawColor(self.renderer, col.r, col.g, col.b, col.a) # <<<<<<<<<<<<<< * * def clear(self, color): */ __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_col, __pyx_n_s_r); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 132; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_t_7 = __Pyx_PyInt_As_uint8_t(__pyx_t_1); if (unlikely((__pyx_t_7 == (Uint8)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 132; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_col, __pyx_n_s_g); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 132; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_t_8 = __Pyx_PyInt_As_uint8_t(__pyx_t_1); if (unlikely((__pyx_t_8 == (Uint8)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 132; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_col, __pyx_n_s_b); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 132; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_t_9 = __Pyx_PyInt_As_uint8_t(__pyx_t_1); if (unlikely((__pyx_t_9 == (Uint8)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 132; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_col, __pyx_n_s_a); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 132; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_t_10 = __Pyx_PyInt_As_uint8_t(__pyx_t_1); if (unlikely((__pyx_t_10 == (Uint8)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 132; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; SDL_SetRenderDrawColor(__pyx_v_self->renderer, __pyx_t_7, __pyx_t_8, __pyx_t_9, __pyx_t_10); /* "pygame_sdl2/render.pyx":129 * return self._info * * cdef set_drawcolor(self, col): # <<<<<<<<<<<<<< * if not isinstance(col, Color): * col = Color(col) */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_5); __Pyx_XDECREF(__pyx_t_6); __Pyx_AddTraceback("pygame_sdl2.render.Renderer.set_drawcolor", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XDECREF(__pyx_v_col); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/render.pyx":134 * SDL_SetRenderDrawColor(self.renderer, col.r, col.g, col.b, col.a) * * def clear(self, color): # <<<<<<<<<<<<<< * self.set_drawcolor(color) * SDL_RenderClear(self.renderer) */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_6render_8Renderer_15clear(PyObject *__pyx_v_self, PyObject *__pyx_v_color); /*proto*/ static PyObject *__pyx_pw_11pygame_sdl2_6render_8Renderer_15clear(PyObject *__pyx_v_self, PyObject *__pyx_v_color) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("clear (wrapper)", 0); __pyx_r = __pyx_pf_11pygame_sdl2_6render_8Renderer_14clear(((struct __pyx_obj_11pygame_sdl2_6render_Renderer *)__pyx_v_self), ((PyObject *)__pyx_v_color)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_6render_8Renderer_14clear(struct __pyx_obj_11pygame_sdl2_6render_Renderer *__pyx_v_self, PyObject *__pyx_v_color) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("clear", 0); /* "pygame_sdl2/render.pyx":135 * * def clear(self, color): * self.set_drawcolor(color) # <<<<<<<<<<<<<< * SDL_RenderClear(self.renderer) * */ __pyx_t_1 = ((struct __pyx_vtabstruct_11pygame_sdl2_6render_Renderer *)__pyx_v_self->__pyx_vtab)->set_drawcolor(__pyx_v_self, __pyx_v_color); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 135; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "pygame_sdl2/render.pyx":136 * def clear(self, color): * self.set_drawcolor(color) * SDL_RenderClear(self.renderer) # <<<<<<<<<<<<<< * * def draw_line(self, color not None, x1, y1, x2, y2): */ SDL_RenderClear(__pyx_v_self->renderer); /* "pygame_sdl2/render.pyx":134 * SDL_SetRenderDrawColor(self.renderer, col.r, col.g, col.b, col.a) * * def clear(self, color): # <<<<<<<<<<<<<< * self.set_drawcolor(color) * SDL_RenderClear(self.renderer) */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("pygame_sdl2.render.Renderer.clear", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/render.pyx":138 * SDL_RenderClear(self.renderer) * * def draw_line(self, color not None, x1, y1, x2, y2): # <<<<<<<<<<<<<< * self.set_drawcolor(color) * if SDL_RenderDrawLine(self.renderer, x1, y1, x2, y2) != 0: */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_6render_8Renderer_17draw_line(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static PyObject *__pyx_pw_11pygame_sdl2_6render_8Renderer_17draw_line(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_color = 0; PyObject *__pyx_v_x1 = 0; PyObject *__pyx_v_y1 = 0; PyObject *__pyx_v_x2 = 0; PyObject *__pyx_v_y2 = 0; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("draw_line (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_color,&__pyx_n_s_x1,&__pyx_n_s_y1,&__pyx_n_s_x2,&__pyx_n_s_y2,0}; PyObject* values[5] = {0,0,0,0,0}; if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4); case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_color)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; case 1: if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_x1)) != 0)) kw_args--; else { __Pyx_RaiseArgtupleInvalid("draw_line", 1, 5, 5, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 138; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } case 2: if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_y1)) != 0)) kw_args--; else { __Pyx_RaiseArgtupleInvalid("draw_line", 1, 5, 5, 2); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 138; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } case 3: if (likely((values[3] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_x2)) != 0)) kw_args--; else { __Pyx_RaiseArgtupleInvalid("draw_line", 1, 5, 5, 3); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 138; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } case 4: if (likely((values[4] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_y2)) != 0)) kw_args--; else { __Pyx_RaiseArgtupleInvalid("draw_line", 1, 5, 5, 4); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 138; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "draw_line") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 138; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } } else if (PyTuple_GET_SIZE(__pyx_args) != 5) { goto __pyx_L5_argtuple_error; } else { values[0] = PyTuple_GET_ITEM(__pyx_args, 0); values[1] = PyTuple_GET_ITEM(__pyx_args, 1); values[2] = PyTuple_GET_ITEM(__pyx_args, 2); values[3] = PyTuple_GET_ITEM(__pyx_args, 3); values[4] = PyTuple_GET_ITEM(__pyx_args, 4); } __pyx_v_color = values[0]; __pyx_v_x1 = values[1]; __pyx_v_y1 = values[2]; __pyx_v_x2 = values[3]; __pyx_v_y2 = values[4]; } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("draw_line", 1, 5, 5, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 138; __pyx_clineno = __LINE__; goto __pyx_L3_error;} __pyx_L3_error:; __Pyx_AddTraceback("pygame_sdl2.render.Renderer.draw_line", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; if (unlikely(((PyObject *)__pyx_v_color) == Py_None)) { PyErr_Format(PyExc_TypeError, "Argument '%.200s' must not be None", "color"); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 138; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } __pyx_r = __pyx_pf_11pygame_sdl2_6render_8Renderer_16draw_line(((struct __pyx_obj_11pygame_sdl2_6render_Renderer *)__pyx_v_self), __pyx_v_color, __pyx_v_x1, __pyx_v_y1, __pyx_v_x2, __pyx_v_y2); /* function exit code */ goto __pyx_L0; __pyx_L1_error:; __pyx_r = NULL; __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_6render_8Renderer_16draw_line(struct __pyx_obj_11pygame_sdl2_6render_Renderer *__pyx_v_self, PyObject *__pyx_v_color, PyObject *__pyx_v_x1, PyObject *__pyx_v_y1, PyObject *__pyx_v_x2, PyObject *__pyx_v_y2) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_t_2; int __pyx_t_3; int __pyx_t_4; int __pyx_t_5; int __pyx_t_6; PyObject *__pyx_t_7 = NULL; PyObject *__pyx_t_8 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("draw_line", 0); /* "pygame_sdl2/render.pyx":139 * * def draw_line(self, color not None, x1, y1, x2, y2): * self.set_drawcolor(color) # <<<<<<<<<<<<<< * if SDL_RenderDrawLine(self.renderer, x1, y1, x2, y2) != 0: * raise error() */ __pyx_t_1 = ((struct __pyx_vtabstruct_11pygame_sdl2_6render_Renderer *)__pyx_v_self->__pyx_vtab)->set_drawcolor(__pyx_v_self, __pyx_v_color); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 139; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "pygame_sdl2/render.pyx":140 * def draw_line(self, color not None, x1, y1, x2, y2): * self.set_drawcolor(color) * if SDL_RenderDrawLine(self.renderer, x1, y1, x2, y2) != 0: # <<<<<<<<<<<<<< * raise error() * */ __pyx_t_2 = __Pyx_PyInt_As_int(__pyx_v_x1); if (unlikely((__pyx_t_2 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 140; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_t_3 = __Pyx_PyInt_As_int(__pyx_v_y1); if (unlikely((__pyx_t_3 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 140; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_t_4 = __Pyx_PyInt_As_int(__pyx_v_x2); if (unlikely((__pyx_t_4 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 140; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_t_5 = __Pyx_PyInt_As_int(__pyx_v_y2); if (unlikely((__pyx_t_5 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 140; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_t_6 = ((SDL_RenderDrawLine(__pyx_v_self->renderer, __pyx_t_2, __pyx_t_3, __pyx_t_4, __pyx_t_5) != 0) != 0); if (__pyx_t_6) { /* "pygame_sdl2/render.pyx":141 * self.set_drawcolor(color) * if SDL_RenderDrawLine(self.renderer, x1, y1, x2, y2) != 0: * raise error() # <<<<<<<<<<<<<< * * def draw_point(self, color not None, x, y): */ __pyx_t_7 = __Pyx_GetModuleGlobalName(__pyx_n_s_error); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 141; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_7); __pyx_t_8 = NULL; if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_7))) { __pyx_t_8 = PyMethod_GET_SELF(__pyx_t_7); if (likely(__pyx_t_8)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_7); __Pyx_INCREF(__pyx_t_8); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_7, function); } } if (__pyx_t_8) { __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_7, __pyx_t_8); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 141; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; } else { __pyx_t_1 = __Pyx_PyObject_CallNoArg(__pyx_t_7); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 141; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_Raise(__pyx_t_1, 0, 0, 0); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; {__pyx_filename = __pyx_f[0]; __pyx_lineno = 141; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "pygame_sdl2/render.pyx":140 * def draw_line(self, color not None, x1, y1, x2, y2): * self.set_drawcolor(color) * if SDL_RenderDrawLine(self.renderer, x1, y1, x2, y2) != 0: # <<<<<<<<<<<<<< * raise error() * */ } /* "pygame_sdl2/render.pyx":138 * SDL_RenderClear(self.renderer) * * def draw_line(self, color not None, x1, y1, x2, y2): # <<<<<<<<<<<<<< * self.set_drawcolor(color) * if SDL_RenderDrawLine(self.renderer, x1, y1, x2, y2) != 0: */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_7); __Pyx_XDECREF(__pyx_t_8); __Pyx_AddTraceback("pygame_sdl2.render.Renderer.draw_line", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/render.pyx":143 * raise error() * * def draw_point(self, color not None, x, y): # <<<<<<<<<<<<<< * self.set_drawcolor(color) * SDL_RenderDrawPoint(self.renderer, x, y) */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_6render_8Renderer_19draw_point(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static PyObject *__pyx_pw_11pygame_sdl2_6render_8Renderer_19draw_point(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_color = 0; PyObject *__pyx_v_x = 0; PyObject *__pyx_v_y = 0; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("draw_point (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_color,&__pyx_n_s_x,&__pyx_n_s_y,0}; PyObject* values[3] = {0,0,0}; if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_color)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; case 1: if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_x)) != 0)) kw_args--; else { __Pyx_RaiseArgtupleInvalid("draw_point", 1, 3, 3, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 143; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } case 2: if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_y)) != 0)) kw_args--; else { __Pyx_RaiseArgtupleInvalid("draw_point", 1, 3, 3, 2); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 143; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "draw_point") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 143; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } } else if (PyTuple_GET_SIZE(__pyx_args) != 3) { goto __pyx_L5_argtuple_error; } else { values[0] = PyTuple_GET_ITEM(__pyx_args, 0); values[1] = PyTuple_GET_ITEM(__pyx_args, 1); values[2] = PyTuple_GET_ITEM(__pyx_args, 2); } __pyx_v_color = values[0]; __pyx_v_x = values[1]; __pyx_v_y = values[2]; } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("draw_point", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 143; __pyx_clineno = __LINE__; goto __pyx_L3_error;} __pyx_L3_error:; __Pyx_AddTraceback("pygame_sdl2.render.Renderer.draw_point", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; if (unlikely(((PyObject *)__pyx_v_color) == Py_None)) { PyErr_Format(PyExc_TypeError, "Argument '%.200s' must not be None", "color"); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 143; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } __pyx_r = __pyx_pf_11pygame_sdl2_6render_8Renderer_18draw_point(((struct __pyx_obj_11pygame_sdl2_6render_Renderer *)__pyx_v_self), __pyx_v_color, __pyx_v_x, __pyx_v_y); /* function exit code */ goto __pyx_L0; __pyx_L1_error:; __pyx_r = NULL; __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_6render_8Renderer_18draw_point(struct __pyx_obj_11pygame_sdl2_6render_Renderer *__pyx_v_self, PyObject *__pyx_v_color, PyObject *__pyx_v_x, PyObject *__pyx_v_y) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_t_2; int __pyx_t_3; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("draw_point", 0); /* "pygame_sdl2/render.pyx":144 * * def draw_point(self, color not None, x, y): * self.set_drawcolor(color) # <<<<<<<<<<<<<< * SDL_RenderDrawPoint(self.renderer, x, y) * */ __pyx_t_1 = ((struct __pyx_vtabstruct_11pygame_sdl2_6render_Renderer *)__pyx_v_self->__pyx_vtab)->set_drawcolor(__pyx_v_self, __pyx_v_color); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 144; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "pygame_sdl2/render.pyx":145 * def draw_point(self, color not None, x, y): * self.set_drawcolor(color) * SDL_RenderDrawPoint(self.renderer, x, y) # <<<<<<<<<<<<<< * * def draw_rect(self, color not None, rect): */ __pyx_t_2 = __Pyx_PyInt_As_int(__pyx_v_x); if (unlikely((__pyx_t_2 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 145; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_t_3 = __Pyx_PyInt_As_int(__pyx_v_y); if (unlikely((__pyx_t_3 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 145; __pyx_clineno = __LINE__; goto __pyx_L1_error;} SDL_RenderDrawPoint(__pyx_v_self->renderer, __pyx_t_2, __pyx_t_3); /* "pygame_sdl2/render.pyx":143 * raise error() * * def draw_point(self, color not None, x, y): # <<<<<<<<<<<<<< * self.set_drawcolor(color) * SDL_RenderDrawPoint(self.renderer, x, y) */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("pygame_sdl2.render.Renderer.draw_point", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/render.pyx":147 * SDL_RenderDrawPoint(self.renderer, x, y) * * def draw_rect(self, color not None, rect): # <<<<<<<<<<<<<< * cdef SDL_Rect r * to_sdl_rect(rect, &r) */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_6render_8Renderer_21draw_rect(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static PyObject *__pyx_pw_11pygame_sdl2_6render_8Renderer_21draw_rect(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_color = 0; PyObject *__pyx_v_rect = 0; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("draw_rect (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_color,&__pyx_n_s_rect,0}; PyObject* values[2] = {0,0}; if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_color)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; case 1: if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_rect)) != 0)) kw_args--; else { __Pyx_RaiseArgtupleInvalid("draw_rect", 1, 2, 2, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 147; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "draw_rect") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 147; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } } else if (PyTuple_GET_SIZE(__pyx_args) != 2) { goto __pyx_L5_argtuple_error; } else { values[0] = PyTuple_GET_ITEM(__pyx_args, 0); values[1] = PyTuple_GET_ITEM(__pyx_args, 1); } __pyx_v_color = values[0]; __pyx_v_rect = values[1]; } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("draw_rect", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 147; __pyx_clineno = __LINE__; goto __pyx_L3_error;} __pyx_L3_error:; __Pyx_AddTraceback("pygame_sdl2.render.Renderer.draw_rect", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; if (unlikely(((PyObject *)__pyx_v_color) == Py_None)) { PyErr_Format(PyExc_TypeError, "Argument '%.200s' must not be None", "color"); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 147; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } __pyx_r = __pyx_pf_11pygame_sdl2_6render_8Renderer_20draw_rect(((struct __pyx_obj_11pygame_sdl2_6render_Renderer *)__pyx_v_self), __pyx_v_color, __pyx_v_rect); /* function exit code */ goto __pyx_L0; __pyx_L1_error:; __pyx_r = NULL; __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_6render_8Renderer_20draw_rect(struct __pyx_obj_11pygame_sdl2_6render_Renderer *__pyx_v_self, PyObject *__pyx_v_color, PyObject *__pyx_v_rect) { SDL_Rect __pyx_v_r; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; PyObject *__pyx_t_2 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("draw_rect", 0); /* "pygame_sdl2/render.pyx":149 * def draw_rect(self, color not None, rect): * cdef SDL_Rect r * to_sdl_rect(rect, &r) # <<<<<<<<<<<<<< * self.set_drawcolor(color) * SDL_RenderDrawRect(self.renderer, &r) */ __pyx_t_1 = __pyx_f_11pygame_sdl2_4rect_to_sdl_rect(__pyx_v_rect, (&__pyx_v_r), NULL); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 149; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "pygame_sdl2/render.pyx":150 * cdef SDL_Rect r * to_sdl_rect(rect, &r) * self.set_drawcolor(color) # <<<<<<<<<<<<<< * SDL_RenderDrawRect(self.renderer, &r) * */ __pyx_t_2 = ((struct __pyx_vtabstruct_11pygame_sdl2_6render_Renderer *)__pyx_v_self->__pyx_vtab)->set_drawcolor(__pyx_v_self, __pyx_v_color); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 150; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "pygame_sdl2/render.pyx":151 * to_sdl_rect(rect, &r) * self.set_drawcolor(color) * SDL_RenderDrawRect(self.renderer, &r) # <<<<<<<<<<<<<< * * def fill_rect(self, color not None, rect): */ SDL_RenderDrawRect(__pyx_v_self->renderer, (&__pyx_v_r)); /* "pygame_sdl2/render.pyx":147 * SDL_RenderDrawPoint(self.renderer, x, y) * * def draw_rect(self, color not None, rect): # <<<<<<<<<<<<<< * cdef SDL_Rect r * to_sdl_rect(rect, &r) */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_AddTraceback("pygame_sdl2.render.Renderer.draw_rect", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/render.pyx":153 * SDL_RenderDrawRect(self.renderer, &r) * * def fill_rect(self, color not None, rect): # <<<<<<<<<<<<<< * cdef SDL_Rect r * to_sdl_rect(rect, &r) */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_6render_8Renderer_23fill_rect(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static PyObject *__pyx_pw_11pygame_sdl2_6render_8Renderer_23fill_rect(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_color = 0; PyObject *__pyx_v_rect = 0; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("fill_rect (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_color,&__pyx_n_s_rect,0}; PyObject* values[2] = {0,0}; if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_color)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; case 1: if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_rect)) != 0)) kw_args--; else { __Pyx_RaiseArgtupleInvalid("fill_rect", 1, 2, 2, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 153; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "fill_rect") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 153; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } } else if (PyTuple_GET_SIZE(__pyx_args) != 2) { goto __pyx_L5_argtuple_error; } else { values[0] = PyTuple_GET_ITEM(__pyx_args, 0); values[1] = PyTuple_GET_ITEM(__pyx_args, 1); } __pyx_v_color = values[0]; __pyx_v_rect = values[1]; } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("fill_rect", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 153; __pyx_clineno = __LINE__; goto __pyx_L3_error;} __pyx_L3_error:; __Pyx_AddTraceback("pygame_sdl2.render.Renderer.fill_rect", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; if (unlikely(((PyObject *)__pyx_v_color) == Py_None)) { PyErr_Format(PyExc_TypeError, "Argument '%.200s' must not be None", "color"); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 153; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } __pyx_r = __pyx_pf_11pygame_sdl2_6render_8Renderer_22fill_rect(((struct __pyx_obj_11pygame_sdl2_6render_Renderer *)__pyx_v_self), __pyx_v_color, __pyx_v_rect); /* function exit code */ goto __pyx_L0; __pyx_L1_error:; __pyx_r = NULL; __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_6render_8Renderer_22fill_rect(struct __pyx_obj_11pygame_sdl2_6render_Renderer *__pyx_v_self, PyObject *__pyx_v_color, PyObject *__pyx_v_rect) { SDL_Rect __pyx_v_r; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; PyObject *__pyx_t_2 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("fill_rect", 0); /* "pygame_sdl2/render.pyx":155 * def fill_rect(self, color not None, rect): * cdef SDL_Rect r * to_sdl_rect(rect, &r) # <<<<<<<<<<<<<< * self.set_drawcolor(color) * SDL_RenderFillRect(self.renderer, &r) */ __pyx_t_1 = __pyx_f_11pygame_sdl2_4rect_to_sdl_rect(__pyx_v_rect, (&__pyx_v_r), NULL); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 155; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "pygame_sdl2/render.pyx":156 * cdef SDL_Rect r * to_sdl_rect(rect, &r) * self.set_drawcolor(color) # <<<<<<<<<<<<<< * SDL_RenderFillRect(self.renderer, &r) * */ __pyx_t_2 = ((struct __pyx_vtabstruct_11pygame_sdl2_6render_Renderer *)__pyx_v_self->__pyx_vtab)->set_drawcolor(__pyx_v_self, __pyx_v_color); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 156; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "pygame_sdl2/render.pyx":157 * to_sdl_rect(rect, &r) * self.set_drawcolor(color) * SDL_RenderFillRect(self.renderer, &r) # <<<<<<<<<<<<<< * * def set_viewport(self, rect=None): */ SDL_RenderFillRect(__pyx_v_self->renderer, (&__pyx_v_r)); /* "pygame_sdl2/render.pyx":153 * SDL_RenderDrawRect(self.renderer, &r) * * def fill_rect(self, color not None, rect): # <<<<<<<<<<<<<< * cdef SDL_Rect r * to_sdl_rect(rect, &r) */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_AddTraceback("pygame_sdl2.render.Renderer.fill_rect", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/render.pyx":159 * SDL_RenderFillRect(self.renderer, &r) * * def set_viewport(self, rect=None): # <<<<<<<<<<<<<< * cdef SDL_Rect vprect * if rect is None: */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_6render_8Renderer_25set_viewport(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static PyObject *__pyx_pw_11pygame_sdl2_6render_8Renderer_25set_viewport(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_rect = 0; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("set_viewport (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_rect,0}; PyObject* values[1] = {0}; values[0] = ((PyObject *)Py_None); if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (kw_args > 0) { PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_rect); if (value) { values[0] = value; kw_args--; } } } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "set_viewport") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 159; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } } else { switch (PyTuple_GET_SIZE(__pyx_args)) { case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); case 0: break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_rect = values[0]; } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("set_viewport", 0, 0, 1, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 159; __pyx_clineno = __LINE__; goto __pyx_L3_error;} __pyx_L3_error:; __Pyx_AddTraceback("pygame_sdl2.render.Renderer.set_viewport", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_11pygame_sdl2_6render_8Renderer_24set_viewport(((struct __pyx_obj_11pygame_sdl2_6render_Renderer *)__pyx_v_self), __pyx_v_rect); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_6render_8Renderer_24set_viewport(struct __pyx_obj_11pygame_sdl2_6render_Renderer *__pyx_v_self, PyObject *__pyx_v_rect) { SDL_Rect __pyx_v_vprect; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; int __pyx_t_2; int __pyx_t_3; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("set_viewport", 0); /* "pygame_sdl2/render.pyx":161 * def set_viewport(self, rect=None): * cdef SDL_Rect vprect * if rect is None: # <<<<<<<<<<<<<< * SDL_RenderSetViewport(self.renderer, NULL) * else: */ __pyx_t_1 = (__pyx_v_rect == Py_None); __pyx_t_2 = (__pyx_t_1 != 0); if (__pyx_t_2) { /* "pygame_sdl2/render.pyx":162 * cdef SDL_Rect vprect * if rect is None: * SDL_RenderSetViewport(self.renderer, NULL) # <<<<<<<<<<<<<< * else: * to_sdl_rect(rect, &vprect) */ SDL_RenderSetViewport(__pyx_v_self->renderer, NULL); /* "pygame_sdl2/render.pyx":161 * def set_viewport(self, rect=None): * cdef SDL_Rect vprect * if rect is None: # <<<<<<<<<<<<<< * SDL_RenderSetViewport(self.renderer, NULL) * else: */ goto __pyx_L3; } /* "pygame_sdl2/render.pyx":164 * SDL_RenderSetViewport(self.renderer, NULL) * else: * to_sdl_rect(rect, &vprect) # <<<<<<<<<<<<<< * SDL_RenderSetViewport(self.renderer, &vprect) * */ /*else*/ { __pyx_t_3 = __pyx_f_11pygame_sdl2_4rect_to_sdl_rect(__pyx_v_rect, (&__pyx_v_vprect), NULL); if (unlikely(__pyx_t_3 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 164; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "pygame_sdl2/render.pyx":165 * else: * to_sdl_rect(rect, &vprect) * SDL_RenderSetViewport(self.renderer, &vprect) # <<<<<<<<<<<<<< * * def create_texture(self, size): */ SDL_RenderSetViewport(__pyx_v_self->renderer, (&__pyx_v_vprect)); } __pyx_L3:; /* "pygame_sdl2/render.pyx":159 * SDL_RenderFillRect(self.renderer, &r) * * def set_viewport(self, rect=None): # <<<<<<<<<<<<<< * cdef SDL_Rect vprect * if rect is None: */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("pygame_sdl2.render.Renderer.set_viewport", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/render.pyx":167 * SDL_RenderSetViewport(self.renderer, &vprect) * * def create_texture(self, size): # <<<<<<<<<<<<<< * if SDL_RenderTargetSupported(self.renderer) != SDL_TRUE: * raise error() */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_6render_8Renderer_27create_texture(PyObject *__pyx_v_self, PyObject *__pyx_v_size); /*proto*/ static PyObject *__pyx_pw_11pygame_sdl2_6render_8Renderer_27create_texture(PyObject *__pyx_v_self, PyObject *__pyx_v_size) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("create_texture (wrapper)", 0); __pyx_r = __pyx_pf_11pygame_sdl2_6render_8Renderer_26create_texture(((struct __pyx_obj_11pygame_sdl2_6render_Renderer *)__pyx_v_self), ((PyObject *)__pyx_v_size)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_6render_8Renderer_26create_texture(struct __pyx_obj_11pygame_sdl2_6render_Renderer *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v_size) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("create_texture", 0); /* "pygame_sdl2/render.pyx":168 * * def create_texture(self, size): * if SDL_RenderTargetSupported(self.renderer) != SDL_TRUE: # <<<<<<<<<<<<<< * raise error() * */ __pyx_t_1 = ((SDL_RenderTargetSupported(__pyx_v_self->renderer) != SDL_TRUE) != 0); if (__pyx_t_1) { /* "pygame_sdl2/render.pyx":169 * def create_texture(self, size): * if SDL_RenderTargetSupported(self.renderer) != SDL_TRUE: * raise error() # <<<<<<<<<<<<<< * * */ __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_error); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 169; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = NULL; if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_3))) { __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3); if (likely(__pyx_t_4)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); __Pyx_INCREF(__pyx_t_4); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_3, function); } } if (__pyx_t_4) { __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 169; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; } else { __pyx_t_2 = __Pyx_PyObject_CallNoArg(__pyx_t_3); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 169; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_Raise(__pyx_t_2, 0, 0, 0); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; {__pyx_filename = __pyx_f[0]; __pyx_lineno = 169; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "pygame_sdl2/render.pyx":168 * * def create_texture(self, size): * if SDL_RenderTargetSupported(self.renderer) != SDL_TRUE: # <<<<<<<<<<<<<< * raise error() * */ } /* "pygame_sdl2/render.pyx":167 * SDL_RenderSetViewport(self.renderer, &vprect) * * def create_texture(self, size): # <<<<<<<<<<<<<< * if SDL_RenderTargetSupported(self.renderer) != SDL_TRUE: * raise error() */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_AddTraceback("pygame_sdl2.render.Renderer.create_texture", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/render.pyx":179 * cdef public int w, h * * def __cinit__(self): # <<<<<<<<<<<<<< * self.texture = NULL * */ /* Python wrapper */ static int __pyx_pw_11pygame_sdl2_6render_7Texture_1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static int __pyx_pw_11pygame_sdl2_6render_7Texture_1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__cinit__ (wrapper)", 0); if (unlikely(PyTuple_GET_SIZE(__pyx_args) > 0)) { __Pyx_RaiseArgtupleInvalid("__cinit__", 1, 0, 0, PyTuple_GET_SIZE(__pyx_args)); return -1;} if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "__cinit__", 0))) return -1; __pyx_r = __pyx_pf_11pygame_sdl2_6render_7Texture___cinit__(((struct __pyx_obj_11pygame_sdl2_6render_Texture *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static int __pyx_pf_11pygame_sdl2_6render_7Texture___cinit__(struct __pyx_obj_11pygame_sdl2_6render_Texture *__pyx_v_self) { int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__cinit__", 0); /* "pygame_sdl2/render.pyx":180 * * def __cinit__(self): * self.texture = NULL # <<<<<<<<<<<<<< * * def __dealloc__(self): */ __pyx_v_self->texture = NULL; /* "pygame_sdl2/render.pyx":179 * cdef public int w, h * * def __cinit__(self): # <<<<<<<<<<<<<< * self.texture = NULL * */ /* function exit code */ __pyx_r = 0; __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/render.pyx":182 * self.texture = NULL * * def __dealloc__(self): # <<<<<<<<<<<<<< * if self.texture: * SDL_DestroyTexture(self.texture) */ /* Python wrapper */ static void __pyx_pw_11pygame_sdl2_6render_7Texture_3__dealloc__(PyObject *__pyx_v_self); /*proto*/ static void __pyx_pw_11pygame_sdl2_6render_7Texture_3__dealloc__(PyObject *__pyx_v_self) { __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__dealloc__ (wrapper)", 0); __pyx_pf_11pygame_sdl2_6render_7Texture_2__dealloc__(((struct __pyx_obj_11pygame_sdl2_6render_Texture *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); } static void __pyx_pf_11pygame_sdl2_6render_7Texture_2__dealloc__(struct __pyx_obj_11pygame_sdl2_6render_Texture *__pyx_v_self) { __Pyx_RefNannyDeclarations int __pyx_t_1; __Pyx_RefNannySetupContext("__dealloc__", 0); /* "pygame_sdl2/render.pyx":183 * * def __dealloc__(self): * if self.texture: # <<<<<<<<<<<<<< * SDL_DestroyTexture(self.texture) * */ __pyx_t_1 = (__pyx_v_self->texture != 0); if (__pyx_t_1) { /* "pygame_sdl2/render.pyx":184 * def __dealloc__(self): * if self.texture: * SDL_DestroyTexture(self.texture) # <<<<<<<<<<<<<< * * cdef set(self, SDL_Renderer *ren, SDL_Texture *tex): */ SDL_DestroyTexture(__pyx_v_self->texture); /* "pygame_sdl2/render.pyx":183 * * def __dealloc__(self): * if self.texture: # <<<<<<<<<<<<<< * SDL_DestroyTexture(self.texture) * */ } /* "pygame_sdl2/render.pyx":182 * self.texture = NULL * * def __dealloc__(self): # <<<<<<<<<<<<<< * if self.texture: * SDL_DestroyTexture(self.texture) */ /* function exit code */ __Pyx_RefNannyFinishContext(); } /* "pygame_sdl2/render.pyx":186 * SDL_DestroyTexture(self.texture) * * cdef set(self, SDL_Renderer *ren, SDL_Texture *tex): # <<<<<<<<<<<<<< * cdef Uint32 format * cdef int access, w, h */ static PyObject *__pyx_f_11pygame_sdl2_6render_7Texture_set(struct __pyx_obj_11pygame_sdl2_6render_Texture *__pyx_v_self, SDL_Renderer *__pyx_v_ren, SDL_Texture *__pyx_v_tex) { Uint32 __pyx_v_format; int __pyx_v_access; int __pyx_v_w; int __pyx_v_h; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("set", 0); /* "pygame_sdl2/render.pyx":190 * cdef int access, w, h * * self.renderer = ren # <<<<<<<<<<<<<< * self.texture = tex * */ __pyx_v_self->renderer = __pyx_v_ren; /* "pygame_sdl2/render.pyx":191 * * self.renderer = ren * self.texture = tex # <<<<<<<<<<<<<< * * if SDL_QueryTexture(self.texture, &format, &access, &w, &h) != 0: */ __pyx_v_self->texture = __pyx_v_tex; /* "pygame_sdl2/render.pyx":193 * self.texture = tex * * if SDL_QueryTexture(self.texture, &format, &access, &w, &h) != 0: # <<<<<<<<<<<<<< * raise error() * */ __pyx_t_1 = ((SDL_QueryTexture(__pyx_v_self->texture, (&__pyx_v_format), (&__pyx_v_access), (&__pyx_v_w), (&__pyx_v_h)) != 0) != 0); if (__pyx_t_1) { /* "pygame_sdl2/render.pyx":194 * * if SDL_QueryTexture(self.texture, &format, &access, &w, &h) != 0: * raise error() # <<<<<<<<<<<<<< * * self.w = w */ __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_error); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 194; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = NULL; if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_3))) { __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3); if (likely(__pyx_t_4)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); __Pyx_INCREF(__pyx_t_4); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_3, function); } } if (__pyx_t_4) { __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 194; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; } else { __pyx_t_2 = __Pyx_PyObject_CallNoArg(__pyx_t_3); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 194; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_Raise(__pyx_t_2, 0, 0, 0); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; {__pyx_filename = __pyx_f[0]; __pyx_lineno = 194; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "pygame_sdl2/render.pyx":193 * self.texture = tex * * if SDL_QueryTexture(self.texture, &format, &access, &w, &h) != 0: # <<<<<<<<<<<<<< * raise error() * */ } /* "pygame_sdl2/render.pyx":196 * raise error() * * self.w = w # <<<<<<<<<<<<<< * self.h = h * */ __pyx_v_self->w = __pyx_v_w; /* "pygame_sdl2/render.pyx":197 * * self.w = w * self.h = h # <<<<<<<<<<<<<< * * */ __pyx_v_self->h = __pyx_v_h; /* "pygame_sdl2/render.pyx":186 * SDL_DestroyTexture(self.texture) * * cdef set(self, SDL_Renderer *ren, SDL_Texture *tex): # <<<<<<<<<<<<<< * cdef Uint32 format * cdef int access, w, h */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_AddTraceback("pygame_sdl2.render.Texture.set", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/render.pyx":177 * cdef SDL_Renderer *renderer * cdef SDL_Texture *texture * cdef public int w, h # <<<<<<<<<<<<<< * * def __cinit__(self): */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_6render_7Texture_1w_1__get__(PyObject *__pyx_v_self); /*proto*/ static PyObject *__pyx_pw_11pygame_sdl2_6render_7Texture_1w_1__get__(PyObject *__pyx_v_self) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); __pyx_r = __pyx_pf_11pygame_sdl2_6render_7Texture_1w___get__(((struct __pyx_obj_11pygame_sdl2_6render_Texture *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_6render_7Texture_1w___get__(struct __pyx_obj_11pygame_sdl2_6render_Texture *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__get__", 0); __Pyx_XDECREF(__pyx_r); __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_self->w); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 177; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("pygame_sdl2.render.Texture.w.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* Python wrapper */ static int __pyx_pw_11pygame_sdl2_6render_7Texture_1w_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/ static int __pyx_pw_11pygame_sdl2_6render_7Texture_1w_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) { int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__set__ (wrapper)", 0); __pyx_r = __pyx_pf_11pygame_sdl2_6render_7Texture_1w_2__set__(((struct __pyx_obj_11pygame_sdl2_6render_Texture *)__pyx_v_self), ((PyObject *)__pyx_v_value)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static int __pyx_pf_11pygame_sdl2_6render_7Texture_1w_2__set__(struct __pyx_obj_11pygame_sdl2_6render_Texture *__pyx_v_self, PyObject *__pyx_v_value) { int __pyx_r; __Pyx_RefNannyDeclarations int __pyx_t_1; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__set__", 0); __pyx_t_1 = __Pyx_PyInt_As_int(__pyx_v_value); if (unlikely((__pyx_t_1 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 177; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_v_self->w = __pyx_t_1; /* function exit code */ __pyx_r = 0; goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("pygame_sdl2.render.Texture.w.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = -1; __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; } /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_6render_7Texture_1h_1__get__(PyObject *__pyx_v_self); /*proto*/ static PyObject *__pyx_pw_11pygame_sdl2_6render_7Texture_1h_1__get__(PyObject *__pyx_v_self) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); __pyx_r = __pyx_pf_11pygame_sdl2_6render_7Texture_1h___get__(((struct __pyx_obj_11pygame_sdl2_6render_Texture *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_6render_7Texture_1h___get__(struct __pyx_obj_11pygame_sdl2_6render_Texture *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__get__", 0); __Pyx_XDECREF(__pyx_r); __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_self->h); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 177; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("pygame_sdl2.render.Texture.h.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* Python wrapper */ static int __pyx_pw_11pygame_sdl2_6render_7Texture_1h_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/ static int __pyx_pw_11pygame_sdl2_6render_7Texture_1h_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) { int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__set__ (wrapper)", 0); __pyx_r = __pyx_pf_11pygame_sdl2_6render_7Texture_1h_2__set__(((struct __pyx_obj_11pygame_sdl2_6render_Texture *)__pyx_v_self), ((PyObject *)__pyx_v_value)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static int __pyx_pf_11pygame_sdl2_6render_7Texture_1h_2__set__(struct __pyx_obj_11pygame_sdl2_6render_Texture *__pyx_v_self, PyObject *__pyx_v_value) { int __pyx_r; __Pyx_RefNannyDeclarations int __pyx_t_1; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__set__", 0); __pyx_t_1 = __Pyx_PyInt_As_int(__pyx_v_value); if (unlikely((__pyx_t_1 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 177; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_v_self->h = __pyx_t_1; /* function exit code */ __pyx_r = 0; goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("pygame_sdl2.render.Texture.h.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = -1; __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/render.pyx":215 * cdef int source_h * * def __init__(self, tex): # <<<<<<<<<<<<<< * if isinstance(tex, Texture): * self.texture = tex */ /* Python wrapper */ static int __pyx_pw_11pygame_sdl2_6render_11TextureNode_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static int __pyx_pw_11pygame_sdl2_6render_11TextureNode_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_tex = 0; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__init__ (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_tex,0}; PyObject* values[1] = {0}; if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_tex)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__init__") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 215; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } } else if (PyTuple_GET_SIZE(__pyx_args) != 1) { goto __pyx_L5_argtuple_error; } else { values[0] = PyTuple_GET_ITEM(__pyx_args, 0); } __pyx_v_tex = values[0]; } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("__init__", 1, 1, 1, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 215; __pyx_clineno = __LINE__; goto __pyx_L3_error;} __pyx_L3_error:; __Pyx_AddTraceback("pygame_sdl2.render.TextureNode.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return -1; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_11pygame_sdl2_6render_11TextureNode___init__(((struct __pyx_obj_11pygame_sdl2_6render_TextureNode *)__pyx_v_self), __pyx_v_tex); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static int __pyx_pf_11pygame_sdl2_6render_11TextureNode___init__(struct __pyx_obj_11pygame_sdl2_6render_TextureNode *__pyx_v_self, PyObject *__pyx_v_tex) { int __pyx_r; __Pyx_RefNannyDeclarations int __pyx_t_1; int __pyx_t_2; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; PyObject *__pyx_t_5 = NULL; int __pyx_t_6; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__init__", 0); /* "pygame_sdl2/render.pyx":216 * * def __init__(self, tex): * if isinstance(tex, Texture): # <<<<<<<<<<<<<< * self.texture = tex * to_sdl_rect((0,0,tex.w,tex.h), &self.source_rect) */ __pyx_t_1 = __Pyx_TypeCheck(__pyx_v_tex, __pyx_ptype_11pygame_sdl2_6render_Texture); __pyx_t_2 = (__pyx_t_1 != 0); if (__pyx_t_2) { /* "pygame_sdl2/render.pyx":217 * def __init__(self, tex): * if isinstance(tex, Texture): * self.texture = tex # <<<<<<<<<<<<<< * to_sdl_rect((0,0,tex.w,tex.h), &self.source_rect) * to_sdl_rect((0,0,tex.w,tex.h), &self.trimmed_rect) */ if (!(likely(((__pyx_v_tex) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_tex, __pyx_ptype_11pygame_sdl2_6render_Texture))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 217; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_t_3 = __pyx_v_tex; __Pyx_INCREF(__pyx_t_3); __Pyx_GIVEREF(__pyx_t_3); __Pyx_GOTREF(__pyx_v_self->texture); __Pyx_DECREF(((PyObject *)__pyx_v_self->texture)); __pyx_v_self->texture = ((struct __pyx_obj_11pygame_sdl2_6render_Texture *)__pyx_t_3); __pyx_t_3 = 0; /* "pygame_sdl2/render.pyx":218 * if isinstance(tex, Texture): * self.texture = tex * to_sdl_rect((0,0,tex.w,tex.h), &self.source_rect) # <<<<<<<<<<<<<< * to_sdl_rect((0,0,tex.w,tex.h), &self.trimmed_rect) * self.source_w = tex.w */ __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_tex, __pyx_n_s_w); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 218; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_tex, __pyx_n_s_h); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 218; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); __pyx_t_5 = PyTuple_New(4); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 218; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); __Pyx_INCREF(__pyx_int_0); __Pyx_GIVEREF(__pyx_int_0); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_int_0); __Pyx_INCREF(__pyx_int_0); __Pyx_GIVEREF(__pyx_int_0); PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_int_0); __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_5, 2, __pyx_t_3); __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_5, 3, __pyx_t_4); __pyx_t_3 = 0; __pyx_t_4 = 0; __pyx_t_6 = __pyx_f_11pygame_sdl2_4rect_to_sdl_rect(__pyx_t_5, (&__pyx_v_self->source_rect), NULL); if (unlikely(__pyx_t_6 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 218; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; /* "pygame_sdl2/render.pyx":219 * self.texture = tex * to_sdl_rect((0,0,tex.w,tex.h), &self.source_rect) * to_sdl_rect((0,0,tex.w,tex.h), &self.trimmed_rect) # <<<<<<<<<<<<<< * self.source_w = tex.w * self.source_h = tex.h */ __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_tex, __pyx_n_s_w); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 219; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_tex, __pyx_n_s_h); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 219; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); __pyx_t_3 = PyTuple_New(4); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 219; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __Pyx_INCREF(__pyx_int_0); __Pyx_GIVEREF(__pyx_int_0); PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_int_0); __Pyx_INCREF(__pyx_int_0); __Pyx_GIVEREF(__pyx_int_0); PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_int_0); __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_3, 2, __pyx_t_5); __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_3, 3, __pyx_t_4); __pyx_t_5 = 0; __pyx_t_4 = 0; __pyx_t_6 = __pyx_f_11pygame_sdl2_4rect_to_sdl_rect(__pyx_t_3, (&__pyx_v_self->trimmed_rect), NULL); if (unlikely(__pyx_t_6 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 219; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "pygame_sdl2/render.pyx":220 * to_sdl_rect((0,0,tex.w,tex.h), &self.source_rect) * to_sdl_rect((0,0,tex.w,tex.h), &self.trimmed_rect) * self.source_w = tex.w # <<<<<<<<<<<<<< * self.source_h = tex.h * */ __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_tex, __pyx_n_s_w); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 220; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __pyx_t_6 = __Pyx_PyInt_As_int(__pyx_t_3); if (unlikely((__pyx_t_6 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 220; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_v_self->source_w = __pyx_t_6; /* "pygame_sdl2/render.pyx":221 * to_sdl_rect((0,0,tex.w,tex.h), &self.trimmed_rect) * self.source_w = tex.w * self.source_h = tex.h # <<<<<<<<<<<<<< * * elif isinstance(tex, TextureNode): */ __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_tex, __pyx_n_s_h); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 221; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __pyx_t_6 = __Pyx_PyInt_As_int(__pyx_t_3); if (unlikely((__pyx_t_6 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 221; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_v_self->source_h = __pyx_t_6; /* "pygame_sdl2/render.pyx":216 * * def __init__(self, tex): * if isinstance(tex, Texture): # <<<<<<<<<<<<<< * self.texture = tex * to_sdl_rect((0,0,tex.w,tex.h), &self.source_rect) */ goto __pyx_L3; } /* "pygame_sdl2/render.pyx":223 * self.source_h = tex.h * * elif isinstance(tex, TextureNode): # <<<<<<<<<<<<<< * self.texture = (tex).texture * */ __pyx_t_2 = __Pyx_TypeCheck(__pyx_v_tex, __pyx_ptype_11pygame_sdl2_6render_TextureNode); __pyx_t_1 = (__pyx_t_2 != 0); if (__pyx_t_1) { /* "pygame_sdl2/render.pyx":224 * * elif isinstance(tex, TextureNode): * self.texture = (tex).texture # <<<<<<<<<<<<<< * * else: */ __pyx_t_3 = ((PyObject *)((struct __pyx_obj_11pygame_sdl2_6render_TextureNode *)__pyx_v_tex)->texture); __Pyx_INCREF(__pyx_t_3); __Pyx_GIVEREF(__pyx_t_3); __Pyx_GOTREF(__pyx_v_self->texture); __Pyx_DECREF(((PyObject *)__pyx_v_self->texture)); __pyx_v_self->texture = ((struct __pyx_obj_11pygame_sdl2_6render_Texture *)__pyx_t_3); __pyx_t_3 = 0; /* "pygame_sdl2/render.pyx":223 * self.source_h = tex.h * * elif isinstance(tex, TextureNode): # <<<<<<<<<<<<<< * self.texture = (tex).texture * */ goto __pyx_L3; } /* "pygame_sdl2/render.pyx":227 * * else: * raise ValueError() # <<<<<<<<<<<<<< * * def render(self, dest=None): */ /*else*/ { __pyx_t_3 = __Pyx_PyObject_CallNoArg(__pyx_builtin_ValueError); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 227; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __Pyx_Raise(__pyx_t_3, 0, 0, 0); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; {__pyx_filename = __pyx_f[0]; __pyx_lineno = 227; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } __pyx_L3:; /* "pygame_sdl2/render.pyx":215 * cdef int source_h * * def __init__(self, tex): # <<<<<<<<<<<<<< * if isinstance(tex, Texture): * self.texture = tex */ /* function exit code */ __pyx_r = 0; goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_5); __Pyx_AddTraceback("pygame_sdl2.render.TextureNode.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = -1; __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/render.pyx":229 * raise ValueError() * * def render(self, dest=None): # <<<<<<<<<<<<<< * cdef SDL_Rect dest_rect * */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_6render_11TextureNode_3render(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static PyObject *__pyx_pw_11pygame_sdl2_6render_11TextureNode_3render(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_dest = 0; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("render (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_dest,0}; PyObject* values[1] = {0}; values[0] = ((PyObject *)Py_None); if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (kw_args > 0) { PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_dest); if (value) { values[0] = value; kw_args--; } } } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "render") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 229; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } } else { switch (PyTuple_GET_SIZE(__pyx_args)) { case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); case 0: break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_dest = values[0]; } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("render", 0, 0, 1, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 229; __pyx_clineno = __LINE__; goto __pyx_L3_error;} __pyx_L3_error:; __Pyx_AddTraceback("pygame_sdl2.render.TextureNode.render", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_11pygame_sdl2_6render_11TextureNode_2render(((struct __pyx_obj_11pygame_sdl2_6render_TextureNode *)__pyx_v_self), __pyx_v_dest); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_6render_11TextureNode_2render(struct __pyx_obj_11pygame_sdl2_6render_TextureNode *__pyx_v_self, PyObject *__pyx_v_dest) { SDL_Rect __pyx_v_dest_rect; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; int __pyx_t_2; int __pyx_t_3; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("render", 0); /* "pygame_sdl2/render.pyx":232 * cdef SDL_Rect dest_rect * * if dest is None: # <<<<<<<<<<<<<< * with nogil: * SDL_RenderCopy(self.texture.renderer, self.texture.texture, NULL, NULL) */ __pyx_t_1 = (__pyx_v_dest == Py_None); __pyx_t_2 = (__pyx_t_1 != 0); if (__pyx_t_2) { /* "pygame_sdl2/render.pyx":233 * * if dest is None: * with nogil: # <<<<<<<<<<<<<< * SDL_RenderCopy(self.texture.renderer, self.texture.texture, NULL, NULL) * */ { #ifdef WITH_THREAD PyThreadState *_save; Py_UNBLOCK_THREADS #endif /*try:*/ { /* "pygame_sdl2/render.pyx":234 * if dest is None: * with nogil: * SDL_RenderCopy(self.texture.renderer, self.texture.texture, NULL, NULL) # <<<<<<<<<<<<<< * * else: */ SDL_RenderCopy(__pyx_v_self->texture->renderer, __pyx_v_self->texture->texture, NULL, NULL); } /* "pygame_sdl2/render.pyx":233 * * if dest is None: * with nogil: # <<<<<<<<<<<<<< * SDL_RenderCopy(self.texture.renderer, self.texture.texture, NULL, NULL) * */ /*finally:*/ { /*normal exit:*/{ #ifdef WITH_THREAD Py_BLOCK_THREADS #endif goto __pyx_L6; } __pyx_L6:; } } /* "pygame_sdl2/render.pyx":232 * cdef SDL_Rect dest_rect * * if dest is None: # <<<<<<<<<<<<<< * with nogil: * SDL_RenderCopy(self.texture.renderer, self.texture.texture, NULL, NULL) */ goto __pyx_L3; } /* "pygame_sdl2/render.pyx":237 * * else: * to_sdl_rect(dest, &dest_rect) # <<<<<<<<<<<<<< * with nogil: * if dest_rect.w == 0 or dest_rect.h == 0: */ /*else*/ { __pyx_t_3 = __pyx_f_11pygame_sdl2_4rect_to_sdl_rect(__pyx_v_dest, (&__pyx_v_dest_rect), NULL); if (unlikely(__pyx_t_3 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 237; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "pygame_sdl2/render.pyx":238 * else: * to_sdl_rect(dest, &dest_rect) * with nogil: # <<<<<<<<<<<<<< * if dest_rect.w == 0 or dest_rect.h == 0: * dest_rect.w = self.trimmed_rect.w */ { #ifdef WITH_THREAD PyThreadState *_save; Py_UNBLOCK_THREADS #endif /*try:*/ { /* "pygame_sdl2/render.pyx":239 * to_sdl_rect(dest, &dest_rect) * with nogil: * if dest_rect.w == 0 or dest_rect.h == 0: # <<<<<<<<<<<<<< * dest_rect.w = self.trimmed_rect.w * dest_rect.h = self.trimmed_rect.h */ __pyx_t_1 = ((__pyx_v_dest_rect.w == 0) != 0); if (!__pyx_t_1) { } else { __pyx_t_2 = __pyx_t_1; goto __pyx_L11_bool_binop_done; } __pyx_t_1 = ((__pyx_v_dest_rect.h == 0) != 0); __pyx_t_2 = __pyx_t_1; __pyx_L11_bool_binop_done:; if (__pyx_t_2) { /* "pygame_sdl2/render.pyx":240 * with nogil: * if dest_rect.w == 0 or dest_rect.h == 0: * dest_rect.w = self.trimmed_rect.w # <<<<<<<<<<<<<< * dest_rect.h = self.trimmed_rect.h * SDL_RenderCopy(self.texture.renderer, self.texture.texture, NULL, &dest_rect) */ __pyx_t_3 = __pyx_v_self->trimmed_rect.w; __pyx_v_dest_rect.w = __pyx_t_3; /* "pygame_sdl2/render.pyx":241 * if dest_rect.w == 0 or dest_rect.h == 0: * dest_rect.w = self.trimmed_rect.w * dest_rect.h = self.trimmed_rect.h # <<<<<<<<<<<<<< * SDL_RenderCopy(self.texture.renderer, self.texture.texture, NULL, &dest_rect) * */ __pyx_t_3 = __pyx_v_self->trimmed_rect.h; __pyx_v_dest_rect.h = __pyx_t_3; /* "pygame_sdl2/render.pyx":239 * to_sdl_rect(dest, &dest_rect) * with nogil: * if dest_rect.w == 0 or dest_rect.h == 0: # <<<<<<<<<<<<<< * dest_rect.w = self.trimmed_rect.w * dest_rect.h = self.trimmed_rect.h */ } /* "pygame_sdl2/render.pyx":242 * dest_rect.w = self.trimmed_rect.w * dest_rect.h = self.trimmed_rect.h * SDL_RenderCopy(self.texture.renderer, self.texture.texture, NULL, &dest_rect) # <<<<<<<<<<<<<< * * */ SDL_RenderCopy(__pyx_v_self->texture->renderer, __pyx_v_self->texture->texture, NULL, (&__pyx_v_dest_rect)); } /* "pygame_sdl2/render.pyx":238 * else: * to_sdl_rect(dest, &dest_rect) * with nogil: # <<<<<<<<<<<<<< * if dest_rect.w == 0 or dest_rect.h == 0: * dest_rect.w = self.trimmed_rect.w */ /*finally:*/ { /*normal exit:*/{ #ifdef WITH_THREAD Py_BLOCK_THREADS #endif goto __pyx_L9; } __pyx_L9:; } } } __pyx_L3:; /* "pygame_sdl2/render.pyx":229 * raise ValueError() * * def render(self, dest=None): # <<<<<<<<<<<<<< * cdef SDL_Rect dest_rect * */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("pygame_sdl2.render.TextureNode.render", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/render.pyx":248 * cdef object frames * * def __init__(self, Renderer ren, fi): # <<<<<<<<<<<<<< * jdata = json.load(open(fi, "r")) * image = jdata["meta"]["image"] */ /* Python wrapper */ static int __pyx_pw_11pygame_sdl2_6render_12TextureAtlas_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static int __pyx_pw_11pygame_sdl2_6render_12TextureAtlas_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { struct __pyx_obj_11pygame_sdl2_6render_Renderer *__pyx_v_ren = 0; PyObject *__pyx_v_fi = 0; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__init__ (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_ren,&__pyx_n_s_fi,0}; PyObject* values[2] = {0,0}; if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_ren)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; case 1: if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_fi)) != 0)) kw_args--; else { __Pyx_RaiseArgtupleInvalid("__init__", 1, 2, 2, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 248; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__init__") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 248; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } } else if (PyTuple_GET_SIZE(__pyx_args) != 2) { goto __pyx_L5_argtuple_error; } else { values[0] = PyTuple_GET_ITEM(__pyx_args, 0); values[1] = PyTuple_GET_ITEM(__pyx_args, 1); } __pyx_v_ren = ((struct __pyx_obj_11pygame_sdl2_6render_Renderer *)values[0]); __pyx_v_fi = values[1]; } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("__init__", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 248; __pyx_clineno = __LINE__; goto __pyx_L3_error;} __pyx_L3_error:; __Pyx_AddTraceback("pygame_sdl2.render.TextureAtlas.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return -1; __pyx_L4_argument_unpacking_done:; if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_ren), __pyx_ptype_11pygame_sdl2_6render_Renderer, 1, "ren", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 248; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_r = __pyx_pf_11pygame_sdl2_6render_12TextureAtlas___init__(((struct __pyx_obj_11pygame_sdl2_6render_TextureAtlas *)__pyx_v_self), __pyx_v_ren, __pyx_v_fi); /* function exit code */ goto __pyx_L0; __pyx_L1_error:; __pyx_r = -1; __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; } static int __pyx_pf_11pygame_sdl2_6render_12TextureAtlas___init__(struct __pyx_obj_11pygame_sdl2_6render_TextureAtlas *__pyx_v_self, struct __pyx_obj_11pygame_sdl2_6render_Renderer *__pyx_v_ren, PyObject *__pyx_v_fi) { PyObject *__pyx_v_jdata = NULL; PyObject *__pyx_v_image = NULL; struct __pyx_obj_11pygame_sdl2_6render_TextureNode *__pyx_v_tn = 0; struct __pyx_obj_11pygame_sdl2_6render_TextureNode *__pyx_v_itex = 0; PyObject *__pyx_v_itm = NULL; PyObject *__pyx_v_iname = NULL; PyObject *__pyx_v_idict = NULL; PyObject *__pyx_v_f = NULL; int __pyx_r; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; PyObject *__pyx_t_5 = NULL; Py_ssize_t __pyx_t_6; Py_ssize_t __pyx_t_7; int __pyx_t_8; int __pyx_t_9; PyObject *(*__pyx_t_10)(PyObject *); PyObject *__pyx_t_11 = NULL; struct __pyx_opt_args_11pygame_sdl2_4rect_to_sdl_rect __pyx_t_12; int __pyx_t_13; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__init__", 0); /* "pygame_sdl2/render.pyx":249 * * def __init__(self, Renderer ren, fi): * jdata = json.load(open(fi, "r")) # <<<<<<<<<<<<<< * image = jdata["meta"]["image"] * */ __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_json); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 249; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_load); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 249; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 249; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __Pyx_INCREF(__pyx_v_fi); __Pyx_GIVEREF(__pyx_v_fi); PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_fi); __Pyx_INCREF(__pyx_n_s_r); __Pyx_GIVEREF(__pyx_n_s_r); PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_n_s_r); __pyx_t_4 = __Pyx_PyObject_Call(__pyx_builtin_open, __pyx_t_2, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 249; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_2 = NULL; if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_3))) { __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_3); if (likely(__pyx_t_2)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); __Pyx_INCREF(__pyx_t_2); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_3, function); } } if (!__pyx_t_2) { __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 249; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_GOTREF(__pyx_t_1); } else { __pyx_t_5 = PyTuple_New(1+1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 249; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); __Pyx_GIVEREF(__pyx_t_2); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_2); __pyx_t_2 = NULL; __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_5, 0+1, __pyx_t_4); __pyx_t_4 = 0; __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_5, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 249; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; } __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_v_jdata = __pyx_t_1; __pyx_t_1 = 0; /* "pygame_sdl2/render.pyx":250 * def __init__(self, Renderer ren, fi): * jdata = json.load(open(fi, "r")) * image = jdata["meta"]["image"] # <<<<<<<<<<<<<< * * cdef TextureNode tn = ren.load_texture(image) */ __pyx_t_1 = PyObject_GetItem(__pyx_v_jdata, __pyx_n_s_meta); if (unlikely(__pyx_t_1 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 250; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; __Pyx_GOTREF(__pyx_t_1); __pyx_t_3 = PyObject_GetItem(__pyx_t_1, __pyx_n_s_image); if (unlikely(__pyx_t_3 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 250; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_v_image = __pyx_t_3; __pyx_t_3 = 0; /* "pygame_sdl2/render.pyx":252 * image = jdata["meta"]["image"] * * cdef TextureNode tn = ren.load_texture(image) # <<<<<<<<<<<<<< * * self.frames = {} */ __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_ren), __pyx_n_s_load_texture); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 252; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_t_5 = NULL; if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_1))) { __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_1); if (likely(__pyx_t_5)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1); __Pyx_INCREF(__pyx_t_5); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_1, function); } } if (!__pyx_t_5) { __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_t_1, __pyx_v_image); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 252; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); } else { __pyx_t_4 = PyTuple_New(1+1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 252; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_5); __pyx_t_5 = NULL; __Pyx_INCREF(__pyx_v_image); __Pyx_GIVEREF(__pyx_v_image); PyTuple_SET_ITEM(__pyx_t_4, 0+1, __pyx_v_image); __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_4, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 252; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_ptype_11pygame_sdl2_6render_TextureNode))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 252; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_v_tn = ((struct __pyx_obj_11pygame_sdl2_6render_TextureNode *)__pyx_t_3); __pyx_t_3 = 0; /* "pygame_sdl2/render.pyx":254 * cdef TextureNode tn = ren.load_texture(image) * * self.frames = {} # <<<<<<<<<<<<<< * * cdef TextureNode itex */ __pyx_t_3 = PyDict_New(); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 254; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __Pyx_GIVEREF(__pyx_t_3); __Pyx_GOTREF(__pyx_v_self->frames); __Pyx_DECREF(__pyx_v_self->frames); __pyx_v_self->frames = __pyx_t_3; __pyx_t_3 = 0; /* "pygame_sdl2/render.pyx":257 * * cdef TextureNode itex * for itm in jdata["frames"].iteritems(): # <<<<<<<<<<<<<< * iname, idict = itm * itex = TextureNode(tn) */ __pyx_t_6 = 0; __pyx_t_1 = PyObject_GetItem(__pyx_v_jdata, __pyx_n_s_frames); if (unlikely(__pyx_t_1 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 257; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; __Pyx_GOTREF(__pyx_t_1); if (unlikely(__pyx_t_1 == Py_None)) { PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%s'", "iteritems"); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 257; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } __pyx_t_4 = __Pyx_dict_iterator(__pyx_t_1, 0, __pyx_n_s_iteritems, (&__pyx_t_7), (&__pyx_t_8)); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 257; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = __pyx_t_4; __pyx_t_4 = 0; while (1) { __pyx_t_9 = __Pyx_dict_iter_next(__pyx_t_3, __pyx_t_7, &__pyx_t_6, NULL, NULL, &__pyx_t_4, __pyx_t_8); if (unlikely(__pyx_t_9 == 0)) break; if (unlikely(__pyx_t_9 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 257; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); __Pyx_XDECREF_SET(__pyx_v_itm, __pyx_t_4); __pyx_t_4 = 0; /* "pygame_sdl2/render.pyx":258 * cdef TextureNode itex * for itm in jdata["frames"].iteritems(): * iname, idict = itm # <<<<<<<<<<<<<< * itex = TextureNode(tn) * f = idict["frame"] */ if ((likely(PyTuple_CheckExact(__pyx_v_itm))) || (PyList_CheckExact(__pyx_v_itm))) { PyObject* sequence = __pyx_v_itm; #if CYTHON_COMPILING_IN_CPYTHON Py_ssize_t size = Py_SIZE(sequence); #else Py_ssize_t size = PySequence_Size(sequence); #endif if (unlikely(size != 2)) { if (size > 2) __Pyx_RaiseTooManyValuesError(2); else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 258; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } #if CYTHON_COMPILING_IN_CPYTHON if (likely(PyTuple_CheckExact(sequence))) { __pyx_t_4 = PyTuple_GET_ITEM(sequence, 0); __pyx_t_1 = PyTuple_GET_ITEM(sequence, 1); } else { __pyx_t_4 = PyList_GET_ITEM(sequence, 0); __pyx_t_1 = PyList_GET_ITEM(sequence, 1); } __Pyx_INCREF(__pyx_t_4); __Pyx_INCREF(__pyx_t_1); #else __pyx_t_4 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 258; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); __pyx_t_1 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 258; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); #endif } else { Py_ssize_t index = -1; __pyx_t_5 = PyObject_GetIter(__pyx_v_itm); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 258; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); __pyx_t_10 = Py_TYPE(__pyx_t_5)->tp_iternext; index = 0; __pyx_t_4 = __pyx_t_10(__pyx_t_5); if (unlikely(!__pyx_t_4)) goto __pyx_L5_unpacking_failed; __Pyx_GOTREF(__pyx_t_4); index = 1; __pyx_t_1 = __pyx_t_10(__pyx_t_5); if (unlikely(!__pyx_t_1)) goto __pyx_L5_unpacking_failed; __Pyx_GOTREF(__pyx_t_1); if (__Pyx_IternextUnpackEndCheck(__pyx_t_10(__pyx_t_5), 2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 258; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_t_10 = NULL; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; goto __pyx_L6_unpacking_done; __pyx_L5_unpacking_failed:; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __pyx_t_10 = NULL; if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 258; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_L6_unpacking_done:; } __Pyx_XDECREF_SET(__pyx_v_iname, __pyx_t_4); __pyx_t_4 = 0; __Pyx_XDECREF_SET(__pyx_v_idict, __pyx_t_1); __pyx_t_1 = 0; /* "pygame_sdl2/render.pyx":259 * for itm in jdata["frames"].iteritems(): * iname, idict = itm * itex = TextureNode(tn) # <<<<<<<<<<<<<< * f = idict["frame"] * to_sdl_rect((f['x'], f['y'], f['w'], f['h']), &itex.source_rect, "frame") */ __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 259; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __Pyx_INCREF(((PyObject *)__pyx_v_tn)); __Pyx_GIVEREF(((PyObject *)__pyx_v_tn)); PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)__pyx_v_tn)); __pyx_t_4 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_11pygame_sdl2_6render_TextureNode), __pyx_t_1, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 259; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_XDECREF_SET(__pyx_v_itex, ((struct __pyx_obj_11pygame_sdl2_6render_TextureNode *)__pyx_t_4)); __pyx_t_4 = 0; /* "pygame_sdl2/render.pyx":260 * iname, idict = itm * itex = TextureNode(tn) * f = idict["frame"] # <<<<<<<<<<<<<< * to_sdl_rect((f['x'], f['y'], f['w'], f['h']), &itex.source_rect, "frame") * f = idict["spriteSourceSize"] */ __pyx_t_4 = PyObject_GetItem(__pyx_v_idict, __pyx_n_s_frame); if (unlikely(__pyx_t_4 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 260; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; __Pyx_GOTREF(__pyx_t_4); __Pyx_XDECREF_SET(__pyx_v_f, __pyx_t_4); __pyx_t_4 = 0; /* "pygame_sdl2/render.pyx":261 * itex = TextureNode(tn) * f = idict["frame"] * to_sdl_rect((f['x'], f['y'], f['w'], f['h']), &itex.source_rect, "frame") # <<<<<<<<<<<<<< * f = idict["spriteSourceSize"] * to_sdl_rect((f['x'], f['y'], f['w'], f['h']), &itex.trimmed_rect, "spriteSourceSize") */ __pyx_t_4 = PyObject_GetItem(__pyx_v_f, __pyx_n_s_x); if (unlikely(__pyx_t_4 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 261; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; __Pyx_GOTREF(__pyx_t_4); __pyx_t_1 = PyObject_GetItem(__pyx_v_f, __pyx_n_s_y); if (unlikely(__pyx_t_1 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 261; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; __Pyx_GOTREF(__pyx_t_1); __pyx_t_5 = PyObject_GetItem(__pyx_v_f, __pyx_n_s_w); if (unlikely(__pyx_t_5 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 261; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; __Pyx_GOTREF(__pyx_t_5); __pyx_t_2 = PyObject_GetItem(__pyx_v_f, __pyx_n_s_h); if (unlikely(__pyx_t_2 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 261; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; __Pyx_GOTREF(__pyx_t_2); __pyx_t_11 = PyTuple_New(4); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 261; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_11); __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_11, 0, __pyx_t_4); __Pyx_GIVEREF(__pyx_t_1); PyTuple_SET_ITEM(__pyx_t_11, 1, __pyx_t_1); __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_11, 2, __pyx_t_5); __Pyx_GIVEREF(__pyx_t_2); PyTuple_SET_ITEM(__pyx_t_11, 3, __pyx_t_2); __pyx_t_4 = 0; __pyx_t_1 = 0; __pyx_t_5 = 0; __pyx_t_2 = 0; __pyx_t_12.__pyx_n = 1; __pyx_t_12.argname = __pyx_n_s_frame; __pyx_t_9 = __pyx_f_11pygame_sdl2_4rect_to_sdl_rect(__pyx_t_11, (&__pyx_v_itex->source_rect), &__pyx_t_12); if (unlikely(__pyx_t_9 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 261; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; /* "pygame_sdl2/render.pyx":262 * f = idict["frame"] * to_sdl_rect((f['x'], f['y'], f['w'], f['h']), &itex.source_rect, "frame") * f = idict["spriteSourceSize"] # <<<<<<<<<<<<<< * to_sdl_rect((f['x'], f['y'], f['w'], f['h']), &itex.trimmed_rect, "spriteSourceSize") * if idict["rotated"]: */ __pyx_t_11 = PyObject_GetItem(__pyx_v_idict, __pyx_n_s_spriteSourceSize); if (unlikely(__pyx_t_11 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 262; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; __Pyx_GOTREF(__pyx_t_11); __Pyx_DECREF_SET(__pyx_v_f, __pyx_t_11); __pyx_t_11 = 0; /* "pygame_sdl2/render.pyx":263 * to_sdl_rect((f['x'], f['y'], f['w'], f['h']), &itex.source_rect, "frame") * f = idict["spriteSourceSize"] * to_sdl_rect((f['x'], f['y'], f['w'], f['h']), &itex.trimmed_rect, "spriteSourceSize") # <<<<<<<<<<<<<< * if idict["rotated"]: * raise error("Rotation not supported yet.") */ __pyx_t_11 = PyObject_GetItem(__pyx_v_f, __pyx_n_s_x); if (unlikely(__pyx_t_11 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 263; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; __Pyx_GOTREF(__pyx_t_11); __pyx_t_2 = PyObject_GetItem(__pyx_v_f, __pyx_n_s_y); if (unlikely(__pyx_t_2 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 263; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; __Pyx_GOTREF(__pyx_t_2); __pyx_t_5 = PyObject_GetItem(__pyx_v_f, __pyx_n_s_w); if (unlikely(__pyx_t_5 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 263; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; __Pyx_GOTREF(__pyx_t_5); __pyx_t_1 = PyObject_GetItem(__pyx_v_f, __pyx_n_s_h); if (unlikely(__pyx_t_1 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 263; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; __Pyx_GOTREF(__pyx_t_1); __pyx_t_4 = PyTuple_New(4); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 263; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); __Pyx_GIVEREF(__pyx_t_11); PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_11); __Pyx_GIVEREF(__pyx_t_2); PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_2); __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_4, 2, __pyx_t_5); __Pyx_GIVEREF(__pyx_t_1); PyTuple_SET_ITEM(__pyx_t_4, 3, __pyx_t_1); __pyx_t_11 = 0; __pyx_t_2 = 0; __pyx_t_5 = 0; __pyx_t_1 = 0; __pyx_t_12.__pyx_n = 1; __pyx_t_12.argname = __pyx_n_s_spriteSourceSize; __pyx_t_9 = __pyx_f_11pygame_sdl2_4rect_to_sdl_rect(__pyx_t_4, (&__pyx_v_itex->trimmed_rect), &__pyx_t_12); if (unlikely(__pyx_t_9 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 263; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; /* "pygame_sdl2/render.pyx":264 * f = idict["spriteSourceSize"] * to_sdl_rect((f['x'], f['y'], f['w'], f['h']), &itex.trimmed_rect, "spriteSourceSize") * if idict["rotated"]: # <<<<<<<<<<<<<< * raise error("Rotation not supported yet.") * itex.source_w = idict["sourceSize"]["w"] */ __pyx_t_4 = PyObject_GetItem(__pyx_v_idict, __pyx_n_s_rotated); if (unlikely(__pyx_t_4 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 264; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; __Pyx_GOTREF(__pyx_t_4); __pyx_t_13 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_13 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 264; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; if (__pyx_t_13) { /* "pygame_sdl2/render.pyx":265 * to_sdl_rect((f['x'], f['y'], f['w'], f['h']), &itex.trimmed_rect, "spriteSourceSize") * if idict["rotated"]: * raise error("Rotation not supported yet.") # <<<<<<<<<<<<<< * itex.source_w = idict["sourceSize"]["w"] * itex.source_h = idict["sourceSize"]["h"] */ __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_error); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 265; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_tuple__2, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 265; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_Raise(__pyx_t_1, 0, 0, 0); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; {__pyx_filename = __pyx_f[0]; __pyx_lineno = 265; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "pygame_sdl2/render.pyx":264 * f = idict["spriteSourceSize"] * to_sdl_rect((f['x'], f['y'], f['w'], f['h']), &itex.trimmed_rect, "spriteSourceSize") * if idict["rotated"]: # <<<<<<<<<<<<<< * raise error("Rotation not supported yet.") * itex.source_w = idict["sourceSize"]["w"] */ } /* "pygame_sdl2/render.pyx":266 * if idict["rotated"]: * raise error("Rotation not supported yet.") * itex.source_w = idict["sourceSize"]["w"] # <<<<<<<<<<<<<< * itex.source_h = idict["sourceSize"]["h"] * */ __pyx_t_1 = PyObject_GetItem(__pyx_v_idict, __pyx_n_s_sourceSize); if (unlikely(__pyx_t_1 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 266; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; __Pyx_GOTREF(__pyx_t_1); __pyx_t_4 = PyObject_GetItem(__pyx_t_1, __pyx_n_s_w); if (unlikely(__pyx_t_4 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 266; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_9 = __Pyx_PyInt_As_int(__pyx_t_4); if (unlikely((__pyx_t_9 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 266; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_v_itex->source_w = __pyx_t_9; /* "pygame_sdl2/render.pyx":267 * raise error("Rotation not supported yet.") * itex.source_w = idict["sourceSize"]["w"] * itex.source_h = idict["sourceSize"]["h"] # <<<<<<<<<<<<<< * * self.frames[iname] = itex */ __pyx_t_4 = PyObject_GetItem(__pyx_v_idict, __pyx_n_s_sourceSize); if (unlikely(__pyx_t_4 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 267; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; __Pyx_GOTREF(__pyx_t_4); __pyx_t_1 = PyObject_GetItem(__pyx_t_4, __pyx_n_s_h); if (unlikely(__pyx_t_1 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 267; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_t_9 = __Pyx_PyInt_As_int(__pyx_t_1); if (unlikely((__pyx_t_9 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 267; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_v_itex->source_h = __pyx_t_9; /* "pygame_sdl2/render.pyx":269 * itex.source_h = idict["sourceSize"]["h"] * * self.frames[iname] = itex # <<<<<<<<<<<<<< * * def __getitem__(self, key): */ if (unlikely(PyObject_SetItem(__pyx_v_self->frames, __pyx_v_iname, ((PyObject *)__pyx_v_itex)) < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 269; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "pygame_sdl2/render.pyx":248 * cdef object frames * * def __init__(self, Renderer ren, fi): # <<<<<<<<<<<<<< * jdata = json.load(open(fi, "r")) * image = jdata["meta"]["image"] */ /* function exit code */ __pyx_r = 0; goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_5); __Pyx_XDECREF(__pyx_t_11); __Pyx_AddTraceback("pygame_sdl2.render.TextureAtlas.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = -1; __pyx_L0:; __Pyx_XDECREF(__pyx_v_jdata); __Pyx_XDECREF(__pyx_v_image); __Pyx_XDECREF((PyObject *)__pyx_v_tn); __Pyx_XDECREF((PyObject *)__pyx_v_itex); __Pyx_XDECREF(__pyx_v_itm); __Pyx_XDECREF(__pyx_v_iname); __Pyx_XDECREF(__pyx_v_idict); __Pyx_XDECREF(__pyx_v_f); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/render.pyx":271 * self.frames[iname] = itex * * def __getitem__(self, key): # <<<<<<<<<<<<<< * return self.frames[key] * */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_6render_12TextureAtlas_3__getitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_key); /*proto*/ static PyObject *__pyx_pw_11pygame_sdl2_6render_12TextureAtlas_3__getitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_key) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__getitem__ (wrapper)", 0); __pyx_r = __pyx_pf_11pygame_sdl2_6render_12TextureAtlas_2__getitem__(((struct __pyx_obj_11pygame_sdl2_6render_TextureAtlas *)__pyx_v_self), ((PyObject *)__pyx_v_key)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_6render_12TextureAtlas_2__getitem__(struct __pyx_obj_11pygame_sdl2_6render_TextureAtlas *__pyx_v_self, PyObject *__pyx_v_key) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__getitem__", 0); /* "pygame_sdl2/render.pyx":272 * * def __getitem__(self, key): * return self.frames[key] # <<<<<<<<<<<<<< * * def keys(self): */ __Pyx_XDECREF(__pyx_r); __pyx_t_1 = PyObject_GetItem(__pyx_v_self->frames, __pyx_v_key); if (unlikely(__pyx_t_1 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 272; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "pygame_sdl2/render.pyx":271 * self.frames[iname] = itex * * def __getitem__(self, key): # <<<<<<<<<<<<<< * return self.frames[key] * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("pygame_sdl2.render.TextureAtlas.__getitem__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/render.pyx":274 * return self.frames[key] * * def keys(self): # <<<<<<<<<<<<<< * return self.frames.keys() * */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_6render_12TextureAtlas_5keys(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/ static PyObject *__pyx_pw_11pygame_sdl2_6render_12TextureAtlas_5keys(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("keys (wrapper)", 0); __pyx_r = __pyx_pf_11pygame_sdl2_6render_12TextureAtlas_4keys(((struct __pyx_obj_11pygame_sdl2_6render_TextureAtlas *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_6render_12TextureAtlas_4keys(struct __pyx_obj_11pygame_sdl2_6render_TextureAtlas *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("keys", 0); /* "pygame_sdl2/render.pyx":275 * * def keys(self): * return self.frames.keys() # <<<<<<<<<<<<<< * * */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self->frames, __pyx_n_s_keys); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 275; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = NULL; if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_2))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); if (likely(__pyx_t_3)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); } } if (__pyx_t_3) { __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 275; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } else { __pyx_t_1 = __Pyx_PyObject_CallNoArg(__pyx_t_2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 275; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "pygame_sdl2/render.pyx":274 * return self.frames[key] * * def keys(self): # <<<<<<<<<<<<<< * return self.frames.keys() * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("pygame_sdl2.render.TextureAtlas.keys", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/render.pyx":291 * cdef double _scaley * * def __init__(self, nodes): # <<<<<<<<<<<<<< * self._color.r = 255 * self._color.g = 255 */ /* Python wrapper */ static int __pyx_pw_11pygame_sdl2_6render_6Sprite_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static int __pyx_pw_11pygame_sdl2_6render_6Sprite_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_nodes = 0; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__init__ (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_nodes,0}; PyObject* values[1] = {0}; if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_nodes)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__init__") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 291; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } } else if (PyTuple_GET_SIZE(__pyx_args) != 1) { goto __pyx_L5_argtuple_error; } else { values[0] = PyTuple_GET_ITEM(__pyx_args, 0); } __pyx_v_nodes = values[0]; } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("__init__", 1, 1, 1, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 291; __pyx_clineno = __LINE__; goto __pyx_L3_error;} __pyx_L3_error:; __Pyx_AddTraceback("pygame_sdl2.render.Sprite.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return -1; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_11pygame_sdl2_6render_6Sprite___init__(((struct __pyx_obj_11pygame_sdl2_6render_Sprite *)__pyx_v_self), __pyx_v_nodes); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static int __pyx_pf_11pygame_sdl2_6render_6Sprite___init__(struct __pyx_obj_11pygame_sdl2_6render_Sprite *__pyx_v_self, PyObject *__pyx_v_nodes) { PyObject *__pyx_v_node = NULL; int __pyx_r; __Pyx_RefNannyDeclarations int __pyx_t_1; int __pyx_t_2; PyObject *__pyx_t_3 = NULL; Py_ssize_t __pyx_t_4; PyObject *(*__pyx_t_5)(PyObject *); PyObject *__pyx_t_6 = NULL; PyObject *__pyx_t_7 = NULL; int __pyx_t_8; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__init__", 0); __Pyx_INCREF(__pyx_v_nodes); /* "pygame_sdl2/render.pyx":292 * * def __init__(self, nodes): * self._color.r = 255 # <<<<<<<<<<<<<< * self._color.g = 255 * self._color.b = 255 */ __pyx_v_self->_color.r = 0xFF; /* "pygame_sdl2/render.pyx":293 * def __init__(self, nodes): * self._color.r = 255 * self._color.g = 255 # <<<<<<<<<<<<<< * self._color.b = 255 * self._color.a = 255 */ __pyx_v_self->_color.g = 0xFF; /* "pygame_sdl2/render.pyx":294 * self._color.r = 255 * self._color.g = 255 * self._color.b = 255 # <<<<<<<<<<<<<< * self._color.a = 255 * self._scalex = 1.0 */ __pyx_v_self->_color.b = 0xFF; /* "pygame_sdl2/render.pyx":295 * self._color.g = 255 * self._color.b = 255 * self._color.a = 255 # <<<<<<<<<<<<<< * self._scalex = 1.0 * self._scaley = 1.0 */ __pyx_v_self->_color.a = 0xFF; /* "pygame_sdl2/render.pyx":296 * self._color.b = 255 * self._color.a = 255 * self._scalex = 1.0 # <<<<<<<<<<<<<< * self._scaley = 1.0 * self._flip = SDL_FLIP_NONE */ __pyx_v_self->_scalex = 1.0; /* "pygame_sdl2/render.pyx":297 * self._color.a = 255 * self._scalex = 1.0 * self._scaley = 1.0 # <<<<<<<<<<<<<< * self._flip = SDL_FLIP_NONE * */ __pyx_v_self->_scaley = 1.0; /* "pygame_sdl2/render.pyx":298 * self._scalex = 1.0 * self._scaley = 1.0 * self._flip = SDL_FLIP_NONE # <<<<<<<<<<<<<< * * memset(&self._pos, 0, sizeof(SDL_Rect)) */ __pyx_v_self->_flip = SDL_FLIP_NONE; /* "pygame_sdl2/render.pyx":300 * self._flip = SDL_FLIP_NONE * * memset(&self._pos, 0, sizeof(SDL_Rect)) # <<<<<<<<<<<<<< * memset(&self.bounding_box, 0, sizeof(SDL_Rect)) * */ memset((&__pyx_v_self->_pos), 0, (sizeof(SDL_Rect))); /* "pygame_sdl2/render.pyx":301 * * memset(&self._pos, 0, sizeof(SDL_Rect)) * memset(&self.bounding_box, 0, sizeof(SDL_Rect)) # <<<<<<<<<<<<<< * * if isinstance(nodes, TextureNode): */ memset((&__pyx_v_self->bounding_box), 0, (sizeof(SDL_Rect))); /* "pygame_sdl2/render.pyx":303 * memset(&self.bounding_box, 0, sizeof(SDL_Rect)) * * if isinstance(nodes, TextureNode): # <<<<<<<<<<<<<< * nodes = [nodes] * */ __pyx_t_1 = __Pyx_TypeCheck(__pyx_v_nodes, __pyx_ptype_11pygame_sdl2_6render_TextureNode); __pyx_t_2 = (__pyx_t_1 != 0); if (__pyx_t_2) { /* "pygame_sdl2/render.pyx":304 * * if isinstance(nodes, TextureNode): * nodes = [nodes] # <<<<<<<<<<<<<< * * self.nodes = [] */ __pyx_t_3 = PyList_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 304; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __Pyx_INCREF(__pyx_v_nodes); __Pyx_GIVEREF(__pyx_v_nodes); PyList_SET_ITEM(__pyx_t_3, 0, __pyx_v_nodes); __Pyx_DECREF_SET(__pyx_v_nodes, __pyx_t_3); __pyx_t_3 = 0; /* "pygame_sdl2/render.pyx":303 * memset(&self.bounding_box, 0, sizeof(SDL_Rect)) * * if isinstance(nodes, TextureNode): # <<<<<<<<<<<<<< * nodes = [nodes] * */ } /* "pygame_sdl2/render.pyx":306 * nodes = [nodes] * * self.nodes = [] # <<<<<<<<<<<<<< * # TODO: Check that they're all from the same texture. * for node in nodes: */ __pyx_t_3 = PyList_New(0); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 306; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __Pyx_GIVEREF(__pyx_t_3); __Pyx_GOTREF(__pyx_v_self->nodes); __Pyx_DECREF(__pyx_v_self->nodes); __pyx_v_self->nodes = ((PyObject*)__pyx_t_3); __pyx_t_3 = 0; /* "pygame_sdl2/render.pyx":308 * self.nodes = [] * # TODO: Check that they're all from the same texture. * for node in nodes: # <<<<<<<<<<<<<< * if not isinstance(node, TextureNode): * raise ValueError("Invalid argument: %s" % node) */ if (likely(PyList_CheckExact(__pyx_v_nodes)) || PyTuple_CheckExact(__pyx_v_nodes)) { __pyx_t_3 = __pyx_v_nodes; __Pyx_INCREF(__pyx_t_3); __pyx_t_4 = 0; __pyx_t_5 = NULL; } else { __pyx_t_4 = -1; __pyx_t_3 = PyObject_GetIter(__pyx_v_nodes); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 308; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __pyx_t_5 = Py_TYPE(__pyx_t_3)->tp_iternext; if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 308; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } for (;;) { if (likely(!__pyx_t_5)) { if (likely(PyList_CheckExact(__pyx_t_3))) { if (__pyx_t_4 >= PyList_GET_SIZE(__pyx_t_3)) break; #if CYTHON_COMPILING_IN_CPYTHON __pyx_t_6 = PyList_GET_ITEM(__pyx_t_3, __pyx_t_4); __Pyx_INCREF(__pyx_t_6); __pyx_t_4++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 308; __pyx_clineno = __LINE__; goto __pyx_L1_error;} #else __pyx_t_6 = PySequence_ITEM(__pyx_t_3, __pyx_t_4); __pyx_t_4++; if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 308; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_6); #endif } else { if (__pyx_t_4 >= PyTuple_GET_SIZE(__pyx_t_3)) break; #if CYTHON_COMPILING_IN_CPYTHON __pyx_t_6 = PyTuple_GET_ITEM(__pyx_t_3, __pyx_t_4); __Pyx_INCREF(__pyx_t_6); __pyx_t_4++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 308; __pyx_clineno = __LINE__; goto __pyx_L1_error;} #else __pyx_t_6 = PySequence_ITEM(__pyx_t_3, __pyx_t_4); __pyx_t_4++; if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 308; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_6); #endif } } else { __pyx_t_6 = __pyx_t_5(__pyx_t_3); if (unlikely(!__pyx_t_6)) { PyObject* exc_type = PyErr_Occurred(); if (exc_type) { if (likely(exc_type == PyExc_StopIteration || PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); else {__pyx_filename = __pyx_f[0]; __pyx_lineno = 308; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } break; } __Pyx_GOTREF(__pyx_t_6); } __Pyx_XDECREF_SET(__pyx_v_node, __pyx_t_6); __pyx_t_6 = 0; /* "pygame_sdl2/render.pyx":309 * # TODO: Check that they're all from the same texture. * for node in nodes: * if not isinstance(node, TextureNode): # <<<<<<<<<<<<<< * raise ValueError("Invalid argument: %s" % node) * SDL_UnionRect(&self.bounding_box, &(node).trimmed_rect, */ __pyx_t_2 = __Pyx_TypeCheck(__pyx_v_node, __pyx_ptype_11pygame_sdl2_6render_TextureNode); __pyx_t_1 = ((!(__pyx_t_2 != 0)) != 0); if (__pyx_t_1) { /* "pygame_sdl2/render.pyx":310 * for node in nodes: * if not isinstance(node, TextureNode): * raise ValueError("Invalid argument: %s" % node) # <<<<<<<<<<<<<< * SDL_UnionRect(&self.bounding_box, &(node).trimmed_rect, * &self.bounding_box) */ __pyx_t_6 = __Pyx_PyString_Format(__pyx_kp_s_Invalid_argument_s, __pyx_v_node); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 310; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_6); __pyx_t_7 = PyTuple_New(1); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 310; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_7); __Pyx_GIVEREF(__pyx_t_6); PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_6); __pyx_t_6 = 0; __pyx_t_6 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_t_7, NULL); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 310; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_Raise(__pyx_t_6, 0, 0, 0); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; {__pyx_filename = __pyx_f[0]; __pyx_lineno = 310; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "pygame_sdl2/render.pyx":309 * # TODO: Check that they're all from the same texture. * for node in nodes: * if not isinstance(node, TextureNode): # <<<<<<<<<<<<<< * raise ValueError("Invalid argument: %s" % node) * SDL_UnionRect(&self.bounding_box, &(node).trimmed_rect, */ } /* "pygame_sdl2/render.pyx":311 * if not isinstance(node, TextureNode): * raise ValueError("Invalid argument: %s" % node) * SDL_UnionRect(&self.bounding_box, &(node).trimmed_rect, # <<<<<<<<<<<<<< * &self.bounding_box) * self.nodes.append(node) */ SDL_UnionRect((&__pyx_v_self->bounding_box), (&((struct __pyx_obj_11pygame_sdl2_6render_TextureNode *)__pyx_v_node)->trimmed_rect), (&__pyx_v_self->bounding_box)); /* "pygame_sdl2/render.pyx":313 * SDL_UnionRect(&self.bounding_box, &(node).trimmed_rect, * &self.bounding_box) * self.nodes.append(node) # <<<<<<<<<<<<<< * * cdef void adjust_rect(Sprite self, const SDL_Rect *dest, const SDL_Rect *rin, SDL_Rect *rout) nogil: */ if (unlikely(__pyx_v_self->nodes == Py_None)) { PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%s'", "append"); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 313; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } __pyx_t_8 = __Pyx_PyList_Append(__pyx_v_self->nodes, __pyx_v_node); if (unlikely(__pyx_t_8 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 313; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "pygame_sdl2/render.pyx":308 * self.nodes = [] * # TODO: Check that they're all from the same texture. * for node in nodes: # <<<<<<<<<<<<<< * if not isinstance(node, TextureNode): * raise ValueError("Invalid argument: %s" % node) */ } __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "pygame_sdl2/render.pyx":291 * cdef double _scaley * * def __init__(self, nodes): # <<<<<<<<<<<<<< * self._color.r = 255 * self._color.g = 255 */ /* function exit code */ __pyx_r = 0; goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_6); __Pyx_XDECREF(__pyx_t_7); __Pyx_AddTraceback("pygame_sdl2.render.Sprite.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = -1; __pyx_L0:; __Pyx_XDECREF(__pyx_v_node); __Pyx_XDECREF(__pyx_v_nodes); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/render.pyx":315 * self.nodes.append(node) * * cdef void adjust_rect(Sprite self, const SDL_Rect *dest, const SDL_Rect *rin, SDL_Rect *rout) nogil: # <<<<<<<<<<<<<< * rout.x = dest.x + (self._scalex * rin.x) * rout.y = dest.y + (self._scaley * rin.y) */ static void __pyx_f_11pygame_sdl2_6render_6Sprite_adjust_rect(struct __pyx_obj_11pygame_sdl2_6render_Sprite *__pyx_v_self, SDL_Rect const *__pyx_v_dest, SDL_Rect const *__pyx_v_rin, SDL_Rect *__pyx_v_rout) { /* "pygame_sdl2/render.pyx":316 * * cdef void adjust_rect(Sprite self, const SDL_Rect *dest, const SDL_Rect *rin, SDL_Rect *rout) nogil: * rout.x = dest.x + (self._scalex * rin.x) # <<<<<<<<<<<<<< * rout.y = dest.y + (self._scaley * rin.y) * rout.w = (self._scalex * rin.w) */ __pyx_v_rout->x = (__pyx_v_dest->x + ((int)(__pyx_v_self->_scalex * __pyx_v_rin->x))); /* "pygame_sdl2/render.pyx":317 * cdef void adjust_rect(Sprite self, const SDL_Rect *dest, const SDL_Rect *rin, SDL_Rect *rout) nogil: * rout.x = dest.x + (self._scalex * rin.x) * rout.y = dest.y + (self._scaley * rin.y) # <<<<<<<<<<<<<< * rout.w = (self._scalex * rin.w) * rout.h = (self._scaley * rin.h) */ __pyx_v_rout->y = (__pyx_v_dest->y + ((int)(__pyx_v_self->_scaley * __pyx_v_rin->y))); /* "pygame_sdl2/render.pyx":318 * rout.x = dest.x + (self._scalex * rin.x) * rout.y = dest.y + (self._scaley * rin.y) * rout.w = (self._scalex * rin.w) # <<<<<<<<<<<<<< * rout.h = (self._scaley * rin.h) * */ __pyx_v_rout->w = ((int)(__pyx_v_self->_scalex * __pyx_v_rin->w)); /* "pygame_sdl2/render.pyx":319 * rout.y = dest.y + (self._scaley * rin.y) * rout.w = (self._scalex * rin.w) * rout.h = (self._scaley * rin.h) # <<<<<<<<<<<<<< * * def render(self, dest=None): */ __pyx_v_rout->h = ((int)(__pyx_v_self->_scaley * __pyx_v_rin->h)); /* "pygame_sdl2/render.pyx":315 * self.nodes.append(node) * * cdef void adjust_rect(Sprite self, const SDL_Rect *dest, const SDL_Rect *rin, SDL_Rect *rout) nogil: # <<<<<<<<<<<<<< * rout.x = dest.x + (self._scalex * rin.x) * rout.y = dest.y + (self._scaley * rin.y) */ /* function exit code */ } /* "pygame_sdl2/render.pyx":321 * rout.h = (self._scaley * rin.h) * * def render(self, dest=None): # <<<<<<<<<<<<<< * cdef Texture tex = (self.nodes[0]).texture * cdef SDL_Rect dest_rect */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_6render_6Sprite_3render(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static PyObject *__pyx_pw_11pygame_sdl2_6render_6Sprite_3render(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_dest = 0; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("render (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_dest,0}; PyObject* values[1] = {0}; values[0] = ((PyObject *)Py_None); if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (kw_args > 0) { PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_dest); if (value) { values[0] = value; kw_args--; } } } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "render") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 321; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } } else { switch (PyTuple_GET_SIZE(__pyx_args)) { case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); case 0: break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_dest = values[0]; } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("render", 0, 0, 1, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 321; __pyx_clineno = __LINE__; goto __pyx_L3_error;} __pyx_L3_error:; __Pyx_AddTraceback("pygame_sdl2.render.Sprite.render", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_11pygame_sdl2_6render_6Sprite_2render(((struct __pyx_obj_11pygame_sdl2_6render_Sprite *)__pyx_v_self), __pyx_v_dest); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_6render_6Sprite_2render(struct __pyx_obj_11pygame_sdl2_6render_Sprite *__pyx_v_self, PyObject *__pyx_v_dest) { struct __pyx_obj_11pygame_sdl2_6render_Texture *__pyx_v_tex = 0; SDL_Rect __pyx_v_dest_rect; SDL_Rect __pyx_v_real_dest; SDL_Point __pyx_v_pivot; struct __pyx_obj_11pygame_sdl2_6render_TextureNode *__pyx_v_tn = 0; PyObject *__pyx_v_x = NULL; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; int __pyx_t_3; int __pyx_t_4; int __pyx_t_5; Py_ssize_t __pyx_t_6; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("render", 0); /* "pygame_sdl2/render.pyx":322 * * def render(self, dest=None): * cdef Texture tex = (self.nodes[0]).texture # <<<<<<<<<<<<<< * cdef SDL_Rect dest_rect * cdef SDL_Rect real_dest */ if (unlikely(__pyx_v_self->nodes == Py_None)) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 322; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } __pyx_t_1 = __Pyx_GetItemInt_List(__pyx_v_self->nodes, 0, long, 1, __Pyx_PyInt_From_long, 1, 0, 1); if (unlikely(__pyx_t_1 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 322; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = ((PyObject *)((struct __pyx_obj_11pygame_sdl2_6render_TextureNode *)__pyx_t_1)->texture); __Pyx_INCREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_v_tex = ((struct __pyx_obj_11pygame_sdl2_6render_Texture *)__pyx_t_2); __pyx_t_2 = 0; /* "pygame_sdl2/render.pyx":327 * cdef SDL_Point pivot * * if dest is None: # <<<<<<<<<<<<<< * memcpy(&dest_rect, &self._pos, sizeof(SDL_Rect)) * else: */ __pyx_t_3 = (__pyx_v_dest == Py_None); __pyx_t_4 = (__pyx_t_3 != 0); if (__pyx_t_4) { /* "pygame_sdl2/render.pyx":328 * * if dest is None: * memcpy(&dest_rect, &self._pos, sizeof(SDL_Rect)) # <<<<<<<<<<<<<< * else: * to_sdl_rect(dest, &dest_rect) */ memcpy((&__pyx_v_dest_rect), (&__pyx_v_self->_pos), (sizeof(SDL_Rect))); /* "pygame_sdl2/render.pyx":327 * cdef SDL_Point pivot * * if dest is None: # <<<<<<<<<<<<<< * memcpy(&dest_rect, &self._pos, sizeof(SDL_Rect)) * else: */ goto __pyx_L3; } /* "pygame_sdl2/render.pyx":330 * memcpy(&dest_rect, &self._pos, sizeof(SDL_Rect)) * else: * to_sdl_rect(dest, &dest_rect) # <<<<<<<<<<<<<< * * with nogil: */ /*else*/ { __pyx_t_5 = __pyx_f_11pygame_sdl2_4rect_to_sdl_rect(__pyx_v_dest, (&__pyx_v_dest_rect), NULL); if (unlikely(__pyx_t_5 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 330; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } __pyx_L3:; /* "pygame_sdl2/render.pyx":332 * to_sdl_rect(dest, &dest_rect) * * with nogil: # <<<<<<<<<<<<<< * SDL_SetTextureColorMod(tex.texture, self._color.r, self._color.g, self._color.b) * SDL_SetTextureAlphaMod(tex.texture, self._color.a) */ { #ifdef WITH_THREAD PyThreadState *_save; Py_UNBLOCK_THREADS #endif /*try:*/ { /* "pygame_sdl2/render.pyx":333 * * with nogil: * SDL_SetTextureColorMod(tex.texture, self._color.r, self._color.g, self._color.b) # <<<<<<<<<<<<<< * SDL_SetTextureAlphaMod(tex.texture, self._color.a) * */ SDL_SetTextureColorMod(__pyx_v_tex->texture, __pyx_v_self->_color.r, __pyx_v_self->_color.g, __pyx_v_self->_color.b); /* "pygame_sdl2/render.pyx":334 * with nogil: * SDL_SetTextureColorMod(tex.texture, self._color.r, self._color.g, self._color.b) * SDL_SetTextureAlphaMod(tex.texture, self._color.a) # <<<<<<<<<<<<<< * * if DEBUG_DRAW_BBOX: */ SDL_SetTextureAlphaMod(__pyx_v_tex->texture, __pyx_v_self->_color.a); /* "pygame_sdl2/render.pyx":336 * SDL_SetTextureAlphaMod(tex.texture, self._color.a) * * if DEBUG_DRAW_BBOX: # <<<<<<<<<<<<<< * # TODO: Adjust for rotation. * self.adjust_rect(&dest_rect, &self.bounding_box, &real_dest) */ __pyx_t_4 = (__pyx_v_11pygame_sdl2_6render_DEBUG_DRAW_BBOX != 0); if (__pyx_t_4) { /* "pygame_sdl2/render.pyx":338 * if DEBUG_DRAW_BBOX: * # TODO: Adjust for rotation. * self.adjust_rect(&dest_rect, &self.bounding_box, &real_dest) # <<<<<<<<<<<<<< * * SDL_SetRenderDrawColor(tex.renderer, 0xFF, 0x00, 0xFF, 0xFF) */ ((struct __pyx_vtabstruct_11pygame_sdl2_6render_Sprite *)__pyx_v_self->__pyx_vtab)->adjust_rect(__pyx_v_self, (&__pyx_v_dest_rect), (&__pyx_v_self->bounding_box), (&__pyx_v_real_dest)); /* "pygame_sdl2/render.pyx":340 * self.adjust_rect(&dest_rect, &self.bounding_box, &real_dest) * * SDL_SetRenderDrawColor(tex.renderer, 0xFF, 0x00, 0xFF, 0xFF) # <<<<<<<<<<<<<< * SDL_RenderDrawRect(tex.renderer, &real_dest) * */ SDL_SetRenderDrawColor(__pyx_v_tex->renderer, 0xFF, 0x00, 0xFF, 0xFF); /* "pygame_sdl2/render.pyx":341 * * SDL_SetRenderDrawColor(tex.renderer, 0xFF, 0x00, 0xFF, 0xFF) * SDL_RenderDrawRect(tex.renderer, &real_dest) # <<<<<<<<<<<<<< * * cdef TextureNode tn */ SDL_RenderDrawRect(__pyx_v_tex->renderer, (&__pyx_v_real_dest)); /* "pygame_sdl2/render.pyx":336 * SDL_SetTextureAlphaMod(tex.texture, self._color.a) * * if DEBUG_DRAW_BBOX: # <<<<<<<<<<<<<< * # TODO: Adjust for rotation. * self.adjust_rect(&dest_rect, &self.bounding_box, &real_dest) */ } } /* "pygame_sdl2/render.pyx":332 * to_sdl_rect(dest, &dest_rect) * * with nogil: # <<<<<<<<<<<<<< * SDL_SetTextureColorMod(tex.texture, self._color.r, self._color.g, self._color.b) * SDL_SetTextureAlphaMod(tex.texture, self._color.a) */ /*finally:*/ { /*normal exit:*/{ #ifdef WITH_THREAD Py_BLOCK_THREADS #endif goto __pyx_L6; } __pyx_L6:; } } /* "pygame_sdl2/render.pyx":344 * * cdef TextureNode tn * for x in self.nodes: # <<<<<<<<<<<<<< * tn = x * */ if (unlikely(__pyx_v_self->nodes == Py_None)) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable"); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 344; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } __pyx_t_2 = __pyx_v_self->nodes; __Pyx_INCREF(__pyx_t_2); __pyx_t_6 = 0; for (;;) { if (__pyx_t_6 >= PyList_GET_SIZE(__pyx_t_2)) break; #if CYTHON_COMPILING_IN_CPYTHON __pyx_t_1 = PyList_GET_ITEM(__pyx_t_2, __pyx_t_6); __Pyx_INCREF(__pyx_t_1); __pyx_t_6++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 344; __pyx_clineno = __LINE__; goto __pyx_L1_error;} #else __pyx_t_1 = PySequence_ITEM(__pyx_t_2, __pyx_t_6); __pyx_t_6++; if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 344; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); #endif __Pyx_XDECREF_SET(__pyx_v_x, __pyx_t_1); __pyx_t_1 = 0; /* "pygame_sdl2/render.pyx":345 * cdef TextureNode tn * for x in self.nodes: * tn = x # <<<<<<<<<<<<<< * * with nogil: */ __pyx_t_1 = __pyx_v_x; __Pyx_INCREF(__pyx_t_1); __Pyx_XDECREF_SET(__pyx_v_tn, ((struct __pyx_obj_11pygame_sdl2_6render_TextureNode *)__pyx_t_1)); __pyx_t_1 = 0; /* "pygame_sdl2/render.pyx":347 * tn = x * * with nogil: # <<<<<<<<<<<<<< * pivot.x = (self._scalex * (tn.source_w / 2 - tn.trimmed_rect.x)) * pivot.y = (self._scaley * (tn.source_h / 2 - tn.trimmed_rect.y)) */ { #ifdef WITH_THREAD PyThreadState *_save; Py_UNBLOCK_THREADS #endif /*try:*/ { /* "pygame_sdl2/render.pyx":348 * * with nogil: * pivot.x = (self._scalex * (tn.source_w / 2 - tn.trimmed_rect.x)) # <<<<<<<<<<<<<< * pivot.y = (self._scaley * (tn.source_h / 2 - tn.trimmed_rect.y)) * */ __pyx_v_pivot.x = ((int)(__pyx_v_self->_scalex * (__Pyx_div_long(__pyx_v_tn->source_w, 2) - __pyx_v_tn->trimmed_rect.x))); /* "pygame_sdl2/render.pyx":349 * with nogil: * pivot.x = (self._scalex * (tn.source_w / 2 - tn.trimmed_rect.x)) * pivot.y = (self._scaley * (tn.source_h / 2 - tn.trimmed_rect.y)) # <<<<<<<<<<<<<< * * self.adjust_rect(&dest_rect, &tn.trimmed_rect, &real_dest) */ __pyx_v_pivot.y = ((int)(__pyx_v_self->_scaley * (__Pyx_div_long(__pyx_v_tn->source_h, 2) - __pyx_v_tn->trimmed_rect.y))); /* "pygame_sdl2/render.pyx":351 * pivot.y = (self._scaley * (tn.source_h / 2 - tn.trimmed_rect.y)) * * self.adjust_rect(&dest_rect, &tn.trimmed_rect, &real_dest) # <<<<<<<<<<<<<< * * SDL_RenderCopyEx(tex.renderer, tex.texture, &tn.source_rect, */ ((struct __pyx_vtabstruct_11pygame_sdl2_6render_Sprite *)__pyx_v_self->__pyx_vtab)->adjust_rect(__pyx_v_self, (&__pyx_v_dest_rect), (&__pyx_v_tn->trimmed_rect), (&__pyx_v_real_dest)); /* "pygame_sdl2/render.pyx":353 * self.adjust_rect(&dest_rect, &tn.trimmed_rect, &real_dest) * * SDL_RenderCopyEx(tex.renderer, tex.texture, &tn.source_rect, # <<<<<<<<<<<<<< * &real_dest, self._rotation, &pivot, * self._flip) */ SDL_RenderCopyEx(__pyx_v_tex->renderer, __pyx_v_tex->texture, (&__pyx_v_tn->source_rect), (&__pyx_v_real_dest), __pyx_v_self->_rotation, (&__pyx_v_pivot), ((SDL_RendererFlip)__pyx_v_self->_flip)); } /* "pygame_sdl2/render.pyx":347 * tn = x * * with nogil: # <<<<<<<<<<<<<< * pivot.x = (self._scalex * (tn.source_w / 2 - tn.trimmed_rect.x)) * pivot.y = (self._scaley * (tn.source_h / 2 - tn.trimmed_rect.y)) */ /*finally:*/ { /*normal exit:*/{ #ifdef WITH_THREAD Py_BLOCK_THREADS #endif goto __pyx_L14; } __pyx_L14:; } } /* "pygame_sdl2/render.pyx":344 * * cdef TextureNode tn * for x in self.nodes: # <<<<<<<<<<<<<< * tn = x * */ } __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "pygame_sdl2/render.pyx":321 * rout.h = (self._scaley * rin.h) * * def render(self, dest=None): # <<<<<<<<<<<<<< * cdef Texture tex = (self.nodes[0]).texture * cdef SDL_Rect dest_rect */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_AddTraceback("pygame_sdl2.render.Sprite.render", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF((PyObject *)__pyx_v_tex); __Pyx_XDECREF((PyObject *)__pyx_v_tn); __Pyx_XDECREF(__pyx_v_x); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/render.pyx":357 * self._flip) * * def collides(self, Sprite other not None): # <<<<<<<<<<<<<< * cdef SDL_Rect r1, r2 * */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_6render_6Sprite_5collides(PyObject *__pyx_v_self, PyObject *__pyx_v_other); /*proto*/ static PyObject *__pyx_pw_11pygame_sdl2_6render_6Sprite_5collides(PyObject *__pyx_v_self, PyObject *__pyx_v_other) { CYTHON_UNUSED int __pyx_lineno = 0; CYTHON_UNUSED const char *__pyx_filename = NULL; CYTHON_UNUSED int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("collides (wrapper)", 0); if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_other), __pyx_ptype_11pygame_sdl2_6render_Sprite, 0, "other", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 357; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_r = __pyx_pf_11pygame_sdl2_6render_6Sprite_4collides(((struct __pyx_obj_11pygame_sdl2_6render_Sprite *)__pyx_v_self), ((struct __pyx_obj_11pygame_sdl2_6render_Sprite *)__pyx_v_other)); /* function exit code */ goto __pyx_L0; __pyx_L1_error:; __pyx_r = NULL; __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_6render_6Sprite_4collides(struct __pyx_obj_11pygame_sdl2_6render_Sprite *__pyx_v_self, struct __pyx_obj_11pygame_sdl2_6render_Sprite *__pyx_v_other) { SDL_Rect __pyx_v_r1; SDL_Rect __pyx_v_r2; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("collides", 0); /* "pygame_sdl2/render.pyx":360 * cdef SDL_Rect r1, r2 * * self.adjust_rect(&self._pos, &self.bounding_box, &r1) # <<<<<<<<<<<<<< * other.adjust_rect(&other._pos, &other.bounding_box, &r2) * */ ((struct __pyx_vtabstruct_11pygame_sdl2_6render_Sprite *)__pyx_v_self->__pyx_vtab)->adjust_rect(__pyx_v_self, (&__pyx_v_self->_pos), (&__pyx_v_self->bounding_box), (&__pyx_v_r1)); /* "pygame_sdl2/render.pyx":361 * * self.adjust_rect(&self._pos, &self.bounding_box, &r1) * other.adjust_rect(&other._pos, &other.bounding_box, &r2) # <<<<<<<<<<<<<< * * return SDL_HasIntersection(&r1, &r2) == SDL_TRUE */ ((struct __pyx_vtabstruct_11pygame_sdl2_6render_Sprite *)__pyx_v_other->__pyx_vtab)->adjust_rect(__pyx_v_other, (&__pyx_v_other->_pos), (&__pyx_v_other->bounding_box), (&__pyx_v_r2)); /* "pygame_sdl2/render.pyx":363 * other.adjust_rect(&other._pos, &other.bounding_box, &r2) * * return SDL_HasIntersection(&r1, &r2) == SDL_TRUE # <<<<<<<<<<<<<< * * property pos: */ __Pyx_XDECREF(__pyx_r); __pyx_t_1 = __Pyx_PyBool_FromLong((SDL_HasIntersection((&__pyx_v_r1), (&__pyx_v_r2)) == SDL_TRUE)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 363; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "pygame_sdl2/render.pyx":357 * self._flip) * * def collides(self, Sprite other not None): # <<<<<<<<<<<<<< * cdef SDL_Rect r1, r2 * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("pygame_sdl2.render.Sprite.collides", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/render.pyx":366 * * property pos: * def __get__(self): # <<<<<<<<<<<<<< * return self._pos.x, self._pos.y * */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_6render_6Sprite_3pos_1__get__(PyObject *__pyx_v_self); /*proto*/ static PyObject *__pyx_pw_11pygame_sdl2_6render_6Sprite_3pos_1__get__(PyObject *__pyx_v_self) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); __pyx_r = __pyx_pf_11pygame_sdl2_6render_6Sprite_3pos___get__(((struct __pyx_obj_11pygame_sdl2_6render_Sprite *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_6render_6Sprite_3pos___get__(struct __pyx_obj_11pygame_sdl2_6render_Sprite *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__get__", 0); /* "pygame_sdl2/render.pyx":367 * property pos: * def __get__(self): * return self._pos.x, self._pos.y # <<<<<<<<<<<<<< * * def __set__(self, val): */ __Pyx_XDECREF(__pyx_r); __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_self->_pos.x); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 367; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_v_self->_pos.y); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 367; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 367; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __Pyx_GIVEREF(__pyx_t_1); PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_1); __Pyx_GIVEREF(__pyx_t_2); PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_2); __pyx_t_1 = 0; __pyx_t_2 = 0; __pyx_r = __pyx_t_3; __pyx_t_3 = 0; goto __pyx_L0; /* "pygame_sdl2/render.pyx":366 * * property pos: * def __get__(self): # <<<<<<<<<<<<<< * return self._pos.x, self._pos.y * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("pygame_sdl2.render.Sprite.pos.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/render.pyx":369 * return self._pos.x, self._pos.y * * def __set__(self, val): # <<<<<<<<<<<<<< * self._pos.x = val[0] * self._pos.y = val[1] */ /* Python wrapper */ static int __pyx_pw_11pygame_sdl2_6render_6Sprite_3pos_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_val); /*proto*/ static int __pyx_pw_11pygame_sdl2_6render_6Sprite_3pos_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_val) { int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__set__ (wrapper)", 0); __pyx_r = __pyx_pf_11pygame_sdl2_6render_6Sprite_3pos_2__set__(((struct __pyx_obj_11pygame_sdl2_6render_Sprite *)__pyx_v_self), ((PyObject *)__pyx_v_val)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static int __pyx_pf_11pygame_sdl2_6render_6Sprite_3pos_2__set__(struct __pyx_obj_11pygame_sdl2_6render_Sprite *__pyx_v_self, PyObject *__pyx_v_val) { int __pyx_r; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_t_2; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__set__", 0); /* "pygame_sdl2/render.pyx":370 * * def __set__(self, val): * self._pos.x = val[0] # <<<<<<<<<<<<<< * self._pos.y = val[1] * */ __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_val, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(__pyx_t_1 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 370; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = __Pyx_PyInt_As_int(__pyx_t_1); if (unlikely((__pyx_t_2 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 370; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_v_self->_pos.x = __pyx_t_2; /* "pygame_sdl2/render.pyx":371 * def __set__(self, val): * self._pos.x = val[0] * self._pos.y = val[1] # <<<<<<<<<<<<<< * * property color: */ __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_val, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(__pyx_t_1 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 371; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = __Pyx_PyInt_As_int(__pyx_t_1); if (unlikely((__pyx_t_2 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 371; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_v_self->_pos.y = __pyx_t_2; /* "pygame_sdl2/render.pyx":369 * return self._pos.x, self._pos.y * * def __set__(self, val): # <<<<<<<<<<<<<< * self._pos.x = val[0] * self._pos.y = val[1] */ /* function exit code */ __pyx_r = 0; goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("pygame_sdl2.render.Sprite.pos.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = -1; __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/render.pyx":374 * * property color: * def __set__(self, val): # <<<<<<<<<<<<<< * if not isinstance(val, Color): * val = Color(val) */ /* Python wrapper */ static int __pyx_pw_11pygame_sdl2_6render_6Sprite_5color_1__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_val); /*proto*/ static int __pyx_pw_11pygame_sdl2_6render_6Sprite_5color_1__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_val) { int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__set__ (wrapper)", 0); __pyx_r = __pyx_pf_11pygame_sdl2_6render_6Sprite_5color___set__(((struct __pyx_obj_11pygame_sdl2_6render_Sprite *)__pyx_v_self), ((PyObject *)__pyx_v_val)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static int __pyx_pf_11pygame_sdl2_6render_6Sprite_5color___set__(struct __pyx_obj_11pygame_sdl2_6render_Sprite *__pyx_v_self, PyObject *__pyx_v_val) { int __pyx_r; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_t_2; int __pyx_t_3; PyObject *__pyx_t_4 = NULL; PyObject *__pyx_t_5 = NULL; PyObject *__pyx_t_6 = NULL; Uint8 __pyx_t_7; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__set__", 0); __Pyx_INCREF(__pyx_v_val); /* "pygame_sdl2/render.pyx":375 * property color: * def __set__(self, val): * if not isinstance(val, Color): # <<<<<<<<<<<<<< * val = Color(val) * */ __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_Color); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 375; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = PyObject_IsInstance(__pyx_v_val, __pyx_t_1); if (unlikely(__pyx_t_2 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 375; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_3 = ((!(__pyx_t_2 != 0)) != 0); if (__pyx_t_3) { /* "pygame_sdl2/render.pyx":376 * def __set__(self, val): * if not isinstance(val, Color): * val = Color(val) # <<<<<<<<<<<<<< * * self._color.r = val.r */ __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_Color); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 376; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); __pyx_t_5 = NULL; if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_4))) { __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4); if (likely(__pyx_t_5)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4); __Pyx_INCREF(__pyx_t_5); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_4, function); } } if (!__pyx_t_5) { __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_v_val); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 376; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); } else { __pyx_t_6 = PyTuple_New(1+1); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 376; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_6); __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_5); __pyx_t_5 = NULL; __Pyx_INCREF(__pyx_v_val); __Pyx_GIVEREF(__pyx_v_val); PyTuple_SET_ITEM(__pyx_t_6, 0+1, __pyx_v_val); __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_6, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 376; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; } __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF_SET(__pyx_v_val, __pyx_t_1); __pyx_t_1 = 0; /* "pygame_sdl2/render.pyx":375 * property color: * def __set__(self, val): * if not isinstance(val, Color): # <<<<<<<<<<<<<< * val = Color(val) * */ } /* "pygame_sdl2/render.pyx":378 * val = Color(val) * * self._color.r = val.r # <<<<<<<<<<<<<< * self._color.g = val.g * self._color.b = val.b */ __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_val, __pyx_n_s_r); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 378; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_t_7 = __Pyx_PyInt_As_uint8_t(__pyx_t_1); if (unlikely((__pyx_t_7 == (Uint8)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 378; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_v_self->_color.r = __pyx_t_7; /* "pygame_sdl2/render.pyx":379 * * self._color.r = val.r * self._color.g = val.g # <<<<<<<<<<<<<< * self._color.b = val.b * self._color.a = val.a */ __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_val, __pyx_n_s_g); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 379; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_t_7 = __Pyx_PyInt_As_uint8_t(__pyx_t_1); if (unlikely((__pyx_t_7 == (Uint8)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 379; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_v_self->_color.g = __pyx_t_7; /* "pygame_sdl2/render.pyx":380 * self._color.r = val.r * self._color.g = val.g * self._color.b = val.b # <<<<<<<<<<<<<< * self._color.a = val.a * */ __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_val, __pyx_n_s_b); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 380; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_t_7 = __Pyx_PyInt_As_uint8_t(__pyx_t_1); if (unlikely((__pyx_t_7 == (Uint8)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 380; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_v_self->_color.b = __pyx_t_7; /* "pygame_sdl2/render.pyx":381 * self._color.g = val.g * self._color.b = val.b * self._color.a = val.a # <<<<<<<<<<<<<< * * property alpha: */ __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_val, __pyx_n_s_a); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 381; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_t_7 = __Pyx_PyInt_As_uint8_t(__pyx_t_1); if (unlikely((__pyx_t_7 == (Uint8)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 381; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_v_self->_color.a = __pyx_t_7; /* "pygame_sdl2/render.pyx":374 * * property color: * def __set__(self, val): # <<<<<<<<<<<<<< * if not isinstance(val, Color): * val = Color(val) */ /* function exit code */ __pyx_r = 0; goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_5); __Pyx_XDECREF(__pyx_t_6); __Pyx_AddTraceback("pygame_sdl2.render.Sprite.color.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = -1; __pyx_L0:; __Pyx_XDECREF(__pyx_v_val); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/render.pyx":384 * * property alpha: * def __get__(self): # <<<<<<<<<<<<<< * return self._color.a * */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_6render_6Sprite_5alpha_1__get__(PyObject *__pyx_v_self); /*proto*/ static PyObject *__pyx_pw_11pygame_sdl2_6render_6Sprite_5alpha_1__get__(PyObject *__pyx_v_self) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); __pyx_r = __pyx_pf_11pygame_sdl2_6render_6Sprite_5alpha___get__(((struct __pyx_obj_11pygame_sdl2_6render_Sprite *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_6render_6Sprite_5alpha___get__(struct __pyx_obj_11pygame_sdl2_6render_Sprite *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__get__", 0); /* "pygame_sdl2/render.pyx":385 * property alpha: * def __get__(self): * return self._color.a # <<<<<<<<<<<<<< * * def __set__(self, val): */ __Pyx_XDECREF(__pyx_r); __pyx_t_1 = __Pyx_PyInt_From_uint8_t(__pyx_v_self->_color.a); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 385; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "pygame_sdl2/render.pyx":384 * * property alpha: * def __get__(self): # <<<<<<<<<<<<<< * return self._color.a * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("pygame_sdl2.render.Sprite.alpha.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/render.pyx":387 * return self._color.a * * def __set__(self, val): # <<<<<<<<<<<<<< * self._color.a = val * */ /* Python wrapper */ static int __pyx_pw_11pygame_sdl2_6render_6Sprite_5alpha_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_val); /*proto*/ static int __pyx_pw_11pygame_sdl2_6render_6Sprite_5alpha_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_val) { int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__set__ (wrapper)", 0); __pyx_r = __pyx_pf_11pygame_sdl2_6render_6Sprite_5alpha_2__set__(((struct __pyx_obj_11pygame_sdl2_6render_Sprite *)__pyx_v_self), ((PyObject *)__pyx_v_val)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static int __pyx_pf_11pygame_sdl2_6render_6Sprite_5alpha_2__set__(struct __pyx_obj_11pygame_sdl2_6render_Sprite *__pyx_v_self, PyObject *__pyx_v_val) { int __pyx_r; __Pyx_RefNannyDeclarations Uint8 __pyx_t_1; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__set__", 0); /* "pygame_sdl2/render.pyx":388 * * def __set__(self, val): * self._color.a = val # <<<<<<<<<<<<<< * * property rotation: */ __pyx_t_1 = __Pyx_PyInt_As_uint8_t(__pyx_v_val); if (unlikely((__pyx_t_1 == (Uint8)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 388; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_v_self->_color.a = __pyx_t_1; /* "pygame_sdl2/render.pyx":387 * return self._color.a * * def __set__(self, val): # <<<<<<<<<<<<<< * self._color.a = val * */ /* function exit code */ __pyx_r = 0; goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("pygame_sdl2.render.Sprite.alpha.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = -1; __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/render.pyx":391 * * property rotation: * def __get__(self): # <<<<<<<<<<<<<< * return self._rotation * */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_6render_6Sprite_8rotation_1__get__(PyObject *__pyx_v_self); /*proto*/ static PyObject *__pyx_pw_11pygame_sdl2_6render_6Sprite_8rotation_1__get__(PyObject *__pyx_v_self) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); __pyx_r = __pyx_pf_11pygame_sdl2_6render_6Sprite_8rotation___get__(((struct __pyx_obj_11pygame_sdl2_6render_Sprite *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_6render_6Sprite_8rotation___get__(struct __pyx_obj_11pygame_sdl2_6render_Sprite *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__get__", 0); /* "pygame_sdl2/render.pyx":392 * property rotation: * def __get__(self): * return self._rotation # <<<<<<<<<<<<<< * * def __set__(self, val): */ __Pyx_XDECREF(__pyx_r); __pyx_t_1 = PyFloat_FromDouble(__pyx_v_self->_rotation); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 392; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "pygame_sdl2/render.pyx":391 * * property rotation: * def __get__(self): # <<<<<<<<<<<<<< * return self._rotation * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("pygame_sdl2.render.Sprite.rotation.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/render.pyx":394 * return self._rotation * * def __set__(self, val): # <<<<<<<<<<<<<< * self._rotation = val * */ /* Python wrapper */ static int __pyx_pw_11pygame_sdl2_6render_6Sprite_8rotation_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_val); /*proto*/ static int __pyx_pw_11pygame_sdl2_6render_6Sprite_8rotation_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_val) { int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__set__ (wrapper)", 0); __pyx_r = __pyx_pf_11pygame_sdl2_6render_6Sprite_8rotation_2__set__(((struct __pyx_obj_11pygame_sdl2_6render_Sprite *)__pyx_v_self), ((PyObject *)__pyx_v_val)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static int __pyx_pf_11pygame_sdl2_6render_6Sprite_8rotation_2__set__(struct __pyx_obj_11pygame_sdl2_6render_Sprite *__pyx_v_self, PyObject *__pyx_v_val) { int __pyx_r; __Pyx_RefNannyDeclarations double __pyx_t_1; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__set__", 0); /* "pygame_sdl2/render.pyx":395 * * def __set__(self, val): * self._rotation = val # <<<<<<<<<<<<<< * * property scale: */ __pyx_t_1 = __pyx_PyFloat_AsDouble(__pyx_v_val); if (unlikely((__pyx_t_1 == (double)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 395; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_v_self->_rotation = __pyx_t_1; /* "pygame_sdl2/render.pyx":394 * return self._rotation * * def __set__(self, val): # <<<<<<<<<<<<<< * self._rotation = val * */ /* function exit code */ __pyx_r = 0; goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("pygame_sdl2.render.Sprite.rotation.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = -1; __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/render.pyx":398 * * property scale: * def __get__(self): # <<<<<<<<<<<<<< * if self._scalex == self._scaley: * return self._scalex */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_6render_6Sprite_5scale_1__get__(PyObject *__pyx_v_self); /*proto*/ static PyObject *__pyx_pw_11pygame_sdl2_6render_6Sprite_5scale_1__get__(PyObject *__pyx_v_self) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); __pyx_r = __pyx_pf_11pygame_sdl2_6render_6Sprite_5scale___get__(((struct __pyx_obj_11pygame_sdl2_6render_Sprite *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_6render_6Sprite_5scale___get__(struct __pyx_obj_11pygame_sdl2_6render_Sprite *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__get__", 0); /* "pygame_sdl2/render.pyx":399 * property scale: * def __get__(self): * if self._scalex == self._scaley: # <<<<<<<<<<<<<< * return self._scalex * else: */ __pyx_t_1 = ((__pyx_v_self->_scalex == __pyx_v_self->_scaley) != 0); if (__pyx_t_1) { /* "pygame_sdl2/render.pyx":400 * def __get__(self): * if self._scalex == self._scaley: * return self._scalex # <<<<<<<<<<<<<< * else: * return self._scalex, self._scaley */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = PyFloat_FromDouble(__pyx_v_self->_scalex); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 400; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; /* "pygame_sdl2/render.pyx":399 * property scale: * def __get__(self): * if self._scalex == self._scaley: # <<<<<<<<<<<<<< * return self._scalex * else: */ } /* "pygame_sdl2/render.pyx":402 * return self._scalex * else: * return self._scalex, self._scaley # <<<<<<<<<<<<<< * * def __set__(self, arg): */ /*else*/ { __Pyx_XDECREF(__pyx_r); __pyx_t_2 = PyFloat_FromDouble(__pyx_v_self->_scalex); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 402; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = PyFloat_FromDouble(__pyx_v_self->_scaley); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 402; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 402; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); __Pyx_GIVEREF(__pyx_t_2); PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_2); __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_3); __pyx_t_2 = 0; __pyx_t_3 = 0; __pyx_r = __pyx_t_4; __pyx_t_4 = 0; goto __pyx_L0; } /* "pygame_sdl2/render.pyx":398 * * property scale: * def __get__(self): # <<<<<<<<<<<<<< * if self._scalex == self._scaley: * return self._scalex */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_AddTraceback("pygame_sdl2.render.Sprite.scale.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/render.pyx":404 * return self._scalex, self._scaley * * def __set__(self, arg): # <<<<<<<<<<<<<< * if type(arg) == tuple: * x, y = arg */ /* Python wrapper */ static int __pyx_pw_11pygame_sdl2_6render_6Sprite_5scale_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_arg); /*proto*/ static int __pyx_pw_11pygame_sdl2_6render_6Sprite_5scale_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_arg) { int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__set__ (wrapper)", 0); __pyx_r = __pyx_pf_11pygame_sdl2_6render_6Sprite_5scale_2__set__(((struct __pyx_obj_11pygame_sdl2_6render_Sprite *)__pyx_v_self), ((PyObject *)__pyx_v_arg)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static int __pyx_pf_11pygame_sdl2_6render_6Sprite_5scale_2__set__(struct __pyx_obj_11pygame_sdl2_6render_Sprite *__pyx_v_self, PyObject *__pyx_v_arg) { PyObject *__pyx_v_x = NULL; PyObject *__pyx_v_y = NULL; int __pyx_r; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_t_2; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; PyObject *(*__pyx_t_5)(PyObject *); double __pyx_t_6; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__set__", 0); /* "pygame_sdl2/render.pyx":405 * * def __set__(self, arg): * if type(arg) == tuple: # <<<<<<<<<<<<<< * x, y = arg * else: */ __pyx_t_1 = PyObject_RichCompare(((PyObject *)Py_TYPE(__pyx_v_arg)), ((PyObject *)(&PyTuple_Type)), Py_EQ); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 405; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 405; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (__pyx_t_2) { /* "pygame_sdl2/render.pyx":406 * def __set__(self, arg): * if type(arg) == tuple: * x, y = arg # <<<<<<<<<<<<<< * else: * x = y = arg */ if ((likely(PyTuple_CheckExact(__pyx_v_arg))) || (PyList_CheckExact(__pyx_v_arg))) { PyObject* sequence = __pyx_v_arg; #if CYTHON_COMPILING_IN_CPYTHON Py_ssize_t size = Py_SIZE(sequence); #else Py_ssize_t size = PySequence_Size(sequence); #endif if (unlikely(size != 2)) { if (size > 2) __Pyx_RaiseTooManyValuesError(2); else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 406; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } #if CYTHON_COMPILING_IN_CPYTHON if (likely(PyTuple_CheckExact(sequence))) { __pyx_t_1 = PyTuple_GET_ITEM(sequence, 0); __pyx_t_3 = PyTuple_GET_ITEM(sequence, 1); } else { __pyx_t_1 = PyList_GET_ITEM(sequence, 0); __pyx_t_3 = PyList_GET_ITEM(sequence, 1); } __Pyx_INCREF(__pyx_t_1); __Pyx_INCREF(__pyx_t_3); #else __pyx_t_1 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 406; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_t_3 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 406; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); #endif } else { Py_ssize_t index = -1; __pyx_t_4 = PyObject_GetIter(__pyx_v_arg); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 406; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); __pyx_t_5 = Py_TYPE(__pyx_t_4)->tp_iternext; index = 0; __pyx_t_1 = __pyx_t_5(__pyx_t_4); if (unlikely(!__pyx_t_1)) goto __pyx_L4_unpacking_failed; __Pyx_GOTREF(__pyx_t_1); index = 1; __pyx_t_3 = __pyx_t_5(__pyx_t_4); if (unlikely(!__pyx_t_3)) goto __pyx_L4_unpacking_failed; __Pyx_GOTREF(__pyx_t_3); if (__Pyx_IternextUnpackEndCheck(__pyx_t_5(__pyx_t_4), 2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 406; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_t_5 = NULL; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; goto __pyx_L5_unpacking_done; __pyx_L4_unpacking_failed:; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_t_5 = NULL; if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 406; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_L5_unpacking_done:; } __pyx_v_x = __pyx_t_1; __pyx_t_1 = 0; __pyx_v_y = __pyx_t_3; __pyx_t_3 = 0; /* "pygame_sdl2/render.pyx":405 * * def __set__(self, arg): * if type(arg) == tuple: # <<<<<<<<<<<<<< * x, y = arg * else: */ goto __pyx_L3; } /* "pygame_sdl2/render.pyx":408 * x, y = arg * else: * x = y = arg # <<<<<<<<<<<<<< * * self._scalex = x */ /*else*/ { __Pyx_INCREF(__pyx_v_arg); __pyx_v_x = __pyx_v_arg; __Pyx_INCREF(__pyx_v_arg); __pyx_v_y = __pyx_v_arg; } __pyx_L3:; /* "pygame_sdl2/render.pyx":410 * x = y = arg * * self._scalex = x # <<<<<<<<<<<<<< * self._scaley = y * */ __pyx_t_6 = __pyx_PyFloat_AsDouble(__pyx_v_x); if (unlikely((__pyx_t_6 == (double)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 410; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_v_self->_scalex = __pyx_t_6; /* "pygame_sdl2/render.pyx":411 * * self._scalex = x * self._scaley = y # <<<<<<<<<<<<<< * * property hflip: */ __pyx_t_6 = __pyx_PyFloat_AsDouble(__pyx_v_y); if (unlikely((__pyx_t_6 == (double)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 411; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_v_self->_scaley = __pyx_t_6; /* "pygame_sdl2/render.pyx":404 * return self._scalex, self._scaley * * def __set__(self, arg): # <<<<<<<<<<<<<< * if type(arg) == tuple: * x, y = arg */ /* function exit code */ __pyx_r = 0; goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_AddTraceback("pygame_sdl2.render.Sprite.scale.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = -1; __pyx_L0:; __Pyx_XDECREF(__pyx_v_x); __Pyx_XDECREF(__pyx_v_y); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/render.pyx":414 * * property hflip: * def __get__(self): # <<<<<<<<<<<<<< * return self._flip & SDL_FLIP_HORIZONTAL * */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_6render_6Sprite_5hflip_1__get__(PyObject *__pyx_v_self); /*proto*/ static PyObject *__pyx_pw_11pygame_sdl2_6render_6Sprite_5hflip_1__get__(PyObject *__pyx_v_self) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); __pyx_r = __pyx_pf_11pygame_sdl2_6render_6Sprite_5hflip___get__(((struct __pyx_obj_11pygame_sdl2_6render_Sprite *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_6render_6Sprite_5hflip___get__(struct __pyx_obj_11pygame_sdl2_6render_Sprite *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__get__", 0); /* "pygame_sdl2/render.pyx":415 * property hflip: * def __get__(self): * return self._flip & SDL_FLIP_HORIZONTAL # <<<<<<<<<<<<<< * * def __set__(self, val): */ __Pyx_XDECREF(__pyx_r); __pyx_t_1 = __Pyx_PyInt_From_int((__pyx_v_self->_flip & SDL_FLIP_HORIZONTAL)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 415; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "pygame_sdl2/render.pyx":414 * * property hflip: * def __get__(self): # <<<<<<<<<<<<<< * return self._flip & SDL_FLIP_HORIZONTAL * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("pygame_sdl2.render.Sprite.hflip.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/render.pyx":417 * return self._flip & SDL_FLIP_HORIZONTAL * * def __set__(self, val): # <<<<<<<<<<<<<< * if val: * self._flip |= SDL_FLIP_HORIZONTAL */ /* Python wrapper */ static int __pyx_pw_11pygame_sdl2_6render_6Sprite_5hflip_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_val); /*proto*/ static int __pyx_pw_11pygame_sdl2_6render_6Sprite_5hflip_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_val) { int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__set__ (wrapper)", 0); __pyx_r = __pyx_pf_11pygame_sdl2_6render_6Sprite_5hflip_2__set__(((struct __pyx_obj_11pygame_sdl2_6render_Sprite *)__pyx_v_self), ((PyObject *)__pyx_v_val)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static int __pyx_pf_11pygame_sdl2_6render_6Sprite_5hflip_2__set__(struct __pyx_obj_11pygame_sdl2_6render_Sprite *__pyx_v_self, PyObject *__pyx_v_val) { int __pyx_r; __Pyx_RefNannyDeclarations int __pyx_t_1; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__set__", 0); /* "pygame_sdl2/render.pyx":418 * * def __set__(self, val): * if val: # <<<<<<<<<<<<<< * self._flip |= SDL_FLIP_HORIZONTAL * else: */ __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_val); if (unlikely(__pyx_t_1 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 418; __pyx_clineno = __LINE__; goto __pyx_L1_error;} if (__pyx_t_1) { /* "pygame_sdl2/render.pyx":419 * def __set__(self, val): * if val: * self._flip |= SDL_FLIP_HORIZONTAL # <<<<<<<<<<<<<< * else: * self._flip &= ~SDL_FLIP_HORIZONTAL */ __pyx_v_self->_flip = (__pyx_v_self->_flip | SDL_FLIP_HORIZONTAL); /* "pygame_sdl2/render.pyx":418 * * def __set__(self, val): * if val: # <<<<<<<<<<<<<< * self._flip |= SDL_FLIP_HORIZONTAL * else: */ goto __pyx_L3; } /* "pygame_sdl2/render.pyx":421 * self._flip |= SDL_FLIP_HORIZONTAL * else: * self._flip &= ~SDL_FLIP_HORIZONTAL # <<<<<<<<<<<<<< * * property vflip: */ /*else*/ { __pyx_v_self->_flip = (__pyx_v_self->_flip & (~SDL_FLIP_HORIZONTAL)); } __pyx_L3:; /* "pygame_sdl2/render.pyx":417 * return self._flip & SDL_FLIP_HORIZONTAL * * def __set__(self, val): # <<<<<<<<<<<<<< * if val: * self._flip |= SDL_FLIP_HORIZONTAL */ /* function exit code */ __pyx_r = 0; goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("pygame_sdl2.render.Sprite.hflip.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = -1; __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/render.pyx":424 * * property vflip: * def __get__(self): # <<<<<<<<<<<<<< * return self._flip & SDL_FLIP_VERTICAL * */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_6render_6Sprite_5vflip_1__get__(PyObject *__pyx_v_self); /*proto*/ static PyObject *__pyx_pw_11pygame_sdl2_6render_6Sprite_5vflip_1__get__(PyObject *__pyx_v_self) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); __pyx_r = __pyx_pf_11pygame_sdl2_6render_6Sprite_5vflip___get__(((struct __pyx_obj_11pygame_sdl2_6render_Sprite *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_6render_6Sprite_5vflip___get__(struct __pyx_obj_11pygame_sdl2_6render_Sprite *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__get__", 0); /* "pygame_sdl2/render.pyx":425 * property vflip: * def __get__(self): * return self._flip & SDL_FLIP_VERTICAL # <<<<<<<<<<<<<< * * def __set__(self, val): */ __Pyx_XDECREF(__pyx_r); __pyx_t_1 = __Pyx_PyInt_From_int((__pyx_v_self->_flip & SDL_FLIP_VERTICAL)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 425; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "pygame_sdl2/render.pyx":424 * * property vflip: * def __get__(self): # <<<<<<<<<<<<<< * return self._flip & SDL_FLIP_VERTICAL * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("pygame_sdl2.render.Sprite.vflip.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/render.pyx":427 * return self._flip & SDL_FLIP_VERTICAL * * def __set__(self, val): # <<<<<<<<<<<<<< * if val: * self._flip |= SDL_FLIP_VERTICAL */ /* Python wrapper */ static int __pyx_pw_11pygame_sdl2_6render_6Sprite_5vflip_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_val); /*proto*/ static int __pyx_pw_11pygame_sdl2_6render_6Sprite_5vflip_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_val) { int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__set__ (wrapper)", 0); __pyx_r = __pyx_pf_11pygame_sdl2_6render_6Sprite_5vflip_2__set__(((struct __pyx_obj_11pygame_sdl2_6render_Sprite *)__pyx_v_self), ((PyObject *)__pyx_v_val)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static int __pyx_pf_11pygame_sdl2_6render_6Sprite_5vflip_2__set__(struct __pyx_obj_11pygame_sdl2_6render_Sprite *__pyx_v_self, PyObject *__pyx_v_val) { int __pyx_r; __Pyx_RefNannyDeclarations int __pyx_t_1; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__set__", 0); /* "pygame_sdl2/render.pyx":428 * * def __set__(self, val): * if val: # <<<<<<<<<<<<<< * self._flip |= SDL_FLIP_VERTICAL * else: */ __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_val); if (unlikely(__pyx_t_1 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 428; __pyx_clineno = __LINE__; goto __pyx_L1_error;} if (__pyx_t_1) { /* "pygame_sdl2/render.pyx":429 * def __set__(self, val): * if val: * self._flip |= SDL_FLIP_VERTICAL # <<<<<<<<<<<<<< * else: * self._flip &= ~SDL_FLIP_VERTICAL */ __pyx_v_self->_flip = (__pyx_v_self->_flip | SDL_FLIP_VERTICAL); /* "pygame_sdl2/render.pyx":428 * * def __set__(self, val): * if val: # <<<<<<<<<<<<<< * self._flip |= SDL_FLIP_VERTICAL * else: */ goto __pyx_L3; } /* "pygame_sdl2/render.pyx":431 * self._flip |= SDL_FLIP_VERTICAL * else: * self._flip &= ~SDL_FLIP_VERTICAL # <<<<<<<<<<<<<< * * */ /*else*/ { __pyx_v_self->_flip = (__pyx_v_self->_flip & (~SDL_FLIP_VERTICAL)); } __pyx_L3:; /* "pygame_sdl2/render.pyx":427 * return self._flip & SDL_FLIP_VERTICAL * * def __set__(self, val): # <<<<<<<<<<<<<< * if val: * self._flip |= SDL_FLIP_VERTICAL */ /* function exit code */ __pyx_r = 0; goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("pygame_sdl2.render.Sprite.vflip.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = -1; __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/render.pyx":440 * cdef list sprites * * def __init__(self, rect): # <<<<<<<<<<<<<< * """ Parameter may be a position (no clipping) or a rect (clipped). """ * */ /* Python wrapper */ static int __pyx_pw_11pygame_sdl2_6render_9Container_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_11pygame_sdl2_6render_9Container___init__[] = " Parameter may be a position (no clipping) or a rect (clipped). "; #if CYTHON_COMPILING_IN_CPYTHON struct wrapperbase __pyx_wrapperbase_11pygame_sdl2_6render_9Container___init__; #endif static int __pyx_pw_11pygame_sdl2_6render_9Container_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_rect = 0; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__init__ (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_rect,0}; PyObject* values[1] = {0}; if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_rect)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__init__") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 440; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } } else if (PyTuple_GET_SIZE(__pyx_args) != 1) { goto __pyx_L5_argtuple_error; } else { values[0] = PyTuple_GET_ITEM(__pyx_args, 0); } __pyx_v_rect = values[0]; } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("__init__", 1, 1, 1, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 440; __pyx_clineno = __LINE__; goto __pyx_L3_error;} __pyx_L3_error:; __Pyx_AddTraceback("pygame_sdl2.render.Container.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return -1; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_11pygame_sdl2_6render_9Container___init__(((struct __pyx_obj_11pygame_sdl2_6render_Container *)__pyx_v_self), __pyx_v_rect); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static int __pyx_pf_11pygame_sdl2_6render_9Container___init__(struct __pyx_obj_11pygame_sdl2_6render_Container *__pyx_v_self, PyObject *__pyx_v_rect) { int __pyx_r; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_t_2; Py_ssize_t __pyx_t_3; int __pyx_t_4; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__init__", 0); /* "pygame_sdl2/render.pyx":443 * """ Parameter may be a position (no clipping) or a rect (clipped). """ * * self.sprites = [] # <<<<<<<<<<<<<< * to_sdl_rect(rect, &self._rect) * if len(rect) == 2: */ __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 443; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __Pyx_GIVEREF(__pyx_t_1); __Pyx_GOTREF(__pyx_v_self->sprites); __Pyx_DECREF(__pyx_v_self->sprites); __pyx_v_self->sprites = ((PyObject*)__pyx_t_1); __pyx_t_1 = 0; /* "pygame_sdl2/render.pyx":444 * * self.sprites = [] * to_sdl_rect(rect, &self._rect) # <<<<<<<<<<<<<< * if len(rect) == 2: * self._rect.w = self._rect.h = 0 */ __pyx_t_2 = __pyx_f_11pygame_sdl2_4rect_to_sdl_rect(__pyx_v_rect, (&__pyx_v_self->_rect), NULL); if (unlikely(__pyx_t_2 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 444; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "pygame_sdl2/render.pyx":445 * self.sprites = [] * to_sdl_rect(rect, &self._rect) * if len(rect) == 2: # <<<<<<<<<<<<<< * self._rect.w = self._rect.h = 0 * */ __pyx_t_3 = PyObject_Length(__pyx_v_rect); if (unlikely(__pyx_t_3 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 445; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_t_4 = ((__pyx_t_3 == 2) != 0); if (__pyx_t_4) { /* "pygame_sdl2/render.pyx":446 * to_sdl_rect(rect, &self._rect) * if len(rect) == 2: * self._rect.w = self._rect.h = 0 # <<<<<<<<<<<<<< * * def add(self, Sprite sprite not None): */ __pyx_v_self->_rect.w = 0; __pyx_v_self->_rect.h = 0; /* "pygame_sdl2/render.pyx":445 * self.sprites = [] * to_sdl_rect(rect, &self._rect) * if len(rect) == 2: # <<<<<<<<<<<<<< * self._rect.w = self._rect.h = 0 * */ } /* "pygame_sdl2/render.pyx":440 * cdef list sprites * * def __init__(self, rect): # <<<<<<<<<<<<<< * """ Parameter may be a position (no clipping) or a rect (clipped). """ * */ /* function exit code */ __pyx_r = 0; goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("pygame_sdl2.render.Container.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = -1; __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/render.pyx":448 * self._rect.w = self._rect.h = 0 * * def add(self, Sprite sprite not None): # <<<<<<<<<<<<<< * self.sprites.append(sprite) * */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_6render_9Container_3add(PyObject *__pyx_v_self, PyObject *__pyx_v_sprite); /*proto*/ static PyObject *__pyx_pw_11pygame_sdl2_6render_9Container_3add(PyObject *__pyx_v_self, PyObject *__pyx_v_sprite) { CYTHON_UNUSED int __pyx_lineno = 0; CYTHON_UNUSED const char *__pyx_filename = NULL; CYTHON_UNUSED int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("add (wrapper)", 0); if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_sprite), __pyx_ptype_11pygame_sdl2_6render_Sprite, 0, "sprite", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 448; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_r = __pyx_pf_11pygame_sdl2_6render_9Container_2add(((struct __pyx_obj_11pygame_sdl2_6render_Container *)__pyx_v_self), ((struct __pyx_obj_11pygame_sdl2_6render_Sprite *)__pyx_v_sprite)); /* function exit code */ goto __pyx_L0; __pyx_L1_error:; __pyx_r = NULL; __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_6render_9Container_2add(struct __pyx_obj_11pygame_sdl2_6render_Container *__pyx_v_self, struct __pyx_obj_11pygame_sdl2_6render_Sprite *__pyx_v_sprite) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("add", 0); /* "pygame_sdl2/render.pyx":449 * * def add(self, Sprite sprite not None): * self.sprites.append(sprite) # <<<<<<<<<<<<<< * * def render(self, dest=None): */ if (unlikely(__pyx_v_self->sprites == Py_None)) { PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%s'", "append"); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 449; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } __pyx_t_1 = __Pyx_PyList_Append(__pyx_v_self->sprites, ((PyObject *)__pyx_v_sprite)); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 449; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "pygame_sdl2/render.pyx":448 * self._rect.w = self._rect.h = 0 * * def add(self, Sprite sprite not None): # <<<<<<<<<<<<<< * self.sprites.append(sprite) * */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("pygame_sdl2.render.Container.add", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/render.pyx":451 * self.sprites.append(sprite) * * def render(self, dest=None): # <<<<<<<<<<<<<< * # TODO: Something other than this to get the SDL_Renderer. * cdef SDL_Renderer *ren = ((self.sprites[0]).nodes[0]).texture.renderer */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_6render_9Container_5render(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static PyObject *__pyx_pw_11pygame_sdl2_6render_9Container_5render(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { CYTHON_UNUSED PyObject *__pyx_v_dest = 0; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("render (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_dest,0}; PyObject* values[1] = {0}; values[0] = ((PyObject *)Py_None); if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (kw_args > 0) { PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_dest); if (value) { values[0] = value; kw_args--; } } } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "render") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 451; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } } else { switch (PyTuple_GET_SIZE(__pyx_args)) { case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); case 0: break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_dest = values[0]; } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("render", 0, 0, 1, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 451; __pyx_clineno = __LINE__; goto __pyx_L3_error;} __pyx_L3_error:; __Pyx_AddTraceback("pygame_sdl2.render.Container.render", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_11pygame_sdl2_6render_9Container_4render(((struct __pyx_obj_11pygame_sdl2_6render_Container *)__pyx_v_self), __pyx_v_dest); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_6render_9Container_4render(struct __pyx_obj_11pygame_sdl2_6render_Container *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v_dest) { SDL_Renderer *__pyx_v_ren; PyObject *__pyx_v_s = NULL; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; SDL_Renderer *__pyx_t_3; int __pyx_t_4; int __pyx_t_5; Py_ssize_t __pyx_t_6; PyObject *__pyx_t_7 = NULL; PyObject *__pyx_t_8 = NULL; PyObject *__pyx_t_9 = NULL; PyObject *__pyx_t_10 = NULL; PyObject *__pyx_t_11 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("render", 0); /* "pygame_sdl2/render.pyx":453 * def render(self, dest=None): * # TODO: Something other than this to get the SDL_Renderer. * cdef SDL_Renderer *ren = ((self.sprites[0]).nodes[0]).texture.renderer # <<<<<<<<<<<<<< * * if self._rect.w != 0 and self._rect.h != 0: */ if (unlikely(__pyx_v_self->sprites == Py_None)) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 453; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } __pyx_t_1 = __Pyx_GetItemInt_List(__pyx_v_self->sprites, 0, long, 1, __Pyx_PyInt_From_long, 1, 0, 1); if (unlikely(__pyx_t_1 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 453; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; __Pyx_GOTREF(__pyx_t_1); if (unlikely(((struct __pyx_obj_11pygame_sdl2_6render_Sprite *)__pyx_t_1)->nodes == Py_None)) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 453; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } __pyx_t_2 = __Pyx_GetItemInt_List(((struct __pyx_obj_11pygame_sdl2_6render_Sprite *)__pyx_t_1)->nodes, 0, long, 1, __Pyx_PyInt_From_long, 1, 0, 1); if (unlikely(__pyx_t_2 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 453; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_3 = ((struct __pyx_obj_11pygame_sdl2_6render_TextureNode *)__pyx_t_2)->texture->renderer; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_v_ren = __pyx_t_3; /* "pygame_sdl2/render.pyx":455 * cdef SDL_Renderer *ren = ((self.sprites[0]).nodes[0]).texture.renderer * * if self._rect.w != 0 and self._rect.h != 0: # <<<<<<<<<<<<<< * SDL_RenderSetClipRect(ren, &self._rect) * */ __pyx_t_5 = ((__pyx_v_self->_rect.w != 0) != 0); if (__pyx_t_5) { } else { __pyx_t_4 = __pyx_t_5; goto __pyx_L4_bool_binop_done; } __pyx_t_5 = ((__pyx_v_self->_rect.h != 0) != 0); __pyx_t_4 = __pyx_t_5; __pyx_L4_bool_binop_done:; if (__pyx_t_4) { /* "pygame_sdl2/render.pyx":456 * * if self._rect.w != 0 and self._rect.h != 0: * SDL_RenderSetClipRect(ren, &self._rect) # <<<<<<<<<<<<<< * * for s in self.sprites: */ SDL_RenderSetClipRect(__pyx_v_ren, (&__pyx_v_self->_rect)); /* "pygame_sdl2/render.pyx":455 * cdef SDL_Renderer *ren = ((self.sprites[0]).nodes[0]).texture.renderer * * if self._rect.w != 0 and self._rect.h != 0: # <<<<<<<<<<<<<< * SDL_RenderSetClipRect(ren, &self._rect) * */ } /* "pygame_sdl2/render.pyx":458 * SDL_RenderSetClipRect(ren, &self._rect) * * for s in self.sprites: # <<<<<<<<<<<<<< * s.render((s.pos[0] + self._rect.x, s.pos[1] + self._rect.y)) * */ if (unlikely(__pyx_v_self->sprites == Py_None)) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable"); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 458; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } __pyx_t_2 = __pyx_v_self->sprites; __Pyx_INCREF(__pyx_t_2); __pyx_t_6 = 0; for (;;) { if (__pyx_t_6 >= PyList_GET_SIZE(__pyx_t_2)) break; #if CYTHON_COMPILING_IN_CPYTHON __pyx_t_1 = PyList_GET_ITEM(__pyx_t_2, __pyx_t_6); __Pyx_INCREF(__pyx_t_1); __pyx_t_6++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 458; __pyx_clineno = __LINE__; goto __pyx_L1_error;} #else __pyx_t_1 = PySequence_ITEM(__pyx_t_2, __pyx_t_6); __pyx_t_6++; if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 458; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); #endif __Pyx_XDECREF_SET(__pyx_v_s, __pyx_t_1); __pyx_t_1 = 0; /* "pygame_sdl2/render.pyx":459 * * for s in self.sprites: * s.render((s.pos[0] + self._rect.x, s.pos[1] + self._rect.y)) # <<<<<<<<<<<<<< * * # TODO: Save and restore previous clip rect instead? */ __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_v_s, __pyx_n_s_render); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 459; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_7); __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_v_s, __pyx_n_s_pos); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 459; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_8); __pyx_t_9 = __Pyx_GetItemInt(__pyx_t_8, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(__pyx_t_9 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 459; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; __Pyx_GOTREF(__pyx_t_9); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; __pyx_t_8 = __Pyx_PyInt_From_int(__pyx_v_self->_rect.x); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 459; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_8); __pyx_t_10 = PyNumber_Add(__pyx_t_9, __pyx_t_8); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 459; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_10); __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_v_s, __pyx_n_s_pos); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 459; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_8); __pyx_t_9 = __Pyx_GetItemInt(__pyx_t_8, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(__pyx_t_9 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 459; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; __Pyx_GOTREF(__pyx_t_9); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; __pyx_t_8 = __Pyx_PyInt_From_int(__pyx_v_self->_rect.y); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 459; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_8); __pyx_t_11 = PyNumber_Add(__pyx_t_9, __pyx_t_8); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 459; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_11); __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; __pyx_t_8 = PyTuple_New(2); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 459; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_8); __Pyx_GIVEREF(__pyx_t_10); PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_10); __Pyx_GIVEREF(__pyx_t_11); PyTuple_SET_ITEM(__pyx_t_8, 1, __pyx_t_11); __pyx_t_10 = 0; __pyx_t_11 = 0; __pyx_t_11 = NULL; if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_7))) { __pyx_t_11 = PyMethod_GET_SELF(__pyx_t_7); if (likely(__pyx_t_11)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_7); __Pyx_INCREF(__pyx_t_11); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_7, function); } } if (!__pyx_t_11) { __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_7, __pyx_t_8); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 459; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; __Pyx_GOTREF(__pyx_t_1); } else { __pyx_t_10 = PyTuple_New(1+1); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 459; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_10); __Pyx_GIVEREF(__pyx_t_11); PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_t_11); __pyx_t_11 = NULL; __Pyx_GIVEREF(__pyx_t_8); PyTuple_SET_ITEM(__pyx_t_10, 0+1, __pyx_t_8); __pyx_t_8 = 0; __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_7, __pyx_t_10, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 459; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; } __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "pygame_sdl2/render.pyx":458 * SDL_RenderSetClipRect(ren, &self._rect) * * for s in self.sprites: # <<<<<<<<<<<<<< * s.render((s.pos[0] + self._rect.x, s.pos[1] + self._rect.y)) * */ } __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "pygame_sdl2/render.pyx":462 * * # TODO: Save and restore previous clip rect instead? * SDL_RenderSetClipRect(ren, NULL) # <<<<<<<<<<<<<< * * property pos: */ SDL_RenderSetClipRect(__pyx_v_ren, NULL); /* "pygame_sdl2/render.pyx":451 * self.sprites.append(sprite) * * def render(self, dest=None): # <<<<<<<<<<<<<< * # TODO: Something other than this to get the SDL_Renderer. * cdef SDL_Renderer *ren = ((self.sprites[0]).nodes[0]).texture.renderer */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_7); __Pyx_XDECREF(__pyx_t_8); __Pyx_XDECREF(__pyx_t_9); __Pyx_XDECREF(__pyx_t_10); __Pyx_XDECREF(__pyx_t_11); __Pyx_AddTraceback("pygame_sdl2.render.Container.render", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF(__pyx_v_s); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/render.pyx":465 * * property pos: * def __get__(self): # <<<<<<<<<<<<<< * return self._rect.x, self._rect.y * */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_6render_9Container_3pos_1__get__(PyObject *__pyx_v_self); /*proto*/ static PyObject *__pyx_pw_11pygame_sdl2_6render_9Container_3pos_1__get__(PyObject *__pyx_v_self) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); __pyx_r = __pyx_pf_11pygame_sdl2_6render_9Container_3pos___get__(((struct __pyx_obj_11pygame_sdl2_6render_Container *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_6render_9Container_3pos___get__(struct __pyx_obj_11pygame_sdl2_6render_Container *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__get__", 0); /* "pygame_sdl2/render.pyx":466 * property pos: * def __get__(self): * return self._rect.x, self._rect.y # <<<<<<<<<<<<<< * * def __set__(self, val): */ __Pyx_XDECREF(__pyx_r); __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_self->_rect.x); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 466; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_v_self->_rect.y); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 466; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 466; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __Pyx_GIVEREF(__pyx_t_1); PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_1); __Pyx_GIVEREF(__pyx_t_2); PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_2); __pyx_t_1 = 0; __pyx_t_2 = 0; __pyx_r = __pyx_t_3; __pyx_t_3 = 0; goto __pyx_L0; /* "pygame_sdl2/render.pyx":465 * * property pos: * def __get__(self): # <<<<<<<<<<<<<< * return self._rect.x, self._rect.y * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("pygame_sdl2.render.Container.pos.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/render.pyx":468 * return self._rect.x, self._rect.y * * def __set__(self, val): # <<<<<<<<<<<<<< * self._rect.x = val[0] * self._rect.y = val[1] */ /* Python wrapper */ static int __pyx_pw_11pygame_sdl2_6render_9Container_3pos_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_val); /*proto*/ static int __pyx_pw_11pygame_sdl2_6render_9Container_3pos_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_val) { int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__set__ (wrapper)", 0); __pyx_r = __pyx_pf_11pygame_sdl2_6render_9Container_3pos_2__set__(((struct __pyx_obj_11pygame_sdl2_6render_Container *)__pyx_v_self), ((PyObject *)__pyx_v_val)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static int __pyx_pf_11pygame_sdl2_6render_9Container_3pos_2__set__(struct __pyx_obj_11pygame_sdl2_6render_Container *__pyx_v_self, PyObject *__pyx_v_val) { int __pyx_r; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_t_2; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__set__", 0); /* "pygame_sdl2/render.pyx":469 * * def __set__(self, val): * self._rect.x = val[0] # <<<<<<<<<<<<<< * self._rect.y = val[1] * */ __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_val, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(__pyx_t_1 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 469; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = __Pyx_PyInt_As_int(__pyx_t_1); if (unlikely((__pyx_t_2 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 469; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_v_self->_rect.x = __pyx_t_2; /* "pygame_sdl2/render.pyx":470 * def __set__(self, val): * self._rect.x = val[0] * self._rect.y = val[1] # <<<<<<<<<<<<<< * * property rect: */ __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_val, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(__pyx_t_1 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 470; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = __Pyx_PyInt_As_int(__pyx_t_1); if (unlikely((__pyx_t_2 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 470; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_v_self->_rect.y = __pyx_t_2; /* "pygame_sdl2/render.pyx":468 * return self._rect.x, self._rect.y * * def __set__(self, val): # <<<<<<<<<<<<<< * self._rect.x = val[0] * self._rect.y = val[1] */ /* function exit code */ __pyx_r = 0; goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("pygame_sdl2.render.Container.pos.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = -1; __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/render.pyx":473 * * property rect: * def __get__(self): # <<<<<<<<<<<<<< * return Rect(self._rect.x, self._rect.y, self._rect.w, self._rect.h) * */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_6render_9Container_4rect_1__get__(PyObject *__pyx_v_self); /*proto*/ static PyObject *__pyx_pw_11pygame_sdl2_6render_9Container_4rect_1__get__(PyObject *__pyx_v_self) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); __pyx_r = __pyx_pf_11pygame_sdl2_6render_9Container_4rect___get__(((struct __pyx_obj_11pygame_sdl2_6render_Container *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_6render_9Container_4rect___get__(struct __pyx_obj_11pygame_sdl2_6render_Container *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; PyObject *__pyx_t_5 = NULL; PyObject *__pyx_t_6 = NULL; PyObject *__pyx_t_7 = NULL; Py_ssize_t __pyx_t_8; PyObject *__pyx_t_9 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__get__", 0); /* "pygame_sdl2/render.pyx":474 * property rect: * def __get__(self): * return Rect(self._rect.x, self._rect.y, self._rect.w, self._rect.h) # <<<<<<<<<<<<<< * * def __set__(self, val): */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_Rect); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 474; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = __Pyx_PyInt_From_int(__pyx_v_self->_rect.x); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 474; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = __Pyx_PyInt_From_int(__pyx_v_self->_rect.y); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 474; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); __pyx_t_5 = __Pyx_PyInt_From_int(__pyx_v_self->_rect.w); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 474; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); __pyx_t_6 = __Pyx_PyInt_From_int(__pyx_v_self->_rect.h); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 474; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_6); __pyx_t_7 = NULL; __pyx_t_8 = 0; if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_2))) { __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_2); if (likely(__pyx_t_7)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_7); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); __pyx_t_8 = 1; } } __pyx_t_9 = PyTuple_New(4+__pyx_t_8); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 474; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_9); if (__pyx_t_7) { __Pyx_GIVEREF(__pyx_t_7); PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_t_7); __pyx_t_7 = NULL; } __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_9, 0+__pyx_t_8, __pyx_t_3); __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_9, 1+__pyx_t_8, __pyx_t_4); __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_9, 2+__pyx_t_8, __pyx_t_5); __Pyx_GIVEREF(__pyx_t_6); PyTuple_SET_ITEM(__pyx_t_9, 3+__pyx_t_8, __pyx_t_6); __pyx_t_3 = 0; __pyx_t_4 = 0; __pyx_t_5 = 0; __pyx_t_6 = 0; __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_9, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 474; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "pygame_sdl2/render.pyx":473 * * property rect: * def __get__(self): # <<<<<<<<<<<<<< * return Rect(self._rect.x, self._rect.y, self._rect.w, self._rect.h) * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_5); __Pyx_XDECREF(__pyx_t_6); __Pyx_XDECREF(__pyx_t_7); __Pyx_XDECREF(__pyx_t_9); __Pyx_AddTraceback("pygame_sdl2.render.Container.rect.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/render.pyx":476 * return Rect(self._rect.x, self._rect.y, self._rect.w, self._rect.h) * * def __set__(self, val): # <<<<<<<<<<<<<< * to_sdl_rect(val, &self._rect) * */ /* Python wrapper */ static int __pyx_pw_11pygame_sdl2_6render_9Container_4rect_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_val); /*proto*/ static int __pyx_pw_11pygame_sdl2_6render_9Container_4rect_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_val) { int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__set__ (wrapper)", 0); __pyx_r = __pyx_pf_11pygame_sdl2_6render_9Container_4rect_2__set__(((struct __pyx_obj_11pygame_sdl2_6render_Container *)__pyx_v_self), ((PyObject *)__pyx_v_val)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static int __pyx_pf_11pygame_sdl2_6render_9Container_4rect_2__set__(struct __pyx_obj_11pygame_sdl2_6render_Container *__pyx_v_self, PyObject *__pyx_v_val) { int __pyx_r; __Pyx_RefNannyDeclarations int __pyx_t_1; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__set__", 0); /* "pygame_sdl2/render.pyx":477 * * def __set__(self, val): * to_sdl_rect(val, &self._rect) # <<<<<<<<<<<<<< * */ __pyx_t_1 = __pyx_f_11pygame_sdl2_4rect_to_sdl_rect(__pyx_v_val, (&__pyx_v_self->_rect), NULL); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 477; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "pygame_sdl2/render.pyx":476 * return Rect(self._rect.x, self._rect.y, self._rect.w, self._rect.h) * * def __set__(self, val): # <<<<<<<<<<<<<< * to_sdl_rect(val, &self._rect) * */ /* function exit code */ __pyx_r = 0; goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("pygame_sdl2.render.Container.rect.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = -1; __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; } static struct __pyx_vtabstruct_11pygame_sdl2_6render_Renderer __pyx_vtable_11pygame_sdl2_6render_Renderer; static PyObject *__pyx_tp_new_11pygame_sdl2_6render_Renderer(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) { struct __pyx_obj_11pygame_sdl2_6render_Renderer *p; PyObject *o; if (likely((t->tp_flags & Py_TPFLAGS_IS_ABSTRACT) == 0)) { o = (*t->tp_alloc)(t, 0); } else { o = (PyObject *) PyBaseObject_Type.tp_new(t, __pyx_empty_tuple, 0); } if (unlikely(!o)) return 0; p = ((struct __pyx_obj_11pygame_sdl2_6render_Renderer *)o); p->__pyx_vtab = __pyx_vtabptr_11pygame_sdl2_6render_Renderer; p->_info = ((PyObject*)Py_None); Py_INCREF(Py_None); if (unlikely(__pyx_pw_11pygame_sdl2_6render_8Renderer_1__cinit__(o, __pyx_empty_tuple, NULL) < 0)) { Py_DECREF(o); o = 0; } return o; } static void __pyx_tp_dealloc_11pygame_sdl2_6render_Renderer(PyObject *o) { struct __pyx_obj_11pygame_sdl2_6render_Renderer *p = (struct __pyx_obj_11pygame_sdl2_6render_Renderer *)o; #if PY_VERSION_HEX >= 0x030400a1 if (unlikely(Py_TYPE(o)->tp_finalize) && !_PyGC_FINALIZED(o)) { if (PyObject_CallFinalizerFromDealloc(o)) return; } #endif PyObject_GC_UnTrack(o); { PyObject *etype, *eval, *etb; PyErr_Fetch(&etype, &eval, &etb); ++Py_REFCNT(o); __pyx_pw_11pygame_sdl2_6render_8Renderer_3__dealloc__(o); --Py_REFCNT(o); PyErr_Restore(etype, eval, etb); } Py_CLEAR(p->_info); (*Py_TYPE(o)->tp_free)(o); } static int __pyx_tp_traverse_11pygame_sdl2_6render_Renderer(PyObject *o, visitproc v, void *a) { int e; struct __pyx_obj_11pygame_sdl2_6render_Renderer *p = (struct __pyx_obj_11pygame_sdl2_6render_Renderer *)o; if (p->_info) { e = (*v)(p->_info, a); if (e) return e; } return 0; } static int __pyx_tp_clear_11pygame_sdl2_6render_Renderer(PyObject *o) { PyObject* tmp; struct __pyx_obj_11pygame_sdl2_6render_Renderer *p = (struct __pyx_obj_11pygame_sdl2_6render_Renderer *)o; tmp = ((PyObject*)p->_info); p->_info = ((PyObject*)Py_None); Py_INCREF(Py_None); Py_XDECREF(tmp); return 0; } static PyMethodDef __pyx_methods_11pygame_sdl2_6render_Renderer[] = { {"load_texture", (PyCFunction)__pyx_pw_11pygame_sdl2_6render_8Renderer_7load_texture, METH_O, 0}, {"load_atlas", (PyCFunction)__pyx_pw_11pygame_sdl2_6render_8Renderer_9load_atlas, METH_O, __pyx_doc_11pygame_sdl2_6render_8Renderer_8load_atlas}, {"render_present", (PyCFunction)__pyx_pw_11pygame_sdl2_6render_8Renderer_11render_present, METH_NOARGS, 0}, {"info", (PyCFunction)__pyx_pw_11pygame_sdl2_6render_8Renderer_13info, METH_NOARGS, 0}, {"clear", (PyCFunction)__pyx_pw_11pygame_sdl2_6render_8Renderer_15clear, METH_O, 0}, {"draw_line", (PyCFunction)__pyx_pw_11pygame_sdl2_6render_8Renderer_17draw_line, METH_VARARGS|METH_KEYWORDS, 0}, {"draw_point", (PyCFunction)__pyx_pw_11pygame_sdl2_6render_8Renderer_19draw_point, METH_VARARGS|METH_KEYWORDS, 0}, {"draw_rect", (PyCFunction)__pyx_pw_11pygame_sdl2_6render_8Renderer_21draw_rect, METH_VARARGS|METH_KEYWORDS, 0}, {"fill_rect", (PyCFunction)__pyx_pw_11pygame_sdl2_6render_8Renderer_23fill_rect, METH_VARARGS|METH_KEYWORDS, 0}, {"set_viewport", (PyCFunction)__pyx_pw_11pygame_sdl2_6render_8Renderer_25set_viewport, METH_VARARGS|METH_KEYWORDS, 0}, {"create_texture", (PyCFunction)__pyx_pw_11pygame_sdl2_6render_8Renderer_27create_texture, METH_O, 0}, {0, 0, 0, 0} }; static PyTypeObject __pyx_type_11pygame_sdl2_6render_Renderer = { PyVarObject_HEAD_INIT(0, 0) "pygame_sdl2.render.Renderer", /*tp_name*/ sizeof(struct __pyx_obj_11pygame_sdl2_6render_Renderer), /*tp_basicsize*/ 0, /*tp_itemsize*/ __pyx_tp_dealloc_11pygame_sdl2_6render_Renderer, /*tp_dealloc*/ 0, /*tp_print*/ 0, /*tp_getattr*/ 0, /*tp_setattr*/ #if PY_MAJOR_VERSION < 3 0, /*tp_compare*/ #endif #if PY_MAJOR_VERSION >= 3 0, /*tp_as_async*/ #endif 0, /*tp_repr*/ 0, /*tp_as_number*/ 0, /*tp_as_sequence*/ 0, /*tp_as_mapping*/ 0, /*tp_hash*/ 0, /*tp_call*/ 0, /*tp_str*/ 0, /*tp_getattro*/ 0, /*tp_setattro*/ 0, /*tp_as_buffer*/ Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/ 0, /*tp_doc*/ __pyx_tp_traverse_11pygame_sdl2_6render_Renderer, /*tp_traverse*/ __pyx_tp_clear_11pygame_sdl2_6render_Renderer, /*tp_clear*/ 0, /*tp_richcompare*/ 0, /*tp_weaklistoffset*/ 0, /*tp_iter*/ 0, /*tp_iternext*/ __pyx_methods_11pygame_sdl2_6render_Renderer, /*tp_methods*/ 0, /*tp_members*/ 0, /*tp_getset*/ 0, /*tp_base*/ 0, /*tp_dict*/ 0, /*tp_descr_get*/ 0, /*tp_descr_set*/ 0, /*tp_dictoffset*/ __pyx_pw_11pygame_sdl2_6render_8Renderer_5__init__, /*tp_init*/ 0, /*tp_alloc*/ __pyx_tp_new_11pygame_sdl2_6render_Renderer, /*tp_new*/ 0, /*tp_free*/ 0, /*tp_is_gc*/ 0, /*tp_bases*/ 0, /*tp_mro*/ 0, /*tp_cache*/ 0, /*tp_subclasses*/ 0, /*tp_weaklist*/ 0, /*tp_del*/ 0, /*tp_version_tag*/ #if PY_VERSION_HEX >= 0x030400a1 0, /*tp_finalize*/ #endif }; static struct __pyx_vtabstruct_11pygame_sdl2_6render_Texture __pyx_vtable_11pygame_sdl2_6render_Texture; static PyObject *__pyx_tp_new_11pygame_sdl2_6render_Texture(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) { struct __pyx_obj_11pygame_sdl2_6render_Texture *p; PyObject *o; if (likely((t->tp_flags & Py_TPFLAGS_IS_ABSTRACT) == 0)) { o = (*t->tp_alloc)(t, 0); } else { o = (PyObject *) PyBaseObject_Type.tp_new(t, __pyx_empty_tuple, 0); } if (unlikely(!o)) return 0; p = ((struct __pyx_obj_11pygame_sdl2_6render_Texture *)o); p->__pyx_vtab = __pyx_vtabptr_11pygame_sdl2_6render_Texture; if (unlikely(__pyx_pw_11pygame_sdl2_6render_7Texture_1__cinit__(o, __pyx_empty_tuple, NULL) < 0)) { Py_DECREF(o); o = 0; } return o; } static void __pyx_tp_dealloc_11pygame_sdl2_6render_Texture(PyObject *o) { #if PY_VERSION_HEX >= 0x030400a1 if (unlikely(Py_TYPE(o)->tp_finalize) && (!PyType_IS_GC(Py_TYPE(o)) || !_PyGC_FINALIZED(o))) { if (PyObject_CallFinalizerFromDealloc(o)) return; } #endif { PyObject *etype, *eval, *etb; PyErr_Fetch(&etype, &eval, &etb); ++Py_REFCNT(o); __pyx_pw_11pygame_sdl2_6render_7Texture_3__dealloc__(o); --Py_REFCNT(o); PyErr_Restore(etype, eval, etb); } (*Py_TYPE(o)->tp_free)(o); } static PyObject *__pyx_getprop_11pygame_sdl2_6render_7Texture_w(PyObject *o, CYTHON_UNUSED void *x) { return __pyx_pw_11pygame_sdl2_6render_7Texture_1w_1__get__(o); } static int __pyx_setprop_11pygame_sdl2_6render_7Texture_w(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) { if (v) { return __pyx_pw_11pygame_sdl2_6render_7Texture_1w_3__set__(o, v); } else { PyErr_SetString(PyExc_NotImplementedError, "__del__"); return -1; } } static PyObject *__pyx_getprop_11pygame_sdl2_6render_7Texture_h(PyObject *o, CYTHON_UNUSED void *x) { return __pyx_pw_11pygame_sdl2_6render_7Texture_1h_1__get__(o); } static int __pyx_setprop_11pygame_sdl2_6render_7Texture_h(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) { if (v) { return __pyx_pw_11pygame_sdl2_6render_7Texture_1h_3__set__(o, v); } else { PyErr_SetString(PyExc_NotImplementedError, "__del__"); return -1; } } static PyMethodDef __pyx_methods_11pygame_sdl2_6render_Texture[] = { {0, 0, 0, 0} }; static struct PyGetSetDef __pyx_getsets_11pygame_sdl2_6render_Texture[] = { {(char *)"w", __pyx_getprop_11pygame_sdl2_6render_7Texture_w, __pyx_setprop_11pygame_sdl2_6render_7Texture_w, 0, 0}, {(char *)"h", __pyx_getprop_11pygame_sdl2_6render_7Texture_h, __pyx_setprop_11pygame_sdl2_6render_7Texture_h, 0, 0}, {0, 0, 0, 0, 0} }; static PyTypeObject __pyx_type_11pygame_sdl2_6render_Texture = { PyVarObject_HEAD_INIT(0, 0) "pygame_sdl2.render.Texture", /*tp_name*/ sizeof(struct __pyx_obj_11pygame_sdl2_6render_Texture), /*tp_basicsize*/ 0, /*tp_itemsize*/ __pyx_tp_dealloc_11pygame_sdl2_6render_Texture, /*tp_dealloc*/ 0, /*tp_print*/ 0, /*tp_getattr*/ 0, /*tp_setattr*/ #if PY_MAJOR_VERSION < 3 0, /*tp_compare*/ #endif #if PY_MAJOR_VERSION >= 3 0, /*tp_as_async*/ #endif 0, /*tp_repr*/ 0, /*tp_as_number*/ 0, /*tp_as_sequence*/ 0, /*tp_as_mapping*/ 0, /*tp_hash*/ 0, /*tp_call*/ 0, /*tp_str*/ 0, /*tp_getattro*/ 0, /*tp_setattro*/ 0, /*tp_as_buffer*/ Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE, /*tp_flags*/ " Mostly for internal use. Users should only see this for RTT. ", /*tp_doc*/ 0, /*tp_traverse*/ 0, /*tp_clear*/ 0, /*tp_richcompare*/ 0, /*tp_weaklistoffset*/ 0, /*tp_iter*/ 0, /*tp_iternext*/ __pyx_methods_11pygame_sdl2_6render_Texture, /*tp_methods*/ 0, /*tp_members*/ __pyx_getsets_11pygame_sdl2_6render_Texture, /*tp_getset*/ 0, /*tp_base*/ 0, /*tp_dict*/ 0, /*tp_descr_get*/ 0, /*tp_descr_set*/ 0, /*tp_dictoffset*/ 0, /*tp_init*/ 0, /*tp_alloc*/ __pyx_tp_new_11pygame_sdl2_6render_Texture, /*tp_new*/ 0, /*tp_free*/ 0, /*tp_is_gc*/ 0, /*tp_bases*/ 0, /*tp_mro*/ 0, /*tp_cache*/ 0, /*tp_subclasses*/ 0, /*tp_weaklist*/ 0, /*tp_del*/ 0, /*tp_version_tag*/ #if PY_VERSION_HEX >= 0x030400a1 0, /*tp_finalize*/ #endif }; static PyObject *__pyx_tp_new_11pygame_sdl2_6render_TextureNode(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) { struct __pyx_obj_11pygame_sdl2_6render_TextureNode *p; PyObject *o; if (likely((t->tp_flags & Py_TPFLAGS_IS_ABSTRACT) == 0)) { o = (*t->tp_alloc)(t, 0); } else { o = (PyObject *) PyBaseObject_Type.tp_new(t, __pyx_empty_tuple, 0); } if (unlikely(!o)) return 0; p = ((struct __pyx_obj_11pygame_sdl2_6render_TextureNode *)o); p->texture = ((struct __pyx_obj_11pygame_sdl2_6render_Texture *)Py_None); Py_INCREF(Py_None); return o; } static void __pyx_tp_dealloc_11pygame_sdl2_6render_TextureNode(PyObject *o) { struct __pyx_obj_11pygame_sdl2_6render_TextureNode *p = (struct __pyx_obj_11pygame_sdl2_6render_TextureNode *)o; #if PY_VERSION_HEX >= 0x030400a1 if (unlikely(Py_TYPE(o)->tp_finalize) && !_PyGC_FINALIZED(o)) { if (PyObject_CallFinalizerFromDealloc(o)) return; } #endif PyObject_GC_UnTrack(o); Py_CLEAR(p->texture); (*Py_TYPE(o)->tp_free)(o); } static int __pyx_tp_traverse_11pygame_sdl2_6render_TextureNode(PyObject *o, visitproc v, void *a) { int e; struct __pyx_obj_11pygame_sdl2_6render_TextureNode *p = (struct __pyx_obj_11pygame_sdl2_6render_TextureNode *)o; if (p->texture) { e = (*v)(((PyObject*)p->texture), a); if (e) return e; } return 0; } static int __pyx_tp_clear_11pygame_sdl2_6render_TextureNode(PyObject *o) { PyObject* tmp; struct __pyx_obj_11pygame_sdl2_6render_TextureNode *p = (struct __pyx_obj_11pygame_sdl2_6render_TextureNode *)o; tmp = ((PyObject*)p->texture); p->texture = ((struct __pyx_obj_11pygame_sdl2_6render_Texture *)Py_None); Py_INCREF(Py_None); Py_XDECREF(tmp); return 0; } static PyMethodDef __pyx_methods_11pygame_sdl2_6render_TextureNode[] = { {"render", (PyCFunction)__pyx_pw_11pygame_sdl2_6render_11TextureNode_3render, METH_VARARGS|METH_KEYWORDS, 0}, {0, 0, 0, 0} }; static PyTypeObject __pyx_type_11pygame_sdl2_6render_TextureNode = { PyVarObject_HEAD_INIT(0, 0) "pygame_sdl2.render.TextureNode", /*tp_name*/ sizeof(struct __pyx_obj_11pygame_sdl2_6render_TextureNode), /*tp_basicsize*/ 0, /*tp_itemsize*/ __pyx_tp_dealloc_11pygame_sdl2_6render_TextureNode, /*tp_dealloc*/ 0, /*tp_print*/ 0, /*tp_getattr*/ 0, /*tp_setattr*/ #if PY_MAJOR_VERSION < 3 0, /*tp_compare*/ #endif #if PY_MAJOR_VERSION >= 3 0, /*tp_as_async*/ #endif 0, /*tp_repr*/ 0, /*tp_as_number*/ 0, /*tp_as_sequence*/ 0, /*tp_as_mapping*/ 0, /*tp_hash*/ 0, /*tp_call*/ 0, /*tp_str*/ 0, /*tp_getattro*/ 0, /*tp_setattro*/ 0, /*tp_as_buffer*/ Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/ " A specified area of a texture. ", /*tp_doc*/ __pyx_tp_traverse_11pygame_sdl2_6render_TextureNode, /*tp_traverse*/ __pyx_tp_clear_11pygame_sdl2_6render_TextureNode, /*tp_clear*/ 0, /*tp_richcompare*/ 0, /*tp_weaklistoffset*/ 0, /*tp_iter*/ 0, /*tp_iternext*/ __pyx_methods_11pygame_sdl2_6render_TextureNode, /*tp_methods*/ 0, /*tp_members*/ 0, /*tp_getset*/ 0, /*tp_base*/ 0, /*tp_dict*/ 0, /*tp_descr_get*/ 0, /*tp_descr_set*/ 0, /*tp_dictoffset*/ __pyx_pw_11pygame_sdl2_6render_11TextureNode_1__init__, /*tp_init*/ 0, /*tp_alloc*/ __pyx_tp_new_11pygame_sdl2_6render_TextureNode, /*tp_new*/ 0, /*tp_free*/ 0, /*tp_is_gc*/ 0, /*tp_bases*/ 0, /*tp_mro*/ 0, /*tp_cache*/ 0, /*tp_subclasses*/ 0, /*tp_weaklist*/ 0, /*tp_del*/ 0, /*tp_version_tag*/ #if PY_VERSION_HEX >= 0x030400a1 0, /*tp_finalize*/ #endif }; static PyObject *__pyx_tp_new_11pygame_sdl2_6render_TextureAtlas(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) { struct __pyx_obj_11pygame_sdl2_6render_TextureAtlas *p; PyObject *o; if (likely((t->tp_flags & Py_TPFLAGS_IS_ABSTRACT) == 0)) { o = (*t->tp_alloc)(t, 0); } else { o = (PyObject *) PyBaseObject_Type.tp_new(t, __pyx_empty_tuple, 0); } if (unlikely(!o)) return 0; p = ((struct __pyx_obj_11pygame_sdl2_6render_TextureAtlas *)o); p->frames = Py_None; Py_INCREF(Py_None); return o; } static void __pyx_tp_dealloc_11pygame_sdl2_6render_TextureAtlas(PyObject *o) { struct __pyx_obj_11pygame_sdl2_6render_TextureAtlas *p = (struct __pyx_obj_11pygame_sdl2_6render_TextureAtlas *)o; #if PY_VERSION_HEX >= 0x030400a1 if (unlikely(Py_TYPE(o)->tp_finalize) && !_PyGC_FINALIZED(o)) { if (PyObject_CallFinalizerFromDealloc(o)) return; } #endif PyObject_GC_UnTrack(o); Py_CLEAR(p->frames); (*Py_TYPE(o)->tp_free)(o); } static int __pyx_tp_traverse_11pygame_sdl2_6render_TextureAtlas(PyObject *o, visitproc v, void *a) { int e; struct __pyx_obj_11pygame_sdl2_6render_TextureAtlas *p = (struct __pyx_obj_11pygame_sdl2_6render_TextureAtlas *)o; if (p->frames) { e = (*v)(p->frames, a); if (e) return e; } return 0; } static int __pyx_tp_clear_11pygame_sdl2_6render_TextureAtlas(PyObject *o) { PyObject* tmp; struct __pyx_obj_11pygame_sdl2_6render_TextureAtlas *p = (struct __pyx_obj_11pygame_sdl2_6render_TextureAtlas *)o; tmp = ((PyObject*)p->frames); p->frames = Py_None; Py_INCREF(Py_None); Py_XDECREF(tmp); return 0; } static PyObject *__pyx_sq_item_11pygame_sdl2_6render_TextureAtlas(PyObject *o, Py_ssize_t i) { PyObject *r; PyObject *x = PyInt_FromSsize_t(i); if(!x) return 0; r = Py_TYPE(o)->tp_as_mapping->mp_subscript(o, x); Py_DECREF(x); return r; } static PyMethodDef __pyx_methods_11pygame_sdl2_6render_TextureAtlas[] = { {"keys", (PyCFunction)__pyx_pw_11pygame_sdl2_6render_12TextureAtlas_5keys, METH_NOARGS, 0}, {0, 0, 0, 0} }; static PySequenceMethods __pyx_tp_as_sequence_TextureAtlas = { 0, /*sq_length*/ 0, /*sq_concat*/ 0, /*sq_repeat*/ __pyx_sq_item_11pygame_sdl2_6render_TextureAtlas, /*sq_item*/ 0, /*sq_slice*/ 0, /*sq_ass_item*/ 0, /*sq_ass_slice*/ 0, /*sq_contains*/ 0, /*sq_inplace_concat*/ 0, /*sq_inplace_repeat*/ }; static PyMappingMethods __pyx_tp_as_mapping_TextureAtlas = { 0, /*mp_length*/ __pyx_pw_11pygame_sdl2_6render_12TextureAtlas_3__getitem__, /*mp_subscript*/ 0, /*mp_ass_subscript*/ }; static PyTypeObject __pyx_type_11pygame_sdl2_6render_TextureAtlas = { PyVarObject_HEAD_INIT(0, 0) "pygame_sdl2.render.TextureAtlas", /*tp_name*/ sizeof(struct __pyx_obj_11pygame_sdl2_6render_TextureAtlas), /*tp_basicsize*/ 0, /*tp_itemsize*/ __pyx_tp_dealloc_11pygame_sdl2_6render_TextureAtlas, /*tp_dealloc*/ 0, /*tp_print*/ 0, /*tp_getattr*/ 0, /*tp_setattr*/ #if PY_MAJOR_VERSION < 3 0, /*tp_compare*/ #endif #if PY_MAJOR_VERSION >= 3 0, /*tp_as_async*/ #endif 0, /*tp_repr*/ 0, /*tp_as_number*/ &__pyx_tp_as_sequence_TextureAtlas, /*tp_as_sequence*/ &__pyx_tp_as_mapping_TextureAtlas, /*tp_as_mapping*/ 0, /*tp_hash*/ 0, /*tp_call*/ 0, /*tp_str*/ 0, /*tp_getattro*/ 0, /*tp_setattro*/ 0, /*tp_as_buffer*/ Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/ 0, /*tp_doc*/ __pyx_tp_traverse_11pygame_sdl2_6render_TextureAtlas, /*tp_traverse*/ __pyx_tp_clear_11pygame_sdl2_6render_TextureAtlas, /*tp_clear*/ 0, /*tp_richcompare*/ 0, /*tp_weaklistoffset*/ 0, /*tp_iter*/ 0, /*tp_iternext*/ __pyx_methods_11pygame_sdl2_6render_TextureAtlas, /*tp_methods*/ 0, /*tp_members*/ 0, /*tp_getset*/ 0, /*tp_base*/ 0, /*tp_dict*/ 0, /*tp_descr_get*/ 0, /*tp_descr_set*/ 0, /*tp_dictoffset*/ __pyx_pw_11pygame_sdl2_6render_12TextureAtlas_1__init__, /*tp_init*/ 0, /*tp_alloc*/ __pyx_tp_new_11pygame_sdl2_6render_TextureAtlas, /*tp_new*/ 0, /*tp_free*/ 0, /*tp_is_gc*/ 0, /*tp_bases*/ 0, /*tp_mro*/ 0, /*tp_cache*/ 0, /*tp_subclasses*/ 0, /*tp_weaklist*/ 0, /*tp_del*/ 0, /*tp_version_tag*/ #if PY_VERSION_HEX >= 0x030400a1 0, /*tp_finalize*/ #endif }; static struct __pyx_vtabstruct_11pygame_sdl2_6render_Sprite __pyx_vtable_11pygame_sdl2_6render_Sprite; static PyObject *__pyx_tp_new_11pygame_sdl2_6render_Sprite(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) { struct __pyx_obj_11pygame_sdl2_6render_Sprite *p; PyObject *o; if (likely((t->tp_flags & Py_TPFLAGS_IS_ABSTRACT) == 0)) { o = (*t->tp_alloc)(t, 0); } else { o = (PyObject *) PyBaseObject_Type.tp_new(t, __pyx_empty_tuple, 0); } if (unlikely(!o)) return 0; p = ((struct __pyx_obj_11pygame_sdl2_6render_Sprite *)o); p->__pyx_vtab = __pyx_vtabptr_11pygame_sdl2_6render_Sprite; p->nodes = ((PyObject*)Py_None); Py_INCREF(Py_None); return o; } static void __pyx_tp_dealloc_11pygame_sdl2_6render_Sprite(PyObject *o) { struct __pyx_obj_11pygame_sdl2_6render_Sprite *p = (struct __pyx_obj_11pygame_sdl2_6render_Sprite *)o; #if PY_VERSION_HEX >= 0x030400a1 if (unlikely(Py_TYPE(o)->tp_finalize) && !_PyGC_FINALIZED(o)) { if (PyObject_CallFinalizerFromDealloc(o)) return; } #endif PyObject_GC_UnTrack(o); Py_CLEAR(p->nodes); (*Py_TYPE(o)->tp_free)(o); } static int __pyx_tp_traverse_11pygame_sdl2_6render_Sprite(PyObject *o, visitproc v, void *a) { int e; struct __pyx_obj_11pygame_sdl2_6render_Sprite *p = (struct __pyx_obj_11pygame_sdl2_6render_Sprite *)o; if (p->nodes) { e = (*v)(p->nodes, a); if (e) return e; } return 0; } static int __pyx_tp_clear_11pygame_sdl2_6render_Sprite(PyObject *o) { PyObject* tmp; struct __pyx_obj_11pygame_sdl2_6render_Sprite *p = (struct __pyx_obj_11pygame_sdl2_6render_Sprite *)o; tmp = ((PyObject*)p->nodes); p->nodes = ((PyObject*)Py_None); Py_INCREF(Py_None); Py_XDECREF(tmp); return 0; } static PyObject *__pyx_getprop_11pygame_sdl2_6render_6Sprite_pos(PyObject *o, CYTHON_UNUSED void *x) { return __pyx_pw_11pygame_sdl2_6render_6Sprite_3pos_1__get__(o); } static int __pyx_setprop_11pygame_sdl2_6render_6Sprite_pos(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) { if (v) { return __pyx_pw_11pygame_sdl2_6render_6Sprite_3pos_3__set__(o, v); } else { PyErr_SetString(PyExc_NotImplementedError, "__del__"); return -1; } } static int __pyx_setprop_11pygame_sdl2_6render_6Sprite_color(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) { if (v) { return __pyx_pw_11pygame_sdl2_6render_6Sprite_5color_1__set__(o, v); } else { PyErr_SetString(PyExc_NotImplementedError, "__del__"); return -1; } } static PyObject *__pyx_getprop_11pygame_sdl2_6render_6Sprite_alpha(PyObject *o, CYTHON_UNUSED void *x) { return __pyx_pw_11pygame_sdl2_6render_6Sprite_5alpha_1__get__(o); } static int __pyx_setprop_11pygame_sdl2_6render_6Sprite_alpha(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) { if (v) { return __pyx_pw_11pygame_sdl2_6render_6Sprite_5alpha_3__set__(o, v); } else { PyErr_SetString(PyExc_NotImplementedError, "__del__"); return -1; } } static PyObject *__pyx_getprop_11pygame_sdl2_6render_6Sprite_rotation(PyObject *o, CYTHON_UNUSED void *x) { return __pyx_pw_11pygame_sdl2_6render_6Sprite_8rotation_1__get__(o); } static int __pyx_setprop_11pygame_sdl2_6render_6Sprite_rotation(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) { if (v) { return __pyx_pw_11pygame_sdl2_6render_6Sprite_8rotation_3__set__(o, v); } else { PyErr_SetString(PyExc_NotImplementedError, "__del__"); return -1; } } static PyObject *__pyx_getprop_11pygame_sdl2_6render_6Sprite_scale(PyObject *o, CYTHON_UNUSED void *x) { return __pyx_pw_11pygame_sdl2_6render_6Sprite_5scale_1__get__(o); } static int __pyx_setprop_11pygame_sdl2_6render_6Sprite_scale(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) { if (v) { return __pyx_pw_11pygame_sdl2_6render_6Sprite_5scale_3__set__(o, v); } else { PyErr_SetString(PyExc_NotImplementedError, "__del__"); return -1; } } static PyObject *__pyx_getprop_11pygame_sdl2_6render_6Sprite_hflip(PyObject *o, CYTHON_UNUSED void *x) { return __pyx_pw_11pygame_sdl2_6render_6Sprite_5hflip_1__get__(o); } static int __pyx_setprop_11pygame_sdl2_6render_6Sprite_hflip(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) { if (v) { return __pyx_pw_11pygame_sdl2_6render_6Sprite_5hflip_3__set__(o, v); } else { PyErr_SetString(PyExc_NotImplementedError, "__del__"); return -1; } } static PyObject *__pyx_getprop_11pygame_sdl2_6render_6Sprite_vflip(PyObject *o, CYTHON_UNUSED void *x) { return __pyx_pw_11pygame_sdl2_6render_6Sprite_5vflip_1__get__(o); } static int __pyx_setprop_11pygame_sdl2_6render_6Sprite_vflip(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) { if (v) { return __pyx_pw_11pygame_sdl2_6render_6Sprite_5vflip_3__set__(o, v); } else { PyErr_SetString(PyExc_NotImplementedError, "__del__"); return -1; } } static PyMethodDef __pyx_methods_11pygame_sdl2_6render_Sprite[] = { {"render", (PyCFunction)__pyx_pw_11pygame_sdl2_6render_6Sprite_3render, METH_VARARGS|METH_KEYWORDS, 0}, {"collides", (PyCFunction)__pyx_pw_11pygame_sdl2_6render_6Sprite_5collides, METH_O, 0}, {0, 0, 0, 0} }; static struct PyGetSetDef __pyx_getsets_11pygame_sdl2_6render_Sprite[] = { {(char *)"pos", __pyx_getprop_11pygame_sdl2_6render_6Sprite_pos, __pyx_setprop_11pygame_sdl2_6render_6Sprite_pos, 0, 0}, {(char *)"color", 0, __pyx_setprop_11pygame_sdl2_6render_6Sprite_color, 0, 0}, {(char *)"alpha", __pyx_getprop_11pygame_sdl2_6render_6Sprite_alpha, __pyx_setprop_11pygame_sdl2_6render_6Sprite_alpha, 0, 0}, {(char *)"rotation", __pyx_getprop_11pygame_sdl2_6render_6Sprite_rotation, __pyx_setprop_11pygame_sdl2_6render_6Sprite_rotation, 0, 0}, {(char *)"scale", __pyx_getprop_11pygame_sdl2_6render_6Sprite_scale, __pyx_setprop_11pygame_sdl2_6render_6Sprite_scale, 0, 0}, {(char *)"hflip", __pyx_getprop_11pygame_sdl2_6render_6Sprite_hflip, __pyx_setprop_11pygame_sdl2_6render_6Sprite_hflip, 0, 0}, {(char *)"vflip", __pyx_getprop_11pygame_sdl2_6render_6Sprite_vflip, __pyx_setprop_11pygame_sdl2_6render_6Sprite_vflip, 0, 0}, {0, 0, 0, 0, 0} }; static PyTypeObject __pyx_type_11pygame_sdl2_6render_Sprite = { PyVarObject_HEAD_INIT(0, 0) "pygame_sdl2.render.Sprite", /*tp_name*/ sizeof(struct __pyx_obj_11pygame_sdl2_6render_Sprite), /*tp_basicsize*/ 0, /*tp_itemsize*/ __pyx_tp_dealloc_11pygame_sdl2_6render_Sprite, /*tp_dealloc*/ 0, /*tp_print*/ 0, /*tp_getattr*/ 0, /*tp_setattr*/ #if PY_MAJOR_VERSION < 3 0, /*tp_compare*/ #endif #if PY_MAJOR_VERSION >= 3 0, /*tp_as_async*/ #endif 0, /*tp_repr*/ 0, /*tp_as_number*/ 0, /*tp_as_sequence*/ 0, /*tp_as_mapping*/ 0, /*tp_hash*/ 0, /*tp_call*/ 0, /*tp_str*/ 0, /*tp_getattro*/ 0, /*tp_setattro*/ 0, /*tp_as_buffer*/ Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/ " One or more TextureNodes, with possible transforms applied. ", /*tp_doc*/ __pyx_tp_traverse_11pygame_sdl2_6render_Sprite, /*tp_traverse*/ __pyx_tp_clear_11pygame_sdl2_6render_Sprite, /*tp_clear*/ 0, /*tp_richcompare*/ 0, /*tp_weaklistoffset*/ 0, /*tp_iter*/ 0, /*tp_iternext*/ __pyx_methods_11pygame_sdl2_6render_Sprite, /*tp_methods*/ 0, /*tp_members*/ __pyx_getsets_11pygame_sdl2_6render_Sprite, /*tp_getset*/ 0, /*tp_base*/ 0, /*tp_dict*/ 0, /*tp_descr_get*/ 0, /*tp_descr_set*/ 0, /*tp_dictoffset*/ __pyx_pw_11pygame_sdl2_6render_6Sprite_1__init__, /*tp_init*/ 0, /*tp_alloc*/ __pyx_tp_new_11pygame_sdl2_6render_Sprite, /*tp_new*/ 0, /*tp_free*/ 0, /*tp_is_gc*/ 0, /*tp_bases*/ 0, /*tp_mro*/ 0, /*tp_cache*/ 0, /*tp_subclasses*/ 0, /*tp_weaklist*/ 0, /*tp_del*/ 0, /*tp_version_tag*/ #if PY_VERSION_HEX >= 0x030400a1 0, /*tp_finalize*/ #endif }; static PyObject *__pyx_tp_new_11pygame_sdl2_6render_Container(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) { struct __pyx_obj_11pygame_sdl2_6render_Container *p; PyObject *o; if (likely((t->tp_flags & Py_TPFLAGS_IS_ABSTRACT) == 0)) { o = (*t->tp_alloc)(t, 0); } else { o = (PyObject *) PyBaseObject_Type.tp_new(t, __pyx_empty_tuple, 0); } if (unlikely(!o)) return 0; p = ((struct __pyx_obj_11pygame_sdl2_6render_Container *)o); p->sprites = ((PyObject*)Py_None); Py_INCREF(Py_None); return o; } static void __pyx_tp_dealloc_11pygame_sdl2_6render_Container(PyObject *o) { struct __pyx_obj_11pygame_sdl2_6render_Container *p = (struct __pyx_obj_11pygame_sdl2_6render_Container *)o; #if PY_VERSION_HEX >= 0x030400a1 if (unlikely(Py_TYPE(o)->tp_finalize) && !_PyGC_FINALIZED(o)) { if (PyObject_CallFinalizerFromDealloc(o)) return; } #endif PyObject_GC_UnTrack(o); Py_CLEAR(p->sprites); (*Py_TYPE(o)->tp_free)(o); } static int __pyx_tp_traverse_11pygame_sdl2_6render_Container(PyObject *o, visitproc v, void *a) { int e; struct __pyx_obj_11pygame_sdl2_6render_Container *p = (struct __pyx_obj_11pygame_sdl2_6render_Container *)o; if (p->sprites) { e = (*v)(p->sprites, a); if (e) return e; } return 0; } static int __pyx_tp_clear_11pygame_sdl2_6render_Container(PyObject *o) { PyObject* tmp; struct __pyx_obj_11pygame_sdl2_6render_Container *p = (struct __pyx_obj_11pygame_sdl2_6render_Container *)o; tmp = ((PyObject*)p->sprites); p->sprites = ((PyObject*)Py_None); Py_INCREF(Py_None); Py_XDECREF(tmp); return 0; } static PyObject *__pyx_getprop_11pygame_sdl2_6render_9Container_pos(PyObject *o, CYTHON_UNUSED void *x) { return __pyx_pw_11pygame_sdl2_6render_9Container_3pos_1__get__(o); } static int __pyx_setprop_11pygame_sdl2_6render_9Container_pos(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) { if (v) { return __pyx_pw_11pygame_sdl2_6render_9Container_3pos_3__set__(o, v); } else { PyErr_SetString(PyExc_NotImplementedError, "__del__"); return -1; } } static PyObject *__pyx_getprop_11pygame_sdl2_6render_9Container_rect(PyObject *o, CYTHON_UNUSED void *x) { return __pyx_pw_11pygame_sdl2_6render_9Container_4rect_1__get__(o); } static int __pyx_setprop_11pygame_sdl2_6render_9Container_rect(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) { if (v) { return __pyx_pw_11pygame_sdl2_6render_9Container_4rect_3__set__(o, v); } else { PyErr_SetString(PyExc_NotImplementedError, "__del__"); return -1; } } static PyMethodDef __pyx_methods_11pygame_sdl2_6render_Container[] = { {"add", (PyCFunction)__pyx_pw_11pygame_sdl2_6render_9Container_3add, METH_O, 0}, {"render", (PyCFunction)__pyx_pw_11pygame_sdl2_6render_9Container_5render, METH_VARARGS|METH_KEYWORDS, 0}, {0, 0, 0, 0} }; static struct PyGetSetDef __pyx_getsets_11pygame_sdl2_6render_Container[] = { {(char *)"pos", __pyx_getprop_11pygame_sdl2_6render_9Container_pos, __pyx_setprop_11pygame_sdl2_6render_9Container_pos, 0, 0}, {(char *)"rect", __pyx_getprop_11pygame_sdl2_6render_9Container_rect, __pyx_setprop_11pygame_sdl2_6render_9Container_rect, 0, 0}, {0, 0, 0, 0, 0} }; static PyTypeObject __pyx_type_11pygame_sdl2_6render_Container = { PyVarObject_HEAD_INIT(0, 0) "pygame_sdl2.render.Container", /*tp_name*/ sizeof(struct __pyx_obj_11pygame_sdl2_6render_Container), /*tp_basicsize*/ 0, /*tp_itemsize*/ __pyx_tp_dealloc_11pygame_sdl2_6render_Container, /*tp_dealloc*/ 0, /*tp_print*/ 0, /*tp_getattr*/ 0, /*tp_setattr*/ #if PY_MAJOR_VERSION < 3 0, /*tp_compare*/ #endif #if PY_MAJOR_VERSION >= 3 0, /*tp_as_async*/ #endif 0, /*tp_repr*/ 0, /*tp_as_number*/ 0, /*tp_as_sequence*/ 0, /*tp_as_mapping*/ 0, /*tp_hash*/ 0, /*tp_call*/ 0, /*tp_str*/ 0, /*tp_getattro*/ 0, /*tp_setattro*/ 0, /*tp_as_buffer*/ Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/ " Multiple sprites, positioned relative to the container. ", /*tp_doc*/ __pyx_tp_traverse_11pygame_sdl2_6render_Container, /*tp_traverse*/ __pyx_tp_clear_11pygame_sdl2_6render_Container, /*tp_clear*/ 0, /*tp_richcompare*/ 0, /*tp_weaklistoffset*/ 0, /*tp_iter*/ 0, /*tp_iternext*/ __pyx_methods_11pygame_sdl2_6render_Container, /*tp_methods*/ 0, /*tp_members*/ __pyx_getsets_11pygame_sdl2_6render_Container, /*tp_getset*/ 0, /*tp_base*/ 0, /*tp_dict*/ 0, /*tp_descr_get*/ 0, /*tp_descr_set*/ 0, /*tp_dictoffset*/ __pyx_pw_11pygame_sdl2_6render_9Container_1__init__, /*tp_init*/ 0, /*tp_alloc*/ __pyx_tp_new_11pygame_sdl2_6render_Container, /*tp_new*/ 0, /*tp_free*/ 0, /*tp_is_gc*/ 0, /*tp_bases*/ 0, /*tp_mro*/ 0, /*tp_cache*/ 0, /*tp_subclasses*/ 0, /*tp_weaklist*/ 0, /*tp_del*/ 0, /*tp_version_tag*/ #if PY_VERSION_HEX >= 0x030400a1 0, /*tp_finalize*/ #endif }; static PyMethodDef __pyx_methods[] = { {0, 0, 0, 0} }; #if PY_MAJOR_VERSION >= 3 static struct PyModuleDef __pyx_moduledef = { #if PY_VERSION_HEX < 0x03020000 { PyObject_HEAD_INIT(NULL) NULL, 0, NULL }, #else PyModuleDef_HEAD_INIT, #endif "render", 0, /* m_doc */ -1, /* m_size */ __pyx_methods /* m_methods */, NULL, /* m_reload */ NULL, /* m_traverse */ NULL, /* m_clear */ NULL /* m_free */ }; #endif static __Pyx_StringTabEntry __pyx_string_tab[] = { {&__pyx_n_s_BLENDMODE_ADD, __pyx_k_BLENDMODE_ADD, sizeof(__pyx_k_BLENDMODE_ADD), 0, 0, 1, 1}, {&__pyx_n_s_BLENDMODE_BLEND, __pyx_k_BLENDMODE_BLEND, sizeof(__pyx_k_BLENDMODE_BLEND), 0, 0, 1, 1}, {&__pyx_n_s_BLENDMODE_MOD, __pyx_k_BLENDMODE_MOD, sizeof(__pyx_k_BLENDMODE_MOD), 0, 0, 1, 1}, {&__pyx_n_s_BLENDMODE_NONE, __pyx_k_BLENDMODE_NONE, sizeof(__pyx_k_BLENDMODE_NONE), 0, 0, 1, 1}, {&__pyx_n_s_Color, __pyx_k_Color, sizeof(__pyx_k_Color), 0, 0, 1, 1}, {&__pyx_kp_s_Invalid_argument_s, __pyx_k_Invalid_argument_s, sizeof(__pyx_k_Invalid_argument_s), 0, 0, 1, 0}, {&__pyx_n_s_Rect, __pyx_k_Rect, sizeof(__pyx_k_Rect), 0, 0, 1, 1}, {&__pyx_kp_s_Renderer_is_not_accelerated, __pyx_k_Renderer_is_not_accelerated, sizeof(__pyx_k_Renderer_is_not_accelerated), 0, 0, 1, 0}, {&__pyx_kp_s_Rotation_not_supported_yet, __pyx_k_Rotation_not_supported_yet, sizeof(__pyx_k_Rotation_not_supported_yet), 0, 0, 1, 0}, {&__pyx_n_s_ValueError, __pyx_k_ValueError, sizeof(__pyx_k_ValueError), 0, 0, 1, 1}, {&__pyx_n_s_a, __pyx_k_a, sizeof(__pyx_k_a), 0, 0, 1, 1}, {&__pyx_n_s_accelerated, __pyx_k_accelerated, sizeof(__pyx_k_accelerated), 0, 0, 1, 1}, {&__pyx_n_s_b, __pyx_k_b, sizeof(__pyx_k_b), 0, 0, 1, 1}, {&__pyx_n_s_color, __pyx_k_color, sizeof(__pyx_k_color), 0, 0, 1, 1}, {&__pyx_n_s_dest, __pyx_k_dest, sizeof(__pyx_k_dest), 0, 0, 1, 1}, {&__pyx_n_s_driver, __pyx_k_driver, sizeof(__pyx_k_driver), 0, 0, 1, 1}, {&__pyx_n_s_error, __pyx_k_error, sizeof(__pyx_k_error), 0, 0, 1, 1}, {&__pyx_n_s_fi, __pyx_k_fi, sizeof(__pyx_k_fi), 0, 0, 1, 1}, {&__pyx_n_s_frame, __pyx_k_frame, sizeof(__pyx_k_frame), 0, 0, 1, 1}, {&__pyx_n_s_frames, __pyx_k_frames, sizeof(__pyx_k_frames), 0, 0, 1, 1}, {&__pyx_n_s_g, __pyx_k_g, sizeof(__pyx_k_g), 0, 0, 1, 1}, {&__pyx_n_s_get_drivers, __pyx_k_get_drivers, sizeof(__pyx_k_get_drivers), 0, 0, 1, 1}, {&__pyx_n_s_h, __pyx_k_h, sizeof(__pyx_k_h), 0, 0, 1, 1}, {&__pyx_kp_s_home_tom_ab_pygame_sdl2_src_pyg, __pyx_k_home_tom_ab_pygame_sdl2_src_pyg, sizeof(__pyx_k_home_tom_ab_pygame_sdl2_src_pyg), 0, 0, 1, 0}, {&__pyx_n_s_image, __pyx_k_image, sizeof(__pyx_k_image), 0, 0, 1, 1}, {&__pyx_n_s_import, __pyx_k_import, sizeof(__pyx_k_import), 0, 0, 1, 1}, {&__pyx_n_s_info, __pyx_k_info, sizeof(__pyx_k_info), 0, 0, 1, 1}, {&__pyx_n_s_iteritems, __pyx_k_iteritems, sizeof(__pyx_k_iteritems), 0, 0, 1, 1}, {&__pyx_n_s_json, __pyx_k_json, sizeof(__pyx_k_json), 0, 0, 1, 1}, {&__pyx_n_s_keys, __pyx_k_keys, sizeof(__pyx_k_keys), 0, 0, 1, 1}, {&__pyx_n_s_load, __pyx_k_load, sizeof(__pyx_k_load), 0, 0, 1, 1}, {&__pyx_n_s_load_texture, __pyx_k_load_texture, sizeof(__pyx_k_load_texture), 0, 0, 1, 1}, {&__pyx_n_s_main, __pyx_k_main, sizeof(__pyx_k_main), 0, 0, 1, 1}, {&__pyx_n_s_max_texture_height, __pyx_k_max_texture_height, sizeof(__pyx_k_max_texture_height), 0, 0, 1, 1}, {&__pyx_n_s_max_texture_width, __pyx_k_max_texture_width, sizeof(__pyx_k_max_texture_width), 0, 0, 1, 1}, {&__pyx_n_s_meta, __pyx_k_meta, sizeof(__pyx_k_meta), 0, 0, 1, 1}, {&__pyx_n_s_n, __pyx_k_n, sizeof(__pyx_k_n), 0, 0, 1, 1}, {&__pyx_n_s_name, __pyx_k_name, sizeof(__pyx_k_name), 0, 0, 1, 1}, {&__pyx_n_s_nodes, __pyx_k_nodes, sizeof(__pyx_k_nodes), 0, 0, 1, 1}, {&__pyx_n_s_num_drivers, __pyx_k_num_drivers, sizeof(__pyx_k_num_drivers), 0, 0, 1, 1}, {&__pyx_n_s_open, __pyx_k_open, sizeof(__pyx_k_open), 0, 0, 1, 1}, {&__pyx_n_s_pos, __pyx_k_pos, sizeof(__pyx_k_pos), 0, 0, 1, 1}, {&__pyx_n_s_pygame_sdl2_color, __pyx_k_pygame_sdl2_color, sizeof(__pyx_k_pygame_sdl2_color), 0, 0, 1, 1}, {&__pyx_n_s_pygame_sdl2_error, __pyx_k_pygame_sdl2_error, sizeof(__pyx_k_pygame_sdl2_error), 0, 0, 1, 1}, {&__pyx_n_s_pygame_sdl2_rect, __pyx_k_pygame_sdl2_rect, sizeof(__pyx_k_pygame_sdl2_rect), 0, 0, 1, 1}, {&__pyx_n_s_pygame_sdl2_render, __pyx_k_pygame_sdl2_render, sizeof(__pyx_k_pygame_sdl2_render), 0, 0, 1, 1}, {&__pyx_n_s_pyx_vtable, __pyx_k_pyx_vtable, sizeof(__pyx_k_pyx_vtable), 0, 0, 1, 1}, {&__pyx_n_s_r, __pyx_k_r, sizeof(__pyx_k_r), 0, 0, 1, 1}, {&__pyx_n_s_range, __pyx_k_range, sizeof(__pyx_k_range), 0, 0, 1, 1}, {&__pyx_n_s_rect, __pyx_k_rect, sizeof(__pyx_k_rect), 0, 0, 1, 1}, {&__pyx_n_s_ren, __pyx_k_ren, sizeof(__pyx_k_ren), 0, 0, 1, 1}, {&__pyx_n_s_render, __pyx_k_render, sizeof(__pyx_k_render), 0, 0, 1, 1}, {&__pyx_n_s_rinfo, __pyx_k_rinfo, sizeof(__pyx_k_rinfo), 0, 0, 1, 1}, {&__pyx_n_s_rotated, __pyx_k_rotated, sizeof(__pyx_k_rotated), 0, 0, 1, 1}, {&__pyx_n_s_rtt, __pyx_k_rtt, sizeof(__pyx_k_rtt), 0, 0, 1, 1}, {&__pyx_n_s_rv, __pyx_k_rv, sizeof(__pyx_k_rv), 0, 0, 1, 1}, {&__pyx_n_s_software, __pyx_k_software, sizeof(__pyx_k_software), 0, 0, 1, 1}, {&__pyx_n_s_sourceSize, __pyx_k_sourceSize, sizeof(__pyx_k_sourceSize), 0, 0, 1, 1}, {&__pyx_n_s_spriteSourceSize, __pyx_k_spriteSourceSize, sizeof(__pyx_k_spriteSourceSize), 0, 0, 1, 1}, {&__pyx_n_s_test, __pyx_k_test, sizeof(__pyx_k_test), 0, 0, 1, 1}, {&__pyx_n_s_tex, __pyx_k_tex, sizeof(__pyx_k_tex), 0, 0, 1, 1}, {&__pyx_n_s_vsync, __pyx_k_vsync, sizeof(__pyx_k_vsync), 0, 0, 1, 1}, {&__pyx_n_s_w, __pyx_k_w, sizeof(__pyx_k_w), 0, 0, 1, 1}, {&__pyx_n_s_warn, __pyx_k_warn, sizeof(__pyx_k_warn), 0, 0, 1, 1}, {&__pyx_n_s_warnings, __pyx_k_warnings, sizeof(__pyx_k_warnings), 0, 0, 1, 1}, {&__pyx_n_s_window, __pyx_k_window, sizeof(__pyx_k_window), 0, 0, 1, 1}, {&__pyx_n_s_x, __pyx_k_x, sizeof(__pyx_k_x), 0, 0, 1, 1}, {&__pyx_n_s_x1, __pyx_k_x1, sizeof(__pyx_k_x1), 0, 0, 1, 1}, {&__pyx_n_s_x2, __pyx_k_x2, sizeof(__pyx_k_x2), 0, 0, 1, 1}, {&__pyx_n_s_y, __pyx_k_y, sizeof(__pyx_k_y), 0, 0, 1, 1}, {&__pyx_n_s_y1, __pyx_k_y1, sizeof(__pyx_k_y1), 0, 0, 1, 1}, {&__pyx_n_s_y2, __pyx_k_y2, sizeof(__pyx_k_y2), 0, 0, 1, 1}, {0, 0, 0, 0, 0, 0, 0} }; static int __Pyx_InitCachedBuiltins(void) { __pyx_builtin_range = __Pyx_GetBuiltinName(__pyx_n_s_range); if (!__pyx_builtin_range) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 58; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_builtin_ValueError = __Pyx_GetBuiltinName(__pyx_n_s_ValueError); if (!__pyx_builtin_ValueError) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 227; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_builtin_open = __Pyx_GetBuiltinName(__pyx_n_s_open); if (!__pyx_builtin_open) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 249; __pyx_clineno = __LINE__; goto __pyx_L1_error;} return 0; __pyx_L1_error:; return -1; } static int __Pyx_InitCachedConstants(void) { __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__Pyx_InitCachedConstants", 0); /* "pygame_sdl2/render.pyx":99 * * if not self.info()["accelerated"]: * warnings.warn("Renderer is not accelerated.") # <<<<<<<<<<<<<< * * def load_texture(self, fi): */ __pyx_tuple_ = PyTuple_Pack(1, __pyx_kp_s_Renderer_is_not_accelerated); if (unlikely(!__pyx_tuple_)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 99; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_tuple_); __Pyx_GIVEREF(__pyx_tuple_); /* "pygame_sdl2/render.pyx":265 * to_sdl_rect((f['x'], f['y'], f['w'], f['h']), &itex.trimmed_rect, "spriteSourceSize") * if idict["rotated"]: * raise error("Rotation not supported yet.") # <<<<<<<<<<<<<< * itex.source_w = idict["sourceSize"]["w"] * itex.source_h = idict["sourceSize"]["h"] */ __pyx_tuple__2 = PyTuple_Pack(1, __pyx_kp_s_Rotation_not_supported_yet); if (unlikely(!__pyx_tuple__2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 265; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_tuple__2); __Pyx_GIVEREF(__pyx_tuple__2); /* "pygame_sdl2/render.pyx":52 * } * * def get_drivers(): # <<<<<<<<<<<<<< * cdef SDL_RendererInfo rinfo * cdef int num_drivers */ __pyx_tuple__3 = PyTuple_Pack(4, __pyx_n_s_rinfo, __pyx_n_s_num_drivers, __pyx_n_s_rv, __pyx_n_s_n); if (unlikely(!__pyx_tuple__3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 52; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_tuple__3); __Pyx_GIVEREF(__pyx_tuple__3); __pyx_codeobj__4 = (PyObject*)__Pyx_PyCode_New(0, 0, 4, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__3, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_tom_ab_pygame_sdl2_src_pyg, __pyx_n_s_get_drivers, 52, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 52; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_RefNannyFinishContext(); return 0; __pyx_L1_error:; __Pyx_RefNannyFinishContext(); return -1; } static int __Pyx_InitGlobals(void) { if (__Pyx_InitStrings(__pyx_string_tab) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; __pyx_int_0 = PyInt_FromLong(0); if (unlikely(!__pyx_int_0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_int_neg_1 = PyInt_FromLong(-1); if (unlikely(!__pyx_int_neg_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} return 0; __pyx_L1_error:; return -1; } #if PY_MAJOR_VERSION < 3 PyMODINIT_FUNC initrender(void); /*proto*/ PyMODINIT_FUNC initrender(void) #else PyMODINIT_FUNC PyInit_render(void); /*proto*/ PyMODINIT_FUNC PyInit_render(void) #endif { PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; PyObject *__pyx_t_5 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannyDeclarations #if CYTHON_REFNANNY __Pyx_RefNanny = __Pyx_RefNannyImportAPI("refnanny"); if (!__Pyx_RefNanny) { PyErr_Clear(); __Pyx_RefNanny = __Pyx_RefNannyImportAPI("Cython.Runtime.refnanny"); if (!__Pyx_RefNanny) Py_FatalError("failed to import 'refnanny' module"); } #endif __Pyx_RefNannySetupContext("PyMODINIT_FUNC PyInit_render(void)", 0); if (__Pyx_check_binary_version() < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_empty_tuple = PyTuple_New(0); if (unlikely(!__pyx_empty_tuple)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_empty_bytes = PyBytes_FromStringAndSize("", 0); if (unlikely(!__pyx_empty_bytes)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} #ifdef __Pyx_CyFunction_USED if (__pyx_CyFunction_init() < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} #endif #ifdef __Pyx_FusedFunction_USED if (__pyx_FusedFunction_init() < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} #endif #ifdef __Pyx_Coroutine_USED if (__pyx_Coroutine_init() < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} #endif #ifdef __Pyx_Generator_USED if (__pyx_Generator_init() < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} #endif #ifdef __Pyx_StopAsyncIteration_USED if (__pyx_StopAsyncIteration_init() < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} #endif /*--- Library function declarations ---*/ /*--- Threads initialization code ---*/ #if defined(__PYX_FORCE_INIT_THREADS) && __PYX_FORCE_INIT_THREADS #ifdef WITH_THREAD /* Python build with threading support? */ PyEval_InitThreads(); #endif #endif /*--- Module creation code ---*/ #if PY_MAJOR_VERSION < 3 __pyx_m = Py_InitModule4("render", __pyx_methods, 0, 0, PYTHON_API_VERSION); Py_XINCREF(__pyx_m); #else __pyx_m = PyModule_Create(&__pyx_moduledef); #endif if (unlikely(!__pyx_m)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_d = PyModule_GetDict(__pyx_m); if (unlikely(!__pyx_d)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} Py_INCREF(__pyx_d); __pyx_b = PyImport_AddModule(__Pyx_BUILTIN_MODULE_NAME); if (unlikely(!__pyx_b)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} #if CYTHON_COMPILING_IN_PYPY Py_INCREF(__pyx_b); #endif if (PyObject_SetAttrString(__pyx_m, "__builtins__", __pyx_b) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; /*--- Initialize various global constants etc. ---*/ if (__Pyx_InitGlobals() < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} #if PY_MAJOR_VERSION < 3 && (__PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT) if (__Pyx_init_sys_getdefaultencoding_params() < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} #endif if (__pyx_module_is_main_pygame_sdl2__render) { if (PyObject_SetAttrString(__pyx_m, "__name__", __pyx_n_s_main) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } #if PY_MAJOR_VERSION >= 3 { PyObject *modules = PyImport_GetModuleDict(); if (unlikely(!modules)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} if (!PyDict_GetItemString(modules, "pygame_sdl2.render")) { if (unlikely(PyDict_SetItemString(modules, "pygame_sdl2.render", __pyx_m) < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } } #endif /*--- Builtin init code ---*/ if (__Pyx_InitCachedBuiltins() < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /*--- Constants init code ---*/ if (__Pyx_InitCachedConstants() < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /*--- Global init code ---*/ /*--- Variable export code ---*/ /*--- Function export code ---*/ /*--- Type init code ---*/ __pyx_vtabptr_11pygame_sdl2_6render_Renderer = &__pyx_vtable_11pygame_sdl2_6render_Renderer; __pyx_vtable_11pygame_sdl2_6render_Renderer.set_drawcolor = (PyObject *(*)(struct __pyx_obj_11pygame_sdl2_6render_Renderer *, PyObject *))__pyx_f_11pygame_sdl2_6render_8Renderer_set_drawcolor; if (PyType_Ready(&__pyx_type_11pygame_sdl2_6render_Renderer) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 67; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_type_11pygame_sdl2_6render_Renderer.tp_print = 0; if (__Pyx_SetVtable(__pyx_type_11pygame_sdl2_6render_Renderer.tp_dict, __pyx_vtabptr_11pygame_sdl2_6render_Renderer) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 67; __pyx_clineno = __LINE__; goto __pyx_L1_error;} if (PyObject_SetAttrString(__pyx_m, "Renderer", (PyObject *)&__pyx_type_11pygame_sdl2_6render_Renderer) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 67; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_ptype_11pygame_sdl2_6render_Renderer = &__pyx_type_11pygame_sdl2_6render_Renderer; __pyx_vtabptr_11pygame_sdl2_6render_Texture = &__pyx_vtable_11pygame_sdl2_6render_Texture; __pyx_vtable_11pygame_sdl2_6render_Texture.set = (PyObject *(*)(struct __pyx_obj_11pygame_sdl2_6render_Texture *, SDL_Renderer *, SDL_Texture *))__pyx_f_11pygame_sdl2_6render_7Texture_set; if (PyType_Ready(&__pyx_type_11pygame_sdl2_6render_Texture) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 172; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_type_11pygame_sdl2_6render_Texture.tp_print = 0; if (__Pyx_SetVtable(__pyx_type_11pygame_sdl2_6render_Texture.tp_dict, __pyx_vtabptr_11pygame_sdl2_6render_Texture) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 172; __pyx_clineno = __LINE__; goto __pyx_L1_error;} if (PyObject_SetAttrString(__pyx_m, "Texture", (PyObject *)&__pyx_type_11pygame_sdl2_6render_Texture) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 172; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_ptype_11pygame_sdl2_6render_Texture = &__pyx_type_11pygame_sdl2_6render_Texture; if (PyType_Ready(&__pyx_type_11pygame_sdl2_6render_TextureNode) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 200; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_type_11pygame_sdl2_6render_TextureNode.tp_print = 0; if (PyObject_SetAttrString(__pyx_m, "TextureNode", (PyObject *)&__pyx_type_11pygame_sdl2_6render_TextureNode) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 200; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_ptype_11pygame_sdl2_6render_TextureNode = &__pyx_type_11pygame_sdl2_6render_TextureNode; if (PyType_Ready(&__pyx_type_11pygame_sdl2_6render_TextureAtlas) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 245; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_type_11pygame_sdl2_6render_TextureAtlas.tp_print = 0; if (PyObject_SetAttrString(__pyx_m, "TextureAtlas", (PyObject *)&__pyx_type_11pygame_sdl2_6render_TextureAtlas) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 245; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_ptype_11pygame_sdl2_6render_TextureAtlas = &__pyx_type_11pygame_sdl2_6render_TextureAtlas; __pyx_vtabptr_11pygame_sdl2_6render_Sprite = &__pyx_vtable_11pygame_sdl2_6render_Sprite; __pyx_vtable_11pygame_sdl2_6render_Sprite.adjust_rect = (void (*)(struct __pyx_obj_11pygame_sdl2_6render_Sprite *, SDL_Rect const *, SDL_Rect const *, SDL_Rect *))__pyx_f_11pygame_sdl2_6render_6Sprite_adjust_rect; if (PyType_Ready(&__pyx_type_11pygame_sdl2_6render_Sprite) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 278; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_type_11pygame_sdl2_6render_Sprite.tp_print = 0; if (__Pyx_SetVtable(__pyx_type_11pygame_sdl2_6render_Sprite.tp_dict, __pyx_vtabptr_11pygame_sdl2_6render_Sprite) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 278; __pyx_clineno = __LINE__; goto __pyx_L1_error;} if (PyObject_SetAttrString(__pyx_m, "Sprite", (PyObject *)&__pyx_type_11pygame_sdl2_6render_Sprite) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 278; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_ptype_11pygame_sdl2_6render_Sprite = &__pyx_type_11pygame_sdl2_6render_Sprite; if (PyType_Ready(&__pyx_type_11pygame_sdl2_6render_Container) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 434; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_type_11pygame_sdl2_6render_Container.tp_print = 0; #if CYTHON_COMPILING_IN_CPYTHON { PyObject *wrapper = PyObject_GetAttrString((PyObject *)&__pyx_type_11pygame_sdl2_6render_Container, "__init__"); if (unlikely(!wrapper)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 434; __pyx_clineno = __LINE__; goto __pyx_L1_error;} if (Py_TYPE(wrapper) == &PyWrapperDescr_Type) { __pyx_wrapperbase_11pygame_sdl2_6render_9Container___init__ = *((PyWrapperDescrObject *)wrapper)->d_base; __pyx_wrapperbase_11pygame_sdl2_6render_9Container___init__.doc = __pyx_doc_11pygame_sdl2_6render_9Container___init__; ((PyWrapperDescrObject *)wrapper)->d_base = &__pyx_wrapperbase_11pygame_sdl2_6render_9Container___init__; } } #endif if (PyObject_SetAttrString(__pyx_m, "Container", (PyObject *)&__pyx_type_11pygame_sdl2_6render_Container) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 434; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_ptype_11pygame_sdl2_6render_Container = &__pyx_type_11pygame_sdl2_6render_Container; /*--- Type import code ---*/ __pyx_ptype_11pygame_sdl2_7surface_Surface = __Pyx_ImportType("pygame_sdl2.surface", "Surface", sizeof(struct __pyx_obj_11pygame_sdl2_7surface_Surface), 1); if (unlikely(!__pyx_ptype_11pygame_sdl2_7surface_Surface)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 23; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_vtabptr_11pygame_sdl2_7surface_Surface = (struct __pyx_vtabstruct_11pygame_sdl2_7surface_Surface*)__Pyx_GetVtable(__pyx_ptype_11pygame_sdl2_7surface_Surface->tp_dict); if (unlikely(!__pyx_vtabptr_11pygame_sdl2_7surface_Surface)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 23; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_ptype_11pygame_sdl2_7display_Window = __Pyx_ImportType("pygame_sdl2.display", "Window", sizeof(struct __pyx_obj_11pygame_sdl2_7display_Window), 1); if (unlikely(!__pyx_ptype_11pygame_sdl2_7display_Window)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 23; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_ptype_11pygame_sdl2_4rect_Rect = __Pyx_ImportType("pygame_sdl2.rect", "Rect", sizeof(struct __pyx_obj_11pygame_sdl2_4rect_Rect), 1); if (unlikely(!__pyx_ptype_11pygame_sdl2_4rect_Rect)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 21; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /*--- Variable import code ---*/ __pyx_t_1 = __Pyx_ImportModule("pygame_sdl2.display"); if (!__pyx_t_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} if (__Pyx_ImportVoidPtr(__pyx_t_1, "main_window", (void **)&__pyx_vp_11pygame_sdl2_7display_main_window, "struct __pyx_obj_11pygame_sdl2_7display_Window *") < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} Py_DECREF(__pyx_t_1); __pyx_t_1 = 0; /*--- Function import code ---*/ __pyx_t_2 = __Pyx_ImportModule("pygame_sdl2.rwobject"); if (!__pyx_t_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} if (__Pyx_ImportFunction(__pyx_t_2, "to_rwops", (void (**)(void))&__pyx_f_11pygame_sdl2_8rwobject_to_rwops, "SDL_RWops *(PyObject *, struct __pyx_opt_args_11pygame_sdl2_8rwobject_to_rwops *__pyx_optional_args)") < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} Py_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_3 = __Pyx_ImportModule("pygame_sdl2.rect"); if (!__pyx_t_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} if (__Pyx_ImportFunction(__pyx_t_3, "to_sdl_rect", (void (**)(void))&__pyx_f_11pygame_sdl2_4rect_to_sdl_rect, "int (PyObject *, SDL_Rect *, struct __pyx_opt_args_11pygame_sdl2_4rect_to_sdl_rect *__pyx_optional_args)") < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} Py_DECREF(__pyx_t_3); __pyx_t_3 = 0; /*--- Execution code ---*/ #if defined(__Pyx_Generator_USED) || defined(__Pyx_Coroutine_USED) if (__Pyx_patch_abc() < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} #endif /* "pygame_sdl2/render.pyx":27 * from pygame_sdl2.rect cimport to_sdl_rect * * from pygame_sdl2.rect import Rect # <<<<<<<<<<<<<< * from pygame_sdl2.error import error * from pygame_sdl2.color import Color */ __pyx_t_4 = PyList_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 27; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); __Pyx_INCREF(__pyx_n_s_Rect); __Pyx_GIVEREF(__pyx_n_s_Rect); PyList_SET_ITEM(__pyx_t_4, 0, __pyx_n_s_Rect); __pyx_t_5 = __Pyx_Import(__pyx_n_s_pygame_sdl2_rect, __pyx_t_4, -1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 27; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_t_4 = __Pyx_ImportFrom(__pyx_t_5, __pyx_n_s_Rect); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 27; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); if (PyDict_SetItem(__pyx_d, __pyx_n_s_Rect, __pyx_t_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 27; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; /* "pygame_sdl2/render.pyx":28 * * from pygame_sdl2.rect import Rect * from pygame_sdl2.error import error # <<<<<<<<<<<<<< * from pygame_sdl2.color import Color * import json */ __pyx_t_5 = PyList_New(1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 28; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); __Pyx_INCREF(__pyx_n_s_error); __Pyx_GIVEREF(__pyx_n_s_error); PyList_SET_ITEM(__pyx_t_5, 0, __pyx_n_s_error); __pyx_t_4 = __Pyx_Import(__pyx_n_s_pygame_sdl2_error, __pyx_t_5, -1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 28; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __pyx_t_5 = __Pyx_ImportFrom(__pyx_t_4, __pyx_n_s_error); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 28; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); if (PyDict_SetItem(__pyx_d, __pyx_n_s_error, __pyx_t_5) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 28; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; /* "pygame_sdl2/render.pyx":29 * from pygame_sdl2.rect import Rect * from pygame_sdl2.error import error * from pygame_sdl2.color import Color # <<<<<<<<<<<<<< * import json * import warnings */ __pyx_t_4 = PyList_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 29; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); __Pyx_INCREF(__pyx_n_s_Color); __Pyx_GIVEREF(__pyx_n_s_Color); PyList_SET_ITEM(__pyx_t_4, 0, __pyx_n_s_Color); __pyx_t_5 = __Pyx_Import(__pyx_n_s_pygame_sdl2_color, __pyx_t_4, -1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 29; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_t_4 = __Pyx_ImportFrom(__pyx_t_5, __pyx_n_s_Color); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 29; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); if (PyDict_SetItem(__pyx_d, __pyx_n_s_Color, __pyx_t_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 29; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; /* "pygame_sdl2/render.pyx":30 * from pygame_sdl2.error import error * from pygame_sdl2.color import Color * import json # <<<<<<<<<<<<<< * import warnings * */ __pyx_t_5 = __Pyx_Import(__pyx_n_s_json, 0, -1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 30; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); if (PyDict_SetItem(__pyx_d, __pyx_n_s_json, __pyx_t_5) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 30; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; /* "pygame_sdl2/render.pyx":31 * from pygame_sdl2.color import Color * import json * import warnings # <<<<<<<<<<<<<< * * BLENDMODE_NONE = SDL_BLENDMODE_NONE */ __pyx_t_5 = __Pyx_Import(__pyx_n_s_warnings, 0, -1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 31; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); if (PyDict_SetItem(__pyx_d, __pyx_n_s_warnings, __pyx_t_5) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 31; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; /* "pygame_sdl2/render.pyx":33 * import warnings * * BLENDMODE_NONE = SDL_BLENDMODE_NONE # <<<<<<<<<<<<<< * BLENDMODE_BLEND = SDL_BLENDMODE_BLEND * BLENDMODE_ADD = SDL_BLENDMODE_ADD */ __pyx_t_5 = __Pyx_PyInt_From_SDL_BlendMode(SDL_BLENDMODE_NONE); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 33; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); if (PyDict_SetItem(__pyx_d, __pyx_n_s_BLENDMODE_NONE, __pyx_t_5) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 33; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; /* "pygame_sdl2/render.pyx":34 * * BLENDMODE_NONE = SDL_BLENDMODE_NONE * BLENDMODE_BLEND = SDL_BLENDMODE_BLEND # <<<<<<<<<<<<<< * BLENDMODE_ADD = SDL_BLENDMODE_ADD * BLENDMODE_MOD = SDL_BLENDMODE_MOD */ __pyx_t_5 = __Pyx_PyInt_From_SDL_BlendMode(SDL_BLENDMODE_BLEND); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 34; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); if (PyDict_SetItem(__pyx_d, __pyx_n_s_BLENDMODE_BLEND, __pyx_t_5) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 34; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; /* "pygame_sdl2/render.pyx":35 * BLENDMODE_NONE = SDL_BLENDMODE_NONE * BLENDMODE_BLEND = SDL_BLENDMODE_BLEND * BLENDMODE_ADD = SDL_BLENDMODE_ADD # <<<<<<<<<<<<<< * BLENDMODE_MOD = SDL_BLENDMODE_MOD * */ __pyx_t_5 = __Pyx_PyInt_From_SDL_BlendMode(SDL_BLENDMODE_ADD); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 35; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); if (PyDict_SetItem(__pyx_d, __pyx_n_s_BLENDMODE_ADD, __pyx_t_5) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 35; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; /* "pygame_sdl2/render.pyx":36 * BLENDMODE_BLEND = SDL_BLENDMODE_BLEND * BLENDMODE_ADD = SDL_BLENDMODE_ADD * BLENDMODE_MOD = SDL_BLENDMODE_MOD # <<<<<<<<<<<<<< * * cdef bint DEBUG_DRAW_BBOX = True */ __pyx_t_5 = __Pyx_PyInt_From_SDL_BlendMode(SDL_BLENDMODE_MOD); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 36; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); if (PyDict_SetItem(__pyx_d, __pyx_n_s_BLENDMODE_MOD, __pyx_t_5) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 36; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; /* "pygame_sdl2/render.pyx":38 * BLENDMODE_MOD = SDL_BLENDMODE_MOD * * cdef bint DEBUG_DRAW_BBOX = True # <<<<<<<<<<<<<< * * cdef rinfo_to_dict(SDL_RendererInfo *rinfo): */ __pyx_v_11pygame_sdl2_6render_DEBUG_DRAW_BBOX = 1; /* "pygame_sdl2/render.pyx":52 * } * * def get_drivers(): # <<<<<<<<<<<<<< * cdef SDL_RendererInfo rinfo * cdef int num_drivers */ __pyx_t_5 = PyCFunction_NewEx(&__pyx_mdef_11pygame_sdl2_6render_1get_drivers, NULL, __pyx_n_s_pygame_sdl2_render); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 52; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); if (PyDict_SetItem(__pyx_d, __pyx_n_s_get_drivers, __pyx_t_5) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 52; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; /* "pygame_sdl2/render.pyx":1 * # Copyright 2014 Patrick Dawson # <<<<<<<<<<<<<< * # * # This software is provided 'as-is', without any express or implied */ __pyx_t_5 = PyDict_New(); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); if (PyDict_SetItem(__pyx_d, __pyx_n_s_test, __pyx_t_5) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; /*--- Wrapped vars code ---*/ goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_5); if (__pyx_m) { if (__pyx_d) { __Pyx_AddTraceback("init pygame_sdl2.render", __pyx_clineno, __pyx_lineno, __pyx_filename); } Py_DECREF(__pyx_m); __pyx_m = 0; } else if (!PyErr_Occurred()) { PyErr_SetString(PyExc_ImportError, "init pygame_sdl2.render"); } __pyx_L0:; __Pyx_RefNannyFinishContext(); #if PY_MAJOR_VERSION < 3 return; #else return __pyx_m; #endif } /* --- Runtime support code --- */ #if CYTHON_REFNANNY static __Pyx_RefNannyAPIStruct *__Pyx_RefNannyImportAPI(const char *modname) { PyObject *m = NULL, *p = NULL; void *r = NULL; m = PyImport_ImportModule((char *)modname); if (!m) goto end; p = PyObject_GetAttrString(m, (char *)"RefNannyAPI"); if (!p) goto end; r = PyLong_AsVoidPtr(p); end: Py_XDECREF(p); Py_XDECREF(m); return (__Pyx_RefNannyAPIStruct *)r; } #endif static PyObject *__Pyx_GetBuiltinName(PyObject *name) { PyObject* result = __Pyx_PyObject_GetAttrStr(__pyx_b, name); if (unlikely(!result)) { PyErr_Format(PyExc_NameError, #if PY_MAJOR_VERSION >= 3 "name '%U' is not defined", name); #else "name '%.200s' is not defined", PyString_AS_STRING(name)); #endif } return result; } static CYTHON_INLINE PyObject *__Pyx_GetModuleGlobalName(PyObject *name) { PyObject *result; #if CYTHON_COMPILING_IN_CPYTHON result = PyDict_GetItem(__pyx_d, name); if (likely(result)) { Py_INCREF(result); } else { #else result = PyObject_GetItem(__pyx_d, name); if (!result) { PyErr_Clear(); #endif result = __Pyx_GetBuiltinName(name); } return result; } #if CYTHON_COMPILING_IN_CPYTHON static CYTHON_INLINE PyObject* __Pyx_PyObject_Call(PyObject *func, PyObject *arg, PyObject *kw) { PyObject *result; ternaryfunc call = func->ob_type->tp_call; if (unlikely(!call)) return PyObject_Call(func, arg, kw); if (unlikely(Py_EnterRecursiveCall((char*)" while calling a Python object"))) return NULL; result = (*call)(func, arg, kw); Py_LeaveRecursiveCall(); if (unlikely(!result) && unlikely(!PyErr_Occurred())) { PyErr_SetString( PyExc_SystemError, "NULL result without error in PyObject_Call"); } return result; } #endif #if CYTHON_COMPILING_IN_CPYTHON static CYTHON_INLINE PyObject* __Pyx_PyObject_CallMethO(PyObject *func, PyObject *arg) { PyObject *self, *result; PyCFunction cfunc; cfunc = PyCFunction_GET_FUNCTION(func); self = PyCFunction_GET_SELF(func); if (unlikely(Py_EnterRecursiveCall((char*)" while calling a Python object"))) return NULL; result = cfunc(self, arg); Py_LeaveRecursiveCall(); if (unlikely(!result) && unlikely(!PyErr_Occurred())) { PyErr_SetString( PyExc_SystemError, "NULL result without error in PyObject_Call"); } return result; } #endif #if CYTHON_COMPILING_IN_CPYTHON static PyObject* __Pyx__PyObject_CallOneArg(PyObject *func, PyObject *arg) { PyObject *result; PyObject *args = PyTuple_New(1); if (unlikely(!args)) return NULL; Py_INCREF(arg); PyTuple_SET_ITEM(args, 0, arg); result = __Pyx_PyObject_Call(func, args, NULL); Py_DECREF(args); return result; } static CYTHON_INLINE PyObject* __Pyx_PyObject_CallOneArg(PyObject *func, PyObject *arg) { #ifdef __Pyx_CyFunction_USED if (likely(PyCFunction_Check(func) || PyObject_TypeCheck(func, __pyx_CyFunctionType))) { #else if (likely(PyCFunction_Check(func))) { #endif if (likely(PyCFunction_GET_FLAGS(func) & METH_O)) { return __Pyx_PyObject_CallMethO(func, arg); } } return __Pyx__PyObject_CallOneArg(func, arg); } #else static CYTHON_INLINE PyObject* __Pyx_PyObject_CallOneArg(PyObject *func, PyObject *arg) { PyObject *result; PyObject *args = PyTuple_Pack(1, arg); if (unlikely(!args)) return NULL; result = __Pyx_PyObject_Call(func, args, NULL); Py_DECREF(args); return result; } #endif #if CYTHON_COMPILING_IN_CPYTHON static CYTHON_INLINE PyObject* __Pyx_PyObject_CallNoArg(PyObject *func) { #ifdef __Pyx_CyFunction_USED if (likely(PyCFunction_Check(func) || PyObject_TypeCheck(func, __pyx_CyFunctionType))) { #else if (likely(PyCFunction_Check(func))) { #endif if (likely(PyCFunction_GET_FLAGS(func) & METH_NOARGS)) { return __Pyx_PyObject_CallMethO(func, NULL); } } return __Pyx_PyObject_Call(func, __pyx_empty_tuple, NULL); } #endif static CYTHON_INLINE void __Pyx_ErrRestore(PyObject *type, PyObject *value, PyObject *tb) { #if CYTHON_COMPILING_IN_CPYTHON PyObject *tmp_type, *tmp_value, *tmp_tb; PyThreadState *tstate = PyThreadState_GET(); tmp_type = tstate->curexc_type; tmp_value = tstate->curexc_value; tmp_tb = tstate->curexc_traceback; tstate->curexc_type = type; tstate->curexc_value = value; tstate->curexc_traceback = tb; Py_XDECREF(tmp_type); Py_XDECREF(tmp_value); Py_XDECREF(tmp_tb); #else PyErr_Restore(type, value, tb); #endif } static CYTHON_INLINE void __Pyx_ErrFetch(PyObject **type, PyObject **value, PyObject **tb) { #if CYTHON_COMPILING_IN_CPYTHON PyThreadState *tstate = PyThreadState_GET(); *type = tstate->curexc_type; *value = tstate->curexc_value; *tb = tstate->curexc_traceback; tstate->curexc_type = 0; tstate->curexc_value = 0; tstate->curexc_traceback = 0; #else PyErr_Fetch(type, value, tb); #endif } #if PY_MAJOR_VERSION < 3 static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, CYTHON_UNUSED PyObject *cause) { Py_XINCREF(type); if (!value || value == Py_None) value = NULL; else Py_INCREF(value); if (!tb || tb == Py_None) tb = NULL; else { Py_INCREF(tb); if (!PyTraceBack_Check(tb)) { PyErr_SetString(PyExc_TypeError, "raise: arg 3 must be a traceback or None"); goto raise_error; } } if (PyType_Check(type)) { #if CYTHON_COMPILING_IN_PYPY if (!value) { Py_INCREF(Py_None); value = Py_None; } #endif PyErr_NormalizeException(&type, &value, &tb); } else { if (value) { PyErr_SetString(PyExc_TypeError, "instance exception may not have a separate value"); goto raise_error; } value = type; type = (PyObject*) Py_TYPE(type); Py_INCREF(type); if (!PyType_IsSubtype((PyTypeObject *)type, (PyTypeObject *)PyExc_BaseException)) { PyErr_SetString(PyExc_TypeError, "raise: exception class must be a subclass of BaseException"); goto raise_error; } } __Pyx_ErrRestore(type, value, tb); return; raise_error: Py_XDECREF(value); Py_XDECREF(type); Py_XDECREF(tb); return; } #else static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, PyObject *cause) { PyObject* owned_instance = NULL; if (tb == Py_None) { tb = 0; } else if (tb && !PyTraceBack_Check(tb)) { PyErr_SetString(PyExc_TypeError, "raise: arg 3 must be a traceback or None"); goto bad; } if (value == Py_None) value = 0; if (PyExceptionInstance_Check(type)) { if (value) { PyErr_SetString(PyExc_TypeError, "instance exception may not have a separate value"); goto bad; } value = type; type = (PyObject*) Py_TYPE(value); } else if (PyExceptionClass_Check(type)) { PyObject *instance_class = NULL; if (value && PyExceptionInstance_Check(value)) { instance_class = (PyObject*) Py_TYPE(value); if (instance_class != type) { int is_subclass = PyObject_IsSubclass(instance_class, type); if (!is_subclass) { instance_class = NULL; } else if (unlikely(is_subclass == -1)) { goto bad; } else { type = instance_class; } } } if (!instance_class) { PyObject *args; if (!value) args = PyTuple_New(0); else if (PyTuple_Check(value)) { Py_INCREF(value); args = value; } else args = PyTuple_Pack(1, value); if (!args) goto bad; owned_instance = PyObject_Call(type, args, NULL); Py_DECREF(args); if (!owned_instance) goto bad; value = owned_instance; if (!PyExceptionInstance_Check(value)) { PyErr_Format(PyExc_TypeError, "calling %R should have returned an instance of " "BaseException, not %R", type, Py_TYPE(value)); goto bad; } } } else { PyErr_SetString(PyExc_TypeError, "raise: exception class must be a subclass of BaseException"); goto bad; } #if PY_VERSION_HEX >= 0x03030000 if (cause) { #else if (cause && cause != Py_None) { #endif PyObject *fixed_cause; if (cause == Py_None) { fixed_cause = NULL; } else if (PyExceptionClass_Check(cause)) { fixed_cause = PyObject_CallObject(cause, NULL); if (fixed_cause == NULL) goto bad; } else if (PyExceptionInstance_Check(cause)) { fixed_cause = cause; Py_INCREF(fixed_cause); } else { PyErr_SetString(PyExc_TypeError, "exception causes must derive from " "BaseException"); goto bad; } PyException_SetCause(value, fixed_cause); } PyErr_SetObject(type, value); if (tb) { #if CYTHON_COMPILING_IN_PYPY PyObject *tmp_type, *tmp_value, *tmp_tb; PyErr_Fetch(&tmp_type, &tmp_value, &tmp_tb); Py_INCREF(tb); PyErr_Restore(tmp_type, tmp_value, tb); Py_XDECREF(tmp_tb); #else PyThreadState *tstate = PyThreadState_GET(); PyObject* tmp_tb = tstate->curexc_traceback; if (tb != tmp_tb) { Py_INCREF(tb); tstate->curexc_traceback = tb; Py_XDECREF(tmp_tb); } #endif } bad: Py_XDECREF(owned_instance); return; } #endif static void __Pyx_RaiseArgtupleInvalid( const char* func_name, int exact, Py_ssize_t num_min, Py_ssize_t num_max, Py_ssize_t num_found) { Py_ssize_t num_expected; const char *more_or_less; if (num_found < num_min) { num_expected = num_min; more_or_less = "at least"; } else { num_expected = num_max; more_or_less = "at most"; } if (exact) { more_or_less = "exactly"; } PyErr_Format(PyExc_TypeError, "%.200s() takes %.8s %" CYTHON_FORMAT_SSIZE_T "d positional argument%.1s (%" CYTHON_FORMAT_SSIZE_T "d given)", func_name, more_or_less, num_expected, (num_expected == 1) ? "" : "s", num_found); } static CYTHON_INLINE int __Pyx_CheckKeywordStrings( PyObject *kwdict, const char* function_name, int kw_allowed) { PyObject* key = 0; Py_ssize_t pos = 0; #if CYTHON_COMPILING_IN_PYPY if (!kw_allowed && PyDict_Next(kwdict, &pos, &key, 0)) goto invalid_keyword; return 1; #else while (PyDict_Next(kwdict, &pos, &key, 0)) { #if PY_MAJOR_VERSION < 3 if (unlikely(!PyString_CheckExact(key)) && unlikely(!PyString_Check(key))) #endif if (unlikely(!PyUnicode_Check(key))) goto invalid_keyword_type; } if ((!kw_allowed) && unlikely(key)) goto invalid_keyword; return 1; invalid_keyword_type: PyErr_Format(PyExc_TypeError, "%.200s() keywords must be strings", function_name); return 0; #endif invalid_keyword: PyErr_Format(PyExc_TypeError, #if PY_MAJOR_VERSION < 3 "%.200s() got an unexpected keyword argument '%.200s'", function_name, PyString_AsString(key)); #else "%s() got an unexpected keyword argument '%U'", function_name, key); #endif return 0; } static void __Pyx_RaiseDoubleKeywordsError( const char* func_name, PyObject* kw_name) { PyErr_Format(PyExc_TypeError, #if PY_MAJOR_VERSION >= 3 "%s() got multiple values for keyword argument '%U'", func_name, kw_name); #else "%s() got multiple values for keyword argument '%s'", func_name, PyString_AsString(kw_name)); #endif } static int __Pyx_ParseOptionalKeywords( PyObject *kwds, PyObject **argnames[], PyObject *kwds2, PyObject *values[], Py_ssize_t num_pos_args, const char* function_name) { PyObject *key = 0, *value = 0; Py_ssize_t pos = 0; PyObject*** name; PyObject*** first_kw_arg = argnames + num_pos_args; while (PyDict_Next(kwds, &pos, &key, &value)) { name = first_kw_arg; while (*name && (**name != key)) name++; if (*name) { values[name-argnames] = value; continue; } name = first_kw_arg; #if PY_MAJOR_VERSION < 3 if (likely(PyString_CheckExact(key)) || likely(PyString_Check(key))) { while (*name) { if ((CYTHON_COMPILING_IN_PYPY || PyString_GET_SIZE(**name) == PyString_GET_SIZE(key)) && _PyString_Eq(**name, key)) { values[name-argnames] = value; break; } name++; } if (*name) continue; else { PyObject*** argname = argnames; while (argname != first_kw_arg) { if ((**argname == key) || ( (CYTHON_COMPILING_IN_PYPY || PyString_GET_SIZE(**argname) == PyString_GET_SIZE(key)) && _PyString_Eq(**argname, key))) { goto arg_passed_twice; } argname++; } } } else #endif if (likely(PyUnicode_Check(key))) { while (*name) { int cmp = (**name == key) ? 0 : #if !CYTHON_COMPILING_IN_PYPY && PY_MAJOR_VERSION >= 3 (PyUnicode_GET_SIZE(**name) != PyUnicode_GET_SIZE(key)) ? 1 : #endif PyUnicode_Compare(**name, key); if (cmp < 0 && unlikely(PyErr_Occurred())) goto bad; if (cmp == 0) { values[name-argnames] = value; break; } name++; } if (*name) continue; else { PyObject*** argname = argnames; while (argname != first_kw_arg) { int cmp = (**argname == key) ? 0 : #if !CYTHON_COMPILING_IN_PYPY && PY_MAJOR_VERSION >= 3 (PyUnicode_GET_SIZE(**argname) != PyUnicode_GET_SIZE(key)) ? 1 : #endif PyUnicode_Compare(**argname, key); if (cmp < 0 && unlikely(PyErr_Occurred())) goto bad; if (cmp == 0) goto arg_passed_twice; argname++; } } } else goto invalid_keyword_type; if (kwds2) { if (unlikely(PyDict_SetItem(kwds2, key, value))) goto bad; } else { goto invalid_keyword; } } return 0; arg_passed_twice: __Pyx_RaiseDoubleKeywordsError(function_name, key); goto bad; invalid_keyword_type: PyErr_Format(PyExc_TypeError, "%.200s() keywords must be strings", function_name); goto bad; invalid_keyword: PyErr_Format(PyExc_TypeError, #if PY_MAJOR_VERSION < 3 "%.200s() got an unexpected keyword argument '%.200s'", function_name, PyString_AsString(key)); #else "%s() got an unexpected keyword argument '%U'", function_name, key); #endif bad: return -1; } static void __Pyx_RaiseArgumentTypeInvalid(const char* name, PyObject *obj, PyTypeObject *type) { PyErr_Format(PyExc_TypeError, "Argument '%.200s' has incorrect type (expected %.200s, got %.200s)", name, type->tp_name, Py_TYPE(obj)->tp_name); } static CYTHON_INLINE int __Pyx_ArgTypeTest(PyObject *obj, PyTypeObject *type, int none_allowed, const char *name, int exact) { if (unlikely(!type)) { PyErr_SetString(PyExc_SystemError, "Missing type object"); return 0; } if (none_allowed && obj == Py_None) return 1; else if (exact) { if (likely(Py_TYPE(obj) == type)) return 1; #if PY_MAJOR_VERSION == 2 else if ((type == &PyBaseString_Type) && likely(__Pyx_PyBaseString_CheckExact(obj))) return 1; #endif } else { if (likely(PyObject_TypeCheck(obj, type))) return 1; } __Pyx_RaiseArgumentTypeInvalid(name, obj, type); return 0; } static CYTHON_INLINE int __Pyx_TypeTest(PyObject *obj, PyTypeObject *type) { if (unlikely(!type)) { PyErr_SetString(PyExc_SystemError, "Missing type object"); return 0; } if (likely(PyObject_TypeCheck(obj, type))) return 1; PyErr_Format(PyExc_TypeError, "Cannot convert %.200s to %.200s", Py_TYPE(obj)->tp_name, type->tp_name); return 0; } static CYTHON_INLINE int __Pyx_IterFinish(void) { #if CYTHON_COMPILING_IN_CPYTHON PyThreadState *tstate = PyThreadState_GET(); PyObject* exc_type = tstate->curexc_type; if (unlikely(exc_type)) { if (likely(exc_type == PyExc_StopIteration) || PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration)) { PyObject *exc_value, *exc_tb; exc_value = tstate->curexc_value; exc_tb = tstate->curexc_traceback; tstate->curexc_type = 0; tstate->curexc_value = 0; tstate->curexc_traceback = 0; Py_DECREF(exc_type); Py_XDECREF(exc_value); Py_XDECREF(exc_tb); return 0; } else { return -1; } } return 0; #else if (unlikely(PyErr_Occurred())) { if (likely(PyErr_ExceptionMatches(PyExc_StopIteration))) { PyErr_Clear(); return 0; } else { return -1; } } return 0; #endif } static PyObject* __Pyx_PyObject_CallMethod0(PyObject* obj, PyObject* method_name) { PyObject *method, *result = NULL; method = __Pyx_PyObject_GetAttrStr(obj, method_name); if (unlikely(!method)) goto bad; #if CYTHON_COMPILING_IN_CPYTHON if (likely(PyMethod_Check(method))) { PyObject *self = PyMethod_GET_SELF(method); if (likely(self)) { PyObject *function = PyMethod_GET_FUNCTION(method); result = __Pyx_PyObject_CallOneArg(function, self); Py_DECREF(method); return result; } } #endif result = __Pyx_PyObject_CallNoArg(method); Py_DECREF(method); bad: return result; } static CYTHON_INLINE void __Pyx_RaiseNeedMoreValuesError(Py_ssize_t index) { PyErr_Format(PyExc_ValueError, "need more than %" CYTHON_FORMAT_SSIZE_T "d value%.1s to unpack", index, (index == 1) ? "" : "s"); } static CYTHON_INLINE void __Pyx_RaiseTooManyValuesError(Py_ssize_t expected) { PyErr_Format(PyExc_ValueError, "too many values to unpack (expected %" CYTHON_FORMAT_SSIZE_T "d)", expected); } static int __Pyx_IternextUnpackEndCheck(PyObject *retval, Py_ssize_t expected) { if (unlikely(retval)) { Py_DECREF(retval); __Pyx_RaiseTooManyValuesError(expected); return -1; } else { return __Pyx_IterFinish(); } return 0; } static CYTHON_INLINE void __Pyx_RaiseNoneNotIterableError(void) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable"); } static void __Pyx_UnpackTupleError(PyObject *t, Py_ssize_t index) { if (t == Py_None) { __Pyx_RaiseNoneNotIterableError(); } else if (PyTuple_GET_SIZE(t) < index) { __Pyx_RaiseNeedMoreValuesError(PyTuple_GET_SIZE(t)); } else { __Pyx_RaiseTooManyValuesError(index); } } static CYTHON_INLINE int __Pyx_unpack_tuple2(PyObject* tuple, PyObject** pvalue1, PyObject** pvalue2, int is_tuple, int has_known_size, int decref_tuple) { Py_ssize_t index; PyObject *value1 = NULL, *value2 = NULL, *iter = NULL; if (!is_tuple && unlikely(!PyTuple_Check(tuple))) { iternextfunc iternext; iter = PyObject_GetIter(tuple); if (unlikely(!iter)) goto bad; if (decref_tuple) { Py_DECREF(tuple); tuple = NULL; } iternext = Py_TYPE(iter)->tp_iternext; value1 = iternext(iter); if (unlikely(!value1)) { index = 0; goto unpacking_failed; } value2 = iternext(iter); if (unlikely(!value2)) { index = 1; goto unpacking_failed; } if (!has_known_size && unlikely(__Pyx_IternextUnpackEndCheck(iternext(iter), 2))) goto bad; Py_DECREF(iter); } else { if (!has_known_size && unlikely(PyTuple_GET_SIZE(tuple) != 2)) { __Pyx_UnpackTupleError(tuple, 2); goto bad; } #if CYTHON_COMPILING_IN_PYPY value1 = PySequence_ITEM(tuple, 0); if (unlikely(!value1)) goto bad; value2 = PySequence_ITEM(tuple, 1); if (unlikely(!value2)) goto bad; #else value1 = PyTuple_GET_ITEM(tuple, 0); value2 = PyTuple_GET_ITEM(tuple, 1); Py_INCREF(value1); Py_INCREF(value2); #endif if (decref_tuple) { Py_DECREF(tuple); } } *pvalue1 = value1; *pvalue2 = value2; return 0; unpacking_failed: if (!has_known_size && __Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); bad: Py_XDECREF(iter); Py_XDECREF(value1); Py_XDECREF(value2); if (decref_tuple) { Py_XDECREF(tuple); } return -1; } static CYTHON_INLINE PyObject* __Pyx_dict_iterator(PyObject* iterable, int is_dict, PyObject* method_name, Py_ssize_t* p_orig_length, int* p_source_is_dict) { is_dict = is_dict || likely(PyDict_CheckExact(iterable)); *p_source_is_dict = is_dict; #if !CYTHON_COMPILING_IN_PYPY if (is_dict) { *p_orig_length = PyDict_Size(iterable); Py_INCREF(iterable); return iterable; } #endif *p_orig_length = 0; if (method_name) { PyObject* iter; iterable = __Pyx_PyObject_CallMethod0(iterable, method_name); if (!iterable) return NULL; #if !CYTHON_COMPILING_IN_PYPY if (PyTuple_CheckExact(iterable) || PyList_CheckExact(iterable)) return iterable; #endif iter = PyObject_GetIter(iterable); Py_DECREF(iterable); return iter; } return PyObject_GetIter(iterable); } static CYTHON_INLINE int __Pyx_dict_iter_next( PyObject* iter_obj, CYTHON_NCP_UNUSED Py_ssize_t orig_length, CYTHON_NCP_UNUSED Py_ssize_t* ppos, PyObject** pkey, PyObject** pvalue, PyObject** pitem, int source_is_dict) { PyObject* next_item; #if !CYTHON_COMPILING_IN_PYPY if (source_is_dict) { PyObject *key, *value; if (unlikely(orig_length != PyDict_Size(iter_obj))) { PyErr_SetString(PyExc_RuntimeError, "dictionary changed size during iteration"); return -1; } if (unlikely(!PyDict_Next(iter_obj, ppos, &key, &value))) { return 0; } if (pitem) { PyObject* tuple = PyTuple_New(2); if (unlikely(!tuple)) { return -1; } Py_INCREF(key); Py_INCREF(value); PyTuple_SET_ITEM(tuple, 0, key); PyTuple_SET_ITEM(tuple, 1, value); *pitem = tuple; } else { if (pkey) { Py_INCREF(key); *pkey = key; } if (pvalue) { Py_INCREF(value); *pvalue = value; } } return 1; } else if (PyTuple_CheckExact(iter_obj)) { Py_ssize_t pos = *ppos; if (unlikely(pos >= PyTuple_GET_SIZE(iter_obj))) return 0; *ppos = pos + 1; next_item = PyTuple_GET_ITEM(iter_obj, pos); Py_INCREF(next_item); } else if (PyList_CheckExact(iter_obj)) { Py_ssize_t pos = *ppos; if (unlikely(pos >= PyList_GET_SIZE(iter_obj))) return 0; *ppos = pos + 1; next_item = PyList_GET_ITEM(iter_obj, pos); Py_INCREF(next_item); } else #endif { next_item = PyIter_Next(iter_obj); if (unlikely(!next_item)) { return __Pyx_IterFinish(); } } if (pitem) { *pitem = next_item; } else if (pkey && pvalue) { if (__Pyx_unpack_tuple2(next_item, pkey, pvalue, source_is_dict, source_is_dict, 1)) return -1; } else if (pkey) { *pkey = next_item; } else { *pvalue = next_item; } return 1; } static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Generic(PyObject *o, PyObject* j) { PyObject *r; if (!j) return NULL; r = PyObject_GetItem(o, j); Py_DECREF(j); return r; } static CYTHON_INLINE PyObject *__Pyx_GetItemInt_List_Fast(PyObject *o, Py_ssize_t i, CYTHON_NCP_UNUSED int wraparound, CYTHON_NCP_UNUSED int boundscheck) { #if CYTHON_COMPILING_IN_CPYTHON if (wraparound & unlikely(i < 0)) i += PyList_GET_SIZE(o); if ((!boundscheck) || likely((0 <= i) & (i < PyList_GET_SIZE(o)))) { PyObject *r = PyList_GET_ITEM(o, i); Py_INCREF(r); return r; } return __Pyx_GetItemInt_Generic(o, PyInt_FromSsize_t(i)); #else return PySequence_GetItem(o, i); #endif } static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Tuple_Fast(PyObject *o, Py_ssize_t i, CYTHON_NCP_UNUSED int wraparound, CYTHON_NCP_UNUSED int boundscheck) { #if CYTHON_COMPILING_IN_CPYTHON if (wraparound & unlikely(i < 0)) i += PyTuple_GET_SIZE(o); if ((!boundscheck) || likely((0 <= i) & (i < PyTuple_GET_SIZE(o)))) { PyObject *r = PyTuple_GET_ITEM(o, i); Py_INCREF(r); return r; } return __Pyx_GetItemInt_Generic(o, PyInt_FromSsize_t(i)); #else return PySequence_GetItem(o, i); #endif } static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Fast(PyObject *o, Py_ssize_t i, int is_list, CYTHON_NCP_UNUSED int wraparound, CYTHON_NCP_UNUSED int boundscheck) { #if CYTHON_COMPILING_IN_CPYTHON if (is_list || PyList_CheckExact(o)) { Py_ssize_t n = ((!wraparound) | likely(i >= 0)) ? i : i + PyList_GET_SIZE(o); if ((!boundscheck) || (likely((n >= 0) & (n < PyList_GET_SIZE(o))))) { PyObject *r = PyList_GET_ITEM(o, n); Py_INCREF(r); return r; } } else if (PyTuple_CheckExact(o)) { Py_ssize_t n = ((!wraparound) | likely(i >= 0)) ? i : i + PyTuple_GET_SIZE(o); if ((!boundscheck) || likely((n >= 0) & (n < PyTuple_GET_SIZE(o)))) { PyObject *r = PyTuple_GET_ITEM(o, n); Py_INCREF(r); return r; } } else { PySequenceMethods *m = Py_TYPE(o)->tp_as_sequence; if (likely(m && m->sq_item)) { if (wraparound && unlikely(i < 0) && likely(m->sq_length)) { Py_ssize_t l = m->sq_length(o); if (likely(l >= 0)) { i += l; } else { if (PyErr_ExceptionMatches(PyExc_OverflowError)) PyErr_Clear(); else return NULL; } } return m->sq_item(o, i); } } #else if (is_list || PySequence_Check(o)) { return PySequence_GetItem(o, i); } #endif return __Pyx_GetItemInt_Generic(o, PyInt_FromSsize_t(i)); } static CYTHON_INLINE long __Pyx_div_long(long a, long b) { long q = a / b; long r = a - q*b; q -= ((r != 0) & ((r ^ b) < 0)); return q; } static int __Pyx_SetVtable(PyObject *dict, void *vtable) { #if PY_VERSION_HEX >= 0x02070000 PyObject *ob = PyCapsule_New(vtable, 0, 0); #else PyObject *ob = PyCObject_FromVoidPtr(vtable, 0); #endif if (!ob) goto bad; if (PyDict_SetItem(dict, __pyx_n_s_pyx_vtable, ob) < 0) goto bad; Py_DECREF(ob); return 0; bad: Py_XDECREF(ob); return -1; } static void* __Pyx_GetVtable(PyObject *dict) { void* ptr; PyObject *ob = PyObject_GetItem(dict, __pyx_n_s_pyx_vtable); if (!ob) goto bad; #if PY_VERSION_HEX >= 0x02070000 ptr = PyCapsule_GetPointer(ob, 0); #else ptr = PyCObject_AsVoidPtr(ob); #endif if (!ptr && !PyErr_Occurred()) PyErr_SetString(PyExc_RuntimeError, "invalid vtable found for imported type"); Py_DECREF(ob); return ptr; bad: Py_XDECREF(ob); return NULL; } static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list, int level) { PyObject *empty_list = 0; PyObject *module = 0; PyObject *global_dict = 0; PyObject *empty_dict = 0; PyObject *list; #if PY_VERSION_HEX < 0x03030000 PyObject *py_import; py_import = __Pyx_PyObject_GetAttrStr(__pyx_b, __pyx_n_s_import); if (!py_import) goto bad; #endif if (from_list) list = from_list; else { empty_list = PyList_New(0); if (!empty_list) goto bad; list = empty_list; } global_dict = PyModule_GetDict(__pyx_m); if (!global_dict) goto bad; empty_dict = PyDict_New(); if (!empty_dict) goto bad; { #if PY_MAJOR_VERSION >= 3 if (level == -1) { if (strchr(__Pyx_MODULE_NAME, '.')) { #if PY_VERSION_HEX < 0x03030000 PyObject *py_level = PyInt_FromLong(1); if (!py_level) goto bad; module = PyObject_CallFunctionObjArgs(py_import, name, global_dict, empty_dict, list, py_level, NULL); Py_DECREF(py_level); #else module = PyImport_ImportModuleLevelObject( name, global_dict, empty_dict, list, 1); #endif if (!module) { if (!PyErr_ExceptionMatches(PyExc_ImportError)) goto bad; PyErr_Clear(); } } level = 0; } #endif if (!module) { #if PY_VERSION_HEX < 0x03030000 PyObject *py_level = PyInt_FromLong(level); if (!py_level) goto bad; module = PyObject_CallFunctionObjArgs(py_import, name, global_dict, empty_dict, list, py_level, NULL); Py_DECREF(py_level); #else module = PyImport_ImportModuleLevelObject( name, global_dict, empty_dict, list, level); #endif } } bad: #if PY_VERSION_HEX < 0x03030000 Py_XDECREF(py_import); #endif Py_XDECREF(empty_list); Py_XDECREF(empty_dict); return module; } static PyObject* __Pyx_ImportFrom(PyObject* module, PyObject* name) { PyObject* value = __Pyx_PyObject_GetAttrStr(module, name); if (unlikely(!value) && PyErr_ExceptionMatches(PyExc_AttributeError)) { PyErr_Format(PyExc_ImportError, #if PY_MAJOR_VERSION < 3 "cannot import name %.230s", PyString_AS_STRING(name)); #else "cannot import name %S", name); #endif } return value; } static int __pyx_bisect_code_objects(__Pyx_CodeObjectCacheEntry* entries, int count, int code_line) { int start = 0, mid = 0, end = count - 1; if (end >= 0 && code_line > entries[end].code_line) { return count; } while (start < end) { mid = start + (end - start) / 2; if (code_line < entries[mid].code_line) { end = mid; } else if (code_line > entries[mid].code_line) { start = mid + 1; } else { return mid; } } if (code_line <= entries[mid].code_line) { return mid; } else { return mid + 1; } } static PyCodeObject *__pyx_find_code_object(int code_line) { PyCodeObject* code_object; int pos; if (unlikely(!code_line) || unlikely(!__pyx_code_cache.entries)) { return NULL; } pos = __pyx_bisect_code_objects(__pyx_code_cache.entries, __pyx_code_cache.count, code_line); if (unlikely(pos >= __pyx_code_cache.count) || unlikely(__pyx_code_cache.entries[pos].code_line != code_line)) { return NULL; } code_object = __pyx_code_cache.entries[pos].code_object; Py_INCREF(code_object); return code_object; } static void __pyx_insert_code_object(int code_line, PyCodeObject* code_object) { int pos, i; __Pyx_CodeObjectCacheEntry* entries = __pyx_code_cache.entries; if (unlikely(!code_line)) { return; } if (unlikely(!entries)) { entries = (__Pyx_CodeObjectCacheEntry*)PyMem_Malloc(64*sizeof(__Pyx_CodeObjectCacheEntry)); if (likely(entries)) { __pyx_code_cache.entries = entries; __pyx_code_cache.max_count = 64; __pyx_code_cache.count = 1; entries[0].code_line = code_line; entries[0].code_object = code_object; Py_INCREF(code_object); } return; } pos = __pyx_bisect_code_objects(__pyx_code_cache.entries, __pyx_code_cache.count, code_line); if ((pos < __pyx_code_cache.count) && unlikely(__pyx_code_cache.entries[pos].code_line == code_line)) { PyCodeObject* tmp = entries[pos].code_object; entries[pos].code_object = code_object; Py_DECREF(tmp); return; } if (__pyx_code_cache.count == __pyx_code_cache.max_count) { int new_max = __pyx_code_cache.max_count + 64; entries = (__Pyx_CodeObjectCacheEntry*)PyMem_Realloc( __pyx_code_cache.entries, (size_t)new_max*sizeof(__Pyx_CodeObjectCacheEntry)); if (unlikely(!entries)) { return; } __pyx_code_cache.entries = entries; __pyx_code_cache.max_count = new_max; } for (i=__pyx_code_cache.count; i>pos; i--) { entries[i] = entries[i-1]; } entries[pos].code_line = code_line; entries[pos].code_object = code_object; __pyx_code_cache.count++; Py_INCREF(code_object); } #include "compile.h" #include "frameobject.h" #include "traceback.h" static PyCodeObject* __Pyx_CreateCodeObjectForTraceback( const char *funcname, int c_line, int py_line, const char *filename) { PyCodeObject *py_code = 0; PyObject *py_srcfile = 0; PyObject *py_funcname = 0; #if PY_MAJOR_VERSION < 3 py_srcfile = PyString_FromString(filename); #else py_srcfile = PyUnicode_FromString(filename); #endif if (!py_srcfile) goto bad; if (c_line) { #if PY_MAJOR_VERSION < 3 py_funcname = PyString_FromFormat( "%s (%s:%d)", funcname, __pyx_cfilenm, c_line); #else py_funcname = PyUnicode_FromFormat( "%s (%s:%d)", funcname, __pyx_cfilenm, c_line); #endif } else { #if PY_MAJOR_VERSION < 3 py_funcname = PyString_FromString(funcname); #else py_funcname = PyUnicode_FromString(funcname); #endif } if (!py_funcname) goto bad; py_code = __Pyx_PyCode_New( 0, 0, 0, 0, 0, __pyx_empty_bytes, /*PyObject *code,*/ __pyx_empty_tuple, /*PyObject *consts,*/ __pyx_empty_tuple, /*PyObject *names,*/ __pyx_empty_tuple, /*PyObject *varnames,*/ __pyx_empty_tuple, /*PyObject *freevars,*/ __pyx_empty_tuple, /*PyObject *cellvars,*/ py_srcfile, /*PyObject *filename,*/ py_funcname, /*PyObject *name,*/ py_line, __pyx_empty_bytes /*PyObject *lnotab*/ ); Py_DECREF(py_srcfile); Py_DECREF(py_funcname); return py_code; bad: Py_XDECREF(py_srcfile); Py_XDECREF(py_funcname); return NULL; } static void __Pyx_AddTraceback(const char *funcname, int c_line, int py_line, const char *filename) { PyCodeObject *py_code = 0; PyFrameObject *py_frame = 0; py_code = __pyx_find_code_object(c_line ? c_line : py_line); if (!py_code) { py_code = __Pyx_CreateCodeObjectForTraceback( funcname, c_line, py_line, filename); if (!py_code) goto bad; __pyx_insert_code_object(c_line ? c_line : py_line, py_code); } py_frame = PyFrame_New( PyThreadState_GET(), /*PyThreadState *tstate,*/ py_code, /*PyCodeObject *code,*/ __pyx_d, /*PyObject *globals,*/ 0 /*PyObject *locals*/ ); if (!py_frame) goto bad; py_frame->f_lineno = py_line; PyTraceBack_Here(py_frame); bad: Py_XDECREF(py_code); Py_XDECREF(py_frame); } static CYTHON_INLINE PyObject* __Pyx_PyInt_From_SDL_BlendMode(SDL_BlendMode value) { const SDL_BlendMode neg_one = (SDL_BlendMode) -1, const_zero = (SDL_BlendMode) 0; const int is_unsigned = neg_one > const_zero; if (is_unsigned) { if (sizeof(SDL_BlendMode) < sizeof(long)) { return PyInt_FromLong((long) value); } else if (sizeof(SDL_BlendMode) <= sizeof(unsigned long)) { return PyLong_FromUnsignedLong((unsigned long) value); } else if (sizeof(SDL_BlendMode) <= sizeof(unsigned PY_LONG_LONG)) { return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value); } } else { if (sizeof(SDL_BlendMode) <= sizeof(long)) { return PyInt_FromLong((long) value); } else if (sizeof(SDL_BlendMode) <= sizeof(PY_LONG_LONG)) { return PyLong_FromLongLong((PY_LONG_LONG) value); } } { int one = 1; int little = (int)*(unsigned char *)&one; unsigned char *bytes = (unsigned char *)&value; return _PyLong_FromByteArray(bytes, sizeof(SDL_BlendMode), little, !is_unsigned); } } static CYTHON_INLINE PyObject* __Pyx_PyInt_From_int(int value) { const int neg_one = (int) -1, const_zero = (int) 0; const int is_unsigned = neg_one > const_zero; if (is_unsigned) { if (sizeof(int) < sizeof(long)) { return PyInt_FromLong((long) value); } else if (sizeof(int) <= sizeof(unsigned long)) { return PyLong_FromUnsignedLong((unsigned long) value); } else if (sizeof(int) <= sizeof(unsigned PY_LONG_LONG)) { return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value); } } else { if (sizeof(int) <= sizeof(long)) { return PyInt_FromLong((long) value); } else if (sizeof(int) <= sizeof(PY_LONG_LONG)) { return PyLong_FromLongLong((PY_LONG_LONG) value); } } { int one = 1; int little = (int)*(unsigned char *)&one; unsigned char *bytes = (unsigned char *)&value; return _PyLong_FromByteArray(bytes, sizeof(int), little, !is_unsigned); } } #define __PYX_VERIFY_RETURN_INT(target_type, func_type, func_value)\ __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, 0) #define __PYX_VERIFY_RETURN_INT_EXC(target_type, func_type, func_value)\ __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, 1) #define __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, exc)\ {\ func_type value = func_value;\ if (sizeof(target_type) < sizeof(func_type)) {\ if (unlikely(value != (func_type) (target_type) value)) {\ func_type zero = 0;\ if (exc && unlikely(value == (func_type)-1 && PyErr_Occurred()))\ return (target_type) -1;\ if (is_unsigned && unlikely(value < zero))\ goto raise_neg_overflow;\ else\ goto raise_overflow;\ }\ }\ return (target_type) value;\ } #if CYTHON_USE_PYLONG_INTERNALS #include "longintrepr.h" #endif static CYTHON_INLINE int __Pyx_PyInt_As_int(PyObject *x) { const int neg_one = (int) -1, const_zero = (int) 0; const int is_unsigned = neg_one > const_zero; #if PY_MAJOR_VERSION < 3 if (likely(PyInt_Check(x))) { if (sizeof(int) < sizeof(long)) { __PYX_VERIFY_RETURN_INT(int, long, PyInt_AS_LONG(x)) } else { long val = PyInt_AS_LONG(x); if (is_unsigned && unlikely(val < 0)) { goto raise_neg_overflow; } return (int) val; } } else #endif if (likely(PyLong_Check(x))) { if (is_unsigned) { #if CYTHON_USE_PYLONG_INTERNALS const digit* digits = ((PyLongObject*)x)->ob_digit; switch (Py_SIZE(x)) { case 0: return (int) 0; case 1: __PYX_VERIFY_RETURN_INT(int, digit, digits[0]) case 2: if (8 * sizeof(int) > 1 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(int) >= 2 * PyLong_SHIFT) { return (int) (((((int)digits[1]) << PyLong_SHIFT) | (int)digits[0])); } } break; case 3: if (8 * sizeof(int) > 2 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(int) >= 3 * PyLong_SHIFT) { return (int) (((((((int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0])); } } break; case 4: if (8 * sizeof(int) > 3 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(int) >= 4 * PyLong_SHIFT) { return (int) (((((((((int)digits[3]) << PyLong_SHIFT) | (int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0])); } } break; } #endif #if CYTHON_COMPILING_IN_CPYTHON if (unlikely(Py_SIZE(x) < 0)) { goto raise_neg_overflow; } #else { int result = PyObject_RichCompareBool(x, Py_False, Py_LT); if (unlikely(result < 0)) return (int) -1; if (unlikely(result == 1)) goto raise_neg_overflow; } #endif if (sizeof(int) <= sizeof(unsigned long)) { __PYX_VERIFY_RETURN_INT_EXC(int, unsigned long, PyLong_AsUnsignedLong(x)) } else if (sizeof(int) <= sizeof(unsigned PY_LONG_LONG)) { __PYX_VERIFY_RETURN_INT_EXC(int, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x)) } } else { #if CYTHON_USE_PYLONG_INTERNALS const digit* digits = ((PyLongObject*)x)->ob_digit; switch (Py_SIZE(x)) { case 0: return (int) 0; case -1: __PYX_VERIFY_RETURN_INT(int, sdigit, -(sdigit) digits[0]) case 1: __PYX_VERIFY_RETURN_INT(int, digit, +digits[0]) case -2: if (8 * sizeof(int) - 1 > 1 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(int, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(int) - 1 > 2 * PyLong_SHIFT) { return (int) (((int)-1)*(((((int)digits[1]) << PyLong_SHIFT) | (int)digits[0]))); } } break; case 2: if (8 * sizeof(int) > 1 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(int) - 1 > 2 * PyLong_SHIFT) { return (int) ((((((int)digits[1]) << PyLong_SHIFT) | (int)digits[0]))); } } break; case -3: if (8 * sizeof(int) - 1 > 2 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(int, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(int) - 1 > 3 * PyLong_SHIFT) { return (int) (((int)-1)*(((((((int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0]))); } } break; case 3: if (8 * sizeof(int) > 2 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(int) - 1 > 3 * PyLong_SHIFT) { return (int) ((((((((int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0]))); } } break; case -4: if (8 * sizeof(int) - 1 > 3 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(int, long, -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(int) - 1 > 4 * PyLong_SHIFT) { return (int) (((int)-1)*(((((((((int)digits[3]) << PyLong_SHIFT) | (int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0]))); } } break; case 4: if (8 * sizeof(int) > 3 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(int) - 1 > 4 * PyLong_SHIFT) { return (int) ((((((((((int)digits[3]) << PyLong_SHIFT) | (int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0]))); } } break; } #endif if (sizeof(int) <= sizeof(long)) { __PYX_VERIFY_RETURN_INT_EXC(int, long, PyLong_AsLong(x)) } else if (sizeof(int) <= sizeof(PY_LONG_LONG)) { __PYX_VERIFY_RETURN_INT_EXC(int, PY_LONG_LONG, PyLong_AsLongLong(x)) } } { #if CYTHON_COMPILING_IN_PYPY && !defined(_PyLong_AsByteArray) PyErr_SetString(PyExc_RuntimeError, "_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers"); #else int val; PyObject *v = __Pyx_PyNumber_Int(x); #if PY_MAJOR_VERSION < 3 if (likely(v) && !PyLong_Check(v)) { PyObject *tmp = v; v = PyNumber_Long(tmp); Py_DECREF(tmp); } #endif if (likely(v)) { int one = 1; int is_little = (int)*(unsigned char *)&one; unsigned char *bytes = (unsigned char *)&val; int ret = _PyLong_AsByteArray((PyLongObject *)v, bytes, sizeof(val), is_little, !is_unsigned); Py_DECREF(v); if (likely(!ret)) return val; } #endif return (int) -1; } } else { int val; PyObject *tmp = __Pyx_PyNumber_Int(x); if (!tmp) return (int) -1; val = __Pyx_PyInt_As_int(tmp); Py_DECREF(tmp); return val; } raise_overflow: PyErr_SetString(PyExc_OverflowError, "value too large to convert to int"); return (int) -1; raise_neg_overflow: PyErr_SetString(PyExc_OverflowError, "can't convert negative value to int"); return (int) -1; } static CYTHON_INLINE uint8_t __Pyx_PyInt_As_uint8_t(PyObject *x) { const uint8_t neg_one = (uint8_t) -1, const_zero = (uint8_t) 0; const int is_unsigned = neg_one > const_zero; #if PY_MAJOR_VERSION < 3 if (likely(PyInt_Check(x))) { if (sizeof(uint8_t) < sizeof(long)) { __PYX_VERIFY_RETURN_INT(uint8_t, long, PyInt_AS_LONG(x)) } else { long val = PyInt_AS_LONG(x); if (is_unsigned && unlikely(val < 0)) { goto raise_neg_overflow; } return (uint8_t) val; } } else #endif if (likely(PyLong_Check(x))) { if (is_unsigned) { #if CYTHON_USE_PYLONG_INTERNALS const digit* digits = ((PyLongObject*)x)->ob_digit; switch (Py_SIZE(x)) { case 0: return (uint8_t) 0; case 1: __PYX_VERIFY_RETURN_INT(uint8_t, digit, digits[0]) case 2: if (8 * sizeof(uint8_t) > 1 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(uint8_t, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(uint8_t) >= 2 * PyLong_SHIFT) { return (uint8_t) (((((uint8_t)digits[1]) << PyLong_SHIFT) | (uint8_t)digits[0])); } } break; case 3: if (8 * sizeof(uint8_t) > 2 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(uint8_t, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(uint8_t) >= 3 * PyLong_SHIFT) { return (uint8_t) (((((((uint8_t)digits[2]) << PyLong_SHIFT) | (uint8_t)digits[1]) << PyLong_SHIFT) | (uint8_t)digits[0])); } } break; case 4: if (8 * sizeof(uint8_t) > 3 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(uint8_t, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(uint8_t) >= 4 * PyLong_SHIFT) { return (uint8_t) (((((((((uint8_t)digits[3]) << PyLong_SHIFT) | (uint8_t)digits[2]) << PyLong_SHIFT) | (uint8_t)digits[1]) << PyLong_SHIFT) | (uint8_t)digits[0])); } } break; } #endif #if CYTHON_COMPILING_IN_CPYTHON if (unlikely(Py_SIZE(x) < 0)) { goto raise_neg_overflow; } #else { int result = PyObject_RichCompareBool(x, Py_False, Py_LT); if (unlikely(result < 0)) return (uint8_t) -1; if (unlikely(result == 1)) goto raise_neg_overflow; } #endif if (sizeof(uint8_t) <= sizeof(unsigned long)) { __PYX_VERIFY_RETURN_INT_EXC(uint8_t, unsigned long, PyLong_AsUnsignedLong(x)) } else if (sizeof(uint8_t) <= sizeof(unsigned PY_LONG_LONG)) { __PYX_VERIFY_RETURN_INT_EXC(uint8_t, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x)) } } else { #if CYTHON_USE_PYLONG_INTERNALS const digit* digits = ((PyLongObject*)x)->ob_digit; switch (Py_SIZE(x)) { case 0: return (uint8_t) 0; case -1: __PYX_VERIFY_RETURN_INT(uint8_t, sdigit, -(sdigit) digits[0]) case 1: __PYX_VERIFY_RETURN_INT(uint8_t, digit, +digits[0]) case -2: if (8 * sizeof(uint8_t) - 1 > 1 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(uint8_t, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(uint8_t) - 1 > 2 * PyLong_SHIFT) { return (uint8_t) (((uint8_t)-1)*(((((uint8_t)digits[1]) << PyLong_SHIFT) | (uint8_t)digits[0]))); } } break; case 2: if (8 * sizeof(uint8_t) > 1 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(uint8_t, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(uint8_t) - 1 > 2 * PyLong_SHIFT) { return (uint8_t) ((((((uint8_t)digits[1]) << PyLong_SHIFT) | (uint8_t)digits[0]))); } } break; case -3: if (8 * sizeof(uint8_t) - 1 > 2 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(uint8_t, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(uint8_t) - 1 > 3 * PyLong_SHIFT) { return (uint8_t) (((uint8_t)-1)*(((((((uint8_t)digits[2]) << PyLong_SHIFT) | (uint8_t)digits[1]) << PyLong_SHIFT) | (uint8_t)digits[0]))); } } break; case 3: if (8 * sizeof(uint8_t) > 2 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(uint8_t, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(uint8_t) - 1 > 3 * PyLong_SHIFT) { return (uint8_t) ((((((((uint8_t)digits[2]) << PyLong_SHIFT) | (uint8_t)digits[1]) << PyLong_SHIFT) | (uint8_t)digits[0]))); } } break; case -4: if (8 * sizeof(uint8_t) - 1 > 3 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(uint8_t, long, -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(uint8_t) - 1 > 4 * PyLong_SHIFT) { return (uint8_t) (((uint8_t)-1)*(((((((((uint8_t)digits[3]) << PyLong_SHIFT) | (uint8_t)digits[2]) << PyLong_SHIFT) | (uint8_t)digits[1]) << PyLong_SHIFT) | (uint8_t)digits[0]))); } } break; case 4: if (8 * sizeof(uint8_t) > 3 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(uint8_t, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(uint8_t) - 1 > 4 * PyLong_SHIFT) { return (uint8_t) ((((((((((uint8_t)digits[3]) << PyLong_SHIFT) | (uint8_t)digits[2]) << PyLong_SHIFT) | (uint8_t)digits[1]) << PyLong_SHIFT) | (uint8_t)digits[0]))); } } break; } #endif if (sizeof(uint8_t) <= sizeof(long)) { __PYX_VERIFY_RETURN_INT_EXC(uint8_t, long, PyLong_AsLong(x)) } else if (sizeof(uint8_t) <= sizeof(PY_LONG_LONG)) { __PYX_VERIFY_RETURN_INT_EXC(uint8_t, PY_LONG_LONG, PyLong_AsLongLong(x)) } } { #if CYTHON_COMPILING_IN_PYPY && !defined(_PyLong_AsByteArray) PyErr_SetString(PyExc_RuntimeError, "_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers"); #else uint8_t val; PyObject *v = __Pyx_PyNumber_Int(x); #if PY_MAJOR_VERSION < 3 if (likely(v) && !PyLong_Check(v)) { PyObject *tmp = v; v = PyNumber_Long(tmp); Py_DECREF(tmp); } #endif if (likely(v)) { int one = 1; int is_little = (int)*(unsigned char *)&one; unsigned char *bytes = (unsigned char *)&val; int ret = _PyLong_AsByteArray((PyLongObject *)v, bytes, sizeof(val), is_little, !is_unsigned); Py_DECREF(v); if (likely(!ret)) return val; } #endif return (uint8_t) -1; } } else { uint8_t val; PyObject *tmp = __Pyx_PyNumber_Int(x); if (!tmp) return (uint8_t) -1; val = __Pyx_PyInt_As_uint8_t(tmp); Py_DECREF(tmp); return val; } raise_overflow: PyErr_SetString(PyExc_OverflowError, "value too large to convert to uint8_t"); return (uint8_t) -1; raise_neg_overflow: PyErr_SetString(PyExc_OverflowError, "can't convert negative value to uint8_t"); return (uint8_t) -1; } static CYTHON_INLINE PyObject* __Pyx_PyInt_From_long(long value) { const long neg_one = (long) -1, const_zero = (long) 0; const int is_unsigned = neg_one > const_zero; if (is_unsigned) { if (sizeof(long) < sizeof(long)) { return PyInt_FromLong((long) value); } else if (sizeof(long) <= sizeof(unsigned long)) { return PyLong_FromUnsignedLong((unsigned long) value); } else if (sizeof(long) <= sizeof(unsigned PY_LONG_LONG)) { return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value); } } else { if (sizeof(long) <= sizeof(long)) { return PyInt_FromLong((long) value); } else if (sizeof(long) <= sizeof(PY_LONG_LONG)) { return PyLong_FromLongLong((PY_LONG_LONG) value); } } { int one = 1; int little = (int)*(unsigned char *)&one; unsigned char *bytes = (unsigned char *)&value; return _PyLong_FromByteArray(bytes, sizeof(long), little, !is_unsigned); } } static CYTHON_INLINE PyObject* __Pyx_PyInt_From_uint8_t(uint8_t value) { const uint8_t neg_one = (uint8_t) -1, const_zero = (uint8_t) 0; const int is_unsigned = neg_one > const_zero; if (is_unsigned) { if (sizeof(uint8_t) < sizeof(long)) { return PyInt_FromLong((long) value); } else if (sizeof(uint8_t) <= sizeof(unsigned long)) { return PyLong_FromUnsignedLong((unsigned long) value); } else if (sizeof(uint8_t) <= sizeof(unsigned PY_LONG_LONG)) { return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value); } } else { if (sizeof(uint8_t) <= sizeof(long)) { return PyInt_FromLong((long) value); } else if (sizeof(uint8_t) <= sizeof(PY_LONG_LONG)) { return PyLong_FromLongLong((PY_LONG_LONG) value); } } { int one = 1; int little = (int)*(unsigned char *)&one; unsigned char *bytes = (unsigned char *)&value; return _PyLong_FromByteArray(bytes, sizeof(uint8_t), little, !is_unsigned); } } static CYTHON_INLINE long __Pyx_PyInt_As_long(PyObject *x) { const long neg_one = (long) -1, const_zero = (long) 0; const int is_unsigned = neg_one > const_zero; #if PY_MAJOR_VERSION < 3 if (likely(PyInt_Check(x))) { if (sizeof(long) < sizeof(long)) { __PYX_VERIFY_RETURN_INT(long, long, PyInt_AS_LONG(x)) } else { long val = PyInt_AS_LONG(x); if (is_unsigned && unlikely(val < 0)) { goto raise_neg_overflow; } return (long) val; } } else #endif if (likely(PyLong_Check(x))) { if (is_unsigned) { #if CYTHON_USE_PYLONG_INTERNALS const digit* digits = ((PyLongObject*)x)->ob_digit; switch (Py_SIZE(x)) { case 0: return (long) 0; case 1: __PYX_VERIFY_RETURN_INT(long, digit, digits[0]) case 2: if (8 * sizeof(long) > 1 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(long) >= 2 * PyLong_SHIFT) { return (long) (((((long)digits[1]) << PyLong_SHIFT) | (long)digits[0])); } } break; case 3: if (8 * sizeof(long) > 2 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(long) >= 3 * PyLong_SHIFT) { return (long) (((((((long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0])); } } break; case 4: if (8 * sizeof(long) > 3 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(long) >= 4 * PyLong_SHIFT) { return (long) (((((((((long)digits[3]) << PyLong_SHIFT) | (long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0])); } } break; } #endif #if CYTHON_COMPILING_IN_CPYTHON if (unlikely(Py_SIZE(x) < 0)) { goto raise_neg_overflow; } #else { int result = PyObject_RichCompareBool(x, Py_False, Py_LT); if (unlikely(result < 0)) return (long) -1; if (unlikely(result == 1)) goto raise_neg_overflow; } #endif if (sizeof(long) <= sizeof(unsigned long)) { __PYX_VERIFY_RETURN_INT_EXC(long, unsigned long, PyLong_AsUnsignedLong(x)) } else if (sizeof(long) <= sizeof(unsigned PY_LONG_LONG)) { __PYX_VERIFY_RETURN_INT_EXC(long, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x)) } } else { #if CYTHON_USE_PYLONG_INTERNALS const digit* digits = ((PyLongObject*)x)->ob_digit; switch (Py_SIZE(x)) { case 0: return (long) 0; case -1: __PYX_VERIFY_RETURN_INT(long, sdigit, -(sdigit) digits[0]) case 1: __PYX_VERIFY_RETURN_INT(long, digit, +digits[0]) case -2: if (8 * sizeof(long) - 1 > 1 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(long, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) { return (long) (((long)-1)*(((((long)digits[1]) << PyLong_SHIFT) | (long)digits[0]))); } } break; case 2: if (8 * sizeof(long) > 1 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) { return (long) ((((((long)digits[1]) << PyLong_SHIFT) | (long)digits[0]))); } } break; case -3: if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(long, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) { return (long) (((long)-1)*(((((((long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0]))); } } break; case 3: if (8 * sizeof(long) > 2 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) { return (long) ((((((((long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0]))); } } break; case -4: if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(long, long, -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(long) - 1 > 4 * PyLong_SHIFT) { return (long) (((long)-1)*(((((((((long)digits[3]) << PyLong_SHIFT) | (long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0]))); } } break; case 4: if (8 * sizeof(long) > 3 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(long) - 1 > 4 * PyLong_SHIFT) { return (long) ((((((((((long)digits[3]) << PyLong_SHIFT) | (long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0]))); } } break; } #endif if (sizeof(long) <= sizeof(long)) { __PYX_VERIFY_RETURN_INT_EXC(long, long, PyLong_AsLong(x)) } else if (sizeof(long) <= sizeof(PY_LONG_LONG)) { __PYX_VERIFY_RETURN_INT_EXC(long, PY_LONG_LONG, PyLong_AsLongLong(x)) } } { #if CYTHON_COMPILING_IN_PYPY && !defined(_PyLong_AsByteArray) PyErr_SetString(PyExc_RuntimeError, "_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers"); #else long val; PyObject *v = __Pyx_PyNumber_Int(x); #if PY_MAJOR_VERSION < 3 if (likely(v) && !PyLong_Check(v)) { PyObject *tmp = v; v = PyNumber_Long(tmp); Py_DECREF(tmp); } #endif if (likely(v)) { int one = 1; int is_little = (int)*(unsigned char *)&one; unsigned char *bytes = (unsigned char *)&val; int ret = _PyLong_AsByteArray((PyLongObject *)v, bytes, sizeof(val), is_little, !is_unsigned); Py_DECREF(v); if (likely(!ret)) return val; } #endif return (long) -1; } } else { long val; PyObject *tmp = __Pyx_PyNumber_Int(x); if (!tmp) return (long) -1; val = __Pyx_PyInt_As_long(tmp); Py_DECREF(tmp); return val; } raise_overflow: PyErr_SetString(PyExc_OverflowError, "value too large to convert to long"); return (long) -1; raise_neg_overflow: PyErr_SetString(PyExc_OverflowError, "can't convert negative value to long"); return (long) -1; } static int __Pyx_check_binary_version(void) { char ctversion[4], rtversion[4]; PyOS_snprintf(ctversion, 4, "%d.%d", PY_MAJOR_VERSION, PY_MINOR_VERSION); PyOS_snprintf(rtversion, 4, "%s", Py_GetVersion()); if (ctversion[0] != rtversion[0] || ctversion[2] != rtversion[2]) { char message[200]; PyOS_snprintf(message, sizeof(message), "compiletime version %s of module '%.100s' " "does not match runtime version %s", ctversion, __Pyx_MODULE_NAME, rtversion); return PyErr_WarnEx(NULL, message, 1); } return 0; } #ifndef __PYX_HAVE_RT_ImportModule #define __PYX_HAVE_RT_ImportModule static PyObject *__Pyx_ImportModule(const char *name) { PyObject *py_name = 0; PyObject *py_module = 0; py_name = __Pyx_PyIdentifier_FromString(name); if (!py_name) goto bad; py_module = PyImport_Import(py_name); Py_DECREF(py_name); return py_module; bad: Py_XDECREF(py_name); return 0; } #endif #ifndef __PYX_HAVE_RT_ImportType #define __PYX_HAVE_RT_ImportType static PyTypeObject *__Pyx_ImportType(const char *module_name, const char *class_name, size_t size, int strict) { PyObject *py_module = 0; PyObject *result = 0; PyObject *py_name = 0; char warning[200]; Py_ssize_t basicsize; #ifdef Py_LIMITED_API PyObject *py_basicsize; #endif py_module = __Pyx_ImportModule(module_name); if (!py_module) goto bad; py_name = __Pyx_PyIdentifier_FromString(class_name); if (!py_name) goto bad; result = PyObject_GetAttr(py_module, py_name); Py_DECREF(py_name); py_name = 0; Py_DECREF(py_module); py_module = 0; if (!result) goto bad; if (!PyType_Check(result)) { PyErr_Format(PyExc_TypeError, "%.200s.%.200s is not a type object", module_name, class_name); goto bad; } #ifndef Py_LIMITED_API basicsize = ((PyTypeObject *)result)->tp_basicsize; #else py_basicsize = PyObject_GetAttrString(result, "__basicsize__"); if (!py_basicsize) goto bad; basicsize = PyLong_AsSsize_t(py_basicsize); Py_DECREF(py_basicsize); py_basicsize = 0; if (basicsize == (Py_ssize_t)-1 && PyErr_Occurred()) goto bad; #endif if (!strict && (size_t)basicsize > size) { PyOS_snprintf(warning, sizeof(warning), "%s.%s size changed, may indicate binary incompatibility", module_name, class_name); if (PyErr_WarnEx(NULL, warning, 0) < 0) goto bad; } else if ((size_t)basicsize != size) { PyErr_Format(PyExc_ValueError, "%.200s.%.200s has the wrong size, try recompiling", module_name, class_name); goto bad; } return (PyTypeObject *)result; bad: Py_XDECREF(py_module); Py_XDECREF(result); return NULL; } #endif #ifndef __PYX_HAVE_RT_ImportVoidPtr #define __PYX_HAVE_RT_ImportVoidPtr static int __Pyx_ImportVoidPtr(PyObject *module, const char *name, void **p, const char *sig) { PyObject *d = 0; PyObject *cobj = 0; d = PyObject_GetAttrString(module, (char *)"__pyx_capi__"); if (!d) goto bad; cobj = PyDict_GetItemString(d, name); if (!cobj) { PyErr_Format(PyExc_ImportError, "%.200s does not export expected C variable %.200s", PyModule_GetName(module), name); goto bad; } #if PY_VERSION_HEX >= 0x02070000 if (!PyCapsule_IsValid(cobj, sig)) { PyErr_Format(PyExc_TypeError, "C variable %.200s.%.200s has wrong signature (expected %.500s, got %.500s)", PyModule_GetName(module), name, sig, PyCapsule_GetName(cobj)); goto bad; } *p = PyCapsule_GetPointer(cobj, sig); #else {const char *desc, *s1, *s2; desc = (const char *)PyCObject_GetDesc(cobj); if (!desc) goto bad; s1 = desc; s2 = sig; while (*s1 != '\0' && *s1 == *s2) { s1++; s2++; } if (*s1 != *s2) { PyErr_Format(PyExc_TypeError, "C variable %.200s.%.200s has wrong signature (expected %.500s, got %.500s)", PyModule_GetName(module), name, sig, desc); goto bad; } *p = PyCObject_AsVoidPtr(cobj);} #endif if (!(*p)) goto bad; Py_DECREF(d); return 0; bad: Py_XDECREF(d); return -1; } #endif #ifndef __PYX_HAVE_RT_ImportFunction #define __PYX_HAVE_RT_ImportFunction static int __Pyx_ImportFunction(PyObject *module, const char *funcname, void (**f)(void), const char *sig) { PyObject *d = 0; PyObject *cobj = 0; union { void (*fp)(void); void *p; } tmp; d = PyObject_GetAttrString(module, (char *)"__pyx_capi__"); if (!d) goto bad; cobj = PyDict_GetItemString(d, funcname); if (!cobj) { PyErr_Format(PyExc_ImportError, "%.200s does not export expected C function %.200s", PyModule_GetName(module), funcname); goto bad; } #if PY_VERSION_HEX >= 0x02070000 if (!PyCapsule_IsValid(cobj, sig)) { PyErr_Format(PyExc_TypeError, "C function %.200s.%.200s has wrong signature (expected %.500s, got %.500s)", PyModule_GetName(module), funcname, sig, PyCapsule_GetName(cobj)); goto bad; } tmp.p = PyCapsule_GetPointer(cobj, sig); #else {const char *desc, *s1, *s2; desc = (const char *)PyCObject_GetDesc(cobj); if (!desc) goto bad; s1 = desc; s2 = sig; while (*s1 != '\0' && *s1 == *s2) { s1++; s2++; } if (*s1 != *s2) { PyErr_Format(PyExc_TypeError, "C function %.200s.%.200s has wrong signature (expected %.500s, got %.500s)", PyModule_GetName(module), funcname, sig, desc); goto bad; } tmp.p = PyCObject_AsVoidPtr(cobj);} #endif *f = tmp.fp; if (!(*f)) goto bad; Py_DECREF(d); return 0; bad: Py_XDECREF(d); return -1; } #endif static int __Pyx_InitStrings(__Pyx_StringTabEntry *t) { while (t->p) { #if PY_MAJOR_VERSION < 3 if (t->is_unicode) { *t->p = PyUnicode_DecodeUTF8(t->s, t->n - 1, NULL); } else if (t->intern) { *t->p = PyString_InternFromString(t->s); } else { *t->p = PyString_FromStringAndSize(t->s, t->n - 1); } #else if (t->is_unicode | t->is_str) { if (t->intern) { *t->p = PyUnicode_InternFromString(t->s); } else if (t->encoding) { *t->p = PyUnicode_Decode(t->s, t->n - 1, t->encoding, NULL); } else { *t->p = PyUnicode_FromStringAndSize(t->s, t->n - 1); } } else { *t->p = PyBytes_FromStringAndSize(t->s, t->n - 1); } #endif if (!*t->p) return -1; ++t; } return 0; } static CYTHON_INLINE PyObject* __Pyx_PyUnicode_FromString(const char* c_str) { return __Pyx_PyUnicode_FromStringAndSize(c_str, (Py_ssize_t)strlen(c_str)); } static CYTHON_INLINE char* __Pyx_PyObject_AsString(PyObject* o) { Py_ssize_t ignore; return __Pyx_PyObject_AsStringAndSize(o, &ignore); } static CYTHON_INLINE char* __Pyx_PyObject_AsStringAndSize(PyObject* o, Py_ssize_t *length) { #if CYTHON_COMPILING_IN_CPYTHON && (__PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT) if ( #if PY_MAJOR_VERSION < 3 && __PYX_DEFAULT_STRING_ENCODING_IS_ASCII __Pyx_sys_getdefaultencoding_not_ascii && #endif PyUnicode_Check(o)) { #if PY_VERSION_HEX < 0x03030000 char* defenc_c; PyObject* defenc = _PyUnicode_AsDefaultEncodedString(o, NULL); if (!defenc) return NULL; defenc_c = PyBytes_AS_STRING(defenc); #if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII { char* end = defenc_c + PyBytes_GET_SIZE(defenc); char* c; for (c = defenc_c; c < end; c++) { if ((unsigned char) (*c) >= 128) { PyUnicode_AsASCIIString(o); return NULL; } } } #endif *length = PyBytes_GET_SIZE(defenc); return defenc_c; #else if (__Pyx_PyUnicode_READY(o) == -1) return NULL; #if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII if (PyUnicode_IS_ASCII(o)) { *length = PyUnicode_GET_LENGTH(o); return PyUnicode_AsUTF8(o); } else { PyUnicode_AsASCIIString(o); return NULL; } #else return PyUnicode_AsUTF8AndSize(o, length); #endif #endif } else #endif #if (!CYTHON_COMPILING_IN_PYPY) || (defined(PyByteArray_AS_STRING) && defined(PyByteArray_GET_SIZE)) if (PyByteArray_Check(o)) { *length = PyByteArray_GET_SIZE(o); return PyByteArray_AS_STRING(o); } else #endif { char* result; int r = PyBytes_AsStringAndSize(o, &result, length); if (unlikely(r < 0)) { return NULL; } else { return result; } } } static CYTHON_INLINE int __Pyx_PyObject_IsTrue(PyObject* x) { int is_true = x == Py_True; if (is_true | (x == Py_False) | (x == Py_None)) return is_true; else return PyObject_IsTrue(x); } static CYTHON_INLINE PyObject* __Pyx_PyNumber_Int(PyObject* x) { PyNumberMethods *m; const char *name = NULL; PyObject *res = NULL; #if PY_MAJOR_VERSION < 3 if (PyInt_Check(x) || PyLong_Check(x)) #else if (PyLong_Check(x)) #endif return __Pyx_NewRef(x); m = Py_TYPE(x)->tp_as_number; #if PY_MAJOR_VERSION < 3 if (m && m->nb_int) { name = "int"; res = PyNumber_Int(x); } else if (m && m->nb_long) { name = "long"; res = PyNumber_Long(x); } #else if (m && m->nb_int) { name = "int"; res = PyNumber_Long(x); } #endif if (res) { #if PY_MAJOR_VERSION < 3 if (!PyInt_Check(res) && !PyLong_Check(res)) { #else if (!PyLong_Check(res)) { #endif PyErr_Format(PyExc_TypeError, "__%.4s__ returned non-%.4s (type %.200s)", name, name, Py_TYPE(res)->tp_name); Py_DECREF(res); return NULL; } } else if (!PyErr_Occurred()) { PyErr_SetString(PyExc_TypeError, "an integer is required"); } return res; } static CYTHON_INLINE Py_ssize_t __Pyx_PyIndex_AsSsize_t(PyObject* b) { Py_ssize_t ival; PyObject *x; #if PY_MAJOR_VERSION < 3 if (likely(PyInt_CheckExact(b))) { if (sizeof(Py_ssize_t) >= sizeof(long)) return PyInt_AS_LONG(b); else return PyInt_AsSsize_t(x); } #endif if (likely(PyLong_CheckExact(b))) { #if CYTHON_USE_PYLONG_INTERNALS const digit* digits = ((PyLongObject*)b)->ob_digit; const Py_ssize_t size = Py_SIZE(b); if (likely(__Pyx_sst_abs(size) <= 1)) { ival = likely(size) ? digits[0] : 0; if (size == -1) ival = -ival; return ival; } else { switch (size) { case 2: if (8 * sizeof(Py_ssize_t) > 2 * PyLong_SHIFT) { return (Py_ssize_t) (((((size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])); } break; case -2: if (8 * sizeof(Py_ssize_t) > 2 * PyLong_SHIFT) { return -(Py_ssize_t) (((((size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])); } break; case 3: if (8 * sizeof(Py_ssize_t) > 3 * PyLong_SHIFT) { return (Py_ssize_t) (((((((size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])); } break; case -3: if (8 * sizeof(Py_ssize_t) > 3 * PyLong_SHIFT) { return -(Py_ssize_t) (((((((size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])); } break; case 4: if (8 * sizeof(Py_ssize_t) > 4 * PyLong_SHIFT) { return (Py_ssize_t) (((((((((size_t)digits[3]) << PyLong_SHIFT) | (size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])); } break; case -4: if (8 * sizeof(Py_ssize_t) > 4 * PyLong_SHIFT) { return -(Py_ssize_t) (((((((((size_t)digits[3]) << PyLong_SHIFT) | (size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])); } break; } } #endif return PyLong_AsSsize_t(b); } x = PyNumber_Index(b); if (!x) return -1; ival = PyInt_AsSsize_t(x); Py_DECREF(x); return ival; } static CYTHON_INLINE PyObject * __Pyx_PyInt_FromSize_t(size_t ival) { return PyInt_FromSize_t(ival); } #endif /* Py_PYTHON_H */ pygame_sdl2-2.1.0-for-renpy-6.99.14.1/gen/pygame_sdl2.display.c0000644000175000017500000243325413231553226023052 0ustar tomtom00000000000000/* Generated by Cython 0.27.3 */ #define PY_SSIZE_T_CLEAN #include "Python.h" #ifndef Py_PYTHON_H #error Python headers needed to compile C extensions, please install development version of Python. #elif PY_VERSION_HEX < 0x02060000 || (0x03000000 <= PY_VERSION_HEX && PY_VERSION_HEX < 0x03030000) #error Cython requires Python 2.6+ or Python 3.3+. #else #define CYTHON_ABI "0_27_3" #define CYTHON_FUTURE_DIVISION 0 #include #ifndef offsetof #define offsetof(type, member) ( (size_t) & ((type*)0) -> member ) #endif #if !defined(WIN32) && !defined(MS_WINDOWS) #ifndef __stdcall #define __stdcall #endif #ifndef __cdecl #define __cdecl #endif #ifndef __fastcall #define __fastcall #endif #endif #ifndef DL_IMPORT #define DL_IMPORT(t) t #endif #ifndef DL_EXPORT #define DL_EXPORT(t) t #endif #define __PYX_COMMA , #ifndef HAVE_LONG_LONG #if PY_VERSION_HEX >= 0x02070000 #define HAVE_LONG_LONG #endif #endif #ifndef PY_LONG_LONG #define PY_LONG_LONG LONG_LONG #endif #ifndef Py_HUGE_VAL #define Py_HUGE_VAL HUGE_VAL #endif #ifdef PYPY_VERSION #define CYTHON_COMPILING_IN_PYPY 1 #define CYTHON_COMPILING_IN_PYSTON 0 #define CYTHON_COMPILING_IN_CPYTHON 0 #undef CYTHON_USE_TYPE_SLOTS #define CYTHON_USE_TYPE_SLOTS 0 #undef CYTHON_USE_PYTYPE_LOOKUP #define CYTHON_USE_PYTYPE_LOOKUP 0 #if PY_VERSION_HEX < 0x03050000 #undef CYTHON_USE_ASYNC_SLOTS #define CYTHON_USE_ASYNC_SLOTS 0 #elif !defined(CYTHON_USE_ASYNC_SLOTS) #define CYTHON_USE_ASYNC_SLOTS 1 #endif #undef CYTHON_USE_PYLIST_INTERNALS #define CYTHON_USE_PYLIST_INTERNALS 0 #undef CYTHON_USE_UNICODE_INTERNALS #define CYTHON_USE_UNICODE_INTERNALS 0 #undef CYTHON_USE_UNICODE_WRITER #define CYTHON_USE_UNICODE_WRITER 0 #undef CYTHON_USE_PYLONG_INTERNALS #define CYTHON_USE_PYLONG_INTERNALS 0 #undef CYTHON_AVOID_BORROWED_REFS #define CYTHON_AVOID_BORROWED_REFS 1 #undef CYTHON_ASSUME_SAFE_MACROS #define CYTHON_ASSUME_SAFE_MACROS 0 #undef CYTHON_UNPACK_METHODS #define CYTHON_UNPACK_METHODS 0 #undef CYTHON_FAST_THREAD_STATE #define CYTHON_FAST_THREAD_STATE 0 #undef CYTHON_FAST_PYCALL #define CYTHON_FAST_PYCALL 0 #undef CYTHON_PEP489_MULTI_PHASE_INIT #define CYTHON_PEP489_MULTI_PHASE_INIT 0 #undef CYTHON_USE_TP_FINALIZE #define CYTHON_USE_TP_FINALIZE 0 #elif defined(PYSTON_VERSION) #define CYTHON_COMPILING_IN_PYPY 0 #define CYTHON_COMPILING_IN_PYSTON 1 #define CYTHON_COMPILING_IN_CPYTHON 0 #ifndef CYTHON_USE_TYPE_SLOTS #define CYTHON_USE_TYPE_SLOTS 1 #endif #undef CYTHON_USE_PYTYPE_LOOKUP #define CYTHON_USE_PYTYPE_LOOKUP 0 #undef CYTHON_USE_ASYNC_SLOTS #define CYTHON_USE_ASYNC_SLOTS 0 #undef CYTHON_USE_PYLIST_INTERNALS #define CYTHON_USE_PYLIST_INTERNALS 0 #ifndef CYTHON_USE_UNICODE_INTERNALS #define CYTHON_USE_UNICODE_INTERNALS 1 #endif #undef CYTHON_USE_UNICODE_WRITER #define CYTHON_USE_UNICODE_WRITER 0 #undef CYTHON_USE_PYLONG_INTERNALS #define CYTHON_USE_PYLONG_INTERNALS 0 #ifndef CYTHON_AVOID_BORROWED_REFS #define CYTHON_AVOID_BORROWED_REFS 0 #endif #ifndef CYTHON_ASSUME_SAFE_MACROS #define CYTHON_ASSUME_SAFE_MACROS 1 #endif #ifndef CYTHON_UNPACK_METHODS #define CYTHON_UNPACK_METHODS 1 #endif #undef CYTHON_FAST_THREAD_STATE #define CYTHON_FAST_THREAD_STATE 0 #undef CYTHON_FAST_PYCALL #define CYTHON_FAST_PYCALL 0 #undef CYTHON_PEP489_MULTI_PHASE_INIT #define CYTHON_PEP489_MULTI_PHASE_INIT 0 #undef CYTHON_USE_TP_FINALIZE #define CYTHON_USE_TP_FINALIZE 0 #else #define CYTHON_COMPILING_IN_PYPY 0 #define CYTHON_COMPILING_IN_PYSTON 0 #define CYTHON_COMPILING_IN_CPYTHON 1 #ifndef CYTHON_USE_TYPE_SLOTS #define CYTHON_USE_TYPE_SLOTS 1 #endif #if PY_VERSION_HEX < 0x02070000 #undef CYTHON_USE_PYTYPE_LOOKUP #define CYTHON_USE_PYTYPE_LOOKUP 0 #elif !defined(CYTHON_USE_PYTYPE_LOOKUP) #define CYTHON_USE_PYTYPE_LOOKUP 1 #endif #if PY_MAJOR_VERSION < 3 #undef CYTHON_USE_ASYNC_SLOTS #define CYTHON_USE_ASYNC_SLOTS 0 #elif !defined(CYTHON_USE_ASYNC_SLOTS) #define CYTHON_USE_ASYNC_SLOTS 1 #endif #if PY_VERSION_HEX < 0x02070000 #undef CYTHON_USE_PYLONG_INTERNALS #define CYTHON_USE_PYLONG_INTERNALS 0 #elif !defined(CYTHON_USE_PYLONG_INTERNALS) #define CYTHON_USE_PYLONG_INTERNALS 1 #endif #ifndef CYTHON_USE_PYLIST_INTERNALS #define CYTHON_USE_PYLIST_INTERNALS 1 #endif #ifndef CYTHON_USE_UNICODE_INTERNALS #define CYTHON_USE_UNICODE_INTERNALS 1 #endif #if PY_VERSION_HEX < 0x030300F0 #undef CYTHON_USE_UNICODE_WRITER #define CYTHON_USE_UNICODE_WRITER 0 #elif !defined(CYTHON_USE_UNICODE_WRITER) #define CYTHON_USE_UNICODE_WRITER 1 #endif #ifndef CYTHON_AVOID_BORROWED_REFS #define CYTHON_AVOID_BORROWED_REFS 0 #endif #ifndef CYTHON_ASSUME_SAFE_MACROS #define CYTHON_ASSUME_SAFE_MACROS 1 #endif #ifndef CYTHON_UNPACK_METHODS #define CYTHON_UNPACK_METHODS 1 #endif #ifndef CYTHON_FAST_THREAD_STATE #define CYTHON_FAST_THREAD_STATE 1 #endif #ifndef CYTHON_FAST_PYCALL #define CYTHON_FAST_PYCALL 1 #endif #ifndef CYTHON_PEP489_MULTI_PHASE_INIT #define CYTHON_PEP489_MULTI_PHASE_INIT (0 && PY_VERSION_HEX >= 0x03050000) #endif #ifndef CYTHON_USE_TP_FINALIZE #define CYTHON_USE_TP_FINALIZE (PY_VERSION_HEX >= 0x030400a1) #endif #endif #if !defined(CYTHON_FAST_PYCCALL) #define CYTHON_FAST_PYCCALL (CYTHON_FAST_PYCALL && PY_VERSION_HEX >= 0x030600B1) #endif #if CYTHON_USE_PYLONG_INTERNALS #include "longintrepr.h" #undef SHIFT #undef BASE #undef MASK #endif #if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX < 0x02070600 && !defined(Py_OptimizeFlag) #define Py_OptimizeFlag 0 #endif #define __PYX_BUILD_PY_SSIZE_T "n" #define CYTHON_FORMAT_SSIZE_T "z" #if PY_MAJOR_VERSION < 3 #define __Pyx_BUILTIN_MODULE_NAME "__builtin__" #define __Pyx_PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)\ PyCode_New(a+k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos) #define __Pyx_DefaultClassType PyClass_Type #else #define __Pyx_BUILTIN_MODULE_NAME "builtins" #define __Pyx_PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)\ PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos) #define __Pyx_DefaultClassType PyType_Type #endif #ifndef Py_TPFLAGS_CHECKTYPES #define Py_TPFLAGS_CHECKTYPES 0 #endif #ifndef Py_TPFLAGS_HAVE_INDEX #define Py_TPFLAGS_HAVE_INDEX 0 #endif #ifndef Py_TPFLAGS_HAVE_NEWBUFFER #define Py_TPFLAGS_HAVE_NEWBUFFER 0 #endif #ifndef Py_TPFLAGS_HAVE_FINALIZE #define Py_TPFLAGS_HAVE_FINALIZE 0 #endif #if PY_VERSION_HEX < 0x030700A0 || !defined(METH_FASTCALL) #ifndef METH_FASTCALL #define METH_FASTCALL 0x80 #endif typedef PyObject *(*__Pyx_PyCFunctionFast) (PyObject *self, PyObject **args, Py_ssize_t nargs); typedef PyObject *(*__Pyx_PyCFunctionFastWithKeywords) (PyObject *self, PyObject **args, Py_ssize_t nargs, PyObject *kwnames); #else #define __Pyx_PyCFunctionFast _PyCFunctionFast #define __Pyx_PyCFunctionFastWithKeywords _PyCFunctionFastWithKeywords #endif #if CYTHON_FAST_PYCCALL #define __Pyx_PyFastCFunction_Check(func)\ ((PyCFunction_Check(func) && (METH_FASTCALL == (PyCFunction_GET_FLAGS(func) & ~(METH_CLASS | METH_STATIC | METH_COEXIST | METH_KEYWORDS))))) #else #define __Pyx_PyFastCFunction_Check(func) 0 #endif #if !CYTHON_FAST_THREAD_STATE || PY_VERSION_HEX < 0x02070000 #define __Pyx_PyThreadState_Current PyThreadState_GET() #elif PY_VERSION_HEX >= 0x03060000 #define __Pyx_PyThreadState_Current _PyThreadState_UncheckedGet() #elif PY_VERSION_HEX >= 0x03000000 #define __Pyx_PyThreadState_Current PyThreadState_GET() #else #define __Pyx_PyThreadState_Current _PyThreadState_Current #endif #if CYTHON_COMPILING_IN_CPYTHON || defined(_PyDict_NewPresized) #define __Pyx_PyDict_NewPresized(n) ((n <= 8) ? PyDict_New() : _PyDict_NewPresized(n)) #else #define __Pyx_PyDict_NewPresized(n) PyDict_New() #endif #if PY_MAJOR_VERSION >= 3 || CYTHON_FUTURE_DIVISION #define __Pyx_PyNumber_Divide(x,y) PyNumber_TrueDivide(x,y) #define __Pyx_PyNumber_InPlaceDivide(x,y) PyNumber_InPlaceTrueDivide(x,y) #else #define __Pyx_PyNumber_Divide(x,y) PyNumber_Divide(x,y) #define __Pyx_PyNumber_InPlaceDivide(x,y) PyNumber_InPlaceDivide(x,y) #endif #if PY_VERSION_HEX > 0x03030000 && defined(PyUnicode_KIND) #define CYTHON_PEP393_ENABLED 1 #define __Pyx_PyUnicode_READY(op) (likely(PyUnicode_IS_READY(op)) ?\ 0 : _PyUnicode_Ready((PyObject *)(op))) #define __Pyx_PyUnicode_GET_LENGTH(u) PyUnicode_GET_LENGTH(u) #define __Pyx_PyUnicode_READ_CHAR(u, i) PyUnicode_READ_CHAR(u, i) #define __Pyx_PyUnicode_MAX_CHAR_VALUE(u) PyUnicode_MAX_CHAR_VALUE(u) #define __Pyx_PyUnicode_KIND(u) PyUnicode_KIND(u) #define __Pyx_PyUnicode_DATA(u) PyUnicode_DATA(u) #define __Pyx_PyUnicode_READ(k, d, i) PyUnicode_READ(k, d, i) #define __Pyx_PyUnicode_WRITE(k, d, i, ch) PyUnicode_WRITE(k, d, i, ch) #define __Pyx_PyUnicode_IS_TRUE(u) (0 != (likely(PyUnicode_IS_READY(u)) ? PyUnicode_GET_LENGTH(u) : PyUnicode_GET_SIZE(u))) #else #define CYTHON_PEP393_ENABLED 0 #define PyUnicode_1BYTE_KIND 1 #define PyUnicode_2BYTE_KIND 2 #define PyUnicode_4BYTE_KIND 4 #define __Pyx_PyUnicode_READY(op) (0) #define __Pyx_PyUnicode_GET_LENGTH(u) PyUnicode_GET_SIZE(u) #define __Pyx_PyUnicode_READ_CHAR(u, i) ((Py_UCS4)(PyUnicode_AS_UNICODE(u)[i])) #define __Pyx_PyUnicode_MAX_CHAR_VALUE(u) ((sizeof(Py_UNICODE) == 2) ? 65535 : 1114111) #define __Pyx_PyUnicode_KIND(u) (sizeof(Py_UNICODE)) #define __Pyx_PyUnicode_DATA(u) ((void*)PyUnicode_AS_UNICODE(u)) #define __Pyx_PyUnicode_READ(k, d, i) ((void)(k), (Py_UCS4)(((Py_UNICODE*)d)[i])) #define __Pyx_PyUnicode_WRITE(k, d, i, ch) (((void)(k)), ((Py_UNICODE*)d)[i] = ch) #define __Pyx_PyUnicode_IS_TRUE(u) (0 != PyUnicode_GET_SIZE(u)) #endif #if CYTHON_COMPILING_IN_PYPY #define __Pyx_PyUnicode_Concat(a, b) PyNumber_Add(a, b) #define __Pyx_PyUnicode_ConcatSafe(a, b) PyNumber_Add(a, b) #else #define __Pyx_PyUnicode_Concat(a, b) PyUnicode_Concat(a, b) #define __Pyx_PyUnicode_ConcatSafe(a, b) ((unlikely((a) == Py_None) || unlikely((b) == Py_None)) ?\ PyNumber_Add(a, b) : __Pyx_PyUnicode_Concat(a, b)) #endif #if CYTHON_COMPILING_IN_PYPY && !defined(PyUnicode_Contains) #define PyUnicode_Contains(u, s) PySequence_Contains(u, s) #endif #if CYTHON_COMPILING_IN_PYPY && !defined(PyByteArray_Check) #define PyByteArray_Check(obj) PyObject_TypeCheck(obj, &PyByteArray_Type) #endif #if CYTHON_COMPILING_IN_PYPY && !defined(PyObject_Format) #define PyObject_Format(obj, fmt) PyObject_CallMethod(obj, "__format__", "O", fmt) #endif #if CYTHON_COMPILING_IN_PYPY && !defined(PyObject_Malloc) #define PyObject_Malloc(s) PyMem_Malloc(s) #define PyObject_Free(p) PyMem_Free(p) #define PyObject_Realloc(p) PyMem_Realloc(p) #endif #if CYTHON_COMPILING_IN_PYSTON #define __Pyx_PyCode_HasFreeVars(co) PyCode_HasFreeVars(co) #define __Pyx_PyFrame_SetLineNumber(frame, lineno) PyFrame_SetLineNumber(frame, lineno) #else #define __Pyx_PyCode_HasFreeVars(co) (PyCode_GetNumFree(co) > 0) #define __Pyx_PyFrame_SetLineNumber(frame, lineno) (frame)->f_lineno = (lineno) #endif #define __Pyx_PyString_FormatSafe(a, b) ((unlikely((a) == Py_None)) ? PyNumber_Remainder(a, b) : __Pyx_PyString_Format(a, b)) #define __Pyx_PyUnicode_FormatSafe(a, b) ((unlikely((a) == Py_None)) ? PyNumber_Remainder(a, b) : PyUnicode_Format(a, b)) #if PY_MAJOR_VERSION >= 3 #define __Pyx_PyString_Format(a, b) PyUnicode_Format(a, b) #else #define __Pyx_PyString_Format(a, b) PyString_Format(a, b) #endif #if PY_MAJOR_VERSION < 3 && !defined(PyObject_ASCII) #define PyObject_ASCII(o) PyObject_Repr(o) #endif #if PY_MAJOR_VERSION >= 3 #define PyBaseString_Type PyUnicode_Type #define PyStringObject PyUnicodeObject #define PyString_Type PyUnicode_Type #define PyString_Check PyUnicode_Check #define PyString_CheckExact PyUnicode_CheckExact #endif #if PY_MAJOR_VERSION >= 3 #define __Pyx_PyBaseString_Check(obj) PyUnicode_Check(obj) #define __Pyx_PyBaseString_CheckExact(obj) PyUnicode_CheckExact(obj) #else #define __Pyx_PyBaseString_Check(obj) (PyString_Check(obj) || PyUnicode_Check(obj)) #define __Pyx_PyBaseString_CheckExact(obj) (PyString_CheckExact(obj) || PyUnicode_CheckExact(obj)) #endif #ifndef PySet_CheckExact #define PySet_CheckExact(obj) (Py_TYPE(obj) == &PySet_Type) #endif #define __Pyx_PyException_Check(obj) __Pyx_TypeCheck(obj, PyExc_Exception) #if PY_MAJOR_VERSION >= 3 #define PyIntObject PyLongObject #define PyInt_Type PyLong_Type #define PyInt_Check(op) PyLong_Check(op) #define PyInt_CheckExact(op) PyLong_CheckExact(op) #define PyInt_FromString PyLong_FromString #define PyInt_FromUnicode PyLong_FromUnicode #define PyInt_FromLong PyLong_FromLong #define PyInt_FromSize_t PyLong_FromSize_t #define PyInt_FromSsize_t PyLong_FromSsize_t #define PyInt_AsLong PyLong_AsLong #define PyInt_AS_LONG PyLong_AS_LONG #define PyInt_AsSsize_t PyLong_AsSsize_t #define PyInt_AsUnsignedLongMask PyLong_AsUnsignedLongMask #define PyInt_AsUnsignedLongLongMask PyLong_AsUnsignedLongLongMask #define PyNumber_Int PyNumber_Long #endif #if PY_MAJOR_VERSION >= 3 #define PyBoolObject PyLongObject #endif #if PY_MAJOR_VERSION >= 3 && CYTHON_COMPILING_IN_PYPY #ifndef PyUnicode_InternFromString #define PyUnicode_InternFromString(s) PyUnicode_FromString(s) #endif #endif #if PY_VERSION_HEX < 0x030200A4 typedef long Py_hash_t; #define __Pyx_PyInt_FromHash_t PyInt_FromLong #define __Pyx_PyInt_AsHash_t PyInt_AsLong #else #define __Pyx_PyInt_FromHash_t PyInt_FromSsize_t #define __Pyx_PyInt_AsHash_t PyInt_AsSsize_t #endif #if PY_MAJOR_VERSION >= 3 #define __Pyx_PyMethod_New(func, self, klass) ((self) ? PyMethod_New(func, self) : PyInstanceMethod_New(func)) #else #define __Pyx_PyMethod_New(func, self, klass) PyMethod_New(func, self, klass) #endif #ifndef __has_attribute #define __has_attribute(x) 0 #endif #ifndef __has_cpp_attribute #define __has_cpp_attribute(x) 0 #endif #if CYTHON_USE_ASYNC_SLOTS #if PY_VERSION_HEX >= 0x030500B1 #define __Pyx_PyAsyncMethodsStruct PyAsyncMethods #define __Pyx_PyType_AsAsync(obj) (Py_TYPE(obj)->tp_as_async) #else #define __Pyx_PyType_AsAsync(obj) ((__Pyx_PyAsyncMethodsStruct*) (Py_TYPE(obj)->tp_reserved)) #endif #else #define __Pyx_PyType_AsAsync(obj) NULL #endif #ifndef __Pyx_PyAsyncMethodsStruct typedef struct { unaryfunc am_await; unaryfunc am_aiter; unaryfunc am_anext; } __Pyx_PyAsyncMethodsStruct; #endif #ifndef CYTHON_RESTRICT #if defined(__GNUC__) #define CYTHON_RESTRICT __restrict__ #elif defined(_MSC_VER) && _MSC_VER >= 1400 #define CYTHON_RESTRICT __restrict #elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L #define CYTHON_RESTRICT restrict #else #define CYTHON_RESTRICT #endif #endif #ifndef CYTHON_UNUSED # if defined(__GNUC__) # if !(defined(__cplusplus)) || (__GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 4)) # define CYTHON_UNUSED __attribute__ ((__unused__)) # else # define CYTHON_UNUSED # endif # elif defined(__ICC) || (defined(__INTEL_COMPILER) && !defined(_MSC_VER)) # define CYTHON_UNUSED __attribute__ ((__unused__)) # else # define CYTHON_UNUSED # endif #endif #ifndef CYTHON_MAYBE_UNUSED_VAR # if defined(__cplusplus) template void CYTHON_MAYBE_UNUSED_VAR( const T& ) { } # else # define CYTHON_MAYBE_UNUSED_VAR(x) (void)(x) # endif #endif #ifndef CYTHON_NCP_UNUSED # if CYTHON_COMPILING_IN_CPYTHON # define CYTHON_NCP_UNUSED # else # define CYTHON_NCP_UNUSED CYTHON_UNUSED # endif #endif #define __Pyx_void_to_None(void_result) ((void)(void_result), Py_INCREF(Py_None), Py_None) #ifdef _MSC_VER #ifndef _MSC_STDINT_H_ #if _MSC_VER < 1300 typedef unsigned char uint8_t; typedef unsigned int uint32_t; #else typedef unsigned __int8 uint8_t; typedef unsigned __int32 uint32_t; #endif #endif #else #include #endif #ifndef CYTHON_FALLTHROUGH #if defined(__cplusplus) && __cplusplus >= 201103L #if __has_cpp_attribute(fallthrough) #define CYTHON_FALLTHROUGH [[fallthrough]] #elif __has_cpp_attribute(clang::fallthrough) #define CYTHON_FALLTHROUGH [[clang::fallthrough]] #elif __has_cpp_attribute(gnu::fallthrough) #define CYTHON_FALLTHROUGH [[gnu::fallthrough]] #endif #endif #ifndef CYTHON_FALLTHROUGH #if __has_attribute(fallthrough) #define CYTHON_FALLTHROUGH __attribute__((fallthrough)) #else #define CYTHON_FALLTHROUGH #endif #endif #if defined(__clang__ ) && defined(__apple_build_version__) #if __apple_build_version__ < 7000000 #undef CYTHON_FALLTHROUGH #define CYTHON_FALLTHROUGH #endif #endif #endif #ifndef CYTHON_INLINE #if defined(__clang__) #define CYTHON_INLINE __inline__ __attribute__ ((__unused__)) #elif defined(__GNUC__) #define CYTHON_INLINE __inline__ #elif defined(_MSC_VER) #define CYTHON_INLINE __inline #elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L #define CYTHON_INLINE inline #else #define CYTHON_INLINE #endif #endif #if defined(WIN32) || defined(MS_WINDOWS) #define _USE_MATH_DEFINES #endif #include #ifdef NAN #define __PYX_NAN() ((float) NAN) #else static CYTHON_INLINE float __PYX_NAN() { float value; memset(&value, 0xFF, sizeof(value)); return value; } #endif #if defined(__CYGWIN__) && defined(_LDBL_EQ_DBL) #define __Pyx_truncl trunc #else #define __Pyx_truncl truncl #endif #define __PYX_ERR(f_index, lineno, Ln_error) \ { \ __pyx_filename = __pyx_f[f_index]; __pyx_lineno = lineno; __pyx_clineno = __LINE__; goto Ln_error; \ } #ifndef __PYX_EXTERN_C #ifdef __cplusplus #define __PYX_EXTERN_C extern "C" #else #define __PYX_EXTERN_C extern #endif #endif #define __PYX_HAVE__pygame_sdl2__display #define __PYX_HAVE_API__pygame_sdl2__display #include #include #include #include #include "SDL.h" #include #ifdef _OPENMP #include #endif /* _OPENMP */ #if defined(PYREX_WITHOUT_ASSERTIONS) && !defined(CYTHON_WITHOUT_ASSERTIONS) #define CYTHON_WITHOUT_ASSERTIONS #endif typedef struct {PyObject **p; const char *s; const Py_ssize_t n; const char* encoding; const char is_unicode; const char is_str; const char intern; } __Pyx_StringTabEntry; #define __PYX_DEFAULT_STRING_ENCODING_IS_ASCII 0 #define __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT 0 #define __PYX_DEFAULT_STRING_ENCODING "" #define __Pyx_PyObject_FromString __Pyx_PyBytes_FromString #define __Pyx_PyObject_FromStringAndSize __Pyx_PyBytes_FromStringAndSize #define __Pyx_uchar_cast(c) ((unsigned char)c) #define __Pyx_long_cast(x) ((long)x) #define __Pyx_fits_Py_ssize_t(v, type, is_signed) (\ (sizeof(type) < sizeof(Py_ssize_t)) ||\ (sizeof(type) > sizeof(Py_ssize_t) &&\ likely(v < (type)PY_SSIZE_T_MAX ||\ v == (type)PY_SSIZE_T_MAX) &&\ (!is_signed || likely(v > (type)PY_SSIZE_T_MIN ||\ v == (type)PY_SSIZE_T_MIN))) ||\ (sizeof(type) == sizeof(Py_ssize_t) &&\ (is_signed || likely(v < (type)PY_SSIZE_T_MAX ||\ v == (type)PY_SSIZE_T_MAX))) ) #if defined (__cplusplus) && __cplusplus >= 201103L #include #define __Pyx_sst_abs(value) std::abs(value) #elif SIZEOF_INT >= SIZEOF_SIZE_T #define __Pyx_sst_abs(value) abs(value) #elif SIZEOF_LONG >= SIZEOF_SIZE_T #define __Pyx_sst_abs(value) labs(value) #elif defined (_MSC_VER) #define __Pyx_sst_abs(value) ((Py_ssize_t)_abs64(value)) #elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L #define __Pyx_sst_abs(value) llabs(value) #elif defined (__GNUC__) #define __Pyx_sst_abs(value) __builtin_llabs(value) #else #define __Pyx_sst_abs(value) ((value<0) ? -value : value) #endif static CYTHON_INLINE const char* __Pyx_PyObject_AsString(PyObject*); static CYTHON_INLINE const char* __Pyx_PyObject_AsStringAndSize(PyObject*, Py_ssize_t* length); #define __Pyx_PyByteArray_FromString(s) PyByteArray_FromStringAndSize((const char*)s, strlen((const char*)s)) #define __Pyx_PyByteArray_FromStringAndSize(s, l) PyByteArray_FromStringAndSize((const char*)s, l) #define __Pyx_PyBytes_FromString PyBytes_FromString #define __Pyx_PyBytes_FromStringAndSize PyBytes_FromStringAndSize static CYTHON_INLINE PyObject* __Pyx_PyUnicode_FromString(const char*); #if PY_MAJOR_VERSION < 3 #define __Pyx_PyStr_FromString __Pyx_PyBytes_FromString #define __Pyx_PyStr_FromStringAndSize __Pyx_PyBytes_FromStringAndSize #else #define __Pyx_PyStr_FromString __Pyx_PyUnicode_FromString #define __Pyx_PyStr_FromStringAndSize __Pyx_PyUnicode_FromStringAndSize #endif #define __Pyx_PyBytes_AsWritableString(s) ((char*) PyBytes_AS_STRING(s)) #define __Pyx_PyBytes_AsWritableSString(s) ((signed char*) PyBytes_AS_STRING(s)) #define __Pyx_PyBytes_AsWritableUString(s) ((unsigned char*) PyBytes_AS_STRING(s)) #define __Pyx_PyBytes_AsString(s) ((const char*) PyBytes_AS_STRING(s)) #define __Pyx_PyBytes_AsSString(s) ((const signed char*) PyBytes_AS_STRING(s)) #define __Pyx_PyBytes_AsUString(s) ((const unsigned char*) PyBytes_AS_STRING(s)) #define __Pyx_PyObject_AsWritableString(s) ((char*) __Pyx_PyObject_AsString(s)) #define __Pyx_PyObject_AsWritableSString(s) ((signed char*) __Pyx_PyObject_AsString(s)) #define __Pyx_PyObject_AsWritableUString(s) ((unsigned char*) __Pyx_PyObject_AsString(s)) #define __Pyx_PyObject_AsSString(s) ((const signed char*) __Pyx_PyObject_AsString(s)) #define __Pyx_PyObject_AsUString(s) ((const unsigned char*) __Pyx_PyObject_AsString(s)) #define __Pyx_PyObject_FromCString(s) __Pyx_PyObject_FromString((const char*)s) #define __Pyx_PyBytes_FromCString(s) __Pyx_PyBytes_FromString((const char*)s) #define __Pyx_PyByteArray_FromCString(s) __Pyx_PyByteArray_FromString((const char*)s) #define __Pyx_PyStr_FromCString(s) __Pyx_PyStr_FromString((const char*)s) #define __Pyx_PyUnicode_FromCString(s) __Pyx_PyUnicode_FromString((const char*)s) static CYTHON_INLINE size_t __Pyx_Py_UNICODE_strlen(const Py_UNICODE *u) { const Py_UNICODE *u_end = u; while (*u_end++) ; return (size_t)(u_end - u - 1); } #define __Pyx_PyUnicode_FromUnicode(u) PyUnicode_FromUnicode(u, __Pyx_Py_UNICODE_strlen(u)) #define __Pyx_PyUnicode_FromUnicodeAndLength PyUnicode_FromUnicode #define __Pyx_PyUnicode_AsUnicode PyUnicode_AsUnicode #define __Pyx_NewRef(obj) (Py_INCREF(obj), obj) #define __Pyx_Owned_Py_None(b) __Pyx_NewRef(Py_None) #define __Pyx_PyBool_FromLong(b) ((b) ? __Pyx_NewRef(Py_True) : __Pyx_NewRef(Py_False)) static CYTHON_INLINE int __Pyx_PyObject_IsTrue(PyObject*); static CYTHON_INLINE PyObject* __Pyx_PyNumber_IntOrLong(PyObject* x); #define __Pyx_PySequence_Tuple(obj)\ (likely(PyTuple_CheckExact(obj)) ? __Pyx_NewRef(obj) : PySequence_Tuple(obj)) static CYTHON_INLINE Py_ssize_t __Pyx_PyIndex_AsSsize_t(PyObject*); static CYTHON_INLINE PyObject * __Pyx_PyInt_FromSize_t(size_t); #if CYTHON_ASSUME_SAFE_MACROS #define __pyx_PyFloat_AsDouble(x) (PyFloat_CheckExact(x) ? PyFloat_AS_DOUBLE(x) : PyFloat_AsDouble(x)) #else #define __pyx_PyFloat_AsDouble(x) PyFloat_AsDouble(x) #endif #define __pyx_PyFloat_AsFloat(x) ((float) __pyx_PyFloat_AsDouble(x)) #if PY_MAJOR_VERSION >= 3 #define __Pyx_PyNumber_Int(x) (PyLong_CheckExact(x) ? __Pyx_NewRef(x) : PyNumber_Long(x)) #else #define __Pyx_PyNumber_Int(x) (PyInt_CheckExact(x) ? __Pyx_NewRef(x) : PyNumber_Int(x)) #endif #define __Pyx_PyNumber_Float(x) (PyFloat_CheckExact(x) ? __Pyx_NewRef(x) : PyNumber_Float(x)) #if PY_MAJOR_VERSION < 3 && __PYX_DEFAULT_STRING_ENCODING_IS_ASCII static int __Pyx_sys_getdefaultencoding_not_ascii; static int __Pyx_init_sys_getdefaultencoding_params(void) { PyObject* sys; PyObject* default_encoding = NULL; PyObject* ascii_chars_u = NULL; PyObject* ascii_chars_b = NULL; const char* default_encoding_c; sys = PyImport_ImportModule("sys"); if (!sys) goto bad; default_encoding = PyObject_CallMethod(sys, (char*) "getdefaultencoding", NULL); Py_DECREF(sys); if (!default_encoding) goto bad; default_encoding_c = PyBytes_AsString(default_encoding); if (!default_encoding_c) goto bad; if (strcmp(default_encoding_c, "ascii") == 0) { __Pyx_sys_getdefaultencoding_not_ascii = 0; } else { char ascii_chars[128]; int c; for (c = 0; c < 128; c++) { ascii_chars[c] = c; } __Pyx_sys_getdefaultencoding_not_ascii = 1; ascii_chars_u = PyUnicode_DecodeASCII(ascii_chars, 128, NULL); if (!ascii_chars_u) goto bad; ascii_chars_b = PyUnicode_AsEncodedString(ascii_chars_u, default_encoding_c, NULL); if (!ascii_chars_b || !PyBytes_Check(ascii_chars_b) || memcmp(ascii_chars, PyBytes_AS_STRING(ascii_chars_b), 128) != 0) { PyErr_Format( PyExc_ValueError, "This module compiled with c_string_encoding=ascii, but default encoding '%.200s' is not a superset of ascii.", default_encoding_c); goto bad; } Py_DECREF(ascii_chars_u); Py_DECREF(ascii_chars_b); } Py_DECREF(default_encoding); return 0; bad: Py_XDECREF(default_encoding); Py_XDECREF(ascii_chars_u); Py_XDECREF(ascii_chars_b); return -1; } #endif #if __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT && PY_MAJOR_VERSION >= 3 #define __Pyx_PyUnicode_FromStringAndSize(c_str, size) PyUnicode_DecodeUTF8(c_str, size, NULL) #else #define __Pyx_PyUnicode_FromStringAndSize(c_str, size) PyUnicode_Decode(c_str, size, __PYX_DEFAULT_STRING_ENCODING, NULL) #if __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT static char* __PYX_DEFAULT_STRING_ENCODING; static int __Pyx_init_sys_getdefaultencoding_params(void) { PyObject* sys; PyObject* default_encoding = NULL; char* default_encoding_c; sys = PyImport_ImportModule("sys"); if (!sys) goto bad; default_encoding = PyObject_CallMethod(sys, (char*) (const char*) "getdefaultencoding", NULL); Py_DECREF(sys); if (!default_encoding) goto bad; default_encoding_c = PyBytes_AsString(default_encoding); if (!default_encoding_c) goto bad; __PYX_DEFAULT_STRING_ENCODING = (char*) malloc(strlen(default_encoding_c)); if (!__PYX_DEFAULT_STRING_ENCODING) goto bad; strcpy(__PYX_DEFAULT_STRING_ENCODING, default_encoding_c); Py_DECREF(default_encoding); return 0; bad: Py_XDECREF(default_encoding); return -1; } #endif #endif /* Test for GCC > 2.95 */ #if defined(__GNUC__) && (__GNUC__ > 2 || (__GNUC__ == 2 && (__GNUC_MINOR__ > 95))) #define likely(x) __builtin_expect(!!(x), 1) #define unlikely(x) __builtin_expect(!!(x), 0) #else /* !__GNUC__ or GCC < 2.95 */ #define likely(x) (x) #define unlikely(x) (x) #endif /* __GNUC__ */ static CYTHON_INLINE void __Pyx_pretend_to_initialize(void* ptr) { (void)ptr; } static PyObject *__pyx_m = NULL; static PyObject *__pyx_d; static PyObject *__pyx_b; static PyObject *__pyx_cython_runtime; static PyObject *__pyx_empty_tuple; static PyObject *__pyx_empty_bytes; static PyObject *__pyx_empty_unicode; static int __pyx_lineno; static int __pyx_clineno = 0; static const char * __pyx_cfilenm= __FILE__; static const char *__pyx_filename; static const char *__pyx_f[] = { "src/pygame_sdl2/display.pyx", "stringsource", "src/pygame_sdl2/display.pxd", "src/pygame_sdl2/surface.pxd", "src/pygame_sdl2/rect.pxd", }; /* NoFastGil.proto */ #define __Pyx_PyGILState_Ensure PyGILState_Ensure #define __Pyx_PyGILState_Release PyGILState_Release #define __Pyx_FastGIL_Remember() #define __Pyx_FastGIL_Forget() #define __Pyx_FastGilFuncInit() /* ForceInitThreads.proto */ #ifndef __PYX_FORCE_INIT_THREADS #define __PYX_FORCE_INIT_THREADS 0 #endif /*--- Type declarations ---*/ struct __pyx_obj_11pygame_sdl2_7surface_Surface; struct __pyx_obj_11pygame_sdl2_4rect_Rect; struct __pyx_obj_11pygame_sdl2_7display_Window; struct __pyx_opt_args_11pygame_sdl2_4rect_to_sdl_rect; /* "pygame_sdl2/rect.pxd":31 * * * cdef int to_sdl_rect(rectlike, SDL_Rect *rect, argname=*) except -1 # <<<<<<<<<<<<<< */ struct __pyx_opt_args_11pygame_sdl2_4rect_to_sdl_rect { int __pyx_n; PyObject *argname; }; /* "pygame_sdl2/surface.pxd":23 * from sdl2 cimport SDL_Surface * * cdef class Surface: # <<<<<<<<<<<<<< * # Allow weak references. * cdef object __weakref__ */ struct __pyx_obj_11pygame_sdl2_7surface_Surface { PyObject_HEAD struct __pyx_vtabstruct_11pygame_sdl2_7surface_Surface *__pyx_vtab; PyObject *__weakref__; SDL_Surface *surface; int owns_surface; int window_surface; PyObject *locklist; struct __pyx_obj_11pygame_sdl2_7surface_Surface *parent; struct __pyx_obj_11pygame_sdl2_7surface_Surface *root; int offset_x; int offset_y; PyObject *get_window_flags; int has_alpha; }; /* "pygame_sdl2/rect.pxd":21 * from sdl2 cimport * * * cdef class Rect: # <<<<<<<<<<<<<< * # Allow weak references. * cdef object __weakref__ */ struct __pyx_obj_11pygame_sdl2_4rect_Rect { PyObject_HEAD PyObject *__weakref__; int x; int y; int w; int h; }; /* "pygame_sdl2/display.pxd":23 * from pygame_sdl2.surface cimport Surface * * cdef class Window: # <<<<<<<<<<<<<< * # Allow weak references. * cdef object __weakref__ */ struct __pyx_obj_11pygame_sdl2_7display_Window { PyObject_HEAD PyObject *__weakref__; SDL_Window *window; SDL_Surface *window_surface; struct __pyx_obj_11pygame_sdl2_7surface_Surface *surface; SDL_GLContext gl_context; Uint32 create_flags; }; /* "pygame_sdl2/surface.pxd":23 * from sdl2 cimport SDL_Surface * * cdef class Surface: # <<<<<<<<<<<<<< * # Allow weak references. * cdef object __weakref__ */ struct __pyx_vtabstruct_11pygame_sdl2_7surface_Surface { void (*take_surface)(struct __pyx_obj_11pygame_sdl2_7surface_Surface *, SDL_Surface *); }; static struct __pyx_vtabstruct_11pygame_sdl2_7surface_Surface *__pyx_vtabptr_11pygame_sdl2_7surface_Surface; /* --- Runtime support code (head) --- */ /* Refnanny.proto */ #ifndef CYTHON_REFNANNY #define CYTHON_REFNANNY 0 #endif #if CYTHON_REFNANNY typedef struct { void (*INCREF)(void*, PyObject*, int); void (*DECREF)(void*, PyObject*, int); void (*GOTREF)(void*, PyObject*, int); void (*GIVEREF)(void*, PyObject*, int); void* (*SetupContext)(const char*, int, const char*); void (*FinishContext)(void**); } __Pyx_RefNannyAPIStruct; static __Pyx_RefNannyAPIStruct *__Pyx_RefNanny = NULL; static __Pyx_RefNannyAPIStruct *__Pyx_RefNannyImportAPI(const char *modname); #define __Pyx_RefNannyDeclarations void *__pyx_refnanny = NULL; #ifdef WITH_THREAD #define __Pyx_RefNannySetupContext(name, acquire_gil)\ if (acquire_gil) {\ PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure();\ __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), __LINE__, __FILE__);\ PyGILState_Release(__pyx_gilstate_save);\ } else {\ __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), __LINE__, __FILE__);\ } #else #define __Pyx_RefNannySetupContext(name, acquire_gil)\ __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), __LINE__, __FILE__) #endif #define __Pyx_RefNannyFinishContext()\ __Pyx_RefNanny->FinishContext(&__pyx_refnanny) #define __Pyx_INCREF(r) __Pyx_RefNanny->INCREF(__pyx_refnanny, (PyObject *)(r), __LINE__) #define __Pyx_DECREF(r) __Pyx_RefNanny->DECREF(__pyx_refnanny, (PyObject *)(r), __LINE__) #define __Pyx_GOTREF(r) __Pyx_RefNanny->GOTREF(__pyx_refnanny, (PyObject *)(r), __LINE__) #define __Pyx_GIVEREF(r) __Pyx_RefNanny->GIVEREF(__pyx_refnanny, (PyObject *)(r), __LINE__) #define __Pyx_XINCREF(r) do { if((r) != NULL) {__Pyx_INCREF(r); }} while(0) #define __Pyx_XDECREF(r) do { if((r) != NULL) {__Pyx_DECREF(r); }} while(0) #define __Pyx_XGOTREF(r) do { if((r) != NULL) {__Pyx_GOTREF(r); }} while(0) #define __Pyx_XGIVEREF(r) do { if((r) != NULL) {__Pyx_GIVEREF(r);}} while(0) #else #define __Pyx_RefNannyDeclarations #define __Pyx_RefNannySetupContext(name, acquire_gil) #define __Pyx_RefNannyFinishContext() #define __Pyx_INCREF(r) Py_INCREF(r) #define __Pyx_DECREF(r) Py_DECREF(r) #define __Pyx_GOTREF(r) #define __Pyx_GIVEREF(r) #define __Pyx_XINCREF(r) Py_XINCREF(r) #define __Pyx_XDECREF(r) Py_XDECREF(r) #define __Pyx_XGOTREF(r) #define __Pyx_XGIVEREF(r) #endif #define __Pyx_XDECREF_SET(r, v) do {\ PyObject *tmp = (PyObject *) r;\ r = v; __Pyx_XDECREF(tmp);\ } while (0) #define __Pyx_DECREF_SET(r, v) do {\ PyObject *tmp = (PyObject *) r;\ r = v; __Pyx_DECREF(tmp);\ } while (0) #define __Pyx_CLEAR(r) do { PyObject* tmp = ((PyObject*)(r)); r = NULL; __Pyx_DECREF(tmp);} while(0) #define __Pyx_XCLEAR(r) do { if((r) != NULL) {PyObject* tmp = ((PyObject*)(r)); r = NULL; __Pyx_DECREF(tmp);}} while(0) /* PyObjectGetAttrStr.proto */ #if CYTHON_USE_TYPE_SLOTS static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStr(PyObject* obj, PyObject* attr_name) { PyTypeObject* tp = Py_TYPE(obj); if (likely(tp->tp_getattro)) return tp->tp_getattro(obj, attr_name); #if PY_MAJOR_VERSION < 3 if (likely(tp->tp_getattr)) return tp->tp_getattr(obj, PyString_AS_STRING(attr_name)); #endif return PyObject_GetAttr(obj, attr_name); } #else #define __Pyx_PyObject_GetAttrStr(o,n) PyObject_GetAttr(o,n) #endif /* GetBuiltinName.proto */ static PyObject *__Pyx_GetBuiltinName(PyObject *name); /* RaiseArgTupleInvalid.proto */ static void __Pyx_RaiseArgtupleInvalid(const char* func_name, int exact, Py_ssize_t num_min, Py_ssize_t num_max, Py_ssize_t num_found); /* RaiseDoubleKeywords.proto */ static void __Pyx_RaiseDoubleKeywordsError(const char* func_name, PyObject* kw_name); /* ParseKeywords.proto */ static int __Pyx_ParseOptionalKeywords(PyObject *kwds, PyObject **argnames[],\ PyObject *kwds2, PyObject *values[], Py_ssize_t num_pos_args,\ const char* function_name); /* PyObjectCall.proto */ #if CYTHON_COMPILING_IN_CPYTHON static CYTHON_INLINE PyObject* __Pyx_PyObject_Call(PyObject *func, PyObject *arg, PyObject *kw); #else #define __Pyx_PyObject_Call(func, arg, kw) PyObject_Call(func, arg, kw) #endif /* GetModuleGlobalName.proto */ static CYTHON_INLINE PyObject *__Pyx_GetModuleGlobalName(PyObject *name); /* PySequenceContains.proto */ static CYTHON_INLINE int __Pyx_PySequence_ContainsTF(PyObject* item, PyObject* seq, int eq) { int result = PySequence_Contains(seq, item); return unlikely(result < 0) ? result : (result == (eq == Py_EQ)); } /* PyCFunctionFastCall.proto */ #if CYTHON_FAST_PYCCALL static CYTHON_INLINE PyObject *__Pyx_PyCFunction_FastCall(PyObject *func, PyObject **args, Py_ssize_t nargs); #else #define __Pyx_PyCFunction_FastCall(func, args, nargs) (assert(0), NULL) #endif /* PyFunctionFastCall.proto */ #if CYTHON_FAST_PYCALL #define __Pyx_PyFunction_FastCall(func, args, nargs)\ __Pyx_PyFunction_FastCallDict((func), (args), (nargs), NULL) #if 1 || PY_VERSION_HEX < 0x030600B1 static PyObject *__Pyx_PyFunction_FastCallDict(PyObject *func, PyObject **args, int nargs, PyObject *kwargs); #else #define __Pyx_PyFunction_FastCallDict(func, args, nargs, kwargs) _PyFunction_FastCallDict(func, args, nargs, kwargs) #endif #endif /* PyObjectCallMethO.proto */ #if CYTHON_COMPILING_IN_CPYTHON static CYTHON_INLINE PyObject* __Pyx_PyObject_CallMethO(PyObject *func, PyObject *arg); #endif /* PyObjectCallOneArg.proto */ static CYTHON_INLINE PyObject* __Pyx_PyObject_CallOneArg(PyObject *func, PyObject *arg); /* PyObjectCallNoArg.proto */ #if CYTHON_COMPILING_IN_CPYTHON static CYTHON_INLINE PyObject* __Pyx_PyObject_CallNoArg(PyObject *func); #else #define __Pyx_PyObject_CallNoArg(func) __Pyx_PyObject_Call(func, __pyx_empty_tuple, NULL) #endif /* PyThreadStateGet.proto */ #if CYTHON_FAST_THREAD_STATE #define __Pyx_PyThreadState_declare PyThreadState *__pyx_tstate; #define __Pyx_PyThreadState_assign __pyx_tstate = __Pyx_PyThreadState_Current; #define __Pyx_PyErr_Occurred() __pyx_tstate->curexc_type #else #define __Pyx_PyThreadState_declare #define __Pyx_PyThreadState_assign #define __Pyx_PyErr_Occurred() PyErr_Occurred() #endif /* PyErrFetchRestore.proto */ #if CYTHON_FAST_THREAD_STATE #define __Pyx_PyErr_Clear() __Pyx_ErrRestore(NULL, NULL, NULL) #define __Pyx_ErrRestoreWithState(type, value, tb) __Pyx_ErrRestoreInState(PyThreadState_GET(), type, value, tb) #define __Pyx_ErrFetchWithState(type, value, tb) __Pyx_ErrFetchInState(PyThreadState_GET(), type, value, tb) #define __Pyx_ErrRestore(type, value, tb) __Pyx_ErrRestoreInState(__pyx_tstate, type, value, tb) #define __Pyx_ErrFetch(type, value, tb) __Pyx_ErrFetchInState(__pyx_tstate, type, value, tb) static CYTHON_INLINE void __Pyx_ErrRestoreInState(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb); static CYTHON_INLINE void __Pyx_ErrFetchInState(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb); #if CYTHON_COMPILING_IN_CPYTHON #define __Pyx_PyErr_SetNone(exc) (Py_INCREF(exc), __Pyx_ErrRestore((exc), NULL, NULL)) #else #define __Pyx_PyErr_SetNone(exc) PyErr_SetNone(exc) #endif #else #define __Pyx_PyErr_Clear() PyErr_Clear() #define __Pyx_PyErr_SetNone(exc) PyErr_SetNone(exc) #define __Pyx_ErrRestoreWithState(type, value, tb) PyErr_Restore(type, value, tb) #define __Pyx_ErrFetchWithState(type, value, tb) PyErr_Fetch(type, value, tb) #define __Pyx_ErrRestoreInState(tstate, type, value, tb) PyErr_Restore(type, value, tb) #define __Pyx_ErrFetchInState(tstate, type, value, tb) PyErr_Fetch(type, value, tb) #define __Pyx_ErrRestore(type, value, tb) PyErr_Restore(type, value, tb) #define __Pyx_ErrFetch(type, value, tb) PyErr_Fetch(type, value, tb) #endif /* RaiseException.proto */ static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, PyObject *cause); /* Import.proto */ static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list, int level); /* SaveResetException.proto */ #if CYTHON_FAST_THREAD_STATE #define __Pyx_ExceptionSave(type, value, tb) __Pyx__ExceptionSave(__pyx_tstate, type, value, tb) static CYTHON_INLINE void __Pyx__ExceptionSave(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb); #define __Pyx_ExceptionReset(type, value, tb) __Pyx__ExceptionReset(__pyx_tstate, type, value, tb) static CYTHON_INLINE void __Pyx__ExceptionReset(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb); #else #define __Pyx_ExceptionSave(type, value, tb) PyErr_GetExcInfo(type, value, tb) #define __Pyx_ExceptionReset(type, value, tb) PyErr_SetExcInfo(type, value, tb) #endif /* PyErrExceptionMatches.proto */ #if CYTHON_FAST_THREAD_STATE #define __Pyx_PyErr_ExceptionMatches(err) __Pyx_PyErr_ExceptionMatchesInState(__pyx_tstate, err) static CYTHON_INLINE int __Pyx_PyErr_ExceptionMatchesInState(PyThreadState* tstate, PyObject* err); #else #define __Pyx_PyErr_ExceptionMatches(err) PyErr_ExceptionMatches(err) #endif /* GetItemInt.proto */ #define __Pyx_GetItemInt(o, i, type, is_signed, to_py_func, is_list, wraparound, boundscheck)\ (__Pyx_fits_Py_ssize_t(i, type, is_signed) ?\ __Pyx_GetItemInt_Fast(o, (Py_ssize_t)i, is_list, wraparound, boundscheck) :\ (is_list ? (PyErr_SetString(PyExc_IndexError, "list index out of range"), (PyObject*)NULL) :\ __Pyx_GetItemInt_Generic(o, to_py_func(i)))) #define __Pyx_GetItemInt_List(o, i, type, is_signed, to_py_func, is_list, wraparound, boundscheck)\ (__Pyx_fits_Py_ssize_t(i, type, is_signed) ?\ __Pyx_GetItemInt_List_Fast(o, (Py_ssize_t)i, wraparound, boundscheck) :\ (PyErr_SetString(PyExc_IndexError, "list index out of range"), (PyObject*)NULL)) static CYTHON_INLINE PyObject *__Pyx_GetItemInt_List_Fast(PyObject *o, Py_ssize_t i, int wraparound, int boundscheck); #define __Pyx_GetItemInt_Tuple(o, i, type, is_signed, to_py_func, is_list, wraparound, boundscheck)\ (__Pyx_fits_Py_ssize_t(i, type, is_signed) ?\ __Pyx_GetItemInt_Tuple_Fast(o, (Py_ssize_t)i, wraparound, boundscheck) :\ (PyErr_SetString(PyExc_IndexError, "tuple index out of range"), (PyObject*)NULL)) static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Tuple_Fast(PyObject *o, Py_ssize_t i, int wraparound, int boundscheck); static PyObject *__Pyx_GetItemInt_Generic(PyObject *o, PyObject* j); static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Fast(PyObject *o, Py_ssize_t i, int is_list, int wraparound, int boundscheck); /* GetException.proto */ #if CYTHON_FAST_THREAD_STATE #define __Pyx_GetException(type, value, tb) __Pyx__GetException(__pyx_tstate, type, value, tb) static int __Pyx__GetException(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb); #else static int __Pyx_GetException(PyObject **type, PyObject **value, PyObject **tb); #endif /* RaiseTooManyValuesToUnpack.proto */ static CYTHON_INLINE void __Pyx_RaiseTooManyValuesError(Py_ssize_t expected); /* RaiseNeedMoreValuesToUnpack.proto */ static CYTHON_INLINE void __Pyx_RaiseNeedMoreValuesError(Py_ssize_t index); /* IterFinish.proto */ static CYTHON_INLINE int __Pyx_IterFinish(void); /* UnpackItemEndCheck.proto */ static int __Pyx_IternextUnpackEndCheck(PyObject *retval, Py_ssize_t expected); /* SwapException.proto */ #if CYTHON_FAST_THREAD_STATE #define __Pyx_ExceptionSwap(type, value, tb) __Pyx__ExceptionSwap(__pyx_tstate, type, value, tb) static CYTHON_INLINE void __Pyx__ExceptionSwap(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb); #else static CYTHON_INLINE void __Pyx_ExceptionSwap(PyObject **type, PyObject **value, PyObject **tb); #endif /* ArgTypeTest.proto */ #define __Pyx_ArgTypeTest(obj, type, none_allowed, name, exact)\ ((likely((Py_TYPE(obj) == type) | (none_allowed && (obj == Py_None)))) ? 1 :\ __Pyx__ArgTypeTest(obj, type, name, exact)) static int __Pyx__ArgTypeTest(PyObject *obj, PyTypeObject *type, const char *name, int exact); /* ExtTypeTest.proto */ static CYTHON_INLINE int __Pyx_TypeTest(PyObject *obj, PyTypeObject *type); /* PyObjectSetAttrStr.proto */ #if CYTHON_USE_TYPE_SLOTS #define __Pyx_PyObject_DelAttrStr(o,n) __Pyx_PyObject_SetAttrStr(o,n,NULL) static CYTHON_INLINE int __Pyx_PyObject_SetAttrStr(PyObject* obj, PyObject* attr_name, PyObject* value) { PyTypeObject* tp = Py_TYPE(obj); if (likely(tp->tp_setattro)) return tp->tp_setattro(obj, attr_name, value); #if PY_MAJOR_VERSION < 3 if (likely(tp->tp_setattr)) return tp->tp_setattr(obj, PyString_AS_STRING(attr_name), value); #endif return PyObject_SetAttr(obj, attr_name, value); } #else #define __Pyx_PyObject_DelAttrStr(o,n) PyObject_DelAttr(o,n) #define __Pyx_PyObject_SetAttrStr(o,n,v) PyObject_SetAttr(o,n,v) #endif /* ListAppend.proto */ #if CYTHON_USE_PYLIST_INTERNALS && CYTHON_ASSUME_SAFE_MACROS static CYTHON_INLINE int __Pyx_PyList_Append(PyObject* list, PyObject* x) { PyListObject* L = (PyListObject*) list; Py_ssize_t len = Py_SIZE(list); if (likely(L->allocated > len) & likely(len > (L->allocated >> 1))) { Py_INCREF(x); PyList_SET_ITEM(list, len, x); Py_SIZE(list) = len+1; return 0; } return PyList_Append(list, x); } #else #define __Pyx_PyList_Append(L,x) PyList_Append(L,x) #endif /* SetupReduce.proto */ static int __Pyx_setup_reduce(PyObject* type_obj); /* GetVTable.proto */ static void* __Pyx_GetVtable(PyObject *dict); /* ImportFrom.proto */ static PyObject* __Pyx_ImportFrom(PyObject* module, PyObject* name); /* CalculateMetaclass.proto */ static PyObject *__Pyx_CalculateMetaclass(PyTypeObject *metaclass, PyObject *bases); /* FetchCommonType.proto */ static PyTypeObject* __Pyx_FetchCommonType(PyTypeObject* type); /* CythonFunction.proto */ #define __Pyx_CyFunction_USED 1 #include #define __Pyx_CYFUNCTION_STATICMETHOD 0x01 #define __Pyx_CYFUNCTION_CLASSMETHOD 0x02 #define __Pyx_CYFUNCTION_CCLASS 0x04 #define __Pyx_CyFunction_GetClosure(f)\ (((__pyx_CyFunctionObject *) (f))->func_closure) #define __Pyx_CyFunction_GetClassObj(f)\ (((__pyx_CyFunctionObject *) (f))->func_classobj) #define __Pyx_CyFunction_Defaults(type, f)\ ((type *)(((__pyx_CyFunctionObject *) (f))->defaults)) #define __Pyx_CyFunction_SetDefaultsGetter(f, g)\ ((__pyx_CyFunctionObject *) (f))->defaults_getter = (g) typedef struct { PyCFunctionObject func; #if PY_VERSION_HEX < 0x030500A0 PyObject *func_weakreflist; #endif PyObject *func_dict; PyObject *func_name; PyObject *func_qualname; PyObject *func_doc; PyObject *func_globals; PyObject *func_code; PyObject *func_closure; PyObject *func_classobj; void *defaults; int defaults_pyobjects; int flags; PyObject *defaults_tuple; PyObject *defaults_kwdict; PyObject *(*defaults_getter)(PyObject *); PyObject *func_annotations; } __pyx_CyFunctionObject; static PyTypeObject *__pyx_CyFunctionType = 0; #define __Pyx_CyFunction_NewEx(ml, flags, qualname, self, module, globals, code)\ __Pyx_CyFunction_New(__pyx_CyFunctionType, ml, flags, qualname, self, module, globals, code) static PyObject *__Pyx_CyFunction_New(PyTypeObject *, PyMethodDef *ml, int flags, PyObject* qualname, PyObject *self, PyObject *module, PyObject *globals, PyObject* code); static CYTHON_INLINE void *__Pyx_CyFunction_InitDefaults(PyObject *m, size_t size, int pyobjects); static CYTHON_INLINE void __Pyx_CyFunction_SetDefaultsTuple(PyObject *m, PyObject *tuple); static CYTHON_INLINE void __Pyx_CyFunction_SetDefaultsKwDict(PyObject *m, PyObject *dict); static CYTHON_INLINE void __Pyx_CyFunction_SetAnnotationsDict(PyObject *m, PyObject *dict); static int __pyx_CyFunction_init(void); /* Py3ClassCreate.proto */ static PyObject *__Pyx_Py3MetaclassPrepare(PyObject *metaclass, PyObject *bases, PyObject *name, PyObject *qualname, PyObject *mkw, PyObject *modname, PyObject *doc); static PyObject *__Pyx_Py3ClassCreate(PyObject *metaclass, PyObject *name, PyObject *bases, PyObject *dict, PyObject *mkw, int calculate_metaclass, int allow_py2_metaclass); /* CLineInTraceback.proto */ #ifdef CYTHON_CLINE_IN_TRACEBACK #define __Pyx_CLineForTraceback(tstate, c_line) (((CYTHON_CLINE_IN_TRACEBACK)) ? c_line : 0) #else static int __Pyx_CLineForTraceback(PyThreadState *tstate, int c_line); #endif /* CodeObjectCache.proto */ typedef struct { PyCodeObject* code_object; int code_line; } __Pyx_CodeObjectCacheEntry; struct __Pyx_CodeObjectCache { int count; int max_count; __Pyx_CodeObjectCacheEntry* entries; }; static struct __Pyx_CodeObjectCache __pyx_code_cache = {0,0,NULL}; static int __pyx_bisect_code_objects(__Pyx_CodeObjectCacheEntry* entries, int count, int code_line); static PyCodeObject *__pyx_find_code_object(int code_line); static void __pyx_insert_code_object(int code_line, PyCodeObject* code_object); /* AddTraceback.proto */ static void __Pyx_AddTraceback(const char *funcname, int c_line, int py_line, const char *filename); /* CIntToPy.proto */ static CYTHON_INLINE PyObject* __Pyx_PyInt_From_int(int value); /* CIntToPy.proto */ static CYTHON_INLINE PyObject* __Pyx_PyInt_From_long(long value); /* CIntToPy.proto */ static CYTHON_INLINE PyObject* __Pyx_PyInt_From_SDL_WindowFlags(SDL_WindowFlags value); /* CIntToPy.proto */ static CYTHON_INLINE PyObject* __Pyx_PyInt_From_uint32_t(uint32_t value); /* CIntToPy.proto */ static CYTHON_INLINE PyObject* __Pyx_PyInt_From_uint8_t(uint8_t value); /* CIntFromPy.proto */ static CYTHON_INLINE uint32_t __Pyx_PyInt_As_uint32_t(PyObject *); /* CIntFromPy.proto */ static CYTHON_INLINE int __Pyx_PyInt_As_int(PyObject *); /* CIntFromPy.proto */ static CYTHON_INLINE long __Pyx_PyInt_As_long(PyObject *); /* CIntFromPy.proto */ static CYTHON_INLINE uint16_t __Pyx_PyInt_As_uint16_t(PyObject *); /* CIntFromPy.proto */ static CYTHON_INLINE SDL_GLattr __Pyx_PyInt_As_SDL_GLattr(PyObject *); /* FastTypeChecks.proto */ #if CYTHON_COMPILING_IN_CPYTHON #define __Pyx_TypeCheck(obj, type) __Pyx_IsSubtype(Py_TYPE(obj), (PyTypeObject *)type) static CYTHON_INLINE int __Pyx_IsSubtype(PyTypeObject *a, PyTypeObject *b); static CYTHON_INLINE int __Pyx_PyErr_GivenExceptionMatches(PyObject *err, PyObject *type); static CYTHON_INLINE int __Pyx_PyErr_GivenExceptionMatches2(PyObject *err, PyObject *type1, PyObject *type2); #else #define __Pyx_TypeCheck(obj, type) PyObject_TypeCheck(obj, (PyTypeObject *)type) #define __Pyx_PyErr_GivenExceptionMatches(err, type) PyErr_GivenExceptionMatches(err, type) #define __Pyx_PyErr_GivenExceptionMatches2(err, type1, type2) (PyErr_GivenExceptionMatches(err, type1) || PyErr_GivenExceptionMatches(err, type2)) #endif /* CheckBinaryVersion.proto */ static int __Pyx_check_binary_version(void); /* VoidPtrExport.proto */ static int __Pyx_ExportVoidPtr(PyObject *name, void *p, const char *sig); /* FunctionExport.proto */ static int __Pyx_ExportFunction(const char *name, void (*f)(void), const char *sig); /* PyIdentifierFromString.proto */ #if !defined(__Pyx_PyIdentifier_FromString) #if PY_MAJOR_VERSION < 3 #define __Pyx_PyIdentifier_FromString(s) PyString_FromString(s) #else #define __Pyx_PyIdentifier_FromString(s) PyUnicode_FromString(s) #endif #endif /* ModuleImport.proto */ static PyObject *__Pyx_ImportModule(const char *name); /* TypeImport.proto */ static PyTypeObject *__Pyx_ImportType(const char *module_name, const char *class_name, size_t size, int strict); /* FunctionImport.proto */ static int __Pyx_ImportFunction(PyObject *module, const char *funcname, void (**f)(void), const char *sig); /* InitStrings.proto */ static int __Pyx_InitStrings(__Pyx_StringTabEntry *t); /* Module declarations from 'libc.stdint' */ /* Module declarations from 'libc.string' */ /* Module declarations from 'libc.stdio' */ /* Module declarations from 'libc.stddef' */ /* Module declarations from 'sdl2' */ /* Module declarations from 'pygame_sdl2.surface' */ static PyTypeObject *__pyx_ptype_11pygame_sdl2_7surface_Surface = 0; /* Module declarations from 'pygame_sdl2.rect' */ static PyTypeObject *__pyx_ptype_11pygame_sdl2_4rect_Rect = 0; static int (*__pyx_f_11pygame_sdl2_4rect_to_sdl_rect)(PyObject *, SDL_Rect *, struct __pyx_opt_args_11pygame_sdl2_4rect_to_sdl_rect *__pyx_optional_args); /*proto*/ /* Module declarations from 'libc.stdlib' */ /* Module declarations from 'pygame_sdl2.display' */ static PyTypeObject *__pyx_ptype_11pygame_sdl2_7display_Window = 0; static struct __pyx_obj_11pygame_sdl2_7display_Window *__pyx_v_11pygame_sdl2_7display_main_window = 0; static SDL_Window *__pyx_f_11pygame_sdl2_7display_PyWindow_AsWindow(PyObject *); /*proto*/ #define __Pyx_MODULE_NAME "pygame_sdl2.display" extern int __pyx_module_is_main_pygame_sdl2__display; int __pyx_module_is_main_pygame_sdl2__display = 0; /* Implementation of 'pygame_sdl2.display' */ static PyObject *__pyx_builtin_object; static PyObject *__pyx_builtin_ImportError; static PyObject *__pyx_builtin_MemoryError; static PyObject *__pyx_builtin_range; static PyObject *__pyx_builtin_TypeError; static const char __pyx_k_0[] = "0"; static const char __pyx_k_i[] = "i"; static const char __pyx_k_t[] = "t"; static const char __pyx_k_dm[] = "dm"; static const char __pyx_k_hw[] = "hw"; static const char __pyx_k_os[] = "os"; static const char __pyx_k_rv[] = "rv"; static const char __pyx_k_wm[] = "wm"; static const char __pyx_k_doc[] = "__doc__"; static const char __pyx_k_ios[] = "ios"; static const char __pyx_k_pos[] = "pos"; static const char __pyx_k_red[] = "red"; static const char __pyx_k_Info[] = "Info"; static const char __pyx_k_blue[] = "blue"; static const char __pyx_k_copy[] = "copy"; static const char __pyx_k_dict[] = "__dict__"; static const char __pyx_k_flag[] = "flag"; static const char __pyx_k_flip[] = "flip"; static const char __pyx_k_hint[] = "hint"; static const char __pyx_k_init[] = "init"; static const char __pyx_k_main[] = "__main__"; static const char __pyx_k_mode[] = "mode"; static const char __pyx_k_name[] = "__name__"; static const char __pyx_k_path[] = "path"; static const char __pyx_k_quit[] = "quit"; static const char __pyx_k_rect[] = "rect"; static const char __pyx_k_repr[] = "__repr__"; static const char __pyx_k_self[] = "self"; static const char __pyx_k_size[] = "size"; static const char __pyx_k_test[] = "__test__"; static const char __pyx_k_depth[] = "depth"; static const char __pyx_k_error[] = "error"; static const char __pyx_k_event[] = "event"; static const char __pyx_k_flags[] = "flags"; static const char __pyx_k_green[] = "green"; static const char __pyx_k_index[] = "index"; static const char __pyx_k_masks[] = "masks"; static const char __pyx_k_range[] = "range"; static const char __pyx_k_title[] = "title"; static const char __pyx_k_utf_8[] = "utf-8"; static const char __pyx_k_value[] = "value"; static const char __pyx_k_Info_r[] = ""; static const char __pyx_k_driver[] = "driver"; static const char __pyx_k_encode[] = "encode"; static const char __pyx_k_format[] = "format"; static const char __pyx_k_import[] = "__import__"; static const char __pyx_k_init_2[] = "__init__"; static const char __pyx_k_losses[] = "losses"; static const char __pyx_k_module[] = "__module__"; static const char __pyx_k_object[] = "object"; static const char __pyx_k_opengl[] = "opengl"; static const char __pyx_k_reduce[] = "__reduce__"; static const char __pyx_k_resize[] = "resize"; static const char __pyx_k_shifts[] = "shifts"; static const char __pyx_k_update[] = "update"; static const char __pyx_k_bitsize[] = "bitsize"; static const char __pyx_k_blit_hw[] = "blit_hw"; static const char __pyx_k_blit_sw[] = "blit_sw"; static const char __pyx_k_default[] = "default"; static const char __pyx_k_destroy[] = "destroy"; static const char __pyx_k_display[] = "display"; static const char __pyx_k_environ[] = "environ"; static const char __pyx_k_iconify[] = "iconify"; static const char __pyx_k_mode_ok[] = "mode_ok"; static const char __pyx_k_prepare[] = "__prepare__"; static const char __pyx_k_surface[] = "surface"; static const char __pyx_k_SRCALPHA[] = "SRCALPHA"; static const char __pyx_k_bytesize[] = "bytesize"; static const char __pyx_k_get_hint[] = "_get_hint"; static const char __pyx_k_get_init[] = "get_init"; static const char __pyx_k_get_size[] = "get_size"; static const char __pyx_k_getstate[] = "__getstate__"; static const char __pyx_k_pyx_capi[] = "__pyx_capi__"; static const char __pyx_k_qualname[] = "__qualname__"; static const char __pyx_k_set_icon[] = "set_icon"; static const char __pyx_k_set_mode[] = "set_mode"; static const char __pyx_k_setstate[] = "__setstate__"; static const char __pyx_k_warnings[] = "warnings"; static const char __pyx_k_TypeError[] = "TypeError"; static const char __pyx_k_blit_hw_A[] = "blit_hw_A"; static const char __pyx_k_blit_sw_A[] = "blit_sw_A"; static const char __pyx_k_current_h[] = "current_h"; static const char __pyx_k_current_w[] = "current_w"; static const char __pyx_k_icontitle[] = "icontitle"; static const char __pyx_k_init_done[] = "init_done"; static const char __pyx_k_main_done[] = "main_done"; static const char __pyx_k_metaclass[] = "__metaclass__"; static const char __pyx_k_num_modes[] = "num_modes"; static const char __pyx_k_reduce_ex[] = "__reduce_ex__"; static const char __pyx_k_set_gamma[] = "set_gamma"; static const char __pyx_k_video_mem[] = "video_mem"; static const char __pyx_k_PYGAME_IOS[] = "PYGAME_IOS"; static const char __pyx_k_blit_hw_CC[] = "blit_hw_CC"; static const char __pyx_k_blit_sw_CC[] = "blit_sw_CC"; static const char __pyx_k_get_active[] = "get_active"; static const char __pyx_k_get_driver[] = "get_driver"; static const char __pyx_k_get_window[] = "get_window"; static const char __pyx_k_list_modes[] = "list_modes"; static const char __pyx_k_pyx_vtable[] = "__pyx_vtable__"; static const char __pyx_k_rectangles[] = "rectangles"; static const char __pyx_k_resolution[] = "resolution"; static const char __pyx_k_startswith[] = "startswith"; static const char __pyx_k_ImportError[] = "ImportError"; static const char __pyx_k_Info___init[] = "Info.__init__"; static const char __pyx_k_Info___repr[] = "Info.__repr__"; static const char __pyx_k_MemoryError[] = "MemoryError"; static const char __pyx_k_PYGAME_SDL2[] = "PYGAME_SDL2"; static const char __pyx_k_get_caption[] = "get_caption"; static const char __pyx_k_get_surface[] = "get_surface"; static const char __pyx_k_get_wm_info[] = "get_wm_info"; static const char __pyx_k_main_window[] = "main_window"; static const char __pyx_k_pygame_sdl2[] = "pygame_sdl2"; static const char __pyx_k_set_caption[] = "set_caption"; static const char __pyx_k_androidembed[] = "androidembed"; static const char __pyx_k_close_window[] = "close_window"; static const char __pyx_k_default_icon[] = "default_icon"; static const char __pyx_k_get_platform[] = "get_platform"; static const char __pyx_k_pygame_hints[] = "_pygame_hints"; static const char __pyx_k_refresh_rate[] = "refresh_rate"; static const char __pyx_k_default_title[] = "default_title"; static const char __pyx_k_pygame_window[] = "pygame window"; static const char __pyx_k_reduce_cython[] = "__reduce_cython__"; static const char __pyx_k_register_init[] = "register_init"; static const char __pyx_k_register_quit[] = "register_quit"; static const char __pyx_k_sdl_main_init[] = "sdl_main_init"; static const char __pyx_k_create_surface[] = "create_surface"; static const char __pyx_k_set_gamma_ramp[] = "set_gamma_ramp"; static const char __pyx_k_GL_SWAP_CONTROL[] = "GL_SWAP_CONTROL"; static const char __pyx_k_gl_load_library[] = "gl_load_library"; static const char __pyx_k_setstate_cython[] = "__setstate_cython__"; static const char __pyx_k_get_window_flags[] = "get_window_flags"; static const char __pyx_k_gl_get_attribute[] = "gl_get_attribute"; static const char __pyx_k_gl_set_attribute[] = "gl_set_attribute"; static const char __pyx_k_get_drawable_size[] = "get_drawable_size"; static const char __pyx_k_gl_unload_library[] = "gl_unload_library"; static const char __pyx_k_pygame_sdl2_error[] = "pygame_sdl2.error"; static const char __pyx_k_toggle_fullscreen[] = "toggle_fullscreen"; static const char __pyx_k_cline_in_traceback[] = "cline_in_traceback"; static const char __pyx_k_get_display_bounds[] = "get_display_bounds"; static const char __pyx_k_pygame_sdl2_locals[] = "pygame_sdl2.locals"; static const char __pyx_k_shown_first_window[] = "_shown_first_window"; static const char __pyx_k_before_first_window[] = "_before_first_window"; static const char __pyx_k_gl_reset_attributes[] = "gl_reset_attributes"; static const char __pyx_k_pygame_sdl2_display[] = "pygame_sdl2.display"; static const char __pyx_k_PYGAME_SDL2_AVOID_GL[] = "PYGAME_SDL2_AVOID_GL"; static const char __pyx_k_default_swap_control[] = "default_swap_control"; static const char __pyx_k_proxy_window_surface[] = "proxy_window_surface"; static const char __pyx_k_get_num_video_displays[] = "get_num_video_displays"; static const char __pyx_k_src_pygame_sdl2_display_pyx[] = "src/pygame_sdl2/display.pyx"; static const char __pyx_k_Couldn_t_allocate_rectangles[] = "Couldn't allocate rectangles."; static const char __pyx_k_SDL_VIDEO_MAC_FULLSCREEN_SPACES[] = "SDL_VIDEO_MAC_FULLSCREEN_SPACES"; static const char __pyx_k_self_gl_context_self_window_self[] = "self.gl_context,self.window,self.window_surface cannot be converted to a Python object for pickling"; static PyObject *__pyx_kp_s_0; static PyObject *__pyx_kp_s_Couldn_t_allocate_rectangles; static PyObject *__pyx_n_s_GL_SWAP_CONTROL; static PyObject *__pyx_n_s_ImportError; static PyObject *__pyx_n_s_Info; static PyObject *__pyx_n_s_Info___init; static PyObject *__pyx_n_s_Info___repr; static PyObject *__pyx_kp_s_Info_r; static PyObject *__pyx_n_s_MemoryError; static PyObject *__pyx_n_s_PYGAME_IOS; static PyObject *__pyx_n_s_PYGAME_SDL2; static PyObject *__pyx_n_s_PYGAME_SDL2_AVOID_GL; static PyObject *__pyx_n_s_SDL_VIDEO_MAC_FULLSCREEN_SPACES; static PyObject *__pyx_n_s_SRCALPHA; static PyObject *__pyx_n_s_TypeError; static PyObject *__pyx_n_s_androidembed; static PyObject *__pyx_n_s_before_first_window; static PyObject *__pyx_n_s_bitsize; static PyObject *__pyx_n_s_blit_hw; static PyObject *__pyx_n_s_blit_hw_A; static PyObject *__pyx_n_s_blit_hw_CC; static PyObject *__pyx_n_s_blit_sw; static PyObject *__pyx_n_s_blit_sw_A; static PyObject *__pyx_n_s_blit_sw_CC; static PyObject *__pyx_n_s_blue; static PyObject *__pyx_n_s_bytesize; static PyObject *__pyx_n_s_cline_in_traceback; static PyObject *__pyx_n_s_close_window; static PyObject *__pyx_n_s_copy; static PyObject *__pyx_n_s_create_surface; static PyObject *__pyx_n_s_current_h; static PyObject *__pyx_n_s_current_w; static PyObject *__pyx_n_s_default; static PyObject *__pyx_n_s_default_icon; static PyObject *__pyx_n_s_default_swap_control; static PyObject *__pyx_n_s_default_title; static PyObject *__pyx_n_s_depth; static PyObject *__pyx_n_s_destroy; static PyObject *__pyx_n_s_dict; static PyObject *__pyx_n_s_display; static PyObject *__pyx_n_s_dm; static PyObject *__pyx_n_s_doc; static PyObject *__pyx_n_s_driver; static PyObject *__pyx_n_s_encode; static PyObject *__pyx_n_s_environ; static PyObject *__pyx_n_s_error; static PyObject *__pyx_n_s_event; static PyObject *__pyx_n_s_flag; static PyObject *__pyx_n_s_flags; static PyObject *__pyx_n_s_flip; static PyObject *__pyx_n_s_format; static PyObject *__pyx_n_s_get_active; static PyObject *__pyx_n_s_get_caption; static PyObject *__pyx_n_s_get_display_bounds; static PyObject *__pyx_n_s_get_drawable_size; static PyObject *__pyx_n_s_get_driver; static PyObject *__pyx_n_s_get_hint; static PyObject *__pyx_n_s_get_init; static PyObject *__pyx_n_s_get_num_video_displays; static PyObject *__pyx_n_s_get_platform; static PyObject *__pyx_n_s_get_size; static PyObject *__pyx_n_s_get_surface; static PyObject *__pyx_n_s_get_window; static PyObject *__pyx_n_s_get_window_flags; static PyObject *__pyx_n_s_get_wm_info; static PyObject *__pyx_n_s_getstate; static PyObject *__pyx_n_s_gl_get_attribute; static PyObject *__pyx_n_s_gl_load_library; static PyObject *__pyx_n_s_gl_reset_attributes; static PyObject *__pyx_n_s_gl_set_attribute; static PyObject *__pyx_n_s_gl_unload_library; static PyObject *__pyx_n_s_green; static PyObject *__pyx_n_s_hint; static PyObject *__pyx_n_s_hw; static PyObject *__pyx_n_s_i; static PyObject *__pyx_n_s_iconify; static PyObject *__pyx_n_s_icontitle; static PyObject *__pyx_n_s_import; static PyObject *__pyx_n_s_index; static PyObject *__pyx_n_s_init; static PyObject *__pyx_n_s_init_2; static PyObject *__pyx_n_s_init_done; static PyObject *__pyx_n_s_ios; static PyObject *__pyx_n_s_list_modes; static PyObject *__pyx_n_s_losses; static PyObject *__pyx_n_s_main; static PyObject *__pyx_n_s_main_done; static PyObject *__pyx_n_s_main_window; static PyObject *__pyx_n_s_masks; static PyObject *__pyx_n_s_metaclass; static PyObject *__pyx_n_s_mode; static PyObject *__pyx_n_s_mode_ok; static PyObject *__pyx_n_s_module; static PyObject *__pyx_n_s_name; static PyObject *__pyx_n_s_num_modes; static PyObject *__pyx_n_s_object; static PyObject *__pyx_n_s_opengl; static PyObject *__pyx_n_s_os; static PyObject *__pyx_n_s_path; static PyObject *__pyx_n_s_pos; static PyObject *__pyx_n_s_prepare; static PyObject *__pyx_n_s_proxy_window_surface; static PyObject *__pyx_n_s_pygame_hints; static PyObject *__pyx_n_s_pygame_sdl2; static PyObject *__pyx_n_s_pygame_sdl2_display; static PyObject *__pyx_n_s_pygame_sdl2_error; static PyObject *__pyx_n_s_pygame_sdl2_locals; static PyObject *__pyx_kp_s_pygame_window; static PyObject *__pyx_n_s_pyx_capi; static PyObject *__pyx_n_s_pyx_vtable; static PyObject *__pyx_n_s_qualname; static PyObject *__pyx_n_s_quit; static PyObject *__pyx_n_s_range; static PyObject *__pyx_n_s_rect; static PyObject *__pyx_n_s_rectangles; static PyObject *__pyx_n_s_red; static PyObject *__pyx_n_s_reduce; static PyObject *__pyx_n_s_reduce_cython; static PyObject *__pyx_n_s_reduce_ex; static PyObject *__pyx_n_s_refresh_rate; static PyObject *__pyx_n_s_register_init; static PyObject *__pyx_n_s_register_quit; static PyObject *__pyx_n_s_repr; static PyObject *__pyx_n_s_resize; static PyObject *__pyx_n_s_resolution; static PyObject *__pyx_n_s_rv; static PyObject *__pyx_n_s_sdl_main_init; static PyObject *__pyx_n_s_self; static PyObject *__pyx_kp_s_self_gl_context_self_window_self; static PyObject *__pyx_n_s_set_caption; static PyObject *__pyx_n_s_set_gamma; static PyObject *__pyx_n_s_set_gamma_ramp; static PyObject *__pyx_n_s_set_icon; static PyObject *__pyx_n_s_set_mode; static PyObject *__pyx_n_s_setstate; static PyObject *__pyx_n_s_setstate_cython; static PyObject *__pyx_n_s_shifts; static PyObject *__pyx_n_s_shown_first_window; static PyObject *__pyx_n_s_size; static PyObject *__pyx_kp_s_src_pygame_sdl2_display_pyx; static PyObject *__pyx_n_s_startswith; static PyObject *__pyx_n_s_surface; static PyObject *__pyx_n_s_t; static PyObject *__pyx_n_s_test; static PyObject *__pyx_n_s_title; static PyObject *__pyx_n_s_toggle_fullscreen; static PyObject *__pyx_n_s_update; static PyObject *__pyx_kp_s_utf_8; static PyObject *__pyx_n_s_value; static PyObject *__pyx_n_s_video_mem; static PyObject *__pyx_n_s_warnings; static PyObject *__pyx_n_s_wm; static PyObject *__pyx_pf_11pygame_sdl2_7display_hint(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_hint, PyObject *__pyx_v_value); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_7display_2_get_hint(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_hint, PyObject *__pyx_v_default); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_7display_4sdl_main_init(CYTHON_UNUSED PyObject *__pyx_self); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_7display_6init(CYTHON_UNUSED PyObject *__pyx_self); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_7display_8quit(CYTHON_UNUSED PyObject *__pyx_self); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_7display_10get_init(CYTHON_UNUSED PyObject *__pyx_self); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_7display_12_before_first_window(CYTHON_UNUSED PyObject *__pyx_self); /* proto */ static int __pyx_pf_11pygame_sdl2_7display_6Window___init__(struct __pyx_obj_11pygame_sdl2_7display_Window *__pyx_v_self, PyObject *__pyx_v_title, PyObject *__pyx_v_resolution, PyObject *__pyx_v_flags, CYTHON_UNUSED PyObject *__pyx_v_depth, PyObject *__pyx_v_pos); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_7display_6Window_2create_surface(struct __pyx_obj_11pygame_sdl2_7display_Window *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_7display_6Window_4destroy(struct __pyx_obj_11pygame_sdl2_7display_Window *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_7display_6Window_6resize(struct __pyx_obj_11pygame_sdl2_7display_Window *__pyx_v_self, PyObject *__pyx_v_size, PyObject *__pyx_v_opengl); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_7display_6Window_8get_window_flags(struct __pyx_obj_11pygame_sdl2_7display_Window *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_7display_6Window_10proxy_window_surface(struct __pyx_obj_11pygame_sdl2_7display_Window *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_7display_6Window_12flip(struct __pyx_obj_11pygame_sdl2_7display_Window *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_7display_6Window_14get_surface(struct __pyx_obj_11pygame_sdl2_7display_Window *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_7display_6Window_16update(struct __pyx_obj_11pygame_sdl2_7display_Window *__pyx_v_self, PyObject *__pyx_v_rectangles); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_7display_6Window_18get_wm_info(CYTHON_UNUSED struct __pyx_obj_11pygame_sdl2_7display_Window *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_7display_6Window_20get_active(struct __pyx_obj_11pygame_sdl2_7display_Window *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_7display_6Window_22iconify(struct __pyx_obj_11pygame_sdl2_7display_Window *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_7display_6Window_24toggle_fullscreen(struct __pyx_obj_11pygame_sdl2_7display_Window *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_7display_6Window_26set_gamma(struct __pyx_obj_11pygame_sdl2_7display_Window *__pyx_v_self, PyObject *__pyx_v_red, PyObject *__pyx_v_green, PyObject *__pyx_v_blue); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_7display_6Window_28set_gamma_ramp(struct __pyx_obj_11pygame_sdl2_7display_Window *__pyx_v_self, PyObject *__pyx_v_red, PyObject *__pyx_v_green, PyObject *__pyx_v_blue); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_7display_6Window_30set_icon(struct __pyx_obj_11pygame_sdl2_7display_Window *__pyx_v_self, struct __pyx_obj_11pygame_sdl2_7surface_Surface *__pyx_v_surface); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_7display_6Window_32set_caption(struct __pyx_obj_11pygame_sdl2_7display_Window *__pyx_v_self, PyObject *__pyx_v_title); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_7display_6Window_34get_drawable_size(struct __pyx_obj_11pygame_sdl2_7display_Window *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_7display_6Window_7surface___get__(struct __pyx_obj_11pygame_sdl2_7display_Window *__pyx_v_self); /* proto */ static int __pyx_pf_11pygame_sdl2_7display_6Window_7surface_2__set__(struct __pyx_obj_11pygame_sdl2_7display_Window *__pyx_v_self, PyObject *__pyx_v_value); /* proto */ static int __pyx_pf_11pygame_sdl2_7display_6Window_7surface_4__del__(struct __pyx_obj_11pygame_sdl2_7display_Window *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_7display_6Window_36__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_11pygame_sdl2_7display_Window *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_7display_6Window_38__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_11pygame_sdl2_7display_Window *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_7display_14set_mode(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_resolution, PyObject *__pyx_v_flags, PyObject *__pyx_v_depth, PyObject *__pyx_v_pos); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_7display_16get_surface(CYTHON_UNUSED PyObject *__pyx_self); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_7display_18get_window(CYTHON_UNUSED PyObject *__pyx_self); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_7display_20flip(CYTHON_UNUSED PyObject *__pyx_self); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_7display_22update(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_rectangles); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_7display_24get_driver(CYTHON_UNUSED PyObject *__pyx_self); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_7display_4Info___init__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_7display_4Info_2__repr__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_7display_26get_wm_info(CYTHON_UNUSED PyObject *__pyx_self); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_7display_28get_num_video_displays(CYTHON_UNUSED PyObject *__pyx_self); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_7display_30list_modes(CYTHON_UNUSED PyObject *__pyx_self, CYTHON_UNUSED PyObject *__pyx_v_depth, CYTHON_UNUSED PyObject *__pyx_v_flags, PyObject *__pyx_v_display); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_7display_32mode_ok(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_size, CYTHON_UNUSED PyObject *__pyx_v_flags, CYTHON_UNUSED PyObject *__pyx_v_depth); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_7display_34gl_reset_attributes(CYTHON_UNUSED PyObject *__pyx_self); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_7display_36gl_set_attribute(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_flag, PyObject *__pyx_v_value); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_7display_38gl_get_attribute(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_flag); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_7display_40gl_load_library(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_path); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_7display_42gl_unload_library(CYTHON_UNUSED PyObject *__pyx_self); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_7display_44get_active(CYTHON_UNUSED PyObject *__pyx_self); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_7display_46iconify(CYTHON_UNUSED PyObject *__pyx_self); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_7display_48toggle_fullscreen(CYTHON_UNUSED PyObject *__pyx_self); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_7display_50set_gamma(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_red, PyObject *__pyx_v_green, PyObject *__pyx_v_blue); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_7display_52set_gamma_ramp(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_red, PyObject *__pyx_v_green, PyObject *__pyx_v_blue); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_7display_54set_icon(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_surface); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_7display_56set_caption(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_title, CYTHON_UNUSED PyObject *__pyx_v_icontitle); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_7display_58get_caption(CYTHON_UNUSED PyObject *__pyx_self); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_7display_60get_drawable_size(CYTHON_UNUSED PyObject *__pyx_self); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_7display_62get_num_video_displays(CYTHON_UNUSED PyObject *__pyx_self); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_7display_64get_display_bounds(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_index); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_7display_66get_platform(CYTHON_UNUSED PyObject *__pyx_self); /* proto */ static PyObject *__pyx_tp_new_11pygame_sdl2_7display_Window(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ static PyObject *__pyx_int_0; static PyObject *__pyx_int_1; static PyObject *__pyx_int_32; static PyObject *__pyx_int_268435456; static PyObject *__pyx_k__6; static PyObject *__pyx_k__15; static PyObject *__pyx_tuple_; static PyObject *__pyx_tuple__2; static PyObject *__pyx_tuple__3; static PyObject *__pyx_tuple__4; static PyObject *__pyx_tuple__5; static PyObject *__pyx_tuple__7; static PyObject *__pyx_tuple__8; static PyObject *__pyx_tuple__9; static PyObject *__pyx_tuple__10; static PyObject *__pyx_tuple__11; static PyObject *__pyx_tuple__12; static PyObject *__pyx_tuple__13; static PyObject *__pyx_tuple__14; static PyObject *__pyx_tuple__16; static PyObject *__pyx_tuple__18; static PyObject *__pyx_tuple__24; static PyObject *__pyx_tuple__26; static PyObject *__pyx_tuple__31; static PyObject *__pyx_tuple__33; static PyObject *__pyx_tuple__35; static PyObject *__pyx_tuple__36; static PyObject *__pyx_tuple__38; static PyObject *__pyx_tuple__41; static PyObject *__pyx_tuple__43; static PyObject *__pyx_tuple__45; static PyObject *__pyx_tuple__48; static PyObject *__pyx_tuple__50; static PyObject *__pyx_tuple__52; static PyObject *__pyx_tuple__58; static PyObject *__pyx_tuple__60; static PyObject *__pyx_tuple__62; static PyObject *__pyx_tuple__64; static PyObject *__pyx_tuple__68; static PyObject *__pyx_tuple__70; static PyObject *__pyx_codeobj__17; static PyObject *__pyx_codeobj__19; static PyObject *__pyx_codeobj__20; static PyObject *__pyx_codeobj__21; static PyObject *__pyx_codeobj__22; static PyObject *__pyx_codeobj__23; static PyObject *__pyx_codeobj__25; static PyObject *__pyx_codeobj__27; static PyObject *__pyx_codeobj__28; static PyObject *__pyx_codeobj__29; static PyObject *__pyx_codeobj__30; static PyObject *__pyx_codeobj__32; static PyObject *__pyx_codeobj__34; static PyObject *__pyx_codeobj__37; static PyObject *__pyx_codeobj__39; static PyObject *__pyx_codeobj__40; static PyObject *__pyx_codeobj__42; static PyObject *__pyx_codeobj__44; static PyObject *__pyx_codeobj__46; static PyObject *__pyx_codeobj__47; static PyObject *__pyx_codeobj__49; static PyObject *__pyx_codeobj__51; static PyObject *__pyx_codeobj__53; static PyObject *__pyx_codeobj__54; static PyObject *__pyx_codeobj__55; static PyObject *__pyx_codeobj__56; static PyObject *__pyx_codeobj__57; static PyObject *__pyx_codeobj__59; static PyObject *__pyx_codeobj__61; static PyObject *__pyx_codeobj__63; static PyObject *__pyx_codeobj__65; static PyObject *__pyx_codeobj__66; static PyObject *__pyx_codeobj__67; static PyObject *__pyx_codeobj__69; static PyObject *__pyx_codeobj__71; static PyObject *__pyx_codeobj__72; /* "pygame_sdl2/display.pyx":40 * _pygame_hints = { } * * def hint(hint, value): # <<<<<<<<<<<<<< * * if str(hint).startswith("PYGAME_SDL2"): */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_7display_1hint(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static PyMethodDef __pyx_mdef_11pygame_sdl2_7display_1hint = {"hint", (PyCFunction)__pyx_pw_11pygame_sdl2_7display_1hint, METH_VARARGS|METH_KEYWORDS, 0}; static PyObject *__pyx_pw_11pygame_sdl2_7display_1hint(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_hint = 0; PyObject *__pyx_v_value = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("hint (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_hint,&__pyx_n_s_value,0}; PyObject* values[2] = {0,0}; if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_hint)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_value)) != 0)) kw_args--; else { __Pyx_RaiseArgtupleInvalid("hint", 1, 2, 2, 1); __PYX_ERR(0, 40, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "hint") < 0)) __PYX_ERR(0, 40, __pyx_L3_error) } } else if (PyTuple_GET_SIZE(__pyx_args) != 2) { goto __pyx_L5_argtuple_error; } else { values[0] = PyTuple_GET_ITEM(__pyx_args, 0); values[1] = PyTuple_GET_ITEM(__pyx_args, 1); } __pyx_v_hint = values[0]; __pyx_v_value = values[1]; } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("hint", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 40, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("pygame_sdl2.display.hint", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_11pygame_sdl2_7display_hint(__pyx_self, __pyx_v_hint, __pyx_v_value); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_7display_hint(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_hint, PyObject *__pyx_v_value) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; int __pyx_t_3; PyObject *__pyx_t_4 = NULL; PyObject *__pyx_t_5 = NULL; int __pyx_t_6; char const *__pyx_t_7; char const *__pyx_t_8; __Pyx_RefNannySetupContext("hint", 0); __Pyx_INCREF(__pyx_v_hint); __Pyx_INCREF(__pyx_v_value); /* "pygame_sdl2/display.pyx":42 * def hint(hint, value): * * if str(hint).startswith("PYGAME_SDL2"): # <<<<<<<<<<<<<< * _pygame_hints[str(hint)] = str(value) * return */ __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 42, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_INCREF(__pyx_v_hint); __Pyx_GIVEREF(__pyx_v_hint); PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_hint); __pyx_t_2 = __Pyx_PyObject_Call(((PyObject *)(&PyString_Type)), __pyx_t_1, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 42, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_startswith); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 42, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_tuple_, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 42, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(0, 42, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; if (__pyx_t_3) { /* "pygame_sdl2/display.pyx":43 * * if str(hint).startswith("PYGAME_SDL2"): * _pygame_hints[str(hint)] = str(value) # <<<<<<<<<<<<<< * return * */ __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 43, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_INCREF(__pyx_v_value); __Pyx_GIVEREF(__pyx_v_value); PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_value); __pyx_t_1 = __Pyx_PyObject_Call(((PyObject *)(&PyString_Type)), __pyx_t_2, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 43, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_pygame_hints); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 43, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 43, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_INCREF(__pyx_v_hint); __Pyx_GIVEREF(__pyx_v_hint); PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_v_hint); __pyx_t_5 = __Pyx_PyObject_Call(((PyObject *)(&PyString_Type)), __pyx_t_4, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 43, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; if (unlikely(PyObject_SetItem(__pyx_t_2, __pyx_t_5, __pyx_t_1) < 0)) __PYX_ERR(0, 43, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "pygame_sdl2/display.pyx":44 * if str(hint).startswith("PYGAME_SDL2"): * _pygame_hints[str(hint)] = str(value) * return # <<<<<<<<<<<<<< * * */ __Pyx_XDECREF(__pyx_r); __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; /* "pygame_sdl2/display.pyx":42 * def hint(hint, value): * * if str(hint).startswith("PYGAME_SDL2"): # <<<<<<<<<<<<<< * _pygame_hints[str(hint)] = str(value) * return */ } /* "pygame_sdl2/display.pyx":47 * * * if not isinstance(hint, bytes): # <<<<<<<<<<<<<< * hint = hint.encode("utf-8") * */ __pyx_t_3 = PyBytes_Check(__pyx_v_hint); __pyx_t_6 = ((!(__pyx_t_3 != 0)) != 0); if (__pyx_t_6) { /* "pygame_sdl2/display.pyx":48 * * if not isinstance(hint, bytes): * hint = hint.encode("utf-8") # <<<<<<<<<<<<<< * * if not isinstance(value, bytes): */ __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_hint, __pyx_n_s_encode); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 48, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_tuple__2, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 48, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF_SET(__pyx_v_hint, __pyx_t_5); __pyx_t_5 = 0; /* "pygame_sdl2/display.pyx":47 * * * if not isinstance(hint, bytes): # <<<<<<<<<<<<<< * hint = hint.encode("utf-8") * */ } /* "pygame_sdl2/display.pyx":50 * hint = hint.encode("utf-8") * * if not isinstance(value, bytes): # <<<<<<<<<<<<<< * value = value.encode("utf-8") * */ __pyx_t_6 = PyBytes_Check(__pyx_v_value); __pyx_t_3 = ((!(__pyx_t_6 != 0)) != 0); if (__pyx_t_3) { /* "pygame_sdl2/display.pyx":51 * * if not isinstance(value, bytes): * value = value.encode("utf-8") # <<<<<<<<<<<<<< * * SDL_SetHint(hint, value) */ __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_value, __pyx_n_s_encode); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 51, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_tuple__3, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 51, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF_SET(__pyx_v_value, __pyx_t_1); __pyx_t_1 = 0; /* "pygame_sdl2/display.pyx":50 * hint = hint.encode("utf-8") * * if not isinstance(value, bytes): # <<<<<<<<<<<<<< * value = value.encode("utf-8") * */ } /* "pygame_sdl2/display.pyx":53 * value = value.encode("utf-8") * * SDL_SetHint(hint, value) # <<<<<<<<<<<<<< * * def _get_hint(hint, default): */ __pyx_t_7 = __Pyx_PyObject_AsString(__pyx_v_hint); if (unlikely((!__pyx_t_7) && PyErr_Occurred())) __PYX_ERR(0, 53, __pyx_L1_error) __pyx_t_8 = __Pyx_PyObject_AsString(__pyx_v_value); if (unlikely((!__pyx_t_8) && PyErr_Occurred())) __PYX_ERR(0, 53, __pyx_L1_error) SDL_SetHint(__pyx_t_7, __pyx_t_8); /* "pygame_sdl2/display.pyx":40 * _pygame_hints = { } * * def hint(hint, value): # <<<<<<<<<<<<<< * * if str(hint).startswith("PYGAME_SDL2"): */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_5); __Pyx_AddTraceback("pygame_sdl2.display.hint", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF(__pyx_v_hint); __Pyx_XDECREF(__pyx_v_value); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/display.pyx":55 * SDL_SetHint(hint, value) * * def _get_hint(hint, default): # <<<<<<<<<<<<<< * hint = str(hint) * */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_7display_3_get_hint(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static PyMethodDef __pyx_mdef_11pygame_sdl2_7display_3_get_hint = {"_get_hint", (PyCFunction)__pyx_pw_11pygame_sdl2_7display_3_get_hint, METH_VARARGS|METH_KEYWORDS, 0}; static PyObject *__pyx_pw_11pygame_sdl2_7display_3_get_hint(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_hint = 0; PyObject *__pyx_v_default = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("_get_hint (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_hint,&__pyx_n_s_default,0}; PyObject* values[2] = {0,0}; if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_hint)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_default)) != 0)) kw_args--; else { __Pyx_RaiseArgtupleInvalid("_get_hint", 1, 2, 2, 1); __PYX_ERR(0, 55, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "_get_hint") < 0)) __PYX_ERR(0, 55, __pyx_L3_error) } } else if (PyTuple_GET_SIZE(__pyx_args) != 2) { goto __pyx_L5_argtuple_error; } else { values[0] = PyTuple_GET_ITEM(__pyx_args, 0); values[1] = PyTuple_GET_ITEM(__pyx_args, 1); } __pyx_v_hint = values[0]; __pyx_v_default = values[1]; } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("_get_hint", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 55, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("pygame_sdl2.display._get_hint", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_11pygame_sdl2_7display_2_get_hint(__pyx_self, __pyx_v_hint, __pyx_v_default); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_7display_2_get_hint(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_hint, PyObject *__pyx_v_default) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; int __pyx_t_3; int __pyx_t_4; __Pyx_RefNannySetupContext("_get_hint", 0); __Pyx_INCREF(__pyx_v_hint); /* "pygame_sdl2/display.pyx":56 * * def _get_hint(hint, default): * hint = str(hint) # <<<<<<<<<<<<<< * * if hint in _pygame_hints: */ __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 56, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_INCREF(__pyx_v_hint); __Pyx_GIVEREF(__pyx_v_hint); PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_hint); __pyx_t_2 = __Pyx_PyObject_Call(((PyObject *)(&PyString_Type)), __pyx_t_1, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 56, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF_SET(__pyx_v_hint, __pyx_t_2); __pyx_t_2 = 0; /* "pygame_sdl2/display.pyx":58 * hint = str(hint) * * if hint in _pygame_hints: # <<<<<<<<<<<<<< * return _pygame_hints[hint] * */ __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_pygame_hints); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 58, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = (__Pyx_PySequence_ContainsTF(__pyx_v_hint, __pyx_t_2, Py_EQ)); if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(0, 58, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_4 = (__pyx_t_3 != 0); if (__pyx_t_4) { /* "pygame_sdl2/display.pyx":59 * * if hint in _pygame_hints: * return _pygame_hints[hint] # <<<<<<<<<<<<<< * * if hint in os.environ: */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_pygame_hints); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 59, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_1 = PyObject_GetItem(__pyx_t_2, __pyx_v_hint); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 59, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "pygame_sdl2/display.pyx":58 * hint = str(hint) * * if hint in _pygame_hints: # <<<<<<<<<<<<<< * return _pygame_hints[hint] * */ } /* "pygame_sdl2/display.pyx":61 * return _pygame_hints[hint] * * if hint in os.environ: # <<<<<<<<<<<<<< * return os.environ[hint] * */ __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_os); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 61, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_environ); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 61, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_4 = (__Pyx_PySequence_ContainsTF(__pyx_v_hint, __pyx_t_2, Py_EQ)); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(0, 61, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_3 = (__pyx_t_4 != 0); if (__pyx_t_3) { /* "pygame_sdl2/display.pyx":62 * * if hint in os.environ: * return os.environ[hint] # <<<<<<<<<<<<<< * * return default */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_os); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 62, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_environ); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 62, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_2 = PyObject_GetItem(__pyx_t_1, __pyx_v_hint); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 62, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; /* "pygame_sdl2/display.pyx":61 * return _pygame_hints[hint] * * if hint in os.environ: # <<<<<<<<<<<<<< * return os.environ[hint] * */ } /* "pygame_sdl2/display.pyx":64 * return os.environ[hint] * * return default # <<<<<<<<<<<<<< * * */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(__pyx_v_default); __pyx_r = __pyx_v_default; goto __pyx_L0; /* "pygame_sdl2/display.pyx":55 * SDL_SetHint(hint, value) * * def _get_hint(hint, default): # <<<<<<<<<<<<<< * hint = str(hint) * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_AddTraceback("pygame_sdl2.display._get_hint", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF(__pyx_v_hint); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/display.pyx":69 * main_done = False * * def sdl_main_init(): # <<<<<<<<<<<<<< * global main_done * */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_7display_5sdl_main_init(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused); /*proto*/ static PyMethodDef __pyx_mdef_11pygame_sdl2_7display_5sdl_main_init = {"sdl_main_init", (PyCFunction)__pyx_pw_11pygame_sdl2_7display_5sdl_main_init, METH_NOARGS, 0}; static PyObject *__pyx_pw_11pygame_sdl2_7display_5sdl_main_init(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("sdl_main_init (wrapper)", 0); __pyx_r = __pyx_pf_11pygame_sdl2_7display_4sdl_main_init(__pyx_self); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_7display_4sdl_main_init(CYTHON_UNUSED PyObject *__pyx_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_t_2; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; __Pyx_RefNannySetupContext("sdl_main_init", 0); /* "pygame_sdl2/display.pyx":72 * global main_done * * if main_done: # <<<<<<<<<<<<<< * return * */ __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_main_done); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 72, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 72, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (__pyx_t_2) { /* "pygame_sdl2/display.pyx":73 * * if main_done: * return # <<<<<<<<<<<<<< * * SDL_SetMainReady() */ __Pyx_XDECREF(__pyx_r); __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; /* "pygame_sdl2/display.pyx":72 * global main_done * * if main_done: # <<<<<<<<<<<<<< * return * */ } /* "pygame_sdl2/display.pyx":75 * return * * SDL_SetMainReady() # <<<<<<<<<<<<<< * * if SDL_Init(0): */ SDL_SetMainReady(); /* "pygame_sdl2/display.pyx":77 * SDL_SetMainReady() * * if SDL_Init(0): # <<<<<<<<<<<<<< * raise error() * */ __pyx_t_2 = (SDL_Init(0) != 0); if (__pyx_t_2) { /* "pygame_sdl2/display.pyx":78 * * if SDL_Init(0): * raise error() # <<<<<<<<<<<<<< * * main_done = True */ __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_error); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 78, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = NULL; if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) { __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3); if (likely(__pyx_t_4)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); __Pyx_INCREF(__pyx_t_4); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_3, function); } } if (__pyx_t_4) { __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 78, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; } else { __pyx_t_1 = __Pyx_PyObject_CallNoArg(__pyx_t_3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 78, __pyx_L1_error) } __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_Raise(__pyx_t_1, 0, 0, 0); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __PYX_ERR(0, 78, __pyx_L1_error) /* "pygame_sdl2/display.pyx":77 * SDL_SetMainReady() * * if SDL_Init(0): # <<<<<<<<<<<<<< * raise error() * */ } /* "pygame_sdl2/display.pyx":80 * raise error() * * main_done = True # <<<<<<<<<<<<<< * * # True if init has been called without quit being called. */ if (PyDict_SetItem(__pyx_d, __pyx_n_s_main_done, Py_True) < 0) __PYX_ERR(0, 80, __pyx_L1_error) /* "pygame_sdl2/display.pyx":69 * main_done = False * * def sdl_main_init(): # <<<<<<<<<<<<<< * global main_done * */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_AddTraceback("pygame_sdl2.display.sdl_main_init", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/display.pyx":86 * * @pygame_sdl2.register_init * def init(): # <<<<<<<<<<<<<< * * if init_done: */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_7display_7init(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused); /*proto*/ static PyMethodDef __pyx_mdef_11pygame_sdl2_7display_7init = {"init", (PyCFunction)__pyx_pw_11pygame_sdl2_7display_7init, METH_NOARGS, 0}; static PyObject *__pyx_pw_11pygame_sdl2_7display_7init(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("init (wrapper)", 0); __pyx_r = __pyx_pf_11pygame_sdl2_7display_6init(__pyx_self); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_7display_6init(CYTHON_UNUSED PyObject *__pyx_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_t_2; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; __Pyx_RefNannySetupContext("init", 0); /* "pygame_sdl2/display.pyx":88 * def init(): * * if init_done: # <<<<<<<<<<<<<< * return * */ __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_init_done); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 88, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 88, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (__pyx_t_2) { /* "pygame_sdl2/display.pyx":89 * * if init_done: * return # <<<<<<<<<<<<<< * * sdl_main_init() */ __Pyx_XDECREF(__pyx_r); __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; /* "pygame_sdl2/display.pyx":88 * def init(): * * if init_done: # <<<<<<<<<<<<<< * return * */ } /* "pygame_sdl2/display.pyx":91 * return * * sdl_main_init() # <<<<<<<<<<<<<< * * hint("SDL_VIDEO_MAC_FULLSCREEN_SPACES", "0") */ __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_sdl_main_init); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 91, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = NULL; if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) { __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3); if (likely(__pyx_t_4)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); __Pyx_INCREF(__pyx_t_4); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_3, function); } } if (__pyx_t_4) { __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 91, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; } else { __pyx_t_1 = __Pyx_PyObject_CallNoArg(__pyx_t_3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 91, __pyx_L1_error) } __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "pygame_sdl2/display.pyx":93 * sdl_main_init() * * hint("SDL_VIDEO_MAC_FULLSCREEN_SPACES", "0") # <<<<<<<<<<<<<< * * if SDL_InitSubSystem(SDL_INIT_VIDEO): */ __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_hint); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 93, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_tuple__4, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 93, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "pygame_sdl2/display.pyx":95 * hint("SDL_VIDEO_MAC_FULLSCREEN_SPACES", "0") * * if SDL_InitSubSystem(SDL_INIT_VIDEO): # <<<<<<<<<<<<<< * raise error() * */ __pyx_t_2 = (SDL_InitSubSystem(SDL_INIT_VIDEO) != 0); if (__pyx_t_2) { /* "pygame_sdl2/display.pyx":96 * * if SDL_InitSubSystem(SDL_INIT_VIDEO): * raise error() # <<<<<<<<<<<<<< * * pygame_sdl2.event.init() */ __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_error); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 96, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_4 = NULL; if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_1))) { __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_1); if (likely(__pyx_t_4)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1); __Pyx_INCREF(__pyx_t_4); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_1, function); } } if (__pyx_t_4) { __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_t_1, __pyx_t_4); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 96, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; } else { __pyx_t_3 = __Pyx_PyObject_CallNoArg(__pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 96, __pyx_L1_error) } __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_Raise(__pyx_t_3, 0, 0, 0); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __PYX_ERR(0, 96, __pyx_L1_error) /* "pygame_sdl2/display.pyx":95 * hint("SDL_VIDEO_MAC_FULLSCREEN_SPACES", "0") * * if SDL_InitSubSystem(SDL_INIT_VIDEO): # <<<<<<<<<<<<<< * raise error() * */ } /* "pygame_sdl2/display.pyx":98 * raise error() * * pygame_sdl2.event.init() # <<<<<<<<<<<<<< * * global init_done */ __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_pygame_sdl2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 98, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_event); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 98, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_init); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 98, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_t_4 = NULL; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_1))) { __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_1); if (likely(__pyx_t_4)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1); __Pyx_INCREF(__pyx_t_4); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_1, function); } } if (__pyx_t_4) { __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_t_1, __pyx_t_4); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 98, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; } else { __pyx_t_3 = __Pyx_PyObject_CallNoArg(__pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 98, __pyx_L1_error) } __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "pygame_sdl2/display.pyx":101 * * global init_done * init_done = True # <<<<<<<<<<<<<< * * */ if (PyDict_SetItem(__pyx_d, __pyx_n_s_init_done, Py_True) < 0) __PYX_ERR(0, 101, __pyx_L1_error) /* "pygame_sdl2/display.pyx":86 * * @pygame_sdl2.register_init * def init(): # <<<<<<<<<<<<<< * * if init_done: */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_AddTraceback("pygame_sdl2.display.init", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/display.pyx":106 * * @pygame_sdl2.register_quit * def quit(): # @ReservedAssignment # <<<<<<<<<<<<<< * * global init_done */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_7display_9quit(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused); /*proto*/ static PyMethodDef __pyx_mdef_11pygame_sdl2_7display_9quit = {"quit", (PyCFunction)__pyx_pw_11pygame_sdl2_7display_9quit, METH_NOARGS, 0}; static PyObject *__pyx_pw_11pygame_sdl2_7display_9quit(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("quit (wrapper)", 0); __pyx_r = __pyx_pf_11pygame_sdl2_7display_8quit(__pyx_self); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_7display_8quit(CYTHON_UNUSED PyObject *__pyx_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; __Pyx_RefNannySetupContext("quit", 0); /* "pygame_sdl2/display.pyx":111 * global main_window * * if main_window: # <<<<<<<<<<<<<< * main_window.destroy() * main_window = None */ __pyx_t_1 = __Pyx_PyObject_IsTrue(((PyObject *)__pyx_v_11pygame_sdl2_7display_main_window)); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(0, 111, __pyx_L1_error) if (__pyx_t_1) { /* "pygame_sdl2/display.pyx":112 * * if main_window: * main_window.destroy() # <<<<<<<<<<<<<< * main_window = None * */ __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_11pygame_sdl2_7display_main_window), __pyx_n_s_destroy); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 112, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = NULL; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) { __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3); if (likely(__pyx_t_4)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); __Pyx_INCREF(__pyx_t_4); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_3, function); } } if (__pyx_t_4) { __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 112, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; } else { __pyx_t_2 = __Pyx_PyObject_CallNoArg(__pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 112, __pyx_L1_error) } __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "pygame_sdl2/display.pyx":113 * if main_window: * main_window.destroy() * main_window = None # <<<<<<<<<<<<<< * * init_done = False */ __Pyx_INCREF(Py_None); __Pyx_XGOTREF(((PyObject *)__pyx_v_11pygame_sdl2_7display_main_window)); __Pyx_DECREF_SET(__pyx_v_11pygame_sdl2_7display_main_window, ((struct __pyx_obj_11pygame_sdl2_7display_Window *)Py_None)); __Pyx_GIVEREF(Py_None); /* "pygame_sdl2/display.pyx":111 * global main_window * * if main_window: # <<<<<<<<<<<<<< * main_window.destroy() * main_window = None */ } /* "pygame_sdl2/display.pyx":115 * main_window = None * * init_done = False # <<<<<<<<<<<<<< * * def get_init(): */ if (PyDict_SetItem(__pyx_d, __pyx_n_s_init_done, Py_False) < 0) __PYX_ERR(0, 115, __pyx_L1_error) /* "pygame_sdl2/display.pyx":106 * * @pygame_sdl2.register_quit * def quit(): # @ReservedAssignment # <<<<<<<<<<<<<< * * global init_done */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_AddTraceback("pygame_sdl2.display.quit", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/display.pyx":117 * init_done = False * * def get_init(): # <<<<<<<<<<<<<< * return init_done * */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_7display_11get_init(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused); /*proto*/ static PyMethodDef __pyx_mdef_11pygame_sdl2_7display_11get_init = {"get_init", (PyCFunction)__pyx_pw_11pygame_sdl2_7display_11get_init, METH_NOARGS, 0}; static PyObject *__pyx_pw_11pygame_sdl2_7display_11get_init(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("get_init (wrapper)", 0); __pyx_r = __pyx_pf_11pygame_sdl2_7display_10get_init(__pyx_self); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_7display_10get_init(CYTHON_UNUSED PyObject *__pyx_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; __Pyx_RefNannySetupContext("get_init", 0); /* "pygame_sdl2/display.pyx":118 * * def get_init(): * return init_done # <<<<<<<<<<<<<< * * */ __Pyx_XDECREF(__pyx_r); __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_init_done); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 118, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "pygame_sdl2/display.pyx":117 * init_done = False * * def get_init(): # <<<<<<<<<<<<<< * return init_done * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("pygame_sdl2.display.get_init", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/display.pyx":127 * _shown_first_window = False * * def _before_first_window(): # <<<<<<<<<<<<<< * global _shown_first_window * */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_7display_13_before_first_window(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused); /*proto*/ static PyMethodDef __pyx_mdef_11pygame_sdl2_7display_13_before_first_window = {"_before_first_window", (PyCFunction)__pyx_pw_11pygame_sdl2_7display_13_before_first_window, METH_NOARGS, 0}; static PyObject *__pyx_pw_11pygame_sdl2_7display_13_before_first_window(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("_before_first_window (wrapper)", 0); __pyx_r = __pyx_pf_11pygame_sdl2_7display_12_before_first_window(__pyx_self); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_7display_12_before_first_window(CYTHON_UNUSED PyObject *__pyx_self) { PyObject *__pyx_v_androidembed = NULL; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_t_2; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; PyObject *__pyx_t_5 = NULL; PyObject *__pyx_t_6 = NULL; PyObject *__pyx_t_7 = NULL; int __pyx_t_8; __Pyx_RefNannySetupContext("_before_first_window", 0); /* "pygame_sdl2/display.pyx":130 * global _shown_first_window * * if _shown_first_window: # <<<<<<<<<<<<<< * return * */ __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_shown_first_window); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 130, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 130, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (__pyx_t_2) { /* "pygame_sdl2/display.pyx":131 * * if _shown_first_window: * return # <<<<<<<<<<<<<< * * _shown_first_window = True */ __Pyx_XDECREF(__pyx_r); __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; /* "pygame_sdl2/display.pyx":130 * global _shown_first_window * * if _shown_first_window: # <<<<<<<<<<<<<< * return * */ } /* "pygame_sdl2/display.pyx":133 * return * * _shown_first_window = True # <<<<<<<<<<<<<< * * # If we're on android, we have to close the splash window before opening */ if (PyDict_SetItem(__pyx_d, __pyx_n_s_shown_first_window, Py_True) < 0) __PYX_ERR(0, 133, __pyx_L1_error) /* "pygame_sdl2/display.pyx":137 * # If we're on android, we have to close the splash window before opening * # our window. * try: # <<<<<<<<<<<<<< * import androidembed * androidembed.close_window() */ { __Pyx_PyThreadState_declare __Pyx_PyThreadState_assign __Pyx_ExceptionSave(&__pyx_t_3, &__pyx_t_4, &__pyx_t_5); __Pyx_XGOTREF(__pyx_t_3); __Pyx_XGOTREF(__pyx_t_4); __Pyx_XGOTREF(__pyx_t_5); /*try:*/ { /* "pygame_sdl2/display.pyx":138 * # our window. * try: * import androidembed # <<<<<<<<<<<<<< * androidembed.close_window() * except ImportError: */ __pyx_t_1 = __Pyx_Import(__pyx_n_s_androidembed, 0, -1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 138, __pyx_L4_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_androidembed = __pyx_t_1; __pyx_t_1 = 0; /* "pygame_sdl2/display.pyx":139 * try: * import androidembed * androidembed.close_window() # <<<<<<<<<<<<<< * except ImportError: * pass */ __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_androidembed, __pyx_n_s_close_window); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 139, __pyx_L4_error) __Pyx_GOTREF(__pyx_t_6); __pyx_t_7 = NULL; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_6))) { __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_6); if (likely(__pyx_t_7)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6); __Pyx_INCREF(__pyx_t_7); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_6, function); } } if (__pyx_t_7) { __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_6, __pyx_t_7); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 139, __pyx_L4_error) __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; } else { __pyx_t_1 = __Pyx_PyObject_CallNoArg(__pyx_t_6); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 139, __pyx_L4_error) } __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "pygame_sdl2/display.pyx":137 * # If we're on android, we have to close the splash window before opening * # our window. * try: # <<<<<<<<<<<<<< * import androidembed * androidembed.close_window() */ } __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; goto __pyx_L9_try_end; __pyx_L4_error:; __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; /* "pygame_sdl2/display.pyx":140 * import androidembed * androidembed.close_window() * except ImportError: # <<<<<<<<<<<<<< * pass * */ __pyx_t_8 = __Pyx_PyErr_ExceptionMatches(__pyx_builtin_ImportError); if (__pyx_t_8) { __Pyx_ErrRestore(0,0,0); goto __pyx_L5_exception_handled; } goto __pyx_L6_except_error; __pyx_L6_except_error:; /* "pygame_sdl2/display.pyx":137 * # If we're on android, we have to close the splash window before opening * # our window. * try: # <<<<<<<<<<<<<< * import androidembed * androidembed.close_window() */ __Pyx_XGIVEREF(__pyx_t_3); __Pyx_XGIVEREF(__pyx_t_4); __Pyx_XGIVEREF(__pyx_t_5); __Pyx_ExceptionReset(__pyx_t_3, __pyx_t_4, __pyx_t_5); goto __pyx_L1_error; __pyx_L5_exception_handled:; __Pyx_XGIVEREF(__pyx_t_3); __Pyx_XGIVEREF(__pyx_t_4); __Pyx_XGIVEREF(__pyx_t_5); __Pyx_ExceptionReset(__pyx_t_3, __pyx_t_4, __pyx_t_5); __pyx_L9_try_end:; } /* "pygame_sdl2/display.pyx":127 * _shown_first_window = False * * def _before_first_window(): # <<<<<<<<<<<<<< * global _shown_first_window * */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_6); __Pyx_XDECREF(__pyx_t_7); __Pyx_AddTraceback("pygame_sdl2.display._before_first_window", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF(__pyx_v_androidembed); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/display.pyx":146 * * cdef class Window: * def __init__(self, title, resolution=(0, 0), flags=0, depth=0, pos=(SDL_WINDOWPOS_UNDEFINED, SDL_WINDOWPOS_UNDEFINED)): # <<<<<<<<<<<<<< * * if not isinstance(title, bytes): */ /* Python wrapper */ static int __pyx_pw_11pygame_sdl2_7display_6Window_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static int __pyx_pw_11pygame_sdl2_7display_6Window_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_title = 0; PyObject *__pyx_v_resolution = 0; PyObject *__pyx_v_flags = 0; CYTHON_UNUSED PyObject *__pyx_v_depth = 0; PyObject *__pyx_v_pos = 0; int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__init__ (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_title,&__pyx_n_s_resolution,&__pyx_n_s_flags,&__pyx_n_s_depth,&__pyx_n_s_pos,0}; PyObject* values[5] = {0,0,0,0,0}; values[1] = ((PyObject *)__pyx_tuple__5); values[2] = ((PyObject *)__pyx_int_0); values[3] = ((PyObject *)__pyx_int_0); values[4] = __pyx_k__6; if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4); CYTHON_FALLTHROUGH; case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); CYTHON_FALLTHROUGH; case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_title)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (kw_args > 0) { PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_resolution); if (value) { values[1] = value; kw_args--; } } CYTHON_FALLTHROUGH; case 2: if (kw_args > 0) { PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_flags); if (value) { values[2] = value; kw_args--; } } CYTHON_FALLTHROUGH; case 3: if (kw_args > 0) { PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_depth); if (value) { values[3] = value; kw_args--; } } CYTHON_FALLTHROUGH; case 4: if (kw_args > 0) { PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_pos); if (value) { values[4] = value; kw_args--; } } } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__init__") < 0)) __PYX_ERR(0, 146, __pyx_L3_error) } } else { switch (PyTuple_GET_SIZE(__pyx_args)) { case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4); CYTHON_FALLTHROUGH; case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); CYTHON_FALLTHROUGH; case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_title = values[0]; __pyx_v_resolution = values[1]; __pyx_v_flags = values[2]; __pyx_v_depth = values[3]; __pyx_v_pos = values[4]; } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("__init__", 0, 1, 5, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 146, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("pygame_sdl2.display.Window.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return -1; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_11pygame_sdl2_7display_6Window___init__(((struct __pyx_obj_11pygame_sdl2_7display_Window *)__pyx_v_self), __pyx_v_title, __pyx_v_resolution, __pyx_v_flags, __pyx_v_depth, __pyx_v_pos); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static int __pyx_pf_11pygame_sdl2_7display_6Window___init__(struct __pyx_obj_11pygame_sdl2_7display_Window *__pyx_v_self, PyObject *__pyx_v_title, PyObject *__pyx_v_resolution, PyObject *__pyx_v_flags, CYTHON_UNUSED PyObject *__pyx_v_depth, PyObject *__pyx_v_pos) { long __pyx_v_gl_flag; int __pyx_r; __Pyx_RefNannyDeclarations int __pyx_t_1; int __pyx_t_2; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; PyObject *__pyx_t_5 = NULL; Uint32 __pyx_t_6; char const *__pyx_t_7; int __pyx_t_8; int __pyx_t_9; int __pyx_t_10; int __pyx_t_11; PyObject *__pyx_t_12 = NULL; PyObject *__pyx_t_13 = NULL; PyObject *__pyx_t_14 = NULL; PyObject *__pyx_t_15 = NULL; PyObject *__pyx_t_16 = NULL; PyObject *__pyx_t_17 = NULL; __Pyx_RefNannySetupContext("__init__", 0); __Pyx_INCREF(__pyx_v_title); /* "pygame_sdl2/display.pyx":148 * def __init__(self, title, resolution=(0, 0), flags=0, depth=0, pos=(SDL_WINDOWPOS_UNDEFINED, SDL_WINDOWPOS_UNDEFINED)): * * if not isinstance(title, bytes): # <<<<<<<<<<<<<< * title = title.encode("utf-8") * */ __pyx_t_1 = PyBytes_Check(__pyx_v_title); __pyx_t_2 = ((!(__pyx_t_1 != 0)) != 0); if (__pyx_t_2) { /* "pygame_sdl2/display.pyx":149 * * if not isinstance(title, bytes): * title = title.encode("utf-8") # <<<<<<<<<<<<<< * * _before_first_window() */ __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_title, __pyx_n_s_encode); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 149, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_tuple__7, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 149, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF_SET(__pyx_v_title, __pyx_t_4); __pyx_t_4 = 0; /* "pygame_sdl2/display.pyx":148 * def __init__(self, title, resolution=(0, 0), flags=0, depth=0, pos=(SDL_WINDOWPOS_UNDEFINED, SDL_WINDOWPOS_UNDEFINED)): * * if not isinstance(title, bytes): # <<<<<<<<<<<<<< * title = title.encode("utf-8") * */ } /* "pygame_sdl2/display.pyx":151 * title = title.encode("utf-8") * * _before_first_window() # <<<<<<<<<<<<<< * * self.create_flags = flags */ __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_before_first_window); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 151, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_5 = NULL; if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) { __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_3); if (likely(__pyx_t_5)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); __Pyx_INCREF(__pyx_t_5); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_3, function); } } if (__pyx_t_5) { __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_5); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 151, __pyx_L1_error) __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; } else { __pyx_t_4 = __Pyx_PyObject_CallNoArg(__pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 151, __pyx_L1_error) } __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; /* "pygame_sdl2/display.pyx":153 * _before_first_window() * * self.create_flags = flags # <<<<<<<<<<<<<< * * # If we do not get the AVOID_GL hint, we always create a GL-compatible */ __pyx_t_6 = __Pyx_PyInt_As_uint32_t(__pyx_v_flags); if (unlikely((__pyx_t_6 == ((Uint32)-1)) && PyErr_Occurred())) __PYX_ERR(0, 153, __pyx_L1_error) __pyx_v_self->create_flags = __pyx_t_6; /* "pygame_sdl2/display.pyx":157 * # If we do not get the AVOID_GL hint, we always create a GL-compatible * # window. This lets us change the OPENGL flag later on. * if int(_get_hint("PYGAME_SDL2_AVOID_GL", "0")): # <<<<<<<<<<<<<< * gl_flag = 0 * else: */ __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_get_hint); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 157, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_tuple__8, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 157, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_t_4 = __Pyx_PyNumber_Int(__pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 157, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 157, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; if (__pyx_t_2) { /* "pygame_sdl2/display.pyx":158 * # window. This lets us change the OPENGL flag later on. * if int(_get_hint("PYGAME_SDL2_AVOID_GL", "0")): * gl_flag = 0 # <<<<<<<<<<<<<< * else: * gl_flag = SDL_WINDOW_OPENGL */ __pyx_v_gl_flag = 0; /* "pygame_sdl2/display.pyx":157 * # If we do not get the AVOID_GL hint, we always create a GL-compatible * # window. This lets us change the OPENGL flag later on. * if int(_get_hint("PYGAME_SDL2_AVOID_GL", "0")): # <<<<<<<<<<<<<< * gl_flag = 0 * else: */ goto __pyx_L4; } /* "pygame_sdl2/display.pyx":160 * gl_flag = 0 * else: * gl_flag = SDL_WINDOW_OPENGL # <<<<<<<<<<<<<< * * self.window = SDL_CreateWindow( */ /*else*/ { __pyx_v_gl_flag = SDL_WINDOW_OPENGL; } __pyx_L4:; /* "pygame_sdl2/display.pyx":163 * * self.window = SDL_CreateWindow( * title, # <<<<<<<<<<<<<< * pos[0], pos[1], * resolution[0], resolution[1], flags | gl_flag) */ __pyx_t_7 = __Pyx_PyObject_AsString(__pyx_v_title); if (unlikely((!__pyx_t_7) && PyErr_Occurred())) __PYX_ERR(0, 163, __pyx_L1_error) /* "pygame_sdl2/display.pyx":164 * self.window = SDL_CreateWindow( * title, * pos[0], pos[1], # <<<<<<<<<<<<<< * resolution[0], resolution[1], flags | gl_flag) * */ __pyx_t_4 = __Pyx_GetItemInt(__pyx_v_pos, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 164, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_8 = __Pyx_PyInt_As_int(__pyx_t_4); if (unlikely((__pyx_t_8 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 164, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_t_4 = __Pyx_GetItemInt(__pyx_v_pos, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 164, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_9 = __Pyx_PyInt_As_int(__pyx_t_4); if (unlikely((__pyx_t_9 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 164, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; /* "pygame_sdl2/display.pyx":165 * title, * pos[0], pos[1], * resolution[0], resolution[1], flags | gl_flag) # <<<<<<<<<<<<<< * * if not self.window: */ __pyx_t_4 = __Pyx_GetItemInt(__pyx_v_resolution, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 165, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_10 = __Pyx_PyInt_As_int(__pyx_t_4); if (unlikely((__pyx_t_10 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 165, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_t_4 = __Pyx_GetItemInt(__pyx_v_resolution, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 165, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_11 = __Pyx_PyInt_As_int(__pyx_t_4); if (unlikely((__pyx_t_11 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 165, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_t_4 = __Pyx_PyInt_From_long(__pyx_v_gl_flag); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 165, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_3 = PyNumber_Or(__pyx_v_flags, __pyx_t_4); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 165, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_t_6 = __Pyx_PyInt_As_uint32_t(__pyx_t_3); if (unlikely((__pyx_t_6 == ((Uint32)-1)) && PyErr_Occurred())) __PYX_ERR(0, 165, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "pygame_sdl2/display.pyx":162 * gl_flag = SDL_WINDOW_OPENGL * * self.window = SDL_CreateWindow( # <<<<<<<<<<<<<< * title, * pos[0], pos[1], */ __pyx_v_self->window = SDL_CreateWindow(__pyx_t_7, __pyx_t_8, __pyx_t_9, __pyx_t_10, __pyx_t_11, __pyx_t_6); /* "pygame_sdl2/display.pyx":167 * resolution[0], resolution[1], flags | gl_flag) * * if not self.window: # <<<<<<<<<<<<<< * raise error() * */ __pyx_t_2 = ((!(__pyx_v_self->window != 0)) != 0); if (__pyx_t_2) { /* "pygame_sdl2/display.pyx":168 * * if not self.window: * raise error() # <<<<<<<<<<<<<< * * # From here on, the window exists. So we have to call self.destroy if */ __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_error); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 168, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_5 = NULL; if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_4))) { __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4); if (likely(__pyx_t_5)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4); __Pyx_INCREF(__pyx_t_5); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_4, function); } } if (__pyx_t_5) { __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_5); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 168, __pyx_L1_error) __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; } else { __pyx_t_3 = __Pyx_PyObject_CallNoArg(__pyx_t_4); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 168, __pyx_L1_error) } __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_Raise(__pyx_t_3, 0, 0, 0); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __PYX_ERR(0, 168, __pyx_L1_error) /* "pygame_sdl2/display.pyx":167 * resolution[0], resolution[1], flags | gl_flag) * * if not self.window: # <<<<<<<<<<<<<< * raise error() * */ } /* "pygame_sdl2/display.pyx":173 * # an exception occurs. * * try: # <<<<<<<<<<<<<< * * if flags & SDL_WINDOW_OPENGL: */ { __Pyx_PyThreadState_declare __Pyx_PyThreadState_assign __Pyx_ExceptionSave(&__pyx_t_12, &__pyx_t_13, &__pyx_t_14); __Pyx_XGOTREF(__pyx_t_12); __Pyx_XGOTREF(__pyx_t_13); __Pyx_XGOTREF(__pyx_t_14); /*try:*/ { /* "pygame_sdl2/display.pyx":175 * try: * * if flags & SDL_WINDOW_OPENGL: # <<<<<<<<<<<<<< * * self.gl_context = SDL_GL_CreateContext(self.window) */ __pyx_t_3 = __Pyx_PyInt_From_SDL_WindowFlags(SDL_WINDOW_OPENGL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 175, __pyx_L6_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = PyNumber_And(__pyx_v_flags, __pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 175, __pyx_L6_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 175, __pyx_L6_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; if (__pyx_t_2) { /* "pygame_sdl2/display.pyx":177 * if flags & SDL_WINDOW_OPENGL: * * self.gl_context = SDL_GL_CreateContext(self.window) # <<<<<<<<<<<<<< * * if self.gl_context == NULL: */ __pyx_v_self->gl_context = SDL_GL_CreateContext(__pyx_v_self->window); /* "pygame_sdl2/display.pyx":179 * self.gl_context = SDL_GL_CreateContext(self.window) * * if self.gl_context == NULL: # <<<<<<<<<<<<<< * raise error() * */ __pyx_t_2 = ((__pyx_v_self->gl_context == NULL) != 0); if (__pyx_t_2) { /* "pygame_sdl2/display.pyx":180 * * if self.gl_context == NULL: * raise error() # <<<<<<<<<<<<<< * * if not ios: */ __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_error); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 180, __pyx_L6_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_5 = NULL; if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) { __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_3); if (likely(__pyx_t_5)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); __Pyx_INCREF(__pyx_t_5); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_3, function); } } if (__pyx_t_5) { __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_5); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 180, __pyx_L6_error) __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; } else { __pyx_t_4 = __Pyx_PyObject_CallNoArg(__pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 180, __pyx_L6_error) } __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_Raise(__pyx_t_4, 0, 0, 0); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __PYX_ERR(0, 180, __pyx_L6_error) /* "pygame_sdl2/display.pyx":179 * self.gl_context = SDL_GL_CreateContext(self.window) * * if self.gl_context == NULL: # <<<<<<<<<<<<<< * raise error() * */ } /* "pygame_sdl2/display.pyx":182 * raise error() * * if not ios: # <<<<<<<<<<<<<< * # Try setting the swap interval - first positive, then negated * # to deal with the case where the negative interval isn't */ __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_ios); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 182, __pyx_L6_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 182, __pyx_L6_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_t_1 = ((!__pyx_t_2) != 0); if (__pyx_t_1) { /* "pygame_sdl2/display.pyx":186 * # to deal with the case where the negative interval isn't * # supported. Then give up and carry on. * if SDL_GL_SetSwapInterval(default_swap_control): # <<<<<<<<<<<<<< * SDL_GL_SetSwapInterval(-default_swap_control) * */ __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_default_swap_control); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 186, __pyx_L6_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_11 = __Pyx_PyInt_As_int(__pyx_t_4); if (unlikely((__pyx_t_11 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 186, __pyx_L6_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_t_1 = (SDL_GL_SetSwapInterval(__pyx_t_11) != 0); if (__pyx_t_1) { /* "pygame_sdl2/display.pyx":187 * # supported. Then give up and carry on. * if SDL_GL_SetSwapInterval(default_swap_control): * SDL_GL_SetSwapInterval(-default_swap_control) # <<<<<<<<<<<<<< * * */ __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_default_swap_control); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 187, __pyx_L6_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_3 = PyNumber_Negative(__pyx_t_4); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 187, __pyx_L6_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_t_11 = __Pyx_PyInt_As_int(__pyx_t_3); if (unlikely((__pyx_t_11 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 187, __pyx_L6_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; SDL_GL_SetSwapInterval(__pyx_t_11); /* "pygame_sdl2/display.pyx":186 * # to deal with the case where the negative interval isn't * # supported. Then give up and carry on. * if SDL_GL_SetSwapInterval(default_swap_control): # <<<<<<<<<<<<<< * SDL_GL_SetSwapInterval(-default_swap_control) * */ } /* "pygame_sdl2/display.pyx":182 * raise error() * * if not ios: # <<<<<<<<<<<<<< * # Try setting the swap interval - first positive, then negated * # to deal with the case where the negative interval isn't */ } /* "pygame_sdl2/display.pyx":175 * try: * * if flags & SDL_WINDOW_OPENGL: # <<<<<<<<<<<<<< * * self.gl_context = SDL_GL_CreateContext(self.window) */ } /* "pygame_sdl2/display.pyx":190 * * * self.create_surface() # <<<<<<<<<<<<<< * * except: */ __pyx_t_4 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_create_surface); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 190, __pyx_L6_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_5 = NULL; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_4))) { __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4); if (likely(__pyx_t_5)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4); __Pyx_INCREF(__pyx_t_5); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_4, function); } } if (__pyx_t_5) { __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_5); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 190, __pyx_L6_error) __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; } else { __pyx_t_3 = __Pyx_PyObject_CallNoArg(__pyx_t_4); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 190, __pyx_L6_error) } __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "pygame_sdl2/display.pyx":173 * # an exception occurs. * * try: # <<<<<<<<<<<<<< * * if flags & SDL_WINDOW_OPENGL: */ } __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0; __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0; __Pyx_XDECREF(__pyx_t_14); __pyx_t_14 = 0; goto __pyx_L11_try_end; __pyx_L6_error:; __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; /* "pygame_sdl2/display.pyx":192 * self.create_surface() * * except: # <<<<<<<<<<<<<< * self.destroy() * raise */ /*except:*/ { __Pyx_AddTraceback("pygame_sdl2.display.Window.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename); if (__Pyx_GetException(&__pyx_t_3, &__pyx_t_4, &__pyx_t_5) < 0) __PYX_ERR(0, 192, __pyx_L8_except_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_GOTREF(__pyx_t_4); __Pyx_GOTREF(__pyx_t_5); /* "pygame_sdl2/display.pyx":193 * * except: * self.destroy() # <<<<<<<<<<<<<< * raise * */ __pyx_t_16 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_destroy); if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 193, __pyx_L8_except_error) __Pyx_GOTREF(__pyx_t_16); __pyx_t_17 = NULL; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_16))) { __pyx_t_17 = PyMethod_GET_SELF(__pyx_t_16); if (likely(__pyx_t_17)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_16); __Pyx_INCREF(__pyx_t_17); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_16, function); } } if (__pyx_t_17) { __pyx_t_15 = __Pyx_PyObject_CallOneArg(__pyx_t_16, __pyx_t_17); if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 193, __pyx_L8_except_error) __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0; } else { __pyx_t_15 = __Pyx_PyObject_CallNoArg(__pyx_t_16); if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 193, __pyx_L8_except_error) } __Pyx_GOTREF(__pyx_t_15); __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0; __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0; /* "pygame_sdl2/display.pyx":194 * except: * self.destroy() * raise # <<<<<<<<<<<<<< * * def create_surface(self): */ __Pyx_GIVEREF(__pyx_t_3); __Pyx_GIVEREF(__pyx_t_4); __Pyx_XGIVEREF(__pyx_t_5); __Pyx_ErrRestoreWithState(__pyx_t_3, __pyx_t_4, __pyx_t_5); __pyx_t_3 = 0; __pyx_t_4 = 0; __pyx_t_5 = 0; __PYX_ERR(0, 194, __pyx_L8_except_error) } __pyx_L8_except_error:; /* "pygame_sdl2/display.pyx":173 * # an exception occurs. * * try: # <<<<<<<<<<<<<< * * if flags & SDL_WINDOW_OPENGL: */ __Pyx_XGIVEREF(__pyx_t_12); __Pyx_XGIVEREF(__pyx_t_13); __Pyx_XGIVEREF(__pyx_t_14); __Pyx_ExceptionReset(__pyx_t_12, __pyx_t_13, __pyx_t_14); goto __pyx_L1_error; __pyx_L11_try_end:; } /* "pygame_sdl2/display.pyx":146 * * cdef class Window: * def __init__(self, title, resolution=(0, 0), flags=0, depth=0, pos=(SDL_WINDOWPOS_UNDEFINED, SDL_WINDOWPOS_UNDEFINED)): # <<<<<<<<<<<<<< * * if not isinstance(title, bytes): */ /* function exit code */ __pyx_r = 0; goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_5); __Pyx_XDECREF(__pyx_t_15); __Pyx_XDECREF(__pyx_t_16); __Pyx_XDECREF(__pyx_t_17); __Pyx_AddTraceback("pygame_sdl2.display.Window.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = -1; __pyx_L0:; __Pyx_XDECREF(__pyx_v_title); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/display.pyx":196 * raise * * def create_surface(self): # <<<<<<<<<<<<<< * """ * Creates the surface associated with this window. */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_7display_6Window_3create_surface(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/ static char __pyx_doc_11pygame_sdl2_7display_6Window_2create_surface[] = "\n Creates the surface associated with this window.\n "; static PyObject *__pyx_pw_11pygame_sdl2_7display_6Window_3create_surface(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("create_surface (wrapper)", 0); __pyx_r = __pyx_pf_11pygame_sdl2_7display_6Window_2create_surface(((struct __pyx_obj_11pygame_sdl2_7display_Window *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_7display_6Window_2create_surface(struct __pyx_obj_11pygame_sdl2_7display_Window *__pyx_v_self) { int __pyx_v_w; int __pyx_v_h; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; SDL_Surface *__pyx_t_5; __Pyx_RefNannySetupContext("create_surface", 0); /* "pygame_sdl2/display.pyx":202 * * cdef int w, h * SDL_GetWindowSize(self.window, &w, &h) # <<<<<<<<<<<<<< * * if self.gl_context: */ SDL_GetWindowSize(__pyx_v_self->window, (&__pyx_v_w), (&__pyx_v_h)); /* "pygame_sdl2/display.pyx":204 * SDL_GetWindowSize(self.window, &w, &h) * * if self.gl_context: # <<<<<<<<<<<<<< * * # For now, make this the size of the window so get_size() works. */ __pyx_t_1 = (__pyx_v_self->gl_context != 0); if (__pyx_t_1) { /* "pygame_sdl2/display.pyx":209 * # TODO: Make this a bit less wasteful of memory, even if it means * # we lie about the actual size of the pixel array. * self.surface = Surface((w, h), SRCALPHA, 32) # <<<<<<<<<<<<<< * * else: */ __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_v_w); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 209, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = __Pyx_PyInt_From_int(__pyx_v_h); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 209, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 209, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_GIVEREF(__pyx_t_2); PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_2); __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_3); __pyx_t_2 = 0; __pyx_t_3 = 0; __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_SRCALPHA); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 209, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_2 = PyTuple_New(3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 209, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_4); __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_t_3); __Pyx_INCREF(__pyx_int_32); __Pyx_GIVEREF(__pyx_int_32); PyTuple_SET_ITEM(__pyx_t_2, 2, __pyx_int_32); __pyx_t_4 = 0; __pyx_t_3 = 0; __pyx_t_3 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_11pygame_sdl2_7surface_Surface), __pyx_t_2, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 209, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_GIVEREF(__pyx_t_3); __Pyx_GOTREF(__pyx_v_self->surface); __Pyx_DECREF(((PyObject *)__pyx_v_self->surface)); __pyx_v_self->surface = ((struct __pyx_obj_11pygame_sdl2_7surface_Surface *)__pyx_t_3); __pyx_t_3 = 0; /* "pygame_sdl2/display.pyx":204 * SDL_GetWindowSize(self.window, &w, &h) * * if self.gl_context: # <<<<<<<<<<<<<< * * # For now, make this the size of the window so get_size() works. */ goto __pyx_L3; } /* "pygame_sdl2/display.pyx":213 * else: * * self.window_surface = SDL_GetWindowSurface(self.window) # <<<<<<<<<<<<<< * * # If the surface is 32-bit, we can use it directly. Otherwise, */ /*else*/ { __pyx_v_self->window_surface = SDL_GetWindowSurface(__pyx_v_self->window); /* "pygame_sdl2/display.pyx":217 * # If the surface is 32-bit, we can use it directly. Otherwise, * # we need to create a 32-bit proxy surface. * if self.window_surface.format.BitsPerPixel == 32: # <<<<<<<<<<<<<< * * self.surface = Surface(()) */ __pyx_t_1 = ((__pyx_v_self->window_surface->format->BitsPerPixel == 32) != 0); if (__pyx_t_1) { /* "pygame_sdl2/display.pyx":219 * if self.window_surface.format.BitsPerPixel == 32: * * self.surface = Surface(()) # <<<<<<<<<<<<<< * self.surface.surface = self.window_surface * self.surface.owns_surface = False */ __pyx_t_3 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_11pygame_sdl2_7surface_Surface), __pyx_tuple__9, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 219, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_GIVEREF(__pyx_t_3); __Pyx_GOTREF(__pyx_v_self->surface); __Pyx_DECREF(((PyObject *)__pyx_v_self->surface)); __pyx_v_self->surface = ((struct __pyx_obj_11pygame_sdl2_7surface_Surface *)__pyx_t_3); __pyx_t_3 = 0; /* "pygame_sdl2/display.pyx":220 * * self.surface = Surface(()) * self.surface.surface = self.window_surface # <<<<<<<<<<<<<< * self.surface.owns_surface = False * self.surface.window_surface = True */ __pyx_t_5 = __pyx_v_self->window_surface; __pyx_v_self->surface->surface = __pyx_t_5; /* "pygame_sdl2/display.pyx":221 * self.surface = Surface(()) * self.surface.surface = self.window_surface * self.surface.owns_surface = False # <<<<<<<<<<<<<< * self.surface.window_surface = True * */ __pyx_v_self->surface->owns_surface = 0; /* "pygame_sdl2/display.pyx":222 * self.surface.surface = self.window_surface * self.surface.owns_surface = False * self.surface.window_surface = True # <<<<<<<<<<<<<< * * else: */ __pyx_v_self->surface->window_surface = 1; /* "pygame_sdl2/display.pyx":217 * # If the surface is 32-bit, we can use it directly. Otherwise, * # we need to create a 32-bit proxy surface. * if self.window_surface.format.BitsPerPixel == 32: # <<<<<<<<<<<<<< * * self.surface = Surface(()) */ goto __pyx_L4; } /* "pygame_sdl2/display.pyx":225 * * else: * self.surface = Surface((w, h), 0, 32) # <<<<<<<<<<<<<< * * self.surface.get_window_flags = self.get_window_flags */ /*else*/ { __pyx_t_3 = __Pyx_PyInt_From_int(__pyx_v_w); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 225, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_v_h); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 225, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 225, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_3); __Pyx_GIVEREF(__pyx_t_2); PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_2); __pyx_t_3 = 0; __pyx_t_2 = 0; __pyx_t_2 = PyTuple_New(3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 225, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_4); __Pyx_INCREF(__pyx_int_0); __Pyx_GIVEREF(__pyx_int_0); PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_int_0); __Pyx_INCREF(__pyx_int_32); __Pyx_GIVEREF(__pyx_int_32); PyTuple_SET_ITEM(__pyx_t_2, 2, __pyx_int_32); __pyx_t_4 = 0; __pyx_t_4 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_11pygame_sdl2_7surface_Surface), __pyx_t_2, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 225, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_GIVEREF(__pyx_t_4); __Pyx_GOTREF(__pyx_v_self->surface); __Pyx_DECREF(((PyObject *)__pyx_v_self->surface)); __pyx_v_self->surface = ((struct __pyx_obj_11pygame_sdl2_7surface_Surface *)__pyx_t_4); __pyx_t_4 = 0; } __pyx_L4:; } __pyx_L3:; /* "pygame_sdl2/display.pyx":227 * self.surface = Surface((w, h), 0, 32) * * self.surface.get_window_flags = self.get_window_flags # <<<<<<<<<<<<<< * * */ __pyx_t_4 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_get_window_flags); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 227, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_GIVEREF(__pyx_t_4); __Pyx_GOTREF(__pyx_v_self->surface->get_window_flags); __Pyx_DECREF(__pyx_v_self->surface->get_window_flags); __pyx_v_self->surface->get_window_flags = __pyx_t_4; __pyx_t_4 = 0; /* "pygame_sdl2/display.pyx":196 * raise * * def create_surface(self): # <<<<<<<<<<<<<< * """ * Creates the surface associated with this window. */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_AddTraceback("pygame_sdl2.display.Window.create_surface", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/display.pyx":230 * * * def destroy(self): # <<<<<<<<<<<<<< * """ * This should be called before the window is deleted. */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_7display_6Window_5destroy(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/ static char __pyx_doc_11pygame_sdl2_7display_6Window_4destroy[] = "\n This should be called before the window is deleted.\n "; static PyObject *__pyx_pw_11pygame_sdl2_7display_6Window_5destroy(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("destroy (wrapper)", 0); __pyx_r = __pyx_pf_11pygame_sdl2_7display_6Window_4destroy(((struct __pyx_obj_11pygame_sdl2_7display_Window *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_7display_6Window_4destroy(struct __pyx_obj_11pygame_sdl2_7display_Window *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; __Pyx_RefNannySetupContext("destroy", 0); /* "pygame_sdl2/display.pyx":235 * """ * * if self.gl_context != NULL: # <<<<<<<<<<<<<< * SDL_GL_DeleteContext(self.gl_context) * */ __pyx_t_1 = ((__pyx_v_self->gl_context != NULL) != 0); if (__pyx_t_1) { /* "pygame_sdl2/display.pyx":236 * * if self.gl_context != NULL: * SDL_GL_DeleteContext(self.gl_context) # <<<<<<<<<<<<<< * * if self.surface: */ SDL_GL_DeleteContext(__pyx_v_self->gl_context); /* "pygame_sdl2/display.pyx":235 * """ * * if self.gl_context != NULL: # <<<<<<<<<<<<<< * SDL_GL_DeleteContext(self.gl_context) * */ } /* "pygame_sdl2/display.pyx":238 * SDL_GL_DeleteContext(self.gl_context) * * if self.surface: # <<<<<<<<<<<<<< * * # Break the cycle that prevents refcounting from collecting this */ __pyx_t_1 = __Pyx_PyObject_IsTrue(((PyObject *)__pyx_v_self->surface)); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(0, 238, __pyx_L1_error) if (__pyx_t_1) { /* "pygame_sdl2/display.pyx":242 * # Break the cycle that prevents refcounting from collecting this * # object. * self.surface.get_window_flags = None # <<<<<<<<<<<<<< * * # Necessary to collect the GL surface, doesn't hurt the window surface. */ __Pyx_INCREF(Py_None); __Pyx_GIVEREF(Py_None); __Pyx_GOTREF(__pyx_v_self->surface->get_window_flags); __Pyx_DECREF(__pyx_v_self->surface->get_window_flags); __pyx_v_self->surface->get_window_flags = Py_None; /* "pygame_sdl2/display.pyx":245 * * # Necessary to collect the GL surface, doesn't hurt the window surface. * self.surface = None # <<<<<<<<<<<<<< * * SDL_DestroyWindow(self.window) */ __Pyx_INCREF(Py_None); __Pyx_GIVEREF(Py_None); __Pyx_GOTREF(__pyx_v_self->surface); __Pyx_DECREF(((PyObject *)__pyx_v_self->surface)); __pyx_v_self->surface = ((struct __pyx_obj_11pygame_sdl2_7surface_Surface *)Py_None); /* "pygame_sdl2/display.pyx":238 * SDL_GL_DeleteContext(self.gl_context) * * if self.surface: # <<<<<<<<<<<<<< * * # Break the cycle that prevents refcounting from collecting this */ } /* "pygame_sdl2/display.pyx":247 * self.surface = None * * SDL_DestroyWindow(self.window) # <<<<<<<<<<<<<< * * def resize(self, size, opengl=False): */ SDL_DestroyWindow(__pyx_v_self->window); /* "pygame_sdl2/display.pyx":230 * * * def destroy(self): # <<<<<<<<<<<<<< * """ * This should be called before the window is deleted. */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("pygame_sdl2.display.Window.destroy", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/display.pyx":249 * SDL_DestroyWindow(self.window) * * def resize(self, size, opengl=False): # <<<<<<<<<<<<<< * """ * Resizes the window to `size`, which must be a width, height tuple. If opengl */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_7display_6Window_7resize(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_11pygame_sdl2_7display_6Window_6resize[] = "\n Resizes the window to `size`, which must be a width, height tuple. If opengl\n is true, adds an OpenGL context, if it's missing. Otherwise, removes the\n opengl context if present.\n "; static PyObject *__pyx_pw_11pygame_sdl2_7display_6Window_7resize(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_size = 0; PyObject *__pyx_v_opengl = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("resize (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_size,&__pyx_n_s_opengl,0}; PyObject* values[2] = {0,0}; values[1] = ((PyObject *)Py_False); if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_size)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (kw_args > 0) { PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_opengl); if (value) { values[1] = value; kw_args--; } } } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "resize") < 0)) __PYX_ERR(0, 249, __pyx_L3_error) } } else { switch (PyTuple_GET_SIZE(__pyx_args)) { case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_size = values[0]; __pyx_v_opengl = values[1]; } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("resize", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 249, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("pygame_sdl2.display.Window.resize", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_11pygame_sdl2_7display_6Window_6resize(((struct __pyx_obj_11pygame_sdl2_7display_Window *)__pyx_v_self), __pyx_v_size, __pyx_v_opengl); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_7display_6Window_6resize(struct __pyx_obj_11pygame_sdl2_7display_Window *__pyx_v_self, PyObject *__pyx_v_size, PyObject *__pyx_v_opengl) { int __pyx_v_cur_width; int __pyx_v_cur_height; PyObject *__pyx_v_width = NULL; PyObject *__pyx_v_height = NULL; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; int __pyx_t_2; int __pyx_t_3; PyObject *__pyx_t_4 = NULL; PyObject *__pyx_t_5 = NULL; PyObject *__pyx_t_6 = NULL; PyObject *(*__pyx_t_7)(PyObject *); int __pyx_t_8; int __pyx_t_9; __Pyx_RefNannySetupContext("resize", 0); /* "pygame_sdl2/display.pyx":257 * * # Prevents a loop between the surface and this object. * self.surface.get_window_flags = None # <<<<<<<<<<<<<< * * if self.gl_context and not opengl: */ __Pyx_INCREF(Py_None); __Pyx_GIVEREF(Py_None); __Pyx_GOTREF(__pyx_v_self->surface->get_window_flags); __Pyx_DECREF(__pyx_v_self->surface->get_window_flags); __pyx_v_self->surface->get_window_flags = Py_None; /* "pygame_sdl2/display.pyx":259 * self.surface.get_window_flags = None * * if self.gl_context and not opengl: # <<<<<<<<<<<<<< * SDL_GL_DeleteContext(self.gl_context) * self.gl_context = NULL */ __pyx_t_2 = (__pyx_v_self->gl_context != 0); if (__pyx_t_2) { } else { __pyx_t_1 = __pyx_t_2; goto __pyx_L4_bool_binop_done; } __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_v_opengl); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 259, __pyx_L1_error) __pyx_t_3 = ((!__pyx_t_2) != 0); __pyx_t_1 = __pyx_t_3; __pyx_L4_bool_binop_done:; if (__pyx_t_1) { /* "pygame_sdl2/display.pyx":260 * * if self.gl_context and not opengl: * SDL_GL_DeleteContext(self.gl_context) # <<<<<<<<<<<<<< * self.gl_context = NULL * */ SDL_GL_DeleteContext(__pyx_v_self->gl_context); /* "pygame_sdl2/display.pyx":261 * if self.gl_context and not opengl: * SDL_GL_DeleteContext(self.gl_context) * self.gl_context = NULL # <<<<<<<<<<<<<< * * cdef int cur_width = 0 */ __pyx_v_self->gl_context = NULL; /* "pygame_sdl2/display.pyx":259 * self.surface.get_window_flags = None * * if self.gl_context and not opengl: # <<<<<<<<<<<<<< * SDL_GL_DeleteContext(self.gl_context) * self.gl_context = NULL */ } /* "pygame_sdl2/display.pyx":263 * self.gl_context = NULL * * cdef int cur_width = 0 # <<<<<<<<<<<<<< * cdef int cur_height = 0 * */ __pyx_v_cur_width = 0; /* "pygame_sdl2/display.pyx":264 * * cdef int cur_width = 0 * cdef int cur_height = 0 # <<<<<<<<<<<<<< * * width, height = size */ __pyx_v_cur_height = 0; /* "pygame_sdl2/display.pyx":266 * cdef int cur_height = 0 * * width, height = size # <<<<<<<<<<<<<< * * SDL_GetWindowSize(self.window, &cur_width, &cur_height) */ if ((likely(PyTuple_CheckExact(__pyx_v_size))) || (PyList_CheckExact(__pyx_v_size))) { PyObject* sequence = __pyx_v_size; #if !CYTHON_COMPILING_IN_PYPY Py_ssize_t size = Py_SIZE(sequence); #else Py_ssize_t size = PySequence_Size(sequence); #endif if (unlikely(size != 2)) { if (size > 2) __Pyx_RaiseTooManyValuesError(2); else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); __PYX_ERR(0, 266, __pyx_L1_error) } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS if (likely(PyTuple_CheckExact(sequence))) { __pyx_t_4 = PyTuple_GET_ITEM(sequence, 0); __pyx_t_5 = PyTuple_GET_ITEM(sequence, 1); } else { __pyx_t_4 = PyList_GET_ITEM(sequence, 0); __pyx_t_5 = PyList_GET_ITEM(sequence, 1); } __Pyx_INCREF(__pyx_t_4); __Pyx_INCREF(__pyx_t_5); #else __pyx_t_4 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 266, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_5 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 266, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); #endif } else { Py_ssize_t index = -1; __pyx_t_6 = PyObject_GetIter(__pyx_v_size); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 266, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __pyx_t_7 = Py_TYPE(__pyx_t_6)->tp_iternext; index = 0; __pyx_t_4 = __pyx_t_7(__pyx_t_6); if (unlikely(!__pyx_t_4)) goto __pyx_L6_unpacking_failed; __Pyx_GOTREF(__pyx_t_4); index = 1; __pyx_t_5 = __pyx_t_7(__pyx_t_6); if (unlikely(!__pyx_t_5)) goto __pyx_L6_unpacking_failed; __Pyx_GOTREF(__pyx_t_5); if (__Pyx_IternextUnpackEndCheck(__pyx_t_7(__pyx_t_6), 2) < 0) __PYX_ERR(0, 266, __pyx_L1_error) __pyx_t_7 = NULL; __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; goto __pyx_L7_unpacking_done; __pyx_L6_unpacking_failed:; __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __pyx_t_7 = NULL; if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); __PYX_ERR(0, 266, __pyx_L1_error) __pyx_L7_unpacking_done:; } __pyx_v_width = __pyx_t_4; __pyx_t_4 = 0; __pyx_v_height = __pyx_t_5; __pyx_t_5 = 0; /* "pygame_sdl2/display.pyx":268 * width, height = size * * SDL_GetWindowSize(self.window, &cur_width, &cur_height) # <<<<<<<<<<<<<< * * if (cur_width != width) or (cur_height != height): */ SDL_GetWindowSize(__pyx_v_self->window, (&__pyx_v_cur_width), (&__pyx_v_cur_height)); /* "pygame_sdl2/display.pyx":270 * SDL_GetWindowSize(self.window, &cur_width, &cur_height) * * if (cur_width != width) or (cur_height != height): # <<<<<<<<<<<<<< * SDL_SetWindowSize(self.window, width, height) * */ __pyx_t_5 = __Pyx_PyInt_From_int(__pyx_v_cur_width); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 270, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_4 = PyObject_RichCompare(__pyx_t_5, __pyx_v_width, Py_NE); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 270, __pyx_L1_error) __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(0, 270, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; if (!__pyx_t_3) { } else { __pyx_t_1 = __pyx_t_3; goto __pyx_L9_bool_binop_done; } __pyx_t_4 = __Pyx_PyInt_From_int(__pyx_v_cur_height); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 270, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_5 = PyObject_RichCompare(__pyx_t_4, __pyx_v_height, Py_NE); __Pyx_XGOTREF(__pyx_t_5); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 270, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(0, 270, __pyx_L1_error) __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __pyx_t_1 = __pyx_t_3; __pyx_L9_bool_binop_done:; if (__pyx_t_1) { /* "pygame_sdl2/display.pyx":271 * * if (cur_width != width) or (cur_height != height): * SDL_SetWindowSize(self.window, width, height) # <<<<<<<<<<<<<< * * cdef int w, h */ __pyx_t_8 = __Pyx_PyInt_As_int(__pyx_v_width); if (unlikely((__pyx_t_8 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 271, __pyx_L1_error) __pyx_t_9 = __Pyx_PyInt_As_int(__pyx_v_height); if (unlikely((__pyx_t_9 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 271, __pyx_L1_error) SDL_SetWindowSize(__pyx_v_self->window, __pyx_t_8, __pyx_t_9); /* "pygame_sdl2/display.pyx":270 * SDL_GetWindowSize(self.window, &cur_width, &cur_height) * * if (cur_width != width) or (cur_height != height): # <<<<<<<<<<<<<< * SDL_SetWindowSize(self.window, width, height) * */ } /* "pygame_sdl2/display.pyx":276 * * # Create a missing GL context. * if opengl and not self.gl_context: # <<<<<<<<<<<<<< * self.gl_context = SDL_GL_CreateContext(self.window) * */ __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_v_opengl); if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(0, 276, __pyx_L1_error) if (__pyx_t_3) { } else { __pyx_t_1 = __pyx_t_3; goto __pyx_L12_bool_binop_done; } __pyx_t_3 = ((!(__pyx_v_self->gl_context != 0)) != 0); __pyx_t_1 = __pyx_t_3; __pyx_L12_bool_binop_done:; if (__pyx_t_1) { /* "pygame_sdl2/display.pyx":277 * # Create a missing GL context. * if opengl and not self.gl_context: * self.gl_context = SDL_GL_CreateContext(self.window) # <<<<<<<<<<<<<< * * if self.gl_context == NULL: */ __pyx_v_self->gl_context = SDL_GL_CreateContext(__pyx_v_self->window); /* "pygame_sdl2/display.pyx":279 * self.gl_context = SDL_GL_CreateContext(self.window) * * if self.gl_context == NULL: # <<<<<<<<<<<<<< * raise error() * */ __pyx_t_1 = ((__pyx_v_self->gl_context == NULL) != 0); if (__pyx_t_1) { /* "pygame_sdl2/display.pyx":280 * * if self.gl_context == NULL: * raise error() # <<<<<<<<<<<<<< * * self.create_surface() */ __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_error); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 280, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_6 = NULL; if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_4))) { __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_4); if (likely(__pyx_t_6)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4); __Pyx_INCREF(__pyx_t_6); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_4, function); } } if (__pyx_t_6) { __pyx_t_5 = __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_6); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 280, __pyx_L1_error) __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; } else { __pyx_t_5 = __Pyx_PyObject_CallNoArg(__pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 280, __pyx_L1_error) } __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_Raise(__pyx_t_5, 0, 0, 0); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __PYX_ERR(0, 280, __pyx_L1_error) /* "pygame_sdl2/display.pyx":279 * self.gl_context = SDL_GL_CreateContext(self.window) * * if self.gl_context == NULL: # <<<<<<<<<<<<<< * raise error() * */ } /* "pygame_sdl2/display.pyx":276 * * # Create a missing GL context. * if opengl and not self.gl_context: # <<<<<<<<<<<<<< * self.gl_context = SDL_GL_CreateContext(self.window) * */ } /* "pygame_sdl2/display.pyx":282 * raise error() * * self.create_surface() # <<<<<<<<<<<<<< * * def get_window_flags(self): */ __pyx_t_4 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_create_surface); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 282, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_6 = NULL; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_4))) { __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_4); if (likely(__pyx_t_6)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4); __Pyx_INCREF(__pyx_t_6); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_4, function); } } if (__pyx_t_6) { __pyx_t_5 = __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_6); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 282, __pyx_L1_error) __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; } else { __pyx_t_5 = __Pyx_PyObject_CallNoArg(__pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 282, __pyx_L1_error) } __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; /* "pygame_sdl2/display.pyx":249 * SDL_DestroyWindow(self.window) * * def resize(self, size, opengl=False): # <<<<<<<<<<<<<< * """ * Resizes the window to `size`, which must be a width, height tuple. If opengl */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_5); __Pyx_XDECREF(__pyx_t_6); __Pyx_AddTraceback("pygame_sdl2.display.Window.resize", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF(__pyx_v_width); __Pyx_XDECREF(__pyx_v_height); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/display.pyx":284 * self.create_surface() * * def get_window_flags(self): # <<<<<<<<<<<<<< * rv = SDL_GetWindowFlags(self.window) * */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_7display_6Window_9get_window_flags(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/ static PyObject *__pyx_pw_11pygame_sdl2_7display_6Window_9get_window_flags(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("get_window_flags (wrapper)", 0); __pyx_r = __pyx_pf_11pygame_sdl2_7display_6Window_8get_window_flags(((struct __pyx_obj_11pygame_sdl2_7display_Window *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_7display_6Window_8get_window_flags(struct __pyx_obj_11pygame_sdl2_7display_Window *__pyx_v_self) { PyObject *__pyx_v_rv = NULL; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_t_2; PyObject *__pyx_t_3 = NULL; __Pyx_RefNannySetupContext("get_window_flags", 0); /* "pygame_sdl2/display.pyx":285 * * def get_window_flags(self): * rv = SDL_GetWindowFlags(self.window) # <<<<<<<<<<<<<< * * if self.gl_context: */ __pyx_t_1 = __Pyx_PyInt_From_uint32_t(SDL_GetWindowFlags(__pyx_v_self->window)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 285, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_rv = __pyx_t_1; __pyx_t_1 = 0; /* "pygame_sdl2/display.pyx":287 * rv = SDL_GetWindowFlags(self.window) * * if self.gl_context: # <<<<<<<<<<<<<< * rv |= SDL_WINDOW_OPENGL * else: */ __pyx_t_2 = (__pyx_v_self->gl_context != 0); if (__pyx_t_2) { /* "pygame_sdl2/display.pyx":288 * * if self.gl_context: * rv |= SDL_WINDOW_OPENGL # <<<<<<<<<<<<<< * else: * rv &= ~SDL_WINDOW_OPENGL */ __pyx_t_1 = __Pyx_PyInt_From_SDL_WindowFlags(SDL_WINDOW_OPENGL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 288, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_3 = PyNumber_InPlaceOr(__pyx_v_rv, __pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 288, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF_SET(__pyx_v_rv, __pyx_t_3); __pyx_t_3 = 0; /* "pygame_sdl2/display.pyx":287 * rv = SDL_GetWindowFlags(self.window) * * if self.gl_context: # <<<<<<<<<<<<<< * rv |= SDL_WINDOW_OPENGL * else: */ goto __pyx_L3; } /* "pygame_sdl2/display.pyx":290 * rv |= SDL_WINDOW_OPENGL * else: * rv &= ~SDL_WINDOW_OPENGL # <<<<<<<<<<<<<< * * return rv */ /*else*/ { __pyx_t_3 = __Pyx_PyInt_From_int((~SDL_WINDOW_OPENGL)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 290, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_1 = PyNumber_InPlaceAnd(__pyx_v_rv, __pyx_t_3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 290, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF_SET(__pyx_v_rv, __pyx_t_1); __pyx_t_1 = 0; } __pyx_L3:; /* "pygame_sdl2/display.pyx":292 * rv &= ~SDL_WINDOW_OPENGL * * return rv # <<<<<<<<<<<<<< * * def proxy_window_surface(self): */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(__pyx_v_rv); __pyx_r = __pyx_v_rv; goto __pyx_L0; /* "pygame_sdl2/display.pyx":284 * self.create_surface() * * def get_window_flags(self): # <<<<<<<<<<<<<< * rv = SDL_GetWindowFlags(self.window) * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("pygame_sdl2.display.Window.get_window_flags", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF(__pyx_v_rv); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/display.pyx":294 * return rv * * def proxy_window_surface(self): # <<<<<<<<<<<<<< * SDL_UpperBlit(self.surface.surface, NULL, self.window_surface, NULL) * */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_7display_6Window_11proxy_window_surface(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/ static PyObject *__pyx_pw_11pygame_sdl2_7display_6Window_11proxy_window_surface(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("proxy_window_surface (wrapper)", 0); __pyx_r = __pyx_pf_11pygame_sdl2_7display_6Window_10proxy_window_surface(((struct __pyx_obj_11pygame_sdl2_7display_Window *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_7display_6Window_10proxy_window_surface(struct __pyx_obj_11pygame_sdl2_7display_Window *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("proxy_window_surface", 0); /* "pygame_sdl2/display.pyx":295 * * def proxy_window_surface(self): * SDL_UpperBlit(self.surface.surface, NULL, self.window_surface, NULL) # <<<<<<<<<<<<<< * * def flip(self): */ SDL_UpperBlit(__pyx_v_self->surface->surface, NULL, __pyx_v_self->window_surface, NULL); /* "pygame_sdl2/display.pyx":294 * return rv * * def proxy_window_surface(self): # <<<<<<<<<<<<<< * SDL_UpperBlit(self.surface.surface, NULL, self.window_surface, NULL) * */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/display.pyx":297 * SDL_UpperBlit(self.surface.surface, NULL, self.window_surface, NULL) * * def flip(self): # <<<<<<<<<<<<<< * if self.gl_context != NULL: * with nogil: */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_7display_6Window_13flip(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/ static PyObject *__pyx_pw_11pygame_sdl2_7display_6Window_13flip(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("flip (wrapper)", 0); __pyx_r = __pyx_pf_11pygame_sdl2_7display_6Window_12flip(((struct __pyx_obj_11pygame_sdl2_7display_Window *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_7display_6Window_12flip(struct __pyx_obj_11pygame_sdl2_7display_Window *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; __Pyx_RefNannySetupContext("flip", 0); /* "pygame_sdl2/display.pyx":298 * * def flip(self): * if self.gl_context != NULL: # <<<<<<<<<<<<<< * with nogil: * SDL_GL_SwapWindow(self.window) */ __pyx_t_1 = ((__pyx_v_self->gl_context != NULL) != 0); if (__pyx_t_1) { /* "pygame_sdl2/display.pyx":299 * def flip(self): * if self.gl_context != NULL: * with nogil: # <<<<<<<<<<<<<< * SDL_GL_SwapWindow(self.window) * else: */ { #ifdef WITH_THREAD PyThreadState *_save; Py_UNBLOCK_THREADS __Pyx_FastGIL_Remember(); #endif /*try:*/ { /* "pygame_sdl2/display.pyx":300 * if self.gl_context != NULL: * with nogil: * SDL_GL_SwapWindow(self.window) # <<<<<<<<<<<<<< * else: * */ SDL_GL_SwapWindow(__pyx_v_self->window); } /* "pygame_sdl2/display.pyx":299 * def flip(self): * if self.gl_context != NULL: * with nogil: # <<<<<<<<<<<<<< * SDL_GL_SwapWindow(self.window) * else: */ /*finally:*/ { /*normal exit:*/{ #ifdef WITH_THREAD __Pyx_FastGIL_Forget(); Py_BLOCK_THREADS #endif goto __pyx_L6; } __pyx_L6:; } } /* "pygame_sdl2/display.pyx":298 * * def flip(self): * if self.gl_context != NULL: # <<<<<<<<<<<<<< * with nogil: * SDL_GL_SwapWindow(self.window) */ goto __pyx_L3; } /* "pygame_sdl2/display.pyx":303 * else: * * if self.surface.surface != self.window_surface: # <<<<<<<<<<<<<< * self.proxy_window_surface() * */ /*else*/ { __pyx_t_1 = ((__pyx_v_self->surface->surface != __pyx_v_self->window_surface) != 0); if (__pyx_t_1) { /* "pygame_sdl2/display.pyx":304 * * if self.surface.surface != self.window_surface: * self.proxy_window_surface() # <<<<<<<<<<<<<< * * with nogil: */ __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_proxy_window_surface); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 304, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = NULL; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) { __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3); if (likely(__pyx_t_4)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); __Pyx_INCREF(__pyx_t_4); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_3, function); } } if (__pyx_t_4) { __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 304, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; } else { __pyx_t_2 = __Pyx_PyObject_CallNoArg(__pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 304, __pyx_L1_error) } __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "pygame_sdl2/display.pyx":303 * else: * * if self.surface.surface != self.window_surface: # <<<<<<<<<<<<<< * self.proxy_window_surface() * */ } /* "pygame_sdl2/display.pyx":306 * self.proxy_window_surface() * * with nogil: # <<<<<<<<<<<<<< * SDL_UpdateWindowSurface(self.window) * */ { #ifdef WITH_THREAD PyThreadState *_save; Py_UNBLOCK_THREADS __Pyx_FastGIL_Remember(); #endif /*try:*/ { /* "pygame_sdl2/display.pyx":307 * * with nogil: * SDL_UpdateWindowSurface(self.window) # <<<<<<<<<<<<<< * * def get_surface(self): */ SDL_UpdateWindowSurface(__pyx_v_self->window); } /* "pygame_sdl2/display.pyx":306 * self.proxy_window_surface() * * with nogil: # <<<<<<<<<<<<<< * SDL_UpdateWindowSurface(self.window) * */ /*finally:*/ { /*normal exit:*/{ #ifdef WITH_THREAD __Pyx_FastGIL_Forget(); Py_BLOCK_THREADS #endif goto __pyx_L10; } __pyx_L10:; } } } __pyx_L3:; /* "pygame_sdl2/display.pyx":297 * SDL_UpperBlit(self.surface.surface, NULL, self.window_surface, NULL) * * def flip(self): # <<<<<<<<<<<<<< * if self.gl_context != NULL: * with nogil: */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_AddTraceback("pygame_sdl2.display.Window.flip", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/display.pyx":309 * SDL_UpdateWindowSurface(self.window) * * def get_surface(self): # <<<<<<<<<<<<<< * return self.surface * */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_7display_6Window_15get_surface(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/ static PyObject *__pyx_pw_11pygame_sdl2_7display_6Window_15get_surface(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("get_surface (wrapper)", 0); __pyx_r = __pyx_pf_11pygame_sdl2_7display_6Window_14get_surface(((struct __pyx_obj_11pygame_sdl2_7display_Window *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_7display_6Window_14get_surface(struct __pyx_obj_11pygame_sdl2_7display_Window *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("get_surface", 0); /* "pygame_sdl2/display.pyx":310 * * def get_surface(self): * return self.surface # <<<<<<<<<<<<<< * * def update(self, rectangles=None): */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(((PyObject *)__pyx_v_self->surface)); __pyx_r = ((PyObject *)__pyx_v_self->surface); goto __pyx_L0; /* "pygame_sdl2/display.pyx":309 * SDL_UpdateWindowSurface(self.window) * * def get_surface(self): # <<<<<<<<<<<<<< * return self.surface * */ /* function exit code */ __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/display.pyx":312 * return self.surface * * def update(self, rectangles=None): # <<<<<<<<<<<<<< * * cdef SDL_Rect *rects */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_7display_6Window_17update(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static PyObject *__pyx_pw_11pygame_sdl2_7display_6Window_17update(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_rectangles = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("update (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_rectangles,0}; PyObject* values[1] = {0}; values[0] = ((PyObject *)Py_None); if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (kw_args > 0) { PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_rectangles); if (value) { values[0] = value; kw_args--; } } } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "update") < 0)) __PYX_ERR(0, 312, __pyx_L3_error) } } else { switch (PyTuple_GET_SIZE(__pyx_args)) { case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_rectangles = values[0]; } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("update", 0, 0, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 312, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("pygame_sdl2.display.Window.update", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_11pygame_sdl2_7display_6Window_16update(((struct __pyx_obj_11pygame_sdl2_7display_Window *)__pyx_v_self), __pyx_v_rectangles); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_7display_6Window_16update(struct __pyx_obj_11pygame_sdl2_7display_Window *__pyx_v_self, PyObject *__pyx_v_rectangles) { SDL_Rect *__pyx_v_rects; int __pyx_v_count; PyObject *__pyx_v_i = NULL; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; int __pyx_t_2; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; PyObject *__pyx_t_5 = NULL; Py_ssize_t __pyx_t_6; PyObject *(*__pyx_t_7)(PyObject *); int __pyx_t_8; int __pyx_t_9; char const *__pyx_t_10; PyObject *__pyx_t_11 = NULL; PyObject *__pyx_t_12 = NULL; PyObject *__pyx_t_13 = NULL; PyObject *__pyx_t_14 = NULL; PyObject *__pyx_t_15 = NULL; PyObject *__pyx_t_16 = NULL; __Pyx_RefNannySetupContext("update", 0); __Pyx_INCREF(__pyx_v_rectangles); /* "pygame_sdl2/display.pyx":315 * * cdef SDL_Rect *rects * cdef int count = 0 # <<<<<<<<<<<<<< * * if rectangles is None: */ __pyx_v_count = 0; /* "pygame_sdl2/display.pyx":317 * cdef int count = 0 * * if rectangles is None: # <<<<<<<<<<<<<< * self.flip() * return */ __pyx_t_1 = (__pyx_v_rectangles == Py_None); __pyx_t_2 = (__pyx_t_1 != 0); if (__pyx_t_2) { /* "pygame_sdl2/display.pyx":318 * * if rectangles is None: * self.flip() # <<<<<<<<<<<<<< * return * */ __pyx_t_4 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_flip); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 318, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_5 = NULL; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_4))) { __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4); if (likely(__pyx_t_5)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4); __Pyx_INCREF(__pyx_t_5); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_4, function); } } if (__pyx_t_5) { __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_5); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 318, __pyx_L1_error) __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; } else { __pyx_t_3 = __Pyx_PyObject_CallNoArg(__pyx_t_4); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 318, __pyx_L1_error) } __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "pygame_sdl2/display.pyx":319 * if rectangles is None: * self.flip() * return # <<<<<<<<<<<<<< * * if self.surface.surface != self.window_surface: */ __Pyx_XDECREF(__pyx_r); __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; /* "pygame_sdl2/display.pyx":317 * cdef int count = 0 * * if rectangles is None: # <<<<<<<<<<<<<< * self.flip() * return */ } /* "pygame_sdl2/display.pyx":321 * return * * if self.surface.surface != self.window_surface: # <<<<<<<<<<<<<< * self.proxy_window_surface() * */ __pyx_t_2 = ((__pyx_v_self->surface->surface != __pyx_v_self->window_surface) != 0); if (__pyx_t_2) { /* "pygame_sdl2/display.pyx":322 * * if self.surface.surface != self.window_surface: * self.proxy_window_surface() # <<<<<<<<<<<<<< * * if not isinstance(rectangles, list): */ __pyx_t_4 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_proxy_window_surface); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 322, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_5 = NULL; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_4))) { __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4); if (likely(__pyx_t_5)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4); __Pyx_INCREF(__pyx_t_5); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_4, function); } } if (__pyx_t_5) { __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_5); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 322, __pyx_L1_error) __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; } else { __pyx_t_3 = __Pyx_PyObject_CallNoArg(__pyx_t_4); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 322, __pyx_L1_error) } __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "pygame_sdl2/display.pyx":321 * return * * if self.surface.surface != self.window_surface: # <<<<<<<<<<<<<< * self.proxy_window_surface() * */ } /* "pygame_sdl2/display.pyx":324 * self.proxy_window_surface() * * if not isinstance(rectangles, list): # <<<<<<<<<<<<<< * rectangles = [ rectangles ] * */ __pyx_t_2 = PyList_Check(__pyx_v_rectangles); __pyx_t_1 = ((!(__pyx_t_2 != 0)) != 0); if (__pyx_t_1) { /* "pygame_sdl2/display.pyx":325 * * if not isinstance(rectangles, list): * rectangles = [ rectangles ] # <<<<<<<<<<<<<< * * rects = calloc(len(rectangles), sizeof(SDL_Rect)) */ __pyx_t_3 = PyList_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 325, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_INCREF(__pyx_v_rectangles); __Pyx_GIVEREF(__pyx_v_rectangles); PyList_SET_ITEM(__pyx_t_3, 0, __pyx_v_rectangles); __Pyx_DECREF_SET(__pyx_v_rectangles, __pyx_t_3); __pyx_t_3 = 0; /* "pygame_sdl2/display.pyx":324 * self.proxy_window_surface() * * if not isinstance(rectangles, list): # <<<<<<<<<<<<<< * rectangles = [ rectangles ] * */ } /* "pygame_sdl2/display.pyx":327 * rectangles = [ rectangles ] * * rects = calloc(len(rectangles), sizeof(SDL_Rect)) # <<<<<<<<<<<<<< * if rects == NULL: * raise MemoryError("Couldn't allocate rectangles.") */ __pyx_t_6 = PyObject_Length(__pyx_v_rectangles); if (unlikely(__pyx_t_6 == ((Py_ssize_t)-1))) __PYX_ERR(0, 327, __pyx_L1_error) __pyx_v_rects = ((SDL_Rect *)calloc(__pyx_t_6, (sizeof(SDL_Rect)))); /* "pygame_sdl2/display.pyx":328 * * rects = calloc(len(rectangles), sizeof(SDL_Rect)) * if rects == NULL: # <<<<<<<<<<<<<< * raise MemoryError("Couldn't allocate rectangles.") * */ __pyx_t_1 = ((__pyx_v_rects == NULL) != 0); if (__pyx_t_1) { /* "pygame_sdl2/display.pyx":329 * rects = calloc(len(rectangles), sizeof(SDL_Rect)) * if rects == NULL: * raise MemoryError("Couldn't allocate rectangles.") # <<<<<<<<<<<<<< * * try: */ __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_MemoryError, __pyx_tuple__10, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 329, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_Raise(__pyx_t_3, 0, 0, 0); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __PYX_ERR(0, 329, __pyx_L1_error) /* "pygame_sdl2/display.pyx":328 * * rects = calloc(len(rectangles), sizeof(SDL_Rect)) * if rects == NULL: # <<<<<<<<<<<<<< * raise MemoryError("Couldn't allocate rectangles.") * */ } /* "pygame_sdl2/display.pyx":331 * raise MemoryError("Couldn't allocate rectangles.") * * try: # <<<<<<<<<<<<<< * * for i in rectangles: */ /*try:*/ { /* "pygame_sdl2/display.pyx":333 * try: * * for i in rectangles: # <<<<<<<<<<<<<< * if i is None: * continue */ if (likely(PyList_CheckExact(__pyx_v_rectangles)) || PyTuple_CheckExact(__pyx_v_rectangles)) { __pyx_t_3 = __pyx_v_rectangles; __Pyx_INCREF(__pyx_t_3); __pyx_t_6 = 0; __pyx_t_7 = NULL; } else { __pyx_t_6 = -1; __pyx_t_3 = PyObject_GetIter(__pyx_v_rectangles); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 333, __pyx_L8_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_7 = Py_TYPE(__pyx_t_3)->tp_iternext; if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 333, __pyx_L8_error) } for (;;) { if (likely(!__pyx_t_7)) { if (likely(PyList_CheckExact(__pyx_t_3))) { if (__pyx_t_6 >= PyList_GET_SIZE(__pyx_t_3)) break; #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS __pyx_t_4 = PyList_GET_ITEM(__pyx_t_3, __pyx_t_6); __Pyx_INCREF(__pyx_t_4); __pyx_t_6++; if (unlikely(0 < 0)) __PYX_ERR(0, 333, __pyx_L8_error) #else __pyx_t_4 = PySequence_ITEM(__pyx_t_3, __pyx_t_6); __pyx_t_6++; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 333, __pyx_L8_error) __Pyx_GOTREF(__pyx_t_4); #endif } else { if (__pyx_t_6 >= PyTuple_GET_SIZE(__pyx_t_3)) break; #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS __pyx_t_4 = PyTuple_GET_ITEM(__pyx_t_3, __pyx_t_6); __Pyx_INCREF(__pyx_t_4); __pyx_t_6++; if (unlikely(0 < 0)) __PYX_ERR(0, 333, __pyx_L8_error) #else __pyx_t_4 = PySequence_ITEM(__pyx_t_3, __pyx_t_6); __pyx_t_6++; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 333, __pyx_L8_error) __Pyx_GOTREF(__pyx_t_4); #endif } } else { __pyx_t_4 = __pyx_t_7(__pyx_t_3); if (unlikely(!__pyx_t_4)) { PyObject* exc_type = PyErr_Occurred(); if (exc_type) { if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); else __PYX_ERR(0, 333, __pyx_L8_error) } break; } __Pyx_GOTREF(__pyx_t_4); } __Pyx_XDECREF_SET(__pyx_v_i, __pyx_t_4); __pyx_t_4 = 0; /* "pygame_sdl2/display.pyx":334 * * for i in rectangles: * if i is None: # <<<<<<<<<<<<<< * continue * */ __pyx_t_1 = (__pyx_v_i == Py_None); __pyx_t_2 = (__pyx_t_1 != 0); if (__pyx_t_2) { /* "pygame_sdl2/display.pyx":335 * for i in rectangles: * if i is None: * continue # <<<<<<<<<<<<<< * * to_sdl_rect(i, &rects[count]) */ goto __pyx_L10_continue; /* "pygame_sdl2/display.pyx":334 * * for i in rectangles: * if i is None: # <<<<<<<<<<<<<< * continue * */ } /* "pygame_sdl2/display.pyx":337 * continue * * to_sdl_rect(i, &rects[count]) # <<<<<<<<<<<<<< * count += 1 * */ __pyx_t_8 = __pyx_f_11pygame_sdl2_4rect_to_sdl_rect(__pyx_v_i, (&(__pyx_v_rects[__pyx_v_count])), NULL); if (unlikely(__pyx_t_8 == ((int)-1))) __PYX_ERR(0, 337, __pyx_L8_error) /* "pygame_sdl2/display.pyx":338 * * to_sdl_rect(i, &rects[count]) * count += 1 # <<<<<<<<<<<<<< * * SDL_UpdateWindowSurfaceRects(self.window, rects, count) */ __pyx_v_count = (__pyx_v_count + 1); /* "pygame_sdl2/display.pyx":333 * try: * * for i in rectangles: # <<<<<<<<<<<<<< * if i is None: * continue */ __pyx_L10_continue:; } __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "pygame_sdl2/display.pyx":340 * count += 1 * * SDL_UpdateWindowSurfaceRects(self.window, rects, count) # <<<<<<<<<<<<<< * * finally: */ SDL_UpdateWindowSurfaceRects(__pyx_v_self->window, __pyx_v_rects, __pyx_v_count); } /* "pygame_sdl2/display.pyx":343 * * finally: * free(rects) # <<<<<<<<<<<<<< * * def get_wm_info(self): */ /*finally:*/ { /*normal exit:*/{ free(__pyx_v_rects); goto __pyx_L9; } __pyx_L8_error:; /*exception exit:*/{ __Pyx_PyThreadState_declare __Pyx_PyThreadState_assign __pyx_t_11 = 0; __pyx_t_12 = 0; __pyx_t_13 = 0; __pyx_t_14 = 0; __pyx_t_15 = 0; __pyx_t_16 = 0; __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; if (PY_MAJOR_VERSION >= 3) __Pyx_ExceptionSwap(&__pyx_t_14, &__pyx_t_15, &__pyx_t_16); if ((PY_MAJOR_VERSION < 3) || unlikely(__Pyx_GetException(&__pyx_t_11, &__pyx_t_12, &__pyx_t_13) < 0)) __Pyx_ErrFetch(&__pyx_t_11, &__pyx_t_12, &__pyx_t_13); __Pyx_XGOTREF(__pyx_t_11); __Pyx_XGOTREF(__pyx_t_12); __Pyx_XGOTREF(__pyx_t_13); __Pyx_XGOTREF(__pyx_t_14); __Pyx_XGOTREF(__pyx_t_15); __Pyx_XGOTREF(__pyx_t_16); __pyx_t_8 = __pyx_lineno; __pyx_t_9 = __pyx_clineno; __pyx_t_10 = __pyx_filename; { free(__pyx_v_rects); } if (PY_MAJOR_VERSION >= 3) { __Pyx_XGIVEREF(__pyx_t_14); __Pyx_XGIVEREF(__pyx_t_15); __Pyx_XGIVEREF(__pyx_t_16); __Pyx_ExceptionReset(__pyx_t_14, __pyx_t_15, __pyx_t_16); } __Pyx_XGIVEREF(__pyx_t_11); __Pyx_XGIVEREF(__pyx_t_12); __Pyx_XGIVEREF(__pyx_t_13); __Pyx_ErrRestore(__pyx_t_11, __pyx_t_12, __pyx_t_13); __pyx_t_11 = 0; __pyx_t_12 = 0; __pyx_t_13 = 0; __pyx_t_14 = 0; __pyx_t_15 = 0; __pyx_t_16 = 0; __pyx_lineno = __pyx_t_8; __pyx_clineno = __pyx_t_9; __pyx_filename = __pyx_t_10; goto __pyx_L1_error; } __pyx_L9:; } /* "pygame_sdl2/display.pyx":312 * return self.surface * * def update(self, rectangles=None): # <<<<<<<<<<<<<< * * cdef SDL_Rect *rects */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_5); __Pyx_AddTraceback("pygame_sdl2.display.Window.update", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF(__pyx_v_i); __Pyx_XDECREF(__pyx_v_rectangles); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/display.pyx":345 * free(rects) * * def get_wm_info(self): # <<<<<<<<<<<<<< * return { } * */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_7display_6Window_19get_wm_info(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/ static PyObject *__pyx_pw_11pygame_sdl2_7display_6Window_19get_wm_info(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("get_wm_info (wrapper)", 0); __pyx_r = __pyx_pf_11pygame_sdl2_7display_6Window_18get_wm_info(((struct __pyx_obj_11pygame_sdl2_7display_Window *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_7display_6Window_18get_wm_info(CYTHON_UNUSED struct __pyx_obj_11pygame_sdl2_7display_Window *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; __Pyx_RefNannySetupContext("get_wm_info", 0); /* "pygame_sdl2/display.pyx":346 * * def get_wm_info(self): * return { } # <<<<<<<<<<<<<< * * def get_active(self): */ __Pyx_XDECREF(__pyx_r); __pyx_t_1 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 346, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "pygame_sdl2/display.pyx":345 * free(rects) * * def get_wm_info(self): # <<<<<<<<<<<<<< * return { } * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("pygame_sdl2.display.Window.get_wm_info", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/display.pyx":348 * return { } * * def get_active(self): # <<<<<<<<<<<<<< * if SDL_GetWindowFlags(self.window) & (SDL_WINDOW_HIDDEN | SDL_WINDOW_MINIMIZED): * return False */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_7display_6Window_21get_active(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/ static PyObject *__pyx_pw_11pygame_sdl2_7display_6Window_21get_active(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("get_active (wrapper)", 0); __pyx_r = __pyx_pf_11pygame_sdl2_7display_6Window_20get_active(((struct __pyx_obj_11pygame_sdl2_7display_Window *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_7display_6Window_20get_active(struct __pyx_obj_11pygame_sdl2_7display_Window *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; __Pyx_RefNannySetupContext("get_active", 0); /* "pygame_sdl2/display.pyx":349 * * def get_active(self): * if SDL_GetWindowFlags(self.window) & (SDL_WINDOW_HIDDEN | SDL_WINDOW_MINIMIZED): # <<<<<<<<<<<<<< * return False * else: */ __pyx_t_1 = ((SDL_GetWindowFlags(__pyx_v_self->window) & (SDL_WINDOW_HIDDEN | SDL_WINDOW_MINIMIZED)) != 0); if (__pyx_t_1) { /* "pygame_sdl2/display.pyx":350 * def get_active(self): * if SDL_GetWindowFlags(self.window) & (SDL_WINDOW_HIDDEN | SDL_WINDOW_MINIMIZED): * return False # <<<<<<<<<<<<<< * else: * return True */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(Py_False); __pyx_r = Py_False; goto __pyx_L0; /* "pygame_sdl2/display.pyx":349 * * def get_active(self): * if SDL_GetWindowFlags(self.window) & (SDL_WINDOW_HIDDEN | SDL_WINDOW_MINIMIZED): # <<<<<<<<<<<<<< * return False * else: */ } /* "pygame_sdl2/display.pyx":352 * return False * else: * return True # <<<<<<<<<<<<<< * * def iconify(self): */ /*else*/ { __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(Py_True); __pyx_r = Py_True; goto __pyx_L0; } /* "pygame_sdl2/display.pyx":348 * return { } * * def get_active(self): # <<<<<<<<<<<<<< * if SDL_GetWindowFlags(self.window) & (SDL_WINDOW_HIDDEN | SDL_WINDOW_MINIMIZED): * return False */ /* function exit code */ __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/display.pyx":354 * return True * * def iconify(self): # <<<<<<<<<<<<<< * SDL_MinimizeWindow(self.window) * return True */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_7display_6Window_23iconify(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/ static PyObject *__pyx_pw_11pygame_sdl2_7display_6Window_23iconify(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("iconify (wrapper)", 0); __pyx_r = __pyx_pf_11pygame_sdl2_7display_6Window_22iconify(((struct __pyx_obj_11pygame_sdl2_7display_Window *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_7display_6Window_22iconify(struct __pyx_obj_11pygame_sdl2_7display_Window *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("iconify", 0); /* "pygame_sdl2/display.pyx":355 * * def iconify(self): * SDL_MinimizeWindow(self.window) # <<<<<<<<<<<<<< * return True * */ SDL_MinimizeWindow(__pyx_v_self->window); /* "pygame_sdl2/display.pyx":356 * def iconify(self): * SDL_MinimizeWindow(self.window) * return True # <<<<<<<<<<<<<< * * def toggle_fullscreen(self): */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(Py_True); __pyx_r = Py_True; goto __pyx_L0; /* "pygame_sdl2/display.pyx":354 * return True * * def iconify(self): # <<<<<<<<<<<<<< * SDL_MinimizeWindow(self.window) * return True */ /* function exit code */ __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/display.pyx":358 * return True * * def toggle_fullscreen(self): # <<<<<<<<<<<<<< * if SDL_GetWindowFlags(self.window) & (SDL_WINDOW_FULLSCREEN_DESKTOP): * if SDL_SetWindowFullscreen(self.window, 0): */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_7display_6Window_25toggle_fullscreen(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/ static PyObject *__pyx_pw_11pygame_sdl2_7display_6Window_25toggle_fullscreen(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("toggle_fullscreen (wrapper)", 0); __pyx_r = __pyx_pf_11pygame_sdl2_7display_6Window_24toggle_fullscreen(((struct __pyx_obj_11pygame_sdl2_7display_Window *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_7display_6Window_24toggle_fullscreen(struct __pyx_obj_11pygame_sdl2_7display_Window *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; __Pyx_RefNannySetupContext("toggle_fullscreen", 0); /* "pygame_sdl2/display.pyx":359 * * def toggle_fullscreen(self): * if SDL_GetWindowFlags(self.window) & (SDL_WINDOW_FULLSCREEN_DESKTOP): # <<<<<<<<<<<<<< * if SDL_SetWindowFullscreen(self.window, 0): * raise error() */ __pyx_t_1 = ((SDL_GetWindowFlags(__pyx_v_self->window) & SDL_WINDOW_FULLSCREEN_DESKTOP) != 0); if (__pyx_t_1) { /* "pygame_sdl2/display.pyx":360 * def toggle_fullscreen(self): * if SDL_GetWindowFlags(self.window) & (SDL_WINDOW_FULLSCREEN_DESKTOP): * if SDL_SetWindowFullscreen(self.window, 0): # <<<<<<<<<<<<<< * raise error() * else: */ __pyx_t_1 = (SDL_SetWindowFullscreen(__pyx_v_self->window, 0) != 0); if (__pyx_t_1) { /* "pygame_sdl2/display.pyx":361 * if SDL_GetWindowFlags(self.window) & (SDL_WINDOW_FULLSCREEN_DESKTOP): * if SDL_SetWindowFullscreen(self.window, 0): * raise error() # <<<<<<<<<<<<<< * else: * if SDL_SetWindowFullscreen(self.window, SDL_WINDOW_FULLSCREEN_DESKTOP): */ __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_error); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 361, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = NULL; if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) { __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3); if (likely(__pyx_t_4)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); __Pyx_INCREF(__pyx_t_4); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_3, function); } } if (__pyx_t_4) { __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 361, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; } else { __pyx_t_2 = __Pyx_PyObject_CallNoArg(__pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 361, __pyx_L1_error) } __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_Raise(__pyx_t_2, 0, 0, 0); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __PYX_ERR(0, 361, __pyx_L1_error) /* "pygame_sdl2/display.pyx":360 * def toggle_fullscreen(self): * if SDL_GetWindowFlags(self.window) & (SDL_WINDOW_FULLSCREEN_DESKTOP): * if SDL_SetWindowFullscreen(self.window, 0): # <<<<<<<<<<<<<< * raise error() * else: */ } /* "pygame_sdl2/display.pyx":359 * * def toggle_fullscreen(self): * if SDL_GetWindowFlags(self.window) & (SDL_WINDOW_FULLSCREEN_DESKTOP): # <<<<<<<<<<<<<< * if SDL_SetWindowFullscreen(self.window, 0): * raise error() */ goto __pyx_L3; } /* "pygame_sdl2/display.pyx":363 * raise error() * else: * if SDL_SetWindowFullscreen(self.window, SDL_WINDOW_FULLSCREEN_DESKTOP): # <<<<<<<<<<<<<< * raise error() * */ /*else*/ { __pyx_t_1 = (SDL_SetWindowFullscreen(__pyx_v_self->window, SDL_WINDOW_FULLSCREEN_DESKTOP) != 0); if (__pyx_t_1) { /* "pygame_sdl2/display.pyx":364 * else: * if SDL_SetWindowFullscreen(self.window, SDL_WINDOW_FULLSCREEN_DESKTOP): * raise error() # <<<<<<<<<<<<<< * * return True */ __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_error); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 364, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = NULL; if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) { __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3); if (likely(__pyx_t_4)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); __Pyx_INCREF(__pyx_t_4); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_3, function); } } if (__pyx_t_4) { __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 364, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; } else { __pyx_t_2 = __Pyx_PyObject_CallNoArg(__pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 364, __pyx_L1_error) } __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_Raise(__pyx_t_2, 0, 0, 0); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __PYX_ERR(0, 364, __pyx_L1_error) /* "pygame_sdl2/display.pyx":363 * raise error() * else: * if SDL_SetWindowFullscreen(self.window, SDL_WINDOW_FULLSCREEN_DESKTOP): # <<<<<<<<<<<<<< * raise error() * */ } } __pyx_L3:; /* "pygame_sdl2/display.pyx":366 * raise error() * * return True # <<<<<<<<<<<<<< * * def set_gamma(self, red, green=None, blue=None): */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(Py_True); __pyx_r = Py_True; goto __pyx_L0; /* "pygame_sdl2/display.pyx":358 * return True * * def toggle_fullscreen(self): # <<<<<<<<<<<<<< * if SDL_GetWindowFlags(self.window) & (SDL_WINDOW_FULLSCREEN_DESKTOP): * if SDL_SetWindowFullscreen(self.window, 0): */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_AddTraceback("pygame_sdl2.display.Window.toggle_fullscreen", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/display.pyx":368 * return True * * def set_gamma(self, red, green=None, blue=None): # <<<<<<<<<<<<<< * if green is None: * green = red */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_7display_6Window_27set_gamma(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static PyObject *__pyx_pw_11pygame_sdl2_7display_6Window_27set_gamma(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_red = 0; PyObject *__pyx_v_green = 0; PyObject *__pyx_v_blue = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("set_gamma (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_red,&__pyx_n_s_green,&__pyx_n_s_blue,0}; PyObject* values[3] = {0,0,0}; values[1] = ((PyObject *)Py_None); values[2] = ((PyObject *)Py_None); if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_red)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (kw_args > 0) { PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_green); if (value) { values[1] = value; kw_args--; } } CYTHON_FALLTHROUGH; case 2: if (kw_args > 0) { PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_blue); if (value) { values[2] = value; kw_args--; } } } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "set_gamma") < 0)) __PYX_ERR(0, 368, __pyx_L3_error) } } else { switch (PyTuple_GET_SIZE(__pyx_args)) { case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_red = values[0]; __pyx_v_green = values[1]; __pyx_v_blue = values[2]; } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("set_gamma", 0, 1, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 368, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("pygame_sdl2.display.Window.set_gamma", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_11pygame_sdl2_7display_6Window_26set_gamma(((struct __pyx_obj_11pygame_sdl2_7display_Window *)__pyx_v_self), __pyx_v_red, __pyx_v_green, __pyx_v_blue); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_7display_6Window_26set_gamma(struct __pyx_obj_11pygame_sdl2_7display_Window *__pyx_v_self, PyObject *__pyx_v_red, PyObject *__pyx_v_green, PyObject *__pyx_v_blue) { Uint16 __pyx_v_red_gamma[0x100]; Uint16 __pyx_v_green_gamma[0x100]; Uint16 __pyx_v_blue_gamma[0x100]; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; int __pyx_t_2; float __pyx_t_3; __Pyx_RefNannySetupContext("set_gamma", 0); __Pyx_INCREF(__pyx_v_green); __Pyx_INCREF(__pyx_v_blue); /* "pygame_sdl2/display.pyx":369 * * def set_gamma(self, red, green=None, blue=None): * if green is None: # <<<<<<<<<<<<<< * green = red * if blue is None: */ __pyx_t_1 = (__pyx_v_green == Py_None); __pyx_t_2 = (__pyx_t_1 != 0); if (__pyx_t_2) { /* "pygame_sdl2/display.pyx":370 * def set_gamma(self, red, green=None, blue=None): * if green is None: * green = red # <<<<<<<<<<<<<< * if blue is None: * blue = red */ __Pyx_INCREF(__pyx_v_red); __Pyx_DECREF_SET(__pyx_v_green, __pyx_v_red); /* "pygame_sdl2/display.pyx":369 * * def set_gamma(self, red, green=None, blue=None): * if green is None: # <<<<<<<<<<<<<< * green = red * if blue is None: */ } /* "pygame_sdl2/display.pyx":371 * if green is None: * green = red * if blue is None: # <<<<<<<<<<<<<< * blue = red * */ __pyx_t_2 = (__pyx_v_blue == Py_None); __pyx_t_1 = (__pyx_t_2 != 0); if (__pyx_t_1) { /* "pygame_sdl2/display.pyx":372 * green = red * if blue is None: * blue = red # <<<<<<<<<<<<<< * * cdef Uint16 red_gamma[256] */ __Pyx_INCREF(__pyx_v_red); __Pyx_DECREF_SET(__pyx_v_blue, __pyx_v_red); /* "pygame_sdl2/display.pyx":371 * if green is None: * green = red * if blue is None: # <<<<<<<<<<<<<< * blue = red * */ } /* "pygame_sdl2/display.pyx":378 * cdef Uint16 blue_gamma[256] * * SDL_CalculateGammaRamp(red, red_gamma) # <<<<<<<<<<<<<< * SDL_CalculateGammaRamp(green, green_gamma) * SDL_CalculateGammaRamp(blue, blue_gamma) */ __pyx_t_3 = __pyx_PyFloat_AsFloat(__pyx_v_red); if (unlikely((__pyx_t_3 == (float)-1) && PyErr_Occurred())) __PYX_ERR(0, 378, __pyx_L1_error) SDL_CalculateGammaRamp(__pyx_t_3, __pyx_v_red_gamma); /* "pygame_sdl2/display.pyx":379 * * SDL_CalculateGammaRamp(red, red_gamma) * SDL_CalculateGammaRamp(green, green_gamma) # <<<<<<<<<<<<<< * SDL_CalculateGammaRamp(blue, blue_gamma) * */ __pyx_t_3 = __pyx_PyFloat_AsFloat(__pyx_v_green); if (unlikely((__pyx_t_3 == (float)-1) && PyErr_Occurred())) __PYX_ERR(0, 379, __pyx_L1_error) SDL_CalculateGammaRamp(__pyx_t_3, __pyx_v_green_gamma); /* "pygame_sdl2/display.pyx":380 * SDL_CalculateGammaRamp(red, red_gamma) * SDL_CalculateGammaRamp(green, green_gamma) * SDL_CalculateGammaRamp(blue, blue_gamma) # <<<<<<<<<<<<<< * * if SDL_SetWindowGammaRamp(self.window, red_gamma, green_gamma, blue_gamma): */ __pyx_t_3 = __pyx_PyFloat_AsFloat(__pyx_v_blue); if (unlikely((__pyx_t_3 == (float)-1) && PyErr_Occurred())) __PYX_ERR(0, 380, __pyx_L1_error) SDL_CalculateGammaRamp(__pyx_t_3, __pyx_v_blue_gamma); /* "pygame_sdl2/display.pyx":382 * SDL_CalculateGammaRamp(blue, blue_gamma) * * if SDL_SetWindowGammaRamp(self.window, red_gamma, green_gamma, blue_gamma): # <<<<<<<<<<<<<< * return False * */ __pyx_t_1 = (SDL_SetWindowGammaRamp(__pyx_v_self->window, __pyx_v_red_gamma, __pyx_v_green_gamma, __pyx_v_blue_gamma) != 0); if (__pyx_t_1) { /* "pygame_sdl2/display.pyx":383 * * if SDL_SetWindowGammaRamp(self.window, red_gamma, green_gamma, blue_gamma): * return False # <<<<<<<<<<<<<< * * return True */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(Py_False); __pyx_r = Py_False; goto __pyx_L0; /* "pygame_sdl2/display.pyx":382 * SDL_CalculateGammaRamp(blue, blue_gamma) * * if SDL_SetWindowGammaRamp(self.window, red_gamma, green_gamma, blue_gamma): # <<<<<<<<<<<<<< * return False * */ } /* "pygame_sdl2/display.pyx":385 * return False * * return True # <<<<<<<<<<<<<< * * def set_gamma_ramp(self, red, green, blue): */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(Py_True); __pyx_r = Py_True; goto __pyx_L0; /* "pygame_sdl2/display.pyx":368 * return True * * def set_gamma(self, red, green=None, blue=None): # <<<<<<<<<<<<<< * if green is None: * green = red */ /* function exit code */ __pyx_L1_error:; __Pyx_AddTraceback("pygame_sdl2.display.Window.set_gamma", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF(__pyx_v_green); __Pyx_XDECREF(__pyx_v_blue); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/display.pyx":387 * return True * * def set_gamma_ramp(self, red, green, blue): # <<<<<<<<<<<<<< * * cdef Uint16 red_gamma[256] */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_7display_6Window_29set_gamma_ramp(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static PyObject *__pyx_pw_11pygame_sdl2_7display_6Window_29set_gamma_ramp(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_red = 0; PyObject *__pyx_v_green = 0; PyObject *__pyx_v_blue = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("set_gamma_ramp (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_red,&__pyx_n_s_green,&__pyx_n_s_blue,0}; PyObject* values[3] = {0,0,0}; if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_red)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_green)) != 0)) kw_args--; else { __Pyx_RaiseArgtupleInvalid("set_gamma_ramp", 1, 3, 3, 1); __PYX_ERR(0, 387, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 2: if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_blue)) != 0)) kw_args--; else { __Pyx_RaiseArgtupleInvalid("set_gamma_ramp", 1, 3, 3, 2); __PYX_ERR(0, 387, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "set_gamma_ramp") < 0)) __PYX_ERR(0, 387, __pyx_L3_error) } } else if (PyTuple_GET_SIZE(__pyx_args) != 3) { goto __pyx_L5_argtuple_error; } else { values[0] = PyTuple_GET_ITEM(__pyx_args, 0); values[1] = PyTuple_GET_ITEM(__pyx_args, 1); values[2] = PyTuple_GET_ITEM(__pyx_args, 2); } __pyx_v_red = values[0]; __pyx_v_green = values[1]; __pyx_v_blue = values[2]; } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("set_gamma_ramp", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 387, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("pygame_sdl2.display.Window.set_gamma_ramp", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_11pygame_sdl2_7display_6Window_28set_gamma_ramp(((struct __pyx_obj_11pygame_sdl2_7display_Window *)__pyx_v_self), __pyx_v_red, __pyx_v_green, __pyx_v_blue); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_7display_6Window_28set_gamma_ramp(struct __pyx_obj_11pygame_sdl2_7display_Window *__pyx_v_self, PyObject *__pyx_v_red, PyObject *__pyx_v_green, PyObject *__pyx_v_blue) { Uint16 __pyx_v_red_gamma[0x100]; Uint16 __pyx_v_green_gamma[0x100]; Uint16 __pyx_v_blue_gamma[0x100]; long __pyx_v_i; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations long __pyx_t_1; PyObject *__pyx_t_2 = NULL; Uint16 __pyx_t_3; int __pyx_t_4; __Pyx_RefNannySetupContext("set_gamma_ramp", 0); /* "pygame_sdl2/display.pyx":393 * cdef Uint16 blue_gamma[256] * * for i in range(256): # <<<<<<<<<<<<<< * red_gamma[i] = red[i] * green_gamma[i] = green[i] */ for (__pyx_t_1 = 0; __pyx_t_1 < 0x100; __pyx_t_1+=1) { __pyx_v_i = __pyx_t_1; /* "pygame_sdl2/display.pyx":394 * * for i in range(256): * red_gamma[i] = red[i] # <<<<<<<<<<<<<< * green_gamma[i] = green[i] * blue_gamma[i] = blue[i] */ __pyx_t_2 = __Pyx_GetItemInt(__pyx_v_red, __pyx_v_i, long, 1, __Pyx_PyInt_From_long, 0, 1, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 394, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = __Pyx_PyInt_As_uint16_t(__pyx_t_2); if (unlikely((__pyx_t_3 == ((Uint16)-1)) && PyErr_Occurred())) __PYX_ERR(0, 394, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; (__pyx_v_red_gamma[__pyx_v_i]) = __pyx_t_3; /* "pygame_sdl2/display.pyx":395 * for i in range(256): * red_gamma[i] = red[i] * green_gamma[i] = green[i] # <<<<<<<<<<<<<< * blue_gamma[i] = blue[i] * */ __pyx_t_2 = __Pyx_GetItemInt(__pyx_v_green, __pyx_v_i, long, 1, __Pyx_PyInt_From_long, 0, 1, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 395, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = __Pyx_PyInt_As_uint16_t(__pyx_t_2); if (unlikely((__pyx_t_3 == ((Uint16)-1)) && PyErr_Occurred())) __PYX_ERR(0, 395, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; (__pyx_v_green_gamma[__pyx_v_i]) = __pyx_t_3; /* "pygame_sdl2/display.pyx":396 * red_gamma[i] = red[i] * green_gamma[i] = green[i] * blue_gamma[i] = blue[i] # <<<<<<<<<<<<<< * * if SDL_SetWindowGammaRamp(self.window, red_gamma, green_gamma, blue_gamma): */ __pyx_t_2 = __Pyx_GetItemInt(__pyx_v_blue, __pyx_v_i, long, 1, __Pyx_PyInt_From_long, 0, 1, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 396, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = __Pyx_PyInt_As_uint16_t(__pyx_t_2); if (unlikely((__pyx_t_3 == ((Uint16)-1)) && PyErr_Occurred())) __PYX_ERR(0, 396, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; (__pyx_v_blue_gamma[__pyx_v_i]) = __pyx_t_3; } /* "pygame_sdl2/display.pyx":398 * blue_gamma[i] = blue[i] * * if SDL_SetWindowGammaRamp(self.window, red_gamma, green_gamma, blue_gamma): # <<<<<<<<<<<<<< * return False * */ __pyx_t_4 = (SDL_SetWindowGammaRamp(__pyx_v_self->window, __pyx_v_red_gamma, __pyx_v_green_gamma, __pyx_v_blue_gamma) != 0); if (__pyx_t_4) { /* "pygame_sdl2/display.pyx":399 * * if SDL_SetWindowGammaRamp(self.window, red_gamma, green_gamma, blue_gamma): * return False # <<<<<<<<<<<<<< * * return True */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(Py_False); __pyx_r = Py_False; goto __pyx_L0; /* "pygame_sdl2/display.pyx":398 * blue_gamma[i] = blue[i] * * if SDL_SetWindowGammaRamp(self.window, red_gamma, green_gamma, blue_gamma): # <<<<<<<<<<<<<< * return False * */ } /* "pygame_sdl2/display.pyx":401 * return False * * return True # <<<<<<<<<<<<<< * * def set_icon(self, Surface surface): */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(Py_True); __pyx_r = Py_True; goto __pyx_L0; /* "pygame_sdl2/display.pyx":387 * return True * * def set_gamma_ramp(self, red, green, blue): # <<<<<<<<<<<<<< * * cdef Uint16 red_gamma[256] */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_AddTraceback("pygame_sdl2.display.Window.set_gamma_ramp", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/display.pyx":403 * return True * * def set_icon(self, Surface surface): # <<<<<<<<<<<<<< * SDL_SetWindowIcon(self.window, surface.surface) * */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_7display_6Window_31set_icon(PyObject *__pyx_v_self, PyObject *__pyx_v_surface); /*proto*/ static PyObject *__pyx_pw_11pygame_sdl2_7display_6Window_31set_icon(PyObject *__pyx_v_self, PyObject *__pyx_v_surface) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("set_icon (wrapper)", 0); if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_surface), __pyx_ptype_11pygame_sdl2_7surface_Surface, 1, "surface", 0))) __PYX_ERR(0, 403, __pyx_L1_error) __pyx_r = __pyx_pf_11pygame_sdl2_7display_6Window_30set_icon(((struct __pyx_obj_11pygame_sdl2_7display_Window *)__pyx_v_self), ((struct __pyx_obj_11pygame_sdl2_7surface_Surface *)__pyx_v_surface)); /* function exit code */ goto __pyx_L0; __pyx_L1_error:; __pyx_r = NULL; __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_7display_6Window_30set_icon(struct __pyx_obj_11pygame_sdl2_7display_Window *__pyx_v_self, struct __pyx_obj_11pygame_sdl2_7surface_Surface *__pyx_v_surface) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("set_icon", 0); /* "pygame_sdl2/display.pyx":404 * * def set_icon(self, Surface surface): * SDL_SetWindowIcon(self.window, surface.surface) # <<<<<<<<<<<<<< * * def set_caption(self, title): */ SDL_SetWindowIcon(__pyx_v_self->window, __pyx_v_surface->surface); /* "pygame_sdl2/display.pyx":403 * return True * * def set_icon(self, Surface surface): # <<<<<<<<<<<<<< * SDL_SetWindowIcon(self.window, surface.surface) * */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/display.pyx":406 * SDL_SetWindowIcon(self.window, surface.surface) * * def set_caption(self, title): # <<<<<<<<<<<<<< * * if not isinstance(title, bytes): */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_7display_6Window_33set_caption(PyObject *__pyx_v_self, PyObject *__pyx_v_title); /*proto*/ static PyObject *__pyx_pw_11pygame_sdl2_7display_6Window_33set_caption(PyObject *__pyx_v_self, PyObject *__pyx_v_title) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("set_caption (wrapper)", 0); __pyx_r = __pyx_pf_11pygame_sdl2_7display_6Window_32set_caption(((struct __pyx_obj_11pygame_sdl2_7display_Window *)__pyx_v_self), ((PyObject *)__pyx_v_title)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_7display_6Window_32set_caption(struct __pyx_obj_11pygame_sdl2_7display_Window *__pyx_v_self, PyObject *__pyx_v_title) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; int __pyx_t_2; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; char const *__pyx_t_5; __Pyx_RefNannySetupContext("set_caption", 0); __Pyx_INCREF(__pyx_v_title); /* "pygame_sdl2/display.pyx":408 * def set_caption(self, title): * * if not isinstance(title, bytes): # <<<<<<<<<<<<<< * title = title.encode("utf-8") * */ __pyx_t_1 = PyBytes_Check(__pyx_v_title); __pyx_t_2 = ((!(__pyx_t_1 != 0)) != 0); if (__pyx_t_2) { /* "pygame_sdl2/display.pyx":409 * * if not isinstance(title, bytes): * title = title.encode("utf-8") # <<<<<<<<<<<<<< * * SDL_SetWindowTitle(self.window, title) */ __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_title, __pyx_n_s_encode); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 409, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_tuple__11, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 409, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF_SET(__pyx_v_title, __pyx_t_4); __pyx_t_4 = 0; /* "pygame_sdl2/display.pyx":408 * def set_caption(self, title): * * if not isinstance(title, bytes): # <<<<<<<<<<<<<< * title = title.encode("utf-8") * */ } /* "pygame_sdl2/display.pyx":411 * title = title.encode("utf-8") * * SDL_SetWindowTitle(self.window, title) # <<<<<<<<<<<<<< * * def get_drawable_size(self): */ __pyx_t_5 = __Pyx_PyObject_AsString(__pyx_v_title); if (unlikely((!__pyx_t_5) && PyErr_Occurred())) __PYX_ERR(0, 411, __pyx_L1_error) SDL_SetWindowTitle(__pyx_v_self->window, __pyx_t_5); /* "pygame_sdl2/display.pyx":406 * SDL_SetWindowIcon(self.window, surface.surface) * * def set_caption(self, title): # <<<<<<<<<<<<<< * * if not isinstance(title, bytes): */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_AddTraceback("pygame_sdl2.display.Window.set_caption", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF(__pyx_v_title); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/display.pyx":413 * SDL_SetWindowTitle(self.window, title) * * def get_drawable_size(self): # <<<<<<<<<<<<<< * cdef int w, h * */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_7display_6Window_35get_drawable_size(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/ static PyObject *__pyx_pw_11pygame_sdl2_7display_6Window_35get_drawable_size(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("get_drawable_size (wrapper)", 0); __pyx_r = __pyx_pf_11pygame_sdl2_7display_6Window_34get_drawable_size(((struct __pyx_obj_11pygame_sdl2_7display_Window *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_7display_6Window_34get_drawable_size(struct __pyx_obj_11pygame_sdl2_7display_Window *__pyx_v_self) { int __pyx_v_w; int __pyx_v_h; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; __Pyx_RefNannySetupContext("get_drawable_size", 0); /* "pygame_sdl2/display.pyx":416 * cdef int w, h * * SDL_GL_GetDrawableSize(self.window, &w, &h) # <<<<<<<<<<<<<< * return w, h * */ SDL_GL_GetDrawableSize(__pyx_v_self->window, (&__pyx_v_w), (&__pyx_v_h)); /* "pygame_sdl2/display.pyx":417 * * SDL_GL_GetDrawableSize(self.window, &w, &h) * return w, h # <<<<<<<<<<<<<< * * # The icon that's used for new windows. */ __Pyx_XDECREF(__pyx_r); __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_w); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 417, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_v_h); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 417, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 417, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_GIVEREF(__pyx_t_1); PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_1); __Pyx_GIVEREF(__pyx_t_2); PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_2); __pyx_t_1 = 0; __pyx_t_2 = 0; __pyx_r = __pyx_t_3; __pyx_t_3 = 0; goto __pyx_L0; /* "pygame_sdl2/display.pyx":413 * SDL_SetWindowTitle(self.window, title) * * def get_drawable_size(self): # <<<<<<<<<<<<<< * cdef int w, h * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("pygame_sdl2.display.Window.get_drawable_size", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/display.pxd":29 * cdef SDL_Window *window * cdef SDL_Surface *window_surface * cdef public Surface surface # <<<<<<<<<<<<<< * * # The OpenGL context corresponding to this window. */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_7display_6Window_7surface_1__get__(PyObject *__pyx_v_self); /*proto*/ static PyObject *__pyx_pw_11pygame_sdl2_7display_6Window_7surface_1__get__(PyObject *__pyx_v_self) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); __pyx_r = __pyx_pf_11pygame_sdl2_7display_6Window_7surface___get__(((struct __pyx_obj_11pygame_sdl2_7display_Window *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_7display_6Window_7surface___get__(struct __pyx_obj_11pygame_sdl2_7display_Window *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__get__", 0); __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(((PyObject *)__pyx_v_self->surface)); __pyx_r = ((PyObject *)__pyx_v_self->surface); goto __pyx_L0; /* function exit code */ __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* Python wrapper */ static int __pyx_pw_11pygame_sdl2_7display_6Window_7surface_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/ static int __pyx_pw_11pygame_sdl2_7display_6Window_7surface_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) { int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__set__ (wrapper)", 0); __pyx_r = __pyx_pf_11pygame_sdl2_7display_6Window_7surface_2__set__(((struct __pyx_obj_11pygame_sdl2_7display_Window *)__pyx_v_self), ((PyObject *)__pyx_v_value)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static int __pyx_pf_11pygame_sdl2_7display_6Window_7surface_2__set__(struct __pyx_obj_11pygame_sdl2_7display_Window *__pyx_v_self, PyObject *__pyx_v_value) { int __pyx_r; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; __Pyx_RefNannySetupContext("__set__", 0); if (!(likely(((__pyx_v_value) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_value, __pyx_ptype_11pygame_sdl2_7surface_Surface))))) __PYX_ERR(2, 29, __pyx_L1_error) __pyx_t_1 = __pyx_v_value; __Pyx_INCREF(__pyx_t_1); __Pyx_GIVEREF(__pyx_t_1); __Pyx_GOTREF(__pyx_v_self->surface); __Pyx_DECREF(((PyObject *)__pyx_v_self->surface)); __pyx_v_self->surface = ((struct __pyx_obj_11pygame_sdl2_7surface_Surface *)__pyx_t_1); __pyx_t_1 = 0; /* function exit code */ __pyx_r = 0; goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("pygame_sdl2.display.Window.surface.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = -1; __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; } /* Python wrapper */ static int __pyx_pw_11pygame_sdl2_7display_6Window_7surface_5__del__(PyObject *__pyx_v_self); /*proto*/ static int __pyx_pw_11pygame_sdl2_7display_6Window_7surface_5__del__(PyObject *__pyx_v_self) { int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__del__ (wrapper)", 0); __pyx_r = __pyx_pf_11pygame_sdl2_7display_6Window_7surface_4__del__(((struct __pyx_obj_11pygame_sdl2_7display_Window *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static int __pyx_pf_11pygame_sdl2_7display_6Window_7surface_4__del__(struct __pyx_obj_11pygame_sdl2_7display_Window *__pyx_v_self) { int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__del__", 0); __Pyx_INCREF(Py_None); __Pyx_GIVEREF(Py_None); __Pyx_GOTREF(__pyx_v_self->surface); __Pyx_DECREF(((PyObject *)__pyx_v_self->surface)); __pyx_v_self->surface = ((struct __pyx_obj_11pygame_sdl2_7surface_Surface *)Py_None); /* function exit code */ __pyx_r = 0; __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "(tree fragment)":1 * def __reduce_cython__(self): # <<<<<<<<<<<<<< * raise TypeError("self.gl_context,self.window,self.window_surface cannot be converted to a Python object for pickling") * def __setstate_cython__(self, __pyx_state): */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_7display_6Window_37__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/ static PyObject *__pyx_pw_11pygame_sdl2_7display_6Window_37__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__reduce_cython__ (wrapper)", 0); __pyx_r = __pyx_pf_11pygame_sdl2_7display_6Window_36__reduce_cython__(((struct __pyx_obj_11pygame_sdl2_7display_Window *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_7display_6Window_36__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_11pygame_sdl2_7display_Window *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; __Pyx_RefNannySetupContext("__reduce_cython__", 0); /* "(tree fragment)":2 * def __reduce_cython__(self): * raise TypeError("self.gl_context,self.window,self.window_surface cannot be converted to a Python object for pickling") # <<<<<<<<<<<<<< * def __setstate_cython__(self, __pyx_state): * raise TypeError("self.gl_context,self.window,self.window_surface cannot be converted to a Python object for pickling") */ __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__12, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 2, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_Raise(__pyx_t_1, 0, 0, 0); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __PYX_ERR(1, 2, __pyx_L1_error) /* "(tree fragment)":1 * def __reduce_cython__(self): # <<<<<<<<<<<<<< * raise TypeError("self.gl_context,self.window,self.window_surface cannot be converted to a Python object for pickling") * def __setstate_cython__(self, __pyx_state): */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("pygame_sdl2.display.Window.__reduce_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "(tree fragment)":3 * def __reduce_cython__(self): * raise TypeError("self.gl_context,self.window,self.window_surface cannot be converted to a Python object for pickling") * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<< * raise TypeError("self.gl_context,self.window,self.window_surface cannot be converted to a Python object for pickling") */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_7display_6Window_39__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state); /*proto*/ static PyObject *__pyx_pw_11pygame_sdl2_7display_6Window_39__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__setstate_cython__ (wrapper)", 0); __pyx_r = __pyx_pf_11pygame_sdl2_7display_6Window_38__setstate_cython__(((struct __pyx_obj_11pygame_sdl2_7display_Window *)__pyx_v_self), ((PyObject *)__pyx_v___pyx_state)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_7display_6Window_38__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_11pygame_sdl2_7display_Window *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; __Pyx_RefNannySetupContext("__setstate_cython__", 0); /* "(tree fragment)":4 * raise TypeError("self.gl_context,self.window,self.window_surface cannot be converted to a Python object for pickling") * def __setstate_cython__(self, __pyx_state): * raise TypeError("self.gl_context,self.window,self.window_surface cannot be converted to a Python object for pickling") # <<<<<<<<<<<<<< */ __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__13, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 4, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_Raise(__pyx_t_1, 0, 0, 0); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __PYX_ERR(1, 4, __pyx_L1_error) /* "(tree fragment)":3 * def __reduce_cython__(self): * raise TypeError("self.gl_context,self.window,self.window_surface cannot be converted to a Python object for pickling") * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<< * raise TypeError("self.gl_context,self.window,self.window_surface cannot be converted to a Python object for pickling") */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("pygame_sdl2.display.Window.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/display.pyx":428 * default_swap_control = 1 * * def set_mode(resolution=(0, 0), flags=0, depth=0, pos=(SDL_WINDOWPOS_UNDEFINED, SDL_WINDOWPOS_UNDEFINED)): # <<<<<<<<<<<<<< * global main_window * */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_7display_15set_mode(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static PyMethodDef __pyx_mdef_11pygame_sdl2_7display_15set_mode = {"set_mode", (PyCFunction)__pyx_pw_11pygame_sdl2_7display_15set_mode, METH_VARARGS|METH_KEYWORDS, 0}; static PyObject *__pyx_pw_11pygame_sdl2_7display_15set_mode(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_resolution = 0; PyObject *__pyx_v_flags = 0; PyObject *__pyx_v_depth = 0; PyObject *__pyx_v_pos = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("set_mode (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_resolution,&__pyx_n_s_flags,&__pyx_n_s_depth,&__pyx_n_s_pos,0}; PyObject* values[4] = {0,0,0,0}; values[0] = ((PyObject *)__pyx_tuple__14); values[1] = ((PyObject *)__pyx_int_0); values[2] = ((PyObject *)__pyx_int_0); values[3] = __pyx_k__15; if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); CYTHON_FALLTHROUGH; case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (kw_args > 0) { PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_resolution); if (value) { values[0] = value; kw_args--; } } CYTHON_FALLTHROUGH; case 1: if (kw_args > 0) { PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_flags); if (value) { values[1] = value; kw_args--; } } CYTHON_FALLTHROUGH; case 2: if (kw_args > 0) { PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_depth); if (value) { values[2] = value; kw_args--; } } CYTHON_FALLTHROUGH; case 3: if (kw_args > 0) { PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_pos); if (value) { values[3] = value; kw_args--; } } } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "set_mode") < 0)) __PYX_ERR(0, 428, __pyx_L3_error) } } else { switch (PyTuple_GET_SIZE(__pyx_args)) { case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); CYTHON_FALLTHROUGH; case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_resolution = values[0]; __pyx_v_flags = values[1]; __pyx_v_depth = values[2]; __pyx_v_pos = values[3]; } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("set_mode", 0, 0, 4, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 428, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("pygame_sdl2.display.set_mode", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_11pygame_sdl2_7display_14set_mode(__pyx_self, __pyx_v_resolution, __pyx_v_flags, __pyx_v_depth, __pyx_v_pos); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_7display_14set_mode(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_resolution, PyObject *__pyx_v_flags, PyObject *__pyx_v_depth, PyObject *__pyx_v_pos) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; PyObject *__pyx_t_5 = NULL; int __pyx_t_6; PyObject *__pyx_t_7 = NULL; int __pyx_t_8; __Pyx_RefNannySetupContext("set_mode", 0); /* "pygame_sdl2/display.pyx":431 * global main_window * * if main_window: # <<<<<<<<<<<<<< * * if (flags & ~SDL_WINDOW_OPENGL) == (main_window.create_flags & ~SDL_WINDOW_OPENGL): */ __pyx_t_1 = __Pyx_PyObject_IsTrue(((PyObject *)__pyx_v_11pygame_sdl2_7display_main_window)); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(0, 431, __pyx_L1_error) if (__pyx_t_1) { /* "pygame_sdl2/display.pyx":433 * if main_window: * * if (flags & ~SDL_WINDOW_OPENGL) == (main_window.create_flags & ~SDL_WINDOW_OPENGL): # <<<<<<<<<<<<<< * main_window.resize(resolution, flags & SDL_WINDOW_OPENGL) * return main_window.surface */ __pyx_t_2 = __Pyx_PyInt_From_int((~SDL_WINDOW_OPENGL)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 433, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = PyNumber_And(__pyx_v_flags, __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 433, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_2 = __Pyx_PyInt_From_uint32_t((__pyx_v_11pygame_sdl2_7display_main_window->create_flags & (~SDL_WINDOW_OPENGL))); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 433, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_4 = PyObject_RichCompare(__pyx_t_3, __pyx_t_2, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 433, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(0, 433, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; if (__pyx_t_1) { /* "pygame_sdl2/display.pyx":434 * * if (flags & ~SDL_WINDOW_OPENGL) == (main_window.create_flags & ~SDL_WINDOW_OPENGL): * main_window.resize(resolution, flags & SDL_WINDOW_OPENGL) # <<<<<<<<<<<<<< * return main_window.surface * */ __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_11pygame_sdl2_7display_main_window), __pyx_n_s_resize); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 434, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = __Pyx_PyInt_From_SDL_WindowFlags(SDL_WINDOW_OPENGL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 434, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_5 = PyNumber_And(__pyx_v_flags, __pyx_t_3); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 434, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_3 = NULL; __pyx_t_6 = 0; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); if (likely(__pyx_t_3)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); __pyx_t_6 = 1; } } #if CYTHON_FAST_PYCALL if (PyFunction_Check(__pyx_t_2)) { PyObject *__pyx_temp[3] = {__pyx_t_3, __pyx_v_resolution, __pyx_t_5}; __pyx_t_4 = __Pyx_PyFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_6, 2+__pyx_t_6); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 434, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; } else #endif #if CYTHON_FAST_PYCCALL if (__Pyx_PyFastCFunction_Check(__pyx_t_2)) { PyObject *__pyx_temp[3] = {__pyx_t_3, __pyx_v_resolution, __pyx_t_5}; __pyx_t_4 = __Pyx_PyCFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_6, 2+__pyx_t_6); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 434, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; } else #endif { __pyx_t_7 = PyTuple_New(2+__pyx_t_6); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 434, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); if (__pyx_t_3) { __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_3); __pyx_t_3 = NULL; } __Pyx_INCREF(__pyx_v_resolution); __Pyx_GIVEREF(__pyx_v_resolution); PyTuple_SET_ITEM(__pyx_t_7, 0+__pyx_t_6, __pyx_v_resolution); __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_7, 1+__pyx_t_6, __pyx_t_5); __pyx_t_5 = 0; __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_7, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 434, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; } __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; /* "pygame_sdl2/display.pyx":435 * if (flags & ~SDL_WINDOW_OPENGL) == (main_window.create_flags & ~SDL_WINDOW_OPENGL): * main_window.resize(resolution, flags & SDL_WINDOW_OPENGL) * return main_window.surface # <<<<<<<<<<<<<< * * else: */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(((PyObject *)__pyx_v_11pygame_sdl2_7display_main_window->surface)); __pyx_r = ((PyObject *)__pyx_v_11pygame_sdl2_7display_main_window->surface); goto __pyx_L0; /* "pygame_sdl2/display.pyx":433 * if main_window: * * if (flags & ~SDL_WINDOW_OPENGL) == (main_window.create_flags & ~SDL_WINDOW_OPENGL): # <<<<<<<<<<<<<< * main_window.resize(resolution, flags & SDL_WINDOW_OPENGL) * return main_window.surface */ } /* "pygame_sdl2/display.pyx":438 * * else: * main_window.destroy() # <<<<<<<<<<<<<< * * main_window = Window(default_title, resolution, flags, depth, pos=pos) */ /*else*/ { __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_11pygame_sdl2_7display_main_window), __pyx_n_s_destroy); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 438, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_7 = NULL; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) { __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_2); if (likely(__pyx_t_7)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_7); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); } } if (__pyx_t_7) { __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_7); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 438, __pyx_L1_error) __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; } else { __pyx_t_4 = __Pyx_PyObject_CallNoArg(__pyx_t_2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 438, __pyx_L1_error) } __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; } /* "pygame_sdl2/display.pyx":431 * global main_window * * if main_window: # <<<<<<<<<<<<<< * * if (flags & ~SDL_WINDOW_OPENGL) == (main_window.create_flags & ~SDL_WINDOW_OPENGL): */ } /* "pygame_sdl2/display.pyx":440 * main_window.destroy() * * main_window = Window(default_title, resolution, flags, depth, pos=pos) # <<<<<<<<<<<<<< * * if default_icon is not None: */ __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_default_title); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 440, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_2 = PyTuple_New(4); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 440, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_4); __Pyx_INCREF(__pyx_v_resolution); __Pyx_GIVEREF(__pyx_v_resolution); PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_v_resolution); __Pyx_INCREF(__pyx_v_flags); __Pyx_GIVEREF(__pyx_v_flags); PyTuple_SET_ITEM(__pyx_t_2, 2, __pyx_v_flags); __Pyx_INCREF(__pyx_v_depth); __Pyx_GIVEREF(__pyx_v_depth); PyTuple_SET_ITEM(__pyx_t_2, 3, __pyx_v_depth); __pyx_t_4 = 0; __pyx_t_4 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 440, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_pos, __pyx_v_pos) < 0) __PYX_ERR(0, 440, __pyx_L1_error) __pyx_t_7 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_11pygame_sdl2_7display_Window), __pyx_t_2, __pyx_t_4); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 440, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_XGOTREF(((PyObject *)__pyx_v_11pygame_sdl2_7display_main_window)); __Pyx_DECREF_SET(__pyx_v_11pygame_sdl2_7display_main_window, ((struct __pyx_obj_11pygame_sdl2_7display_Window *)__pyx_t_7)); __Pyx_GIVEREF(__pyx_t_7); __pyx_t_7 = 0; /* "pygame_sdl2/display.pyx":442 * main_window = Window(default_title, resolution, flags, depth, pos=pos) * * if default_icon is not None: # <<<<<<<<<<<<<< * main_window.set_icon(default_icon) * */ __pyx_t_7 = __Pyx_GetModuleGlobalName(__pyx_n_s_default_icon); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 442, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __pyx_t_1 = (__pyx_t_7 != Py_None); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __pyx_t_8 = (__pyx_t_1 != 0); if (__pyx_t_8) { /* "pygame_sdl2/display.pyx":443 * * if default_icon is not None: * main_window.set_icon(default_icon) # <<<<<<<<<<<<<< * * return main_window.surface */ __pyx_t_4 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_11pygame_sdl2_7display_main_window), __pyx_n_s_set_icon); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 443, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_default_icon); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 443, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_5 = NULL; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_4))) { __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4); if (likely(__pyx_t_5)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4); __Pyx_INCREF(__pyx_t_5); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_4, function); } } if (!__pyx_t_5) { __pyx_t_7 = __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_2); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 443, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_GOTREF(__pyx_t_7); } else { #if CYTHON_FAST_PYCALL if (PyFunction_Check(__pyx_t_4)) { PyObject *__pyx_temp[2] = {__pyx_t_5, __pyx_t_2}; __pyx_t_7 = __Pyx_PyFunction_FastCall(__pyx_t_4, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 443, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } else #endif #if CYTHON_FAST_PYCCALL if (__Pyx_PyFastCFunction_Check(__pyx_t_4)) { PyObject *__pyx_temp[2] = {__pyx_t_5, __pyx_t_2}; __pyx_t_7 = __Pyx_PyCFunction_FastCall(__pyx_t_4, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 443, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } else #endif { __pyx_t_3 = PyTuple_New(1+1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 443, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_5); __pyx_t_5 = NULL; __Pyx_GIVEREF(__pyx_t_2); PyTuple_SET_ITEM(__pyx_t_3, 0+1, __pyx_t_2); __pyx_t_2 = 0; __pyx_t_7 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_3, NULL); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 443, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } } __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; /* "pygame_sdl2/display.pyx":442 * main_window = Window(default_title, resolution, flags, depth, pos=pos) * * if default_icon is not None: # <<<<<<<<<<<<<< * main_window.set_icon(default_icon) * */ } /* "pygame_sdl2/display.pyx":445 * main_window.set_icon(default_icon) * * return main_window.surface # <<<<<<<<<<<<<< * * def get_surface(): */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(((PyObject *)__pyx_v_11pygame_sdl2_7display_main_window->surface)); __pyx_r = ((PyObject *)__pyx_v_11pygame_sdl2_7display_main_window->surface); goto __pyx_L0; /* "pygame_sdl2/display.pyx":428 * default_swap_control = 1 * * def set_mode(resolution=(0, 0), flags=0, depth=0, pos=(SDL_WINDOWPOS_UNDEFINED, SDL_WINDOWPOS_UNDEFINED)): # <<<<<<<<<<<<<< * global main_window * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_5); __Pyx_XDECREF(__pyx_t_7); __Pyx_AddTraceback("pygame_sdl2.display.set_mode", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/display.pyx":447 * return main_window.surface * * def get_surface(): # <<<<<<<<<<<<<< * if main_window is None: * return None */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_7display_17get_surface(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused); /*proto*/ static PyMethodDef __pyx_mdef_11pygame_sdl2_7display_17get_surface = {"get_surface", (PyCFunction)__pyx_pw_11pygame_sdl2_7display_17get_surface, METH_NOARGS, 0}; static PyObject *__pyx_pw_11pygame_sdl2_7display_17get_surface(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("get_surface (wrapper)", 0); __pyx_r = __pyx_pf_11pygame_sdl2_7display_16get_surface(__pyx_self); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_7display_16get_surface(CYTHON_UNUSED PyObject *__pyx_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; int __pyx_t_2; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; PyObject *__pyx_t_5 = NULL; __Pyx_RefNannySetupContext("get_surface", 0); /* "pygame_sdl2/display.pyx":448 * * def get_surface(): * if main_window is None: # <<<<<<<<<<<<<< * return None * */ __pyx_t_1 = (((PyObject *)__pyx_v_11pygame_sdl2_7display_main_window) == Py_None); __pyx_t_2 = (__pyx_t_1 != 0); if (__pyx_t_2) { /* "pygame_sdl2/display.pyx":449 * def get_surface(): * if main_window is None: * return None # <<<<<<<<<<<<<< * * return main_window.get_surface() */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(Py_None); __pyx_r = Py_None; goto __pyx_L0; /* "pygame_sdl2/display.pyx":448 * * def get_surface(): * if main_window is None: # <<<<<<<<<<<<<< * return None * */ } /* "pygame_sdl2/display.pyx":451 * return None * * return main_window.get_surface() # <<<<<<<<<<<<<< * * def get_window(): */ __Pyx_XDECREF(__pyx_r); __pyx_t_4 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_11pygame_sdl2_7display_main_window), __pyx_n_s_get_surface); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 451, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_5 = NULL; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_4))) { __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4); if (likely(__pyx_t_5)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4); __Pyx_INCREF(__pyx_t_5); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_4, function); } } if (__pyx_t_5) { __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_5); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 451, __pyx_L1_error) __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; } else { __pyx_t_3 = __Pyx_PyObject_CallNoArg(__pyx_t_4); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 451, __pyx_L1_error) } __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_r = __pyx_t_3; __pyx_t_3 = 0; goto __pyx_L0; /* "pygame_sdl2/display.pyx":447 * return main_window.surface * * def get_surface(): # <<<<<<<<<<<<<< * if main_window is None: * return None */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_5); __Pyx_AddTraceback("pygame_sdl2.display.get_surface", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/display.pyx":453 * return main_window.get_surface() * * def get_window(): # <<<<<<<<<<<<<< * """ * Returns the Window created by set_mode, or None if no such window */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_7display_19get_window(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused); /*proto*/ static char __pyx_doc_11pygame_sdl2_7display_18get_window[] = "\n Returns the Window created by set_mode, or None if no such window\n exists.\n "; static PyMethodDef __pyx_mdef_11pygame_sdl2_7display_19get_window = {"get_window", (PyCFunction)__pyx_pw_11pygame_sdl2_7display_19get_window, METH_NOARGS, __pyx_doc_11pygame_sdl2_7display_18get_window}; static PyObject *__pyx_pw_11pygame_sdl2_7display_19get_window(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("get_window (wrapper)", 0); __pyx_r = __pyx_pf_11pygame_sdl2_7display_18get_window(__pyx_self); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_7display_18get_window(CYTHON_UNUSED PyObject *__pyx_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("get_window", 0); /* "pygame_sdl2/display.pyx":459 * """ * * return main_window # <<<<<<<<<<<<<< * * def flip(): */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(((PyObject *)__pyx_v_11pygame_sdl2_7display_main_window)); __pyx_r = ((PyObject *)__pyx_v_11pygame_sdl2_7display_main_window); goto __pyx_L0; /* "pygame_sdl2/display.pyx":453 * return main_window.get_surface() * * def get_window(): # <<<<<<<<<<<<<< * """ * Returns the Window created by set_mode, or None if no such window */ /* function exit code */ __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/display.pyx":461 * return main_window * * def flip(): # <<<<<<<<<<<<<< * if main_window: * main_window.flip() */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_7display_21flip(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused); /*proto*/ static PyMethodDef __pyx_mdef_11pygame_sdl2_7display_21flip = {"flip", (PyCFunction)__pyx_pw_11pygame_sdl2_7display_21flip, METH_NOARGS, 0}; static PyObject *__pyx_pw_11pygame_sdl2_7display_21flip(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("flip (wrapper)", 0); __pyx_r = __pyx_pf_11pygame_sdl2_7display_20flip(__pyx_self); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_7display_20flip(CYTHON_UNUSED PyObject *__pyx_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; __Pyx_RefNannySetupContext("flip", 0); /* "pygame_sdl2/display.pyx":462 * * def flip(): * if main_window: # <<<<<<<<<<<<<< * main_window.flip() * */ __pyx_t_1 = __Pyx_PyObject_IsTrue(((PyObject *)__pyx_v_11pygame_sdl2_7display_main_window)); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(0, 462, __pyx_L1_error) if (__pyx_t_1) { /* "pygame_sdl2/display.pyx":463 * def flip(): * if main_window: * main_window.flip() # <<<<<<<<<<<<<< * * def update(rectangles=None): */ __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_11pygame_sdl2_7display_main_window), __pyx_n_s_flip); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 463, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = NULL; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) { __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3); if (likely(__pyx_t_4)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); __Pyx_INCREF(__pyx_t_4); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_3, function); } } if (__pyx_t_4) { __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 463, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; } else { __pyx_t_2 = __Pyx_PyObject_CallNoArg(__pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 463, __pyx_L1_error) } __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "pygame_sdl2/display.pyx":462 * * def flip(): * if main_window: # <<<<<<<<<<<<<< * main_window.flip() * */ } /* "pygame_sdl2/display.pyx":461 * return main_window * * def flip(): # <<<<<<<<<<<<<< * if main_window: * main_window.flip() */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_AddTraceback("pygame_sdl2.display.flip", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/display.pyx":465 * main_window.flip() * * def update(rectangles=None): # <<<<<<<<<<<<<< * if main_window: * main_window.update(rectangles) */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_7display_23update(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static PyMethodDef __pyx_mdef_11pygame_sdl2_7display_23update = {"update", (PyCFunction)__pyx_pw_11pygame_sdl2_7display_23update, METH_VARARGS|METH_KEYWORDS, 0}; static PyObject *__pyx_pw_11pygame_sdl2_7display_23update(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_rectangles = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("update (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_rectangles,0}; PyObject* values[1] = {0}; values[0] = ((PyObject *)Py_None); if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (kw_args > 0) { PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_rectangles); if (value) { values[0] = value; kw_args--; } } } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "update") < 0)) __PYX_ERR(0, 465, __pyx_L3_error) } } else { switch (PyTuple_GET_SIZE(__pyx_args)) { case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_rectangles = values[0]; } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("update", 0, 0, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 465, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("pygame_sdl2.display.update", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_11pygame_sdl2_7display_22update(__pyx_self, __pyx_v_rectangles); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_7display_22update(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_rectangles) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; PyObject *__pyx_t_5 = NULL; __Pyx_RefNannySetupContext("update", 0); /* "pygame_sdl2/display.pyx":466 * * def update(rectangles=None): * if main_window: # <<<<<<<<<<<<<< * main_window.update(rectangles) * */ __pyx_t_1 = __Pyx_PyObject_IsTrue(((PyObject *)__pyx_v_11pygame_sdl2_7display_main_window)); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(0, 466, __pyx_L1_error) if (__pyx_t_1) { /* "pygame_sdl2/display.pyx":467 * def update(rectangles=None): * if main_window: * main_window.update(rectangles) # <<<<<<<<<<<<<< * * def get_driver(): */ __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_11pygame_sdl2_7display_main_window), __pyx_n_s_update); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 467, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = NULL; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) { __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3); if (likely(__pyx_t_4)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); __Pyx_INCREF(__pyx_t_4); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_3, function); } } if (!__pyx_t_4) { __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_v_rectangles); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 467, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); } else { #if CYTHON_FAST_PYCALL if (PyFunction_Check(__pyx_t_3)) { PyObject *__pyx_temp[2] = {__pyx_t_4, __pyx_v_rectangles}; __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_3, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 467, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_GOTREF(__pyx_t_2); } else #endif #if CYTHON_FAST_PYCCALL if (__Pyx_PyFastCFunction_Check(__pyx_t_3)) { PyObject *__pyx_temp[2] = {__pyx_t_4, __pyx_v_rectangles}; __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 467, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_GOTREF(__pyx_t_2); } else #endif { __pyx_t_5 = PyTuple_New(1+1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 467, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_4); __pyx_t_4 = NULL; __Pyx_INCREF(__pyx_v_rectangles); __Pyx_GIVEREF(__pyx_v_rectangles); PyTuple_SET_ITEM(__pyx_t_5, 0+1, __pyx_v_rectangles); __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_5, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 467, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; } } __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "pygame_sdl2/display.pyx":466 * * def update(rectangles=None): * if main_window: # <<<<<<<<<<<<<< * main_window.update(rectangles) * */ } /* "pygame_sdl2/display.pyx":465 * main_window.flip() * * def update(rectangles=None): # <<<<<<<<<<<<<< * if main_window: * main_window.update(rectangles) */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_5); __Pyx_AddTraceback("pygame_sdl2.display.update", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/display.pyx":469 * main_window.update(rectangles) * * def get_driver(): # <<<<<<<<<<<<<< * cdef const char *driver = SDL_GetCurrentVideoDriver() * */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_7display_25get_driver(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused); /*proto*/ static PyMethodDef __pyx_mdef_11pygame_sdl2_7display_25get_driver = {"get_driver", (PyCFunction)__pyx_pw_11pygame_sdl2_7display_25get_driver, METH_NOARGS, 0}; static PyObject *__pyx_pw_11pygame_sdl2_7display_25get_driver(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("get_driver (wrapper)", 0); __pyx_r = __pyx_pf_11pygame_sdl2_7display_24get_driver(__pyx_self); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_7display_24get_driver(CYTHON_UNUSED PyObject *__pyx_self) { char const *__pyx_v_driver; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; __Pyx_RefNannySetupContext("get_driver", 0); /* "pygame_sdl2/display.pyx":470 * * def get_driver(): * cdef const char *driver = SDL_GetCurrentVideoDriver() # <<<<<<<<<<<<<< * * if driver == NULL: */ __pyx_v_driver = SDL_GetCurrentVideoDriver(); /* "pygame_sdl2/display.pyx":472 * cdef const char *driver = SDL_GetCurrentVideoDriver() * * if driver == NULL: # <<<<<<<<<<<<<< * raise error() * */ __pyx_t_1 = ((__pyx_v_driver == NULL) != 0); if (__pyx_t_1) { /* "pygame_sdl2/display.pyx":473 * * if driver == NULL: * raise error() # <<<<<<<<<<<<<< * * return driver */ __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_error); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 473, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = NULL; if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) { __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3); if (likely(__pyx_t_4)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); __Pyx_INCREF(__pyx_t_4); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_3, function); } } if (__pyx_t_4) { __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 473, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; } else { __pyx_t_2 = __Pyx_PyObject_CallNoArg(__pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 473, __pyx_L1_error) } __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_Raise(__pyx_t_2, 0, 0, 0); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __PYX_ERR(0, 473, __pyx_L1_error) /* "pygame_sdl2/display.pyx":472 * cdef const char *driver = SDL_GetCurrentVideoDriver() * * if driver == NULL: # <<<<<<<<<<<<<< * raise error() * */ } /* "pygame_sdl2/display.pyx":475 * raise error() * * return driver # <<<<<<<<<<<<<< * * class Info(object): */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __Pyx_PyBytes_FromString(__pyx_v_driver); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 475, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; /* "pygame_sdl2/display.pyx":469 * main_window.update(rectangles) * * def get_driver(): # <<<<<<<<<<<<<< * cdef const char *driver = SDL_GetCurrentVideoDriver() * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_AddTraceback("pygame_sdl2.display.get_driver", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/display.pyx":479 * class Info(object): * * def __init__(self): # <<<<<<<<<<<<<< * cdef SDL_DisplayMode dm * cdef SDL_PixelFormat *format */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_7display_4Info_1__init__(PyObject *__pyx_self, PyObject *__pyx_v_self); /*proto*/ static PyMethodDef __pyx_mdef_11pygame_sdl2_7display_4Info_1__init__ = {"__init__", (PyCFunction)__pyx_pw_11pygame_sdl2_7display_4Info_1__init__, METH_O, 0}; static PyObject *__pyx_pw_11pygame_sdl2_7display_4Info_1__init__(PyObject *__pyx_self, PyObject *__pyx_v_self) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__init__ (wrapper)", 0); __pyx_r = __pyx_pf_11pygame_sdl2_7display_4Info___init__(__pyx_self, ((PyObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_7display_4Info___init__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self) { SDL_DisplayMode __pyx_v_dm; SDL_PixelFormat *__pyx_v_format; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; PyObject *__pyx_t_5 = NULL; PyObject *__pyx_t_6 = NULL; PyObject *(*__pyx_t_7)(PyObject *); __Pyx_RefNannySetupContext("__init__", 0); /* "pygame_sdl2/display.pyx":483 * cdef SDL_PixelFormat *format * * if SDL_GetCurrentDisplayMode(0, &dm): # <<<<<<<<<<<<<< * raise error() * */ __pyx_t_1 = (SDL_GetCurrentDisplayMode(0, (&__pyx_v_dm)) != 0); if (__pyx_t_1) { /* "pygame_sdl2/display.pyx":484 * * if SDL_GetCurrentDisplayMode(0, &dm): * raise error() # <<<<<<<<<<<<<< * * format = SDL_AllocFormat(dm.format) */ __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_error); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 484, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = NULL; if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) { __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3); if (likely(__pyx_t_4)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); __Pyx_INCREF(__pyx_t_4); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_3, function); } } if (__pyx_t_4) { __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 484, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; } else { __pyx_t_2 = __Pyx_PyObject_CallNoArg(__pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 484, __pyx_L1_error) } __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_Raise(__pyx_t_2, 0, 0, 0); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __PYX_ERR(0, 484, __pyx_L1_error) /* "pygame_sdl2/display.pyx":483 * cdef SDL_PixelFormat *format * * if SDL_GetCurrentDisplayMode(0, &dm): # <<<<<<<<<<<<<< * raise error() * */ } /* "pygame_sdl2/display.pyx":486 * raise error() * * format = SDL_AllocFormat(dm.format) # <<<<<<<<<<<<<< * if format == NULL: * raise error() */ __pyx_v_format = SDL_AllocFormat(__pyx_v_dm.format); /* "pygame_sdl2/display.pyx":487 * * format = SDL_AllocFormat(dm.format) * if format == NULL: # <<<<<<<<<<<<<< * raise error() * */ __pyx_t_1 = ((__pyx_v_format == NULL) != 0); if (__pyx_t_1) { /* "pygame_sdl2/display.pyx":488 * format = SDL_AllocFormat(dm.format) * if format == NULL: * raise error() # <<<<<<<<<<<<<< * * self.bitsize = format.BitsPerPixel */ __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_error); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 488, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = NULL; if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) { __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3); if (likely(__pyx_t_4)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); __Pyx_INCREF(__pyx_t_4); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_3, function); } } if (__pyx_t_4) { __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 488, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; } else { __pyx_t_2 = __Pyx_PyObject_CallNoArg(__pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 488, __pyx_L1_error) } __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_Raise(__pyx_t_2, 0, 0, 0); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __PYX_ERR(0, 488, __pyx_L1_error) /* "pygame_sdl2/display.pyx":487 * * format = SDL_AllocFormat(dm.format) * if format == NULL: # <<<<<<<<<<<<<< * raise error() * */ } /* "pygame_sdl2/display.pyx":490 * raise error() * * self.bitsize = format.BitsPerPixel # <<<<<<<<<<<<<< * self.bytesize = format.BytesPerPixel * */ __pyx_t_2 = __Pyx_PyInt_From_uint8_t(__pyx_v_format->BitsPerPixel); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 490, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_bitsize, __pyx_t_2) < 0) __PYX_ERR(0, 490, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "pygame_sdl2/display.pyx":491 * * self.bitsize = format.BitsPerPixel * self.bytesize = format.BytesPerPixel # <<<<<<<<<<<<<< * * self.masks = ( */ __pyx_t_2 = __Pyx_PyInt_From_uint8_t(__pyx_v_format->BytesPerPixel); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 491, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_bytesize, __pyx_t_2) < 0) __PYX_ERR(0, 491, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "pygame_sdl2/display.pyx":494 * * self.masks = ( * format.Rmask, # <<<<<<<<<<<<<< * format.Gmask, * format.Bmask, */ __pyx_t_2 = __Pyx_PyInt_From_uint32_t(__pyx_v_format->Rmask); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 494, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); /* "pygame_sdl2/display.pyx":495 * self.masks = ( * format.Rmask, * format.Gmask, # <<<<<<<<<<<<<< * format.Bmask, * format.Amask, */ __pyx_t_3 = __Pyx_PyInt_From_uint32_t(__pyx_v_format->Gmask); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 495, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); /* "pygame_sdl2/display.pyx":496 * format.Rmask, * format.Gmask, * format.Bmask, # <<<<<<<<<<<<<< * format.Amask, * ) */ __pyx_t_4 = __Pyx_PyInt_From_uint32_t(__pyx_v_format->Bmask); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 496, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); /* "pygame_sdl2/display.pyx":497 * format.Gmask, * format.Bmask, * format.Amask, # <<<<<<<<<<<<<< * ) * */ __pyx_t_5 = __Pyx_PyInt_From_uint32_t(__pyx_v_format->Amask); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 497, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); /* "pygame_sdl2/display.pyx":494 * * self.masks = ( * format.Rmask, # <<<<<<<<<<<<<< * format.Gmask, * format.Bmask, */ __pyx_t_6 = PyTuple_New(4); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 494, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_GIVEREF(__pyx_t_2); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_2); __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_6, 1, __pyx_t_3); __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_6, 2, __pyx_t_4); __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_6, 3, __pyx_t_5); __pyx_t_2 = 0; __pyx_t_3 = 0; __pyx_t_4 = 0; __pyx_t_5 = 0; /* "pygame_sdl2/display.pyx":493 * self.bytesize = format.BytesPerPixel * * self.masks = ( # <<<<<<<<<<<<<< * format.Rmask, * format.Gmask, */ if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_masks, __pyx_t_6) < 0) __PYX_ERR(0, 493, __pyx_L1_error) __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; /* "pygame_sdl2/display.pyx":501 * * self.shifts = ( * format.Rshift, # <<<<<<<<<<<<<< * format.Gshift, * format.Bshift, */ __pyx_t_6 = __Pyx_PyInt_From_uint8_t(__pyx_v_format->Rshift); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 501, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); /* "pygame_sdl2/display.pyx":502 * self.shifts = ( * format.Rshift, * format.Gshift, # <<<<<<<<<<<<<< * format.Bshift, * format.Ashift, */ __pyx_t_5 = __Pyx_PyInt_From_uint8_t(__pyx_v_format->Gshift); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 502, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); /* "pygame_sdl2/display.pyx":503 * format.Rshift, * format.Gshift, * format.Bshift, # <<<<<<<<<<<<<< * format.Ashift, * ) */ __pyx_t_4 = __Pyx_PyInt_From_uint8_t(__pyx_v_format->Bshift); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 503, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); /* "pygame_sdl2/display.pyx":504 * format.Gshift, * format.Bshift, * format.Ashift, # <<<<<<<<<<<<<< * ) * */ __pyx_t_3 = __Pyx_PyInt_From_uint8_t(__pyx_v_format->Ashift); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 504, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); /* "pygame_sdl2/display.pyx":501 * * self.shifts = ( * format.Rshift, # <<<<<<<<<<<<<< * format.Gshift, * format.Bshift, */ __pyx_t_2 = PyTuple_New(4); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 501, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_GIVEREF(__pyx_t_6); PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_6); __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_t_5); __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_2, 2, __pyx_t_4); __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_2, 3, __pyx_t_3); __pyx_t_6 = 0; __pyx_t_5 = 0; __pyx_t_4 = 0; __pyx_t_3 = 0; /* "pygame_sdl2/display.pyx":500 * ) * * self.shifts = ( # <<<<<<<<<<<<<< * format.Rshift, * format.Gshift, */ if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_shifts, __pyx_t_2) < 0) __PYX_ERR(0, 500, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "pygame_sdl2/display.pyx":508 * * self.losses = ( * format.Rloss, # <<<<<<<<<<<<<< * format.Gloss, * format.Bloss, */ __pyx_t_2 = __Pyx_PyInt_From_uint8_t(__pyx_v_format->Rloss); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 508, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); /* "pygame_sdl2/display.pyx":509 * self.losses = ( * format.Rloss, * format.Gloss, # <<<<<<<<<<<<<< * format.Bloss, * format.Aloss, */ __pyx_t_3 = __Pyx_PyInt_From_uint8_t(__pyx_v_format->Gloss); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 509, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); /* "pygame_sdl2/display.pyx":510 * format.Rloss, * format.Gloss, * format.Bloss, # <<<<<<<<<<<<<< * format.Aloss, * ) */ __pyx_t_4 = __Pyx_PyInt_From_uint8_t(__pyx_v_format->Bloss); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 510, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); /* "pygame_sdl2/display.pyx":511 * format.Gloss, * format.Bloss, * format.Aloss, # <<<<<<<<<<<<<< * ) * */ __pyx_t_5 = __Pyx_PyInt_From_uint8_t(__pyx_v_format->Aloss); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 511, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); /* "pygame_sdl2/display.pyx":508 * * self.losses = ( * format.Rloss, # <<<<<<<<<<<<<< * format.Gloss, * format.Bloss, */ __pyx_t_6 = PyTuple_New(4); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 508, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_GIVEREF(__pyx_t_2); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_2); __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_6, 1, __pyx_t_3); __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_6, 2, __pyx_t_4); __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_6, 3, __pyx_t_5); __pyx_t_2 = 0; __pyx_t_3 = 0; __pyx_t_4 = 0; __pyx_t_5 = 0; /* "pygame_sdl2/display.pyx":507 * ) * * self.losses = ( # <<<<<<<<<<<<<< * format.Rloss, * format.Gloss, */ if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_losses, __pyx_t_6) < 0) __PYX_ERR(0, 507, __pyx_L1_error) __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; /* "pygame_sdl2/display.pyx":514 * ) * * SDL_FreeFormat(format) # <<<<<<<<<<<<<< * * if main_window: */ SDL_FreeFormat(__pyx_v_format); /* "pygame_sdl2/display.pyx":516 * SDL_FreeFormat(format) * * if main_window: # <<<<<<<<<<<<<< * self.current_w, self.current_h = main_window.surface.get_size() * else: */ __pyx_t_1 = __Pyx_PyObject_IsTrue(((PyObject *)__pyx_v_11pygame_sdl2_7display_main_window)); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(0, 516, __pyx_L1_error) if (__pyx_t_1) { /* "pygame_sdl2/display.pyx":517 * * if main_window: * self.current_w, self.current_h = main_window.surface.get_size() # <<<<<<<<<<<<<< * else: * */ __pyx_t_5 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_11pygame_sdl2_7display_main_window->surface), __pyx_n_s_get_size); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 517, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_4 = NULL; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_5))) { __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_5); if (likely(__pyx_t_4)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5); __Pyx_INCREF(__pyx_t_4); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_5, function); } } if (__pyx_t_4) { __pyx_t_6 = __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_t_4); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 517, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; } else { __pyx_t_6 = __Pyx_PyObject_CallNoArg(__pyx_t_5); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 517, __pyx_L1_error) } __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; if ((likely(PyTuple_CheckExact(__pyx_t_6))) || (PyList_CheckExact(__pyx_t_6))) { PyObject* sequence = __pyx_t_6; #if !CYTHON_COMPILING_IN_PYPY Py_ssize_t size = Py_SIZE(sequence); #else Py_ssize_t size = PySequence_Size(sequence); #endif if (unlikely(size != 2)) { if (size > 2) __Pyx_RaiseTooManyValuesError(2); else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); __PYX_ERR(0, 517, __pyx_L1_error) } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS if (likely(PyTuple_CheckExact(sequence))) { __pyx_t_5 = PyTuple_GET_ITEM(sequence, 0); __pyx_t_4 = PyTuple_GET_ITEM(sequence, 1); } else { __pyx_t_5 = PyList_GET_ITEM(sequence, 0); __pyx_t_4 = PyList_GET_ITEM(sequence, 1); } __Pyx_INCREF(__pyx_t_5); __Pyx_INCREF(__pyx_t_4); #else __pyx_t_5 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 517, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_4 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 517, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); #endif __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; } else { Py_ssize_t index = -1; __pyx_t_3 = PyObject_GetIter(__pyx_t_6); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 517, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __pyx_t_7 = Py_TYPE(__pyx_t_3)->tp_iternext; index = 0; __pyx_t_5 = __pyx_t_7(__pyx_t_3); if (unlikely(!__pyx_t_5)) goto __pyx_L6_unpacking_failed; __Pyx_GOTREF(__pyx_t_5); index = 1; __pyx_t_4 = __pyx_t_7(__pyx_t_3); if (unlikely(!__pyx_t_4)) goto __pyx_L6_unpacking_failed; __Pyx_GOTREF(__pyx_t_4); if (__Pyx_IternextUnpackEndCheck(__pyx_t_7(__pyx_t_3), 2) < 0) __PYX_ERR(0, 517, __pyx_L1_error) __pyx_t_7 = NULL; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; goto __pyx_L7_unpacking_done; __pyx_L6_unpacking_failed:; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_7 = NULL; if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); __PYX_ERR(0, 517, __pyx_L1_error) __pyx_L7_unpacking_done:; } if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_current_w, __pyx_t_5) < 0) __PYX_ERR(0, 517, __pyx_L1_error) __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_current_h, __pyx_t_4) < 0) __PYX_ERR(0, 517, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; /* "pygame_sdl2/display.pyx":516 * SDL_FreeFormat(format) * * if main_window: # <<<<<<<<<<<<<< * self.current_w, self.current_h = main_window.surface.get_size() * else: */ goto __pyx_L5; } /* "pygame_sdl2/display.pyx":520 * else: * * self.current_w = dm.w # <<<<<<<<<<<<<< * self.current_h = dm.h * */ /*else*/ { __pyx_t_6 = __Pyx_PyInt_From_int(__pyx_v_dm.w); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 520, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_current_w, __pyx_t_6) < 0) __PYX_ERR(0, 520, __pyx_L1_error) __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; /* "pygame_sdl2/display.pyx":521 * * self.current_w = dm.w * self.current_h = dm.h # <<<<<<<<<<<<<< * * self.refresh_rate = dm.refresh_rate */ __pyx_t_6 = __Pyx_PyInt_From_int(__pyx_v_dm.h); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 521, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_current_h, __pyx_t_6) < 0) __PYX_ERR(0, 521, __pyx_L1_error) __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; } __pyx_L5:; /* "pygame_sdl2/display.pyx":523 * self.current_h = dm.h * * self.refresh_rate = dm.refresh_rate # <<<<<<<<<<<<<< * * # The rest of these are just guesses. */ __pyx_t_6 = __Pyx_PyInt_From_int(__pyx_v_dm.refresh_rate); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 523, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_refresh_rate, __pyx_t_6) < 0) __PYX_ERR(0, 523, __pyx_L1_error) __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; /* "pygame_sdl2/display.pyx":526 * * # The rest of these are just guesses. * self.hw = False # <<<<<<<<<<<<<< * self.wm = True * self.video_mem = 256 * 1024 * 1024 */ if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_hw, Py_False) < 0) __PYX_ERR(0, 526, __pyx_L1_error) /* "pygame_sdl2/display.pyx":527 * # The rest of these are just guesses. * self.hw = False * self.wm = True # <<<<<<<<<<<<<< * self.video_mem = 256 * 1024 * 1024 * */ if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_wm, Py_True) < 0) __PYX_ERR(0, 527, __pyx_L1_error) /* "pygame_sdl2/display.pyx":528 * self.hw = False * self.wm = True * self.video_mem = 256 * 1024 * 1024 # <<<<<<<<<<<<<< * * self.blit_hw = False */ if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_video_mem, __pyx_int_268435456) < 0) __PYX_ERR(0, 528, __pyx_L1_error) /* "pygame_sdl2/display.pyx":530 * self.video_mem = 256 * 1024 * 1024 * * self.blit_hw = False # <<<<<<<<<<<<<< * self.blit_hw_CC = False * self.blit_hw_A = False */ if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_blit_hw, Py_False) < 0) __PYX_ERR(0, 530, __pyx_L1_error) /* "pygame_sdl2/display.pyx":531 * * self.blit_hw = False * self.blit_hw_CC = False # <<<<<<<<<<<<<< * self.blit_hw_A = False * */ if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_blit_hw_CC, Py_False) < 0) __PYX_ERR(0, 531, __pyx_L1_error) /* "pygame_sdl2/display.pyx":532 * self.blit_hw = False * self.blit_hw_CC = False * self.blit_hw_A = False # <<<<<<<<<<<<<< * * self.blit_sw = False */ if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_blit_hw_A, Py_False) < 0) __PYX_ERR(0, 532, __pyx_L1_error) /* "pygame_sdl2/display.pyx":534 * self.blit_hw_A = False * * self.blit_sw = False # <<<<<<<<<<<<<< * self.blit_sw_CC = False * self.blit_sw_A = False */ if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_blit_sw, Py_False) < 0) __PYX_ERR(0, 534, __pyx_L1_error) /* "pygame_sdl2/display.pyx":535 * * self.blit_sw = False * self.blit_sw_CC = False # <<<<<<<<<<<<<< * self.blit_sw_A = False * */ if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_blit_sw_CC, Py_False) < 0) __PYX_ERR(0, 535, __pyx_L1_error) /* "pygame_sdl2/display.pyx":536 * self.blit_sw = False * self.blit_sw_CC = False * self.blit_sw_A = False # <<<<<<<<<<<<<< * * def __repr__(self): */ if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_blit_sw_A, Py_False) < 0) __PYX_ERR(0, 536, __pyx_L1_error) /* "pygame_sdl2/display.pyx":479 * class Info(object): * * def __init__(self): # <<<<<<<<<<<<<< * cdef SDL_DisplayMode dm * cdef SDL_PixelFormat *format */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_5); __Pyx_XDECREF(__pyx_t_6); __Pyx_AddTraceback("pygame_sdl2.display.Info.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/display.pyx":538 * self.blit_sw_A = False * * def __repr__(self): # <<<<<<<<<<<<<< * return "".format(self.__dict__) * */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_7display_4Info_3__repr__(PyObject *__pyx_self, PyObject *__pyx_v_self); /*proto*/ static PyMethodDef __pyx_mdef_11pygame_sdl2_7display_4Info_3__repr__ = {"__repr__", (PyCFunction)__pyx_pw_11pygame_sdl2_7display_4Info_3__repr__, METH_O, 0}; static PyObject *__pyx_pw_11pygame_sdl2_7display_4Info_3__repr__(PyObject *__pyx_self, PyObject *__pyx_v_self) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__repr__ (wrapper)", 0); __pyx_r = __pyx_pf_11pygame_sdl2_7display_4Info_2__repr__(__pyx_self, ((PyObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_7display_4Info_2__repr__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; PyObject *__pyx_t_5 = NULL; __Pyx_RefNannySetupContext("__repr__", 0); /* "pygame_sdl2/display.pyx":539 * * def __repr__(self): * return "".format(self.__dict__) # <<<<<<<<<<<<<< * * */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_kp_s_Info_r, __pyx_n_s_format); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 539, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_dict); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 539, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = NULL; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) { __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_2); if (likely(__pyx_t_4)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_4); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); } } if (!__pyx_t_4) { __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 539, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_GOTREF(__pyx_t_1); } else { #if CYTHON_FAST_PYCALL if (PyFunction_Check(__pyx_t_2)) { PyObject *__pyx_temp[2] = {__pyx_t_4, __pyx_t_3}; __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_2, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 539, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } else #endif #if CYTHON_FAST_PYCCALL if (__Pyx_PyFastCFunction_Check(__pyx_t_2)) { PyObject *__pyx_temp[2] = {__pyx_t_4, __pyx_t_3}; __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_2, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 539, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } else #endif { __pyx_t_5 = PyTuple_New(1+1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 539, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_4); __pyx_t_4 = NULL; __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_5, 0+1, __pyx_t_3); __pyx_t_3 = 0; __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_5, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 539, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; } } __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "pygame_sdl2/display.pyx":538 * self.blit_sw_A = False * * def __repr__(self): # <<<<<<<<<<<<<< * return "".format(self.__dict__) * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_5); __Pyx_AddTraceback("pygame_sdl2.display.Info.__repr__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/display.pyx":542 * * * def get_wm_info(): # <<<<<<<<<<<<<< * if main_window: * return main_window.get_wm_info() */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_7display_27get_wm_info(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused); /*proto*/ static PyMethodDef __pyx_mdef_11pygame_sdl2_7display_27get_wm_info = {"get_wm_info", (PyCFunction)__pyx_pw_11pygame_sdl2_7display_27get_wm_info, METH_NOARGS, 0}; static PyObject *__pyx_pw_11pygame_sdl2_7display_27get_wm_info(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("get_wm_info (wrapper)", 0); __pyx_r = __pyx_pf_11pygame_sdl2_7display_26get_wm_info(__pyx_self); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_7display_26get_wm_info(CYTHON_UNUSED PyObject *__pyx_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; __Pyx_RefNannySetupContext("get_wm_info", 0); /* "pygame_sdl2/display.pyx":543 * * def get_wm_info(): * if main_window: # <<<<<<<<<<<<<< * return main_window.get_wm_info() * */ __pyx_t_1 = __Pyx_PyObject_IsTrue(((PyObject *)__pyx_v_11pygame_sdl2_7display_main_window)); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(0, 543, __pyx_L1_error) if (__pyx_t_1) { /* "pygame_sdl2/display.pyx":544 * def get_wm_info(): * if main_window: * return main_window.get_wm_info() # <<<<<<<<<<<<<< * * return {} */ __Pyx_XDECREF(__pyx_r); __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_11pygame_sdl2_7display_main_window), __pyx_n_s_get_wm_info); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 544, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = NULL; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) { __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3); if (likely(__pyx_t_4)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); __Pyx_INCREF(__pyx_t_4); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_3, function); } } if (__pyx_t_4) { __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 544, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; } else { __pyx_t_2 = __Pyx_PyObject_CallNoArg(__pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 544, __pyx_L1_error) } __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; /* "pygame_sdl2/display.pyx":543 * * def get_wm_info(): * if main_window: # <<<<<<<<<<<<<< * return main_window.get_wm_info() * */ } /* "pygame_sdl2/display.pyx":546 * return main_window.get_wm_info() * * return {} # <<<<<<<<<<<<<< * * */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 546, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; /* "pygame_sdl2/display.pyx":542 * * * def get_wm_info(): # <<<<<<<<<<<<<< * if main_window: * return main_window.get_wm_info() */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_AddTraceback("pygame_sdl2.display.get_wm_info", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/display.pyx":549 * * * def get_num_video_displays(): # <<<<<<<<<<<<<< * """ * Returns the number of video displays connected to the system. */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_7display_29get_num_video_displays(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused); /*proto*/ static char __pyx_doc_11pygame_sdl2_7display_28get_num_video_displays[] = "\n Returns the number of video displays connected to the system.\n "; static PyMethodDef __pyx_mdef_11pygame_sdl2_7display_29get_num_video_displays = {"get_num_video_displays", (PyCFunction)__pyx_pw_11pygame_sdl2_7display_29get_num_video_displays, METH_NOARGS, __pyx_doc_11pygame_sdl2_7display_28get_num_video_displays}; static PyObject *__pyx_pw_11pygame_sdl2_7display_29get_num_video_displays(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("get_num_video_displays (wrapper)", 0); __pyx_r = __pyx_pf_11pygame_sdl2_7display_28get_num_video_displays(__pyx_self); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_7display_28get_num_video_displays(CYTHON_UNUSED PyObject *__pyx_self) { int __pyx_v_rv; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; __Pyx_RefNannySetupContext("get_num_video_displays", 0); /* "pygame_sdl2/display.pyx":554 * """ * * rv = SDL_GetNumVideoDisplays() # <<<<<<<<<<<<<< * * if rv < 0: */ __pyx_v_rv = SDL_GetNumVideoDisplays(); /* "pygame_sdl2/display.pyx":556 * rv = SDL_GetNumVideoDisplays() * * if rv < 0: # <<<<<<<<<<<<<< * raise error() * */ __pyx_t_1 = ((__pyx_v_rv < 0) != 0); if (__pyx_t_1) { /* "pygame_sdl2/display.pyx":557 * * if rv < 0: * raise error() # <<<<<<<<<<<<<< * * return rv */ __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_error); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 557, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = NULL; if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) { __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3); if (likely(__pyx_t_4)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); __Pyx_INCREF(__pyx_t_4); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_3, function); } } if (__pyx_t_4) { __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 557, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; } else { __pyx_t_2 = __Pyx_PyObject_CallNoArg(__pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 557, __pyx_L1_error) } __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_Raise(__pyx_t_2, 0, 0, 0); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __PYX_ERR(0, 557, __pyx_L1_error) /* "pygame_sdl2/display.pyx":556 * rv = SDL_GetNumVideoDisplays() * * if rv < 0: # <<<<<<<<<<<<<< * raise error() * */ } /* "pygame_sdl2/display.pyx":559 * raise error() * * return rv # <<<<<<<<<<<<<< * * */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_v_rv); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 559, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; /* "pygame_sdl2/display.pyx":549 * * * def get_num_video_displays(): # <<<<<<<<<<<<<< * """ * Returns the number of video displays connected to the system. */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_AddTraceback("pygame_sdl2.display.get_num_video_displays", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/display.pyx":562 * * * def list_modes(depth=0, flags=0, display=0): # <<<<<<<<<<<<<< * """ * Returns a list of possible display modes for the display `display`. */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_7display_31list_modes(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_11pygame_sdl2_7display_30list_modes[] = "\n Returns a list of possible display modes for the display `display`.\n\n `depth` and `flags` are ignored.\n "; static PyMethodDef __pyx_mdef_11pygame_sdl2_7display_31list_modes = {"list_modes", (PyCFunction)__pyx_pw_11pygame_sdl2_7display_31list_modes, METH_VARARGS|METH_KEYWORDS, __pyx_doc_11pygame_sdl2_7display_30list_modes}; static PyObject *__pyx_pw_11pygame_sdl2_7display_31list_modes(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { CYTHON_UNUSED PyObject *__pyx_v_depth = 0; CYTHON_UNUSED PyObject *__pyx_v_flags = 0; PyObject *__pyx_v_display = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("list_modes (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_depth,&__pyx_n_s_flags,&__pyx_n_s_display,0}; PyObject* values[3] = {0,0,0}; values[0] = ((PyObject *)__pyx_int_0); values[1] = ((PyObject *)__pyx_int_0); values[2] = ((PyObject *)__pyx_int_0); if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (kw_args > 0) { PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_depth); if (value) { values[0] = value; kw_args--; } } CYTHON_FALLTHROUGH; case 1: if (kw_args > 0) { PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_flags); if (value) { values[1] = value; kw_args--; } } CYTHON_FALLTHROUGH; case 2: if (kw_args > 0) { PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_display); if (value) { values[2] = value; kw_args--; } } } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "list_modes") < 0)) __PYX_ERR(0, 562, __pyx_L3_error) } } else { switch (PyTuple_GET_SIZE(__pyx_args)) { case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_depth = values[0]; __pyx_v_flags = values[1]; __pyx_v_display = values[2]; } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("list_modes", 0, 0, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 562, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("pygame_sdl2.display.list_modes", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_11pygame_sdl2_7display_30list_modes(__pyx_self, __pyx_v_depth, __pyx_v_flags, __pyx_v_display); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_7display_30list_modes(CYTHON_UNUSED PyObject *__pyx_self, CYTHON_UNUSED PyObject *__pyx_v_depth, CYTHON_UNUSED PyObject *__pyx_v_flags, PyObject *__pyx_v_display) { int __pyx_v_num_modes; int __pyx_v_i; SDL_DisplayMode __pyx_v_mode; PyObject *__pyx_v_rv = NULL; PyObject *__pyx_v_t = NULL; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_t_2; int __pyx_t_3; PyObject *__pyx_t_4 = NULL; PyObject *__pyx_t_5 = NULL; int __pyx_t_6; int __pyx_t_7; int __pyx_t_8; __Pyx_RefNannySetupContext("list_modes", 0); /* "pygame_sdl2/display.pyx":572 * cdef SDL_DisplayMode mode * * rv = [ ] # <<<<<<<<<<<<<< * * num_modes = SDL_GetNumDisplayModes(display) */ __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 572, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_rv = ((PyObject*)__pyx_t_1); __pyx_t_1 = 0; /* "pygame_sdl2/display.pyx":574 * rv = [ ] * * num_modes = SDL_GetNumDisplayModes(display) # <<<<<<<<<<<<<< * if num_modes < 0: * raise error() */ __pyx_t_2 = __Pyx_PyInt_As_int(__pyx_v_display); if (unlikely((__pyx_t_2 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 574, __pyx_L1_error) __pyx_v_num_modes = SDL_GetNumDisplayModes(__pyx_t_2); /* "pygame_sdl2/display.pyx":575 * * num_modes = SDL_GetNumDisplayModes(display) * if num_modes < 0: # <<<<<<<<<<<<<< * raise error() * */ __pyx_t_3 = ((__pyx_v_num_modes < 0) != 0); if (__pyx_t_3) { /* "pygame_sdl2/display.pyx":576 * num_modes = SDL_GetNumDisplayModes(display) * if num_modes < 0: * raise error() # <<<<<<<<<<<<<< * * for 0 <= i < num_modes: */ __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_error); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 576, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_5 = NULL; if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_4))) { __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4); if (likely(__pyx_t_5)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4); __Pyx_INCREF(__pyx_t_5); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_4, function); } } if (__pyx_t_5) { __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_5); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 576, __pyx_L1_error) __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; } else { __pyx_t_1 = __Pyx_PyObject_CallNoArg(__pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 576, __pyx_L1_error) } __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_Raise(__pyx_t_1, 0, 0, 0); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __PYX_ERR(0, 576, __pyx_L1_error) /* "pygame_sdl2/display.pyx":575 * * num_modes = SDL_GetNumDisplayModes(display) * if num_modes < 0: # <<<<<<<<<<<<<< * raise error() * */ } /* "pygame_sdl2/display.pyx":578 * raise error() * * for 0 <= i < num_modes: # <<<<<<<<<<<<<< * if SDL_GetDisplayMode(display, i, &mode) == 0: * t = (mode.w, mode.h) */ __pyx_t_2 = __pyx_v_num_modes; for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_2; __pyx_v_i++) { /* "pygame_sdl2/display.pyx":579 * * for 0 <= i < num_modes: * if SDL_GetDisplayMode(display, i, &mode) == 0: # <<<<<<<<<<<<<< * t = (mode.w, mode.h) * if t not in rv: */ __pyx_t_6 = __Pyx_PyInt_As_int(__pyx_v_display); if (unlikely((__pyx_t_6 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 579, __pyx_L1_error) __pyx_t_3 = ((SDL_GetDisplayMode(__pyx_t_6, __pyx_v_i, (&__pyx_v_mode)) == 0) != 0); if (__pyx_t_3) { /* "pygame_sdl2/display.pyx":580 * for 0 <= i < num_modes: * if SDL_GetDisplayMode(display, i, &mode) == 0: * t = (mode.w, mode.h) # <<<<<<<<<<<<<< * if t not in rv: * rv.append(t) */ __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_mode.w); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 580, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_4 = __Pyx_PyInt_From_int(__pyx_v_mode.h); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 580, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_5 = PyTuple_New(2); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 580, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_GIVEREF(__pyx_t_1); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_1); __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_t_4); __pyx_t_1 = 0; __pyx_t_4 = 0; __Pyx_XDECREF_SET(__pyx_v_t, __pyx_t_5); __pyx_t_5 = 0; /* "pygame_sdl2/display.pyx":581 * if SDL_GetDisplayMode(display, i, &mode) == 0: * t = (mode.w, mode.h) * if t not in rv: # <<<<<<<<<<<<<< * rv.append(t) * */ __pyx_t_3 = (__Pyx_PySequence_ContainsTF(__pyx_v_t, __pyx_v_rv, Py_NE)); if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(0, 581, __pyx_L1_error) __pyx_t_7 = (__pyx_t_3 != 0); if (__pyx_t_7) { /* "pygame_sdl2/display.pyx":582 * t = (mode.w, mode.h) * if t not in rv: * rv.append(t) # <<<<<<<<<<<<<< * * return rv */ __pyx_t_8 = __Pyx_PyList_Append(__pyx_v_rv, __pyx_v_t); if (unlikely(__pyx_t_8 == ((int)-1))) __PYX_ERR(0, 582, __pyx_L1_error) /* "pygame_sdl2/display.pyx":581 * if SDL_GetDisplayMode(display, i, &mode) == 0: * t = (mode.w, mode.h) * if t not in rv: # <<<<<<<<<<<<<< * rv.append(t) * */ } /* "pygame_sdl2/display.pyx":579 * * for 0 <= i < num_modes: * if SDL_GetDisplayMode(display, i, &mode) == 0: # <<<<<<<<<<<<<< * t = (mode.w, mode.h) * if t not in rv: */ } } /* "pygame_sdl2/display.pyx":584 * rv.append(t) * * return rv # <<<<<<<<<<<<<< * * */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(__pyx_v_rv); __pyx_r = __pyx_v_rv; goto __pyx_L0; /* "pygame_sdl2/display.pyx":562 * * * def list_modes(depth=0, flags=0, display=0): # <<<<<<<<<<<<<< * """ * Returns a list of possible display modes for the display `display`. */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_5); __Pyx_AddTraceback("pygame_sdl2.display.list_modes", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF(__pyx_v_rv); __Pyx_XDECREF(__pyx_v_t); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/display.pyx":587 * * * def mode_ok(size, flags=0, depth=0): # <<<<<<<<<<<<<< * """ * Returns true if size is in the result of list_modes(). */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_7display_33mode_ok(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_11pygame_sdl2_7display_32mode_ok[] = "\n Returns true if size is in the result of list_modes().\n "; static PyMethodDef __pyx_mdef_11pygame_sdl2_7display_33mode_ok = {"mode_ok", (PyCFunction)__pyx_pw_11pygame_sdl2_7display_33mode_ok, METH_VARARGS|METH_KEYWORDS, __pyx_doc_11pygame_sdl2_7display_32mode_ok}; static PyObject *__pyx_pw_11pygame_sdl2_7display_33mode_ok(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_size = 0; CYTHON_UNUSED PyObject *__pyx_v_flags = 0; CYTHON_UNUSED PyObject *__pyx_v_depth = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("mode_ok (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_size,&__pyx_n_s_flags,&__pyx_n_s_depth,0}; PyObject* values[3] = {0,0,0}; values[1] = ((PyObject *)__pyx_int_0); values[2] = ((PyObject *)__pyx_int_0); if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_size)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (kw_args > 0) { PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_flags); if (value) { values[1] = value; kw_args--; } } CYTHON_FALLTHROUGH; case 2: if (kw_args > 0) { PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_depth); if (value) { values[2] = value; kw_args--; } } } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "mode_ok") < 0)) __PYX_ERR(0, 587, __pyx_L3_error) } } else { switch (PyTuple_GET_SIZE(__pyx_args)) { case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_size = values[0]; __pyx_v_flags = values[1]; __pyx_v_depth = values[2]; } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("mode_ok", 0, 1, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 587, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("pygame_sdl2.display.mode_ok", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_11pygame_sdl2_7display_32mode_ok(__pyx_self, __pyx_v_size, __pyx_v_flags, __pyx_v_depth); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_7display_32mode_ok(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_size, CYTHON_UNUSED PyObject *__pyx_v_flags, CYTHON_UNUSED PyObject *__pyx_v_depth) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; int __pyx_t_5; __Pyx_RefNannySetupContext("mode_ok", 0); /* "pygame_sdl2/display.pyx":592 * """ * * return tuple(size) in list_modes() # <<<<<<<<<<<<<< * * def gl_reset_attributes(): */ __Pyx_XDECREF(__pyx_r); __pyx_t_1 = __Pyx_PySequence_Tuple(__pyx_v_size); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 592, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_list_modes); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 592, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = NULL; if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) { __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3); if (likely(__pyx_t_4)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); __Pyx_INCREF(__pyx_t_4); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_3, function); } } if (__pyx_t_4) { __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 592, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; } else { __pyx_t_2 = __Pyx_PyObject_CallNoArg(__pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 592, __pyx_L1_error) } __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_5 = (__Pyx_PySequence_ContainsTF(__pyx_t_1, __pyx_t_2, Py_EQ)); if (unlikely(__pyx_t_5 < 0)) __PYX_ERR(0, 592, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_2 = __Pyx_PyBool_FromLong(__pyx_t_5); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 592, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; /* "pygame_sdl2/display.pyx":587 * * * def mode_ok(size, flags=0, depth=0): # <<<<<<<<<<<<<< * """ * Returns true if size is in the result of list_modes(). */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_AddTraceback("pygame_sdl2.display.mode_ok", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/display.pyx":594 * return tuple(size) in list_modes() * * def gl_reset_attributes(): # <<<<<<<<<<<<<< * SDL_GL_ResetAttributes() * */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_7display_35gl_reset_attributes(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused); /*proto*/ static PyMethodDef __pyx_mdef_11pygame_sdl2_7display_35gl_reset_attributes = {"gl_reset_attributes", (PyCFunction)__pyx_pw_11pygame_sdl2_7display_35gl_reset_attributes, METH_NOARGS, 0}; static PyObject *__pyx_pw_11pygame_sdl2_7display_35gl_reset_attributes(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("gl_reset_attributes (wrapper)", 0); __pyx_r = __pyx_pf_11pygame_sdl2_7display_34gl_reset_attributes(__pyx_self); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_7display_34gl_reset_attributes(CYTHON_UNUSED PyObject *__pyx_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("gl_reset_attributes", 0); /* "pygame_sdl2/display.pyx":595 * * def gl_reset_attributes(): * SDL_GL_ResetAttributes() # <<<<<<<<<<<<<< * * def gl_set_attribute(flag, value): */ SDL_GL_ResetAttributes(); /* "pygame_sdl2/display.pyx":594 * return tuple(size) in list_modes() * * def gl_reset_attributes(): # <<<<<<<<<<<<<< * SDL_GL_ResetAttributes() * */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/display.pyx":597 * SDL_GL_ResetAttributes() * * def gl_set_attribute(flag, value): # <<<<<<<<<<<<<< * * if flag == GL_SWAP_CONTROL: */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_7display_37gl_set_attribute(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static PyMethodDef __pyx_mdef_11pygame_sdl2_7display_37gl_set_attribute = {"gl_set_attribute", (PyCFunction)__pyx_pw_11pygame_sdl2_7display_37gl_set_attribute, METH_VARARGS|METH_KEYWORDS, 0}; static PyObject *__pyx_pw_11pygame_sdl2_7display_37gl_set_attribute(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_flag = 0; PyObject *__pyx_v_value = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("gl_set_attribute (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_flag,&__pyx_n_s_value,0}; PyObject* values[2] = {0,0}; if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_flag)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_value)) != 0)) kw_args--; else { __Pyx_RaiseArgtupleInvalid("gl_set_attribute", 1, 2, 2, 1); __PYX_ERR(0, 597, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "gl_set_attribute") < 0)) __PYX_ERR(0, 597, __pyx_L3_error) } } else if (PyTuple_GET_SIZE(__pyx_args) != 2) { goto __pyx_L5_argtuple_error; } else { values[0] = PyTuple_GET_ITEM(__pyx_args, 0); values[1] = PyTuple_GET_ITEM(__pyx_args, 1); } __pyx_v_flag = values[0]; __pyx_v_value = values[1]; } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("gl_set_attribute", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 597, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("pygame_sdl2.display.gl_set_attribute", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_11pygame_sdl2_7display_36gl_set_attribute(__pyx_self, __pyx_v_flag, __pyx_v_value); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_7display_36gl_set_attribute(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_flag, PyObject *__pyx_v_value) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; int __pyx_t_3; int __pyx_t_4; SDL_GLattr __pyx_t_5; PyObject *__pyx_t_6 = NULL; __Pyx_RefNannySetupContext("gl_set_attribute", 0); /* "pygame_sdl2/display.pyx":599 * def gl_set_attribute(flag, value): * * if flag == GL_SWAP_CONTROL: # <<<<<<<<<<<<<< * if ios: * return */ __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_GL_SWAP_CONTROL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 599, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = PyObject_RichCompare(__pyx_v_flag, __pyx_t_1, Py_EQ); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 599, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(0, 599, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; if (__pyx_t_3) { /* "pygame_sdl2/display.pyx":600 * * if flag == GL_SWAP_CONTROL: * if ios: # <<<<<<<<<<<<<< * return * */ __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_ios); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 600, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(0, 600, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; if (__pyx_t_3) { /* "pygame_sdl2/display.pyx":601 * if flag == GL_SWAP_CONTROL: * if ios: * return # <<<<<<<<<<<<<< * * global default_swap_control */ __Pyx_XDECREF(__pyx_r); __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; /* "pygame_sdl2/display.pyx":600 * * if flag == GL_SWAP_CONTROL: * if ios: # <<<<<<<<<<<<<< * return * */ } /* "pygame_sdl2/display.pyx":608 * # to deal with the case where the negative interval isn't * # supported. Then give up and carry on. * if SDL_GL_SetSwapInterval(value): # <<<<<<<<<<<<<< * SDL_GL_SetSwapInterval(-value) * */ __pyx_t_4 = __Pyx_PyInt_As_int(__pyx_v_value); if (unlikely((__pyx_t_4 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 608, __pyx_L1_error) __pyx_t_3 = (SDL_GL_SetSwapInterval(__pyx_t_4) != 0); if (__pyx_t_3) { /* "pygame_sdl2/display.pyx":609 * # supported. Then give up and carry on. * if SDL_GL_SetSwapInterval(value): * SDL_GL_SetSwapInterval(-value) # <<<<<<<<<<<<<< * * default_swap_control = value */ __pyx_t_2 = PyNumber_Negative(__pyx_v_value); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 609, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_4 = __Pyx_PyInt_As_int(__pyx_t_2); if (unlikely((__pyx_t_4 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 609, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; SDL_GL_SetSwapInterval(__pyx_t_4); /* "pygame_sdl2/display.pyx":608 * # to deal with the case where the negative interval isn't * # supported. Then give up and carry on. * if SDL_GL_SetSwapInterval(value): # <<<<<<<<<<<<<< * SDL_GL_SetSwapInterval(-value) * */ } /* "pygame_sdl2/display.pyx":611 * SDL_GL_SetSwapInterval(-value) * * default_swap_control = value # <<<<<<<<<<<<<< * return * */ if (PyDict_SetItem(__pyx_d, __pyx_n_s_default_swap_control, __pyx_v_value) < 0) __PYX_ERR(0, 611, __pyx_L1_error) /* "pygame_sdl2/display.pyx":612 * * default_swap_control = value * return # <<<<<<<<<<<<<< * * if SDL_GL_SetAttribute(flag, value): */ __Pyx_XDECREF(__pyx_r); __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; /* "pygame_sdl2/display.pyx":599 * def gl_set_attribute(flag, value): * * if flag == GL_SWAP_CONTROL: # <<<<<<<<<<<<<< * if ios: * return */ } /* "pygame_sdl2/display.pyx":614 * return * * if SDL_GL_SetAttribute(flag, value): # <<<<<<<<<<<<<< * raise error() * */ __pyx_t_5 = ((SDL_GLattr)__Pyx_PyInt_As_SDL_GLattr(__pyx_v_flag)); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 614, __pyx_L1_error) __pyx_t_4 = __Pyx_PyInt_As_int(__pyx_v_value); if (unlikely((__pyx_t_4 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 614, __pyx_L1_error) __pyx_t_3 = (SDL_GL_SetAttribute(__pyx_t_5, __pyx_t_4) != 0); if (__pyx_t_3) { /* "pygame_sdl2/display.pyx":615 * * if SDL_GL_SetAttribute(flag, value): * raise error() # <<<<<<<<<<<<<< * * def gl_get_attribute(flag): */ __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_error); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 615, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_6 = NULL; if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_1))) { __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_1); if (likely(__pyx_t_6)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1); __Pyx_INCREF(__pyx_t_6); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_1, function); } } if (__pyx_t_6) { __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_1, __pyx_t_6); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 615, __pyx_L1_error) __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; } else { __pyx_t_2 = __Pyx_PyObject_CallNoArg(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 615, __pyx_L1_error) } __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_Raise(__pyx_t_2, 0, 0, 0); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __PYX_ERR(0, 615, __pyx_L1_error) /* "pygame_sdl2/display.pyx":614 * return * * if SDL_GL_SetAttribute(flag, value): # <<<<<<<<<<<<<< * raise error() * */ } /* "pygame_sdl2/display.pyx":597 * SDL_GL_ResetAttributes() * * def gl_set_attribute(flag, value): # <<<<<<<<<<<<<< * * if flag == GL_SWAP_CONTROL: */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_6); __Pyx_AddTraceback("pygame_sdl2.display.gl_set_attribute", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/display.pyx":617 * raise error() * * def gl_get_attribute(flag): # <<<<<<<<<<<<<< * cdef int rv * */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_7display_39gl_get_attribute(PyObject *__pyx_self, PyObject *__pyx_v_flag); /*proto*/ static PyMethodDef __pyx_mdef_11pygame_sdl2_7display_39gl_get_attribute = {"gl_get_attribute", (PyCFunction)__pyx_pw_11pygame_sdl2_7display_39gl_get_attribute, METH_O, 0}; static PyObject *__pyx_pw_11pygame_sdl2_7display_39gl_get_attribute(PyObject *__pyx_self, PyObject *__pyx_v_flag) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("gl_get_attribute (wrapper)", 0); __pyx_r = __pyx_pf_11pygame_sdl2_7display_38gl_get_attribute(__pyx_self, ((PyObject *)__pyx_v_flag)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_7display_38gl_get_attribute(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_flag) { int __pyx_v_rv; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; int __pyx_t_3; SDL_GLattr __pyx_t_4; PyObject *__pyx_t_5 = NULL; __Pyx_RefNannySetupContext("gl_get_attribute", 0); /* "pygame_sdl2/display.pyx":620 * cdef int rv * * if flag == GL_SWAP_CONTROL: # <<<<<<<<<<<<<< * return SDL_GL_GetSwapInterval() * */ __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_GL_SWAP_CONTROL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 620, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = PyObject_RichCompare(__pyx_v_flag, __pyx_t_1, Py_EQ); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 620, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(0, 620, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; if (__pyx_t_3) { /* "pygame_sdl2/display.pyx":621 * * if flag == GL_SWAP_CONTROL: * return SDL_GL_GetSwapInterval() # <<<<<<<<<<<<<< * * if SDL_GL_GetAttribute(flag, &rv): */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __Pyx_PyInt_From_int(SDL_GL_GetSwapInterval()); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 621, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; /* "pygame_sdl2/display.pyx":620 * cdef int rv * * if flag == GL_SWAP_CONTROL: # <<<<<<<<<<<<<< * return SDL_GL_GetSwapInterval() * */ } /* "pygame_sdl2/display.pyx":623 * return SDL_GL_GetSwapInterval() * * if SDL_GL_GetAttribute(flag, &rv): # <<<<<<<<<<<<<< * raise error() * */ __pyx_t_4 = ((SDL_GLattr)__Pyx_PyInt_As_SDL_GLattr(__pyx_v_flag)); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 623, __pyx_L1_error) __pyx_t_3 = (SDL_GL_GetAttribute(__pyx_t_4, (&__pyx_v_rv)) != 0); if (__pyx_t_3) { /* "pygame_sdl2/display.pyx":624 * * if SDL_GL_GetAttribute(flag, &rv): * raise error() # <<<<<<<<<<<<<< * * return rv */ __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_error); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 624, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_5 = NULL; if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_1))) { __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_1); if (likely(__pyx_t_5)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1); __Pyx_INCREF(__pyx_t_5); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_1, function); } } if (__pyx_t_5) { __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_1, __pyx_t_5); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 624, __pyx_L1_error) __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; } else { __pyx_t_2 = __Pyx_PyObject_CallNoArg(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 624, __pyx_L1_error) } __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_Raise(__pyx_t_2, 0, 0, 0); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __PYX_ERR(0, 624, __pyx_L1_error) /* "pygame_sdl2/display.pyx":623 * return SDL_GL_GetSwapInterval() * * if SDL_GL_GetAttribute(flag, &rv): # <<<<<<<<<<<<<< * raise error() * */ } /* "pygame_sdl2/display.pyx":626 * raise error() * * return rv # <<<<<<<<<<<<<< * * def gl_load_library(path): */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_v_rv); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 626, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; /* "pygame_sdl2/display.pyx":617 * raise error() * * def gl_get_attribute(flag): # <<<<<<<<<<<<<< * cdef int rv * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_5); __Pyx_AddTraceback("pygame_sdl2.display.gl_get_attribute", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/display.pyx":628 * return rv * * def gl_load_library(path): # <<<<<<<<<<<<<< * if path is None: * if SDL_GL_LoadLibrary(NULL): */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_7display_41gl_load_library(PyObject *__pyx_self, PyObject *__pyx_v_path); /*proto*/ static PyMethodDef __pyx_mdef_11pygame_sdl2_7display_41gl_load_library = {"gl_load_library", (PyCFunction)__pyx_pw_11pygame_sdl2_7display_41gl_load_library, METH_O, 0}; static PyObject *__pyx_pw_11pygame_sdl2_7display_41gl_load_library(PyObject *__pyx_self, PyObject *__pyx_v_path) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("gl_load_library (wrapper)", 0); __pyx_r = __pyx_pf_11pygame_sdl2_7display_40gl_load_library(__pyx_self, ((PyObject *)__pyx_v_path)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_7display_40gl_load_library(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_path) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; int __pyx_t_2; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; PyObject *__pyx_t_5 = NULL; char const *__pyx_t_6; __Pyx_RefNannySetupContext("gl_load_library", 0); /* "pygame_sdl2/display.pyx":629 * * def gl_load_library(path): * if path is None: # <<<<<<<<<<<<<< * if SDL_GL_LoadLibrary(NULL): * raise error() */ __pyx_t_1 = (__pyx_v_path == Py_None); __pyx_t_2 = (__pyx_t_1 != 0); if (__pyx_t_2) { /* "pygame_sdl2/display.pyx":630 * def gl_load_library(path): * if path is None: * if SDL_GL_LoadLibrary(NULL): # <<<<<<<<<<<<<< * raise error() * else: */ __pyx_t_2 = (SDL_GL_LoadLibrary(NULL) != 0); if (__pyx_t_2) { /* "pygame_sdl2/display.pyx":631 * if path is None: * if SDL_GL_LoadLibrary(NULL): * raise error() # <<<<<<<<<<<<<< * else: * if SDL_GL_LoadLibrary(path): */ __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_error); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 631, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_5 = NULL; if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_4))) { __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4); if (likely(__pyx_t_5)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4); __Pyx_INCREF(__pyx_t_5); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_4, function); } } if (__pyx_t_5) { __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_5); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 631, __pyx_L1_error) __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; } else { __pyx_t_3 = __Pyx_PyObject_CallNoArg(__pyx_t_4); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 631, __pyx_L1_error) } __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_Raise(__pyx_t_3, 0, 0, 0); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __PYX_ERR(0, 631, __pyx_L1_error) /* "pygame_sdl2/display.pyx":630 * def gl_load_library(path): * if path is None: * if SDL_GL_LoadLibrary(NULL): # <<<<<<<<<<<<<< * raise error() * else: */ } /* "pygame_sdl2/display.pyx":629 * * def gl_load_library(path): * if path is None: # <<<<<<<<<<<<<< * if SDL_GL_LoadLibrary(NULL): * raise error() */ goto __pyx_L3; } /* "pygame_sdl2/display.pyx":633 * raise error() * else: * if SDL_GL_LoadLibrary(path): # <<<<<<<<<<<<<< * raise error() * */ /*else*/ { __pyx_t_6 = __Pyx_PyObject_AsString(__pyx_v_path); if (unlikely((!__pyx_t_6) && PyErr_Occurred())) __PYX_ERR(0, 633, __pyx_L1_error) __pyx_t_2 = (SDL_GL_LoadLibrary(__pyx_t_6) != 0); if (__pyx_t_2) { /* "pygame_sdl2/display.pyx":634 * else: * if SDL_GL_LoadLibrary(path): * raise error() # <<<<<<<<<<<<<< * * def gl_unload_library(): */ __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_error); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 634, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_5 = NULL; if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_4))) { __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4); if (likely(__pyx_t_5)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4); __Pyx_INCREF(__pyx_t_5); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_4, function); } } if (__pyx_t_5) { __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_5); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 634, __pyx_L1_error) __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; } else { __pyx_t_3 = __Pyx_PyObject_CallNoArg(__pyx_t_4); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 634, __pyx_L1_error) } __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_Raise(__pyx_t_3, 0, 0, 0); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __PYX_ERR(0, 634, __pyx_L1_error) /* "pygame_sdl2/display.pyx":633 * raise error() * else: * if SDL_GL_LoadLibrary(path): # <<<<<<<<<<<<<< * raise error() * */ } } __pyx_L3:; /* "pygame_sdl2/display.pyx":628 * return rv * * def gl_load_library(path): # <<<<<<<<<<<<<< * if path is None: * if SDL_GL_LoadLibrary(NULL): */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_5); __Pyx_AddTraceback("pygame_sdl2.display.gl_load_library", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/display.pyx":636 * raise error() * * def gl_unload_library(): # <<<<<<<<<<<<<< * SDL_GL_UnloadLibrary() * */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_7display_43gl_unload_library(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused); /*proto*/ static PyMethodDef __pyx_mdef_11pygame_sdl2_7display_43gl_unload_library = {"gl_unload_library", (PyCFunction)__pyx_pw_11pygame_sdl2_7display_43gl_unload_library, METH_NOARGS, 0}; static PyObject *__pyx_pw_11pygame_sdl2_7display_43gl_unload_library(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("gl_unload_library (wrapper)", 0); __pyx_r = __pyx_pf_11pygame_sdl2_7display_42gl_unload_library(__pyx_self); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_7display_42gl_unload_library(CYTHON_UNUSED PyObject *__pyx_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("gl_unload_library", 0); /* "pygame_sdl2/display.pyx":637 * * def gl_unload_library(): * SDL_GL_UnloadLibrary() # <<<<<<<<<<<<<< * * def get_active(): */ SDL_GL_UnloadLibrary(); /* "pygame_sdl2/display.pyx":636 * raise error() * * def gl_unload_library(): # <<<<<<<<<<<<<< * SDL_GL_UnloadLibrary() * */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/display.pyx":639 * SDL_GL_UnloadLibrary() * * def get_active(): # <<<<<<<<<<<<<< * if main_window: * return main_window.get_active() */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_7display_45get_active(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused); /*proto*/ static PyMethodDef __pyx_mdef_11pygame_sdl2_7display_45get_active = {"get_active", (PyCFunction)__pyx_pw_11pygame_sdl2_7display_45get_active, METH_NOARGS, 0}; static PyObject *__pyx_pw_11pygame_sdl2_7display_45get_active(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("get_active (wrapper)", 0); __pyx_r = __pyx_pf_11pygame_sdl2_7display_44get_active(__pyx_self); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_7display_44get_active(CYTHON_UNUSED PyObject *__pyx_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; __Pyx_RefNannySetupContext("get_active", 0); /* "pygame_sdl2/display.pyx":640 * * def get_active(): * if main_window: # <<<<<<<<<<<<<< * return main_window.get_active() * return False */ __pyx_t_1 = __Pyx_PyObject_IsTrue(((PyObject *)__pyx_v_11pygame_sdl2_7display_main_window)); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(0, 640, __pyx_L1_error) if (__pyx_t_1) { /* "pygame_sdl2/display.pyx":641 * def get_active(): * if main_window: * return main_window.get_active() # <<<<<<<<<<<<<< * return False * */ __Pyx_XDECREF(__pyx_r); __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_11pygame_sdl2_7display_main_window), __pyx_n_s_get_active); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 641, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = NULL; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) { __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3); if (likely(__pyx_t_4)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); __Pyx_INCREF(__pyx_t_4); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_3, function); } } if (__pyx_t_4) { __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 641, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; } else { __pyx_t_2 = __Pyx_PyObject_CallNoArg(__pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 641, __pyx_L1_error) } __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; /* "pygame_sdl2/display.pyx":640 * * def get_active(): * if main_window: # <<<<<<<<<<<<<< * return main_window.get_active() * return False */ } /* "pygame_sdl2/display.pyx":642 * if main_window: * return main_window.get_active() * return False # <<<<<<<<<<<<<< * * def iconify(): */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(Py_False); __pyx_r = Py_False; goto __pyx_L0; /* "pygame_sdl2/display.pyx":639 * SDL_GL_UnloadLibrary() * * def get_active(): # <<<<<<<<<<<<<< * if main_window: * return main_window.get_active() */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_AddTraceback("pygame_sdl2.display.get_active", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/display.pyx":644 * return False * * def iconify(): # <<<<<<<<<<<<<< * if main_window: * return main_window.iconify() */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_7display_47iconify(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused); /*proto*/ static PyMethodDef __pyx_mdef_11pygame_sdl2_7display_47iconify = {"iconify", (PyCFunction)__pyx_pw_11pygame_sdl2_7display_47iconify, METH_NOARGS, 0}; static PyObject *__pyx_pw_11pygame_sdl2_7display_47iconify(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("iconify (wrapper)", 0); __pyx_r = __pyx_pf_11pygame_sdl2_7display_46iconify(__pyx_self); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_7display_46iconify(CYTHON_UNUSED PyObject *__pyx_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; __Pyx_RefNannySetupContext("iconify", 0); /* "pygame_sdl2/display.pyx":645 * * def iconify(): * if main_window: # <<<<<<<<<<<<<< * return main_window.iconify() * */ __pyx_t_1 = __Pyx_PyObject_IsTrue(((PyObject *)__pyx_v_11pygame_sdl2_7display_main_window)); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(0, 645, __pyx_L1_error) if (__pyx_t_1) { /* "pygame_sdl2/display.pyx":646 * def iconify(): * if main_window: * return main_window.iconify() # <<<<<<<<<<<<<< * * return False */ __Pyx_XDECREF(__pyx_r); __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_11pygame_sdl2_7display_main_window), __pyx_n_s_iconify); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 646, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = NULL; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) { __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3); if (likely(__pyx_t_4)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); __Pyx_INCREF(__pyx_t_4); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_3, function); } } if (__pyx_t_4) { __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 646, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; } else { __pyx_t_2 = __Pyx_PyObject_CallNoArg(__pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 646, __pyx_L1_error) } __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; /* "pygame_sdl2/display.pyx":645 * * def iconify(): * if main_window: # <<<<<<<<<<<<<< * return main_window.iconify() * */ } /* "pygame_sdl2/display.pyx":648 * return main_window.iconify() * * return False # <<<<<<<<<<<<<< * * def toggle_fullscreen(): */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(Py_False); __pyx_r = Py_False; goto __pyx_L0; /* "pygame_sdl2/display.pyx":644 * return False * * def iconify(): # <<<<<<<<<<<<<< * if main_window: * return main_window.iconify() */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_AddTraceback("pygame_sdl2.display.iconify", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/display.pyx":650 * return False * * def toggle_fullscreen(): # <<<<<<<<<<<<<< * if main_window: * return main_window.toggle_fullscreen() */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_7display_49toggle_fullscreen(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused); /*proto*/ static PyMethodDef __pyx_mdef_11pygame_sdl2_7display_49toggle_fullscreen = {"toggle_fullscreen", (PyCFunction)__pyx_pw_11pygame_sdl2_7display_49toggle_fullscreen, METH_NOARGS, 0}; static PyObject *__pyx_pw_11pygame_sdl2_7display_49toggle_fullscreen(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("toggle_fullscreen (wrapper)", 0); __pyx_r = __pyx_pf_11pygame_sdl2_7display_48toggle_fullscreen(__pyx_self); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_7display_48toggle_fullscreen(CYTHON_UNUSED PyObject *__pyx_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; __Pyx_RefNannySetupContext("toggle_fullscreen", 0); /* "pygame_sdl2/display.pyx":651 * * def toggle_fullscreen(): * if main_window: # <<<<<<<<<<<<<< * return main_window.toggle_fullscreen() * */ __pyx_t_1 = __Pyx_PyObject_IsTrue(((PyObject *)__pyx_v_11pygame_sdl2_7display_main_window)); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(0, 651, __pyx_L1_error) if (__pyx_t_1) { /* "pygame_sdl2/display.pyx":652 * def toggle_fullscreen(): * if main_window: * return main_window.toggle_fullscreen() # <<<<<<<<<<<<<< * * return True */ __Pyx_XDECREF(__pyx_r); __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_11pygame_sdl2_7display_main_window), __pyx_n_s_toggle_fullscreen); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 652, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = NULL; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) { __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3); if (likely(__pyx_t_4)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); __Pyx_INCREF(__pyx_t_4); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_3, function); } } if (__pyx_t_4) { __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 652, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; } else { __pyx_t_2 = __Pyx_PyObject_CallNoArg(__pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 652, __pyx_L1_error) } __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; /* "pygame_sdl2/display.pyx":651 * * def toggle_fullscreen(): * if main_window: # <<<<<<<<<<<<<< * return main_window.toggle_fullscreen() * */ } /* "pygame_sdl2/display.pyx":654 * return main_window.toggle_fullscreen() * * return True # <<<<<<<<<<<<<< * * def set_gamma(red, green=None, blue=None): */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(Py_True); __pyx_r = Py_True; goto __pyx_L0; /* "pygame_sdl2/display.pyx":650 * return False * * def toggle_fullscreen(): # <<<<<<<<<<<<<< * if main_window: * return main_window.toggle_fullscreen() */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_AddTraceback("pygame_sdl2.display.toggle_fullscreen", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/display.pyx":656 * return True * * def set_gamma(red, green=None, blue=None): # <<<<<<<<<<<<<< * if main_window: * return main_window.set_gamma(red, green, blue) */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_7display_51set_gamma(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static PyMethodDef __pyx_mdef_11pygame_sdl2_7display_51set_gamma = {"set_gamma", (PyCFunction)__pyx_pw_11pygame_sdl2_7display_51set_gamma, METH_VARARGS|METH_KEYWORDS, 0}; static PyObject *__pyx_pw_11pygame_sdl2_7display_51set_gamma(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_red = 0; PyObject *__pyx_v_green = 0; PyObject *__pyx_v_blue = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("set_gamma (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_red,&__pyx_n_s_green,&__pyx_n_s_blue,0}; PyObject* values[3] = {0,0,0}; values[1] = ((PyObject *)Py_None); values[2] = ((PyObject *)Py_None); if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_red)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (kw_args > 0) { PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_green); if (value) { values[1] = value; kw_args--; } } CYTHON_FALLTHROUGH; case 2: if (kw_args > 0) { PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_blue); if (value) { values[2] = value; kw_args--; } } } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "set_gamma") < 0)) __PYX_ERR(0, 656, __pyx_L3_error) } } else { switch (PyTuple_GET_SIZE(__pyx_args)) { case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_red = values[0]; __pyx_v_green = values[1]; __pyx_v_blue = values[2]; } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("set_gamma", 0, 1, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 656, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("pygame_sdl2.display.set_gamma", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_11pygame_sdl2_7display_50set_gamma(__pyx_self, __pyx_v_red, __pyx_v_green, __pyx_v_blue); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_7display_50set_gamma(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_red, PyObject *__pyx_v_green, PyObject *__pyx_v_blue) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; int __pyx_t_5; PyObject *__pyx_t_6 = NULL; __Pyx_RefNannySetupContext("set_gamma", 0); /* "pygame_sdl2/display.pyx":657 * * def set_gamma(red, green=None, blue=None): * if main_window: # <<<<<<<<<<<<<< * return main_window.set_gamma(red, green, blue) * return False */ __pyx_t_1 = __Pyx_PyObject_IsTrue(((PyObject *)__pyx_v_11pygame_sdl2_7display_main_window)); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(0, 657, __pyx_L1_error) if (__pyx_t_1) { /* "pygame_sdl2/display.pyx":658 * def set_gamma(red, green=None, blue=None): * if main_window: * return main_window.set_gamma(red, green, blue) # <<<<<<<<<<<<<< * return False * */ __Pyx_XDECREF(__pyx_r); __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_11pygame_sdl2_7display_main_window), __pyx_n_s_set_gamma); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 658, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = NULL; __pyx_t_5 = 0; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) { __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3); if (likely(__pyx_t_4)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); __Pyx_INCREF(__pyx_t_4); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_3, function); __pyx_t_5 = 1; } } #if CYTHON_FAST_PYCALL if (PyFunction_Check(__pyx_t_3)) { PyObject *__pyx_temp[4] = {__pyx_t_4, __pyx_v_red, __pyx_v_green, __pyx_v_blue}; __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_5, 3+__pyx_t_5); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 658, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_GOTREF(__pyx_t_2); } else #endif #if CYTHON_FAST_PYCCALL if (__Pyx_PyFastCFunction_Check(__pyx_t_3)) { PyObject *__pyx_temp[4] = {__pyx_t_4, __pyx_v_red, __pyx_v_green, __pyx_v_blue}; __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_5, 3+__pyx_t_5); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 658, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_GOTREF(__pyx_t_2); } else #endif { __pyx_t_6 = PyTuple_New(3+__pyx_t_5); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 658, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); if (__pyx_t_4) { __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_4); __pyx_t_4 = NULL; } __Pyx_INCREF(__pyx_v_red); __Pyx_GIVEREF(__pyx_v_red); PyTuple_SET_ITEM(__pyx_t_6, 0+__pyx_t_5, __pyx_v_red); __Pyx_INCREF(__pyx_v_green); __Pyx_GIVEREF(__pyx_v_green); PyTuple_SET_ITEM(__pyx_t_6, 1+__pyx_t_5, __pyx_v_green); __Pyx_INCREF(__pyx_v_blue); __Pyx_GIVEREF(__pyx_v_blue); PyTuple_SET_ITEM(__pyx_t_6, 2+__pyx_t_5, __pyx_v_blue); __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_6, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 658, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; } __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; /* "pygame_sdl2/display.pyx":657 * * def set_gamma(red, green=None, blue=None): * if main_window: # <<<<<<<<<<<<<< * return main_window.set_gamma(red, green, blue) * return False */ } /* "pygame_sdl2/display.pyx":659 * if main_window: * return main_window.set_gamma(red, green, blue) * return False # <<<<<<<<<<<<<< * * def set_gamma_ramp(red, green, blue): */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(Py_False); __pyx_r = Py_False; goto __pyx_L0; /* "pygame_sdl2/display.pyx":656 * return True * * def set_gamma(red, green=None, blue=None): # <<<<<<<<<<<<<< * if main_window: * return main_window.set_gamma(red, green, blue) */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_6); __Pyx_AddTraceback("pygame_sdl2.display.set_gamma", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/display.pyx":661 * return False * * def set_gamma_ramp(red, green, blue): # <<<<<<<<<<<<<< * if main_window: * return main_window.set_gamma_ramp(red, green, blue) */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_7display_53set_gamma_ramp(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static PyMethodDef __pyx_mdef_11pygame_sdl2_7display_53set_gamma_ramp = {"set_gamma_ramp", (PyCFunction)__pyx_pw_11pygame_sdl2_7display_53set_gamma_ramp, METH_VARARGS|METH_KEYWORDS, 0}; static PyObject *__pyx_pw_11pygame_sdl2_7display_53set_gamma_ramp(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_red = 0; PyObject *__pyx_v_green = 0; PyObject *__pyx_v_blue = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("set_gamma_ramp (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_red,&__pyx_n_s_green,&__pyx_n_s_blue,0}; PyObject* values[3] = {0,0,0}; if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_red)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_green)) != 0)) kw_args--; else { __Pyx_RaiseArgtupleInvalid("set_gamma_ramp", 1, 3, 3, 1); __PYX_ERR(0, 661, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 2: if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_blue)) != 0)) kw_args--; else { __Pyx_RaiseArgtupleInvalid("set_gamma_ramp", 1, 3, 3, 2); __PYX_ERR(0, 661, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "set_gamma_ramp") < 0)) __PYX_ERR(0, 661, __pyx_L3_error) } } else if (PyTuple_GET_SIZE(__pyx_args) != 3) { goto __pyx_L5_argtuple_error; } else { values[0] = PyTuple_GET_ITEM(__pyx_args, 0); values[1] = PyTuple_GET_ITEM(__pyx_args, 1); values[2] = PyTuple_GET_ITEM(__pyx_args, 2); } __pyx_v_red = values[0]; __pyx_v_green = values[1]; __pyx_v_blue = values[2]; } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("set_gamma_ramp", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 661, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("pygame_sdl2.display.set_gamma_ramp", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_11pygame_sdl2_7display_52set_gamma_ramp(__pyx_self, __pyx_v_red, __pyx_v_green, __pyx_v_blue); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_7display_52set_gamma_ramp(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_red, PyObject *__pyx_v_green, PyObject *__pyx_v_blue) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; int __pyx_t_5; PyObject *__pyx_t_6 = NULL; __Pyx_RefNannySetupContext("set_gamma_ramp", 0); /* "pygame_sdl2/display.pyx":662 * * def set_gamma_ramp(red, green, blue): * if main_window: # <<<<<<<<<<<<<< * return main_window.set_gamma_ramp(red, green, blue) * return False */ __pyx_t_1 = __Pyx_PyObject_IsTrue(((PyObject *)__pyx_v_11pygame_sdl2_7display_main_window)); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(0, 662, __pyx_L1_error) if (__pyx_t_1) { /* "pygame_sdl2/display.pyx":663 * def set_gamma_ramp(red, green, blue): * if main_window: * return main_window.set_gamma_ramp(red, green, blue) # <<<<<<<<<<<<<< * return False * */ __Pyx_XDECREF(__pyx_r); __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_11pygame_sdl2_7display_main_window), __pyx_n_s_set_gamma_ramp); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 663, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = NULL; __pyx_t_5 = 0; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) { __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3); if (likely(__pyx_t_4)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); __Pyx_INCREF(__pyx_t_4); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_3, function); __pyx_t_5 = 1; } } #if CYTHON_FAST_PYCALL if (PyFunction_Check(__pyx_t_3)) { PyObject *__pyx_temp[4] = {__pyx_t_4, __pyx_v_red, __pyx_v_green, __pyx_v_blue}; __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_5, 3+__pyx_t_5); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 663, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_GOTREF(__pyx_t_2); } else #endif #if CYTHON_FAST_PYCCALL if (__Pyx_PyFastCFunction_Check(__pyx_t_3)) { PyObject *__pyx_temp[4] = {__pyx_t_4, __pyx_v_red, __pyx_v_green, __pyx_v_blue}; __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_5, 3+__pyx_t_5); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 663, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_GOTREF(__pyx_t_2); } else #endif { __pyx_t_6 = PyTuple_New(3+__pyx_t_5); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 663, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); if (__pyx_t_4) { __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_4); __pyx_t_4 = NULL; } __Pyx_INCREF(__pyx_v_red); __Pyx_GIVEREF(__pyx_v_red); PyTuple_SET_ITEM(__pyx_t_6, 0+__pyx_t_5, __pyx_v_red); __Pyx_INCREF(__pyx_v_green); __Pyx_GIVEREF(__pyx_v_green); PyTuple_SET_ITEM(__pyx_t_6, 1+__pyx_t_5, __pyx_v_green); __Pyx_INCREF(__pyx_v_blue); __Pyx_GIVEREF(__pyx_v_blue); PyTuple_SET_ITEM(__pyx_t_6, 2+__pyx_t_5, __pyx_v_blue); __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_6, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 663, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; } __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; /* "pygame_sdl2/display.pyx":662 * * def set_gamma_ramp(red, green, blue): * if main_window: # <<<<<<<<<<<<<< * return main_window.set_gamma_ramp(red, green, blue) * return False */ } /* "pygame_sdl2/display.pyx":664 * if main_window: * return main_window.set_gamma_ramp(red, green, blue) * return False # <<<<<<<<<<<<<< * * def set_icon(surface): */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(Py_False); __pyx_r = Py_False; goto __pyx_L0; /* "pygame_sdl2/display.pyx":661 * return False * * def set_gamma_ramp(red, green, blue): # <<<<<<<<<<<<<< * if main_window: * return main_window.set_gamma_ramp(red, green, blue) */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_6); __Pyx_AddTraceback("pygame_sdl2.display.set_gamma_ramp", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/display.pyx":666 * return False * * def set_icon(surface): # <<<<<<<<<<<<<< * global default_icon * */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_7display_55set_icon(PyObject *__pyx_self, PyObject *__pyx_v_surface); /*proto*/ static PyMethodDef __pyx_mdef_11pygame_sdl2_7display_55set_icon = {"set_icon", (PyCFunction)__pyx_pw_11pygame_sdl2_7display_55set_icon, METH_O, 0}; static PyObject *__pyx_pw_11pygame_sdl2_7display_55set_icon(PyObject *__pyx_self, PyObject *__pyx_v_surface) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("set_icon (wrapper)", 0); __pyx_r = __pyx_pf_11pygame_sdl2_7display_54set_icon(__pyx_self, ((PyObject *)__pyx_v_surface)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_7display_54set_icon(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_surface) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; int __pyx_t_4; int __pyx_t_5; PyObject *__pyx_t_6 = NULL; PyObject *__pyx_t_7 = NULL; __Pyx_RefNannySetupContext("set_icon", 0); /* "pygame_sdl2/display.pyx":669 * global default_icon * * default_icon = surface.copy() # <<<<<<<<<<<<<< * * if main_window is not None: */ __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_surface, __pyx_n_s_copy); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 669, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = NULL; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); if (likely(__pyx_t_3)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); } } if (__pyx_t_3) { __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 669, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } else { __pyx_t_1 = __Pyx_PyObject_CallNoArg(__pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 669, __pyx_L1_error) } __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; if (PyDict_SetItem(__pyx_d, __pyx_n_s_default_icon, __pyx_t_1) < 0) __PYX_ERR(0, 669, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "pygame_sdl2/display.pyx":671 * default_icon = surface.copy() * * if main_window is not None: # <<<<<<<<<<<<<< * main_window.set_icon(default_icon) * */ __pyx_t_4 = (((PyObject *)__pyx_v_11pygame_sdl2_7display_main_window) != Py_None); __pyx_t_5 = (__pyx_t_4 != 0); if (__pyx_t_5) { /* "pygame_sdl2/display.pyx":672 * * if main_window is not None: * main_window.set_icon(default_icon) # <<<<<<<<<<<<<< * * def set_caption(title, icontitle = None): */ __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_11pygame_sdl2_7display_main_window), __pyx_n_s_set_icon); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 672, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_default_icon); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 672, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_6 = NULL; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) { __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_2); if (likely(__pyx_t_6)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_6); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); } } if (!__pyx_t_6) { __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 672, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_GOTREF(__pyx_t_1); } else { #if CYTHON_FAST_PYCALL if (PyFunction_Check(__pyx_t_2)) { PyObject *__pyx_temp[2] = {__pyx_t_6, __pyx_t_3}; __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_2, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 672, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } else #endif #if CYTHON_FAST_PYCCALL if (__Pyx_PyFastCFunction_Check(__pyx_t_2)) { PyObject *__pyx_temp[2] = {__pyx_t_6, __pyx_t_3}; __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_2, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 672, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } else #endif { __pyx_t_7 = PyTuple_New(1+1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 672, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_GIVEREF(__pyx_t_6); PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_6); __pyx_t_6 = NULL; __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_7, 0+1, __pyx_t_3); __pyx_t_3 = 0; __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_7, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 672, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; } } __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "pygame_sdl2/display.pyx":671 * default_icon = surface.copy() * * if main_window is not None: # <<<<<<<<<<<<<< * main_window.set_icon(default_icon) * */ } /* "pygame_sdl2/display.pyx":666 * return False * * def set_icon(surface): # <<<<<<<<<<<<<< * global default_icon * */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_6); __Pyx_XDECREF(__pyx_t_7); __Pyx_AddTraceback("pygame_sdl2.display.set_icon", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/display.pyx":674 * main_window.set_icon(default_icon) * * def set_caption(title, icontitle = None): # <<<<<<<<<<<<<< * global default_title * */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_7display_57set_caption(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static PyMethodDef __pyx_mdef_11pygame_sdl2_7display_57set_caption = {"set_caption", (PyCFunction)__pyx_pw_11pygame_sdl2_7display_57set_caption, METH_VARARGS|METH_KEYWORDS, 0}; static PyObject *__pyx_pw_11pygame_sdl2_7display_57set_caption(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_title = 0; CYTHON_UNUSED PyObject *__pyx_v_icontitle = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("set_caption (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_title,&__pyx_n_s_icontitle,0}; PyObject* values[2] = {0,0}; values[1] = ((PyObject *)Py_None); if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_title)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (kw_args > 0) { PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_icontitle); if (value) { values[1] = value; kw_args--; } } } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "set_caption") < 0)) __PYX_ERR(0, 674, __pyx_L3_error) } } else { switch (PyTuple_GET_SIZE(__pyx_args)) { case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_title = values[0]; __pyx_v_icontitle = values[1]; } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("set_caption", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 674, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("pygame_sdl2.display.set_caption", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_11pygame_sdl2_7display_56set_caption(__pyx_self, __pyx_v_title, __pyx_v_icontitle); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_7display_56set_caption(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_title, CYTHON_UNUSED PyObject *__pyx_v_icontitle) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; PyObject *__pyx_t_5 = NULL; PyObject *__pyx_t_6 = NULL; __Pyx_RefNannySetupContext("set_caption", 0); /* "pygame_sdl2/display.pyx":677 * global default_title * * default_title = title # <<<<<<<<<<<<<< * * if main_window: */ if (PyDict_SetItem(__pyx_d, __pyx_n_s_default_title, __pyx_v_title) < 0) __PYX_ERR(0, 677, __pyx_L1_error) /* "pygame_sdl2/display.pyx":679 * default_title = title * * if main_window: # <<<<<<<<<<<<<< * main_window.set_caption(default_title) * */ __pyx_t_1 = __Pyx_PyObject_IsTrue(((PyObject *)__pyx_v_11pygame_sdl2_7display_main_window)); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(0, 679, __pyx_L1_error) if (__pyx_t_1) { /* "pygame_sdl2/display.pyx":680 * * if main_window: * main_window.set_caption(default_title) # <<<<<<<<<<<<<< * * def get_caption(): */ __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_11pygame_sdl2_7display_main_window), __pyx_n_s_set_caption); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 680, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_default_title); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 680, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_5 = NULL; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) { __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_3); if (likely(__pyx_t_5)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); __Pyx_INCREF(__pyx_t_5); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_3, function); } } if (!__pyx_t_5) { __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 680, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_GOTREF(__pyx_t_2); } else { #if CYTHON_FAST_PYCALL if (PyFunction_Check(__pyx_t_3)) { PyObject *__pyx_temp[2] = {__pyx_t_5, __pyx_t_4}; __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_3, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 680, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; } else #endif #if CYTHON_FAST_PYCCALL if (__Pyx_PyFastCFunction_Check(__pyx_t_3)) { PyObject *__pyx_temp[2] = {__pyx_t_5, __pyx_t_4}; __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 680, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; } else #endif { __pyx_t_6 = PyTuple_New(1+1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 680, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_5); __pyx_t_5 = NULL; __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_6, 0+1, __pyx_t_4); __pyx_t_4 = 0; __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_6, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 680, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; } } __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "pygame_sdl2/display.pyx":679 * default_title = title * * if main_window: # <<<<<<<<<<<<<< * main_window.set_caption(default_title) * */ } /* "pygame_sdl2/display.pyx":674 * main_window.set_icon(default_icon) * * def set_caption(title, icontitle = None): # <<<<<<<<<<<<<< * global default_title * */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_5); __Pyx_XDECREF(__pyx_t_6); __Pyx_AddTraceback("pygame_sdl2.display.set_caption", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/display.pyx":682 * main_window.set_caption(default_title) * * def get_caption(): # <<<<<<<<<<<<<< * return default_title * */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_7display_59get_caption(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused); /*proto*/ static PyMethodDef __pyx_mdef_11pygame_sdl2_7display_59get_caption = {"get_caption", (PyCFunction)__pyx_pw_11pygame_sdl2_7display_59get_caption, METH_NOARGS, 0}; static PyObject *__pyx_pw_11pygame_sdl2_7display_59get_caption(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("get_caption (wrapper)", 0); __pyx_r = __pyx_pf_11pygame_sdl2_7display_58get_caption(__pyx_self); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_7display_58get_caption(CYTHON_UNUSED PyObject *__pyx_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; __Pyx_RefNannySetupContext("get_caption", 0); /* "pygame_sdl2/display.pyx":683 * * def get_caption(): * return default_title # <<<<<<<<<<<<<< * * def get_drawable_size(): */ __Pyx_XDECREF(__pyx_r); __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_default_title); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 683, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "pygame_sdl2/display.pyx":682 * main_window.set_caption(default_title) * * def get_caption(): # <<<<<<<<<<<<<< * return default_title * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("pygame_sdl2.display.get_caption", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/display.pyx":685 * return default_title * * def get_drawable_size(): # <<<<<<<<<<<<<< * if main_window: * return main_window.get_drawable_size() */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_7display_61get_drawable_size(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused); /*proto*/ static PyMethodDef __pyx_mdef_11pygame_sdl2_7display_61get_drawable_size = {"get_drawable_size", (PyCFunction)__pyx_pw_11pygame_sdl2_7display_61get_drawable_size, METH_NOARGS, 0}; static PyObject *__pyx_pw_11pygame_sdl2_7display_61get_drawable_size(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("get_drawable_size (wrapper)", 0); __pyx_r = __pyx_pf_11pygame_sdl2_7display_60get_drawable_size(__pyx_self); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_7display_60get_drawable_size(CYTHON_UNUSED PyObject *__pyx_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; __Pyx_RefNannySetupContext("get_drawable_size", 0); /* "pygame_sdl2/display.pyx":686 * * def get_drawable_size(): * if main_window: # <<<<<<<<<<<<<< * return main_window.get_drawable_size() * return None */ __pyx_t_1 = __Pyx_PyObject_IsTrue(((PyObject *)__pyx_v_11pygame_sdl2_7display_main_window)); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(0, 686, __pyx_L1_error) if (__pyx_t_1) { /* "pygame_sdl2/display.pyx":687 * def get_drawable_size(): * if main_window: * return main_window.get_drawable_size() # <<<<<<<<<<<<<< * return None * */ __Pyx_XDECREF(__pyx_r); __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_11pygame_sdl2_7display_main_window), __pyx_n_s_get_drawable_size); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 687, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = NULL; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) { __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3); if (likely(__pyx_t_4)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); __Pyx_INCREF(__pyx_t_4); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_3, function); } } if (__pyx_t_4) { __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 687, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; } else { __pyx_t_2 = __Pyx_PyObject_CallNoArg(__pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 687, __pyx_L1_error) } __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; /* "pygame_sdl2/display.pyx":686 * * def get_drawable_size(): * if main_window: # <<<<<<<<<<<<<< * return main_window.get_drawable_size() * return None */ } /* "pygame_sdl2/display.pyx":688 * if main_window: * return main_window.get_drawable_size() * return None # <<<<<<<<<<<<<< * * def get_num_video_displays(): */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(Py_None); __pyx_r = Py_None; goto __pyx_L0; /* "pygame_sdl2/display.pyx":685 * return default_title * * def get_drawable_size(): # <<<<<<<<<<<<<< * if main_window: * return main_window.get_drawable_size() */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_AddTraceback("pygame_sdl2.display.get_drawable_size", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/display.pyx":690 * return None * * def get_num_video_displays(): # <<<<<<<<<<<<<< * rv = SDL_GetNumVideoDisplays() * if rv < 0: */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_7display_63get_num_video_displays(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused); /*proto*/ static PyMethodDef __pyx_mdef_11pygame_sdl2_7display_63get_num_video_displays = {"get_num_video_displays", (PyCFunction)__pyx_pw_11pygame_sdl2_7display_63get_num_video_displays, METH_NOARGS, 0}; static PyObject *__pyx_pw_11pygame_sdl2_7display_63get_num_video_displays(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("get_num_video_displays (wrapper)", 0); __pyx_r = __pyx_pf_11pygame_sdl2_7display_62get_num_video_displays(__pyx_self); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_7display_62get_num_video_displays(CYTHON_UNUSED PyObject *__pyx_self) { int __pyx_v_rv; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; __Pyx_RefNannySetupContext("get_num_video_displays", 0); /* "pygame_sdl2/display.pyx":691 * * def get_num_video_displays(): * rv = SDL_GetNumVideoDisplays() # <<<<<<<<<<<<<< * if rv < 0: * raise error() */ __pyx_v_rv = SDL_GetNumVideoDisplays(); /* "pygame_sdl2/display.pyx":692 * def get_num_video_displays(): * rv = SDL_GetNumVideoDisplays() * if rv < 0: # <<<<<<<<<<<<<< * raise error() * */ __pyx_t_1 = ((__pyx_v_rv < 0) != 0); if (__pyx_t_1) { /* "pygame_sdl2/display.pyx":693 * rv = SDL_GetNumVideoDisplays() * if rv < 0: * raise error() # <<<<<<<<<<<<<< * * return rv */ __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_error); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 693, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = NULL; if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) { __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3); if (likely(__pyx_t_4)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); __Pyx_INCREF(__pyx_t_4); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_3, function); } } if (__pyx_t_4) { __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 693, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; } else { __pyx_t_2 = __Pyx_PyObject_CallNoArg(__pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 693, __pyx_L1_error) } __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_Raise(__pyx_t_2, 0, 0, 0); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __PYX_ERR(0, 693, __pyx_L1_error) /* "pygame_sdl2/display.pyx":692 * def get_num_video_displays(): * rv = SDL_GetNumVideoDisplays() * if rv < 0: # <<<<<<<<<<<<<< * raise error() * */ } /* "pygame_sdl2/display.pyx":695 * raise error() * * return rv # <<<<<<<<<<<<<< * * def get_display_bounds(index): */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_v_rv); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 695, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; /* "pygame_sdl2/display.pyx":690 * return None * * def get_num_video_displays(): # <<<<<<<<<<<<<< * rv = SDL_GetNumVideoDisplays() * if rv < 0: */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_AddTraceback("pygame_sdl2.display.get_num_video_displays", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/display.pyx":697 * return rv * * def get_display_bounds(index): # <<<<<<<<<<<<<< * cdef SDL_Rect rect * rv = SDL_GetDisplayBounds(index, &rect) */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_7display_65get_display_bounds(PyObject *__pyx_self, PyObject *__pyx_v_index); /*proto*/ static PyMethodDef __pyx_mdef_11pygame_sdl2_7display_65get_display_bounds = {"get_display_bounds", (PyCFunction)__pyx_pw_11pygame_sdl2_7display_65get_display_bounds, METH_O, 0}; static PyObject *__pyx_pw_11pygame_sdl2_7display_65get_display_bounds(PyObject *__pyx_self, PyObject *__pyx_v_index) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("get_display_bounds (wrapper)", 0); __pyx_r = __pyx_pf_11pygame_sdl2_7display_64get_display_bounds(__pyx_self, ((PyObject *)__pyx_v_index)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_7display_64get_display_bounds(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_index) { SDL_Rect __pyx_v_rect; CYTHON_UNUSED int __pyx_v_rv; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; PyObject *__pyx_t_5 = NULL; PyObject *__pyx_t_6 = NULL; __Pyx_RefNannySetupContext("get_display_bounds", 0); /* "pygame_sdl2/display.pyx":699 * def get_display_bounds(index): * cdef SDL_Rect rect * rv = SDL_GetDisplayBounds(index, &rect) # <<<<<<<<<<<<<< * * return (rect.x, rect.y, rect.w, rect.h) */ __pyx_t_1 = __Pyx_PyInt_As_int(__pyx_v_index); if (unlikely((__pyx_t_1 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 699, __pyx_L1_error) __pyx_v_rv = SDL_GetDisplayBounds(__pyx_t_1, (&__pyx_v_rect)); /* "pygame_sdl2/display.pyx":701 * rv = SDL_GetDisplayBounds(index, &rect) * * return (rect.x, rect.y, rect.w, rect.h) # <<<<<<<<<<<<<< * * def get_platform(): */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_v_rect.x); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 701, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = __Pyx_PyInt_From_int(__pyx_v_rect.y); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 701, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = __Pyx_PyInt_From_int(__pyx_v_rect.w); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 701, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_5 = __Pyx_PyInt_From_int(__pyx_v_rect.h); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 701, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_6 = PyTuple_New(4); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 701, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_GIVEREF(__pyx_t_2); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_2); __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_6, 1, __pyx_t_3); __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_6, 2, __pyx_t_4); __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_6, 3, __pyx_t_5); __pyx_t_2 = 0; __pyx_t_3 = 0; __pyx_t_4 = 0; __pyx_t_5 = 0; __pyx_r = __pyx_t_6; __pyx_t_6 = 0; goto __pyx_L0; /* "pygame_sdl2/display.pyx":697 * return rv * * def get_display_bounds(index): # <<<<<<<<<<<<<< * cdef SDL_Rect rect * rv = SDL_GetDisplayBounds(index, &rect) */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_5); __Pyx_XDECREF(__pyx_t_6); __Pyx_AddTraceback("pygame_sdl2.display.get_display_bounds", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/display.pyx":703 * return (rect.x, rect.y, rect.w, rect.h) * * def get_platform(): # <<<<<<<<<<<<<< * return SDL_GetPlatform() * */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_7display_67get_platform(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused); /*proto*/ static PyMethodDef __pyx_mdef_11pygame_sdl2_7display_67get_platform = {"get_platform", (PyCFunction)__pyx_pw_11pygame_sdl2_7display_67get_platform, METH_NOARGS, 0}; static PyObject *__pyx_pw_11pygame_sdl2_7display_67get_platform(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("get_platform (wrapper)", 0); __pyx_r = __pyx_pf_11pygame_sdl2_7display_66get_platform(__pyx_self); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_7display_66get_platform(CYTHON_UNUSED PyObject *__pyx_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; __Pyx_RefNannySetupContext("get_platform", 0); /* "pygame_sdl2/display.pyx":704 * * def get_platform(): * return SDL_GetPlatform() # <<<<<<<<<<<<<< * * cdef api SDL_Window *PyWindow_AsWindow(window): */ __Pyx_XDECREF(__pyx_r); __pyx_t_1 = __Pyx_PyBytes_FromString(SDL_GetPlatform()); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 704, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "pygame_sdl2/display.pyx":703 * return (rect.x, rect.y, rect.w, rect.h) * * def get_platform(): # <<<<<<<<<<<<<< * return SDL_GetPlatform() * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("pygame_sdl2.display.get_platform", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/display.pyx":706 * return SDL_GetPlatform() * * cdef api SDL_Window *PyWindow_AsWindow(window): # <<<<<<<<<<<<<< * """ * Returns a pointer to the SDL_Window corresponding to `window`. If `window` */ static SDL_Window *__pyx_f_11pygame_sdl2_7display_PyWindow_AsWindow(PyObject *__pyx_v_window) { SDL_Window *__pyx_r; __Pyx_RefNannyDeclarations int __pyx_t_1; int __pyx_t_2; __Pyx_RefNannySetupContext("PyWindow_AsWindow", 0); __Pyx_INCREF(__pyx_v_window); /* "pygame_sdl2/display.pyx":713 * """ * * if window is None: # <<<<<<<<<<<<<< * window = main_window * */ __pyx_t_1 = (__pyx_v_window == Py_None); __pyx_t_2 = (__pyx_t_1 != 0); if (__pyx_t_2) { /* "pygame_sdl2/display.pyx":714 * * if window is None: * window = main_window # <<<<<<<<<<<<<< * * if window is None: */ __Pyx_INCREF(((PyObject *)__pyx_v_11pygame_sdl2_7display_main_window)); __Pyx_DECREF_SET(__pyx_v_window, ((PyObject *)__pyx_v_11pygame_sdl2_7display_main_window)); /* "pygame_sdl2/display.pyx":713 * """ * * if window is None: # <<<<<<<<<<<<<< * window = main_window * */ } /* "pygame_sdl2/display.pyx":716 * window = main_window * * if window is None: # <<<<<<<<<<<<<< * return NULL * */ __pyx_t_2 = (__pyx_v_window == Py_None); __pyx_t_1 = (__pyx_t_2 != 0); if (__pyx_t_1) { /* "pygame_sdl2/display.pyx":717 * * if window is None: * return NULL # <<<<<<<<<<<<<< * * return ( window).window */ __pyx_r = NULL; goto __pyx_L0; /* "pygame_sdl2/display.pyx":716 * window = main_window * * if window is None: # <<<<<<<<<<<<<< * return NULL * */ } /* "pygame_sdl2/display.pyx":719 * return NULL * * return ( window).window # <<<<<<<<<<<<<< */ __pyx_r = ((struct __pyx_obj_11pygame_sdl2_7display_Window *)__pyx_v_window)->window; goto __pyx_L0; /* "pygame_sdl2/display.pyx":706 * return SDL_GetPlatform() * * cdef api SDL_Window *PyWindow_AsWindow(window): # <<<<<<<<<<<<<< * """ * Returns a pointer to the SDL_Window corresponding to `window`. If `window` */ /* function exit code */ __pyx_L0:; __Pyx_XDECREF(__pyx_v_window); __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_tp_new_11pygame_sdl2_7display_Window(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) { struct __pyx_obj_11pygame_sdl2_7display_Window *p; PyObject *o; if (likely((t->tp_flags & Py_TPFLAGS_IS_ABSTRACT) == 0)) { o = (*t->tp_alloc)(t, 0); } else { o = (PyObject *) PyBaseObject_Type.tp_new(t, __pyx_empty_tuple, 0); } if (unlikely(!o)) return 0; p = ((struct __pyx_obj_11pygame_sdl2_7display_Window *)o); p->surface = ((struct __pyx_obj_11pygame_sdl2_7surface_Surface *)Py_None); Py_INCREF(Py_None); return o; } static void __pyx_tp_dealloc_11pygame_sdl2_7display_Window(PyObject *o) { struct __pyx_obj_11pygame_sdl2_7display_Window *p = (struct __pyx_obj_11pygame_sdl2_7display_Window *)o; #if CYTHON_USE_TP_FINALIZE if (unlikely(PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE) && Py_TYPE(o)->tp_finalize) && !_PyGC_FINALIZED(o)) { if (PyObject_CallFinalizerFromDealloc(o)) return; } #endif PyObject_GC_UnTrack(o); if (p->__weakref__) PyObject_ClearWeakRefs(o); Py_CLEAR(p->surface); (*Py_TYPE(o)->tp_free)(o); } static int __pyx_tp_traverse_11pygame_sdl2_7display_Window(PyObject *o, visitproc v, void *a) { int e; struct __pyx_obj_11pygame_sdl2_7display_Window *p = (struct __pyx_obj_11pygame_sdl2_7display_Window *)o; if (p->surface) { e = (*v)(((PyObject *)p->surface), a); if (e) return e; } return 0; } static int __pyx_tp_clear_11pygame_sdl2_7display_Window(PyObject *o) { PyObject* tmp; struct __pyx_obj_11pygame_sdl2_7display_Window *p = (struct __pyx_obj_11pygame_sdl2_7display_Window *)o; tmp = ((PyObject*)p->surface); p->surface = ((struct __pyx_obj_11pygame_sdl2_7surface_Surface *)Py_None); Py_INCREF(Py_None); Py_XDECREF(tmp); return 0; } static PyObject *__pyx_getprop_11pygame_sdl2_7display_6Window_surface(PyObject *o, CYTHON_UNUSED void *x) { return __pyx_pw_11pygame_sdl2_7display_6Window_7surface_1__get__(o); } static int __pyx_setprop_11pygame_sdl2_7display_6Window_surface(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) { if (v) { return __pyx_pw_11pygame_sdl2_7display_6Window_7surface_3__set__(o, v); } else { return __pyx_pw_11pygame_sdl2_7display_6Window_7surface_5__del__(o); } } static PyMethodDef __pyx_methods_11pygame_sdl2_7display_Window[] = { {"create_surface", (PyCFunction)__pyx_pw_11pygame_sdl2_7display_6Window_3create_surface, METH_NOARGS, __pyx_doc_11pygame_sdl2_7display_6Window_2create_surface}, {"destroy", (PyCFunction)__pyx_pw_11pygame_sdl2_7display_6Window_5destroy, METH_NOARGS, __pyx_doc_11pygame_sdl2_7display_6Window_4destroy}, {"resize", (PyCFunction)__pyx_pw_11pygame_sdl2_7display_6Window_7resize, METH_VARARGS|METH_KEYWORDS, __pyx_doc_11pygame_sdl2_7display_6Window_6resize}, {"get_window_flags", (PyCFunction)__pyx_pw_11pygame_sdl2_7display_6Window_9get_window_flags, METH_NOARGS, 0}, {"proxy_window_surface", (PyCFunction)__pyx_pw_11pygame_sdl2_7display_6Window_11proxy_window_surface, METH_NOARGS, 0}, {"flip", (PyCFunction)__pyx_pw_11pygame_sdl2_7display_6Window_13flip, METH_NOARGS, 0}, {"get_surface", (PyCFunction)__pyx_pw_11pygame_sdl2_7display_6Window_15get_surface, METH_NOARGS, 0}, {"update", (PyCFunction)__pyx_pw_11pygame_sdl2_7display_6Window_17update, METH_VARARGS|METH_KEYWORDS, 0}, {"get_wm_info", (PyCFunction)__pyx_pw_11pygame_sdl2_7display_6Window_19get_wm_info, METH_NOARGS, 0}, {"get_active", (PyCFunction)__pyx_pw_11pygame_sdl2_7display_6Window_21get_active, METH_NOARGS, 0}, {"iconify", (PyCFunction)__pyx_pw_11pygame_sdl2_7display_6Window_23iconify, METH_NOARGS, 0}, {"toggle_fullscreen", (PyCFunction)__pyx_pw_11pygame_sdl2_7display_6Window_25toggle_fullscreen, METH_NOARGS, 0}, {"set_gamma", (PyCFunction)__pyx_pw_11pygame_sdl2_7display_6Window_27set_gamma, METH_VARARGS|METH_KEYWORDS, 0}, {"set_gamma_ramp", (PyCFunction)__pyx_pw_11pygame_sdl2_7display_6Window_29set_gamma_ramp, METH_VARARGS|METH_KEYWORDS, 0}, {"set_icon", (PyCFunction)__pyx_pw_11pygame_sdl2_7display_6Window_31set_icon, METH_O, 0}, {"set_caption", (PyCFunction)__pyx_pw_11pygame_sdl2_7display_6Window_33set_caption, METH_O, 0}, {"get_drawable_size", (PyCFunction)__pyx_pw_11pygame_sdl2_7display_6Window_35get_drawable_size, METH_NOARGS, 0}, {"__reduce_cython__", (PyCFunction)__pyx_pw_11pygame_sdl2_7display_6Window_37__reduce_cython__, METH_NOARGS, 0}, {"__setstate_cython__", (PyCFunction)__pyx_pw_11pygame_sdl2_7display_6Window_39__setstate_cython__, METH_O, 0}, {0, 0, 0, 0} }; static struct PyGetSetDef __pyx_getsets_11pygame_sdl2_7display_Window[] = { {(char *)"surface", __pyx_getprop_11pygame_sdl2_7display_6Window_surface, __pyx_setprop_11pygame_sdl2_7display_6Window_surface, (char *)0, 0}, {0, 0, 0, 0, 0} }; static PyTypeObject __pyx_type_11pygame_sdl2_7display_Window = { PyVarObject_HEAD_INIT(0, 0) "pygame_sdl2.display.Window", /*tp_name*/ sizeof(struct __pyx_obj_11pygame_sdl2_7display_Window), /*tp_basicsize*/ 0, /*tp_itemsize*/ __pyx_tp_dealloc_11pygame_sdl2_7display_Window, /*tp_dealloc*/ 0, /*tp_print*/ 0, /*tp_getattr*/ 0, /*tp_setattr*/ #if PY_MAJOR_VERSION < 3 0, /*tp_compare*/ #endif #if PY_MAJOR_VERSION >= 3 0, /*tp_as_async*/ #endif 0, /*tp_repr*/ 0, /*tp_as_number*/ 0, /*tp_as_sequence*/ 0, /*tp_as_mapping*/ 0, /*tp_hash*/ 0, /*tp_call*/ 0, /*tp_str*/ 0, /*tp_getattro*/ 0, /*tp_setattro*/ 0, /*tp_as_buffer*/ Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/ 0, /*tp_doc*/ __pyx_tp_traverse_11pygame_sdl2_7display_Window, /*tp_traverse*/ __pyx_tp_clear_11pygame_sdl2_7display_Window, /*tp_clear*/ 0, /*tp_richcompare*/ 0, /*tp_weaklistoffset*/ 0, /*tp_iter*/ 0, /*tp_iternext*/ __pyx_methods_11pygame_sdl2_7display_Window, /*tp_methods*/ 0, /*tp_members*/ __pyx_getsets_11pygame_sdl2_7display_Window, /*tp_getset*/ 0, /*tp_base*/ 0, /*tp_dict*/ 0, /*tp_descr_get*/ 0, /*tp_descr_set*/ 0, /*tp_dictoffset*/ __pyx_pw_11pygame_sdl2_7display_6Window_1__init__, /*tp_init*/ 0, /*tp_alloc*/ __pyx_tp_new_11pygame_sdl2_7display_Window, /*tp_new*/ 0, /*tp_free*/ 0, /*tp_is_gc*/ 0, /*tp_bases*/ 0, /*tp_mro*/ 0, /*tp_cache*/ 0, /*tp_subclasses*/ 0, /*tp_weaklist*/ 0, /*tp_del*/ 0, /*tp_version_tag*/ #if PY_VERSION_HEX >= 0x030400a1 0, /*tp_finalize*/ #endif }; static PyMethodDef __pyx_methods[] = { {0, 0, 0, 0} }; #if PY_MAJOR_VERSION >= 3 #if CYTHON_PEP489_MULTI_PHASE_INIT static PyObject* __pyx_pymod_create(PyObject *spec, PyModuleDef *def); /*proto*/ static int __pyx_pymod_exec_display(PyObject* module); /*proto*/ static PyModuleDef_Slot __pyx_moduledef_slots[] = { {Py_mod_create, (void*)__pyx_pymod_create}, {Py_mod_exec, (void*)__pyx_pymod_exec_display}, {0, NULL} }; #endif static struct PyModuleDef __pyx_moduledef = { PyModuleDef_HEAD_INIT, "display", 0, /* m_doc */ #if CYTHON_PEP489_MULTI_PHASE_INIT 0, /* m_size */ #else -1, /* m_size */ #endif __pyx_methods /* m_methods */, #if CYTHON_PEP489_MULTI_PHASE_INIT __pyx_moduledef_slots, /* m_slots */ #else NULL, /* m_reload */ #endif NULL, /* m_traverse */ NULL, /* m_clear */ NULL /* m_free */ }; #endif static __Pyx_StringTabEntry __pyx_string_tab[] = { {&__pyx_kp_s_0, __pyx_k_0, sizeof(__pyx_k_0), 0, 0, 1, 0}, {&__pyx_kp_s_Couldn_t_allocate_rectangles, __pyx_k_Couldn_t_allocate_rectangles, sizeof(__pyx_k_Couldn_t_allocate_rectangles), 0, 0, 1, 0}, {&__pyx_n_s_GL_SWAP_CONTROL, __pyx_k_GL_SWAP_CONTROL, sizeof(__pyx_k_GL_SWAP_CONTROL), 0, 0, 1, 1}, {&__pyx_n_s_ImportError, __pyx_k_ImportError, sizeof(__pyx_k_ImportError), 0, 0, 1, 1}, {&__pyx_n_s_Info, __pyx_k_Info, sizeof(__pyx_k_Info), 0, 0, 1, 1}, {&__pyx_n_s_Info___init, __pyx_k_Info___init, sizeof(__pyx_k_Info___init), 0, 0, 1, 1}, {&__pyx_n_s_Info___repr, __pyx_k_Info___repr, sizeof(__pyx_k_Info___repr), 0, 0, 1, 1}, {&__pyx_kp_s_Info_r, __pyx_k_Info_r, sizeof(__pyx_k_Info_r), 0, 0, 1, 0}, {&__pyx_n_s_MemoryError, __pyx_k_MemoryError, sizeof(__pyx_k_MemoryError), 0, 0, 1, 1}, {&__pyx_n_s_PYGAME_IOS, __pyx_k_PYGAME_IOS, sizeof(__pyx_k_PYGAME_IOS), 0, 0, 1, 1}, {&__pyx_n_s_PYGAME_SDL2, __pyx_k_PYGAME_SDL2, sizeof(__pyx_k_PYGAME_SDL2), 0, 0, 1, 1}, {&__pyx_n_s_PYGAME_SDL2_AVOID_GL, __pyx_k_PYGAME_SDL2_AVOID_GL, sizeof(__pyx_k_PYGAME_SDL2_AVOID_GL), 0, 0, 1, 1}, {&__pyx_n_s_SDL_VIDEO_MAC_FULLSCREEN_SPACES, __pyx_k_SDL_VIDEO_MAC_FULLSCREEN_SPACES, sizeof(__pyx_k_SDL_VIDEO_MAC_FULLSCREEN_SPACES), 0, 0, 1, 1}, {&__pyx_n_s_SRCALPHA, __pyx_k_SRCALPHA, sizeof(__pyx_k_SRCALPHA), 0, 0, 1, 1}, {&__pyx_n_s_TypeError, __pyx_k_TypeError, sizeof(__pyx_k_TypeError), 0, 0, 1, 1}, {&__pyx_n_s_androidembed, __pyx_k_androidembed, sizeof(__pyx_k_androidembed), 0, 0, 1, 1}, {&__pyx_n_s_before_first_window, __pyx_k_before_first_window, sizeof(__pyx_k_before_first_window), 0, 0, 1, 1}, {&__pyx_n_s_bitsize, __pyx_k_bitsize, sizeof(__pyx_k_bitsize), 0, 0, 1, 1}, {&__pyx_n_s_blit_hw, __pyx_k_blit_hw, sizeof(__pyx_k_blit_hw), 0, 0, 1, 1}, {&__pyx_n_s_blit_hw_A, __pyx_k_blit_hw_A, sizeof(__pyx_k_blit_hw_A), 0, 0, 1, 1}, {&__pyx_n_s_blit_hw_CC, __pyx_k_blit_hw_CC, sizeof(__pyx_k_blit_hw_CC), 0, 0, 1, 1}, {&__pyx_n_s_blit_sw, __pyx_k_blit_sw, sizeof(__pyx_k_blit_sw), 0, 0, 1, 1}, {&__pyx_n_s_blit_sw_A, __pyx_k_blit_sw_A, sizeof(__pyx_k_blit_sw_A), 0, 0, 1, 1}, {&__pyx_n_s_blit_sw_CC, __pyx_k_blit_sw_CC, sizeof(__pyx_k_blit_sw_CC), 0, 0, 1, 1}, {&__pyx_n_s_blue, __pyx_k_blue, sizeof(__pyx_k_blue), 0, 0, 1, 1}, {&__pyx_n_s_bytesize, __pyx_k_bytesize, sizeof(__pyx_k_bytesize), 0, 0, 1, 1}, {&__pyx_n_s_cline_in_traceback, __pyx_k_cline_in_traceback, sizeof(__pyx_k_cline_in_traceback), 0, 0, 1, 1}, {&__pyx_n_s_close_window, __pyx_k_close_window, sizeof(__pyx_k_close_window), 0, 0, 1, 1}, {&__pyx_n_s_copy, __pyx_k_copy, sizeof(__pyx_k_copy), 0, 0, 1, 1}, {&__pyx_n_s_create_surface, __pyx_k_create_surface, sizeof(__pyx_k_create_surface), 0, 0, 1, 1}, {&__pyx_n_s_current_h, __pyx_k_current_h, sizeof(__pyx_k_current_h), 0, 0, 1, 1}, {&__pyx_n_s_current_w, __pyx_k_current_w, sizeof(__pyx_k_current_w), 0, 0, 1, 1}, {&__pyx_n_s_default, __pyx_k_default, sizeof(__pyx_k_default), 0, 0, 1, 1}, {&__pyx_n_s_default_icon, __pyx_k_default_icon, sizeof(__pyx_k_default_icon), 0, 0, 1, 1}, {&__pyx_n_s_default_swap_control, __pyx_k_default_swap_control, sizeof(__pyx_k_default_swap_control), 0, 0, 1, 1}, {&__pyx_n_s_default_title, __pyx_k_default_title, sizeof(__pyx_k_default_title), 0, 0, 1, 1}, {&__pyx_n_s_depth, __pyx_k_depth, sizeof(__pyx_k_depth), 0, 0, 1, 1}, {&__pyx_n_s_destroy, __pyx_k_destroy, sizeof(__pyx_k_destroy), 0, 0, 1, 1}, {&__pyx_n_s_dict, __pyx_k_dict, sizeof(__pyx_k_dict), 0, 0, 1, 1}, {&__pyx_n_s_display, __pyx_k_display, sizeof(__pyx_k_display), 0, 0, 1, 1}, {&__pyx_n_s_dm, __pyx_k_dm, sizeof(__pyx_k_dm), 0, 0, 1, 1}, {&__pyx_n_s_doc, __pyx_k_doc, sizeof(__pyx_k_doc), 0, 0, 1, 1}, {&__pyx_n_s_driver, __pyx_k_driver, sizeof(__pyx_k_driver), 0, 0, 1, 1}, {&__pyx_n_s_encode, __pyx_k_encode, sizeof(__pyx_k_encode), 0, 0, 1, 1}, {&__pyx_n_s_environ, __pyx_k_environ, sizeof(__pyx_k_environ), 0, 0, 1, 1}, {&__pyx_n_s_error, __pyx_k_error, sizeof(__pyx_k_error), 0, 0, 1, 1}, {&__pyx_n_s_event, __pyx_k_event, sizeof(__pyx_k_event), 0, 0, 1, 1}, {&__pyx_n_s_flag, __pyx_k_flag, sizeof(__pyx_k_flag), 0, 0, 1, 1}, {&__pyx_n_s_flags, __pyx_k_flags, sizeof(__pyx_k_flags), 0, 0, 1, 1}, {&__pyx_n_s_flip, __pyx_k_flip, sizeof(__pyx_k_flip), 0, 0, 1, 1}, {&__pyx_n_s_format, __pyx_k_format, sizeof(__pyx_k_format), 0, 0, 1, 1}, {&__pyx_n_s_get_active, __pyx_k_get_active, sizeof(__pyx_k_get_active), 0, 0, 1, 1}, {&__pyx_n_s_get_caption, __pyx_k_get_caption, sizeof(__pyx_k_get_caption), 0, 0, 1, 1}, {&__pyx_n_s_get_display_bounds, __pyx_k_get_display_bounds, sizeof(__pyx_k_get_display_bounds), 0, 0, 1, 1}, {&__pyx_n_s_get_drawable_size, __pyx_k_get_drawable_size, sizeof(__pyx_k_get_drawable_size), 0, 0, 1, 1}, {&__pyx_n_s_get_driver, __pyx_k_get_driver, sizeof(__pyx_k_get_driver), 0, 0, 1, 1}, {&__pyx_n_s_get_hint, __pyx_k_get_hint, sizeof(__pyx_k_get_hint), 0, 0, 1, 1}, {&__pyx_n_s_get_init, __pyx_k_get_init, sizeof(__pyx_k_get_init), 0, 0, 1, 1}, {&__pyx_n_s_get_num_video_displays, __pyx_k_get_num_video_displays, sizeof(__pyx_k_get_num_video_displays), 0, 0, 1, 1}, {&__pyx_n_s_get_platform, __pyx_k_get_platform, sizeof(__pyx_k_get_platform), 0, 0, 1, 1}, {&__pyx_n_s_get_size, __pyx_k_get_size, sizeof(__pyx_k_get_size), 0, 0, 1, 1}, {&__pyx_n_s_get_surface, __pyx_k_get_surface, sizeof(__pyx_k_get_surface), 0, 0, 1, 1}, {&__pyx_n_s_get_window, __pyx_k_get_window, sizeof(__pyx_k_get_window), 0, 0, 1, 1}, {&__pyx_n_s_get_window_flags, __pyx_k_get_window_flags, sizeof(__pyx_k_get_window_flags), 0, 0, 1, 1}, {&__pyx_n_s_get_wm_info, __pyx_k_get_wm_info, sizeof(__pyx_k_get_wm_info), 0, 0, 1, 1}, {&__pyx_n_s_getstate, __pyx_k_getstate, sizeof(__pyx_k_getstate), 0, 0, 1, 1}, {&__pyx_n_s_gl_get_attribute, __pyx_k_gl_get_attribute, sizeof(__pyx_k_gl_get_attribute), 0, 0, 1, 1}, {&__pyx_n_s_gl_load_library, __pyx_k_gl_load_library, sizeof(__pyx_k_gl_load_library), 0, 0, 1, 1}, {&__pyx_n_s_gl_reset_attributes, __pyx_k_gl_reset_attributes, sizeof(__pyx_k_gl_reset_attributes), 0, 0, 1, 1}, {&__pyx_n_s_gl_set_attribute, __pyx_k_gl_set_attribute, sizeof(__pyx_k_gl_set_attribute), 0, 0, 1, 1}, {&__pyx_n_s_gl_unload_library, __pyx_k_gl_unload_library, sizeof(__pyx_k_gl_unload_library), 0, 0, 1, 1}, {&__pyx_n_s_green, __pyx_k_green, sizeof(__pyx_k_green), 0, 0, 1, 1}, {&__pyx_n_s_hint, __pyx_k_hint, sizeof(__pyx_k_hint), 0, 0, 1, 1}, {&__pyx_n_s_hw, __pyx_k_hw, sizeof(__pyx_k_hw), 0, 0, 1, 1}, {&__pyx_n_s_i, __pyx_k_i, sizeof(__pyx_k_i), 0, 0, 1, 1}, {&__pyx_n_s_iconify, __pyx_k_iconify, sizeof(__pyx_k_iconify), 0, 0, 1, 1}, {&__pyx_n_s_icontitle, __pyx_k_icontitle, sizeof(__pyx_k_icontitle), 0, 0, 1, 1}, {&__pyx_n_s_import, __pyx_k_import, sizeof(__pyx_k_import), 0, 0, 1, 1}, {&__pyx_n_s_index, __pyx_k_index, sizeof(__pyx_k_index), 0, 0, 1, 1}, {&__pyx_n_s_init, __pyx_k_init, sizeof(__pyx_k_init), 0, 0, 1, 1}, {&__pyx_n_s_init_2, __pyx_k_init_2, sizeof(__pyx_k_init_2), 0, 0, 1, 1}, {&__pyx_n_s_init_done, __pyx_k_init_done, sizeof(__pyx_k_init_done), 0, 0, 1, 1}, {&__pyx_n_s_ios, __pyx_k_ios, sizeof(__pyx_k_ios), 0, 0, 1, 1}, {&__pyx_n_s_list_modes, __pyx_k_list_modes, sizeof(__pyx_k_list_modes), 0, 0, 1, 1}, {&__pyx_n_s_losses, __pyx_k_losses, sizeof(__pyx_k_losses), 0, 0, 1, 1}, {&__pyx_n_s_main, __pyx_k_main, sizeof(__pyx_k_main), 0, 0, 1, 1}, {&__pyx_n_s_main_done, __pyx_k_main_done, sizeof(__pyx_k_main_done), 0, 0, 1, 1}, {&__pyx_n_s_main_window, __pyx_k_main_window, sizeof(__pyx_k_main_window), 0, 0, 1, 1}, {&__pyx_n_s_masks, __pyx_k_masks, sizeof(__pyx_k_masks), 0, 0, 1, 1}, {&__pyx_n_s_metaclass, __pyx_k_metaclass, sizeof(__pyx_k_metaclass), 0, 0, 1, 1}, {&__pyx_n_s_mode, __pyx_k_mode, sizeof(__pyx_k_mode), 0, 0, 1, 1}, {&__pyx_n_s_mode_ok, __pyx_k_mode_ok, sizeof(__pyx_k_mode_ok), 0, 0, 1, 1}, {&__pyx_n_s_module, __pyx_k_module, sizeof(__pyx_k_module), 0, 0, 1, 1}, {&__pyx_n_s_name, __pyx_k_name, sizeof(__pyx_k_name), 0, 0, 1, 1}, {&__pyx_n_s_num_modes, __pyx_k_num_modes, sizeof(__pyx_k_num_modes), 0, 0, 1, 1}, {&__pyx_n_s_object, __pyx_k_object, sizeof(__pyx_k_object), 0, 0, 1, 1}, {&__pyx_n_s_opengl, __pyx_k_opengl, sizeof(__pyx_k_opengl), 0, 0, 1, 1}, {&__pyx_n_s_os, __pyx_k_os, sizeof(__pyx_k_os), 0, 0, 1, 1}, {&__pyx_n_s_path, __pyx_k_path, sizeof(__pyx_k_path), 0, 0, 1, 1}, {&__pyx_n_s_pos, __pyx_k_pos, sizeof(__pyx_k_pos), 0, 0, 1, 1}, {&__pyx_n_s_prepare, __pyx_k_prepare, sizeof(__pyx_k_prepare), 0, 0, 1, 1}, {&__pyx_n_s_proxy_window_surface, __pyx_k_proxy_window_surface, sizeof(__pyx_k_proxy_window_surface), 0, 0, 1, 1}, {&__pyx_n_s_pygame_hints, __pyx_k_pygame_hints, sizeof(__pyx_k_pygame_hints), 0, 0, 1, 1}, {&__pyx_n_s_pygame_sdl2, __pyx_k_pygame_sdl2, sizeof(__pyx_k_pygame_sdl2), 0, 0, 1, 1}, {&__pyx_n_s_pygame_sdl2_display, __pyx_k_pygame_sdl2_display, sizeof(__pyx_k_pygame_sdl2_display), 0, 0, 1, 1}, {&__pyx_n_s_pygame_sdl2_error, __pyx_k_pygame_sdl2_error, sizeof(__pyx_k_pygame_sdl2_error), 0, 0, 1, 1}, {&__pyx_n_s_pygame_sdl2_locals, __pyx_k_pygame_sdl2_locals, sizeof(__pyx_k_pygame_sdl2_locals), 0, 0, 1, 1}, {&__pyx_kp_s_pygame_window, __pyx_k_pygame_window, sizeof(__pyx_k_pygame_window), 0, 0, 1, 0}, {&__pyx_n_s_pyx_capi, __pyx_k_pyx_capi, sizeof(__pyx_k_pyx_capi), 0, 0, 1, 1}, {&__pyx_n_s_pyx_vtable, __pyx_k_pyx_vtable, sizeof(__pyx_k_pyx_vtable), 0, 0, 1, 1}, {&__pyx_n_s_qualname, __pyx_k_qualname, sizeof(__pyx_k_qualname), 0, 0, 1, 1}, {&__pyx_n_s_quit, __pyx_k_quit, sizeof(__pyx_k_quit), 0, 0, 1, 1}, {&__pyx_n_s_range, __pyx_k_range, sizeof(__pyx_k_range), 0, 0, 1, 1}, {&__pyx_n_s_rect, __pyx_k_rect, sizeof(__pyx_k_rect), 0, 0, 1, 1}, {&__pyx_n_s_rectangles, __pyx_k_rectangles, sizeof(__pyx_k_rectangles), 0, 0, 1, 1}, {&__pyx_n_s_red, __pyx_k_red, sizeof(__pyx_k_red), 0, 0, 1, 1}, {&__pyx_n_s_reduce, __pyx_k_reduce, sizeof(__pyx_k_reduce), 0, 0, 1, 1}, {&__pyx_n_s_reduce_cython, __pyx_k_reduce_cython, sizeof(__pyx_k_reduce_cython), 0, 0, 1, 1}, {&__pyx_n_s_reduce_ex, __pyx_k_reduce_ex, sizeof(__pyx_k_reduce_ex), 0, 0, 1, 1}, {&__pyx_n_s_refresh_rate, __pyx_k_refresh_rate, sizeof(__pyx_k_refresh_rate), 0, 0, 1, 1}, {&__pyx_n_s_register_init, __pyx_k_register_init, sizeof(__pyx_k_register_init), 0, 0, 1, 1}, {&__pyx_n_s_register_quit, __pyx_k_register_quit, sizeof(__pyx_k_register_quit), 0, 0, 1, 1}, {&__pyx_n_s_repr, __pyx_k_repr, sizeof(__pyx_k_repr), 0, 0, 1, 1}, {&__pyx_n_s_resize, __pyx_k_resize, sizeof(__pyx_k_resize), 0, 0, 1, 1}, {&__pyx_n_s_resolution, __pyx_k_resolution, sizeof(__pyx_k_resolution), 0, 0, 1, 1}, {&__pyx_n_s_rv, __pyx_k_rv, sizeof(__pyx_k_rv), 0, 0, 1, 1}, {&__pyx_n_s_sdl_main_init, __pyx_k_sdl_main_init, sizeof(__pyx_k_sdl_main_init), 0, 0, 1, 1}, {&__pyx_n_s_self, __pyx_k_self, sizeof(__pyx_k_self), 0, 0, 1, 1}, {&__pyx_kp_s_self_gl_context_self_window_self, __pyx_k_self_gl_context_self_window_self, sizeof(__pyx_k_self_gl_context_self_window_self), 0, 0, 1, 0}, {&__pyx_n_s_set_caption, __pyx_k_set_caption, sizeof(__pyx_k_set_caption), 0, 0, 1, 1}, {&__pyx_n_s_set_gamma, __pyx_k_set_gamma, sizeof(__pyx_k_set_gamma), 0, 0, 1, 1}, {&__pyx_n_s_set_gamma_ramp, __pyx_k_set_gamma_ramp, sizeof(__pyx_k_set_gamma_ramp), 0, 0, 1, 1}, {&__pyx_n_s_set_icon, __pyx_k_set_icon, sizeof(__pyx_k_set_icon), 0, 0, 1, 1}, {&__pyx_n_s_set_mode, __pyx_k_set_mode, sizeof(__pyx_k_set_mode), 0, 0, 1, 1}, {&__pyx_n_s_setstate, __pyx_k_setstate, sizeof(__pyx_k_setstate), 0, 0, 1, 1}, {&__pyx_n_s_setstate_cython, __pyx_k_setstate_cython, sizeof(__pyx_k_setstate_cython), 0, 0, 1, 1}, {&__pyx_n_s_shifts, __pyx_k_shifts, sizeof(__pyx_k_shifts), 0, 0, 1, 1}, {&__pyx_n_s_shown_first_window, __pyx_k_shown_first_window, sizeof(__pyx_k_shown_first_window), 0, 0, 1, 1}, {&__pyx_n_s_size, __pyx_k_size, sizeof(__pyx_k_size), 0, 0, 1, 1}, {&__pyx_kp_s_src_pygame_sdl2_display_pyx, __pyx_k_src_pygame_sdl2_display_pyx, sizeof(__pyx_k_src_pygame_sdl2_display_pyx), 0, 0, 1, 0}, {&__pyx_n_s_startswith, __pyx_k_startswith, sizeof(__pyx_k_startswith), 0, 0, 1, 1}, {&__pyx_n_s_surface, __pyx_k_surface, sizeof(__pyx_k_surface), 0, 0, 1, 1}, {&__pyx_n_s_t, __pyx_k_t, sizeof(__pyx_k_t), 0, 0, 1, 1}, {&__pyx_n_s_test, __pyx_k_test, sizeof(__pyx_k_test), 0, 0, 1, 1}, {&__pyx_n_s_title, __pyx_k_title, sizeof(__pyx_k_title), 0, 0, 1, 1}, {&__pyx_n_s_toggle_fullscreen, __pyx_k_toggle_fullscreen, sizeof(__pyx_k_toggle_fullscreen), 0, 0, 1, 1}, {&__pyx_n_s_update, __pyx_k_update, sizeof(__pyx_k_update), 0, 0, 1, 1}, {&__pyx_kp_s_utf_8, __pyx_k_utf_8, sizeof(__pyx_k_utf_8), 0, 0, 1, 0}, {&__pyx_n_s_value, __pyx_k_value, sizeof(__pyx_k_value), 0, 0, 1, 1}, {&__pyx_n_s_video_mem, __pyx_k_video_mem, sizeof(__pyx_k_video_mem), 0, 0, 1, 1}, {&__pyx_n_s_warnings, __pyx_k_warnings, sizeof(__pyx_k_warnings), 0, 0, 1, 1}, {&__pyx_n_s_wm, __pyx_k_wm, sizeof(__pyx_k_wm), 0, 0, 1, 1}, {0, 0, 0, 0, 0, 0, 0} }; static int __Pyx_InitCachedBuiltins(void) { __pyx_builtin_object = __Pyx_GetBuiltinName(__pyx_n_s_object); if (!__pyx_builtin_object) __PYX_ERR(0, 477, __pyx_L1_error) __pyx_builtin_ImportError = __Pyx_GetBuiltinName(__pyx_n_s_ImportError); if (!__pyx_builtin_ImportError) __PYX_ERR(0, 140, __pyx_L1_error) __pyx_builtin_MemoryError = __Pyx_GetBuiltinName(__pyx_n_s_MemoryError); if (!__pyx_builtin_MemoryError) __PYX_ERR(0, 329, __pyx_L1_error) __pyx_builtin_range = __Pyx_GetBuiltinName(__pyx_n_s_range); if (!__pyx_builtin_range) __PYX_ERR(0, 393, __pyx_L1_error) __pyx_builtin_TypeError = __Pyx_GetBuiltinName(__pyx_n_s_TypeError); if (!__pyx_builtin_TypeError) __PYX_ERR(1, 2, __pyx_L1_error) return 0; __pyx_L1_error:; return -1; } static int __Pyx_InitCachedConstants(void) { __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__Pyx_InitCachedConstants", 0); /* "pygame_sdl2/display.pyx":42 * def hint(hint, value): * * if str(hint).startswith("PYGAME_SDL2"): # <<<<<<<<<<<<<< * _pygame_hints[str(hint)] = str(value) * return */ __pyx_tuple_ = PyTuple_Pack(1, __pyx_n_s_PYGAME_SDL2); if (unlikely(!__pyx_tuple_)) __PYX_ERR(0, 42, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple_); __Pyx_GIVEREF(__pyx_tuple_); /* "pygame_sdl2/display.pyx":48 * * if not isinstance(hint, bytes): * hint = hint.encode("utf-8") # <<<<<<<<<<<<<< * * if not isinstance(value, bytes): */ __pyx_tuple__2 = PyTuple_Pack(1, __pyx_kp_s_utf_8); if (unlikely(!__pyx_tuple__2)) __PYX_ERR(0, 48, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__2); __Pyx_GIVEREF(__pyx_tuple__2); /* "pygame_sdl2/display.pyx":51 * * if not isinstance(value, bytes): * value = value.encode("utf-8") # <<<<<<<<<<<<<< * * SDL_SetHint(hint, value) */ __pyx_tuple__3 = PyTuple_Pack(1, __pyx_kp_s_utf_8); if (unlikely(!__pyx_tuple__3)) __PYX_ERR(0, 51, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__3); __Pyx_GIVEREF(__pyx_tuple__3); /* "pygame_sdl2/display.pyx":93 * sdl_main_init() * * hint("SDL_VIDEO_MAC_FULLSCREEN_SPACES", "0") # <<<<<<<<<<<<<< * * if SDL_InitSubSystem(SDL_INIT_VIDEO): */ __pyx_tuple__4 = PyTuple_Pack(2, __pyx_n_s_SDL_VIDEO_MAC_FULLSCREEN_SPACES, __pyx_kp_s_0); if (unlikely(!__pyx_tuple__4)) __PYX_ERR(0, 93, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__4); __Pyx_GIVEREF(__pyx_tuple__4); /* "pygame_sdl2/display.pyx":146 * * cdef class Window: * def __init__(self, title, resolution=(0, 0), flags=0, depth=0, pos=(SDL_WINDOWPOS_UNDEFINED, SDL_WINDOWPOS_UNDEFINED)): # <<<<<<<<<<<<<< * * if not isinstance(title, bytes): */ __pyx_tuple__5 = PyTuple_Pack(2, __pyx_int_0, __pyx_int_0); if (unlikely(!__pyx_tuple__5)) __PYX_ERR(0, 146, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__5); __Pyx_GIVEREF(__pyx_tuple__5); /* "pygame_sdl2/display.pyx":149 * * if not isinstance(title, bytes): * title = title.encode("utf-8") # <<<<<<<<<<<<<< * * _before_first_window() */ __pyx_tuple__7 = PyTuple_Pack(1, __pyx_kp_s_utf_8); if (unlikely(!__pyx_tuple__7)) __PYX_ERR(0, 149, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__7); __Pyx_GIVEREF(__pyx_tuple__7); /* "pygame_sdl2/display.pyx":157 * # If we do not get the AVOID_GL hint, we always create a GL-compatible * # window. This lets us change the OPENGL flag later on. * if int(_get_hint("PYGAME_SDL2_AVOID_GL", "0")): # <<<<<<<<<<<<<< * gl_flag = 0 * else: */ __pyx_tuple__8 = PyTuple_Pack(2, __pyx_n_s_PYGAME_SDL2_AVOID_GL, __pyx_kp_s_0); if (unlikely(!__pyx_tuple__8)) __PYX_ERR(0, 157, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__8); __Pyx_GIVEREF(__pyx_tuple__8); /* "pygame_sdl2/display.pyx":219 * if self.window_surface.format.BitsPerPixel == 32: * * self.surface = Surface(()) # <<<<<<<<<<<<<< * self.surface.surface = self.window_surface * self.surface.owns_surface = False */ __pyx_tuple__9 = PyTuple_Pack(1, __pyx_empty_tuple); if (unlikely(!__pyx_tuple__9)) __PYX_ERR(0, 219, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__9); __Pyx_GIVEREF(__pyx_tuple__9); /* "pygame_sdl2/display.pyx":329 * rects = calloc(len(rectangles), sizeof(SDL_Rect)) * if rects == NULL: * raise MemoryError("Couldn't allocate rectangles.") # <<<<<<<<<<<<<< * * try: */ __pyx_tuple__10 = PyTuple_Pack(1, __pyx_kp_s_Couldn_t_allocate_rectangles); if (unlikely(!__pyx_tuple__10)) __PYX_ERR(0, 329, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__10); __Pyx_GIVEREF(__pyx_tuple__10); /* "pygame_sdl2/display.pyx":409 * * if not isinstance(title, bytes): * title = title.encode("utf-8") # <<<<<<<<<<<<<< * * SDL_SetWindowTitle(self.window, title) */ __pyx_tuple__11 = PyTuple_Pack(1, __pyx_kp_s_utf_8); if (unlikely(!__pyx_tuple__11)) __PYX_ERR(0, 409, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__11); __Pyx_GIVEREF(__pyx_tuple__11); /* "(tree fragment)":2 * def __reduce_cython__(self): * raise TypeError("self.gl_context,self.window,self.window_surface cannot be converted to a Python object for pickling") # <<<<<<<<<<<<<< * def __setstate_cython__(self, __pyx_state): * raise TypeError("self.gl_context,self.window,self.window_surface cannot be converted to a Python object for pickling") */ __pyx_tuple__12 = PyTuple_Pack(1, __pyx_kp_s_self_gl_context_self_window_self); if (unlikely(!__pyx_tuple__12)) __PYX_ERR(1, 2, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__12); __Pyx_GIVEREF(__pyx_tuple__12); /* "(tree fragment)":4 * raise TypeError("self.gl_context,self.window,self.window_surface cannot be converted to a Python object for pickling") * def __setstate_cython__(self, __pyx_state): * raise TypeError("self.gl_context,self.window,self.window_surface cannot be converted to a Python object for pickling") # <<<<<<<<<<<<<< */ __pyx_tuple__13 = PyTuple_Pack(1, __pyx_kp_s_self_gl_context_self_window_self); if (unlikely(!__pyx_tuple__13)) __PYX_ERR(1, 4, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__13); __Pyx_GIVEREF(__pyx_tuple__13); /* "pygame_sdl2/display.pyx":428 * default_swap_control = 1 * * def set_mode(resolution=(0, 0), flags=0, depth=0, pos=(SDL_WINDOWPOS_UNDEFINED, SDL_WINDOWPOS_UNDEFINED)): # <<<<<<<<<<<<<< * global main_window * */ __pyx_tuple__14 = PyTuple_Pack(2, __pyx_int_0, __pyx_int_0); if (unlikely(!__pyx_tuple__14)) __PYX_ERR(0, 428, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__14); __Pyx_GIVEREF(__pyx_tuple__14); /* "pygame_sdl2/display.pyx":40 * _pygame_hints = { } * * def hint(hint, value): # <<<<<<<<<<<<<< * * if str(hint).startswith("PYGAME_SDL2"): */ __pyx_tuple__16 = PyTuple_Pack(2, __pyx_n_s_hint, __pyx_n_s_value); if (unlikely(!__pyx_tuple__16)) __PYX_ERR(0, 40, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__16); __Pyx_GIVEREF(__pyx_tuple__16); __pyx_codeobj__17 = (PyObject*)__Pyx_PyCode_New(2, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__16, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_display_pyx, __pyx_n_s_hint, 40, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__17)) __PYX_ERR(0, 40, __pyx_L1_error) /* "pygame_sdl2/display.pyx":55 * SDL_SetHint(hint, value) * * def _get_hint(hint, default): # <<<<<<<<<<<<<< * hint = str(hint) * */ __pyx_tuple__18 = PyTuple_Pack(2, __pyx_n_s_hint, __pyx_n_s_default); if (unlikely(!__pyx_tuple__18)) __PYX_ERR(0, 55, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__18); __Pyx_GIVEREF(__pyx_tuple__18); __pyx_codeobj__19 = (PyObject*)__Pyx_PyCode_New(2, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__18, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_display_pyx, __pyx_n_s_get_hint, 55, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__19)) __PYX_ERR(0, 55, __pyx_L1_error) /* "pygame_sdl2/display.pyx":69 * main_done = False * * def sdl_main_init(): # <<<<<<<<<<<<<< * global main_done * */ __pyx_codeobj__20 = (PyObject*)__Pyx_PyCode_New(0, 0, 0, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_display_pyx, __pyx_n_s_sdl_main_init, 69, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__20)) __PYX_ERR(0, 69, __pyx_L1_error) /* "pygame_sdl2/display.pyx":86 * * @pygame_sdl2.register_init * def init(): # <<<<<<<<<<<<<< * * if init_done: */ __pyx_codeobj__21 = (PyObject*)__Pyx_PyCode_New(0, 0, 0, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_display_pyx, __pyx_n_s_init, 86, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__21)) __PYX_ERR(0, 86, __pyx_L1_error) /* "pygame_sdl2/display.pyx":106 * * @pygame_sdl2.register_quit * def quit(): # @ReservedAssignment # <<<<<<<<<<<<<< * * global init_done */ __pyx_codeobj__22 = (PyObject*)__Pyx_PyCode_New(0, 0, 0, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_display_pyx, __pyx_n_s_quit, 106, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__22)) __PYX_ERR(0, 106, __pyx_L1_error) /* "pygame_sdl2/display.pyx":117 * init_done = False * * def get_init(): # <<<<<<<<<<<<<< * return init_done * */ __pyx_codeobj__23 = (PyObject*)__Pyx_PyCode_New(0, 0, 0, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_display_pyx, __pyx_n_s_get_init, 117, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__23)) __PYX_ERR(0, 117, __pyx_L1_error) /* "pygame_sdl2/display.pyx":127 * _shown_first_window = False * * def _before_first_window(): # <<<<<<<<<<<<<< * global _shown_first_window * */ __pyx_tuple__24 = PyTuple_Pack(1, __pyx_n_s_androidembed); if (unlikely(!__pyx_tuple__24)) __PYX_ERR(0, 127, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__24); __Pyx_GIVEREF(__pyx_tuple__24); __pyx_codeobj__25 = (PyObject*)__Pyx_PyCode_New(0, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__24, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_display_pyx, __pyx_n_s_before_first_window, 127, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__25)) __PYX_ERR(0, 127, __pyx_L1_error) /* "pygame_sdl2/display.pyx":428 * default_swap_control = 1 * * def set_mode(resolution=(0, 0), flags=0, depth=0, pos=(SDL_WINDOWPOS_UNDEFINED, SDL_WINDOWPOS_UNDEFINED)): # <<<<<<<<<<<<<< * global main_window * */ __pyx_tuple__26 = PyTuple_Pack(4, __pyx_n_s_resolution, __pyx_n_s_flags, __pyx_n_s_depth, __pyx_n_s_pos); if (unlikely(!__pyx_tuple__26)) __PYX_ERR(0, 428, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__26); __Pyx_GIVEREF(__pyx_tuple__26); __pyx_codeobj__27 = (PyObject*)__Pyx_PyCode_New(4, 0, 4, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__26, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_display_pyx, __pyx_n_s_set_mode, 428, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__27)) __PYX_ERR(0, 428, __pyx_L1_error) /* "pygame_sdl2/display.pyx":447 * return main_window.surface * * def get_surface(): # <<<<<<<<<<<<<< * if main_window is None: * return None */ __pyx_codeobj__28 = (PyObject*)__Pyx_PyCode_New(0, 0, 0, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_display_pyx, __pyx_n_s_get_surface, 447, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__28)) __PYX_ERR(0, 447, __pyx_L1_error) /* "pygame_sdl2/display.pyx":453 * return main_window.get_surface() * * def get_window(): # <<<<<<<<<<<<<< * """ * Returns the Window created by set_mode, or None if no such window */ __pyx_codeobj__29 = (PyObject*)__Pyx_PyCode_New(0, 0, 0, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_display_pyx, __pyx_n_s_get_window, 453, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__29)) __PYX_ERR(0, 453, __pyx_L1_error) /* "pygame_sdl2/display.pyx":461 * return main_window * * def flip(): # <<<<<<<<<<<<<< * if main_window: * main_window.flip() */ __pyx_codeobj__30 = (PyObject*)__Pyx_PyCode_New(0, 0, 0, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_display_pyx, __pyx_n_s_flip, 461, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__30)) __PYX_ERR(0, 461, __pyx_L1_error) /* "pygame_sdl2/display.pyx":465 * main_window.flip() * * def update(rectangles=None): # <<<<<<<<<<<<<< * if main_window: * main_window.update(rectangles) */ __pyx_tuple__31 = PyTuple_Pack(1, __pyx_n_s_rectangles); if (unlikely(!__pyx_tuple__31)) __PYX_ERR(0, 465, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__31); __Pyx_GIVEREF(__pyx_tuple__31); __pyx_codeobj__32 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__31, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_display_pyx, __pyx_n_s_update, 465, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__32)) __PYX_ERR(0, 465, __pyx_L1_error) /* "pygame_sdl2/display.pyx":469 * main_window.update(rectangles) * * def get_driver(): # <<<<<<<<<<<<<< * cdef const char *driver = SDL_GetCurrentVideoDriver() * */ __pyx_tuple__33 = PyTuple_Pack(1, __pyx_n_s_driver); if (unlikely(!__pyx_tuple__33)) __PYX_ERR(0, 469, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__33); __Pyx_GIVEREF(__pyx_tuple__33); __pyx_codeobj__34 = (PyObject*)__Pyx_PyCode_New(0, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__33, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_display_pyx, __pyx_n_s_get_driver, 469, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__34)) __PYX_ERR(0, 469, __pyx_L1_error) /* "pygame_sdl2/display.pyx":477 * return driver * * class Info(object): # <<<<<<<<<<<<<< * * def __init__(self): */ __pyx_tuple__35 = PyTuple_Pack(1, __pyx_builtin_object); if (unlikely(!__pyx_tuple__35)) __PYX_ERR(0, 477, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__35); __Pyx_GIVEREF(__pyx_tuple__35); /* "pygame_sdl2/display.pyx":479 * class Info(object): * * def __init__(self): # <<<<<<<<<<<<<< * cdef SDL_DisplayMode dm * cdef SDL_PixelFormat *format */ __pyx_tuple__36 = PyTuple_Pack(3, __pyx_n_s_self, __pyx_n_s_dm, __pyx_n_s_format); if (unlikely(!__pyx_tuple__36)) __PYX_ERR(0, 479, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__36); __Pyx_GIVEREF(__pyx_tuple__36); __pyx_codeobj__37 = (PyObject*)__Pyx_PyCode_New(1, 0, 3, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__36, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_display_pyx, __pyx_n_s_init_2, 479, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__37)) __PYX_ERR(0, 479, __pyx_L1_error) /* "pygame_sdl2/display.pyx":538 * self.blit_sw_A = False * * def __repr__(self): # <<<<<<<<<<<<<< * return "".format(self.__dict__) * */ __pyx_tuple__38 = PyTuple_Pack(1, __pyx_n_s_self); if (unlikely(!__pyx_tuple__38)) __PYX_ERR(0, 538, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__38); __Pyx_GIVEREF(__pyx_tuple__38); __pyx_codeobj__39 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__38, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_display_pyx, __pyx_n_s_repr, 538, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__39)) __PYX_ERR(0, 538, __pyx_L1_error) /* "pygame_sdl2/display.pyx":542 * * * def get_wm_info(): # <<<<<<<<<<<<<< * if main_window: * return main_window.get_wm_info() */ __pyx_codeobj__40 = (PyObject*)__Pyx_PyCode_New(0, 0, 0, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_display_pyx, __pyx_n_s_get_wm_info, 542, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__40)) __PYX_ERR(0, 542, __pyx_L1_error) /* "pygame_sdl2/display.pyx":549 * * * def get_num_video_displays(): # <<<<<<<<<<<<<< * """ * Returns the number of video displays connected to the system. */ __pyx_tuple__41 = PyTuple_Pack(1, __pyx_n_s_rv); if (unlikely(!__pyx_tuple__41)) __PYX_ERR(0, 549, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__41); __Pyx_GIVEREF(__pyx_tuple__41); __pyx_codeobj__42 = (PyObject*)__Pyx_PyCode_New(0, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__41, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_display_pyx, __pyx_n_s_get_num_video_displays, 549, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__42)) __PYX_ERR(0, 549, __pyx_L1_error) /* "pygame_sdl2/display.pyx":562 * * * def list_modes(depth=0, flags=0, display=0): # <<<<<<<<<<<<<< * """ * Returns a list of possible display modes for the display `display`. */ __pyx_tuple__43 = PyTuple_Pack(8, __pyx_n_s_depth, __pyx_n_s_flags, __pyx_n_s_display, __pyx_n_s_num_modes, __pyx_n_s_i, __pyx_n_s_mode, __pyx_n_s_rv, __pyx_n_s_t); if (unlikely(!__pyx_tuple__43)) __PYX_ERR(0, 562, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__43); __Pyx_GIVEREF(__pyx_tuple__43); __pyx_codeobj__44 = (PyObject*)__Pyx_PyCode_New(3, 0, 8, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__43, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_display_pyx, __pyx_n_s_list_modes, 562, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__44)) __PYX_ERR(0, 562, __pyx_L1_error) /* "pygame_sdl2/display.pyx":587 * * * def mode_ok(size, flags=0, depth=0): # <<<<<<<<<<<<<< * """ * Returns true if size is in the result of list_modes(). */ __pyx_tuple__45 = PyTuple_Pack(3, __pyx_n_s_size, __pyx_n_s_flags, __pyx_n_s_depth); if (unlikely(!__pyx_tuple__45)) __PYX_ERR(0, 587, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__45); __Pyx_GIVEREF(__pyx_tuple__45); __pyx_codeobj__46 = (PyObject*)__Pyx_PyCode_New(3, 0, 3, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__45, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_display_pyx, __pyx_n_s_mode_ok, 587, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__46)) __PYX_ERR(0, 587, __pyx_L1_error) /* "pygame_sdl2/display.pyx":594 * return tuple(size) in list_modes() * * def gl_reset_attributes(): # <<<<<<<<<<<<<< * SDL_GL_ResetAttributes() * */ __pyx_codeobj__47 = (PyObject*)__Pyx_PyCode_New(0, 0, 0, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_display_pyx, __pyx_n_s_gl_reset_attributes, 594, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__47)) __PYX_ERR(0, 594, __pyx_L1_error) /* "pygame_sdl2/display.pyx":597 * SDL_GL_ResetAttributes() * * def gl_set_attribute(flag, value): # <<<<<<<<<<<<<< * * if flag == GL_SWAP_CONTROL: */ __pyx_tuple__48 = PyTuple_Pack(2, __pyx_n_s_flag, __pyx_n_s_value); if (unlikely(!__pyx_tuple__48)) __PYX_ERR(0, 597, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__48); __Pyx_GIVEREF(__pyx_tuple__48); __pyx_codeobj__49 = (PyObject*)__Pyx_PyCode_New(2, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__48, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_display_pyx, __pyx_n_s_gl_set_attribute, 597, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__49)) __PYX_ERR(0, 597, __pyx_L1_error) /* "pygame_sdl2/display.pyx":617 * raise error() * * def gl_get_attribute(flag): # <<<<<<<<<<<<<< * cdef int rv * */ __pyx_tuple__50 = PyTuple_Pack(2, __pyx_n_s_flag, __pyx_n_s_rv); if (unlikely(!__pyx_tuple__50)) __PYX_ERR(0, 617, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__50); __Pyx_GIVEREF(__pyx_tuple__50); __pyx_codeobj__51 = (PyObject*)__Pyx_PyCode_New(1, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__50, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_display_pyx, __pyx_n_s_gl_get_attribute, 617, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__51)) __PYX_ERR(0, 617, __pyx_L1_error) /* "pygame_sdl2/display.pyx":628 * return rv * * def gl_load_library(path): # <<<<<<<<<<<<<< * if path is None: * if SDL_GL_LoadLibrary(NULL): */ __pyx_tuple__52 = PyTuple_Pack(1, __pyx_n_s_path); if (unlikely(!__pyx_tuple__52)) __PYX_ERR(0, 628, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__52); __Pyx_GIVEREF(__pyx_tuple__52); __pyx_codeobj__53 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__52, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_display_pyx, __pyx_n_s_gl_load_library, 628, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__53)) __PYX_ERR(0, 628, __pyx_L1_error) /* "pygame_sdl2/display.pyx":636 * raise error() * * def gl_unload_library(): # <<<<<<<<<<<<<< * SDL_GL_UnloadLibrary() * */ __pyx_codeobj__54 = (PyObject*)__Pyx_PyCode_New(0, 0, 0, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_display_pyx, __pyx_n_s_gl_unload_library, 636, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__54)) __PYX_ERR(0, 636, __pyx_L1_error) /* "pygame_sdl2/display.pyx":639 * SDL_GL_UnloadLibrary() * * def get_active(): # <<<<<<<<<<<<<< * if main_window: * return main_window.get_active() */ __pyx_codeobj__55 = (PyObject*)__Pyx_PyCode_New(0, 0, 0, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_display_pyx, __pyx_n_s_get_active, 639, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__55)) __PYX_ERR(0, 639, __pyx_L1_error) /* "pygame_sdl2/display.pyx":644 * return False * * def iconify(): # <<<<<<<<<<<<<< * if main_window: * return main_window.iconify() */ __pyx_codeobj__56 = (PyObject*)__Pyx_PyCode_New(0, 0, 0, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_display_pyx, __pyx_n_s_iconify, 644, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__56)) __PYX_ERR(0, 644, __pyx_L1_error) /* "pygame_sdl2/display.pyx":650 * return False * * def toggle_fullscreen(): # <<<<<<<<<<<<<< * if main_window: * return main_window.toggle_fullscreen() */ __pyx_codeobj__57 = (PyObject*)__Pyx_PyCode_New(0, 0, 0, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_display_pyx, __pyx_n_s_toggle_fullscreen, 650, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__57)) __PYX_ERR(0, 650, __pyx_L1_error) /* "pygame_sdl2/display.pyx":656 * return True * * def set_gamma(red, green=None, blue=None): # <<<<<<<<<<<<<< * if main_window: * return main_window.set_gamma(red, green, blue) */ __pyx_tuple__58 = PyTuple_Pack(3, __pyx_n_s_red, __pyx_n_s_green, __pyx_n_s_blue); if (unlikely(!__pyx_tuple__58)) __PYX_ERR(0, 656, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__58); __Pyx_GIVEREF(__pyx_tuple__58); __pyx_codeobj__59 = (PyObject*)__Pyx_PyCode_New(3, 0, 3, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__58, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_display_pyx, __pyx_n_s_set_gamma, 656, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__59)) __PYX_ERR(0, 656, __pyx_L1_error) /* "pygame_sdl2/display.pyx":661 * return False * * def set_gamma_ramp(red, green, blue): # <<<<<<<<<<<<<< * if main_window: * return main_window.set_gamma_ramp(red, green, blue) */ __pyx_tuple__60 = PyTuple_Pack(3, __pyx_n_s_red, __pyx_n_s_green, __pyx_n_s_blue); if (unlikely(!__pyx_tuple__60)) __PYX_ERR(0, 661, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__60); __Pyx_GIVEREF(__pyx_tuple__60); __pyx_codeobj__61 = (PyObject*)__Pyx_PyCode_New(3, 0, 3, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__60, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_display_pyx, __pyx_n_s_set_gamma_ramp, 661, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__61)) __PYX_ERR(0, 661, __pyx_L1_error) /* "pygame_sdl2/display.pyx":666 * return False * * def set_icon(surface): # <<<<<<<<<<<<<< * global default_icon * */ __pyx_tuple__62 = PyTuple_Pack(1, __pyx_n_s_surface); if (unlikely(!__pyx_tuple__62)) __PYX_ERR(0, 666, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__62); __Pyx_GIVEREF(__pyx_tuple__62); __pyx_codeobj__63 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__62, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_display_pyx, __pyx_n_s_set_icon, 666, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__63)) __PYX_ERR(0, 666, __pyx_L1_error) /* "pygame_sdl2/display.pyx":674 * main_window.set_icon(default_icon) * * def set_caption(title, icontitle = None): # <<<<<<<<<<<<<< * global default_title * */ __pyx_tuple__64 = PyTuple_Pack(2, __pyx_n_s_title, __pyx_n_s_icontitle); if (unlikely(!__pyx_tuple__64)) __PYX_ERR(0, 674, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__64); __Pyx_GIVEREF(__pyx_tuple__64); __pyx_codeobj__65 = (PyObject*)__Pyx_PyCode_New(2, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__64, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_display_pyx, __pyx_n_s_set_caption, 674, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__65)) __PYX_ERR(0, 674, __pyx_L1_error) /* "pygame_sdl2/display.pyx":682 * main_window.set_caption(default_title) * * def get_caption(): # <<<<<<<<<<<<<< * return default_title * */ __pyx_codeobj__66 = (PyObject*)__Pyx_PyCode_New(0, 0, 0, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_display_pyx, __pyx_n_s_get_caption, 682, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__66)) __PYX_ERR(0, 682, __pyx_L1_error) /* "pygame_sdl2/display.pyx":685 * return default_title * * def get_drawable_size(): # <<<<<<<<<<<<<< * if main_window: * return main_window.get_drawable_size() */ __pyx_codeobj__67 = (PyObject*)__Pyx_PyCode_New(0, 0, 0, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_display_pyx, __pyx_n_s_get_drawable_size, 685, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__67)) __PYX_ERR(0, 685, __pyx_L1_error) /* "pygame_sdl2/display.pyx":690 * return None * * def get_num_video_displays(): # <<<<<<<<<<<<<< * rv = SDL_GetNumVideoDisplays() * if rv < 0: */ __pyx_tuple__68 = PyTuple_Pack(1, __pyx_n_s_rv); if (unlikely(!__pyx_tuple__68)) __PYX_ERR(0, 690, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__68); __Pyx_GIVEREF(__pyx_tuple__68); __pyx_codeobj__69 = (PyObject*)__Pyx_PyCode_New(0, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__68, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_display_pyx, __pyx_n_s_get_num_video_displays, 690, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__69)) __PYX_ERR(0, 690, __pyx_L1_error) /* "pygame_sdl2/display.pyx":697 * return rv * * def get_display_bounds(index): # <<<<<<<<<<<<<< * cdef SDL_Rect rect * rv = SDL_GetDisplayBounds(index, &rect) */ __pyx_tuple__70 = PyTuple_Pack(3, __pyx_n_s_index, __pyx_n_s_rect, __pyx_n_s_rv); if (unlikely(!__pyx_tuple__70)) __PYX_ERR(0, 697, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__70); __Pyx_GIVEREF(__pyx_tuple__70); __pyx_codeobj__71 = (PyObject*)__Pyx_PyCode_New(1, 0, 3, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__70, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_display_pyx, __pyx_n_s_get_display_bounds, 697, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__71)) __PYX_ERR(0, 697, __pyx_L1_error) /* "pygame_sdl2/display.pyx":703 * return (rect.x, rect.y, rect.w, rect.h) * * def get_platform(): # <<<<<<<<<<<<<< * return SDL_GetPlatform() * */ __pyx_codeobj__72 = (PyObject*)__Pyx_PyCode_New(0, 0, 0, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_display_pyx, __pyx_n_s_get_platform, 703, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__72)) __PYX_ERR(0, 703, __pyx_L1_error) __Pyx_RefNannyFinishContext(); return 0; __pyx_L1_error:; __Pyx_RefNannyFinishContext(); return -1; } static int __Pyx_InitGlobals(void) { if (__Pyx_InitStrings(__pyx_string_tab) < 0) __PYX_ERR(0, 1, __pyx_L1_error); __pyx_int_0 = PyInt_FromLong(0); if (unlikely(!__pyx_int_0)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_int_1 = PyInt_FromLong(1); if (unlikely(!__pyx_int_1)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_int_32 = PyInt_FromLong(32); if (unlikely(!__pyx_int_32)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_int_268435456 = PyInt_FromLong(268435456L); if (unlikely(!__pyx_int_268435456)) __PYX_ERR(0, 1, __pyx_L1_error) return 0; __pyx_L1_error:; return -1; } #if PY_MAJOR_VERSION < 3 PyMODINIT_FUNC initdisplay(void); /*proto*/ PyMODINIT_FUNC initdisplay(void) #else PyMODINIT_FUNC PyInit_display(void); /*proto*/ PyMODINIT_FUNC PyInit_display(void) #if CYTHON_PEP489_MULTI_PHASE_INIT { return PyModuleDef_Init(&__pyx_moduledef); } static int __Pyx_copy_spec_to_module(PyObject *spec, PyObject *moddict, const char* from_name, const char* to_name) { PyObject *value = PyObject_GetAttrString(spec, from_name); int result = 0; if (likely(value)) { result = PyDict_SetItemString(moddict, to_name, value); Py_DECREF(value); } else if (PyErr_ExceptionMatches(PyExc_AttributeError)) { PyErr_Clear(); } else { result = -1; } return result; } static PyObject* __pyx_pymod_create(PyObject *spec, CYTHON_UNUSED PyModuleDef *def) { PyObject *module = NULL, *moddict, *modname; if (__pyx_m) return __Pyx_NewRef(__pyx_m); modname = PyObject_GetAttrString(spec, "name"); if (unlikely(!modname)) goto bad; module = PyModule_NewObject(modname); Py_DECREF(modname); if (unlikely(!module)) goto bad; moddict = PyModule_GetDict(module); if (unlikely(!moddict)) goto bad; if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "loader", "__loader__") < 0)) goto bad; if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "origin", "__file__") < 0)) goto bad; if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "parent", "__package__") < 0)) goto bad; if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "submodule_search_locations", "__path__") < 0)) goto bad; return module; bad: Py_XDECREF(module); return NULL; } static int __pyx_pymod_exec_display(PyObject *__pyx_pyinit_module) #endif #endif { PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; int __pyx_t_4; PyObject *__pyx_t_5 = NULL; PyObject *__pyx_t_6 = NULL; PyObject *__pyx_t_7 = NULL; __Pyx_RefNannyDeclarations #if CYTHON_PEP489_MULTI_PHASE_INIT if (__pyx_m && __pyx_m == __pyx_pyinit_module) return 0; #endif #if CYTHON_REFNANNY __Pyx_RefNanny = __Pyx_RefNannyImportAPI("refnanny"); if (!__Pyx_RefNanny) { PyErr_Clear(); __Pyx_RefNanny = __Pyx_RefNannyImportAPI("Cython.Runtime.refnanny"); if (!__Pyx_RefNanny) Py_FatalError("failed to import 'refnanny' module"); } #endif __Pyx_RefNannySetupContext("PyMODINIT_FUNC PyInit_display(void)", 0); if (__Pyx_check_binary_version() < 0) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_empty_tuple = PyTuple_New(0); if (unlikely(!__pyx_empty_tuple)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_empty_bytes = PyBytes_FromStringAndSize("", 0); if (unlikely(!__pyx_empty_bytes)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_empty_unicode = PyUnicode_FromStringAndSize("", 0); if (unlikely(!__pyx_empty_unicode)) __PYX_ERR(0, 1, __pyx_L1_error) #ifdef __Pyx_CyFunction_USED if (__pyx_CyFunction_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error) #endif #ifdef __Pyx_FusedFunction_USED if (__pyx_FusedFunction_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error) #endif #ifdef __Pyx_Coroutine_USED if (__pyx_Coroutine_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error) #endif #ifdef __Pyx_Generator_USED if (__pyx_Generator_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error) #endif #ifdef __Pyx_AsyncGen_USED if (__pyx_AsyncGen_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error) #endif #ifdef __Pyx_StopAsyncIteration_USED if (__pyx_StopAsyncIteration_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error) #endif /*--- Library function declarations ---*/ /*--- Threads initialization code ---*/ #if defined(__PYX_FORCE_INIT_THREADS) && __PYX_FORCE_INIT_THREADS #ifdef WITH_THREAD /* Python build with threading support? */ PyEval_InitThreads(); #endif #endif /*--- Module creation code ---*/ #if CYTHON_PEP489_MULTI_PHASE_INIT __pyx_m = __pyx_pyinit_module; Py_INCREF(__pyx_m); #else #if PY_MAJOR_VERSION < 3 __pyx_m = Py_InitModule4("display", __pyx_methods, 0, 0, PYTHON_API_VERSION); Py_XINCREF(__pyx_m); #else __pyx_m = PyModule_Create(&__pyx_moduledef); #endif if (unlikely(!__pyx_m)) __PYX_ERR(0, 1, __pyx_L1_error) #endif __pyx_d = PyModule_GetDict(__pyx_m); if (unlikely(!__pyx_d)) __PYX_ERR(0, 1, __pyx_L1_error) Py_INCREF(__pyx_d); __pyx_b = PyImport_AddModule(__Pyx_BUILTIN_MODULE_NAME); if (unlikely(!__pyx_b)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_cython_runtime = PyImport_AddModule((char *) "cython_runtime"); if (unlikely(!__pyx_cython_runtime)) __PYX_ERR(0, 1, __pyx_L1_error) #if CYTHON_COMPILING_IN_PYPY Py_INCREF(__pyx_b); #endif if (PyObject_SetAttrString(__pyx_m, "__builtins__", __pyx_b) < 0) __PYX_ERR(0, 1, __pyx_L1_error); /*--- Initialize various global constants etc. ---*/ if (__Pyx_InitGlobals() < 0) __PYX_ERR(0, 1, __pyx_L1_error) #if PY_MAJOR_VERSION < 3 && (__PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT) if (__Pyx_init_sys_getdefaultencoding_params() < 0) __PYX_ERR(0, 1, __pyx_L1_error) #endif if (__pyx_module_is_main_pygame_sdl2__display) { if (PyObject_SetAttrString(__pyx_m, "__name__", __pyx_n_s_main) < 0) __PYX_ERR(0, 1, __pyx_L1_error) } #if PY_MAJOR_VERSION >= 3 { PyObject *modules = PyImport_GetModuleDict(); if (unlikely(!modules)) __PYX_ERR(0, 1, __pyx_L1_error) if (!PyDict_GetItemString(modules, "pygame_sdl2.display")) { if (unlikely(PyDict_SetItemString(modules, "pygame_sdl2.display", __pyx_m) < 0)) __PYX_ERR(0, 1, __pyx_L1_error) } } #endif /*--- Builtin init code ---*/ if (__Pyx_InitCachedBuiltins() < 0) __PYX_ERR(0, 1, __pyx_L1_error) /*--- Constants init code ---*/ if (__Pyx_InitCachedConstants() < 0) __PYX_ERR(0, 1, __pyx_L1_error) /*--- Global init code ---*/ __pyx_v_11pygame_sdl2_7display_main_window = ((struct __pyx_obj_11pygame_sdl2_7display_Window *)Py_None); Py_INCREF(Py_None); /*--- Variable export code ---*/ if (__Pyx_ExportVoidPtr(__pyx_n_s_main_window, (void *)&__pyx_v_11pygame_sdl2_7display_main_window, "struct __pyx_obj_11pygame_sdl2_7display_Window *") < 0) __PYX_ERR(0, 1, __pyx_L1_error) /*--- Function export code ---*/ if (__Pyx_ExportFunction("PyWindow_AsWindow", (void (*)(void))__pyx_f_11pygame_sdl2_7display_PyWindow_AsWindow, "SDL_Window *(PyObject *)") < 0) __PYX_ERR(0, 1, __pyx_L1_error) /*--- Type init code ---*/ if (PyType_Ready(&__pyx_type_11pygame_sdl2_7display_Window) < 0) __PYX_ERR(0, 145, __pyx_L1_error) __pyx_type_11pygame_sdl2_7display_Window.tp_print = 0; if (PyObject_SetAttrString(__pyx_m, "Window", (PyObject *)&__pyx_type_11pygame_sdl2_7display_Window) < 0) __PYX_ERR(0, 145, __pyx_L1_error) if (__pyx_type_11pygame_sdl2_7display_Window.tp_weaklistoffset == 0) __pyx_type_11pygame_sdl2_7display_Window.tp_weaklistoffset = offsetof(struct __pyx_obj_11pygame_sdl2_7display_Window, __weakref__); if (__Pyx_setup_reduce((PyObject*)&__pyx_type_11pygame_sdl2_7display_Window) < 0) __PYX_ERR(0, 145, __pyx_L1_error) __pyx_ptype_11pygame_sdl2_7display_Window = &__pyx_type_11pygame_sdl2_7display_Window; /*--- Type import code ---*/ __pyx_ptype_11pygame_sdl2_7surface_Surface = __Pyx_ImportType("pygame_sdl2.surface", "Surface", sizeof(struct __pyx_obj_11pygame_sdl2_7surface_Surface), 1); if (unlikely(!__pyx_ptype_11pygame_sdl2_7surface_Surface)) __PYX_ERR(3, 23, __pyx_L1_error) __pyx_vtabptr_11pygame_sdl2_7surface_Surface = (struct __pyx_vtabstruct_11pygame_sdl2_7surface_Surface*)__Pyx_GetVtable(__pyx_ptype_11pygame_sdl2_7surface_Surface->tp_dict); if (unlikely(!__pyx_vtabptr_11pygame_sdl2_7surface_Surface)) __PYX_ERR(3, 23, __pyx_L1_error) __pyx_ptype_11pygame_sdl2_4rect_Rect = __Pyx_ImportType("pygame_sdl2.rect", "Rect", sizeof(struct __pyx_obj_11pygame_sdl2_4rect_Rect), 1); if (unlikely(!__pyx_ptype_11pygame_sdl2_4rect_Rect)) __PYX_ERR(4, 21, __pyx_L1_error) /*--- Variable import code ---*/ /*--- Function import code ---*/ __pyx_t_1 = __Pyx_ImportModule("pygame_sdl2.rect"); if (!__pyx_t_1) __PYX_ERR(0, 1, __pyx_L1_error) if (__Pyx_ImportFunction(__pyx_t_1, "to_sdl_rect", (void (**)(void))&__pyx_f_11pygame_sdl2_4rect_to_sdl_rect, "int (PyObject *, SDL_Rect *, struct __pyx_opt_args_11pygame_sdl2_4rect_to_sdl_rect *__pyx_optional_args)") < 0) __PYX_ERR(0, 1, __pyx_L1_error) Py_DECREF(__pyx_t_1); __pyx_t_1 = 0; /*--- Execution code ---*/ #if defined(__Pyx_Generator_USED) || defined(__Pyx_Coroutine_USED) if (__Pyx_patch_abc() < 0) __PYX_ERR(0, 1, __pyx_L1_error) #endif /* "pygame_sdl2/display.pyx":25 * * from libc.stdlib cimport calloc, free * from pygame_sdl2.locals import SRCALPHA, GL_SWAP_CONTROL # <<<<<<<<<<<<<< * from pygame_sdl2.error import error * import pygame_sdl2 */ __pyx_t_2 = PyList_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 25, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_INCREF(__pyx_n_s_SRCALPHA); __Pyx_GIVEREF(__pyx_n_s_SRCALPHA); PyList_SET_ITEM(__pyx_t_2, 0, __pyx_n_s_SRCALPHA); __Pyx_INCREF(__pyx_n_s_GL_SWAP_CONTROL); __Pyx_GIVEREF(__pyx_n_s_GL_SWAP_CONTROL); PyList_SET_ITEM(__pyx_t_2, 1, __pyx_n_s_GL_SWAP_CONTROL); __pyx_t_3 = __Pyx_Import(__pyx_n_s_pygame_sdl2_locals, __pyx_t_2, -1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 25, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_2 = __Pyx_ImportFrom(__pyx_t_3, __pyx_n_s_SRCALPHA); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 25, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_SRCALPHA, __pyx_t_2) < 0) __PYX_ERR(0, 25, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_2 = __Pyx_ImportFrom(__pyx_t_3, __pyx_n_s_GL_SWAP_CONTROL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 25, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_GL_SWAP_CONTROL, __pyx_t_2) < 0) __PYX_ERR(0, 25, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "pygame_sdl2/display.pyx":26 * from libc.stdlib cimport calloc, free * from pygame_sdl2.locals import SRCALPHA, GL_SWAP_CONTROL * from pygame_sdl2.error import error # <<<<<<<<<<<<<< * import pygame_sdl2 * */ __pyx_t_3 = PyList_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 26, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_INCREF(__pyx_n_s_error); __Pyx_GIVEREF(__pyx_n_s_error); PyList_SET_ITEM(__pyx_t_3, 0, __pyx_n_s_error); __pyx_t_2 = __Pyx_Import(__pyx_n_s_pygame_sdl2_error, __pyx_t_3, -1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 26, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_3 = __Pyx_ImportFrom(__pyx_t_2, __pyx_n_s_error); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 26, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); if (PyDict_SetItem(__pyx_d, __pyx_n_s_error, __pyx_t_3) < 0) __PYX_ERR(0, 26, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "pygame_sdl2/display.pyx":27 * from pygame_sdl2.locals import SRCALPHA, GL_SWAP_CONTROL * from pygame_sdl2.error import error * import pygame_sdl2 # <<<<<<<<<<<<<< * * import warnings */ __pyx_t_2 = __Pyx_Import(__pyx_n_s_pygame_sdl2, 0, -1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 27, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_pygame_sdl2, __pyx_t_2) < 0) __PYX_ERR(0, 27, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "pygame_sdl2/display.pyx":29 * import pygame_sdl2 * * import warnings # <<<<<<<<<<<<<< * import os * */ __pyx_t_2 = __Pyx_Import(__pyx_n_s_warnings, 0, -1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 29, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_warnings, __pyx_t_2) < 0) __PYX_ERR(0, 29, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "pygame_sdl2/display.pyx":30 * * import warnings * import os # <<<<<<<<<<<<<< * * # True if we are on ios. */ __pyx_t_2 = __Pyx_Import(__pyx_n_s_os, 0, -1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 30, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_os, __pyx_t_2) < 0) __PYX_ERR(0, 30, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "pygame_sdl2/display.pyx":33 * * # True if we are on ios. * ios = ("PYGAME_IOS" in os.environ) # <<<<<<<<<<<<<< * * # This inits SDL proper, and should be called by the other init methods. */ __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_os); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 33, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_environ); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 33, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_4 = (__Pyx_PySequence_ContainsTF(__pyx_n_s_PYGAME_IOS, __pyx_t_3, Py_EQ)); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(0, 33, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_3 = __Pyx_PyBool_FromLong(__pyx_t_4); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 33, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); if (PyDict_SetItem(__pyx_d, __pyx_n_s_ios, __pyx_t_3) < 0) __PYX_ERR(0, 33, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "pygame_sdl2/display.pyx":38 * * # A map from a PYGAME_SDL2 hint to what it was set to. * _pygame_hints = { } # <<<<<<<<<<<<<< * * def hint(hint, value): */ __pyx_t_3 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 38, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); if (PyDict_SetItem(__pyx_d, __pyx_n_s_pygame_hints, __pyx_t_3) < 0) __PYX_ERR(0, 38, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "pygame_sdl2/display.pyx":40 * _pygame_hints = { } * * def hint(hint, value): # <<<<<<<<<<<<<< * * if str(hint).startswith("PYGAME_SDL2"): */ __pyx_t_3 = PyCFunction_NewEx(&__pyx_mdef_11pygame_sdl2_7display_1hint, NULL, __pyx_n_s_pygame_sdl2_display); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 40, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); if (PyDict_SetItem(__pyx_d, __pyx_n_s_hint, __pyx_t_3) < 0) __PYX_ERR(0, 40, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "pygame_sdl2/display.pyx":55 * SDL_SetHint(hint, value) * * def _get_hint(hint, default): # <<<<<<<<<<<<<< * hint = str(hint) * */ __pyx_t_3 = PyCFunction_NewEx(&__pyx_mdef_11pygame_sdl2_7display_3_get_hint, NULL, __pyx_n_s_pygame_sdl2_display); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 55, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); if (PyDict_SetItem(__pyx_d, __pyx_n_s_get_hint, __pyx_t_3) < 0) __PYX_ERR(0, 55, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "pygame_sdl2/display.pyx":67 * * * main_done = False # <<<<<<<<<<<<<< * * def sdl_main_init(): */ if (PyDict_SetItem(__pyx_d, __pyx_n_s_main_done, Py_False) < 0) __PYX_ERR(0, 67, __pyx_L1_error) /* "pygame_sdl2/display.pyx":69 * main_done = False * * def sdl_main_init(): # <<<<<<<<<<<<<< * global main_done * */ __pyx_t_3 = PyCFunction_NewEx(&__pyx_mdef_11pygame_sdl2_7display_5sdl_main_init, NULL, __pyx_n_s_pygame_sdl2_display); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 69, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); if (PyDict_SetItem(__pyx_d, __pyx_n_s_sdl_main_init, __pyx_t_3) < 0) __PYX_ERR(0, 69, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "pygame_sdl2/display.pyx":83 * * # True if init has been called without quit being called. * init_done = False # <<<<<<<<<<<<<< * * @pygame_sdl2.register_init */ if (PyDict_SetItem(__pyx_d, __pyx_n_s_init_done, Py_False) < 0) __PYX_ERR(0, 83, __pyx_L1_error) /* "pygame_sdl2/display.pyx":85 * init_done = False * * @pygame_sdl2.register_init # <<<<<<<<<<<<<< * def init(): * */ __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_pygame_sdl2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 85, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_register_init); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 85, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "pygame_sdl2/display.pyx":86 * * @pygame_sdl2.register_init * def init(): # <<<<<<<<<<<<<< * * if init_done: */ __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_11pygame_sdl2_7display_7init, NULL, __pyx_n_s_pygame_sdl2_display); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 86, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_6 = NULL; if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_5))) { __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_5); if (likely(__pyx_t_6)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5); __Pyx_INCREF(__pyx_t_6); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_5, function); } } if (!__pyx_t_6) { __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 85, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_GOTREF(__pyx_t_3); } else { #if CYTHON_FAST_PYCALL if (PyFunction_Check(__pyx_t_5)) { PyObject *__pyx_temp[2] = {__pyx_t_6, __pyx_t_2}; __pyx_t_3 = __Pyx_PyFunction_FastCall(__pyx_t_5, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 85, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } else #endif #if CYTHON_FAST_PYCCALL if (__Pyx_PyFastCFunction_Check(__pyx_t_5)) { PyObject *__pyx_temp[2] = {__pyx_t_6, __pyx_t_2}; __pyx_t_3 = __Pyx_PyCFunction_FastCall(__pyx_t_5, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 85, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } else #endif { __pyx_t_7 = PyTuple_New(1+1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 85, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_GIVEREF(__pyx_t_6); PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_6); __pyx_t_6 = NULL; __Pyx_GIVEREF(__pyx_t_2); PyTuple_SET_ITEM(__pyx_t_7, 0+1, __pyx_t_2); __pyx_t_2 = 0; __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_7, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 85, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; } } __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; if (PyDict_SetItem(__pyx_d, __pyx_n_s_init, __pyx_t_3) < 0) __PYX_ERR(0, 86, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "pygame_sdl2/display.pyx":105 * * * @pygame_sdl2.register_quit # <<<<<<<<<<<<<< * def quit(): # @ReservedAssignment * */ __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_pygame_sdl2); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 105, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_register_quit); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 105, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; /* "pygame_sdl2/display.pyx":106 * * @pygame_sdl2.register_quit * def quit(): # @ReservedAssignment # <<<<<<<<<<<<<< * * global init_done */ __pyx_t_5 = PyCFunction_NewEx(&__pyx_mdef_11pygame_sdl2_7display_9quit, NULL, __pyx_n_s_pygame_sdl2_display); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 106, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_2 = NULL; if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_7))) { __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_7); if (likely(__pyx_t_2)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_7); __Pyx_INCREF(__pyx_t_2); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_7, function); } } if (!__pyx_t_2) { __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_t_7, __pyx_t_5); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 105, __pyx_L1_error) __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_GOTREF(__pyx_t_3); } else { #if CYTHON_FAST_PYCALL if (PyFunction_Check(__pyx_t_7)) { PyObject *__pyx_temp[2] = {__pyx_t_2, __pyx_t_5}; __pyx_t_3 = __Pyx_PyFunction_FastCall(__pyx_t_7, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 105, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; } else #endif #if CYTHON_FAST_PYCCALL if (__Pyx_PyFastCFunction_Check(__pyx_t_7)) { PyObject *__pyx_temp[2] = {__pyx_t_2, __pyx_t_5}; __pyx_t_3 = __Pyx_PyCFunction_FastCall(__pyx_t_7, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 105, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; } else #endif { __pyx_t_6 = PyTuple_New(1+1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 105, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_GIVEREF(__pyx_t_2); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_2); __pyx_t_2 = NULL; __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_6, 0+1, __pyx_t_5); __pyx_t_5 = 0; __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_7, __pyx_t_6, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 105, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; } } __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; if (PyDict_SetItem(__pyx_d, __pyx_n_s_quit, __pyx_t_3) < 0) __PYX_ERR(0, 106, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "pygame_sdl2/display.pyx":117 * init_done = False * * def get_init(): # <<<<<<<<<<<<<< * return init_done * */ __pyx_t_3 = PyCFunction_NewEx(&__pyx_mdef_11pygame_sdl2_7display_11get_init, NULL, __pyx_n_s_pygame_sdl2_display); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 117, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); if (PyDict_SetItem(__pyx_d, __pyx_n_s_get_init, __pyx_t_3) < 0) __PYX_ERR(0, 117, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "pygame_sdl2/display.pyx":122 * * # The window that is used by the various module globals. * main_window = None # <<<<<<<<<<<<<< * * # Have we shown the first window? */ __Pyx_INCREF(Py_None); __Pyx_XGOTREF(((PyObject *)__pyx_v_11pygame_sdl2_7display_main_window)); __Pyx_DECREF_SET(__pyx_v_11pygame_sdl2_7display_main_window, ((struct __pyx_obj_11pygame_sdl2_7display_Window *)Py_None)); __Pyx_GIVEREF(Py_None); /* "pygame_sdl2/display.pyx":125 * * # Have we shown the first window? * _shown_first_window = False # <<<<<<<<<<<<<< * * def _before_first_window(): */ if (PyDict_SetItem(__pyx_d, __pyx_n_s_shown_first_window, Py_False) < 0) __PYX_ERR(0, 125, __pyx_L1_error) /* "pygame_sdl2/display.pyx":127 * _shown_first_window = False * * def _before_first_window(): # <<<<<<<<<<<<<< * global _shown_first_window * */ __pyx_t_3 = PyCFunction_NewEx(&__pyx_mdef_11pygame_sdl2_7display_13_before_first_window, NULL, __pyx_n_s_pygame_sdl2_display); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 127, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); if (PyDict_SetItem(__pyx_d, __pyx_n_s_before_first_window, __pyx_t_3) < 0) __PYX_ERR(0, 127, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "pygame_sdl2/display.pyx":146 * * cdef class Window: * def __init__(self, title, resolution=(0, 0), flags=0, depth=0, pos=(SDL_WINDOWPOS_UNDEFINED, SDL_WINDOWPOS_UNDEFINED)): # <<<<<<<<<<<<<< * * if not isinstance(title, bytes): */ __pyx_t_3 = __Pyx_PyInt_From_int(SDL_WINDOWPOS_UNDEFINED); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 146, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_7 = __Pyx_PyInt_From_int(SDL_WINDOWPOS_UNDEFINED); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 146, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __pyx_t_6 = PyTuple_New(2); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 146, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_3); __Pyx_GIVEREF(__pyx_t_7); PyTuple_SET_ITEM(__pyx_t_6, 1, __pyx_t_7); __pyx_t_3 = 0; __pyx_t_7 = 0; __pyx_k__6 = __pyx_t_6; __Pyx_GIVEREF(__pyx_t_6); __pyx_t_6 = 0; /* "pygame_sdl2/display.pyx":420 * * # The icon that's used for new windows. * default_icon = None # <<<<<<<<<<<<<< * * # The title that's used for new windows. */ if (PyDict_SetItem(__pyx_d, __pyx_n_s_default_icon, Py_None) < 0) __PYX_ERR(0, 420, __pyx_L1_error) /* "pygame_sdl2/display.pyx":423 * * # The title that's used for new windows. * default_title = "pygame window" # <<<<<<<<<<<<<< * * # The default gl_swap_control */ if (PyDict_SetItem(__pyx_d, __pyx_n_s_default_title, __pyx_kp_s_pygame_window) < 0) __PYX_ERR(0, 423, __pyx_L1_error) /* "pygame_sdl2/display.pyx":426 * * # The default gl_swap_control * default_swap_control = 1 # <<<<<<<<<<<<<< * * def set_mode(resolution=(0, 0), flags=0, depth=0, pos=(SDL_WINDOWPOS_UNDEFINED, SDL_WINDOWPOS_UNDEFINED)): */ if (PyDict_SetItem(__pyx_d, __pyx_n_s_default_swap_control, __pyx_int_1) < 0) __PYX_ERR(0, 426, __pyx_L1_error) /* "pygame_sdl2/display.pyx":428 * default_swap_control = 1 * * def set_mode(resolution=(0, 0), flags=0, depth=0, pos=(SDL_WINDOWPOS_UNDEFINED, SDL_WINDOWPOS_UNDEFINED)): # <<<<<<<<<<<<<< * global main_window * */ __pyx_t_6 = __Pyx_PyInt_From_int(SDL_WINDOWPOS_UNDEFINED); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 428, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __pyx_t_7 = __Pyx_PyInt_From_int(SDL_WINDOWPOS_UNDEFINED); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 428, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 428, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_GIVEREF(__pyx_t_6); PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_6); __Pyx_GIVEREF(__pyx_t_7); PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_7); __pyx_t_6 = 0; __pyx_t_7 = 0; __pyx_k__15 = __pyx_t_3; __Pyx_GIVEREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_3 = PyCFunction_NewEx(&__pyx_mdef_11pygame_sdl2_7display_15set_mode, NULL, __pyx_n_s_pygame_sdl2_display); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 428, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); if (PyDict_SetItem(__pyx_d, __pyx_n_s_set_mode, __pyx_t_3) < 0) __PYX_ERR(0, 428, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "pygame_sdl2/display.pyx":447 * return main_window.surface * * def get_surface(): # <<<<<<<<<<<<<< * if main_window is None: * return None */ __pyx_t_3 = PyCFunction_NewEx(&__pyx_mdef_11pygame_sdl2_7display_17get_surface, NULL, __pyx_n_s_pygame_sdl2_display); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 447, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); if (PyDict_SetItem(__pyx_d, __pyx_n_s_get_surface, __pyx_t_3) < 0) __PYX_ERR(0, 447, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "pygame_sdl2/display.pyx":453 * return main_window.get_surface() * * def get_window(): # <<<<<<<<<<<<<< * """ * Returns the Window created by set_mode, or None if no such window */ __pyx_t_3 = PyCFunction_NewEx(&__pyx_mdef_11pygame_sdl2_7display_19get_window, NULL, __pyx_n_s_pygame_sdl2_display); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 453, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); if (PyDict_SetItem(__pyx_d, __pyx_n_s_get_window, __pyx_t_3) < 0) __PYX_ERR(0, 453, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "pygame_sdl2/display.pyx":461 * return main_window * * def flip(): # <<<<<<<<<<<<<< * if main_window: * main_window.flip() */ __pyx_t_3 = PyCFunction_NewEx(&__pyx_mdef_11pygame_sdl2_7display_21flip, NULL, __pyx_n_s_pygame_sdl2_display); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 461, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); if (PyDict_SetItem(__pyx_d, __pyx_n_s_flip, __pyx_t_3) < 0) __PYX_ERR(0, 461, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "pygame_sdl2/display.pyx":465 * main_window.flip() * * def update(rectangles=None): # <<<<<<<<<<<<<< * if main_window: * main_window.update(rectangles) */ __pyx_t_3 = PyCFunction_NewEx(&__pyx_mdef_11pygame_sdl2_7display_23update, NULL, __pyx_n_s_pygame_sdl2_display); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 465, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); if (PyDict_SetItem(__pyx_d, __pyx_n_s_update, __pyx_t_3) < 0) __PYX_ERR(0, 465, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "pygame_sdl2/display.pyx":469 * main_window.update(rectangles) * * def get_driver(): # <<<<<<<<<<<<<< * cdef const char *driver = SDL_GetCurrentVideoDriver() * */ __pyx_t_3 = PyCFunction_NewEx(&__pyx_mdef_11pygame_sdl2_7display_25get_driver, NULL, __pyx_n_s_pygame_sdl2_display); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 469, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); if (PyDict_SetItem(__pyx_d, __pyx_n_s_get_driver, __pyx_t_3) < 0) __PYX_ERR(0, 469, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "pygame_sdl2/display.pyx":477 * return driver * * class Info(object): # <<<<<<<<<<<<<< * * def __init__(self): */ __pyx_t_3 = __Pyx_CalculateMetaclass(NULL, __pyx_tuple__35); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 477, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_7 = __Pyx_Py3MetaclassPrepare(__pyx_t_3, __pyx_tuple__35, __pyx_n_s_Info, __pyx_n_s_Info, (PyObject *) NULL, __pyx_n_s_pygame_sdl2_display, (PyObject *) NULL); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 477, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); /* "pygame_sdl2/display.pyx":479 * class Info(object): * * def __init__(self): # <<<<<<<<<<<<<< * cdef SDL_DisplayMode dm * cdef SDL_PixelFormat *format */ __pyx_t_6 = __Pyx_CyFunction_NewEx(&__pyx_mdef_11pygame_sdl2_7display_4Info_1__init__, 0, __pyx_n_s_Info___init, NULL, __pyx_n_s_pygame_sdl2_display, __pyx_d, ((PyObject *)__pyx_codeobj__37)); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 479, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); if (PyObject_SetItem(__pyx_t_7, __pyx_n_s_init_2, __pyx_t_6) < 0) __PYX_ERR(0, 479, __pyx_L1_error) __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; /* "pygame_sdl2/display.pyx":538 * self.blit_sw_A = False * * def __repr__(self): # <<<<<<<<<<<<<< * return "".format(self.__dict__) * */ __pyx_t_6 = __Pyx_CyFunction_NewEx(&__pyx_mdef_11pygame_sdl2_7display_4Info_3__repr__, 0, __pyx_n_s_Info___repr, NULL, __pyx_n_s_pygame_sdl2_display, __pyx_d, ((PyObject *)__pyx_codeobj__39)); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 538, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); if (PyObject_SetItem(__pyx_t_7, __pyx_n_s_repr, __pyx_t_6) < 0) __PYX_ERR(0, 538, __pyx_L1_error) __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; /* "pygame_sdl2/display.pyx":477 * return driver * * class Info(object): # <<<<<<<<<<<<<< * * def __init__(self): */ __pyx_t_6 = __Pyx_Py3ClassCreate(__pyx_t_3, __pyx_n_s_Info, __pyx_tuple__35, __pyx_t_7, NULL, 0, 1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 477, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); if (PyDict_SetItem(__pyx_d, __pyx_n_s_Info, __pyx_t_6) < 0) __PYX_ERR(0, 477, __pyx_L1_error) __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "pygame_sdl2/display.pyx":542 * * * def get_wm_info(): # <<<<<<<<<<<<<< * if main_window: * return main_window.get_wm_info() */ __pyx_t_3 = PyCFunction_NewEx(&__pyx_mdef_11pygame_sdl2_7display_27get_wm_info, NULL, __pyx_n_s_pygame_sdl2_display); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 542, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); if (PyDict_SetItem(__pyx_d, __pyx_n_s_get_wm_info, __pyx_t_3) < 0) __PYX_ERR(0, 542, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "pygame_sdl2/display.pyx":549 * * * def get_num_video_displays(): # <<<<<<<<<<<<<< * """ * Returns the number of video displays connected to the system. */ __pyx_t_3 = PyCFunction_NewEx(&__pyx_mdef_11pygame_sdl2_7display_29get_num_video_displays, NULL, __pyx_n_s_pygame_sdl2_display); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 549, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); if (PyDict_SetItem(__pyx_d, __pyx_n_s_get_num_video_displays, __pyx_t_3) < 0) __PYX_ERR(0, 549, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "pygame_sdl2/display.pyx":562 * * * def list_modes(depth=0, flags=0, display=0): # <<<<<<<<<<<<<< * """ * Returns a list of possible display modes for the display `display`. */ __pyx_t_3 = PyCFunction_NewEx(&__pyx_mdef_11pygame_sdl2_7display_31list_modes, NULL, __pyx_n_s_pygame_sdl2_display); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 562, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); if (PyDict_SetItem(__pyx_d, __pyx_n_s_list_modes, __pyx_t_3) < 0) __PYX_ERR(0, 562, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "pygame_sdl2/display.pyx":587 * * * def mode_ok(size, flags=0, depth=0): # <<<<<<<<<<<<<< * """ * Returns true if size is in the result of list_modes(). */ __pyx_t_3 = PyCFunction_NewEx(&__pyx_mdef_11pygame_sdl2_7display_33mode_ok, NULL, __pyx_n_s_pygame_sdl2_display); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 587, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); if (PyDict_SetItem(__pyx_d, __pyx_n_s_mode_ok, __pyx_t_3) < 0) __PYX_ERR(0, 587, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "pygame_sdl2/display.pyx":594 * return tuple(size) in list_modes() * * def gl_reset_attributes(): # <<<<<<<<<<<<<< * SDL_GL_ResetAttributes() * */ __pyx_t_3 = PyCFunction_NewEx(&__pyx_mdef_11pygame_sdl2_7display_35gl_reset_attributes, NULL, __pyx_n_s_pygame_sdl2_display); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 594, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); if (PyDict_SetItem(__pyx_d, __pyx_n_s_gl_reset_attributes, __pyx_t_3) < 0) __PYX_ERR(0, 594, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "pygame_sdl2/display.pyx":597 * SDL_GL_ResetAttributes() * * def gl_set_attribute(flag, value): # <<<<<<<<<<<<<< * * if flag == GL_SWAP_CONTROL: */ __pyx_t_3 = PyCFunction_NewEx(&__pyx_mdef_11pygame_sdl2_7display_37gl_set_attribute, NULL, __pyx_n_s_pygame_sdl2_display); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 597, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); if (PyDict_SetItem(__pyx_d, __pyx_n_s_gl_set_attribute, __pyx_t_3) < 0) __PYX_ERR(0, 597, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "pygame_sdl2/display.pyx":617 * raise error() * * def gl_get_attribute(flag): # <<<<<<<<<<<<<< * cdef int rv * */ __pyx_t_3 = PyCFunction_NewEx(&__pyx_mdef_11pygame_sdl2_7display_39gl_get_attribute, NULL, __pyx_n_s_pygame_sdl2_display); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 617, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); if (PyDict_SetItem(__pyx_d, __pyx_n_s_gl_get_attribute, __pyx_t_3) < 0) __PYX_ERR(0, 617, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "pygame_sdl2/display.pyx":628 * return rv * * def gl_load_library(path): # <<<<<<<<<<<<<< * if path is None: * if SDL_GL_LoadLibrary(NULL): */ __pyx_t_3 = PyCFunction_NewEx(&__pyx_mdef_11pygame_sdl2_7display_41gl_load_library, NULL, __pyx_n_s_pygame_sdl2_display); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 628, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); if (PyDict_SetItem(__pyx_d, __pyx_n_s_gl_load_library, __pyx_t_3) < 0) __PYX_ERR(0, 628, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "pygame_sdl2/display.pyx":636 * raise error() * * def gl_unload_library(): # <<<<<<<<<<<<<< * SDL_GL_UnloadLibrary() * */ __pyx_t_3 = PyCFunction_NewEx(&__pyx_mdef_11pygame_sdl2_7display_43gl_unload_library, NULL, __pyx_n_s_pygame_sdl2_display); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 636, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); if (PyDict_SetItem(__pyx_d, __pyx_n_s_gl_unload_library, __pyx_t_3) < 0) __PYX_ERR(0, 636, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "pygame_sdl2/display.pyx":639 * SDL_GL_UnloadLibrary() * * def get_active(): # <<<<<<<<<<<<<< * if main_window: * return main_window.get_active() */ __pyx_t_3 = PyCFunction_NewEx(&__pyx_mdef_11pygame_sdl2_7display_45get_active, NULL, __pyx_n_s_pygame_sdl2_display); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 639, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); if (PyDict_SetItem(__pyx_d, __pyx_n_s_get_active, __pyx_t_3) < 0) __PYX_ERR(0, 639, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "pygame_sdl2/display.pyx":644 * return False * * def iconify(): # <<<<<<<<<<<<<< * if main_window: * return main_window.iconify() */ __pyx_t_3 = PyCFunction_NewEx(&__pyx_mdef_11pygame_sdl2_7display_47iconify, NULL, __pyx_n_s_pygame_sdl2_display); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 644, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); if (PyDict_SetItem(__pyx_d, __pyx_n_s_iconify, __pyx_t_3) < 0) __PYX_ERR(0, 644, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "pygame_sdl2/display.pyx":650 * return False * * def toggle_fullscreen(): # <<<<<<<<<<<<<< * if main_window: * return main_window.toggle_fullscreen() */ __pyx_t_3 = PyCFunction_NewEx(&__pyx_mdef_11pygame_sdl2_7display_49toggle_fullscreen, NULL, __pyx_n_s_pygame_sdl2_display); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 650, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); if (PyDict_SetItem(__pyx_d, __pyx_n_s_toggle_fullscreen, __pyx_t_3) < 0) __PYX_ERR(0, 650, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "pygame_sdl2/display.pyx":656 * return True * * def set_gamma(red, green=None, blue=None): # <<<<<<<<<<<<<< * if main_window: * return main_window.set_gamma(red, green, blue) */ __pyx_t_3 = PyCFunction_NewEx(&__pyx_mdef_11pygame_sdl2_7display_51set_gamma, NULL, __pyx_n_s_pygame_sdl2_display); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 656, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); if (PyDict_SetItem(__pyx_d, __pyx_n_s_set_gamma, __pyx_t_3) < 0) __PYX_ERR(0, 656, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "pygame_sdl2/display.pyx":661 * return False * * def set_gamma_ramp(red, green, blue): # <<<<<<<<<<<<<< * if main_window: * return main_window.set_gamma_ramp(red, green, blue) */ __pyx_t_3 = PyCFunction_NewEx(&__pyx_mdef_11pygame_sdl2_7display_53set_gamma_ramp, NULL, __pyx_n_s_pygame_sdl2_display); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 661, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); if (PyDict_SetItem(__pyx_d, __pyx_n_s_set_gamma_ramp, __pyx_t_3) < 0) __PYX_ERR(0, 661, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "pygame_sdl2/display.pyx":666 * return False * * def set_icon(surface): # <<<<<<<<<<<<<< * global default_icon * */ __pyx_t_3 = PyCFunction_NewEx(&__pyx_mdef_11pygame_sdl2_7display_55set_icon, NULL, __pyx_n_s_pygame_sdl2_display); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 666, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); if (PyDict_SetItem(__pyx_d, __pyx_n_s_set_icon, __pyx_t_3) < 0) __PYX_ERR(0, 666, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "pygame_sdl2/display.pyx":674 * main_window.set_icon(default_icon) * * def set_caption(title, icontitle = None): # <<<<<<<<<<<<<< * global default_title * */ __pyx_t_3 = PyCFunction_NewEx(&__pyx_mdef_11pygame_sdl2_7display_57set_caption, NULL, __pyx_n_s_pygame_sdl2_display); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 674, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); if (PyDict_SetItem(__pyx_d, __pyx_n_s_set_caption, __pyx_t_3) < 0) __PYX_ERR(0, 674, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "pygame_sdl2/display.pyx":682 * main_window.set_caption(default_title) * * def get_caption(): # <<<<<<<<<<<<<< * return default_title * */ __pyx_t_3 = PyCFunction_NewEx(&__pyx_mdef_11pygame_sdl2_7display_59get_caption, NULL, __pyx_n_s_pygame_sdl2_display); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 682, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); if (PyDict_SetItem(__pyx_d, __pyx_n_s_get_caption, __pyx_t_3) < 0) __PYX_ERR(0, 682, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "pygame_sdl2/display.pyx":685 * return default_title * * def get_drawable_size(): # <<<<<<<<<<<<<< * if main_window: * return main_window.get_drawable_size() */ __pyx_t_3 = PyCFunction_NewEx(&__pyx_mdef_11pygame_sdl2_7display_61get_drawable_size, NULL, __pyx_n_s_pygame_sdl2_display); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 685, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); if (PyDict_SetItem(__pyx_d, __pyx_n_s_get_drawable_size, __pyx_t_3) < 0) __PYX_ERR(0, 685, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "pygame_sdl2/display.pyx":690 * return None * * def get_num_video_displays(): # <<<<<<<<<<<<<< * rv = SDL_GetNumVideoDisplays() * if rv < 0: */ __pyx_t_3 = PyCFunction_NewEx(&__pyx_mdef_11pygame_sdl2_7display_63get_num_video_displays, NULL, __pyx_n_s_pygame_sdl2_display); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 690, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); if (PyDict_SetItem(__pyx_d, __pyx_n_s_get_num_video_displays, __pyx_t_3) < 0) __PYX_ERR(0, 690, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "pygame_sdl2/display.pyx":697 * return rv * * def get_display_bounds(index): # <<<<<<<<<<<<<< * cdef SDL_Rect rect * rv = SDL_GetDisplayBounds(index, &rect) */ __pyx_t_3 = PyCFunction_NewEx(&__pyx_mdef_11pygame_sdl2_7display_65get_display_bounds, NULL, __pyx_n_s_pygame_sdl2_display); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 697, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); if (PyDict_SetItem(__pyx_d, __pyx_n_s_get_display_bounds, __pyx_t_3) < 0) __PYX_ERR(0, 697, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "pygame_sdl2/display.pyx":703 * return (rect.x, rect.y, rect.w, rect.h) * * def get_platform(): # <<<<<<<<<<<<<< * return SDL_GetPlatform() * */ __pyx_t_3 = PyCFunction_NewEx(&__pyx_mdef_11pygame_sdl2_7display_67get_platform, NULL, __pyx_n_s_pygame_sdl2_display); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 703, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); if (PyDict_SetItem(__pyx_d, __pyx_n_s_get_platform, __pyx_t_3) < 0) __PYX_ERR(0, 703, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "pygame_sdl2/display.pyx":1 * # Copyright 2014 Patrick Dawson # <<<<<<<<<<<<<< * # Copyright 2014 Tom Rothamel * # */ __pyx_t_3 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); if (PyDict_SetItem(__pyx_d, __pyx_n_s_test, __pyx_t_3) < 0) __PYX_ERR(0, 1, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /*--- Wrapped vars code ---*/ goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_5); __Pyx_XDECREF(__pyx_t_6); __Pyx_XDECREF(__pyx_t_7); if (__pyx_m) { if (__pyx_d) { __Pyx_AddTraceback("init pygame_sdl2.display", 0, __pyx_lineno, __pyx_filename); } Py_DECREF(__pyx_m); __pyx_m = 0; } else if (!PyErr_Occurred()) { PyErr_SetString(PyExc_ImportError, "init pygame_sdl2.display"); } __pyx_L0:; __Pyx_RefNannyFinishContext(); #if CYTHON_PEP489_MULTI_PHASE_INIT return (__pyx_m != NULL) ? 0 : -1; #elif PY_MAJOR_VERSION >= 3 return __pyx_m; #else return; #endif } /* --- Runtime support code --- */ /* Refnanny */ #if CYTHON_REFNANNY static __Pyx_RefNannyAPIStruct *__Pyx_RefNannyImportAPI(const char *modname) { PyObject *m = NULL, *p = NULL; void *r = NULL; m = PyImport_ImportModule((char *)modname); if (!m) goto end; p = PyObject_GetAttrString(m, (char *)"RefNannyAPI"); if (!p) goto end; r = PyLong_AsVoidPtr(p); end: Py_XDECREF(p); Py_XDECREF(m); return (__Pyx_RefNannyAPIStruct *)r; } #endif /* GetBuiltinName */ static PyObject *__Pyx_GetBuiltinName(PyObject *name) { PyObject* result = __Pyx_PyObject_GetAttrStr(__pyx_b, name); if (unlikely(!result)) { PyErr_Format(PyExc_NameError, #if PY_MAJOR_VERSION >= 3 "name '%U' is not defined", name); #else "name '%.200s' is not defined", PyString_AS_STRING(name)); #endif } return result; } /* RaiseArgTupleInvalid */ static void __Pyx_RaiseArgtupleInvalid( const char* func_name, int exact, Py_ssize_t num_min, Py_ssize_t num_max, Py_ssize_t num_found) { Py_ssize_t num_expected; const char *more_or_less; if (num_found < num_min) { num_expected = num_min; more_or_less = "at least"; } else { num_expected = num_max; more_or_less = "at most"; } if (exact) { more_or_less = "exactly"; } PyErr_Format(PyExc_TypeError, "%.200s() takes %.8s %" CYTHON_FORMAT_SSIZE_T "d positional argument%.1s (%" CYTHON_FORMAT_SSIZE_T "d given)", func_name, more_or_less, num_expected, (num_expected == 1) ? "" : "s", num_found); } /* RaiseDoubleKeywords */ static void __Pyx_RaiseDoubleKeywordsError( const char* func_name, PyObject* kw_name) { PyErr_Format(PyExc_TypeError, #if PY_MAJOR_VERSION >= 3 "%s() got multiple values for keyword argument '%U'", func_name, kw_name); #else "%s() got multiple values for keyword argument '%s'", func_name, PyString_AsString(kw_name)); #endif } /* ParseKeywords */ static int __Pyx_ParseOptionalKeywords( PyObject *kwds, PyObject **argnames[], PyObject *kwds2, PyObject *values[], Py_ssize_t num_pos_args, const char* function_name) { PyObject *key = 0, *value = 0; Py_ssize_t pos = 0; PyObject*** name; PyObject*** first_kw_arg = argnames + num_pos_args; while (PyDict_Next(kwds, &pos, &key, &value)) { name = first_kw_arg; while (*name && (**name != key)) name++; if (*name) { values[name-argnames] = value; continue; } name = first_kw_arg; #if PY_MAJOR_VERSION < 3 if (likely(PyString_CheckExact(key)) || likely(PyString_Check(key))) { while (*name) { if ((CYTHON_COMPILING_IN_PYPY || PyString_GET_SIZE(**name) == PyString_GET_SIZE(key)) && _PyString_Eq(**name, key)) { values[name-argnames] = value; break; } name++; } if (*name) continue; else { PyObject*** argname = argnames; while (argname != first_kw_arg) { if ((**argname == key) || ( (CYTHON_COMPILING_IN_PYPY || PyString_GET_SIZE(**argname) == PyString_GET_SIZE(key)) && _PyString_Eq(**argname, key))) { goto arg_passed_twice; } argname++; } } } else #endif if (likely(PyUnicode_Check(key))) { while (*name) { int cmp = (**name == key) ? 0 : #if !CYTHON_COMPILING_IN_PYPY && PY_MAJOR_VERSION >= 3 (PyUnicode_GET_SIZE(**name) != PyUnicode_GET_SIZE(key)) ? 1 : #endif PyUnicode_Compare(**name, key); if (cmp < 0 && unlikely(PyErr_Occurred())) goto bad; if (cmp == 0) { values[name-argnames] = value; break; } name++; } if (*name) continue; else { PyObject*** argname = argnames; while (argname != first_kw_arg) { int cmp = (**argname == key) ? 0 : #if !CYTHON_COMPILING_IN_PYPY && PY_MAJOR_VERSION >= 3 (PyUnicode_GET_SIZE(**argname) != PyUnicode_GET_SIZE(key)) ? 1 : #endif PyUnicode_Compare(**argname, key); if (cmp < 0 && unlikely(PyErr_Occurred())) goto bad; if (cmp == 0) goto arg_passed_twice; argname++; } } } else goto invalid_keyword_type; if (kwds2) { if (unlikely(PyDict_SetItem(kwds2, key, value))) goto bad; } else { goto invalid_keyword; } } return 0; arg_passed_twice: __Pyx_RaiseDoubleKeywordsError(function_name, key); goto bad; invalid_keyword_type: PyErr_Format(PyExc_TypeError, "%.200s() keywords must be strings", function_name); goto bad; invalid_keyword: PyErr_Format(PyExc_TypeError, #if PY_MAJOR_VERSION < 3 "%.200s() got an unexpected keyword argument '%.200s'", function_name, PyString_AsString(key)); #else "%s() got an unexpected keyword argument '%U'", function_name, key); #endif bad: return -1; } /* PyObjectCall */ #if CYTHON_COMPILING_IN_CPYTHON static CYTHON_INLINE PyObject* __Pyx_PyObject_Call(PyObject *func, PyObject *arg, PyObject *kw) { PyObject *result; ternaryfunc call = func->ob_type->tp_call; if (unlikely(!call)) return PyObject_Call(func, arg, kw); if (unlikely(Py_EnterRecursiveCall((char*)" while calling a Python object"))) return NULL; result = (*call)(func, arg, kw); Py_LeaveRecursiveCall(); if (unlikely(!result) && unlikely(!PyErr_Occurred())) { PyErr_SetString( PyExc_SystemError, "NULL result without error in PyObject_Call"); } return result; } #endif /* GetModuleGlobalName */ static CYTHON_INLINE PyObject *__Pyx_GetModuleGlobalName(PyObject *name) { PyObject *result; #if !CYTHON_AVOID_BORROWED_REFS result = PyDict_GetItem(__pyx_d, name); if (likely(result)) { Py_INCREF(result); } else { #else result = PyObject_GetItem(__pyx_d, name); if (!result) { PyErr_Clear(); #endif result = __Pyx_GetBuiltinName(name); } return result; } /* PyCFunctionFastCall */ #if CYTHON_FAST_PYCCALL static CYTHON_INLINE PyObject * __Pyx_PyCFunction_FastCall(PyObject *func_obj, PyObject **args, Py_ssize_t nargs) { PyCFunctionObject *func = (PyCFunctionObject*)func_obj; PyCFunction meth = PyCFunction_GET_FUNCTION(func); PyObject *self = PyCFunction_GET_SELF(func); int flags = PyCFunction_GET_FLAGS(func); assert(PyCFunction_Check(func)); assert(METH_FASTCALL == (flags & ~(METH_CLASS | METH_STATIC | METH_COEXIST | METH_KEYWORDS))); assert(nargs >= 0); assert(nargs == 0 || args != NULL); /* _PyCFunction_FastCallDict() must not be called with an exception set, because it may clear it (directly or indirectly) and so the caller loses its exception */ assert(!PyErr_Occurred()); if ((PY_VERSION_HEX < 0x030700A0) || unlikely(flags & METH_KEYWORDS)) { return (*((__Pyx_PyCFunctionFastWithKeywords)meth)) (self, args, nargs, NULL); } else { return (*((__Pyx_PyCFunctionFast)meth)) (self, args, nargs); } } #endif /* PyFunctionFastCall */ #if CYTHON_FAST_PYCALL #include "frameobject.h" static PyObject* __Pyx_PyFunction_FastCallNoKw(PyCodeObject *co, PyObject **args, Py_ssize_t na, PyObject *globals) { PyFrameObject *f; PyThreadState *tstate = __Pyx_PyThreadState_Current; PyObject **fastlocals; Py_ssize_t i; PyObject *result; assert(globals != NULL); /* XXX Perhaps we should create a specialized PyFrame_New() that doesn't take locals, but does take builtins without sanity checking them. */ assert(tstate != NULL); f = PyFrame_New(tstate, co, globals, NULL); if (f == NULL) { return NULL; } fastlocals = f->f_localsplus; for (i = 0; i < na; i++) { Py_INCREF(*args); fastlocals[i] = *args++; } result = PyEval_EvalFrameEx(f,0); ++tstate->recursion_depth; Py_DECREF(f); --tstate->recursion_depth; return result; } #if 1 || PY_VERSION_HEX < 0x030600B1 static PyObject *__Pyx_PyFunction_FastCallDict(PyObject *func, PyObject **args, int nargs, PyObject *kwargs) { PyCodeObject *co = (PyCodeObject *)PyFunction_GET_CODE(func); PyObject *globals = PyFunction_GET_GLOBALS(func); PyObject *argdefs = PyFunction_GET_DEFAULTS(func); PyObject *closure; #if PY_MAJOR_VERSION >= 3 PyObject *kwdefs; #endif PyObject *kwtuple, **k; PyObject **d; Py_ssize_t nd; Py_ssize_t nk; PyObject *result; assert(kwargs == NULL || PyDict_Check(kwargs)); nk = kwargs ? PyDict_Size(kwargs) : 0; if (Py_EnterRecursiveCall((char*)" while calling a Python object")) { return NULL; } if ( #if PY_MAJOR_VERSION >= 3 co->co_kwonlyargcount == 0 && #endif likely(kwargs == NULL || nk == 0) && co->co_flags == (CO_OPTIMIZED | CO_NEWLOCALS | CO_NOFREE)) { if (argdefs == NULL && co->co_argcount == nargs) { result = __Pyx_PyFunction_FastCallNoKw(co, args, nargs, globals); goto done; } else if (nargs == 0 && argdefs != NULL && co->co_argcount == Py_SIZE(argdefs)) { /* function called with no arguments, but all parameters have a default value: use default values as arguments .*/ args = &PyTuple_GET_ITEM(argdefs, 0); result =__Pyx_PyFunction_FastCallNoKw(co, args, Py_SIZE(argdefs), globals); goto done; } } if (kwargs != NULL) { Py_ssize_t pos, i; kwtuple = PyTuple_New(2 * nk); if (kwtuple == NULL) { result = NULL; goto done; } k = &PyTuple_GET_ITEM(kwtuple, 0); pos = i = 0; while (PyDict_Next(kwargs, &pos, &k[i], &k[i+1])) { Py_INCREF(k[i]); Py_INCREF(k[i+1]); i += 2; } nk = i / 2; } else { kwtuple = NULL; k = NULL; } closure = PyFunction_GET_CLOSURE(func); #if PY_MAJOR_VERSION >= 3 kwdefs = PyFunction_GET_KW_DEFAULTS(func); #endif if (argdefs != NULL) { d = &PyTuple_GET_ITEM(argdefs, 0); nd = Py_SIZE(argdefs); } else { d = NULL; nd = 0; } #if PY_MAJOR_VERSION >= 3 result = PyEval_EvalCodeEx((PyObject*)co, globals, (PyObject *)NULL, args, nargs, k, (int)nk, d, (int)nd, kwdefs, closure); #else result = PyEval_EvalCodeEx(co, globals, (PyObject *)NULL, args, nargs, k, (int)nk, d, (int)nd, closure); #endif Py_XDECREF(kwtuple); done: Py_LeaveRecursiveCall(); return result; } #endif #endif /* PyObjectCallMethO */ #if CYTHON_COMPILING_IN_CPYTHON static CYTHON_INLINE PyObject* __Pyx_PyObject_CallMethO(PyObject *func, PyObject *arg) { PyObject *self, *result; PyCFunction cfunc; cfunc = PyCFunction_GET_FUNCTION(func); self = PyCFunction_GET_SELF(func); if (unlikely(Py_EnterRecursiveCall((char*)" while calling a Python object"))) return NULL; result = cfunc(self, arg); Py_LeaveRecursiveCall(); if (unlikely(!result) && unlikely(!PyErr_Occurred())) { PyErr_SetString( PyExc_SystemError, "NULL result without error in PyObject_Call"); } return result; } #endif /* PyObjectCallOneArg */ #if CYTHON_COMPILING_IN_CPYTHON static PyObject* __Pyx__PyObject_CallOneArg(PyObject *func, PyObject *arg) { PyObject *result; PyObject *args = PyTuple_New(1); if (unlikely(!args)) return NULL; Py_INCREF(arg); PyTuple_SET_ITEM(args, 0, arg); result = __Pyx_PyObject_Call(func, args, NULL); Py_DECREF(args); return result; } static CYTHON_INLINE PyObject* __Pyx_PyObject_CallOneArg(PyObject *func, PyObject *arg) { #if CYTHON_FAST_PYCALL if (PyFunction_Check(func)) { return __Pyx_PyFunction_FastCall(func, &arg, 1); } #endif if (likely(PyCFunction_Check(func))) { if (likely(PyCFunction_GET_FLAGS(func) & METH_O)) { return __Pyx_PyObject_CallMethO(func, arg); #if CYTHON_FAST_PYCCALL } else if (PyCFunction_GET_FLAGS(func) & METH_FASTCALL) { return __Pyx_PyCFunction_FastCall(func, &arg, 1); #endif } } return __Pyx__PyObject_CallOneArg(func, arg); } #else static CYTHON_INLINE PyObject* __Pyx_PyObject_CallOneArg(PyObject *func, PyObject *arg) { PyObject *result; PyObject *args = PyTuple_Pack(1, arg); if (unlikely(!args)) return NULL; result = __Pyx_PyObject_Call(func, args, NULL); Py_DECREF(args); return result; } #endif /* PyObjectCallNoArg */ #if CYTHON_COMPILING_IN_CPYTHON static CYTHON_INLINE PyObject* __Pyx_PyObject_CallNoArg(PyObject *func) { #if CYTHON_FAST_PYCALL if (PyFunction_Check(func)) { return __Pyx_PyFunction_FastCall(func, NULL, 0); } #endif #ifdef __Pyx_CyFunction_USED if (likely(PyCFunction_Check(func) || __Pyx_TypeCheck(func, __pyx_CyFunctionType))) { #else if (likely(PyCFunction_Check(func))) { #endif if (likely(PyCFunction_GET_FLAGS(func) & METH_NOARGS)) { return __Pyx_PyObject_CallMethO(func, NULL); } } return __Pyx_PyObject_Call(func, __pyx_empty_tuple, NULL); } #endif /* PyErrFetchRestore */ #if CYTHON_FAST_THREAD_STATE static CYTHON_INLINE void __Pyx_ErrRestoreInState(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb) { PyObject *tmp_type, *tmp_value, *tmp_tb; tmp_type = tstate->curexc_type; tmp_value = tstate->curexc_value; tmp_tb = tstate->curexc_traceback; tstate->curexc_type = type; tstate->curexc_value = value; tstate->curexc_traceback = tb; Py_XDECREF(tmp_type); Py_XDECREF(tmp_value); Py_XDECREF(tmp_tb); } static CYTHON_INLINE void __Pyx_ErrFetchInState(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb) { *type = tstate->curexc_type; *value = tstate->curexc_value; *tb = tstate->curexc_traceback; tstate->curexc_type = 0; tstate->curexc_value = 0; tstate->curexc_traceback = 0; } #endif /* RaiseException */ #if PY_MAJOR_VERSION < 3 static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, CYTHON_UNUSED PyObject *cause) { __Pyx_PyThreadState_declare Py_XINCREF(type); if (!value || value == Py_None) value = NULL; else Py_INCREF(value); if (!tb || tb == Py_None) tb = NULL; else { Py_INCREF(tb); if (!PyTraceBack_Check(tb)) { PyErr_SetString(PyExc_TypeError, "raise: arg 3 must be a traceback or None"); goto raise_error; } } if (PyType_Check(type)) { #if CYTHON_COMPILING_IN_PYPY if (!value) { Py_INCREF(Py_None); value = Py_None; } #endif PyErr_NormalizeException(&type, &value, &tb); } else { if (value) { PyErr_SetString(PyExc_TypeError, "instance exception may not have a separate value"); goto raise_error; } value = type; type = (PyObject*) Py_TYPE(type); Py_INCREF(type); if (!PyType_IsSubtype((PyTypeObject *)type, (PyTypeObject *)PyExc_BaseException)) { PyErr_SetString(PyExc_TypeError, "raise: exception class must be a subclass of BaseException"); goto raise_error; } } __Pyx_PyThreadState_assign __Pyx_ErrRestore(type, value, tb); return; raise_error: Py_XDECREF(value); Py_XDECREF(type); Py_XDECREF(tb); return; } #else static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, PyObject *cause) { PyObject* owned_instance = NULL; if (tb == Py_None) { tb = 0; } else if (tb && !PyTraceBack_Check(tb)) { PyErr_SetString(PyExc_TypeError, "raise: arg 3 must be a traceback or None"); goto bad; } if (value == Py_None) value = 0; if (PyExceptionInstance_Check(type)) { if (value) { PyErr_SetString(PyExc_TypeError, "instance exception may not have a separate value"); goto bad; } value = type; type = (PyObject*) Py_TYPE(value); } else if (PyExceptionClass_Check(type)) { PyObject *instance_class = NULL; if (value && PyExceptionInstance_Check(value)) { instance_class = (PyObject*) Py_TYPE(value); if (instance_class != type) { int is_subclass = PyObject_IsSubclass(instance_class, type); if (!is_subclass) { instance_class = NULL; } else if (unlikely(is_subclass == -1)) { goto bad; } else { type = instance_class; } } } if (!instance_class) { PyObject *args; if (!value) args = PyTuple_New(0); else if (PyTuple_Check(value)) { Py_INCREF(value); args = value; } else args = PyTuple_Pack(1, value); if (!args) goto bad; owned_instance = PyObject_Call(type, args, NULL); Py_DECREF(args); if (!owned_instance) goto bad; value = owned_instance; if (!PyExceptionInstance_Check(value)) { PyErr_Format(PyExc_TypeError, "calling %R should have returned an instance of " "BaseException, not %R", type, Py_TYPE(value)); goto bad; } } } else { PyErr_SetString(PyExc_TypeError, "raise: exception class must be a subclass of BaseException"); goto bad; } if (cause) { PyObject *fixed_cause; if (cause == Py_None) { fixed_cause = NULL; } else if (PyExceptionClass_Check(cause)) { fixed_cause = PyObject_CallObject(cause, NULL); if (fixed_cause == NULL) goto bad; } else if (PyExceptionInstance_Check(cause)) { fixed_cause = cause; Py_INCREF(fixed_cause); } else { PyErr_SetString(PyExc_TypeError, "exception causes must derive from " "BaseException"); goto bad; } PyException_SetCause(value, fixed_cause); } PyErr_SetObject(type, value); if (tb) { #if CYTHON_COMPILING_IN_PYPY PyObject *tmp_type, *tmp_value, *tmp_tb; PyErr_Fetch(&tmp_type, &tmp_value, &tmp_tb); Py_INCREF(tb); PyErr_Restore(tmp_type, tmp_value, tb); Py_XDECREF(tmp_tb); #else PyThreadState *tstate = __Pyx_PyThreadState_Current; PyObject* tmp_tb = tstate->curexc_traceback; if (tb != tmp_tb) { Py_INCREF(tb); tstate->curexc_traceback = tb; Py_XDECREF(tmp_tb); } #endif } bad: Py_XDECREF(owned_instance); return; } #endif /* Import */ static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list, int level) { PyObject *empty_list = 0; PyObject *module = 0; PyObject *global_dict = 0; PyObject *empty_dict = 0; PyObject *list; #if PY_MAJOR_VERSION < 3 PyObject *py_import; py_import = __Pyx_PyObject_GetAttrStr(__pyx_b, __pyx_n_s_import); if (!py_import) goto bad; #endif if (from_list) list = from_list; else { empty_list = PyList_New(0); if (!empty_list) goto bad; list = empty_list; } global_dict = PyModule_GetDict(__pyx_m); if (!global_dict) goto bad; empty_dict = PyDict_New(); if (!empty_dict) goto bad; { #if PY_MAJOR_VERSION >= 3 if (level == -1) { if (strchr(__Pyx_MODULE_NAME, '.')) { module = PyImport_ImportModuleLevelObject( name, global_dict, empty_dict, list, 1); if (!module) { if (!PyErr_ExceptionMatches(PyExc_ImportError)) goto bad; PyErr_Clear(); } } level = 0; } #endif if (!module) { #if PY_MAJOR_VERSION < 3 PyObject *py_level = PyInt_FromLong(level); if (!py_level) goto bad; module = PyObject_CallFunctionObjArgs(py_import, name, global_dict, empty_dict, list, py_level, NULL); Py_DECREF(py_level); #else module = PyImport_ImportModuleLevelObject( name, global_dict, empty_dict, list, level); #endif } } bad: #if PY_MAJOR_VERSION < 3 Py_XDECREF(py_import); #endif Py_XDECREF(empty_list); Py_XDECREF(empty_dict); return module; } /* SaveResetException */ #if CYTHON_FAST_THREAD_STATE static CYTHON_INLINE void __Pyx__ExceptionSave(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb) { #if PY_VERSION_HEX >= 0x030700A2 *type = tstate->exc_state.exc_type; *value = tstate->exc_state.exc_value; *tb = tstate->exc_state.exc_traceback; #else *type = tstate->exc_type; *value = tstate->exc_value; *tb = tstate->exc_traceback; #endif Py_XINCREF(*type); Py_XINCREF(*value); Py_XINCREF(*tb); } static CYTHON_INLINE void __Pyx__ExceptionReset(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb) { PyObject *tmp_type, *tmp_value, *tmp_tb; #if PY_VERSION_HEX >= 0x030700A2 tmp_type = tstate->exc_state.exc_type; tmp_value = tstate->exc_state.exc_value; tmp_tb = tstate->exc_state.exc_traceback; tstate->exc_state.exc_type = type; tstate->exc_state.exc_value = value; tstate->exc_state.exc_traceback = tb; #else tmp_type = tstate->exc_type; tmp_value = tstate->exc_value; tmp_tb = tstate->exc_traceback; tstate->exc_type = type; tstate->exc_value = value; tstate->exc_traceback = tb; #endif Py_XDECREF(tmp_type); Py_XDECREF(tmp_value); Py_XDECREF(tmp_tb); } #endif /* PyErrExceptionMatches */ #if CYTHON_FAST_THREAD_STATE static int __Pyx_PyErr_ExceptionMatchesTuple(PyObject *exc_type, PyObject *tuple) { Py_ssize_t i, n; n = PyTuple_GET_SIZE(tuple); #if PY_MAJOR_VERSION >= 3 for (i=0; icurexc_type; if (exc_type == err) return 1; if (unlikely(!exc_type)) return 0; if (unlikely(PyTuple_Check(err))) return __Pyx_PyErr_ExceptionMatchesTuple(exc_type, err); return __Pyx_PyErr_GivenExceptionMatches(exc_type, err); } #endif /* GetItemInt */ static PyObject *__Pyx_GetItemInt_Generic(PyObject *o, PyObject* j) { PyObject *r; if (!j) return NULL; r = PyObject_GetItem(o, j); Py_DECREF(j); return r; } static CYTHON_INLINE PyObject *__Pyx_GetItemInt_List_Fast(PyObject *o, Py_ssize_t i, CYTHON_NCP_UNUSED int wraparound, CYTHON_NCP_UNUSED int boundscheck) { #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS Py_ssize_t wrapped_i = i; if (wraparound & unlikely(i < 0)) { wrapped_i += PyList_GET_SIZE(o); } if ((!boundscheck) || likely((0 <= wrapped_i) & (wrapped_i < PyList_GET_SIZE(o)))) { PyObject *r = PyList_GET_ITEM(o, wrapped_i); Py_INCREF(r); return r; } return __Pyx_GetItemInt_Generic(o, PyInt_FromSsize_t(i)); #else return PySequence_GetItem(o, i); #endif } static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Tuple_Fast(PyObject *o, Py_ssize_t i, CYTHON_NCP_UNUSED int wraparound, CYTHON_NCP_UNUSED int boundscheck) { #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS Py_ssize_t wrapped_i = i; if (wraparound & unlikely(i < 0)) { wrapped_i += PyTuple_GET_SIZE(o); } if ((!boundscheck) || likely((0 <= wrapped_i) & (wrapped_i < PyTuple_GET_SIZE(o)))) { PyObject *r = PyTuple_GET_ITEM(o, wrapped_i); Py_INCREF(r); return r; } return __Pyx_GetItemInt_Generic(o, PyInt_FromSsize_t(i)); #else return PySequence_GetItem(o, i); #endif } static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Fast(PyObject *o, Py_ssize_t i, int is_list, CYTHON_NCP_UNUSED int wraparound, CYTHON_NCP_UNUSED int boundscheck) { #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS && CYTHON_USE_TYPE_SLOTS if (is_list || PyList_CheckExact(o)) { Py_ssize_t n = ((!wraparound) | likely(i >= 0)) ? i : i + PyList_GET_SIZE(o); if ((!boundscheck) || (likely((n >= 0) & (n < PyList_GET_SIZE(o))))) { PyObject *r = PyList_GET_ITEM(o, n); Py_INCREF(r); return r; } } else if (PyTuple_CheckExact(o)) { Py_ssize_t n = ((!wraparound) | likely(i >= 0)) ? i : i + PyTuple_GET_SIZE(o); if ((!boundscheck) || likely((n >= 0) & (n < PyTuple_GET_SIZE(o)))) { PyObject *r = PyTuple_GET_ITEM(o, n); Py_INCREF(r); return r; } } else { PySequenceMethods *m = Py_TYPE(o)->tp_as_sequence; if (likely(m && m->sq_item)) { if (wraparound && unlikely(i < 0) && likely(m->sq_length)) { Py_ssize_t l = m->sq_length(o); if (likely(l >= 0)) { i += l; } else { if (!PyErr_ExceptionMatches(PyExc_OverflowError)) return NULL; PyErr_Clear(); } } return m->sq_item(o, i); } } #else if (is_list || PySequence_Check(o)) { return PySequence_GetItem(o, i); } #endif return __Pyx_GetItemInt_Generic(o, PyInt_FromSsize_t(i)); } /* GetException */ #if CYTHON_FAST_THREAD_STATE static int __Pyx__GetException(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb) { #else static int __Pyx_GetException(PyObject **type, PyObject **value, PyObject **tb) { #endif PyObject *local_type, *local_value, *local_tb; #if CYTHON_FAST_THREAD_STATE PyObject *tmp_type, *tmp_value, *tmp_tb; local_type = tstate->curexc_type; local_value = tstate->curexc_value; local_tb = tstate->curexc_traceback; tstate->curexc_type = 0; tstate->curexc_value = 0; tstate->curexc_traceback = 0; #else PyErr_Fetch(&local_type, &local_value, &local_tb); #endif PyErr_NormalizeException(&local_type, &local_value, &local_tb); #if CYTHON_FAST_THREAD_STATE if (unlikely(tstate->curexc_type)) #else if (unlikely(PyErr_Occurred())) #endif goto bad; #if PY_MAJOR_VERSION >= 3 if (local_tb) { if (unlikely(PyException_SetTraceback(local_value, local_tb) < 0)) goto bad; } #endif Py_XINCREF(local_tb); Py_XINCREF(local_type); Py_XINCREF(local_value); *type = local_type; *value = local_value; *tb = local_tb; #if CYTHON_FAST_THREAD_STATE #if PY_VERSION_HEX >= 0x030700A2 tmp_type = tstate->exc_state.exc_type; tmp_value = tstate->exc_state.exc_value; tmp_tb = tstate->exc_state.exc_traceback; tstate->exc_state.exc_type = local_type; tstate->exc_state.exc_value = local_value; tstate->exc_state.exc_traceback = local_tb; #else tmp_type = tstate->exc_type; tmp_value = tstate->exc_value; tmp_tb = tstate->exc_traceback; tstate->exc_type = local_type; tstate->exc_value = local_value; tstate->exc_traceback = local_tb; #endif Py_XDECREF(tmp_type); Py_XDECREF(tmp_value); Py_XDECREF(tmp_tb); #else PyErr_SetExcInfo(local_type, local_value, local_tb); #endif return 0; bad: *type = 0; *value = 0; *tb = 0; Py_XDECREF(local_type); Py_XDECREF(local_value); Py_XDECREF(local_tb); return -1; } /* RaiseTooManyValuesToUnpack */ static CYTHON_INLINE void __Pyx_RaiseTooManyValuesError(Py_ssize_t expected) { PyErr_Format(PyExc_ValueError, "too many values to unpack (expected %" CYTHON_FORMAT_SSIZE_T "d)", expected); } /* RaiseNeedMoreValuesToUnpack */ static CYTHON_INLINE void __Pyx_RaiseNeedMoreValuesError(Py_ssize_t index) { PyErr_Format(PyExc_ValueError, "need more than %" CYTHON_FORMAT_SSIZE_T "d value%.1s to unpack", index, (index == 1) ? "" : "s"); } /* IterFinish */ static CYTHON_INLINE int __Pyx_IterFinish(void) { #if CYTHON_FAST_THREAD_STATE PyThreadState *tstate = __Pyx_PyThreadState_Current; PyObject* exc_type = tstate->curexc_type; if (unlikely(exc_type)) { if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) { PyObject *exc_value, *exc_tb; exc_value = tstate->curexc_value; exc_tb = tstate->curexc_traceback; tstate->curexc_type = 0; tstate->curexc_value = 0; tstate->curexc_traceback = 0; Py_DECREF(exc_type); Py_XDECREF(exc_value); Py_XDECREF(exc_tb); return 0; } else { return -1; } } return 0; #else if (unlikely(PyErr_Occurred())) { if (likely(PyErr_ExceptionMatches(PyExc_StopIteration))) { PyErr_Clear(); return 0; } else { return -1; } } return 0; #endif } /* UnpackItemEndCheck */ static int __Pyx_IternextUnpackEndCheck(PyObject *retval, Py_ssize_t expected) { if (unlikely(retval)) { Py_DECREF(retval); __Pyx_RaiseTooManyValuesError(expected); return -1; } else { return __Pyx_IterFinish(); } return 0; } /* SwapException */ #if CYTHON_FAST_THREAD_STATE static CYTHON_INLINE void __Pyx__ExceptionSwap(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb) { PyObject *tmp_type, *tmp_value, *tmp_tb; #if PY_VERSION_HEX >= 0x030700A2 tmp_type = tstate->exc_state.exc_type; tmp_value = tstate->exc_state.exc_value; tmp_tb = tstate->exc_state.exc_traceback; tstate->exc_state.exc_type = *type; tstate->exc_state.exc_value = *value; tstate->exc_state.exc_traceback = *tb; #else tmp_type = tstate->exc_type; tmp_value = tstate->exc_value; tmp_tb = tstate->exc_traceback; tstate->exc_type = *type; tstate->exc_value = *value; tstate->exc_traceback = *tb; #endif *type = tmp_type; *value = tmp_value; *tb = tmp_tb; } #else static CYTHON_INLINE void __Pyx_ExceptionSwap(PyObject **type, PyObject **value, PyObject **tb) { PyObject *tmp_type, *tmp_value, *tmp_tb; PyErr_GetExcInfo(&tmp_type, &tmp_value, &tmp_tb); PyErr_SetExcInfo(*type, *value, *tb); *type = tmp_type; *value = tmp_value; *tb = tmp_tb; } #endif /* ArgTypeTest */ static int __Pyx__ArgTypeTest(PyObject *obj, PyTypeObject *type, const char *name, int exact) { if (unlikely(!type)) { PyErr_SetString(PyExc_SystemError, "Missing type object"); return 0; } else if (exact) { #if PY_MAJOR_VERSION == 2 if ((type == &PyBaseString_Type) && likely(__Pyx_PyBaseString_CheckExact(obj))) return 1; #endif } else { if (likely(__Pyx_TypeCheck(obj, type))) return 1; } PyErr_Format(PyExc_TypeError, "Argument '%.200s' has incorrect type (expected %.200s, got %.200s)", name, type->tp_name, Py_TYPE(obj)->tp_name); return 0; } /* ExtTypeTest */ static CYTHON_INLINE int __Pyx_TypeTest(PyObject *obj, PyTypeObject *type) { if (unlikely(!type)) { PyErr_SetString(PyExc_SystemError, "Missing type object"); return 0; } if (likely(__Pyx_TypeCheck(obj, type))) return 1; PyErr_Format(PyExc_TypeError, "Cannot convert %.200s to %.200s", Py_TYPE(obj)->tp_name, type->tp_name); return 0; } /* SetupReduce */ static int __Pyx_setup_reduce_is_named(PyObject* meth, PyObject* name) { int ret; PyObject *name_attr; name_attr = __Pyx_PyObject_GetAttrStr(meth, __pyx_n_s_name); if (likely(name_attr)) { ret = PyObject_RichCompareBool(name_attr, name, Py_EQ); } else { ret = -1; } if (unlikely(ret < 0)) { PyErr_Clear(); ret = 0; } Py_XDECREF(name_attr); return ret; } static int __Pyx_setup_reduce(PyObject* type_obj) { int ret = 0; PyObject *object_reduce = NULL; PyObject *object_reduce_ex = NULL; PyObject *reduce = NULL; PyObject *reduce_ex = NULL; PyObject *reduce_cython = NULL; PyObject *setstate = NULL; PyObject *setstate_cython = NULL; #if CYTHON_USE_PYTYPE_LOOKUP if (_PyType_Lookup((PyTypeObject*)type_obj, __pyx_n_s_getstate)) goto GOOD; #else if (PyObject_HasAttr(type_obj, __pyx_n_s_getstate)) goto GOOD; #endif #if CYTHON_USE_PYTYPE_LOOKUP object_reduce_ex = _PyType_Lookup(&PyBaseObject_Type, __pyx_n_s_reduce_ex); if (!object_reduce_ex) goto BAD; #else object_reduce_ex = __Pyx_PyObject_GetAttrStr((PyObject*)&PyBaseObject_Type, __pyx_n_s_reduce_ex); if (!object_reduce_ex) goto BAD; #endif reduce_ex = __Pyx_PyObject_GetAttrStr(type_obj, __pyx_n_s_reduce_ex); if (unlikely(!reduce_ex)) goto BAD; if (reduce_ex == object_reduce_ex) { #if CYTHON_USE_PYTYPE_LOOKUP object_reduce = _PyType_Lookup(&PyBaseObject_Type, __pyx_n_s_reduce); if (!object_reduce) goto BAD; #else object_reduce = __Pyx_PyObject_GetAttrStr((PyObject*)&PyBaseObject_Type, __pyx_n_s_reduce); if (!object_reduce) goto BAD; #endif reduce = __Pyx_PyObject_GetAttrStr(type_obj, __pyx_n_s_reduce); if (unlikely(!reduce)) goto BAD; if (reduce == object_reduce || __Pyx_setup_reduce_is_named(reduce, __pyx_n_s_reduce_cython)) { reduce_cython = __Pyx_PyObject_GetAttrStr(type_obj, __pyx_n_s_reduce_cython); if (unlikely(!reduce_cython)) goto BAD; ret = PyDict_SetItem(((PyTypeObject*)type_obj)->tp_dict, __pyx_n_s_reduce, reduce_cython); if (unlikely(ret < 0)) goto BAD; ret = PyDict_DelItem(((PyTypeObject*)type_obj)->tp_dict, __pyx_n_s_reduce_cython); if (unlikely(ret < 0)) goto BAD; setstate = __Pyx_PyObject_GetAttrStr(type_obj, __pyx_n_s_setstate); if (!setstate) PyErr_Clear(); if (!setstate || __Pyx_setup_reduce_is_named(setstate, __pyx_n_s_setstate_cython)) { setstate_cython = __Pyx_PyObject_GetAttrStr(type_obj, __pyx_n_s_setstate_cython); if (unlikely(!setstate_cython)) goto BAD; ret = PyDict_SetItem(((PyTypeObject*)type_obj)->tp_dict, __pyx_n_s_setstate, setstate_cython); if (unlikely(ret < 0)) goto BAD; ret = PyDict_DelItem(((PyTypeObject*)type_obj)->tp_dict, __pyx_n_s_setstate_cython); if (unlikely(ret < 0)) goto BAD; } PyType_Modified((PyTypeObject*)type_obj); } } goto GOOD; BAD: if (!PyErr_Occurred()) PyErr_Format(PyExc_RuntimeError, "Unable to initialize pickling for %s", ((PyTypeObject*)type_obj)->tp_name); ret = -1; GOOD: #if !CYTHON_USE_PYTYPE_LOOKUP Py_XDECREF(object_reduce); Py_XDECREF(object_reduce_ex); #endif Py_XDECREF(reduce); Py_XDECREF(reduce_ex); Py_XDECREF(reduce_cython); Py_XDECREF(setstate); Py_XDECREF(setstate_cython); return ret; } /* GetVTable */ static void* __Pyx_GetVtable(PyObject *dict) { void* ptr; PyObject *ob = PyObject_GetItem(dict, __pyx_n_s_pyx_vtable); if (!ob) goto bad; #if PY_VERSION_HEX >= 0x02070000 ptr = PyCapsule_GetPointer(ob, 0); #else ptr = PyCObject_AsVoidPtr(ob); #endif if (!ptr && !PyErr_Occurred()) PyErr_SetString(PyExc_RuntimeError, "invalid vtable found for imported type"); Py_DECREF(ob); return ptr; bad: Py_XDECREF(ob); return NULL; } /* ImportFrom */ static PyObject* __Pyx_ImportFrom(PyObject* module, PyObject* name) { PyObject* value = __Pyx_PyObject_GetAttrStr(module, name); if (unlikely(!value) && PyErr_ExceptionMatches(PyExc_AttributeError)) { PyErr_Format(PyExc_ImportError, #if PY_MAJOR_VERSION < 3 "cannot import name %.230s", PyString_AS_STRING(name)); #else "cannot import name %S", name); #endif } return value; } /* CalculateMetaclass */ static PyObject *__Pyx_CalculateMetaclass(PyTypeObject *metaclass, PyObject *bases) { Py_ssize_t i, nbases = PyTuple_GET_SIZE(bases); for (i=0; i < nbases; i++) { PyTypeObject *tmptype; PyObject *tmp = PyTuple_GET_ITEM(bases, i); tmptype = Py_TYPE(tmp); #if PY_MAJOR_VERSION < 3 if (tmptype == &PyClass_Type) continue; #endif if (!metaclass) { metaclass = tmptype; continue; } if (PyType_IsSubtype(metaclass, tmptype)) continue; if (PyType_IsSubtype(tmptype, metaclass)) { metaclass = tmptype; continue; } PyErr_SetString(PyExc_TypeError, "metaclass conflict: " "the metaclass of a derived class " "must be a (non-strict) subclass " "of the metaclasses of all its bases"); return NULL; } if (!metaclass) { #if PY_MAJOR_VERSION < 3 metaclass = &PyClass_Type; #else metaclass = &PyType_Type; #endif } Py_INCREF((PyObject*) metaclass); return (PyObject*) metaclass; } /* FetchCommonType */ static PyTypeObject* __Pyx_FetchCommonType(PyTypeObject* type) { PyObject* fake_module; PyTypeObject* cached_type = NULL; fake_module = PyImport_AddModule((char*) "_cython_" CYTHON_ABI); if (!fake_module) return NULL; Py_INCREF(fake_module); cached_type = (PyTypeObject*) PyObject_GetAttrString(fake_module, type->tp_name); if (cached_type) { if (!PyType_Check((PyObject*)cached_type)) { PyErr_Format(PyExc_TypeError, "Shared Cython type %.200s is not a type object", type->tp_name); goto bad; } if (cached_type->tp_basicsize != type->tp_basicsize) { PyErr_Format(PyExc_TypeError, "Shared Cython type %.200s has the wrong size, try recompiling", type->tp_name); goto bad; } } else { if (!PyErr_ExceptionMatches(PyExc_AttributeError)) goto bad; PyErr_Clear(); if (PyType_Ready(type) < 0) goto bad; if (PyObject_SetAttrString(fake_module, type->tp_name, (PyObject*) type) < 0) goto bad; Py_INCREF(type); cached_type = type; } done: Py_DECREF(fake_module); return cached_type; bad: Py_XDECREF(cached_type); cached_type = NULL; goto done; } /* CythonFunction */ static PyObject * __Pyx_CyFunction_get_doc(__pyx_CyFunctionObject *op, CYTHON_UNUSED void *closure) { if (unlikely(op->func_doc == NULL)) { if (op->func.m_ml->ml_doc) { #if PY_MAJOR_VERSION >= 3 op->func_doc = PyUnicode_FromString(op->func.m_ml->ml_doc); #else op->func_doc = PyString_FromString(op->func.m_ml->ml_doc); #endif if (unlikely(op->func_doc == NULL)) return NULL; } else { Py_INCREF(Py_None); return Py_None; } } Py_INCREF(op->func_doc); return op->func_doc; } static int __Pyx_CyFunction_set_doc(__pyx_CyFunctionObject *op, PyObject *value) { PyObject *tmp = op->func_doc; if (value == NULL) { value = Py_None; } Py_INCREF(value); op->func_doc = value; Py_XDECREF(tmp); return 0; } static PyObject * __Pyx_CyFunction_get_name(__pyx_CyFunctionObject *op) { if (unlikely(op->func_name == NULL)) { #if PY_MAJOR_VERSION >= 3 op->func_name = PyUnicode_InternFromString(op->func.m_ml->ml_name); #else op->func_name = PyString_InternFromString(op->func.m_ml->ml_name); #endif if (unlikely(op->func_name == NULL)) return NULL; } Py_INCREF(op->func_name); return op->func_name; } static int __Pyx_CyFunction_set_name(__pyx_CyFunctionObject *op, PyObject *value) { PyObject *tmp; #if PY_MAJOR_VERSION >= 3 if (unlikely(value == NULL || !PyUnicode_Check(value))) { #else if (unlikely(value == NULL || !PyString_Check(value))) { #endif PyErr_SetString(PyExc_TypeError, "__name__ must be set to a string object"); return -1; } tmp = op->func_name; Py_INCREF(value); op->func_name = value; Py_XDECREF(tmp); return 0; } static PyObject * __Pyx_CyFunction_get_qualname(__pyx_CyFunctionObject *op) { Py_INCREF(op->func_qualname); return op->func_qualname; } static int __Pyx_CyFunction_set_qualname(__pyx_CyFunctionObject *op, PyObject *value) { PyObject *tmp; #if PY_MAJOR_VERSION >= 3 if (unlikely(value == NULL || !PyUnicode_Check(value))) { #else if (unlikely(value == NULL || !PyString_Check(value))) { #endif PyErr_SetString(PyExc_TypeError, "__qualname__ must be set to a string object"); return -1; } tmp = op->func_qualname; Py_INCREF(value); op->func_qualname = value; Py_XDECREF(tmp); return 0; } static PyObject * __Pyx_CyFunction_get_self(__pyx_CyFunctionObject *m, CYTHON_UNUSED void *closure) { PyObject *self; self = m->func_closure; if (self == NULL) self = Py_None; Py_INCREF(self); return self; } static PyObject * __Pyx_CyFunction_get_dict(__pyx_CyFunctionObject *op) { if (unlikely(op->func_dict == NULL)) { op->func_dict = PyDict_New(); if (unlikely(op->func_dict == NULL)) return NULL; } Py_INCREF(op->func_dict); return op->func_dict; } static int __Pyx_CyFunction_set_dict(__pyx_CyFunctionObject *op, PyObject *value) { PyObject *tmp; if (unlikely(value == NULL)) { PyErr_SetString(PyExc_TypeError, "function's dictionary may not be deleted"); return -1; } if (unlikely(!PyDict_Check(value))) { PyErr_SetString(PyExc_TypeError, "setting function's dictionary to a non-dict"); return -1; } tmp = op->func_dict; Py_INCREF(value); op->func_dict = value; Py_XDECREF(tmp); return 0; } static PyObject * __Pyx_CyFunction_get_globals(__pyx_CyFunctionObject *op) { Py_INCREF(op->func_globals); return op->func_globals; } static PyObject * __Pyx_CyFunction_get_closure(CYTHON_UNUSED __pyx_CyFunctionObject *op) { Py_INCREF(Py_None); return Py_None; } static PyObject * __Pyx_CyFunction_get_code(__pyx_CyFunctionObject *op) { PyObject* result = (op->func_code) ? op->func_code : Py_None; Py_INCREF(result); return result; } static int __Pyx_CyFunction_init_defaults(__pyx_CyFunctionObject *op) { int result = 0; PyObject *res = op->defaults_getter((PyObject *) op); if (unlikely(!res)) return -1; #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS op->defaults_tuple = PyTuple_GET_ITEM(res, 0); Py_INCREF(op->defaults_tuple); op->defaults_kwdict = PyTuple_GET_ITEM(res, 1); Py_INCREF(op->defaults_kwdict); #else op->defaults_tuple = PySequence_ITEM(res, 0); if (unlikely(!op->defaults_tuple)) result = -1; else { op->defaults_kwdict = PySequence_ITEM(res, 1); if (unlikely(!op->defaults_kwdict)) result = -1; } #endif Py_DECREF(res); return result; } static int __Pyx_CyFunction_set_defaults(__pyx_CyFunctionObject *op, PyObject* value) { PyObject* tmp; if (!value) { value = Py_None; } else if (value != Py_None && !PyTuple_Check(value)) { PyErr_SetString(PyExc_TypeError, "__defaults__ must be set to a tuple object"); return -1; } Py_INCREF(value); tmp = op->defaults_tuple; op->defaults_tuple = value; Py_XDECREF(tmp); return 0; } static PyObject * __Pyx_CyFunction_get_defaults(__pyx_CyFunctionObject *op) { PyObject* result = op->defaults_tuple; if (unlikely(!result)) { if (op->defaults_getter) { if (__Pyx_CyFunction_init_defaults(op) < 0) return NULL; result = op->defaults_tuple; } else { result = Py_None; } } Py_INCREF(result); return result; } static int __Pyx_CyFunction_set_kwdefaults(__pyx_CyFunctionObject *op, PyObject* value) { PyObject* tmp; if (!value) { value = Py_None; } else if (value != Py_None && !PyDict_Check(value)) { PyErr_SetString(PyExc_TypeError, "__kwdefaults__ must be set to a dict object"); return -1; } Py_INCREF(value); tmp = op->defaults_kwdict; op->defaults_kwdict = value; Py_XDECREF(tmp); return 0; } static PyObject * __Pyx_CyFunction_get_kwdefaults(__pyx_CyFunctionObject *op) { PyObject* result = op->defaults_kwdict; if (unlikely(!result)) { if (op->defaults_getter) { if (__Pyx_CyFunction_init_defaults(op) < 0) return NULL; result = op->defaults_kwdict; } else { result = Py_None; } } Py_INCREF(result); return result; } static int __Pyx_CyFunction_set_annotations(__pyx_CyFunctionObject *op, PyObject* value) { PyObject* tmp; if (!value || value == Py_None) { value = NULL; } else if (!PyDict_Check(value)) { PyErr_SetString(PyExc_TypeError, "__annotations__ must be set to a dict object"); return -1; } Py_XINCREF(value); tmp = op->func_annotations; op->func_annotations = value; Py_XDECREF(tmp); return 0; } static PyObject * __Pyx_CyFunction_get_annotations(__pyx_CyFunctionObject *op) { PyObject* result = op->func_annotations; if (unlikely(!result)) { result = PyDict_New(); if (unlikely(!result)) return NULL; op->func_annotations = result; } Py_INCREF(result); return result; } static PyGetSetDef __pyx_CyFunction_getsets[] = { {(char *) "func_doc", (getter)__Pyx_CyFunction_get_doc, (setter)__Pyx_CyFunction_set_doc, 0, 0}, {(char *) "__doc__", (getter)__Pyx_CyFunction_get_doc, (setter)__Pyx_CyFunction_set_doc, 0, 0}, {(char *) "func_name", (getter)__Pyx_CyFunction_get_name, (setter)__Pyx_CyFunction_set_name, 0, 0}, {(char *) "__name__", (getter)__Pyx_CyFunction_get_name, (setter)__Pyx_CyFunction_set_name, 0, 0}, {(char *) "__qualname__", (getter)__Pyx_CyFunction_get_qualname, (setter)__Pyx_CyFunction_set_qualname, 0, 0}, {(char *) "__self__", (getter)__Pyx_CyFunction_get_self, 0, 0, 0}, {(char *) "func_dict", (getter)__Pyx_CyFunction_get_dict, (setter)__Pyx_CyFunction_set_dict, 0, 0}, {(char *) "__dict__", (getter)__Pyx_CyFunction_get_dict, (setter)__Pyx_CyFunction_set_dict, 0, 0}, {(char *) "func_globals", (getter)__Pyx_CyFunction_get_globals, 0, 0, 0}, {(char *) "__globals__", (getter)__Pyx_CyFunction_get_globals, 0, 0, 0}, {(char *) "func_closure", (getter)__Pyx_CyFunction_get_closure, 0, 0, 0}, {(char *) "__closure__", (getter)__Pyx_CyFunction_get_closure, 0, 0, 0}, {(char *) "func_code", (getter)__Pyx_CyFunction_get_code, 0, 0, 0}, {(char *) "__code__", (getter)__Pyx_CyFunction_get_code, 0, 0, 0}, {(char *) "func_defaults", (getter)__Pyx_CyFunction_get_defaults, (setter)__Pyx_CyFunction_set_defaults, 0, 0}, {(char *) "__defaults__", (getter)__Pyx_CyFunction_get_defaults, (setter)__Pyx_CyFunction_set_defaults, 0, 0}, {(char *) "__kwdefaults__", (getter)__Pyx_CyFunction_get_kwdefaults, (setter)__Pyx_CyFunction_set_kwdefaults, 0, 0}, {(char *) "__annotations__", (getter)__Pyx_CyFunction_get_annotations, (setter)__Pyx_CyFunction_set_annotations, 0, 0}, {0, 0, 0, 0, 0} }; static PyMemberDef __pyx_CyFunction_members[] = { {(char *) "__module__", T_OBJECT, offsetof(PyCFunctionObject, m_module), PY_WRITE_RESTRICTED, 0}, {0, 0, 0, 0, 0} }; static PyObject * __Pyx_CyFunction_reduce(__pyx_CyFunctionObject *m, CYTHON_UNUSED PyObject *args) { #if PY_MAJOR_VERSION >= 3 return PyUnicode_FromString(m->func.m_ml->ml_name); #else return PyString_FromString(m->func.m_ml->ml_name); #endif } static PyMethodDef __pyx_CyFunction_methods[] = { {"__reduce__", (PyCFunction)__Pyx_CyFunction_reduce, METH_VARARGS, 0}, {0, 0, 0, 0} }; #if PY_VERSION_HEX < 0x030500A0 #define __Pyx_CyFunction_weakreflist(cyfunc) ((cyfunc)->func_weakreflist) #else #define __Pyx_CyFunction_weakreflist(cyfunc) ((cyfunc)->func.m_weakreflist) #endif static PyObject *__Pyx_CyFunction_New(PyTypeObject *type, PyMethodDef *ml, int flags, PyObject* qualname, PyObject *closure, PyObject *module, PyObject* globals, PyObject* code) { __pyx_CyFunctionObject *op = PyObject_GC_New(__pyx_CyFunctionObject, type); if (op == NULL) return NULL; op->flags = flags; __Pyx_CyFunction_weakreflist(op) = NULL; op->func.m_ml = ml; op->func.m_self = (PyObject *) op; Py_XINCREF(closure); op->func_closure = closure; Py_XINCREF(module); op->func.m_module = module; op->func_dict = NULL; op->func_name = NULL; Py_INCREF(qualname); op->func_qualname = qualname; op->func_doc = NULL; op->func_classobj = NULL; op->func_globals = globals; Py_INCREF(op->func_globals); Py_XINCREF(code); op->func_code = code; op->defaults_pyobjects = 0; op->defaults = NULL; op->defaults_tuple = NULL; op->defaults_kwdict = NULL; op->defaults_getter = NULL; op->func_annotations = NULL; PyObject_GC_Track(op); return (PyObject *) op; } static int __Pyx_CyFunction_clear(__pyx_CyFunctionObject *m) { Py_CLEAR(m->func_closure); Py_CLEAR(m->func.m_module); Py_CLEAR(m->func_dict); Py_CLEAR(m->func_name); Py_CLEAR(m->func_qualname); Py_CLEAR(m->func_doc); Py_CLEAR(m->func_globals); Py_CLEAR(m->func_code); Py_CLEAR(m->func_classobj); Py_CLEAR(m->defaults_tuple); Py_CLEAR(m->defaults_kwdict); Py_CLEAR(m->func_annotations); if (m->defaults) { PyObject **pydefaults = __Pyx_CyFunction_Defaults(PyObject *, m); int i; for (i = 0; i < m->defaults_pyobjects; i++) Py_XDECREF(pydefaults[i]); PyObject_Free(m->defaults); m->defaults = NULL; } return 0; } static void __Pyx__CyFunction_dealloc(__pyx_CyFunctionObject *m) { if (__Pyx_CyFunction_weakreflist(m) != NULL) PyObject_ClearWeakRefs((PyObject *) m); __Pyx_CyFunction_clear(m); PyObject_GC_Del(m); } static void __Pyx_CyFunction_dealloc(__pyx_CyFunctionObject *m) { PyObject_GC_UnTrack(m); __Pyx__CyFunction_dealloc(m); } static int __Pyx_CyFunction_traverse(__pyx_CyFunctionObject *m, visitproc visit, void *arg) { Py_VISIT(m->func_closure); Py_VISIT(m->func.m_module); Py_VISIT(m->func_dict); Py_VISIT(m->func_name); Py_VISIT(m->func_qualname); Py_VISIT(m->func_doc); Py_VISIT(m->func_globals); Py_VISIT(m->func_code); Py_VISIT(m->func_classobj); Py_VISIT(m->defaults_tuple); Py_VISIT(m->defaults_kwdict); if (m->defaults) { PyObject **pydefaults = __Pyx_CyFunction_Defaults(PyObject *, m); int i; for (i = 0; i < m->defaults_pyobjects; i++) Py_VISIT(pydefaults[i]); } return 0; } static PyObject *__Pyx_CyFunction_descr_get(PyObject *func, PyObject *obj, PyObject *type) { __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func; if (m->flags & __Pyx_CYFUNCTION_STATICMETHOD) { Py_INCREF(func); return func; } if (m->flags & __Pyx_CYFUNCTION_CLASSMETHOD) { if (type == NULL) type = (PyObject *)(Py_TYPE(obj)); return __Pyx_PyMethod_New(func, type, (PyObject *)(Py_TYPE(type))); } if (obj == Py_None) obj = NULL; return __Pyx_PyMethod_New(func, obj, type); } static PyObject* __Pyx_CyFunction_repr(__pyx_CyFunctionObject *op) { #if PY_MAJOR_VERSION >= 3 return PyUnicode_FromFormat("", op->func_qualname, (void *)op); #else return PyString_FromFormat("", PyString_AsString(op->func_qualname), (void *)op); #endif } static PyObject * __Pyx_CyFunction_CallMethod(PyObject *func, PyObject *self, PyObject *arg, PyObject *kw) { PyCFunctionObject* f = (PyCFunctionObject*)func; PyCFunction meth = f->m_ml->ml_meth; Py_ssize_t size; switch (f->m_ml->ml_flags & (METH_VARARGS | METH_KEYWORDS | METH_NOARGS | METH_O)) { case METH_VARARGS: if (likely(kw == NULL || PyDict_Size(kw) == 0)) return (*meth)(self, arg); break; case METH_VARARGS | METH_KEYWORDS: return (*(PyCFunctionWithKeywords)meth)(self, arg, kw); case METH_NOARGS: if (likely(kw == NULL || PyDict_Size(kw) == 0)) { size = PyTuple_GET_SIZE(arg); if (likely(size == 0)) return (*meth)(self, NULL); PyErr_Format(PyExc_TypeError, "%.200s() takes no arguments (%" CYTHON_FORMAT_SSIZE_T "d given)", f->m_ml->ml_name, size); return NULL; } break; case METH_O: if (likely(kw == NULL || PyDict_Size(kw) == 0)) { size = PyTuple_GET_SIZE(arg); if (likely(size == 1)) { PyObject *result, *arg0; #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS arg0 = PyTuple_GET_ITEM(arg, 0); #else arg0 = PySequence_ITEM(arg, 0); if (unlikely(!arg0)) return NULL; #endif result = (*meth)(self, arg0); #if !(CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS) Py_DECREF(arg0); #endif return result; } PyErr_Format(PyExc_TypeError, "%.200s() takes exactly one argument (%" CYTHON_FORMAT_SSIZE_T "d given)", f->m_ml->ml_name, size); return NULL; } break; default: PyErr_SetString(PyExc_SystemError, "Bad call flags in " "__Pyx_CyFunction_Call. METH_OLDARGS is no " "longer supported!"); return NULL; } PyErr_Format(PyExc_TypeError, "%.200s() takes no keyword arguments", f->m_ml->ml_name); return NULL; } static CYTHON_INLINE PyObject *__Pyx_CyFunction_Call(PyObject *func, PyObject *arg, PyObject *kw) { return __Pyx_CyFunction_CallMethod(func, ((PyCFunctionObject*)func)->m_self, arg, kw); } static PyObject *__Pyx_CyFunction_CallAsMethod(PyObject *func, PyObject *args, PyObject *kw) { PyObject *result; __pyx_CyFunctionObject *cyfunc = (__pyx_CyFunctionObject *) func; if ((cyfunc->flags & __Pyx_CYFUNCTION_CCLASS) && !(cyfunc->flags & __Pyx_CYFUNCTION_STATICMETHOD)) { Py_ssize_t argc; PyObject *new_args; PyObject *self; argc = PyTuple_GET_SIZE(args); new_args = PyTuple_GetSlice(args, 1, argc); if (unlikely(!new_args)) return NULL; self = PyTuple_GetItem(args, 0); if (unlikely(!self)) { Py_DECREF(new_args); return NULL; } result = __Pyx_CyFunction_CallMethod(func, self, new_args, kw); Py_DECREF(new_args); } else { result = __Pyx_CyFunction_Call(func, args, kw); } return result; } static PyTypeObject __pyx_CyFunctionType_type = { PyVarObject_HEAD_INIT(0, 0) "cython_function_or_method", sizeof(__pyx_CyFunctionObject), 0, (destructor) __Pyx_CyFunction_dealloc, 0, 0, 0, #if PY_MAJOR_VERSION < 3 0, #else 0, #endif (reprfunc) __Pyx_CyFunction_repr, 0, 0, 0, 0, __Pyx_CyFunction_CallAsMethod, 0, 0, 0, 0, Py_TPFLAGS_DEFAULT | Py_TPFLAGS_HAVE_GC, 0, (traverseproc) __Pyx_CyFunction_traverse, (inquiry) __Pyx_CyFunction_clear, 0, #if PY_VERSION_HEX < 0x030500A0 offsetof(__pyx_CyFunctionObject, func_weakreflist), #else offsetof(PyCFunctionObject, m_weakreflist), #endif 0, 0, __pyx_CyFunction_methods, __pyx_CyFunction_members, __pyx_CyFunction_getsets, 0, 0, __Pyx_CyFunction_descr_get, 0, offsetof(__pyx_CyFunctionObject, func_dict), 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, #if PY_VERSION_HEX >= 0x030400a1 0, #endif }; static int __pyx_CyFunction_init(void) { __pyx_CyFunctionType = __Pyx_FetchCommonType(&__pyx_CyFunctionType_type); if (unlikely(__pyx_CyFunctionType == NULL)) { return -1; } return 0; } static CYTHON_INLINE void *__Pyx_CyFunction_InitDefaults(PyObject *func, size_t size, int pyobjects) { __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func; m->defaults = PyObject_Malloc(size); if (unlikely(!m->defaults)) return PyErr_NoMemory(); memset(m->defaults, 0, size); m->defaults_pyobjects = pyobjects; return m->defaults; } static CYTHON_INLINE void __Pyx_CyFunction_SetDefaultsTuple(PyObject *func, PyObject *tuple) { __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func; m->defaults_tuple = tuple; Py_INCREF(tuple); } static CYTHON_INLINE void __Pyx_CyFunction_SetDefaultsKwDict(PyObject *func, PyObject *dict) { __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func; m->defaults_kwdict = dict; Py_INCREF(dict); } static CYTHON_INLINE void __Pyx_CyFunction_SetAnnotationsDict(PyObject *func, PyObject *dict) { __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func; m->func_annotations = dict; Py_INCREF(dict); } /* Py3ClassCreate */ static PyObject *__Pyx_Py3MetaclassPrepare(PyObject *metaclass, PyObject *bases, PyObject *name, PyObject *qualname, PyObject *mkw, PyObject *modname, PyObject *doc) { PyObject *ns; if (metaclass) { PyObject *prep = __Pyx_PyObject_GetAttrStr(metaclass, __pyx_n_s_prepare); if (prep) { PyObject *pargs = PyTuple_Pack(2, name, bases); if (unlikely(!pargs)) { Py_DECREF(prep); return NULL; } ns = PyObject_Call(prep, pargs, mkw); Py_DECREF(prep); Py_DECREF(pargs); } else { if (unlikely(!PyErr_ExceptionMatches(PyExc_AttributeError))) return NULL; PyErr_Clear(); ns = PyDict_New(); } } else { ns = PyDict_New(); } if (unlikely(!ns)) return NULL; if (unlikely(PyObject_SetItem(ns, __pyx_n_s_module, modname) < 0)) goto bad; if (unlikely(PyObject_SetItem(ns, __pyx_n_s_qualname, qualname) < 0)) goto bad; if (unlikely(doc && PyObject_SetItem(ns, __pyx_n_s_doc, doc) < 0)) goto bad; return ns; bad: Py_DECREF(ns); return NULL; } static PyObject *__Pyx_Py3ClassCreate(PyObject *metaclass, PyObject *name, PyObject *bases, PyObject *dict, PyObject *mkw, int calculate_metaclass, int allow_py2_metaclass) { PyObject *result, *margs; PyObject *owned_metaclass = NULL; if (allow_py2_metaclass) { owned_metaclass = PyObject_GetItem(dict, __pyx_n_s_metaclass); if (owned_metaclass) { metaclass = owned_metaclass; } else if (likely(PyErr_ExceptionMatches(PyExc_KeyError))) { PyErr_Clear(); } else { return NULL; } } if (calculate_metaclass && (!metaclass || PyType_Check(metaclass))) { metaclass = __Pyx_CalculateMetaclass((PyTypeObject*) metaclass, bases); Py_XDECREF(owned_metaclass); if (unlikely(!metaclass)) return NULL; owned_metaclass = metaclass; } margs = PyTuple_Pack(3, name, bases, dict); if (unlikely(!margs)) { result = NULL; } else { result = PyObject_Call(metaclass, margs, mkw); Py_DECREF(margs); } Py_XDECREF(owned_metaclass); return result; } /* CLineInTraceback */ #ifndef CYTHON_CLINE_IN_TRACEBACK static int __Pyx_CLineForTraceback(CYTHON_UNUSED PyThreadState *tstate, int c_line) { PyObject *use_cline; PyObject *ptype, *pvalue, *ptraceback; #if CYTHON_COMPILING_IN_CPYTHON PyObject **cython_runtime_dict; #endif __Pyx_ErrFetchInState(tstate, &ptype, &pvalue, &ptraceback); #if CYTHON_COMPILING_IN_CPYTHON cython_runtime_dict = _PyObject_GetDictPtr(__pyx_cython_runtime); if (likely(cython_runtime_dict)) { use_cline = PyDict_GetItem(*cython_runtime_dict, __pyx_n_s_cline_in_traceback); } else #endif { PyObject *use_cline_obj = __Pyx_PyObject_GetAttrStr(__pyx_cython_runtime, __pyx_n_s_cline_in_traceback); if (use_cline_obj) { use_cline = PyObject_Not(use_cline_obj) ? Py_False : Py_True; Py_DECREF(use_cline_obj); } else { PyErr_Clear(); use_cline = NULL; } } if (!use_cline) { c_line = 0; PyObject_SetAttr(__pyx_cython_runtime, __pyx_n_s_cline_in_traceback, Py_False); } else if (PyObject_Not(use_cline) != 0) { c_line = 0; } __Pyx_ErrRestoreInState(tstate, ptype, pvalue, ptraceback); return c_line; } #endif /* CodeObjectCache */ static int __pyx_bisect_code_objects(__Pyx_CodeObjectCacheEntry* entries, int count, int code_line) { int start = 0, mid = 0, end = count - 1; if (end >= 0 && code_line > entries[end].code_line) { return count; } while (start < end) { mid = start + (end - start) / 2; if (code_line < entries[mid].code_line) { end = mid; } else if (code_line > entries[mid].code_line) { start = mid + 1; } else { return mid; } } if (code_line <= entries[mid].code_line) { return mid; } else { return mid + 1; } } static PyCodeObject *__pyx_find_code_object(int code_line) { PyCodeObject* code_object; int pos; if (unlikely(!code_line) || unlikely(!__pyx_code_cache.entries)) { return NULL; } pos = __pyx_bisect_code_objects(__pyx_code_cache.entries, __pyx_code_cache.count, code_line); if (unlikely(pos >= __pyx_code_cache.count) || unlikely(__pyx_code_cache.entries[pos].code_line != code_line)) { return NULL; } code_object = __pyx_code_cache.entries[pos].code_object; Py_INCREF(code_object); return code_object; } static void __pyx_insert_code_object(int code_line, PyCodeObject* code_object) { int pos, i; __Pyx_CodeObjectCacheEntry* entries = __pyx_code_cache.entries; if (unlikely(!code_line)) { return; } if (unlikely(!entries)) { entries = (__Pyx_CodeObjectCacheEntry*)PyMem_Malloc(64*sizeof(__Pyx_CodeObjectCacheEntry)); if (likely(entries)) { __pyx_code_cache.entries = entries; __pyx_code_cache.max_count = 64; __pyx_code_cache.count = 1; entries[0].code_line = code_line; entries[0].code_object = code_object; Py_INCREF(code_object); } return; } pos = __pyx_bisect_code_objects(__pyx_code_cache.entries, __pyx_code_cache.count, code_line); if ((pos < __pyx_code_cache.count) && unlikely(__pyx_code_cache.entries[pos].code_line == code_line)) { PyCodeObject* tmp = entries[pos].code_object; entries[pos].code_object = code_object; Py_DECREF(tmp); return; } if (__pyx_code_cache.count == __pyx_code_cache.max_count) { int new_max = __pyx_code_cache.max_count + 64; entries = (__Pyx_CodeObjectCacheEntry*)PyMem_Realloc( __pyx_code_cache.entries, (size_t)new_max*sizeof(__Pyx_CodeObjectCacheEntry)); if (unlikely(!entries)) { return; } __pyx_code_cache.entries = entries; __pyx_code_cache.max_count = new_max; } for (i=__pyx_code_cache.count; i>pos; i--) { entries[i] = entries[i-1]; } entries[pos].code_line = code_line; entries[pos].code_object = code_object; __pyx_code_cache.count++; Py_INCREF(code_object); } /* AddTraceback */ #include "compile.h" #include "frameobject.h" #include "traceback.h" static PyCodeObject* __Pyx_CreateCodeObjectForTraceback( const char *funcname, int c_line, int py_line, const char *filename) { PyCodeObject *py_code = 0; PyObject *py_srcfile = 0; PyObject *py_funcname = 0; #if PY_MAJOR_VERSION < 3 py_srcfile = PyString_FromString(filename); #else py_srcfile = PyUnicode_FromString(filename); #endif if (!py_srcfile) goto bad; if (c_line) { #if PY_MAJOR_VERSION < 3 py_funcname = PyString_FromFormat( "%s (%s:%d)", funcname, __pyx_cfilenm, c_line); #else py_funcname = PyUnicode_FromFormat( "%s (%s:%d)", funcname, __pyx_cfilenm, c_line); #endif } else { #if PY_MAJOR_VERSION < 3 py_funcname = PyString_FromString(funcname); #else py_funcname = PyUnicode_FromString(funcname); #endif } if (!py_funcname) goto bad; py_code = __Pyx_PyCode_New( 0, 0, 0, 0, 0, __pyx_empty_bytes, /*PyObject *code,*/ __pyx_empty_tuple, /*PyObject *consts,*/ __pyx_empty_tuple, /*PyObject *names,*/ __pyx_empty_tuple, /*PyObject *varnames,*/ __pyx_empty_tuple, /*PyObject *freevars,*/ __pyx_empty_tuple, /*PyObject *cellvars,*/ py_srcfile, /*PyObject *filename,*/ py_funcname, /*PyObject *name,*/ py_line, __pyx_empty_bytes /*PyObject *lnotab*/ ); Py_DECREF(py_srcfile); Py_DECREF(py_funcname); return py_code; bad: Py_XDECREF(py_srcfile); Py_XDECREF(py_funcname); return NULL; } static void __Pyx_AddTraceback(const char *funcname, int c_line, int py_line, const char *filename) { PyCodeObject *py_code = 0; PyFrameObject *py_frame = 0; PyThreadState *tstate = __Pyx_PyThreadState_Current; if (c_line) { c_line = __Pyx_CLineForTraceback(tstate, c_line); } py_code = __pyx_find_code_object(c_line ? -c_line : py_line); if (!py_code) { py_code = __Pyx_CreateCodeObjectForTraceback( funcname, c_line, py_line, filename); if (!py_code) goto bad; __pyx_insert_code_object(c_line ? -c_line : py_line, py_code); } py_frame = PyFrame_New( tstate, /*PyThreadState *tstate,*/ py_code, /*PyCodeObject *code,*/ __pyx_d, /*PyObject *globals,*/ 0 /*PyObject *locals*/ ); if (!py_frame) goto bad; __Pyx_PyFrame_SetLineNumber(py_frame, py_line); PyTraceBack_Here(py_frame); bad: Py_XDECREF(py_code); Py_XDECREF(py_frame); } /* CIntToPy */ static CYTHON_INLINE PyObject* __Pyx_PyInt_From_int(int value) { const int neg_one = (int) -1, const_zero = (int) 0; const int is_unsigned = neg_one > const_zero; if (is_unsigned) { if (sizeof(int) < sizeof(long)) { return PyInt_FromLong((long) value); } else if (sizeof(int) <= sizeof(unsigned long)) { return PyLong_FromUnsignedLong((unsigned long) value); #ifdef HAVE_LONG_LONG } else if (sizeof(int) <= sizeof(unsigned PY_LONG_LONG)) { return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value); #endif } } else { if (sizeof(int) <= sizeof(long)) { return PyInt_FromLong((long) value); #ifdef HAVE_LONG_LONG } else if (sizeof(int) <= sizeof(PY_LONG_LONG)) { return PyLong_FromLongLong((PY_LONG_LONG) value); #endif } } { int one = 1; int little = (int)*(unsigned char *)&one; unsigned char *bytes = (unsigned char *)&value; return _PyLong_FromByteArray(bytes, sizeof(int), little, !is_unsigned); } } /* CIntFromPyVerify */ #define __PYX_VERIFY_RETURN_INT(target_type, func_type, func_value)\ __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, 0) #define __PYX_VERIFY_RETURN_INT_EXC(target_type, func_type, func_value)\ __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, 1) #define __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, exc)\ {\ func_type value = func_value;\ if (sizeof(target_type) < sizeof(func_type)) {\ if (unlikely(value != (func_type) (target_type) value)) {\ func_type zero = 0;\ if (exc && unlikely(value == (func_type)-1 && PyErr_Occurred()))\ return (target_type) -1;\ if (is_unsigned && unlikely(value < zero))\ goto raise_neg_overflow;\ else\ goto raise_overflow;\ }\ }\ return (target_type) value;\ } /* CIntToPy */ static CYTHON_INLINE PyObject* __Pyx_PyInt_From_long(long value) { const long neg_one = (long) -1, const_zero = (long) 0; const int is_unsigned = neg_one > const_zero; if (is_unsigned) { if (sizeof(long) < sizeof(long)) { return PyInt_FromLong((long) value); } else if (sizeof(long) <= sizeof(unsigned long)) { return PyLong_FromUnsignedLong((unsigned long) value); #ifdef HAVE_LONG_LONG } else if (sizeof(long) <= sizeof(unsigned PY_LONG_LONG)) { return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value); #endif } } else { if (sizeof(long) <= sizeof(long)) { return PyInt_FromLong((long) value); #ifdef HAVE_LONG_LONG } else if (sizeof(long) <= sizeof(PY_LONG_LONG)) { return PyLong_FromLongLong((PY_LONG_LONG) value); #endif } } { int one = 1; int little = (int)*(unsigned char *)&one; unsigned char *bytes = (unsigned char *)&value; return _PyLong_FromByteArray(bytes, sizeof(long), little, !is_unsigned); } } /* CIntToPy */ static CYTHON_INLINE PyObject* __Pyx_PyInt_From_SDL_WindowFlags(SDL_WindowFlags value) { const SDL_WindowFlags neg_one = (SDL_WindowFlags) -1, const_zero = (SDL_WindowFlags) 0; const int is_unsigned = neg_one > const_zero; if (is_unsigned) { if (sizeof(SDL_WindowFlags) < sizeof(long)) { return PyInt_FromLong((long) value); } else if (sizeof(SDL_WindowFlags) <= sizeof(unsigned long)) { return PyLong_FromUnsignedLong((unsigned long) value); #ifdef HAVE_LONG_LONG } else if (sizeof(SDL_WindowFlags) <= sizeof(unsigned PY_LONG_LONG)) { return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value); #endif } } else { if (sizeof(SDL_WindowFlags) <= sizeof(long)) { return PyInt_FromLong((long) value); #ifdef HAVE_LONG_LONG } else if (sizeof(SDL_WindowFlags) <= sizeof(PY_LONG_LONG)) { return PyLong_FromLongLong((PY_LONG_LONG) value); #endif } } { int one = 1; int little = (int)*(unsigned char *)&one; unsigned char *bytes = (unsigned char *)&value; return _PyLong_FromByteArray(bytes, sizeof(SDL_WindowFlags), little, !is_unsigned); } } /* CIntToPy */ static CYTHON_INLINE PyObject* __Pyx_PyInt_From_uint32_t(uint32_t value) { const uint32_t neg_one = (uint32_t) -1, const_zero = (uint32_t) 0; const int is_unsigned = neg_one > const_zero; if (is_unsigned) { if (sizeof(uint32_t) < sizeof(long)) { return PyInt_FromLong((long) value); } else if (sizeof(uint32_t) <= sizeof(unsigned long)) { return PyLong_FromUnsignedLong((unsigned long) value); #ifdef HAVE_LONG_LONG } else if (sizeof(uint32_t) <= sizeof(unsigned PY_LONG_LONG)) { return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value); #endif } } else { if (sizeof(uint32_t) <= sizeof(long)) { return PyInt_FromLong((long) value); #ifdef HAVE_LONG_LONG } else if (sizeof(uint32_t) <= sizeof(PY_LONG_LONG)) { return PyLong_FromLongLong((PY_LONG_LONG) value); #endif } } { int one = 1; int little = (int)*(unsigned char *)&one; unsigned char *bytes = (unsigned char *)&value; return _PyLong_FromByteArray(bytes, sizeof(uint32_t), little, !is_unsigned); } } /* CIntToPy */ static CYTHON_INLINE PyObject* __Pyx_PyInt_From_uint8_t(uint8_t value) { const uint8_t neg_one = (uint8_t) -1, const_zero = (uint8_t) 0; const int is_unsigned = neg_one > const_zero; if (is_unsigned) { if (sizeof(uint8_t) < sizeof(long)) { return PyInt_FromLong((long) value); } else if (sizeof(uint8_t) <= sizeof(unsigned long)) { return PyLong_FromUnsignedLong((unsigned long) value); #ifdef HAVE_LONG_LONG } else if (sizeof(uint8_t) <= sizeof(unsigned PY_LONG_LONG)) { return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value); #endif } } else { if (sizeof(uint8_t) <= sizeof(long)) { return PyInt_FromLong((long) value); #ifdef HAVE_LONG_LONG } else if (sizeof(uint8_t) <= sizeof(PY_LONG_LONG)) { return PyLong_FromLongLong((PY_LONG_LONG) value); #endif } } { int one = 1; int little = (int)*(unsigned char *)&one; unsigned char *bytes = (unsigned char *)&value; return _PyLong_FromByteArray(bytes, sizeof(uint8_t), little, !is_unsigned); } } /* CIntFromPy */ static CYTHON_INLINE uint32_t __Pyx_PyInt_As_uint32_t(PyObject *x) { const uint32_t neg_one = (uint32_t) -1, const_zero = (uint32_t) 0; const int is_unsigned = neg_one > const_zero; #if PY_MAJOR_VERSION < 3 if (likely(PyInt_Check(x))) { if (sizeof(uint32_t) < sizeof(long)) { __PYX_VERIFY_RETURN_INT(uint32_t, long, PyInt_AS_LONG(x)) } else { long val = PyInt_AS_LONG(x); if (is_unsigned && unlikely(val < 0)) { goto raise_neg_overflow; } return (uint32_t) val; } } else #endif if (likely(PyLong_Check(x))) { if (is_unsigned) { #if CYTHON_USE_PYLONG_INTERNALS const digit* digits = ((PyLongObject*)x)->ob_digit; switch (Py_SIZE(x)) { case 0: return (uint32_t) 0; case 1: __PYX_VERIFY_RETURN_INT(uint32_t, digit, digits[0]) case 2: if (8 * sizeof(uint32_t) > 1 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(uint32_t, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(uint32_t) >= 2 * PyLong_SHIFT) { return (uint32_t) (((((uint32_t)digits[1]) << PyLong_SHIFT) | (uint32_t)digits[0])); } } break; case 3: if (8 * sizeof(uint32_t) > 2 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(uint32_t, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(uint32_t) >= 3 * PyLong_SHIFT) { return (uint32_t) (((((((uint32_t)digits[2]) << PyLong_SHIFT) | (uint32_t)digits[1]) << PyLong_SHIFT) | (uint32_t)digits[0])); } } break; case 4: if (8 * sizeof(uint32_t) > 3 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(uint32_t, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(uint32_t) >= 4 * PyLong_SHIFT) { return (uint32_t) (((((((((uint32_t)digits[3]) << PyLong_SHIFT) | (uint32_t)digits[2]) << PyLong_SHIFT) | (uint32_t)digits[1]) << PyLong_SHIFT) | (uint32_t)digits[0])); } } break; } #endif #if CYTHON_COMPILING_IN_CPYTHON if (unlikely(Py_SIZE(x) < 0)) { goto raise_neg_overflow; } #else { int result = PyObject_RichCompareBool(x, Py_False, Py_LT); if (unlikely(result < 0)) return (uint32_t) -1; if (unlikely(result == 1)) goto raise_neg_overflow; } #endif if (sizeof(uint32_t) <= sizeof(unsigned long)) { __PYX_VERIFY_RETURN_INT_EXC(uint32_t, unsigned long, PyLong_AsUnsignedLong(x)) #ifdef HAVE_LONG_LONG } else if (sizeof(uint32_t) <= sizeof(unsigned PY_LONG_LONG)) { __PYX_VERIFY_RETURN_INT_EXC(uint32_t, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x)) #endif } } else { #if CYTHON_USE_PYLONG_INTERNALS const digit* digits = ((PyLongObject*)x)->ob_digit; switch (Py_SIZE(x)) { case 0: return (uint32_t) 0; case -1: __PYX_VERIFY_RETURN_INT(uint32_t, sdigit, (sdigit) (-(sdigit)digits[0])) case 1: __PYX_VERIFY_RETURN_INT(uint32_t, digit, +digits[0]) case -2: if (8 * sizeof(uint32_t) - 1 > 1 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(uint32_t, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(uint32_t) - 1 > 2 * PyLong_SHIFT) { return (uint32_t) (((uint32_t)-1)*(((((uint32_t)digits[1]) << PyLong_SHIFT) | (uint32_t)digits[0]))); } } break; case 2: if (8 * sizeof(uint32_t) > 1 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(uint32_t, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(uint32_t) - 1 > 2 * PyLong_SHIFT) { return (uint32_t) ((((((uint32_t)digits[1]) << PyLong_SHIFT) | (uint32_t)digits[0]))); } } break; case -3: if (8 * sizeof(uint32_t) - 1 > 2 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(uint32_t, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(uint32_t) - 1 > 3 * PyLong_SHIFT) { return (uint32_t) (((uint32_t)-1)*(((((((uint32_t)digits[2]) << PyLong_SHIFT) | (uint32_t)digits[1]) << PyLong_SHIFT) | (uint32_t)digits[0]))); } } break; case 3: if (8 * sizeof(uint32_t) > 2 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(uint32_t, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(uint32_t) - 1 > 3 * PyLong_SHIFT) { return (uint32_t) ((((((((uint32_t)digits[2]) << PyLong_SHIFT) | (uint32_t)digits[1]) << PyLong_SHIFT) | (uint32_t)digits[0]))); } } break; case -4: if (8 * sizeof(uint32_t) - 1 > 3 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(uint32_t, long, -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(uint32_t) - 1 > 4 * PyLong_SHIFT) { return (uint32_t) (((uint32_t)-1)*(((((((((uint32_t)digits[3]) << PyLong_SHIFT) | (uint32_t)digits[2]) << PyLong_SHIFT) | (uint32_t)digits[1]) << PyLong_SHIFT) | (uint32_t)digits[0]))); } } break; case 4: if (8 * sizeof(uint32_t) > 3 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(uint32_t, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(uint32_t) - 1 > 4 * PyLong_SHIFT) { return (uint32_t) ((((((((((uint32_t)digits[3]) << PyLong_SHIFT) | (uint32_t)digits[2]) << PyLong_SHIFT) | (uint32_t)digits[1]) << PyLong_SHIFT) | (uint32_t)digits[0]))); } } break; } #endif if (sizeof(uint32_t) <= sizeof(long)) { __PYX_VERIFY_RETURN_INT_EXC(uint32_t, long, PyLong_AsLong(x)) #ifdef HAVE_LONG_LONG } else if (sizeof(uint32_t) <= sizeof(PY_LONG_LONG)) { __PYX_VERIFY_RETURN_INT_EXC(uint32_t, PY_LONG_LONG, PyLong_AsLongLong(x)) #endif } } { #if CYTHON_COMPILING_IN_PYPY && !defined(_PyLong_AsByteArray) PyErr_SetString(PyExc_RuntimeError, "_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers"); #else uint32_t val; PyObject *v = __Pyx_PyNumber_IntOrLong(x); #if PY_MAJOR_VERSION < 3 if (likely(v) && !PyLong_Check(v)) { PyObject *tmp = v; v = PyNumber_Long(tmp); Py_DECREF(tmp); } #endif if (likely(v)) { int one = 1; int is_little = (int)*(unsigned char *)&one; unsigned char *bytes = (unsigned char *)&val; int ret = _PyLong_AsByteArray((PyLongObject *)v, bytes, sizeof(val), is_little, !is_unsigned); Py_DECREF(v); if (likely(!ret)) return val; } #endif return (uint32_t) -1; } } else { uint32_t val; PyObject *tmp = __Pyx_PyNumber_IntOrLong(x); if (!tmp) return (uint32_t) -1; val = __Pyx_PyInt_As_uint32_t(tmp); Py_DECREF(tmp); return val; } raise_overflow: PyErr_SetString(PyExc_OverflowError, "value too large to convert to uint32_t"); return (uint32_t) -1; raise_neg_overflow: PyErr_SetString(PyExc_OverflowError, "can't convert negative value to uint32_t"); return (uint32_t) -1; } /* CIntFromPy */ static CYTHON_INLINE int __Pyx_PyInt_As_int(PyObject *x) { const int neg_one = (int) -1, const_zero = (int) 0; const int is_unsigned = neg_one > const_zero; #if PY_MAJOR_VERSION < 3 if (likely(PyInt_Check(x))) { if (sizeof(int) < sizeof(long)) { __PYX_VERIFY_RETURN_INT(int, long, PyInt_AS_LONG(x)) } else { long val = PyInt_AS_LONG(x); if (is_unsigned && unlikely(val < 0)) { goto raise_neg_overflow; } return (int) val; } } else #endif if (likely(PyLong_Check(x))) { if (is_unsigned) { #if CYTHON_USE_PYLONG_INTERNALS const digit* digits = ((PyLongObject*)x)->ob_digit; switch (Py_SIZE(x)) { case 0: return (int) 0; case 1: __PYX_VERIFY_RETURN_INT(int, digit, digits[0]) case 2: if (8 * sizeof(int) > 1 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(int) >= 2 * PyLong_SHIFT) { return (int) (((((int)digits[1]) << PyLong_SHIFT) | (int)digits[0])); } } break; case 3: if (8 * sizeof(int) > 2 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(int) >= 3 * PyLong_SHIFT) { return (int) (((((((int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0])); } } break; case 4: if (8 * sizeof(int) > 3 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(int) >= 4 * PyLong_SHIFT) { return (int) (((((((((int)digits[3]) << PyLong_SHIFT) | (int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0])); } } break; } #endif #if CYTHON_COMPILING_IN_CPYTHON if (unlikely(Py_SIZE(x) < 0)) { goto raise_neg_overflow; } #else { int result = PyObject_RichCompareBool(x, Py_False, Py_LT); if (unlikely(result < 0)) return (int) -1; if (unlikely(result == 1)) goto raise_neg_overflow; } #endif if (sizeof(int) <= sizeof(unsigned long)) { __PYX_VERIFY_RETURN_INT_EXC(int, unsigned long, PyLong_AsUnsignedLong(x)) #ifdef HAVE_LONG_LONG } else if (sizeof(int) <= sizeof(unsigned PY_LONG_LONG)) { __PYX_VERIFY_RETURN_INT_EXC(int, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x)) #endif } } else { #if CYTHON_USE_PYLONG_INTERNALS const digit* digits = ((PyLongObject*)x)->ob_digit; switch (Py_SIZE(x)) { case 0: return (int) 0; case -1: __PYX_VERIFY_RETURN_INT(int, sdigit, (sdigit) (-(sdigit)digits[0])) case 1: __PYX_VERIFY_RETURN_INT(int, digit, +digits[0]) case -2: if (8 * sizeof(int) - 1 > 1 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(int, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(int) - 1 > 2 * PyLong_SHIFT) { return (int) (((int)-1)*(((((int)digits[1]) << PyLong_SHIFT) | (int)digits[0]))); } } break; case 2: if (8 * sizeof(int) > 1 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(int) - 1 > 2 * PyLong_SHIFT) { return (int) ((((((int)digits[1]) << PyLong_SHIFT) | (int)digits[0]))); } } break; case -3: if (8 * sizeof(int) - 1 > 2 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(int, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(int) - 1 > 3 * PyLong_SHIFT) { return (int) (((int)-1)*(((((((int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0]))); } } break; case 3: if (8 * sizeof(int) > 2 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(int) - 1 > 3 * PyLong_SHIFT) { return (int) ((((((((int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0]))); } } break; case -4: if (8 * sizeof(int) - 1 > 3 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(int, long, -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(int) - 1 > 4 * PyLong_SHIFT) { return (int) (((int)-1)*(((((((((int)digits[3]) << PyLong_SHIFT) | (int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0]))); } } break; case 4: if (8 * sizeof(int) > 3 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(int) - 1 > 4 * PyLong_SHIFT) { return (int) ((((((((((int)digits[3]) << PyLong_SHIFT) | (int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0]))); } } break; } #endif if (sizeof(int) <= sizeof(long)) { __PYX_VERIFY_RETURN_INT_EXC(int, long, PyLong_AsLong(x)) #ifdef HAVE_LONG_LONG } else if (sizeof(int) <= sizeof(PY_LONG_LONG)) { __PYX_VERIFY_RETURN_INT_EXC(int, PY_LONG_LONG, PyLong_AsLongLong(x)) #endif } } { #if CYTHON_COMPILING_IN_PYPY && !defined(_PyLong_AsByteArray) PyErr_SetString(PyExc_RuntimeError, "_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers"); #else int val; PyObject *v = __Pyx_PyNumber_IntOrLong(x); #if PY_MAJOR_VERSION < 3 if (likely(v) && !PyLong_Check(v)) { PyObject *tmp = v; v = PyNumber_Long(tmp); Py_DECREF(tmp); } #endif if (likely(v)) { int one = 1; int is_little = (int)*(unsigned char *)&one; unsigned char *bytes = (unsigned char *)&val; int ret = _PyLong_AsByteArray((PyLongObject *)v, bytes, sizeof(val), is_little, !is_unsigned); Py_DECREF(v); if (likely(!ret)) return val; } #endif return (int) -1; } } else { int val; PyObject *tmp = __Pyx_PyNumber_IntOrLong(x); if (!tmp) return (int) -1; val = __Pyx_PyInt_As_int(tmp); Py_DECREF(tmp); return val; } raise_overflow: PyErr_SetString(PyExc_OverflowError, "value too large to convert to int"); return (int) -1; raise_neg_overflow: PyErr_SetString(PyExc_OverflowError, "can't convert negative value to int"); return (int) -1; } /* CIntFromPy */ static CYTHON_INLINE long __Pyx_PyInt_As_long(PyObject *x) { const long neg_one = (long) -1, const_zero = (long) 0; const int is_unsigned = neg_one > const_zero; #if PY_MAJOR_VERSION < 3 if (likely(PyInt_Check(x))) { if (sizeof(long) < sizeof(long)) { __PYX_VERIFY_RETURN_INT(long, long, PyInt_AS_LONG(x)) } else { long val = PyInt_AS_LONG(x); if (is_unsigned && unlikely(val < 0)) { goto raise_neg_overflow; } return (long) val; } } else #endif if (likely(PyLong_Check(x))) { if (is_unsigned) { #if CYTHON_USE_PYLONG_INTERNALS const digit* digits = ((PyLongObject*)x)->ob_digit; switch (Py_SIZE(x)) { case 0: return (long) 0; case 1: __PYX_VERIFY_RETURN_INT(long, digit, digits[0]) case 2: if (8 * sizeof(long) > 1 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(long) >= 2 * PyLong_SHIFT) { return (long) (((((long)digits[1]) << PyLong_SHIFT) | (long)digits[0])); } } break; case 3: if (8 * sizeof(long) > 2 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(long) >= 3 * PyLong_SHIFT) { return (long) (((((((long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0])); } } break; case 4: if (8 * sizeof(long) > 3 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(long) >= 4 * PyLong_SHIFT) { return (long) (((((((((long)digits[3]) << PyLong_SHIFT) | (long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0])); } } break; } #endif #if CYTHON_COMPILING_IN_CPYTHON if (unlikely(Py_SIZE(x) < 0)) { goto raise_neg_overflow; } #else { int result = PyObject_RichCompareBool(x, Py_False, Py_LT); if (unlikely(result < 0)) return (long) -1; if (unlikely(result == 1)) goto raise_neg_overflow; } #endif if (sizeof(long) <= sizeof(unsigned long)) { __PYX_VERIFY_RETURN_INT_EXC(long, unsigned long, PyLong_AsUnsignedLong(x)) #ifdef HAVE_LONG_LONG } else if (sizeof(long) <= sizeof(unsigned PY_LONG_LONG)) { __PYX_VERIFY_RETURN_INT_EXC(long, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x)) #endif } } else { #if CYTHON_USE_PYLONG_INTERNALS const digit* digits = ((PyLongObject*)x)->ob_digit; switch (Py_SIZE(x)) { case 0: return (long) 0; case -1: __PYX_VERIFY_RETURN_INT(long, sdigit, (sdigit) (-(sdigit)digits[0])) case 1: __PYX_VERIFY_RETURN_INT(long, digit, +digits[0]) case -2: if (8 * sizeof(long) - 1 > 1 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(long, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) { return (long) (((long)-1)*(((((long)digits[1]) << PyLong_SHIFT) | (long)digits[0]))); } } break; case 2: if (8 * sizeof(long) > 1 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) { return (long) ((((((long)digits[1]) << PyLong_SHIFT) | (long)digits[0]))); } } break; case -3: if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(long, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) { return (long) (((long)-1)*(((((((long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0]))); } } break; case 3: if (8 * sizeof(long) > 2 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) { return (long) ((((((((long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0]))); } } break; case -4: if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(long, long, -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(long) - 1 > 4 * PyLong_SHIFT) { return (long) (((long)-1)*(((((((((long)digits[3]) << PyLong_SHIFT) | (long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0]))); } } break; case 4: if (8 * sizeof(long) > 3 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(long) - 1 > 4 * PyLong_SHIFT) { return (long) ((((((((((long)digits[3]) << PyLong_SHIFT) | (long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0]))); } } break; } #endif if (sizeof(long) <= sizeof(long)) { __PYX_VERIFY_RETURN_INT_EXC(long, long, PyLong_AsLong(x)) #ifdef HAVE_LONG_LONG } else if (sizeof(long) <= sizeof(PY_LONG_LONG)) { __PYX_VERIFY_RETURN_INT_EXC(long, PY_LONG_LONG, PyLong_AsLongLong(x)) #endif } } { #if CYTHON_COMPILING_IN_PYPY && !defined(_PyLong_AsByteArray) PyErr_SetString(PyExc_RuntimeError, "_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers"); #else long val; PyObject *v = __Pyx_PyNumber_IntOrLong(x); #if PY_MAJOR_VERSION < 3 if (likely(v) && !PyLong_Check(v)) { PyObject *tmp = v; v = PyNumber_Long(tmp); Py_DECREF(tmp); } #endif if (likely(v)) { int one = 1; int is_little = (int)*(unsigned char *)&one; unsigned char *bytes = (unsigned char *)&val; int ret = _PyLong_AsByteArray((PyLongObject *)v, bytes, sizeof(val), is_little, !is_unsigned); Py_DECREF(v); if (likely(!ret)) return val; } #endif return (long) -1; } } else { long val; PyObject *tmp = __Pyx_PyNumber_IntOrLong(x); if (!tmp) return (long) -1; val = __Pyx_PyInt_As_long(tmp); Py_DECREF(tmp); return val; } raise_overflow: PyErr_SetString(PyExc_OverflowError, "value too large to convert to long"); return (long) -1; raise_neg_overflow: PyErr_SetString(PyExc_OverflowError, "can't convert negative value to long"); return (long) -1; } /* CIntFromPy */ static CYTHON_INLINE uint16_t __Pyx_PyInt_As_uint16_t(PyObject *x) { const uint16_t neg_one = (uint16_t) -1, const_zero = (uint16_t) 0; const int is_unsigned = neg_one > const_zero; #if PY_MAJOR_VERSION < 3 if (likely(PyInt_Check(x))) { if (sizeof(uint16_t) < sizeof(long)) { __PYX_VERIFY_RETURN_INT(uint16_t, long, PyInt_AS_LONG(x)) } else { long val = PyInt_AS_LONG(x); if (is_unsigned && unlikely(val < 0)) { goto raise_neg_overflow; } return (uint16_t) val; } } else #endif if (likely(PyLong_Check(x))) { if (is_unsigned) { #if CYTHON_USE_PYLONG_INTERNALS const digit* digits = ((PyLongObject*)x)->ob_digit; switch (Py_SIZE(x)) { case 0: return (uint16_t) 0; case 1: __PYX_VERIFY_RETURN_INT(uint16_t, digit, digits[0]) case 2: if (8 * sizeof(uint16_t) > 1 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(uint16_t, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(uint16_t) >= 2 * PyLong_SHIFT) { return (uint16_t) (((((uint16_t)digits[1]) << PyLong_SHIFT) | (uint16_t)digits[0])); } } break; case 3: if (8 * sizeof(uint16_t) > 2 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(uint16_t, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(uint16_t) >= 3 * PyLong_SHIFT) { return (uint16_t) (((((((uint16_t)digits[2]) << PyLong_SHIFT) | (uint16_t)digits[1]) << PyLong_SHIFT) | (uint16_t)digits[0])); } } break; case 4: if (8 * sizeof(uint16_t) > 3 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(uint16_t, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(uint16_t) >= 4 * PyLong_SHIFT) { return (uint16_t) (((((((((uint16_t)digits[3]) << PyLong_SHIFT) | (uint16_t)digits[2]) << PyLong_SHIFT) | (uint16_t)digits[1]) << PyLong_SHIFT) | (uint16_t)digits[0])); } } break; } #endif #if CYTHON_COMPILING_IN_CPYTHON if (unlikely(Py_SIZE(x) < 0)) { goto raise_neg_overflow; } #else { int result = PyObject_RichCompareBool(x, Py_False, Py_LT); if (unlikely(result < 0)) return (uint16_t) -1; if (unlikely(result == 1)) goto raise_neg_overflow; } #endif if (sizeof(uint16_t) <= sizeof(unsigned long)) { __PYX_VERIFY_RETURN_INT_EXC(uint16_t, unsigned long, PyLong_AsUnsignedLong(x)) #ifdef HAVE_LONG_LONG } else if (sizeof(uint16_t) <= sizeof(unsigned PY_LONG_LONG)) { __PYX_VERIFY_RETURN_INT_EXC(uint16_t, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x)) #endif } } else { #if CYTHON_USE_PYLONG_INTERNALS const digit* digits = ((PyLongObject*)x)->ob_digit; switch (Py_SIZE(x)) { case 0: return (uint16_t) 0; case -1: __PYX_VERIFY_RETURN_INT(uint16_t, sdigit, (sdigit) (-(sdigit)digits[0])) case 1: __PYX_VERIFY_RETURN_INT(uint16_t, digit, +digits[0]) case -2: if (8 * sizeof(uint16_t) - 1 > 1 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(uint16_t, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(uint16_t) - 1 > 2 * PyLong_SHIFT) { return (uint16_t) (((uint16_t)-1)*(((((uint16_t)digits[1]) << PyLong_SHIFT) | (uint16_t)digits[0]))); } } break; case 2: if (8 * sizeof(uint16_t) > 1 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(uint16_t, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(uint16_t) - 1 > 2 * PyLong_SHIFT) { return (uint16_t) ((((((uint16_t)digits[1]) << PyLong_SHIFT) | (uint16_t)digits[0]))); } } break; case -3: if (8 * sizeof(uint16_t) - 1 > 2 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(uint16_t, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(uint16_t) - 1 > 3 * PyLong_SHIFT) { return (uint16_t) (((uint16_t)-1)*(((((((uint16_t)digits[2]) << PyLong_SHIFT) | (uint16_t)digits[1]) << PyLong_SHIFT) | (uint16_t)digits[0]))); } } break; case 3: if (8 * sizeof(uint16_t) > 2 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(uint16_t, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(uint16_t) - 1 > 3 * PyLong_SHIFT) { return (uint16_t) ((((((((uint16_t)digits[2]) << PyLong_SHIFT) | (uint16_t)digits[1]) << PyLong_SHIFT) | (uint16_t)digits[0]))); } } break; case -4: if (8 * sizeof(uint16_t) - 1 > 3 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(uint16_t, long, -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(uint16_t) - 1 > 4 * PyLong_SHIFT) { return (uint16_t) (((uint16_t)-1)*(((((((((uint16_t)digits[3]) << PyLong_SHIFT) | (uint16_t)digits[2]) << PyLong_SHIFT) | (uint16_t)digits[1]) << PyLong_SHIFT) | (uint16_t)digits[0]))); } } break; case 4: if (8 * sizeof(uint16_t) > 3 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(uint16_t, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(uint16_t) - 1 > 4 * PyLong_SHIFT) { return (uint16_t) ((((((((((uint16_t)digits[3]) << PyLong_SHIFT) | (uint16_t)digits[2]) << PyLong_SHIFT) | (uint16_t)digits[1]) << PyLong_SHIFT) | (uint16_t)digits[0]))); } } break; } #endif if (sizeof(uint16_t) <= sizeof(long)) { __PYX_VERIFY_RETURN_INT_EXC(uint16_t, long, PyLong_AsLong(x)) #ifdef HAVE_LONG_LONG } else if (sizeof(uint16_t) <= sizeof(PY_LONG_LONG)) { __PYX_VERIFY_RETURN_INT_EXC(uint16_t, PY_LONG_LONG, PyLong_AsLongLong(x)) #endif } } { #if CYTHON_COMPILING_IN_PYPY && !defined(_PyLong_AsByteArray) PyErr_SetString(PyExc_RuntimeError, "_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers"); #else uint16_t val; PyObject *v = __Pyx_PyNumber_IntOrLong(x); #if PY_MAJOR_VERSION < 3 if (likely(v) && !PyLong_Check(v)) { PyObject *tmp = v; v = PyNumber_Long(tmp); Py_DECREF(tmp); } #endif if (likely(v)) { int one = 1; int is_little = (int)*(unsigned char *)&one; unsigned char *bytes = (unsigned char *)&val; int ret = _PyLong_AsByteArray((PyLongObject *)v, bytes, sizeof(val), is_little, !is_unsigned); Py_DECREF(v); if (likely(!ret)) return val; } #endif return (uint16_t) -1; } } else { uint16_t val; PyObject *tmp = __Pyx_PyNumber_IntOrLong(x); if (!tmp) return (uint16_t) -1; val = __Pyx_PyInt_As_uint16_t(tmp); Py_DECREF(tmp); return val; } raise_overflow: PyErr_SetString(PyExc_OverflowError, "value too large to convert to uint16_t"); return (uint16_t) -1; raise_neg_overflow: PyErr_SetString(PyExc_OverflowError, "can't convert negative value to uint16_t"); return (uint16_t) -1; } /* CIntFromPy */ static CYTHON_INLINE SDL_GLattr __Pyx_PyInt_As_SDL_GLattr(PyObject *x) { const SDL_GLattr neg_one = (SDL_GLattr) -1, const_zero = (SDL_GLattr) 0; const int is_unsigned = neg_one > const_zero; #if PY_MAJOR_VERSION < 3 if (likely(PyInt_Check(x))) { if (sizeof(SDL_GLattr) < sizeof(long)) { __PYX_VERIFY_RETURN_INT(SDL_GLattr, long, PyInt_AS_LONG(x)) } else { long val = PyInt_AS_LONG(x); if (is_unsigned && unlikely(val < 0)) { goto raise_neg_overflow; } return (SDL_GLattr) val; } } else #endif if (likely(PyLong_Check(x))) { if (is_unsigned) { #if CYTHON_USE_PYLONG_INTERNALS const digit* digits = ((PyLongObject*)x)->ob_digit; switch (Py_SIZE(x)) { case 0: return (SDL_GLattr) 0; case 1: __PYX_VERIFY_RETURN_INT(SDL_GLattr, digit, digits[0]) case 2: if (8 * sizeof(SDL_GLattr) > 1 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(SDL_GLattr, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(SDL_GLattr) >= 2 * PyLong_SHIFT) { return (SDL_GLattr) (((((SDL_GLattr)digits[1]) << PyLong_SHIFT) | (SDL_GLattr)digits[0])); } } break; case 3: if (8 * sizeof(SDL_GLattr) > 2 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(SDL_GLattr, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(SDL_GLattr) >= 3 * PyLong_SHIFT) { return (SDL_GLattr) (((((((SDL_GLattr)digits[2]) << PyLong_SHIFT) | (SDL_GLattr)digits[1]) << PyLong_SHIFT) | (SDL_GLattr)digits[0])); } } break; case 4: if (8 * sizeof(SDL_GLattr) > 3 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(SDL_GLattr, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(SDL_GLattr) >= 4 * PyLong_SHIFT) { return (SDL_GLattr) (((((((((SDL_GLattr)digits[3]) << PyLong_SHIFT) | (SDL_GLattr)digits[2]) << PyLong_SHIFT) | (SDL_GLattr)digits[1]) << PyLong_SHIFT) | (SDL_GLattr)digits[0])); } } break; } #endif #if CYTHON_COMPILING_IN_CPYTHON if (unlikely(Py_SIZE(x) < 0)) { goto raise_neg_overflow; } #else { int result = PyObject_RichCompareBool(x, Py_False, Py_LT); if (unlikely(result < 0)) return (SDL_GLattr) -1; if (unlikely(result == 1)) goto raise_neg_overflow; } #endif if (sizeof(SDL_GLattr) <= sizeof(unsigned long)) { __PYX_VERIFY_RETURN_INT_EXC(SDL_GLattr, unsigned long, PyLong_AsUnsignedLong(x)) #ifdef HAVE_LONG_LONG } else if (sizeof(SDL_GLattr) <= sizeof(unsigned PY_LONG_LONG)) { __PYX_VERIFY_RETURN_INT_EXC(SDL_GLattr, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x)) #endif } } else { #if CYTHON_USE_PYLONG_INTERNALS const digit* digits = ((PyLongObject*)x)->ob_digit; switch (Py_SIZE(x)) { case 0: return (SDL_GLattr) 0; case -1: __PYX_VERIFY_RETURN_INT(SDL_GLattr, sdigit, (sdigit) (-(sdigit)digits[0])) case 1: __PYX_VERIFY_RETURN_INT(SDL_GLattr, digit, +digits[0]) case -2: if (8 * sizeof(SDL_GLattr) - 1 > 1 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(SDL_GLattr, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(SDL_GLattr) - 1 > 2 * PyLong_SHIFT) { return (SDL_GLattr) (((SDL_GLattr)-1)*(((((SDL_GLattr)digits[1]) << PyLong_SHIFT) | (SDL_GLattr)digits[0]))); } } break; case 2: if (8 * sizeof(SDL_GLattr) > 1 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(SDL_GLattr, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(SDL_GLattr) - 1 > 2 * PyLong_SHIFT) { return (SDL_GLattr) ((((((SDL_GLattr)digits[1]) << PyLong_SHIFT) | (SDL_GLattr)digits[0]))); } } break; case -3: if (8 * sizeof(SDL_GLattr) - 1 > 2 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(SDL_GLattr, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(SDL_GLattr) - 1 > 3 * PyLong_SHIFT) { return (SDL_GLattr) (((SDL_GLattr)-1)*(((((((SDL_GLattr)digits[2]) << PyLong_SHIFT) | (SDL_GLattr)digits[1]) << PyLong_SHIFT) | (SDL_GLattr)digits[0]))); } } break; case 3: if (8 * sizeof(SDL_GLattr) > 2 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(SDL_GLattr, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(SDL_GLattr) - 1 > 3 * PyLong_SHIFT) { return (SDL_GLattr) ((((((((SDL_GLattr)digits[2]) << PyLong_SHIFT) | (SDL_GLattr)digits[1]) << PyLong_SHIFT) | (SDL_GLattr)digits[0]))); } } break; case -4: if (8 * sizeof(SDL_GLattr) - 1 > 3 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(SDL_GLattr, long, -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(SDL_GLattr) - 1 > 4 * PyLong_SHIFT) { return (SDL_GLattr) (((SDL_GLattr)-1)*(((((((((SDL_GLattr)digits[3]) << PyLong_SHIFT) | (SDL_GLattr)digits[2]) << PyLong_SHIFT) | (SDL_GLattr)digits[1]) << PyLong_SHIFT) | (SDL_GLattr)digits[0]))); } } break; case 4: if (8 * sizeof(SDL_GLattr) > 3 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(SDL_GLattr, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(SDL_GLattr) - 1 > 4 * PyLong_SHIFT) { return (SDL_GLattr) ((((((((((SDL_GLattr)digits[3]) << PyLong_SHIFT) | (SDL_GLattr)digits[2]) << PyLong_SHIFT) | (SDL_GLattr)digits[1]) << PyLong_SHIFT) | (SDL_GLattr)digits[0]))); } } break; } #endif if (sizeof(SDL_GLattr) <= sizeof(long)) { __PYX_VERIFY_RETURN_INT_EXC(SDL_GLattr, long, PyLong_AsLong(x)) #ifdef HAVE_LONG_LONG } else if (sizeof(SDL_GLattr) <= sizeof(PY_LONG_LONG)) { __PYX_VERIFY_RETURN_INT_EXC(SDL_GLattr, PY_LONG_LONG, PyLong_AsLongLong(x)) #endif } } { #if CYTHON_COMPILING_IN_PYPY && !defined(_PyLong_AsByteArray) PyErr_SetString(PyExc_RuntimeError, "_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers"); #else SDL_GLattr val; PyObject *v = __Pyx_PyNumber_IntOrLong(x); #if PY_MAJOR_VERSION < 3 if (likely(v) && !PyLong_Check(v)) { PyObject *tmp = v; v = PyNumber_Long(tmp); Py_DECREF(tmp); } #endif if (likely(v)) { int one = 1; int is_little = (int)*(unsigned char *)&one; unsigned char *bytes = (unsigned char *)&val; int ret = _PyLong_AsByteArray((PyLongObject *)v, bytes, sizeof(val), is_little, !is_unsigned); Py_DECREF(v); if (likely(!ret)) return val; } #endif return (SDL_GLattr) -1; } } else { SDL_GLattr val; PyObject *tmp = __Pyx_PyNumber_IntOrLong(x); if (!tmp) return (SDL_GLattr) -1; val = __Pyx_PyInt_As_SDL_GLattr(tmp); Py_DECREF(tmp); return val; } raise_overflow: PyErr_SetString(PyExc_OverflowError, "value too large to convert to SDL_GLattr"); return (SDL_GLattr) -1; raise_neg_overflow: PyErr_SetString(PyExc_OverflowError, "can't convert negative value to SDL_GLattr"); return (SDL_GLattr) -1; } /* FastTypeChecks */ #if CYTHON_COMPILING_IN_CPYTHON static int __Pyx_InBases(PyTypeObject *a, PyTypeObject *b) { while (a) { a = a->tp_base; if (a == b) return 1; } return b == &PyBaseObject_Type; } static CYTHON_INLINE int __Pyx_IsSubtype(PyTypeObject *a, PyTypeObject *b) { PyObject *mro; if (a == b) return 1; mro = a->tp_mro; if (likely(mro)) { Py_ssize_t i, n; n = PyTuple_GET_SIZE(mro); for (i = 0; i < n; i++) { if (PyTuple_GET_ITEM(mro, i) == (PyObject *)b) return 1; } return 0; } return __Pyx_InBases(a, b); } #if PY_MAJOR_VERSION == 2 static int __Pyx_inner_PyErr_GivenExceptionMatches2(PyObject *err, PyObject* exc_type1, PyObject* exc_type2) { PyObject *exception, *value, *tb; int res; __Pyx_PyThreadState_declare __Pyx_PyThreadState_assign __Pyx_ErrFetch(&exception, &value, &tb); res = exc_type1 ? PyObject_IsSubclass(err, exc_type1) : 0; if (unlikely(res == -1)) { PyErr_WriteUnraisable(err); res = 0; } if (!res) { res = PyObject_IsSubclass(err, exc_type2); if (unlikely(res == -1)) { PyErr_WriteUnraisable(err); res = 0; } } __Pyx_ErrRestore(exception, value, tb); return res; } #else static CYTHON_INLINE int __Pyx_inner_PyErr_GivenExceptionMatches2(PyObject *err, PyObject* exc_type1, PyObject *exc_type2) { int res = exc_type1 ? __Pyx_IsSubtype((PyTypeObject*)err, (PyTypeObject*)exc_type1) : 0; if (!res) { res = __Pyx_IsSubtype((PyTypeObject*)err, (PyTypeObject*)exc_type2); } return res; } #endif static CYTHON_INLINE int __Pyx_PyErr_GivenExceptionMatches(PyObject *err, PyObject* exc_type) { if (likely(err == exc_type)) return 1; if (likely(PyExceptionClass_Check(err))) { return __Pyx_inner_PyErr_GivenExceptionMatches2(err, NULL, exc_type); } return PyErr_GivenExceptionMatches(err, exc_type); } static CYTHON_INLINE int __Pyx_PyErr_GivenExceptionMatches2(PyObject *err, PyObject *exc_type1, PyObject *exc_type2) { if (likely(err == exc_type1 || err == exc_type2)) return 1; if (likely(PyExceptionClass_Check(err))) { return __Pyx_inner_PyErr_GivenExceptionMatches2(err, exc_type1, exc_type2); } return (PyErr_GivenExceptionMatches(err, exc_type1) || PyErr_GivenExceptionMatches(err, exc_type2)); } #endif /* CheckBinaryVersion */ static int __Pyx_check_binary_version(void) { char ctversion[4], rtversion[4]; PyOS_snprintf(ctversion, 4, "%d.%d", PY_MAJOR_VERSION, PY_MINOR_VERSION); PyOS_snprintf(rtversion, 4, "%s", Py_GetVersion()); if (ctversion[0] != rtversion[0] || ctversion[2] != rtversion[2]) { char message[200]; PyOS_snprintf(message, sizeof(message), "compiletime version %s of module '%.100s' " "does not match runtime version %s", ctversion, __Pyx_MODULE_NAME, rtversion); return PyErr_WarnEx(NULL, message, 1); } return 0; } /* VoidPtrExport */ static int __Pyx_ExportVoidPtr(PyObject *name, void *p, const char *sig) { PyObject *d; PyObject *cobj = 0; d = PyDict_GetItem(__pyx_d, __pyx_n_s_pyx_capi); Py_XINCREF(d); if (!d) { d = PyDict_New(); if (!d) goto bad; if (__Pyx_PyObject_SetAttrStr(__pyx_m, __pyx_n_s_pyx_capi, d) < 0) goto bad; } #if PY_VERSION_HEX >= 0x02070000 cobj = PyCapsule_New(p, sig, 0); #else cobj = PyCObject_FromVoidPtrAndDesc(p, (void *)sig, 0); #endif if (!cobj) goto bad; if (PyDict_SetItem(d, name, cobj) < 0) goto bad; Py_DECREF(cobj); Py_DECREF(d); return 0; bad: Py_XDECREF(cobj); Py_XDECREF(d); return -1; } /* FunctionExport */ static int __Pyx_ExportFunction(const char *name, void (*f)(void), const char *sig) { PyObject *d = 0; PyObject *cobj = 0; union { void (*fp)(void); void *p; } tmp; d = PyObject_GetAttrString(__pyx_m, (char *)"__pyx_capi__"); if (!d) { PyErr_Clear(); d = PyDict_New(); if (!d) goto bad; Py_INCREF(d); if (PyModule_AddObject(__pyx_m, (char *)"__pyx_capi__", d) < 0) goto bad; } tmp.fp = f; #if PY_VERSION_HEX >= 0x02070000 cobj = PyCapsule_New(tmp.p, sig, 0); #else cobj = PyCObject_FromVoidPtrAndDesc(tmp.p, (void *)sig, 0); #endif if (!cobj) goto bad; if (PyDict_SetItemString(d, name, cobj) < 0) goto bad; Py_DECREF(cobj); Py_DECREF(d); return 0; bad: Py_XDECREF(cobj); Py_XDECREF(d); return -1; } /* ModuleImport */ #ifndef __PYX_HAVE_RT_ImportModule #define __PYX_HAVE_RT_ImportModule static PyObject *__Pyx_ImportModule(const char *name) { PyObject *py_name = 0; PyObject *py_module = 0; py_name = __Pyx_PyIdentifier_FromString(name); if (!py_name) goto bad; py_module = PyImport_Import(py_name); Py_DECREF(py_name); return py_module; bad: Py_XDECREF(py_name); return 0; } #endif /* TypeImport */ #ifndef __PYX_HAVE_RT_ImportType #define __PYX_HAVE_RT_ImportType static PyTypeObject *__Pyx_ImportType(const char *module_name, const char *class_name, size_t size, int strict) { PyObject *py_module = 0; PyObject *result = 0; PyObject *py_name = 0; char warning[200]; Py_ssize_t basicsize; #ifdef Py_LIMITED_API PyObject *py_basicsize; #endif py_module = __Pyx_ImportModule(module_name); if (!py_module) goto bad; py_name = __Pyx_PyIdentifier_FromString(class_name); if (!py_name) goto bad; result = PyObject_GetAttr(py_module, py_name); Py_DECREF(py_name); py_name = 0; Py_DECREF(py_module); py_module = 0; if (!result) goto bad; if (!PyType_Check(result)) { PyErr_Format(PyExc_TypeError, "%.200s.%.200s is not a type object", module_name, class_name); goto bad; } #ifndef Py_LIMITED_API basicsize = ((PyTypeObject *)result)->tp_basicsize; #else py_basicsize = PyObject_GetAttrString(result, "__basicsize__"); if (!py_basicsize) goto bad; basicsize = PyLong_AsSsize_t(py_basicsize); Py_DECREF(py_basicsize); py_basicsize = 0; if (basicsize == (Py_ssize_t)-1 && PyErr_Occurred()) goto bad; #endif if (!strict && (size_t)basicsize > size) { PyOS_snprintf(warning, sizeof(warning), "%s.%s size changed, may indicate binary incompatibility. Expected %zd, got %zd", module_name, class_name, basicsize, size); if (PyErr_WarnEx(NULL, warning, 0) < 0) goto bad; } else if ((size_t)basicsize != size) { PyErr_Format(PyExc_ValueError, "%.200s.%.200s has the wrong size, try recompiling. Expected %zd, got %zd", module_name, class_name, basicsize, size); goto bad; } return (PyTypeObject *)result; bad: Py_XDECREF(py_module); Py_XDECREF(result); return NULL; } #endif /* FunctionImport */ #ifndef __PYX_HAVE_RT_ImportFunction #define __PYX_HAVE_RT_ImportFunction static int __Pyx_ImportFunction(PyObject *module, const char *funcname, void (**f)(void), const char *sig) { PyObject *d = 0; PyObject *cobj = 0; union { void (*fp)(void); void *p; } tmp; d = PyObject_GetAttrString(module, (char *)"__pyx_capi__"); if (!d) goto bad; cobj = PyDict_GetItemString(d, funcname); if (!cobj) { PyErr_Format(PyExc_ImportError, "%.200s does not export expected C function %.200s", PyModule_GetName(module), funcname); goto bad; } #if PY_VERSION_HEX >= 0x02070000 if (!PyCapsule_IsValid(cobj, sig)) { PyErr_Format(PyExc_TypeError, "C function %.200s.%.200s has wrong signature (expected %.500s, got %.500s)", PyModule_GetName(module), funcname, sig, PyCapsule_GetName(cobj)); goto bad; } tmp.p = PyCapsule_GetPointer(cobj, sig); #else {const char *desc, *s1, *s2; desc = (const char *)PyCObject_GetDesc(cobj); if (!desc) goto bad; s1 = desc; s2 = sig; while (*s1 != '\0' && *s1 == *s2) { s1++; s2++; } if (*s1 != *s2) { PyErr_Format(PyExc_TypeError, "C function %.200s.%.200s has wrong signature (expected %.500s, got %.500s)", PyModule_GetName(module), funcname, sig, desc); goto bad; } tmp.p = PyCObject_AsVoidPtr(cobj);} #endif *f = tmp.fp; if (!(*f)) goto bad; Py_DECREF(d); return 0; bad: Py_XDECREF(d); return -1; } #endif /* InitStrings */ static int __Pyx_InitStrings(__Pyx_StringTabEntry *t) { while (t->p) { #if PY_MAJOR_VERSION < 3 if (t->is_unicode) { *t->p = PyUnicode_DecodeUTF8(t->s, t->n - 1, NULL); } else if (t->intern) { *t->p = PyString_InternFromString(t->s); } else { *t->p = PyString_FromStringAndSize(t->s, t->n - 1); } #else if (t->is_unicode | t->is_str) { if (t->intern) { *t->p = PyUnicode_InternFromString(t->s); } else if (t->encoding) { *t->p = PyUnicode_Decode(t->s, t->n - 1, t->encoding, NULL); } else { *t->p = PyUnicode_FromStringAndSize(t->s, t->n - 1); } } else { *t->p = PyBytes_FromStringAndSize(t->s, t->n - 1); } #endif if (!*t->p) return -1; if (PyObject_Hash(*t->p) == -1) PyErr_Clear(); ++t; } return 0; } static CYTHON_INLINE PyObject* __Pyx_PyUnicode_FromString(const char* c_str) { return __Pyx_PyUnicode_FromStringAndSize(c_str, (Py_ssize_t)strlen(c_str)); } static CYTHON_INLINE const char* __Pyx_PyObject_AsString(PyObject* o) { Py_ssize_t ignore; return __Pyx_PyObject_AsStringAndSize(o, &ignore); } #if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT #if !CYTHON_PEP393_ENABLED static const char* __Pyx_PyUnicode_AsStringAndSize(PyObject* o, Py_ssize_t *length) { char* defenc_c; PyObject* defenc = _PyUnicode_AsDefaultEncodedString(o, NULL); if (!defenc) return NULL; defenc_c = PyBytes_AS_STRING(defenc); #if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII { char* end = defenc_c + PyBytes_GET_SIZE(defenc); char* c; for (c = defenc_c; c < end; c++) { if ((unsigned char) (*c) >= 128) { PyUnicode_AsASCIIString(o); return NULL; } } } #endif *length = PyBytes_GET_SIZE(defenc); return defenc_c; } #else static CYTHON_INLINE const char* __Pyx_PyUnicode_AsStringAndSize(PyObject* o, Py_ssize_t *length) { if (unlikely(__Pyx_PyUnicode_READY(o) == -1)) return NULL; #if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII if (likely(PyUnicode_IS_ASCII(o))) { *length = PyUnicode_GET_LENGTH(o); return PyUnicode_AsUTF8(o); } else { PyUnicode_AsASCIIString(o); return NULL; } #else return PyUnicode_AsUTF8AndSize(o, length); #endif } #endif #endif static CYTHON_INLINE const char* __Pyx_PyObject_AsStringAndSize(PyObject* o, Py_ssize_t *length) { #if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT if ( #if PY_MAJOR_VERSION < 3 && __PYX_DEFAULT_STRING_ENCODING_IS_ASCII __Pyx_sys_getdefaultencoding_not_ascii && #endif PyUnicode_Check(o)) { return __Pyx_PyUnicode_AsStringAndSize(o, length); } else #endif #if (!CYTHON_COMPILING_IN_PYPY) || (defined(PyByteArray_AS_STRING) && defined(PyByteArray_GET_SIZE)) if (PyByteArray_Check(o)) { *length = PyByteArray_GET_SIZE(o); return PyByteArray_AS_STRING(o); } else #endif { char* result; int r = PyBytes_AsStringAndSize(o, &result, length); if (unlikely(r < 0)) { return NULL; } else { return result; } } } static CYTHON_INLINE int __Pyx_PyObject_IsTrue(PyObject* x) { int is_true = x == Py_True; if (is_true | (x == Py_False) | (x == Py_None)) return is_true; else return PyObject_IsTrue(x); } static PyObject* __Pyx_PyNumber_IntOrLongWrongResultType(PyObject* result, const char* type_name) { #if PY_MAJOR_VERSION >= 3 if (PyLong_Check(result)) { if (PyErr_WarnFormat(PyExc_DeprecationWarning, 1, "__int__ returned non-int (type %.200s). " "The ability to return an instance of a strict subclass of int " "is deprecated, and may be removed in a future version of Python.", Py_TYPE(result)->tp_name)) { Py_DECREF(result); return NULL; } return result; } #endif PyErr_Format(PyExc_TypeError, "__%.4s__ returned non-%.4s (type %.200s)", type_name, type_name, Py_TYPE(result)->tp_name); Py_DECREF(result); return NULL; } static CYTHON_INLINE PyObject* __Pyx_PyNumber_IntOrLong(PyObject* x) { #if CYTHON_USE_TYPE_SLOTS PyNumberMethods *m; #endif const char *name = NULL; PyObject *res = NULL; #if PY_MAJOR_VERSION < 3 if (likely(PyInt_Check(x) || PyLong_Check(x))) #else if (likely(PyLong_Check(x))) #endif return __Pyx_NewRef(x); #if CYTHON_USE_TYPE_SLOTS m = Py_TYPE(x)->tp_as_number; #if PY_MAJOR_VERSION < 3 if (m && m->nb_int) { name = "int"; res = m->nb_int(x); } else if (m && m->nb_long) { name = "long"; res = m->nb_long(x); } #else if (likely(m && m->nb_int)) { name = "int"; res = m->nb_int(x); } #endif #else if (!PyBytes_CheckExact(x) && !PyUnicode_CheckExact(x)) { res = PyNumber_Int(x); } #endif if (likely(res)) { #if PY_MAJOR_VERSION < 3 if (unlikely(!PyInt_Check(res) && !PyLong_Check(res))) { #else if (unlikely(!PyLong_CheckExact(res))) { #endif return __Pyx_PyNumber_IntOrLongWrongResultType(res, name); } } else if (!PyErr_Occurred()) { PyErr_SetString(PyExc_TypeError, "an integer is required"); } return res; } static CYTHON_INLINE Py_ssize_t __Pyx_PyIndex_AsSsize_t(PyObject* b) { Py_ssize_t ival; PyObject *x; #if PY_MAJOR_VERSION < 3 if (likely(PyInt_CheckExact(b))) { if (sizeof(Py_ssize_t) >= sizeof(long)) return PyInt_AS_LONG(b); else return PyInt_AsSsize_t(x); } #endif if (likely(PyLong_CheckExact(b))) { #if CYTHON_USE_PYLONG_INTERNALS const digit* digits = ((PyLongObject*)b)->ob_digit; const Py_ssize_t size = Py_SIZE(b); if (likely(__Pyx_sst_abs(size) <= 1)) { ival = likely(size) ? digits[0] : 0; if (size == -1) ival = -ival; return ival; } else { switch (size) { case 2: if (8 * sizeof(Py_ssize_t) > 2 * PyLong_SHIFT) { return (Py_ssize_t) (((((size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])); } break; case -2: if (8 * sizeof(Py_ssize_t) > 2 * PyLong_SHIFT) { return -(Py_ssize_t) (((((size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])); } break; case 3: if (8 * sizeof(Py_ssize_t) > 3 * PyLong_SHIFT) { return (Py_ssize_t) (((((((size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])); } break; case -3: if (8 * sizeof(Py_ssize_t) > 3 * PyLong_SHIFT) { return -(Py_ssize_t) (((((((size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])); } break; case 4: if (8 * sizeof(Py_ssize_t) > 4 * PyLong_SHIFT) { return (Py_ssize_t) (((((((((size_t)digits[3]) << PyLong_SHIFT) | (size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])); } break; case -4: if (8 * sizeof(Py_ssize_t) > 4 * PyLong_SHIFT) { return -(Py_ssize_t) (((((((((size_t)digits[3]) << PyLong_SHIFT) | (size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])); } break; } } #endif return PyLong_AsSsize_t(b); } x = PyNumber_Index(b); if (!x) return -1; ival = PyInt_AsSsize_t(x); Py_DECREF(x); return ival; } static CYTHON_INLINE PyObject * __Pyx_PyInt_FromSize_t(size_t ival) { return PyInt_FromSize_t(ival); } #endif /* Py_PYTHON_H */ pygame_sdl2-2.1.0-for-renpy-6.99.14.1/gen/pygame_sdl2.mixer_music.c0000664000175000017500000051270312660477777023753 0ustar tomtom00000000000000/* Generated by Cython 0.23.4 */ #define PY_SSIZE_T_CLEAN #include "Python.h" #ifndef Py_PYTHON_H #error Python headers needed to compile C extensions, please install development version of Python. #elif PY_VERSION_HEX < 0x02060000 || (0x03000000 <= PY_VERSION_HEX && PY_VERSION_HEX < 0x03020000) #error Cython requires Python 2.6+ or Python 3.2+. #else #define CYTHON_ABI "0_23_4" #include #ifndef offsetof #define offsetof(type, member) ( (size_t) & ((type*)0) -> member ) #endif #if !defined(WIN32) && !defined(MS_WINDOWS) #ifndef __stdcall #define __stdcall #endif #ifndef __cdecl #define __cdecl #endif #ifndef __fastcall #define __fastcall #endif #endif #ifndef DL_IMPORT #define DL_IMPORT(t) t #endif #ifndef DL_EXPORT #define DL_EXPORT(t) t #endif #ifndef PY_LONG_LONG #define PY_LONG_LONG LONG_LONG #endif #ifndef Py_HUGE_VAL #define Py_HUGE_VAL HUGE_VAL #endif #ifdef PYPY_VERSION #define CYTHON_COMPILING_IN_PYPY 1 #define CYTHON_COMPILING_IN_CPYTHON 0 #else #define CYTHON_COMPILING_IN_PYPY 0 #define CYTHON_COMPILING_IN_CPYTHON 1 #endif #if !defined(CYTHON_USE_PYLONG_INTERNALS) && CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x02070000 #define CYTHON_USE_PYLONG_INTERNALS 1 #endif #if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX < 0x02070600 && !defined(Py_OptimizeFlag) #define Py_OptimizeFlag 0 #endif #define __PYX_BUILD_PY_SSIZE_T "n" #define CYTHON_FORMAT_SSIZE_T "z" #if PY_MAJOR_VERSION < 3 #define __Pyx_BUILTIN_MODULE_NAME "__builtin__" #define __Pyx_PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)\ PyCode_New(a+k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos) #define __Pyx_DefaultClassType PyClass_Type #else #define __Pyx_BUILTIN_MODULE_NAME "builtins" #define __Pyx_PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)\ PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos) #define __Pyx_DefaultClassType PyType_Type #endif #ifndef Py_TPFLAGS_CHECKTYPES #define Py_TPFLAGS_CHECKTYPES 0 #endif #ifndef Py_TPFLAGS_HAVE_INDEX #define Py_TPFLAGS_HAVE_INDEX 0 #endif #ifndef Py_TPFLAGS_HAVE_NEWBUFFER #define Py_TPFLAGS_HAVE_NEWBUFFER 0 #endif #ifndef Py_TPFLAGS_HAVE_FINALIZE #define Py_TPFLAGS_HAVE_FINALIZE 0 #endif #if PY_VERSION_HEX > 0x03030000 && defined(PyUnicode_KIND) #define CYTHON_PEP393_ENABLED 1 #define __Pyx_PyUnicode_READY(op) (likely(PyUnicode_IS_READY(op)) ?\ 0 : _PyUnicode_Ready((PyObject *)(op))) #define __Pyx_PyUnicode_GET_LENGTH(u) PyUnicode_GET_LENGTH(u) #define __Pyx_PyUnicode_READ_CHAR(u, i) PyUnicode_READ_CHAR(u, i) #define __Pyx_PyUnicode_KIND(u) PyUnicode_KIND(u) #define __Pyx_PyUnicode_DATA(u) PyUnicode_DATA(u) #define __Pyx_PyUnicode_READ(k, d, i) PyUnicode_READ(k, d, i) #else #define CYTHON_PEP393_ENABLED 0 #define __Pyx_PyUnicode_READY(op) (0) #define __Pyx_PyUnicode_GET_LENGTH(u) PyUnicode_GET_SIZE(u) #define __Pyx_PyUnicode_READ_CHAR(u, i) ((Py_UCS4)(PyUnicode_AS_UNICODE(u)[i])) #define __Pyx_PyUnicode_KIND(u) (sizeof(Py_UNICODE)) #define __Pyx_PyUnicode_DATA(u) ((void*)PyUnicode_AS_UNICODE(u)) #define __Pyx_PyUnicode_READ(k, d, i) ((void)(k), (Py_UCS4)(((Py_UNICODE*)d)[i])) #endif #if CYTHON_COMPILING_IN_PYPY #define __Pyx_PyUnicode_Concat(a, b) PyNumber_Add(a, b) #define __Pyx_PyUnicode_ConcatSafe(a, b) PyNumber_Add(a, b) #else #define __Pyx_PyUnicode_Concat(a, b) PyUnicode_Concat(a, b) #define __Pyx_PyUnicode_ConcatSafe(a, b) ((unlikely((a) == Py_None) || unlikely((b) == Py_None)) ?\ PyNumber_Add(a, b) : __Pyx_PyUnicode_Concat(a, b)) #endif #if CYTHON_COMPILING_IN_PYPY && !defined(PyUnicode_Contains) #define PyUnicode_Contains(u, s) PySequence_Contains(u, s) #endif #define __Pyx_PyString_FormatSafe(a, b) ((unlikely((a) == Py_None)) ? PyNumber_Remainder(a, b) : __Pyx_PyString_Format(a, b)) #define __Pyx_PyUnicode_FormatSafe(a, b) ((unlikely((a) == Py_None)) ? PyNumber_Remainder(a, b) : PyUnicode_Format(a, b)) #if PY_MAJOR_VERSION >= 3 #define __Pyx_PyString_Format(a, b) PyUnicode_Format(a, b) #else #define __Pyx_PyString_Format(a, b) PyString_Format(a, b) #endif #if PY_MAJOR_VERSION >= 3 #define PyBaseString_Type PyUnicode_Type #define PyStringObject PyUnicodeObject #define PyString_Type PyUnicode_Type #define PyString_Check PyUnicode_Check #define PyString_CheckExact PyUnicode_CheckExact #endif #if PY_MAJOR_VERSION >= 3 #define __Pyx_PyBaseString_Check(obj) PyUnicode_Check(obj) #define __Pyx_PyBaseString_CheckExact(obj) PyUnicode_CheckExact(obj) #else #define __Pyx_PyBaseString_Check(obj) (PyString_Check(obj) || PyUnicode_Check(obj)) #define __Pyx_PyBaseString_CheckExact(obj) (PyString_CheckExact(obj) || PyUnicode_CheckExact(obj)) #endif #ifndef PySet_CheckExact #define PySet_CheckExact(obj) (Py_TYPE(obj) == &PySet_Type) #endif #define __Pyx_TypeCheck(obj, type) PyObject_TypeCheck(obj, (PyTypeObject *)type) #if PY_MAJOR_VERSION >= 3 #define PyIntObject PyLongObject #define PyInt_Type PyLong_Type #define PyInt_Check(op) PyLong_Check(op) #define PyInt_CheckExact(op) PyLong_CheckExact(op) #define PyInt_FromString PyLong_FromString #define PyInt_FromUnicode PyLong_FromUnicode #define PyInt_FromLong PyLong_FromLong #define PyInt_FromSize_t PyLong_FromSize_t #define PyInt_FromSsize_t PyLong_FromSsize_t #define PyInt_AsLong PyLong_AsLong #define PyInt_AS_LONG PyLong_AS_LONG #define PyInt_AsSsize_t PyLong_AsSsize_t #define PyInt_AsUnsignedLongMask PyLong_AsUnsignedLongMask #define PyInt_AsUnsignedLongLongMask PyLong_AsUnsignedLongLongMask #define PyNumber_Int PyNumber_Long #endif #if PY_MAJOR_VERSION >= 3 #define PyBoolObject PyLongObject #endif #if PY_MAJOR_VERSION >= 3 && CYTHON_COMPILING_IN_PYPY #ifndef PyUnicode_InternFromString #define PyUnicode_InternFromString(s) PyUnicode_FromString(s) #endif #endif #if PY_VERSION_HEX < 0x030200A4 typedef long Py_hash_t; #define __Pyx_PyInt_FromHash_t PyInt_FromLong #define __Pyx_PyInt_AsHash_t PyInt_AsLong #else #define __Pyx_PyInt_FromHash_t PyInt_FromSsize_t #define __Pyx_PyInt_AsHash_t PyInt_AsSsize_t #endif #if PY_MAJOR_VERSION >= 3 #define __Pyx_PyMethod_New(func, self, klass) ((self) ? PyMethod_New(func, self) : PyInstanceMethod_New(func)) #else #define __Pyx_PyMethod_New(func, self, klass) PyMethod_New(func, self, klass) #endif #if PY_VERSION_HEX >= 0x030500B1 #define __Pyx_PyAsyncMethodsStruct PyAsyncMethods #define __Pyx_PyType_AsAsync(obj) (Py_TYPE(obj)->tp_as_async) #elif CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3 typedef struct { unaryfunc am_await; unaryfunc am_aiter; unaryfunc am_anext; } __Pyx_PyAsyncMethodsStruct; #define __Pyx_PyType_AsAsync(obj) ((__Pyx_PyAsyncMethodsStruct*) (Py_TYPE(obj)->tp_reserved)) #else #define __Pyx_PyType_AsAsync(obj) NULL #endif #ifndef CYTHON_RESTRICT #if defined(__GNUC__) #define CYTHON_RESTRICT __restrict__ #elif defined(_MSC_VER) && _MSC_VER >= 1400 #define CYTHON_RESTRICT __restrict #elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L #define CYTHON_RESTRICT restrict #else #define CYTHON_RESTRICT #endif #endif #define __Pyx_void_to_None(void_result) ((void)(void_result), Py_INCREF(Py_None), Py_None) #ifndef CYTHON_INLINE #if defined(__GNUC__) #define CYTHON_INLINE __inline__ #elif defined(_MSC_VER) #define CYTHON_INLINE __inline #elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L #define CYTHON_INLINE inline #else #define CYTHON_INLINE #endif #endif #if defined(WIN32) || defined(MS_WINDOWS) #define _USE_MATH_DEFINES #endif #include #ifdef NAN #define __PYX_NAN() ((float) NAN) #else static CYTHON_INLINE float __PYX_NAN() { float value; memset(&value, 0xFF, sizeof(value)); return value; } #endif #if PY_MAJOR_VERSION >= 3 #define __Pyx_PyNumber_Divide(x,y) PyNumber_TrueDivide(x,y) #define __Pyx_PyNumber_InPlaceDivide(x,y) PyNumber_InPlaceTrueDivide(x,y) #else #define __Pyx_PyNumber_Divide(x,y) PyNumber_Divide(x,y) #define __Pyx_PyNumber_InPlaceDivide(x,y) PyNumber_InPlaceDivide(x,y) #endif #ifndef __PYX_EXTERN_C #ifdef __cplusplus #define __PYX_EXTERN_C extern "C" #else #define __PYX_EXTERN_C extern #endif #endif #define __PYX_HAVE__pygame_sdl2__mixer_music #define __PYX_HAVE_API__pygame_sdl2__mixer_music #include "stdint.h" #include "string.h" #include "stdio.h" #include "stddef.h" #include "SDL.h" #include "SDL_mixer.h" #ifdef _OPENMP #include #endif /* _OPENMP */ #ifdef PYREX_WITHOUT_ASSERTIONS #define CYTHON_WITHOUT_ASSERTIONS #endif #ifndef CYTHON_UNUSED # if defined(__GNUC__) # if !(defined(__cplusplus)) || (__GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 4)) # define CYTHON_UNUSED __attribute__ ((__unused__)) # else # define CYTHON_UNUSED # endif # elif defined(__ICC) || (defined(__INTEL_COMPILER) && !defined(_MSC_VER)) # define CYTHON_UNUSED __attribute__ ((__unused__)) # else # define CYTHON_UNUSED # endif #endif #ifndef CYTHON_NCP_UNUSED # if CYTHON_COMPILING_IN_CPYTHON # define CYTHON_NCP_UNUSED # else # define CYTHON_NCP_UNUSED CYTHON_UNUSED # endif #endif typedef struct {PyObject **p; char *s; const Py_ssize_t n; const char* encoding; const char is_unicode; const char is_str; const char intern; } __Pyx_StringTabEntry; #define __PYX_DEFAULT_STRING_ENCODING_IS_ASCII 0 #define __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT 0 #define __PYX_DEFAULT_STRING_ENCODING "" #define __Pyx_PyObject_FromString __Pyx_PyBytes_FromString #define __Pyx_PyObject_FromStringAndSize __Pyx_PyBytes_FromStringAndSize #define __Pyx_uchar_cast(c) ((unsigned char)c) #define __Pyx_long_cast(x) ((long)x) #define __Pyx_fits_Py_ssize_t(v, type, is_signed) (\ (sizeof(type) < sizeof(Py_ssize_t)) ||\ (sizeof(type) > sizeof(Py_ssize_t) &&\ likely(v < (type)PY_SSIZE_T_MAX ||\ v == (type)PY_SSIZE_T_MAX) &&\ (!is_signed || likely(v > (type)PY_SSIZE_T_MIN ||\ v == (type)PY_SSIZE_T_MIN))) ||\ (sizeof(type) == sizeof(Py_ssize_t) &&\ (is_signed || likely(v < (type)PY_SSIZE_T_MAX ||\ v == (type)PY_SSIZE_T_MAX))) ) #if defined (__cplusplus) && __cplusplus >= 201103L #include #define __Pyx_sst_abs(value) std::abs(value) #elif SIZEOF_INT >= SIZEOF_SIZE_T #define __Pyx_sst_abs(value) abs(value) #elif SIZEOF_LONG >= SIZEOF_SIZE_T #define __Pyx_sst_abs(value) labs(value) #elif defined (_MSC_VER) && defined (_M_X64) #define __Pyx_sst_abs(value) _abs64(value) #elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L #define __Pyx_sst_abs(value) llabs(value) #elif defined (__GNUC__) #define __Pyx_sst_abs(value) __builtin_llabs(value) #else #define __Pyx_sst_abs(value) ((value<0) ? -value : value) #endif static CYTHON_INLINE char* __Pyx_PyObject_AsString(PyObject*); static CYTHON_INLINE char* __Pyx_PyObject_AsStringAndSize(PyObject*, Py_ssize_t* length); #define __Pyx_PyByteArray_FromString(s) PyByteArray_FromStringAndSize((const char*)s, strlen((const char*)s)) #define __Pyx_PyByteArray_FromStringAndSize(s, l) PyByteArray_FromStringAndSize((const char*)s, l) #define __Pyx_PyBytes_FromString PyBytes_FromString #define __Pyx_PyBytes_FromStringAndSize PyBytes_FromStringAndSize static CYTHON_INLINE PyObject* __Pyx_PyUnicode_FromString(const char*); #if PY_MAJOR_VERSION < 3 #define __Pyx_PyStr_FromString __Pyx_PyBytes_FromString #define __Pyx_PyStr_FromStringAndSize __Pyx_PyBytes_FromStringAndSize #else #define __Pyx_PyStr_FromString __Pyx_PyUnicode_FromString #define __Pyx_PyStr_FromStringAndSize __Pyx_PyUnicode_FromStringAndSize #endif #define __Pyx_PyObject_AsSString(s) ((signed char*) __Pyx_PyObject_AsString(s)) #define __Pyx_PyObject_AsUString(s) ((unsigned char*) __Pyx_PyObject_AsString(s)) #define __Pyx_PyObject_FromCString(s) __Pyx_PyObject_FromString((const char*)s) #define __Pyx_PyBytes_FromCString(s) __Pyx_PyBytes_FromString((const char*)s) #define __Pyx_PyByteArray_FromCString(s) __Pyx_PyByteArray_FromString((const char*)s) #define __Pyx_PyStr_FromCString(s) __Pyx_PyStr_FromString((const char*)s) #define __Pyx_PyUnicode_FromCString(s) __Pyx_PyUnicode_FromString((const char*)s) #if PY_MAJOR_VERSION < 3 static CYTHON_INLINE size_t __Pyx_Py_UNICODE_strlen(const Py_UNICODE *u) { const Py_UNICODE *u_end = u; while (*u_end++) ; return (size_t)(u_end - u - 1); } #else #define __Pyx_Py_UNICODE_strlen Py_UNICODE_strlen #endif #define __Pyx_PyUnicode_FromUnicode(u) PyUnicode_FromUnicode(u, __Pyx_Py_UNICODE_strlen(u)) #define __Pyx_PyUnicode_FromUnicodeAndLength PyUnicode_FromUnicode #define __Pyx_PyUnicode_AsUnicode PyUnicode_AsUnicode #define __Pyx_NewRef(obj) (Py_INCREF(obj), obj) #define __Pyx_Owned_Py_None(b) __Pyx_NewRef(Py_None) #define __Pyx_PyBool_FromLong(b) ((b) ? __Pyx_NewRef(Py_True) : __Pyx_NewRef(Py_False)) static CYTHON_INLINE int __Pyx_PyObject_IsTrue(PyObject*); static CYTHON_INLINE PyObject* __Pyx_PyNumber_Int(PyObject* x); static CYTHON_INLINE Py_ssize_t __Pyx_PyIndex_AsSsize_t(PyObject*); static CYTHON_INLINE PyObject * __Pyx_PyInt_FromSize_t(size_t); #if CYTHON_COMPILING_IN_CPYTHON #define __pyx_PyFloat_AsDouble(x) (PyFloat_CheckExact(x) ? PyFloat_AS_DOUBLE(x) : PyFloat_AsDouble(x)) #else #define __pyx_PyFloat_AsDouble(x) PyFloat_AsDouble(x) #endif #define __pyx_PyFloat_AsFloat(x) ((float) __pyx_PyFloat_AsDouble(x)) #if PY_MAJOR_VERSION < 3 && __PYX_DEFAULT_STRING_ENCODING_IS_ASCII static int __Pyx_sys_getdefaultencoding_not_ascii; static int __Pyx_init_sys_getdefaultencoding_params(void) { PyObject* sys; PyObject* default_encoding = NULL; PyObject* ascii_chars_u = NULL; PyObject* ascii_chars_b = NULL; const char* default_encoding_c; sys = PyImport_ImportModule("sys"); if (!sys) goto bad; default_encoding = PyObject_CallMethod(sys, (char*) "getdefaultencoding", NULL); Py_DECREF(sys); if (!default_encoding) goto bad; default_encoding_c = PyBytes_AsString(default_encoding); if (!default_encoding_c) goto bad; if (strcmp(default_encoding_c, "ascii") == 0) { __Pyx_sys_getdefaultencoding_not_ascii = 0; } else { char ascii_chars[128]; int c; for (c = 0; c < 128; c++) { ascii_chars[c] = c; } __Pyx_sys_getdefaultencoding_not_ascii = 1; ascii_chars_u = PyUnicode_DecodeASCII(ascii_chars, 128, NULL); if (!ascii_chars_u) goto bad; ascii_chars_b = PyUnicode_AsEncodedString(ascii_chars_u, default_encoding_c, NULL); if (!ascii_chars_b || !PyBytes_Check(ascii_chars_b) || memcmp(ascii_chars, PyBytes_AS_STRING(ascii_chars_b), 128) != 0) { PyErr_Format( PyExc_ValueError, "This module compiled with c_string_encoding=ascii, but default encoding '%.200s' is not a superset of ascii.", default_encoding_c); goto bad; } Py_DECREF(ascii_chars_u); Py_DECREF(ascii_chars_b); } Py_DECREF(default_encoding); return 0; bad: Py_XDECREF(default_encoding); Py_XDECREF(ascii_chars_u); Py_XDECREF(ascii_chars_b); return -1; } #endif #if __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT && PY_MAJOR_VERSION >= 3 #define __Pyx_PyUnicode_FromStringAndSize(c_str, size) PyUnicode_DecodeUTF8(c_str, size, NULL) #else #define __Pyx_PyUnicode_FromStringAndSize(c_str, size) PyUnicode_Decode(c_str, size, __PYX_DEFAULT_STRING_ENCODING, NULL) #if __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT static char* __PYX_DEFAULT_STRING_ENCODING; static int __Pyx_init_sys_getdefaultencoding_params(void) { PyObject* sys; PyObject* default_encoding = NULL; char* default_encoding_c; sys = PyImport_ImportModule("sys"); if (!sys) goto bad; default_encoding = PyObject_CallMethod(sys, (char*) (const char*) "getdefaultencoding", NULL); Py_DECREF(sys); if (!default_encoding) goto bad; default_encoding_c = PyBytes_AsString(default_encoding); if (!default_encoding_c) goto bad; __PYX_DEFAULT_STRING_ENCODING = (char*) malloc(strlen(default_encoding_c)); if (!__PYX_DEFAULT_STRING_ENCODING) goto bad; strcpy(__PYX_DEFAULT_STRING_ENCODING, default_encoding_c); Py_DECREF(default_encoding); return 0; bad: Py_XDECREF(default_encoding); return -1; } #endif #endif /* Test for GCC > 2.95 */ #if defined(__GNUC__) && (__GNUC__ > 2 || (__GNUC__ == 2 && (__GNUC_MINOR__ > 95))) #define likely(x) __builtin_expect(!!(x), 1) #define unlikely(x) __builtin_expect(!!(x), 0) #else /* !__GNUC__ or GCC < 2.95 */ #define likely(x) (x) #define unlikely(x) (x) #endif /* __GNUC__ */ static PyObject *__pyx_m; static PyObject *__pyx_d; static PyObject *__pyx_b; static PyObject *__pyx_empty_tuple; static PyObject *__pyx_empty_bytes; static int __pyx_lineno; static int __pyx_clineno = 0; static const char * __pyx_cfilenm= __FILE__; static const char *__pyx_filename; static const char *__pyx_f[] = { "src/pygame_sdl2/mixer_music.pyx", }; /*--- Type declarations ---*/ struct __pyx_opt_args_11pygame_sdl2_8rwobject_to_rwops; /* "pygame_sdl2/rwobject.pxd":21 * from sdl2 cimport SDL_RWops * * cdef SDL_RWops *to_rwops(filelike, mode=*) except NULL # <<<<<<<<<<<<<< * */ struct __pyx_opt_args_11pygame_sdl2_8rwobject_to_rwops { int __pyx_n; PyObject *mode; }; /* --- Runtime support code (head) --- */ #ifndef CYTHON_REFNANNY #define CYTHON_REFNANNY 0 #endif #if CYTHON_REFNANNY typedef struct { void (*INCREF)(void*, PyObject*, int); void (*DECREF)(void*, PyObject*, int); void (*GOTREF)(void*, PyObject*, int); void (*GIVEREF)(void*, PyObject*, int); void* (*SetupContext)(const char*, int, const char*); void (*FinishContext)(void**); } __Pyx_RefNannyAPIStruct; static __Pyx_RefNannyAPIStruct *__Pyx_RefNanny = NULL; static __Pyx_RefNannyAPIStruct *__Pyx_RefNannyImportAPI(const char *modname); #define __Pyx_RefNannyDeclarations void *__pyx_refnanny = NULL; #ifdef WITH_THREAD #define __Pyx_RefNannySetupContext(name, acquire_gil)\ if (acquire_gil) {\ PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure();\ __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), __LINE__, __FILE__);\ PyGILState_Release(__pyx_gilstate_save);\ } else {\ __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), __LINE__, __FILE__);\ } #else #define __Pyx_RefNannySetupContext(name, acquire_gil)\ __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), __LINE__, __FILE__) #endif #define __Pyx_RefNannyFinishContext()\ __Pyx_RefNanny->FinishContext(&__pyx_refnanny) #define __Pyx_INCREF(r) __Pyx_RefNanny->INCREF(__pyx_refnanny, (PyObject *)(r), __LINE__) #define __Pyx_DECREF(r) __Pyx_RefNanny->DECREF(__pyx_refnanny, (PyObject *)(r), __LINE__) #define __Pyx_GOTREF(r) __Pyx_RefNanny->GOTREF(__pyx_refnanny, (PyObject *)(r), __LINE__) #define __Pyx_GIVEREF(r) __Pyx_RefNanny->GIVEREF(__pyx_refnanny, (PyObject *)(r), __LINE__) #define __Pyx_XINCREF(r) do { if((r) != NULL) {__Pyx_INCREF(r); }} while(0) #define __Pyx_XDECREF(r) do { if((r) != NULL) {__Pyx_DECREF(r); }} while(0) #define __Pyx_XGOTREF(r) do { if((r) != NULL) {__Pyx_GOTREF(r); }} while(0) #define __Pyx_XGIVEREF(r) do { if((r) != NULL) {__Pyx_GIVEREF(r);}} while(0) #else #define __Pyx_RefNannyDeclarations #define __Pyx_RefNannySetupContext(name, acquire_gil) #define __Pyx_RefNannyFinishContext() #define __Pyx_INCREF(r) Py_INCREF(r) #define __Pyx_DECREF(r) Py_DECREF(r) #define __Pyx_GOTREF(r) #define __Pyx_GIVEREF(r) #define __Pyx_XINCREF(r) Py_XINCREF(r) #define __Pyx_XDECREF(r) Py_XDECREF(r) #define __Pyx_XGOTREF(r) #define __Pyx_XGIVEREF(r) #endif #define __Pyx_XDECREF_SET(r, v) do {\ PyObject *tmp = (PyObject *) r;\ r = v; __Pyx_XDECREF(tmp);\ } while (0) #define __Pyx_DECREF_SET(r, v) do {\ PyObject *tmp = (PyObject *) r;\ r = v; __Pyx_DECREF(tmp);\ } while (0) #define __Pyx_CLEAR(r) do { PyObject* tmp = ((PyObject*)(r)); r = NULL; __Pyx_DECREF(tmp);} while(0) #define __Pyx_XCLEAR(r) do { if((r) != NULL) {PyObject* tmp = ((PyObject*)(r)); r = NULL; __Pyx_DECREF(tmp);}} while(0) #if CYTHON_COMPILING_IN_CPYTHON static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStr(PyObject* obj, PyObject* attr_name) { PyTypeObject* tp = Py_TYPE(obj); if (likely(tp->tp_getattro)) return tp->tp_getattro(obj, attr_name); #if PY_MAJOR_VERSION < 3 if (likely(tp->tp_getattr)) return tp->tp_getattr(obj, PyString_AS_STRING(attr_name)); #endif return PyObject_GetAttr(obj, attr_name); } #else #define __Pyx_PyObject_GetAttrStr(o,n) PyObject_GetAttr(o,n) #endif static PyObject *__Pyx_GetBuiltinName(PyObject *name); static CYTHON_INLINE PyObject *__Pyx_GetModuleGlobalName(PyObject *name); #if CYTHON_COMPILING_IN_CPYTHON static CYTHON_INLINE PyObject* __Pyx_PyObject_Call(PyObject *func, PyObject *arg, PyObject *kw); #else #define __Pyx_PyObject_Call(func, arg, kw) PyObject_Call(func, arg, kw) #endif #if CYTHON_COMPILING_IN_CPYTHON static CYTHON_INLINE PyObject* __Pyx_PyObject_CallMethO(PyObject *func, PyObject *arg); #endif static CYTHON_INLINE PyObject* __Pyx_PyObject_CallOneArg(PyObject *func, PyObject *arg); #if CYTHON_COMPILING_IN_CPYTHON static CYTHON_INLINE PyObject* __Pyx_PyObject_CallNoArg(PyObject *func); #else #define __Pyx_PyObject_CallNoArg(func) __Pyx_PyObject_Call(func, __pyx_empty_tuple, NULL) #endif static CYTHON_INLINE void __Pyx_ErrRestore(PyObject *type, PyObject *value, PyObject *tb); static CYTHON_INLINE void __Pyx_ErrFetch(PyObject **type, PyObject **value, PyObject **tb); static void __Pyx_WriteUnraisable(const char *name, int clineno, int lineno, const char *filename, int full_traceback, int nogil); static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, PyObject *cause); static void __Pyx_RaiseDoubleKeywordsError(const char* func_name, PyObject* kw_name); static int __Pyx_ParseOptionalKeywords(PyObject *kwds, PyObject **argnames[],\ PyObject *kwds2, PyObject *values[], Py_ssize_t num_pos_args,\ const char* function_name); static void __Pyx_RaiseArgtupleInvalid(const char* func_name, int exact, Py_ssize_t num_min, Py_ssize_t num_max, Py_ssize_t num_found); static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list, int level); static PyObject* __Pyx_ImportFrom(PyObject* module, PyObject* name); typedef struct { int code_line; PyCodeObject* code_object; } __Pyx_CodeObjectCacheEntry; struct __Pyx_CodeObjectCache { int count; int max_count; __Pyx_CodeObjectCacheEntry* entries; }; static struct __Pyx_CodeObjectCache __pyx_code_cache = {0,0,NULL}; static int __pyx_bisect_code_objects(__Pyx_CodeObjectCacheEntry* entries, int count, int code_line); static PyCodeObject *__pyx_find_code_object(int code_line); static void __pyx_insert_code_object(int code_line, PyCodeObject* code_object); static void __Pyx_AddTraceback(const char *funcname, int c_line, int py_line, const char *filename); static CYTHON_INLINE int __Pyx_PyInt_As_int(PyObject *); static CYTHON_INLINE PyObject* __Pyx_PyInt_From_int(int value); static CYTHON_INLINE PyObject* __Pyx_PyInt_From_long(long value); static CYTHON_INLINE long __Pyx_PyInt_As_long(PyObject *); static int __Pyx_check_binary_version(void); #if !defined(__Pyx_PyIdentifier_FromString) #if PY_MAJOR_VERSION < 3 #define __Pyx_PyIdentifier_FromString(s) PyString_FromString(s) #else #define __Pyx_PyIdentifier_FromString(s) PyUnicode_FromString(s) #endif #endif static PyObject *__Pyx_ImportModule(const char *name); static int __Pyx_ImportFunction(PyObject *module, const char *funcname, void (**f)(void), const char *sig); static int __Pyx_InitStrings(__Pyx_StringTabEntry *t); /* Module declarations from 'libc.stdint' */ /* Module declarations from 'libc.string' */ /* Module declarations from 'libc.stdio' */ /* Module declarations from 'libc.stddef' */ /* Module declarations from 'sdl2' */ /* Module declarations from 'sdl2_mixer' */ /* Module declarations from 'pygame_sdl2.rwobject' */ static SDL_RWops *(*__pyx_f_11pygame_sdl2_8rwobject_to_rwops)(PyObject *, struct __pyx_opt_args_11pygame_sdl2_8rwobject_to_rwops *__pyx_optional_args); /*proto*/ /* Module declarations from 'pygame_sdl2.mixer_music' */ static Mix_Music *__pyx_v_11pygame_sdl2_11mixer_music_current_music; static PyObject *__pyx_v_11pygame_sdl2_11mixer_music_queued_music = 0; static int __pyx_v_11pygame_sdl2_11mixer_music_endevent; static void __pyx_f_11pygame_sdl2_11mixer_music_music_finished(void); /*proto*/ #define __Pyx_MODULE_NAME "pygame_sdl2.mixer_music" int __pyx_module_is_main_pygame_sdl2__mixer_music = 0; /* Implementation of 'pygame_sdl2.mixer_music' */ static char __pyx_k_fi[] = "fi"; static char __pyx_k_pos[] = "pos"; static char __pyx_k_load[] = "load"; static char __pyx_k_main[] = "__main__"; static char __pyx_k_play[] = "play"; static char __pyx_k_stop[] = "stop"; static char __pyx_k_test[] = "__test__"; static char __pyx_k_time[] = "time"; static char __pyx_k_type[] = "type"; static char __pyx_k_error[] = "error"; static char __pyx_k_loops[] = "loops"; static char __pyx_k_pause[] = "pause"; static char __pyx_k_queue[] = "queue"; static char __pyx_k_start[] = "start"; static char __pyx_k_value[] = "value"; static char __pyx_k_import[] = "__import__"; static char __pyx_k_fadeout[] = "fadeout"; static char __pyx_k_get_pos[] = "get_pos"; static char __pyx_k_set_pos[] = "set_pos"; static char __pyx_k_unpause[] = "unpause"; static char __pyx_k_get_busy[] = "get_busy"; static char __pyx_k_get_volume[] = "get_volume"; static char __pyx_k_set_volume[] = "set_volume"; static char __pyx_k_get_endevent[] = "get_endevent"; static char __pyx_k_set_endevent[] = "set_endevent"; static char __pyx_k_Not_implemented[] = "Not implemented."; static char __pyx_k_pygame_sdl2_error[] = "pygame_sdl2.error"; static char __pyx_k_pygame_sdl2_mixer_music[] = "pygame_sdl2.mixer_music"; static char __pyx_k_home_tom_ab_pygame_sdl2_src_pyg[] = "/home/tom/ab/pygame_sdl2/src/pygame_sdl2/mixer_music.pyx"; static PyObject *__pyx_kp_s_Not_implemented; static PyObject *__pyx_n_s_error; static PyObject *__pyx_n_s_fadeout; static PyObject *__pyx_n_s_fi; static PyObject *__pyx_n_s_get_busy; static PyObject *__pyx_n_s_get_endevent; static PyObject *__pyx_n_s_get_pos; static PyObject *__pyx_n_s_get_volume; static PyObject *__pyx_kp_s_home_tom_ab_pygame_sdl2_src_pyg; static PyObject *__pyx_n_s_import; static PyObject *__pyx_n_s_load; static PyObject *__pyx_n_s_loops; static PyObject *__pyx_n_s_main; static PyObject *__pyx_n_s_pause; static PyObject *__pyx_n_s_play; static PyObject *__pyx_n_s_pos; static PyObject *__pyx_n_s_pygame_sdl2_error; static PyObject *__pyx_n_s_pygame_sdl2_mixer_music; static PyObject *__pyx_n_s_queue; static PyObject *__pyx_n_s_set_endevent; static PyObject *__pyx_n_s_set_pos; static PyObject *__pyx_n_s_set_volume; static PyObject *__pyx_n_s_start; static PyObject *__pyx_n_s_stop; static PyObject *__pyx_n_s_test; static PyObject *__pyx_n_s_time; static PyObject *__pyx_n_s_type; static PyObject *__pyx_n_s_unpause; static PyObject *__pyx_n_s_value; static PyObject *__pyx_pf_11pygame_sdl2_11mixer_music_load(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_fi); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_11mixer_music_2play(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_loops, double __pyx_v_start); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_11mixer_music_4rewind(CYTHON_UNUSED PyObject *__pyx_self); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_11mixer_music_6stop(CYTHON_UNUSED PyObject *__pyx_self); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_11mixer_music_8pause(CYTHON_UNUSED PyObject *__pyx_self); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_11mixer_music_10unpause(CYTHON_UNUSED PyObject *__pyx_self); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_11mixer_music_12fadeout(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_time); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_11mixer_music_14set_volume(CYTHON_UNUSED PyObject *__pyx_self, double __pyx_v_value); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_11mixer_music_16get_volume(CYTHON_UNUSED PyObject *__pyx_self); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_11mixer_music_18get_busy(CYTHON_UNUSED PyObject *__pyx_self); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_11mixer_music_20set_pos(CYTHON_UNUSED PyObject *__pyx_self, double __pyx_v_pos); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_11mixer_music_22get_pos(CYTHON_UNUSED PyObject *__pyx_self); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_11mixer_music_24queue(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_fi); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_11mixer_music_26set_endevent(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_type); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_11mixer_music_28get_endevent(CYTHON_UNUSED PyObject *__pyx_self); /* proto */ static PyObject *__pyx_int_0; static PyObject *__pyx_tuple_; static PyObject *__pyx_tuple__2; static PyObject *__pyx_tuple__4; static PyObject *__pyx_tuple__9; static PyObject *__pyx_tuple__11; static PyObject *__pyx_tuple__15; static PyObject *__pyx_tuple__18; static PyObject *__pyx_tuple__20; static PyObject *__pyx_codeobj__3; static PyObject *__pyx_codeobj__5; static PyObject *__pyx_codeobj__6; static PyObject *__pyx_codeobj__7; static PyObject *__pyx_codeobj__8; static PyObject *__pyx_codeobj__10; static PyObject *__pyx_codeobj__12; static PyObject *__pyx_codeobj__13; static PyObject *__pyx_codeobj__14; static PyObject *__pyx_codeobj__16; static PyObject *__pyx_codeobj__17; static PyObject *__pyx_codeobj__19; static PyObject *__pyx_codeobj__21; static PyObject *__pyx_codeobj__22; /* "pygame_sdl2/mixer_music.pyx":30 * cdef int endevent = 0 * * cdef void music_finished(): # <<<<<<<<<<<<<< * global queued_music * if queued_music: */ static void __pyx_f_11pygame_sdl2_11mixer_music_music_finished(void) { SDL_Event __pyx_v_e; __Pyx_RefNannyDeclarations int __pyx_t_1; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; PyObject *__pyx_t_5 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("music_finished", 0); /* "pygame_sdl2/mixer_music.pyx":32 * cdef void music_finished(): * global queued_music * if queued_music: # <<<<<<<<<<<<<< * load(queued_music) * play() */ __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_11pygame_sdl2_11mixer_music_queued_music); if (unlikely(__pyx_t_1 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 32; __pyx_clineno = __LINE__; goto __pyx_L1_error;} if (__pyx_t_1) { /* "pygame_sdl2/mixer_music.pyx":33 * global queued_music * if queued_music: * load(queued_music) # <<<<<<<<<<<<<< * play() * queued_music = None */ __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_load); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 33; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = NULL; if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_3))) { __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3); if (likely(__pyx_t_4)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); __Pyx_INCREF(__pyx_t_4); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_3, function); } } if (!__pyx_t_4) { __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_v_11pygame_sdl2_11mixer_music_queued_music); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 33; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); } else { __pyx_t_5 = PyTuple_New(1+1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 33; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_4); __pyx_t_4 = NULL; __Pyx_INCREF(__pyx_v_11pygame_sdl2_11mixer_music_queued_music); __Pyx_GIVEREF(__pyx_v_11pygame_sdl2_11mixer_music_queued_music); PyTuple_SET_ITEM(__pyx_t_5, 0+1, __pyx_v_11pygame_sdl2_11mixer_music_queued_music); __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_5, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 33; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; } __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "pygame_sdl2/mixer_music.pyx":34 * if queued_music: * load(queued_music) * play() # <<<<<<<<<<<<<< * queued_music = None * */ __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_play); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 34; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __pyx_t_5 = NULL; if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_3))) { __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_3); if (likely(__pyx_t_5)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); __Pyx_INCREF(__pyx_t_5); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_3, function); } } if (__pyx_t_5) { __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_5); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 34; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; } else { __pyx_t_2 = __Pyx_PyObject_CallNoArg(__pyx_t_3); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 34; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "pygame_sdl2/mixer_music.pyx":35 * load(queued_music) * play() * queued_music = None # <<<<<<<<<<<<<< * * cdef SDL_Event e */ __Pyx_INCREF(Py_None); __Pyx_XGOTREF(__pyx_v_11pygame_sdl2_11mixer_music_queued_music); __Pyx_DECREF_SET(__pyx_v_11pygame_sdl2_11mixer_music_queued_music, Py_None); __Pyx_GIVEREF(Py_None); /* "pygame_sdl2/mixer_music.pyx":32 * cdef void music_finished(): * global queued_music * if queued_music: # <<<<<<<<<<<<<< * load(queued_music) * play() */ } /* "pygame_sdl2/mixer_music.pyx":38 * * cdef SDL_Event e * if endevent != 0: # <<<<<<<<<<<<<< * memset(&e, 0, sizeof(SDL_Event)) * e.type = endevent */ __pyx_t_1 = ((__pyx_v_11pygame_sdl2_11mixer_music_endevent != 0) != 0); if (__pyx_t_1) { /* "pygame_sdl2/mixer_music.pyx":39 * cdef SDL_Event e * if endevent != 0: * memset(&e, 0, sizeof(SDL_Event)) # <<<<<<<<<<<<<< * e.type = endevent * SDL_PushEvent(&e) */ memset((&__pyx_v_e), 0, (sizeof(SDL_Event))); /* "pygame_sdl2/mixer_music.pyx":40 * if endevent != 0: * memset(&e, 0, sizeof(SDL_Event)) * e.type = endevent # <<<<<<<<<<<<<< * SDL_PushEvent(&e) * */ __pyx_v_e.type = __pyx_v_11pygame_sdl2_11mixer_music_endevent; /* "pygame_sdl2/mixer_music.pyx":41 * memset(&e, 0, sizeof(SDL_Event)) * e.type = endevent * SDL_PushEvent(&e) # <<<<<<<<<<<<<< * * */ SDL_PushEvent((&__pyx_v_e)); /* "pygame_sdl2/mixer_music.pyx":38 * * cdef SDL_Event e * if endevent != 0: # <<<<<<<<<<<<<< * memset(&e, 0, sizeof(SDL_Event)) * e.type = endevent */ } /* "pygame_sdl2/mixer_music.pyx":30 * cdef int endevent = 0 * * cdef void music_finished(): # <<<<<<<<<<<<<< * global queued_music * if queued_music: */ /* function exit code */ goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_5); __Pyx_WriteUnraisable("pygame_sdl2.mixer_music.music_finished", __pyx_clineno, __pyx_lineno, __pyx_filename, 0, 0); __pyx_L0:; __Pyx_RefNannyFinishContext(); } /* "pygame_sdl2/mixer_music.pyx":44 * * * def load(fi): # <<<<<<<<<<<<<< * global current_music * */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_11mixer_music_1load(PyObject *__pyx_self, PyObject *__pyx_v_fi); /*proto*/ static PyMethodDef __pyx_mdef_11pygame_sdl2_11mixer_music_1load = {"load", (PyCFunction)__pyx_pw_11pygame_sdl2_11mixer_music_1load, METH_O, 0}; static PyObject *__pyx_pw_11pygame_sdl2_11mixer_music_1load(PyObject *__pyx_self, PyObject *__pyx_v_fi) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("load (wrapper)", 0); __pyx_r = __pyx_pf_11pygame_sdl2_11mixer_music_load(__pyx_self, ((PyObject *)__pyx_v_fi)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_11mixer_music_load(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_fi) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; SDL_RWops *__pyx_t_2; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; PyObject *__pyx_t_5 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("load", 0); /* "pygame_sdl2/mixer_music.pyx":48 * * # Free any previously loaded music. * if current_music != NULL: # <<<<<<<<<<<<<< * Mix_FreeMusic(current_music) * */ __pyx_t_1 = ((__pyx_v_11pygame_sdl2_11mixer_music_current_music != NULL) != 0); if (__pyx_t_1) { /* "pygame_sdl2/mixer_music.pyx":49 * # Free any previously loaded music. * if current_music != NULL: * Mix_FreeMusic(current_music) # <<<<<<<<<<<<<< * * current_music = Mix_LoadMUS_RW(to_rwops(fi), 1) */ Mix_FreeMusic(__pyx_v_11pygame_sdl2_11mixer_music_current_music); /* "pygame_sdl2/mixer_music.pyx":48 * * # Free any previously loaded music. * if current_music != NULL: # <<<<<<<<<<<<<< * Mix_FreeMusic(current_music) * */ } /* "pygame_sdl2/mixer_music.pyx":51 * Mix_FreeMusic(current_music) * * current_music = Mix_LoadMUS_RW(to_rwops(fi), 1) # <<<<<<<<<<<<<< * if current_music == NULL: * raise error() */ __pyx_t_2 = __pyx_f_11pygame_sdl2_8rwobject_to_rwops(__pyx_v_fi, NULL); if (unlikely(__pyx_t_2 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 51; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_v_11pygame_sdl2_11mixer_music_current_music = Mix_LoadMUS_RW(__pyx_t_2, 1); /* "pygame_sdl2/mixer_music.pyx":52 * * current_music = Mix_LoadMUS_RW(to_rwops(fi), 1) * if current_music == NULL: # <<<<<<<<<<<<<< * raise error() * */ __pyx_t_1 = ((__pyx_v_11pygame_sdl2_11mixer_music_current_music == NULL) != 0); if (__pyx_t_1) { /* "pygame_sdl2/mixer_music.pyx":53 * current_music = Mix_LoadMUS_RW(to_rwops(fi), 1) * if current_music == NULL: * raise error() # <<<<<<<<<<<<<< * * def play(loops=0, double start=0.0): */ __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_error); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 53; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); __pyx_t_5 = NULL; if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_4))) { __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4); if (likely(__pyx_t_5)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4); __Pyx_INCREF(__pyx_t_5); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_4, function); } } if (__pyx_t_5) { __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_5); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 53; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; } else { __pyx_t_3 = __Pyx_PyObject_CallNoArg(__pyx_t_4); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 53; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_Raise(__pyx_t_3, 0, 0, 0); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; {__pyx_filename = __pyx_f[0]; __pyx_lineno = 53; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "pygame_sdl2/mixer_music.pyx":52 * * current_music = Mix_LoadMUS_RW(to_rwops(fi), 1) * if current_music == NULL: # <<<<<<<<<<<<<< * raise error() * */ } /* "pygame_sdl2/mixer_music.pyx":44 * * * def load(fi): # <<<<<<<<<<<<<< * global current_music * */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_5); __Pyx_AddTraceback("pygame_sdl2.mixer_music.load", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/mixer_music.pyx":55 * raise error() * * def play(loops=0, double start=0.0): # <<<<<<<<<<<<<< * Mix_FadeInMusicPos(current_music, loops, 0, start) * */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_11mixer_music_3play(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static PyMethodDef __pyx_mdef_11pygame_sdl2_11mixer_music_3play = {"play", (PyCFunction)__pyx_pw_11pygame_sdl2_11mixer_music_3play, METH_VARARGS|METH_KEYWORDS, 0}; static PyObject *__pyx_pw_11pygame_sdl2_11mixer_music_3play(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_loops = 0; double __pyx_v_start; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("play (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_loops,&__pyx_n_s_start,0}; PyObject* values[2] = {0,0}; values[0] = ((PyObject *)__pyx_int_0); if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (kw_args > 0) { PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_loops); if (value) { values[0] = value; kw_args--; } } case 1: if (kw_args > 0) { PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_start); if (value) { values[1] = value; kw_args--; } } } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "play") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 55; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } } else { switch (PyTuple_GET_SIZE(__pyx_args)) { case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); case 0: break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_loops = values[0]; if (values[1]) { __pyx_v_start = __pyx_PyFloat_AsDouble(values[1]); if (unlikely((__pyx_v_start == (double)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 55; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } else { __pyx_v_start = ((double)0.0); } } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("play", 0, 0, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 55; __pyx_clineno = __LINE__; goto __pyx_L3_error;} __pyx_L3_error:; __Pyx_AddTraceback("pygame_sdl2.mixer_music.play", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_11pygame_sdl2_11mixer_music_2play(__pyx_self, __pyx_v_loops, __pyx_v_start); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_11mixer_music_2play(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_loops, double __pyx_v_start) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("play", 0); /* "pygame_sdl2/mixer_music.pyx":56 * * def play(loops=0, double start=0.0): * Mix_FadeInMusicPos(current_music, loops, 0, start) # <<<<<<<<<<<<<< * * def rewind(): */ __pyx_t_1 = __Pyx_PyInt_As_int(__pyx_v_loops); if (unlikely((__pyx_t_1 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 56; __pyx_clineno = __LINE__; goto __pyx_L1_error;} Mix_FadeInMusicPos(__pyx_v_11pygame_sdl2_11mixer_music_current_music, __pyx_t_1, 0, __pyx_v_start); /* "pygame_sdl2/mixer_music.pyx":55 * raise error() * * def play(loops=0, double start=0.0): # <<<<<<<<<<<<<< * Mix_FadeInMusicPos(current_music, loops, 0, start) * */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("pygame_sdl2.mixer_music.play", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/mixer_music.pyx":58 * Mix_FadeInMusicPos(current_music, loops, 0, start) * * def rewind(): # <<<<<<<<<<<<<< * Mix_RewindMusic() * */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_11mixer_music_5rewind(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused); /*proto*/ static PyObject *__pyx_pw_11pygame_sdl2_11mixer_music_5rewind(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("rewind (wrapper)", 0); __pyx_r = __pyx_pf_11pygame_sdl2_11mixer_music_4rewind(__pyx_self); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_11mixer_music_4rewind(CYTHON_UNUSED PyObject *__pyx_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("rewind", 0); /* "pygame_sdl2/mixer_music.pyx":59 * * def rewind(): * Mix_RewindMusic() # <<<<<<<<<<<<<< * * def stop(): */ Mix_RewindMusic(); /* "pygame_sdl2/mixer_music.pyx":58 * Mix_FadeInMusicPos(current_music, loops, 0, start) * * def rewind(): # <<<<<<<<<<<<<< * Mix_RewindMusic() * */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/mixer_music.pyx":61 * Mix_RewindMusic() * * def stop(): # <<<<<<<<<<<<<< * Mix_HaltMusic() * */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_11mixer_music_7stop(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused); /*proto*/ static PyMethodDef __pyx_mdef_11pygame_sdl2_11mixer_music_7stop = {"stop", (PyCFunction)__pyx_pw_11pygame_sdl2_11mixer_music_7stop, METH_NOARGS, 0}; static PyObject *__pyx_pw_11pygame_sdl2_11mixer_music_7stop(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("stop (wrapper)", 0); __pyx_r = __pyx_pf_11pygame_sdl2_11mixer_music_6stop(__pyx_self); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_11mixer_music_6stop(CYTHON_UNUSED PyObject *__pyx_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("stop", 0); /* "pygame_sdl2/mixer_music.pyx":62 * * def stop(): * Mix_HaltMusic() # <<<<<<<<<<<<<< * * def pause(): */ Mix_HaltMusic(); /* "pygame_sdl2/mixer_music.pyx":61 * Mix_RewindMusic() * * def stop(): # <<<<<<<<<<<<<< * Mix_HaltMusic() * */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/mixer_music.pyx":64 * Mix_HaltMusic() * * def pause(): # <<<<<<<<<<<<<< * Mix_PauseMusic() * */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_11mixer_music_9pause(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused); /*proto*/ static PyMethodDef __pyx_mdef_11pygame_sdl2_11mixer_music_9pause = {"pause", (PyCFunction)__pyx_pw_11pygame_sdl2_11mixer_music_9pause, METH_NOARGS, 0}; static PyObject *__pyx_pw_11pygame_sdl2_11mixer_music_9pause(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("pause (wrapper)", 0); __pyx_r = __pyx_pf_11pygame_sdl2_11mixer_music_8pause(__pyx_self); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_11mixer_music_8pause(CYTHON_UNUSED PyObject *__pyx_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("pause", 0); /* "pygame_sdl2/mixer_music.pyx":65 * * def pause(): * Mix_PauseMusic() # <<<<<<<<<<<<<< * * def unpause(): */ Mix_PauseMusic(); /* "pygame_sdl2/mixer_music.pyx":64 * Mix_HaltMusic() * * def pause(): # <<<<<<<<<<<<<< * Mix_PauseMusic() * */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/mixer_music.pyx":67 * Mix_PauseMusic() * * def unpause(): # <<<<<<<<<<<<<< * Mix_ResumeMusic() * */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_11mixer_music_11unpause(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused); /*proto*/ static PyMethodDef __pyx_mdef_11pygame_sdl2_11mixer_music_11unpause = {"unpause", (PyCFunction)__pyx_pw_11pygame_sdl2_11mixer_music_11unpause, METH_NOARGS, 0}; static PyObject *__pyx_pw_11pygame_sdl2_11mixer_music_11unpause(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("unpause (wrapper)", 0); __pyx_r = __pyx_pf_11pygame_sdl2_11mixer_music_10unpause(__pyx_self); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_11mixer_music_10unpause(CYTHON_UNUSED PyObject *__pyx_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("unpause", 0); /* "pygame_sdl2/mixer_music.pyx":68 * * def unpause(): * Mix_ResumeMusic() # <<<<<<<<<<<<<< * * def fadeout(time): */ Mix_ResumeMusic(); /* "pygame_sdl2/mixer_music.pyx":67 * Mix_PauseMusic() * * def unpause(): # <<<<<<<<<<<<<< * Mix_ResumeMusic() * */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/mixer_music.pyx":70 * Mix_ResumeMusic() * * def fadeout(time): # <<<<<<<<<<<<<< * Mix_FadeOutMusic(time) * */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_11mixer_music_13fadeout(PyObject *__pyx_self, PyObject *__pyx_v_time); /*proto*/ static PyMethodDef __pyx_mdef_11pygame_sdl2_11mixer_music_13fadeout = {"fadeout", (PyCFunction)__pyx_pw_11pygame_sdl2_11mixer_music_13fadeout, METH_O, 0}; static PyObject *__pyx_pw_11pygame_sdl2_11mixer_music_13fadeout(PyObject *__pyx_self, PyObject *__pyx_v_time) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("fadeout (wrapper)", 0); __pyx_r = __pyx_pf_11pygame_sdl2_11mixer_music_12fadeout(__pyx_self, ((PyObject *)__pyx_v_time)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_11mixer_music_12fadeout(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_time) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("fadeout", 0); /* "pygame_sdl2/mixer_music.pyx":71 * * def fadeout(time): * Mix_FadeOutMusic(time) # <<<<<<<<<<<<<< * * def set_volume(double value): */ __pyx_t_1 = __Pyx_PyInt_As_int(__pyx_v_time); if (unlikely((__pyx_t_1 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 71; __pyx_clineno = __LINE__; goto __pyx_L1_error;} Mix_FadeOutMusic(__pyx_t_1); /* "pygame_sdl2/mixer_music.pyx":70 * Mix_ResumeMusic() * * def fadeout(time): # <<<<<<<<<<<<<< * Mix_FadeOutMusic(time) * */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("pygame_sdl2.mixer_music.fadeout", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/mixer_music.pyx":73 * Mix_FadeOutMusic(time) * * def set_volume(double value): # <<<<<<<<<<<<<< * Mix_VolumeMusic((MIX_MAX_VOLUME * value)) * */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_11mixer_music_15set_volume(PyObject *__pyx_self, PyObject *__pyx_arg_value); /*proto*/ static PyMethodDef __pyx_mdef_11pygame_sdl2_11mixer_music_15set_volume = {"set_volume", (PyCFunction)__pyx_pw_11pygame_sdl2_11mixer_music_15set_volume, METH_O, 0}; static PyObject *__pyx_pw_11pygame_sdl2_11mixer_music_15set_volume(PyObject *__pyx_self, PyObject *__pyx_arg_value) { double __pyx_v_value; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("set_volume (wrapper)", 0); assert(__pyx_arg_value); { __pyx_v_value = __pyx_PyFloat_AsDouble(__pyx_arg_value); if (unlikely((__pyx_v_value == (double)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 73; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; __Pyx_AddTraceback("pygame_sdl2.mixer_music.set_volume", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_11pygame_sdl2_11mixer_music_14set_volume(__pyx_self, ((double)__pyx_v_value)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_11mixer_music_14set_volume(CYTHON_UNUSED PyObject *__pyx_self, double __pyx_v_value) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("set_volume", 0); /* "pygame_sdl2/mixer_music.pyx":74 * * def set_volume(double value): * Mix_VolumeMusic((MIX_MAX_VOLUME * value)) # <<<<<<<<<<<<<< * * def get_volume(): */ Mix_VolumeMusic(((int)(MIX_MAX_VOLUME * __pyx_v_value))); /* "pygame_sdl2/mixer_music.pyx":73 * Mix_FadeOutMusic(time) * * def set_volume(double value): # <<<<<<<<<<<<<< * Mix_VolumeMusic((MIX_MAX_VOLUME * value)) * */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/mixer_music.pyx":76 * Mix_VolumeMusic((MIX_MAX_VOLUME * value)) * * def get_volume(): # <<<<<<<<<<<<<< * return Mix_VolumeMusic(-1) / MIX_MAX_VOLUME * */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_11mixer_music_17get_volume(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused); /*proto*/ static PyMethodDef __pyx_mdef_11pygame_sdl2_11mixer_music_17get_volume = {"get_volume", (PyCFunction)__pyx_pw_11pygame_sdl2_11mixer_music_17get_volume, METH_NOARGS, 0}; static PyObject *__pyx_pw_11pygame_sdl2_11mixer_music_17get_volume(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("get_volume (wrapper)", 0); __pyx_r = __pyx_pf_11pygame_sdl2_11mixer_music_16get_volume(__pyx_self); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_11mixer_music_16get_volume(CYTHON_UNUSED PyObject *__pyx_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; PyObject *__pyx_t_2 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("get_volume", 0); /* "pygame_sdl2/mixer_music.pyx":77 * * def get_volume(): * return Mix_VolumeMusic(-1) / MIX_MAX_VOLUME # <<<<<<<<<<<<<< * * def get_busy(): */ __Pyx_XDECREF(__pyx_r); __pyx_t_1 = Mix_VolumeMusic(-1); if (unlikely(((double)MIX_MAX_VOLUME) == 0)) { PyErr_SetString(PyExc_ZeroDivisionError, "float division"); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 77; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } __pyx_t_2 = PyFloat_FromDouble((__pyx_t_1 / ((double)MIX_MAX_VOLUME))); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 77; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; /* "pygame_sdl2/mixer_music.pyx":76 * Mix_VolumeMusic((MIX_MAX_VOLUME * value)) * * def get_volume(): # <<<<<<<<<<<<<< * return Mix_VolumeMusic(-1) / MIX_MAX_VOLUME * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_AddTraceback("pygame_sdl2.mixer_music.get_volume", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/mixer_music.pyx":79 * return Mix_VolumeMusic(-1) / MIX_MAX_VOLUME * * def get_busy(): # <<<<<<<<<<<<<< * return Mix_PlayingMusic() * */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_11mixer_music_19get_busy(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused); /*proto*/ static PyMethodDef __pyx_mdef_11pygame_sdl2_11mixer_music_19get_busy = {"get_busy", (PyCFunction)__pyx_pw_11pygame_sdl2_11mixer_music_19get_busy, METH_NOARGS, 0}; static PyObject *__pyx_pw_11pygame_sdl2_11mixer_music_19get_busy(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("get_busy (wrapper)", 0); __pyx_r = __pyx_pf_11pygame_sdl2_11mixer_music_18get_busy(__pyx_self); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_11mixer_music_18get_busy(CYTHON_UNUSED PyObject *__pyx_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("get_busy", 0); /* "pygame_sdl2/mixer_music.pyx":80 * * def get_busy(): * return Mix_PlayingMusic() # <<<<<<<<<<<<<< * * def set_pos(double pos): */ __Pyx_XDECREF(__pyx_r); __pyx_t_1 = __Pyx_PyInt_From_int(Mix_PlayingMusic()); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 80; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "pygame_sdl2/mixer_music.pyx":79 * return Mix_VolumeMusic(-1) / MIX_MAX_VOLUME * * def get_busy(): # <<<<<<<<<<<<<< * return Mix_PlayingMusic() * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("pygame_sdl2.mixer_music.get_busy", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/mixer_music.pyx":82 * return Mix_PlayingMusic() * * def set_pos(double pos): # <<<<<<<<<<<<<< * Mix_SetMusicPosition(pos) * */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_11mixer_music_21set_pos(PyObject *__pyx_self, PyObject *__pyx_arg_pos); /*proto*/ static PyMethodDef __pyx_mdef_11pygame_sdl2_11mixer_music_21set_pos = {"set_pos", (PyCFunction)__pyx_pw_11pygame_sdl2_11mixer_music_21set_pos, METH_O, 0}; static PyObject *__pyx_pw_11pygame_sdl2_11mixer_music_21set_pos(PyObject *__pyx_self, PyObject *__pyx_arg_pos) { double __pyx_v_pos; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("set_pos (wrapper)", 0); assert(__pyx_arg_pos); { __pyx_v_pos = __pyx_PyFloat_AsDouble(__pyx_arg_pos); if (unlikely((__pyx_v_pos == (double)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 82; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; __Pyx_AddTraceback("pygame_sdl2.mixer_music.set_pos", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_11pygame_sdl2_11mixer_music_20set_pos(__pyx_self, ((double)__pyx_v_pos)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_11mixer_music_20set_pos(CYTHON_UNUSED PyObject *__pyx_self, double __pyx_v_pos) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("set_pos", 0); /* "pygame_sdl2/mixer_music.pyx":83 * * def set_pos(double pos): * Mix_SetMusicPosition(pos) # <<<<<<<<<<<<<< * * def get_pos(): */ Mix_SetMusicPosition(__pyx_v_pos); /* "pygame_sdl2/mixer_music.pyx":82 * return Mix_PlayingMusic() * * def set_pos(double pos): # <<<<<<<<<<<<<< * Mix_SetMusicPosition(pos) * */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/mixer_music.pyx":85 * Mix_SetMusicPosition(pos) * * def get_pos(): # <<<<<<<<<<<<<< * # TODO: Use a Mix_SetPostMix callback to track position. * raise error("Not implemented.") */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_11mixer_music_23get_pos(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused); /*proto*/ static PyMethodDef __pyx_mdef_11pygame_sdl2_11mixer_music_23get_pos = {"get_pos", (PyCFunction)__pyx_pw_11pygame_sdl2_11mixer_music_23get_pos, METH_NOARGS, 0}; static PyObject *__pyx_pw_11pygame_sdl2_11mixer_music_23get_pos(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("get_pos (wrapper)", 0); __pyx_r = __pyx_pf_11pygame_sdl2_11mixer_music_22get_pos(__pyx_self); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_11mixer_music_22get_pos(CYTHON_UNUSED PyObject *__pyx_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("get_pos", 0); /* "pygame_sdl2/mixer_music.pyx":87 * def get_pos(): * # TODO: Use a Mix_SetPostMix callback to track position. * raise error("Not implemented.") # <<<<<<<<<<<<<< * * def queue(fi): */ __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_error); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 87; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_tuple_, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 87; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_Raise(__pyx_t_2, 0, 0, 0); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; {__pyx_filename = __pyx_f[0]; __pyx_lineno = 87; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "pygame_sdl2/mixer_music.pyx":85 * Mix_SetMusicPosition(pos) * * def get_pos(): # <<<<<<<<<<<<<< * # TODO: Use a Mix_SetPostMix callback to track position. * raise error("Not implemented.") */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_AddTraceback("pygame_sdl2.mixer_music.get_pos", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/mixer_music.pyx":89 * raise error("Not implemented.") * * def queue(fi): # <<<<<<<<<<<<<< * Mix_HookMusicFinished(music_finished) * if get_busy(): */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_11mixer_music_25queue(PyObject *__pyx_self, PyObject *__pyx_v_fi); /*proto*/ static PyMethodDef __pyx_mdef_11pygame_sdl2_11mixer_music_25queue = {"queue", (PyCFunction)__pyx_pw_11pygame_sdl2_11mixer_music_25queue, METH_O, 0}; static PyObject *__pyx_pw_11pygame_sdl2_11mixer_music_25queue(PyObject *__pyx_self, PyObject *__pyx_v_fi) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("queue (wrapper)", 0); __pyx_r = __pyx_pf_11pygame_sdl2_11mixer_music_24queue(__pyx_self, ((PyObject *)__pyx_v_fi)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_11mixer_music_24queue(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_fi) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; int __pyx_t_4; PyObject *__pyx_t_5 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("queue", 0); /* "pygame_sdl2/mixer_music.pyx":90 * * def queue(fi): * Mix_HookMusicFinished(music_finished) # <<<<<<<<<<<<<< * if get_busy(): * global queued_music */ Mix_HookMusicFinished(__pyx_f_11pygame_sdl2_11mixer_music_music_finished); /* "pygame_sdl2/mixer_music.pyx":91 * def queue(fi): * Mix_HookMusicFinished(music_finished) * if get_busy(): # <<<<<<<<<<<<<< * global queued_music * queued_music = fi */ __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_get_busy); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 91; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = NULL; if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_2))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); if (likely(__pyx_t_3)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); } } if (__pyx_t_3) { __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 91; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } else { __pyx_t_1 = __Pyx_PyObject_CallNoArg(__pyx_t_2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 91; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_4 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 91; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (__pyx_t_4) { /* "pygame_sdl2/mixer_music.pyx":93 * if get_busy(): * global queued_music * queued_music = fi # <<<<<<<<<<<<<< * else: * load(fi) */ __Pyx_INCREF(__pyx_v_fi); __Pyx_XGOTREF(__pyx_v_11pygame_sdl2_11mixer_music_queued_music); __Pyx_DECREF_SET(__pyx_v_11pygame_sdl2_11mixer_music_queued_music, __pyx_v_fi); __Pyx_GIVEREF(__pyx_v_fi); /* "pygame_sdl2/mixer_music.pyx":91 * def queue(fi): * Mix_HookMusicFinished(music_finished) * if get_busy(): # <<<<<<<<<<<<<< * global queued_music * queued_music = fi */ goto __pyx_L3; } /* "pygame_sdl2/mixer_music.pyx":95 * queued_music = fi * else: * load(fi) # <<<<<<<<<<<<<< * play() * */ /*else*/ { __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_load); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 95; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = NULL; if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_2))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); if (likely(__pyx_t_3)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); } } if (!__pyx_t_3) { __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_v_fi); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 95; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); } else { __pyx_t_5 = PyTuple_New(1+1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 95; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_3); __pyx_t_3 = NULL; __Pyx_INCREF(__pyx_v_fi); __Pyx_GIVEREF(__pyx_v_fi); PyTuple_SET_ITEM(__pyx_t_5, 0+1, __pyx_v_fi); __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_5, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 95; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; } __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "pygame_sdl2/mixer_music.pyx":96 * else: * load(fi) * play() # <<<<<<<<<<<<<< * * def set_endevent(type=None): */ __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_play); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 96; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __pyx_t_5 = NULL; if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_2))) { __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_2); if (likely(__pyx_t_5)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_5); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); } } if (__pyx_t_5) { __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_5); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 96; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; } else { __pyx_t_1 = __Pyx_PyObject_CallNoArg(__pyx_t_2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 96; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; } __pyx_L3:; /* "pygame_sdl2/mixer_music.pyx":89 * raise error("Not implemented.") * * def queue(fi): # <<<<<<<<<<<<<< * Mix_HookMusicFinished(music_finished) * if get_busy(): */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_5); __Pyx_AddTraceback("pygame_sdl2.mixer_music.queue", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/mixer_music.pyx":98 * play() * * def set_endevent(type=None): # <<<<<<<<<<<<<< * Mix_HookMusicFinished(music_finished) * global endevent */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_11mixer_music_27set_endevent(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static PyMethodDef __pyx_mdef_11pygame_sdl2_11mixer_music_27set_endevent = {"set_endevent", (PyCFunction)__pyx_pw_11pygame_sdl2_11mixer_music_27set_endevent, METH_VARARGS|METH_KEYWORDS, 0}; static PyObject *__pyx_pw_11pygame_sdl2_11mixer_music_27set_endevent(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_type = 0; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("set_endevent (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_type,0}; PyObject* values[1] = {0}; values[0] = ((PyObject *)Py_None); if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (kw_args > 0) { PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_type); if (value) { values[0] = value; kw_args--; } } } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "set_endevent") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 98; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } } else { switch (PyTuple_GET_SIZE(__pyx_args)) { case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); case 0: break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_type = values[0]; } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("set_endevent", 0, 0, 1, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 98; __pyx_clineno = __LINE__; goto __pyx_L3_error;} __pyx_L3_error:; __Pyx_AddTraceback("pygame_sdl2.mixer_music.set_endevent", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_11pygame_sdl2_11mixer_music_26set_endevent(__pyx_self, __pyx_v_type); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_11mixer_music_26set_endevent(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_type) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; int __pyx_t_2; int __pyx_t_3; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("set_endevent", 0); /* "pygame_sdl2/mixer_music.pyx":99 * * def set_endevent(type=None): * Mix_HookMusicFinished(music_finished) # <<<<<<<<<<<<<< * global endevent * endevent = type or 0 */ Mix_HookMusicFinished(__pyx_f_11pygame_sdl2_11mixer_music_music_finished); /* "pygame_sdl2/mixer_music.pyx":101 * Mix_HookMusicFinished(music_finished) * global endevent * endevent = type or 0 # <<<<<<<<<<<<<< * * def get_endevent(): */ __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_v_type); if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 101; __pyx_clineno = __LINE__; goto __pyx_L1_error;} if (!__pyx_t_2) { } else { __pyx_t_3 = __Pyx_PyInt_As_int(__pyx_v_type); if (unlikely((__pyx_t_3 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 101; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_t_1 = __pyx_t_3; goto __pyx_L3_bool_binop_done; } __pyx_t_1 = 0; __pyx_L3_bool_binop_done:; __pyx_v_11pygame_sdl2_11mixer_music_endevent = __pyx_t_1; /* "pygame_sdl2/mixer_music.pyx":98 * play() * * def set_endevent(type=None): # <<<<<<<<<<<<<< * Mix_HookMusicFinished(music_finished) * global endevent */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("pygame_sdl2.mixer_music.set_endevent", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/mixer_music.pyx":103 * endevent = type or 0 * * def get_endevent(): # <<<<<<<<<<<<<< * return endevent */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_11mixer_music_29get_endevent(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused); /*proto*/ static PyMethodDef __pyx_mdef_11pygame_sdl2_11mixer_music_29get_endevent = {"get_endevent", (PyCFunction)__pyx_pw_11pygame_sdl2_11mixer_music_29get_endevent, METH_NOARGS, 0}; static PyObject *__pyx_pw_11pygame_sdl2_11mixer_music_29get_endevent(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("get_endevent (wrapper)", 0); __pyx_r = __pyx_pf_11pygame_sdl2_11mixer_music_28get_endevent(__pyx_self); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_11mixer_music_28get_endevent(CYTHON_UNUSED PyObject *__pyx_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("get_endevent", 0); /* "pygame_sdl2/mixer_music.pyx":104 * * def get_endevent(): * return endevent # <<<<<<<<<<<<<< */ __Pyx_XDECREF(__pyx_r); __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_11pygame_sdl2_11mixer_music_endevent); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 104; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "pygame_sdl2/mixer_music.pyx":103 * endevent = type or 0 * * def get_endevent(): # <<<<<<<<<<<<<< * return endevent */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("pygame_sdl2.mixer_music.get_endevent", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyMethodDef __pyx_methods[] = { {"rewind", (PyCFunction)__pyx_pw_11pygame_sdl2_11mixer_music_5rewind, METH_NOARGS, 0}, {0, 0, 0, 0} }; #if PY_MAJOR_VERSION >= 3 static struct PyModuleDef __pyx_moduledef = { #if PY_VERSION_HEX < 0x03020000 { PyObject_HEAD_INIT(NULL) NULL, 0, NULL }, #else PyModuleDef_HEAD_INIT, #endif "mixer_music", 0, /* m_doc */ -1, /* m_size */ __pyx_methods /* m_methods */, NULL, /* m_reload */ NULL, /* m_traverse */ NULL, /* m_clear */ NULL /* m_free */ }; #endif static __Pyx_StringTabEntry __pyx_string_tab[] = { {&__pyx_kp_s_Not_implemented, __pyx_k_Not_implemented, sizeof(__pyx_k_Not_implemented), 0, 0, 1, 0}, {&__pyx_n_s_error, __pyx_k_error, sizeof(__pyx_k_error), 0, 0, 1, 1}, {&__pyx_n_s_fadeout, __pyx_k_fadeout, sizeof(__pyx_k_fadeout), 0, 0, 1, 1}, {&__pyx_n_s_fi, __pyx_k_fi, sizeof(__pyx_k_fi), 0, 0, 1, 1}, {&__pyx_n_s_get_busy, __pyx_k_get_busy, sizeof(__pyx_k_get_busy), 0, 0, 1, 1}, {&__pyx_n_s_get_endevent, __pyx_k_get_endevent, sizeof(__pyx_k_get_endevent), 0, 0, 1, 1}, {&__pyx_n_s_get_pos, __pyx_k_get_pos, sizeof(__pyx_k_get_pos), 0, 0, 1, 1}, {&__pyx_n_s_get_volume, __pyx_k_get_volume, sizeof(__pyx_k_get_volume), 0, 0, 1, 1}, {&__pyx_kp_s_home_tom_ab_pygame_sdl2_src_pyg, __pyx_k_home_tom_ab_pygame_sdl2_src_pyg, sizeof(__pyx_k_home_tom_ab_pygame_sdl2_src_pyg), 0, 0, 1, 0}, {&__pyx_n_s_import, __pyx_k_import, sizeof(__pyx_k_import), 0, 0, 1, 1}, {&__pyx_n_s_load, __pyx_k_load, sizeof(__pyx_k_load), 0, 0, 1, 1}, {&__pyx_n_s_loops, __pyx_k_loops, sizeof(__pyx_k_loops), 0, 0, 1, 1}, {&__pyx_n_s_main, __pyx_k_main, sizeof(__pyx_k_main), 0, 0, 1, 1}, {&__pyx_n_s_pause, __pyx_k_pause, sizeof(__pyx_k_pause), 0, 0, 1, 1}, {&__pyx_n_s_play, __pyx_k_play, sizeof(__pyx_k_play), 0, 0, 1, 1}, {&__pyx_n_s_pos, __pyx_k_pos, sizeof(__pyx_k_pos), 0, 0, 1, 1}, {&__pyx_n_s_pygame_sdl2_error, __pyx_k_pygame_sdl2_error, sizeof(__pyx_k_pygame_sdl2_error), 0, 0, 1, 1}, {&__pyx_n_s_pygame_sdl2_mixer_music, __pyx_k_pygame_sdl2_mixer_music, sizeof(__pyx_k_pygame_sdl2_mixer_music), 0, 0, 1, 1}, {&__pyx_n_s_queue, __pyx_k_queue, sizeof(__pyx_k_queue), 0, 0, 1, 1}, {&__pyx_n_s_set_endevent, __pyx_k_set_endevent, sizeof(__pyx_k_set_endevent), 0, 0, 1, 1}, {&__pyx_n_s_set_pos, __pyx_k_set_pos, sizeof(__pyx_k_set_pos), 0, 0, 1, 1}, {&__pyx_n_s_set_volume, __pyx_k_set_volume, sizeof(__pyx_k_set_volume), 0, 0, 1, 1}, {&__pyx_n_s_start, __pyx_k_start, sizeof(__pyx_k_start), 0, 0, 1, 1}, {&__pyx_n_s_stop, __pyx_k_stop, sizeof(__pyx_k_stop), 0, 0, 1, 1}, {&__pyx_n_s_test, __pyx_k_test, sizeof(__pyx_k_test), 0, 0, 1, 1}, {&__pyx_n_s_time, __pyx_k_time, sizeof(__pyx_k_time), 0, 0, 1, 1}, {&__pyx_n_s_type, __pyx_k_type, sizeof(__pyx_k_type), 0, 0, 1, 1}, {&__pyx_n_s_unpause, __pyx_k_unpause, sizeof(__pyx_k_unpause), 0, 0, 1, 1}, {&__pyx_n_s_value, __pyx_k_value, sizeof(__pyx_k_value), 0, 0, 1, 1}, {0, 0, 0, 0, 0, 0, 0} }; static int __Pyx_InitCachedBuiltins(void) { return 0; } static int __Pyx_InitCachedConstants(void) { __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__Pyx_InitCachedConstants", 0); /* "pygame_sdl2/mixer_music.pyx":87 * def get_pos(): * # TODO: Use a Mix_SetPostMix callback to track position. * raise error("Not implemented.") # <<<<<<<<<<<<<< * * def queue(fi): */ __pyx_tuple_ = PyTuple_Pack(1, __pyx_kp_s_Not_implemented); if (unlikely(!__pyx_tuple_)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 87; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_tuple_); __Pyx_GIVEREF(__pyx_tuple_); /* "pygame_sdl2/mixer_music.pyx":44 * * * def load(fi): # <<<<<<<<<<<<<< * global current_music * */ __pyx_tuple__2 = PyTuple_Pack(1, __pyx_n_s_fi); if (unlikely(!__pyx_tuple__2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 44; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_tuple__2); __Pyx_GIVEREF(__pyx_tuple__2); __pyx_codeobj__3 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__2, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_tom_ab_pygame_sdl2_src_pyg, __pyx_n_s_load, 44, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 44; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "pygame_sdl2/mixer_music.pyx":55 * raise error() * * def play(loops=0, double start=0.0): # <<<<<<<<<<<<<< * Mix_FadeInMusicPos(current_music, loops, 0, start) * */ __pyx_tuple__4 = PyTuple_Pack(2, __pyx_n_s_loops, __pyx_n_s_start); if (unlikely(!__pyx_tuple__4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 55; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_tuple__4); __Pyx_GIVEREF(__pyx_tuple__4); __pyx_codeobj__5 = (PyObject*)__Pyx_PyCode_New(2, 0, 2, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__4, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_tom_ab_pygame_sdl2_src_pyg, __pyx_n_s_play, 55, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 55; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "pygame_sdl2/mixer_music.pyx":61 * Mix_RewindMusic() * * def stop(): # <<<<<<<<<<<<<< * Mix_HaltMusic() * */ __pyx_codeobj__6 = (PyObject*)__Pyx_PyCode_New(0, 0, 0, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_tom_ab_pygame_sdl2_src_pyg, __pyx_n_s_stop, 61, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 61; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "pygame_sdl2/mixer_music.pyx":64 * Mix_HaltMusic() * * def pause(): # <<<<<<<<<<<<<< * Mix_PauseMusic() * */ __pyx_codeobj__7 = (PyObject*)__Pyx_PyCode_New(0, 0, 0, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_tom_ab_pygame_sdl2_src_pyg, __pyx_n_s_pause, 64, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 64; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "pygame_sdl2/mixer_music.pyx":67 * Mix_PauseMusic() * * def unpause(): # <<<<<<<<<<<<<< * Mix_ResumeMusic() * */ __pyx_codeobj__8 = (PyObject*)__Pyx_PyCode_New(0, 0, 0, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_tom_ab_pygame_sdl2_src_pyg, __pyx_n_s_unpause, 67, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 67; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "pygame_sdl2/mixer_music.pyx":70 * Mix_ResumeMusic() * * def fadeout(time): # <<<<<<<<<<<<<< * Mix_FadeOutMusic(time) * */ __pyx_tuple__9 = PyTuple_Pack(1, __pyx_n_s_time); if (unlikely(!__pyx_tuple__9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 70; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_tuple__9); __Pyx_GIVEREF(__pyx_tuple__9); __pyx_codeobj__10 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__9, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_tom_ab_pygame_sdl2_src_pyg, __pyx_n_s_fadeout, 70, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 70; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "pygame_sdl2/mixer_music.pyx":73 * Mix_FadeOutMusic(time) * * def set_volume(double value): # <<<<<<<<<<<<<< * Mix_VolumeMusic((MIX_MAX_VOLUME * value)) * */ __pyx_tuple__11 = PyTuple_Pack(2, __pyx_n_s_value, __pyx_n_s_value); if (unlikely(!__pyx_tuple__11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 73; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_tuple__11); __Pyx_GIVEREF(__pyx_tuple__11); __pyx_codeobj__12 = (PyObject*)__Pyx_PyCode_New(1, 0, 2, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__11, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_tom_ab_pygame_sdl2_src_pyg, __pyx_n_s_set_volume, 73, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__12)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 73; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "pygame_sdl2/mixer_music.pyx":76 * Mix_VolumeMusic((MIX_MAX_VOLUME * value)) * * def get_volume(): # <<<<<<<<<<<<<< * return Mix_VolumeMusic(-1) / MIX_MAX_VOLUME * */ __pyx_codeobj__13 = (PyObject*)__Pyx_PyCode_New(0, 0, 0, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_tom_ab_pygame_sdl2_src_pyg, __pyx_n_s_get_volume, 76, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__13)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 76; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "pygame_sdl2/mixer_music.pyx":79 * return Mix_VolumeMusic(-1) / MIX_MAX_VOLUME * * def get_busy(): # <<<<<<<<<<<<<< * return Mix_PlayingMusic() * */ __pyx_codeobj__14 = (PyObject*)__Pyx_PyCode_New(0, 0, 0, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_tom_ab_pygame_sdl2_src_pyg, __pyx_n_s_get_busy, 79, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__14)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 79; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "pygame_sdl2/mixer_music.pyx":82 * return Mix_PlayingMusic() * * def set_pos(double pos): # <<<<<<<<<<<<<< * Mix_SetMusicPosition(pos) * */ __pyx_tuple__15 = PyTuple_Pack(2, __pyx_n_s_pos, __pyx_n_s_pos); if (unlikely(!__pyx_tuple__15)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 82; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_tuple__15); __Pyx_GIVEREF(__pyx_tuple__15); __pyx_codeobj__16 = (PyObject*)__Pyx_PyCode_New(1, 0, 2, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__15, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_tom_ab_pygame_sdl2_src_pyg, __pyx_n_s_set_pos, 82, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__16)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 82; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "pygame_sdl2/mixer_music.pyx":85 * Mix_SetMusicPosition(pos) * * def get_pos(): # <<<<<<<<<<<<<< * # TODO: Use a Mix_SetPostMix callback to track position. * raise error("Not implemented.") */ __pyx_codeobj__17 = (PyObject*)__Pyx_PyCode_New(0, 0, 0, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_tom_ab_pygame_sdl2_src_pyg, __pyx_n_s_get_pos, 85, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__17)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 85; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "pygame_sdl2/mixer_music.pyx":89 * raise error("Not implemented.") * * def queue(fi): # <<<<<<<<<<<<<< * Mix_HookMusicFinished(music_finished) * if get_busy(): */ __pyx_tuple__18 = PyTuple_Pack(1, __pyx_n_s_fi); if (unlikely(!__pyx_tuple__18)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 89; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_tuple__18); __Pyx_GIVEREF(__pyx_tuple__18); __pyx_codeobj__19 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__18, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_tom_ab_pygame_sdl2_src_pyg, __pyx_n_s_queue, 89, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__19)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 89; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "pygame_sdl2/mixer_music.pyx":98 * play() * * def set_endevent(type=None): # <<<<<<<<<<<<<< * Mix_HookMusicFinished(music_finished) * global endevent */ __pyx_tuple__20 = PyTuple_Pack(1, __pyx_n_s_type); if (unlikely(!__pyx_tuple__20)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 98; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_tuple__20); __Pyx_GIVEREF(__pyx_tuple__20); __pyx_codeobj__21 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__20, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_tom_ab_pygame_sdl2_src_pyg, __pyx_n_s_set_endevent, 98, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__21)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 98; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "pygame_sdl2/mixer_music.pyx":103 * endevent = type or 0 * * def get_endevent(): # <<<<<<<<<<<<<< * return endevent */ __pyx_codeobj__22 = (PyObject*)__Pyx_PyCode_New(0, 0, 0, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_tom_ab_pygame_sdl2_src_pyg, __pyx_n_s_get_endevent, 103, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__22)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 103; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_RefNannyFinishContext(); return 0; __pyx_L1_error:; __Pyx_RefNannyFinishContext(); return -1; } static int __Pyx_InitGlobals(void) { if (__Pyx_InitStrings(__pyx_string_tab) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; __pyx_int_0 = PyInt_FromLong(0); if (unlikely(!__pyx_int_0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} return 0; __pyx_L1_error:; return -1; } #if PY_MAJOR_VERSION < 3 PyMODINIT_FUNC initmixer_music(void); /*proto*/ PyMODINIT_FUNC initmixer_music(void) #else PyMODINIT_FUNC PyInit_mixer_music(void); /*proto*/ PyMODINIT_FUNC PyInit_mixer_music(void) #endif { PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannyDeclarations #if CYTHON_REFNANNY __Pyx_RefNanny = __Pyx_RefNannyImportAPI("refnanny"); if (!__Pyx_RefNanny) { PyErr_Clear(); __Pyx_RefNanny = __Pyx_RefNannyImportAPI("Cython.Runtime.refnanny"); if (!__Pyx_RefNanny) Py_FatalError("failed to import 'refnanny' module"); } #endif __Pyx_RefNannySetupContext("PyMODINIT_FUNC PyInit_mixer_music(void)", 0); if (__Pyx_check_binary_version() < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_empty_tuple = PyTuple_New(0); if (unlikely(!__pyx_empty_tuple)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_empty_bytes = PyBytes_FromStringAndSize("", 0); if (unlikely(!__pyx_empty_bytes)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} #ifdef __Pyx_CyFunction_USED if (__pyx_CyFunction_init() < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} #endif #ifdef __Pyx_FusedFunction_USED if (__pyx_FusedFunction_init() < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} #endif #ifdef __Pyx_Coroutine_USED if (__pyx_Coroutine_init() < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} #endif #ifdef __Pyx_Generator_USED if (__pyx_Generator_init() < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} #endif #ifdef __Pyx_StopAsyncIteration_USED if (__pyx_StopAsyncIteration_init() < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} #endif /*--- Library function declarations ---*/ /*--- Threads initialization code ---*/ #if defined(__PYX_FORCE_INIT_THREADS) && __PYX_FORCE_INIT_THREADS #ifdef WITH_THREAD /* Python build with threading support? */ PyEval_InitThreads(); #endif #endif /*--- Module creation code ---*/ #if PY_MAJOR_VERSION < 3 __pyx_m = Py_InitModule4("mixer_music", __pyx_methods, 0, 0, PYTHON_API_VERSION); Py_XINCREF(__pyx_m); #else __pyx_m = PyModule_Create(&__pyx_moduledef); #endif if (unlikely(!__pyx_m)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_d = PyModule_GetDict(__pyx_m); if (unlikely(!__pyx_d)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} Py_INCREF(__pyx_d); __pyx_b = PyImport_AddModule(__Pyx_BUILTIN_MODULE_NAME); if (unlikely(!__pyx_b)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} #if CYTHON_COMPILING_IN_PYPY Py_INCREF(__pyx_b); #endif if (PyObject_SetAttrString(__pyx_m, "__builtins__", __pyx_b) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; /*--- Initialize various global constants etc. ---*/ if (__Pyx_InitGlobals() < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} #if PY_MAJOR_VERSION < 3 && (__PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT) if (__Pyx_init_sys_getdefaultencoding_params() < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} #endif if (__pyx_module_is_main_pygame_sdl2__mixer_music) { if (PyObject_SetAttrString(__pyx_m, "__name__", __pyx_n_s_main) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } #if PY_MAJOR_VERSION >= 3 { PyObject *modules = PyImport_GetModuleDict(); if (unlikely(!modules)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} if (!PyDict_GetItemString(modules, "pygame_sdl2.mixer_music")) { if (unlikely(PyDict_SetItemString(modules, "pygame_sdl2.mixer_music", __pyx_m) < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } } #endif /*--- Builtin init code ---*/ if (__Pyx_InitCachedBuiltins() < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /*--- Constants init code ---*/ if (__Pyx_InitCachedConstants() < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /*--- Global init code ---*/ __pyx_v_11pygame_sdl2_11mixer_music_queued_music = Py_None; Py_INCREF(Py_None); /*--- Variable export code ---*/ /*--- Function export code ---*/ /*--- Type init code ---*/ /*--- Type import code ---*/ /*--- Variable import code ---*/ /*--- Function import code ---*/ __pyx_t_1 = __Pyx_ImportModule("pygame_sdl2.rwobject"); if (!__pyx_t_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} if (__Pyx_ImportFunction(__pyx_t_1, "to_rwops", (void (**)(void))&__pyx_f_11pygame_sdl2_8rwobject_to_rwops, "SDL_RWops *(PyObject *, struct __pyx_opt_args_11pygame_sdl2_8rwobject_to_rwops *__pyx_optional_args)") < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} Py_DECREF(__pyx_t_1); __pyx_t_1 = 0; /*--- Execution code ---*/ #if defined(__Pyx_Generator_USED) || defined(__Pyx_Coroutine_USED) if (__Pyx_patch_abc() < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} #endif /* "pygame_sdl2/mixer_music.pyx":24 * from libc.string cimport memset * * from pygame_sdl2.error import error # <<<<<<<<<<<<<< * * cdef Mix_Music *current_music = NULL */ __pyx_t_2 = PyList_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 24; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __Pyx_INCREF(__pyx_n_s_error); __Pyx_GIVEREF(__pyx_n_s_error); PyList_SET_ITEM(__pyx_t_2, 0, __pyx_n_s_error); __pyx_t_3 = __Pyx_Import(__pyx_n_s_pygame_sdl2_error, __pyx_t_2, -1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 24; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_2 = __Pyx_ImportFrom(__pyx_t_3, __pyx_n_s_error); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 24; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_error, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 24; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "pygame_sdl2/mixer_music.pyx":26 * from pygame_sdl2.error import error * * cdef Mix_Music *current_music = NULL # <<<<<<<<<<<<<< * cdef object queued_music = None * cdef int endevent = 0 */ __pyx_v_11pygame_sdl2_11mixer_music_current_music = NULL; /* "pygame_sdl2/mixer_music.pyx":27 * * cdef Mix_Music *current_music = NULL * cdef object queued_music = None # <<<<<<<<<<<<<< * cdef int endevent = 0 * */ __Pyx_INCREF(Py_None); __Pyx_XGOTREF(__pyx_v_11pygame_sdl2_11mixer_music_queued_music); __Pyx_DECREF_SET(__pyx_v_11pygame_sdl2_11mixer_music_queued_music, Py_None); __Pyx_GIVEREF(Py_None); /* "pygame_sdl2/mixer_music.pyx":28 * cdef Mix_Music *current_music = NULL * cdef object queued_music = None * cdef int endevent = 0 # <<<<<<<<<<<<<< * * cdef void music_finished(): */ __pyx_v_11pygame_sdl2_11mixer_music_endevent = 0; /* "pygame_sdl2/mixer_music.pyx":44 * * * def load(fi): # <<<<<<<<<<<<<< * global current_music * */ __pyx_t_3 = PyCFunction_NewEx(&__pyx_mdef_11pygame_sdl2_11mixer_music_1load, NULL, __pyx_n_s_pygame_sdl2_mixer_music); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 44; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); if (PyDict_SetItem(__pyx_d, __pyx_n_s_load, __pyx_t_3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 44; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "pygame_sdl2/mixer_music.pyx":55 * raise error() * * def play(loops=0, double start=0.0): # <<<<<<<<<<<<<< * Mix_FadeInMusicPos(current_music, loops, 0, start) * */ __pyx_t_3 = PyCFunction_NewEx(&__pyx_mdef_11pygame_sdl2_11mixer_music_3play, NULL, __pyx_n_s_pygame_sdl2_mixer_music); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 55; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); if (PyDict_SetItem(__pyx_d, __pyx_n_s_play, __pyx_t_3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 55; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "pygame_sdl2/mixer_music.pyx":61 * Mix_RewindMusic() * * def stop(): # <<<<<<<<<<<<<< * Mix_HaltMusic() * */ __pyx_t_3 = PyCFunction_NewEx(&__pyx_mdef_11pygame_sdl2_11mixer_music_7stop, NULL, __pyx_n_s_pygame_sdl2_mixer_music); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 61; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); if (PyDict_SetItem(__pyx_d, __pyx_n_s_stop, __pyx_t_3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 61; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "pygame_sdl2/mixer_music.pyx":64 * Mix_HaltMusic() * * def pause(): # <<<<<<<<<<<<<< * Mix_PauseMusic() * */ __pyx_t_3 = PyCFunction_NewEx(&__pyx_mdef_11pygame_sdl2_11mixer_music_9pause, NULL, __pyx_n_s_pygame_sdl2_mixer_music); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 64; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); if (PyDict_SetItem(__pyx_d, __pyx_n_s_pause, __pyx_t_3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 64; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "pygame_sdl2/mixer_music.pyx":67 * Mix_PauseMusic() * * def unpause(): # <<<<<<<<<<<<<< * Mix_ResumeMusic() * */ __pyx_t_3 = PyCFunction_NewEx(&__pyx_mdef_11pygame_sdl2_11mixer_music_11unpause, NULL, __pyx_n_s_pygame_sdl2_mixer_music); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 67; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); if (PyDict_SetItem(__pyx_d, __pyx_n_s_unpause, __pyx_t_3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 67; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "pygame_sdl2/mixer_music.pyx":70 * Mix_ResumeMusic() * * def fadeout(time): # <<<<<<<<<<<<<< * Mix_FadeOutMusic(time) * */ __pyx_t_3 = PyCFunction_NewEx(&__pyx_mdef_11pygame_sdl2_11mixer_music_13fadeout, NULL, __pyx_n_s_pygame_sdl2_mixer_music); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 70; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); if (PyDict_SetItem(__pyx_d, __pyx_n_s_fadeout, __pyx_t_3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 70; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "pygame_sdl2/mixer_music.pyx":73 * Mix_FadeOutMusic(time) * * def set_volume(double value): # <<<<<<<<<<<<<< * Mix_VolumeMusic((MIX_MAX_VOLUME * value)) * */ __pyx_t_3 = PyCFunction_NewEx(&__pyx_mdef_11pygame_sdl2_11mixer_music_15set_volume, NULL, __pyx_n_s_pygame_sdl2_mixer_music); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 73; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); if (PyDict_SetItem(__pyx_d, __pyx_n_s_set_volume, __pyx_t_3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 73; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "pygame_sdl2/mixer_music.pyx":76 * Mix_VolumeMusic((MIX_MAX_VOLUME * value)) * * def get_volume(): # <<<<<<<<<<<<<< * return Mix_VolumeMusic(-1) / MIX_MAX_VOLUME * */ __pyx_t_3 = PyCFunction_NewEx(&__pyx_mdef_11pygame_sdl2_11mixer_music_17get_volume, NULL, __pyx_n_s_pygame_sdl2_mixer_music); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 76; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); if (PyDict_SetItem(__pyx_d, __pyx_n_s_get_volume, __pyx_t_3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 76; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "pygame_sdl2/mixer_music.pyx":79 * return Mix_VolumeMusic(-1) / MIX_MAX_VOLUME * * def get_busy(): # <<<<<<<<<<<<<< * return Mix_PlayingMusic() * */ __pyx_t_3 = PyCFunction_NewEx(&__pyx_mdef_11pygame_sdl2_11mixer_music_19get_busy, NULL, __pyx_n_s_pygame_sdl2_mixer_music); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 79; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); if (PyDict_SetItem(__pyx_d, __pyx_n_s_get_busy, __pyx_t_3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 79; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "pygame_sdl2/mixer_music.pyx":82 * return Mix_PlayingMusic() * * def set_pos(double pos): # <<<<<<<<<<<<<< * Mix_SetMusicPosition(pos) * */ __pyx_t_3 = PyCFunction_NewEx(&__pyx_mdef_11pygame_sdl2_11mixer_music_21set_pos, NULL, __pyx_n_s_pygame_sdl2_mixer_music); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 82; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); if (PyDict_SetItem(__pyx_d, __pyx_n_s_set_pos, __pyx_t_3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 82; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "pygame_sdl2/mixer_music.pyx":85 * Mix_SetMusicPosition(pos) * * def get_pos(): # <<<<<<<<<<<<<< * # TODO: Use a Mix_SetPostMix callback to track position. * raise error("Not implemented.") */ __pyx_t_3 = PyCFunction_NewEx(&__pyx_mdef_11pygame_sdl2_11mixer_music_23get_pos, NULL, __pyx_n_s_pygame_sdl2_mixer_music); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 85; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); if (PyDict_SetItem(__pyx_d, __pyx_n_s_get_pos, __pyx_t_3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 85; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "pygame_sdl2/mixer_music.pyx":89 * raise error("Not implemented.") * * def queue(fi): # <<<<<<<<<<<<<< * Mix_HookMusicFinished(music_finished) * if get_busy(): */ __pyx_t_3 = PyCFunction_NewEx(&__pyx_mdef_11pygame_sdl2_11mixer_music_25queue, NULL, __pyx_n_s_pygame_sdl2_mixer_music); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 89; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); if (PyDict_SetItem(__pyx_d, __pyx_n_s_queue, __pyx_t_3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 89; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "pygame_sdl2/mixer_music.pyx":98 * play() * * def set_endevent(type=None): # <<<<<<<<<<<<<< * Mix_HookMusicFinished(music_finished) * global endevent */ __pyx_t_3 = PyCFunction_NewEx(&__pyx_mdef_11pygame_sdl2_11mixer_music_27set_endevent, NULL, __pyx_n_s_pygame_sdl2_mixer_music); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 98; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); if (PyDict_SetItem(__pyx_d, __pyx_n_s_set_endevent, __pyx_t_3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 98; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "pygame_sdl2/mixer_music.pyx":103 * endevent = type or 0 * * def get_endevent(): # <<<<<<<<<<<<<< * return endevent */ __pyx_t_3 = PyCFunction_NewEx(&__pyx_mdef_11pygame_sdl2_11mixer_music_29get_endevent, NULL, __pyx_n_s_pygame_sdl2_mixer_music); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 103; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); if (PyDict_SetItem(__pyx_d, __pyx_n_s_get_endevent, __pyx_t_3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 103; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "pygame_sdl2/mixer_music.pyx":1 * # Copyright 2014 Patrick Dawson # <<<<<<<<<<<<<< * # * # This software is provided 'as-is', without any express or implied */ __pyx_t_3 = PyDict_New(); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); if (PyDict_SetItem(__pyx_d, __pyx_n_s_test, __pyx_t_3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /*--- Wrapped vars code ---*/ goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); if (__pyx_m) { if (__pyx_d) { __Pyx_AddTraceback("init pygame_sdl2.mixer_music", __pyx_clineno, __pyx_lineno, __pyx_filename); } Py_DECREF(__pyx_m); __pyx_m = 0; } else if (!PyErr_Occurred()) { PyErr_SetString(PyExc_ImportError, "init pygame_sdl2.mixer_music"); } __pyx_L0:; __Pyx_RefNannyFinishContext(); #if PY_MAJOR_VERSION < 3 return; #else return __pyx_m; #endif } /* --- Runtime support code --- */ #if CYTHON_REFNANNY static __Pyx_RefNannyAPIStruct *__Pyx_RefNannyImportAPI(const char *modname) { PyObject *m = NULL, *p = NULL; void *r = NULL; m = PyImport_ImportModule((char *)modname); if (!m) goto end; p = PyObject_GetAttrString(m, (char *)"RefNannyAPI"); if (!p) goto end; r = PyLong_AsVoidPtr(p); end: Py_XDECREF(p); Py_XDECREF(m); return (__Pyx_RefNannyAPIStruct *)r; } #endif static PyObject *__Pyx_GetBuiltinName(PyObject *name) { PyObject* result = __Pyx_PyObject_GetAttrStr(__pyx_b, name); if (unlikely(!result)) { PyErr_Format(PyExc_NameError, #if PY_MAJOR_VERSION >= 3 "name '%U' is not defined", name); #else "name '%.200s' is not defined", PyString_AS_STRING(name)); #endif } return result; } static CYTHON_INLINE PyObject *__Pyx_GetModuleGlobalName(PyObject *name) { PyObject *result; #if CYTHON_COMPILING_IN_CPYTHON result = PyDict_GetItem(__pyx_d, name); if (likely(result)) { Py_INCREF(result); } else { #else result = PyObject_GetItem(__pyx_d, name); if (!result) { PyErr_Clear(); #endif result = __Pyx_GetBuiltinName(name); } return result; } #if CYTHON_COMPILING_IN_CPYTHON static CYTHON_INLINE PyObject* __Pyx_PyObject_Call(PyObject *func, PyObject *arg, PyObject *kw) { PyObject *result; ternaryfunc call = func->ob_type->tp_call; if (unlikely(!call)) return PyObject_Call(func, arg, kw); if (unlikely(Py_EnterRecursiveCall((char*)" while calling a Python object"))) return NULL; result = (*call)(func, arg, kw); Py_LeaveRecursiveCall(); if (unlikely(!result) && unlikely(!PyErr_Occurred())) { PyErr_SetString( PyExc_SystemError, "NULL result without error in PyObject_Call"); } return result; } #endif #if CYTHON_COMPILING_IN_CPYTHON static CYTHON_INLINE PyObject* __Pyx_PyObject_CallMethO(PyObject *func, PyObject *arg) { PyObject *self, *result; PyCFunction cfunc; cfunc = PyCFunction_GET_FUNCTION(func); self = PyCFunction_GET_SELF(func); if (unlikely(Py_EnterRecursiveCall((char*)" while calling a Python object"))) return NULL; result = cfunc(self, arg); Py_LeaveRecursiveCall(); if (unlikely(!result) && unlikely(!PyErr_Occurred())) { PyErr_SetString( PyExc_SystemError, "NULL result without error in PyObject_Call"); } return result; } #endif #if CYTHON_COMPILING_IN_CPYTHON static PyObject* __Pyx__PyObject_CallOneArg(PyObject *func, PyObject *arg) { PyObject *result; PyObject *args = PyTuple_New(1); if (unlikely(!args)) return NULL; Py_INCREF(arg); PyTuple_SET_ITEM(args, 0, arg); result = __Pyx_PyObject_Call(func, args, NULL); Py_DECREF(args); return result; } static CYTHON_INLINE PyObject* __Pyx_PyObject_CallOneArg(PyObject *func, PyObject *arg) { #ifdef __Pyx_CyFunction_USED if (likely(PyCFunction_Check(func) || PyObject_TypeCheck(func, __pyx_CyFunctionType))) { #else if (likely(PyCFunction_Check(func))) { #endif if (likely(PyCFunction_GET_FLAGS(func) & METH_O)) { return __Pyx_PyObject_CallMethO(func, arg); } } return __Pyx__PyObject_CallOneArg(func, arg); } #else static CYTHON_INLINE PyObject* __Pyx_PyObject_CallOneArg(PyObject *func, PyObject *arg) { PyObject *result; PyObject *args = PyTuple_Pack(1, arg); if (unlikely(!args)) return NULL; result = __Pyx_PyObject_Call(func, args, NULL); Py_DECREF(args); return result; } #endif #if CYTHON_COMPILING_IN_CPYTHON static CYTHON_INLINE PyObject* __Pyx_PyObject_CallNoArg(PyObject *func) { #ifdef __Pyx_CyFunction_USED if (likely(PyCFunction_Check(func) || PyObject_TypeCheck(func, __pyx_CyFunctionType))) { #else if (likely(PyCFunction_Check(func))) { #endif if (likely(PyCFunction_GET_FLAGS(func) & METH_NOARGS)) { return __Pyx_PyObject_CallMethO(func, NULL); } } return __Pyx_PyObject_Call(func, __pyx_empty_tuple, NULL); } #endif static CYTHON_INLINE void __Pyx_ErrRestore(PyObject *type, PyObject *value, PyObject *tb) { #if CYTHON_COMPILING_IN_CPYTHON PyObject *tmp_type, *tmp_value, *tmp_tb; PyThreadState *tstate = PyThreadState_GET(); tmp_type = tstate->curexc_type; tmp_value = tstate->curexc_value; tmp_tb = tstate->curexc_traceback; tstate->curexc_type = type; tstate->curexc_value = value; tstate->curexc_traceback = tb; Py_XDECREF(tmp_type); Py_XDECREF(tmp_value); Py_XDECREF(tmp_tb); #else PyErr_Restore(type, value, tb); #endif } static CYTHON_INLINE void __Pyx_ErrFetch(PyObject **type, PyObject **value, PyObject **tb) { #if CYTHON_COMPILING_IN_CPYTHON PyThreadState *tstate = PyThreadState_GET(); *type = tstate->curexc_type; *value = tstate->curexc_value; *tb = tstate->curexc_traceback; tstate->curexc_type = 0; tstate->curexc_value = 0; tstate->curexc_traceback = 0; #else PyErr_Fetch(type, value, tb); #endif } static void __Pyx_WriteUnraisable(const char *name, CYTHON_UNUSED int clineno, CYTHON_UNUSED int lineno, CYTHON_UNUSED const char *filename, int full_traceback, CYTHON_UNUSED int nogil) { PyObject *old_exc, *old_val, *old_tb; PyObject *ctx; #ifdef WITH_THREAD PyGILState_STATE state; if (nogil) state = PyGILState_Ensure(); #endif __Pyx_ErrFetch(&old_exc, &old_val, &old_tb); if (full_traceback) { Py_XINCREF(old_exc); Py_XINCREF(old_val); Py_XINCREF(old_tb); __Pyx_ErrRestore(old_exc, old_val, old_tb); PyErr_PrintEx(1); } #if PY_MAJOR_VERSION < 3 ctx = PyString_FromString(name); #else ctx = PyUnicode_FromString(name); #endif __Pyx_ErrRestore(old_exc, old_val, old_tb); if (!ctx) { PyErr_WriteUnraisable(Py_None); } else { PyErr_WriteUnraisable(ctx); Py_DECREF(ctx); } #ifdef WITH_THREAD if (nogil) PyGILState_Release(state); #endif } #if PY_MAJOR_VERSION < 3 static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, CYTHON_UNUSED PyObject *cause) { Py_XINCREF(type); if (!value || value == Py_None) value = NULL; else Py_INCREF(value); if (!tb || tb == Py_None) tb = NULL; else { Py_INCREF(tb); if (!PyTraceBack_Check(tb)) { PyErr_SetString(PyExc_TypeError, "raise: arg 3 must be a traceback or None"); goto raise_error; } } if (PyType_Check(type)) { #if CYTHON_COMPILING_IN_PYPY if (!value) { Py_INCREF(Py_None); value = Py_None; } #endif PyErr_NormalizeException(&type, &value, &tb); } else { if (value) { PyErr_SetString(PyExc_TypeError, "instance exception may not have a separate value"); goto raise_error; } value = type; type = (PyObject*) Py_TYPE(type); Py_INCREF(type); if (!PyType_IsSubtype((PyTypeObject *)type, (PyTypeObject *)PyExc_BaseException)) { PyErr_SetString(PyExc_TypeError, "raise: exception class must be a subclass of BaseException"); goto raise_error; } } __Pyx_ErrRestore(type, value, tb); return; raise_error: Py_XDECREF(value); Py_XDECREF(type); Py_XDECREF(tb); return; } #else static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, PyObject *cause) { PyObject* owned_instance = NULL; if (tb == Py_None) { tb = 0; } else if (tb && !PyTraceBack_Check(tb)) { PyErr_SetString(PyExc_TypeError, "raise: arg 3 must be a traceback or None"); goto bad; } if (value == Py_None) value = 0; if (PyExceptionInstance_Check(type)) { if (value) { PyErr_SetString(PyExc_TypeError, "instance exception may not have a separate value"); goto bad; } value = type; type = (PyObject*) Py_TYPE(value); } else if (PyExceptionClass_Check(type)) { PyObject *instance_class = NULL; if (value && PyExceptionInstance_Check(value)) { instance_class = (PyObject*) Py_TYPE(value); if (instance_class != type) { int is_subclass = PyObject_IsSubclass(instance_class, type); if (!is_subclass) { instance_class = NULL; } else if (unlikely(is_subclass == -1)) { goto bad; } else { type = instance_class; } } } if (!instance_class) { PyObject *args; if (!value) args = PyTuple_New(0); else if (PyTuple_Check(value)) { Py_INCREF(value); args = value; } else args = PyTuple_Pack(1, value); if (!args) goto bad; owned_instance = PyObject_Call(type, args, NULL); Py_DECREF(args); if (!owned_instance) goto bad; value = owned_instance; if (!PyExceptionInstance_Check(value)) { PyErr_Format(PyExc_TypeError, "calling %R should have returned an instance of " "BaseException, not %R", type, Py_TYPE(value)); goto bad; } } } else { PyErr_SetString(PyExc_TypeError, "raise: exception class must be a subclass of BaseException"); goto bad; } #if PY_VERSION_HEX >= 0x03030000 if (cause) { #else if (cause && cause != Py_None) { #endif PyObject *fixed_cause; if (cause == Py_None) { fixed_cause = NULL; } else if (PyExceptionClass_Check(cause)) { fixed_cause = PyObject_CallObject(cause, NULL); if (fixed_cause == NULL) goto bad; } else if (PyExceptionInstance_Check(cause)) { fixed_cause = cause; Py_INCREF(fixed_cause); } else { PyErr_SetString(PyExc_TypeError, "exception causes must derive from " "BaseException"); goto bad; } PyException_SetCause(value, fixed_cause); } PyErr_SetObject(type, value); if (tb) { #if CYTHON_COMPILING_IN_PYPY PyObject *tmp_type, *tmp_value, *tmp_tb; PyErr_Fetch(&tmp_type, &tmp_value, &tmp_tb); Py_INCREF(tb); PyErr_Restore(tmp_type, tmp_value, tb); Py_XDECREF(tmp_tb); #else PyThreadState *tstate = PyThreadState_GET(); PyObject* tmp_tb = tstate->curexc_traceback; if (tb != tmp_tb) { Py_INCREF(tb); tstate->curexc_traceback = tb; Py_XDECREF(tmp_tb); } #endif } bad: Py_XDECREF(owned_instance); return; } #endif static void __Pyx_RaiseDoubleKeywordsError( const char* func_name, PyObject* kw_name) { PyErr_Format(PyExc_TypeError, #if PY_MAJOR_VERSION >= 3 "%s() got multiple values for keyword argument '%U'", func_name, kw_name); #else "%s() got multiple values for keyword argument '%s'", func_name, PyString_AsString(kw_name)); #endif } static int __Pyx_ParseOptionalKeywords( PyObject *kwds, PyObject **argnames[], PyObject *kwds2, PyObject *values[], Py_ssize_t num_pos_args, const char* function_name) { PyObject *key = 0, *value = 0; Py_ssize_t pos = 0; PyObject*** name; PyObject*** first_kw_arg = argnames + num_pos_args; while (PyDict_Next(kwds, &pos, &key, &value)) { name = first_kw_arg; while (*name && (**name != key)) name++; if (*name) { values[name-argnames] = value; continue; } name = first_kw_arg; #if PY_MAJOR_VERSION < 3 if (likely(PyString_CheckExact(key)) || likely(PyString_Check(key))) { while (*name) { if ((CYTHON_COMPILING_IN_PYPY || PyString_GET_SIZE(**name) == PyString_GET_SIZE(key)) && _PyString_Eq(**name, key)) { values[name-argnames] = value; break; } name++; } if (*name) continue; else { PyObject*** argname = argnames; while (argname != first_kw_arg) { if ((**argname == key) || ( (CYTHON_COMPILING_IN_PYPY || PyString_GET_SIZE(**argname) == PyString_GET_SIZE(key)) && _PyString_Eq(**argname, key))) { goto arg_passed_twice; } argname++; } } } else #endif if (likely(PyUnicode_Check(key))) { while (*name) { int cmp = (**name == key) ? 0 : #if !CYTHON_COMPILING_IN_PYPY && PY_MAJOR_VERSION >= 3 (PyUnicode_GET_SIZE(**name) != PyUnicode_GET_SIZE(key)) ? 1 : #endif PyUnicode_Compare(**name, key); if (cmp < 0 && unlikely(PyErr_Occurred())) goto bad; if (cmp == 0) { values[name-argnames] = value; break; } name++; } if (*name) continue; else { PyObject*** argname = argnames; while (argname != first_kw_arg) { int cmp = (**argname == key) ? 0 : #if !CYTHON_COMPILING_IN_PYPY && PY_MAJOR_VERSION >= 3 (PyUnicode_GET_SIZE(**argname) != PyUnicode_GET_SIZE(key)) ? 1 : #endif PyUnicode_Compare(**argname, key); if (cmp < 0 && unlikely(PyErr_Occurred())) goto bad; if (cmp == 0) goto arg_passed_twice; argname++; } } } else goto invalid_keyword_type; if (kwds2) { if (unlikely(PyDict_SetItem(kwds2, key, value))) goto bad; } else { goto invalid_keyword; } } return 0; arg_passed_twice: __Pyx_RaiseDoubleKeywordsError(function_name, key); goto bad; invalid_keyword_type: PyErr_Format(PyExc_TypeError, "%.200s() keywords must be strings", function_name); goto bad; invalid_keyword: PyErr_Format(PyExc_TypeError, #if PY_MAJOR_VERSION < 3 "%.200s() got an unexpected keyword argument '%.200s'", function_name, PyString_AsString(key)); #else "%s() got an unexpected keyword argument '%U'", function_name, key); #endif bad: return -1; } static void __Pyx_RaiseArgtupleInvalid( const char* func_name, int exact, Py_ssize_t num_min, Py_ssize_t num_max, Py_ssize_t num_found) { Py_ssize_t num_expected; const char *more_or_less; if (num_found < num_min) { num_expected = num_min; more_or_less = "at least"; } else { num_expected = num_max; more_or_less = "at most"; } if (exact) { more_or_less = "exactly"; } PyErr_Format(PyExc_TypeError, "%.200s() takes %.8s %" CYTHON_FORMAT_SSIZE_T "d positional argument%.1s (%" CYTHON_FORMAT_SSIZE_T "d given)", func_name, more_or_less, num_expected, (num_expected == 1) ? "" : "s", num_found); } static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list, int level) { PyObject *empty_list = 0; PyObject *module = 0; PyObject *global_dict = 0; PyObject *empty_dict = 0; PyObject *list; #if PY_VERSION_HEX < 0x03030000 PyObject *py_import; py_import = __Pyx_PyObject_GetAttrStr(__pyx_b, __pyx_n_s_import); if (!py_import) goto bad; #endif if (from_list) list = from_list; else { empty_list = PyList_New(0); if (!empty_list) goto bad; list = empty_list; } global_dict = PyModule_GetDict(__pyx_m); if (!global_dict) goto bad; empty_dict = PyDict_New(); if (!empty_dict) goto bad; { #if PY_MAJOR_VERSION >= 3 if (level == -1) { if (strchr(__Pyx_MODULE_NAME, '.')) { #if PY_VERSION_HEX < 0x03030000 PyObject *py_level = PyInt_FromLong(1); if (!py_level) goto bad; module = PyObject_CallFunctionObjArgs(py_import, name, global_dict, empty_dict, list, py_level, NULL); Py_DECREF(py_level); #else module = PyImport_ImportModuleLevelObject( name, global_dict, empty_dict, list, 1); #endif if (!module) { if (!PyErr_ExceptionMatches(PyExc_ImportError)) goto bad; PyErr_Clear(); } } level = 0; } #endif if (!module) { #if PY_VERSION_HEX < 0x03030000 PyObject *py_level = PyInt_FromLong(level); if (!py_level) goto bad; module = PyObject_CallFunctionObjArgs(py_import, name, global_dict, empty_dict, list, py_level, NULL); Py_DECREF(py_level); #else module = PyImport_ImportModuleLevelObject( name, global_dict, empty_dict, list, level); #endif } } bad: #if PY_VERSION_HEX < 0x03030000 Py_XDECREF(py_import); #endif Py_XDECREF(empty_list); Py_XDECREF(empty_dict); return module; } static PyObject* __Pyx_ImportFrom(PyObject* module, PyObject* name) { PyObject* value = __Pyx_PyObject_GetAttrStr(module, name); if (unlikely(!value) && PyErr_ExceptionMatches(PyExc_AttributeError)) { PyErr_Format(PyExc_ImportError, #if PY_MAJOR_VERSION < 3 "cannot import name %.230s", PyString_AS_STRING(name)); #else "cannot import name %S", name); #endif } return value; } static int __pyx_bisect_code_objects(__Pyx_CodeObjectCacheEntry* entries, int count, int code_line) { int start = 0, mid = 0, end = count - 1; if (end >= 0 && code_line > entries[end].code_line) { return count; } while (start < end) { mid = start + (end - start) / 2; if (code_line < entries[mid].code_line) { end = mid; } else if (code_line > entries[mid].code_line) { start = mid + 1; } else { return mid; } } if (code_line <= entries[mid].code_line) { return mid; } else { return mid + 1; } } static PyCodeObject *__pyx_find_code_object(int code_line) { PyCodeObject* code_object; int pos; if (unlikely(!code_line) || unlikely(!__pyx_code_cache.entries)) { return NULL; } pos = __pyx_bisect_code_objects(__pyx_code_cache.entries, __pyx_code_cache.count, code_line); if (unlikely(pos >= __pyx_code_cache.count) || unlikely(__pyx_code_cache.entries[pos].code_line != code_line)) { return NULL; } code_object = __pyx_code_cache.entries[pos].code_object; Py_INCREF(code_object); return code_object; } static void __pyx_insert_code_object(int code_line, PyCodeObject* code_object) { int pos, i; __Pyx_CodeObjectCacheEntry* entries = __pyx_code_cache.entries; if (unlikely(!code_line)) { return; } if (unlikely(!entries)) { entries = (__Pyx_CodeObjectCacheEntry*)PyMem_Malloc(64*sizeof(__Pyx_CodeObjectCacheEntry)); if (likely(entries)) { __pyx_code_cache.entries = entries; __pyx_code_cache.max_count = 64; __pyx_code_cache.count = 1; entries[0].code_line = code_line; entries[0].code_object = code_object; Py_INCREF(code_object); } return; } pos = __pyx_bisect_code_objects(__pyx_code_cache.entries, __pyx_code_cache.count, code_line); if ((pos < __pyx_code_cache.count) && unlikely(__pyx_code_cache.entries[pos].code_line == code_line)) { PyCodeObject* tmp = entries[pos].code_object; entries[pos].code_object = code_object; Py_DECREF(tmp); return; } if (__pyx_code_cache.count == __pyx_code_cache.max_count) { int new_max = __pyx_code_cache.max_count + 64; entries = (__Pyx_CodeObjectCacheEntry*)PyMem_Realloc( __pyx_code_cache.entries, (size_t)new_max*sizeof(__Pyx_CodeObjectCacheEntry)); if (unlikely(!entries)) { return; } __pyx_code_cache.entries = entries; __pyx_code_cache.max_count = new_max; } for (i=__pyx_code_cache.count; i>pos; i--) { entries[i] = entries[i-1]; } entries[pos].code_line = code_line; entries[pos].code_object = code_object; __pyx_code_cache.count++; Py_INCREF(code_object); } #include "compile.h" #include "frameobject.h" #include "traceback.h" static PyCodeObject* __Pyx_CreateCodeObjectForTraceback( const char *funcname, int c_line, int py_line, const char *filename) { PyCodeObject *py_code = 0; PyObject *py_srcfile = 0; PyObject *py_funcname = 0; #if PY_MAJOR_VERSION < 3 py_srcfile = PyString_FromString(filename); #else py_srcfile = PyUnicode_FromString(filename); #endif if (!py_srcfile) goto bad; if (c_line) { #if PY_MAJOR_VERSION < 3 py_funcname = PyString_FromFormat( "%s (%s:%d)", funcname, __pyx_cfilenm, c_line); #else py_funcname = PyUnicode_FromFormat( "%s (%s:%d)", funcname, __pyx_cfilenm, c_line); #endif } else { #if PY_MAJOR_VERSION < 3 py_funcname = PyString_FromString(funcname); #else py_funcname = PyUnicode_FromString(funcname); #endif } if (!py_funcname) goto bad; py_code = __Pyx_PyCode_New( 0, 0, 0, 0, 0, __pyx_empty_bytes, /*PyObject *code,*/ __pyx_empty_tuple, /*PyObject *consts,*/ __pyx_empty_tuple, /*PyObject *names,*/ __pyx_empty_tuple, /*PyObject *varnames,*/ __pyx_empty_tuple, /*PyObject *freevars,*/ __pyx_empty_tuple, /*PyObject *cellvars,*/ py_srcfile, /*PyObject *filename,*/ py_funcname, /*PyObject *name,*/ py_line, __pyx_empty_bytes /*PyObject *lnotab*/ ); Py_DECREF(py_srcfile); Py_DECREF(py_funcname); return py_code; bad: Py_XDECREF(py_srcfile); Py_XDECREF(py_funcname); return NULL; } static void __Pyx_AddTraceback(const char *funcname, int c_line, int py_line, const char *filename) { PyCodeObject *py_code = 0; PyFrameObject *py_frame = 0; py_code = __pyx_find_code_object(c_line ? c_line : py_line); if (!py_code) { py_code = __Pyx_CreateCodeObjectForTraceback( funcname, c_line, py_line, filename); if (!py_code) goto bad; __pyx_insert_code_object(c_line ? c_line : py_line, py_code); } py_frame = PyFrame_New( PyThreadState_GET(), /*PyThreadState *tstate,*/ py_code, /*PyCodeObject *code,*/ __pyx_d, /*PyObject *globals,*/ 0 /*PyObject *locals*/ ); if (!py_frame) goto bad; py_frame->f_lineno = py_line; PyTraceBack_Here(py_frame); bad: Py_XDECREF(py_code); Py_XDECREF(py_frame); } #define __PYX_VERIFY_RETURN_INT(target_type, func_type, func_value)\ __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, 0) #define __PYX_VERIFY_RETURN_INT_EXC(target_type, func_type, func_value)\ __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, 1) #define __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, exc)\ {\ func_type value = func_value;\ if (sizeof(target_type) < sizeof(func_type)) {\ if (unlikely(value != (func_type) (target_type) value)) {\ func_type zero = 0;\ if (exc && unlikely(value == (func_type)-1 && PyErr_Occurred()))\ return (target_type) -1;\ if (is_unsigned && unlikely(value < zero))\ goto raise_neg_overflow;\ else\ goto raise_overflow;\ }\ }\ return (target_type) value;\ } #if CYTHON_USE_PYLONG_INTERNALS #include "longintrepr.h" #endif static CYTHON_INLINE int __Pyx_PyInt_As_int(PyObject *x) { const int neg_one = (int) -1, const_zero = (int) 0; const int is_unsigned = neg_one > const_zero; #if PY_MAJOR_VERSION < 3 if (likely(PyInt_Check(x))) { if (sizeof(int) < sizeof(long)) { __PYX_VERIFY_RETURN_INT(int, long, PyInt_AS_LONG(x)) } else { long val = PyInt_AS_LONG(x); if (is_unsigned && unlikely(val < 0)) { goto raise_neg_overflow; } return (int) val; } } else #endif if (likely(PyLong_Check(x))) { if (is_unsigned) { #if CYTHON_USE_PYLONG_INTERNALS const digit* digits = ((PyLongObject*)x)->ob_digit; switch (Py_SIZE(x)) { case 0: return (int) 0; case 1: __PYX_VERIFY_RETURN_INT(int, digit, digits[0]) case 2: if (8 * sizeof(int) > 1 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(int) >= 2 * PyLong_SHIFT) { return (int) (((((int)digits[1]) << PyLong_SHIFT) | (int)digits[0])); } } break; case 3: if (8 * sizeof(int) > 2 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(int) >= 3 * PyLong_SHIFT) { return (int) (((((((int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0])); } } break; case 4: if (8 * sizeof(int) > 3 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(int) >= 4 * PyLong_SHIFT) { return (int) (((((((((int)digits[3]) << PyLong_SHIFT) | (int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0])); } } break; } #endif #if CYTHON_COMPILING_IN_CPYTHON if (unlikely(Py_SIZE(x) < 0)) { goto raise_neg_overflow; } #else { int result = PyObject_RichCompareBool(x, Py_False, Py_LT); if (unlikely(result < 0)) return (int) -1; if (unlikely(result == 1)) goto raise_neg_overflow; } #endif if (sizeof(int) <= sizeof(unsigned long)) { __PYX_VERIFY_RETURN_INT_EXC(int, unsigned long, PyLong_AsUnsignedLong(x)) } else if (sizeof(int) <= sizeof(unsigned PY_LONG_LONG)) { __PYX_VERIFY_RETURN_INT_EXC(int, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x)) } } else { #if CYTHON_USE_PYLONG_INTERNALS const digit* digits = ((PyLongObject*)x)->ob_digit; switch (Py_SIZE(x)) { case 0: return (int) 0; case -1: __PYX_VERIFY_RETURN_INT(int, sdigit, -(sdigit) digits[0]) case 1: __PYX_VERIFY_RETURN_INT(int, digit, +digits[0]) case -2: if (8 * sizeof(int) - 1 > 1 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(int, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(int) - 1 > 2 * PyLong_SHIFT) { return (int) (((int)-1)*(((((int)digits[1]) << PyLong_SHIFT) | (int)digits[0]))); } } break; case 2: if (8 * sizeof(int) > 1 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(int) - 1 > 2 * PyLong_SHIFT) { return (int) ((((((int)digits[1]) << PyLong_SHIFT) | (int)digits[0]))); } } break; case -3: if (8 * sizeof(int) - 1 > 2 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(int, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(int) - 1 > 3 * PyLong_SHIFT) { return (int) (((int)-1)*(((((((int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0]))); } } break; case 3: if (8 * sizeof(int) > 2 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(int) - 1 > 3 * PyLong_SHIFT) { return (int) ((((((((int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0]))); } } break; case -4: if (8 * sizeof(int) - 1 > 3 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(int, long, -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(int) - 1 > 4 * PyLong_SHIFT) { return (int) (((int)-1)*(((((((((int)digits[3]) << PyLong_SHIFT) | (int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0]))); } } break; case 4: if (8 * sizeof(int) > 3 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(int) - 1 > 4 * PyLong_SHIFT) { return (int) ((((((((((int)digits[3]) << PyLong_SHIFT) | (int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0]))); } } break; } #endif if (sizeof(int) <= sizeof(long)) { __PYX_VERIFY_RETURN_INT_EXC(int, long, PyLong_AsLong(x)) } else if (sizeof(int) <= sizeof(PY_LONG_LONG)) { __PYX_VERIFY_RETURN_INT_EXC(int, PY_LONG_LONG, PyLong_AsLongLong(x)) } } { #if CYTHON_COMPILING_IN_PYPY && !defined(_PyLong_AsByteArray) PyErr_SetString(PyExc_RuntimeError, "_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers"); #else int val; PyObject *v = __Pyx_PyNumber_Int(x); #if PY_MAJOR_VERSION < 3 if (likely(v) && !PyLong_Check(v)) { PyObject *tmp = v; v = PyNumber_Long(tmp); Py_DECREF(tmp); } #endif if (likely(v)) { int one = 1; int is_little = (int)*(unsigned char *)&one; unsigned char *bytes = (unsigned char *)&val; int ret = _PyLong_AsByteArray((PyLongObject *)v, bytes, sizeof(val), is_little, !is_unsigned); Py_DECREF(v); if (likely(!ret)) return val; } #endif return (int) -1; } } else { int val; PyObject *tmp = __Pyx_PyNumber_Int(x); if (!tmp) return (int) -1; val = __Pyx_PyInt_As_int(tmp); Py_DECREF(tmp); return val; } raise_overflow: PyErr_SetString(PyExc_OverflowError, "value too large to convert to int"); return (int) -1; raise_neg_overflow: PyErr_SetString(PyExc_OverflowError, "can't convert negative value to int"); return (int) -1; } static CYTHON_INLINE PyObject* __Pyx_PyInt_From_int(int value) { const int neg_one = (int) -1, const_zero = (int) 0; const int is_unsigned = neg_one > const_zero; if (is_unsigned) { if (sizeof(int) < sizeof(long)) { return PyInt_FromLong((long) value); } else if (sizeof(int) <= sizeof(unsigned long)) { return PyLong_FromUnsignedLong((unsigned long) value); } else if (sizeof(int) <= sizeof(unsigned PY_LONG_LONG)) { return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value); } } else { if (sizeof(int) <= sizeof(long)) { return PyInt_FromLong((long) value); } else if (sizeof(int) <= sizeof(PY_LONG_LONG)) { return PyLong_FromLongLong((PY_LONG_LONG) value); } } { int one = 1; int little = (int)*(unsigned char *)&one; unsigned char *bytes = (unsigned char *)&value; return _PyLong_FromByteArray(bytes, sizeof(int), little, !is_unsigned); } } static CYTHON_INLINE PyObject* __Pyx_PyInt_From_long(long value) { const long neg_one = (long) -1, const_zero = (long) 0; const int is_unsigned = neg_one > const_zero; if (is_unsigned) { if (sizeof(long) < sizeof(long)) { return PyInt_FromLong((long) value); } else if (sizeof(long) <= sizeof(unsigned long)) { return PyLong_FromUnsignedLong((unsigned long) value); } else if (sizeof(long) <= sizeof(unsigned PY_LONG_LONG)) { return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value); } } else { if (sizeof(long) <= sizeof(long)) { return PyInt_FromLong((long) value); } else if (sizeof(long) <= sizeof(PY_LONG_LONG)) { return PyLong_FromLongLong((PY_LONG_LONG) value); } } { int one = 1; int little = (int)*(unsigned char *)&one; unsigned char *bytes = (unsigned char *)&value; return _PyLong_FromByteArray(bytes, sizeof(long), little, !is_unsigned); } } static CYTHON_INLINE long __Pyx_PyInt_As_long(PyObject *x) { const long neg_one = (long) -1, const_zero = (long) 0; const int is_unsigned = neg_one > const_zero; #if PY_MAJOR_VERSION < 3 if (likely(PyInt_Check(x))) { if (sizeof(long) < sizeof(long)) { __PYX_VERIFY_RETURN_INT(long, long, PyInt_AS_LONG(x)) } else { long val = PyInt_AS_LONG(x); if (is_unsigned && unlikely(val < 0)) { goto raise_neg_overflow; } return (long) val; } } else #endif if (likely(PyLong_Check(x))) { if (is_unsigned) { #if CYTHON_USE_PYLONG_INTERNALS const digit* digits = ((PyLongObject*)x)->ob_digit; switch (Py_SIZE(x)) { case 0: return (long) 0; case 1: __PYX_VERIFY_RETURN_INT(long, digit, digits[0]) case 2: if (8 * sizeof(long) > 1 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(long) >= 2 * PyLong_SHIFT) { return (long) (((((long)digits[1]) << PyLong_SHIFT) | (long)digits[0])); } } break; case 3: if (8 * sizeof(long) > 2 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(long) >= 3 * PyLong_SHIFT) { return (long) (((((((long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0])); } } break; case 4: if (8 * sizeof(long) > 3 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(long) >= 4 * PyLong_SHIFT) { return (long) (((((((((long)digits[3]) << PyLong_SHIFT) | (long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0])); } } break; } #endif #if CYTHON_COMPILING_IN_CPYTHON if (unlikely(Py_SIZE(x) < 0)) { goto raise_neg_overflow; } #else { int result = PyObject_RichCompareBool(x, Py_False, Py_LT); if (unlikely(result < 0)) return (long) -1; if (unlikely(result == 1)) goto raise_neg_overflow; } #endif if (sizeof(long) <= sizeof(unsigned long)) { __PYX_VERIFY_RETURN_INT_EXC(long, unsigned long, PyLong_AsUnsignedLong(x)) } else if (sizeof(long) <= sizeof(unsigned PY_LONG_LONG)) { __PYX_VERIFY_RETURN_INT_EXC(long, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x)) } } else { #if CYTHON_USE_PYLONG_INTERNALS const digit* digits = ((PyLongObject*)x)->ob_digit; switch (Py_SIZE(x)) { case 0: return (long) 0; case -1: __PYX_VERIFY_RETURN_INT(long, sdigit, -(sdigit) digits[0]) case 1: __PYX_VERIFY_RETURN_INT(long, digit, +digits[0]) case -2: if (8 * sizeof(long) - 1 > 1 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(long, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) { return (long) (((long)-1)*(((((long)digits[1]) << PyLong_SHIFT) | (long)digits[0]))); } } break; case 2: if (8 * sizeof(long) > 1 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) { return (long) ((((((long)digits[1]) << PyLong_SHIFT) | (long)digits[0]))); } } break; case -3: if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(long, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) { return (long) (((long)-1)*(((((((long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0]))); } } break; case 3: if (8 * sizeof(long) > 2 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) { return (long) ((((((((long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0]))); } } break; case -4: if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(long, long, -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(long) - 1 > 4 * PyLong_SHIFT) { return (long) (((long)-1)*(((((((((long)digits[3]) << PyLong_SHIFT) | (long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0]))); } } break; case 4: if (8 * sizeof(long) > 3 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(long) - 1 > 4 * PyLong_SHIFT) { return (long) ((((((((((long)digits[3]) << PyLong_SHIFT) | (long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0]))); } } break; } #endif if (sizeof(long) <= sizeof(long)) { __PYX_VERIFY_RETURN_INT_EXC(long, long, PyLong_AsLong(x)) } else if (sizeof(long) <= sizeof(PY_LONG_LONG)) { __PYX_VERIFY_RETURN_INT_EXC(long, PY_LONG_LONG, PyLong_AsLongLong(x)) } } { #if CYTHON_COMPILING_IN_PYPY && !defined(_PyLong_AsByteArray) PyErr_SetString(PyExc_RuntimeError, "_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers"); #else long val; PyObject *v = __Pyx_PyNumber_Int(x); #if PY_MAJOR_VERSION < 3 if (likely(v) && !PyLong_Check(v)) { PyObject *tmp = v; v = PyNumber_Long(tmp); Py_DECREF(tmp); } #endif if (likely(v)) { int one = 1; int is_little = (int)*(unsigned char *)&one; unsigned char *bytes = (unsigned char *)&val; int ret = _PyLong_AsByteArray((PyLongObject *)v, bytes, sizeof(val), is_little, !is_unsigned); Py_DECREF(v); if (likely(!ret)) return val; } #endif return (long) -1; } } else { long val; PyObject *tmp = __Pyx_PyNumber_Int(x); if (!tmp) return (long) -1; val = __Pyx_PyInt_As_long(tmp); Py_DECREF(tmp); return val; } raise_overflow: PyErr_SetString(PyExc_OverflowError, "value too large to convert to long"); return (long) -1; raise_neg_overflow: PyErr_SetString(PyExc_OverflowError, "can't convert negative value to long"); return (long) -1; } static int __Pyx_check_binary_version(void) { char ctversion[4], rtversion[4]; PyOS_snprintf(ctversion, 4, "%d.%d", PY_MAJOR_VERSION, PY_MINOR_VERSION); PyOS_snprintf(rtversion, 4, "%s", Py_GetVersion()); if (ctversion[0] != rtversion[0] || ctversion[2] != rtversion[2]) { char message[200]; PyOS_snprintf(message, sizeof(message), "compiletime version %s of module '%.100s' " "does not match runtime version %s", ctversion, __Pyx_MODULE_NAME, rtversion); return PyErr_WarnEx(NULL, message, 1); } return 0; } #ifndef __PYX_HAVE_RT_ImportModule #define __PYX_HAVE_RT_ImportModule static PyObject *__Pyx_ImportModule(const char *name) { PyObject *py_name = 0; PyObject *py_module = 0; py_name = __Pyx_PyIdentifier_FromString(name); if (!py_name) goto bad; py_module = PyImport_Import(py_name); Py_DECREF(py_name); return py_module; bad: Py_XDECREF(py_name); return 0; } #endif #ifndef __PYX_HAVE_RT_ImportFunction #define __PYX_HAVE_RT_ImportFunction static int __Pyx_ImportFunction(PyObject *module, const char *funcname, void (**f)(void), const char *sig) { PyObject *d = 0; PyObject *cobj = 0; union { void (*fp)(void); void *p; } tmp; d = PyObject_GetAttrString(module, (char *)"__pyx_capi__"); if (!d) goto bad; cobj = PyDict_GetItemString(d, funcname); if (!cobj) { PyErr_Format(PyExc_ImportError, "%.200s does not export expected C function %.200s", PyModule_GetName(module), funcname); goto bad; } #if PY_VERSION_HEX >= 0x02070000 if (!PyCapsule_IsValid(cobj, sig)) { PyErr_Format(PyExc_TypeError, "C function %.200s.%.200s has wrong signature (expected %.500s, got %.500s)", PyModule_GetName(module), funcname, sig, PyCapsule_GetName(cobj)); goto bad; } tmp.p = PyCapsule_GetPointer(cobj, sig); #else {const char *desc, *s1, *s2; desc = (const char *)PyCObject_GetDesc(cobj); if (!desc) goto bad; s1 = desc; s2 = sig; while (*s1 != '\0' && *s1 == *s2) { s1++; s2++; } if (*s1 != *s2) { PyErr_Format(PyExc_TypeError, "C function %.200s.%.200s has wrong signature (expected %.500s, got %.500s)", PyModule_GetName(module), funcname, sig, desc); goto bad; } tmp.p = PyCObject_AsVoidPtr(cobj);} #endif *f = tmp.fp; if (!(*f)) goto bad; Py_DECREF(d); return 0; bad: Py_XDECREF(d); return -1; } #endif static int __Pyx_InitStrings(__Pyx_StringTabEntry *t) { while (t->p) { #if PY_MAJOR_VERSION < 3 if (t->is_unicode) { *t->p = PyUnicode_DecodeUTF8(t->s, t->n - 1, NULL); } else if (t->intern) { *t->p = PyString_InternFromString(t->s); } else { *t->p = PyString_FromStringAndSize(t->s, t->n - 1); } #else if (t->is_unicode | t->is_str) { if (t->intern) { *t->p = PyUnicode_InternFromString(t->s); } else if (t->encoding) { *t->p = PyUnicode_Decode(t->s, t->n - 1, t->encoding, NULL); } else { *t->p = PyUnicode_FromStringAndSize(t->s, t->n - 1); } } else { *t->p = PyBytes_FromStringAndSize(t->s, t->n - 1); } #endif if (!*t->p) return -1; ++t; } return 0; } static CYTHON_INLINE PyObject* __Pyx_PyUnicode_FromString(const char* c_str) { return __Pyx_PyUnicode_FromStringAndSize(c_str, (Py_ssize_t)strlen(c_str)); } static CYTHON_INLINE char* __Pyx_PyObject_AsString(PyObject* o) { Py_ssize_t ignore; return __Pyx_PyObject_AsStringAndSize(o, &ignore); } static CYTHON_INLINE char* __Pyx_PyObject_AsStringAndSize(PyObject* o, Py_ssize_t *length) { #if CYTHON_COMPILING_IN_CPYTHON && (__PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT) if ( #if PY_MAJOR_VERSION < 3 && __PYX_DEFAULT_STRING_ENCODING_IS_ASCII __Pyx_sys_getdefaultencoding_not_ascii && #endif PyUnicode_Check(o)) { #if PY_VERSION_HEX < 0x03030000 char* defenc_c; PyObject* defenc = _PyUnicode_AsDefaultEncodedString(o, NULL); if (!defenc) return NULL; defenc_c = PyBytes_AS_STRING(defenc); #if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII { char* end = defenc_c + PyBytes_GET_SIZE(defenc); char* c; for (c = defenc_c; c < end; c++) { if ((unsigned char) (*c) >= 128) { PyUnicode_AsASCIIString(o); return NULL; } } } #endif *length = PyBytes_GET_SIZE(defenc); return defenc_c; #else if (__Pyx_PyUnicode_READY(o) == -1) return NULL; #if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII if (PyUnicode_IS_ASCII(o)) { *length = PyUnicode_GET_LENGTH(o); return PyUnicode_AsUTF8(o); } else { PyUnicode_AsASCIIString(o); return NULL; } #else return PyUnicode_AsUTF8AndSize(o, length); #endif #endif } else #endif #if (!CYTHON_COMPILING_IN_PYPY) || (defined(PyByteArray_AS_STRING) && defined(PyByteArray_GET_SIZE)) if (PyByteArray_Check(o)) { *length = PyByteArray_GET_SIZE(o); return PyByteArray_AS_STRING(o); } else #endif { char* result; int r = PyBytes_AsStringAndSize(o, &result, length); if (unlikely(r < 0)) { return NULL; } else { return result; } } } static CYTHON_INLINE int __Pyx_PyObject_IsTrue(PyObject* x) { int is_true = x == Py_True; if (is_true | (x == Py_False) | (x == Py_None)) return is_true; else return PyObject_IsTrue(x); } static CYTHON_INLINE PyObject* __Pyx_PyNumber_Int(PyObject* x) { PyNumberMethods *m; const char *name = NULL; PyObject *res = NULL; #if PY_MAJOR_VERSION < 3 if (PyInt_Check(x) || PyLong_Check(x)) #else if (PyLong_Check(x)) #endif return __Pyx_NewRef(x); m = Py_TYPE(x)->tp_as_number; #if PY_MAJOR_VERSION < 3 if (m && m->nb_int) { name = "int"; res = PyNumber_Int(x); } else if (m && m->nb_long) { name = "long"; res = PyNumber_Long(x); } #else if (m && m->nb_int) { name = "int"; res = PyNumber_Long(x); } #endif if (res) { #if PY_MAJOR_VERSION < 3 if (!PyInt_Check(res) && !PyLong_Check(res)) { #else if (!PyLong_Check(res)) { #endif PyErr_Format(PyExc_TypeError, "__%.4s__ returned non-%.4s (type %.200s)", name, name, Py_TYPE(res)->tp_name); Py_DECREF(res); return NULL; } } else if (!PyErr_Occurred()) { PyErr_SetString(PyExc_TypeError, "an integer is required"); } return res; } static CYTHON_INLINE Py_ssize_t __Pyx_PyIndex_AsSsize_t(PyObject* b) { Py_ssize_t ival; PyObject *x; #if PY_MAJOR_VERSION < 3 if (likely(PyInt_CheckExact(b))) { if (sizeof(Py_ssize_t) >= sizeof(long)) return PyInt_AS_LONG(b); else return PyInt_AsSsize_t(x); } #endif if (likely(PyLong_CheckExact(b))) { #if CYTHON_USE_PYLONG_INTERNALS const digit* digits = ((PyLongObject*)b)->ob_digit; const Py_ssize_t size = Py_SIZE(b); if (likely(__Pyx_sst_abs(size) <= 1)) { ival = likely(size) ? digits[0] : 0; if (size == -1) ival = -ival; return ival; } else { switch (size) { case 2: if (8 * sizeof(Py_ssize_t) > 2 * PyLong_SHIFT) { return (Py_ssize_t) (((((size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])); } break; case -2: if (8 * sizeof(Py_ssize_t) > 2 * PyLong_SHIFT) { return -(Py_ssize_t) (((((size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])); } break; case 3: if (8 * sizeof(Py_ssize_t) > 3 * PyLong_SHIFT) { return (Py_ssize_t) (((((((size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])); } break; case -3: if (8 * sizeof(Py_ssize_t) > 3 * PyLong_SHIFT) { return -(Py_ssize_t) (((((((size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])); } break; case 4: if (8 * sizeof(Py_ssize_t) > 4 * PyLong_SHIFT) { return (Py_ssize_t) (((((((((size_t)digits[3]) << PyLong_SHIFT) | (size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])); } break; case -4: if (8 * sizeof(Py_ssize_t) > 4 * PyLong_SHIFT) { return -(Py_ssize_t) (((((((((size_t)digits[3]) << PyLong_SHIFT) | (size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])); } break; } } #endif return PyLong_AsSsize_t(b); } x = PyNumber_Index(b); if (!x) return -1; ival = PyInt_AsSsize_t(x); Py_DECREF(x); return ival; } static CYTHON_INLINE PyObject * __Pyx_PyInt_FromSize_t(size_t ival) { return PyInt_FromSize_t(ival); } #endif /* Py_PYTHON_H */ pygame_sdl2-2.1.0-for-renpy-6.99.14.1/gen/pygame_sdl2.draw.c0000664000175000017500000123146712660477775022370 0ustar tomtom00000000000000/* Generated by Cython 0.23.4 */ #define PY_SSIZE_T_CLEAN #include "Python.h" #ifndef Py_PYTHON_H #error Python headers needed to compile C extensions, please install development version of Python. #elif PY_VERSION_HEX < 0x02060000 || (0x03000000 <= PY_VERSION_HEX && PY_VERSION_HEX < 0x03020000) #error Cython requires Python 2.6+ or Python 3.2+. #else #define CYTHON_ABI "0_23_4" #include #ifndef offsetof #define offsetof(type, member) ( (size_t) & ((type*)0) -> member ) #endif #if !defined(WIN32) && !defined(MS_WINDOWS) #ifndef __stdcall #define __stdcall #endif #ifndef __cdecl #define __cdecl #endif #ifndef __fastcall #define __fastcall #endif #endif #ifndef DL_IMPORT #define DL_IMPORT(t) t #endif #ifndef DL_EXPORT #define DL_EXPORT(t) t #endif #ifndef PY_LONG_LONG #define PY_LONG_LONG LONG_LONG #endif #ifndef Py_HUGE_VAL #define Py_HUGE_VAL HUGE_VAL #endif #ifdef PYPY_VERSION #define CYTHON_COMPILING_IN_PYPY 1 #define CYTHON_COMPILING_IN_CPYTHON 0 #else #define CYTHON_COMPILING_IN_PYPY 0 #define CYTHON_COMPILING_IN_CPYTHON 1 #endif #if !defined(CYTHON_USE_PYLONG_INTERNALS) && CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x02070000 #define CYTHON_USE_PYLONG_INTERNALS 1 #endif #if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX < 0x02070600 && !defined(Py_OptimizeFlag) #define Py_OptimizeFlag 0 #endif #define __PYX_BUILD_PY_SSIZE_T "n" #define CYTHON_FORMAT_SSIZE_T "z" #if PY_MAJOR_VERSION < 3 #define __Pyx_BUILTIN_MODULE_NAME "__builtin__" #define __Pyx_PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)\ PyCode_New(a+k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos) #define __Pyx_DefaultClassType PyClass_Type #else #define __Pyx_BUILTIN_MODULE_NAME "builtins" #define __Pyx_PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)\ PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos) #define __Pyx_DefaultClassType PyType_Type #endif #ifndef Py_TPFLAGS_CHECKTYPES #define Py_TPFLAGS_CHECKTYPES 0 #endif #ifndef Py_TPFLAGS_HAVE_INDEX #define Py_TPFLAGS_HAVE_INDEX 0 #endif #ifndef Py_TPFLAGS_HAVE_NEWBUFFER #define Py_TPFLAGS_HAVE_NEWBUFFER 0 #endif #ifndef Py_TPFLAGS_HAVE_FINALIZE #define Py_TPFLAGS_HAVE_FINALIZE 0 #endif #if PY_VERSION_HEX > 0x03030000 && defined(PyUnicode_KIND) #define CYTHON_PEP393_ENABLED 1 #define __Pyx_PyUnicode_READY(op) (likely(PyUnicode_IS_READY(op)) ?\ 0 : _PyUnicode_Ready((PyObject *)(op))) #define __Pyx_PyUnicode_GET_LENGTH(u) PyUnicode_GET_LENGTH(u) #define __Pyx_PyUnicode_READ_CHAR(u, i) PyUnicode_READ_CHAR(u, i) #define __Pyx_PyUnicode_KIND(u) PyUnicode_KIND(u) #define __Pyx_PyUnicode_DATA(u) PyUnicode_DATA(u) #define __Pyx_PyUnicode_READ(k, d, i) PyUnicode_READ(k, d, i) #else #define CYTHON_PEP393_ENABLED 0 #define __Pyx_PyUnicode_READY(op) (0) #define __Pyx_PyUnicode_GET_LENGTH(u) PyUnicode_GET_SIZE(u) #define __Pyx_PyUnicode_READ_CHAR(u, i) ((Py_UCS4)(PyUnicode_AS_UNICODE(u)[i])) #define __Pyx_PyUnicode_KIND(u) (sizeof(Py_UNICODE)) #define __Pyx_PyUnicode_DATA(u) ((void*)PyUnicode_AS_UNICODE(u)) #define __Pyx_PyUnicode_READ(k, d, i) ((void)(k), (Py_UCS4)(((Py_UNICODE*)d)[i])) #endif #if CYTHON_COMPILING_IN_PYPY #define __Pyx_PyUnicode_Concat(a, b) PyNumber_Add(a, b) #define __Pyx_PyUnicode_ConcatSafe(a, b) PyNumber_Add(a, b) #else #define __Pyx_PyUnicode_Concat(a, b) PyUnicode_Concat(a, b) #define __Pyx_PyUnicode_ConcatSafe(a, b) ((unlikely((a) == Py_None) || unlikely((b) == Py_None)) ?\ PyNumber_Add(a, b) : __Pyx_PyUnicode_Concat(a, b)) #endif #if CYTHON_COMPILING_IN_PYPY && !defined(PyUnicode_Contains) #define PyUnicode_Contains(u, s) PySequence_Contains(u, s) #endif #define __Pyx_PyString_FormatSafe(a, b) ((unlikely((a) == Py_None)) ? PyNumber_Remainder(a, b) : __Pyx_PyString_Format(a, b)) #define __Pyx_PyUnicode_FormatSafe(a, b) ((unlikely((a) == Py_None)) ? PyNumber_Remainder(a, b) : PyUnicode_Format(a, b)) #if PY_MAJOR_VERSION >= 3 #define __Pyx_PyString_Format(a, b) PyUnicode_Format(a, b) #else #define __Pyx_PyString_Format(a, b) PyString_Format(a, b) #endif #if PY_MAJOR_VERSION >= 3 #define PyBaseString_Type PyUnicode_Type #define PyStringObject PyUnicodeObject #define PyString_Type PyUnicode_Type #define PyString_Check PyUnicode_Check #define PyString_CheckExact PyUnicode_CheckExact #endif #if PY_MAJOR_VERSION >= 3 #define __Pyx_PyBaseString_Check(obj) PyUnicode_Check(obj) #define __Pyx_PyBaseString_CheckExact(obj) PyUnicode_CheckExact(obj) #else #define __Pyx_PyBaseString_Check(obj) (PyString_Check(obj) || PyUnicode_Check(obj)) #define __Pyx_PyBaseString_CheckExact(obj) (PyString_CheckExact(obj) || PyUnicode_CheckExact(obj)) #endif #ifndef PySet_CheckExact #define PySet_CheckExact(obj) (Py_TYPE(obj) == &PySet_Type) #endif #define __Pyx_TypeCheck(obj, type) PyObject_TypeCheck(obj, (PyTypeObject *)type) #if PY_MAJOR_VERSION >= 3 #define PyIntObject PyLongObject #define PyInt_Type PyLong_Type #define PyInt_Check(op) PyLong_Check(op) #define PyInt_CheckExact(op) PyLong_CheckExact(op) #define PyInt_FromString PyLong_FromString #define PyInt_FromUnicode PyLong_FromUnicode #define PyInt_FromLong PyLong_FromLong #define PyInt_FromSize_t PyLong_FromSize_t #define PyInt_FromSsize_t PyLong_FromSsize_t #define PyInt_AsLong PyLong_AsLong #define PyInt_AS_LONG PyLong_AS_LONG #define PyInt_AsSsize_t PyLong_AsSsize_t #define PyInt_AsUnsignedLongMask PyLong_AsUnsignedLongMask #define PyInt_AsUnsignedLongLongMask PyLong_AsUnsignedLongLongMask #define PyNumber_Int PyNumber_Long #endif #if PY_MAJOR_VERSION >= 3 #define PyBoolObject PyLongObject #endif #if PY_MAJOR_VERSION >= 3 && CYTHON_COMPILING_IN_PYPY #ifndef PyUnicode_InternFromString #define PyUnicode_InternFromString(s) PyUnicode_FromString(s) #endif #endif #if PY_VERSION_HEX < 0x030200A4 typedef long Py_hash_t; #define __Pyx_PyInt_FromHash_t PyInt_FromLong #define __Pyx_PyInt_AsHash_t PyInt_AsLong #else #define __Pyx_PyInt_FromHash_t PyInt_FromSsize_t #define __Pyx_PyInt_AsHash_t PyInt_AsSsize_t #endif #if PY_MAJOR_VERSION >= 3 #define __Pyx_PyMethod_New(func, self, klass) ((self) ? PyMethod_New(func, self) : PyInstanceMethod_New(func)) #else #define __Pyx_PyMethod_New(func, self, klass) PyMethod_New(func, self, klass) #endif #if PY_VERSION_HEX >= 0x030500B1 #define __Pyx_PyAsyncMethodsStruct PyAsyncMethods #define __Pyx_PyType_AsAsync(obj) (Py_TYPE(obj)->tp_as_async) #elif CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3 typedef struct { unaryfunc am_await; unaryfunc am_aiter; unaryfunc am_anext; } __Pyx_PyAsyncMethodsStruct; #define __Pyx_PyType_AsAsync(obj) ((__Pyx_PyAsyncMethodsStruct*) (Py_TYPE(obj)->tp_reserved)) #else #define __Pyx_PyType_AsAsync(obj) NULL #endif #ifndef CYTHON_RESTRICT #if defined(__GNUC__) #define CYTHON_RESTRICT __restrict__ #elif defined(_MSC_VER) && _MSC_VER >= 1400 #define CYTHON_RESTRICT __restrict #elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L #define CYTHON_RESTRICT restrict #else #define CYTHON_RESTRICT #endif #endif #define __Pyx_void_to_None(void_result) ((void)(void_result), Py_INCREF(Py_None), Py_None) #ifndef CYTHON_INLINE #if defined(__GNUC__) #define CYTHON_INLINE __inline__ #elif defined(_MSC_VER) #define CYTHON_INLINE __inline #elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L #define CYTHON_INLINE inline #else #define CYTHON_INLINE #endif #endif #if defined(WIN32) || defined(MS_WINDOWS) #define _USE_MATH_DEFINES #endif #include #ifdef NAN #define __PYX_NAN() ((float) NAN) #else static CYTHON_INLINE float __PYX_NAN() { float value; memset(&value, 0xFF, sizeof(value)); return value; } #endif #if PY_MAJOR_VERSION >= 3 #define __Pyx_PyNumber_Divide(x,y) PyNumber_TrueDivide(x,y) #define __Pyx_PyNumber_InPlaceDivide(x,y) PyNumber_InPlaceTrueDivide(x,y) #else #define __Pyx_PyNumber_Divide(x,y) PyNumber_Divide(x,y) #define __Pyx_PyNumber_InPlaceDivide(x,y) PyNumber_InPlaceDivide(x,y) #endif #ifndef __PYX_EXTERN_C #ifdef __cplusplus #define __PYX_EXTERN_C extern "C" #else #define __PYX_EXTERN_C extern #endif #endif #define __PYX_HAVE__pygame_sdl2__draw #define __PYX_HAVE_API__pygame_sdl2__draw #include "stdint.h" #include "string.h" #include "stdio.h" #include "stddef.h" #include "SDL.h" #ifdef _OPENMP #include #endif /* _OPENMP */ #ifdef PYREX_WITHOUT_ASSERTIONS #define CYTHON_WITHOUT_ASSERTIONS #endif #ifndef CYTHON_UNUSED # if defined(__GNUC__) # if !(defined(__cplusplus)) || (__GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 4)) # define CYTHON_UNUSED __attribute__ ((__unused__)) # else # define CYTHON_UNUSED # endif # elif defined(__ICC) || (defined(__INTEL_COMPILER) && !defined(_MSC_VER)) # define CYTHON_UNUSED __attribute__ ((__unused__)) # else # define CYTHON_UNUSED # endif #endif #ifndef CYTHON_NCP_UNUSED # if CYTHON_COMPILING_IN_CPYTHON # define CYTHON_NCP_UNUSED # else # define CYTHON_NCP_UNUSED CYTHON_UNUSED # endif #endif typedef struct {PyObject **p; char *s; const Py_ssize_t n; const char* encoding; const char is_unicode; const char is_str; const char intern; } __Pyx_StringTabEntry; #define __PYX_DEFAULT_STRING_ENCODING_IS_ASCII 0 #define __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT 0 #define __PYX_DEFAULT_STRING_ENCODING "" #define __Pyx_PyObject_FromString __Pyx_PyBytes_FromString #define __Pyx_PyObject_FromStringAndSize __Pyx_PyBytes_FromStringAndSize #define __Pyx_uchar_cast(c) ((unsigned char)c) #define __Pyx_long_cast(x) ((long)x) #define __Pyx_fits_Py_ssize_t(v, type, is_signed) (\ (sizeof(type) < sizeof(Py_ssize_t)) ||\ (sizeof(type) > sizeof(Py_ssize_t) &&\ likely(v < (type)PY_SSIZE_T_MAX ||\ v == (type)PY_SSIZE_T_MAX) &&\ (!is_signed || likely(v > (type)PY_SSIZE_T_MIN ||\ v == (type)PY_SSIZE_T_MIN))) ||\ (sizeof(type) == sizeof(Py_ssize_t) &&\ (is_signed || likely(v < (type)PY_SSIZE_T_MAX ||\ v == (type)PY_SSIZE_T_MAX))) ) #if defined (__cplusplus) && __cplusplus >= 201103L #include #define __Pyx_sst_abs(value) std::abs(value) #elif SIZEOF_INT >= SIZEOF_SIZE_T #define __Pyx_sst_abs(value) abs(value) #elif SIZEOF_LONG >= SIZEOF_SIZE_T #define __Pyx_sst_abs(value) labs(value) #elif defined (_MSC_VER) && defined (_M_X64) #define __Pyx_sst_abs(value) _abs64(value) #elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L #define __Pyx_sst_abs(value) llabs(value) #elif defined (__GNUC__) #define __Pyx_sst_abs(value) __builtin_llabs(value) #else #define __Pyx_sst_abs(value) ((value<0) ? -value : value) #endif static CYTHON_INLINE char* __Pyx_PyObject_AsString(PyObject*); static CYTHON_INLINE char* __Pyx_PyObject_AsStringAndSize(PyObject*, Py_ssize_t* length); #define __Pyx_PyByteArray_FromString(s) PyByteArray_FromStringAndSize((const char*)s, strlen((const char*)s)) #define __Pyx_PyByteArray_FromStringAndSize(s, l) PyByteArray_FromStringAndSize((const char*)s, l) #define __Pyx_PyBytes_FromString PyBytes_FromString #define __Pyx_PyBytes_FromStringAndSize PyBytes_FromStringAndSize static CYTHON_INLINE PyObject* __Pyx_PyUnicode_FromString(const char*); #if PY_MAJOR_VERSION < 3 #define __Pyx_PyStr_FromString __Pyx_PyBytes_FromString #define __Pyx_PyStr_FromStringAndSize __Pyx_PyBytes_FromStringAndSize #else #define __Pyx_PyStr_FromString __Pyx_PyUnicode_FromString #define __Pyx_PyStr_FromStringAndSize __Pyx_PyUnicode_FromStringAndSize #endif #define __Pyx_PyObject_AsSString(s) ((signed char*) __Pyx_PyObject_AsString(s)) #define __Pyx_PyObject_AsUString(s) ((unsigned char*) __Pyx_PyObject_AsString(s)) #define __Pyx_PyObject_FromCString(s) __Pyx_PyObject_FromString((const char*)s) #define __Pyx_PyBytes_FromCString(s) __Pyx_PyBytes_FromString((const char*)s) #define __Pyx_PyByteArray_FromCString(s) __Pyx_PyByteArray_FromString((const char*)s) #define __Pyx_PyStr_FromCString(s) __Pyx_PyStr_FromString((const char*)s) #define __Pyx_PyUnicode_FromCString(s) __Pyx_PyUnicode_FromString((const char*)s) #if PY_MAJOR_VERSION < 3 static CYTHON_INLINE size_t __Pyx_Py_UNICODE_strlen(const Py_UNICODE *u) { const Py_UNICODE *u_end = u; while (*u_end++) ; return (size_t)(u_end - u - 1); } #else #define __Pyx_Py_UNICODE_strlen Py_UNICODE_strlen #endif #define __Pyx_PyUnicode_FromUnicode(u) PyUnicode_FromUnicode(u, __Pyx_Py_UNICODE_strlen(u)) #define __Pyx_PyUnicode_FromUnicodeAndLength PyUnicode_FromUnicode #define __Pyx_PyUnicode_AsUnicode PyUnicode_AsUnicode #define __Pyx_NewRef(obj) (Py_INCREF(obj), obj) #define __Pyx_Owned_Py_None(b) __Pyx_NewRef(Py_None) #define __Pyx_PyBool_FromLong(b) ((b) ? __Pyx_NewRef(Py_True) : __Pyx_NewRef(Py_False)) static CYTHON_INLINE int __Pyx_PyObject_IsTrue(PyObject*); static CYTHON_INLINE PyObject* __Pyx_PyNumber_Int(PyObject* x); static CYTHON_INLINE Py_ssize_t __Pyx_PyIndex_AsSsize_t(PyObject*); static CYTHON_INLINE PyObject * __Pyx_PyInt_FromSize_t(size_t); #if CYTHON_COMPILING_IN_CPYTHON #define __pyx_PyFloat_AsDouble(x) (PyFloat_CheckExact(x) ? PyFloat_AS_DOUBLE(x) : PyFloat_AsDouble(x)) #else #define __pyx_PyFloat_AsDouble(x) PyFloat_AsDouble(x) #endif #define __pyx_PyFloat_AsFloat(x) ((float) __pyx_PyFloat_AsDouble(x)) #if PY_MAJOR_VERSION < 3 && __PYX_DEFAULT_STRING_ENCODING_IS_ASCII static int __Pyx_sys_getdefaultencoding_not_ascii; static int __Pyx_init_sys_getdefaultencoding_params(void) { PyObject* sys; PyObject* default_encoding = NULL; PyObject* ascii_chars_u = NULL; PyObject* ascii_chars_b = NULL; const char* default_encoding_c; sys = PyImport_ImportModule("sys"); if (!sys) goto bad; default_encoding = PyObject_CallMethod(sys, (char*) "getdefaultencoding", NULL); Py_DECREF(sys); if (!default_encoding) goto bad; default_encoding_c = PyBytes_AsString(default_encoding); if (!default_encoding_c) goto bad; if (strcmp(default_encoding_c, "ascii") == 0) { __Pyx_sys_getdefaultencoding_not_ascii = 0; } else { char ascii_chars[128]; int c; for (c = 0; c < 128; c++) { ascii_chars[c] = c; } __Pyx_sys_getdefaultencoding_not_ascii = 1; ascii_chars_u = PyUnicode_DecodeASCII(ascii_chars, 128, NULL); if (!ascii_chars_u) goto bad; ascii_chars_b = PyUnicode_AsEncodedString(ascii_chars_u, default_encoding_c, NULL); if (!ascii_chars_b || !PyBytes_Check(ascii_chars_b) || memcmp(ascii_chars, PyBytes_AS_STRING(ascii_chars_b), 128) != 0) { PyErr_Format( PyExc_ValueError, "This module compiled with c_string_encoding=ascii, but default encoding '%.200s' is not a superset of ascii.", default_encoding_c); goto bad; } Py_DECREF(ascii_chars_u); Py_DECREF(ascii_chars_b); } Py_DECREF(default_encoding); return 0; bad: Py_XDECREF(default_encoding); Py_XDECREF(ascii_chars_u); Py_XDECREF(ascii_chars_b); return -1; } #endif #if __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT && PY_MAJOR_VERSION >= 3 #define __Pyx_PyUnicode_FromStringAndSize(c_str, size) PyUnicode_DecodeUTF8(c_str, size, NULL) #else #define __Pyx_PyUnicode_FromStringAndSize(c_str, size) PyUnicode_Decode(c_str, size, __PYX_DEFAULT_STRING_ENCODING, NULL) #if __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT static char* __PYX_DEFAULT_STRING_ENCODING; static int __Pyx_init_sys_getdefaultencoding_params(void) { PyObject* sys; PyObject* default_encoding = NULL; char* default_encoding_c; sys = PyImport_ImportModule("sys"); if (!sys) goto bad; default_encoding = PyObject_CallMethod(sys, (char*) (const char*) "getdefaultencoding", NULL); Py_DECREF(sys); if (!default_encoding) goto bad; default_encoding_c = PyBytes_AsString(default_encoding); if (!default_encoding_c) goto bad; __PYX_DEFAULT_STRING_ENCODING = (char*) malloc(strlen(default_encoding_c)); if (!__PYX_DEFAULT_STRING_ENCODING) goto bad; strcpy(__PYX_DEFAULT_STRING_ENCODING, default_encoding_c); Py_DECREF(default_encoding); return 0; bad: Py_XDECREF(default_encoding); return -1; } #endif #endif /* Test for GCC > 2.95 */ #if defined(__GNUC__) && (__GNUC__ > 2 || (__GNUC__ == 2 && (__GNUC_MINOR__ > 95))) #define likely(x) __builtin_expect(!!(x), 1) #define unlikely(x) __builtin_expect(!!(x), 0) #else /* !__GNUC__ or GCC < 2.95 */ #define likely(x) (x) #define unlikely(x) (x) #endif /* __GNUC__ */ static PyObject *__pyx_m; static PyObject *__pyx_d; static PyObject *__pyx_b; static PyObject *__pyx_empty_tuple; static PyObject *__pyx_empty_bytes; static int __pyx_lineno; static int __pyx_clineno = 0; static const char * __pyx_cfilenm= __FILE__; static const char *__pyx_filename; static const char *__pyx_f[] = { "src/pygame_sdl2/draw.pyx", "src/pygame_sdl2/surface.pxd", }; /*--- Type declarations ---*/ struct __pyx_obj_11pygame_sdl2_7surface_Surface; /* "pygame_sdl2/surface.pxd":23 * from sdl2 cimport SDL_Surface * * cdef class Surface: # <<<<<<<<<<<<<< * # Allow weak references. * cdef object __weakref__ */ struct __pyx_obj_11pygame_sdl2_7surface_Surface { PyObject_HEAD struct __pyx_vtabstruct_11pygame_sdl2_7surface_Surface *__pyx_vtab; PyObject *__weakref__; SDL_Surface *surface; int owns_surface; int window_surface; PyObject *locklist; struct __pyx_obj_11pygame_sdl2_7surface_Surface *parent; struct __pyx_obj_11pygame_sdl2_7surface_Surface *root; int offset_x; int offset_y; PyObject *get_window_flags; int has_alpha; }; struct __pyx_vtabstruct_11pygame_sdl2_7surface_Surface { void (*take_surface)(struct __pyx_obj_11pygame_sdl2_7surface_Surface *, SDL_Surface *); }; static struct __pyx_vtabstruct_11pygame_sdl2_7surface_Surface *__pyx_vtabptr_11pygame_sdl2_7surface_Surface; /* --- Runtime support code (head) --- */ #ifndef CYTHON_REFNANNY #define CYTHON_REFNANNY 0 #endif #if CYTHON_REFNANNY typedef struct { void (*INCREF)(void*, PyObject*, int); void (*DECREF)(void*, PyObject*, int); void (*GOTREF)(void*, PyObject*, int); void (*GIVEREF)(void*, PyObject*, int); void* (*SetupContext)(const char*, int, const char*); void (*FinishContext)(void**); } __Pyx_RefNannyAPIStruct; static __Pyx_RefNannyAPIStruct *__Pyx_RefNanny = NULL; static __Pyx_RefNannyAPIStruct *__Pyx_RefNannyImportAPI(const char *modname); #define __Pyx_RefNannyDeclarations void *__pyx_refnanny = NULL; #ifdef WITH_THREAD #define __Pyx_RefNannySetupContext(name, acquire_gil)\ if (acquire_gil) {\ PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure();\ __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), __LINE__, __FILE__);\ PyGILState_Release(__pyx_gilstate_save);\ } else {\ __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), __LINE__, __FILE__);\ } #else #define __Pyx_RefNannySetupContext(name, acquire_gil)\ __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), __LINE__, __FILE__) #endif #define __Pyx_RefNannyFinishContext()\ __Pyx_RefNanny->FinishContext(&__pyx_refnanny) #define __Pyx_INCREF(r) __Pyx_RefNanny->INCREF(__pyx_refnanny, (PyObject *)(r), __LINE__) #define __Pyx_DECREF(r) __Pyx_RefNanny->DECREF(__pyx_refnanny, (PyObject *)(r), __LINE__) #define __Pyx_GOTREF(r) __Pyx_RefNanny->GOTREF(__pyx_refnanny, (PyObject *)(r), __LINE__) #define __Pyx_GIVEREF(r) __Pyx_RefNanny->GIVEREF(__pyx_refnanny, (PyObject *)(r), __LINE__) #define __Pyx_XINCREF(r) do { if((r) != NULL) {__Pyx_INCREF(r); }} while(0) #define __Pyx_XDECREF(r) do { if((r) != NULL) {__Pyx_DECREF(r); }} while(0) #define __Pyx_XGOTREF(r) do { if((r) != NULL) {__Pyx_GOTREF(r); }} while(0) #define __Pyx_XGIVEREF(r) do { if((r) != NULL) {__Pyx_GIVEREF(r);}} while(0) #else #define __Pyx_RefNannyDeclarations #define __Pyx_RefNannySetupContext(name, acquire_gil) #define __Pyx_RefNannyFinishContext() #define __Pyx_INCREF(r) Py_INCREF(r) #define __Pyx_DECREF(r) Py_DECREF(r) #define __Pyx_GOTREF(r) #define __Pyx_GIVEREF(r) #define __Pyx_XINCREF(r) Py_XINCREF(r) #define __Pyx_XDECREF(r) Py_XDECREF(r) #define __Pyx_XGOTREF(r) #define __Pyx_XGIVEREF(r) #endif #define __Pyx_XDECREF_SET(r, v) do {\ PyObject *tmp = (PyObject *) r;\ r = v; __Pyx_XDECREF(tmp);\ } while (0) #define __Pyx_DECREF_SET(r, v) do {\ PyObject *tmp = (PyObject *) r;\ r = v; __Pyx_DECREF(tmp);\ } while (0) #define __Pyx_CLEAR(r) do { PyObject* tmp = ((PyObject*)(r)); r = NULL; __Pyx_DECREF(tmp);} while(0) #define __Pyx_XCLEAR(r) do { if((r) != NULL) {PyObject* tmp = ((PyObject*)(r)); r = NULL; __Pyx_DECREF(tmp);}} while(0) static void __Pyx_RaiseArgtupleInvalid(const char* func_name, int exact, Py_ssize_t num_min, Py_ssize_t num_max, Py_ssize_t num_found); static void __Pyx_RaiseDoubleKeywordsError(const char* func_name, PyObject* kw_name); static int __Pyx_ParseOptionalKeywords(PyObject *kwds, PyObject **argnames[],\ PyObject *kwds2, PyObject *values[], Py_ssize_t num_pos_args,\ const char* function_name); static CYTHON_INLINE int __Pyx_ArgTypeTest(PyObject *obj, PyTypeObject *type, int none_allowed, const char *name, int exact); #if CYTHON_COMPILING_IN_CPYTHON static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStr(PyObject* obj, PyObject* attr_name) { PyTypeObject* tp = Py_TYPE(obj); if (likely(tp->tp_getattro)) return tp->tp_getattro(obj, attr_name); #if PY_MAJOR_VERSION < 3 if (likely(tp->tp_getattr)) return tp->tp_getattr(obj, PyString_AS_STRING(attr_name)); #endif return PyObject_GetAttr(obj, attr_name); } #else #define __Pyx_PyObject_GetAttrStr(o,n) PyObject_GetAttr(o,n) #endif static PyObject *__Pyx_GetBuiltinName(PyObject *name); static CYTHON_INLINE PyObject *__Pyx_GetModuleGlobalName(PyObject *name); #if CYTHON_COMPILING_IN_CPYTHON static CYTHON_INLINE PyObject* __Pyx_PyObject_Call(PyObject *func, PyObject *arg, PyObject *kw); #else #define __Pyx_PyObject_Call(func, arg, kw) PyObject_Call(func, arg, kw) #endif #if CYTHON_COMPILING_IN_CPYTHON static CYTHON_INLINE PyObject* __Pyx_PyObject_CallMethO(PyObject *func, PyObject *arg); #endif static CYTHON_INLINE PyObject* __Pyx_PyObject_CallOneArg(PyObject *func, PyObject *arg); #if CYTHON_COMPILING_IN_CPYTHON static PyObject* __Pyx_PyInt_EqObjC(PyObject *op1, PyObject *op2, long intval, int inplace); #else #define __Pyx_PyInt_EqObjC(op1, op2, intval, inplace)\ PyObject_RichCompare(op1, op2, Py_EQ) #endif #if CYTHON_COMPILING_IN_CPYTHON static PyObject* __Pyx_PyInt_AddObjC(PyObject *op1, PyObject *op2, long intval, int inplace); #else #define __Pyx_PyInt_AddObjC(op1, op2, intval, inplace)\ (inplace ? PyNumber_InPlaceAdd(op1, op2) : PyNumber_Add(op1, op2)) #endif #if CYTHON_COMPILING_IN_CPYTHON static CYTHON_INLINE PyObject* __Pyx_PyObject_CallNoArg(PyObject *func); #else #define __Pyx_PyObject_CallNoArg(func) __Pyx_PyObject_Call(func, __pyx_empty_tuple, NULL) #endif #define __Pyx_GetItemInt(o, i, type, is_signed, to_py_func, is_list, wraparound, boundscheck)\ (__Pyx_fits_Py_ssize_t(i, type, is_signed) ?\ __Pyx_GetItemInt_Fast(o, (Py_ssize_t)i, is_list, wraparound, boundscheck) :\ (is_list ? (PyErr_SetString(PyExc_IndexError, "list index out of range"), (PyObject*)NULL) :\ __Pyx_GetItemInt_Generic(o, to_py_func(i)))) #define __Pyx_GetItemInt_List(o, i, type, is_signed, to_py_func, is_list, wraparound, boundscheck)\ (__Pyx_fits_Py_ssize_t(i, type, is_signed) ?\ __Pyx_GetItemInt_List_Fast(o, (Py_ssize_t)i, wraparound, boundscheck) :\ (PyErr_SetString(PyExc_IndexError, "list index out of range"), (PyObject*)NULL)) static CYTHON_INLINE PyObject *__Pyx_GetItemInt_List_Fast(PyObject *o, Py_ssize_t i, int wraparound, int boundscheck); #define __Pyx_GetItemInt_Tuple(o, i, type, is_signed, to_py_func, is_list, wraparound, boundscheck)\ (__Pyx_fits_Py_ssize_t(i, type, is_signed) ?\ __Pyx_GetItemInt_Tuple_Fast(o, (Py_ssize_t)i, wraparound, boundscheck) :\ (PyErr_SetString(PyExc_IndexError, "tuple index out of range"), (PyObject*)NULL)) static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Tuple_Fast(PyObject *o, Py_ssize_t i, int wraparound, int boundscheck); static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Generic(PyObject *o, PyObject* j); static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Fast(PyObject *o, Py_ssize_t i, int is_list, int wraparound, int boundscheck); static CYTHON_INLINE void __Pyx_RaiseTooManyValuesError(Py_ssize_t expected); static CYTHON_INLINE void __Pyx_RaiseNeedMoreValuesError(Py_ssize_t index); static CYTHON_INLINE int __Pyx_IterFinish(void); static int __Pyx_IternextUnpackEndCheck(PyObject *retval, Py_ssize_t expected); #if CYTHON_COMPILING_IN_CPYTHON static PyObject* __Pyx_PyInt_SubtractObjC(PyObject *op1, PyObject *op2, long intval, int inplace); #else #define __Pyx_PyInt_SubtractObjC(op1, op2, intval, inplace)\ (inplace ? PyNumber_InPlaceSubtract(op1, op2) : PyNumber_Subtract(op1, op2)) #endif static CYTHON_INLINE void __Pyx_ErrRestore(PyObject *type, PyObject *value, PyObject *tb); static CYTHON_INLINE void __Pyx_ErrFetch(PyObject **type, PyObject **value, PyObject **tb); static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, PyObject *cause); static void* __Pyx_GetVtable(PyObject *dict); static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list, int level); static PyObject* __Pyx_ImportFrom(PyObject* module, PyObject* name); typedef struct { int code_line; PyCodeObject* code_object; } __Pyx_CodeObjectCacheEntry; struct __Pyx_CodeObjectCache { int count; int max_count; __Pyx_CodeObjectCacheEntry* entries; }; static struct __Pyx_CodeObjectCache __pyx_code_cache = {0,0,NULL}; static int __pyx_bisect_code_objects(__Pyx_CodeObjectCacheEntry* entries, int count, int code_line); static PyCodeObject *__pyx_find_code_object(int code_line); static void __pyx_insert_code_object(int code_line, PyCodeObject* code_object); static void __Pyx_AddTraceback(const char *funcname, int c_line, int py_line, const char *filename); static CYTHON_INLINE PyObject* __Pyx_PyInt_From_long(long value); static CYTHON_INLINE long __Pyx_PyInt_As_long(PyObject *); static CYTHON_INLINE int __Pyx_PyInt_As_int(PyObject *); static int __Pyx_check_binary_version(void); #if !defined(__Pyx_PyIdentifier_FromString) #if PY_MAJOR_VERSION < 3 #define __Pyx_PyIdentifier_FromString(s) PyString_FromString(s) #else #define __Pyx_PyIdentifier_FromString(s) PyUnicode_FromString(s) #endif #endif static PyObject *__Pyx_ImportModule(const char *name); static PyTypeObject *__Pyx_ImportType(const char *module_name, const char *class_name, size_t size, int strict); static int __Pyx_InitStrings(__Pyx_StringTabEntry *t); /* Module declarations from 'libc.stdint' */ /* Module declarations from 'libc.string' */ /* Module declarations from 'libc.stdio' */ /* Module declarations from 'libc.stddef' */ /* Module declarations from 'sdl2' */ /* Module declarations from 'pygame_sdl2.surface' */ static PyTypeObject *__pyx_ptype_11pygame_sdl2_7surface_Surface = 0; /* Module declarations from 'pygame_sdl2.draw' */ #define __Pyx_MODULE_NAME "pygame_sdl2.draw" int __pyx_module_is_main_pygame_sdl2__draw = 0; /* Implementation of 'pygame_sdl2.draw' */ static char __pyx_k_h[] = "h"; static char __pyx_k_n[] = "n"; static char __pyx_k_r[] = "r"; static char __pyx_k_w[] = "w"; static char __pyx_k_x[] = "x"; static char __pyx_k_y[] = "y"; static char __pyx_k__6[] = "*"; static char __pyx_k_x1[] = "x1"; static char __pyx_k_x2[] = "x2"; static char __pyx_k_y1[] = "y1"; static char __pyx_k_y2[] = "y2"; static char __pyx_k_arc[] = "arc"; static char __pyx_k_box[] = "box"; static char __pyx_k_pos[] = "pos"; static char __pyx_k_Rect[] = "Rect"; static char __pyx_k_clip[] = "clip"; static char __pyx_k_line[] = "line"; static char __pyx_k_main[] = "__main__"; static char __pyx_k_rect[] = "rect"; static char __pyx_k_test[] = "__test__"; static char __pyx_k_blend[] = "blend"; static char __pyx_k_color[] = "color"; static char __pyx_k_dirty[] = "dirty"; static char __pyx_k_error[] = "error"; static char __pyx_k_lines[] = "lines"; static char __pyx_k_width[] = "width"; static char __pyx_k_aaline[] = "aaline"; static char __pyx_k_circle[] = "circle"; static char __pyx_k_closed[] = "closed"; static char __pyx_k_endpos[] = "endpos"; static char __pyx_k_import[] = "__import__"; static char __pyx_k_radius[] = "radius"; static char __pyx_k_aalines[] = "aalines"; static char __pyx_k_ellipse[] = "ellipse"; static char __pyx_k_end_pos[] = "end_pos"; static char __pyx_k_gfxdraw[] = "gfxdraw"; static char __pyx_k_polygon[] = "polygon"; static char __pyx_k_surface[] = "surface"; static char __pyx_k_get_rect[] = "get_rect"; static char __pyx_k_startpos[] = "startpos"; static char __pyx_k_union_ip[] = "union_ip"; static char __pyx_k_pointlist[] = "pointlist"; static char __pyx_k_rectangle[] = "rectangle"; static char __pyx_k_start_pos[] = "start_pos"; static char __pyx_k_pyx_vtable[] = "__pyx_vtable__"; static char __pyx_k_stop_angle[] = "stop_angle"; static char __pyx_k_thick_line[] = "thick_line"; static char __pyx_k_start_angle[] = "start_angle"; static char __pyx_k_filled_circle[] = "filled_circle"; static char __pyx_k_filled_polygon[] = "filled_polygon"; static char __pyx_k_Not_implemented[] = "Not implemented."; static char __pyx_k_pygame_sdl2_draw[] = "pygame_sdl2.draw"; static char __pyx_k_pygame_sdl2_rect[] = "pygame_sdl2.rect"; static char __pyx_k_pygame_sdl2_error[] = "pygame_sdl2.error"; static char __pyx_k_pygame_sdl2_gfxdraw[] = "pygame_sdl2.gfxdraw"; static char __pyx_k_home_tom_ab_pygame_sdl2_src_pyg[] = "/home/tom/ab/pygame_sdl2/src/pygame_sdl2/draw.pyx"; static PyObject *__pyx_kp_s_Not_implemented; static PyObject *__pyx_n_s_Rect; static PyObject *__pyx_n_s__6; static PyObject *__pyx_n_s_aaline; static PyObject *__pyx_n_s_aalines; static PyObject *__pyx_n_s_arc; static PyObject *__pyx_n_s_blend; static PyObject *__pyx_n_s_box; static PyObject *__pyx_n_s_circle; static PyObject *__pyx_n_s_clip; static PyObject *__pyx_n_s_closed; static PyObject *__pyx_n_s_color; static PyObject *__pyx_n_s_dirty; static PyObject *__pyx_n_s_ellipse; static PyObject *__pyx_n_s_end_pos; static PyObject *__pyx_n_s_endpos; static PyObject *__pyx_n_s_error; static PyObject *__pyx_n_s_filled_circle; static PyObject *__pyx_n_s_filled_polygon; static PyObject *__pyx_n_s_get_rect; static PyObject *__pyx_n_s_gfxdraw; static PyObject *__pyx_n_s_h; static PyObject *__pyx_kp_s_home_tom_ab_pygame_sdl2_src_pyg; static PyObject *__pyx_n_s_import; static PyObject *__pyx_n_s_line; static PyObject *__pyx_n_s_lines; static PyObject *__pyx_n_s_main; static PyObject *__pyx_n_s_n; static PyObject *__pyx_n_s_pointlist; static PyObject *__pyx_n_s_polygon; static PyObject *__pyx_n_s_pos; static PyObject *__pyx_n_s_pygame_sdl2_draw; static PyObject *__pyx_n_s_pygame_sdl2_error; static PyObject *__pyx_n_s_pygame_sdl2_gfxdraw; static PyObject *__pyx_n_s_pygame_sdl2_rect; static PyObject *__pyx_n_s_pyx_vtable; static PyObject *__pyx_n_s_r; static PyObject *__pyx_n_s_radius; static PyObject *__pyx_n_s_rect; static PyObject *__pyx_n_s_rectangle; static PyObject *__pyx_n_s_start_angle; static PyObject *__pyx_n_s_start_pos; static PyObject *__pyx_n_s_startpos; static PyObject *__pyx_n_s_stop_angle; static PyObject *__pyx_n_s_surface; static PyObject *__pyx_n_s_test; static PyObject *__pyx_n_s_thick_line; static PyObject *__pyx_n_s_union_ip; static PyObject *__pyx_n_s_w; static PyObject *__pyx_n_s_width; static PyObject *__pyx_n_s_x; static PyObject *__pyx_n_s_x1; static PyObject *__pyx_n_s_x2; static PyObject *__pyx_n_s_y; static PyObject *__pyx_n_s_y1; static PyObject *__pyx_n_s_y2; static PyObject *__pyx_pf_11pygame_sdl2_4draw_rect(CYTHON_UNUSED PyObject *__pyx_self, struct __pyx_obj_11pygame_sdl2_7surface_Surface *__pyx_v_surface, PyObject *__pyx_v_color, PyObject *__pyx_v_rect, PyObject *__pyx_v_width); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_4draw_2polygon(CYTHON_UNUSED PyObject *__pyx_self, struct __pyx_obj_11pygame_sdl2_7surface_Surface *__pyx_v_surface, PyObject *__pyx_v_color, PyObject *__pyx_v_pointlist, PyObject *__pyx_v_width); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_4draw_4circle(CYTHON_UNUSED PyObject *__pyx_self, struct __pyx_obj_11pygame_sdl2_7surface_Surface *__pyx_v_surface, PyObject *__pyx_v_color, PyObject *__pyx_v_pos, PyObject *__pyx_v_radius, PyObject *__pyx_v_width); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_4draw_6ellipse(CYTHON_UNUSED PyObject *__pyx_self, CYTHON_UNUSED struct __pyx_obj_11pygame_sdl2_7surface_Surface *__pyx_v_surface, CYTHON_UNUSED PyObject *__pyx_v_color, CYTHON_UNUSED PyObject *__pyx_v_rect, CYTHON_UNUSED PyObject *__pyx_v_width); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_4draw_8arc(CYTHON_UNUSED PyObject *__pyx_self, CYTHON_UNUSED struct __pyx_obj_11pygame_sdl2_7surface_Surface *__pyx_v_surface, CYTHON_UNUSED PyObject *__pyx_v_color, CYTHON_UNUSED PyObject *__pyx_v_rect, CYTHON_UNUSED PyObject *__pyx_v_start_angle, CYTHON_UNUSED PyObject *__pyx_v_stop_angle, CYTHON_UNUSED PyObject *__pyx_v_width); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_4draw_10line(CYTHON_UNUSED PyObject *__pyx_self, struct __pyx_obj_11pygame_sdl2_7surface_Surface *__pyx_v_surface, PyObject *__pyx_v_color, PyObject *__pyx_v_start_pos, PyObject *__pyx_v_end_pos, PyObject *__pyx_v_width); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_4draw_12lines(CYTHON_UNUSED PyObject *__pyx_self, struct __pyx_obj_11pygame_sdl2_7surface_Surface *__pyx_v_surface, PyObject *__pyx_v_color, PyObject *__pyx_v_closed, PyObject *__pyx_v_pointlist, PyObject *__pyx_v_width); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_4draw_14aaline(CYTHON_UNUSED PyObject *__pyx_self, struct __pyx_obj_11pygame_sdl2_7surface_Surface *__pyx_v_surface, PyObject *__pyx_v_color, PyObject *__pyx_v_startpos, PyObject *__pyx_v_endpos, CYTHON_UNUSED PyObject *__pyx_v_blend); /* proto */ static PyObject *__pyx_pf_11pygame_sdl2_4draw_16aalines(CYTHON_UNUSED PyObject *__pyx_self, struct __pyx_obj_11pygame_sdl2_7surface_Surface *__pyx_v_surface, PyObject *__pyx_v_color, PyObject *__pyx_v_closed, PyObject *__pyx_v_pointlist, CYTHON_UNUSED PyObject *__pyx_v_blend); /* proto */ static PyObject *__pyx_int_0; static PyObject *__pyx_int_1; static PyObject *__pyx_int_2; static PyObject *__pyx_tuple_; static PyObject *__pyx_tuple__2; static PyObject *__pyx_tuple__3; static PyObject *__pyx_tuple__4; static PyObject *__pyx_tuple__5; static PyObject *__pyx_tuple__7; static PyObject *__pyx_tuple__9; static PyObject *__pyx_tuple__11; static PyObject *__pyx_tuple__13; static PyObject *__pyx_tuple__15; static PyObject *__pyx_tuple__17; static PyObject *__pyx_tuple__19; static PyObject *__pyx_tuple__21; static PyObject *__pyx_tuple__23; static PyObject *__pyx_codeobj__8; static PyObject *__pyx_codeobj__10; static PyObject *__pyx_codeobj__12; static PyObject *__pyx_codeobj__14; static PyObject *__pyx_codeobj__16; static PyObject *__pyx_codeobj__18; static PyObject *__pyx_codeobj__20; static PyObject *__pyx_codeobj__22; static PyObject *__pyx_codeobj__24; /* "pygame_sdl2/draw.pyx":26 * from pygame_sdl2.error import error * * def rect(Surface surface, color, rect, width=0): # <<<<<<<<<<<<<< * if not isinstance(rect, Rect): * rect = Rect(rect) */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_4draw_1rect(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static PyMethodDef __pyx_mdef_11pygame_sdl2_4draw_1rect = {"rect", (PyCFunction)__pyx_pw_11pygame_sdl2_4draw_1rect, METH_VARARGS|METH_KEYWORDS, 0}; static PyObject *__pyx_pw_11pygame_sdl2_4draw_1rect(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { struct __pyx_obj_11pygame_sdl2_7surface_Surface *__pyx_v_surface = 0; PyObject *__pyx_v_color = 0; PyObject *__pyx_v_rect = 0; PyObject *__pyx_v_width = 0; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("rect (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_surface,&__pyx_n_s_color,&__pyx_n_s_rect,&__pyx_n_s_width,0}; PyObject* values[4] = {0,0,0,0}; values[3] = ((PyObject *)__pyx_int_0); if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_surface)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; case 1: if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_color)) != 0)) kw_args--; else { __Pyx_RaiseArgtupleInvalid("rect", 0, 3, 4, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 26; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } case 2: if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_rect)) != 0)) kw_args--; else { __Pyx_RaiseArgtupleInvalid("rect", 0, 3, 4, 2); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 26; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } case 3: if (kw_args > 0) { PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_width); if (value) { values[3] = value; kw_args--; } } } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "rect") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 26; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } } else { switch (PyTuple_GET_SIZE(__pyx_args)) { case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); values[1] = PyTuple_GET_ITEM(__pyx_args, 1); values[0] = PyTuple_GET_ITEM(__pyx_args, 0); break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_surface = ((struct __pyx_obj_11pygame_sdl2_7surface_Surface *)values[0]); __pyx_v_color = values[1]; __pyx_v_rect = values[2]; __pyx_v_width = values[3]; } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("rect", 0, 3, 4, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 26; __pyx_clineno = __LINE__; goto __pyx_L3_error;} __pyx_L3_error:; __Pyx_AddTraceback("pygame_sdl2.draw.rect", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_surface), __pyx_ptype_11pygame_sdl2_7surface_Surface, 1, "surface", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 26; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_r = __pyx_pf_11pygame_sdl2_4draw_rect(__pyx_self, __pyx_v_surface, __pyx_v_color, __pyx_v_rect, __pyx_v_width); /* function exit code */ goto __pyx_L0; __pyx_L1_error:; __pyx_r = NULL; __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_4draw_rect(CYTHON_UNUSED PyObject *__pyx_self, struct __pyx_obj_11pygame_sdl2_7surface_Surface *__pyx_v_surface, PyObject *__pyx_v_color, PyObject *__pyx_v_rect, PyObject *__pyx_v_width) { PyObject *__pyx_v_n = NULL; PyObject *__pyx_v_r = NULL; PyObject *__pyx_v_dirty = NULL; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_t_2; int __pyx_t_3; PyObject *__pyx_t_4 = NULL; PyObject *__pyx_t_5 = NULL; PyObject *__pyx_t_6 = NULL; Py_ssize_t __pyx_t_7; PyObject *__pyx_t_8 = NULL; PyObject *__pyx_t_9 = NULL; PyObject *__pyx_t_10 = NULL; PyObject *__pyx_t_11 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("rect", 0); __Pyx_INCREF(__pyx_v_rect); /* "pygame_sdl2/draw.pyx":27 * * def rect(Surface surface, color, rect, width=0): * if not isinstance(rect, Rect): # <<<<<<<<<<<<<< * rect = Rect(rect) * */ __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_Rect); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 27; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = PyObject_IsInstance(__pyx_v_rect, __pyx_t_1); if (unlikely(__pyx_t_2 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 27; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_3 = ((!(__pyx_t_2 != 0)) != 0); if (__pyx_t_3) { /* "pygame_sdl2/draw.pyx":28 * def rect(Surface surface, color, rect, width=0): * if not isinstance(rect, Rect): * rect = Rect(rect) # <<<<<<<<<<<<<< * * if width == 0: */ __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_Rect); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 28; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); __pyx_t_5 = NULL; if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_4))) { __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4); if (likely(__pyx_t_5)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4); __Pyx_INCREF(__pyx_t_5); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_4, function); } } if (!__pyx_t_5) { __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_v_rect); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 28; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); } else { __pyx_t_6 = PyTuple_New(1+1); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 28; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_6); __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_5); __pyx_t_5 = NULL; __Pyx_INCREF(__pyx_v_rect); __Pyx_GIVEREF(__pyx_v_rect); PyTuple_SET_ITEM(__pyx_t_6, 0+1, __pyx_v_rect); __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_6, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 28; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; } __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF_SET(__pyx_v_rect, __pyx_t_1); __pyx_t_1 = 0; /* "pygame_sdl2/draw.pyx":27 * * def rect(Surface surface, color, rect, width=0): * if not isinstance(rect, Rect): # <<<<<<<<<<<<<< * rect = Rect(rect) * */ } /* "pygame_sdl2/draw.pyx":30 * rect = Rect(rect) * * if width == 0: # <<<<<<<<<<<<<< * gfxdraw.box(surface, rect, color) * else: */ __pyx_t_1 = __Pyx_PyInt_EqObjC(__pyx_v_width, __pyx_int_0, 0, 0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 30; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 30; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (__pyx_t_3) { /* "pygame_sdl2/draw.pyx":31 * * if width == 0: * gfxdraw.box(surface, rect, color) # <<<<<<<<<<<<<< * else: * gfxdraw.rectangle(surface, rect, color) */ __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_gfxdraw); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 31; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_box); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 31; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_t_4 = NULL; __pyx_t_7 = 0; if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_6))) { __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_6); if (likely(__pyx_t_4)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6); __Pyx_INCREF(__pyx_t_4); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_6, function); __pyx_t_7 = 1; } } __pyx_t_5 = PyTuple_New(3+__pyx_t_7); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 31; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); if (__pyx_t_4) { __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_4); __pyx_t_4 = NULL; } __Pyx_INCREF(((PyObject *)__pyx_v_surface)); __Pyx_GIVEREF(((PyObject *)__pyx_v_surface)); PyTuple_SET_ITEM(__pyx_t_5, 0+__pyx_t_7, ((PyObject *)__pyx_v_surface)); __Pyx_INCREF(__pyx_v_rect); __Pyx_GIVEREF(__pyx_v_rect); PyTuple_SET_ITEM(__pyx_t_5, 1+__pyx_t_7, __pyx_v_rect); __Pyx_INCREF(__pyx_v_color); __Pyx_GIVEREF(__pyx_v_color); PyTuple_SET_ITEM(__pyx_t_5, 2+__pyx_t_7, __pyx_v_color); __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_5, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 31; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "pygame_sdl2/draw.pyx":30 * rect = Rect(rect) * * if width == 0: # <<<<<<<<<<<<<< * gfxdraw.box(surface, rect, color) * else: */ goto __pyx_L4; } /* "pygame_sdl2/draw.pyx":33 * gfxdraw.box(surface, rect, color) * else: * gfxdraw.rectangle(surface, rect, color) # <<<<<<<<<<<<<< * n = 1 * while n < width: */ /*else*/ { __pyx_t_6 = __Pyx_GetModuleGlobalName(__pyx_n_s_gfxdraw); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 33; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_6); __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_rectangle); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 33; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __pyx_t_6 = NULL; __pyx_t_7 = 0; if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_5))) { __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_5); if (likely(__pyx_t_6)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5); __Pyx_INCREF(__pyx_t_6); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_5, function); __pyx_t_7 = 1; } } __pyx_t_4 = PyTuple_New(3+__pyx_t_7); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 33; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); if (__pyx_t_6) { __Pyx_GIVEREF(__pyx_t_6); PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_6); __pyx_t_6 = NULL; } __Pyx_INCREF(((PyObject *)__pyx_v_surface)); __Pyx_GIVEREF(((PyObject *)__pyx_v_surface)); PyTuple_SET_ITEM(__pyx_t_4, 0+__pyx_t_7, ((PyObject *)__pyx_v_surface)); __Pyx_INCREF(__pyx_v_rect); __Pyx_GIVEREF(__pyx_v_rect); PyTuple_SET_ITEM(__pyx_t_4, 1+__pyx_t_7, __pyx_v_rect); __Pyx_INCREF(__pyx_v_color); __Pyx_GIVEREF(__pyx_v_color); PyTuple_SET_ITEM(__pyx_t_4, 2+__pyx_t_7, __pyx_v_color); __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_4, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 33; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "pygame_sdl2/draw.pyx":34 * else: * gfxdraw.rectangle(surface, rect, color) * n = 1 # <<<<<<<<<<<<<< * while n < width: * r = Rect(rect.x - n, rect.y - n, rect.w + (n*2), rect.h + (n*2)) */ __Pyx_INCREF(__pyx_int_1); __pyx_v_n = __pyx_int_1; /* "pygame_sdl2/draw.pyx":35 * gfxdraw.rectangle(surface, rect, color) * n = 1 * while n < width: # <<<<<<<<<<<<<< * r = Rect(rect.x - n, rect.y - n, rect.w + (n*2), rect.h + (n*2)) * gfxdraw.rectangle(surface, r, color) */ while (1) { __pyx_t_1 = PyObject_RichCompare(__pyx_v_n, __pyx_v_width, Py_LT); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 35; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 35; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (!__pyx_t_3) break; /* "pygame_sdl2/draw.pyx":36 * n = 1 * while n < width: * r = Rect(rect.x - n, rect.y - n, rect.w + (n*2), rect.h + (n*2)) # <<<<<<<<<<<<<< * gfxdraw.rectangle(surface, r, color) * r = Rect(rect.x + n, rect.y + n, rect.w - (n*2), rect.h - (n*2)) */ __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_Rect); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 36; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_rect, __pyx_n_s_x); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 36; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); __pyx_t_6 = PyNumber_Subtract(__pyx_t_4, __pyx_v_n); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 36; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_rect, __pyx_n_s_y); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 36; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); __pyx_t_8 = PyNumber_Subtract(__pyx_t_4, __pyx_v_n); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 36; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_8); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_rect, __pyx_n_s_w); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 36; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); __pyx_t_9 = PyNumber_Multiply(__pyx_v_n, __pyx_int_2); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 36; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_9); __pyx_t_10 = PyNumber_Add(__pyx_t_4, __pyx_t_9); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 36; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_10); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_rect, __pyx_n_s_h); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 36; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_9); __pyx_t_4 = PyNumber_Multiply(__pyx_v_n, __pyx_int_2); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 36; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); __pyx_t_11 = PyNumber_Add(__pyx_t_9, __pyx_t_4); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 36; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_11); __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_t_4 = NULL; __pyx_t_7 = 0; if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_5))) { __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_5); if (likely(__pyx_t_4)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5); __Pyx_INCREF(__pyx_t_4); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_5, function); __pyx_t_7 = 1; } } __pyx_t_9 = PyTuple_New(4+__pyx_t_7); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 36; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_9); if (__pyx_t_4) { __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_t_4); __pyx_t_4 = NULL; } __Pyx_GIVEREF(__pyx_t_6); PyTuple_SET_ITEM(__pyx_t_9, 0+__pyx_t_7, __pyx_t_6); __Pyx_GIVEREF(__pyx_t_8); PyTuple_SET_ITEM(__pyx_t_9, 1+__pyx_t_7, __pyx_t_8); __Pyx_GIVEREF(__pyx_t_10); PyTuple_SET_ITEM(__pyx_t_9, 2+__pyx_t_7, __pyx_t_10); __Pyx_GIVEREF(__pyx_t_11); PyTuple_SET_ITEM(__pyx_t_9, 3+__pyx_t_7, __pyx_t_11); __pyx_t_6 = 0; __pyx_t_8 = 0; __pyx_t_10 = 0; __pyx_t_11 = 0; __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_9, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 36; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_XDECREF_SET(__pyx_v_r, __pyx_t_1); __pyx_t_1 = 0; /* "pygame_sdl2/draw.pyx":37 * while n < width: * r = Rect(rect.x - n, rect.y - n, rect.w + (n*2), rect.h + (n*2)) * gfxdraw.rectangle(surface, r, color) # <<<<<<<<<<<<<< * r = Rect(rect.x + n, rect.y + n, rect.w - (n*2), rect.h - (n*2)) * gfxdraw.rectangle(surface, r, color) */ __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_gfxdraw); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 37; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_rectangle); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 37; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_9); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __pyx_t_5 = NULL; __pyx_t_7 = 0; if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_9))) { __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_9); if (likely(__pyx_t_5)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_9); __Pyx_INCREF(__pyx_t_5); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_9, function); __pyx_t_7 = 1; } } __pyx_t_11 = PyTuple_New(3+__pyx_t_7); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 37; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_11); if (__pyx_t_5) { __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_11, 0, __pyx_t_5); __pyx_t_5 = NULL; } __Pyx_INCREF(((PyObject *)__pyx_v_surface)); __Pyx_GIVEREF(((PyObject *)__pyx_v_surface)); PyTuple_SET_ITEM(__pyx_t_11, 0+__pyx_t_7, ((PyObject *)__pyx_v_surface)); __Pyx_INCREF(__pyx_v_r); __Pyx_GIVEREF(__pyx_v_r); PyTuple_SET_ITEM(__pyx_t_11, 1+__pyx_t_7, __pyx_v_r); __Pyx_INCREF(__pyx_v_color); __Pyx_GIVEREF(__pyx_v_color); PyTuple_SET_ITEM(__pyx_t_11, 2+__pyx_t_7, __pyx_v_color); __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_9, __pyx_t_11, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 37; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "pygame_sdl2/draw.pyx":38 * r = Rect(rect.x - n, rect.y - n, rect.w + (n*2), rect.h + (n*2)) * gfxdraw.rectangle(surface, r, color) * r = Rect(rect.x + n, rect.y + n, rect.w - (n*2), rect.h - (n*2)) # <<<<<<<<<<<<<< * gfxdraw.rectangle(surface, r, color) * n += 1 */ __pyx_t_9 = __Pyx_GetModuleGlobalName(__pyx_n_s_Rect); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 38; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_9); __pyx_t_11 = __Pyx_PyObject_GetAttrStr(__pyx_v_rect, __pyx_n_s_x); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 38; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_11); __pyx_t_5 = PyNumber_Add(__pyx_t_11, __pyx_v_n); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 38; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; __pyx_t_11 = __Pyx_PyObject_GetAttrStr(__pyx_v_rect, __pyx_n_s_y); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 38; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_11); __pyx_t_10 = PyNumber_Add(__pyx_t_11, __pyx_v_n); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 38; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_10); __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; __pyx_t_11 = __Pyx_PyObject_GetAttrStr(__pyx_v_rect, __pyx_n_s_w); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 38; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_11); __pyx_t_8 = PyNumber_Multiply(__pyx_v_n, __pyx_int_2); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 38; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_8); __pyx_t_6 = PyNumber_Subtract(__pyx_t_11, __pyx_t_8); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 38; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_v_rect, __pyx_n_s_h); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 38; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_8); __pyx_t_11 = PyNumber_Multiply(__pyx_v_n, __pyx_int_2); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 38; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_11); __pyx_t_4 = PyNumber_Subtract(__pyx_t_8, __pyx_t_11); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 38; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; __pyx_t_11 = NULL; __pyx_t_7 = 0; if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_9))) { __pyx_t_11 = PyMethod_GET_SELF(__pyx_t_9); if (likely(__pyx_t_11)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_9); __Pyx_INCREF(__pyx_t_11); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_9, function); __pyx_t_7 = 1; } } __pyx_t_8 = PyTuple_New(4+__pyx_t_7); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 38; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_8); if (__pyx_t_11) { __Pyx_GIVEREF(__pyx_t_11); PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_11); __pyx_t_11 = NULL; } __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_8, 0+__pyx_t_7, __pyx_t_5); __Pyx_GIVEREF(__pyx_t_10); PyTuple_SET_ITEM(__pyx_t_8, 1+__pyx_t_7, __pyx_t_10); __Pyx_GIVEREF(__pyx_t_6); PyTuple_SET_ITEM(__pyx_t_8, 2+__pyx_t_7, __pyx_t_6); __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_8, 3+__pyx_t_7, __pyx_t_4); __pyx_t_5 = 0; __pyx_t_10 = 0; __pyx_t_6 = 0; __pyx_t_4 = 0; __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_9, __pyx_t_8, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 38; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; __Pyx_DECREF_SET(__pyx_v_r, __pyx_t_1); __pyx_t_1 = 0; /* "pygame_sdl2/draw.pyx":39 * gfxdraw.rectangle(surface, r, color) * r = Rect(rect.x + n, rect.y + n, rect.w - (n*2), rect.h - (n*2)) * gfxdraw.rectangle(surface, r, color) # <<<<<<<<<<<<<< * n += 1 * dirty = Rect(rect.x - width, rect.y - width, rect.w + (width*2), rect.h + (width*2)) */ __pyx_t_9 = __Pyx_GetModuleGlobalName(__pyx_n_s_gfxdraw); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 39; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_9); __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_9, __pyx_n_s_rectangle); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 39; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_8); __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; __pyx_t_9 = NULL; __pyx_t_7 = 0; if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_8))) { __pyx_t_9 = PyMethod_GET_SELF(__pyx_t_8); if (likely(__pyx_t_9)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_8); __Pyx_INCREF(__pyx_t_9); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_8, function); __pyx_t_7 = 1; } } __pyx_t_4 = PyTuple_New(3+__pyx_t_7); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 39; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); if (__pyx_t_9) { __Pyx_GIVEREF(__pyx_t_9); PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_9); __pyx_t_9 = NULL; } __Pyx_INCREF(((PyObject *)__pyx_v_surface)); __Pyx_GIVEREF(((PyObject *)__pyx_v_surface)); PyTuple_SET_ITEM(__pyx_t_4, 0+__pyx_t_7, ((PyObject *)__pyx_v_surface)); __Pyx_INCREF(__pyx_v_r); __Pyx_GIVEREF(__pyx_v_r); PyTuple_SET_ITEM(__pyx_t_4, 1+__pyx_t_7, __pyx_v_r); __Pyx_INCREF(__pyx_v_color); __Pyx_GIVEREF(__pyx_v_color); PyTuple_SET_ITEM(__pyx_t_4, 2+__pyx_t_7, __pyx_v_color); __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_8, __pyx_t_4, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 39; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "pygame_sdl2/draw.pyx":40 * r = Rect(rect.x + n, rect.y + n, rect.w - (n*2), rect.h - (n*2)) * gfxdraw.rectangle(surface, r, color) * n += 1 # <<<<<<<<<<<<<< * dirty = Rect(rect.x - width, rect.y - width, rect.w + (width*2), rect.h + (width*2)) * return dirty.clip(surface.get_rect()) */ __pyx_t_1 = __Pyx_PyInt_AddObjC(__pyx_v_n, __pyx_int_1, 1, 1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 40; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF_SET(__pyx_v_n, __pyx_t_1); __pyx_t_1 = 0; } } __pyx_L4:; /* "pygame_sdl2/draw.pyx":41 * gfxdraw.rectangle(surface, r, color) * n += 1 * dirty = Rect(rect.x - width, rect.y - width, rect.w + (width*2), rect.h + (width*2)) # <<<<<<<<<<<<<< * return dirty.clip(surface.get_rect()) * */ __pyx_t_8 = __Pyx_GetModuleGlobalName(__pyx_n_s_Rect); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 41; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_8); __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_rect, __pyx_n_s_x); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 41; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); __pyx_t_9 = PyNumber_Subtract(__pyx_t_4, __pyx_v_width); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 41; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_9); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_rect, __pyx_n_s_y); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 41; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); __pyx_t_6 = PyNumber_Subtract(__pyx_t_4, __pyx_v_width); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 41; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_rect, __pyx_n_s_w); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 41; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); __pyx_t_10 = PyNumber_Multiply(__pyx_v_width, __pyx_int_2); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 41; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_10); __pyx_t_5 = PyNumber_Add(__pyx_t_4, __pyx_t_10); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 41; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_v_rect, __pyx_n_s_h); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 41; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_10); __pyx_t_4 = PyNumber_Multiply(__pyx_v_width, __pyx_int_2); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 41; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); __pyx_t_11 = PyNumber_Add(__pyx_t_10, __pyx_t_4); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 41; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_11); __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_t_4 = NULL; __pyx_t_7 = 0; if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_8))) { __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_8); if (likely(__pyx_t_4)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_8); __Pyx_INCREF(__pyx_t_4); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_8, function); __pyx_t_7 = 1; } } __pyx_t_10 = PyTuple_New(4+__pyx_t_7); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 41; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_10); if (__pyx_t_4) { __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_t_4); __pyx_t_4 = NULL; } __Pyx_GIVEREF(__pyx_t_9); PyTuple_SET_ITEM(__pyx_t_10, 0+__pyx_t_7, __pyx_t_9); __Pyx_GIVEREF(__pyx_t_6); PyTuple_SET_ITEM(__pyx_t_10, 1+__pyx_t_7, __pyx_t_6); __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_10, 2+__pyx_t_7, __pyx_t_5); __Pyx_GIVEREF(__pyx_t_11); PyTuple_SET_ITEM(__pyx_t_10, 3+__pyx_t_7, __pyx_t_11); __pyx_t_9 = 0; __pyx_t_6 = 0; __pyx_t_5 = 0; __pyx_t_11 = 0; __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_8, __pyx_t_10, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 41; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; __pyx_v_dirty = __pyx_t_1; __pyx_t_1 = 0; /* "pygame_sdl2/draw.pyx":42 * n += 1 * dirty = Rect(rect.x - width, rect.y - width, rect.w + (width*2), rect.h + (width*2)) * return dirty.clip(surface.get_rect()) # <<<<<<<<<<<<<< * * def polygon(Surface surface, color, pointlist, width=0): */ __Pyx_XDECREF(__pyx_r); __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_v_dirty, __pyx_n_s_clip); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 42; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_8); __pyx_t_11 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_surface), __pyx_n_s_get_rect); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 42; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_11); __pyx_t_5 = NULL; if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_11))) { __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_11); if (likely(__pyx_t_5)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_11); __Pyx_INCREF(__pyx_t_5); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_11, function); } } if (__pyx_t_5) { __pyx_t_10 = __Pyx_PyObject_CallOneArg(__pyx_t_11, __pyx_t_5); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 42; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; } else { __pyx_t_10 = __Pyx_PyObject_CallNoArg(__pyx_t_11); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 42; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } __Pyx_GOTREF(__pyx_t_10); __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; __pyx_t_11 = NULL; if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_8))) { __pyx_t_11 = PyMethod_GET_SELF(__pyx_t_8); if (likely(__pyx_t_11)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_8); __Pyx_INCREF(__pyx_t_11); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_8, function); } } if (!__pyx_t_11) { __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_8, __pyx_t_10); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 42; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; __Pyx_GOTREF(__pyx_t_1); } else { __pyx_t_5 = PyTuple_New(1+1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 42; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); __Pyx_GIVEREF(__pyx_t_11); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_11); __pyx_t_11 = NULL; __Pyx_GIVEREF(__pyx_t_10); PyTuple_SET_ITEM(__pyx_t_5, 0+1, __pyx_t_10); __pyx_t_10 = 0; __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_8, __pyx_t_5, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 42; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; } __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "pygame_sdl2/draw.pyx":26 * from pygame_sdl2.error import error * * def rect(Surface surface, color, rect, width=0): # <<<<<<<<<<<<<< * if not isinstance(rect, Rect): * rect = Rect(rect) */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_5); __Pyx_XDECREF(__pyx_t_6); __Pyx_XDECREF(__pyx_t_8); __Pyx_XDECREF(__pyx_t_9); __Pyx_XDECREF(__pyx_t_10); __Pyx_XDECREF(__pyx_t_11); __Pyx_AddTraceback("pygame_sdl2.draw.rect", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF(__pyx_v_n); __Pyx_XDECREF(__pyx_v_r); __Pyx_XDECREF(__pyx_v_dirty); __Pyx_XDECREF(__pyx_v_rect); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/draw.pyx":44 * return dirty.clip(surface.get_rect()) * * def polygon(Surface surface, color, pointlist, width=0): # <<<<<<<<<<<<<< * if width == 0: * gfxdraw.filled_polygon(surface, pointlist, color) */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_4draw_3polygon(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static PyMethodDef __pyx_mdef_11pygame_sdl2_4draw_3polygon = {"polygon", (PyCFunction)__pyx_pw_11pygame_sdl2_4draw_3polygon, METH_VARARGS|METH_KEYWORDS, 0}; static PyObject *__pyx_pw_11pygame_sdl2_4draw_3polygon(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { struct __pyx_obj_11pygame_sdl2_7surface_Surface *__pyx_v_surface = 0; PyObject *__pyx_v_color = 0; PyObject *__pyx_v_pointlist = 0; PyObject *__pyx_v_width = 0; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("polygon (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_surface,&__pyx_n_s_color,&__pyx_n_s_pointlist,&__pyx_n_s_width,0}; PyObject* values[4] = {0,0,0,0}; values[3] = ((PyObject *)__pyx_int_0); if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_surface)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; case 1: if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_color)) != 0)) kw_args--; else { __Pyx_RaiseArgtupleInvalid("polygon", 0, 3, 4, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 44; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } case 2: if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_pointlist)) != 0)) kw_args--; else { __Pyx_RaiseArgtupleInvalid("polygon", 0, 3, 4, 2); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 44; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } case 3: if (kw_args > 0) { PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_width); if (value) { values[3] = value; kw_args--; } } } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "polygon") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 44; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } } else { switch (PyTuple_GET_SIZE(__pyx_args)) { case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); values[1] = PyTuple_GET_ITEM(__pyx_args, 1); values[0] = PyTuple_GET_ITEM(__pyx_args, 0); break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_surface = ((struct __pyx_obj_11pygame_sdl2_7surface_Surface *)values[0]); __pyx_v_color = values[1]; __pyx_v_pointlist = values[2]; __pyx_v_width = values[3]; } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("polygon", 0, 3, 4, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 44; __pyx_clineno = __LINE__; goto __pyx_L3_error;} __pyx_L3_error:; __Pyx_AddTraceback("pygame_sdl2.draw.polygon", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_surface), __pyx_ptype_11pygame_sdl2_7surface_Surface, 1, "surface", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 44; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_r = __pyx_pf_11pygame_sdl2_4draw_2polygon(__pyx_self, __pyx_v_surface, __pyx_v_color, __pyx_v_pointlist, __pyx_v_width); /* function exit code */ goto __pyx_L0; __pyx_L1_error:; __pyx_r = NULL; __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_4draw_2polygon(CYTHON_UNUSED PyObject *__pyx_self, struct __pyx_obj_11pygame_sdl2_7surface_Surface *__pyx_v_surface, PyObject *__pyx_v_color, PyObject *__pyx_v_pointlist, PyObject *__pyx_v_width) { PyObject *__pyx_v_dirty = NULL; PyObject *__pyx_v_n = NULL; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_t_2; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; Py_ssize_t __pyx_t_5; PyObject *__pyx_t_6 = NULL; PyObject *__pyx_t_7 = NULL; PyObject *__pyx_t_8 = NULL; PyObject *__pyx_t_9 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("polygon", 0); /* "pygame_sdl2/draw.pyx":45 * * def polygon(Surface surface, color, pointlist, width=0): * if width == 0: # <<<<<<<<<<<<<< * gfxdraw.filled_polygon(surface, pointlist, color) * dirty = Rect(pointlist[0], (1, 1)) */ __pyx_t_1 = __Pyx_PyInt_EqObjC(__pyx_v_width, __pyx_int_0, 0, 0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 45; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 45; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (__pyx_t_2) { /* "pygame_sdl2/draw.pyx":46 * def polygon(Surface surface, color, pointlist, width=0): * if width == 0: * gfxdraw.filled_polygon(surface, pointlist, color) # <<<<<<<<<<<<<< * dirty = Rect(pointlist[0], (1, 1)) * n = 1 */ __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_gfxdraw); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 46; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_filled_polygon); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 46; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_3 = NULL; __pyx_t_5 = 0; if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_4))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_4); if (likely(__pyx_t_3)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_4, function); __pyx_t_5 = 1; } } __pyx_t_6 = PyTuple_New(3+__pyx_t_5); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 46; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_6); if (__pyx_t_3) { __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_3); __pyx_t_3 = NULL; } __Pyx_INCREF(((PyObject *)__pyx_v_surface)); __Pyx_GIVEREF(((PyObject *)__pyx_v_surface)); PyTuple_SET_ITEM(__pyx_t_6, 0+__pyx_t_5, ((PyObject *)__pyx_v_surface)); __Pyx_INCREF(__pyx_v_pointlist); __Pyx_GIVEREF(__pyx_v_pointlist); PyTuple_SET_ITEM(__pyx_t_6, 1+__pyx_t_5, __pyx_v_pointlist); __Pyx_INCREF(__pyx_v_color); __Pyx_GIVEREF(__pyx_v_color); PyTuple_SET_ITEM(__pyx_t_6, 2+__pyx_t_5, __pyx_v_color); __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_6, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 46; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "pygame_sdl2/draw.pyx":47 * if width == 0: * gfxdraw.filled_polygon(surface, pointlist, color) * dirty = Rect(pointlist[0], (1, 1)) # <<<<<<<<<<<<<< * n = 1 * while n < len(pointlist): */ __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_Rect); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 47; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); __pyx_t_6 = __Pyx_GetItemInt(__pyx_v_pointlist, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(__pyx_t_6 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 47; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; __Pyx_GOTREF(__pyx_t_6); __pyx_t_3 = NULL; __pyx_t_5 = 0; if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_4))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_4); if (likely(__pyx_t_3)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_4, function); __pyx_t_5 = 1; } } __pyx_t_7 = PyTuple_New(2+__pyx_t_5); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 47; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_7); if (__pyx_t_3) { __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_3); __pyx_t_3 = NULL; } __Pyx_GIVEREF(__pyx_t_6); PyTuple_SET_ITEM(__pyx_t_7, 0+__pyx_t_5, __pyx_t_6); __Pyx_INCREF(__pyx_tuple_); __Pyx_GIVEREF(__pyx_tuple_); PyTuple_SET_ITEM(__pyx_t_7, 1+__pyx_t_5, __pyx_tuple_); __pyx_t_6 = 0; __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_7, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 47; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_v_dirty = __pyx_t_1; __pyx_t_1 = 0; /* "pygame_sdl2/draw.pyx":48 * gfxdraw.filled_polygon(surface, pointlist, color) * dirty = Rect(pointlist[0], (1, 1)) * n = 1 # <<<<<<<<<<<<<< * while n < len(pointlist): * dirty.union_ip(Rect(pointlist[n], (1,1))) */ __Pyx_INCREF(__pyx_int_1); __pyx_v_n = __pyx_int_1; /* "pygame_sdl2/draw.pyx":49 * dirty = Rect(pointlist[0], (1, 1)) * n = 1 * while n < len(pointlist): # <<<<<<<<<<<<<< * dirty.union_ip(Rect(pointlist[n], (1,1))) * n += 1 */ while (1) { __pyx_t_5 = PyObject_Length(__pyx_v_pointlist); if (unlikely(__pyx_t_5 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 49; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_t_1 = PyInt_FromSsize_t(__pyx_t_5); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 49; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_t_4 = PyObject_RichCompare(__pyx_v_n, __pyx_t_1, Py_LT); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 49; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 49; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; if (!__pyx_t_2) break; /* "pygame_sdl2/draw.pyx":50 * n = 1 * while n < len(pointlist): * dirty.union_ip(Rect(pointlist[n], (1,1))) # <<<<<<<<<<<<<< * n += 1 * return dirty.clip(surface.get_rect()) */ __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_dirty, __pyx_n_s_union_ip); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 50; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_t_6 = __Pyx_GetModuleGlobalName(__pyx_n_s_Rect); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 50; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_6); __pyx_t_3 = PyObject_GetItem(__pyx_v_pointlist, __pyx_v_n); if (unlikely(__pyx_t_3 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 50; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; __Pyx_GOTREF(__pyx_t_3); __pyx_t_8 = NULL; __pyx_t_5 = 0; if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_6))) { __pyx_t_8 = PyMethod_GET_SELF(__pyx_t_6); if (likely(__pyx_t_8)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6); __Pyx_INCREF(__pyx_t_8); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_6, function); __pyx_t_5 = 1; } } __pyx_t_9 = PyTuple_New(2+__pyx_t_5); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 50; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_9); if (__pyx_t_8) { __Pyx_GIVEREF(__pyx_t_8); PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_t_8); __pyx_t_8 = NULL; } __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_9, 0+__pyx_t_5, __pyx_t_3); __Pyx_INCREF(__pyx_tuple__2); __Pyx_GIVEREF(__pyx_tuple__2); PyTuple_SET_ITEM(__pyx_t_9, 1+__pyx_t_5, __pyx_tuple__2); __pyx_t_3 = 0; __pyx_t_7 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_9, NULL); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 50; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __pyx_t_6 = NULL; if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_1))) { __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_1); if (likely(__pyx_t_6)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1); __Pyx_INCREF(__pyx_t_6); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_1, function); } } if (!__pyx_t_6) { __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_t_1, __pyx_t_7); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 50; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_GOTREF(__pyx_t_4); } else { __pyx_t_9 = PyTuple_New(1+1); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 50; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_9); __Pyx_GIVEREF(__pyx_t_6); PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_t_6); __pyx_t_6 = NULL; __Pyx_GIVEREF(__pyx_t_7); PyTuple_SET_ITEM(__pyx_t_9, 0+1, __pyx_t_7); __pyx_t_7 = 0; __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_9, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 50; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; /* "pygame_sdl2/draw.pyx":51 * while n < len(pointlist): * dirty.union_ip(Rect(pointlist[n], (1,1))) * n += 1 # <<<<<<<<<<<<<< * return dirty.clip(surface.get_rect()) * else: */ __pyx_t_4 = __Pyx_PyInt_AddObjC(__pyx_v_n, __pyx_int_1, 1, 1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 51; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF_SET(__pyx_v_n, __pyx_t_4); __pyx_t_4 = 0; } /* "pygame_sdl2/draw.pyx":52 * dirty.union_ip(Rect(pointlist[n], (1,1))) * n += 1 * return dirty.clip(surface.get_rect()) # <<<<<<<<<<<<<< * else: * return lines(surface, color, True, pointlist, width) */ __Pyx_XDECREF(__pyx_r); __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_dirty, __pyx_n_s_clip); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 52; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_t_7 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_surface), __pyx_n_s_get_rect); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 52; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_7); __pyx_t_6 = NULL; if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_7))) { __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_7); if (likely(__pyx_t_6)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_7); __Pyx_INCREF(__pyx_t_6); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_7, function); } } if (__pyx_t_6) { __pyx_t_9 = __Pyx_PyObject_CallOneArg(__pyx_t_7, __pyx_t_6); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 52; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; } else { __pyx_t_9 = __Pyx_PyObject_CallNoArg(__pyx_t_7); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 52; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } __Pyx_GOTREF(__pyx_t_9); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __pyx_t_7 = NULL; if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_1))) { __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_1); if (likely(__pyx_t_7)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1); __Pyx_INCREF(__pyx_t_7); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_1, function); } } if (!__pyx_t_7) { __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_t_1, __pyx_t_9); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 52; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; __Pyx_GOTREF(__pyx_t_4); } else { __pyx_t_6 = PyTuple_New(1+1); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 52; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_6); __Pyx_GIVEREF(__pyx_t_7); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_7); __pyx_t_7 = NULL; __Pyx_GIVEREF(__pyx_t_9); PyTuple_SET_ITEM(__pyx_t_6, 0+1, __pyx_t_9); __pyx_t_9 = 0; __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_6, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 52; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_r = __pyx_t_4; __pyx_t_4 = 0; goto __pyx_L0; /* "pygame_sdl2/draw.pyx":45 * * def polygon(Surface surface, color, pointlist, width=0): * if width == 0: # <<<<<<<<<<<<<< * gfxdraw.filled_polygon(surface, pointlist, color) * dirty = Rect(pointlist[0], (1, 1)) */ } /* "pygame_sdl2/draw.pyx":54 * return dirty.clip(surface.get_rect()) * else: * return lines(surface, color, True, pointlist, width) # <<<<<<<<<<<<<< * * def circle(Surface surface, color, pos, radius, width=0): */ /*else*/ { __Pyx_XDECREF(__pyx_r); __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_lines); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 54; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_t_6 = NULL; __pyx_t_5 = 0; if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_1))) { __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_1); if (likely(__pyx_t_6)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1); __Pyx_INCREF(__pyx_t_6); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_1, function); __pyx_t_5 = 1; } } __pyx_t_9 = PyTuple_New(5+__pyx_t_5); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 54; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_9); if (__pyx_t_6) { __Pyx_GIVEREF(__pyx_t_6); PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_t_6); __pyx_t_6 = NULL; } __Pyx_INCREF(((PyObject *)__pyx_v_surface)); __Pyx_GIVEREF(((PyObject *)__pyx_v_surface)); PyTuple_SET_ITEM(__pyx_t_9, 0+__pyx_t_5, ((PyObject *)__pyx_v_surface)); __Pyx_INCREF(__pyx_v_color); __Pyx_GIVEREF(__pyx_v_color); PyTuple_SET_ITEM(__pyx_t_9, 1+__pyx_t_5, __pyx_v_color); __Pyx_INCREF(Py_True); __Pyx_GIVEREF(Py_True); PyTuple_SET_ITEM(__pyx_t_9, 2+__pyx_t_5, Py_True); __Pyx_INCREF(__pyx_v_pointlist); __Pyx_GIVEREF(__pyx_v_pointlist); PyTuple_SET_ITEM(__pyx_t_9, 3+__pyx_t_5, __pyx_v_pointlist); __Pyx_INCREF(__pyx_v_width); __Pyx_GIVEREF(__pyx_v_width); PyTuple_SET_ITEM(__pyx_t_9, 4+__pyx_t_5, __pyx_v_width); __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_9, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 54; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_r = __pyx_t_4; __pyx_t_4 = 0; goto __pyx_L0; } /* "pygame_sdl2/draw.pyx":44 * return dirty.clip(surface.get_rect()) * * def polygon(Surface surface, color, pointlist, width=0): # <<<<<<<<<<<<<< * if width == 0: * gfxdraw.filled_polygon(surface, pointlist, color) */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_6); __Pyx_XDECREF(__pyx_t_7); __Pyx_XDECREF(__pyx_t_8); __Pyx_XDECREF(__pyx_t_9); __Pyx_AddTraceback("pygame_sdl2.draw.polygon", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF(__pyx_v_dirty); __Pyx_XDECREF(__pyx_v_n); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/draw.pyx":56 * return lines(surface, color, True, pointlist, width) * * def circle(Surface surface, color, pos, radius, width=0): # <<<<<<<<<<<<<< * x, y = pos * if width == 0: */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_4draw_5circle(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static PyMethodDef __pyx_mdef_11pygame_sdl2_4draw_5circle = {"circle", (PyCFunction)__pyx_pw_11pygame_sdl2_4draw_5circle, METH_VARARGS|METH_KEYWORDS, 0}; static PyObject *__pyx_pw_11pygame_sdl2_4draw_5circle(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { struct __pyx_obj_11pygame_sdl2_7surface_Surface *__pyx_v_surface = 0; PyObject *__pyx_v_color = 0; PyObject *__pyx_v_pos = 0; PyObject *__pyx_v_radius = 0; PyObject *__pyx_v_width = 0; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("circle (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_surface,&__pyx_n_s_color,&__pyx_n_s_pos,&__pyx_n_s_radius,&__pyx_n_s_width,0}; PyObject* values[5] = {0,0,0,0,0}; values[4] = ((PyObject *)__pyx_int_0); if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4); case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_surface)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; case 1: if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_color)) != 0)) kw_args--; else { __Pyx_RaiseArgtupleInvalid("circle", 0, 4, 5, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 56; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } case 2: if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_pos)) != 0)) kw_args--; else { __Pyx_RaiseArgtupleInvalid("circle", 0, 4, 5, 2); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 56; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } case 3: if (likely((values[3] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_radius)) != 0)) kw_args--; else { __Pyx_RaiseArgtupleInvalid("circle", 0, 4, 5, 3); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 56; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } case 4: if (kw_args > 0) { PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_width); if (value) { values[4] = value; kw_args--; } } } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "circle") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 56; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } } else { switch (PyTuple_GET_SIZE(__pyx_args)) { case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4); case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); values[2] = PyTuple_GET_ITEM(__pyx_args, 2); values[1] = PyTuple_GET_ITEM(__pyx_args, 1); values[0] = PyTuple_GET_ITEM(__pyx_args, 0); break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_surface = ((struct __pyx_obj_11pygame_sdl2_7surface_Surface *)values[0]); __pyx_v_color = values[1]; __pyx_v_pos = values[2]; __pyx_v_radius = values[3]; __pyx_v_width = values[4]; } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("circle", 0, 4, 5, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 56; __pyx_clineno = __LINE__; goto __pyx_L3_error;} __pyx_L3_error:; __Pyx_AddTraceback("pygame_sdl2.draw.circle", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_surface), __pyx_ptype_11pygame_sdl2_7surface_Surface, 1, "surface", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 56; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_r = __pyx_pf_11pygame_sdl2_4draw_4circle(__pyx_self, __pyx_v_surface, __pyx_v_color, __pyx_v_pos, __pyx_v_radius, __pyx_v_width); /* function exit code */ goto __pyx_L0; __pyx_L1_error:; __pyx_r = NULL; __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_4draw_4circle(CYTHON_UNUSED PyObject *__pyx_self, struct __pyx_obj_11pygame_sdl2_7surface_Surface *__pyx_v_surface, PyObject *__pyx_v_color, PyObject *__pyx_v_pos, PyObject *__pyx_v_radius, PyObject *__pyx_v_width) { PyObject *__pyx_v_x = NULL; PyObject *__pyx_v_y = NULL; PyObject *__pyx_v_dirty = NULL; PyObject *__pyx_v_n = NULL; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; PyObject *(*__pyx_t_4)(PyObject *); int __pyx_t_5; Py_ssize_t __pyx_t_6; PyObject *__pyx_t_7 = NULL; PyObject *__pyx_t_8 = NULL; PyObject *__pyx_t_9 = NULL; PyObject *__pyx_t_10 = NULL; PyObject *__pyx_t_11 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("circle", 0); /* "pygame_sdl2/draw.pyx":57 * * def circle(Surface surface, color, pos, radius, width=0): * x, y = pos # <<<<<<<<<<<<<< * if width == 0: * gfxdraw.filled_circle(surface, x, y, radius, color) */ if ((likely(PyTuple_CheckExact(__pyx_v_pos))) || (PyList_CheckExact(__pyx_v_pos))) { PyObject* sequence = __pyx_v_pos; #if CYTHON_COMPILING_IN_CPYTHON Py_ssize_t size = Py_SIZE(sequence); #else Py_ssize_t size = PySequence_Size(sequence); #endif if (unlikely(size != 2)) { if (size > 2) __Pyx_RaiseTooManyValuesError(2); else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 57; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } #if CYTHON_COMPILING_IN_CPYTHON if (likely(PyTuple_CheckExact(sequence))) { __pyx_t_1 = PyTuple_GET_ITEM(sequence, 0); __pyx_t_2 = PyTuple_GET_ITEM(sequence, 1); } else { __pyx_t_1 = PyList_GET_ITEM(sequence, 0); __pyx_t_2 = PyList_GET_ITEM(sequence, 1); } __Pyx_INCREF(__pyx_t_1); __Pyx_INCREF(__pyx_t_2); #else __pyx_t_1 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 57; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 57; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); #endif } else { Py_ssize_t index = -1; __pyx_t_3 = PyObject_GetIter(__pyx_v_pos); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 57; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = Py_TYPE(__pyx_t_3)->tp_iternext; index = 0; __pyx_t_1 = __pyx_t_4(__pyx_t_3); if (unlikely(!__pyx_t_1)) goto __pyx_L3_unpacking_failed; __Pyx_GOTREF(__pyx_t_1); index = 1; __pyx_t_2 = __pyx_t_4(__pyx_t_3); if (unlikely(!__pyx_t_2)) goto __pyx_L3_unpacking_failed; __Pyx_GOTREF(__pyx_t_2); if (__Pyx_IternextUnpackEndCheck(__pyx_t_4(__pyx_t_3), 2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 57; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_t_4 = NULL; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; goto __pyx_L4_unpacking_done; __pyx_L3_unpacking_failed:; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_4 = NULL; if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 57; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_L4_unpacking_done:; } __pyx_v_x = __pyx_t_1; __pyx_t_1 = 0; __pyx_v_y = __pyx_t_2; __pyx_t_2 = 0; /* "pygame_sdl2/draw.pyx":58 * def circle(Surface surface, color, pos, radius, width=0): * x, y = pos * if width == 0: # <<<<<<<<<<<<<< * gfxdraw.filled_circle(surface, x, y, radius, color) * dirty = Rect((x - radius, y - radius), (radius*2, radius*2)) */ __pyx_t_2 = __Pyx_PyInt_EqObjC(__pyx_v_width, __pyx_int_0, 0, 0); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 58; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_5 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 58; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; if (__pyx_t_5) { /* "pygame_sdl2/draw.pyx":59 * x, y = pos * if width == 0: * gfxdraw.filled_circle(surface, x, y, radius, color) # <<<<<<<<<<<<<< * dirty = Rect((x - radius, y - radius), (radius*2, radius*2)) * return dirty.clip(surface.get_rect()) */ __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_gfxdraw); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 59; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_filled_circle); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 59; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_1 = NULL; __pyx_t_6 = 0; if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_3))) { __pyx_t_1 = PyMethod_GET_SELF(__pyx_t_3); if (likely(__pyx_t_1)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); __Pyx_INCREF(__pyx_t_1); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_3, function); __pyx_t_6 = 1; } } __pyx_t_7 = PyTuple_New(5+__pyx_t_6); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 59; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_7); if (__pyx_t_1) { __Pyx_GIVEREF(__pyx_t_1); PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_1); __pyx_t_1 = NULL; } __Pyx_INCREF(((PyObject *)__pyx_v_surface)); __Pyx_GIVEREF(((PyObject *)__pyx_v_surface)); PyTuple_SET_ITEM(__pyx_t_7, 0+__pyx_t_6, ((PyObject *)__pyx_v_surface)); __Pyx_INCREF(__pyx_v_x); __Pyx_GIVEREF(__pyx_v_x); PyTuple_SET_ITEM(__pyx_t_7, 1+__pyx_t_6, __pyx_v_x); __Pyx_INCREF(__pyx_v_y); __Pyx_GIVEREF(__pyx_v_y); PyTuple_SET_ITEM(__pyx_t_7, 2+__pyx_t_6, __pyx_v_y); __Pyx_INCREF(__pyx_v_radius); __Pyx_GIVEREF(__pyx_v_radius); PyTuple_SET_ITEM(__pyx_t_7, 3+__pyx_t_6, __pyx_v_radius); __Pyx_INCREF(__pyx_v_color); __Pyx_GIVEREF(__pyx_v_color); PyTuple_SET_ITEM(__pyx_t_7, 4+__pyx_t_6, __pyx_v_color); __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_7, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 59; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "pygame_sdl2/draw.pyx":60 * if width == 0: * gfxdraw.filled_circle(surface, x, y, radius, color) * dirty = Rect((x - radius, y - radius), (radius*2, radius*2)) # <<<<<<<<<<<<<< * return dirty.clip(surface.get_rect()) * else: */ __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_Rect); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 60; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __pyx_t_7 = PyNumber_Subtract(__pyx_v_x, __pyx_v_radius); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 60; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_7); __pyx_t_1 = PyNumber_Subtract(__pyx_v_y, __pyx_v_radius); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 60; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_t_8 = PyTuple_New(2); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 60; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_8); __Pyx_GIVEREF(__pyx_t_7); PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_7); __Pyx_GIVEREF(__pyx_t_1); PyTuple_SET_ITEM(__pyx_t_8, 1, __pyx_t_1); __pyx_t_7 = 0; __pyx_t_1 = 0; __pyx_t_1 = PyNumber_Multiply(__pyx_v_radius, __pyx_int_2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 60; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_t_7 = PyNumber_Multiply(__pyx_v_radius, __pyx_int_2); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 60; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_7); __pyx_t_9 = PyTuple_New(2); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 60; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_9); __Pyx_GIVEREF(__pyx_t_1); PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_t_1); __Pyx_GIVEREF(__pyx_t_7); PyTuple_SET_ITEM(__pyx_t_9, 1, __pyx_t_7); __pyx_t_1 = 0; __pyx_t_7 = 0; __pyx_t_7 = NULL; __pyx_t_6 = 0; if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_3))) { __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_3); if (likely(__pyx_t_7)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); __Pyx_INCREF(__pyx_t_7); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_3, function); __pyx_t_6 = 1; } } __pyx_t_1 = PyTuple_New(2+__pyx_t_6); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 60; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); if (__pyx_t_7) { __Pyx_GIVEREF(__pyx_t_7); PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_7); __pyx_t_7 = NULL; } __Pyx_GIVEREF(__pyx_t_8); PyTuple_SET_ITEM(__pyx_t_1, 0+__pyx_t_6, __pyx_t_8); __Pyx_GIVEREF(__pyx_t_9); PyTuple_SET_ITEM(__pyx_t_1, 1+__pyx_t_6, __pyx_t_9); __pyx_t_8 = 0; __pyx_t_9 = 0; __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_1, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 60; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_v_dirty = __pyx_t_2; __pyx_t_2 = 0; /* "pygame_sdl2/draw.pyx":61 * gfxdraw.filled_circle(surface, x, y, radius, color) * dirty = Rect((x - radius, y - radius), (radius*2, radius*2)) * return dirty.clip(surface.get_rect()) # <<<<<<<<<<<<<< * else: * gfxdraw.circle(surface, x, y, radius, color) */ __Pyx_XDECREF(__pyx_r); __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_dirty, __pyx_n_s_clip); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 61; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __pyx_t_9 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_surface), __pyx_n_s_get_rect); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 61; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_9); __pyx_t_8 = NULL; if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_9))) { __pyx_t_8 = PyMethod_GET_SELF(__pyx_t_9); if (likely(__pyx_t_8)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_9); __Pyx_INCREF(__pyx_t_8); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_9, function); } } if (__pyx_t_8) { __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_9, __pyx_t_8); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 61; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; } else { __pyx_t_1 = __Pyx_PyObject_CallNoArg(__pyx_t_9); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 61; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; __pyx_t_9 = NULL; if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_3))) { __pyx_t_9 = PyMethod_GET_SELF(__pyx_t_3); if (likely(__pyx_t_9)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); __Pyx_INCREF(__pyx_t_9); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_3, function); } } if (!__pyx_t_9) { __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 61; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_GOTREF(__pyx_t_2); } else { __pyx_t_8 = PyTuple_New(1+1); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 61; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_8); __Pyx_GIVEREF(__pyx_t_9); PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_9); __pyx_t_9 = NULL; __Pyx_GIVEREF(__pyx_t_1); PyTuple_SET_ITEM(__pyx_t_8, 0+1, __pyx_t_1); __pyx_t_1 = 0; __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_8, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 61; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; } __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; /* "pygame_sdl2/draw.pyx":58 * def circle(Surface surface, color, pos, radius, width=0): * x, y = pos * if width == 0: # <<<<<<<<<<<<<< * gfxdraw.filled_circle(surface, x, y, radius, color) * dirty = Rect((x - radius, y - radius), (radius*2, radius*2)) */ } /* "pygame_sdl2/draw.pyx":63 * return dirty.clip(surface.get_rect()) * else: * gfxdraw.circle(surface, x, y, radius, color) # <<<<<<<<<<<<<< * n = 1 * while n < width: */ /*else*/ { __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_gfxdraw); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 63; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_circle); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 63; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_8); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_3 = NULL; __pyx_t_6 = 0; if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_8))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_8); if (likely(__pyx_t_3)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_8); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_8, function); __pyx_t_6 = 1; } } __pyx_t_1 = PyTuple_New(5+__pyx_t_6); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 63; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); if (__pyx_t_3) { __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_3); __pyx_t_3 = NULL; } __Pyx_INCREF(((PyObject *)__pyx_v_surface)); __Pyx_GIVEREF(((PyObject *)__pyx_v_surface)); PyTuple_SET_ITEM(__pyx_t_1, 0+__pyx_t_6, ((PyObject *)__pyx_v_surface)); __Pyx_INCREF(__pyx_v_x); __Pyx_GIVEREF(__pyx_v_x); PyTuple_SET_ITEM(__pyx_t_1, 1+__pyx_t_6, __pyx_v_x); __Pyx_INCREF(__pyx_v_y); __Pyx_GIVEREF(__pyx_v_y); PyTuple_SET_ITEM(__pyx_t_1, 2+__pyx_t_6, __pyx_v_y); __Pyx_INCREF(__pyx_v_radius); __Pyx_GIVEREF(__pyx_v_radius); PyTuple_SET_ITEM(__pyx_t_1, 3+__pyx_t_6, __pyx_v_radius); __Pyx_INCREF(__pyx_v_color); __Pyx_GIVEREF(__pyx_v_color); PyTuple_SET_ITEM(__pyx_t_1, 4+__pyx_t_6, __pyx_v_color); __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_8, __pyx_t_1, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 63; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "pygame_sdl2/draw.pyx":64 * else: * gfxdraw.circle(surface, x, y, radius, color) * n = 1 # <<<<<<<<<<<<<< * while n < width: * gfxdraw.circle(surface, x, y, radius - 1, color) */ __Pyx_INCREF(__pyx_int_1); __pyx_v_n = __pyx_int_1; /* "pygame_sdl2/draw.pyx":65 * gfxdraw.circle(surface, x, y, radius, color) * n = 1 * while n < width: # <<<<<<<<<<<<<< * gfxdraw.circle(surface, x, y, radius - 1, color) * gfxdraw.circle(surface, x, y, radius + 1, color) */ while (1) { __pyx_t_2 = PyObject_RichCompare(__pyx_v_n, __pyx_v_width, Py_LT); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 65; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_5 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 65; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; if (!__pyx_t_5) break; /* "pygame_sdl2/draw.pyx":66 * n = 1 * while n < width: * gfxdraw.circle(surface, x, y, radius - 1, color) # <<<<<<<<<<<<<< * gfxdraw.circle(surface, x, y, radius + 1, color) * n += 1 */ __pyx_t_8 = __Pyx_GetModuleGlobalName(__pyx_n_s_gfxdraw); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 66; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_8); __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_8, __pyx_n_s_circle); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 66; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; __pyx_t_8 = __Pyx_PyInt_SubtractObjC(__pyx_v_radius, __pyx_int_1, 1, 0); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 66; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_8); __pyx_t_3 = NULL; __pyx_t_6 = 0; if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_1))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_1); if (likely(__pyx_t_3)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_1, function); __pyx_t_6 = 1; } } __pyx_t_9 = PyTuple_New(5+__pyx_t_6); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 66; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_9); if (__pyx_t_3) { __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_t_3); __pyx_t_3 = NULL; } __Pyx_INCREF(((PyObject *)__pyx_v_surface)); __Pyx_GIVEREF(((PyObject *)__pyx_v_surface)); PyTuple_SET_ITEM(__pyx_t_9, 0+__pyx_t_6, ((PyObject *)__pyx_v_surface)); __Pyx_INCREF(__pyx_v_x); __Pyx_GIVEREF(__pyx_v_x); PyTuple_SET_ITEM(__pyx_t_9, 1+__pyx_t_6, __pyx_v_x); __Pyx_INCREF(__pyx_v_y); __Pyx_GIVEREF(__pyx_v_y); PyTuple_SET_ITEM(__pyx_t_9, 2+__pyx_t_6, __pyx_v_y); __Pyx_GIVEREF(__pyx_t_8); PyTuple_SET_ITEM(__pyx_t_9, 3+__pyx_t_6, __pyx_t_8); __Pyx_INCREF(__pyx_v_color); __Pyx_GIVEREF(__pyx_v_color); PyTuple_SET_ITEM(__pyx_t_9, 4+__pyx_t_6, __pyx_v_color); __pyx_t_8 = 0; __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_9, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 66; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "pygame_sdl2/draw.pyx":67 * while n < width: * gfxdraw.circle(surface, x, y, radius - 1, color) * gfxdraw.circle(surface, x, y, radius + 1, color) # <<<<<<<<<<<<<< * n += 1 * dirty = Rect(x - radius - width, y - radius - width, (radius*2) + width, (radius*2) + width) */ __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_gfxdraw); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 67; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_circle); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 67; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_9); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_1 = __Pyx_PyInt_AddObjC(__pyx_v_radius, __pyx_int_1, 1, 0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 67; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_t_8 = NULL; __pyx_t_6 = 0; if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_9))) { __pyx_t_8 = PyMethod_GET_SELF(__pyx_t_9); if (likely(__pyx_t_8)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_9); __Pyx_INCREF(__pyx_t_8); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_9, function); __pyx_t_6 = 1; } } __pyx_t_3 = PyTuple_New(5+__pyx_t_6); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 67; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); if (__pyx_t_8) { __Pyx_GIVEREF(__pyx_t_8); PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_8); __pyx_t_8 = NULL; } __Pyx_INCREF(((PyObject *)__pyx_v_surface)); __Pyx_GIVEREF(((PyObject *)__pyx_v_surface)); PyTuple_SET_ITEM(__pyx_t_3, 0+__pyx_t_6, ((PyObject *)__pyx_v_surface)); __Pyx_INCREF(__pyx_v_x); __Pyx_GIVEREF(__pyx_v_x); PyTuple_SET_ITEM(__pyx_t_3, 1+__pyx_t_6, __pyx_v_x); __Pyx_INCREF(__pyx_v_y); __Pyx_GIVEREF(__pyx_v_y); PyTuple_SET_ITEM(__pyx_t_3, 2+__pyx_t_6, __pyx_v_y); __Pyx_GIVEREF(__pyx_t_1); PyTuple_SET_ITEM(__pyx_t_3, 3+__pyx_t_6, __pyx_t_1); __Pyx_INCREF(__pyx_v_color); __Pyx_GIVEREF(__pyx_v_color); PyTuple_SET_ITEM(__pyx_t_3, 4+__pyx_t_6, __pyx_v_color); __pyx_t_1 = 0; __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_9, __pyx_t_3, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 67; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "pygame_sdl2/draw.pyx":68 * gfxdraw.circle(surface, x, y, radius - 1, color) * gfxdraw.circle(surface, x, y, radius + 1, color) * n += 1 # <<<<<<<<<<<<<< * dirty = Rect(x - radius - width, y - radius - width, (radius*2) + width, (radius*2) + width) * return dirty.clip(surface.get_rect()) */ __pyx_t_2 = __Pyx_PyInt_AddObjC(__pyx_v_n, __pyx_int_1, 1, 1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 68; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF_SET(__pyx_v_n, __pyx_t_2); __pyx_t_2 = 0; } /* "pygame_sdl2/draw.pyx":69 * gfxdraw.circle(surface, x, y, radius + 1, color) * n += 1 * dirty = Rect(x - radius - width, y - radius - width, (radius*2) + width, (radius*2) + width) # <<<<<<<<<<<<<< * return dirty.clip(surface.get_rect()) * */ __pyx_t_9 = __Pyx_GetModuleGlobalName(__pyx_n_s_Rect); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 69; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_9); __pyx_t_3 = PyNumber_Subtract(__pyx_v_x, __pyx_v_radius); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 69; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __pyx_t_1 = PyNumber_Subtract(__pyx_t_3, __pyx_v_width); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 69; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_3 = PyNumber_Subtract(__pyx_v_y, __pyx_v_radius); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 69; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __pyx_t_8 = PyNumber_Subtract(__pyx_t_3, __pyx_v_width); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 69; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_8); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_3 = PyNumber_Multiply(__pyx_v_radius, __pyx_int_2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 69; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __pyx_t_7 = PyNumber_Add(__pyx_t_3, __pyx_v_width); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 69; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_3 = PyNumber_Multiply(__pyx_v_radius, __pyx_int_2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 69; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __pyx_t_10 = PyNumber_Add(__pyx_t_3, __pyx_v_width); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 69; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_10); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_3 = NULL; __pyx_t_6 = 0; if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_9))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_9); if (likely(__pyx_t_3)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_9); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_9, function); __pyx_t_6 = 1; } } __pyx_t_11 = PyTuple_New(4+__pyx_t_6); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 69; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_11); if (__pyx_t_3) { __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_11, 0, __pyx_t_3); __pyx_t_3 = NULL; } __Pyx_GIVEREF(__pyx_t_1); PyTuple_SET_ITEM(__pyx_t_11, 0+__pyx_t_6, __pyx_t_1); __Pyx_GIVEREF(__pyx_t_8); PyTuple_SET_ITEM(__pyx_t_11, 1+__pyx_t_6, __pyx_t_8); __Pyx_GIVEREF(__pyx_t_7); PyTuple_SET_ITEM(__pyx_t_11, 2+__pyx_t_6, __pyx_t_7); __Pyx_GIVEREF(__pyx_t_10); PyTuple_SET_ITEM(__pyx_t_11, 3+__pyx_t_6, __pyx_t_10); __pyx_t_1 = 0; __pyx_t_8 = 0; __pyx_t_7 = 0; __pyx_t_10 = 0; __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_9, __pyx_t_11, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 69; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; __pyx_v_dirty = __pyx_t_2; __pyx_t_2 = 0; /* "pygame_sdl2/draw.pyx":70 * n += 1 * dirty = Rect(x - radius - width, y - radius - width, (radius*2) + width, (radius*2) + width) * return dirty.clip(surface.get_rect()) # <<<<<<<<<<<<<< * * def ellipse(Surface surface, color, rect, width=0): */ __Pyx_XDECREF(__pyx_r); __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_dirty, __pyx_n_s_clip); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 70; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_9); __pyx_t_10 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_surface), __pyx_n_s_get_rect); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 70; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_10); __pyx_t_7 = NULL; if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_10))) { __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_10); if (likely(__pyx_t_7)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_10); __Pyx_INCREF(__pyx_t_7); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_10, function); } } if (__pyx_t_7) { __pyx_t_11 = __Pyx_PyObject_CallOneArg(__pyx_t_10, __pyx_t_7); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 70; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; } else { __pyx_t_11 = __Pyx_PyObject_CallNoArg(__pyx_t_10); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 70; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } __Pyx_GOTREF(__pyx_t_11); __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; __pyx_t_10 = NULL; if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_9))) { __pyx_t_10 = PyMethod_GET_SELF(__pyx_t_9); if (likely(__pyx_t_10)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_9); __Pyx_INCREF(__pyx_t_10); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_9, function); } } if (!__pyx_t_10) { __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_9, __pyx_t_11); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 70; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; __Pyx_GOTREF(__pyx_t_2); } else { __pyx_t_7 = PyTuple_New(1+1); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 70; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_7); __Pyx_GIVEREF(__pyx_t_10); PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_10); __pyx_t_10 = NULL; __Pyx_GIVEREF(__pyx_t_11); PyTuple_SET_ITEM(__pyx_t_7, 0+1, __pyx_t_11); __pyx_t_11 = 0; __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_9, __pyx_t_7, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 70; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; } __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; } /* "pygame_sdl2/draw.pyx":56 * return lines(surface, color, True, pointlist, width) * * def circle(Surface surface, color, pos, radius, width=0): # <<<<<<<<<<<<<< * x, y = pos * if width == 0: */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_7); __Pyx_XDECREF(__pyx_t_8); __Pyx_XDECREF(__pyx_t_9); __Pyx_XDECREF(__pyx_t_10); __Pyx_XDECREF(__pyx_t_11); __Pyx_AddTraceback("pygame_sdl2.draw.circle", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF(__pyx_v_x); __Pyx_XDECREF(__pyx_v_y); __Pyx_XDECREF(__pyx_v_dirty); __Pyx_XDECREF(__pyx_v_n); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/draw.pyx":72 * return dirty.clip(surface.get_rect()) * * def ellipse(Surface surface, color, rect, width=0): # <<<<<<<<<<<<<< * raise error("Not implemented.") * */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_4draw_7ellipse(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static PyMethodDef __pyx_mdef_11pygame_sdl2_4draw_7ellipse = {"ellipse", (PyCFunction)__pyx_pw_11pygame_sdl2_4draw_7ellipse, METH_VARARGS|METH_KEYWORDS, 0}; static PyObject *__pyx_pw_11pygame_sdl2_4draw_7ellipse(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { CYTHON_UNUSED struct __pyx_obj_11pygame_sdl2_7surface_Surface *__pyx_v_surface = 0; CYTHON_UNUSED PyObject *__pyx_v_color = 0; CYTHON_UNUSED PyObject *__pyx_v_rect = 0; CYTHON_UNUSED PyObject *__pyx_v_width = 0; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("ellipse (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_surface,&__pyx_n_s_color,&__pyx_n_s_rect,&__pyx_n_s_width,0}; PyObject* values[4] = {0,0,0,0}; values[3] = ((PyObject *)__pyx_int_0); if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_surface)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; case 1: if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_color)) != 0)) kw_args--; else { __Pyx_RaiseArgtupleInvalid("ellipse", 0, 3, 4, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 72; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } case 2: if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_rect)) != 0)) kw_args--; else { __Pyx_RaiseArgtupleInvalid("ellipse", 0, 3, 4, 2); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 72; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } case 3: if (kw_args > 0) { PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_width); if (value) { values[3] = value; kw_args--; } } } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "ellipse") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 72; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } } else { switch (PyTuple_GET_SIZE(__pyx_args)) { case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); values[1] = PyTuple_GET_ITEM(__pyx_args, 1); values[0] = PyTuple_GET_ITEM(__pyx_args, 0); break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_surface = ((struct __pyx_obj_11pygame_sdl2_7surface_Surface *)values[0]); __pyx_v_color = values[1]; __pyx_v_rect = values[2]; __pyx_v_width = values[3]; } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("ellipse", 0, 3, 4, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 72; __pyx_clineno = __LINE__; goto __pyx_L3_error;} __pyx_L3_error:; __Pyx_AddTraceback("pygame_sdl2.draw.ellipse", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_surface), __pyx_ptype_11pygame_sdl2_7surface_Surface, 1, "surface", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 72; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_r = __pyx_pf_11pygame_sdl2_4draw_6ellipse(__pyx_self, __pyx_v_surface, __pyx_v_color, __pyx_v_rect, __pyx_v_width); /* function exit code */ goto __pyx_L0; __pyx_L1_error:; __pyx_r = NULL; __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_4draw_6ellipse(CYTHON_UNUSED PyObject *__pyx_self, CYTHON_UNUSED struct __pyx_obj_11pygame_sdl2_7surface_Surface *__pyx_v_surface, CYTHON_UNUSED PyObject *__pyx_v_color, CYTHON_UNUSED PyObject *__pyx_v_rect, CYTHON_UNUSED PyObject *__pyx_v_width) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("ellipse", 0); /* "pygame_sdl2/draw.pyx":73 * * def ellipse(Surface surface, color, rect, width=0): * raise error("Not implemented.") # <<<<<<<<<<<<<< * * def arc(Surface surface, color, rect, start_angle, stop_angle, width=1): */ __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_error); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 73; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_tuple__3, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 73; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_Raise(__pyx_t_2, 0, 0, 0); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; {__pyx_filename = __pyx_f[0]; __pyx_lineno = 73; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "pygame_sdl2/draw.pyx":72 * return dirty.clip(surface.get_rect()) * * def ellipse(Surface surface, color, rect, width=0): # <<<<<<<<<<<<<< * raise error("Not implemented.") * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_AddTraceback("pygame_sdl2.draw.ellipse", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/draw.pyx":75 * raise error("Not implemented.") * * def arc(Surface surface, color, rect, start_angle, stop_angle, width=1): # <<<<<<<<<<<<<< * raise error("Not implemented.") * */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_4draw_9arc(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static PyMethodDef __pyx_mdef_11pygame_sdl2_4draw_9arc = {"arc", (PyCFunction)__pyx_pw_11pygame_sdl2_4draw_9arc, METH_VARARGS|METH_KEYWORDS, 0}; static PyObject *__pyx_pw_11pygame_sdl2_4draw_9arc(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { CYTHON_UNUSED struct __pyx_obj_11pygame_sdl2_7surface_Surface *__pyx_v_surface = 0; CYTHON_UNUSED PyObject *__pyx_v_color = 0; CYTHON_UNUSED PyObject *__pyx_v_rect = 0; CYTHON_UNUSED PyObject *__pyx_v_start_angle = 0; CYTHON_UNUSED PyObject *__pyx_v_stop_angle = 0; CYTHON_UNUSED PyObject *__pyx_v_width = 0; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("arc (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_surface,&__pyx_n_s_color,&__pyx_n_s_rect,&__pyx_n_s_start_angle,&__pyx_n_s_stop_angle,&__pyx_n_s_width,0}; PyObject* values[6] = {0,0,0,0,0,0}; values[5] = ((PyObject *)__pyx_int_1); if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5); case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4); case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_surface)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; case 1: if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_color)) != 0)) kw_args--; else { __Pyx_RaiseArgtupleInvalid("arc", 0, 5, 6, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 75; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } case 2: if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_rect)) != 0)) kw_args--; else { __Pyx_RaiseArgtupleInvalid("arc", 0, 5, 6, 2); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 75; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } case 3: if (likely((values[3] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_start_angle)) != 0)) kw_args--; else { __Pyx_RaiseArgtupleInvalid("arc", 0, 5, 6, 3); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 75; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } case 4: if (likely((values[4] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_stop_angle)) != 0)) kw_args--; else { __Pyx_RaiseArgtupleInvalid("arc", 0, 5, 6, 4); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 75; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } case 5: if (kw_args > 0) { PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_width); if (value) { values[5] = value; kw_args--; } } } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "arc") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 75; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } } else { switch (PyTuple_GET_SIZE(__pyx_args)) { case 6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5); case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4); values[3] = PyTuple_GET_ITEM(__pyx_args, 3); values[2] = PyTuple_GET_ITEM(__pyx_args, 2); values[1] = PyTuple_GET_ITEM(__pyx_args, 1); values[0] = PyTuple_GET_ITEM(__pyx_args, 0); break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_surface = ((struct __pyx_obj_11pygame_sdl2_7surface_Surface *)values[0]); __pyx_v_color = values[1]; __pyx_v_rect = values[2]; __pyx_v_start_angle = values[3]; __pyx_v_stop_angle = values[4]; __pyx_v_width = values[5]; } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("arc", 0, 5, 6, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 75; __pyx_clineno = __LINE__; goto __pyx_L3_error;} __pyx_L3_error:; __Pyx_AddTraceback("pygame_sdl2.draw.arc", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_surface), __pyx_ptype_11pygame_sdl2_7surface_Surface, 1, "surface", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 75; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_r = __pyx_pf_11pygame_sdl2_4draw_8arc(__pyx_self, __pyx_v_surface, __pyx_v_color, __pyx_v_rect, __pyx_v_start_angle, __pyx_v_stop_angle, __pyx_v_width); /* function exit code */ goto __pyx_L0; __pyx_L1_error:; __pyx_r = NULL; __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_4draw_8arc(CYTHON_UNUSED PyObject *__pyx_self, CYTHON_UNUSED struct __pyx_obj_11pygame_sdl2_7surface_Surface *__pyx_v_surface, CYTHON_UNUSED PyObject *__pyx_v_color, CYTHON_UNUSED PyObject *__pyx_v_rect, CYTHON_UNUSED PyObject *__pyx_v_start_angle, CYTHON_UNUSED PyObject *__pyx_v_stop_angle, CYTHON_UNUSED PyObject *__pyx_v_width) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("arc", 0); /* "pygame_sdl2/draw.pyx":76 * * def arc(Surface surface, color, rect, start_angle, stop_angle, width=1): * raise error("Not implemented.") # <<<<<<<<<<<<<< * * def line(Surface surface, color, start_pos, end_pos, width=1): */ __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_error); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 76; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_tuple__4, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 76; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_Raise(__pyx_t_2, 0, 0, 0); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; {__pyx_filename = __pyx_f[0]; __pyx_lineno = 76; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "pygame_sdl2/draw.pyx":75 * raise error("Not implemented.") * * def arc(Surface surface, color, rect, start_angle, stop_angle, width=1): # <<<<<<<<<<<<<< * raise error("Not implemented.") * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_AddTraceback("pygame_sdl2.draw.arc", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/draw.pyx":78 * raise error("Not implemented.") * * def line(Surface surface, color, start_pos, end_pos, width=1): # <<<<<<<<<<<<<< * gfxdraw.thick_line(surface, start_pos[0], start_pos[1], * end_pos[0], end_pos[1], width, color) */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_4draw_11line(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static PyMethodDef __pyx_mdef_11pygame_sdl2_4draw_11line = {"line", (PyCFunction)__pyx_pw_11pygame_sdl2_4draw_11line, METH_VARARGS|METH_KEYWORDS, 0}; static PyObject *__pyx_pw_11pygame_sdl2_4draw_11line(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { struct __pyx_obj_11pygame_sdl2_7surface_Surface *__pyx_v_surface = 0; PyObject *__pyx_v_color = 0; PyObject *__pyx_v_start_pos = 0; PyObject *__pyx_v_end_pos = 0; PyObject *__pyx_v_width = 0; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("line (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_surface,&__pyx_n_s_color,&__pyx_n_s_start_pos,&__pyx_n_s_end_pos,&__pyx_n_s_width,0}; PyObject* values[5] = {0,0,0,0,0}; values[4] = ((PyObject *)__pyx_int_1); if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4); case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_surface)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; case 1: if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_color)) != 0)) kw_args--; else { __Pyx_RaiseArgtupleInvalid("line", 0, 4, 5, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 78; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } case 2: if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_start_pos)) != 0)) kw_args--; else { __Pyx_RaiseArgtupleInvalid("line", 0, 4, 5, 2); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 78; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } case 3: if (likely((values[3] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_end_pos)) != 0)) kw_args--; else { __Pyx_RaiseArgtupleInvalid("line", 0, 4, 5, 3); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 78; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } case 4: if (kw_args > 0) { PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_width); if (value) { values[4] = value; kw_args--; } } } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "line") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 78; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } } else { switch (PyTuple_GET_SIZE(__pyx_args)) { case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4); case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); values[2] = PyTuple_GET_ITEM(__pyx_args, 2); values[1] = PyTuple_GET_ITEM(__pyx_args, 1); values[0] = PyTuple_GET_ITEM(__pyx_args, 0); break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_surface = ((struct __pyx_obj_11pygame_sdl2_7surface_Surface *)values[0]); __pyx_v_color = values[1]; __pyx_v_start_pos = values[2]; __pyx_v_end_pos = values[3]; __pyx_v_width = values[4]; } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("line", 0, 4, 5, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 78; __pyx_clineno = __LINE__; goto __pyx_L3_error;} __pyx_L3_error:; __Pyx_AddTraceback("pygame_sdl2.draw.line", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_surface), __pyx_ptype_11pygame_sdl2_7surface_Surface, 1, "surface", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 78; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_r = __pyx_pf_11pygame_sdl2_4draw_10line(__pyx_self, __pyx_v_surface, __pyx_v_color, __pyx_v_start_pos, __pyx_v_end_pos, __pyx_v_width); /* function exit code */ goto __pyx_L0; __pyx_L1_error:; __pyx_r = NULL; __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_4draw_10line(CYTHON_UNUSED PyObject *__pyx_self, struct __pyx_obj_11pygame_sdl2_7surface_Surface *__pyx_v_surface, PyObject *__pyx_v_color, PyObject *__pyx_v_start_pos, PyObject *__pyx_v_end_pos, PyObject *__pyx_v_width) { PyObject *__pyx_v_dirty = NULL; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; PyObject *__pyx_t_5 = NULL; PyObject *__pyx_t_6 = NULL; PyObject *__pyx_t_7 = NULL; Py_ssize_t __pyx_t_8; PyObject *__pyx_t_9 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("line", 0); /* "pygame_sdl2/draw.pyx":79 * * def line(Surface surface, color, start_pos, end_pos, width=1): * gfxdraw.thick_line(surface, start_pos[0], start_pos[1], # <<<<<<<<<<<<<< * end_pos[0], end_pos[1], width, color) * dirty = Rect(start_pos, (width, width)) */ __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_gfxdraw); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 79; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_thick_line); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 79; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_2 = __Pyx_GetItemInt(__pyx_v_start_pos, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(__pyx_t_2 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 79; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; __Pyx_GOTREF(__pyx_t_2); __pyx_t_4 = __Pyx_GetItemInt(__pyx_v_start_pos, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(__pyx_t_4 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 79; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; __Pyx_GOTREF(__pyx_t_4); /* "pygame_sdl2/draw.pyx":80 * def line(Surface surface, color, start_pos, end_pos, width=1): * gfxdraw.thick_line(surface, start_pos[0], start_pos[1], * end_pos[0], end_pos[1], width, color) # <<<<<<<<<<<<<< * dirty = Rect(start_pos, (width, width)) * dirty.union_ip(Rect(end_pos, (width, width))) */ __pyx_t_5 = __Pyx_GetItemInt(__pyx_v_end_pos, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(__pyx_t_5 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 80; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; __Pyx_GOTREF(__pyx_t_5); __pyx_t_6 = __Pyx_GetItemInt(__pyx_v_end_pos, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(__pyx_t_6 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 80; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; __Pyx_GOTREF(__pyx_t_6); __pyx_t_7 = NULL; __pyx_t_8 = 0; if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_3))) { __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_3); if (likely(__pyx_t_7)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); __Pyx_INCREF(__pyx_t_7); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_3, function); __pyx_t_8 = 1; } } __pyx_t_9 = PyTuple_New(7+__pyx_t_8); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 79; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_9); if (__pyx_t_7) { __Pyx_GIVEREF(__pyx_t_7); PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_t_7); __pyx_t_7 = NULL; } __Pyx_INCREF(((PyObject *)__pyx_v_surface)); __Pyx_GIVEREF(((PyObject *)__pyx_v_surface)); PyTuple_SET_ITEM(__pyx_t_9, 0+__pyx_t_8, ((PyObject *)__pyx_v_surface)); __Pyx_GIVEREF(__pyx_t_2); PyTuple_SET_ITEM(__pyx_t_9, 1+__pyx_t_8, __pyx_t_2); __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_9, 2+__pyx_t_8, __pyx_t_4); __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_9, 3+__pyx_t_8, __pyx_t_5); __Pyx_GIVEREF(__pyx_t_6); PyTuple_SET_ITEM(__pyx_t_9, 4+__pyx_t_8, __pyx_t_6); __Pyx_INCREF(__pyx_v_width); __Pyx_GIVEREF(__pyx_v_width); PyTuple_SET_ITEM(__pyx_t_9, 5+__pyx_t_8, __pyx_v_width); __Pyx_INCREF(__pyx_v_color); __Pyx_GIVEREF(__pyx_v_color); PyTuple_SET_ITEM(__pyx_t_9, 6+__pyx_t_8, __pyx_v_color); __pyx_t_2 = 0; __pyx_t_4 = 0; __pyx_t_5 = 0; __pyx_t_6 = 0; __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_9, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 79; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "pygame_sdl2/draw.pyx":81 * gfxdraw.thick_line(surface, start_pos[0], start_pos[1], * end_pos[0], end_pos[1], width, color) * dirty = Rect(start_pos, (width, width)) # <<<<<<<<<<<<<< * dirty.union_ip(Rect(end_pos, (width, width))) * return dirty.clip(surface.get_rect()) */ __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_Rect); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 81; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __pyx_t_9 = PyTuple_New(2); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 81; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_9); __Pyx_INCREF(__pyx_v_width); __Pyx_GIVEREF(__pyx_v_width); PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_v_width); __Pyx_INCREF(__pyx_v_width); __Pyx_GIVEREF(__pyx_v_width); PyTuple_SET_ITEM(__pyx_t_9, 1, __pyx_v_width); __pyx_t_6 = NULL; __pyx_t_8 = 0; if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_3))) { __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_3); if (likely(__pyx_t_6)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); __Pyx_INCREF(__pyx_t_6); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_3, function); __pyx_t_8 = 1; } } __pyx_t_5 = PyTuple_New(2+__pyx_t_8); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 81; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); if (__pyx_t_6) { __Pyx_GIVEREF(__pyx_t_6); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_6); __pyx_t_6 = NULL; } __Pyx_INCREF(__pyx_v_start_pos); __Pyx_GIVEREF(__pyx_v_start_pos); PyTuple_SET_ITEM(__pyx_t_5, 0+__pyx_t_8, __pyx_v_start_pos); __Pyx_GIVEREF(__pyx_t_9); PyTuple_SET_ITEM(__pyx_t_5, 1+__pyx_t_8, __pyx_t_9); __pyx_t_9 = 0; __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_5, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 81; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_v_dirty = __pyx_t_1; __pyx_t_1 = 0; /* "pygame_sdl2/draw.pyx":82 * end_pos[0], end_pos[1], width, color) * dirty = Rect(start_pos, (width, width)) * dirty.union_ip(Rect(end_pos, (width, width))) # <<<<<<<<<<<<<< * return dirty.clip(surface.get_rect()) * */ __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_dirty, __pyx_n_s_union_ip); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 82; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __pyx_t_9 = __Pyx_GetModuleGlobalName(__pyx_n_s_Rect); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 82; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_9); __pyx_t_6 = PyTuple_New(2); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 82; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_6); __Pyx_INCREF(__pyx_v_width); __Pyx_GIVEREF(__pyx_v_width); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_v_width); __Pyx_INCREF(__pyx_v_width); __Pyx_GIVEREF(__pyx_v_width); PyTuple_SET_ITEM(__pyx_t_6, 1, __pyx_v_width); __pyx_t_4 = NULL; __pyx_t_8 = 0; if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_9))) { __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_9); if (likely(__pyx_t_4)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_9); __Pyx_INCREF(__pyx_t_4); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_9, function); __pyx_t_8 = 1; } } __pyx_t_2 = PyTuple_New(2+__pyx_t_8); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 82; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); if (__pyx_t_4) { __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_4); __pyx_t_4 = NULL; } __Pyx_INCREF(__pyx_v_end_pos); __Pyx_GIVEREF(__pyx_v_end_pos); PyTuple_SET_ITEM(__pyx_t_2, 0+__pyx_t_8, __pyx_v_end_pos); __Pyx_GIVEREF(__pyx_t_6); PyTuple_SET_ITEM(__pyx_t_2, 1+__pyx_t_8, __pyx_t_6); __pyx_t_6 = 0; __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_9, __pyx_t_2, NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 82; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; __pyx_t_9 = NULL; if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_3))) { __pyx_t_9 = PyMethod_GET_SELF(__pyx_t_3); if (likely(__pyx_t_9)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); __Pyx_INCREF(__pyx_t_9); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_3, function); } } if (!__pyx_t_9) { __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_5); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 82; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_GOTREF(__pyx_t_1); } else { __pyx_t_2 = PyTuple_New(1+1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 82; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __Pyx_GIVEREF(__pyx_t_9); PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_9); __pyx_t_9 = NULL; __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_2, 0+1, __pyx_t_5); __pyx_t_5 = 0; __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_2, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 82; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "pygame_sdl2/draw.pyx":83 * dirty = Rect(start_pos, (width, width)) * dirty.union_ip(Rect(end_pos, (width, width))) * return dirty.clip(surface.get_rect()) # <<<<<<<<<<<<<< * * def lines(Surface surface, color, closed, pointlist, width=1): */ __Pyx_XDECREF(__pyx_r); __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_dirty, __pyx_n_s_clip); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 83; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __pyx_t_5 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_surface), __pyx_n_s_get_rect); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 83; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); __pyx_t_9 = NULL; if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_5))) { __pyx_t_9 = PyMethod_GET_SELF(__pyx_t_5); if (likely(__pyx_t_9)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5); __Pyx_INCREF(__pyx_t_9); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_5, function); } } if (__pyx_t_9) { __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_t_9); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 83; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; } else { __pyx_t_2 = __Pyx_PyObject_CallNoArg(__pyx_t_5); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 83; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __pyx_t_5 = NULL; if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_3))) { __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_3); if (likely(__pyx_t_5)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); __Pyx_INCREF(__pyx_t_5); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_3, function); } } if (!__pyx_t_5) { __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 83; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_GOTREF(__pyx_t_1); } else { __pyx_t_9 = PyTuple_New(1+1); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 83; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_9); __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_t_5); __pyx_t_5 = NULL; __Pyx_GIVEREF(__pyx_t_2); PyTuple_SET_ITEM(__pyx_t_9, 0+1, __pyx_t_2); __pyx_t_2 = 0; __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_9, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 83; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; } __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "pygame_sdl2/draw.pyx":78 * raise error("Not implemented.") * * def line(Surface surface, color, start_pos, end_pos, width=1): # <<<<<<<<<<<<<< * gfxdraw.thick_line(surface, start_pos[0], start_pos[1], * end_pos[0], end_pos[1], width, color) */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_5); __Pyx_XDECREF(__pyx_t_6); __Pyx_XDECREF(__pyx_t_7); __Pyx_XDECREF(__pyx_t_9); __Pyx_AddTraceback("pygame_sdl2.draw.line", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF(__pyx_v_dirty); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/draw.pyx":85 * return dirty.clip(surface.get_rect()) * * def lines(Surface surface, color, closed, pointlist, width=1): # <<<<<<<<<<<<<< * n = 0 * dirty = Rect(pointlist[0], (width, width)) */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_4draw_13lines(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static PyMethodDef __pyx_mdef_11pygame_sdl2_4draw_13lines = {"lines", (PyCFunction)__pyx_pw_11pygame_sdl2_4draw_13lines, METH_VARARGS|METH_KEYWORDS, 0}; static PyObject *__pyx_pw_11pygame_sdl2_4draw_13lines(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { struct __pyx_obj_11pygame_sdl2_7surface_Surface *__pyx_v_surface = 0; PyObject *__pyx_v_color = 0; PyObject *__pyx_v_closed = 0; PyObject *__pyx_v_pointlist = 0; PyObject *__pyx_v_width = 0; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("lines (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_surface,&__pyx_n_s_color,&__pyx_n_s_closed,&__pyx_n_s_pointlist,&__pyx_n_s_width,0}; PyObject* values[5] = {0,0,0,0,0}; values[4] = ((PyObject *)__pyx_int_1); if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4); case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_surface)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; case 1: if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_color)) != 0)) kw_args--; else { __Pyx_RaiseArgtupleInvalid("lines", 0, 4, 5, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 85; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } case 2: if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_closed)) != 0)) kw_args--; else { __Pyx_RaiseArgtupleInvalid("lines", 0, 4, 5, 2); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 85; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } case 3: if (likely((values[3] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_pointlist)) != 0)) kw_args--; else { __Pyx_RaiseArgtupleInvalid("lines", 0, 4, 5, 3); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 85; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } case 4: if (kw_args > 0) { PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_width); if (value) { values[4] = value; kw_args--; } } } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "lines") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 85; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } } else { switch (PyTuple_GET_SIZE(__pyx_args)) { case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4); case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); values[2] = PyTuple_GET_ITEM(__pyx_args, 2); values[1] = PyTuple_GET_ITEM(__pyx_args, 1); values[0] = PyTuple_GET_ITEM(__pyx_args, 0); break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_surface = ((struct __pyx_obj_11pygame_sdl2_7surface_Surface *)values[0]); __pyx_v_color = values[1]; __pyx_v_closed = values[2]; __pyx_v_pointlist = values[3]; __pyx_v_width = values[4]; } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("lines", 0, 4, 5, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 85; __pyx_clineno = __LINE__; goto __pyx_L3_error;} __pyx_L3_error:; __Pyx_AddTraceback("pygame_sdl2.draw.lines", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_surface), __pyx_ptype_11pygame_sdl2_7surface_Surface, 1, "surface", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 85; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_r = __pyx_pf_11pygame_sdl2_4draw_12lines(__pyx_self, __pyx_v_surface, __pyx_v_color, __pyx_v_closed, __pyx_v_pointlist, __pyx_v_width); /* function exit code */ goto __pyx_L0; __pyx_L1_error:; __pyx_r = NULL; __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_4draw_12lines(CYTHON_UNUSED PyObject *__pyx_self, struct __pyx_obj_11pygame_sdl2_7surface_Surface *__pyx_v_surface, PyObject *__pyx_v_color, PyObject *__pyx_v_closed, PyObject *__pyx_v_pointlist, PyObject *__pyx_v_width) { PyObject *__pyx_v_n = NULL; PyObject *__pyx_v_dirty = NULL; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; PyObject *__pyx_t_5 = NULL; Py_ssize_t __pyx_t_6; PyObject *__pyx_t_7 = NULL; int __pyx_t_8; PyObject *__pyx_t_9 = NULL; PyObject *__pyx_t_10 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("lines", 0); /* "pygame_sdl2/draw.pyx":86 * * def lines(Surface surface, color, closed, pointlist, width=1): * n = 0 # <<<<<<<<<<<<<< * dirty = Rect(pointlist[0], (width, width)) * while n < len(pointlist) - 1: */ __Pyx_INCREF(__pyx_int_0); __pyx_v_n = __pyx_int_0; /* "pygame_sdl2/draw.pyx":87 * def lines(Surface surface, color, closed, pointlist, width=1): * n = 0 * dirty = Rect(pointlist[0], (width, width)) # <<<<<<<<<<<<<< * while n < len(pointlist) - 1: * line(surface, color, pointlist[n], pointlist[n+1], width) */ __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_Rect); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 87; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = __Pyx_GetItemInt(__pyx_v_pointlist, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(__pyx_t_3 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 87; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 87; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); __Pyx_INCREF(__pyx_v_width); __Pyx_GIVEREF(__pyx_v_width); PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_v_width); __Pyx_INCREF(__pyx_v_width); __Pyx_GIVEREF(__pyx_v_width); PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_v_width); __pyx_t_5 = NULL; __pyx_t_6 = 0; if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_2))) { __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_2); if (likely(__pyx_t_5)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_5); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); __pyx_t_6 = 1; } } __pyx_t_7 = PyTuple_New(2+__pyx_t_6); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 87; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_7); if (__pyx_t_5) { __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_5); __pyx_t_5 = NULL; } __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_7, 0+__pyx_t_6, __pyx_t_3); __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_7, 1+__pyx_t_6, __pyx_t_4); __pyx_t_3 = 0; __pyx_t_4 = 0; __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_7, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 87; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_v_dirty = __pyx_t_1; __pyx_t_1 = 0; /* "pygame_sdl2/draw.pyx":88 * n = 0 * dirty = Rect(pointlist[0], (width, width)) * while n < len(pointlist) - 1: # <<<<<<<<<<<<<< * line(surface, color, pointlist[n], pointlist[n+1], width) * dirty.union_ip(Rect(pointlist[n+1], (width, width))) */ while (1) { __pyx_t_6 = PyObject_Length(__pyx_v_pointlist); if (unlikely(__pyx_t_6 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 88; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_t_1 = PyInt_FromSsize_t((__pyx_t_6 - 1)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 88; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = PyObject_RichCompare(__pyx_v_n, __pyx_t_1, Py_LT); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 88; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_8 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_8 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 88; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; if (!__pyx_t_8) break; /* "pygame_sdl2/draw.pyx":89 * dirty = Rect(pointlist[0], (width, width)) * while n < len(pointlist) - 1: * line(surface, color, pointlist[n], pointlist[n+1], width) # <<<<<<<<<<<<<< * dirty.union_ip(Rect(pointlist[n+1], (width, width))) * n += 1 */ __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_line); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 89; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_t_7 = PyObject_GetItem(__pyx_v_pointlist, __pyx_v_n); if (unlikely(__pyx_t_7 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 89; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; __Pyx_GOTREF(__pyx_t_7); __pyx_t_4 = __Pyx_PyInt_AddObjC(__pyx_v_n, __pyx_int_1, 1, 0); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 89; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); __pyx_t_3 = PyObject_GetItem(__pyx_v_pointlist, __pyx_t_4); if (unlikely(__pyx_t_3 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 89; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_t_4 = NULL; __pyx_t_6 = 0; if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_1))) { __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_1); if (likely(__pyx_t_4)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1); __Pyx_INCREF(__pyx_t_4); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_1, function); __pyx_t_6 = 1; } } __pyx_t_5 = PyTuple_New(5+__pyx_t_6); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 89; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); if (__pyx_t_4) { __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_4); __pyx_t_4 = NULL; } __Pyx_INCREF(((PyObject *)__pyx_v_surface)); __Pyx_GIVEREF(((PyObject *)__pyx_v_surface)); PyTuple_SET_ITEM(__pyx_t_5, 0+__pyx_t_6, ((PyObject *)__pyx_v_surface)); __Pyx_INCREF(__pyx_v_color); __Pyx_GIVEREF(__pyx_v_color); PyTuple_SET_ITEM(__pyx_t_5, 1+__pyx_t_6, __pyx_v_color); __Pyx_GIVEREF(__pyx_t_7); PyTuple_SET_ITEM(__pyx_t_5, 2+__pyx_t_6, __pyx_t_7); __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_5, 3+__pyx_t_6, __pyx_t_3); __Pyx_INCREF(__pyx_v_width); __Pyx_GIVEREF(__pyx_v_width); PyTuple_SET_ITEM(__pyx_t_5, 4+__pyx_t_6, __pyx_v_width); __pyx_t_7 = 0; __pyx_t_3 = 0; __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_5, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 89; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "pygame_sdl2/draw.pyx":90 * while n < len(pointlist) - 1: * line(surface, color, pointlist[n], pointlist[n+1], width) * dirty.union_ip(Rect(pointlist[n+1], (width, width))) # <<<<<<<<<<<<<< * n += 1 * if closed: */ __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_dirty, __pyx_n_s_union_ip); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 90; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_Rect); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 90; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __pyx_t_7 = __Pyx_PyInt_AddObjC(__pyx_v_n, __pyx_int_1, 1, 0); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 90; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_7); __pyx_t_4 = PyObject_GetItem(__pyx_v_pointlist, __pyx_t_7); if (unlikely(__pyx_t_4 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 90; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __pyx_t_7 = PyTuple_New(2); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 90; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_7); __Pyx_INCREF(__pyx_v_width); __Pyx_GIVEREF(__pyx_v_width); PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_v_width); __Pyx_INCREF(__pyx_v_width); __Pyx_GIVEREF(__pyx_v_width); PyTuple_SET_ITEM(__pyx_t_7, 1, __pyx_v_width); __pyx_t_9 = NULL; __pyx_t_6 = 0; if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_3))) { __pyx_t_9 = PyMethod_GET_SELF(__pyx_t_3); if (likely(__pyx_t_9)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); __Pyx_INCREF(__pyx_t_9); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_3, function); __pyx_t_6 = 1; } } __pyx_t_10 = PyTuple_New(2+__pyx_t_6); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 90; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_10); if (__pyx_t_9) { __Pyx_GIVEREF(__pyx_t_9); PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_t_9); __pyx_t_9 = NULL; } __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_10, 0+__pyx_t_6, __pyx_t_4); __Pyx_GIVEREF(__pyx_t_7); PyTuple_SET_ITEM(__pyx_t_10, 1+__pyx_t_6, __pyx_t_7); __pyx_t_4 = 0; __pyx_t_7 = 0; __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_10, NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 90; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_3 = NULL; if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_1))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_1); if (likely(__pyx_t_3)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_1, function); } } if (!__pyx_t_3) { __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_1, __pyx_t_5); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 90; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_GOTREF(__pyx_t_2); } else { __pyx_t_10 = PyTuple_New(1+1); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 90; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_10); __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_t_3); __pyx_t_3 = NULL; __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_10, 0+1, __pyx_t_5); __pyx_t_5 = 0; __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_10, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 90; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "pygame_sdl2/draw.pyx":91 * line(surface, color, pointlist[n], pointlist[n+1], width) * dirty.union_ip(Rect(pointlist[n+1], (width, width))) * n += 1 # <<<<<<<<<<<<<< * if closed: * line(surface, color, pointlist[n], pointlist[0], width) */ __pyx_t_2 = __Pyx_PyInt_AddObjC(__pyx_v_n, __pyx_int_1, 1, 1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 91; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF_SET(__pyx_v_n, __pyx_t_2); __pyx_t_2 = 0; } /* "pygame_sdl2/draw.pyx":92 * dirty.union_ip(Rect(pointlist[n+1], (width, width))) * n += 1 * if closed: # <<<<<<<<<<<<<< * line(surface, color, pointlist[n], pointlist[0], width) * return dirty.clip(surface.get_rect()) */ __pyx_t_8 = __Pyx_PyObject_IsTrue(__pyx_v_closed); if (unlikely(__pyx_t_8 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 92; __pyx_clineno = __LINE__; goto __pyx_L1_error;} if (__pyx_t_8) { /* "pygame_sdl2/draw.pyx":93 * n += 1 * if closed: * line(surface, color, pointlist[n], pointlist[0], width) # <<<<<<<<<<<<<< * return dirty.clip(surface.get_rect()) * */ __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_line); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 93; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_t_10 = PyObject_GetItem(__pyx_v_pointlist, __pyx_v_n); if (unlikely(__pyx_t_10 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 93; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; __Pyx_GOTREF(__pyx_t_10); __pyx_t_5 = __Pyx_GetItemInt(__pyx_v_pointlist, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(__pyx_t_5 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 93; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; __Pyx_GOTREF(__pyx_t_5); __pyx_t_3 = NULL; __pyx_t_6 = 0; if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_1))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_1); if (likely(__pyx_t_3)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_1, function); __pyx_t_6 = 1; } } __pyx_t_7 = PyTuple_New(5+__pyx_t_6); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 93; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_7); if (__pyx_t_3) { __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_3); __pyx_t_3 = NULL; } __Pyx_INCREF(((PyObject *)__pyx_v_surface)); __Pyx_GIVEREF(((PyObject *)__pyx_v_surface)); PyTuple_SET_ITEM(__pyx_t_7, 0+__pyx_t_6, ((PyObject *)__pyx_v_surface)); __Pyx_INCREF(__pyx_v_color); __Pyx_GIVEREF(__pyx_v_color); PyTuple_SET_ITEM(__pyx_t_7, 1+__pyx_t_6, __pyx_v_color); __Pyx_GIVEREF(__pyx_t_10); PyTuple_SET_ITEM(__pyx_t_7, 2+__pyx_t_6, __pyx_t_10); __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_7, 3+__pyx_t_6, __pyx_t_5); __Pyx_INCREF(__pyx_v_width); __Pyx_GIVEREF(__pyx_v_width); PyTuple_SET_ITEM(__pyx_t_7, 4+__pyx_t_6, __pyx_v_width); __pyx_t_10 = 0; __pyx_t_5 = 0; __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_7, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 93; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "pygame_sdl2/draw.pyx":92 * dirty.union_ip(Rect(pointlist[n+1], (width, width))) * n += 1 * if closed: # <<<<<<<<<<<<<< * line(surface, color, pointlist[n], pointlist[0], width) * return dirty.clip(surface.get_rect()) */ } /* "pygame_sdl2/draw.pyx":94 * if closed: * line(surface, color, pointlist[n], pointlist[0], width) * return dirty.clip(surface.get_rect()) # <<<<<<<<<<<<<< * * def aaline(Surface surface, color, startpos, endpos, blend=1): */ __Pyx_XDECREF(__pyx_r); __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_dirty, __pyx_n_s_clip); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 94; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_t_5 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_surface), __pyx_n_s_get_rect); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 94; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); __pyx_t_10 = NULL; if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_5))) { __pyx_t_10 = PyMethod_GET_SELF(__pyx_t_5); if (likely(__pyx_t_10)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5); __Pyx_INCREF(__pyx_t_10); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_5, function); } } if (__pyx_t_10) { __pyx_t_7 = __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_t_10); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 94; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; } else { __pyx_t_7 = __Pyx_PyObject_CallNoArg(__pyx_t_5); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 94; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __pyx_t_5 = NULL; if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_1))) { __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_1); if (likely(__pyx_t_5)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1); __Pyx_INCREF(__pyx_t_5); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_1, function); } } if (!__pyx_t_5) { __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_1, __pyx_t_7); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 94; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_GOTREF(__pyx_t_2); } else { __pyx_t_10 = PyTuple_New(1+1); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 94; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_10); __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_t_5); __pyx_t_5 = NULL; __Pyx_GIVEREF(__pyx_t_7); PyTuple_SET_ITEM(__pyx_t_10, 0+1, __pyx_t_7); __pyx_t_7 = 0; __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_10, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 94; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; /* "pygame_sdl2/draw.pyx":85 * return dirty.clip(surface.get_rect()) * * def lines(Surface surface, color, closed, pointlist, width=1): # <<<<<<<<<<<<<< * n = 0 * dirty = Rect(pointlist[0], (width, width)) */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_5); __Pyx_XDECREF(__pyx_t_7); __Pyx_XDECREF(__pyx_t_9); __Pyx_XDECREF(__pyx_t_10); __Pyx_AddTraceback("pygame_sdl2.draw.lines", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF(__pyx_v_n); __Pyx_XDECREF(__pyx_v_dirty); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/draw.pyx":96 * return dirty.clip(surface.get_rect()) * * def aaline(Surface surface, color, startpos, endpos, blend=1): # <<<<<<<<<<<<<< * x1, y1 = startpos * x2, y2 = endpos */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_4draw_15aaline(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static PyMethodDef __pyx_mdef_11pygame_sdl2_4draw_15aaline = {"aaline", (PyCFunction)__pyx_pw_11pygame_sdl2_4draw_15aaline, METH_VARARGS|METH_KEYWORDS, 0}; static PyObject *__pyx_pw_11pygame_sdl2_4draw_15aaline(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { struct __pyx_obj_11pygame_sdl2_7surface_Surface *__pyx_v_surface = 0; PyObject *__pyx_v_color = 0; PyObject *__pyx_v_startpos = 0; PyObject *__pyx_v_endpos = 0; CYTHON_UNUSED PyObject *__pyx_v_blend = 0; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("aaline (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_surface,&__pyx_n_s_color,&__pyx_n_s_startpos,&__pyx_n_s_endpos,&__pyx_n_s_blend,0}; PyObject* values[5] = {0,0,0,0,0}; values[4] = ((PyObject *)__pyx_int_1); if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4); case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_surface)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; case 1: if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_color)) != 0)) kw_args--; else { __Pyx_RaiseArgtupleInvalid("aaline", 0, 4, 5, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 96; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } case 2: if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_startpos)) != 0)) kw_args--; else { __Pyx_RaiseArgtupleInvalid("aaline", 0, 4, 5, 2); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 96; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } case 3: if (likely((values[3] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_endpos)) != 0)) kw_args--; else { __Pyx_RaiseArgtupleInvalid("aaline", 0, 4, 5, 3); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 96; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } case 4: if (kw_args > 0) { PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_blend); if (value) { values[4] = value; kw_args--; } } } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "aaline") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 96; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } } else { switch (PyTuple_GET_SIZE(__pyx_args)) { case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4); case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); values[2] = PyTuple_GET_ITEM(__pyx_args, 2); values[1] = PyTuple_GET_ITEM(__pyx_args, 1); values[0] = PyTuple_GET_ITEM(__pyx_args, 0); break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_surface = ((struct __pyx_obj_11pygame_sdl2_7surface_Surface *)values[0]); __pyx_v_color = values[1]; __pyx_v_startpos = values[2]; __pyx_v_endpos = values[3]; __pyx_v_blend = values[4]; } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("aaline", 0, 4, 5, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 96; __pyx_clineno = __LINE__; goto __pyx_L3_error;} __pyx_L3_error:; __Pyx_AddTraceback("pygame_sdl2.draw.aaline", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_surface), __pyx_ptype_11pygame_sdl2_7surface_Surface, 1, "surface", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 96; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_r = __pyx_pf_11pygame_sdl2_4draw_14aaline(__pyx_self, __pyx_v_surface, __pyx_v_color, __pyx_v_startpos, __pyx_v_endpos, __pyx_v_blend); /* function exit code */ goto __pyx_L0; __pyx_L1_error:; __pyx_r = NULL; __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_4draw_14aaline(CYTHON_UNUSED PyObject *__pyx_self, struct __pyx_obj_11pygame_sdl2_7surface_Surface *__pyx_v_surface, PyObject *__pyx_v_color, PyObject *__pyx_v_startpos, PyObject *__pyx_v_endpos, CYTHON_UNUSED PyObject *__pyx_v_blend) { PyObject *__pyx_v_x1 = NULL; PyObject *__pyx_v_y1 = NULL; PyObject *__pyx_v_x2 = NULL; PyObject *__pyx_v_y2 = NULL; PyObject *__pyx_v_dirty = NULL; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; PyObject *(*__pyx_t_4)(PyObject *); Py_ssize_t __pyx_t_5; PyObject *__pyx_t_6 = NULL; PyObject *__pyx_t_7 = NULL; PyObject *__pyx_t_8 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("aaline", 0); /* "pygame_sdl2/draw.pyx":97 * * def aaline(Surface surface, color, startpos, endpos, blend=1): * x1, y1 = startpos # <<<<<<<<<<<<<< * x2, y2 = endpos * gfxdraw.aaline(surface, x1, y1, x2, y2, color) */ if ((likely(PyTuple_CheckExact(__pyx_v_startpos))) || (PyList_CheckExact(__pyx_v_startpos))) { PyObject* sequence = __pyx_v_startpos; #if CYTHON_COMPILING_IN_CPYTHON Py_ssize_t size = Py_SIZE(sequence); #else Py_ssize_t size = PySequence_Size(sequence); #endif if (unlikely(size != 2)) { if (size > 2) __Pyx_RaiseTooManyValuesError(2); else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 97; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } #if CYTHON_COMPILING_IN_CPYTHON if (likely(PyTuple_CheckExact(sequence))) { __pyx_t_1 = PyTuple_GET_ITEM(sequence, 0); __pyx_t_2 = PyTuple_GET_ITEM(sequence, 1); } else { __pyx_t_1 = PyList_GET_ITEM(sequence, 0); __pyx_t_2 = PyList_GET_ITEM(sequence, 1); } __Pyx_INCREF(__pyx_t_1); __Pyx_INCREF(__pyx_t_2); #else __pyx_t_1 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 97; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 97; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); #endif } else { Py_ssize_t index = -1; __pyx_t_3 = PyObject_GetIter(__pyx_v_startpos); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 97; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = Py_TYPE(__pyx_t_3)->tp_iternext; index = 0; __pyx_t_1 = __pyx_t_4(__pyx_t_3); if (unlikely(!__pyx_t_1)) goto __pyx_L3_unpacking_failed; __Pyx_GOTREF(__pyx_t_1); index = 1; __pyx_t_2 = __pyx_t_4(__pyx_t_3); if (unlikely(!__pyx_t_2)) goto __pyx_L3_unpacking_failed; __Pyx_GOTREF(__pyx_t_2); if (__Pyx_IternextUnpackEndCheck(__pyx_t_4(__pyx_t_3), 2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 97; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_t_4 = NULL; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; goto __pyx_L4_unpacking_done; __pyx_L3_unpacking_failed:; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_4 = NULL; if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 97; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_L4_unpacking_done:; } __pyx_v_x1 = __pyx_t_1; __pyx_t_1 = 0; __pyx_v_y1 = __pyx_t_2; __pyx_t_2 = 0; /* "pygame_sdl2/draw.pyx":98 * def aaline(Surface surface, color, startpos, endpos, blend=1): * x1, y1 = startpos * x2, y2 = endpos # <<<<<<<<<<<<<< * gfxdraw.aaline(surface, x1, y1, x2, y2, color) * dirty = Rect(x1, y1, x2 - x1, y2 - y1) */ if ((likely(PyTuple_CheckExact(__pyx_v_endpos))) || (PyList_CheckExact(__pyx_v_endpos))) { PyObject* sequence = __pyx_v_endpos; #if CYTHON_COMPILING_IN_CPYTHON Py_ssize_t size = Py_SIZE(sequence); #else Py_ssize_t size = PySequence_Size(sequence); #endif if (unlikely(size != 2)) { if (size > 2) __Pyx_RaiseTooManyValuesError(2); else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 98; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } #if CYTHON_COMPILING_IN_CPYTHON if (likely(PyTuple_CheckExact(sequence))) { __pyx_t_2 = PyTuple_GET_ITEM(sequence, 0); __pyx_t_1 = PyTuple_GET_ITEM(sequence, 1); } else { __pyx_t_2 = PyList_GET_ITEM(sequence, 0); __pyx_t_1 = PyList_GET_ITEM(sequence, 1); } __Pyx_INCREF(__pyx_t_2); __Pyx_INCREF(__pyx_t_1); #else __pyx_t_2 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 98; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __pyx_t_1 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 98; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); #endif } else { Py_ssize_t index = -1; __pyx_t_3 = PyObject_GetIter(__pyx_v_endpos); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 98; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = Py_TYPE(__pyx_t_3)->tp_iternext; index = 0; __pyx_t_2 = __pyx_t_4(__pyx_t_3); if (unlikely(!__pyx_t_2)) goto __pyx_L5_unpacking_failed; __Pyx_GOTREF(__pyx_t_2); index = 1; __pyx_t_1 = __pyx_t_4(__pyx_t_3); if (unlikely(!__pyx_t_1)) goto __pyx_L5_unpacking_failed; __Pyx_GOTREF(__pyx_t_1); if (__Pyx_IternextUnpackEndCheck(__pyx_t_4(__pyx_t_3), 2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 98; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_t_4 = NULL; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; goto __pyx_L6_unpacking_done; __pyx_L5_unpacking_failed:; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_4 = NULL; if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 98; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_L6_unpacking_done:; } __pyx_v_x2 = __pyx_t_2; __pyx_t_2 = 0; __pyx_v_y2 = __pyx_t_1; __pyx_t_1 = 0; /* "pygame_sdl2/draw.pyx":99 * x1, y1 = startpos * x2, y2 = endpos * gfxdraw.aaline(surface, x1, y1, x2, y2, color) # <<<<<<<<<<<<<< * dirty = Rect(x1, y1, x2 - x1, y2 - y1) * return dirty.clip(surface.get_rect()) */ __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_gfxdraw); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 99; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_aaline); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 99; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_2 = NULL; __pyx_t_5 = 0; if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_3))) { __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_3); if (likely(__pyx_t_2)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); __Pyx_INCREF(__pyx_t_2); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_3, function); __pyx_t_5 = 1; } } __pyx_t_6 = PyTuple_New(6+__pyx_t_5); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 99; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_6); if (__pyx_t_2) { __Pyx_GIVEREF(__pyx_t_2); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_2); __pyx_t_2 = NULL; } __Pyx_INCREF(((PyObject *)__pyx_v_surface)); __Pyx_GIVEREF(((PyObject *)__pyx_v_surface)); PyTuple_SET_ITEM(__pyx_t_6, 0+__pyx_t_5, ((PyObject *)__pyx_v_surface)); __Pyx_INCREF(__pyx_v_x1); __Pyx_GIVEREF(__pyx_v_x1); PyTuple_SET_ITEM(__pyx_t_6, 1+__pyx_t_5, __pyx_v_x1); __Pyx_INCREF(__pyx_v_y1); __Pyx_GIVEREF(__pyx_v_y1); PyTuple_SET_ITEM(__pyx_t_6, 2+__pyx_t_5, __pyx_v_y1); __Pyx_INCREF(__pyx_v_x2); __Pyx_GIVEREF(__pyx_v_x2); PyTuple_SET_ITEM(__pyx_t_6, 3+__pyx_t_5, __pyx_v_x2); __Pyx_INCREF(__pyx_v_y2); __Pyx_GIVEREF(__pyx_v_y2); PyTuple_SET_ITEM(__pyx_t_6, 4+__pyx_t_5, __pyx_v_y2); __Pyx_INCREF(__pyx_v_color); __Pyx_GIVEREF(__pyx_v_color); PyTuple_SET_ITEM(__pyx_t_6, 5+__pyx_t_5, __pyx_v_color); __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_6, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 99; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "pygame_sdl2/draw.pyx":100 * x2, y2 = endpos * gfxdraw.aaline(surface, x1, y1, x2, y2, color) * dirty = Rect(x1, y1, x2 - x1, y2 - y1) # <<<<<<<<<<<<<< * return dirty.clip(surface.get_rect()) * */ __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_Rect); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 100; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __pyx_t_6 = PyNumber_Subtract(__pyx_v_x2, __pyx_v_x1); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 100; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_6); __pyx_t_2 = PyNumber_Subtract(__pyx_v_y2, __pyx_v_y1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 100; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __pyx_t_7 = NULL; __pyx_t_5 = 0; if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_3))) { __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_3); if (likely(__pyx_t_7)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); __Pyx_INCREF(__pyx_t_7); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_3, function); __pyx_t_5 = 1; } } __pyx_t_8 = PyTuple_New(4+__pyx_t_5); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 100; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_8); if (__pyx_t_7) { __Pyx_GIVEREF(__pyx_t_7); PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_7); __pyx_t_7 = NULL; } __Pyx_INCREF(__pyx_v_x1); __Pyx_GIVEREF(__pyx_v_x1); PyTuple_SET_ITEM(__pyx_t_8, 0+__pyx_t_5, __pyx_v_x1); __Pyx_INCREF(__pyx_v_y1); __Pyx_GIVEREF(__pyx_v_y1); PyTuple_SET_ITEM(__pyx_t_8, 1+__pyx_t_5, __pyx_v_y1); __Pyx_GIVEREF(__pyx_t_6); PyTuple_SET_ITEM(__pyx_t_8, 2+__pyx_t_5, __pyx_t_6); __Pyx_GIVEREF(__pyx_t_2); PyTuple_SET_ITEM(__pyx_t_8, 3+__pyx_t_5, __pyx_t_2); __pyx_t_6 = 0; __pyx_t_2 = 0; __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_8, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 100; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_v_dirty = __pyx_t_1; __pyx_t_1 = 0; /* "pygame_sdl2/draw.pyx":101 * gfxdraw.aaline(surface, x1, y1, x2, y2, color) * dirty = Rect(x1, y1, x2 - x1, y2 - y1) * return dirty.clip(surface.get_rect()) # <<<<<<<<<<<<<< * * def aalines(Surface surface, color, closed, pointlist, blend=1): */ __Pyx_XDECREF(__pyx_r); __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_dirty, __pyx_n_s_clip); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 101; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_surface), __pyx_n_s_get_rect); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 101; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __pyx_t_6 = NULL; if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_2))) { __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_2); if (likely(__pyx_t_6)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_6); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); } } if (__pyx_t_6) { __pyx_t_8 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_6); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 101; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; } else { __pyx_t_8 = __Pyx_PyObject_CallNoArg(__pyx_t_2); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 101; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } __Pyx_GOTREF(__pyx_t_8); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_2 = NULL; if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_3))) { __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_3); if (likely(__pyx_t_2)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); __Pyx_INCREF(__pyx_t_2); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_3, function); } } if (!__pyx_t_2) { __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_8); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 101; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; __Pyx_GOTREF(__pyx_t_1); } else { __pyx_t_6 = PyTuple_New(1+1); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 101; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_6); __Pyx_GIVEREF(__pyx_t_2); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_2); __pyx_t_2 = NULL; __Pyx_GIVEREF(__pyx_t_8); PyTuple_SET_ITEM(__pyx_t_6, 0+1, __pyx_t_8); __pyx_t_8 = 0; __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_6, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 101; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; } __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "pygame_sdl2/draw.pyx":96 * return dirty.clip(surface.get_rect()) * * def aaline(Surface surface, color, startpos, endpos, blend=1): # <<<<<<<<<<<<<< * x1, y1 = startpos * x2, y2 = endpos */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_6); __Pyx_XDECREF(__pyx_t_7); __Pyx_XDECREF(__pyx_t_8); __Pyx_AddTraceback("pygame_sdl2.draw.aaline", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF(__pyx_v_x1); __Pyx_XDECREF(__pyx_v_y1); __Pyx_XDECREF(__pyx_v_x2); __Pyx_XDECREF(__pyx_v_y2); __Pyx_XDECREF(__pyx_v_dirty); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pygame_sdl2/draw.pyx":103 * return dirty.clip(surface.get_rect()) * * def aalines(Surface surface, color, closed, pointlist, blend=1): # <<<<<<<<<<<<<< * n = 0 * dirty = Rect(pointlist[0], (1,1)) */ /* Python wrapper */ static PyObject *__pyx_pw_11pygame_sdl2_4draw_17aalines(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static PyMethodDef __pyx_mdef_11pygame_sdl2_4draw_17aalines = {"aalines", (PyCFunction)__pyx_pw_11pygame_sdl2_4draw_17aalines, METH_VARARGS|METH_KEYWORDS, 0}; static PyObject *__pyx_pw_11pygame_sdl2_4draw_17aalines(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { struct __pyx_obj_11pygame_sdl2_7surface_Surface *__pyx_v_surface = 0; PyObject *__pyx_v_color = 0; PyObject *__pyx_v_closed = 0; PyObject *__pyx_v_pointlist = 0; CYTHON_UNUSED PyObject *__pyx_v_blend = 0; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("aalines (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_surface,&__pyx_n_s_color,&__pyx_n_s_closed,&__pyx_n_s_pointlist,&__pyx_n_s_blend,0}; PyObject* values[5] = {0,0,0,0,0}; values[4] = ((PyObject *)__pyx_int_1); if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4); case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_surface)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; case 1: if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_color)) != 0)) kw_args--; else { __Pyx_RaiseArgtupleInvalid("aalines", 0, 4, 5, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 103; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } case 2: if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_closed)) != 0)) kw_args--; else { __Pyx_RaiseArgtupleInvalid("aalines", 0, 4, 5, 2); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 103; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } case 3: if (likely((values[3] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_pointlist)) != 0)) kw_args--; else { __Pyx_RaiseArgtupleInvalid("aalines", 0, 4, 5, 3); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 103; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } case 4: if (kw_args > 0) { PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_blend); if (value) { values[4] = value; kw_args--; } } } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "aalines") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 103; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } } else { switch (PyTuple_GET_SIZE(__pyx_args)) { case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4); case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); values[2] = PyTuple_GET_ITEM(__pyx_args, 2); values[1] = PyTuple_GET_ITEM(__pyx_args, 1); values[0] = PyTuple_GET_ITEM(__pyx_args, 0); break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_surface = ((struct __pyx_obj_11pygame_sdl2_7surface_Surface *)values[0]); __pyx_v_color = values[1]; __pyx_v_closed = values[2]; __pyx_v_pointlist = values[3]; __pyx_v_blend = values[4]; } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("aalines", 0, 4, 5, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 103; __pyx_clineno = __LINE__; goto __pyx_L3_error;} __pyx_L3_error:; __Pyx_AddTraceback("pygame_sdl2.draw.aalines", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_surface), __pyx_ptype_11pygame_sdl2_7surface_Surface, 1, "surface", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 103; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_r = __pyx_pf_11pygame_sdl2_4draw_16aalines(__pyx_self, __pyx_v_surface, __pyx_v_color, __pyx_v_closed, __pyx_v_pointlist, __pyx_v_blend); /* function exit code */ goto __pyx_L0; __pyx_L1_error:; __pyx_r = NULL; __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11pygame_sdl2_4draw_16aalines(CYTHON_UNUSED PyObject *__pyx_self, struct __pyx_obj_11pygame_sdl2_7surface_Surface *__pyx_v_surface, PyObject *__pyx_v_color, PyObject *__pyx_v_closed, PyObject *__pyx_v_pointlist, CYTHON_UNUSED PyObject *__pyx_v_blend) { PyObject *__pyx_v_n = NULL; PyObject *__pyx_v_dirty = NULL; PyObject *__pyx_v_r = NULL; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; Py_ssize_t __pyx_t_5; PyObject *__pyx_t_6 = NULL; int __pyx_t_7; PyObject *__pyx_t_8 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("aalines", 0); /* "pygame_sdl2/draw.pyx":104 * * def aalines(Surface surface, color, closed, pointlist, blend=1): * n = 0 # <<<<<<<<<<<<<< * dirty = Rect(pointlist[0], (1,1)) * while n < len(pointlist) - 1: */ __Pyx_INCREF(__pyx_int_0); __pyx_v_n = __pyx_int_0; /* "pygame_sdl2/draw.pyx":105 * def aalines(Surface surface, color, closed, pointlist, blend=1): * n = 0 * dirty = Rect(pointlist[0], (1,1)) # <<<<<<<<<<<<<< * while n < len(pointlist) - 1: * r = aaline(surface, color, pointlist[n], pointlist[n+1]) */ __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_Rect); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 105; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = __Pyx_GetItemInt(__pyx_v_pointlist, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(__pyx_t_3 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 105; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = NULL; __pyx_t_5 = 0; if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_2))) { __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_2); if (likely(__pyx_t_4)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_4); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); __pyx_t_5 = 1; } } __pyx_t_6 = PyTuple_New(2+__pyx_t_5); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 105; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_6); if (__pyx_t_4) { __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_4); __pyx_t_4 = NULL; } __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_6, 0+__pyx_t_5, __pyx_t_3); __Pyx_INCREF(__pyx_tuple__5); __Pyx_GIVEREF(__pyx_tuple__5); PyTuple_SET_ITEM(__pyx_t_6, 1+__pyx_t_5, __pyx_tuple__5); __pyx_t_3 = 0; __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_6, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 105; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_v_dirty = __pyx_t_1; __pyx_t_1 = 0; /* "pygame_sdl2/draw.pyx":106 * n = 0 * dirty = Rect(pointlist[0], (1,1)) * while n < len(pointlist) - 1: # <<<<<<<<<<<<<< * r = aaline(surface, color, pointlist[n], pointlist[n+1]) * dirty.union_ip(r) */ while (1) { __pyx_t_5 = PyObject_Length(__pyx_v_pointlist); if (unlikely(__pyx_t_5 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 106; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_t_1 = PyInt_FromSsize_t((__pyx_t_5 - 1)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 106; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = PyObject_RichCompare(__pyx_v_n, __pyx_t_1, Py_LT); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 106; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_7 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 106; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; if (!__pyx_t_7) break; /* "pygame_sdl2/draw.pyx":107 * dirty = Rect(pointlist[0], (1,1)) * while n < len(pointlist) - 1: * r = aaline(surface, color, pointlist[n], pointlist[n+1]) # <<<<<<<<<<<<<< * dirty.union_ip(r) * n += 1 */ __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_aaline); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 107; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_t_6 = PyObject_GetItem(__pyx_v_pointlist, __pyx_v_n); if (unlikely(__pyx_t_6 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 107; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; __Pyx_GOTREF(__pyx_t_6); __pyx_t_3 = __Pyx_PyInt_AddObjC(__pyx_v_n, __pyx_int_1, 1, 0); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 107; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = PyObject_GetItem(__pyx_v_pointlist, __pyx_t_3); if (unlikely(__pyx_t_4 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 107; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_3 = NULL; __pyx_t_5 = 0; if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_1))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_1); if (likely(__pyx_t_3)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_1, function); __pyx_t_5 = 1; } } __pyx_t_8 = PyTuple_New(4+__pyx_t_5); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 107; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_8); if (__pyx_t_3) { __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_3); __pyx_t_3 = NULL; } __Pyx_INCREF(((PyObject *)__pyx_v_surface)); __Pyx_GIVEREF(((PyObject *)__pyx_v_surface)); PyTuple_SET_ITEM(__pyx_t_8, 0+__pyx_t_5, ((PyObject *)__pyx_v_surface)); __Pyx_INCREF(__pyx_v_color); __Pyx_GIVEREF(__pyx_v_color); PyTuple_SET_ITEM(__pyx_t_8, 1+__pyx_t_5, __pyx_v_color); __Pyx_GIVEREF(__pyx_t_6); PyTuple_SET_ITEM(__pyx_t_8, 2+__pyx_t_5, __pyx_t_6); __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_8, 3+__pyx_t_5, __pyx_t_4); __pyx_t_6 = 0; __pyx_t_4 = 0; __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_8, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 107; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_XDECREF_SET(__pyx_v_r, __pyx_t_2); __pyx_t_2 = 0; /* "pygame_sdl2/draw.pyx":108 * while n < len(pointlist) - 1: * r = aaline(surface, color, pointlist[n], pointlist[n+1]) * dirty.union_ip(r) # <<<<<<<<<<<<<< * n += 1 * if closed: */ __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_dirty, __pyx_n_s_union_ip); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 108; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_t_8 = NULL; if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_1))) { __pyx_t_8 = PyMethod_GET_SELF(__pyx_t_1); if (likely(__pyx_t_8)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1); __Pyx_INCREF(__pyx_t_8); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_1, function); } } if (!__pyx_t_8) { __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_1, __pyx_v_r); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 108; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); } else { __pyx_t_4 = PyTuple_New(1+1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 108; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); __Pyx_GIVEREF(__pyx_t_8); PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_8); __pyx_t_8 = NULL; __Pyx_INCREF(__pyx_v_r); __Pyx_GIVEREF(__pyx_v_r); PyTuple_SET_ITEM(__pyx_t_4, 0+1, __pyx_v_r); __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_4, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 108; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "pygame_sdl2/draw.pyx":109 * r = aaline(surface, color, pointlist[n], pointlist[n+1]) * dirty.union_ip(r) * n += 1 # <<<<<<<<<<<<<< * if closed: * aaline(surface, color, pointlist[n], pointlist[0]) */ __pyx_t_2 = __Pyx_PyInt_AddObjC(__pyx_v_n, __pyx_int_1, 1, 1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 109; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF_SET(__pyx_v_n, __pyx_t_2); __pyx_t_2 = 0; } /* "pygame_sdl2/draw.pyx":110 * dirty.union_ip(r) * n += 1 * if closed: # <<<<<<<<<<<<<< * aaline(surface, color, pointlist[n], pointlist[0]) * return dirty.clip(surface.get_rect()) */ __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_v_closed); if (unlikely(__pyx_t_7 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 110; __pyx_clineno = __LINE__; goto __pyx_L1_error;} if (__pyx_t_7) { /* "pygame_sdl2/draw.pyx":111 * n += 1 * if closed: * aaline(surface, color, pointlist[n], pointlist[0]) # <<<<<<<<<<<<<< * return dirty.clip(surface.get_rect()) */ __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_aaline); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 111; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_t_4 = PyObject_GetItem(__pyx_v_pointlist, __pyx_v_n); if (unlikely(__pyx_t_4 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 111; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; __Pyx_GOTREF(__pyx_t_4); __pyx_t_8 = __Pyx_GetItemInt(__pyx_v_pointlist, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(__pyx_t_8 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 111; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; __Pyx_GOTREF(__pyx_t_8); __pyx_t_6 = NULL; __pyx_t_5 = 0; if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_1))) { __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_1); if (likely(__pyx_t_6)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1); __Pyx_INCREF(__pyx_t_6); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_1, function); __pyx_t_5 = 1; } } __pyx_t_3 = PyTuple_New(4+__pyx_t_5); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 111; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); if (__pyx_t_6) { __Pyx_GIVEREF(__pyx_t_6); PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_6); __pyx_t_6 = NULL; } __Pyx_INCREF(((PyObject *)__pyx_v_surface)); __Pyx_GIVEREF(((PyObject *)__pyx_v_surface)); PyTuple_SET_ITEM(__pyx_t_3, 0+__pyx_t_5, ((PyObject *)__pyx_v_surface)); __Pyx_INCREF(__pyx_v_color); __Pyx_GIVEREF(__pyx_v_color); PyTuple_SET_ITEM(__pyx_t_3, 1+__pyx_t_5, __pyx_v_color); __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_3, 2+__pyx_t_5, __pyx_t_4); __Pyx_GIVEREF(__pyx_t_8); PyTuple_SET_ITEM(__pyx_t_3, 3+__pyx_t_5, __pyx_t_8); __pyx_t_4 = 0; __pyx_t_8 = 0; __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_3, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 111; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "pygame_sdl2/draw.pyx":110 * dirty.union_ip(r) * n += 1 * if closed: # <<<<<<<<<<<<<< * aaline(surface, color, pointlist[n], pointlist[0]) * return dirty.clip(surface.get_rect()) */ } /* "pygame_sdl2/draw.pyx":112 * if closed: * aaline(surface, color, pointlist[n], pointlist[0]) * return dirty.clip(surface.get_rect()) # <<<<<<<<<<<<<< */ __Pyx_XDECREF(__pyx_r); __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_dirty, __pyx_n_s_clip); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 112; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_t_8 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_surface), __pyx_n_s_get_rect); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 112; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_8); __pyx_t_4 = NULL; if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_8))) { __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_8); if (likely(__pyx_t_4)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_8); __Pyx_INCREF(__pyx_t_4); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_8, function); } } if (__pyx_t_4) { __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_t_8, __pyx_t_4); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 112; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; } else { __pyx_t_3 = __Pyx_PyObject_CallNoArg(__pyx_t_8); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 112; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; __pyx_t_8 = NULL; if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_1))) { __pyx_t_8 = PyMethod_GET_SELF(__pyx_t_1); if (likely(__pyx_t_8)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1); __Pyx_INCREF(__pyx_t_8); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_1, function); } } if (!__pyx_t_8) { __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_1, __pyx_t_3); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 112; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_GOTREF(__pyx_t_2); } else { __pyx_t_4 = PyTuple_New(1+1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 112; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); __Pyx_GIVEREF(__pyx_t_8); PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_8); __pyx_t_8 = NULL; __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_4, 0+1, __pyx_t_3); __pyx_t_3 = 0; __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_4, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 112; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; /* "pygame_sdl2/draw.pyx":103 * return dirty.clip(surface.get_rect()) * * def aalines(Surface surface, color, closed, pointlist, blend=1): # <<<<<<<<<<<<<< * n = 0 * dirty = Rect(pointlist[0], (1,1)) */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_6); __Pyx_XDECREF(__pyx_t_8); __Pyx_AddTraceback("pygame_sdl2.draw.aalines", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF(__pyx_v_n); __Pyx_XDECREF(__pyx_v_dirty); __Pyx_XDECREF(__pyx_v_r); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyMethodDef __pyx_methods[] = { {0, 0, 0, 0} }; #if PY_MAJOR_VERSION >= 3 static struct PyModuleDef __pyx_moduledef = { #if PY_VERSION_HEX < 0x03020000 { PyObject_HEAD_INIT(NULL) NULL, 0, NULL }, #else PyModuleDef_HEAD_INIT, #endif "draw", 0, /* m_doc */ -1, /* m_size */ __pyx_methods /* m_methods */, NULL, /* m_reload */ NULL, /* m_traverse */ NULL, /* m_clear */ NULL /* m_free */ }; #endif static __Pyx_StringTabEntry __pyx_string_tab[] = { {&__pyx_kp_s_Not_implemented, __pyx_k_Not_implemented, sizeof(__pyx_k_Not_implemented), 0, 0, 1, 0}, {&__pyx_n_s_Rect, __pyx_k_Rect, sizeof(__pyx_k_Rect), 0, 0, 1, 1}, {&__pyx_n_s__6, __pyx_k__6, sizeof(__pyx_k__6), 0, 0, 1, 1}, {&__pyx_n_s_aaline, __pyx_k_aaline, sizeof(__pyx_k_aaline), 0, 0, 1, 1}, {&__pyx_n_s_aalines, __pyx_k_aalines, sizeof(__pyx_k_aalines), 0, 0, 1, 1}, {&__pyx_n_s_arc, __pyx_k_arc, sizeof(__pyx_k_arc), 0, 0, 1, 1}, {&__pyx_n_s_blend, __pyx_k_blend, sizeof(__pyx_k_blend), 0, 0, 1, 1}, {&__pyx_n_s_box, __pyx_k_box, sizeof(__pyx_k_box), 0, 0, 1, 1}, {&__pyx_n_s_circle, __pyx_k_circle, sizeof(__pyx_k_circle), 0, 0, 1, 1}, {&__pyx_n_s_clip, __pyx_k_clip, sizeof(__pyx_k_clip), 0, 0, 1, 1}, {&__pyx_n_s_closed, __pyx_k_closed, sizeof(__pyx_k_closed), 0, 0, 1, 1}, {&__pyx_n_s_color, __pyx_k_color, sizeof(__pyx_k_color), 0, 0, 1, 1}, {&__pyx_n_s_dirty, __pyx_k_dirty, sizeof(__pyx_k_dirty), 0, 0, 1, 1}, {&__pyx_n_s_ellipse, __pyx_k_ellipse, sizeof(__pyx_k_ellipse), 0, 0, 1, 1}, {&__pyx_n_s_end_pos, __pyx_k_end_pos, sizeof(__pyx_k_end_pos), 0, 0, 1, 1}, {&__pyx_n_s_endpos, __pyx_k_endpos, sizeof(__pyx_k_endpos), 0, 0, 1, 1}, {&__pyx_n_s_error, __pyx_k_error, sizeof(__pyx_k_error), 0, 0, 1, 1}, {&__pyx_n_s_filled_circle, __pyx_k_filled_circle, sizeof(__pyx_k_filled_circle), 0, 0, 1, 1}, {&__pyx_n_s_filled_polygon, __pyx_k_filled_polygon, sizeof(__pyx_k_filled_polygon), 0, 0, 1, 1}, {&__pyx_n_s_get_rect, __pyx_k_get_rect, sizeof(__pyx_k_get_rect), 0, 0, 1, 1}, {&__pyx_n_s_gfxdraw, __pyx_k_gfxdraw, sizeof(__pyx_k_gfxdraw), 0, 0, 1, 1}, {&__pyx_n_s_h, __pyx_k_h, sizeof(__pyx_k_h), 0, 0, 1, 1}, {&__pyx_kp_s_home_tom_ab_pygame_sdl2_src_pyg, __pyx_k_home_tom_ab_pygame_sdl2_src_pyg, sizeof(__pyx_k_home_tom_ab_pygame_sdl2_src_pyg), 0, 0, 1, 0}, {&__pyx_n_s_import, __pyx_k_import, sizeof(__pyx_k_import), 0, 0, 1, 1}, {&__pyx_n_s_line, __pyx_k_line, sizeof(__pyx_k_line), 0, 0, 1, 1}, {&__pyx_n_s_lines, __pyx_k_lines, sizeof(__pyx_k_lines), 0, 0, 1, 1}, {&__pyx_n_s_main, __pyx_k_main, sizeof(__pyx_k_main), 0, 0, 1, 1}, {&__pyx_n_s_n, __pyx_k_n, sizeof(__pyx_k_n), 0, 0, 1, 1}, {&__pyx_n_s_pointlist, __pyx_k_pointlist, sizeof(__pyx_k_pointlist), 0, 0, 1, 1}, {&__pyx_n_s_polygon, __pyx_k_polygon, sizeof(__pyx_k_polygon), 0, 0, 1, 1}, {&__pyx_n_s_pos, __pyx_k_pos, sizeof(__pyx_k_pos), 0, 0, 1, 1}, {&__pyx_n_s_pygame_sdl2_draw, __pyx_k_pygame_sdl2_draw, sizeof(__pyx_k_pygame_sdl2_draw), 0, 0, 1, 1}, {&__pyx_n_s_pygame_sdl2_error, __pyx_k_pygame_sdl2_error, sizeof(__pyx_k_pygame_sdl2_error), 0, 0, 1, 1}, {&__pyx_n_s_pygame_sdl2_gfxdraw, __pyx_k_pygame_sdl2_gfxdraw, sizeof(__pyx_k_pygame_sdl2_gfxdraw), 0, 0, 1, 1}, {&__pyx_n_s_pygame_sdl2_rect, __pyx_k_pygame_sdl2_rect, sizeof(__pyx_k_pygame_sdl2_rect), 0, 0, 1, 1}, {&__pyx_n_s_pyx_vtable, __pyx_k_pyx_vtable, sizeof(__pyx_k_pyx_vtable), 0, 0, 1, 1}, {&__pyx_n_s_r, __pyx_k_r, sizeof(__pyx_k_r), 0, 0, 1, 1}, {&__pyx_n_s_radius, __pyx_k_radius, sizeof(__pyx_k_radius), 0, 0, 1, 1}, {&__pyx_n_s_rect, __pyx_k_rect, sizeof(__pyx_k_rect), 0, 0, 1, 1}, {&__pyx_n_s_rectangle, __pyx_k_rectangle, sizeof(__pyx_k_rectangle), 0, 0, 1, 1}, {&__pyx_n_s_start_angle, __pyx_k_start_angle, sizeof(__pyx_k_start_angle), 0, 0, 1, 1}, {&__pyx_n_s_start_pos, __pyx_k_start_pos, sizeof(__pyx_k_start_pos), 0, 0, 1, 1}, {&__pyx_n_s_startpos, __pyx_k_startpos, sizeof(__pyx_k_startpos), 0, 0, 1, 1}, {&__pyx_n_s_stop_angle, __pyx_k_stop_angle, sizeof(__pyx_k_stop_angle), 0, 0, 1, 1}, {&__pyx_n_s_surface, __pyx_k_surface, sizeof(__pyx_k_surface), 0, 0, 1, 1}, {&__pyx_n_s_test, __pyx_k_test, sizeof(__pyx_k_test), 0, 0, 1, 1}, {&__pyx_n_s_thick_line, __pyx_k_thick_line, sizeof(__pyx_k_thick_line), 0, 0, 1, 1}, {&__pyx_n_s_union_ip, __pyx_k_union_ip, sizeof(__pyx_k_union_ip), 0, 0, 1, 1}, {&__pyx_n_s_w, __pyx_k_w, sizeof(__pyx_k_w), 0, 0, 1, 1}, {&__pyx_n_s_width, __pyx_k_width, sizeof(__pyx_k_width), 0, 0, 1, 1}, {&__pyx_n_s_x, __pyx_k_x, sizeof(__pyx_k_x), 0, 0, 1, 1}, {&__pyx_n_s_x1, __pyx_k_x1, sizeof(__pyx_k_x1), 0, 0, 1, 1}, {&__pyx_n_s_x2, __pyx_k_x2, sizeof(__pyx_k_x2), 0, 0, 1, 1}, {&__pyx_n_s_y, __pyx_k_y, sizeof(__pyx_k_y), 0, 0, 1, 1}, {&__pyx_n_s_y1, __pyx_k_y1, sizeof(__pyx_k_y1), 0, 0, 1, 1}, {&__pyx_n_s_y2, __pyx_k_y2, sizeof(__pyx_k_y2), 0, 0, 1, 1}, {0, 0, 0, 0, 0, 0, 0} }; static int __Pyx_InitCachedBuiltins(void) { return 0; } static int __Pyx_InitCachedConstants(void) { __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__Pyx_InitCachedConstants", 0); /* "pygame_sdl2/draw.pyx":47 * if width == 0: * gfxdraw.filled_polygon(surface, pointlist, color) * dirty = Rect(pointlist[0], (1, 1)) # <<<<<<<<<<<<<< * n = 1 * while n < len(pointlist): */ __pyx_tuple_ = PyTuple_Pack(2, __pyx_int_1, __pyx_int_1); if (unlikely(!__pyx_tuple_)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 47; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_tuple_); __Pyx_GIVEREF(__pyx_tuple_); /* "pygame_sdl2/draw.pyx":50 * n = 1 * while n < len(pointlist): * dirty.union_ip(Rect(pointlist[n], (1,1))) # <<<<<<<<<<<<<< * n += 1 * return dirty.clip(surface.get_rect()) */ __pyx_tuple__2 = PyTuple_Pack(2, __pyx_int_1, __pyx_int_1); if (unlikely(!__pyx_tuple__2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 50; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_tuple__2); __Pyx_GIVEREF(__pyx_tuple__2); /* "pygame_sdl2/draw.pyx":73 * * def ellipse(Surface surface, color, rect, width=0): * raise error("Not implemented.") # <<<<<<<<<<<<<< * * def arc(Surface surface, color, rect, start_angle, stop_angle, width=1): */ __pyx_tuple__3 = PyTuple_Pack(1, __pyx_kp_s_Not_implemented); if (unlikely(!__pyx_tuple__3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 73; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_tuple__3); __Pyx_GIVEREF(__pyx_tuple__3); /* "pygame_sdl2/draw.pyx":76 * * def arc(Surface surface, color, rect, start_angle, stop_angle, width=1): * raise error("Not implemented.") # <<<<<<<<<<<<<< * * def line(Surface surface, color, start_pos, end_pos, width=1): */ __pyx_tuple__4 = PyTuple_Pack(1, __pyx_kp_s_Not_implemented); if (unlikely(!__pyx_tuple__4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 76; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_tuple__4); __Pyx_GIVEREF(__pyx_tuple__4); /* "pygame_sdl2/draw.pyx":105 * def aalines(Surface surface, color, closed, pointlist, blend=1): * n = 0 * dirty = Rect(pointlist[0], (1,1)) # <<<<<<<<<<<<<< * while n < len(pointlist) - 1: * r = aaline(surface, color, pointlist[n], pointlist[n+1]) */ __pyx_tuple__5 = PyTuple_Pack(2, __pyx_int_1, __pyx_int_1); if (unlikely(!__pyx_tuple__5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 105; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_tuple__5); __Pyx_GIVEREF(__pyx_tuple__5); /* "pygame_sdl2/draw.pyx":26 * from pygame_sdl2.error import error * * def rect(Surface surface, color, rect, width=0): # <<<<<<<<<<<<<< * if not isinstance(rect, Rect): * rect = Rect(rect) */ __pyx_tuple__7 = PyTuple_Pack(7, __pyx_n_s_surface, __pyx_n_s_color, __pyx_n_s_rect, __pyx_n_s_width, __pyx_n_s_n, __pyx_n_s_r, __pyx_n_s_dirty); if (unlikely(!__pyx_tuple__7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 26; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_tuple__7); __Pyx_GIVEREF(__pyx_tuple__7); __pyx_codeobj__8 = (PyObject*)__Pyx_PyCode_New(4, 0, 7, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__7, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_tom_ab_pygame_sdl2_src_pyg, __pyx_n_s_rect, 26, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 26; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "pygame_sdl2/draw.pyx":44 * return dirty.clip(surface.get_rect()) * * def polygon(Surface surface, color, pointlist, width=0): # <<<<<<<<<<<<<< * if width == 0: * gfxdraw.filled_polygon(surface, pointlist, color) */ __pyx_tuple__9 = PyTuple_Pack(6, __pyx_n_s_surface, __pyx_n_s_color, __pyx_n_s_pointlist, __pyx_n_s_width, __pyx_n_s_dirty, __pyx_n_s_n); if (unlikely(!__pyx_tuple__9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 44; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_tuple__9); __Pyx_GIVEREF(__pyx_tuple__9); __pyx_codeobj__10 = (PyObject*)__Pyx_PyCode_New(4, 0, 6, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__9, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_tom_ab_pygame_sdl2_src_pyg, __pyx_n_s_polygon, 44, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 44; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "pygame_sdl2/draw.pyx":56 * return lines(surface, color, True, pointlist, width) * * def circle(Surface surface, color, pos, radius, width=0): # <<<<<<<<<<<<<< * x, y = pos * if width == 0: */ __pyx_tuple__11 = PyTuple_Pack(9, __pyx_n_s_surface, __pyx_n_s_color, __pyx_n_s_pos, __pyx_n_s_radius, __pyx_n_s_width, __pyx_n_s_x, __pyx_n_s_y, __pyx_n_s_dirty, __pyx_n_s_n); if (unlikely(!__pyx_tuple__11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 56; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_tuple__11); __Pyx_GIVEREF(__pyx_tuple__11); __pyx_codeobj__12 = (PyObject*)__Pyx_PyCode_New(5, 0, 9, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__11, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_tom_ab_pygame_sdl2_src_pyg, __pyx_n_s_circle, 56, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__12)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 56; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "pygame_sdl2/draw.pyx":72 * return dirty.clip(surface.get_rect()) * * def ellipse(Surface surface, color, rect, width=0): # <<<<<<<<<<<<<< * raise error("Not implemented.") * */ __pyx_tuple__13 = PyTuple_Pack(4, __pyx_n_s_surface, __pyx_n_s_color, __pyx_n_s_rect, __pyx_n_s_width); if (unlikely(!__pyx_tuple__13)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 72; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_tuple__13); __Pyx_GIVEREF(__pyx_tuple__13); __pyx_codeobj__14 = (PyObject*)__Pyx_PyCode_New(4, 0, 4, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__13, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_tom_ab_pygame_sdl2_src_pyg, __pyx_n_s_ellipse, 72, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__14)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 72; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "pygame_sdl2/draw.pyx":75 * raise error("Not implemented.") * * def arc(Surface surface, color, rect, start_angle, stop_angle, width=1): # <<<<<<<<<<<<<< * raise error("Not implemented.") * */ __pyx_tuple__15 = PyTuple_Pack(6, __pyx_n_s_surface, __pyx_n_s_color, __pyx_n_s_rect, __pyx_n_s_start_angle, __pyx_n_s_stop_angle, __pyx_n_s_width); if (unlikely(!__pyx_tuple__15)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 75; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_tuple__15); __Pyx_GIVEREF(__pyx_tuple__15); __pyx_codeobj__16 = (PyObject*)__Pyx_PyCode_New(6, 0, 6, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__15, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_tom_ab_pygame_sdl2_src_pyg, __pyx_n_s_arc, 75, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__16)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 75; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "pygame_sdl2/draw.pyx":78 * raise error("Not implemented.") * * def line(Surface surface, color, start_pos, end_pos, width=1): # <<<<<<<<<<<<<< * gfxdraw.thick_line(surface, start_pos[0], start_pos[1], * end_pos[0], end_pos[1], width, color) */ __pyx_tuple__17 = PyTuple_Pack(6, __pyx_n_s_surface, __pyx_n_s_color, __pyx_n_s_start_pos, __pyx_n_s_end_pos, __pyx_n_s_width, __pyx_n_s_dirty); if (unlikely(!__pyx_tuple__17)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 78; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_tuple__17); __Pyx_GIVEREF(__pyx_tuple__17); __pyx_codeobj__18 = (PyObject*)__Pyx_PyCode_New(5, 0, 6, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__17, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_tom_ab_pygame_sdl2_src_pyg, __pyx_n_s_line, 78, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__18)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 78; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "pygame_sdl2/draw.pyx":85 * return dirty.clip(surface.get_rect()) * * def lines(Surface surface, color, closed, pointlist, width=1): # <<<<<<<<<<<<<< * n = 0 * dirty = Rect(pointlist[0], (width, width)) */ __pyx_tuple__19 = PyTuple_Pack(7, __pyx_n_s_surface, __pyx_n_s_color, __pyx_n_s_closed, __pyx_n_s_pointlist, __pyx_n_s_width, __pyx_n_s_n, __pyx_n_s_dirty); if (unlikely(!__pyx_tuple__19)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 85; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_tuple__19); __Pyx_GIVEREF(__pyx_tuple__19); __pyx_codeobj__20 = (PyObject*)__Pyx_PyCode_New(5, 0, 7, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__19, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_tom_ab_pygame_sdl2_src_pyg, __pyx_n_s_lines, 85, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__20)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 85; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "pygame_sdl2/draw.pyx":96 * return dirty.clip(surface.get_rect()) * * def aaline(Surface surface, color, startpos, endpos, blend=1): # <<<<<<<<<<<<<< * x1, y1 = startpos * x2, y2 = endpos */ __pyx_tuple__21 = PyTuple_Pack(10, __pyx_n_s_surface, __pyx_n_s_color, __pyx_n_s_startpos, __pyx_n_s_endpos, __pyx_n_s_blend, __pyx_n_s_x1, __pyx_n_s_y1, __pyx_n_s_x2, __pyx_n_s_y2, __pyx_n_s_dirty); if (unlikely(!__pyx_tuple__21)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 96; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_tuple__21); __Pyx_GIVEREF(__pyx_tuple__21); __pyx_codeobj__22 = (PyObject*)__Pyx_PyCode_New(5, 0, 10, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__21, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_tom_ab_pygame_sdl2_src_pyg, __pyx_n_s_aaline, 96, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__22)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 96; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "pygame_sdl2/draw.pyx":103 * return dirty.clip(surface.get_rect()) * * def aalines(Surface surface, color, closed, pointlist, blend=1): # <<<<<<<<<<<<<< * n = 0 * dirty = Rect(pointlist[0], (1,1)) */ __pyx_tuple__23 = PyTuple_Pack(8, __pyx_n_s_surface, __pyx_n_s_color, __pyx_n_s_closed, __pyx_n_s_pointlist, __pyx_n_s_blend, __pyx_n_s_n, __pyx_n_s_dirty, __pyx_n_s_r); if (unlikely(!__pyx_tuple__23)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 103; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_tuple__23); __Pyx_GIVEREF(__pyx_tuple__23); __pyx_codeobj__24 = (PyObject*)__Pyx_PyCode_New(5, 0, 8, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__23, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_tom_ab_pygame_sdl2_src_pyg, __pyx_n_s_aalines, 103, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__24)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 103; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_RefNannyFinishContext(); return 0; __pyx_L1_error:; __Pyx_RefNannyFinishContext(); return -1; } static int __Pyx_InitGlobals(void) { if (__Pyx_InitStrings(__pyx_string_tab) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; __pyx_int_0 = PyInt_FromLong(0); if (unlikely(!__pyx_int_0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_int_1 = PyInt_FromLong(1); if (unlikely(!__pyx_int_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_int_2 = PyInt_FromLong(2); if (unlikely(!__pyx_int_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} return 0; __pyx_L1_error:; return -1; } #if PY_MAJOR_VERSION < 3 PyMODINIT_FUNC initdraw(void); /*proto*/ PyMODINIT_FUNC initdraw(void) #else PyMODINIT_FUNC PyInit_draw(void); /*proto*/ PyMODINIT_FUNC PyInit_draw(void) #endif { PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannyDeclarations #if CYTHON_REFNANNY __Pyx_RefNanny = __Pyx_RefNannyImportAPI("refnanny"); if (!__Pyx_RefNanny) { PyErr_Clear(); __Pyx_RefNanny = __Pyx_RefNannyImportAPI("Cython.Runtime.refnanny"); if (!__Pyx_RefNanny) Py_FatalError("failed to import 'refnanny' module"); } #endif __Pyx_RefNannySetupContext("PyMODINIT_FUNC PyInit_draw(void)", 0); if (__Pyx_check_binary_version() < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_empty_tuple = PyTuple_New(0); if (unlikely(!__pyx_empty_tuple)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_empty_bytes = PyBytes_FromStringAndSize("", 0); if (unlikely(!__pyx_empty_bytes)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} #ifdef __Pyx_CyFunction_USED if (__pyx_CyFunction_init() < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} #endif #ifdef __Pyx_FusedFunction_USED if (__pyx_FusedFunction_init() < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} #endif #ifdef __Pyx_Coroutine_USED if (__pyx_Coroutine_init() < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} #endif #ifdef __Pyx_Generator_USED if (__pyx_Generator_init() < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} #endif #ifdef __Pyx_StopAsyncIteration_USED if (__pyx_StopAsyncIteration_init() < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} #endif /*--- Library function declarations ---*/ /*--- Threads initialization code ---*/ #if defined(__PYX_FORCE_INIT_THREADS) && __PYX_FORCE_INIT_THREADS #ifdef WITH_THREAD /* Python build with threading support? */ PyEval_InitThreads(); #endif #endif /*--- Module creation code ---*/ #if PY_MAJOR_VERSION < 3 __pyx_m = Py_InitModule4("draw", __pyx_methods, 0, 0, PYTHON_API_VERSION); Py_XINCREF(__pyx_m); #else __pyx_m = PyModule_Create(&__pyx_moduledef); #endif if (unlikely(!__pyx_m)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_d = PyModule_GetDict(__pyx_m); if (unlikely(!__pyx_d)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} Py_INCREF(__pyx_d); __pyx_b = PyImport_AddModule(__Pyx_BUILTIN_MODULE_NAME); if (unlikely(!__pyx_b)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} #if CYTHON_COMPILING_IN_PYPY Py_INCREF(__pyx_b); #endif if (PyObject_SetAttrString(__pyx_m, "__builtins__", __pyx_b) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; /*--- Initialize various global constants etc. ---*/ if (__Pyx_InitGlobals() < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} #if PY_MAJOR_VERSION < 3 && (__PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT) if (__Pyx_init_sys_getdefaultencoding_params() < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} #endif if (__pyx_module_is_main_pygame_sdl2__draw) { if (PyObject_SetAttrString(__pyx_m, "__name__", __pyx_n_s_main) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } #if PY_MAJOR_VERSION >= 3 { PyObject *modules = PyImport_GetModuleDict(); if (unlikely(!modules)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} if (!PyDict_GetItemString(modules, "pygame_sdl2.draw")) { if (unlikely(PyDict_SetItemString(modules, "pygame_sdl2.draw", __pyx_m) < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } } #endif /*--- Builtin init code ---*/ if (__Pyx_InitCachedBuiltins() < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /*--- Constants init code ---*/ if (__Pyx_InitCachedConstants() < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /*--- Global init code ---*/ /*--- Variable export code ---*/ /*--- Function export code ---*/ /*--- Type init code ---*/ /*--- Type import code ---*/ __pyx_ptype_11pygame_sdl2_7surface_Surface = __Pyx_ImportType("pygame_sdl2.surface", "Surface", sizeof(struct __pyx_obj_11pygame_sdl2_7surface_Surface), 1); if (unlikely(!__pyx_ptype_11pygame_sdl2_7surface_Surface)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 23; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_vtabptr_11pygame_sdl2_7surface_Surface = (struct __pyx_vtabstruct_11pygame_sdl2_7surface_Surface*)__Pyx_GetVtable(__pyx_ptype_11pygame_sdl2_7surface_Surface->tp_dict); if (unlikely(!__pyx_vtabptr_11pygame_sdl2_7surface_Surface)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 23; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /*--- Variable import code ---*/ /*--- Function import code ---*/ /*--- Execution code ---*/ #if defined(__Pyx_Generator_USED) || defined(__Pyx_Coroutine_USED) if (__Pyx_patch_abc() < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} #endif /* "pygame_sdl2/draw.pyx":22 * from pygame_sdl2.surface cimport Surface * * import pygame_sdl2.gfxdraw as gfxdraw # <<<<<<<<<<<<<< * from pygame_sdl2.rect import Rect * from pygame_sdl2.error import error */ __pyx_t_1 = PyList_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 22; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __Pyx_INCREF(__pyx_n_s__6); __Pyx_GIVEREF(__pyx_n_s__6); PyList_SET_ITEM(__pyx_t_1, 0, __pyx_n_s__6); __pyx_t_2 = __Pyx_Import(__pyx_n_s_pygame_sdl2_gfxdraw, __pyx_t_1, -1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 22; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (PyDict_SetItem(__pyx_d, __pyx_n_s_gfxdraw, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 22; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "pygame_sdl2/draw.pyx":23 * * import pygame_sdl2.gfxdraw as gfxdraw * from pygame_sdl2.rect import Rect # <<<<<<<<<<<<<< * from pygame_sdl2.error import error * */ __pyx_t_2 = PyList_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 23; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __Pyx_INCREF(__pyx_n_s_Rect); __Pyx_GIVEREF(__pyx_n_s_Rect); PyList_SET_ITEM(__pyx_t_2, 0, __pyx_n_s_Rect); __pyx_t_1 = __Pyx_Import(__pyx_n_s_pygame_sdl2_rect, __pyx_t_2, -1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 23; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_2 = __Pyx_ImportFrom(__pyx_t_1, __pyx_n_s_Rect); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 23; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_Rect, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 23; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "pygame_sdl2/draw.pyx":24 * import pygame_sdl2.gfxdraw as gfxdraw * from pygame_sdl2.rect import Rect * from pygame_sdl2.error import error # <<<<<<<<<<<<<< * * def rect(Surface surface, color, rect, width=0): */ __pyx_t_1 = PyList_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 24; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __Pyx_INCREF(__pyx_n_s_error); __Pyx_GIVEREF(__pyx_n_s_error); PyList_SET_ITEM(__pyx_t_1, 0, __pyx_n_s_error); __pyx_t_2 = __Pyx_Import(__pyx_n_s_pygame_sdl2_error, __pyx_t_1, -1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 24; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_1 = __Pyx_ImportFrom(__pyx_t_2, __pyx_n_s_error); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 24; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); if (PyDict_SetItem(__pyx_d, __pyx_n_s_error, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 24; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "pygame_sdl2/draw.pyx":26 * from pygame_sdl2.error import error * * def rect(Surface surface, color, rect, width=0): # <<<<<<<<<<<<<< * if not isinstance(rect, Rect): * rect = Rect(rect) */ __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_11pygame_sdl2_4draw_1rect, NULL, __pyx_n_s_pygame_sdl2_draw); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 26; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_rect, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 26; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "pygame_sdl2/draw.pyx":44 * return dirty.clip(surface.get_rect()) * * def polygon(Surface surface, color, pointlist, width=0): # <<<<<<<<<<<<<< * if width == 0: * gfxdraw.filled_polygon(surface, pointlist, color) */ __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_11pygame_sdl2_4draw_3polygon, NULL, __pyx_n_s_pygame_sdl2_draw); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 44; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_polygon, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 44; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "pygame_sdl2/draw.pyx":56 * return lines(surface, color, True, pointlist, width) * * def circle(Surface surface, color, pos, radius, width=0): # <<<<<<<<<<<<<< * x, y = pos * if width == 0: */ __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_11pygame_sdl2_4draw_5circle, NULL, __pyx_n_s_pygame_sdl2_draw); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 56; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_circle, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 56; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "pygame_sdl2/draw.pyx":72 * return dirty.clip(surface.get_rect()) * * def ellipse(Surface surface, color, rect, width=0): # <<<<<<<<<<<<<< * raise error("Not implemented.") * */ __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_11pygame_sdl2_4draw_7ellipse, NULL, __pyx_n_s_pygame_sdl2_draw); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 72; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_ellipse, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 72; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "pygame_sdl2/draw.pyx":75 * raise error("Not implemented.") * * def arc(Surface surface, color, rect, start_angle, stop_angle, width=1): # <<<<<<<<<<<<<< * raise error("Not implemented.") * */ __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_11pygame_sdl2_4draw_9arc, NULL, __pyx_n_s_pygame_sdl2_draw); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 75; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_arc, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 75; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "pygame_sdl2/draw.pyx":78 * raise error("Not implemented.") * * def line(Surface surface, color, start_pos, end_pos, width=1): # <<<<<<<<<<<<<< * gfxdraw.thick_line(surface, start_pos[0], start_pos[1], * end_pos[0], end_pos[1], width, color) */ __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_11pygame_sdl2_4draw_11line, NULL, __pyx_n_s_pygame_sdl2_draw); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 78; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_line, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 78; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "pygame_sdl2/draw.pyx":85 * return dirty.clip(surface.get_rect()) * * def lines(Surface surface, color, closed, pointlist, width=1): # <<<<<<<<<<<<<< * n = 0 * dirty = Rect(pointlist[0], (width, width)) */ __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_11pygame_sdl2_4draw_13lines, NULL, __pyx_n_s_pygame_sdl2_draw); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 85; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_lines, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 85; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "pygame_sdl2/draw.pyx":96 * return dirty.clip(surface.get_rect()) * * def aaline(Surface surface, color, startpos, endpos, blend=1): # <<<<<<<<<<<<<< * x1, y1 = startpos * x2, y2 = endpos */ __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_11pygame_sdl2_4draw_15aaline, NULL, __pyx_n_s_pygame_sdl2_draw); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 96; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_aaline, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 96; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "pygame_sdl2/draw.pyx":103 * return dirty.clip(surface.get_rect()) * * def aalines(Surface surface, color, closed, pointlist, blend=1): # <<<<<<<<<<<<<< * n = 0 * dirty = Rect(pointlist[0], (1,1)) */ __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_11pygame_sdl2_4draw_17aalines, NULL, __pyx_n_s_pygame_sdl2_draw); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 103; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_aalines, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 103; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "pygame_sdl2/draw.pyx":1 * # Copyright 2014 Patrick Dawson # <<<<<<<<<<<<<< * # * # This software is provided 'as-is', without any express or implied */ __pyx_t_2 = PyDict_New(); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_test, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /*--- Wrapped vars code ---*/ goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); if (__pyx_m) { if (__pyx_d) { __Pyx_AddTraceback("init pygame_sdl2.draw", __pyx_clineno, __pyx_lineno, __pyx_filename); } Py_DECREF(__pyx_m); __pyx_m = 0; } else if (!PyErr_Occurred()) { PyErr_SetString(PyExc_ImportError, "init pygame_sdl2.draw"); } __pyx_L0:; __Pyx_RefNannyFinishContext(); #if PY_MAJOR_VERSION < 3 return; #else return __pyx_m; #endif } /* --- Runtime support code --- */ #if CYTHON_REFNANNY static __Pyx_RefNannyAPIStruct *__Pyx_RefNannyImportAPI(const char *modname) { PyObject *m = NULL, *p = NULL; void *r = NULL; m = PyImport_ImportModule((char *)modname); if (!m) goto end; p = PyObject_GetAttrString(m, (char *)"RefNannyAPI"); if (!p) goto end; r = PyLong_AsVoidPtr(p); end: Py_XDECREF(p); Py_XDECREF(m); return (__Pyx_RefNannyAPIStruct *)r; } #endif static void __Pyx_RaiseArgtupleInvalid( const char* func_name, int exact, Py_ssize_t num_min, Py_ssize_t num_max, Py_ssize_t num_found) { Py_ssize_t num_expected; const char *more_or_less; if (num_found < num_min) { num_expected = num_min; more_or_less = "at least"; } else { num_expected = num_max; more_or_less = "at most"; } if (exact) { more_or_less = "exactly"; } PyErr_Format(PyExc_TypeError, "%.200s() takes %.8s %" CYTHON_FORMAT_SSIZE_T "d positional argument%.1s (%" CYTHON_FORMAT_SSIZE_T "d given)", func_name, more_or_less, num_expected, (num_expected == 1) ? "" : "s", num_found); } static void __Pyx_RaiseDoubleKeywordsError( const char* func_name, PyObject* kw_name) { PyErr_Format(PyExc_TypeError, #if PY_MAJOR_VERSION >= 3 "%s() got multiple values for keyword argument '%U'", func_name, kw_name); #else "%s() got multiple values for keyword argument '%s'", func_name, PyString_AsString(kw_name)); #endif } static int __Pyx_ParseOptionalKeywords( PyObject *kwds, PyObject **argnames[], PyObject *kwds2, PyObject *values[], Py_ssize_t num_pos_args, const char* function_name) { PyObject *key = 0, *value = 0; Py_ssize_t pos = 0; PyObject*** name; PyObject*** first_kw_arg = argnames + num_pos_args; while (PyDict_Next(kwds, &pos, &key, &value)) { name = first_kw_arg; while (*name && (**name != key)) name++; if (*name) { values[name-argnames] = value; continue; } name = first_kw_arg; #if PY_MAJOR_VERSION < 3 if (likely(PyString_CheckExact(key)) || likely(PyString_Check(key))) { while (*name) { if ((CYTHON_COMPILING_IN_PYPY || PyString_GET_SIZE(**name) == PyString_GET_SIZE(key)) && _PyString_Eq(**name, key)) { values[name-argnames] = value; break; } name++; } if (*name) continue; else { PyObject*** argname = argnames; while (argname != first_kw_arg) { if ((**argname == key) || ( (CYTHON_COMPILING_IN_PYPY || PyString_GET_SIZE(**argname) == PyString_GET_SIZE(key)) && _PyString_Eq(**argname, key))) { goto arg_passed_twice; } argname++; } } } else #endif if (likely(PyUnicode_Check(key))) { while (*name) { int cmp = (**name == key) ? 0 : #if !CYTHON_COMPILING_IN_PYPY && PY_MAJOR_VERSION >= 3 (PyUnicode_GET_SIZE(**name) != PyUnicode_GET_SIZE(key)) ? 1 : #endif PyUnicode_Compare(**name, key); if (cmp < 0 && unlikely(PyErr_Occurred())) goto bad; if (cmp == 0) { values[name-argnames] = value; break; } name++; } if (*name) continue; else { PyObject*** argname = argnames; while (argname != first_kw_arg) { int cmp = (**argname == key) ? 0 : #if !CYTHON_COMPILING_IN_PYPY && PY_MAJOR_VERSION >= 3 (PyUnicode_GET_SIZE(**argname) != PyUnicode_GET_SIZE(key)) ? 1 : #endif PyUnicode_Compare(**argname, key); if (cmp < 0 && unlikely(PyErr_Occurred())) goto bad; if (cmp == 0) goto arg_passed_twice; argname++; } } } else goto invalid_keyword_type; if (kwds2) { if (unlikely(PyDict_SetItem(kwds2, key, value))) goto bad; } else { goto invalid_keyword; } } return 0; arg_passed_twice: __Pyx_RaiseDoubleKeywordsError(function_name, key); goto bad; invalid_keyword_type: PyErr_Format(PyExc_TypeError, "%.200s() keywords must be strings", function_name); goto bad; invalid_keyword: PyErr_Format(PyExc_TypeError, #if PY_MAJOR_VERSION < 3 "%.200s() got an unexpected keyword argument '%.200s'", function_name, PyString_AsString(key)); #else "%s() got an unexpected keyword argument '%U'", function_name, key); #endif bad: return -1; } static void __Pyx_RaiseArgumentTypeInvalid(const char* name, PyObject *obj, PyTypeObject *type) { PyErr_Format(PyExc_TypeError, "Argument '%.200s' has incorrect type (expected %.200s, got %.200s)", name, type->tp_name, Py_TYPE(obj)->tp_name); } static CYTHON_INLINE int __Pyx_ArgTypeTest(PyObject *obj, PyTypeObject *type, int none_allowed, const char *name, int exact) { if (unlikely(!type)) { PyErr_SetString(PyExc_SystemError, "Missing type object"); return 0; } if (none_allowed && obj == Py_None) return 1; else if (exact) { if (likely(Py_TYPE(obj) == type)) return 1; #if PY_MAJOR_VERSION == 2 else if ((type == &PyBaseString_Type) && likely(__Pyx_PyBaseString_CheckExact(obj))) return 1; #endif } else { if (likely(PyObject_TypeCheck(obj, type))) return 1; } __Pyx_RaiseArgumentTypeInvalid(name, obj, type); return 0; } static PyObject *__Pyx_GetBuiltinName(PyObject *name) { PyObject* result = __Pyx_PyObject_GetAttrStr(__pyx_b, name); if (unlikely(!result)) { PyErr_Format(PyExc_NameError, #if PY_MAJOR_VERSION >= 3 "name '%U' is not defined", name); #else "name '%.200s' is not defined", PyString_AS_STRING(name)); #endif } return result; } static CYTHON_INLINE PyObject *__Pyx_GetModuleGlobalName(PyObject *name) { PyObject *result; #if CYTHON_COMPILING_IN_CPYTHON result = PyDict_GetItem(__pyx_d, name); if (likely(result)) { Py_INCREF(result); } else { #else result = PyObject_GetItem(__pyx_d, name); if (!result) { PyErr_Clear(); #endif result = __Pyx_GetBuiltinName(name); } return result; } #if CYTHON_COMPILING_IN_CPYTHON static CYTHON_INLINE PyObject* __Pyx_PyObject_Call(PyObject *func, PyObject *arg, PyObject *kw) { PyObject *result; ternaryfunc call = func->ob_type->tp_call; if (unlikely(!call)) return PyObject_Call(func, arg, kw); if (unlikely(Py_EnterRecursiveCall((char*)" while calling a Python object"))) return NULL; result = (*call)(func, arg, kw); Py_LeaveRecursiveCall(); if (unlikely(!result) && unlikely(!PyErr_Occurred())) { PyErr_SetString( PyExc_SystemError, "NULL result without error in PyObject_Call"); } return result; } #endif #if CYTHON_COMPILING_IN_CPYTHON static CYTHON_INLINE PyObject* __Pyx_PyObject_CallMethO(PyObject *func, PyObject *arg) { PyObject *self, *result; PyCFunction cfunc; cfunc = PyCFunction_GET_FUNCTION(func); self = PyCFunction_GET_SELF(func); if (unlikely(Py_EnterRecursiveCall((char*)" while calling a Python object"))) return NULL; result = cfunc(self, arg); Py_LeaveRecursiveCall(); if (unlikely(!result) && unlikely(!PyErr_Occurred())) { PyErr_SetString( PyExc_SystemError, "NULL result without error in PyObject_Call"); } return result; } #endif #if CYTHON_COMPILING_IN_CPYTHON static PyObject* __Pyx__PyObject_CallOneArg(PyObject *func, PyObject *arg) { PyObject *result; PyObject *args = PyTuple_New(1); if (unlikely(!args)) return NULL; Py_INCREF(arg); PyTuple_SET_ITEM(args, 0, arg); result = __Pyx_PyObject_Call(func, args, NULL); Py_DECREF(args); return result; } static CYTHON_INLINE PyObject* __Pyx_PyObject_CallOneArg(PyObject *func, PyObject *arg) { #ifdef __Pyx_CyFunction_USED if (likely(PyCFunction_Check(func) || PyObject_TypeCheck(func, __pyx_CyFunctionType))) { #else if (likely(PyCFunction_Check(func))) { #endif if (likely(PyCFunction_GET_FLAGS(func) & METH_O)) { return __Pyx_PyObject_CallMethO(func, arg); } } return __Pyx__PyObject_CallOneArg(func, arg); } #else static CYTHON_INLINE PyObject* __Pyx_PyObject_CallOneArg(PyObject *func, PyObject *arg) { PyObject *result; PyObject *args = PyTuple_Pack(1, arg); if (unlikely(!args)) return NULL; result = __Pyx_PyObject_Call(func, args, NULL); Py_DECREF(args); return result; } #endif #if CYTHON_USE_PYLONG_INTERNALS #include "longintrepr.h" #endif #if CYTHON_COMPILING_IN_CPYTHON static PyObject* __Pyx_PyInt_EqObjC(PyObject *op1, PyObject *op2, CYTHON_UNUSED long intval, CYTHON_UNUSED int inplace) { if (op1 == op2) { Py_RETURN_TRUE; } #if PY_MAJOR_VERSION < 3 if (likely(PyInt_CheckExact(op1))) { const long b = intval; long a = PyInt_AS_LONG(op1); if (a == b) { Py_RETURN_TRUE; } else { Py_RETURN_FALSE; } } #endif #if CYTHON_USE_PYLONG_INTERNALS && PY_MAJOR_VERSION >= 3 if (likely(PyLong_CheckExact(op1))) { const long b = intval; long a; const digit* digits = ((PyLongObject*)op1)->ob_digit; const Py_ssize_t size = Py_SIZE(op1); if (likely(__Pyx_sst_abs(size) <= 1)) { a = likely(size) ? digits[0] : 0; if (size == -1) a = -a; } else { switch (size) { case -2: if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) { a = -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])); break; } case 2: if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) { a = (long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])); break; } case -3: if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) { a = -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])); break; } case 3: if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) { a = (long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])); break; } case -4: if (8 * sizeof(long) - 1 > 4 * PyLong_SHIFT) { a = -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])); break; } case 4: if (8 * sizeof(long) - 1 > 4 * PyLong_SHIFT) { a = (long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])); break; } #if PyLong_SHIFT < 30 && PyLong_SHIFT != 15 default: return PyLong_Type.tp_richcompare(op1, op2, Py_EQ); #else default: Py_RETURN_FALSE; #endif } } if (a == b) { Py_RETURN_TRUE; } else { Py_RETURN_FALSE; } } #endif if (PyFloat_CheckExact(op1)) { const long b = intval; double a = PyFloat_AS_DOUBLE(op1); if ((double)a == (double)b) { Py_RETURN_TRUE; } else { Py_RETURN_FALSE; } } return PyObject_RichCompare(op1, op2, Py_EQ); } #endif #if CYTHON_COMPILING_IN_CPYTHON static PyObject* __Pyx_PyInt_AddObjC(PyObject *op1, PyObject *op2, CYTHON_UNUSED long intval, CYTHON_UNUSED int inplace) { #if PY_MAJOR_VERSION < 3 if (likely(PyInt_CheckExact(op1))) { const long b = intval; long x; long a = PyInt_AS_LONG(op1); x = (long)((unsigned long)a + b); if (likely((x^a) >= 0 || (x^b) >= 0)) return PyInt_FromLong(x); return PyLong_Type.tp_as_number->nb_add(op1, op2); } #endif #if CYTHON_USE_PYLONG_INTERNALS && PY_MAJOR_VERSION >= 3 if (likely(PyLong_CheckExact(op1))) { const long b = intval; long a, x; const PY_LONG_LONG llb = intval; PY_LONG_LONG lla, llx; const digit* digits = ((PyLongObject*)op1)->ob_digit; const Py_ssize_t size = Py_SIZE(op1); if (likely(__Pyx_sst_abs(size) <= 1)) { a = likely(size) ? digits[0] : 0; if (size == -1) a = -a; } else { switch (size) { case -2: if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) { a = -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])); break; } else if (8 * sizeof(PY_LONG_LONG) - 1 > 2 * PyLong_SHIFT) { lla = -(PY_LONG_LONG) (((((unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0])); goto long_long; } case 2: if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) { a = (long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])); break; } else if (8 * sizeof(PY_LONG_LONG) - 1 > 2 * PyLong_SHIFT) { lla = (PY_LONG_LONG) (((((unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0])); goto long_long; } case -3: if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) { a = -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])); break; } else if (8 * sizeof(PY_LONG_LONG) - 1 > 3 * PyLong_SHIFT) { lla = -(PY_LONG_LONG) (((((((unsigned PY_LONG_LONG)digits[2]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0])); goto long_long; } case 3: if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) { a = (long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])); break; } else if (8 * sizeof(PY_LONG_LONG) - 1 > 3 * PyLong_SHIFT) { lla = (PY_LONG_LONG) (((((((unsigned PY_LONG_LONG)digits[2]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0])); goto long_long; } case -4: if (8 * sizeof(long) - 1 > 4 * PyLong_SHIFT) { a = -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])); break; } else if (8 * sizeof(PY_LONG_LONG) - 1 > 4 * PyLong_SHIFT) { lla = -(PY_LONG_LONG) (((((((((unsigned PY_LONG_LONG)digits[3]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[2]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0])); goto long_long; } case 4: if (8 * sizeof(long) - 1 > 4 * PyLong_SHIFT) { a = (long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])); break; } else if (8 * sizeof(PY_LONG_LONG) - 1 > 4 * PyLong_SHIFT) { lla = (PY_LONG_LONG) (((((((((unsigned PY_LONG_LONG)digits[3]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[2]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0])); goto long_long; } default: return PyLong_Type.tp_as_number->nb_add(op1, op2); } } x = a + b; return PyLong_FromLong(x); long_long: llx = lla + llb; return PyLong_FromLongLong(llx); } #endif if (PyFloat_CheckExact(op1)) { const long b = intval; double a = PyFloat_AS_DOUBLE(op1); double result; PyFPE_START_PROTECT("add", return NULL) result = ((double)a) + (double)b; PyFPE_END_PROTECT(result) return PyFloat_FromDouble(result); } return (inplace ? PyNumber_InPlaceAdd : PyNumber_Add)(op1, op2); } #endif #if CYTHON_COMPILING_IN_CPYTHON static CYTHON_INLINE PyObject* __Pyx_PyObject_CallNoArg(PyObject *func) { #ifdef __Pyx_CyFunction_USED if (likely(PyCFunction_Check(func) || PyObject_TypeCheck(func, __pyx_CyFunctionType))) { #else if (likely(PyCFunction_Check(func))) { #endif if (likely(PyCFunction_GET_FLAGS(func) & METH_NOARGS)) { return __Pyx_PyObject_CallMethO(func, NULL); } } return __Pyx_PyObject_Call(func, __pyx_empty_tuple, NULL); } #endif static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Generic(PyObject *o, PyObject* j) { PyObject *r; if (!j) return NULL; r = PyObject_GetItem(o, j); Py_DECREF(j); return r; } static CYTHON_INLINE PyObject *__Pyx_GetItemInt_List_Fast(PyObject *o, Py_ssize_t i, CYTHON_NCP_UNUSED int wraparound, CYTHON_NCP_UNUSED int boundscheck) { #if CYTHON_COMPILING_IN_CPYTHON if (wraparound & unlikely(i < 0)) i += PyList_GET_SIZE(o); if ((!boundscheck) || likely((0 <= i) & (i < PyList_GET_SIZE(o)))) { PyObject *r = PyList_GET_ITEM(o, i); Py_INCREF(r); return r; } return __Pyx_GetItemInt_Generic(o, PyInt_FromSsize_t(i)); #else return PySequence_GetItem(o, i); #endif } static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Tuple_Fast(PyObject *o, Py_ssize_t i, CYTHON_NCP_UNUSED int wraparound, CYTHON_NCP_UNUSED int boundscheck) { #if CYTHON_COMPILING_IN_CPYTHON if (wraparound & unlikely(i < 0)) i += PyTuple_GET_SIZE(o); if ((!boundscheck) || likely((0 <= i) & (i < PyTuple_GET_SIZE(o)))) { PyObject *r = PyTuple_GET_ITEM(o, i); Py_INCREF(r); return r; } return __Pyx_GetItemInt_Generic(o, PyInt_FromSsize_t(i)); #else return PySequence_GetItem(o, i); #endif } static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Fast(PyObject *o, Py_ssize_t i, int is_list, CYTHON_NCP_UNUSED int wraparound, CYTHON_NCP_UNUSED int boundscheck) { #if CYTHON_COMPILING_IN_CPYTHON if (is_list || PyList_CheckExact(o)) { Py_ssize_t n = ((!wraparound) | likely(i >= 0)) ? i : i + PyList_GET_SIZE(o); if ((!boundscheck) || (likely((n >= 0) & (n < PyList_GET_SIZE(o))))) { PyObject *r = PyList_GET_ITEM(o, n); Py_INCREF(r); return r; } } else if (PyTuple_CheckExact(o)) { Py_ssize_t n = ((!wraparound) | likely(i >= 0)) ? i : i + PyTuple_GET_SIZE(o); if ((!boundscheck) || likely((n >= 0) & (n < PyTuple_GET_SIZE(o)))) { PyObject *r = PyTuple_GET_ITEM(o, n); Py_INCREF(r); return r; } } else { PySequenceMethods *m = Py_TYPE(o)->tp_as_sequence; if (likely(m && m->sq_item)) { if (wraparound && unlikely(i < 0) && likely(m->sq_length)) { Py_ssize_t l = m->sq_length(o); if (likely(l >= 0)) { i += l; } else { if (PyErr_ExceptionMatches(PyExc_OverflowError)) PyErr_Clear(); else return NULL; } } return m->sq_item(o, i); } } #else if (is_list || PySequence_Check(o)) { return PySequence_GetItem(o, i); } #endif return __Pyx_GetItemInt_Generic(o, PyInt_FromSsize_t(i)); } static CYTHON_INLINE void __Pyx_RaiseTooManyValuesError(Py_ssize_t expected) { PyErr_Format(PyExc_ValueError, "too many values to unpack (expected %" CYTHON_FORMAT_SSIZE_T "d)", expected); } static CYTHON_INLINE void __Pyx_RaiseNeedMoreValuesError(Py_ssize_t index) { PyErr_Format(PyExc_ValueError, "need more than %" CYTHON_FORMAT_SSIZE_T "d value%.1s to unpack", index, (index == 1) ? "" : "s"); } static CYTHON_INLINE int __Pyx_IterFinish(void) { #if CYTHON_COMPILING_IN_CPYTHON PyThreadState *tstate = PyThreadState_GET(); PyObject* exc_type = tstate->curexc_type; if (unlikely(exc_type)) { if (likely(exc_type == PyExc_StopIteration) || PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration)) { PyObject *exc_value, *exc_tb; exc_value = tstate->curexc_value; exc_tb = tstate->curexc_traceback; tstate->curexc_type = 0; tstate->curexc_value = 0; tstate->curexc_traceback = 0; Py_DECREF(exc_type); Py_XDECREF(exc_value); Py_XDECREF(exc_tb); return 0; } else { return -1; } } return 0; #else if (unlikely(PyErr_Occurred())) { if (likely(PyErr_ExceptionMatches(PyExc_StopIteration))) { PyErr_Clear(); return 0; } else { return -1; } } return 0; #endif } static int __Pyx_IternextUnpackEndCheck(PyObject *retval, Py_ssize_t expected) { if (unlikely(retval)) { Py_DECREF(retval); __Pyx_RaiseTooManyValuesError(expected); return -1; } else { return __Pyx_IterFinish(); } return 0; } #if CYTHON_COMPILING_IN_CPYTHON static PyObject* __Pyx_PyInt_SubtractObjC(PyObject *op1, PyObject *op2, CYTHON_UNUSED long intval, CYTHON_UNUSED int inplace) { #if PY_MAJOR_VERSION < 3 if (likely(PyInt_CheckExact(op1))) { const long b = intval; long x; long a = PyInt_AS_LONG(op1); x = (long)((unsigned long)a - b); if (likely((x^a) >= 0 || (x^~b) >= 0)) return PyInt_FromLong(x); return PyLong_Type.tp_as_number->nb_subtract(op1, op2); } #endif #if CYTHON_USE_PYLONG_INTERNALS && PY_MAJOR_VERSION >= 3 if (likely(PyLong_CheckExact(op1))) { const long b = intval; long a, x; const PY_LONG_LONG llb = intval; PY_LONG_LONG lla, llx; const digit* digits = ((PyLongObject*)op1)->ob_digit; const Py_ssize_t size = Py_SIZE(op1); if (likely(__Pyx_sst_abs(size) <= 1)) { a = likely(size) ? digits[0] : 0; if (size == -1) a = -a; } else { switch (size) { case -2: if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) { a = -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])); break; } else if (8 * sizeof(PY_LONG_LONG) - 1 > 2 * PyLong_SHIFT) { lla = -(PY_LONG_LONG) (((((unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0])); goto long_long; } case 2: if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) { a = (long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])); break; } else if (8 * sizeof(PY_LONG_LONG) - 1 > 2 * PyLong_SHIFT) { lla = (PY_LONG_LONG) (((((unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0])); goto long_long; } case -3: if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) { a = -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])); break; } else if (8 * sizeof(PY_LONG_LONG) - 1 > 3 * PyLong_SHIFT) { lla = -(PY_LONG_LONG) (((((((unsigned PY_LONG_LONG)digits[2]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0])); goto long_long; } case 3: if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) { a = (long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])); break; } else if (8 * sizeof(PY_LONG_LONG) - 1 > 3 * PyLong_SHIFT) { lla = (PY_LONG_LONG) (((((((unsigned PY_LONG_LONG)digits[2]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0])); goto long_long; } case -4: if (8 * sizeof(long) - 1 > 4 * PyLong_SHIFT) { a = -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])); break; } else if (8 * sizeof(PY_LONG_LONG) - 1 > 4 * PyLong_SHIFT) { lla = -(PY_LONG_LONG) (((((((((unsigned PY_LONG_LONG)digits[3]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[2]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0])); goto long_long; } case 4: if (8 * sizeof(long) - 1 > 4 * PyLong_SHIFT) { a = (long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])); break; } else if (8 * sizeof(PY_LONG_LONG) - 1 > 4 * PyLong_SHIFT) { lla = (PY_LONG_LONG) (((((((((unsigned PY_LONG_LONG)digits[3]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[2]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0])); goto long_long; } default: return PyLong_Type.tp_as_number->nb_subtract(op1, op2); } } x = a - b; return PyLong_FromLong(x); long_long: llx = lla - llb; return PyLong_FromLongLong(llx); } #endif if (PyFloat_CheckExact(op1)) { const long b = intval; double a = PyFloat_AS_DOUBLE(op1); double result; PyFPE_START_PROTECT("subtract", return NULL) result = ((double)a) - (double)b; PyFPE_END_PROTECT(result) return PyFloat_FromDouble(result); } return (inplace ? PyNumber_InPlaceSubtract : PyNumber_Subtract)(op1, op2); } #endif static CYTHON_INLINE void __Pyx_ErrRestore(PyObject *type, PyObject *value, PyObject *tb) { #if CYTHON_COMPILING_IN_CPYTHON PyObject *tmp_type, *tmp_value, *tmp_tb; PyThreadState *tstate = PyThreadState_GET(); tmp_type = tstate->curexc_type; tmp_value = tstate->curexc_value; tmp_tb = tstate->curexc_traceback; tstate->curexc_type = type; tstate->curexc_value = value; tstate->curexc_traceback = tb; Py_XDECREF(tmp_type); Py_XDECREF(tmp_value); Py_XDECREF(tmp_tb); #else PyErr_Restore(type, value, tb); #endif } static CYTHON_INLINE void __Pyx_ErrFetch(PyObject **type, PyObject **value, PyObject **tb) { #if CYTHON_COMPILING_IN_CPYTHON PyThreadState *tstate = PyThreadState_GET(); *type = tstate->curexc_type; *value = tstate->curexc_value; *tb = tstate->curexc_traceback; tstate->curexc_type = 0; tstate->curexc_value = 0; tstate->curexc_traceback = 0; #else PyErr_Fetch(type, value, tb); #endif } #if PY_MAJOR_VERSION < 3 static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, CYTHON_UNUSED PyObject *cause) { Py_XINCREF(type); if (!value || value == Py_None) value = NULL; else Py_INCREF(value); if (!tb || tb == Py_None) tb = NULL; else { Py_INCREF(tb); if (!PyTraceBack_Check(tb)) { PyErr_SetString(PyExc_TypeError, "raise: arg 3 must be a traceback or None"); goto raise_error; } } if (PyType_Check(type)) { #if CYTHON_COMPILING_IN_PYPY if (!value) { Py_INCREF(Py_None); value = Py_None; } #endif PyErr_NormalizeException(&type, &value, &tb); } else { if (value) { PyErr_SetString(PyExc_TypeError, "instance exception may not have a separate value"); goto raise_error; } value = type; type = (PyObject*) Py_TYPE(type); Py_INCREF(type); if (!PyType_IsSubtype((PyTypeObject *)type, (PyTypeObject *)PyExc_BaseException)) { PyErr_SetString(PyExc_TypeError, "raise: exception class must be a subclass of BaseException"); goto raise_error; } } __Pyx_ErrRestore(type, value, tb); return; raise_error: Py_XDECREF(value); Py_XDECREF(type); Py_XDECREF(tb); return; } #else static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, PyObject *cause) { PyObject* owned_instance = NULL; if (tb == Py_None) { tb = 0; } else if (tb && !PyTraceBack_Check(tb)) { PyErr_SetString(PyExc_TypeError, "raise: arg 3 must be a traceback or None"); goto bad; } if (value == Py_None) value = 0; if (PyExceptionInstance_Check(type)) { if (value) { PyErr_SetString(PyExc_TypeError, "instance exception may not have a separate value"); goto bad; } value = type; type = (PyObject*) Py_TYPE(value); } else if (PyExceptionClass_Check(type)) { PyObject *instance_class = NULL; if (value && PyExceptionInstance_Check(value)) { instance_class = (PyObject*) Py_TYPE(value); if (instance_class != type) { int is_subclass = PyObject_IsSubclass(instance_class, type); if (!is_subclass) { instance_class = NULL; } else if (unlikely(is_subclass == -1)) { goto bad; } else { type = instance_class; } } } if (!instance_class) { PyObject *args; if (!value) args = PyTuple_New(0); else if (PyTuple_Check(value)) { Py_INCREF(value); args = value; } else args = PyTuple_Pack(1, value); if (!args) goto bad; owned_instance = PyObject_Call(type, args, NULL); Py_DECREF(args); if (!owned_instance) goto bad; value = owned_instance; if (!PyExceptionInstance_Check(value)) { PyErr_Format(PyExc_TypeError, "calling %R should have returned an instance of " "BaseException, not %R", type, Py_TYPE(value)); goto bad; } } } else { PyErr_SetString(PyExc_TypeError, "raise: exception class must be a subclass of BaseException"); goto bad; } #if PY_VERSION_HEX >= 0x03030000 if (cause) { #else if (cause && cause != Py_None) { #endif PyObject *fixed_cause; if (cause == Py_None) { fixed_cause = NULL; } else if (PyExceptionClass_Check(cause)) { fixed_cause = PyObject_CallObject(cause, NULL); if (fixed_cause == NULL) goto bad; } else if (PyExceptionInstance_Check(cause)) { fixed_cause = cause; Py_INCREF(fixed_cause); } else { PyErr_SetString(PyExc_TypeError, "exception causes must derive from " "BaseException"); goto bad; } PyException_SetCause(value, fixed_cause); } PyErr_SetObject(type, value); if (tb) { #if CYTHON_COMPILING_IN_PYPY PyObject *tmp_type, *tmp_value, *tmp_tb; PyErr_Fetch(&tmp_type, &tmp_value, &tmp_tb); Py_INCREF(tb); PyErr_Restore(tmp_type, tmp_value, tb); Py_XDECREF(tmp_tb); #else PyThreadState *tstate = PyThreadState_GET(); PyObject* tmp_tb = tstate->curexc_traceback; if (tb != tmp_tb) { Py_INCREF(tb); tstate->curexc_traceback = tb; Py_XDECREF(tmp_tb); } #endif } bad: Py_XDECREF(owned_instance); return; } #endif static void* __Pyx_GetVtable(PyObject *dict) { void* ptr; PyObject *ob = PyObject_GetItem(dict, __pyx_n_s_pyx_vtable); if (!ob) goto bad; #if PY_VERSION_HEX >= 0x02070000 ptr = PyCapsule_GetPointer(ob, 0); #else ptr = PyCObject_AsVoidPtr(ob); #endif if (!ptr && !PyErr_Occurred()) PyErr_SetString(PyExc_RuntimeError, "invalid vtable found for imported type"); Py_DECREF(ob); return ptr; bad: Py_XDECREF(ob); return NULL; } static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list, int level) { PyObject *empty_list = 0; PyObject *module = 0; PyObject *global_dict = 0; PyObject *empty_dict = 0; PyObject *list; #if PY_VERSION_HEX < 0x03030000 PyObject *py_import; py_import = __Pyx_PyObject_GetAttrStr(__pyx_b, __pyx_n_s_import); if (!py_import) goto bad; #endif if (from_list) list = from_list; else { empty_list = PyList_New(0); if (!empty_list) goto bad; list = empty_list; } global_dict = PyModule_GetDict(__pyx_m); if (!global_dict) goto bad; empty_dict = PyDict_New(); if (!empty_dict) goto bad; { #if PY_MAJOR_VERSION >= 3 if (level == -1) { if (strchr(__Pyx_MODULE_NAME, '.')) { #if PY_VERSION_HEX < 0x03030000 PyObject *py_level = PyInt_FromLong(1); if (!py_level) goto bad; module = PyObject_CallFunctionObjArgs(py_import, name, global_dict, empty_dict, list, py_level, NULL); Py_DECREF(py_level); #else module = PyImport_ImportModuleLevelObject( name, global_dict, empty_dict, list, 1); #endif if (!module) { if (!PyErr_ExceptionMatches(PyExc_ImportError)) goto bad; PyErr_Clear(); } } level = 0; } #endif if (!module) { #if PY_VERSION_HEX < 0x03030000 PyObject *py_level = PyInt_FromLong(level); if (!py_level) goto bad; module = PyObject_CallFunctionObjArgs(py_import, name, global_dict, empty_dict, list, py_level, NULL); Py_DECREF(py_level); #else module = PyImport_ImportModuleLevelObject( name, global_dict, empty_dict, list, level); #endif } } bad: #if PY_VERSION_HEX < 0x03030000 Py_XDECREF(py_import); #endif Py_XDECREF(empty_list); Py_XDECREF(empty_dict); return module; } static PyObject* __Pyx_ImportFrom(PyObject* module, PyObject* name) { PyObject* value = __Pyx_PyObject_GetAttrStr(module, name); if (unlikely(!value) && PyErr_ExceptionMatches(PyExc_AttributeError)) { PyErr_Format(PyExc_ImportError, #if PY_MAJOR_VERSION < 3 "cannot import name %.230s", PyString_AS_STRING(name)); #else "cannot import name %S", name); #endif } return value; } static int __pyx_bisect_code_objects(__Pyx_CodeObjectCacheEntry* entries, int count, int code_line) { int start = 0, mid = 0, end = count - 1; if (end >= 0 && code_line > entries[end].code_line) { return count; } while (start < end) { mid = start + (end - start) / 2; if (code_line < entries[mid].code_line) { end = mid; } else if (code_line > entries[mid].code_line) { start = mid + 1; } else { return mid; } } if (code_line <= entries[mid].code_line) { return mid; } else { return mid + 1; } } static PyCodeObject *__pyx_find_code_object(int code_line) { PyCodeObject* code_object; int pos; if (unlikely(!code_line) || unlikely(!__pyx_code_cache.entries)) { return NULL; } pos = __pyx_bisect_code_objects(__pyx_code_cache.entries, __pyx_code_cache.count, code_line); if (unlikely(pos >= __pyx_code_cache.count) || unlikely(__pyx_code_cache.entries[pos].code_line != code_line)) { return NULL; } code_object = __pyx_code_cache.entries[pos].code_object; Py_INCREF(code_object); return code_object; } static void __pyx_insert_code_object(int code_line, PyCodeObject* code_object) { int pos, i; __Pyx_CodeObjectCacheEntry* entries = __pyx_code_cache.entries; if (unlikely(!code_line)) { return; } if (unlikely(!entries)) { entries = (__Pyx_CodeObjectCacheEntry*)PyMem_Malloc(64*sizeof(__Pyx_CodeObjectCacheEntry)); if (likely(entries)) { __pyx_code_cache.entries = entries; __pyx_code_cache.max_count = 64; __pyx_code_cache.count = 1; entries[0].code_line = code_line; entries[0].code_object = code_object; Py_INCREF(code_object); } return; } pos = __pyx_bisect_code_objects(__pyx_code_cache.entries, __pyx_code_cache.count, code_line); if ((pos < __pyx_code_cache.count) && unlikely(__pyx_code_cache.entries[pos].code_line == code_line)) { PyCodeObject* tmp = entries[pos].code_object; entries[pos].code_object = code_object; Py_DECREF(tmp); return; } if (__pyx_code_cache.count == __pyx_code_cache.max_count) { int new_max = __pyx_code_cache.max_count + 64; entries = (__Pyx_CodeObjectCacheEntry*)PyMem_Realloc( __pyx_code_cache.entries, (size_t)new_max*sizeof(__Pyx_CodeObjectCacheEntry)); if (unlikely(!entries)) { return; } __pyx_code_cache.entries = entries; __pyx_code_cache.max_count = new_max; } for (i=__pyx_code_cache.count; i>pos; i--) { entries[i] = entries[i-1]; } entries[pos].code_line = code_line; entries[pos].code_object = code_object; __pyx_code_cache.count++; Py_INCREF(code_object); } #include "compile.h" #include "frameobject.h" #include "traceback.h" static PyCodeObject* __Pyx_CreateCodeObjectForTraceback( const char *funcname, int c_line, int py_line, const char *filename) { PyCodeObject *py_code = 0; PyObject *py_srcfile = 0; PyObject *py_funcname = 0; #if PY_MAJOR_VERSION < 3 py_srcfile = PyString_FromString(filename); #else py_srcfile = PyUnicode_FromString(filename); #endif if (!py_srcfile) goto bad; if (c_line) { #if PY_MAJOR_VERSION < 3 py_funcname = PyString_FromFormat( "%s (%s:%d)", funcname, __pyx_cfilenm, c_line); #else py_funcname = PyUnicode_FromFormat( "%s (%s:%d)", funcname, __pyx_cfilenm, c_line); #endif } else { #if PY_MAJOR_VERSION < 3 py_funcname = PyString_FromString(funcname); #else py_funcname = PyUnicode_FromString(funcname); #endif } if (!py_funcname) goto bad; py_code = __Pyx_PyCode_New( 0, 0, 0, 0, 0, __pyx_empty_bytes, /*PyObject *code,*/ __pyx_empty_tuple, /*PyObject *consts,*/ __pyx_empty_tuple, /*PyObject *names,*/ __pyx_empty_tuple, /*PyObject *varnames,*/ __pyx_empty_tuple, /*PyObject *freevars,*/ __pyx_empty_tuple, /*PyObject *cellvars,*/ py_srcfile, /*PyObject *filename,*/ py_funcname, /*PyObject *name,*/ py_line, __pyx_empty_bytes /*PyObject *lnotab*/ ); Py_DECREF(py_srcfile); Py_DECREF(py_funcname); return py_code; bad: Py_XDECREF(py_srcfile); Py_XDECREF(py_funcname); return NULL; } static void __Pyx_AddTraceback(const char *funcname, int c_line, int py_line, const char *filename) { PyCodeObject *py_code = 0; PyFrameObject *py_frame = 0; py_code = __pyx_find_code_object(c_line ? c_line : py_line); if (!py_code) { py_code = __Pyx_CreateCodeObjectForTraceback( funcname, c_line, py_line, filename); if (!py_code) goto bad; __pyx_insert_code_object(c_line ? c_line : py_line, py_code); } py_frame = PyFrame_New( PyThreadState_GET(), /*PyThreadState *tstate,*/ py_code, /*PyCodeObject *code,*/ __pyx_d, /*PyObject *globals,*/ 0 /*PyObject *locals*/ ); if (!py_frame) goto bad; py_frame->f_lineno = py_line; PyTraceBack_Here(py_frame); bad: Py_XDECREF(py_code); Py_XDECREF(py_frame); } static CYTHON_INLINE PyObject* __Pyx_PyInt_From_long(long value) { const long neg_one = (long) -1, const_zero = (long) 0; const int is_unsigned = neg_one > const_zero; if (is_unsigned) { if (sizeof(long) < sizeof(long)) { return PyInt_FromLong((long) value); } else if (sizeof(long) <= sizeof(unsigned long)) { return PyLong_FromUnsignedLong((unsigned long) value); } else if (sizeof(long) <= sizeof(unsigned PY_LONG_LONG)) { return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value); } } else { if (sizeof(long) <= sizeof(long)) { return PyInt_FromLong((long) value); } else if (sizeof(long) <= sizeof(PY_LONG_LONG)) { return PyLong_FromLongLong((PY_LONG_LONG) value); } } { int one = 1; int little = (int)*(unsigned char *)&one; unsigned char *bytes = (unsigned char *)&value; return _PyLong_FromByteArray(bytes, sizeof(long), little, !is_unsigned); } } #define __PYX_VERIFY_RETURN_INT(target_type, func_type, func_value)\ __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, 0) #define __PYX_VERIFY_RETURN_INT_EXC(target_type, func_type, func_value)\ __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, 1) #define __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, exc)\ {\ func_type value = func_value;\ if (sizeof(target_type) < sizeof(func_type)) {\ if (unlikely(value != (func_type) (target_type) value)) {\ func_type zero = 0;\ if (exc && unlikely(value == (func_type)-1 && PyErr_Occurred()))\ return (target_type) -1;\ if (is_unsigned && unlikely(value < zero))\ goto raise_neg_overflow;\ else\ goto raise_overflow;\ }\ }\ return (target_type) value;\ } static CYTHON_INLINE long __Pyx_PyInt_As_long(PyObject *x) { const long neg_one = (long) -1, const_zero = (long) 0; const int is_unsigned = neg_one > const_zero; #if PY_MAJOR_VERSION < 3 if (likely(PyInt_Check(x))) { if (sizeof(long) < sizeof(long)) { __PYX_VERIFY_RETURN_INT(long, long, PyInt_AS_LONG(x)) } else { long val = PyInt_AS_LONG(x); if (is_unsigned && unlikely(val < 0)) { goto raise_neg_overflow; } return (long) val; } } else #endif if (likely(PyLong_Check(x))) { if (is_unsigned) { #if CYTHON_USE_PYLONG_INTERNALS const digit* digits = ((PyLongObject*)x)->ob_digit; switch (Py_SIZE(x)) { case 0: return (long) 0; case 1: __PYX_VERIFY_RETURN_INT(long, digit, digits[0]) case 2: if (8 * sizeof(long) > 1 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(long) >= 2 * PyLong_SHIFT) { return (long) (((((long)digits[1]) << PyLong_SHIFT) | (long)digits[0])); } } break; case 3: if (8 * sizeof(long) > 2 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(long) >= 3 * PyLong_SHIFT) { return (long) (((((((long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0])); } } break; case 4: if (8 * sizeof(long) > 3 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(long) >= 4 * PyLong_SHIFT) { return (long) (((((((((long)digits[3]) << PyLong_SHIFT) | (long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0])); } } break; } #endif #if CYTHON_COMPILING_IN_CPYTHON if (unlikely(Py_SIZE(x) < 0)) { goto raise_neg_overflow; } #else { int result = PyObject_RichCompareBool(x, Py_False, Py_LT); if (unlikely(result < 0)) return (long) -1; if (unlikely(result == 1)) goto raise_neg_overflow; } #endif if (sizeof(long) <= sizeof(unsigned long)) { __PYX_VERIFY_RETURN_INT_EXC(long, unsigned long, PyLong_AsUnsignedLong(x)) } else if (sizeof(long) <= sizeof(unsigned PY_LONG_LONG)) { __PYX_VERIFY_RETURN_INT_EXC(long, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x)) } } else { #if CYTHON_USE_PYLONG_INTERNALS const digit* digits = ((PyLongObject*)x)->ob_digit; switch (Py_SIZE(x)) { case 0: return (long) 0; case -1: __PYX_VERIFY_RETURN_INT(long, sdigit, -(sdigit) digits[0]) case 1: __PYX_VERIFY_RETURN_INT(long, digit, +digits[0]) case -2: if (8 * sizeof(long) - 1 > 1 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(long, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) { return (long) (((long)-1)*(((((long)digits[1]) << PyLong_SHIFT) | (long)digits[0]))); } } break; case 2: if (8 * sizeof(long) > 1 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) { return (long) ((((((long)digits[1]) << PyLong_SHIFT) | (long)digits[0]))); } } break; case -3: if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(long, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) { return (long) (((long)-1)*(((((((long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0]))); } } break; case 3: if (8 * sizeof(long) > 2 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) { return (long) ((((((((long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0]))); } } break; case -4: if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(long, long, -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(long) - 1 > 4 * PyLong_SHIFT) { return (long) (((long)-1)*(((((((((long)digits[3]) << PyLong_SHIFT) | (long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0]))); } } break; case 4: if (8 * sizeof(long) > 3 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(long) - 1 > 4 * PyLong_SHIFT) { return (long) ((((((((((long)digits[3]) << PyLong_SHIFT) | (long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0]))); } } break; } #endif if (sizeof(long) <= sizeof(long)) { __PYX_VERIFY_RETURN_INT_EXC(long, long, PyLong_AsLong(x)) } else if (sizeof(long) <= sizeof(PY_LONG_LONG)) { __PYX_VERIFY_RETURN_INT_EXC(long, PY_LONG_LONG, PyLong_AsLongLong(x)) } } { #if CYTHON_COMPILING_IN_PYPY && !defined(_PyLong_AsByteArray) PyErr_SetString(PyExc_RuntimeError, "_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers"); #else long val; PyObject *v = __Pyx_PyNumber_Int(x); #if PY_MAJOR_VERSION < 3 if (likely(v) && !PyLong_Check(v)) { PyObject *tmp = v; v = PyNumber_Long(tmp); Py_DECREF(tmp); } #endif if (likely(v)) { int one = 1; int is_little = (int)*(unsigned char *)&one; unsigned char *bytes = (unsigned char *)&val; int ret = _PyLong_AsByteArray((PyLongObject *)v, bytes, sizeof(val), is_little, !is_unsigned); Py_DECREF(v); if (likely(!ret)) return val; } #endif return (long) -1; } } else { long val; PyObject *tmp = __Pyx_PyNumber_Int(x); if (!tmp) return (long) -1; val = __Pyx_PyInt_As_long(tmp); Py_DECREF(tmp); return val; } raise_overflow: PyErr_SetString(PyExc_OverflowError, "value too large to convert to long"); return (long) -1; raise_neg_overflow: PyErr_SetString(PyExc_OverflowError, "can't convert negative value to long"); return (long) -1; } static CYTHON_INLINE int __Pyx_PyInt_As_int(PyObject *x) { const int neg_one = (int) -1, const_zero = (int) 0; const int is_unsigned = neg_one > const_zero; #if PY_MAJOR_VERSION < 3 if (likely(PyInt_Check(x))) { if (sizeof(int) < sizeof(long)) { __PYX_VERIFY_RETURN_INT(int, long, PyInt_AS_LONG(x)) } else { long val = PyInt_AS_LONG(x); if (is_unsigned && unlikely(val < 0)) { goto raise_neg_overflow; } return (int) val; } } else #endif if (likely(PyLong_Check(x))) { if (is_unsigned) { #if CYTHON_USE_PYLONG_INTERNALS const digit* digits = ((PyLongObject*)x)->ob_digit; switch (Py_SIZE(x)) { case 0: return (int) 0; case 1: __PYX_VERIFY_RETURN_INT(int, digit, digits[0]) case 2: if (8 * sizeof(int) > 1 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(int) >= 2 * PyLong_SHIFT) { return (int) (((((int)digits[1]) << PyLong_SHIFT) | (int)digits[0])); } } break; case 3: if (8 * sizeof(int) > 2 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(int) >= 3 * PyLong_SHIFT) { return (int) (((((((int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0])); } } break; case 4: if (8 * sizeof(int) > 3 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(int) >= 4 * PyLong_SHIFT) { return (int) (((((((((int)digits[3]) << PyLong_SHIFT) | (int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0])); } } break; } #endif #if CYTHON_COMPILING_IN_CPYTHON if (unlikely(Py_SIZE(x) < 0)) { goto raise_neg_overflow; } #else { int result = PyObject_RichCompareBool(x, Py_False, Py_LT); if (unlikely(result < 0)) return (int) -1; if (unlikely(result == 1)) goto raise_neg_overflow; } #endif if (sizeof(int) <= sizeof(unsigned long)) { __PYX_VERIFY_RETURN_INT_EXC(int, unsigned long, PyLong_AsUnsignedLong(x)) } else if (sizeof(int) <= sizeof(unsigned PY_LONG_LONG)) { __PYX_VERIFY_RETURN_INT_EXC(int, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x)) } } else { #if CYTHON_USE_PYLONG_INTERNALS const digit* digits = ((PyLongObject*)x)->ob_digit; switch (Py_SIZE(x)) { case 0: return (int) 0; case -1: __PYX_VERIFY_RETURN_INT(int, sdigit, -(sdigit) digits[0]) case 1: __PYX_VERIFY_RETURN_INT(int, digit, +digits[0]) case -2: if (8 * sizeof(int) - 1 > 1 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(int, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(int) - 1 > 2 * PyLong_SHIFT) { return (int) (((int)-1)*(((((int)digits[1]) << PyLong_SHIFT) | (int)digits[0]))); } } break; case 2: if (8 * sizeof(int) > 1 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(int) - 1 > 2 * PyLong_SHIFT) { return (int) ((((((int)digits[1]) << PyLong_SHIFT) | (int)digits[0]))); } } break; case -3: if (8 * sizeof(int) - 1 > 2 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(int, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(int) - 1 > 3 * PyLong_SHIFT) { return (int) (((int)-1)*(((((((int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0]))); } } break; case 3: if (8 * sizeof(int) > 2 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(int) - 1 > 3 * PyLong_SHIFT) { return (int) ((((((((int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0]))); } } break; case -4: if (8 * sizeof(int) - 1 > 3 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(int, long, -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(int) - 1 > 4 * PyLong_SHIFT) { return (int) (((int)-1)*(((((((((int)digits[3]) << PyLong_SHIFT) | (int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0]))); } } break; case 4: if (8 * sizeof(int) > 3 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(int) - 1 > 4 * PyLong_SHIFT) { return (int) ((((((((((int)digits[3]) << PyLong_SHIFT) | (int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0]))); } } break; } #endif if (sizeof(int) <= sizeof(long)) { __PYX_VERIFY_RETURN_INT_EXC(int, long, PyLong_AsLong(x)) } else if (sizeof(int) <= sizeof(PY_LONG_LONG)) { __PYX_VERIFY_RETURN_INT_EXC(int, PY_LONG_LONG, PyLong_AsLongLong(x)) } } { #if CYTHON_COMPILING_IN_PYPY && !defined(_PyLong_AsByteArray) PyErr_SetString(PyExc_RuntimeError, "_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers"); #else int val; PyObject *v = __Pyx_PyNumber_Int(x); #if PY_MAJOR_VERSION < 3 if (likely(v) && !PyLong_Check(v)) { PyObject *tmp = v; v = PyNumber_Long(tmp); Py_DECREF(tmp); } #endif if (likely(v)) { int one = 1; int is_little = (int)*(unsigned char *)&one; unsigned char *bytes = (unsigned char *)&val; int ret = _PyLong_AsByteArray((PyLongObject *)v, bytes, sizeof(val), is_little, !is_unsigned); Py_DECREF(v); if (likely(!ret)) return val; } #endif return (int) -1; } } else { int val; PyObject *tmp = __Pyx_PyNumber_Int(x); if (!tmp) return (int) -1; val = __Pyx_PyInt_As_int(tmp); Py_DECREF(tmp); return val; } raise_overflow: PyErr_SetString(PyExc_OverflowError, "value too large to convert to int"); return (int) -1; raise_neg_overflow: PyErr_SetString(PyExc_OverflowError, "can't convert negative value to int"); return (int) -1; } static int __Pyx_check_binary_version(void) { char ctversion[4], rtversion[4]; PyOS_snprintf(ctversion, 4, "%d.%d", PY_MAJOR_VERSION, PY_MINOR_VERSION); PyOS_snprintf(rtversion, 4, "%s", Py_GetVersion()); if (ctversion[0] != rtversion[0] || ctversion[2] != rtversion[2]) { char message[200]; PyOS_snprintf(message, sizeof(message), "compiletime version %s of module '%.100s' " "does not match runtime version %s", ctversion, __Pyx_MODULE_NAME, rtversion); return PyErr_WarnEx(NULL, message, 1); } return 0; } #ifndef __PYX_HAVE_RT_ImportModule #define __PYX_HAVE_RT_ImportModule static PyObject *__Pyx_ImportModule(const char *name) { PyObject *py_name = 0; PyObject *py_module = 0; py_name = __Pyx_PyIdentifier_FromString(name); if (!py_name) goto bad; py_module = PyImport_Import(py_name); Py_DECREF(py_name); return py_module; bad: Py_XDECREF(py_name); return 0; } #endif #ifndef __PYX_HAVE_RT_ImportType #define __PYX_HAVE_RT_ImportType static PyTypeObject *__Pyx_ImportType(const char *module_name, const char *class_name, size_t size, int strict) { PyObject *py_module = 0; PyObject *result = 0; PyObject *py_name = 0; char warning[200]; Py_ssize_t basicsize; #ifdef Py_LIMITED_API PyObject *py_basicsize; #endif py_module = __Pyx_ImportModule(module_name); if (!py_module) goto bad; py_name = __Pyx_PyIdentifier_FromString(class_name); if (!py_name) goto bad; result = PyObject_GetAttr(py_module, py_name); Py_DECREF(py_name); py_name = 0; Py_DECREF(py_module); py_module = 0; if (!result) goto bad; if (!PyType_Check(result)) { PyErr_Format(PyExc_TypeError, "%.200s.%.200s is not a type object", module_name, class_name); goto bad; } #ifndef Py_LIMITED_API basicsize = ((PyTypeObject *)result)->tp_basicsize; #else py_basicsize = PyObject_GetAttrString(result, "__basicsize__"); if (!py_basicsize) goto bad; basicsize = PyLong_AsSsize_t(py_basicsize); Py_DECREF(py_basicsize); py_basicsize = 0; if (basicsize == (Py_ssize_t)-1 && PyErr_Occurred()) goto bad; #endif if (!strict && (size_t)basicsize > size) { PyOS_snprintf(warning, sizeof(warning), "%s.%s size changed, may indicate binary incompatibility", module_name, class_name); if (PyErr_WarnEx(NULL, warning, 0) < 0) goto bad; } else if ((size_t)basicsize != size) { PyErr_Format(PyExc_ValueError, "%.200s.%.200s has the wrong size, try recompiling", module_name, class_name); goto bad; } return (PyTypeObject *)result; bad: Py_XDECREF(py_module); Py_XDECREF(result); return NULL; } #endif static int __Pyx_InitStrings(__Pyx_StringTabEntry *t) { while (t->p) { #if PY_MAJOR_VERSION < 3 if (t->is_unicode) { *t->p = PyUnicode_DecodeUTF8(t->s, t->n - 1, NULL); } else if (t->intern) { *t->p = PyString_InternFromString(t->s); } else { *t->p = PyString_FromStringAndSize(t->s, t->n - 1); } #else if (t->is_unicode | t->is_str) { if (t->intern) { *t->p = PyUnicode_InternFromString(t->s); } else if (t->encoding) { *t->p = PyUnicode_Decode(t->s, t->n - 1, t->encoding, NULL); } else { *t->p = PyUnicode_FromStringAndSize(t->s, t->n - 1); } } else { *t->p = PyBytes_FromStringAndSize(t->s, t->n - 1); } #endif if (!*t->p) return -1; ++t; } return 0; } static CYTHON_INLINE PyObject* __Pyx_PyUnicode_FromString(const char* c_str) { return __Pyx_PyUnicode_FromStringAndSize(c_str, (Py_ssize_t)strlen(c_str)); } static CYTHON_INLINE char* __Pyx_PyObject_AsString(PyObject* o) { Py_ssize_t ignore; return __Pyx_PyObject_AsStringAndSize(o, &ignore); } static CYTHON_INLINE char* __Pyx_PyObject_AsStringAndSize(PyObject* o, Py_ssize_t *length) { #if CYTHON_COMPILING_IN_CPYTHON && (__PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT) if ( #if PY_MAJOR_VERSION < 3 && __PYX_DEFAULT_STRING_ENCODING_IS_ASCII __Pyx_sys_getdefaultencoding_not_ascii && #endif PyUnicode_Check(o)) { #if PY_VERSION_HEX < 0x03030000 char* defenc_c; PyObject* defenc = _PyUnicode_AsDefaultEncodedString(o, NULL); if (!defenc) return NULL; defenc_c = PyBytes_AS_STRING(defenc); #if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII { char* end = defenc_c + PyBytes_GET_SIZE(defenc); char* c; for (c = defenc_c; c < end; c++) { if ((unsigned char) (*c) >= 128) { PyUnicode_AsASCIIString(o); return NULL; } } } #endif *length = PyBytes_GET_SIZE(defenc); return defenc_c; #else if (__Pyx_PyUnicode_READY(o) == -1) return NULL; #if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII if (PyUnicode_IS_ASCII(o)) { *length = PyUnicode_GET_LENGTH(o); return PyUnicode_AsUTF8(o); } else { PyUnicode_AsASCIIString(o); return NULL; } #else return PyUnicode_AsUTF8AndSize(o, length); #endif #endif } else #endif #if (!CYTHON_COMPILING_IN_PYPY) || (defined(PyByteArray_AS_STRING) && defined(PyByteArray_GET_SIZE)) if (PyByteArray_Check(o)) { *length = PyByteArray_GET_SIZE(o); return PyByteArray_AS_STRING(o); } else #endif { char* result; int r = PyBytes_AsStringAndSize(o, &result, length); if (unlikely(r < 0)) { return NULL; } else { return result; } } } static CYTHON_INLINE int __Pyx_PyObject_IsTrue(PyObject* x) { int is_true = x == Py_True; if (is_true | (x == Py_False) | (x == Py_None)) return is_true; else return PyObject_IsTrue(x); } static CYTHON_INLINE PyObject* __Pyx_PyNumber_Int(PyObject* x) { PyNumberMethods *m; const char *name = NULL; PyObject *res = NULL; #if PY_MAJOR_VERSION < 3 if (PyInt_Check(x) || PyLong_Check(x)) #else if (PyLong_Check(x)) #endif return __Pyx_NewRef(x); m = Py_TYPE(x)->tp_as_number; #if PY_MAJOR_VERSION < 3 if (m && m->nb_int) { name = "int"; res = PyNumber_Int(x); } else if (m && m->nb_long) { name = "long"; res = PyNumber_Long(x); } #else if (m && m->nb_int) { name = "int"; res = PyNumber_Long(x); } #endif if (res) { #if PY_MAJOR_VERSION < 3 if (!PyInt_Check(res) && !PyLong_Check(res)) { #else if (!PyLong_Check(res)) { #endif PyErr_Format(PyExc_TypeError, "__%.4s__ returned non-%.4s (type %.200s)", name, name, Py_TYPE(res)->tp_name); Py_DECREF(res); return NULL; } } else if (!PyErr_Occurred()) { PyErr_SetString(PyExc_TypeError, "an integer is required"); } return res; } static CYTHON_INLINE Py_ssize_t __Pyx_PyIndex_AsSsize_t(PyObject* b) { Py_ssize_t ival; PyObject *x; #if PY_MAJOR_VERSION < 3 if (likely(PyInt_CheckExact(b))) { if (sizeof(Py_ssize_t) >= sizeof(long)) return PyInt_AS_LONG(b); else return PyInt_AsSsize_t(x); } #endif if (likely(PyLong_CheckExact(b))) { #if CYTHON_USE_PYLONG_INTERNALS const digit* digits = ((PyLongObject*)b)->ob_digit; const Py_ssize_t size = Py_SIZE(b); if (likely(__Pyx_sst_abs(size) <= 1)) { ival = likely(size) ? digits[0] : 0; if (size == -1) ival = -ival; return ival; } else { switch (size) { case 2: if (8 * sizeof(Py_ssize_t) > 2 * PyLong_SHIFT) { return (Py_ssize_t) (((((size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])); } break; case -2: if (8 * sizeof(Py_ssize_t) > 2 * PyLong_SHIFT) { return -(Py_ssize_t) (((((size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])); } break; case 3: if (8 * sizeof(Py_ssize_t) > 3 * PyLong_SHIFT) { return (Py_ssize_t) (((((((size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])); } break; case -3: if (8 * sizeof(Py_ssize_t) > 3 * PyLong_SHIFT) { return -(Py_ssize_t) (((((((size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])); } break; case 4: if (8 * sizeof(Py_ssize_t) > 4 * PyLong_SHIFT) { return (Py_ssize_t) (((((((((size_t)digits[3]) << PyLong_SHIFT) | (size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])); } break; case -4: if (8 * sizeof(Py_ssize_t) > 4 * PyLong_SHIFT) { return -(Py_ssize_t) (((((((((size_t)digits[3]) << PyLong_SHIFT) | (size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])); } break; } } #endif return PyLong_AsSsize_t(b); } x = PyNumber_Index(b); if (!x) return -1; ival = PyInt_AsSsize_t(x); Py_DECREF(x); return ival; } static CYTHON_INLINE PyObject * __Pyx_PyInt_FromSize_t(size_t ival) { return PyInt_FromSize_t(ival); } #endif /* Py_PYTHON_H */ pygame_sdl2-2.1.0-for-renpy-6.99.14.1/gen/pygame_sdl2.locals.c0000644000175000017500000151031213201703320022635 0ustar tomtom00000000000000/* Generated by Cython 0.23.5 */ #define PY_SSIZE_T_CLEAN #include "Python.h" #ifndef Py_PYTHON_H #error Python headers needed to compile C extensions, please install development version of Python. #elif PY_VERSION_HEX < 0x02060000 || (0x03000000 <= PY_VERSION_HEX && PY_VERSION_HEX < 0x03020000) #error Cython requires Python 2.6+ or Python 3.2+. #else #define CYTHON_ABI "0_23_5" #include #ifndef offsetof #define offsetof(type, member) ( (size_t) & ((type*)0) -> member ) #endif #if !defined(WIN32) && !defined(MS_WINDOWS) #ifndef __stdcall #define __stdcall #endif #ifndef __cdecl #define __cdecl #endif #ifndef __fastcall #define __fastcall #endif #endif #ifndef DL_IMPORT #define DL_IMPORT(t) t #endif #ifndef DL_EXPORT #define DL_EXPORT(t) t #endif #ifndef PY_LONG_LONG #define PY_LONG_LONG LONG_LONG #endif #ifndef Py_HUGE_VAL #define Py_HUGE_VAL HUGE_VAL #endif #ifdef PYPY_VERSION #define CYTHON_COMPILING_IN_PYPY 1 #define CYTHON_COMPILING_IN_CPYTHON 0 #else #define CYTHON_COMPILING_IN_PYPY 0 #define CYTHON_COMPILING_IN_CPYTHON 1 #endif #if !defined(CYTHON_USE_PYLONG_INTERNALS) && CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x02070000 #define CYTHON_USE_PYLONG_INTERNALS 1 #endif #if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX < 0x02070600 && !defined(Py_OptimizeFlag) #define Py_OptimizeFlag 0 #endif #define __PYX_BUILD_PY_SSIZE_T "n" #define CYTHON_FORMAT_SSIZE_T "z" #if PY_MAJOR_VERSION < 3 #define __Pyx_BUILTIN_MODULE_NAME "__builtin__" #define __Pyx_PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)\ PyCode_New(a+k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos) #define __Pyx_DefaultClassType PyClass_Type #else #define __Pyx_BUILTIN_MODULE_NAME "builtins" #define __Pyx_PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)\ PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos) #define __Pyx_DefaultClassType PyType_Type #endif #ifndef Py_TPFLAGS_CHECKTYPES #define Py_TPFLAGS_CHECKTYPES 0 #endif #ifndef Py_TPFLAGS_HAVE_INDEX #define Py_TPFLAGS_HAVE_INDEX 0 #endif #ifndef Py_TPFLAGS_HAVE_NEWBUFFER #define Py_TPFLAGS_HAVE_NEWBUFFER 0 #endif #ifndef Py_TPFLAGS_HAVE_FINALIZE #define Py_TPFLAGS_HAVE_FINALIZE 0 #endif #if PY_VERSION_HEX > 0x03030000 && defined(PyUnicode_KIND) #define CYTHON_PEP393_ENABLED 1 #define __Pyx_PyUnicode_READY(op) (likely(PyUnicode_IS_READY(op)) ?\ 0 : _PyUnicode_Ready((PyObject *)(op))) #define __Pyx_PyUnicode_GET_LENGTH(u) PyUnicode_GET_LENGTH(u) #define __Pyx_PyUnicode_READ_CHAR(u, i) PyUnicode_READ_CHAR(u, i) #define __Pyx_PyUnicode_KIND(u) PyUnicode_KIND(u) #define __Pyx_PyUnicode_DATA(u) PyUnicode_DATA(u) #define __Pyx_PyUnicode_READ(k, d, i) PyUnicode_READ(k, d, i) #else #define CYTHON_PEP393_ENABLED 0 #define __Pyx_PyUnicode_READY(op) (0) #define __Pyx_PyUnicode_GET_LENGTH(u) PyUnicode_GET_SIZE(u) #define __Pyx_PyUnicode_READ_CHAR(u, i) ((Py_UCS4)(PyUnicode_AS_UNICODE(u)[i])) #define __Pyx_PyUnicode_KIND(u) (sizeof(Py_UNICODE)) #define __Pyx_PyUnicode_DATA(u) ((void*)PyUnicode_AS_UNICODE(u)) #define __Pyx_PyUnicode_READ(k, d, i) ((void)(k), (Py_UCS4)(((Py_UNICODE*)d)[i])) #endif #if CYTHON_COMPILING_IN_PYPY #define __Pyx_PyUnicode_Concat(a, b) PyNumber_Add(a, b) #define __Pyx_PyUnicode_ConcatSafe(a, b) PyNumber_Add(a, b) #else #define __Pyx_PyUnicode_Concat(a, b) PyUnicode_Concat(a, b) #define __Pyx_PyUnicode_ConcatSafe(a, b) ((unlikely((a) == Py_None) || unlikely((b) == Py_None)) ?\ PyNumber_Add(a, b) : __Pyx_PyUnicode_Concat(a, b)) #endif #if CYTHON_COMPILING_IN_PYPY && !defined(PyUnicode_Contains) #define PyUnicode_Contains(u, s) PySequence_Contains(u, s) #endif #define __Pyx_PyString_FormatSafe(a, b) ((unlikely((a) == Py_None)) ? PyNumber_Remainder(a, b) : __Pyx_PyString_Format(a, b)) #define __Pyx_PyUnicode_FormatSafe(a, b) ((unlikely((a) == Py_None)) ? PyNumber_Remainder(a, b) : PyUnicode_Format(a, b)) #if PY_MAJOR_VERSION >= 3 #define __Pyx_PyString_Format(a, b) PyUnicode_Format(a, b) #else #define __Pyx_PyString_Format(a, b) PyString_Format(a, b) #endif #if PY_MAJOR_VERSION >= 3 #define PyBaseString_Type PyUnicode_Type #define PyStringObject PyUnicodeObject #define PyString_Type PyUnicode_Type #define PyString_Check PyUnicode_Check #define PyString_CheckExact PyUnicode_CheckExact #endif #if PY_MAJOR_VERSION >= 3 #define __Pyx_PyBaseString_Check(obj) PyUnicode_Check(obj) #define __Pyx_PyBaseString_CheckExact(obj) PyUnicode_CheckExact(obj) #else #define __Pyx_PyBaseString_Check(obj) (PyString_Check(obj) || PyUnicode_Check(obj)) #define __Pyx_PyBaseString_CheckExact(obj) (PyString_CheckExact(obj) || PyUnicode_CheckExact(obj)) #endif #ifndef PySet_CheckExact #define PySet_CheckExact(obj) (Py_TYPE(obj) == &PySet_Type) #endif #define __Pyx_TypeCheck(obj, type) PyObject_TypeCheck(obj, (PyTypeObject *)type) #if PY_MAJOR_VERSION >= 3 #define PyIntObject PyLongObject #define PyInt_Type PyLong_Type #define PyInt_Check(op) PyLong_Check(op) #define PyInt_CheckExact(op) PyLong_CheckExact(op) #define PyInt_FromString PyLong_FromString #define PyInt_FromUnicode PyLong_FromUnicode #define PyInt_FromLong PyLong_FromLong #define PyInt_FromSize_t PyLong_FromSize_t #define PyInt_FromSsize_t PyLong_FromSsize_t #define PyInt_AsLong PyLong_AsLong #define PyInt_AS_LONG PyLong_AS_LONG #define PyInt_AsSsize_t PyLong_AsSsize_t #define PyInt_AsUnsignedLongMask PyLong_AsUnsignedLongMask #define PyInt_AsUnsignedLongLongMask PyLong_AsUnsignedLongLongMask #define PyNumber_Int PyNumber_Long #endif #if PY_MAJOR_VERSION >= 3 #define PyBoolObject PyLongObject #endif #if PY_MAJOR_VERSION >= 3 && CYTHON_COMPILING_IN_PYPY #ifndef PyUnicode_InternFromString #define PyUnicode_InternFromString(s) PyUnicode_FromString(s) #endif #endif #if PY_VERSION_HEX < 0x030200A4 typedef long Py_hash_t; #define __Pyx_PyInt_FromHash_t PyInt_FromLong #define __Pyx_PyInt_AsHash_t PyInt_AsLong #else #define __Pyx_PyInt_FromHash_t PyInt_FromSsize_t #define __Pyx_PyInt_AsHash_t PyInt_AsSsize_t #endif #if PY_MAJOR_VERSION >= 3 #define __Pyx_PyMethod_New(func, self, klass) ((self) ? PyMethod_New(func, self) : PyInstanceMethod_New(func)) #else #define __Pyx_PyMethod_New(func, self, klass) PyMethod_New(func, self, klass) #endif #if PY_VERSION_HEX >= 0x030500B1 #define __Pyx_PyAsyncMethodsStruct PyAsyncMethods #define __Pyx_PyType_AsAsync(obj) (Py_TYPE(obj)->tp_as_async) #elif CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3 typedef struct { unaryfunc am_await; unaryfunc am_aiter; unaryfunc am_anext; } __Pyx_PyAsyncMethodsStruct; #define __Pyx_PyType_AsAsync(obj) ((__Pyx_PyAsyncMethodsStruct*) (Py_TYPE(obj)->tp_reserved)) #else #define __Pyx_PyType_AsAsync(obj) NULL #endif #ifndef CYTHON_RESTRICT #if defined(__GNUC__) #define CYTHON_RESTRICT __restrict__ #elif defined(_MSC_VER) && _MSC_VER >= 1400 #define CYTHON_RESTRICT __restrict #elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L #define CYTHON_RESTRICT restrict #else #define CYTHON_RESTRICT #endif #endif #define __Pyx_void_to_None(void_result) ((void)(void_result), Py_INCREF(Py_None), Py_None) #ifndef CYTHON_INLINE #if defined(__GNUC__) #define CYTHON_INLINE __inline__ #elif defined(_MSC_VER) #define CYTHON_INLINE __inline #elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L #define CYTHON_INLINE inline #else #define CYTHON_INLINE #endif #endif #if defined(WIN32) || defined(MS_WINDOWS) #define _USE_MATH_DEFINES #endif #include #ifdef NAN #define __PYX_NAN() ((float) NAN) #else static CYTHON_INLINE float __PYX_NAN() { float value; memset(&value, 0xFF, sizeof(value)); return value; } #endif #if PY_MAJOR_VERSION >= 3 #define __Pyx_PyNumber_Divide(x,y) PyNumber_TrueDivide(x,y) #define __Pyx_PyNumber_InPlaceDivide(x,y) PyNumber_InPlaceTrueDivide(x,y) #else #define __Pyx_PyNumber_Divide(x,y) PyNumber_Divide(x,y) #define __Pyx_PyNumber_InPlaceDivide(x,y) PyNumber_InPlaceDivide(x,y) #endif #ifndef __PYX_EXTERN_C #ifdef __cplusplus #define __PYX_EXTERN_C extern "C" #else #define __PYX_EXTERN_C extern #endif #endif #define __PYX_HAVE__pygame_sdl2__locals #define __PYX_HAVE_API__pygame_sdl2__locals #include "stdint.h" #include "string.h" #include "stdio.h" #include "stddef.h" #include "SDL.h" #ifdef _OPENMP #include #endif /* _OPENMP */ #ifdef PYREX_WITHOUT_ASSERTIONS #define CYTHON_WITHOUT_ASSERTIONS #endif #ifndef CYTHON_UNUSED # if defined(__GNUC__) # if !(defined(__cplusplus)) || (__GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 4)) # define CYTHON_UNUSED __attribute__ ((__unused__)) # else # define CYTHON_UNUSED # endif # elif defined(__ICC) || (defined(__INTEL_COMPILER) && !defined(_MSC_VER)) # define CYTHON_UNUSED __attribute__ ((__unused__)) # else # define CYTHON_UNUSED # endif #endif #ifndef CYTHON_NCP_UNUSED # if CYTHON_COMPILING_IN_CPYTHON # define CYTHON_NCP_UNUSED # else # define CYTHON_NCP_UNUSED CYTHON_UNUSED # endif #endif typedef struct {PyObject **p; char *s; const Py_ssize_t n; const char* encoding; const char is_unicode; const char is_str; const char intern; } __Pyx_StringTabEntry; #define __PYX_DEFAULT_STRING_ENCODING_IS_ASCII 0 #define __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT 0 #define __PYX_DEFAULT_STRING_ENCODING "" #define __Pyx_PyObject_FromString __Pyx_PyBytes_FromString #define __Pyx_PyObject_FromStringAndSize __Pyx_PyBytes_FromStringAndSize #define __Pyx_uchar_cast(c) ((unsigned char)c) #define __Pyx_long_cast(x) ((long)x) #define __Pyx_fits_Py_ssize_t(v, type, is_signed) (\ (sizeof(type) < sizeof(Py_ssize_t)) ||\ (sizeof(type) > sizeof(Py_ssize_t) &&\ likely(v < (type)PY_SSIZE_T_MAX ||\ v == (type)PY_SSIZE_T_MAX) &&\ (!is_signed || likely(v > (type)PY_SSIZE_T_MIN ||\ v == (type)PY_SSIZE_T_MIN))) ||\ (sizeof(type) == sizeof(Py_ssize_t) &&\ (is_signed || likely(v < (type)PY_SSIZE_T_MAX ||\ v == (type)PY_SSIZE_T_MAX))) ) #if defined (__cplusplus) && __cplusplus >= 201103L #include #define __Pyx_sst_abs(value) std::abs(value) #elif SIZEOF_INT >= SIZEOF_SIZE_T #define __Pyx_sst_abs(value) abs(value) #elif SIZEOF_LONG >= SIZEOF_SIZE_T #define __Pyx_sst_abs(value) labs(value) #elif defined (_MSC_VER) && defined (_M_X64) #define __Pyx_sst_abs(value) _abs64(value) #elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L #define __Pyx_sst_abs(value) llabs(value) #elif defined (__GNUC__) #define __Pyx_sst_abs(value) __builtin_llabs(value) #else #define __Pyx_sst_abs(value) ((value<0) ? -value : value) #endif static CYTHON_INLINE char* __Pyx_PyObject_AsString(PyObject*); static CYTHON_INLINE char* __Pyx_PyObject_AsStringAndSize(PyObject*, Py_ssize_t* length); #define __Pyx_PyByteArray_FromString(s) PyByteArray_FromStringAndSize((const char*)s, strlen((const char*)s)) #define __Pyx_PyByteArray_FromStringAndSize(s, l) PyByteArray_FromStringAndSize((const char*)s, l) #define __Pyx_PyBytes_FromString PyBytes_FromString #define __Pyx_PyBytes_FromStringAndSize PyBytes_FromStringAndSize static CYTHON_INLINE PyObject* __Pyx_PyUnicode_FromString(const char*); #if PY_MAJOR_VERSION < 3 #define __Pyx_PyStr_FromString __Pyx_PyBytes_FromString #define __Pyx_PyStr_FromStringAndSize __Pyx_PyBytes_FromStringAndSize #else #define __Pyx_PyStr_FromString __Pyx_PyUnicode_FromString #define __Pyx_PyStr_FromStringAndSize __Pyx_PyUnicode_FromStringAndSize #endif #define __Pyx_PyObject_AsSString(s) ((signed char*) __Pyx_PyObject_AsString(s)) #define __Pyx_PyObject_AsUString(s) ((unsigned char*) __Pyx_PyObject_AsString(s)) #define __Pyx_PyObject_FromCString(s) __Pyx_PyObject_FromString((const char*)s) #define __Pyx_PyBytes_FromCString(s) __Pyx_PyBytes_FromString((const char*)s) #define __Pyx_PyByteArray_FromCString(s) __Pyx_PyByteArray_FromString((const char*)s) #define __Pyx_PyStr_FromCString(s) __Pyx_PyStr_FromString((const char*)s) #define __Pyx_PyUnicode_FromCString(s) __Pyx_PyUnicode_FromString((const char*)s) #if PY_MAJOR_VERSION < 3 static CYTHON_INLINE size_t __Pyx_Py_UNICODE_strlen(const Py_UNICODE *u) { const Py_UNICODE *u_end = u; while (*u_end++) ; return (size_t)(u_end - u - 1); } #else #define __Pyx_Py_UNICODE_strlen Py_UNICODE_strlen #endif #define __Pyx_PyUnicode_FromUnicode(u) PyUnicode_FromUnicode(u, __Pyx_Py_UNICODE_strlen(u)) #define __Pyx_PyUnicode_FromUnicodeAndLength PyUnicode_FromUnicode #define __Pyx_PyUnicode_AsUnicode PyUnicode_AsUnicode #define __Pyx_NewRef(obj) (Py_INCREF(obj), obj) #define __Pyx_Owned_Py_None(b) __Pyx_NewRef(Py_None) #define __Pyx_PyBool_FromLong(b) ((b) ? __Pyx_NewRef(Py_True) : __Pyx_NewRef(Py_False)) static CYTHON_INLINE int __Pyx_PyObject_IsTrue(PyObject*); static CYTHON_INLINE PyObject* __Pyx_PyNumber_Int(PyObject* x); static CYTHON_INLINE Py_ssize_t __Pyx_PyIndex_AsSsize_t(PyObject*); static CYTHON_INLINE PyObject * __Pyx_PyInt_FromSize_t(size_t); #if CYTHON_COMPILING_IN_CPYTHON #define __pyx_PyFloat_AsDouble(x) (PyFloat_CheckExact(x) ? PyFloat_AS_DOUBLE(x) : PyFloat_AsDouble(x)) #else #define __pyx_PyFloat_AsDouble(x) PyFloat_AsDouble(x) #endif #define __pyx_PyFloat_AsFloat(x) ((float) __pyx_PyFloat_AsDouble(x)) #if PY_MAJOR_VERSION < 3 && __PYX_DEFAULT_STRING_ENCODING_IS_ASCII static int __Pyx_sys_getdefaultencoding_not_ascii; static int __Pyx_init_sys_getdefaultencoding_params(void) { PyObject* sys; PyObject* default_encoding = NULL; PyObject* ascii_chars_u = NULL; PyObject* ascii_chars_b = NULL; const char* default_encoding_c; sys = PyImport_ImportModule("sys"); if (!sys) goto bad; default_encoding = PyObject_CallMethod(sys, (char*) "getdefaultencoding", NULL); Py_DECREF(sys); if (!default_encoding) goto bad; default_encoding_c = PyBytes_AsString(default_encoding); if (!default_encoding_c) goto bad; if (strcmp(default_encoding_c, "ascii") == 0) { __Pyx_sys_getdefaultencoding_not_ascii = 0; } else { char ascii_chars[128]; int c; for (c = 0; c < 128; c++) { ascii_chars[c] = c; } __Pyx_sys_getdefaultencoding_not_ascii = 1; ascii_chars_u = PyUnicode_DecodeASCII(ascii_chars, 128, NULL); if (!ascii_chars_u) goto bad; ascii_chars_b = PyUnicode_AsEncodedString(ascii_chars_u, default_encoding_c, NULL); if (!ascii_chars_b || !PyBytes_Check(ascii_chars_b) || memcmp(ascii_chars, PyBytes_AS_STRING(ascii_chars_b), 128) != 0) { PyErr_Format( PyExc_ValueError, "This module compiled with c_string_encoding=ascii, but default encoding '%.200s' is not a superset of ascii.", default_encoding_c); goto bad; } Py_DECREF(ascii_chars_u); Py_DECREF(ascii_chars_b); } Py_DECREF(default_encoding); return 0; bad: Py_XDECREF(default_encoding); Py_XDECREF(ascii_chars_u); Py_XDECREF(ascii_chars_b); return -1; } #endif #if __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT && PY_MAJOR_VERSION >= 3 #define __Pyx_PyUnicode_FromStringAndSize(c_str, size) PyUnicode_DecodeUTF8(c_str, size, NULL) #else #define __Pyx_PyUnicode_FromStringAndSize(c_str, size) PyUnicode_Decode(c_str, size, __PYX_DEFAULT_STRING_ENCODING, NULL) #if __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT static char* __PYX_DEFAULT_STRING_ENCODING; static int __Pyx_init_sys_getdefaultencoding_params(void) { PyObject* sys; PyObject* default_encoding = NULL; char* default_encoding_c; sys = PyImport_ImportModule("sys"); if (!sys) goto bad; default_encoding = PyObject_CallMethod(sys, (char*) (const char*) "getdefaultencoding", NULL); Py_DECREF(sys); if (!default_encoding) goto bad; default_encoding_c = PyBytes_AsString(default_encoding); if (!default_encoding_c) goto bad; __PYX_DEFAULT_STRING_ENCODING = (char*) malloc(strlen(default_encoding_c)); if (!__PYX_DEFAULT_STRING_ENCODING) goto bad; strcpy(__PYX_DEFAULT_STRING_ENCODING, default_encoding_c); Py_DECREF(default_encoding); return 0; bad: Py_XDECREF(default_encoding); return -1; } #endif #endif /* Test for GCC > 2.95 */ #if defined(__GNUC__) && (__GNUC__ > 2 || (__GNUC__ == 2 && (__GNUC_MINOR__ > 95))) #define likely(x) __builtin_expect(!!(x), 1) #define unlikely(x) __builtin_expect(!!(x), 0) #else /* !__GNUC__ or GCC < 2.95 */ #define likely(x) (x) #define unlikely(x) (x) #endif /* __GNUC__ */ static PyObject *__pyx_m; static PyObject *__pyx_d; static PyObject *__pyx_b; static PyObject *__pyx_empty_tuple; static PyObject *__pyx_empty_bytes; static int __pyx_lineno; static int __pyx_clineno = 0; static const char * __pyx_cfilenm= __FILE__; static const char *__pyx_filename; static const char *__pyx_f[] = { "src/pygame_sdl2/locals.pyx", "include/event_list.pxi", "include/keycode_list.pxi", "include/glattr.pxi", "include/controller.pxi", }; /*--- Type declarations ---*/ /* --- Runtime support code (head) --- */ #ifndef CYTHON_REFNANNY #define CYTHON_REFNANNY 0 #endif #if CYTHON_REFNANNY typedef struct { void (*INCREF)(void*, PyObject*, int); void (*DECREF)(void*, PyObject*, int); void (*GOTREF)(void*, PyObject*, int); void (*GIVEREF)(void*, PyObject*, int); void* (*SetupContext)(const char*, int, const char*); void (*FinishContext)(void**); } __Pyx_RefNannyAPIStruct; static __Pyx_RefNannyAPIStruct *__Pyx_RefNanny = NULL; static __Pyx_RefNannyAPIStruct *__Pyx_RefNannyImportAPI(const char *modname); #define __Pyx_RefNannyDeclarations void *__pyx_refnanny = NULL; #ifdef WITH_THREAD #define __Pyx_RefNannySetupContext(name, acquire_gil)\ if (acquire_gil) {\ PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure();\ __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), __LINE__, __FILE__);\ PyGILState_Release(__pyx_gilstate_save);\ } else {\ __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), __LINE__, __FILE__);\ } #else #define __Pyx_RefNannySetupContext(name, acquire_gil)\ __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), __LINE__, __FILE__) #endif #define __Pyx_RefNannyFinishContext()\ __Pyx_RefNanny->FinishContext(&__pyx_refnanny) #define __Pyx_INCREF(r) __Pyx_RefNanny->INCREF(__pyx_refnanny, (PyObject *)(r), __LINE__) #define __Pyx_DECREF(r) __Pyx_RefNanny->DECREF(__pyx_refnanny, (PyObject *)(r), __LINE__) #define __Pyx_GOTREF(r) __Pyx_RefNanny->GOTREF(__pyx_refnanny, (PyObject *)(r), __LINE__) #define __Pyx_GIVEREF(r) __Pyx_RefNanny->GIVEREF(__pyx_refnanny, (PyObject *)(r), __LINE__) #define __Pyx_XINCREF(r) do { if((r) != NULL) {__Pyx_INCREF(r); }} while(0) #define __Pyx_XDECREF(r) do { if((r) != NULL) {__Pyx_DECREF(r); }} while(0) #define __Pyx_XGOTREF(r) do { if((r) != NULL) {__Pyx_GOTREF(r); }} while(0) #define __Pyx_XGIVEREF(r) do { if((r) != NULL) {__Pyx_GIVEREF(r);}} while(0) #else #define __Pyx_RefNannyDeclarations #define __Pyx_RefNannySetupContext(name, acquire_gil) #define __Pyx_RefNannyFinishContext() #define __Pyx_INCREF(r) Py_INCREF(r) #define __Pyx_DECREF(r) Py_DECREF(r) #define __Pyx_GOTREF(r) #define __Pyx_GIVEREF(r) #define __Pyx_XINCREF(r) Py_XINCREF(r) #define __Pyx_XDECREF(r) Py_XDECREF(r) #define __Pyx_XGOTREF(r) #define __Pyx_XGIVEREF(r) #endif #define __Pyx_XDECREF_SET(r, v) do {\ PyObject *tmp = (PyObject *) r;\ r = v; __Pyx_XDECREF(tmp);\ } while (0) #define __Pyx_DECREF_SET(r, v) do {\ PyObject *tmp = (PyObject *) r;\ r = v; __Pyx_DECREF(tmp);\ } while (0) #define __Pyx_CLEAR(r) do { PyObject* tmp = ((PyObject*)(r)); r = NULL; __Pyx_DECREF(tmp);} while(0) #define __Pyx_XCLEAR(r) do { if((r) != NULL) {PyObject* tmp = ((PyObject*)(r)); r = NULL; __Pyx_DECREF(tmp);}} while(0) #if CYTHON_COMPILING_IN_CPYTHON static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStr(PyObject* obj, PyObject* attr_name) { PyTypeObject* tp = Py_TYPE(obj); if (likely(tp->tp_getattro)) return tp->tp_getattro(obj, attr_name); #if PY_MAJOR_VERSION < 3 if (likely(tp->tp_getattr)) return tp->tp_getattr(obj, PyString_AS_STRING(attr_name)); #endif return PyObject_GetAttr(obj, attr_name); } #else #define __Pyx_PyObject_GetAttrStr(o,n) PyObject_GetAttr(o,n) #endif static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list, int level); static PyObject* __Pyx_ImportFrom(PyObject* module, PyObject* name); static CYTHON_INLINE PyObject *__Pyx_GetAttr(PyObject *, PyObject *); static PyObject* __Pyx_Globals(void); #if CYTHON_COMPILING_IN_CPYTHON static CYTHON_INLINE PyObject* __Pyx_PyObject_Call(PyObject *func, PyObject *arg, PyObject *kw); #else #define __Pyx_PyObject_Call(func, arg, kw) PyObject_Call(func, arg, kw) #endif #if CYTHON_COMPILING_IN_CPYTHON static CYTHON_INLINE PyObject* __Pyx_PyObject_CallMethO(PyObject *func, PyObject *arg); #endif static CYTHON_INLINE PyObject* __Pyx_PyObject_CallOneArg(PyObject *func, PyObject *arg); typedef struct { int code_line; PyCodeObject* code_object; } __Pyx_CodeObjectCacheEntry; struct __Pyx_CodeObjectCache { int count; int max_count; __Pyx_CodeObjectCacheEntry* entries; }; static struct __Pyx_CodeObjectCache __pyx_code_cache = {0,0,NULL}; static int __pyx_bisect_code_objects(__Pyx_CodeObjectCacheEntry* entries, int count, int code_line); static PyCodeObject *__pyx_find_code_object(int code_line); static void __pyx_insert_code_object(int code_line, PyCodeObject* code_object); static void __Pyx_AddTraceback(const char *funcname, int c_line, int py_line, const char *filename); static CYTHON_INLINE PyObject* __Pyx_PyInt_From_SDL_EventType(SDL_EventType value); static CYTHON_INLINE PyObject* __Pyx_PyInt_From_long(long value); static CYTHON_INLINE PyObject* __Pyx_PyInt_From_int(int value); static CYTHON_INLINE PyObject* __Pyx_PyInt_From_SDL_GLattr(SDL_GLattr value); static CYTHON_INLINE PyObject* __Pyx_PyInt_From_SDL_WindowFlags(SDL_WindowFlags value); static CYTHON_INLINE PyObject* __Pyx_PyInt_From_SDL_Keymod(SDL_Keymod value); static CYTHON_INLINE PyObject* __Pyx_PyInt_From_SDL_GameControllerButton(SDL_GameControllerButton value); static CYTHON_INLINE PyObject* __Pyx_PyInt_From_SDL_GameControllerAxis(SDL_GameControllerAxis value); static CYTHON_INLINE PyObject* __Pyx_PyInt_From_SDL_PowerState(SDL_PowerState value); static CYTHON_INLINE long __Pyx_PyInt_As_long(PyObject *); static CYTHON_INLINE int __Pyx_PyInt_As_int(PyObject *); static int __Pyx_check_binary_version(void); static int __Pyx_InitStrings(__Pyx_StringTabEntry *t); /* Module declarations from 'libc.stdint' */ /* Module declarations from 'libc.string' */ /* Module declarations from 'libc.stdio' */ /* Module declarations from 'libc.stddef' */ /* Module declarations from 'sdl2' */ /* Module declarations from 'pygame_sdl2.locals' */ #define __Pyx_MODULE_NAME "pygame_sdl2.locals" int __pyx_module_is_main_pygame_sdl2__locals = 0; /* Implementation of 'pygame_sdl2.locals' */ static char __pyx_k_K_0[] = "K_0"; static char __pyx_k_K_1[] = "K_1"; static char __pyx_k_K_2[] = "K_2"; static char __pyx_k_K_3[] = "K_3"; static char __pyx_k_K_4[] = "K_4"; static char __pyx_k_K_5[] = "K_5"; static char __pyx_k_K_6[] = "K_6"; static char __pyx_k_K_7[] = "K_7"; static char __pyx_k_K_8[] = "K_8"; static char __pyx_k_K_9[] = "K_9"; static char __pyx_k_K_a[] = "K_a"; static char __pyx_k_K_b[] = "K_b"; static char __pyx_k_K_c[] = "K_c"; static char __pyx_k_K_d[] = "K_d"; static char __pyx_k_K_e[] = "K_e"; static char __pyx_k_K_f[] = "K_f"; static char __pyx_k_K_g[] = "K_g"; static char __pyx_k_K_h[] = "K_h"; static char __pyx_k_K_i[] = "K_i"; static char __pyx_k_K_j[] = "K_j"; static char __pyx_k_K_k[] = "K_k"; static char __pyx_k_K_l[] = "K_l"; static char __pyx_k_K_m[] = "K_m"; static char __pyx_k_K_n[] = "K_n"; static char __pyx_k_K_o[] = "K_o"; static char __pyx_k_K_p[] = "K_p"; static char __pyx_k_K_q[] = "K_q"; static char __pyx_k_K_r[] = "K_r"; static char __pyx_k_K_s[] = "K_s"; static char __pyx_k_K_t[] = "K_t"; static char __pyx_k_K_u[] = "K_u"; static char __pyx_k_K_v[] = "K_v"; static char __pyx_k_K_w[] = "K_w"; static char __pyx_k_K_x[] = "K_x"; static char __pyx_k_K_y[] = "K_y"; static char __pyx_k_K_z[] = "K_z"; static char __pyx_k_K_AT[] = "K_AT"; static char __pyx_k_K_F1[] = "K_F1"; static char __pyx_k_K_F2[] = "K_F2"; static char __pyx_k_K_F3[] = "K_F3"; static char __pyx_k_K_F4[] = "K_F4"; static char __pyx_k_K_F5[] = "K_F5"; static char __pyx_k_K_F6[] = "K_F6"; static char __pyx_k_K_F7[] = "K_F7"; static char __pyx_k_K_F8[] = "K_F8"; static char __pyx_k_K_F9[] = "K_F9"; static char __pyx_k_K_UP[] = "K_UP"; static char __pyx_k_QUIT[] = "QUIT"; static char __pyx_k_Rect[] = "Rect"; static char __pyx_k_main[] = "__main__"; static char __pyx_k_test[] = "__test__"; static char __pyx_k_Color[] = "Color"; static char __pyx_k_KEYUP[] = "KEYUP"; static char __pyx_k_K_CUT[] = "K_CUT"; static char __pyx_k_K_END[] = "K_END"; static char __pyx_k_K_F10[] = "K_F10"; static char __pyx_k_K_F11[] = "K_F11"; static char __pyx_k_K_F12[] = "K_F12"; static char __pyx_k_K_F13[] = "K_F13"; static char __pyx_k_K_F14[] = "K_F14"; static char __pyx_k_K_F15[] = "K_F15"; static char __pyx_k_K_F16[] = "K_F16"; static char __pyx_k_K_F17[] = "K_F17"; static char __pyx_k_K_F18[] = "K_F18"; static char __pyx_k_K_F19[] = "K_F19"; static char __pyx_k_K_F20[] = "K_F20"; static char __pyx_k_K_F21[] = "K_F21"; static char __pyx_k_K_F22[] = "K_F22"; static char __pyx_k_K_F23[] = "K_F23"; static char __pyx_k_K_F24[] = "K_F24"; static char __pyx_k_K_KP0[] = "K_KP0"; static char __pyx_k_K_KP1[] = "K_KP1"; static char __pyx_k_K_KP2[] = "K_KP2"; static char __pyx_k_K_KP3[] = "K_KP3"; static char __pyx_k_K_KP4[] = "K_KP4"; static char __pyx_k_K_KP5[] = "K_KP5"; static char __pyx_k_K_KP6[] = "K_KP6"; static char __pyx_k_K_KP7[] = "K_KP7"; static char __pyx_k_K_KP8[] = "K_KP8"; static char __pyx_k_K_KP9[] = "K_KP9"; static char __pyx_k_K_OUT[] = "K_OUT"; static char __pyx_k_K_TAB[] = "K_TAB"; static char __pyx_k_K_WWW[] = "K_WWW"; static char __pyx_k_K_COPY[] = "K_COPY"; static char __pyx_k_K_DOWN[] = "K_DOWN"; static char __pyx_k_K_EURO[] = "K_EURO"; static char __pyx_k_K_FIND[] = "K_FIND"; static char __pyx_k_K_HASH[] = "K_HASH"; static char __pyx_k_K_HELP[] = "K_HELP"; static char __pyx_k_K_HOME[] = "K_HOME"; static char __pyx_k_K_KP_0[] = "K_KP_0"; static char __pyx_k_K_KP_1[] = "K_KP_1"; static char __pyx_k_K_KP_2[] = "K_KP_2"; static char __pyx_k_K_KP_3[] = "K_KP_3"; static char __pyx_k_K_KP_4[] = "K_KP_4"; static char __pyx_k_K_KP_5[] = "K_KP_5"; static char __pyx_k_K_KP_6[] = "K_KP_6"; static char __pyx_k_K_KP_7[] = "K_KP_7"; static char __pyx_k_K_KP_8[] = "K_KP_8"; static char __pyx_k_K_KP_9[] = "K_KP_9"; static char __pyx_k_K_KP_A[] = "K_KP_A"; static char __pyx_k_K_KP_B[] = "K_KP_B"; static char __pyx_k_K_KP_C[] = "K_KP_C"; static char __pyx_k_K_KP_D[] = "K_KP_D"; static char __pyx_k_K_KP_E[] = "K_KP_E"; static char __pyx_k_K_KP_F[] = "K_KP_F"; static char __pyx_k_K_LALT[] = "K_LALT"; static char __pyx_k_K_LAST[] = "K_LAST"; static char __pyx_k_K_LEFT[] = "K_LEFT"; static char __pyx_k_K_LESS[] = "K_LESS"; static char __pyx_k_K_LGUI[] = "K_LGUI"; static char __pyx_k_K_MAIL[] = "K_MAIL"; static char __pyx_k_K_MENU[] = "K_MENU"; static char __pyx_k_K_MODE[] = "K_MODE"; static char __pyx_k_K_MUTE[] = "K_MUTE"; static char __pyx_k_K_OPER[] = "K_OPER"; static char __pyx_k_K_PLUS[] = "K_PLUS"; static char __pyx_k_K_RALT[] = "K_RALT"; static char __pyx_k_K_RGUI[] = "K_RGUI"; static char __pyx_k_K_STOP[] = "K_STOP"; static char __pyx_k_K_UNDO[] = "K_UNDO"; static char __pyx_k_OPENGL[] = "OPENGL"; static char __pyx_k_import[] = "__import__"; static char __pyx_k_update[] = "update"; static char __pyx_k_KEYDOWN[] = "KEYDOWN"; static char __pyx_k_K_AGAIN[] = "K_AGAIN"; static char __pyx_k_K_BREAK[] = "K_BREAK"; static char __pyx_k_K_CARET[] = "K_CARET"; static char __pyx_k_K_CLEAR[] = "K_CLEAR"; static char __pyx_k_K_COLON[] = "K_COLON"; static char __pyx_k_K_COMMA[] = "K_COMMA"; static char __pyx_k_K_CRSEL[] = "K_CRSEL"; static char __pyx_k_K_EJECT[] = "K_EJECT"; static char __pyx_k_K_EXSEL[] = "K_EXSEL"; static char __pyx_k_K_FIRST[] = "K_FIRST"; static char __pyx_k_K_KP_00[] = "K_KP_00"; static char __pyx_k_K_KP_AT[] = "K_KP_AT"; static char __pyx_k_K_LCTRL[] = "K_LCTRL"; static char __pyx_k_K_LMETA[] = "K_LMETA"; static char __pyx_k_K_MINUS[] = "K_MINUS"; static char __pyx_k_K_PASTE[] = "K_PASTE"; static char __pyx_k_K_PAUSE[] = "K_PAUSE"; static char __pyx_k_K_POWER[] = "K_POWER"; static char __pyx_k_K_PRINT[] = "K_PRINT"; static char __pyx_k_K_PRIOR[] = "K_PRIOR"; static char __pyx_k_K_QUOTE[] = "K_QUOTE"; static char __pyx_k_K_RCTRL[] = "K_RCTRL"; static char __pyx_k_K_RIGHT[] = "K_RIGHT"; static char __pyx_k_K_RMETA[] = "K_RMETA"; static char __pyx_k_K_SLASH[] = "K_SLASH"; static char __pyx_k_K_SLEEP[] = "K_SLEEP"; static char __pyx_k_K_SPACE[] = "K_SPACE"; static char __pyx_k_NOEVENT[] = "NOEVENT"; static char __pyx_k_NOFRAME[] = "NOFRAME"; static char __pyx_k_DROPFILE[] = "DROPFILE"; static char __pyx_k_FINGERUP[] = "FINGERUP"; static char __pyx_k_KMOD_ALT[] = "KMOD_ALT"; static char __pyx_k_KMOD_GUI[] = "KMOD_GUI"; static char __pyx_k_KMOD_NUM[] = "KMOD_NUM"; static char __pyx_k_K_CANCEL[] = "K_CANCEL"; static char __pyx_k_K_DELETE[] = "K_DELETE"; static char __pyx_k_K_DOLLAR[] = "K_DOLLAR"; static char __pyx_k_K_EQUALS[] = "K_EQUALS"; static char __pyx_k_K_ESCAPE[] = "K_ESCAPE"; static char __pyx_k_K_INSERT[] = "K_INSERT"; static char __pyx_k_K_KP_000[] = "K_KP_000"; static char __pyx_k_K_KP_TAB[] = "K_KP_TAB"; static char __pyx_k_K_KP_XOR[] = "K_KP_XOR"; static char __pyx_k_K_LSHIFT[] = "K_LSHIFT"; static char __pyx_k_K_LSUPER[] = "K_LSUPER"; static char __pyx_k_K_PAGEUP[] = "K_PAGEUP"; static char __pyx_k_K_PERIOD[] = "K_PERIOD"; static char __pyx_k_K_RETURN[] = "K_RETURN"; static char __pyx_k_K_RSHIFT[] = "K_RSHIFT"; static char __pyx_k_K_RSUPER[] = "K_RSUPER"; static char __pyx_k_K_SELECT[] = "K_SELECT"; static char __pyx_k_K_SYSREQ[] = "K_SYSREQ"; static char __pyx_k_RLEACCEL[] = "RLEACCEL"; static char __pyx_k_SRCALPHA[] = "SRCALPHA"; static char __pyx_k_BLEND_ADD[] = "BLEND_ADD"; static char __pyx_k_BLEND_MAX[] = "BLEND_MAX"; static char __pyx_k_BLEND_MIN[] = "BLEND_MIN"; static char __pyx_k_BLEND_SUB[] = "BLEND_SUB"; static char __pyx_k_BYTEORDER[] = "BYTEORDER"; static char __pyx_k_DOUBLEBUF[] = "DOUBLEBUF"; static char __pyx_k_GL_STEREO[] = "GL_STEREO"; static char __pyx_k_HWSURFACE[] = "HWSURFACE"; static char __pyx_k_KMOD_CAPS[] = "KMOD_CAPS"; static char __pyx_k_KMOD_CTRL[] = "KMOD_CTRL"; static char __pyx_k_KMOD_LALT[] = "KMOD_LALT"; static char __pyx_k_KMOD_LGUI[] = "KMOD_LGUI"; static char __pyx_k_KMOD_META[] = "KMOD_META"; static char __pyx_k_KMOD_MODE[] = "KMOD_MODE"; static char __pyx_k_KMOD_NONE[] = "KMOD_NONE"; static char __pyx_k_KMOD_RALT[] = "KMOD_RALT"; static char __pyx_k_KMOD_RGUI[] = "KMOD_RGUI"; static char __pyx_k_K_AC_BACK[] = "K_AC_BACK"; static char __pyx_k_K_AC_HOME[] = "K_AC_HOME"; static char __pyx_k_K_AC_STOP[] = "K_AC_STOP"; static char __pyx_k_K_EXCLAIM[] = "K_EXCLAIM"; static char __pyx_k_K_EXECUTE[] = "K_EXECUTE"; static char __pyx_k_K_GREATER[] = "K_GREATER"; static char __pyx_k_K_KP_HASH[] = "K_KP_HASH"; static char __pyx_k_K_KP_LESS[] = "K_KP_LESS"; static char __pyx_k_K_KP_PLUS[] = "K_KP_PLUS"; static char __pyx_k_K_NUMLOCK[] = "K_NUMLOCK"; static char __pyx_k_K_PERCENT[] = "K_PERCENT"; static char __pyx_k_K_RETURN2[] = "K_RETURN2"; static char __pyx_k_K_UNKNOWN[] = "K_UNKNOWN"; static char __pyx_k_LASTEVENT[] = "LASTEVENT"; static char __pyx_k_RESIZABLE[] = "RESIZABLE"; static char __pyx_k_SWSURFACE[] = "SWSURFACE"; static char __pyx_k_TEXTINPUT[] = "TEXTINPUT"; static char __pyx_k_USEREVENT[] = "USEREVENT"; static char __pyx_k_BIG_ENDIAN[] = "BIG_ENDIAN"; static char __pyx_k_BLEND_MULT[] = "BLEND_MULT"; static char __pyx_k_FINGERDOWN[] = "FINGERDOWN"; static char __pyx_k_FULLSCREEN[] = "FULLSCREEN"; static char __pyx_k_KMOD_LCTRL[] = "KMOD_LCTRL"; static char __pyx_k_KMOD_LMETA[] = "KMOD_LMETA"; static char __pyx_k_KMOD_RCTRL[] = "KMOD_RCTRL"; static char __pyx_k_KMOD_RMETA[] = "KMOD_RMETA"; static char __pyx_k_KMOD_SHIFT[] = "KMOD_SHIFT"; static char __pyx_k_K_ALTERASE[] = "K_ALTERASE"; static char __pyx_k_K_ASTERISK[] = "K_ASTERISK"; static char __pyx_k_K_CAPSLOCK[] = "K_CAPSLOCK"; static char __pyx_k_K_COMPUTER[] = "K_COMPUTER"; static char __pyx_k_K_KP_CLEAR[] = "K_KP_CLEAR"; static char __pyx_k_K_KP_COLON[] = "K_KP_COLON"; static char __pyx_k_K_KP_COMMA[] = "K_KP_COMMA"; static char __pyx_k_K_KP_ENTER[] = "K_KP_ENTER"; static char __pyx_k_K_KP_MINUS[] = "K_KP_MINUS"; static char __pyx_k_K_KP_OCTAL[] = "K_KP_OCTAL"; static char __pyx_k_K_KP_POWER[] = "K_KP_POWER"; static char __pyx_k_K_KP_SPACE[] = "K_KP_SPACE"; static char __pyx_k_K_PAGEDOWN[] = "K_PAGEDOWN"; static char __pyx_k_K_QUESTION[] = "K_QUESTION"; static char __pyx_k_K_QUOTEDBL[] = "K_QUOTEDBL"; static char __pyx_k_K_VOLUMEUP[] = "K_VOLUMEUP"; static char __pyx_k_LIL_ENDIAN[] = "LIL_ENDIAN"; static char __pyx_k_MOUSEWHEEL[] = "MOUSEWHEEL"; static char __pyx_k_SCRAP_TEXT[] = "SCRAP_TEXT"; static char __pyx_k_SYSWMEVENT[] = "SYSWMEVENT"; static char __pyx_k_text_plain[] = "text/plain"; static char __pyx_k_ACTIVEEVENT[] = "ACTIVEEVENT"; static char __pyx_k_GL_RED_SIZE[] = "GL_RED_SIZE"; static char __pyx_k_JOYBUTTONUP[] = "JOYBUTTONUP"; static char __pyx_k_KMOD_LSHIFT[] = "KMOD_LSHIFT"; static char __pyx_k_KMOD_RSHIFT[] = "KMOD_RSHIFT"; static char __pyx_k_K_AC_SEARCH[] = "K_AC_SEARCH"; static char __pyx_k_K_AMPERSAND[] = "K_AMPERSAND"; static char __pyx_k_K_AUDIOMUTE[] = "K_AUDIOMUTE"; static char __pyx_k_K_AUDIONEXT[] = "K_AUDIONEXT"; static char __pyx_k_K_AUDIOPLAY[] = "K_AUDIOPLAY"; static char __pyx_k_K_AUDIOPREV[] = "K_AUDIOPREV"; static char __pyx_k_K_AUDIOSTOP[] = "K_AUDIOSTOP"; static char __pyx_k_K_BACKQUOTE[] = "K_BACKQUOTE"; static char __pyx_k_K_BACKSLASH[] = "K_BACKSLASH"; static char __pyx_k_K_BACKSPACE[] = "K_BACKSPACE"; static char __pyx_k_K_KP_BINARY[] = "K_KP_BINARY"; static char __pyx_k_K_KP_DIVIDE[] = "K_KP_DIVIDE"; static char __pyx_k_K_KP_EQUALS[] = "K_KP_EQUALS"; static char __pyx_k_K_KP_EXCLAM[] = "K_KP_EXCLAM"; static char __pyx_k_K_KP_MEMADD[] = "K_KP_MEMADD"; static char __pyx_k_K_KP_PERIOD[] = "K_KP_PERIOD"; static char __pyx_k_K_LEFTPAREN[] = "K_LEFTPAREN"; static char __pyx_k_K_SCROLLOCK[] = "K_SCROLLOCK"; static char __pyx_k_K_SEMICOLON[] = "K_SEMICOLON"; static char __pyx_k_K_SEPARATOR[] = "K_SEPARATOR"; static char __pyx_k_MOUSEMOTION[] = "MOUSEMOTION"; static char __pyx_k_SRCCOLORKEY[] = "SRCCOLORKEY"; static char __pyx_k_TEXTEDITING[] = "TEXTEDITING"; static char __pyx_k_VIDEOEXPOSE[] = "VIDEOEXPOSE"; static char __pyx_k_VIDEORESIZE[] = "VIDEORESIZE"; static char __pyx_k_WINDOWEVENT[] = "WINDOWEVENT"; static char __pyx_k_DOLLARRECORD[] = "DOLLARRECORD"; static char __pyx_k_FINGERMOTION[] = "FINGERMOTION"; static char __pyx_k_GL_BLUE_SIZE[] = "GL_BLUE_SIZE"; static char __pyx_k_JOYHATMOTION[] = "JOYHATMOTION"; static char __pyx_k_K_AC_FORWARD[] = "K_AC_FORWARD"; static char __pyx_k_K_AC_REFRESH[] = "K_AC_REFRESH"; static char __pyx_k_K_CALCULATOR[] = "K_CALCULATOR"; static char __pyx_k_K_CLEARAGAIN[] = "K_CLEARAGAIN"; static char __pyx_k_K_KBDILLUMUP[] = "K_KBDILLUMUP"; static char __pyx_k_K_KP_DECIMAL[] = "K_KP_DECIMAL"; static char __pyx_k_K_KP_GREATER[] = "K_KP_GREATER"; static char __pyx_k_K_KP_PERCENT[] = "K_KP_PERCENT"; static char __pyx_k_K_RIGHTPAREN[] = "K_RIGHTPAREN"; static char __pyx_k_K_SCROLLLOCK[] = "K_SCROLLLOCK"; static char __pyx_k_K_UNDERSCORE[] = "K_UNDERSCORE"; static char __pyx_k_K_VOLUMEDOWN[] = "K_VOLUMEDOWN"; static char __pyx_k_MULTIGESTURE[] = "MULTIGESTURE"; static char __pyx_k_WINDOW_SHOWN[] = "WINDOW_SHOWN"; static char __pyx_k_APP_LOWMEMORY[] = "APP_LOWMEMORY"; static char __pyx_k_BLEND_RGB_ADD[] = "BLEND_RGB_ADD"; static char __pyx_k_BLEND_RGB_MAX[] = "BLEND_RGB_MAX"; static char __pyx_k_BLEND_RGB_MIN[] = "BLEND_RGB_MIN"; static char __pyx_k_BLEND_RGB_SUB[] = "BLEND_RGB_SUB"; static char __pyx_k_DOLLARGESTURE[] = "DOLLARGESTURE"; static char __pyx_k_GL_ALPHA_SIZE[] = "GL_ALPHA_SIZE"; static char __pyx_k_GL_DEPTH_SIZE[] = "GL_DEPTH_SIZE"; static char __pyx_k_GL_GREEN_SIZE[] = "GL_GREEN_SIZE"; static char __pyx_k_JOYAXISMOTION[] = "JOYAXISMOTION"; static char __pyx_k_JOYBALLMOTION[] = "JOYBALLMOTION"; static char __pyx_k_JOYBUTTONDOWN[] = "JOYBUTTONDOWN"; static char __pyx_k_K_APPLICATION[] = "K_APPLICATION"; static char __pyx_k_K_KP_MEMCLEAR[] = "K_KP_MEMCLEAR"; static char __pyx_k_K_KP_MEMSTORE[] = "K_KP_MEMSTORE"; static char __pyx_k_K_KP_MULTIPLY[] = "K_KP_MULTIPLY"; static char __pyx_k_K_LEFTBRACKET[] = "K_LEFTBRACKET"; static char __pyx_k_K_MEDIASELECT[] = "K_MEDIASELECT"; static char __pyx_k_K_PRINTSCREEN[] = "K_PRINTSCREEN"; static char __pyx_k_MOUSEBUTTONUP[] = "MOUSEBUTTONUP"; static char __pyx_k_TOUCH_MOUSEID[] = "TOUCH_MOUSEID"; static char __pyx_k_WINDOW_HIDDEN[] = "WINDOW_HIDDEN"; static char __pyx_k_WINDOW_OPENGL[] = "WINDOW_OPENGL"; static char __pyx_k_BLEND_RGBA_ADD[] = "BLEND_RGBA_ADD"; static char __pyx_k_BLEND_RGBA_MAX[] = "BLEND_RGBA_MAX"; static char __pyx_k_BLEND_RGBA_MIN[] = "BLEND_RGBA_MIN"; static char __pyx_k_BLEND_RGBA_SUB[] = "BLEND_RGBA_SUB"; static char __pyx_k_BLEND_RGB_MULT[] = "BLEND_RGB_MULT"; static char __pyx_k_GL_BUFFER_SIZE[] = "GL_BUFFER_SIZE"; static char __pyx_k_GL_CONTEXT_EGL[] = "GL_CONTEXT_EGL"; static char __pyx_k_JOYDEVICEADDED[] = "JOYDEVICEADDED"; static char __pyx_k_K_AC_BOOKMARKS[] = "K_AC_BOOKMARKS"; static char __pyx_k_K_BRIGHTNESSUP[] = "K_BRIGHTNESSUP"; static char __pyx_k_K_CURRENCYUNIT[] = "K_CURRENCYUNIT"; static char __pyx_k_K_KBDILLUMDOWN[] = "K_KBDILLUMDOWN"; static char __pyx_k_K_KP_AMPERSAND[] = "K_KP_AMPERSAND"; static char __pyx_k_K_KP_BACKSPACE[] = "K_KP_BACKSPACE"; static char __pyx_k_K_KP_LEFTBRACE[] = "K_KP_LEFTBRACE"; static char __pyx_k_K_KP_LEFTPAREN[] = "K_KP_LEFTPAREN"; static char __pyx_k_K_KP_MEMDIVIDE[] = "K_KP_MEMDIVIDE"; static char __pyx_k_K_KP_MEMRECALL[] = "K_KP_MEMRECALL"; static char __pyx_k_K_KP_PLUSMINUS[] = "K_KP_PLUSMINUS"; static char __pyx_k_K_NUMLOCKCLEAR[] = "K_NUMLOCKCLEAR"; static char __pyx_k_K_RIGHTBRACKET[] = "K_RIGHTBRACKET"; static char __pyx_k_WINDOW_FOREIGN[] = "WINDOW_FOREIGN"; static char __pyx_k_WINDOW_NOFRAME[] = "WINDOW_NOFRAME"; static char __pyx_k_APP_TERMINATING[] = "APP_TERMINATING"; static char __pyx_k_BLEND_RGBA_MULT[] = "BLEND_RGBA_MULT"; static char __pyx_k_CLIPBOARDUPDATE[] = "CLIPBOARDUPDATE"; static char __pyx_k_GL_DOUBLEBUFFER[] = "GL_DOUBLEBUFFER"; static char __pyx_k_GL_STENCIL_SIZE[] = "GL_STENCIL_SIZE"; static char __pyx_k_GL_SWAP_CONTROL[] = "GL_SWAP_CONTROL"; static char __pyx_k_K_DISPLAYSWITCH[] = "K_DISPLAYSWITCH"; static char __pyx_k_K_KP_CLEARENTRY[] = "K_KP_CLEARENTRY"; static char __pyx_k_K_KP_RIGHTBRACE[] = "K_KP_RIGHTBRACE"; static char __pyx_k_K_KP_RIGHTPAREN[] = "K_KP_RIGHTPAREN"; static char __pyx_k_MOUSEBUTTONDOWN[] = "MOUSEBUTTONDOWN"; static char __pyx_k_GL_CONTEXT_FLAGS[] = "GL_CONTEXT_FLAGS"; static char __pyx_k_JOYDEVICEREMOVED[] = "JOYDEVICEREMOVED"; static char __pyx_k_K_BRIGHTNESSDOWN[] = "K_BRIGHTNESSDOWN"; static char __pyx_k_K_KBDILLUMTOGGLE[] = "K_KBDILLUMTOGGLE"; static char __pyx_k_K_KP_EQUALSAS400[] = "K_KP_EQUALSAS400"; static char __pyx_k_K_KP_HEXADECIMAL[] = "K_KP_HEXADECIMAL"; static char __pyx_k_K_KP_MEMMULTIPLY[] = "K_KP_MEMMULTIPLY"; static char __pyx_k_K_KP_MEMSUBTRACT[] = "K_KP_MEMSUBTRACT"; static char __pyx_k_K_KP_VERTICALBAR[] = "K_KP_VERTICALBAR"; static char __pyx_k_WINDOW_MAXIMIZED[] = "WINDOW_MAXIMIZED"; static char __pyx_k_WINDOW_MINIMIZED[] = "WINDOW_MINIMIZED"; static char __pyx_k_WINDOW_RESIZABLE[] = "WINDOW_RESIZABLE"; static char __pyx_k_pygame_sdl2_rect[] = "pygame_sdl2.rect"; static char __pyx_k_GL_ACCUM_RED_SIZE[] = "GL_ACCUM_RED_SIZE"; static char __pyx_k_K_CURRENCYSUBUNIT[] = "K_CURRENCYSUBUNIT"; static char __pyx_k_K_KP_DBLAMPERSAND[] = "K_KP_DBLAMPERSAND"; static char __pyx_k_SDL_VERSION_TUPLE[] = "SDL_VERSION_TUPLE"; static char __pyx_k_WINDOW_BORDERLESS[] = "WINDOW_BORDERLESS"; static char __pyx_k_WINDOW_FULLSCREEN[] = "WINDOW_FULLSCREEN"; static char __pyx_k_pygame_sdl2_color[] = "pygame_sdl2.color"; static char __pyx_k_CONTROLLERBUTTONUP[] = "CONTROLLERBUTTONUP"; static char __pyx_k_GL_ACCUM_BLUE_SIZE[] = "GL_ACCUM_BLUE_SIZE"; static char __pyx_k_K_DECIMALSEPARATOR[] = "K_DECIMALSEPARATOR"; static char __pyx_k_POWERSTATE_CHARGED[] = "POWERSTATE_CHARGED"; static char __pyx_k_POWERSTATE_UNKNOWN[] = "POWERSTATE_UNKNOWN"; static char __pyx_k_WINDOWPOS_CENTERED[] = "WINDOWPOS_CENTERED"; static char __pyx_k_WINDOW_INPUT_FOCUS[] = "WINDOW_INPUT_FOCUS"; static char __pyx_k_BLEND_PREMULTIPLIED[] = "BLEND_PREMULTIPLIED"; static char __pyx_k_CONTROLLER_AXIS_MAX[] = "CONTROLLER_AXIS_MAX"; static char __pyx_k_CONTROLLER_BUTTON_A[] = "CONTROLLER_BUTTON_A"; static char __pyx_k_CONTROLLER_BUTTON_B[] = "CONTROLLER_BUTTON_B"; static char __pyx_k_CONTROLLER_BUTTON_X[] = "CONTROLLER_BUTTON_X"; static char __pyx_k_CONTROLLER_BUTTON_Y[] = "CONTROLLER_BUTTON_Y"; static char __pyx_k_GL_ACCUM_ALPHA_SIZE[] = "GL_ACCUM_ALPHA_SIZE"; static char __pyx_k_GL_ACCUM_GREEN_SIZE[] = "GL_ACCUM_GREEN_SIZE"; static char __pyx_k_GL_RETAINED_BACKING[] = "GL_RETAINED_BACKING"; static char __pyx_k_K_KP_DBLVERTICALBAR[] = "K_KP_DBLVERTICALBAR"; static char __pyx_k_POWERSTATE_CHARGING[] = "POWERSTATE_CHARGING"; static char __pyx_k_WINDOWPOS_UNDEFINED[] = "WINDOWPOS_UNDEFINED"; static char __pyx_k_CONTROLLERAXISMOTION[] = "CONTROLLERAXISMOTION"; static char __pyx_k_CONTROLLERBUTTONDOWN[] = "CONTROLLERBUTTONDOWN"; static char __pyx_k_K_THOUSANDSSEPARATOR[] = "K_THOUSANDSSEPARATOR"; static char __pyx_k_RENDER_TARGETS_RESET[] = "RENDER_TARGETS_RESET"; static char __pyx_k_WINDOW_ALLOW_HIGHDPI[] = "WINDOW_ALLOW_HIGHDPI"; static char __pyx_k_WINDOW_INPUT_GRABBED[] = "WINDOW_INPUT_GRABBED"; static char __pyx_k_CONTROLLERDEVICEADDED[] = "CONTROLLERDEVICEADDED"; static char __pyx_k_CONTROLLER_AXIS_LEFTX[] = "CONTROLLER_AXIS_LEFTX"; static char __pyx_k_CONTROLLER_AXIS_LEFTY[] = "CONTROLLER_AXIS_LEFTY"; static char __pyx_k_CONTROLLER_BUTTON_MAX[] = "CONTROLLER_BUTTON_MAX"; static char __pyx_k_GL_ACCELERATED_VISUAL[] = "GL_ACCELERATED_VISUAL"; static char __pyx_k_GL_MULTISAMPLEBUFFERS[] = "GL_MULTISAMPLEBUFFERS"; static char __pyx_k_GL_MULTISAMPLESAMPLES[] = "GL_MULTISAMPLESAMPLES"; static char __pyx_k_POWERSTATE_NO_BATTERY[] = "POWERSTATE_NO_BATTERY"; static char __pyx_k_POWERSTATE_ON_BATTERY[] = "POWERSTATE_ON_BATTERY"; static char __pyx_k_APP_DIDENTERBACKGROUND[] = "APP_DIDENTERBACKGROUND"; static char __pyx_k_APP_DIDENTERFOREGROUND[] = "APP_DIDENTERFOREGROUND"; static char __pyx_k_CONTROLLER_AXIS_RIGHTX[] = "CONTROLLER_AXIS_RIGHTX"; static char __pyx_k_CONTROLLER_AXIS_RIGHTY[] = "CONTROLLER_AXIS_RIGHTY"; static char __pyx_k_CONTROLLER_BUTTON_BACK[] = "CONTROLLER_BUTTON_BACK"; static char __pyx_k_APP_WILLENTERBACKGROUND[] = "APP_WILLENTERBACKGROUND"; static char __pyx_k_APP_WILLENTERFOREGROUND[] = "APP_WILLENTERFOREGROUND"; static char __pyx_k_CONTROLLERDEVICEREMOVED[] = "CONTROLLERDEVICEREMOVED"; static char __pyx_k_CONTROLLER_AXIS_INVALID[] = "CONTROLLER_AXIS_INVALID"; static char __pyx_k_CONTROLLER_BUTTON_GUIDE[] = "CONTROLLER_BUTTON_GUIDE"; static char __pyx_k_CONTROLLER_BUTTON_START[] = "CONTROLLER_BUTTON_START"; static char __pyx_k_GL_CONTEXT_PROFILE_MASK[] = "GL_CONTEXT_PROFILE_MASK"; static char __pyx_k_CONTROLLERDEVICEREMAPPED[] = "CONTROLLERDEVICEREMAPPED"; static char __pyx_k_GL_CONTEXT_MAJOR_VERSION[] = "GL_CONTEXT_MAJOR_VERSION"; static char __pyx_k_GL_CONTEXT_MINOR_VERSION[] = "GL_CONTEXT_MINOR_VERSION"; static char __pyx_k_CONTROLLER_BUTTON_DPAD_UP[] = "CONTROLLER_BUTTON_DPAD_UP"; static char __pyx_k_CONTROLLER_BUTTON_INVALID[] = "CONTROLLER_BUTTON_INVALID"; static char __pyx_k_WINDOW_FULLSCREEN_DESKTOP[] = "WINDOW_FULLSCREEN_DESKTOP"; static char __pyx_k_CONTROLLER_AXIS_TRIGGERLEFT[] = "CONTROLLER_AXIS_TRIGGERLEFT"; static char __pyx_k_CONTROLLER_BUTTON_DPAD_DOWN[] = "CONTROLLER_BUTTON_DPAD_DOWN"; static char __pyx_k_CONTROLLER_BUTTON_DPAD_LEFT[] = "CONTROLLER_BUTTON_DPAD_LEFT"; static char __pyx_k_CONTROLLER_BUTTON_LEFTSTICK[] = "CONTROLLER_BUTTON_LEFTSTICK"; static char __pyx_k_GL_FRAMEBUFFER_SRGB_CAPABLE[] = "GL_FRAMEBUFFER_SRGB_CAPABLE"; static char __pyx_k_CONTROLLER_AXIS_TRIGGERRIGHT[] = "CONTROLLER_AXIS_TRIGGERRIGHT"; static char __pyx_k_CONTROLLER_BUTTON_DPAD_RIGHT[] = "CONTROLLER_BUTTON_DPAD_RIGHT"; static char __pyx_k_CONTROLLER_BUTTON_RIGHTSTICK[] = "CONTROLLER_BUTTON_RIGHTSTICK"; static char __pyx_k_GL_SHARE_WITH_CURRENT_CONTEXT[] = "GL_SHARE_WITH_CURRENT_CONTEXT"; static char __pyx_k_CONTROLLER_BUTTON_LEFTSHOULDER[] = "CONTROLLER_BUTTON_LEFTSHOULDER"; static char __pyx_k_CONTROLLER_BUTTON_RIGHTSHOULDER[] = "CONTROLLER_BUTTON_RIGHTSHOULDER"; static PyObject *__pyx_n_s_ACTIVEEVENT; static PyObject *__pyx_n_s_APP_DIDENTERBACKGROUND; static PyObject *__pyx_n_s_APP_DIDENTERFOREGROUND; static PyObject *__pyx_n_s_APP_LOWMEMORY; static PyObject *__pyx_n_s_APP_TERMINATING; static PyObject *__pyx_n_s_APP_WILLENTERBACKGROUND; static PyObject *__pyx_n_s_APP_WILLENTERFOREGROUND; static PyObject *__pyx_n_s_BIG_ENDIAN; static PyObject *__pyx_n_s_BLEND_ADD; static PyObject *__pyx_n_s_BLEND_MAX; static PyObject *__pyx_n_s_BLEND_MIN; static PyObject *__pyx_n_s_BLEND_MULT; static PyObject *__pyx_n_s_BLEND_PREMULTIPLIED; static PyObject *__pyx_n_s_BLEND_RGBA_ADD; static PyObject *__pyx_n_s_BLEND_RGBA_MAX; static PyObject *__pyx_n_s_BLEND_RGBA_MIN; static PyObject *__pyx_n_s_BLEND_RGBA_MULT; static PyObject *__pyx_n_s_BLEND_RGBA_SUB; static PyObject *__pyx_n_s_BLEND_RGB_ADD; static PyObject *__pyx_n_s_BLEND_RGB_MAX; static PyObject *__pyx_n_s_BLEND_RGB_MIN; static PyObject *__pyx_n_s_BLEND_RGB_MULT; static PyObject *__pyx_n_s_BLEND_RGB_SUB; static PyObject *__pyx_n_s_BLEND_SUB; static PyObject *__pyx_n_s_BYTEORDER; static PyObject *__pyx_n_s_CLIPBOARDUPDATE; static PyObject *__pyx_n_s_CONTROLLERAXISMOTION; static PyObject *__pyx_n_s_CONTROLLERBUTTONDOWN; static PyObject *__pyx_n_s_CONTROLLERBUTTONUP; static PyObject *__pyx_n_s_CONTROLLERDEVICEADDED; static PyObject *__pyx_n_s_CONTROLLERDEVICEREMAPPED; static PyObject *__pyx_n_s_CONTROLLERDEVICEREMOVED; static PyObject *__pyx_n_s_CONTROLLER_AXIS_INVALID; static PyObject *__pyx_n_s_CONTROLLER_AXIS_LEFTX; static PyObject *__pyx_n_s_CONTROLLER_AXIS_LEFTY; static PyObject *__pyx_n_s_CONTROLLER_AXIS_MAX; static PyObject *__pyx_n_s_CONTROLLER_AXIS_RIGHTX; static PyObject *__pyx_n_s_CONTROLLER_AXIS_RIGHTY; static PyObject *__pyx_n_s_CONTROLLER_AXIS_TRIGGERLEFT; static PyObject *__pyx_n_s_CONTROLLER_AXIS_TRIGGERRIGHT; static PyObject *__pyx_n_s_CONTROLLER_BUTTON_A; static PyObject *__pyx_n_s_CONTROLLER_BUTTON_B; static PyObject *__pyx_n_s_CONTROLLER_BUTTON_BACK; static PyObject *__pyx_n_s_CONTROLLER_BUTTON_DPAD_DOWN; static PyObject *__pyx_n_s_CONTROLLER_BUTTON_DPAD_LEFT; static PyObject *__pyx_n_s_CONTROLLER_BUTTON_DPAD_RIGHT; static PyObject *__pyx_n_s_CONTROLLER_BUTTON_DPAD_UP; static PyObject *__pyx_n_s_CONTROLLER_BUTTON_GUIDE; static PyObject *__pyx_n_s_CONTROLLER_BUTTON_INVALID; static PyObject *__pyx_n_s_CONTROLLER_BUTTON_LEFTSHOULDER; static PyObject *__pyx_n_s_CONTROLLER_BUTTON_LEFTSTICK; static PyObject *__pyx_n_s_CONTROLLER_BUTTON_MAX; static PyObject *__pyx_n_s_CONTROLLER_BUTTON_RIGHTSHOULDER; static PyObject *__pyx_n_s_CONTROLLER_BUTTON_RIGHTSTICK; static PyObject *__pyx_n_s_CONTROLLER_BUTTON_START; static PyObject *__pyx_n_s_CONTROLLER_BUTTON_X; static PyObject *__pyx_n_s_CONTROLLER_BUTTON_Y; static PyObject *__pyx_n_s_Color; static PyObject *__pyx_n_s_DOLLARGESTURE; static PyObject *__pyx_n_s_DOLLARRECORD; static PyObject *__pyx_n_s_DOUBLEBUF; static PyObject *__pyx_n_s_DROPFILE; static PyObject *__pyx_n_s_FINGERDOWN; static PyObject *__pyx_n_s_FINGERMOTION; static PyObject *__pyx_n_s_FINGERUP; static PyObject *__pyx_n_s_FULLSCREEN; static PyObject *__pyx_n_s_GL_ACCELERATED_VISUAL; static PyObject *__pyx_n_s_GL_ACCUM_ALPHA_SIZE; static PyObject *__pyx_n_s_GL_ACCUM_BLUE_SIZE; static PyObject *__pyx_n_s_GL_ACCUM_GREEN_SIZE; static PyObject *__pyx_n_s_GL_ACCUM_RED_SIZE; static PyObject *__pyx_n_s_GL_ALPHA_SIZE; static PyObject *__pyx_n_s_GL_BLUE_SIZE; static PyObject *__pyx_n_s_GL_BUFFER_SIZE; static PyObject *__pyx_n_s_GL_CONTEXT_EGL; static PyObject *__pyx_n_s_GL_CONTEXT_FLAGS; static PyObject *__pyx_n_s_GL_CONTEXT_MAJOR_VERSION; static PyObject *__pyx_n_s_GL_CONTEXT_MINOR_VERSION; static PyObject *__pyx_n_s_GL_CONTEXT_PROFILE_MASK; static PyObject *__pyx_n_s_GL_DEPTH_SIZE; static PyObject *__pyx_n_s_GL_DOUBLEBUFFER; static PyObject *__pyx_n_s_GL_FRAMEBUFFER_SRGB_CAPABLE; static PyObject *__pyx_n_s_GL_GREEN_SIZE; static PyObject *__pyx_n_s_GL_MULTISAMPLEBUFFERS; static PyObject *__pyx_n_s_GL_MULTISAMPLESAMPLES; static PyObject *__pyx_n_s_GL_RED_SIZE; static PyObject *__pyx_n_s_GL_RETAINED_BACKING; static PyObject *__pyx_n_s_GL_SHARE_WITH_CURRENT_CONTEXT; static PyObject *__pyx_n_s_GL_STENCIL_SIZE; static PyObject *__pyx_n_s_GL_STEREO; static PyObject *__pyx_n_s_GL_SWAP_CONTROL; static PyObject *__pyx_n_s_HWSURFACE; static PyObject *__pyx_n_s_JOYAXISMOTION; static PyObject *__pyx_n_s_JOYBALLMOTION; static PyObject *__pyx_n_s_JOYBUTTONDOWN; static PyObject *__pyx_n_s_JOYBUTTONUP; static PyObject *__pyx_n_s_JOYDEVICEADDED; static PyObject *__pyx_n_s_JOYDEVICEREMOVED; static PyObject *__pyx_n_s_JOYHATMOTION; static PyObject *__pyx_n_s_KEYDOWN; static PyObject *__pyx_n_s_KEYUP; static PyObject *__pyx_n_s_KMOD_ALT; static PyObject *__pyx_n_s_KMOD_CAPS; static PyObject *__pyx_n_s_KMOD_CTRL; static PyObject *__pyx_n_s_KMOD_GUI; static PyObject *__pyx_n_s_KMOD_LALT; static PyObject *__pyx_n_s_KMOD_LCTRL; static PyObject *__pyx_n_s_KMOD_LGUI; static PyObject *__pyx_n_s_KMOD_LMETA; static PyObject *__pyx_n_s_KMOD_LSHIFT; static PyObject *__pyx_n_s_KMOD_META; static PyObject *__pyx_n_s_KMOD_MODE; static PyObject *__pyx_n_s_KMOD_NONE; static PyObject *__pyx_n_s_KMOD_NUM; static PyObject *__pyx_n_s_KMOD_RALT; static PyObject *__pyx_n_s_KMOD_RCTRL; static PyObject *__pyx_n_s_KMOD_RGUI; static PyObject *__pyx_n_s_KMOD_RMETA; static PyObject *__pyx_n_s_KMOD_RSHIFT; static PyObject *__pyx_n_s_KMOD_SHIFT; static PyObject *__pyx_n_s_K_0; static PyObject *__pyx_n_s_K_1; static PyObject *__pyx_n_s_K_2; static PyObject *__pyx_n_s_K_3; static PyObject *__pyx_n_s_K_4; static PyObject *__pyx_n_s_K_5; static PyObject *__pyx_n_s_K_6; static PyObject *__pyx_n_s_K_7; static PyObject *__pyx_n_s_K_8; static PyObject *__pyx_n_s_K_9; static PyObject *__pyx_n_s_K_AC_BACK; static PyObject *__pyx_n_s_K_AC_BOOKMARKS; static PyObject *__pyx_n_s_K_AC_FORWARD; static PyObject *__pyx_n_s_K_AC_HOME; static PyObject *__pyx_n_s_K_AC_REFRESH; static PyObject *__pyx_n_s_K_AC_SEARCH; static PyObject *__pyx_n_s_K_AC_STOP; static PyObject *__pyx_n_s_K_AGAIN; static PyObject *__pyx_n_s_K_ALTERASE; static PyObject *__pyx_n_s_K_AMPERSAND; static PyObject *__pyx_n_s_K_APPLICATION; static PyObject *__pyx_n_s_K_ASTERISK; static PyObject *__pyx_n_s_K_AT; static PyObject *__pyx_n_s_K_AUDIOMUTE; static PyObject *__pyx_n_s_K_AUDIONEXT; static PyObject *__pyx_n_s_K_AUDIOPLAY; static PyObject *__pyx_n_s_K_AUDIOPREV; static PyObject *__pyx_n_s_K_AUDIOSTOP; static PyObject *__pyx_n_s_K_BACKQUOTE; static PyObject *__pyx_n_s_K_BACKSLASH; static PyObject *__pyx_n_s_K_BACKSPACE; static PyObject *__pyx_n_s_K_BREAK; static PyObject *__pyx_n_s_K_BRIGHTNESSDOWN; static PyObject *__pyx_n_s_K_BRIGHTNESSUP; static PyObject *__pyx_n_s_K_CALCULATOR; static PyObject *__pyx_n_s_K_CANCEL; static PyObject *__pyx_n_s_K_CAPSLOCK; static PyObject *__pyx_n_s_K_CARET; static PyObject *__pyx_n_s_K_CLEAR; static PyObject *__pyx_n_s_K_CLEARAGAIN; static PyObject *__pyx_n_s_K_COLON; static PyObject *__pyx_n_s_K_COMMA; static PyObject *__pyx_n_s_K_COMPUTER; static PyObject *__pyx_n_s_K_COPY; static PyObject *__pyx_n_s_K_CRSEL; static PyObject *__pyx_n_s_K_CURRENCYSUBUNIT; static PyObject *__pyx_n_s_K_CURRENCYUNIT; static PyObject *__pyx_n_s_K_CUT; static PyObject *__pyx_n_s_K_DECIMALSEPARATOR; static PyObject *__pyx_n_s_K_DELETE; static PyObject *__pyx_n_s_K_DISPLAYSWITCH; static PyObject *__pyx_n_s_K_DOLLAR; static PyObject *__pyx_n_s_K_DOWN; static PyObject *__pyx_n_s_K_EJECT; static PyObject *__pyx_n_s_K_END; static PyObject *__pyx_n_s_K_EQUALS; static PyObject *__pyx_n_s_K_ESCAPE; static PyObject *__pyx_n_s_K_EURO; static PyObject *__pyx_n_s_K_EXCLAIM; static PyObject *__pyx_n_s_K_EXECUTE; static PyObject *__pyx_n_s_K_EXSEL; static PyObject *__pyx_n_s_K_F1; static PyObject *__pyx_n_s_K_F10; static PyObject *__pyx_n_s_K_F11; static PyObject *__pyx_n_s_K_F12; static PyObject *__pyx_n_s_K_F13; static PyObject *__pyx_n_s_K_F14; static PyObject *__pyx_n_s_K_F15; static PyObject *__pyx_n_s_K_F16; static PyObject *__pyx_n_s_K_F17; static PyObject *__pyx_n_s_K_F18; static PyObject *__pyx_n_s_K_F19; static PyObject *__pyx_n_s_K_F2; static PyObject *__pyx_n_s_K_F20; static PyObject *__pyx_n_s_K_F21; static PyObject *__pyx_n_s_K_F22; static PyObject *__pyx_n_s_K_F23; static PyObject *__pyx_n_s_K_F24; static PyObject *__pyx_n_s_K_F3; static PyObject *__pyx_n_s_K_F4; static PyObject *__pyx_n_s_K_F5; static PyObject *__pyx_n_s_K_F6; static PyObject *__pyx_n_s_K_F7; static PyObject *__pyx_n_s_K_F8; static PyObject *__pyx_n_s_K_F9; static PyObject *__pyx_n_s_K_FIND; static PyObject *__pyx_n_s_K_FIRST; static PyObject *__pyx_n_s_K_GREATER; static PyObject *__pyx_n_s_K_HASH; static PyObject *__pyx_n_s_K_HELP; static PyObject *__pyx_n_s_K_HOME; static PyObject *__pyx_n_s_K_INSERT; static PyObject *__pyx_n_s_K_KBDILLUMDOWN; static PyObject *__pyx_n_s_K_KBDILLUMTOGGLE; static PyObject *__pyx_n_s_K_KBDILLUMUP; static PyObject *__pyx_n_s_K_KP0; static PyObject *__pyx_n_s_K_KP1; static PyObject *__pyx_n_s_K_KP2; static PyObject *__pyx_n_s_K_KP3; static PyObject *__pyx_n_s_K_KP4; static PyObject *__pyx_n_s_K_KP5; static PyObject *__pyx_n_s_K_KP6; static PyObject *__pyx_n_s_K_KP7; static PyObject *__pyx_n_s_K_KP8; static PyObject *__pyx_n_s_K_KP9; static PyObject *__pyx_n_s_K_KP_0; static PyObject *__pyx_n_s_K_KP_00; static PyObject *__pyx_n_s_K_KP_000; static PyObject *__pyx_n_s_K_KP_1; static PyObject *__pyx_n_s_K_KP_2; static PyObject *__pyx_n_s_K_KP_3; static PyObject *__pyx_n_s_K_KP_4; static PyObject *__pyx_n_s_K_KP_5; static PyObject *__pyx_n_s_K_KP_6; static PyObject *__pyx_n_s_K_KP_7; static PyObject *__pyx_n_s_K_KP_8; static PyObject *__pyx_n_s_K_KP_9; static PyObject *__pyx_n_s_K_KP_A; static PyObject *__pyx_n_s_K_KP_AMPERSAND; static PyObject *__pyx_n_s_K_KP_AT; static PyObject *__pyx_n_s_K_KP_B; static PyObject *__pyx_n_s_K_KP_BACKSPACE; static PyObject *__pyx_n_s_K_KP_BINARY; static PyObject *__pyx_n_s_K_KP_C; static PyObject *__pyx_n_s_K_KP_CLEAR; static PyObject *__pyx_n_s_K_KP_CLEARENTRY; static PyObject *__pyx_n_s_K_KP_COLON; static PyObject *__pyx_n_s_K_KP_COMMA; static PyObject *__pyx_n_s_K_KP_D; static PyObject *__pyx_n_s_K_KP_DBLAMPERSAND; static PyObject *__pyx_n_s_K_KP_DBLVERTICALBAR; static PyObject *__pyx_n_s_K_KP_DECIMAL; static PyObject *__pyx_n_s_K_KP_DIVIDE; static PyObject *__pyx_n_s_K_KP_E; static PyObject *__pyx_n_s_K_KP_ENTER; static PyObject *__pyx_n_s_K_KP_EQUALS; static PyObject *__pyx_n_s_K_KP_EQUALSAS400; static PyObject *__pyx_n_s_K_KP_EXCLAM; static PyObject *__pyx_n_s_K_KP_F; static PyObject *__pyx_n_s_K_KP_GREATER; static PyObject *__pyx_n_s_K_KP_HASH; static PyObject *__pyx_n_s_K_KP_HEXADECIMAL; static PyObject *__pyx_n_s_K_KP_LEFTBRACE; static PyObject *__pyx_n_s_K_KP_LEFTPAREN; static PyObject *__pyx_n_s_K_KP_LESS; static PyObject *__pyx_n_s_K_KP_MEMADD; static PyObject *__pyx_n_s_K_KP_MEMCLEAR; static PyObject *__pyx_n_s_K_KP_MEMDIVIDE; static PyObject *__pyx_n_s_K_KP_MEMMULTIPLY; static PyObject *__pyx_n_s_K_KP_MEMRECALL; static PyObject *__pyx_n_s_K_KP_MEMSTORE; static PyObject *__pyx_n_s_K_KP_MEMSUBTRACT; static PyObject *__pyx_n_s_K_KP_MINUS; static PyObject *__pyx_n_s_K_KP_MULTIPLY; static PyObject *__pyx_n_s_K_KP_OCTAL; static PyObject *__pyx_n_s_K_KP_PERCENT; static PyObject *__pyx_n_s_K_KP_PERIOD; static PyObject *__pyx_n_s_K_KP_PLUS; static PyObject *__pyx_n_s_K_KP_PLUSMINUS; static PyObject *__pyx_n_s_K_KP_POWER; static PyObject *__pyx_n_s_K_KP_RIGHTBRACE; static PyObject *__pyx_n_s_K_KP_RIGHTPAREN; static PyObject *__pyx_n_s_K_KP_SPACE; static PyObject *__pyx_n_s_K_KP_TAB; static PyObject *__pyx_n_s_K_KP_VERTICALBAR; static PyObject *__pyx_n_s_K_KP_XOR; static PyObject *__pyx_n_s_K_LALT; static PyObject *__pyx_n_s_K_LAST; static PyObject *__pyx_n_s_K_LCTRL; static PyObject *__pyx_n_s_K_LEFT; static PyObject *__pyx_n_s_K_LEFTBRACKET; static PyObject *__pyx_n_s_K_LEFTPAREN; static PyObject *__pyx_n_s_K_LESS; static PyObject *__pyx_n_s_K_LGUI; static PyObject *__pyx_n_s_K_LMETA; static PyObject *__pyx_n_s_K_LSHIFT; static PyObject *__pyx_n_s_K_LSUPER; static PyObject *__pyx_n_s_K_MAIL; static PyObject *__pyx_n_s_K_MEDIASELECT; static PyObject *__pyx_n_s_K_MENU; static PyObject *__pyx_n_s_K_MINUS; static PyObject *__pyx_n_s_K_MODE; static PyObject *__pyx_n_s_K_MUTE; static PyObject *__pyx_n_s_K_NUMLOCK; static PyObject *__pyx_n_s_K_NUMLOCKCLEAR; static PyObject *__pyx_n_s_K_OPER; static PyObject *__pyx_n_s_K_OUT; static PyObject *__pyx_n_s_K_PAGEDOWN; static PyObject *__pyx_n_s_K_PAGEUP; static PyObject *__pyx_n_s_K_PASTE; static PyObject *__pyx_n_s_K_PAUSE; static PyObject *__pyx_n_s_K_PERCENT; static PyObject *__pyx_n_s_K_PERIOD; static PyObject *__pyx_n_s_K_PLUS; static PyObject *__pyx_n_s_K_POWER; static PyObject *__pyx_n_s_K_PRINT; static PyObject *__pyx_n_s_K_PRINTSCREEN; static PyObject *__pyx_n_s_K_PRIOR; static PyObject *__pyx_n_s_K_QUESTION; static PyObject *__pyx_n_s_K_QUOTE; static PyObject *__pyx_n_s_K_QUOTEDBL; static PyObject *__pyx_n_s_K_RALT; static PyObject *__pyx_n_s_K_RCTRL; static PyObject *__pyx_n_s_K_RETURN; static PyObject *__pyx_n_s_K_RETURN2; static PyObject *__pyx_n_s_K_RGUI; static PyObject *__pyx_n_s_K_RIGHT; static PyObject *__pyx_n_s_K_RIGHTBRACKET; static PyObject *__pyx_n_s_K_RIGHTPAREN; static PyObject *__pyx_n_s_K_RMETA; static PyObject *__pyx_n_s_K_RSHIFT; static PyObject *__pyx_n_s_K_RSUPER; static PyObject *__pyx_n_s_K_SCROLLLOCK; static PyObject *__pyx_n_s_K_SCROLLOCK; static PyObject *__pyx_n_s_K_SELECT; static PyObject *__pyx_n_s_K_SEMICOLON; static PyObject *__pyx_n_s_K_SEPARATOR; static PyObject *__pyx_n_s_K_SLASH; static PyObject *__pyx_n_s_K_SLEEP; static PyObject *__pyx_n_s_K_SPACE; static PyObject *__pyx_n_s_K_STOP; static PyObject *__pyx_n_s_K_SYSREQ; static PyObject *__pyx_n_s_K_TAB; static PyObject *__pyx_n_s_K_THOUSANDSSEPARATOR; static PyObject *__pyx_n_s_K_UNDERSCORE; static PyObject *__pyx_n_s_K_UNDO; static PyObject *__pyx_n_s_K_UNKNOWN; static PyObject *__pyx_n_s_K_UP; static PyObject *__pyx_n_s_K_VOLUMEDOWN; static PyObject *__pyx_n_s_K_VOLUMEUP; static PyObject *__pyx_n_s_K_WWW; static PyObject *__pyx_n_s_K_a; static PyObject *__pyx_n_s_K_b; static PyObject *__pyx_n_s_K_c; static PyObject *__pyx_n_s_K_d; static PyObject *__pyx_n_s_K_e; static PyObject *__pyx_n_s_K_f; static PyObject *__pyx_n_s_K_g; static PyObject *__pyx_n_s_K_h; static PyObject *__pyx_n_s_K_i; static PyObject *__pyx_n_s_K_j; static PyObject *__pyx_n_s_K_k; static PyObject *__pyx_n_s_K_l; static PyObject *__pyx_n_s_K_m; static PyObject *__pyx_n_s_K_n; static PyObject *__pyx_n_s_K_o; static PyObject *__pyx_n_s_K_p; static PyObject *__pyx_n_s_K_q; static PyObject *__pyx_n_s_K_r; static PyObject *__pyx_n_s_K_s; static PyObject *__pyx_n_s_K_t; static PyObject *__pyx_n_s_K_u; static PyObject *__pyx_n_s_K_v; static PyObject *__pyx_n_s_K_w; static PyObject *__pyx_n_s_K_x; static PyObject *__pyx_n_s_K_y; static PyObject *__pyx_n_s_K_z; static PyObject *__pyx_n_s_LASTEVENT; static PyObject *__pyx_n_s_LIL_ENDIAN; static PyObject *__pyx_n_s_MOUSEBUTTONDOWN; static PyObject *__pyx_n_s_MOUSEBUTTONUP; static PyObject *__pyx_n_s_MOUSEMOTION; static PyObject *__pyx_n_s_MOUSEWHEEL; static PyObject *__pyx_n_s_MULTIGESTURE; static PyObject *__pyx_n_s_NOEVENT; static PyObject *__pyx_n_s_NOFRAME; static PyObject *__pyx_n_s_OPENGL; static PyObject *__pyx_n_s_POWERSTATE_CHARGED; static PyObject *__pyx_n_s_POWERSTATE_CHARGING; static PyObject *__pyx_n_s_POWERSTATE_NO_BATTERY; static PyObject *__pyx_n_s_POWERSTATE_ON_BATTERY; static PyObject *__pyx_n_s_POWERSTATE_UNKNOWN; static PyObject *__pyx_n_s_QUIT; static PyObject *__pyx_n_s_RENDER_TARGETS_RESET; static PyObject *__pyx_n_s_RESIZABLE; static PyObject *__pyx_n_s_RLEACCEL; static PyObject *__pyx_n_s_Rect; static PyObject *__pyx_n_s_SCRAP_TEXT; static PyObject *__pyx_n_s_SDL_VERSION_TUPLE; static PyObject *__pyx_n_s_SRCALPHA; static PyObject *__pyx_n_s_SRCCOLORKEY; static PyObject *__pyx_n_s_SWSURFACE; static PyObject *__pyx_n_s_SYSWMEVENT; static PyObject *__pyx_n_s_TEXTEDITING; static PyObject *__pyx_n_s_TEXTINPUT; static PyObject *__pyx_n_s_TOUCH_MOUSEID; static PyObject *__pyx_n_s_USEREVENT; static PyObject *__pyx_n_s_VIDEOEXPOSE; static PyObject *__pyx_n_s_VIDEORESIZE; static PyObject *__pyx_n_s_WINDOWEVENT; static PyObject *__pyx_n_s_WINDOWPOS_CENTERED; static PyObject *__pyx_n_s_WINDOWPOS_UNDEFINED; static PyObject *__pyx_n_s_WINDOW_ALLOW_HIGHDPI; static PyObject *__pyx_n_s_WINDOW_BORDERLESS; static PyObject *__pyx_n_s_WINDOW_FOREIGN; static PyObject *__pyx_n_s_WINDOW_FULLSCREEN; static PyObject *__pyx_n_s_WINDOW_FULLSCREEN_DESKTOP; static PyObject *__pyx_n_s_WINDOW_HIDDEN; static PyObject *__pyx_n_s_WINDOW_INPUT_FOCUS; static PyObject *__pyx_n_s_WINDOW_INPUT_GRABBED; static PyObject *__pyx_n_s_WINDOW_MAXIMIZED; static PyObject *__pyx_n_s_WINDOW_MINIMIZED; static PyObject *__pyx_n_s_WINDOW_NOFRAME; static PyObject *__pyx_n_s_WINDOW_OPENGL; static PyObject *__pyx_n_s_WINDOW_RESIZABLE; static PyObject *__pyx_n_s_WINDOW_SHOWN; static PyObject *__pyx_n_s_import; static PyObject *__pyx_n_s_main; static PyObject *__pyx_n_s_pygame_sdl2_color; static PyObject *__pyx_n_s_pygame_sdl2_rect; static PyObject *__pyx_n_s_test; static PyObject *__pyx_kp_s_text_plain; static PyObject *__pyx_n_s_update; static PyObject *__pyx_int_0; static PyObject *__pyx_int_1; static PyObject *__pyx_int_2; static PyObject *__pyx_int_3; static PyObject *__pyx_int_4; static PyObject *__pyx_int_5; static PyObject *__pyx_int_6; static PyObject *__pyx_int_7; static PyObject *__pyx_int_8; static PyObject *__pyx_int_9; static PyObject *__pyx_int_16; static PyObject *__pyx_int_17; static PyObject *__pyx_int_1073741824; static PyObject *__pyx_int_2147483648; static PyObject *__pyx_int_neg_1; static PyMethodDef __pyx_methods[] = { {0, 0, 0, 0} }; #if PY_MAJOR_VERSION >= 3 static struct PyModuleDef __pyx_moduledef = { #if PY_VERSION_HEX < 0x03020000 { PyObject_HEAD_INIT(NULL) NULL, 0, NULL }, #else PyModuleDef_HEAD_INIT, #endif "locals", 0, /* m_doc */ -1, /* m_size */ __pyx_methods /* m_methods */, NULL, /* m_reload */ NULL, /* m_traverse */ NULL, /* m_clear */ NULL /* m_free */ }; #endif static __Pyx_StringTabEntry __pyx_string_tab[] = { {&__pyx_n_s_ACTIVEEVENT, __pyx_k_ACTIVEEVENT, sizeof(__pyx_k_ACTIVEEVENT), 0, 0, 1, 1}, {&__pyx_n_s_APP_DIDENTERBACKGROUND, __pyx_k_APP_DIDENTERBACKGROUND, sizeof(__pyx_k_APP_DIDENTERBACKGROUND), 0, 0, 1, 1}, {&__pyx_n_s_APP_DIDENTERFOREGROUND, __pyx_k_APP_DIDENTERFOREGROUND, sizeof(__pyx_k_APP_DIDENTERFOREGROUND), 0, 0, 1, 1}, {&__pyx_n_s_APP_LOWMEMORY, __pyx_k_APP_LOWMEMORY, sizeof(__pyx_k_APP_LOWMEMORY), 0, 0, 1, 1}, {&__pyx_n_s_APP_TERMINATING, __pyx_k_APP_TERMINATING, sizeof(__pyx_k_APP_TERMINATING), 0, 0, 1, 1}, {&__pyx_n_s_APP_WILLENTERBACKGROUND, __pyx_k_APP_WILLENTERBACKGROUND, sizeof(__pyx_k_APP_WILLENTERBACKGROUND), 0, 0, 1, 1}, {&__pyx_n_s_APP_WILLENTERFOREGROUND, __pyx_k_APP_WILLENTERFOREGROUND, sizeof(__pyx_k_APP_WILLENTERFOREGROUND), 0, 0, 1, 1}, {&__pyx_n_s_BIG_ENDIAN, __pyx_k_BIG_ENDIAN, sizeof(__pyx_k_BIG_ENDIAN), 0, 0, 1, 1}, {&__pyx_n_s_BLEND_ADD, __pyx_k_BLEND_ADD, sizeof(__pyx_k_BLEND_ADD), 0, 0, 1, 1}, {&__pyx_n_s_BLEND_MAX, __pyx_k_BLEND_MAX, sizeof(__pyx_k_BLEND_MAX), 0, 0, 1, 1}, {&__pyx_n_s_BLEND_MIN, __pyx_k_BLEND_MIN, sizeof(__pyx_k_BLEND_MIN), 0, 0, 1, 1}, {&__pyx_n_s_BLEND_MULT, __pyx_k_BLEND_MULT, sizeof(__pyx_k_BLEND_MULT), 0, 0, 1, 1}, {&__pyx_n_s_BLEND_PREMULTIPLIED, __pyx_k_BLEND_PREMULTIPLIED, sizeof(__pyx_k_BLEND_PREMULTIPLIED), 0, 0, 1, 1}, {&__pyx_n_s_BLEND_RGBA_ADD, __pyx_k_BLEND_RGBA_ADD, sizeof(__pyx_k_BLEND_RGBA_ADD), 0, 0, 1, 1}, {&__pyx_n_s_BLEND_RGBA_MAX, __pyx_k_BLEND_RGBA_MAX, sizeof(__pyx_k_BLEND_RGBA_MAX), 0, 0, 1, 1}, {&__pyx_n_s_BLEND_RGBA_MIN, __pyx_k_BLEND_RGBA_MIN, sizeof(__pyx_k_BLEND_RGBA_MIN), 0, 0, 1, 1}, {&__pyx_n_s_BLEND_RGBA_MULT, __pyx_k_BLEND_RGBA_MULT, sizeof(__pyx_k_BLEND_RGBA_MULT), 0, 0, 1, 1}, {&__pyx_n_s_BLEND_RGBA_SUB, __pyx_k_BLEND_RGBA_SUB, sizeof(__pyx_k_BLEND_RGBA_SUB), 0, 0, 1, 1}, {&__pyx_n_s_BLEND_RGB_ADD, __pyx_k_BLEND_RGB_ADD, sizeof(__pyx_k_BLEND_RGB_ADD), 0, 0, 1, 1}, {&__pyx_n_s_BLEND_RGB_MAX, __pyx_k_BLEND_RGB_MAX, sizeof(__pyx_k_BLEND_RGB_MAX), 0, 0, 1, 1}, {&__pyx_n_s_BLEND_RGB_MIN, __pyx_k_BLEND_RGB_MIN, sizeof(__pyx_k_BLEND_RGB_MIN), 0, 0, 1, 1}, {&__pyx_n_s_BLEND_RGB_MULT, __pyx_k_BLEND_RGB_MULT, sizeof(__pyx_k_BLEND_RGB_MULT), 0, 0, 1, 1}, {&__pyx_n_s_BLEND_RGB_SUB, __pyx_k_BLEND_RGB_SUB, sizeof(__pyx_k_BLEND_RGB_SUB), 0, 0, 1, 1}, {&__pyx_n_s_BLEND_SUB, __pyx_k_BLEND_SUB, sizeof(__pyx_k_BLEND_SUB), 0, 0, 1, 1}, {&__pyx_n_s_BYTEORDER, __pyx_k_BYTEORDER, sizeof(__pyx_k_BYTEORDER), 0, 0, 1, 1}, {&__pyx_n_s_CLIPBOARDUPDATE, __pyx_k_CLIPBOARDUPDATE, sizeof(__pyx_k_CLIPBOARDUPDATE), 0, 0, 1, 1}, {&__pyx_n_s_CONTROLLERAXISMOTION, __pyx_k_CONTROLLERAXISMOTION, sizeof(__pyx_k_CONTROLLERAXISMOTION), 0, 0, 1, 1}, {&__pyx_n_s_CONTROLLERBUTTONDOWN, __pyx_k_CONTROLLERBUTTONDOWN, sizeof(__pyx_k_CONTROLLERBUTTONDOWN), 0, 0, 1, 1}, {&__pyx_n_s_CONTROLLERBUTTONUP, __pyx_k_CONTROLLERBUTTONUP, sizeof(__pyx_k_CONTROLLERBUTTONUP), 0, 0, 1, 1}, {&__pyx_n_s_CONTROLLERDEVICEADDED, __pyx_k_CONTROLLERDEVICEADDED, sizeof(__pyx_k_CONTROLLERDEVICEADDED), 0, 0, 1, 1}, {&__pyx_n_s_CONTROLLERDEVICEREMAPPED, __pyx_k_CONTROLLERDEVICEREMAPPED, sizeof(__pyx_k_CONTROLLERDEVICEREMAPPED), 0, 0, 1, 1}, {&__pyx_n_s_CONTROLLERDEVICEREMOVED, __pyx_k_CONTROLLERDEVICEREMOVED, sizeof(__pyx_k_CONTROLLERDEVICEREMOVED), 0, 0, 1, 1}, {&__pyx_n_s_CONTROLLER_AXIS_INVALID, __pyx_k_CONTROLLER_AXIS_INVALID, sizeof(__pyx_k_CONTROLLER_AXIS_INVALID), 0, 0, 1, 1}, {&__pyx_n_s_CONTROLLER_AXIS_LEFTX, __pyx_k_CONTROLLER_AXIS_LEFTX, sizeof(__pyx_k_CONTROLLER_AXIS_LEFTX), 0, 0, 1, 1}, {&__pyx_n_s_CONTROLLER_AXIS_LEFTY, __pyx_k_CONTROLLER_AXIS_LEFTY, sizeof(__pyx_k_CONTROLLER_AXIS_LEFTY), 0, 0, 1, 1}, {&__pyx_n_s_CONTROLLER_AXIS_MAX, __pyx_k_CONTROLLER_AXIS_MAX, sizeof(__pyx_k_CONTROLLER_AXIS_MAX), 0, 0, 1, 1}, {&__pyx_n_s_CONTROLLER_AXIS_RIGHTX, __pyx_k_CONTROLLER_AXIS_RIGHTX, sizeof(__pyx_k_CONTROLLER_AXIS_RIGHTX), 0, 0, 1, 1}, {&__pyx_n_s_CONTROLLER_AXIS_RIGHTY, __pyx_k_CONTROLLER_AXIS_RIGHTY, sizeof(__pyx_k_CONTROLLER_AXIS_RIGHTY), 0, 0, 1, 1}, {&__pyx_n_s_CONTROLLER_AXIS_TRIGGERLEFT, __pyx_k_CONTROLLER_AXIS_TRIGGERLEFT, sizeof(__pyx_k_CONTROLLER_AXIS_TRIGGERLEFT), 0, 0, 1, 1}, {&__pyx_n_s_CONTROLLER_AXIS_TRIGGERRIGHT, __pyx_k_CONTROLLER_AXIS_TRIGGERRIGHT, sizeof(__pyx_k_CONTROLLER_AXIS_TRIGGERRIGHT), 0, 0, 1, 1}, {&__pyx_n_s_CONTROLLER_BUTTON_A, __pyx_k_CONTROLLER_BUTTON_A, sizeof(__pyx_k_CONTROLLER_BUTTON_A), 0, 0, 1, 1}, {&__pyx_n_s_CONTROLLER_BUTTON_B, __pyx_k_CONTROLLER_BUTTON_B, sizeof(__pyx_k_CONTROLLER_BUTTON_B), 0, 0, 1, 1}, {&__pyx_n_s_CONTROLLER_BUTTON_BACK, __pyx_k_CONTROLLER_BUTTON_BACK, sizeof(__pyx_k_CONTROLLER_BUTTON_BACK), 0, 0, 1, 1}, {&__pyx_n_s_CONTROLLER_BUTTON_DPAD_DOWN, __pyx_k_CONTROLLER_BUTTON_DPAD_DOWN, sizeof(__pyx_k_CONTROLLER_BUTTON_DPAD_DOWN), 0, 0, 1, 1}, {&__pyx_n_s_CONTROLLER_BUTTON_DPAD_LEFT, __pyx_k_CONTROLLER_BUTTON_DPAD_LEFT, sizeof(__pyx_k_CONTROLLER_BUTTON_DPAD_LEFT), 0, 0, 1, 1}, {&__pyx_n_s_CONTROLLER_BUTTON_DPAD_RIGHT, __pyx_k_CONTROLLER_BUTTON_DPAD_RIGHT, sizeof(__pyx_k_CONTROLLER_BUTTON_DPAD_RIGHT), 0, 0, 1, 1}, {&__pyx_n_s_CONTROLLER_BUTTON_DPAD_UP, __pyx_k_CONTROLLER_BUTTON_DPAD_UP, sizeof(__pyx_k_CONTROLLER_BUTTON_DPAD_UP), 0, 0, 1, 1}, {&__pyx_n_s_CONTROLLER_BUTTON_GUIDE, __pyx_k_CONTROLLER_BUTTON_GUIDE, sizeof(__pyx_k_CONTROLLER_BUTTON_GUIDE), 0, 0, 1, 1}, {&__pyx_n_s_CONTROLLER_BUTTON_INVALID, __pyx_k_CONTROLLER_BUTTON_INVALID, sizeof(__pyx_k_CONTROLLER_BUTTON_INVALID), 0, 0, 1, 1}, {&__pyx_n_s_CONTROLLER_BUTTON_LEFTSHOULDER, __pyx_k_CONTROLLER_BUTTON_LEFTSHOULDER, sizeof(__pyx_k_CONTROLLER_BUTTON_LEFTSHOULDER), 0, 0, 1, 1}, {&__pyx_n_s_CONTROLLER_BUTTON_LEFTSTICK, __pyx_k_CONTROLLER_BUTTON_LEFTSTICK, sizeof(__pyx_k_CONTROLLER_BUTTON_LEFTSTICK), 0, 0, 1, 1}, {&__pyx_n_s_CONTROLLER_BUTTON_MAX, __pyx_k_CONTROLLER_BUTTON_MAX, sizeof(__pyx_k_CONTROLLER_BUTTON_MAX), 0, 0, 1, 1}, {&__pyx_n_s_CONTROLLER_BUTTON_RIGHTSHOULDER, __pyx_k_CONTROLLER_BUTTON_RIGHTSHOULDER, sizeof(__pyx_k_CONTROLLER_BUTTON_RIGHTSHOULDER), 0, 0, 1, 1}, {&__pyx_n_s_CONTROLLER_BUTTON_RIGHTSTICK, __pyx_k_CONTROLLER_BUTTON_RIGHTSTICK, sizeof(__pyx_k_CONTROLLER_BUTTON_RIGHTSTICK), 0, 0, 1, 1}, {&__pyx_n_s_CONTROLLER_BUTTON_START, __pyx_k_CONTROLLER_BUTTON_START, sizeof(__pyx_k_CONTROLLER_BUTTON_START), 0, 0, 1, 1}, {&__pyx_n_s_CONTROLLER_BUTTON_X, __pyx_k_CONTROLLER_BUTTON_X, sizeof(__pyx_k_CONTROLLER_BUTTON_X), 0, 0, 1, 1}, {&__pyx_n_s_CONTROLLER_BUTTON_Y, __pyx_k_CONTROLLER_BUTTON_Y, sizeof(__pyx_k_CONTROLLER_BUTTON_Y), 0, 0, 1, 1}, {&__pyx_n_s_Color, __pyx_k_Color, sizeof(__pyx_k_Color), 0, 0, 1, 1}, {&__pyx_n_s_DOLLARGESTURE, __pyx_k_DOLLARGESTURE, sizeof(__pyx_k_DOLLARGESTURE), 0, 0, 1, 1}, {&__pyx_n_s_DOLLARRECORD, __pyx_k_DOLLARRECORD, sizeof(__pyx_k_DOLLARRECORD), 0, 0, 1, 1}, {&__pyx_n_s_DOUBLEBUF, __pyx_k_DOUBLEBUF, sizeof(__pyx_k_DOUBLEBUF), 0, 0, 1, 1}, {&__pyx_n_s_DROPFILE, __pyx_k_DROPFILE, sizeof(__pyx_k_DROPFILE), 0, 0, 1, 1}, {&__pyx_n_s_FINGERDOWN, __pyx_k_FINGERDOWN, sizeof(__pyx_k_FINGERDOWN), 0, 0, 1, 1}, {&__pyx_n_s_FINGERMOTION, __pyx_k_FINGERMOTION, sizeof(__pyx_k_FINGERMOTION), 0, 0, 1, 1}, {&__pyx_n_s_FINGERUP, __pyx_k_FINGERUP, sizeof(__pyx_k_FINGERUP), 0, 0, 1, 1}, {&__pyx_n_s_FULLSCREEN, __pyx_k_FULLSCREEN, sizeof(__pyx_k_FULLSCREEN), 0, 0, 1, 1}, {&__pyx_n_s_GL_ACCELERATED_VISUAL, __pyx_k_GL_ACCELERATED_VISUAL, sizeof(__pyx_k_GL_ACCELERATED_VISUAL), 0, 0, 1, 1}, {&__pyx_n_s_GL_ACCUM_ALPHA_SIZE, __pyx_k_GL_ACCUM_ALPHA_SIZE, sizeof(__pyx_k_GL_ACCUM_ALPHA_SIZE), 0, 0, 1, 1}, {&__pyx_n_s_GL_ACCUM_BLUE_SIZE, __pyx_k_GL_ACCUM_BLUE_SIZE, sizeof(__pyx_k_GL_ACCUM_BLUE_SIZE), 0, 0, 1, 1}, {&__pyx_n_s_GL_ACCUM_GREEN_SIZE, __pyx_k_GL_ACCUM_GREEN_SIZE, sizeof(__pyx_k_GL_ACCUM_GREEN_SIZE), 0, 0, 1, 1}, {&__pyx_n_s_GL_ACCUM_RED_SIZE, __pyx_k_GL_ACCUM_RED_SIZE, sizeof(__pyx_k_GL_ACCUM_RED_SIZE), 0, 0, 1, 1}, {&__pyx_n_s_GL_ALPHA_SIZE, __pyx_k_GL_ALPHA_SIZE, sizeof(__pyx_k_GL_ALPHA_SIZE), 0, 0, 1, 1}, {&__pyx_n_s_GL_BLUE_SIZE, __pyx_k_GL_BLUE_SIZE, sizeof(__pyx_k_GL_BLUE_SIZE), 0, 0, 1, 1}, {&__pyx_n_s_GL_BUFFER_SIZE, __pyx_k_GL_BUFFER_SIZE, sizeof(__pyx_k_GL_BUFFER_SIZE), 0, 0, 1, 1}, {&__pyx_n_s_GL_CONTEXT_EGL, __pyx_k_GL_CONTEXT_EGL, sizeof(__pyx_k_GL_CONTEXT_EGL), 0, 0, 1, 1}, {&__pyx_n_s_GL_CONTEXT_FLAGS, __pyx_k_GL_CONTEXT_FLAGS, sizeof(__pyx_k_GL_CONTEXT_FLAGS), 0, 0, 1, 1}, {&__pyx_n_s_GL_CONTEXT_MAJOR_VERSION, __pyx_k_GL_CONTEXT_MAJOR_VERSION, sizeof(__pyx_k_GL_CONTEXT_MAJOR_VERSION), 0, 0, 1, 1}, {&__pyx_n_s_GL_CONTEXT_MINOR_VERSION, __pyx_k_GL_CONTEXT_MINOR_VERSION, sizeof(__pyx_k_GL_CONTEXT_MINOR_VERSION), 0, 0, 1, 1}, {&__pyx_n_s_GL_CONTEXT_PROFILE_MASK, __pyx_k_GL_CONTEXT_PROFILE_MASK, sizeof(__pyx_k_GL_CONTEXT_PROFILE_MASK), 0, 0, 1, 1}, {&__pyx_n_s_GL_DEPTH_SIZE, __pyx_k_GL_DEPTH_SIZE, sizeof(__pyx_k_GL_DEPTH_SIZE), 0, 0, 1, 1}, {&__pyx_n_s_GL_DOUBLEBUFFER, __pyx_k_GL_DOUBLEBUFFER, sizeof(__pyx_k_GL_DOUBLEBUFFER), 0, 0, 1, 1}, {&__pyx_n_s_GL_FRAMEBUFFER_SRGB_CAPABLE, __pyx_k_GL_FRAMEBUFFER_SRGB_CAPABLE, sizeof(__pyx_k_GL_FRAMEBUFFER_SRGB_CAPABLE), 0, 0, 1, 1}, {&__pyx_n_s_GL_GREEN_SIZE, __pyx_k_GL_GREEN_SIZE, sizeof(__pyx_k_GL_GREEN_SIZE), 0, 0, 1, 1}, {&__pyx_n_s_GL_MULTISAMPLEBUFFERS, __pyx_k_GL_MULTISAMPLEBUFFERS, sizeof(__pyx_k_GL_MULTISAMPLEBUFFERS), 0, 0, 1, 1}, {&__pyx_n_s_GL_MULTISAMPLESAMPLES, __pyx_k_GL_MULTISAMPLESAMPLES, sizeof(__pyx_k_GL_MULTISAMPLESAMPLES), 0, 0, 1, 1}, {&__pyx_n_s_GL_RED_SIZE, __pyx_k_GL_RED_SIZE, sizeof(__pyx_k_GL_RED_SIZE), 0, 0, 1, 1}, {&__pyx_n_s_GL_RETAINED_BACKING, __pyx_k_GL_RETAINED_BACKING, sizeof(__pyx_k_GL_RETAINED_BACKING), 0, 0, 1, 1}, {&__pyx_n_s_GL_SHARE_WITH_CURRENT_CONTEXT, __pyx_k_GL_SHARE_WITH_CURRENT_CONTEXT, sizeof(__pyx_k_GL_SHARE_WITH_CURRENT_CONTEXT), 0, 0, 1, 1}, {&__pyx_n_s_GL_STENCIL_SIZE, __pyx_k_GL_STENCIL_SIZE, sizeof(__pyx_k_GL_STENCIL_SIZE), 0, 0, 1, 1}, {&__pyx_n_s_GL_STEREO, __pyx_k_GL_STEREO, sizeof(__pyx_k_GL_STEREO), 0, 0, 1, 1}, {&__pyx_n_s_GL_SWAP_CONTROL, __pyx_k_GL_SWAP_CONTROL, sizeof(__pyx_k_GL_SWAP_CONTROL), 0, 0, 1, 1}, {&__pyx_n_s_HWSURFACE, __pyx_k_HWSURFACE, sizeof(__pyx_k_HWSURFACE), 0, 0, 1, 1}, {&__pyx_n_s_JOYAXISMOTION, __pyx_k_JOYAXISMOTION, sizeof(__pyx_k_JOYAXISMOTION), 0, 0, 1, 1}, {&__pyx_n_s_JOYBALLMOTION, __pyx_k_JOYBALLMOTION, sizeof(__pyx_k_JOYBALLMOTION), 0, 0, 1, 1}, {&__pyx_n_s_JOYBUTTONDOWN, __pyx_k_JOYBUTTONDOWN, sizeof(__pyx_k_JOYBUTTONDOWN), 0, 0, 1, 1}, {&__pyx_n_s_JOYBUTTONUP, __pyx_k_JOYBUTTONUP, sizeof(__pyx_k_JOYBUTTONUP), 0, 0, 1, 1}, {&__pyx_n_s_JOYDEVICEADDED, __pyx_k_JOYDEVICEADDED, sizeof(__pyx_k_JOYDEVICEADDED), 0, 0, 1, 1}, {&__pyx_n_s_JOYDEVICEREMOVED, __pyx_k_JOYDEVICEREMOVED, sizeof(__pyx_k_JOYDEVICEREMOVED), 0, 0, 1, 1}, {&__pyx_n_s_JOYHATMOTION, __pyx_k_JOYHATMOTION, sizeof(__pyx_k_JOYHATMOTION), 0, 0, 1, 1}, {&__pyx_n_s_KEYDOWN, __pyx_k_KEYDOWN, sizeof(__pyx_k_KEYDOWN), 0, 0, 1, 1}, {&__pyx_n_s_KEYUP, __pyx_k_KEYUP, sizeof(__pyx_k_KEYUP), 0, 0, 1, 1}, {&__pyx_n_s_KMOD_ALT, __pyx_k_KMOD_ALT, sizeof(__pyx_k_KMOD_ALT), 0, 0, 1, 1}, {&__pyx_n_s_KMOD_CAPS, __pyx_k_KMOD_CAPS, sizeof(__pyx_k_KMOD_CAPS), 0, 0, 1, 1}, {&__pyx_n_s_KMOD_CTRL, __pyx_k_KMOD_CTRL, sizeof(__pyx_k_KMOD_CTRL), 0, 0, 1, 1}, {&__pyx_n_s_KMOD_GUI, __pyx_k_KMOD_GUI, sizeof(__pyx_k_KMOD_GUI), 0, 0, 1, 1}, {&__pyx_n_s_KMOD_LALT, __pyx_k_KMOD_LALT, sizeof(__pyx_k_KMOD_LALT), 0, 0, 1, 1}, {&__pyx_n_s_KMOD_LCTRL, __pyx_k_KMOD_LCTRL, sizeof(__pyx_k_KMOD_LCTRL), 0, 0, 1, 1}, {&__pyx_n_s_KMOD_LGUI, __pyx_k_KMOD_LGUI, sizeof(__pyx_k_KMOD_LGUI), 0, 0, 1, 1}, {&__pyx_n_s_KMOD_LMETA, __pyx_k_KMOD_LMETA, sizeof(__pyx_k_KMOD_LMETA), 0, 0, 1, 1}, {&__pyx_n_s_KMOD_LSHIFT, __pyx_k_KMOD_LSHIFT, sizeof(__pyx_k_KMOD_LSHIFT), 0, 0, 1, 1}, {&__pyx_n_s_KMOD_META, __pyx_k_KMOD_META, sizeof(__pyx_k_KMOD_META), 0, 0, 1, 1}, {&__pyx_n_s_KMOD_MODE, __pyx_k_KMOD_MODE, sizeof(__pyx_k_KMOD_MODE), 0, 0, 1, 1}, {&__pyx_n_s_KMOD_NONE, __pyx_k_KMOD_NONE, sizeof(__pyx_k_KMOD_NONE), 0, 0, 1, 1}, {&__pyx_n_s_KMOD_NUM, __pyx_k_KMOD_NUM, sizeof(__pyx_k_KMOD_NUM), 0, 0, 1, 1}, {&__pyx_n_s_KMOD_RALT, __pyx_k_KMOD_RALT, sizeof(__pyx_k_KMOD_RALT), 0, 0, 1, 1}, {&__pyx_n_s_KMOD_RCTRL, __pyx_k_KMOD_RCTRL, sizeof(__pyx_k_KMOD_RCTRL), 0, 0, 1, 1}, {&__pyx_n_s_KMOD_RGUI, __pyx_k_KMOD_RGUI, sizeof(__pyx_k_KMOD_RGUI), 0, 0, 1, 1}, {&__pyx_n_s_KMOD_RMETA, __pyx_k_KMOD_RMETA, sizeof(__pyx_k_KMOD_RMETA), 0, 0, 1, 1}, {&__pyx_n_s_KMOD_RSHIFT, __pyx_k_KMOD_RSHIFT, sizeof(__pyx_k_KMOD_RSHIFT), 0, 0, 1, 1}, {&__pyx_n_s_KMOD_SHIFT, __pyx_k_KMOD_SHIFT, sizeof(__pyx_k_KMOD_SHIFT), 0, 0, 1, 1}, {&__pyx_n_s_K_0, __pyx_k_K_0, sizeof(__pyx_k_K_0), 0, 0, 1, 1}, {&__pyx_n_s_K_1, __pyx_k_K_1, sizeof(__pyx_k_K_1), 0, 0, 1, 1}, {&__pyx_n_s_K_2, __pyx_k_K_2, sizeof(__pyx_k_K_2), 0, 0, 1, 1}, {&__pyx_n_s_K_3, __pyx_k_K_3, sizeof(__pyx_k_K_3), 0, 0, 1, 1}, {&__pyx_n_s_K_4, __pyx_k_K_4, sizeof(__pyx_k_K_4), 0, 0, 1, 1}, {&__pyx_n_s_K_5, __pyx_k_K_5, sizeof(__pyx_k_K_5), 0, 0, 1, 1}, {&__pyx_n_s_K_6, __pyx_k_K_6, sizeof(__pyx_k_K_6), 0, 0, 1, 1}, {&__pyx_n_s_K_7, __pyx_k_K_7, sizeof(__pyx_k_K_7), 0, 0, 1, 1}, {&__pyx_n_s_K_8, __pyx_k_K_8, sizeof(__pyx_k_K_8), 0, 0, 1, 1}, {&__pyx_n_s_K_9, __pyx_k_K_9, sizeof(__pyx_k_K_9), 0, 0, 1, 1}, {&__pyx_n_s_K_AC_BACK, __pyx_k_K_AC_BACK, sizeof(__pyx_k_K_AC_BACK), 0, 0, 1, 1}, {&__pyx_n_s_K_AC_BOOKMARKS, __pyx_k_K_AC_BOOKMARKS, sizeof(__pyx_k_K_AC_BOOKMARKS), 0, 0, 1, 1}, {&__pyx_n_s_K_AC_FORWARD, __pyx_k_K_AC_FORWARD, sizeof(__pyx_k_K_AC_FORWARD), 0, 0, 1, 1}, {&__pyx_n_s_K_AC_HOME, __pyx_k_K_AC_HOME, sizeof(__pyx_k_K_AC_HOME), 0, 0, 1, 1}, {&__pyx_n_s_K_AC_REFRESH, __pyx_k_K_AC_REFRESH, sizeof(__pyx_k_K_AC_REFRESH), 0, 0, 1, 1}, {&__pyx_n_s_K_AC_SEARCH, __pyx_k_K_AC_SEARCH, sizeof(__pyx_k_K_AC_SEARCH), 0, 0, 1, 1}, {&__pyx_n_s_K_AC_STOP, __pyx_k_K_AC_STOP, sizeof(__pyx_k_K_AC_STOP), 0, 0, 1, 1}, {&__pyx_n_s_K_AGAIN, __pyx_k_K_AGAIN, sizeof(__pyx_k_K_AGAIN), 0, 0, 1, 1}, {&__pyx_n_s_K_ALTERASE, __pyx_k_K_ALTERASE, sizeof(__pyx_k_K_ALTERASE), 0, 0, 1, 1}, {&__pyx_n_s_K_AMPERSAND, __pyx_k_K_AMPERSAND, sizeof(__pyx_k_K_AMPERSAND), 0, 0, 1, 1}, {&__pyx_n_s_K_APPLICATION, __pyx_k_K_APPLICATION, sizeof(__pyx_k_K_APPLICATION), 0, 0, 1, 1}, {&__pyx_n_s_K_ASTERISK, __pyx_k_K_ASTERISK, sizeof(__pyx_k_K_ASTERISK), 0, 0, 1, 1}, {&__pyx_n_s_K_AT, __pyx_k_K_AT, sizeof(__pyx_k_K_AT), 0, 0, 1, 1}, {&__pyx_n_s_K_AUDIOMUTE, __pyx_k_K_AUDIOMUTE, sizeof(__pyx_k_K_AUDIOMUTE), 0, 0, 1, 1}, {&__pyx_n_s_K_AUDIONEXT, __pyx_k_K_AUDIONEXT, sizeof(__pyx_k_K_AUDIONEXT), 0, 0, 1, 1}, {&__pyx_n_s_K_AUDIOPLAY, __pyx_k_K_AUDIOPLAY, sizeof(__pyx_k_K_AUDIOPLAY), 0, 0, 1, 1}, {&__pyx_n_s_K_AUDIOPREV, __pyx_k_K_AUDIOPREV, sizeof(__pyx_k_K_AUDIOPREV), 0, 0, 1, 1}, {&__pyx_n_s_K_AUDIOSTOP, __pyx_k_K_AUDIOSTOP, sizeof(__pyx_k_K_AUDIOSTOP), 0, 0, 1, 1}, {&__pyx_n_s_K_BACKQUOTE, __pyx_k_K_BACKQUOTE, sizeof(__pyx_k_K_BACKQUOTE), 0, 0, 1, 1}, {&__pyx_n_s_K_BACKSLASH, __pyx_k_K_BACKSLASH, sizeof(__pyx_k_K_BACKSLASH), 0, 0, 1, 1}, {&__pyx_n_s_K_BACKSPACE, __pyx_k_K_BACKSPACE, sizeof(__pyx_k_K_BACKSPACE), 0, 0, 1, 1}, {&__pyx_n_s_K_BREAK, __pyx_k_K_BREAK, sizeof(__pyx_k_K_BREAK), 0, 0, 1, 1}, {&__pyx_n_s_K_BRIGHTNESSDOWN, __pyx_k_K_BRIGHTNESSDOWN, sizeof(__pyx_k_K_BRIGHTNESSDOWN), 0, 0, 1, 1}, {&__pyx_n_s_K_BRIGHTNESSUP, __pyx_k_K_BRIGHTNESSUP, sizeof(__pyx_k_K_BRIGHTNESSUP), 0, 0, 1, 1}, {&__pyx_n_s_K_CALCULATOR, __pyx_k_K_CALCULATOR, sizeof(__pyx_k_K_CALCULATOR), 0, 0, 1, 1}, {&__pyx_n_s_K_CANCEL, __pyx_k_K_CANCEL, sizeof(__pyx_k_K_CANCEL), 0, 0, 1, 1}, {&__pyx_n_s_K_CAPSLOCK, __pyx_k_K_CAPSLOCK, sizeof(__pyx_k_K_CAPSLOCK), 0, 0, 1, 1}, {&__pyx_n_s_K_CARET, __pyx_k_K_CARET, sizeof(__pyx_k_K_CARET), 0, 0, 1, 1}, {&__pyx_n_s_K_CLEAR, __pyx_k_K_CLEAR, sizeof(__pyx_k_K_CLEAR), 0, 0, 1, 1}, {&__pyx_n_s_K_CLEARAGAIN, __pyx_k_K_CLEARAGAIN, sizeof(__pyx_k_K_CLEARAGAIN), 0, 0, 1, 1}, {&__pyx_n_s_K_COLON, __pyx_k_K_COLON, sizeof(__pyx_k_K_COLON), 0, 0, 1, 1}, {&__pyx_n_s_K_COMMA, __pyx_k_K_COMMA, sizeof(__pyx_k_K_COMMA), 0, 0, 1, 1}, {&__pyx_n_s_K_COMPUTER, __pyx_k_K_COMPUTER, sizeof(__pyx_k_K_COMPUTER), 0, 0, 1, 1}, {&__pyx_n_s_K_COPY, __pyx_k_K_COPY, sizeof(__pyx_k_K_COPY), 0, 0, 1, 1}, {&__pyx_n_s_K_CRSEL, __pyx_k_K_CRSEL, sizeof(__pyx_k_K_CRSEL), 0, 0, 1, 1}, {&__pyx_n_s_K_CURRENCYSUBUNIT, __pyx_k_K_CURRENCYSUBUNIT, sizeof(__pyx_k_K_CURRENCYSUBUNIT), 0, 0, 1, 1}, {&__pyx_n_s_K_CURRENCYUNIT, __pyx_k_K_CURRENCYUNIT, sizeof(__pyx_k_K_CURRENCYUNIT), 0, 0, 1, 1}, {&__pyx_n_s_K_CUT, __pyx_k_K_CUT, sizeof(__pyx_k_K_CUT), 0, 0, 1, 1}, {&__pyx_n_s_K_DECIMALSEPARATOR, __pyx_k_K_DECIMALSEPARATOR, sizeof(__pyx_k_K_DECIMALSEPARATOR), 0, 0, 1, 1}, {&__pyx_n_s_K_DELETE, __pyx_k_K_DELETE, sizeof(__pyx_k_K_DELETE), 0, 0, 1, 1}, {&__pyx_n_s_K_DISPLAYSWITCH, __pyx_k_K_DISPLAYSWITCH, sizeof(__pyx_k_K_DISPLAYSWITCH), 0, 0, 1, 1}, {&__pyx_n_s_K_DOLLAR, __pyx_k_K_DOLLAR, sizeof(__pyx_k_K_DOLLAR), 0, 0, 1, 1}, {&__pyx_n_s_K_DOWN, __pyx_k_K_DOWN, sizeof(__pyx_k_K_DOWN), 0, 0, 1, 1}, {&__pyx_n_s_K_EJECT, __pyx_k_K_EJECT, sizeof(__pyx_k_K_EJECT), 0, 0, 1, 1}, {&__pyx_n_s_K_END, __pyx_k_K_END, sizeof(__pyx_k_K_END), 0, 0, 1, 1}, {&__pyx_n_s_K_EQUALS, __pyx_k_K_EQUALS, sizeof(__pyx_k_K_EQUALS), 0, 0, 1, 1}, {&__pyx_n_s_K_ESCAPE, __pyx_k_K_ESCAPE, sizeof(__pyx_k_K_ESCAPE), 0, 0, 1, 1}, {&__pyx_n_s_K_EURO, __pyx_k_K_EURO, sizeof(__pyx_k_K_EURO), 0, 0, 1, 1}, {&__pyx_n_s_K_EXCLAIM, __pyx_k_K_EXCLAIM, sizeof(__pyx_k_K_EXCLAIM), 0, 0, 1, 1}, {&__pyx_n_s_K_EXECUTE, __pyx_k_K_EXECUTE, sizeof(__pyx_k_K_EXECUTE), 0, 0, 1, 1}, {&__pyx_n_s_K_EXSEL, __pyx_k_K_EXSEL, sizeof(__pyx_k_K_EXSEL), 0, 0, 1, 1}, {&__pyx_n_s_K_F1, __pyx_k_K_F1, sizeof(__pyx_k_K_F1), 0, 0, 1, 1}, {&__pyx_n_s_K_F10, __pyx_k_K_F10, sizeof(__pyx_k_K_F10), 0, 0, 1, 1}, {&__pyx_n_s_K_F11, __pyx_k_K_F11, sizeof(__pyx_k_K_F11), 0, 0, 1, 1}, {&__pyx_n_s_K_F12, __pyx_k_K_F12, sizeof(__pyx_k_K_F12), 0, 0, 1, 1}, {&__pyx_n_s_K_F13, __pyx_k_K_F13, sizeof(__pyx_k_K_F13), 0, 0, 1, 1}, {&__pyx_n_s_K_F14, __pyx_k_K_F14, sizeof(__pyx_k_K_F14), 0, 0, 1, 1}, {&__pyx_n_s_K_F15, __pyx_k_K_F15, sizeof(__pyx_k_K_F15), 0, 0, 1, 1}, {&__pyx_n_s_K_F16, __pyx_k_K_F16, sizeof(__pyx_k_K_F16), 0, 0, 1, 1}, {&__pyx_n_s_K_F17, __pyx_k_K_F17, sizeof(__pyx_k_K_F17), 0, 0, 1, 1}, {&__pyx_n_s_K_F18, __pyx_k_K_F18, sizeof(__pyx_k_K_F18), 0, 0, 1, 1}, {&__pyx_n_s_K_F19, __pyx_k_K_F19, sizeof(__pyx_k_K_F19), 0, 0, 1, 1}, {&__pyx_n_s_K_F2, __pyx_k_K_F2, sizeof(__pyx_k_K_F2), 0, 0, 1, 1}, {&__pyx_n_s_K_F20, __pyx_k_K_F20, sizeof(__pyx_k_K_F20), 0, 0, 1, 1}, {&__pyx_n_s_K_F21, __pyx_k_K_F21, sizeof(__pyx_k_K_F21), 0, 0, 1, 1}, {&__pyx_n_s_K_F22, __pyx_k_K_F22, sizeof(__pyx_k_K_F22), 0, 0, 1, 1}, {&__pyx_n_s_K_F23, __pyx_k_K_F23, sizeof(__pyx_k_K_F23), 0, 0, 1, 1}, {&__pyx_n_s_K_F24, __pyx_k_K_F24, sizeof(__pyx_k_K_F24), 0, 0, 1, 1}, {&__pyx_n_s_K_F3, __pyx_k_K_F3, sizeof(__pyx_k_K_F3), 0, 0, 1, 1}, {&__pyx_n_s_K_F4, __pyx_k_K_F4, sizeof(__pyx_k_K_F4), 0, 0, 1, 1}, {&__pyx_n_s_K_F5, __pyx_k_K_F5, sizeof(__pyx_k_K_F5), 0, 0, 1, 1}, {&__pyx_n_s_K_F6, __pyx_k_K_F6, sizeof(__pyx_k_K_F6), 0, 0, 1, 1}, {&__pyx_n_s_K_F7, __pyx_k_K_F7, sizeof(__pyx_k_K_F7), 0, 0, 1, 1}, {&__pyx_n_s_K_F8, __pyx_k_K_F8, sizeof(__pyx_k_K_F8), 0, 0, 1, 1}, {&__pyx_n_s_K_F9, __pyx_k_K_F9, sizeof(__pyx_k_K_F9), 0, 0, 1, 1}, {&__pyx_n_s_K_FIND, __pyx_k_K_FIND, sizeof(__pyx_k_K_FIND), 0, 0, 1, 1}, {&__pyx_n_s_K_FIRST, __pyx_k_K_FIRST, sizeof(__pyx_k_K_FIRST), 0, 0, 1, 1}, {&__pyx_n_s_K_GREATER, __pyx_k_K_GREATER, sizeof(__pyx_k_K_GREATER), 0, 0, 1, 1}, {&__pyx_n_s_K_HASH, __pyx_k_K_HASH, sizeof(__pyx_k_K_HASH), 0, 0, 1, 1}, {&__pyx_n_s_K_HELP, __pyx_k_K_HELP, sizeof(__pyx_k_K_HELP), 0, 0, 1, 1}, {&__pyx_n_s_K_HOME, __pyx_k_K_HOME, sizeof(__pyx_k_K_HOME), 0, 0, 1, 1}, {&__pyx_n_s_K_INSERT, __pyx_k_K_INSERT, sizeof(__pyx_k_K_INSERT), 0, 0, 1, 1}, {&__pyx_n_s_K_KBDILLUMDOWN, __pyx_k_K_KBDILLUMDOWN, sizeof(__pyx_k_K_KBDILLUMDOWN), 0, 0, 1, 1}, {&__pyx_n_s_K_KBDILLUMTOGGLE, __pyx_k_K_KBDILLUMTOGGLE, sizeof(__pyx_k_K_KBDILLUMTOGGLE), 0, 0, 1, 1}, {&__pyx_n_s_K_KBDILLUMUP, __pyx_k_K_KBDILLUMUP, sizeof(__pyx_k_K_KBDILLUMUP), 0, 0, 1, 1}, {&__pyx_n_s_K_KP0, __pyx_k_K_KP0, sizeof(__pyx_k_K_KP0), 0, 0, 1, 1}, {&__pyx_n_s_K_KP1, __pyx_k_K_KP1, sizeof(__pyx_k_K_KP1), 0, 0, 1, 1}, {&__pyx_n_s_K_KP2, __pyx_k_K_KP2, sizeof(__pyx_k_K_KP2), 0, 0, 1, 1}, {&__pyx_n_s_K_KP3, __pyx_k_K_KP3, sizeof(__pyx_k_K_KP3), 0, 0, 1, 1}, {&__pyx_n_s_K_KP4, __pyx_k_K_KP4, sizeof(__pyx_k_K_KP4), 0, 0, 1, 1}, {&__pyx_n_s_K_KP5, __pyx_k_K_KP5, sizeof(__pyx_k_K_KP5), 0, 0, 1, 1}, {&__pyx_n_s_K_KP6, __pyx_k_K_KP6, sizeof(__pyx_k_K_KP6), 0, 0, 1, 1}, {&__pyx_n_s_K_KP7, __pyx_k_K_KP7, sizeof(__pyx_k_K_KP7), 0, 0, 1, 1}, {&__pyx_n_s_K_KP8, __pyx_k_K_KP8, sizeof(__pyx_k_K_KP8), 0, 0, 1, 1}, {&__pyx_n_s_K_KP9, __pyx_k_K_KP9, sizeof(__pyx_k_K_KP9), 0, 0, 1, 1}, {&__pyx_n_s_K_KP_0, __pyx_k_K_KP_0, sizeof(__pyx_k_K_KP_0), 0, 0, 1, 1}, {&__pyx_n_s_K_KP_00, __pyx_k_K_KP_00, sizeof(__pyx_k_K_KP_00), 0, 0, 1, 1}, {&__pyx_n_s_K_KP_000, __pyx_k_K_KP_000, sizeof(__pyx_k_K_KP_000), 0, 0, 1, 1}, {&__pyx_n_s_K_KP_1, __pyx_k_K_KP_1, sizeof(__pyx_k_K_KP_1), 0, 0, 1, 1}, {&__pyx_n_s_K_KP_2, __pyx_k_K_KP_2, sizeof(__pyx_k_K_KP_2), 0, 0, 1, 1}, {&__pyx_n_s_K_KP_3, __pyx_k_K_KP_3, sizeof(__pyx_k_K_KP_3), 0, 0, 1, 1}, {&__pyx_n_s_K_KP_4, __pyx_k_K_KP_4, sizeof(__pyx_k_K_KP_4), 0, 0, 1, 1}, {&__pyx_n_s_K_KP_5, __pyx_k_K_KP_5, sizeof(__pyx_k_K_KP_5), 0, 0, 1, 1}, {&__pyx_n_s_K_KP_6, __pyx_k_K_KP_6, sizeof(__pyx_k_K_KP_6), 0, 0, 1, 1}, {&__pyx_n_s_K_KP_7, __pyx_k_K_KP_7, sizeof(__pyx_k_K_KP_7), 0, 0, 1, 1}, {&__pyx_n_s_K_KP_8, __pyx_k_K_KP_8, sizeof(__pyx_k_K_KP_8), 0, 0, 1, 1}, {&__pyx_n_s_K_KP_9, __pyx_k_K_KP_9, sizeof(__pyx_k_K_KP_9), 0, 0, 1, 1}, {&__pyx_n_s_K_KP_A, __pyx_k_K_KP_A, sizeof(__pyx_k_K_KP_A), 0, 0, 1, 1}, {&__pyx_n_s_K_KP_AMPERSAND, __pyx_k_K_KP_AMPERSAND, sizeof(__pyx_k_K_KP_AMPERSAND), 0, 0, 1, 1}, {&__pyx_n_s_K_KP_AT, __pyx_k_K_KP_AT, sizeof(__pyx_k_K_KP_AT), 0, 0, 1, 1}, {&__pyx_n_s_K_KP_B, __pyx_k_K_KP_B, sizeof(__pyx_k_K_KP_B), 0, 0, 1, 1}, {&__pyx_n_s_K_KP_BACKSPACE, __pyx_k_K_KP_BACKSPACE, sizeof(__pyx_k_K_KP_BACKSPACE), 0, 0, 1, 1}, {&__pyx_n_s_K_KP_BINARY, __pyx_k_K_KP_BINARY, sizeof(__pyx_k_K_KP_BINARY), 0, 0, 1, 1}, {&__pyx_n_s_K_KP_C, __pyx_k_K_KP_C, sizeof(__pyx_k_K_KP_C), 0, 0, 1, 1}, {&__pyx_n_s_K_KP_CLEAR, __pyx_k_K_KP_CLEAR, sizeof(__pyx_k_K_KP_CLEAR), 0, 0, 1, 1}, {&__pyx_n_s_K_KP_CLEARENTRY, __pyx_k_K_KP_CLEARENTRY, sizeof(__pyx_k_K_KP_CLEARENTRY), 0, 0, 1, 1}, {&__pyx_n_s_K_KP_COLON, __pyx_k_K_KP_COLON, sizeof(__pyx_k_K_KP_COLON), 0, 0, 1, 1}, {&__pyx_n_s_K_KP_COMMA, __pyx_k_K_KP_COMMA, sizeof(__pyx_k_K_KP_COMMA), 0, 0, 1, 1}, {&__pyx_n_s_K_KP_D, __pyx_k_K_KP_D, sizeof(__pyx_k_K_KP_D), 0, 0, 1, 1}, {&__pyx_n_s_K_KP_DBLAMPERSAND, __pyx_k_K_KP_DBLAMPERSAND, sizeof(__pyx_k_K_KP_DBLAMPERSAND), 0, 0, 1, 1}, {&__pyx_n_s_K_KP_DBLVERTICALBAR, __pyx_k_K_KP_DBLVERTICALBAR, sizeof(__pyx_k_K_KP_DBLVERTICALBAR), 0, 0, 1, 1}, {&__pyx_n_s_K_KP_DECIMAL, __pyx_k_K_KP_DECIMAL, sizeof(__pyx_k_K_KP_DECIMAL), 0, 0, 1, 1}, {&__pyx_n_s_K_KP_DIVIDE, __pyx_k_K_KP_DIVIDE, sizeof(__pyx_k_K_KP_DIVIDE), 0, 0, 1, 1}, {&__pyx_n_s_K_KP_E, __pyx_k_K_KP_E, sizeof(__pyx_k_K_KP_E), 0, 0, 1, 1}, {&__pyx_n_s_K_KP_ENTER, __pyx_k_K_KP_ENTER, sizeof(__pyx_k_K_KP_ENTER), 0, 0, 1, 1}, {&__pyx_n_s_K_KP_EQUALS, __pyx_k_K_KP_EQUALS, sizeof(__pyx_k_K_KP_EQUALS), 0, 0, 1, 1}, {&__pyx_n_s_K_KP_EQUALSAS400, __pyx_k_K_KP_EQUALSAS400, sizeof(__pyx_k_K_KP_EQUALSAS400), 0, 0, 1, 1}, {&__pyx_n_s_K_KP_EXCLAM, __pyx_k_K_KP_EXCLAM, sizeof(__pyx_k_K_KP_EXCLAM), 0, 0, 1, 1}, {&__pyx_n_s_K_KP_F, __pyx_k_K_KP_F, sizeof(__pyx_k_K_KP_F), 0, 0, 1, 1}, {&__pyx_n_s_K_KP_GREATER, __pyx_k_K_KP_GREATER, sizeof(__pyx_k_K_KP_GREATER), 0, 0, 1, 1}, {&__pyx_n_s_K_KP_HASH, __pyx_k_K_KP_HASH, sizeof(__pyx_k_K_KP_HASH), 0, 0, 1, 1}, {&__pyx_n_s_K_KP_HEXADECIMAL, __pyx_k_K_KP_HEXADECIMAL, sizeof(__pyx_k_K_KP_HEXADECIMAL), 0, 0, 1, 1}, {&__pyx_n_s_K_KP_LEFTBRACE, __pyx_k_K_KP_LEFTBRACE, sizeof(__pyx_k_K_KP_LEFTBRACE), 0, 0, 1, 1}, {&__pyx_n_s_K_KP_LEFTPAREN, __pyx_k_K_KP_LEFTPAREN, sizeof(__pyx_k_K_KP_LEFTPAREN), 0, 0, 1, 1}, {&__pyx_n_s_K_KP_LESS, __pyx_k_K_KP_LESS, sizeof(__pyx_k_K_KP_LESS), 0, 0, 1, 1}, {&__pyx_n_s_K_KP_MEMADD, __pyx_k_K_KP_MEMADD, sizeof(__pyx_k_K_KP_MEMADD), 0, 0, 1, 1}, {&__pyx_n_s_K_KP_MEMCLEAR, __pyx_k_K_KP_MEMCLEAR, sizeof(__pyx_k_K_KP_MEMCLEAR), 0, 0, 1, 1}, {&__pyx_n_s_K_KP_MEMDIVIDE, __pyx_k_K_KP_MEMDIVIDE, sizeof(__pyx_k_K_KP_MEMDIVIDE), 0, 0, 1, 1}, {&__pyx_n_s_K_KP_MEMMULTIPLY, __pyx_k_K_KP_MEMMULTIPLY, sizeof(__pyx_k_K_KP_MEMMULTIPLY), 0, 0, 1, 1}, {&__pyx_n_s_K_KP_MEMRECALL, __pyx_k_K_KP_MEMRECALL, sizeof(__pyx_k_K_KP_MEMRECALL), 0, 0, 1, 1}, {&__pyx_n_s_K_KP_MEMSTORE, __pyx_k_K_KP_MEMSTORE, sizeof(__pyx_k_K_KP_MEMSTORE), 0, 0, 1, 1}, {&__pyx_n_s_K_KP_MEMSUBTRACT, __pyx_k_K_KP_MEMSUBTRACT, sizeof(__pyx_k_K_KP_MEMSUBTRACT), 0, 0, 1, 1}, {&__pyx_n_s_K_KP_MINUS, __pyx_k_K_KP_MINUS, sizeof(__pyx_k_K_KP_MINUS), 0, 0, 1, 1}, {&__pyx_n_s_K_KP_MULTIPLY, __pyx_k_K_KP_MULTIPLY, sizeof(__pyx_k_K_KP_MULTIPLY), 0, 0, 1, 1}, {&__pyx_n_s_K_KP_OCTAL, __pyx_k_K_KP_OCTAL, sizeof(__pyx_k_K_KP_OCTAL), 0, 0, 1, 1}, {&__pyx_n_s_K_KP_PERCENT, __pyx_k_K_KP_PERCENT, sizeof(__pyx_k_K_KP_PERCENT), 0, 0, 1, 1}, {&__pyx_n_s_K_KP_PERIOD, __pyx_k_K_KP_PERIOD, sizeof(__pyx_k_K_KP_PERIOD), 0, 0, 1, 1}, {&__pyx_n_s_K_KP_PLUS, __pyx_k_K_KP_PLUS, sizeof(__pyx_k_K_KP_PLUS), 0, 0, 1, 1}, {&__pyx_n_s_K_KP_PLUSMINUS, __pyx_k_K_KP_PLUSMINUS, sizeof(__pyx_k_K_KP_PLUSMINUS), 0, 0, 1, 1}, {&__pyx_n_s_K_KP_POWER, __pyx_k_K_KP_POWER, sizeof(__pyx_k_K_KP_POWER), 0, 0, 1, 1}, {&__pyx_n_s_K_KP_RIGHTBRACE, __pyx_k_K_KP_RIGHTBRACE, sizeof(__pyx_k_K_KP_RIGHTBRACE), 0, 0, 1, 1}, {&__pyx_n_s_K_KP_RIGHTPAREN, __pyx_k_K_KP_RIGHTPAREN, sizeof(__pyx_k_K_KP_RIGHTPAREN), 0, 0, 1, 1}, {&__pyx_n_s_K_KP_SPACE, __pyx_k_K_KP_SPACE, sizeof(__pyx_k_K_KP_SPACE), 0, 0, 1, 1}, {&__pyx_n_s_K_KP_TAB, __pyx_k_K_KP_TAB, sizeof(__pyx_k_K_KP_TAB), 0, 0, 1, 1}, {&__pyx_n_s_K_KP_VERTICALBAR, __pyx_k_K_KP_VERTICALBAR, sizeof(__pyx_k_K_KP_VERTICALBAR), 0, 0, 1, 1}, {&__pyx_n_s_K_KP_XOR, __pyx_k_K_KP_XOR, sizeof(__pyx_k_K_KP_XOR), 0, 0, 1, 1}, {&__pyx_n_s_K_LALT, __pyx_k_K_LALT, sizeof(__pyx_k_K_LALT), 0, 0, 1, 1}, {&__pyx_n_s_K_LAST, __pyx_k_K_LAST, sizeof(__pyx_k_K_LAST), 0, 0, 1, 1}, {&__pyx_n_s_K_LCTRL, __pyx_k_K_LCTRL, sizeof(__pyx_k_K_LCTRL), 0, 0, 1, 1}, {&__pyx_n_s_K_LEFT, __pyx_k_K_LEFT, sizeof(__pyx_k_K_LEFT), 0, 0, 1, 1}, {&__pyx_n_s_K_LEFTBRACKET, __pyx_k_K_LEFTBRACKET, sizeof(__pyx_k_K_LEFTBRACKET), 0, 0, 1, 1}, {&__pyx_n_s_K_LEFTPAREN, __pyx_k_K_LEFTPAREN, sizeof(__pyx_k_K_LEFTPAREN), 0, 0, 1, 1}, {&__pyx_n_s_K_LESS, __pyx_k_K_LESS, sizeof(__pyx_k_K_LESS), 0, 0, 1, 1}, {&__pyx_n_s_K_LGUI, __pyx_k_K_LGUI, sizeof(__pyx_k_K_LGUI), 0, 0, 1, 1}, {&__pyx_n_s_K_LMETA, __pyx_k_K_LMETA, sizeof(__pyx_k_K_LMETA), 0, 0, 1, 1}, {&__pyx_n_s_K_LSHIFT, __pyx_k_K_LSHIFT, sizeof(__pyx_k_K_LSHIFT), 0, 0, 1, 1}, {&__pyx_n_s_K_LSUPER, __pyx_k_K_LSUPER, sizeof(__pyx_k_K_LSUPER), 0, 0, 1, 1}, {&__pyx_n_s_K_MAIL, __pyx_k_K_MAIL, sizeof(__pyx_k_K_MAIL), 0, 0, 1, 1}, {&__pyx_n_s_K_MEDIASELECT, __pyx_k_K_MEDIASELECT, sizeof(__pyx_k_K_MEDIASELECT), 0, 0, 1, 1}, {&__pyx_n_s_K_MENU, __pyx_k_K_MENU, sizeof(__pyx_k_K_MENU), 0, 0, 1, 1}, {&__pyx_n_s_K_MINUS, __pyx_k_K_MINUS, sizeof(__pyx_k_K_MINUS), 0, 0, 1, 1}, {&__pyx_n_s_K_MODE, __pyx_k_K_MODE, sizeof(__pyx_k_K_MODE), 0, 0, 1, 1}, {&__pyx_n_s_K_MUTE, __pyx_k_K_MUTE, sizeof(__pyx_k_K_MUTE), 0, 0, 1, 1}, {&__pyx_n_s_K_NUMLOCK, __pyx_k_K_NUMLOCK, sizeof(__pyx_k_K_NUMLOCK), 0, 0, 1, 1}, {&__pyx_n_s_K_NUMLOCKCLEAR, __pyx_k_K_NUMLOCKCLEAR, sizeof(__pyx_k_K_NUMLOCKCLEAR), 0, 0, 1, 1}, {&__pyx_n_s_K_OPER, __pyx_k_K_OPER, sizeof(__pyx_k_K_OPER), 0, 0, 1, 1}, {&__pyx_n_s_K_OUT, __pyx_k_K_OUT, sizeof(__pyx_k_K_OUT), 0, 0, 1, 1}, {&__pyx_n_s_K_PAGEDOWN, __pyx_k_K_PAGEDOWN, sizeof(__pyx_k_K_PAGEDOWN), 0, 0, 1, 1}, {&__pyx_n_s_K_PAGEUP, __pyx_k_K_PAGEUP, sizeof(__pyx_k_K_PAGEUP), 0, 0, 1, 1}, {&__pyx_n_s_K_PASTE, __pyx_k_K_PASTE, sizeof(__pyx_k_K_PASTE), 0, 0, 1, 1}, {&__pyx_n_s_K_PAUSE, __pyx_k_K_PAUSE, sizeof(__pyx_k_K_PAUSE), 0, 0, 1, 1}, {&__pyx_n_s_K_PERCENT, __pyx_k_K_PERCENT, sizeof(__pyx_k_K_PERCENT), 0, 0, 1, 1}, {&__pyx_n_s_K_PERIOD, __pyx_k_K_PERIOD, sizeof(__pyx_k_K_PERIOD), 0, 0, 1, 1}, {&__pyx_n_s_K_PLUS, __pyx_k_K_PLUS, sizeof(__pyx_k_K_PLUS), 0, 0, 1, 1}, {&__pyx_n_s_K_POWER, __pyx_k_K_POWER, sizeof(__pyx_k_K_POWER), 0, 0, 1, 1}, {&__pyx_n_s_K_PRINT, __pyx_k_K_PRINT, sizeof(__pyx_k_K_PRINT), 0, 0, 1, 1}, {&__pyx_n_s_K_PRINTSCREEN, __pyx_k_K_PRINTSCREEN, sizeof(__pyx_k_K_PRINTSCREEN), 0, 0, 1, 1}, {&__pyx_n_s_K_PRIOR, __pyx_k_K_PRIOR, sizeof(__pyx_k_K_PRIOR), 0, 0, 1, 1}, {&__pyx_n_s_K_QUESTION, __pyx_k_K_QUESTION, sizeof(__pyx_k_K_QUESTION), 0, 0, 1, 1}, {&__pyx_n_s_K_QUOTE, __pyx_k_K_QUOTE, sizeof(__pyx_k_K_QUOTE), 0, 0, 1, 1}, {&__pyx_n_s_K_QUOTEDBL, __pyx_k_K_QUOTEDBL, sizeof(__pyx_k_K_QUOTEDBL), 0, 0, 1, 1}, {&__pyx_n_s_K_RALT, __pyx_k_K_RALT, sizeof(__pyx_k_K_RALT), 0, 0, 1, 1}, {&__pyx_n_s_K_RCTRL, __pyx_k_K_RCTRL, sizeof(__pyx_k_K_RCTRL), 0, 0, 1, 1}, {&__pyx_n_s_K_RETURN, __pyx_k_K_RETURN, sizeof(__pyx_k_K_RETURN), 0, 0, 1, 1}, {&__pyx_n_s_K_RETURN2, __pyx_k_K_RETURN2, sizeof(__pyx_k_K_RETURN2), 0, 0, 1, 1}, {&__pyx_n_s_K_RGUI, __pyx_k_K_RGUI, sizeof(__pyx_k_K_RGUI), 0, 0, 1, 1}, {&__pyx_n_s_K_RIGHT, __pyx_k_K_RIGHT, sizeof(__pyx_k_K_RIGHT), 0, 0, 1, 1}, {&__pyx_n_s_K_RIGHTBRACKET, __pyx_k_K_RIGHTBRACKET, sizeof(__pyx_k_K_RIGHTBRACKET), 0, 0, 1, 1}, {&__pyx_n_s_K_RIGHTPAREN, __pyx_k_K_RIGHTPAREN, sizeof(__pyx_k_K_RIGHTPAREN), 0, 0, 1, 1}, {&__pyx_n_s_K_RMETA, __pyx_k_K_RMETA, sizeof(__pyx_k_K_RMETA), 0, 0, 1, 1}, {&__pyx_n_s_K_RSHIFT, __pyx_k_K_RSHIFT, sizeof(__pyx_k_K_RSHIFT), 0, 0, 1, 1}, {&__pyx_n_s_K_RSUPER, __pyx_k_K_RSUPER, sizeof(__pyx_k_K_RSUPER), 0, 0, 1, 1}, {&__pyx_n_s_K_SCROLLLOCK, __pyx_k_K_SCROLLLOCK, sizeof(__pyx_k_K_SCROLLLOCK), 0, 0, 1, 1}, {&__pyx_n_s_K_SCROLLOCK, __pyx_k_K_SCROLLOCK, sizeof(__pyx_k_K_SCROLLOCK), 0, 0, 1, 1}, {&__pyx_n_s_K_SELECT, __pyx_k_K_SELECT, sizeof(__pyx_k_K_SELECT), 0, 0, 1, 1}, {&__pyx_n_s_K_SEMICOLON, __pyx_k_K_SEMICOLON, sizeof(__pyx_k_K_SEMICOLON), 0, 0, 1, 1}, {&__pyx_n_s_K_SEPARATOR, __pyx_k_K_SEPARATOR, sizeof(__pyx_k_K_SEPARATOR), 0, 0, 1, 1}, {&__pyx_n_s_K_SLASH, __pyx_k_K_SLASH, sizeof(__pyx_k_K_SLASH), 0, 0, 1, 1}, {&__pyx_n_s_K_SLEEP, __pyx_k_K_SLEEP, sizeof(__pyx_k_K_SLEEP), 0, 0, 1, 1}, {&__pyx_n_s_K_SPACE, __pyx_k_K_SPACE, sizeof(__pyx_k_K_SPACE), 0, 0, 1, 1}, {&__pyx_n_s_K_STOP, __pyx_k_K_STOP, sizeof(__pyx_k_K_STOP), 0, 0, 1, 1}, {&__pyx_n_s_K_SYSREQ, __pyx_k_K_SYSREQ, sizeof(__pyx_k_K_SYSREQ), 0, 0, 1, 1}, {&__pyx_n_s_K_TAB, __pyx_k_K_TAB, sizeof(__pyx_k_K_TAB), 0, 0, 1, 1}, {&__pyx_n_s_K_THOUSANDSSEPARATOR, __pyx_k_K_THOUSANDSSEPARATOR, sizeof(__pyx_k_K_THOUSANDSSEPARATOR), 0, 0, 1, 1}, {&__pyx_n_s_K_UNDERSCORE, __pyx_k_K_UNDERSCORE, sizeof(__pyx_k_K_UNDERSCORE), 0, 0, 1, 1}, {&__pyx_n_s_K_UNDO, __pyx_k_K_UNDO, sizeof(__pyx_k_K_UNDO), 0, 0, 1, 1}, {&__pyx_n_s_K_UNKNOWN, __pyx_k_K_UNKNOWN, sizeof(__pyx_k_K_UNKNOWN), 0, 0, 1, 1}, {&__pyx_n_s_K_UP, __pyx_k_K_UP, sizeof(__pyx_k_K_UP), 0, 0, 1, 1}, {&__pyx_n_s_K_VOLUMEDOWN, __pyx_k_K_VOLUMEDOWN, sizeof(__pyx_k_K_VOLUMEDOWN), 0, 0, 1, 1}, {&__pyx_n_s_K_VOLUMEUP, __pyx_k_K_VOLUMEUP, sizeof(__pyx_k_K_VOLUMEUP), 0, 0, 1, 1}, {&__pyx_n_s_K_WWW, __pyx_k_K_WWW, sizeof(__pyx_k_K_WWW), 0, 0, 1, 1}, {&__pyx_n_s_K_a, __pyx_k_K_a, sizeof(__pyx_k_K_a), 0, 0, 1, 1}, {&__pyx_n_s_K_b, __pyx_k_K_b, sizeof(__pyx_k_K_b), 0, 0, 1, 1}, {&__pyx_n_s_K_c, __pyx_k_K_c, sizeof(__pyx_k_K_c), 0, 0, 1, 1}, {&__pyx_n_s_K_d, __pyx_k_K_d, sizeof(__pyx_k_K_d), 0, 0, 1, 1}, {&__pyx_n_s_K_e, __pyx_k_K_e, sizeof(__pyx_k_K_e), 0, 0, 1, 1}, {&__pyx_n_s_K_f, __pyx_k_K_f, sizeof(__pyx_k_K_f), 0, 0, 1, 1}, {&__pyx_n_s_K_g, __pyx_k_K_g, sizeof(__pyx_k_K_g), 0, 0, 1, 1}, {&__pyx_n_s_K_h, __pyx_k_K_h, sizeof(__pyx_k_K_h), 0, 0, 1, 1}, {&__pyx_n_s_K_i, __pyx_k_K_i, sizeof(__pyx_k_K_i), 0, 0, 1, 1}, {&__pyx_n_s_K_j, __pyx_k_K_j, sizeof(__pyx_k_K_j), 0, 0, 1, 1}, {&__pyx_n_s_K_k, __pyx_k_K_k, sizeof(__pyx_k_K_k), 0, 0, 1, 1}, {&__pyx_n_s_K_l, __pyx_k_K_l, sizeof(__pyx_k_K_l), 0, 0, 1, 1}, {&__pyx_n_s_K_m, __pyx_k_K_m, sizeof(__pyx_k_K_m), 0, 0, 1, 1}, {&__pyx_n_s_K_n, __pyx_k_K_n, sizeof(__pyx_k_K_n), 0, 0, 1, 1}, {&__pyx_n_s_K_o, __pyx_k_K_o, sizeof(__pyx_k_K_o), 0, 0, 1, 1}, {&__pyx_n_s_K_p, __pyx_k_K_p, sizeof(__pyx_k_K_p), 0, 0, 1, 1}, {&__pyx_n_s_K_q, __pyx_k_K_q, sizeof(__pyx_k_K_q), 0, 0, 1, 1}, {&__pyx_n_s_K_r, __pyx_k_K_r, sizeof(__pyx_k_K_r), 0, 0, 1, 1}, {&__pyx_n_s_K_s, __pyx_k_K_s, sizeof(__pyx_k_K_s), 0, 0, 1, 1}, {&__pyx_n_s_K_t, __pyx_k_K_t, sizeof(__pyx_k_K_t), 0, 0, 1, 1}, {&__pyx_n_s_K_u, __pyx_k_K_u, sizeof(__pyx_k_K_u), 0, 0, 1, 1}, {&__pyx_n_s_K_v, __pyx_k_K_v, sizeof(__pyx_k_K_v), 0, 0, 1, 1}, {&__pyx_n_s_K_w, __pyx_k_K_w, sizeof(__pyx_k_K_w), 0, 0, 1, 1}, {&__pyx_n_s_K_x, __pyx_k_K_x, sizeof(__pyx_k_K_x), 0, 0, 1, 1}, {&__pyx_n_s_K_y, __pyx_k_K_y, sizeof(__pyx_k_K_y), 0, 0, 1, 1}, {&__pyx_n_s_K_z, __pyx_k_K_z, sizeof(__pyx_k_K_z), 0, 0, 1, 1}, {&__pyx_n_s_LASTEVENT, __pyx_k_LASTEVENT, sizeof(__pyx_k_LASTEVENT), 0, 0, 1, 1}, {&__pyx_n_s_LIL_ENDIAN, __pyx_k_LIL_ENDIAN, sizeof(__pyx_k_LIL_ENDIAN), 0, 0, 1, 1}, {&__pyx_n_s_MOUSEBUTTONDOWN, __pyx_k_MOUSEBUTTONDOWN, sizeof(__pyx_k_MOUSEBUTTONDOWN), 0, 0, 1, 1}, {&__pyx_n_s_MOUSEBUTTONUP, __pyx_k_MOUSEBUTTONUP, sizeof(__pyx_k_MOUSEBUTTONUP), 0, 0, 1, 1}, {&__pyx_n_s_MOUSEMOTION, __pyx_k_MOUSEMOTION, sizeof(__pyx_k_MOUSEMOTION), 0, 0, 1, 1}, {&__pyx_n_s_MOUSEWHEEL, __pyx_k_MOUSEWHEEL, sizeof(__pyx_k_MOUSEWHEEL), 0, 0, 1, 1}, {&__pyx_n_s_MULTIGESTURE, __pyx_k_MULTIGESTURE, sizeof(__pyx_k_MULTIGESTURE), 0, 0, 1, 1}, {&__pyx_n_s_NOEVENT, __pyx_k_NOEVENT, sizeof(__pyx_k_NOEVENT), 0, 0, 1, 1}, {&__pyx_n_s_NOFRAME, __pyx_k_NOFRAME, sizeof(__pyx_k_NOFRAME), 0, 0, 1, 1}, {&__pyx_n_s_OPENGL, __pyx_k_OPENGL, sizeof(__pyx_k_OPENGL), 0, 0, 1, 1}, {&__pyx_n_s_POWERSTATE_CHARGED, __pyx_k_POWERSTATE_CHARGED, sizeof(__pyx_k_POWERSTATE_CHARGED), 0, 0, 1, 1}, {&__pyx_n_s_POWERSTATE_CHARGING, __pyx_k_POWERSTATE_CHARGING, sizeof(__pyx_k_POWERSTATE_CHARGING), 0, 0, 1, 1}, {&__pyx_n_s_POWERSTATE_NO_BATTERY, __pyx_k_POWERSTATE_NO_BATTERY, sizeof(__pyx_k_POWERSTATE_NO_BATTERY), 0, 0, 1, 1}, {&__pyx_n_s_POWERSTATE_ON_BATTERY, __pyx_k_POWERSTATE_ON_BATTERY, sizeof(__pyx_k_POWERSTATE_ON_BATTERY), 0, 0, 1, 1}, {&__pyx_n_s_POWERSTATE_UNKNOWN, __pyx_k_POWERSTATE_UNKNOWN, sizeof(__pyx_k_POWERSTATE_UNKNOWN), 0, 0, 1, 1}, {&__pyx_n_s_QUIT, __pyx_k_QUIT, sizeof(__pyx_k_QUIT), 0, 0, 1, 1}, {&__pyx_n_s_RENDER_TARGETS_RESET, __pyx_k_RENDER_TARGETS_RESET, sizeof(__pyx_k_RENDER_TARGETS_RESET), 0, 0, 1, 1}, {&__pyx_n_s_RESIZABLE, __pyx_k_RESIZABLE, sizeof(__pyx_k_RESIZABLE), 0, 0, 1, 1}, {&__pyx_n_s_RLEACCEL, __pyx_k_RLEACCEL, sizeof(__pyx_k_RLEACCEL), 0, 0, 1, 1}, {&__pyx_n_s_Rect, __pyx_k_Rect, sizeof(__pyx_k_Rect), 0, 0, 1, 1}, {&__pyx_n_s_SCRAP_TEXT, __pyx_k_SCRAP_TEXT, sizeof(__pyx_k_SCRAP_TEXT), 0, 0, 1, 1}, {&__pyx_n_s_SDL_VERSION_TUPLE, __pyx_k_SDL_VERSION_TUPLE, sizeof(__pyx_k_SDL_VERSION_TUPLE), 0, 0, 1, 1}, {&__pyx_n_s_SRCALPHA, __pyx_k_SRCALPHA, sizeof(__pyx_k_SRCALPHA), 0, 0, 1, 1}, {&__pyx_n_s_SRCCOLORKEY, __pyx_k_SRCCOLORKEY, sizeof(__pyx_k_SRCCOLORKEY), 0, 0, 1, 1}, {&__pyx_n_s_SWSURFACE, __pyx_k_SWSURFACE, sizeof(__pyx_k_SWSURFACE), 0, 0, 1, 1}, {&__pyx_n_s_SYSWMEVENT, __pyx_k_SYSWMEVENT, sizeof(__pyx_k_SYSWMEVENT), 0, 0, 1, 1}, {&__pyx_n_s_TEXTEDITING, __pyx_k_TEXTEDITING, sizeof(__pyx_k_TEXTEDITING), 0, 0, 1, 1}, {&__pyx_n_s_TEXTINPUT, __pyx_k_TEXTINPUT, sizeof(__pyx_k_TEXTINPUT), 0, 0, 1, 1}, {&__pyx_n_s_TOUCH_MOUSEID, __pyx_k_TOUCH_MOUSEID, sizeof(__pyx_k_TOUCH_MOUSEID), 0, 0, 1, 1}, {&__pyx_n_s_USEREVENT, __pyx_k_USEREVENT, sizeof(__pyx_k_USEREVENT), 0, 0, 1, 1}, {&__pyx_n_s_VIDEOEXPOSE, __pyx_k_VIDEOEXPOSE, sizeof(__pyx_k_VIDEOEXPOSE), 0, 0, 1, 1}, {&__pyx_n_s_VIDEORESIZE, __pyx_k_VIDEORESIZE, sizeof(__pyx_k_VIDEORESIZE), 0, 0, 1, 1}, {&__pyx_n_s_WINDOWEVENT, __pyx_k_WINDOWEVENT, sizeof(__pyx_k_WINDOWEVENT), 0, 0, 1, 1}, {&__pyx_n_s_WINDOWPOS_CENTERED, __pyx_k_WINDOWPOS_CENTERED, sizeof(__pyx_k_WINDOWPOS_CENTERED), 0, 0, 1, 1}, {&__pyx_n_s_WINDOWPOS_UNDEFINED, __pyx_k_WINDOWPOS_UNDEFINED, sizeof(__pyx_k_WINDOWPOS_UNDEFINED), 0, 0, 1, 1}, {&__pyx_n_s_WINDOW_ALLOW_HIGHDPI, __pyx_k_WINDOW_ALLOW_HIGHDPI, sizeof(__pyx_k_WINDOW_ALLOW_HIGHDPI), 0, 0, 1, 1}, {&__pyx_n_s_WINDOW_BORDERLESS, __pyx_k_WINDOW_BORDERLESS, sizeof(__pyx_k_WINDOW_BORDERLESS), 0, 0, 1, 1}, {&__pyx_n_s_WINDOW_FOREIGN, __pyx_k_WINDOW_FOREIGN, sizeof(__pyx_k_WINDOW_FOREIGN), 0, 0, 1, 1}, {&__pyx_n_s_WINDOW_FULLSCREEN, __pyx_k_WINDOW_FULLSCREEN, sizeof(__pyx_k_WINDOW_FULLSCREEN), 0, 0, 1, 1}, {&__pyx_n_s_WINDOW_FULLSCREEN_DESKTOP, __pyx_k_WINDOW_FULLSCREEN_DESKTOP, sizeof(__pyx_k_WINDOW_FULLSCREEN_DESKTOP), 0, 0, 1, 1}, {&__pyx_n_s_WINDOW_HIDDEN, __pyx_k_WINDOW_HIDDEN, sizeof(__pyx_k_WINDOW_HIDDEN), 0, 0, 1, 1}, {&__pyx_n_s_WINDOW_INPUT_FOCUS, __pyx_k_WINDOW_INPUT_FOCUS, sizeof(__pyx_k_WINDOW_INPUT_FOCUS), 0, 0, 1, 1}, {&__pyx_n_s_WINDOW_INPUT_GRABBED, __pyx_k_WINDOW_INPUT_GRABBED, sizeof(__pyx_k_WINDOW_INPUT_GRABBED), 0, 0, 1, 1}, {&__pyx_n_s_WINDOW_MAXIMIZED, __pyx_k_WINDOW_MAXIMIZED, sizeof(__pyx_k_WINDOW_MAXIMIZED), 0, 0, 1, 1}, {&__pyx_n_s_WINDOW_MINIMIZED, __pyx_k_WINDOW_MINIMIZED, sizeof(__pyx_k_WINDOW_MINIMIZED), 0, 0, 1, 1}, {&__pyx_n_s_WINDOW_NOFRAME, __pyx_k_WINDOW_NOFRAME, sizeof(__pyx_k_WINDOW_NOFRAME), 0, 0, 1, 1}, {&__pyx_n_s_WINDOW_OPENGL, __pyx_k_WINDOW_OPENGL, sizeof(__pyx_k_WINDOW_OPENGL), 0, 0, 1, 1}, {&__pyx_n_s_WINDOW_RESIZABLE, __pyx_k_WINDOW_RESIZABLE, sizeof(__pyx_k_WINDOW_RESIZABLE), 0, 0, 1, 1}, {&__pyx_n_s_WINDOW_SHOWN, __pyx_k_WINDOW_SHOWN, sizeof(__pyx_k_WINDOW_SHOWN), 0, 0, 1, 1}, {&__pyx_n_s_import, __pyx_k_import, sizeof(__pyx_k_import), 0, 0, 1, 1}, {&__pyx_n_s_main, __pyx_k_main, sizeof(__pyx_k_main), 0, 0, 1, 1}, {&__pyx_n_s_pygame_sdl2_color, __pyx_k_pygame_sdl2_color, sizeof(__pyx_k_pygame_sdl2_color), 0, 0, 1, 1}, {&__pyx_n_s_pygame_sdl2_rect, __pyx_k_pygame_sdl2_rect, sizeof(__pyx_k_pygame_sdl2_rect), 0, 0, 1, 1}, {&__pyx_n_s_test, __pyx_k_test, sizeof(__pyx_k_test), 0, 0, 1, 1}, {&__pyx_kp_s_text_plain, __pyx_k_text_plain, sizeof(__pyx_k_text_plain), 0, 0, 1, 0}, {&__pyx_n_s_update, __pyx_k_update, sizeof(__pyx_k_update), 0, 0, 1, 1}, {0, 0, 0, 0, 0, 0, 0} }; static int __Pyx_InitCachedBuiltins(void) { return 0; } static int __Pyx_InitCachedConstants(void) { __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__Pyx_InitCachedConstants", 0); __Pyx_RefNannyFinishContext(); return 0; } static int __Pyx_InitGlobals(void) { if (__Pyx_InitStrings(__pyx_string_tab) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; __pyx_int_0 = PyInt_FromLong(0); if (unlikely(!__pyx_int_0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_int_1 = PyInt_FromLong(1); if (unlikely(!__pyx_int_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_int_2 = PyInt_FromLong(2); if (unlikely(!__pyx_int_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_int_3 = PyInt_FromLong(3); if (unlikely(!__pyx_int_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_int_4 = PyInt_FromLong(4); if (unlikely(!__pyx_int_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_int_5 = PyInt_FromLong(5); if (unlikely(!__pyx_int_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_int_6 = PyInt_FromLong(6); if (unlikely(!__pyx_int_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_int_7 = PyInt_FromLong(7); if (unlikely(!__pyx_int_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_int_8 = PyInt_FromLong(8); if (unlikely(!__pyx_int_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_int_9 = PyInt_FromLong(9); if (unlikely(!__pyx_int_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_int_16 = PyInt_FromLong(16); if (unlikely(!__pyx_int_16)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_int_17 = PyInt_FromLong(17); if (unlikely(!__pyx_int_17)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_int_1073741824 = PyInt_FromLong(1073741824L); if (unlikely(!__pyx_int_1073741824)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_int_2147483648 = PyInt_FromString((char *)"2147483648", 0, 0); if (unlikely(!__pyx_int_2147483648)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_int_neg_1 = PyInt_FromLong(-1); if (unlikely(!__pyx_int_neg_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} return 0; __pyx_L1_error:; return -1; } #if PY_MAJOR_VERSION < 3 PyMODINIT_FUNC initlocals(void); /*proto*/ PyMODINIT_FUNC initlocals(void) #else PyMODINIT_FUNC PyInit_locals(void); /*proto*/ PyMODINIT_FUNC PyInit_locals(void) #endif { PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; PyObject *__pyx_t_5 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannyDeclarations #if CYTHON_REFNANNY __Pyx_RefNanny = __Pyx_RefNannyImportAPI("refnanny"); if (!__Pyx_RefNanny) { PyErr_Clear(); __Pyx_RefNanny = __Pyx_RefNannyImportAPI("Cython.Runtime.refnanny"); if (!__Pyx_RefNanny) Py_FatalError("failed to import 'refnanny' module"); } #endif __Pyx_RefNannySetupContext("PyMODINIT_FUNC PyInit_locals(void)", 0); if (__Pyx_check_binary_version() < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_empty_tuple = PyTuple_New(0); if (unlikely(!__pyx_empty_tuple)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_empty_bytes = PyBytes_FromStringAndSize("", 0); if (unlikely(!__pyx_empty_bytes)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} #ifdef __Pyx_CyFunction_USED if (__pyx_CyFunction_init() < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} #endif #ifdef __Pyx_FusedFunction_USED if (__pyx_FusedFunction_init() < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} #endif #ifdef __Pyx_Coroutine_USED if (__pyx_Coroutine_init() < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} #endif #ifdef __Pyx_Generator_USED if (__pyx_Generator_init() < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} #endif #ifdef __Pyx_StopAsyncIteration_USED if (__pyx_StopAsyncIteration_init() < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} #endif /*--- Library function declarations ---*/ /*--- Threads initialization code ---*/ #if defined(__PYX_FORCE_INIT_THREADS) && __PYX_FORCE_INIT_THREADS #ifdef WITH_THREAD /* Python build with threading support? */ PyEval_InitThreads(); #endif #endif /*--- Module creation code ---*/ #if PY_MAJOR_VERSION < 3 __pyx_m = Py_InitModule4("locals", __pyx_methods, 0, 0, PYTHON_API_VERSION); Py_XINCREF(__pyx_m); #else __pyx_m = PyModule_Create(&__pyx_moduledef); #endif if (unlikely(!__pyx_m)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_d = PyModule_GetDict(__pyx_m); if (unlikely(!__pyx_d)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} Py_INCREF(__pyx_d); __pyx_b = PyImport_AddModule(__Pyx_BUILTIN_MODULE_NAME); if (unlikely(!__pyx_b)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} #if CYTHON_COMPILING_IN_PYPY Py_INCREF(__pyx_b); #endif if (PyObject_SetAttrString(__pyx_m, "__builtins__", __pyx_b) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; /*--- Initialize various global constants etc. ---*/ if (__Pyx_InitGlobals() < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} #if PY_MAJOR_VERSION < 3 && (__PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT) if (__Pyx_init_sys_getdefaultencoding_params() < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} #endif if (__pyx_module_is_main_pygame_sdl2__locals) { if (PyObject_SetAttrString(__pyx_m, "__name__", __pyx_n_s_main) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } #if PY_MAJOR_VERSION >= 3 { PyObject *modules = PyImport_GetModuleDict(); if (unlikely(!modules)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} if (!PyDict_GetItemString(modules, "pygame_sdl2.locals")) { if (unlikely(PyDict_SetItemString(modules, "pygame_sdl2.locals", __pyx_m) < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } } #endif /*--- Builtin init code ---*/ if (__Pyx_InitCachedBuiltins() < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /*--- Constants init code ---*/ if (__Pyx_InitCachedConstants() < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /*--- Global init code ---*/ /*--- Variable export code ---*/ /*--- Function export code ---*/ /*--- Type init code ---*/ /*--- Type import code ---*/ /*--- Variable import code ---*/ /*--- Function import code ---*/ /*--- Execution code ---*/ #if defined(__Pyx_Generator_USED) || defined(__Pyx_Coroutine_USED) if (__Pyx_patch_abc() < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} #endif /* "pygame_sdl2/locals.pyx":4 * cimport sdl2 * * from pygame_sdl2.rect import Rect # <<<<<<<<<<<<<< * from pygame_sdl2.color import Color * */ __pyx_t_1 = PyList_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __Pyx_INCREF(__pyx_n_s_Rect); __Pyx_GIVEREF(__pyx_n_s_Rect); PyList_SET_ITEM(__pyx_t_1, 0, __pyx_n_s_Rect); __pyx_t_2 = __Pyx_Import(__pyx_n_s_pygame_sdl2_rect, __pyx_t_1, -1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_1 = __Pyx_ImportFrom(__pyx_t_2, __pyx_n_s_Rect); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); if (PyDict_SetItem(__pyx_d, __pyx_n_s_Rect, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "pygame_sdl2/locals.pyx":5 * * from pygame_sdl2.rect import Rect * from pygame_sdl2.color import Color # <<<<<<<<<<<<<< * * include "event_list.pxi" */ __pyx_t_2 = PyList_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __Pyx_INCREF(__pyx_n_s_Color); __Pyx_GIVEREF(__pyx_n_s_Color); PyList_SET_ITEM(__pyx_t_2, 0, __pyx_n_s_Color); __pyx_t_1 = __Pyx_Import(__pyx_n_s_pygame_sdl2_color, __pyx_t_2, -1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_2 = __Pyx_ImportFrom(__pyx_t_1, __pyx_n_s_Color); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_Color, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "include/event_list.pxi":4 * # Do not edit! * * NOEVENT = SDL_FIRSTEVENT # <<<<<<<<<<<<<< * QUIT = SDL_QUIT * APP_TERMINATING = SDL_APP_TERMINATING */ __pyx_t_1 = __Pyx_PyInt_From_SDL_EventType(SDL_FIRSTEVENT); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 4; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); if (PyDict_SetItem(__pyx_d, __pyx_n_s_NOEVENT, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 4; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "include/event_list.pxi":5 * * NOEVENT = SDL_FIRSTEVENT * QUIT = SDL_QUIT # <<<<<<<<<<<<<< * APP_TERMINATING = SDL_APP_TERMINATING * APP_LOWMEMORY = SDL_APP_LOWMEMORY */ __pyx_t_1 = __Pyx_PyInt_From_SDL_EventType(SDL_QUIT); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 5; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); if (PyDict_SetItem(__pyx_d, __pyx_n_s_QUIT, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 5; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "include/event_list.pxi":6 * NOEVENT = SDL_FIRSTEVENT * QUIT = SDL_QUIT * APP_TERMINATING = SDL_APP_TERMINATING # <<<<<<<<<<<<<< * APP_LOWMEMORY = SDL_APP_LOWMEMORY * APP_WILLENTERBACKGROUND = SDL_APP_WILLENTERBACKGROUND */ __pyx_t_1 = __Pyx_PyInt_From_SDL_EventType(SDL_APP_TERMINATING); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 6; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); if (PyDict_SetItem(__pyx_d, __pyx_n_s_APP_TERMINATING, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 6; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "include/event_list.pxi":7 * QUIT = SDL_QUIT * APP_TERMINATING = SDL_APP_TERMINATING * APP_LOWMEMORY = SDL_APP_LOWMEMORY # <<<<<<<<<<<<<< * APP_WILLENTERBACKGROUND = SDL_APP_WILLENTERBACKGROUND * APP_DIDENTERBACKGROUND = SDL_APP_DIDENTERBACKGROUND */ __pyx_t_1 = __Pyx_PyInt_From_SDL_EventType(SDL_APP_LOWMEMORY); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 7; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); if (PyDict_SetItem(__pyx_d, __pyx_n_s_APP_LOWMEMORY, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 7; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "include/event_list.pxi":8 * APP_TERMINATING = SDL_APP_TERMINATING * APP_LOWMEMORY = SDL_APP_LOWMEMORY * APP_WILLENTERBACKGROUND = SDL_APP_WILLENTERBACKGROUND # <<<<<<<<<<<<<< * APP_DIDENTERBACKGROUND = SDL_APP_DIDENTERBACKGROUND * APP_WILLENTERFOREGROUND = SDL_APP_WILLENTERFOREGROUND */ __pyx_t_1 = __Pyx_PyInt_From_SDL_EventType(SDL_APP_WILLENTERBACKGROUND); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 8; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); if (PyDict_SetItem(__pyx_d, __pyx_n_s_APP_WILLENTERBACKGROUND, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 8; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "include/event_list.pxi":9 * APP_LOWMEMORY = SDL_APP_LOWMEMORY * APP_WILLENTERBACKGROUND = SDL_APP_WILLENTERBACKGROUND * APP_DIDENTERBACKGROUND = SDL_APP_DIDENTERBACKGROUND # <<<<<<<<<<<<<< * APP_WILLENTERFOREGROUND = SDL_APP_WILLENTERFOREGROUND * APP_DIDENTERFOREGROUND = SDL_APP_DIDENTERFOREGROUND */ __pyx_t_1 = __Pyx_PyInt_From_SDL_EventType(SDL_APP_DIDENTERBACKGROUND); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 9; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); if (PyDict_SetItem(__pyx_d, __pyx_n_s_APP_DIDENTERBACKGROUND, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 9; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "include/event_list.pxi":10 * APP_WILLENTERBACKGROUND = SDL_APP_WILLENTERBACKGROUND * APP_DIDENTERBACKGROUND = SDL_APP_DIDENTERBACKGROUND * APP_WILLENTERFOREGROUND = SDL_APP_WILLENTERFOREGROUND # <<<<<<<<<<<<<< * APP_DIDENTERFOREGROUND = SDL_APP_DIDENTERFOREGROUND * WINDOWEVENT = SDL_WINDOWEVENT */ __pyx_t_1 = __Pyx_PyInt_From_SDL_EventType(SDL_APP_WILLENTERFOREGROUND); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 10; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); if (PyDict_SetItem(__pyx_d, __pyx_n_s_APP_WILLENTERFOREGROUND, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 10; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "include/event_list.pxi":11 * APP_DIDENTERBACKGROUND = SDL_APP_DIDENTERBACKGROUND * APP_WILLENTERFOREGROUND = SDL_APP_WILLENTERFOREGROUND * APP_DIDENTERFOREGROUND = SDL_APP_DIDENTERFOREGROUND # <<<<<<<<<<<<<< * WINDOWEVENT = SDL_WINDOWEVENT * SYSWMEVENT = SDL_SYSWMEVENT */ __pyx_t_1 = __Pyx_PyInt_From_SDL_EventType(SDL_APP_DIDENTERFOREGROUND); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 11; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); if (PyDict_SetItem(__pyx_d, __pyx_n_s_APP_DIDENTERFOREGROUND, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 11; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "include/event_list.pxi":12 * APP_WILLENTERFOREGROUND = SDL_APP_WILLENTERFOREGROUND * APP_DIDENTERFOREGROUND = SDL_APP_DIDENTERFOREGROUND * WINDOWEVENT = SDL_WINDOWEVENT # <<<<<<<<<<<<<< * SYSWMEVENT = SDL_SYSWMEVENT * KEYDOWN = SDL_KEYDOWN */ __pyx_t_1 = __Pyx_PyInt_From_SDL_EventType(SDL_WINDOWEVENT); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 12; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); if (PyDict_SetItem(__pyx_d, __pyx_n_s_WINDOWEVENT, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 12; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "include/event_list.pxi":13 * APP_DIDENTERFOREGROUND = SDL_APP_DIDENTERFOREGROUND * WINDOWEVENT = SDL_WINDOWEVENT * SYSWMEVENT = SDL_SYSWMEVENT # <<<<<<<<<<<<<< * KEYDOWN = SDL_KEYDOWN * KEYUP = SDL_KEYUP */ __pyx_t_1 = __Pyx_PyInt_From_SDL_EventType(SDL_SYSWMEVENT); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 13; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); if (PyDict_SetItem(__pyx_d, __pyx_n_s_SYSWMEVENT, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 13; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "include/event_list.pxi":14 * WINDOWEVENT = SDL_WINDOWEVENT * SYSWMEVENT = SDL_SYSWMEVENT * KEYDOWN = SDL_KEYDOWN # <<<<<<<<<<<<<< * KEYUP = SDL_KEYUP * TEXTEDITING = SDL_TEXTEDITING */ __pyx_t_1 = __Pyx_PyInt_From_SDL_EventType(SDL_KEYDOWN); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 14; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); if (PyDict_SetItem(__pyx_d, __pyx_n_s_KEYDOWN, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 14; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "include/event_list.pxi":15 * SYSWMEVENT = SDL_SYSWMEVENT * KEYDOWN = SDL_KEYDOWN * KEYUP = SDL_KEYUP # <<<<<<<<<<<<<< * TEXTEDITING = SDL_TEXTEDITING * TEXTINPUT = SDL_TEXTINPUT */ __pyx_t_1 = __Pyx_PyInt_From_SDL_EventType(SDL_KEYUP); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 15; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); if (PyDict_SetItem(__pyx_d, __pyx_n_s_KEYUP, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 15; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "include/event_list.pxi":16 * KEYDOWN = SDL_KEYDOWN * KEYUP = SDL_KEYUP * TEXTEDITING = SDL_TEXTEDITING # <<<<<<<<<<<<<< * TEXTINPUT = SDL_TEXTINPUT * MOUSEMOTION = SDL_MOUSEMOTION */ __pyx_t_1 = __Pyx_PyInt_From_SDL_EventType(SDL_TEXTEDITING); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 16; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); if (PyDict_SetItem(__pyx_d, __pyx_n_s_TEXTEDITING, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 16; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "include/event_list.pxi":17 * KEYUP = SDL_KEYUP * TEXTEDITING = SDL_TEXTEDITING * TEXTINPUT = SDL_TEXTINPUT # <<<<<<<<<<<<<< * MOUSEMOTION = SDL_MOUSEMOTION * MOUSEBUTTONDOWN = SDL_MOUSEBUTTONDOWN */ __pyx_t_1 = __Pyx_PyInt_From_SDL_EventType(SDL_TEXTINPUT); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 17; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); if (PyDict_SetItem(__pyx_d, __pyx_n_s_TEXTINPUT, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 17; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "include/event_list.pxi":18 * TEXTEDITING = SDL_TEXTEDITING * TEXTINPUT = SDL_TEXTINPUT * MOUSEMOTION = SDL_MOUSEMOTION # <<<<<<<<<<<<<< * MOUSEBUTTONDOWN = SDL_MOUSEBUTTONDOWN * MOUSEBUTTONUP = SDL_MOUSEBUTTONUP */ __pyx_t_1 = __Pyx_PyInt_From_SDL_EventType(SDL_MOUSEMOTION); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 18; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); if (PyDict_SetItem(__pyx_d, __pyx_n_s_MOUSEMOTION, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 18; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "include/event_list.pxi":19 * TEXTINPUT = SDL_TEXTINPUT * MOUSEMOTION = SDL_MOUSEMOTION * MOUSEBUTTONDOWN = SDL_MOUSEBUTTONDOWN # <<<<<<<<<<<<<< * MOUSEBUTTONUP = SDL_MOUSEBUTTONUP * MOUSEWHEEL = SDL_MOUSEWHEEL */ __pyx_t_1 = __Pyx_PyInt_From_SDL_EventType(SDL_MOUSEBUTTONDOWN); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 19; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); if (PyDict_SetItem(__pyx_d, __pyx_n_s_MOUSEBUTTONDOWN, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 19; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "include/event_list.pxi":20 * MOUSEMOTION = SDL_MOUSEMOTION * MOUSEBUTTONDOWN = SDL_MOUSEBUTTONDOWN * MOUSEBUTTONUP = SDL_MOUSEBUTTONUP # <<<<<<<<<<<<<< * MOUSEWHEEL = SDL_MOUSEWHEEL * JOYAXISMOTION = SDL_JOYAXISMOTION */ __pyx_t_1 = __Pyx_PyInt_From_SDL_EventType(SDL_MOUSEBUTTONUP); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 20; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); if (PyDict_SetItem(__pyx_d, __pyx_n_s_MOUSEBUTTONUP, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 20; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "include/event_list.pxi":21 * MOUSEBUTTONDOWN = SDL_MOUSEBUTTONDOWN * MOUSEBUTTONUP = SDL_MOUSEBUTTONUP * MOUSEWHEEL = SDL_MOUSEWHEEL # <<<<<<<<<<<<<< * JOYAXISMOTION = SDL_JOYAXISMOTION * JOYBALLMOTION = SDL_JOYBALLMOTION */ __pyx_t_1 = __Pyx_PyInt_From_SDL_EventType(SDL_MOUSEWHEEL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 21; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); if (PyDict_SetItem(__pyx_d, __pyx_n_s_MOUSEWHEEL, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 21; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "include/event_list.pxi":22 * MOUSEBUTTONUP = SDL_MOUSEBUTTONUP * MOUSEWHEEL = SDL_MOUSEWHEEL * JOYAXISMOTION = SDL_JOYAXISMOTION # <<<<<<<<<<<<<< * JOYBALLMOTION = SDL_JOYBALLMOTION * JOYHATMOTION = SDL_JOYHATMOTION */ __pyx_t_1 = __Pyx_PyInt_From_SDL_EventType(SDL_JOYAXISMOTION); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 22; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); if (PyDict_SetItem(__pyx_d, __pyx_n_s_JOYAXISMOTION, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 22; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "include/event_list.pxi":23 * MOUSEWHEEL = SDL_MOUSEWHEEL * JOYAXISMOTION = SDL_JOYAXISMOTION * JOYBALLMOTION = SDL_JOYBALLMOTION # <<<<<<<<<<<<<< * JOYHATMOTION = SDL_JOYHATMOTION * JOYBUTTONDOWN = SDL_JOYBUTTONDOWN */ __pyx_t_1 = __Pyx_PyInt_From_SDL_EventType(SDL_JOYBALLMOTION); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 23; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); if (PyDict_SetItem(__pyx_d, __pyx_n_s_JOYBALLMOTION, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 23; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "include/event_list.pxi":24 * JOYAXISMOTION = SDL_JOYAXISMOTION * JOYBALLMOTION = SDL_JOYBALLMOTION * JOYHATMOTION = SDL_JOYHATMOTION # <<<<<<<<<<<<<< * JOYBUTTONDOWN = SDL_JOYBUTTONDOWN * JOYBUTTONUP = SDL_JOYBUTTONUP */ __pyx_t_1 = __Pyx_PyInt_From_SDL_EventType(SDL_JOYHATMOTION); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 24; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); if (PyDict_SetItem(__pyx_d, __pyx_n_s_JOYHATMOTION, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 24; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "include/event_list.pxi":25 * JOYBALLMOTION = SDL_JOYBALLMOTION * JOYHATMOTION = SDL_JOYHATMOTION * JOYBUTTONDOWN = SDL_JOYBUTTONDOWN # <<<<<<<<<<<<<< * JOYBUTTONUP = SDL_JOYBUTTONUP * JOYDEVICEADDED = SDL_JOYDEVICEADDED */ __pyx_t_1 = __Pyx_PyInt_From_SDL_EventType(SDL_JOYBUTTONDOWN); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 25; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); if (PyDict_SetItem(__pyx_d, __pyx_n_s_JOYBUTTONDOWN, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 25; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "include/event_list.pxi":26 * JOYHATMOTION = SDL_JOYHATMOTION * JOYBUTTONDOWN = SDL_JOYBUTTONDOWN * JOYBUTTONUP = SDL_JOYBUTTONUP # <<<<<<<<<<<<<< * JOYDEVICEADDED = SDL_JOYDEVICEADDED * JOYDEVICEREMOVED = SDL_JOYDEVICEREMOVED */ __pyx_t_1 = __Pyx_PyInt_From_SDL_EventType(SDL_JOYBUTTONUP); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 26; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); if (PyDict_SetItem(__pyx_d, __pyx_n_s_JOYBUTTONUP, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 26; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "include/event_list.pxi":27 * JOYBUTTONDOWN = SDL_JOYBUTTONDOWN * JOYBUTTONUP = SDL_JOYBUTTONUP * JOYDEVICEADDED = SDL_JOYDEVICEADDED # <<<<<<<<<<<<<< * JOYDEVICEREMOVED = SDL_JOYDEVICEREMOVED * CONTROLLERAXISMOTION = SDL_CONTROLLERAXISMOTION */ __pyx_t_1 = __Pyx_PyInt_From_SDL_EventType(SDL_JOYDEVICEADDED); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 27; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); if (PyDict_SetItem(__pyx_d, __pyx_n_s_JOYDEVICEADDED, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 27; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "include/event_list.pxi":28 * JOYBUTTONUP = SDL_JOYBUTTONUP * JOYDEVICEADDED = SDL_JOYDEVICEADDED * JOYDEVICEREMOVED = SDL_JOYDEVICEREMOVED # <<<<<<<<<<<<<< * CONTROLLERAXISMOTION = SDL_CONTROLLERAXISMOTION * CONTROLLERBUTTONDOWN = SDL_CONTROLLERBUTTONDOWN */ __pyx_t_1 = __Pyx_PyInt_From_SDL_EventType(SDL_JOYDEVICEREMOVED); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 28; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); if (PyDict_SetItem(__pyx_d, __pyx_n_s_JOYDEVICEREMOVED, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 28; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "include/event_list.pxi":29 * JOYDEVICEADDED = SDL_JOYDEVICEADDED * JOYDEVICEREMOVED = SDL_JOYDEVICEREMOVED * CONTROLLERAXISMOTION = SDL_CONTROLLERAXISMOTION # <<<<<<<<<<<<<< * CONTROLLERBUTTONDOWN = SDL_CONTROLLERBUTTONDOWN * CONTROLLERBUTTONUP = SDL_CONTROLLERBUTTONUP */ __pyx_t_1 = __Pyx_PyInt_From_SDL_EventType(SDL_CONTROLLERAXISMOTION); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 29; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); if (PyDict_SetItem(__pyx_d, __pyx_n_s_CONTROLLERAXISMOTION, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 29; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "include/event_list.pxi":30 * JOYDEVICEREMOVED = SDL_JOYDEVICEREMOVED * CONTROLLERAXISMOTION = SDL_CONTROLLERAXISMOTION * CONTROLLERBUTTONDOWN = SDL_CONTROLLERBUTTONDOWN # <<<<<<<<<<<<<< * CONTROLLERBUTTONUP = SDL_CONTROLLERBUTTONUP * CONTROLLERDEVICEADDED = SDL_CONTROLLERDEVICEADDED */ __pyx_t_1 = __Pyx_PyInt_From_SDL_EventType(SDL_CONTROLLERBUTTONDOWN); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 30; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); if (PyDict_SetItem(__pyx_d, __pyx_n_s_CONTROLLERBUTTONDOWN, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 30; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "include/event_list.pxi":31 * CONTROLLERAXISMOTION = SDL_CONTROLLERAXISMOTION * CONTROLLERBUTTONDOWN = SDL_CONTROLLERBUTTONDOWN * CONTROLLERBUTTONUP = SDL_CONTROLLERBUTTONUP # <<<<<<<<<<<<<< * CONTROLLERDEVICEADDED = SDL_CONTROLLERDEVICEADDED * CONTROLLERDEVICEREMOVED = SDL_CONTROLLERDEVICEREMOVED */ __pyx_t_1 = __Pyx_PyInt_From_SDL_EventType(SDL_CONTROLLERBUTTONUP); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 31; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); if (PyDict_SetItem(__pyx_d, __pyx_n_s_CONTROLLERBUTTONUP, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 31; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "include/event_list.pxi":32 * CONTROLLERBUTTONDOWN = SDL_CONTROLLERBUTTONDOWN * CONTROLLERBUTTONUP = SDL_CONTROLLERBUTTONUP * CONTROLLERDEVICEADDED = SDL_CONTROLLERDEVICEADDED # <<<<<<<<<<<<<< * CONTROLLERDEVICEREMOVED = SDL_CONTROLLERDEVICEREMOVED * CONTROLLERDEVICEREMAPPED = SDL_CONTROLLERDEVICEREMAPPED */ __pyx_t_1 = __Pyx_PyInt_From_SDL_EventType(SDL_CONTROLLERDEVICEADDED); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 32; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); if (PyDict_SetItem(__pyx_d, __pyx_n_s_CONTROLLERDEVICEADDED, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 32; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "include/event_list.pxi":33 * CONTROLLERBUTTONUP = SDL_CONTROLLERBUTTONUP * CONTROLLERDEVICEADDED = SDL_CONTROLLERDEVICEADDED * CONTROLLERDEVICEREMOVED = SDL_CONTROLLERDEVICEREMOVED # <<<<<<<<<<<<<< * CONTROLLERDEVICEREMAPPED = SDL_CONTROLLERDEVICEREMAPPED * FINGERDOWN = SDL_FINGERDOWN */ __pyx_t_1 = __Pyx_PyInt_From_SDL_EventType(SDL_CONTROLLERDEVICEREMOVED); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 33; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); if (PyDict_SetItem(__pyx_d, __pyx_n_s_CONTROLLERDEVICEREMOVED, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 33; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "include/event_list.pxi":34 * CONTROLLERDEVICEADDED = SDL_CONTROLLERDEVICEADDED * CONTROLLERDEVICEREMOVED = SDL_CONTROLLERDEVICEREMOVED * CONTROLLERDEVICEREMAPPED = SDL_CONTROLLERDEVICEREMAPPED # <<<<<<<<<<<<<< * FINGERDOWN = SDL_FINGERDOWN * FINGERUP = SDL_FINGERUP */ __pyx_t_1 = __Pyx_PyInt_From_SDL_EventType(SDL_CONTROLLERDEVICEREMAPPED); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 34; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); if (PyDict_SetItem(__pyx_d, __pyx_n_s_CONTROLLERDEVICEREMAPPED, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 34; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "include/event_list.pxi":35 * CONTROLLERDEVICEREMOVED = SDL_CONTROLLERDEVICEREMOVED * CONTROLLERDEVICEREMAPPED = SDL_CONTROLLERDEVICEREMAPPED * FINGERDOWN = SDL_FINGERDOWN # <<<<<<<<<<<<<< * FINGERUP = SDL_FINGERUP * FINGERMOTION = SDL_FINGERMOTION */ __pyx_t_1 = __Pyx_PyInt_From_SDL_EventType(SDL_FINGERDOWN); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 35; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); if (PyDict_SetItem(__pyx_d, __pyx_n_s_FINGERDOWN, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 35; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "include/event_list.pxi":36 * CONTROLLERDEVICEREMAPPED = SDL_CONTROLLERDEVICEREMAPPED * FINGERDOWN = SDL_FINGERDOWN * FINGERUP = SDL_FINGERUP # <<<<<<<<<<<<<< * FINGERMOTION = SDL_FINGERMOTION * DOLLARGESTURE = SDL_DOLLARGESTURE */ __pyx_t_1 = __Pyx_PyInt_From_SDL_EventType(SDL_FINGERUP); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 36; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); if (PyDict_SetItem(__pyx_d, __pyx_n_s_FINGERUP, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 36; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "include/event_list.pxi":37 * FINGERDOWN = SDL_FINGERDOWN * FINGERUP = SDL_FINGERUP * FINGERMOTION = SDL_FINGERMOTION # <<<<<<<<<<<<<< * DOLLARGESTURE = SDL_DOLLARGESTURE * DOLLARRECORD = SDL_DOLLARRECORD */ __pyx_t_1 = __Pyx_PyInt_From_SDL_EventType(SDL_FINGERMOTION); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 37; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); if (PyDict_SetItem(__pyx_d, __pyx_n_s_FINGERMOTION, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 37; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "include/event_list.pxi":38 * FINGERUP = SDL_FINGERUP * FINGERMOTION = SDL_FINGERMOTION * DOLLARGESTURE = SDL_DOLLARGESTURE # <<<<<<<<<<<<<< * DOLLARRECORD = SDL_DOLLARRECORD * MULTIGESTURE = SDL_MULTIGESTURE */ __pyx_t_1 = __Pyx_PyInt_From_SDL_EventType(SDL_DOLLARGESTURE); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 38; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); if (PyDict_SetItem(__pyx_d, __pyx_n_s_DOLLARGESTURE, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 38; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "include/event_list.pxi":39 * FINGERMOTION = SDL_FINGERMOTION * DOLLARGESTURE = SDL_DOLLARGESTURE * DOLLARRECORD = SDL_DOLLARRECORD # <<<<<<<<<<<<<< * MULTIGESTURE = SDL_MULTIGESTURE * CLIPBOARDUPDATE = SDL_CLIPBOARDUPDATE */ __pyx_t_1 = __Pyx_PyInt_From_SDL_EventType(SDL_DOLLARRECORD); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 39; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); if (PyDict_SetItem(__pyx_d, __pyx_n_s_DOLLARRECORD, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 39; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "include/event_list.pxi":40 * DOLLARGESTURE = SDL_DOLLARGESTURE * DOLLARRECORD = SDL_DOLLARRECORD * MULTIGESTURE = SDL_MULTIGESTURE # <<<<<<<<<<<<<< * CLIPBOARDUPDATE = SDL_CLIPBOARDUPDATE * DROPFILE = SDL_DROPFILE */ __pyx_t_1 = __Pyx_PyInt_From_SDL_EventType(SDL_MULTIGESTURE); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 40; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); if (PyDict_SetItem(__pyx_d, __pyx_n_s_MULTIGESTURE, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 40; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "include/event_list.pxi":41 * DOLLARRECORD = SDL_DOLLARRECORD * MULTIGESTURE = SDL_MULTIGESTURE * CLIPBOARDUPDATE = SDL_CLIPBOARDUPDATE # <<<<<<<<<<<<<< * DROPFILE = SDL_DROPFILE * RENDER_TARGETS_RESET = SDL_RENDER_TARGETS_RESET */ __pyx_t_1 = __Pyx_PyInt_From_SDL_EventType(SDL_CLIPBOARDUPDATE); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 41; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); if (PyDict_SetItem(__pyx_d, __pyx_n_s_CLIPBOARDUPDATE, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 41; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "include/event_list.pxi":42 * MULTIGESTURE = SDL_MULTIGESTURE * CLIPBOARDUPDATE = SDL_CLIPBOARDUPDATE * DROPFILE = SDL_DROPFILE # <<<<<<<<<<<<<< * RENDER_TARGETS_RESET = SDL_RENDER_TARGETS_RESET * USEREVENT = SDL_USEREVENT */ __pyx_t_1 = __Pyx_PyInt_From_SDL_EventType(SDL_DROPFILE); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 42; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); if (PyDict_SetItem(__pyx_d, __pyx_n_s_DROPFILE, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 42; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "include/event_list.pxi":43 * CLIPBOARDUPDATE = SDL_CLIPBOARDUPDATE * DROPFILE = SDL_DROPFILE * RENDER_TARGETS_RESET = SDL_RENDER_TARGETS_RESET # <<<<<<<<<<<<<< * USEREVENT = SDL_USEREVENT * LASTEVENT = SDL_LASTEVENT */ __pyx_t_1 = __Pyx_PyInt_From_SDL_EventType(SDL_RENDER_TARGETS_RESET); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 43; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); if (PyDict_SetItem(__pyx_d, __pyx_n_s_RENDER_TARGETS_RESET, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 43; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "include/event_list.pxi":44 * DROPFILE = SDL_DROPFILE * RENDER_TARGETS_RESET = SDL_RENDER_TARGETS_RESET * USEREVENT = SDL_USEREVENT # <<<<<<<<<<<<<< * LASTEVENT = SDL_LASTEVENT */ __pyx_t_1 = __Pyx_PyInt_From_SDL_EventType(SDL_USEREVENT); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 44; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); if (PyDict_SetItem(__pyx_d, __pyx_n_s_USEREVENT, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 44; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "include/event_list.pxi":45 * RENDER_TARGETS_RESET = SDL_RENDER_TARGETS_RESET * USEREVENT = SDL_USEREVENT * LASTEVENT = SDL_LASTEVENT # <<<<<<<<<<<<<< */ __pyx_t_1 = __Pyx_PyInt_From_SDL_EventType(SDL_LASTEVENT); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 45; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); if (PyDict_SetItem(__pyx_d, __pyx_n_s_LASTEVENT, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 45; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "pygame_sdl2/locals.pyx":8 * * include "event_list.pxi" * ACTIVEEVENT = SDL_LASTEVENT - 1 # <<<<<<<<<<<<<< * VIDEORESIZE = SDL_LASTEVENT - 2 * VIDEOEXPOSE = SDL_LASTEVENT - 3 */ __pyx_t_1 = __Pyx_PyInt_From_long((SDL_LASTEVENT - 1)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 8; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); if (PyDict_SetItem(__pyx_d, __pyx_n_s_ACTIVEEVENT, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 8; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "pygame_sdl2/locals.pyx":9 * include "event_list.pxi" * ACTIVEEVENT = SDL_LASTEVENT - 1 * VIDEORESIZE = SDL_LASTEVENT - 2 # <<<<<<<<<<<<<< * VIDEOEXPOSE = SDL_LASTEVENT - 3 * */ __pyx_t_1 = __Pyx_PyInt_From_long((SDL_LASTEVENT - 2)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 9; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); if (PyDict_SetItem(__pyx_d, __pyx_n_s_VIDEORESIZE, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 9; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "pygame_sdl2/locals.pyx":10 * ACTIVEEVENT = SDL_LASTEVENT - 1 * VIDEORESIZE = SDL_LASTEVENT - 2 * VIDEOEXPOSE = SDL_LASTEVENT - 3 # <<<<<<<<<<<<<< * * include "keycode_list.pxi" */ __pyx_t_1 = __Pyx_PyInt_From_long((SDL_LASTEVENT - 3)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 10; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); if (PyDict_SetItem(__pyx_d, __pyx_n_s_VIDEOEXPOSE, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 10; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "include/keycode_list.pxi":4 * # Do not edit! * * K_UNKNOWN = SDLK_UNKNOWN # <<<<<<<<<<<<<< * K_RETURN = SDLK_RETURN * K_ESCAPE = SDLK_ESCAPE */ __pyx_t_1 = __Pyx_PyInt_From_int(SDLK_UNKNOWN); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); if (PyDict_SetItem(__pyx_d, __pyx_n_s_K_UNKNOWN, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "include/keycode_list.pxi":5 * * K_UNKNOWN = SDLK_UNKNOWN * K_RETURN = SDLK_RETURN # <<<<<<<<<<<<<< * K_ESCAPE = SDLK_ESCAPE * K_BACKSPACE = SDLK_BACKSPACE */ __pyx_t_1 = __Pyx_PyInt_From_int(SDLK_RETURN); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); if (PyDict_SetItem(__pyx_d, __pyx_n_s_K_RETURN, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "include/keycode_list.pxi":6 * K_UNKNOWN = SDLK_UNKNOWN * K_RETURN = SDLK_RETURN * K_ESCAPE = SDLK_ESCAPE # <<<<<<<<<<<<<< * K_BACKSPACE = SDLK_BACKSPACE * K_TAB = SDLK_TAB */ __pyx_t_1 = __Pyx_PyInt_From_int(SDLK_ESCAPE); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); if (PyDict_SetItem(__pyx_d, __pyx_n_s_K_ESCAPE, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "include/keycode_list.pxi":7 * K_RETURN = SDLK_RETURN * K_ESCAPE = SDLK_ESCAPE * K_BACKSPACE = SDLK_BACKSPACE # <<<<<<<<<<<<<< * K_TAB = SDLK_TAB * K_SPACE = SDLK_SPACE */ __pyx_t_1 = __Pyx_PyInt_From_int(SDLK_BACKSPACE); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); if (PyDict_SetItem(__pyx_d, __pyx_n_s_K_BACKSPACE, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "include/keycode_list.pxi":8 * K_ESCAPE = SDLK_ESCAPE * K_BACKSPACE = SDLK_BACKSPACE * K_TAB = SDLK_TAB # <<<<<<<<<<<<<< * K_SPACE = SDLK_SPACE * K_EXCLAIM = SDLK_EXCLAIM */ __pyx_t_1 = __Pyx_PyInt_From_int(SDLK_TAB); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); if (PyDict_SetItem(__pyx_d, __pyx_n_s_K_TAB, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "include/keycode_list.pxi":9 * K_BACKSPACE = SDLK_BACKSPACE * K_TAB = SDLK_TAB * K_SPACE = SDLK_SPACE # <<<<<<<<<<<<<< * K_EXCLAIM = SDLK_EXCLAIM * K_QUOTEDBL = SDLK_QUOTEDBL */ __pyx_t_1 = __Pyx_PyInt_From_int(SDLK_SPACE); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 9; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); if (PyDict_SetItem(__pyx_d, __pyx_n_s_K_SPACE, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 9; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "include/keycode_list.pxi":10 * K_TAB = SDLK_TAB * K_SPACE = SDLK_SPACE * K_EXCLAIM = SDLK_EXCLAIM # <<<<<<<<<<<<<< * K_QUOTEDBL = SDLK_QUOTEDBL * K_HASH = SDLK_HASH */ __pyx_t_1 = __Pyx_PyInt_From_int(SDLK_EXCLAIM); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 10; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); if (PyDict_SetItem(__pyx_d, __pyx_n_s_K_EXCLAIM, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 10; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "include/keycode_list.pxi":11 * K_SPACE = SDLK_SPACE * K_EXCLAIM = SDLK_EXCLAIM * K_QUOTEDBL = SDLK_QUOTEDBL # <<<<<<<<<<<<<< * K_HASH = SDLK_HASH * K_PERCENT = SDLK_PERCENT */ __pyx_t_1 = __Pyx_PyInt_From_int(SDLK_QUOTEDBL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 11; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); if (PyDict_SetItem(__pyx_d, __pyx_n_s_K_QUOTEDBL, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 11; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "include/keycode_list.pxi":12 * K_EXCLAIM = SDLK_EXCLAIM * K_QUOTEDBL = SDLK_QUOTEDBL * K_HASH = SDLK_HASH # <<<<<<<<<<<<<< * K_PERCENT = SDLK_PERCENT * K_DOLLAR = SDLK_DOLLAR */ __pyx_t_1 = __Pyx_PyInt_From_int(SDLK_HASH); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 12; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); if (PyDict_SetItem(__pyx_d, __pyx_n_s_K_HASH, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 12; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "include/keycode_list.pxi":13 * K_QUOTEDBL = SDLK_QUOTEDBL * K_HASH = SDLK_HASH * K_PERCENT = SDLK_PERCENT # <<<<<<<<<<<<<< * K_DOLLAR = SDLK_DOLLAR * K_AMPERSAND = SDLK_AMPERSAND */ __pyx_t_1 = __Pyx_PyInt_From_int(SDLK_PERCENT); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 13; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); if (PyDict_SetItem(__pyx_d, __pyx_n_s_K_PERCENT, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 13; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "include/keycode_list.pxi":14 * K_HASH = SDLK_HASH * K_PERCENT = SDLK_PERCENT * K_DOLLAR = SDLK_DOLLAR # <<<<<<<<<<<<<< * K_AMPERSAND = SDLK_AMPERSAND * K_QUOTE = SDLK_QUOTE */ __pyx_t_1 = __Pyx_PyInt_From_int(SDLK_DOLLAR); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 14; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); if (PyDict_SetItem(__pyx_d, __pyx_n_s_K_DOLLAR, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 14; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "include/keycode_list.pxi":15 * K_PERCENT = SDLK_PERCENT * K_DOLLAR = SDLK_DOLLAR * K_AMPERSAND = SDLK_AMPERSAND # <<<<<<<<<<<<<< * K_QUOTE = SDLK_QUOTE * K_LEFTPAREN = SDLK_LEFTPAREN */ __pyx_t_1 = __Pyx_PyInt_From_int(SDLK_AMPERSAND); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 15; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); if (PyDict_SetItem(__pyx_d, __pyx_n_s_K_AMPERSAND, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 15; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "include/keycode_list.pxi":16 * K_DOLLAR = SDLK_DOLLAR * K_AMPERSAND = SDLK_AMPERSAND * K_QUOTE = SDLK_QUOTE # <<<<<<<<<<<<<< * K_LEFTPAREN = SDLK_LEFTPAREN * K_RIGHTPAREN = SDLK_RIGHTPAREN */ __pyx_t_1 = __Pyx_PyInt_From_int(SDLK_QUOTE); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 16; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); if (PyDict_SetItem(__pyx_d, __pyx_n_s_K_QUOTE, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 16; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "include/keycode_list.pxi":17 * K_AMPERSAND = SDLK_AMPERSAND * K_QUOTE = SDLK_QUOTE * K_LEFTPAREN = SDLK_LEFTPAREN # <<<<<<<<<<<<<< * K_RIGHTPAREN = SDLK_RIGHTPAREN * K_ASTERISK = SDLK_ASTERISK */ __pyx_t_1 = __Pyx_PyInt_From_int(SDLK_LEFTPAREN); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 17; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); if (PyDict_SetItem(__pyx_d, __pyx_n_s_K_LEFTPAREN, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 17; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "include/keycode_list.pxi":18 * K_QUOTE = SDLK_QUOTE * K_LEFTPAREN = SDLK_LEFTPAREN * K_RIGHTPAREN = SDLK_RIGHTPAREN # <<<<<<<<<<<<<< * K_ASTERISK = SDLK_ASTERISK * K_PLUS = SDLK_PLUS */ __pyx_t_1 = __Pyx_PyInt_From_int(SDLK_RIGHTPAREN); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 18; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); if (PyDict_SetItem(__pyx_d, __pyx_n_s_K_RIGHTPAREN, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 18; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "include/keycode_list.pxi":19 * K_LEFTPAREN = SDLK_LEFTPAREN * K_RIGHTPAREN = SDLK_RIGHTPAREN * K_ASTERISK = SDLK_ASTERISK # <<<<<<<<<<<<<< * K_PLUS = SDLK_PLUS * K_COMMA = SDLK_COMMA */ __pyx_t_1 = __Pyx_PyInt_From_int(SDLK_ASTERISK); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 19; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); if (PyDict_SetItem(__pyx_d, __pyx_n_s_K_ASTERISK, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 19; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "include/keycode_list.pxi":20 * K_RIGHTPAREN = SDLK_RIGHTPAREN * K_ASTERISK = SDLK_ASTERISK * K_PLUS = SDLK_PLUS # <<<<<<<<<<<<<< * K_COMMA = SDLK_COMMA * K_MINUS = SDLK_MINUS */ __pyx_t_1 = __Pyx_PyInt_From_int(SDLK_PLUS); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 20; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); if (PyDict_SetItem(__pyx_d, __pyx_n_s_K_PLUS, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 20; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "include/keycode_list.pxi":21 * K_ASTERISK = SDLK_ASTERISK * K_PLUS = SDLK_PLUS * K_COMMA = SDLK_COMMA # <<<<<<<<<<<<<< * K_MINUS = SDLK_MINUS * K_PERIOD = SDLK_PERIOD */ __pyx_t_1 = __Pyx_PyInt_From_int(SDLK_COMMA); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 21; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); if (PyDict_SetItem(__pyx_d, __pyx_n_s_K_COMMA, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 21; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "include/keycode_list.pxi":22 * K_PLUS = SDLK_PLUS * K_COMMA = SDLK_COMMA * K_MINUS = SDLK_MINUS # <<<<<<<<<<<<<< * K_PERIOD = SDLK_PERIOD * K_SLASH = SDLK_SLASH */ __pyx_t_1 = __Pyx_PyInt_From_int(SDLK_MINUS); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 22; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); if (PyDict_SetItem(__pyx_d, __pyx_n_s_K_MINUS, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 22; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "include/keycode_list.pxi":23 * K_COMMA = SDLK_COMMA * K_MINUS = SDLK_MINUS * K_PERIOD = SDLK_PERIOD # <<<<<<<<<<<<<< * K_SLASH = SDLK_SLASH * K_0 = SDLK_0 */ __pyx_t_1 = __Pyx_PyInt_From_int(SDLK_PERIOD); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 23; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); if (PyDict_SetItem(__pyx_d, __pyx_n_s_K_PERIOD, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 23; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "include/keycode_list.pxi":24 * K_MINUS = SDLK_MINUS * K_PERIOD = SDLK_PERIOD * K_SLASH = SDLK_SLASH # <<<<<<<<<<<<<< * K_0 = SDLK_0 * K_1 = SDLK_1 */ __pyx_t_1 = __Pyx_PyInt_From_int(SDLK_SLASH); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 24; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); if (PyDict_SetItem(__pyx_d, __pyx_n_s_K_SLASH, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 24; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "include/keycode_list.pxi":25 * K_PERIOD = SDLK_PERIOD * K_SLASH = SDLK_SLASH * K_0 = SDLK_0 # <<<<<<<<<<<<<< * K_1 = SDLK_1 * K_2 = SDLK_2 */ __pyx_t_1 = __Pyx_PyInt_From_int(SDLK_0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 25; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); if (PyDict_SetItem(__pyx_d, __pyx_n_s_K_0, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 25; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "include/keycode_list.pxi":26 * K_SLASH = SDLK_SLASH * K_0 = SDLK_0 * K_1 = SDLK_1 # <<<<<<<<<<<<<< * K_2 = SDLK_2 * K_3 = SDLK_3 */ __pyx_t_1 = __Pyx_PyInt_From_int(SDLK_1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 26; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); if (PyDict_SetItem(__pyx_d, __pyx_n_s_K_1, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 26; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "include/keycode_list.pxi":27 * K_0 = SDLK_0 * K_1 = SDLK_1 * K_2 = SDLK_2 # <<<<<<<<<<<<<< * K_3 = SDLK_3 * K_4 = SDLK_4 */ __pyx_t_1 = __Pyx_PyInt_From_int(SDLK_2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 27; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); if (PyDict_SetItem(__pyx_d, __pyx_n_s_K_2, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 27; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "include/keycode_list.pxi":28 * K_1 = SDLK_1 * K_2 = SDLK_2 * K_3 = SDLK_3 # <<<<<<<<<<<<<< * K_4 = SDLK_4 * K_5 = SDLK_5 */ __pyx_t_1 = __Pyx_PyInt_From_int(SDLK_3); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 28; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); if (PyDict_SetItem(__pyx_d, __pyx_n_s_K_3, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 28; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "include/keycode_list.pxi":29 * K_2 = SDLK_2 * K_3 = SDLK_3 * K_4 = SDLK_4 # <<<<<<<<<<<<<< * K_5 = SDLK_5 * K_6 = SDLK_6 */ __pyx_t_1 = __Pyx_PyInt_From_int(SDLK_4); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 29; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); if (PyDict_SetItem(__pyx_d, __pyx_n_s_K_4, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 29; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "include/keycode_list.pxi":30 * K_3 = SDLK_3 * K_4 = SDLK_4 * K_5 = SDLK_5 # <<<<<<<<<<<<<< * K_6 = SDLK_6 * K_7 = SDLK_7 */ __pyx_t_1 = __Pyx_PyInt_From_int(SDLK_5); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 30; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); if (PyDict_SetItem(__pyx_d, __pyx_n_s_K_5, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 30; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "include/keycode_list.pxi":31 * K_4 = SDLK_4 * K_5 = SDLK_5 * K_6 = SDLK_6 # <<<<<<<<<<<<<< * K_7 = SDLK_7 * K_8 = SDLK_8 */ __pyx_t_1 = __Pyx_PyInt_From_int(SDLK_6); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 31; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); if (PyDict_SetItem(__pyx_d, __pyx_n_s_K_6, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 31; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "include/keycode_list.pxi":32 * K_5 = SDLK_5 * K_6 = SDLK_6 * K_7 = SDLK_7 # <<<<<<<<<<<<<< * K_8 = SDLK_8 * K_9 = SDLK_9 */ __pyx_t_1 = __Pyx_PyInt_From_int(SDLK_7); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 32; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); if (PyDict_SetItem(__pyx_d, __pyx_n_s_K_7, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 32; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "include/keycode_list.pxi":33 * K_6 = SDLK_6 * K_7 = SDLK_7 * K_8 = SDLK_8 # <<<<<<<<<<<<<< * K_9 = SDLK_9 * K_COLON = SDLK_COLON */ __pyx_t_1 = __Pyx_PyInt_From_int(SDLK_8); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 33; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); if (PyDict_SetItem(__pyx_d, __pyx_n_s_K_8, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 33; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "include/keycode_list.pxi":34 * K_7 = SDLK_7 * K_8 = SDLK_8 * K_9 = SDLK_9 # <<<<<<<<<<<<<< * K_COLON = SDLK_COLON * K_SEMICOLON = SDLK_SEMICOLON */ __pyx_t_1 = __Pyx_PyInt_From_int(SDLK_9); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 34; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); if (PyDict_SetItem(__pyx_d, __pyx_n_s_K_9, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 34; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "include/keycode_list.pxi":35 * K_8 = SDLK_8 * K_9 = SDLK_9 * K_COLON = SDLK_COLON # <<<<<<<<<<<<<< * K_SEMICOLON = SDLK_SEMICOLON * K_LESS = SDLK_LESS */ __pyx_t_1 = __Pyx_PyInt_From_int(SDLK_COLON); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 35; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); if (PyDict_SetItem(__pyx_d, __pyx_n_s_K_COLON, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 35; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "include/keycode_list.pxi":36 * K_9 = SDLK_9 * K_COLON = SDLK_COLON * K_SEMICOLON = SDLK_SEMICOLON # <<<<<<<<<<<<<< * K_LESS = SDLK_LESS * K_EQUALS = SDLK_EQUALS */ __pyx_t_1 = __Pyx_PyInt_From_int(SDLK_SEMICOLON); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 36; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); if (PyDict_SetItem(__pyx_d, __pyx_n_s_K_SEMICOLON, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 36; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "include/keycode_list.pxi":37 * K_COLON = SDLK_COLON * K_SEMICOLON = SDLK_SEMICOLON * K_LESS = SDLK_LESS # <<<<<<<<<<<<<< * K_EQUALS = SDLK_EQUALS * K_GREATER = SDLK_GREATER */ __pyx_t_1 = __Pyx_PyInt_From_int(SDLK_LESS); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 37; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); if (PyDict_SetItem(__pyx_d, __pyx_n_s_K_LESS, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 37; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "include/keycode_list.pxi":38 * K_SEMICOLON = SDLK_SEMICOLON * K_LESS = SDLK_LESS * K_EQUALS = SDLK_EQUALS # <<<<<<<<<<<<<< * K_GREATER = SDLK_GREATER * K_QUESTION = SDLK_QUESTION */ __pyx_t_1 = __Pyx_PyInt_From_int(SDLK_EQUALS); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 38; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); if (PyDict_SetItem(__pyx_d, __pyx_n_s_K_EQUALS, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 38; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "include/keycode_list.pxi":39 * K_LESS = SDLK_LESS * K_EQUALS = SDLK_EQUALS * K_GREATER = SDLK_GREATER # <<<<<<<<<<<<<< * K_QUESTION = SDLK_QUESTION * K_AT = SDLK_AT */ __pyx_t_1 = __Pyx_PyInt_From_int(SDLK_GREATER); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 39; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); if (PyDict_SetItem(__pyx_d, __pyx_n_s_K_GREATER, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 39; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "include/keycode_list.pxi":40 * K_EQUALS = SDLK_EQUALS * K_GREATER = SDLK_GREATER * K_QUESTION = SDLK_QUESTION # <<<<<<<<<<<<<< * K_AT = SDLK_AT * K_LEFTBRACKET = SDLK_LEFTBRACKET */ __pyx_t_1 = __Pyx_PyInt_From_int(SDLK_QUESTION); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 40; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); if (PyDict_SetItem(__pyx_d, __pyx_n_s_K_QUESTION, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 40; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "include/keycode_list.pxi":41 * K_GREATER = SDLK_GREATER * K_QUESTION = SDLK_QUESTION * K_AT = SDLK_AT # <<<<<<<<<<<<<< * K_LEFTBRACKET = SDLK_LEFTBRACKET * K_BACKSLASH = SDLK_BACKSLASH */ __pyx_t_1 = __Pyx_PyInt_From_int(SDLK_AT); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 41; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); if (PyDict_SetItem(__pyx_d, __pyx_n_s_K_AT, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 41; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "include/keycode_list.pxi":42 * K_QUESTION = SDLK_QUESTION * K_AT = SDLK_AT * K_LEFTBRACKET = SDLK_LEFTBRACKET # <<<<<<<<<<<<<< * K_BACKSLASH = SDLK_BACKSLASH * K_RIGHTBRACKET = SDLK_RIGHTBRACKET */ __pyx_t_1 = __Pyx_PyInt_From_int(SDLK_LEFTBRACKET); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 42; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); if (PyDict_SetItem(__pyx_d, __pyx_n_s_K_LEFTBRACKET, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 42; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "include/keycode_list.pxi":43 * K_AT = SDLK_AT * K_LEFTBRACKET = SDLK_LEFTBRACKET * K_BACKSLASH = SDLK_BACKSLASH # <<<<<<<<<<<<<< * K_RIGHTBRACKET = SDLK_RIGHTBRACKET * K_CARET = SDLK_CARET */ __pyx_t_1 = __Pyx_PyInt_From_int(SDLK_BACKSLASH); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 43; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); if (PyDict_SetItem(__pyx_d, __pyx_n_s_K_BACKSLASH, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 43; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "include/keycode_list.pxi":44 * K_LEFTBRACKET = SDLK_LEFTBRACKET * K_BACKSLASH = SDLK_BACKSLASH * K_RIGHTBRACKET = SDLK_RIGHTBRACKET # <<<<<<<<<<<<<< * K_CARET = SDLK_CARET * K_UNDERSCORE = SDLK_UNDERSCORE */ __pyx_t_1 = __Pyx_PyInt_From_int(SDLK_RIGHTBRACKET); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 44; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); if (PyDict_SetItem(__pyx_d, __pyx_n_s_K_RIGHTBRACKET, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 44; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "include/keycode_list.pxi":45 * K_BACKSLASH = SDLK_BACKSLASH * K_RIGHTBRACKET = SDLK_RIGHTBRACKET * K_CARET = SDLK_CARET # <<<<<<<<<<<<<< * K_UNDERSCORE = SDLK_UNDERSCORE * K_BACKQUOTE = SDLK_BACKQUOTE */ __pyx_t_1 = __Pyx_PyInt_From_int(SDLK_CARET); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 45; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); if (PyDict_SetItem(__pyx_d, __pyx_n_s_K_CARET, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 45; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "include/keycode_list.pxi":46 * K_RIGHTBRACKET = SDLK_RIGHTBRACKET * K_CARET = SDLK_CARET * K_UNDERSCORE = SDLK_UNDERSCORE # <<<<<<<<<<<<<< * K_BACKQUOTE = SDLK_BACKQUOTE * K_a = SDLK_a */ __pyx_t_1 = __Pyx_PyInt_From_int(SDLK_UNDERSCORE); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 46; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); if (PyDict_SetItem(__pyx_d, __pyx_n_s_K_UNDERSCORE, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 46; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "include/keycode_list.pxi":47 * K_CARET = SDLK_CARET * K_UNDERSCORE = SDLK_UNDERSCORE * K_BACKQUOTE = SDLK_BACKQUOTE # <<<<<<<<<<<<<< * K_a = SDLK_a * K_b = SDLK_b */ __pyx_t_1 = __Pyx_PyInt_From_int(SDLK_BACKQUOTE); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 47; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); if (PyDict_SetItem(__pyx_d, __pyx_n_s_K_BACKQUOTE, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 47; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "include/keycode_list.pxi":48 * K_UNDERSCORE = SDLK_UNDERSCORE * K_BACKQUOTE = SDLK_BACKQUOTE * K_a = SDLK_a # <<<<<<<<<<<<<< * K_b = SDLK_b * K_c = SDLK_c */ __pyx_t_1 = __Pyx_PyInt_From_int(SDLK_a); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 48; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); if (PyDict_SetItem(__pyx_d, __pyx_n_s_K_a, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 48; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "include/keycode_list.pxi":49 * K_BACKQUOTE = SDLK_BACKQUOTE * K_a = SDLK_a * K_b = SDLK_b # <<<<<<<<<<<<<< * K_c = SDLK_c * K_d = SDLK_d */ __pyx_t_1 = __Pyx_PyInt_From_int(SDLK_b); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 49; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); if (PyDict_SetItem(__pyx_d, __pyx_n_s_K_b, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 49; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "include/keycode_list.pxi":50 * K_a = SDLK_a * K_b = SDLK_b * K_c = SDLK_c # <<<<<<<<<<<<<< * K_d = SDLK_d * K_e = SDLK_e */ __pyx_t_1 = __Pyx_PyInt_From_int(SDLK_c); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 50; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); if (PyDict_SetItem(__pyx_d, __pyx_n_s_K_c, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 50; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "include/keycode_list.pxi":51 * K_b = SDLK_b * K_c = SDLK_c * K_d = SDLK_d # <<<<<<<<<<<<<< * K_e = SDLK_e * K_f = SDLK_f */ __pyx_t_1 = __Pyx_PyInt_From_int(SDLK_d); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 51; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); if (PyDict_SetItem(__pyx_d, __pyx_n_s_K_d, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 51; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "include/keycode_list.pxi":52 * K_c = SDLK_c * K_d = SDLK_d * K_e = SDLK_e # <<<<<<<<<<<<<< * K_f = SDLK_f * K_g = SDLK_g */ __pyx_t_1 = __Pyx_PyInt_From_int(SDLK_e); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 52; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); if (PyDict_SetItem(__pyx_d, __pyx_n_s_K_e, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 52; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "include/keycode_list.pxi":53 * K_d = SDLK_d * K_e = SDLK_e * K_f = SDLK_f # <<<<<<<<<<<<<< * K_g = SDLK_g * K_h = SDLK_h */ __pyx_t_1 = __Pyx_PyInt_From_int(SDLK_f); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 53; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); if (PyDict_SetItem(__pyx_d, __pyx_n_s_K_f, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 53; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "include/keycode_list.pxi":54 * K_e = SDLK_e * K_f = SDLK_f * K_g = SDLK_g # <<<<<<<<<<<<<< * K_h = SDLK_h * K_i = SDLK_i */ __pyx_t_1 = __Pyx_PyInt_From_int(SDLK_g); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 54; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); if (PyDict_SetItem(__pyx_d, __pyx_n_s_K_g, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 54; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "include/keycode_list.pxi":55 * K_f = SDLK_f * K_g = SDLK_g * K_h = SDLK_h # <<<<<<<<<<<<<< * K_i = SDLK_i * K_j = SDLK_j */ __pyx_t_1 = __Pyx_PyInt_From_int(SDLK_h); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 55; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); if (PyDict_SetItem(__pyx_d, __pyx_n_s_K_h, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 55; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "include/keycode_list.pxi":56 * K_g = SDLK_g * K_h = SDLK_h * K_i = SDLK_i # <<<<<<<<<<<<<< * K_j = SDLK_j * K_k = SDLK_k */ __pyx_t_1 = __Pyx_PyInt_From_int(SDLK_i); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 56; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); if (PyDict_SetItem(__pyx_d, __pyx_n_s_K_i, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 56; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "include/keycode_list.pxi":57 * K_h = SDLK_h * K_i = SDLK_i * K_j = SDLK_j # <<<<<<<<<<<<<< * K_k = SDLK_k * K_l = SDLK_l */ __pyx_t_1 = __Pyx_PyInt_From_int(SDLK_j); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 57; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); if (PyDict_SetItem(__pyx_d, __pyx_n_s_K_j, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 57; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "include/keycode_list.pxi":58 * K_i = SDLK_i * K_j = SDLK_j * K_k = SDLK_k # <<<<<<<<<<<<<< * K_l = SDLK_l * K_m = SDLK_m */ __pyx_t_1 = __Pyx_PyInt_From_int(SDLK_k); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 58; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); if (PyDict_SetItem(__pyx_d, __pyx_n_s_K_k, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 58; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "include/keycode_list.pxi":59 * K_j = SDLK_j * K_k = SDLK_k * K_l = SDLK_l # <<<<<<<<<<<<<< * K_m = SDLK_m * K_n = SDLK_n */ __pyx_t_1 = __Pyx_PyInt_From_int(SDLK_l); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 59; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); if (PyDict_SetItem(__pyx_d, __pyx_n_s_K_l, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 59; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "include/keycode_list.pxi":60 * K_k = SDLK_k * K_l = SDLK_l * K_m = SDLK_m # <<<<<<<<<<<<<< * K_n = SDLK_n * K_o = SDLK_o */ __pyx_t_1 = __Pyx_PyInt_From_int(SDLK_m); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 60; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); if (PyDict_SetItem(__pyx_d, __pyx_n_s_K_m, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 60; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "include/keycode_list.pxi":61 * K_l = SDLK_l * K_m = SDLK_m * K_n = SDLK_n # <<<<<<<<<<<<<< * K_o = SDLK_o * K_p = SDLK_p */ __pyx_t_1 = __Pyx_PyInt_From_int(SDLK_n); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 61; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); if (PyDict_SetItem(__pyx_d, __pyx_n_s_K_n, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 61; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "include/keycode_list.pxi":62 * K_m = SDLK_m * K_n = SDLK_n * K_o = SDLK_o # <<<<<<<<<<<<<< * K_p = SDLK_p * K_q = SDLK_q */ __pyx_t_1 = __Pyx_PyInt_From_int(SDLK_o); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 62; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); if (PyDict_SetItem(__pyx_d, __pyx_n_s_K_o, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 62; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "include/keycode_list.pxi":63 * K_n = SDLK_n * K_o = SDLK_o * K_p = SDLK_p # <<<<<<<<<<<<<< * K_q = SDLK_q * K_r = SDLK_r */ __pyx_t_1 = __Pyx_PyInt_From_int(SDLK_p); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 63; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); if (PyDict_SetItem(__pyx_d, __pyx_n_s_K_p, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 63; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "include/keycode_list.pxi":64 * K_o = SDLK_o * K_p = SDLK_p * K_q = SDLK_q # <<<<<<<<<<<<<< * K_r = SDLK_r * K_s = SDLK_s */ __pyx_t_1 = __Pyx_PyInt_From_int(SDLK_q); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 64; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); if (PyDict_SetItem(__pyx_d, __pyx_n_s_K_q, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 64; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "include/keycode_list.pxi":65 * K_p = SDLK_p * K_q = SDLK_q * K_r = SDLK_r # <<<<<<<<<<<<<< * K_s = SDLK_s * K_t = SDLK_t */ __pyx_t_1 = __Pyx_PyInt_From_int(SDLK_r); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 65; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); if (PyDict_SetItem(__pyx_d, __pyx_n_s_K_r, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 65; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "include/keycode_list.pxi":66 * K_q = SDLK_q * K_r = SDLK_r * K_s = SDLK_s # <<<<<<<<<<<<<< * K_t = SDLK_t * K_u = SDLK_u */ __pyx_t_1 = __Pyx_PyInt_From_int(SDLK_s); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 66; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); if (PyDict_SetItem(__pyx_d, __pyx_n_s_K_s, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 66; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "include/keycode_list.pxi":67 * K_r = SDLK_r * K_s = SDLK_s * K_t = SDLK_t # <<<<<<<<<<<<<< * K_u = SDLK_u * K_v = SDLK_v */ __pyx_t_1 = __Pyx_PyInt_From_int(SDLK_t); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 67; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); if (PyDict_SetItem(__pyx_d, __pyx_n_s_K_t, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 67; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "include/keycode_list.pxi":68 * K_s = SDLK_s * K_t = SDLK_t * K_u = SDLK_u # <<<<<<<<<<<<<< * K_v = SDLK_v * K_w = SDLK_w */ __pyx_t_1 = __Pyx_PyInt_From_int(SDLK_u); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 68; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); if (PyDict_SetItem(__pyx_d, __pyx_n_s_K_u, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 68; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "include/keycode_list.pxi":69 * K_t = SDLK_t * K_u = SDLK_u * K_v = SDLK_v # <<<<<<<<<<<<<< * K_w = SDLK_w * K_x = SDLK_x */ __pyx_t_1 = __Pyx_PyInt_From_int(SDLK_v); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 69; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); if (PyDict_SetItem(__pyx_d, __pyx_n_s_K_v, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 69; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "include/keycode_list.pxi":70 * K_u = SDLK_u * K_v = SDLK_v * K_w = SDLK_w # <<<<<<<<<<<<<< * K_x = SDLK_x * K_y = SDLK_y */ __pyx_t_1 = __Pyx_PyInt_From_int(SDLK_w); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 70; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); if (PyDict_SetItem(__pyx_d, __pyx_n_s_K_w, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 70; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "include/keycode_list.pxi":71 * K_v = SDLK_v * K_w = SDLK_w * K_x = SDLK_x # <<<<<<<<<<<<<< * K_y = SDLK_y * K_z = SDLK_z */ __pyx_t_1 = __Pyx_PyInt_From_int(SDLK_x); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 71; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); if (PyDict_SetItem(__pyx_d, __pyx_n_s_K_x, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 71; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "include/keycode_list.pxi":72 * K_w = SDLK_w * K_x = SDLK_x * K_y = SDLK_y # <<<<<<<<<<<<<< * K_z = SDLK_z * K_CAPSLOCK = SDLK_CAPSLOCK */ __pyx_t_1 = __Pyx_PyInt_From_int(SDLK_y); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 72; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); if (PyDict_SetItem(__pyx_d, __pyx_n_s_K_y, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 72; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "include/keycode_list.pxi":73 * K_x = SDLK_x * K_y = SDLK_y * K_z = SDLK_z # <<<<<<<<<<<<<< * K_CAPSLOCK = SDLK_CAPSLOCK * K_F1 = SDLK_F1 */ __pyx_t_1 = __Pyx_PyInt_From_int(SDLK_z); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 73; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); if (PyDict_SetItem(__pyx_d, __pyx_n_s_K_z, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 73; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "include/keycode_list.pxi":74 * K_y = SDLK_y * K_z = SDLK_z * K_CAPSLOCK = SDLK_CAPSLOCK # <<<<<<<<<<<<<< * K_F1 = SDLK_F1 * K_F2 = SDLK_F2 */ __pyx_t_1 = __Pyx_PyInt_From_int(SDLK_CAPSLOCK); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 74; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); if (PyDict_SetItem(__pyx_d, __pyx_n_s_K_CAPSLOCK, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 74; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "include/keycode_list.pxi":75 * K_z = SDLK_z * K_CAPSLOCK = SDLK_CAPSLOCK * K_F1 = SDLK_F1 # <<<<<<<<<<<<<< * K_F2 = SDLK_F2 * K_F3 = SDLK_F3 */ __pyx_t_1 = __Pyx_PyInt_From_int(SDLK_F1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 75; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); if (PyDict_SetItem(__pyx_d, __pyx_n_s_K_F1, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 75; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "include/keycode_list.pxi":76 * K_CAPSLOCK = SDLK_CAPSLOCK * K_F1 = SDLK_F1 * K_F2 = SDLK_F2 # <<<<<<<<<<<<<< * K_F3 = SDLK_F3 * K_F4 = SDLK_F4 */ __pyx_t_1 = __Pyx_PyInt_From_int(SDLK_F2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 76; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); if (PyDict_SetItem(__pyx_d, __pyx_n_s_K_F2, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 76; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "include/keycode_list.pxi":77 * K_F1 = SDLK_F1 * K_F2 = SDLK_F2 * K_F3 = SDLK_F3 # <<<<<<<<<<<<<< * K_F4 = SDLK_F4 * K_F5 = SDLK_F5 */ __pyx_t_1 = __Pyx_PyInt_From_int(SDLK_F3); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 77; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); if (PyDict_SetItem(__pyx_d, __pyx_n_s_K_F3, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 77; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "include/keycode_list.pxi":78 * K_F2 = SDLK_F2 * K_F3 = SDLK_F3 * K_F4 = SDLK_F4 # <<<<<<<<<<<<<< * K_F5 = SDLK_F5 * K_F6 = SDLK_F6 */ __pyx_t_1 = __Pyx_PyInt_From_int(SDLK_F4); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 78; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); if (PyDict_SetItem(__pyx_d, __pyx_n_s_K_F4, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 78; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "include/keycode_list.pxi":79 * K_F3 = SDLK_F3 * K_F4 = SDLK_F4 * K_F5 = SDLK_F5 # <<<<<<<<<<<<<< * K_F6 = SDLK_F6 * K_F7 = SDLK_F7 */ __pyx_t_1 = __Pyx_PyInt_From_int(SDLK_F5); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 79; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); if (PyDict_SetItem(__pyx_d, __pyx_n_s_K_F5, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 79; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "include/keycode_list.pxi":80 * K_F4 = SDLK_F4 * K_F5 = SDLK_F5 * K_F6 = SDLK_F6 # <<<<<<<<<<<<<< * K_F7 = SDLK_F7 * K_F8 = SDLK_F8 */ __pyx_t_1 = __Pyx_PyInt_From_int(SDLK_F6); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 80; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); if (PyDict_SetItem(__pyx_d, __pyx_n_s_K_F6, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 80; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "include/keycode_list.pxi":81 * K_F5 = SDLK_F5 * K_F6 = SDLK_F6 * K_F7 = SDLK_F7 # <<<<<<<<<<<<<< * K_F8 = SDLK_F8 * K_F9 = SDLK_F9 */ __pyx_t_1 = __Pyx_PyInt_From_int(SDLK_F7); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 81; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); if (PyDict_SetItem(__pyx_d, __pyx_n_s_K_F7, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 81; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "include/keycode_list.pxi":82 * K_F6 = SDLK_F6 * K_F7 = SDLK_F7 * K_F8 = SDLK_F8 # <<<<<<<<<<<<<< * K_F9 = SDLK_F9 * K_F10 = SDLK_F10 */ __pyx_t_1 = __Pyx_PyInt_From_int(SDLK_F8); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 82; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); if (PyDict_SetItem(__pyx_d, __pyx_n_s_K_F8, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 82; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "include/keycode_list.pxi":83 * K_F7 = SDLK_F7 * K_F8 = SDLK_F8 * K_F9 = SDLK_F9 # <<<<<<<<<<<<<< * K_F10 = SDLK_F10 * K_F11 = SDLK_F11 */ __pyx_t_1 = __Pyx_PyInt_From_int(SDLK_F9); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 83; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); if (PyDict_SetItem(__pyx_d, __pyx_n_s_K_F9, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 83; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "include/keycode_list.pxi":84 * K_F8 = SDLK_F8 * K_F9 = SDLK_F9 * K_F10 = SDLK_F10 # <<<<<<<<<<<<<< * K_F11 = SDLK_F11 * K_F12 = SDLK_F12 */ __pyx_t_1 = __Pyx_PyInt_From_int(SDLK_F10); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 84; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); if (PyDict_SetItem(__pyx_d, __pyx_n_s_K_F10, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 84; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "include/keycode_list.pxi":85 * K_F9 = SDLK_F9 * K_F10 = SDLK_F10 * K_F11 = SDLK_F11 # <<<<<<<<<<<<<< * K_F12 = SDLK_F12 * K_PRINTSCREEN = SDLK_PRINTSCREEN */ __pyx_t_1 = __Pyx_PyInt_From_int(SDLK_F11); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 85; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); if (PyDict_SetItem(__pyx_d, __pyx_n_s_K_F11, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 85; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "include/keycode_list.pxi":86 * K_F10 = SDLK_F10 * K_F11 = SDLK_F11 * K_F12 = SDLK_F12 # <<<<<<<<<<<<<< * K_PRINTSCREEN = SDLK_PRINTSCREEN * K_SCROLLLOCK = SDLK_SCROLLLOCK */ __pyx_t_1 = __Pyx_PyInt_From_int(SDLK_F12); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 86; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); if (PyDict_SetItem(__pyx_d, __pyx_n_s_K_F12, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 86; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "include/keycode_list.pxi":87 * K_F11 = SDLK_F11 * K_F12 = SDLK_F12 * K_PRINTSCREEN = SDLK_PRINTSCREEN # <<<<<<<<<<<<<< * K_SCROLLLOCK = SDLK_SCROLLLOCK * K_PAUSE = SDLK_PAUSE */ __pyx_t_1 = __Pyx_PyInt_From_int(SDLK_PRINTSCREEN); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 87; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); if (PyDict_SetItem(__pyx_d, __pyx_n_s_K_PRINTSCREEN, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 87; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "include/keycode_list.pxi":88 * K_F12 = SDLK_F12 * K_PRINTSCREEN = SDLK_PRINTSCREEN * K_SCROLLLOCK = SDLK_SCROLLLOCK # <<<<<<<<<<<<<< * K_PAUSE = SDLK_PAUSE * K_INSERT = SDLK_INSERT */ __pyx_t_1 = __Pyx_PyInt_From_int(SDLK_SCROLLLOCK); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 88; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); if (PyDict_SetItem(__pyx_d, __pyx_n_s_K_SCROLLLOCK, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 88; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "include/keycode_list.pxi":89 * K_PRINTSCREEN = SDLK_PRINTSCREEN * K_SCROLLLOCK = SDLK_SCROLLLOCK * K_PAUSE = SDLK_PAUSE # <<<<<<<<<<<<<< * K_INSERT = SDLK_INSERT * K_HOME = SDLK_HOME */ __pyx_t_1 = __Pyx_PyInt_From_int(SDLK_PAUSE); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 89; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); if (PyDict_SetItem(__pyx_d, __pyx_n_s_K_PAUSE, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 89; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "include/keycode_list.pxi":90 * K_SCROLLLOCK = SDLK_SCROLLLOCK * K_PAUSE = SDLK_PAUSE * K_INSERT = SDLK_INSERT # <<<<<<<<<<<<<< * K_HOME = SDLK_HOME * K_PAGEUP = SDLK_PAGEUP */ __pyx_t_1 = __Pyx_PyInt_From_int(SDLK_INSERT); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 90; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); if (PyDict_SetItem(__pyx_d, __pyx_n_s_K_INSERT, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 90; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "include/keycode_list.pxi":91 * K_PAUSE = SDLK_PAUSE * K_INSERT = SDLK_INSERT * K_HOME = SDLK_HOME # <<<<<<<<<<<<<< * K_PAGEUP = SDLK_PAGEUP * K_DELETE = SDLK_DELETE */ __pyx_t_1 = __Pyx_PyInt_From_int(SDLK_HOME); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 91; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); if (PyDict_SetItem(__pyx_d, __pyx_n_s_K_HOME, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 91; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "include/keycode_list.pxi":92 * K_INSERT = SDLK_INSERT * K_HOME = SDLK_HOME * K_PAGEUP = SDLK_PAGEUP # <<<<<<<<<<<<<< * K_DELETE = SDLK_DELETE * K_END = SDLK_END */ __pyx_t_1 = __Pyx_PyInt_From_int(SDLK_PAGEUP); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 92; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); if (PyDict_SetItem(__pyx_d, __pyx_n_s_K_PAGEUP, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 92; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "include/keycode_list.pxi":93 * K_HOME = SDLK_HOME * K_PAGEUP = SDLK_PAGEUP * K_DELETE = SDLK_DELETE # <<<<<<<<<<<<<< * K_END = SDLK_END * K_PAGEDOWN = SDLK_PAGEDOWN */ __pyx_t_1 = __Pyx_PyInt_From_int(SDLK_DELETE); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 93; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); if (PyDict_SetItem(__pyx_d, __pyx_n_s_K_DELETE, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 93; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "include/keycode_list.pxi":94 * K_PAGEUP = SDLK_PAGEUP * K_DELETE = SDLK_DELETE * K_END = SDLK_END # <<<<<<<<<<<<<< * K_PAGEDOWN = SDLK_PAGEDOWN * K_RIGHT = SDLK_RIGHT */ __pyx_t_1 = __Pyx_PyInt_From_int(SDLK_END); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 94; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); if (PyDict_SetItem(__pyx_d, __pyx_n_s_K_END, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 94; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "include/keycode_list.pxi":95 * K_DELETE = SDLK_DELETE * K_END = SDLK_END * K_PAGEDOWN = SDLK_PAGEDOWN # <<<<<<<<<<<<<< * K_RIGHT = SDLK_RIGHT * K_LEFT = SDLK_LEFT */ __pyx_t_1 = __Pyx_PyInt_From_int(SDLK_PAGEDOWN); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 95; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); if (PyDict_SetItem(__pyx_d, __pyx_n_s_K_PAGEDOWN, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 95; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "include/keycode_list.pxi":96 * K_END = SDLK_END * K_PAGEDOWN = SDLK_PAGEDOWN * K_RIGHT = SDLK_RIGHT # <<<<<<<<<<<<<< * K_LEFT = SDLK_LEFT * K_DOWN = SDLK_DOWN */ __pyx_t_1 = __Pyx_PyInt_From_int(SDLK_RIGHT); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 96; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); if (PyDict_SetItem(__pyx_d, __pyx_n_s_K_RIGHT, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 96; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "include/keycode_list.pxi":97 * K_PAGEDOWN = SDLK_PAGEDOWN * K_RIGHT = SDLK_RIGHT * K_LEFT = SDLK_LEFT # <<<<<<<<<<<<<< * K_DOWN = SDLK_DOWN * K_UP = SDLK_UP */ __pyx_t_1 = __Pyx_PyInt_From_int(SDLK_LEFT); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 97; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); if (PyDict_SetItem(__pyx_d, __pyx_n_s_K_LEFT, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 97; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "include/keycode_list.pxi":98 * K_RIGHT = SDLK_RIGHT * K_LEFT = SDLK_LEFT * K_DOWN = SDLK_DOWN # <<<<<<<<<<<<<< * K_UP = SDLK_UP * K_NUMLOCKCLEAR = SDLK_NUMLOCKCLEAR */ __pyx_t_1 = __Pyx_PyInt_From_int(SDLK_DOWN); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 98; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); if (PyDict_SetItem(__pyx_d, __pyx_n_s_K_DOWN, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 98; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "include/keycode_list.pxi":99 * K_LEFT = SDLK_LEFT * K_DOWN = SDLK_DOWN * K_UP = SDLK_UP # <<<<<<<<<<<<<< * K_NUMLOCKCLEAR = SDLK_NUMLOCKCLEAR * K_KP_DIVIDE = SDLK_KP_DIVIDE */ __pyx_t_1 = __Pyx_PyInt_From_int(SDLK_UP); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 99; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); if (PyDict_SetItem(__pyx_d, __pyx_n_s_K_UP, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 99; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "include/keycode_list.pxi":100 * K_DOWN = SDLK_DOWN * K_UP = SDLK_UP * K_NUMLOCKCLEAR = SDLK_NUMLOCKCLEAR # <<<<<<<<<<<<<< * K_KP_DIVIDE = SDLK_KP_DIVIDE * K_KP_MULTIPLY = SDLK_KP_MULTIPLY */ __pyx_t_1 = __Pyx_PyInt_From_int(SDLK_NUMLOCKCLEAR); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 100; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); if (PyDict_SetItem(__pyx_d, __pyx_n_s_K_NUMLOCKCLEAR, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 100; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "include/keycode_list.pxi":101 * K_UP = SDLK_UP * K_NUMLOCKCLEAR = SDLK_NUMLOCKCLEAR * K_KP_DIVIDE = SDLK_KP_DIVIDE # <<<<<<<<<<<<<< * K_KP_MULTIPLY = SDLK_KP_MULTIPLY * K_KP_MINUS = SDLK_KP_MINUS */ __pyx_t_1 = __Pyx_PyInt_From_int(SDLK_KP_DIVIDE); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 101; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); if (PyDict_SetItem(__pyx_d, __pyx_n_s_K_KP_DIVIDE, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 101; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "include/keycode_list.pxi":102 * K_NUMLOCKCLEAR = SDLK_NUMLOCKCLEAR * K_KP_DIVIDE = SDLK_KP_DIVIDE * K_KP_MULTIPLY = SDLK_KP_MULTIPLY # <<<<<<<<<<<<<< * K_KP_MINUS = SDLK_KP_MINUS * K_KP_PLUS = SDLK_KP_PLUS */ __pyx_t_1 = __Pyx_PyInt_From_int(SDLK_KP_MULTIPLY); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 102; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); if (PyDict_SetItem(__pyx_d, __pyx_n_s_K_KP_MULTIPLY, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 102; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "include/keycode_list.pxi":103 * K_KP_DIVIDE = SDLK_KP_DIVIDE * K_KP_MULTIPLY = SDLK_KP_MULTIPLY * K_KP_MINUS = SDLK_KP_MINUS # <<<<<<<<<<<<<< * K_KP_PLUS = SDLK_KP_PLUS * K_KP_ENTER = SDLK_KP_ENTER */ __pyx_t_1 = __Pyx_PyInt_From_int(SDLK_KP_MINUS); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 103; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); if (PyDict_SetItem(__pyx_d, __pyx_n_s_K_KP_MINUS, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 103; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "include/keycode_list.pxi":104 * K_KP_MULTIPLY = SDLK_KP_MULTIPLY * K_KP_MINUS = SDLK_KP_MINUS * K_KP_PLUS = SDLK_KP_PLUS # <<<<<<<<<<<<<< * K_KP_ENTER = SDLK_KP_ENTER * K_KP_1 = SDLK_KP_1 */ __pyx_t_1 = __Pyx_PyInt_From_int(SDLK_KP_PLUS); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 104; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); if (PyDict_SetItem(__pyx_d, __pyx_n_s_K_KP_PLUS, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 104; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "include/keycode_list.pxi":105 * K_KP_MINUS = SDLK_KP_MINUS * K_KP_PLUS = SDLK_KP_PLUS * K_KP_ENTER = SDLK_KP_ENTER # <<<<<<<<<<<<<< * K_KP_1 = SDLK_KP_1 * K_KP_2 = SDLK_KP_2 */ __pyx_t_1 = __Pyx_PyInt_From_int(SDLK_KP_ENTER); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 105; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); if (PyDict_SetItem(__pyx_d, __pyx_n_s_K_KP_ENTER, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 105; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "include/keycode_list.pxi":106 * K_KP_PLUS = SDLK_KP_PLUS * K_KP_ENTER = SDLK_KP_ENTER * K_KP_1 = SDLK_KP_1 # <<<<<<<<<<<<<< * K_KP_2 = SDLK_KP_2 * K_KP_3 = SDLK_KP_3 */ __pyx_t_1 = __Pyx_PyInt_From_int(SDLK_KP_1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 106; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); if (PyDict_SetItem(__pyx_d, __pyx_n_s_K_KP_1, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 106; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "include/keycode_list.pxi":107 * K_KP_ENTER = SDLK_KP_ENTER * K_KP_1 = SDLK_KP_1 * K_KP_2 = SDLK_KP_2 # <<<<<<<<<<<<<< * K_KP_3 = SDLK_KP_3 * K_KP_4 = SDLK_KP_4 */ __pyx_t_1 = __Pyx_PyInt_From_int(SDLK_KP_2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 107; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); if (PyDict_SetItem(__pyx_d, __pyx_n_s_K_KP_2, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 107; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "include/keycode_list.pxi":108 * K_KP_1 = SDLK_KP_1 * K_KP_2 = SDLK_KP_2 * K_KP_3 = SDLK_KP_3 # <<<<<<<<<<<<<< * K_KP_4 = SDLK_KP_4 * K_KP_5 = SDLK_KP_5 */ __pyx_t_1 = __Pyx_PyInt_From_int(SDLK_KP_3); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 108; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); if (PyDict_SetItem(__pyx_d, __pyx_n_s_K_KP_3, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 108; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "include/keycode_list.pxi":109 * K_KP_2 = SDLK_KP_2 * K_KP_3 = SDLK_KP_3 * K_KP_4 = SDLK_KP_4 # <<<<<<<<<<<<<< * K_KP_5 = SDLK_KP_5 * K_KP_6 = SDLK_KP_6 */ __pyx_t_1 = __Pyx_PyInt_From_int(SDLK_KP_4); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 109; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); if (PyDict_SetItem(__pyx_d, __pyx_n_s_K_KP_4, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 109; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "include/keycode_list.pxi":110 * K_KP_3 = SDLK_KP_3 * K_KP_4 = SDLK_KP_4 * K_KP_5 = SDLK_KP_5 # <<<<<<<<<<<<<< * K_KP_6 = SDLK_KP_6 * K_KP_7 = SDLK_KP_7 */ __pyx_t_1 = __Pyx_PyInt_From_int(SDLK_KP_5); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 110; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); if (PyDict_SetItem(__pyx_d, __pyx_n_s_K_KP_5, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 110; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "include/keycode_list.pxi":111 * K_KP_4 = SDLK_KP_4 * K_KP_5 = SDLK_KP_5 * K_KP_6 = SDLK_KP_6 # <<<<<<<<<<<<<< * K_KP_7 = SDLK_KP_7 * K_KP_8 = SDLK_KP_8 */ __pyx_t_1 = __Pyx_PyInt_From_int(SDLK_KP_6); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 111; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); if (PyDict_SetItem(__pyx_d, __pyx_n_s_K_KP_6, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 111; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "include/keycode_list.pxi":112 * K_KP_5 = SDLK_KP_5 * K_KP_6 = SDLK_KP_6 * K_KP_7 = SDLK_KP_7 # <<<<<<<<<<<<<< * K_KP_8 = SDLK_KP_8 * K_KP_9 = SDLK_KP_9 */ __pyx_t_1 = __Pyx_PyInt_From_int(SDLK_KP_7); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 112; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); if (PyDict_SetItem(__pyx_d, __pyx_n_s_K_KP_7, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 112; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "include/keycode_list.pxi":113 * K_KP_6 = SDLK_KP_6 * K_KP_7 = SDLK_KP_7 * K_KP_8 = SDLK_KP_8 # <<<<<<<<<<<<<< * K_KP_9 = SDLK_KP_9 * K_KP_0 = SDLK_KP_0 */ __pyx_t_1 = __Pyx_PyInt_From_int(SDLK_KP_8); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 113; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); if (PyDict_SetItem(__pyx_d, __pyx_n_s_K_KP_8, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 113; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "include/keycode_list.pxi":114 * K_KP_7 = SDLK_KP_7 * K_KP_8 = SDLK_KP_8 * K_KP_9 = SDLK_KP_9 # <<<<<<<<<<<<<< * K_KP_0 = SDLK_KP_0 * K_KP_PERIOD = SDLK_KP_PERIOD */ __pyx_t_1 = __Pyx_PyInt_From_int(SDLK_KP_9); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 114; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); if (PyDict_SetItem(__pyx_d, __pyx_n_s_K_KP_9, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 114; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "include/keycode_list.pxi":115 * K_KP_8 = SDLK_KP_8 * K_KP_9 = SDLK_KP_9 * K_KP_0 = SDLK_KP_0 # <<<<<<<<<<<<<< * K_KP_PERIOD = SDLK_KP_PERIOD * K_APPLICATION = SDLK_APPLICATION */ __pyx_t_1 = __Pyx_PyInt_From_int(SDLK_KP_0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 115; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); if (PyDict_SetItem(__pyx_d, __pyx_n_s_K_KP_0, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 115; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "include/keycode_list.pxi":116 * K_KP_9 = SDLK_KP_9 * K_KP_0 = SDLK_KP_0 * K_KP_PERIOD = SDLK_KP_PERIOD # <<<<<<<<<<<<<< * K_APPLICATION = SDLK_APPLICATION * K_POWER = SDLK_POWER */ __pyx_t_1 = __Pyx_PyInt_From_int(SDLK_KP_PERIOD); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 116; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); if (PyDict_SetItem(__pyx_d, __pyx_n_s_K_KP_PERIOD, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 116; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "include/keycode_list.pxi":117 * K_KP_0 = SDLK_KP_0 * K_KP_PERIOD = SDLK_KP_PERIOD * K_APPLICATION = SDLK_APPLICATION # <<<<<<<<<<<<<< * K_POWER = SDLK_POWER * K_KP_EQUALS = SDLK_KP_EQUALS */ __pyx_t_1 = __Pyx_PyInt_From_int(SDLK_APPLICATION); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 117; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); if (PyDict_SetItem(__pyx_d, __pyx_n_s_K_APPLICATION, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 117; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "include/keycode_list.pxi":118 * K_KP_PERIOD = SDLK_KP_PERIOD * K_APPLICATION = SDLK_APPLICATION * K_POWER = SDLK_POWER # <<<<<<<<<<<<<< * K_KP_EQUALS = SDLK_KP_EQUALS * K_F13 = SDLK_F13 */ __pyx_t_1 = __Pyx_PyInt_From_int(SDLK_POWER); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 118; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); if (PyDict_SetItem(__pyx_d, __pyx_n_s_K_POWER, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 118; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "include/keycode_list.pxi":119 * K_APPLICATION = SDLK_APPLICATION * K_POWER = SDLK_POWER * K_KP_EQUALS = SDLK_KP_EQUALS # <<<<<<<<<<<<<< * K_F13 = SDLK_F13 * K_F14 = SDLK_F14 */ __pyx_t_1 = __Pyx_PyInt_From_int(SDLK_KP_EQUALS); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 119; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); if (PyDict_SetItem(__pyx_d, __pyx_n_s_K_KP_EQUALS, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 119; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "include/keycode_list.pxi":120 * K_POWER = SDLK_POWER * K_KP_EQUALS = SDLK_KP_EQUALS * K_F13 = SDLK_F13 # <<<<<<<<<<<<<< * K_F14 = SDLK_F14 * K_F15 = SDLK_F15 */ __pyx_t_1 = __Pyx_PyInt_From_int(SDLK_F13); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 120; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); if (PyDict_SetItem(__pyx_d, __pyx_n_s_K_F13, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 120; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "include/keycode_list.pxi":121 * K_KP_EQUALS = SDLK_KP_EQUALS * K_F13 = SDLK_F13 * K_F14 = SDLK_F14 # <<<<<<<<<<<<<< * K_F15 = SDLK_F15 * K_F16 = SDLK_F16 */ __pyx_t_1 = __Pyx_PyInt_From_int(SDLK_F14); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 121; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); if (PyDict_SetItem(__pyx_d, __pyx_n_s_K_F14, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 121; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "include/keycode_list.pxi":122 * K_F13 = SDLK_F13 * K_F14 = SDLK_F14 * K_F15 = SDLK_F15 # <<<<<<<<<<<<<< * K_F16 = SDLK_F16 * K_F17 = SDLK_F17 */ __pyx_t_1 = __Pyx_PyInt_From_int(SDLK_F15); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 122; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); if (PyDict_SetItem(__pyx_d, __pyx_n_s_K_F15, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 122; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "include/keycode_list.pxi":123 * K_F14 = SDLK_F14 * K_F15 = SDLK_F15 * K_F16 = SDLK_F16 # <<<<<<<<<<<<<< * K_F17 = SDLK_F17 * K_F18 = SDLK_F18 */ __pyx_t_1 = __Pyx_PyInt_From_int(SDLK_F16); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 123; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); if (PyDict_SetItem(__pyx_d, __pyx_n_s_K_F16, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 123; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "include/keycode_list.pxi":124 * K_F15 = SDLK_F15 * K_F16 = SDLK_F16 * K_F17 = SDLK_F17 # <<<<<<<<<<<<<< * K_F18 = SDLK_F18 * K_F19 = SDLK_F19 */ __pyx_t_1 = __Pyx_PyInt_From_int(SDLK_F17); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 124; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); if (PyDict_SetItem(__pyx_d, __pyx_n_s_K_F17, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 124; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "include/keycode_list.pxi":125 * K_F16 = SDLK_F16 * K_F17 = SDLK_F17 * K_F18 = SDLK_F18 # <<<<<<<<<<<<<< * K_F19 = SDLK_F19 * K_F20 = SDLK_F20 */ __pyx_t_1 = __Pyx_PyInt_From_int(SDLK_F18); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 125; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); if (PyDict_SetItem(__pyx_d, __pyx_n_s_K_F18, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 125; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "include/keycode_list.pxi":126 * K_F17 = SDLK_F17 * K_F18 = SDLK_F18 * K_F19 = SDLK_F19 # <<<<<<<<<<<<<< * K_F20 = SDLK_F20 * K_F21 = SDLK_F21 */ __pyx_t_1 = __Pyx_PyInt_From_int(SDLK_F19); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 126; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); if (PyDict_SetItem(__pyx_d, __pyx_n_s_K_F19, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 126; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "include/keycode_list.pxi":127 * K_F18 = SDLK_F18 * K_F19 = SDLK_F19 * K_F20 = SDLK_F20 # <<<<<<<<<<<<<< * K_F21 = SDLK_F21 * K_F22 = SDLK_F22 */ __pyx_t_1 = __Pyx_PyInt_From_int(SDLK_F20); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 127; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); if (PyDict_SetItem(__pyx_d, __pyx_n_s_K_F20, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 127; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "include/keycode_list.pxi":128 * K_F19 = SDLK_F19 * K_F20 = SDLK_F20 * K_F21 = SDLK_F21 # <<<<<<<<<<<<<< * K_F22 = SDLK_F22 * K_F23 = SDLK_F23 */ __pyx_t_1 = __Pyx_PyInt_From_int(SDLK_F21); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 128; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); if (PyDict_SetItem(__pyx_d, __pyx_n_s_K_F21, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 128; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "include/keycode_list.pxi":129 * K_F20 = SDLK_F20 * K_F21 = SDLK_F21 * K_F22 = SDLK_F22 # <<<<<<<<<<<<<< * K_F23 = SDLK_F23 * K_F24 = SDLK_F24 */ __pyx_t_1 = __Pyx_PyInt_From_int(SDLK_F22); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 129; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); if (PyDict_SetItem(__pyx_d, __pyx_n_s_K_F22, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 129; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "include/keycode_list.pxi":130 * K_F21 = SDLK_F21 * K_F22 = SDLK_F22 * K_F23 = SDLK_F23 # <<<<<<<<<<<<<< * K_F24 = SDLK_F24 * K_EXECUTE = SDLK_EXECUTE */ __pyx_t_1 = __Pyx_PyInt_From_int(SDLK_F23); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 130; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); if (PyDict_SetItem(__pyx_d, __pyx_n_s_K_F23, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 130; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "include/keycode_list.pxi":131 * K_F22 = SDLK_F22 * K_F23 = SDLK_F23 * K_F24 = SDLK_F24 # <<<<<<<<<<<<<< * K_EXECUTE = SDLK_EXECUTE * K_HELP = SDLK_HELP */ __pyx_t_1 = __Pyx_PyInt_From_int(SDLK_F24); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 131; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); if (PyDict_SetItem(__pyx_d, __pyx_n_s_K_F24, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 131; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "include/keycode_list.pxi":132 * K_F23 = SDLK_F23 * K_F24 = SDLK_F24 * K_EXECUTE = SDLK_EXECUTE # <<<<<<<<<<<<<< * K_HELP = SDLK_HELP * K_MENU = SDLK_MENU */ __pyx_t_1 = __Pyx_PyInt_From_int(SDLK_EXECUTE); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 132; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); if (PyDict_SetItem(__pyx_d, __pyx_n_s_K_EXECUTE, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 132; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "include/keycode_list.pxi":133 * K_F24 = SDLK_F24 * K_EXECUTE = SDLK_EXECUTE * K_HELP = SDLK_HELP # <<<<<<<<<<<<<< * K_MENU = SDLK_MENU * K_SELECT = SDLK_SELECT */ __pyx_t_1 = __Pyx_PyInt_From_int(SDLK_HELP); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 133; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); if (PyDict_SetItem(__pyx_d, __pyx_n_s_K_HELP, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 133; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "include/keycode_list.pxi":134 * K_EXECUTE = SDLK_EXECUTE * K_HELP = SDLK_HELP * K_MENU = SDLK_MENU # <<<<<<<<<<<<<< * K_SELECT = SDLK_SELECT * K_STOP = SDLK_STOP */ __pyx_t_1 = __Pyx_PyInt_From_int(SDLK_MENU); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 134; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); if (PyDict_SetItem(__pyx_d, __pyx_n_s_K_MENU, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 134; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "include/keycode_list.pxi":135 * K_HELP = SDLK_HELP * K_MENU = SDLK_MENU * K_SELECT = SDLK_SELECT # <<<<<<<<<<<<<< * K_STOP = SDLK_STOP * K_AGAIN = SDLK_AGAIN */ __pyx_t_1 = __Pyx_PyInt_From_int(SDLK_SELECT); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 135; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); if (PyDict_SetItem(__pyx_d, __pyx_n_s_K_SELECT, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 135; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "include/keycode_list.pxi":136 * K_MENU = SDLK_MENU * K_SELECT = SDLK_SELECT * K_STOP = SDLK_STOP # <<<<<<<<<<<<<< * K_AGAIN = SDLK_AGAIN * K_UNDO = SDLK_UNDO */ __pyx_t_1 = __Pyx_PyInt_From_int(SDLK_STOP); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 136; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); if (PyDict_SetItem(__pyx_d, __pyx_n_s_K_STOP, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 136; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "include/keycode_list.pxi":137 * K_SELECT = SDLK_SELECT * K_STOP = SDLK_STOP * K_AGAIN = SDLK_AGAIN # <<<<<<<<<<<<<< * K_UNDO = SDLK_UNDO * K_CUT = SDLK_CUT */ __pyx_t_1 = __Pyx_PyInt_From_int(SDLK_AGAIN); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 137; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); if (PyDict_SetItem(__pyx_d, __pyx_n_s_K_AGAIN, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 137; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "include/keycode_list.pxi":138 * K_STOP = SDLK_STOP * K_AGAIN = SDLK_AGAIN * K_UNDO = SDLK_UNDO # <<<<<<<<<<<<<< * K_CUT = SDLK_CUT * K_COPY = SDLK_COPY */ __pyx_t_1 = __Pyx_PyInt_From_int(SDLK_UNDO); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 138; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); if (PyDict_SetItem(__pyx_d, __pyx_n_s_K_UNDO, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 138; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "include/keycode_list.pxi":139 * K_AGAIN = SDLK_AGAIN * K_UNDO = SDLK_UNDO * K_CUT = SDLK_CUT # <<<<<<<<<<<<<< * K_COPY = SDLK_COPY * K_PASTE = SDLK_PASTE */ __pyx_t_1 = __Pyx_PyInt_From_int(SDLK_CUT); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 139; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); if (PyDict_SetItem(__pyx_d, __pyx_n_s_K_CUT, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 139; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "include/keycode_list.pxi":140 * K_UNDO = SDLK_UNDO * K_CUT = SDLK_CUT * K_COPY = SDLK_COPY # <<<<<<<<<<<<<< * K_PASTE = SDLK_PASTE * K_FIND = SDLK_FIND */ __pyx_t_1 = __Pyx_PyInt_From_int(SDLK_COPY); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 140; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); if (PyDict_SetItem(__pyx_d, __pyx_n_s_K_COPY, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 140; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "include/keycode_list.pxi":141 * K_CUT = SDLK_CUT * K_COPY = SDLK_COPY * K_PASTE = SDLK_PASTE # <<<<<<<<<<<<<< * K_FIND = SDLK_FIND * K_MUTE = SDLK_MUTE */ __pyx_t_1 = __Pyx_PyInt_From_int(SDLK_PASTE); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 141; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); if (PyDict_SetItem(__pyx_d, __pyx_n_s_K_PASTE, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 141; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "include/keycode_list.pxi":142 * K_COPY = SDLK_COPY * K_PASTE = SDLK_PASTE * K_FIND = SDLK_FIND # <<<<<<<<<<<<<< * K_MUTE = SDLK_MUTE * K_VOLUMEUP = SDLK_VOLUMEUP */ __pyx_t_1 = __Pyx_PyInt_From_int(SDLK_FIND); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 142; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); if (PyDict_SetItem(__pyx_d, __pyx_n_s_K_FIND, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 142; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "include/keycode_list.pxi":143 * K_PASTE = SDLK_PASTE * K_FIND = SDLK_FIND * K_MUTE = SDLK_MUTE # <<<<<<<<<<<<<< * K_VOLUMEUP = SDLK_VOLUMEUP * K_VOLUMEDOWN = SDLK_VOLUMEDOWN */ __pyx_t_1 = __Pyx_PyInt_From_int(SDLK_MUTE); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 143; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); if (PyDict_SetItem(__pyx_d, __pyx_n_s_K_MUTE, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 143; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "include/keycode_list.pxi":144 * K_FIND = SDLK_FIND * K_MUTE = SDLK_MUTE * K_VOLUMEUP = SDLK_VOLUMEUP # <<<<<<<<<<<<<< * K_VOLUMEDOWN = SDLK_VOLUMEDOWN * K_KP_COMMA = SDLK_KP_COMMA */ __pyx_t_1 = __Pyx_PyInt_From_int(SDLK_VOLUMEUP); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 144; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); if (PyDict_SetItem(__pyx_d, __pyx_n_s_K_VOLUMEUP, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 144; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "include/keycode_list.pxi":145 * K_MUTE = SDLK_MUTE * K_VOLUMEUP = SDLK_VOLUMEUP * K_VOLUMEDOWN = SDLK_VOLUMEDOWN # <<<<<<<<<<<<<< * K_KP_COMMA = SDLK_KP_COMMA * K_KP_EQUALSAS400 = SDLK_KP_EQUALSAS400 */ __pyx_t_1 = __Pyx_PyInt_From_int(SDLK_VOLUMEDOWN); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 145; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); if (PyDict_SetItem(__pyx_d, __pyx_n_s_K_VOLUMEDOWN, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 145; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "include/keycode_list.pxi":146 * K_VOLUMEUP = SDLK_VOLUMEUP * K_VOLUMEDOWN = SDLK_VOLUMEDOWN * K_KP_COMMA = SDLK_KP_COMMA # <<<<<<<<<<<<<< * K_KP_EQUALSAS400 = SDLK_KP_EQUALSAS400 * K_ALTERASE = SDLK_ALTERASE */ __pyx_t_1 = __Pyx_PyInt_From_int(SDLK_KP_COMMA); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 146; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); if (PyDict_SetItem(__pyx_d, __pyx_n_s_K_KP_COMMA, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 146; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "include/keycode_list.pxi":147 * K_VOLUMEDOWN = SDLK_VOLUMEDOWN * K_KP_COMMA = SDLK_KP_COMMA * K_KP_EQUALSAS400 = SDLK_KP_EQUALSAS400 # <<<<<<<<<<<<<< * K_ALTERASE = SDLK_ALTERASE * K_SYSREQ = SDLK_SYSREQ */ __pyx_t_1 = __Pyx_PyInt_From_int(SDLK_KP_EQUALSAS400); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 147; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); if (PyDict_SetItem(__pyx_d, __pyx_n_s_K_KP_EQUALSAS400, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 147; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "include/keycode_list.pxi":148 * K_KP_COMMA = SDLK_KP_COMMA * K_KP_EQUALSAS400 = SDLK_KP_EQUALSAS400 * K_ALTERASE = SDLK_ALTERASE # <<<<<<<<<<<<<< * K_SYSREQ = SDLK_SYSREQ * K_CANCEL = SDLK_CANCEL */ __pyx_t_1 = __Pyx_PyInt_From_int(SDLK_ALTERASE); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 148; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); if (PyDict_SetItem(__pyx_d, __pyx_n_s_K_ALTERASE, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 148; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "include/keycode_list.pxi":149 * K_KP_EQUALSAS400 = SDLK_KP_EQUALSAS400 * K_ALTERASE = SDLK_ALTERASE * K_SYSREQ = SDLK_SYSREQ # <<<<<<<<<<<<<< * K_CANCEL = SDLK_CANCEL * K_CLEAR = SDLK_CLEAR */ __pyx_t_1 = __Pyx_PyInt_From_int(SDLK_SYSREQ); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 149; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); if (PyDict_SetItem(__pyx_d, __pyx_n_s_K_SYSREQ, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 149; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "include/keycode_list.pxi":150 * K_ALTERASE = SDLK_ALTERASE * K_SYSREQ = SDLK_SYSREQ * K_CANCEL = SDLK_CANCEL # <<<<<<<<<<<<<< * K_CLEAR = SDLK_CLEAR * K_PRIOR = SDLK_PRIOR */ __pyx_t_1 = __Pyx_PyInt_From_int(SDLK_CANCEL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 150; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); if (PyDict_SetItem(__pyx_d, __pyx_n_s_K_CANCEL, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 150; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "include/keycode_list.pxi":151 * K_SYSREQ = SDLK_SYSREQ * K_CANCEL = SDLK_CANCEL * K_CLEAR = SDLK_CLEAR # <<<<<<<<<<<<<< * K_PRIOR = SDLK_PRIOR * K_RETURN2 = SDLK_RETURN2 */ __pyx_t_1 = __Pyx_PyInt_From_int(SDLK_CLEAR); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 151; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); if (PyDict_SetItem(__pyx_d, __pyx_n_s_K_CLEAR, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 151; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "include/keycode_list.pxi":152 * K_CANCEL = SDLK_CANCEL * K_CLEAR = SDLK_CLEAR * K_PRIOR = SDLK_PRIOR # <<<<<<<<<<<<<< * K_RETURN2 = SDLK_RETURN2 * K_SEPARATOR = SDLK_SEPARATOR */ __pyx_t_1 = __Pyx_PyInt_From_int(SDLK_PRIOR); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 152; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); if (PyDict_SetItem(__pyx_d, __pyx_n_s_K_PRIOR, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 152; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "include/keycode_list.pxi":153 * K_CLEAR = SDLK_CLEAR * K_PRIOR = SDLK_PRIOR * K_RETURN2 = SDLK_RETURN2 # <<<<<<<<<<<<<< * K_SEPARATOR = SDLK_SEPARATOR * K_OUT = SDLK_OUT */ __pyx_t_1 = __Pyx_PyInt_From_int(SDLK_RETURN2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 153; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); if (PyDict_SetItem(__pyx_d, __pyx_n_s_K_RETURN2, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 153; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "include/keycode_list.pxi":154 * K_PRIOR = SDLK_PRIOR * K_RETURN2 = SDLK_RETURN2 * K_SEPARATOR = SDLK_SEPARATOR # <<<<<<<<<<<<<< * K_OUT = SDLK_OUT * K_OPER = SDLK_OPER */ __pyx_t_1 = __Pyx_PyInt_From_int(SDLK_SEPARATOR); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 154; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); if (PyDict_SetItem(__pyx_d, __pyx_n_s_K_SEPARATOR, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 154; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "include/keycode_list.pxi":155 * K_RETURN2 = SDLK_RETURN2 * K_SEPARATOR = SDLK_SEPARATOR * K_OUT = SDLK_OUT # <<<<<<<<<<<<<< * K_OPER = SDLK_OPER * K_CLEARAGAIN = SDLK_CLEARAGAIN */ __pyx_t_1 = __Pyx_PyInt_From_int(SDLK_OUT); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 155; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); if (PyDict_SetItem(__pyx_d, __pyx_n_s_K_OUT, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 155; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "include/keycode_list.pxi":156 * K_SEPARATOR = SDLK_SEPARATOR * K_OUT = SDLK_OUT * K_OPER = SDLK_OPER # <<<<<<<<<<<<<< * K_CLEARAGAIN = SDLK_CLEARAGAIN * K_CRSEL = SDLK_CRSEL */ __pyx_t_1 = __Pyx_PyInt_From_int(SDLK_OPER); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 156; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); if (PyDict_SetItem(__pyx_d, __pyx_n_s_K_OPER, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 156; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "include/keycode_list.pxi":157 * K_OUT = SDLK_OUT * K_OPER = SDLK_OPER * K_CLEARAGAIN = SDLK_CLEARAGAIN # <<<<<<<<<<<<<< * K_CRSEL = SDLK_CRSEL * K_EXSEL = SDLK_EXSEL */ __pyx_t_1 = __Pyx_PyInt_From_int(SDLK_CLEARAGAIN); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 157; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); if (PyDict_SetItem(__pyx_d, __pyx_n_s_K_CLEARAGAIN, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 157; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "include/keycode_list.pxi":158 * K_OPER = SDLK_OPER * K_CLEARAGAIN = SDLK_CLEARAGAIN * K_CRSEL = SDLK_CRSEL # <<<<<<<<<<<<<< * K_EXSEL = SDLK_EXSEL * K_KP_00 = SDLK_KP_00 */ __pyx_t_1 = __Pyx_PyInt_From_int(SDLK_CRSEL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 158; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); if (PyDict_SetItem(__pyx_d, __pyx_n_s_K_CRSEL, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 158; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "include/keycode_list.pxi":159 * K_CLEARAGAIN = SDLK_CLEARAGAIN * K_CRSEL = SDLK_CRSEL * K_EXSEL = SDLK_EXSEL # <<<<<<<<<<<<<< * K_KP_00 = SDLK_KP_00 * K_KP_000 = SDLK_KP_000 */ __pyx_t_1 = __Pyx_PyInt_From_int(SDLK_EXSEL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 159; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); if (PyDict_SetItem(__pyx_d, __pyx_n_s_K_EXSEL, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 159; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "include/keycode_list.pxi":160 * K_CRSEL = SDLK_CRSEL * K_EXSEL = SDLK_EXSEL * K_KP_00 = SDLK_KP_00 # <<<<<<<<<<<<<< * K_KP_000 = SDLK_KP_000 * K_THOUSANDSSEPARATOR = SDLK_THOUSANDSSEPARATOR */ __pyx_t_1 = __Pyx_PyInt_From_int(SDLK_KP_00); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 160; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); if (PyDict_SetItem(__pyx_d, __pyx_n_s_K_KP_00, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 160; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "include/keycode_list.pxi":161 * K_EXSEL = SDLK_EXSEL * K_KP_00 = SDLK_KP_00 * K_KP_000 = SDLK_KP_000 # <<<<<<<<<<<<<< * K_THOUSANDSSEPARATOR = SDLK_THOUSANDSSEPARATOR * K_DECIMALSEPARATOR = SDLK_DECIMALSEPARATOR */ __pyx_t_1 = __Pyx_PyInt_From_int(SDLK_KP_000); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 161; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); if (PyDict_SetItem(__pyx_d, __pyx_n_s_K_KP_000, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 161; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "include/keycode_list.pxi":162 * K_KP_00 = SDLK_KP_00 * K_KP_000 = SDLK_KP_000 * K_THOUSANDSSEPARATOR = SDLK_THOUSANDSSEPARATOR # <<<<<<<<<<<<<< * K_DECIMALSEPARATOR = SDLK_DECIMALSEPARATOR * K_CURRENCYUNIT = SDLK_CURRENCYUNIT */ __pyx_t_1 = __Pyx_PyInt_From_int(SDLK_THOUSANDSSEPARATOR); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 162; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); if (PyDict_SetItem(__pyx_d, __pyx_n_s_K_THOUSANDSSEPARATOR, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 162; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "include/keycode_list.pxi":163 * K_KP_000 = SDLK_KP_000 * K_THOUSANDSSEPARATOR = SDLK_THOUSANDSSEPARATOR * K_DECIMALSEPARATOR = SDLK_DECIMALSEPARATOR # <<<<<<<<<<<<<< * K_CURRENCYUNIT = SDLK_CURRENCYUNIT * K_CURRENCYSUBUNIT = SDLK_CURRENCYSUBUNIT */ __pyx_t_1 = __Pyx_PyInt_From_int(SDLK_DECIMALSEPARATOR); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 163; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); if (PyDict_SetItem(__pyx_d, __pyx_n_s_K_DECIMALSEPARATOR, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 163; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "include/keycode_list.pxi":164 * K_THOUSANDSSEPARATOR = SDLK_THOUSANDSSEPARATOR * K_DECIMALSEPARATOR = SDLK_DECIMALSEPARATOR * K_CURRENCYUNIT = SDLK_CURRENCYUNIT # <<<<<<<<<<<<<< * K_CURRENCYSUBUNIT = SDLK_CURRENCYSUBUNIT * K_KP_LEFTPAREN = SDLK_KP_LEFTPAREN */ __pyx_t_1 = __Pyx_PyInt_From_int(SDLK_CURRENCYUNIT); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 164; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); if (PyDict_SetItem(__pyx_d, __pyx_n_s_K_CURRENCYUNIT, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 164; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "include/keycode_list.pxi":165 * K_DECIMALSEPARATOR = SDLK_DECIMALSEPARATOR * K_CURRENCYUNIT = SDLK_CURRENCYUNIT * K_CURRENCYSUBUNIT = SDLK_CURRENCYSUBUNIT # <<<<<<<<<<<<<< * K_KP_LEFTPAREN = SDLK_KP_LEFTPAREN * K_KP_RIGHTPAREN = SDLK_KP_RIGHTPAREN */ __pyx_t_1 = __Pyx_PyInt_From_int(SDLK_CURRENCYSUBUNIT); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 165; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); if (PyDict_SetItem(__pyx_d, __pyx_n_s_K_CURRENCYSUBUNIT, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 165; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "include/keycode_list.pxi":166 * K_CURRENCYUNIT = SDLK_CURRENCYUNIT * K_CURRENCYSUBUNIT = SDLK_CURRENCYSUBUNIT * K_KP_LEFTPAREN = SDLK_KP_LEFTPAREN # <<<<<<<<<<<<<< * K_KP_RIGHTPAREN = SDLK_KP_RIGHTPAREN * K_KP_LEFTBRACE = SDLK_KP_LEFTBRACE */ __pyx_t_1 = __Pyx_PyInt_From_int(SDLK_KP_LEFTPAREN); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 166; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); if (PyDict_SetItem(__pyx_d, __pyx_n_s_K_KP_LEFTPAREN, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 166; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "include/keycode_list.pxi":167 * K_CURRENCYSUBUNIT = SDLK_CURRENCYSUBUNIT * K_KP_LEFTPAREN = SDLK_KP_LEFTPAREN * K_KP_RIGHTPAREN = SDLK_KP_RIGHTPAREN # <<<<<<<<<<<<<< * K_KP_LEFTBRACE = SDLK_KP_LEFTBRACE * K_KP_RIGHTBRACE = SDLK_KP_RIGHTBRACE */ __pyx_t_1 = __Pyx_PyInt_From_int(SDLK_KP_RIGHTPAREN); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 167; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); if (PyDict_SetItem(__pyx_d, __pyx_n_s_K_KP_RIGHTPAREN, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 167; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "include/keycode_list.pxi":168 * K_KP_LEFTPAREN = SDLK_KP_LEFTPAREN * K_KP_RIGHTPAREN = SDLK_KP_RIGHTPAREN * K_KP_LEFTBRACE = SDLK_KP_LEFTBRACE # <<<<<<<<<<<<<< * K_KP_RIGHTBRACE = SDLK_KP_RIGHTBRACE * K_KP_TAB = SDLK_KP_TAB */ __pyx_t_1 = __Pyx_PyInt_From_int(SDLK_KP_LEFTBRACE); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 168; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); if (PyDict_SetItem(__pyx_d, __pyx_n_s_K_KP_LEFTBRACE, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 168; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "include/keycode_list.pxi":169 * K_KP_RIGHTPAREN = SDLK_KP_RIGHTPAREN * K_KP_LEFTBRACE = SDLK_KP_LEFTBRACE * K_KP_RIGHTBRACE = SDLK_KP_RIGHTBRACE # <<<<<<<<<<<<<< * K_KP_TAB = SDLK_KP_TAB * K_KP_BACKSPACE = SDLK_KP_BACKSPACE */ __pyx_t_1 = __Pyx_PyInt_From_int(SDLK_KP_RIGHTBRACE); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 169; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); if (PyDict_SetItem(__pyx_d, __pyx_n_s_K_KP_RIGHTBRACE, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 169; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "include/keycode_list.pxi":170 * K_KP_LEFTBRACE = SDLK_KP_LEFTBRACE * K_KP_RIGHTBRACE = SDLK_KP_RIGHTBRACE * K_KP_TAB = SDLK_KP_TAB # <<<<<<<<<<<<<< * K_KP_BACKSPACE = SDLK_KP_BACKSPACE * K_KP_A = SDLK_KP_A */ __pyx_t_1 = __Pyx_PyInt_From_int(SDLK_KP_TAB); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 170; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); if (PyDict_SetItem(__pyx_d, __pyx_n_s_K_KP_TAB, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 170; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "include/keycode_list.pxi":171 * K_KP_RIGHTBRACE = SDLK_KP_RIGHTBRACE * K_KP_TAB = SDLK_KP_TAB * K_KP_BACKSPACE = SDLK_KP_BACKSPACE # <<<<<<<<<<<<<< * K_KP_A = SDLK_KP_A * K_KP_B = SDLK_KP_B */ __pyx_t_1 = __Pyx_PyInt_From_int(SDLK_KP_BACKSPACE); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 171; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); if (PyDict_SetItem(__pyx_d, __pyx_n_s_K_KP_BACKSPACE, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 171; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "include/keycode_list.pxi":172 * K_KP_TAB = SDLK_KP_TAB * K_KP_BACKSPACE = SDLK_KP_BACKSPACE * K_KP_A = SDLK_KP_A # <<<<<<<<<<<<<< * K_KP_B = SDLK_KP_B * K_KP_C = SDLK_KP_C */ __pyx_t_1 = __Pyx_PyInt_From_int(SDLK_KP_A); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 172; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); if (PyDict_SetItem(__pyx_d, __pyx_n_s_K_KP_A, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 172; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "include/keycode_list.pxi":173 * K_KP_BACKSPACE = SDLK_KP_BACKSPACE * K_KP_A = SDLK_KP_A * K_KP_B = SDLK_KP_B # <<<<<<<<<<<<<< * K_KP_C = SDLK_KP_C * K_KP_D = SDLK_KP_D */ __pyx_t_1 = __Pyx_PyInt_From_int(SDLK_KP_B); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 173; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); if (PyDict_SetItem(__pyx_d, __pyx_n_s_K_KP_B, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 173; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "include/keycode_list.pxi":174 * K_KP_A = SDLK_KP_A * K_KP_B = SDLK_KP_B * K_KP_C = SDLK_KP_C # <<<<<<<<<<<<<< * K_KP_D = SDLK_KP_D * K_KP_E = SDLK_KP_E */ __pyx_t_1 = __Pyx_PyInt_From_int(SDLK_KP_C); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 174; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); if (PyDict_SetItem(__pyx_d, __pyx_n_s_K_KP_C, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 174; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "include/keycode_list.pxi":175 * K_KP_B = SDLK_KP_B * K_KP_C = SDLK_KP_C * K_KP_D = SDLK_KP_D # <<<<<<<<<<<<<< * K_KP_E = SDLK_KP_E * K_KP_F = SDLK_KP_F */ __pyx_t_1 = __Pyx_PyInt_From_int(SDLK_KP_D); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 175; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); if (PyDict_SetItem(__pyx_d, __pyx_n_s_K_KP_D, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 175; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "include/keycode_list.pxi":176 * K_KP_C = SDLK_KP_C * K_KP_D = SDLK_KP_D * K_KP_E = SDLK_KP_E # <<<<<<<<<<<<<< * K_KP_F = SDLK_KP_F * K_KP_XOR = SDLK_KP_XOR */ __pyx_t_1 = __Pyx_PyInt_From_int(SDLK_KP_E); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 176; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); if (PyDict_SetItem(__pyx_d, __pyx_n_s_K_KP_E, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 176; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "include/keycode_list.pxi":177 * K_KP_D = SDLK_KP_D * K_KP_E = SDLK_KP_E * K_KP_F = SDLK_KP_F # <<<<<<<<<<<<<< * K_KP_XOR = SDLK_KP_XOR * K_KP_POWER = SDLK_KP_POWER */ __pyx_t_1 = __Pyx_PyInt_From_int(SDLK_KP_F); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 177; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); if (PyDict_SetItem(__pyx_d, __pyx_n_s_K_KP_F, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 177; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "include/keycode_list.pxi":178 * K_KP_E = SDLK_KP_E * K_KP_F = SDLK_KP_F * K_KP_XOR = SDLK_KP_XOR # <<<<<<<<<<<<<< * K_KP_POWER = SDLK_KP_POWER * K_KP_PERCENT = SDLK_KP_PERCENT */ __pyx_t_1 = __Pyx_PyInt_From_int(SDLK_KP_XOR); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 178; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); if (PyDict_SetItem(__pyx_d, __pyx_n_s_K_KP_XOR, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 178; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "include/keycode_list.pxi":179 * K_KP_F = SDLK_KP_F * K_KP_XOR = SDLK_KP_XOR * K_KP_POWER = SDLK_KP_POWER # <<<<<<<<<<<<<< * K_KP_PERCENT = SDLK_KP_PERCENT * K_KP_LESS = SDLK_KP_LESS */ __pyx_t_1 = __Pyx_PyInt_From_int(SDLK_KP_POWER); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 179; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); if (PyDict_SetItem(__pyx_d, __pyx_n_s_K_KP_POWER, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 179; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "include/keycode_list.pxi":180 * K_KP_XOR = SDLK_KP_XOR * K_KP_POWER = SDLK_KP_POWER * K_KP_PERCENT = SDLK_KP_PERCENT # <<<<<<<<<<<<<< * K_KP_LESS = SDLK_KP_LESS * K_KP_GREATER = SDLK_KP_GREATER */ __pyx_t_1 = __Pyx_PyInt_From_int(SDLK_KP_PERCENT); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 180; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); if (PyDict_SetItem(__pyx_d, __pyx_n_s_K_KP_PERCENT, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 180; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "include/keycode_list.pxi":181 * K_KP_POWER = SDLK_KP_POWER * K_KP_PERCENT = SDLK_KP_PERCENT * K_KP_LESS = SDLK_KP_LESS # <<<<<<<<<<<<<< * K_KP_GREATER = SDLK_KP_GREATER * K_KP_AMPERSAND = SDLK_KP_AMPERSAND */ __pyx_t_1 = __Pyx_PyInt_From_int(SDLK_KP_LESS); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 181; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); if (PyDict_SetItem(__pyx_d, __pyx_n_s_K_KP_LESS, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 181; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "include/keycode_list.pxi":182 * K_KP_PERCENT = SDLK_KP_PERCENT * K_KP_LESS = SDLK_KP_LESS * K_KP_GREATER = SDLK_KP_GREATER # <<<<<<<<<<<<<< * K_KP_AMPERSAND = SDLK_KP_AMPERSAND * K_KP_DBLAMPERSAND = SDLK_KP_DBLAMPERSAND */ __pyx_t_1 = __Pyx_PyInt_From_int(SDLK_KP_GREATER); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 182; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); if (PyDict_SetItem(__pyx_d, __pyx_n_s_K_KP_GREATER, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 182; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "include/keycode_list.pxi":183 * K_KP_LESS = SDLK_KP_LESS * K_KP_GREATER = SDLK_KP_GREATER * K_KP_AMPERSAND = SDLK_KP_AMPERSAND # <<<<<<<<<<<<<< * K_KP_DBLAMPERSAND = SDLK_KP_DBLAMPERSAND * K_KP_VERTICALBAR = SDLK_KP_VERTICALBAR */ __pyx_t_1 = __Pyx_PyInt_From_int(SDLK_KP_AMPERSAND); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 183; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); if (PyDict_SetItem(__pyx_d, __pyx_n_s_K_KP_AMPERSAND, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 183; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "include/keycode_list.pxi":184 * K_KP_GREATER = SDLK_KP_GREATER * K_KP_AMPERSAND = SDLK_KP_AMPERSAND * K_KP_DBLAMPERSAND = SDLK_KP_DBLAMPERSAND # <<<<<<<<<<<<<< * K_KP_VERTICALBAR = SDLK_KP_VERTICALBAR * K_KP_DBLVERTICALBAR = SDLK_KP_DBLVERTICALBAR */ __pyx_t_1 = __Pyx_PyInt_From_int(SDLK_KP_DBLAMPERSAND); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 184; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); if (PyDict_SetItem(__pyx_d, __pyx_n_s_K_KP_DBLAMPERSAND, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 184; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "include/keycode_list.pxi":185 * K_KP_AMPERSAND = SDLK_KP_AMPERSAND * K_KP_DBLAMPERSAND = SDLK_KP_DBLAMPERSAND * K_KP_VERTICALBAR = SDLK_KP_VERTICALBAR # <<<<<<<<<<<<<< * K_KP_DBLVERTICALBAR = SDLK_KP_DBLVERTICALBAR * K_KP_COLON = SDLK_KP_COLON */ __pyx_t_1 = __Pyx_PyInt_From_int(SDLK_KP_VERTICALBAR); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 185; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); if (PyDict_SetItem(__pyx_d, __pyx_n_s_K_KP_VERTICALBAR, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 185; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "include/keycode_list.pxi":186 * K_KP_DBLAMPERSAND = SDLK_KP_DBLAMPERSAND * K_KP_VERTICALBAR = SDLK_KP_VERTICALBAR * K_KP_DBLVERTICALBAR = SDLK_KP_DBLVERTICALBAR # <<<<<<<<<<<<<< * K_KP_COLON = SDLK_KP_COLON * K_KP_HASH = SDLK_KP_HASH */ __pyx_t_1 = __Pyx_PyInt_From_int(SDLK_KP_DBLVERTICALBAR); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 186; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); if (PyDict_SetItem(__pyx_d, __pyx_n_s_K_KP_DBLVERTICALBAR, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 186; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "include/keycode_list.pxi":187 * K_KP_VERTICALBAR = SDLK_KP_VERTICALBAR * K_KP_DBLVERTICALBAR = SDLK_KP_DBLVERTICALBAR * K_KP_COLON = SDLK_KP_COLON # <<<<<<<<<<<<<< * K_KP_HASH = SDLK_KP_HASH * K_KP_SPACE = SDLK_KP_SPACE */ __pyx_t_1 = __Pyx_PyInt_From_int(SDLK_KP_COLON); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 187; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); if (PyDict_SetItem(__pyx_d, __pyx_n_s_K_KP_COLON, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 187; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "include/keycode_list.pxi":188 * K_KP_DBLVERTICALBAR = SDLK_KP_DBLVERTICALBAR * K_KP_COLON = SDLK_KP_COLON * K_KP_HASH = SDLK_KP_HASH # <<<<<<<<<<<<<< * K_KP_SPACE = SDLK_KP_SPACE * K_KP_AT = SDLK_KP_AT */ __pyx_t_1 = __Pyx_PyInt_From_int(SDLK_KP_HASH); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 188; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); if (PyDict_SetItem(__pyx_d, __pyx_n_s_K_KP_HASH, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 188; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "include/keycode_list.pxi":189 * K_KP_COLON = SDLK_KP_COLON * K_KP_HASH = SDLK_KP_HASH * K_KP_SPACE = SDLK_KP_SPACE # <<<<<<<<<<<<<< * K_KP_AT = SDLK_KP_AT * K_KP_EXCLAM = SDLK_KP_EXCLAM */ __pyx_t_1 = __Pyx_PyInt_From_int(SDLK_KP_SPACE); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 189; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); if (PyDict_SetItem(__pyx_d, __pyx_n_s_K_KP_SPACE, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 189; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "include/keycode_list.pxi":190 * K_KP_HASH = SDLK_KP_HASH * K_KP_SPACE = SDLK_KP_SPACE * K_KP_AT = SDLK_KP_AT # <<<<<<<<<<<<<< * K_KP_EXCLAM = SDLK_KP_EXCLAM * K_KP_MEMSTORE = SDLK_KP_MEMSTORE */ __pyx_t_1 = __Pyx_PyInt_From_int(SDLK_KP_AT); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 190; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); if (PyDict_SetItem(__pyx_d, __pyx_n_s_K_KP_AT, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 190; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "include/keycode_list.pxi":191 * K_KP_SPACE = SDLK_KP_SPACE * K_KP_AT = SDLK_KP_AT * K_KP_EXCLAM = SDLK_KP_EXCLAM # <<<<<<<<<<<<<< * K_KP_MEMSTORE = SDLK_KP_MEMSTORE * K_KP_MEMRECALL = SDLK_KP_MEMRECALL */ __pyx_t_1 = __Pyx_PyInt_From_int(SDLK_KP_EXCLAM); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 191; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); if (PyDict_SetItem(__pyx_d, __pyx_n_s_K_KP_EXCLAM, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 191; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "include/keycode_list.pxi":192 * K_KP_AT = SDLK_KP_AT * K_KP_EXCLAM = SDLK_KP_EXCLAM * K_KP_MEMSTORE = SDLK_KP_MEMSTORE # <<<<<<<<<<<<<< * K_KP_MEMRECALL = SDLK_KP_MEMRECALL * K_KP_MEMCLEAR = SDLK_KP_MEMCLEAR */ __pyx_t_1 = __Pyx_PyInt_From_int(SDLK_KP_MEMSTORE); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 192; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); if (PyDict_SetItem(__pyx_d, __pyx_n_s_K_KP_MEMSTORE, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 192; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "include/keycode_list.pxi":193 * K_KP_EXCLAM = SDLK_KP_EXCLAM * K_KP_MEMSTORE = SDLK_KP_MEMSTORE * K_KP_MEMRECALL = SDLK_KP_MEMRECALL # <<<<<<<<<<<<<< * K_KP_MEMCLEAR = SDLK_KP_MEMCLEAR * K_KP_MEMADD = SDLK_KP_MEMADD */ __pyx_t_1 = __Pyx_PyInt_From_int(SDLK_KP_MEMRECALL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 193; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); if (PyDict_SetItem(__pyx_d, __pyx_n_s_K_KP_MEMRECALL, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 193; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "include/keycode_list.pxi":194 * K_KP_MEMSTORE = SDLK_KP_MEMSTORE * K_KP_MEMRECALL = SDLK_KP_MEMRECALL * K_KP_MEMCLEAR = SDLK_KP_MEMCLEAR # <<<<<<<<<<<<<< * K_KP_MEMADD = SDLK_KP_MEMADD * K_KP_MEMSUBTRACT = SDLK_KP_MEMSUBTRACT */ __pyx_t_1 = __Pyx_PyInt_From_int(SDLK_KP_MEMCLEAR); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 194; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); if (PyDict_SetItem(__pyx_d, __pyx_n_s_K_KP_MEMCLEAR, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 194; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "include/keycode_list.pxi":195 * K_KP_MEMRECALL = SDLK_KP_MEMRECALL * K_KP_MEMCLEAR = SDLK_KP_MEMCLEAR * K_KP_MEMADD = SDLK_KP_MEMADD # <<<<<<<<<<<<<< * K_KP_MEMSUBTRACT = SDLK_KP_MEMSUBTRACT * K_KP_MEMMULTIPLY = SDLK_KP_MEMMULTIPLY */ __pyx_t_1 = __Pyx_PyInt_From_int(SDLK_KP_MEMADD); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 195; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); if (PyDict_SetItem(__pyx_d, __pyx_n_s_K_KP_MEMADD, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 195; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "include/keycode_list.pxi":196 * K_KP_MEMCLEAR = SDLK_KP_MEMCLEAR * K_KP_MEMADD = SDLK_KP_MEMADD * K_KP_MEMSUBTRACT = SDLK_KP_MEMSUBTRACT # <<<<<<<<<<<<<< * K_KP_MEMMULTIPLY = SDLK_KP_MEMMULTIPLY * K_KP_MEMDIVIDE = SDLK_KP_MEMDIVIDE */ __pyx_t_1 = __Pyx_PyInt_From_int(SDLK_KP_MEMSUBTRACT); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 196; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); if (PyDict_SetItem(__pyx_d, __pyx_n_s_K_KP_MEMSUBTRACT, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 196; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "include/keycode_list.pxi":197 * K_KP_MEMADD = SDLK_KP_MEMADD * K_KP_MEMSUBTRACT = SDLK_KP_MEMSUBTRACT * K_KP_MEMMULTIPLY = SDLK_KP_MEMMULTIPLY # <<<<<<<<<<<<<< * K_KP_MEMDIVIDE = SDLK_KP_MEMDIVIDE * K_KP_PLUSMINUS = SDLK_KP_PLUSMINUS */ __pyx_t_1 = __Pyx_PyInt_From_int(SDLK_KP_MEMMULTIPLY); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 197; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); if (PyDict_SetItem(__pyx_d, __pyx_n_s_K_KP_MEMMULTIPLY, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 197; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "include/keycode_list.pxi":198 * K_KP_MEMSUBTRACT = SDLK_KP_MEMSUBTRACT * K_KP_MEMMULTIPLY = SDLK_KP_MEMMULTIPLY * K_KP_MEMDIVIDE = SDLK_KP_MEMDIVIDE # <<<<<<<<<<<<<< * K_KP_PLUSMINUS = SDLK_KP_PLUSMINUS * K_KP_CLEAR = SDLK_KP_CLEAR */ __pyx_t_1 = __Pyx_PyInt_From_int(SDLK_KP_MEMDIVIDE); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 198; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); if (PyDict_SetItem(__pyx_d, __pyx_n_s_K_KP_MEMDIVIDE, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 198; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "include/keycode_list.pxi":199 * K_KP_MEMMULTIPLY = SDLK_KP_MEMMULTIPLY * K_KP_MEMDIVIDE = SDLK_KP_MEMDIVIDE * K_KP_PLUSMINUS = SDLK_KP_PLUSMINUS # <<<<<<<<<<<<<< * K_KP_CLEAR = SDLK_KP_CLEAR * K_KP_CLEARENTRY = SDLK_KP_CLEARENTRY */ __pyx_t_1 = __Pyx_PyInt_From_int(SDLK_KP_PLUSMINUS); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 199; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); if (PyDict_SetItem(__pyx_d, __pyx_n_s_K_KP_PLUSMINUS, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 199; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "include/keycode_list.pxi":200 * K_KP_MEMDIVIDE = SDLK_KP_MEMDIVIDE * K_KP_PLUSMINUS = SDLK_KP_PLUSMINUS * K_KP_CLEAR = SDLK_KP_CLEAR # <<<<<<<<<<<<<< * K_KP_CLEARENTRY = SDLK_KP_CLEARENTRY * K_KP_BINARY = SDLK_KP_BINARY */ __pyx_t_1 = __Pyx_PyInt_From_int(SDLK_KP_CLEAR); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 200; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); if (PyDict_SetItem(__pyx_d, __pyx_n_s_K_KP_CLEAR, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 200; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "include/keycode_list.pxi":201 * K_KP_PLUSMINUS = SDLK_KP_PLUSMINUS * K_KP_CLEAR = SDLK_KP_CLEAR * K_KP_CLEARENTRY = SDLK_KP_CLEARENTRY # <<<<<<<<<<<<<< * K_KP_BINARY = SDLK_KP_BINARY * K_KP_OCTAL = SDLK_KP_OCTAL */ __pyx_t_1 = __Pyx_PyInt_From_int(SDLK_KP_CLEARENTRY); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 201; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); if (PyDict_SetItem(__pyx_d, __pyx_n_s_K_KP_CLEARENTRY, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 201; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "include/keycode_list.pxi":202 * K_KP_CLEAR = SDLK_KP_CLEAR * K_KP_CLEARENTRY = SDLK_KP_CLEARENTRY * K_KP_BINARY = SDLK_KP_BINARY # <<<<<<<<<<<<<< * K_KP_OCTAL = SDLK_KP_OCTAL * K_KP_DECIMAL = SDLK_KP_DECIMAL */ __pyx_t_1 = __Pyx_PyInt_From_int(SDLK_KP_BINARY); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 202; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); if (PyDict_SetItem(__pyx_d, __pyx_n_s_K_KP_BINARY, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 202; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "include/keycode_list.pxi":203 * K_KP_CLEARENTRY = SDLK_KP_CLEARENTRY * K_KP_BINARY = SDLK_KP_BINARY * K_KP_OCTAL = SDLK_KP_OCTAL # <<<<<<<<<<<<<< * K_KP_DECIMAL = SDLK_KP_DECIMAL * K_KP_HEXADECIMAL = SDLK_KP_HEXADECIMAL */ __pyx_t_1 = __Pyx_PyInt_From_int(SDLK_KP_OCTAL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 203; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); if (PyDict_SetItem(__pyx_d, __pyx_n_s_K_KP_OCTAL, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 203; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "include/keycode_list.pxi":204 * K_KP_BINARY = SDLK_KP_BINARY * K_KP_OCTAL = SDLK_KP_OCTAL * K_KP_DECIMAL = SDLK_KP_DECIMAL # <<<<<<<<<<<<<< * K_KP_HEXADECIMAL = SDLK_KP_HEXADECIMAL * K_LCTRL = SDLK_LCTRL */ __pyx_t_1 = __Pyx_PyInt_From_int(SDLK_KP_DECIMAL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 204; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); if (PyDict_SetItem(__pyx_d, __pyx_n_s_K_KP_DECIMAL, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 204; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "include/keycode_list.pxi":205 * K_KP_OCTAL = SDLK_KP_OCTAL * K_KP_DECIMAL = SDLK_KP_DECIMAL * K_KP_HEXADECIMAL = SDLK_KP_HEXADECIMAL # <<<<<<<<<<<<<< * K_LCTRL = SDLK_LCTRL * K_LSHIFT = SDLK_LSHIFT */ __pyx_t_1 = __Pyx_PyInt_From_int(SDLK_KP_HEXADECIMAL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 205; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); if (PyDict_SetItem(__pyx_d, __pyx_n_s_K_KP_HEXADECIMAL, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 205; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "include/keycode_list.pxi":206 * K_KP_DECIMAL = SDLK_KP_DECIMAL * K_KP_HEXADECIMAL = SDLK_KP_HEXADECIMAL * K_LCTRL = SDLK_LCTRL # <<<<<<<<<<<<<< * K_LSHIFT = SDLK_LSHIFT * K_LALT = SDLK_LALT */ __pyx_t_1 = __Pyx_PyInt_From_int(SDLK_LCTRL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 206; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); if (PyDict_SetItem(__pyx_d, __pyx_n_s_K_LCTRL, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 206; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "include/keycode_list.pxi":207 * K_KP_HEXADECIMAL = SDLK_KP_HEXADECIMAL * K_LCTRL = SDLK_LCTRL * K_LSHIFT = SDLK_LSHIFT # <<<<<<<<<<<<<< * K_LALT = SDLK_LALT * K_LGUI = SDLK_LGUI */ __pyx_t_1 = __Pyx_PyInt_From_int(SDLK_LSHIFT); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 207; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); if (PyDict_SetItem(__pyx_d, __pyx_n_s_K_LSHIFT, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 207; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "include/keycode_list.pxi":208 * K_LCTRL = SDLK_LCTRL * K_LSHIFT = SDLK_LSHIFT * K_LALT = SDLK_LALT # <<<<<<<<<<<<<< * K_LGUI = SDLK_LGUI * K_RCTRL = SDLK_RCTRL */ __pyx_t_1 = __Pyx_PyInt_From_int(SDLK_LALT); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 208; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); if (PyDict_SetItem(__pyx_d, __pyx_n_s_K_LALT, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 208; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "include/keycode_list.pxi":209 * K_LSHIFT = SDLK_LSHIFT * K_LALT = SDLK_LALT * K_LGUI = SDLK_LGUI # <<<<<<<<<<<<<< * K_RCTRL = SDLK_RCTRL * K_RSHIFT = SDLK_RSHIFT */ __pyx_t_1 = __Pyx_PyInt_From_int(SDLK_LGUI); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 209; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); if (PyDict_SetItem(__pyx_d, __pyx_n_s_K_LGUI, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 209; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "include/keycode_list.pxi":210 * K_LALT = SDLK_LALT * K_LGUI = SDLK_LGUI * K_RCTRL = SDLK_RCTRL # <<<<<<<<<<<<<< * K_RSHIFT = SDLK_RSHIFT * K_RALT = SDLK_RALT */ __pyx_t_1 = __Pyx_PyInt_From_int(SDLK_RCTRL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 210; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); if (PyDict_SetItem(__pyx_d, __pyx_n_s_K_RCTRL, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 210; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "include/keycode_list.pxi":211 * K_LGUI = SDLK_LGUI * K_RCTRL = SDLK_RCTRL * K_RSHIFT = SDLK_RSHIFT # <<<<<<<<<<<<<< * K_RALT = SDLK_RALT * K_RGUI = SDLK_RGUI */ __pyx_t_1 = __Pyx_PyInt_From_int(SDLK_RSHIFT); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 211; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); if (PyDict_SetItem(__pyx_d, __pyx_n_s_K_RSHIFT, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 211; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "include/keycode_list.pxi":212 * K_RCTRL = SDLK_RCTRL * K_RSHIFT = SDLK_RSHIFT * K_RALT = SDLK_RALT # <<<<<<<<<<<<<< * K_RGUI = SDLK_RGUI * K_MODE = SDLK_MODE */ __pyx_t_1 = __Pyx_PyInt_From_int(SDLK_RALT); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 212; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); if (PyDict_SetItem(__pyx_d, __pyx_n_s_K_RALT, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 212; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "include/keycode_list.pxi":213 * K_RSHIFT = SDLK_RSHIFT * K_RALT = SDLK_RALT * K_RGUI = SDLK_RGUI # <<<<<<<<<<<<<< * K_MODE = SDLK_MODE * K_AUDIONEXT = SDLK_AUDIONEXT */ __pyx_t_1 = __Pyx_PyInt_From_int(SDLK_RGUI); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 213; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); if (PyDict_SetItem(__pyx_d, __pyx_n_s_K_RGUI, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 213; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "include/keycode_list.pxi":214 * K_RALT = SDLK_RALT * K_RGUI = SDLK_RGUI * K_MODE = SDLK_MODE # <<<<<<<<<<<<<< * K_AUDIONEXT = SDLK_AUDIONEXT * K_AUDIOPREV = SDLK_AUDIOPREV */ __pyx_t_1 = __Pyx_PyInt_From_int(SDLK_MODE); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 214; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); if (PyDict_SetItem(__pyx_d, __pyx_n_s_K_MODE, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 214; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "include/keycode_list.pxi":215 * K_RGUI = SDLK_RGUI * K_MODE = SDLK_MODE * K_AUDIONEXT = SDLK_AUDIONEXT # <<<<<<<<<<<<<< * K_AUDIOPREV = SDLK_AUDIOPREV * K_AUDIOSTOP = SDLK_AUDIOSTOP */ __pyx_t_1 = __Pyx_PyInt_From_int(SDLK_AUDIONEXT); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 215; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); if (PyDict_SetItem(__pyx_d, __pyx_n_s_K_AUDIONEXT, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 215; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "include/keycode_list.pxi":216 * K_MODE = SDLK_MODE * K_AUDIONEXT = SDLK_AUDIONEXT * K_AUDIOPREV = SDLK_AUDIOPREV # <<<<<<<<<<<<<< * K_AUDIOSTOP = SDLK_AUDIOSTOP * K_AUDIOPLAY = SDLK_AUDIOPLAY */ __pyx_t_1 = __Pyx_PyInt_From_int(SDLK_AUDIOPREV); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 216; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); if (PyDict_SetItem(__pyx_d, __pyx_n_s_K_AUDIOPREV, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 216; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "include/keycode_list.pxi":217 * K_AUDIONEXT = SDLK_AUDIONEXT * K_AUDIOPREV = SDLK_AUDIOPREV * K_AUDIOSTOP = SDLK_AUDIOSTOP # <<<<<<<<<<<<<< * K_AUDIOPLAY = SDLK_AUDIOPLAY * K_AUDIOMUTE = SDLK_AUDIOMUTE */ __pyx_t_1 = __Pyx_PyInt_From_int(SDLK_AUDIOSTOP); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 217; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); if (PyDict_SetItem(__pyx_d, __pyx_n_s_K_AUDIOSTOP, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 217; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "include/keycode_list.pxi":218 * K_AUDIOPREV = SDLK_AUDIOPREV * K_AUDIOSTOP = SDLK_AUDIOSTOP * K_AUDIOPLAY = SDLK_AUDIOPLAY # <<<<<<<<<<<<<< * K_AUDIOMUTE = SDLK_AUDIOMUTE * K_MEDIASELECT = SDLK_MEDIASELECT */ __pyx_t_1 = __Pyx_PyInt_From_int(SDLK_AUDIOPLAY); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 218; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); if (PyDict_SetItem(__pyx_d, __pyx_n_s_K_AUDIOPLAY, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 218; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "include/keycode_list.pxi":219 * K_AUDIOSTOP = SDLK_AUDIOSTOP * K_AUDIOPLAY = SDLK_AUDIOPLAY * K_AUDIOMUTE = SDLK_AUDIOMUTE # <<<<<<<<<<<<<< * K_MEDIASELECT = SDLK_MEDIASELECT * K_WWW = SDLK_WWW */ __pyx_t_1 = __Pyx_PyInt_From_int(SDLK_AUDIOMUTE); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 219; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); if (PyDict_SetItem(__pyx_d, __pyx_n_s_K_AUDIOMUTE, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 219; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "include/keycode_list.pxi":220 * K_AUDIOPLAY = SDLK_AUDIOPLAY * K_AUDIOMUTE = SDLK_AUDIOMUTE * K_MEDIASELECT = SDLK_MEDIASELECT # <<<<<<<<<<<<<< * K_WWW = SDLK_WWW * K_MAIL = SDLK_MAIL */ __pyx_t_1 = __Pyx_PyInt_From_int(SDLK_MEDIASELECT); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 220; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); if (PyDict_SetItem(__pyx_d, __pyx_n_s_K_MEDIASELECT, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 220; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "include/keycode_list.pxi":221 * K_AUDIOMUTE = SDLK_AUDIOMUTE * K_MEDIASELECT = SDLK_MEDIASELECT * K_WWW = SDLK_WWW # <<<<<<<<<<<<<< * K_MAIL = SDLK_MAIL * K_CALCULATOR = SDLK_CALCULATOR */ __pyx_t_1 = __Pyx_PyInt_From_int(SDLK_WWW); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 221; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); if (PyDict_SetItem(__pyx_d, __pyx_n_s_K_WWW, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 221; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "include/keycode_list.pxi":222 * K_MEDIASELECT = SDLK_MEDIASELECT * K_WWW = SDLK_WWW * K_MAIL = SDLK_MAIL # <<<<<<<<<<<<<< * K_CALCULATOR = SDLK_CALCULATOR * K_COMPUTER = SDLK_COMPUTER */ __pyx_t_1 = __Pyx_PyInt_From_int(SDLK_MAIL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 222; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); if (PyDict_SetItem(__pyx_d, __pyx_n_s_K_MAIL, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 222; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "include/keycode_list.pxi":223 * K_WWW = SDLK_WWW * K_MAIL = SDLK_MAIL * K_CALCULATOR = SDLK_CALCULATOR # <<<<<<<<<<<<<< * K_COMPUTER = SDLK_COMPUTER * K_AC_SEARCH = SDLK_AC_SEARCH */ __pyx_t_1 = __Pyx_PyInt_From_int(SDLK_CALCULATOR); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 223; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); if (PyDict_SetItem(__pyx_d, __pyx_n_s_K_CALCULATOR, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 223; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "include/keycode_list.pxi":224 * K_MAIL = SDLK_MAIL * K_CALCULATOR = SDLK_CALCULATOR * K_COMPUTER = SDLK_COMPUTER # <<<<<<<<<<<<<< * K_AC_SEARCH = SDLK_AC_SEARCH * K_AC_HOME = SDLK_AC_HOME */ __pyx_t_1 = __Pyx_PyInt_From_int(SDLK_COMPUTER); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 224; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); if (PyDict_SetItem(__pyx_d, __pyx_n_s_K_COMPUTER, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 224; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "include/keycode_list.pxi":225 * K_CALCULATOR = SDLK_CALCULATOR * K_COMPUTER = SDLK_COMPUTER * K_AC_SEARCH = SDLK_AC_SEARCH # <<<<<<<<<<<<<< * K_AC_HOME = SDLK_AC_HOME * K_AC_BACK = SDLK_AC_BACK */ __pyx_t_1 = __Pyx_PyInt_From_int(SDLK_AC_SEARCH); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 225; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); if (PyDict_SetItem(__pyx_d, __pyx_n_s_K_AC_SEARCH, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 225; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "include/keycode_list.pxi":226 * K_COMPUTER = SDLK_COMPUTER * K_AC_SEARCH = SDLK_AC_SEARCH * K_AC_HOME = SDLK_AC_HOME # <<<<<<<<<<<<<< * K_AC_BACK = SDLK_AC_BACK * K_AC_FORWARD = SDLK_AC_FORWARD */ __pyx_t_1 = __Pyx_PyInt_From_int(SDLK_AC_HOME); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 226; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); if (PyDict_SetItem(__pyx_d, __pyx_n_s_K_AC_HOME, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 226; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "include/keycode_list.pxi":227 * K_AC_SEARCH = SDLK_AC_SEARCH * K_AC_HOME = SDLK_AC_HOME * K_AC_BACK = SDLK_AC_BACK # <<<<<<<<<<<<<< * K_AC_FORWARD = SDLK_AC_FORWARD * K_AC_STOP = SDLK_AC_STOP */ __pyx_t_1 = __Pyx_PyInt_From_int(SDLK_AC_BACK); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 227; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); if (PyDict_SetItem(__pyx_d, __pyx_n_s_K_AC_BACK, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 227; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "include/keycode_list.pxi":228 * K_AC_HOME = SDLK_AC_HOME * K_AC_BACK = SDLK_AC_BACK * K_AC_FORWARD = SDLK_AC_FORWARD # <<<<<<<<<<<<<< * K_AC_STOP = SDLK_AC_STOP * K_AC_REFRESH = SDLK_AC_REFRESH */ __pyx_t_1 = __Pyx_PyInt_From_int(SDLK_AC_FORWARD); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 228; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); if (PyDict_SetItem(__pyx_d, __pyx_n_s_K_AC_FORWARD, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 228; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "include/keycode_list.pxi":229 * K_AC_BACK = SDLK_AC_BACK * K_AC_FORWARD = SDLK_AC_FORWARD * K_AC_STOP = SDLK_AC_STOP # <<<<<<<<<<<<<< * K_AC_REFRESH = SDLK_AC_REFRESH * K_AC_BOOKMARKS = SDLK_AC_BOOKMARKS */ __pyx_t_1 = __Pyx_PyInt_From_int(SDLK_AC_STOP); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 229; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); if (PyDict_SetItem(__pyx_d, __pyx_n_s_K_AC_STOP, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 229; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "include/keycode_list.pxi":230 * K_AC_FORWARD = SDLK_AC_FORWARD * K_AC_STOP = SDLK_AC_STOP * K_AC_REFRESH = SDLK_AC_REFRESH # <<<<<<<<<<<<<< * K_AC_BOOKMARKS = SDLK_AC_BOOKMARKS * K_BRIGHTNESSDOWN = SDLK_BRIGHTNESSDOWN */ __pyx_t_1 = __Pyx_PyInt_From_int(SDLK_AC_REFRESH); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 230; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); if (PyDict_SetItem(__pyx_d, __pyx_n_s_K_AC_REFRESH, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 230; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "include/keycode_list.pxi":231 * K_AC_STOP = SDLK_AC_STOP * K_AC_REFRESH = SDLK_AC_REFRESH * K_AC_BOOKMARKS = SDLK_AC_BOOKMARKS # <<<<<<<<<<<<<< * K_BRIGHTNESSDOWN = SDLK_BRIGHTNESSDOWN * K_BRIGHTNESSUP = SDLK_BRIGHTNESSUP */ __pyx_t_1 = __Pyx_PyInt_From_int(SDLK_AC_BOOKMARKS); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 231; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); if (PyDict_SetItem(__pyx_d, __pyx_n_s_K_AC_BOOKMARKS, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 231; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "include/keycode_list.pxi":232 * K_AC_REFRESH = SDLK_AC_REFRESH * K_AC_BOOKMARKS = SDLK_AC_BOOKMARKS * K_BRIGHTNESSDOWN = SDLK_BRIGHTNESSDOWN # <<<<<<<<<<<<<< * K_BRIGHTNESSUP = SDLK_BRIGHTNESSUP * K_DISPLAYSWITCH = SDLK_DISPLAYSWITCH */ __pyx_t_1 = __Pyx_PyInt_From_int(SDLK_BRIGHTNESSDOWN); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 232; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); if (PyDict_SetItem(__pyx_d, __pyx_n_s_K_BRIGHTNESSDOWN, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 232; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "include/keycode_list.pxi":233 * K_AC_BOOKMARKS = SDLK_AC_BOOKMARKS * K_BRIGHTNESSDOWN = SDLK_BRIGHTNESSDOWN * K_BRIGHTNESSUP = SDLK_BRIGHTNESSUP # <<<<<<<<<<<<<< * K_DISPLAYSWITCH = SDLK_DISPLAYSWITCH * K_KBDILLUMTOGGLE = SDLK_KBDILLUMTOGGLE */ __pyx_t_1 = __Pyx_PyInt_From_int(SDLK_BRIGHTNESSUP); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 233; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); if (PyDict_SetItem(__pyx_d, __pyx_n_s_K_BRIGHTNESSUP, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 233; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "include/keycode_list.pxi":234 * K_BRIGHTNESSDOWN = SDLK_BRIGHTNESSDOWN * K_BRIGHTNESSUP = SDLK_BRIGHTNESSUP * K_DISPLAYSWITCH = SDLK_DISPLAYSWITCH # <<<<<<<<<<<<<< * K_KBDILLUMTOGGLE = SDLK_KBDILLUMTOGGLE * K_KBDILLUMDOWN = SDLK_KBDILLUMDOWN */ __pyx_t_1 = __Pyx_PyInt_From_int(SDLK_DISPLAYSWITCH); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 234; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); if (PyDict_SetItem(__pyx_d, __pyx_n_s_K_DISPLAYSWITCH, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 234; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "include/keycode_list.pxi":235 * K_BRIGHTNESSUP = SDLK_BRIGHTNESSUP * K_DISPLAYSWITCH = SDLK_DISPLAYSWITCH * K_KBDILLUMTOGGLE = SDLK_KBDILLUMTOGGLE # <<<<<<<<<<<<<< * K_KBDILLUMDOWN = SDLK_KBDILLUMDOWN * K_KBDILLUMUP = SDLK_KBDILLUMUP */ __pyx_t_1 = __Pyx_PyInt_From_int(SDLK_KBDILLUMTOGGLE); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 235; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); if (PyDict_SetItem(__pyx_d, __pyx_n_s_K_KBDILLUMTOGGLE, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 235; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "include/keycode_list.pxi":236 * K_DISPLAYSWITCH = SDLK_DISPLAYSWITCH * K_KBDILLUMTOGGLE = SDLK_KBDILLUMTOGGLE * K_KBDILLUMDOWN = SDLK_KBDILLUMDOWN # <<<<<<<<<<<<<< * K_KBDILLUMUP = SDLK_KBDILLUMUP * K_EJECT = SDLK_EJECT */ __pyx_t_1 = __Pyx_PyInt_From_int(SDLK_KBDILLUMDOWN); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 236; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); if (PyDict_SetItem(__pyx_d, __pyx_n_s_K_KBDILLUMDOWN, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 236; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "include/keycode_list.pxi":237 * K_KBDILLUMTOGGLE = SDLK_KBDILLUMTOGGLE * K_KBDILLUMDOWN = SDLK_KBDILLUMDOWN * K_KBDILLUMUP = SDLK_KBDILLUMUP # <<<<<<<<<<<<<< * K_EJECT = SDLK_EJECT * K_SLEEP = SDLK_SLEEP */ __pyx_t_1 = __Pyx_PyInt_From_int(SDLK_KBDILLUMUP); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 237; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); if (PyDict_SetItem(__pyx_d, __pyx_n_s_K_KBDILLUMUP, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 237; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "include/keycode_list.pxi":238 * K_KBDILLUMDOWN = SDLK_KBDILLUMDOWN * K_KBDILLUMUP = SDLK_KBDILLUMUP * K_EJECT = SDLK_EJECT # <<<<<<<<<<<<<< * K_SLEEP = SDLK_SLEEP */ __pyx_t_1 = __Pyx_PyInt_From_int(SDLK_EJECT); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 238; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); if (PyDict_SetItem(__pyx_d, __pyx_n_s_K_EJECT, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 238; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "include/keycode_list.pxi":239 * K_KBDILLUMUP = SDLK_KBDILLUMUP * K_EJECT = SDLK_EJECT * K_SLEEP = SDLK_SLEEP # <<<<<<<<<<<<<< */ __pyx_t_1 = __Pyx_PyInt_From_int(SDLK_SLEEP); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 239; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); if (PyDict_SetItem(__pyx_d, __pyx_n_s_K_SLEEP, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 239; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "include/glattr.pxi":1 * GL_RED_SIZE = SDL_GL_RED_SIZE # <<<<<<<<<<<<<< * GL_GREEN_SIZE = SDL_GL_GREEN_SIZE * GL_BLUE_SIZE = SDL_GL_BLUE_SIZE */ __pyx_t_1 = __Pyx_PyInt_From_SDL_GLattr(SDL_GL_RED_SIZE); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); if (PyDict_SetItem(__pyx_d, __pyx_n_s_GL_RED_SIZE, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "include/glattr.pxi":2 * GL_RED_SIZE = SDL_GL_RED_SIZE * GL_GREEN_SIZE = SDL_GL_GREEN_SIZE # <<<<<<<<<<<<<< * GL_BLUE_SIZE = SDL_GL_BLUE_SIZE * GL_ALPHA_SIZE = SDL_GL_ALPHA_SIZE */ __pyx_t_1 = __Pyx_PyInt_From_SDL_GLattr(SDL_GL_GREEN_SIZE); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 2; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); if (PyDict_SetItem(__pyx_d, __pyx_n_s_GL_GREEN_SIZE, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 2; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "include/glattr.pxi":3 * GL_RED_SIZE = SDL_GL_RED_SIZE * GL_GREEN_SIZE = SDL_GL_GREEN_SIZE * GL_BLUE_SIZE = SDL_GL_BLUE_SIZE # <<<<<<<<<<<<<< * GL_ALPHA_SIZE = SDL_GL_ALPHA_SIZE * GL_BUFFER_SIZE = SDL_GL_BUFFER_SIZE */ __pyx_t_1 = __Pyx_PyInt_From_SDL_GLattr(SDL_GL_BLUE_SIZE); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 3; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); if (PyDict_SetItem(__pyx_d, __pyx_n_s_GL_BLUE_SIZE, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 3; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "include/glattr.pxi":4 * GL_GREEN_SIZE = SDL_GL_GREEN_SIZE * GL_BLUE_SIZE = SDL_GL_BLUE_SIZE * GL_ALPHA_SIZE = SDL_GL_ALPHA_SIZE # <<<<<<<<<<<<<< * GL_BUFFER_SIZE = SDL_GL_BUFFER_SIZE * GL_DOUBLEBUFFER = SDL_GL_DOUBLEBUFFER */ __pyx_t_1 = __Pyx_PyInt_From_SDL_GLattr(SDL_GL_ALPHA_SIZE); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 4; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); if (PyDict_SetItem(__pyx_d, __pyx_n_s_GL_ALPHA_SIZE, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 4; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "include/glattr.pxi":5 * GL_BLUE_SIZE = SDL_GL_BLUE_SIZE * GL_ALPHA_SIZE = SDL_GL_ALPHA_SIZE * GL_BUFFER_SIZE = SDL_GL_BUFFER_SIZE # <<<<<<<<<<<<<< * GL_DOUBLEBUFFER = SDL_GL_DOUBLEBUFFER * GL_DEPTH_SIZE = SDL_GL_DEPTH_SIZE */ __pyx_t_1 = __Pyx_PyInt_From_SDL_GLattr(SDL_GL_BUFFER_SIZE); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 5; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); if (PyDict_SetItem(__pyx_d, __pyx_n_s_GL_BUFFER_SIZE, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 5; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "include/glattr.pxi":6 * GL_ALPHA_SIZE = SDL_GL_ALPHA_SIZE * GL_BUFFER_SIZE = SDL_GL_BUFFER_SIZE * GL_DOUBLEBUFFER = SDL_GL_DOUBLEBUFFER # <<<<<<<<<<<<<< * GL_DEPTH_SIZE = SDL_GL_DEPTH_SIZE * GL_STENCIL_SIZE = SDL_GL_STENCIL_SIZE */ __pyx_t_1 = __Pyx_PyInt_From_SDL_GLattr(SDL_GL_DOUBLEBUFFER); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 6; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); if (PyDict_SetItem(__pyx_d, __pyx_n_s_GL_DOUBLEBUFFER, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 6; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "include/glattr.pxi":7 * GL_BUFFER_SIZE = SDL_GL_BUFFER_SIZE * GL_DOUBLEBUFFER = SDL_GL_DOUBLEBUFFER * GL_DEPTH_SIZE = SDL_GL_DEPTH_SIZE # <<<<<<<<<<<<<< * GL_STENCIL_SIZE = SDL_GL_STENCIL_SIZE * GL_ACCUM_RED_SIZE = SDL_GL_ACCUM_RED_SIZE */ __pyx_t_1 = __Pyx_PyInt_From_SDL_GLattr(SDL_GL_DEPTH_SIZE); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 7; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); if (PyDict_SetItem(__pyx_d, __pyx_n_s_GL_DEPTH_SIZE, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 7; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "include/glattr.pxi":8 * GL_DOUBLEBUFFER = SDL_GL_DOUBLEBUFFER * GL_DEPTH_SIZE = SDL_GL_DEPTH_SIZE * GL_STENCIL_SIZE = SDL_GL_STENCIL_SIZE # <<<<<<<<<<<<<< * GL_ACCUM_RED_SIZE = SDL_GL_ACCUM_RED_SIZE * GL_ACCUM_GREEN_SIZE = SDL_GL_ACCUM_GREEN_SIZE */ __pyx_t_1 = __Pyx_PyInt_From_SDL_GLattr(SDL_GL_STENCIL_SIZE); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 8; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); if (PyDict_SetItem(__pyx_d, __pyx_n_s_GL_STENCIL_SIZE, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 8; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "include/glattr.pxi":9 * GL_DEPTH_SIZE = SDL_GL_DEPTH_SIZE * GL_STENCIL_SIZE = SDL_GL_STENCIL_SIZE * GL_ACCUM_RED_SIZE = SDL_GL_ACCUM_RED_SIZE # <<<<<<<<<<<<<< * GL_ACCUM_GREEN_SIZE = SDL_GL_ACCUM_GREEN_SIZE * GL_ACCUM_BLUE_SIZE = SDL_GL_ACCUM_BLUE_SIZE */ __pyx_t_1 = __Pyx_PyInt_From_SDL_GLattr(SDL_GL_ACCUM_RED_SIZE); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 9; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); if (PyDict_SetItem(__pyx_d, __pyx_n_s_GL_ACCUM_RED_SIZE, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 9; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "include/glattr.pxi":10 * GL_STENCIL_SIZE = SDL_GL_STENCIL_SIZE * GL_ACCUM_RED_SIZE = SDL_GL_ACCUM_RED_SIZE * GL_ACCUM_GREEN_SIZE = SDL_GL_ACCUM_GREEN_SIZE # <<<<<<<<<<<<<< * GL_ACCUM_BLUE_SIZE = SDL_GL_ACCUM_BLUE_SIZE * GL_ACCUM_ALPHA_SIZE = SDL_GL_ACCUM_ALPHA_SIZE */ __pyx_t_1 = __Pyx_PyInt_From_SDL_GLattr(SDL_GL_ACCUM_GREEN_SIZE); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 10; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); if (PyDict_SetItem(__pyx_d, __pyx_n_s_GL_ACCUM_GREEN_SIZE, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 10; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "include/glattr.pxi":11 * GL_ACCUM_RED_SIZE = SDL_GL_ACCUM_RED_SIZE * GL_ACCUM_GREEN_SIZE = SDL_GL_ACCUM_GREEN_SIZE * GL_ACCUM_BLUE_SIZE = SDL_GL_ACCUM_BLUE_SIZE # <<<<<<<<<<<<<< * GL_ACCUM_ALPHA_SIZE = SDL_GL_ACCUM_ALPHA_SIZE * GL_STEREO = SDL_GL_STEREO */ __pyx_t_1 = __Pyx_PyInt_From_SDL_GLattr(SDL_GL_ACCUM_BLUE_SIZE); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 11; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); if (PyDict_SetItem(__pyx_d, __pyx_n_s_GL_ACCUM_BLUE_SIZE, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 11; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "include/glattr.pxi":12 * GL_ACCUM_GREEN_SIZE = SDL_GL_ACCUM_GREEN_SIZE * GL_ACCUM_BLUE_SIZE = SDL_GL_ACCUM_BLUE_SIZE * GL_ACCUM_ALPHA_SIZE = SDL_GL_ACCUM_ALPHA_SIZE # <<<<<<<<<<<<<< * GL_STEREO = SDL_GL_STEREO * GL_MULTISAMPLEBUFFERS = SDL_GL_MULTISAMPLEBUFFERS */ __pyx_t_1 = __Pyx_PyInt_From_SDL_GLattr(SDL_GL_ACCUM_ALPHA_SIZE); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 12; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); if (PyDict_SetItem(__pyx_d, __pyx_n_s_GL_ACCUM_ALPHA_SIZE, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 12; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "include/glattr.pxi":13 * GL_ACCUM_BLUE_SIZE = SDL_GL_ACCUM_BLUE_SIZE * GL_ACCUM_ALPHA_SIZE = SDL_GL_ACCUM_ALPHA_SIZE * GL_STEREO = SDL_GL_STEREO # <<<<<<<<<<<<<< * GL_MULTISAMPLEBUFFERS = SDL_GL_MULTISAMPLEBUFFERS * GL_MULTISAMPLESAMPLES = SDL_GL_MULTISAMPLESAMPLES */ __pyx_t_1 = __Pyx_PyInt_From_SDL_GLattr(SDL_GL_STEREO); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 13; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); if (PyDict_SetItem(__pyx_d, __pyx_n_s_GL_STEREO, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 13; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "include/glattr.pxi":14 * GL_ACCUM_ALPHA_SIZE = SDL_GL_ACCUM_ALPHA_SIZE * GL_STEREO = SDL_GL_STEREO * GL_MULTISAMPLEBUFFERS = SDL_GL_MULTISAMPLEBUFFERS # <<<<<<<<<<<<<< * GL_MULTISAMPLESAMPLES = SDL_GL_MULTISAMPLESAMPLES * GL_ACCELERATED_VISUAL = SDL_GL_ACCELERATED_VISUAL */ __pyx_t_1 = __Pyx_PyInt_From_SDL_GLattr(SDL_GL_MULTISAMPLEBUFFERS); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 14; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); if (PyDict_SetItem(__pyx_d, __pyx_n_s_GL_MULTISAMPLEBUFFERS, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 14; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "include/glattr.pxi":15 * GL_STEREO = SDL_GL_STEREO * GL_MULTISAMPLEBUFFERS = SDL_GL_MULTISAMPLEBUFFERS * GL_MULTISAMPLESAMPLES = SDL_GL_MULTISAMPLESAMPLES # <<<<<<<<<<<<<< * GL_ACCELERATED_VISUAL = SDL_GL_ACCELERATED_VISUAL * GL_RETAINED_BACKING = SDL_GL_RETAINED_BACKING */ __pyx_t_1 = __Pyx_PyInt_From_SDL_GLattr(SDL_GL_MULTISAMPLESAMPLES); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 15; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); if (PyDict_SetItem(__pyx_d, __pyx_n_s_GL_MULTISAMPLESAMPLES, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 15; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "include/glattr.pxi":16 * GL_MULTISAMPLEBUFFERS = SDL_GL_MULTISAMPLEBUFFERS * GL_MULTISAMPLESAMPLES = SDL_GL_MULTISAMPLESAMPLES * GL_ACCELERATED_VISUAL = SDL_GL_ACCELERATED_VISUAL # <<<<<<<<<<<<<< * GL_RETAINED_BACKING = SDL_GL_RETAINED_BACKING * GL_CONTEXT_MAJOR_VERSION = SDL_GL_CONTEXT_MAJOR_VERSION */ __pyx_t_1 = __Pyx_PyInt_From_SDL_GLattr(SDL_GL_ACCELERATED_VISUAL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 16; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); if (PyDict_SetItem(__pyx_d, __pyx_n_s_GL_ACCELERATED_VISUAL, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 16; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "include/glattr.pxi":17 * GL_MULTISAMPLESAMPLES = SDL_GL_MULTISAMPLESAMPLES * GL_ACCELERATED_VISUAL = SDL_GL_ACCELERATED_VISUAL * GL_RETAINED_BACKING = SDL_GL_RETAINED_BACKING # <<<<<<<<<<<<<< * GL_CONTEXT_MAJOR_VERSION = SDL_GL_CONTEXT_MAJOR_VERSION * GL_CONTEXT_MINOR_VERSION = SDL_GL_CONTEXT_MINOR_VERSION */ __pyx_t_1 = __Pyx_PyInt_From_SDL_GLattr(SDL_GL_RETAINED_BACKING); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 17; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); if (PyDict_SetItem(__pyx_d, __pyx_n_s_GL_RETAINED_BACKING, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 17; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "include/glattr.pxi":18 * GL_ACCELERATED_VISUAL = SDL_GL_ACCELERATED_VISUAL * GL_RETAINED_BACKING = SDL_GL_RETAINED_BACKING * GL_CONTEXT_MAJOR_VERSION = SDL_GL_CONTEXT_MAJOR_VERSION # <<<<<<<<<<<<<< * GL_CONTEXT_MINOR_VERSION = SDL_GL_CONTEXT_MINOR_VERSION * GL_CONTEXT_EGL = SDL_GL_CONTEXT_EGL */ __pyx_t_1 = __Pyx_PyInt_From_SDL_GLattr(SDL_GL_CONTEXT_MAJOR_VERSION); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 18; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); if (PyDict_SetItem(__pyx_d, __pyx_n_s_GL_CONTEXT_MAJOR_VERSION, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 18; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "include/glattr.pxi":19 * GL_RETAINED_BACKING = SDL_GL_RETAINED_BACKING * GL_CONTEXT_MAJOR_VERSION = SDL_GL_CONTEXT_MAJOR_VERSION * GL_CONTEXT_MINOR_VERSION = SDL_GL_CONTEXT_MINOR_VERSION # <<<<<<<<<<<<<< * GL_CONTEXT_EGL = SDL_GL_CONTEXT_EGL * GL_CONTEXT_FLAGS = SDL_GL_CONTEXT_FLAGS */ __pyx_t_1 = __Pyx_PyInt_From_SDL_GLattr(SDL_GL_CONTEXT_MINOR_VERSION); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 19; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); if (PyDict_SetItem(__pyx_d, __pyx_n_s_GL_CONTEXT_MINOR_VERSION, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 19; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "include/glattr.pxi":20 * GL_CONTEXT_MAJOR_VERSION = SDL_GL_CONTEXT_MAJOR_VERSION * GL_CONTEXT_MINOR_VERSION = SDL_GL_CONTEXT_MINOR_VERSION * GL_CONTEXT_EGL = SDL_GL_CONTEXT_EGL # <<<<<<<<<<<<<< * GL_CONTEXT_FLAGS = SDL_GL_CONTEXT_FLAGS * GL_CONTEXT_PROFILE_MASK = SDL_GL_CONTEXT_PROFILE_MASK */ __pyx_t_1 = __Pyx_PyInt_From_SDL_GLattr(SDL_GL_CONTEXT_EGL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 20; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); if (PyDict_SetItem(__pyx_d, __pyx_n_s_GL_CONTEXT_EGL, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 20; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "include/glattr.pxi":21 * GL_CONTEXT_MINOR_VERSION = SDL_GL_CONTEXT_MINOR_VERSION * GL_CONTEXT_EGL = SDL_GL_CONTEXT_EGL * GL_CONTEXT_FLAGS = SDL_GL_CONTEXT_FLAGS # <<<<<<<<<<<<<< * GL_CONTEXT_PROFILE_MASK = SDL_GL_CONTEXT_PROFILE_MASK * GL_SHARE_WITH_CURRENT_CONTEXT = SDL_GL_SHARE_WITH_CURRENT_CONTEXT */ __pyx_t_1 = __Pyx_PyInt_From_SDL_GLattr(SDL_GL_CONTEXT_FLAGS); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 21; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); if (PyDict_SetItem(__pyx_d, __pyx_n_s_GL_CONTEXT_FLAGS, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 21; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "include/glattr.pxi":22 * GL_CONTEXT_EGL = SDL_GL_CONTEXT_EGL * GL_CONTEXT_FLAGS = SDL_GL_CONTEXT_FLAGS * GL_CONTEXT_PROFILE_MASK = SDL_GL_CONTEXT_PROFILE_MASK # <<<<<<<<<<<<<< * GL_SHARE_WITH_CURRENT_CONTEXT = SDL_GL_SHARE_WITH_CURRENT_CONTEXT * GL_FRAMEBUFFER_SRGB_CAPABLE = SDL_GL_FRAMEBUFFER_SRGB_CAPABLE */ __pyx_t_1 = __Pyx_PyInt_From_SDL_GLattr(SDL_GL_CONTEXT_PROFILE_MASK); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 22; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); if (PyDict_SetItem(__pyx_d, __pyx_n_s_GL_CONTEXT_PROFILE_MASK, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 22; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "include/glattr.pxi":23 * GL_CONTEXT_FLAGS = SDL_GL_CONTEXT_FLAGS * GL_CONTEXT_PROFILE_MASK = SDL_GL_CONTEXT_PROFILE_MASK * GL_SHARE_WITH_CURRENT_CONTEXT = SDL_GL_SHARE_WITH_CURRENT_CONTEXT # <<<<<<<<<<<<<< * GL_FRAMEBUFFER_SRGB_CAPABLE = SDL_GL_FRAMEBUFFER_SRGB_CAPABLE */ __pyx_t_1 = __Pyx_PyInt_From_SDL_GLattr(SDL_GL_SHARE_WITH_CURRENT_CONTEXT); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 23; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); if (PyDict_SetItem(__pyx_d, __pyx_n_s_GL_SHARE_WITH_CURRENT_CONTEXT, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 23; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "include/glattr.pxi":24 * GL_CONTEXT_PROFILE_MASK = SDL_GL_CONTEXT_PROFILE_MASK * GL_SHARE_WITH_CURRENT_CONTEXT = SDL_GL_SHARE_WITH_CURRENT_CONTEXT * GL_FRAMEBUFFER_SRGB_CAPABLE = SDL_GL_FRAMEBUFFER_SRGB_CAPABLE # <<<<<<<<<<<<<< */ __pyx_t_1 = __Pyx_PyInt_From_SDL_GLattr(SDL_GL_FRAMEBUFFER_SRGB_CAPABLE); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 24; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); if (PyDict_SetItem(__pyx_d, __pyx_n_s_GL_FRAMEBUFFER_SRGB_CAPABLE, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 24; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "pygame_sdl2/locals.pyx":15 * * include "glattr.pxi" * GL_SWAP_CONTROL = -1 # <<<<<<<<<<<<<< * * RLEACCEL = SDL_RLEACCEL */ if (PyDict_SetItem(__pyx_d, __pyx_n_s_GL_SWAP_CONTROL, __pyx_int_neg_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 15; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "pygame_sdl2/locals.pyx":17 * GL_SWAP_CONTROL = -1 * * RLEACCEL = SDL_RLEACCEL # <<<<<<<<<<<<<< * SRCCOLORKEY = 0 * */ __pyx_t_1 = __Pyx_PyInt_From_int(SDL_RLEACCEL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 17; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); if (PyDict_SetItem(__pyx_d, __pyx_n_s_RLEACCEL, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 17; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "pygame_sdl2/locals.pyx":18 * * RLEACCEL = SDL_RLEACCEL * SRCCOLORKEY = 0 # <<<<<<<<<<<<<< * * # Surface flags. */ if (PyDict_SetItem(__pyx_d, __pyx_n_s_SRCCOLORKEY, __pyx_int_0) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 18; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "pygame_sdl2/locals.pyx":21 * * # Surface flags. * SRCALPHA = 0x80000000 # <<<<<<<<<<<<<< * HWSURFACE = 0x40000000 * SWSURFACE = 0 */ if (PyDict_SetItem(__pyx_d, __pyx_n_s_SRCALPHA, __pyx_int_2147483648) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 21; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "pygame_sdl2/locals.pyx":22 * # Surface flags. * SRCALPHA = 0x80000000 * HWSURFACE = 0x40000000 # <<<<<<<<<<<<<< * SWSURFACE = 0 * */ if (PyDict_SetItem(__pyx_d, __pyx_n_s_HWSURFACE, __pyx_int_1073741824) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 22; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "pygame_sdl2/locals.pyx":23 * SRCALPHA = 0x80000000 * HWSURFACE = 0x40000000 * SWSURFACE = 0 # <<<<<<<<<<<<<< * * # Window flags. */ if (PyDict_SetItem(__pyx_d, __pyx_n_s_SWSURFACE, __pyx_int_0) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 23; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "pygame_sdl2/locals.pyx":26 * * # Window flags. * FULLSCREEN = SDL_WINDOW_FULLSCREEN # <<<<<<<<<<<<<< * OPENGL = SDL_WINDOW_OPENGL * NOFRAME = SDL_WINDOW_BORDERLESS */ __pyx_t_1 = __Pyx_PyInt_From_SDL_WindowFlags(SDL_WINDOW_FULLSCREEN); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 26; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); if (PyDict_SetItem(__pyx_d, __pyx_n_s_FULLSCREEN, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 26; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "pygame_sdl2/locals.pyx":27 * # Window flags. * FULLSCREEN = SDL_WINDOW_FULLSCREEN * OPENGL = SDL_WINDOW_OPENGL # <<<<<<<<<<<<<< * NOFRAME = SDL_WINDOW_BORDERLESS * RESIZABLE = SDL_WINDOW_RESIZABLE */ __pyx_t_1 = __Pyx_PyInt_From_SDL_WindowFlags(SDL_WINDOW_OPENGL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 27; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); if (PyDict_SetItem(__pyx_d, __pyx_n_s_OPENGL, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 27; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "pygame_sdl2/locals.pyx":28 * FULLSCREEN = SDL_WINDOW_FULLSCREEN * OPENGL = SDL_WINDOW_OPENGL * NOFRAME = SDL_WINDOW_BORDERLESS # <<<<<<<<<<<<<< * RESIZABLE = SDL_WINDOW_RESIZABLE * DOUBLEBUF = 0 */ __pyx_t_1 = __Pyx_PyInt_From_SDL_WindowFlags(SDL_WINDOW_BORDERLESS); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 28; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); if (PyDict_SetItem(__pyx_d, __pyx_n_s_NOFRAME, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 28; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "pygame_sdl2/locals.pyx":29 * OPENGL = SDL_WINDOW_OPENGL * NOFRAME = SDL_WINDOW_BORDERLESS * RESIZABLE = SDL_WINDOW_RESIZABLE # <<<<<<<<<<<<<< * DOUBLEBUF = 0 * */ __pyx_t_1 = __Pyx_PyInt_From_SDL_WindowFlags(SDL_WINDOW_RESIZABLE); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 29; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); if (PyDict_SetItem(__pyx_d, __pyx_n_s_RESIZABLE, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 29; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "pygame_sdl2/locals.pyx":30 * NOFRAME = SDL_WINDOW_BORDERLESS * RESIZABLE = SDL_WINDOW_RESIZABLE * DOUBLEBUF = 0 # <<<<<<<<<<<<<< * * WINDOW_FULLSCREEN = SDL_WINDOW_FULLSCREEN */ if (PyDict_SetItem(__pyx_d, __pyx_n_s_DOUBLEBUF, __pyx_int_0) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 30; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "pygame_sdl2/locals.pyx":32 * DOUBLEBUF = 0 * * WINDOW_FULLSCREEN = SDL_WINDOW_FULLSCREEN # <<<<<<<<<<<<<< * WINDOW_SHOWN = SDL_WINDOW_SHOWN * WINDOW_HIDDEN = SDL_WINDOW_HIDDEN */ __pyx_t_1 = __Pyx_PyInt_From_SDL_WindowFlags(SDL_WINDOW_FULLSCREEN); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 32; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); if (PyDict_SetItem(__pyx_d, __pyx_n_s_WINDOW_FULLSCREEN, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 32; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "pygame_sdl2/locals.pyx":33 * * WINDOW_FULLSCREEN = SDL_WINDOW_FULLSCREEN * WINDOW_SHOWN = SDL_WINDOW_SHOWN # <<<<<<<<<<<<<< * WINDOW_HIDDEN = SDL_WINDOW_HIDDEN * WINDOW_OPENGL = SDL_WINDOW_OPENGL */ __pyx_t_1 = __Pyx_PyInt_From_SDL_WindowFlags(SDL_WINDOW_SHOWN); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 33; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); if (PyDict_SetItem(__pyx_d, __pyx_n_s_WINDOW_SHOWN, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 33; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "pygame_sdl2/locals.pyx":34 * WINDOW_FULLSCREEN = SDL_WINDOW_FULLSCREEN * WINDOW_SHOWN = SDL_WINDOW_SHOWN * WINDOW_HIDDEN = SDL_WINDOW_HIDDEN # <<<<<<<<<<<<<< * WINDOW_OPENGL = SDL_WINDOW_OPENGL * WINDOW_NOFRAME = SDL_WINDOW_BORDERLESS */ __pyx_t_1 = __Pyx_PyInt_From_SDL_WindowFlags(SDL_WINDOW_HIDDEN); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 34; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); if (PyDict_SetItem(__pyx_d, __pyx_n_s_WINDOW_HIDDEN, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 34; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "pygame_sdl2/locals.pyx":35 * WINDOW_SHOWN = SDL_WINDOW_SHOWN * WINDOW_HIDDEN = SDL_WINDOW_HIDDEN * WINDOW_OPENGL = SDL_WINDOW_OPENGL # <<<<<<<<<<<<<< * WINDOW_NOFRAME = SDL_WINDOW_BORDERLESS * WINDOW_BORDERLESS = SDL_WINDOW_BORDERLESS */ __pyx_t_1 = __Pyx_PyInt_From_SDL_WindowFlags(SDL_WINDOW_OPENGL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 35; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); if (PyDict_SetItem(__pyx_d, __pyx_n_s_WINDOW_OPENGL, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 35; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "pygame_sdl2/locals.pyx":36 * WINDOW_HIDDEN = SDL_WINDOW_HIDDEN * WINDOW_OPENGL = SDL_WINDOW_OPENGL * WINDOW_NOFRAME = SDL_WINDOW_BORDERLESS # <<<<<<<<<<<<<< * WINDOW_BORDERLESS = SDL_WINDOW_BORDERLESS * WINDOW_RESIZABLE = SDL_WINDOW_RESIZABLE */ __pyx_t_1 = __Pyx_PyInt_From_SDL_WindowFlags(SDL_WINDOW_BORDERLESS); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 36; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); if (PyDict_SetItem(__pyx_d, __pyx_n_s_WINDOW_NOFRAME, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 36; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "pygame_sdl2/locals.pyx":37 * WINDOW_OPENGL = SDL_WINDOW_OPENGL * WINDOW_NOFRAME = SDL_WINDOW_BORDERLESS * WINDOW_BORDERLESS = SDL_WINDOW_BORDERLESS # <<<<<<<<<<<<<< * WINDOW_RESIZABLE = SDL_WINDOW_RESIZABLE * WINDOW_MINIMIZED = SDL_WINDOW_MINIMIZED */ __pyx_t_1 = __Pyx_PyInt_From_SDL_WindowFlags(SDL_WINDOW_BORDERLESS); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 37; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); if (PyDict_SetItem(__pyx_d, __pyx_n_s_WINDOW_BORDERLESS, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 37; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "pygame_sdl2/locals.pyx":38 * WINDOW_NOFRAME = SDL_WINDOW_BORDERLESS * WINDOW_BORDERLESS = SDL_WINDOW_BORDERLESS * WINDOW_RESIZABLE = SDL_WINDOW_RESIZABLE # <<<<<<<<<<<<<< * WINDOW_MINIMIZED = SDL_WINDOW_MINIMIZED * WINDOW_MAXIMIZED = SDL_WINDOW_MAXIMIZED */ __pyx_t_1 = __Pyx_PyInt_From_SDL_WindowFlags(SDL_WINDOW_RESIZABLE); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 38; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); if (PyDict_SetItem(__pyx_d, __pyx_n_s_WINDOW_RESIZABLE, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 38; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "pygame_sdl2/locals.pyx":39 * WINDOW_BORDERLESS = SDL_WINDOW_BORDERLESS * WINDOW_RESIZABLE = SDL_WINDOW_RESIZABLE * WINDOW_MINIMIZED = SDL_WINDOW_MINIMIZED # <<<<<<<<<<<<<< * WINDOW_MAXIMIZED = SDL_WINDOW_MAXIMIZED * WINDOW_INPUT_GRABBED = SDL_WINDOW_INPUT_GRABBED */ __pyx_t_1 = __Pyx_PyInt_From_SDL_WindowFlags(SDL_WINDOW_MINIMIZED); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 39; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); if (PyDict_SetItem(__pyx_d, __pyx_n_s_WINDOW_MINIMIZED, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 39; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "pygame_sdl2/locals.pyx":40 * WINDOW_RESIZABLE = SDL_WINDOW_RESIZABLE * WINDOW_MINIMIZED = SDL_WINDOW_MINIMIZED * WINDOW_MAXIMIZED = SDL_WINDOW_MAXIMIZED # <<<<<<<<<<<<<< * WINDOW_INPUT_GRABBED = SDL_WINDOW_INPUT_GRABBED * WINDOW_INPUT_FOCUS = SDL_WINDOW_MOUSE_FOCUS */ __pyx_t_1 = __Pyx_PyInt_From_SDL_WindowFlags(SDL_WINDOW_MAXIMIZED); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 40; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); if (PyDict_SetItem(__pyx_d, __pyx_n_s_WINDOW_MAXIMIZED, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 40; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "pygame_sdl2/locals.pyx":41 * WINDOW_MINIMIZED = SDL_WINDOW_MINIMIZED * WINDOW_MAXIMIZED = SDL_WINDOW_MAXIMIZED * WINDOW_INPUT_GRABBED = SDL_WINDOW_INPUT_GRABBED # <<<<<<<<<<<<<< * WINDOW_INPUT_FOCUS = SDL_WINDOW_MOUSE_FOCUS * WINDOW_FULLSCREEN_DESKTOP = SDL_WINDOW_FULLSCREEN_DESKTOP */ __pyx_t_1 = __Pyx_PyInt_From_SDL_WindowFlags(SDL_WINDOW_INPUT_GRABBED); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 41; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); if (PyDict_SetItem(__pyx_d, __pyx_n_s_WINDOW_INPUT_GRABBED, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 41; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "pygame_sdl2/locals.pyx":42 * WINDOW_MAXIMIZED = SDL_WINDOW_MAXIMIZED * WINDOW_INPUT_GRABBED = SDL_WINDOW_INPUT_GRABBED * WINDOW_INPUT_FOCUS = SDL_WINDOW_MOUSE_FOCUS # <<<<<<<<<<<<<< * WINDOW_FULLSCREEN_DESKTOP = SDL_WINDOW_FULLSCREEN_DESKTOP * WINDOW_FOREIGN = SDL_WINDOW_FOREIGN */ __pyx_t_1 = __Pyx_PyInt_From_SDL_WindowFlags(SDL_WINDOW_MOUSE_FOCUS); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 42; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); if (PyDict_SetItem(__pyx_d, __pyx_n_s_WINDOW_INPUT_FOCUS, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 42; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "pygame_sdl2/locals.pyx":43 * WINDOW_INPUT_GRABBED = SDL_WINDOW_INPUT_GRABBED * WINDOW_INPUT_FOCUS = SDL_WINDOW_MOUSE_FOCUS * WINDOW_FULLSCREEN_DESKTOP = SDL_WINDOW_FULLSCREEN_DESKTOP # <<<<<<<<<<<<<< * WINDOW_FOREIGN = SDL_WINDOW_FOREIGN * WINDOW_ALLOW_HIGHDPI = SDL_WINDOW_ALLOW_HIGHDPI */ __pyx_t_1 = __Pyx_PyInt_From_SDL_WindowFlags(SDL_WINDOW_FULLSCREEN_DESKTOP); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 43; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); if (PyDict_SetItem(__pyx_d, __pyx_n_s_WINDOW_FULLSCREEN_DESKTOP, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 43; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "pygame_sdl2/locals.pyx":44 * WINDOW_INPUT_FOCUS = SDL_WINDOW_MOUSE_FOCUS * WINDOW_FULLSCREEN_DESKTOP = SDL_WINDOW_FULLSCREEN_DESKTOP * WINDOW_FOREIGN = SDL_WINDOW_FOREIGN # <<<<<<<<<<<<<< * WINDOW_ALLOW_HIGHDPI = SDL_WINDOW_ALLOW_HIGHDPI * */ __pyx_t_1 = __Pyx_PyInt_From_SDL_WindowFlags(SDL_WINDOW_FOREIGN); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 44; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); if (PyDict_SetItem(__pyx_d, __pyx_n_s_WINDOW_FOREIGN, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 44; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "pygame_sdl2/locals.pyx":45 * WINDOW_FULLSCREEN_DESKTOP = SDL_WINDOW_FULLSCREEN_DESKTOP * WINDOW_FOREIGN = SDL_WINDOW_FOREIGN * WINDOW_ALLOW_HIGHDPI = SDL_WINDOW_ALLOW_HIGHDPI # <<<<<<<<<<<<<< * * WINDOWPOS_CENTERED = SDL_WINDOWPOS_CENTERED */ __pyx_t_1 = __Pyx_PyInt_From_SDL_WindowFlags(SDL_WINDOW_ALLOW_HIGHDPI); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 45; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); if (PyDict_SetItem(__pyx_d, __pyx_n_s_WINDOW_ALLOW_HIGHDPI, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 45; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "pygame_sdl2/locals.pyx":47 * WINDOW_ALLOW_HIGHDPI = SDL_WINDOW_ALLOW_HIGHDPI * * WINDOWPOS_CENTERED = SDL_WINDOWPOS_CENTERED # <<<<<<<<<<<<<< * WINDOWPOS_UNDEFINED = SDL_WINDOWPOS_UNDEFINED * */ __pyx_t_1 = __Pyx_PyInt_From_int(SDL_WINDOWPOS_CENTERED); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 47; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); if (PyDict_SetItem(__pyx_d, __pyx_n_s_WINDOWPOS_CENTERED, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 47; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "pygame_sdl2/locals.pyx":48 * * WINDOWPOS_CENTERED = SDL_WINDOWPOS_CENTERED * WINDOWPOS_UNDEFINED = SDL_WINDOWPOS_UNDEFINED # <<<<<<<<<<<<<< * * # Blend modes */ __pyx_t_1 = __Pyx_PyInt_From_int(SDL_WINDOWPOS_UNDEFINED); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 48; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); if (PyDict_SetItem(__pyx_d, __pyx_n_s_WINDOWPOS_UNDEFINED, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 48; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "pygame_sdl2/locals.pyx":51 * * # Blend modes * BLEND_RGB_ADD = BLEND_ADD = 0x1 # <<<<<<<<<<<<<< * BLEND_RGB_SUB = BLEND_SUB = 0x2 * BLEND_RGB_MULT = BLEND_MULT = 0x3 */ if (PyDict_SetItem(__pyx_d, __pyx_n_s_BLEND_RGB_ADD, __pyx_int_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 51; __pyx_clineno = __LINE__; goto __pyx_L1_error;} if (PyDict_SetItem(__pyx_d, __pyx_n_s_BLEND_ADD, __pyx_int_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 51; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "pygame_sdl2/locals.pyx":52 * # Blend modes * BLEND_RGB_ADD = BLEND_ADD = 0x1 * BLEND_RGB_SUB = BLEND_SUB = 0x2 # <<<<<<<<<<<<<< * BLEND_RGB_MULT = BLEND_MULT = 0x3 * BLEND_RGB_MIN = BLEND_MIN = 0x4 */ if (PyDict_SetItem(__pyx_d, __pyx_n_s_BLEND_RGB_SUB, __pyx_int_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 52; __pyx_clineno = __LINE__; goto __pyx_L1_error;} if (PyDict_SetItem(__pyx_d, __pyx_n_s_BLEND_SUB, __pyx_int_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 52; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "pygame_sdl2/locals.pyx":53 * BLEND_RGB_ADD = BLEND_ADD = 0x1 * BLEND_RGB_SUB = BLEND_SUB = 0x2 * BLEND_RGB_MULT = BLEND_MULT = 0x3 # <<<<<<<<<<<<<< * BLEND_RGB_MIN = BLEND_MIN = 0x4 * BLEND_RGB_MAX = BLEND_MAX = 0x5 */ if (PyDict_SetItem(__pyx_d, __pyx_n_s_BLEND_RGB_MULT, __pyx_int_3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 53; __pyx_clineno = __LINE__; goto __pyx_L1_error;} if (PyDict_SetItem(__pyx_d, __pyx_n_s_BLEND_MULT, __pyx_int_3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 53; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "pygame_sdl2/locals.pyx":54 * BLEND_RGB_SUB = BLEND_SUB = 0x2 * BLEND_RGB_MULT = BLEND_MULT = 0x3 * BLEND_RGB_MIN = BLEND_MIN = 0x4 # <<<<<<<<<<<<<< * BLEND_RGB_MAX = BLEND_MAX = 0x5 * */ if (PyDict_SetItem(__pyx_d, __pyx_n_s_BLEND_RGB_MIN, __pyx_int_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 54; __pyx_clineno = __LINE__; goto __pyx_L1_error;} if (PyDict_SetItem(__pyx_d, __pyx_n_s_BLEND_MIN, __pyx_int_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 54; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "pygame_sdl2/locals.pyx":55 * BLEND_RGB_MULT = BLEND_MULT = 0x3 * BLEND_RGB_MIN = BLEND_MIN = 0x4 * BLEND_RGB_MAX = BLEND_MAX = 0x5 # <<<<<<<<<<<<<< * * BLEND_RGBA_ADD = 0x6 */ if (PyDict_SetItem(__pyx_d, __pyx_n_s_BLEND_RGB_MAX, __pyx_int_5) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 55; __pyx_clineno = __LINE__; goto __pyx_L1_error;} if (PyDict_SetItem(__pyx_d, __pyx_n_s_BLEND_MAX, __pyx_int_5) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 55; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "pygame_sdl2/locals.pyx":57 * BLEND_RGB_MAX = BLEND_MAX = 0x5 * * BLEND_RGBA_ADD = 0x6 # <<<<<<<<<<<<<< * BLEND_RGBA_SUB = 0x7 * BLEND_RGBA_MULT = 0x8 */ if (PyDict_SetItem(__pyx_d, __pyx_n_s_BLEND_RGBA_ADD, __pyx_int_6) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 57; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "pygame_sdl2/locals.pyx":58 * * BLEND_RGBA_ADD = 0x6 * BLEND_RGBA_SUB = 0x7 # <<<<<<<<<<<<<< * BLEND_RGBA_MULT = 0x8 * BLEND_RGBA_MIN = 0x9 */ if (PyDict_SetItem(__pyx_d, __pyx_n_s_BLEND_RGBA_SUB, __pyx_int_7) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 58; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "pygame_sdl2/locals.pyx":59 * BLEND_RGBA_ADD = 0x6 * BLEND_RGBA_SUB = 0x7 * BLEND_RGBA_MULT = 0x8 # <<<<<<<<<<<<<< * BLEND_RGBA_MIN = 0x9 * BLEND_RGBA_MAX = 0x10 */ if (PyDict_SetItem(__pyx_d, __pyx_n_s_BLEND_RGBA_MULT, __pyx_int_8) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 59; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "pygame_sdl2/locals.pyx":60 * BLEND_RGBA_SUB = 0x7 * BLEND_RGBA_MULT = 0x8 * BLEND_RGBA_MIN = 0x9 # <<<<<<<<<<<<<< * BLEND_RGBA_MAX = 0x10 * */ if (PyDict_SetItem(__pyx_d, __pyx_n_s_BLEND_RGBA_MIN, __pyx_int_9) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 60; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "pygame_sdl2/locals.pyx":61 * BLEND_RGBA_MULT = 0x8 * BLEND_RGBA_MIN = 0x9 * BLEND_RGBA_MAX = 0x10 # <<<<<<<<<<<<<< * * BLEND_PREMULTIPLIED = 0x11 */ if (PyDict_SetItem(__pyx_d, __pyx_n_s_BLEND_RGBA_MAX, __pyx_int_16) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 61; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "pygame_sdl2/locals.pyx":63 * BLEND_RGBA_MAX = 0x10 * * BLEND_PREMULTIPLIED = 0x11 # <<<<<<<<<<<<<< * * # Scrap types. */ if (PyDict_SetItem(__pyx_d, __pyx_n_s_BLEND_PREMULTIPLIED, __pyx_int_17) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 63; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "pygame_sdl2/locals.pyx":66 * * # Scrap types. * SCRAP_TEXT = "text/plain" # <<<<<<<<<<<<<< * * BYTEORDER = SDL_BYTEORDER */ if (PyDict_SetItem(__pyx_d, __pyx_n_s_SCRAP_TEXT, __pyx_kp_s_text_plain) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 66; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "pygame_sdl2/locals.pyx":68 * SCRAP_TEXT = "text/plain" * * BYTEORDER = SDL_BYTEORDER # <<<<<<<<<<<<<< * LIL_ENDIAN = SDL_LIL_ENDIAN * BIG_ENDIAN = SDL_BIG_ENDIAN */ __pyx_t_1 = __Pyx_PyInt_From_int(SDL_BYTEORDER); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 68; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); if (PyDict_SetItem(__pyx_d, __pyx_n_s_BYTEORDER, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 68; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "pygame_sdl2/locals.pyx":69 * * BYTEORDER = SDL_BYTEORDER * LIL_ENDIAN = SDL_LIL_ENDIAN # <<<<<<<<<<<<<< * BIG_ENDIAN = SDL_BIG_ENDIAN * */ __pyx_t_1 = __Pyx_PyInt_From_int(SDL_LIL_ENDIAN); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 69; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); if (PyDict_SetItem(__pyx_d, __pyx_n_s_LIL_ENDIAN, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 69; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "pygame_sdl2/locals.pyx":70 * BYTEORDER = SDL_BYTEORDER * LIL_ENDIAN = SDL_LIL_ENDIAN * BIG_ENDIAN = SDL_BIG_ENDIAN # <<<<<<<<<<<<<< * * SDL_VERSION_TUPLE = (SDL_MAJOR_VERSION, SDL_MINOR_VERSION, SDL_PATCHLEVEL) */ __pyx_t_1 = __Pyx_PyInt_From_int(SDL_BIG_ENDIAN); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 70; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); if (PyDict_SetItem(__pyx_d, __pyx_n_s_BIG_ENDIAN, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 70; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "pygame_sdl2/locals.pyx":72 * BIG_ENDIAN = SDL_BIG_ENDIAN * * SDL_VERSION_TUPLE = (SDL_MAJOR_VERSION, SDL_MINOR_VERSION, SDL_PATCHLEVEL) # <<<<<<<<<<<<<< * * globals().update(dict( */ __pyx_t_1 = __Pyx_PyInt_From_int(SDL_MAJOR_VERSION); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 72; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = __Pyx_PyInt_From_int(SDL_MINOR_VERSION); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 72; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = __Pyx_PyInt_From_int(SDL_PATCHLEVEL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 72; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = PyTuple_New(3); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 72; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); __Pyx_GIVEREF(__pyx_t_1); PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_1); __Pyx_GIVEREF(__pyx_t_2); PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_2); __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_4, 2, __pyx_t_3); __pyx_t_1 = 0; __pyx_t_2 = 0; __pyx_t_3 = 0; if (PyDict_SetItem(__pyx_d, __pyx_n_s_SDL_VERSION_TUPLE, __pyx_t_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 72; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; /* "pygame_sdl2/locals.pyx":74 * SDL_VERSION_TUPLE = (SDL_MAJOR_VERSION, SDL_MINOR_VERSION, SDL_PATCHLEVEL) * * globals().update(dict( # <<<<<<<<<<<<<< * KMOD_NONE = sdl2.KMOD_NONE, * */ __pyx_t_3 = __Pyx_Globals(); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 74; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_update); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 74; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "pygame_sdl2/locals.pyx":75 * * globals().update(dict( * KMOD_NONE = sdl2.KMOD_NONE, # <<<<<<<<<<<<<< * * KMOD_LSHIFT = sdl2.KMOD_LSHIFT, */ __pyx_t_3 = PyDict_New(); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 75; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __pyx_t_1 = __Pyx_PyInt_From_SDL_Keymod(KMOD_NONE); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 75; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_KMOD_NONE, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 75; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "pygame_sdl2/locals.pyx":77 * KMOD_NONE = sdl2.KMOD_NONE, * * KMOD_LSHIFT = sdl2.KMOD_LSHIFT, # <<<<<<<<<<<<<< * KMOD_RSHIFT = sdl2.KMOD_RSHIFT, * KMOD_SHIFT = sdl2.KMOD_SHIFT, */ __pyx_t_1 = __Pyx_PyInt_From_SDL_Keymod(KMOD_LSHIFT); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 77; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_KMOD_LSHIFT, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 75; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "pygame_sdl2/locals.pyx":78 * * KMOD_LSHIFT = sdl2.KMOD_LSHIFT, * KMOD_RSHIFT = sdl2.KMOD_RSHIFT, # <<<<<<<<<<<<<< * KMOD_SHIFT = sdl2.KMOD_SHIFT, * */ __pyx_t_1 = __Pyx_PyInt_From_SDL_Keymod(KMOD_RSHIFT); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 78; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_KMOD_RSHIFT, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 75; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "pygame_sdl2/locals.pyx":79 * KMOD_LSHIFT = sdl2.KMOD_LSHIFT, * KMOD_RSHIFT = sdl2.KMOD_RSHIFT, * KMOD_SHIFT = sdl2.KMOD_SHIFT, # <<<<<<<<<<<<<< * * KMOD_LCTRL = sdl2.KMOD_LCTRL, */ __pyx_t_1 = __Pyx_PyInt_From_int(KMOD_SHIFT); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 79; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_KMOD_SHIFT, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 75; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "pygame_sdl2/locals.pyx":81 * KMOD_SHIFT = sdl2.KMOD_SHIFT, * * KMOD_LCTRL = sdl2.KMOD_LCTRL, # <<<<<<<<<<<<<< * KMOD_RCTRL = sdl2.KMOD_RCTRL, * KMOD_CTRL = sdl2.KMOD_CTRL, */ __pyx_t_1 = __Pyx_PyInt_From_SDL_Keymod(KMOD_LCTRL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 81; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_KMOD_LCTRL, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 75; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "pygame_sdl2/locals.pyx":82 * * KMOD_LCTRL = sdl2.KMOD_LCTRL, * KMOD_RCTRL = sdl2.KMOD_RCTRL, # <<<<<<<<<<<<<< * KMOD_CTRL = sdl2.KMOD_CTRL, * */ __pyx_t_1 = __Pyx_PyInt_From_SDL_Keymod(KMOD_RCTRL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 82; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_KMOD_RCTRL, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 75; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "pygame_sdl2/locals.pyx":83 * KMOD_LCTRL = sdl2.KMOD_LCTRL, * KMOD_RCTRL = sdl2.KMOD_RCTRL, * KMOD_CTRL = sdl2.KMOD_CTRL, # <<<<<<<<<<<<<< * * KMOD_LALT = sdl2.KMOD_LALT, */ __pyx_t_1 = __Pyx_PyInt_From_int(KMOD_CTRL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 83; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_KMOD_CTRL, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 75; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "pygame_sdl2/locals.pyx":85 * KMOD_CTRL = sdl2.KMOD_CTRL, * * KMOD_LALT = sdl2.KMOD_LALT, # <<<<<<<<<<<<<< * KMOD_RALT = sdl2.KMOD_RALT, * KMOD_ALT = sdl2.KMOD_ALT, */ __pyx_t_1 = __Pyx_PyInt_From_SDL_Keymod(KMOD_LALT); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 85; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_KMOD_LALT, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 75; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "pygame_sdl2/locals.pyx":86 * * KMOD_LALT = sdl2.KMOD_LALT, * KMOD_RALT = sdl2.KMOD_RALT, # <<<<<<<<<<<<<< * KMOD_ALT = sdl2.KMOD_ALT, * */ __pyx_t_1 = __Pyx_PyInt_From_SDL_Keymod(KMOD_RALT); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 86; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_KMOD_RALT, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 75; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "pygame_sdl2/locals.pyx":87 * KMOD_LALT = sdl2.KMOD_LALT, * KMOD_RALT = sdl2.KMOD_RALT, * KMOD_ALT = sdl2.KMOD_ALT, # <<<<<<<<<<<<<< * * KMOD_LGUI = sdl2.KMOD_LGUI, */ __pyx_t_1 = __Pyx_PyInt_From_int(KMOD_ALT); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 87; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_KMOD_ALT, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 75; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "pygame_sdl2/locals.pyx":89 * KMOD_ALT = sdl2.KMOD_ALT, * * KMOD_LGUI = sdl2.KMOD_LGUI, # <<<<<<<<<<<<<< * KMOD_RGUI = sdl2.KMOD_RGUI, * KMOD_GUI = sdl2.KMOD_GUI, */ __pyx_t_1 = __Pyx_PyInt_From_SDL_Keymod(KMOD_LGUI); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 89; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_KMOD_LGUI, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 75; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "pygame_sdl2/locals.pyx":90 * * KMOD_LGUI = sdl2.KMOD_LGUI, * KMOD_RGUI = sdl2.KMOD_RGUI, # <<<<<<<<<<<<<< * KMOD_GUI = sdl2.KMOD_GUI, * */ __pyx_t_1 = __Pyx_PyInt_From_SDL_Keymod(KMOD_RGUI); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 90; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_KMOD_RGUI, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 75; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "pygame_sdl2/locals.pyx":91 * KMOD_LGUI = sdl2.KMOD_LGUI, * KMOD_RGUI = sdl2.KMOD_RGUI, * KMOD_GUI = sdl2.KMOD_GUI, # <<<<<<<<<<<<<< * * KMOD_LMETA = sdl2.KMOD_LGUI, */ __pyx_t_1 = __Pyx_PyInt_From_int(KMOD_GUI); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 91; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_KMOD_GUI, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 75; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "pygame_sdl2/locals.pyx":93 * KMOD_GUI = sdl2.KMOD_GUI, * * KMOD_LMETA = sdl2.KMOD_LGUI, # <<<<<<<<<<<<<< * KMOD_RMETA = sdl2.KMOD_RGUI, * KMOD_META = sdl2.KMOD_GUI, */ __pyx_t_1 = __Pyx_PyInt_From_SDL_Keymod(KMOD_LGUI); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 93; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_KMOD_LMETA, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 75; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "pygame_sdl2/locals.pyx":94 * * KMOD_LMETA = sdl2.KMOD_LGUI, * KMOD_RMETA = sdl2.KMOD_RGUI, # <<<<<<<<<<<<<< * KMOD_META = sdl2.KMOD_GUI, * */ __pyx_t_1 = __Pyx_PyInt_From_SDL_Keymod(KMOD_RGUI); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 94; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_KMOD_RMETA, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 75; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "pygame_sdl2/locals.pyx":95 * KMOD_LMETA = sdl2.KMOD_LGUI, * KMOD_RMETA = sdl2.KMOD_RGUI, * KMOD_META = sdl2.KMOD_GUI, # <<<<<<<<<<<<<< * * KMOD_NUM = sdl2.KMOD_NUM, */ __pyx_t_1 = __Pyx_PyInt_From_int(KMOD_GUI); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 95; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_KMOD_META, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 75; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "pygame_sdl2/locals.pyx":97 * KMOD_META = sdl2.KMOD_GUI, * * KMOD_NUM = sdl2.KMOD_NUM, # <<<<<<<<<<<<<< * KMOD_CAPS = sdl2.KMOD_CAPS, * */ __pyx_t_1 = __Pyx_PyInt_From_SDL_Keymod(KMOD_NUM); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 97; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_KMOD_NUM, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 75; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "pygame_sdl2/locals.pyx":98 * * KMOD_NUM = sdl2.KMOD_NUM, * KMOD_CAPS = sdl2.KMOD_CAPS, # <<<<<<<<<<<<<< * * KMOD_MODE = sdl2.KMOD_MODE, */ __pyx_t_1 = __Pyx_PyInt_From_SDL_Keymod(KMOD_CAPS); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 98; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_KMOD_CAPS, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 75; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "pygame_sdl2/locals.pyx":100 * KMOD_CAPS = sdl2.KMOD_CAPS, * * KMOD_MODE = sdl2.KMOD_MODE, # <<<<<<<<<<<<<< * * K_FIRST = 0, */ __pyx_t_1 = __Pyx_PyInt_From_SDL_Keymod(KMOD_MODE); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 100; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_KMOD_MODE, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 75; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_K_FIRST, __pyx_int_0) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 75; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "pygame_sdl2/locals.pyx":103 * * K_FIRST = 0, * K_LAST = sdl2.SDLK_SLEEP, # <<<<<<<<<<<<<< * * K_BREAK = sdl2.SDLK_PAUSE, */ __pyx_t_1 = __Pyx_PyInt_From_int(SDLK_SLEEP); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 103; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_K_LAST, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 75; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "pygame_sdl2/locals.pyx":105 * K_LAST = sdl2.SDLK_SLEEP, * * K_BREAK = sdl2.SDLK_PAUSE, # <<<<<<<<<<<<<< * K_EURO = sdl2.SDLK_CURRENCYUNIT, * */ __pyx_t_1 = __Pyx_PyInt_From_int(SDLK_PAUSE); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 105; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_K_BREAK, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 75; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "pygame_sdl2/locals.pyx":106 * * K_BREAK = sdl2.SDLK_PAUSE, * K_EURO = sdl2.SDLK_CURRENCYUNIT, # <<<<<<<<<<<<<< * * K_KP0 = sdl2.SDLK_KP_0, */ __pyx_t_1 = __Pyx_PyInt_From_int(SDLK_CURRENCYUNIT); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 106; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_K_EURO, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 75; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "pygame_sdl2/locals.pyx":108 * K_EURO = sdl2.SDLK_CURRENCYUNIT, * * K_KP0 = sdl2.SDLK_KP_0, # <<<<<<<<<<<<<< * K_KP1 = sdl2.SDLK_KP_1, * K_KP2 = sdl2.SDLK_KP_2, */ __pyx_t_1 = __Pyx_PyInt_From_int(SDLK_KP_0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 108; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_K_KP0, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 75; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "pygame_sdl2/locals.pyx":109 * * K_KP0 = sdl2.SDLK_KP_0, * K_KP1 = sdl2.SDLK_KP_1, # <<<<<<<<<<<<<< * K_KP2 = sdl2.SDLK_KP_2, * K_KP3 = sdl2.SDLK_KP_3, */ __pyx_t_1 = __Pyx_PyInt_From_int(SDLK_KP_1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 109; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_K_KP1, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 75; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "pygame_sdl2/locals.pyx":110 * K_KP0 = sdl2.SDLK_KP_0, * K_KP1 = sdl2.SDLK_KP_1, * K_KP2 = sdl2.SDLK_KP_2, # <<<<<<<<<<<<<< * K_KP3 = sdl2.SDLK_KP_3, * K_KP4 = sdl2.SDLK_KP_4, */ __pyx_t_1 = __Pyx_PyInt_From_int(SDLK_KP_2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 110; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_K_KP2, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 75; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "pygame_sdl2/locals.pyx":111 * K_KP1 = sdl2.SDLK_KP_1, * K_KP2 = sdl2.SDLK_KP_2, * K_KP3 = sdl2.SDLK_KP_3, # <<<<<<<<<<<<<< * K_KP4 = sdl2.SDLK_KP_4, * K_KP5 = sdl2.SDLK_KP_5, */ __pyx_t_1 = __Pyx_PyInt_From_int(SDLK_KP_3); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 111; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_K_KP3, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 75; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "pygame_sdl2/locals.pyx":112 * K_KP2 = sdl2.SDLK_KP_2, * K_KP3 = sdl2.SDLK_KP_3, * K_KP4 = sdl2.SDLK_KP_4, # <<<<<<<<<<<<<< * K_KP5 = sdl2.SDLK_KP_5, * K_KP6 = sdl2.SDLK_KP_6, */ __pyx_t_1 = __Pyx_PyInt_From_int(SDLK_KP_4); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 112; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_K_KP4, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 75; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "pygame_sdl2/locals.pyx":113 * K_KP3 = sdl2.SDLK_KP_3, * K_KP4 = sdl2.SDLK_KP_4, * K_KP5 = sdl2.SDLK_KP_5, # <<<<<<<<<<<<<< * K_KP6 = sdl2.SDLK_KP_6, * K_KP7 = sdl2.SDLK_KP_7, */ __pyx_t_1 = __Pyx_PyInt_From_int(SDLK_KP_5); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 113; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_K_KP5, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 75; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "pygame_sdl2/locals.pyx":114 * K_KP4 = sdl2.SDLK_KP_4, * K_KP5 = sdl2.SDLK_KP_5, * K_KP6 = sdl2.SDLK_KP_6, # <<<<<<<<<<<<<< * K_KP7 = sdl2.SDLK_KP_7, * K_KP8 = sdl2.SDLK_KP_8, */ __pyx_t_1 = __Pyx_PyInt_From_int(SDLK_KP_6); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 114; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_K_KP6, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 75; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "pygame_sdl2/locals.pyx":115 * K_KP5 = sdl2.SDLK_KP_5, * K_KP6 = sdl2.SDLK_KP_6, * K_KP7 = sdl2.SDLK_KP_7, # <<<<<<<<<<<<<< * K_KP8 = sdl2.SDLK_KP_8, * K_KP9 = sdl2.SDLK_KP_9, */ __pyx_t_1 = __Pyx_PyInt_From_int(SDLK_KP_7); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 115; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_K_KP7, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 75; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "pygame_sdl2/locals.pyx":116 * K_KP6 = sdl2.SDLK_KP_6, * K_KP7 = sdl2.SDLK_KP_7, * K_KP8 = sdl2.SDLK_KP_8, # <<<<<<<<<<<<<< * K_KP9 = sdl2.SDLK_KP_9, * */ __pyx_t_1 = __Pyx_PyInt_From_int(SDLK_KP_8); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 116; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_K_KP8, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 75; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "pygame_sdl2/locals.pyx":117 * K_KP7 = sdl2.SDLK_KP_7, * K_KP8 = sdl2.SDLK_KP_8, * K_KP9 = sdl2.SDLK_KP_9, # <<<<<<<<<<<<<< * * K_LMETA = sdl2.SDLK_LGUI, */ __pyx_t_1 = __Pyx_PyInt_From_int(SDLK_KP_9); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 117; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_K_KP9, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 75; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "pygame_sdl2/locals.pyx":119 * K_KP9 = sdl2.SDLK_KP_9, * * K_LMETA = sdl2.SDLK_LGUI, # <<<<<<<<<<<<<< * K_LSUPER = sdl2.SDLK_LGUI, * K_RMETA = sdl2.SDLK_RGUI, */ __pyx_t_1 = __Pyx_PyInt_From_int(SDLK_LGUI); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 119; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_K_LMETA, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 75; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "pygame_sdl2/locals.pyx":120 * * K_LMETA = sdl2.SDLK_LGUI, * K_LSUPER = sdl2.SDLK_LGUI, # <<<<<<<<<<<<<< * K_RMETA = sdl2.SDLK_RGUI, * K_RSUPER = sdl2.SDLK_RGUI, */ __pyx_t_1 = __Pyx_PyInt_From_int(SDLK_LGUI); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 120; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_K_LSUPER, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 75; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "pygame_sdl2/locals.pyx":121 * K_LMETA = sdl2.SDLK_LGUI, * K_LSUPER = sdl2.SDLK_LGUI, * K_RMETA = sdl2.SDLK_RGUI, # <<<<<<<<<<<<<< * K_RSUPER = sdl2.SDLK_RGUI, * */ __pyx_t_1 = __Pyx_PyInt_From_int(SDLK_RGUI); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 121; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_K_RMETA, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 75; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "pygame_sdl2/locals.pyx":122 * K_LSUPER = sdl2.SDLK_LGUI, * K_RMETA = sdl2.SDLK_RGUI, * K_RSUPER = sdl2.SDLK_RGUI, # <<<<<<<<<<<<<< * * K_NUMLOCK = sdl2.SDLK_NUMLOCKCLEAR, */ __pyx_t_1 = __Pyx_PyInt_From_int(SDLK_RGUI); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 122; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_K_RSUPER, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 75; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "pygame_sdl2/locals.pyx":124 * K_RSUPER = sdl2.SDLK_RGUI, * * K_NUMLOCK = sdl2.SDLK_NUMLOCKCLEAR, # <<<<<<<<<<<<<< * K_SCROLLOCK = sdl2.SDLK_SCROLLLOCK, * K_PRINT = sdl2.SDLK_PRINTSCREEN, */ __pyx_t_1 = __Pyx_PyInt_From_int(SDLK_NUMLOCKCLEAR); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 124; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_K_NUMLOCK, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 75; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "pygame_sdl2/locals.pyx":125 * * K_NUMLOCK = sdl2.SDLK_NUMLOCKCLEAR, * K_SCROLLOCK = sdl2.SDLK_SCROLLLOCK, # <<<<<<<<<<<<<< * K_PRINT = sdl2.SDLK_PRINTSCREEN, * )) */ __pyx_t_1 = __Pyx_PyInt_From_int(SDLK_SCROLLLOCK); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 125; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_K_SCROLLOCK, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 75; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "pygame_sdl2/locals.pyx":126 * K_NUMLOCK = sdl2.SDLK_NUMLOCKCLEAR, * K_SCROLLOCK = sdl2.SDLK_SCROLLLOCK, * K_PRINT = sdl2.SDLK_PRINTSCREEN, # <<<<<<<<<<<<<< * )) * */ __pyx_t_1 = __Pyx_PyInt_From_int(SDLK_PRINTSCREEN); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 126; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_K_PRINT, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 75; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_1 = NULL; if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_2))) { __pyx_t_1 = PyMethod_GET_SELF(__pyx_t_2); if (likely(__pyx_t_1)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_1); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); } } if (!__pyx_t_1) { __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 74; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_GOTREF(__pyx_t_4); } else { __pyx_t_5 = PyTuple_New(1+1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 74; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); __Pyx_GIVEREF(__pyx_t_1); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_1); __pyx_t_1 = NULL; __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_5, 0+1, __pyx_t_3); __pyx_t_3 = 0; __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_5, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 74; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; } __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; /* "pygame_sdl2/locals.pyx":129 * )) * * TOUCH_MOUSEID = -1 # <<<<<<<<<<<<<< * * include "controller.pxi" */ if (PyDict_SetItem(__pyx_d, __pyx_n_s_TOUCH_MOUSEID, __pyx_int_neg_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 129; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "include/controller.pxi":1 * CONTROLLER_BUTTON_INVALID = SDL_CONTROLLER_BUTTON_INVALID # <<<<<<<<<<<<<< * CONTROLLER_BUTTON_A = SDL_CONTROLLER_BUTTON_A * CONTROLLER_BUTTON_B = SDL_CONTROLLER_BUTTON_B */ __pyx_t_4 = __Pyx_PyInt_From_SDL_GameControllerButton(SDL_CONTROLLER_BUTTON_INVALID); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); if (PyDict_SetItem(__pyx_d, __pyx_n_s_CONTROLLER_BUTTON_INVALID, __pyx_t_4) < 0) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; /* "include/controller.pxi":2 * CONTROLLER_BUTTON_INVALID = SDL_CONTROLLER_BUTTON_INVALID * CONTROLLER_BUTTON_A = SDL_CONTROLLER_BUTTON_A # <<<<<<<<<<<<<< * CONTROLLER_BUTTON_B = SDL_CONTROLLER_BUTTON_B * CONTROLLER_BUTTON_X = SDL_CONTROLLER_BUTTON_X */ __pyx_t_4 = __Pyx_PyInt_From_SDL_GameControllerButton(SDL_CONTROLLER_BUTTON_A); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 2; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); if (PyDict_SetItem(__pyx_d, __pyx_n_s_CONTROLLER_BUTTON_A, __pyx_t_4) < 0) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 2; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; /* "include/controller.pxi":3 * CONTROLLER_BUTTON_INVALID = SDL_CONTROLLER_BUTTON_INVALID * CONTROLLER_BUTTON_A = SDL_CONTROLLER_BUTTON_A * CONTROLLER_BUTTON_B = SDL_CONTROLLER_BUTTON_B # <<<<<<<<<<<<<< * CONTROLLER_BUTTON_X = SDL_CONTROLLER_BUTTON_X * CONTROLLER_BUTTON_Y = SDL_CONTROLLER_BUTTON_Y */ __pyx_t_4 = __Pyx_PyInt_From_SDL_GameControllerButton(SDL_CONTROLLER_BUTTON_B); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 3; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); if (PyDict_SetItem(__pyx_d, __pyx_n_s_CONTROLLER_BUTTON_B, __pyx_t_4) < 0) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 3; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; /* "include/controller.pxi":4 * CONTROLLER_BUTTON_A = SDL_CONTROLLER_BUTTON_A * CONTROLLER_BUTTON_B = SDL_CONTROLLER_BUTTON_B * CONTROLLER_BUTTON_X = SDL_CONTROLLER_BUTTON_X # <<<<<<<<<<<<<< * CONTROLLER_BUTTON_Y = SDL_CONTROLLER_BUTTON_Y * CONTROLLER_BUTTON_BACK = SDL_CONTROLLER_BUTTON_BACK */ __pyx_t_4 = __Pyx_PyInt_From_SDL_GameControllerButton(SDL_CONTROLLER_BUTTON_X); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 4; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); if (PyDict_SetItem(__pyx_d, __pyx_n_s_CONTROLLER_BUTTON_X, __pyx_t_4) < 0) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 4; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; /* "include/controller.pxi":5 * CONTROLLER_BUTTON_B = SDL_CONTROLLER_BUTTON_B * CONTROLLER_BUTTON_X = SDL_CONTROLLER_BUTTON_X * CONTROLLER_BUTTON_Y = SDL_CONTROLLER_BUTTON_Y # <<<<<<<<<<<<<< * CONTROLLER_BUTTON_BACK = SDL_CONTROLLER_BUTTON_BACK * CONTROLLER_BUTTON_GUIDE = SDL_CONTROLLER_BUTTON_GUIDE */ __pyx_t_4 = __Pyx_PyInt_From_SDL_GameControllerButton(SDL_CONTROLLER_BUTTON_Y); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 5; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); if (PyDict_SetItem(__pyx_d, __pyx_n_s_CONTROLLER_BUTTON_Y, __pyx_t_4) < 0) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 5; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; /* "include/controller.pxi":6 * CONTROLLER_BUTTON_X = SDL_CONTROLLER_BUTTON_X * CONTROLLER_BUTTON_Y = SDL_CONTROLLER_BUTTON_Y * CONTROLLER_BUTTON_BACK = SDL_CONTROLLER_BUTTON_BACK # <<<<<<<<<<<<<< * CONTROLLER_BUTTON_GUIDE = SDL_CONTROLLER_BUTTON_GUIDE * CONTROLLER_BUTTON_START = SDL_CONTROLLER_BUTTON_START */ __pyx_t_4 = __Pyx_PyInt_From_SDL_GameControllerButton(SDL_CONTROLLER_BUTTON_BACK); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 6; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); if (PyDict_SetItem(__pyx_d, __pyx_n_s_CONTROLLER_BUTTON_BACK, __pyx_t_4) < 0) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 6; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; /* "include/controller.pxi":7 * CONTROLLER_BUTTON_Y = SDL_CONTROLLER_BUTTON_Y * CONTROLLER_BUTTON_BACK = SDL_CONTROLLER_BUTTON_BACK * CONTROLLER_BUTTON_GUIDE = SDL_CONTROLLER_BUTTON_GUIDE # <<<<<<<<<<<<<< * CONTROLLER_BUTTON_START = SDL_CONTROLLER_BUTTON_START * CONTROLLER_BUTTON_LEFTSTICK = SDL_CONTROLLER_BUTTON_LEFTSTICK */ __pyx_t_4 = __Pyx_PyInt_From_SDL_GameControllerButton(SDL_CONTROLLER_BUTTON_GUIDE); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 7; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); if (PyDict_SetItem(__pyx_d, __pyx_n_s_CONTROLLER_BUTTON_GUIDE, __pyx_t_4) < 0) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 7; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; /* "include/controller.pxi":8 * CONTROLLER_BUTTON_BACK = SDL_CONTROLLER_BUTTON_BACK * CONTROLLER_BUTTON_GUIDE = SDL_CONTROLLER_BUTTON_GUIDE * CONTROLLER_BUTTON_START = SDL_CONTROLLER_BUTTON_START # <<<<<<<<<<<<<< * CONTROLLER_BUTTON_LEFTSTICK = SDL_CONTROLLER_BUTTON_LEFTSTICK * CONTROLLER_BUTTON_RIGHTSTICK = SDL_CONTROLLER_BUTTON_RIGHTSTICK */ __pyx_t_4 = __Pyx_PyInt_From_SDL_GameControllerButton(SDL_CONTROLLER_BUTTON_START); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 8; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); if (PyDict_SetItem(__pyx_d, __pyx_n_s_CONTROLLER_BUTTON_START, __pyx_t_4) < 0) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 8; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; /* "include/controller.pxi":9 * CONTROLLER_BUTTON_GUIDE = SDL_CONTROLLER_BUTTON_GUIDE * CONTROLLER_BUTTON_START = SDL_CONTROLLER_BUTTON_START * CONTROLLER_BUTTON_LEFTSTICK = SDL_CONTROLLER_BUTTON_LEFTSTICK # <<<<<<<<<<<<<< * CONTROLLER_BUTTON_RIGHTSTICK = SDL_CONTROLLER_BUTTON_RIGHTSTICK * CONTROLLER_BUTTON_LEFTSHOULDER = SDL_CONTROLLER_BUTTON_LEFTSHOULDER */ __pyx_t_4 = __Pyx_PyInt_From_SDL_GameControllerButton(SDL_CONTROLLER_BUTTON_LEFTSTICK); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 9; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); if (PyDict_SetItem(__pyx_d, __pyx_n_s_CONTROLLER_BUTTON_LEFTSTICK, __pyx_t_4) < 0) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 9; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; /* "include/controller.pxi":10 * CONTROLLER_BUTTON_START = SDL_CONTROLLER_BUTTON_START * CONTROLLER_BUTTON_LEFTSTICK = SDL_CONTROLLER_BUTTON_LEFTSTICK * CONTROLLER_BUTTON_RIGHTSTICK = SDL_CONTROLLER_BUTTON_RIGHTSTICK # <<<<<<<<<<<<<< * CONTROLLER_BUTTON_LEFTSHOULDER = SDL_CONTROLLER_BUTTON_LEFTSHOULDER * CONTROLLER_BUTTON_RIGHTSHOULDER = SDL_CONTROLLER_BUTTON_RIGHTSHOULDER */ __pyx_t_4 = __Pyx_PyInt_From_SDL_GameControllerButton(SDL_CONTROLLER_BUTTON_RIGHTSTICK); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 10; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); if (PyDict_SetItem(__pyx_d, __pyx_n_s_CONTROLLER_BUTTON_RIGHTSTICK, __pyx_t_4) < 0) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 10; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; /* "include/controller.pxi":11 * CONTROLLER_BUTTON_LEFTSTICK = SDL_CONTROLLER_BUTTON_LEFTSTICK * CONTROLLER_BUTTON_RIGHTSTICK = SDL_CONTROLLER_BUTTON_RIGHTSTICK * CONTROLLER_BUTTON_LEFTSHOULDER = SDL_CONTROLLER_BUTTON_LEFTSHOULDER # <<<<<<<<<<<<<< * CONTROLLER_BUTTON_RIGHTSHOULDER = SDL_CONTROLLER_BUTTON_RIGHTSHOULDER * CONTROLLER_BUTTON_DPAD_UP = SDL_CONTROLLER_BUTTON_DPAD_UP */ __pyx_t_4 = __Pyx_PyInt_From_SDL_GameControllerButton(SDL_CONTROLLER_BUTTON_LEFTSHOULDER); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 11; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); if (PyDict_SetItem(__pyx_d, __pyx_n_s_CONTROLLER_BUTTON_LEFTSHOULDER, __pyx_t_4) < 0) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 11; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; /* "include/controller.pxi":12 * CONTROLLER_BUTTON_RIGHTSTICK = SDL_CONTROLLER_BUTTON_RIGHTSTICK * CONTROLLER_BUTTON_LEFTSHOULDER = SDL_CONTROLLER_BUTTON_LEFTSHOULDER * CONTROLLER_BUTTON_RIGHTSHOULDER = SDL_CONTROLLER_BUTTON_RIGHTSHOULDER # <<<<<<<<<<<<<< * CONTROLLER_BUTTON_DPAD_UP = SDL_CONTROLLER_BUTTON_DPAD_UP * CONTROLLER_BUTTON_DPAD_DOWN = SDL_CONTROLLER_BUTTON_DPAD_DOWN */ __pyx_t_4 = __Pyx_PyInt_From_SDL_GameControllerButton(SDL_CONTROLLER_BUTTON_RIGHTSHOULDER); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 12; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); if (PyDict_SetItem(__pyx_d, __pyx_n_s_CONTROLLER_BUTTON_RIGHTSHOULDER, __pyx_t_4) < 0) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 12; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; /* "include/controller.pxi":13 * CONTROLLER_BUTTON_LEFTSHOULDER = SDL_CONTROLLER_BUTTON_LEFTSHOULDER * CONTROLLER_BUTTON_RIGHTSHOULDER = SDL_CONTROLLER_BUTTON_RIGHTSHOULDER * CONTROLLER_BUTTON_DPAD_UP = SDL_CONTROLLER_BUTTON_DPAD_UP # <<<<<<<<<<<<<< * CONTROLLER_BUTTON_DPAD_DOWN = SDL_CONTROLLER_BUTTON_DPAD_DOWN * CONTROLLER_BUTTON_DPAD_LEFT = SDL_CONTROLLER_BUTTON_DPAD_LEFT */ __pyx_t_4 = __Pyx_PyInt_From_SDL_GameControllerButton(SDL_CONTROLLER_BUTTON_DPAD_UP); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 13; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); if (PyDict_SetItem(__pyx_d, __pyx_n_s_CONTROLLER_BUTTON_DPAD_UP, __pyx_t_4) < 0) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 13; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; /* "include/controller.pxi":14 * CONTROLLER_BUTTON_RIGHTSHOULDER = SDL_CONTROLLER_BUTTON_RIGHTSHOULDER * CONTROLLER_BUTTON_DPAD_UP = SDL_CONTROLLER_BUTTON_DPAD_UP * CONTROLLER_BUTTON_DPAD_DOWN = SDL_CONTROLLER_BUTTON_DPAD_DOWN # <<<<<<<<<<<<<< * CONTROLLER_BUTTON_DPAD_LEFT = SDL_CONTROLLER_BUTTON_DPAD_LEFT * CONTROLLER_BUTTON_DPAD_RIGHT = SDL_CONTROLLER_BUTTON_DPAD_RIGHT */ __pyx_t_4 = __Pyx_PyInt_From_SDL_GameControllerButton(SDL_CONTROLLER_BUTTON_DPAD_DOWN); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 14; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); if (PyDict_SetItem(__pyx_d, __pyx_n_s_CONTROLLER_BUTTON_DPAD_DOWN, __pyx_t_4) < 0) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 14; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; /* "include/controller.pxi":15 * CONTROLLER_BUTTON_DPAD_UP = SDL_CONTROLLER_BUTTON_DPAD_UP * CONTROLLER_BUTTON_DPAD_DOWN = SDL_CONTROLLER_BUTTON_DPAD_DOWN * CONTROLLER_BUTTON_DPAD_LEFT = SDL_CONTROLLER_BUTTON_DPAD_LEFT # <<<<<<<<<<<<<< * CONTROLLER_BUTTON_DPAD_RIGHT = SDL_CONTROLLER_BUTTON_DPAD_RIGHT * CONTROLLER_BUTTON_MAX = SDL_CONTROLLER_BUTTON_MAX */ __pyx_t_4 = __Pyx_PyInt_From_SDL_GameControllerButton(SDL_CONTROLLER_BUTTON_DPAD_LEFT); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 15; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); if (PyDict_SetItem(__pyx_d, __pyx_n_s_CONTROLLER_BUTTON_DPAD_LEFT, __pyx_t_4) < 0) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 15; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; /* "include/controller.pxi":16 * CONTROLLER_BUTTON_DPAD_DOWN = SDL_CONTROLLER_BUTTON_DPAD_DOWN * CONTROLLER_BUTTON_DPAD_LEFT = SDL_CONTROLLER_BUTTON_DPAD_LEFT * CONTROLLER_BUTTON_DPAD_RIGHT = SDL_CONTROLLER_BUTTON_DPAD_RIGHT # <<<<<<<<<<<<<< * CONTROLLER_BUTTON_MAX = SDL_CONTROLLER_BUTTON_MAX * CONTROLLER_AXIS_INVALID = SDL_CONTROLLER_AXIS_INVALID */ __pyx_t_4 = __Pyx_PyInt_From_SDL_GameControllerButton(SDL_CONTROLLER_BUTTON_DPAD_RIGHT); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 16; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); if (PyDict_SetItem(__pyx_d, __pyx_n_s_CONTROLLER_BUTTON_DPAD_RIGHT, __pyx_t_4) < 0) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 16; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; /* "include/controller.pxi":17 * CONTROLLER_BUTTON_DPAD_LEFT = SDL_CONTROLLER_BUTTON_DPAD_LEFT * CONTROLLER_BUTTON_DPAD_RIGHT = SDL_CONTROLLER_BUTTON_DPAD_RIGHT * CONTROLLER_BUTTON_MAX = SDL_CONTROLLER_BUTTON_MAX # <<<<<<<<<<<<<< * CONTROLLER_AXIS_INVALID = SDL_CONTROLLER_AXIS_INVALID * CONTROLLER_AXIS_LEFTX = SDL_CONTROLLER_AXIS_LEFTX */ __pyx_t_4 = __Pyx_PyInt_From_SDL_GameControllerButton(SDL_CONTROLLER_BUTTON_MAX); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 17; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); if (PyDict_SetItem(__pyx_d, __pyx_n_s_CONTROLLER_BUTTON_MAX, __pyx_t_4) < 0) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 17; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; /* "include/controller.pxi":18 * CONTROLLER_BUTTON_DPAD_RIGHT = SDL_CONTROLLER_BUTTON_DPAD_RIGHT * CONTROLLER_BUTTON_MAX = SDL_CONTROLLER_BUTTON_MAX * CONTROLLER_AXIS_INVALID = SDL_CONTROLLER_AXIS_INVALID # <<<<<<<<<<<<<< * CONTROLLER_AXIS_LEFTX = SDL_CONTROLLER_AXIS_LEFTX * CONTROLLER_AXIS_LEFTY = SDL_CONTROLLER_AXIS_LEFTY */ __pyx_t_4 = __Pyx_PyInt_From_SDL_GameControllerAxis(SDL_CONTROLLER_AXIS_INVALID); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 18; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); if (PyDict_SetItem(__pyx_d, __pyx_n_s_CONTROLLER_AXIS_INVALID, __pyx_t_4) < 0) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 18; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; /* "include/controller.pxi":19 * CONTROLLER_BUTTON_MAX = SDL_CONTROLLER_BUTTON_MAX * CONTROLLER_AXIS_INVALID = SDL_CONTROLLER_AXIS_INVALID * CONTROLLER_AXIS_LEFTX = SDL_CONTROLLER_AXIS_LEFTX # <<<<<<<<<<<<<< * CONTROLLER_AXIS_LEFTY = SDL_CONTROLLER_AXIS_LEFTY * CONTROLLER_AXIS_RIGHTX = SDL_CONTROLLER_AXIS_RIGHTX */ __pyx_t_4 = __Pyx_PyInt_From_SDL_GameControllerAxis(SDL_CONTROLLER_AXIS_LEFTX); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 19; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); if (PyDict_SetItem(__pyx_d, __pyx_n_s_CONTROLLER_AXIS_LEFTX, __pyx_t_4) < 0) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 19; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; /* "include/controller.pxi":20 * CONTROLLER_AXIS_INVALID = SDL_CONTROLLER_AXIS_INVALID * CONTROLLER_AXIS_LEFTX = SDL_CONTROLLER_AXIS_LEFTX * CONTROLLER_AXIS_LEFTY = SDL_CONTROLLER_AXIS_LEFTY # <<<<<<<<<<<<<< * CONTROLLER_AXIS_RIGHTX = SDL_CONTROLLER_AXIS_RIGHTX * CONTROLLER_AXIS_RIGHTY = SDL_CONTROLLER_AXIS_RIGHTY */ __pyx_t_4 = __Pyx_PyInt_From_SDL_GameControllerAxis(SDL_CONTROLLER_AXIS_LEFTY); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 20; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); if (PyDict_SetItem(__pyx_d, __pyx_n_s_CONTROLLER_AXIS_LEFTY, __pyx_t_4) < 0) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 20; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; /* "include/controller.pxi":21 * CONTROLLER_AXIS_LEFTX = SDL_CONTROLLER_AXIS_LEFTX * CONTROLLER_AXIS_LEFTY = SDL_CONTROLLER_AXIS_LEFTY * CONTROLLER_AXIS_RIGHTX = SDL_CONTROLLER_AXIS_RIGHTX # <<<<<<<<<<<<<< * CONTROLLER_AXIS_RIGHTY = SDL_CONTROLLER_AXIS_RIGHTY * CONTROLLER_AXIS_TRIGGERLEFT = SDL_CONTROLLER_AXIS_TRIGGERLEFT */ __pyx_t_4 = __Pyx_PyInt_From_SDL_GameControllerAxis(SDL_CONTROLLER_AXIS_RIGHTX); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 21; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); if (PyDict_SetItem(__pyx_d, __pyx_n_s_CONTROLLER_AXIS_RIGHTX, __pyx_t_4) < 0) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 21; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; /* "include/controller.pxi":22 * CONTROLLER_AXIS_LEFTY = SDL_CONTROLLER_AXIS_LEFTY * CONTROLLER_AXIS_RIGHTX = SDL_CONTROLLER_AXIS_RIGHTX * CONTROLLER_AXIS_RIGHTY = SDL_CONTROLLER_AXIS_RIGHTY # <<<<<<<<<<<<<< * CONTROLLER_AXIS_TRIGGERLEFT = SDL_CONTROLLER_AXIS_TRIGGERLEFT * CONTROLLER_AXIS_TRIGGERRIGHT = SDL_CONTROLLER_AXIS_TRIGGERRIGHT */ __pyx_t_4 = __Pyx_PyInt_From_SDL_GameControllerAxis(SDL_CONTROLLER_AXIS_RIGHTY); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 22; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); if (PyDict_SetItem(__pyx_d, __pyx_n_s_CONTROLLER_AXIS_RIGHTY, __pyx_t_4) < 0) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 22; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; /* "include/controller.pxi":23 * CONTROLLER_AXIS_RIGHTX = SDL_CONTROLLER_AXIS_RIGHTX * CONTROLLER_AXIS_RIGHTY = SDL_CONTROLLER_AXIS_RIGHTY * CONTROLLER_AXIS_TRIGGERLEFT = SDL_CONTROLLER_AXIS_TRIGGERLEFT # <<<<<<<<<<<<<< * CONTROLLER_AXIS_TRIGGERRIGHT = SDL_CONTROLLER_AXIS_TRIGGERRIGHT * CONTROLLER_AXIS_MAX = SDL_CONTROLLER_AXIS_MAX */ __pyx_t_4 = __Pyx_PyInt_From_SDL_GameControllerAxis(SDL_CONTROLLER_AXIS_TRIGGERLEFT); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 23; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); if (PyDict_SetItem(__pyx_d, __pyx_n_s_CONTROLLER_AXIS_TRIGGERLEFT, __pyx_t_4) < 0) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 23; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; /* "include/controller.pxi":24 * CONTROLLER_AXIS_RIGHTY = SDL_CONTROLLER_AXIS_RIGHTY * CONTROLLER_AXIS_TRIGGERLEFT = SDL_CONTROLLER_AXIS_TRIGGERLEFT * CONTROLLER_AXIS_TRIGGERRIGHT = SDL_CONTROLLER_AXIS_TRIGGERRIGHT # <<<<<<<<<<<<<< * CONTROLLER_AXIS_MAX = SDL_CONTROLLER_AXIS_MAX */ __pyx_t_4 = __Pyx_PyInt_From_SDL_GameControllerAxis(SDL_CONTROLLER_AXIS_TRIGGERRIGHT); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 24; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); if (PyDict_SetItem(__pyx_d, __pyx_n_s_CONTROLLER_AXIS_TRIGGERRIGHT, __pyx_t_4) < 0) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 24; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; /* "include/controller.pxi":25 * CONTROLLER_AXIS_TRIGGERLEFT = SDL_CONTROLLER_AXIS_TRIGGERLEFT * CONTROLLER_AXIS_TRIGGERRIGHT = SDL_CONTROLLER_AXIS_TRIGGERRIGHT * CONTROLLER_AXIS_MAX = SDL_CONTROLLER_AXIS_MAX # <<<<<<<<<<<<<< */ __pyx_t_4 = __Pyx_PyInt_From_SDL_GameControllerAxis(SDL_CONTROLLER_AXIS_MAX); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 25; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); if (PyDict_SetItem(__pyx_d, __pyx_n_s_CONTROLLER_AXIS_MAX, __pyx_t_4) < 0) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 25; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; /* "pygame_sdl2/locals.pyx":133 * include "controller.pxi" * * POWERSTATE_UNKNOWN = SDL_POWERSTATE_UNKNOWN # <<<<<<<<<<<<<< * POWERSTATE_ON_BATTERY = SDL_POWERSTATE_ON_BATTERY * POWERSTATE_NO_BATTERY = SDL_POWERSTATE_NO_BATTERY */ __pyx_t_4 = __Pyx_PyInt_From_SDL_PowerState(SDL_POWERSTATE_UNKNOWN); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 133; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); if (PyDict_SetItem(__pyx_d, __pyx_n_s_POWERSTATE_UNKNOWN, __pyx_t_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 133; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; /* "pygame_sdl2/locals.pyx":134 * * POWERSTATE_UNKNOWN = SDL_POWERSTATE_UNKNOWN * POWERSTATE_ON_BATTERY = SDL_POWERSTATE_ON_BATTERY # <<<<<<<<<<<<<< * POWERSTATE_NO_BATTERY = SDL_POWERSTATE_NO_BATTERY * POWERSTATE_CHARGING = SDL_POWERSTATE_CHARGING */ __pyx_t_4 = __Pyx_PyInt_From_SDL_PowerState(SDL_POWERSTATE_ON_BATTERY); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 134; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); if (PyDict_SetItem(__pyx_d, __pyx_n_s_POWERSTATE_ON_BATTERY, __pyx_t_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 134; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; /* "pygame_sdl2/locals.pyx":135 * POWERSTATE_UNKNOWN = SDL_POWERSTATE_UNKNOWN * POWERSTATE_ON_BATTERY = SDL_POWERSTATE_ON_BATTERY * POWERSTATE_NO_BATTERY = SDL_POWERSTATE_NO_BATTERY # <<<<<<<<<<<<<< * POWERSTATE_CHARGING = SDL_POWERSTATE_CHARGING * POWERSTATE_CHARGED = SDL_POWERSTATE_CHARGED */ __pyx_t_4 = __Pyx_PyInt_From_SDL_PowerState(SDL_POWERSTATE_NO_BATTERY); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 135; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); if (PyDict_SetItem(__pyx_d, __pyx_n_s_POWERSTATE_NO_BATTERY, __pyx_t_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 135; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; /* "pygame_sdl2/locals.pyx":136 * POWERSTATE_ON_BATTERY = SDL_POWERSTATE_ON_BATTERY * POWERSTATE_NO_BATTERY = SDL_POWERSTATE_NO_BATTERY * POWERSTATE_CHARGING = SDL_POWERSTATE_CHARGING # <<<<<<<<<<<<<< * POWERSTATE_CHARGED = SDL_POWERSTATE_CHARGED * */ __pyx_t_4 = __Pyx_PyInt_From_SDL_PowerState(SDL_POWERSTATE_CHARGING); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 136; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); if (PyDict_SetItem(__pyx_d, __pyx_n_s_POWERSTATE_CHARGING, __pyx_t_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 136; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; /* "pygame_sdl2/locals.pyx":137 * POWERSTATE_NO_BATTERY = SDL_POWERSTATE_NO_BATTERY * POWERSTATE_CHARGING = SDL_POWERSTATE_CHARGING * POWERSTATE_CHARGED = SDL_POWERSTATE_CHARGED # <<<<<<<<<<<<<< * */ __pyx_t_4 = __Pyx_PyInt_From_SDL_PowerState(SDL_POWERSTATE_CHARGED); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 137; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); if (PyDict_SetItem(__pyx_d, __pyx_n_s_POWERSTATE_CHARGED, __pyx_t_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 137; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; /* "pygame_sdl2/locals.pyx":1 * from sdl2 cimport * # <<<<<<<<<<<<<< * cimport sdl2 * */ __pyx_t_4 = PyDict_New(); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); if (PyDict_SetItem(__pyx_d, __pyx_n_s_test, __pyx_t_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; /*--- Wrapped vars code ---*/ goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_5); if (__pyx_m) { if (__pyx_d) { __Pyx_AddTraceback("init pygame_sdl2.locals", __pyx_clineno, __pyx_lineno, __pyx_filename); } Py_DECREF(__pyx_m); __pyx_m = 0; } else if (!PyErr_Occurred()) { PyErr_SetString(PyExc_ImportError, "init pygame_sdl2.locals"); } __pyx_L0:; __Pyx_RefNannyFinishContext(); #if PY_MAJOR_VERSION < 3 return; #else return __pyx_m; #endif } /* --- Runtime support code --- */ #if CYTHON_REFNANNY static __Pyx_RefNannyAPIStruct *__Pyx_RefNannyImportAPI(const char *modname) { PyObject *m = NULL, *p = NULL; void *r = NULL; m = PyImport_ImportModule((char *)modname); if (!m) goto end; p = PyObject_GetAttrString(m, (char *)"RefNannyAPI"); if (!p) goto end; r = PyLong_AsVoidPtr(p); end: Py_XDECREF(p); Py_XDECREF(m); return (__Pyx_RefNannyAPIStruct *)r; } #endif static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list, int level) { PyObject *empty_list = 0; PyObject *module = 0; PyObject *global_dict = 0; PyObject *empty_dict = 0; PyObject *list; #if PY_VERSION_HEX < 0x03030000 PyObject *py_import; py_import = __Pyx_PyObject_GetAttrStr(__pyx_b, __pyx_n_s_import); if (!py_import) goto bad; #endif if (from_list) list = from_list; else { empty_list = PyList_New(0); if (!empty_list) goto bad; list = empty_list; } global_dict = PyModule_GetDict(__pyx_m); if (!global_dict) goto bad; empty_dict = PyDict_New(); if (!empty_dict) goto bad; { #if PY_MAJOR_VERSION >= 3 if (level == -1) { if (strchr(__Pyx_MODULE_NAME, '.')) { #if PY_VERSION_HEX < 0x03030000 PyObject *py_level = PyInt_FromLong(1); if (!py_level) goto bad; module = PyObject_CallFunctionObjArgs(py_import, name, global_dict, empty_dict, list, py_level, NULL); Py_DECREF(py_level); #else module = PyImport_ImportModuleLevelObject( name, global_dict, empty_dict, list, 1); #endif if (!module) { if (!PyErr_ExceptionMatches(PyExc_ImportError)) goto bad; PyErr_Clear(); } } level = 0; } #endif if (!module) { #if PY_VERSION_HEX < 0x03030000 PyObject *py_level = PyInt_FromLong(level); if (!py_level) goto bad; module = PyObject_CallFunctionObjArgs(py_import, name, global_dict, empty_dict, list, py_level, NULL); Py_DECREF(py_level); #else module = PyImport_ImportModuleLevelObject( name, global_dict, empty_dict, list, level); #endif } } bad: #if PY_VERSION_HEX < 0x03030000 Py_XDECREF(py_import); #endif Py_XDECREF(empty_list); Py_XDECREF(empty_dict); return module; } static PyObject* __Pyx_ImportFrom(PyObject* module, PyObject* name) { PyObject* value = __Pyx_PyObject_GetAttrStr(module, name); if (unlikely(!value) && PyErr_ExceptionMatches(PyExc_AttributeError)) { PyErr_Format(PyExc_ImportError, #if PY_MAJOR_VERSION < 3 "cannot import name %.230s", PyString_AS_STRING(name)); #else "cannot import name %S", name); #endif } return value; } static CYTHON_INLINE PyObject *__Pyx_GetAttr(PyObject *o, PyObject *n) { #if CYTHON_COMPILING_IN_CPYTHON #if PY_MAJOR_VERSION >= 3 if (likely(PyUnicode_Check(n))) #else if (likely(PyString_Check(n))) #endif return __Pyx_PyObject_GetAttrStr(o, n); #endif return PyObject_GetAttr(o, n); } static PyObject* __Pyx_Globals(void) { Py_ssize_t i; PyObject *names; PyObject *globals = __pyx_d; Py_INCREF(globals); names = PyObject_Dir(__pyx_m); if (!names) goto bad; for (i = PyList_GET_SIZE(names)-1; i >= 0; i--) { #if CYTHON_COMPILING_IN_PYPY PyObject* name = PySequence_ITEM(names, i); if (!name) goto bad; #else PyObject* name = PyList_GET_ITEM(names, i); #endif if (!PyDict_Contains(globals, name)) { PyObject* value = __Pyx_GetAttr(__pyx_m, name); if (!value) { #if CYTHON_COMPILING_IN_PYPY Py_DECREF(name); #endif goto bad; } if (PyDict_SetItem(globals, name, value) < 0) { #if CYTHON_COMPILING_IN_PYPY Py_DECREF(name); #endif Py_DECREF(value); goto bad; } } #if CYTHON_COMPILING_IN_PYPY Py_DECREF(name); #endif } Py_DECREF(names); return globals; bad: Py_XDECREF(names); Py_XDECREF(globals); return NULL; } #if CYTHON_COMPILING_IN_CPYTHON static CYTHON_INLINE PyObject* __Pyx_PyObject_Call(PyObject *func, PyObject *arg, PyObject *kw) { PyObject *result; ternaryfunc call = func->ob_type->tp_call; if (unlikely(!call)) return PyObject_Call(func, arg, kw); if (unlikely(Py_EnterRecursiveCall((char*)" while calling a Python object"))) return NULL; result = (*call)(func, arg, kw); Py_LeaveRecursiveCall(); if (unlikely(!result) && unlikely(!PyErr_Occurred())) { PyErr_SetString( PyExc_SystemError, "NULL result without error in PyObject_Call"); } return result; } #endif #if CYTHON_COMPILING_IN_CPYTHON static CYTHON_INLINE PyObject* __Pyx_PyObject_CallMethO(PyObject *func, PyObject *arg) { PyObject *self, *result; PyCFunction cfunc; cfunc = PyCFunction_GET_FUNCTION(func); self = PyCFunction_GET_SELF(func); if (unlikely(Py_EnterRecursiveCall((char*)" while calling a Python object"))) return NULL; result = cfunc(self, arg); Py_LeaveRecursiveCall(); if (unlikely(!result) && unlikely(!PyErr_Occurred())) { PyErr_SetString( PyExc_SystemError, "NULL result without error in PyObject_Call"); } return result; } #endif #if CYTHON_COMPILING_IN_CPYTHON static PyObject* __Pyx__PyObject_CallOneArg(PyObject *func, PyObject *arg) { PyObject *result; PyObject *args = PyTuple_New(1); if (unlikely(!args)) return NULL; Py_INCREF(arg); PyTuple_SET_ITEM(args, 0, arg); result = __Pyx_PyObject_Call(func, args, NULL); Py_DECREF(args); return result; } static CYTHON_INLINE PyObject* __Pyx_PyObject_CallOneArg(PyObject *func, PyObject *arg) { #ifdef __Pyx_CyFunction_USED if (likely(PyCFunction_Check(func) || PyObject_TypeCheck(func, __pyx_CyFunctionType))) { #else if (likely(PyCFunction_Check(func))) { #endif if (likely(PyCFunction_GET_FLAGS(func) & METH_O)) { return __Pyx_PyObject_CallMethO(func, arg); } } return __Pyx__PyObject_CallOneArg(func, arg); } #else static CYTHON_INLINE PyObject* __Pyx_PyObject_CallOneArg(PyObject *func, PyObject *arg) { PyObject *result; PyObject *args = PyTuple_Pack(1, arg); if (unlikely(!args)) return NULL; result = __Pyx_PyObject_Call(func, args, NULL); Py_DECREF(args); return result; } #endif static int __pyx_bisect_code_objects(__Pyx_CodeObjectCacheEntry* entries, int count, int code_line) { int start = 0, mid = 0, end = count - 1; if (end >= 0 && code_line > entries[end].code_line) { return count; } while (start < end) { mid = start + (end - start) / 2; if (code_line < entries[mid].code_line) { end = mid; } else if (code_line > entries[mid].code_line) { start = mid + 1; } else { return mid; } } if (code_line <= entries[mid].code_line) { return mid; } else { return mid + 1; } } static PyCodeObject *__pyx_find_code_object(int code_line) { PyCodeObject* code_object; int pos; if (unlikely(!code_line) || unlikely(!__pyx_code_cache.entries)) { return NULL; } pos = __pyx_bisect_code_objects(__pyx_code_cache.entries, __pyx_code_cache.count, code_line); if (unlikely(pos >= __pyx_code_cache.count) || unlikely(__pyx_code_cache.entries[pos].code_line != code_line)) { return NULL; } code_object = __pyx_code_cache.entries[pos].code_object; Py_INCREF(code_object); return code_object; } static void __pyx_insert_code_object(int code_line, PyCodeObject* code_object) { int pos, i; __Pyx_CodeObjectCacheEntry* entries = __pyx_code_cache.entries; if (unlikely(!code_line)) { return; } if (unlikely(!entries)) { entries = (__Pyx_CodeObjectCacheEntry*)PyMem_Malloc(64*sizeof(__Pyx_CodeObjectCacheEntry)); if (likely(entries)) { __pyx_code_cache.entries = entries; __pyx_code_cache.max_count = 64; __pyx_code_cache.count = 1; entries[0].code_line = code_line; entries[0].code_object = code_object; Py_INCREF(code_object); } return; } pos = __pyx_bisect_code_objects(__pyx_code_cache.entries, __pyx_code_cache.count, code_line); if ((pos < __pyx_code_cache.count) && unlikely(__pyx_code_cache.entries[pos].code_line == code_line)) { PyCodeObject* tmp = entries[pos].code_object; entries[pos].code_object = code_object; Py_DECREF(tmp); return; } if (__pyx_code_cache.count == __pyx_code_cache.max_count) { int new_max = __pyx_code_cache.max_count + 64; entries = (__Pyx_CodeObjectCacheEntry*)PyMem_Realloc( __pyx_code_cache.entries, (size_t)new_max*sizeof(__Pyx_CodeObjectCacheEntry)); if (unlikely(!entries)) { return; } __pyx_code_cache.entries = entries; __pyx_code_cache.max_count = new_max; } for (i=__pyx_code_cache.count; i>pos; i--) { entries[i] = entries[i-1]; } entries[pos].code_line = code_line; entries[pos].code_object = code_object; __pyx_code_cache.count++; Py_INCREF(code_object); } #include "compile.h" #include "frameobject.h" #include "traceback.h" static PyCodeObject* __Pyx_CreateCodeObjectForTraceback( const char *funcname, int c_line, int py_line, const char *filename) { PyCodeObject *py_code = 0; PyObject *py_srcfile = 0; PyObject *py_funcname = 0; #if PY_MAJOR_VERSION < 3 py_srcfile = PyString_FromString(filename); #else py_srcfile = PyUnicode_FromString(filename); #endif if (!py_srcfile) goto bad; if (c_line) { #if PY_MAJOR_VERSION < 3 py_funcname = PyString_FromFormat( "%s (%s:%d)", funcname, __pyx_cfilenm, c_line); #else py_funcname = PyUnicode_FromFormat( "%s (%s:%d)", funcname, __pyx_cfilenm, c_line); #endif } else { #if PY_MAJOR_VERSION < 3 py_funcname = PyString_FromString(funcname); #else py_funcname = PyUnicode_FromString(funcname); #endif } if (!py_funcname) goto bad; py_code = __Pyx_PyCode_New( 0, 0, 0, 0, 0, __pyx_empty_bytes, /*PyObject *code,*/ __pyx_empty_tuple, /*PyObject *consts,*/ __pyx_empty_tuple, /*PyObject *names,*/ __pyx_empty_tuple, /*PyObject *varnames,*/ __pyx_empty_tuple, /*PyObject *freevars,*/ __pyx_empty_tuple, /*PyObject *cellvars,*/ py_srcfile, /*PyObject *filename,*/ py_funcname, /*PyObject *name,*/ py_line, __pyx_empty_bytes /*PyObject *lnotab*/ ); Py_DECREF(py_srcfile); Py_DECREF(py_funcname); return py_code; bad: Py_XDECREF(py_srcfile); Py_XDECREF(py_funcname); return NULL; } static void __Pyx_AddTraceback(const char *funcname, int c_line, int py_line, const char *filename) { PyCodeObject *py_code = 0; PyFrameObject *py_frame = 0; py_code = __pyx_find_code_object(c_line ? c_line : py_line); if (!py_code) { py_code = __Pyx_CreateCodeObjectForTraceback( funcname, c_line, py_line, filename); if (!py_code) goto bad; __pyx_insert_code_object(c_line ? c_line : py_line, py_code); } py_frame = PyFrame_New( PyThreadState_GET(), /*PyThreadState *tstate,*/ py_code, /*PyCodeObject *code,*/ __pyx_d, /*PyObject *globals,*/ 0 /*PyObject *locals*/ ); if (!py_frame) goto bad; py_frame->f_lineno = py_line; PyTraceBack_Here(py_frame); bad: Py_XDECREF(py_code); Py_XDECREF(py_frame); } static CYTHON_INLINE PyObject* __Pyx_PyInt_From_SDL_EventType(SDL_EventType value) { const SDL_EventType neg_one = (SDL_EventType) -1, const_zero = (SDL_EventType) 0; const int is_unsigned = neg_one > const_zero; if (is_unsigned) { if (sizeof(SDL_EventType) < sizeof(long)) { return PyInt_FromLong((long) value); } else if (sizeof(SDL_EventType) <= sizeof(unsigned long)) { return PyLong_FromUnsignedLong((unsigned long) value); } else if (sizeof(SDL_EventType) <= sizeof(unsigned PY_LONG_LONG)) { return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value); } } else { if (sizeof(SDL_EventType) <= sizeof(long)) { return PyInt_FromLong((long) value); } else if (sizeof(SDL_EventType) <= sizeof(PY_LONG_LONG)) { return PyLong_FromLongLong((PY_LONG_LONG) value); } } { int one = 1; int little = (int)*(unsigned char *)&one; unsigned char *bytes = (unsigned char *)&value; return _PyLong_FromByteArray(bytes, sizeof(SDL_EventType), little, !is_unsigned); } } static CYTHON_INLINE PyObject* __Pyx_PyInt_From_long(long value) { const long neg_one = (long) -1, const_zero = (long) 0; const int is_unsigned = neg_one > const_zero; if (is_unsigned) { if (sizeof(long) < sizeof(long)) { return PyInt_FromLong((long) value); } else if (sizeof(long) <= sizeof(unsigned long)) { return PyLong_FromUnsignedLong((unsigned long) value); } else if (sizeof(long) <= sizeof(unsigned PY_LONG_LONG)) { return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value); } } else { if (sizeof(long) <= sizeof(long)) { return PyInt_FromLong((long) value); } else if (sizeof(long) <= sizeof(PY_LONG_LONG)) { return PyLong_FromLongLong((PY_LONG_LONG) value); } } { int one = 1; int little = (int)*(unsigned char *)&one; unsigned char *bytes = (unsigned char *)&value; return _PyLong_FromByteArray(bytes, sizeof(long), little, !is_unsigned); } } static CYTHON_INLINE PyObject* __Pyx_PyInt_From_int(int value) { const int neg_one = (int) -1, const_zero = (int) 0; const int is_unsigned = neg_one > const_zero; if (is_unsigned) { if (sizeof(int) < sizeof(long)) { return PyInt_FromLong((long) value); } else if (sizeof(int) <= sizeof(unsigned long)) { return PyLong_FromUnsignedLong((unsigned long) value); } else if (sizeof(int) <= sizeof(unsigned PY_LONG_LONG)) { return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value); } } else { if (sizeof(int) <= sizeof(long)) { return PyInt_FromLong((long) value); } else if (sizeof(int) <= sizeof(PY_LONG_LONG)) { return PyLong_FromLongLong((PY_LONG_LONG) value); } } { int one = 1; int little = (int)*(unsigned char *)&one; unsigned char *bytes = (unsigned char *)&value; return _PyLong_FromByteArray(bytes, sizeof(int), little, !is_unsigned); } } static CYTHON_INLINE PyObject* __Pyx_PyInt_From_SDL_GLattr(SDL_GLattr value) { const SDL_GLattr neg_one = (SDL_GLattr) -1, const_zero = (SDL_GLattr) 0; const int is_unsigned = neg_one > const_zero; if (is_unsigned) { if (sizeof(SDL_GLattr) < sizeof(long)) { return PyInt_FromLong((long) value); } else if (sizeof(SDL_GLattr) <= sizeof(unsigned long)) { return PyLong_FromUnsignedLong((unsigned long) value); } else if (sizeof(SDL_GLattr) <= sizeof(unsigned PY_LONG_LONG)) { return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value); } } else { if (sizeof(SDL_GLattr) <= sizeof(long)) { return PyInt_FromLong((long) value); } else if (sizeof(SDL_GLattr) <= sizeof(PY_LONG_LONG)) { return PyLong_FromLongLong((PY_LONG_LONG) value); } } { int one = 1; int little = (int)*(unsigned char *)&one; unsigned char *bytes = (unsigned char *)&value; return _PyLong_FromByteArray(bytes, sizeof(SDL_GLattr), little, !is_unsigned); } } static CYTHON_INLINE PyObject* __Pyx_PyInt_From_SDL_WindowFlags(SDL_WindowFlags value) { const SDL_WindowFlags neg_one = (SDL_WindowFlags) -1, const_zero = (SDL_WindowFlags) 0; const int is_unsigned = neg_one > const_zero; if (is_unsigned) { if (sizeof(SDL_WindowFlags) < sizeof(long)) { return PyInt_FromLong((long) value); } else if (sizeof(SDL_WindowFlags) <= sizeof(unsigned long)) { return PyLong_FromUnsignedLong((unsigned long) value); } else if (sizeof(SDL_WindowFlags) <= sizeof(unsigned PY_LONG_LONG)) { return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value); } } else { if (sizeof(SDL_WindowFlags) <= sizeof(long)) { return PyInt_FromLong((long) value); } else if (sizeof(SDL_WindowFlags) <= sizeof(PY_LONG_LONG)) { return PyLong_FromLongLong((PY_LONG_LONG) value); } } { int one = 1; int little = (int)*(unsigned char *)&one; unsigned char *bytes = (unsigned char *)&value; return _PyLong_FromByteArray(bytes, sizeof(SDL_WindowFlags), little, !is_unsigned); } } static CYTHON_INLINE PyObject* __Pyx_PyInt_From_SDL_Keymod(SDL_Keymod value) { const SDL_Keymod neg_one = (SDL_Keymod) -1, const_zero = (SDL_Keymod) 0; const int is_unsigned = neg_one > const_zero; if (is_unsigned) { if (sizeof(SDL_Keymod) < sizeof(long)) { return PyInt_FromLong((long) value); } else if (sizeof(SDL_Keymod) <= sizeof(unsigned long)) { return PyLong_FromUnsignedLong((unsigned long) value); } else if (sizeof(SDL_Keymod) <= sizeof(unsigned PY_LONG_LONG)) { return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value); } } else { if (sizeof(SDL_Keymod) <= sizeof(long)) { return PyInt_FromLong((long) value); } else if (sizeof(SDL_Keymod) <= sizeof(PY_LONG_LONG)) { return PyLong_FromLongLong((PY_LONG_LONG) value); } } { int one = 1; int little = (int)*(unsigned char *)&one; unsigned char *bytes = (unsigned char *)&value; return _PyLong_FromByteArray(bytes, sizeof(SDL_Keymod), little, !is_unsigned); } } static CYTHON_INLINE PyObject* __Pyx_PyInt_From_SDL_GameControllerButton(SDL_GameControllerButton value) { const SDL_GameControllerButton neg_one = (SDL_GameControllerButton) -1, const_zero = (SDL_GameControllerButton) 0; const int is_unsigned = neg_one > const_zero; if (is_unsigned) { if (sizeof(SDL_GameControllerButton) < sizeof(long)) { return PyInt_FromLong((long) value); } else if (sizeof(SDL_GameControllerButton) <= sizeof(unsigned long)) { return PyLong_FromUnsignedLong((unsigned long) value); } else if (sizeof(SDL_GameControllerButton) <= sizeof(unsigned PY_LONG_LONG)) { return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value); } } else { if (sizeof(SDL_GameControllerButton) <= sizeof(long)) { return PyInt_FromLong((long) value); } else if (sizeof(SDL_GameControllerButton) <= sizeof(PY_LONG_LONG)) { return PyLong_FromLongLong((PY_LONG_LONG) value); } } { int one = 1; int little = (int)*(unsigned char *)&one; unsigned char *bytes = (unsigned char *)&value; return _PyLong_FromByteArray(bytes, sizeof(SDL_GameControllerButton), little, !is_unsigned); } } static CYTHON_INLINE PyObject* __Pyx_PyInt_From_SDL_GameControllerAxis(SDL_GameControllerAxis value) { const SDL_GameControllerAxis neg_one = (SDL_GameControllerAxis) -1, const_zero = (SDL_GameControllerAxis) 0; const int is_unsigned = neg_one > const_zero; if (is_unsigned) { if (sizeof(SDL_GameControllerAxis) < sizeof(long)) { return PyInt_FromLong((long) value); } else if (sizeof(SDL_GameControllerAxis) <= sizeof(unsigned long)) { return PyLong_FromUnsignedLong((unsigned long) value); } else if (sizeof(SDL_GameControllerAxis) <= sizeof(unsigned PY_LONG_LONG)) { return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value); } } else { if (sizeof(SDL_GameControllerAxis) <= sizeof(long)) { return PyInt_FromLong((long) value); } else if (sizeof(SDL_GameControllerAxis) <= sizeof(PY_LONG_LONG)) { return PyLong_FromLongLong((PY_LONG_LONG) value); } } { int one = 1; int little = (int)*(unsigned char *)&one; unsigned char *bytes = (unsigned char *)&value; return _PyLong_FromByteArray(bytes, sizeof(SDL_GameControllerAxis), little, !is_unsigned); } } static CYTHON_INLINE PyObject* __Pyx_PyInt_From_SDL_PowerState(SDL_PowerState value) { const SDL_PowerState neg_one = (SDL_PowerState) -1, const_zero = (SDL_PowerState) 0; const int is_unsigned = neg_one > const_zero; if (is_unsigned) { if (sizeof(SDL_PowerState) < sizeof(long)) { return PyInt_FromLong((long) value); } else if (sizeof(SDL_PowerState) <= sizeof(unsigned long)) { return PyLong_FromUnsignedLong((unsigned long) value); } else if (sizeof(SDL_PowerState) <= sizeof(unsigned PY_LONG_LONG)) { return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value); } } else { if (sizeof(SDL_PowerState) <= sizeof(long)) { return PyInt_FromLong((long) value); } else if (sizeof(SDL_PowerState) <= sizeof(PY_LONG_LONG)) { return PyLong_FromLongLong((PY_LONG_LONG) value); } } { int one = 1; int little = (int)*(unsigned char *)&one; unsigned char *bytes = (unsigned char *)&value; return _PyLong_FromByteArray(bytes, sizeof(SDL_PowerState), little, !is_unsigned); } } #define __PYX_VERIFY_RETURN_INT(target_type, func_type, func_value)\ __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, 0) #define __PYX_VERIFY_RETURN_INT_EXC(target_type, func_type, func_value)\ __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, 1) #define __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, exc)\ {\ func_type value = func_value;\ if (sizeof(target_type) < sizeof(func_type)) {\ if (unlikely(value != (func_type) (target_type) value)) {\ func_type zero = 0;\ if (exc && unlikely(value == (func_type)-1 && PyErr_Occurred()))\ return (target_type) -1;\ if (is_unsigned && unlikely(value < zero))\ goto raise_neg_overflow;\ else\ goto raise_overflow;\ }\ }\ return (target_type) value;\ } #if CYTHON_USE_PYLONG_INTERNALS #include "longintrepr.h" #endif static CYTHON_INLINE long __Pyx_PyInt_As_long(PyObject *x) { const long neg_one = (long) -1, const_zero = (long) 0; const int is_unsigned = neg_one > const_zero; #if PY_MAJOR_VERSION < 3 if (likely(PyInt_Check(x))) { if (sizeof(long) < sizeof(long)) { __PYX_VERIFY_RETURN_INT(long, long, PyInt_AS_LONG(x)) } else { long val = PyInt_AS_LONG(x); if (is_unsigned && unlikely(val < 0)) { goto raise_neg_overflow; } return (long) val; } } else #endif if (likely(PyLong_Check(x))) { if (is_unsigned) { #if CYTHON_USE_PYLONG_INTERNALS const digit* digits = ((PyLongObject*)x)->ob_digit; switch (Py_SIZE(x)) { case 0: return (long) 0; case 1: __PYX_VERIFY_RETURN_INT(long, digit, digits[0]) case 2: if (8 * sizeof(long) > 1 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(long) >= 2 * PyLong_SHIFT) { return (long) (((((long)digits[1]) << PyLong_SHIFT) | (long)digits[0])); } } break; case 3: if (8 * sizeof(long) > 2 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(long) >= 3 * PyLong_SHIFT) { return (long) (((((((long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0])); } } break; case 4: if (8 * sizeof(long) > 3 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(long) >= 4 * PyLong_SHIFT) { return (long) (((((((((long)digits[3]) << PyLong_SHIFT) | (long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0])); } } break; } #endif #if CYTHON_COMPILING_IN_CPYTHON if (unlikely(Py_SIZE(x) < 0)) { goto raise_neg_overflow; } #else { int result = PyObject_RichCompareBool(x, Py_False, Py_LT); if (unlikely(result < 0)) return (long) -1; if (unlikely(result == 1)) goto raise_neg_overflow; } #endif if (sizeof(long) <= sizeof(unsigned long)) { __PYX_VERIFY_RETURN_INT_EXC(long, unsigned long, PyLong_AsUnsignedLong(x)) } else if (sizeof(long) <= sizeof(unsigned PY_LONG_LONG)) { __PYX_VERIFY_RETURN_INT_EXC(long, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x)) } } else { #if CYTHON_USE_PYLONG_INTERNALS const digit* digits = ((PyLongObject*)x)->ob_digit; switch (Py_SIZE(x)) { case 0: return (long) 0; case -1: __PYX_VERIFY_RETURN_INT(long, sdigit, (sdigit) (-(sdigit)digits[0])) case 1: __PYX_VERIFY_RETURN_INT(long, digit, +digits[0]) case -2: if (8 * sizeof(long) - 1 > 1 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(long, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) { return (long) (((long)-1)*(((((long)digits[1]) << PyLong_SHIFT) | (long)digits[0]))); } } break; case 2: if (8 * sizeof(long) > 1 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) { return (long) ((((((long)digits[1]) << PyLong_SHIFT) | (long)digits[0]))); } } break; case -3: if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(long, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) { return (long) (((long)-1)*(((((((long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0]))); } } break; case 3: if (8 * sizeof(long) > 2 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) { return (long) ((((((((long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0]))); } } break; case -4: if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(long, long, -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(long) - 1 > 4 * PyLong_SHIFT) { return (long) (((long)-1)*(((((((((long)digits[3]) << PyLong_SHIFT) | (long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0]))); } } break; case 4: if (8 * sizeof(long) > 3 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(long) - 1 > 4 * PyLong_SHIFT) { return (long) ((((((((((long)digits[3]) << PyLong_SHIFT) | (long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0]))); } } break; } #endif if (sizeof(long) <= sizeof(long)) { __PYX_VERIFY_RETURN_INT_EXC(long, long, PyLong_AsLong(x)) } else if (sizeof(long) <= sizeof(PY_LONG_LONG)) { __PYX_VERIFY_RETURN_INT_EXC(long, PY_LONG_LONG, PyLong_AsLongLong(x)) } } { #if CYTHON_COMPILING_IN_PYPY && !defined(_PyLong_AsByteArray) PyErr_SetString(PyExc_RuntimeError, "_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers"); #else long val; PyObject *v = __Pyx_PyNumber_Int(x); #if PY_MAJOR_VERSION < 3 if (likely(v) && !PyLong_Check(v)) { PyObject *tmp = v; v = PyNumber_Long(tmp); Py_DECREF(tmp); } #endif if (likely(v)) { int one = 1; int is_little = (int)*(unsigned char *)&one; unsigned char *bytes = (unsigned char *)&val; int ret = _PyLong_AsByteArray((PyLongObject *)v, bytes, sizeof(val), is_little, !is_unsigned); Py_DECREF(v); if (likely(!ret)) return val; } #endif return (long) -1; } } else { long val; PyObject *tmp = __Pyx_PyNumber_Int(x); if (!tmp) return (long) -1; val = __Pyx_PyInt_As_long(tmp); Py_DECREF(tmp); return val; } raise_overflow: PyErr_SetString(PyExc_OverflowError, "value too large to convert to long"); return (long) -1; raise_neg_overflow: PyErr_SetString(PyExc_OverflowError, "can't convert negative value to long"); return (long) -1; } static CYTHON_INLINE int __Pyx_PyInt_As_int(PyObject *x) { const int neg_one = (int) -1, const_zero = (int) 0; const int is_unsigned = neg_one > const_zero; #if PY_MAJOR_VERSION < 3 if (likely(PyInt_Check(x))) { if (sizeof(int) < sizeof(long)) { __PYX_VERIFY_RETURN_INT(int, long, PyInt_AS_LONG(x)) } else { long val = PyInt_AS_LONG(x); if (is_unsigned && unlikely(val < 0)) { goto raise_neg_overflow; } return (int) val; } } else #endif if (likely(PyLong_Check(x))) { if (is_unsigned) { #if CYTHON_USE_PYLONG_INTERNALS const digit* digits = ((PyLongObject*)x)->ob_digit; switch (Py_SIZE(x)) { case 0: return (int) 0; case 1: __PYX_VERIFY_RETURN_INT(int, digit, digits[0]) case 2: if (8 * sizeof(int) > 1 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(int) >= 2 * PyLong_SHIFT) { return (int) (((((int)digits[1]) << PyLong_SHIFT) | (int)digits[0])); } } break; case 3: if (8 * sizeof(int) > 2 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(int) >= 3 * PyLong_SHIFT) { return (int) (((((((int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0])); } } break; case 4: if (8 * sizeof(int) > 3 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(int) >= 4 * PyLong_SHIFT) { return (int) (((((((((int)digits[3]) << PyLong_SHIFT) | (int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0])); } } break; } #endif #if CYTHON_COMPILING_IN_CPYTHON if (unlikely(Py_SIZE(x) < 0)) { goto raise_neg_overflow; } #else { int result = PyObject_RichCompareBool(x, Py_False, Py_LT); if (unlikely(result < 0)) return (int) -1; if (unlikely(result == 1)) goto raise_neg_overflow; } #endif if (sizeof(int) <= sizeof(unsigned long)) { __PYX_VERIFY_RETURN_INT_EXC(int, unsigned long, PyLong_AsUnsignedLong(x)) } else if (sizeof(int) <= sizeof(unsigned PY_LONG_LONG)) { __PYX_VERIFY_RETURN_INT_EXC(int, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x)) } } else { #if CYTHON_USE_PYLONG_INTERNALS const digit* digits = ((PyLongObject*)x)->ob_digit; switch (Py_SIZE(x)) { case 0: return (int) 0; case -1: __PYX_VERIFY_RETURN_INT(int, sdigit, (sdigit) (-(sdigit)digits[0])) case 1: __PYX_VERIFY_RETURN_INT(int, digit, +digits[0]) case -2: if (8 * sizeof(int) - 1 > 1 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(int, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(int) - 1 > 2 * PyLong_SHIFT) { return (int) (((int)-1)*(((((int)digits[1]) << PyLong_SHIFT) | (int)digits[0]))); } } break; case 2: if (8 * sizeof(int) > 1 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(int) - 1 > 2 * PyLong_SHIFT) { return (int) ((((((int)digits[1]) << PyLong_SHIFT) | (int)digits[0]))); } } break; case -3: if (8 * sizeof(int) - 1 > 2 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(int, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(int) - 1 > 3 * PyLong_SHIFT) { return (int) (((int)-1)*(((((((int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0]))); } } break; case 3: if (8 * sizeof(int) > 2 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(int) - 1 > 3 * PyLong_SHIFT) { return (int) ((((((((int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0]))); } } break; case -4: if (8 * sizeof(int) - 1 > 3 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(int, long, -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(int) - 1 > 4 * PyLong_SHIFT) { return (int) (((int)-1)*(((((((((int)digits[3]) << PyLong_SHIFT) | (int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0]))); } } break; case 4: if (8 * sizeof(int) > 3 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(int) - 1 > 4 * PyLong_SHIFT) { return (int) ((((((((((int)digits[3]) << PyLong_SHIFT) | (int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0]))); } } break; } #endif if (sizeof(int) <= sizeof(long)) { __PYX_VERIFY_RETURN_INT_EXC(int, long, PyLong_AsLong(x)) } else if (sizeof(int) <= sizeof(PY_LONG_LONG)) { __PYX_VERIFY_RETURN_INT_EXC(int, PY_LONG_LONG, PyLong_AsLongLong(x)) } } { #if CYTHON_COMPILING_IN_PYPY && !defined(_PyLong_AsByteArray) PyErr_SetString(PyExc_RuntimeError, "_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers"); #else int val; PyObject *v = __Pyx_PyNumber_Int(x); #if PY_MAJOR_VERSION < 3 if (likely(v) && !PyLong_Check(v)) { PyObject *tmp = v; v = PyNumber_Long(tmp); Py_DECREF(tmp); } #endif if (likely(v)) { int one = 1; int is_little = (int)*(unsigned char *)&one; unsigned char *bytes = (unsigned char *)&val; int ret = _PyLong_AsByteArray((PyLongObject *)v, bytes, sizeof(val), is_little, !is_unsigned); Py_DECREF(v); if (likely(!ret)) return val; } #endif return (int) -1; } } else { int val; PyObject *tmp = __Pyx_PyNumber_Int(x); if (!tmp) return (int) -1; val = __Pyx_PyInt_As_int(tmp); Py_DECREF(tmp); return val; } raise_overflow: PyErr_SetString(PyExc_OverflowError, "value too large to convert to int"); return (int) -1; raise_neg_overflow: PyErr_SetString(PyExc_OverflowError, "can't convert negative value to int"); return (int) -1; } static int __Pyx_check_binary_version(void) { char ctversion[4], rtversion[4]; PyOS_snprintf(ctversion, 4, "%d.%d", PY_MAJOR_VERSION, PY_MINOR_VERSION); PyOS_snprintf(rtversion, 4, "%s", Py_GetVersion()); if (ctversion[0] != rtversion[0] || ctversion[2] != rtversion[2]) { char message[200]; PyOS_snprintf(message, sizeof(message), "compiletime version %s of module '%.100s' " "does not match runtime version %s", ctversion, __Pyx_MODULE_NAME, rtversion); return PyErr_WarnEx(NULL, message, 1); } return 0; } static int __Pyx_InitStrings(__Pyx_StringTabEntry *t) { while (t->p) { #if PY_MAJOR_VERSION < 3 if (t->is_unicode) { *t->p = PyUnicode_DecodeUTF8(t->s, t->n - 1, NULL); } else if (t->intern) { *t->p = PyString_InternFromString(t->s); } else { *t->p = PyString_FromStringAndSize(t->s, t->n - 1); } #else if (t->is_unicode | t->is_str) { if (t->intern) { *t->p = PyUnicode_InternFromString(t->s); } else if (t->encoding) { *t->p = PyUnicode_Decode(t->s, t->n - 1, t->encoding, NULL); } else { *t->p = PyUnicode_FromStringAndSize(t->s, t->n - 1); } } else { *t->p = PyBytes_FromStringAndSize(t->s, t->n - 1); } #endif if (!*t->p) return -1; ++t; } return 0; } static CYTHON_INLINE PyObject* __Pyx_PyUnicode_FromString(const char* c_str) { return __Pyx_PyUnicode_FromStringAndSize(c_str, (Py_ssize_t)strlen(c_str)); } static CYTHON_INLINE char* __Pyx_PyObject_AsString(PyObject* o) { Py_ssize_t ignore; return __Pyx_PyObject_AsStringAndSize(o, &ignore); } static CYTHON_INLINE char* __Pyx_PyObject_AsStringAndSize(PyObject* o, Py_ssize_t *length) { #if CYTHON_COMPILING_IN_CPYTHON && (__PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT) if ( #if PY_MAJOR_VERSION < 3 && __PYX_DEFAULT_STRING_ENCODING_IS_ASCII __Pyx_sys_getdefaultencoding_not_ascii && #endif PyUnicode_Check(o)) { #if PY_VERSION_HEX < 0x03030000 char* defenc_c; PyObject* defenc = _PyUnicode_AsDefaultEncodedString(o, NULL); if (!defenc) return NULL; defenc_c = PyBytes_AS_STRING(defenc); #if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII { char* end = defenc_c + PyBytes_GET_SIZE(defenc); char* c; for (c = defenc_c; c < end; c++) { if ((unsigned char) (*c) >= 128) { PyUnicode_AsASCIIString(o); return NULL; } } } #endif *length = PyBytes_GET_SIZE(defenc); return defenc_c; #else if (__Pyx_PyUnicode_READY(o) == -1) return NULL; #if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII if (PyUnicode_IS_ASCII(o)) { *length = PyUnicode_GET_LENGTH(o); return PyUnicode_AsUTF8(o); } else { PyUnicode_AsASCIIString(o); return NULL; } #else return PyUnicode_AsUTF8AndSize(o, length); #endif #endif } else #endif #if (!CYTHON_COMPILING_IN_PYPY) || (defined(PyByteArray_AS_STRING) && defined(PyByteArray_GET_SIZE)) if (PyByteArray_Check(o)) { *length = PyByteArray_GET_SIZE(o); return PyByteArray_AS_STRING(o); } else #endif { char* result; int r = PyBytes_AsStringAndSize(o, &result, length); if (unlikely(r < 0)) { return NULL; } else { return result; } } } static CYTHON_INLINE int __Pyx_PyObject_IsTrue(PyObject* x) { int is_true = x == Py_True; if (is_true | (x == Py_False) | (x == Py_None)) return is_true; else return PyObject_IsTrue(x); } static CYTHON_INLINE PyObject* __Pyx_PyNumber_Int(PyObject* x) { PyNumberMethods *m; const char *name = NULL; PyObject *res = NULL; #if PY_MAJOR_VERSION < 3 if (PyInt_Check(x) || PyLong_Check(x)) #else if (PyLong_Check(x)) #endif return __Pyx_NewRef(x); m = Py_TYPE(x)->tp_as_number; #if PY_MAJOR_VERSION < 3 if (m && m->nb_int) { name = "int"; res = PyNumber_Int(x); } else if (m && m->nb_long) { name = "long"; res = PyNumber_Long(x); } #else if (m && m->nb_int) { name = "int"; res = PyNumber_Long(x); } #endif if (res) { #if PY_MAJOR_VERSION < 3 if (!PyInt_Check(res) && !PyLong_Check(res)) { #else if (!PyLong_Check(res)) { #endif PyErr_Format(PyExc_TypeError, "__%.4s__ returned non-%.4s (type %.200s)", name, name, Py_TYPE(res)->tp_name); Py_DECREF(res); return NULL; } } else if (!PyErr_Occurred()) { PyErr_SetString(PyExc_TypeError, "an integer is required"); } return res; } static CYTHON_INLINE Py_ssize_t __Pyx_PyIndex_AsSsize_t(PyObject* b) { Py_ssize_t ival; PyObject *x; #if PY_MAJOR_VERSION < 3 if (likely(PyInt_CheckExact(b))) { if (sizeof(Py_ssize_t) >= sizeof(long)) return PyInt_AS_LONG(b); else return PyInt_AsSsize_t(x); } #endif if (likely(PyLong_CheckExact(b))) { #if CYTHON_USE_PYLONG_INTERNALS const digit* digits = ((PyLongObject*)b)->ob_digit; const Py_ssize_t size = Py_SIZE(b); if (likely(__Pyx_sst_abs(size) <= 1)) { ival = likely(size) ? digits[0] : 0; if (size == -1) ival = -ival; return ival; } else { switch (size) { case 2: if (8 * sizeof(Py_ssize_t) > 2 * PyLong_SHIFT) { return (Py_ssize_t) (((((size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])); } break; case -2: if (8 * sizeof(Py_ssize_t) > 2 * PyLong_SHIFT) { return -(Py_ssize_t) (((((size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])); } break; case 3: if (8 * sizeof(Py_ssize_t) > 3 * PyLong_SHIFT) { return (Py_ssize_t) (((((((size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])); } break; case -3: if (8 * sizeof(Py_ssize_t) > 3 * PyLong_SHIFT) { return -(Py_ssize_t) (((((((size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])); } break; case 4: if (8 * sizeof(Py_ssize_t) > 4 * PyLong_SHIFT) { return (Py_ssize_t) (((((((((size_t)digits[3]) << PyLong_SHIFT) | (size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])); } break; case -4: if (8 * sizeof(Py_ssize_t) > 4 * PyLong_SHIFT) { return -(Py_ssize_t) (((((((((size_t)digits[3]) << PyLong_SHIFT) | (size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])); } break; } } #endif return PyLong_AsSsize_t(b); } x = PyNumber_Index(b); if (!x) return -1; ival = PyInt_AsSsize_t(x); Py_DECREF(x); return ival; } static CYTHON_INLINE PyObject * __Pyx_PyInt_FromSize_t(size_t ival) { return PyInt_FromSize_t(ival); } #endif /* Py_PYTHON_H */ pygame_sdl2-2.1.0-for-renpy-6.99.14.1/README.rst0000644000175000017500000001131013201701200017711 0ustar tomtom00000000000000=========== Pygame_sdl2 =========== Pygame_sdl2 is a reimplementation of the Pygame API using SDL2 and related libraries. The initial goal of this project are to allow games written using the pygame API to run on SDL2 on desktop and mobile platforms. We will then evolve the API to expose SDL2-provided functionality in a pythonic manner. Downloads --------- Nightly builds are available from: https://nightly.renpy.org/current/ An official release will be coming to pypi shortly. License ------- New code written for pygame_sdl2 is licensed under the Zlib license. Some code - including compiled code - is taken wholesale from Pygame, and is licensed under the LGPL2. Please check each module to determine its licensing status. See the COPYING.ZLIB and COPYING.LGPL21 files for details - you'll need to comply with both to distribute software containing pygame_sdl2. Current Status -------------- Pygame_sdl2 builds and runs on Windows, Mac OS X, and Linux, with a useful subset of the pygame API working. While not as well documented, it has also run on Android, iOS, and inside the Chrome browser. The following modules have at least some implementation: * pygame_sdl2.color * pygame_sdl2.display * pygame_sdl2.draw * pygame_sdl2.event * pygame_sdl2.font * pygame_sdl2.gfxdraw * pygame_sdl2.image * pygame_sdl2.joystick * pygame_sdl2.key * pygame_sdl2.locals * pygame_sdl2.mixer (including mixer.music) * pygame_sdl2.mouse * pygame_sdl2.scrap * pygame_sdl2.sprite * pygame_sdl2.surface * pygame_sdl2.sysfont * pygame_sdl2.time * pygame_sdl2.transform * pygame_sdl2.version Experimental new modules include: * pygame_sdl2.render * pygame_sdl2.controller Current omissions include: * Modules not listed above. * APIs that expose pygame data as buffers or arrays. * Support for non-32-bit surface depths. Our thinking is that 8, 16, and (to some extent) 24-bit surfaces are legacy formats, and not worth duplicating code four or more times to support. This only applies to in-memory formats - when an image of lesser color depth is loaded, it is converted to a 32-bit image. * Support for palette functions, which only apply to 8-bit surfaces. Documentation ------------- The latest documentation can be found at: http://pygame-sdl2.readthedocs.org/ An Android packaging example can be found at: https://github.com/renpytom/rapt-pygame-example Building -------- Building pygame_sdl2 requires the ability to build python modules; the ability to link against the SDL2, SDL2_gfx, SDL2_image, SDL2_mixer, and SDL2_ttf libraries; and the ability to compile cython code. To build pygame_sdl2, install the build dependencies: **Ubuntu**:: sudo apt-get install build-essential python-dev libsdl2-dev \ libsdl2-image-dev libsdl2-mixer-dev libsdl2-ttf-dev \ libjpeg-dev libpng12-dev virtualenvwrapper **Mac OS X** (with `brew `_):: brew install sdl2 sdl2_gfx sdl2_image sdl2_mixer sdl2_ttf sudo pip install virtualenvwrapper Open a new shell to ensure virtualenvwrapper is running, then run:: mkvirtualenv pygame_sdl2 pip install cython Change into a clone of this project, and run the following command to modify the virtualenv so pygame_sdl2 header files can be installed in it:: python fix_virtualenv.py Finally, build and install pygame_sdl2 by running:: python setup.py install Windows ^^^^^^^ To build on windows, change into the pygame_sdl2 checkout, clone renpy/pygame_sdl2_windeps using a command like:: git clone https://github.com/renpy/pygame_sdl2_windeps and then build and install using:: python setup.py install This assumes you have installed a version of Visual Studio that is appropriate for the version of Python you are using. C Headers ^^^^^^^^^ A small number of C headers can be installed using the command:: python setup.py install_headers These headers export functions statically, and must be initialized by including "pygame_sdl2/pygame_sdl2.h" and calling the (C-language) import_pygame_sdl2() function from each C file in which a function will be called. The following functions are exposed: * PySurface_AsSurface - Returns the SDL_Surface underlying a pygame_sdl2.Surface. * PySurface_New - Wraps an SDL_Surface in a new pygame_sdl2.Surface. Contributing ------------ We're looking for people to contribute to pygame_sdl2 development. For simple changes, just give us a pull request. Before making a change that is a lot of work, it might make sense to send us an email to ensure we're not already working on it. Credits ------- Pygame_sdl2 is written by: * Patrick Dawson * Tom Rothamel It includes some code from Pygame, and is inspired by the hundreds of contributors to the Pygame, Python, and SDL2 projects. pygame_sdl2-2.1.0-for-renpy-6.99.14.1/src/0000755000175000017500000000000013235720531017034 5ustar tomtom00000000000000pygame_sdl2-2.1.0-for-renpy-6.99.14.1/src/write_png.h0000664000175000017500000000034012470006030021171 0ustar tomtom00000000000000#ifndef WRITE_PNG_H #define WRITE_PNG_H #include int Pygame_SDL2_SavePNG(const char *file, SDL_Surface *surf,int compression); int Pygame_SDL2_SavePNG_RW(SDL_RWops *src, SDL_Surface *surf,int compression); #endif pygame_sdl2-2.1.0-for-renpy-6.99.14.1/src/write_png.c0000664000175000017500000001103412673647072021214 0ustar tomtom00000000000000/* Based on zlib license - see http://www.gzip.org/zlib/zlib_license.html This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages arising from the use of this software. Permission is granted to anyone to use this software for any purpose, including commercial applications, and to alter it and redistribute it freely, subject to the following restrictions: 1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required. 2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software. 3. This notice may not be removed or altered from any source distribution. "Philip D. Bober" */ /** * 4/17/04 - IMG_SavePNG & IMG_SavePNG_RW - Philip D. Bober * 11/08/2004 - Compr fix, levels -1,1-7 now work - Tyler Montbriand */ #include #include #include #include "write_png.h" #ifndef png_voidp #define png_voidp voidp #endif int Pygame_SDL2_SavePNG(const char *file, SDL_Surface *surf,int compression){ SDL_RWops *fp; int ret; fp=SDL_RWFromFile(file,"wb"); if( fp == NULL ) { return (-1); } ret=Pygame_SDL2_SavePNG_RW(fp,surf,compression); SDL_RWclose(fp); return ret; } static void png_write_data(png_structp png_ptr,png_bytep data, png_size_t length){ SDL_RWops *rp = (SDL_RWops*) png_get_io_ptr(png_ptr); SDL_RWwrite(rp,data,1,length); } int Pygame_SDL2_SavePNG_RW(SDL_RWops *src, SDL_Surface *surf,int compression){ png_structp png_ptr; png_infop info_ptr; SDL_PixelFormat *fmt=NULL; SDL_Surface *tempsurf=NULL; int ret; int i; png_colorp palette; Uint8 *palette_alpha=NULL; png_byte **row_pointers=NULL; unsigned int target_format; png_ptr=NULL;info_ptr=NULL;palette=NULL;ret=-1; if( !src || !surf) { goto savedone2; /* Nothing to do. */ } row_pointers=(png_byte **)malloc(surf->h * sizeof(png_byte*)); if (!row_pointers) { SDL_SetError("Couldn't allocate memory for rowpointers"); goto savedone2; } png_ptr=png_create_write_struct(PNG_LIBPNG_VER_STRING, NULL,NULL,NULL); if (!png_ptr){ SDL_SetError("Couldn't allocate memory for PNG file version: " PNG_LIBPNG_VER_STRING); goto savedone2; } info_ptr= png_create_info_struct(png_ptr); if (!info_ptr){ SDL_SetError("Couldn't allocate image information for PNG file"); goto savedone; } /* setup custom writer functions */ png_set_write_fn(png_ptr,(png_voidp)src,png_write_data,NULL); if (setjmp(png_jmpbuf(png_ptr))){ SDL_SetError("Unknown error writing PNG"); goto savedone; } if(compression>Z_BEST_COMPRESSION) compression=Z_BEST_COMPRESSION; if(compression == Z_NO_COMPRESSION) // No compression { png_set_filter(png_ptr,0,PNG_FILTER_NONE); png_set_compression_level(png_ptr,Z_NO_COMPRESSION); } else if(compression<0) // Default compression png_set_compression_level(png_ptr,Z_DEFAULT_COMPRESSION); else png_set_compression_level(png_ptr,compression); fmt=surf->format; if (fmt->Amask) { png_set_IHDR(png_ptr,info_ptr, surf->w,surf->h,8,PNG_COLOR_TYPE_RGB_ALPHA, PNG_INTERLACE_NONE,PNG_COMPRESSION_TYPE_DEFAULT, PNG_FILTER_TYPE_DEFAULT); } else { png_set_IHDR(png_ptr,info_ptr, surf->w,surf->h,8,PNG_COLOR_TYPE_RGB, PNG_INTERLACE_NONE,PNG_COMPRESSION_TYPE_DEFAULT, PNG_FILTER_TYPE_DEFAULT); } png_write_info(png_ptr, info_ptr); #if SDL_BYTEORDER == SDL_LIL_ENDIAN if (fmt->Amask) { target_format = SDL_PIXELFORMAT_ABGR8888; } else { target_format = SDL_PIXELFORMAT_BGR888; } #else if (fmt->Amask) { target_format = SDL_PIXELFORMAT_RGBA8888; } else { target_format = SDL_PIXELFORMAT_RGB888; } #endif if (surf->format->format != target_format) { tempsurf = SDL_ConvertSurfaceFormat(surf, target_format, 0); surf = tempsurf; if (!tempsurf){ SDL_SetError("Couldn't allocate temp surface"); goto savedone; } } for(i=0;i < surf->h;i++){ row_pointers[i]= ((png_byte*) surf->pixels) + i * surf->pitch; } png_write_image(png_ptr, row_pointers); if (tempsurf) { SDL_FreeSurface(tempsurf); } png_write_end(png_ptr, NULL); ret=0; /* got here, so nothing went wrong. YAY! */ savedone: /* clean up and return */ png_destroy_write_struct(&png_ptr,&info_ptr); savedone2: if (palette) { free(palette); } if (palette_alpha) { free(palette_alpha); } if (row_pointers) { free(row_pointers); } return ret; } pygame_sdl2-2.1.0-for-renpy-6.99.14.1/src/write_jpeg.h0000664000175000017500000000020212673650147021352 0ustar tomtom00000000000000#ifndef WRITE_JPEG_H #define WRITE_JPEG_H int Pygame_SDL2_SaveJPEG(SDL_Surface *surface, const char *file, int quality); #endif pygame_sdl2-2.1.0-for-renpy-6.99.14.1/src/write_jpeg.c0000664000175000017500000000513512673650213021351 0ustar tomtom00000000000000/* Copyright 2006 Rene Dudfield * Copyright 2014 Tom Rothamel * * This software is provided 'as-is', without any express or implied * warranty. In no event will the authors be held liable for any damages * arising from the use of this software. * * Permission is granted to anyone to use this software for any purpose, * including commercial applications, and to alter it and redistribute it * freely, subject to the following restrictions: * * 1. The origin of this software must not be misrepresented; you must not * claim that you wrote the original software. If you use this software * in a product, an acknowledgment in the product documentation would be * appreciated but is not required. * 2. Altered source versions must be plainly marked as such, and must not be * misrepresented as being the original software. * 3. This notice may not be removed or altered from any source distribution. */ #include #include #include static int write_jpeg ( const char *file_name, JSAMPROW *rows, int width, int height, int quality) { struct jpeg_compress_struct cinfo; struct jpeg_error_mgr jerr; FILE * outfile; cinfo.err = jpeg_std_error(&jerr); jpeg_create_compress(&cinfo); if ((outfile = fopen(file_name, "wb")) == NULL) { SDL_SetError ("SaveJPEG: could not open %s", file_name); return -1; } jpeg_stdio_dest (&cinfo, outfile); cinfo.image_width = width; cinfo.image_height = height; cinfo.input_components = 3; cinfo.in_color_space = JCS_RGB; jpeg_set_defaults (&cinfo); jpeg_set_quality (&cinfo, quality, TRUE); jpeg_start_compress (&cinfo, TRUE); jpeg_write_scanlines(&cinfo, rows, height); jpeg_finish_compress (&cinfo); fclose (outfile); jpeg_destroy_compress (&cinfo); return 0; } int Pygame_SDL2_SaveJPEG(SDL_Surface *surface, const char *file, int quality) { SDL_Surface *rgb_surf; JSAMPROW *samples; int i, rv; if (quality < 0) { quality = 90; } rgb_surf = SDL_ConvertSurfaceFormat(surface, SDL_PIXELFORMAT_RGB24, 0); if (! rgb_surf) { return -1; } samples = (JSAMPROW *) malloc (sizeof(JSAMPROW) * rgb_surf->h); if (!samples) { SDL_FreeSurface(rgb_surf); return -1; } /* copy pointers to the scanlines... since they might not be packed. */ for (i = 0; i < rgb_surf->h; i++) { samples[i] = ((unsigned char*)rgb_surf->pixels) + i * rgb_surf->pitch; } rv = write_jpeg(file, samples, surface->w, surface->h, quality); free(samples); SDL_FreeSurface(rgb_surf); return rv; } pygame_sdl2-2.1.0-for-renpy-6.99.14.1/src/SDL_gfxPrimitives_font.h0000664000175000017500000015513312513724350023610 0ustar tomtom00000000000000 /* ---- 8x8 font definition ---- */ /* LGPL (c) A. Schiffler */ #define GFX_FONTDATAMAX (8*256) static unsigned char gfxPrimitivesFontdata[GFX_FONTDATAMAX] = { /* * 0 0x00 '^@' */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ /* * 1 0x01 '^A' */ 0x7e, /* 01111110 */ 0x81, /* 10000001 */ 0xa5, /* 10100101 */ 0x81, /* 10000001 */ 0xbd, /* 10111101 */ 0x99, /* 10011001 */ 0x81, /* 10000001 */ 0x7e, /* 01111110 */ /* * 2 0x02 '^B' */ 0x7e, /* 01111110 */ 0xff, /* 11111111 */ 0xdb, /* 11011011 */ 0xff, /* 11111111 */ 0xc3, /* 11000011 */ 0xe7, /* 11100111 */ 0xff, /* 11111111 */ 0x7e, /* 01111110 */ /* * 3 0x03 '^C' */ 0x6c, /* 01101100 */ 0xfe, /* 11111110 */ 0xfe, /* 11111110 */ 0xfe, /* 11111110 */ 0x7c, /* 01111100 */ 0x38, /* 00111000 */ 0x10, /* 00010000 */ 0x00, /* 00000000 */ /* * 4 0x04 '^D' */ 0x10, /* 00010000 */ 0x38, /* 00111000 */ 0x7c, /* 01111100 */ 0xfe, /* 11111110 */ 0x7c, /* 01111100 */ 0x38, /* 00111000 */ 0x10, /* 00010000 */ 0x00, /* 00000000 */ /* * 5 0x05 '^E' */ 0x38, /* 00111000 */ 0x7c, /* 01111100 */ 0x38, /* 00111000 */ 0xfe, /* 11111110 */ 0xfe, /* 11111110 */ 0xd6, /* 11010110 */ 0x10, /* 00010000 */ 0x38, /* 00111000 */ /* * 6 0x06 '^F' */ 0x10, /* 00010000 */ 0x38, /* 00111000 */ 0x7c, /* 01111100 */ 0xfe, /* 11111110 */ 0xfe, /* 11111110 */ 0x7c, /* 01111100 */ 0x10, /* 00010000 */ 0x38, /* 00111000 */ /* * 7 0x07 '^G' */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ 0x18, /* 00011000 */ 0x3c, /* 00111100 */ 0x3c, /* 00111100 */ 0x18, /* 00011000 */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ /* * 8 0x08 '^H' */ 0xff, /* 11111111 */ 0xff, /* 11111111 */ 0xe7, /* 11100111 */ 0xc3, /* 11000011 */ 0xc3, /* 11000011 */ 0xe7, /* 11100111 */ 0xff, /* 11111111 */ 0xff, /* 11111111 */ /* * 9 0x09 '^I' */ 0x00, /* 00000000 */ 0x3c, /* 00111100 */ 0x66, /* 01100110 */ 0x42, /* 01000010 */ 0x42, /* 01000010 */ 0x66, /* 01100110 */ 0x3c, /* 00111100 */ 0x00, /* 00000000 */ /* * 10 0x0a '^J' */ 0xff, /* 11111111 */ 0xc3, /* 11000011 */ 0x99, /* 10011001 */ 0xbd, /* 10111101 */ 0xbd, /* 10111101 */ 0x99, /* 10011001 */ 0xc3, /* 11000011 */ 0xff, /* 11111111 */ /* * 11 0x0b '^K' */ 0x0f, /* 00001111 */ 0x07, /* 00000111 */ 0x0f, /* 00001111 */ 0x7d, /* 01111101 */ 0xcc, /* 11001100 */ 0xcc, /* 11001100 */ 0xcc, /* 11001100 */ 0x78, /* 01111000 */ /* * 12 0x0c '^L' */ 0x3c, /* 00111100 */ 0x66, /* 01100110 */ 0x66, /* 01100110 */ 0x66, /* 01100110 */ 0x3c, /* 00111100 */ 0x18, /* 00011000 */ 0x7e, /* 01111110 */ 0x18, /* 00011000 */ /* * 13 0x0d '^M' */ 0x3f, /* 00111111 */ 0x33, /* 00110011 */ 0x3f, /* 00111111 */ 0x30, /* 00110000 */ 0x30, /* 00110000 */ 0x70, /* 01110000 */ 0xf0, /* 11110000 */ 0xe0, /* 11100000 */ /* * 14 0x0e '^N' */ 0x7f, /* 01111111 */ 0x63, /* 01100011 */ 0x7f, /* 01111111 */ 0x63, /* 01100011 */ 0x63, /* 01100011 */ 0x67, /* 01100111 */ 0xe6, /* 11100110 */ 0xc0, /* 11000000 */ /* * 15 0x0f '^O' */ 0x18, /* 00011000 */ 0xdb, /* 11011011 */ 0x3c, /* 00111100 */ 0xe7, /* 11100111 */ 0xe7, /* 11100111 */ 0x3c, /* 00111100 */ 0xdb, /* 11011011 */ 0x18, /* 00011000 */ /* * 16 0x10 '^P' */ 0x80, /* 10000000 */ 0xe0, /* 11100000 */ 0xf8, /* 11111000 */ 0xfe, /* 11111110 */ 0xf8, /* 11111000 */ 0xe0, /* 11100000 */ 0x80, /* 10000000 */ 0x00, /* 00000000 */ /* * 17 0x11 '^Q' */ 0x02, /* 00000010 */ 0x0e, /* 00001110 */ 0x3e, /* 00111110 */ 0xfe, /* 11111110 */ 0x3e, /* 00111110 */ 0x0e, /* 00001110 */ 0x02, /* 00000010 */ 0x00, /* 00000000 */ /* * 18 0x12 '^R' */ 0x18, /* 00011000 */ 0x3c, /* 00111100 */ 0x7e, /* 01111110 */ 0x18, /* 00011000 */ 0x18, /* 00011000 */ 0x7e, /* 01111110 */ 0x3c, /* 00111100 */ 0x18, /* 00011000 */ /* * 19 0x13 '^S' */ 0x66, /* 01100110 */ 0x66, /* 01100110 */ 0x66, /* 01100110 */ 0x66, /* 01100110 */ 0x66, /* 01100110 */ 0x00, /* 00000000 */ 0x66, /* 01100110 */ 0x00, /* 00000000 */ /* * 20 0x14 '^T' */ 0x7f, /* 01111111 */ 0xdb, /* 11011011 */ 0xdb, /* 11011011 */ 0x7b, /* 01111011 */ 0x1b, /* 00011011 */ 0x1b, /* 00011011 */ 0x1b, /* 00011011 */ 0x00, /* 00000000 */ /* * 21 0x15 '^U' */ 0x3e, /* 00111110 */ 0x61, /* 01100001 */ 0x3c, /* 00111100 */ 0x66, /* 01100110 */ 0x66, /* 01100110 */ 0x3c, /* 00111100 */ 0x86, /* 10000110 */ 0x7c, /* 01111100 */ /* * 22 0x16 '^V' */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ 0x7e, /* 01111110 */ 0x7e, /* 01111110 */ 0x7e, /* 01111110 */ 0x00, /* 00000000 */ /* * 23 0x17 '^W' */ 0x18, /* 00011000 */ 0x3c, /* 00111100 */ 0x7e, /* 01111110 */ 0x18, /* 00011000 */ 0x7e, /* 01111110 */ 0x3c, /* 00111100 */ 0x18, /* 00011000 */ 0xff, /* 11111111 */ /* * 24 0x18 '^X' */ 0x18, /* 00011000 */ 0x3c, /* 00111100 */ 0x7e, /* 01111110 */ 0x18, /* 00011000 */ 0x18, /* 00011000 */ 0x18, /* 00011000 */ 0x18, /* 00011000 */ 0x00, /* 00000000 */ /* * 25 0x19 '^Y' */ 0x18, /* 00011000 */ 0x18, /* 00011000 */ 0x18, /* 00011000 */ 0x18, /* 00011000 */ 0x7e, /* 01111110 */ 0x3c, /* 00111100 */ 0x18, /* 00011000 */ 0x00, /* 00000000 */ /* * 26 0x1a '^Z' */ 0x00, /* 00000000 */ 0x18, /* 00011000 */ 0x0c, /* 00001100 */ 0xfe, /* 11111110 */ 0x0c, /* 00001100 */ 0x18, /* 00011000 */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ /* * 27 0x1b '^[' */ 0x00, /* 00000000 */ 0x30, /* 00110000 */ 0x60, /* 01100000 */ 0xfe, /* 11111110 */ 0x60, /* 01100000 */ 0x30, /* 00110000 */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ /* * 28 0x1c '^\' */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ 0xc0, /* 11000000 */ 0xc0, /* 11000000 */ 0xc0, /* 11000000 */ 0xfe, /* 11111110 */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ /* * 29 0x1d '^]' */ 0x00, /* 00000000 */ 0x24, /* 00100100 */ 0x66, /* 01100110 */ 0xff, /* 11111111 */ 0x66, /* 01100110 */ 0x24, /* 00100100 */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ /* * 30 0x1e '^^' */ 0x00, /* 00000000 */ 0x18, /* 00011000 */ 0x3c, /* 00111100 */ 0x7e, /* 01111110 */ 0xff, /* 11111111 */ 0xff, /* 11111111 */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ /* * 31 0x1f '^_' */ 0x00, /* 00000000 */ 0xff, /* 11111111 */ 0xff, /* 11111111 */ 0x7e, /* 01111110 */ 0x3c, /* 00111100 */ 0x18, /* 00011000 */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ /* * 32 0x20 ' ' */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ /* * 33 0x21 '!' */ 0x18, /* 00011000 */ 0x3c, /* 00111100 */ 0x3c, /* 00111100 */ 0x18, /* 00011000 */ 0x18, /* 00011000 */ 0x00, /* 00000000 */ 0x18, /* 00011000 */ 0x00, /* 00000000 */ /* * 34 0x22 '"' */ 0x66, /* 01100110 */ 0x66, /* 01100110 */ 0x24, /* 00100100 */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ /* * 35 0x23 '#' */ 0x6c, /* 01101100 */ 0x6c, /* 01101100 */ 0xfe, /* 11111110 */ 0x6c, /* 01101100 */ 0xfe, /* 11111110 */ 0x6c, /* 01101100 */ 0x6c, /* 01101100 */ 0x00, /* 00000000 */ /* * 36 0x24 '$' */ 0x18, /* 00011000 */ 0x3e, /* 00111110 */ 0x60, /* 01100000 */ 0x3c, /* 00111100 */ 0x06, /* 00000110 */ 0x7c, /* 01111100 */ 0x18, /* 00011000 */ 0x00, /* 00000000 */ /* * 37 0x25 '%' */ 0x00, /* 00000000 */ 0xc6, /* 11000110 */ 0xcc, /* 11001100 */ 0x18, /* 00011000 */ 0x30, /* 00110000 */ 0x66, /* 01100110 */ 0xc6, /* 11000110 */ 0x00, /* 00000000 */ /* * 38 0x26 '&' */ 0x38, /* 00111000 */ 0x6c, /* 01101100 */ 0x38, /* 00111000 */ 0x76, /* 01110110 */ 0xdc, /* 11011100 */ 0xcc, /* 11001100 */ 0x76, /* 01110110 */ 0x00, /* 00000000 */ /* * 39 0x27 ''' */ 0x18, /* 00011000 */ 0x18, /* 00011000 */ 0x30, /* 00110000 */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ /* * 40 0x28 '(' */ 0x0c, /* 00001100 */ 0x18, /* 00011000 */ 0x30, /* 00110000 */ 0x30, /* 00110000 */ 0x30, /* 00110000 */ 0x18, /* 00011000 */ 0x0c, /* 00001100 */ 0x00, /* 00000000 */ /* * 41 0x29 ')' */ 0x30, /* 00110000 */ 0x18, /* 00011000 */ 0x0c, /* 00001100 */ 0x0c, /* 00001100 */ 0x0c, /* 00001100 */ 0x18, /* 00011000 */ 0x30, /* 00110000 */ 0x00, /* 00000000 */ /* * 42 0x2a '*' */ 0x00, /* 00000000 */ 0x66, /* 01100110 */ 0x3c, /* 00111100 */ 0xff, /* 11111111 */ 0x3c, /* 00111100 */ 0x66, /* 01100110 */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ /* * 43 0x2b '+' */ 0x00, /* 00000000 */ 0x18, /* 00011000 */ 0x18, /* 00011000 */ 0x7e, /* 01111110 */ 0x18, /* 00011000 */ 0x18, /* 00011000 */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ /* * 44 0x2c ',' */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ 0x18, /* 00011000 */ 0x18, /* 00011000 */ 0x30, /* 00110000 */ /* * 45 0x2d '-' */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ 0x7e, /* 01111110 */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ /* * 46 0x2e '.' */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ 0x18, /* 00011000 */ 0x18, /* 00011000 */ 0x00, /* 00000000 */ /* * 47 0x2f '/' */ 0x06, /* 00000110 */ 0x0c, /* 00001100 */ 0x18, /* 00011000 */ 0x30, /* 00110000 */ 0x60, /* 01100000 */ 0xc0, /* 11000000 */ 0x80, /* 10000000 */ 0x00, /* 00000000 */ /* * 48 0x30 '0' */ 0x38, /* 00111000 */ 0x6c, /* 01101100 */ 0xc6, /* 11000110 */ 0xd6, /* 11010110 */ 0xc6, /* 11000110 */ 0x6c, /* 01101100 */ 0x38, /* 00111000 */ 0x00, /* 00000000 */ /* * 49 0x31 '1' */ 0x18, /* 00011000 */ 0x38, /* 00111000 */ 0x18, /* 00011000 */ 0x18, /* 00011000 */ 0x18, /* 00011000 */ 0x18, /* 00011000 */ 0x7e, /* 01111110 */ 0x00, /* 00000000 */ /* * 50 0x32 '2' */ 0x7c, /* 01111100 */ 0xc6, /* 11000110 */ 0x06, /* 00000110 */ 0x1c, /* 00011100 */ 0x30, /* 00110000 */ 0x66, /* 01100110 */ 0xfe, /* 11111110 */ 0x00, /* 00000000 */ /* * 51 0x33 '3' */ 0x7c, /* 01111100 */ 0xc6, /* 11000110 */ 0x06, /* 00000110 */ 0x3c, /* 00111100 */ 0x06, /* 00000110 */ 0xc6, /* 11000110 */ 0x7c, /* 01111100 */ 0x00, /* 00000000 */ /* * 52 0x34 '4' */ 0x1c, /* 00011100 */ 0x3c, /* 00111100 */ 0x6c, /* 01101100 */ 0xcc, /* 11001100 */ 0xfe, /* 11111110 */ 0x0c, /* 00001100 */ 0x1e, /* 00011110 */ 0x00, /* 00000000 */ /* * 53 0x35 '5' */ 0xfe, /* 11111110 */ 0xc0, /* 11000000 */ 0xc0, /* 11000000 */ 0xfc, /* 11111100 */ 0x06, /* 00000110 */ 0xc6, /* 11000110 */ 0x7c, /* 01111100 */ 0x00, /* 00000000 */ /* * 54 0x36 '6' */ 0x38, /* 00111000 */ 0x60, /* 01100000 */ 0xc0, /* 11000000 */ 0xfc, /* 11111100 */ 0xc6, /* 11000110 */ 0xc6, /* 11000110 */ 0x7c, /* 01111100 */ 0x00, /* 00000000 */ /* * 55 0x37 '7' */ 0xfe, /* 11111110 */ 0xc6, /* 11000110 */ 0x0c, /* 00001100 */ 0x18, /* 00011000 */ 0x30, /* 00110000 */ 0x30, /* 00110000 */ 0x30, /* 00110000 */ 0x00, /* 00000000 */ /* * 56 0x38 '8' */ 0x7c, /* 01111100 */ 0xc6, /* 11000110 */ 0xc6, /* 11000110 */ 0x7c, /* 01111100 */ 0xc6, /* 11000110 */ 0xc6, /* 11000110 */ 0x7c, /* 01111100 */ 0x00, /* 00000000 */ /* * 57 0x39 '9' */ 0x7c, /* 01111100 */ 0xc6, /* 11000110 */ 0xc6, /* 11000110 */ 0x7e, /* 01111110 */ 0x06, /* 00000110 */ 0x0c, /* 00001100 */ 0x78, /* 01111000 */ 0x00, /* 00000000 */ /* * 58 0x3a ':' */ 0x00, /* 00000000 */ 0x18, /* 00011000 */ 0x18, /* 00011000 */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ 0x18, /* 00011000 */ 0x18, /* 00011000 */ 0x00, /* 00000000 */ /* * 59 0x3b ';' */ 0x00, /* 00000000 */ 0x18, /* 00011000 */ 0x18, /* 00011000 */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ 0x18, /* 00011000 */ 0x18, /* 00011000 */ 0x30, /* 00110000 */ /* * 60 0x3c '<' */ 0x06, /* 00000110 */ 0x0c, /* 00001100 */ 0x18, /* 00011000 */ 0x30, /* 00110000 */ 0x18, /* 00011000 */ 0x0c, /* 00001100 */ 0x06, /* 00000110 */ 0x00, /* 00000000 */ /* * 61 0x3d '=' */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ 0x7e, /* 01111110 */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ 0x7e, /* 01111110 */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ /* * 62 0x3e '>' */ 0x60, /* 01100000 */ 0x30, /* 00110000 */ 0x18, /* 00011000 */ 0x0c, /* 00001100 */ 0x18, /* 00011000 */ 0x30, /* 00110000 */ 0x60, /* 01100000 */ 0x00, /* 00000000 */ /* * 63 0x3f '?' */ 0x7c, /* 01111100 */ 0xc6, /* 11000110 */ 0x0c, /* 00001100 */ 0x18, /* 00011000 */ 0x18, /* 00011000 */ 0x00, /* 00000000 */ 0x18, /* 00011000 */ 0x00, /* 00000000 */ /* * 64 0x40 '@' */ 0x7c, /* 01111100 */ 0xc6, /* 11000110 */ 0xde, /* 11011110 */ 0xde, /* 11011110 */ 0xde, /* 11011110 */ 0xc0, /* 11000000 */ 0x78, /* 01111000 */ 0x00, /* 00000000 */ /* * 65 0x41 'A' */ 0x38, /* 00111000 */ 0x6c, /* 01101100 */ 0xc6, /* 11000110 */ 0xfe, /* 11111110 */ 0xc6, /* 11000110 */ 0xc6, /* 11000110 */ 0xc6, /* 11000110 */ 0x00, /* 00000000 */ /* * 66 0x42 'B' */ 0xfc, /* 11111100 */ 0x66, /* 01100110 */ 0x66, /* 01100110 */ 0x7c, /* 01111100 */ 0x66, /* 01100110 */ 0x66, /* 01100110 */ 0xfc, /* 11111100 */ 0x00, /* 00000000 */ /* * 67 0x43 'C' */ 0x3c, /* 00111100 */ 0x66, /* 01100110 */ 0xc0, /* 11000000 */ 0xc0, /* 11000000 */ 0xc0, /* 11000000 */ 0x66, /* 01100110 */ 0x3c, /* 00111100 */ 0x00, /* 00000000 */ /* * 68 0x44 'D' */ 0xf8, /* 11111000 */ 0x6c, /* 01101100 */ 0x66, /* 01100110 */ 0x66, /* 01100110 */ 0x66, /* 01100110 */ 0x6c, /* 01101100 */ 0xf8, /* 11111000 */ 0x00, /* 00000000 */ /* * 69 0x45 'E' */ 0xfe, /* 11111110 */ 0x62, /* 01100010 */ 0x68, /* 01101000 */ 0x78, /* 01111000 */ 0x68, /* 01101000 */ 0x62, /* 01100010 */ 0xfe, /* 11111110 */ 0x00, /* 00000000 */ /* * 70 0x46 'F' */ 0xfe, /* 11111110 */ 0x62, /* 01100010 */ 0x68, /* 01101000 */ 0x78, /* 01111000 */ 0x68, /* 01101000 */ 0x60, /* 01100000 */ 0xf0, /* 11110000 */ 0x00, /* 00000000 */ /* * 71 0x47 'G' */ 0x3c, /* 00111100 */ 0x66, /* 01100110 */ 0xc0, /* 11000000 */ 0xc0, /* 11000000 */ 0xce, /* 11001110 */ 0x66, /* 01100110 */ 0x3a, /* 00111010 */ 0x00, /* 00000000 */ /* * 72 0x48 'H' */ 0xc6, /* 11000110 */ 0xc6, /* 11000110 */ 0xc6, /* 11000110 */ 0xfe, /* 11111110 */ 0xc6, /* 11000110 */ 0xc6, /* 11000110 */ 0xc6, /* 11000110 */ 0x00, /* 00000000 */ /* * 73 0x49 'I' */ 0x3c, /* 00111100 */ 0x18, /* 00011000 */ 0x18, /* 00011000 */ 0x18, /* 00011000 */ 0x18, /* 00011000 */ 0x18, /* 00011000 */ 0x3c, /* 00111100 */ 0x00, /* 00000000 */ /* * 74 0x4a 'J' */ 0x1e, /* 00011110 */ 0x0c, /* 00001100 */ 0x0c, /* 00001100 */ 0x0c, /* 00001100 */ 0xcc, /* 11001100 */ 0xcc, /* 11001100 */ 0x78, /* 01111000 */ 0x00, /* 00000000 */ /* * 75 0x4b 'K' */ 0xe6, /* 11100110 */ 0x66, /* 01100110 */ 0x6c, /* 01101100 */ 0x78, /* 01111000 */ 0x6c, /* 01101100 */ 0x66, /* 01100110 */ 0xe6, /* 11100110 */ 0x00, /* 00000000 */ /* * 76 0x4c 'L' */ 0xf0, /* 11110000 */ 0x60, /* 01100000 */ 0x60, /* 01100000 */ 0x60, /* 01100000 */ 0x62, /* 01100010 */ 0x66, /* 01100110 */ 0xfe, /* 11111110 */ 0x00, /* 00000000 */ /* * 77 0x4d 'M' */ 0xc6, /* 11000110 */ 0xee, /* 11101110 */ 0xfe, /* 11111110 */ 0xfe, /* 11111110 */ 0xd6, /* 11010110 */ 0xc6, /* 11000110 */ 0xc6, /* 11000110 */ 0x00, /* 00000000 */ /* * 78 0x4e 'N' */ 0xc6, /* 11000110 */ 0xe6, /* 11100110 */ 0xf6, /* 11110110 */ 0xde, /* 11011110 */ 0xce, /* 11001110 */ 0xc6, /* 11000110 */ 0xc6, /* 11000110 */ 0x00, /* 00000000 */ /* * 79 0x4f 'O' */ 0x7c, /* 01111100 */ 0xc6, /* 11000110 */ 0xc6, /* 11000110 */ 0xc6, /* 11000110 */ 0xc6, /* 11000110 */ 0xc6, /* 11000110 */ 0x7c, /* 01111100 */ 0x00, /* 00000000 */ /* * 80 0x50 'P' */ 0xfc, /* 11111100 */ 0x66, /* 01100110 */ 0x66, /* 01100110 */ 0x7c, /* 01111100 */ 0x60, /* 01100000 */ 0x60, /* 01100000 */ 0xf0, /* 11110000 */ 0x00, /* 00000000 */ /* * 81 0x51 'Q' */ 0x7c, /* 01111100 */ 0xc6, /* 11000110 */ 0xc6, /* 11000110 */ 0xc6, /* 11000110 */ 0xc6, /* 11000110 */ 0xce, /* 11001110 */ 0x7c, /* 01111100 */ 0x0e, /* 00001110 */ /* * 82 0x52 'R' */ 0xfc, /* 11111100 */ 0x66, /* 01100110 */ 0x66, /* 01100110 */ 0x7c, /* 01111100 */ 0x6c, /* 01101100 */ 0x66, /* 01100110 */ 0xe6, /* 11100110 */ 0x00, /* 00000000 */ /* * 83 0x53 'S' */ 0x3c, /* 00111100 */ 0x66, /* 01100110 */ 0x30, /* 00110000 */ 0x18, /* 00011000 */ 0x0c, /* 00001100 */ 0x66, /* 01100110 */ 0x3c, /* 00111100 */ 0x00, /* 00000000 */ /* * 84 0x54 'T' */ 0x7e, /* 01111110 */ 0x7e, /* 01111110 */ 0x5a, /* 01011010 */ 0x18, /* 00011000 */ 0x18, /* 00011000 */ 0x18, /* 00011000 */ 0x3c, /* 00111100 */ 0x00, /* 00000000 */ /* * 85 0x55 'U' */ 0xc6, /* 11000110 */ 0xc6, /* 11000110 */ 0xc6, /* 11000110 */ 0xc6, /* 11000110 */ 0xc6, /* 11000110 */ 0xc6, /* 11000110 */ 0x7c, /* 01111100 */ 0x00, /* 00000000 */ /* * 86 0x56 'V' */ 0xc6, /* 11000110 */ 0xc6, /* 11000110 */ 0xc6, /* 11000110 */ 0xc6, /* 11000110 */ 0xc6, /* 11000110 */ 0x6c, /* 01101100 */ 0x38, /* 00111000 */ 0x00, /* 00000000 */ /* * 87 0x57 'W' */ 0xc6, /* 11000110 */ 0xc6, /* 11000110 */ 0xc6, /* 11000110 */ 0xd6, /* 11010110 */ 0xd6, /* 11010110 */ 0xfe, /* 11111110 */ 0x6c, /* 01101100 */ 0x00, /* 00000000 */ /* * 88 0x58 'X' */ 0xc6, /* 11000110 */ 0xc6, /* 11000110 */ 0x6c, /* 01101100 */ 0x38, /* 00111000 */ 0x6c, /* 01101100 */ 0xc6, /* 11000110 */ 0xc6, /* 11000110 */ 0x00, /* 00000000 */ /* * 89 0x59 'Y' */ 0x66, /* 01100110 */ 0x66, /* 01100110 */ 0x66, /* 01100110 */ 0x3c, /* 00111100 */ 0x18, /* 00011000 */ 0x18, /* 00011000 */ 0x3c, /* 00111100 */ 0x00, /* 00000000 */ /* * 90 0x5a 'Z' */ 0xfe, /* 11111110 */ 0xc6, /* 11000110 */ 0x8c, /* 10001100 */ 0x18, /* 00011000 */ 0x32, /* 00110010 */ 0x66, /* 01100110 */ 0xfe, /* 11111110 */ 0x00, /* 00000000 */ /* * 91 0x5b '[' */ 0x3c, /* 00111100 */ 0x30, /* 00110000 */ 0x30, /* 00110000 */ 0x30, /* 00110000 */ 0x30, /* 00110000 */ 0x30, /* 00110000 */ 0x3c, /* 00111100 */ 0x00, /* 00000000 */ /* * 92 0x5c '\' */ 0xc0, /* 11000000 */ 0x60, /* 01100000 */ 0x30, /* 00110000 */ 0x18, /* 00011000 */ 0x0c, /* 00001100 */ 0x06, /* 00000110 */ 0x02, /* 00000010 */ 0x00, /* 00000000 */ /* * 93 0x5d ']' */ 0x3c, /* 00111100 */ 0x0c, /* 00001100 */ 0x0c, /* 00001100 */ 0x0c, /* 00001100 */ 0x0c, /* 00001100 */ 0x0c, /* 00001100 */ 0x3c, /* 00111100 */ 0x00, /* 00000000 */ /* * 94 0x5e '^' */ 0x10, /* 00010000 */ 0x38, /* 00111000 */ 0x6c, /* 01101100 */ 0xc6, /* 11000110 */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ /* * 95 0x5f '_' */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ 0xff, /* 11111111 */ /* * 96 0x60 '`' */ 0x30, /* 00110000 */ 0x18, /* 00011000 */ 0x0c, /* 00001100 */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ /* * 97 0x61 'a' */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ 0x78, /* 01111000 */ 0x0c, /* 00001100 */ 0x7c, /* 01111100 */ 0xcc, /* 11001100 */ 0x76, /* 01110110 */ 0x00, /* 00000000 */ /* * 98 0x62 'b' */ 0xe0, /* 11100000 */ 0x60, /* 01100000 */ 0x7c, /* 01111100 */ 0x66, /* 01100110 */ 0x66, /* 01100110 */ 0x66, /* 01100110 */ 0xdc, /* 11011100 */ 0x00, /* 00000000 */ /* * 99 0x63 'c' */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ 0x7c, /* 01111100 */ 0xc6, /* 11000110 */ 0xc0, /* 11000000 */ 0xc6, /* 11000110 */ 0x7c, /* 01111100 */ 0x00, /* 00000000 */ /* * 100 0x64 'd' */ 0x1c, /* 00011100 */ 0x0c, /* 00001100 */ 0x7c, /* 01111100 */ 0xcc, /* 11001100 */ 0xcc, /* 11001100 */ 0xcc, /* 11001100 */ 0x76, /* 01110110 */ 0x00, /* 00000000 */ /* * 101 0x65 'e' */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ 0x7c, /* 01111100 */ 0xc6, /* 11000110 */ 0xfe, /* 11111110 */ 0xc0, /* 11000000 */ 0x7c, /* 01111100 */ 0x00, /* 00000000 */ /* * 102 0x66 'f' */ 0x3c, /* 00111100 */ 0x66, /* 01100110 */ 0x60, /* 01100000 */ 0xf8, /* 11111000 */ 0x60, /* 01100000 */ 0x60, /* 01100000 */ 0xf0, /* 11110000 */ 0x00, /* 00000000 */ /* * 103 0x67 'g' */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ 0x76, /* 01110110 */ 0xcc, /* 11001100 */ 0xcc, /* 11001100 */ 0x7c, /* 01111100 */ 0x0c, /* 00001100 */ 0xf8, /* 11111000 */ /* * 104 0x68 'h' */ 0xe0, /* 11100000 */ 0x60, /* 01100000 */ 0x6c, /* 01101100 */ 0x76, /* 01110110 */ 0x66, /* 01100110 */ 0x66, /* 01100110 */ 0xe6, /* 11100110 */ 0x00, /* 00000000 */ /* * 105 0x69 'i' */ 0x18, /* 00011000 */ 0x00, /* 00000000 */ 0x38, /* 00111000 */ 0x18, /* 00011000 */ 0x18, /* 00011000 */ 0x18, /* 00011000 */ 0x3c, /* 00111100 */ 0x00, /* 00000000 */ /* * 106 0x6a 'j' */ 0x06, /* 00000110 */ 0x00, /* 00000000 */ 0x06, /* 00000110 */ 0x06, /* 00000110 */ 0x06, /* 00000110 */ 0x66, /* 01100110 */ 0x66, /* 01100110 */ 0x3c, /* 00111100 */ /* * 107 0x6b 'k' */ 0xe0, /* 11100000 */ 0x60, /* 01100000 */ 0x66, /* 01100110 */ 0x6c, /* 01101100 */ 0x78, /* 01111000 */ 0x6c, /* 01101100 */ 0xe6, /* 11100110 */ 0x00, /* 00000000 */ /* * 108 0x6c 'l' */ 0x38, /* 00111000 */ 0x18, /* 00011000 */ 0x18, /* 00011000 */ 0x18, /* 00011000 */ 0x18, /* 00011000 */ 0x18, /* 00011000 */ 0x3c, /* 00111100 */ 0x00, /* 00000000 */ /* * 109 0x6d 'm' */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ 0xec, /* 11101100 */ 0xfe, /* 11111110 */ 0xd6, /* 11010110 */ 0xd6, /* 11010110 */ 0xd6, /* 11010110 */ 0x00, /* 00000000 */ /* * 110 0x6e 'n' */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ 0xdc, /* 11011100 */ 0x66, /* 01100110 */ 0x66, /* 01100110 */ 0x66, /* 01100110 */ 0x66, /* 01100110 */ 0x00, /* 00000000 */ /* * 111 0x6f 'o' */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ 0x7c, /* 01111100 */ 0xc6, /* 11000110 */ 0xc6, /* 11000110 */ 0xc6, /* 11000110 */ 0x7c, /* 01111100 */ 0x00, /* 00000000 */ /* * 112 0x70 'p' */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ 0xdc, /* 11011100 */ 0x66, /* 01100110 */ 0x66, /* 01100110 */ 0x7c, /* 01111100 */ 0x60, /* 01100000 */ 0xf0, /* 11110000 */ /* * 113 0x71 'q' */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ 0x76, /* 01110110 */ 0xcc, /* 11001100 */ 0xcc, /* 11001100 */ 0x7c, /* 01111100 */ 0x0c, /* 00001100 */ 0x1e, /* 00011110 */ /* * 114 0x72 'r' */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ 0xdc, /* 11011100 */ 0x76, /* 01110110 */ 0x60, /* 01100000 */ 0x60, /* 01100000 */ 0xf0, /* 11110000 */ 0x00, /* 00000000 */ /* * 115 0x73 's' */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ 0x7e, /* 01111110 */ 0xc0, /* 11000000 */ 0x7c, /* 01111100 */ 0x06, /* 00000110 */ 0xfc, /* 11111100 */ 0x00, /* 00000000 */ /* * 116 0x74 't' */ 0x30, /* 00110000 */ 0x30, /* 00110000 */ 0xfc, /* 11111100 */ 0x30, /* 00110000 */ 0x30, /* 00110000 */ 0x36, /* 00110110 */ 0x1c, /* 00011100 */ 0x00, /* 00000000 */ /* * 117 0x75 'u' */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ 0xcc, /* 11001100 */ 0xcc, /* 11001100 */ 0xcc, /* 11001100 */ 0xcc, /* 11001100 */ 0x76, /* 01110110 */ 0x00, /* 00000000 */ /* * 118 0x76 'v' */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ 0xc6, /* 11000110 */ 0xc6, /* 11000110 */ 0xc6, /* 11000110 */ 0x6c, /* 01101100 */ 0x38, /* 00111000 */ 0x00, /* 00000000 */ /* * 119 0x77 'w' */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ 0xc6, /* 11000110 */ 0xd6, /* 11010110 */ 0xd6, /* 11010110 */ 0xfe, /* 11111110 */ 0x6c, /* 01101100 */ 0x00, /* 00000000 */ /* * 120 0x78 'x' */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ 0xc6, /* 11000110 */ 0x6c, /* 01101100 */ 0x38, /* 00111000 */ 0x6c, /* 01101100 */ 0xc6, /* 11000110 */ 0x00, /* 00000000 */ /* * 121 0x79 'y' */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ 0xc6, /* 11000110 */ 0xc6, /* 11000110 */ 0xc6, /* 11000110 */ 0x7e, /* 01111110 */ 0x06, /* 00000110 */ 0xfc, /* 11111100 */ /* * 122 0x7a 'z' */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ 0x7e, /* 01111110 */ 0x4c, /* 01001100 */ 0x18, /* 00011000 */ 0x32, /* 00110010 */ 0x7e, /* 01111110 */ 0x00, /* 00000000 */ /* * 123 0x7b '{' */ 0x0e, /* 00001110 */ 0x18, /* 00011000 */ 0x18, /* 00011000 */ 0x70, /* 01110000 */ 0x18, /* 00011000 */ 0x18, /* 00011000 */ 0x0e, /* 00001110 */ 0x00, /* 00000000 */ /* * 124 0x7c '|' */ 0x18, /* 00011000 */ 0x18, /* 00011000 */ 0x18, /* 00011000 */ 0x18, /* 00011000 */ 0x18, /* 00011000 */ 0x18, /* 00011000 */ 0x18, /* 00011000 */ 0x00, /* 00000000 */ /* * 125 0x7d '}' */ 0x70, /* 01110000 */ 0x18, /* 00011000 */ 0x18, /* 00011000 */ 0x0e, /* 00001110 */ 0x18, /* 00011000 */ 0x18, /* 00011000 */ 0x70, /* 01110000 */ 0x00, /* 00000000 */ /* * 126 0x7e '~' */ 0x76, /* 01110110 */ 0xdc, /* 11011100 */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ /* * 127 0x7f '' */ 0x00, /* 00000000 */ 0x10, /* 00010000 */ 0x38, /* 00111000 */ 0x6c, /* 01101100 */ 0xc6, /* 11000110 */ 0xc6, /* 11000110 */ 0xfe, /* 11111110 */ 0x00, /* 00000000 */ /* * 128 0x80 '€' */ 0x7c, /* 01111100 */ 0xc6, /* 11000110 */ 0xc0, /* 11000000 */ 0xc0, /* 11000000 */ 0xc6, /* 11000110 */ 0x7c, /* 01111100 */ 0x0c, /* 00001100 */ 0x78, /* 01111000 */ /* * 129 0x81 '' */ 0xcc, /* 11001100 */ 0x00, /* 00000000 */ 0xcc, /* 11001100 */ 0xcc, /* 11001100 */ 0xcc, /* 11001100 */ 0xcc, /* 11001100 */ 0x76, /* 01110110 */ 0x00, /* 00000000 */ /* * 130 0x82 '‚' */ 0x0c, /* 00001100 */ 0x18, /* 00011000 */ 0x7c, /* 01111100 */ 0xc6, /* 11000110 */ 0xfe, /* 11111110 */ 0xc0, /* 11000000 */ 0x7c, /* 01111100 */ 0x00, /* 00000000 */ /* * 131 0x83 'ƒ' */ 0x7c, /* 01111100 */ 0x82, /* 10000010 */ 0x78, /* 01111000 */ 0x0c, /* 00001100 */ 0x7c, /* 01111100 */ 0xcc, /* 11001100 */ 0x76, /* 01110110 */ 0x00, /* 00000000 */ /* * 132 0x84 '„' */ 0xc6, /* 11000110 */ 0x00, /* 00000000 */ 0x78, /* 01111000 */ 0x0c, /* 00001100 */ 0x7c, /* 01111100 */ 0xcc, /* 11001100 */ 0x76, /* 01110110 */ 0x00, /* 00000000 */ /* * 133 0x85 '…' */ 0x30, /* 00110000 */ 0x18, /* 00011000 */ 0x78, /* 01111000 */ 0x0c, /* 00001100 */ 0x7c, /* 01111100 */ 0xcc, /* 11001100 */ 0x76, /* 01110110 */ 0x00, /* 00000000 */ /* * 134 0x86 '†' */ 0x30, /* 00110000 */ 0x30, /* 00110000 */ 0x78, /* 01111000 */ 0x0c, /* 00001100 */ 0x7c, /* 01111100 */ 0xcc, /* 11001100 */ 0x76, /* 01110110 */ 0x00, /* 00000000 */ /* * 135 0x87 '‡' */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ 0x7e, /* 01111110 */ 0xc0, /* 11000000 */ 0xc0, /* 11000000 */ 0x7e, /* 01111110 */ 0x0c, /* 00001100 */ 0x38, /* 00111000 */ /* * 136 0x88 'ˆ' */ 0x7c, /* 01111100 */ 0x82, /* 10000010 */ 0x7c, /* 01111100 */ 0xc6, /* 11000110 */ 0xfe, /* 11111110 */ 0xc0, /* 11000000 */ 0x7c, /* 01111100 */ 0x00, /* 00000000 */ /* * 137 0x89 '‰' */ 0xc6, /* 11000110 */ 0x00, /* 00000000 */ 0x7c, /* 01111100 */ 0xc6, /* 11000110 */ 0xfe, /* 11111110 */ 0xc0, /* 11000000 */ 0x7c, /* 01111100 */ 0x00, /* 00000000 */ /* * 138 0x8a 'Š' */ 0x30, /* 00110000 */ 0x18, /* 00011000 */ 0x7c, /* 01111100 */ 0xc6, /* 11000110 */ 0xfe, /* 11111110 */ 0xc0, /* 11000000 */ 0x7c, /* 01111100 */ 0x00, /* 00000000 */ /* * 139 0x8b '‹' */ 0x66, /* 01100110 */ 0x00, /* 00000000 */ 0x38, /* 00111000 */ 0x18, /* 00011000 */ 0x18, /* 00011000 */ 0x18, /* 00011000 */ 0x3c, /* 00111100 */ 0x00, /* 00000000 */ /* * 140 0x8c 'Œ' */ 0x7c, /* 01111100 */ 0x82, /* 10000010 */ 0x38, /* 00111000 */ 0x18, /* 00011000 */ 0x18, /* 00011000 */ 0x18, /* 00011000 */ 0x3c, /* 00111100 */ 0x00, /* 00000000 */ /* * 141 0x8d '' */ 0x30, /* 00110000 */ 0x18, /* 00011000 */ 0x00, /* 00000000 */ 0x38, /* 00111000 */ 0x18, /* 00011000 */ 0x18, /* 00011000 */ 0x3c, /* 00111100 */ 0x00, /* 00000000 */ /* * 142 0x8e 'Ž' */ 0xc6, /* 11000110 */ 0x38, /* 00111000 */ 0x6c, /* 01101100 */ 0xc6, /* 11000110 */ 0xfe, /* 11111110 */ 0xc6, /* 11000110 */ 0xc6, /* 11000110 */ 0x00, /* 00000000 */ /* * 143 0x8f '' */ 0x38, /* 00111000 */ 0x6c, /* 01101100 */ 0x7c, /* 01111100 */ 0xc6, /* 11000110 */ 0xfe, /* 11111110 */ 0xc6, /* 11000110 */ 0xc6, /* 11000110 */ 0x00, /* 00000000 */ /* * 144 0x90 '' */ 0x18, /* 00011000 */ 0x30, /* 00110000 */ 0xfe, /* 11111110 */ 0xc0, /* 11000000 */ 0xf8, /* 11111000 */ 0xc0, /* 11000000 */ 0xfe, /* 11111110 */ 0x00, /* 00000000 */ /* * 145 0x91 '‘' */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ 0x7e, /* 01111110 */ 0x18, /* 00011000 */ 0x7e, /* 01111110 */ 0xd8, /* 11011000 */ 0x7e, /* 01111110 */ 0x00, /* 00000000 */ /* * 146 0x92 '’' */ 0x3e, /* 00111110 */ 0x6c, /* 01101100 */ 0xcc, /* 11001100 */ 0xfe, /* 11111110 */ 0xcc, /* 11001100 */ 0xcc, /* 11001100 */ 0xce, /* 11001110 */ 0x00, /* 00000000 */ /* * 147 0x93 '“' */ 0x7c, /* 01111100 */ 0x82, /* 10000010 */ 0x7c, /* 01111100 */ 0xc6, /* 11000110 */ 0xc6, /* 11000110 */ 0xc6, /* 11000110 */ 0x7c, /* 01111100 */ 0x00, /* 00000000 */ /* * 148 0x94 '”' */ 0xc6, /* 11000110 */ 0x00, /* 00000000 */ 0x7c, /* 01111100 */ 0xc6, /* 11000110 */ 0xc6, /* 11000110 */ 0xc6, /* 11000110 */ 0x7c, /* 01111100 */ 0x00, /* 00000000 */ /* * 149 0x95 '•' */ 0x30, /* 00110000 */ 0x18, /* 00011000 */ 0x7c, /* 01111100 */ 0xc6, /* 11000110 */ 0xc6, /* 11000110 */ 0xc6, /* 11000110 */ 0x7c, /* 01111100 */ 0x00, /* 00000000 */ /* * 150 0x96 '–' */ 0x78, /* 01111000 */ 0x84, /* 10000100 */ 0x00, /* 00000000 */ 0xcc, /* 11001100 */ 0xcc, /* 11001100 */ 0xcc, /* 11001100 */ 0x76, /* 01110110 */ 0x00, /* 00000000 */ /* * 151 0x97 '—' */ 0x60, /* 01100000 */ 0x30, /* 00110000 */ 0xcc, /* 11001100 */ 0xcc, /* 11001100 */ 0xcc, /* 11001100 */ 0xcc, /* 11001100 */ 0x76, /* 01110110 */ 0x00, /* 00000000 */ /* * 152 0x98 '˜' */ 0xc6, /* 11000110 */ 0x00, /* 00000000 */ 0xc6, /* 11000110 */ 0xc6, /* 11000110 */ 0xc6, /* 11000110 */ 0x7e, /* 01111110 */ 0x06, /* 00000110 */ 0xfc, /* 11111100 */ /* * 153 0x99 '™' */ 0xc6, /* 11000110 */ 0x38, /* 00111000 */ 0x6c, /* 01101100 */ 0xc6, /* 11000110 */ 0xc6, /* 11000110 */ 0x6c, /* 01101100 */ 0x38, /* 00111000 */ 0x00, /* 00000000 */ /* * 154 0x9a 'š' */ 0xc6, /* 11000110 */ 0x00, /* 00000000 */ 0xc6, /* 11000110 */ 0xc6, /* 11000110 */ 0xc6, /* 11000110 */ 0xc6, /* 11000110 */ 0x7c, /* 01111100 */ 0x00, /* 00000000 */ /* * 155 0x9b '›' */ 0x18, /* 00011000 */ 0x18, /* 00011000 */ 0x7e, /* 01111110 */ 0xc0, /* 11000000 */ 0xc0, /* 11000000 */ 0x7e, /* 01111110 */ 0x18, /* 00011000 */ 0x18, /* 00011000 */ /* * 156 0x9c 'œ' */ 0x38, /* 00111000 */ 0x6c, /* 01101100 */ 0x64, /* 01100100 */ 0xf0, /* 11110000 */ 0x60, /* 01100000 */ 0x66, /* 01100110 */ 0xfc, /* 11111100 */ 0x00, /* 00000000 */ /* * 157 0x9d '' */ 0x66, /* 01100110 */ 0x66, /* 01100110 */ 0x3c, /* 00111100 */ 0x7e, /* 01111110 */ 0x18, /* 00011000 */ 0x7e, /* 01111110 */ 0x18, /* 00011000 */ 0x18, /* 00011000 */ /* * 158 0x9e 'ž' */ 0xf8, /* 11111000 */ 0xcc, /* 11001100 */ 0xcc, /* 11001100 */ 0xfa, /* 11111010 */ 0xc6, /* 11000110 */ 0xcf, /* 11001111 */ 0xc6, /* 11000110 */ 0xc7, /* 11000111 */ /* * 159 0x9f 'Ÿ' */ 0x0e, /* 00001110 */ 0x1b, /* 00011011 */ 0x18, /* 00011000 */ 0x3c, /* 00111100 */ 0x18, /* 00011000 */ 0xd8, /* 11011000 */ 0x70, /* 01110000 */ 0x00, /* 00000000 */ /* * 160 0xa0 ' ' */ 0x18, /* 00011000 */ 0x30, /* 00110000 */ 0x78, /* 01111000 */ 0x0c, /* 00001100 */ 0x7c, /* 01111100 */ 0xcc, /* 11001100 */ 0x76, /* 01110110 */ 0x00, /* 00000000 */ /* * 161 0xa1 '¡' */ 0x0c, /* 00001100 */ 0x18, /* 00011000 */ 0x00, /* 00000000 */ 0x38, /* 00111000 */ 0x18, /* 00011000 */ 0x18, /* 00011000 */ 0x3c, /* 00111100 */ 0x00, /* 00000000 */ /* * 162 0xa2 '¢' */ 0x0c, /* 00001100 */ 0x18, /* 00011000 */ 0x7c, /* 01111100 */ 0xc6, /* 11000110 */ 0xc6, /* 11000110 */ 0xc6, /* 11000110 */ 0x7c, /* 01111100 */ 0x00, /* 00000000 */ /* * 163 0xa3 '£' */ 0x18, /* 00011000 */ 0x30, /* 00110000 */ 0xcc, /* 11001100 */ 0xcc, /* 11001100 */ 0xcc, /* 11001100 */ 0xcc, /* 11001100 */ 0x76, /* 01110110 */ 0x00, /* 00000000 */ /* * 164 0xa4 '¤' */ 0x76, /* 01110110 */ 0xdc, /* 11011100 */ 0x00, /* 00000000 */ 0xdc, /* 11011100 */ 0x66, /* 01100110 */ 0x66, /* 01100110 */ 0x66, /* 01100110 */ 0x00, /* 00000000 */ /* * 165 0xa5 '¥' */ 0x76, /* 01110110 */ 0xdc, /* 11011100 */ 0x00, /* 00000000 */ 0xe6, /* 11100110 */ 0xf6, /* 11110110 */ 0xde, /* 11011110 */ 0xce, /* 11001110 */ 0x00, /* 00000000 */ /* * 166 0xa6 '¦' */ 0x3c, /* 00111100 */ 0x6c, /* 01101100 */ 0x6c, /* 01101100 */ 0x3e, /* 00111110 */ 0x00, /* 00000000 */ 0x7e, /* 01111110 */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ /* * 167 0xa7 '§' */ 0x38, /* 00111000 */ 0x6c, /* 01101100 */ 0x6c, /* 01101100 */ 0x38, /* 00111000 */ 0x00, /* 00000000 */ 0x7c, /* 01111100 */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ /* * 168 0xa8 '¨' */ 0x18, /* 00011000 */ 0x00, /* 00000000 */ 0x18, /* 00011000 */ 0x18, /* 00011000 */ 0x30, /* 00110000 */ 0x63, /* 01100011 */ 0x3e, /* 00111110 */ 0x00, /* 00000000 */ /* * 169 0xa9 '©' */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ 0xfe, /* 11111110 */ 0xc0, /* 11000000 */ 0xc0, /* 11000000 */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ /* * 170 0xaa 'ª' */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ 0xfe, /* 11111110 */ 0x06, /* 00000110 */ 0x06, /* 00000110 */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ /* * 171 0xab '«' */ 0x63, /* 01100011 */ 0xe6, /* 11100110 */ 0x6c, /* 01101100 */ 0x7e, /* 01111110 */ 0x33, /* 00110011 */ 0x66, /* 01100110 */ 0xcc, /* 11001100 */ 0x0f, /* 00001111 */ /* * 172 0xac '¬' */ 0x63, /* 01100011 */ 0xe6, /* 11100110 */ 0x6c, /* 01101100 */ 0x7a, /* 01111010 */ 0x36, /* 00110110 */ 0x6a, /* 01101010 */ 0xdf, /* 11011111 */ 0x06, /* 00000110 */ /* * 173 0xad '­' */ 0x18, /* 00011000 */ 0x00, /* 00000000 */ 0x18, /* 00011000 */ 0x18, /* 00011000 */ 0x3c, /* 00111100 */ 0x3c, /* 00111100 */ 0x18, /* 00011000 */ 0x00, /* 00000000 */ /* * 174 0xae '®' */ 0x00, /* 00000000 */ 0x33, /* 00110011 */ 0x66, /* 01100110 */ 0xcc, /* 11001100 */ 0x66, /* 01100110 */ 0x33, /* 00110011 */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ /* * 175 0xaf '¯' */ 0x00, /* 00000000 */ 0xcc, /* 11001100 */ 0x66, /* 01100110 */ 0x33, /* 00110011 */ 0x66, /* 01100110 */ 0xcc, /* 11001100 */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ /* * 176 0xb0 '°' */ 0x22, /* 00100010 */ 0x88, /* 10001000 */ 0x22, /* 00100010 */ 0x88, /* 10001000 */ 0x22, /* 00100010 */ 0x88, /* 10001000 */ 0x22, /* 00100010 */ 0x88, /* 10001000 */ /* * 177 0xb1 '±' */ 0x55, /* 01010101 */ 0xaa, /* 10101010 */ 0x55, /* 01010101 */ 0xaa, /* 10101010 */ 0x55, /* 01010101 */ 0xaa, /* 10101010 */ 0x55, /* 01010101 */ 0xaa, /* 10101010 */ /* * 178 0xb2 '²' */ 0x77, /* 01110111 */ 0xdd, /* 11011101 */ 0x77, /* 01110111 */ 0xdd, /* 11011101 */ 0x77, /* 01110111 */ 0xdd, /* 11011101 */ 0x77, /* 01110111 */ 0xdd, /* 11011101 */ /* * 179 0xb3 '³' */ 0x18, /* 00011000 */ 0x18, /* 00011000 */ 0x18, /* 00011000 */ 0x18, /* 00011000 */ 0x18, /* 00011000 */ 0x18, /* 00011000 */ 0x18, /* 00011000 */ 0x18, /* 00011000 */ /* * 180 0xb4 '´' */ 0x18, /* 00011000 */ 0x18, /* 00011000 */ 0x18, /* 00011000 */ 0x18, /* 00011000 */ 0xf8, /* 11111000 */ 0x18, /* 00011000 */ 0x18, /* 00011000 */ 0x18, /* 00011000 */ /* * 181 0xb5 'µ' */ 0x18, /* 00011000 */ 0x18, /* 00011000 */ 0xf8, /* 11111000 */ 0x18, /* 00011000 */ 0xf8, /* 11111000 */ 0x18, /* 00011000 */ 0x18, /* 00011000 */ 0x18, /* 00011000 */ /* * 182 0xb6 '¶' */ 0x36, /* 00110110 */ 0x36, /* 00110110 */ 0x36, /* 00110110 */ 0x36, /* 00110110 */ 0xf6, /* 11110110 */ 0x36, /* 00110110 */ 0x36, /* 00110110 */ 0x36, /* 00110110 */ /* * 183 0xb7 '·' */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ 0xfe, /* 11111110 */ 0x36, /* 00110110 */ 0x36, /* 00110110 */ 0x36, /* 00110110 */ /* * 184 0xb8 '¸' */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ 0xf8, /* 11111000 */ 0x18, /* 00011000 */ 0xf8, /* 11111000 */ 0x18, /* 00011000 */ 0x18, /* 00011000 */ 0x18, /* 00011000 */ /* * 185 0xb9 '¹' */ 0x36, /* 00110110 */ 0x36, /* 00110110 */ 0xf6, /* 11110110 */ 0x06, /* 00000110 */ 0xf6, /* 11110110 */ 0x36, /* 00110110 */ 0x36, /* 00110110 */ 0x36, /* 00110110 */ /* * 186 0xba 'º' */ 0x36, /* 00110110 */ 0x36, /* 00110110 */ 0x36, /* 00110110 */ 0x36, /* 00110110 */ 0x36, /* 00110110 */ 0x36, /* 00110110 */ 0x36, /* 00110110 */ 0x36, /* 00110110 */ /* * 187 0xbb '»' */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ 0xfe, /* 11111110 */ 0x06, /* 00000110 */ 0xf6, /* 11110110 */ 0x36, /* 00110110 */ 0x36, /* 00110110 */ 0x36, /* 00110110 */ /* * 188 0xbc '¼' */ 0x36, /* 00110110 */ 0x36, /* 00110110 */ 0xf6, /* 11110110 */ 0x06, /* 00000110 */ 0xfe, /* 11111110 */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ /* * 189 0xbd '½' */ 0x36, /* 00110110 */ 0x36, /* 00110110 */ 0x36, /* 00110110 */ 0x36, /* 00110110 */ 0xfe, /* 11111110 */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ /* * 190 0xbe '¾' */ 0x18, /* 00011000 */ 0x18, /* 00011000 */ 0xf8, /* 11111000 */ 0x18, /* 00011000 */ 0xf8, /* 11111000 */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ /* * 191 0xbf '¿' */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ 0xf8, /* 11111000 */ 0x18, /* 00011000 */ 0x18, /* 00011000 */ 0x18, /* 00011000 */ /* * 192 0xc0 'À' */ 0x18, /* 00011000 */ 0x18, /* 00011000 */ 0x18, /* 00011000 */ 0x18, /* 00011000 */ 0x1f, /* 00011111 */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ /* * 193 0xc1 'Á' */ 0x18, /* 00011000 */ 0x18, /* 00011000 */ 0x18, /* 00011000 */ 0x18, /* 00011000 */ 0xff, /* 11111111 */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ /* * 194 0xc2 'Â' */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ 0xff, /* 11111111 */ 0x18, /* 00011000 */ 0x18, /* 00011000 */ 0x18, /* 00011000 */ /* * 195 0xc3 'Ã' */ 0x18, /* 00011000 */ 0x18, /* 00011000 */ 0x18, /* 00011000 */ 0x18, /* 00011000 */ 0x1f, /* 00011111 */ 0x18, /* 00011000 */ 0x18, /* 00011000 */ 0x18, /* 00011000 */ /* * 196 0xc4 'Ä' */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ 0xff, /* 11111111 */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ /* * 197 0xc5 'Å' */ 0x18, /* 00011000 */ 0x18, /* 00011000 */ 0x18, /* 00011000 */ 0x18, /* 00011000 */ 0xff, /* 11111111 */ 0x18, /* 00011000 */ 0x18, /* 00011000 */ 0x18, /* 00011000 */ /* * 198 0xc6 'Æ' */ 0x18, /* 00011000 */ 0x18, /* 00011000 */ 0x1f, /* 00011111 */ 0x18, /* 00011000 */ 0x1f, /* 00011111 */ 0x18, /* 00011000 */ 0x18, /* 00011000 */ 0x18, /* 00011000 */ /* * 199 0xc7 'Ç' */ 0x36, /* 00110110 */ 0x36, /* 00110110 */ 0x36, /* 00110110 */ 0x36, /* 00110110 */ 0x37, /* 00110111 */ 0x36, /* 00110110 */ 0x36, /* 00110110 */ 0x36, /* 00110110 */ /* * 200 0xc8 'È' */ 0x36, /* 00110110 */ 0x36, /* 00110110 */ 0x37, /* 00110111 */ 0x30, /* 00110000 */ 0x3f, /* 00111111 */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ /* * 201 0xc9 'É' */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ 0x3f, /* 00111111 */ 0x30, /* 00110000 */ 0x37, /* 00110111 */ 0x36, /* 00110110 */ 0x36, /* 00110110 */ 0x36, /* 00110110 */ /* * 202 0xca 'Ê' */ 0x36, /* 00110110 */ 0x36, /* 00110110 */ 0xf7, /* 11110111 */ 0x00, /* 00000000 */ 0xff, /* 11111111 */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ /* * 203 0xcb 'Ë' */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ 0xff, /* 11111111 */ 0x00, /* 00000000 */ 0xf7, /* 11110111 */ 0x36, /* 00110110 */ 0x36, /* 00110110 */ 0x36, /* 00110110 */ /* * 204 0xcc 'Ì' */ 0x36, /* 00110110 */ 0x36, /* 00110110 */ 0x37, /* 00110111 */ 0x30, /* 00110000 */ 0x37, /* 00110111 */ 0x36, /* 00110110 */ 0x36, /* 00110110 */ 0x36, /* 00110110 */ /* * 205 0xcd 'Í' */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ 0xff, /* 11111111 */ 0x00, /* 00000000 */ 0xff, /* 11111111 */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ /* * 206 0xce 'Î' */ 0x36, /* 00110110 */ 0x36, /* 00110110 */ 0xf7, /* 11110111 */ 0x00, /* 00000000 */ 0xf7, /* 11110111 */ 0x36, /* 00110110 */ 0x36, /* 00110110 */ 0x36, /* 00110110 */ /* * 207 0xcf 'Ï' */ 0x18, /* 00011000 */ 0x18, /* 00011000 */ 0xff, /* 11111111 */ 0x00, /* 00000000 */ 0xff, /* 11111111 */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ /* * 208 0xd0 'Ð' */ 0x36, /* 00110110 */ 0x36, /* 00110110 */ 0x36, /* 00110110 */ 0x36, /* 00110110 */ 0xff, /* 11111111 */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ /* * 209 0xd1 'Ñ' */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ 0xff, /* 11111111 */ 0x00, /* 00000000 */ 0xff, /* 11111111 */ 0x18, /* 00011000 */ 0x18, /* 00011000 */ 0x18, /* 00011000 */ /* * 210 0xd2 'Ò' */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ 0xff, /* 11111111 */ 0x36, /* 00110110 */ 0x36, /* 00110110 */ 0x36, /* 00110110 */ /* * 211 0xd3 'Ó' */ 0x36, /* 00110110 */ 0x36, /* 00110110 */ 0x36, /* 00110110 */ 0x36, /* 00110110 */ 0x3f, /* 00111111 */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ /* * 212 0xd4 'Ô' */ 0x18, /* 00011000 */ 0x18, /* 00011000 */ 0x1f, /* 00011111 */ 0x18, /* 00011000 */ 0x1f, /* 00011111 */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ /* * 213 0xd5 'Õ' */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ 0x1f, /* 00011111 */ 0x18, /* 00011000 */ 0x1f, /* 00011111 */ 0x18, /* 00011000 */ 0x18, /* 00011000 */ 0x18, /* 00011000 */ /* * 214 0xd6 'Ö' */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ 0x3f, /* 00111111 */ 0x36, /* 00110110 */ 0x36, /* 00110110 */ 0x36, /* 00110110 */ /* * 215 0xd7 '×' */ 0x36, /* 00110110 */ 0x36, /* 00110110 */ 0x36, /* 00110110 */ 0x36, /* 00110110 */ 0xff, /* 11111111 */ 0x36, /* 00110110 */ 0x36, /* 00110110 */ 0x36, /* 00110110 */ /* * 216 0xd8 'Ø' */ 0x18, /* 00011000 */ 0x18, /* 00011000 */ 0xff, /* 11111111 */ 0x18, /* 00011000 */ 0xff, /* 11111111 */ 0x18, /* 00011000 */ 0x18, /* 00011000 */ 0x18, /* 00011000 */ /* * 217 0xd9 'Ù' */ 0x18, /* 00011000 */ 0x18, /* 00011000 */ 0x18, /* 00011000 */ 0x18, /* 00011000 */ 0xf8, /* 11111000 */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ /* * 218 0xda 'Ú' */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ 0x1f, /* 00011111 */ 0x18, /* 00011000 */ 0x18, /* 00011000 */ 0x18, /* 00011000 */ /* * 219 0xdb 'Û' */ 0xff, /* 11111111 */ 0xff, /* 11111111 */ 0xff, /* 11111111 */ 0xff, /* 11111111 */ 0xff, /* 11111111 */ 0xff, /* 11111111 */ 0xff, /* 11111111 */ 0xff, /* 11111111 */ /* * 220 0xdc 'Ü' */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ 0xff, /* 11111111 */ 0xff, /* 11111111 */ 0xff, /* 11111111 */ 0xff, /* 11111111 */ /* * 221 0xdd 'Ý' */ 0xf0, /* 11110000 */ 0xf0, /* 11110000 */ 0xf0, /* 11110000 */ 0xf0, /* 11110000 */ 0xf0, /* 11110000 */ 0xf0, /* 11110000 */ 0xf0, /* 11110000 */ 0xf0, /* 11110000 */ /* * 222 0xde 'Þ' */ 0x0f, /* 00001111 */ 0x0f, /* 00001111 */ 0x0f, /* 00001111 */ 0x0f, /* 00001111 */ 0x0f, /* 00001111 */ 0x0f, /* 00001111 */ 0x0f, /* 00001111 */ 0x0f, /* 00001111 */ /* * 223 0xdf 'ß' */ 0xff, /* 11111111 */ 0xff, /* 11111111 */ 0xff, /* 11111111 */ 0xff, /* 11111111 */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ /* * 224 0xe0 'à' */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ 0x76, /* 01110110 */ 0xdc, /* 11011100 */ 0xc8, /* 11001000 */ 0xdc, /* 11011100 */ 0x76, /* 01110110 */ 0x00, /* 00000000 */ /* * 225 0xe1 'á' */ 0x78, /* 01111000 */ 0xcc, /* 11001100 */ 0xcc, /* 11001100 */ 0xd8, /* 11011000 */ 0xcc, /* 11001100 */ 0xc6, /* 11000110 */ 0xcc, /* 11001100 */ 0x00, /* 00000000 */ /* * 226 0xe2 'â' */ 0xfe, /* 11111110 */ 0xc6, /* 11000110 */ 0xc0, /* 11000000 */ 0xc0, /* 11000000 */ 0xc0, /* 11000000 */ 0xc0, /* 11000000 */ 0xc0, /* 11000000 */ 0x00, /* 00000000 */ /* * 227 0xe3 'ã' */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ 0xfe, /* 11111110 */ 0x6c, /* 01101100 */ 0x6c, /* 01101100 */ 0x6c, /* 01101100 */ 0x6c, /* 01101100 */ 0x00, /* 00000000 */ /* * 228 0xe4 'ä' */ 0xfe, /* 11111110 */ 0xc6, /* 11000110 */ 0x60, /* 01100000 */ 0x30, /* 00110000 */ 0x60, /* 01100000 */ 0xc6, /* 11000110 */ 0xfe, /* 11111110 */ 0x00, /* 00000000 */ /* * 229 0xe5 'å' */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ 0x7e, /* 01111110 */ 0xd8, /* 11011000 */ 0xd8, /* 11011000 */ 0xd8, /* 11011000 */ 0x70, /* 01110000 */ 0x00, /* 00000000 */ /* * 230 0xe6 'æ' */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ 0x66, /* 01100110 */ 0x66, /* 01100110 */ 0x66, /* 01100110 */ 0x66, /* 01100110 */ 0x7c, /* 01111100 */ 0xc0, /* 11000000 */ /* * 231 0xe7 'ç' */ 0x00, /* 00000000 */ 0x76, /* 01110110 */ 0xdc, /* 11011100 */ 0x18, /* 00011000 */ 0x18, /* 00011000 */ 0x18, /* 00011000 */ 0x18, /* 00011000 */ 0x00, /* 00000000 */ /* * 232 0xe8 'è' */ 0x7e, /* 01111110 */ 0x18, /* 00011000 */ 0x3c, /* 00111100 */ 0x66, /* 01100110 */ 0x66, /* 01100110 */ 0x3c, /* 00111100 */ 0x18, /* 00011000 */ 0x7e, /* 01111110 */ /* * 233 0xe9 'é' */ 0x38, /* 00111000 */ 0x6c, /* 01101100 */ 0xc6, /* 11000110 */ 0xfe, /* 11111110 */ 0xc6, /* 11000110 */ 0x6c, /* 01101100 */ 0x38, /* 00111000 */ 0x00, /* 00000000 */ /* * 234 0xea 'ê' */ 0x38, /* 00111000 */ 0x6c, /* 01101100 */ 0xc6, /* 11000110 */ 0xc6, /* 11000110 */ 0x6c, /* 01101100 */ 0x6c, /* 01101100 */ 0xee, /* 11101110 */ 0x00, /* 00000000 */ /* * 235 0xeb 'ë' */ 0x0e, /* 00001110 */ 0x18, /* 00011000 */ 0x0c, /* 00001100 */ 0x3e, /* 00111110 */ 0x66, /* 01100110 */ 0x66, /* 01100110 */ 0x3c, /* 00111100 */ 0x00, /* 00000000 */ /* * 236 0xec 'ì' */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ 0x7e, /* 01111110 */ 0xdb, /* 11011011 */ 0xdb, /* 11011011 */ 0x7e, /* 01111110 */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ /* * 237 0xed 'í' */ 0x06, /* 00000110 */ 0x0c, /* 00001100 */ 0x7e, /* 01111110 */ 0xdb, /* 11011011 */ 0xdb, /* 11011011 */ 0x7e, /* 01111110 */ 0x60, /* 01100000 */ 0xc0, /* 11000000 */ /* * 238 0xee 'î' */ 0x1e, /* 00011110 */ 0x30, /* 00110000 */ 0x60, /* 01100000 */ 0x7e, /* 01111110 */ 0x60, /* 01100000 */ 0x30, /* 00110000 */ 0x1e, /* 00011110 */ 0x00, /* 00000000 */ /* * 239 0xef 'ï' */ 0x00, /* 00000000 */ 0x7c, /* 01111100 */ 0xc6, /* 11000110 */ 0xc6, /* 11000110 */ 0xc6, /* 11000110 */ 0xc6, /* 11000110 */ 0xc6, /* 11000110 */ 0x00, /* 00000000 */ /* * 240 0xf0 'ð' */ 0x00, /* 00000000 */ 0xfe, /* 11111110 */ 0x00, /* 00000000 */ 0xfe, /* 11111110 */ 0x00, /* 00000000 */ 0xfe, /* 11111110 */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ /* * 241 0xf1 'ñ' */ 0x18, /* 00011000 */ 0x18, /* 00011000 */ 0x7e, /* 01111110 */ 0x18, /* 00011000 */ 0x18, /* 00011000 */ 0x00, /* 00000000 */ 0x7e, /* 01111110 */ 0x00, /* 00000000 */ /* * 242 0xf2 'ò' */ 0x30, /* 00110000 */ 0x18, /* 00011000 */ 0x0c, /* 00001100 */ 0x18, /* 00011000 */ 0x30, /* 00110000 */ 0x00, /* 00000000 */ 0x7e, /* 01111110 */ 0x00, /* 00000000 */ /* * 243 0xf3 'ó' */ 0x0c, /* 00001100 */ 0x18, /* 00011000 */ 0x30, /* 00110000 */ 0x18, /* 00011000 */ 0x0c, /* 00001100 */ 0x00, /* 00000000 */ 0x7e, /* 01111110 */ 0x00, /* 00000000 */ /* * 244 0xf4 'ô' */ 0x0e, /* 00001110 */ 0x1b, /* 00011011 */ 0x1b, /* 00011011 */ 0x18, /* 00011000 */ 0x18, /* 00011000 */ 0x18, /* 00011000 */ 0x18, /* 00011000 */ 0x18, /* 00011000 */ /* * 245 0xf5 'õ' */ 0x18, /* 00011000 */ 0x18, /* 00011000 */ 0x18, /* 00011000 */ 0x18, /* 00011000 */ 0x18, /* 00011000 */ 0xd8, /* 11011000 */ 0xd8, /* 11011000 */ 0x70, /* 01110000 */ /* * 246 0xf6 'ö' */ 0x00, /* 00000000 */ 0x18, /* 00011000 */ 0x00, /* 00000000 */ 0x7e, /* 01111110 */ 0x00, /* 00000000 */ 0x18, /* 00011000 */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ /* * 247 0xf7 '÷' */ 0x00, /* 00000000 */ 0x76, /* 01110110 */ 0xdc, /* 11011100 */ 0x00, /* 00000000 */ 0x76, /* 01110110 */ 0xdc, /* 11011100 */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ /* * 248 0xf8 'ø' */ 0x38, /* 00111000 */ 0x6c, /* 01101100 */ 0x6c, /* 01101100 */ 0x38, /* 00111000 */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ /* * 249 0xf9 'ù' */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ 0x18, /* 00011000 */ 0x18, /* 00011000 */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ /* * 250 0xfa 'ú' */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ 0x18, /* 00011000 */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ /* * 251 0xfb 'û' */ 0x0f, /* 00001111 */ 0x0c, /* 00001100 */ 0x0c, /* 00001100 */ 0x0c, /* 00001100 */ 0xec, /* 11101100 */ 0x6c, /* 01101100 */ 0x3c, /* 00111100 */ 0x1c, /* 00011100 */ /* * 252 0xfc 'ü' */ 0x6c, /* 01101100 */ 0x36, /* 00110110 */ 0x36, /* 00110110 */ 0x36, /* 00110110 */ 0x36, /* 00110110 */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ /* * 253 0xfd 'ý' */ 0x78, /* 01111000 */ 0x0c, /* 00001100 */ 0x18, /* 00011000 */ 0x30, /* 00110000 */ 0x7c, /* 01111100 */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ /* * 254 0xfe 'þ' */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ 0x3c, /* 00111100 */ 0x3c, /* 00111100 */ 0x3c, /* 00111100 */ 0x3c, /* 00111100 */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ /* * 255 0xff ' ' */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ }; pygame_sdl2-2.1.0-for-renpy-6.99.14.1/src/alphablit.c0000664000175000017500000023040012656774334021161 0ustar tomtom00000000000000/* pygame - Python Game Library Copyright (C) 2000-2001 Pete Shinners Copyright (C) 2006 Rene Dudfield Copyright (C) 2007 Marcus von Appen This library is free software; you can redistribute it and/or modify it under the terms of the GNU Library General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public License for more details. You should have received a copy of the GNU Library General Public License along with this library; if not, write to the Free Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA Pete Shinners pete@shinners.org */ #include "surface.h" /* The structure passed to the low level blit functions */ typedef struct { int width; int height; Uint8 *s_pixels; int s_pxskip; int s_skip; Uint8 *d_pixels; int d_pxskip; int d_skip; SDL_PixelFormat *src; SDL_PixelFormat *dst; Uint32 src_flags; Uint32 dst_flags; } SDL_BlitInfo; static void alphablit_alpha (SDL_BlitInfo * info); #if 0 static void alphablit_colorkey (SDL_BlitInfo * info); #endif static void alphablit_solid (SDL_BlitInfo * info); static void blit_blend_add (SDL_BlitInfo * info); static void blit_blend_sub (SDL_BlitInfo * info); static void blit_blend_mul (SDL_BlitInfo * info); static void blit_blend_min (SDL_BlitInfo * info); static void blit_blend_max (SDL_BlitInfo * info); static void blit_blend_rgba_add (SDL_BlitInfo * info); static void blit_blend_rgba_sub (SDL_BlitInfo * info); static void blit_blend_rgba_mul (SDL_BlitInfo * info); static void blit_blend_rgba_min (SDL_BlitInfo * info); static void blit_blend_rgba_max (SDL_BlitInfo * info); static void blit_blend_premultiplied (SDL_BlitInfo * info); static int SoftBlitPyGame (SDL_Surface * src, SDL_Rect * srcrect, SDL_Surface * dst, SDL_Rect * dstrect, int the_args); extern int SDL_RLESurface (SDL_Surface * surface); extern void SDL_UnRLESurface (SDL_Surface * surface, int recode); static int SoftBlitPyGame (SDL_Surface * src, SDL_Rect * srcrect, SDL_Surface * dst, SDL_Rect * dstrect, int the_args) { int okay; int src_locked; int dst_locked; /* Everything is okay at the beginning... */ okay = 1; /* Lock the destination if it's in hardware */ dst_locked = 0; if (SDL_MUSTLOCK (dst)) { if (SDL_LockSurface (dst) < 0) okay = 0; else dst_locked = 1; } /* Lock the source if it's in hardware */ src_locked = 0; if (SDL_MUSTLOCK (src)) { if (SDL_LockSurface (src) < 0) okay = 0; else src_locked = 1; } /* Set up source and destination buffer pointers, and BLIT! */ if (okay && srcrect->w && srcrect->h) { SDL_BlitInfo info; /* Set up the blit information */ info.width = srcrect->w; info.height = srcrect->h; info.s_pixels = (Uint8 *) src->pixels + (Uint16) srcrect->y * src->pitch + (Uint16) srcrect->x * src->format->BytesPerPixel; info.s_pxskip = src->format->BytesPerPixel; info.s_skip = src->pitch - info.width * src->format->BytesPerPixel; info.d_pixels = (Uint8 *) dst->pixels + (Uint16) dstrect->y * dst->pitch + (Uint16) dstrect->x * dst->format->BytesPerPixel; info.d_pxskip = dst->format->BytesPerPixel; info.d_skip = dst->pitch - info.width * dst->format->BytesPerPixel; info.src = src->format; info.dst = dst->format; info.src_flags = src->flags; info.dst_flags = dst->flags; if (info.d_pixels > info.s_pixels) { int span = info.width * info.src->BytesPerPixel; Uint8 *srcpixend = info.s_pixels + (info.height - 1) * src->pitch + span; if (info.d_pixels < srcpixend) { int dstoffset = (info.d_pixels - info.s_pixels) % src->pitch; if (dstoffset < span || dstoffset > src->pitch - span) { /* Overlapping Self blit with positive destination offset. Reverse direction of the blit. */ info.s_pixels = srcpixend - info.s_pxskip; info.s_pxskip = -info.s_pxskip; info.s_skip = -info.s_skip; info.d_pixels = (info.d_pixels + (info.height - 1) * dst->pitch + span - info.d_pxskip); info.d_pxskip = -info.d_pxskip; info.d_skip = -info.d_skip; } } } switch (the_args) { case 0: { if (src->format->Amask) alphablit_alpha (&info); else alphablit_solid (&info); break; } case PYGAME_BLEND_ADD: { blit_blend_add (&info); break; } case PYGAME_BLEND_SUB: { blit_blend_sub (&info); break; } case PYGAME_BLEND_MULT: { blit_blend_mul (&info); break; } case PYGAME_BLEND_MIN: { blit_blend_min (&info); break; } case PYGAME_BLEND_MAX: { blit_blend_max (&info); break; } case PYGAME_BLEND_RGBA_ADD: { blit_blend_rgba_add (&info); break; } case PYGAME_BLEND_RGBA_SUB: { blit_blend_rgba_sub (&info); break; } case PYGAME_BLEND_RGBA_MULT: { blit_blend_rgba_mul (&info); break; } case PYGAME_BLEND_RGBA_MIN: { blit_blend_rgba_min (&info); break; } case PYGAME_BLEND_RGBA_MAX: { blit_blend_rgba_max (&info); break; } case PYGAME_BLEND_PREMULTIPLIED: { blit_blend_premultiplied (&info); break; } default: { SDL_SetError ("Invalid argument passed to blit."); okay = 0; break; } } } /* We need to unlock the surfaces if they're locked */ if (dst_locked) SDL_UnlockSurface (dst); if (src_locked) SDL_UnlockSurface (src); /* Blit is done! */ return (okay ? 0 : -1); } /* --------------------------------------------------------- */ static void blit_blend_rgba_add (SDL_BlitInfo * info) { int n; int width = info->width; int height = info->height; Uint8 *src = info->s_pixels; int srcpxskip = info->s_pxskip; int srcskip = info->s_skip; Uint8 *dst = info->d_pixels; int dstpxskip = info->d_pxskip; int dstskip = info->d_skip; SDL_PixelFormat *srcfmt = info->src; SDL_PixelFormat *dstfmt = info->dst; int srcbpp = srcfmt->BytesPerPixel; int dstbpp = dstfmt->BytesPerPixel; Uint8 dR, dG, dB, dA, sR, sG, sB, sA; Uint32 pixel; Uint32 tmp; int srcppa = (srcfmt->Amask); int dstppa = (dstfmt->Amask); if (!dstppa) { blit_blend_add (info); return; } if (srcbpp == 4 && dstbpp == 4 && srcfmt->Rmask == dstfmt->Rmask && srcfmt->Gmask == dstfmt->Gmask && srcfmt->Bmask == dstfmt->Bmask && srcfmt->Amask == dstfmt->Amask && srcfmt->Amask) { int incr = srcpxskip > 0 ? 1 : -1; if (incr < 0) { src += 3; dst += 3; } while (height--) { LOOP_UNROLLED4( { REPEAT_4( { tmp = (*dst) + (*src); (*dst) = (tmp <= 255 ? tmp : 255); src += incr; dst += incr; }); }, n, width); src += srcskip; dst += dstskip; } return; } if (srcbpp == 1) { if (dstbpp == 1) { while (height--) { LOOP_UNROLLED4( { GET_PIXELVALS_1(sR, sG, sB, sA, src, srcfmt); GET_PIXELVALS_1(dR, dG, dB, dA, dst, dstfmt); BLEND_RGBA_ADD (tmp, sR, sG, sB, sA, dR, dG, dB, dA); CREATE_PIXEL(dst, dR, dG, dB, dA, dstbpp, dstfmt); src += srcpxskip; dst += dstpxskip; }, n, width); src += srcskip; dst += dstskip; } } else /* dstbpp > 1 */ { while (height--) { LOOP_UNROLLED4( { GET_PIXELVALS_1(sR, sG, sB, sA, src, srcfmt); GET_PIXEL (pixel, dstbpp, dst); GET_PIXELVALS (dR, dG, dB, dA, pixel, dstfmt, dstppa); BLEND_RGBA_ADD (tmp, sR, sG, sB, sA, dR, dG, dB, dA); CREATE_PIXEL(dst, dR, dG, dB, dA, dstbpp, dstfmt); src += srcpxskip; dst += dstpxskip; }, n, width); src += srcskip; dst += dstskip; } } } else /* srcbpp > 1 */ { if (dstbpp == 1) { while (height--) { LOOP_UNROLLED4( { GET_PIXEL(pixel, srcbpp, src); GET_PIXELVALS (sR, sG, sB, sA, pixel, srcfmt, srcppa); GET_PIXELVALS_1(dR, dG, dB, dA, dst, dstfmt); BLEND_RGBA_ADD (tmp, sR, sG, sB, sA, dR, dG, dB, dA); CREATE_PIXEL(dst, dR, dG, dB, dA, dstbpp, dstfmt); src += srcpxskip; dst += dstpxskip; }, n, width); src += srcskip; dst += dstskip; } } else /* dstbpp > 1 */ { while (height--) { LOOP_UNROLLED4( { GET_PIXEL(pixel, srcbpp, src); GET_PIXELVALS (sR, sG, sB, sA, pixel, srcfmt, srcppa); GET_PIXEL (pixel, dstbpp, dst); GET_PIXELVALS (dR, dG, dB, dA, pixel, dstfmt, dstppa); BLEND_RGBA_ADD (tmp, sR, sG, sB, sA, dR, dG, dB, dA); CREATE_PIXEL(dst, dR, dG, dB, dA, dstbpp, dstfmt); src += srcpxskip; dst += dstpxskip; }, n, width); src += srcskip; dst += dstskip; } } } } static void blit_blend_rgba_sub (SDL_BlitInfo * info) { int n; int width = info->width; int height = info->height; Uint8 *src = info->s_pixels; int srcpxskip = info->s_pxskip; int srcskip = info->s_skip; Uint8 *dst = info->d_pixels; int dstpxskip = info->d_pxskip; int dstskip = info->d_skip; SDL_PixelFormat *srcfmt = info->src; SDL_PixelFormat *dstfmt = info->dst; int srcbpp = srcfmt->BytesPerPixel; int dstbpp = dstfmt->BytesPerPixel; Uint8 dR, dG, dB, dA, sR, sG, sB, sA; Uint32 pixel; Sint32 tmp2; int srcppa = (srcfmt->Amask); int dstppa = (dstfmt->Amask); if (!dstppa) { blit_blend_sub (info); return; } if (srcbpp == 4 && dstbpp == 4 && srcfmt->Rmask == dstfmt->Rmask && srcfmt->Gmask == dstfmt->Gmask && srcfmt->Bmask == dstfmt->Bmask && srcfmt->Amask == dstfmt->Amask && srcfmt->Amask) { int incr = srcpxskip > 0 ? 1 : -1; if (incr < 0) { src += 3; dst += 3; } while (height--) { LOOP_UNROLLED4( { REPEAT_4( { tmp2 = (*dst) - (*src); (*dst) = (tmp2 >= 0 ? tmp2 : 0); src += incr; dst += incr; }); }, n, width); src += srcskip; dst += dstskip; } return; } if (srcbpp == 1) { if (dstbpp == 1) { while (height--) { LOOP_UNROLLED4( { GET_PIXELVALS_1(sR, sG, sB, sA, src, srcfmt); GET_PIXELVALS_1(dR, dG, dB, dA, dst, dstfmt); BLEND_RGBA_SUB (tmp2, sR, sG, sB, sA, dR, dG, dB, dA); CREATE_PIXEL(dst, dR, dG, dB, dA, dstbpp, dstfmt); src += srcpxskip; dst += dstpxskip; }, n, width); src += srcskip; dst += dstskip; } } else /* dstbpp > 1 */ { while (height--) { LOOP_UNROLLED4( { GET_PIXELVALS_1(sR, sG, sB, sA, src, srcfmt); GET_PIXEL (pixel, dstbpp, dst); GET_PIXELVALS (dR, dG, dB, dA, pixel, dstfmt, dstppa); BLEND_RGBA_SUB (tmp2, sR, sG, sB, sA, dR, dG, dB, dA); CREATE_PIXEL(dst, dR, dG, dB, dA, dstbpp, dstfmt); src += srcpxskip; dst += dstpxskip; }, n, width); src += srcskip; dst += dstskip; } } } else /* srcbpp > 1 */ { if (dstbpp == 1) { while (height--) { LOOP_UNROLLED4( { GET_PIXEL(pixel, srcbpp, src); GET_PIXELVALS (sR, sG, sB, sA, pixel, srcfmt, srcppa); GET_PIXELVALS_1(dR, dG, dB, dA, dst, dstfmt); BLEND_RGBA_SUB (tmp2, sR, sG, sB, sA, dR, dG, dB, dA); CREATE_PIXEL(dst, dR, dG, dB, dA, dstbpp, dstfmt); src += srcpxskip; dst += dstpxskip; }, n, width); src += srcskip; dst += dstskip; } } else /* dstbpp > 1 */ { while (height--) { LOOP_UNROLLED4( { GET_PIXEL(pixel, srcbpp, src); GET_PIXELVALS (sR, sG, sB, sA, pixel, srcfmt, srcppa); GET_PIXEL (pixel, dstbpp, dst); GET_PIXELVALS (dR, dG, dB, dA, pixel, dstfmt, dstppa); BLEND_RGBA_SUB (tmp2, sR, sG, sB, sA, dR, dG, dB, dA); CREATE_PIXEL(dst, dR, dG, dB, dA, dstbpp, dstfmt); src += srcpxskip; dst += dstpxskip; }, n, width); src += srcskip; dst += dstskip; } } } } static void blit_blend_rgba_mul (SDL_BlitInfo * info) { int n; int width = info->width; int height = info->height; Uint8 *src = info->s_pixels; int srcpxskip = info->s_pxskip; int srcskip = info->s_skip; Uint8 *dst = info->d_pixels; int dstpxskip = info->d_pxskip; int dstskip = info->d_skip; SDL_PixelFormat *srcfmt = info->src; SDL_PixelFormat *dstfmt = info->dst; int srcbpp = srcfmt->BytesPerPixel; int dstbpp = dstfmt->BytesPerPixel; Uint8 dR, dG, dB, dA, sR, sG, sB, sA; Uint32 pixel; Uint32 tmp; int srcppa = (srcfmt->Amask); int dstppa = (dstfmt->Amask); if (!dstppa) { blit_blend_mul (info); return; } if (srcbpp == 4 && dstbpp == 4 && srcfmt->Rmask == dstfmt->Rmask && srcfmt->Gmask == dstfmt->Gmask && srcfmt->Bmask == dstfmt->Bmask && srcfmt->Amask == dstfmt->Amask && srcfmt->Amask) { int incr = srcpxskip > 0 ? 1 : -1; if (incr < 0) { src += 3; dst += 3; } while (height--) { LOOP_UNROLLED4( { REPEAT_4( { tmp = ((*dst) && (*src)) ? ((*dst) * (*src)) >> 8 : 0; (*dst) = (tmp <= 255 ? tmp : 255); src += incr; dst += incr; }); }, n, width); src += srcskip; dst += dstskip; } return; } if (srcbpp == 1) { if (dstbpp == 1) { while (height--) { LOOP_UNROLLED4( { GET_PIXELVALS_1(sR, sG, sB, sA, src, srcfmt); GET_PIXELVALS_1(dR, dG, dB, dA, dst, dstfmt); BLEND_RGBA_MULT (sR, sG, sB, sA, dR, dG, dB, dA); CREATE_PIXEL(dst, dR, dG, dB, dA, dstbpp, dstfmt); src += srcpxskip; dst += dstpxskip; }, n, width); src += srcskip; dst += dstskip; } } else /* dstbpp > 1 */ { while (height--) { LOOP_UNROLLED4( { GET_PIXELVALS_1(sR, sG, sB, sA, src, srcfmt); GET_PIXEL (pixel, dstbpp, dst); GET_PIXELVALS (dR, dG, dB, dA, pixel, dstfmt, dstppa); BLEND_RGBA_MULT (sR, sG, sB, sA, dR, dG, dB, dA); CREATE_PIXEL(dst, dR, dG, dB, dA, dstbpp, dstfmt); src += srcpxskip; dst += dstpxskip; }, n, width); src += srcskip; dst += dstskip; } } } else /* srcbpp > 1 */ { if (dstbpp == 1) { while (height--) { LOOP_UNROLLED4( { GET_PIXEL(pixel, srcbpp, src); GET_PIXELVALS (sR, sG, sB, sA, pixel, srcfmt, srcppa); GET_PIXELVALS_1(dR, dG, dB, dA, dst, dstfmt); BLEND_RGBA_MULT (sR, sG, sB, sA, dR, dG, dB, dA); CREATE_PIXEL(dst, dR, dG, dB, dA, dstbpp, dstfmt); src += srcpxskip; dst += dstpxskip; }, n, width); src += srcskip; dst += dstskip; } } else /* dstbpp > 1 */ { while (height--) { LOOP_UNROLLED4( { GET_PIXEL(pixel, srcbpp, src); GET_PIXELVALS (sR, sG, sB, sA, pixel, srcfmt, srcppa); GET_PIXEL (pixel, dstbpp, dst); GET_PIXELVALS (dR, dG, dB, dA, pixel, dstfmt, dstppa); BLEND_RGBA_MULT (sR, sG, sB, sA, dR, dG, dB, dA); CREATE_PIXEL(dst, dR, dG, dB, dA, dstbpp, dstfmt); src += srcpxskip; dst += dstpxskip; }, n, width); src += srcskip; dst += dstskip; } } } } static void blit_blend_rgba_min (SDL_BlitInfo * info) { int n; int width = info->width; int height = info->height; Uint8 *src = info->s_pixels; int srcpxskip = info->s_pxskip; int srcskip = info->s_skip; Uint8 *dst = info->d_pixels; int dstpxskip = info->d_pxskip; int dstskip = info->d_skip; SDL_PixelFormat *srcfmt = info->src; SDL_PixelFormat *dstfmt = info->dst; int srcbpp = srcfmt->BytesPerPixel; int dstbpp = dstfmt->BytesPerPixel; Uint8 dR, dG, dB, dA, sR, sG, sB, sA; Uint32 pixel; int srcppa = (srcfmt->Amask); int dstppa = (dstfmt->Amask); if (!dstppa) { blit_blend_min (info); return; } if (srcbpp == 4 && dstbpp == 4 && srcfmt->Rmask == dstfmt->Rmask && srcfmt->Gmask == dstfmt->Gmask && srcfmt->Bmask == dstfmt->Bmask && srcfmt->Amask == dstfmt->Amask && srcfmt->Amask) { int incr = srcpxskip > 0 ? 1 : -1; if (incr < 0) { src += 3; dst += 3; } while (height--) { LOOP_UNROLLED4( { REPEAT_4( { if ((*src) < (*dst)) (*dst) = (*src); src += incr; dst += incr; }); }, n, width); src += srcskip; dst += dstskip; } return; } if (srcbpp == 1) { if (dstbpp == 1) { while (height--) { LOOP_UNROLLED4( { GET_PIXELVALS_1(sR, sG, sB, sA, src, srcfmt); GET_PIXELVALS_1(dR, dG, dB, dA, dst, dstfmt); BLEND_RGBA_MIN (sR, sG, sB, sA, dR, dG, dB, dA); CREATE_PIXEL(dst, dR, dG, dB, dA, dstbpp, dstfmt); src += srcpxskip; dst += dstpxskip; }, n, width); src += srcskip; dst += dstskip; } } else /* dstbpp > 1 */ { while (height--) { LOOP_UNROLLED4( { GET_PIXELVALS_1(sR, sG, sB, sA, src, srcfmt); GET_PIXEL (pixel, dstbpp, dst); GET_PIXELVALS (dR, dG, dB, dA, pixel, dstfmt, dstppa); BLEND_RGBA_MIN (sR, sG, sB, sA, dR, dG, dB, dA); CREATE_PIXEL(dst, dR, dG, dB, dA, dstbpp, dstfmt); src += srcpxskip; dst += dstpxskip; }, n, width); src += srcskip; dst += dstskip; } } } else /* srcbpp > 1 */ { if (dstbpp == 1) { while (height--) { LOOP_UNROLLED4( { GET_PIXEL(pixel, srcbpp, src); GET_PIXELVALS (sR, sG, sB, sA, pixel, srcfmt, srcppa); GET_PIXELVALS_1(dR, dG, dB, dA, dst, dstfmt); BLEND_RGBA_MIN (sR, sG, sB, sA, dR, dG, dB, dA); CREATE_PIXEL(dst, dR, dG, dB, dA, dstbpp, dstfmt); src += srcpxskip; dst += dstpxskip; }, n, width); src += srcskip; dst += dstskip; } } else /* dstbpp > 1 */ { while (height--) { LOOP_UNROLLED4( { GET_PIXEL(pixel, srcbpp, src); GET_PIXELVALS (sR, sG, sB, sA, pixel, srcfmt, srcppa); GET_PIXEL (pixel, dstbpp, dst); GET_PIXELVALS (dR, dG, dB, dA, pixel, dstfmt, dstppa); BLEND_RGBA_MIN (sR, sG, sB, sA, dR, dG, dB, dA); CREATE_PIXEL(dst, dR, dG, dB, dA, dstbpp, dstfmt); src += srcpxskip; dst += dstpxskip; }, n, width); src += srcskip; dst += dstskip; } } } } static void blit_blend_rgba_max (SDL_BlitInfo * info) { int n; int width = info->width; int height = info->height; Uint8 *src = info->s_pixels; int srcpxskip = info->s_pxskip; int srcskip = info->s_skip; Uint8 *dst = info->d_pixels; int dstpxskip = info->d_pxskip; int dstskip = info->d_skip; SDL_PixelFormat *srcfmt = info->src; SDL_PixelFormat *dstfmt = info->dst; int srcbpp = srcfmt->BytesPerPixel; int dstbpp = dstfmt->BytesPerPixel; Uint8 dR, dG, dB, dA, sR, sG, sB, sA; Uint32 pixel; int srcppa = (srcfmt->Amask); int dstppa = (dstfmt->Amask); if (!dstppa) { blit_blend_max (info); return; } if (srcbpp == 4 && dstbpp == 4 && srcfmt->Rmask == dstfmt->Rmask && srcfmt->Gmask == dstfmt->Gmask && srcfmt->Bmask == dstfmt->Bmask && srcfmt->Amask == dstfmt->Amask && srcfmt->Amask) { int incr = srcpxskip > 0 ? 1 : -1; if (incr < 0) { src += 3; dst += 3; } while (height--) { LOOP_UNROLLED4( { REPEAT_4( { if ((*src) > (*dst)) (*dst) = (*src); src += incr; dst += incr; }); }, n, width); src += srcskip; dst += dstskip; } return; } if (srcbpp == 1) { if (dstbpp == 1) { while (height--) { LOOP_UNROLLED4( { GET_PIXELVALS_1(sR, sG, sB, sA, src, srcfmt); GET_PIXELVALS_1(dR, dG, dB, dA, dst, dstfmt); BLEND_RGBA_MAX (sR, sG, sB, sA, dR, dG, dB, dA); CREATE_PIXEL(dst, dR, dG, dB, dA, dstbpp, dstfmt); src += srcpxskip; dst += dstpxskip; }, n, width); src += srcskip; dst += dstskip; } } else /* dstbpp > 1 */ { while (height--) { LOOP_UNROLLED4( { GET_PIXELVALS_1(sR, sG, sB, sA, src, srcfmt); GET_PIXEL (pixel, dstbpp, dst); GET_PIXELVALS (dR, dG, dB, dA, pixel, dstfmt, dstppa); BLEND_RGBA_MAX (sR, sG, sB, sA, dR, dG, dB, dA); CREATE_PIXEL(dst, dR, dG, dB, dA, dstbpp, dstfmt); src += srcpxskip; dst += dstpxskip; }, n, width); src += srcskip; dst += dstskip; } } } else /* srcbpp > 1 */ { if (dstbpp == 1) { while (height--) { LOOP_UNROLLED4( { GET_PIXEL(pixel, srcbpp, src); GET_PIXELVALS (sR, sG, sB, sA, pixel, srcfmt, srcppa); GET_PIXELVALS_1(dR, dG, dB, dA, dst, dstfmt); BLEND_RGBA_MAX (sR, sG, sB, sA, dR, dG, dB, dA); CREATE_PIXEL(dst, dR, dG, dB, dA, dstbpp, dstfmt); src += srcpxskip; dst += dstpxskip; }, n, width); src += srcskip; dst += dstskip; } } else /* dstbpp > 1 */ { while (height--) { LOOP_UNROLLED4( { GET_PIXEL(pixel, srcbpp, src); GET_PIXELVALS (sR, sG, sB, sA, pixel, srcfmt, srcppa); GET_PIXEL (pixel, dstbpp, dst); GET_PIXELVALS (dR, dG, dB, dA, pixel, dstfmt, dstppa); BLEND_RGBA_MAX (sR, sG, sB, sA, dR, dG, dB, dA); CREATE_PIXEL(dst, dR, dG, dB, dA, dstbpp, dstfmt); src += srcpxskip; dst += dstpxskip; }, n, width); src += srcskip; dst += dstskip; } } } } static void blit_blend_premultiplied (SDL_BlitInfo * info) { int n; int width = info->width; int height = info->height; Uint8 *src = info->s_pixels; int srcpxskip = info->s_pxskip; int srcskip = info->s_skip; Uint8 *dst = info->d_pixels; int dstpxskip = info->d_pxskip; int dstskip = info->d_skip; SDL_PixelFormat *srcfmt = info->src; SDL_PixelFormat *dstfmt = info->dst; int srcbpp = srcfmt->BytesPerPixel; int dstbpp = dstfmt->BytesPerPixel; Uint8 dR, dG, dB, dA, sR, sG, sB, sA; Uint32 pixel; int srcppa = (srcfmt->Amask); int dstppa = (dstfmt->Amask); int tmp; /* printf ("Premultiplied alpha blit with %d and %d\n", srcbpp, dstbpp); */ if (srcbpp == 1) { if (dstbpp == 1) { while (height--) { LOOP_UNROLLED4( { GET_PIXELVALS_1(sR, sG, sB, sA, src, srcfmt); GET_PIXELVALS_1(dR, dG, dB, dA, dst, dstfmt); ALPHA_BLEND_PREMULTIPLIED (tmp, sR, sG, sB, sA, dR, dG, dB, dA); CREATE_PIXEL(dst, dR, dG, dB, dA, dstbpp, dstfmt); src += srcpxskip; dst += dstpxskip; }, n, width); src += srcskip; dst += dstskip; } } else /* dstbpp > 1 */ { while (height--) { LOOP_UNROLLED4( { GET_PIXELVALS_1(sR, sG, sB, sA, src, srcfmt); GET_PIXEL (pixel, dstbpp, dst); GET_PIXELVALS (dR, dG, dB, dA, pixel, dstfmt, dstppa); ALPHA_BLEND_PREMULTIPLIED (tmp, sR, sG, sB, sA, dR, dG, dB, dA); CREATE_PIXEL(dst, dR, dG, dB, dA, dstbpp, dstfmt); src += srcpxskip; dst += dstpxskip; }, n, width); src += srcskip; dst += dstskip; } } } else /* srcbpp > 1 */ { if (dstbpp == 1) { while (height--) { LOOP_UNROLLED4( { GET_PIXEL(pixel, srcbpp, src); GET_PIXELVALS (sR, sG, sB, sA, pixel, srcfmt, srcppa); GET_PIXELVALS_1(dR, dG, dB, dA, dst, dstfmt); ALPHA_BLEND_PREMULTIPLIED (tmp, sR, sG, sB, sA, dR, dG, dB, dA); CREATE_PIXEL(dst, dR, dG, dB, dA, dstbpp, dstfmt); src += srcpxskip; dst += dstpxskip; }, n, width); src += srcskip; dst += dstskip; } } else /* dstbpp > 1 */ { while (height--) { LOOP_UNROLLED4( { GET_PIXEL(pixel, srcbpp, src); GET_PIXELVALS (sR, sG, sB, sA, pixel, srcfmt, srcppa); GET_PIXEL (pixel, dstbpp, dst); GET_PIXELVALS (dR, dG, dB, dA, pixel, dstfmt, dstppa); ALPHA_BLEND_PREMULTIPLIED (tmp, sR, sG, sB, sA, dR, dG, dB, dA); CREATE_PIXEL(dst, dR, dG, dB, dA, dstbpp, dstfmt); src += srcpxskip; dst += dstpxskip; }, n, width); src += srcskip; dst += dstskip; } } } } /* --------------------------------------------------------- */ static void blit_blend_add (SDL_BlitInfo * info) { int n; int width = info->width; int height = info->height; Uint8 *src = info->s_pixels; int srcpxskip = info->s_pxskip; int srcskip = info->s_skip; Uint8 *dst = info->d_pixels; int dstpxskip = info->d_pxskip; int dstskip = info->d_skip; SDL_PixelFormat *srcfmt = info->src; SDL_PixelFormat *dstfmt = info->dst; int srcbpp = srcfmt->BytesPerPixel; int dstbpp = dstfmt->BytesPerPixel; Uint8 dR, dG, dB, dA, sR, sG, sB, sA; Uint32 pixel; Uint32 tmp; int srcppa = (srcfmt->Amask); int dstppa = (dstfmt->Amask); if (srcbpp >= 3 && dstbpp >= 3 && !(srcfmt->Amask)) { size_t srcoffsetR, srcoffsetG, srcoffsetB; size_t dstoffsetR, dstoffsetG, dstoffsetB; if (srcbpp == 3) { SET_OFFSETS_24 (srcoffsetR, srcoffsetG, srcoffsetB, srcfmt); } else { SET_OFFSETS_32 (srcoffsetR, srcoffsetG, srcoffsetB, srcfmt); } if (dstbpp == 3) { SET_OFFSETS_24 (dstoffsetR, dstoffsetG, dstoffsetB, dstfmt); } else { SET_OFFSETS_32 (dstoffsetR, dstoffsetG, dstoffsetB, dstfmt); } while (height--) { LOOP_UNROLLED4( { tmp = dst[dstoffsetR] + src[srcoffsetR]; dst[dstoffsetR] = (tmp <= 255 ? tmp : 255); tmp = dst[dstoffsetG] + src[srcoffsetG]; dst[dstoffsetG] = (tmp <= 255 ? tmp : 255); tmp = dst[dstoffsetB] + src[srcoffsetB]; dst[dstoffsetB] = (tmp <= 255 ? tmp : 255); src += srcpxskip; dst += dstpxskip; }, n, width); src += srcskip; dst += dstskip; } return; } if (srcbpp == 1) { if (dstbpp == 1) { while (height--) { LOOP_UNROLLED4( { GET_PIXELVALS_1(sR, sG, sB, sA, src, srcfmt); GET_PIXELVALS_1(dR, dG, dB, dA, dst, dstfmt); BLEND_ADD (tmp, sR, sG, sB, sA, dR, dG, dB, dA); *dst = (Uint8) SDL_MapRGB (dstfmt, dR, dG, dB); src += srcpxskip; dst += dstpxskip; }, n, width); src += srcskip; dst += dstskip; } } else if (dstbpp == 3) { size_t offsetR, offsetG, offsetB; SET_OFFSETS_24 (offsetR, offsetG, offsetB, dstfmt); while (height--) { LOOP_UNROLLED4( { GET_PIXELVALS_1(sR, sG, sB, sA, src, srcfmt); GET_PIXEL (pixel, dstbpp, dst); GET_PIXELVALS (dR, dG, dB, dA, pixel, dstfmt, dstppa); BLEND_ADD (tmp, sR, sG, sB, sA, dR, dG, dB, dA); dst[offsetR] = dR; dst[offsetG] = dG; dst[offsetB] = dB; src += srcpxskip; dst += dstpxskip; }, n, width); src += srcskip; dst += dstskip; } } else /* even dstbpp */ { while (height--) { LOOP_UNROLLED4( { GET_PIXELVALS_1(sR, sG, sB, sA, src, srcfmt); GET_PIXEL (pixel, dstbpp, dst); GET_PIXELVALS (dR, dG, dB, dA, pixel, dstfmt, dstppa); BLEND_ADD (tmp, sR, sG, sB, sA, dR, dG, dB, dA); CREATE_PIXEL(dst, dR, dG, dB, dA, dstbpp, dstfmt); src += srcpxskip; dst += dstpxskip; }, n, width); src += srcskip; dst += dstskip; } } } else /* srcbpp > 1 */ { if (dstbpp == 1) { while (height--) { LOOP_UNROLLED4( { GET_PIXEL(pixel, srcbpp, src); GET_PIXELVALS (sR, sG, sB, sA, pixel, srcfmt, srcppa); GET_PIXELVALS_1(dR, dG, dB, dA, dst, dstfmt); BLEND_ADD (tmp, sR, sG, sB, sA, dR, dG, dB, dA); *dst = (Uint8) SDL_MapRGB (dstfmt, dR, dG, dB); src += srcpxskip; dst += dstpxskip; }, n, width); src += srcskip; dst += dstskip; } } else if (dstbpp == 3) { size_t offsetR, offsetG, offsetB; SET_OFFSETS_24 (offsetR, offsetG, offsetB, dstfmt); while (height--) { LOOP_UNROLLED4( { GET_PIXEL(pixel, srcbpp, src); GET_PIXELVALS (sR, sG, sB, sA, pixel, srcfmt, srcppa); GET_PIXEL (pixel, dstbpp, dst); GET_PIXELVALS (dR, dG, dB, dA, pixel, dstfmt, dstppa); BLEND_ADD (tmp, sR, sG, sB, sA, dR, dG, dB, dA); dst[offsetR] = dR; dst[offsetG] = dG; dst[offsetB] = dB; src += srcpxskip; dst += dstpxskip; }, n, width); src += srcskip; dst += dstskip; } } else /* even dstbpp */ { while (height--) { LOOP_UNROLLED4( { GET_PIXEL(pixel, srcbpp, src); GET_PIXELVALS (sR, sG, sB, sA, pixel, srcfmt, srcppa); GET_PIXEL (pixel, dstbpp, dst); GET_PIXELVALS (dR, dG, dB, dA, pixel, dstfmt, dstppa); BLEND_ADD (tmp, sR, sG, sB, sA, dR, dG, dB, dA); CREATE_PIXEL(dst, dR, dG, dB, dA, dstbpp, dstfmt); src += srcpxskip; dst += dstpxskip; }, n, width); src += srcskip; dst += dstskip; } } } } static void blit_blend_sub (SDL_BlitInfo * info) { int n; int width = info->width; int height = info->height; Uint8 *src = info->s_pixels; int srcpxskip = info->s_pxskip; int srcskip = info->s_skip; Uint8 *dst = info->d_pixels; int dstpxskip = info->d_pxskip; int dstskip = info->d_skip; SDL_PixelFormat *srcfmt = info->src; SDL_PixelFormat *dstfmt = info->dst; int srcbpp = srcfmt->BytesPerPixel; int dstbpp = dstfmt->BytesPerPixel; Uint8 dR, dG, dB, dA, sR, sG, sB, sA; Uint32 pixel; Sint32 tmp2; int srcppa = (srcfmt->Amask); int dstppa = (dstfmt->Amask); if (srcbpp >= 3 && dstbpp >= 3 && !(srcfmt->Amask)) { size_t srcoffsetR, srcoffsetG, srcoffsetB; size_t dstoffsetR, dstoffsetG, dstoffsetB; if (srcbpp == 3) { SET_OFFSETS_24 (srcoffsetR, srcoffsetG, srcoffsetB, srcfmt); } else { SET_OFFSETS_32 (srcoffsetR, srcoffsetG, srcoffsetB, srcfmt); } if (dstbpp == 3) { SET_OFFSETS_24 (dstoffsetR, dstoffsetG, dstoffsetB, dstfmt); } else { SET_OFFSETS_32 (dstoffsetR, dstoffsetG, dstoffsetB, dstfmt); } while (height--) { LOOP_UNROLLED4( { tmp2 = dst[dstoffsetR] - src[srcoffsetR]; dst[dstoffsetR] = (tmp2 >= 0 ? tmp2 : 0); tmp2 = dst[dstoffsetG] - src[srcoffsetG]; dst[dstoffsetG] = (tmp2 >= 0 ? tmp2 : 0); tmp2 = dst[dstoffsetB] - src[srcoffsetB]; dst[dstoffsetB] = (tmp2 >= 0 ? tmp2 : 0); src += srcpxskip; dst += dstpxskip; }, n, width); src += srcskip; dst += dstskip; } return; } if (srcbpp == 1) { if (dstbpp == 1) { while (height--) { LOOP_UNROLLED4( { GET_PIXELVALS_1(sR, sG, sB, sA, src, srcfmt); GET_PIXELVALS_1(dR, dG, dB, dA, dst, dstfmt); BLEND_SUB (tmp2, sR, sG, sB, sA, dR, dG, dB, dA); *dst = (Uint8) SDL_MapRGB (dstfmt, dR, dG, dB); src += srcpxskip; dst += dstpxskip; }, n, width); src += srcskip; dst += dstskip; } } else if (dstbpp == 3) { size_t offsetR, offsetG, offsetB; SET_OFFSETS_24 (offsetR, offsetG, offsetB, dstfmt); while (height--) { LOOP_UNROLLED4( { GET_PIXELVALS_1(sR, sG, sB, sA, src, srcfmt); GET_PIXEL (pixel, dstbpp, dst); GET_PIXELVALS (dR, dG, dB, dA, pixel, dstfmt, dstfmt); BLEND_SUB (tmp2, sR, sG, sB, sA, dR, dG, dB, dA); dst[offsetR] = dR; dst[offsetG] = dG; dst[offsetB] = dB; src += srcpxskip; dst += dstpxskip; }, n, width); src += srcskip; dst += dstskip; } } else /* even dstbpp */ { while (height--) { LOOP_UNROLLED4( { GET_PIXELVALS_1(sR, sG, sB, sA, src, srcfmt); GET_PIXEL (pixel, dstbpp, dst); GET_PIXELVALS (dR, dG, dB, dA, pixel, dstfmt, dstppa); BLEND_SUB (tmp2, sR, sG, sB, sA, dR, dG, dB, dA); CREATE_PIXEL(dst, dR, dG, dB, dA, dstbpp, dstfmt); src += srcpxskip; dst += dstpxskip; }, n, width); src += srcskip; dst += dstskip; } } } else /* srcbpp > 1 */ { if (dstbpp == 1) { while (height--) { LOOP_UNROLLED4( { GET_PIXEL(pixel, srcbpp, src); GET_PIXELVALS (sR, sG, sB, sA, pixel, srcfmt, srcppa); GET_PIXELVALS_1(dR, dG, dB, dA, dst, dstfmt); BLEND_SUB (tmp2, sR, sG, sB, sA, dR, dG, dB, dA); *dst = (Uint8) SDL_MapRGB (dstfmt, dR, dG, dB); src += srcpxskip; dst += dstpxskip; }, n, width); src += srcskip; dst += dstskip; } } else if (dstbpp == 3) { size_t offsetR, offsetG, offsetB; SET_OFFSETS_24 (offsetR, offsetG, offsetB, dstfmt); while (height--) { LOOP_UNROLLED4( { GET_PIXEL(pixel, srcbpp, src); GET_PIXELVALS (sR, sG, sB, sA, pixel, srcfmt, srcppa); GET_PIXEL (pixel, dstbpp, dst); GET_PIXELVALS (dR, dG, dB, dA, pixel, dstfmt, dstppa); BLEND_SUB (tmp2, sR, sG, sB, sA, dR, dG, dB, dA); dst[offsetR] = dR; dst[offsetG] = dG; dst[offsetB] = dB; src += srcpxskip; dst += dstpxskip; }, n, width); src += srcskip; dst += dstskip; } } else /* even dstbpp */ { while (height--) { LOOP_UNROLLED4( { GET_PIXEL(pixel, srcbpp, src); GET_PIXELVALS (sR, sG, sB, sA, pixel, srcfmt, srcppa); GET_PIXEL (pixel, dstbpp, dst); GET_PIXELVALS (dR, dG, dB, dA, pixel, dstfmt, dstppa); BLEND_SUB (tmp2, sR, sG, sB, sA, dR, dG, dB, dA); CREATE_PIXEL(dst, dR, dG, dB, dA, dstbpp, dstfmt); src += srcpxskip; dst += dstpxskip; }, n, width); src += srcskip; dst += dstskip; } } } } static void blit_blend_mul (SDL_BlitInfo * info) { int n; int width = info->width; int height = info->height; Uint8 *src = info->s_pixels; int srcpxskip = info->s_pxskip; int srcskip = info->s_skip; Uint8 *dst = info->d_pixels; int dstpxskip = info->d_pxskip; int dstskip = info->d_skip; SDL_PixelFormat *srcfmt = info->src; SDL_PixelFormat *dstfmt = info->dst; int srcbpp = srcfmt->BytesPerPixel; int dstbpp = dstfmt->BytesPerPixel; Uint8 dR, dG, dB, dA, sR, sG, sB, sA; Uint32 pixel; Uint32 tmp; int srcppa = (srcfmt->Amask); int dstppa = (dstfmt->Amask); if (srcbpp >= 3 && dstbpp >= 3 && !(srcfmt->Amask)) { size_t srcoffsetR, srcoffsetG, srcoffsetB; size_t dstoffsetR, dstoffsetG, dstoffsetB; if (srcbpp == 3) { SET_OFFSETS_24 (srcoffsetR, srcoffsetG, srcoffsetB, srcfmt); } else { SET_OFFSETS_32 (srcoffsetR, srcoffsetG, srcoffsetB, srcfmt); } if (dstbpp == 3) { SET_OFFSETS_24 (dstoffsetR, dstoffsetG, dstoffsetB, dstfmt); } else { SET_OFFSETS_32 (dstoffsetR, dstoffsetG, dstoffsetB, dstfmt); } while (height--) { LOOP_UNROLLED4( { tmp = ((dst[dstoffsetR] && src[srcoffsetR]) ? (dst[dstoffsetR] * src[srcoffsetR]) >> 8 : 0); dst[dstoffsetR] = (tmp <= 255 ? tmp : 255); tmp = ((dst[dstoffsetG] && src[srcoffsetG]) ? (dst[dstoffsetG] * src[srcoffsetG]) >> 8 : 0); dst[dstoffsetG] = (tmp <= 255 ? tmp : 255); tmp = ((dst[dstoffsetB] && src[srcoffsetB]) ? (dst[dstoffsetB] * src[srcoffsetB]) >> 8 : 0); dst[dstoffsetB] = (tmp <= 255 ? tmp : 255); src += srcpxskip; dst += dstpxskip; }, n, width); src += srcskip; dst += dstskip; } return; } if (srcbpp == 1) { if (dstbpp == 1) { while (height--) { LOOP_UNROLLED4( { GET_PIXELVALS_1(sR, sG, sB, sA, src, srcfmt); GET_PIXELVALS_1(dR, dG, dB, dA, dst, dstfmt); BLEND_MULT (sR, sG, sB, sA, dR, dG, dB, dA); *dst = (Uint8) SDL_MapRGB (dstfmt, dR, dG, dB); src += srcpxskip; dst += dstpxskip; }, n, width); src += srcskip; dst += dstskip; } } else if (dstbpp == 3) { size_t offsetR, offsetG, offsetB; SET_OFFSETS_24 (offsetR, offsetG, offsetB, dstfmt); while (height--) { LOOP_UNROLLED4( { GET_PIXELVALS_1(sR, sG, sB, sA, src, srcfmt); GET_PIXEL (pixel, dstbpp, dst); GET_PIXELVALS (dR, dG, dB, dA, pixel, dstfmt, dstppa); BLEND_MULT (sR, sG, sB, sA, dR, dG, dB, dA); dst[offsetR] = dR; dst[offsetG] = dG; dst[offsetB] = dB; src += srcpxskip; dst += dstpxskip; }, n, width); src += srcskip; dst += dstskip; } } else /* even dstbpp */ { while (height--) { LOOP_UNROLLED4( { GET_PIXELVALS_1(sR, sG, sB, sA, src, srcfmt); GET_PIXEL (pixel, dstbpp, dst); GET_PIXELVALS (dR, dG, dB, dA, pixel, dstfmt, dstppa); BLEND_MULT (sR, sG, sB, sA, dR, dG, dB, dA); CREATE_PIXEL(dst, dR, dG, dB, dA, dstbpp, dstfmt); src += srcpxskip; dst += dstpxskip; }, n, width); src += srcskip; dst += dstskip; } } } else /* srcbpp > 1 */ { if (dstbpp == 1) { while (height--) { LOOP_UNROLLED4( { GET_PIXEL(pixel, srcbpp, src); GET_PIXELVALS (sR, sG, sB, sA, pixel, srcfmt, srcppa); GET_PIXELVALS_1(dR, dG, dB, dA, dst, dstfmt); BLEND_MULT (sR, sG, sB, sA, dR, dG, dB, dA); *dst = (Uint8) SDL_MapRGB (dstfmt, dR, dG, dB); src += srcpxskip; dst += dstpxskip; }, n, width); src += srcskip; dst += dstskip; } } else if (dstbpp == 3) { size_t offsetR, offsetG, offsetB; SET_OFFSETS_24 (offsetR, offsetG, offsetB, dstfmt); while (height--) { LOOP_UNROLLED4( { GET_PIXEL(pixel, srcbpp, src); GET_PIXELVALS (sR, sG, sB, sA, pixel, srcfmt, srcppa); GET_PIXEL (pixel, dstbpp, dst); GET_PIXELVALS (dR, dG, dB, dA, pixel, dstfmt, dstppa); BLEND_MULT (sR, sG, sB, sA, dR, dG, dB, dA); dst[offsetR] = dR; dst[offsetG] = dG; dst[offsetB] = dB; src += srcpxskip; dst += dstpxskip; }, n, width); src += srcskip; dst += dstskip; } } else /* even dstbpp */ { while (height--) { LOOP_UNROLLED4( { GET_PIXEL(pixel, srcbpp, src); GET_PIXELVALS (sR, sG, sB, sA, pixel, srcfmt, srcppa); GET_PIXEL (pixel, dstbpp, dst); GET_PIXELVALS (dR, dG, dB, dA, pixel, dstfmt, dstppa); BLEND_MULT (sR, sG, sB, sA, dR, dG, dB, dA); CREATE_PIXEL(dst, dR, dG, dB, dA, dstbpp, dstfmt); src += srcpxskip; dst += dstpxskip; }, n, width); src += srcskip; dst += dstskip; } } } } static void blit_blend_min (SDL_BlitInfo * info) { int n; int width = info->width; int height = info->height; Uint8 *src = info->s_pixels; int srcpxskip = info->s_pxskip; int srcskip = info->s_skip; Uint8 *dst = info->d_pixels; int dstpxskip = info->d_pxskip; int dstskip = info->d_skip; SDL_PixelFormat *srcfmt = info->src; SDL_PixelFormat *dstfmt = info->dst; int srcbpp = srcfmt->BytesPerPixel; int dstbpp = dstfmt->BytesPerPixel; Uint8 dR, dG, dB, dA, sR, sG, sB, sA; Uint32 pixel; int srcppa = (srcfmt->Amask); int dstppa = (dstfmt->Amask); if (srcbpp >= 3 && dstbpp >= 3 && !(srcfmt->Amask)) { size_t srcoffsetR, srcoffsetG, srcoffsetB; size_t dstoffsetR, dstoffsetG, dstoffsetB; if (srcbpp == 3) { SET_OFFSETS_24 (srcoffsetR, srcoffsetG, srcoffsetB, srcfmt); } else { SET_OFFSETS_32 (srcoffsetR, srcoffsetG, srcoffsetB, srcfmt); } if (dstbpp == 3) { SET_OFFSETS_24 (dstoffsetR, dstoffsetG, dstoffsetB, dstfmt); } else { SET_OFFSETS_32 (dstoffsetR, dstoffsetG, dstoffsetB, dstfmt); } while (height--) { LOOP_UNROLLED4( { if (src[srcoffsetR] < dst[dstoffsetR]) { dst[dstoffsetR] = src[srcoffsetR]; } if (src[srcoffsetG] < dst[dstoffsetG]) { dst[dstoffsetG] = src[srcoffsetG]; } if (src[srcoffsetB] < dst[dstoffsetB]) { dst[dstoffsetB] = src[srcoffsetB]; } src += srcpxskip; dst += dstpxskip; }, n, width); src += srcskip; dst += dstskip; } return; } if (srcbpp == 1) { if (dstbpp == 1) { while (height--) { LOOP_UNROLLED4( { GET_PIXELVALS_1(sR, sG, sB, sA, src, srcfmt); GET_PIXELVALS_1(dR, dG, dB, dA, dst, dstfmt); BLEND_MIN (sR, sG, sB, sA, dR, dG, dB, dA); *dst = (Uint8) SDL_MapRGB (dstfmt, dR, dG, dB); src += srcpxskip; dst += dstpxskip; }, n, width); src += srcskip; dst += dstskip; } } else if (dstbpp == 3) { size_t offsetR, offsetG, offsetB; SET_OFFSETS_24 (offsetR, offsetG, offsetB, dstfmt); while (height--) { LOOP_UNROLLED4( { GET_PIXELVALS_1(sR, sG, sB, sA, src, srcfmt); GET_PIXEL (pixel, dstbpp, dst); GET_PIXELVALS (dR, dG, dB, dA, pixel, dstfmt, dstppa); BLEND_MIN (sR, sG, sB, sA, dR, dG, dB, dA); dst[offsetR] = dR; dst[offsetG] = dG; dst[offsetB] = dB; src += srcpxskip; dst += dstpxskip; }, n, width); src += srcskip; dst += dstskip; } } else /* even dstbpp */ { while (height--) { LOOP_UNROLLED4( { GET_PIXELVALS_1(sR, sG, sB, sA, src, srcfmt); GET_PIXEL (pixel, dstbpp, dst); GET_PIXELVALS (dR, dG, dB, dA, pixel, dstfmt, dstppa); BLEND_MIN (sR, sG, sB, sA, dR, dG, dB, dA); CREATE_PIXEL(dst, dR, dG, dB, dA, dstbpp, dstfmt); src += srcpxskip; dst += dstpxskip; }, n, width); src += srcskip; dst += dstskip; } } } else /* srcbpp > 1 */ { if (dstbpp == 1) { while (height--) { LOOP_UNROLLED4( { GET_PIXEL(pixel, srcbpp, src); GET_PIXELVALS (sR, sG, sB, sA, pixel, srcfmt, srcppa); GET_PIXELVALS_1(dR, dG, dB, dA, dst, dstfmt); BLEND_MIN (sR, sG, sB, sA, dR, dG, dB, dA); *dst = (Uint8) SDL_MapRGB (dstfmt, dR, dG, dB); src += srcpxskip; dst += dstpxskip; }, n, width); src += srcskip; dst += dstskip; } } else if (dstbpp == 3) { size_t offsetR, offsetG, offsetB; SET_OFFSETS_24 (offsetR, offsetG, offsetB, dstfmt); while (height--) { LOOP_UNROLLED4( { GET_PIXEL(pixel, srcbpp, src); GET_PIXELVALS (sR, sG, sB, sA, pixel, srcfmt, srcppa); GET_PIXEL (pixel, dstbpp, dst); GET_PIXELVALS (dR, dG, dB, dA, pixel, dstfmt, dstppa); BLEND_MIN (sR, sG, sB, sA, dR, dG, dB, dA); dst[offsetR] = dR; dst[offsetG] = dG; dst[offsetB] = dB; src += srcpxskip; dst += dstpxskip; }, n, width); src += srcskip; dst += dstskip; } } else /* even dstbpp */ { while (height--) { LOOP_UNROLLED4( { GET_PIXEL(pixel, srcbpp, src); GET_PIXELVALS (sR, sG, sB, sA, pixel, srcfmt, srcppa); GET_PIXEL (pixel, dstbpp, dst); GET_PIXELVALS (dR, dG, dB, dA, pixel, dstfmt, dstppa); BLEND_MIN (sR, sG, sB, sA, dR, dG, dB, dA); CREATE_PIXEL(dst, dR, dG, dB, dA, dstbpp, dstfmt); src += srcpxskip; dst += dstpxskip; }, n, width); src += srcskip; dst += dstskip; } } } } static void blit_blend_max (SDL_BlitInfo * info) { int n; int width = info->width; int height = info->height; Uint8 *src = info->s_pixels; int srcpxskip = info->s_pxskip; int srcskip = info->s_skip; Uint8 *dst = info->d_pixels; int dstpxskip = info->d_pxskip; int dstskip = info->d_skip; SDL_PixelFormat *srcfmt = info->src; SDL_PixelFormat *dstfmt = info->dst; int srcbpp = srcfmt->BytesPerPixel; int dstbpp = dstfmt->BytesPerPixel; Uint8 dR, dG, dB, dA, sR, sG, sB, sA; Uint32 pixel; int srcppa = (srcfmt->Amask); int dstppa = (dstfmt->Amask); if (srcbpp >= 3 && dstbpp >= 3 && !(srcfmt->Amask)) { size_t srcoffsetR, srcoffsetG, srcoffsetB; size_t dstoffsetR, dstoffsetG, dstoffsetB; if (srcbpp == 3) { SET_OFFSETS_24 (srcoffsetR, srcoffsetG, srcoffsetB, srcfmt); } else { SET_OFFSETS_32 (srcoffsetR, srcoffsetG, srcoffsetB, srcfmt); } if (dstbpp == 3) { SET_OFFSETS_24 (dstoffsetR, dstoffsetG, dstoffsetB, dstfmt); } else { SET_OFFSETS_32 (dstoffsetR, dstoffsetG, dstoffsetB, dstfmt); } while (height--) { LOOP_UNROLLED4( { if (src[srcoffsetR] > dst[dstoffsetR]) { dst[dstoffsetR] = src[srcoffsetR]; } if (src[srcoffsetG] > dst[dstoffsetG]) { dst[dstoffsetG] = src[srcoffsetG]; } if (src[srcoffsetB] > dst[dstoffsetB]) { dst[dstoffsetB] = src[srcoffsetB]; } src += srcpxskip; dst += dstpxskip; }, n, width); src += srcskip; dst += dstskip; } return; } if (srcbpp == 1) { if (dstbpp == 1) { while (height--) { LOOP_UNROLLED4( { GET_PIXELVALS_1(sR, sG, sB, sA, src, srcfmt); GET_PIXELVALS_1(dR, dG, dB, dA, dst, dstfmt); BLEND_MAX (sR, sG, sB, sA, dR, dG, dB, dA); *dst = (Uint8) SDL_MapRGB (dstfmt, dR, dG, dB); src += srcpxskip; dst += dstpxskip; }, n, width); src += srcskip; dst += dstskip; } } else if (dstbpp == 3) { size_t offsetR, offsetG, offsetB; SET_OFFSETS_24 (offsetR, offsetG, offsetB, dstfmt); while (height--) { LOOP_UNROLLED4( { GET_PIXELVALS_1(sR, sG, sB, sA, src, srcfmt); GET_PIXEL (pixel, dstbpp, dst); GET_PIXELVALS (dR, dG, dB, dA, pixel, dstfmt, dstppa); BLEND_MAX (sR, sG, sB, sA, dR, dG, dB, dA); dst[offsetR] = dR; dst[offsetG] = dG; dst[offsetB] = dB; src += srcpxskip; dst += dstpxskip; }, n, width); src += srcskip; dst += dstskip; } } else /* even dstbpp */ { while (height--) { LOOP_UNROLLED4( { GET_PIXELVALS_1(sR, sG, sB, sA, src, srcfmt); GET_PIXEL (pixel, dstbpp, dst); GET_PIXELVALS (dR, dG, dB, dA, pixel, dstfmt, dstppa); BLEND_MAX (sR, sG, sB, sA, dR, dG, dB, dA); CREATE_PIXEL(dst, dR, dG, dB, dA, dstbpp, dstfmt); src += srcpxskip; dst += dstpxskip; }, n, width); src += srcskip; dst += dstskip; } } } else /* srcbpp > 1 */ { if (dstbpp == 1) { while (height--) { LOOP_UNROLLED4( { GET_PIXEL(pixel, srcbpp, src); GET_PIXELVALS (sR, sG, sB, sA, pixel, srcfmt, srcppa); GET_PIXELVALS_1(dR, dG, dB, dA, dst, dstfmt); BLEND_MAX (sR, sG, sB, sA, dR, dG, dB, dA); *dst = (Uint8) SDL_MapRGB (dstfmt, dR, dG, dB); src += srcpxskip; dst += dstpxskip; }, n, width); src += srcskip; dst += dstskip; } } else if (dstbpp == 3) { size_t offsetR, offsetG, offsetB; SET_OFFSETS_24 (offsetR, offsetG, offsetB, dstfmt); while (height--) { LOOP_UNROLLED4( { GET_PIXEL(pixel, srcbpp, src); GET_PIXELVALS (sR, sG, sB, sA, pixel, srcfmt, srcppa); GET_PIXEL (pixel, dstbpp, dst); GET_PIXELVALS (dR, dG, dB, dA, pixel, dstfmt, dstppa); BLEND_MAX (sR, sG, sB, sA, dR, dG, dB, dA); dst[offsetR] = dR; dst[offsetG] = dG; dst[offsetB] = dB; src += srcpxskip; dst += dstpxskip; }, n, width); src += srcskip; dst += dstskip; } } else /* even dstbpp */ { while (height--) { LOOP_UNROLLED4( { GET_PIXEL(pixel, srcbpp, src); GET_PIXELVALS (sR, sG, sB, sA, pixel, srcfmt, srcppa); GET_PIXEL (pixel, dstbpp, dst); GET_PIXELVALS (dR, dG, dB, dA, pixel, dstfmt, dstppa); BLEND_MAX (sR, sG, sB, sA, dR, dG, dB, dA); CREATE_PIXEL(dst, dR, dG, dB, dA, dstbpp, dstfmt); src += srcpxskip; dst += dstpxskip; }, n, width); src += srcskip; dst += dstskip; } } } } /* --------------------------------------------------------- */ static void alphablit_alpha (SDL_BlitInfo * info) { int n; int width = info->width; int height = info->height; Uint8 *src = info->s_pixels; int srcpxskip = info->s_pxskip; int srcskip = info->s_skip; Uint8 *dst = info->d_pixels; int dstpxskip = info->d_pxskip; int dstskip = info->d_skip; SDL_PixelFormat *srcfmt = info->src; SDL_PixelFormat *dstfmt = info->dst; int srcbpp = srcfmt->BytesPerPixel; int dstbpp = dstfmt->BytesPerPixel; int dR, dG, dB, dA, sR, sG, sB, sA; Uint32 pixel; int srcppa = (srcfmt->Amask); int dstppa = (dstfmt->Amask); /* printf ("Alpha blit with %d and %d\n", srcbpp, dstbpp); */ if (srcbpp == 1) { if (dstbpp == 1) { while (height--) { LOOP_UNROLLED4( { GET_PIXELVALS_1(sR, sG, sB, sA, src, srcfmt); GET_PIXELVALS_1(dR, dG, dB, dA, dst, dstfmt); ALPHA_BLEND (sR, sG, sB, sA, dR, dG, dB, dA); CREATE_PIXEL(dst, dR, dG, dB, dA, dstbpp, dstfmt); src += srcpxskip; dst += dstpxskip; }, n, width); src += srcskip; dst += dstskip; } } else /* dstbpp > 1 */ { while (height--) { LOOP_UNROLLED4( { GET_PIXELVALS_1(sR, sG, sB, sA, src, srcfmt); GET_PIXEL (pixel, dstbpp, dst); GET_PIXELVALS (dR, dG, dB, dA, pixel, dstfmt, dstppa); ALPHA_BLEND (sR, sG, sB, sA, dR, dG, dB, dA); CREATE_PIXEL(dst, dR, dG, dB, dA, dstbpp, dstfmt); src += srcpxskip; dst += dstpxskip; }, n, width); src += srcskip; dst += dstskip; } } } else /* srcbpp > 1 */ { if (dstbpp == 1) { while (height--) { LOOP_UNROLLED4( { GET_PIXEL(pixel, srcbpp, src); GET_PIXELVALS (sR, sG, sB, sA, pixel, srcfmt, srcppa); GET_PIXELVALS_1(dR, dG, dB, dA, dst, dstfmt); ALPHA_BLEND (sR, sG, sB, sA, dR, dG, dB, dA); CREATE_PIXEL(dst, dR, dG, dB, dA, dstbpp, dstfmt); src += srcpxskip; dst += dstpxskip; }, n, width); src += srcskip; dst += dstskip; } } else /* dstbpp > 1 */ { while (height--) { LOOP_UNROLLED4( { GET_PIXEL(pixel, srcbpp, src); GET_PIXELVALS (sR, sG, sB, sA, pixel, srcfmt, srcppa); GET_PIXEL (pixel, dstbpp, dst); GET_PIXELVALS (dR, dG, dB, dA, pixel, dstfmt, dstppa); ALPHA_BLEND (sR, sG, sB, sA, dR, dG, dB, dA); CREATE_PIXEL(dst, dR, dG, dB, dA, dstbpp, dstfmt); src += srcpxskip; dst += dstpxskip; }, n, width); src += srcskip; dst += dstskip; } } } } #if 0 static void alphablit_colorkey (SDL_BlitInfo * info) { int n; int width = info->width; int height = info->height; Uint8 *src = info->s_pixels; int srcpxskip = info->s_pxskip; int srcskip = info->s_skip; Uint8 *dst = info->d_pixels; int dstpxskip = info->d_pxskip; int dstskip = info->d_skip; SDL_PixelFormat *srcfmt = info->src; SDL_PixelFormat *dstfmt = info->dst; int srcbpp = srcfmt->BytesPerPixel; int dstbpp = dstfmt->BytesPerPixel; int dR, dG, dB, dA, sR, sG, sB, sA; int alpha = 255; Uint32 colorkey = 0; // srcfmt->colorkey; Uint32 pixel; int srcppa = (srcfmt->Amask); int dstppa = (dstfmt->Amask); /* printf ("Colorkey blit with %d and %d\n", srcbpp, dstbpp); */ if (srcbpp == 1) { if (dstbpp == 1) { while (height--) { LOOP_UNROLLED4( { GET_PIXELVALS_1(sR, sG, sB, sA, src, srcfmt); sA = (*src == colorkey) ? 0 : alpha; GET_PIXELVALS_1(dR, dG, dB, dA, dst, dstfmt); ALPHA_BLEND (sR, sG, sB, sA, dR, dG, dB, dA); *dst = (Uint8) SDL_MapRGB (dstfmt, dR, dG, dB); src += srcpxskip; dst += dstpxskip; }, n, width); src += srcskip; dst += dstskip; } } else /* dstbpp > 1 */ { while (height--) { LOOP_UNROLLED4( { GET_PIXELVALS_1(sR, sG, sB, sA, src, srcfmt); sA = (*src == colorkey) ? 0 : alpha; GET_PIXEL (pixel, dstbpp, dst); GET_PIXELVALS (dR, dG, dB, dA, pixel, dstfmt, dstppa); ALPHA_BLEND (sR, sG, sB, sA, dR, dG, dB, dA); CREATE_PIXEL(dst, dR, dG, dB, dA, dstbpp, dstfmt); src += srcpxskip; dst += dstpxskip; }, n, width); src += srcskip; dst += dstskip; } } } else /* srcbpp > 1 */ { if (dstbpp == 1) { while (height--) { LOOP_UNROLLED4( { GET_PIXEL(pixel, srcbpp, src); GET_PIXELVALS (sR, sG, sB, sA, pixel, srcfmt, srcppa); sA = (pixel == colorkey) ? 0 : alpha; GET_PIXELVALS_1(dR, dG, dB, dA, dst, dstfmt); ALPHA_BLEND (sR, sG, sB, sA, dR, dG, dB, dA); *dst = (Uint8) SDL_MapRGB (dstfmt, dR, dG, dB); src += srcpxskip; dst += dstpxskip; }, n, width); src += srcskip; dst += dstskip; } } else if (dstbpp == 3) { /* This is interim code until SDL can properly handle self blits of surfaces with blanket alpha. */ size_t offsetR, offsetG, offsetB; SET_OFFSETS_24 (offsetR, offsetG, offsetB, dstfmt); while (height--) { LOOP_UNROLLED4( { GET_PIXEL(pixel, srcbpp, src); GET_PIXELVALS (sR, sG, sB, sA, pixel, srcfmt, srcppa); sA = (pixel == colorkey) ? 0 : alpha; GET_PIXEL (pixel, dstbpp, dst); GET_PIXELVALS (dR, dG, dB, dA, pixel, dstfmt, dstppa); ALPHA_BLEND (sR, sG, sB, sA, dR, dG, dB, dA); dst[offsetR] = dR; dst[offsetG] = dG; dst[offsetB] = dB; src += srcpxskip; dst += dstpxskip; }, n, width); src += srcskip; dst += dstskip; } } else /* even dstbpp */ { while (height--) { LOOP_UNROLLED4( { GET_PIXEL(pixel, srcbpp, src); GET_PIXELVALS (sR, sG, sB, sA, pixel, srcfmt, srcppa); sA = (pixel == colorkey) ? 0 : alpha; GET_PIXEL (pixel, dstbpp, dst); GET_PIXELVALS (dR, dG, dB, dA, pixel, dstfmt, dstppa); ALPHA_BLEND (sR, sG, sB, sA, dR, dG, dB, dA); CREATE_PIXEL(dst, dR, dG, dB, dA, dstbpp, dstfmt); src += srcpxskip; dst += dstpxskip; }, n, width); src += srcskip; dst += dstskip; } } } } #endif static void alphablit_solid (SDL_BlitInfo * info) { int n; int width = info->width; int height = info->height; Uint8 *src = info->s_pixels; int srcpxskip = info->s_pxskip; int srcskip = info->s_skip; Uint8 *dst = info->d_pixels; int dstpxskip = info->d_pxskip; int dstskip = info->d_skip; SDL_PixelFormat *srcfmt = info->src; SDL_PixelFormat *dstfmt = info->dst; int srcbpp = srcfmt->BytesPerPixel; int dstbpp = dstfmt->BytesPerPixel; int dR, dG, dB, dA, sR, sG, sB, sA; int alpha = 255; int pixel; int srcppa = (srcfmt->Amask); int dstppa = (dstfmt->Amask); /* printf ("Solid blit with %d and %d\n", srcbpp, dstbpp); */ if (srcbpp == 1) { if (dstbpp == 1) { while (height--) { LOOP_UNROLLED4( { GET_PIXELVALS_1(sR, sG, sB, sA, src, srcfmt); GET_PIXELVALS_1(dR, dG, dB, dA, dst, dstfmt); ALPHA_BLEND (sR, sG, sB, alpha, dR, dG, dB, dA); *dst = (Uint8) SDL_MapRGB (dstfmt, dR, dG, dB); src += srcpxskip; dst += dstpxskip; }, n, width); src += srcskip; dst += dstskip; } } else /* dstbpp > 1 */ { while (height--) { LOOP_UNROLLED4( { GET_PIXELVALS_1(sR, sG, sB, sA, src, srcfmt); GET_PIXEL (pixel, dstbpp, dst); GET_PIXELVALS (dR, dG, dB, dA, pixel, dstfmt, dstppa); ALPHA_BLEND (sR, sG, sB, alpha, dR, dG, dB, dA); CREATE_PIXEL(dst, dR, dG, dB, dA, dstbpp, dstfmt); src += srcpxskip; dst += dstpxskip; }, n, width); src += srcskip; dst += dstskip; } } } else /* srcbpp > 1 */ { if (dstbpp == 1) { while (height--) { LOOP_UNROLLED4( { GET_PIXEL(pixel, srcbpp, src); GET_PIXELVALS (sR, sG, sB, sA, pixel, srcfmt, srcppa); GET_PIXELVALS_1(dR, dG, dB, dA, dst, dstfmt); ALPHA_BLEND (sR, sG, sB, alpha, dR, dG, dB, dA); *dst = (Uint8) SDL_MapRGB (dstfmt, dR, dG, dB); src += srcpxskip; dst += dstpxskip; }, n, width); src += srcskip; dst += dstskip; } } else if (dstbpp == 3) { /* This is interim code until SDL can properly handle self blits of surfaces with blanket alpha. */ size_t offsetR, offsetG, offsetB; SET_OFFSETS_24 (offsetR, offsetG, offsetB, dstfmt); while (height--) { LOOP_UNROLLED4( { GET_PIXEL(pixel, srcbpp, src); GET_PIXELVALS (sR, sG, sB, sA, pixel, srcfmt, srcppa); GET_PIXEL (pixel, dstbpp, dst); GET_PIXELVALS (dR, dG, dB, dA, pixel, dstfmt, dstppa); ALPHA_BLEND (sR, sG, sB, alpha, dR, dG, dB, dA); dst[offsetR] = dR; dst[offsetG] = dG; dst[offsetB] = dB; src += srcpxskip; dst += dstpxskip; }, n, width); src += srcskip; dst += dstskip; } } else /* even dstbpp */ { while (height--) { LOOP_UNROLLED4( { GET_PIXEL(pixel, srcbpp, src); GET_PIXELVALS (sR, sG, sB, sA, pixel, srcfmt, srcppa); GET_PIXEL (pixel, dstbpp, dst); GET_PIXELVALS (dR, dG, dB, dA, pixel, dstfmt, dstppa); ALPHA_BLEND (sR, sG, sB, alpha, dR, dG, dB, dA); CREATE_PIXEL(dst, dR, dG, dB, dA, dstbpp, dstfmt); src += srcpxskip; dst += dstpxskip; }, n ,width); src += srcskip; dst += dstskip; } } } } /*we assume the "dst" has pixel alpha*/ int pygame_Blit (SDL_Surface * src, SDL_Rect * srcrect, SDL_Surface * dst, SDL_Rect * dstrect, int the_args) { SDL_Rect fulldst; int srcx, srcy, w, h; /* Make sure the surfaces aren't locked */ if (!src || !dst) { SDL_SetError ("SDL_UpperBlit: passed a NULL surface"); return (-1); } if (src->locked || dst->locked) { SDL_SetError ("Surfaces must not be locked during blit"); return (-1); } /* If the destination rectangle is NULL, use the entire dest surface */ if (dstrect == NULL) { fulldst.x = fulldst.y = 0; dstrect = &fulldst; } /* clip the source rectangle to the source surface */ if (srcrect) { int maxw, maxh; srcx = srcrect->x; w = srcrect->w; if (srcx < 0) { w += srcx; dstrect->x -= srcx; srcx = 0; } maxw = src->w - srcx; if (maxw < w) w = maxw; srcy = srcrect->y; h = srcrect->h; if (srcy < 0) { h += srcy; dstrect->y -= srcy; srcy = 0; } maxh = src->h - srcy; if (maxh < h) h = maxh; } else { srcx = srcy = 0; w = src->w; h = src->h; } /* clip the destination rectangle against the clip rectangle */ { SDL_Rect *clip = &dst->clip_rect; int dx, dy; dx = clip->x - dstrect->x; if (dx > 0) { w -= dx; dstrect->x += dx; srcx += dx; } dx = dstrect->x + w - clip->x - clip->w; if (dx > 0) w -= dx; dy = clip->y - dstrect->y; if (dy > 0) { h -= dy; dstrect->y += dy; srcy += dy; } dy = dstrect->y + h - clip->y - clip->h; if (dy > 0) h -= dy; } if (w > 0 && h > 0) { SDL_Rect sr; sr.x = srcx; sr.y = srcy; sr.w = dstrect->w = w; sr.h = dstrect->h = h; return SoftBlitPyGame (src, &sr, dst, dstrect, the_args); } dstrect->w = dstrect->h = 0; return 0; } int pygame_AlphaBlit (SDL_Surface * src, SDL_Rect * srcrect, SDL_Surface * dst, SDL_Rect * dstrect, int the_args) { return pygame_Blit (src, srcrect, dst, dstrect, the_args); } pygame_sdl2-2.1.0-for-renpy-6.99.14.1/src/pygame_sdl2/0000755000175000017500000000000013235720531021242 5ustar tomtom00000000000000pygame_sdl2-2.1.0-for-renpy-6.99.14.1/src/pygame_sdl2/rwobject.pxd0000664000175000017500000000172712423603333023605 0ustar tomtom00000000000000# Copyright 2014 Tom Rothamel # # This software is provided 'as-is', without any express or implied # warranty. In no event will the authors be held liable for any damages # arising from the use of this software. # # Permission is granted to anyone to use this software for any purpose, # including commercial applications, and to alter it and redistribute it # freely, subject to the following restrictions: # # 1. The origin of this software must not be misrepresented; you must not # claim that you wrote the original software. If you use this software # in a product, an acknowledgment in the product documentation would be # appreciated but is not required. # 2. Altered source versions must be plainly marked as such, and must not be # misrepresented as being the original software. # 3. This notice may not be removed or altered from any source distribution. from sdl2 cimport SDL_RWops cdef SDL_RWops *to_rwops(filelike, mode=*) except NULL pygame_sdl2-2.1.0-for-renpy-6.99.14.1/src/pygame_sdl2/render.pyx0000664000175000017500000003412312507777071023304 0ustar tomtom00000000000000# Copyright 2014 Patrick Dawson # # This software is provided 'as-is', without any express or implied # warranty. In no event will the authors be held liable for any damages # arising from the use of this software. # # Permission is granted to anyone to use this software for any purpose, # including commercial applications, and to alter it and redistribute it # freely, subject to the following restrictions: # # 1. The origin of this software must not be misrepresented; you must not # claim that you wrote the original software. If you use this software # in a product, an acknowledgment in the product documentation would be # appreciated but is not required. # 2. Altered source versions must be plainly marked as such, and must not be # misrepresented as being the original software. # 3. This notice may not be removed or altered from any source distribution. from sdl2 cimport * from sdl2_image cimport * from libc.string cimport memcpy, memset from pygame_sdl2.display cimport * from pygame_sdl2.surface cimport * from pygame_sdl2.rwobject cimport to_rwops from pygame_sdl2.rect cimport to_sdl_rect from pygame_sdl2.rect import Rect from pygame_sdl2.error import error from pygame_sdl2.color import Color import json import warnings BLENDMODE_NONE = SDL_BLENDMODE_NONE BLENDMODE_BLEND = SDL_BLENDMODE_BLEND BLENDMODE_ADD = SDL_BLENDMODE_ADD BLENDMODE_MOD = SDL_BLENDMODE_MOD cdef bint DEBUG_DRAW_BBOX = True cdef rinfo_to_dict(SDL_RendererInfo *rinfo): # Ignore texture_formats for now. return { "name" : rinfo.name, "software" : rinfo.flags & SDL_RENDERER_SOFTWARE != 0, "accelerated" : rinfo.flags & SDL_RENDERER_ACCELERATED != 0, "vsync" : rinfo.flags & SDL_RENDERER_PRESENTVSYNC != 0, "rtt" : rinfo.flags & SDL_RENDERER_TARGETTEXTURE != 0, "max_texture_width" : rinfo.max_texture_width, "max_texture_height" : rinfo.max_texture_height, } def get_drivers(): cdef SDL_RendererInfo rinfo cdef int num_drivers rv = [] num_drivers = SDL_GetNumRenderDrivers() for n in range(num_drivers): if SDL_GetRenderDriverInfo(n, &rinfo) != 0: raise error() rv.append(rinfo_to_dict(&rinfo)) return rv cdef class Renderer: cdef SDL_Renderer *renderer cdef dict _info def __cinit__(self): self.renderer = NULL def __dealloc__(self): if self.renderer: SDL_DestroyRenderer(self.renderer) def __init__(self, Window window=None, vsync=False, driver=-1): if window is None: window = main_window cdef uint32_t flags = SDL_RENDERER_ACCELERATED if vsync: flags |= SDL_RENDERER_PRESENTVSYNC self.renderer = SDL_CreateRenderer(window.window, driver, flags) if self.renderer == NULL: self.renderer = SDL_GetRenderer(window.window) if self.renderer == NULL: raise error() cdef SDL_RendererInfo rinfo if SDL_GetRendererInfo(self.renderer, &rinfo) != 0: raise error() self._info = rinfo_to_dict(&rinfo) if not self.info()["accelerated"]: warnings.warn("Renderer is not accelerated.") def load_texture(self, fi): cdef SDL_Texture *tex cdef Texture t = Texture() if isinstance(fi, Surface): tex = SDL_CreateTextureFromSurface(self.renderer, (fi).surface) else: tex = IMG_LoadTexture_RW(self.renderer, to_rwops(fi), 1) if tex == NULL: raise error() t.set(self.renderer, tex) return TextureNode(t) def load_atlas(self, filename): """ Loads a file in the popular JSON (Hash) format exported by TexturePacker and other software. """ return TextureAtlas(self, filename) def render_present(self): with nogil: SDL_RenderPresent(self.renderer) def info(self): return self._info cdef set_drawcolor(self, col): if not isinstance(col, Color): col = Color(col) SDL_SetRenderDrawColor(self.renderer, col.r, col.g, col.b, col.a) def clear(self, color): self.set_drawcolor(color) SDL_RenderClear(self.renderer) def draw_line(self, color not None, x1, y1, x2, y2): self.set_drawcolor(color) if SDL_RenderDrawLine(self.renderer, x1, y1, x2, y2) != 0: raise error() def draw_point(self, color not None, x, y): self.set_drawcolor(color) SDL_RenderDrawPoint(self.renderer, x, y) def draw_rect(self, color not None, rect): cdef SDL_Rect r to_sdl_rect(rect, &r) self.set_drawcolor(color) SDL_RenderDrawRect(self.renderer, &r) def fill_rect(self, color not None, rect): cdef SDL_Rect r to_sdl_rect(rect, &r) self.set_drawcolor(color) SDL_RenderFillRect(self.renderer, &r) def set_viewport(self, rect=None): cdef SDL_Rect vprect if rect is None: SDL_RenderSetViewport(self.renderer, NULL) else: to_sdl_rect(rect, &vprect) SDL_RenderSetViewport(self.renderer, &vprect) def create_texture(self, size): if SDL_RenderTargetSupported(self.renderer) != SDL_TRUE: raise error() cdef class Texture: """ Mostly for internal use. Users should only see this for RTT. """ cdef SDL_Renderer *renderer cdef SDL_Texture *texture cdef public int w, h def __cinit__(self): self.texture = NULL def __dealloc__(self): if self.texture: SDL_DestroyTexture(self.texture) cdef set(self, SDL_Renderer *ren, SDL_Texture *tex): cdef Uint32 format cdef int access, w, h self.renderer = ren self.texture = tex if SDL_QueryTexture(self.texture, &format, &access, &w, &h) != 0: raise error() self.w = w self.h = h cdef class TextureNode: """ A specified area of a texture. """ cdef Texture texture # The absolute rect within the texture. cdef SDL_Rect source_rect # The relative rect within the original tile. cdef SDL_Rect trimmed_rect # The dimensions of the original tile. cdef int source_w cdef int source_h def __init__(self, tex): if isinstance(tex, Texture): self.texture = tex to_sdl_rect((0,0,tex.w,tex.h), &self.source_rect) to_sdl_rect((0,0,tex.w,tex.h), &self.trimmed_rect) self.source_w = tex.w self.source_h = tex.h elif isinstance(tex, TextureNode): self.texture = (tex).texture else: raise ValueError() def render(self, dest=None): cdef SDL_Rect dest_rect if dest is None: with nogil: SDL_RenderCopy(self.texture.renderer, self.texture.texture, NULL, NULL) else: to_sdl_rect(dest, &dest_rect) with nogil: if dest_rect.w == 0 or dest_rect.h == 0: dest_rect.w = self.trimmed_rect.w dest_rect.h = self.trimmed_rect.h SDL_RenderCopy(self.texture.renderer, self.texture.texture, NULL, &dest_rect) cdef class TextureAtlas: cdef object frames def __init__(self, Renderer ren, fi): jdata = json.load(open(fi, "r")) image = jdata["meta"]["image"] cdef TextureNode tn = ren.load_texture(image) self.frames = {} cdef TextureNode itex for itm in jdata["frames"].iteritems(): iname, idict = itm itex = TextureNode(tn) f = idict["frame"] to_sdl_rect((f['x'], f['y'], f['w'], f['h']), &itex.source_rect, "frame") f = idict["spriteSourceSize"] to_sdl_rect((f['x'], f['y'], f['w'], f['h']), &itex.trimmed_rect, "spriteSourceSize") if idict["rotated"]: raise error("Rotation not supported yet.") itex.source_w = idict["sourceSize"]["w"] itex.source_h = idict["sourceSize"]["h"] self.frames[iname] = itex def __getitem__(self, key): return self.frames[key] def keys(self): return self.frames.keys() cdef class Sprite: """ One or more TextureNodes, with possible transforms applied. """ cdef list nodes cdef SDL_Rect _pos cdef SDL_Rect bounding_box cdef double _rotation cdef int _flip cdef SDL_Color _color cdef double _scalex cdef double _scaley def __init__(self, nodes): self._color.r = 255 self._color.g = 255 self._color.b = 255 self._color.a = 255 self._scalex = 1.0 self._scaley = 1.0 self._flip = SDL_FLIP_NONE memset(&self._pos, 0, sizeof(SDL_Rect)) memset(&self.bounding_box, 0, sizeof(SDL_Rect)) if isinstance(nodes, TextureNode): nodes = [nodes] self.nodes = [] # TODO: Check that they're all from the same texture. for node in nodes: if not isinstance(node, TextureNode): raise ValueError("Invalid argument: %s" % node) SDL_UnionRect(&self.bounding_box, &(node).trimmed_rect, &self.bounding_box) self.nodes.append(node) cdef void adjust_rect(Sprite self, const SDL_Rect *dest, const SDL_Rect *rin, SDL_Rect *rout) nogil: rout.x = dest.x + (self._scalex * rin.x) rout.y = dest.y + (self._scaley * rin.y) rout.w = (self._scalex * rin.w) rout.h = (self._scaley * rin.h) def render(self, dest=None): cdef Texture tex = (self.nodes[0]).texture cdef SDL_Rect dest_rect cdef SDL_Rect real_dest cdef SDL_Point pivot if dest is None: memcpy(&dest_rect, &self._pos, sizeof(SDL_Rect)) else: to_sdl_rect(dest, &dest_rect) with nogil: SDL_SetTextureColorMod(tex.texture, self._color.r, self._color.g, self._color.b) SDL_SetTextureAlphaMod(tex.texture, self._color.a) if DEBUG_DRAW_BBOX: # TODO: Adjust for rotation. self.adjust_rect(&dest_rect, &self.bounding_box, &real_dest) SDL_SetRenderDrawColor(tex.renderer, 0xFF, 0x00, 0xFF, 0xFF) SDL_RenderDrawRect(tex.renderer, &real_dest) cdef TextureNode tn for x in self.nodes: tn = x with nogil: pivot.x = (self._scalex * (tn.source_w / 2 - tn.trimmed_rect.x)) pivot.y = (self._scaley * (tn.source_h / 2 - tn.trimmed_rect.y)) self.adjust_rect(&dest_rect, &tn.trimmed_rect, &real_dest) SDL_RenderCopyEx(tex.renderer, tex.texture, &tn.source_rect, &real_dest, self._rotation, &pivot, self._flip) def collides(self, Sprite other not None): cdef SDL_Rect r1, r2 self.adjust_rect(&self._pos, &self.bounding_box, &r1) other.adjust_rect(&other._pos, &other.bounding_box, &r2) return SDL_HasIntersection(&r1, &r2) == SDL_TRUE property pos: def __get__(self): return self._pos.x, self._pos.y def __set__(self, val): self._pos.x = val[0] self._pos.y = val[1] property color: def __set__(self, val): if not isinstance(val, Color): val = Color(val) self._color.r = val.r self._color.g = val.g self._color.b = val.b self._color.a = val.a property alpha: def __get__(self): return self._color.a def __set__(self, val): self._color.a = val property rotation: def __get__(self): return self._rotation def __set__(self, val): self._rotation = val property scale: def __get__(self): if self._scalex == self._scaley: return self._scalex else: return self._scalex, self._scaley def __set__(self, arg): if type(arg) == tuple: x, y = arg else: x = y = arg self._scalex = x self._scaley = y property hflip: def __get__(self): return self._flip & SDL_FLIP_HORIZONTAL def __set__(self, val): if val: self._flip |= SDL_FLIP_HORIZONTAL else: self._flip &= ~SDL_FLIP_HORIZONTAL property vflip: def __get__(self): return self._flip & SDL_FLIP_VERTICAL def __set__(self, val): if val: self._flip |= SDL_FLIP_VERTICAL else: self._flip &= ~SDL_FLIP_VERTICAL cdef class Container: """ Multiple sprites, positioned relative to the container. """ cdef SDL_Rect _rect cdef list sprites def __init__(self, rect): """ Parameter may be a position (no clipping) or a rect (clipped). """ self.sprites = [] to_sdl_rect(rect, &self._rect) if len(rect) == 2: self._rect.w = self._rect.h = 0 def add(self, Sprite sprite not None): self.sprites.append(sprite) def render(self, dest=None): # TODO: Something other than this to get the SDL_Renderer. cdef SDL_Renderer *ren = ((self.sprites[0]).nodes[0]).texture.renderer if self._rect.w != 0 and self._rect.h != 0: SDL_RenderSetClipRect(ren, &self._rect) for s in self.sprites: s.render((s.pos[0] + self._rect.x, s.pos[1] + self._rect.y)) # TODO: Save and restore previous clip rect instead? SDL_RenderSetClipRect(ren, NULL) property pos: def __get__(self): return self._rect.x, self._rect.y def __set__(self, val): self._rect.x = val[0] self._rect.y = val[1] property rect: def __get__(self): return Rect(self._rect.x, self._rect.y, self._rect.w, self._rect.h) def __set__(self, val): to_sdl_rect(val, &self._rect) pygame_sdl2-2.1.0-for-renpy-6.99.14.1/src/pygame_sdl2/display.pyx0000664000175000017500000004220113231553216023452 0ustar tomtom00000000000000# Copyright 2014 Patrick Dawson # Copyright 2014 Tom Rothamel # # This software is provided 'as-is', without any express or implied # warranty. In no event will the authors be held liable for any damages # arising from the use of this software. # # Permission is granted to anyone to use this software for any purpose, # including commercial applications, and to alter it and redistribute it # freely, subject to the following restrictions: # # 1. The origin of this software must not be misrepresented; you must not # claim that you wrote the original software. If you use this software # in a product, an acknowledgment in the product documentation would be # appreciated but is not required. # 2. Altered source versions must be plainly marked as such, and must not be # misrepresented as being the original software. # 3. This notice may not be removed or altered from any source distribution. from sdl2 cimport * from pygame_sdl2.surface cimport * from pygame_sdl2.rect cimport to_sdl_rect from libc.stdlib cimport calloc, free from pygame_sdl2.locals import SRCALPHA, GL_SWAP_CONTROL from pygame_sdl2.error import error import pygame_sdl2 import warnings import os # True if we are on ios. ios = ("PYGAME_IOS" in os.environ) # This inits SDL proper, and should be called by the other init methods. # A map from a PYGAME_SDL2 hint to what it was set to. _pygame_hints = { } def hint(hint, value): if str(hint).startswith("PYGAME_SDL2"): _pygame_hints[str(hint)] = str(value) return if not isinstance(hint, bytes): hint = hint.encode("utf-8") if not isinstance(value, bytes): value = value.encode("utf-8") SDL_SetHint(hint, value) def _get_hint(hint, default): hint = str(hint) if hint in _pygame_hints: return _pygame_hints[hint] if hint in os.environ: return os.environ[hint] return default main_done = False def sdl_main_init(): global main_done if main_done: return SDL_SetMainReady() if SDL_Init(0): raise error() main_done = True # True if init has been called without quit being called. init_done = False @pygame_sdl2.register_init def init(): if init_done: return sdl_main_init() hint("SDL_VIDEO_MAC_FULLSCREEN_SPACES", "0") if SDL_InitSubSystem(SDL_INIT_VIDEO): raise error() pygame_sdl2.event.init() global init_done init_done = True @pygame_sdl2.register_quit def quit(): # @ReservedAssignment global init_done global main_window if main_window: main_window.destroy() main_window = None init_done = False def get_init(): return init_done # The window that is used by the various module globals. main_window = None # Have we shown the first window? _shown_first_window = False def _before_first_window(): global _shown_first_window if _shown_first_window: return _shown_first_window = True # If we're on android, we have to close the splash window before opening # our window. try: import androidembed androidembed.close_window() except ImportError: pass cdef class Window: def __init__(self, title, resolution=(0, 0), flags=0, depth=0, pos=(SDL_WINDOWPOS_UNDEFINED, SDL_WINDOWPOS_UNDEFINED)): if not isinstance(title, bytes): title = title.encode("utf-8") _before_first_window() self.create_flags = flags # If we do not get the AVOID_GL hint, we always create a GL-compatible # window. This lets us change the OPENGL flag later on. if int(_get_hint("PYGAME_SDL2_AVOID_GL", "0")): gl_flag = 0 else: gl_flag = SDL_WINDOW_OPENGL self.window = SDL_CreateWindow( title, pos[0], pos[1], resolution[0], resolution[1], flags | gl_flag) if not self.window: raise error() # From here on, the window exists. So we have to call self.destroy if # an exception occurs. try: if flags & SDL_WINDOW_OPENGL: self.gl_context = SDL_GL_CreateContext(self.window) if self.gl_context == NULL: raise error() if not ios: # Try setting the swap interval - first positive, then negated # to deal with the case where the negative interval isn't # supported. Then give up and carry on. if SDL_GL_SetSwapInterval(default_swap_control): SDL_GL_SetSwapInterval(-default_swap_control) self.create_surface() except: self.destroy() raise def create_surface(self): """ Creates the surface associated with this window. """ cdef int w, h SDL_GetWindowSize(self.window, &w, &h) if self.gl_context: # For now, make this the size of the window so get_size() works. # TODO: Make this a bit less wasteful of memory, even if it means # we lie about the actual size of the pixel array. self.surface = Surface((w, h), SRCALPHA, 32) else: self.window_surface = SDL_GetWindowSurface(self.window) # If the surface is 32-bit, we can use it directly. Otherwise, # we need to create a 32-bit proxy surface. if self.window_surface.format.BitsPerPixel == 32: self.surface = Surface(()) self.surface.surface = self.window_surface self.surface.owns_surface = False self.surface.window_surface = True else: self.surface = Surface((w, h), 0, 32) self.surface.get_window_flags = self.get_window_flags def destroy(self): """ This should be called before the window is deleted. """ if self.gl_context != NULL: SDL_GL_DeleteContext(self.gl_context) if self.surface: # Break the cycle that prevents refcounting from collecting this # object. self.surface.get_window_flags = None # Necessary to collect the GL surface, doesn't hurt the window surface. self.surface = None SDL_DestroyWindow(self.window) def resize(self, size, opengl=False): """ Resizes the window to `size`, which must be a width, height tuple. If opengl is true, adds an OpenGL context, if it's missing. Otherwise, removes the opengl context if present. """ # Prevents a loop between the surface and this object. self.surface.get_window_flags = None if self.gl_context and not opengl: SDL_GL_DeleteContext(self.gl_context) self.gl_context = NULL cdef int cur_width = 0 cdef int cur_height = 0 width, height = size SDL_GetWindowSize(self.window, &cur_width, &cur_height) if (cur_width != width) or (cur_height != height): SDL_SetWindowSize(self.window, width, height) cdef int w, h # Create a missing GL context. if opengl and not self.gl_context: self.gl_context = SDL_GL_CreateContext(self.window) if self.gl_context == NULL: raise error() self.create_surface() def get_window_flags(self): rv = SDL_GetWindowFlags(self.window) if self.gl_context: rv |= SDL_WINDOW_OPENGL else: rv &= ~SDL_WINDOW_OPENGL return rv def proxy_window_surface(self): SDL_UpperBlit(self.surface.surface, NULL, self.window_surface, NULL) def flip(self): if self.gl_context != NULL: with nogil: SDL_GL_SwapWindow(self.window) else: if self.surface.surface != self.window_surface: self.proxy_window_surface() with nogil: SDL_UpdateWindowSurface(self.window) def get_surface(self): return self.surface def update(self, rectangles=None): cdef SDL_Rect *rects cdef int count = 0 if rectangles is None: self.flip() return if self.surface.surface != self.window_surface: self.proxy_window_surface() if not isinstance(rectangles, list): rectangles = [ rectangles ] rects = calloc(len(rectangles), sizeof(SDL_Rect)) if rects == NULL: raise MemoryError("Couldn't allocate rectangles.") try: for i in rectangles: if i is None: continue to_sdl_rect(i, &rects[count]) count += 1 SDL_UpdateWindowSurfaceRects(self.window, rects, count) finally: free(rects) def get_wm_info(self): return { } def get_active(self): if SDL_GetWindowFlags(self.window) & (SDL_WINDOW_HIDDEN | SDL_WINDOW_MINIMIZED): return False else: return True def iconify(self): SDL_MinimizeWindow(self.window) return True def toggle_fullscreen(self): if SDL_GetWindowFlags(self.window) & (SDL_WINDOW_FULLSCREEN_DESKTOP): if SDL_SetWindowFullscreen(self.window, 0): raise error() else: if SDL_SetWindowFullscreen(self.window, SDL_WINDOW_FULLSCREEN_DESKTOP): raise error() return True def set_gamma(self, red, green=None, blue=None): if green is None: green = red if blue is None: blue = red cdef Uint16 red_gamma[256] cdef Uint16 green_gamma[256] cdef Uint16 blue_gamma[256] SDL_CalculateGammaRamp(red, red_gamma) SDL_CalculateGammaRamp(green, green_gamma) SDL_CalculateGammaRamp(blue, blue_gamma) if SDL_SetWindowGammaRamp(self.window, red_gamma, green_gamma, blue_gamma): return False return True def set_gamma_ramp(self, red, green, blue): cdef Uint16 red_gamma[256] cdef Uint16 green_gamma[256] cdef Uint16 blue_gamma[256] for i in range(256): red_gamma[i] = red[i] green_gamma[i] = green[i] blue_gamma[i] = blue[i] if SDL_SetWindowGammaRamp(self.window, red_gamma, green_gamma, blue_gamma): return False return True def set_icon(self, Surface surface): SDL_SetWindowIcon(self.window, surface.surface) def set_caption(self, title): if not isinstance(title, bytes): title = title.encode("utf-8") SDL_SetWindowTitle(self.window, title) def get_drawable_size(self): cdef int w, h SDL_GL_GetDrawableSize(self.window, &w, &h) return w, h # The icon that's used for new windows. default_icon = None # The title that's used for new windows. default_title = "pygame window" # The default gl_swap_control default_swap_control = 1 def set_mode(resolution=(0, 0), flags=0, depth=0, pos=(SDL_WINDOWPOS_UNDEFINED, SDL_WINDOWPOS_UNDEFINED)): global main_window if main_window: if (flags & ~SDL_WINDOW_OPENGL) == (main_window.create_flags & ~SDL_WINDOW_OPENGL): main_window.resize(resolution, flags & SDL_WINDOW_OPENGL) return main_window.surface else: main_window.destroy() main_window = Window(default_title, resolution, flags, depth, pos=pos) if default_icon is not None: main_window.set_icon(default_icon) return main_window.surface def get_surface(): if main_window is None: return None return main_window.get_surface() def get_window(): """ Returns the Window created by set_mode, or None if no such window exists. """ return main_window def flip(): if main_window: main_window.flip() def update(rectangles=None): if main_window: main_window.update(rectangles) def get_driver(): cdef const char *driver = SDL_GetCurrentVideoDriver() if driver == NULL: raise error() return driver class Info(object): def __init__(self): cdef SDL_DisplayMode dm cdef SDL_PixelFormat *format if SDL_GetCurrentDisplayMode(0, &dm): raise error() format = SDL_AllocFormat(dm.format) if format == NULL: raise error() self.bitsize = format.BitsPerPixel self.bytesize = format.BytesPerPixel self.masks = ( format.Rmask, format.Gmask, format.Bmask, format.Amask, ) self.shifts = ( format.Rshift, format.Gshift, format.Bshift, format.Ashift, ) self.losses = ( format.Rloss, format.Gloss, format.Bloss, format.Aloss, ) SDL_FreeFormat(format) if main_window: self.current_w, self.current_h = main_window.surface.get_size() else: self.current_w = dm.w self.current_h = dm.h self.refresh_rate = dm.refresh_rate # The rest of these are just guesses. self.hw = False self.wm = True self.video_mem = 256 * 1024 * 1024 self.blit_hw = False self.blit_hw_CC = False self.blit_hw_A = False self.blit_sw = False self.blit_sw_CC = False self.blit_sw_A = False def __repr__(self): return "".format(self.__dict__) def get_wm_info(): if main_window: return main_window.get_wm_info() return {} def get_num_video_displays(): """ Returns the number of video displays connected to the system. """ rv = SDL_GetNumVideoDisplays() if rv < 0: raise error() return rv def list_modes(depth=0, flags=0, display=0): """ Returns a list of possible display modes for the display `display`. `depth` and `flags` are ignored. """ cdef int num_modes, i cdef SDL_DisplayMode mode rv = [ ] num_modes = SDL_GetNumDisplayModes(display) if num_modes < 0: raise error() for 0 <= i < num_modes: if SDL_GetDisplayMode(display, i, &mode) == 0: t = (mode.w, mode.h) if t not in rv: rv.append(t) return rv def mode_ok(size, flags=0, depth=0): """ Returns true if size is in the result of list_modes(). """ return tuple(size) in list_modes() def gl_reset_attributes(): SDL_GL_ResetAttributes() def gl_set_attribute(flag, value): if flag == GL_SWAP_CONTROL: if ios: return global default_swap_control # Try setting the swap interval - first positive, then negated # to deal with the case where the negative interval isn't # supported. Then give up and carry on. if SDL_GL_SetSwapInterval(value): SDL_GL_SetSwapInterval(-value) default_swap_control = value return if SDL_GL_SetAttribute(flag, value): raise error() def gl_get_attribute(flag): cdef int rv if flag == GL_SWAP_CONTROL: return SDL_GL_GetSwapInterval() if SDL_GL_GetAttribute(flag, &rv): raise error() return rv def gl_load_library(path): if path is None: if SDL_GL_LoadLibrary(NULL): raise error() else: if SDL_GL_LoadLibrary(path): raise error() def gl_unload_library(): SDL_GL_UnloadLibrary() def get_active(): if main_window: return main_window.get_active() return False def iconify(): if main_window: return main_window.iconify() return False def toggle_fullscreen(): if main_window: return main_window.toggle_fullscreen() return True def set_gamma(red, green=None, blue=None): if main_window: return main_window.set_gamma(red, green, blue) return False def set_gamma_ramp(red, green, blue): if main_window: return main_window.set_gamma_ramp(red, green, blue) return False def set_icon(surface): global default_icon default_icon = surface.copy() if main_window is not None: main_window.set_icon(default_icon) def set_caption(title, icontitle = None): global default_title default_title = title if main_window: main_window.set_caption(default_title) def get_caption(): return default_title def get_drawable_size(): if main_window: return main_window.get_drawable_size() return None def get_num_video_displays(): rv = SDL_GetNumVideoDisplays() if rv < 0: raise error() return rv def get_display_bounds(index): cdef SDL_Rect rect rv = SDL_GetDisplayBounds(index, &rect) return (rect.x, rect.y, rect.w, rect.h) def get_platform(): return SDL_GetPlatform() cdef api SDL_Window *PyWindow_AsWindow(window): """ Returns a pointer to the SDL_Window corresponding to `window`. If `window` is None, a pointer to the main window is returned. NULL is returned if there is no main window. """ if window is None: window = main_window if window is None: return NULL return ( window).window pygame_sdl2-2.1.0-for-renpy-6.99.14.1/src/pygame_sdl2/gfxdraw.pyx0000664000175000017500000001650613053465633023467 0ustar tomtom00000000000000# Copyright 2014 Patrick Dawson # # This software is provided 'as-is', without any express or implied # warranty. In no event will the authors be held liable for any damages # arising from the use of this software. # # Permission is granted to anyone to use this software for any purpose, # including commercial applications, and to alter it and redistribute it # freely, subject to the following restrictions: # # 1. The origin of this software must not be misrepresented; you must not # claim that you wrote the original software. If you use this software # in a product, an acknowledgment in the product documentation would be # appreciated but is not required. # 2. Altered source versions must be plainly marked as such, and must not be # misrepresented as being the original software. # 3. This notice may not be removed or altered from any source distribution. from sdl2 cimport * from sdl2_gfx cimport * from libc.stdlib cimport malloc, free from pygame_sdl2.surface cimport Surface from pygame_sdl2.color cimport Color from pygame_sdl2.error import error from pygame_sdl2.rect import Rect def pixel(Surface surface, x, y, color): cdef Color c = Color(color) pixelRGBA(surface.surface, x, y, c.r, c.g, c.b, c.a) def hline(Surface surface, x1, x2, y, color): cdef Color c = Color(color) hlineRGBA(surface.surface, x1, x2, y, c.r, c.g, c.b, c.a) def vline(Surface surface, x, y1, y2, color): cdef Color c = Color(color) vlineRGBA(surface.surface, x, y1, y2, c.r, c.g, c.b, c.a) def rectangle(Surface surface, rect, color): cdef Color c = Color(color) if not isinstance(rect, Rect): rect = Rect(rect) rectangleRGBA(surface.surface, rect.x, rect.y, rect.x + rect.w, rect.y + rect.h, c.r, c.g, c.b, c.a) def rounded_rectangle(Surface surface, rect, rad, color): cdef Color c = Color(color) if not isinstance(rect, Rect): rect = Rect(rect) roundedRectangleRGBA(surface.surface, rect.x, rect.y, rect.x + rect.w, rect.y + rect.h, rad, c.r, c.g, c.b, c.a) def box(Surface surface, rect, color): cdef Color c = Color(color) if not isinstance(rect, Rect): rect = Rect(rect) boxRGBA(surface.surface, rect.x, rect.y, rect.x + rect.w, rect.y + rect.h, c.r, c.g, c.b, c.a) def rounded_box(Surface surface, rect, rad, color): cdef Color c = Color(color) if not isinstance(rect, Rect): rect = Rect(rect) roundedBoxRGBA(surface.surface, rect.x, rect.y, rect.x + rect.w, rect.y + rect.h, rad, c.r, c.g, c.b, c.a) def line(Surface surface, x1, y1, x2, y2, color): cdef Color c = Color(color) lineRGBA(surface.surface, x1, y1, x2, y2, c.r, c.g, c.b, c.a) def aaline(Surface surface, x1, y1, x2, y2, color): cdef Color c = Color(color) aalineRGBA(surface.surface, x1, y1, x2, y2, c.r, c.g, c.b, c.a) def thick_line(Surface surface, x1, y1, x2, y2, width, color): cdef Color c = Color(color) # This locks up in c code when trying to draw a zero-length line. So make # sure that doesn't happen. cdef int x1int, y1int, x2int, y2int x1int = x1 y1int = y1 x2int = x2 y2int = y2 if x1int == x2int and y1int == y2int: return thickLineRGBA(surface.surface, x1int, y1int, x2int, y2int, width, c.r, c.g, c.b, c.a) def circle(Surface surface, x, y, r, color): cdef Color c = Color(color) circleRGBA(surface.surface, x, y, r, c.r, c.g, c.b, c.a) def arc(Surface surface, x, y, r, start, end, color): cdef Color c = Color(color) arcRGBA(surface.surface, x, y, r, start, end, c.r, c.g, c.b, c.a) def aacircle(Surface surface, x, y, r, color): cdef Color c = Color(color) aacircleRGBA(surface.surface, x, y, r, c.r, c.g, c.b, c.a) def filled_circle(Surface surface, x, y, r, color): cdef Color c = Color(color) filledCircleRGBA(surface.surface, x, y, r, c.r, c.g, c.b, c.a) def ellipse(Surface surface, x, y, rx, ry, color): cdef Color c = Color(color) ellipseRGBA(surface.surface, x, y, rx, ry, c.r, c.g, c.b, c.a) def aaellipse(Surface surface, x, y, rx, ry, color): cdef Color c = Color(color) aaellipseRGBA(surface.surface, x, y, rx, ry, c.r, c.g, c.b, c.a) def filled_ellipse(Surface surface, x, y, rx, ry, color): cdef Color c = Color(color) filledEllipseRGBA(surface.surface, x, y, rx, ry, c.r, c.g, c.b, c.a) def pie(Surface surface, x, y, r, start, end, color): cdef Color c = Color(color) pieRGBA(surface.surface, x, y, r, start, end, c.r, c.g, c.b, c.a) def filled_pie(Surface surface, x, y, r, start, end, color): cdef Color c = Color(color) filledPieRGBA(surface.surface, x, y, r, start, end, c.r, c.g, c.b, c.a) def trigon(Surface surface, x1, y1, x2, y2, x3, y3, color): cdef Color c = Color(color) trigonRGBA(surface.surface, x1, y1, x2, y2, x3, y3, c.r, c.g, c.b, c.a) def aatrigon(Surface surface, x1, y1, x2, y2, x3, y3, color): cdef Color c = Color(color) aatrigonRGBA(surface.surface, x1, y1, x2, y2, x3, y3, c.r, c.g, c.b, c.a) def filled_trigon(Surface surface, x1, y1, x2, y2, x3, y3, color): cdef Color c = Color(color) filledTrigonRGBA(surface.surface, x1, y1, x2, y2, x3, y3, c.r, c.g, c.b, c.a) def polygon(Surface surface, points, color): cdef Color c = Color(color) cdef Sint16 *vx cdef Sint16 *vy cdef size_t num_points = len(points) vx = malloc(num_points * sizeof(Sint16)) vy = malloc(num_points * sizeof(Sint16)) for n, pt in zip(range(num_points), points): vx[n], vy[n] = points[n] polygonRGBA(surface.surface, vx, vy, num_points, c.r, c.g, c.b, c.a) free(vx) free(vy) def aapolygon(Surface surface, points, color): cdef Color c = Color(color) cdef Sint16 *vx cdef Sint16 *vy cdef size_t num_points = len(points) vx = malloc(num_points * sizeof(Sint16)) vy = malloc(num_points * sizeof(Sint16)) for n, pt in zip(range(num_points), points): vx[n], vy[n] = points[n] aapolygonRGBA(surface.surface, vx, vy, num_points, c.r, c.g, c.b, c.a) free(vx) free(vy) def filled_polygon(Surface surface, points, color): cdef Color c = Color(color) cdef Sint16 *vx cdef Sint16 *vy cdef size_t num_points = len(points) vx = malloc(num_points * sizeof(Sint16)) vy = malloc(num_points * sizeof(Sint16)) for n, pt in zip(range(num_points), points): vx[n], vy[n] = points[n] filledPolygonRGBA(surface.surface, vx, vy, num_points, c.r, c.g, c.b, c.a) free(vx) free(vy) def textured_polygon(Surface surface, points, Surface texture not None, tx, ty): cdef Sint16 *vx cdef Sint16 *vy cdef size_t num_points = len(points) vx = malloc(num_points * sizeof(Sint16)) vy = malloc(num_points * sizeof(Sint16)) for n, pt in zip(range(num_points), points): vx[n], vy[n] = points[n] texturedPolygon(surface.surface, vx, vy, num_points, texture.surface, tx, ty) free(vx) free(vy) def bezier(Surface surface, points, steps, color): cdef Color c = Color(color) cdef Sint16 *vx cdef Sint16 *vy cdef size_t num_points = len(points) vx = malloc(num_points * sizeof(Sint16)) vy = malloc(num_points * sizeof(Sint16)) for n, pt in zip(range(num_points), points): vx[n], vy[n] = points[n] bezierRGBA(surface.surface, vx, vy, num_points, steps, c.r, c.g, c.b, c.a) free(vx) free(vy) pygame_sdl2-2.1.0-for-renpy-6.99.14.1/src/pygame_sdl2/display.pxd0000664000175000017500000000253712647113421023435 0ustar tomtom00000000000000# Copyright 2014 Patrick Dawson # Copyright 2014 Tom Rothamel # # This software is provided 'as-is', without any express or implied # warranty. In no event will the authors be held liable for any damages # arising from the use of this software. # # Permission is granted to anyone to use this software for any purpose, # including commercial applications, and to alter it and redistribute it # freely, subject to the following restrictions: # # 1. The origin of this software must not be misrepresented; you must not # claim that you wrote the original software. If you use this software # in a product, an acknowledgment in the product documentation would be # appreciated but is not required. # 2. Altered source versions must be plainly marked as such, and must not be # misrepresented as being the original software. # 3. This notice may not be removed or altered from any source distribution. from sdl2 cimport * from pygame_sdl2.surface cimport Surface cdef class Window: # Allow weak references. cdef object __weakref__ cdef SDL_Window *window cdef SDL_Surface *window_surface cdef public Surface surface # The OpenGL context corresponding to this window. cdef SDL_GLContext gl_context # The flags the window was created with. cdef Uint32 create_flags cdef Window main_window = None pygame_sdl2-2.1.0-for-renpy-6.99.14.1/src/pygame_sdl2/DejaVuSans.txt0000664000175000017500000001132012651174172024012 0ustar tomtom00000000000000Fonts are (c) Bitstream (see below). DejaVu changes are in public domain. Glyphs imported from Arev fonts are (c) Tavmjong Bah (see below) Bitstream Vera Fonts Copyright ------------------------------ Copyright (c) 2003 by Bitstream, Inc. All Rights Reserved. Bitstream Vera is a trademark of Bitstream, Inc. Permission is hereby granted, free of charge, to any person obtaining a copy of the fonts accompanying this license ("Fonts") and associated documentation files (the "Font Software"), to reproduce and distribute the Font Software, including without limitation the rights to use, copy, merge, publish, distribute, and/or sell copies of the Font Software, and to permit persons to whom the Font Software is furnished to do so, subject to the following conditions: The above copyright and trademark notices and this permission notice shall be included in all copies of one or more of the Font Software typefaces. The Font Software may be modified, altered, or added to, and in particular the designs of glyphs or characters in the Fonts may be modified and additional glyphs or characters may be added to the Fonts, only if the fonts are renamed to names not containing either the words "Bitstream" or the word "Vera". This License becomes null and void to the extent applicable to Fonts or Font Software that has been modified and is distributed under the "Bitstream Vera" names. The Font Software may be sold as part of a larger software package but no copy of one or more of the Font Software typefaces may be sold by itself. THE FONT SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT OF COPYRIGHT, PATENT, TRADEMARK, OR OTHER RIGHT. IN NO EVENT SHALL BITSTREAM OR THE GNOME FOUNDATION BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, INCLUDING ANY GENERAL, SPECIAL, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL DAMAGES, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF THE USE OR INABILITY TO USE THE FONT SOFTWARE OR FROM OTHER DEALINGS IN THE FONT SOFTWARE. Except as contained in this notice, the names of Gnome, the Gnome Foundation, and Bitstream Inc., shall not be used in advertising or otherwise to promote the sale, use or other dealings in this Font Software without prior written authorization from the Gnome Foundation or Bitstream Inc., respectively. For further information, contact: fonts at gnome dot org. Arev Fonts Copyright ------------------------------ Copyright (c) 2006 by Tavmjong Bah. All Rights Reserved. Permission is hereby granted, free of charge, to any person obtaining a copy of the fonts accompanying this license ("Fonts") and associated documentation files (the "Font Software"), to reproduce and distribute the modifications to the Bitstream Vera Font Software, including without limitation the rights to use, copy, merge, publish, distribute, and/or sell copies of the Font Software, and to permit persons to whom the Font Software is furnished to do so, subject to the following conditions: The above copyright and trademark notices and this permission notice shall be included in all copies of one or more of the Font Software typefaces. The Font Software may be modified, altered, or added to, and in particular the designs of glyphs or characters in the Fonts may be modified and additional glyphs or characters may be added to the Fonts, only if the fonts are renamed to names not containing either the words "Tavmjong Bah" or the word "Arev". This License becomes null and void to the extent applicable to Fonts or Font Software that has been modified and is distributed under the "Tavmjong Bah Arev" names. The Font Software may be sold as part of a larger software package but no copy of one or more of the Font Software typefaces may be sold by itself. THE FONT SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT OF COPYRIGHT, PATENT, TRADEMARK, OR OTHER RIGHT. IN NO EVENT SHALL TAVMJONG BAH BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, INCLUDING ANY GENERAL, SPECIAL, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL DAMAGES, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF THE USE OR INABILITY TO USE THE FONT SOFTWARE OR FROM OTHER DEALINGS IN THE FONT SOFTWARE. Except as contained in this notice, the name of Tavmjong Bah shall not be used in advertising or otherwise to promote the sale, use or other dealings in this Font Software without prior written authorization from Tavmjong Bah. For further information, contact: tavmjong @ free . fr. $Id: LICENSE 2133 2007-11-28 02:46:28Z lechimp $ pygame_sdl2-2.1.0-for-renpy-6.99.14.1/src/pygame_sdl2/version.py0000664000175000017500000000176012651553340023312 0ustar tomtom00000000000000# Copyright 2014 Tom Rothamel # # This software is provided 'as-is', without any express or implied # warranty. In no event will the authors be held liable for any damages # arising from the use of this software. # # Permission is granted to anyone to use this software for any purpose, # including commercial applications, and to alter it and redistribute it # freely, subject to the following restrictions: # # 1. The origin of this software must not be misrepresented; you must not # claim that you wrote the original software. If you use this software # in a product, an acknowledgment in the product documentation would be # appreciated but is not required. # 2. Altered source versions must be plainly marked as such, and must not be # misrepresented as being the original software. # 3. This notice may not be removed or altered from any source distribution. import pygame_sdl2 vernum = (2, 1, 0) ver = ".".join(str(i) for i in vernum) rev = "pygame_sdl2-not-tracked" pygame_sdl2-2.1.0-for-renpy-6.99.14.1/src/pygame_sdl2/color.pxd0000664000175000017500000000254712426562233023113 0ustar tomtom00000000000000# Copyright 2014 Tom Rothamel # Copyright 2014 Patrick Dawson # # This software is provided 'as-is', without any express or implied # warranty. In no event will the authors be held liable for any damages # arising from the use of this software. # # Permission is granted to anyone to use this software for any purpose, # including commercial applications, and to alter it and redistribute it # freely, subject to the following restrictions: # # 1. The origin of this software must not be misrepresented; you must not # claim that you wrote the original software. If you use this software # in a product, an acknowledgment in the product documentation would be # appreciated but is not required. # 2. Altered source versions must be plainly marked as such, and must not be # misrepresented as being the original software. # 3. This notice may not be removed or altered from any source distribution. from sdl2 cimport * cdef Uint32 map_color(SDL_Surface *surface, color) except? 0xaabbccdd cdef object get_color(Uint32 pixel, SDL_Surface *surface) cdef to_sdl_color(color, SDL_Color *out) cdef class Color: # Allow weak references. cdef object __weakref__ cdef public Uint8 r, g, b, a cdef uint8_t length cdef from_rgba(self, Uint8 r, Uint8 g, Uint8 b, Uint8 a) cdef from_name(self, c) cdef from_hex(self, c) pygame_sdl2-2.1.0-for-renpy-6.99.14.1/src/pygame_sdl2/DejaVuSans.ttf0000664000175000017500000270455012651176737024021 0ustar tomtom00000000000000@FFTMo9ž¸LGDEF”#ŽBh”GPOS œ&öüžGSUB¹¿8Z¢ÞMATH§6€·ü>OS/2Y-v-¾<Vcmap‘Áʾ”îcvt i9Õ„þfpgmq4vjׄ«gaspØ0 glyfh„h1Ø<y\head]‡ Q˜6hhea Ÿ¿ QÐ$hmtxÅ5Øý Qôafkern ½E ³\?üloca`–ÆŒ óXaˆmaxpÎq Tà namemM¡ U=post xŽ ’ñõprep;ñ „hÌ=¢ÏÑ}ýôÑ}ýô(0Y°±ÅÆÆÇÊËÌÍÑÒÓÔäåéêóôôõõöö÷ÿ          $%%&JKKLNOSTrs€‘>??@ABIJPQVWö÷üý     ( ) + , ~   €  ‘ — ˜ ˜ ™ œ ž Ÿ ¶ · ¸ ¹ Ñ Ò Ò Ó­®º»»¼¼½æççèdeeffgghjkklvwëìóô !tu|}Ö×ר`±ÆÇÊÍרØÙÙÚäêíîõöö÷÷øúûýþÿ Ü\DFLTzarab†armn¨brai´cansÀcherÌcyrlØgeorôgrekhanihebrkana*lao 6latnFmath†nko ’ogam runr¬tfng¸thaiÆÿÿKUR SND URD ÿÿÿÿÿÿÿÿÿÿMKD SRB ÿÿÿÿÿÿÿÿÿÿÿÿÿÿ4ISM 4KSM 4LSM 4MOL 4NSM 4ROM 4SKS 4SSM 4ÿÿÿÿÿÿÿÿÿÿÿÿÿÿ kern8kern>markFmarkTmark\markdmkmkjmkmkrmkmkx    "*2:BLT\dlt|„Œž¦ŒÞ¦ØfF ü f!<":#ø8ª9Ò;‚=4BÞC^FüX„q´ròš 0&: þ þÔýóux}ux}Ú® *06<BHNTZ`flrx~„Š–œ:¤:Ü::ܤ:þr:ü Äü4 Ä4Ð `Kstvwyz{|~uvwxyz{|Kstvwyz{|~uvwxyz{|RX^djpv|‚ˆŽ”𠦬²¸¾Ä°°°°°°°°°°°°°°°°°°°°$ ýlýàIFG ý¨ý¨N>X  &,ý„öýlwýlwýlwýfný„ö?BCDEHQV &,28ýl`ýl~ýl~ýl`ýl~ýl`Z&” #HNTZ`flrx~„Š–œ¢¨®´ºÀÆÌÒØÞäêðöüþýÞþýÞþþþþþýÚþþþþþþþþ‰þþ‰þþ‰þýÚþþþþtþþtþþþþþþ;þþþþþþ8þþ8þþ8þþ¿þýÚþþþþþþ þþþþþþþþþþþþþýÚÇÊÍÑÔâ êíøúþÿ!" ÇÊÍÑÔ× Úâ êíøúþÿ !†Œ’˜ž¤ª°¶¼ÂÈÎÔÚàæìòøþ "(.4:@FþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþBÞŽ :v|‚ˆŽ”𠦬²¸¾ÄÊÐÖÜâèîôú $*06<BHNTZ`flrx~„Š–œ¢¨®´ºÀÆÌþhþhþhþ=þþþDþþþÅþþhþhþ¨þ¨þhþVþDþ“þþhþhþ=þÐþDþDþþþþÚþnnnnþþþþþhþhþþþþþþþþøþøþøþøþøþøþÛþøþøþ±Âîîðóõõ÷÷ûý   !÷ü# ‘ —)01 2××9 ±Âîîðóõõ÷÷ûý÷ü ‘ —% ,××78âèîôú $*06<BHNTZ`flrx~„Š–œ¢¨®´ºÀÆÌÒØÞäêðöü &,þ{þ{þ{þ°þþþþþþ{þ{þ{þ{þ{þ{þ{þþþþþ{þ{þ°þþþþ{þ{þ{þþ{þþþþþ{þ{þþþþþþþþ{þ{þ{þ{þ{þ{þ{þ{þ{þ{þ{þ{¸®Ú $6HZl~ cÿœÈÿj cÿœÈÿj cÿœÈÿj cÿœÈÿj cÿœÈýÚ cÿœÈýÚ cÿœÈÿj cÿœÈÿjìó%ux}>DJPV\bhntz€†Œ’Æ< wðöü &,28>DJPV\bhntz€†Œ’˜ž¤ª°¶¼ÂÈÎÔÚàæìòøþ "(.4:@FLRX^djpv|‚ˆŽ”𠦬²¸¾ÄÊÐÖÜâèîôú $*06<BHNTZ`flrx~„Š–œ¢¨®´ºÀÆÌÒØÞäêðöü &,28>DJPV\bhntz€†Œ’˜ž¤ª°¶¼ÂÈÎÔÚàæìòøþ     " ( . 4 : @ F L R X ^ d j p v | ‚ ˆ Ž ” š   ¦ ¬ ² ¸ ¾ Ä Ê Ð Ö Ü â è î ô ú     $ * 0 6 < B H N T Z ` f l r x ~ „ Š – œ ¢ ¨ ® ´ º À Æ Ì Ò Ø Þ ä ê ð ö ü      & , 2 8 > D J P V \ b h n t z € † Œ ’ ˜ ž ¤ ª ° ¶ ¼ Â È Î Ô Ú à æ ì ò ø þ     " ( . 4 : @ F L R X ^ d j p v | ‚ ˆ Ž ” š   ¦ ¬ ² ¸ ¾ Ä Ê Ð Ö Ü â è î ô ú     $ * 0 6 < B H N T Z ` f l r x ~ „ Š – œ ¢ ¨ ® ´ º À Æ Ì Ò Ø Þ ä ê ð ö ü &,28>DJPV\bhntz€†Œ’˜ž¤ª°¶¼ÂÈÎÔÚàæìòøþ "(.4:@FLRX^djpv|‚ˆŽ”𠦬²¸¾ÄÊÐÖÜâèîôú $*06<BHNTZ`flrx~„Š–œ¢¨®´ºÀÆÌÒØÞäêðöü &,28>DJPV\bhntz€†Œ’˜ž¤ª°¶¼ÂÈÎÔÚàæìòøþ "(.4:@FLRX^djpv|‚ˆŽ”𠦬²¸¾ÄÊÐÖÜâèîôú $*06<BHNTZ`flrx~„Š–œ¢¨®´ÞUÛø«,«Áå£!ì¸þ8©|ÿúšQþ'Änâââÿœÿœôþ ýÚ¼þpÿœ„þpôÿj„ÿj„ÿj,ýv,ý¨,ývÂÿjÂÿjôþ ôþ Xý¨Xý¨Xý¨XýD[ÿj[ÿj×ý¨×ý¨,ÿœ ÿ8¼ýÚ ÿ8¼þ>ðý¨îþ>ôÿjôþ ¼þp¼ýÚ„ÿj¼ýÚ„ÿj„ÿj„ý¨„þ^„ÿj„ý¨„ÿj„ý¨,ý¨,ý¨,ý¨,ý¨,ý¨,ý¨,ý¨Âÿjôþ^ôþpôþpÂÿjóþ¢ÂÿjÂÿjÂÿjôþ ôþ ôþ ôþ ôþ ôþ ôþ ôþ ôþ Xý¨Xý¨Xý¨Xý¨Xý¨[ÿj×ý¨ ÿ8¶þp¶þp ÿ8¶ýv ÿ8¼ýÚ¼ýÚ ÿj ÿj ÿj ÿ8 ÿ8 ýv ÿj ÿj ÿj þp ýD ÿj¼þ>¼þ>¼þ>îü®ýDîþ>îþ>ýîþ> ÿj,ý¨ôþ ôþ ôþ ôþ ¼þp¼þpÕüšôÿjI«^`’k/©ÕÝ#€eÝ€YYY„ý¨„ý¨+ýÚ+ýÚ„ý¨„ý¨+ýÚ+ýÚ„ý¨„ý¨+ýÚ+ýÚ„ÿj„ÿj+ÿœ+ÿœ„ÿj„ÿj+ÿœ+ÿœ„ÿj„ÿj+ÿœ+ÿœ ÿ8 ÿ8ôÿjÿj ÿ8 ÿ8ôÿjÿj,ý¨,ý¨Xþ Xþ ,ý¨,ý¨XÿXÿ,ý¨,ý¨Xþ Xþ ,ý¨,ý¨Xþ Xþ óþ¢óþ¢ÂÿjÂÿjÂÿjÂÿjÂÿjÂÿjôþ ôþ ôþ ôþ  ÿj ÿj,ÿj,ÿj ÿj ÿj,ÿj,ÿj ýD ýDývýv ÿj ÿj,ÿj,ÿjîþ>îý¨îþ>îý¨+ÿœ+ÿœ ÿjRý¨Âÿjôý¨ ÿ8 ÿ8,ÿj,ÿjôþ ôþ ôþ ôþ ôþ ôþ ôþ ôþ ÕüšÕüš+ýÚ+ýÚ+ÿœ+ÿœ¼þp¼þp+þ¢+þ¢,ÿœ,ÿœ,ÿœÅÿœ,þ ,ÿœ,ÿœ,ÿœ,ÿœ,þÔ,þÔ,ÿœ,ÿœ,ÿœ,ÿœô2ÿœÿœÿœÿœôþ ôþ ý¨ý¨¼þp¼þp+ÿœ+ÿœÿœÿœ„þp„þp+þ¢+þ¢ôÿjôÿj„ÿj„ÿj+ÿœ+ÿœ„ÿj„ÿj+ÿœ+ÿœ,ý¨,ý¨Xþ¢Xþ¢,ý¨,ý¨XÿœXÿœ,ý¨,ý¨XÿœXÿœÂÿjÂÿjÂÿjÂÿjôþ ôþ ôþ ôþ Xý¨Xý¨ŠÿjŠÿjXý¨Xý¨ŠÿjŠÿjXý¨Xý¨&ÿj&ÿjXý¨Xý¨&ÿj&ÿj[ÿj[ÿjSÿjSÿj[ÿj[ÿjSÿjSÿjŠý¨×ý¨XÿœîÿœŠý¨×ý¨Xÿœîÿœ ÿ8 ÿ8ôÿjÿj¼ýÚ¼ý¨ôÿjÿj ÿ8 ÿ8,ÿj,ÿj¼þ>¼þ>SÿœSÿœðý¨ðý¨&ÿj&ÿjîþ>îý¨+ÿœ+ÿœôÿjôÿjÂÿjôý¨ôþ ôþ ¼þp¼þp¼ýÚ¼ýÚ+þ¢+þ¢„ÿj+ÿœ+ÿœ ÿ8ôÿjÿj¼ý™ôÿjÿj+ÿœ+ÿœ„þ^+þÂ+þ„ÿj+ÿœ+ÿœ,ý¨XÿœXÿœ,ý¨XÿœXÿœ,ý¨XÿœXÿœ,ý¨Xþ Xþ ôþ ôþ ¼þ>SÿœSÿœ¼þp+þ¢+þ¢ôþ ôÿjIII«««^^^```’’’kkk///©©©ÕÕÕÝÝÝ###€€€eeeÝÝÝ€€€YYYYYYYYYôþ^ôþpôþpÂÿjÂÿjôþ ôþ ôþ ôþ ôþ Xý¨èþpèþpXý¨èýÚèýÚXý¨èýÚèýÚXý¨ þp þpXý¨&ÿj&ÿj[ÿjSÿjSÿj×ý¨Xÿœîÿœ¶þpóþ¢óþ¢¶þpóþ¢óþ¢¶ývôý¨ôý¨¼ý™ôÿjÿj¼ý™ôÿjÿj ÿj¤ÿj¤ÿj ÿj,ÿj,ÿj ÿ8,ÿj,ÿj ývý¨ý¨ ÿj,ÿj,ÿj þpþ¢þ¢ ÿj,ÿj,ÿj¼þ>SÿœSÿœ¼þ>SÿœSÿœîü®+ýÚIýÚü•+þ¢+þ¢üc+þÂ+þÂîý¨+ÿœ+ÿœ &COrŽB’àDõ“èS±hë'1¡3D¬`h¾jjÇ}ÖÈä8"%ux}BHNTZ`flrx~„Š–œÿÿôÆú 06<BHNTZ`flrx~„Š–œ¢¨®´cŒÑ0ò0¬0™080µ00q=i0Õ0è0«0Ø10Íf0ä0j=Æ0P&,.244 67 9:<@ºº™0¸®è $6HZl~ cr– cr– cr–ä cr–ä cr–Ü cr–Ü cr–Ü cr–ÜìóKstvwyz{|~»uvwxyz{|Z`flrx~„Š–œ¢¨®´ºÀÆÌÒØ`°°°°°°°°°°°°`°°°°°°°°LîŒ \ºÀÆÌÒØÞäêðöü &,28>DJPV\bhntz€†Œ’˜ž¤ª°¶¼ÂÈÎÔÚàæìòøþ "(.4:@FLRX^djpv|‚ˆŽ”𠦬²¸¾ÄÊÐÖÜâèîôú $*06<BHNTZ`flrx~„Š–œ¢¨®´ºÀÆÌÒØÞäêðöü &,28>DJPV\bhntz€†Œ’˜ž¤ª°¶¼ÂÈÎÔÚàæìòøþ     " ( . 4 : @ F L R X ^ d j p v | ‚ ˆ Ž ” š   ¦ ¬ ² ¸ ¾ Ä Ê Ð Ö Ü â è î ô ú     $ * 0 6 < B H N T Z ` f l r x ~ „ Š – œ ¢ ¨ ® ´ º À Æ Ì Ò Ø Þ ä ê ð ö ü      & , 2 8 > D J P V \ b h n t z € † Œ ’ ˜ ž ¤ ª ° ¶ ¼ Â È Î Ô Ú à æ ì ò ø þ     " ( . 4 : @ F L R X ^ d j p v | ‚ ˆ Ž ” š   ¦ ¬ ² ¸ ¾ Ä Ê Ð Ö Ü â è î ô ú     $ * 0 6 < B H N T Z ` f l r x ~ „ Š – œ ¢ ¨ ® ´ º À Æ Ì Ò Ø Þ ä ê ð ö ü &,28>DJPV\bhntz€†Œ’˜ž¤ª°¶¼ÂÈÎÔÚàæìòøþ "(.4:@FLRX^djpv|‚ˆŽ”𠦬²¸¾ÄÊÐÖÜâèîôú $*06<BHNTZ`flrx~„Š–œ¢¨®´ºÀÆÌÒØÞäêðöü &,28>DJPV\bhntz€†Œ’˜ž¤ª°¶¼ÂÈÎÔÚàæìòøþ "(.4:@FLRX^djpv|‚ˆŽ”𠦬²¸¾ÄÊÐÖÜR``S`ž4Âârôr„èÂL„R„LŠèŠèŠâèâ¼î¼èX X X X [r[rÂ~Âx,°¼LôL¼ÜŠŠ¶ŠèÂRôîôîôî„èôL„â„L„è„R„è„è„L„芊܊èŠèŠÜŠèŠèÂ@èèÂ@ÂâèÂܪÂܼx¼°¼î¼î¼î¼î¼è¼â¼âX X X X X [rôr¼L¼L¼L¼L¼L¼LôLôLôxôxôx99¼Üôxôxôxôxôxôx¼4¼4¼fŠŠèŠî¼_Šè¼âRLŠâôâôFôªôâôîôâôîÂRðIð«ð^ððð`ððàððnðð§ð©ðËðÝð#ðò€òðð”ðÝð€òYððððYðYð„è„è+è+è„è„è+è+è„è„è+è+è„L„L++„L„L++„â„â+ª+ª¼L¼Lô@ª¼L¼Lô@ªŠèŠèXèXèŠèŠèXèXèŠèŠèXèXèŠèŠèXèXèèèÂâÂâÂÜÂÜÂ@Â@¼â¼â¼x¼xôxôxúúôxôxú¤ú¤ôxôxú¤ú¤ôxôxllŠîŠŠ¼_¼e+ª+ªRLR ôLô 99žžôFôFôâôâôªôªôâôâôîXî+è+è+è+èôîXV+è+è,¤,¤,:Ű,°,Ü,Ü,:,:,°,°,,,:,:ÂLÐИ˜ÂâÂârrôX+F+Frr„è„è+è+èÂL&L„R„R++„L„L++ŠèŠèXèXèŠèŠèXèXèŠâŠâX~X~èèââ¼î¼î¼è¼èX X ЄЄX X RâRâX X & & X X &è&è[r[rSrSr[r[rSrSrÂ~ôèÂ~îèÂxô~Âxî~¼L¼LôF°ôLôRôF°¼Ü¼ÜúúŠŠSrSrжŠR&R&RŠèŠî++ÂR&RôLô ôîôîôîXVôîXî+è+è„è+è+è¼LôL¶ôRôL¶++„R++„è++ŠXªXªŠÜXxXxŠÜXxXxŠâX~X~¼î¼î¼4S4S4¼¶+°+°¼°&RðððIðIðIð«ð«ð«ð^ð^ð^ððððððð`ð`ð`ððððàðàðàððððnðnðnðððð§ð§ð§ð©ð©ð©ðËðËðËðÝðÝðÝð#ð#ð#ðòòò€ò€ò€òðððððð”ð”ð”ðÝðÝðÝð€ò€ò€òYðYðYððððððððððYðYðYðYðYðYðèèÂ@ªÂܼî¼î¼î¼è¼âX RRX ЄЄX RâRâX & & X XâXâ[rSrSrôxôrîx¼LôL¶¼LôF°¼LôL¶ôRôF°ôRô@ªôxxxxxôxúú9¤¤¼Üúúôxú¤ú¤ôxú¤ú¤ôxff¼4S4S4¼fSfSfŠSrSrŠî++Šî++¼è++''11::OrŽ'’à)õxèS–hë'1†3D‘`h£jj¬}Ö­ä8Kstvwyz{|~»uvwxyz{|z€†Œ’˜ž¤ª°¶¼ÂÈÎÔÚàæìòøþ "(`°°°°°°°°°°°°{{{{{{{{`°°°°°°°°ö <BHNTZ`flrx~„Š–œ¢¨®´ºÀÆÌÒØÞä]xÜþxÿ@€[")ÿ@>Eö"~~€x2 x::"<abFGI"> @FLRX^djpv|‚ˆŽ”𠦬²¸¾ÄÊÐÖÜâèîô]kxyyÜyšxy€z[f"w)h>yEy`Pö["~[~t`€zxy2{` ”ˆuxJJ:ˆ:ˆ"<PP__ab ?BCDEHQRSTUV 28>DJPV\bhnttbbbbt`~~`~` Z ¦þR© ÇÊÍÑÔ× Úä êíøúþÿ!"#ޔ𠦬²¸¾ÄÊÐÖÜâèîôú $*06<BHNTZþÿÿþÿÿþþþÿþþÿÿþÿÿþÿÿþÿÿþÿÿþÿÿþÿÿþÿÿþÿÿþÿÿþÿÿþÿÿþÿÿþÿÿþÿÿþÿÿþÿÿþÿÿþÿÿþÿþþÿÿþÿÿþÿÿþÿÿþÿÿþÿÿþÿÿþÿÿþÿÿþÿÿŒ¶” •,28>DJPV\bhntz€†Œ’˜ž¤ª°¶¼ÂÈÎÔÚàæìòøþ "(.4:@FLRX^djpv|‚ˆŽ”𠦬²¸¾ÄÊÐÖÜâèîôú $*06<BHNTZ`flrx~„Š–œ¢¨®´ºÀÆÌÒØÞäêðöü &,28>DJPV\bhntz€†Œ’˜ž¤ððððððððððððððððððððððððððððððððððððððððððððððððððððððððððððððððððððððððððððððððððððððððððððððððððððððððððððððððððððððððððððððððððððððððððððððððððððð#$=D]šš4ºº5ÆÇ6ÐÑ8óó:();AA=HH>QR?YYAaaBy{CFGHI**J77KTTLÐÐM  NèêXíî[ôô]øù^`d$o&*y/2~9E‚IMGG”eg ððbNj $*06<Jìm–s}ìPþ‰ÃÐÕí-  ±² þ{þ{ŒÖ’ Y´ºÀÆÌÒØÞäêðöü &,28>DJPV\bhntz€†Œ’˜ž¤ª°¶¼ÂÈÎÔÚàæìòøþ "(.4:@FLRX^djpv|‚ˆŽ”𠦬²¸¾ÄÿL-ž./++'¢î¾Ñ¦f–s.}////'sÑÿþ€Ñþ€–////s}\'Ä/'¾–ˆþR///‡ÂRJsþR//'s{y5D;Í+¢.’/}þRY$&'(+,01268=DFGHKLPQRVX]ޑ𮝰±ºÃÆÇÕêëìíîïòó-HQRYayz{‘’ÊËÌÍ*7T + , Å Æèô!"?@CDELGãØþî ¶( µlrx~„Š–œ¢¨®´ºÀÆÌÒØÞäêðöü &,28>DJPV\bhntz€†Œ’˜ž¤ª°¶¼ÂÈÎÔÚàæìòøþ "(.4:@FLRX^djpv|‚ˆŽ”𠦬²¸¾ÄÊÐÖÜâèîôú $*06<BHNTZ`flrx~„Š–œ¢¨®´ºÀÆÌÒØÞäêðöü &,28>DJPV\bhntz€†Œ’˜ž¤ª°¶¼ÂÈÎÔÚàæìòøþ "(.4:@FLRX^djpv|‚ˆŽ”𠦬²¸¾ÄÊÐÖÜâèîôú     $ * 0 6 < B H N T Z ` f l r x ~ „ Š – œ ¢ ¨ ® ´ º À Æ Ì Ò Ø Þ ä ê ð ö ü      & , 2 8 > D J P V \ b h n t z € † Œ ’ ˜ ž ¤ ª ° ¶ ¼ Â È Î Ô Ú à æ ì ò ø þ     " ( . 4 : @ F L R X ^ d j p v | ‚ ˆ Ž ” š   ¦ ¬ ² ¸ ¾ Ä Ê Ð Ö Ü â è î ô ú     $ * 0 6 < B H N T Z ` f l r x ~ „ Š – œ ¢ ¨ ® ´ º À Æ Ì Ò Ø Þ ä ê ð ö ü      & , 2 8 > D J P V \ b h n t z € † Œ ’ ˜ ž ¤‹‹‹‹‹‹‹‹‹‹¼¼Lìžž\/.þRž™sõ'ž'}“sî¼õÍr¾J·¤f–;¦þR¦þR¦é¦s¦þRˆþR%ô}^Gb`þR////'ã}sJÿþ€Ñþ€ìf–ªÐ////¦‰þRssô};·\f'Ä7þR/'þz`þR¾–ˆþR///¦ô¼î¼ž”.þRþR'}r`þR‡TÖ¦TþRTcRRJ@@îþRjþRjþR¦bþRb}þR¦¦þR€™þþRîþRééþRéþR‰þR‰þR‰sé¦þR555þRþRaþRƒt;Q'þRþRþRñþRþRþRôþR}}^G^dþRþRþR°:°:þR'aH¦£ÿöþR«þR_ˆþR°:þþþRþGþRŽ þR~þRJ}'/'}ž¦'}^T¦TT@¦X‚}±½½½Tg^GþX^¦þRìfìþ‰fþ‰ìþ¿fþ¿ìþtfþtìþfþ//“èLBRþRfÖÞ,4$þR'„˜_úzþRf4÷ÆŽLÆó}÷`þRüe·™™žTô¦ž¦¾'sþR¼Ãÿä^õG^£5sÔ“þR¾þR/þR‰þRwþRžþRJþVÑ1×ÅÑüvüvÿöüvþRž®•’Ë®;Ínž¦þRªÄþR'ˆþRÛþR þR¦þR÷þRõ¦\¦þRž¦õ¦}“%fOœ’œ©L5s/Ìõî<\’‘þRô&ÕRäx9Ô´\‹‹w‹‹‹‹‹‹‹þRŠÇ}þR^$= D]$Ž‘>ššB¨¨C®²DººIÃÃJÆÇKÐÑMÕÕOèïPòóXúúZ  [\]()^--`AAaEEbHHcNNdQReTTgYYhaailljvvky{l‘’oÊÍqöøu xJ€Lg½ikÙmmÜFFÝIIÞLL߈ˆàššáêëâä""æ33ç66è|}éghëjoírzó~‚ü†‹ÐÐ   + , Å Æ ÷ ø š š ¢ ¥ § © ¬ ¬ ¯ ´! » »' ¿ ¿( à Ä) Æ È+ Ê Ê. Ì Ð/ Ó Ö4 Ë Ë8ÛÛ9ÝÞ:àñ<óõNøùQ??ST  X Z*f/2v8Mzt†žž£  ¤ÕÞ¥GH¯__±ii²ss³ãã´ ÇÊÍÑÔ× Úä êíøúþÿ!"#ޔ𠦬²¸¾ÄÊÐÖÜâèîôú $*06<BHNTZþÿÿþÿÿþþþÿþþÿÿþÿÿþÿÿþÿÿþÿÿþÿÿþÿÿþÿÿþÿÿþÿÿþÿÿþÿÿþÿÿþÿÿþÿÿþÿÿþÿÿþÿÿþÿÿþÿþþÿÿþÿÿþÿÿþÿÿþÿÿþÿÿþÿÿþÿÿþÿÿþÿÿHz” iÔÚàæìòøþ "(.4:@FLRX^djpv|‚ˆŽ”𠦬´ºÂÈÐÖÜâèîôú &,4:@FLRX^djrx~†Œ’˜ ¦¬²¸¾ÄÊÐÖÜâèîôú $*06<BHNTZ`flrx~„Š–œ¢¨®´ºÀÆÌÒØÞäêðöü"(.4:@FNTZ`flrx~„Š–œ¢¨®´ºÀÆÌÒØÞäìòøþ     " ( . 4 : @ F L R X ^ d j p v | ‚ ˆ Ž ” š   ¦ ¬ ² ¸ ¾ Ä Ê Ð Ö Ü â è î ô ú     $ * 0 6 > D J P V \ b h n t z € † Œ ’ ˜ ž ¤ ª ° ¶ ¼ Â È Î Ô Ú à æ ì ò ø þ     " ( . 4 : @ F L R X ^ d j p v | ‚ ˆ Ž ” š   ¦ ¬ ² ¸ ¾ Ä Ê Ð Ö Ü â è î ô ú     $ * 0 6 < B H N T Z ` f l r x ~ „ Š – œ ¢ ¨ ® ´ º À Æ Ì Ò Ø Þ ä ê ð ö ü      & , 2 8 > D J P V \ b h n t z € † Œ ’ ˜ ž ¤ ª ° ¶ ¼ Â È Î Ô Ú à æ ì ò ø þ "(.4:@FLRX^djpv|‚ˆŽ”𠦬²¸¾ÄÊÐÖÜâèîôú &,28>DJRX^djpv|‚ˆŽ”𠦬²¸¾ÄÊÐÖÜâèîôú $*06<BHNTZ`flrx~„Š–œ¢¨®´ºÀÆÌÒØÞäêðöü"(.4:@FLRX^djpv|‚ˆŽ–œ¢¨®´ºÀÆÌÒØàæìòøþ "(.4:@FLRX^djpv|‚ˆŽ”𠦬²¸¾ÄÊÐÖÜâèîôú $*06<BHNTZ`f‹ð‹ð‹ð‹ð‹ð‹ð‹ð‹ð‹ð‹ð¼ð¼ðLðìðžðžð\ðð/ð.ðžð*ðsðõð'ðžð'ð}ð“ðsðîð¼ðõðÍðrð¾ðJ{#ð¤{þð–{àðj{ð//ððé{‰{s{ ¦{o{{'{ð}{^{G{b{`{{'ðã{¦{}ðs{ð¼ðJ{#þðªðQð{¦{‰{{sðð}{àððð\ðLðþðXð'ðÄðžð;ð\ð¿ð/ð/ððð‚ðõð'ððÀð'{ððsððsð§ðrð`{¾ð{¾ð–ðˆ{'ðð‰{ð{¼ðîð¼ðžð{.ð/'ð}ð{rð`{‡{T{Ö{ðÎ{¦{þðþðc{R{R{J|@{@{î{{jðj{¦{b{b{}{ðð/{€{™ðþðððé{é{é{‰{‰{‰{s{{é{¦ð3{3ð3{^{a{p{‚{;{Q{'{ððñ{ð{ð}{}{^{G{^ðd{{{{{°ð:ð°ð:ð'ða{H{¦ð£{/«{{jð°ð:ðþðþðþðGðŽ{ ððJ{~ð^{}ðJ|Eð‰{}ð{£{‚ð‡{{Eð}{p{¦{t{}{j{{ª{b{¤{^{~ð~ð ðî{}{t{^{ï{¦{¦{/'ð¦{ò{ð¦{Hð“ð/ðÕðrðð¼ð¼ð¼ð™ðtðžðOðsðõðîð}ðsðð'ððžðLðsðoðqðÍðð²ðGðGðYð‡ð¼ðNðsðàðT{›ða{E{ö{{›{@{‚{t{ø{{‚{}{{¦{¦{T{`{kðb{{K{©{©{{{{²{ö{t{¦{'{///ú{ó{4ð{¼ð^{óðc{sðö{„ð"{Oð–{,ðs{Oð–{ð%ú'ð}{ð•{žð¦{Oð›{îðt{îðt{îðððe{ðsðK{£{‰{{'ð}{E{Íðb{ø{îðt{ø{‚{^{{{T{¦{TƒT{{@{¦{{{‚{}{±{½{½{½{{{{{T{g{b{^{G{{þ{{^{ø{¦{ìðþðìðþðìðþðìðþð“ðèðLðBðRðfðÆðÖðÞð,ð4â${ð'ð „ð˜ð_âúâzðfð4ðÊDÆðŽðLððÆðóçç}1÷{`{üðeðð*ðð*ðžð}ðT{ðððžðð¾ð{'ðsð¼ðÃÓ^{õðG{^{ð£{ª{3ðs{Ô{“ð¾ðˆðžð/ð³ð {0ðÆ{™ðö{Õð{™ð{'ðlðÚ{nð{T{T{ððwðžðJ{{ðÑ{1ð×{ÅðÑ{üðv{üðvqüðv{žðð*ð’ð\ð®ð;ðÍ{nð{žð¦{ªðÄ{'ðo{ððÛð{ðð‰{²ð÷ðõð‰{\ðj{žððõð‰{}ð{“ð'{fðOï’©{Lð5ðsð/ˆÌðõðîð<ðð\ð’ð‘ððôðð&ððÕðRðäðx÷9÷Ô÷´{\{‹ð‹ðwð‹ð‹ð‹ð‹ð‹ð‹ð‹ðõð{{êðð{{{Çð}{w$= D]$šš>¨©?²²AººBÀÀCÆÇDÑÑFèéGóóIúúJ  KL()M55OABPEERHISNNUPVVXY][]___baacffdijelpgt{l¬¬töùu yJLg¾ikÚmmÝE]Þde÷iiùkkúmmûooüwwý„ŠþŒŒ˜šž £¬ ®ÌÎã5èïKóS b"#h*+j.6l@@uMMvXXw^^xbby|}z‹‹|’“}§§²³€µµ‚··ƒgo„r{~‚—…‹œ£ÐФ ¥ ÷ ø­ š š¯ ¢ ¥° § ©´ ¬ ¬· ¯ ´¸ » »¾ ¿ ¿¿ à ÄÀ Æ ÈÂ Ê ÊÅ Ì ÐÆ Ó ÖË Ë ËÏÛõÐøùë%%í99î??ïÔ×ðÚàôâåûèèÿêê   *,,#.2$7M)t†@žžS  TÕÞUFH___biicmmdpqessgããh ±Åîóõõ÷÷ûý "#÷ü( ‘ —. 5××@A$*06>FLRX`flrx~„Š–œ¢¨®´ºÀÆÌÒØÞäêðöü &,28>FNTZ`flrx~„Š–þ{þ{þ{þ{þ{þ{þ{þ{þ{þ{þ{þ{þ{þ{þ{þ{þ{þ{þŠoþrþrþ{þŠrþ{þ{þ{þ{þ{þ{þ{þ{þ{þ{þ{þ{ýŽ{þ{þA{þ{üê{þ{þ{þ{þ{þ{þ{þ{þ{þ{þ{þ{ þ{þ{þ{þ{þ{þ{þ{þ{þ{þ{þ{þ{þ{þ{>þD >DJPV\bhntz€†Œ’˜ž¤ª°¶¼ÂÈÎÔÚàæìØÀX(ÿþ³l>túþV(t>\X(¾–ˆþR‡ÂDtþR<D$(,28<=DHLRX\]šºóHYayz{*7TèGÙýô&ð!0# 5PÿÓÿ·Kr9KÿDÿˆÿ­ÿšÿ &ÿÉÿÜ&ÿÓKÿÓÿÜÿÜ9ÿÜÿÜÿÜÿÜÿaÿ}ÿÿaÿÜÿÜÿÜÿ·ÿÜÿÜÿˆÿ­ÿuÿ·ÿÜÿÜÿÜ9ÿÜÿÜÿÜÿÜÿÜÿÜÿÜÿÜÿÜÿÜÿaÿÿ­ÿaÿuÿÜÿÜÿaÿaÿuÿ­ÿþøÿ/ÿÜÿÜÿÜÿÜÿÁÿ·ÿÿÁÿÜÿÜÿÜÿÜÿÜÿÜÿ·ÿÿÜÿ·ÿÿÿ­ÿÜÿÜÿÜÿÜÿÜ&ÿÜÿÜÿÿÜÿÜÿÜÿÿÿÓÿÉÿDþ·ÿaÿDÿÜÿÜÿDÿÿkÿ·ÿkÿÿDÿDÿÿ·ÿÿDÿDÿÿkÿ·ÿÜÿÜÿÿDÿ·ÿÜÿ·ÿDÿÓþˆÿ·ÿšÿÜÿÜÿÓÿÓÿÉÿÜÿ·ÿÁÿ·ÿ·ÿÜÿÜÿÜÿ·ÿÁÿÿ)ÿÜÿÿÿaÿÉÿ·ÿ·ÿÜÿšÿšÿšÿkÿ}ÿÿÜÿšÿšÿšÿÁÿÁÿÜ/ÿ·þæÿšÿÿDþðÿÜÿÜÿÜÿDÿÜÿÜÿÜþaýæ9ÿ­ÿÜÿÜÿÜÿ}ÿÿÜÿÓÿÜÿDÿÓþÁÿ}ÿÓÿ¤ÿ·ÿÓÿÜÿ·ÿÜÿÜÿÜÿÜÿ¤ÿ·ÿ·ÿÜ&&þ·9ÿÓÿÜÿ}ÿ­ÿ·ÿÁÿ­ÿšÿkÿÿ­ÿ}ÿÓÿ¤ÿ¤ÿ¤ÿÿÿÜÿšÿÓÿ¤ÿ¤ÿ¤ÿkÿ}ÿÜ&ÿDÿ ÿÿaÿˆÿÜþ­þ¤þ¤ÿÁþ¤þÓþ­þÉþ­þÁÿDÿÿˆÿþàþôþçþ¤ÿÓþøÿÜÿˆþøÿYÿ}ÿÜÿaÿaÿÓÿaÿuÿÉÿNÿÿaÿaÿaÿuþæÿ­ÿÿˆÿÿ}ÿˆÿÓÿˆÿ¤ÿ·ÿÜÿÿÜÿ}ÿˆÿˆÿ·ÿÜþøÿšÿkÿ}ÿÜÿ¤ÿÿkÿ¤ÿaÿ­ÿÓÿ þaþðÿaÿÿþæþðÿ·þðÿÿÿkÿþæþðþðÿÿÿÜþøÿÜÿÜÿÜÿÜÿÜÿÿkÿ·ÿÜÿÜÿÜÿ·ÿÜAÿÿÜÿ·ÿ·ÿÁÿ·ÿÜÿ·ÿ·ÿÁÿkÿÿ¤&ÿÜÿÁÿkÿ·ÿ}ÿ}ÿDÿÜÿÓÿÜÿÓÿÜÿÜÿÓÿÜÿÉÿ·ÿÓÿÓÿÓHVþÉÿÉÿaÿÿÜÿÜÿÜþðÿDÿÿÜÿÜÿ)ÿÜÿÁÿÁÿÁÿÁÿÜÿÜþÜÿkÿÜÿÜþÓÿÜÿÜÿÜÿÜÿÜÿÿÿÜÿkÿÜÿÜÿÜ—ÿÜÿÜÿ·ÿ·ÿÜÿÜÿÜÿÜÿDÿNÿÿÿÿÜÿÜÿÜÿÜÿÓÿÜÿÜ9ÿÜÿÜÿÜÿÜÿaÿ}ÿÿaÿÜÿÜÿÜÿ·ÿÜÿÜÿˆÿ­ÿuÿ·ÿÜÿÜÿÜ9ÿÜÿÜÿÜÿÜÿÜÿÜÿÜÿÜÿaÿÿ­ÿaÿuÿÜþøÿ/ÿÓÿÜÿÜ9ÿÜÿÜÿÜÿÜÿaÿ}ÿÿaÿÜÿÜÿÜÿ·ÿÜÿÜÿˆÿ­ÿuÿ·ÿÜÿÜÿÜ9ÿÜÿÜÿÜÿÜÿÜÿÜÿÜÿÜÿaÿÿ­ÿaÿuÿÜÿþøÿ/ÿÓÿÜÿÜ9ÿÜÿÜÿÜÿÜÿaÿ}ÿÿaÿÜÿÜÿÜÿ·ÿÜÿÜÿˆÿ­ÿuÿ·ÿÜÿÜÿÜ9ÿÜÿÜÿÜÿÜÿÜÿÜÿÜÿÜÿaÿÿ­ÿaÿuÿþøÿ/ÿ­ÿ¤ÿÿÜÿÜÿÜ&ÿkÿ·ÿÜÿD&ÿÿÿ­ÿ¤ÿÿ·ÿÓÿÜÿÜ9ÿÜÿÜÿÜÿÜÿaÿ}ÿÿaÿÜÿÜÿÜÿ·ÿÜÿÜÿˆÿ­ÿuÿ·ÿÜÿÜ9ÿÜÿÜÿÜÿÜÿÜÿÜÿÜÿaÿÿ­ÿaÿuÿÜÿþøÿ/ÿÓÿÜÿÜ9ÿÜÿÜÿÜÿÜÿaÿ}ÿÿaÿÜÿÜÿÜÿ·ÿÜÿÜÿˆÿ­ÿ·ÿÜÿÜ9ÿÜÿÜÿÜÿÜÿÜÿÜÿaÿÿ­ÿaÿÜÿþøÿ/ÿÜÿÜÿÿÜÿÜÿÓÿÉÿDÿ?ÿ}ÿDÿÜÿÓÿÜÿÓÿÜÿÜÿÓÿÜÿÉÿ·ÿÓÿÓÿÓÿÜVþÉÿDÿ ÿÿaÿˆÿÜþ­þ¤þ¤ÿÁþ¤þÓþ­þÉþ­þÁÿDÿÿˆþ­þ¤þ¤þÉþ¤ÿÓþøÿÓÿ·Kr9KÿDÿˆÿ­ÿšÿ &ÿÉÿÜ&KþøÿÁÿ·ÿÁÿÁÿ·ÿÁÿ·ÿ·ÿˆÿÜÿ·ÿÿkÿÿ·ÿ·ÿ·þ}ÿ·ÿ·ÿkÿ·&ÿ·ÿÿ·ÿ·ÿ·/ÿÿþæþˆÿÿ·þˆÿÜÿ·ÿ·ÿ·ÿÿ<ÿ&ÿÿ·ÿ·ÿ·R$$%%&&''))**++-- .. // 22 33 445566778899::;;<<==HHIINNQQRRUUYYZZ[[ \\!mm"}}#‚‚$ƒ„%……&††%ˆˆ'‰‰(’’”˜ ›žŸŸ  )¡¡*ª­²²+³³´¸¿¿!ÁÁ!ÂÂ,ÄÄ,ÆÆ-ÈÈ(ÎÎ(ÐÐÒÒ.ÝÝààûû ÿÿ /  0  ""&&100::?? ò ò2 þ þ3 4 ¢$$%%&&''))** ++-- ./22 3344 5566 778899::;;<<==DDFFGGHHIIJKLLOOPPQQRRTTUUVV WW!XX"YY#ZZ$[[%\\&mm'}}(‚†ˆˆ)‰‰*”˜ ›žŸŸ ¡¢¢+££¤§+©©ªª,««¬­,²²-³³´´.µµ¶¸.»»/¼¼"½¾/¿¿&ÁÁ&ÂÂ0ÃÃ1ÄÄ0ÅÅ1ÆÆ0ÇÇ1ÈÈÉÉ2ÊÊ3ËË4ÌÌ3ÍÍ5ÎÎÏÏ2ÐÐÑÑ6ÓÓ7ÕÕ8××8ÙÙ8ÛÛ8ÝÝÞÞ3àà9ááââ3ää:ññ;õõ;ûûÿÿ  3<3<=<;    !! "" ## $$>%%5&&''!((?++@--@//@0011"33@55@66A77B88C99D::??ˆˆ4¬¬E­­F®®E¯¯FÚÚ ÜÜGÝÝ4ðð3ññHóó4ôôIõõJ } }A ~ ~K  L € €B A ‚ ‚B ï ïC ð ðD þ þM ÿ ÿN Oa$%&')*+-./23456789:;<=HINQRUYZ[\m}‚ƒ„…†ˆ‰’”•–—˜›œžŸ ¡ª«¬­²³´µ¶·¸¿ÁÂÄÆÈÎÐÒÝàûÿ  "&0:? ò þ `$XÿØÿ±ÿ£ÿœOgOSUY[_ ae J¸DFLTzarabŠarmnÄbraiÒcansÞcherêcyrlögeorgrek$hani4hebr@kanaRlao ^latnjmathònko þogamrunrtfng(thai4 KUR SND (URD (ÿÿ ÿÿ ÿÿ ÿÿÿÿÿÿMKD SRB ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿF CAT ZESP ZGAL ZISM bKSM bLSM bMOL vNSM bROM vSKS bSSM bÿÿ ÿÿÿÿ ÿÿ ÿÿ ÿÿÿÿÿÿÿÿ RQD°aalt¶aalt¼aaltÂcaseÈccmpÎccmpÔccmpÜccmpädligîdligôdligúfinafinahlig hliginitinitliga$liga,locl2locl8medi>mediDrligJrligTsalt\saltbsalth     (RZbjrŒ”œ¤¬´¼ÄÌÔÜäìôü $,4<DLT\dlt|„Œ”œR `Ô  ”ìDœôLŽÖfެ° ´ ø  ú  >    d F z     \ HXœ¬¼PTXv”ªÜàHPX`hp 9:;cW,,,Hõ   ï ï}Ö õ   ï ï}Ö&   B8%%88ŒŒŒ D9LMñ *_±²³´µ¶·¸¹º»¼½¾¿ÀÁÂÃÄÅîïðñòóôõ÷ûüý‡êì * È ‘ ’ “ ” ß àj$=EEGGIIKKLMNOWW‚˜š¡ÂÂÄÄÆÆÈÈÊÊÌÌÎÎÐÐÒÒÔÔÖÖØØÚÚÜÜÞÞààââääæêììîîððññòòôôööøøû      ""$$&&((**,,..0022446688:;==??AAHHRRTTVVyz‘“••¤¤¬¬®®ÚÚÜÜððôô  **__±ÅÇÊÍäêíîõöö÷÷øúûýþÿ‡‡êêìì * * È È ‘ ” ß à&!!!&   $$4F§«§§¨«""$$4F§«§##$$4F§«§$$$$4F§«§%%$$4F§«§ª««&&(0§§§OR'.6¨¨¨SSUW'.6©©©XY[\'.6ªªª]_aa'(0«««be' º¼/CèÅ: B}€ƒ†‰Œ’•˜›ž¡¤§ª­°³¶¹¼¿ÂÅÈËÎÑÔõîty{}…‡‹‘•™¡£¥§©­±µ¹½ÁÅÉÍÑÕÙÝáåçé'-ýõé36íùñ9<  ?äåæçè#héê`ëì!íîñô÷úý*  %?)1!-$b'*-05736;BECGIQeKjOgirŽ#’à%B~„‡Š“–™œŸ¢¥¨«®±´·º½ÀÃÆÉÌÏÒÕõªRƒ‰“—›Ÿ«¯³·»¿ÃÇËÏÓ×ÛßãOë)/ÿ÷ë58ïûó;> Aðóöùüÿ, 'A+ 3#/&d),/21958=DSgM SSUUW[`gioqrŽ’ ³Ø)ÝßOB‚…ˆ‹Ž‘”—𠣦©¬¯²µ¸»¾ÁÄÇÊÍÐÓÖõªR‚ˆŽ’–šžª®²¶º¾ÂÆÊÎÒÖÚÞâNê(.þöê47îúò:= @ïòõøûþ+  &@*2".%c(+.10847<CRfL SSUUW[`gioqrŽ’ ³Ø)ÝßO2  wyzy zxwuuxy~&8Jluyvy {|xy ||yy ywxvvtus |w{vstvwy| ò…ó…Ö×> $ðî{ìyñï{íyÖ×6 "(²IO±IL°O¯L®II²Rlž¨$*06<uzsyqxowmvlujthsR}P|O{ &,vztyrxpwnvisQ|S|Thprç2&B 8  ¹ó·ñ¶ëµü¸üëú´WV³WAˆ(:FPZfr +"  * )" Ò$; V ·0 ¸(/ ˜F žX R")567DFœœgfhdeji#9?FLTZgfhdeji#9?FLTZs_iF,-DO *"&s_iãF,-DO\ …8 ×  ±²³´·¸¹»¼½À óùm!GHùóùpqno LMñ *_‡êì * È ß à§§«¬§«±§«¶§«»§«ggggg§« àèP< Ý‚`Õ``h`UvZZZZZZZZrZZ8û<(ú:0 ‚†ŠŽ’–šž¢®ºÆÒÞêö&2>JVbfjnr~Š–¢®ºÆÒÞêö&2>JVbfjnr~Š–¢®ºÆPp°ÐN ™K= P šK> P ›K? P@ µÂ@ ø ¶ÂA ø ·ÂB ø ¸ÂC ø ¹ÂD ø ºÂE ø »ÂF ø ¼ÂG ø ½ÂH ø JKI P KKJ P LKK P MKL PÈÞô n‘M ³o‘N ³p‘O ³qÂP ørÂQ øsÂR øtÂS øuÂT øvÂU øwÂV øxÂW øyÂX øzÂY ø{ÂZ ø|Â[ ø}Â\ ø~Â] øÂ^ ø€­_ D­` E0F\r ÜP   ÜQ   íR ± .ÜV   0ÜW   ZÜS   \ÜT   ^íU ± ´( u ³((  ²( – ·( u ¶((  µ( – º( u ¹((  ¸( q ½( f ¼(( ~ »( q À( r Á(( ˜ ¿(( Š Á(( ˜ ¾( ƒ_(_( Ä( r Á(( ˜ Ã(( Š Á(( ˜ Â( ƒ ø( ø( £( o Å(( ‰ ¢( l ¹(  ¸( q ¼( ~ »( q º( u ¹(  ½( f ¼( ~ ( (B((B((q(Vq(Vq(Vq(V >>@@^` ø ø ™ › µ ½ J M ’ •n Bq    . 0 Z \ ^3™3™×f çnÿÒýÿ $`) PfEd@ ÿÿþšmã`ÿßÿ, Ìä, Ì ää~éîó÷OSXZbw~ŠŒ¡%V_‡ŠÃÇêô  :UWZpt¿ÈÌÎÐÕùçõú?‚„ˆŠ—Ÿ£¥§«¹½ÄÆÍÙÝÅü5JR½ê>Pj…–¯ÞáGvœ#.[jx{}…¿ÉûEMWY[]}´ÄÓÛïôþ d q Ž œ µ º ½ Ñ × Ü á! !I!K!N!…!‰###!#(#,#u#z#}#‡#”#®#Ï#ã#å#è$#$i&œ&¸&Ã&â'' '''K'M'R'V'^'”'¯'¾'Æ'à'ë(ÿ)) )A)„)Õ)ë)û***/*k* *º*ú++$+T,w,-%-e-o...%..Mÿ¤ÿ¦G¦M¦Q¦W¦n¦¦•§§§+§A§K§S§W§g§ƒ§Ž§‘§ª§ÿïðô&ôAöÅûûû6û<û>ûAûDûOû£û­ûÜûßûéûÿþþ#þtþüþÿÿýÿÿ  ìó÷QWZ\pz„ŒŽ£1Ya‰°ÆÐð  !@WZ`tyÆËÎÐÕðÀëø?„‡Š”™¡¥§ª­»ÀÆÈÐÜ Ð 7LTÀì@RtŠ ÞáFn€&0]w{}…›Ä HPY[]_€¶ÆÖÝòö j t   ¸ ½ Ð Ö Û á!! !K!N!P!‰!###$#+#s#z#}#‡#”#›#Î#ã#å#è$"$`%&ž&À&â''' ')'M'O'V'X'a'˜'±'Å'à'æ'ð)) )@)ƒ)Î)ë)ú** */*j*}*®*ù+++S,`,y--0-o..."..MÀ¤Ð¦D¦L¦P¦T¦b¦Š¦”§§§"§0§F§N§V§d§€§‰§§ §øïðôô(öÅûûûû8û>û@ûCûFûRûªûÓûÞûäûüþþ þpþvþÿÿùÿÿÿãÿÂÿÀÿ¼ÿ¹ÿ±ÿ°ÿ­ÿ¬ÿ«ÿžÿœÿ—ÿ–ÿ•ÿ”ÿ‰ÿ‡ÿ†ÿ…ÿ`ÿ^ÿVÿQÿ@ÿ?ÿ>ÿ6ÿ1ÿ.ÿ-ÿ(ÿ'ÿ%ÿ ÿÿÿÿÿÿÿ þñþ+þ(þ&÷â÷¡÷ ÷ž÷÷›÷•÷”÷“÷’÷‘÷÷Ž÷÷‹÷Š÷‰÷‡÷…õÃõ¹òµò´ò³ò²ò±ò°ò®ò­ò¥ò¤ò£òšò–òò_ò]ñùñÓñÊëgëfëdëcëbëVëTëSëLë7ë3êýêùê÷êõêóêñêðêïêîêíêëêêêéêçêæêäêãêâêÝêÛêÚê×êÕêÓêÁê½êºê¶ê˜ê—ê–ê”ê“êêŠê„ê‚ê€ê~ê8ê4ê2ê)êêéøéåéäéâé©émè×èÖèÏè±è“è’èèèŽèèŠè‰è‡è„èƒè}èdè_è[èUèSèçÞç•ç€çrçnçeçSççæûæ½æ¸æ´æ†å{åzäúäðäçä?ä9ä7ä/ÄžmÎlŠl†l„l‚lxl]lWkåkákßkÛk×kÕkÓkÇk¯kªk©k›kN$N#hlk订œ›š™˜–kjfTTDø÷õü  ~ ébìî¬óó¯÷÷°O±QSWXZZ\bpwz~„ŠŒŒ"Ž¡#£%71VºY_àa‡ç‰Š°ÃÆÇ$Ðê&ðôAF  H  JKLM!:N@UhWW~ZZ`p€tt‘y¿’ÆÈÙËÌÜÎÎÞÐÐßÕÕàðùáÀçëëõøú??!‚"„„$‡ˆ%ŠŠ'(”—)™Ÿ-¡£4¥¥7§§8ª«9­¹;»½HÀÄKÆÆPÈÍQÐÙWÜÝa ÅcÐü‰¶ ½5Ð7JéLRýT½Àênì™>µ@PäRjõt…Š–  ¯-ÞÞ=áá>FG?nvA€œJg#|&.Š0[“]j¿wxÍ{{Ï}}Ð……Ñ›¿ÒÄÉ÷ûý ù  E HM ;PW AYY I[[ J]] K_} L€´ k¶Ä  ÆÓ ¯ÖÛ ½Ýï Ãòô Ööþ Ù d â j q G t Ž O œ j   µ w ¸ º ½ ½ Ð Ñ ‘ Ö × “ Û Ü • á á —!! ˜! !I ¢!K!K á!N!N â!P!… ã!‰!‰ !# ## œ##! ž#$#( ¤#+#, ©#s#u «#z#z ®#}#} ¯#‡#‡ °#”#” ±#›#® ²#Î#Ï Æ#ã#ã È#å#å É#è#è Ê$"$# Ë$`$i Í%&œ ×&ž&¸t&À&Ã&â&â“''”'' ˜' ''œ')'K¸'M'MÛ'O'RÜ'V'Và'X'^á'a'”è'˜'¯'±'¾4'Å'ÆB'à'àD'æ'ëE'ð(ÿK))[) ) ])@)A_)ƒ)„a)Î)Õc)ë)ëk)ú)ûl**n* *q*/*/‚*j*kƒ*}* …*®*º©*ù*ú¶++¸++$Ó+S+TÙ,`,wÛ,y,ó--%ú-0-e -o-oV..W..X.".%Y....]MÀMÿ^¤Ð¤ÿž¦D¦GΦL¦MÒ¦P¦QÔ¦T¦WÖ¦b¦nÚ¦Š¦禔¦•ë§§í§§ü§"§+§0§A §F§K§N§S#§V§W)§d§g+§€§ƒ/§‰§Ž3§§‘9§ §ª;§ø§ÿFïïNððhôô&lô(ôA“öÅöÅ­ûû®ûûµûû6ºû8û<Ôû>û>Ùû@ûAÚûCûDÜûFûOÞûRû£èûªû­:ûÓûÜ>ûÞûßHûäûéJûüûÿPþþTþ þ#dþpþthþvþümþÿþÿôÿùÿýõú #ÓÓVÕ8Õ9tÕ;Õ>vÕ@ÕDzÕFÕFÕJÕP€ÕRÕk‡Õ ÕÓ¡ר×ëÕîîéîîíî!î"î$î$ î'î' î)î2 î4î7î9î9î;î;îaîbîdîdîgîjîlîr#îtîw*îyî|.î~î~2ð0ð“3ð ð®—ð±ð¾¦ðÁðÏ´ðÑðßÃô-ô.Òô1ô1Ôô5ô5Õöö#Öö%ö+úö-ö@   !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`a†‡‰‹“˜ž£¢¤¦¥§©«ª¬­¯®°±³µ´¶¸·¼»½¾ rdei x¡pk ¹vj ꈚ ¨s î ïgw Œ › ™T µl|=¨ºcn ¤T Ò m} b‚…— õ ö þ ÿ ú û¹¡Á: & ƒ  ¯° y ü „ŒƒŠ‘Ž•–”œ›óˆžqš›œzŸ‰5¸ËËÁªœ¦¸fqË ²…u¸Ãˉ-˦ðÓª‡ËªJ3ËÙôT´œ99N´R¸çÍ7sÍ`s3¢V¦V9Åɸßsºé3¼Dßͪåªˤ{¸o{RÇÍššoËÍžÓðºƒÕ˜HžÕÁËöƒT3fÓǤ͚sÕ þ+¤´œbœ-ÕÕÕð{T¤¸#Ӹ˦Ãì“ Ó\qÛ…#¨H99`Õš#fy```{œw`ªé`b{Å{´RÍf¼fwÍ;…‰{ÍJ/œœ}oo5jo{®²-–{öƒT7öœáföÍD)fîs–·, °%Id°@QX ÈY!-,°%Id°@QX ÈY!-,  °P° y ¸ÿÿPXY°°%°%#á °P° y ¸ÿÿPXY°°%á-,KPX °ýEDY!-,°%E`D-,KSX°%°%EDY!!-,ED-,°%°%I°%°%I`° ch ŠŠ#:Še:-ÿÿfþ–f¤@ ûû/ÄÔì1ÔìÔì0!%!!füsüåþ–øòr)5Õ 5@ƒ üK° TX¹ÿÀ8Y<ì2991/äüÌ0¶ P ]%3#3#5ËËË¢þþÕýqþ›eŪéÕB@„üK°TK°T[X¹ÿÀ8YüÜì1ô<ì20@0 @ P ` p   ¿ ]#!#oª$ªÕýÕ+ýÕ+ž¾`@1 ‡  ‡   üÌ91/<Ô<<ü<<Ô<<Ä2ì220@   ]!! !3!!!!#!#!5!!5!þÝT%Dh$i g8þ¡R>þ›h gþÛg¡hþÅ`Tþ¾if…þ²‡þaŸþašþ²™þbžþbž™NšŸªþÓm!(/½@U" '&( /)/))/B" ) *!††#Љ*Љ- ) " & 0üK° TX¹ÿÀ8YK° TK°T[K°T[X¹@8Y<ìô<ü<ôäì1/äìÄÔäì2Äîî99990KSXíí9í9íY"#.'5.546753.'>54&´diÒjfÑoÝÉÚÌd]®SS¯\ãÖãÖdtzqá{þÓ---´@AÈ$¬–£¼ëè¯*.þU#´œ©Ãš jXV`ÕþOnZXhqÿã)ð #'3‰@6$%&%&'$'B’ ’.’$’ &Œ($‘4'!%   ! + 1 4üK° TK° T[K° T[K°T[K°T[K° T[X¹1ÿÀ8YÄìôìîöî991ä2ô<äìîöîî0KSXííY""32654&'2#"&546"32654&%3#2#"&546ÑWccWUccUžº» º»ü—VcbWWcd1 üZ ž¼»ŸŸ¹º‘”„‚••‚ƒ•Ü»»ÛÛ»¼Ûa•‚„””„–ùó Û»½ÚÛ¼ºÜÿãþð 0Í@–  † †  † †††  !         B  (('•+•'”$‘Œ .  .'.'!!1üìÄÔÔìÆî99999991/ÆäöæîîÆ9990KSXíí9í9í9í9í9íí9í9ííí9Y"²2]@² " ) **&:4D ^YZ UZZY0g{›š™—• “••"™-  ' (   2'') #**(/2; 49?2J LKFO2VZ Y UY\_2j i`2uy z““—•œœŸš › š 2 2°29]]3267 >73#'#"5467.54632.#"ò[UÔ _¦Iþ{ü;Bº h]ühäƒñþΆ†02Þ¸S¥UWžDiƒ;#Q¡X’Â?@ýøYËr„þþ~þã“YW×€ác?}<¢Å$$¶/1oX3gŪoÕ7@ „üK°TK°T[X¹ÿÀ8Yì1ôì0@ @P`p ]#oªÕýÕ+°þò{ 7@˜—  ÜK°TX¹ ÿÀ8YK°TX¹ @8Yä2ì991üì0#&547{†‚ƒ… –•”—æþ>ççþ;åëÆàßÄì¤þòo @˜— Ü<ôì991üì03#654¤ –••– …ƒƒìþ<ßàþ:ëåÅççÂ=JÃðN@,  ™ ™ ‘    Ô<ä2Ü<ä2991ôÔ<ì2Äì2990 %#'-73%Ãþ™g:þ°rþ°:gþ™:PrPßÂÃbËþ‡yËbÃÂcËyþ‡ËÙÛ #@ œ  Üü<ü<ì1/Ô<ü<Ä0!!#!5!®-ýÓ¨ýÓ-ýÓªýÓ-ª-žÿÃþ@ žƒüìÔÌ1üì073#ðÓ¤Rþ¬þÀ@d߃¶œÜÌ1Ôì0!!dý僤ۮþ·ƒüì1/ì073#ÛÓÓþþÿB²Õ-@BŸ/Ä991ôì0KSXííY"3#ªýøªÕùm‡ÿãð #@   ‘Œ üìôì1äôìî0"32'2#"‹œœû þ÷ûûþ÷ PþÍþÌþÍþÍ3343 þsþ†þ‡þsyzáZÕ @@B     ÔK°TX¹@8YìÄüì1/ì2ôìÔì0KSXY"´]7!5%3!!þJþ™eÊJü¤ªsH¸HúÕª–Jðž@'B¡”  ‘   üK°TK°T[K°T[X¹ÿÀ8YÄÔìÀÀ91/ì2ôìôì0KSXíí°9Y"@2UVVzzv‡tvust‚†‚‚‚¨¨]]%!!567>54&#"5>32‰ÁüLs3aM§†_ÓxzÔXèE[þôªªªw‘:m—Iw–BCÌ12èÂ\¥pþëœÿãsð(p@. † †     “  “#‘Œ£)&  )üK°TK°T[X¹ ÿÀ8YÄÄÔìôì991ìäôäìæîîîî90@ daa d!]!"&'532654&+532654&#"5>32?‘£þÐþè^ÇjTÈm¾Ç¹¥®¶•ž£˜S¾rsÉYæ Ž%ÄÝò%%Ã12–„•¦wps{$&´ Ѳ|«d¤Õ @   B     ÜK° TK° T[X¹ ÿÀ8YÔ<Äì291/äÔ<ì290KSXÉÉY"@* *HYiwŠ+&+6NO O Vfuz… ]] !33##!5þþ5þÕÕÉý^%üãÍü3¨þ `ÞÿãdÕ^@#†  ‰   Œ¤  üK°TK°T[X¹ÿÀ8YK°TX¹@8YÄÔìÄî1ääôìæîþÄî90!!>32!"&'532654&#"Ýý ,X,ú$þÔþï^ÃhZÀk­ÊÊ­Q¡TÕªþ’þîêñþõ Ë10¶œœ¶$&ÿã–ð $X@$ †   ¥  ‰"‘Œ% " !%üììôìä1äôäüäîîî90@ËËÍÍÍËˤ²]]"32654&.#">32# !2¤ˆŸŸˆˆŸŸ L›LÈÓ;²káþðâþýþîPL›;º¢¡»»¡¢ºy¸$&þòþïW]þïëæþêyb¥¨hÕc@B üÌÄ991/ôì0KSXííY"K°TX½@ÿÀ878Y@X9Hg°°]]!#!¨ÀýâÓþý3ÕVú+‹ÿã‹ð #/C@%  ' - ‘Œ'£0 $*$ !0üÄìôÄìîî991ìäôìîî990"32654&%.54$32#"$54632654&#"‹¥¥¦¥þ¥‚‘ÿÞßþ‘’£þ÷÷÷þ÷¤H‘ƒ‚““‚ƒ‘Åš‡‡š›†‡šV ²€³Ðг€² "ÆÙèèÙÆat‚‚tt‚‚ÿã‡ð$X@#†  ¥ ‰ ‘Œ%!"" %üìäôìì1äôìæþõîî90@ÄÂÀÀÀÂμé]]7532#"543 !"&2654&#"áLœKÈÓ:²làþûâþ±þåLœ>ˆŸŸˆˆŸŸ¸$& V\ëæþsþ†þŸþ[—º¢¡»»¡¢ºðÃ#@ƒ¦ƒü<ì21/ìôì073#3#ðÓÓÓÓþþ#þžÿÃ# %@ƒžƒ¦  ü<ì2ÔÌ1äüìî03#3#ðÓÓÓ¤R#þýÙ¬þÀ@Ù^Û¦M@*œœœœB¨§$#üì291ôì90KSXííííY" 5Ûûøúþðþ‘þ“¶ѦÑÙ`Û¢@ œœ#ü<Ä21ÔìÔì0!!!!Ùúþúþ¢¨ðªÙ^Û¦O@+œœœœB¨§$#ü<ì91ôì90KSXííííY"55Ùúþð¶þ/¦þ/¶m“°ð$e@+$  †ˆ•‘ƒ   &%ÜK° TX¹ÿÀ8YÄüìÔìî99991/îöþôîÍ9990¶y z z ]%3##546?>54&#"5>32‡ËËÅ¿8ZZ93ƒlO³a^Ág¸ßHZX/'þþ‘še‚VY5^1YnFC¼98ŸL‰VV/5<4‡þœq¢ L•@2  ©©L43¬0©7¬$©7CM34( (+(I+*(I,=MÜìüìþýþ<Æî991ÔÄüìþíÔÆÅî2Äî990K° TK° T[K°T[K°T[K°T[X½MÿÀMM@878Y@ NN/N?N]32654&#"#"&5463253>54&'&$#"3267#"$'&5476$32úŽ|{zy!<›g¬×Ø«gœ;’¥?@hþÕ°{â`±smiùhZ}þÙ˜¹þ¸€€†ˆ~R½Ôk{KOþÂþè£¤ŽŒ¥¤þHMIùÈÈúKLƒý ß±k¼Pƒ‹A@fþµÁŸþêjhmWQoagƒ}}I½¶J}‡® bæ{þùþÐhÕ Â@A       B•    ÔÄ91/<äÔì90KSXííííííííY"² ]@BXvpŒ  VXP ghxv|rwx‡ˆ€ ˜™–]] !3#!#¼þî%þ{å9Òˆý_ˆÕý®ú+þÉìÕ C@#• •• ­ . !üì2üìÔì9991/ììôìî90²"]!2654&#!2654&#%!2#!“D££þ¼+”‘‘”þ çú€|•¥þðûýèÉý݇‹Œ…fþ>orqp¦À±‰¢ ˘ÈÚsÿã'ð6@ ¡® •¡®•‘Œ 0üì2ì1äôìôìîöî0´].# !267# !2'fç‚ÿþð‚çfjí„þ­þz†S†íbÕ_^þÇþØþÙþÇ^_ÓHHŸghŸGɰÕ.@• •  2 üìôì99991/ìôì0²`]3 !%! )“ô5þáþËþBŸ²–þhþPþa/ûw.,¦þ—þ€þ~þ–É‹Õ .@•••­   üì2ÔÄÄ1/ììôìî0² ]!!!!!!ɰýÇý9øü>ÕªþFªýãªÉ#Õ )@••­ üì2ÔÄ1/ìôìî0² ]!!!!#ÉZýpPý°ÊÕªþHªý7sÿã‹ð9@ ••¡®•‘Œ43 üìüäüÄ1äôìôìþÔî990%!5!# !2.# !26Ãþ¶uþæ þ¢þu‹^’opü‹þîþík¨Õ‘¦ýSU™mn™HF×_`þÎþÑþÒþÎ%É;Õ ,@•­ 8  üì2üì21/<ä2üì0²P ]3!3#!#ÉÊÞÊÊý"ÊÕýœdú+Çý9É“Õ.·¯üK°TX¹@8Yì1/ì0@ 0@P`Ÿ]3#ÉÊÊÕú+ÿ–þf“Õ B@ •° 9 üK°TX¹@8Yìä991äüì990@ 0 @ P ` Ÿ ]3+53265ÉÊÍãM?†nÕú“þòôª–ÂÉjÕ ï@(B¯  üì2ÔÄ91/<ì290KSXííííY"²]@’ ((764GFCUgvwƒˆ”›ç    (+*66650 A@E@@@ b`hgwp ‹‹Ž š¶µÅÅ×Öèéèê÷øù,]q]q3! !#ÉÊžýþöý3ÊÕý‰wýHüãÏý1ÉjÕ%@ •:üìì1/äì0@ 0P€€]3!!ÉÊ×ü_ÕúÕªÉÕ ¿@4  B ¯   >  üìüì91/<Äì290KSXííííY"²p]@V   && & 45 i|{y €‚‚  #,'( 4<VY ej vy •›]]! !###É-}-ÅþËþÄÕüøú+üúáÉ3Õ y@B¯6 üìüì991/<ì2990KSXííY"² ]@068HGif€ FIWXeiy…Š•šŸ ]]!3!#É–ÄþðýjÄÕûáú+áûsÿãÙð #@•• ‘Œ 3üìüì1äôìî0"32' ! 'ÜþýÜÜþÿÜ:xþˆþÆþÅþ‡yLþ¸þåþæþ¸HH¤þ[þžþŸþ[¤bb¥ÉÕ:@••   ? üì2üì91/ôìÔì0@ ?_¯]32654&#%!2+#“þššþ8ÈûþÿûþÊ/ýÏ’‡†’¦ãÛÝâý¨sþøÙð R@*  B ••‘Œ    3üìüì9991Ääôìî990KSXíí9Y""32#'# ! 'ÜþýÜÜþÿ? ôÝ!#þÅþ‡y;:xÑLþ¸þåþæþ¸HHúÏþÝï¥ab¥þ[þžþüþŽÉTÕ±@5  B• •   ?  üì2üÄì99991/<ôìÔì9990KSXíí9Y"²@]@Bz%%%&'&&& 66FFhuuwˆˆ˜˜]]#.+#! 32654&#A{>ÍÙ¿J‹xÜÊÈüƒý‰þ’••’¼~þh–bý‰ÕÖØºOýƒ…‡ÿã¢ð'~@<    B ¡”••”%‘Œ( "-"(ÜÄìüìä99991äôäìîöîÆ90KSXí9í9Y"²)]¶)/)O)].#"!"&'532654&/.54$32HsÌ_¥³w¦zâ×þÝþçjï€{ìr­¼‡š{âÊõiÚ¤Å76€vce+Ù¶Ùà0/ÐEFˆ~n|-À«Æä&ÿúéÕJ@•@@Ôäüä1/ôì20K° TX½@ÿÀ878Y@  @ p Ÿ ]!!#!ïýîËýîÕªúÕ+²ÿã)Õ@@ •Œ  8AüK°TX¹ÿÀ8Yìüì1ä2ôì99990¶Ÿ]332653! ²Ë®Ã®ËþßþæþåþßÕüuðÓÓð‹ü\þÜþÖ*$hÕ·@'B¯ÔÄ91/ì290KSXííííY"²P]@b*GGZ}ƒ *&&))% 833<<7HEEIIGYVfiizvvyyu€˜—)]]!3 3JýÆÓÙÚÒýÇÕûéú+D¦Õ {@I      B ¯    ÔÌ91/<ì2290KSXííííííííY"²]@ò  ($ >>4 0 LMB @ Yjkg ` {|€ –•     !   # $ %  <:5306 9 ? 0FFJ@E@BBB@@ D M @@XVY Pfgab```d d d wv{xwtyywpx  †‡ˆ‰… Š —Ÿ¯[]]3 3 3# #DÌ:9ã:9Íþ‰þþÅþÂþÕûîûîú+úð=;Õ f@  ÔÄÜÄÄ1´€ ]@¯ /<ì20K°BPX@   ìììì@    Y3 3 # #ÙsuÙþ Ùþ\þYÚÕýÕ+ý3üø{ý…ÿüçÕ”@(B¯@@ Ôäüä91/ì290KSXííííY"² ]@<5000F@@@QQQe„“ &)78@ ghxp Ÿ ]]3 3#Ùž›ÙýðËÕýšfüòý9Ç\Õ @B••B ÜK° TK° T[X¹ÿÀ8YÄÔä991/ìôì0KSXííY"@@ )&8HGH    / 59? GJO UYfio wx Ÿ ]]!!!5!s•üPÇû=°ügÕšûoªš‘°þòX;@©²©±CÜK° TX¹@8YK°TK°T[X¹ÿÀ8YüÌ21üìôì0!#3!°¨ððþXùüÿB²Õ-@BŸ/Ä991ôì0KSXííY"#ªªýøÕùm“Çþòo0@©²©±CüK°TK°T[X¹@8Y<Üì1üìôì0!53#5oþXïïøÞÙ¨ÛÕ@ ÜÌ91ôÌ290 # #¼ÉþHþHÉÕýÓ‹þu-ÿìþþ¬µ©ÄÄ1Ôì0!5ûØþ¬ªð‰f1@ ´³DÜì1ôì0K° TK°T[X½ÿÀ@878Y #o™þºfþŠv{ÿã-{ %¼@'  ©¹ †º¹#¸Œ   E&üìÌÔì22991/ÄäôüôìÆîî9990@n0000 0!0"?'@@@@ @!@"PPPP P!P"P'p'…‡‡‡ ‡!…"' 'ð'000 0!@@@ @!PPP P!``` `!ppp p!€€€ €!]]"326=7#5#"&5463!54&#"5>32¾ß¬o™¹¸¸?¼ˆ¬Ëýû§—`¶Te¾Zóð3f{bsÙ´)LýªfaÁ¢½À‹..ª''üºÿ㤠8@¹  ¹Œ¸—G Füì22ôì1/ìäôÄìÆî0¶`€ ]4&#"326>32#"&'#3å§’’§§’’§ýŽ:±{ÌÿÿÌ{±:¹¹/ËççËËççRdaþ¼þøþøþ¼ad¨qÿãç{?@†ˆ† ˆ ¹¹¸Œ HEüä2ì1äôìþôîõî0@ € ].#"3267#"!2çNP³ÆÆ³PNM¥]ýþÖ-U¢5¬++ãÍÍã++ª$$>:#qÿãZ8@¹¹Œ¸—G Eüìôì221/ìäôÄìÄî0¶`€ ]3#5#"3232654&#"¢¸¸:±|ËÿÿË|±ýǧ’’¨¨’’§¶^ùì¨daDDaþËççËËççqÿã{p@$ †ˆ©¹ »¹¸ ŒKEüìôìÄ91äôìäîîôî90@)?p Ðð?????,// , ooooo ]q]!3267# 32.#"ü² Í·jÇbcÐkþôþÇ)ü⸥ˆš¹^Z¾Ç44®*,8 CþÝÄ—´®ž/øY@ ©‡—¼    LüK° TX¹ @8YK°TX¹ ÿÀ8Y<Äü<ÄÄ991/ä2üìî2990¶@P ]#"!!##535463ø°cM/þѹ°°®½™Phcü/ÑN»«qþVZ{ (J@#  †¹¹&#¸'¼ ¹½& G E)üÄìôì221/ÄäìäôÄìþÕî990¶`*€* *]4&#"326!"&'5326=#"3253¢¥•”¥¥”•¥¸þþúa¬QQžRµ´9²|ÎüüÎ|²9¸=ÈÜÜÈÇÜÜëþâþé³,*½¿[cb::bcªºd4@ ‡¸ — N  Füì2ôì1/<ìôÄì90²`]#4&#"#3>32d¸||•¬¹¹B³uÁƤý\žŸž¾¤ý‡ýžedïÁy+@¾±¼Fü<ì21/äüì0@  @ P ` p ]3#3#Á¸¸¸¸`û éÿÛþVy D@ ¾ ‡½¼ ±O  Fü<ì2ä991ìäôìî990@ @P`p]3+532653#Á¸£µF1iL¸¸`ûŒÖÀœa™(麜 ¼@)B¼— F üì2ÔÄ91/<ìä90KSXííííY"² ]@_ ')+Vfgsw‚‰Ž“–—£    ('(++@ h` ‰…‰š—ª§¶ÅÖ÷ð÷ð]q]33 ##º¹%ëý®kðýǹüiãýôý¬#ýÝÁy"·—Füì1/ì0@ @P`pð]3#Á¸¸ùìº{"Z@&  ‡ ¸¼PPF#üì2üüüì91/<<äô<Äì290@0$P$p$$ $ $¿$ß$ÿ$ ]>32#4&#"#4&#"#3>32)EÀ‚¯¾¹ru¦¹rw¦¹¹?°yz«‰|võâý\ž¡œ¾¤ý‡ž¢›¿£ý‡`®gb|ºd{6@ ‡¸ ¼ N  Füì2ôì1/<äôÄì90´`Ï]#4&#"#3>32d¸||•¬¹¹B³uÁƤý\žŸž¾¤ý‡`®edïqÿãu{ J@¹¹ ¸Œ QEüìôì1äôìî0@#?{{   {  { ð]"32654&'2#"s”¬«•“¬¬“ðþîðñþïßçÉÉçèÈÇéœþÈþìþíþÇ98ºþV¤{>@¹¹¸Œ½¼ GFüì22ôì1äääôÄìÄî0@ `€ à]%#3>32#"&4&#"326s¹¹:±{ÌÿÿÌ{±8§’’§§’’§¨ý® ªdaþ¼þøþøþ¼aëËççËËççqþVZ{ >@¹  ¹¸Œ½¼ GEüìôì221äääôÄìÆî0@ `€ à]32654&#"#"3253#/§’’¨¨’’§s:±|ËÿÿË|±:¸¸/ËççËËççý®daDDadªùöºJ{0@  ‡¸ ¼ FüÄì21/äôìÄÔÌ90´PŸ].#"#3>32JI,œ§¹¹:º….´˾ý²`®fcoÿãÇ{'ç@<  S  SB †‰†‰¹¹%¸Œ( R"E(üÄìÔìä99991äôìþõîõî90KSXí9í9Y"²']@m   . , , , ; ; ; ; $( ( *//*(() )!$'† † † †      '/)?)_))€)) )ð)]]q.#"#"&'532654&/.54632‹N¨Z‰‰b”?Ä¥÷ØZÃlfÆa‚Œe«@«˜àÎf´?®((TT@I!*™‰œ¶##¾55YQKP%$•‚ž¬7òž8@©¼‡  Fü<Äü<Ä2991/ìô<Äì2990²¯]!!;#"&5#53w{þ…Ks½½Õ¢‡‡žþÂý ‰NšŸÒ`>®ÿãX{;@ ‡Œ ¼¸  NFüìô9ì21/ää2ôÄì90´oÀ]332653#5#"&®¸||•­¸¸C±uÁÈϺ¦ýaŸŸ¾¤{û ¬fcð¨=`û@'B¿ÔK° TX¹@8YK°TK°T[X¹ÿÀ8YÄ91/ì290KSXííííY"@ŽHj{†€‘¤  &&)) 55::0FFIIFH@VVYYPffiigh`ut{{uz……‰‰‰†––—š˜˜—¨§°Àßÿ>]]3 3#=Ã^^Ãþ\ú`üT¬û V5` ë@IU U U U   B ¿    ÔK° TK°T[K°T[K°T[K° T[X¹@8YK° TK° T[K°T[X¹ÿÀ8YÌ91/<ì2290KSXííííííííY"@ÿ" 5 IIF @ [[U P nnf yy‡™˜” ¼¼ÎÇÏ         %%#'!%""%' $ ! # 9669 0FHF@B@@@D D D @@VVVPQRRPS T U cdejejjjn a g ouuy}x}zzxy  { v } ‡ˆ——”“œ›˜˜™@/– Ÿ¦¦¤¤««©©«¤ ¯µ±½»¸ ¿ÄÃÌÊy]]333# #V¸æåÙæå¸þÛÙñòÙ`ü–jü–jû –üj;y` C@F      B ¿  ÔK° TK°T[K°T[K°T[X¹@8YK°TX¹ÿÀ8YÄÔÄ91/<ì290KSXííííííííY"@˜   & =1 UWX f vzvt ‚ ™Ÿ—’ ¦©¯¥£       )&% * :9746 9 0 IFE J @ YVYYWVYVV Y P o x ›”«¤° Ï ß ÿ /]] # # 3 dþkªÙþºþºÙ³þrÙ))`ýßýÁ¸þHJþq=þV`‹@C        B  ‡½ ¼  ÔK° TK°T[X¹ @8YK°TX¹ ÿÀ8YÄÄ91ä2ôì9990KSXíííííí2Y"@ð     # 5 I O N Z Z j ‡ € “        '$$  )( % $ $ ' ** 755008 6 6 8 990A@@@@@@@@B E G II@TQQUPPVUVW W U U YYPffh ii`{xx‰Š … … ‰ ‰‰™ • • šš¤ ¤ ««°Ïßÿe]]+5326?3 3“N”|“lLT3!þ;Ã^^ÃhÈzšH†TNü”lXÛ` @B©¼© ÜK° TK° T[X¹ÿÀ8YK°TX¹@8YÄ2Ä991/ìôì0KSXííY"@B&GI  + 690 @@E@@CWY_ ``f``b € ¯ ]]!!!5!qjýL´ü}´ýe`¨üÛ“¨%þ²$w@4 %   ! © ©À ©±% $  C %ÔK° TX¹@8Y<Äü<Ä299999991üìÄôìî99999990²&]#"&=4&+5326=46;#"3>ù©lŽ==k©ù>DV[noZV¾”Ýï—ts•ðÝ“XøŽŽœøXþ®·±Ôì1üÌ0#®ªøþ²$‡@6%   ©©#À©±%#C %ÔK° TX¹ÿÀ8YK°TX¹@8Y<Ä2ü<Ä99999991üìÄôìî99999990²&]326=467.=4&+532;#"+FŒUZooZUŒF?ù§lŽ>>Žl§ù?¾VøœŽŽøŽW“Ýð•st—ïÝ”ÙÓÛ1#@ œœ ÔÄ1ÔüÔìÀ990#"'&'&'&#"5>32326Ûi³an’ ›^X¬bi³an“ ›^V©1²OD;>MS²OE<>L5þ‹` e@ƒ¼  ü<ì2991ôäüÌ0K° TX½ @ ÿÀ878YK°TK°T[K°T[X½ ÿÀ @878Y¶ P ]#53#3ËËË¢bþú+eþ›¬þÇ#˜!Q@+  †ˆ †ˆ ¹ ¹¸Œ"  "ÜìÔ<Ô<<ì221äô<ÄìÄþôîõî9990%.'>7#&73¦“¤¤JˆDF‰HA‰Mfñþ÷ ñfI‰ƒX⸹⡬)*ü *'ª#þä 32þá!bð`@!† ©  ”‘   Ü<ÌÌü<ÄÔÄ1/ì2ôäìÔ<î2î990K° TX½ÿÀ@878Y´66].#"!!!!53#535632NLˆ=”t‡þy-üìÇÇÖè=—´¶))›Ô×þ/ªªÑîó^R¼²#/ƒ@I -'! - -¹ëì'¹ë!0 *$0* $ $(st*(s0Üäìôäì9999999991ÔäìôäìÀ9999999907'#"&''7.5467'7>324&#"326{ÏrÎ%$&(ÑrÏ;t=:x=ÏqÏ%%&&ÏsÏ7t@?s9ÏqÏ(&%%ÏsÎ>v:@t8ÎsÏ'%$þ|pššprœRÃÕÆ@F  B Ó Ó   fe f eÔ<ì2ìüì2ì99991/ä2Ô<ì2Ô<ì290KSXííííY"K° TX½ÿÀ@878Y@(†¦ µ' ' ')((79‡ ˆ¦ ¥ª©]]!#!5!5'!5!3 3!!!þcÉþ` Tþ´þþ{y¿þÂþµTŸÇþ9Ç{3›{JýD¼ý¶{›3þ¢®˜@ õõÜ<ì21ÔìÔì0##®ªªª˜ý öý ö\ÿ=¢ð >‘@54&.#"#"&'532654/.5467.54632{?>‹ú?>ÌS8alÎÓƒ\]>9Ì­IšXW”:fqÝÖ€][;;ȦI™¨.Z.L…‡-[.Kˆ“¤''PGZswšeZŒ54m@ލ¤''TLf{x™f[1,pE‚Ÿ×F)’@ÎÍddÜüÔì1ü<ì20K° TK° T[X½@ÿÀ878YK° TK° T[K°T[K°T[X½ÿÀ@878YK°TK°T[X½@ÿÀ878Y@````pppp]3#%3#^ËËþyËËÊÊÊåÍ/IC@&=Ë>:ÌAÊ$1Ë04ÌGÊÉÈ$É 7aD=0^* D^ JÜÌüìþí2î1/îöþýîÖîýîÖî02#"$'&5476$"3267>54&'..#"3267#"&54632˜mmllmmþù˜˜þùmmllmm˜ƒâ^^``^^⃄ã^]]^\^ã§B‚B•§«›@zBC‰FØûûØIˆÍnmmþúš˜þûmmnnmm˜šmmng^^^å‚ã^^__^]⃅ã]^^õ! ¯Ÿ®"ôÐÑòsÕ;ð)_@3(%ãÝá%Ý ßÞÝ à‘* "(kl"k *ÜìÌüì22ÀÀ9991ôäüôìÄîíÖîî99990!!#5#"&546;54&#"5>32"326=‹°ýP®•,]€˜¿¼¶uu>ˆDI‘E·³þì¡~bRh‚P{¸þ@p?D‡q‡Š[[""°ðCO@Mrž%# †@Ièèèè è è è  è B  ç¦ o o nüü<Ôì2991ô<ì2990KSXííííííííY" 5 5%þÓ-þ+#þÓ-þ+#¿þôþô¿¢R¢¿þôþô¿¢RÙÛ^@ œÜÔì1ÔÄì0!#!Ù¨û¦^ýÁ•d߃¶œÜÌ1Ôì0!!dý僤åÍ/8L`@6EBC?2ÉH0É9JCÊ 9ÊÉÈ É$HE301B54&'.'2#"$'&5476$#32654&'2#'.+#ƒâ^^``^^⃄ã^]]^\^ㄘmmllmmþù˜˜þùmmllmm}{{nWXf°®i`C.‰¬;I6B›f^^^å‚ã^^__^]⃅ã]^^gnmmþúš˜þûmmnnmm˜šmmnþbþì>KL?gwyVpMIßÑ`3þœDÕb+ö/·ïîÔÌ1üì0K° TK°T[X½ÿÀ@878Y!!ÕVýªö”Ãu=ð  @ÃÄà ‘ Z[ZÜìüì1ôìüì0"32654&'2#"&546PnnPPnoO@v+..¹†‡´¸ooPOmmOOp1.-rB„·´‡†ºÙÛ .@МР œ   Ô<ì2ü<ì21/ìÔ<ìü<ì0!!#!5!!!®-ýÓ¨ýÓ-ýÓúþþ}ªþ}ƒªƒû¦ª^œ´ðJ@$}}BÝÝ÷ Ý‘~ÜÄÔÄì91ôÄìüìî90KSXí2íY"!!56754&#"5>32 ¨ýª"?XhU4zHM…9‘®þµ8rn81^BQ##{„l‹þä0bÍð(H@' Ý Ý Ý Ý ø÷Ý ø#‘)~&~ )ÜÄÄÔìÔì9991ôäìüäìÔìîî90#"&'532654&+532654&#"5>32 \e¾±9}F4wCmxolV^^ad_(fQI€7©Z`mR|†yOFJLl?<:=svcE`sîRf1@ ´³DÔì1ôì0K° TK°T[X½ÿÀ@878Y3#‹Çþº™fþˆ®þVå` M@% ‡Œ ¼½!   NF!üì2ôìÄ91ää2ô<ìÜÄ990¶"`"Ï"]3326533267#"&'#"&'®¸Š‡”•¸#% )I#ER2‘bf*þV ýH‘”¨¨ü¢<9 ”NPOONNýמÿ;9Õ %@Á]] ÔÔüÜì91Ä2ôì90!###.54$yÀ¾Ž×ëÕùfùáNݸ¾èÛH®F·ƒÔì1Ôì03#ÛÓÓFþ#þuÁ@  ó' ÜÔìÔÌ1/ÔüÄ90!#"&'532654&'T76xv.W+"J/;<+->i0Y[ ƒ0.W=‰œÅß ,@Ý ÝÝ ÷‘ |]|| Üôäüä1ôììÔìî2035733!œÌßæ‰Íý× c)t'ý+n`Õdð.@ãáÝ àÝ‘ klk Üìüì991ôìôìüì0!!2#"&546"32654&‹°ýPX³Îγ³Ðгi~hi}|P{Ý¿¿Ûܾ¿Ýs¡ˆ…  …‰ ÁH# †@I è è è è èèèèB  ç¦ o opü<üÔ<ì991ô<ì2990KSXííííííííY"5 %5 ÁÕþ+-þÓ²Õþ+-þÓ#þ^Rþ^¿  ¿þ^Rþ^¿  ÿÿ‰ÿãð&{' O‹ýd &5ÿÿ‰ÿã?ð&{'t‹ýd &5ÿÿbÿãð&u' O‹ýd &5þn¬` $†@/ †ˆ !ƒ# •½#¼%" " "!& %ÜìÔüìÔì99991äôìþÍôî9990K°TK°T[K°T[X½%ÿÀ%%@878Y@ ttttv]33267#"&546?>7>5#53ô¾7ZZ:3ƒmN´`^Àg¸àIYX0&ÄÊÊÏœe‚WX5^1YnFC¼98ŸL‰VV/5<6þÿÿhk&$¼uÿÿhk&$¼uÿÿhm&$¼u´  +@ ]1ÿÿh^&$¼u´ #+@ @O# /#]1ÿÿhN&$¼u´  +@ 0?  ]1hm !Ë@T   !!  ! !!!B  Á • Ž  !  VV!"ÔÄÔì2Ôî299999991/<æÖîÔî9990KSXííííííííY"² #]@  s › P#f iu {yyv v!€# ]]4&#"326!.54632#!#TY?@WX??Y˜þð!þX=>Ÿsr¡?<Òˆý_ˆÕZ?YWA?XXþóýN)sIs ¡rFv)ú‹þHÕ‡@9  B• ••••­    ÔÔ<ì2ÔÄÄ91/<ììÄôììîî0KSXííííY"²€]@gww† …– ¿ ]!!!!!!#!5ýÇý9øü=ýð Íq‹þ¶ËÕªþFªýãªþÕžüðÿÿsþu'ð&&z-ÿÿÉ‹k&(žuÿÿÉ‹k&(žuÿÿÉ‹m&(žu@@ ]1ÿÿÉ‹N&(žu @@ @]1ÿÿ;ºk&,/uÿÿ¢k&,/uÿÿÿþ`m&,/u´ +1ÿÿXN&,/u´ +1 ºÕ g@  © ••  2  yô<ì2ÄôìÄ91/Æ2îöîî20@( °Ÿ Ÿ Ÿ Ÿ ŸŸŸŸ¿ ¿ ¿ ¿ ¿¿¿¿]]! )#53!!3 !Ó ±–þiþPþ`ÉÉËPþ°ó5þáþËÕþ—þ€þ~þ–¼ãþýê.,ÿÿÉ3^&1þu´"+@ 0?""]1ÿÿsÿãÙk&2'uÿÿsÿãÙk&2'uÿÿsÿãÙm&2'u´+@]1ÿÿsÿãÙ^&2'u´!0 +@ 0!?0 !/0!0]1ÿÿsÿãÙN&2'u´ +@ @O]1?œÅ …@M œ  œœœœœ œ œ B   Ô<Ì291Ô<Ì290KSXííííííííY"  ' 7 œþ7Éwþ5þ5vÈþ8vËËLþ5þ7yËþ5yÉËyþ5Ëfÿºå +ž@< +,  )&  *&•& •‘&Œ,+,* # )#3,üìüìÀ999999991äôìîÀÀ99999990@*WZWU!je!{vu! FYVjddj(|svz( ]] 324&'.#"&5!27!"&''¶ý3>¡_Ü'y=¡_Üþý''†NOy;‚ÝW¢fªNPþˆþÆ€Ý[¢gXü²@CHp¸¸@Cþ¸þåp¼Džf b¥MK¿YÆgþöžþŸþ[KK¿Xÿÿ²ÿã)k&8îuÿÿ²ÿã)k&8îuÿÿ²ÿã)m&8îu´ +@ / ]1ÿÿ²ÿã)N&8îu´ +@P_@O /]1ÿÿÿüçk&<suÉÕ =@• •ö  ? üì22üì91/ôüìÔì0@ ?_]332+#32654&#ÉÊþûþÿûþÊÊþš™ŽÕþøáÜÜâþ®'ýÑ’††‘ºÿã¬/š@0-'!  *†¹*¹—Œ.  !' $'$-F0üÄüÌÆîÔîî99991/äþîþÕî990@@'(Š Š     ! "&  : :!MM I!I"jj ¥¥¦ ]]4632#"&'532654&/.5467.#"#ºïÚÐÛ—¨:A9¦`áÓ@ˆIPŒAtx;e\`W§—ƒq‚ˆ»qÈÛèàs`/Q*%jŽd¬·¤_[?T>7;‡[¬gp‹ƒû“ÿÿ{ÿã-f&DCR @?&/&&]1ÿÿ{ÿã-f&DvR @?&/&&]1ÿÿ{ÿã-f&DˆR´ (,+1ÿÿ{ÿã-7&DžR´.< +@ ./<.<]1ÿÿ{ÿã-&DjR ´-( +@(o(P-_(@-O(0-?(-( ]1ÿÿ{ÿã-&DœR%@&,,& 2882 +Ä+Ä1@ ?5?/5/]0{ÿão{3>@C'-%= 4©%†ˆ©:¹.†-º*¹»1 ¸Œ%?47&%7& =&-7"E?üìÌÔü<ÔìÄ999991Ää2ô<Ääü<ôìÄî2îôîî9990@0+0,0-0.0/00@+@,@-@.@/@0P+P,P-P.P/P0…+…0€@@ @°@À@Ð@à@à@ð@??? ??0,0-0.0/@,@-@.@/P,P-P.P/ooo oo`,`-`.`/p,p-p.p/€,€-€.€/]q].#">32!3267#"&'#"&5463!54&#"5>32"326=¶¥‰™¹DJÔ„âü² Ì·hÈddÐj§øMIؽÒýû§—`¶Te¾ZŽÕï߬o™¹”—´®ž0Z^þÝúZ¿È55®*,ywxx»¨½À‹..ª''`þf{bsÙ´)ÿÿqþuç{&Fzÿÿqÿãf&HC‹ÿÿqÿãf&Hv‹ÿÿqÿãf&Hˆ‹´"+1ÿÿqÿã&Hj‹@@ ]1ÿÿÿǦf'Cÿóÿÿof'vÿóÿÿÿÞ\f&óˆÿ´ +1ÿÿÿôF&ójÿ´ +1qÿãu('@^%{&%#${##{#({'(#&'('%$%(('"#" ! B('&%"! ##¹ ¹Œ#±)&' ! (%#" QE)üìôì99999991ìÄôìî9990KSXÉÉÉÉííííY"²?*]@v%+("/#/$)%-&-'*(6%F%X X!` `!f"u u!u"%#%$&&&''(6$6%F$E%Z Z!b b!z{     {zzv v!x" *ð*']].#"32654&#"432''%'3%F2X)§¹®’‘®6 ~rþäæçþåÝ4*ŸþÁ!µäM!þÙ“ØÃ¼ÞÞ¼z¼&þà­ÿþÉ7ÿú7´kc\Ì‘oabÿÿºd7&Qž˜ÿÿqÿãuf&RCsÿÿqÿãuf&Rvsÿÿqÿãuf&Rˆs´+1ÿÿqÿãu7&Ržs´ .+@ /. .]1ÿÿqÿãu&Rjs´ +@ @O0?]1Ù–Ûo )@êêœ r ÜÔ<ü<Ä1ÔÄüÄîî03#3#!!ßööööýúúþoöþõAªHÿ¢œ¼ +ä@<+,&  )&  *&¹& ¹¸&Œ,+,* # #Q)E,üì2ôì2À9999991äôìîÀÀ99999990@p(?-YVUV jf!{    { z{ {!"#$%{&›•%¨ -ð-&YVUZ(ifej(ztvz(‰•š$¢­$]] 32654&'.#".5327#"&''‰þ)gA“¬\*g>—©}66ñ]ŸC‹_’56þîð`¡?‹`!ý°*(èÈOuš))ëÓHn.—MÅw834¨O³MÆxþíþÇ43¨Nÿÿ®ÿãXf&XC{ÿÿ®ÿãXf&Xv{ÿÿ®ÿãXf&Xˆ{´ +1ÿÿ®ÿãX&Xj{´ +@ @O0?]1ÿÿ=þVf&\v^ºþV¤>@¹¹Œ¸½— GFüì22ôì1ìääôÄìÆî0@ `€ à]%#3>32#"&4&#"326s¹¹:±{ÌÿÿÌ{±8§’’§§’’§¨ý®¾ý¢daþ¼þøþøþ¼aëËççËËççÿÿ=þV&\j^´+@ 0? /]1ÿÿh1'q¼;$´ +@@O]1ÿÿ{ÿã-ö&qJD´+@o]1ÿÿh’'šÎJ$´+1@oo]0ÿÿ{ÿã-&šO×D´"+1ÿÿþu¥Õ&$äÿÿ{þu€{&D¿ÿÿsÿã'k&&-uÿÿqÿãçf&Fv‰ÿÿsÿã'm'Lu& ²<=/1ÿÿqÿãçf&Fˆ¤ÿÿsÿã'P'Lu&ÿÿqÿãç'¸¤Fÿÿsÿã'm&&-u@]1ÿÿqÿãçf&F‰‰ÿÿɰm'ìu'ÿÿqÿãÛ&G @_?]1ÿÿ ºÕ’qÿãô$J@$Ó ù"¹¹ Œ¸—   GE%üìô<Äü<Ä1/ìäôÄìÄîý<î20¶`&€& &]!5!533##5#"3232654&#"¢þºF¸šš¸:±|ËÿÿË|±ýǧ’’¨¨’’§¶N}““}úü¨daDDaþËççËËççÿÿÉ‹3&(q¡=ÿÿqÿãö'q–H@p]1ÿÿÉ‹m'¡u(@@]1ÿÿqÿãH'š–H@p]1ÿÿÉ‹P'žu(ÿÿqÿã'¸–HÿÿÉþuÕ&(Ìÿÿqþu{&HxÿÿÉ‹g&(¦o@@ ]1ÿÿqÿãa&H‰”ÿû´!+@!]1ÿÿsÿã‹m'\u* ²<=/1ÿÿqþVZf&ˆhJ ² <=/1ÿÿsÿã‹m&*uÿÿqþVZH&Jš‹ÿÿsÿã‹P'\u*@?]0ÿÿqþVZ'¸jJÿÿsþ‹ð'×^ÿí*ÿÿqþVZ4'Ãà JÿÿÉ;m'u+´ +@ / ]1ÿÿÿådm'uK*´+1K°QX»ÿÀÿÀ88Y@ €€@@]É‹Õ:@•  •­  8 Üì22Ìüì22Ì1/<ä2üìÜ22ì2203!533##!##53!5qÊÞʨ¨Êý"ʨ¨ÊÞÕààà¤û¯Çý9Q¤¤ààxŸ>@! ‡ ‡¸— N  Ü2ì22ÌÌôì1/<ìôÄìÜ2ì290#4&#"##5353!!>32Ÿ¸||•¬¹}}¹`þ B³uÁƤý\žŸž¾¤ý‡ö¤zz¤þ¼edïÿÿÿäx^'.u,´ +1ÿÿÿÓg7'žÿó´+1ÿÿY1'qÿ.;,´+1ÿÿÿòHõ'qÿÿÿó´+1ÿÿÿõgm'.u,´+1ÿÿÿäVH'šÿó´+1ÿÿ°þu%Õ'ÿd,ÿÿ–þu 'ÿJLÿÿÉ•P&,/u³<<1´??]0Áy{,@ ¸¿Füì91/ìä0@4D@P`p]3#Á¸¸\`û {ÿÿÉþfïÕ'-\,@ì1ÿÿÁþV±'M8L@Fì1ÿÿÿ–þf_m'.u-´+1ÿÿÿÛþV\f'ˆÿù´+1ÿÿÉþjÕ'× .ÿÿºþœ'׬ Nºœ` »@(B¼ F üì2ÔÄ91/<ì290KSXííííY"² ]@_ ')+Vfgsw‚‰Ž“–—£    ('(++@ h` ‰…‰š—ª§¶ÅÖ÷ð÷ð]q]33 ##º¹%ëý®kðýǹ`þåýòý®!ýßÿÿÉjl'nv/ÿÿÁJl'ZvO±<1K°QX¹@8Y@ŸO]0ÿÿÉþjÕ'×› /ÿÿˆþ­'× O@@]1ÿÿÉjÕ'ŸÿÃ/ÿÿÁ'9O @]1ÿÿÉjÕ'y1w/ÿÿÁ„'yÖsOK° QK°SK°QZ[X¹@8Y1ÿòuÕ ?@ •  : yô<ìÄü<Ä991/äì90´0P]3%!!'7ÓË9Pþw×ü^”MáÕý˜Ûoþîýãª;jnžH ^@ — z z Ô<äü<ä991/ì90K°TX½ @ ÿÀ878Y@ @ P ` sz p à ð ]37#'7Ǹ}Lɸ{JÅý¦ZjüãšXjÿÿÉ3l'Åv1@O]1ÿÿºdm&vBQ @?O]1ÿÿÉþ3Õ'× 1ÿÿºþd{'× QÿÿÉ3_&1õg´ +@ /  ]1ÿÿºdf&Q‰´ +@]1ÿÿ͹Õ'QU~ÉþVð;@  AüK°TX¹ÿÀ8Yì2ÔüÌ1@ •°•‘/äôìôì0!"#367632+53265Pþͳ×ÊÊNij™ãéQRµW1fO¬ÿÞü²Õñ†CCþÁþÌüoÕa`œZ ºþVd{;@ ‡‡¸¼ NF üì2ôìÄ1/äôÄìÔì90´`!Ï!]+5327654&#"#367632dRQµþéi&&||•¬¹¹BYZuÁcc¤ýHÖ``œ01™²Ÿž¾¤ý‡`®e22wxÿÿsÿãÙ1'q';2´ +@]1ÿÿqÿãuõ&qsÿR´+1ÿÿsÿãÙm''u2´+@]1ÿÿqÿãuH&šsR´#+1ÿÿsÿãÙk''u2ÿÿqÿãuf'Ÿ Rs Õ;@•••­   üìÔÄÄÔì299991/ìì2ôì2î0!!!!! !# !3úýÇý9øû×þOþA¿±gþ¿þÀ@AÕªþFªýãª|pm|ªþáþàþßþßqÿãÃ{'3„@1†ˆ ©. ¹(¹»"%¸Œ4"1 K1 Q+E4üìôüôìÄ9991ä2ô<Ääì2Äî2îôî90@%?5_5p5Ÿ5Ï5Ð5ð5????? ooooo ]q].#"!3267#"&'#"32>32%"32654& ¤‰™¹Hü² Ì·jÈbdÐj òQGÑŒñþïñŒÓBNèâú°”¬«•“¬¬”˜³®ž5Z¾Ç44®*,nmnm98olkpþ݇çÉÉçèÈÇéÿÿÉTl'•v5ÿÿº”m&vBUÿÿÉþTÕ'× 5ÿÿ‚þJ{'× UÿÿÉT_&5}g@_]0ÿÿºZf&U‰´ +@]1ÿÿ‡ÿã¢l'•v6ÿÿoÿãÇm&vBVÿÿ‡ÿã¢m'“u6 ´ ))Ic:1ÿÿoÿãÇf&ˆ%V ´ ))Ic:1ÿÿ‡þu¢ð&6z‹ÿÿoþuÇ{&Vzÿÿ‡ÿã¢m&6‹u ´+ ""Ic:1ÿÿoÿãÇf&V½' ´+ ""Ic:1ÿÿÿúþuéÕ&zP7ÿÿ7þuòž&záWÿÿÿúé_&7sg´ +1@_]0ÿÿ7þ‚&W7p@]1ÿúéÕF@ • • @ @ Ô<äÌü<äÌ1/ôì2Ô<ì20@@pŸ ]!!!!#!5!!ïýî þ÷Ëþ÷ ýîÕªýÀªý¿Aª@7òžC@©©¼ ‡ Fü<<Ä2ü<<ÄÄ2991/ìô<Äü<Ü<ì20²¯]!!!!;#"'&=#535#53w{þ…{þ…%&s½½ÕQQ‡‡‡‡žþÂéŽé‰''šPOÒéŽé>ÿÿ²ÿã)^'îu8´ '+@ ]1ÿÿ®ÿãX7'žƒX´&+1ÿÿ²ÿã)1'qî;8´ +@ / ]1ÿÿ®ÿãXõ'qƒÿÿX´+1ÿÿ²ÿã)m'îu8´+@]1ÿÿ®ÿãXH'šƒX´+1ÿÿ²ÿã)o&8œðiÿÿ®ÿãXÊ&Xœ|Ä @@@!]1ÿÿ²ÿã)k'îu8ÿÿ®ÿã^f'Ÿ°Xÿÿ²þu)Õ&8úÿÿ®þuè{&X'ÿÿD¦t'õ|:´+1ÿÿV5m'ˆEZ´+1ÿÿÿüçt'r|<´ +1ÿÿ=þVm&ˆ^\´+1ÿÿÿüçN&<su´ +1ÿÿ\l'•v=ÿÿXÛm&vB]ÿÿ\P'¾u=ÿÿXÛ'¸]@ O _ ¯ ß ]1ÿÿ\m&=¾uÿÿXÛf&]‰´ +@ ]1/ø#@ ‡ —©¼ Lü<ÌüÌ1/ôìôì0!##53546;#"˜¹°°®½®°c'&ÑN»«™()g ÿã¤,D@%¹ ¹ Œ¸")%©,$'—".EG* ,(%#'F-ü<Ìì222Ìôìì1/ôÜ<ì2äôÄìÆî04'&#"327667632#"'&'##5353!!åST’’TSST’’TSýŽ:YX{Ì€€Ì{XY:¹šš¹Eþ»/ËtsstËËtsstRd01¢¢þøþø¢¢10d¨}““}ÿ—PÕ)C@#• •• ­ . *üì2üìÔì9991/ììôìî90²"]!2654&#!2654&#%!2#!"#546÷D££þ¼+”‘‘”þ çú€|•¥þðûýè„vœÀÉý݇‹Œ…fþ>orqp¦À±‰¢ ˘ÈÚ0_i1Fµ£ÿÿÉìÕ¥ºÿã¤&8@¹#¹ Œ¸©—(EGF'üì22ôìÄì1/ôìäôÄìÆî067632#"'&'#!%4'&#"3276s:YX{Ì€€Ì{XY:¹NýkrST’’TSST’’TS¶d01¢¢þøþø¢¢10d¨¦üÀËtsstËËtsstìÕ 3@  . /Üì2üìÄÌ1@ • ­ •/ìäôì³ 9/04'&#!!276!2#!#ON£þ¼D£NOý|NûþðûýèÉ8·‹DCýÝDC¨ýšÚÞÝÚD‘ÿã¤>@  G /Üì22ôìÄÌ1@¹¸ ¹ Œ—/äôìÄôìij9/0>32#"&'##34&#"326s:±{ÌÿÿÌ{±:¹º"Qr§’’§§’’§¶daþ¼þøþøþ¼ad¨DÑüËççËËççsÿã'ð0@†ˆ•‘ † ˆ• Œ0 Ü<ôìì1ôìôìôìôì0>3 !"&'53 !"shí†S†þzþ­„íjfç‚þðÿ‚çfbGGþaþ˜þ™þaHHÓ_^9'(9^_sÿãZd$D@"!• % ¡® •¡®•‘Œ%  0%üü2ììÄ1äôìôìîöîÜì0´&&].# !267# !2676;#"'fç‚ÿþð‚çfjí„þ­þz†S`œ SfãM?†nbÕ_^þÇþØþÙþÇ^_ÓHHŸghŸ$Ãbzª–qÿãÌ"N@$†ˆ† ˆ ¹¹¸Œ#‡—# HE#üô2Ììì1ôìäôìþôîõî0@ $$€$$ $].#"3267#"!2546;#"çNP³ÆÆ³PNM¥]ýþÖ-GF¡µE0iL~õ++ãÍÍã++ª$$>: ÖÀœaÿÿ ºÕ’ÿ—Õ.@• •  2 üìôì99991/ìôì0²`]3 !%! )"#546÷ô5þáþËþBŸ²–þhþPþa„vœÀ/ûw.,¦þ—þ€þ~þ–0_i1Fµ£ÉìÕ.@  .üìôì2ÄÄ1@ • •­• /ìôìôì0)!"!!"$54$3!!ž@Dþ¼£NýèûþðûNý|·þï#‡“ú+ÚÞÝÚÀqÿãZ?@¹¹Œ¸‡—G EüìÄôì221/üìäôÄìÄî0¶` €   ]5!#5#"3232654&#" M¸:±|ËÿÿË|±:ý§’’¨¨’’§n¦ùì¨daDDad¹üÀËççËËççqþVtc'T@ )E Q E(üìÄô²]ìÔìì99@   ¹¹¶(ôìÔüÔÌ99@%S ì910%!"'53254%&'&326&#">kþGÝxfööþøÐuŽïð›'«””¬¼~@3cnBOþðF™Fu\0%p‡9þÇþíœþü ËåèÃÂÇ *܃EÕ +@    ÜÄÄÔì2Ä1@ • •­•/ìôìôì0!5!!5!!5Eü>øý9ÇýÕú+ªªºªuÿãÙðD@&¡®•••­• ‘Œ3üÄìôì91äôìôäîîôî90!!"56$3 ! 7327uþíþî‹üpo’^‹þˆþÆþ·þ—Ü ÿÊÊÿ   2`_×FHþgþ’þŸþ[·ÌÃþääÿã{ð(@@$ † ˆ •‘)•­)† ˆ•#Œ)* &)üìÔìÔÄÄÌ1ôìôìôì9ôìôì0.54$32.#";#"3267# $546؃Ž æYÉsr¾S˜£ž•¶®¥¹Ç¾mÈTjÇ^þèþУ%!«|²Ñ ´&${spw¦•„–21Ã%%òÝÄÿ–þf#ÕA@ • °••­ üì2ÔÄÄ991ìôìîôì990² ]!!!!+53265ÉZýpPý°ÍãM?†nÕªþHªýŸþòôª–ÂÿþVøe@# ‡ ½©‡—¼ LüK° TX¹@8YK°TX¹ÿÀ8Y<Äü<ÄÄ991ä2üìî299ôì990¶@P ]#"!!+53265#535463ø°cM/þÑ®½®°cM°°®½™Phcû뻫™Ph*N»«sÿã—d&I@43! F'üìüôìüÄÄ1@•'$•$•¡®•‘Œ'äôìôìþÔî99Üì0%!5!# !246;#".# !26Ãþ¶uþæ þ¢þu‹^[£DÉãM?†npü‹þîþík¨Õ‘¦ýSU™mn™¼êª–Â×_`þÎþÑþÒþÎ%þRvÕ%•@ 'P $&ÔÔìÔìÔ]ĵ 91@ •½%$&ä222ôì³990@ #%$$ì<ì<¶$ì¶#$ì´%#@$"! #9927654'&'3#"'&547673¿6,3,,3,6ÙÞýºhC.Kd››dK.ChýºÞþý B9Iy\\yI9B z^ûÏÈ®wB‹AWWA‹Bw®È1ºG*O@, *&NF+üì2ôìÄÄÌÔì91@‡ '&‡& ‡ #¸—/<ìô<Äì9ì99ì0%27654'&'5+"&54&#"#3>323L•TWJ>yàmoþàÝF»||•¬¹¹B³uÁÆLiœbe›Þp_!”‘þìõþæÈΟž¾¤ý‡ýžedïèþò“gÉÆÕ .@ • üK°TX¹@8YìÄ991/äì9903;#"&ÉÊn†?MãÍÕü-–ªô RÕ E@ •¯  ü<ÄK°TX»@@88Yì2Ä1/ìÜ<ô20@ 0 @ P ` Ÿ ]33###53ÉÊ¿¿Ê¿¿Õýªý¿AªÉ÷ðf@ üì2ÔÄ9Ôì1@%    B  •‘¯ /<ìôì9990KSXííííY"#54&#" !#3632÷ªI&F%ýÝþöý3ÊÊlUqˆUUHy6P#ýùüãÏý1Õý‰CO\[n¹œË@   Füì2ÔÄ9Ä1@B  •— ¼/<äüä90KSX@     ííííY²]@5 ( ' ( ++@h `‰ … ‰ š —ª § ¶ÅÖ÷ ð ÷ ð ]´ q@%  ' ) +V f gs w ‚ ‰ Ž“ – —£ ]46;#"3 ##¹£µ¿¨iL%ëý®kðýǹ~ÖÀœa™ýÿãýôý¬#ýÝ * 2@F ü<ì21@ ©—/ìÔ<ì20@  @ P ` p ð ]33###53Á¸±±¸··ý8ýD¼= @     ÔIJ€]ÔÄÄÌ9´ @ ]1@  — /<ôÄÄ90@2 ©© ©        ìììììììììì<<ììü<3''%'3%# =ëGþÔ!)KÈ4:!þÉíÃþÆþ~2¼eccÅŠhahú×<üIJÿã'Õ'J@ )PP (üìüüüÌü<91@ !•!$Œ( /ô<<ô<Äì2909%#"'&5332653327653#5#"'&¦EÀ‚¯__Ë'9u¦Ë99w{SSËË?°yzVUÕ|v{zâûïº5N¾¤ìûï¢NM_`£ìú)®gb>>ÿ–þf3ÕŒ@)B • °¯6  9üìä99üì991/ì299üì990KSXííY"² ]@068HGif€ FIWXeiy…Š•šŸ]]!3!+53265É–ÄþðýjÍãG?†nÕûáú+áû‡þòôª–ÂÿÿºþVd{KsÿãÙð 1@ 3üì2ôì21@• •­ •‘ Œäôìôìì0! ! "!&32sy:;xþˆþÅþÆþ‡µÊÿ ¬þýVûÜÜøéb¥þ[þŸþžþ[¤ÅþäÃÃýzþÿþÂ=ÿÿgÿã&2ôÌ¢4ÿÿvÿãÓë'ÌX RsÿãÏð3@•¯• ‘•Œ!  üìÔ<ìÜìÄ1/ôìôìôì0!4&#! !2!2"327&nz¼þÅþÆþ‡y;pa'ãÍüXÜþýܯ€ŠÓ–û‹Ó¤bb¥ôþòü-Lþ¸þæþåþ¸gFqþVY{!:@ ‡¼"¹¸"¹Œ½"# E"üìÔìÜìÄ91äôìôìôì04'&##"3232"327&¡&&i‰ðñþïñdRصRQý”¬«•@TþVt™10ü¼98``ÖûŒ‰çÉÉç:ð6ÿ—ñÕ:@••   ? üì2üì91/ôìÔì0@ ?_¯]32654&#%!2+#"#546÷þššþ8ÈûþÿûþÊ„vœÀ/ýÏ’‡†’¦ãÛÝâý¨0_i1Fµ£¹þV¤$O@$#¹¹¸Œ½% ©—%G  F%üì22Ì99ôì1ôì99ääôÄìÄî0@ `&€& &à&]%#46;#">32#"&4&#"326sº£µþçiL:±{ÌÿÿÌ{±8§’’§§’’§¨ý®(ÖÀœa™Èdaþ¼þøþøþ¼aëËççËËççÉþøTÕV@  ?  üì22üÄì99991@• • /ìÜôìÔì9990@ @u|]#.+#33 326&#A{>ÍÙ¿J‹xÜÊÊþüƒý‰þš™Ž´~þh–bþ‘ÕþøÖغOýÑ’ ‘rÿãð!d@ -" "ÜìäüìÄ99991@B!¡” • •”‘Œ"äôäìîöîÎ90KSX@ ííY6 327# '&546?6764'& ÌäÆÊâ{š‡¼­áøþýÖþç’‘×âz¦<;YZþ¡ä¤LäþÀ-|숋Ð_ppÙ¶Ù+23Ù@@mdÿã¼{'Ï@  !! RE(üäìÔìÄ99991@ †'‰$†‰¹$¹¸Œ(äôìþõîõî90@S !S BKSXí9í9Y"²]@/)?)_))€)) )ð)]@% '$&((*//*( ( ))$††††]@.,,,;;;; q>323267#"&546?>54&#" L´fÎà˜«@«eŒ‚aÆflÃZØ÷¥Ä?”b‰‰Z¨N?¬ž‚•$%PKQY55¾##¶œ‰™*!I@TT((ÿÿÉ‹Õ7þòþV×6@   O ü2ü2ÌÌÔÌ1@‡ ‡— ‡½ üìôìÔ<ì20;#"&5# 54!23%&'&#"3wMc°®½®¾þò/µR5¿þ†!n|wjû=hP™«»®ÒØ`@o›š,0A37þVòž?@ Fü<Äü<Ü29üÌ1@©¼‡‡½/üììô<Ìì2990!!;+53276="&5#53w{þ…Ks½¤´F0j&&Õ§‡‡žþÂý ‰N®ÖÀœ01™ŸÒ`>éÕX@ •@  ÔÔìüä991/ôì2Ä990K° TX½@ÿÀ878Y@@pŸ ]!!##"#546®;ýîË^„vœÀÕªúÕ+Zi1Fµ£7òI@  Fü<Äü<Ä2291@‡— ©¼‡ /ìô<ì299ôì990²¯]!!;#"&5#53546;#"w{þ…Ks½½Õ¢‡‡®½®°cMÃcý ‰NšŸÒ`N»«™QÿúþféÕT@• ½•@@ ÔäüäÄ1ôì2ôì0K° TX½@ÿÀ878Y@@pŸ ]!!;#"&!ïýîn†?NãÍýîÕªû=–ªôÃÿÿ­ÿ÷_&8ûÌä4ÿÿ°ÿãië'Ìî XNÿãÏÊ:@!3   üÄüÄôÄìüÄ1@ • •Œ ôìü<ì2220!! 47!5!3254'5!ÏþÀ¡ŽþþÑþÏþ‘žþÁX²Ç ØØƱXþØÂþËþwŠ>¸*‹²²aþ´ÊïþÝ"ðÊLa²ÉÿávÕ-@   üìÔì/<91@ •ŒôììÄ0%254'&'5!'&'&33ÆØcAn³¡ŽÀ¿þÏMèagÊn†"ðʦmWDþØÂþËÅÄtzðü–ÿüððd@  @ @Ôäüä9Ä9/ì1@ •‘ ¯/ì9ôìÌ990@        BKSXííííY""#3 632#54&×9%þ„ËýðÙžNZ£ˆUUªIGý¿ý9Çýšùˆ\[nƒy6P=þVØ{j@  ÔK° TK°T[X¹ @8YK°TX¹ ÿÀ8YÄÄ9Ôì991@:        B ‡½ ¹¸ ¼ Ääôìôì9990KSXíííííí2Y"@      '$$  )( % $ $ ' 755008 6 6 8 A@@@@@@@@B E G TQQUPPVUVW W U U ffh {‰Š … … ‰ ™ • • ¤ ¤ F]@%     # 5 I O N Z Z j ‡ € “ ]+5326?3 67632#54&#"“N”|“lLT3!þ;Ã^0X‡ƒ¹²Q99) hÈzšH†TNü”À43`¿†rr:T*\ÕÀ@5    B ••• B ÜK° TK° T[X¹ ÿÀ8YÄÔä99ÄÄ91/ìôìÔ<ì20KSXíí<<<323#‰ÁüL:sþ§â_%'ST†_ijxzÔXè"Jhì0ªªª@umHLIwKK!!CÌ12èÂ\RI`1]ÿÁùÕ5@ FüÔììÔÔìÌ1@ •• • ôìÔìÌÔì0 4&#!!!%$ $5& ¹¥ý÷¡ý)s¢Q;-˜ýÄþÐþÛ%†“,ªþ%ÐhþàV)$yòÝhþL?`3@  FüÄìÔÔìÌ1@‡½‡ ‡ ¼ôìÔìüÌ2ì03 4&#!!!32!"'hªÎ–¹¥þŸýŸÝiä¦;-˜þè»Ô§c%†“,ªþ&cÔþàV)$yJXÿ㥞$!"'&'5327674'&+#5333!ªpln‰þíUQQLITNP³c9:VÀ>ååÊçæ}wsªº}#¬(rA…bLr¤þ줺þV¤{@@  Füì22ÔìÌ1@ B‡ Œ¼½ìÄôôÌì0KSX¶‡íÌY#36763254'&#"s¹¹4‡QÒ¸MNüÏr98xÜ­zþÐ ªBR1pq™þWþäù…BAïÉþV“Õ&@ —½Füì1ìì0@ @P`pð]3#ÉÊÊÕøÿÿÉþV'Õ'‚”‚þVœÕ:@ ©© — ½  Ô<<Ì2ü<<Ì21ìì9/<ì2Ü<ì203!!!!#!5!5!5!sÊ_þ¡_þ¡Êþ¡_þ¡_Õý—¨ðªý,Ôªð¨ÿÿɔՔÿÿÉ Ðm'?±'ÿÿÉ °f'@Õ'ÿÿqÿã‘f'@¶GÿÿÉþf$Õ'-‘/ÿÿÉþVÞ'Me/ÿÿÁþVï'MvOÿÿÉþfòÕ'-_1ÿÿÉþV·'M>1ÿÿºþVÞ'MeQÿÿhm&$¾u±<1ÿÿ{ÿã-f&D‰Z´ +'+1ÿÿÿþ`m&,/u ´ Ic:1ÿÿÿà^f&ó‰ÿ ´ Ic:1ÿÿsÿãÙm&2'uÿÿqÿãuf&R‰v± <1ÿÿ²ÿã)m&8öu±<1ÿÿ®ÿãXf&X‰v ´ Ic:1ÿÿ²ÿã)3&I08ÿÿ®ÿãX1'q{;¾ÿÿ²ÿã)Z&8L6ÿÿ®ÿãX"&XLÿ¾þÈÿÿ²ÿã)Z&8Q0ÿÿ®ÿãX"&XQÿÄþÈÿÿ²ÿã)`&8M0ÿÿ®ÿãX"&XMÿ¾þÈÿÿqÿã{ÿÿh3&$Iÿÿ{ÿã-1&¦qR;ÿÿh3&$Kÿÿ{ÿã-ô&DKÿ“þÁÿÿH4'q×>ˆÿÿ{ÿãoò'qèÿü¨sÿãð%T@!$"43 &üìü<ÌäüÄÄ1@"#•%•¡®•‘Œ&äôìôìþÔî99ܰ KTX±"@8Y<Ì203## !2.# !2675#535!5‹yyuþæ þ¢þu‹^’opü‹þîþík¨Cýýþ¶ þÖXÿSU™mn™HF×_`þÎþÑþÒþÎ%'µX„¦qþVú{ 4X@"2% G,E5üÄìôì22ÄÄ1@ #% ) †¹¹2/¸3¼ ¹½&)/ÄäìäôÄìþÕî99Ô<Ì20¶`6€6 6]4&#"3263#!"&'532767!5!6=#"3253¢¥•”¥¥”•¥¸³Æ:þúa¬QQžRµZý„š9²|ÎüüÎ|²9¸=ÈÜÜÈÇÜÜënXF]@Œ³,*_EG^[cb::bcªÿÿsÿã‹m&*Ju±!<@”!T!$!]1ÿÿqþVZc&‰JýJÿÿÉjm'¢u.ÿÿÿéœm&Nu*´ +1K°QX»ÿÀÿÀ88Y@ €€@@]ÿÿsþuÙð'42ÿÿqþuu{'€RÿÿsþuÙ1'q';¬ÿÿqþuuõ&qsÿ­ÿÿ ÿÁøm'¾uyÿÿXþL/f&‰TÿÿÿÛþVdf'‰ÿ%ù ´ Ic:1ÿÿÉ ÐÕ'=±'ÿÿÉ °Õ']Õ'ÿÿqÿã‘']¶Gÿÿsÿã‹l'v*ÿÿqþVZc&JvýÉÿã-Õ5@8üì2üì2Ôì1@•­ •Œ/äìä2üìÄ03!327653! '&5!#ÉÊÞÊ>=™”B>Êd`þæþígdý"ÊÕýœdûìŸPNOK¤ŸýZ߀xxvé ý9ÉþVð@@  üì22ÔìÌ1@ B• Œ½ìÄôôÌì0KSX¶‡íÌY%#3676324'&#"“ÊÊ8‘WâÆSTü‘¡=<íºœýº¹HW5xz¤þ7þή GFþÿÿÿÉ3k'u1ÿÿºdd&QCÿþÿÿhs&‡\}ÿÿ{ÿãÜs&§ì}ÿÿHl'\vˆÿÿ{ÿãoc&¨veÿýÿÿfÿºål'þvšÿÿHÿ¢œc&ºvýÿÿhp&$ åzÿÿ{ÿã-d'À˜ÿþDÿÿh6&$¼>ÿÿ{ÿã-H'ÂeDÿÿÉ‹p&( ¥zÿÿqÿãc'ÀºÿýHÿÿÉ‹6&(¦>ÿÿqÿãH'©Hÿÿÿ§sp&, YzÿÿÿÃc'Àfÿýóÿÿw6&,>>ÿÿÿãUH'Â$óÿÿsÿãÙp&2 Azÿÿqÿãud'ÀŸÿþRÿÿsÿãÙ6&2>ÿÿqÿãuH'˜RÿÿÇTp&5 yzÿÿ‚Jc'À%ÿýUÿÿÉT6&5€>ÿÿº^H'Â-Uÿÿ²ÿã)p&8 zÿÿ®ÿãXd'ÀÔÿþXÿÿ²ÿã)6&8ì>ÿÿ®ÿãXH'«Xÿÿ‡þ¢ð'×v6ÿÿoþÇ{'×,VÿÿÿúþéÕ'×S7ÿÿ7þòž'×WœþRsð. 56$>54&#"57>54.#"5632?4o¹ÿþê™È1¹\}p_s£ø54&#"57>54.#"5$32§Fp>!Bl˜³•J¢õžc(v];?Øß"AW?-1CA#E¨“ †p¸tgÍDZX%KŠlaF='‚.`[b[3XpV‹U 2#Pš™³×ÊÊQÌãéÉ×ÕÿÞü²Õñ‡†þÁþÌúÙqÿpD(4%3254'"632!"'#67&5#"'&76323 76'& ¶% 44ÊnˆôþªI5"ÄC0:XY|Ë€€Ë|YX:¸üÕST$TTTTþÜT‚¯- ¸Îþ¿H:E“<$d01¢¢¢¢10d^üæþjtsst–tssqÿã%ð ;W@$3=E (B!8;7B/E<üìôì̲ ;]ôìÌôìì91@$3•­< ;‘<,Œ<ôìôÌÔÌôì990" 7654&327654'&'52 '&54767&'&5476!˸jkkjpkkÔô‚ª_;̨_`Lm‚ä–‹ª˜¬_`œ›ýº›œ`a««CU‚tÅMMþòMMMN†‡š'|OEH-AAˆž+Mdhaº€² "ccÙttttÙcc"FYX‚SJqÿãq 4C@6E B42()+&BE5üìôìÌ2ÔìÌ2ôìì1@4)"¹.­5¹Œ5ôìôì99Ì20" 7654'& '&5467&'&5473327654'qSRRS SSSRþ:4H‚’RQ…„þ„…¤’;4?¡+IHƒ‚IJ,ÅMMþòMMMN†‡MMJ@b™@Y "ccÙttttÙÆ"#VKŽYIAèAAAAtw>\þVÕŸ@ B  ÜK° TK° T[X¹ ÿÀ8YÄÄÔìä991@ B• •• /ìôìÜì0KSX@ ííY@@ )&8HGH  /59?GJOUYfiowxŸ]]+53276=!5!5!!žHrþéi&&ûõ°üg•üPÇþßP%œ01™š‘ªšûoXþVÛ`¬@   ÜK° TK° T[X¹ ÿÀ8YK°TX¹ @8YÄÄ´@`]Ä99Ô´@`]ì1@ B© ©¼© /ìôìÜì0KSX@ ííY@2&GI + 690EIWY_fh€¯]]+53276=!5!5!!ÛžHrþéi&&ý5´ýejýL´þßP%œ01™¨%“¨üÛÿÿhP'¼u$ÿÿ{ÿã-'¸JDÿÿÉþu‹Õ&(z¢ÿÿqþu{&Hz{ÿÿsÿãÙ3&2Ibÿÿqÿãu1&¸qs;ÿÿsÿãÙ3&2Piÿÿqÿãué&RPÿµþ¶ÿÿsÿãÙP''u2ÿÿqÿãu'¸sRÿÿsÿãÙ3&2Kjÿÿqÿãu1&ñqs;ÿÿÿüç1'qr;<ÿÿ=þVõ&q^ÿ\Šÿp\%3254'"632!"'#67&73Î% 44ÊnˆôþªI5"ÄC1¸‚¯- ¸Îþ¿H:E“þÂÿÛþVy` 8@ ‡½¼  OF üìä991äôì990@  @ P ` p ]3+53265Á¸£µF1iL`ûŒÖÀœa™qÿ㌠#/A@1E%G +G!E0üìô<<ü<<ôìì1@(¹ .¹Œ ¸ —/ìä2ô2ì2ì20 6& 23632#"'#5#"'&76'&  7/ST$¨¨þÜT¹õr¹rôÌÿÿÌôr¹rõË€€]STþÜTSST$Túþjtsç–çs Å^ý¢Åþ¼ýðþ¼Å¨¨Å¢¢¢¢üé–tsstþjtssqþVŒ{ %/D@1E$G+G'E0üìô<<ü<<ôìì1@ *¹.¹!¸ Œ½¼0äää2ô<ì2ì20'&  7"'##"'&763253632 6& ÍSTþÜTSST$T¹ôr¹rõË€€Ëõr¹rôÌÿÿú¢ST$¨¨þÜTd–tsstþjtssþóÅý®RÅ¢¢¢¢ÅªªÅþ¼ýðþ¼þjtsç–çsÿýÿº|3 #!#'#7'7 3!Jå†afþp|ÒˆýÖÍ2F;R/þîo½]jÕþ¡¡Yþ'üñŽFF8Äý±þO ÿºŠ",'&76!27&'!2767# '#&# rfÜuÃÃS†v=:efc.1üô ˆ‚tsfjwv„þ´Â9Øt‚ÿˆˆFX»hÏÐ$xYv»+!üf //_ÓH$$Ç\/œþØ­ ÿ¢]¼"+'7&576!27&'32767#"'&#"i`½U—–UQ.-Y_výÓc³PNONMRS]ð“7îGG³cc^NæÌ lOU ý^q+ª$VqrÍg jÕ ;@  • •: ü<Ììü<Ì1/äìÔ<ì20@ 0P€€]33#!!#53ÉÊ¿¿×ü_¿¿Õýwýÿ²ÿº1##'!5!7 !é4þ"Ëþ gZýî™8fý¦,þÔi>ýÌý ý³XÇRªBYþ boþ{=4'&/&'&54632.#"3#"'&/&'&'&'53276 23«@«LLàÎf´LN¨Z‰DE11”?ÆPS{W„Ÿ“*L'TrGYí$alfcca‚FF'K((%$JK‚ž¬®((**T@%$!,KL‰œ[@Ÿ~$š=&[ó#¾5-,Xþ3`!;#"'&/&+=!qjýN\1“*Ll“TrGYí=Z^´ýe`¨üÝ1þø~$š=&[ó?œ %PÕ6@ ÔÔìÔì9991@ •• •/ôìÔìÔì0##32654&+"56;2‘'ÊñššþE¯O˜«þôþ÷Zý¦‘‡ˆ*,¶FÜá×çP{7@   ÔÔìÔì991@ ¹ † ˆ¹¸/ôìôîÔì032654'&#"5632##/dšLU†IVVN˜«û}„ÔÂʦ‘‡AH+¶FntÛÕåþü ìÕ (\@ #  . &%)ü<Ìì22ÌüìÔì9991@(•%• ••­#/ììôìî99/<ì20²*]!!!2654&#!2654&#%!2#!#53“[þ¥D££þ¼+”‘‘”þ çú€|•¥þðûýè¿¿ÉÉʇ‹Œ…fþ>orqp¦À±‰¢ ˘ÈÚp ÿãÎÕ_@ 8AüK°TX¹ÿÀ8Y<Ìì2ü<Ìì21@ • • Œä2ôì9/<<ì2299990¶Ÿ]3!33#! 5#53!3265²ËáË¥¥þßþæþåþߦ¦¬ý®Ã®Õý–jý–¤–þÜþÖ*$–¤¤}ðÓÓðÿÿhÕ0ÉÿB‹“33#!!!!#7#!#!¸ªAX’— þ¼¹.ý˜AªA°®þ<¹Ù—þV“¾ªþFªý㪾¾ÕúÕýãǺþFqÿB&-1&'&'!3267#"'#&'&3273&#"#ÇSošþ+”JajÇbcÐk{cPªm!)ü81Gª\9/ƒý¼‡š¹ZoÏ ”—Z þò6Zþ—44®*,! œ C ¬à"2’ÅJ®žþc¬ÿ–þfRÕY@   ••° 9 üK°TX¹@8Y<ì2ä99ÄÄ1äüìÔ<ì2990@ 0@P`Ÿ]#+53265#5333R¿ÍãM?†n¿¿Ê¿wýñþòôª–¦¸ýHÿÛþVS@$¾± ‡ ½©¼  OFü<<ì22ä991äÜ<ä2ôì99ôì0@ @P`p]33#+53265#533#Á¸£££µF1iLµµ¸¸`þ¤þ(ÖÀœa™ؤ¬ésþf°ñ$C@$ • °%"•• Œ‘¯%  %üìÔì22Ì991ìäôÄìÄîäì99053;#"&5# !232#"³Än†EMãÍMì¥þòþ¬T¥ìüßêÌÍëëÍÌêíèú“–ªô„€«\\«€ýxþãþ»EEþ»qþV@{$H@"‡½%"¹¹Œ¸¼%G E%üìôì22Ì991ìäôÄìÄîôì0¶`&€& &]#"&=#"3253;32654&#"@Fµ£:±|ËÿÿË|±:¸Li1ûï§’’¨¨’’§þVÀÖ¼daDDadªûŒ™a=ËççËËçç TÕ »@  ?  !ü<Ìì2üÄì99991@!  B• • /<ôìÔ2ì29990KSXíí9Y"²@"]@Bz%%%&'&&& "66FFhuuwˆˆ˜˜]]#.+##53! 32654&#A{>ÍÙ¿J‹xÜÊ¿¿Èüƒý‰þ’••’¼~þh–bý‰w¦¸ÖغOýƒ…J{=@ Fü<ÄÄü<<1@ ‡¸© ¼/äÔ<ì2ôìÄÔÌ0´PŸ]###533>32.#"«¹¬¬¹:º….I,œ§h¤þ<Ĥø®fc½ΡÿöìÕ3!733!#!53!Ù— –Ù—œþõþöËþöþôwþјÕààà¤þvý9ÇФ¤â þVµ`+5326?!533!33!+“N”|“lLT3!ÍþÖð¾Ã¸L¸Ã¹ïþ×ÁÚmhÈzšH†TòÍþ3Íþ3þð®ÿã`{ %²@ '  F&üì22ÔìÌÄ991@© ¹¸& †º¹#Œ ¼&äôìüìôìÄÔä¶  9990@1??? ?!OOO O!___ _!ooo o! ! !]@%???? ?!?"OOOO O!O"____ _!_"]2654&#"3>32#!3267#"&߬o™¹¸¸?¼ˆ¬Ëýûþþ§—`¶Te¾Zóð+f{bsÙ´)LªfaÁ¢½À‹..ª''üqÿãZ{8@¹¹Œ¸¼G Eüìôì221/ìäôÄìÄî0¶`€ ]53#5#"3232654&#"¢¸¸:±|ËÿÿË|±ýǧ’’¨¨’’§¶ªû ¨daDDaþËççËËççºÿã£{ 8@¹  ¹Œ¸¼G Füì22ôì1/ìäôÄìÆî0¶`€ ]4&#"326>32#"&'#3å§’’¨¨’’§ý:±|ËÿÿË|±:¸¸/ËççËËççRdaþ¼þøþøþ¼adª`ºÿ㤠$C@¹  ¹Œ¸!©—G! F%üì22Ä99ôì1/üìäôÄìÆî0¶`&€& &]4&#"326>32#"&'#46;#"å§’’§§’’§ýŽ:±{ÌÿÿÌ{±:¹³¥þéZ[/ËççËËççRdaþ¼þøþøþ¼ad¨~ÃÓœ}}ÿãõ{0@†ˆ¹¸ † ˆ¹ ŒEH Ü<ôìì1ôìôìôìôì0>32!"&'532654&#"M¥]ý*þÓþúU¢LNP³ÆÆ³PN3$$þÂþòþîþÆ##¬++ãÍÍã++qÿsç{'/O@( ,,H"E0üä2ìì991@†ˆ¹.*¹¹%¸Œ0äÌôìüÜìõî0@ 11€11 1].#"67632#"'#47&'&!23254#"çNP³Æc'>Ij£J?_S›PI™ 9/•-U¢þŠ:M’„e5¬++ãÍÍrQ,3H=Y}/)9DhQ#3¡ :#ü:9KqþV@$K@$©½%"¹¹Œ¸—%OG E%üìôì22ä1ìäôÄìÄîüì990¶`€ ]#"&=#"323;32654&#"@Fµ£:±|ËÿÿË|±:¸Li1ûï§’’¨¨’’§þVÀÖ¼daDDad^ùØ™a=ËççËËççqÿã¹$=@"¹¹ Œ¸%©—%  GE%üìôì221üääôÄìÄî0¶`€ ]546;#"#5#"3232654&#"¢£µ¿ªiL¸:±|ËÿÿË|±ýǧ’’¨¨’’§¶ÈÖÀœa™û‚¨daDDaþËççËËççqÿã{"r@ KE#üÄìôì91@†ˆ©¹ »¹¸ Œ#äôìäììôì90@)?$p$ $Ð$ð$?????,//,ooooo ]q]47632!"&'532767!7&'&#"qƒ„âü”•œþôkÐcbdcj·fg ü²¸]\šˆRS^ú’‘¡¢þíþöœœ,*®4cd¾žWWZZqÿã{A@$ †ˆ©¹»¹ ¸ŒKEüÄìôì91äôìäîîôî905!.#"5>3 #"73267qN Í·jÇbcÐk 9þ×üâþù¸¥ˆš¹Z¾Ç44®*,þÈþöþíþ½#Ä—´®ž|ÿã„{ 4w@6.('4 KE5üÄìüìÜ<üÜĶ&  91@/©.'"¹"¸5 ¹Œ5ôìôìÔÜì´†ˆôì@  &"90@ 4 &'<<ü<<<%6'6'32#"'&'&'&5>3 73;#"'&5Nf ý— Rˆ¨`•”üä‚\þLÑladbcÐk œ$˸&&i+@¯WRÖŠÏ>8þœE#Z`vþí¢¡‘gœ»'#d4®*,œ#)u”™10œ`ZÈÿÿ…ÿãÈ|Iÿÿ…ÿãÈ|Ë…ÿã*|>i@@603273;#"'&5Â|ŠþþîPUTZGUU]—UTNH‰”›tCDFEwGQPabªLÄq_ì¸&&i+@¯WRþà@\’l­¶«%88ZX83˜,-F@.. §NBj†”™10œ`ZȦFqÿãÅ|/;@ 1 &,E0üìÔìÄÄÔì1@¹¸0©0¹)Œ0ôìÔìôì²#90"327654'&+5327654'&'2# 76ñû`cchÒ—UTNH‰”›tCDFEhÄqr<žÿÛþV`K@ ‡ ½©¼  OFü<<ì22ä991äÜ<ä2ôì990@ @P`p]33#+53265#53Á¸£££µF1iLµµ`þ¤þ(ÖÀœa™ؤqþV¸ 0U@)  †¹¹&#¸-©*— ¹½*-+& G E1üÄìôì22Ä991/ÄäìôìôÄìþÕî990¶`2€2 2]4&#"326!"&'5326=#"32546;#"¢¥•”¥¥”•¥¸þþúa¬QQžRµ´9²|ÎüüÎ|²9£µ¾©iL=ÈÜÜÈÇÜÜëþâþé³,*½¿[cb::bcÈÖÀœa™qþVZ` #C@ †¹¹#¼¹½ GE$üÄìôì21/ÄäìôìþÕî990¶`%€% %]!"326!"&'5326=#"43!¢þª‡–¥”•¥¸þþúa¬QQžRµ´9²|ÎüüÎ=ˆÍ»ÇÜÜëþâþé³,*½¿[cb:ù*qÿãO{8@©¹†ˆ¹¸Œ4 EüìÜäüÄ1äôìôìþÔî990%#5!#"!2.#"326©›Ae×{ýþÖ-hÅ]_Àc³ÆÆ³O|žŒýð$$>:77ª>>ãÍÍã`þRd`#y@ %  $ÔÔìÔìÔĵ 91@ ¹ ½¼$ä222ôì³  990´ì³<´ìµ<<³<³< 3#"&54767327654'&'bBÀþ_j&;––––;&jþ_ÀBC(::(èxüܱS€c‚‚c€S±$úŽ-EIdccdIE-`ÿãd`#y@ %  $ÔÔìÔìÔĵ 91@ ¹ Œ¼$ä222ôì³  990´ì³<´ìµ<<³<³< 3#"&54767327654'&'b)ÙþrG,E––––E,GþrÙ)C'88'ÑýêbLx>‚‚>xLbü-!@2FF2@!-®þVX`9@ ‡Œ ¼ ½  NFüìôì21ää2ôÄì90´`Ï]332653##"&®¸||•­¸¸C±uÁȺ¦ýaŸŸ¾¤{ùöVfcðºdC@! ‡¸ ©— N  Füì2Ä99ôì1/<üì99ôÄì90²`]#4&#"#46;#">32d¸||•¬¹£µþçiMB³uÁƤý\žŸž¾¤ý‡~ÖÀœa™ÌedïºþVd!J@%  ‡¸"©—‡ NF"üì2Ä99ôìÄ1/Üìüì99ôÄì90²`#]+53265#"#46;#"632d£µþéiLø•¬¹£µþçiMƒçÁƤýHÖÀœa™²=¾¤ý‡~ÖÀœa™ÌÉï >@¾ ± ©¼  Fü<<<ì2221/äÜ<ì2üì0@ @P`p]33###533#¸¤¤¸´´¸¸`þ¤þ<Ĥ¬éÿÿ¦n`Mt„` '@   Üì2üì21@  ©¼ ©/ì2üì205!#3!53t¨¨ý𰼤¤ü褤Kß#<@ % V V$ÜüÜ<ü<ÜüÔ1@#!à !×/ä/ì2Ô<ì903327673#"'#&'&#"#67632=¸ &}33[¸ &}33[üí %$R‡IJý… %$R‡IJMT5@  ÜÜÔ<2ü<ÜÄ1@¹ ©—/ä9/<ì2ÔìÄ033##4'# 7632&#"3¢¸úú¸=þèõ5*7M\üþ ýŽT½öú„K9ÁþV_ (@  F üüÔÄ1@  — ‡½ ôìä990;#"&5y=x1F¿™ùÎ|tœÌÊ(ÁþL6$²@#&#" F%üü<ÔÄÔÄì̲#91@B©"©"† “¹ ½"¼ —/ääüìôìì9/ìì³ 990@$#ìì@  **8;ILT[q ]@$$%$$5$7E$FT$\ ]@    ]2!"'&'5327654'&+5!#3!CicUQþÐþè^cdjTÈm¾cd\[§®®ýj¸¸eÜ8+lhŠÝò%Ã12KK„KJ¦óü3þL¨ºÿæb&^@PP F'üìüüüü<91@  ‡#Œ'¼'ô<<ô<Äì290@0(P(p(( ( (¿(ß(ÿ( ]%#"&5332765332653#5#"'&®Cb`‚¯¾¹ruSS¹rw¦¹¹=ZXyzVUØy=<öâ¤ýb¢œ`^¤zýb¢œÀ¢zûž°e32>>ºþVb&a@PP F'üìüüüü<91@  ‡#Œ'¼½'ìô<<ô<Äì290@0(P(p(( ( (¿(ß(ÿ( ]%#"&5332765332653##"'&®Cb`‚¯¾¹ruSS¹rw¦¹¹=ZXyzVUØy=<öâ¤ýb¢œ`^¤zýb¢œÀ¢zùôZe32>>ºþV{0c@PP)%'F1üì2üüüì9Ì1@‡ %*!‡*-¸(¼&/<äô<Äì29Ôì0@02P2p22 2 2¿2ß2ÿ2 ]>32+5327654&#"#4'&#"#3>32)EÀ‚¯__RQµþéi&&ru¦¹99wSS¹¹?°yzUV‰|v{zâýHÖ``œ01™²¡œ¾¤ý‡ž¢NM_`£ý‡`®gb>>ÿÛþVk{Q@N O Füì2ä99ôì1@ ‡¸¼/äôÄì9@  ‡ ½ôì990´`Ï]#4&#"+532653>32k¸||•­£µF1iL¹B³uÁƤý\žŸž¾¤ýsÖÀœa™t®edïºþVJ{;@ N  Füì2ôìÜÄ1@ ‡¸ ¼ ©½ /üìäôÄìµ  90&54&#"#3>32;#"þR||•¬¹¹B³uÁÆ&&i1Fµþ¶`Ö²Ÿž¾¤ý‡`®edïèýH™10œ³d` y@B¼NF üìüì991/<ì2990KSXííY"² ]@068HGif€ FIWXeiy…Š•šŸ ]]!3!#³ÝÄþðþ#Ä`üy‡û lü”qÿãu{ ,@© ¹¹¸Œ Q Eüì2ôì21äôìîÜì0"!.265!2#"q“•t•’•¨ý†¨–ðþîðñþïßÁÁü è””èüþÈþìþíþÇ98q$`I@  EüìÔì2ÔÄÄij 991@ ©¼ © /ü<ôü<@© 9Ð/ì0!!!!! '&76!#";ýÔýë:üáþ»§¨¨§E*%ðxxxxð%`šþÝ›þ”œŽŽ‚lkØÙlm”ÿÜ>|$2@ &E E%üìÔüÔìì1@ ‡‡#Œ¸%äô<ì2ìÄ02765 26= "&'"&H`k&IÐþnÊI&k`þB"F:.a×¢ Öהģµ0[1þÐþð[0µ£ÄÈT\þ¤þ€l²6p£uyŸíÿÿpþVÑiÿå`/@   /Üì2991@ ‡Œ ¼ /ìôìÄÔÌ90%!"/32653#×rþù%832JI,œ§¹¹:º….´˾ü ®fcºþVJ{:@ ‡ ½‡¸¼ FüÄì2Ä1äôìÄÔÌôì90´PŸ].#";#"&53>32JI,§Liéþµ£¹:º….´˾ýž™aœÀÖt®fc„~{%@ ÜÌì2Ì1@  ‡ ¼‡/ì2üì9903!5346;#"à¤þ¤£µþéiLåý¿¤¤AÖÀœat~{%@ ÜÌÌüÌ1@  ‡ ¼‡/ì2üì9903!534&+532Ê´ýð¤Liéþµ£åý¿¤¤A™aœÀº—`°@4  B© © ¼     Füì2ÜÄì99991/<ôìÔì9990KSXíí9Y"²@]@Bz%%%&'&&& 66FFhuuwˆˆ˜˜]]#.+#!232654&#0s2®Ã¢J{Q©¹„ÚÖpýõÆwu t]þ΀:þ'`ž¥iŒþ¯VNM`º—`E@  Füì2ÜÄì99991@  ©©¼/ä2ìÔì9990332673#!32654&#º¹©Q{J¢Ã®2s0jpÖÚþ|¹Æuw`þ':€þÎ]t Œi¥žìþ¯`MNVoþVÇ{0€@C  S('  S'('B©½1 '(†‰‰!¹¹.¸Œ1' ($R$+E1üÄìÔìä9999ìÌ1äôìþõõî9üì0KSXí9í9Y"²0].#"#"/;#"&=32654&/.54632‹N¨Z‰‰b”?Ä¥÷ØdXLiéþµ£ÌÁ‚Œe«@«˜àÎf´?®((TT@I!*™‰œ¶ ™aœÀÖûjYQKP%$•‚ž¬ÿÙþV×4@ O Fü<ì22ä991@ ‡½ ‡—üì99ôì046;#"+5326¾®½®°cM£µF1iK»«™Phû)ÖÀœaÿÙþV× O@ !O F!ü<<ì22ä99Ì2Ä1@©¼! ©‡½! ‡—!üì99ôìÔ<ì2ôì0546;#"3#+53265#53#5¾®½®°cM¢££µF1iK´´¯`N»«™Phý¨¤þ(ÖÀœa™ؤi7þV5e"¶O ÔÜüì1@ ‡½‡¼ôìôì04&+532;#"&—Mc°®½®Ki1Fµ£(hP™«»üí™aœÀþòþV×2@   O ü2ü2ÌÌÔÌ1@ ‡‡— /<ôìì2ÔÌ0!3## 54!346;#"#"3276w·¿5RµþѾ®½®°cMów|n!›o@`ØÒ®»«™Phú£3A07þÀò^3@   /<Ô<ì2991@ © ¼©/<ì2ôìÄ990²¯]!5!4&+5323#²þ…{Ks½½Õ¢‡‡þÀ>`‰NšŸÒý þÂ7þVöž=@©¼‡ ½  Fü<Äü<Ä2991üìô<Äì2990²¯]!!;#"&5#53w{þ…LiÊൣ‡‡žþÂü™aœÀÖå>ÿã`C@ ‡©  Œ¼  NFüì2ôì221/ä2ôÄÜ22ì22ü0´` Ï ]3!33##5#"&=#5!326®¸:¸ºº¸C±uÁÈ®ŸýÇ||²høþøþ¤þ<¬fcðç ¤¥ŸŸºqÿâ„`S@ !  üÄüÄÔÄÌüÄ1@ ©¼ ¹Œ ôìü<ì2220@ààïïÐÐßß@@OO ]##"5467#5!32654&'7!„ìaþäááþäaíºfˆ°°ˆf´¼Hë˜ëþÜ$ë˜ëH¤ÜB׋ŸÂŸ‹×BÜÁ\b,@   FüüÄÄÄÔì91@ ¹¹¸ ¼/ìôìì0+"'&53732654'&'5\Ž‘ÞFµRQ¸&(g3°JInhX§3"î’``ÖÊý6™12Äžèec–0[«s=`h@'B¿ÔK° TX¹@8YK°TK°T[X¹ÿÀ8YÄ91/ì290KSXííííY"33# =¤ú¤Ãþ¢þ¢`û ¬üTV5` ï@   ÔK° TK°T[K°T[K°T[K° T[X¹@8YK° TK° T[K°T[X¹ÿÀ8YÌ91@  ¿/<<ì290@0U U U U   BKSXííííííííY"@ÿ - : FFI O TTZ _ aai vpvpˆ–—› ³³ÁÈÀ       %%#'!%""% ' $ ! #966 90FHF@B@@@ D D D @@VVVPQRRP S T U cdejejjjn a gouuy}x}zzx y  { v }‡ˆ——”“œ›˜˜™ @/–Ÿ¦¦¤¤««©©« ¤¯µ±½»¸ ¿ÄÃÌÊy]]!# # #335¸æåÙæå¸%ÙñòÙjü–jü–`üj–=F´ÔÔÄÄ1µ©—/<ôì0· ü<<<¶  9@   ìì3676;#"# =ìPHJ|“lL*./!ÅÃþ¡þ£ÒÇ>=š$#‡^û²lü”fk`8@   ÔÜüÔÄ91³¼/ä20@ ììì3 3#fÙ%.Ùþ]Ë`þ8ÈýþðXþV¿`ª@"B © ½©¼© OÜK° TK° T[X¹ÿÀ8YK°TX¹@8YÄ2Ä99ì1/ìôìüì0KSXííY"@B&GI + 690@@E@@CWY_``f``b€¯]]!!;#"&=!5!qjýL´Li/Fµ£ý7´ýe`¨üÛ§™aœÀÖ¨%Xÿ‘Û`!±@  "ÜKTK° T[X¹ÿÀ8YK°TX¹@8YÄ2Ä99ìÜ<ì21@ ©¼¹ ©/ü<ÜìÌôì0@ BKSXííY"@:&GI #+ #690#@@ECWY_#``fb#€#¯#]]!367632+#47!5!3254qjýL¯"TA`„:&>R~i™þ–´ýeÿ8ŠFX`¨üÛ¢G7W9W`/=3<;4¨%üÆ6]XþL/` ©@ "!ÜÔÄÔÄì̲91@B©!©† “¹ ½¼!äüìôìì9/ìì³ 990@ ìì@  **8;ILT[q ]@  %$ 5 7E FT \ ]@    ]2!"'&'5327654'&+5!5!`ÆqÿãÅ|/=@1 %,%E0üìÔìÄÔìÄ1@¹¸0 © 0¹"Œ0ôìÔìôì²( 90";#"327654'&% !"$5467&'&5476EwEFDCt›”‰HNTU—Òhcc`þöa——þÖþÆîþþŠ|p<:!ÖÀœa™þå>>ãÍÍãÿÿº`ÑþòþV.9@ Fü<ü<ÜÄÜì991@  ½¼± /<Ì2ääüÄ03#33## 54!3#"3276Á¸¸¸µ½7K¼þÑÁ¸u_+éËû ‹xG`ÝÍ‹BA0 ºþLœ` ## 33œ¹ýÛëRý•ð9¹þL—þ TýÝ#ºñ`@ ¿©FüüÌÄ1/ìì03!!º¸üÉ`ü3“qþVø $C@¹  ¹¸Œ#½%‡—% "GE%üìôì221üìääôÄìÆî0@ `&€& &à&]32654&#"#"32546;#"#/§’’¨¨’’§s:±|ËÿÿË|±:£µþçiM¹/ËççËËççý®daDDadÆÖÀœa™ùÚX¥$L@ & %ÜÜ<ü<Üìij#ÌÌ1@ † $©! ¹—©/ÔäôìÜ<ì2KPXÜÔYì032765&'&#"56763 3###53T?ÀV:9c³PONNLQQUŠmlpªççÊåärLb…Ar+¬#}ºªswÔ¤þì¤X¥$M@ &"#E%üìÜ<ü<Üij "#ÌÌ1@† ©$!#¹ —#©#/ÔäôìÜ<ì2KPXÜÔYì0535&'&5476!2&'&#";3##÷çªpln‰UQQLNONP³c9:VÀ>ååʤÔwsªº}#¬+rA…bLrþš¤þìqÿãà &) 76'& %3!!!+5#"'&7632/ST$TTTTþÜT ¸iýL´ü—ž:XY|Ë€€Ë|YXòšúþjtsst–tssH^þL¨üÛ“¨d01¢¢¢¢10MüùqþL4@#5#"'&76323!2!"'&'5327654'&+5 76'& Z¸:XY|Ë€€Ë|YX:¸jþej€bVQþÐþè^cdjTÈm¾cd\]¥®®ú:ST$TTTTþÜTÍü3¨d01¢¢¢¢10d^þL¨þ$8*mhŠÝò%Ã12KK„KJ¦óÓþjtsst–tssqÿ‘ 3: 76'& %%!332!##47!#5#"'&763233254#/ST$TTTTþÜTØ™ýghýL¯<Ûãþ²)™þ–:XY|Ë€€Ë|YX:¸ý®FXúþjtsst–tss_üú“¨üÛ ö½3<;4¨d01¢¢¢¢10d^ú6[7@ž7!!3!27654&/.54632.#")"'&5#53w{þ…%&s@‚FF^²@«˜àÎf´LN¨Z‰‰b”?Æ£|LþùýÄÕQQ‡‡žþÂý ‰''-,4IM*$•‚ž¬®((TT@I!,—‰’e>POÒ`>7þV&/!05476;#"+53276=#"'&5#53!3wxWQî°c&'QRµF1i&&½ÕQQ‡‡3þˆ%&sžþÂNµ[V™((hû)Ö``œ01™POÒ`>úü¢•ý ‰''7ÿpÉž-9D!6!2&'&#"63 #"'47!"'&5#533276'&#"&57!3w{•ÿUQQLNONP³cccOÎ+eKTI™þëÕQQ‡‡;BS_ƒr(þÖ€‹þ™%&sžþÂz•#¬+qrþfr «öv)2LOAPOÒ`>úù 'KV ø›ý ‰''/þVo5+5327654&#"#!##535476;#"!;67632oRQµþéi&&||•¬¹þÓ¹°°WW½®°c'&-·BYZuÁcc¤ýHÖ``œ01™²Ÿž¾¤ý‡Ñü/ÑN»UV™((hc®e22wxÁA'3!27654&/.54632.#")Á¸ý‚FF^²@«˜àÎf´LN¨Z‰‰b”?Æ£|LþùýOú†-,4IM*$•‚ž¬®((TT@I!,—‰’e>Áâ Ž@   Füü<ÔÄ2991@ B ©¼©—/ììôì0KSX@  ííY@B &GI   + 09 @@@@@C EWY `````b f¯¿ß]]3!!!+Á¸iýL´ü—ž¸šþL¨üÛ“Íüù6ÿâé 333# #333# #6t‘‰‘t¹ˆ˜™ˆ¹t‘‰‘t¹ˆ˜™ˆUþéþéýýþ=þéþéýýþ6­é3@    Ü<ì2Ô<ì2Ä1@  ©©ÔüÌ2ÔüÌ20!#!#!#!#6³ýk³ýkUþXþûrþXþûþJ3@ NF Ôüìôì2Ì1@‡Œ ‡ —¼½ììôìôÌì0%#"&54&+53232653#׃çÁÆLi1Fµ£ø•¬¹¹¬ÉïèÄ™aœÀÖýBþþ¤yùìþVv!:@ #NF "Ôüìôì2ÌÌ1@‡Œ" ‡ —"‡½¼"ìüìôìôÌì0%#"&54&+53232653;#"&'׃çÁÆLi1Fµ£ø•¬¹Ph2F¶ž¬ÉïèÄ™aœÀÖýBþþ¤yûŽ”fœ¹ÝuœÄ0@ ÔÜ32ÄtNN^luu)qJy}þ…wYYk\þžgþ«88†uœÄ:K°SX@ ÔÜ<Ì/ÌÌK° QX±@8Y1²]@ Ô<ÔÌÔÌ0Y#4&#"#46;#">32ÄtNN^lugr ’B0)qJy}þ…wYYk\þž„xkW6Vr88†ÿé­î #@Ü<ÌÜ<Ì1@ÔÔÌÜÌ03+5327653#zt43r,Bttý‚x66XVr‚uœ@ ÜÌÌ1@ /ÄÔÌÔÌ0.#"#3>32.biuu$uT ¯ qkþ¶sa97Hä´ ÜÜ<Ì1µ /ÌÔÌÔÌ032653#5#"&'H.bitt$uT ü qkJýa97H­u'¶ ÜÜ<ÜÜ1@  /<ÌÔÌÔÌÜÌ032653;#"&=#"&'H.bit0B,rg$uT ü qkJý V6Xlx a97 œ!+33276?3327654'&+›CFCD‰ôtk=%%(f{n!!"þ×}K'))'K}éN;[--sþ÷?¡«5ÿ/.6œé 333# #6t‘‰‘t¹ˆ˜™ˆþéþéýýþ&­Õ+53276?33Ÿ1/.N]D0 þâ{ÝÜ{bp"#WK/iþêÿÿ tŸfÿÿ tf&tÿÿ®éÓÕ úÿÿ²þ×Õ ûÄîéÚ@ žÜüÔÌ1Ôì0#5—R¤Ú¬þÀ@¬uï‡1´ Ü´? O ]Ìܶ ]<1¶—ôÌܲ]9Ì0526544u@XX@sPOOPï{X@?X{POæPPuï‡1´ ÔÌÜ@    ]<1¶ —ôÌÔ²]9Ì0"'&4763"3‡sPOOPs@XX@ïPPæOP{X?@Xuœ‰+@ ÔÄÜÜÌ91@   ÔÔÌÔÌÜÌ032765&'&#"567632#'y7$#?q22110335®WDDFk€[@*7K$@ ` XFh_@Cþ“uœ‰-@ ÜÌÜÌÄ91@   ÔÔÌÔÌÜÌ0#&'&547632&'&#"3êkGDEW­53301212q>$%6y[þAmC@_hFX ` @$K7*@ 2õ°% % êþ™gþ»õ‹´´‹õ 2õ°5-5õþgþ™ê'õ‹´´‹õÁ|?f=´uÜì91µ³ôÌ2´]90K° TK°T[X½ÿÀ@878Y3# #¶”õ‹´´‹fþgþ™Á|?fL´uÜì91µ³ô<Ô²]90K° TK°T[X½ÿÀ@878Y@ 5:5:3]]33¶õ‹´´‹õ|êþ™gþÁî?f7@ ´³uÜì91ôì290K° TK°T[X½ÿÀ@878Y3#'#¶”õ‹´´‹fþˆõõÁî?f7@ ´³uÜì91ô<ì90K° TK°T[X½ÿÀ@878Y373¶õ‹´´‹õîxõõþˆÖç^@ÜÜÌ1@/Ä0#^ˆýÕ+ÿÿÕb+öqsîRf3#‹Çþº™fþˆªð‰f #o™þºfþŠvÖþÑ^ü@ÜÜÌ1@/Ä0%#^ˆüýÕ+ÿÿÕþÀ+ÿTqù^ªþ‰ÿ’#o™þºnþŠvsþRÿ”3#‹Çþº™lþˆoÔ#E@ Ô<ÄK°PX³@@88Y2991/ÄÔÄ0@ `o]@ P```dd]!!!²e³³þ›ÙJý'þ¶oÙÔ#4¶ÔÄK°PX³@@88Y91ÔÄ0@`]@ P``d]!!²eÙJÿÿuþ‡#€þÿÿuþ‡#þÔá–!533áþ>––j––,þÔÔá–5!##––––þÔ,dÿºU 533##5#5D–àà–àuàà–àà–dß&u!5!&þ>Âß–Ç)9H W@ ð³VVÜìÔì1ô<Ôì0K° TX½ÿÀ@878YK°TK°T[K°T[X½@ÿÀ878Y332673#"&Çv aWV` v ž‘‘žHKKJLšDfN@ ÎÍdÔì1üì0K° TK° T[X½@ÿÀ878Y° KT°KT[X½@ÿÀ878Y3#šÌÌÌîá  @Áò ÁñV xVÔìôì1ôìôì04&#"3267#"&54632˜X@AWWA@XzŸssŸŸssŸô?XW@AWX@s  ssŸŸLþuÁ @  óô 'ÔìÄÔÌ1/üüÄ90!33267#"&546¸w-+76 >&Dzs5=X..… W]0i¶J7c@$  Ãà íVwVvôìüì99991ü<üÔ<ì99990K° TK° T[X½ÿÀ@878Y'.#"#>3232673#"&ü9! &$}f[&@%9! &$}f[&@Z7IR‡“!7IR‡“ðî®fB@´³ÔÜÔÌ991ô<ì20K° TK°T[X½ÿÀ@878Y3#3#ü²ø‡ªß‰fþˆxþˆÿÿÞ­%3;#"'&5¸&&i+@¯WRþëd¤”™10œ`ZÈ¢ïîf '#7'373\\]´µµ´]\´¶¶îaa»½``½»u«ý # 5473733254²òþõµú‰¿·‰þ¼‰ˆÜù´„„¿ò/ààþŠ®˜MM‰zœî ±/Ì1±/Ä03#zttü™uœ/2&'&#"#"'&'532654'&/&'&547632j1549W++](}24NMˆ9>=D@?>=RX o(l00GF‚@99 a /$*+MW33 k2-*)*IX01 uœ! #'#37ÿ ‰Í͉û‰»»þÏþ¾ööH+ßßÿÿuœ‰ƒÖX@ ©ÄÔì1/Ôì0!!5!•þAGЈú¨ÖX'@??//©ÄÔì21/ÔÜì]0!!5!3•þA¿ˆœˆ4ú¨ÖX@ ©ÄÔì21/ÔÜì0!!5!3•þA¿ˆhˆhú¨ÖX'@pp00©ÄÔì21/ÔÜì]0!!5!3•þA¿ˆ4ˆœú¨ÖX@ ©ÄÔì1/ìÄ0%3!5•ˆý¹ˆÐú¨ˆÿÿÁýì?ÿÖ‡ùpÿÿÕâ+v'q€q€ÿÿ®émÕ ÿÿÿîþ9œù3¶þvJÿ!_@ Vw V v"ôìüì99991@  à Ã"Ô<üÔ<ì99990K° TX½ÿÀ@878Y'&'&#"#67632327673#"&ü9 &}33[&@%9 &}33[&@þ³7 %$R‡IJ!7 %$R‡IJü¨{þ‡f6@ ´³¸DÜì91äôì0K° TK°T[X½ÿÀ@878Y # ým™þºXfþŠvþýq{ÿPf6@ ´³¸DÔì91äôì0K° TK°T[X½ÿÀ@878Y3#þ‰Çþº™fþˆsüÁ{ÿ?f<@´³¸uÜì991äôì290K° TK°T[X½ÿÀ@878Y3#'#ý¶”õ‹´´‹?fþˆõõsÿÿü´ÿH7žûþÿÿüÙbÿ/öqüÿÿûì|  üÿÿü¿)ÿ1Hšûøý¢{þZ%@ ¾±¸Ôì91äüì0@4D]3#ý¢¸¸^é°ü×{ÿ)I@Î͸ dd ÜüÔ9ì1äü<ì20@#4D`````````ppppp]3#%3#þ^ËËþyËË)ÊÊÊËý7òþ÷{"@ V@€ V /ÌìÜì1@Á@À /Üì0632#546?654&#"ý7pihX,#w3-.>GZdH3UC=A   (6%""($4ÿÿüìáÿœûþÿÿüôîÿ²fŸüüÅ{ÿCf<@´³¸uÜì991äô<ì90K° TK°T[X½ÿÀ@878Y373ýºõ‹´´‹õNîxõõþˆsý¼ìþD¨²/ì1±/Ì0#þDˆ¨þD¼ÿÿüðìÿ¨'¾ÿ4¾Ìü]îÿfB@´³ÔÜÔÌ991ô<ì20K° TK°T[X½ÿÀ@878Y#!#ý͇ø¾‰ßfþˆxþˆxÿÿü¿)ÿ1V'¸Bšûøü¿)ÿ1H µVV/ìÔì1´ ð/<Üì0#.#"#> Ïv aWV` v ž"ž)KKJLþéÿD( @ÔÌ0#3þòÓ¤é?ýÂþ‚Á#55#53þ‚òppòÃþÿ{‰þýÂþ‚Á53#7"ýñopòÃþþ‰{ÿyš‡3#@Çu™þˆÿÿü¨ýßþ‡ÿUCûþøïÿÿýqýÝÿPÿUvûþøïý$þþ<ÿÎ#5353#ýÄ  xxþµx¡þFýÄþþÜÿÎ33##ýÄx  x2¡x¡þU†?p!5!#Iþžêˆèˆþþðk{à1@V/K° TK° T[K°T[X¹@8YÜ2Üì1@ Á/ÄüÌ0532654&'3#"&þð=X..… W]0i×w-+76 >&Dzs5ý€þþVÿ¾ @  VÔüÌ21@Á Á/üÜì0"&5463"3þVZ||Z(55(þ}ZY|x5'(5ý þþõÿM3!5353þD±þ±ˆþœˆˆ±ý þþõÿM#5!##ý¼±걈þňˆ±ý$þþÜÿÎ #53533##ýÄ  x  xþµx¡¡x¡ý þˆþõÿ5!ý êþˆˆˆýzþVÿЀ '+53276=0RQµþéi&&€”Ö``œ01™”ýwþVÿÍ€ %3;#"'&5ýw¸&&iéþµQR€”™10œ``Öý¢þ‰þZÿs3#ý¢¸¸êÿÿüÕþ‰ÿ'ÿSjûþùCý(þþÔÿ¾ @V xVÔìôì1@Á Á/üÜì04&#"3267#"&54632þ[6'(55('6y|ZZ||ZZ|þê&65'(56&Z}}ZY||ýjþþÿT @ÔÌ03#ý¼Ó¤¬þÀÿÿý#þuþÁzüÿÿýLþuþÁüý¼þþDÿ ²/ì1±/Ì0#þDˆ`þtŒüðþPÿÿš#5!#é‰þë‰fþ¶ÂÂJücþ9ÿ˜ÿX#"4533273273"ýþ Ïv aWV` v ž"žþ6KKJLÿÿü´þ9ÿHÿSžûþùÿÿüÙþÀÿ/ÿTüÿÿûìþþ¬Büÿÿûìþÿî ùüûŒìÿ­ #"'&'.#"5>32326SKOZq Mg3OIN’S5dJ t]F‰ ®;73 !;?®<6 7=ýxÄÿˆh!5xýðh¤¤úíÄÿÿh5!úíĤ¤ûhÿ¢ÿ¼¼'ûÈ`õ_^NÌOúÿºÿ‘'úygfFXYý¬þþ‚ÿ¾ @  VÔüÌ21@Á Á/üÜì02#52654&#ý¬Z||Z(55(B}ZY|x5'(5üñþ[ÿÿ¥3!53üñ‰‰þ[JÂÂþ¶ý!þþãÿÖ!5#þãþ>JÒ*þ>Âþ¶ÒÒücþ9ÿ˜ÿX632#&#"#&'"#72ýþ;tÚv gfv ifvÜtúRþæ––•–ý+óþå­ '7'77þ}`}}`}}`}}`p}`}}`}}`}}`þÂÿ Ò.54675>54'&'þC!“‡RI 7!“‡RI Ç0PQn +0PQn ÿÿûì: ' ü üþ¾ÿÿü¨ðþ‡fCûþÿÿýqîÿPfvûþÿÿü´ÿH7žûþÿÿýÂþ‚ÁÄÿÿüçFÿbÒüÿÿýÆþVþ¢ÿ¤üüÕÿ+I#5!#!Õ–þÖ–V––,ýþ2þáÿ¸!5!5!5!þáþ>Âþ>Âþ2x–xýþþëÿ 3#3#ý––@––`þtŒþtýþþáÿÖ!#!ý–þÔ*þ>,ü¶îÿJf'73327673#"'&'#7&'&#"#67632ýÿBmk  &}33[& !Bnk  &}33[& ÿg©  $%R‡JI g¨ $%R‡JI ü¶‰ÿJÌ!%'.#"#4632326=3#"&3#3#ýü9 $(}gV$=09" (}gT";è––Ò––h! 2-ev 3)dw.–C–ÿÿü¶ÅÿJ"·§ücþ(ÿÿ 7!#'73!'3þp„þ„¯¯„ç„~¯¯þ(››ÍÍ››ÍÍý3þþÍÿ¤#557'þ2d›ÍÍ›þç„~¯¯~„ýxáþˆ&'&4767þˆ@*,,*@rNPPNr‹*,@A++{OPæPNÿÿü¿`ÿ1Ø'¸åÿÿý+þþåÿÎîù!ýxáþˆ050567654'&ýxrNPPNr@*,,*‹{NPæPO{++A@,*ÿÿÿ.Dÿú›ý”üþÿoÿ¿2>&"762"'"&46264&"ý 5O57O5÷>µ||¶=>¶||¶þ66O55þÃ55M75m?|³}A@}³|þÎ6M65O5ÿÿüpþÿ… !üÉÿÿüpkÕ !üÉPüp×k!!üp øàk”üpþÀÿT!!üp øà¬”ý* Ö'#'&'&#"#67632327673#"'&O,$e5F¢qpÈ[?9ZO,$a9G¢qpÈ[?9J7  $0G‡JI "7  $,K‡JI ÿÿüpn "üÉüwþ(“ÿÂ5!'3#7üws„~¯¯~„þÃd›ÍÍ›ÿÿÉqÕðÿÿÁÐ`ñÉÕ !#!#!#ÉSÊþ†Ëþ†ÊÕüôbúÕ+ýžÉeÕ !#####Éœ¸¹¹¹¹ÕüôbúÕ+ýž tŸf@ÔÌ1ÔÌ03 A¾ntòþ þVŸH@ÔÌ1ÔÌ0%#ŸA¾nHþòÿÿÉ3Õ¬ÿÿºy`̶þV’ÿ¤ #"'&=3;’”• #þV!.åå ÿÿÿãõ{ÿÿqÿãç{'yOÿ„Fÿÿÿãõ{'yŽÿ„ÿÿžÿÃ#sîRf1@ ´³DÔì1ôì0K° TK°T[X½ÿÀ@878Y3#‹Çþº™fþˆÿÿ×FRÒ&jl@¯Ÿ_]@_q0ÿÿhf'þÚ&ÿÿÛH®Fyÿÿÿçuf'þt*êÿÿÿóf'þ€,äÿÿÿí}f'þz.êÿÿÿòÿãf'þ4(ÿÿÿá‘f'þn9ªÿÿÿÛf'þh=6ÿÿ€Ò'ÿ.MÿÿhÕ$ÿÿÉìÕ%ÉjÕ@ •üüÌÄ1/ôì03!!É¡ý)ÕªúÕhÕ=@ B••ÔÄÄ1/ìôì0KSX@ììììY !3¼þf5û¹:å9ûš¨Õú+ÿÿÉ‹Õ(ÿÿ\Õ=ÿÿÉ;Õ+sÿãÙð!2@•‘"•­" •Œ"#3"üìÄôìÄì1ôìôìôì0!!"3276'&' ! '&76ÅÂý>bÜ‚ÜÜ€€Ü:x¼¼þÆþż½½¼pª†¤¤þåþæþ¸¤¤¤¤¤þ[þžþŸÒÓÒÒbbÓÒÿÿÉ“Õ,ÿÿÉjÕ.hÕ<@ B•ÔÄÄ1/<ôì0KSX@ììììY3#3#åÕ:å9Òþ&Õú+ÿÿÉÕ0ÿÿÉ3Õ1ÉbÕ *@• •­•   ü<ÄÔ<Äì1/ìôìôì0!!!!!!2Çý9i™üg™ügqªªûªÿÿsÿãÙð2ÿÿÉ;Õ³ÿÿÉÕ3É‹Õ F@B ••  ü<Ô<Ì1/ì2ôì20KSX@   ììììY%!!5 5!!±Úü>ßþ!°ý8ߪªªpªªýóÿÿÿúéÕ7ÿÿÿüçÕ<sÙÕ'<@) !%(üìÔ<<ü<<ÔìÄ1@•' •%'/Ô<ü<ôÔ<ü<0367654'&'&'&76753#–b‚‚b–Ê–b€€b–Êôž½½õÊô¼¼ôÊŽWsÆÅsWWsÅÆsWü† ¡‡ŸŸ†¡þñþò¡†ÿÿ=;Õ;sÛÕ.@ •ÜìÔ<ü<ÔìÌ1/ä22Ü<ì20!6'"'&336763#ÂÖ¼¸Õ‚nŠÊŠn‚Õ¸¼Ö†°ÒÌh™þgþ椌ñüŒ¤™þgþ˜ÌÒHîNÏç&3@ •‘&•("3'üÄüÄôÄìüÄ1/<ì222ôì0%!567654'&#"!5!&'&576! Ïý¨±cc„„ØØþ÷cd²ý¨?žIHÀ¿1/ÁÀGG¡²²²a¦¦Êð‘‘þÝïʦ¦a²²‹••¸>ÅÅÅÄþË””ÿÿXN'/u.´ +1ÿÿÿüçN'qu9´ +1ÿÿqÿçäf&Enÿÿ…ÿãÈf&PIÿÿºþVdf'ÆKÿÿ¦˜f&MÿFÿÿ•ÿã*Ò&Yqÿçäy *È@ ,%E+üìÔÄÄ99@ ?/]q@ ¹)¸ ¹!Œ¼‡/ìäôìôì99@<ììì<ìì10@ „†ˆ‰ €]@IIIJN LNIK ]@:9:88? <>]@ + +*))]@  ]@++]'&#"3273;#"'&'#"'&763 N,-²†=MKLy†H¤c¤Í( #) Xn^T).^,ëruÆ7 çínжÜikÕç%ý¡Û1)0œT*XoW)˜&ŠšÀþVˆ!7@E Füì2ÄÔìäÔì1@¹ ¹¹ Œ½ìôìÔü9Ôì0%#! !"3 5 4# y¹ª²¬þÔYoÅ þ0kêþûEþÈþþîdZþõþ&J­:ª@ÛþÈ þV`@@ ÔÔüÔÄ1@ ¿½/<ìä20@ ìì99ìì3#&+532iõ^Ãþ;¸þÚ,_1FŰýLdû þVªD~žqÿãuð-T@(/E( Q!E.üìÔìô² ]ìÄì99@%¹%¹Œ.ôìÔüÔÌ99@Sì910&#"#"'&4767&5!232654'&'&ìfïýÐuމ‰ð‰5Kœ¹ÝxþD7VUV•“¬[a~@Fu\0%p‡þëþ÷œœÌ¥@$OFþ(IqÌËrsè¾Ç`g …ÿãÈ|2=@" † ˆ¹¸3©3'†(ˆ#¹,Œ34 '0E3üìÔìÔÄÄÄ1ôìôìÔìôìôì0&'&547632&'&#";#"32767#"'&546‹p<@ ÔìÔÔÔÄüÌK°QX¹@8Y1@¹ ¹Œ‡—ôì2ôìÜì0%#457654'&# !5!Ê„OTJP£E* :ý¢;ýìfý,KOxsPWKL,#%5,*3ìY¹¹þ”þ'þiºþVd{1@‡¸ ¼½ FN  Füì2ôìì1/ìäôÄì0@ €]#4&#"#367632d¸||•¬¹¹BYZuÁcc¤û²HŸž¾¤ý‡`®e22wxqÿéu$!O@ ¹—"•"¹Œ"#E QE"üì2ô²]ì2ì1ôìÔ@?]ìôì0@ w #€#]!3276'&#"2#"'&76±ýƒEV•–SI 6V“™Q@=ð‰‰‰‰ðñˆ‰‰ˆÆþÕœŠÉdžœ~þü´ÔÓþŠþ‹ÔÕÕÔuvÓÔ¦n` @ FüüÔÄ1@ ¼‡/ìä0;#"'&5c"$lYo´RR`ý+‘.0œ`bÔÊ¿…` I@   F üì2ÄÔÄ1@¼ /<ä20@   ìì <<ìì33 ##¿¾ãàþGþáþb‰¾`þ/ÑþZýFBþ?= F@ ÔÄÔÄ1@ ‡ —/<ôì0@ì ììììì # #'&+5zÃþÆþ~ÃëJ/k`uâeú›<üÄ2Æ~žÿÿ®þVå`wJ`B@ÔÄÔìÄ1@ ¼/ä20@ì ì9ì9!367676'&'31 þªÆ!xdLjºE.*ˆ±{`üT|¬p5dwƒY|rNįätkþR&@@ (" %'ÔìÔìÔÔÄÔÄüÌ1@¹ ¹Œ'#‡"‡—'ôü<Ôì9ôìÜì0%#457654'&# %$47#5! $Ú„OTJP£E* :ý‘MþèÜÐý‹ýÆKOxsPWKL,#%5,*µ,X$ÅR¹¹þÝ¿ ªþ¼þñÿÿqÿãu{RJÿÙ˜`/@  ÜÄìÔìÄÄÌ1@ ‡Œ‡¼/ôì22ôì0!#3267#"&5!##J117,#J%x\þc¼`¸ýPH?… ƒ°œüX¨ºþV¤{1@¹¸¹ Œ½EQ Füììô²]ìì1ìôìôì067632#"&'#44&#"326=—;¶ÌÿÿÌ{±:¹+§’’§§’’§˜fZ#þ¼þøþøþ¼adý®ÏçÝËççËËççqþRç{$6@ !& HE%üìôÌÔüÄ1@¹¹Œ% † ˆ ¹¸%ôüôìôìÜì0 !2.#"32#457654'&¨þóþÖ-U¢LNP³ÆÆ¯ƒPTJP£E* >:##¬++ãÍÍãLOxsPWKL,#%5,*qÿãÖ` 1@  QEüìô²]ìÔÄ1@ ¹Œ‡¹¼ôììôì0"32654'&'!##"'&76s˜RV«•“¬VOšcÎm‰‰ðñˆ‰‰qÎns¾ÉçèÈ·zn’¸œÝþ휜›dm`#@  ÔÄüÄÄÄ1@ ‡ ¼¹/ìôì20%;#"'&5!5!!æ$lYo´RRþ\ þWÌ0œ`bÔ¸¸ýã‘•ÿã*`+@ E FüìÔìä@?? ?]1@ ¼¹/ìô<0327676'&'31'"'&5R27k–i;jºF-*€œþ³eb`ý+‡@EÐv»f€wƒZ{sšý»äxvÅÊpþVÑh )=@+E(#E*üìÔ<Ìü<Ôìì1@¹ ¸*'‡Œ½*ìô<ì2ô<ì20"27654'&'2##"'&7673=A__UVF6Œ‰‰Ë·Ç†ˆˆf¦B:VVMpË‘ýRh]ßÐp[„þÙþñ¡˜þn‘™œ’m£Ns¾Êsg¯.;þUda®@    Ô<Ô<9±Ä1@ © ¼©½ü<ìü<ì90°%KSX@ ìììì´ ´´ ´´9´9´  9´ 9Y#&+53;'$Ü•þÍÙ²¶1š1FA”3ÙþN¶1š1FþþúýÐ×~ž§þ0üèþ)~žpþVÑ`6@   ÜìÔ<ü<ÔìÌ1@ ¼ ‡Œ½ìô<ì2ô<<0&'&53367653#EçkƒºUJ|·ƒCUºƒvÜ·%awó‰ý~·LBÕü,BT¯ýxünc#þn‡ÿã'`8@E  EüÜììÔüÔììÜì1@ ¼ ‡/<ì2ô<Ä0 433233243! &þa›ÆÞ˪ËÞÆ›þaþð!)Rë@þÀðþOýæ±ð@þÀëý®+þÕÿÿ}&Mjÿ.ÿÿ•ÿã*&jYÿÿqÿãuf&}Sÿÿ•ÿã*f&"Yÿÿ‡ÿã'f&]YÉþVjÕ 3! # #ÉÊžýþ’†ý ÊÕý‰wýHüãþV„õý1§ÿéM$ 'G@)E& F(üì2ÔììÔ²?]ì1@ ¹("¹Œ(¹—(ôìôìÔ¶?]ì990267656#" '&76#327>&iPËDyÌz]6îö;~þ‹ox†Ò¤Ú]ûYß:P®W­p=l“Þºlþǧé‚_ÕÕ¨,¾Õâþå¶–þꀰœ-Ñžqÿéu$ 7@ !EE üìÌÜììü<1@‡— ‡ ‡Œ ÌôìÜìôì04'&#" '&4632  ®1B•SxyJþ̃ÓЯÚõþäþ#þõ¼°/¥pö~ª‰ZªZ7ªAi6 Þþdüüþe¶Ò þóþ½BWQß I@ "!ÜÌü9ÜÄ´?@]Ì1@•• •‘/ô<ÌììÌÔì99@ oÏ]0#4''&"562%62#"F R*Ë*R Mw(oUCHk&_*SK…Hþó¥ývŠ¥ H# ª 0þr{C @[)/Bÿÿÿá¡f'þnfPÿÿWQN'ÅufpþVÑ'A@)   $E(üìÔ<<ü<<ÔìÄ1@ ‡¸(‡ Œ— ½(ìäô<ü<ô<ü<02##"'&76327676'&#"üÇ…‰‰…Ƿdžˆˆ†Ç·qMTVMq·qLWULþc™œþíþ휙þo‘™œœ™úwgsÊÈugü¸HguÈÊsgAÿãm`E@ EEüÄìÔüÔìÄì91@‡¼‡ Œô<ì2ôì22Ì05!#%$! 47)323764A,“Mþaþñ")þøþaM:ü’GÞϪÏÞ¨¸¸Ï¤ý­*þÕR¤ÏѧþOýã®§pþ[Íg9&'&47#"54654'&#"563277632327"'532ùö! ½`È7"7$>Ž9[@[½`È7"7þÜ>Ž9[&ÍF¢]_I¤ ðI5lþ÷|"Oš Šz:6hlà0'þÃ[Ml |"Ošþ÷Šz:6hlýàf$1 1sþXÙðD@!  üìܶ0]ü9ܶ0]ìì1@ • ‘ •½ ìÔ<ìôì0#&'&76!   76'„¸ü ½½¼;:¼¼¼Ÿ{þH‚‚¸€€þp³ÒÄÓÒÒÓþžþŸÒ³I¤¤þåþ椤¤¤¤qþVu{ <@!E E üìܲ0]ü999Üìì1@ ¹¸ ¹Œ½ ìô<ìôì0"32654'&#&'&7632s”VVUV•“¬VV9ª¾k‰‰ˆñð‰jßstþntsèÈÇtuü þn’}œœœþÈþìþíœ{‹þR«Õ$.@ & #%ÜìÌÔÌüÄ1@ ••Œ%•"%ôìôìÜì0 32#457654'&# '&76)Fþó`{[mÈzYTJP£E* :þÀŽ•¹Šxe+w˜þÍþµ˜TOxsPWKL,#%5,*ËÖeNí±ªqþRQ` 4@ " E!üìÌÔÌüIJ]1@ ¹¹Œ! ¹¸!ôìôìÜì0")!"32#457654'&gÌþÖ-­þ[³ÆÅoƒPTJP£E* >œÇÎÍãLOxsPWKL,#%5,*ÿÿÉ#Õ)ÿ@þVF'6·  (ÜÌü<ÌÌ1@‡ ‡ ‡—( ‡$‡½(üìÔìôìÌÔìì0347632&'&#"!!#"'&'53276îˆ`©1213$)),x:KAþ¿‹b­933.1220W@R‚ Žd ¤>QoþÉý?’¥s ¤K_³ÿüÔÕ7"'&76'&526n ê'BƒæQ_šý¬'BƒæQ_‡þ[~ý,`*l#½FR¶Úþ‘`*l#½FR¿ˆB@ ÜÌ91¶B©—/äÔì0KSX@ììììY #!3ˆþç¸âý&¸âpüÆMý]rþV`ð!#56! #'#64?!"QªÍhЂÙíÖöáRR_@Ͷ»Ðþ¤0:ýŒIKiÆÏþÎþìýÂþXþ’LÊÑ}/M4ÐýÆ!÷wþ–x#&'#&' #'nï¹d2þF¹b.¼Ó-òà¬t¨`4þÌÀ#Mýа!„¤ØÈþPþßþ‰^ösþKÕ=W@< 9:?5 +,">üÜììÔü9Ô9ììÜìÜKSX° +9> &1•Œ>ôì29ô<ÌÌ90'6767&'&'#"'&46733276=332764''3=DÛ´þìvŒaŠyͤgDd''de’Óy{d;]ùT‡CHI}rHGÇFFt†AGC‡Tú_8dàþïËæ¦ˆd*…0Q€A^­­^^±´˜ÉŸFþ¿Ÿ·þÍkmihÆññÆhimw'·ŸAF‚œþë‡þU'`%S@!'E  E&üÜììÔü9Ô9ììÜìÜKSX°"Pe^Ò8*ˆ7D˜ ! ! 12ÀÔ°œˆ.#A“L.#^YŒq4+& "H4B;;=/?"+ŸVhP’OþV ö!! 7654'&#"#676! 3 7úÿþíþ¯þ¹º³llc¤´^#ð,V£¡¢¢þ÷þœÕ)èì¾£ñÛ„œe]’6?¡f‘ñضþòþ…µ³dþVj{ # 7654'&#"#67632327\ÚêþîþÞB§\\T‹™PÌ%I‹îèНþ/‘©ýÅþï™yYÂk}oSKu,2Rœè¤œÅþàºs¶ï5%! &'&#"567632 67632'&#" ;!53276ÚnþÍþ€þÜ"?E! rK,/ 4'Kr !D<&þÒtEGúÃGH ªÊþh=»" » C(FþK#C » "&þEýà !ªª!6Ë{5%! &'&#"56763267632'&#";!53276šÌäþ[9ï6:ƒ@%(ÅÅ(%@ƒ:6ö-:IûkI:ž8þî¤=35þú53þ¸þgžžsÿã%+$67632! '&76!2767&#"327*þÖW8QU{‚õ2þÎþùþΤ£‹|°s• K^—lŽÈº¼hiie¿¼b-sJ V"1þ¼ýðþ¼œ›PÞÒ» '±$üA‚æstÀ½xssqÿã[/&67632#"'&76!27674'&#"3276›ãI,)e[xÌ€€Ûÿ‰ˆtgO_\SG]EZ¨ST’•VXXT—”RS7xJ©F61¢¢ý𢢜›PÞÒ» '§'üøÍrsstËÇxsst,þV·Õ4@  Ü<Üìü<Üì1@  • ¼ ½ììô<ì2Ì20#5!#!#!3·ËþëËþëËàË`þòdú `duþ‹7þUÏ3@  Ü<Üìü<Üì1@  ‡ ¼ ½ìÌô<ì2Ì20#5####!3­å¹å­’¹_ÿpú†zppþpÿòÍg3#"54654'&#"563277632327#"'$47(`È7"7$>Ž9[@[½`È7"7þÜ>Ž9[@[þã™þ÷|"Oš Šz:6hlà0%þÁ[Ml |"Ošþ÷Šz:6hlà0%?[MºþV¤{$:@&E QF%üììô² ]ììÄ1@¹¹¸%"¹ Œ½%ìôìôìì04767632#"'&')! $'&  7ºZ6ž;¶Ì€€Ìx[Y: ôþþ+STþÜTSST$T%Уb^#¢¢ýð¢¢10dþXªÚ4–tsstþjtssÿÿqÿãç{FÿÿÿÛþVyMÿÿsÿãÙðaqÿãØ{!&'&#"!!32?# '&76!2Ø%%cj·f_¥ý[_f·€MJOhkþôœœ en('® c\©©\c§œœ(œœ Äÿã+{!56763 !"/532767!5!&'&#"Ä'(ne œœþôkhOJM€·f_ý[¥_f·jc%®£ œœýØœœ§c\©©\c ÿÿÉÕ ÿÿºþV¤Àÿÿsÿã'ð&ÉÕ ”@  >  üìüì91@ B ¯ /<Äì290KSX@  ííííY²p]@ 6II YY @  &)5:EJ ]]! !###É-}-ÅþËþÄÕþ!ßú+þçúáþV³` O@ F  ÜìÜìì1@ B  ¼ ½/ìÄì290KSX@   ííííY!!###þ¹þì™þë¹`þ{…û ²þ` ú¤UþV¤{'4767632#"'&'!!#5#5'&  7ºZ=—;¶Ì€€Ì{XY:åþ¹eSTþÜTSST$TµçŒfZ#¢¢ýð¢¢10dþȪppªô–tsstþjtssÿÿsÿã'ðHÿÿsÿã'ð&y3ÿÿsÿã'ð'yä‘ÿÿÉ‹k&©îuÿÿÉ‹N&©u…±’—B°“°˜B±€B±B|°°#I°°#Ia°€bh°Fa°F`°’C°`#B°’C°`C°UX°°’C°`C8°°5Y±€B±B°°°°#Ih;°°5°°#I°@PX°°@8°°5°5Yÿúþf¬Õ4@  ÔÌü<ÌÜüÌ1@•°••/ôì2Ôìôì0%+532654&#!#!5!!!2¬ÌäL>†o||þˆËþR‹ýÞhþòôª–Â"Ÿžý9+ªªþFéîÿÿÉjk&§®usÿã'ðN@  Üì2Ô<ÌÌ1@•­ ¡ ®• ‘¡®•Œôìôìôìôìôì±I±IPX³@8Y0! ! &! !!! 'Ôþõþ±þz†OÐÓÿþøîüâîFÓŸhgŸŽÕ½þãïªïþäÿÿ‡ÿã¢ð6ÿÿÉ“Õ,ÿÿXN‘ÿÿÿ–þf“Õ-T/Õ3@   ÔÔìÔ<ìÜì1@• ­• •/<ì2ôìüì0!565!32#!% 4&+pþÈþ‘Ù•xêûþðûþLª@£à+¸ýÊýû8ª/¦XþýšÚÝÞÚ¦‹‡ýÝÉÌÕ5@ üì2Ü<ì2Üì1@ • ­ •/<ìä2ü<ì20!!#3!332#4&+326 ý†ÊÊzÊêûþðû6£à࡟Çý9ÕýœdýšÚÞÝÚ·‹‡ý݇ÿú¬Õ,@   ÔÌü<ÌÜì1@ •  • /<ôì2Ôì02#4&#!#!5!!ºÞÉ||þˆËþR‹ýîqéîþfŠŸžý9+ªªþFÿÿɆk&®îuÿÿÉ3k&¬åuÿÿ#½m'ru·Éþ¿;Õ )@  •  üìÔüÔìì1· • /<ä2ìÌ0)3!3!#­þÊÞÊþªÕúÕ+ú+þ¿ÿÿhÕ$ÉìÕ.@  . üì2ôìÄÌ1@ •• ­•/ìôìôì04&#!!26!!2)£þ¼D£lýNûþùþüýè·‹‡ý݇¨¦þ@ÚÞÝÚÕÿÿÉìÕ%ÉjÕ@ •üüÌÄ1/ôì03!!É¡ý)ÕªúÕeþ¿ÛÕ4@• •ÜìÔìÔÌü<ì1@ • •/ì22Ì2ôì0%!!67!3#!#Ó”þpþ±†&axªªûÞªªÔþ þµD+?x4&úÕþAþ¿ëÿÿÉ‹Õ((vÕ˜@   Ü<ì2ÔÄ991@B  ¯ /<<ì2290KSX@    <<ííííY@ I:I:I:I:I:I:@  <<<<33 # # # 3êʪõýßDÓþþþÊþþþÓDýßõªÕýâý³üxþéþêüÿˆMý‡ÿãšð(?@ * %)ü2ÔìÌÔüÌ1@• ¡®• %¡&®"•‘ Œ)äôìôììôìÔì02#"$'532654&+532654&#"5>Iö8Žƒ‘£þîzþä,™©|¼Ð¹ÃÌÔ³ž£Æ†\ÍqìðѲ|«!ÄæéBÐY+•„•¦wps{MÅ("É3Õ y@ B ¯ 6 üìüì991/<ì2990KSXííY"² ]@068HGif€  FI WX ei y …Š •š Ÿ ]]#!33ÄýjþðÄ–Õú+áûÕûáÿÿÉ3m&¬õu#´ +° KT° KT[°KT[X»@ ÿÀ88Y1É†Õ Y@   üì2ÔÄ991@ B ¯ /<ì290KSX@    <<ííííY3! # #ÉÊÒý¿_ÜýúþïÊÕýâý²üyþéþT:Õ%@   ÔÔìÔìì1@ •• /<ìôì035675!#!TÙ>WxÊþfbª/¤Xþú++¸ýÊþøýÿÿÉÕ0ÿÿÉ;Õ+ÿÿsÿãÙð2É;Õ@• üìÔìì1/<ôì0#!#;Êý"ÊÕú++úÕÕÿÿÉÕ3ÿÿsÿã'ð&ÿÿÿúéÕ7#½Õ>´ ÔÄÔÄ1¶B •/ìì20KSX@   ììììY%+53276?3 3 OûM?w.-þ!ÙsuÙµ2&]ª*jkü”lyjÕ =@!   üìÔ<<ü<<Ôìì1@ ••/Ü<ì2ôÜ<ì203>54&'$%53# ÙææÙËÙääÙËþÃþ©W=Ë=Uþ«þÃË¢ÌÅÅËËÅÅÌü+  -‹‹þÕþõþ÷þÕ²ÿÿ=;Õ;Éþ¿åÕ )@ • üìÔì<üÌ1@ •/ì2Ìô<0)3!33#;ûŽÊÞʪªÕúÕ+úÕþ¯³Õ$@  ÜìÔì2ì1·• ­ /ä2ôì0!!"&533!3èþ_ºÞÉ||xËdéîšþvŸžÇú+ÉÅÕ *@    üìÔüÔìì1@ •/ì2ô<<0%!3!3!3¬OÊùÊOʪ+ú+ÕúÕ+Éþ¿oÕ2@ •  üìÔüÔì<üÌ1@   •/ì22Ìô<<0)3!3!33#ÅùÊOÊOʪªÕúÕ+úÕ+úÕþ<Õ *@••­•  ÌÜì2ÔìÌ1/ìôìôì0!!5!!2#4'&#!!276õþGƒNûþðû6ON£þ¼D¡PO+ªýšÚÞÝÚ·‹DCýÝDCÿÿÉFÕ&À,³ÉìÕ $@• ­ •  üì2ÔìÌ1/ìäôì04'&#!!2763!2#!ON£þ¼D£NOü²ÊNûþðûýè·‹DCýÝDC¨ýšÚÞÝÚoÿã#ðN@ Ü<ÌÔì2Ì1@•­ ¡® •‘¡®•Œôìôìôìôìôì± I±IPX³@8Y0! 7!5!&! 56! ! 'oÓîüâîþøÿÓÐO†þzþ±þõÔF½ïªï½ÕŽþaþ™þ˜þaÓÿã0ð&8@•‘'•Œ'!•&­$#(  !%$'üì2Ô<ìÔìÌ1/äôìôìôì0"3276'&76! ! '&!#3~Ü‚‚ÜÜ€€üs´´;:¼¼¼¼þÆþÅ´´þÐÊÊL¤¤þåþ椤¤¤¤¤ýóÍÌÒÓþžþŸÒÓÍÍýkÕýjˆÆÕ@@  ÔÄìÔì2ì1@ B• •­ /<ôìôì0KSX·  ììY3!!" &$54$)#!›•’:þÆ’•þí˜dÿÊþòþv'ƒ‡…ûV©×Îàú+wý‰ÿÿ{ÿã-{Dpÿã7):@+E'Q! E*üì2ôììÔÄ1@©—*$¹¹ ¸Œ*äô99ìîôì02#"'&5476$%676"32654&}ðþîðñþö:[;z631-ú~LǂӔ¬«•“¬¬{þÈþìþíþÇ0åw) v¹ ’ ,u™8wœçÉÉçèÈÇéº>` /@ " F!üì2ÔìÌÔì1@ © ©¼© /ìôìÔì0!2654&#32654&#%!2#!r~„„~þúòh„„hþV¶ÅÔljŒçÖþ9þ_ZZ^ÉþÊSJJO“…gy˜r–¤ºÐ`¶FüüÜÌ1´©¼/ôì03!!ºý£`“ü3kþå`4@ © ©ÜìÔìÔÄü<ì1@ © ¼©/ì22Ì2ôì0%!!6765!3#!#»þ}vþØ[(bõ““üt““:ŒþdÜ6(UÓ©Ôü3þRþå®ÿÿqÿã{HFï`˜@   Ü<ì2ÔÄ991@B  ¼ /<<ì2290KSX@    <<ííííY@ I:I:I:I:I:I:@  <<<<33 ##'# 3?·éÖþnÌÅþ‡»·»þ‡ÅÌþnÖé`ýòþQýO6Éþ“mÉýʱ¯ýò…ÿãÈ|(N@ &* )ÜÄÄÔìÌÔì1@ †ˆ¹#¸)©) † ˆ ¹Œ)ôü° KQXüôYìÔìôü° KQXüôYì0#"&'532654&+532654&#"5>32Â|ŠþþîP©ZGª]—©–‰”›t‡‹wG¡abªLÄãx\’l­¶«%%pZXk˜YF@\§]ºy` ?@B ¼ F F üìÔì99ì1/<ä2990KSX@  ììY##3y·ýäì·`û ƒü}`üÿÿºy&ÌššÿÌ#´ +°KT°KT[°KT[X»@ ÿÀ88Y1º‘` Y@  F üì2ÔÄ991@ B ¼ /<ì290KSX@    <<ííííY33 ##º·âþTãÎþsÅ·`ýòþOýQ5Èþ“Ls`$@ F  ÔÔìÔìì1· ©¼© /<ìôì0356765!#!L¶8Dõ¸þ{X^™~±Å·û ÍoþPÂϺO` M@B ¼  F F üìÜìì1/<Äì290KSX@   ííííY! !###º >? ¹þ˸þʹ`ýîû °ý'ÙüPº` '@ ©¼ F F üì2Üì2ì1/<ä2Üì03!3#!#º¹U¹¹ý«¹`þ7Éû ýüÿÿqÿãu{Rº`@©¼ FFüìÔìì1/<ôì0#!#¹ý«¹`û Íü3`ÿÿºþV¤{Sÿÿqÿãç{F<m`¶ ÜÔüÜÌ1µ©¼/ôì20!!#!<1þBµþB`“ü3Íÿÿ=þV`\pþVgÕ (3B@5E)! '.E4üìÔ<<ü<<Ôìì1@,¹¸—41¹$Œ ½4ìô<ì2äô<ì20327&#"#"323>32#"&'4&#"326/‘{brrb{‘à9ƒS§éé§Sƒ9¹9ƒS§éé§Sƒ9à‘{brrb{‘/ëǨ¨Çû<9^N5=L^ýü^LþÃþíþíþËN^ýÇÙëǨýì¨Çÿÿ;y`[ºþå` (@ ©F üìÔ<ìüÌ1·¼ ©/ì2Ìô<0)3!33#ü9¹U¹““`ü3Íü3þR–`;@© ¼FÜìÔì2ì1/ä2Ôì°°#I° °#IRX± ¸ÿÀ°8Y0!!"'&533!3Hþ©™f\¸45h)¸×_V¸þõu;;öû º˜` )@ F  F üìÔüÔìì1· ¼©/ì2ô<<0%!3!3!3Ú¹ú"¹Ù¹“Íû `ü3ͺþå+`2@ ©  FüìÔüÔ<ìüÌ1@  ¼ ©/ì22Ìô<<0)3!3!33#˜ú"¹Ù¹Ú¹““`ü3Íü3Íü3þR>.` ,@ E  ÄÜì2Ôìì1@ © ¼© ©/ìÔìôì02#!!5!!!2654&qÖççÖþ8þ•$þù~ƒƒ—£¨¨¤Í“þ7“þ_ZZ^ÿÿº›{'ó"àº>`%@ E  Füì2Ôìì1·© ¼©/ìäÔì04&#!!263!2#!zƒ~þú~ƒý@¹ÖççÖþ9LZ^þ_nþ7£¨¨¤qÿãç{M@ HÜ<Ìôì21@† ˆ †ˆ¹©» ¹¸Œäôìôîþôîõî± I±IPX³@8Y073267!5!.#"563 !"'qž“ÒýÈ2 ŸÇš¡¦-þÛþÿ½“ÕV«Ú“ißV¬FþÃþñþòþÂHÁÿãL{ :@ E  Füì2Ô<ìÔìì1@¹¸¹Œ©¼/äÔìôìôì0"32654&632#"'##3J”¬«•“¬¬ýqùððþîðñþù и¸ßçÉÉçèÈÇéþ¾þÈþìþíþÇ.øý÷`þAt"`<@  ÔÄìÔì21@ B©¼ © /<Ôìôì0KSX·  ììY;#" .5463!##z€wøøw€þúVtš×Ù¶¹åþ¶S^a\ü뉢¡û Ùþ'ÿÿqÿãk&ÉCZÿÿqÿã&Éj–…±’—B°“°˜B±€B±B|°°#I°#°#Ia°€bh°#Fa°F`°’C°`#B°’C°`C°UX°°’C°`C8°°5Y±€B±B°°#°°#Ih;°#°5°°##I°@PX°#°@8°#°5°5Y/þV?@N F ü<Ìì22ÌôüÌ1@©©‡ —/ìÔÄìÜ<ì2Ôì0#533!!>325654&#"#ß°°¹ýãB²v¶Øþ©×zõ||š§¹Ñ´þLþmedéþêâþY)Œ.ÒПĞþûÿÿºØm&Çv†qÿãç{N@ HEüä2ü2Ì1@†ˆ†ˆ¹ © »¹¸Œäôìôîþôîõî± I± IPX³ @8Y02&#"!!327# ¤¦¡šÇŸ 2ýÈÒ“ž“½þÿþÛ-{F¬Vßi“Ú«VªH>=ÿÿoÿãÇ{VÿÿÁyLÿÿÿôF±ÿÿÿÛþVyML¿`6@!E  ÔÔìÔ<ìÔìì1@© ©©¼©/<ìôììÔì0356765!32#!!%2654&+L¶8DØ«ÖèçÖþ›þšX^x~„„~£™~±Å·þ7£¨¨¤ÍoþPÂÏv_ZZ^þº·`8@E   Füì2Ü<ì2Ôì1@ ©  ©¼ /<ä2Ü<ì2ì032#!!#3!2654&+N«ÖèçÖþ›ýÞ¹¹"\~„„~£`þ7£¨¨¤ýü`þ7Éü3_ZZ^þ/‰:@N Fü<Ìì22ôìÌ1@©‡ —/<ìÔÄìÜ<ì20#533!!>32#4&#"#ß°°¹ýãB³u½Ê¸||˜©¹Ñ´þLþmedêíþÐ*ŸžÁ¡þûÿÿº‘m&Îvoÿÿºyk&ÌC]ÿÿ=þV&ך^̺þå` )@ F © F üìÔüÔìì1· ©¼ /<ä2ìÌ0)3!3!#Tþf¹U¹þf“`ü3Íû þåsÿãÕ48@$%6 )  5üÜììÔüÔììÜì1@ $•-/<ì2ô<Ì0"'&46733276=332764''3#"'&':Óy{d;]ùT‡CHI}rHGÇFFt†AGC‡Tú_8d{{Ñ’ed''de±´˜ÉŸFþ¿Ÿ·þÍkmihÆññÆhimw'·ŸAF‚œþç¾þf²±^^­­^^ÿÿ‡ÿã'`]±Õ:@  Ü<Ìü<<ÌÔìÌ1@ •  •­• /ìôìôÔ<ì20!2#!!5!53!4'&#!!276XNûþðûýèþpÊqON£þ¼D£NOQâÚÞÝÚQ¤àà¤ýf‹DCýÝDCç:@E  Ü<Ìü<<ÌÔìì1@ ©  © —©/ìäÔìÔ<ì20$4&#!!2!5!3!!!2##ƒ~þú~ýÃþ»E¹©þWÖççÖò´^þ“Í“´þL“þÊ£þ°¤Óÿãð+#3376!2&'&# !!!2767# '&ÊÊÒÃS†vwhfst‚ÿˆg²ýF‰ÿ‚tsfjwv„þ­Ãº Çý9Õýœ§Ð$#GÕ_//œwƪþó”//_ÓH$$ÏÆOÁÿã{#2&#"!!327# '&'##33676>¦¡šæ\" Ìþ, žUxž“¼þó”{ “¸¸˜z—{F¬V´AWô^3VªH­äýü`þ3Ê€žøÕ !#!#!#3 øáþêþéÊþçþêáå±þÜþÜýåýåÕüó7ýÉ3` !#####3 Ãìã¸åìÎÑóó•þk•þk`ý¹¡þ_É Õ!#!#!#!#3!3  áþêþéÊþçþêáoýøÊÊ_<å±þÜþÜýåýåÇý9Õýœdüó7ýÉÁÐ`!#####!#3!3 ÐÃìã¸åìÃþk¸¸éÑóó•þk•þkçþ`þéý¹¡þ_sÙÕ‚@   Üì9ÌÜ´O]9ìÌܶ@@]9ì991@B • /<<ô9ìÔ<ì20KSX@  ííííY²@]##767!#'&'!‹Ê“d‚Õ½xªþQþP¤t¼Õ€`ø>ýƒYý§Y~¤þåbÒ†1êý2‚Òþž¡zÊ(k{`~@   Üì9Ìܲ€]9ìÌܲ0]9ì991@B •¼ /<<ô9ìÔ<ì20KSX@ííííY´p]! #4'&'##767Eþ]Ñþ»kK‰ÃV:V¸S8V‰Jlþ»¶þ–ýÌ&VœþìÇtOþ\¢KtÉœU'4ÉÄÕ! !#'&'##767!#3!ïþŸþP¤t¼Õ€`™Ê“d‚Õ½UnýµÊÊ„>ýƒqdý2‚Òþž¡z ý§Y~¤þåbÒ_4ý9Õýœn(Á.`! !#4'&'##767!#3!7þçþ»kK‰ÃV:V¸S8V‰þ’¸¸þ]ÑwéýÌ&VœþìÇtOþ\¢KtÉœþ`þ?þ–sþVszS#"&#"3276&#"#"'&54763!27654'4327654!"567376767632'&#"ss˜ÆDº#`ÜA€t bTDt;ü<}J£5?u_hFA»XùV£RuþÅ¥Þ Ÿs j#B#' "2Z¦brþïRU¾Ïgˆ‚r %§',a’zQ^XRj½7¦&6îJ´- ƒþƒÞ@' WoÊWd§þýE\`[þtÈO#"&#"32632&#"#"'&53!2654'&'"#5223 54'&#"5673767632&#"Èvm¢D¨Pb!',²-cX;b1Ò2i?‰Ä,ZnN .ër‚‚rë. >þ.þ¡˜½½˜_- > ^˜¼¼˜þ¢ >‘¤òó¤‘ ‘¤óò¤‘ ¡ªÒtÓª ªÓþÆþÇÒ« qÿã¡{&P%327654'&+"&'&'#";67>2# '&5476!36767623 !#"'&'&r-¡HVV?ª- ,4, -£GVUH£- ,4 É.þÿx‰‰t. 4 .w‰‰tþû. 4 ¤`t·§ƒa  _t¸¼p_   “‰œî颈   ˆœï袉   ÿÿvÿãút&Ò'—0'ÿÿ˜ÿã¡&Ó'üþœ•ÿÃÿÿsÿã3'àcSôÿÿ‡ÿã'à&àõsþV'ð9@  0üìüÔ´/?]ì1@ ¡ ®• ‘•/ìÌôìôì0´]!# '&76!2&'&# 3!#ú®þ¥»ÃÃÃS†vwhfst‚ÿˆˆˆ˜ðkÉÆÐShÏÐ$#GÕ_//œþØþÓ‚”ý°qþVç{9@  HEüìôÔì1@ † ˆ¹¸©/ìÌôüõî0@ € ]! '&576!2&'&#";#˜þû•—–UQQLNONP³cccc³õÉ–Ÿú#¬+qr͹rqýê;ÿ¥Ê§'''7'77'77ÊdØiØdØ}®}ØdØiØdØi®i®}µ}®}ØdØ}®}µ}®}µdµûÚÞÿBz/!"'&'&'&547676763!47676762þ¹þ3 8 Í 8 g    ý) M #&#"56763 v¢][“ˆ‹Jw}$)›/K†'*Cý³Âþ¥a"53#7þ¥òñ…†Â ”žý³Âþ¥a#55#53þ¥ò†…ñÍþõgžùÊÙ M !2%$'$'&ùʇ¯rE2 þ_ïþÙfݘL{t†\q Ï÷ÖþF` &3@MZg#.#"#> #.#"#> #.#"#> #.#"#> #.#"#> #.#"#> #.#"#> #.#"#> þÇv aWV` v ž"ž8v aWV` v ž"žù®v aWV` v ž"žfv aWV` v ž"žù®v aWV` v ž"ž·v aWV` v ž"ž÷ v aWV` v ž"ž‰v aWV` v ž"žAKKJLþQKKJLKKJLúKKJLKKJL)KKJLKKJLû˜KKJLøXýÃÂ- #)/'7'7'7%'%53-#%5#53 3#k–yo\©ûw–yo\©–zV\þãúL•yþ©[`¬@þÀøÂ¬þÀ@_Ó¤RÓÓ¤RZ–yþ©\µ–yW\þãþñ•zn[©ûw–yo\¨Ô¤‚RÔÔ¤‚R߬@þÀøÂ¬þÀ@ÿÿÉþVüm&áõuÿÿÁþV8&âš ÿÌ!ìÕ:@  Ü<Ìü<<ÌÔìÌ1@ •  •­• /ìôìôÔ<ì20!2#!#535334'&#!!276“Nûþðûý訨ʨÜON£þ¼D£NOQâÚÞÝÚQ¤àà¤ýf‹DCýÝDC&Ež 9@ E Ü<Ìü<<ÌÔìì1@ ©© ©/ìÄÔìÔ<ì204'&#!!276!2#!#5333>C€þùB>ýøÐyttsÖþ9››¸L^*.þ—.+ßþÊURþ°RRÑ>þÂÉáÕ'+#!2'674&+327'7UŒj’~ÖþÊÈû€â šþþrG×j#u~{Sý¨ÕqrÛ’-,9†’ýÏ/´~ºþV¤{)%'7654'& 32'#"'&'#367632*ŒnŠOSTþÜTSST’F“o•Wl{XY:¹¹:YX{Ì€€ ˜§]¥sÅËtstsþjts®]³.01dý® ªd01¢¢ýð¢Éj@ •üüÜÌ1/ôìÌ03!3!É÷ªý)Õ2þ$úպК· FüüÜÌÌ1µ©¼/ôìÌ03!3!ºƒ“ý¢`:þ3ü3GïÕ )@ • • Ü<Ìü<ÌÌÄ1/ôüÜ<ì20!!5!!!!!Nþù¡ý)#ýÝ”ª—ªþªýl8U` +@  Ü<Ìü<ÌÜÌ1@  © ©¼/ôüÜ<ì20!!5!!!!!?þùý¢ þ`ôªÂþÛªþ ÉþfÌÕ3@  üü<ÜÌÄüÌ1@•°••/ôìÔìôì0#!!!2+5327654&#“Ê¡ý)¡ºqmÌäL>†87||Çý9ÕªþFwrîþÎþòôªKKÂ"ŸžºþV `3@  Füü<ÜÌÄüÌ1@©½©©¼/ôìÔìüì0#!!3 +5327654'&#r¸ý¢úFRRQµÁ¬n!&&1†çþ`ªþÁGQåþòÖ``œ07“ª )(þ¿‘Õ33 3## # # 3êʪõýß׈Å)þþþÊþþþÓDýßõªÕýâý³ý"þAþéþêüÿˆMýFþå`33 3###'# 3?·éÖþnfz¸!þ‡»·»þ‡ÅÌþnÖé`ýòþQýèþL6Éþ“mÉýʱ¯ýòÿÿ‡þušð&z9«ÿÿ…þuÈ|&zÎËÉþ¿´Õ3! 3## #ÉÊÒý¿í ÅEýúþïÊÕýâý²ý#þAþéþºþå³`33 3###º·âþTwޏ8þsÅ·`ýòþOýêþL5Èþ“ɆÕ373! ###ÉÊ­dÁý¿_Üýúd­ÊÕý±TîËý²üyþ%u±þº‘`37533 ##5#º·`eBâþTãÎþse`·`ýòaÝvFþOýQ5þÅÔaþ“!†Õ33#! # ##53Éʨ¨Òý¿_Üýúþïʨ¨ÕàþŽâý²üyþéþe=‘3!!3 ###53º·dþœâþTãÎþsÅ·}}z}ý5þOýQ5Èþ“}2²Õ _@   ÔÜì2ÔÄ991@B   ¯ /<ì29ì0KSX@    <<ííííY!! # #!2Òý¿_ÜýúþïÊþ=Õýâý²üyþéþ+*‚` _@   ÔÜì2ÔÄ991@B   ¼ /<ì29ì0KSX@    <<ííííY!3 ##!*8âþTãÎþsÅ·þ`ýòþOýQ5Èþ“ÆÉþ¿Õ6@ •­•  • 8 üì2üì2<ì1/<Ììä2üì0²P]3!33##!#ÉÊÞÊÉÉÊý"ÊÕýœdúÕþAÇý9Áþå@`1@ ©¼© F ©  Füì2Ü<ìì2ì1/<Ììä2Üì03!33##!#Á¸W¸¸¸¸ý©¸`þ3Íü9þLýüÉÕ -@• •­  8 üì2üì2Ä1/<ä2üìì03!!!#!#ÉÊÞ¡ý)Êý"ÊÕýœdªúÕÇý9Áæ` +@© ©¼   Füì2Üì2Ä1/<ä2Üìì03!!!#!#Á¸Wý¢¸ý©¸`þ3ͪüJýüÉþftÕ8@üìÔ<ìÜÌüÌ1@• ­••/<Üìôìôì0#!#!!2+5327654&#;Êý"Êr¡ºqmÌäL>†87||Çý9+úÕÕýœwrîþÎþòôªKKÂ"ŸžÁþV!`3@!F üìÔ<ìÜÌüÌ1@  ©¼/<ÜÌôìÜÌ0#!#!3 +5327654'&ˆ¸ý©¸ÇúFRRQµÁ¬n!&&1†çþÆü:`þGQåþòÖ``œ07“¤&.sÿã÷ñAY%.54>323267#".'#"$&54>73267>54.#"+9lR2*DaSN}aF-?jQ&h;>e3.x=&QUW+BÃyªþô¼c[¬÷s«p8<{¾R€±?S0 $0>&1H3!(BT®1‰ªÄkBŠƒtW22Tp{:S´²ªJ¨#&4tϨ Ë}§fšÍ|}Þ§bm:†Ž‘E/fcYC(+G[`_&b«Žnqÿãxz?P4>73267.54>3232>7#"&'#".>54.#"qKц]Š[-2`ŠX'V$?/(PtMBpP-\_#D-)*%-8%7‚CFIG‡Ô‘LV"- !(,!(ƒØœX›Fr˜Xb r> %gx‚@]ŸsA9h’Y›ñ^    , T™Ö¸&^dc+KiB&HiC÷ÿÿsþu'ð'z-µÿÿqþuç{'zÕÿúþ¿éÕ ,@ @ @ ÄÜìü<ìüÄ1@ • •/Ììôì20%3##!5!!×ÉÉËýîïýîªþA+ªª<þåm` (@   ÜÜü<ìÜÌ1@ ©¼©/Ììôì20%3##!5!!¯¸¸µþB1þB™þL¶ªªÿÿÿüçÕ<=þV`o@¼  ÔK° TK°T[X¹ @8YK°TX¹ ÿÀ8YÔüI:91Ìä20@BKSXííííY"%#3 3ÅÃþ;Ã^^ÃþD¼Nü”lÿüçÕ!#!5!53 3!ßþøËþùýðÙž›Ùýðsþsªªýšfüòª=þV` !!#5!5!53 þFþúÃþïþ;Ã^^`û²XªººªXNü”l=þ¿;Õ%3## # 3 3ËpÅþ\þYÚþ/ÙsuÙþ ªþA{ý…¸ýÕ+ý3;þåy`%3## # 3 3q¸!þºþºÙ³þrÙ))Ùþk™þL¸þHJþqýßÿúþ¿GÕ5@• @ @ ÔäüäÔì<üÌ1@  • • /ì2Ìô<ì20%!33#!!5!!ÖÞÊÉÉûŽýîïýîª+úÕþA+ªªþåB`3@©  ÜÄüÄÔ<ìüÌ1@  © ¼© /ì2Ìô<ì20%!33#!!5!!xZ¸¸¸ü9þB1þB™Çü9þL¶ªª¯þ¿|Õ.@   ÜìÔ<ì2ì21@ •­ •/Ììä2ôì0%3##!"'&533!3³ÉÉËþ_ºqmÉ||x˪þAÇwrî7þÙŸžd–þå¸`F@ F  ÜìÔ<ì2ì21@ © ¼©/Ììä2Ôì°°#I°°#IRX±¸ÿÀ°8Y0%3##!"'&=33!3¸¸¸þ©™f\¸45h)¸™þL _V¸êÓu;;¾¯³Õ#"'&53;333###‚;ºqmÉ||ÖËËÖÇwrî7þÙŸž9þÇdú+ÇþÏ–`5333###5#"'&=3ù ¯¸¸¯ ™f\¸4+¤Âľû  ÄÄ_V¸êÓu;0¯³Õ$@  üì2ÔìÌ1·• ­/<ôôì0!2#4&#!#z¡ºÞÉ||þˆËÕýœéîþfŠŸžý9ÕÿÿºdKÿãð"*I@#$ $3 +Ü2ÜììôìÄ91@¡® •$­ •(•‘Œ+äôììô<ì2Ìôì076! !!267# '&'&=3%!&'& ²"–¼:Cµ»ûp‹üpoƒ„’þ¢Å¼ ªvzªKB@­b‚þH€am §ÒÒÛþ„þôþÎ`_×F$$ÍÂUgkßL> A9¿|¤¤|ÿãf{%.i@.&&K /Ü2ìÜ@ p0°0Ï0]ìôìÄ91@&†ˆ &©¹"»*¹¸"Œ/äôìä²o]2ìü<Ìô²/]ì90"'&=33676!2!32767# '&&'&#"XY`œ09Jt’ÿ⃄ü² fg·jdcbhcneþóœ”NRSˆš]\RZ¬F1—!&Å‚¡‘’úZ¾dc4®,œ”—ZZWWžþ‡ð-!&'& 76! !!267#$'&'&=3‹­b‚þH€añ"–¼:Cµ»ûp‹üpoƒmw²þý ¼ ªvzªKBm¿|¤¤|¿ §ÒÒÛþ„þôþÎ`_×F$þ£c ¦ÃTgkßL> A9þ·f{1&'&#""'&=33676!2!32767#&'&®RSˆš]\ÆY`œ09Jt’ÿ⃄ü² fg·jdcbhcOJ¦Â{””—ZZWWžRZ¬F1—!&Å‚¡‘’úZ¾dc4®,þÒ3{”ÿÿÉ“Õ,ÿÿ(vm'[uªÿÿFïH'š¨ÊÉþf5Õ32+5327654&#!#3!©‹ºqmÌäL>†87||þˆÊÊžqwrîþÎþòôªKKÂ"Ÿžý9Õý‰w¿þVˆ`3 +5327654'&#!#33^HRRQµÁ¬n!&&,‹þü¹¹%ëwGQåþòÖ``œ07“¦$)þ`þã6þVÕ!#!567!3#:Êþ„bþ‘ÔCuxÉþ’†+Ôþþªý8§.¨%5úÕªþV.þV+`%3##!56765!s¸þÞ{å¸þ{v^þ̳;bõ™™þVªdžþ’þüϙϧÔÉþf;Õ1@ 8üì2üìü<Ì1@ •­ /ä2üìÜÌ0%!#3!3+53276qý"ÊÊÞÊÎãL>†87h_ý9Õýœdú“þòôªKKÁþVˆ`/@ F Füì2Üìü<Ì1@ © ¼/ô<ÜìÜÌ0!#3!3+53276Ðý©¸¸W¸RQµÁ¬n!&ýü`þ3ÍûŒÖ``œ07ÉþVÕ!#!#3!33#;Êý"ÊÊÞÊÉþ’†Çý9ÕýœdúÕªþVÁþV@`!#!#3!33#ˆ¸ý©¸¸W¸¸þÞ{ýü`þ3Íü9™þV¯þ¿³Õ/@ ÜìÔìü22ì1@ • ­•/Ììä2ôì0%!"'&533!3##èþ_ºqmÉ||xËËɪwrî7þÙŸždú+þ¿ë–þå`G@ FÜìÔìü22ì1@ © ¼©/Ììä2Ôì°°#I° °#IRX± ¸ÿÀ°8Y0%!"'&=33!3##Hþ©™f\¸45h)¸¸¸™p_V¸êÓu;;¾û þå´ÉþVèÕ%3####! !Éþ’†+ÅþËþÄ-}-ªªþVªüúáÕüøÁþV`%3####! !H¸þÞ{å²þ˸þʲ>?™™þVª°ý'ÙüP`ýîÿÿÁyOÿÿh’'šÎJ¤´+1@oo]0ÿÿ{ÿã-&šO×Ä´"+1ÿÿhN&¤¼u´  +@ 0?  ]1ÿÿ{ÿã-&ÄjR ´-( +@(o(P-_(@-O(0-?(-( ]1ÿÿHÕˆÿÿ{ÿão{¨ÿÿÉ‹m'¡u©@@]1ÿÿqÿãH'š–É@p]1ÿÿuÿãÙðQÿÿqÿã{ÿÿuÿãÙN' ulÿÿqÿã&jTmÿÿ(vN'QuªÿÿFï'jžÊÿÿ‡ÿãšN'‡u«ÿÿ…ÿãÈ&j:Ëÿÿ ÿÁøÕyÿÿXþL/`TÿÿÉ31'qõ;¬ÿÿºyõ'q’ÿÿÌÿÿÉ3N'õu¬ÿÿºy'j’ÌÿÿsÿãÙN&²'u´ +@ @O]1ÿÿqÿãu&Òjs´ +@ @O0?]1ÿÿsÿãÙðaÿÿqÿãu{7ÿÿsÿãÙN&|'uÿÿqÿãu&}jsÿÿoÿã#N'guÁÿÿqÿãç&jâáÿÿ#½1'qr;·ÿÿ=þVõ&q^ÿ×ÿÿ#½N'ru·ÿÿ=þV&j^×ÿÿ#½k'ru·ÿÿ=þVf&Ÿ^×ÿÿ¯³N'Ìu»ÿÿ–&j^ÛÉþ¿jÕ #@ •  üü<ìÌÄ1¶•/ÌÌôì03!!3#É¡ý)ÉÉÕªûþAºþåÐ` #@ © F üü<ìÜÌ1¶©¼/ÌÌôì03!!3#ºý¢¸¸`ªüãþLÿÿÉFN&¿·uÿÿº›&ßjGþVïÕ9@  Ü<<Ìü<ÌÌÄÜÌ1@ • •/ôüÜ<ì2ÌÜÌ0!!5!!!!!!+53265Nþù¡ý)#ýÝiGR¿þéiL”ª—ªþªýì”È`nœa­8þVU`;@  Ü<ÄÌü<ÌÜÌÜÌ1@ © ©¼/ôìÜ<ü<ÌÜÌ0!!5!!!!!!+53265?þùý¢ þ`nFRÀþéjKôªÂþÛªþŒ”È`nœa­=þf*Õ%+532767 # 3 3*SfäL>‡7( þ^þYÚþ/ÙsuÙþ ¾bzªK5sxý…¸ýÕ+ý3;þVd` +527>5 # 3 dþkkCQÄÁÄO5þ½þºÙ³þrÙ))`ýßþ&9Íasœ m˜´þHJþq=;Õ3 3!!# #!5!ÙsuÙþNtþÎÙþ\þYÚÔþŒ–ÕýÕ+ýwýD{ý…¼;y` 3 3!!# #!5·þ©Ù))Ùþª þà~ÙþºþºÙþß”Ìþqþ4ýü¸þH‘´Õ &@  ÜìÔì2ì1@ •­ • /ìäôì03!!"!"$54$3!fON£Dþ¼£NONýèûþðûN·ŠCD#CD“ú+ÚÝÞÚfqõ` %@ F EüìÔì2ì1·© ¼© /ìäÔì03!!"!"'&763!5>Bþù€C>Àþ9ÖsttyÐLZ+.i.*¶û RRPRUÅ‘ÿãCÕ 09@2&)  1ÜìÔì29Ôìì1@"••­-Œ(¼1ììä2ôìì20!"32765#"'&54$3!3327653#"'&êþ¼£NOO_´KV! 3j^nîˆûNÉ?4pi;?Ênh×Ùf1ÉCDþêP_m}ŸþÝ`61‰ÊÞÚfûì[JJO›ŸýZàxx9qÿãs` 08@2F&) E1üìÔì29Ôìì1@" ©1©-Œ(¼1ìÌä2Ôìì20!"32765#"'&54763!3327653#"'&=þù€C>A@j”\-1C]^ˆ¬fetyи>¸dhÎÓd.*^\:9m4œþöl01a`¦ªRUÅýaŸPOORAþ¸ìsxx%Éÿãð7@@9., ,#8üÔìÌÔüÌìÌ1@•'•2¡®•‘-2Œ8äÌôìôììÔì904'&+5327654'&#"567632327653#"'&'&ª\]¥®¶•OOQR˜S¾rsdeY憆GGƒ‘RQ?4pi;?Ênh×Ùf0!²„JK¦;$&´ hi²|UV!bb€[JJO›ŸýZàxx8Pa«ÿãF|5G@7., ,#6ÜÄÔìÌÔììÌ1@†ˆ¹¸6©6'¹2Œ,6ÌôìÔìôü° KQXüôYì04'&+5327654'&#"5>32327653#"'&NH‰”›tCDFEwGQPabªLÄqr<=ih<>¸dhÎÇpb8f83˜,-F@.. §NO]@AHOHXDEORAþ¸ìsxueÉþV<ð):@  '+%*üÔìÌìÔüÌ1@!•¡®•‘'•(½/ììôìôìÔì90!#4'&+5327654'&#"5676323#sÉ\]¥®¶•OOQR˜S¾rsdeY憆GGƒ‘RQÉɱ…JK¦;$&´ hi²|UV!ba’þùý¬«þVƒ|)?@ !+) *ÜÄÔìÌìÔì1@†ˆ¹¸ © ©½/ììÔìôü° KQXüôYì0%3##4'&+5327654'&#"5>32È»¸¸NH‰”›tCDFEwGQPabªLÄqr<¸dhÎÇpbþ{v^þ̳;b`ýWŠORAþ¸ìsxue{†þ’þüϙϧÔÿÿÉÿã-Õ¸Áÿã`6@F  Füì2Üì2Ôüì1@ ©¼©Œ /Ìôìä2Üì0327653#"'&=!#3!ˆzgh<>¸dhÎÇpbý©¸¸W`ýWŠORAþ¸ìsxue{Ìýü`þ3Ísÿã‰ð0@  üìÜìÄì1@••• ‘ŒäôìÔüÌì0# '&76! &! !2653‰d-‰|—þ›ÄÀ¿Åe'ááþêýÛ%×{ʺà9!ÒÌÐÍҎ׿ýŸý ”¤ðqÿãF{0@ E EüìÔìÄì1@¹¹ ¹¸ŒäôìÔüÌì076!2&#"3253# '&q’– к¾Ä½bZZb½â¸Éåþü•Ž/¡nª||rþ|r|>¾Åì禞ÿúÿãfÕ/@  @@ÔäüäÌÜì1@ ••Œ Ìäôì2ì0327653#"'&5!5!×?4oi;?Ênh×Öinýîï+ü–[JJO›ŸýZàxx}âqªªÿãö`2@  ÔÜüÌÌÜì1@ ©Œ©¼ Ìôì2ôì² ]0327653#"'&5!5!x>=ih<>¸dhÎÇpbþB1¶ý®VFEORAþ¸ìsxue{~ªªÿÿ¤ÿã{ðRÿÿ…ÿãÈ|ITþf:Õ/@ ÔÔìÔììÌ1@ • ½••2ìôìôì0356765!+532765!TÝ:WxÍãM?†77þfbª0£ödþú“þòôªKLÁøýÊþøýLþVs`/@ FÔÔìÔììÌ1@ © ½©¼©2ìôìôì0356765!+532765!L»3Dõ£µF1a.&þ{X^™}¦зûŒÖÀœ0)¡áoþPÂÏT Õ35675! 3 # # !TÙ>WysuÙþ Ùþ\þYÚþ ý¸fbª/¤XþýÕ+ý3üø{ý…¸ýÊþøýL²` # # !56765! þkªÙþºþºÙ³þßþ0X^þ̶8Dõ')`ýßýÁ¸þHJƒoþPÂÏ™~±Å·þtÉèÕ32654&#!##!23 #“þšš•þêþÊÈûhÙþ Ù/ýÏ’‡†’ý³Šý¨ÕãÛ0*ý3üøºþV¨{ ##"&'#3>32&  “þkªÙþË\Ì{±:¹¹:±{ÌT%þ+§þܧ§$`ýßýÁ¡¨t¢adý® ªda¢k—‰ý–ççþj爼Õ3&$54$)!!!!!!3!!"ˆ˜dÿèýÅý;öü>þôþv7•’8þÈ’©×ÎàªþFªýãªwý‰ªþú‡tÿãw{&/!3267# '&'##.5463!632.#"%;#"wü² Í·jÇbcÐkþô˜åþ¶ÆVtš×ÙeVg⸥ˆš¹ýK€wøøw€^Z¾Ç44®*,œ˜Âþ'뉢¡þÝÄ—´®žŠS^a\ÿÿsþøÙð4ÿÿqþVZ{TÿÿD¦Õ:ÿÿV5`ZɆÕ37!#'# #3'j‡—Ýþ£ÈŽ€ž_ÜýúþïÊʯۊ—âþ›È€¡üyþéþÕý¸Üº‘`373#'##35ŒAvâæ“ŽLãÎþsÅ··K)@wé“LýQ5Èþ“`ýòPTþfsÕ%9@' !&ÔÔìÔ<ìÜÄÌì1@••!•½/<Ììôììì035675!!2+5327654&#!#!TÙ>Wx¡ºqmÌäL>†87||þˆÊþfbª/¤XþýœwrîþÎþòôªKKÂ"Ÿžý9+¸ýÊþøýLþV `'9@)"#(ÔÔìÔ<ìÜÄÌì1@©©#©¼½!/<Ììôììì0356765!3 +5327654'&#!#!L¶8DõúFRRQµÁ¬n!&&,‹þü¸þ{X^™~±Å·þGQåþòÕa`œ07“¦$)þÍoþPÂÏÉþftÕ!?@ #8"üì2ü<ì2ÔÌìÌ1@•½•­ /<ä2ü<ì2üì03!3!2+5327654&#!#!#ÉÊÞÊ¡ºqmÌäL>†87||þˆÊý"ÊÕýœdýœwrîþÎþòôªKKÂ"Ÿžý9Çý9ºþV`#@@ % !F$üì2Ü<ì2ÜÄÌì1@©©!©¼½#/Ìì<ä2Üììì03!33 +5327654'&#!#!#º¹U¹úFRRQµÁ¬n!&&,‹þü¹ý«¹`þ7ÉþGQåþòÕa`œ07“¦$)þýüÉþ¿Õ !!#!3#qý"ÊrÉÉ+úÕÕúÕþAºþå9` 3##!#¸¸¹ý«¹`ü9þLÍü3`²ÿÄpÕ#653&'# 33267.'ˆ'U.,ËaOYFqlE¯kþëþÙË*YŒb?f)6^&ã4Z)e¹‹ü\å3'ž4H./)%¤üux«m3-`4²3ò3! #54.#"!!²"$Ë+Z‹`b‹Z*¶üJ¤%)þÙþÙ9 y«m22m«yþç¯þ=]Õò#3##!".4>3 4.#"3ÛúúËþ‘‹Ø”MM”ØŒ"Ë*ZŠ`iV%,[‹_r¯þ=ÃPŽÄèÅQþÖþÜþÎy«m2:dˆž„_5ZËò!4.#"#5! 3#*ZŒa`‹Z+Ë$"úú‹y«m22m«y 9''þ×þÛþίþ=²ÿã3Õ!!32>=3! }¶üJ*Z‹b`‹Z+ËþÜþçþèþÞÕþ‹¯þ™y«m22m«y 9þÙþÙ)%¤²Šó)!!332>54."#54> Š3Tmqn,äûdËV=™—uG0fžÜœc.ËL™å2ëŸRg´™|]= ªL¢+S{¢Çug«yC@p—VGKyÒšXZ¥ç¼íÕ %!!3!!‡ÛüZËfüš¯¯Õþ‹¯²3ò3! #54.#"!²"$Ë+Z‹`b‹Z*¶¤%)þÙþÙ9 y«m22m«yý$¯²ÿã®ò)8"#4> 3##".4>;54.2>5#"Ãð¯q6Ë[«ö6ö«[ÎÎBt¡^_ŸtADuŸ[ê5oþÈ%AXhV>"ê9Z>N2m«yüu¤“Ý”JJ”Ý“4¯þ×k£n9:s¯ê¨l3z­müá¨pBAkP#?]ÿãÕÕ##".4>3!33#!"3265ÛIÕ‹ŒØ”MM”Ø‹oËúúýÅ_‹[,%ViÀ®W’é¢W]ÑèО\uþ‹¯Bnž”sE÷òA¼3Õ3>32#54."#¼Ë?¼vŠÔ’KË+Z‹À‹[+ËÕþ MIH“Ý–K2y«m22l¬yýó¼DÕ!!‡½üxÕúÚ¯Õ¼ÿãËÕ2>53".5!#3Ê6Tf`bQ3ËH€°Ò³„KþˆËË`ý1Kf>>fKÏýIw«o55o«wüOÕþ‹ÿæð+>33>32.#"#".5467#32>54.$+ ËNB™£¨R=3)ËE¶vŠÔ’KË+Z‹À‹[+Ëã?CH“Ý–&ýóy«m22l«z˜FÿÊÕ%.>76$73ü>g? ;‹w›8¤ÏîqËÁ»`g_ 8/˜Î@9L`uŠPh¦G/þ‰+Xam@E\>&¨ÿЀó5C4>32>54."#54> .'#".%"3267.·;e„Hxív(A//dŸàb,ËNšå,ë T"?W68m8ˆ6o8nù~G„f=l!?1XXV°Q^¯ IrN(`P2s|†Fg®}F@p—VGKyÒšXX£çV¥œŽ?-_3Ž4e0Yd$KqÜ$3 AOH@BPdÕò%3!4.#"#5! Ûúþ;+ZŒab‹Y)Ë !¯¯‹y«m24m«w 9''þÖþÜi¹â$"!".>7>73>33!&-p|…CtûÄBnK#QMC¡Yþäó¼PŸ–ˆ8ü‘PDYMôýêG)#@[9ür¤ El™È~mÉX—þîBkJ(ü~…©`#ûJ¦²ÿã#Õ! 332>5!)þßþæþäþàË*YŒbaŒY*Å&ý þÝþÕ''¤üux«m33m«x‹¯’ÿãYñ7 .5332>54&#!5!2>54& #4>2YM™æþÎå˜LË+`›qp›^*ÊÉý°PQwM%ŸþÊ ËJˆ¿êÀ‰L%@T.DuW2¼g­~GJ‚¯eArW22Vp>€¯'C\5vqr{_•g65f“];hS<?[vÿãqÕ32>=3! #5Å)ZŒcb‹Y)ËþßþåþæþßúÕüux«m33nªx 9þÜþÖ-!ô° ÿâyÕ..+532%.#"32>=3#".54>7d8ŠUÛj¢Gkþ–@*oº‡KÐÓi›e2ËRœä‘’é£XNнoªþþÔ” H†Àyðø54&#"#54> MÃüûíJ*r»„IÒÐh›f2ËRœã$é£WK‰½éUÎEÔg V”Æqßï32#4.gËV‹b4Ëf¶ø“ÿµcË8fŽGü”l Ip•X*9‚ÙœWWœÙ‚ü\•O•vO¨}ó";".5&>32!!332676&%4.#"32>VxP.Oœå“ ìœML…·lÙûdËNQÃ_(¢Õ0ežokže.+K;y±m'+H5›#9GG@k”X^§åˆyݼ”1ªL¢?=²Ãædª{E9d‡M&7%@rœ[-jx‡²#ò!4.#"#! 3#^*ZŒa`‹Z+Ë$"úú‹y«m22m«yüu¤''þ×þÛþίþ=ÿÿ²ÿã)Õ8dÕÕ)#".=32>533Õþ;AºvŠÔ’KË+Z‹À‹[+ËúóHJH“Ý–±˜y«m22l«z úÚ–ÿãî=332>54.'.'&>2#.#" .–Ë5`‡RPˆd86a‰TCq_F(I‡¿êÃNË'NzVOxO$&KqPˆÕ”NR–ÕþüÒ•PÃDtT0 DiI:U=( -?XsKZšr@=l‘T,TB)'F_72I5% Bi™nf¤s=K‚¯²)ò3! #54.#"²"(Ë,\Œ`bŠX)¤%)þÝþÕ9 y«m22m«yüu ÿãgñ1@ .5332>54&#!53.54>22>54& gM™æþÎå˜LË+`›qp›^*ÊÉý°à 7(Jˆ¿êÀ‰L%@T.DuW2ý›QwM%ŸþÊ D|¼g­~GJ‚¯eArW22Vp>€¯2?J)_•g65f“];hS<?[vg'C\5vst{&UJ0¼MÕ!!#‡Æý:ËÕþ‹¯üOÕxÕ'3>4.'.>753#×ÁÑÑÁË]•h88h•]ˇà XX à‡Ë‡à¡ZZ¡à‡ËŽÙþvØ;k˜Ä™l;üT–Õ Ö˜TŸŸT˜ÖþôÕ˜T2nò+".'!!#5#53!22>4."*>n^K˜üh˾¾"‹Ù”MM”Øþ$VÒŽU%&WŽÐŒV×%4þ毚š¯e$ N‹ÂèÁŠMZœ\22[ž…a67aÿÿsÿãÙð2nÿæøÕ)3 $.=3".546;2%"4.#>ødºþùþºþú·bË7>53o:Z=z3^†SB[9z.ZˆÃ$9H(@{b?%9H(G{^;ÿÿÿÿðÞfCÿUè5í)#&>32#".'332>54.'&umG~®f?z`< =[<'OC1†& 0B&J…e;ðy¾‚D"FnL0R>#+G3 %'<*.c“Zñ²3!ZŒÌñ#©z®ÿä`*%#".5332>5332>53#5#"&¢E¿ƒWˆ]1¹:V;GrQ+¹qxFrP+¹¹?°y|¨Ö~t?x°q¤ýNQqH 1\ƒRzýb£›2]‚Qzû ®iazºþVd{5#"!!#3>32¬ø•¬ñý¹¹B²vÂÅÂÜ=¾¤þ' þV ®fcîéâqþV/{(2>54."##".>32533#/+Qt’uQ+,Qt’tQ¸:°}f¨yCCy¨f}°:¸ÕՔʡp<323e¹ø•¬¹¹B²vÂÆÕþVH=¾¤ý‡`®fcîéýü ®ÿãb3!!3276=3#5#"'&®¸üý>=}˜TV¸¸C°vÁddºZþL þŸPO_b¡ëý0¬gbxwqþV/{-3!#".>325332>54.#"ZÕþs:°}f¨yCCy¨f}°:¸üÕ!IxW<]F0 !KwW<]E0 þö RdaU›ÙÙ›UadªýÏNœ{M%AUaf0N›|M&@V`fºì )3!!!—ý#¸zý†%þL üàºþVd{!#"!!3>32¬ø•¬ñüV¹B²vÂÅž=¾¤ü}  ®fcîéý\ºþVè{,<!4.#"#3>323##".4>!"32>f1Hv—ORŒg;¹¹*cmv=Dˆ~mQ.’–`”FH`87ZsfþÖ2(+@)QQD/d¡p=)ZŽeûë ª5".54>3!33¢þÆItQ++QtIQvM&¸Bºò»B@»{<¸ÕÀ5f•ae¡p<32d¸ø•¬¹¹B²vÂŤý\ž=¾¤ûݾýžfcîºþVl`3!3rúþN¸þö  ºþV*32>53#5#".5#"#3>32HqxFrP+¹¹?°y=kD÷KnH$¹¹AWh;ÃĤ⣛2]‚Qzû ®ia)e©=2\ƒQûݾýž'I7"ìqÿãt-3!#".54>732>54.'#"ÂÔ¤B7}C=DƒÀöÀ‚D>oš[á(QwPOxP(+G4‡NxQ)  âÒ NׄzΗUU—ÎzxÆ”^ýÀS•oAAo•SMwcV,Euš®þVX3327653##"&®¸ø•VW¸¸C°vÂǺZû­þÂ_^¥{ùöVgbïÿÿºdKjÿâ0-B#5#".7>7.54?37>32>=4.'<4©³¸H\pCbœj7>mš^D];"$Ç*.GW(9þ !CeDMxR+EpQ=lR0,± dþå¹ýÿ¬-J6Bxªi`·­£K 4GS)D59?;-?""ü EsS-7]{DV5wuh&2u‡šºþV9{!#"#3>329þsø•¬¹¹B²vÂÅþö H=¾¤ý‡`®fcîéüRŒÿãZ$(>53>32&#"32#5#".'&732>=4.+ŒÄ7§Ák-42Grb*wÑœZ¸F\tEf—f568V-Ia8FsS.*bŸuG* ¶ª`¥zE½*Kh=LŠÂwý¯®,J6Ar›Zƒ‹ýýXuF3[|Ih@†mEA‡„~®ÿã-332>5!##5#"&®¸øKwS-Õ¸C°vÃÆº¦ýaþÂ2\ƒQ/ úŒ¬gbîÿÔþVr` 3+53265º¸£µF1iL`ûŒÖÀœa™ÿÙÿãX!32>53#5#"&5#'øKwS-¸¸C°vÃÆÕû­þÂ2\ƒQ{û ¬gbîéºþV{{13!!".54>54.#"5>32Á Pýt*D07.54>737>7üúýÖ$F7!#0D(·YËȸE  ®þV`*%#".5332>5332>53##"&¢E¿ƒWˆ]1¹:V;GrQ+¹qxFrP+¹¹?°y|¨Ö~t?x°q¤ýNQqH 1\ƒRzýb£›2]‚QzùöXiaznþVô|,D3!!".5467>'.54>32%">54.ô32!!5>54.ÁO|V-¹¹?½yc¢t?!=V5)ýý?`B"#GlÛ4ZzFýs`¬afF}®gS‹{q9 „4myŠPIa8ÿÿ®ÿãX{X®þV-332>533!#"&®¸øKwS-¸ÕþsC°vÃÆº¦ýaþÂ2\ƒQ/øâ Vgbî®ÿã{'3>32##"#5#"&5332>¸!OW[,Ãĸø32d¸øKwS,¹¹B²vÃĤý\ž=2\ƒQûÝ ®gbìÿÿoþVX{Jþº˜`%!!3r&ý"¸  `®þV'3>32##"##"&5332>¸!OW[,Ãĸø9jQ1¸C±dÃÆ¸ø?oS0å/ýž3K2ìëý\ž=/Z„UûÝVgbîé¦ýaþÂ/[„)þV¤{,%!!#5#533>32#"&4."2>sü빑‘¹:°|f¨zCCz¨f|°8+Qt’tQ++Qt’uP+¨þ¨›__›ªdaV›ØþúØ›Vaëd¡p=;2%"4.#2>!g´ó‹¸W¤‘xV0´Pƒ©Zbœo;;oœb¸Žó²ý}t{ E}°jj°}ÇþøÖ—RþVª'Ig€•S]VW˜rB+OnCHpM'þLF‰Ï&OHBMý€À_/üæ9k®ÿã~%!!5#"&5332>73X&ý"C°vÃÆ¸øIuT.¸  ¬gbîéZû­þÂ/X}MŒðÃR73#3#ðÓÓÓÓþþRþd²ƒ%$'d ˆþõˆƒZZ¤-,DþCÚÿÓ´ Ü<Ì21¶ÜÜÜI:03#3#D––––-–d–ÿÿ«þC‚ÿÓ'¨þä°KRX»@8<1YÿþC¢ÿÓ %¶  Ü<Ü<ÜÌ1@  Ü<Ü<ÜI:05!73#3#ÿ}––––Ö–––d–ÿþC¢ÿÓ.@ Ü<Ü<ÜÜÜÌ1@   Ü<Ü<<ÌÜI:03#3#'#5#5! ––––ú–}-–d–úÈÈ––Dþ»ÚÿQµÜÌ1ÜÌ03#D––¯–ÿÿÇþ»WÿQ&}ƒ²ISX¹@8Y1ÇþCWÿÓ O@   ÔÌÜÌÜI:1²ISXA @ÿÀ88Y@    Ü<Ü<ÜI:03#3#73#D––}––ú––þÙ––––cþ»»ÿQµÜÌ1ÜÌ0!!cXý¨¯–cþu»ÿ¡´ ÜÜÜÌ1´ÜÜ<Ì0#5#5!Ú–áXõ––––––µÔÌ1ÜÌ03#––––ÿÿ––ÿÿ/þ¹ÿÝ'ßÿ`&åöþëŒ=² ISX¹ ÿÀ8Y³ I:1² ISX¹ ÿÀ8Y² ISX¹ÿÀ8Y³ I:0Nåä{µÔÌ1ÜÌ03#N––{–DþCÚÿÓµÜÌ1ÜÌ03#D––-þpdÆj!!dýåj¤c»–µÔÌ1ÜÌ0!!cXý¨––Ñÿ8‹(´ÔìÌ1²ÌÌ0´@P]3#Ѻº(ú¯–µÔÌ1ÜÌ03#––––Å[–µÔÌ1ÜÌ03#Å––––Ñ‹`#¶ Ô2ì2Ì1´¼/ÌôÌ0´@ P ]3#3#Ѻººº`Êý4ÊfÜ` ¶  ÔìÔÌÌ1¶©¼ © /ìôì06;#"!!fÍã’”†n¼ýŠ^ô–ÂþcþC»ÿÓ´ ÜÜÜÌ1´ÜÜ<Ì0#5#5!Ú–áXÃúú––ºŸ`'o·)F·  F(üìÔüÜ·o_²?]ìÔK°SX¹ÿÀ8Yüü·J:)z²D]K° QX¹)ÿÀ8Y1´¼ //üÄ·::U[ ¶ejy ]0 ##54>73>53€Ùþ`#8!¸2-A,þäÙ #8"¸2.@,›þeX5AnEþô¹QŠ`Q2, ›ý¨ 6AnE ¹R‰aQ1,XH`6·ÜÔÜüÜÜ´t o]1K° QX¹ÿÀ8Y·© ¼©©°/ììüì0%4.#!5!23!5è &EyWþ¶J{±tE¦üÏKcf:%.U‹¦rþUXÿö`?·!± ÜÔÔìÜìÌ´t\]K°QK° SZX}°/Y1·©¼ © °//ìüì0#&'#"'532>54.+532EMÇ:!FPP7.3"$,EV8(3e\Z`ÝË^þÀއpQg6© 4[ªu—¡;ôX`(¶ ÜÜüÜÜ1K° QX¹ ÿÀ8Yµ©¼/üüÄ0##!5!ƺýÁ¿Ñü/Ѻ€`<·F ²FüìÔÔüü´p j ]K° QX¹ÿÀ8Y1· © ¼°//ÔÄüü0##4&#!5! ˆ¹±¹ºþ.Ðá¬ýT`&ýÆ`Ø™úºt`!¶FFüüüK° QX¹ÿÀ8Y1²¼/ä0#tº`û `Xm` E¶ ÜÜüÜÜ1K°SK°QZX|°/³jZ´j Z ]1YK° QX¹ÿÀ8Yµ © ¼/üüÄ0#"#467#5mPWAºM8ø`›½ý‡y²'º€` 7·F ±FüüÜüü²p ]K° QX¹ÿÀ8Y1µ© ¼//üì²t]0#4&#!#! €º‚¸þç¹Ðâ^ý¢yÆ’ü/`ð¹ÿã¿k[·! ±F üüÜÜ·tp / ²  ]üÜ1K° QX¹!ÿÀ8Y·©¼ ©°/ìüÄìµl nnµ\ ^^·D D4 4° ]02>54.#"5632 r-Yt tY-0ZCB]rWfT%üýòü`ý´t¢[(([¢tq}=QŸÒþÔþó ,Dˆ¢B`#´ÜüÜ1K° QX¹ÿÀ8Y´¼ä/Ä0Bº`ýŽL¾XþV’`8¶F ÜÜüü´a _ ]K° QX¹ÿÀ8Y1¶ © ¼½ìüì¶_O?]0#4.#!5!2’º2X]þû¨Ö†5îüh˜r›uB=—èXÊ`5¶ÜÔÜüÜ·OO??°]1K° QX¹ÿÀ8Y¶©¼© /ìüì0!2#!5!2>4.#!XXu»xP""Px»uþ¨XdN""Ndþ¨`@k’¬’k@Ž>u‘¼‘u>XðÕ6· ² ÜüÜüÔ²]üÜ1K° QX¹ ÿÀ8Y¶©¼/üÌüÄ0!!3”ýC»ÝþWÑþ‹nüº•`4·F ±FüüÜüü1K° QX¹ÿÀ8Y¶ ©¼ ©/ìôì´o ~ ]0)!2!4&#•ü%ãÀw4üßg‚¹`:½Šsü¾êÆ’Xµp%d·'F ´&ÜìÔ²p]üÜÜüü·J#:#*##·h#Z#Jh´s #]K° QX¹'ÿÀ8Y1·© ¼©°//ìüÔü·Xl\v²]03>3 !5!4&#"#>54XÙBMLbL3’ýÎxza´V0*bºP]` NFd6ýîý¢ŽÐû [Îþ¢I3'@ºþVt`$¶FFüüüK° QX¹ÿÀ8Y1´½¼ää0#tº`ùö Xx` 1·F  ÜÔÜüüK° QX¹ÿÀ8Y1¶©¼ © /ìüì´ ]0%4&+532!5¾dj~~Í»ýàX{o±Ýý.¹ÿã¿` ]·  F°üüܲ]üܶJ < `]1·YTid°]K° QX¹ÿÀ8Y· ©¼©/ìüü·44 && ·BB Rd°]0!  ! 4.¹çÿýúÿçþÒ”-_`úþÔþÐþÙ'0þkþI¿uœX$XÿBH`K·F ±ÜÄüÜüü¶>   ]1K° QX¹ÿÀ8Y·© © ¼±¼ääÔìä´]0´g G ]35%3>ˆÀ1XˆÂ‚þ€$þÔ„FDþäv²¯ˆj/‹©h ü29–ºþVd`^·F ²FüüÔÜüü1K° QX¹ÿÀ8Y·© ©¼±½ìüüÜ·J  / °]K°PK°SZX¹ @8Yü·j\J°]0#4&+327#"&5! dº‘©ýGJ)CRC†›¶ä^ûø СðIE ˜”°dõºŽ`j· ²FüÄüÔÜ´_ ? ]üÜ·== KK °]1K° QX¹ÿÀ8Y·©©¼ ±©/ìüü}ܲ_q¶pPJ]K°PK°SZX¹@8Yü0! )5!2654&+327#"&5ºª(þ×þÿþV^ìÑØä¥HJ)CRC†›`þÜýèþÜŽÀîÛºÞIE ˜”°XþVùcG·³ÜüÔüÄܲ]üÜ·6DT°]1K° QX¹ÿÀ8Yµ¼½ìüIJ7]0>=3#4.'%Ÿf:uh¸=h€Hº9=1Ócä’™.ׄ„oº~Sü†&P«jI9X`l·F  ²ÜÄüܰ KQ°KSZX¹ @8± /YüÄü·<;?H·lY_J¶i|= ]1K° QX¹ÿÀ8Yµ ¼©/ìüÄ·T8Tt°]0%367>53!5ôýdÚƒ,¸.&=$üSŽÒýÉ47Z7 ¹J}XM./þŽGŽºþV_ R°·  ´F üÔüÜüÔ·O_o°]üÌ1K° QX¹ ÿÀ8Y·©¼½°/ìüüÜIJ¯]´@ P q0 !5!ŒºÓ”üWþWþVVLûöªÑŽnüXÊ`@¶F ÜÜüì1°KT°KT[X° /1YK° QX¹ÿÀ8Y´ © ¼/üì0K°PX±//0Y#4.#!5!2ʺ3P~Rþ°O~¿zM:ýÆ:IviF)5]¡XS`(¢·* ¶)ÜÔüüÜ´]üÜ·H;+·P`p°]üÜK° PX»ÿÀÿÀ881±/}/Y· 0WW°]1·fgwv²‡]K° QX¹*ÿÀ8Y·©¼±©/ìüÄÄÜ·¯/Ÿ°]ì¶CC"H%]0!#3>732>73®¼š¹I0K8( ¥)l_§+b—’kcE8" ¹*=Ki«Ë`ýñ!#@5]Ey+þüg«E=þÍ(Ci’Åú¦ü䣉W=ÿøˆ`I· F ³ÜÔüüÜüü1´ÐÐ]K° QX¹ ÿÀ8Y·© ©©²¼/üìüÔü¶j[]0#4.+#"'53265#5!2ˆº $@pPö{˜5NA&G.­]Ál,^ý¢`Jce:%ýÍÖÐr£3CŠ´ÿÿº `'+–+ÿÿˆ¨`'+4/ÿÿˆ¢`'/=/ºä™`@ ´¼DÔì1ôì03#ÒÇþº™`þ„ºän`@´¼DDÔìÜì1ô<ì203#3#§Çþº™½Çþº™`þ„|þ„ÿ×Ü"%0#4'&'37676537653#"'% '##5± rb{ .q & q-aT !ýö}þÁBý®s12jÿî{¢Í@E#$]} q«!<"iúÅbP-üF`ÿ×Ü)*5"2767#"'&54767&'&5&76 '##5¨M@V:118UF%/>7P6.N@?^G?D)7-#ŽFý–}þÁBý®s)^ &# \*$@.") n F>]KH*!#TH#úÅbP-üF`…z %3#%3#3#%3#Æ´´þ>´´ý´´” ý^ úúúúúúúì…< %3#%3#%3#3#%3#ˆ´´þ>´´þ>´´ý´´” ý^ úúúúúúúúúìÛì!#53®Ó¤R¬@þÀüýñ 327654'&+533676Í7N5G4¯pQf$h?FA@6b ! ¨eþ¿I(R[2*Û #53 3#®Ó¤RÓÓÓ%¬@þÀý-þ“°ð$%#5754&'./.54632.#"¼Ë'/XZH߸gÁ^a³Olƒ39ZZ8þþþ“{4<5/VV‰LŸÂ89¼CFnY1^5YV‚eš£UÞ"756767&'&54767632&767£/SD4Ž35gcbnZdF31`È9:H:ZÍçU°!LOTAKv?=¹0ps2#¹pÿÿlþ Ã'}ÿTÿÿ‚þóÀµ'|ÿôþ>qÁy3#Á¸¸ùìÿÿ‚þ¢ë&Ž!9þ¢ÿÿ‹ÿÆ &o"ú„ÿÿ‚ÿìë &Ž"¼Šÿÿ‚ÿìë&Ž#¼Šÿÿþ (f&Z!þ (f$3  !27# '&5767"Ã$ÄþÚ×àJKÁÔ–úþ^©ƒÔ`‰eŸ~h'?6š§®þû‡`¤v¸c–àße4-ÿÿþ (°&Z!?}ÿÚR%67654'&'3#"'532‡¬#þ¢›—¸€Šÿÿÿ«þ b¶&^!q ‚þ î?%#&'$473327676'&/3327653323#"'&'üT…ÁPx€mþíi¸l“_Qb_y^@@¸$;sR,%¸@nޏ\Kf% I0Š1_2F„,³kª>GHö´Îܳ&%0žlŽ}=êœJ"5Œþ^ó.327654'&'&#"&#4763&547632#bzL,5;(.;Dn2KÈxAZ¢M\MO¶bxX²'*9:X DD(ÁNOþì­f7*(”„?$S§-8’APÿÿ“þµH¶&Ó!? ‹ÿÆ Þ"327654'&'2#"'&5476»B!799[]KB{˜Æ¶“¥„`Q§%T*WE{R,,9.UMAx³ |”ÈKU#JïµN¹ÿ«þ @† &"34'&!5 767"'&'&547632î?,3/ÀV%.¬_]Àþ“g†¨>v-–(tYh‰YH‚Ä9!$3/,¸;þôþÌ X*V¸L_” !"b‰Wg3Zf‚þóÀJ6%#"'$47376767654'&'&'&'4762#&'&'&Vfþ©±xHþÛ?¸B¤a=~±T;~BrC:@¾_Ð`¸ B(EN><}ø9M ªI&huqƒc“- !P85J.39s–J%*=­=!'&"7*S@UYDÿÿ‚þ ÀJ&q"ôþ ܺ$š5%5%ÜHý¸Hªn‚nþŽn‚nܺ$ý&567&'&54763233"/#"'&5332767654&#" %!lE?I(7 /4KU^r8Z #08Ÿ " -d$* 9^W4'6O'&n=NVš)qaKî" %Üþ$ÿö5%%5%ÜHý¸Hþn‚nnn‚nܺ$ª5%ÜHºn‚nܹ$ý-&'&5476323"'&'#5276767654&#") lE?I(7$# +EÈ“˜‹V " -º 8_W4'6O -n=*{nmp" %Üþè$ÿØ5%ÜHþèn‚nÈË8ô(#"'&54737676533254'3'&!9EO)"a 2=`YG g -SG„L(E?4mmb}8T"ªRY$6îs9It…6Y !ìá 4&#"32>"&462–X@AWWA@XzŸæŸŸæô?XW@AWX³æ  æŸ˜¹hÁ732767#"'&'˜ gC*6:)kXZZC5"LMD¥6{S )L}@F€ÿÿO¿¦w‘ÕÿÿÿOþ ¦ÿđոÚÜë$/-#"'&547.#526763"327654'&× lE?I(7$# +EÈ“˜‹V " -. 8_W4'6O -n=*{nmp" %óî 4373¶Ã‹‚‚‹ÃîFÃÃþº¸Â”¼3#¸Üܼú¼ !#'3¼´%1œÄyI ©Ü!nþÝþ”›Rð#'337673#"¦ ´%1œÇBR´{6´)cóoajr›þ©Ü!n›˜•UPymþúL%#'37676537653#"'« ´%1œÄ/(/H´/; ´'G›… 44.5WY¾þ9©Ü!nr|> @2¦Þ%,*ÊþÏ;l>3 ¯ÿì§ *"2767#"'&54767&'&'&76#zfˆ\MOY‡p0;JcX~VI|ee•pdkAXH,7âp ¨4C@#90¤L@rRiUZ‡hÔÀ®ÇsBBsÇ®Àþ¡ë³þËuu5³ëaUò#'#"'532N%bÄU`޲§´¥ÒþÜþŸþëþ†DK*‘2´2<!&'3673ÌbŸ~ÄšZ00ZšÄ¥xUö:þæþÊþŨ ¨;6þÓþIþÊú<3#&'#6Ì´Ux¥ÄšZ00ZšÄ~ŸbúþÊþIþÓ6;¨ ¨þÅþÊæþ:dò#"'&'&547632#54'&#"¿Î=­:i_{•š\ %ZÄ[,,G\O98<SGU37e{a}Uw¦‡–þÍþ¤œnWl42@B^!xþ©–$%-`+-!d! M fMÿÿ‚ÿìë™&ŽK„ý¨ÿÿ‚ÿìë&Ž%9„ÿÿ‚þ ë&Ž%9ÿÿÿ‚þë &Ž'"¼Š2©þÿÿ‚ÿìë¶&Ž$¼ ÿÿ‚þ ë&Ž$¼ÿÿÿ‚ÿìë&Ž&¼„ÿÿ‚þ ë&Ž&¼ÿÿÿþ (¯&Z|Šÿ8ÿÿþ (ª&Z%?ÿÿþ (f&Z"Šÿÿþ (f&Z%¯ÿÿþ (ª&Z#Âÿÿþ (f&Z$––ÿÿþ (f&Z&–¯ÿÿ}ÿÚ÷&\KÿÂÿÿÿ}þR&\2þÿÿ}þ¢R&\!©þ¢ÿÿ}þ¢÷'!©þ¢&\KÿÂÿÿÿ}ÿÚ°&\"úÿÿ}þÔR&\"+þÔÿÿ}ÿÚª&\#úÿÿ}ÿÚx&\$úâÿÿ}ÿÚª&\&úÿÿÿ«þ Á/'K¼þ>^ÿÿÿ«þ Ér'¼þ>^ÿÿÿ«þ &&^2Xþ ÿÿÿ«þ Ê&&^!4þHÿÿÿ«þ &'ù^ÿÿÿ«þ Ê&'!4þH&^!´(ÿÿÿ«þ „¶&^"ô ÿÿÿ«þ „°&^#ô ÿÿÿ«þ „°&^&ôÿÿ‚þ ¶&`'!_ !õþ¢ÿÿ‚þ î&`$xÿÿÿ‚þ °&`'#â $xÿÿÿ‚þ å&b"xþ¢ÿÿ‚þ °&b#~ ÿÿÜ&d#„Rÿÿuþ ²@&f#,°‚ÿ¤žÙ:654'&32! '$&73! 76767#"'&54767632µ)B,4((7(*H³nþÃþïþáþÙ‚þ·@¸AËZAÑ×d#?z…Kb–NLZB`.+M;3*)3P&þÚ´F=)d Š\^ˆtL"9;l&NKCW4,”E$2Hf6‰âÿÿ‚þ¢žÙ&º!kþ¢ÿÿ‚þ¢ž&º'!õ~!kþ¢ÿÿ‚ÿ¤ž&º#x~ÿÿ‚ý¨žÙ&º$îþ¢ÿÿ‚ÿ¤ž&º&xxÿÿkþH›&!Ï~ÿÿkþH›&#R~‚ÿ§)-%2767654'&54767#"'$473¸Â$6þÊ2 #déý­Gf>5þ÷ã¡À€þ¶?¸AËhXPA7.EB|=Q#!w*6ºú(  %þ¶{{qeVUI&b Š\^ˆ~B"‚ÿ§.54767!#!"'$4733!2$6=4'%$Ç ¢°`üh_ ®Êø>5þ¡þ À€þ¶?¸AËh—ô¸m/yüYþk>ba›ýè7# #5–&øqeVž&b Š\^ˆ~B"–jj‘7ÿÿ‚ÿ§)&Â2F„ÿÿÿÉÇ&k!îFÿÿÿÉÇÖ&k#qFÿÿý¨Ç&k$Xþ¢ÿÿ‚ÿ§)+&ÂEÊÿÿ‚ÿ§)+&È2F„ÿÿ‚ÿ§):&È"„¤ÿÿ‚þ¢)+&È"Xþ¢ÿÿ‚ý¨)+&È%Õþ¢ÿÿ‚ÿ§)4&È#„¤ÿÿþÈÉÄ&l¼ÿÿþÈž&l!jÿÿþÈx4&l#è¤ÿÿüà&l$&ýÚÿÿ“ývH¶&Ó'!? !¼ýv“þµHî#"'$47332767654'3HdnùaP„mþ¸/¸1É]]LGÁL"f¸h8­²ÅD%jdëQ¬í45Þb`¸Þœÿÿ“þµH&ÓKÈþ%ÿÿ“ý]H¶&Ó'!? 2&ý]ÿÿ“þµH°&Ó#ô ÿ½å 2?4#">#"'&54733267&'&547632&'5#"32764&__A-D$Il–n9eÁ¸|8-H,-C,QÚÝN(J¯„b41}>í‡XA%v3ˆþhO =¬J6>(E& !B„QHJQS'¹Bµþïþõg=q?%'“i!.C]“ÿÿþ (°'$––&Z!?ÿÿÿ«þ @r'ÿôþ>pÿÿÿ«þ @Õ'wÿ¤ýØpÿÿÿ«þ @4'ÿìþpÿÿÿ«þ @°'#, pÿÿ‚þóÀJqÿÿ‚þóÀr&qÿôþ>ÿÿ‚üþÀJ'%Šýøqÿÿ‹ÿÆ Þoÿÿ¸Â”¼€ÿÿ¼ÿÿRð‚ÿÿLƒRÅ%'&547632&767#"'#'3ÈX\lTX\D8/0EÃ=’ ´%1œÇBx:=œ$!"4'´Qjr›þ©Ü!n›8jÿõâ$(327654'&#"327#"'&5732#"€-2!WZWXZV%2-Z(‘ .5_³ªŸ¾_52œ‘Z¡JkVרààÕÚ<…J¡Ð•ž¸y&ÄvþŠ»þÑ‹¦žÐ 3767"'&547632&#"327ÐAoDdN.†bpŒxXWs>0B7,gŒ`áp†5ÿµoU%m—®ao´3/AbM3))´I˜·áÿÿ<‡ÿÿ<ˆÿÿdò‰‡ÿãð (@  üìôìì1@    ‘Œäôìì0"32$  ‹œœþhö þ÷þ þ÷PþÍþÌþÍþÍ3343 þsþ†þ‡þsyzáZÕ (@  ÔìÌüü1@     /ì2ôìÔì0%!5!3%=ü¤JÊeþ™ªªª+H¸Hûá=Õ · Üì2Ôì1¶  /ä2Ôì03!#3uÈýlÈÈçîýhüÃÕþá=Õ ¶  Ü2Ôì21·   /ìôÔì0)5!!5!3=ü¤”ýl”Ȫ¹ªÈá=Õ ·  ÜìÔ2ì1·  /ìäÔì0%!!!3!©”ü¤”Èýlªª ÈüŽá=ÕµÜì2Ä1¶  /äÔì0!#3!=ýlÈÈ”Öý*Õý«á=Õ¶ÜìÔì1µ /äÔì0!#!3!=ÈýlÈ”crý8ÖAÕ'µÜüÌ91´/ìÜÌ0¶‡‡ìì#3Aý“þÉSuÃüNÕúÛÅÖAÕ (¶  Üü<Ü̵  /ôÜì´Ü<10%!3!#ŸþþÉÉ¢ý“þ°þ ÃüN{î 2@ EEüìܲ@]ü9Üìì1@ • •‘ /ôìÔ<ì02>4."#&'.4>329[œ¸ZZ¸œ_ÈPGr……䆇䄄rEM»p`77`p_88úæ 1§Å§bb§Å§1 ÁyÕ@ ¯üüì1/ì03#Á¸¸Õú+qÿã!“/@ E  EôìÔ¶ 0   ]ìì1@    ŒôìÔì0 6&    ¹¹¹þúþ«†þëþz>þú¹¹¹þ†þëþzþë='Ù+@  ÜÄ2üÄ291@ /ì2903#3²³Âþç¸þçÂ6£ýQüÖ*¯=q33# =¤ú¤Ãþ¢þ¢qü½ýCºq @ üìÔüì1µ£ /ìô<0)3!3ü9¹U¹qý"Þºq @ ü<Ôüì1¶ £ /ìôì0!5!!5ü9üòqü“K“qOâ!>@#E E"üÄìܲ@]üܲ@]ìÄì1@ • •‘ /ì2ôìÔ<ì0%!!5!&'.4> 2>4."¼‡ü:‡RJr……ä 惃sKRþQ[œ¸ZZ¸œ“““{ 1¨Å©bb©Å¨1 Ÿp`88`p`88º¦ %@    ìÜüÔÌÌ21¶   /ìÜÜÜÌ03"3#!5!ò„…ñpü9Çœ fšžüø“qçî2@ EüìÔ<ì2ÔüÌ1@    ‘/ôìÔ<ì2Ì0!#!##"&6 54'&"3qv¹þCœø¼°±f^‹œ]8Æmr^:ÉüÞþÄ<ÖUåf˜þɃ]8˜ÆƒÁDÕ '@   üü<ü<Ì1@    ¯/ôìÜì0#!!!y¸ƒþ5Ëßý!Õ“þ/’=ÀÕ '@   Ü<ü<üì1@   ¯/ôìÜì0!5!!5!#þ5Ëþ5ƒ¸ß’Ñ“ú+ºÕ %@ üü<Ôìì1·   /ììÔì0!!27654'&'2#!3œþÐ,R4,,=iXXXlýιÞýµ]Oz}I_“‡_Ò­‡…ÕýœÁ$Õ;@   ôܲ_]9üÔì@    /ôì999@ ìì10#4'&'5!½ˆ4B ¸5M‰ÃcAþïê¸æþÉq™_–ÜÜ9V“= Õ4·ÔÜü9Ì1@ /ô̲]ìì´]0 53#Tþ麸ßþÇö9ú+Áë!-@ #"üìÔìÔüì1@    ! /ì2ÔìÔì03432>324&#"!4&#"!ÁôÆ}x5%–ÓÒ^ˆº¤ZþýH¤Zl”þî¦ÿK--ÒX€hý&|‚€Å•þncƒ§Òò=‹Õ &@   Üü<ü<üÌ1¶  /ôÜ<Ü<0!5!3!!#ˆþµK¸Kþµ¸€”Áþ?”ü€=Õ9@  Üü<ü<Ü<ü<üÌ1@     /<ô<Ü<<ü<<0!!5!3!3!!#!ˆþµK¹øLþ´¸þ=“Áþ?Áþ?“üüºq!@ üìÔüì1¶ £ /ìôì0!!ü9¹Uqüq“ýµK=ÃÕ=³ÔÄÄ1·B••/ìôì0KSX@ììììY! #ÆýtFCþ0æþ0Bû~ú+ÕÁnÕ 4@ üìÜ<ü<Ôìì1@       /ìôìÜ<ì20327654'&+!!2/!!m¨]%i¤þ ;°„@ED\ŒÔýTôqQE=4."þµXEr„„rJS¸RJr…CEoJ¥[œ¸ZZ¸œOó“þ{ 2¦Æ¦1 þ{† 1¦ÆSV/þÞp_88_p`88Á}Õ @ üìÔìì1µ /ôüÌ0#!#}¸þµ¹Õú+BþÅÎÁ}æ #@   üü<Üüì1µ /ÔÌüÌ0#!#3}¸þµ¹¹âüOþü›þüÁmÕ +@   ü<ìÜ<üì1@      /ìôìÔì0!%!!5!!z;þ ôþ ¬ýTÞýµK“Ñ“ú+qOÕ $=@&E "E%üìܲ@]<ü<ܲ@]ìì1@ • • "#/ìÔ<ìÔ<ì02>4."%#&'.4767673 [œ¸ZZ¸œTXEr„„rJS¸RJr…CEoJR¸"p_88_p`88Î 2¦Æ¦1 þ{† 1¦ÆSV/ †qOÕ(#&'.4767675!5!!2>4."¼XEr„„rJS¸RJr…CEoJRþµNþµþQ[œ¸ZZ¸œP 2¦Æ¦1 þ{† 1¦ÆSV/ ó““ýàp_88_p`88Ùb/ö²ÜÌ1² /ì0!!ÙVýªö”Bà¾f#"&/#332?¾¢E=9Qc´‹õ”t2 %xfþ¼" %/¯õxà $â¤Dp²/ì1²/ì03#¤ÌÌÌ¿î=f7´uÜì91¶´³ôì290K° TK°T[X½ÿÀ@878Y3#'#´”õ‹´´‹fþˆõõ[î¥fE³ÜÌ91¶ ÜüÌ90·  ìì@ Ueu…@ )9IUe]]!5'3¥ü¶{ì¶î”æäBà¾f3326?3#'#"&'B‹x% 2t”õ‹´cQ9=Efâ$ àþˆõ¯/% "[î¥fC³ÜÌ91¶ ÜüÌ90·  ìì@Ueu…&6FZj]]5%3%[¶ì{î”äæ”šþ‡fÿS²/ì1²/ì03#šÌÌ­ÌÕF'µ/üÜì1´/<ü<03#%3#\ËËþyËËÊÊÊÈuº·  ü<ÜÜì1´ /ìÜÌ0#527#53ºò„…ñ€þõgšžÈuº·  üÜÜ<ì1´ /ìÜÌ03"3#Èò„…ñ  gšždû¶ ÜÜüÜÌ1µ /ìÔì03#!!×ÌÌþ³üMûÌýd“dÞ '@  ÜÜ<ü<ÜÌ1@   /ìÔìÔì03#3#!!×ÌÌÌÌþ³üM„ÌìÌÞ’ÿì÷“³ÄÜÄ1² /ì0'!! üõ““°þæ‘''/33!!3'#67654'&67654&nÍÍÍþu‹dÑruxt‹›€ñddx>DD>x˜II’‰þvŠýçþ!ßý þóRTšxޱ…¯`aþæ£þw,0dc1-ýëþ!:;z{t‚ÿëÛ{*L@$% E+ü<ô<Ô<<ìÜü@!#91@‡Œ$+<ôìÔÄ@ ‡(‡¸+üììÔÄ0%"3254"3254#"54!#"543263 #4#"h??AA??A¸ùæ'+ææ¨,L½–¸â‰Wð@@@@@@@@üÁÍÉÐpØ·QQþ¾üÇ9ªŽ‹ÿ݇Œ/@@1(. #E0üì<ÌÜÌÜü<Ì1@‡‡!Œ0‡%*‡ ¸0üìÌÜÌÜôôìÔì0"3254"54$3  !2632&#"# 54-654!"`@@@CÒv»Bþ™þîþĉըŸŠ†iUvË«þ:Ö×þknL?o@@@@þìä‰Äþ«þìN;EjfŽÕa‘ùïe:.šº88U؉ÿìôŒ8327&'"254"%47&5476! #4'&# 63 #"'632# i60IKhhþ¯*)…“7!‹o¸^R¿þýX;*:ú9«ÌÌþu`þ/'"­€6OÔfq³þ÷ý¿A¼…tqLIþ¶ $\9.ȶmþQŒ!6@   E"üÌÜÌÔüÜü1@‡¸" ‡ ½"üìÌüìÄÜÄ0463 #"&'7325#'&&7'6m¢ÝešÍÖt ½"x¯‚ØÐÖCBC¦quýôýþùðÐ Ñóßh!Ï ACBBÿÿ—š )2@  #&E*üìÔÌÔÌÜ<ì1@ ‡ ¸*%/ÔÌÔÄÌôì0"32654& 4''&5432#5476°$ % U%|{¸eÈÙÚô6þ™ãL¸j` %"%:yxþÙý~)ŽR¦·Àh–††KKª>Ü‹þ †Œ 65@$- 3 (E7ü<ìÌÔÌÔ<ü<1@ 5/‡¸7‡&Œ7ôìôìÌÔÌ"32654&4763  !27632! 54-654!"#"`$ % õçºBþ™þ­ûïy#x—”¾Jþiþ:•O×þknLI¿Òo %"%0‰yKþéþpjNdfïD×þüþ”QcwþõùØiC‘|85s½sÿïô• *;@&%   E+ü<ìÜÌÌÔÌÜì1@"‡)Œ+‡¸&¼+ìôÌÔÌÔìôì02654&'&47&7'73%$æ$!% þ­¥¦lÜÝ6ZA“‹|¸ýÌý³• $! $ý˜Vmê-·Æˆ½G4 ¡p¨¾?ýÁý´ºÿã¼{1@ FüìÌÜÌÜì1@ ‡¸<üì@ŒôÄÜÄ0%"32544!  #"54$32¥@@@þ¹þµæëäÖ)ë@@@@ëÆÆþPÄÈÈŽÌvvÌüÇÿ⃡ .<@- " 'E/üìÌÔÌÜ<Üì1@ $Œ/‡-‡)¸/ô<ì2ÜìôÌÔÌ0%"32654&672#4#"#"'&#" #"53232l$ % L ™ò¸7*>(€z*M#6Õûò—&8"$ñ %"%3|þ©ü¶0Û¯qi½áþPÄÚÒ–Wu«þ²{+?@-$'+ ,<ÌÜÌüÌÜÌÜüÌ1@ )‡!¸,Œ&½,ìôÄÜÄü<ìÄÜÄ0%"3254"3254 #"5#&767663 #4!" @@@þ™@@@®äï!ÙÓ¢7yÁ-ž¸þæ²^õ@@@@ö@@@@ý˜ÝÃã×ÇedÕmúÛ%£‹WÿïË‘ ,9@. $  )E-ü<ìÌÔÌÔüÜüÜ1@ ‡'Œ-+"‡¸ô<ìÌÔÌôì0"32654&4323254#4#"%$7"@$ % þùæì‹µ¶'(¸ujþ‘þ’ÕÓø %"%@ÙÕ¯ˆ¨Ì°Xþûüsghý©þ¹\—_ÿ㾌"9@ $ E#üÌÜÌüÌÜìÌ1@¸¼#‡ ©Œ#ô<ìììüÄÜÄ0254#"53265$54767653!"'#W@@>¸z]Uþèâî]ƒã¸þi¹TrÙs@@@@üpeœgÌÝÛýu©±/üÑþ²ssIÿïs|2@  Eüì<ÌÜÌÜü1@  ¸¼‡ŒôüìüÄÜÄ0"325447&763! 3%$5@@@þÔ¶·åíþìMg¸ýáýõî@@@@ýRÚÄ&¶Â¼—þѨË'´ýLþBIÿïs2@  Eüì<ÌÜÌÜü1@  ¸—‡ŒôüìüÄÜÄ0"325447&76! 3%$5@@@þÔ¶·åíþìMg¸ýáýõ@@@@ý<ïÅ%·Â½­þÒ¨Ë'hû˜þBYÿïÌé E"32654&!"32654&&''"&5623253765$7465&'7$ % ý$ % K”fg´¦œüÔþ饤¸£›þçÓרIJÒ %"% %"%üIK£šbáëÇþv„„4þË‹‚ŒËî˜42@7-]fÅnþ9¥™ºÿãh%A@'$ F&üìÌÜÌÜüÜüÌ1@‡Œ&ô<ü<Ì@" ¸—&ìüÄÜÄ0!"'# 432!32533253"3254hþ©”fg´þ¾ýÓþ襤¸¢›¸ü>@@@ þÃJJ=|ßëÌþ\¤¤@þ¿¦§ôýÌ@@@@hÿï} -?@, (,$ E.ü<ìÌÔÌÔüÔì1@"&¸¼. ‡Œ.ô<ü<ÄäôÌÔÌ0"32654&2533253!"'# 47&5432d$ % A¤¸¢›¸þ©”fg´þ¾™‰æìèBÒ %"%ü³§4þË©ª/üÑþÃJJ=ð¦%žøÜ‰þñM§hÿï -?@, (,$ E.ü<ìÌÔÌÔüÔì1@"&¸—. ‡Œ.ô<ü<ÄäôÌÔÌ0"32654&2533253!"'# 47&5432d$ % A¤¸¢›¸þ©”fg´þ¾™‰æìèBÒ %"%ü³§4þË©ªèûþÃJJ=ð¦%žøÜ‹þóL‘§@ÿã`$@ÜìÜì1@ ¼‡ Œô<üü<03!23! '#"543225“¸ù¸þOþ³)3¶Æœ)`ý,þíÔüÅþ¾88œ–{‹sÿïô *;@&%   E+ü<ìÜÌÌÔÌÜì1@"‡)Œ+‡¸&—+ìôÌÔÌÔìôì02654&'&47&7'73%$æ$!% þ­¥¦lÜÝ6ZA“‹|¸ýÌý³• $! $ý˜Vmê-·Æˆ½G4 ¡p¨¾Úü&ý´‹ÿïŒ ,7@  '#E-ü<ÌìÔÌÔü1@+‡Œ.%‡‡¸.ôüÔüÔÜÌôì0"32654&4! ! &# ! ! '&54323 c$ $ ½þ€ýÔ6bæuøåþŒ’ýÄþ«‡UÓàK·X $ $è8$Ü{»ŒŸþþ›nE{ËÒN%Oÿ戴 0@@2, %&E1ü<ÌìÔÌÜìÔìÜ1@‡%‡/Œ1!‡*¸ôìô<ìÌÔÌÔÌì0%"32654&&'&'&5! 765! '676%&4% $  ,«D ãÏù)@ ' 1#-E5ü<ÌìÔÌÔü<1@ ‡)Œ6/‡%‡!‡¸6ôìÜìÔüÔÜÄôì0"32654& 4%$54!232#"'&#"! '&5432h$ % $—þ{ýÝ¡Ëajjh@”Mó§qKÍy)ý«þLJmá×_œ‹ %"%þù½1EæüYl0þ”xP^b8RþÂþsu_|ÞÚ]FËþ­ð¡'"2''&'$!32'&547"32?6A€€ñS2;9ŠÂ’ þhhÍÔÓÔ¤ÚNU×~œõþ± €û †+;9j–qÎÖÐ!þþæB¦a¦©þÈÿÿoÿå¶€'?ýu?úÉû`ÿ§ +@   /ÌÜÌÜü991@ /üÌÌÜÌ0! &7623$'4'74"YýÇþ¶Ãåò#!A[VЍüÞB8?<þÿ¨kÙØP$U.FŠM?>={É{+@  EüÌÜÌÜì1@   ‡¸<üìÜÌÜÌ0 ##"2#"53254#"·¸ÿn=Úåá¦;C>@{þjýËVÁÇÇ®þR777ÿÿüšÉr&V@û@ìÿji·  /ìÔÜÔì1µ  /<Ì2ÔÌ0! ! !5 74! ûþ%þ&þ?þºþ˜%»~?>þÂþÁ~»Åû@ìi$@  /ÌìÔÜÔì1¶ /<Ì22ÔÌ0! ! 3!5 76! ûþ%þ&>Ôý©þ¹þ˜%»~?>þÂwJ~~»Åû@ìÿji*@   /ìÜÄÜÄÜì1@    /<Ì2ÜüÜÌ0! ! !5 74! #5ûþ%þ&þ?þºþ˜ßî%»~?>þÂþÁ~»ÅNÜÜû@ìi.@  /ÌìÔÄÜÄÔì1@   /<Ì22ÜüÜÌ0! ! 3!5 76! #5ûþ%þ&>Ôý©þ¹þ˜ßî%»~?>þÂwJ~~»ÅTÜÜüþý3þ¶ÿ²"36654'#"5432ýî‚AA\(D³ªeN[̼þÏo[$žºN[‹uÖü§ýŽþÈÿ¯%@ /ÌÔÌÜÌÜÌ1@ /ÌÌÜÄÜÄ0"3254"547&54323253ýró>Juum‚ž„²þ@’s> [yu?{EBXFþºÃû`ÿ§ '656%"'&76! 4"3Y¨ŠVþ¥A!. Ùå{x9üá322674&#"ŽCC›òèÌjFPˆH OQ²µ$!%!¢p'(FnäJv-Oý!3]ï $ $ÿÿzÿãÈ{&KK0ÿÓÿö0, ("32654&&3 #"4/&5432N$ % þ¤s $ËŒeÓû‹qɘzm… %"%þù´ƒµþçÏ82®º´‘y¦œþ,v\ÿãë#"6@ E#üìÜì@! ÜìÜÜÌ1@ ‡˜#Œ#ôÄÜÄüü04$54%&&5! $#"57"3254ÂiþØó xÜ«äþâïï@@@ç¸ÜXº¸4 |ì`Pþ°¤Ù³ý÷ åÜÝ?@@@@¼ÿê ""32654&5&'7!$#"47#®$ % þdt¦„.;àÕûœï %"%ȈÄ_øp•½¬˜þ‰ ñÐ8>™u“þ%˜t/;4#"#"'&#"$#&532327632! '&57"32654&à"3C2z7J,"Óû¶…/IN\=0‚¶BWþ–þ¡TO½3Hý©$ % Xt\DD\t] ñÏ5ö<\UCþþüªþ÷fˆwpv Ê gH %"%ýñýÆV@/ü1/Ì03#ý´´Vþ›ûàÿ£ '@ /ÔÌÜÌÌÜÌ1@  /Ü<ÌÜÄÜÄ0'6"%)56574 65ü+*+µ×þ„þU·‘G±óm++),}åþÝ….pˆƒ·\(úû>È.ó4"!27676327673!#5654#"'&'&#";&543ü.ð%2~*&IHHÜ„BO™g(þâÅÐLBC]i%>’e>.`h>3È‚A?×~= h‚\$…kb8:;-F¡_Zkf2)üNàþŒ !@© /<Ìü<Ü1@© /<Ìü<Ü053533##5üNØŽØØŽ¸ŽØØŽØØÿÿû IPüšöþ>r@ /ÌÜÌ1@ /ÌÜÌ0432#"73254#"üšÔÐÔЄLTPP¾´´ÈÈHHH‡ÿã` " 7654&' ! '&476‹^L:NbX1ˆcoŒþ÷þí€qo’À„h³½`™W®£ü Ä’éý޳¥”æ•Äcÿg¨›&24764'&#"676'&'&5476 ¶€ òÒpH¼’gc/5pØä†I´u ¦þÎö€€ýê‡uËpHECle\gâÔUÔÜš‰su—ÈýϨ‡cÿy\±$24"27#&5432# '&5?$5+€€rÐ%3Ýàí]fÜþͦÏÓ¸þ”Ù|pHF€þP¶ÆØþäðfou—ÈT¢¥àéþÇþå©aþûpHÿ튤/%24'$5432327#"'&#"%$'#"5432253â¶þ¶ï¡3]L/|€t¾kZ1„AQ½þfþÜ(3¶Æœ)¸ƒDj¾R—Ææ:jÄTþûh8KOÈpÆþtþ$68œ–{‹‘ýÖþícÿWα%24"$'&5?$532&'&32!€€­þâþñþ¾rŠÏÓ¸þ”Ù|T9ïlcÙÔì ~x¢˜€ý?Lv§T¢¥àéþÇþå©aþûmY<ÅÐäØÉÇKcÿWα-224"7&5&326532&'&32$'&324!€€ýBå‘äûœ¸³}b$|T9ïlcÙÔì ~x¢þâþñþ¾rŠø=C˜€Ëh¡(ªç­­¢½ë¤ ?fXþòmY<ÅÐäØÉÇKLvÈttYÿïô4@'&''"&54323253765'$543227#"$#""32654&²¥”fg´¦œýÔþ饤¸£›Ùþ¬úu ^|€u½IþòSL\ßü>$ % ,¥™IK£šbßëÇþv„„4þË‹‚jEašØÑüÃTþûùW8Ò‹þ¾ %"%‚þÛ{ &%"324"324#"54!#"543263 #4#"h??AA??A¸ùæ'+ææ¨,L½–¸â‰Wð€€€€üÁÍÉÐpØ·QQþ¾úÛ%ªŽ–þRpt MU"32654&254"#&76767%4#"#"'&#"$#&3232763276'767‰$ % ånnþ´vp†+-•"2D2z7J,"Óû¶„0IN\=0‚¶ŽJØ%•.3?­5xvþ„'ªQœ %"%ýž933¹hk//3wá±t\DD\tþß ñÏ5º<\UCþþýÈrT­«”F-2bG;þÐ"‚b,iÿ÷÷‘ $5354#" #"524"Åm~¸þÀþŶ¥Óý¬€€‘þ¹ý©ejüsûþX°¤þ\Ìëß|9ü€ÿè“™ I"327$"3273653%"'%5254%$7&76%$5#0#&7626¨€A?à€A?‘ Tc¸þéb*@þÖÛRX6&$þHþ£ÂåîuŠ æÓ¢5r—ý@@@@@@@mýo6 Jü¶þ½,/¸Ìáƒ7'ýÖþ³- Ó/™×Ô‹uŠþꟵ² îÉcdÿèÉ™ LX"327$"3273253!"''&76324%$7&76%$5#0#&76262654&'&¨€A?à€A?‘fx¸þÔ…$8ŸÙÄ$+Rb,7þHþ£ÂåîuŠ æÓ¢5r—ýô$!% @@@@@@@mýÓ”žJü¶þ¾ceÆÁã“$3ýÖþ³- Ó/™×Ô‹uŠþꟵ² îÉcdûê $! $xÿᆟ! !5!!%64'7†þ;þ·þ±þOÜþtJýuý¯4úSS›vþ–þ;øX¨©çþ"þòþ]| …¿KÅnÿÿ¢Ÿ#"57!3273!Á¼–âþá¾þñÌqžº´-ÁJLß÷÷ø½ÝX1ú¢oþÑ2³!6&#"&5&632!~þpoƒ~d‘þ·½ßsþÑ.†xsgd{²®àï°ûŒþ1nÿâ?Ÿ #"327%%5!5!!‚þ¢ÍÑþ¦Iæë<½þPþÌþÓþ@—ýÐýÑ“Þ =þÂþ÷þýþ¦`ýþ¸þI´I=œ?©©<¥dj³!&#"&432¶Î‚”±ŠyÎòä Y·«‘Ó…¿°4þÔþÓû¦P¶³!#4&#"&54632!þ¨µ’_k‹X„’ýµºî õü#‰gi’Mk| ªô謃ýl<ÿ០!3>4&#"!5!! >þþž³ƒÀáŸþçæïþêþ³ Fýþ+û¬Ô ú¡þWþßþ®5ç ýþþÞyÿá³%# !!!)!Y€þ¢þºF^Šþ¬þÖþeþ.Ȥ*”þzþÀþåþMjûåᎃâýéýO<ý%!3!kýѳ/¹C¤ù¨x}Ÿ 4&#"36#&3632Ê´œ•º°ŸtÜÑõþ÷´Þlõµ}ß9þ^äþDoUD<þËNþ·îü<ÿáF  &#">!#!63 ˆä‚™¶ŽwÏþÁëþíþ¦³À¤þÃ8 »=þ€þúµ¤þ¹10¿ýëµýÀ<þ¿ýœþêxÿâ—Ÿ "3265!%"3!!5!!«‚ò»‡µšþžôþîÇþÆ5þýLiüÁþÛàßÜ¿üçþAþìþ¸-*'=Xªýþûx‚‡Ÿ%4&#"#463!!&632Ê½š±Œ´åñ¿þ„t§ªüwâ¢aüf ÌɪX¥­PþÒþý‘dþ©r³ !#"3 3!  ! 36´þ­ûïþ«_æJ ´þ¾þÔþ»þ?Ë89Òþ辕ŒbŸþiþåþÊþVÉýµþ©Gejçþþ–þíþ4Tð2ÿâ½³#"5!5!3>53½þæäáþØþ{9ˉ¾³ÿàþÃ=ê ŸûR­×Õ®®P‡ %#"547#5!3273Ô¢­òþð¥ØØè²“‘¾³ÊV-çŸØ “vþ湯V4ùbnÿâÓ %!#"5732653!!þIþæÜãþݼsrÇ€®”´iƒyþ8þÒþÜ/ÓquÅšÈßÓlýûûè‚ÿ≠# 533>54'7‰þпþôþö³ ±—_ö*þõþÃjëiû”ÅîÝÛÑŽÁ‚ÿÿˆ³6&#!!>7)!!! ÊÛœþà Ù½þÑþüþàÂü‹Ó3‹¾Ëý¶¿ÚþÄþ+¡´þÁdþ‹r³ !#"32!527&'! ! ´þ°øúþ°açõU¾þmæ}Øþüþ³þEÂI=ÆÉÉa þ]þñþÓþM¸ý¨þ©ž¼v8±"`_ðþþœþÈþØ€d‰¬"#327&%#;!###) 7bb´ÜÔþ6e³îÿ¢eaþ±þýb­eþüþ¥^tNü4 ÊÒþñÐÎþãëþËþ´þL´NhBþÄZp !#!3!3!´þˆ³ýѽr³4fQüJµÙþÐAýÁþƒÿሳ#4&"#&32ˆ´¿‹ŠË²(á嬬ÜÛ¬ûT¨éAþ¸Ønu %#"533273ÁÒüõ´– ¸³´ÂMÛ=ýűžU5ùaxÿá~ &$=3326=#"533273~ôþêÑþÕ½¶‡ŽË¶©öþ´§¦¤­³θþÍðà$!¤¥§ûS9¹8ýÈ—»X2‚‡Ÿ%6&#"#3632ԙχ°´³®œÙ/«“½0ü5žýÍ0ÿþØýŒyÿá³5#$!&# %73gö£þuþ6ßwöfÛÀþüþr€ ý¶an‡Õ¥°¸þ‘þ²þÑþXž÷üéxÿâ{  "3265!# !33!ÇÇÊÇ›ˆ  þ«þõÏþûþâGùµüþôžÚöÇ×Üüéþ$þÚþèP ;ýüûw‚ÿÿˆŸ4&#!!>7#!!#5!#!2Êp]þ9ÇP~½Ò¹þ9³þ˜´{¹Òmþ€ª÷ÿþ{çþ( âdÿ☳ # 5332654%$432#6&#"˜þëäþôþÑ¿ͬ¤šþ]þ`þÔây€ŠDÑÓþäeüµþô©šÈªª þáÑÆ‹–vÎþ¢‚ÿÿˆŸ#"'!!33263ˆþÞð¥›Ìü€´¾„Ï´ÒþÌþØþ¬ ü ã<Ÿ ! ## #5!zýž®×ëþkÜþ{ÿTýïöýøüÎöýO_–©üœ<ÿâG # 5!#!32653GþÕÐþÿþóþ°´·³¨Ã³ óþÉZÐôþ‰û^‹ñÑ«ž‚ˆ 54&+#3!23X„ý´´½×¾7Ÿ›‹üŸýü½§b oÿâ³!#"&7326554632#&#"þ˜ôóþª·‰æ¨ÓÇüúÃ}‘Ñ}5þçþÆ:#æÃƒ‰Ÿä×çÌLöŸŸŽŽ}¸þÅ<B %#&=#5!;3îÖѾv ZŸñ³t´ŸmfùŠùanR #&$3;>53RþÂL»[þ¼´£aƒ^•µ‡þÙáýƒ}å#ýåÇ©¤ËPÿᘳ 3#"32654&#"3267+!!.546;!5!5>32œÂE…HPw=xXca³hx¿ÞÀ³Zþ¦Ö”°ÚÕµÂþ‚~¸¡¾â9]~}_h` dY‡ZµydŸÓþç—ïœËDz“ᕵ¾Â¼dÿ⬽! 7332&53¬þ[þ]&°"òïþz»~ªþ8ÒÏÏþº<ÔkÔ¤þ–dÿãÀ³! %76'&53'!2ÀþYþK‹/““·‚0>´öþó!ýÂ<AC§ijŽAˆ…´I{þ2·þHþPZþLi$%#"5%674#"'! 4&'326LþÿóèþêÒ«³œ ES©}´‘§©ª·‘„¿*×þË6Ö¦w‚“†1(Wþä‚©þ‡•öþÿ‰®ÔÕdþ(a'! 47&#"#&%'67$!26! # !2þ^þNWuöe+Ç þh–tzkœþž…³ofÿ£´ïþõ ïPýã(ŽB¤þ­þ ÁÊÔžc¢lq/ýã쬱ýùzþ‡þbdþ˜`! 7332#"#'! ˜þtþX!¬ôâáÈ7¬1n‹?þ\¦áãþèôâ܆þodþ¬`"! 73!54'#53654#"#'! ¬þoþI%® ݪ¦ÈëȰyŸÓÚ=þZ ååþì†Ø˜\ÙÏ¿¥›Tþ¢Ò…hþ)ÿã´! 7&%&326#"6þ\þZÁì[FxL´òñó±¯® ýÖ*qaqEþ¬±tDþ'¥þ\þaÉúÜþådÿã`!263 ##"! #"32d¤õh~’åàèeoþsþ`”òîìô U¼·ýìþÀþæ@ŽºJ½ýÔ(Êþ6þddÀ`# # À·’þ ‘¸\DþôþÉ #þmþàþß8Zþ¥V! 73!54+53$54'3¥þmþF2ª( Úè´g)¶éyï>þ[˜ïæþëþ”FÀ³¬¨·Ïa[þódþ( j0#5#"#'#"#'#"#&%'67$!263263  Ç×ìÛØ — ÊÅ – ÞÛ²C¯1þCþ°„m‚æýÅÕ\`¼ÍX^Ϊìþôô+þùáá þôááþ£þ>àfþ¸çT˜€o'åÕãËÕÙÏdÿ⬳! !4#"#5! &' !2¬þoþIºeÐÙ·zªD–þðã¼þ&?! 1NÓÈ//Tþ þ-, þjþNY‚ÿáÊ©! )!"67 #32ÊþRþfN¢þ0v‹’´û{tíýýÈñ{\’Žþn@ ý× ;þkþ‘dÿÿå`##"#5#"#!263 åþíÑ/Òç¥çÓ8ÑþæˆáWaÜ…VþÒþØ@~þ§ÒÒYþ‚þÎþÛ$3 ããdÿ⬩! 7332+53274$53¬þ[þ]²ïñÇ®Âþ¯Á-´áýáÙÈÆþ±“m–«Ÿ™ÂdȨ¯H”dþ«i! 73325 '6%5%«þcþW´ò÷þdãþ9)þ×*@þ]¢””þê÷O‡rþܤ–uGv²dú©###"#5#"#%7263 úþâåOäÞ§ÜèPîþêþþ¨þvþĶÙ[`Ü’KþÛþÛB‰þžÃÃbþwþ¾þ÷+ IH@§þQ)Mýý‚ÿâÊž! 3!26573ÊþfþRªæÈ¶Úãýÿ¬ûTþ|u©ª¤]þÌZþâp %3! 32%#Z²ÿþÅþûþøþÀ´ܸ­æþ¯±þ¯:È_þí\ý2þÁþ)ÒKþÒþ[60’ý~ þ¶’ ! 73!2&#"#4+'73263 ¶þnþG²è‡{ œRmWPOC 0@þ]£ããþég¶Œþ¥[x(¡2»»þÇdþ!`2:! 63 ! $=46326=4+5326'#"! #"32d¡]x¼‰ûßþØþêþâþècd™Öë ·PS¹ÔŸa þ]þY–õííõeûÆÁþRú£j˜\´á¼wCD4sšoX§—µ›7®<\"þåqþ‘þ¦dþ˜Ÿ! 7332&'"#'!3˜þwþU!¶#÷ßg­¤2±*>§|ª?þ\¤ááþè¾K ÉöÎ| P™dþ)æ_%67!263 #5#"#'#"#4'&P³þQŒØ`[Ê™¨ÉÀàÛžàÚn³æ¿Â³<5)•ãççþ5ÙúÐAþéÄÄþ§þ)áªñ§q+­dþ¬N! 7332 4733673¬þgþQ¸ýí|€þz¯ÏËÓ‘kªBþ_ –“þév? ­ÜÖàÒþÞ >Š<ÿ⢳(! !4#"&=6#53263 .'"32¢þƒþ5¢‡z¤€GN~‹†ZXR¤8ª6zHòþì©þ9!? ,™Œ–V5''5X€4ʸ¸þîûäþMþk‚ʳ74#"63 ##"#! Z ¤”t–­ÓËï„vªNA%˜tÏþ™Gþ4þÛþ°SD9üƒS`õ™Zþ8A ! 53! +532'6&'3Çåþþt»{>@×­¦Ç× º Ä«§`WþÌþ£(;þÌþƘýnl=‡ÎW¶„•dÿ㫟 ! !63&#"32«þ[þ]£\Ÿ©©„xîïû÷ýì4+G£û.§BþaþXƒÿâè³'!26;'"&=4#"63 ! 3 #&ƒ9¤RXZ…Š~NG€Ÿ}¢þ+þªâòy¡¸¸Ê4€X5'(4V––þ`GýÕýËù$þ·©Ÿ>dþÅž%3!!! 733245#";#!3 ¨þí þ^þ[ ¯òîÿV¾š//þÔUQžý¤‚KúþÎþ_¡åïþõ¦ K·¦†+;‚ÿâÊž ! 363 #"32ÊþbþVª‰–´ï`›þì(ýº/ýƒ?ýȬ;þLþ‰þŽ“#%#5265&/%77654&+532ŽQþè þ³î æÀsÖþˆQfV?LED‘OR#\Õ€°þÒxµ¼Ð–sp˜2E ºŒÂš"%-4‡.-ŒUAœdÿ⬳'! 73324'#53256+53274$53¬þaþW(´(ïñq££eg£¢Zþ‚§£·±½þa³””þÙ Ü‚œ€…’m•¥VŠ· =Eˆ‘HqxÿâÀ³'! 3324+53256+53274&53Àþ[þ]ªó÷w··oq·¶düºï­·±¼þaï¸ûHþ ãx—{¿mQÁˆY¢³>E’‡Hqdþàª`27$! 3&'6#"—Fþú¦ þíR‘ᑞߋòìîðTs²_0ýÐþ¢³sÌIÑÏKSþzyd¡dþ¬_! 73325#53$=#%¬þYþ_»'òïݵo#þB®þÚ&=þZ¤âÝþ㤃ZôyôuýÓ?€þôdþ«³%! 733254+53$#$! 727«þ_þZ ´ òìòCM\ŽþW©ÿýÄÝþäAþ^¨ÞâþÝ!Ñýе)‡v„òü°þåþ€Twüdÿâ³'! %!! ! 3#3!"3253!54#"­þYþ^Ÿ þöþa¦£rrrþéþûëöúþëúö6îþšfwwiþ—ïˆþíŠæâíîíïÝdþ9`$!"'!525#"!$!263 #"729þYˆ`þ^øøòþH¦ç]Yí§µ÷ãèò'ý»ˆÇþzŒø“¡þSþeŠ"8ììýÇ®þÅçþ¹Zþ`! %$54#"#'! ! 4'3þþ676Ÿ¿œ bOþËþÊ4`¾Vþ6Ê9¼½¯ª"µý×ÛþS+þ®þáþ\§PþBh$43 32/7! 47$3254&#"Põýøþƒ³œ þ»þ­•þ™´“¨ÂŽ˜²´Hã=þ¾ÞþFew‚“†1(Wþø~ƒªd€þö ºÜÝdÿc¬a54'&#"'67$% #7#"é;;_ƒCƒCˆþί™ ÃâþB|MKOm0Á„¿þTËÇ$þ¼þ©—,nÿì'à 3#3#3#nÍÍòÇÇþÊÊà½Êºø»d\(³2"4;!"4#"32JßäàÆûþìAê{ntv²þÜþÏ2cÂ`L©Ð·½ÃhØ=@ B••ÔÄÄ1/ìôì0KSX@ììììY %##™œýÇåýÆ.ûœdªú+ÕÿÿhK'œÀE¸ÿÿhÕ)ÿÿhO'Àt¸É°Õ@·üìÔì1µB¯/ì990KSX@ííííY s£û³çÂüNÚýÕý‡äÿÿɰO')tºÿÿɰN')uºÿÿɰÕ'Úeºw^Õ?¶ÜìÔì1µB¯/ì990KSX@ííííY 5´ü]£ªûçÂþ(þ&þðxäyÿÿw^O'1t¾ÿÿÉØ'¶5Úÿÿ6Ø'Ú¡¶ÿÿÉÕ&Ú¸5ÿÿ6Õ'Ú¡¸ÿÿÉO'¹5Úÿÿ6O&¹Ú¡ÿÿÉEÕ'º•ÚÿÿÉEÕ'Ú°ºÿÿÉEO'»•ÚÿÿÉEO&»Ú°ÿÿɰO'É0»ÿÿÉóÕ'¾•ÚÿÿwEÕ&¾Ú°ÿÿÉóO'¿•ÚÿÿwEO&¿Ú°ÿÿw^O'?0¿É •Õ3#ÉÌÌÕ̉œçß!38öîýYgg`ýªnCü½^Úå·^nýç7€]ý€^Úå·7ånýçn7]€]‰0­d"&533265453­ŸæŸzWA@XzCs  s!þßAWX@+ö‰!­U#454&#"#462­zX@AWzŸæŸBþßö+@XWAþß!s  ‰0µU!5!2654&#!5!2£þæ@XX@þæsŸŸ0{X@?X{Ÿæ ‰0­U 4&#"32>"&4623X@AWWA@XzŸæŸŸæC?XW@AWX³æ  æŸH>Þ %™‡þãþ'‡þãÎ1üð11üð‰œ¥ß· ]]ÜìÜìÄ1¶÷‘ô<ì203!3ýäœCü½Cü½É~•K3#ÉÌÌK͉­!5!­ýÜ${‰1­V #5#53533ØzÕÕzÕÕÕ{ÕÕ{‰1­‡##5!ØzÕ$ þ%Û{{ÿÿ:Ø'ÓU¶ÿÿÇÕ'Óâ¸ÿÿÉ"Õ'Ó=ºÿÿwqÕ'ÓŒ¾ÿÿhÕ9ÿÿhK'œÀEäÿÿhÕ0ÿÿhO'Àtäw^Õ:µÜ<Ôì1³B¯/ì0KSX@ííííY7 5wMû³çû¶40»ý‡äýˆÿÿw^O')tæÿÿw^N')uæÿÿw^Õ'Ú¶æw^Õ:µÜìÌ21³B¯/ì0KSX@ííííY%5^ûçû³¶¶xäy»ýÐÿÿw^O'1têÿÿÉÕ'â5Úÿÿ6Õ&9Ú¡ÿÿÉÕ'ä5Úÿÿ6Õ&äÚ¡ÿÿÉO'å5Úÿÿ6O&åÚ¡ÿÿÉóÕ'æ•ÚÿÿwEÕ&æÚ°ÿÿÉóO'ç•ÚÿÿwEO&çÚ°ÿÿÉóÕ'ê•ÚÿÿwEÕ&êÚ°ÿÿÉóO'ë•ÚÿÿwEO&ëÚ°ÿÿw^N'1uꉛ ß<´ÜÌ291µB÷‘ôä0KSX@}}}}ííííY5 üéý`sb€bsþщœß³]Üì1´÷‘ôì03‰œCü½ÿÿ²ÿã)Õ8ÿÿ²)K'œðEÿ²)ò*@ 8AüK°TX¹ÿÀ8Yìüì1µ •‘ /<ôì03! #4&#"²!!Ë®Âî¤$*þÖþÜü\‹ðÓÓðüuÿÿ²)O'çtÿw^Õ¶ 2 Ü<ôì1¶• •/ìôì07! )5! )w¾5þáþËþBŸ²–þhþPþa¦.,¦þ—þ€þ~þ–ÿÿw^O'Çtÿÿw^N'Çuÿÿw^Õ'Ú¶y`Õ· 2üìô<1¶ ••/ìôì0%! )! !`þaþPþh–²ŸþBþËþá5¦¦j‚€i¦þéþÔþÒþèÿÿy`O'"tÿÿÉÿã¬Õ&Úýƒÿÿ²ÿã¥Õ'Úýÿÿɬò'ÿƒÚÿÿ²¥ò&ÿÚÿÿɬO'ƒÚÿÿ²¥O&ÚÿÿÉóÕ'•Úÿÿw½Õ'Ú(ÿÿÉóO'•Úÿÿw½O&Ú(ÿÿÉÕ'½Úÿÿy½Õ'Ú(ÿÿÉO'½Úÿÿy½O&Ú(ÿÿðÕ'½r‰œßµ ~ÜìÌ21@ Ý÷ Ý‘ôìôì0# $54$!3#"3nþðþÿnÍ™¾¨ nË××Ên“ ¹{ÿÿ²ÿã•ß'ü|ýÿÿ²•ò'ü|ÿÿÿw}ß'üdÿÿy¯ß'ü–F>ò %@ üìÜì21@ • •‘/ôìÜ9î0"32654&"$54$32#Bz­È_€²ÌÌ€²ëþï#ÙìÊR¤—¨”©“¤—ý3IðìúáðìûêÿÿÉÁK'œÀEÉÁò %@  üì2Üì1@ • •‘/ôìÜ9î0"32654&#4$32#&Åf̲€_È­þTÊìÙ#þïë²R—¤“©”¨—¤ý3ý{ìðáúìðÿÿÉÁO'ÀtFÿã>Õ (@  üìÜì21@ • •Œ‘ìôîÔ9ì0%2654&#"3#"$54$3Bf̲€_È­¬ÊþðìÙþÝ벃—¤“©”¨—¤Í…ûêìðáúìðÿÿFÿã>O'ÓtÿÿFÿãüN'ÓuÉÿãÁÕ (@  üì2Üì1@ • •Œ‘ìôîÔ9ì0%2654&#"672#"$53Åz­È_€²ÌÌ€²ëþÝÙìþðʃ¤—¨”©“¤—ÍIðìúáðìÿÿÉÿãÁO'5t"ÿÿÉò'ÚÚÿÿF³ò'ÚÿÿÉ?ò'~ÚÿÿÉò'Ú|ÿÿÉ?O&Ú~ÿÿÉO&Ú|ÿÿÉÿãÕ'ÚÚÿÿFÿã³Õ&ÚÿÿÉÿãO' ÚÚÿÿFÿã³O& ÚÿÿÉÿã?Õ'"~ÚÿÿÉÿãÕ&"Ú|ÿÿÉÿã?O'#~ÚÿÿÉÿãO&#Ú|ÿÿðÿã?Õ&r"~‰‹ ß $·~ ]Üì2Ôì1@ ÝÝ÷‘ôôüÔì02654&#"632#"&53ÉXP^J\TaaQ_”¬·‰•«ùVFTHUGQK})†„Œ~†„J8‹¸ß 2654&#"03#"&54632xOaT\J^P«•‰·¬”_ùKQGUHTFV}iý¶„†~Œ„†ÿÿF‘ò'üxÿÿÉÃò'üªÿÿFÿã‘ß'üxÿÿÉÿãÃß'üª"F>ò¶ ÜìÜì1µ •‘/ôìÌ0#4$32#4&#"Ê#ÙìÊÌf€²úáðìûꤗ©ÿÿÉÁK'œÀE;ÉÁò· üìÜì1µ• ‘/ôìÌ04&#"#4$32÷²€fÌÊìÙ#’©—¤ûéìðáúÿÿÉÁO'Àt;Fÿã>Õ¶ ÜìÜì1·• Œ‘äôîÌ032653#"$5²€fÌÊþðìÙþݾ’©—¤ûêìðáúÿÿFÿã>O'Ót=ÿÿFÿãüN'Óu=ÉÿãÁÕ· üìÜì1· •Œ‘äôîÌ03#"$53326÷ÊþÝÙìþðÊÌf€²¾úáðìû餗©ÿÿÉÿãÁO'5t@ÿÿÉò'9ÚÚÿÿF³ò&9ÚÿÿÉ?ò';~ÚÿÿÉò&;Ú|ÿÿÉ?O'<~ÚÿÿÉO&<Ú|ÿÿÉÿãÕ'=ÚÚÿÿFÿã³Õ&=ÚÿÿÉÿãO'>ÚÚÿÿFÿã³O&>ÚÿÿÉÿã?Õ'@~ÚÿÿÉÿãÕ&@Ú|ÿÿÉÿã?O'A~ÚÿÿÉÿãO&AÚ|ÿÿðÿã?Õ&r@~‰‹ ß¶] ]ÜìÔì1· Ý÷‘ôôüÌ03#"&53326y·‰•«aO\T•Œ~†„Jý¶PML‰‹ ß32653#"&5T\Oa«•‰·•QLMPJý¶„†~ŒwÕµ:Üüì1´•/ôì0!#!5!Êý)¡+ªÿÿÉjK'œ©EUÉjÕ@ •:üìì1/ôì03!!É¡ý)ÕªúÕÿÿÉjO'©tUwÕµ:Üüì1´•/äì0!5!ü_×Õú+ª+ÿÿwO'³tWÿÿwÜN'³uWÿÿÉjÕ/ÿÿÉjO'5tZÿÿÉ5Õ&ÚSÿÿw¯Õ'ÚSÿÿÉíÕ&ÚUƒÿÿÉ¥Õ'ÚUÿÿÉíO'VƒÚÿÿÉ¥O&VÚÿÿÉ5Õ'WÚÿÿw¯Õ&WÚÿÿÉ6O'XÚÿÿw¯O&XÚÿÿÉíÕ'ZƒÚÿÿÉ¥Õ&ZÚÿÿÉíO'[ƒÚÿÿÉ¥O&[ÚÿÿðíÕ&rZƒ‰œ¥ß´]ÜìÌ1¶Ý÷‘ôôì0!!3Œýä nC‰œ ßµ ~ÜìÌ21@ Ý÷ Ý‘ôìôì0! $54$)!"3 þúþðþÿþçÍ™¾¨ nË××Ên“ ¹{‰œ¥ß3!5ýä Õü½nwÿãŠ} (@  ÜÔìÔ9ì1@ •Œ• Ôì2ôî0"32654&'2#"$547!5œ‹È__ȘúþïìëþïLýšÓ¦n¨””¨ƒ‘ªáÝìððìªjªÿÿFÿãY 'œiÿpFÿãY} )@  üÄìÔ9ì1@ •Œ• Ôì2ôî0"32654&'!!#"$54$C™È`^È‹›ý™MþïëìþïÓ‘ƒ¨””¨n¦ªªjªìððìÝáÿÿ ÿã'iÿ<pÅwŠš "@  ÜÔìÔ9ì1¶•• /ì2Ôì0%2654&#"!5!&54$32˜È__È‹œûêfLëìþýª‘ƒ¨””¨n¦ªªjªìððìÝáÿÿwŠ'ªÿ<rÿÿwŠ'ªÿ<rFYš #@  üÄìÔ9ì1¶•• /ì2Ôì0%2654&#""$54$32!C›‹È^`È™úþýìëMgª¦n¨””¨ƒ‘ªáÝìððìªjªÿÿFY'Tÿ<uÿÿÉÿãH}'n¾ÚÿÿwÿãÐ}'Ú;nÿÿÉ3š'uÚÚÿÿFYš'ÚyuÿÿÉ3'vÚÚÿÿFY&vÚyÿÿFY'Tÿ<u‰ß\ä 2654&#""&546 !Éj>_IEcI_£¬(¬0ƒMJBSKFXCIn~|„‡‡„Q;n‰‹.ß"&5332653ܨ«abaa«‹†„Jý¶PMMPJý¶„†‰ß\ä 2654&#"0!5!&546 _IcEI_>jýmƒ0¬(¬£MICXFKSBJnn;Q„‡‡„|~wŠšµ ÜÔìÌ1µ• •/ìÔì0%2654&#!5!2#bŘûêúþï쥒¥ƒ‘ªáÝìðÿÿFY 'œ¤ÿƒFYš¶ üÄìÌ1µ ••/ìÔì0%"$54$3!!"Cìþïúûê™Æ¥¥ðìÝ᪑ƒ¥’ÿÿFY'¤ÿ<ƒwŠšµ  ÜÔìÌ1µ• •/ìÔì052#!5!2654&ìþýúûê˜Åõ¥ðìÝ᪑ƒ¥’ÿÿwŠ'ªÿ<…ÿÿwŠ'ªÿ<…FYš¶ üÄìÌ1µ•• /ìÔì0"3!!"$54$3CbÆ™ûêúþýìõ’¥ƒ‘ªáÝìðÿÿFY'¤ÿ<ˆÿÿÉHš'¾ÚÿÿwК&Ú;ÿÿÉ3š'ƒÚÚÿÿFÆš&ƒÚ1ÿÿÉ3'„ÚÚÿÿFÆ&„Ú1ÿÿÉHš'…¾ÚÿÿwК&…Ú;ÿÿÉH'†¾ÚÿÿwÐ&†Ú;ÿÿÉ3š'ˆÚÚÿÿFÆš&ˆÚ1ÿÿÉ3'‰ÚÚÿÿFÆ&‰Ú1‰ß\ä"3!!"&5463ÜRiPY’ýnž£¬§vDZHCn~ƒ}‡w^Õ %5-5 ^ûjü–çüìü¶¶2äÔÕä2»éì¸éF Õ ·? Üìüì1µ• /ôÔì0!3#$53TCcÊþúþ ʨþ™þ½ýXonÿÿÉ2K'œ EœÉÕ @ ? üìüì1µ •/ôÔì053#3 ÃÊþ þúÊcCT¨-nþcþ‘ý¨þCÿÿÉO' tœF Õ · ? Üìüì1µ •/äÔì0%#5%3# ÊôÊcþ½þ¬--noXýþ½ÿÿF O'£tžÿÿFÌN'£užÉÕ @  ? üìüì1µ• /äÔì0%!#3#Ãþ¬þ½cÊôÊ-gCþý¨þ‘þcnÿÿÉO'3t¡ÿÿÉäÕ'šÚÚÿÿF‘Õ'ÚüšÿÿÉÕ'œƒÚÿÿÉ´Õ'ÚœÿÿÉO'ƒÚÿÿÉ´O&ÚÿÿÉäÕ'žÚÚÿÿF‘Õ&žÚüÿÿÉäO'ŸÚÚÿÿF‘O&ŸÚüÿÿÉÕ'¡ƒÚÿÿÉ´Õ&¡ÚÿÿÉO'¢ƒÚÿÿÉ´O&¢ÚÿÿðÕ&r¡ƒ‰œèß ¶ ] ] ÜìÔì1·Ý ÷‘ ôôÜì04&+3#X¸ÏHãìÆÇœ¶þ¹å¬V‰‹ìî+.#"#"&'532654'&/&'&54632¸Cw7Bh#-8GC>©¤=‹JG‰BAm'./G?;¢=~ÇH)@@V\`RʺªÒV\`RʺªÒ¾ÓhZáþç·%XÓhZá·þÛFÿãlò632#4&#"#"&3326tҪºÊR`\VҪºÊR`\V¾X%·ÂþçáZhÓý¨þÛ·ÂáZhÿÿFÿãlO'ót¶FÿãÜ·'32654 !"/.#"3"54!2ú!„rz|K«È£þÙ¬×42 „swU¡ùÒ¤'­Ö4°X˧|`å¥þí•þÈ~pX˧|`å¥J š3þç~ÿÿFÿãÜ'‹ÿ<¸FÿãÜ·'763 #52654&#"# '4!"326(24׬'£Òù¡Uv€r„!24Ö­þ٣ȫK|zs„°p~þÈ•¦þ¼¥å`|§ËXp~þç8•­=¥å`|§ËÿÿFÿãÜ'‹ÿ<ºÿÿÉÿãò&Úµ•ÿÿFÿãƒò&µÚîÿÿÉÿãò'¶•ÚÿÿFÿãƒò&¶ÚîÿÿÉÿãO'·•ÚÿÿFÿãƒO&·ÚîÿÿÉÿãÙ·'¸ýÚÿÿFÿãU·'ÚÀ¸ÿÿÉÿãÙ'¹ýÚÿÿFÿãU&¹ÚÀÿÿÉÿãÙ·'ºýÚÿÿFÿãU·&ºÚÀÿÿÉÿãÙ'»ýÚÿÿFÿãU&»ÚÀ‰Ï¯æ'>72#52654&#"#"&'463"326[*'so¾b„I=J>",BˆþRðÓÓð‹ü\þÜþÖ*$²j¥t_UV²ÿã)ò '2654&"#"'&54632! 33265ð,B:d:B–0<~JI§jŠ­þßþåþæþßË®Âî€B,">>",BˆVU_t¥jýNþÜþÖ*$¤üuðÓÓð²ÿã)ò '"2654&'632#"&5! #4&#"ë,B:d:B–0<~JI§jŠ­!!Ë®ÂîUB,">>",BˆVU_t¥j²$*þÖþÜü\‹ðÓÓð²ÿã)ò '"2654&74&#"#! #"&547632ð(B:d:BB®Ã®Ë!!­Šj§IJ~<UB,">>",Bˆ®ðÓÓðüu¤$*þÖþÜýNj¥t_UVÿÿ²ÿã)O'çtÿÿ²ÿã)O'çtS^Õ$264&"&546; )5! '&óVšþhþÞÌf€²Ê#Ùì¾ fýœ¤—©’úáðìw_ò:@ ÜÜ9ìÜì1@ B •‘/Ìô9ìÌ0KSX·ííY%4$32#4&#"!7gìÙ#ʲ€fÌþÞþhš¾Xìðáú’©—¤ûédfFÿã.Õ=@ ÜìÜì1@ B •Œ‘ä9ôîÌÌ0KSX·ííY#"$533265!>þðìÙþÝʲ€fÌ"˜šü¨ìðáú’©—¤ýœfwÿã_Õ?@  ÜÜ9ìÜì1@ B •Œ‘ä9ôîÌÌ0KSX·ííY '!32653#"$5gþªš˜"Ìf€²ÊþÝÙìþðýôfdû餗©’úáðìÿÿ‰ ÍK': +ÿÿ‰ Íò'; +ÿÿ‰ ÍO'< +ÿÿ‰ÿã;ä'=ý+ÿÿ‰ÿã;O'>ý+ÿÿ‰ÿã Íä'@ +ÿÿ‰ÿã ÍO'A +‰¨(ä (2654&""&546323326=3#"&=ÉbFntnPX”¬¬”•«/¹Q,CE«ma¬ZT:KMMKFHn…|p‡‡pX;§oBGj§§„‡ˆƒ9‰¨$ä 3>2654&"!&546323326=3#"&=!"&54632!2654&"ÉbFntnP?+¬”•«/¹Q,CE«ma¬ûÊ”¬¬”•«/ëbFntnPZT:KMMKFH;Xp‡‡pX;§oBGj§§„‡ˆƒ9…|p‡‡pX;T:KMMKFHFY‰<@   üÄìÌÌ91·B•• /ìÔìÌ0KSX@ ííY!"3"$54$3!7Yûê™ÆbìþïúXýòhòþþ‘ƒ¥’¥ðìÝáUšÿÿFY‰'¤ÿ<-wþŠš8·  Ì9ÜÔìÌ1·B• •/ÌìÔì0KSX@ ííY!26544#!w™Æbìþýúü¨ gX‘ƒ¥’¥ðìÝáþ«šÿÿwþŠ'\ÿ</FþYš:@  üÌìÔÌ91·B • •/ÌìÔì0KSX@ ííY'!"$54$3"3!Yýœhü¨úþýìbÆ™XþišUáÝì𥒥ƒ‘ÿÿFþY'iÿ<1‰µ\ä'%!"&5463"3!\þ±=.ýÌž£¬§RiPY’¬÷Bè~ƒ}‡nDZHCwÕ%#535!53!3##qÉÉý=ÊýÃúÉÉÊà¤Ô­Ðý-þ‚¤à!®Õ%#5#53!3!3´ÊÉÉúýÃÊ=ýÉààà¤~Óý0­Ô¤ÿÿ!®O't5wÕ533#!#5!5#5qÊÉÉý=ÊýÃúÉõàà¤þ‚ý-ЭԤÿÿwO'Út7!®Õ3#!#!#5353´ÉÉúýÃÊ=ýÉÉÊõ¤Ô­ý0Ó~¤àÿÿ!®O'Vt9 ›èß33#!#!5#53‰Ïþ¥‘mþ ßunfyþ~ÔnÉÿãÁÕ ,@  üì22Üì1@ • •Œ‘/ìôîÔ99ì0%2654&#"672#"'"#3Åz­È_€²ÌÌ€²ëþÝÙ·{O{ʃ¤—¨”©“¤—ÍIðìúáH+ÕÿÿɰÕ'sZÕ@  2üìôì1¶• • /ìôì0# !3! !ôþËþá5ôÊþaþPþh–²/þéþÔþÒþè/ú+j‚€i‰œNß !!!5!—©ýùý;þßVýnV‰ìN#5!5!5!53!!75$iþÎ2þÜ$iþä*þÖmÖ‚œ°°Vxn°°Vþ¢þßnÕ††ý™  u!s #'#37ÿ ‰Í͉û‰»»sþÏþ¾ööH+ßßÿÿ‰—ò'Yôÿÿ‰ ±ò&+9sÿÿ‰ Éò&,;ÿÿ‰ ÉO&,<ÿÿ‰ÿã 7ä&,=ùÿÿ‰ÿã 7O&,>ùÿÿ‰ÿã Éä&,@ÿÿ‰ÿã ÉO&,Aÿì÷åŸ!!ùüŸ¨ÿìÿŸ!!#!þYÊþXŸ¨ý öÿìÿÆŸ !!###!ÚþYÊ÷ÊþXŸ¨ý öý öÿìÿ‡Ÿ!!#####!›þYÊ÷Ê÷ÊþXŸ¨ý öý öý öÿìÿ HŸ!!#######! \þYÊ÷Ê÷Ê÷ÊþXŸ¨ý öý öý öý öÿìÿ Ÿ!!#########! þYÊ÷Ê÷Ê÷Ê÷ÊþXŸ¨ý öý öý öý öý öÿì÷”!3!!¨Ê§ûçŸõý ¨ÿì÷Æ” !333!!¨Ê÷ʧú&Ÿõý õý ¨ÿì÷‡”!33333!!¨Ê÷Ê÷ʧøeŸõý õý õý ¨ÿì÷ G”!3333333!!¨Ê÷Ê÷Ê÷ʦö¥Ÿõý õý õý õý ¨ÿì÷ ”!333333333!!¨Ê÷Ê÷Ê÷Ê÷ʧôãŸõý õý õý õý õý ¨ÿìÿ” !3!!#!ÂêÕêþ?êÕêþrŸõý ¨ý öÿìÿÓ”!333!!###!ÂêÕêîêÕêþ?êÕêîêÕêþrŸõý õý ¨ý öý öÿìÿ–”!33333!!#####!ÂêÕêîêÕêîêÕêþ?êÕêîêÕêîêÕêþrŸõý õý õý ¨ý öý öý öÿìÿ Y”#!3333333!!#######!ÂêÕêîêÕêîêÕêîêÕêþ?êÕêîêÕêîêÕêîêÕêþrŸõý õý õý õý ¨ý öý öý öý öÿìÿ ”+!333333333!!#########!ÂêÕêîêÕêîêÕêîêÕêîêÕêþ?êÕêîêÕêîêÕêîêÕêîêÕêþrŸõý õý õý õý õý ¨ý öý öý öý öý öÿìSC !3!!#!¨Ê§þYÊþXŸ¤þ\¨þ\¤ÿìSÆC!333!!###!¨ÊöʨþXÊöÊþXŸ¤þ\¤þ\¨þ\¤þ\¤ÿìS„C!33333!!#####!¨ÊöÊøÊ¤þ\ÊøÊöÊþXŸ¤þ\¤þ\¤þ\¨þ\¤þ\¤þ\¤ÿìS FC#!3333333!!#######!¨ÊöÊøÊöʦþZÊöÊøÊöÊþXŸ¤þ\¤þ\¤þ\¤þ\¨þ\¤þ\¤þ\¤þ\¤ÿìS C+!333333333!!#########!¨ÊöÊøÊöÊøÊ§þYÊøÊöÊøÊöÊþXŸ¤þ\¤þ\¤þ\¤þ\¤þ\¨þ\¤þ\¤þ\¤þ\¤þ\¤ÿìÿ”!33!!# #!êÕššÕêþrêÕ™™ÕêþrŸõþòý ¨ý ïþöÿìÿ”%!3!!#!!2ÐÑü^DéD^þ£þ»éþ»þ£ÏŸ÷þæ¨õý ¨ý öþÿìÿWcŸ !!!5!5!!!wûûùþÑùüsþXŸ¨þ¨¨þ ÿìþ ·Ÿ#5!! !!'!%'! !7%!77'7! Ëþºýô þúþwƒþúƒƒþúƒþwþú ýô‰ƒþúƒƒþúƒƒƒƒƒ‰þú÷¨¨þþu|ù||ù|þ‹ññþ‹|ù||þ|||||u ÿì÷ G7+/37;?CGKO!5#535#535#53533533533533#3#3#!!#3%#3%#3#3%#3%#3#3%#3%#3¨ÊÊÊÊÊÊÊ÷Ê÷Ê÷ÊÊÊÊÊÊʦö¥ë÷÷þ?÷÷þ?÷÷‚÷÷þ?÷÷þ?÷÷‚÷÷þ?÷÷þ?÷÷Ÿ¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨𨨨¨¨¨¨¨¨¨¨¨¨¨¨¨¨ÿì§‹Ÿ!!!!¶øüÊŸúaO¨ø¨q:#[!' 7#þ}þCrŸþar¼Ÿ¨þCrŸžrþDÿì:ž[! !„¼rþaŸrþCþ}Ÿ¼rþbþar½=` !#!#3!ÃfþfäúþÀÀþí`ýG [`3!!!!!!!! Ùjýöóþ ý/þ¾tšè`”þÓ”þˆ“þíÍýÚ&{ÿão{4=J%#"'&=!.#"5>32>32#!3267#"'&32767%2654'&#"JÔ„â„„N Ì·hddddÐj§||MIؽii~ûþþST—`¶Te__ZŽjkü÷SR‰™\]i߬A@o™\]›Z^‘’úZ¿È5®*,=>` #% 54)3#4+327#!5#53!2xþþþúÜÜÞìòòì¹ÖŒçÖþ9||¶ÅÔ™µ´f¤_‘þڪИr–¤ø¤Äÿÿqÿãç{Fºg`32654&#%! )sÙËËÙþº7F0þÎþ¼þÉÍüÇÇÖÕÇ“þñþàþßþð$g` ! )#53!#32654&+º7F0þÎþ¼þÉ––zÁÙËËÙ`þñþàþßþðõ¤¤þŸÇÖÕÇþ̺‹` !!!!!!ºÄýöóþ ý/`”þÓ”þˆ“‚ÿãÅ|1#"&'5327654'&+5327654'&#"567632¿p<54& #.54! ì++ãþfã++ª$$>:#tNP³ÆÆ³PNM¥]ý*þÓþúU¢3MY + 3267>54&#"'>3 '# 5467'7²ý°*(èÈOuš))ëÓHn.—MÅw834¨O³MÆxþíþÇ43¨Nç)gA“¬\*g>—©}66þïñ]ŸC‹_’56ð`¡?‹`qÿãÃ{&/=5!&'&#"5>3267632#"'&'#"'&732767276'&#"qN ff·jÈbdÐj òQGhiŒñˆ‰‰ˆñŒijBNèâ„„¹RR‰™\]”VVUV•“¬VVZ¾dc44®*,nmn67œþíþ윜78lkp‘’ĘZYWWžþ´st’tsèÈÇtuq/u{ 4&#"#32²¬“”¬Âñð/ÇéçÉ8þÈþìqÿãu/ 32653#"4¬“”¬Âþïñðþî/ÇéçÉþìþÈ8—Ì`!264&#%!2#!#N[cc[þH¸¼ÁÁ¼þÿ·Åþ˜^¬^›ªþ¶ªþ>2`!.54763!##"#676#";µjpklÙ„¹©a;;?¢Ã®545ØÆw?@@?wÆ Œi¢QPû Ù%$qþá2^66É**TS++2`!&'&'3;3!"'&546#"3µ7545®Ã¢?;;a©¹þ|Ùlkp Æw?@@?wS66^2þáq$%Ùû PQ¢iŒþcQ++ST**ÿÿ<m`Öºÿà`$ 653 &53æs¹ÙþXÙ¹}Ž¢³ý;ÛààÛÅýM¢®L+ö%!5!2654&#!5!#TýZŸŸŸ¾¤ý…`¬fcðL¸||–¬¸¸B²tÂÈ®NÛø5353!5!2654&#!5!#®ÊÊÊŒýZŸŸŸ¾¤ý…`¬fcðxÌÌþzÊʤ¸||”®¸¸D°vÀÈ/þª{&#!5!2654&#!5!27654'&#!5!#¸|vz{âý\ž¡œ¾¤ý‡ž¢MN`_£ý‡`®gb>> EÀ‚¯__¹ru¦¹99wSS¹¹?°yzVUÿÿ=`YÿÿV5`ZÿÿXÛ`]xÿãº`73264&+5%5!2 'СӀ„{n ýÔþöF—oäþ}ɽBd»d>““þÂJŸm ¶7³ü{3!!³Iý{ªü/ÿÿ=`N—ì`#!#ì¶þ¶`û ·üI`ÿÿ—Ì`~Z^`367653#5&'&3¸U9Vˆm±¸¯mŠÄV9S`ý1MsÉ,þÔþìœ}îî}œ,þÔÇuMÿÿLs`Ï œhà !3#'!#¹­Zõg„VþXV†qþ`ü¼ÖÖœ–à!!!!!5!#!Šþ.¿þAÞý¢þ³eŠWÐ"à_ø_þÑ_ÖÖDXþI·œà &327654'&#327654'&#%!2#!þÌg1221g̼^-..-^þÅE‘OO)(N^h¬žþ¯+þÎ&&MO%%Xü@? ]65dL.- rUpzœ•à 327654'&#%! )þšÂ[ZZ[Âþ瀀þðþûƒývNO©¨NN]eeרfeœÝà !!!!!!Rþ-Àþ@ßý¢à_ø_þÑ_Sœ±à !5!!5!5!5±ý¢Þþ@Àþ-àü¼_/_ø_HŒ~ï$5#5!#"'&547632&'&#"326ÐNJYXeÝ|}}|Ý\SRFFPOW­WVVW­Cjá]þ™/rsÌÍsr'y5UVª©VUœLà 3!3#!#΀€þ2àþ©Wü¼Žþrœþà3#àü¼ÿ½¶þà 3+53265A@1(TFàüö—DE`Tlœià 33 ##¦¤þ-ô§þ<àþŸaþzþB“þmœÈà3!!Êý·àý_œÛà 33###½ðò½|ò€ó{àýÇ9ü¼ÞýÃ=ý"œGà 33##«¡|¬þ_{àýE»ü¼»ýEœGà ##3G|þ_«{¡àü¼»ýEDýE»HŒ¯ï"327654'&$  '&üŠRQQRŠ‹QQQQþ¯Œwvvwþtww“[\Ÿž\[[\žŸ\[\vvÆÅvvuvŒGŒ>ï@"327654'&327654'&'52#"&54767&'&54763ÂsCDDCstDCCBšR65<%€j<=0ER^X65`l<=ca¸·Ä==ll*6RI¢)++LK,++,KL++5##,&)$%LY+8:6iG2278PyAA‚yP87'21I.*œÞà 32764'&#%!2+#þ Y0110YþážQQQQž ƒþÆ))–))]?@ö@?þ°œ[à #'&'&+#!232654&#=)&''ˆy.,,LŠ¡PO)*þs \^^\$ )(GäÖTþŸD<32#"&'#3t45¸5445¸5þª$pMPPPPMp$uucä@AA@ä@AA86Z[þØ[Z68^gGŒ¾3#5#"'&76322764'&"Jtt%78N€PQQP€N87þš45¸5555¸5°Sü™^8Z[([Z¡ä@AA@ä@AAGŒÕ#!32767#"'&547632&'&#"Õýë@AsC?>>>BAD©bc^]ŸŽSSt44Va:: ï2j88a WW•š[ZQRmT3210XGŒÕMK° SX@ ÔÌÄÔÌ2K°SK°QZK°T[X½ÿÀÿÀÿÀ888Y1@   ÔÌ/ÌÔÌÔÌ0Y5!.#"5>32#"&73267G‚sC}>?ƒC©Å»ŸŽ¦thVau»2koa®•šµ£mTebXTŒb2&'&547632.#";#"32767#"&5476ùG&%HG{065>=f,K,,+*Ib]W-155_;65-9553–¢+,î$$4O,, ^$'U13 `fa<))RŒ`1#"'&'532654'&+5327654'&#"5>32»FLHG{065>=23-KX+*Ib]V.156_:65-9j2–RQ,+¼ H4O-+]4$'U 12  `33a<))G­¾ 14'&#"327#"'&'53276=#"'&763253J44^]4444]^4¨PP¥=7633223r99$88N‚OPPO‚N88$tmà=>>=à=>>F NO e 45k37XX"XX7_z¨î3#53ztttýô‚‚uœç 33 ##uuZ”þ‰†—þšuýþþÛþ²2þÎuœ{"4@ $ #ÔÜ32>32#4&#"²tHKYhuu'oMLl+yRowtHJZiþþžw[Wk\þžsa97EBEB‰~þ…wZXku­Ä4@ ÔÜþzx66X6V‚YYk\þžsa8BDGŒÏ 6@ ÔÌÔÌK°SK°QZK°T[X»ÿÀ ÿÀ88Y1@ ÔÌ/Ì0"32654&'2#"&546‹]ml^]ll]—­­—˜¬¬Çqq‚poƒW®›š¯¯š›®GŒu 67632#"'&'532764'&#"G0336¥^_]^ :5311213p?>>?p3121÷ XX™—YY _ ?@æ@? GÕÏ4'&"#46320T66º67z¬˜—WVÕoBAA@q›®WW›GŒÏÕ27653#"'&50Â66º67z¬˜—VWÕoBAA@q›®WW›u­ì#3>32#"&$4'&"27êuu$pMPPPPMpf45¸5445¸5úþ³b_86Z[þØ[Z6¡ä@AA@ä@AA#œÛÁ3#;#"'&5#535ìïï0Hww†33UUÁ²Pþ¬M,V-,vTP²nŒ½3327653#5#"&nt''N^67tt+78Jy~”{þˆY,-65\cý`9†nÇAÔ!5!27654'&#!5!#þU¦e22<KLÇg#"FS10gg%dAl88u{(#"&53327653327653#5#"&Q+<=Rnxu$$IZ54t$$KY45tt(78LMlE!"Šzþ‰[+,64\cþ‰[+,66Zcýb;F&œÕ33#&{ÝÜ{þøžýòýy­Û #! !&'3254554#"ít n°þÏ…9F}µþÛæ”¥Ãþê^Ø™83•þö¸a°ž _·{¯­Õ3#5&+532ã›Ü{þãt¹<,|­þ|æýïïÔGXGŒÏï+&#" '&54767&54!232654'&'&yA– §‚JZVWþÒVWW!/b‹LþÌ+"766^]l9=P(r(B4?Kœ”WXXWšr]$,O˜'þø(@ä?A‚jp69G­  )"27654'&'2##5"'&5476734 )=;67-!XQVVQs~SVV@h)%661F¼Qþ:5}t?3XJO¥˜ZUâáUXš R=\ ,Ajq@:©%­Ä'#&+53;'&Í^Á‰sa,£(^Á‰þïra,£×þƼGX]×:þDþøFYÿÿzîg Nýdÿÿu‚uýdÿÿnÿð½s»ýdÿÿ&Õs¾ýdÿÿyÿÛo¿ýdÿÿÿÕsÀýdyÿï‚67632#"&'#44&#"326²&_%s€  €No%tþi\[jj[\i92µþض78þ³"{q‚‚qrÿÿGÿ xÂýdÿÿ%ÿÄtÃýdºþV£{(!2.#">32#"&'#32654&#"ºþa¬QQžRµ´9²|ÎüüÎ|²9¸¸¥•”¥¥”•¥F³,*½¿[cbþÆþýþüþÆbcª#ÈÜÜÈÇÜÜÿÿœLà—t„`5!#3#3!53#53t¨¨¨¨ýð°°°¼¤¤þ¬¤þत ¤T2þV${"+%##533>323##"&!3276!&'&#"s¹ˆˆ¹:±{Ë€f… t€Ë{±7ýJT’’TJýf>T’’T>¨ý®®̪da¢‚Ãê•¢aÀ®fttf>„VttV‘þV/%+53276'7#3/¤´F0j&*¸¸š®ÖÀœ06”ú†GŒ¾#367632#"'&$4'&"27»tt%87N€PQQP€N78f54¸5555¸4ú_s^8Z[þØ[Z¡äA@@AäA@@GŒu&'&#"32767#"&54632u1122q>??>q22110h;Ÿ¼¾¥533÷` @?æ?@ _²—™° GKu+325&#"47&'&54632&'&#"632#"Z%0\R@5`$^¾¥4412/412q>??5{¼Ò3î *š &;/Z–™° ` ?@æ@bŠiGŒÏ.&'&#"32654'&7#"&54632''7'37 i:;n\[nO$$ZY‘’²®‹ dɱrPѺœ =67TŒb1#"'&'5327654'&+532654'&#"5>32½N+,QR–2658-56:_651.V]aIV-+K-32==l/|GHLî ))¿¿unn77wU:8PýÝ#P,i/0ÿé­\+53276=#5333î43r,Brrtnœ x66XU P#ýÝPG­¾ ,5#"3276#"'&'53276=#"'&54763JÆ]4444]^44tPP¥=7633223r99$88N‚OPPO‚Ýë>=à=>>=¢ýÛ NO e 45k37XX‘‚XXn­½3327653##"&nt''N^67tt+87Jy~”{þˆY,-65\cüžO9†Iœ– 5333##53#Irtggttt™\þæ\ýýj‚zœ~ ;#"&5îC,rfþpUWlwIœ– 5!#3!53IMjjþ³o³\\þE\\»Iœ–5!#3#3!535#535IMjjjjþ³ooo³\\¾\¡\\¡\¾ÿV­`3#"54;33#'#"3276ztte¿ªztry "3rKNB ‚ü,|ssýW?#5˜$ z­~3;#"&5ztC,rfäüáSVXlx[­`+53276'7#3`34r,Bttòax66XS güïqœƒ3!!q“ýîýÝ_u­{467632+53265&7454&#"#4'&#"#367632Ÿ+=32#4'&#"î43r,B0t*pJz>?t'(N^66‘x66X6V~a88BDþ…wY,-56\u­U 4'&#"#367632;#"'&5P''N^66uu)89Jy?>0B,r34Y,-56\þžsa8BDþzV6X66xqœÄ 33##q«-{«þÓ{þùý~úþGŒÏ 2#"'&5476"!&'!3276‹—WVVW—˜UWWUõº6/‘/1þw &6^]6&WW›šWXXWš›WWW@9\[8ïE-AA.G®Ï&.#5!#3!535&'&5476767654'&O—¢—pFVVFp—þ^—nCWWCnt6%66%ª4#76$§\\ŒFW›šWG…\\†FWš›WE[þ*,ApoA-þ9Ô*Aâ@+F­a:.#"#"/;#"'&=32654'&/.547632;1j8W*,]({44MNˆ9> 0B“ r34@?>=RX l)k`GF‚@rýb/$+*MW33 V6X66x"j2-*TIX00ÿé­Ê476;#"+5326z73zno>43r,B0‘]Me30U:ýJx66X6#­ÛÁ3#;+5326=#"'&5#535ìïï0Hw43r,B0†33UUÁ²Pþ¬M,ax66X6V -,vTP²^Œ!533!33##5#"&=)3276^ntgtuut+87Jy~Úþš''N^61™\þæþæ\ý`9†‚Y,-6/G‹Ø&5!327654'&'5!# '&54767GE()78Z[78*,?”G$"ZYþäYZ!"J³\{':?KY7667YR8>#{\8?>LƒRRQR€R<=:uŠ’2653#"'&53„QHuDE…†EDuHâPZƒþs{>??>{þ}ZPzœ¿3+"&53?27654'&'&gËH#"YZŽ,rftA Z87)2:0Ä8?>LƒRRlwþpU67YQ8C&œÕ# #3Õ{ÜÝ{ žœýòs7œn !!!5!G'þL´ýÉ´þ\^þ=R^Ã7­ý!!#;#"&=!5!G'þL´C,rfþ>´þ\^þ=R VXlx ^Ã7^n#47#5!5!3632#'3254#|`å´þ\'þLn&ŠÒ m,7œ!!^ÃR^þ=¢ŠjR37¨£!2#"'&'5327654'&+5!5!hCQ>63``°;??C5~Ex>?::hnþ\&§ =;M|CD m**PJ*)]R^GÏ !32767&'&"2#"&76Sþo/6^]6/ +6º6,Ç—WVVW—˜¬VV*€MWXMÞmGYXFoƒvwþ^wwî¢wvü[îÿ¥f!5!73þ°ý«¨‹î”äü[îÿ¥f3!ýPõ‹¨îxä”ü[îÿ¥f#'!5þ°õ‹¨ýéfþˆä”ü[îÿ¥f!!#ýPUý騋f”äüBîÿ¾f 3#'#3þ5”õ‹´´”õ‹´fþˆõõxõüBîÿ¾f 73#'#ýË´´‹õ”´´‹õfõõþˆõõxÿÿþhÕ'Ö¼$ÿÿ{þ-{'ÖTDÿÿÉìP'¼u%ÿÿ¸ÿã¤R'¸>EÿÿÉþ‰ìÕ&%Ô¥ÿÿºþ‰¤&EÔšÿÿÉþÀìÕ&%—ÿÿºþÀ¤&Eÿÿsþu'l'Lv‰ÿÿqþuçf&©vCÿÿɰP'ìu'ÿÿqÿãZ‰'¸þuGÿÿÉþаÕ'Ôì'ÿÿqþŠZ'ÔfGÿÿÉþÁ°Õ'âì'ÿÿqþÁZ'âfGÿÿÉþw°Õ&'z[ÿÿqþuZ&GzöÿÿÉþ°Õ'Þì'ÿÿqþZ'ÞfGÿÿÉ‹Z&(Oîÿÿqÿã^'OÿÙÿHÿÿÉ‹Z&(Nìÿÿqÿã^&HNÿ×ÿÿÿÉþK‹Õ&(Þ±7ÿÿqþK{&HÞ°7ÿÿÉþv‹Õ&(°³ÿÿqþv{&H°›ÿÿÉþu‹m'¡u&(z¾ÿÿqþuH&H'š‡zKÿÿÉ#O'vt)ÿÿ/ø‰'¸àuIÿÿsÿã‹&*‹2"ÿÿqþVZö&J‹IÿÿÉ;N's+ÿÿ¸dR'¸>KÿÿÉþ‰;Õ'Ô+ÿÿºþ‰d'ÔKÿÿÉ;P&+j@ÿÿÿídN'¹>Kÿÿþt;Õ&+zþîÿÿÿÿþtd&KzþßÿÿÿÿÉþ9;Õ&+ß ÿÿºþ9d&Kß•ÿÿþv”Õ&,°ÿJÿÿÿÓþvg'°ÿLÿÿYZ&,LþtÿÿÿôF&óLþaþ¼ÿÿÉjl'âv.ÿÿºœl'ZvNÿÿÉþ‰jÕ&.ÔÜÿÿºþ‰œ&NÔ‘ÿÿÉþÀjÕ&. ÿÿºþÀœ&NvÿÿÉþ‰jÕ'Ôš/ÿÿÉþ‰„'Ô'O ÿÿþŠjk'µ*u'Ô™/ÿÿÿýþ‰S1'qÿ(; 4ÿÿÉþÀjÕ&/ŽÿÿÿôþÀJ'ÿOÿÿÉþjÕ'ˆ—ù&/ÿÿÿÞþ\'ˆÿù&OÿÿÉl'sv0ÿÿºf&Pv”ÿÿÉO'wt0ÿÿº'¸éPÿÿÉþ‰Õ'Ôt0ÿÿºþ‰{'ÔæPÿÿÉ3P'õu1ÿÿºd'¸‰QÿÿÉþ‰3Õ'Ôþ1ÿÿºþ‰d{'ÔQÿÿÉþÀ3Õ&1÷ÿÿºþÀd{&QŒÿÿÉþ3Õ'ˆþù&1ÿÿºþd{'ˆ•ù&QÿÿsÿãÙZ&2Tfÿÿqÿãu &RTÿ²þ²ÿÿsÿãÙV&2Rlÿÿqÿãu&R'joÿrÿÿsÿãÙZ&2Ojÿÿqÿãu^&ROÿµÿÿÿsÿãÙZ&2Nhÿÿqÿãu^'Nÿ¹ÿRÿÿÉl'žv3ÿÿºþV¤f&Sv2ÿÿÉO'„t3ÿÿºþV¤'¸¦SÿÿÉTN'ƒs5ÿÿºJ'¸UÿÿÉþ‰TÕ'Ô}5ÿÿºþ‰J{'Ô UÿÿÉþ‰T1'q}; Wÿÿºþ‰Jõ&qÿ XÿÿÉþÀTÕ&5åÿÿTþÀJ{&Uÿÿÿ‡ÿã¢O'¸t6ÿÿoÿãÇ'¸'Vÿÿ‡þ‰¢ð'ÔŠ6ÿÿoþŠÇ{'Ô%Vÿÿ‡ÿã¢m'âv'¤’6ÿÿoÿãâf&V&›ŒVvÿÿ‡ÿã¢W&Sä6ÿÿoÿãÇÉ'¸-µ#ÿÿ‡þ‰¢O'›t _ÿÿoþŠÇÞ'¸'ÿÊ `ÿÿÿúéO'rt7ÿÿ7ò‰'¸uWÿÿÿúþ‰éÕ'Ôq7ÿÿ7þ‰òž'ÔèWÿÿÿúþÀéÕ&7bÿÿ7þÀž&ôWÿÿÿúþéÕ'ˆrù&7ÿÿ7þ'ž'ˆÿèù&Wÿÿ²þ‰)Õ'Õð8ÿÿ®þ‰X{'Õ{Xÿÿ²þv)Õ&8°òÿÿ®þvX{&X°ÿÿ²þK)Õ&8Þà7ÿÿ®þKX{&XÞu7ÿÿ²ÿã)Z&T.8ÿÿ®ÿãXì&+v–†ÿÿ²ÿã)4&J28ÿÿ®ÿãXô'JÿÈþÀXÿÿh}&9žíFÿÿ=7&Yžmÿÿþ‰hÕ&9Ô¼ÿÿ=þ‰`&YÔ^ÿÿD¦r'õ|:ÿÿV5k'C ZÿÿD¦r'õ|:ÿÿV5m'v†ZÿÿD¦N'jõ>:ÿÿV5'jEZÿÿD¦N'õs:ÿÿV5'¸GZÿÿDþ‰¦Õ&:ÔûÿÿVþ‰5`&ZÔJÿÿ=;O'Ês;ÿÿ;y'¸b[ÿÿ=;N&;jÊ>ÿÿ;y&[jfÿÿÿüçP'ru<ÿÿ=þV'¸`\ÿÿ\m'¾u=ÿÿXÛf&]ˆÿÿ\þ‰Õ&=ÔÙÿÿXþ‰Û`&]Ô1ÿÿ\þÀÕ&=ÇÿÿXþÀÛ`&]ÿÿºþÀd&KfÿÿòN&Wjÿ->ÿÿV5&ZœBÿÿ=þV&\œÿÿ{ÿãa&D€Úÿÿ/ø‰'¸àuAø!#'7#53546;#"7˜¹“Jݰ°®½®°d&&ÖKþßhjN»«™()gþt˜iÏ/ø!##535#53676;#"3#˜¹°°°³ GW½®°d&ýÿEŒ‰FV™( D²ÿã´ò7&#"#4>32"#"'532654.546m®@f_@&Ë9d¦cÙ07ÏþÿCjjCþ÷Ó´Ém±ob—)F[dd[F)ßôZ@h§oüˆ‘ƒÏ‹\(Ž}_-C-->TŒ\¤É_ÐEFvX5P3) $2BgC»ÿÿqÿãuðHÿÿþ‰hÕ'Ô·$ÿÿ{þ‰-{'Ô!Dÿÿhð&$º¼uÿÿ{ÿã-{&DºTÿÿh:&$Uÿÿ{ÿã¯Å'Uÿ—þ‹Dÿÿh:&$Vÿÿ{ÿã-Æ&DVÿ”þŒÿÿh[&$\ÿÿ{ÿãæ'\ÿ–þ‹Dÿÿhu&$Wÿÿ{ÿã-'Wÿ–þ‹Dÿÿþ‰hm&„Ô¯ÿÿ{þ‰-f&¤Ô"ÿÿhZ&$Yÿÿ{ÿã-'Yÿ‘þªDÿÿhZ&$Zÿÿ{ÿã-'Zÿ’þªDÿÿh‹&$[ÿÿ{ÿã-5'[ÿ”þªDÿÿhY&$Xÿÿ{ÿã-&DXÿ’þªÿÿþ‰h’&ÄÔÀÿÿ{þ‰-&ÅÔ3ÿÿÉþ‰‹Õ&(Ôžÿÿqþ‰{&HÔ‹ÿÿÉ‹ð&(ºžuÿÿqÿã{&HºÿÿÉ‹^'žu(ÿÿqÿã7'ž—HÿÿÉ:&(UÿÿqÿãèÅ'UÿÐþ‹HÿÿÉ‹:&(VîÿÿqÿãÆ'VÿÐþŒHÿÿÉõ[&(\îÿÿqÿã׿&H\ÿÐþ‹ÿÿÉ‹u&(Wêÿÿqÿã'WÿÑþ‹HÿÿÉþ‰‹m&ŒÔžÿÿqþ‰f'Ô‹& ¶ˆ‹ÿÿZð&,º#uÿÿD|&óº ÿÿÉþ‰“Õ&,Ô.ÿÿ¿þ‰y&LÔÿÿsþ‰Ùð&2Ô'ÿÿqþ‰u{&RÔsÿÿsÿãÙð&2º'uÿÿqÿãu{&Rº}ÿÿsÿãÙ:&2UlÿÿqÿãÎÅ'Uÿ¶þ‹RÿÿsÿãÙ:&2VjÿÿqÿãuÆ'VÿµþŒRÿÿsÿãÙ[&2\jÿÿqÿã½æ'\ÿ¶þ‹RÿÿsÿãÙu&2Weÿÿqÿãu'Wÿ¶þ‹Rÿÿsþ‰Ùm&–Ô'ÿÿqþ‰uf'Ôs& ʈsÿÿgÿãk''ubÿÿvÿãÓf&vscÿÿgÿãk''ubÿÿvÿãÓf&Cscÿÿgÿãð&bº'uÿÿvÿãÓ{&cº}ÿÿgÿã^''ubÿÿvÿãÓ7&žscÿÿgþ‰&bÔ'ÿÿvþ‰Óë&cÔsÿÿ²þ‰)Õ&8Ôõÿÿ®þ‰X{&XÔ{ÿÿ²ÿã)ð&8ºîuÿÿ®ÿãX{&Xº}ÿÿ­ÿ÷_k'îuqÿÿ°ÿãif&v{rÿÿ­ÿ÷_k'îuqÿÿ°ÿãif&C{rÿÿ­ÿ÷_ð&qºîuÿÿ°ÿãi{&rº}ÿÿ­ÿ÷_^'îuqÿÿ°ÿãi7'ž€rÿÿ­þ‰_&qÔõÿÿ°þ‰ië&rÔ{ÿÿÿüçr&<r|ÿÿ=þVk&\C!ÿÿÿüþ‰çÕ'Ôv<ÿÿ=þV`'Ôt\ÿÿÿüç÷&<ºr|ÿÿ=þV‚&\º`ÿÿÿüç^'ru<ÿÿ=þV7&žw\ÉÕ 333!!ÉÊèÊ×ú­ÕúÕ+úÕª ²33533#####53Á¸à¸¡¡¸à¸¡¡“““}úüúü}ÿÿqÿçäa&E ©pÿÿqÿçäa&E áHÿÿqÿçäf&E ¶”ÿÿqÿçäf&E Äÿÿqÿçäf&E ·„ÿÿqÿçäf&E Ä ÿÿqÿçäm&E ¸vÿÿqÿçäm&E ÅDÿÿha&& ©ÿ#ÿÿha&& áþóÿÿôf'&Œ ¶ÿ|ÿÿôf'&Œ Èÿÿf'&® ·ÿSÿÿXf'&ð Äÿoÿÿ™m&&1 ¸ÿQÿÿàm&&x ÅÿNÿÿ…ÿãÈa&I ©Dÿÿ…ÿãÈa&I á9ÿÿ…ÿãÈf&I ¶ ÿÿ…ÿãÈf&I Ã%ÿÿ…ÿããf&I ·Oÿÿ…ÿãf&I ÄRÿÿ-a'*¢ ©þÿÿ-a'*¢ áþÿÿ7f'*¬ ¶ÿ|ÿÿIf'*¾ Èÿÿ­f'*" ·ÿSÿÿéf'*^ ÄÿoÿÿºþVda&K ©¦ÿÿºþVda&K á¢ÿÿºþVdf&K ¶€ÿÿºþVdf&K ÃpÿÿºþVdf&K ·„ÿÿºþVdf&K Ä®ÿÿºþVdm&K ¸œÿÿºþVdm&K Ňÿÿéa',® ©þÿÿæa',« áþÿÿçf',¬ ¶ÿ|ÿÿíf',² Èÿÿnf',3 ·ÿSÿÿŸf',d Äÿoÿÿ¯m',t ¸ÿQÿÿÊm', ÅÿNÿÿ›na&M ©ÿÿÿ‘na&M áÿ ÿÿÿ°¹f&M ¶ÿ'ÿÿÿºÇf&M Ãÿ<ÿÿåf&M ·ÿQÿÿÿÒîf&M Äÿ=ÿÿÿËnm&M ¸ÿÿÿÿÆnm&M ÅÿÿÿAa'.® ©þÿÿ5a'.¢ áþÿÿKf'.¸ ¶ÿ|ÿÿKf'.¸ ÈÿÿÇf'.4 ·ÿSÿÿf'.p Äÿoÿÿ"m'. ¸ÿQÿÿ)m'.– ÅÿNÿÿqÿãua&S ©xÿÿqÿãua&S ánÿÿqÿãuf&S ¶eÿÿqÿãuf&S ÃTÿÿqÿãuf&S ·ˆÿÿqÿãuf&S Ä‘ÿÿÿãüa&4# ©þÿÿÿãVa&4} áþÿÿÿãOf'4v ¶ÿ|ÿÿÿãYf'4€ Èÿÿÿãf'46 ·ÿSÿÿÿãPf'4w Äÿoÿÿ•ÿã*a&Y ©=ÿÿ•ÿã*a&Y áÿÿ•ÿã*f&Y ¶'ÿÿ•ÿã*f&Y Ã!ÿÿ•ÿã*f&Y ·`ÿÿ•ÿã*f&Y ÄWÿÿ•ÿã*m&Y ¸8ÿÿ•ÿã*m&Y ÅÿÿIa'9b áþÿÿÿf'9 Èÿÿf'96 Äÿoÿÿ3m'9L ÅÿNÿÿ‡ÿã'a&] ©^ÿÿ‡ÿã'a&] áTÿÿ‡ÿã'f&] ¶Yÿÿ‡ÿã'f&] Ã^ÿÿ‡ÿã'f&] ·¤ÿÿ‡ÿã'f&] Ä‹ÿÿ‡ÿã'm&] ¸cÿÿ‡ÿã'm&] Å^ÿÿa&=N ©þÿÿqa'=¢ áþÿÿif'=š ¶ÿ|ÿÿuf'=¦ ÈÿÿCf'=t ·ÿSÿÿyf'=ª Äÿoÿÿm'=B ¸ÿQÿÿPm'= ÅÿNÿÿqÿçäf&E Õtÿÿqÿçäf@ÿÿ…ÿãÈf&I ÕTÿÿ…ÿãÈfAÿÿºþVdf&K ÕÆÿÿºþVdfBÿÿÿnf&M Õþãÿÿ¦˜fCÿÿqÿãuf&S Õ{ÿÿqÿãuf`ÿÿ•ÿã*f&Y Õ0ÿÿ•ÿã*faÿÿ‡ÿã'f&] ÕMÿÿ‡ÿã'fbÿÿqþVäa& ùHÿÿqþVäa& úHÿÿqþVäf& ûHÿÿqþVäf& üHÿÿqþVäf& ýHÿÿqþVäf& þHÿÿqþVäm& ÿHÿÿqþVäm& HÿÿþVha&  ¨ºÿÿþVha&  ¨ºÿÿþVôf&  ¨FÿÿþVôf&  ¨FÿÿþVf&  ¨hÿÿþVXf&  ¨ªÿÿþV™m&  ¨ëÿÿþVàm&  ¨2ÿÿºþVda& ÿ8ÿÿºþVda& ÿ8ÿÿºþVdf& ÿ8ÿÿºþVdf& ÿ8ÿÿºþVdf& ÿ8ÿÿºþVdf& ÿ8ÿÿºþVdm& ÿ8ÿÿºþVdm& ÿ8ÿÿþVéa&  ¨žÿÿþVæa&  ¨›ÿÿþVçf&  ¨œÿÿþVíf&  ¨¢ÿÿþVnf& ! ¨#ÿÿþVŸf& " ¨TÿÿþV¯m& # ¨dÿÿþVÊm& $ ¨ÿÿ‡þV'a& MYÿÿ‡þV'a& NYÿÿ‡þV'f& OYÿÿ‡þV'f& PYÿÿ‡þV'f& QYÿÿ‡þV'f& RYÿÿ‡þV'm& SYÿÿ‡þV'm& TYÿÿþVa& U ¨\ÿÿþVqa& V ¨°ÿÿþVif& W ¨¨ÿÿþVuf& X ¨´ÿÿþVCf& Y ¨‚ÿÿþVyf& Z ¨¸ÿÿþVm& [ ¨PÿÿþVPm& \ ¨ÿÿqÿçäH&Ešzÿÿqÿçäö&EqyÿÿqþVäf& ]HÿÿqþVäy&EHÿÿqþVäf&@Hÿÿqÿçä7&E ªnÿÿqþVä7&  Hÿÿhm&&ºuÿÿh1&&q¼;ÿÿÿüªf&&B ÕÿRÿÿhfÿÿþVhÕ&& ¨ºÿÿ†Âxa ©ÿÿ¶þV’ÿ¤†ÂxaH´ Ô<ܲ?]À1¶ Ô´?_]°KPXÌÀYÌ̲?]90±I±IPX³@@88Y#55#53xò†…ñÍþõgžÿÿ¶J7žÿÿ¶FJm'„jÿÿºþVdf& aÿ8ÿÿºþVd{&Kÿ8ÿÿºþVdf&Bÿ8ÿÿºþVd7&K ªÿÿºþVd7& ¯ÿ8ÿÿÿüíf'*b ÕÿRÿÿÿçufÿÿÿü©f',n ÕÿRÿÿÿóf ÿÿÉþV;Õ&, ¨ÿÿÿ‰Â’f' ©ÿ Õ ÿÿ´Â”f' ©ÿ. àBÿÿ¶ÂJm'„ ©ÿÿÿënH&Mšÿ$ÿÿÿãnö&MqÿÿÿÿØnÒ&M Óÿ.ÿÿ€Ò%ÿÿÿäx7&M ªÿ.ÿÿÿæzm&M «ÿ0ÿÿÿõgm&..uÿÿY1&.qÿ.;ÿÿÿüf'.q ÕÿRÿÿÿí}f!ÿÿ~‹f' áþø Õÿÿ•±f' áÿ à_ÿÿ¶ÂJm'„ áÿÿ•ÿã*H&Yš'ÿÿ•ÿã*ö&Yq$ÿÿ•ÿã*Ò&Y Óÿÿ•ÿã*ÒDÿÿºþV¤a&U ©»ÿÿºþV¤a&U á±ÿÿ•ÿã*7&Y ª'ÿÿ•ÿã*m&Y «ÿÿÿüçm&9vuÿÿÿüç1&9q€;ÿÿÿüÇf'9à ÕÿRÿÿÿá‘f#ÿÿ5a'6¨ áþÿÿªF)Ò&j Õlÿÿ×FRÒÿÿªð‰fCÿÿ‡þV'f& iYÿÿ‡þV'`&]Yÿÿ‡þV'f&bYÿÿ‡ÿã'7&] ªOÿÿ‡þV'7& ÙYÿÿÿüÿãf'4; ÕÿRÿÿÿòÿãf"ÿÿÿüf'=D ÕÿRÿÿÿÛf$ÿÿNþVÏç&= ¨ÿÿsîRfv†ÂxaH´ ÔÀܲ?]<1¶ Ô´?_]°KPXÌÀYÌ̲?]90±I±IPX³@@88Y53#7"†ò††òÍ”žgd߃¶œÜÌ1Ôì0!!dý僤ÿÿd߃ òdé³y¶©é/Æ1üì0!!dOû±ydéœy¶©é/Æ1üì0!!d8üÈydéœyµ©/Ì1Ôì0!!d8øÈyéyµ©/Ì1Ôì0!!øyÿÿþø&__Jÿÿÿìþÿî&BBB®éÓÕ@ žÜüÔÌ1ôì0#53Ó¤Ré­?þÁ²þ×Õ@ žÜìÔÌ1ôì03#Ó¤RÕ˜þÁ?®ÿÓþ@ žƒÔìÔÌ1üì0%3#Ó¤Rþ¬þÀ@²þ×Õ#5…R¤Õ˜þÁ?˜®émÕ '@ž   ÜüÌÔÌþÔÎ1ô<ì20#53#53Ó¤RšÓ¤Ré­?þÁ­­?þÁ®émÕ '@ ž  ÜìÔÌÜîÔÎ1ô<ì203#%3#Ó¤RšÓ¤RÕ¬þÀ@¬¬þÀ@®ÿmþ '@ žƒ   ÜìÔÌÜîÔÎ1ü<ì20%3#%3#šÓ¤RþfÓ¤Rþ¬þÀ@¬¬þÀ@®émÕ #5!#5R¤mR¤Õ­þÁ?­­þÁ?­9ÿ;ÇÕ '@¹  YW Y Ô<ìü<ì1äôÔ<ì203!!#!5!¨°oþ‘°þ‘oÕþ\™û£]™9ÿ;ÇÕ>@ ¹¹  ÂY W Y Ô<<ì2ü<<ì21äôÄ2Ä2î2î20%!#!5!!5!3!!!Çþ‘°þ‘oþ‘o°oþ‘oßþ\¤š™¤þ\™ýá3Ñ…! · Ç \ Ôì1Ôì04632#"&3­~|«¬}}¬ú|««|}¬¬3Õq3¢ðþˆìÁþ³Ôì1²ƒ/ì073#ìÕÕþþìkþ¶ÔüÔì1´ƒ/<ì20%3#%3#–ÕÕýVÕÕþþþþìþ #@ƒ   ÔüÔìÔì1/<<ì220%3#%3#%3#–ÔÔ©ÕÕú­ÕÕþþþþþþÜk¯i3#ÜÓÓiþqÿã Lð #'3?K®@D$%&%&'$'B@’ .’(’F’4 :&Œ$‘L%IC'1+C =  1 =I 7+ ! LüäìÔÄìäîîöîî991ä2ô<<ä2ì2îöîî20KSXííY"K°TK° T[K° T[K° T[K° T[K°T[X½L@LLÿÀ878Y"32654&'2#"&5462#"&546!3#"32654&2#"&546"32654&ôWddWUccUžº» º»ùtž¼»ŸŸ¹º% üZ VcbWWcd²žº» º»ŸWccWUcc‘”„‚••‚ƒ•Ü»»ÛÛ»¼ÛàÛ»½ÚÛ¼ºÜùóŽ•‚„””„–ýŸÜ»»ÛÛ»¼Û”„‚••‚ƒ• qÿã rð "-7;EP\"32654&'2#"&546"32654&'2#"&546  &54%3#"26542#"&546"32654& WddWUccUžº» º»ýyWddWUccUžº» º»øÖ<¼»þ¹ß üZ u¬cb®cNžº» º»ŸWccWUcc‘”„‚••‚ƒ•ÜþŠÛÛ»¼Û”„‚••‚ƒ•ÜþŠÛÛ»¼ÛàÛ»½ÚÛ¼ºÜùóŽ•‚„””„þ5ÜþŠÛÛ»¼Û”„‚••‚ƒ•(` Õ3(­Ëþß`uþ‹ÿÿ(`ÌÕ&  ,ÿÿ(`øÕ' ,&  X(` Õ#3 WþßË`uÿÿ(`ÌÕ&  ,ÿÿ(`øÕ& ' X , þ«ÿÃ#'#«”»¼•Rþùù¦žs#G@%èèèèBç¦onüì291ôì90KSXííííY" 5sþÓ-þ+#¿þôþô¿¢RÁ–#I@&èèèèBç¦opü<ì91ôì90KSXííííY"5 ÁÕþ+-þÓ#þ^Rþ^¿  ÿÿÃëÌ&™K'ÿèN''=NÎÿÿ“OÕ'ÿ^O“°ð$#5>323#7>54'&L¿ Za^Ág¸ßHZX/'ÅËËÅ-93A%‘­ #C¼98ŸL‰VV/5<4þòþBþR-5^1Y7ÿÿÿì| B_ÿ§þÇÿ… %³ ÄÔij991@  ÔÜÜ<Ì202$7#"$'56çÅåëþ:àßþ<ìæÂþµhh~vvuw~igÿ§Çn %³ ÄÔij991@  ÔÜÜ<Ì202&$#"56$6àÆëåþ;ççþ>æìÄnvv~hhgi~wuÿªþIÕ3 # #çbþâbíícÕþ$þ$Šþvÿÿ=ÿÅÃ' ý{' ý{ “Ý3_!!ÝVýª_Þþ‰ÿãÍð+@BŒ‘ÔÌ1ää0KSXííY"3#- ü\ ðùó°þòX 3!!#3hðþX¨ðð^ý#"ý#J°þòX 53#5!!53°ðð¨þXð^JÝøÞÝÿÿJð&"·"gÿÿ“Jð&"Jÿÿ“Jð'ÿ^"šdÿ–] 7· ÜÔ91@ B ©¼ Ìô<Äì20KSX·ììY327# 'dšêû³þà˜uþÃÈ]€û(®ìÿ;‡Õ 2###¬×ë׎¾Õ辸Ýü²ùášØÂ( 3+"&5463y¯¯v}¬­~ý±¬}|«ØÂ( ';2+‡¯¯v~­¬}ÂO«|}¬ÿÿ=ÿÅÃk ý{ÿB# #5#5ðÓÓR¤#þþüÛ¬þÀ@¬ÿÿÿ§þÇn& ! "ÿÿ=ÿòÃo' ý¨ ÿÿ‘ÿBCÕ'‘'ŽÿÙHdÓœ1#"'&'&'&#"5>32326œžæ’”ì 錄ܔžæ’°Ò 錂×1²OD;>MS²OE<>Lÿÿÿ§þÇÿ~ "ø8È| #'7!5!'737!!ª ùqùþŸaúqú úqúaþŸúq)þŸ`ùrù úrûbþžúqú ùrú2¶¶ 535353úÈ,ÈÈÈÈÈþ¢ÈȼÈÈÿÿ(`$Õ' ,& ' „ XfNè 53!535353fÈXÈý¨ÈÈÈÈÈÈÈþpÈÈ ÈÈföNÞ 5353535353öÈÈÈÈÈü,ÈÜȆÈÈþpÈÈ ÈÈüôÈÈ ÈÈÛ®Õ3#3#ÛÓÓÓÓÕþü'þdþåýï 3#%3#3#3#dÓÓÆÓÓýÓÓÓÓiþþþ„þùòþpDÕ %53535353#!5!3!†ÈÈÈü,ÈÜÈ| ýfš šöÈÈ ÈÈüôÈÈ ÈÈþ„ýfš ›ýe ÛP®> 3#3#3#ÛÓÓÓÓÓÓ>þýþöþÛ®w 3#3#3#3#ÛÓÓÓÓÓÓÓÓ‰þìþü–þðþWîð "27654/2#"&546Ê2332Ê233—¡ªª¡¢ªª—VV¬­VVVV­¬V¯ÞÓÔÞÞÔÓÞzœî@ Ü<Ü<Ì1@ÔÄÜÌ03#3#zttttýg‚?œôß Ô@ Ý ÷‘ ] ÜÔ<Äì291ôüÔ<ì290K°TK°T[K°T[K°T[K° T[K° T[X½@ÿÀ878YK°TK°T[X½ÿÀ@878Y@T /9IFYi‹«»       "5GK S[ e„¥µ]] !33##5!5ÝþË5¦‡‡þbfþ]ýämººyfÓß !!67632#"&'53264&#"Žþþy¡^^a`°<~B9>>Eo‚‚o4h6ß_Ì MLƒ‡KJq f®f\óð/"327654'&&'&#"67632#"&547632³X3333XW3333«1221€DD &9:D‘TTXW‘§°ll¶122m45[Z4554Z[54bg KL™1LM„ONÞÔÆuv lœÕß!#!liþ¤ˆHþ3ß0üíäYìð *:"32764'%&'&546 #"'&54767327654'&#"º55j]\655þìT./¤RQ./SZ85UVžŸUV56-/.UQ100/SS0/*,+KLV,+–+]12Hdt::dJ01:7PyAAAAyN98Æ?&%%$A?&%%$Séð.532767#"&547632#"'&2654'&#"‘1220DC #<9E¨WX‘§WXkl¶122ÌXf33XU5443®g KKš/˜„MNooÔÆuv rh\Z4554Z\44‰œ°k !!#!5!Q_þ¡iþ¡_kþÈ_þÈ8_8‰Ô°3!!‰'üÙ3_‰a°¥!!!!‰'üÙ'üÙ¥^‡_o #&'&4767TRRTe^///._üþþþ€ƒ€ú~„gˆ3#676'&ge_/../_eT)**)„~ú€ƒ€~~uœÄ0@ ÔÜ32ÄtNN^luu)qJy}þ…wYYk\þžsa88†ÿÿWÿñîT Mýdÿÿ‰ÅC{ýdÿÿ^´TtýdÿÿbÿñÍTuýdÿÿ?ôC OýdÿÿfÿñÓC Pýdÿÿ\ÿñóT QýdÿÿlÕC RýdÿÿYÿñìT SýdÿÿSÿñéT Týdÿÿ‰°Ï Uýdÿÿ‰8°— Výdÿÿ‰Å°  Wýdÿÿoÿif Xýdÿÿgÿiˆf YýdÿÿMÿ𡂦ýdÿÿGÿðÕ‚¬ýdÿÿGÿðÏ‚µýdÿÿu!s¥ýdÿÿGÿðÕ‚­ýdÿÿuÄgrýdÿÿuçg²ýdÿÿzîg£ýdÿÿu{‚³ýdÿÿuÄ‚ Zýdÿÿuÿ삹ýdÿÿu“¤ýdÿÿ#Û%ºýdV®Ö##"32.#"3267!!!!!!ÝO²cþþÛ%þe±NL­bÀÌÌÀb­LÄýÓýê:ý/¸667756ŸGFêþDêFG €þµ€þk€sÿ¦¾9'.473&'3267#"'#7&'#7&'&76%73&'hA>›/(%:@þÁwÓ]aØy›A9&›A²² œã‘X}R4>CþÁ5Aëi¥Õ<)û—^_ÓHH?W‡æÏghйKüpþØî”Ëû•(`ÿä³ð,%6767# !2.#"3>32.#".aXj]aÙyþÊþ›e6{Ù_]Ôwêù|^™˜0šn&<$€‹Š'/_ÓHGžghŸGGÕ_^þÇþØþÙœu]\Yª¶«…ËÕ!!!!3###5qZýpPý°úúÊì~WªþHªþµEþÇ9Ebð#!!53#535#535632.#"!!!5-üì¿¿ÇÇÖè=—OLˆ=”t‡þyìþ¾ªªB_ó¶))›ÔHºÿB+#&'&#"#3676323632#4&#"#̪m49wSS¹¹>YXyzU6%…ªX\x¯¾¹ru¦¹¾xGM_a¢ý‡`®f21>&>EÖ3öáý\ž¡œ¾¤ý‡"ôÕ"&)''#!333#3#!###535#53355ØP·8ÄÔæÄ¢¢¢¢þðÔæÄ¢¢¢¢8PP¯ÎÎþò““4ýÚ&ýÚ{“{ýÚ&ýÚ&{“{{““þòÎÎÉÿã ÎÕP32654&#+#!233!!;532654&/.54632.#"#"&'5#"&5‡ï…‘‘…Ýqzìï¾­ìzWQ®eþ›Gl«`»[z„_¡<¡ÓÂ`©HJžU]‹;¹›éËU·f«É˜/ýÏ’‡†’þÌÈjqý¨ÕqRˆ>þÂý ‰N#55YQKP%$•‚ž¬®((TT@I!*™‰œ¶##ŸÒ`Éÿã3ÕE326&##.+#! 32654&/.54632.#"#"'&“þ’••’¿Ù¿J‹xÜÊÈüƒ}A{>[b`ca‚Œe«@«˜àÎf´LN¨Z‰‰b”?Ä¥÷ØZa,/ýúØ–bý‰ÕÖØº$~´3YQKP%$•‚ž¬®((TT@I!*™‰œ¶;®Õ"&)-1'#53'3!73!733#3#####5!73'!!7¶]:1Ì00ã00Í19]zžáþÚÃÜþàŸÀ¥¥þu‘û ¥¥å}ýL‘uÂÂÂÂÂÂuü€€ü€€ýg™uuþüýg™uuuu_ÿãñÕ % #4&#!#)"33!3_ÿ¸°þ±¸Žýýÿþú¸°S¸ÒþÖþÜþ‘VðÓú²*$oþªðÓNÿÿqþÀô&ÓŠÿãð1@: Ó"+Ó ¡®•¡®•/‘Œ) 2+"!)#&  , & &*!/<ÔÄ2üÄÄ99999999991Ä2äôìôìîöîî2Ý<î20K° TK° T[K° T[K°T[K°T[K°T[X½2ÿÀ22@878Y@z  1Ti lnooooiko o!o"o#n$l%i'i-ŸŸŸ Ÿ Ÿ Ÿ Ÿ ŸŸŸŸŸŸ–Ÿ Ÿ!Ÿ"Ÿ#Ÿ$Ÿ%Ÿ&Ÿ'Ÿ(Ÿ)Ÿ*Ÿ+Ÿ,-2   USjg ]].#"!!!!3267#"#734&5465#7332[©fÊ A7ýæ¾8þŠ Êf©[Y¹`íþË(Ó7‹Â7œ(6ìb¹bÕiZÈ»{.# .{»ÊZiÓHH"{/ #/{"G(Õ33!!###5¿½uóý€ªþX°ùý_½—Tý‰wýsýÏý1ásÕ!5!!77#'%5'&ýîïýîåPþËæPþÊËçM4èMžªªþñ¡o؈¢oÙý¸º¡nÙˆ¢nÐþ9 ¤ð-bwƒ'67>32#"'&'"326767654'&'&67'>7632#"'.'&/#"'&54632326767654'&'&&#"32¹¢">1–aJ{%A01Q[W7>/÷W1   >$< ù¹ ´. #®dCw¯Ë-^URB$`>DL_K>.3b @N\uLM„iIä±(S395lš9,8„ýG(/&  -þ9)ЗiRm:3X’wdg7? 2øj7#=5(6$ 629T/ ·(2M !:5S}$@{mbõqŒ‚~Es/4 -& "TAB`]…’ü›|@8†nR€kcd]aCœû ".ÿãŽð)5'632327&547632#527654'#"'&#"%654'&#"¹‹“o|@X"07ãPYˆtaTkµ~jü†[Iw‰mqJ2530D#24!`ðNkB±þ¬X``S±ã«£¿Â†q¢J<“Xr~hFÙl¯V1??0W¦D¢Õ$+15#53!23#3#+##5!3276!&'&+!!64—RRÈûL\HGZMûþÊSþþMþÿMþ#ýÝ#ìVtqDjt,tkDqý¨xttzIYIíV,]ÿ[±x$-#5&'&76753&'&'6767#5!'ùŒß‰¨¨‰ßŒi`p^_kbkN?H9x"cxhuŒ…OooO¥§Ìmnͦ‰$F×_0,û?'‘¦ýS*%²§ l™þÑþÒ™lÕ5!3!!3##!##5373!/331µåµ0þûG¾“µÒªþªÕµ’½IÁC©DúÒiR{ýø{Ï{ýøýø{ÏÏÏ{Auÿã¼ð66767!5!67654&#"5>323!!!3267# $547#5\J€þ5’ ;³¥_ÌsrÚiõ¯þýgØC…üS1¼­rì{€ïjþçþݨ¡J,{ +kv€67Å&&äÆUB{\* {;^~ˆFEÐ/0àÙK?{¥þÓr*.#267#&'&576753r\¨ee¨\Z\X[d¹tÔÔy²e]X\þ‹[CvlC¤ÕiZûñZiÓH$"þðvÖ9BËtèâ"$û¤ùCuª¡f´lCÕ !!!!#!ïûïýîËýîÕªxªû÷ j¯Õ&7!!!##&'&+532767!7!&'&#j77þžO57ö=A}A=;AÍÙ¿KDFxÜþ’JDý¾7-J’Z{{N{~U]$HD‚þh—01¦C>r{C4X âÚ!#'%5'%3772âþhþ ¬æN4èL4ÊæPþÊèPþÈåñþ~þ–¡n؉¢nÙäþª¢oÙˆ£oÚýû.CÑÕ!2+!!##535#5;2654&+ Èûþÿûþ*ýÖÊÊÊÊÊÊþššþÕãÛÝ⦦þô ¦¦¦’‡†’üÿË3!üÚ~„åÿ›dü=ÿö!5!'3 üGå„~d›ü=zÿË!#'73!5ý„~¯¯~„å›ÍÍ›ü=zÿË5!'3#7ü=å„~¯¯~„d›ÍÍ›ü{ÿì 3#%3#%3#üËËËËþyËËfÊÊÊÊÊËûP{° 3#%3#%3#%3#ËËûkËËËËþyËË)ÊÊÊÊÊÊÊËü=zÿË #'73!'3#7üæ„~¯¯~„<„~¯¯~„›ÍÍ››ÍÍ›CÿÏØ $(B"326=7#5#"&54634&#"5>32%3#.#"3267#"&54632 pSHf¼¼™m¦ÍÆ©ogDc\”GÂÁ°ØüDØ©^o8y‰‰y8o^I‚IÊìîÑC€öBRCI”‚ Mþ >Ož–›W\ 7²$ÊúùË„²4œ”“4±"úÑÔùCÿÏþ +EI.46'&#"#&'53254&'"326=7#5#"&54634&#"5>32%3#V‡¹Nz$p´;i0™‰Êª¯‘%“‹±={û‰ pSHf¼¼™m¦ÍÆ©ogDc\”GÂÁ°ØüDØ}|ïŽ4¼9d$, !ó•5ÊLf,1„BRCI”‚ Mþ >Ož–›W\ 7²$ÊúùËsÿã'ð!.#"3267# !2'Yè—£yy£—èYjí„þ­þz†S†íý #bvAZ4û-4ZBuHHŸghŸGû[!¬þºþ»¬!ÿÿÃÿãmð&r&FÿÖÕ+™¸,/¸-/¸ܸܸ,¸(и(/¸ÜA&6FVfv†–¦¶ÆÖ ]Aåõ]¸¸ и¸ и¸и¸#и /º!"+¸!0153&'&'6767!!5&'&76wI3cc3IÊ86QLNN7887NNMR48×ü_¡k•—i³:rÍÍq;Ôzn #¬+ü¤+ª$ *ªÞ rŸn<ÿÏå(2.#"3267#"&54632%3#"326&$  &54^o8y‰‰y8o^I‚IÊìîÑC€ÝØüDØkavva`wwþß‚ÚÚþ~Ù—²4œ”“4±"üÑÔùKùËž’‘Ÿ   øÕÔøøÔÕ<ÿÏM-1332653#5#"&.#"3267#"&54632%3#\¼QPcu¼¼`ž¡ýª^o8y‰‰y8o^I‚IÊìîÑC€ÝØüDØLýõriuðüD PÁÿ²4œ”“4±"üÑÔùKùËÿÿ¤ÿã{ðRÿÿoþÖ#ãÁþóÿÿÃ&ð&r)IÿãŒûo!6767632#"'&#"32767#"'&'&547!#"'&54632327676"#"'&'&54767632¿lø(9BKc{=&%%03!((!,739%7`lG;7 þ25]­¹hB4,'5  'B[QF$%ˆ]c'G  %! }Kr~“,§ê1ý¼ÑŒ˜Ig)*!&!(D;wÖþ½¥‚},75;!_']7:y}©[´Ïž£\®@4>#,!, 'QFª§ÿj(JG4$$,*)/9„yK#%þù‹ÙP73276767654'&'&#"&'&"'632654'&'&54767767#"'&'672#"*i(X%# 1F‚S°E/ ËO.55Fu½PU[QF[00rlÓ~œ"‘KI}!;IFs;n¡íò;_þéT^ÍŒQ79}w²–^l.G‰yr\[4þúO9%#i#Þ^MX;€¥yv@c„“}e.ID\7I;>2V秉uÓ°þ¢ÓþþÉÕ3!3%!!!!!!ÕÊûŽÊþÒ’’þnýêþnqúó úó dýˆxú+Ûý%H‡#>54&#"#3>32uƒ¹ƒ j_”Ù y¸/¸wFÚx”£ ¤ý\/HT^Ȧý“ýœ^m ‘$RZ‡3%632##"#'7ˆ¹-þP4ªçÁ—-ƒ¸‚>ø•Ñ {¹ßÑõê|aˆþõÉïèý\ž=¾¤ý‡BcL;ÿátð9#"'&5476323276765"#"'&54767632thÁ‚n<7# ;KQ>!|Za,4(XM‹•µ!}ã,üþþ†Â‚<7D9#7.M=†„¾.1?@ '(MXI(' jÿãFð!2?632327654'&54?#"'&#"632327#"&#"jŒou9„!ydG>PPÕPP5ʺò6…8^nm{z€}}È‹oÖz€Z¥'PV‰aK~p’md Œ‹yk”b¼^òÞOP681/:ª:b:DÿãnòJ327654'7#"'&'$#5"'47676766767632#"'&'&'&#"32ÛnZS_n0VBšR„äny#H‰B?„ÁX!$9B©„€Mw>7l. ;7%,;(Ó§½uy,D0ÿäÿãÒð&3273#"'#67&5477632654#0)W:K…32#"&'####53&  Á¸¸¹±ýO:±{ÌÿÿÌ{±:¹¸¸¡¡›§þܧ§$“““}þ²daþ¼ýðþ¼ad¨úü}ûã–ççþjçÆ¢Õ %# !3!# ýîêü”¨ÐdþXý0dd úóqûáú+áû6ÁÕ+/±’—B°“°˜B°/³,/°<±•í°°-ݰ.<°-°Þ°#ͱ?± °<± •í°#° °9° FhH°°)°#°#Ii;±€B±B=°°#I°€bi°F`°Fa°’C°`#B°’C°`C°UX°°’C°`C8Y°²& °<±€B±B0°0±þ°<°Ä°±ý°<°± 6ü°<° ±ý°<°9° FhH° ° °°#Ih;° <° °Ö°° ݰ,9°, FhH° °&Ö°&°°° #Ii;°/°,°#Ih:°°1#I°’C°`#B°’C°`C°PXµ& ,/°’C°`C°8K° RX° °#I°’C°`#B°’C°`C°@PX°’C°`C°@a°’C°`#B´ °’C°`C°8YYY±€B±B=°°#I°€bi°F`°Fa°’C°`#B°’C°`C°UX°°’C°`C8Y°²#)°<±€B±B1°°#I°RX ±°±í°±ý  ±°°<  ±°°< Y3525!463"!4632#"&732654&#"5!6“–º“þðýjãggggŒ92299229ŒîªkÀûÌ€•ªkû@áü4€•nŠ¿¿ŠŠ¿¿ŠNggNNggýD{{åÊ "-! ! ! ! '32654&#%!2+# ÚþJþÑþÏþR´12)þ÷þúþ†uy»ýÓ²ckkcþÁ?°´´°²ñÛþÎþÐþL´00¶eþ…þùþûþ‡y »wþ¯XQPXd‰ƒ…‡þ˜nþ;Cö0<67632#"'67327654'&#"#"'&57&547276545ˆ[«Û„ƒFIœy®eL )qz]E& J½þŸ‡EYƒq:?ß.è”0.A Æ‚¾Mke”½LP«Ú×§<+(ŒhÃ|H=þyþÞ|nŽ=B† üžî¤üïÆ{u.F/4_NÈTÕ 33!27&#%!2+!67654'&,Êd.ý@‘úþÿûþþnX<-]\,qúó ýj’dÛÓÕÚýˆZý™)VŸžV)sþøÙð!)%#'# ! % 7& 676'&B ôÝ3þÅþ‡y;:xÑý+lllþðli$ ›› Þ#››þÝï¥ab¥þ[þžþüþŽ 22×22ûjT%¶ýœµ%5û¯$¶c¶$Bÿî2 _327654'&'&'#"'&5476323276765""'&5476!6?232767#"'&B=]iS\Z—ÎV30FŸ¹n7;#FfS9!!ç< #5,h½";<¶‰„2XngšZR{,##9>;K!Q¡ýIag£Sûæ Àˆ‰D£5@7*'S:y}ž*‚7H0 5#!,I‘l» @3X§¿nh0ÞÍ{(2r:=OSÿãlñIX&54'&#"#"'&527654'&#"3"'&547632763227767654'&#"R(O*\xggŒfg-.@@?@@?\QA@@@S6—fggf—¢eÓ»p/$~AB}:1$ -*ü¤šMJJ@f·ŸŒ[¦+8ÇÎvuuv° zVWWW–›•XWWVÊVW\uvœuuu# bW1±W{|^1$h{ƒ€vC[SK\þ•GChfy— /È2Õ &.2&'&+3!.+!! !27&#676'&%3ûLDEx-MeÇþø5q>ÍþH¿J‹xþn§üu1ý•E˜A+ZY*ü²Ê—01/ÉþåO„~þh–bý‰ÕÖØÐb)¥ýj’ý™)V>U)-úó ©ƒÕ§¸ /¸!/¸ ¸и/¸ ܸи!¸ܸÜAêú]A)9IYiy‰™©¹ÉÙ ]¸ и /º9¸ /¸/¸/º+¸º +¸0132654&#+#!273 # #sþšš s­þÊÈûN®¾èþÍCéÏÔèI/ýÏ’‡†’ý_6ý¨ÕãÛ¬kÛêþ†þkþü•Éÿ%TÇ$+.3&##&'&''7#!27%7 67654#“ÑÈ?\üA>:AÍÙ¿KE6Tþ®oF^È~_ þº,¶8~ƒ|§T3JýÛ/ýîøýHD‚þh—0& ü°,¯Õ‚o®Œkغçþ]-Dƒbü‡g‹(Ø'4.#"#"&'532654&/.54632733###æUW'AG/E8piŒ4sG[d/EK7?8pcŠ|3iи¡¢¸ŠŒ‡‰·Y"*/( VAO[`*,2,* M=H\þ¬TýÈ”þØ(þlÿü0`!!#!!!!!!!3!!³þr˜þsàoþÕþ+öý…ï…àý›`€ü à`fþ÷fþ»f€üæf'“FÕ >@!  É  b b cbcÔäüäÔìÔì91ô<<ì2Ô<<Ä903#######5J®¤ªqÃ7ËrqËrÉÕÿý¾äþÑ/þB^þä^ÿ"hÄ %73# ' 3×þº,¶þ¢¦ÚÒýÇåžýo-þ£ÓM†‚o®üþFéú+žý„,õ’\™Õ %#!!!5!È8êüÈküÈOúÃ8üßd úóqdúódd XþL/ 654&#!5!5!5!!2!"'Xª£Á¹¥þð÷þ ÷ýÄ$þ'Ùþ'¬ß¦¹þþ»Ô§c£Ì†“¦e“e“¨þ°¨þ°aÔŠþÓf†JÿÿNÏç=ÿÿNÿãÏÊsþΕDU767654'&#"#"'&5733272632632!"'4'&'&#"'6763232767654'&'&#"Ž_}yj#1Q€–\$˜####‚,TGG\<‚„lG2ûe$°òþ×sa#0EKXQn#?QY>™k›DMý4þëÇgiàMq«Ìþí¢ÿã†ðE#"'&'&5476?&'&547632#"'&547654'&#"3"32767'_²ûilE_†m²l=Oc{ñˆT3-2") %+fa@aP/Z_|«{w:maZÂu> IhA¬"%@_©®Šl$=P”‹czS2VN-2!$+%$+@e—}N069n™¦a[u>_Tÿß M#"'&'!#!"'&547632327676=!7!&#"#"'&5476!27327î#X':'7á?<=ÿ**MÆþô€_4. B^l{>!þ—'Ba>ÁnG#&#w§4$Bš»00!ò£K=ýÜDc˜„€KÊ_4B( 03B{>ce‚¹DInFT=I,F´w§7K. 0É#Õ )5!!5!3#ü¦ý°Pʪ¸ªÉ9ÿÇBk32767"'&'&47'&'&'#"'&547632326765&#"6767632377632#"'&'&'&#"×,5(.'*'E`Ÿ97®y{7a;f7;>F3.^PeMD*#7@,j!HhH<=.%_yi¥pp3 T}€œ˜²B',$ *ý5Ü€/,,@!;Da97žT‘³þÄþÉþVMæ;©nwFþí»³^O?/,%!;>jytŸÖX<;}f?E'_n¥þúþôþ± Hô—˜''#  .hÿçJ) 4&#"322#"&54©WOmVPm˜ËÝ¢˜ËÝ÷t}þþÏt{ýØ£ÆþÿØ£Ægÿã²ð4 4'+5654/&4?'&547 '&5474/Ä‹c2üû›>B¬d=VEõÄ/b5Œšñc2ltc2¶c2Ðþuc1‚LS2œ?B¬dÖ,>8?]/c6¼›ñc1‚LS2ý–tc1‚LS2¶c1‚LS2ÿûÿã9ñ03#!".54?>3!4'.#!".54>323!2¾O,‡"ûô"…$„%@ý;5H *ÖY[¶ü#$‡"†x2 1[G(  Wÿ¸Að,!2#"&/#!"54?>3!!"&5462TPl 0%= -d,þmF"…$…þºmG- .7#*(/ ‚ý$þû"Sae(!‡Íq~B;Vÿ¸ºð&!"&54>323!2#"&'&5 ýmG * 5G 0%9 . ¦q~( 0 (/ ‚&ýJ“s!S'DQIF× 4632#"&3!53#5!¼pQOooOQpƒ˜ýo——ùTQooQOonûuyy5yZÿÕR; ! ! ! ! þHHþ¸þæþåé#ïþ[þŸþžþ[¥breþHþý¸Â ôÝ!#þÅþ‡y;:xÑ— L`  !!!!#!3#'!#33 # #—ƒþ¼þD—ƒµjÿ—wŠZþDZŒÖõöþÃRþëþé``€þ¶ýéþC5ü€ææ€þ³MþRþ.}þƒÞ$ÿðz`-1%5"'&'&5#2327#"'&5#!#"#463!#3#‰, †9áYl(Ht„ý*§þ²=Z2dr¥¶ý!††Z4@'!8¢ ýÖ¦zEB¯ ñÊbýãüüLs¨{dþYþ¯˜þsZ{3#"#4763 3×®UE‚El4FŒÅ©dGQõ´‰n ‚ËCFÁþ\þ§þxŸBýú¾*WŸbOZý=šþþÉþ¾ýýÈ0Õ 3%!!,Ê:ý*þnqúó ddúÕÉÕ3!3!!!!ÓÊûÊ þnýìþn8qúó úó úqúÕþwSÁ ! ! !!5 5¦ýþüúüð—üúüðùÆýþÚY*üÖü§çdüÖü§ccS£ÿã»ð!!6$3 !"$'53 !"kJýîu ^‹þuþ¢’þùopü‹þíþîk¨þþo¦SUþgþ“þ’þgHF×_`2/.2%©Õµ:Üüì1´•/ôì0!#!5!©Êý)¡+ª¨Õµ:Üüì1´•/äì0!5!¨ü_×Õú+ª+ÿüçÕ!# #3çÙþbþeÙËfýšÇý9WJÕ " )327&#!3676654'&|²¨tKþ"þPýý"ûcõ­â“öþoûÊû¯ÍÐAfÕµ|ßcvþ~þ–ÕdúóA‹Aúó xûãPfUÂmZÿã­ #2!7#"547632!3 32767654'&#"ç* 6¯B8wxþ²!Nbb|Ëž"#>Ë|OO'vNþþ÷† ý2½¥wx87¥tžKsO= † =‚üí¨d01 ”P²²D10d^dú¬Tþdü6‚‚ŸžJthi[ÿã“{ (232767# '&5477632!7!654'&#"Ú N¡&# ¨G_yZ\klmkþô}Z5µ³üäfFý 9N©JC0<7h:‚ýJ(u*œo¦DM¢¡‘c“FPZd82vRsO 3#3#!!ɸ.¸Ô†²†$þ²ÚNéû9˜ü`ÿþV 3##676#732767!ɸ.¸fʆÐ#5H2KþÜÜ1i0/éNÞ)deéú¿ûеT0Hôd01™¬ûŒÖ``;ÿã¸ð&0 #473>32#"&'532654&7>54&#"ºþ;Hºt]þéühäƒñ2††02Þ¸S¥UWžDiƒ;2[UÔ _¦I@YËr„~•YWþí×€ác?}<¢Å$$¶/1oX3gÎQ¡X’Â?@Qˆ` $@   F ÄÄÔìì21@‡‡¼/äìÔì0!5!!5!ˆüÉþù`û “o“Ëÿÿ‰ÿã`ð' &5&{ R‹ýdÿÿ‰ÿãtð' &5&{ T‹ýdÿÿ‰ÿã ®ð' &5&{'{‹ýd MÀýdÿÿ‰ÿãXð&{' &5u‹ýdÿÿ^ÿãXð&t' &5u‹ýdÿÿ‰ÿã^ð&{' &5 P‹ýdÿÿ^ÿã^ð&t' &5 P‹ýdÿÿbÿã^ð&u' &5 P‹ýdÿÿ?ÿã^ð& O' &5 P‹ýdÿÿ‰ÿã~ð&{' &5 Q‹ýdÿÿfÿã~ð& P' &5 Q‹ýdÿÿ‰ÿãwð&{' &5 S‹ýdÿÿbÿãwð&u' &5 S‹ýdÿÿfÿãwð& P' &5 S‹ýdÿÿlÿãwð& R' &5 S‹ýdÿÿ‰ÿãð&{ &5ÿÿÉ“Õ,ÿÿÉ'Õ&,,”ÿÿÉ»Õ&,',”,(ÿÿÉQÕ&,9éÿÿhÕ9ÿÿ˜Õ&9,ÿÿ,Õ&9',,™ÿÿ ÀÕ&9',',™,-ÿÿÉÕ&,;Üÿÿ=;Õ;ÿÿ=®Õ&;,ÿÿ=BÕ&;',,¯ÿÿÉjÕ/ÿÿsÿã'ð&ÿÿɰÕ'ÿÿÉÕ0ÿÿÁyLÿÿÁé&LLpÿÿÁY&L'LpLàÿÿÁA&LYÂÿÿ=`Yÿÿ=½&YLDÿÿ=-&Y'LDL´ÿÿ=&Y'LD'L´L$ÿÿÁJ&L[Ñÿÿ;y`[ÿÿ;Ô&[L[ÿÿ;D&['L[LËÿÿÁyOÿÿqÿãç{FÿÿqÿãZGÿÿº{Py }Õ  ) !3 !## !5²–þhþPýŒþPþh–²Ÿô5þáþËôÊôþËþá5Õþ—þ€þ~þ–j‚€iúÑ.,ûw‰þéþÔþÒþèɰÕ#ûº +¸ º+¸º+¸¸ ¸ÐAêú]A)9IYiy‰™©¹ÉÙ ]¸ ¸ÐAêú]A)9IYiy‰™©¹ÉÙ ]¸¸%ܺ"+¸º+¸º+¸º +¸ 013 !#3 #32654&#! )“ô5þáþËôHðñÿHNŸ““Ÿþ蟲–þhþPþaY³.,²ÂÏÐÞý茊Þþ—þ€þ~þ–y }Õ(1C3 +3 !32654&+! ) #"35# !35#"&546!`HðñÿHô5þáþËôNŸ““ŸNÕýŒþPþh–²t²–þhü±NŸ““ŸNôþËþá5ôHÿñð/²ÂÏÐó.,ü°ŒŠü j‚€iþ—þ€þ~þ–ߊŒž²þéþÔþÒþè³ÃÐÏÂÿÿsÿã'ðHÿÿÿãõ{sþV'ð.# !267## !2'fç‚ÿþð‚çfÉ v„þ­þz†S†íbÕ_^þÇþØþÙþÇ^_ý¹$ŸghŸGÿÿWÿãXð' &5'u‹ýd MdÌ?8 ´  ÔÔÌ2@ @@ 00 ]1@  œ Ôì99ÌÌ0@  œ ü<<@ œü<<°KSX³ <<´œ ì´œìY5!!d‰xéÃû=éxUZ‰xéªéx£Ü @  œ Ôì99ÌÌ1´  ÔÔÌ2@ OO ?? ]0@  œ ü<<@ œü<<°KSX³ <<´œ ì´œìY3'#'-ZˆxèªêxÜþvxêû<ÄêxuÌP8 ´  ÔÔÌ2@ OO __ ]1@ œ Ôì99ÌÌ0@  œ ü<<@ œü<<°KSX³ <<´œ ì´œìY'7!5!'7Pþwxéû=Ãéx¯Zþwxéªéx£ÿùÕ @ œ Ôì99ÌÌ1´  ÔÔÌ2@ @@ PP ]0@  œ ü<<@ œü<<°KSX³ <<´œ ì´œìY#737‡ZþvxêªèxŠxêÄû<êxdÌP8Ú¶ ÔÌ2ÔÌ2@ PP_ _O O]1@   œ Ôì9Ì2Ì20@   œü<<@ œü<<@ œ ü<<@ œü<<°KSX· <<<<´œì´œì´ œ ì´œìY5!'7'7!d‰xé¼éx‰þwxéüDéxUZ‰xééxþwZþwxééx£ÿïÜÞ@   œ Ôì9Ì2Ì21¶ ÔÌ2ÔÌ2@__P POO@ @]0@   œü<<@ œü<<@ œ ü<<@ œü<<°KSX· <<<<´œì´œì´ œ ì´œìY3'7#7'-ZˆxèèxþxZþvxêêxÜþvxêüCêxþvŠxê½êx 4Ÿ³ 7!!# ?,þ¶^xü¢©t?©ü¢x^þ¶ 4Ÿ³ #'!5`?©ü¢x^þ¶³?ýÔJü¢x^© 4Ÿ³ %!5!73Ÿ?ýÔJü¢x^©s?©^xü¢J 4Ÿ³ %'3!_?©^xü¢J4?,þ¶^xü¢©dÌ?8'!5!!BÈ”—ýÿéxþw‰xédÈ”—š-þ¥Uéx‰Z‰xé[UþúªuÌP8!'7'7!'!5rÈ”—éx‰þwxéýœÈ”—þf×[UþúéxþwZþwxéþ¥Uª,ÓžP4327>76767632&'&'&#"#"'&/#7!í#/)85,0F"<;NJX[GR7<"#!2)85,/$#?2WG[XJN; ©?,þ¶ô!F0O<:" %7xþŸýéxUZ‰xéaxþÂþÂxaéxuÌP8 '7!' 7!'7PþwxéýþŸx>þÂxaêéx‰UþwxéþŸx>>xþŸéxþwdÌ?8 !5!3#•ûçéxþw‰x骪-éx‰Z‰xéYü¤¥Ü %'3'!!5èxˆZˆxèZü¤ªêxŠþvxêû檪uÌP8 †· œÔì2ÔÌ2@ O O _ _ ]1@  œ ÔÌÌü99ÌÌ0@  œ ü<<@ œ ü<<°KSX³  <<´œ ì´ œ ìY!#3!'7'8û窪éx‰þwx-þ§\þ§éxþwZþwx¥ÿùÕ !5!!7#7þ¨\þ¦èxþxZþxxè+ªªûæêxþvŠxê¥Ü7!!5!7'3'¯èxþx‚ü¤€þxxèèxˆZˆxèÂêxþvªªŠxêêxŠþvxêdÌ>†%52#!5! 767>54&'&'&>42/+-+-':1 üHéxþw‰xéÙÙܪ-)o=Ü  éxþwZþwxé(.46<=69)-dÌ>†>3276767654'&'&'&"5476767632+#5!5‘‚ 6 ©+/24>A1:'-+/24>‚©ý”éxþw‰xé×  ‚‚=69)-(.46=<69)-ÜÜéx‰Z‰xévÌP†>54'&'&'&"3)'7'7!#5#"'&'&'&5476767632# 6 +léx‰þwxéý”©‚>42/+-':1A>42/+ׂ  éxþwZþwxéÜÜ-)96<=64.(-)96=dÌP8X#532267676767632267676;'7'7#""'&'&'&'&'&""'&'&'&† éxþw‰xé 0$#$   "%'-0$' !  ' '- éx‰þwxé  ('Z&("  "(&Z'( -éx‰Z‰xé$ -#%"&* 'éxþwZþwxé ""&*  *&"" d¾PF%'!5!!'7'7! pþœéxþw‰x领 pdéx‰þwxéþ^¾:5éx‰Z‰xéo:þËéxþwZþwxé*ÿüØ %'7 ý!§^ßÁ bþ9YþÁ‹¾þXxýî¨û¸¾‹þÀÈbþñZ ò #!5 ªþéxþw‰xé‘ûoçéx‰Z‰xé¬[ò !'7'7!#¬—éx‰þwxéþª‘éxþwZþwxéüZÿã Õ !5!3 ýiéxþw‰xéíªDéx‰Z‰xéç¬ÿã[Õ 3!'7'7¬ªíéx‰þwxéD‘üéxþwZþwxéÝÿùÔ 7#7!5³éxþwZþwxéýÔÔü=éxþw‰xéªdÌ? !5!3?ü=éxþw‰xéª-éx‰Z‰xé,- eX&7#754767676 #4&'&'&"9èxþxZþvxê.-\ZnllnZ\-.ªBB54'&/#7!!#"'&'&'&54767D !BB54'&´x\-..0YXpl€…gtTY0../Z#þ¶,@ª#B"!BB@RN¾JV°]xþw‰x]TQ>°]x‰þwx]þ¬xL iiþ þ`iiTÁ4¬]x‰Z‰x]à4¬]xþwZþwx]JÒiiiiuÌP8!7'!7!5!7!'7'7!'7!5½giiþþÚyýìYu‚I0]x‰þwx]ýÌu‚Iþ«iiÒÒxÊK]xþwZþwx]ÊKxdÌ?8!!5!!¯ûÉ]xþw‰x]7ûQix]x‰Z‰x]xi¥Ü#'3'#'ñx\xˆZŠx^xh°ûP8^xŠþvx^ûȰhuÌP87'!5!'7'7!5$iiûQ7]x‰þwx]ûÉiix]xþwZþwx]x¥ÿùÕ737#73ñjhx^xþvZþxx\x%hh°ûÈ^xþvŠx^8dÌP8!7'!!5!'7'”iiüli…ý\]xþw‰x]¤]x‰þwxiiiá]x‰Z‰x]]xþwZþwx¤ÿðÜ7''3'7#7ñiiiá]x‰Z‰x]]xþwZþwx°ülii”iü{¤]x‰þwx]ý\]xþw‰x ÿѳ #7!##ÉPUý©?,ƒûUü°•vü°Uû„,?©ýUP¼ÿÑŸ³5#'#5!#5'ö•ü°Uûƒ,?©ýUv”ü°Uû©?ýÔ„ýU¼4Ÿ 753!5373öü°Uû©?ýÔƒýUP•qPUý„ýÔ?©ûUü° 433!'3É•PUýƒýÔ?©ûUq”PUý©?,„ûUdÌ?8!!!!5!!cÜû$ŠRü&xþw‰xÚû®¾xŠxx‰Z‰xxuÌP8!5!'!5!7'!5!Qû$ÜŠû®Úx‰þwxü&RFxŠxxþwZþwxxdÌ?8#''''#53777?(F´´´´´ncéxþw‰xé‹F´´´´´n-F´´´´´néx‰Z‰xéF´´´´´nuÌP8577773'7'7#'''un´´´´´F‹éx‰þwxécn´´´´´F-ªn´´´´´FéxþwZþwxén´´´´´F£Ü3'!!!!#!5!5!5!'-Zˆxè(þØ(þتþÚ&þÚ&êxÜþvxêþŽªªªþ¬Tªªªrêx£ÿùÕ#7!5!5!5!3!!!!7…ZþxxèþØ(þØ(ª&þÚ&þÚêxŠxêrªªªTþ¬ªªªþŽêxdÌ?8 5!!5!35!d‰xéqþéxªÿªÿUZ‰xéªéxaªªªª£Ü 3'#'3#3#-ZŠxêªêxbªªªªÜþvxêþŽrêxþVþªÿuÌP8  '7!5!'7%!#'#5Pþwxéþqéx‰ûÎÿÿªÿUþwxéªéxþw(ªªªª£ÿùÕ 737533-þvxêªêxþv‚ªªªŠxêrþŽêxþv4þþ¨ÿkË?9 !#3?ûîêxþvªªŠxêתêxŠþ~\þ€ŠxêuËI9 !'73#'7!uêxŠªªþvxêûî×êxþv€ü¤‚þvxê7†?~ 5!! !!Ïþö  ûôdþü ûôŒþöþöƒý}üüþïþ*^V 3! !!dþöþöƒý}üüþïþ*p þöûô düþûô H†P~ !! !!¸ûô  þ’ûô üŒƒþòƒ þÖþ^ÿÍVÕ #!# !!!dƒþòƒ þÖþe ûôþön ûôþ^V !! !3 3!!!Eþ*þïüüþïdƒþöþöƒrþ*rþò$èüþþ|è þöþþÔþ¤\d”^V )3! !3#!5#3 3 üšÈþïüüþïÈýÆÈžÈƒþöþöƒ\°üþýPd””x þö@t %#!5#3'!3!3! !33'ÓȞȡdþxd¡:üšÈþÑþÑÈýÙètø””Zddû®\’ýæýnªt^V%#!3!3! !3!5#3ĹØtIüš¹þþüüþþ¹þ¹tø”äØû\°üþýPìû”x^V%3 3!!! !!3 37áƒþöþöƒrþ*þïþèüüþèþïkŠþöþöŠ€dô þöý dôüþþè| þö€^V %#!5#3 3!3!! !!33 37ÓȞȃþöþöƒ:üšÈþïþèüüþèþïÈþÍŠþöþöŠ€ø””` þöü¨\˜üþþèþh þö€u†}~ 7!! !5#35! u\°üþýPd””x þöÏfÈþþÈ:Èýbȃ  ƒzMÕ!#7!!#Múc"?,þ¶^xü¢©ÕcúŽÕþŸ?©ü¢x^þ¶zMÕ35!3!5!73zpcþÞ?ýÔJü¢x^©crú+a?©^xü¢J^ÿÍV 3 3# '! !! !áƒþöþöƒƒ  þþþïüüþïe  þöüõþö dþüCüþuÌP8)5A '7!"'&'&'&'#5367676762!'7$"!&'&'!27676Pþwxéþ¡ 21@=“:C.2 ¾¾ 21@=“:C.2 _éx‰ü_R#)l$hþ˜$#R#$Uþwxé@21.2@ª@21.2@éxþw#þðÿÿwÿù;Ü' , þÔuþtP'7!5!'7!5!'7!5!'7Pÿÿþwxéû=Ã××û=Ã××û=Ãéx‰ÿÿUÿÿZþwxéª×ת×תéxþwZÿÿdÀ?D5!3!!#!d‰xé3ªæþªýÍéxUZ‰xémþ“ªþ“méxuÀPD '7!#!5!3!'7Pþwxéýͪþæª3éx‰Uþwxéþ“mªmþ“éxþwdÀPD3!'7'7!#!5ª‰éx‰þwxéþwªþwéxþw‰xé×mþ“éxþwZþwxéþ“méx‰Z‰xédÀ?D5!333!!###!d‰x駪ªªþ⪪ªþYéxUZ‰xémþ“mþ“ªþ“mþ“méxuÀPD '7!###!5!333!'7PþwxéþYªªªþ⪪ª§éx‰Uþwxéþ“mþ“mªmþ“mþ“éxþwdÀPD333!'7'7!###!5œŒdŒ éx‰þwxéþàŒdŒþàéxþw‰xé×mþ“mþ“éxþwZþwxéþ“mþ“méx‰Z‰xé7Ä?@  !¥úJþB¾JˆôúAþƒ¾¾þƒ‚uÄ}@ 7'!5! úúPû¶J¾þBˆúúþÅ‚}þBþB7Ä}@7'! ! úúü–úý6þB¾Ê¾þBˆúúþ ôúAþƒ¾¾þƒ}þBþBhÕ %!3!3¼ýÛ ýÆÕˆ¡ˆÒýÇÇçüRÕþú+‡ÿãnðmº+¸A&6FVfv†–¦¶ÆÖ ]Aåõ]º+¸º +¸0132#&'&#"327673#"‡ ûû…B!ÊOœœOÊ!B…ûûþ÷ézÆcI7™þÍþÌþÌþÍ™7IcÅŒ_ÿãÄL 0"'&547632654'&#"563 3276767&#"µ\m`c²u\6% G¼Gnth r5?£€þÁ,/H@3H5,Yš„:$Ue·¾”˜I+HQ\‡N­,¨öt­qƒþ¸œzSd69->eSY×®lÉ‹Õ !5!!5!!5‹ü>øýøýÕú+ªìªëªÉÿ¢‹5!#7#53!5!!5!733!‹ýKªc˜˜þÐd˜þ0ª4˜êþ☶Õú+^^ªìªëª``ªþëýkþì›ÿì]®(673#"'&'#7&'&$32 '&#" 32$767&'&Yj€iEdÈþ ¹»°80~iª?/cÆ`»¹°üÉô‘™šþÝRQQ$gý'-‘š™"SRR:;nSz²þ€þ¾_'œÒBT±€c¾_ ûé¥N“‘››‘@DüRO“‘››‘gÿú`Á8@ÔÌ91/ÄÌ90@cmpxyvn]] !3!¬þ^DýïàCúšîûÄú?ÿú`Á%! !¬¢ü¼3ý½fý½Ó<úñÁú?¯ÿìI®!!"$54$3!!!W?JŒ‰”¹ýGÀþ¾¾cÀ¹ýG”‰‹K@ õsJx‹NLŸÆ`»¹`ÈŸMOŠx] ¯þåI¯&/!!!!3!!"''&'&54$;7#"Ø–I$þ¢¹ý¯°$$¹ýGA?d–`,,±¾¾cÀêüÝFU ;¸°“Š}YI¯7ÊŸþ þŸ þî7c`»¹`ÈüÅJx‘H ¸ üNG’x]Ù›åg% $54$)!!3!+þØþÖ*(ºþFèiNvüŠ%Frߺ›öððöŽO:…Ž‘0QޝÿìI®&'&'&'!5!2#!5!676767!5¡?JŒ‰”ýG¹Àc¾¾þÀýG¹”‰‹K@ û 'Jx‹NLŸÆþ »¹þ ÈŸMOŠx] ¯þåI¯&/'7!5!!5!&#!5!2+4'&'&'3276765 –IþÜ^¹ýéQ°$$ýG¹A?d–`,,±¾¾þÀê#FT‚ ;¸°“Š}YIþå7ÊŸü ãŸ 7þøcþ »¹þ È;Jx‘H þH þNG’x]Ù›åg )5%2767!5&'&!5“(*þÖþØþFºèiNüŠv%FtÝþFgöñïöŽP:…Ž‘1RŽ,ëâ ¸/¸/01!!,¿âüœþwqÁ@×Ö¯ggÔìÔì1üìì20!#!#œÕðý ïÁø¶}ùƒœþwqÁ@ÖׯggÔìÔì1ü<üü03!3œïöðþwJùƒ}ø¶þw;Á ]@    ÔÄ91ÄÔÌÎ990@0QVPZ spvupz €€ Z pp{ t €€ ]]!! !!5 7êüA ýJïúÞÕýIÁÁý3ýÀ•!ãÙ-Û×¶œÔÄ1Ôì0!!ÙúþתÙÛ !#!5!3!!5!®¨ýÓ-¨-ýÓý+ƒªƒþ}ªתªÙÛÕ Wº+¸¸Ð¸¸ и¸ и¸ и/º +¸ º+¸¸¸и¸ Ð01!!#!5!3#®-ýÓ¨ýÓ-¨¨ þªþûªû5ÌÿÿÿB²ÕÿÿŠÿ’<%?ŠP¯%73% %#'±þTU¬¨¬UþT¬UþT¨þTU‚÷“÷ïþ÷“÷÷“÷þï÷“ÿÿDG¾ÂrýÒÿÿXYª© %ˆ=ÿ×} *@    ÔÌ91ÔÌÄ903##'%\½sý®BþÁ}}`ùºs-Pbý;ÿÿ=ÿ×v& ¤us†ÿÿ=ÿ×e& ¤ Os†ÜåÛå 127#"#"'&'&'#"'&547632676;#"3¥c‰d3668+MI6641C;It‡Y^^SI6?+((C;ItK@”t‰kðHMfpEF„?$Tx5@ej¯¨re!93Ex5@ƒðþúÜåÎå#/;&'#"'&54763267632#"'&%27#""327654'&¥1C;Js‡Y^^TŽI6?+((C;Js‡Y^^TŽI66þ6¥c‰d3778ë•s~Šd3778]$Tx5@ej¯¨re!93Ex5@ej¯¨reMðHMfpEFôðþúHMfpEFË™I%!3!™û‚ªÔË~ü,¯IÕ%!3Iúf¹òüËÊÊÕúõ¯ÿ”IÕA¸/¸/º+¸¸Ðº9º9¸¸к901%&'&'3!!#4'!&'7`'JAWþÎã`òþLqR]+XþÉŒü* PÊ‹†s^þã(ýRs“§°Ê57756uíÿúÜÑ5º +¸ ¸ /¸/º 9º 9º 901 7&'7%%'6 676rý{Ž‹ÔþŠEG…þ%†yýÝ44RÀW!L!$îÒ¾³Æ ¡“¿Òñ&!L éþçþð{ž°þJP+3#°  +øfþJ›+ 7º+¸¸и¸и/¸/º9º 90137#'° ûPþµ ýMVÕüœ°oçü)g±nþJð+3#3#  @  +øáøfþJ›+{¸/¸/¸¸Ð¸/¸ܸи¸ ܸܸ ¸и¸ и¸и/¸/¸ /¸/º 9º 9º 9º 9013737##'   [P«   ]MæEü+qdý @oxûº×pü™÷AnÓ¢!3# iúhÃþÞþÝ¢û^¬üTÓ¢3 3#Ã#"Ãþ˜ú¢üT¬û^Ó¢32#4&#"#õñðõ¬”¥¦”¬P(*þÖþØý°7ôÓÓôýÉÓ¢332653#"¬”¦¥”¬õðñõRPýÉôÓÓô7ý°þØþÖ*uþM¶>2&#""&'7327㢗~”9GA¢—~”9Gâ§…}Œ‚¯ú°§…}Œ‚¯ÿÿuþMÛ& µ µ%ÿÿuþM& µ' µ% µJuþM¶-6?67632&#"#"'&'7327&'&5476767654'&'ãSOJMG7”9GcBnnVsSOJMG7”9G]InoSuŠ=,EG%,½=,HK%â§DAF7Œ‚¯þÖK|’œoUþ¾§DAF7Œ‚¯1Io›œsVý›/HgjG$þ4Ö.JhgH$uþMÛMQZc67632&#"!67632&#"#"'&'7327!#"'&'7327&'&54767!!67654'&ãSOJMG7”9G~SOJMG7”9GcBnnVsSOJMG7”9Gþ‚SOJMG7”9G]InoSu‰~þ‚¾=,HK% =,EG%â§DAF7Œ‚¯þâ7§DAF7Œ‚¯þÖK|’œoUþ¾§DAF7Œ‚¯$þçDAF7Œ‚¯0Io›œsVý’ñþ!Ö.JhgH$ºþ+/HgjG$uþMmqu~‡67632&#"!67632&#"!67632&#"#"'&'7327!#"'&'7327!#"'&'7327&'&54767!)!67654'&ãSOJMG7”9G~SOJMG7”9G~SOJMG7”9GcBnnVsSOJMG7”9Gþ‚SOJMG7”9Gþ‚SOJMG7”9G]InoSu,þ‚ýÛ~þ‚¾=,HK%2=,EG%â§DAF7Œ‚¯þâ7§DAF7Œ‚¯þâ7§DAF7Œ‚¯þÖK|’œoUþ¾§DAF7Œ‚¯$þçDAF7Œ‚¯$þçDAF7Œ‚¯0Io›œsVý’ñþñþ!Ö.JhgH$ºþ+/HgjG$uþL.3&#"7#'754'&'#"&'7327#4767>32";EY?w^H¾6¼H\O3,, HO€”;E+@/VfmVm HO€ö‚¯þ³?uœ]H½½H]sM3 üg¥‡z‚¯ˆ.Vr›mV_¥‡zuþM<%4'>7'7&#"7"&'7327&'&54767>2·=,HK%€˜=Q ‡Hl;EYLmHH§7'&#"'"&'7327&'&54767>2·=,HK%m#6,=iSH²;Ec‹¤HKÂsŸ˜€”;E]InoSuŸ˜€JÖ.JghH$6B0þ+‚@THþÖ?¤HK|Àþ¾¥‡z‚¯1Io›œsV<¤ˆzÿÿyÍžÕ' Oÿžþ…' Oðþ… OGÿÿyÍžÕ' OGþ…' Oð Oÿžÿÿ¡ÍtÖ' OÿÆ OÿÆþ…ÿÿyÍžÕ' Oð' Oÿž' Oðþ… Oÿžþ…ÿÿÙ-Ûj' O$ œÙŸÜj 3#3#!!ÓÓÓÓûÐXü¨þËþ•ªÿÿØŸÜj& œ' OÿýþW' Oÿþ$' O-þW O.$ÿÿÙŸÛj& Æ' OþW O$ÙÓÛ2#"'&'&'&#"5>32326Ûi³an’ ›^X¬bi³an“ ›^V©2³NE;=LT³NE;=KÙÓÛ23276767632.#"#"&'Ùg©V^› “na³ib¬X^› ’na³i2UK=;EN³TL=;EN¢1Ô).#"3".54>323265.#72#"&:QŸHRdhNiœ\dŽnxÂ>@°HRdhNiœ\dŽnxÄ.ttlH=Y›OšHL¢\}X[lH=Y›OšHL¢\}ÙWÛ­#"'"#322Û{ûædfftXª{ûædfftX×ý€ÖÜþ#€þ*þ$ÝÐ0!#.5476767654&'30´ND:323267#"''æcDX¬bi³a]y¬›¨eEV©gi³a`y«›S LT³NE+~FþŒ KU³NE,þ…FÙÛ¢ #"/&'&#"5>32326!!Ûi³an’›^X¬bi³an“ ›^V©ûeúþo³NE;=LT³NE;=Kˆ¨Ù`Ûô#"/&'&#"5>32326!!Ûi³an’›^X¬bi³an“›^V©ûeúþô²OE;=LS²NE; =KþkªÙbÛÓ%&32767#"'!!'7!5!7&#"5>32Ë%H\¯ i³aBPŸü﹉lþ噸‘ZX¬bi³an“3ïý}oþé -X"²OEºªþdšªó8LS²NE;IüÙ¸ÛÁ"#"/&'&#"5>32326!!!!Ûi³an’›^X¬bi³an“›^V©ûeúþúþÁ²OE;=LS²NE;?KþkªËªÙÛÁ.#"/&'&#"5>32326#5!7!5!7!!!!'Ûi³an’›^X¬bi³an“›^V©üLç•ÑýšŒoþKÐ…üɦoÁ²OE;=LS²NE;?KüLªËªŠsªËª sÙÿöÛB.32767#"'!!!!'7#5!7!5!7'&#"5>327b K`Jqi³a'+\+ýzlòü³h’>ùTmþ?u2›^X¬bi³an“c†’"%]²OE«ªËªÂNtªËªÚ=LS²NE;%úNÙÛô;?@.9*-" *œ19œ"œ œ<-<Ô<Ä21ÔìÔìÜüÔìÀ9999990#"'&'&'&#"5>32326#"'&'&'&#"5>32326Ûi³an’ ›^X¬bi³an“ ›^V©gi³an’ ›^X¬bi³an“ ›^V©o³NE;=LT³NE;=KÚ²OE;=LS²NE;=KÙÛÿ43267#"'3267#"/'&#"5>327&#"5>29+V©gi³a@LJ“ZV©gi³aƒ}¤‰9+X¬bi³a@MH’ZX¬bi³Â ¤a KU²OE»8KU³NE; þ˜@^ LT³NE»8LS²NE;f@Ù¸ÛÉ59#"/&'&#"5>32326#"/&'&#"5>32326!!Ûi³an’›^X¬bi³an“›^V©gi³aq›^X¬bi³an“Æ3V©ûeúþL²OE;=LS²NE;?KÒ²OE;=LS²NE;?KüîªÙyÛÑ5P#"/&'&#"5>32326#"/&'&#"5>32326#"/&'&#"5>32326Ûi³an’›^X¬bi³an“›^V©gi³an’›^X¬bi³an“›^V©gi³aq›^X¬bi³an“Æ3V©ײOE;=LS²NE;?KÒ²OE;=LS²NE;?KÒ²OE;=LS²NE;?KÙ¸ÛÁ"32?632.#"#"&'!5!5Ùg©V^›“na³ib¬X^›’na³iúþúþÁUK?;EN²SL=;EOþȪªþ‹ªªØ×Û+  %5 % $%5$[þáþœg&Yþ¢þà%Zþ£þÞþàþhÓ¦²•¦²—³¦²—¤²—Ù6ÛÎ9%676767!!"'&'&'!5!!5!676762!!&'&'&[C-8›þö7VYÎYW6 þöœ8.CC.8þd 6WYÎYV7 þe8-Ù,CE[¨<0[2332[39¨\DD+N+DD\¨93[2332[0<¨[EC,Ù`ÛÎ !5!676762!!&'&'&!![C.8þd 6WYÎYV7 þe8-ý;úþ++DD\¨93[2332[0<¨[EC,ýãªÿÿÙ`Ûÿ' O¹ ÿÿÙÛÿ' Oýº&  O¹ÿÿÙÞÿ' Oÿþ¹&  O0ý½ÿÿÙÝÿ' Oÿþý½&  O.¹ÿÿÏ62Ï' Oÿôþî' Oÿô‰ WÿÿÍ63Ì& ô' O…† O…þîÙ`Û¢ 3654'!!5!&547!5!!æ44ò34wúþ~þ€þ‰ú0IG00GG2ðªª?8>;¨¨_8Ù`Û !!!!"264&'2#"&546Ùúþúþ…Hdd‘deH;k'**¨z{¤§¢¨ðªDbFE``‹bq+((d:s¡žvv£Ù`ÛK!!!! &!56Ùúþúþ‚áàþÿþæé¢¨ðªë—²—•²—Ù`Û!!!! 3# Ùúþúþ$´Ÿ¾¸¢¨ðª‚ýcÙþ'Ù`Û!!!!33#Ùúþúþ$¦¸¾Ÿþý´¢¨ðªþ'ÙýcÙ`ÛÊ!!!!!!'Ùúþúþú+]^*ò^ôó]¢¨ðªNþä°þä°°Ù`ÛÔ !!!!!3!Ùúþúþ‚¦Nßp!ýN¢¨ðªÀþNfýÙ`Û07GO!!!!#"3###535463!3267#"&546324&#"'53#5#"&4632264&"Ùúþúþ¤?$mmC???DíþÏNB&H#$J'`qk[Q_C<17HÆBB@,I\\I,@Íp`ctiG6B?9iÚýÐ=$#t¾u#g“SS“SÙ`Û*!!!!>32#4&#"#4&#"#3>32ÙúþúþŸ!]?U\Z79EPZ7:DPZZV:;S¢¨ðª==:xoþµHOM]QþÊHPL^PþÊ%U20=Ù`ÛÚ ,!!!!3#7#546?>54&#"5>32Ùúþúþ4eeb_--B6'Z0/`4\o$-,¢¨ðªÈN2A+,/-7#!^aO&E++ Ù'ÛÝ>@" Ïœ Ï œ  Ü<Ä291Ô<Ì2ü<ìþ<ì990!!!!!'7!5!7!Ù}®/þHÃ{üúþþ}®þÕ¶Ãý‡¢;fÕ¨ðªþÇfÓªðÙ¸ÛL !@  Ü<<Ü<<1ÔÜÜÜÜÜ0!!!!!!ÙúþúþúþתªýÀªÙÿÎÛ4!5!7!!!!!!'7!5!7!5!•ýD€™Q"þrñýµn¹üé™RþÝoþL¢ªèT”ªËªËªêT–ªËªÙÛ  )@    Ü<Ü<1ÔÜÜÜÜÜÜÜ0!!!!!!!!Ùúþúþúþúþ”ªªüKªªÙÛ¨ T@.œœœœBѧœ $# ü<ì2291/ìôì90KSXííííY" 5 !!Ûü@Àúþúþúþøþëþî²pªoüªÙÛ¨ V@/œœœœBѧœ$ # ü<<ì291/ìôì90KSXííííY"55 !5ÙúþÁAúþø°þ‘ªþ²ýǪªÚÿVÜ 3!! 5 !!Úúþü@Àúþúþúþªþëþî²pªoüªÚÿVÜ !!555 !5ÜúþúþÀBúþªªk°þ‘ªþ²ýǪªÚþ±Ü!5!7!5!7!!!!' 5'þ³Ú`ýÆȉŠ)Pþ"_=ý6ŠŠÞü@Àúþªªsª¤s1ªsª¥tFþëþî²pªoÚþ±Ü!5!7!5!7!!!!'55'þ³Ú`ýÆȉŠ)Pþ"_=ý6ŠŠþÜúþÀªªsª¤s1ªsª¥tF°þ‘ªþ²”.Ìß 5 5ÌüÆ:ûÊ6üþüÆ:ûÊ6þpþrÅŸ ÎþpþrÅŸ ”.Ìß 5555”6ûÊ:86ûÊ:ÎýöŸýøÅŽÎýöŸýøÅްþò'!67&'&54767&'676'&'{)#Y4JJ4Y#)þÀ)#Y4JJ4Y#) AAAAGF£žâßà㞢GGGG¢žãàß➣FGú2;;âÎá;<<;áþ2â;ØÜè5$?$%5%67$'W´É ßeþöþ»²Ä”‡·Èþûäd?þNÿÄ”])]²o&¶—²¯ bRô)`²q%µ ˜²¯ þŸRÙÛd%'%5% >ýz™‡“þ­ˆmþzÈþF<ß˶êþ½@6´¦ o@æh¶‹GpÙÿ Ûÿ%5'75%7-ý†™‡“ïüå­ˆmþá†ÈºþÄ%˶êC@þÊ´¦þàþ‘@æh¶‹GpÙÿ/ÛV !5!%5%%%!!'’þ‰/ôþƒ½xýËv¤H-þ‰réýÛf‹ý5L¤OlUýrªC¢ªÝ@=ÇV°lþÑŒ²žþíªÑ=Ùÿ/ÛV%'!5!75%7%5!!'‘ ÖþþøGWþbè[ý½„¤ÚýmmüÁN¤—L>üߪìw²‹õ§°·e=þ¨ˆª½þتÑ=Ùÿܨ$%#"'&'&'&#"5>32326 5Üj²bn’ š^X¬bh´`n” œ^V¨gü@Àúþð´ND:3232655Üj²bn’ š^X¬bh´`n” œ^V¨ûfúþÁ²NF<>LT²NF<>L>°þ‘ªþ²Ùÿ)ÜP14%&#"5>32%5%%%3267#"'&'&/' k X¬bh´`'+kýÆu¥E%þsäýák œ^V¨hj²bn’ "P¥vþ„1-LT´ND£ªÞ9A»T°jþÍŠ²œþãLT²NF<þñ=ß &T²N#¡w²‹ô¨°¸f=ý€J;ÐÿNÜ} 55 5ÚúþÀ8ü@Àúþ'°þ‘ªþ²»þëþî²pªoÐÿNÜ} 5 55Òü@ÀúþûúþÀ'þëþî²pªoö°þ‘ªþ²ÐþmÜ`!-%5%%%'5%%5 MMþÜ`ýºÂZ¦D„þOAòýè@ýFZ¦Dþt¸@þmþ¬*³_TW§ªÊˆ&þÔo°}þ䎲š¥ªÈþw&-r²~‘°›ÞbUÐþmÜ`!7/%5%%'%5%75%À®˜J¦’¤ýv±a¦d®ýì",ý©,ƒýV`¦bþL"ýÌ_D2,£/*/¼°Å¨&þO{ª˜”Ÿ°­Â¸²Äþ[&®}ªš”¢²­Ùÿ²ÛP %5$Ûþrýó ’þoüsaþa^þ~ï|¦|Ùÿ²ÛP 55%$Ùsüþo’ ýóaïþ|¦|þï‚^aÙÿ)ÛW!%5%5$Ûþgü—V¬þþ$Üþü}ƒ×¾‘®…ßþå]]þå×x„¦|€Ùÿ)ÛW3%55%$Ù¬Vü—þgƒü}þÜþ$¡…®‘þBW×þ€|¦„þˆ×]]ÙÿRÛW(%#"'&'&'&#"5>32326%5$Ûi³an’ ›^X¬bi³an“ ›^V©gþþ$Üþü}ƒ±³NE;=LT³NE;=K$þå]]þå×x„¦|€ÙÿRÛW(%#"'&'&'&#"5>3232655%$Ûi³an’ ›^X¬bi³an“ ›^V©ûeƒü}þÜþ$±³NE;=LT³NE;=K$×þ€|¦„þˆ×]]ÙÿƒÛ&%5$%67%'îðþÛÃEƒ¹žtºÖ‹$÷ãþ‚ë‚k—¡}u°U)¦?¥eKþtu•ï³uþÔíï"¦þ K 9'ÙþåÛ'567$'567&'Æð%þ=þ»þ⃹žtºÖ‹þÜ÷ã~ë‚þ•—¡}uRU)¦?¥ý›KŒu•ï³u,íïþÞ¦÷Küö9'Ì£è_%!"54763!!"3!èüÂÊþ슊È@üÀˆ¾^`ˆ@£ÈÆ‹–ÀˆŠ^`Ì£è_75!27654&#!5!2#Ì@ˆ`^¾ˆüÀ@ÈŠŠþìÊ£–`^ŠˆÀ–‹ÆÈþêÌÿ;èÏ #";3!!!!#"54763¢úˆ¾^`ˆ0ørªrnþdÊfýlpªpÈþꊊÈÉÀˆŠ^`&pþ–ýp–þ˜hÈÆ‹Ìÿ3èÇ 32654'&+ #!5!!5!32#úˆ¾^`ˆ0ørªrþ’œÊýš”pªpÈŠŠÈ9ÀˆŠ^`üÚþp––hþ˜þêÈÆ‹¾Ûè7!!!"'&54763!!"3!òéûéüÁÉŠ‹‹ŠÈ@üÀ‰¾_`ˆ@––,‹‹ÈÆ‹–ÀˆŠ^`Ùöè7!!5!27654&#!5!2#Ùéû@ˆ`_¾‰üÀ@ÈŠ‹‹ŠÉ––,–`^ŠˆÀ–‹ÆÈ‹‹¾ÿÛ× '!";!!!!'7!5!7&'&54763!7!!Ñþʉ¾_`ˆ'œ}ýE=øüÉa†LþéT>¹‚‹‹ŠÈsc†L0þ’RÀˆŠ^`–––í5¸––ƒ‹ÈÆ‹ï7¸–Ùÿö× '327654'&/!5!7+!!'7!5!7!5!^»ˆ`__BV™ý 5c†TpX‹‹ŠÉ÷?àüãb†LþÐm>þUéÂ`^Šˆ`C –ï7Ë XÆÈ‹‹––í5¸–––¾ÿjÛé )5!7!!'!"'&54763!!"3!Äþ.Bqx-ëý¥qxDüÁÉŠ‹‹ŠÈ@üÀ‰¾_`ˆ@––Z<––Zi‹‹ÈÆ‹–ÀˆŠ^`¾ÿjÛé )5!7!!'5!27654&#!5!2#Äþ.Bqx-ëý¥qxþ'@ˆ`_¾‰üÀ@ÈŠ‹‹ŠÉ––Z<––Zi–`^ŠˆÀ–‹ÆÈ‹‹Ó¢332653#"757!!¬”¦¥”¬õðñõîÄ54&'&'$  &'&'&547676!!#!5!ÅÖ]\LMLLML\]Ö]\LMLLML\þ®îbc1111cbîþìîbc1111cbÍdþœªþœdŽ''LM¸mj¸ML''''LM¸jm¸ML'½dbcwvŒ‰wvcbddbcvw‰Œvwcb„þ›ªþ›eªe»ÿãù$7!!"2767>54&'&'$  &'&'&547676¡rüŽ$Ö]\LMLLML\]Ö]\LMLLML\þ®îbc1111cbîþìîbc1111cbתa''LM¸mj¸ML''''LM¸jm¸ML'½dbcwvŒ‰wvcbddbcvw‰Œvwcb»ÿãù$3?"2767>54&'&'$  &'&'&547676''7'77ÅÖ]\LMLLML\]Ö]\LMLLML\þ®îbc1111cbîþìîbc1111cbíýüxüüyýüxüüŽ''LM¸mj¸ML''''LM¸jm¸ML'½dbcwvŒ‰wvcbddbcvw‰Œvwcbþ¾üüxüýyüüxüý»ÿãù$7 "2767>54&'&'$  &'&'&547676æpxýgÖ]\LMLLML\]Ö]\LMLLML\þ®îbc1111cbîþìîbc1111cb†pxý€''LM¸mj¸ML''''LM¸jm¸ML'½dbcwvŒ‰wvcbddbcvw‰Œvwcb»ÿãù$73#"2767>54&'&'$  &'&'&547676ðÔÔÕÖ]\LMLLML\]Ö]\LMLLML\þ®îbc1111cbîþìîbc1111cbþ‹''LM¸mj¸ML''''LM¸jm¸ML'½dbcwvŒ‰wvcbddbcvw‰Œvwcb»ÿãù$ 2L"264&'2#"&54>"2767>54&'&'$  &'&'&547676ZPnn noO@v+..¹†‡´¸ðÖ]\LMLLML\]Ö]\LMLLML\þ®îbc1111cbîþìîbc1111cbAoPOmmžp1.-rB„·´‡†ºÌ''LM¸mj¸ML''''LM¸jm¸ML'½dbcwvŒ‰wvcbddbcvw‰Œvwcb»ÿãù$+E %#'-73%"2767>54&'&'$  &'&'&547676ðþ½C4þÑfþÑ4Cþ½4/f/÷Ö]\LMLLML\]Ö]\LMLLML\þ®îbc1111cbîþìîbc1111cb1¯°X·þ­S·X°¯Y·Sþ­·''LM¸mj¸ML''''LM¸jm¸ML'½dbcwvŒ‰wvcbddbcvw‰Œvwcb»ÿãù$!;!!!!"2767>54&'&'$  &'&'&547676€ý€€ý€«Ö]\LMLLML\]Ö]\LMLLML\þ®îbc1111cbîþìîbc1111cbjˆÀˆô''LM¸mj¸ML''''LM¸jm¸ML'½dbcwvŒ‰wvcbddbcvw‰Œvwcb»ÿãù$37"2767>54&'&'$  &'&'&547676!!ÅÖ]\LMLLML\]Ö]\LMLLML\þ®îbc1111cbîþìîbc1111cb8€ý€Ž''LM¸mj¸ML''''LM¸jm¸ML'½dbcwvŒ‰wvcbddbcvw‰Œvwcbþª»ÿãù$!%!!!!#!5!QûX>úÂôdþœªþœd‰ûð›ú¿Yþ›ªþ›eªe»ÿãù$ !!!%!!¡rüŽPûX>úÂת\ûð›ú¿»ÿãù$   ' 7 %!%!!=þ•kyþ–þ–ykþ•yjjüûX>úÂìþ–þ–xjþ•yjjyþ•k$ûð›ú¿»ÿãù$ 3#!%!!ðÔÔþaûX>úÂþ†ûð›ú¿¯Jš@ ÜÜ<Ü1<ÜÜÜ033!!¯úäšýuýp¯Jš!#!5!3Jú䋯Iš!#!5Iýs€ýsšúå¯Iš35!3!¯€úå¯|š33!!¯Ný²šýuýp¯|š !#3!!!!.Ný²Ný²šþ$ä¯Jš !#3!!!!.úäúäšþ$ä¯Jš !3!!!#3¹üGþšýuýpš¯Jš !#33!!!#3.GVýªþšúfšýuýpš¯Jš!#3#3!!!!.c¹üG¹üGšúfšþ$ä¯ÿ¯Jë33!!!'!¯'SsþÅjý\þªs=þšýuÜ5ýYý6«ýp¯ÿ¯Jë!!!!'!#3!7!¨sêý­j½ýþþséþhx¥jýÃë5þäýÓ6÷þ$šþ$þää¯ÿ¯Jë!!'!#3!#3‚sþÅþ6þªs=þžüÿë5ýYý6«ýpšýuüñš¯ÿ¯Jë!#3!!!!!'!#37!‘ôsê:þŒjÞýçþþséþìþ²jþGšþ$-5þäýÓ6÷þ$šüÁääÙÿ§Ë]*5$%67654&#"'632#"'732654'&'$Ù›@Èe=M>P7sZ ˆ°”ãþ‰wã”°ˆ Zs7P>M=eÈþÀ.¨(Y7O0<0:>~j yŸ[Œ<<Œ[Ÿy j~>:0<0O7YÙÿ§Ë]*327#"&5476%$'&54632&#"ËþeþÀÈe=M>P7sZ ˆ°”ãwþ‰ã”°ˆ Zs7P>M=eÈ@›.(Y7O0<0:>~j yŸ[Œ<<Œ[Ÿy j~>:0<0O7Y(ÙÛæ 51ü¢úþ Äþžýœ¦ÙÛæ ƒ^ü¢ª bbü:Èýï¦ÙÿžÛd 5! 5Ùªü¢úþbªªÄþžýœ¦ÙÿžÛd 5! Ùû¨^ü¢ªbªªbbü:Èýï¦yg‡¢62"'&'!"&462!6"264ŸS몧òQ3ýQ3Tò¢¦ëW4¯üdrOOsOOS¨ï¤Q3CB3R¢ò§U4CDPrOOqyg‡¢"&462!6762"'&'!$264&"aS몧òQ3¯3Tò¢¦ëW4ýQœrOOsOºS¨ï¤Q3CB3R¢ò§U4CDPrOOqbgR¢ 7!6762"'&'$&"26bÀ1[륢òS4šOsPOtO.¨D/Y§ò¢R3BŽPQqOOyÿ ;d 3#!!#3%!5!¨¨( ý󀨨þØýó dýó€ªýs €ªî<›!##5!#T~èNèÈì 35!3 3#ÈKûõÃ#"Ãþ˜úªªìüT¬û^Èì !!3# ÈKûµ@iúhÃþÞþÝìªú¾¢û^¬üTÈì !!3 3#ÈKûµ@Ã#"Ãþ˜ú쪠üT¬û^™~ )3!!&'.'&™û‚ªZV¥îF%ü,E=Î?~þë%Fî¤VZDý¼A?Î=™~ !53ïüÖ*ü,ÔªÔüÖªªÔû‚ÿúþw–Á # #·ßËý}ý}ËÝÁø¶wù‰Jÿúþw–Á 3 3Ùý!˃ƒËý#þwJù‰wø¶ŒþwÁ@ ÜÜÜÜ1@ ÜÌÌ0"# #4$HÛþÌ­½þ½­þÏãüû9àB(þØþ¾û ÇúåŒþwÁ@ ÜÜÜÜ1@ ÜÌÌ02$53 3HÛ4­þCþþC­1åãüÇû þ¾þØ(Bàû9úå‚‚€€ rþðþþþ‚þðþòþþþÛH®F·ƒÔì1Ôì03#ÛÓÓFþù1  !!'ù+]^*ò^ôó]ýþä°þä°°ÙÛç3#3#!5!7 !! 'ßööööRþL´þ‹xÊÊxþ‹´þLuxþ6þ6xõÉöþ<ªuxþ6Êxþ‹ªþ‹xÊþ6xÙÿÂ'B  ' Ù''üÙ›þâ>€ý°Pú€Nq^ýD^þ¢ÆÙÿÂ'B %  !'üÙüÙ''ýtþÊþ¢àNý²€ý°PÝþ^ýDÙÿÂ'B 5  5!Ù''üÙüÙŒ6âbàý²Nú€Pý°Ýäþ¢¼ÙÿÂ'B5 5ÙŒýtNüÙ>àáâÝû]ÝPÙÿÂ'B 5 'üÙüÙNýtŒ>Pý°Ý£ÝþþÙ`Ûô32?632.#"#"&'!5Ùg©V^›“na³ib¬X^›’na³iúþôUK= ;EN²SL=;EOþȪªcy¢ 33#c×u?Ik×þ8fºf¢þþ%ÚqþüÝ#cy¢ 33#cÈfºfÈ×þ•I?þ‹#üÝþqÚþ%þ¾ÿúÛ )!"3!!"'&5463!! '&76)!"3!Ûýk:((P:•ýj€ZY²–ýkþñ¼½½º—ýjÈŠ‹‹ŠÉ• ()9:PªZX‚€´üD½¾  ¿½ª‹ÆÈ‹‹Ùÿúö )5!2#!5!2654'&#5!27654'&#!5! !Ù–²YZ€ýj•:P((:ýk•ÉŠ‹‹ŠÈýj—º½½¼þñ ª´€‚XZªP:9)(ü‹ÈÆ‹ª½¿þôþó¾½ÒâN$!4&"#47632! #4'& äPtPªZX‚€´üD|À¼ªŠŒþpŠŒÆ:PP:ý:È€ZX²€ý8Æx¼ºþðý8ÈÈŠŠŠŠÊý:Òÿãâ1$2653#"&5! '&3 765ÐPtPªZX‚€´¼þ„ýèÀ¼ªŠŒŠŒ1ý::PP:Æý8€ZX²€Èý:þðþˆ¼ºÈý8ÈŠŠŠŠÊÆ|8Õ4'&'##47673#ŽZ:KªK:ZªŒl‘ª“lŠªŸ€Y:ü:Æ:Z€ýaÈŒlaþŸlŠÈýaÙÿ4ÛÕ###!5!5!5!333!!!!'5#Yªªªþ~‚þ~‚ªªª‚þ~‚þ~ªªÌ,ýÔ,ªð¨3ýÍ3ýͨðªªððÙ^Û¦ 3# 5¤ÓÓ7ûøúþþîþ‘þ“¶ѦÑÙ^Û¦ 3#55=ÓÓdúþþî¶þ/¦þ/¶m”. Ìß  5 5 5 ÌüÆ:ûÊ6ýüÆ:ûÊ6üþüÆ:ûÊ6þpþrÅŸ ÎþpþrÅŸ ÎþpþrÅŸ ”. Ìß 555555”6ûÊ:86ûÊ::6ûÊ:ÎýöŸýøÅŽÎýöŸýøÅŽÎýöŸýøÅŽÙþ.ÛÔ  5 !5! 5ÙÁü?úþúþü@ÀúþþÞ²þªþ‘þªNþëþî²pªoÙþ.ÛÔ 5 5!55Ûúþü?þ¿úþúþÀþÞ°oªp²þî9ªªø°þ‘ªþ²ÙÛ¨ %5 5!Ûúþü@þ¾°°oªp²þî9ªªÙÛ¨ 7 5 !5!ÙÁü?úþúþ°²þªþ‘þªÙÿ)ÛW5$%5$ÛþTüªi™þü}ƒþþ$Ü€þ_…®‘¾ú©×€|¦„x×þå]]Ùÿ)ÛW5$%$5Ù™iüªþTÜþ$þƒü}þ€×þB‘®…ý!]]×þˆ„¦|þ€Ùþ“Û!&!%'&'57&%5$%67&%7Ûþóþ*þズÕÿÚ?ðþص;öƒ¦½‚ÈâiöÚþ€@šþ]0qw^×%¤ý¡KA6#®(A‡F+¦3273267#"'' 5æcCX¬bh´`^xn›ieEV¨hj²b_zl›]ü@ÀúþLT´ND*óFé JV´ND+ðFÍþëþî²pªoÙþåܨ"%&#"5>3273267#"''55æcCX¬bh´`^xn›ieEV¨hj²b_zl›þ[úþÀLT´ND*óFé JV´ND+ðFͰþ‘ªþ²Ùþ¦ÛW&&#"5>3273267#"''%5$æcDX¬bi³a]ym›ieEV©gi³a`yl›]þþ$Üþü}ƒ. LT³NE+óFé KU³NE,ñF”þå]]þå×x„¦|€áþ¢ãW&&#"5>3273267#"''55%$îcDX¬bi³a]ym›ieEV©gi³a`yl›þ[ƒü}þÜþ$3 LT³NE+ôFê KU³NE,ðF˜×þ€|¦„þˆ×]]ÙþöÛ 7%'%5 '瞃Ùý¹ÛžÜýâL ‹Ðž‘þ  @þÁYû8ðýè@à¦\üïÄ9þ@aÎÙþöÛ ' 7%ÍžƒÙGÛžÜü´þô‹Ðž‘öþö@?YÈð@ýçà¦þ¤ý<9ü@þŸÎÙþ}Û…5!%57%!!'71ŽÏý| ýäIÁžÛý·…Îüìvž\'þ žÄ:þýqª†ß¦[×@þÅZû8ñþ»ªþß@áÐ_ÍÕþ}×…7!!'7#5!7%%%Õ¥éžé¿ý9ƒJüpvž\º]þFGjqœÈþé8@ýǹ¦þÛþÀªþß@áªäµý  &vvýŠýŠrèèýþn66\]Ú]\6666\]Ú]\6¨Šîîþèî5þ•kØkþ•üæ\­þSü¤þSÈÚ]\6666\]Ú]\6666\þªîþèÿÿš!ŽˆYþ÷ÏZ  "27654/2#"&546573éÊ2332Ê233—¡ªª¡¢ªªþVßæ‰VV¬­VVVV­¬V¯ÞÓÔÞÞÔÓÞü¬Ñ)t'ü½ÿ‚ÿã¤>32#"&'#'%53%&  s:±{ÌÿÿÌ{±:¹þé!8¹#!þ¼r§þܧ§$¶daþ¼ýðþ¼ad¨æ]chÀƒaamü@–ççþjç’þ.‚Ð!3!3: ¨ü¨þØøý^¢˜ÿì”è &Ûº+¸º#+¸#º+¸A&6FVfv†–¦¶ÆÖ ]Aåõ]Aêú]A)9IYiy‰™©¹ÉÙ ]º+¸º +¸ º$%+¸$¸Ð01! 4$32! 4$#"35%33!”þ?þÂþÄþ?Îq¾ÁqÍúW¶þ¸­­þ¸¶|Ùì¡Úý—êþÁþA¿?ÆrÆÆþÈþäþp³G±±þ¹ýÿ~+˜/ü掘ÿì”è 8?º+¸º3&+¸3º+¸A&6FVfv†–¦¶ÆÖ ]Aåõ]Aêú]A)9IYiy‰™©¹ÉÙ ]¸3¸и/Aê&ú&]A&)&9&I&Y&i&y&‰&™&©&¹&É&Ù& ]º,9º+¸º +¸ º+¸º0)+¸001! 4$32! 4$#"!!56$7>54&#"5>32”þ?þÂþÄþ?Îq¾ÁqÍúW¶þ¸­­þ¸¶O´ý\R!>/_N;„sa‘=£Å0>²êþÁþA¿?ÆrÆÆþÈþäþp³G±±þ¹ýÿŽMñ"?U(?N&:«$—}:iF§˜ÿì”è Dµº+¸ºB5+¸Bº+¸A&6FVfv†–¦¶ÆÖ ]Aåõ]Aêú]A)9IYiy‰™©¹ÉÙ ]Aê5ú5]A5)595I5Y5i5y5‰5™5©5¹5É5Ù5 ]º5B9º,5B9¸,/Aê,ú,]A,),9,I,Y,i,y,‰,™,©,¹,É,Ù, ]¸ܺ&9º;9º+¸º +¸ º)"+¸)º?8+¸?º2/+¸2º/2901! 4$32! 4$#"#"&'532654&+532654&#"5>32”þ?þÂþÄþ?Îq¾ÁqÍúW¶þ¸­­þ¸¶¹ vØÃ@ˆX[}DuskcŒ‘ZX\[4yk_ˆ=¡ÁhêþÁþA¿?ÆrÆÆþÈþäþp³G±±þ¹–]œ¨0OLGNŒ<:,+¸>º2+¸201! 4$32! 4$#""32654&.#"632#"&5432”þ?þÂþÄþ?Îq¾ÁqÍúW¶þ¸­­þ¸¶¡N\\NN\\ÔTa/w €N ºÂ ¹ÀêÈ5jêþÁþA¿?ÆrÆÆþÈþäþp³G±±þ¹Ÿb[ZbbZ[bœ#”P =±”‘³ýçÚ ˜ÿì”è "ë¸#/¸$/¸Ü¸#¸и/¸ÜA&6FVfv†–¦¶ÆÖ ]Aåõ]¸¸ÜAêú]A)9IYiy‰™©¹ÉÙ ]º 9º!9º+¸º +¸ º!+¸01! 4$32! 4$#"!#!”þ?þÂþÄþ?Îq¾ÁqÍúW¶þ¸­­þ¸¶k«þ”ÁQþ1êþÁþA¿?ÆrÆÆþÈþäþp³G±±þ¹Kü£˜ÿì”è '?K º+¸º=+¸º1F+¸1º+¸A&6FVfv†–¦¶ÆÖ ]Aåõ]Aêú]A)9IYiy‰™©¹ÉÙ ]A&6FVfv†–¦¶ÆÖ ]Aåõ]AêFúF]AF)F9FIFYFiFyF‰F™F©F¹FÉFÙF ]º%F19¸%/Aê%ú%]A%)%9%I%Y%i%y%‰%™%©%¹%É%Ù% ]º+=9¸+/º4F19¸%¸7ܸ+¸@ܺ+¸º +¸ º":+¸"º.I+¸.ºC+¸Cº4C901! 4$32! 4$#""32654&%.54632#"&546732654&#"”þ?þÂþÄþ?Îq¾ÁqÍúW¶þ¸­­þ¸¶¯T__TT__þÆj·¶iv¾­­¾vWQMKRRKMQêþÁþA¿?ÆrÆÆþÈþäþp³G±±þ¹æPIIPQHIPIvStˆˆtSvƒ\Š——Š\ƒÁ=BB=>BB˜ÿì”è 4@‘º+¸º>)+¸>º+¸º/8+¸/A&6FVfv†–¦¶ÆÖ ]Aåõ]Aêú]A)9IYiy‰™©¹ÉÙ ]A>&>6>F>V>f>v>†>–>¦>¶>Æ>Ö> ]Aå>õ>]º)>9Aê8ú8]A8)898I8Y8i8y8‰8™8©8¹8É8Ù8 ]º+¸º +¸ º 2+¸ º,;+¸,º5&+¸501! 4$32! 4$#"532676#"&54632#"&2654&#"”þ?þÂþÄþ?Îq¾ÁqÍúW¶þ¸­­þ¸¶Ua.w €OŸºÂ ¹¿éÈ5kÙN[[NN\\êþÁþA¿?ÆrÆÆþÈþäþp³G±±þ¹ý‹œ$“O <¯”‘´ýèÚþö´b[[bb[[b˜ÿì”è &2>›º+¸º#+¸#º*<+¸*º60+¸6º+¸A&6FVfv†–¦¶ÆÖ ]Aåõ]Aêú]A)9IYiy‰™©¹ÉÙ ]Aê0ú0]A0)090I0Y0i0y0‰0™0©0¹0É0Ù0 ]Aê<ú<]A<)<9<I<Y<i<y<‰<™<©<¹<É<Ù< ]º+¸º +¸ º-9+¸-º$%+¸$º3'+¸3¸$¸Ð01! 4$32! 4$#"35733!"32654&'2#"&546”þ?þÂþÄþ?Îq¾ÁqÍúW¶þ¸­­þ¸¶Íž¬¼uŸþ>@EE@?FF?‚ˆˆ‚ƒˆˆêþÁþA¿?ÆrÆÆþÈþäþp³G±±þ¹þ>>'‰*ý6€Þ—£¢——¢£—{äÑÐääÐÑäÿìjå5!ùj¬¬ÿìål!ùXþ¨þ¸3 þ öÈþ!È@þ ö<j• 5!!5!!5!r#ýB#ýB#j¬¬¬¬¬¬<•l !!!!!r#ýB#ýB#Xþ¨Xþ¨Xþ¨þm¸ 333     þmjý–jý–jý–Èþm !!!È@þÀ@þÀ@þmjý–jý–jý–<j• 53353353353<¼x¼x¼x½j¬¬¬¬¬¬¬¬<•l 3333333<¼x¼x¼x½Xþ¨Xþ¨Xþ¨Xþ¨þn¸ 3333       p¢þ^øþ¢þ^¬¢þ^ýª¢þ^Èþn !!!!È@þÀ@þÀ@þÀ@p¢þ^øþ¢þ^¬¢þ^ýª¢þ^þå!!ÍýÓþ¬û–þål!!ÍýÓþlþ¨ûìÈþå!!Èþ#þ¬û–Èþål!!Èþ#þlþ¨ûìÿìþ¸!5!ýÔÌþj¬úêÿìþ¸l!!ýÔÌþXú”ÿìþ!5!Èþ$þj¬úêÿìþl!!Èþ$þXú”jå3! -jû•¬å3! -mûëþ¨Èjå!!È@Ýjû•¬Èå!!È@Ýmûëþ¨ÿìj¸5!3, j¬kúéÿì¸!3, Xú“ÿìj5!!Ü@j¬kúéÿì!!Ü@Xú“þå3!! -ýÓþ û•¬û–þå3!! -ýÓþ ûëþ¨ûìÈþå #!!!P@ÝýÓþjû•¬û–Èþå 33!!ÈP -þ#þkû•¬û–Èþå!!!È@Ýþ#þ û•¬û–Èþå #!!!P@ÝýÓþmûëþ¨ûìÈþå 33!!ÈP -þ#þlûëþ¨ûìÈþå!!!È@Ýþ#þ ûëþ¨ûìÿìþ¸!5!3ýÔ, þj¬köÿìþ¸!!3ýÔ, þXöÿìþ !5!!#ýÔÜ@Pþj¬kúéû–ÿìþ !5!33Èþ$, Pþj¬kû•úêÿìþ!5!!Èþ$Ü@þj¬köÿìþ !!!#ýÔÜ@PþXú“ûìÿìþ !!33Èþ$, PþXûëú”ÿìþ!!!Èþ$Ü@þXöÿìþå!5!!ýÔùýÓþj¬¬û–ÿìþål !!!!ýÔÌ-ýÓþXV¬û–ÿìþål !5!5!!ýÔ,ÍýÓþj¬Vþ¨ûìÿìþål!!!ýÔùýÓþXþ¨ûìÿìþå!5!!Èþ$ùþ#þj¬¬û–ÿìþål !!!!Èþ$Ýþ#þXV¬û–ÿìþål !5!5!!Èþ$Üþ#þj¬Vþ¨ûìÿìþål!!!Èþ$ùþ#þXþ¨ûìÿìjå5!3!, -j¬kû•¬ÿìå !3!!, -ýÓXû•¬Vÿìå 5!3!!5, -ý3j¬kûëþ¨Vÿìå!3!, -Xûëþ¨ÿìjå5!!!Ü@Ýj¬kû•¬ÿìå !!!!Ü@Ýþ#Xû•¬Vÿìå 5!!!!5Ü@Ýüãj¬kûëþ¨Vÿìå!!!Ü@ÝXûëþ¨ÿìþå #!5!3!¸ ýÔ, -jû–j¬kû•¬ÿìþå !!3!!ýÔ, -ýÓþXû•¬û–ÿìþå !5!3!!ýÔ, -ýÓþj¬kûëþ¨ûìÿìþå !!3!!ýÔ, -ýÓþXûëþ¨ûìÿìþå !5!!!!ýÔÜ@ÝýÓþj¬kû•¬û–ÿìþå !5!3!!Èþ$, -þ#þj¬kû•¬û–ÿìþå !5!!!!Èþ$Ü@Ýþ#þj¬kû•¬û–ÿìþå !!!!!#ýÔÜ@Ýþ#PþXû•¬Vûìÿìþå #5!5!!!!Pþ$Ü@ÝýÓþV¬kûëþ¨ûìÿìþå !!33!!Èþ$, PÝþ#þXûëV¬û–ÿìþå !5!533!!Èþ$ÜP -þ#þj¬Vûëþ¨ûìÿìþå !!!!!ýÔÜ@ÝýÓþXûëþ¨ûìÿìþå !!3!!Èþ$, -þ#þXûëþ¨ûìÿìþå !!!!!Èþ$Ü@Ýþ#þXû•¬û–ÿìþå !5!!!!Èþ$Ü@Ýþ#þj¬kûëþ¨ûìÿìþå !!!!!Èþ$Ü@Ýþ#þXûëþ¨ûì<j•5!35!<ðyðj¬¬¬¬<•l!!!¥ðû§ðXþ¨Xþ¨þÀ¸Á33   lUü«ûTTü¬ÈþÀÁ!!È@þÀ@lUü«ûTTü¬ÿì¾åÂ5!5!ùûù¬¬þ¨¬¬xþX333x   þ ö öþå !!!!ÍýÓ-ýÓþ¬¬¬üBxþå !!##xmþs  þ¬û–jû–xþå !!3!!xmý3 -þsþ¬úêj¬üBÿìþ¸ !5!5!5!ýÔ,ýÔÌþ¾¬¬¬ú>ÿìþX 5!###l   j¬úêjû–jÿìþX !5!!!5!¸ý4lþ þt,þ¬ú>¾¬û–¾å 3!!! -ýÓ-¾ÃüA¬¬¬xjå 333!x   jû•kû•¬x¾å 3!3!¸ ü“ ÍküA¬þ¨Ãúé¬ÿ쾸 5!5!5!3,ýÔ, ¾¬¬¬¿ú=ÿìjX 5!333Œ   j¬kû•kúéÿì¾X 5!35!3Œ ýÔÌ ¬¿û•þ¨¬ú=þå 3!!!! -ýÓ-ýÓþ üA¬¬¬üBxþå 333!!x   þsþ ö û•¬û–xþå 3!33!!¸ ü“  -þsküA¬úê öj¬üBÿìþ¸ !5!5!5!3ýÔ,ýÔ, þ¾¬¬¬¿öÿìþX !5!333xþtŒ   þj¬kö öÿìþX 5!3!5!33Œ  þt,  ¬¿û•ú꾬û– öÿìþå !5!!5!ýÔùýÓý4ùþ¾¬¬üB¬¬ÿìþå 5!!###ùþs   j¬¬û–jû–jÿìþå 5!!5!3!!ùü“þt, -þs¬¬ú꾬û–j¬üBÿì¾å 5!5!3!ùû, -¾¬¬X¬¿üA¬ÿìjå 5!333!Œ   j¬kû•kû•¬ÿì¾å 5!5!333!ùûŒ   ¾¬¬X¬¿û•küA¬ÿìþå!5!5!5!3!!!!ýÔ,ýÔ, -ýÓ-ýÓþ¾¬¬¬¿üA¬¬¬üBÿìþå5!333!!###Œ   þs   j¬kû•kû•¬û–jû–jÿìþå !!!!5!5!333!¸-þsþ þt,ýÔŒ   þj¬üB¾¬û–¬¿û•küA¬þå 43!!"ªªyþ‡Y[þp¥¬~|üÿìþ¸ 4&#!5!2[Yþˆx¨¬þp~|¬þ¨üÿìj¸ 5!2653#xY[ ¬¨j¬~|qü¨þjå !"&533!åþ‡¨¬ [Yyjþ¨qü|~ÿ§þ*m3YѲû/þ Yö§ÿ§þ*m#3*²û/²þ Yÿ§þ*m # # 3 3*²ýðýñ²iý—²²ý˜þü¬­üûSÿìjh5!|j¬¬À¸3 ÀÁû?hjå5!h}j¬¬þ¸À3 þÀû@ÿìhl|Xþ¨ÈÀ!È@ÀÁû?hål!h}Xþ¨ÈþÀ!È@þÀû@ÿìål5!5!!5iý—j¬Vþ¨VÈþ333ÈP PþÀÁû?û@ÿìål!!!iý—XV¬VÈþ#!#P@PþÀÁû?û@ÿÿÿì;([ÿìþ;ÿ!Oþþûÿìþ;ÿö!Oþöþ ÿìþ;!Oþüñÿìþ;!Oþûìÿìþ;!Oþúçÿìþ;!Oþùâÿìþ;#!Oþ#øÝÿìþ;(!Oþ(÷Øÿìþq(!…þ(÷Øÿìþ§(!»þ(÷ØÿìþÝ(!ñþ(÷Øÿìþ(!'þ(÷ØÿìþI(!]þ(÷Øÿìþ(!“þ(÷Øÿìþµ(3Éþ(÷Øÿÿþ:(c' ÿìþq( #'+/3!33!33!33!33!33!3§ÊüÊÊÊüÉòÊüÊÊÊüÉòÊüÊÊÊüÉþþûþûmþûþûnþûþûmþûþûnþûþûmþûþû ÿìþ4('/7?GOW_gow‡—Ÿ§¯·¿ÇÏ×ßçï÷ÿ#'573#'573#'573#'573#'573#'573#'573#'573#'573#'573#'573#'573#'573#'573#'573#'573#'573#'573#'573#'573#'573#'573#'573#'573#'573#'573#'573#'573#'573#'573#'573#'573µ¿¿’¿¿’¿¿’¿¿ü¿¿’¿¿’¿¿’¿¿ú¿¿’¿¿’¿¿’¿¿ü¿¿’¿¿’¿¿’¿¿ú¿¿’¿¿’¿¿’¿¿ü¿¿’¿¿’¿¿’¿¿ú¿¿’¿¿’¿¿’¿¿ü¿¿’¿¿’¿¿’¿¿(ûûûûûûûþûûûûûûûþûûûûûûûþûûûûûûûþûûûûûûûþûûûûûûûþûûûûûûûþûûûûûûûÿìþ;(!%)-13#3#3!3!##!#3#3#3#3#3#3#ÉÉÉÉÉ^Ê^ÊÊý¢ÊÊÊ(ÊÊþlÊÊþlÊÊ(ÊÊþlÊÊþmÖÖþû÷Øþûþû¶þûýýŽþûýÿÿÿì#;(X#ÿÿqþ:(f…ÿìþ!(þûìþ;!(þûìÿì(!(ûìÿìþ;(!!!;ù±('þ(ûìÿìþ;(!!!('üØûìûìÿìþ;(!!;üÙüØ(ûìûì(ÿìþ;(!!!OüØüÙ(÷Ø;(!(ûìÿìþ;(!!!!'(üÙüØûìûìÿìþ;(!!'(þ÷غÿÕ$!ºü ùàºÿÕ$!!!,7úÉrŠ<úR ùàºÿÕ$ %3!254#!") ) ,äoääü‘ärVoVþªü‘þªZäätääüŒtVþªüŒþªÿÿºÿÕ$'xºÿÕ$ !%!5!5!5!5!5!5!5!5!5!ºúW7úÉ7úÉ7úÉ7úÉ7úÉü ùàr°r²r°r²r°ºÿÕ$ !%3#3#3#3#3#ºþá°°þܲ²þÞ°°þܲ²þÞ°°ü ùàt8úÈ8úÈ8úÈ8úÈ8ºÿÕ$ #'+/37;?CGKOSW[_cg35#35#35#35#35#35#35#35#35#35#35#35#35#35#35#35#35#35#35#35#35#35#35#35#35#!L²²$°°"²²üš®®®®®®®®®® ²²²²²²²²$°°°°°°°°"²²²²²²²²$­­­­­­­­­­ûˆ®®®®®Ü®þ.²þ,°þ,²þ.®Ü®þ.²þ,°þ,²¸®þ.²þ,°þ,²¸®þ.²þ,°þ,²¸®þ.²þ,°þ,²þ.®þÞ ùàºÿÕ$ !33775353535ºúWââ„ûý!ûûä¾yûB¢üߢþ|¢âü ùàTâüþ}üüß<ûB½ûäü ýüƒââºÿÕ$ !%353555#5#5#57#ºþ¬âýû„ûäû!úÉy¾yûBûüßûþ|ââü ùàrââƒüý!üûä¾ûC¡üà¡þ}¡âºÿÕ$  $(-159=AFKOSW\aejos7'#7'7'#7'7'7'#7'7'7'75#7'7'7'7'7'37'75'7'7'7'37'75'7'37'35'!,2|5y2~~2O~~5’þþ~|~þ2~~2ì~~5’þý~}}þµ}}~þµ~~~‰}1yþý|~|þ³|~|þµ}||þµ|~|þ³}}|ÿz4|2ˆ~12þ´~~~þµ~|~þ¶~~~þ³5“4~»}22þµ~}~þµ4“5~4z2ú‰31|4ýä2~~1O~~4þÿ~|~üÌ1~}1ì~~4þý}}~þµ~}}þ¶~~~ì|1þý|~|þ´}~|þ¶|||þµ|~|þ´|}}þ4|1í~2™1þ´~~~þµ~|~þµ~~~þ´44~~1™1þµ}|~þµ44~~41þÞ ùາ7!ºøüüº²%!!!,üìrøˆüvüüºšÕŽ%!!ÕùåšôºšÕŽ!!!cúÉ©ùå ýðrôºÿ­"!ºóúùäºÿ­"!!!,ýñróˆ8úVùäš!Ž%!!˜ûnŠ‘šôš!Ž !!!büSþïäûnŠ‘ ýðrôÿ!$  ü ùàÿ!$! ±Åýüó ŠÊúÄ ùàþ7 üüüüþ7! ±¢þ¯þüüˆ¦üèüüÿ!$ü üðÿ!$ xÅû;rRffúŠ üðþ7øüþþ7 x¢ý^røÁSSü¯üþ!7üþ!7 xŒûtrÁSSü¯üþÿ!$!üò$ùàÿ!$ %!±bcúüò²û6Êrùàþ!øþüþ %!±QQü³øþ ýZ¦rüÿ!$ùàÿ!$ êÅúWýšÌýšùàþøþüþ ê¢üzøþ­¦þ­þü!þü!  #ŒúWþ­¦þ­þüÿ!$  üòüðüðÿ!$ žuvýŠüó üòýˆxxýˆüðüðÿ!$ >ÕÕþ+ý‹uvýŠüó üò×þ)þ)×ýˆxxýˆüðüðpþÿ‹) )$7632#"'327$%&#"%632#"'‚þ~€~þþ~€~þeM¥¦§¥Mþ³¥§¦¥þ>‡ÃÃÄÇþyÃÄÃÃïJ’JJ’ý¶’JJ6ýÀ``ÀþÀ``ûÿ„âqqâü|âqqþ#îu"@ÔÌ91ÔÌ990 úþþôþ þ üÏüÇ9%ûÛûÓ-pþÿ‹) 327$%&#"%632#"'åM¥¦§¥Mþ³¥§¦¥þ>‡ÃÃÄÇþyÃÄÃÓýÀ``ÀþÀ``ûÿ„âqqâü|âqqrÿ‰' '/7?G%&'&'6767&'&'7%'676727"'64'7&"'62&47\+;.81F9K5Ú8.42d;E9Gœ,:.80G9J6ü&8.;+d1O9FíLšL&_À`Jný¡LšL'`À_ü¸n<1& j(0=Ju &,A=N:0('<1& j(0=Ju &1<>EB0(úÔn_I I'[Ê[Jný¡I I'[Ê[pþÿ‹) %/36%632#"'327&#"6767&'&6p‡ÃÃÄÇþyÃÄÃà AAAA‰««–,+-,,-+öA@@ãªR„âqqâü|âqqÅû¾%ö%m±ýܱ[úÐ0$û %@%¢ü|±"pþÿ‹) )73276'&#"7632#"'327$%&#"%632#"'™r99:9rr9:99í°XWXX°°XXWXþM¥¦§¥Mþ³¥§¦¥þ>‡ÃÃÄÇþyÃÄÃØþøB!!BB!!þo–e33eþje33¯ýÀ``ÀþÀ``ûÿ„âqqâü|âqqpÿ‹ @ ÜÔÌ1ÔÄ04767632#"'&'&pih¶µÒѵ¶hiih¶µÑÒµ¶hiѶµiiiiµ¶ÑѶµiiiiµ¶pÿ‹ $32#"$27$%&#pÑkÒÑkÑÑþ•ÑÒþ•<§¥Mþ³¥§A¢kÒÒþ•þ^þ•ÒÒa`ÀþÀ`pÿ‹ $32#"$"3pÑkÒÑkÑÑþ•ÑÒþ•<¦¥þ³M¥¦A¢kÒÒþ•þ^þ•ÒÒÝ`ÀýÀ`pÿ‹ $32#"$%&#"pÑkÒÑkÑÑþ•ÑÒþ•Õþ³¥§¦¥þ³A¢kÒÒþ•þ^þ•ÒÒ>À``Àþpÿ‹ $32#"$327$pÑkÒÑkÑÑþ•ÑÒþ•\M¥¦§¥MA¢kÒÒþ•þ^þ•ÒÒ>þÀ``Àpÿ‹ $  $"327$!pÑk£kÑÑþ•þ]þ•<¦¥þ³M¥¦§¥MýgA¢kÒÒþ•þ^þ•ÒÒÝ`ÀýÀ``Àpÿ‹ $  $"!pÑk£kÑÑþ•þ]þ•<¦¥þ³˜A¢kÒÒþ•þ^þ•ÒÒÝ`Àþpþÿ})6%63"'p‡ÃÃÃÃR„âqùÖqºþÿÇ)#2ÇþyÃÃÃÃÖü|âq*qºÿìš( 2654&#"!¬ú¬«|~­þ¹àú}¬¬}|««üv<ùĺþ ( $%632#"'327$%&#"!IM¥¦§¥Mþ³¥§¦¥þ>‡ÃÃÄÇþyÃÄÃÃþ_O•þÀ``ÀýÀ``ü|âqqâ„âqqùH(÷غ ( !#%&#")%632ºOþyÃÄÃÃþy¦úÏM¦¥¦¦MûìÂâqqâþ>~Á``Áºþ  3327$3!#"'$º‡ÃÃÄÇú@1þ³¦¦¥¦þ³þþ>âqqâÂûìþ‚Á``Á) %63"‡Ãæ¥þ³Ââqv`Àþ) 2#%&#ÃÇuþ³¥¦)qâþ>À`þÿ 527$3¦¥MuþyÃþÿv`Àþ>âqþÿ "'$33ÃÃþyuM¥¦þÿqâÂþÀ`p‹)%632#%&#"p‡ÃÃÄÇuþ³¥§¦¥þ³Ââqqâþ>À``Àþpþÿ‹03327$3#"'$puM¥¦§¥MuþyÃÄÃÃþyþÀ``Àþ>âqqâÿ!$ü ùàÿ!$ü ùàÿ!$!ü ÿ!$!$ùà3Ñ…! 2654&#"4632"&nŠÈЉce‹;­~|«¬ú¬údŠŠdc‰‰c|««|}¬¬ºÿÕ$!%!!ºüòœýdü ùàr<ºÿÕ$!%!!ºúW›ýeü ùàr<ºÿÕ$!%!ºúW7ü ùàr<ºÿÕ$!%!ºúW7úÉü ùàr<ºÿÕ$ !%!!!!ºý+cýý,býžü ùàr<úÄ<ÿ!$ 462"! W|VV}ýÜÅýüó ,|VV|Vþ ÊúÄ ùàÿ!$! cýüó ŠÊúÄ ùàÿ!$! ±büó ŠÊúÄ ùàpþ„(  7& $  %ñÅâÄâÅþ;âþ<âýºýûþýýüþýûìþûƒƒƒƒú¨*––þÖûXþÖ––ºÿÕ$ !!!!!!,7ýý,rúWbýžŠ<ý)ý) ùàIeºÿÕ$ !!!!%!!,ÔcúÉrúWbýžMý)<úR ùàreºÿÕ$ !!!!%!!,bÕúÉrý+cýŠ×eúR ùàreºÿÕ$ !!!!!!,7ý+ýžrý+cýŠe×úR ùàIepÿ‹  $32#"$!327$%&'pÑkÒÑkÑÑþ•ÑÒþ•‰‰þÌ]ý£4¦¥¦¦Mþ³‰ŠA¢kÒÒþ•þ^þ•ÒÒÚO²þ¬rþ¬²``ÁüÁOý+pÿ‹  $32#"$67$%&#"!pÑkÒÑkÑÑþ•ÑÒþ•uЉMþ³¦¦¥¦þÌÏý14‰‰A¢kÒÒþ•þ^þ•ÒÒ^OÁüÁ``²þ¬rþ¬²Ocpÿ‹  $32#"$!%&#"67$!pÑkÒÑkÑÑþ•ÑÒþ•\M‰‰Ðþ̦¦¥¦„Љ4ý¢A¢kÒÒþ•þ^þ•ÒÒ¼ýÁOÕT²``û%O²Tpÿ‹  $32#"$327$!%&'pÑkÒÑkÑÑþ•ÑÒþ•\M¦¥¦¦4ý0‰‰âþ̉ŠA¢kÒÒþ•þ^þ•ÒÒ¼ýÁ``²TÕOýúT²Oýÿ!$7!!xŒûtr ’úR ÿ!$ %!#ŒúW²ûn’rùàÿ!$!xŒûtrŠ’úü ùàºÿyê¯!!!,Lû´r0Rû<6úʺÿyê¯!º0‡6úʺÿÝ"K%!!!,„ü|rhOŠünû’ºÿÝ"K!ºh#nû’ÿ!$! #ŒúWŠ’úü ùà «€Õ "*2:AI3#''%#&'52#"'&5476!!'5%!!'53'5%3'5%3#'sMM7:ø=üýü=È-0ÐY ¾G.¯b#·CýKSþ­uYþ§G†r=øýµ;ö>MMÕþ¢^›?þ?îþ@Ç7µá`½d§?\µgþíOOOOþè‚y>ý*<þ?vþ¢^hÿû—á"3263#!5276;'4?'4?26õÙu'6‡"gPù39†.4!  '*ÌC0.xáèV#m14He ®'1l1 “Z+ddÈÕ?33 #&'&+"'&#"/573;2?"#'57#&'#"#5676!5‹:¸+#9,–p!—ˆj[%+ > 7ÓVCÅCc":Àï8Õ}þV .e3B=ýSe` e9*¤=9 3@=Úß}ªÿÿ‚k %C`Œ·ã:d»æ;emu}©Óý'S3273&'3327&'67&'67&'67'32654'&'2327654&#"3672 $54767&'&47'&327632#"/#"57#"54?'&5432'&27632#"/#"57#"54?'&5432'&327632#"/#"57#"54?'&5432'&27632#"/#"57#"54?'&5432'&327632#"/#"57#"54?'&5432'&27632#"/"57#"54?'&5432'4327632#"/#"57#"54?'&5432'&27632#"/#"57#"54?'&5432'&27632#"/#"57#"54?'&5432'&27632#"/#"57#"4?'&54327'4327632#"/#"57#"54?'&54327'&27632#"/"57#"54?'&5432&'67&'67&'67'&327632#"/#"57#"54?'&5432'&27632#"/"57#"54?'&5432'&27632#"/"57#"54?'&5432'&27632#"/"57#"54?'&5432'&327632#"/#"57#"54?'&5432üB€~ %<z*+'þë)+(@&'$Ê|÷¯®ø|e‹<-A}]\ŠB-7“„1SLoWŽþäþjþã\vLLý©)(0/ (( .1(%%,* # $ )*f$% +) $ #*+f%%,* $ $ )*ûË  ü»\o÷  [ ®%)#þ·&'%ü&)#`#$ *) $ #+,üU  þQ  0 üE%% +) $ $*+‰&EC&V*,)-)-*,þ%&%&žf“‘ÐБ“fU 3HhfeefhH2Ùpu^èQFs¥£ææ£¥sKQèGýh!99!  !77!  Ñ4 4 22 K44 22 22  11  š  þã     ¨      ¡    7   Ù     úà%&%&â%'%&%'%&22  //  g     û     ‚     ý44 22 ƒ© ->O`q‚“¤µÆ×èù +&'&54?632332?654/&#"2#"/54762#"/54762#"/54762#"/54762#"/54762#"/54762#"/547672#"/54762#"/54762#"/5476%2#"/5476%2#"/5476%2#"/5476D.2`{4&/<) eˆ>þúO ,4H3R 07K÷ $  ¨ $  Š # › #  # ½ $  Š #  $   $  ýU $   # " $   #  7Q=KG<s-8PZy9z €_e""#/2dt0&2j ,: . 4 . = , ý , þü  -  - ú -  -  û  . Ó . ç  , Ê  -  …ÿ÷§É !! …Wº»Vþºþþ¹9ýÇþŸýÈ`þ 8…ÿ÷§É !! 7 ! !…Wº»Vþºþþ¹DŒu€˜þ‘Žþ9ýÇþŸýÈ`þ 8þN þæÂ·þIªëÕ 7%7&5476°9 ý}îV&þ7àýÝA“ Õ6$ ý…ýôæþ8'^4?† ªÙ!2 7%7&547!&'6íI@ýÁçY%þ1çýï4åû¨HFÙS"ýÅþÕþ="l-2ßúüDC[9ª‚Ø &! 4$32 4$ #"&54>2‚þJþÉþËþJÉhº½hÈúqŠ0Š´þ¼þ¬þ¼´^mNMn2Z^Z2ìþÉþKµ7ÂiÁÁþ™Äþèþw‰±B®®þ¾±NmmN1Z00Z}ŸÑ C"32654%"32654&%#"&54767654$ #"&767&54! ±”ggJIhûœIhhIJgg[¶‚¶ZQoyþ±þ þ±y}WZ¶‚€·[zÀADÀégJIggIJggJIhhIJgU\‚··‚\Q s™´ýý´™rW\þü··\޶ø^þ¢ø±}ŸÉ A4&#"26%4&#"326! 547&'&632 $54'&'&632hIJgg”güMgJIhhIJg#þ@þ¼þ¿þ@z[·€‚¶ZW}yOàOyoQZ¶‚¶[s‘IhhIJggJJggJIggþ ÷þ£]÷´[¶¶þþ[Xr—´ûû´˜q Q\¶¶þþ\‹}ÿýâÆ "32654&7#"32†ÉÉŽÉǾ˜þÎÙ×þÎ/Ú`Tš_ÈŽÉÉŽÈ;™þPþÏ1°2ÓY}žÉ1"264&"3264#"54327&5432#"'&'3x©©ð©¨³ò¨¨yx©ü¾&þÿ·µþÿÿ·¹€Üÿ·¸þÿ·µ Ú©ð©©ð©Z©ð©©ðýäTdµþÿµ·€‰IU·þÿ·µþÿ Œ kÕ#5AMYer€š§µÅÙ3#"'%&547654'!#"'4%$53!76=332654&#"#"&54632'#"&54632#"&54632&'&67632#"&'&676'.547>'.76$6&'&54%6&'&6>#"'.54>32#"'.54÷ [$gþi< D"ûœ"D =þif%LñçùWèð‘«ì¥¨êé©§êrƒ^]ƒƒ]^ƒŸ !! !! Ñ.› .þ *)X,)ý¯,*))+þ. } Õ›¤ª™Œ+G  G+Œ™ª¤™þvK˜K9_þâþê_9K˜Kýݧêꧦìì¥]„„]_ƒƒÞ""""ýs!!""W&. - ýì. - a)," Ã"  ))  ì  !)þ” /    ‘ pÕ%-5AMYdp|ˆ”¦Êð5#!4'&'5#2#"&546"264"264"2647>'.7>'.676&'&>&'&7>'.%7>'.676&'&676&'&53!76=3%#"'676%27+%&547654'7327&'$%'#327%654'&547ì1ËÃÄÊ8þú¦å楣çæ¸¸¼. . . . þò - -Y - -ýü))G))ý«))U*)þ>- - ~- - V†áØùÉØá†þ©K;þŠ yA øøC0Bøø Ax þ‰;K'6FJ> ìþÇþ$06þ#þÇë >JF6&Â@Ž@1Añþe›ñA1@Ž@Hç£¤ææ¤£ç­¸€€¸ . .ýµ . .E - -ýÿ- ,1))Õ),(9)(©))þu- ,æ - - Gœ77Wþõþ6Ê W77œGå D&& ¥ËÇe‹‹eÇË¥ &&D "(=ˆ—pp—ˆ=("¸uÕ !!'!¾°úPnàÕú8Èhûø·vÕ "!!'!##+572367676½³úMoà‡L)þ¹>u eÍ¢—I3?b›aÕú8ÈhûøžA:þFþ½;/Iƒ¦t³»x·vÕ !!'!  ##' ½³úMoàû÷›—_þh˜[þeþi[—þiÕú8Èhûø†þi—[þeþf[—þl[š›š §@36273 ##'5ñ) UþÒ.WþÔþÒW1þÏ@þ ÞUþþS÷þ Vùõdõv#,5>~3+&=43+&=4%3+&=43+&=43+&=43+&=43+&=4%33 #&'&+"'&#"/573;2?"#'57#&'#"#5676!5Ö\:V\9\:÷\:]:&]9[\:ý«:¸+#9,–p!—ˆj[%+ > 7ÓVCÅCc":Àï8Ï #8dÏ#7ãÏ$6¹Ï$8;Î$7iÏ$7ëÏ #9špþPL  )Z. ;6ýŸZV Z3%Y63 .87€ÂÆp ˜“Ù 3DMy!674#!!6?676545&#'323276767654#3#&'&'454632767!672!&=75$/563&43!32+'!67#>54&53# û ?ô I :W0 96;E,Q 2:&l6xý0 bˆm! oþÛ¸½®±"\ü>%Eþfþ™~ýñþe2UÖÉ6g!6V#p5Cü+ C þ˜? P9 @´7H4XþÍÇm†M7RV /‚M(=H: ,qLUD)8ˆWqk±’e-Pexúó —NW =$ U  þ/0c›™)H?õ2@[nDF8T$.J?¬Ù !' !žTú4X—ýÍKóGýÏÙþwû´L†þ5ü_¡K¬Ð !'7›ŒWú4Z~Ðþwû¿D€ŸÔS&5476322632%632#"'&'#64'#"'&'&54654&'&54767632xØJX%&XA,B:\8 [ÇEMH95##Fl% !9@!#jLÏ p_’ÎMi#"?8" %lF##58HN4hok@RRr*%tþëe BB9'7*$%) "fXSþÝçò5EIþêf" )%#,7'9CB «˜>E3#"'4332327$'#"$4727%672567654&5&§oJ°7.˜b9M þúƒD† þ²ý™,B3 qY 5*Ä*]d=HN9%‡å ˜sW$,þðJ ® ]T-MMñm@eöd: ,'Z MÞ 'cM&T)$$ <þ¥ „Iµ¬ç2%!"&54676737#&'&54>;7!"&546767!7!"&54>3!6763!26ýP+=6ˆ/2´þÿD>Rý+>2,+v*>ç>+2  ,2 =,2  =,3>,¬ç2463!2!2#!!#!32#3#!¬>*v+,1>+ýR=Dþÿ³20‡6=+ýP#,>3,=  2,= 2,  2+>²Ô{"D%4&#!"!0#"3!!"3!#";#"3&'6737#&'6737!"'67!7!&'63!67!2I0!þŸ6üÙOSÿ þžSS: ÝSS®>SS]]J«]]äþÆ]]hý\\, Bv*>Kñ%39’LKIOKHLKIhghghghgE?-ü³“LÊ!D72654'6#"'4#"'54#"'54#"'675674767#%±$4:JILLHOKHLKIhghgighgD>-ü²sJ1 b6'SSý cRRþÄ ßSS®?SS\\K¬\\ä;\\þ–ý]]üÔ!AþŠ*>K›±Ó{!C%254+'3254+'!254#!'!24+!&#!"463!!2!!#!3#3ÁSS?®SSß *vA!,]]ýj\\þÅä\\¬K\\ñIKLHKOIKL’93%üëN-?Eghghghgi“ÿùLÂ!C32=732=7325732'654&#'%2&'&5&'5&'±IKLHKOHLLIJ:4$üëN->Dghgighgh³SS=®SSÝ þÆSSb ýSS'6a!0J)K>*þŠB üÔ\\üþ˜]]:ä]]«J]]}¯ØO€‹•¤³ºÁÖÜãçëïó÷ûÿ &*.26:> 3656;2#'7+"/#"'+"5&54775%"'5476;25'7&56%635&56;374765'75'76=4'&+ +"'4!#"'4543$365&5&#%#754'&5&&547'5367&547+&'&'735&2?"5%75537'7'3533553535'32767&5%2?&#%55'575775775§1’:e ,$?F?Yø>êF_LA3E¾L¬¯HÑ3,8LYLäþÐlEF'!0<… k#gþšF  ™EeYÄ!! Gà€p&þ­iq.8ZN$ÏË%`BCëf F4ùü"4._?ñeËe3&{E(1þõ-ÖÙ+$Kt8¿ - ‡ þ–$þÖÌGs ¥sM ýùrEF›"ºã2 >_ý£pÌØÁlTErf^5.>=9|5"-l)d ,&>vv]cccWpC-+ d•8 Bpp>W]oØæaþxvuPp82,ŽD¨ ^8, ^B$K»œ+ "1®R[+Òe*ñ;Ð 2 ››W Q—›Pþ‚ I&? gpëo% w ^SA$ Ÿ2 9i-5n02¢þ†Ç¿ Ai&®IY^P]D›%ˆ\??\OWC ,,1 /211/=;7777=321811{908hN%b\Dh,)h?Ì17I21!122223 21¬Ø&2%2#"'&=477654'#"'5473Bq4|ýl anN iü¡¡l‹m b üµ9 bØMOŠbý >YÑaYÆ®58Šl7P ÌP@ ª‚Ø$0<FX + &=6&# 3 6=%&#"';27!5%67%!&'&'2+"'&=476‰rþÃÂÔ þ„þúcR¹¦§þÔë~²ßUêYþ­þÔ¨Ñ082.Ôþà_þWÒ†_þV"+Ò}þIR8D).P9H'Øþ¯Öþ°ý“ƒ®²S„¬]þÙ±ÂþÄâŠZ–¦YàûHYoþ’X(I_ Û þ’‘°;.2lOþÏP%.G6R%&I8dÈØ)Nl>54'67&54&#"&'632.547#"'&'#"'3267654'7327323.#'654'567654&&5476;'&'%&+"#"8DH$$yU ?L[>!Wt…Jþ([Fho*Ám¦.2¤\=w\`|€UP7¸:/E" @7? EPþ¦¢]Eixà Òp·‚F@¶T5û†ym´,±"&e¿B@q¦€²‘(‹A _Ã% #+B7!þêN &".ËOý²S$ªXE/K(Aa]dLP*'FCaYr= CÙ44mo C‚þÿ ¶ “(FKœWYŽüF•¡vb‰ph´'UD˜'R< $ˆ“dÿüöÑ#+?Vmƒ¢­²·¼ÁÉÐÕÚßåíô#327&"#"'7'632&'$54#&73254'&#"'5&567#&''5$'67'654'6'5$'67'654$'67&'654'''5$56732#"'&#"&'$'63&47"7&'7&'7&'7&'54'6546767675477&545?&''5&#" '6%35&'.54>23#67!&#"W  OB7[l#> Ì Fþˆ_Vh "ï "®@.,=6tJþè€4V®¶p1EQJþ“qMiÎ v–h£ýþópHI£®!:¯½JJJþ Í=4m\8B*Ò®?o þv!"ºt,`—s&*_~P1>5='g=>24<+ý-s[,*&sd1PT>3J@='h<42åJ-H#*þõYT_Y)*)X^TYþõ*$D  ?>}>  *0üt"J. ™Œ ‰&b54CUE ''¤!`9 !,(MTE *!… }q~=/+)f[4f !B" <@0&9c?"V+€GoM“K~a„? }b‰9e\ P&0@k"?c*‰G€E‰JŽX ?„e}9‰ \«ÎÂ4 ¥\6 '''' 6\¥ ªNÙ(&'65&'67327&+!65+"3yyys{Åw Êʃ£µ®©³¤cþ¦c¨³©®µÞ±±ŽqXŸþñe¸óó·Xcþ÷6þ µ®®µô6 cªÿýˆÙ ,35'533#3!'#'5!5!5#53!5!5#!!-Ê·«}} ”þcˆ±††þk–v¤G þôGþõ @<<3ff¢X¯ý苜…þ›‚q°X¢üÏ»GccGª›J 326&#!2+73 ### 3(ÑttþŠvÎÔÔÎÑÚÜþg®Ûï¦þÛ·þnܧýØüŸßØÙÞþÍíþBþ(þúþéᵪ²×33#!!#'!'57!5#'5735׫¥¥$þÜ«þÞ"££×›”q˜ü‚~˜q”›ªÿý‚Õ+!#!573#'5!3!'573!#'73!#'5»¶ ;jjýÅ þJªýÄss<ªÕwýÑ¡þIžýÈjj8ž·¡/w²{Ø,32#' 3%+ &5%6323'#57'53œÝÒïþ©Ñ^Vˆœ ŠQ6þ‘¬>ѨA±©B¬ÕØ’6þÊž¹þ’ÖG2k >ÀéªîYþ3É~»||É~ªƒÙObs32732753"'#"'4323$4'5;+"'#"'53275'&'&5?5572%#&'&5%634%476=%ê@.!%,BE,#!-Q²2" $nÞàL/P¥uHED8ˆ32#"&546324&"26%! ! – Å’ÉþbþäþÞþ{±•ÆÊ=&*<<*(;ýE;R::R;åþKþÉþÊþJ¶67µøŽÁÏš˜þ{þɬ²Àž)::)*<<**<<*):<'þÊþL´67·þIÿÿª‚Õ&a'a†a ÿÿªƒÔ&a'a…b ÿÿª‚Õ&a'b…a ÿÿª‚Õ&a'b…b ÿÿª‚Õ&b'a…a ÿÿª‚Õ&b'a…b ÿÿª‚Õ&b'b…a ÿÿª‚Õ&b'b…b ‡ÿê¥á @FLRX^djp3264'&#"&47367'676756273#'#'5&'&'7&'677&'67'%%&'&'%6767%&'ô0/CB^0/AC/ýpkTcR|Â'N(¶‰OfUippqUfOж''NµŠQaQhû!$ Žb€)·dŒþ¯ËL÷Qýk þðK´ÌRþt!% cþ'¸d&„//^„000Ã'N'·|P_PfppoQ`Qy¹'N'°ƒP\ QgppmQ \Pyº,  Mª ÆNþ>&«`‚7" bþK*ŒVô&"¬g{‰ þðM¥ ÂMªÿj­n !-=4632#"&%462#"&! ! ! ! 676 &'& ‚Q;:RR:;QBRtSS:;Qûætu ýôþ‹þŒýò‡¿<=½þCþÃþÄþAì$3¶¶2%s'ŽþlŽ(ý;QQvRS:;QQ;:SSÙuýñþ‹þŒýô tþÄþC½<=Àþ@ý%83µµ38H,'Ž(+ªÿj­n !-=4632#"&%462#"&! ! ! ! 7 767 '&‚Q;:RR:;QBRtSS:;Qûætu ýôþ‹þŒýò‡¿<=½þCþÃþÄþAìs(Ž”Ž's%2¶ýü¶3ý;QQvRS:;QQ;:SSÙuýñþ‹þŒýô tþÄþC½<=Àþ@ýªG+'ŽŽ',H83µµ3ªÿj­n !13264&#"32654&"! ! % 767' '&'‚Q;:RR:;QBQ;:SStRûætu ýôþ‹þŒýòs$3¶¶2%s'ŽþlŽ(ý:SRvQQ;:SS:;QQþ²uýñþ‹þŒýô [83µµ38H,'ŽŽ'+ ª‚Ø "*2:AIX3#''%#&'52#"'&5476!!'5%!!'53'5%3'5%3#'32765'&#"sNN99ø=üûý>È-1×\ ÄH0µe%½FýKSþ­wZþ¦G†r=øý´;÷=NN$‚E| 1† ?’'Øþ¡_œ>ÿ?îþ@Ç7µâ`½d¨@\´hþíPPPPþç‚y?ý+<þ>wþ¡_VG{?,rC‚AšÝƒ×+ +"'5$76%&'547327676=&#~‹jþt³°1/Q}›þ²ˆ]•(Éþ¯+VžéRþ¥£ž×þ‡­ÆþxþÿbO±Ê àP >ÅþþnèS˜ô]] =fªPØ+! &56;2'5$%75#"3¯þuþïiŒ³±1.Pþì~šNˆ]•(þ7P,VŸèSZ¤žy­ÆˆcO±ËþõþpáO >Åí‘èS–õ\^ þÂþüf¯ÿ0:Û1>7#'#53'&'&54767&'&=33676=3#326'&i($…„lØÜÊÊ“m……$(($…Ž[Uu&tU[Ž…$þ÷&uU[·‚·[UV$ƒ½¼|dÑdÊËbÑ e|¼½ƒ$%ƒ¼ ‚ZSSZ‚ ¼ƒ%_TYþüªªYT¯þÿ-Ú #"32654&&5432!!#!5!&î¤ç礡êêýÉ©PïìS©ˆ´þð´þðµ'ä¤£ØØ£¤äüíîïLþ´þ"œ~þø|þÿ| ¯ÿã-¾ #%2654&#"#"767!5!3!!î¤ç礡êê7©þ°ïìþ­©ˆ´þñ´þðµ–ä¤£ØØ£¤äîïþ´LÞœ~|þÿ|þ÷¢ÿã¥à "326&#"!7!á¤ç礡êêû¨ôëþ¬YæäpiþŒîþšp–äþ¸ØØHäüñ¤=ÜU g\Žþuþ¤’ÁèSר5264&#"#43233#!5 zª©{y«–¸»mã——ü«ò««y¹þü¹¨{Åú(|—ÀjØ#53533#632#4654&#"#*jj˜²²o˜²ïŒ—›onš˜—´´—þ}mþþ»Zåy„îH{©ªzþFø2Ø 1"32654'#"&4767!!53#5!!3!!#3!!ÍpOO87O:=0L˜mk™L/>þàþΛ›2 — 1™™þÏþàŒO79NN97Â0LØ™™ØL1ŒþK—Ó˜þJ¶þJ¶˜ý-—µ'Ø<%#5#535&'&'5'73'3#'73'676=35'73'33â—°°¥z–‘˜hNg‘’—‘‘eMj‘˜–z¥¯»»»—‹z–×TŽŒ™™ŒŽT—hOÊ‹šš‹ý7Nj–YŽŒ™™ŒŽYÓ–y‹—ì?Ø! #!!!'!27674'&#ô™.d û;6þªzüý‘F‚H¢%QØÐM_þö\ý­‚ǃþ$‚P¤<]ÎÚ$!#"#&5463 67!2#654&#"Vþâ©"T†]£’tƒ„s“¢]†U"‚¨þâXÅ"€€„¡„»üû1((1»„¡„€"Äüûý¨·uØ." 6&'67>3"#"54767&'&#52•“ÎÎ&ÏÍ•ƒLVa¡¹{§ƒ.+’þÙÓÐþØ”)0«z¹ºHUM\ÏþÚÎÎ&Ï–=B´®lþÈl)•ÒÑþÙ'ÑÒ•*l8l®´B=ÀjÚ&'5 %$ 56?63#'¨ª[øW°¦¦°þ©ýþ¥ª¨˜tuétuéü4”ZZ—/ûâ/˜[[”5  ç@Eo&<"3264,'532'&54632264&" &$#"#"&547>B¾„„_^…þ^þÈþ”™ýl;‚ƒÍ“•ÎhIöý«^……¼†…9l™ýþ–:…ƒÍ“•ÎhIõ¸„¾……¾þ (+|Tl§“ÏÏþÚgML¶„¾„„¾„x)+{Tl¦”ÏÏ”’gMM ØM>54'.#"32463227#"&5454&#"#"&'&54767632254&”K2q'$#K1o'#0ß´¬ÚþÞ†GdAoc¤„–.% 3t88<­/3u77LJMŒq'##K2o'#$L1ð¡Éݰ»þ ´|XHwyoÇᆥ›<‘>b€WDs-Kx68<32>32#&'567'45'#&+"#4'3>$4&+"¨?w(ÆK>R0ƒD32>32gYYËËYËD,.:…?—#)³•˜Žv$·E?w(ÆK>Ro}v­¯vxJvÙÈüašAjâ×ütA¾¿O°]¼Æ€wϧÛÊý„©ÿÿ‚Ø  / ? !5!êý?=lþÃþXj¨þÃj=ÁþØüý?þÃl=þXj¨=jþÃÁ˜ýÀjØ)127632#"'#576&#"4'5267>327&'"SkQmÃy™Ž›z,~Ѝšzi2@:$šž„“¡(.-)zW]‚¡ Ÿ˜Øüžݾg‘«… ×vxþ-ÃýðaÞþíÉX[–ü&‘Ű9{¢'Q32263227632&#""'&#"#"'&#"#'3232762327632&#"#"'&#"#"'&"#'°Es- p¬86rV+)|m^?_354.#"!&'.54>325467675#53533#63232>54.#"P#3Jœ“TRJWVJQS“OMJ4"þ?õü¹*&ElnÆhPL$ llill %LOhÆnlD')ýÖ----Ç+)Q•PQ’((’QP•Q)+ý¸þÑ/þ 6ÄklÅj$?6FWWF6?$jÅlkÄ6 þ}++--âJØHNRh|¥»&'4>32"'4>32&'4>32&54>32&54>32#!5!'!567>54.#"32767>4.#"327732>4.#"327>54.#"732>54.#"M_ 669ï4S55.½+C55C&¹.66 V\+55 c ü£$µþ•·×üÿMç##$ 6ˆ»$#$­s`%#$þšd0"%)h¦ #"#û_33@þ¾]22-"ý40446üÊä/*33UýJ"+33^þ1ýÑ/þßáK=Ó0¤¤T* ####ýø ù #&$$&#ýÑ#&$$&# ý B #### üÚ*ê"$$" UÿþÖÖ!'-2!35!#3!53573#'5#5!35!75!!5'57!«s\\sûs]]s ª—ûîJRüÚRIJý~Ö››¢–ý·•££˜E—¢›úû77êƒ__ƒývt€€t4!ýݶvØ7CQ^&54767&'&'5676767&'&54>32! 535#5##3654."!2>4.#"Ë  <$))+N-N*)N-M,**%:  ü@ ¬¬v¬¬¢<-MTM-?ÞŠþK5:664”59<5&?HPPIK* ')+K**K+)' *KIPPH>&5<:6þu”N|l||l|þ²-I+N))N+@6þ¬:55:5QÛØ)5>o654&547!&54='&'654'67.5476;+"'5#"=6&'76767%25#654&'Fzê-ü6 ŠZ8.ž ,‹N0H!h6¢%`+EH )Ø#M ;,Jga#‡iR þ‚ k'þ Mè +1^hgþ½üo8: (@sŽ.PùÀmz nxþë?.#1þp#41§`&>%!ac,,ÅÀLHJ ­xþì}647| + OJJ)!0ÿÿû× P[32>4.#"32>54.#"!5&54767&'&546767&'&4>32'&'.#"¿:e79e89f76e`[ûÙS ¥’&(*UM,N)(N-KV)&&“¦ \@Eõ€õCAÁpd88dpg66ú»9: %N&KRS—* 'TM**MT' *—SRK&NþÛ :9„}qyƒƒyq}ÉcØ $TdhyŠ67&'&"!3!67>54.#"!&'.54>325467675#53533#63232>54.#"!57!&'.54>3234'67632!P#3Jœ“TRJWVJQS“OMJ4"þ?õü¹*&ElnÆhPL$ llill %LOhÆnlD')ýÖ----¤ýsÎþè=BDw@>=)ñ)==AwDB=þéÇ+)Q•PQ’((’QP•Q)+ý¸þÑ/þ 6ÄklÅj$?6FWWF6?$jÅlkÄ6 þ}++--ü¶ÈÈÎ !yCB{C!$$!C{BCy! âJØHLP&'4>32"'4>32&'4>32&54>32&54>32#!5!5!M_ 669ï4S55.½+C55C&¹.66 V\+55 c ü£$ý)×ý)û_33@þ¾]22-"ý40446üÊä/*33UýJ"+33^þ1ýÑ/ËNNþÖOOUÿþÖÖ%)5!5!!35!#3!53573#'5#5!35!Öý€Êüìü«s\\sûs]]s ª—ûî„^^ü/oo#››¢–ý·•££˜E—¢›úû77¶vØ4@4767&'&'5676767&'&54>32!&535#5##3¬  <$))+N-N*)N-M,**%:  ü@%¬¬v¬¬<5&?HPPIK* ')+K**K+)' *KIPPH>&5<:6þn”5|l||l|LàØ3?HN654&5473#!&5454'+#"#7&'654'67654&547;2547#";65'"3%:U"-ü6 •Bu Zg0krX0c-h8ªE+`%s H>É4wM-æ'9.QY / þ¬üo8: q§’hPSå¾mh #%Bzÿ1"0@þ)5"@YþóýR0ÿÿû×.&54767&'&546767&'&4>32; ¥’&(*UM,N)(N-KV)&&“¦ 9: %N&KRS—* 'TM**MT' *—SRK&NþÛ :9CèÔ##"'##56'##"/547?˜^Øí'¢5@š_*S×U&/U»L »;YÔ§þìþê9UP(§`Ý þå–—X…ÑI.·Ë‚¥¹sÑ222732#&547636=4'&# #4'&#"*Út pëÑz&Ýþ=<ý xÇQåÐÛ>h½G:þøV He½®k%ÑþíPF5ÓNP þþçýÙBí²¶Ò|-þÛäý¼»¡—&¬pþA&NÑà±FXÒÔ &&5 –<ýãþF:þþ^Ôýý;" €V –ýgýdœäGÔ7236;2"##'65##"'&5476;235&'&=476—Öe x<JTî`Ñ(GòeRÐUdõ¿föB3 VNT<×GÔã48u <ÊB<Íh  þ©m€MþëÉD:éS GEnQÉhBêÕ"<B+"'##56#+"'&575477;2732;276=4'3&'"—~Vµ"0‘b*S×V*8Ui QÎ"_|þ®Q ”)w`·Sg‰A ËæŽ? Õáþ6‹†ÑNÚ þè›—#eu®B? ÈÔgIÇþo‚…»5 ÚF”§(°ÏûpZR¶wÔ2367632#&5476(Ët*#\l‡Ñ~ ÐýïýΨÇTÔë]1¢klàSIúãý…±ÍÚÓ|-XÒÔ &47–÷EýÄ ýÎoÔýsU ýÝŠäHÜ2`g26;2"##'65##"'&5476;2&'5476&+"326733276=4/#"567654'&#"35&5›Ëhr=)ø\Ò"IñfRÑUdöÀg÷C3&=cØGð© kv ó=ˆ=NÒr%SZž¨U ý6vk »6)¸S<ÜÎF9„¦×8:Ód  þ§m€OþèËE:ëR p±&Ëiþ³›Ì  ÔC”]&'Ax†…¾.+Þ0 ‰nM,¶WÈûÎ`cØÿþTÔ!1M3#&'&'0546%3#&'&'45463#&'&'546 $&54673 $64'&'v ‘Ì £0¥A ’Í ¢1¦Y ’Í £1¦,¨¾¹þ±þ”þ±¹½¨ƒKV§.J/¦VLƒ9?›c‚yɦt3Zrˆí`í—Å»þÎû²N‹ ±Ñ[OÄ}¡šýБBr‘­þ1±a`°bb°`a±1)EM¨˜UU˜¨ME)¬ÿö·Õ3#"/4?23hHÄ0#ÔÓ!cZÕúý£-…‚@Ô¬ÿöoÕ3#'654'&'#"54732XW­ðz=ä\à9òÔ`YÕ'6?FŠ’` 1TFG*ûÖ™-¨ƒ@Öxÿ/³Õ#"=4?2%#"=4?2ý³À6Õ±'VQýÜ–Cت+YPÕÊúí›*¤~: ©ûÛ‰8›z"CÓ¼ÿöoÕ"'4723!# 5472!5kþûéémOü¥òþþìdXX[ÕûÕ¤Š;•ýZÏ$±}@áÏœœµÿú"Ù 3363'$654'"»-ª‘ãý³8¢•wÙü?íþÿþWXÖûÔþc1 ”¬0Ù 3%#'#3%#±)N(þ¯4Ùþ/¡ûcå Šý™þ}­4Ù(,377#'#'547#5773%%‡.wwzy.þà** þà ÙþÐ<<þ‹7‡Cþ׌þ¦A<Ž<{8‹Aþú†Mý–þ‡‹t¬PÙH#0#"#"'5654'5673;54'56732733273+&+#&"#&'565¶¨³P8 cc 9Sµ§ƒ:-Œ-:ƒ£µS8!cc 7P³¤ƒ:-Œ-:ƒZ#;17F-:ƒ¯µS8!cc!8Sµ¯ƒ:-F71;#ZþRµS9 cc 9Sµ„œÙ ;G7567&'&'3#6737'#&'7#&'6735'67#3335#5;0/_í^//þ†,/,-D--C-,.-äÐ zz Ðä~jihh~äÐ zz Ðä~hihj~ntt6tt´-.,-C..C.,.-n//_üR_//÷~ijhh~þNÐ yy в~hiii~ÖÑ zz ÑsŸ.þ€€.Ÿ ¬¬#.6CMhwŒ—¦¯!2732!'5675'&=32#$'57637&/&+"+&532?4/%32#'#&&=4?#'57335'3!273+#='!"/547354;2?!&=!(‹:Mb­þ¤R».qp7°þÓž,ÊÊ_qýð >MT,›•P$’ ´6œ…6$0_äý u3d´­Ud€tœÈ_}s*$Ä"ìRþÖt0XX__ç/iþký¸=Z¬G†8þÔ*F €1 þƬ.þ­ Å þÑŠfþõþï)MC =þêg9E¢k×O 9þË!(-ƒ);& Æ þ]¬þÔt!þ±y" ³þ¥†& 2| ¬ªb³a$ U+œ Ù #8M35733!&54?'7'327!!"'&%#'7367654'77'7'&#"'676Õ«ºÊ«þýó,&T>ë=c#]–þK9.‹U¯§ÒÒÆ:1ʈó%üæ©`T?ê7>54&#"5>32&54?'7'327!!"'&%#'7367654'77'7'&#"'676]Týñ@Í1$Jë=c#]–þK9.‹U¯§ÒÒÆ:1ʈó%üæ©`T?ê32&54?'7'327!!"'&%#'7367654'77'7'&#"'676Z _­3lFHe5^\VOosHGJI)`VKm1šSüj,&T>ë=c#]–þK9.‹U¯§ÒÒÆ:1ʈó%üæ©`T?êë=c#]–þK9.‹U¯§ÒÒÆ:1ʈó%üæ©`T?êë=c#]–þK9.‹U¯§ÒÒÆ:1ʈó%üæ©`T?êë=c#]–þK9.‹U¯§ÒÒÆ:1ʈó%üæ©`T?êë=c#]–þK9.‹U¯§ÒÒÆ:1ʈó%üæ©`T?êë=c#]–þK9.‹U¯§ÒÒÆ:1ʈó%üæ©`T?ê32#"&–¼eËÅþ›þ|þ›ÅÉeþ(®<X<®³þħ¨þñ“"32#"&$2#".46–¼eËÅþ›þ|þ›ÅÉeþ(®<X<®³þħ¨þñ“"@<#"4.#"–¼eËÅþ›þ|þ›ÅÉe:<#"< !<"#;ÙÁþ˜þzþÆÆc†hÁü– =B4.#"$32>4."–¼eËÅþ›þ|þ›ÅÉe:<#"< !<"#;ü¥"< !<"#<@;ÙÁþ˜þzþÆÆc†hÁü– =B54.#"##"'5##"$'&'0!5!5&'.4>32!!676767'%''H&(G()G'%H(ã%'©þËV W3WI„muþ‰w>DE}AB|GE=mþ“d^„JW4W V›sÖ'H''H'(H''Húò`XAK|@X1(Ô3"|ˆ}DD}ˆ|" 2ý/ "1X@|þµAX1# Ö/ 673&/'67 &'"&'6?&'3 ' âK[]œ><+Gg['fBôòBe&\hœ?(K?œ]\Kýã ˆŠ!½þÐ;32T $ù #µ¤ACÅþâ«,þí¶ÅMMMþv ÕA5p_9D-ïþ–þãM**¤  û”B@0"@R//>wA·&oc/D&3.YaQ/5"1'"þ´þuŠE62/uŠ= =!m- .... yÿì²Û 7%  %  32+#".=!"&'&'#&=4;7337_þìþì‹ý%þíþìŠ Ö8)Â0/­_^«^ýM^¬¼­1/Ì 9×53üü4í<üÄ&&<üÄ&Ñ*(üÇD>?GGzB6üÊC{GG?>D9/››Cþ½›}®Û&632#"&'.#"'#!#!#Ò¸ž62ÉK#+~KF0R!9'/N£Çxåí_TþâŠþãV_‡T '¦NQ9;:#8³HL"CþßD™ý|ý¦×þ)×þ)Z)Û 532>4.#";267#&=&$32735&'.4>2æ2[02[24Z1/[»–á­þ)'5*+þXÇë A323#67#&"#"/&'&547&#""'6%676V ón*[‘n%'ZxL0<{2;&b;0&8a>!U*~EmL‘K}`? {aˆ7c[ O&0>j!>a)†E~CˆK‘W‹ ={d{7ˆ [+M57LL75M-Z '*''*' Y (€5[£ J5( üÖ\d (5J £[4Œ ''Ó/7O_Ÿ«³»ËÓÛãï2#".54>&'32367&%2327654'&''67&'&'&'676765467654'&#"7>326323#"'##"'&'#"&'&54767&'&54767232&'&#"6&%6767&'&'&#"676&5467&'&6732767&–$$$$áOG3%V c˜â™c V%4GL944m/122102/.303112.OF}6&V eý´"w?>v"¤pt #8ˆŠ7! vn¤":;@A<:"¢nx !6Šˆ6# sp%./13/.UVT\<>"$!!þ• !"#">k•c V &6|FO 93399 <>#"#Ö><  "$ZTU./43..V5$##$Ù59gT;&'9Z^^Z9'':Tg9§'(''&()I8:9889: Z_59eU;'( ³ÀÀ³:8.>euvc>-7:°bccb°;7-?cwud?/8K¢WZZW¢ **D@@D+8(':Te95^&)(&''(ÖDA:AD.*!žY[[Yž!&Ö !-x†”67&'67&'4&6%67.'%4'6&#"&'6767&54?67&'&#"#&'#&'5&'"'67&'&47632>4.#"%2#".4>Î'7,3 3%/0þÜ),7ß=*#þ×0*+3.22'þ÷8  Yf·©T,1'¥¤').U¨¸fY >98 "2 B2;F_ XB?2C 3" 894i¼hg¼ik¾ce½"SŸ[XŸVWŸXZŸ„£§#eªjpÍMcNTvJKrZ1VlLWMI ©p jª…k%§nA V{ww[1‡ôô‡1[ ww{V @#fÜd-#JM 7B/"‰‰"0C7 NK",dÜf#ˆÎ½hh½Î¿ggQU ®XX® UíSèž !!Y,ûq@·ûI@,ûqžþȤ7þTªþU7¤þÈíSèž '!57|,ûq,ûûIw,ûq,ž¥þɤþ窪ý«¥8¤dÈÔ %3!'#!52#"62#".54>Ÿ"ù­ ýh9ý|M463%&$$Ôú5 ª›ûO ÂDý›n;ý $$$$ªôØ33'554#$/ÑýŽ[ƒüQ‡wþ“ØýâGSGýUW GJG¯þÿZÚ*1=C&32632!!#!#!5!&"327&7&!&7326&#"6'X©Pï™}}›ìR¨ˆ´þð´þ†´þðµ¤çç¤?9Š‹9×XezfH9? êê A:Œþ×uutÝLFFþ´þ"œ~þø|þÿþÿ| ‘äþ¹Ø•®ü”- þø ¥ØGäþP8lGrrþ¹¢þ[0à $,8>& 67& '&'&'&!7!!! 6'&265"÷uþ»çt.77Ì…þµþ!ªu$†lªYËoiþŒî‹þšp•þš@qDiþí÷þÐÞ4tEêu.ý¡ê¤ã$räþ¸l,Î36ýèþ½Ÿl’%ežÜUg\Žþxþuþ¤’vþ¤Sc?\þ7Ìþ× =1lØHr-þÉØ¤à¯þƒßÙ-9E6'#"'!!#!5!&'&326!7!%"327&7&326&#"’suuWþ³óš~Wdþð´þ𵇩Pï—|€šåojþŒŒîŽþšpû“¤çç¤?9‰‹:v8?¢êê¢A:Èþ¸llGrþëçþ¼E, þø|þÿ| ~ÝLDJg\Žþuþ¤’Æäþ¹Ø•¬Ÿý ØHäþO¯þÿ²U(&  6&32!7!!!#!5!&yêþ»ççEêüß©PïÀ•hþŒîþšp©ˆ´þð´þðµCääþ¹ØØèÝLn[Žþuþ¤’Âïœ~þø|þÿ|  ÿãÐô+D#"'&'&'&47>76327'7'%'27>764'&'."(F3"D"&%#}bV`ZZ^;D"&&$ƒ[X]:3Gþ9þ†á:ÎÀ‹]†þ:ýF=~=HS]³^X‚&% «iŠiD^‹¿þ29áþ½i‹üü\=<€<92-1X?:„<91*Ïþ£î=X62'%'!!#5!5!5&'&'.546767''7'''7"2767>54&'&'&î4p6³â9ÎÀŒ]³.(EGGE@Z-<þí–þí81VDEGFF'1þ9þT]ŒÀÎ9âTþ:þŠG5>+.11./:9Š5>+.11./:9‡ ž\Š¿þ2:âþa(E«b_«E@( ¸–ðð–¸ %CE«_b©G(HiŠjËâ:οŠ\ËiŠjÓ+.wBAw./+.wABw./€ÿã4ô+F!!#"'&'.546767675!5!' 2767>54&'&'&"¥þí<-Z@EGGEDVRbfNZ@EGGEDV18þí¬kbbjøC9:/.11.+>5Š9:/.11.+>5Õþç–‘ (@E«_b«EC%##(@E«b_«EC% ‘–­kaþŸjûP/.wBAw.+/.wABw.+ ¡Ä+F####"&'&'&54767>32333'7 '%32676764'&'.#"‚Ü–U (@E«_b«EC%##(@E«b_«EC% U–Ü­kaþŸjûÉ/.wBAw.+/.wABw.+Ÿþí<-Z@EGGEDVRbfNZ@EGGEDV18þí¬kþžþžjøC9:/.11.+>5Š9:/.11.+>55Å @  ÜìÔìÄ1ÔìÔì0432#"732654&#"ÄÄþéÄÄþ陽……½½……½ëÄþêÄÅþêÂ…½½…†½½5Å @  ÜÔÌ1ÔÄ0432#"ÄÄþéÄÄþéëÄþêÄÅþêúºK +@kk k kÜìÔK°TX¹ÿÀ8YìÄ1ÔìÔì04632#"&732654&#"úÏ‘‘ÏÏ‘‘ϘuSSuuSSuì’ÍÍ’‘ÎÎSuuSSvvdPK!)7eK° RX@ *.,&"($ k3,k($kk8ÔìÔìÔìÔì991@&"6k0k 8Ô<ì2Ô<ì299990Y4632632#"'#"&7323&547&#"%6547232654&#"dÏ‘RDDR‘ÏÏ‘RDDR‘ϘuS?>Su^222Z>?SuuSì’Í Í’‘Î!!ÎSuXqpWv28ML88LM{WpqXuSSvTZ`z8Rm3#"2767>54&'&/2"'&'.5467676"2767>54&'&/2"'&'.5467676––R#)$#R#$ $LK:C.25521@=“:C.25521@=ýR#)$#R#$ $LK:C.25521@=“:C.25521@=züàZF)(JG()K¥.2IF21.2FI21–F)(JG()K¥.2IF21.2FI21 ªJ7Qk>767632"'&'.'!"'&'.546767632$"2767>54&'&'$"2767>54&'&'÷#61@=HK:C.25521@=“:C.5%þÅ'21@=“:C.25521@=HK:C.6#¹R#$$#R#$$û÷R#)$#R#$ $5[51.2IF21.4`]21.2FI21.5[F)(GG()FF)(JG()KÒæR 5%%%xüÌÜÜþŽrÊü6þŽ׊eMºM^‚xþ„x‚±V–)7654'&'575#!&54767'5!s_vR$N:È:N$Rv_£þì¤{aT,X@X,Ta{´ß4b\)1¢%==%¢1)\b4ß´»:ê`¾\KDúúDK\¾`ê¯þÿ-Ú&  6& #&yêþ»ççEêüß©PÛS©ˆ´´µCääþ¹ØØèÝLþ´þ"œ~ý{†Yþÿ,Ú!#!5!326& '6 !Iµþð(4¡èèþ»~u¨ÛP§‰³þÿ|²ØGäjt¦þ´þ š~þø|°þÿ,Ú 23"#"#"#5237 °>>þ!‡ˆˆ‡[ZˆˆˆˆVLþ´þ´Ÿ;ýÅýéþô|þÿ| ¨oJþ¶°þÿ,Ú737!!'!!#!5!'!5!{ý³ü{þä‰þ~zýþð´þðýzþ~‰ùzýdþüzþä|þë{ýý®|þÿ|Rý{|xÿT% ! !5! #!7!# #TþÓþ?þ?þÓ¢LLñ¬þwÖÖŽþ´þ´ŽJ|þA¿|þ¶JÛý¦ZýtÕÕ|þ¶JŽÿ,¯$264&"&7673% %&u¦uu¦>ÏhH]¬%Vþ™gVþÛYFhÏݦuu¦výÙÎ#gGÎþέ”ÑÒ”®þÒEgþÝÎDþÿXÚ!#!5!&'&5%676'!H´þðœfN)]®H;ËbtúWUJnþÿ|3L˜u¡.¹:;…ÄþÍ¢8%ÿ|V^m3 76= '&  7654'7! '.54676! º«ÎNΫ.8ðýlí?ý²Î««ÎNΫ«,spppæþÂþÇèspppæ>9“`VhhV`’"xx  hVc`VhhV`cVY9ˆQþ¢Nˆ9ss9ˆN^Qˆ9sV^Ë -E  7654' 76= '& 76= '&! '.54676! ý²Î««ÎNΫ«ûk«ÎNΫ.8ðýlí?*«ÎNΫ.8ðýlí?—spppæþÂþÇèspppæ>9ghVc`VhhV`cVþ|“`VhhV`’"xx þÁ“`VhhV`’"xx Z9ˆQþ¢þ¢Nˆ9ss9ˆN^^Qˆ9sV^m !1?U! '&'!  '&'&76767 76= '&  7654'7! '.54676! x8¸þñþï¶;ì41ýÀ ¶::¸ýà¶; 9Ù«ÎNΫ.8ðýlí?ý²Î««ÎNΫ«,spppæþÂþÇèspppæ>9d]]c£]]] þÕ“`VhhV`’"xx  hVc`VhhV`cVY9ˆQþ¢Nˆ9ss9ˆN^Qˆ9sV^Ë!-;K[s  '&'&76767! '&'! ! '&'!   7654' 76= '& 76= '&! '.54676! K ¶::¸ýà¶; 9å8¸þñþï¶;ì41í8¸þñþï¶;ì41 ý²Î««ÎNΫ«ûk«ÎNΫ.8ðýlí?*«ÎNΫ.8ðýlí?—spppæþÂþÇèspppæ>9]]] þ]]cü]]cehVc`VhhV`cVþ|“`VhhV`’"xx þÁ“`VhhV`’"xx Z9ˆQþ¢þ¢Nˆ9ss9ˆN^^Qˆ9s¯ÿã-¾ ,"&54632#"767' 2654&#"î@a^CF[^µ‡©þ°ïìþ­©ˆ´þùccþ÷Z¤ç礡êê}[D>XUAB]»~îïþ´LÞœ~gþúÇ]þ£Çú÷ä¤£ØØ£¤ä…lPj…'#"'&#"'&'&'&47>7632327>76&'&'&/&'&'&47>762!2!%327>764'&'.#"&#"327>764'&'&ÍÖs®* 0$+$$$ 1#*# ZaZ%% NT12 4 #HH  ")mR‹èOeýbÕü  , 0  +  …Í ) . $J . %'.D"&B 1 $C mR )KÏy   µ !   V!Eµdz267>54&'."#"'%"'&'.5467676;27>4.'&+"'&'.54676762%632$"267>54&'&ý.&&.&m,mQÛþ‘j–P(!N!"(! aVf&&bZ55!("!N!(P–joÛQm,úæ.&&.&q    lü?W’,>&#< A#"< " (( " <"#A <#&>,’W?~    ÀlOOj…3!#!"'.'&47676?6767>'.'&#"#"'.'&47>763276;%32676764'.'&#"676764'.'&#"32ÍÖÕžeOèþuRd2!  HH# 7   ZTN +Za21#+$0 4$$$+$0 '±sý¹  *   * OÏK) Rd#!>& 3"9*$"D. ' - D! 2 . , T% #ý: & (  Iô˜èZx–´Òþ-4H67&'&'&+"'&'&'&476767632%632 #"'%#"'&'&'&54767676;276276767654'&'&'&"276767654'&'&'&""'&'&'&547676762"'&'&'&547676762'&'&'&547654'&'&'&";276-&#"+"276767654'&5476%327%&"'&'&476762I  Q\C--%("(/*0.,+"( /ŽX]â\ˆ9þþ<…\âþ£XŽ/"$)0*3')"* %1*0CR[þë        22 2 2 2 †%•'   &J  &%C\d#½í_*]OÙþ‘”hXC%&  J&   “ÙO]*ýÝÙ    Ù   ")&`&"'$"/' <%‹ZS  ÏÏ % SZ‹%< /'* "%5"-($# þÒ;ý‚8\= !  !  " þòÂ÷/V’C "  !  !  [uV/á+    Vÿã^ðau‡ 767>54&'&'&#"&54767632 '.5467&54732#"#"676767#"'&#"'67654 ozwbda_f_zxІ|wbdaM,krnulŒœšŽ†spsnun‹þÇŠ*D$ lµ©Q$" 6*D?"5'K(2- # ž>   :72 331cdíˆèi`4331cd퇼>˜mœwn<;;8roþ졘þðwp:;;BV0/MÍï8:D@*|sa  -F(7 "*=8&0!2  1-5$& 6:B4Vÿã^ð (B\w.'%&'&"632%6767>54$2"'&'.546767" 767>54&'&'&'2 '&'&547676©?'*&$ 1ó$-+h+-$F3782ˆ**?þ’1 $&þç>>9†|wbdabc`òzwbda_f_zxŠšŽ†spsnun‹þËŽ†spsnulŒwI_ý"2[$  £""ƒ þ ýgIƒ $[2!v 55 55 31cdí…ñcaf31cdíˆèi`43d;8roþ졘þðwp:;;8roœwn<;x,Aª-57'36%33#3#!2#!3#3##$'#7”$@d’’5«{s”Vdš]˜F0 0Fþø˜]šdV”s{«5þâ’’d@×(ÚÉ j–P‚PÆ,ÆP‚P–` ÉÚ„Ü0ù ")- !676762!"'&'&'&54!ö¸ûX¸$#R#+/®þRþŸþF¨þF$#R#$1þS­ýò¬h,þÔ  ªþÞþÝkþÓ-ª"ýs!ýßûã³|ïPÐãó476?6763&'&'&547632676767654'&547632!54'&'&54'&&#"'&/&'&'&#"#"'&'&/&'&#"&'&'&?6'&'#"'&'&#"!'476='654'&545454'327654'&'&327654'&/³%4-)"$0JK&  )7   ýß %0‡'# #6 +-L _ˆ_^/s4* 1( .266 |/(1   \«   ýþ#:7  l€S&   xë71]/~[#<$  o»_%@,†: $";vRþÔ $X$+|‰‰¶!5DX&PY;¶9Do6 b'n•2  83þeF] 4T&  &  /50$?- 1@& 3l K  C"P1Ö Ÿ·:03<D:5XI.)D&þ[+-1:   q/A8   g+©jl9Lp{‰7654'"'&#"+"'&54?67676763276323273#5%6767'&#"6"/67#"27632327654'73654'676547&Øp/l0&–J!cS%YþøE]{@C"$4>™-;% ¾Ì,(6áY>ømü¼!N$Xì6"/,(«4òsS?X$U>"sJ?K(`./4‰+2K2.ž0>ü°S ¢Zp0+þ 1^ð' þÇ;cs  /è^"|Y/ 4«28Û‡ƒ´Ï•l%é%oté5oA='Y$ a…£T* ''G+- %_kj~r}jL`І|ï\gÃK@/.85–c($¶šË¯ (2LS>54/##326?%%3254'654'3>7632#"&547>32'% ;66Ií ü€™ ’™ ƒ }¸ýgý„½ ?ý¤6ýûqýn   -> 9@ îH67; ù˜’ ˜’zýƒýh¸| ýó8 >ü¶6!qýúê    ôýÂB5–Ž>%+?F4&'&/76765'7! !'!654'!4'!!$467>2"&'&!654'£ Ò33Ò û¦^^^¯¯RXý¨ü®¯I´#ýJ2ýVªülÅPú#Þ ~!88!~ KØppØphÈþ¬þ¬È,þÄp <(##(#id¶šË¯ (2LS.#"227654&'''%'654+.#"65.'&54632#"'.6#"%  íI66; üo’ ™’ ¨Æ|™¸ýƒ>?%6!ýûqý   9 ý ;76Hî ý ’˜ ’ÕÆ |¸ýhýƒì> 8ˆ6ýúqým    BýÂX{[%G'23 %%.'&"27>7%$!"#232%"'&'.4676762%#"#Š2%ký¿      Aý•ýéþÛ™±·þœ>>dþIýñ±ID`nþíS   SþínGŠYn¹ 5>5 ¹nŠ­)(%$#"#64'232%%&'&'&"27676è&ý•ýìø22økýÚ**Å!þín`à`nþí!##3ÆW 2327632#"'&'&5476Å'( ï>‡ !þ~þ¶GH ".4F+Ž@xÂH )þ0ýü$Š™'*'í²Å 23277632#"'&'&54763Å'( ïe` ý}{*˜279HF`0@x¯JýÞL ²†1 ,”±A  ' 7 çÉŽþ8þ7ŽÉþ7ŽÉÉŽêþ7Éþ7ÉÉþ8ɯ?– ‘tþÉþŒþŒþÉtþŒ7tt7êþŒþÉtþŒ7tt7þŒuþÉñÿîœÜB2632#"'&'#"'&54767'&54763267632676ø ÐÄQ   x€¬Þ L$3 Ìäz(   6XŽÌÜ3âþñÆï  šÐàþŠ6*=P*> "#  ¨˜¸ÌüêR26#"'#"'&'+"'&'#"'&547&'&54767&&5476326763276T ñë””% $$YyæX$ ‚Äzc0 + j–çù ê:  (ÛþÇÌ¢1#: _¿þû‡$ #- °Ô½ =1 '2ĺÚ pDÕ #!!!!!%!!!!!!!!#!5!36þHþVª¸ªþ¦¾þBý¨þB¾XȾþBÈþB¾ÈÆ«þUþHþVª¸Pý¨þB¾X¿ýyÈþB¾È¿pDÕ !!!!!!""ýÞþpýÞ"²þpýÞ"#pDÕ35#7!!#!5!3ãîîïrýŽðýŽrðsîðýŽrðspDÕ!!%!!!!!!“Žþr"ýÞþpýÞ"#ŽþpýÞ"#RbÕ !!#!5!3ÒþpðþpðEðü«Uð lÕ3!!'#'!!#!!3!5@––þÔþŽ–––,r–ÈÜþÔ,Ü,©–þŽý_– –r,–ú,þÔÜý_¡Ü>vÕ #!!!!!'!!!!!!!!#!5!3þ˜þèhÈþèýøþè þèÈþèÈmþèþ„ý_¡|Pýäý_¡þHÜý_¡ÜpDÕK#";54&'&'&#'!326767657'&'&'.+3!76767>5{d³IB,$2$*DE³h{LGC_RQ|66R_CIJ{h³ED*$2$,BF¶d{LGC_RQû„66R_CIJ KIB`OT|87O\FGKzd¶GB+%2%+BI´dzKGF\OTû„87O`BHL{d¶GB+%2%+BI´d»ÿåùó  #!! !!! 373#'7#Zà¿ààþAààþAàà¿:¦¦L¦¦¦lØ­mllmÙþzØlþçmllmÙóþ|þ}þ}þ|„ƒƒdþáþà »d»»þ}¼c¼¼¼„»Tÿã`ðC54'&54762327632#"'&+"'&5476=#"#"'&476323(L,68x86,L ºzFvd0000dvFzº L,68x86,L ºzFvd0000dvFzº ºzFvd0000dvFzº L,68x86,L »yFvd0110dvFy» L,68x86,LVÿç^ðƒ&'##"&'&'&4767>32367675&'&'.5467676236767>32#"&'&'&'#"'&'.546767675& Ô  R.-R  R-.R " Ô *!""! ((\(( !""!#%  Ô " R.-R  R-.R  Ô  %#!""! ((\(( !""!*“*!""! ((\(( !""!#%  Õ  R.-R  R-.R " Õ  %#!""! ((\(( !""!* Ô " R.-R  R-.R  Ô Sÿãaðƒ4&'&'&'.546767622676767>32#"&'&'&'.#"'&'.54676767>5"#"&'&'&4767>32(,$ ((*& :.r06$&**& )'De!  'd8:b&$$&b:8d'  )a@/!  ')*&$6/r/6$&*)'  ')?c'  &d8:b&!$&b:=_& (bCc"  &d8:b& $&b:=_& (a?/!  ')*&$6/r/6$&*)'  ')De!  'd8:b&$$&b:8d'  )a@)' ((*& :.r06$&**& ((Tÿå`ò0267632#"'&'&'!&'&'&54676763267632#"'&'#"'&'&'&5476767!6767632#"'&'"'&'&'&54767#"'&'&'&5476767632!#"'&'&'&54767#"'&'&'&476767632&'&5476767632!#"'.'&5476767632&'&54767676Z   ( &        þÛ    <   4 þÛ         % (   ò   (  þÛ 2     6  þÚ         %    <    %  (   Wÿã_õ2767653"4'&'&W›†spsnulŒœœŒlunsps†ì;8ro¡þðwn<;;¬¢þ²þj¢¬þ>-¬¢›œý'†þO^†__†^þOqþ¸ýï4óþÙ4H4þ"hþdÿþdÿÿœÿ„0Õ!% %!-º@– þj– þjþÀþj •þk Õþ*ëþëêëþëëþ*Öëëê˜Õ37'73 #'ãxxîxxþ™þ.xÒðÒxþ.Òxþ.ðþ.x¹ÎÐÐÎÎ ÐþòýåÐþóþòÐ ýæþóÐpDÕ #'!5!73!Ô¹GþFdþFGºýrþEGºdºGþEr¸þFG»ýŽqþFGºd»GþFqýºGþEd@ÿãLð     - FOÔþFýºcþ,OOþ,cýºFþÔðý¹dþ,POþ,dý¹GþœÔOPÔþœ Tÿã`ð '%%%%%% % -õþÝwDþÛþáš{þáwwþe#wý¼%þf{wwŸ„¤‡þy¤þ|ŸŸþ|¤þy‡¤„…{þàxxþe#wý¼%þf{wwœþÝxEþÛþàþy¤þ| Ÿþ|¤þy‡¤„Ÿ „¤»ÿãùð % %  Zp/þA¿ýÑppýÑ¿þA/ðý¼Áþ}þ}Áý»EÁƒƒÁTÿã`ð     - Zq²þïôþ þNqqþNþ ôþï²ðþ þNrqþNþ õþî²qr²þîTÿã`ð% % -Zªy‰lþ”‰þ‡ªªþ‡‰þ”l‰yðþ”‰þ‡«ªþ‡‰þ”l‰yª«y‰Tÿã`ð%% %% -ZtGcïVþªïþGþñttþñGþïþªVïcGðþ©ïþGþñstþñGþïþ©WïcGtsGcïpDÕ/3%!!%#'''%!5!%777xªoª:UþÅœ.þc¾þF™.þd;UþÇ©oªxªoªþÆU:þe.šþE¾þc.™þÈU9©o¾þE™.þf:UþÅ«o«xªo¬þÄU9þg.˜þF¼þf.›þÅU:ªoªx«o©9UþÇ™.§ÿã ð›54'&5476276767632+"#"32;2#"'&'&/"'&5476=&'&'#"'&'&547676;232?&547'&#"+"'&'&54767632676'K,68x86,L qA'C<4GW>L ƒd  f‚ L>WG4L „d  dƒ L>WG454&'&/54'&5476276767632+"#"32;2#"'&'&/"'&5476=&'&'#"'&'&547676;232?&547'&#"+"'&'&54767632676o**YK,68x86,L qA'C<4GW>L ƒd  f‚ L>WG4L „d  dƒ L>WG42#'"372"'&'&/"'&476="'&547>µŸQ!//V–Z¢ *nN™+G80j@6R¨R6@j0/P1“N± ¢TžP#00V–Z¢ ,lO@W+G80j@6R¬N6@j03L/•N² ¡Ä ]H,`,H Yc¢!77™\Ê4OO4ÐVA7§gU3š',H^ ]H,`,L&3c¢!77™\Ê4OO7ÍVA7¥fV4š&,H^¡ÿãð™±É67654'&"327632#"'&'&/#"'&5476=#"'&'&5476763232?'&#"#"'&'&5476763254'&5476276767632#"'&#"#"'&#"327676%32767654'&'&#"#"Z8%1T1%8¨5e %ZF\ +m8BS/?JV@6RTXN6@VGB1QB8n* \FZ% e53e!&ZFZ *n8BS/?JV@6R¨R6@VGB1QB8m+ \FZ&!e3þ˜DA 5<; > +F$ÜH$F+ > ;<5 AÓcJ2QD++DQ2Jþ´ (5H,'9,J&0f‰) T|\`j4OO7g`\|T '‹g/& H,9',I4( (3J,&9-H &0f‰) T|\`j4OO4j`\|T '‹g/&J,9',H5(€""'!$(:UJJU:($!'""nF­w"2767>54&'&'767632"'"'&'.'"'&'.546767"'&'.546767632.546767632¢=>343343>==>343343>x>%85670-),(-%8/[0!-(,)-02y/8%0%)-02y/8%-(.'&$W/:#-(,)-02;>/;),)-02;>/8%-( 06{IF{6006{FI{605+'g>:c.&".c;=g'+&1N%&W'+&.c:>k#"$.c:>g'+,B:>g'+&.c;=?nF­\v¦½Ö%"'&'.546767"'&'.546767632.5467676267632"'"'&'.27654&'&'&"67&'&'&'276767&5467'&'&#"32767>54&/76767>54&'&'&#"Z0%8/y20-),(-!0[/8%-(,)0-<1:3%>(-%8/|/8%-(>%85670-),(-%8/[0!-(,)-02y/8%0M=  H C# B/g H Ö/*x#$  8## H g/B õPP  $#x*/ø%N1&+'g=;c."&.c:>g'.5 ?=;c.&&.c;=? 5+'g>:c.&".c;=g'+&1N8GG$> >$ ‚ýc.,bB$#>  ºIr0C >'#> þÂLM >#$Bb,.$ >#'> C0rI Tÿã`ð)T½æ:e©Ó&'#"&'&'&4767>3267'&#"327%32676764'&'.#"7632#"#.4767676324676762>322##"&'"'&'.5#"'.'&467"&'&'&4767>&'&'.'&'>76?&'326767767>5&'&'.#"767>7.'&/32>7674&'&'67'&'.#"67'&'.'67676767"2767>54&'&'"'&'.54?&'2767>54'7654&'&'&"67'&54676762:ä    äÎ$4 4$ww4 4 åxy   ûÊ%" !()-+U$"! ((\(( !"&S+-)(! '7M"# V2% A()-.R$"! ((\(( !"(O-,*(A"#2P"# "MÁŽ   ´ ¸! *4 2ë kk  4 2 uKK   ¦ ´    Ži2 4* !ý‰== 2 4  Í `_  wR#$$#R#$$  8 < c !<>  š   8 < d!!<>   "%UV*) !!$3R  R3&!-(-%Z& "#%(.2$( &&S+,))A!$3R  R3'A))XT$""#%(`$( " þ ´     Ži3+!x== 3 Í _`   þŽ    ´ ¹!+3ë kk 3 uKJ   ßF)(GG()Fþ$ä    äÍ%3 3%ww3 3 åxy   Vÿã^ð3N^"2767>54&'&/2"'&'.4676762 '&'&547676% %-—z35++++++53z35++++++5pWDM69?=;9JHªDM69?=;9JHSšŽ†spsnun‹þËŽ†spsnulŒœþ£þ}ƒ££ƒþ}£þ(.h<;h.((.h; +F$þ$þ‚> +F$Hþ‚ ;<5 AØ~ ;<5 AÓ¹+DQ2Jþ´ (5H,'9,J&0f‰) T|\`j4OO7g`\|T '‹g/& H,9',I4( (3J,&9-H &0f‰) T|\`j4OO4j`\|T '‹g/&J,9',H5(õþG+DQ2JÁÝ$(:UþÍÝ$(:U3Ý!'""ûÝ!'""¶þÕA''7'753'75377537'7'#5''#5'7#5'7'7âðÂ<†Ä<ÄxðÂ<†x†<ÂðxÄ<Ć<ÂððÂ<†Ä<ÄxðÂ<†x†<ÂðxÄ<Ć<ÂëŠphMrhr›à‹ohMããMhoþëŠà›rhrMhpŠ‹phMrhr›à‹þêohMããMho‹à›rhrMhpœÕ!%)-153%% %%#'-75%77%7?5x# <þö$þÝ <þ÷þÝxþÝþ÷< þÝ$þö< #««#««ý÷¬««šª««ýö««x«ÕþÌ©þ°šhš¨¨™hšþ¯©þÍ3©Qšh™¨¨šhšP©'ÅcÅccÅchcbbccbbgcÆcÆÆcÆ‚0ÕA37%37' 7'#%'#5'7#5'7'7-'7'753'7xŒdð ÈX<[Œdðþö ðdŒY<\ÈþùðdŒxŒdðþ÷È[ÿB-ÏDH2#"2767>5!"&54$3!57!#"'&'.5467676#Ý_>I-74þÍÞý×3TŒÈP>CPN±DG-2.1/&D9¨¾Ð 88 '.* !-8D_èÈ2ú{ûÛj·@F'%.3r@Md7+4VýªžÿÝð/2&'&54676762"'&'.546767Z y*,&'ˆ²‚†®ˆ'&%1]~|45,-++-,54|45,-++-,5ð(+&a4|dƒÎ΃fz4a&$(üF*.j=3"&'&'&54767>32Ôîòr²JŠ6464ˆNNˆ4646ŠJ´pòêŠþ`Â684F@NLBD64:866D@NLBD668Âþ^~*Ëž i654'&#"632327632!"'&5!267&'&#"#"'&54763247632327654'&547632#"— 6+Jo.^V|;-þË™it36?þÅ̺ÆfQMeæEJS?(*$ s]vh2K)*NL13^Úv:Mc*„Zœ™£þe—C0ª3N35%&-Kt\K%9S >BWN=!$?$8(F!5{^? Z„ Q67654 547&'&+327#"'#536767&'&'&5432&5476323254'&5432ß?-BO>=þþ‹v06&%K`dC+(‘k$'eM?$#=Hb B=)+8=.mØ9eb PB÷°>$3g:84þ!þEB7WPfG+1K«HŽP<Ff#&T'0P+A'þ“š<þú›œ¸±œ›ƒ}DC‘þä/'"05276767654'&'4‘rceNS((((¦`hmº©§„Œ@DDF†Š¡©þä/CD}ƒ›œ±¸œ›>C/GF†©½»¤§…‰CGþñ˜ !&547˜†‚ƒ…þ°–•”—æþ>þ2þ;åëÆàßÄìþñ˜ 0!!6P—”•–þ°…ƒ‚ìþ<ßàþ:ëåÅιþÛ! !ÛþÜþþ$þþüÛþü ! Ûÿþ"þþþüü#þ{! !{þ<ýl”Äý`þü9þ‘ ! 9 ý`Ä”ýlþüüUþ?! !?þþþìþþüwþ` ! wÿþêþþþüüÄþHZîjþæjî•îjÍjîlþð'7'7Zîjþæjî¼îjþæú3þæjîfþ²$#"&=4&+5326=46;#"3Ôù©lŽ==k©ùÔDV[noZV¾”Ýï—ts•ðÝ“XøŽŽœøX¡þ²N$326=467.=4&+532;#"+¡DVZon[VDÔù©k==Žl©ùÔ¾XøœŽŽøX“Ýð•st—ïÝ”˜ÿì”è º+¸º +¸ 01! 4$32!5##7#”þ?þÂþÄþ?Îq¾ÁqÍûÓiÚ¡þÿìÙêþÁþA¿?ÆrÆÆþý\Ž/˜+ý‚˜ÿì”è *º%+¸%º +¸ 01! 4$32>54&#">32!5!>”þ?þÂþÄþ?Îq¾ÁqÍýæ>0Å£=‘as„;N_/>!þúR¤þL}²êþÁþA¿?ÆrÆÆþéFi:}—$«:&N?(U?"ñMŽt§˜ÿì”è 6™º+Aêú]A)9IYiy‰™©¹ÉÙ ]¸1ܺ.+¸.º +¸ º!'+¸!º+¸º9º*'!901! 4$32%4&#">32+32#"&'32654&'26”þ?þÂþÄþ?Îq¾ÁqÍþ|Á¡=ˆ_ky4[\XZ‘ŒcksuD}[Xˆ@ÃØv hêþÁþA¿?ÆrÆÆþs‰— ?<:<ŒNGLO0¨œ]r˜ÿì”è º+¸º +¸ 01! 4$32! !3535##”þ?þÂþÄþ?Îq¾ÁqÍýþó þC½¶ÎêþÁþA¿?ÆrÆÆþþ¼~þƒŽÓÓH˜ÿì”è +‹º!+Aê!ú!]A!)!9!I!Y!i!y!‰!™!©!¹!É!Ù! ]º+¸º ++¸ º+¸º($+¸(º901! 4$32>32#"&'32654&#"75!5!”þ?þÂþÄþ?Îq¾ÁqÍûïYe2hvvhDw_X…@¾Õϰ?‘ýÃêþÁþA¿?ÆrÆÆþó%aVUa/¬¬˜•° «Ž˜ÿì”è 2ñ¸3/¸4/¸3¸и/¸4¸ܸÜAêú]A)9IYiy‰™©¹ÉÙ ]¸¸ÜA&6FVfv†–¦¶ÆÖ ]Aåõ]º +¸ º +¸ º+¸º,&+¸,º/&,901! 4$32#"&54632"32654&#"7>325.”þ?þÂþÄþ?Îq¾ÁqÍý¢\NN\\NN\qÈêÀ¹ Âº N€ w/aTJjêþÁþA¿?ÆrÆÆþþZbbZ[bb*þõÚçý³‘”±= P”#œ˜ÿì”è º+¸º +¸ 01! 4$32%!35!”þ?þÂþÄþ?Îq¾ÁqÍûÂÏþ¯ÁlýUêþÁþA¿?ÆrÆÆþvüæ]K˜ÿì”è 1=‹º+¸º+¸º +¸Aêú]A)9IYiy‰™©¹ÉÙ ]A&6FVfv†–¦¶ÆÖ ]Aåõ]Aê ú ]A ) 9 I Y i y ‰ ™ © ¹ É Ù ]º/9º;9¸;/Aê;ú;]A;);9;I;Y;i;y;‰;™;©;¹;É;Ù; ]¸5ܺ+¸º )+¸ º+¸º28+¸201! 4$32#"&5463232654&'>54&#"2#"&546”þ?þÂþÄþ?Îq¾ÁqÍý¹_TT__TT_ýâ¾­­¾vi¶·jvkKRRKMQQêþÁþA¿?ÆrÆÆþþlHQPIIPPIŠ——Š\ƒvStˆˆtSvƒÄB>=BB=>B˜ÿì”è &2é¸3/¸4/¸Ü¸ÜAêú]A)9IYiy‰™©¹ÉÙ ]¸3¸'и'/¸-ÜA-&-6-F-V-f-v-†-–-¦-¶-Æ-Ö- ]Aå-õ-]º+¸º +¸ º +¸º*0+¸*º# 901! 4$32254&#"326#"&'4632#"&”þ?þÂþÄþ?Îq¾ÁqÍüÑÈ鿹 ÂºŸO€ w.aUJk<\NN[[NN\êþÁþA¿?ÆrÆÆþýK Úèý´‘”¯< O“$œ„[bb[[bb˜ÿì”è $0Óº%+¸%º+¸º++¸Aêú]A)9IYiy‰™©¹ÉÙ ]Aê+ú+]A+)+9+I+Y+i+y+‰+™+©+¹+É+Ù+ ]º+¸º .+¸ ¸¸(Ü01! 4$32!5##7##"&5463232654&#"”þ?þÂþÄþ?Îq¾ÁqÍû$Ÿu¼¬ž‰F?@EE@?Fþpˆƒ‚ˆˆ‚ƒˆêþÁþA¿?ÆrÆÆþý©€Ê*‰'ýÂ$¢——¢£——£ÐääÐÑää ÿ–«=$>  767654'&'!5%3!!  '&'&54767ôþ̆„mommom„†4†„mommom„ý¥þá¡ýP\˜–|~{{~|–˜þ¤˜–|~{{~|–Ù96ooþ÷œ—þ÷oo6996oo —œ oo6û}9“:û݈¨@>}~þÔ±¬þÔ~}>@@>}~,¬±,~}> ÿ–«=6P  767654'&'!!567>54&#"5>32  '&'&54767ôþ̆„mommom„†4†„mommom„þ)4ý \=)N=…kP¥`aªFºÝ7I׺\˜–|~{{~|–˜þ¤˜–|~{{~|–Ù96ooþ÷œ—þ÷oo6996oo —œ oo6û€ˆˆ_A.Xx;_x55£'(º›I„ZÞV@>}~þÔ±¬þÔ~}>@@>}~,¬±,~}> ÿ–«=B\  767654'&'#"&'532654&+532654&#"5>32  '&'&54767ôþ̆„mommom„†4†„mommom„ttƒóàLŸUD W˜Ÿ”„‹‘x~‚zB˜\R«GºÕrþ=\˜–|~{{~|–˜þ¤˜–|~{{~|–Ù96ooþ÷œ—þ÷oo6996oo —œ oo6ýyœt°Âœ'(xrjw…_Z\b§Ždˆ @>}~þÔ±¬þÔ~}>@@>}~,¬±,~}> ÿ–«='A  767654'&'!33##!5  '&'&54767ôþ̆„mommom„†4†„mommom„Þþh˜*˪ª¡ýå+\˜–|~{{~|–˜þ¤˜–|~{{~|–Ù96ooþ÷œ—þ÷oo6996oo —œ oo6íý‚ üõ†þæœò@>}~þÔ±¬þÔ~}>@@>}~,¬±,~}> ÿ–«=7Q  767654'&'!!>32#"&'532654&#"  '&'&54767ôþ̆„mommom„†4†„mommom„ý£zþ#G#ÈéðÚKœSL•VŠ¢¢ŠAC\˜–|~{{~|–˜þ¤˜–|~{{~|–Ù96ooþ÷œ—þ÷oo6996oo —œ oo6cˆþÛ Û»ÁÖ£)%’}|’X@>}~þÔ±¬þÔ~}>@@>}~,¬±,~}> ÿ–«=%>X  767654'&'"32654&.#">32#"32  '&'&54767ôþ̆„mommom„†4†„mommom„þÖl€€lmÔ=|< © /ŽV´ÑÚµÏÛ â=|þ^\˜–|~{{~|–˜þ¤˜–|~{{~|–Ù96ooþ÷œ—þ÷oo6996oo —œ oo6ý‹•‚€––€‚•ú“ØÚEKÛ¼¸Þ>-O@>}~þÔ±¬þÔ~}>@@>}~,¬±,~}> ÿ–«= :  767654'&'!#!  '&'&54767ôþ̆„mommom„†4†„mommom„ý\þN¨˜ýÂÖ\˜–|~{{~|–˜þ¤˜–|~{{~|–Ù96ooþ÷œ—þ÷oo6996oo —œ oo6`Eûš#…@>}~þÔ±¬þÔ~}>@@>}~,¬±,~}> ÿ–«=#9E_  767654'&'"2654&%.546  &54632654&#"  '&'&54767ôþ̆„mommom„†4†„mommom„þßs„„æ…„þêhtÌdÌthuƒÔþtÔ„9tihvvhit0\˜–|~{{~|–˜þ¤˜–|~{{~|–Ù96ooþ÷œ—þ÷oo6996oo —œ oo6ý,{Ø{|kl{EŽg¦¦gŽžs­ºº­sž\hh\]hhÐ@>}~þÔ±¬þÔ~}>@@>}~,¬±,~}> ÿ–«=2>X  767654'&'53267#"&54632#"&2654&#"  '&'&54767ôþ̆„mommom„†4†„mommom„ý§=|< © .VµÏÚ´ÐÚþôâ=}þmml€€J\˜–|~{{~|–˜þ¤˜–|~{{~|–Ù96ooþ÷œ—þ÷oo6996oo —œ oo6û“×ÛDJÙ¼¸ÞþÃþÑþæþ¯•‚••‚••@>}~þÔ±¬þÔ~}>@@>}~,¬±,~}> ÿ–«=+8Ca  76767654'&'&'"32654'.  735733!  '&'&'&5476767ôþ̆„mo5885om„†4†„mo5885om„T,+VUVV++ï2QPPQþΠPþ3–•ƒþp\˜–|~-,¡üg%“&û݈¨@>}~•—±¬—•~}>@@>}~•—¬±—•~}> ÿ–«= $!5!#%  '&'&54767°þø¡þâ{\˜–|~{{~|–˜þ¤˜–|~{{~|–ˆˆ#:“9üq @>}~þÔ±¬þÔ~}>@@>}~,¬±,~}> ÿ–«=6>7>54&#">32!5  '&'&54767£Ã×I7ݺFªa`©Lk…=N)þÃ\öýÕ\˜–|~{{~|–˜þ¤˜–|~{{~|– ÇÞZ„I›º('£55x_;xX.þ¿_ˆˆ@>}~þÔ±¬þÔ~}>@@>}~,¬±,~}> ÿ–«=(B>54&#">32+32#"&'32654&  '&'&54767ir׸G¡\\˜Bz‚~x‘‹„”Ÿ˜W DUŸLàóƒþ2\˜–|~{{~|–˜þ¤˜–|~{{~|–ˆdާb\Z_…wjrx('œ°tœ=@>}~þÔ±¬þÔ~}>@@>}~,¬±,~}> ÿ–«= '! !335#$  '&'&54767œþhnþ¡ªªþo\˜–|~{{~|–˜þ¤˜–|~{{~|–³ý‚ ý œþæ† ý@>}~þÔ±¬þÔ~}>@@>}~,¬±,~}> ÿ–«=7>32#"&'32654&#"!5  '&'&54767CAŠ¢¢ŠV™HSœKÚðéÈ#G#æþ\˜–|~{{~|–˜þ¤˜–|~{{~|–=ý¨’|}’''£ÖÁ»Û %ˆ@>}~þÔ±¬þÔ~}>@@>}~,¬±,~}> ÿ–«= $>2#"&546.#"32654&#">32  '&'&54767Pmml€€­C|=âþóÛϵÚÑ´VŽ/ © <|=þ\˜–|~{{~|–˜þ¤˜–|~{{~|–+•‚€––€‚•úþ¯þåþÓþÂÞ¸¼ÛKEÚØ«@>}~þÔ±¬þÔ~}>@@>}~,¬±,~}> ÿ–«= !35$  '&'&54767Ö>þh¨²ýÖ\˜–|~{{~|–˜þ¤˜–|~{{~|–@ˆûÝfEý@>}~þÔ±¬þÔ~}>@@>}~,¬±,~}> ÿ–«= +E2"&46' 654&'>54& 74632#"&  '&'&54767Yt„…æ„„/t„ԌԃuhtÌþœÌt-tihvvhit0\˜–|~{{~|–˜þ¤˜–|~{{~|–Ì{lk|{Ø{Ežs­ºº­sžŽg¦¦gŽå]hh]\hh‰@>}~þÔ±¬þÔ~}>@@>}~,¬±,~}> ÿ–«=$>%32#"3267#"&'"&54632  '&'&54767!C}=â ÚдÚѳV. © <|=Al€€lmþÝ\˜–|~{{~|–˜þ¤˜–|~{{~|–®Q/=Þ¸¼ÙJDÛ×g•‚••‚••@>}~þÔ±¬þÔ~}>@@>}~,¬±,~}> ÿ–«=  :2#"&546$  !5##7  '&'&54767™eddedddþ¾©©Bªû‘¡³´–\˜–|~{{~|–˜þ¤˜–|~{{~|–Õõ÷õööõ÷õ€þÃþÑþÓþÂ>-/ýˆˆ#&“%üq @>}~þÔ±¬þÔ~}>@@>}~,¬±,~}>ušPj !!5!!PþþÀpûÝ#þ@‚þpðpüpté 7%÷ý©µÔFýN‹´ªý4ýNGuÌP85 zûûDýæ<2ð2pþJþJüt” '-ZýK©ûþ˲Fýª´ÔGýNuPü!!u»¨\lý”þ¤¨ýE¾>ü~~ü>uu+"&'.546?!".4>3!'.5467>2þp4,ºü€,$$,€º,4›2.þp ,.º".2."º., þpuÌP8!5! šûÛ%¶þJZPŽþJþJuÌP8!5! šûÛ%¶þJÜHþJþJuÌP8 #3#3#3!!5 ¹ððþÀxxÈ<<éþo‘¶þJºþpþpþpîþJþJuÌP8 55!#3#3#3š¸þþ¸þoPððþÀxxÈ<<®Šþ΄„þΊXý¨Xý¨Xý¨Xu†}~ !!üþûô ~þþÖäÀPD! 6ü¼–þ>lú”‚þñÂþ>þ>äÀPD ! þòDýRþ>lú”‚þñÂþ>þ>äÿøP  Bþ¢lú”‚ŠývývuÌPb3!5 5! '&'.u$##+* Z¶þJþMþM*+##$‚à0U%!ÆþJþJÆ!%Uu¢P84676763!5 5! u$##+* Z¶þJþMþM*+##$‚0U%!ÆþJþJÆ!%U0ìÿñÙ!! ^þŽr{þ…VXeýoýouÌP855!¼þDüqšžþ΄„þΞ0ušj%5!!53  !<ý9Çúèþª˜þhý9šîôîþþ>îþ¬ušj%5!!53  !<ý9Çúèþ˜þhý9šîôîþþ>îþ¬+Z° !73#57!!+ IŠdØý&–ý+ÑŠ„¬Šü·ÄÎôîýþÈþ2È&îþ¬+Z° 5!'53#'!!!+Õ–ÚØdŠü·±ü·ÄIЬý|úÈ&Èþ2Èýþî¤þ¬î˜˜2˜ !'!'!53 !ÜOýìdcnèdþ‚˜þhýžÈ”žþÈþ¶ž˜˜žþ 2˜ 3#5!7!!! Ünèdþnýd;ýc˜þh˜þÈþž”Èþèþ ž˜˜dd˜ !53#'5!'! !–]nè2þn2üÕ2òr-˜þhüÓ°Jžþdþc;dJúž˜˜ždd˜ 7!573#5!! !–2+2nè2þnü£òr-˜þhüÓLJd;cþdþžJúž˜˜ž<ÿØÄ¯6767632"'&'&'! <'CZmo~yti^Z\X^Vqo÷ti^?)XÊþ6nGCZ.//+]YÝ€zÚ_X0//+]>IžÊÊž ‚BP "&*.37#37#37#37#5!!!!3'#3'#3'#3'#á < ´ < ´ < ´ < x»»‡­Ãíþy»ýä_< <(< <(< <(< <ZððððððððPþ輂‚¼þèhððððððð¥pt> 7&#"7'7 !%¢¯*ޤBF¯þ8þ©þåþWU¨{°FC£*°þ9oþX¨:þWþæubP¢ 55!5!!'!þš¸¸šþ˜ý§XÈý¨ÈÈXȪø¼dd¼øPRÈÈȧÿÅt” '327'' !!i¯FB¤Ž*¯ÿ8þ‘¨þX:þå¨Á°*¢CF°ÿ9þ¨þåþXU¨§pt>*%&#">7'&'&">327&5467>7t¥BEH€¦¦#&NKþX$W/,0$"¨ D5Hp*G6¦¦¨$"!0,0Y"þW!F&'&#þ»GGC£uaP£'467#"!4676?'&'.5!3!.5P·›5ëê#$ý¨%"//"%X$# Ë5›‚e¼eJ(0Y! "X0(Je¼§ÿÆt”*.'.54?'#"&'2767.'32t)H5§§ þX"$ #0,0X"¨KN&#E€HEB¥”Ž£CGG¨¨&'&KþW"Y0,0$"¨E6Gs¬PX'<6%"'&'.54676$4676762"'&'&&'.54676762$/ö+ãz >ü_ $#R#afü‚þ·#R#)ž>xåþ”ÎbQuþý 88—RK…68ƒ# 88  þþvc–<å*676767632#"'&'&'&%.5467.546–A ''+/54<3¢‘þo¢8n23'9%%%%büüb%%%‚&:?$ fLLf#&#/:&'X23X'ñrrñ'X32X¢V2®c"'&'.54?654&'&'&#!"#!".4?64/&4676763!23!2767>54/&546767622ð þæZýœ ;:td Z ð‹ð  c ´  uuè ´ c  ð¢ñ2c"'&'.54?654&'&'&+"#!".4?64'&4676763!2;2767>54/&546767622þpW\xýj IJœ– ‚\W‹þ˜ Ûð  ““8 þüÛ þ˜u¦P^'#76767&'&/3#>7!5!!5!.'PˆSŒJl.. &GG& GlHŽSýÌi7*üÖånK Knü**7‚OU©nm¤'66'¤1ª¤”UýÕ=…HdŽ·)·ŽdH…=nþ²Ð&*'$&'&#"'67667Ð h7þHm^:-ˆ3ÕÞþ° REþ² SR®õQO‰1ØÌ¡üLÜHOþ²±&57$'&54&#""OER þ°ÞÕ3ˆ-:^mþH7hþ²HÜ´¡ÌØ1‰OQü ®þ®S þ#îu ! !ùõþ þ óþ˜Òþ–jý.uûÛûÓ-1ýüްþò0 3%!#3!ÈþÔ€ððý€°ù¦Zddù¦d¯þò/ #3!53#5ËÈÈdý€ðð°ù¦¾øÞdZd·þò{3 #·ªþ檂üpüp¤þòh # 3hþæªþ檂üpÿÿ·þòÏ&GGTÿÿ¤þò¼&HHT[[Ü '#'#'##'‰Òx\xÒxjjxÒx\xÒÜý,x\ýeÓûȰhhûP8Óü›ì\xÔYÿùYÕ73373737+ý.x\xÒxjjxÒx\xý.Ôx\ìü›Ó8ûPhh°ûÈÓeý\xý,Ol„D=072767>54'&'&'&"7#7676767632#"'&ew@RN¾JV !'7$"!3!&'&'&'!#!2767676Þþwxéþ  !1cbîþìîbc1! ½½ "1cbîîbc1" `éxüâÖ]\LM& ®ª® &ML\;þRªþR &ML\]Ö]\LM&¯ZþwxéZQvcbddbcvQZª[RwcbddbcwR[éxV''LM\7=eþ›=7\ML'ýÆþ›e;6\ML''''LM\6dÌ 8 ´  ÔÔÌ2@ @@ 00 ]1@  œ Ôì99ÌÌ0@  œ ü<<@ œü<<°KSX³ <<´œ ì´œìY5!!d‰xé ‡öyéxUZ‰xéªéxuÌ 8 ´  ÔÔÌ2@ OO __ ]1@ œ Ôì99ÌÌ0@  œ ü<<@ œü<<°KSX³ <<´œ ì´œìY'7!5!'7 þwxéöy ‡éx¯ZþwxéªéxdÌ 8Ú¶ ÔÌ2ÔÌ2@ PP_ _O O]1@   œ Ôì9Ì2Ì20@   œü<<@ œü<<@ œ ü<<@ œü<<°KSX· <<<<´œì´œì´ œ ì´œìY5!'7'7!d‰xé€éx‰þwxé÷€éxUZ‰xééxþwZþwxééxdÌ 8!!5!! s÷]xþw‰x]ûöix]x‰Z‰x]xiuÌ 87'!5!'7'7!5 èiiöû]x‰þwx]÷iix]xþwZþwx]xdÌ 8!7'!!5!'7'Xii÷¨iIø˜]xþw‰x]h]x‰þwxiiiá]x‰Z‰x]]xþwZþwxdÌ 8 !5!3# Y÷#éxþw‰xéݪª-éx‰Z‰xéYü¤uÌ 8 #3!'7'7ªªÝéx‰þwxé-þ§\þ§éxþwZþwxédÌ 8 !5!53#5! Y÷¯]xþw‰x]Qªª÷7ii¡]x‰Z‰x]Íü¤EÒiiuÌ 8 !'7'7!#3!7'Q]x‰þwx]÷¯ªªÉiic]xþwZþwx]Í\þ»ÒiiuÌ 8%77777773'7'7#'''''''uF´´´´´´´´´´´´F‹éx‰þwxécn´´´´´´´´´´´´F×F´´´´´´´´´´´´FéxþwZþwxén´´´´´´´´´´´´Fÿÿ,X@^,ÿÿ,ÝX ^,Ýÿÿ,ÝX@'^,^,Ýÿÿ,§XÓ^,§ÿÿ,§X@'^,^,§ÿÿ,§X '^,Ý^,§ÿÿ,§X@'^,'^,Ý^,§ÿÿ„°@^„ÿÿ,°@'^,^„ÿÿ,ݰ@'^,Ý^„ÿÿ,ݰ@'^,'^,Ý^„ÿÿ,§°@'^,§^„ÿÿ,§°@'^,'^,§^„ÿÿ,§°@'^,Ý'^,§^„ÿÿ,§°@'^,'^,Ý'^,§^„ÿÿ„ݰ ^„Ýÿÿ,ݰ@'^,^„Ýÿÿ,ݰ '^,Ý^„Ýÿÿ,ݰ@'^,'^,Ý^„Ýÿÿ,§° '^,§^„Ýÿÿ,§°@'^,'^,§^„Ýÿÿ,§° '^,Ý'^,§^„Ýÿÿ,§°@'^,'^,Ý'^,§^„Ýÿÿ„ݰ@'^„^„Ýÿÿ,ݰ@'^,'^„^„Ýÿÿ,ݰ@'^,Ý'^„^„Ýÿÿ,ݰ@'^,'^,Ý'^„^„Ýÿÿ,§°@'^,§'^„^„Ýÿÿ,§°@'^,'^,§'^„^„Ýÿÿ,§°@'^,Ý'^,§'^„^„Ýÿÿ,§°@'^,'^,Ý'^,§'^„^„Ýÿÿ„§°Ó^„§ÿÿ,§°@'^,^„§ÿÿ,§° '^,Ý^„§ÿÿ,§°@'^,'^,Ý^„§ÿÿ,§°Ó'^,§^„§ÿÿ,§°@'^,'^,§^„§ÿÿ,§° '^,Ý'^,§^„§ÿÿ,§°@'^,'^,Ý'^,§^„§ÿÿ„§°@'^„^„§ÿÿ,§°@'^,'^„^„§ÿÿ,§°@'^,Ý'^„^„§ÿÿ,§°@'^,'^,Ý'^„^„§ÿÿ,§°@'^,§'^„^„§ÿÿ,§°@'^,'^,§'^„^„§ÿÿ,§°@'^,Ý'^,§'^„^„§ÿÿ,§°@'^,'^,Ý'^,§'^„^„§ÿÿ„§° '^„Ý^„§ÿÿ,§°@'^,'^„Ý^„§ÿÿ,§° '^,Ý'^„Ý^„§ÿÿ,§°@'^,'^,Ý'^„Ý^„§ÿÿ,§° '^,§'^„Ý^„§ÿÿ,§°@'^,'^,§'^„Ý^„§ÿÿ,§° '^,Ý'^,§'^„Ý^„§ÿÿ,§°@'^,'^,Ý'^,§'^„Ý^„§ÿÿ„§°@'^„'^„Ý^„§ÿÿ,§°@'^,'^„'^„Ý^„§ÿÿ,§°@'^,Ý'^„'^„Ý^„§ÿÿ,§°@'^,'^,Ý'^„'^„Ý^„§ÿÿ,§°@'^,§'^„'^„Ý^„§ÿÿ,§°@'^,'^,§'^„'^„Ý^„§ÿÿ,§°@'^,Ý'^,§'^„'^„Ý^„§ÿÿ,§°@'^,'^,Ý'^,§'^„'^„Ý^„§ÿÿ,þpXÿœ^,þpÿÿ,þpX@'^,^,þpÿÿ,þpX '^,Ý^,þpÿÿ,þpX@'^,'^,Ý^,þpÿÿ,þpXÓ'^,§^,þpÿÿ,þpX@'^,'^,§^,þpÿÿ,þpX '^,Ý'^,§^,þpÿÿ,þpX@'^,'^,Ý'^,§^,þpÿÿ,þp°@'^„^,þpÿÿ,þp°@'^,'^„^,þpÿÿ,þp°@'^,Ý'^„^,þpÿÿ,þp°@'^,'^,Ý'^„^,þpÿÿ,þp°@'^,§'^„^,þpÿÿ,þp°@'^,'^,§'^„^,þpÿÿ,þp°@'^,Ý'^,§'^„^,þpÿÿ,þp°@'^,'^,Ý'^,§'^„^,þpÿÿ,þp° '^„Ý^,þpÿÿ,þp°@'^,'^„Ý^,þpÿÿ,þp° '^,Ý'^„Ý^,þpÿÿ,þp°@'^,'^,Ý'^„Ý^,þpÿÿ,þp° '^,§'^„Ý^,þpÿÿ,þp°@'^,'^,§'^„Ý^,þpÿÿ,þp° '^,Ý'^,§'^„Ý^,þpÿÿ,þp°@'^,'^,Ý'^,§'^„Ý^,þpÿÿ,þp°@'^„'^„Ý^,þpÿÿ,þp°@'^,'^„'^„Ý^,þpÿÿ,þp°@'^,Ý'^„'^„Ý^,þpÿÿ,þp°@'^,'^,Ý'^„'^„Ý^,þpÿÿ,þp°@'^,§'^„'^„Ý^,þpÿÿ,þp°@'^,'^,§'^„'^„Ý^,þpÿÿ,þp°@'^,Ý'^,§'^„'^„Ý^,þpÿÿ,þp°@'^,'^,Ý'^,§'^„'^„Ý^,þpÿÿ,þp°Ó'^„§^,þpÿÿ,þp°@'^,'^„§^,þpÿÿ,þp° '^,Ý'^„§^,þpÿÿ,þp°@'^,'^,Ý'^„§^,þpÿÿ,þp°Ó'^,§'^„§^,þpÿÿ,þp°@'^,'^,§'^„§^,þpÿÿ,þp° '^,Ý'^,§'^„§^,þpÿÿ,þp°@'^,'^,Ý'^,§'^„§^,þpÿÿ,þp°@'^„'^„§^,þpÿÿ,þp°@'^,'^„'^„§^,þpÿÿ,þp°@'^,Ý'^„'^„§^,þpÿÿ,þp°@'^,'^,Ý'^„'^„§^,þpÿÿ,þp°@'^,§'^„'^„§^,þpÿÿ,þp°@'^,'^,§'^„'^„§^,þpÿÿ,þp°@'^,Ý'^,§'^„'^„§^,þpÿÿ,þp°@'^,'^,Ý'^,§'^„'^„§^,þpÿÿ,þp° '^„Ý'^„§^,þpÿÿ,þp°@'^,'^„Ý'^„§^,þpÿÿ,þp° '^,Ý'^„Ý'^„§^,þpÿÿ,þp°@'^,'^,Ý'^„Ý'^„§^,þpÿÿ,þp° '^,§'^„Ý'^„§^,þpÿÿ,þp°@'^,'^,§'^„Ý'^„§^,þpÿÿ,þp° '^,Ý'^,§'^„Ý'^„§^,þpÿÿ,þp°@'^,'^,Ý'^,§'^„Ý'^„§^,þpÿÿ,þp°@'^„'^„Ý'^„§^,þpÿÿ,þp°@'^,'^„'^„Ý'^„§^,þpÿÿ,þp°@'^,Ý'^„'^„Ý'^„§^,þpÿÿ,þp°@'^,'^,Ý'^„'^„Ý'^„§^,þpÿÿ,þp°@'^,§'^„'^„Ý'^„§^,þpÿÿ,þp°@'^,'^,§'^„'^„Ý'^„§^,þpÿÿ,þp°@'^,Ý'^,§'^„'^„Ý'^„§^,þpÿÿ,þp°@'^,'^,Ý'^,§'^„'^„Ý'^„§^,þpÿÿ„þp°ÿœ^„þpÿÿ,þp°@'^,^„þpÿÿ,þp° '^,Ý^„þpÿÿ,þp°@'^,'^,Ý^„þpÿÿ,þp°Ó'^,§^„þpÿÿ,þp°@'^,'^,§^„þpÿÿ,þp° '^,Ý'^,§^„þpÿÿ,þp°@'^,'^,Ý'^,§^„þpÿÿ„þp°@'^„^„þpÿÿ,þp°@'^,'^„^„þpÿÿ,þp°@'^,Ý'^„^„þpÿÿ,þp°@'^,'^,Ý'^„^„þpÿÿ,þp°@'^,§'^„^„þpÿÿ,þp°@'^,'^,§'^„^„þpÿÿ,þp°@'^,Ý'^,§'^„^„þpÿÿ,þp°@'^,'^,Ý'^,§'^„^„þpÿÿ„þp° '^„Ý^„þpÿÿ,þp°@'^,'^„Ý^„þpÿÿ,þp° '^,Ý'^„Ý^„þpÿÿ,þp°@'^,'^,Ý'^„Ý^„þpÿÿ,þp° '^,§'^„Ý^„þpÿÿ,þp°@'^,'^,§'^„Ý^„þpÿÿ,þp° '^,Ý'^,§'^„Ý^„þpÿÿ,þp°@'^,'^,Ý'^,§'^„Ý^„þpÿÿ„þp°@'^„'^„Ý^„þpÿÿ,þp°@'^,'^„'^„Ý^„þpÿÿ,þp°@'^,Ý'^„'^„Ý^„þpÿÿ,þp°@'^,'^,Ý'^„'^„Ý^„þpÿÿ,þp°@'^,§'^„'^„Ý^„þpÿÿ,þp°@'^,'^,§'^„'^„Ý^„þpÿÿ,þp°@'^,Ý'^,§'^„'^„Ý^„þpÿÿ,þp°@'^,'^,Ý'^,§'^„'^„Ý^„þpÿÿ„þp°Ó'^„§^„þpÿÿ,þp°@'^,'^„§^„þpÿÿ,þp° '^,Ý'^„§^„þpÿÿ,þp°@'^,'^,Ý'^„§^„þpÿÿ,þp°Ó'^,§'^„§^„þpÿÿ,þp°@'^,'^,§'^„§^„þpÿÿ,þp° '^,Ý'^,§'^„§^„þpÿÿ,þp°@'^,'^,Ý'^,§'^„§^„þpÿÿ„þp°@'^„'^„§^„þpÿÿ,þp°@'^,'^„'^„§^„þpÿÿ,þp°@'^,Ý'^„'^„§^„þpÿÿ,þp°@'^,'^,Ý'^„'^„§^„þpÿÿ,þp°@'^,§'^„'^„§^„þpÿÿ,þp°@'^,'^,§'^„'^„§^„þpÿÿ,þp°@'^,Ý'^,§'^„'^„§^„þpÿÿ,þp°@'^,'^,Ý'^,§'^„'^„§^„þpÿÿ„þp° '^„Ý'^„§^„þpÿÿ,þp°@'^,'^„Ý'^„§^„þpÿÿ,þp° '^,Ý'^„Ý'^„§^„þpÿÿ,þp°@'^,'^,Ý'^„Ý'^„§^„þpÿÿ,þp° '^,§'^„Ý'^„§^„þpÿÿ,þp°@'^,'^,§'^„Ý'^„§^„þpÿÿ,þp° '^,Ý'^,§'^„Ý'^„§^„þpÿÿ,þp°@'^,'^,Ý'^,§'^„Ý'^„§^„þpÿÿ„þp°@'^„'^„Ý'^„§^„þpÿÿ,þp°@'^,'^„'^„Ý'^„§^„þpÿÿ,þp°@'^,Ý'^„'^„Ý'^„§^„þpÿÿ,þp°@'^,'^,Ý'^„'^„Ý'^„§^„þpÿÿ,þp°@'^,§'^„'^„Ý'^„§^„þpÿÿ,þp°@'^,'^,§'^„'^„Ý'^„§^„þpÿÿ,þp°@'^,Ý'^,§'^„'^„Ý'^„§^„þpÿÿ,þp°@'^,'^,Ý'^,§'^„'^„Ý'^„§^„þpÿÿ,þp°ÿœ'^,þp^„þpÿÿ,þp°@'^,'^,þp^„þpÿÿ,þp° '^,Ý'^,þp^„þpÿÿ,þp°@'^,'^,Ý'^,þp^„þpÿÿ,þp°Ó'^,§'^,þp^„þpÿÿ,þp°@'^,'^,§'^,þp^„þpÿÿ,þp° '^,Ý'^,§'^,þp^„þpÿÿ,þp°@'^,'^,Ý'^,§'^,þp^„þpÿÿ,þp°@'^„'^,þp^„þpÿÿ,þp°@'^,'^„'^,þp^„þpÿÿ,þp°@'^,Ý'^„'^,þp^„þpÿÿ,þp°@'^,'^,Ý'^„'^,þp^„þpÿÿ,þp°@'^,§'^„'^,þp^„þpÿÿ,þp°@'^,'^,§'^„'^,þp^„þpÿÿ,þp°@'^,Ý'^,§'^„'^,þp^„þpÿÿ,þp°@'^,'^,Ý'^,§'^„'^,þp^„þpÿÿ,þp° '^„Ý'^,þp^„þpÿÿ,þp°@'^,'^„Ý'^,þp^„þpÿÿ,þp° '^,Ý'^„Ý'^,þp^„þpÿÿ,þp°@'^,'^,Ý'^„Ý'^,þp^„þpÿÿ,þp° '^,§'^„Ý'^,þp^„þpÿÿ,þp°@'^,'^,§'^„Ý'^,þp^„þpÿÿ,þp° '^,Ý'^,§'^„Ý'^,þp^„þpÿÿ,þp°@'^,'^,Ý'^,§'^„Ý'^,þp^„þpÿÿ,þp°@'^„'^„Ý'^,þp^„þpÿÿ,þp°@'^,'^„'^„Ý'^,þp^„þpÿÿ,þp°@'^,Ý'^„'^„Ý'^,þp^„þpÿÿ,þp°@'^,'^,Ý'^„'^„Ý'^,þp^„þpÿÿ,þp°@'^,§'^„'^„Ý'^,þp^„þpÿÿ,þp°@'^,'^,§'^„'^„Ý'^,þp^„þpÿÿ,þp°@'^,Ý'^,§'^„'^„Ý'^,þp^„þpÿÿ,þp°@'^,'^,Ý'^,§'^„'^„Ý'^,þp^„þpÿÿ,þp°Ó'^„§'^,þp^„þpÿÿ,þp°@'^,'^„§'^,þp^„þpÿÿ,þp° '^,Ý'^„§'^,þp^„þpÿÿ,þp°@'^,'^,Ý'^„§'^,þp^„þpÿÿ,þp°Ó'^,§'^„§'^,þp^„þpÿÿ,þp°@'^,'^,§'^„§'^,þp^„þpÿÿ,þp° '^,Ý'^,§'^„§'^,þp^„þpÿÿ,þp°@'^,'^,Ý'^,§'^„§'^,þp^„þpÿÿ,þp°@'^„'^„§'^,þp^„þpÿÿ,þp°@'^,'^„'^„§'^,þp^„þpÿÿ,þp°@'^,Ý'^„'^„§'^,þp^„þpÿÿ,þp°@'^,'^,Ý'^„'^„§'^,þp^„þpÿÿ,þp°@'^,§'^„'^„§'^,þp^„þpÿÿ,þp°@'^,'^,§'^„'^„§'^,þp^„þpÿÿ,þp°@'^,Ý'^,§'^„'^„§'^,þp^„þpÿÿ,þp°@'^,'^,Ý'^,§'^„'^„§'^,þp^„þpÿÿ,þp° '^„Ý'^„§'^,þp^„þpÿÿ,þp°@'^,'^„Ý'^„§'^,þp^„þpÿÿ,þp° '^,Ý'^„Ý'^„§'^,þp^„þpÿÿ,þp°@'^,'^,Ý'^„Ý'^„§'^,þp^„þpÿÿ,þp° '^,§'^„Ý'^„§'^,þp^„þpÿÿ,þp°@'^,'^,§'^„Ý'^„§'^,þp^„þpÿÿ,þp° '^,Ý'^,§'^„Ý'^„§'^,þp^„þpÿÿ,þp°@'^,'^,Ý'^,§'^„Ý'^„§'^,þp^„þpÿÿ,þp°@'^„'^„Ý'^„§'^,þp^„þpÿÿ,þp°@'^,'^„'^„Ý'^„§'^,þp^„þpÿÿ,þp°@'^,Ý'^„'^„Ý'^„§'^,þp^„þpÿÿ,þp°@'^,'^,Ý'^„'^„Ý'^„§'^,þp^„þpÿÿ,þp°@'^,§'^„'^„Ý'^„§'^,þp^„þpÿÿ,þp°@'^,'^,§'^„'^„Ý'^„§'^,þp^„þpÿÿ,þp°@'^,Ý'^,§'^„'^„Ý'^„§'^,þp^„þpÿÿ,þp°@'^,'^,Ý'^,§'^„'^„Ý'^„§'^,þp^„þpdÌ?8 !5!53#5!•üs]xþw‰x]ªªûûii¡]x‰Z‰x]Íü¤EÒiiuÌP8 !'7'7!#3!7']x‰þwx]üsªªiic]xþwZþwx]Í\þ»Òii´Ü 3'#'##-Z-x\xÒxÒx\®.ýÒx\ün Óû#ÝÓûö’\ÿù´Õ733737#x\xÒxÒx\xýÓZ'x\’ûöÓÝû#Ó ün\xýÒO€'µ=%"'&'&'&767670327676764'&'&'&½pk_V1..1Vbr‰xé`Xk_V1..1V_kpIêxþ¸XE?#!!';B¢]YQS@?#!!';BQ9€.-\ZnllnZ_.‰xé$-\ZnlÿlnZ\-.)èxF!F@RN¾JV>Žl§ùï˜mGСBk˜ðþî>DôdWŽû0Xd”Ýï—ts•ðÝ“þ²ß.W@#.  -&.%)/ÜK° TX¹)ÿÀ8YÌ299ÌÜ´]<Ü<Ì999991@© &$À-±/ôÌ2ÄôÌ2ì907&54&'>5!2;#"#!532654&+C­­I°02°Ký½ù§lŽ>>Žl§ùþù5ŒUUŒ5D>ð˜kB¡û0Gm˜ñ“Ýð•st—ïÝ”dXÐŽWÙþ2Ûù  5 1üªúþû¨VüªªÌdþÎýÌá¦á22üšhþ¦Ù'æ %#3 5'ªªþ ü¢úþÈü:Äþžýœ¦Ù'æ 73 ÙªL^ü¢ªÈû8bbü:Èýï¦ÙÿÂ'B 7Ù''üÙ›â>€ý°Pú€Nqþ¢ÆÙÿÂ'B 'Ù''üÙ›þ>€ý°Pú€Nq^ýDÙÿÂ'B Ù''üÙ>€ý°Pú€NÙÿÂ'B%  'üÙüÙ''ýt¢àNý²€ý°PÝþÙÿÂ'B5  5Ù''üÙüÙŒbàý²Nú€Pý°Ýäþ#îu úôþ þ uûÛûÓ-ÙÛ3!3!!#!#!5 ¨L¨3þͨþ´¨þÍ×-ýÓ-ýÓªýÓ-ýÓ-ªÙÛ333333#######5¨¨¶¨¶¨ÏϨ¶¨¶¨Ï×-ýÓ-ýÓ-ýÓªýÓ-ýÓ-ýÓ-ª:þkÆû7!!  767654'&'$  $'&'&547676h0þÐ8þÀŒ‰rtrrtr‰Œ@Œ‰rtrrtr‰þ ŽVŽŽGFFGŽŽþªþrþªŽŽGFFGŽŽèþ’È;:rsþ죟þìsr:;;:rsŸ£sr:ôެªÉŬªŽŽª¬Åɪ¬Ž:þkÆû3?  767654'&'$  $'&'&547676!!#!5! þÀŒ‰rtrrtr‰Œ@Œ‰rtrrtr‰þ ŽVŽŽGFFGŽŽþªþrþªŽŽGFFGŽ€ýs¨ýsB;:rsþ죟þìsr:;;:rsŸ£sr:ôެªÉŬªŽŽª¬Åɪ¬Ž€Kýsªýsª:þkÆû3?  767654'&'$  $'&'&547676   '  þÀŒ‰rtrrtr‰Œ@Œ‰rtrrtr‰þ ŽVŽŽGFFGŽŽþªþrþªŽŽGFFGŽ€]ÍÎxþ3Íwþ3þ2xÍþ3B;:rsþ죟þìsr:;;:rsŸ£sr:ôެªÉŬªŽŽª¬Åɪ¬Ž€èþ3Íxþ2þ3wÍþ3xÎÍÿÿuþM %' µo& µ' µ% µJuþM¶327!5!>2&#"!!"&' ;E þ€”2&#"!!!!"&' ;Eþø þä$Ÿ˜€”;Eþð þÜŸ˜€›‚¯Ϊð¨@¥‡z‚¯þÙ¨ðªþ¥‡zuþM¶&#"%"&'73275%>2";ECþµŸ˜€”;Eþ¾JŸ˜€ö‚¯ýç¶ ºým¥‡z‚¯¶ º“¥‡zuþM¶*3&#"&'67"&'7327&'&54767>2";E™Iq(P >6DŸ˜€”;E]InoSuŸ˜€þ=,HK%ö‚¯þÖ)ˆAH!þ+p$ þ¾¥‡z‚¯1Io›œsV<¤ˆzüEÖ.JghH$uþM-2&#"676='73'"&'7327&'&53>2";E+@/V]H½6¼H\nUm —€”;D [>wfP3,, —I6ö‚¯üx/Ur]H½½H]œlVþ¡¥‡z‚¯M>wšrN3 ™¥‡F4uþM¶!3#!!>2&#"!!"&'732²ÓÓwþ¥¢—~”9F 9þ¡ ©‘}”9G¦þýêr0®§…}Œ‚¯þõü¼þÿ­}Œ‚uþM¶+3#>2&#""&'73273264&²ÓÓc)¢—~”9GcBnnVs¢—~”9F (6o‡”¦þ~ç…|‚¯þÖK|þÒoUþ¾§…}Œ‚¯¶“ØuþMp.3#327264&#">2&#"632#"'"&'ÓÓþz;E-8pÆ–ŠqÕS¢—€”;E;D©ÎÜ›WI —€®þýµ‚¯3>6‘Ñ¡]¤ˆz‚¯þËéþÒÛ!þ£¥‡zuþM¶ 13#64&"327&'&767>2&#""&'­ÓÓË”ŠÖ¢;E]InoSuŸ˜€”;EcBnnVsŸ˜€°þzÑ‘Ïþ-‚¯1Io7sV<¤ˆz‚¯þÖK|þÒoUþ¾¥‡zuþM¶!%7!>2&#"!!"&'73273!#3˜;¢—~”9GþÄ©”9G ŬþÅ«“›þI§…}Œ‚¯þÐýþÞ­{Ž‚¯ tþêþÿ¾þMm-&#"!2#567&'!"&'7327!5!>2";Ed‹_``þë!Ÿ˜€”;D þÜ»`þÅ;`»*Ÿ˜I6ö‚¯ýïÆŒˆebýI¥‡z‚¯žº`:H:`º*¥‡F4uþM¶#&#"7'"&'7327'7'7>2";Exüüx±Ÿ˜€”;EŸzþüx²Ÿ˜€ö‚¯þXyüüx°ýô¥‡z‚¯â yüüx³Ø¥‡zuþM¶*327#467>2&#"#4'"&' ;E-A 4y›yŸ˜€”;E Z>Vy|-Ÿ˜€›‚¯¦2PœþÈIϼ+¥‡z‚¯þæEaÖþ·8ó2üJ¥‡zuþM¶'&#"63"&'7327&'&53>2";E*’yþ€”;E\?Vy~+Ÿ˜€ö‚¯ü&8þ·þŒ'þ¢¥‡z‚¯LFaÖIþÈõ1…¥‡zuþMÀù>32&#"#"&'7327!5ã¢KL~”9GA¢LK~”9Güïâ§…}Œ‚¯ú°§…}Œ‚¯g  kýb¶>32&#"#"&'73275!ã¢KL~”9GA¢LK~”9GþÉâ§…}Œ‚¯ú°§…}Œ‚¯ýР ÿÿ?œÅ™ÿÿÙÓÛj& Æ O$ÿÿÙŸÛj& Æ' OçþW O@$ÙÿÛ¦ 5 5ÛúþûøúþF¶Ѷeþ‘þ“¶ѦÑÙÿÛ¦ 55ÙúþúþFѶþ/ì¶þ/¦þ/¶mÿÿÙÿݦ' O/ÿ»…ÿÿÙÿÛ¦& Oþ»†ÿÿÙÿÛ'' Oá…ÿÿÙÿÛ'' Oá†ÿÿÙÿÝ' O/Ì…ÿÿÙÿÛ ' OÿþdžÙþñÜN:A%#"'&'&'&#"5>32326#"'&'&'&#"5>32326 5Üj²bn’ š^X¬bh´`n” œ^V¨hj²bn’ š^X¬bh´`n” œ^V¨gü@ÀúþP³NE;=LT³NE;=K›²PD:32326#"'&'&'&#"5>3232655Üj²bn’ š^X¬bh´`n” œ^V¨hj²bn’ š^X¬bh´`n” œ^V¨ûeúþÀP³NE;=LT³NE;=K›²PD:327&#"56767326 5Üj²bDS4ŒWV¨hj²bm“\¤Y@/X¬bh´`ES3‹VX¬bhZmM’p[¤Y@1V¨gü@Àúþ–²PDƒ4KU³NE;é@âLT³NE‚4LR²N"*,é@ãJ^þëþî²pªoÙþ_ÜN5<#"'3267#"/'7&#"5>327&#"5>32732655Üj²bDS4ŒWV¨hj²bm“\¤Y@/X¬bh´`ES3‹VX¬bh´`n”[¤Y@1V¨ûeúþÀ–²PDƒ4KU³NE;é@âLT³NE‚4LR²ND:é@ãJ^°þ‘ªþ²Ùý„ÛT 5!5!-5 !5!Ûúþü‹uúþúþuü‹úþúþû°/ª0²Òý\ªû^ÕÒ²þЪþÑ~ªÙý„ÛT -55!55!Ùuü‹úþúþü‹þsûÕÒ²þЪþÑþ᪪ü°/ª0²ÒùªªÙÿÜN%#"/&'&#"5>32326!! 5Üj³an’š^X¬bh´`n”œ^V¨ûfúþü@Àúþ–²PD:32326!!55Üj³an’š^X¬bh´`n”œ^V¨ûfúþúþÀ–²PD:323265-5Ûi³an’›^X¬bi³an“›^V©gúþü‹þsuü‹úþ¾²OE;=LS²NE; =KJ°/ª0²Òú:ÕÒ²þЪþÑÙþÛ !(#"/&'&#"5>32326-5 5Ûi³an’›^X¬bi³an“›^V©ûeuü‹úþúþü‹¾²OE;=LS²NE; =KJÕÒ²þЪþÑû¿°/ª0²ÒÙþ,Û× -55!55!Ùuü‹úþúþü‹þs%ÕÒ²þЪþÑþ᪪(°/ª0²ÒùÙªªÙþ,Û× 5!5!-5 !5!Ûúþü‹uúþúþuü‹úþúþ%°/ª0²Òý\ª~ÕÒ²þЪþÑû^ªÙþ6Ûî 5 5 -55Ûúþü‹uúþúþuü‹úþ•°/ª0²ÒýV/°þÑý¦ÕÒ²þЪþÑþа/°Ùþ6Ûî -555 5Ùuü‹úþúþü‹uúþ•ÕÒ²þЪþÑþÛ°/°ý'°/ª0²ÒýK/°þÑÙÿ„Û& 55Ûúþúþûøpþ/¶Ñû¶ѦѶþ“Ùÿ„Û& 5 5Ùúþûøúþp¶þ/¶ý›om¶þ/¦þ/ÿÿÙÿ„Ý&' O/þîÿÿÙÿ„Û&' OÿþþäžÚÿ¶Ü{ 5!5 5!Úúþü@þ¾Ѫªû•°oªp²þî9ªªÚÿ¶Ü{ !5! 5 !5!ÜúþúþÀü@úþúþѪúë²þªþ‘þªÙÿÀÛÍ555Ùúþúþü@«²p²ýN²p²ü—°oªp²þîÙÿÀÛÍ 55 5ÛúþúþúþÀü@úþ«p²þþ p²þýU²þªþ‘ÙÜ(".#"#"&'5327>76325Üh¨V^œ ”n`´hb¬X^š ’nb²júþü@ÊTL>7632 5Üh¨V^œ ”n`´hb¬X^š ’nb²júýÁü?úþÊTL>ªªþÖªªÜVJ<:DN´TL<:DNüD°oªp²þîÙþ˜ÜÔ$+5!5!.#"#"&'53276767632 5Ùúþh¨V^œ ”n`´hb¬X^š ’nb²júýÀü@úþ>ªªþÖªªÜVJ<:DN´TL<:DNüD²þªþ‘ÙfÛÎ $!!!5!676762!!&'&'&!!Ùúþ‚C.8þd 6WYÎYV7 þe8-ý;úþZª{+DD\¨93[2332[0<¨[EC,üéªÙÿÏÛW7!!%5$Ùúþþþ$Üþü}ƒyª±þå]]þå×x„¦|€ÙÿÏÛW%!5505%$Ûúþƒü}þÜþ$yªª×þ€|¦„þˆ×]]Ùþ×ÛW !!'7!5!%5$¬–Zóý²…–Zþ N´þþ$Üþü}ƒqP¨ªøP¨ªþå]]þå×x„¦|€Ùþ×ÛW !!'7!5!55%$¬–Zóý²…–Zþ Ný²ƒü}þÜþ$qP¨ªøP¨ª×þ€|¦„þˆ×]]Ùÿ ÛK75!5!%5$ÙúþþÍýØ!:þ£ü[¥]3ªªþÖªªkþå-Q÷×tX¦VvÙÿ ÛK75!5!55$%$Ùúþúþ]¥ü[þ£:!ýØ3ªªþÖªªk×þŠV¦XþŒ×÷Q-ÙþqÛK!5!7!5!7!!!!'%5$&þ³Ú`ýÆȉŠ)Pþ"_=ý6ŠŠÞþÍýØ!:þ£ü[¥]êªsª¤s1ªsª¥tþå-Q÷×tX¦VvÙþqÛK!5!7!5!7!!!!'55$%$&þ³Ú`ýÆȉŠ)Pþ"_=ý6ŠŠþÜ]¥ü[þ£:!ýØêªsª¤s1ªsª¥t×þŠV¦XþŒ×÷Q-ÙþyÛ‹:E#"'&'&'&#"5>76326#"'&'&'&#"5>32>%5$Ûi³an’ ›^X¬bi²b`¡ ›^V©gi³an’ ›^X¬bi³an“ ªž°gþÍýØ!:þ£ü[¥](³NE;=LT³N9 A=Kš²OE;=LS²NE;C Eìþå-Q÷×tX¦VvÙþyÛ‹:E#"'&'&'&#"5>76326#"'&'&'&#"5>32>55$%$Ûi³an’ ›^X¬bi²b`¡ ›^V©gi³an’ ›^X¬bi³an“ ªž°ûe]¥ü[þ£:!ýØ(³NE;=LT³N9 A=Kš²OE;=LS²NE;C Eì×þŠV¦XþŒ×÷Q-ÙýíÜ‹6A#"'3267#"/'7&#"5>327&#"56767326%5$Üj²bDS4ŒWV¨hj²bm“\¤Y@/X¬bh´`ES3‹VX¬bhZmM’p[¤Y@1V¨gþÍýØ!:þ£ü[¥]$²PDƒ4KU³NE;é@âLT³NE‚4LR²N"*,é@ãJæþå-Q÷×tX¦VvÙýíÜ‹6A#"'3267#"/'7&#"5>327&#"5676732655$%$Üj²bDS4ŒWV¨hj²bm“\¤Y@/X¬bh´`ES3‹VX¬bhZmM’p[¤Y@1V¨ûe]¥ü[þ£:!ýØ$²PDƒ4KU³NE;é@âLT³NE‚4LR²N"*,é@ãJæ×þŠV¦XþŒ×÷Q-Ùþ¡Û®7 5Ùúþúþü@ÀúþÃþ²pôþ²p«þëþî²pªoÙþ¡Û®%5555ÛúþúþúþÀòþ²²²þ²i°þ‘ªþ²µÿÉŸ³ ' '!Â]ý#¿Ý\eÁý#þ´ÝÂÏN\ý#¿Ý]xý–Âý#LÝÁ ÿÉ ³ !77 ! ýþˆ\Ý¿ý#þ€ÏÂÝþ´ý#Nþˆ]ý#¿ÝýòÏÁý#þ´Ýµ4Ÿ !7 7:\ý#¿Ý]xý–Âý#LÝÁ]Ý¿ý#\eÁÝLý#Âý1 4  %''' !ý]Ý¿ý#\eÁÝLý#Âý1™\Ý¿ý#]þˆjÂÝþ´ý#Á7†P~ % ! !!5 5!3þü!üþýß…ýþö é †üüþïþþõƒƒþöþöƒƒ 7†?~% !!3þü ûô†üüþïþ*^V !!^üüþïþ* üþûô ^ÿÍVÕ!!!^ÖþÉ ûôþµÿÉŸ³' '!ŸÁý#þ´ÝÂÏäÂý#LÝÁ ÿÉ ³!  ÏÂÝþ´ý#äÏÁý#þ´Ýµ4Ÿ%7 7ÐÂý#LÝÁ4ÁÝLý#Âý1 4  ! ÁÝLý#Âý1ÂÝþ´ý#Á7†P~ % ! !3þü!üþý߆üüþïþþ^ÿÍV ! !! !EþþþïüüþïÉþüCüþuÿùR× #7!5!7ÈZþxxèü/{êxŠxêªþ:êxu-R '!5!'ÈŠxêû…Ñèxˆ þvxêþ:ªêxŠHÿù%× 7!!7Òþvxê{ü/èxþxŠxêƪþäêxþvH-% 3'!!'ÒZˆxèÑû…êx þvxêþäªÆêxºÿÕ$!%!!ºúW7úÉü ùàržºÿÕ$!!!ºúW7úÉü ùàžºÿÕ$!!,7úÉrŠ<úR ùàºÿÕ$!!cúÉrŠ<úR ùàÿ!$ výŠüó üòdxxýˆüðüðÿ!$ žuüó üòýˆðýˆüðüðÿ!$ ! žuvú} üòýˆxüðüðÿ!$! žëýŠüó üòxýˆüðüð ºÿÕ$ #)-17#535#5#5#5##5#5#5##5##53#5#5#5##5Õãqrrrrþ¥ÌêÊMrqêÌêÊþ¤rärrrrärrætr¶ÌÌ´ÊÊü$tttt¬ærtttttúÆrtæ¶ÌÌ´ÊÊÐtræ$ÿÊÐ# !$VVþºûà¶mý“ü$ÿÊÐ# ! !ªzý0üªVVþºûà‹ü±O þmý“ü–ÿFfü   vvýŠýŠrèèý5þ•kØkþ•üæ\­þSü¤þS–ÿFfü7 –èèýó\­þSü¤þS"ÿ¹Ù‰ ! ÐþR®[®þRGèèýýpþ„( $  %pýûþýýüþý@¨*––þÖûXþÖ––Mÿ §M :lý”üLüªüªF Mÿ §M  ü²N þ lý”üÆþîü†þìÐVüªüªF  jÕ3!!!!!!#535#53ÉÊ[þ¥[þ¥×ü_¿¿¿¿Õþþ~ª, *3###535#5333#y±±¸····¸±±¼ýÔ,8ýÈÿ×jÕ#3327673#"'!!&'&#"#>32ÉÊ &}f[×ü_ &}f[Õý, %$R†”þ/ª %$R†” Õ!2+##5332654&+!ÉÈû€€ûþÊ¿¿Êþššþ[ÕqrÛÝqqý¨ÏÑ’‡†’ÐÉþfTÕ$Ç@  $ !? %üì2üÄì9999Ì991@&  B •°• $•/ôìÔì999ôì990KSXíí9Y"²@&]@Bz%%%&'&&& &66FFhuuwˆˆ˜˜]]#.+;#"&! 32654&#A{>ÍÙ¿J‹xÜn†?MãÍÈüƒý‰þ’••’¼~þh–býñ–ªômÖØºOýƒ…Hÿ¢œ¼#(07#5#"''7&546;7&'&#"5>327354326=-¸?¼ˆ‡\g`n;ýû)ž T—`¶Te¾Zçx”_¨9»58¯þ¼>c™¹ýÅåc3Výªfa<}N…V{½À¿ E..ª''r³OËs+Aºþx.Ù´)þâ 3{ ÿèÿB“333#;#"'&'##53w1ÀªÀ ÑªKs½½ÕQ fªÖ‡‡žþÂ3ýÍþo‰NšP þÖr>ÿÿÉþ¿Õ6ºþå!#4&#"#3676323#d¸||•¬¹¹BYZuÁcc¸¸žŸž¾¤ý‡ýže22wxèýõþLÉþ¿jÕ%3###3!Á©ÅEý3ÊÊžýªþAÏý1Õý‰wýHºþåœ33 3###º¹%ëý®ÌŸ¸8ýǹüiãýôþEþL#ýÝ\þ¿èÕ !!#!5!s•üPÉû=°ügÕšûoþAš‘Xþå“` !!#!5!qjýLl¸ü}´ýe`¨üÛþR¨%sÿãwñ-@••Œ‘¯ üìÔì221/ìäôÄìÄî053#5# !232#"³ÄÄMì¥þòþ¬T¥ìüßêÌÍëëÍÌêíèú+ç„€«\\«€ýxþãþ»EEþ»ÉþfÕ! !+53265##É-}-ÍãMD†nþËþÄÕüøú“þòôª–·üúáhÕ %!#3!3¼ýÛ…åýÇÒˆ¡ˆÕÇçüRÕþsÿãwñ%#3>3 !"&#" 7ÄÄMì¥Tþ¬þò¥ì!êÌÍëëšçèÕç„€þUýHþU€k:Eþ»ýÆþ»=à{0#3 632#54&"$þ·úþ\Ã^TÞƒ¹²Qr)mü“`üTæá¿†rr:T*D ð # #3 3 67632#54&#"fþÉþþÅþÂþþŠÌ:9ã:76&7#"733%3úhþôÒþÿþݺ “ÙkÀjþw”Ó˜¼„rq¿-xÑž‡¡«–D|Hv`ÓQ°¯~ý®°ûPþH_##"$'5332654&76#"#3$32¨¿þ¾Ò°þØ »Ÿ”•·Ç$Zh‘ü9¾d½RÔ™¶°½ËŸ¬YP[yƒ„è¸f®®ýãP°°°ÿë”u .63 ?# 6%#"?3327632#5&7$ªùþÔ'Ež‹ ÂÛÛ¬þœ99 …Z….¤ Ä IBÊÑa¡uy¤h$4Q´ Êþ(¼×  dcŽáZe~ˆPA45Gx=%'þ” þƒiþK_#6#"#3$324ÑRhi‡þÑFÄu¿~Òuþf¨®®ýƒ°°°°üÕPþå_#6#"#3$32$32#6#"ËUlh’þâQ¾tÀxÊl“ÕžÁ‰o‘þìkþg¨®®üÔ_°°°°°üQ,®®ýXÿ $6#"72767#"7#"'53;73$32ÉiþÙO_Ô{k¿'þÍþøˆÓjh¶°Æ jW°z{Ó+®®ýΆ8B~÷BA¯ÖDæéýk6þY±±l4_ "6#"3%$32#6#"#7#"73$32©eþ»Rr;'iŽÔ›¾‡hþ삸þ{«Ú$¿™Ö,®²þ ®°}°°üQ,®®üÔÈȯ°´´ŽW_!#6#"#3$32¾¿ˆh“þÜ5¾^À‰Ø ,®®þ‘¢°°Àhþs‡ 6#"32%##"73$32¡oþÇNq¯ªmÍ]þЬÓIÓ4’Ó,®®ýõ®¿ý‰‘À¯ãýïǰ°P9_ "6#"32%#7#"76##3$32$36eo‚þ´NmˆIÁþy»·[fyþ¸_¿ˆÁŽÈ–°Â,®ýõ®®þο¿¯}®¬üÔ_°°³³±mÿïÇ )32767$76%&#"#"=3326323¢ýïE¶syx cÀ»Òþ·VÏ&J]ÕzÃ7S²r¬#1XÛ-ƒþõ;=m¤ý; @@û]¦kr•¢w?|ÀþÓ†P[‡!#6#"#'! #5&#"$36¶À“iþÚs¿™" …¼­þ ~ŽÛ ,®®üÔ8Ó|¡{aA£þ¹t°±h_%#"7332%332%3#7#",þ’œÒ¦¾“r‡ÀŠ\iÀ“Áþ€Š¾¯¯¯°üÓ®®-üÓ®®-û¡¯¯hr_%#"7332%3#,þ’œÒšÀ‰rsÀœÂ¯¯¯°üÓ®®-û¡Žþ#‡#7#"7#"73327332%3ÒLþ½ÊBþì©\ÎNt2Ö¾Q BizÌhþN„Áºˆ—×þºsýã^yÜ®ý'üŽh ‡3$32#6#"#7#"73325mTÍ@ rÕœ¾‡hþæsÀþœœÒ˜ÃŠr2Uý¡y°°üQ,®®üÔ¯¯¯°üÓ®h]‡332%3#7#"7íMÜ7ph^ʈÊþœœÒa&ý×üÔ®®-û¡¯¯¯fþJ_6#"$7327! 3$36ˆjþÙeü¼!ýDu˜ŽÎcÂþàþú¥2нx‘Ö-+®®ý9KžìF›Æº…¶F4DZ±þËhþJ%#"7#"7332%332%'3#Þþ€ŠÈþœœÒ¤À“r‡ÀŠ\h$ËxmЯ¯¯¯¯°üÓ®®-üÓ®®,ìþçüiý„{þ"_ -6&32%6#2%#7#'#7!"3$32$32ožþçGp¯ }Yþ¯H••·þÖ–t UÎ@þýþñÔ,t¿SÔÀP×Ã-mn°þ­®ú¯¯þ®¯þϯ¯-;þ,Ìů1.±±±±þÍdþE‡%##3%3%73#mgÎQ6þZÄ{ÇO¦BUÂE3 Ë{ÌPþ\oý¯R„{íoýø†»Sý{þ«xÀüŸ~P\_$32#6#"#3–{ŽÕ›É‡^þÙqÁž¿¯°°üQ,®®üÔ_hþr`%#"733273#þ¯›Ò”¾róˆÉœƒÚ¯¯¯°üÓ®®.ü@ý~hþh_%#"7332%3!#532$þœ™Ò˜Â‰riÀr;þ.þÛUIçY¥¥¯°üÓ®®-ü‘þWþ׋ßPþT‡#3$32#6#"|jcÚK—JÄ={Õ‹½th,ýýØ8ý³‹°°üQ,®VþA`27#73$32 #6#"[wËXÐÚûþâ$’½(æÔ+‚¾~£sþ÷e¡þ­z²3ö±°þÍýæ®®ýÎÚzÿîŇ3 7# %33–ýüCÍ8id,ýÛþ©*>'ÂjÒKpð'µþ2Ö²·ý\þæ-XºC)ýÙPþö`!6#"#3$32$32#6#"ôs_‘þà`\ÚDˆÀuÉi–ћ‰qþët,®®üõýýâ`±±±±±üQ,®®üÔ<þ\_ #6#"6 %'73 &!"#3$6"À)gþÜ]ê—³ý´éëÝå þسÅÅÆ,ßÐ*#®±ý—sþþ^Q¾zßn(±²þË`þa_3 73!Èý8`”¾‹!TÀ^$ý97çþCÿü%ðëüÓþÿþ‹Fþ`‰$# /33 73$'#%&'R$w­þËòþèØ¡a‘¡ýõÖ°;þÿ¹Ë"›,ƒ«ØÜÒdíRmQ”ýrþ¾®<‰z°¾þ–×¿ËøP_!#7#"6#"#3$3232%3xÂþ–ŸÊ,IkƒþàfÃŽ¿ äÐZgiC^¿¯¯2ù®®üÖ^±±±ý„®®-dþ[‡6#"#!3#"$7#ˆi|þÆ]öþ1³*p®ê‘2xšË^À,®ªýýofÀCйþx£¯ýàzN! 33 767537632ÿ,ý¬þÑ*#Ë&Å8Oý|І…†ñ$2þÎ2þ÷­¹2šÂçÔ¤v;<ü|þm‡%#7#"33%3ãnÜOþ›Í,оŒ‡h*sNÓ;„ýš%l¯1.üÒ­¯!5ýÍhþÒ_%#7##"7332%3E½ÔmËJÅ@¿†roÃF_Eý¾3¯°ü´™Bzÿﻈ%3 7#6! 6%!#5&"% •ýþB«G½seþŸf)ý¹þÖ*IÄWÊ©À^3*Ù+½þ0²²³½Ê ýJþÎ2Á9R¾M?[–þº'þàqÿã» $@ E EüìÔìì1@¹ ¹ŒôìÔì0"32654&'2#"$54$–™··™™··™ù,þÔùùþÔ,g}ss}}ss}¤ÓÁÁÓÓÁÁÓsÿã§ð+2@ -! ‘ ,üì2ôì2ì1@• ­•&•‘Œ,äôììôì046$32#"$&%!327676%!&'.#"s~Ô&¢¢&Ô~~ÔþÚ¢¢þÚÔ~YûŠNÖwwkØ]ûŒ~ŠNÖwwkØ]êÑzzÑþâžþâÑzzÑIÊ‘S`0aäJùÉ’R`0aåIsÿã§ð"'I@"•$$#) ‘#(üì2ôì2ì9/<ì21@•"#­•!%•‘Œ(äôì2ì2ô<ì2046$32#"$&7)6&')s~Ô&¢¢&Ô~~ÔþÚ¢¢þÚÔ~Û µ¤þ&µ þõµý\ÚµþõêÑzzÑþâžþâÑzzÑIÉþæ!ýû!tÉ!ýü!þæ@5Õ c@  •  ÜÄÔÄ1/<ôì990@    BKSXíííí@   Y"5! # #7!v•þ(ðþvþuðyTýW+ªšýýFý麣ÎC8Õ c@  •ÜÄÔÄ1/ä2ì990@    BKSXíííí@   Y"%!5 3 3!ûkÌýþð‹Šðýþxþ«©ššªqºýéýF£þ2@ÕÕj@ • •  Ü<Ô<Ì1/ì99ôì990@   BKSXíííí@   Y"! !7!5 5!ÙýWXþ´©þ¨wÑûkÑþ/•+þWý(©–ýÁª L?ª –èÕ #@‘   ÜüÜüÜì1/ô<<Ì203#3#3#ÌÌýzÌÌDÊÊÕÿÿÿÿú+ÿÿhÕ0ÿÿhÕ9ÿÿÉ‹Õ(ÿÿƒEÕP–ÿãàð #/3H@5E1-0 !'E4ü<ì2ÄÔ<ì2Äì1@3¹00* ¹ ¹‘4¹*¹$Œ4ôìÔìôìÔì9/ì02654&#""$54$322654&#""$54$32!!»™¹¹™™¹¹™ùþÔ,ùù,þÔù™¹¹™™¹¹™ùþÔ,ùù,þÔý7 ü`s94488449¤Žƒ‚ŽŽ‚ƒŽü¸94488449¤Žƒ‚ŽŽ‚ƒŽ\ªÛ}Õ:@   ÜÌ2ì2Üì2Ì21@• •­‘• /<ì2ä2ôìì20!!!!!!!!5!!Û ‹ þ¿AýõþuýõAþ¿ÕýœdªûªÇý9ª\RÕ T@ •   ôì2ÔÄ91/<ôì0@  BKSXí<<íííY"!#! #!&ʬþ,ïþPþsæýÕšývýOÓç–~Õ -@ •¯•­•  Ü<Ì2ÜÌ´? ?]1/ìüìüì03#3#3#€þþþþþþþQÍþIÍÕÍ\RÕ T@ •   ôì2ÔÄ91/ìô<0@  BKSXí<<íííY"3 !3%!cïýÔâûTÊþsæÕýOývšÕýéÓüsÿã§ð+7@ •&-& ‘,üìôìì9/ì1@ !• •‘Œ,äôì2ì2046$32#"$&767>54'&'&s~Ô&¢¢&Ô~~ÔþÚ¢¢þÚÔ~Õ.]Ø=@µN\ªµN\.]Ø=êÑzzÑþâžþâÑzzÑž}qäa ³!ˆSáÝûM!‰Rá}|påasÿ•§?#-n@.  '&$ /$ ‘.üìôììÄ9999991@ .'& ) )••‘Œ.äôìì/Ä9999999046$327#"''7&7&#"4'32>s~Ô&¢ãÄ ‚n€~ÔþÚ¢äÄ œnÕ‘ê§wÖœ\Š‘ý§wÖœ\êÑzvÄiÂjþÞžþâÑzwÅkÁj!žæ®˜^`¥á|å¯üg^`¥á–”Õ .@••• •¯  Ü<<<Ì2221/äìÜììÜì03#3#3#3#–þþþþþþþþÕÍßÍáÍáÍ)áÕ:@ ¯ ÜÜÄÌ1/<ä0@íí22íí # #3².èþ]þºæèºýFýâÕÉ;Õ -@    üüÜüÜüü1@ ‘• ­ /<ô<ìä03!#!#!ÊÔÊý"ÊÔÕýœüÇý9q><Õ@  ÔÄÜÄÄ9/ì1´€ ]@¯ /<ì220K°BPX@     ìììì@     @ ííY333 # #‚ÚÊ Øþ Øþ\þXÚÕþdœþsý3üø{ý…–¢Õ 1@• ¯•  Ü<Ì2Ü<Ì2´??]1/<ì2ô<ì20%3#3#3#3#¤þþþþýòþþþþÍÍÕÍûÅÍÕÍ\Õ 7@••  ôìÔÄ91/ìôì0@ BKSXííY" !!!!&æýâûT¬üœdDçúÕÕšûo–h’h $@    ÜìÜìÜìÌ1/<<Ì2203#3#3#ÆÌÌþhÌÌþhÌÌhÿÿÿÿÿÉ‹Õ7o–Õ !@ •¯• /Ì2üÌ21/ì2ôì20!!!!5!!o&þÓ.üÚ-þÒÕªûªªoÿâ1ð/,@!•‘ '•,Œ01*$ 0Ì2ÜìÜ2Ì1ä2ì2ô<ì20!"'53 !"563 676!2&# !27# '&Ð%4Âþ¬€rmyþðÿymr€OÇ4%%4ÂT€rmyÿþðymr€þ²È4*B6Ð!¯*:'(8)¯ Ï6AB6Ï ¯)þÈþØþÙþÆ*¯!Ð6oÌÕP@   Ô<<Ì2ì22Ô<<ü<<Ì21@ • • ¯/<ä2Ü<<ì22Ü<<ì2203!3!!!!#!#!5!!5!!‘Ê’ÊþëþëÊþnÊþÞ"þÞ"Ê’ÕþxˆþxªþŽªþy‡þy‡ªrªªþŽrÿÿÉ3լ̈Õ@•¯•üìÄ21/ìüì03!!!̼ýòÕªûªÿÿÉ“Õ,oÌÕ7@   /<<Ì2ü<<Ì21@•• ¯ /äÜ<ì2Ü<ì203!!!!#!5!!5!¿ÊCý½Cý½Êý°Pý°PÕþxªþŽªþy‡ªrªÉ•Õ7@ ¯üK°TX¹@8Y2ì21/ìÌÌ0@ 0 @ P ` Ÿ ]73#3#ÉÌÌÊÊÍÍÕû¦Ÿÿã¤Õ>@••‘Œ üÄìÔÄìÔì1äôììÄ0@ BKSXíY"47!5!32654'3! $Ÿ¾»ü¤¬ýx·ÅÛÉâÕË¿áþ»þ¹þÎþ¹ßwNªªþetäw–¤ˆˆ³Îà¡Îæùcÿã­ð #/9@1E- !'E0ü<ì2Ô<ì2ì1@¹ ¹‘0¹*¹$Œ0ôìÔìôìÔì02654&#""$54$322654&#""$54$32ˆ™··™™··™ùþÔ,ùù,þÔù™··™™··™ùþÔ,ùù,þÔPIIPPIIP¤¥˜—¦¦—˜¥ýPIIPPIIP¤¦—˜¥¥˜—¦sÿã§ð'(@ ) ‘(üìôìì1@ •#•‘Œ(äôìì046$32#"$&732>54.#"s~Ô&¢¢&Ô~~ÔþÚ¢¢þÚÔ~Õ\œÖwwÖœ\\œÖwwÖœ\êÑzzÑþâžþâÑzzÑž}á¥``¥á}|á¥``¥ásÿ‘§ð,P@  ! #.# ‘-üìôììÄ9991@ ! (•(•‘Œ-äôììÀ99046$32'#"$&73277654.#"s~Ô&¢¢&Ô~l¢§Äå¢þÚÔ~Õ\œÖw§þ‘ƒj\œÖwwÖœ\êžÐzzÐþâžžþàiÇkÊwzО|â¤`^¾jþI®å|â¤``¤âÉ;Õ -@   üüÜüÜüü1@ ‘ •­ /ôì2ä203!3!#ÉÊÞÊþ,Êdqý9ÇüýœdÉÇÕ (@ •¯•­•  Ü<<Ü<<Ì1/ìüìüì03#3#3#ÉþþþþþþQÍþIÍÕÍ–hÕ ?@•¯ •­ •   Ü<Ì2ÜÌÜ<Ì2¶??? ]1/<ì2üìü<ì20#53#533#3#3#hþþþþýþþþþþþþÍú+Í„ÍþIÍÕÍsÿã§ð'+>@- )(( ‘,üìôì9/Ìì²/)]1@+Î(­•#•‘Œ,äôììôì046$32#"$&732>54.#"3#s~Ô&¢¢&Ô~~ÔþÚ¢¢þÚÔ~Õ\œÖwwÖœ\\œÖwwÖœ\ÆþþêÑzzÑþâžþâÑzzÑž}á¥``¥á}|á¥``¥áÍsÿä§>,P@  %$#& !.! ‘-üìôììÄ9991@ #&$%(•(•‘Œ-äôììÄ99046$327#"$&732>54''&#"s~Ô&¢äÄ ƒžn~ÔþÚ¢¢þÚÔ~Õ\œÖwwÖœ\þ”‚p§wÖœ\êžÐzvÄiÂkþàžžþâÐzzО|â¤``¤â|å®þ?lÆ^`¤âsÿãrï%1=G@8&,20>üìô<ì2Ü<ì21@/•;• 5 )•#•‘#Œ>äôìì9/ì/ì0! #"&547 !&54632! 32654&#"4&#"326s†S“_ ™…„™þþþû™„…™ _þmþ­þz™,,,,,,,,égŸs'O;‘‘H6þ¾þâþâþ¾6H‘‘;O'sŸz<11<;22‡<11<;//dÀÕ #@• ­¯  Ô<Äü<Ä1/äô<ì203!!#!5!­ÊIý·Êý·IÕýjªýk•ªÿÿ=;Õ;sÿãrï3?Kf@•F4%+6:0Lüì2ô<ì2Ü<ì29/<ü<Ì1@•=•(I• C (7##•1•‘1ŒLäôìì9/ì/ì/<ì2ÌÄ0! #"&547"333###3&54632! 32654&#"4&#"326s†S“_ ™…„™î—»ÌééÌ»—…™A;…þïþ­þz™,,,,,,,,égŸs'O;‘‘H6¢Šßÿÿªÿÿߊ¢6H‘‘;OO4Ÿz<11<;22‡<11<;//É‹Õ;@ •••­•  üì2ÔÄÄÜ<ì21/ì2ìôìî20²]!!!33##!!!ɰýÌêêÌþïøü>ÕªþFÿÿªÿÿýãªÿÿhÕ)É;Õ@• üìÔìì1/ìô<0)3!3;ûŽÊÞÊÕúÕ+ÉyÕ=@ B• ü<Ô1/ôì20KSX@ììììY!# 5!!±èßþ!°ý8ßÀkªªýšsÛÕ#O@%$!  /<<ì22Ô<ì2ìÔ<ì2ì1@• • /<<Ô<ì2ô<<Ô<ì2032653#2#4&##"#3"3ÂÊŠòÓþ‡ÖÖyÓòŠÊŠòÓyÖÖþ‡Óò+ªþVâÈþîþºþÛþºþîÈâþVªâÈF%FÈâÉöÕ.@ ¯üK°TX¹@8YìÄÄ1/ìÄ0´í!##ÉÞþuÄÕý-úásÛÕ+f@- ,&'  #+ /<<<ì222Ô<ì2ÄìÔ<ì2ìÄ1@+¹* •  #•*'"/<<Ô<ì2ô<<Ô<ì29/<ì205!5"3332653#!!2#4&##"#35ÁÖþ‡ÓòŠÊŠòÓþ‡Ö¿þAÖyÓòŠÊŠòÓyÖ•ª>FÈâªþVâÈþîþº>ª=þºþîÈâþVªâÈF=6-éÕ@ ÜÌÜÌ1/ÌÄ20!3!3éüM•-¨þûþn¬^$36767#"&546?>7>5#53ó¿ Ya^Ág¸ßHZX/'ÅËËÅ-93B$ÍüS #C¼98ŸL‰VV/5<4þú¾®-5^1Y7ÿÿÙŸÛ2& Æ OþW°:X!##°¨ð¸ýµÇ:o#5!#¶ï¨¹…ý&°þòXÌ3!3hðþX¸ÚÇþòoÌ!533oþXï¹þòKÿÿ“°ðMÿÿªþ¼‚Õ'Øü6Øÿÿªþ¼‚Õ'ßü6ßÿÿªþ¼‚Õ'Ûü6Ýÿÿªþ¼‚Õ'Ýü6Þÿÿªþ¼‚Õ'Øü6Ýÿÿªþ¼‚Õ&ØÝü6ÿÿªþ¼‚Õ'Ýü6ßÿÿªþ¼‚Õ&Ýßü6ÿÿªþ¼‚Õ'Øü6Üÿÿªþ¼ƒÕ&ØÙü6ÿÿªþ¼‚Õ&ߨü6ÿÿªþ¼‚Õ'ßü6Øÿÿªþ¼‚Õ&ØÚü6ÿÿªþ¼‚Õ'Øü6Úÿÿªþ¼‚Õ&ßÞü6ÿÿªþ¼‚Õ&Ûßü6ÿÿªþ¼ƒÕ'Ûü6Ùÿÿªþ¼‚Õ'Üü6Þÿÿªþ¼ƒÕ'Ùü6ßÿÿªþ¼‚Õ&Üßü6ÿÿªþ¼‚Õ'Ûü6Úÿÿªþ¼‚Õ&ÞÚü6ÿÿªþ¼‚Õ&Þßü6ÿÿªþ¼‚Õ'Ûü6ßÿÿªþ¼‚Õ'Ûü6Øÿÿªþ¼‚Õ&ÞØü6ÿÿªþ¼‚Õ&ÞÛü6ÿÿªþ¼ƒÕ&ÙÜü6ÿÿªþ¼‚Õ&ÝÝü6ÿÿªþ¼‚Õ&ÚÚü6ÿÿªþ¼ƒÕ&ÙÞü6ÿÿªþ¼‚Õ&ÛÜü6ÿÿªþ¼‚Õ'Þü6Øÿÿªþ¼‚Õ&ÛØü6ÿÿªþ¼‚Õ'ßü6Úÿÿªþ¼‚Õ&ßÚü6ÿÿªþ¼‚Õ&ÜÚü6ÿÿªþ¼ƒÕ&ÚÙü6ÿÿªþ¼‚Õ&ÝÞü6ÿÿªþ¼‚Õ'Ýü6Ûÿÿªþ¼ƒÕ&ÞÙü6ÿÿªþ¼‚Õ&ÜÛü6ÿÿªþ¼ƒÕ&ÙØü6ÿÿªþ¼‚Õ&ØÜü6ÿÿªþ¼ƒÕ&Ùßü6ÿÿªþ¼‚Õ&ßÜü6ÿÿªþ¼ƒÕ'Ýü6Ùÿÿªþ¼‚Õ&ÝÜü6ÿÿªþ¼ƒÕ&ÙÚü6ÿÿªþ¼‚Õ&ÚÜü6ÿÿªþ¼‚Õ&ÛÛü6ÿÿªþ¼‚Õ&ÞÞü6ÿÿªþ¼‚Õ&ÜÞü6ÿÿªþ¼ƒÕ&ÛÙü6ÿÿªþ¼‚Õ&ÛÚü6ÿÿªþ¼‚Õ&ÚÞü6ÿÿªþ¼‚Õ&ÜÜü6ÿÿªþ¼ƒÕ&ÙÙü6ÿÿªþ¼‚Õ&ÜÝü6ÿÿªþ¼ƒÕ&ÝÙü6ÿÿªþ¼ƒÕ&ÜÙü6ÿÿªþ¼‚Õ&ÛÞü6ÿÿªþ¼‚Õ&ÝÚü6ÿÿªþ¼‚Õ'Ýü6ÚÿÿÉìÕ%ÿÿÉÕ3F Õ%#"3!"$54$;3@þššÈþ8ûþÿûþʦ1’‡†’¦ãÛÝâXÿÿɰÕ'ÿÿÿúéÕ7ÿúéÕ)5!3!éû˪+úÕÿÿsÿã‹ð*ÿÿÉjÕ.ÿÕvÕ !#! !3vÊýbþüåüæ ÍÊwý‰¸ý1ÏÿÿÿãOÕ_ÿÿsÿã'ð&ÿÿsÿã'ðHÿÿ\Õ=ÿÿÉ#Õ)ÿÿÉ#Õ ÉÿÿÉÕ0ÿÿÉ3Õ1ÿÿÉjÕ/ÿÿ‡ÿã¢ð6ÿÿÉTÕ5;ÆÕ.'3;3! &546#"3A{>ÍÙ¿J‹xÜÊþ8ÿüƒwþ’••’~˜þ–bwú+ÖØºý±‡þú…ÿÿhÕÿÿhÕ9ÿÿÉ;Õ+ÿÿ£ÿã»ð ØÉò.#"#632[ÂhqÊÓ÷`¾˜ìQQ•Ëüîê,ÿÿD¦Õ:ÿÿ=;Õ;ÿÿÿüçÕ<‘´Õ !"3!"3!"&5467.54$3!êþ¼££DþÕ”‘‘”õýüçú€|•¥û #‡‹Œ…ýšÂorqp¦À±‰¢ ˘ÈÚÿÿhÕ$ÿÿhÕêÿÿÉ‹Õ(ƒEÕ )5!!5!!5!EüPæý9ÇýªºªªÿÿÉ“Õ,ÿÿsÿãÙð2ÿÿ²ÿã)Õ8²)ò*@ 8AüK°TX¹ÿÀ8Yìüì1µ •‘ /<ôì03! #4&#"²!!Ë®Âî¤$*þÖþÜü\‹ðÓÓðüuÿÿ©Õ ÙsZÕ@  2üìôì1¶• • /ìôì0# !3! !ôþËþá5ôÊþaþPþh–²/þéþÔþÒþè/ú+j‚€i¯·>!!¯þø>þÂ’þÀ·>!##¯¤¤‡>þÂþÀ@ÿÿ¯>'Æ_Æÿÿ¯þÀ>'Ç_Æ’þÀ·# !##!!¯¤¤‡þø>þÂþÀ@#þ¯·#!!!!¯þøþø>þÂ#þ¯Ö!!!!ýþøý²Vüª>þÂÖ¨¯`¢!!!!¯VüªVüª¢¨ðªÿÿrÿãðiÿÿdÿã¼{jÿÿÉÆÕXÿÿ¦n`+vÿãú)4>@01, *$6E5üìÌÌ9ÔÌìÔÌ1@ $• *•Œ05Ì2ô2ì2Üì0#"'&'&#"#"'&547673!27676323 4'&'3úftê[na`zxz{Ân[êtfCGoù~[UŠ]LKf›dKJ]ŠU[~úoFCþò‹žD@@DD€D‹òÆâì˜kóâ¶þº63366336F¶âók˜ìâ˜ÿã¡Å!<@!  # E"üìÌÌ9ÔÌìÔÌ1@ ©© Œ! "Ì2ô2ì2Üì0!"$"# 33276762324ŠþrTþÕðþÔRþrŠÆ’Ð>IxdüdyI?Ð’ÅþãþëþPââ±þ¹úþû8[ 77 [8øGÿÿ<rÕ&¾,ßÿÿ>Š{&ÞósÿãÐð   !3#!! ! þHþÿ¸Ò0ÊÊþÐþ˜þÅþÆþˆx:;hLþ¸þåþæþ¸HÅ–ú+•þèþf¥ab¥þgpÿãû{ "326&33###" r“¬¬“•«¬hÕ¸¸Ð þùñðþîàùßéÇÈèç’çþ¿û  øþÒ98þäÓ¿Õ3#!#!#3! !¡å9Òˆý_ˆÕüþ:ÊÊoþî%Õú+þ•ýkÕýjÏýÁÿã{"-#5#"&547!#3!63!54&#"5>32"326=¸?¼ˆ¬Ë/þø¸¸Òj•§—`¶Te¾Zóðþ‘߬o™¹ýªfaÁ¢sPý÷`þA"‹..ª''üþ´f{bsÙ´)eþ¿Õ767!!3##!#!!¬†&aOý)ªªÊü¨ªþp(”ª?x4&ªûþAþ¿ëÔþ þµD+kþåç`76765!!3##!#!!°[(bRý£““¹ý-“fþ}v“(UÓ©Ô“üÆþRþå®:ŒþdÜ6TÕ356765!!#!TÝ:WOý)Êþfbª0£ödþªúÕ+¸ýÊþøýLÑ`356765!!+!L»3DSý£¸þ{X^™}¦з“ü3ÍoþPÂÏÉöÕ! !!+##É-}ý)Åþ„ËþÄÕüøªúÕü úẬ`! !!###º >?hý£¹þ˸þʹ`ýî“ü3°ý'ÙüPÿÿsÿãÙð'yâ2ÿÿqÿãu{&Ry.ÿ„sÿãeð3#%3# '&76   1ÓÓ¤ÓÓñýLÐÏÏдÐÏÏþÈþþà æ Fþþþý›ÒÒÄÓÒÒÓý<Ò—þ¸þåþæþ¸HqÿãC{3#%3#"32654&' ! ¼ÓÓhÓÓJÃãáÅÂãã Iþ·þàþßþ¸HÊþþþçþnçèÈÇéœþÈþìþíþÇ98ÿÿsÿã jð&#'yryâÿÿqÿã¶{'yoÿ„'y.ÿ„$:þWÎñ '/7?GO€„%3#%3#3#%3#3#%3#"264"264$"264"264$"264"264$"2642+ '&' &547"#"&546;&546 676 3#J††ý††ýþø††"††ü{´ii´h ´ii´h©´ii´h¡´ii´hý†´ii´hþ´ii´h©´ii´hG««4«þãUUþâ©3««2©UU«4ý¯††œœœIœœœþFœœœ]Ž÷ŽŽ÷äöŽŽööŽŽöþ9Ž÷ŽŽ÷ŽŽ÷ŽŽ÷þ7Ž÷ŽŽ÷ŽŽ÷ŽŽ÷R̬©Ì\…«Ëdfʬ…\Ê«¬ÌZ…«ÌeeÌ«…ZþÒœÿúþfÕ!!!2+5327654&#!#!ïýqmÌäL>†87||þˆËýîÕªþFwrîþÎþòôªKKÂ"Ÿžý9+<þVH`!!3 +5327654'&#!#!<1þBúFRRQµÁ¬n!&&,‹þüµþB`“þªGQåþòÕa`œ07“¦$)þÍÿúéÕ!!;#"&!ïýîm†?MãÍýîÕªü×–ªô)<m`!!;#"'&5!<1þF##mXn¶PSþE`“ý¾‘.0œ`bÔ7¯³Õ*@  üì2ÌÔìÌ1@ • ­•/<ôìôì0!2#4&#!#463!#"z¡ºÞÉ||þˆË£µ àiM?ÎéîþfŠŸžý9?ÖÀœaÿÿºd(ÖX3#3Öªª¿ˆXˆû0Xú¨ÖX3#3Öªª¿ˆ$ˆüdXú¨ÖX3#3Öªª¿ˆðˆý˜Xú¨ÖX3#3Öªª¿ˆ¼ˆþÌXú¨ÖX73#3#Öªª¿ˆˆˆˆXú¨ÖX3##3sªªþ눈Xˆû0XÖX3##3sªªþ눈$ˆüdXÖX3##3sªªþ눈ðˆý˜XÖX3##3sªªþ눈¼ˆþÌXÖX%3#!#3sªªþ눈ˆˆXÖX!#!!^ˆGþAXˆÖX!#3!!^ˆˆ¿þAXþ̈ÖX!#3!!^ˆˆ¿þAXý˜ˆÖX!#3!!^ˆˆ¿þAXüdˆÖX%!!3^¿ý¹ˆˆˆXfœŽä 3'#'^9÷L’k“LäÝCƒýU«ƒCf˜Žà #'737—9øL“k’L˜ÝCƒ«ýUƒCÜCà 3#3#'À€€ f *ŽDþ‘ÈÈÜCà #53#73C€€€ fRŽü¼oÈÈÿÿÃCDÿýd‰ÍÔ35 !5 !5 ÏJþ¶Jþ¢ ®¸ £'£Å¢þŒåcmþûþZ‰‘`35 !5 !5 »,þÔ,þÔá„ ™|™˜þèžMY¼þ¸sËJð 5! -u¤‹×ýãÍþþÒ.1Ô ÛsVJ{ 5! -u¤‹×ýãXþþÒ.1Ô ½Éþf;Õ3!3+53265!#ÉÊÞÊÍãM?†ný"ÊÕýœdú“þòôª–Â_ý9ºþVd4&#"#3>32+532765¬||•¬¹¹B³uÁÆ£µF1n!&žŸž¾¤ý‡ýžedïèýHÖÀœ08’ÿúþLÕ*!!!2!"'&'5327654'&+5!#!ïýî^þeicUQ˜˜þès‚‚j~‰Àcd\]¥®ýžËýîժ˚þ8+lhŠÜzy$Ã1KK†IJ˜êüJ+7þL4ž02!"'&'5327654'&+5!;#"&5#533!AicUQþÐþè^cdjTÈm¾cd\[§®®ýjKs½½Õ¢‡‡¹eÜ8+lhŠÝò%Ã12KK„KJ¦óý¤‰NšŸÒ`>þ¨ÿÿ¤ÿã{ðR…þgÈ|1&'&547632&'&#";#"32767#"$546‹p<HmmFE˜MU…ˆUU8¾%ðåÁº~` !!!!#ºÄýöÕþ+º`”þÓ”ýõÿÿoÿãÇ{V îÕ3 3#!+!# ! !JåÐÑå9Òˆý_ˆÒˆý_ˆÕ¬þî%sþî%Õû>Âú+þþýçý{ÿã'{ 5@M"326=%#5#"'#5#"&5463!54&#"5>3205>32"326=63!54&#"¾ß¬o™¹²¸?¼ˆnQ¸?¼ˆ¬Ëýû§—`¶Te¾Zóxe¾Zóðþ‘߬o™¹ýˆ5yǧ—`[A3f{bsÙ´)Lýªfa' ªfaÁ¢½À‹..ª''~D''üþ´f{bsÙ´)hn¦<‹ÿã -ð 3676! ! '&'!# !  Jå¸-p¼;:xþˆþÆþżP.ýgˆÕ¬þî%ˆþHþý¸Õþ®}Òþ[þžþŸþ[ÒXrþý%þ¸þåþæþ¸H{ÿã{{"-82 '&'#"&5463!54&#"5>3 6"326="32654&yðþîþˆ7!`Œ²±Ìýû§—`¶Te¾Z*qŠþO߬o™¹”¬«•“¬¬{þÈþìþíþÇ>RE‡aÁ¢½À‹..ª''½½ý¸f{bsÙ´)¬çþnçèÈÇéÿãqÕ !3!2653! '!#¼þî%þ{å¼J®Ëþßþæþsv%ý_ˆÕý®ûrÀÓð‹ü\þÜþÖ4hþ{ÿã{(3%#"&5463!54&#"5>3232653#5# "326=“H¢²±Ëýû§—`¶Te¾Zóð||•­¸¸C±uþåþÛ߬o™¹ßoÁ¢½À‹..ª''üÿ¾ŸŸ¾¤{û ¬fcPf{bsÙ´)´Õ !!#3 3¼þî%Ljý_ˆÕ:åÜ×ÒýÇýýÙþÕûáú+{ÿãN{ ("326=5#"&5463!54&#"5>323¾ß¬o™¹?¼ˆ¬Ëýû§—`¶Te¾Zóð^Ãþ\3f{bsÙ´)ýͪfaÁ¢½À‹..ª''üÿþ5¬û ´Õ )!#!#333#¼þî%~gþY’åˆý_ˆÕ:ågécÒý‹i5ý¨þþÕüR®ûª‹{ÿãN{"-0!5#"&5463!54&#"5>32333#"326=!#u?¼ˆ¬Ëýû§—`¶Te¾ZóxgƚÛ›ÑÓþ߬o™¹GªfaÁ¢½À‹..ª''~mÍþcýÍ3f{bsÙ´)þþV›Õ !+53276?!#3 3¼þî%lKMJ|Ø«L*+2ˆý_ˆÕ:åÏËÒýýqÆ?=ª$%…2þÕû@À{þVN{'2!5#"&5463!54&#"5>323+5326?"326=u?¼ˆ¬Ëýû§—`¶Te¾Zóð^ÃþN”|“lLT3þô߬o™¹ªfaÁ¢½À‹..ª''üÿþwjû8ÈzšH†B3f{bsÙ´)ÿÿsÿã'ð“ÿÿÿãõ{ jÕ33#! !##53ÉÊ¿¿žýþöý3Ê¿¿Õ¹ªþìwýHüãÏý1rª¤3!!3 ###53¹"þÞ%ëý®kðýǹ´´¬¤ý¹ãýôý¬#ýÝĤÉfÕ 37!!ÉÊü×ü_­(ý^Mý*ªúÁc37#Á¸ê¸œxýIüžåSœÕ 33#!!#53ûʨ¨×ü_¨¨Õà¤üYªQ¤xò 33###53Y¸áá¸ááþâ¤û®R¤ ÿãjð% 3#! '&#5376 !&'! 76;:¼¡~ °¼þÆþż± ~¢¼þHj´iüF w¸vðÒµþãþ¾ÄÓÒÄCµÒ¤¤†ÖÖ†þú—¤¤— ÿãŽ{'23##"'&'#53676"!&'&!3276Íð‰oÄÀ ~‰ðñˆ~ ÂÆoˆñ”V?s?V«ýƒLV•“VM{œ~ÍôôÍ~œœsUƒUuþ%«gstgsÿã jð$. 676! ! '&'!     ':¼/##.½;:xþˆþÆþŽ.$#.¼þÆþÅþ‡yþHþý¸þHþý¸ðÒ5==5Òþ[þžþŸþ[Ò4=<4Ӥĥ¤þ¸þåþæþ¸HHþ¸þåþæþ¸Hqÿã¶{ 1"32654&!"32654&'267632#"'&'#"´”¬«•“¬¬ü,”¬«•“¬¬“ð‰‰ñðþîðñ‰‰ðñþïßçþnçèÈÇéçþnçèÈÇ霜œþÈþìþíþÇ98 Õ32654&#%!2+3###53“þššþ8Èû€€ûþííÊ¿¿/ýÏ’‡†’¦qrÛÝqqÄþüÿûþV¤{&  533>32#"&'3##5å§þܧ§$ü½¿¹:±{ÌÿÿÌ{±:þþ¹d–ççþjçþgìªdaþ¼ýðþ¼adþÌŽŽ2™Õ'!2+##"&'&5476;2654&+ÕÈûþÿûþÊ-\0:32#"'#‘ ’ŽXS§þܧ¹3),4:32#"&å§þܧ§$þ5¹¿¿¹þþ:±{ÌÿÿÌ{±d–ççþjç+ý®›““þÅdaþ¼ýðþ¼a Õ326&#332+3##5#53“þš™Žþ8ÊþûþÿûþííÊ¿¿'ýÑ’ ‘®þøáþHâ^ddÿûþV¤&  533>32#"&'3##5å§þܧ§$ü½¿¹:±{ÌÿÿÌ{±:þþ¹d–ççþjçþg ý¢daþ¼ýðþ¼adþÌŽŽ ¬Õ!#!5!¬Êý)¡+ªÁþVy{3#\¸¸{ùöÉþVð3"&4&#"#367632o†ñÍš™³×ÊÊQfežãé}þ…–ªô}×ÕÿÞûñ‡CBþÁºþV{3"&'4&#"#3>32dJlÊ£||•¬¹¹B³uÁƤþçŽaœÁÕŸž¾¤ûÝ ®edïÿÿðÃ# Ib !5!5!5!bþ>Âþ>ÂI–––5áÕ:@ üK° TX¹ÿÀ8Yì991äÌ@ _°ï]0¶ P]3#5Ë¢Õýqþ›eŪoÕ7@ „üK°TK°T[X¹ÿÀ8Yì1ôì0@ @P`p ]#oªÕýÕ+ÿÿ¯³Õ»MþVT&#"3733#;#"&50# 7632’7M\P¸úú=x1F¿™<þèõ5„K9úüþ ýp|tœÌʆ½öÉþ¿ÝÕ !33#!#É–ĪªþðýjÄÕûáúÕþAáûºþå÷{3##4&#"#3>32d““¸||•¬¹¹B³uÁƤýïþRžŸž¾¤ý‡`®edïÿã9ð(%!5!#$'&''7&5!2.# !26Ãþ¶uþæ þ¢Æ(T+p‹^’opü‹þÆ+ûjŠk¨Õ‘¦ýSUÌ’â%n™HF×_`™—þÙ•þ_Ïw™%þV{&0:%!"&'5326=#"'&''7&53253732654'&'&#"Zþþúa¬QQžRµ´9²|Î~Ch!tüÎ|²9¸•!¶¹ýŸ.R”•¥ 2R–”¥‹þâþé³,*½¿[cbSp#c'8>:bcªþ±2c==ËW367'&'&#"d¸ýǹ•!¶¹B³uÁcJ‘!¬º 3>|•¬¤ý\j¾þTo2c=ƒ®edxY™1c90u@O¾¤_‹Õ$+#.+#'7! 7-&'&'#3767A{>ÍÙ¿J‹xÜÊš+ÅÈ~Ié+ÿƒý‰,J“þþ“J= ¼~þh–bý‰3BFk>dNU ºò³?(Bþ(D8cJ{.#"%#'73>32JI,œ§²!þ-¹•!¶¹:º….´˾4bœþTo2c<„®fcÿãð/.#"%!"&'532654&/'%&'&54$32HsÌ_¥³w¦T"+þ™W6lþÝþçjï€{ìr­¼‡šaýâ+eM0eõiÚ¤Å76€vceµw'8l¶Ùà0/ÐEFˆ~n|´w".`«Æä&ÿã'{/.#"%#"&'532654&/'%&'&54632‹N¨Z‰‰b”-º!þÖK,R÷ØZÃlfÆa‚Œe«$þO!#>&LàÎf´?®((TT@I! “cc (L‰œ¶##¾55YQKP%ca&Jƒž¬ÿ—ŸÕ#546;!3#!#-„vœÀÖÊÞÊÊý"Ê0^i1Fµ£ýœdú+Çý9œà3!533##!##53!5è€Îjjþ2€ii€Îà}}}\ý•Žþrk\\~~GŒä'1.#"!3267#"&'#"&54632>32$"32654ogW`uýë€sC~>?ƒCe˜3-„X˜¬¬˜X…*1’Zާýºml^]lUdaY2jpa==><¯š›®><<>£Lâ‚poÿÿº˜`ÜwÑÕ #!5!!5ÑÊý°PýpÕú+ɪ¸ªF Õ#";##"$54$3@þššþÊÊþûþÿû/’†‡’×ú+XâÝÛãÉÕ 3333! ÉÄËÅþÓþþƒÕúáüú+øüÉ“m3#ÉÊÊmø“D UÕ%3 3# # #3ô>ã:9Íþ‰þþÅþÂãþÆþÇÍwþÅûîú+úðîûÕÂЕX¶©ÄÔ1Ôì0!5!•þ-ÓЈœ½X'3ÖI(œsIˆnhäX#'3äþh'OÐý˜W™`4òX#'3òýòv5]ÐüdDàZùX#'3ù ýè|;dÐû07!œ½X#Öç(ýøXþ̈Iÿÿœ•$NþÌÿÿh½$OþÌÿÿn4ä$PþÌÿÿ`ò$QþÌnhäX#7äOýÙhþðˆ™Wý˜ÿÿh½$SþÌÿÿÂh•ðNý˜ÿÿ4½ðOý˜ÿÿnäðPý˜`4òX#7ò]ýËv¼ˆàDüdÿÿn4ä$XþÌÿÿ4½ðSý˜ÿÿÂ4•¼Nüdÿÿ½¼OüdZùX%#7ùdýÅ|ˆˆ!7û0ÿÿ`ò$]þÌÿÿnäðXý˜ÿÿ½¼Südÿÿ•ˆNû0±<0Ö^XµÔì1ÄÄ33ÖˆXú¨–:Ü #'+/37Ú·/$0(7,48Ü<Ü<<<<¶#+ 3'Ü<<<<Ü<¶ Ü<Ü<<<<¶ Ü<<<<Ü<°9̰XKRX°8K° bf °TX±30<xÖN\ašÄdþÁ‹Urn¯³$.%675!26! $547&# !&'$! $ cþ¹©ŸeÙþ'þ4'T­þû¨Ô‡8þø îþþõ…þåþïÃN!VÆmø³©ýÿ•ýÒ0w_Œšþ·cþ-þ±SÖR@@´]þžšþwloÿâ6³! 3!4!"#! 6þþ"ZÐn':þäóS¾E²·Èþé/þÑþ·OsÑþÿö ‰þ‹nÿâ6³! 3! 54'#5364##'! Íúü85Ä<'0¾ª[Üüþþ%º³»æ|sþ}þþàþ¨NsÍ(©P Úõšžnÿâ˳ &"673! ! 7! 547&5! 3ÑÖÑhfÀ=þÈþ´G=Âýÿýýe¾…‘ HÞ6ß´_c ýåˆþvKþ]›XKý¸RF¼”ÎŽþ.%@nÿâ ³ "! ! %!$#"! !663 Iþóþí W Ìþ÷ò×þ.þ<Îà•s÷ƒ’‚þ~ý“þ\¤›þFþúåÛÒyþíý-ý½Cm!æÚýén³## #! ›Æ¤õþۮȤã²ûþŠþ{C¸š~þ‚þfþSþ²y‚šýânÿâ6 ! 3 5+53$54'!6þþ+Î<'0ÒܯÿÈdúúÆþó$þÜþ®Dx<¨¯•¹¾mþ÷dcþžnë³5%67$5!26 63 #=# ###&!"6!&%$]s‘þ=0·èpdžm^ó®ßÍüýÿ¬ãÛ­þþø-²zþÐ(þ™þ›þɦxCóð{ë²»»²þgºþd±È?GçþZ¦þþZ¦çþ·yþAé #þv¥\[þÃnÿâ4³ &'  ! 5%254!"#! ‹j¸þÃ:%©þ2þãžþá™{²ºÔÚË?þÁ¸þ•býþ®îJÑùql|þc‚ÿâJ  !"! 7! )!"63 –þɨ5+´þþ#Qþ¬©Œé«OKþ&þ­DþúþèT‚ æÇUn†³ #!"#!"#!263 †þÇà^þòå·þ÷ë>×þÚ¾Þx‚¹ÉÂþfþØnUσþÏý‚‡(þ}þ1þ§þ–(›Ï!ððýßnÿâ6Ÿ! 73! 54'#53$54$536þ0þÇ5!°Úsþ]Ü{ëÿ×%þ0ß³³þÁ?CÀ-¶?°£rô–ŽÝ²ynnÿâ5Á% 3! %5'6%5%5þþ!¾!3ý×`ý¸¢þ]ÆÑþJþVO;2xÖþ}²ΰ_§‚ná³&#5% #! #5%$!$7 63 áþ¢ï‡þûþõÀþæþü”ëþ™Êüò°} ŠuÛÜ|þbþübIŒKþ×þ¢^(þ´•þÁþžw£üû þØ4ôô‚ÿâJŸ! 3! 54'73Jþþ#´+5ü-ÈJ-þRkûmþvIK³&™Ùæ|þûnÿâj³$3254'##533! 547 „XÑñïÍÖ’»“.úþ×þ©þ¼þÇÀܧ/ð³þ½˜þˆw™@¶DüíçD\þu±þ¶Ñþ&ÖÕI°R2ÿá'³! 3! &#"#&'#53263 'þ4þ8ËDB§Ÿž“Œ›Ki©qîýóê.þ×þ²5´©TþhMŒŸŸŸþ†nÿ⌳ 7! ! !#"$53;265+5765!"%5!263 Fþïþ÷2þ¿þédÏþµËÚ‚JÆè|;Ôþ÷…o&þIþ+ÃýmŒ»ªìØžvþ‹þy‡ýÀÔþÞÙ;€Í‰—‰ß5€p”rý×)‹ÇÁþZþå’{nÿâ5Ÿ! 73! '#'235þþ#7ÌE!?дÄB³<m¬Ý©ÊþèÝÜþ·N$²¨þÿù^þª¢nÿ⻳*7675!23 #=! # !&'$üxšþ`ÆÙ‰xæÆ¯åÖþýþñ«ýì³vS¥8þøýþïþß±b" K÷þùþ aëþ”`òTTþrþÀ@þ¨mþMþ­páRcE¾nÿâ4¡! 3! 54736734þþ!Â"!?¥þ5᳤›¨Åþ» þóþéDøc ¹(©ÉÔ”(þÚ t9nÿâ4³#&#  ! 5!4#"#54!5 63 ŒsÇþÛ`¨þ1þ ㈲®³¤þç6UÔKËÆIþrþŠ]þ ù=`|´::´ŸÀÀþ³ƒJ³74#"6#=&#! ¥Ä®›ÌÀÜèþÚ¹³U’uþæáhþ=^þýþ§u°®bü|ðÃþí’pÿâà# 325&+53$54$73‘ø(þåþþÆr׆Ì«¯¬ÀÒZ þã¸$®Œ{þöþâþ¸Hp,=þ‹ôþcþöþò­û£e‘ŒTˆnÿâ4Ÿ &# ! ! 5!63ŒzÊþäD¨þþ䦔¨£PþpYþqlýô>J=RIƒÿâI³$!26! #54#"67 ! 3! 5!"ƒ[È`%þ礧¯¦Šáþ þ0³Iþω¦y:½½Ÿ DD ›þžUþwýÛþ…q‹R`nÿâ\ ##3#! 73! # !3'33;#"[Ü?ž~Wþþ#;ÌH 5^áþgœ^%È"òüîòÕDŽõiþ¹þ5þèÝÜþ·NÅ-6¨¨þÏ¥G‚ÿâJŸ !! 7! 363–þË¢ˆ9&´þ&þµ¡‰éUþXþv€n_ýÑ%˜ý¼N2ÿâï³!%!5 65&%'%7764&#532ïMþ§‘PþÉþ™ÉþúséþyPjJ@‚œ„JKpÌŠ«þënÜÆæ zÀ(E•¾ŒÅÂS8›KJ²7Änÿâ5³&! 3! 4+53254'#53254!#53 35þþ!¾!-šçÓššççƒþmvvQ—©ƒ–™þIþœų„yµ™¸žþª›aN‡”Gnxÿâ>²& 3! 4'#5327&+53654!5 #\þµ0'ƒ©©lƒ¦¦oþ×矶­ÀæMû³þºà±ƒ}·´žþÒ¥Sg~€\VáþNnÿ_6³ $! 27#! 3"%#',$*þ×þÛ¾Ù?þêâäþå.ïÃþçþîÅÒþhxx˜¢ þ`û©S^¦;ýÁþ^þ¢þøO¾æçnÿâ4µ! 53! 5+53$#%4þþ%½%(òä{[ýµÁÆþºF–þLÔÓÝþÖ›¤­xìý¿žqþÒnÿâB´ ! 53! !#53$#3!2735þþ!¿ -þêÀng§ƒþ!¾!Þ}š þÕ)Èþ掎þºF`­»owÆÅáþ€¦œnÿâÁ³%!$! 5)4! ! %#$! 3#3„þÇþá&2ý¨9þÎþÚ þþ# þõä㌌ŒÞþÎþÔôbþºŸãûÚxþlÌ!j`?Ûþ~—¾þʸnÿâ6´ ,4&#  !"'!5 5!"! 5$7 6!|¦þÞ 'ºþ€šþ/þÚ‹™%þˉv'ºµÚþÙþkþÔ„ý݇žþl ôx'›Âýþ¯¥öýúØØþÄ¿zþù‡#32%$76#"##"6%3$32šýüBpr.«HZþãd ýD]Ï]þÇ©Ó*H$¼O¾H5ÁÔ*üN¨þ,®®®Fhú®Iý¡à(ýô‘¯2ùú:(ýjnþÍdþ(Ó0<$47'&'#&%'67$%&573265&5#"6kVoþrþb32#4&#"#9þó`M1¸C±uÁȸ||•­MM 7ÑÔB³uÁƸ||•¬¹e,'"¼xMü¬fcðç¦ýaŸŸ¾¤‘?'¼»Gzýžedïèý\žŸž¾¤ûÝ®þVã5<!"'&76763!!32653#5#"&5#3!#"&5332765!"3 þÛ•^SWsvÝ™||•­¸¸C±uÁÈáÕþsC±uÁȸ||•WVþÛƒƒ¶^S‘ƒBWþLýaŸŸ¾¤{û ¬fcðçüûB¢Vfcðçfþ¡ŸŸ__¤{{Š®þV ›H!&#5#"&5332654/&763!6763232653#5#"'&=4&#"#9þó`M1¸C±uÁȸ||•­MM 7ÑÔc%ZkÁÆ>8nŒ­¸¸C±l¯bd||x¬¹e,'"¼xMü¬fcðç¦ýaŸŸ¾¤‘?'¼»Gzýž2ïèã—XO¾¤{û ¬fcx{ä䟞¾¤ûÝÿÿˆ[B`&/þN VÈ 332673 &Vv aWV` v žþÞžKKJLÿÿJ[¢`&Cþç N~`27676=3#!5!cÁú\@º&@e‹¾xþjÁ`üQ£qò73>53³zíýK-b[;¸Iwz?þ‡í´-b\;¸2Nh`iþ——8^—Xþô d­wNjýi8^—X öVšnZ7X½`##!5!½ÊºüeÑü/Ѻ`#4.#!5!2%#¹ '>nŒiý+Õ…Ä”^;ûk¹íþíj‹t@,?]‘²EýT`X»`!2#!5!2>4.#!X×–è\##\ç–ý(Øq¨f==f¨qý(`Ai•™°™•iAŽ*HnušunH*X»!!3! \û\»¨ý¤ÑCþL„ü$º`)!2!4.#ú5£Óƒ5ûWï !3WmO`<Ù§½ü¾…^‚h=)X»`#4.#!5!2»ºTŒtüÈ7¢Ó‚5ý송m)<Ù`ÿøº`#4.#!#"'53265#5!2ºº $@pPþ${˜5NA&G.­CÁl,^ý¢`Jce:%ýÍÖÐr£3CŠ´Ù-Û!5!3!Ûúþ-¨--ª-ýÓÿÿXS–&!¡?ÿÿNS–&N?ÿÿXS–'Xü&!—?ÿÿXS–'Xü'!ûL?ÿÿºþ»Ÿ`&&ÿÿºþuŸ`&&ÿÿºþ»Ÿ`&&ÿÿXH`'þá'ÿÿXÿö`'þ!(ÿÿX`'þ)ÿÿº€`&*ÿÿY`'þ +ªÿÿYç`'þ ,zÿÿ¹ÿã¿k&.ÿÿY¢`'þ  /ÚÿÿXþV’`'þ±0ÿÿXÊ`'þ±1ÿÿXðÕ'þQ2ÿÿXµp&04ÿÿXx`'þ!6ÿÿ¹ÿã¿`&7ÿÿºþVd`&q9ÿÿºŽ`&|:ÿÿX`'þQ<ÿÿºþV_&Ñ=ÿÿXÊ`'þ±>ÿÿXS`'9ü ?ÿÿÿøˆ`&@ÿÿºt–'!û´+ÿÿXH–'ÿq'ÿÿXÊ–'ÿA1ÿÿºŽ–&:X‘, ##54>7#33>53rÙþ`#8!¸2-A,º¸»xž#8"¸2.@,›þeX5AnEþô¹QŠ`Q2,  BþLý« 6AnE ¹R‰aQ1,ÿÿ‚þ ë'%9ÿŽÿÿ‚þ ï'%9ÿ'ÿÿÿìþ ‡X&(%àÿÿÿÿìþ ~X'%àÿ)ÿÿ‚þ ë'$¼ÿŽÿÿ‚þ ï'$¼ÿ'ÿÿÿìþ óX&($cÿÿÿÿìþ ~X&)$cÿÿÿ‚þ ë'&¼ÿŽÿÿ‚þ ï'&¼ÿ'ÿÿÿìþ óX&(&cÿÿÿÿìþ ~X&)&cÿÿÿ‚ÿìë'%9„Žÿÿ‚ÿìï'%9„'ÿÿÿì‡â&(%àLÿÿÿì~â&)%àLÿÿ‚ÿìë'&¼„Žÿÿ‚ÿìï&'&¼„ÿÿÿìóâ&(&cLÿÿÿì~â&)&cLÿÿ‚ÿìë™'K„ý¨Žÿÿ‚ÿìï™&'K„ý¨ÿÿÿì0a&(Kÿ+þpÿÿÿì~a&)Kÿ+þpÿÿ‚ÿ¤ž'#x~ºÿÿ‚ÿ¥\F&*#x¶ÿÿÿì?&+#,~ÿÿÿì x&,#>èÿÿ‚ÿ¤ž'&xxºÿÿ‚ÿ¥\F&*&x°ÿÿÿì?&+&,xÿÿÿì x&,&>âÿÿþ (f'%¯Zÿÿþ >f'%£}™ÿÿÿìþ>\/&š% ÿ8ÿÿÿìþ>>/&›% ÿ8ÿÿþ (f'"ŠZÿÿþ >f'"&ÿç™ÿÿÿìÿ8\/&š"ÿ8ÿÿÿìÿ8>/&›"ÿ8ÿÿþ (f'$––Zÿÿþ >f'$2™ÿÿÿìþ>\/&š$ÿ8ÿÿÿìþ>>/&›$ÿ8ÿÿþ (f'&–¯Zÿÿþ >f'&2™ÿÿÿìþ>\/&š&ÿ8ÿÿÿìþ>>/&›&ÿ8ÿÿ}þÔR'"+þÔ\ÿÿ}þÔGR'"+þÔ¡ÿÿ}ÿÚ°'"ú\ÿÿ}ÿÚG°'"ú¡ÿÿ}ÿÚª'#ú\ÿÿ}ÿÚGª'#ú¡ÿÿ}ÿÚ÷'KÿÂÿ\ÿÿ}ÿÚG÷'KÿÂÿ¡ÿÿÿ«þ „°'#ô ^ÿÿÿ«þ ~°&¥#ô ÿÿÿ«þ Á/&^K¼þ>ÿÿÿ«þ ~/&¥K¼þ>ÿÿ‚ÿ§)‚ÿ§Ù7%#"'$47332767654'&54767;#"'&/œc©Í·À€þ¶?¸AËh—¸Âž#6þÊ2 #déý­GG&+@X„A:g!axL54#"%473303576 !! &5"'&3254&'±?ÐTKJ&ý߸|ŠtD.^(þ¨£.Eþôò:qÁ!&PET¿*Ÿ¤4pHuJ6>(E&7 kcCryb¸lâBcÞß5/iCp4— ÿÿÿìÿ½½åâÿÿÿìþ Ä«ãÿÿÿÉÇÖ'#qFkÿÿÿÉÒÖ&Ñ#qFÿÿÿìÏl&Ò#KÜÿÿÿìl&Ó#KÜÿÿÿ«þ @Õ&pwÿ¤ýØÿÿÿ«þ 6Õ&åwÿ¤ýØÿÿÿ«þ @r'ÿôþ>pÿÿÿ«þ 6r'ÿôþ>åÿÿÿ«þ @4&pÿìþÿÿÿ«þ 64&åÿìþÿÿÿ«þ @°&p#, ÿÿÿ«þ 6°&å#, ÿÿ‚üþÀJ&q%Šýøÿÿ‚üþ¿'%Šýøçÿÿÿìþ ‡X'%àÿ(ÿÿÿìþ ~X&)%àÿÿì‡X %+53276=3+HZ#c,1¸VV¸,1jÙÙ»ÿì~X%+53276=3;#"+M˜Z#c,1¸1,c7n–VV¸,1jÙÙj1,¸ÿÿ‚þóÀJqÿÿ‚þð¿çÿÿÿìþÔóX&N"cþÔÿÿÿìþÔ~X&O"cþÔüpn"56$3çþ=æìÅßÔgi~wun52&$ßÅìæþ=Ôšuw~igý* '/&'&#"#67632O,$e5F¢qpÈ[?8WH7  $0G‡JI  Ö'327673#"'&'O,$a9G¢qpÈ[?8Wì7  $,K‡JI ÿÿºPšsÿ,ÿÿÿìlš&hsÿ,ÿÿºPýtÿ,i,k ;#"'&=3!1,cK‚Ž\W¸L71,¸\W+ÿÿþPÿöuÿ,ÿÿºPªvÿ,ÿÿÿìlª'vÿ,hÿÿ¹Pýwÿ,ÿÿÿìlý'wÿ,hÿÿþèPÿØxÿ,ÿÿÿìþèl¸'xÿ,hÿÿÿôËdôyÿ,ÿÿÿìlô'yÿ,hÿÿá<zÿ,ÿÿÿìl&hzÿ,ÿÿ£UÞNÿÿÿµ…ƒ'{ÿÂTÿÿÿµ…ƒ&…{ÿÂÿÿlÃ9'|ÿÂTÿÿl„9&…|ÿÂÿÿÿ«þ @µ'|ÿÂþ>pÿÿÿ«þ 6µ&å|ÿÂþ>ÿÿlþ Ã'}ÿTÿÿlþ „&…}ÿÿÿ‚þóÀµ'|ÿôþ>qÿÿ‚þð¿»&ç|XýDÿÿÿìÑç&N|ÿ+þpÿÿÿì~ç&O|ÿ+þpÿÿÁyTÁ„ 3;#"'&Á¸1,cK‚šPWs¡ûkj1,¸\eÿÿ‚þ¢ë'!9þ¢Žÿÿ‚þ¢ï&'!9þ¢ÿÿÿìþÔ‡X&(!àþÔÿÿÿìþÔ~X&)!àþÔÿÿ‹ÿÆ '"ú„oÿÿ‘^&á"^„ÿÿ‚ÿìë '"¼ŠŽÿÿ‚ÿìï &'"¼Šÿÿÿìóè&("cRÿÿÿì~è&)"cRÿÿ‚ÿìë'#¼ŠŽÿÿ‚ÿìï&'#¼Šÿÿÿìóâ&(#cRÿÿÿì~â&)#cRÿÿþ (f'!Zÿÿþ >f&™!¼ÿÎÿÿÿìþÔ\/&š! þÔÿÿÿìþÔ>/&›! þÔÿÿþ (fZþ >f0%3#"'&'&'!27# '&5767"#"5$3 "(1{R=IrbàJIÁÔ–úþ^©ƒÔ`‰ _Œ‡_Á&Èm3HZ¸¸–dœ²P·ü‰^¤v¸c–àße4)¸?6š [ _wÿì\/&'&'&5672+5327676SSgU´R¡HK¢¬ÜLX¦J‘KÝ£€dãht^¸#4bš4bBP¸H:jVÿì>/);#"'&'+53276767&'&'&5672~ÜAI2hrBVÑ~(;E)‘KÝ£€dãht^eSgU´R¡HK¢ 4bš)N"w¸¨6a.%P¸H:jV#¸ÿÿþ (°'!?Zÿÿþ >°&™!?ÿÿÿì\L&š! ¶ÿÿÿì>L&›! ¶ÿÿ}ÿÚR\}ÿÚGR &'3;#"'#"'532767654"9¶ãaRQS,cK‚“a]Ï.-fgsT!"¬#?z™N‰†uIS,¸‚€!&¸* 1p*Dÿÿ}ÿÚ°'!E\ÿÿ}ÿÚG°&¡!Eÿÿÿ«þ b&^ÿ«þ ~&3;#"'!5 767654x¸ I*eK‚‚2Dûþäþ¾0ËÚ# &pgM,¸>þê…—¸€ŠÐ:H~ÿÿÿ«þ b¶'!q ^ÿÿÿ«þ ~¶&¥!q ÿÿ‚þ î`‚þ GîF%7653323;#"'#"'&''&'#&'$473327676'&/3¸N0%¸@nޏS,cK‚‘vDm% I0Š1_@8‰'T…ÁPx€mþíi¸l“_Qb_y^@@¸$:µ|_ÊÍ2©&þªaS,¸`[ F{Ÿ<³kª>GHö´Îܳ&%0žlŽ}=êœJ<~ÿìÿã î1%+53276=3327653763#"'&'#"'&€+8Lc‚Kc,P¸,+hm,%¸@nޏ\Kf%#?7‰0`DAbH<Š;!.¸,PdÀœ@dczgÂÍ2ª&þªÇq\ =„œ!1(ÿìÿã7î8#"'&'#"'&'+53276=3327653763;#"'ý%#?7‰0`DAbH<)+8Lc‚Kc,P¸,+hm,%¸@nޏS,cK‚‘vD =„œ!1(I;!.¸,PdÀœ@dczgÂÍ2ª&þªaS,¸`Zÿÿ‚þ °'#â `ÿÿ‚þ G°&©#â ÿÿÿìÿã °&ª#Š ÿÿÿìÿã7°&«#Š ÿÿ‚þ åb‚þ áå<I)"'&5#&'$47332767654'367676;#"/"3276'&'&uþì&4-JXîPx€mþíi¸l“_Qf[¢+!'« (s{l“HX}aº*=RK‚ƒgÌL~¨‘»í»‰%º€›MGHö´Îܳ&%DŠl“Š7(2’l^F"%GéMF ,¸\v7QlÂ?[F‡ÿì2å .327654'&#"!"'&'+53276=36767632Ш‘»íº‹%0LºþìJNA'f¬‚Kc,P¸-e_™KUskº¸ÊælÂ?[F‡ýÉ*#=Џ,PdrNP2†T‰?!'Dì©mxÿìå+8)"'&'+53276=36767632;#"/327654'&#"˜þèJNA'f¬‚Kc,P¸-e_™KUqm¾*=RK‚ƒgÌ਑»íº‹%0L*#=Џ,PdrNP2†T‰?!'DìKH ,¸\vælÂ?[F‡ÿÿ‚þ ¶'!û bÿÿ‚þ á¶&±!û ÿÿÿì2¶&²!Û ÿÿÿì¶&³!Û ÿÿÜd¬))5!3%632;#"/%3276'&'&#"@ý¿þ‘o¸Ù\Dui¼*=RK‚ƒgÌýé»í»‰%0Pz±¸\û?c!'EëMF ,¸\v¸?]D‡QxÿìÔ %3276'&'&#")5!3%6329»í»‰%0Pz±uýÁþõ ¸Ù\Duiº¸Ê¸?]D‡Qxþ’¸\û?c!'Eë©mxÿì¤))5!3%632;#"/%3276'&'&#"8ý¿þõ ¸Ù\Dui¼*=RK‚ƒgÌýé»í»‰%0Pz±¸\û?c!'EëMF ,¸\v¸?]D‡QxÿÿÜ'!ÏRdÿÿ¬&¹!ÏRÿÿÿìÔ&º!ÇRÿÿÿì¤&»!ÇRÿÿuþ ²*fuþ ²%+! '&7.54762;# '!2764"²˜þÿþ[b»=D}aî_[9^D¶U þöøš)k_ÁÔý1ˆÎþoc¼z’Œ2t*n@00@p[C+ @M¸äkl=žv–8`3$ÿìø*727&'&5763"327%+5<¡ÊK4XÌ}ûÚº>SF7J þ\þ¢²X¸];dŒ}M©‰ÿ4F!¸Å¤¸ÿìð$/%+532767&'&5476762;#""654'îÂÊv`kB;(aD hYîYh MXD=p`vʨ4/gg/¹¹¸($'UZ'-)74--47)-'bM,(¸U __ ÿÿuþ ²F'!w°fÿÿuþ ²L&Á!©¶ÿÿÿìøF&Â!w°ÿÿÿìðL&Ã!£¶ÿÿ‚ÿ¤ž'!õ~ºÿÿ‚ÿ¥\L&*!õ¶ÿÿÿì?&+!©~ÿÿÿì ~&,!»èÿÿkþH›'"R~ÿÿkþ À&-"„kÿÿÿì?&.",~ÿÿÿì ~&/"8èÿÿÿÉÇkÿÉÒ!D#"'5327654'&'&7676'&'$54733276763;#"'ÐJ&P DfXRNB8D-<9_¸h$$EB|=Q#!v+6ºú(  %þ¶{{qe›ÿì))5!27654'&54767;#"'&/6þ¶6”-6þÊ2 héý­GG&+@X„A:g!a_¸h$$EB|=Q#!v+6ºú(  %ý?¸+)x.›ÿÿþÈlþÈ#$%653;#"'#"'$&733276N¸1,cK‚pNyþû†UcEþÜ@¸A¦(IPm®I~ãjûkj1,¸3.(±B"[Š\ss~B"5ÿì¯ +5327653¯WPš‚Kc,1¸s²e\¸,1j•ÿìº%+5327653;#"SM˜‚Kc,1¸1,cK‚–VV¸,1j•ûkj1,¸ÿÿŒþ^ómŒþgt5%327654'&'&#"#"'&#4763&547632;#"bzL,5;(.;DÀ …Kµ2KÈxAZ¢M\HTª((&iK‚¯¨*9:X DD(©PNNOþ“m­f7*(”„?$G³C,,¸ÿìÿͦm$%#"'+5326767632%327654'&#"da“În@h t4W‡^Q°[aýð>Ÿ/4(*X.[4fb0¸G1µP8TY¸NE5EK&)Ÿ/4:''5)24fb0¸$#1µP8S§1>,¸ÄE5EX !a%ÿÿ“þµH¶'!? Óÿÿ“þ +¼&5!?&ÿÿÿì‡è'!àR(ÿÿÿì~è'!àR)ÿÿ‹ÿÆ Þo‘^î $&'&'&'3;#"'&'#"'&5476¤ xRo´t¸$8pK‚ZI-&Šœ8:½Ìm*12e CY>)2Ñ'+¨®eO,¸3;I0š­Dÿìÿ½½å-=67654'&#"27&'&5476&'5#"'+5327654'&”$"':Aù4N--0M,Qߨ@(J¯ƒšx’‰«b 41}! @H=.%4-+#%vˆ iEN@TSZ '¹D³ÑÞ49g=ql)¸D%'“i.C!v-‹3j  °;AWE… ¸L9P)8K6(¸œS/V¸L_”+Y‡9›K1\Sÿÿ‚þóÀJq‚þð¿765&'&'&54767632;#"'&#"#"'$4733276L[/,4PT*uW€ ##rpl$-AIq€ÚYh¼uþÛ?¸A¦B³[M•!3!+ (;=A<^†Ä¸¬¥#0{bV` )g™ZZ™rNÿÿ‚þ ÀJ'"ôþ qÿÿ‚þ ¿'"ôþ çÿÿÿìþÔóX&N"cþÔÿÿÿìþÔ~X&O"cþÔÿÿÿ.ÿì¿í&ò{þ–,ÿÿÿ.ÿìÚí&ó{þ–,ÿÿÿåÿì¿£&ò|þ–,ÿÿÿåÿìÚ£&ó|þ–,ÿÿþ ¿&ò}þÈÿÿþ Ú&ó}þÈTÿì¿#"'5327367653¿‹7MÍžjK`Uqˆþ³ª%¸BþÔÚUG´ ¸ ˜FüA+7‰¸®TÿìÚ#"'5327367653;#"'&4;IÊ¡jK`Uqˆþ³ª%¸"@Pi¯f<[A´ ¸ ˜FüA+7‰¸®üD®Tž¸ó)ÿTL* 35'5467676?67654&#">32üüü–Ë,X\"$߸gÁ^a³Olƒ39ZZ8Lüüüý®þþ“{4<+VZ@ELŸÂ89¼CFnY1^5YV‚ešdÿãªÕ 73!!d0æ0¨ÁýŒÁêõ#²úN@öþ ª|Èÿíè $327654&#632!"'327654&#|4ûw=ƯþÞˆdð¢Î×Öu«þ½d„´oê^,ì¿~þ#r;BY•Wa{ÐÕzzäŽp¤4þ€=8hŽdÿãêó  küùýxˆýwýwÈÒ 33 !7>'.'ÈZ„žŸ '8þ¹þÂZÎÇA ¼þÒxzùeþb¸­ÀcÔz\¬‘ Èœò #%%|´Ôýü ýü 6þÊòu²SþÃX²SþÃX²Èœò #%|´Ôýü *üÖòu²SþÃX²–îÕ !#3!53#–XÒÒý¨ÒÒÕ´û“´´mÈ8Õ !!!!!Èpü¼ýøýøÕú+EÜþ$´þ#–ÿã¤ó# $&6$ 67!!!!&¤zÐþàþÆþàÐzzÐ : ÐzýSÂþ´þþÐòÂþîˆòþîNþàÐ{{Ð : Ð{{ÐþàýÃþ óÃþî‰óþî0þ ÃÈ|Õ3#È´´Õú+Èÿãƒó !#3 |´´ˆxý.ÙxýqÕýá=†ýý{†CÈûÕ #3|ÿ€ýM€´3€ýMÕÈ Ôó 3  #Ètƒ8/.€ýRýÒýÑý³´Õýå9ýÑ/€ýS.ýÒîûLÈwó3  #Ètƒ8€ýRý³´Õýå9€ýSîûLÈœÕ !!!!!!!|ÜýpÔú,DÜû”Ü´Üþ$ÜEú+!þ$Üþ$Üýoþ$Ü–ÿã¤ó'64."26 $&6$ "&462’^^ŸÞðÞŸ^^ŸÞðÞ±zÐþàþÆþàÐzzÐ : Ðzý…RtRRtR”ßðßž__žßðßž__XþàÐ{{Ð : Ð{{Ðþà×RRtRRÈçè$54$!"#63 ( þÓþâ57´¢~bþYfÔ¶ùúÄÔþ¿þìþ°’È*Õ 33 3# È´ýý´´þþÕý¢^ú+½ý¡_ûC–ò 4."2>#&'.4>2fH}’}HH}’}üzf@H´GAhxyÏôÏyç“|HH|“}HHLÑ;%ý‰w%<ÐôÏyyÏÈDé ##63 7654'&#"ØlÈÿv‹´¢~l …†‹r¾+.éþåüþÑN$þ\Õüosr–žlX–ÿòòê  ”^þ¢€þc^þ¢€Lþ¢þ¢þ„^^ž€düò%#%7ü8þ2´þ"8Ь•û­™¬È´ê#34€üÈ´´ê€üÉýÍÕý\–ÿãçò 7   'QþE–’“–þE»–þmþn–í£bý¡_bý]ýXbdýœb–âÕ$!#5&'&76753676'&´ª¡¡€«´ª¡¡€«`KmmKþì`KmmKÌ€¡Ç¢€ËË€¡þ9¢€‡ý0Ll2lKýHÐLn˜–nLdò !#73—´ý€ÿ´ÿ€ýô~€þãþ€ý‚–ÿñ¢¹%4&"2$ &767&'&6 4&"2î{®{{®/åþ¾år/77/råBår/77/r´{®{{® ®{{®{1ååBs/.rCååþ¾s/.rî{{®{Èàè 3632!2654&#"È„ó þ©þóÊæ´¢*0Õæ½ÐÜýgNvcœÈÿíàÕ 3 #"'032654&È´ Wþàó„´0*¢´æÕýgÜнæ‡þœcvd¼Õ5!3#d¤´´‘´ú+‘dªò #7 "&462ªýÐæýШûûþ‘RtRRtR²úN²@úÚ&ýØRRtRRÿÿÈ|ÕdÿãªÕ73 d0æ0¨þþ#²úN@&úÚÿÿ–ÿãçòd'ó #dÈûzýÛ´þ,Çý;„þûXþªà‚¨ !5!5!)5!ýþ­S2Sý½þ®RàÈÈÈÈÈÿÿª=‚ 'aCÿ]ÿÿª7‚'ÿXbFÿÿª:‚ 'ba:ÿÿª;‚ 'b<bÿÿª=‚ 'ÿ]bÿÿª‚H'a€&a'a€aÿÿª‚H'a€'a€'abÿÿª‚H'þ 'a€'a€aÿÿª‚H'a€&a'ab€ÿÿª‚H'b€'a€'abÿÿª‚H'b€'a'a€þ ÿÿª‚H&a& 'a€aÿÿª‚H&b& 'a€aÿÿª‚H'þ 'a'a€ ÿÿª‚H'b'a€&aa€ÿÿª‚H'b'a€'a€bÿÿª‚H'þ 'a€'a€bÿÿª‚H&a'b€'ba€ÿÿª‚H&b'a€'bb€ÿÿª‚H'þ 'b€'ba€ÿÿª‚H& 'a€'baÿÿª‚H& &b'a€bÿÿª‚H& 'a€'bþ ÿÿª‚H' 'a€&aa€ÿÿª‚H&b'a€'a€ ÿÿª‚H'þ ' 'a€a€ÿÿª‚H'b€'a€&a ÿÿª‚H' &b'a€b€ÿÿª‚H' 'þ 'a€b€ÿÿª‚H' 'a€& aÿÿª‚H' 'a€& bÿÿª‚H' & 'a€þ ÿÿª‚H'b€'a'a€aÿÿª‚H'b€&b'aa€ÿÿª‚H'b€'a'a€þ ÿÿª‚H'b€'b€'aaÿÿª‚H'b€&b'ab€ÿÿª‚H'b€'þ 'ab€ÿÿª‚H'b€'a& aÿÿª‚H'b€'a& bÿÿª‚H'b€& 'aþ ÿÿª‚H'b€&a'a€bÿÿª‚H'b€&b'a€bÿÿª‚H'b€'b'a€þ ÿÿª‚H'b€'b'b€aÿÿª‚H'b€'b€'bbÿÿª‚H'b€'b'b€þ ÿÿª‚H'b€&a'b ÿÿª‚H'b€'b&b ÿÿª‚H'b€'þ 'b ÿÿª‚H'b€&a'a€ ÿÿª‚H'b€' 'a€bÿÿª‚H'b€'a€' þ ÿÿª‚H'b€' &ab€ÿÿª‚H'b€'b€&b ÿÿª‚H'b€'b€'þ  ÿÿª‚H'b€&a&  ÿÿª‚H'b€&b&  ÿÿª‚H'b€'þ &  ÿÿª‚H' &a'a€aÿÿª‚H' 'a€'abÿÿª‚H' 'þ 'a€aÿÿª‚H' &a'ab€ÿÿª‚H' 'b€'abÿÿª‚H' 'b€'aþ ÿÿª‚H' &a& aÿÿª‚H' &b& aÿÿª‚H' 'þ 'a ÿÿª‚H' 'b'a€aÿÿª‚H' 'b'a€bÿÿª‚H' 'þ 'a€bÿÿª‚H' &a'b€bÿÿª‚H' &b'bb€ÿÿª‚H' 'þ 'b€bÿÿª‚H' & 'baÿÿª‚H' & &bbÿÿª‚H' & 'bþ ÿÿª‚H' ' 'a€aÿÿª‚H' &b'a€ ÿÿª‚H' 'þ ' a€ÿÿª‚H' 'b€&a ÿÿª‚H' ' &bb€ÿÿª‚H' ' 'þ b€ÿÿª‚H' ' & aÿÿª‚H' ' & bÿÿª‚H' ' & þ ÜÕ #3 !!#!]ÍîÍþW:þ\˜ý€™w9þã8qúóqú+¡þ_ÕÇü÷ÉNÕ  %*!2#!327&#363&#!3654/654'ÉfçúÀþþðûý†ê;33;êÖ$ $ýþÊ#ÐÐ>ÐÐÕÀ±å]aþáÈÚéý{wˆýÜúó ûDÜåD–6ÍÄ6è3Õ! )327&#!36'è²–þhþPýý’cõ  öþpÊÆßßÕþ—þ€þ~þ–qúóA‹Aúó ûk•{qœÉSÕ3%!!!!!!-ÊþÒxýÇý9øûvqúó ddýädýsdÉìÕ !!!!!#3É#ýoQý¯þn.ÊÊÕdýädýqúósÿã‹ð&&$#"32767!5!# !2dþü…»‡‡»‘eVþRuþæ þ¢þu‹^’oüR©©äaG@û;@&5çdýSU™mn™HFûcI¯þºþ»¯f¾Õ3%!#3!53#.ÊþnXddý¨ddqúó ddúódd ÿ–þfYÕ6765%!#!53265-V?OþÔÍãþí?†nqú±òd J^ê dú“þòôd–ÂÉ0Õ !3 #!3ÉŸü£’™üÂþpdÊÕý‰wý@üëÏý1qúó É2Õ !!!3É’×û—dÊÕúdoúó ÄoÕ !#!! !3!3Ýþ_GþbþnØ}×þÒÊúÊqû®RúÕüøú+qúó úó rÿãÚð'( ! '&76 7& 676'&&:¼¾½½þÆþż½½¼Glllþðli$ ›› Þ#››ûÌðÒÕþ þ¡ÔÓÓÒabÓÒúŽ22×22ûjT%¶ýœµ%5û¯$¶c¶$ýôˆÿÜŸö-6&/.4%&  %5 64&/.$ Pdˆ¬o©¨&œªn°žÎþÅ¢m”nÊÉþàþþûßg©zŠoÊ·Æ-[þÊš)'¹þÿNXd»''ã´pu‰éi$2ëþXîf|•’ý† /ÏŒôÿú°Õ 3%!!!!rÈüÀ¶ýîþpýìqúó ddúq±ÿãóÕ $!&%! 65! ÆX!û†!YþÓ‘€ €‘þ¬ýfþ¬qü™þæ‚ba@üÀþž`|gdü5ðÓÓðËü\þÜþÖ*$·Õ 3%! 3!šîÈþþ®ÙÚdýÇþÌqúó dûéú+D®Õ 3!3%! ! 3! !ÄDÈþ¼û5DÈþ¼þ»:9:9dþ‰þ|þÅþÂþ€qúó úó dûîûîú+úðlÕ 3%! 3 ! #(\Æü¤þ~¸v„bþL:þHþŠþ|d¶qúó dýÎ2ý„ü§2ýÎ{ÿü¬Õ 3!! #3nÚdýðþpýð”ªþ2ÈÌÊÂüòý9ÇüòªýVý{ÿã“{",34&'3!5#"&546;54&#"5>3 5#">76/–=Kˆdþ°?¼V¬ËýûÐu—`¶Twß8þ°Ð6/^b;:þgCˆzÓ†]ˆýYýªfaÁ¢½ÀH‹..t''üþ‹UýíNHGÜýg‹wt”ÿã-!>32#"&'!4'&'676763&#"327”N:±|ËÿÿË|±:þ²^,<<,9üR†ù¥KM_]¥ý¢daþ¼ýðþ¼ad¨tŸ‚= üz =OsKÚú¬TþdihtJžŸ‚‚qÿãç{#%#"!2&'&#"3276%çM¥]ýþÖ-U¢LEmGJXHCQRHVþ,${z$d$$>:##düWS%€êæƒ&”ÿã-!!5#"323327654'&'&#"ÅNþ²:±|ËÿÿË|±ýv9,<<,^(†ý¥]_MK¥¶^ùì¨daDDaþZžKsO= † =‚ú¬Tþdü6‚‚ŸžJthioÿã}{!327# 32!.#"}ý‹K_ÙÃmÃkþôþÇ)üåý#ÆÅiÌ©J@þb]u-)8 CþÚ÷qzþÛþóŽÓ¾ç/ã 3476%#"!!!#5354763g.9‡ñ®”:9„þ|þ±°°WX¼® -8‘û¶J_D8‹d97’ddüædd¼TVqþVð{#.=65326=#"325!!"&32767654'&#"jëülQžRµ´:±|ËÿÿË|±:NþÖþÍrÊy^,<<,9/¥KM_]¥úü=ÊŒoú—€,*½¿qdaDDad¨ü-þâþéwŸ‚= † =OsKýÂihtJžŸ‚‚ºH "34'&3'!>32!4&#"! GŒS5ü‡ëOIÆÔÛþ¬kk€•þ± h¾ý”@Á[:¶ú´Ldýžedïèý\Пž¾¤ýUæ5 33#!!J‡ ¹¹KOþ±üüh˜éËû ÿ×þV #676#532765!3#¨‡%G(=ôÝ1l$%OQRa¸¸ûеT0Hôd01™¬ûŒÖ``¾éº2 !3 #!3ºO„ŒýHÑ–ýmþ±d‡üiãýöýª#ýݰú´Læê&5#"'&5!3J=(G%‡õ¶RQOLi” H0Tµ0úZ``Ö~ûJœ^dº‡{"&1<!>32>32!4&#"!4&#"!3%34'&%34'&ºOIÆÔTÞÔÛþ¬kk€•þ¬kk€•þ±d‡[ GŒS5ã GŒS5`®ed¬J€vïèý\Пž¾«ý\Пž¾¤ýUüüh˜ h¾ý”@Á[: h¾ý”@Á[:ºH{ "34'&%3'!>32!4&#"! GŒS5ü‡ëOIÆÔÛþ¬kk€•þ± h¾ý”@Á[:üh˜d®edïèý\Пž¾¤ýUqÿãu{ #2#"27&"676'&sðþîðñþï‚3x33x3d4'pp'Ú3(pp({þÈþìþíþÇ98û× º ükp-€þ$€-Rü’-Û€-qþVð{-%!!>32#"&4'&'&'676#&#"32¿þ²N:±|ËÿÿË|±Š9,<<,^ü؆¥]_MK¥¨ý®¨daþ¼ýðþ¼a¦žKsO= üz =‚ýoHú¸Ê‚‚ŸžJthiqþVð{-%#"325!!3#32767654'&#"¢:±|ËÿÿË|±:Nþ²ý<^,<<,9(††þ¥KM_]¥¨daDDad¨ùø”Ÿ‚= † =OsKü2HüHihtJžŸ‚‚ºß{3'!>32.#"!†êN:º…4I,œ§þ²üüh˜d®fc…˾ýzoÿãÇ{E67654'&/&'&5432654&/.54632.#"#"&'i'K&'q4¥=B%%U+.„39GÓS OjqL‘4vàÎf´LJ\_opPx3¡„÷ØZÃlù=vf03"3;@{R?Bsl37'*7CoTüþ78^UNO,,—ˆ¦µ z1$YXDL#/ž¤À%%7ˆž%&7#!!;!"&5#53Ð*‡\{þ…Ks½þ­Õ¢‡‡jU|ÿü7­N(þ¬dýU‰NdŸÒudT±ÿåD` "%&'&5##!5#"&5!3265!ù GŒS5C‡ëþ¬IÆÔÛTkk€•TS h¾lýÀÁ[:˜ühd®edïè¤ý0Ÿž¾¤«=±` 3%! 3!ÍYƒþ£þñT^^dþ\þÔüüh˜düT¬û Vò`3!3%!!3! !ñð‡òübð‡òþùTæåNæådþÛþÊñòþÇüüh˜üh˜dü–jü–jû –üjL` 3%! 3 ! #«—ýUþ¢|þ¥åþpþãþã|[üüh˜dþþ-ýsþÓ=þVÃ`7%! 3+53267Ò²>þ•þæ^]_lþP’|““XQ+üûÛ™Œdü—iû8Ç{dCYXb` 3%!!!5!\ývŒŠü‰ñýw‰ûö‰ýüüh˜ddühdd˜ÿÿhÕ$ÿÿÉìÕ%ÿÿsÿã'ð&ÿÿɰÕ'ÿÿÉ‹Õ(ÿÿÉ#Õ)ÿÿsÿã‹ð*ÿÿÉ;Õ+ÿÿ—öÕsÿÿÿ–þf“Õ-ÿÿÉjÕ.ÿÿÉjÕ/ÿÿÉÕ0ÿÿÉ3Õ1ÿÿsÿãÙð2ÿÿÉÕ3ÿÿsþøÙð4ÿÿÉTÕ5ÿÿ‡ÿã¢ð6ÿÿÿúéÕ7ÿÿ²ÿã)Õ8ÿÿhÕ9ÿÿD¦Õ:ÿÿ=;Õ;ÿÿÿüçÕ<ÿÿ\Õ=ÿÿ{ÿã-{Dÿÿºÿã¤Eÿÿqÿãç{FÿÿqÿãZGÿÿqÿã{Hÿÿ/øIÿÿqþVZ{JÿÿºdKÿÿÁyLÿÿÿÛþVyMÿÿºœNÿÿÁ9iÿÿº{Pÿÿºd{Qÿÿqÿãu{RÿÿºþV¤{SÿÿqþVZ{TÿÿºJ{UÿÿoÿãÇ{Vÿÿ7òžWÿÿ®ÿãX{Xÿÿ=`YÿÿV5`Zÿÿ;y`[ÿÿ=þV`\ÿÿXÛ`]ˆÿãð   6/&"27ö þöþ þøØÌÌd3{44{3þºÊÊðþsý þsóü#ÔÕ0úÙ÷þ,þ-k¬Õ37!!5!5%6ÊbJûÜJþ™gqúó dúdd HdH‚šð(7!676'&'$32!!7676&#"û)`"LlDbZE‚Ñþçµó0Q]þú(ûèž=y‡m˜ÁdÍ•@9\9p¨dºÏþÝ9hôÌb¬–‘þiddAb¿¨•œÿãsð$*0"'5327&+5327&#"56325654&'>54+»Ô!ĪeO6?ÌÔ;2:LœÙæ¯æ €Ž¢þÐÌuWEdJj D• d <h@Ѳ|ª!ÅÝò’Uèl$–þyX¬Z¸Õ#3 !!3#!!5§ËÈþÔþQ¯“­­þpýßqúóÁüãÍü3dþ\¤”ÿãŒÕ#66'&#"!! !"'532ÿÈg¶ÌÌd1j´ÎKþEþÔþ½¹Ð½Ü‘àýýüæ\Ü`ýI× Kïdþ# õþFù<ˆdqÿãªð %%6'27&"2'& 632# |ÊÊþ&ÍÍd:«-(«?ô§¨"™þÖ^BhõþðöþßþîPpc \ʳþ‘þ#•2"Œ_¸h$$EB|=Q&v+6ºú(  %þ¶z|qe›ÿì© #!5!27653©WPšþ„Ec,1¸s²e\¸,1j•ÿìÿÎ<m%%#"'#!5!26767632%327654'&#"úa“În@hþÊ 4W‡^Q°[aýð>Ÿ/4(*X-.*4fb0¸G1µP8TY¸NE5EK&)d%ÿÿÿìè&<!ÚRÿìÿãnî1%+53276=3327653763#"'&'#"'&ä+8Lcæ¯c,P¸,+hm,%¸@nޏ\Kf%#?7‰0`DAbH<Š;!.¸,PdÀœ@dczgÂÍ2ª&þªÇq\ =„œ!1(ÿÿÿìø*Âÿÿÿì?'!©~+ÿì–å .327654'&#"!"'&'+53276=367676324¨‘»íº‹%0LºþìJNA'f¬æ¯c,P¸-e_™KUskº¸ÊælÂ?[F‡ýÉ*#=Џ,PdrNP2†T‰?!'Dì©mxÿÿÿì?Îÿÿÿìÿãn°&#î ÿÿÿìíè&<"]Rÿÿÿìíâ'#]R<ÿÿÿìÀL& !q¶ÿÿÿì–¶'!? ÿÿÿìøFÆÿÿÁþÔ'!æþÔ1ÿÿÁþÔÌ'!}þÔÁÿ½-'7G3;27&'&5476&'5#"'+"'&327654'&67654'&#"Á¸1,cŽ4N--0M,Qߨ@(J¯ƒšx’ãšPWFb 41}!þº$"':As¡ûkj1, iEN@TSZ '¹D³ÑÞ49g=ql)\e;%'“i.C!_ßþ\šPWs¡ûkj1,h$$EB|=Q&v+6ºú(  %þ¶z|qe›\eÁÿÎ/%327654'&#"#"'+"'&53;26767632>Ÿ/4(*X-.*Äa“În@húšPW¸1,c—4W‡^Q°[aÇE5EK&)d%²fb0\e²¡ûkj1,G1µP8TY¸ÿÿÁ'!æR1Áÿãz;3;276=3327653763#"'&'#"'&'+"'&Á¸1,cnc,P¸,+hm,%¸@nޏ\Kf%#?7‰0`DAbH<)+8LcÜšPWs¡ûkj1,,PdÀœ@dczgÂÍ2ª&þªÇq\ =„œ!1(I;!.\eÁh$3;27&'&5763"327%+"'&Á¸1,cs¡ÊK4XÌ}ûÚº>SF7J þ\þ¢²²šPWs¡ûkj1,];dŒ}M©‰ÿ4F!¸Å¤\eÿÿÁ¯'!~2Á¢+83;276=36767632)"'&'+"'&327654'&#"Á¸1,cnc,P¸-e_™KUskº¸ÊþäþìJNA'f¬ÜšPW¨‘»íº‹%0Ls¡ûkj1,,PdrNP2†T‰?!'Dì©mx*#=Š\e%lÂ?[F‡ÿÿÁ¯'"œ~2ÿÿÁÿãz'#ú %ÿÿÁù'"iR1ÿÿÁù'#iR1ÿÿÁÌ'!}¶ÿÿÁ¢'!K (ÿÿÁD'!7R ÿÿÁh'!ç°&Á%#!"'&53;276=31Hþ¶šPW¸1,cÜc,1¸VV\e²¡ûkj1,,1jÙÙ»Á¯*:33!276767'&54767632#!"'&654'&32Á¸1,cT—O<?a‚Nb–NLZB`.NJ|m‘þešPW)B,4((7(*Hs¡ûkj1, ]027EW-3”E$2Hf3ŒÐˆ,'\eX+M;3*)3P&ÈF !;3#!.ûš Y_Ãü$õû ÈF !; 7!'!%3È Y÷ÁÙFõû Ûü%ŒÃý=ÈF !;"4767632"'&'&!'!%30&$Iù˜ Y÷ÁÙÃ$$%ý¨õû Ûü%ŒÃý=ÈF !;,048"'&'&4767632"'&'&4767632!'!%3±$$%ýÅ$%$ú Y÷ÁÙ?H%$HGüöõû Ûü%ŒÃý=ÈF !;+AEIM"'&'&4767632"'&'&476762"'&'&4767632!'!%3±$$%þÎ$HþÒ$%$ú Y÷ÁÙ?H%$ JHHGüöõû Ûü%ŒÃý=ÈF !;+AW[_c476762#"'&'&4767632"'&'$476762#"'&'4767632"'&'&!'!%3'H$%$%HýÞH$%$%Hø Y÷ÁÙÌ$JýéJ%$J%$S$JüŸõû Ûü%ŒÃý=ÈF !;+AWnrvz476762#"'&'&4767632"'&'$476762#"'&'4767632"'&'&4767632"'&'&!'!%3'H$%$%HýÞH$%$%Hþ÷&$Iù˜ Y÷ÁÙÌ$JýéJ%$J%$S$Jä$$%ý¨õû Ûü%ŒÃý= ÈF !;*@Uiƒ‡‹"'&'&476762"'&'&5476762 "'&'&4767632"'&'&'476762"'&'.76762"'&'&54767632!'!%3¤$H%$HþÍJ&$UJHJHý~J&$ú Y÷ÁÙRHJýï%$HG$$%$HýÞGH%$Hüãõû Ûü%ŒÃý=ÈF !;!476762"'&'&!'!%3ÊJHýþ Y÷ÁÙÃ$$%ý¨õû Ûü%ŒÃý=ÈF !;,048476762"'&'&%4767632"'&'&!'!%3ÌJHd&$Iù˜ Y÷ÁÙÃ$$%%$$%ý¨õû Ûü%ŒÃý=ÈF !;,BFJN476762"'&'&"'&'&4767632"'&'&4767632!'!%3ÊJHç$$%ýÅ$%$ú Y÷ÁÙÃ$$%þ¡H%$HGüöõû Ûü%ŒÃý=ÈF !;,AW[_c476762"'&'&"'&'&4767632"'&'&476762"'&'&4767632!'!%3ÊJHç$$%þÎ$HþÒ$%$ú Y÷ÁÙÃ$$%þ¡H%$ JHHGüöõû Ûü%ŒÃý=ÈF !;+AWmquy476762"'&'&476762#"'&'&4767632"'&'$476762#"'&'4767632"'&'&!'!%3ÊJH]H$%$%HýÞH$%$%Hø Y÷ÁÙÃ$$%.$JýéJ%$J%$S$JüŸõû Ûü%ŒÃý= ÈF !;+AWm„ˆŒ476762"'&'&476762#"'&'&4767632"'&'$476762#"'&'4767632"'&'&4767632"'&'&!'!%3ÊJH]H$%$%HýÞH$%$%Hþ÷&$Iù˜ Y÷ÁÙÃ$$%.$JýéJ%$J%$S$Jä$$%ý¨õû Ûü%ŒÃý= ÈF !;*@Vk•™¡476762"'&'&%"'&'&476762"'&'&5476762 "'&'&4767632"'&'&'476762"'&'.76762"'&'&54767632!'!%3ÊJHÚ$H%$HþÍJ&$UJHJHý~J&$ú Y÷ÁÙÃ$$%´HJýï%$HG$$%$HýÞGH%$Hüãõû Ûü%ŒÃý=ÈF !;+/37"'&'&4767632"'&'&5476762!'!%3rJ%$ý­$Jþm Y÷ÁÙ@H$%$%Hüôõû Ûü%ŒÃý=ÈF !;"8N4767632"'&'&!'!%3"'&'&4767632"'&'&54767620&$Iù˜ Y÷ÁÙþ·J%$ý­$JÃ$$%ý¨õû Ûü%ŒÃý=H$%$%HÈF !;,048Nd"'&'&4767632"'&'&4767632!'!%3"'&'&4767632"'&'&5476762±$$%ýÅ$%$ú Y÷ÁÙþ·J%$ý­$J?H%$HGüöõû Ûü%ŒÃý=H$%$%HÈF !;+AEIMcy"'&'&4767632"'&'&476762"'&'&4767632!'!%3"'&'&4767632"'&'&5476762±$$%þÎ$HþÒ$%$ú Y÷ÁÙþ·J%$ý­$J?H%$ JHHGüöõû Ûü%ŒÃý=H$%$%H ÈF !;)>SW[_t‰476762"'&'&476762"'&'$476762"'&'476762"'&'&!'!%3"'&'&4767632"'&'&476762'HIIHýÞHIIHø Y÷ÁÙþ·I%$ý­$IÌ$IýéI%$I%$S$IüŸõû Ûü%ŒÃý=HIIH ÈF !;+AWnrvz¦476762#"'&'&4767632"'&'$476762#"'&'4767632"'&'&4767632"'&'&!'!%3"'&'&4767632"'&'&5476762'H$%$%HýÞH$%$%Hþ÷&$Iù˜ Y÷ÁÙþ·J%$ý­$JÌ$JýéJ%$J%$S$Jä$$%ý¨õû Ûü%ŒÃý=H$%$%H ÈF !;*@Uiƒ‡‹¡·"'&'&476762"'&'&5476762 "'&'&4767632"'&'&'476762"'&'.76762"'&'&54767632!'!%3"'&'&4767632"'&'&5476762¤$H%$HþÍJ&$UJHJHý~J&$ú Y÷ÁÙþ·J%$ý­$JRHJýï%$HG$$%$HýÞGH%$Hüãõû Ûü%ŒÃý=H$%$%HÈF !;+AEIM"'&'&4767632%"'&'&4767632"'&'&5476762!'!%3rJ%$þ¶$$%þÒ$Jþm Y÷ÁÙ@H$%ùJI $%Hüôõû Ûü%ŒÃý=ÈF !;+AX\`d"'&'&4767632%"'&'&4767632"'&'&54767624767632"'&'&!'!%3rJ%$þ¶$$%þÒ$JÕ&$Iù˜ Y÷ÁÙ@H$%ùJI $%H$$%ý¨õû Ûü%ŒÃý=ÈF !;+AXnrvz"'&'&4767632%"'&'&4767632"'&'&5476762"'&'&4767632"'&'&4767632!'!%3rJ%$þ¶$$%þÒ$JV$$%ýÅ$%$ú Y÷ÁÙ@H$%ùJI $%HýíH%$HGüöõû Ûü%ŒÃý= ÈF !;+AXmƒ‡‹"'&'&4767632%"'&'&4767632"'&'&5476762"'&'&4767632"'&'&476762"'&'&4767632!'!%3rJ%$þ¶$$%þÒ$JV$$%þÎ$HþÒ$%$ú Y÷ÁÙ@H$%ùJI $%HýíH%$ JHHGüöõû Ûü%ŒÃý= ÈF !;+AWmƒ™¡¥"'&'&4767632%"'&'&4767632"'&'&5476762%476762#"'&'&4767632"'&'$476762#"'&'4767632"'&'&!'!%3rJ%$þ¶$$%þÒ$JÌH$%$%HýÞH$%$%Hø Y÷ÁÙ@H$%ùJI $%Hz$JýéJ%$J%$S$JüŸõû Ûü%ŒÃý= ÈF !;+AWmƒ™°´¸¼"'&'&4767632%"'&'&4767632"'&'&5476762%476762#"'&'&4767632"'&'$476762#"'&'4767632"'&'&4767632"'&'&!'!%3rJ%$þ¶$$%þÒ$JÌH$%$%HýÞH$%$%Hþ÷&$Iù˜ Y÷ÁÙ@H$%ùJI $%Hz$JýéJ%$J%$S$Jä$$%ý¨õû Ûü%ŒÃý= ÈF !;+AVl‚—«ÁÅÉÍ"'&'&4767632%"'&'&4767632"'&'&5476762!"'&'&476762"'&'&5476762 "'&'&4767632"'&'&'476762"'&'.76762"'&'&54767632!'!%3rJ%$þ¶$$%þÒ$JI$H%$HþÍJ&$UJHJHý~J&$ú Y÷ÁÙ@H$%ùJI $%HHJýï%$HG$$%$HýÞGH%$Hüãõû Ûü%ŒÃý=ÈF !;)>SW[_476762"'&'&476762"'&'$476762"'&'476762"'&'&!'!%3ÁHIIHýÞHIIHüõ Y÷ÁÙÌ$IýéI%$I%$S$IüŸõû Ûü%ŒÃý=ÈF !;!6K`u4767632"'&'&!'!%3476762"'&'&476762"'&'$476762"'&'476762"'&'&0&$Iù˜ Y÷ÁÙüHIIHýÞHIIHÃ$Iý¨õû Ûü%ŒÃý=m$IýéI%$I%$S$I ÈF !;,048Ndz"'&'&4767632"'&'&4767632!'!%3476762#"'&'&4767632"'&'$476762#"'&'4767632"'&'&±$$%ýÅ$%$ú Y÷ÁÙüH$%$%HýÞH$%$%H?H%$HGüöõû Ûü%ŒÃý=m$JýéJ%$J%$S$J ÈF !;+AEIMcy¥"'&'&4767632"'&'&476762"'&'&4767632!'!%3476762#"'&'&4767632"'&'$476762#"'&'4767632"'&'&±$$%þÎ$HþÒ$%$ú Y÷ÁÙüH$%$%HýÞH$%$%H?H%$ JHHGüöõû Ûü%ŒÃý=m$JýéJ%$J%$S$J ÈF !;+AW[_cy¥»476762#"'&'&4767632"'&'$476762#"'&'4767632"'&'&!'!%3476762#"'&'&4767632"'&'$476762#"'&'4767632"'&'&'H$%$%HýÞH$%$%Hø Y÷ÁÙüH$%$%HýÞH$%$%HÌ$JýéJ%$J%$S$JüŸõû Ûü%ŒÃý=m$JýéJ%$J%$S$J ÈF !;+AWnrvz¦¼Ò476762#"'&'&4767632"'&'$476762#"'&'4767632"'&'&4767632"'&'&!'!%3476762#"'&'&4767632"'&'$476762#"'&'4767632"'&'&'H$%$%HýÞH$%$%Hþ÷&$Iù˜ Y÷ÁÙüH$%$%HýÞH$%$%HÌ$JýéJ%$J%$S$Jä$$%ý¨õû Ûü%ŒÃý=m$JýéJ%$J%$S$J ÈF !;*@Uiƒ‡‹¡·Íã"'&'&476762"'&'&5476762 "'&'&4767632"'&'&'476762"'&'.76762"'&'&54767632!'!%3476762#"'&'&4767632"'&'$476762#"'&'4767632"'&'&¤$H%$HþÍJ&$UJHJHý~J&$ú Y÷ÁÙüH$%$%HýÞH$%$%HRHJýï%$HG$$%$HýÞGH%$Hüãõû Ûü%ŒÃý=m$JýéJ%$J%$S$JÈF !; !7Mcy7!'!%3476762#"'&'&4767632"'&'$476762#"'&'4767632"'&'&476762"'&'&È Y÷ÁÙüH$%$%HýÞH$%$%Hþ÷JHFõû Ûü%ŒÃý=m$JýéJ%$J%$S$Jä$$% ÈF !;"8Ndz4767632"'&'&!'!%3476762#"'&'&4767632"'&'$476762#"'&'4767632"'&'&476762"'&'&0&$Iù˜ Y÷ÁÙüH$%$%HýÞH$%$%Hþ÷JHÃ$$%ý¨õû Ûü%ŒÃý=m$JýéJ%$J%$S$Jä$$% ÈF !;,048Ndz¦"'&'&4767632"'&'&4767632!'!%3476762#"'&'&4767632"'&'$476762#"'&'4767632"'&'&476762"'&'&±$$%ýÅ$%$ú Y÷ÁÙüH$%$%HýÞH$%$%Hþ÷JH?H%$HGüöõû Ûü%ŒÃý=m$JýéJ%$J%$S$Jä$$% ÈF !;+AEIMcy¥»"'&'&4767632"'&'&476762"'&'&4767632!'!%3476762#"'&'&4767632"'&'$476762#"'&'4767632"'&'&476762"'&'&±$$%þÎ$HþÒ$%$ú Y÷ÁÙüH$%$%HýÞH$%$%Hþ÷JH?H%$ JHHGüöõû Ûü%ŒÃý=m$JýéJ%$J%$S$Jä$$% ÈF !;+AW[_cy¥»Ñ476762#"'&'&4767632"'&'$476762#"'&'4767632"'&'&!'!%3476762#"'&'&4767632"'&'$476762#"'&'4767632"'&'&476762"'&'&'H$%$%HýÞH$%$%Hø Y÷ÁÙüH$%$%HýÞH$%$%Hþ÷JHÌ$JýéJ%$J%$S$JüŸõû Ûü%ŒÃý=m$JýéJ%$J%$S$Jä$$% ÈF !;+AWnrvz¦¼Òè476762#"'&'&4767632"'&'$476762#"'&'4767632"'&'&4767632"'&'&!'!%3476762#"'&'&4767632"'&'$476762#"'&'4767632"'&'&476762"'&'&'H$%$%HýÞH$%$%Hþ÷&$Iù˜ Y÷ÁÙüH$%$%HýÞH$%$%Hþ÷JHÌ$JýéJ%$J%$S$Jä$$%ý¨õû Ûü%ŒÃý=m$JýéJ%$J%$S$Jä$$%ÈF !;*@Uiƒ‡‹¡·Íãù"'&'&476762"'&'&5476762 "'&'&4767632"'&'&'476762"'&'.76762"'&'&54767632!'!%3476762#"'&'&4767632"'&'$476762#"'&'4767632"'&'&476762"'&'&¤$H%$HþÍJ&$UJHJHý~J&$ú Y÷ÁÙüH$%$%HýÞH$%$%Hþ÷JHRHJýï%$HG$$%$HýÞGH%$Hüãõû Ûü%ŒÃý=m$JýéJ%$J%$S$Jä$$% ÈF !; ":Pf|’7!'!%3"'&'&54767632"'&'&54767632 "'&'&4767632"'&'&'476762"'&'.76762"'&'&54767632È Y÷ÁÙý„$$%%$$%þÍJ%$0$H%$Hý•J%$Fõû Ûü%ŒÃý=ò%$Jýï&$$%H$%$%HýîH$%$%H ÈF !;"9Qg}“©4767632"'&'&!'!%3"'&'&54767632"'&'&54767632 "'&'&4767632"'&'&'476762"'&'.76762"'&'&547676320&$Iù˜ Y÷ÁÙý„$$%%$$%þÍJ%$0$H%$Hý•J%$Ã$$%ý¨õû Ûü%ŒÃý=ò%$Jýï&$$%H$%$%HýîH$%$%H ÈF !;,048Og}“©¿"'&'&4767632"'&'&4767632!'!%3"'&'&54767632"'&'&54767632 "'&'&4767632"'&'&'476762"'&'.76762"'&'&54767632±$$%ýÅ$%$ú Y÷ÁÙý„$$%%$$%þÍJ%$0$H%$Hý•J%$?H%$HGüöõû Ûü%ŒÃý=ò%$Jýï&$$%H$%$%HýîH$%$%H ÈF !;+AEIMd|’¨¾Ô"'&'&4767632"'&'&476762"'&'&4767632!'!%3"'&'&54767632"'&'&54767632 "'&'&4767632"'&'&'476762"'&'.76762"'&'&54767632±$$%þÎ$HþÒ$%$ú Y÷ÁÙý„$$%%$$%þÍJ%$0$H%$Hý•J%$?H%$ JHHGüöõû Ûü%ŒÃý=ò%$Jýï&$$%H$%$%HýîH$%$%H ÈF !;+AW[_cz’¨¾Ôê476762#"'&'&4767632"'&'$476762#"'&'4767632"'&'&!'!%3"'&'&54767632"'&'&54767632 "'&'&4767632"'&'&'476762"'&'.76762"'&'&54767632'H$%$%HýÞH$%$%Hø Y÷ÁÙý„$$%%$$%þÍJ%$0$H%$Hý•J%$Ì$JýéJ%$J%$S$JüŸõû Ûü%ŒÃý=ò%$Jýï&$$%H$%$%HýîH$%$%HÈF !;+AWnrvz‘©¿Õë476762#"'&'&4767632"'&'$476762#"'&'4767632"'&'&4767632"'&'&!'!%3"'&'&54767632"'&'&54767632 "'&'&4767632"'&'&'476762"'&'.76762"'&'&54767632'H$%$%HýÞH$%$%Hþ÷&$Iù˜ Y÷ÁÙý„$$%%$$%þÍJ%$0$H%$Hý•J%$Ì$JýéJ%$J%$S$Jä$$%ý¨õû Ûü%ŒÃý=ò%$Jýï&$$%H$%$%HýîH$%$%HÈF !;*@Uiƒ‡‹¡·Ìáö "'&'&476762"'&'&5476762 "'&'&4767632"'&'&'476762"'&'.76762"'&'&54767632!'!%3"'&'&5476762"'&'&5476762 "'&'&4767632"'&'.76762"'&'.76762"'&'&4767632¤$H%$HþÌI&$UIHIHý}I&$ú Y÷ÁÙý„$I%$IþÌI%$0$H%$Hý”I%$RHIýï%$HG$$%$HýÞGH%$Hüãõû Ûü%ŒÃý=ò%$Iýï&$IHIIHýîHIIHÈþ½m!5!!áÃü$õû fö§Èþ½m !!7!!!!Èõû Ûü%ŒÃý=mö§?ü'Èþ½m"2#"'&'&47676!!7!!!!E$$%ý¨õû Ûü%ŒÃý=&$Ihö§?ü'Èþ½m+/37476762#"'&'&476762"'&'&!!7!!!!ÁH%$HGüöõû Ûü%ŒÃý=|$I;$%$øö§?ü'Èþ½m+AEIM476762#"'&'&476762"'&'&476762"'&'&!!7!!!!ÁH%$ JHHGüöõû Ûü%ŒÃý=|$$%2$H.$%$øö§?ü'Èþ½m+AW[_c2"'&'&5476762#"'&'&47672#"'&'&547672"'&'&47676!!7!!!!N$JýéJ%$J%$S$JüŸõû Ûü%ŒÃý=H$%ýî$%H"H$%ýþ$%Hqö§?ü'Èþ½m+AWnrvz2"'&'&5476762#"'&'&47672#"'&'&547672"'&'&476762#"'&'&47676!!7!!!!N$JýéJ%$J%$S$Jä$$%ý¨õû Ûü%ŒÃý=H$%ýî$%H"H$%ýþ$%H &$Ihö§?ü' Èþ½m*@Uiƒ‡‹%476762"'&'&%4767632"'&'&476762"'&'4767672"'&'$4767>"'&'4767632'&'!!7!!!!ÔHJýï%$HG$$%$HýÞGH%$Hüãõû Ûü%ŒÃý=‘$H%$H3J&$ý«JHJH‚J&$äö§?ü'Èþ½m!2#"'&'&47676!!7!!!!E$$%ý¨õû Ûü%ŒÃý=kJHö§?ü'Èþ½m,0482#"'&'&476762#"'&'&47676!!7!!!!E$$%%$$%ý¨õû Ûü%ŒÃý=iJHûœ&$Ihö§?ü'Èþ½m,BFJN2#"'&'&47676476762#"'&'&476762"'&'&!!7!!!!E$$%þ¡H%$HGüöõû Ûü%ŒÃý=kJHú$$%;$%$øö§?ü'Èþ½m,AW[_c2#"'&'&47676476762#"'&'&476762"'&'&476762"'&'&!!7!!!!E$$%þ¡H%$ JHHGüöõû Ûü%ŒÃý=kJHú$$%2$H.$%$øö§?ü'Èþ½m+AWmquy2#"'&'&476762"'&'&5476762#"'&'&47672#"'&'&547672"'&'&47676!!7!!!!E$$%.$JýéJ%$J%$S$JüŸõû Ûü%ŒÃý=kJHü£H$%ýî$%H"H$%ýþ$%Hqö§?ü' Èþ½m+AWm„ˆŒ2#"'&'&476762"'&'&5476762#"'&'&47672#"'&'&547672"'&'&476762#"'&'&47676!!7!!!!E$$%.$JýéJ%$J%$S$Jä$$%ý¨õû Ûü%ŒÃý=kJHü£H$%ýî$%H"H$%ýþ$%H &$Ihö§?ü' Èþ½m*@Vk•™¡2#"'&'&47676476762"'&'&%4767632"'&'&476762"'&'4767672"'&'$4767>"'&'4767632'&'!!7!!!!E$$%´HJýï%$HG$$%$HýÞGH%$Hüãõû Ûü%ŒÃý=kJHû&$H%$H3J&$ý«JHJH‚J&$äö§?ü'Èþ½m+/37476762#"'&'4767632"'&'&!!7!!!!ÂH$%$%Hüôõû Ûü%ŒÃý=ÃJ%$S$J“ö§?ü'Èþ½m"8N2#"'&'&47676!!7!!!!476762#"'&'4767632"'&'&E$$%ý¨õû Ûü%ŒÃý=H$%$%H&$Ihö§?ü'IJ%$S$JÈþ½m,048Nd476762#"'&'&476762"'&'&!!7!!!!476762#"'&'4767632"'&'&ÁH%$HGüöõû Ûü%ŒÃý=H$%$%H|$$%;$%$øö§?ü'IJ%$S$JÈþ½m+AEIMcy476762#"'&'&476762"'&'&476762"'&'&!!7!!!!476762#"'&'4767632"'&'&ÁH%$ JHHGüöõû Ûü%ŒÃý=H$%$%H|$$%2$H.$%$øö§?ü'IJ%$S$J Èþ½m+AW[_cy2"'&'&5476762#"'&'&47672#"'&'&547672"'&'&47676!!7!!!!476762#"'&'4767632"'&'&N$JýéJ%$J%$S$JüŸõû Ûü%ŒÃý=H$%$%HH$%ýî$%H"H$%ýþ$%Hqö§?ü'IJ%$S$J Èþ½m+AWnrvz¦2"'&'&5476762#"'&'&47672#"'&'&547672"'&'&476762#"'&'&47676!!7!!!!476762#"'&'4767632"'&'&N$JýéJ%$J%$S$Jä$$%ý¨õû Ûü%ŒÃý=H$%$%HH$%ýî$%H"H$%ýþ$%H &$Ihö§?ü'IJ%$S$J Èþ½m*@Uiƒ‡‹¡·%476762"'&'&%4767632"'&'&476762"'&'4767672"'&'$4767>"'&'4767632'&'!!7!!!!476762#"'&'4767632"'&'&ÔHJýï%$HG$$%$HýÞGH%$Hüãõû Ûü%ŒÃý=H$%$%H‘$H%$H3J&$ý«JHJH‚J&$äö§?ü'IJ%$S$JÈþ½m+AEIM476762#"'&'476762"'&'&4767632"'&'&!!7!!!!ÂH$%ùJI $%Hüôõû Ûü%ŒÃý=ÃJ%$J$$%.$J“ö§?ü'Èþ½m+AX\`d476762#"'&'476762"'&'&4767632"'&'&2#"'&'&47676!!7!!!!ÂH$%ùJI $%H$$%ý¨õû Ûü%ŒÃý=ÃJ%$J$$%.$Jû+&$Ihö§?ü'Èþ½m+AXnrvz476762#"'&'476762"'&'&4767632"'&'&476762#"'&'&476762"'&'&!!7!!!!ÂH$%ùJI $%HýíH%$HGüöõû Ûü%ŒÃý=ÃJ%$J$$%.$Jùª$$%;$%$øö§?ü' Èþ½m+AXmƒ‡‹476762#"'&'476762"'&'&4767632"'&'&476762#"'&'&476762"'&'&476762"'&'&!!7!!!!ÂH$%ùJI $%HýíH%$ JHHGüöõû Ûü%ŒÃý=ÃJ%$J$$%.$Jùª$$%2$H.$%$øö§?ü' Èþ½m+AWmƒ™¡¥476762#"'&'476762"'&'&4767632"'&'&2"'&'&5476762#"'&'&47672#"'&'&547672"'&'&47676!!7!!!!ÂH$%ùJI $%Hz$JýéJ%$J%$S$JüŸõû Ûü%ŒÃý=ÃJ%$J$$%.$Jü4H$%ýî$%H"H$%ýþ$%Hqö§?ü' Èþ½m+AWmƒ™°´¸¼476762#"'&'476762"'&'&4767632"'&'&2"'&'&5476762#"'&'&47672#"'&'&547672"'&'&476762#"'&'&47676!!7!!!!ÂH$%ùJI $%Hz$JýéJ%$J%$S$Jä$$%ý¨õû Ûü%ŒÃý=ÃJ%$J$$%.$Jü4H$%ýî$%H"H$%ýþ$%H &$Ihö§?ü' Èþ½m+AVl‚—«ÁÅÉÍ476762#"'&'476762"'&'&4767632"'&'&476762"'&'&%4767632"'&'&476762"'&'4767672"'&'$4767>"'&'4767632'&'!!7!!!!ÂH$%ùJI $%HHJýï%$HG$$%$HýÞGH%$Hüãõû Ûü%ŒÃý=ÃJ%$J$$%.$Jú·$H%$H3J&$ý«JHJH‚J&$äö§?ü'Èþ½m)>SW[_2"'&'&476762#"'&'&47672#"'&'&47672"'&'&47676!!7!!!!N$IýéI%$I%$S$IüŸõû Ûü%ŒÃý=tHIýîIH"HIýþIH ö§?ü'Èþ½m!6K`u2"'&'&47676!!7!!!!2"'&'&476762#"'&'&47672#"'&'&47672"'&'&47676E$Iý¨õû Ûü%ŒÃý=m$IýéI%$I%$S$I&$Ihö§?ü'úHIýîIH"HIýþIH Èþ½m,048Ndz476762#"'&'&476762"'&'&!!7!!!!2"'&'&5476762#"'&'&47672#"'&'&547672"'&'&47676ÁH%$HGüöõû Ûü%ŒÃý=m$JýéJ%$J%$S$J|$$%;$%$øö§?ü'úH$%ýî$%H"H$%ýþ$%H Èþ½m+AEIMcy¥476762#"'&'&476762"'&'&476762"'&'&!!7!!!!2"'&'&5476762#"'&'&47672#"'&'&547672"'&'&47676ÁH%$ JHHGüöõû Ûü%ŒÃý=m$JýéJ%$J%$S$J|$$%2$H.$%$øö§?ü'úH$%ýî$%H"H$%ýþ$%H Èþ½m+AW[_cy¥»2"'&'&5476762#"'&'&47672#"'&'&547672"'&'&47676!!7!!!!2"'&'&5476762#"'&'&47672#"'&'&547672"'&'&47676N$JýéJ%$J%$S$JüŸõû Ûü%ŒÃý=m$JýéJ%$J%$S$JH$%ýî$%H"H$%ýþ$%Hqö§?ü'úH$%ýî$%H"H$%ýþ$%H Èþ½m)>SimquŠŸ´É2"'&'&476762#"'&'&47672#"'&'&47672"'&'&476762"'&'&47676!!7!!!!2"'&'&476762#"'&'&47672#"'&'&47672"'&'&47676N$IýéI%$I%$S$Iä$Iý¨õû Ûü%ŒÃý=m$IýéI%$I%$S$IHIýîIH"HIýþIH &$Ihö§?ü'úHIýîIH"HIýþIH Èþ½m*@Uiƒ‡‹¡·Íã%476762"'&'&%4767632"'&'&476762"'&'4767672"'&'$4767>"'&'4767632'&'!!7!!!!2"'&'&5476762#"'&'&47672#"'&'&547672"'&'&47676ÔHJýï%$HG$$%$HýÞGH%$Hüãõû Ûü%ŒÃý=m$JýéJ%$J%$S$J‘$H%$H3J&$ý«JHJH‚J&$äö§?ü'úH$%ýî$%H"H$%ýþ$%HÈþ½m !7Mcy!!7!!!!2"'&'&5476762#"'&'&47672#"'&'&547672"'&'&476762#"'&'&47676Èõû Ûü%ŒÃý=m$JýéJ%$J%$S$Jä$$%mö§?ü'úH$%ýî$%H"H$%ýþ$%H JH Èþ½m"8Ndz2#"'&'&47676!!7!!!!2"'&'&5476762#"'&'&47672#"'&'&547672"'&'&476762#"'&'&47676E$$%ý¨õû Ûü%ŒÃý=m$JýéJ%$J%$S$Jä$$%&$Ihö§?ü'úH$%ýî$%H"H$%ýþ$%H JH Èþ½m+/37Lav‹ 476762#"'&'&476762"'&'&!!7!!!!2"'&'&476762#"'&'&47672#"'&'&47672"'&'&476762"'&'&47676ÁH%$HGüöõû Ûü%ŒÃý=m$IýéI%$I%$S$Iä$I|$I;$%$øö§?ü'úHIýîIH"HIýþIH JH Èþ½m+AEIMcy¥»476762#"'&'&476762"'&'&476762"'&'&!!7!!!!2"'&'&5476762#"'&'&47672#"'&'&547672"'&'&476762#"'&'&47676ÁH%$ JHHGüöõû Ûü%ŒÃý=m$JýéJ%$J%$S$Jä$$%|$$%2$H.$%$øö§?ü'úH$%ýî$%H"H$%ýþ$%H JH Èþ½m+AW[_cy¥»Ñ2"'&'&5476762#"'&'&47672#"'&'&547672"'&'&47676!!7!!!!2"'&'&5476762#"'&'&47672#"'&'&547672"'&'&476762#"'&'&47676N$JýéJ%$J%$S$JüŸõû Ûü%ŒÃý=m$JýéJ%$J%$S$Jä$$%H$%ýî$%H"H$%ýþ$%Hqö§?ü'úH$%ýî$%H"H$%ýþ$%H JH Èþ½m+AWnrvz¦¼Òè2"'&'&5476762#"'&'&47672#"'&'&547672"'&'&476762#"'&'&47676!!7!!!!2"'&'&5476762#"'&'&47672#"'&'&547672"'&'&476762#"'&'&47676N$JýéJ%$J%$S$Jä$$%ý¨õû Ûü%ŒÃý=m$JýéJ%$J%$S$Jä$$%H$%ýî$%H"H$%ýþ$%H &$Ihö§?ü'úH$%ýî$%H"H$%ýþ$%H JHÈþ½m*@Uiƒ‡‹¡·Íãù%476762"'&'&%4767632"'&'&476762"'&'4767672"'&'$4767>"'&'4767632'&'!!7!!!!2"'&'&5476762#"'&'&47672#"'&'&547672"'&'&476762#"'&'&47676ÔHJýï%$HG$$%$HýÞGH%$Hüãõû Ûü%ŒÃý=m$JýéJ%$J%$S$Jä$$%‘$H%$H3J&$ý«JHJH‚J&$äö§?ü'úH$%ýî$%H"H$%ýþ$%H JH Èþ½m ":Pf|’!!7!!!!4767632"'&'&%4767632#"'&'&476762"'&'4767672"'&'&%4767>#"'&'&4767632'&'Èõû Ûü%ŒÃý=ò%$Jýï&$$%H$%$%HýîH$%$%Hmö§?ü'|$$%%$$%3J%$ýÐ$H%$HkJ%$ Èþ½m"9Qg}“©2#"'&'&47676!!7!!!!4767632"'&'&%4767632#"'&'&476762"'&'4767672"'&'&%4767>#"'&'&4767632'&'E$$%ý¨õû Ûü%ŒÃý=ò%$Jýï&$$%H$%$%HýîH$%$%H&$Ihö§?ü'|$$%%$$%3J%$ýÐ$H%$HkJ%$ Èþ½m,048Og}“©¿476762#"'&'&476762"'&'&!!7!!!!4767632"'&'&%4767632#"'&'&476762"'&'4767672"'&'&%4767>#"'&'&4767632'&'ÁH%$HGüöõû Ûü%ŒÃý=ò%$Jýï&$$%H$%$%HýîH$%$%H|$$%;$%$øö§?ü'|$$%%$$%3J%$ýÐ$H%$HkJ%$ Èþ½m+AEIMd|’¨¾Ô476762#"'&'&476762"'&'&476762"'&'&!!7!!!!4767632"'&'&%4767632#"'&'&476762"'&'4767672"'&'&%4767>#"'&'&4767632'&'ÁH%$ JHHGüöõû Ûü%ŒÃý=ò%$Jýï&$$%H$%$%HýîH$%$%H|$$%2$H.$%$øö§?ü'|$$%%$$%3J%$ýÐ$H%$HkJ%$ Èþ½m+AW[_cz’¨¾Ôê2"'&'&5476762#"'&'&47672#"'&'&547672"'&'&47676!!7!!!!4767632"'&'&%4767632#"'&'&476762"'&'4767672"'&'&%4767>#"'&'&4767632'&'N$JýéJ%$J%$S$JüŸõû Ûü%ŒÃý=ò%$Jýï&$$%H$%$%HýîH$%$%HH$%ýî$%H"H$%ýþ$%Hqö§?ü'|$$%%$$%3J%$ýÐ$H%$HkJ%$Èþ½m)>Simqu‹¡¶Ëàõ2"'&'&476762#"'&'&47672#"'&'&47672"'&'&476762"'&'&47676!!7!!!!4767632"'&'&%4767632"'&'&476762'&'4767>"'&'&%4767>"'&'&476762'&'N$IýéI%$I%$S$Iä$Iý¨õû Ûü%ŒÃý=ò%$Iýï&$IHIIHýîHIIHHIýîIH"HIýþIH &$Ihö§?ü'|$I%$I4I%$ýÐ$H%$HlI%$Èþ½m*@Uiƒ‡‹¡·Ìáö %476762"'&'&%4767632"'&'&476762"'&'4767672"'&'$4767>"'&'4767632'&'!!7!!!!4767632"'&'&%4767632"'&'&476762'&'4767>"'&'&%4767>"'&'&476762'&'ÔHIýï%$HG$$%$HýÞGH%$Hüãõû Ûü%ŒÃý=ò%$Iýï&$IHIIHýîHIIH‘$H%$H4I&$ý«IHIHƒI&$äö§?ü'|$I%$I4I%$ýÐ$H%$HlI%$Èþgm "3!254#%!2#!"54!¸xx¿xxûA¿ððûAð,Gõxø‡xxyxxðø‡ððyð÷ÓøÿÈþgm$03;#"'##65##"5476"3!254#%!2#!"54!3#'!#×A; ÃlB;˜;Blà ;ý"xx¿xxûA¿ððûAðK† Òš „Dþ¶D„yþ~&%Nä›ÌkkÌ›äN%&‚Vxø‡xxyxxðø‡ððyðþ¬þUü¼ÚÚÈþgm$0I#"'##65##"5476"3!254#%!2#!"54!!56754&#"5>32×A; ÃlB;˜;Blà ;ý"xx¿xxûA¿ððûAðž¨ýª"?XhU4zHM…9‘®þµ8yþ~&%Nä›ÌkkÌ›äN%&‚Vxø‡xxyxxðø‡ððyðü?rn81^BQ##{„l‹þä0Èþgm$0Y#"'##65##"5476"3!254#%!2#!"54#"&'532654&+532654&#"5>32×A; ÃlB;˜;Blà ;ý"xx¿xxûA¿ððûAðš\e¾±9}F4wCmxolV^^ad_(fQI€7©Zyþ~&%Nä›ÌkkÌ›äN%&‚Vxø‡xxyxxðø‡ððyðý‘mR|†yOFJLl?<:=svcE`Èþgm$03>#"'##65##"5476"3!254#%!2#!"54 !33##5!5×A; ÃlB;˜;Blà ;ý"xx¿xxûA¿ððûAðŽþË5¦‡‡þbyþ~&%Nä›ÌkkÌ›äN%&‚Vxø‡xxyxxðø‡ððyðþ—þ]ýämººyÈþgm$0Q#"'##65##"5476"3!254#%!2#!"54!!67632#"&'53264&#"×A; ÃlB;˜;Blà ;ý"xx¿xxûA¿ððûAðþþy¡^^a`°<~B9>>Eo‚‚o4h6yþ~&%Nä›ÌkkÌ›äN%&‚Vxø‡xxyxxðø‡ððyðð_Ì MLƒ‡KJq f®fÈþgm$0@`#"'##65##"5476"3!254#%!2#!"54"327654'&&'&#"67632#"&547632×A; ÃlB;˜;Blà ;ý"xx¿xxûA¿ððûAðGX3333XW3333«1221€DD &9:D‘TTXW‘§°ll¶122yþ~&%Nä›ÌkkÌ›äN%&‚Vxø‡xxyxxðø‡ððyðýž45[Z4554Z[54bg KL™1LM„ONÞÔÆuv Èþgm$07#"'##65##"5476"3!254#%!2#!"54!#!×A; ÃlB;˜;Blà ;ý"xx¿xxûA¿ððûAððiþ¤ˆHþ3yþ~&%Nä›ÌkkÌ›äN%&‚Vxø‡xxyxxðø‡ððyðð0üíäÈþgm$0=[j#"'##65##"5476"3!254#%!2#!"54"32764'%&'&546 #"'&54767327654'&"×A; ÃlB;˜;Blà ;ý"xx¿xxûA¿ððûAð—º55j]\655þìT./¤RQ./SZ85UVžŸUV56-/.UQ100/¦0/yþ~&%Nä›ÌkkÌ›äN%&‚Vxø‡xxyxxðø‡ððyðý[,+KLV,+–+]12Hdt::dJ01:7PyAAAAyN98Æ?&%%$A?&%%$Èþgm$0P_#"'##65##"5476"3!254#%!2#!"54532767#"&547632#"'&2654'&#"×A; ÃlB;˜;Blà ;ý"xx¿xxûA¿ððûAð.1220DC #<9E¨WX‘§WXkl¶122ÌXf33XU5443yþ~&%Nä›ÌkkÌ›äN%&‚Vxø‡xxyxxðø‡ððyðûßg KKš/˜„MNooÔÆuv rh\Z4554Z\44Èþgm$0>JQ#"'##65##"5476"3!254#%!2#!"54"27654/2#"&546573×A; ÃlB;˜;Blà ;ý"xx¿xxûA¿ððûAðêŽ2332Ž233yƒªªƒ¢ŒŒþt…Œ‰yþ~&%Nä›ÌkkÌ›äN%&‚Vxø‡xxyxxðø‡ððyðþÈVV¬­VVVV­¬V¯ÞÓÔÞÞÔÓÞü¬Ñ)t'ü½Èþgm$0=#"'##65##"5476"3!254#%!2#!"543+53265×A; ÃlB;˜;Blà ;ý"xx¿xxûA¿ððûAð²A@1(TFyþ~&%Nä›ÌkkÌ›äN%&‚Vxø‡xxyxxðø‡ððyððýÜ•FE`TlÈþgm$0J#"'##65##"5476"3!254#%!2#!"54#"&54632.#"3267×A; ÃlB;˜;Blà ;ý"xx¿xxûA¿ððûAð<1e9µÈÉ´9f0/j6||{}7j.yþ~&%Nä›ÌkkÌ›äN%&‚Vxø‡xxyxxðø‡ððyðûëãÎÍåt"$ª¬««$"Èþgm4@L"#"&54632&#"32#"'##65##"5476"3!254#%!2#!"54ûž›œžŸœVX~_ Ua`UU`a”A; ÃlB;˜;Blà ;ý"xx¿xxûA¿ððûAð,×ÚÛ××Û¥É(j8€pžžþžnyþ~&%Nä›ÌkkÌ›äN%&‚Vxø‡xxyxxðø‡ððyðÈþgm$0;#"'##65##"5476"3!254#%!2#!"5433 ##×A; ÃlB;˜;Blà ;ý"xx¿xxûA¿ððûAððj¤þi¸§þxyþ~&%Nä›ÌkkÌ›äN%&‚Vxø‡xxyxxðø‡ððyððþŸaþzþB“þmÈþgm!-0867632 &547632"3!254#%!2#!"54!3#'!#Ì7>T‹>}þÄþÀ}?ŠV<7ýxx¿xxûA¿ððûAðK† Òš „Dþ¶D„¶v>G•-;žŸþn’ ;-•GAÌxø‡xxyxxðø‡ððyðþ¬þUü¼ÚÚÈþgm!-F67632 &547632"3!254#%!2#!"54!!56754&#"5>32Ì7>T‹>}þÄþÀ}?ŠV<7ýxx¿xxûA¿ððûAðž¨ýª"?XhU4zHM…9‘®þµ8¶v>G•-;žŸþn’ ;-•GAÌxø‡xxyxxðø‡ððyðü?rn81^BQ##{„l‹þä0Èþgm!-V67632 &547632"3!254#%!2#!"54#"&'532654&+532654&#"5>32Ì7>T‹>}þÄþÀ}?ŠV<7ýxx¿xxûA¿ððûAðš\e¾±9}F4wCmxolV^^ad_(fQI€7©Z¶v>G•-;žŸþn’ ;-•GAÌxø‡xxyxxðø‡ððyðý‘mR|†yOFJLl?<:=svcE`Èþgm!-0;67632 &547632"3!254#%!2#!"54 !33##5!5Ì7>T‹>}þÄþÀ}?ŠV<7ýxx¿xxûA¿ððûAðŽþË5¦‡‡þb¶v>G•-;žŸþn’ ;-•GAÌxø‡xxyxxðø‡ððyðþ—þ]ýämººyÈþgm!-N67632 &547632"3!254#%!2#!"54!!67632#"&'53264&#"Ì7>T‹>}þÄþÀ}?ŠV<7ýxx¿xxûA¿ððûAðþþy¡^^a`°<~B9>>Eo‚‚o4h6¶v>G•-;žŸþn’ ;-•GAÌxø‡xxyxxðø‡ððyðð_Ì MLƒ‡KJq f®fÈþgm!-=]67632 &547632"3!254#%!2#!"54"327654'&&'&#"67632#"&547632Ì7>T‹>}þÄþÀ}?ŠV<7ýxx¿xxûA¿ððûAðGX3333XW3333«1221€DD &9:D‘TTXW‘§°ll¶122¶v>G•-;žŸþn’ ;-•GAÌxø‡xxyxxðø‡ððyðýž45[Z4554Z[54bg KL™1LM„ONÞÔÆuv Èþgm!-467632 &547632"3!254#%!2#!"54!#!Ì7>T‹>}þÄþÀ}?ŠV<7ýxx¿xxûA¿ððûAððiþ¤ˆHþ3¶v>G•-;žŸþn’ ;-•GAÌxø‡xxyxxðø‡ððyðð0üíäÈþgm!-:Xg67632 &547632"3!254#%!2#!"54"32764'%&'&546 #"'&54767327654'&"Ì7>T‹>}þÄþÀ}?ŠV<7ýxx¿xxûA¿ððûAð—º55j]\655þìT./¤RQ./SZ85UVžŸUV56-/.UQ100/¦0/¶v>G•-;žŸþn’ ;-•GAÌxø‡xxyxxðø‡ððyðý[,+KLV,+–+]12Hdt::dJ01:7PyAAAAyN98Æ?&%%$A?&%%$Èþgm!-M\67632 &547632"3!254#%!2#!"54532767#"&547632#"'&2654'&#"Ì7>T‹>}þÄþÀ}?ŠV<7ýxx¿xxûA¿ððûAð.1220DC #<9E¨WX‘§WXkl¶122ÌXf33XU5443¶v>G•-;žŸþn’ ;-•GAÌxø‡xxyxxðø‡ððyðûßg KKš/˜„MNooÔÆuv rh\Z4554Z\44Èþgm!-;GN67632 &547632"3!254#%!2#!"54"27654/2#"&546573Ì7>T‹>}þÄþÀ}?ŠV<7ýxx¿xxûA¿ððûAðêŽ2332Ž233yƒªªƒ¢ŒŒþt…Œ‰¶v>G•-;žŸþn’ ;-•GAÌxø‡xxyxxðø‡ððyðþÈVV¬­VVVV­¬V¯ÞÓÔÞÞÔÓÞü¬Ñ)t'ü½Èþgm!-:67632 &547632"3!254#%!2#!"543+53265Ì7>T‹>}þÄþÀ}?ŠV<7ýxx¿xxûA¿ððûAð²A@1(TF¶v>G•-;žŸþn’ ;-•GAÌxø‡xxyxxðø‡ððyððýÜ•FE`TlÈþgm!-G67632 &547632"3!254#%!2#!"54#"&54632.#"3267Ì7>T‹>}þÄþÀ}?ŠV<7ýxx¿xxûA¿ððûAð<1e9µÈÉ´9f0/j6||{}7j.¶v>G•-;žŸþn’ ;-•GAÌxø‡xxyxxðø‡ððyðûëãÎÍåt"$ª¬««$"Ùþxm1=I"#"&54632&#"3267632 &547632"3!254#%!2#!"54ûž›œžŸœVX~_ Ua`UU`a‰7>T‹>}þÄþÀ}?ŠV<7ýxx¿xxûA¿ððûAð,×ÚÛ××Û¥É(j8€pžžþžþ0v>G•-;žŸþn’ ;-•GAÌxø‡xxyxxðø‡ððyðÈþgm!-867632 &547632"3!254#%!2#!"5433 ##Ì7>T‹>}þÄþÀ}?ŠV<7ýxx¿xxûA¿ððûAððj¤þi¸§þx¶v>G•-;žŸþn’ ;-•GAÌxø‡xxyxxðø‡ððyððþŸaþzþB“þmÈþgm!)0 00"3!254#%!2#!"54!3#'!#ʘþhþfþˆxx¿xxûA¿ððûAðK† Òš „Dþ¶D„ùýòýú xø‡xxyxxðø‡ððyðþ¬þUü¼ÚÚÈþgm70 00"3!254#%!2#!"54!!56754&#"5>32ʘþhþfþˆxx¿xxûA¿ððûAðž¨ýª"?XhU4zHM…9‘®þµ8ùýòýú xø‡xxyxxðø‡ððyðü?rn81^BQ##{„l‹þä0ÈþgmG0 00"3!254#%!2#!"54#"&'532654&+532654&#"5>32ʘþhþfþˆxx¿xxûA¿ððûAðš\e¾±9}F4wCmxolV^^ad_(fQI€7©Zùýòýú xø‡xxyxxðø‡ððyðý‘mR|†yOFJLl?<:=svcE`Èþgm!,0 00"3!254#%!2#!"54 !33##5!5ʘþhþfþˆxx¿xxûA¿ððûAðŽþË5¦‡‡þbùýòýú xø‡xxyxxðø‡ððyðþ—þ]ýämººyÈþgm?0 00"3!254#%!2#!"54!!67632#"&'53264&#"ʘþhþfþˆxx¿xxûA¿ððûAðþþy¡^^a`°<~B9>>Eo‚‚o4h6ùýòýú xø‡xxyxxðø‡ððyðð_Ì MLƒ‡KJq f®fÈþgm.N0 00"3!254#%!2#!"54"327654'&&'&#"67632#"&547632ʘþhþfþˆxx¿xxûA¿ððûAðGX3333XW3333«1221€DD &9:D‘TTXW‘§°ll¶122ùýòýú xø‡xxyxxðø‡ððyðýž45[Z4554Z[54bg KL™1LM„ONÞÔÆuv Èþgm%0 00"3!254#%!2#!"54!#!ʘþhþfþˆxx¿xxûA¿ððûAððiþ¤ˆHþ3ùýòýú xø‡xxyxxðø‡ððyðð0üíäÈþgm+IX0 00"3!254#%!2#!"54"32764'%&'&546 #"'&54767327654'&"ʘþhþfþˆxx¿xxûA¿ððûAð—º55j]\655þìT./¤RQ./SZ85UVžŸUV56-/.UQ100/¦0/ùýòýú xø‡xxyxxðø‡ððyðý[,+KLV,+–+]12Hdt::dJ01:7PyAAAAyN98Æ?&%%$A?&%%$Èþgm>M0 00"3!254#%!2#!"54532767#"&547632#"'&2654'&#"ʘþhþfþˆxx¿xxûA¿ððûAð.1220DC #<9E¨WX‘§WXkl¶122ÌXf33XU5443ùýòýú xø‡xxyxxðø‡ððyðûßg KKš/˜„MNooÔÆuv rh\Z4554Z\44Èþgm,8?0 00"3!254#%!2#!"54"27654/2#"&546573ʘþhþfþˆxx¿xxûA¿ððûAðêŽ2332Ž233yƒªªƒ¢ŒŒþt…Œ‰ùýòýú xø‡xxyxxðø‡ððyðþÈVV¬­VVVV­¬V¯ÞÓÔÞÞÔÓÞü¬Ñ)t'ü½Èþgm+0 00"3!254#%!2#!"543+53265ʘþhþfþˆxx¿xxûA¿ððûAð²A@1(TFùýòýú xø‡xxyxxðø‡ððyððýÜ•FE`TlÈþgm80 00"3!254#%!2#!"54#"&54632.#"3267ʘþhþfþˆxx¿xxûA¿ððûAð<1e9µÈÉ´9f0/j6||{}7j.ùýòýú xø‡xxyxxðø‡ððyðûëãÎÍåt"$ª¬««$"Èþgm".:0 00"#"&54632&#"32"3!254#%!2#!"54ʘþhþf5ž›œžŸœVX~_ Ua`UU`aþuxx¿xxûA¿ððûAðùýòýúA×ÚÛ××Û¥É(j8€pžžþžoxø‡xxyxxðø‡ððyðÈþgm)0 00"3!254#%!2#!"5433 ##ʘþhþfþˆxx¿xxûA¿ððûAððj¤þi¸§þxùýòýú xø‡xxyxxðø‡ððyððþŸaþzþB“þmÈþgm !! !"3!254#%!2#!"54ŽÑþ‰þ‰þ‡þ‰Ðþ0xx¿xxûA¿ððûAð1þGþïþGþï¹}xø‡xxyxxðø‡ððyðÈþgm#/;>F65'&'&547632&54 632'"3!254#%!2#!"54!3#'!#U9Hª5’?«K1|Ø|1K«?’5©I9üÉxx¿xxûA¿ððûAðK† Òš „Dþ¶D„üLûà C•4$‚jêêj‚$4’F ÅûLñxø‡xxyxxðø‡ððyðþ¬þUü¼ÚÚÈþgm#/;T65'&'&547632&54 632'"3!254#%!2#!"54!!56754&#"5>32U9Hª5’?«K1|Ø|1K«?’5©I9üÉxx¿xxûA¿ððûAðž¨ýª"?XhU4zHM…9‘®þµ8üLûà C•4$‚jêêj‚$4’F ÅûLñxø‡xxyxxðø‡ððyðü?rn81^BQ##{„l‹þä0Èþgm#/;d65'&'&547632&54 632'"3!254#%!2#!"54#"&'532654&+532654&#"5>32U9Hª5’?«K1|Ø|1K«?’5©I9üÉxx¿xxûA¿ððûAðš\e¾±9}F4wCmxolV^^ad_(fQI€7©ZüLûà C•4$‚jêêj‚$4’F ÅûLñxø‡xxyxxðø‡ððyðý‘mR|†yOFJLl?<:=svcE`Èþgm#/;>I65'&'&547632&54 632'"3!254#%!2#!"54 !33##5!5U9Hª5’?«K1|Ø|1K«?’5©I9üÉxx¿xxûA¿ððûAðŽþË5¦‡‡þbüLûà C•4$‚jêêj‚$4’F ÅûLñxø‡xxyxxðø‡ððyðþ—þ]ýämººyÈþgm#/;\65'&'&547632&54 632'"3!254#%!2#!"54!!67632#"&'53264&#"U9Hª5’?«K1|Ø|1K«?’5©I9üÉxx¿xxûA¿ððûAðþþy¡^^a`°<~B9>>Eo‚‚o4h6üLûà C•4$‚jêêj‚$4’F ÅûLñxø‡xxyxxðø‡ððyðð_Ì MLƒ‡KJq f®fÈþgm#/;Kk65'&'&547632&54 632'"3!254#%!2#!"54"327654'&&'&#"67632#"&547632U9Hª5’?«K1|Ø|1K«?’5©I9üÉxx¿xxûA¿ððûAðGX3333XW3333«1221€DD &9:D‘TTXW‘§°ll¶122üLûà C•4$‚jêêj‚$4’F ÅûLñxø‡xxyxxðø‡ððyðýž45[Z4554Z[54bg KL™1LM„ONÞÔÆuv Èþgm#/;B65'&'&547632&54 632'"3!254#%!2#!"54!#!U9Hª5’?«K1|Ø|1K«?’5©I9üÉxx¿xxûA¿ððûAððiþ¤ˆHþ3üLûà C•4$‚jêêj‚$4’F ÅûLñxø‡xxyxxðø‡ððyðð0üíäÈþgm#/;Hfu65'&'&547632&54 632'"3!254#%!2#!"54"32764'%&'&546 #"'&54767327654'&"U9Hª5’?«K1|Ø|1K«?’5©I9üÉxx¿xxûA¿ððûAð—º55j]\655þìT./¤RQ./SZ85UVžŸUV56-/.UQ100/¦0/üLûà C•4$‚jêêj‚$4’F ÅûLñxø‡xxyxxðø‡ððyðý[,+KLV,+–+]12Hdt::dJ01:7PyAAAAyN98Æ?&%%$A?&%%$Èþgm#/;[j65'&'&547632&54 632'"3!254#%!2#!"54532767#"&547632#"'&2654'&#"U9Hª5’?«K1|Ø|1K«?’5©I9üÉxx¿xxûA¿ððûAð.1220DC #<9E¨WX‘§WXkl¶122ÌXf33XU5443üLûà C•4$‚jêêj‚$4’F ÅûLñxø‡xxyxxðø‡ððyðûßg KKš/˜„MNooÔÆuv rh\Z4554Z\44Èþgm#/;IU\65'&'&547632&54 632'"3!254#%!2#!"54"27654/2#"&546573U9Hª5’?«K1|Ø|1K«?’5©I9üÉxx¿xxûA¿ððûAðêŽ2332Ž233yƒªªƒ¢ŒŒþt…Œ‰üLûà C•4$‚jêêj‚$4’F ÅûLñxø‡xxyxxðø‡ððyðþÈVV¬­VVVV­¬V¯ÞÓÔÞÞÔÓÞü¬Ñ)t'ü½Èþgm#/;H65'&'&547632&54 632'"3!254#%!2#!"543+53265U9Hª5’?«K1|Ø|1K«?’5©I9üÉxx¿xxûA¿ððûAð²A@1(TFüLûà C•4$‚jêêj‚$4’F ÅûLñxø‡xxyxxðø‡ððyððýÜ•FE`TlÈþgm#/;U65'&'&547632&54 632'"3!254#%!2#!"54#"&54632.#"3267U9Hª5’?«K1|Ø|1K«?’5©I9üÉxx¿xxûA¿ððûAð<1e9µÈÉ´9f0/j6||{}7j.üLûà C•4$‚jêêj‚$4’F ÅûLñxø‡xxyxxðø‡ððyðûëãÎÍåt"$ª¬««$"Èþgm#/;MW65'&'&547632&54 632'"3!254#%!2#!"54"#"&54632&#"32U9Hª5’?«K1|Ø|1K«?’5©I9üÉxx¿xxûA¿ððûAð3ž›œžŸœVX~_ Ua`UU`aüLûà C•4$‚jêêj‚$4’F ÅûLñxø‡xxyxxðø‡ððyðû¿×ÚÛ××Û¥É(j8€pžžþžÈþgm#/;F65'&'&547632&54 632'"3!254#%!2#!"5433 ##U9Hª5’?«K1|Ø|1K«?’5©I9üÉxx¿xxûA¿ððûAððj¤þi¸§þxüLûà C•4$‚jêêj‚$4’F ÅûLñxø‡xxyxxðø‡ððyððþŸaþzþB“þmÈþgm +!%%!%%"3!254#%!2#!"54dþ¼ecþ»b­²þ¸`þ‰þ‡bþ·³þMxx¿xxûA¿ððûAðnþξþ;¾3¾õþo(þâþTßߨ"(Uxø‡xxyxxðø‡ððyð™ÿj¿V#+3·462"7"32654$"&462"32654462"6"&4622>7>54&'&'>54&#"&547&"'654.#"'72>32%%"&''%&/'%.547&54632æB\BB\t- .¯B\BB\, -þo  ì  ¡lN. † ;qsV6C70AIbbOS‚C‚*¨*‚C‚SObbIA07C6Vsq; † .8˜L+Ê‹­]œKƒ˜YŸýìûþ ©ú© þ ûýìŸY˜ƒKœ]­‹Ê+8ggg‚=>ugggÜ=>ý"6''6']6''6'à$9]W>:ûLkt“LJ˜73(#ƒXQik¤\B?&STTS&?B\¤kiQXƒ#(37˜JL“tkLûþÆ>W]9†¾·ŒŠr¬ÈlÈ¡~3D#®@¬mŠŠm¬@®#D3~¡ÈlȬrŠŒ·¾† Kÿj -Š "(,Ž™Ÿý"&4632'2654#"3#"&46327'7#5%32767654'&'7>732>7>54'.#"&$ &/.#"3276%2654#"'747'&'#".'.54>7>32676 767>32+"&'&'&'&'& '326y2>=32>=-5nnI3=>23=>ûS3Å9?*”nýÒB?94±‹iE€B9?B  R' 8%/6 1.4&++ #?Y=þ÷þ¾þ÷=Y?# ++&4.1 6/%8 'R  -íª*?9ÅúË 9 !;+57? B:),#3‡A32%A(7¤¤¤7(A%23A‡3#,):B ?75+;! 9 "`  B6ˆÄˆ6B  _# 4aþºa7k~Ñn‚nn‚nAÔÒ‹n‚nn‚nµ-Úº”ýMÒÒ“v$DK;7" D;KD$v h5WM' 1 *L7.4(#"NƒemmeƒN"#(4.7L* 1 'MW5hNAš»”ºÚûï*,PÝI  ,9 :kR4_5"2S''RNNR''S2"5_4Rk: 9,  IÝP,*0(sBD0H.&&.H0DBs(þà$'&=ÿj(2AN¸7327327#"'#""'72#"'&547632">7&>32#"'&327654'&#"654.'&'&#"&'%% 767%767%7&54>76?62>?''! '&'7&''¦\E[:TT:[E\lJDEI¸>zÂz>Z†þü+Q (F65/AFeN$0+E¸dFB/56F( Qy 0( ,@“ *ó™t›t™ó* B þ¿þág¤µ굤gþáþÀ úÀ &<ý]iâi]ý;& l m nmuÃÙþàþßÙÁvmmm Œb@,,@bd¨x==x.L #$-G0,a&0$4%Ca,0G-$#  ;§‚t.f>v¡§:ÄÄ:§¡rAe.t‚+B,E@y>zçw„„wçz>y9L,B=|9jwA“uŒ: ‰a a‰ :Œu“Awj9|BQW.>.þ÷ŽžžŒ .>.QWB ªÿj– %1;Gh˜ª¼462"7"32654"547632"&462432#"'&"3265473267!"& 7654'>54'&#".#" 632+ '.'&'#"&'&'&54632676&#";67&%32767654&'&#"RtRRt‘78,%,% RtRRtþÿ%,%,78üãj‚Î`´;j¨þî€êŠÀ¥|TVZ‚GqpG‚ZVT|Ðj7aij "†Y:8«m”þà”m«8:Y†" jiaÖ (+G&<5t5<&G+( tRRtRh11þR $ $ tRRtRþ$ $k11ý¨T¤XLTÖrþÞËš¸†•,0^1ŠioE55EoiŠ1^0,•†¸š¤|ˆ›¤‡,6[?Ki{pn­7LL7­np{iK?[6,‡¤›ˆ|ýÌR:3—/‡{W``W{‡/—3:R ªÿj­n ".49>BF4632#"&%462#"&! ! ! ! ! 67##%67#5#‚Q;:RR:;QBRtSS:;Qüm¿<=½þCþÃþÄþA‡tu ýôþ‹þŒýòÛþ•ýüþ”²XL¤ˆ¤L Hdý eÿ;QQ;:SS:;QQ;:SSÛþÄþC½<=Àþ@þÃuýñþ‹þŒýô jþþþ–jß *%þ¦ZþÛ*™Rd¸¸f ªÿj­n #/5:?CG! ! ! ! 462#4&"!462#4&"! 67##%67#5#1¿<=½þCþÃþÄþA‡tu ýôþ‹þŒýò¼ŒÄŒ‡=T=ý)ŒÄŒ‡=T=ßÛþ•ýüþ”²XL¤ˆ¤L Hdý eêþÄþC½<=Àþ@þÃuýñþ‹þŒýô ‹ÅÅ‹SwwS‹ÅÅ‹SwwS¬þþþ–jß *%þ¦ZþÛ*™Rd¸¸f _ÿjùn #/Y~5#67##67#%! 462#4&"!462#4&"! "'&/! &"&5476?&7! 4'#"'&/&'&! 6?"'462#4&"!462#4&"! ! ! ! ! %!7276ŒÄŒ‡=T=Ɍȇ=T=û½tu ýôþ‹þŒýò‡¿<=½þCþÃþÄþAÛþ•ýüþ”BüW!\ŽÊÊŽ\Œ‹ÅÅ‹SwwS‹ÅÅ‹SwwS¢uýñþ‹þŒýô tþÄþC½<=Àþ@þ¹þþþ–j{u\ŽŽ\ªÿj­n #/;AJ"&547462#4&"!462#4&"! ! ! ! ! %!7276¨AL6û¯ŒÄŒ‡=T=Ɍȇ=T=û½tu ýôþ‹þŒýò‡¿<=½þCþÃþÄþAÛþ•ýüþ”BüW!\ŽÊÊŽ\,€8"+6,#5 ‹ÅÅ‹SwwS‹ÅÅ‹SwwS¢uýñþ‹þŒýô tþÄþC½<=Àþ@þ¹þþþ–j{u\ŽŽ\ªÿj­n %+3%%''7'7! ! ! ! ! %!$76|'MÆÆMþÙ þÙMÆÆMýõtu ýôþ‹þŒýò‡¿<=½þCþÃþÄþAÛþ•ýüþ”BüW!\Ž”Ž\'În‹ŠnÎUUÎnŠ‹nýõuýñþ‹þŒýô tþÄþC½<=Àþ@þ¹þþþ–j{u\ŽŽ\ÿjÈc*5IW_7767 '&! /! '462#"&%4632#"&4$! ! 7&%654$! 6! &#"32s(“Ž's%2¶ýü¶2þï¿<=½Þåþ×þØæà”RtSS:;Qý¾Q;:RR:;Qþ €ýâýôþ‹þŒýòãþÛ¼þCþÃþÄþA½ôJKC°Þݰ°ÝÞÑG,&Ž',H92µµ3QþÄþC½<=à99à*;QQ;:SS:;QQvRS\†¾¾†‚\üþ¥þŒýô t[ü\6JQrrQJ6Ïõnnªÿj­0-9J%462#"&%4632#"&'7 767 '&! ! 6 %! 7Ò/MþÑ?RtSS:;Qý¾Q;:RR:;QMþÑMýÆs(Ž”Ž's%2¶ýü¶2þï¿<=½þCþÃþÄþAâ„*„»­ýôþ‹þŒýò®gÔoÕþ¼;QQ;:SS:;QQvRSìnÕoý>G,&ŽŽ',H92µµ3QþÄþC½<=Àþ@**ìýÐçþÑþŒýô t/ç0ªÿj­n'297 767 '&! ! ! ! 4632#"&-%s(Ž”Ž's%2¶ýü¶2þï¿<=½þCþÃþÄþA‡tu ýôþ‹þŒýòØQ;:RR:;Qú'MÆÆMþÙÑG,&ŽŽ',H92µµ3QþÄþC½<=Àþ@þÃuýñþ‹þŒýô ‡;QQvRSdÎn‹ŠnΪÿj­n'3?7 767 '&462#4&"!462#4&"! ! ! ! s(Ž”Ž's%2¶ýü¶2,ŒÄŒ‡=T=Ɍȇ=T=û½tu ýôþ‹þŒýò‡¿<=½þCþÃþÄþAÑG,&ŽŽ',H92µµ3ó‹ÅÅ‹SwwS‹ÅÅ‹SwwS¢uýñþ‹þŒýô tþÄþC½<=Àþ@ªÿj­n 7CQ462#4&"!462#4&"!27&'# 3 536! ! ! 327674'&fŒÄŒ‡=T=ý)ŒÄŒ‡=T=þ”¿<ˆveA+-þþþ”‡”‡{7ÑþCþÃþÄþA‡tu ýôþ‹þŒýòO\&$ !Œ‹ÅÅ‹SwwS‹ÅÅ‹SwwS¢þÄþC)0ljÊþåÉÕ dcÚ3=Àþ@þÃuýñþ‹þŒýô 6C$(9.ªÿj­n'3?7 767 '&"&53265!"&53265! ! ! ! s(Ž”Ž's%2¶ýü¶2ŒÄŒ‡=T=þ7ŒÄŒ‡=T=ý?tu ýôþ‹þŒýò‡¿<=½þCþÃþÄþAÑG,&ŽŽ',H92µµ3ï‹ÅÅ‹SwwS‹ÅÅ‹SwwSþbuýñþ‹þŒýô tþÄþC½<=Àþ@ªÿj­n/;GW2#'&5&7633476!2367672#'&'476! ! ! ! 7 767 '&¦<2¨Ÿ> &?)   #ýI=#   )?& >Ÿ¨2<þtu ýôþ‹þŒýò‡¿<=½þCþÃþÄþAìs(Ž”Ž's%2¶ýü¶2À%?A>ϾDLD 1GG1 DLD¾Ï>A?%þ*uýñþ‹þŒýô tþÄþC½<=Àþ@ýªG,&ŽŽ',H92µµ3ªÿj­n#3<! 4'#"&5"&=#! ! %7767 '&!&'&! 1¿<=½Tn¦ì¦¦ì¦nU‡tu ýôþ‹þŒýòss(“Ž's%2¶ýü¶2`”ÞþÂþÄàêþÄþC½<àOdŽŽddŽŽdO Ãuýñþ‹þŒýô [G,&Ž',H92µµ3;ààªÿj­n)5!!5!2767!! ! ! ! ˜ªûÔªlÊŽ's%2¶þþü~tu ýôþ‹þŒýò‡¿<=½þCþÃþÄþAŒ‡‡‡‡ý¬Ž',H92µ9uýñþ‹þŒýô tþÄþC½<=Àþ@ªÿj­n%15!4632#"&%462#"&! ! ! ! LÀüvQ;:RR:;QBRtSS:;Qûætu ýôþ‹þŒýò‡¿<=½þCþÃþÄþAq‡‡Œ;QQvRS:;QQ;:SSÙuýñþ‹þŒýô tþÄþC½<=Àþ@ªÿj­n #5!!5!5!! ! ! ! ˜ªûÔªþŒÀúžtu ýôþ‹þŒýò‡¿<=½þCþÃþÄþAŒ‡‡‡‡ý凇yuýñþ‹þŒýô tþÄþC½<=Àþ@ªÿj­n )7! ! ! ! 5!5!2#"&545!5!2#"&5451¿<=½þCþÃþÄþA‡tu ýôþ‹þŒýò¢Àüx:RR:;QVx:SS:;QêþÄþC½<=Àþ@þÃuýñþ‹þŒýô ‡‡-‡Q;:SS:‡Q;:SS:ªÿj­n *6B"&475!%7 '%4632#"&%462#"&! ! ! ! PA6L6ü=À þ¨MXûÝMXMþéQ;:RR:;QBRtSS:;Qûætu ýôþ‹þŒýò‡¿<=½þCþÃþÄþA¬€5O66O5þE‡‡¥ðoñnnñoþ¯;QQvRS:;QQ;:SS‘uýñþ‹þŒýô tþÄþC½<=Àþ@ªÿj­n'35!"&53265!"&53265! ! ! ! LÀ6ŒÄŒ‡=T=þ7ŒÄŒ‡=T=ý?tu ýôþ‹þŒýò‡¿<=½þCþÃþÄþAq‡‡‹ÅÅ‹SwwS‹ÅÅ‹SwwSþbuýñþ‹þŒýô tþÄþC½<=Àþ@ªÿj­n%1%'4632#"&%462#"&! ! ! ! •9g9ü†Q;:RR:;QBRtSS:;Qûætu ýôþ‹þŒýò‡¿<=½þCþÃþÄþA¬{–{»;QQvRS:;QQ;:SSÙuýñþ‹þŒýô tþÄþC½<=Àþ@ªÿj­nB'! ! ! ! 7"'&'&#"'67623276762&É__ýZ¿<=½þCþÃþÄþA‡tu ýôþ‹þŒýòåþò_š4) FÄF "58 yFÄF "54( FÄFy\__þ€þÄþC½<=Àþ@þÃuýñþ‹þŒýô æ_þòþWi"bc(!__9("bb("_i"bb"(9_ªÿj­n #/;4632#"&%462#"&7'7'7'! ! ! ! ‚Q;:RR:;QBRtSS:;QÎPA<<þýAPü´tu ýôþ‹þŒýò‡¿<=½þCþÃþÄþAÿ;QQ;:SS:;QQ;:SSþ$>NvX..XvN>#uýñþ‹þŒýô tþÄþC½<=Àþ@ªÿj­n")6BN2#'&5&76334764632#"&-%7'7'7'! ! ! ! j<2¨ž> &@(   "üVQ;:RR:;Qú'MÆÆMþÙ†PA<<þýAPü´tu ýôþ‹þŒýò‡¿<=½þCþÃþÄþA¯%?A>ϾDLD 1GN;QQvRSdÎn‹ŠnÎþ>NvX..XvN>#uýñþ‹þŒýô tþÄþC½<=Àþ@ªÿj­n $0<462#4&"!462#4&"7'7'7'! ! ! ! ŒÄŒ‡=T=Ɍȇ=T=÷PA<<þýAPü´tu ýôþ‹þŒýò‡¿<=½þCþÃþÄþAŒ‹ÅÅ‹SwwS‹ÅÅ‹SwwSþ]>NvX..XvN>#uýñþ‹þŒýô tþÄþC½<=Àþ@ªÿj­n $0<7'7'7'"&53265!"&53265! ! ! ! öPA<<þýAPLŒÄŒ‡=T=þ7ŒÄŒ‡=T=ý?tu ýôþ‹þŒýò‡¿<=½þCþÃþÄþAé>NvX..XvN>Á‹ÅÅ‹SwwS‹ÅÅ‹SwwSþbuýñþ‹þŒýô tþÄþC½<=Àþ@ªÿj­n ".8>4632#"&%462#"&! ! ! ! %5!#"&5!#26‚Q;:RR:;QBRtSS:;Qüm¿<=½þCþÃþÄþA‡tu ýôþ‹þŒýò¢ÀòŒÄŒUÎ=T=ÿ;QQ;:SS:;QQ;:SSÛþÄþC½<=Àþ@þÃuýñþ‹þŒýô c‡‡‹ÅÅ‹Swwªÿj­n )394632#"&-%! ! ! ! %5!#"&5!#26‚Q;:RR:;Qú'MÆÆMþÙüµ¿<=½þCþÃþÄþA‡tu ýôþ‹þŒýò¢ÀòŒÄŒUÎ=T=ý;QQvRSdÎn‹ŠnÎèþÄþC½<=Àþ@þÃuýñþ‹þŒýô c‡‡‹ÅÅ‹Swwªÿj­n %/5! ! ! ! '7'7%%5!#"&5!#261¿<=½þCþÃþÄþA‡tu ýôþ‹þŒýò2þÙMÆÆMÇ'MÆÆMþÙýÐÀòŒÄŒUÎ=T=êþÄþC½<=Àþ@þÃuýñþ‹þŒýô ±UÎnŠ‹nÎÎn‹ŠnÎþ‡‡‹ÅÅ‹Swwªÿj­n)5F%7 '%4632#"&%462#"&! ! ! ! 676 &'&#&þ¨MXûÝMXMþéQ;:RR:;QBRtSS:;Qûætu ýôþ‹þŒýò‡¿<=½þCþÃþÄþAì%2¶¶3$s(ŽÊÊŽ'ðoñnnñoþ¯;QQvRS:;QQ;:SS‘uýñþ‹þŒýô tþÄþC½<=Àþ@ý%83µµ38H,'ŽŽ',ªÿj­n"-9EV%'6762&'&"%7 '%4632#"&%462#"&! ! ! ! 676 &'&#&ÕyFÄFyT;þ¨MXûÝMXMþéQ;:RR:;QBRtSS:;Qûætu ýôþ‹þŒýò‡¿<=½þCþÃþÄþAì%2¶¶3$s(ŽÊÊŽ'Ÿ9("bb"(9<<dðoñnnñoþ¯;QQvRS:;QQ;:SS‘uýñþ‹þŒýô tþÄþC½<=Àþ@ý%83µµ38H,'ŽŽ',ªÿj­n)5F'4632#"&%462#"&%! ! ! ! 676 &'&#&†MþÑMþ+Q;:RR:;QBRtSS:;Qþ/MþÑþ%tu ýôþ‹þŒýò‡¿<=½þCþÃþÄþAì%2¶¶3$s(ŽÊÊŽ'gnÕoÞ;QQvRS:;QQ;:SSìÔoÕýñuýñþ‹þŒýô tþÄþC½<=Àþ@ý%83µµ38H,'ŽŽ',ªÿj­n(,7BFV676 &'&#&! ! ! ! %462#"&%4632#"&''6762&'&"%2¶¶3$s(ŽÊÊŽ'þ¡¿<=½þCþÃþÄþA‡tu ýôþ‹þŒýò(/MþÑ?RtSS:;Qý¾Q;:RR:;QMþÑM‚yFÄFyTL83µµ38H,'ŽŽ',åþÄþC½<=Àþ@þÃuýñþ‹þŒýô ñÔoÕþ¼;QQ;:SS:;QQvRSìnÕoü 9("bb"(9<<ªÿj­n #4O! ! ! ! "&53265676 &'&#&"&54?&'&532651¿<=½þCþÃþÄþA‡tu ýôþ‹þŒýòHŒÄŒ‡=T=þ²%2¶¶3$s(ŽÊÊŽ'²F:M L6 M:F‡=T=êþÄþC½<=Àþ@þÃuýñþ‹þŒýô ‹ÅÅ‹SwwSüÄ83µµ38H,'ŽŽ',ƒŒbQ?7#+6,#5? RbŒSwwSªÿj­n*6676 &'&#&%%''7'7! ! ! ! %2¶¶3$s(ŽÊÊŽ'ì'MÆÆMþÙ þÙMÆÆMýõtu ýôþ‹þŒýò‡¿<=½þCþÃþÄþAL83µµ38H,'ŽŽ',"În‹ŠnÎUUÎnŠ‹nýõuýñþ‹þŒýô tþÄþC½<=Àþ@ªÿj­n!-9' 7 676 &'&#&"&47! ! ! ! É__¸þò_ü/%2¶¶3$s(ŽÊÊŽ'ÚB6L6û¿<=½þCþÃþÄþA‡tu ýôþ‹þŒýò\__þò_þòý‘83µµ38H,'ŽŽ',#€5O66O5¾þÄþC½<=Àþ@þÃuýñþ‹þŒýô ªÿj­n ".4<4632#"&%462#"&! ! ! ! !4 !&'& ‚Q;:RR:;QBRtSS:;Qûætu ýôþ‹þŒýò‡¿<=½þCþÃþÄþAóü'£'ü©½EkþÒjEÿ;QQ;:SS:;QQ;:SSÛuýñþ‹þŒýô tþÄþC½<=Àþ@ü¤èFþºa`LtuLªÿj­n)5;C%7 '%4632#"&%462#"&! ! ! ! !4 !&'& þ¨MXûÝMXMþéQ;:RR:;QBRtSS:;Qûætu ýôþ‹þŒýò‡¿<=½þCþÃþÄþAóü'£'ü©½EkþÒjEðoñnnñoþ¯;QQvRS:;QQ;:SS‘uýñþ‹þŒýô tþÄþC½<=Àþ@ü¤èFþºa`LtuLªÿj­n NZflx„Š–œ¢32654&#"!&'& !4 ! 4'#&'#5"'#5&47&'##"&'##5! ! 4632#"&%6754&#"326'#"&546325&'&'67%&'%67%–tJUioOLrþ7½EkþÒjE?ü'£'û ¿<=½5D%DmŽ8D++!"D"!++D8ŽnD%D6‡tu ýôþ‹þŒýòq"!#ýž ##  rLOoiUJt…#!"$ g!"$!"+üO# *"!$RluIOooüé`LtuLæèFþº7þÄþC½<›…º;.)þnY6G$@<œ<=ýj–þÃ<œ<@$F7Y“*.þż†œuýñþ‹þŒýô ¤!!# ü ¢þ‘OooOIulR #!!y£ Œ( ò &„!-Òœ-!ý à ªÿj­n '-5' 7 ' 7! ! ! ! !4 !&'& É__¸þò_üÛ__¸þò_ú¼tu ýôþ‹þŒýò‡¿<=½þCþÃþÄþAóü'£'ü©½EkþÒjE__þò_þòþX__þò_þò?uýñþ‹þŒýô tþÄþC½<=Àþ@ü¤èFþºa`LtuLªÿj­n)5AGO767632#"&53265!"&53265! ! ! ! !4 !&'& ÄU% $  ';ŒÄŒ‡=T=þ7ŒÄŒ‡=T=ý?tu ýôþ‹þŒýò‡¿<=½þCþÃþÄþAóü'£'ü©½EkþÒjEÈt2  "$À‹ÅÅ‹SwwS‹ÅÅ‹SwwSþbuýñþ‹þŒýô tþÄþC½<=Àþ@ü¤èFþºa`LtuLªÿj­n %+3%%''7'7! ! ! ! !4 !&'& |'MÆÆMþÙ þÙMÆÆMýõtu ýôþ‹þŒýò‡¿<=½þCþÃþÄþAóü'£'ü©½EkþÒjE'În‹ŠnÎUUÎnŠ‹nýõuýñþ‹þŒýô tþÄþC½<=Àþ@ü¤èFþºa`LtuL_ÿjùn =b%!4 '7'7%%! "'&/! &"&5476?&7! 4'#"'&/&'&! 6?"'¤ü'£'ý¸þÙMÆÆMÇ'MÆÆMþÙü.tu ];6L *Ñþúþ‹þŒþùÑ+ L6<\‡¿<=½%&-ˆ)/šÞþÂþÄàš/)ˆ-LËèFþºtUÎnŠ‹nÎÎn‹ŠnÎèuýñþ‹%&69 þéÑþúÐ96&%þÄþC½<9ˆ-Çšàà›Æ -ˆ9ªÿj­n*6462"4632#"&%462#"&! ! ! ! ,–Ô––ÔþÀQ;:RR:;QBRtSS:;Qûætu ýôþ‹þŒýò‡¿<=½þCþÃþÄþAZÔ––Ô–;;QQ;:SS:;QQ;:SSÛuýñþ‹þŒýô tþÄþC½<=Àþ@ªÿj­n%1=%7 '%4632#"&%462#"&462"! ! ! ! þ¨MXûÝMXMþéQ;:RR:;QBRtSS:;QþèKjKKjü³tu ýôþ‹þŒýò‡¿<=½þCþÃþÄþAðoñnnñoþ¯;QQvRS:;QQ;:SSþjKKjK¦uýñþ‹þŒýô tþÄþC½<=Àþ@ªÿj­n#.:F"&47462"%7 '%4632#"&%462#"&! ! ! ! PA6L6ý–Ô––ÔUþ¨MXûÝMXMþéQ;:RR:;QBRtSS:;Qûætu ýôþ‹þŒýò‡¿<=½þCþÃþÄþA¬€5O66O5þ.Ô––Ô–Rðoñnnñoþ¯;QQvRS:;QQ;:SS‘uýñþ‹þŒýô tþÄþC½<=Àþ@#ÿ<5nk”&462 &462%'%%7462"5.'46767 #5476764&"#5 '#54&/&'&'."% 7547676767>76767&'& QRtSSýIQQuRRþùMXM~þ¨MXüÈ–Ô––Ôý¡HVŠh=;®é®;=hŠVH‡&z':%i)8^'ˆnþûyˆ'^8)i%:'z&Lw l0‘8< 32Þý†à33<8‘0(SuQQuSSuQQvRînñoððoñüÖÔ––Ô–þxË>[1'Sk ß°þø¯à kSþÙþé1[>Ëç$n9ð(#móq,%@76?62>?''! '&&''7&''%4."#462!4."#462&'32?67#5#"'ì‚\>xcev> rtž’6þíþœþì;#• yý]Mþ´4þÈf£µ굡gþÍ.þºG *ó™t›t™ó* € &<ý]iâi]ý;& ikhdtÀÙþàþßÙÀt^b e11B1‡ŒÄŒÉ1B1‡ŒÄŒþ:$(2+$) ˆ`3H:þG??4ü.x==xü%B DG“}KSBÇ$bCJAi?l:1âw„„vã85j?g>LCR4.f>v¡§:ÄÄ:§¡rAe½ME9jwA“uŒ: ‰a a‰ :Œu“Awj9DMDVW$@"<<þýŒžžŒ@6 @"O`DQ+ZEEY,ŒÄÄŒ+ZEEY,ŒÄÄŒþ  ‘„c'F aa C `ÿjø?H]¨¶ÄÎÔÚ654.'&'& &'6?#"'% 76767%767#"&/27#"'7327 $'&54732"&546?4''7&54>76?62>?'#"&/ '&&'4."#462!4."#462&'32?67#5#"'º *òštþÈt˜ô* Pˆ,3,04þÈf¤µé¶¢fþÌ.0,4.ŠRüÈ‚\>xbfv> rtž’6þîþœþì<"– xü|%7>4Zfd &<ý^iáj]ýŽ<& hjZ4<6$,4,tÀØýÀÚÀt*$ä0B2ˆŒÄŒÊ0B2ˆŒÄŒþ:$(2,$( ˆ`4H:þF>@4|(,.f>v¡§:ÄÄ:§¡rAe.*',,ˆ3<%WLi?l:1âw„„vã85j?gD`(<3ˆ,¯.x==xü%B DG“}KSBA6%,4JDME9jwA“uŒ: ‰a a‰ :Œu“Awj9DMD44,%6<3*hbþýŒžžŒ]p-oÄ+ZEEY,ŒÄÄŒ+ZEEY,ŒÄÄŒþ  ‘„c'F aa C :ÿj&*_œª´ÃÐ27#"'7327 $'&54732#"'267#"%% 76767%767%7654.'&'&#"&'&54>76?62>?''! '&&''7&''%4632#"'&7">7&#"'&'67632327654'&#"ì‚\>xcev> rtž’6þíþœþì;#• yprw??5Àê½2H:uü}Mþ´4þÈf£µ굡gþÍ.þºG *ó™t›t™ó* € &<ý]iâi]ý;& ikhdtÀÙþàþßÙÀt^b eâcC>]0L!(C8ý$0+Eÿ8C%$M/2-;Cc¤ .* ,@ü.x==xü%B DG“}KSBh ELME N$bCJAi?l:1âw„„vã85j?g>LCR4.f>v¡§:ÄÄ:§¡rAe½ME9jwA“uŒ: ‰a a‰ :Œu“Awj9DMDVW$@"<<þýŒžžŒ@6 @"O`DŸF_W;E !I+ /!-! CB*&_z 5=ÿjJƒ˜­7327327#"'#""'72%654.'&'&#"&'%% 767%767%7&54>76?62>?''! '&'7&''>32#'&'4632%2347632#'&546¦\E[:TT:[E\lJDEI¸>zÂz>Z†º *ó™t›t™ó* B þ¿þág¤µ굤gþáþÀ úÀ &<ý]iâi]ý;& l m nmuÃÙþàþßÙÁvmmm ã :-.>>Ÿ¨1@/=# ¨-:  #=/@1¨Ÿ>>Œb@,,@bd¨x==x.8‚t.f>v¡§:ÄÄ:§¡rAe.t‚+B,E@y>zçw„„wçz>y9L,B=|9jwA“uŒ: ‰a a‰ :Œu“Awj9|BQW.>.þ÷ŽžžŒ .>.QWB•0B=1JJ¾Ï=B*HGrB0GH*B=ϾJJ1= =ÿj(7Du®¸-'"'72#"'&547632">7&>32#"'&327654'&#"654.'&'&#"&'%% 767%767%7&54>76?62>?''! '&'7&''2767!Ò/MþÑMþÑMs>zÂz>Z†þü+Q (F65/AFeN$0+E¸dFB/56F( Qy 0( ,@“ *ó™t›t™ó* B þ¿þág¤µ굤gþáþÀ úÀ &<ý]iâi]ý;& l m nmuÃÙþàþßÙÁvmmm ïÊŽ(s"5µþýgÔoÕnnÕoþ=x==x.L #$-G0,a&0$4%Ca,0G-$#  ;§‚t.f>v¡§:ÄÄ:§¡rAe.t‚+B,E@y>zçw„„wçz>y9L,B=|9jwA“uŒ: ‰a a‰ :Œu“Awj9|BQW.>.þ÷ŽžžŒ .>.QWBþŽ(+H65µ=ÿj'4i¨µ¾#"'&547632">7&>32#"'&327654'&#"654.'&'&#"&'%% 76?%767%72>?''! '&''7&''7&'54>76?7'7'7'27#"'7l+Q (F65/AFeN$0+E¸dFB/56F( Qy 0( ,@“ *ó™t›t™ó*  B þ¿þáf£µ굡gþáþÀ ýÓâi]ý;&  l m nmtÀÙþàþßÙÀtmmm l &<ý]£PA<<þýAP „[>wdev>¨L #$-G0,a&0$4%Ca,0G-$#  ;§ƒs.f>v¡§:ÄÄ:§¡rAe.$‚A+B,E@y>zâw„„vãz>y9L,B a‰ :Œu“Awj9ŠWBQW.>.þýŒžžŒ.>.QWB`*9jwA“uŒ: ‰aû:=NwY.-YwN=Ú.x==x =ÿj'4ež¦¯¸¼À#"'&547632">7&>32#"'&327654'&#"654.'&'&#"&'%% 767%767%7&54>76?62>?''! '&'7&''62&"%6 &#"27#"'7'%%l+Q (F65/AFeN$0+E¸dFB/56F( Qy 0( ,@“ *ó™t›t™ó* B þ¿þág¤µ굤gþáþÀ úÀ &<ý]iâi]ý;& l m nmuÃÙþàþßÙÁvmmm GFÄF`Tþµµ`ŽÊÈ„[>wdev>öMþÑMþ{/MþѨL #$-G0,a&0$4%Ca,0G-$#  ;§‚t.f>v¡§:ÄÄ:§¡rAe.t‚+B,E@y>zçw„„wçz>y9L,B=|9jwA“uŒ: ‰a a‰ :Œu“Awj9|BQW.>.þ÷ŽžžŒ .>.QWBþcc_<<õµµ`ŽŽú.x==x=nÕoÔÔoÕ=ÿj ,4dŽ"&545"'7276?.53265!"&532656 & &6?6?62>?'' '7&''!2$7%767%7654/&'& &'%%B€M 6L6nÂv>[„[3 M€‡=T=þ7ŒÄŒ‡=T=÷µµ`ŽþnýÕ &<ý]iâi]ý;&+ l m nmuþdý¿þfvmmm ;×ÞõYgþáþÀ A+ó™tþÈt™ó* B þ¿ˆ‹´?5O66,5=x..c?´‹SwwS‹ÅÅ‹SwwSüÚµµ`ŽŽÆ|ÄjauŒ: ‰a a‰ :ŒuaÌ È|BQW.>.þ÷þÔ* .>.QWBæþûçz>y9L,B+‚Qˆ®b§:ÄÄ:§¡T¨nk‚+B,E@y>=ÿj4s{ƒ‡‹654.'&'&#"&'%% 76?%767%72>?''! '&''7&''7&'54>76?!&'& !476327'* *ó™t›t™ó*  B þ¿þáf£µ굡gþáþÀ ýÓâi]ý;&  l m nmtÀÙþàþßÙÀtmmm l &<ý]†½EkþÒjE?ü““ÒÑ(•þò_üÛ__Úƒs.f>v¡§:ÄÄ:§¡rAe.$‚A+B,E@y>zâw„„vãz>y9L,B a‰ :Œu“Awj9ŠWBQW.>.þýŒžžŒ.>.QWB`*9jwA“uŒ: ‰aûGaKtuKç礣þº~_þò___ÿ¹šÇ @ÔÌ03#Çu™þˆü×ÿ)Ù¥@ ÎddÔüÜì1Ô<ì20K°TK°T[X½@ÿÀ878YK°TK° T[K°T[X½ÿÀ@878YK°TK°T[X½@ÿÀ878YK°TX½ÿÀ@878Y@````pppp]3#%3#þ^ËËþyËËÙËËËýsîþðö@BúÄÀ1ôÌ0KSXÉÉY"K° TX½ÿÀ@878YK°TX½@ÿÀ878Y@ %%6FVjg //]]3#þ7¹ä™öþøü¶ÿJéu@!  ÃÃúVV ÔìÔì99991ô<ìÔì2990K° TX½ÿÀ@878YK°TX½@ÿÀ878Y´ ]'.#"#4632326=3#"&ýü9 $(}gV$=09" (}gT";9! 2-ev 3)dwý îþ‹ö‰@BúÄÀ1ôÌ0KSXÉÉY"K° TX½ÿÀ@878YK°TX½@ÿÀ878Y@*$$5CUUŸŸ¯¯//]]#ýÇÄ™æöþøüÏîÿ1øw@ úÔÄ91ô<Ä90K° TX½ÿÀ@878YK°TX½@ÿÀ878YK°TX½ÿÀ@878Y@ //- ]3#'#ý¢¼Ó‹¦¦‹øþö²²üÏîÿ1ø†@ úÔÄ91ôÄ290K° TK° T[K° T[K° T[X½ÿÀ@878YK°TX½@ÿÀ878YK°TX½ÿÀ@878Y@ "  ]373ý¢Ó‹¦¦‹Óî ²²þöüÇÿ9ø #.#"#>32Çv cSRav  Ÿ6978w{züÇÿ9ø j@à úVVÔìÔì1ôüÌ20K° TX½ÿÀ@878YK°TX½@ÿÀ878YK°TK°T[X½ÿÀ@878Y332673#"&üÇv cSRav  Ÿø6978w{zýšþfÛG·ÎdÔì1Ôì0K°TK°T[X½@ÿÀ878YK°TX½ÿÀ@878Y3#ýšÌÌÛÍüæîÿ²ö@Ì1Ô<Ì203#3#þù¹ä™‹¹ä™öþøþøüNîÿö#!#ýÄ™äÄ™äöþøþø––53#–––––73#'3#ú––ú–––––– 3#3#'3#}––}––ú–––d–––ÿ– 3#3#'3#}––}––ú––d––––ÿ––3#3#––––d––ÿ– 3#3#3#3#ú––––ú––––d––d––‚ÿìï&;#"'&'#"'$&733$767654'3ïF??7Kÿÿÿì‡XNÿÿÿì~XO‚ÿ¥\,>%!$'$&73!2%7&'&547676323!!"'654'&'&#"xhnþèþðþÏ}þ·@¸AËQ+è"R¼:4RQ‰P þôioh4"(=)1$+<'gŠ\^ˆsM6,|y$›K2S–%j¸ßAzG' <8BNÿì?Ù0654'&323276767'&54767632#!V)B,4((7(*Hý®ñT—O<?a‚Nb–NLZB`.NJ|m‘þ¿+M;3*)3P&þ· ]027EW4,”E$2Hf3ŒÐˆ,'ÿì !5;#"'+5327&'&54767632"67654'&'&f·$'“Ùˆ¹¹ˆÙ“'$¹A??8 D?$ 9úP–2*I1C2¸99¸(M.L,0W¸ 5+5DE2.4! kþ Àä.@%&'&'&547676323!!#'$'&5473!2766'&'&#"¸B.y9“(“)Wp8c2þô0-=€ž¯ÍþŽ^E>¸><Œ–Õl/"'"3 9Ld/  #+m¹=¥E2X‘:Ö¸zF‘NV¾Š}¦`k›L:‚DbZzWK# :<,; ÿÿÿì?Ù+ÿÿÿì ,ÿÿÿì‡è&(!àRÿÿÿì~è&)!àR¶· %4'&"2>"'&4762<R8R8z?@¸?@@?¸@Ü(8)*8…¸@@@@¸@??ÿÿ‚þï '"¼Š'2©þ'ÿÿÿìþôè&('"cR2Pþôÿÿÿìþô~è&)'"cR2Pþôÿÿ‚ÿìï¶'$¼ 'ÿÿÿìóâ&($cLÿÿÿì~â&)$cLÿÿþ >¯&™|Šÿ8ÿÿÿì\K&š|XþÔÿÿÿì>K&›|XþÔÿÿþ >ª&™%?ÿÿÿì\F&š% °ÿÿÿì>F&›% °ÿÿþ >ª&™#Âÿÿÿì\F&š#¶ÿÿÿì>F&›#¶ÿÿþ >°&™'!?$çÿÿÿìþ>\L&š'$ÿ8! ¶ÿÿÿìþ>>L&›'$œÿ8! ¶3_+ 5_ü¡_•þž–bÕþV'ÕJ@!B • ¯ 6Üìüì99Ì1/<ì299Üì0KSXííY"²]33+532765#Õ¸â¸RQµþéi&&ý¸Õûƒ}úÖ``œ01­}ûƒ` 2@ ©¼ F ü<<ì221/äÜ<ì20@  @ P ` p ]33###53ø¤¤¸´´`þ¤þ<ĤþòþV.` 54!333##"3276!þÑÁ¸µ¿5R µw{i&þVÝÍ`û ›p?`3A0ÿÿ’cè3'q½=¼Uÿÿ’aè4'q½ÿ¼[ÿÿ’^è3'¼Pq½=ÿÿ“cåZ'ðd¼Uÿÿ“cåZ'Œd¼Uÿÿ’aèZ'ðdq½ÿÿÿ’aèZ'Œdq½ÿÿÿvj 3'À\q½=ÿÿ‹cíZ'¼b¼Uÿÿvj V'¼}À\ÿÿ‹cíW'¼u¼|ÿÿvj0Z'@dÀ\ÿÿ‹c:'¼u(Dÿÿ‹cm:'âD¼uÿÿvc u'¼uÀŒÿÿvV Y'¼PÀpÿÿƒVõZ'¼PðdÿÿƒVõZ'¼PŒdÿÿƒVõ‹'º«¼Pÿÿ‹c['ºà¼uÿÿüš{ÿPn&²¸þøZ,,!!,þÔ,þÔÿãOÕ=32653#"&[ÂhqÊÓ÷`¾=ìQQ•Ëîüþæê,ÿÿÿ«þ &&aùÿ«þ ö&3;#"'!5 767654x¸ I*eÃú‚2Dûþäþ¾0ËÚ# &pgM,¸>þê…—¸€ŠÐ:H~ÿÿþÈ#Ä'¼Õÿÿÿì`Ä'ÿSÖÿÿÿìºÄ'ÿS×ÿÿ‚þð¿F'¼ýçÿÿÿìþÔ8@'ÿ+þ '"cþÔNÿÿÿìþÔ~@'ÿ+þ '"cþÔOÿÿÿ«þ ~r'¼þ>¥Á9 9µF üìÄK°SK°QZX¹ÿÀ8Y1´—‡/ìä0@  @ P ` p ð ]3;#"&5Á¸Li µ£û‚™aœÀÖÿÿ‘^îáÿÿqÿã%ðäÿÿqÿãqåÿÿ–þu {&óÿJOw`73#!!dž²†$þ²ÚNd˜ü`ÿþVw`#676#732767!5ʆÐ#5H2KþÜÜ1i0/éNÞ)deûеT0Hôd01™¬ûŒÖ``ÿÿÿÓþvg{'°ÿóÿÿ¿þ‰y{&óÔðØÃû3#3#ðÓÓÓÓÖþ#þ—öÕ +@ • •   Ô2ì2ü2ì21/ì2ôì20!#3!53#—^ÊËý¢ÉÊÕªûªª­• ?!5 ü¤?ªªÿÿÈË8ò'sXyÿÿÈË8 U'tXyÿÿȺ8è'yôsÿÿÈË8'vXyÿÿÈË8 U'wXyÿÿȺ8 'y,vÿÿÜ¿$ž'vô|ÿÿÜ¿$ñ'wô|ÁNÕ@ T¯üüüÄ1/ìì0333Á¸ÕÕú¾“ÿìNÕ@T¯ ÄüüüÄ1/ìì20%3!533yÕýžÕ¸“““BÿìyÕ@ T¯Äüüì1/ìì0)533yþsÕ¸“Bqÿ㦓8@ E EôìÔ¶0 ]99ìüÄ1@    Œ /ìôìÔì0 6& #" 3 ¹¹¹þú*NYÃþë†hí>þú¹¹¹ý †þëé“ÿìÿ㦓A@E E ÄôìÔ¶0 ]9ìüÄ1@     Œ  /<ì2ôìÔì0 6& "'!53&54 3 ¹¹¹þú*N²NþJíh†hí>þú¹¹¹ý “©Ãþëé“ÿìÿã!“8@ E EÄôìÔ¶0 ]99ìì1@    Œ /ìôìÔì0 6& &54 #"'!5 ¹¹¹þúíh†þëÃYNþJ>þú¹¹¹ýœ©Ãþëþzþë“=xÙ 4@   ÜÄ2üÄ2ÜÄ91@  ‡/ìì290)33!xýÞþç³³Âþçj*¯þ]£ýQýiÿìxÙ 6@   ÄÜÄ2üÄ2ÜÄ91@    ‡/ì2ì290%!5!33xütjþç³³Âþç“““—¯þ]£ýQýiÿì'Ù 4@     ÄÜÄ2üÄ2Ì91@   ‡ /ìì290#5!33jþç³³Âþç“—¯þ]£ýQüÖ=Ðq) #33Ðþìþ¢þ¢Ã¤úmˆ½ýCqý"ÿìÐq )5333!þìˆmúmˆþìþ¢“Þý"“½ÿìq)533#þìˆmú¤Ãþ¢“Þü½ºOq $@  üìÔüüÄ1¶£‡/ì2ô<0)3!33Oûk¹U¹Îqý"Þý"ÿìOq (@   ÄüìÔüüÄ1·£ ‡/ì22ô<0)533!33OúιU¹Î“Þý"Þý"ÿìq $@  ÄüìÔüì1¶£‡/ì2ô<0)533!3ûkιU¹“Þý"ÞºOq $@   ü<ÔüüÄ1· £ /ì2ôì035!!5!3ºüòÇΓK“ý"“ÿìOq $@   ÄüÔüüÄ1· £ /ì2ôì0#5!!5!3ÜüòÇΓK“ý"“ÿìq @ ÄüÔüì1¶ £ /ìôì0!5!!5ûkÜüòqü“K“qÔâ:@!E E üìܲ@]üܲ@ ]ìüÄ1@ •• ‘ /ìôìÔ<ì0!&'.4> !2>4."RJr……ä 惃sKRü9[œ¸ZZ¸œ 1¨Å©bb©Å¨1 ý…“­p`88`p`88ÿìÔâ!>@#E E"Äüìܲ@]üܲ@]ìüÄ1@ • •‘ /ì2ôìÔ<ì0%!!5!&'.4> 2>4."¼ûRJr……ä 惃sKRþQ[œ¸ZZ¸œ“““{ 1¨Å©bb©Å¨1 Ÿp`88`p`88ÿìOâ:@!EE Äüìܲ@]üܲ@]ìì1@ •• ‘ /ìôìÔ<ì0#5!&'.4> 2>4."RJr……ä 惃sKRþQ[œ¸ZZ¸œ“{ 1¨Å©bb©Å¨1 üò­p`88`p`88ºO¦ &@    ÔÄüÜÌÌ21¶   /ìÜÜÜÌ03"3#!5!ò„…ñ>ûk•œ fšžüø“ÿìO¦ "·  ÄÔÄÜÌÌ21¶   /ìÜÜÜÌ03"3#!5!ò„…ñ>úcœ fšžüø“ÿì¦ $@   ÄÜüÜÌÌ21¶   /ìÜÜÜÌ03"3#!5!ò„…ñpûk•œ fšžüø“qµî7@ EüìÔ<ì2ÔüÜÄ1@    ‘ /ìôìÔ<ì2Ì0!!##"&6 !354'&"3.þCœø¼°±f^‹vÎü ]8Æmr^ÞþÄ<ÖUåf˜¶Éý"“qɃ]8˜Æƒÿìµî;@! E ÄüìÔ<ì2ÔüÜÄ1@   ‘ /ì2ôìÔ<ì2Ì0%!##"&6 !3!554'&"3.þCœø¼°±f^‹vÎù7é]8Æmr^“KþÄ<ÖUåf˜¶Éý"““ÞɃ]8˜Æƒÿìçî7@ EÄüìÔ<ì2ÔüÌ1@    ‘ /ìôìÔ<ì2Ì0%!##"&6 !!554'&"3.þCœø¼°±f^‹vúé]8Æmr^“KþÄ<ÖUåf˜¶Éü“ÞɃ]8˜ÆƒÁ•Õ ,@   üü<ü<ÜÄ1@   ¯  /ìôìÜì03!!!!!Áƒþ5Ëþ5Õ“þ/’ý´“ÿì•Õ 0@   Äüü<ü<ÜÄ1@    ¯  /ì2ôìÜì0#53!!!!!Õƒþ5Ëþ5“B“þ/’ý´“ÿìDÕ ,@    Äüü<ü<Ì1@    ¯ /ìôìÜì0)53!!!!yþsÕƒþ5Ëþ5“B“þ/’=•Õ ,@  Ü<ü<üüÄ1@   ¯  /ìôìÜì0!!5!!5!3þ5Ëþ5ƒÕß’Ñ“ú¾“ÿì•Õ 0@  ÄÜ<ü<üüÄ1@    ¯  /ì2ôìÜì0#5!!5!!5!3þ5Ëþ5ƒÕ“L’Ñ“ú¾“ÿìÀÕ ,@    ÄÜ<ü<üì1@    ¯ /ìôìÜì0)5!!5!!5!Àý,þ5Ëþ5ƒ“L’Ñ“ºŒÕ *@  üü<ÔìüÄ1@     ì2ìÔì0!!27654'&3!23œþÐ,R4,,=ýÙ¹UiXOÓÞýµ]Oz}I_ý"Õýœ‡_Ò¤‚“ÿìŒÕ.@  Äüü<ÔìüÄ1@    /ì22ìÔì0#533!23!!27654'&ιUiXOÓþþÐ,R4,,=“Býœ‡_Ò¤‚“Þýµ]Oz}I_ÿìÕ *@  Äüü<Ôìì1@     /ì2ìÔì0!!27654'&533!2#œþÐ,R4,,=ý ιUiXXXlÞýµ]Oz}I_ý"“Býœ‡_Ò­‡…ÁùÕ@@  ôܲ_]9üÔüÄ@    /ìôì999@  ìì10!4'&'5!!ª5M‰Ãcý™ˆ4B˜™_–ÜÜ9V“þïê¸æœ@9“ÿìùÕD@   Äôܲ_]9üÔüÄ@     /ì2ôì999@  ìì10#5!&'&'&'5!!» 5M‰Ãcý™ˆ4B˜“X]°–ÜÜ9V“þïê¸æœ@9“ÿì$Õ@@   Äôܲ_]9üÔì@     /ìôì999@  ìì10#5!&'&'&'5!» 5M‰Ãcý™ˆ4B “X]°–ÜÜ9V“þïê¸æþÉq=áÕ:@   ÔÜü9ÜÄ1@  /ìô̲]ìì´]0!533TþéºÕßþÇö9ú¾“ÿìáÕ >@  ÄÔÜü9ÜÄ1@  /ì2ô̲]ìì´]0#5!533hþéºÕ“LþÇö9ú¾“ÿì Õ:@  ÄÔÜü9Ì1@  /ìô̲]ìì´]0#5!53hþ麓LþÇö9ú+ÁÀ#1@%!$üìÔìÔüüÄ1@    # /ì22ÔìÔì03432>3234&#"!4&#"!ÁôÆ}x5%–ÓÒ^ˆÕþq¤ZþýH¤Zl”þî¦ÿK--ÒX€hý¹“|‚€Å•þncƒ§ÒòÿìÀ%5@'#&ÄüìÔìÔüüÄ1@    $ /ì222ÔìÔì0#53432>3234&#"!4&#"!ÕôÆ}x5%–ÓÒ^ˆÕþq¤ZþýH¤Zl”þ“[¦ÿK--ÒX€hý¹“|‚€Å•þncƒ§Òòÿìë#1@%!$ÄüìÔìÔüì1@    " /ì22ÔìÔì0#53432>324&#"!4&#"!ÕôÆ}x5%–ÓÒ^ˆº¤ZþýH¤Zl”þ“[¦ÿK--ÒX€hý&|‚€Å•þncƒ§Òò=ÜÕ -@   Üü<ü<üÜÄ1@    /ìüÜ<ü<0!!5!3!!!ˆþµK¸Kþµœ“Áþ?“ý“ÿìÜÕ1@   ÄÜü<ü<üÌÄ1@    /ì2ôÜ<ü<0#5!!5!3!!!œþµK¸Kþµœ“î“Áþ?“ý“ÿì‹Õ -@   ÄÜü<ü<üÌ1@    /ìôÜ<ü<0)5!!5!3!!@ý¬œþµK¸Kþµ“î“Áþ?“=XÕ>@ Üü<ü<Ü<ü<üÜÄ1@    /ì2ô<Ü<<ì220%!!5!3!3!!!þ=¹þµK¹øLþ´œ“îý““Áþ?Áþ?“ý“ÿìXÕB@  ÄÜü<ü<Ü<ü<üÜÄ1@    /ì22ô<Ü<<ì220#5!!5!3!3!!!%!œþµK¹øLþ´œý¬þ=“î“Áþ?Áþ?“ý““îýÿìÕ>@  ÄÜü<ü<Ü<ü<üÌ1@    /ì2ô<Ü<<ü<<0)5!!5!3!3!!!¼û0œþµK¹øLþ´¸þ=“î“Áþ?Áþ?“ýîýºOq %@   üìÔüüÄ1· £ /ì2ôì03!3!ºÇÎü$Uqý"“ÞýµKÿìOq *@    ÄüìÔüüÄ1@  £  /ì22ôì0#53!3!ÎÇÎü$U“Þý"“ÞýµKÿìq %@  ÄüìÔüì1·  £ /ì2ôì0)53!!ûkÎÇüòU“Þ“ýµK=ÕC´  ÔÄÄÄ1@ B•• /ììôì0KSX@ììììY!!!ÆýtFsþ0†þhéBû~ÀÕú¾“ÿìÕ Fµ  ÄÔÄÄ1@ B••  /ì2ìôì0KSX@ììììY!5!!!ÆýtFýléþh†þhéBû~À“Bú¾“ÿìÃÕC´  ÄÔÄÄ1@ B•• /ììôì0KSX@ììììY!5!!ÆýtFýléþh†þ0Bû~À“Bú+ÁóÕ 8@!  üìÔ<ü<ÔìüÄ1@       /ì2ôìÜ<ì20327654'&+!!!2/!m¨]%i¤þ ;þ ô°„@ED\ŒÔ†qQE=4."RJr…CEoJRþµXEr„„rJSü9[œ¸ZZ¸œ† 1¦ÆSV/ ó“þ{ 2¦Æ¦1 ò“"p_88_p`88ÿìÔÕ*#5!5&'.4767675!5!!2>4."RJr…CEoJRþµXEr„„rJSü9[œ¸ZZ¸œ“ó 1¦ÆSV/ ó“þ{ 2¦Æ¦1 ò“"p_88_p`88ÿìOÕ(#5!5&'.4767675!5!2>4."RJr…CEoJRþµXEr„„rJSþQ[œ¸ZZ¸œ“ó 1¦ÆSV/ ó“þ{ 2¦Æ¦1 þ{"p_88_p`88ÁQÕ %@   üìÔìüÄ1·  /ìôüÌ0!!#!3Åþµ¹¼ÔBþÅÎú¾“ÿìQÕ *@  ÄüìÔìüÄ1@    /ì2ôüÌ0#5!!#!3Ùþµ¹¼Ô“¯þÅÎú¾“ÿì}Õ %@   ÄüìÔìì1·  /ìôüÌ0#5!!#!Ùþµ¹¼“¯þÅÎú+ÁQæ (@   üü<ÜüüÄ1·   /ìÔÌüÌ0!!#3!3Åþµ¹¹ÔOþü›þüü±“ÿìQæ -@   Äüü<ÜüüÄ1@     /ì2ÔÌüÌ0#5!!#3!3Ùþµ¹¹Ô“¼þü›þüü±“ÿì}æ (@    Äüü<Üüì1·   /ìÔÌüÌ0#5!!#3!Ùþµ¹¹“¼þü›þüüÁBÕ /@   ü<ìÜ<üüÄ1@      /ì2ôìÔì0!!!5!3z;þ ôþ ¬ÕÞýµKý"qÑ“ú¾“ÿìBÕ3@   Äü<ìÜ<üüÄ1@      /ì22ôìÔì0!53!!5!3z;ý7Õôþ ¬ÕÞýµKý"“ÞÑ“ú¾“ÿìmÕ /@    Äü<ìÜ<üì1@      /ì2ôìÔì0!53!!5!z;ý7Õôþ ¬ÞýµKý"“ÞÑ“ú+qÔÕ &B@%(E# E'üìܲ@ ]<ü<ܲ@]ìüÄ1@ •# •$  /ììÔ<ìÔ<ì02>4."&'.4767673! [œ¸ZZ¸œœRJr…CEoJR¸XEr„„rJS"p_88_p`88ü~† 1¦ÆSV/ †þ{ 2¦Æ¦1 ò“ÿìÔÕ (F@ *E#'E)Äüìܲ@]<ü<ܲ@#]ìüÄ1@•' •( /ì2ìÔ<ìÔ<ì02>4."!5!5&'.4767673 [œ¸ZZ¸œlûRJr…CEoJR¸XEr„„rJS"p_88_p`88ý““ó 1¦ÆSV/ †þ{ 2¦Æ¦1 òÿìOÕ &B@(E# E&'Äüìܲ@ ]<ü<ܲ@]ìì1@ •# •  %/ììÔ<ìÔ<ì02>4."5&'.4767673!5 [œ¸ZZ¸œœRJr…CEoJR¸XEr„„rJSý0"p_88_p`88ýó 1¦ÆSV/ †þ{ 2¦Æ¦1 þ{“qÔÕ*!&'.4767675!5!!!2>4."RJr…CEoJRþµNþµXEr„„rJSü9[œ¸ZZ¸œ† 1¦ÆSV/ ó““ò 2¦Æ¦1 ò“"p_88_p`88ÿìÔÕ ,%!5!5&'.4767675!5!!2>4."ÔûRJr…CEoJRþµNþµXEr„„rJSþQ[œ¸ZZ¸œ“““ó 1¦ÆSV/ ó““ò 2¦Æ¦1 òp_88_p`88ÿìOÕ*)5!5&'.4767675!5!!2>4."¼ý0RJr…CEoJRþµNþµXEr„„rJSþQ[œ¸ZZ¸œ“ó 1¦ÆSV/ ó““ò 2¦Æ¦1 p_88_p`88ÿÿüìûÿ œûþÿÿÿª†‚Õ'a†'aÊa ÿÿª†ƒÕ'a†'aÉb ÿÿª†‚Õ'a†'bÉa ÿÿª†‚Õ'a†'bÉb ÿÿª†‚Õ'b†'aÉa ÿÿª†‚Õ'b†'aÉb ÿÿª†‚Õ'b†'bÉa ÿÿª†‚Õ'b†'bÉb —à :@   Ô@ ? o ]Ü99ÔÜ99ÔÌ991¶ ÔÌ2Ü<Ì0#'##'##'d22¯222¯22dàÈddddÈÉþVüÕ!#!3!3#3ÄýjþðÄ–Éþ’†áûÕûáúÕªþVÁþV8`!##333#€·ýäì·í¸þÞ{ƒü}`üü9™þV®þVX{ %5#"&5332653!"&'5326 C±uÁȸ||•­¸þþúa¬QQžRµ´þÝjBfcðç¦ýaŸŸ¾¤{ü+þâþé³,*½Ðÿÿ}þGR'2þ¡ÿÿ}þ¢GR'!©þ¢¡ÿÿ}þ¢G÷'KÿÂÿ'!©þ¢¡ÿÿ}ÿÚGx'$úâ¡ÿÿ}ÿÚGª'&ú¡ÿÿÿ«þ ~&'2Xþ ¥ÿÿÿ«þ ~&'!4þH¥ÿÿÿ«þ ~&'!´('!4þH¥ÿÿÿ«þ ~¶'"ô ¥ÿÿÿ«þ ~°'&ô¥ÿÿ‚þ G¶&©'!_ !õþ¢ÿÿÿìþ¢ è&ª'!R!þ¢ÿÿÿìþ¢7è&«'!R!þ¢ÿÿ‚þ Gî&©$xÿÿÿÿìþ  î&ª$ ÿÿÿÿìþ 7î&«$ ÿÿÿ‚þ G°&©'#â $xÿÿÿÿìþ  °&ª'#Š $ ÿÿÿÿìþ 7°&«'#Š $ ÿÿÿ‚þ áå&±"xþ¢ÿÿÿìþ¢2å&²"Xþ¢ÿÿÿìþ¢å&³"Xþ¢ÿÿ‚þ á°&±#~ ÿÿÿì2°&²# ÿÿÿì°&³# ÿÿ¬&¹#„RÿÿÿìÔ&º#|Rÿÿÿì¤&»#|Rÿÿuþ ²F&Á#,¶ÿÿÿìø@&Â#,°ÿÿÿìðF&Ã#,¶ÿÿ‚þ¢\&*!kþ¢ÿÿÿìþÔ?Ù&+!¨þÔÿÿÿìþÔ &,!¨þÔÿÿ‚þ¢\L&*'!õ¶!kþ¢ÿÿÿìþÔ?&+'!©~!¨þÔÿÿÿìþÔ ~&,'!»è!¨þÔÿÿ‚ý¨\&*$îþ¢ÿÿÿìýÚ?Ù&+$,þÔÿÿÿìýÚ &,$,þÔÿÿkþ À&-!kÿÿÿì?&.!©~ÿÿÿì ~&/!»èÿÿkþ Àû&-#„kÿÿÿì?&.#,~ÿÿÿì x&/#>è‚ÿ§‚7%2$6=4'%$=4767!;#"&'#!"'$4733ö¸k1yüYþ  °`üh_ ®Êø/.Z\9 Sþl¡þ À€þ¶?¸AËh—X–l k‘7¾>c`›ýè7# #5–&øE^¸209‚&b Š\^ˆ~B"ÿì„ #5!276'&'%$=4767!#“. cüYþ ¢°`üh_ ®Êø>_߸h,n‘7¾>ba›ýè7# #5–&øqe›ÿì)#5!27654'%$=4767!;#"&'#ˆ9püYþ ¢°`üh_ ®Êø/.ZZ8 `§¸h‘7¾?ba›ýè7# #5–&øE_¸/(Wÿÿ‚ÿ§Ù&%2F„ÿÿÿìÏ&Ò2ô„ÿÿÿì&Ó2ô„ÿÿÿÉÒ&Ñ!îFÿÿÿìÏr&Ò!ÈÜÿÿÿìr&Ó!ÈÜÿÿý¨Ò&Ñ$Xþ¢ÿÿÿìýÚÏ&Ò$ÈþÔÿÿÿìýÚ&Ó$ÈþÔÿÿ‚ÿ§Ù+&)2F„ÿÿÿìÏ+&*2ô„ÿÿÿì+&+2ô„ÿÿ‚þ¢Ù+&)"Xþ¢ÿÿÿìþÔÏ+&*"ÈþÔÿÿÿìþÔ+&+"ÈþÔÿÿ‚ÿ§Ù4&)#„¤ÿÿÿìÏ4&*#K¤ÿÿÿì4&+#K¤ÿÿþÈ#ž&Õ!jÿÿÿ쯞&Ö!ÿÿÿ캞&×!ÿÿþÈ#4&Õ#è¤ÿÿÿì4&Ö#¤ÿÿÿìº4&×#¤ÿÿüà#&Õ$&ýÚÿÿÿìþ ó&Ö$cÿÿÿÿìþ º&×$ÿÿÿ“üÇ+¼&5'!?&!¼üÇÿÿÿìþÔ‡è'!àR&(!àþÔÿÿÿìþÔ~è'!àR&)!àþÔÿÿ“ü®+¼&5'!?&2&ü®ÿÿÿìþôè'!àR&(2Pþôÿÿÿìþô~è'!àR&)2Pþôÿÿ“þ +¶&5#ô&ÿÿÿìóâ&(#cRÿÿÿì~â&)#cR5Õ b@ƒ ü<ì2991/ôüÌ0K° TX½ @ ÿÀ878YK°TK°T[K°T[X½ ÿÀ @878Y¶ P ]#53#3ËËË¢×þú+eþ›ÿã¬Õ $†@/ †ˆ !ƒ# •Œ#%" " "!& %ÜìÔüìÔì99991äôìþÍôî9990K°TK°T[K°T[X½%ÿÀ%%@878Y@ ttttv]33267#"&546?>7>5#53ô¾7ZZ:3ƒmN´`^Àg¸àIYX0&ÄÊÊDœe‚WX5^1YnFC¼98ŸL‰VV/5<6þÿÿÿã¬ÓWuÿìX %#!5!276=3%Hþ¬c,1¸VV¸,1jÙÙ»ÝýÔ²#!!!!ÝÕþ­ûÐþ®#õ± -öÓÝýÔ²#!!!ÝR0SýÔ OöÓ -õ±#ýÔf# !! !!5 Nóú´¶ü+ø½ü)#þïü ûÈþðÓm¥ý™@>2&#"#"&'7327« äÖ³ÒPd \ æjk³ÒPd è켰Ǹøø}켰Ǹ÷ÿÿ¥ý™H&@@ÿÿ¥ý™ Q'@'@@¥ý™@-6?67632&#"#"'&'7327&'&54767676'4'&'« uphmdNÒPd Œ]œœz¢ vphmdNÒPd „fœu¦ÃV?bd4?þõV?fj4èì`\cMǸøþ["j¯ÏÝœxþ9ì`\cMǸ÷°"gÛÝ¢züBf’–d3ýv˜Ai’’f3¥ý™HMQZc67632&#"!67632&#"#"'&'7327!#"'&'7327&'&54767!!676'4'&« uphmdNÒPd  upimdNÑQd Œ^œ›z¢ upimdNÑQd ýä vphmdNÒPd „fœu¦Â"ýäþóV?fj4Q V?bd4èì`\cMǸøþl¸ì`\cMǸøþ["j¯ÏÝœxþ9ì`\cMǸ÷þ@ì`\cMǸ÷®#hÛÝ¢zü¿ý[˜Ai’’f3qýiBf’–d3¥ý™ Pmqu~‡67632&#"!67632&#"!67632&#"#"'&'7327!#"'&'7327!#"'&'7327&'&54767!)!67654'&« uphmdNÒPd  upimdNÑQd  uphmdNÑQd Œ]œœz¢ vphmeNÒPd ýä upimdNÑQd ýä vphmdNÒPd „fœu¦æ"ýä"üø"ýäþóV?fj4YV>be4èì`\cMǸøþl¸ì`\cMǸøþl¸ì`\cMǸøþ["j¯ÏÝœxþ9ì`\cMǸ÷þ@ì`\cMǸ÷þ@ì`\cMǸ÷®#hÛÝ¢zü¿ýA¿ý[˜Ai’’f3qýiBf’–d3¥ý™é3&#"7#754'&'#"&'7327#4767>32nSb ~Y¨…fþôMþöf‚pH>> âfpµÒSb =[Bzšzš âfpµ¸øþ)"X§Ü*ƒeþô eƒ*£mHúé鿬˸÷ÿBx¢Û›zñé¿­Ê¥ý™Ñ>4'>7'7&#"7#"&'7327&'&54767>32mV?fj4×Vs ¿e™Sb ~kšefì%Uz¢ álkµÒSb „fœu¦ álkµÓ˜Ai‘“f3EØTýiŽÁeX¸øþ[m¯eeí_Xþ9鿬˸÷°"gÛÝ¢z¿èÀ­Ê¥ý™Ô=.'>7'&#"'#"&'7327&'&54767>32mV?fj41M>V• vfüSb ŒÅèfjþî£ álkµÒSb „fœu¦ álkµÓ˜Ai‘“f3·]Dýi·[wf&¸øþ["ÞYèfj¯þðþ9鿬˸÷°"gÛÝ¢z¿èÀ­ÊÿøýÔ P# ! !Aþáüsüsþá #õ± %öÛ OÿøýÔ P# ! !ûñûôýÔ OöÜ $õ±ÆýÔ‚# # #¤þËþKôuÒuôþO;þÀþ›ù>åÈ¢þ^þ8ùÂbCÆýÔ‚# 3 3¤5µôý‹ý.ý‹ô±þ¼AeÁùþ8þ^£Çåù?þžþ¼Rýà þu7!!  767654'&'  $'&'&7676Ñ®þR¹þ<ÆÂ¡¤¡¡¤¡ÂÆÄÆÂ¡¤¢¢¤¡Âý?3ãÉÉdccdÉÉþýÍþÉÉdccdÉÉýûYTR¡£þzçáþz¢¡SSSR¢£†à熣¡RYËÈÉóðþãþéòðÊÇÌÌÇÉñóñóÉÇRýà þu3?  767654'&'  $'&'&7676!!#!5!Šþ<ÆÂ¡¤¡¡¤¡ÂÆÄÆÂ¡¤¢¢¤¡Âý?3ãÉÉdccdÉÉþýÍþÉÉdccdɵˆ›üeîüe›pTR¡£þzçáþz¢¡SSSR¢£†à熣¡RYËÈÉóðþãþéòðÊÇÌÌÇÉñóñóɵjüeñüe›ñ›Rýà þu3?  767654'&'  $'&'&7676   ' Šþ<ÆÂ¡¤¡¡¤¡ÂÆÄÆÂ¡¤¢¢¤¡Âý?3ãÉÉdccdÉÉþýÍþÉÉdccdɵƒªýs¨ýsýsªýspTR¡£þzçáþz¢¡SSSR¢£†à熣¡RYËÈÉóðþãþéòðÊÇÌÌÇÉñóñóɵþ¸ýsªýsýs¨ýsªÿÿ¥ý™Y&@'@'@ @¥ý™@327!5!>32&#"!!#"&'wSb -þ}# álkµÒTb "ƒþr/ álkµÛ¸÷®ñå鿭ʸøý?ñü/鿬Ë¥ý™@'327!5!!5!>32&#"!!!!#"&'wSb þ‹þn álkµÒSb uþ€‘þc álkµÛ¸÷ŽðTíÅ鿭ʸøþ_íþ¬ðýO鿬Ë¥ý™@&#"#"&'73275>32nSb %Éþ,, álkµÒSb %þ9Ò, álkµ¸øý âþùü\鿬˸÷øþþã¤é¿­Ê¥ý™@,5&#"&'67#"&'7327&'&54767>32nSb Øh 9q-XLa álkµÒSb „fœu¦ álkµý-V?fj4¸øþ[:À\f.ýiž3 þ9鿬˸÷°"gÛÝ¢z¿èÀ­Êúº˜Ai‘“f3¥ý™è4&#"676='3'#"&'7327&'&53>32nSb =[Bz„f L f‚œxš ãjkµÒS` X¨qH?> ãjkgL¸øûBx¡+„f þôf„+ݘzþ鿬˸÷×#X¨Ú¡nHé¿cJÊ¥ý™@!!!!!>2&#"!!"&'732f*þÖþ åÖ²ÒPc »þ ïΰÒPe¿þ™ý  `켱Ƹøþ‡ûbþ”õ³±Æ¸¥ý™@,!!>2&#"#"&'7327326&f*þÖŒ:, åÖ²ÒPd Œ]œœz¢ æjk²ÒPc 9L¿Ñ¿þ™~켯ȸøþ["j¯þUxþ9켱Ƹ÷lÐ2³¥ý™G1!!327326&# >32&#"632#"'#"&'ž+þÕýÙSb &@OžŒÔàþÓv"æjkµÒSb S`ï$þÈÛ{g ãjkµÊþ™ü¸÷X(LÍ(ÊäXèÀ­Ê¸øþKþ·þTþË/þ鿬Ë¥ý™@ 4!!6& 327&'&767>32&#"#"&'_*þÖÑÃþÒÌÊåSb „fœu¦ álkµÒSb Œ]œœz¢ álkµÍþ™­Ì(ÊÍ“’Ìýl¸÷°"g¸¢z¿èÀ­Ê¸øþ["j¯þTœxþ9鿬Ë¥ý™@"&7!>2&#"!!#"&'73273!#3×½ åÖ²ÒPd ŒþA ïfe³ÒPd "óþCòÐÛ;Ò켱ƸøþRûÅþfõ³®É¸÷wxýKµýKÿ£ý™B/&#"!2#567&'!#"&'7327!5!>32nSb $~Ŏˆ ˆþy/ álkµÒS` -þc ˆþC½ˆþ÷¦& álkgL¸øýÊþèÆÀ‹ü)鿬˸÷´þùˆ¼f¼ˆþùé¿cJÊ¥ý™@%&#"7 '#"&'7327' 7>32nSb Þ©þœd©û# álkµÒSb !á­gþœªü álkµ¸øý©Þ«þ›þœªùý鿬˸÷ªâ«de©ýœé¿­Ê¥ý™@,327#7>32&#"#'#"&'wSb @\-J«Û« álkµÒSb Xz«¯@ álkµÛ¸÷)FqÝþGÑ% §é¿­Ê¸øþr"b‰þÑþ/¹XGúÀ鿬Ë¥ý™@)&#"63#"&'7327&'&3>32nSb <Ϋþ~ álkµÒSb ‚Yz«²= álkµ¸øû 6sºþ.ýò7þ鿬˸÷Ö!b‰/ÒþFþ¦Eúé¿­Ê¥ý™N Ü>2&#"#"&'7327!5« åÖ²ÒPd \ ækj²ÒPd ÿû©è켱Ƹøø}켱Ƹ÷ xââ—üL@>2&#"#"&'73275!« åÖ²ÒPd \ ækj²ÒPd þHVè켱Ƹøø}켱Ƹ÷üèããY™õ‡[”_<õÑ~äÑ~ä÷ÖüLY Ümþþ÷ÖúQYRÍfª‹55®Å´žªšq=3ۤ=´Ù‹žãd‹Û²‡á–œdž¨‹²ð²ž´Ù´Ù´Ù?“‡y}É–s)ÉÉšÉ3sÉ\É\ÿ–?ÉuÉçÉüÉLsÓÉLsɇãÿúÛ²yéD{=ãÿü{\°²Ç´Ùÿìªç{ºfqqìqÑ/qº9Á9ÿÛ¢º9Á˺ºåqºqJº+o#7®¼=‹V¼;¼=3X²´Ù‹55¬^R²\×Åsåž´ÙãdÕôÙ5^5bs®ž‹Û#5‰Å`åÁÁ‰Á‰Áb?yyyyyyË–sÉÉÉÉ\;\¢\ÿþ\3 üÉLsLsLsLsLs´LfÛ²Û²Û²Û²ãÿü×É ºç{ç{ç{ç{ç{ç{Û{fqìqìqìqìq9ÿÇ99ÿÞ9ÿôåqºåqåqåqåqåq´ÙåH®®®®¼=º¼=yç{yç{yç{–sfq–sfq–sfq–sfq)Éq3 qÉìqÉìqÉìqÉìqÉìq3sq3sq3sq3sqÉÿåTÉx\ÿä9ÿÓ\9ÿò\ÿõ9ÿä\°9–\É9Á¸ÉrÁ\ÿ–9ÿÛ?É¢º¢ºuÉ9ÁuÉ9ˆuÉÁuɼÁÿòFüɺüɺüɺ‚ÍüɺLsåqLsåqLsåqs/qÉJºÉJ‚ÉJº‡+o‡+o‡+o‡+oãÿú#7ãÿú#7ãÿú#7Û²®Û²®Û²®Û²®Û²®Û²®éD‹Vãÿü¼=ãÿü{\3X{\3X{\3XÑ/ áÿ—}ɺ} s–sfq3 ÿ—}ÉqåqƒLuꤚÿ–Ñÿ3s~ߺÔÉ\ ÷É¢¹9 ¼=˲üÿ–ºLsNgåv—sq7ÿ—¹Ér+dɰþò#7ã#7ãÿúÝ­°NÄÉóÿüØ={\3XT T\Ÿh3q–T]ŸhXº\Éðɬ]É `É dÉ <q¯ÉKɧÁsÉdÉaºyç{\ÿþ9ÿàLsåqÛ²®Û²®Û²®Û²®Û²®ìqyç{yç{ËÛ{3sq3sq?É¢ÿéLsåqLsåqT ŸX9ÿÛ `É dÉ <q3sqçÉuÉüɺyç{ËÛ{LfåHyç{yç{ÉìqÉìq\ÿ§9ÿÃ\9ÿãLsåqLsåqÇJ‚ÉJºÛ²®Û²®‡+oãÿú#7œ,GÉÿðâÉ´q–qâq{\3Xyç{ÉìqLsåqLsåqLsåqLsåqãÿü¼=ÌŠ¾ºÑ79ÿÛüqüqyÿý– f u ãÿ²+o3XÓPÕP} Û yÉìq\ÿ–9ÿÛ@sq Jãÿö¼ Í®qººefqq’qìqìqŽ|S…A…4…Pq9ÿÛ‘qq qÄ`Ä`®ºº9µ¦ùt*KæM:Á¦Á˺˺˺+ÿÛ#º³åqÝqÓ”GpPPOJºIº>„>tÔºÔº+o°ÿÙ°ÿÙ±7°þò#7#7ñqÉÁ¼=‹V¼=ãf3X3XŸXŸmXXXXLs£ºPqªq;ºVþòVººÑqXXqvqq¤7á7:7É/¥Á<Á66JO<u1ufÿéu]H^H 6û&: ® ‹®‹²‹Äuuuuõuõu  ÁÁÁÁ3ÖÕsª3ÖÕªs²o²ouuuudŠdÇšîL¶ð†ÿÿïhuTzüuuõuòÖòÖòÖòÖòÖÁÕ%®î¶ü¨ýqüÁü´üÙûìü¿ý¢ü×ý7üìüôüÅý¼üðü]ü¿ü¿þýýÿyü¨ýqý$ýÄþUþðý€ý ý ý$ý ýzýwý¢üÕý(ýjý#ýLý¼üðücüÅü¿ü¿ü¿ü´üÙûìûìûŒýxúíûhúý¬üñý!ücý+þûìü¨ýqü´ýüçýÆüÕýýýü¶ü¶ü¶ücý3ýxü¿ý+ýxÿ.üüpüpüpüpý*üpüw<É‹ÁåÉ.É: : üÉ3º¶efqe²žs׊‹ÛøÿçøÿóDÿí€ÿò™ÿá›ÿÛµy}ÉuÉyÉ{\ÉLs\É?ÉyçÉüÉÉLsÉÓÉÉãÿúãÿüLs{=LsN\ãÿüFqS…ºµ¦¡•FqÀ¼ åqS…Zkºåqµ¦·¿¼=®xJvkåqÑJº²qqÑd¡•GpŸ;Gp³‡µ¡•åq¡•³‡?Éê§ôq—W½ÿá—WGp³AOpLsåq0‹²qšÉ«ÿ@G³G¿ìrwxs³‡sFqUÉë-~OÛd$s6˜såqã,J7Opºfq9ÿÛLsìqìÄ×ɺ–sçÉ5U s–s sÉÉJÿúáÉ–s‡\É\\ÿ–ÀT\ÉJÿú®ÉüÉà#Éy}É}ÉáÉ@eÉž(!‡üÉüÉ®ÉTçÉÉLsÉÓÉ–sãÿúà#ãy{=6É|¯ŽÉÀÉ©<É}É–o£Óˆç{ïp·º4ºˆkìq5FA…3º3ºÕºL º;ºåq;ººfq©<¼=×p¼;rºº–Rº‰º§>Qº·ºdq¼ÁÐtìqìq/4ºdq+o9Á9ÿô9ÿÛ8L0º7/Õº3º¼=;ºxs³‡*`ŠÓþÁ D3 GÉÁLsåk7ɘÁsS[Ú2Lsåq@R2@R2ðs<q sq pv9˜xs³‡–sfq;ûÚýý³ý³ùÊX÷ÖXøX.ÉjÁ}!·&ÓɺáÉ4ºfG¹8þÉ=ºž(5F!‡A…®ÉÕº®ÉÕº®!Õ=Ú2§*ÉIÁÉÁ¦ÉSÁs‹q–sfqãÿú©<ãÿü¼=ãÿü¼={=¼;yÿút|¯º–|¯º–|¯º‡Ó‡Ó\Éž(5F?ÉÕ¿56].ÉIÁ6ÉrÁ|¯º–É2Á9Áyç{yç{ËÛ{ÉìqLuìqLuìqž(5F!‡A…T ŸXüÉ3ºüÉ3ºLsåqLsåqLsåq–odqà#¼=à#¼=à#¼=|¯º–áÉ4ºÉQºfG¹8{=¼;{=¼;}‘·q ‘-qÌÉô«nɵ«“6¨.çɽÁ3sGq/ÿú°ê¤S…TL ZTóL'ÉêºAˆãtLsqéD‹V®ÉÕº¥T>L¦ÉLºXÉvº!²Û²]ZÛ²-²¼Û²à²]‡¼D¼`¼èÛ²ºF ¨d#iU²Ò’Õ Û²´xgZ%¨U²Û²d¤–²ó M¼|x2LsRnuu‹²àäçÿÿ>ZË®ºCqNº®qººèºCqº,º׺ûq®ºÝjºŒ®,ÿÔÿÙýº< Ë®{n0º®®Ê®ºozºÊ®)àoqF~®²ðãdD«ÿÿDÇÇcc/NDãdc\ÑÅ\шfcYº XLX^X:º.ºÅX:º0¹ʈLX;XŒXOºoX.º4X1¹XºÿºQX¿X­º„X«XBĺbˆ¥ˆSº(º…Ð…•Ûü‹Û?“ã9ÿµ9lÝÿ«9lC‚9Áˆ‚1‹ˆ‚ˆ‚***}}Ýÿ«Ýÿ« Ä‚ Ä‚ ¬‚ ¬‚ffÆuÆuXÿìK‚5k˜ÐôŒà“1‹Ýÿ«C‚C‚ÜÜÜÜÜÜÈì˜OOÜóL¸LLRLLL¯L‡LUL<L<LdL…™‹²\Wˆ‚5kÉVzˆ‚ˆ‚ˆ‚ˆ‚ˆ‚ˆ‚ˆ‚ˆ‚*******}}}}}}}}}Ýÿ«Ýÿ«üÿ«=ÿ«âÿ«=ÿ«Ýÿ«Ýÿ«Ýÿ« Ä‚ Ä‚ Ä‚ ¬‚ ¬‚fÆuK‚K‚K‚K‚K‚K‚5k5k)‚n‚)‚˜˜˜)‚)‚)‚)‚)‚)‚ÐÐÐÐà“à“à“à“à“–*Ýÿ«Ýÿ«Ýÿ«Ýÿ«C‚C‚C‚1‹L¸LLRLLLRLjLÐL<L<Ld‡ááááááÖÖ9Á’qd=¼=;º;ºÀq;º¡qÁ=xºåÁÍ=¬ÁÈ=D=;º=ßÁ=ÁËpÈ==Àq=Á=Á.ÁÀqÀqÙB¤¿[B[šÕ‚È‚È{d{dãÿì°]‚x‹‰Ümx‹€s[º")>WE_IIöY"º~h~h@€sx‹2Os Osx‹MËoû`P{Püšû@û@û@û@üþü§û`ûNzBz®ÿÓa\î¼d“ýûû>üNûüš‡ c c]cc Y]‚d–ji::þxÞnno­nìd$P<Py <õx¾<xÿ‚Öd@2 PKn÷‚ö‚ÖdídÊZ ƒ÷nxõ‚‹yýxì‚üd‚Ì<Á<Ä‚‚oÄ<ÀnèPd$d¦Z‹ddd)hd$dZ„d.d.‚Jdd$d^d.‚<Z. šddJd$d$<.‚’Z.d$ƒ)d.‚¢d$xdd$dodŸdjZd’Pd•n—dyyyy'É'É'É'É'w'w®É­®É­®É­¼ÉɼÉÉ'ɼÉw¼Éw'w ÉX‰c^c^‰‰%‰‰ºH‰ ɉ‰‰¸E ÉïwyyyyÕwÕwÕwÕwÕwÕw®Éy®É­®É­¼Éw¼Éw¼Éw¼ÉwÕw‰‰‰Û²Û²Û²Û²×w×w×w×w×y×y^ɲ^ɲ^ɲlÉ4wlÉ4w”É4y”É4y”ðy‰²²íwyFÉÉÉFFFÉÉáÉ*F…ɇɅɇÉáÉ*FáÉ*F…ɇɅɇɅðA‰A8F3ÉF3ÉFÉÉÉFFFÉÉáÉ*F…ɇɅɇÉáÉ*FáÉ*F…ɇɅɇɅðz‰z‰áwuÉuÉuÉáwáwáwuÉuÉþÉ&wøÉÉøÉÉþÉ&wþÉ&wøÉÉøÉÉøð‰‰‰ÐwÐFÐFÐ ÐwÐwÐwÐFÐFŽÉGwyÉÐFyÉÐFÐF͉Ÿ‰͉ÐwÐFÐFÐFÐwÐwÐwÐFÐFŽÉGwyÉ=FyÉ=FŽÉGwŽÉGwªÉ=FªÉ=F͉ÕwÓFÓÉÓÉÓÉÓFÓFÓFÓÉÓÉ­ÉFVÉ+ÉVÉ+É­ÉF­ÉFVÉ+ÉVÉ+ÉVðY‰]‰Y‰²F²F²F"F"F"F"FGÉúFGÉúFGÉúF ÉÌF ÉÌF ÉÌF ÉÌF ‰wÉÉÉwwwÉÉÁÉ?w‡ÉŒÉ‡ÉŒÉÁÉ?wÁÉ?w‡ÉŒÉ‡ÉŒÉ‡ðY‰‰à‰SÉSwSwSÉSÉSÉÓÉÓÉÓÉÓFÓFÓF­ÉFY‰Õwy–y–y–y–ÏMÏMÏwÏwdÉw‰Û²Û²Û²Û²Û²Û²×S×S×y×y”É4y‰¥F¥w¥w¥F¥F¥w¥w‚‰Éà‰`‰`‰`‰`‰`‰`‰`‰š‰¥F¥w¥F¥w ‰ ‰ ‰‰‰ ‰ ‰™‰•‰ÐFÐFÐwÐwÐFÐF͉%w%!%!%w%w%!%!Y É)É#s¿‰¿‰u`‰ z‰ ‰ ‰ ‰ ‰ ‰ ‰Ñÿìñÿì²ÿìsÿì 4ÿì õÿìñÿì²ÿìsÿì 3ÿì õÿìüÿì¿ÿì‚ÿì Eÿì ÿìñÿì²ÿìpÿì 2ÿì õÿìüÿìÿìOÿì £ÿì 3ÿìwÿìqÿì¼=½ Û{°>fq׺×$íºS‚9Á(¢ºª º3ºåqfyqyqy3/qåqåq2—Ð2Ð2©<˜ºå®•®/¼=‹V3X5xª³¼=ƒ—2—¹ZLr èuá//SçHÊ||ÿ½NÎYÅÅ÷H„G €ÿü°pû+"M"M>G/Mmu>GVGVGâTàR>GnzhuüuEuOGöGOGOGmu\#=nÂnüuV&7yûGSGé%nzu=nV&7yûKySGé%ºÊùtV29‘>GöGöGOGâT_Ýÿé>G=nIÿzIIàÿVÿzá[qüuüuIÿéÖuEqOGOGâFKÿé\#^YGäu@zV&î7~7î7#7OGü[ü[ü[ü[üBüByç{}ɸ}ɺ}ɺ–sfq)Éq)Éq)Éq)Éq)ÉqÉìqÉìqÉìqÉìqÉìqšÉÑ/3sqɸɺÉÿíɺ\9ÿÓ\9ÿô?É¢º?É¢º?É¢ºuÉMÉuMÿýuÉ9ÿôuÉ9ÿÞçÉ˺çÉ˺çÉ˺üɺüɺüɺüɺLsåqLsåqLsåqLsåqÓɺÓɺÉJºÉJºÉJºÉJT‡+o‡+o‡+o‡+o‡+oãÿú#7ãÿú#7ãÿú#7ãÿú#7Û²®Û²®Û²®Û²®Û²®y¼=y¼=éD‹VéD‹VéD‹VéD‹VéD‹V{=¼;{=¼;ãÿü¼={\3X{\3X{\3Xº#‹V¼=ç{Ñ/ÑÑ/&²åqyç{yç{yç{yç{yç{yç{yç{yç{yç{yç{yç{yç{ÉìqÉìqÉìqÉìqÉìqÉìqÉìqÉìq\Z9D\É9¿LsåqLsåqLsåqLsåqLsåqLsåqLsåqNgåvNgåvNgåvNgåvNgåvÛ²®Û²®Ý­°Ý­°Ý­°Ý­°Ý­°ãÿü¼=ãÿü¼=ãÿü¼=ãÿü¼='ÉÑ FqFqFqFqFqFqFqFqyy'iªñS…S…S…S…S…S…°°ºÌ0lºººººººº²¯°¶7hx“µ›µ‘µÿ±µÿ»µµÿÓµÿ˵ÿÆ þÌêñåqåqåqåqåqåqoÉÂ̂á•¡•¡•¡•¡•¡•¡•¡•Eû.³‡³‡³‡³‡³‡³‡³‡³‡k¿·Ã‘Ç_žFqFqS…c…º<ºµÿµ¦åqåq¡•¡•³‡³‡FqFqFqFqFqFqFqFqyy'iªñºººººººº²¯°¶7hx“³‡³‡³‡³‡³‡³‡³‡³‡k¿·Ã‘Ç_žFqFqFqFqFqFqFqyy»ÿüŠy†¶†¶¶ºº<ºººpÿüøÿçrÿüøÿóɉ´¶µÿëµÿãµÿصµÿäµÿæ\ÿõ\ÍÿüDÿí~•¶¡•¡•¡•¡•ºº¡•¡•ãÿüãÿüÃÿü™ÿá{ª×ª³‡³‡³‡³‡³‡‡ÿü€ÿòaÿü›ÿÛNs†£V‹™Ìãdãddddÿì‹®‹²‹®‹²%®%®%®%®99¸3¸3­ìWìì‹Ü™ ¼q âqÑ(ý()(Ñ(ý()(¶ 3ž3Á´Ãâ“?“ÿìnÿ§nÿ§ÿª=ÝVþ‰°°`JݓݓúdìØØ=²nÿ§=™‘dnÿ§´8°úN(´f´f‹Ûad´p‹Û‹ÛÇ5Wnz5?5f5\5l5Y5S9‰9‰9‰÷o÷g0u5W5‰5^5b5?5f5\5l5Y5S9‰9‰9‰÷o÷g"MVGOGuVG<uhuTzüu0umuüu\#Vs`…˺" .É—Éé;F_q( .Ð.D]1u¥j Cüü=ü=ü=üûPü=&C&C–süÃ#ÿÖ&<‰<ꤖoÃèI ÌÉHZÂ;”jÃDNÿä‹ hÆR6”nœÈLsbBƒSVÈ,©yÉ(˜ÿü'yõ\ŸXNNîµD?ÉyJ\ ‚Ö}¼WØ¢JTšÉŽ9²högdÿûº(V FhZ —ž$Ò<ÈÊÉ|3£uuãÿüWªZì[ÏOÏÿ=;6QÁ‰Á‰ ö‰Á‰Á^Á‰Á^ÁbÁ?Á‰ÁfÁ‰ÁbÁfÁl‹‰\ÉðÉ„ÉbÉyaõ ‰WÉ{=w= =uÉ–s)ÉçÉ9Á©ÁÁ~Á¼=}=í= ]=Á¼;”;;9Áfqq˺ öy)É öy se–sÁW´d´£´u´£´d´£´ ´ ´ ´ ´d´u´,´´d´¥´u´¥´d´u´d´¥´u´¥´¥´d´v´d´v´d´d´*´Z´¬´Z´¬´Ý´d´-´O´Þ´p´Ó´´d´d´´£´u´u´´£´d´w´d´d´x´v´x´d´d´d´d´u´d´¥´u´¥´d´¤´ ´¼´¼´ ´d´u´d´u´£´£´d´£´u´£´k´u´7´^´H´^´^´^´@´^´^´^´u´z´z´^´u´w´u´d´u´d´d´u´d´7´u´7y‡#_ÉÉø›ZÿúZÿúø¯ø¯¾Ùø¯ø¯¾Ù,œœd´Ù´Ù´Ù²Š´DX===·ÜªÜ´,¯,¯´í°ffÛÛÛÛ+uPuuu+uPuuu+u+u+uyy¡y´Ù´Ù´Ø´Ù´Ù´Ù´¢´ÙдٴٴٴٴٴٴٴٴٴٴٴٴشٴٴٴٶٶÙÏʹٴٴٴٴٴٴٴٴٴٴٴٴٴٴٴٴڴڴڴÚ`”`”¶°´Ø´Ù´Ù´Ù´Ù´Ù´Ú´Ù´Ù´Ð´Ð´Ð´Ð´Ù´Ù´Ù´Ù´Ù´Ù´Ù´Ù´Ì´Ì´Ì´Ì´¾´Ù´¾´Ù´¾´¾ÛÛ۴ٴٴٴÙ>Ù>Ù´»´»´»´»´»´»´»´»´»´»´»´»´»ø¯ø¯ø¯ø¯*¯*¯ø¯ø¯ø¯ø¯ø¯ø¯ø¯ø¯´Ù´Ù´Ù´Ù´Ù´Ùyy´b´y*îÛÈÛÈÛÈ´´ÿúÿúŒŒ‚‹Ûù´ÙÙÙÙÙÙ´ÙÜcÜc´¾´Ù´Ò´Ò´|´Ù´Ù´Ù a” a”´Ù´Ù´Ù´Ù´Ù´Ù´Ù´Ù´Ù´Ù´Ù´Ù´Ù´Ù´Ù´á´Ù´Ù´Ù´Õ–ìììXø¯¾Ùø¯ø¯¾Ùø¯ø¯Xø¯¾Ùø¯¾ÙøÙÑJÑr’´£´£´£´£è;°Ç°Çxôxdxôxd´Ù÷´ÙÀ°À†À°À†+¯+* 8œ 8œ Pœ 8œ Œx Pü–µ¦º³‡Fq 8œü#°°°°°°°°°°£¨££¨£¨+¯´7ºü–'Yÿƒ’,˜,˜,˜,˜,˜,˜,˜,˜,˜,˜ÑÿìÑÿìÑÑÈÑ<Ñ<ÑÑÈÑ<Ñ<ÑÑÈÑÑÑÈÑÈÑÿìÑÿìÑÿìÑÿìÑÑÑÈÑÈÑÿìÑÿìÑÿìÑÿìÑÑÑÈÑÈÑÈÑÈÑÈÑÈÑÿìÑÿìÑÿìÑÿìÑÿìÑÿìÑÿìÑÿìÑÿìÑÿìÑÿìÑÿìÑÿìÑÿìÑÿìÑÿìÑÿìÑÿìÑÿìÑÿìÑÿìÑÿìÑÿìÑÿìÑÿìÑÿìÑÿìÑÿìÑÿìÑÿìÑÿìÑÿìÑÿìÑÿìÑÿìÑÿìÑÿìÑÿìÑÿìÑÿìÑ<Ñ<ÑÑÈÑÿìÑxÑÑxÑxÑÿìÑÿìÑÿìÑÑxÑxÑÿìÑÿìÑÿìÑÑxÑxÑÿìÑÿìÑÿìÑÿìÑÿìÑÿìÑÿìÑÿìÑÿìÑÿìÑÿìÑÿìÑÑÿìÑÿìÑÑÿ§Ñÿ§Ñÿ§ÑÿìÑÑhÑÑÿìÑÈÑhÑÈÑÿìÑÈÑÿìÑÈ'ÿì'ÿì'ÿì'ÿì'ÿì'ÿì'ÿì'ÿì'ÿì'ÿì'ÿì'ÿì'ÿì'ÿì'ÿì'ÿì''ÿì'ÿì'ÿì'ÿì'q'ÿì''ÿì'ÿì'ÿì'ÿì'ÿì''ÿì'ÿ캺ººººººººlºlºººgºgº'''''''''''''''''ûpôûpûrûpûpûpûpûpûpûpûpûp7p7ºTºúúúûpûp''''¸3ººººº'''ôpººººûpûpûpûp'''¤º¤ºܺܺ',«h,d,ª,ƒ,…,…•ª+ª,ª}}_}} ÷Œ ‘,¸,·,·Bš,d,˜,¬,¬,Ÿ,«,¬,¬,²ß“,±ß“,},¬,ª,dZdøª2ªEª\ª,ª,²,ª¯ª,«,ª,ª,ª,ª,ª,ª,ª,ª,ª,ª,‡WªWªWª,ª,Ý,ªé¯ܯܯ,¢,S,À,ø,,ì,],·,À,ç,,m,«,E,©,À,°,A,É,â,U,¶,Q,0,É,â,U,¶,L,0,C,¹,X,ä,B,¶,X,ä,ØƬ¬,x,¼Ƶܬß­ü¬ „,¬,œ,œ,œ,œ,œ,œ,œ,œ,¬,ª,ª,ª,1ô–ô–ô–ô–ô–ô–,ª,ª,ª,ª,ª,ª,ª,ª,ª,ª,X,X,j,Æ, T},y,},),Â,,,,í,í,džª ¯·¢ f¯9¯´ ´Ï´€´ ´´´ú´d´T´ ÀÒ´±ܯÜYܰܰÌxÜŽÜD´V´V´V´Vܯ´´V´´I´V´V´x´„´³´+´¶´5´¶´X´Š´3´í´´¯´ñ´ü´p´p´p´p´R´ ´>´p´»´T´V´S´T´W´W´/´V´0´/´0´0´0´2´„´˜´p´@´T´»´T´T´T´p´§´§´¡´¡´n´n´T´V´¡´¶´œ´‚´¡´a´a´T´T,f,z,z,z,z,ª´´°´”®”xN®Nx´>´ž´N´n´X´~´ ´‘´‘´´´¹´Û´#´9´U´w´Ä´l´f´¡,˜,˜,˜,˜,˜,˜,˜,˜,˜,˜´ ´ ´ ´ ´ ´ ´ ´ ´ ´ ´ ´ ´ ´ ´ ´ ´ ´ ´ ´ ´u´ü´u´ü´u´u´u´u´u´u´u´ä´ä´ä´u´u´ì´u´u´u´+´+´´´´´<´‚´¥´u´§´§´u´§´s´–´¢´¢´unOôö°ö¯·¤s·s¤´[´Y´O´O Bu xd xu xd xd xu xd xd xu xd xu xuÜÜ,Ü,Ü,Ü,Ü,Ü,Ü,Ü„Ü,Ü,Ü,Ü,Ü,Ü,Ü,Ü„Ü,Ü,Ü,Ü,Ü,Ü,Ü,Ü„Ü,Ü,Ü,Ü,Ü,Ü,Ü,Ü„Ü,Ü,Ü,Ü,Ü,Ü,Ü,Ü„Ü,Ü,Ü,Ü,Ü,Ü,Ü,Ü„Ü,Ü,Ü,Ü,Ü,Ü,Ü,Ü„Ü,Ü,Ü,Ü,Ü,Ü,Ü,Ü,Ü,Ü,Ü,Ü,Ü,Ü,Ü,Ü,Ü,Ü,Ü,Ü,Ü,Ü,Ü,Ü,Ü,Ü,Ü,Ü,Ü,Ü,Ü,Ü,Ü,Ü,Ü,Ü,Ü,Ü,Ü,Ü,Ü,Ü,Ü,Ü,Ü,Ü,Ü,Ü,Ü,Ü,Ü,Ü,Ü,Ü,Ü,Ü,Ü,Ü,Ü,Ü,Ü,Ü,Ü,Ü,Ü,Ü,Ü,Ü,Ü,Ü,Ü,Ü„Ü,Ü,Ü,Ü,Ü,Ü,Ü,Ü„Ü,Ü,Ü,Ü,Ü,Ü,Ü,Ü„Ü,Ü,Ü,Ü,Ü,Ü,Ü,Ü„Ü,Ü,Ü,Ü,Ü,Ü,Ü,Ü„Ü,Ü,Ü,Ü,Ü,Ü,Ü,Ü„Ü,Ü,Ü,Ü,Ü,Ü,Ü,Ü„Ü,Ü,Ü,Ü,Ü,Ü,Ü,Ü„Ü,Ü,Ü,Ü,Ü,Ü,Ü,Ü,Ü,Ü,Ü,Ü,Ü,Ü,Ü,Ü,Ü,Ü,Ü,Ü,Ü,Ü,Ü,Ü,Ü,Ü,Ü,Ü,Ü,Ü,Ü,Ü,Ü,Ü,Ü,Ü,Ü,Ü,Ü,Ü,Ü,Ü,Ü,Ü,Ü,Ü,Ü,Ü,Ü,Ü,Ü,Ü,Ü,Ü,Ü,Ü,Ü,Ü,Ü,Ü,Ü,Ü,Ü,Ü,Ü,Ü,Ü,Ü,Ü,Ü,Ü,´d´u´´wOwOßß´ÙÙÙÙÙÙÙÙô´Ù´Ù::: šu+u+u+u+u+u+u+u+u+u+u+ÿ¾+u+u+u+u+k´´Ù´Ù´Ù´Ù´Ù´Ù´Ù´Ù´Ù´Ù´Ù´Ù´Ù´Ù´Ù´Ù´Ù´Ù´Ù´Ù´Ù´Ù´Ù´Ù´Ù´Ù´Ù´Ù´Ù´Ù´Ú´Ú´Ù´Ù´Ù´Ù´Ù´Ù´Ù´Ù´Ù´Ù´Ù´Ù´Ù´Ù´Ù´Ù´Ù´Ù´Ù´Ù´Ù´µ´ ´µ´ ´7´7´^´^´µ´ ´µ´ ´7´^°u°u°H°Hºººº''''ºô$ô$ü–ü–ü"ôpôMôMu 9 uÿ×Ó ÉçH#ÿèɺ?É¢º{\3X@sçÉy@sà= D±V¼h<É‹ÁGpPåqíbfÿér ‡{\º{Â2„PгiIPlÃŽÛh¡PõmÃPihÂhsŽsh­h½fchŸ{ŸdÄPÂh¸h¼P¼V÷z]P·<±`¦FPPÄdÂz½|"h5z,qssu@xC@~–yyɃv–ÿÛ{\í–{\ssg–)É?>8–{\(–ÉoŸo:oüÉ÷Ì\É:o\ÉŸcssÉÉþ–ss–s$d{=–súÉyÉÉNs‰ÉNs6?´Ù°Ç°Ç?“,ª,ª,ª,ª,ª,ª,ª,ª,ª,ª,ª,ª,ª,ª,ª,ª,ª,ª,ª,ª,ª,ª,ª,ª,ª,ª,ª,ª,ª,ª,ª,ª,ª,ª,ª,ª,ª,ª,ª,ª,ª,ª,ª,ª,ª,ª,ª,ª,ª,ª,ª,ª,ª,ª,ª,ª,ª,ª,ª,ª,ª,ª,ª,ª}ÉÓÉÓF)Éãÿúãÿú3s?É?ÿÕ–s s{\šÉšÉçÉüÉuɇÉ;yyÉ3£ÉéD{=ãÿü}‘yyɃ\ÉLsÛ²Û²u#sf¯f’ůůf’f¯´¯´¯r+dÔɵ¦ pv9˜;<@>£s¼pÐÓ¾ÁeKkˆT5L mɺLsåqØs³q Ýs&q:Bÿúz<ãÿú©<|¯ºòÖòÖòÖòÖòÖòÖòÖòÖòÖòÖòÖòÖòÖòÖòÖôfôfÃÃÉىÆsÆsɺÿú­7ê¤S…íº+o ÿá{  ë{ #Ù{Å‹{Å‹{¬‹{ se? ªqÉ#Á§Sjxt ¢ Ýs&qÓ ÿûß222Lsq× ÿû× ÿûu 9Áâɺ²ð 553Å|¯æM.ÉUº3?¢üJ+hÿ—'GRºšwÓFçÉ\É ˜DµÂçn`#ZçµÂçn`nçµÂçn`nçµÂç#Z`nçµÂ3ÖЖЖЖЖ¤n¤nýnn®o¤n9nnqn¤n Yn¶n¸‚ôn¤n·nOn¸‚Ùnª2ún·n)n¶n¶n¹ƒ1p¶n·ƒÊn¸‚!2£n¬x¤n¤n¥nn¤nszwddddddddddd$d$d$dKdKdKdKdKd_<_<_<_<_<_<åqƒ/ / /¼/¼/}/ão « ® ‘® }® <®ʈV¥JNÙ®1X?º,X¿X׺uX`´Ù«X«N«X«XYºYºYº XLX^X:ºØY?Y0¹¤YLX;XŒXoX2X1¹ºÿº¿X­º„X«XB.º X;XÿºXˆ‚Û‚:ÿìjÿ숂ۂ:ÿìjÿ숂ۂ:ÿìjÿ숂ۂ:ÿìjÿ숂ۂ:ÿìjÿ숂ۂ:ÿìjÿìK‚H‚Óÿì ÿìK‚H‚Óÿì ÿì**òÿì*ÿì**òÿì*ÿì**òÿì*ÿì**òÿì*ÿì}3}}3}}3}}3}Ýÿ«jÿ«Ýÿ«jÿ«)‚)‚Ïÿìkÿì)‚)‚Ïÿìkÿì)‚)‚Ïÿìkÿì)‚)‚Ïÿìkÿìà““à““:ÿìjÿì–8ÿì°ÿ옾ÏÿìkÿìÝÿ«"ÿ«Ýÿ«"ÿ«Ýÿ«"ÿ«Ýÿ«"ÿ«C‚«‚:ÿìjÿì:ÿìjÿìC‚«‚:ÿìjÿìüpý*XXÿìXiXXXÿìXXÿìXXÿìXÿôXÿìXXÿìã9ÿµpÿµ9lplÝÿ«"ÿ«9lplC‚«‚:ÿìjÿì9ÁpÁˆ‚Û‚:ÿìjÿì1‹J‘ˆ‚Û‚:ÿìjÿ숂ۂ:ÿìjÿì**òÿì*ÿì**òÿì*ÿì**òÿì*ÿì}3}}3}Ýÿ«jÿ«Ýÿ«jÿ« Ä‚ 3‚´ÿì#ÿì Ä‚ 3‚´ÿì#ÿì ¬‚ Í‚Ëÿìðÿì ¬‚ Í‚Ëÿìðÿìf˜^ÿìÿìf˜^ÿìÿìÆuBuÆÿìÜÿìÆuBu/ÿìÜÿìK‚H‚Óÿì ÿì5k¬kÓÿì ÿ옾ÏÿìkÿìÐpÿì¦ÿìôŒSŒIÿì ÿìà““:ÿìjÿì1‹J‘8ÿì°ÿìÝÿ«"ÿ«C‚«‚C‚«‚:ÿìjÿìÿ.Æÿ.ÿåÆÿåÆTÆT4dÜÈ€dÎÈdÈdÈ„–È:–DÈÈ_È jÈ ÈdÈ:–}ÈòȰ–ÚȈ–’dÈ}–x–zd8–vÈvÈ„ddDÈd}–‹d,ª,ª,ª,ª,ª,ª,ª,ª,ª,ª,ª,ª,ª,ª,ª,ª,ª,ª,ª,ª,ª,ª,ª,ª,ª,ª,ª,ª,ª,ª,ª,ª,ª,ª,ª,ª,ª,ª,ª,ª,ª,ª,ª,ª,ª,ª,ª,ª,ª,ª,ª,ª,ª,ª,ª,ª,ª,ª,ª,ª,ª,ª,ª,ª,ª,ª,ª,ª,ª,ª,ª,ª,ª,ª,ª,ª,ª,ª,ª,ª,ª,ª,ª,ª,ª,ª,ªíÙÉèÖÉcÉ3s$f"ÿ–É=É3ÄLrˆªÿú¤±ÈÝDrl¨ÿüK{ª”fqª”ìo¹/ªqåºÏæÏÿ×5ºÏæ "ºåºåqªqªqߺ+o¹7ê±Ü=HVhLÿ=¸Xy}É–s)ÉÉšÉ3sÉŒ—\ÿ–?ÉuÉçÉüÉLsÓÉLsɇãÿúÛ²yéD{=ãÿü{\ç{ºfqqìqÑ/qº9Á9ÿÛ¢º9Á˺ºåqºqJº+o#7®¼=‹V¼;¼=3Xˆk‚œZ”qA‹j‡á–œdž¨‹9Áˆ‚*}Ýÿ«Ýÿ«*fC‚˜ÐôŒà“ Ä‚ÆuK‚ ¬‚5kÝÿ« Ä‚ˆ‚ˆ‚*} ¬‚fÆuˆ‚à“K‚5k4ÿìVÿìÎÿìVÿì4ÿìÉÿìjÿìßÿì4ÿìÿìÆÿìÓÿì/ÿìÓÿìÿì4ÿì4ÿìVÿì/ÿì/ÿì@ÁbÁ¨ÁbÁÍÁ@Á?Á¹Á@Á $Á6ÁCÁ ;ÁCÁ $Á@Á@ÁbÁ ;ÁÍÁ6Á@ÁCÁ éÈ éÈ éÈ éÈ éÈ éÈ éÈ éÈ éÈ éÈ éÈ éÈ éÈ éÈ éÈ éÈ éÈ éÈ éÈ éÈ éÈ éÈ éÈ éÈ éÈ éÈ éÈ éÈ éÈ éÈ éÈ éÈ éÈ éÈ éÈ éÈ éÈ éÈ éÈ éÈ éÈ éÈ éÈ éÈ éÈ éÈ éÈ éÈ éÈ éÈ…È…È…È…È…È…È…È…È…È…È…È…È…È…È…È…È…È…È…È…È…È…È…È…È…È…È…È…È…È…È…È…È…È…È…È…È…È…È…È…È…È…È…È…È…È…È…È…È…È…È/È/È/È/È/È/È/È/È/È/È/È/È/È/È/È/È/È/È/È/È/È/È/È/È/È/È/È@Ù/È/È/È/È/È/È/È/È/È/È/È/È/È/È/È/È/È/È/È/È/È/È/È/È/È/È/È/È/È/È/ÈX™ xKW= @ªWªWª Y_WªWªWªWªWWªWªWªWªWªWªWªWªWªWªWªWªWªWªWªWªWªWªWªWªWªWªWªWªWªWªWªWªWªWªWªWªWªWªWª Y_WªWªWªW#WªWª ÕªWªWªWªW: Y`W:W=W=W=W=W=W=ÿ¹ü×ýsü¶ý üÏüÏüÇüÇýšüæüN––Û‚:ÿìjÿìH‚Óÿì ÿì¬kÓÿì ÿì:ÿìjÿì¶Û‚:ÿìjÿìÛ‚:ÿìjÿì*òÿì*ÿì*òÿì*ÿì*òÿì*ÿì*òÿì*ÿì_üÕ9îþòx’x’x’x“x“x’x’xvx‹xvx‹xvx‹x‹xvxvxƒxƒxƒx‹üš,âÿ«âÿ«pÿì¦ÿì«‚:ÿìjÿìjÿ«9ÁJ‘–qâq9–ÏOÏÿ9ÿÓ9¿²ðŒ—´­ÈÈÈÈÈÈÜÜ:Á:ÿì:ÿì’q’ÿì’ÿìd=dÿìdÿì¼=¼ÿì¼ÿì;º;ÿì;ÿì;º;ÿì;ÿìÀqÀÿìÀÿì;º;ÿì;ÿì¡q¡ÿì¡ÿìÁÿìÿì=ÿìÿìxºxÿìxÿìåÁåÿìåÿìÍ=ÍÿìÍÿì¬Á¬ÿì¬ÿìÈ=ÈÿìÈÿìD=DÿìDÿì;º;ÿì;ÿì=ÿìÿìßÁßÿìßÿì=Á=ÿì=ÿìËpËÿìËÿìÈ=ÈÿìÈÿì=ÿìÿìÀqÀÿìÀÿì=Á=ÿì=ÿì=Á=ÿì=ÿì.Á.ÿì.ÿìÀqÀÿìÀÿìÀqÀÿìÀÿìüì,ª,ª,ª,ª,ª,ª,ª,ª³—.ÉjÁ®3}3}3}3}3}jÿ«jÿ«jÿ«jÿ«jÿ« 3‚´ÿì#ÿì 3‚´ÿì#ÿì 3‚´ÿì#ÿì Í‚Ëÿìðÿì Í‚Ëÿìðÿì˜^ÿìÿìBuÆÿìÜÿìH‚Óÿì ÿìH‚Óÿì ÿìH‚Óÿì ÿì¬kÓÿì ÿì¬kÓÿì ÿìn‚òÿìòÿì)‚Ïÿìkÿì¾Ïÿìkÿì¾Ïÿìkÿì)‚Ïÿìkÿì)‚Ïÿìkÿì)‚Ïÿìkÿìpÿì¦ÿìpÿì¦ÿìpÿì¦ÿì“:ÿìjÿì“:ÿìjÿì“:ÿìjÿì55??4ÿìÝÝŸ#ä¥í¥ õ¥ä¥í¥ õ¥ä¥ä¥ä¥ Gÿø Gÿø GÆ GÆ PR PR PRþ¥䥥¥¥¥¥¥¥¥¥ÿ£¥¥¥¥—?ø §0 ê$ÿÓ%ÿ·*K-r294K7ÿD9ÿˆ:ÿ­;ÿš<ÿ R&YÿÉ\ÿÜ‚ÿÓƒÿÓ„ÿÓ…ÿÓ†ÿÓ”9•9–9—9˜9Ÿÿ ´&µ&¶&·&¸&¿ÿÜÁÿÜÂÿÓÄÿÓÆÿÓàK&ÿD:ÿ $ÿÓ$ÿÜ$ÿÜ$$9$&ÿÜ$*ÿÜ$2ÿÜ$4ÿÜ$7ÿa$9ÿ}$:ÿ$<ÿa$FÿÜ$GÿÜ$HÿÜ$Iÿ·$RÿÜ$TÿÜ$WÿÜ$Yÿˆ$Zÿ­$\ÿu$mÿ·$‚9$ƒ9$„9$…9$†9$‰ÿÜ$”ÿÜ$•ÿÜ$–ÿÜ$—ÿÜ$˜ÿÜ$Ÿÿa$©ÿÜ$ªÿÜ$«ÿÜ$¬ÿÜ$­ÿÜ$´ÿÜ$µÿÜ$¶ÿÜ$·ÿÜ$¸ÿÜ$¿ÿu$Áÿu$Â9$Ä9$Æ9$ÈÿÜ$ÉÿÜ$ÊÿÜ$ËÿÜ$ÌÿÜ$ÍÿÜ$ÎÿÜ$ÏÿÜ$ÑÿÜ$ÓÿÜ$ÕÿÜ$×ÿÜ$ÙÿÜ$ÛÿÜ$ÝÿÜ$ÞÿÜ$àÿÜ$âÿÜ$ÿÜ$ÿÜ$ÿÜ$ÿÜ$ÿÜ$ÿÜ$$ÿa$%ÿÜ$&ÿa$'ÿÜ$6ÿ$7ÿ­$8ÿa$9ÿu$:ÿa$ˆÿÜ$¬ÿÜ$­ÿÜ$®ÿÜ$¯ÿÜ$Üÿa$ÝÿÜ$ðÿÜ$óÿÜ$ôÿa$õÿu$ }ÿ$ ~ÿ­$ ÿ$ €ÿ­$ ÿ$ ‚ÿ­$ ïÿa$ ðÿu$ þþø$ ÿÿ$ /%&ÿÜ%*ÿÜ%2ÿÜ%6ÿÜ%9ÿÁ%:ÿ·%<ÿ%mÿÁ%}ÿÜ%‰ÿÜ%”ÿÜ%•ÿÜ%–ÿÜ%—ÿÜ%˜ÿÜ%Ÿÿ%ÈÿÜ%ÊÿÜ%ÌÿÜ%ÎÿÜ%ÞÿÜ%àÿÜ%âÿÜ%äÿÜ%ÿÜ%ÿÜ%ÿÜ%ÿÜ%ÿÜ% ÿÜ%"ÿÜ%6ÿ·%8ÿ%:ÿ%¬ÿÜ%®ÿÜ%ÚÿÜ%ðÿÜ% }ÿ·% ÿ·% ÿ·% ïÿ% þÿ% ÿÿ% ÿ­&<ÿÜ&mÿÜ&}ÿÜ&ŸÿÜ&8ÿÜ&:ÿÜ&ôÿÜ& ïÿÜ& ÿ&'$ÿÜ'9ÿÜ'<ÿ'mÿÜ'}ÿÜ'‚ÿÜ'ƒÿÜ'„ÿÜ'…ÿÜ'†ÿÜ'Ÿÿ'ÂÿÜ'ÄÿÜ'ÆÿÜ'8ÿ':ÿ'ôÿ' ïÿ' þÿÓ' ÿÿÉ' ÿD)þ·)ÿa)$ÿD)6ÿÜ)7ÿÜ)DÿD)Hÿ)Lÿk)Rÿ·)Uÿk)Xÿ)\ÿD)‚ÿD)ƒÿD)„ÿD)…ÿD)†ÿD)¢ÿD)£ÿD)¤ÿD)¥ÿD)¦ÿD)§ÿD)ªÿ)«ÿ)¬ÿ)­ÿ)´ÿ·)µÿ·)¶ÿ·)·ÿ·)¸ÿ·)»ÿ)¼ÿ)½ÿ)¾ÿ)¿ÿD)ÁÿD)ÂÿD)ÃÿD)ÄÿD)ÅÿD)ÆÿD)ÇÿD)Õÿ)×ÿ)Ùÿ)Ûÿ)Ýÿ)ñÿk)õÿk)ÿ·)ÿ·)ÿ·)ÿk)ÿk)ÿk)ÿÜ)ÿÜ) ÿÜ)"ÿÜ)$ÿÜ)&ÿÜ)(ÿÜ)+ÿ)-ÿ)/ÿ)1ÿ)3ÿ)5ÿ)9ÿD)­ÿ·)¯ÿ·)ÚÿÜ)ÜÿÜ)ñÿ·)õÿD) ðÿD) þÿÓ) þˆ*7ÿ·*<ÿš*mÿÜ*}ÿÜ*Ÿÿš*&ÿ·*:ÿš* þÿÓ* ÿÿÓ* ÿÉ+ÿÜ+ þÿ·+ ÿÿÁ+ ÿ·-ÿ·-$ÿÜ-mÿÜ-}ÿÜ-‚ÿÜ-ƒÿÜ-„ÿÜ-…ÿÜ-†ÿÜ- þÿ·- ÿÿÁ- ÿ.ÿ).$ÿÜ.&ÿ.2ÿ.7ÿa.8ÿÉ.:ÿ·.<ÿ·.DÿÜ.Hÿš.Rÿš.Xÿš.\ÿk.mÿ}.‚ÿÜ.ƒÿÜ.„ÿÜ.…ÿÜ.†ÿÜ.‰ÿ.”ÿ.•ÿ.–ÿ.—ÿ.˜ÿ.›ÿÉ.œÿÉ.ÿÉ.žÿÉ.Ÿÿ·.¢ÿÜ.£ÿÜ.¤ÿÜ.¥ÿÜ.¦ÿÜ.§ÿÜ.ªÿš.«ÿš.¬ÿš.­ÿš.´ÿš.µÿš.¶ÿš.·ÿš.¸ÿš.»ÿš.¼ÿš.½ÿš.¾ÿš.¿ÿk.Áÿk.Èÿ.Îÿ.Ýÿš.&ÿa.0ÿÉ.1ÿš.:ÿ·. þÿÁ. ÿÿÁ/ÿÜ/$//2ÿ·/7þæ/8ÿš/9ÿ/:ÿD/<þð/HÿÜ/RÿÜ/XÿÜ/\ÿD/‚//ƒ//„//…//†//”ÿ·/•ÿ·/–ÿ·/—ÿ·/˜ÿ·/›ÿš/œÿš/ÿš/žÿš/Ÿþð/ªÿÜ/«ÿÜ/¬ÿÜ/­ÿÜ/´ÿÜ/µÿÜ/¶ÿÜ/·ÿÜ/¸ÿÜ/»ÿÜ/¼ÿÜ/½ÿÜ/¾ÿÜ/¿ÿD/ÁÿD/ÝÿÜ/&þæ/0ÿš/1ÿÜ/:þð/ þþa/ ÿýæ292ÿ­2ÿÜ2$ÿÜ29ÿÜ2;ÿ}2<ÿ2mÿÜ2‚ÿÜ2ƒÿÜ2„ÿÜ2…ÿÜ2†ÿÜ2Ÿÿ2:ÿ2 þÿÓ2 ÿÿÜ2 ÿD3ÿÓ3þÁ3$ÿ}3<ÿÓ3Dÿ¤3Hÿ·3LÿÓ3QÿÜ3Rÿ·3UÿÜ3VÿÜ3XÿÜ3mÿÜ3‚ÿ}3ƒÿ}3„ÿ}3…ÿ}3†ÿ}3ŸÿÓ3¢ÿ¤3£ÿ¤3¤ÿ¤3¥ÿ¤3¦ÿ¤3§ÿ¤3ªÿ·3«ÿ·3¬ÿ·3­ÿ·3³ÿÜ3´ÿ·3µÿ·3¶ÿ·3·ÿ·3¸ÿ·3»ÿÜ3¼ÿÜ3½ÿÜ3¾ÿÜ3Ýÿ·3 ÿÜ3ÿÜ3ÿÜ3!ÿÜ3#ÿÜ31ÿÜ3:ÿÓ3 þ&3 ÿ&3 þ·494 þÿÓ4 ÿÿÜ4 ÿ}5ÿ­5ÿ·5ÿÁ5$ÿ­5&ÿš57ÿk59ÿ5:ÿ­5<ÿ}5DÿÓ5Hÿ¤5Rÿ¤5Xÿ¤5\ÿ5mÿ5}ÿÜ5‚ÿ­5ƒÿ­5„ÿ­5…ÿ­5†ÿ­5‰ÿš5Ÿÿ}5¢ÿÓ5£ÿÓ5¤ÿÓ5¥ÿÓ5¦ÿÓ5§ÿÓ5ªÿ¤5«ÿ¤5¬ÿ¤5­ÿ¤5´ÿ¤5µÿ¤5¶ÿ¤5·ÿ¤5¸ÿ¤5»ÿ¤5¼ÿ¤5½ÿ¤5¾ÿ¤5¿ÿ5Áÿ5Èÿš5Îÿš5Ýÿ¤5&ÿk51ÿ¤5:ÿ}5 þÿk5 ÿÿ}5 ÿÜ6$&6‚&6ƒ&6„&6…&6†&7ÿD7ÿ 7ÿ7$ÿa7&ÿˆ77ÿÜ7Dþ­7Fþ¤7Hþ¤7LÿÁ7Rþ¤7UþÓ7Vþ­7XþÉ7Zþ­7\þÁ7mÿD7}ÿ7‚ÿa7ƒÿa7„ÿa7…ÿa7†ÿa7‰ÿˆ7¢ÿ7£þ­7¤ÿ7¥ÿ7¦ÿ7§ÿ7©þ¤7ªþà7«þ¤7¬þà7­þà7´þô7µþ¤7¶þô7·þô7¸þô7»þç7¼þÉ7½þç7¾þç7¿þÁ7ÁþÁ7Èÿˆ7Éþ¤7Îÿˆ7Ïþ¤7Ýþ¤7þÓ7þÓ7!þ­7#þ­7&ÿÜ71þÉ7 ÿÿÓ7 þø8=ÿÜ8?ÿÜ9ÿˆ9þø9ÿY9$ÿ}92ÿÜ9Dÿa9Hÿa9LÿÓ9Rÿa9Xÿu9\ÿÉ9mÿN9}ÿ9‚ÿ}9ƒÿ}9„ÿ}9…ÿ}9†ÿ}9”ÿÜ9•ÿÜ9–ÿÜ9—ÿÜ9˜ÿÜ9¢ÿa9£ÿa9¤ÿa9¥ÿa9¦ÿa9§ÿa9ªÿa9«ÿa9¬ÿa9­ÿa9´ÿa9µÿa9¶ÿa9·ÿa9¸ÿa9»ÿu9¼ÿu9½ÿu9¾ÿu9¿ÿÉ9ÁÿÉ9Ýÿa91ÿu9 þæ:ÿ­:ÿ:ÿˆ:$ÿ:Dÿ}:Hÿˆ:LÿÓ:Rÿˆ:Uÿ¤:Xÿ·:\ÿÜ:mÿ:}ÿÜ:‚ÿ:ƒÿ:„ÿ:…ÿ:†ÿ:¢ÿ}:£ÿ}:¤ÿ}:¥ÿ}:¦ÿ}:§ÿ}:ªÿˆ:«ÿˆ:¬ÿˆ:­ÿˆ:´ÿˆ:µÿˆ:¶ÿˆ:·ÿˆ:¸ÿˆ:»ÿ·:¼ÿ·:½ÿ·:¾ÿ·:¿ÿÜ:ÁÿÜ:Ýÿˆ:ÿ¤:ÿ¤:1ÿ·: þÿÜ: þø;ÿš;&ÿk;2ÿ};7ÿÜ;Hÿ¤;mÿ;‰ÿk;”ÿ};•ÿ};–ÿ};—ÿ};˜ÿ};ªÿ¤;«ÿ¤;¬ÿ¤;­ÿ¤;Èÿk;Îÿk;Ýÿ¤;&ÿÜ; þÿa; ÿÿ­; ÿÓ<ÿ <þa<þð<$ÿa<&ÿ<2ÿ<Dþæ<Hþð<Lÿ·<Rþð<Xÿ<mÿ<}ÿk<‚ÿa<ƒÿa<„ÿa<…ÿa<†ÿa<‰ÿ<”ÿ<•ÿ<–ÿ<—ÿ<˜ÿ<¢þæ<£þæ<¤þæ<¥þæ<¦þæ<§þæ<ªþð<«þð<¬þð<­þð<´þð<µþð<¶þð<·þð<¸þð<»ÿ<¼ÿ<½ÿ<¾ÿ<Èÿ<Îÿ<Ýþð<1ÿ< þÿ< ÿÿÜ< þø=ÿÜ= þÿÜ= ÿÿÜ= ÿÜH[ÿÜIÿIÿkIÿ·IWÿÜIZÿÜI\ÿÜImÿ·I}ÿÜI¿ÿÜIÁÿÜI'ÿÜI þAI ÿNDÿÜNHÿ·NRÿ·NXÿÁN\ÿ·N¢ÿÜN£ÿÜN¤ÿÜN¥ÿÜN¦ÿÜN§ÿÜNªÿ·N«ÿ·N¬ÿ·N­ÿ·N´ÿ·Nµÿ·N¶ÿ·N·ÿ·N¸ÿ·N»ÿÁN¼ÿÁN½ÿÁN¾ÿÁN¿ÿ·NÁÿ·NÝÿ·N1ÿÁQ þÿkQ ÿÿQ ÿ¤R&RÿÜR[ÿÁR þÿkR ÿÿ·R ÿ}Uÿ}UÿDUÿÜUFÿÓUGÿÜUHÿÓUJÿÜUKÿÜUPÿÜUQÿÜURÿÓUTÿÜUUÿÜU[ÿÉUmÿ·U©ÿÓUªÿÓU«ÿÓU¬ÿÓU­ÿÓU³ÿÜU´ÿÓUµÿÓU¶ÿÓU·ÿÓU¸ÿÓUÉÿÓUÏÿÓUÑHUÝÿÓUáÿÜU ÿÜUÿÜUÿÜU ÿVU þÉYÿÉYÿaYÿYmÿÜY}ÿÜY ÿÿÜY þðZÿDZÿZmÿÜZ}ÿÜZ ÿ)[FÿÜ[HÿÁ[RÿÁ[©ÿÜ[ªÿÁ[«ÿÁ[¬ÿÁ[­ÿÁ[´ÿÁ[µÿÁ[¶ÿÁ[·ÿÁ[¸ÿÁ[ÉÿÜ[ÏÿÜ[ÝÿÁ\ÿÜ\þÜ\ÿk\mÿÜ\}ÿÜ\ þÓm%ÿÜm&ÿÜm'ÿÜm*ÿÜm-ÿÜm7ÿm9ÿm:ÿÜm<ÿkmYÿÜmZÿÜm\ÿÜmˆ—m‰ÿÜmŸÿkm¿ÿÜmÁÿÜmÈÿÜmÎÿÜmÐÿÜmàÿÜm&ÿm:ÿk}$ÿ·}%ÿ·}&ÿÜ}'ÿÜ}-ÿÜ}2ÿÜ}7ÿD}9ÿN}:ÿ};ÿ}<ÿ}YÿÜ}ZÿÜ}\ÿÜ}‚ÿ·}ƒÿ·}„ÿ·}…ÿ·}†ÿ·}‰ÿÜ}”ÿÜ}•ÿÜ}–ÿÜ}—ÿÜ}˜ÿÜ}Ÿÿ}¿ÿÜ}ÁÿÜ}ÈÿÜ}ÎÿÜ}ÐÿÜ}&ÿD}:ÿ‚ÿÓ‚ÿÜ‚ÿÜ‚$9‚&ÿÜ‚*ÿÜ‚2ÿÜ‚4ÿÜ‚7ÿa‚9ÿ}‚:ÿ‚<ÿa‚FÿÜ‚GÿÜ‚HÿÜ‚Iÿ·‚RÿÜ‚TÿÜ‚WÿÜ‚Yÿˆ‚Zÿ­‚\ÿu‚mÿ·‚‚9‚ƒ9‚„9‚…9‚†9‚‰ÿÜ‚”ÿÜ‚•ÿÜ‚–ÿÜ‚—ÿÜ‚˜ÿÜ‚Ÿÿa‚©ÿÜ‚ªÿÜ‚«ÿÜ‚¬ÿÜ‚­ÿÜ‚´ÿÜ‚µÿÜ‚¶ÿÜ‚·ÿÜ‚¸ÿÜ‚¿ÿu‚Áÿu‚Â9‚Ä9‚Æ9‚ÈÿÜ‚ÉÿÜ‚ÊÿÜ‚ÌÿÜ‚ÍÿÜ‚ÎÿÜ‚ÏÿÜ‚ÑÿÜ‚ÕÿÜ‚×ÿÜ‚ÙÿÜ‚ÛÿÜ‚ÝÿÜ‚ÞÿÜ‚àÿÜ‚âÿÜ‚ÿÜ‚ÿÜ‚ÿÜ‚ÿÜ‚ÿÜ‚ÿÜ‚$ÿa‚%ÿÜ‚&ÿa‚'ÿÜ‚6ÿ‚7ÿ­‚8ÿa‚9ÿu‚:ÿa‚ðÿÜ‚ñÿÜ‚ }ÿ‚ €ÿ­‚ ÿ‚ ‚ÿ­‚ ïÿa‚ ðÿu‚ þþø‚ ÿÿ‚ /ƒÿÓƒÿ܃ÿ܃$9ƒ&ÿ܃*ÿ܃2ÿ܃4ÿ܃7ÿaƒ9ÿ}ƒ:ÿƒ<ÿaƒFÿ܃Gÿ܃Hÿ܃Iÿ·ƒRÿ܃Tÿ܃Wÿ܃YÿˆƒZÿ­ƒ\ÿuƒmÿ·ƒ‚9ƒƒ9ƒ„9ƒ…9ƒ†9ƒ‰ÿ܃”ÿ܃•ÿ܃–ÿ܃—ÿ܃˜ÿ܃Ÿÿaƒ©ÿ܃ªÿ܃«ÿ܃¬ÿ܃­ÿ܃´ÿ܃µÿ܃¶ÿ܃·ÿ܃¸ÿ܃¿ÿuƒÁÿuƒÂ9ƒÄ9ƒÆ9ƒÈÿ܃Éÿ܃Êÿ܃Ìÿ܃Íÿ܃Îÿ܃Ïÿ܃Ñÿ܃Õÿ܃×ÿ܃Ùÿ܃Ûÿ܃Ýÿ܃Þÿ܃àÿ܃âÿ܃ÿ܃ÿ܃ÿ܃ÿ܃ÿ܃ÿ܃$ÿaƒ%ÿ܃&ÿaƒ'ÿ܃6ÿƒ7ÿ­ƒ8ÿaƒ9ÿuƒ:ÿaƒðÿ܃ñÿ܃ }ÿƒ ÿƒ €ÿ­ƒ ÿƒ ‚ÿ­ƒ ïÿaƒ ðÿuƒ þþøƒ ÿÿƒ /„ÿÓ„ÿÜ„ÿÜ„$9„&ÿÜ„*ÿÜ„2ÿÜ„4ÿÜ„7ÿa„9ÿ}„:ÿ„<ÿa„FÿÜ„GÿÜ„HÿÜ„Iÿ·„RÿÜ„TÿÜ„WÿÜ„Yÿˆ„Zÿ­„\ÿu„mÿ·„‚9„ƒ9„„9„…9„†9„‰ÿÜ„”ÿÜ„•ÿÜ„–ÿÜ„—ÿÜ„˜ÿÜ„Ÿÿa„©ÿÜ„ªÿÜ„«ÿÜ„¬ÿÜ„­ÿÜ„´ÿÜ„µÿÜ„¶ÿÜ„·ÿÜ„¸ÿÜ„¿ÿu„Áÿu„Â9„Ä9„Æ9„ÈÿÜ„ÉÿÜ„ÊÿÜ„ÌÿÜ„ÍÿÜ„ÎÿÜ„ÏÿÜ„ÑÿÜ„ÕÿÜ„×ÿÜ„ÙÿÜ„ÛÿÜ„ÝÿÜ„ÞÿÜ„àÿÜ„âÿÜ„ÿÜ„ÿÜ„ÿÜ„ÿÜ„ÿÜ„ÿÜ„$ÿa„%ÿÜ„&ÿa„'ÿÜ„6ÿ„7ÿ­„8ÿa„9ÿu„:ÿa„ðÿÜ„ñÿÜ„ }ÿ„ ÿ„ €ÿ­„ ÿ„ ‚ÿ­„ ïÿa„ ðÿu„ þþø„ ÿÿ„ /…ÿÓ…ÿÜ…ÿÜ…$9…&ÿÜ…*ÿÜ…2ÿÜ…4ÿÜ…7ÿa…9ÿ}…:ÿ…<ÿa…FÿÜ…GÿÜ…HÿÜ…Iÿ·…RÿÜ…TÿÜ…WÿÜ…Yÿˆ…Zÿ­…\ÿu…mÿ·…‚9…ƒ9…„9……9…†9…‰ÿÜ…”ÿÜ…•ÿÜ…–ÿÜ…—ÿÜ…˜ÿÜ…Ÿÿa…©ÿÜ…ªÿÜ…«ÿÜ…¬ÿÜ…­ÿÜ…´ÿÜ…µÿÜ…¶ÿÜ…·ÿÜ…¸ÿÜ…¿ÿu…Áÿu…Â9…Ä9…Æ9…ÈÿÜ…ÉÿÜ…ÊÿÜ…ÌÿÜ…ÍÿÜ…ÎÿÜ…ÏÿÜ…ÑÿÜ…ÕÿÜ…×ÿÜ…ÙÿÜ…ÛÿÜ…ÝÿÜ…ÞÿÜ…àÿÜ…âÿÜ…ÿÜ…ÿÜ…ÿÜ…ÿÜ…ÿÜ…ÿÜ…$ÿa…%ÿÜ…&ÿa…'ÿÜ…6ÿ…7ÿ­…8ÿa…9ÿu…:ÿa…ðÿÜ… }ÿ… ÿ… €ÿ­… ÿ… ‚ÿ­… ïÿa… ðÿu… þþø… ÿÿ… /†ÿÓ†ÿ܆ÿ܆$9†&ÿ܆*ÿ܆2ÿ܆4ÿ܆7ÿa†9ÿ}†:ÿ†<ÿa†Fÿ܆Gÿ܆Hÿ܆Iÿ·†Rÿ܆Tÿ܆Wÿ܆Yÿˆ†Zÿ­†\ÿu†mÿ·†‚9†ƒ9†„9†…9††9†‰ÿ܆”ÿ܆•ÿ܆–ÿ܆—ÿ܆˜ÿ܆Ÿÿa†©ÿ܆ªÿ܆«ÿ܆¬ÿ܆­ÿ܆´ÿ܆µÿ܆¶ÿ܆·ÿ܆¸ÿ܆¿ÿu†Áÿu†Â9†Ä9†Æ9†Èÿ܆Éÿ܆Êÿ܆Ìÿ܆Íÿ܆Îÿ܆Ïÿ܆Ñÿ܆Õÿ܆×ÿ܆Ùÿ܆Ûÿ܆Ýÿ܆Þÿ܆àÿ܆âÿ܆ÿ܆ÿ܆ÿ܆ÿ܆ÿ܆ÿ܆$ÿa†%ÿ܆&ÿa†'ÿ܆6ÿ†7ÿ­†8ÿa†9ÿu†:ÿa†ðÿ܆ñÿ܆ }ÿ† ÿ† €ÿ­† ÿ† ‚ÿ­† ïÿa† ðÿu† þþø† ÿÿ† /ˆ þÿ­ˆ ÿÿ¤ˆ ÿ‰<ÿ܉mÿ܉}ÿ܉Ÿÿ܉:ÿ܉ ÿ&’$ÿÜ’9ÿÜ’<ÿ’mÿÜ’}ÿÜ’‚ÿÜ’ƒÿÜ’„ÿÜ’…ÿÜ’†ÿÜ’Ÿÿ’ÂÿÜ’ÄÿÜ’ÆÿÜ’8ÿ’:ÿ’ôÿ’ ïÿ’ þÿÓ’ ÿÿÉ’ ÿD”9”ÿ­”ÿÜ”$ÿÜ”9ÿÜ”;ÿ}”<ÿ”mÿÜ”‚ÿÜ”ƒÿÜ”„ÿÜ”…ÿÜ”†ÿÜ”Ÿÿ”:ÿ” þÿÓ” ÿÿÜ” ÿD•9•ÿ­•ÿÜ•$ÿÜ•9ÿÜ•;ÿ}•<ÿ•mÿÜ•‚ÿÜ•ƒÿÜ•„ÿÜ•…ÿÜ•†ÿÜ•Ÿÿ•:ÿ• þÿÓ• ÿÿÜ• ÿD–9–ÿ­–ÿÜ–$ÿÜ–9ÿÜ–;ÿ}–<ÿ–mÿÜ–‚ÿÜ–ƒÿÜ–„ÿÜ–…ÿÜ–†ÿÜ–Ÿÿ–:ÿ– þÿÓ– ÿÿÜ– ÿD—9—ÿ­—ÿÜ—$ÿÜ—9ÿÜ—;ÿ}—<ÿ—mÿÜ—‚ÿÜ—ƒÿÜ—„ÿÜ—…ÿÜ—†ÿÜ—Ÿÿ—:ÿ— þÿÓ— ÿÿÜ— ÿD˜9˜ÿ­˜ÿܘ$ÿܘ9ÿܘ;ÿ}˜<ÿ˜mÿܘ‚ÿܘƒÿܘ„ÿܘ…ÿܘ†ÿܘŸÿ˜:ÿ˜ þÿÓ˜ ÿÿܘ ÿD›=ÿÜ›?ÿÜœ=ÿÜœ?ÿÜ=ÿÜ?ÿÜž=ÿÜž?ÿÜŸÿ ŸþaŸþðŸ$ÿaŸ&ÿŸ2ÿŸDþæŸHþðŸLÿ·ŸRþðŸXÿŸmÿŸ}ÿkŸ‚ÿaŸƒÿaŸ„ÿaŸ…ÿaŸ†ÿaŸ‰ÿŸ”ÿŸ•ÿŸ–ÿŸ—ÿŸ˜ÿŸ¢þ柣þ柤þ查þ柦þ柧þ柪þðŸ«þðŸ¬þðŸ­þðŸ´þðŸµþðŸ¶þðŸ·þðŸ¸þðŸ»ÿŸ¼ÿŸ½ÿŸ¾ÿŸÈÿŸÎÿŸÝþðŸ1ÿŸ þÿŸ ÿÿÜŸ þø ÿk ÿ·  þÿÜ  ÿD¡&¡ þÿ¡ ÿÿ¡ ÿ­ª[ÿÜ«[ÿܬ[ÿÜ­[ÿܲ þÿ¤² ÿÿ² ÿ·³ þÿk³ ÿÿ³ ÿ¤´&´ÿÜ´[ÿÁ´ þÿk´ ÿÿ·´ ÿ}µ&µÿܵ[ÿÁµ þÿkµ ÿÿ·µ ÿ}¶&¶ÿܶ[ÿÁ¶ þÿk¶ ÿÿ·¶ ÿ}·&·ÿÜ·[ÿÁ· þÿk· ÿÿ·· ÿ}¸&¸ÿܸ[ÿÁ¸ þÿk¸ ÿÿ·¸ ÿ}¿ÿÜ¿þÜ¿ÿk¿mÿÜ¿}ÿÜ¿ þÓÁÿÜÁþÜÁÿkÁmÿÜÁ}ÿÜÁ þÓÂÿÓÂÿÜÂÿÜÂ$9Â&ÿÜÂ*ÿÜÂ2ÿÜÂ4ÿÜÂ7ÿaÂ9ÿ}Â:ÿÂ<ÿaÂFÿÜÂGÿÜÂHÿÜÂIÿ·ÂRÿÜÂTÿÜÂWÿÜÂYÿˆÂZÿ­Â\ÿuÂmÿ·Â‚9ƒ9„9Â…9†9”ÿÜ•ÿÜ–ÿÜ—ÿܘÿÜŸÿa©ÿܪÿÜ«ÿܬÿÜ­ÿÜ´ÿܵÿܶÿÜ·ÿܸÿÜ¿ÿuÂÁÿuÂÂ9ÂÄ9ÂÆ9ÂÈÿÜÂÊÿÜÂÌÿÜÂÍÿÜÂÎÿÜÂÑÿÜÂÓÿÜÂÕÿÜÂ×ÿÜÂÙÿÜÂÛÿÜÂÝÿÜÂÞÿÜÂâÿÜÂÿÜÂÿÜÂÿÜÂÿÜÂÿÜÂÿÜÂ$ÿaÂ%ÿÜÂ&ÿaÂ'ÿÜÂ6ÿÂ7ÿ­Â8ÿaÂ9ÿuÂ:ÿaÂðÿÜÂñÿÜ }ÿ ÿ €ÿ­Â ÿ ‚ÿ­Â ïÿa ðÿu þþøÂ ÿÿ /ÄÿÓÄÿÜÄÿÜÄ$9Ä&ÿÜÄ*ÿÜÄ2ÿÜÄ4ÿÜÄ7ÿaÄ9ÿ}Ä:ÿÄ<ÿaÄFÿÜÄGÿÜÄHÿÜÄIÿ·ÄRÿÜÄTÿÜÄWÿÜÄYÿˆÄZÿ­Ä\ÿuÄmÿ·Ä‚9ă9Ä„9Ä…9Ć9Ä”ÿÜÄ•ÿÜÄ–ÿÜÄ—ÿÜĘÿÜÄŸÿaÄ©ÿÜĪÿÜÄ«ÿÜĬÿÜÄ­ÿÜÄ´ÿÜĵÿÜĶÿÜÄ·ÿÜĸÿÜÄ¿ÿuÄÁÿuÄÂ9ÄÄ9ÄÆ9ÄÈÿÜÄÊÿÜÄÌÿÜÄÍÿÜÄÎÿÜÄÑÿÜÄÓÿÜÄÕÿÜÄ×ÿÜÄÙÿÜÄÛÿÜÄÝÿÜÄÞÿÜÄâÿÜÄÿÜÄÿÜÄÿÜÄÿÜÄÿÜÄÿÜÄ$ÿaÄ%ÿÜÄ&ÿaÄ'ÿÜÄ6ÿÄ7ÿ­Ä8ÿaÄ9ÿuÄ:ÿaÄðÿÜÄñÿÜÄ }ÿÄ ÿÄ €ÿ­Ä ÿÄ ‚ÿ­Ä ïÿaÄ ðÿuÄ þþøÄ ÿÿÄ /ÆÿÓÆÿÜÆÿÜÆ$9Æ&ÿÜÆ*ÿÜÆ2ÿÜÆ4ÿÜÆ7ÿaÆ9ÿ}Æ:ÿÆ<ÿaÆFÿÜÆGÿÜÆHÿÜÆIÿ·ÆRÿÜÆTÿÜÆWÿÜÆYÿˆÆZÿ­Æmÿ·Æ‚9ƃ9Æ„9Æ…9Ɔ9Æ”ÿÜÆ•ÿÜÆ–ÿÜÆ—ÿÜÆ˜ÿÜÆŸÿaÆ©ÿÜÆªÿÜÆ«ÿÜÆ¬ÿÜÆ­ÿÜÆ´ÿÜÆµÿÜÆ¶ÿÜÆ·ÿÜÆ¸ÿÜÆÂ9ÆÄ9ÆÆ9ÆÈÿÜÆÊÿÜÆÌÿÜÆÍÿÜÆÎÿÜÆÑÿÜÆÓÿÜÆÕÿÜÆ×ÿÜÆÙÿÜÆÛÿÜÆÝÿÜÆÞÿÜÆâÿÜÆÿÜÆÿÜÆÿÜÆÿÜÆÿÜÆ$ÿaÆ%ÿÜÆ&ÿaÆ'ÿÜÆ6ÿÆ7ÿ­Æ8ÿaÆ:ÿaÆðÿÜÆñÿÜÆ }ÿÆ ÿÆ €ÿ­Æ ÿÆ ‚ÿ­Æ ïÿaÆ þþøÆ ÿÿÆ /È<ÿÜÈmÿÜÈ}ÿÜÈŸÿÜÈ:ÿÜÈ ÿ&Î<ÿÜÎmÿÜÎ}ÿÜΟÿÜÎ:ÿÜÎ ÿ&Ð$ÿÜÐ9ÿÜÐ<ÿÐmÿÜÐ}ÿÜЂÿÜЃÿÜЄÿÜÐ…ÿÜІÿÜПÿÐÂÿÜÐÄÿÜÐÆÿÜÐ8ÿÐ:ÿÐôÿÐ ïÿÐ þÿÓÐ ÿÿÉÐ ÿDÒ$ÿÜÒ9ÿÜÒ<ÿÒmÿÜÒ}ÿÜÒ‚ÿÜÒƒÿÜÒ„ÿÜÒ…ÿÜÒ†ÿÜÒŸÿÒ:ÿÒ þÿÓÒ ÿÿÉÒ ÿDÝ[ÿÜà7ÿ·à<ÿšàmÿÜà}ÿÜàŸÿšà&ÿ·à:ÿšà þÿÓà ÿÿÓà ÿÉûÿÜû$/û2ÿ·û7þæû8ÿšû9ÿû:ÿDû<þðûHÿÜûRÿÜûXÿÜû\ÿDû‚/ûƒ/û„/û…/û†/û”ÿ·û•ÿ·û–ÿ·û—ÿ·û˜ÿ·û›ÿšûœÿšûÿšûžÿšûŸþðûªÿÜû«ÿÜû¬ÿÜû­ÿÜû´ÿÜûµÿÜû¶ÿÜû·ÿÜû¸ÿÜû»ÿÜû¼ÿÜû½ÿÜû¾ÿÜû¿ÿDûÁÿDûÝÿÜû&þæû0ÿšû1ÿÜû:þðû þþaû ÿýæÿÿÜÿ$/ÿ2ÿ·ÿ7þæÿ8ÿšÿ9ÿÿ:ÿDÿ<þðÿHÿÜÿRÿÜÿXÿÜÿ\ÿDÿ‚/ÿƒ/ÿ„/ÿ…/ÿ†/ÿ”ÿ·ÿ•ÿ·ÿ–ÿ·ÿ—ÿ·ÿ˜ÿ·ÿ›ÿšÿœÿšÿÿšÿžÿšÿŸþðÿªÿÜÿ«ÿÜÿ¬ÿÜÿ­ÿÜÿ´ÿÜÿµÿÜÿ¶ÿÜÿ·ÿÜÿ¸ÿÜÿ»ÿÜÿ¼ÿÜÿ½ÿÜÿ¾ÿÜÿ¿ÿDÿÁÿDÿÝÿÜÿ&þæÿ0ÿšÿ1ÿÜÿ:þðÿ þþaÿ ÿýæOÿ? þÿk ÿÿ ÿ¤ÿ­ÿ·ÿÁ$ÿ­&ÿš7ÿk9ÿ:ÿ­<ÿ}DÿÓHÿ¤Rÿ¤Xÿ¤\ÿmÿ}ÿÜ‚ÿ­ƒÿ­„ÿ­…ÿ­†ÿ­‰ÿšŸÿ}¢ÿÓ£ÿÓ¤ÿÓ¥ÿÓ¦ÿÓ§ÿÓªÿ¤«ÿ¤¬ÿ¤­ÿ¤´ÿ¤µÿ¤¶ÿ¤·ÿ¤¸ÿ¤»ÿ¤¼ÿ¤½ÿ¤¾ÿ¤¿ÿÁÿÈÿšÎÿšÝÿ¤&ÿk1ÿ¤:ÿ} þÿk ÿÿ} ÿÜÿ}ÿDÿÜFÿÓGÿÜHÿÓJÿÜKÿÜPÿÜQÿÜRÿÓTÿÜUÿÜ[ÿÉmÿ·©ÿÓªÿÓ«ÿÓ¬ÿÓ­ÿÓ³ÿÜ´ÿÓµÿÓ¶ÿÓ·ÿÓ¸ÿÓÉÿÓÏÿÓÑHÝÿÓáÿÜ ÿÜÿÜÿÜ ÿV þÉÿ­ÿ·ÿÁ$ÿ­&ÿš7ÿk9ÿ:ÿ­<ÿ}DÿÓHÿ¤Rÿ¤Xÿ¤\ÿmÿ}ÿÜ‚ÿ­ƒÿ­„ÿ­…ÿ­†ÿ­‰ÿšŸÿ}¢ÿÓ£ÿÓ¤ÿÓ¥ÿÓ¦ÿÓ§ÿÓªÿ¤«ÿ¤¬ÿ¤­ÿ¤´ÿ¤µÿ¤¶ÿ¤·ÿ¤¸ÿ¤»ÿ¤¼ÿ¤½ÿ¤¾ÿ¤¿ÿÁÿÈÿšÎÿšÝÿ¤&ÿk1ÿ¤:ÿ} þÿk ÿÿ} ÿÜÿ}ÿDÿÜFÿÓGÿÜHÿÓJÿÜKÿÜPÿÜQÿÜRÿÓTÿÜUÿÜ[ÿÉmÿ·©ÿÓªÿÓ«ÿÓ¬ÿÓ­ÿÓ³ÿÜ´ÿÓµÿÓ¶ÿÓ·ÿÓ¸ÿÓÉÿÓÏÿÓÑÿÜÝÿÓáÿÜ ÿÜÿÜÿÜ ÿV þÉ $& ‚& ƒ& „& …& †&"$&"‚&"ƒ&"„&"…&"†&&ÿD&ÿ &ÿ&$ÿa&&ÿˆ&7ÿÜ&Dþ­&Fþ¤&Hþ¤&LÿÁ&Rþ¤&UþÓ&Vþ­&XþÉ&Zþ­&\þÁ&mÿD&}ÿ&‚ÿa&ƒÿa&„ÿa&…ÿa&†ÿa&‰ÿˆ&¢þ­&£þ­&¤þ­&¥þ­&¦þ­&§þ­&©þ¤&ªþ¤&«þ¤&¬þ¤&­þ¤&´þ¤&µþ¤&¶þ¤&·þ¤&¸þ¤&»þÉ&¼þÉ&½þÉ&¾þÉ&¿þÁ&ÁþÁ&Èÿˆ&Éþ¤&Îÿˆ&Ïþ¤&Ýþ¤&þÓ&þÓ&!þ­&#þ­&&ÿÜ&1þÉ& ÿÿÓ& þø0=ÿÜ0?ÿÜ:ÿ :þa:þð:$ÿa:&ÿ:2ÿ:Dþæ:Hþð:Lÿ·:Rþð:Xÿ:mÿ:}ÿk:‚ÿa:ƒÿa:„ÿa:…ÿa:†ÿa:‰ÿ:”ÿ:•ÿ:–ÿ:—ÿ:˜ÿ:¢þæ:£þæ:¤þæ:¥þæ:¦þæ:§þæ:ªþð:«þð:¬þð:­þð:´þð:µþð:¶þð:·þð:¸þð:»ÿ:¼ÿ:½ÿ:¾ÿ:Èÿ:Îÿ:Ýþð:1ÿ: þÿ: ÿÿÜ: þø?ÿÜ? þÿÜ? ÿÿÜ? ÿÜ ò$ÿÓ ò%ÿ· ò*K ò-r ò29 ò4K ò7ÿD ò9ÿˆ ò:ÿ­ ò;ÿš ò<ÿ òR& òYÿÉ ò\ÿÜ ò‚ÿÓ òƒÿÓ ò„ÿÓ ò…ÿÓ ò†ÿÓ ò”9 ò•9 ò–9 ò—9 ò˜9 òŸÿ ò´& òµ& ò¶& ò·& ò¸& ò¿ÿÜ òÁÿÜ òàK ò&ÿD ò:ÿ þ$þø þ%ÿÁ þ&ÿ· þ'ÿÁ þ)ÿÁ þ*ÿ· þ+ÿÁ þ-ÿÁ þ.ÿÁ þ/ÿÁ þ2ÿ· þ3ÿÁ þ4ÿ· þ5ÿÁ þ;ÿˆ þ=ÿÜ þIÿ· þQÿ þRÿk þUÿ þYÿ· þZÿ· þ\ÿ· þ‚þø þƒþø þ„þø þ…þø þ†þø þˆþ} þ‰ÿ· þ”ÿ· þ•ÿ· þ–ÿ· þ—ÿ· þ˜ÿ· þ ÿÁ þ¡ÿÁ þ²ÿ· þ³ÿ þ´ÿk þµÿk þ¶ÿk þ·ÿk þ¸ÿk þ¿ÿ· þÁÿ· þÈÿ· þÎÿ· þÐÿÁ þàÿ· þûÿÁ þÿÿÁ þ ÿ þÿÁ þÿ þÿÁ þÿ þ?ÿÜ þÿÁ $& %ÿ· &ÿ 'ÿ· )ÿ· *ÿ· +ÿ· -/ .ÿ· /ÿ· 2ÿ 3ÿ· 4ÿ 5ÿ· 7þæ 9þˆ :ÿ ;ÿ· <þˆ IÿÜ Qÿ· Rÿ· Uÿ· Yÿ Zÿ< \ÿ ‚& ƒ& „& …& †& ˆ& ‰ÿ ”ÿ •ÿ –ÿ —ÿ ˜ÿ Ÿþˆ  ÿ· ¡ÿ· ²ÿ· ³ÿ· ´ÿ· µÿ· ¶ÿ· ·ÿ· ¸ÿ· ¿ÿ Áÿ Èÿ Îÿ Ðÿ· àÿ· ûÿ· ÿÿ·  ÿ· ÿ· ÿ· ÿ· ÿ· &þæ :þˆ ÿ·ÿDÿ ÿ$ÿa&ÿˆ7ÿÜDþ­Fþ¤Hþ¤LÿÁRþ¤UþÓVþ­XþÉZþ­\þÁmÿD}ÿ‚ÿaƒÿa„ÿa…ÿa†ÿa‰ÿˆ¢ÿ£þ­¤ÿ¥ÿ¦ÿ§ÿ©þ¤ªþà«þ¤¬þà­þà´þôµþ¤¶þô·þô¸þô»þç¼þɽþç¾þç¿þÁÁþÁÈÿˆÉþ¤ÎÿˆÏþ¤Ýþ¤þÓþÓ!þ­#þ­&ÿÜ1þÉ ÿÿÓ þøÿ)$ÿÜ&ÿ2ÿ7ÿa8ÿÉ:ÿ·<ÿ·DÿÜHÿšRÿšXÿš\ÿkmÿ}‚ÿ܃ÿÜ„ÿÜ…ÿ܆ÿ܉ÿ”ÿ•ÿ–ÿ—ÿ˜ÿ›ÿÉœÿÉÿÉžÿÉŸÿ·¢ÿÜ£ÿܤÿÜ¥ÿܦÿܧÿܪÿš«ÿš¬ÿš­ÿš´ÿšµÿš¶ÿš·ÿš¸ÿš»ÿš¼ÿš½ÿš¾ÿš¿ÿkÁÿkÈÿÎÿÝÿš&ÿa0ÿÉ1ÿš:ÿ· þÿÁ ÿÿÁDÿÜHÿ·Rÿ·XÿÁ\ÿ·¢ÿÜ£ÿܤÿÜ¥ÿܦÿܧÿܪÿ·«ÿ·¬ÿ·­ÿ·´ÿ·µÿ·¶ÿ··ÿ·¸ÿ·»ÿÁ¼ÿÁ½ÿÁ¾ÿÁ¿ÿ·Áÿ·Ýÿ·1ÿÁOgÿØPgÿ±Qgÿ£RgÿœSgÿØUgÿØVgÿ±Wgÿ£Xgÿ±YgÿØ[gÿØ\gÿ±]gÿ£^gÿ±_gÿØagÿØbgÿœcgÿ£dgÿ±egÿØDDDD¨ìDlÔ(˜ðŒà  D l ¸ < ¬ ¬ ” PètH\¬$hà¸84ä|ü\°X´ül”ØÔ|ˆT h!`!Ð"T#4$ð%”&X''x'Ä((\(ˆ(Ø**œ+4+Ì, -8..x.È/D040p141¬2P2ð345`5Ü6`7„9¨;,<ø=Ä> >Ð?¼@@@@@ÔA BXCpD”DÜF$FÜHHÜI¨IàJ KXK¤LLŒM,MèN8NìOHOtOÔP,P´Q„Q¤QÄQäRÜRôS S8ShS˜TØU°UÈUàUøVV@VXVpV”V¸W„W´WÌWäXXDXtY<ZtZŒZ¤ZÔ[ [$[¬\Ô\ø]]<]h] ]à_œ_´_Ì_ä``,`D`\`€`¤bTblb„bœb¼bèccpdädüee4ede|ffLfxf fÌfìggg4gLgpgˆg g¸gÜgôh h4hDiii<i`i„iœi´iÌiäjj4jXj|j”j¬jÐjèkkkHkŒll¨lÌlðmm8m\m€m˜m°màn,nPntn˜n¼nÔnìoÜoôp,pDphp€p¤p¼pðqlqür rDr\rtr¤rÐrès€ttHtht”t´tÌtäu„v¬vÄvÜvôw w0wXwpwˆw°wÔwìxx,xTxlx„x°xÔyXyôz zDztz˜zÄzè{{${<{T{l{„{¨{Ì{ð||4|L|d|||¤|¼|ä}<~~Ð~à”€ €ÈX‚‚Ô‚äƒxƒô„œ…t…І€‡8‡¸ˆp‰<ŠP‹ ‹|‹ìŒ¨¼ŽÄ”¤‘H‘`‘x’ ’Ì“d”$”à•´–ü— —¨˜@˜Ð™l™øšš(šÔ›`œìžô  à¡°¢À£,£ ¤4¤À¥4¥È¦¦ ¦ ¦°¦È¦à¦ø§§(§@§X§p§ˆ§¨§È§ð¨¨0¨P¨p¨”¨¬¨Ä¨Ü¨ô© ©$©<©T©d©|©”©¬©Ä©Ü©ôªÈ«¼«è¬¬¬\¬t¬Œ¬¤¬¼¬Ô¬ì­­,­D­\­t­Œ®$®¼®Ô®ì¯¯¯4¯L¯d¯|¯”¯¬¯Ä¯Ü¯ô° °$°<°T°l°„°œ°´°Ì°ä°ü±±,±D±\±t±Œ±¤±¼±Ô±ì²²²¨³<³T³˜´ ´°µ¼¶ ·Œ¸„¸œ¸´¸Ì¸ä¸ü¹¹,¹D¹\¹t¹Œ¹¤¹¼¹Ôº(º¬»»x¼X½<½¬¾D¾Ô¿@¿”ÀLÀ¤Á(Á°ÂŒÃLÃ\ÃÄÄpŠŨÆhÇ$ÈLÈØÉ(ɈʬËDËÜÌ”ÍÍüμÏlÐPÐôÒÒ$Ò4ÓPÔÔ¤ÕˆÖ@ÖÜ×ÐØÄÙ@ÙØÚ„ÚøÛÛ\ÜÜÜèÞÞàß´à¤áLáàâˆããÈäxäˆäðåXåäæXæäç@çœè°éTê`êÔë€ëàìtìèíhî îÄïTïäò ò˜óóðõö$ö´÷H÷Üøtùùœù¬ú|û<ûLûÜüüPýýÄþ€ÿÿØ”8Ä”( lÐ@Ä`ÔdÄ$|ø d œ à ð   ( ` È 0 ¸ D l ” ø l È$Td€ Ðä ŒÜð(Lx” ˆôT€¸ì8`ø0@tÀL€”¬¼ÐœøP¸ÌàôLÀ4H\Äð |˜ä 4XtˆœÀàtÄè 8T„´ÌàLp„˜Àä , h ¤ ¸ ì!!!(!<!˜!´!Ð!ð""\"€"¨"ð#$#„# #´#È#Ü#ì$$$8$`$ˆ$¨%$%˜%°%è&&&P&h&|&¼&Ð'4'H'\'x'”(((D(T(d(”(Ä(ô)$)4)D)x)ˆ) )¸)È**H*`*p*Œ*¨*Ä*Ü*ø++(+8+H+€+ì+ü, ,,Ì,Ü,ì-P-`-p-Ð-à-ð..|.Œ.œ/\/l00°0Ô0ø11(1@1X1p2À3\3Ü4À5646°7x7È8H8Ì8Ü9l:(:8:´;H;ô<ˆ<è=t>4?@?Ô@h@€@˜@°@È@àA AðB˜CPClC„DLDüE¨F`G G°HLH\I IhIØJPJ¬KÄLœM0M¼NpOXOÐP@PôQ¤R8RÐS@S¬THUUU U0U V VV,V<W W˜XX(X@XXXpYYœY´Z`ZpZ€ZZ [8[È\8\P\h\€\Ø\è]h]x]°^<^L_@_ø`¤`äaxaØaèaøbbPb`bpb€cc¸cÈd d|dØeDeÄeÜfPfüg¼hXhhi0iÌjjŒjœkŒlPlÀmmmðnxnÐnào(o8oHoŒoœp„p”pìqhqÄr0r¬rÄs4sØt|u u$uÄvhv€w$w4wDwTwdxx”y$y<yTylyÄzœz¬{L{à|p|à}$}d}À~ä€`€ØÄ‚ ƒƒhƒxƒˆƒÔ„$„<„T„ø…|†t‡`‡€‡ ‡¸‡Ðˆl‰‰P‰èŠŠDŠlЬ‹ðŒ¬ŒÄŒÜxŽŽx@„äDБ`‘Ä’$’<’T’˜’Ü“(“p“¼””¨•H•¸–$–ˆ–è—€˜™ ™èššštšÌšÜ›x›ÀœœLœ”tèžtžÄŸŸpŸ€ \¡X¡ô¢Œ¢œ¢´¢Ì£(£Œ£Ø¤$¤œ¥¥P¥Œ¦¦”¦à§,§<§h§ˆ§¸§ð¨¨¨4¨X¨h¨x¨¨¨¨À¨Ø¨ð©©©(©@©X©p©ˆ©¸©ä©ôªªª4ªLªdª|ª”ª¬ªÄªÜªô« «$«p«¼«Ô«ì¬x­­d­Ä®®d®Ü¯X°(°ô±Ô²¸³l´(´Ìµlµ|¶¶ ·(·¬¸4¸D¸T¸Ô¹T¹¸º º€ºø»d»ü¼ ¼¼,¼<¼¼Ü½ˆ¾8¾à¿Œ¿¼¿ìÀdÀ¼Á,Á€ÁØÂPÂ|ÂÌÃpÃÜÄ(ÄLĬÅ`ŬÆÆÈÇǘÇìȈÈÜÉdɰÊ Ê|Ë(Ë€ËËäÌÌÜÍ”ͼÎ<ÎÄÎÔÏtϬÏÐÏìÐ4ÐHÐÀÐàÑ\ѨÒ$ÒlÒÀÓHÓtÓ¸Ô`ÔÔÕÕ8Õ´Ö@Ö„Ö”×X× ØPØœØÈÙٜ٬Ú<Ú¸ÛtÛàÛðÜ<ܰÜøÝÝ(Ý Þ$Þ4ÞÜß(ßLßtß´ßäà8àœàÄàìálá˜áÔáüâ âlâ˜âÄâàã ãDãpã˜ãàä0älåTåÐæpæÀç<çxçðè`é é`éÔê\êÀë4ììPì´ídíüî¨ïpððÌñXñØòðó˜ó°óÈóàôôXôøõ¨õèö4öTö°öà÷P÷À÷Ø÷ðøø ø8øTølø„øœø´øÌù4ùLù ù¸ùüúúÔúìû°ûÈü4üLüÌüäüüýý,ýèþHþÔþìÿTÿÔ€˜ÄdŒ¨4PÌXl€ 4P€ØTØ@ˆØ( Ô8lÐ € œ ð   8 X p ˆ   ¸ Ð è   0 H ` x  ¨ È à ø  ( @ X p ˆ   ¸ Ø ð   @ X x  ¨ À Ø”¬Ìäü,DØpˆ ¸Ðè0H`x¨Àà@XxPpˆ ¸Ðàø 0@P`à`ÄÔäôxÐd°ô4„à|¬(€¨ì4ä@Ð$xðpÌhÀ @ Œ ø!”!ì"x"¼#(#¨#ð$@$¤%\%ä&&X&€&Ü'H''ø( (`(¤(ä)()„)°*P++ä,Œ-4-è.Ä/00à1¤2d3 3¨4D55Ä6ˆ7L7À8Œ9L:,:Ô;œ|>˜?(?¤?¼@ @AAŒAÔBPB´C,CÈD\DtDøEœFFÄFìGtHH\HpH¼I I JJ¤K(KÌLŒLüNNlOTPdPÌQQhQÜR$RxRÜS@ShSÌT<T°UUŒUÔV$V€VÌW$W¨X,XlX°XðYTY”YüZhZÀ[0[x[À\\L\¼\ü]L]è^0^”__œ_ì`X`Ða<a€aàb€bècDc¬ddddäe0eœff°gg„gàh`h¼i,ixiôjlj¸k0k¤llxlÜmTmÔnLn¸oooðp plpØpðqqq„qœq´qÌr<rTrlr„rœr´rÌrärüss,sDs\stsŒs¤s¼sÔsìtt8tXt”tÐu uPu„uÌuävv,vPvhv€v˜v°vÀvØvèwwdw|w”w¬xx(x@xXxpxˆx x¸xÐxèyyy0yHy`yxyyôz$z4zLz¸zÐ{8{P{h{€{è|||0|H|`|x||¨|À|Ø|ð}} }8}P}h}Ä}Ü}ô~ ~$~ ~¸4LÌäü€|€”€¬€Ä€Ü€ô $<Tl„œ´Ìäü‚t‚È‚à‚øƒƒ(ƒ|ƒ”ƒì„„\„t„Œ„ä„ü……,…D…\…t…Œ…¤…¼…ԅ솆†4†L†d†¼†ô‡,‡D‡|‡”‡Ì‡ä‡üˆ ˆ$ˆ<ˆTˆlˆ„ˆœˆ´ˆÌˆäˆü‰‰,‰D‰\‰t‰Œ‰ÈŠ(ŠHŠÄŠÜ‹\‹t‹ìŒŒŒ”Œ¬ŒÄŒÜŒô $<T¤äŽ8ŽŒޤŽød|”è0H`x¨ÀØð‘‘ ‘8‘P‘ˆ‘Ä’’0’ˆ’ ’ô“ “$“|“”“¬“ēܓô” ”$”<”T”l”„”œ”´”Ì”ä”ü•L•Ж–\–´–Ì—H—`—à—ø˜˜(˜@˜X˜p˜ˆ˜ ˜¸˜Ð˜è™™™0™H™¼šš,šˆš šü››,›ˆ› ›¸›Ð›èœœœ0œHœ`œxœœ¨œÀœØœðhx´ž žŒžðŸŸlŸ„Ÿì  l Ô ì¡P¡h¡€¡ì¢(¢Ü¢ô£¨£À¤x¤¥D¥\¥t¥Œ¥ø¦t¦ð§l§è¨¨¨”¨¬©,©D©\©t©ìªPª¸ªÐ«4«L«°«È¬(¬8¬H¬`¬x¬¬¨¬À¬Ø¬ð­­ˆ®®Œ¯¯,¯D¯\¯t¯Œ¯¤¯¼°0°Ü±\±t±ð²²ˆ² ²ä³ ³\³t³°³È´´´X´Ü´ìµ\µŒµì¶$¶<¶T¶l¶„¶œ¶´¶Ì¶ä··(·X·”·Ø¸(¸P¸€¸¼¹¹P¹„¹Ðº4º°»D»t»¸¼¼|¼ü½D½œ½Ô¾l¿D¿l¿ ¿ÔÀ À\Á8Á¤Á´ÁüÂT„ÃÃ8ÃtÄüÃÌÃÜÃìÃüÄTĬÅ<ÅøÆ0ÆhƬÇÇŒÇœÇØÈÈxÈìÈüÉ ÉÉlɌɜÉÄÉÔÊ0Ê@ÊtÊÀË<ËŒ˼ËìÌ\ÌŒ̨ÌØÍ Í,ÍdÍ”ÍÄÎ$ÎàÏ,ϘÏÀÐÐ<мÑDѬÒ„ÒèÓPÓÄÔlÕÕÖ$ÖHÖ|×׬Ø0ؘØÔÙ ÙpÙ°ÙüÚHÚÄÚìÛLÛ„Ü ܈ÜàÜôÝÝÝ0ÝDÝXÝ´ÝÈÝÜÞ\ÞlÞ¬ß8ßtßÜà<àÀáPáàâ$âhâðã<ãtã¤ãÐä ädä˜äØäøåæ ælæÐççpèè¨èøéPé¸ê0êtêØëë0ë|ëØìDì°ìÐìôíí8ídí”í¬íÄíÜíôî î$î<îTîlî„îœî´îÌîäîüïï,ïDï\ïtïŒï¤ï¼ïÔïìððð4ðTðtðŒð¤ð¼ðÔðìñññ4ñLñdñ|ñ”ñ¬ñÄñÜñôò ò$ò<òTòlò„òœò´òÌòäóóó4óLódó|ó”ó¬óÄóÜóôô ô$ô<ôTôlô„ôœô´ôÌôäôüõõ4õLõdõ|õ”õ¬õÄõÜõôö ö$ö<öTölö„öœö´öÌöäöü÷÷4÷T÷l÷„÷œ÷´÷Ì÷ä÷üøø,øDø\øtøŒø¤ø¼øÔøìùùù4ùLùdù|ù”ù¬ùÄùÜùôú ú$ú<úTúlú„úœú´úÌúäúüûû,ûDû\ûtûŒû¤û¼ûÔûìüüü4üLüdü´üüý”ý¤ý¼ýÔýìþþþ4þLþdþ|þ”þ¬þÄþÜþôÿ ÿ$ÿ<ÿTÿlÿ„ÿœÿ´ÿÌÿäÿü,D\tŒ¤¼Ôì4Ll„œ´Ìäü,D\tŒ¤¼Ôì$<Tl„œ´Ìäü,D\tŒ¤¼Ôì4Ld|”¬ÄÜô $PŒ¤¼Ôì4Ld|˜°Ìè0H`x¨Äàü  0 L d | ” ¬ Ä Ü ô  ( D ` x ” ° Ì è   0 H ` x  ¨ Ä à ü  0 L h „ œ ´ Ì ä ü  , D ` x ” ° È à ø(@XpŒ¤ÀÜô $<Tl„œ´Ðì <XtŒœ´ÄÜì,<Td|Œ¤¼Ôì4Ld|”¬ÄÜô $<Tl„œ´Ìäü,D\tŒ¤¼Ôì4Ld|”¬ÄÜô $<Tl„œ´Ìäü $4D´ÄÜô $<Tp€œ¬Äàø(@Xh€˜°Èäô(@Xpˆ˜°Èàø(DTpˆ˜¨ÀØð <Lhx                  8Ht Ìô $`œÔøT°  @ ˜!!\!x! !à"4"L"L"L"L"L"L"L"L"L#Ø$è%% %@%\%t%”%¸&(&œ&Ì&è'd'x'Ø(8(d(ˆ(¤(ì))L)d)|)˜**<*l*œ*°*à*ø++8+˜+¬,,4,\,œ,è- -H-¬-Ü..............l.°/¼0 0°0Ø1ˆ22H2d2Œ2Ä33t3ˆ3œ3°3Ä3Ø3ì444(4<4P4d4x4Œ4 4´4È4Ü4ð555,5@5T5h5|55¤66È7X7˜88„99ì:¼;h;Ì;ä=˜=à>8?Ä@`@øAŒAøB˜C(C\CÜD@D DÄDäE E4ElE°EèF¨G€GøHI8IÔJlJ|JJ¨KèLØM(M„MäNO$PP„QQDSìT”UHU¸VXWpXlYZ4ZÜ[|[Ü\h\¼\ü]h]x]ˆ^|^°^À^Ð_È`ŒaabXc8cdd¨düe f0f¼g4g|gðhtii|i¬iðjDj´jìk$kPkÔl„m$m\mÄn\n¬nÌnìoo4oToto”o´oÔoôpp4pTptp”p¬p¼pÔpôq qq4qTq|q”q¤q¼qÜqìqür rr,rDrdr|rŒr¤rÄrìsss,sLs\sls|sŒtuŒvlv|vŒvøwwÈxxy(yØzø||L|||¬|Ü}(}t~~Ä\¨ô€<€ˆ€ÄÄ‚‚T‚Ôƒ`„$„è…ü†\†¤†Ü‡‡L‡„‡¼‡ôˆxˆø‰4‰ ŠHŠð‹`‹Ð‹øŒ Œ”(Lh„ èŽ0ŽxŽÀŽÜŽø`àHˆÈ‘‘H‘¤’’@’€’À““@“€“Ü”8””è•0•x•Ä––L–ˆ–Ì——P——ô˜H˜¨™™t™ôšHšŒšÐ›,œœ$œ„œÈlÄž žžÄžøŸHŸ„ X ð¡$¡Œ¢L¢°¢à£D£è¤<¤ ¥D¥˜¥À¦¦H¦à§ §H§Ü§ì¨¨L¨`¨p¨Ð¨è©©˜ªPªpª”«@«ì¬¬t¬œ­`­Œ­´­ô®4®„®œ®¼¯ˆ°À²h³³Ð´˜´¼´à´üµ(µ@µtµ¤µÄ¶$¶„··H·¨¸¸t¸Ü¹\¹Ðºdºô»è¼ˆ½8¾ ¾”¾ì¿¨ÀÀ4ÀTÀtÀ”À¸ÀØÁ4Á ÁèÂ,Âl¸ÂüÃÜÄ`ÄìÅxÅÐÆ0ÆœÇ,ǸÈÈ@ȨÉ ÉTɘÊ ÊŒÊàË4Ë Ì ÌŒÍ͸ÎlΰÎøÏ„Ð ÐHЀÐÔÑ$Ñ´Ò@Ò°Ó ÓdÓ¨ÔÔ€ÔÔÕ$Õ Ö ÖŒÖø×X×p×ÐØØT؈ؼØäÙÙÔÚˆÛXÜÜÈݰÞ”ßTààXà”àøá0áláá¸áÜââ0â`ââÐã ãPã¬ääläðåxå¨åÔæ æDæ°ççlç°çÔèè@ètèÈèøé$éPé´êêHêtê¨ëëXë˜ëØìì4ì˜ìÐííŒîîˆïï\ïÀïøð,ð”ðôñLñ ñØòòdò¸óLóàôHô°ôüõHõÀö8öÀ÷H÷ ÷øøløÜùù ùDùhùÜúDúœú´û(ûˆûüühüÜýDý þþxþ¬ÿ$ÿPÿˆÿ¸ÿäÿüt”´ÔôDl”´(LlŒ¬\¨àL¬ d Ð D T d t „ ´  D | ˜ Ð  $ \ | ˜ ¼ à üP¨àü4ŒÀÜ0\€ôŒ °¼ ˜"”$ü'h'„' '¼'Ø( (D(|(¸(ð)0)x)Ä)è* *0*T*x*œ*À*ä++(+L+p++°+Ð+ô,,D,p,œ,Ä,ô- -H-p-˜-Ä-ð..H.t.œ.Ä.ð//D/l/˜/Ä/ì00<0h00¸0ä1181h1œ1Ð2282l2 2Ø33H3€3´3è44P4„4¨4Ô55,5T5|5¨5Ô6646`6”6À6ì7 7L7x7¬7Ü88T8„8¸8ø9,9\9œ9Ð::@:ˆ:Ì;(;X;ˆ;¸;è<<$ >(>D>`>|>˜>´>Ð>ì??$?@?\?x?”?¨@\CpDD,D@D\DxD”D¸DàEE(EDElEE¬EØF,FDFœFüH8HÀIHKK$KPKlK˜K´KàLL4LPLxL”L¼LØMM MLMhM”M°MÜMøN$N@NlNˆN´NÐNüOOPO”P$PxPàQØRŒSHS¬TT\T¸UU|UÌUôVVXVÐW$WxW¤WÐWüX,XpX´XÐXìYYYdYY¼YäZ ZHZŒZ¸Zà[L[Œ[Ì\ \L\Ì]L]Ì^L^t^œ^Ä^ð_ _8_T_|`l`ØajtmXmmônDn¨o<ppÔq8qÜt`w@wxwðxdx¼z{È||D}8~ ~¤<€€ÈŒ‚P…؆T‡x‰Œ€ˆüŽ`Žät¼‘ì’ˆ““Гð””0”P”p””°”ЖD— —ü˜¨™ÄšXšè› œœ\¸žLžøŸ`ŸÔ l Ð¡¢p£@£´¤X¤´¥P¦<¦¼§äªª¬«È­®$¯¸°°±0±ø²à³t³è´Œ´Ôµt¶<¶¶À·ä¸Ð¹¹l¹Ðº0º„ºÐ»d¼$½ ¿À Á0ÂlÃlÄÅÄÆ´LjÈ”ÉÌË$Ì(ÌÄÍ4ÍèÎÜÐÑÓPÓìÔ¬ÕÕ Õ¼ÕäÕüÖÖ,ÖDÖÄ×טØÙ<Ú`ÛÛ¤ÜHÝPß8áüã¼ää@äÄååðæØçÀèPé0êDë ëüìpì¸í0î4ï€ðÄññ„ñÜò8òóóhóÐô8ôàõÀöÔøDøÜúlûÐý\¨ ¬\ ´ Ì ¸ Ì ´< LŒXPÐ@„´”xÌLÐ0@¨4Ä„  ! !|!Ð"8"œ"ô#¸#ü$T$¤%%Ð'|)p*œ,Ì.,0¤5ø709€:D; ;à=d>ä@DA¤BðD\DÈE4EœFFhF„F F¼FüGHG`GxHTHìI¨JJŒK¬L”MMpM¬MèNN<NdNN¸NäOO<O PP€Q,RlRôT U VX`Yì[`\4]8^P_,`,aDbc<dTe„ff´g|hh¸i€iøjÐk˜l\lŒl¸lämm@mÌmônnpnÄnìooLolo¼p p8php°pøqLqœqèr8rrèsTsøtPt˜tðu|uüvˆwXwèyz<zÈ{({ˆ{Ä{ø|,|T|||”|¬}}X~~ÜØ€ˆ8‚X‚˜‚؃4ƒpƒ¬ƒø„D„È„È„Ü„ð… … …<…X…|……¬…ȅ솆,†P†|††¬†È†ì‡‡,‡P‡|‡˜‡¼‡àˆ ˆ0ˆ\ˆˆˆ¼ˆÐˆì‰‰,‰H‰l‰‰¼‰Ø‰üŠ ŠLŠpŠœŠÈŠü‹‹<‹`‹Œ‹°‹ÜŒŒ<Œ`ŒŒŒ¸ŒìL€¼Ð쎎,ŽHŽlŽ޼ŽØŽü LpœÈü<`Œ°Ü‘‘<‘`‘Œ‘¸‘ì’’L’€’¼’Ø’ü“ “L“p“œ“È“ü” ”L”x”¬”Ø• •@•|• •Ì•ø–,–X–Œ–À–ü—(—\——̘˜<˜x˜¼˜Ð˜ì™™,™H™l™™¼™Ø™üš šLšpšœšÈšü››<›`›Œ›°›Üœœ<œ`œŒœ¸œìL€¼Øüž žLžpžœžÈžüŸ ŸLŸxŸ¬ŸØ   @ |   Ì ø¡,¡X¡Œ¡À¡ü¢(¢\¢¢Ì££<£x£¼£Ø£ü¤ ¤L¤p¤œ¤È¤ü¥ ¥L¥x¥¬¥Ø¦ ¦@¦|¦ ¦Ì¦ø§,§X§Œ§À§ü¨(¨\¨¨Ì©©<©x©¼©àª ª8ªlª˜ªÌ««<«h«œ«Ð¬ ¬@¬|¬¸¬ü­(­\­­Ì®®<®x®¼®ð¯,¯h¯¬¯è°,°p°¼±±T±œ±à²¬³t´Xµ8µ„µÀµü¶0¶d¶Œ¶À¶ô··\·´¸t¹Hº,ºTº¼»8»¤¼P¼ð½d½ô¾ˆ¿,¿°ÀHÀÄÁLÁÐÂ0 ¸ÂØÃÃLÃdÃ|ÔìÃÄÃÜĬÅxÅÈÆÆÜǘÇüÈXÈÜÉ\ÉìÊ|ÊØË<ˤÌÌDÌ€̘̰ÌôÍ<Í„ÍÔÎLÎÈÏ\ÏôÐxÐÀÑÑhÑÈÒÒpÒèÓ\Ô<ÕÕìÖ¼××Pט×àØ(ØpØÌØôÙÙDÙpÙœÙÈÙôÚ,ÚdÚ˜ÚÐÛÛ<ÛhÛ”ÛÀÛèÜÜHÜxܨÝTÝxÝ´ÝøÞ ÞLÞˆÞ¬Þèß0ßpßàà<áxâ(â„â”âäã$ãdã˜ãÌädä´äìåLå˜ææhæÈæðçç˜çäè`è”è¨èÔé€éØê@ê´ë(ëÄì ìtìðílí¨î îˆïïtïÔðð„ððñ8ñ¤òò´óóTó˜óìô<ôœôüõdõØöööð÷L÷¨÷øøDøÐùDú úðû˜ü@üøýPý`ýpý€ýþ|ÿÿÿð€PX¼$„L¸$€ä¬hx¸ÈH¤ D  ¸ œ ü T Ü ¨Œäô0°Àp4ˆt´0Hhˆ¨ÈØð 8Ph€˜°Èàø(@Xpˆ ¸Ðè0H`x¨ÀØð 8Ph€˜°Èàø(@Xpˆ ¸Ðè0H`x¨ÀØèø@P`„”¤Üìü ,<L\l|Œð 0l|Œœ ,<l|Œœ   ˆ ¤ È à ø!,!X!„!¬!¼!Ì!Ü!ì"È#x##¨$ $ˆ$Ø%`%À&&\&œ&à' '8'P'Ä(8(X(x**`*Ä*ü+<+´+Ä+ì,,<,d,Œ,´,Ü--,-P-p-”-¸-Ü-ü.(.T.€.¬.À//H/x/¨/ì0D0È1X1h1ø2$242˜3t3ü4¬55œ5ä6`6¼7L7°8H8X8h8°8ø9$9L9|9¨:0:´;l<t>Ü?8? ?ø@d@„@¤@üAPA`AˆAäB8BHB¨BäC0CÀDtDÔE0EœF F FøGH$HlH¸IPI`IŒIÔJJ,JxJ¤JÄJèK K0KPKdKxKŒK KÄKØKìLLL8LLL`LtLˆL¬LÀLÔLèMM,OØRˆU4WäX8X YY¼ZZˆ[ [Œ[à\D\ô]`]À^4^˜^ð_|_Ì`L`´adaÄbXbÀc4cœddpdäe\e°f(f˜ggˆgìh\hàitjjÐk$k„kôlLl°mmtmØnHn¸oohoÌpDpÄqTqÌrTrÌsPsàtXtàuduØvˆw,w¬xŒyLyÌzÄ{|8|Ô}„~L~d~˜~°~ühà€4€`€¨€äDl„œ¼Üô‚ ‚$‚<‚T‚l‚„‚ ‚¸‚Ђ샃ƒ4ƒLƒdƒ|ƒ”ƒ¬ƒÄƒÜƒô„ „$„<„T„l„„…… …8…P…h…€…˜…°…È…à…ø††(†@†X†p†ˆ† †¸†Ð†è‡‡‡0‡H‡`‡x‡‡¨‡À‡Ø‡ðˆˆ ˆ8ˆPˆhˆ€ˆ˜ˆ°ˆÈˆàˆø‰‰(‰@‰X‰p‰ˆ‰ ‰¸‰Ð‰èŠŠŠ0ŠHŠ`ŠxŠЍЏ‹d‹t‹„‹œ‹´‹Ì‹ä‹üŒŒ,ŒDŒ\ŒtŒŒŒ¤Œ´,D\tŒœŽ@ŽPŽ`ŽxŽލŽÀŽØŽð 8Ph€˜°ÈàP`pˆ                 Èð‘8‘€‘”‘¬‘À‘ô’’’4’H’`’t’Œ’ ’¸’Ì’ä’ô“ “$“<“T“l“„“œ“´“Ì“ä“ü””$”X”p”ˆ” ”¸”Д蕕•0•H•`•x••¨•À•ؕ𖖖¬——˜—°—È—à—ø˜˜l˜„˜œ˜¬™™™0™@šš¤›D›\›t›Œ›¤›´œÀØðžž ž0ž´Ÿ Ÿ¤Ÿ¼ŸÔŸì   œ ô¡„¡œ¡´¡Ì¡ä¡ü¢¢,¢D¢\¢t¢Œ¢¤¢´£€£ì¤t¤„¤ø¥,¥p¥€¦ ¦§ §8§P§h§€§¨¨Ä©T©d©øªª¬ªÄªÜªô« «$«<«T«l«„«œ«ð¬X¬X¬X¬X¬X¬X¬ä­ ­˜­Ä®®T®„®°®ì¯ˆ¯¤¯Ü°°D°t°Ð±`±¨±à²H² ²Ø³³,³p³ì´$´¤´èµ0µTµœµ¬µØµè¶¶T¶p¶Œ¶¨¶Ä¶à··0·\·„·¬·Ø¸¸(¸P¸x¸ ¸Ì¸ô¹¹H¹p¹˜¹À¹èºº<ºdºŒº¸ºà»»0»X»€»¬»Ô»ü¼(¼P¼x¼ ¼È¼ð½½D½l½˜½À½è¾¾8¾`¾Œ¾´¾Ü¿¿0¿X¿€¿¨¿Ð¿üÀ$ÀLÀxÀ ÀÈÀðÁÁ@ÁlÁ”Á¼ÁèÂÂ8Â`ˆ°ÂÜÃÃ,ÃXÀèÃÐÄĬÅÅXÅ”Æ Æ\ƨÆìÇÇxÈȰÈèÉ\ɘÊÊTÊœË@ËÜÌTÌðÍhÍÐΘÏ ÏDÏ ÏäÐ0ÐìÑ`ÑìÒˆÓ$ÓpÔ<Ô˜Õ ÕHÕ¨ÕüÖLÖÖ Ö°ÖÀÖÐÖàÖð××× ×0×@×P×`×p×€×× ×°×À×Ð×à×ðØØØ Ø0Ø@ØPØ`ØpØ€ØØ ذØÀØÐØàØðÙÙÙ Ù0Ù@ÙPÙ`ÙpÙ€Ù٠ٰÙÀÙÐÚ<Ú|Û Û ÛìÜ\ÜèÝ$Þތޜެ޼ÞÌÞÜÞìÞüß ßß,ß<ßLß\ßlß|ߌßœ߬ß¼ßÌßÜßìßüà àà,à<àLà\àlà|àŒàœà¬à¼àÌàÜàìàüá áá4áLââpâˆâôã(ã ã¸äHäXäpäüå å$å<åTålå„å”å¬åÄæ˜ççœç´è<èÌèäéêêêÄêÜêôë ë$ë<ëTëlë„ëÐì„ì°ìèídî ïðXñÔóˆôôÀõÀöüøxú4ü(üäýàÿ˜HDxt° 0 ì è$˜Ì@ü8´ h!à#œ%œ'Ø*T-01Ä3Ì68œ;`>hA˜AÄAüBxC4D0ElFèHœIIÔJÔLMŒOHQ<QøRôT0U¬WhYd[˜\”]Ð_Pa ceDg¸hìj`lnpTrÀutvìx¨z˜|ÔP‚ …†ÄˆÌ‹˜\“L–|–Ø—”˜p™lš,›œ0œÜžŸ$  È¡ ¢€£<£ô¤Ì¥Ä¦€§h¨|©$ªT«d¬P­­Ô®°¯h¯ø°¨±x²²È³°´0µ8¶ ¶ä·l¸¸Ì¹X¹Ôº¬»¤¼¼½”¾œ¿ÌÀ”ÁäÃÄ ÄðÅäÆàÇ´ÈXÊ`ÍHÏpÑÒÓÕ(ÖÖè×ìØÀÙüÛÛàÜÀÝÌÞ¬ßÔà¨áPââœã\äPååÀæ¸çŒè éxêPë(ëøìÄíÄîôïôñ(ò8ó óðôÐõÐ÷Ìø¸ùÌú ûìü°ý”þ”`  @¼œä h ØàX¨h(L´„,Èt¨H¨ä  ( L | ¬ Ð!!„!”!¤"d## $h$x$ˆ$ $¸%%(%H%h%€%˜%°%È%à%ø&&(&@&X&p&ˆ&¨&È&è''˜'ø(H(d(€(œ(¸(Ô(ð) )()D)`)|)˜)´)Ð)ì**$*@*\*x**¬*ä*ü+P+h+€+˜+°+Ð+ð,,l,|,Œ,œ,´,à-8-P-h-Œ-ä...0.H.`.x..¨.À.ø/8/p00 101˜22p2 2Ð2ü3L3¤3ð4<4ˆ4Ð5x6(6Ì7(7€7Ø8p99°: :p:Ì;(;Œ;è”? ?„?ð@T@øA¤BHB¬CC|DDœE(E|EØF,F¤G$GœHDHôIœJJlJÐKhL L¤LôMLMœNNˆNüO€PPŒPÜQ4Q„QÜR<R”SStSàT¤UpV4V¼WHWÐWäXX,XPXtX˜X¼XàYYpY¬YèZTZlZ„Z¤Z¼ZÔZì[[$[<[T[t[”[´[Ì[ä[ü\\<\\\t\Œ\¤\¼\Ô\ì]]]4]L]d]|]”]¬]Ä]ä^^$^<^T^l^„^œ^´^Ì^ä^ü_¨``œ`´`Ì`ä`üaa,aDa\ataŒa¤a¼aÔaìbbb4bLbdb|b”b¬bÄbÜbôc c$cDcdc„c¤cÄcäcüdd,d¼e´eÈeüf$fLfˆfØfðggàijÄkhl8mm8mhm´nnÄoœpˆp°qq rrÈspsèt€u$uÔvXvøw€xxœxüy\aT+h ™>˜2 ãù  : ` ƒ²  (Z4;b ;¯;Å 0 Ë ï þ " F m "Ž :Ä %: h:ø ;— ;»Copyright (c) 2003 by Bitstream, Inc. All Rights Reserved. Copyright (c) 2006 by Tavmjong Bah. All Rights Reserved. DejaVu changes are in public domain Copyright (c) 2003 by Bitstream, Inc. All Rights Reserved. Copyright (c) 2006 by Tavmjong Bah. All Rights Reserved. DejaVu changes are in public domain DejaVu SansDejaVu SansBookBookDejaVu SansDejaVu SansDejaVu SansDejaVu SansVersion 2.35Version 2.35DejaVuSansDejaVuSansDejaVu fonts teamDejaVu fonts teamhttp://dejavu.sourceforge.nethttp://dejavu.sourceforge.netFonts are (c) Bitstream (see below). DejaVu changes are in public domain. Glyphs imported from Arev fonts are (c) Tavmjung Bah (see below) Bitstream Vera Fonts Copyright ------------------------------ Copyright (c) 2003 by Bitstream, Inc. All Rights Reserved. Bitstream Vera is a trademark of Bitstream, Inc. Permission is hereby granted, free of charge, to any person obtaining a copy of the fonts accompanying this license ("Fonts") and associated documentation files (the "Font Software"), to reproduce and distribute the Font Software, including without limitation the rights to use, copy, merge, publish, distribute, and/or sell copies of the Font Software, and to permit persons to whom the Font Software is furnished to do so, subject to the following conditions: The above copyright and trademark notices and this permission notice shall be included in all copies of one or more of the Font Software typefaces. The Font Software may be modified, altered, or added to, and in particular the designs of glyphs or characters in the Fonts may be modified and additional glyphs or characters may be added to the Fonts, only if the fonts are renamed to names not containing either the words "Bitstream" or the word "Vera". This License becomes null and void to the extent applicable to Fonts or Font Software that has been modified and is distributed under the "Bitstream Vera" names. The Font Software may be sold as part of a larger software package but no copy of one or more of the Font Software typefaces may be sold by itself. THE FONT SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT OF COPYRIGHT, PATENT, TRADEMARK, OR OTHER RIGHT. IN NO EVENT SHALL BITSTREAM OR THE GNOME FOUNDATION BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, INCLUDING ANY GENERAL, SPECIAL, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL DAMAGES, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF THE USE OR INABILITY TO USE THE FONT SOFTWARE OR FROM OTHER DEALINGS IN THE FONT SOFTWARE. Except as contained in this notice, the names of Gnome, the Gnome Foundation, and Bitstream Inc., shall not be used in advertising or otherwise to promote the sale, use or other dealings in this Font Software without prior written authorization from the Gnome Foundation or Bitstream Inc., respectively. For further information, contact: fonts at gnome dot org. Arev Fonts Copyright ------------------------------ Copyright (c) 2006 by Tavmjong Bah. All Rights Reserved. Permission is hereby granted, free of charge, to any person obtaining a copy of the fonts accompanying this license ("Fonts") and associated documentation files (the "Font Software"), to reproduce and distribute the modifications to the Bitstream Vera Font Software, including without limitation the rights to use, copy, merge, publish, distribute, and/or sell copies of the Font Software, and to permit persons to whom the Font Software is furnished to do so, subject to the following conditions: The above copyright and trademark notices and this permission notice shall be included in all copies of one or more of the Font Software typefaces. The Font Software may be modified, altered, or added to, and in particular the designs of glyphs or characters in the Fonts may be modified and additional glyphs or characters may be added to the Fonts, only if the fonts are renamed to names not containing either the words "Tavmjong Bah" or the word "Arev". This License becomes null and void to the extent applicable to Fonts or Font Software that has been modified and is distributed under the "Tavmjong Bah Arev" names. The Font Software may be sold as part of a larger software package but no copy of one or more of the Font Software typefaces may be sold by itself. THE FONT SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT OF COPYRIGHT, PATENT, TRADEMARK, OR OTHER RIGHT. IN NO EVENT SHALL TAVMJONG BAH BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, INCLUDING ANY GENERAL, SPECIAL, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL DAMAGES, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF THE USE OR INABILITY TO USE THE FONT SOFTWARE OR FROM OTHER DEALINGS IN THE FONT SOFTWARE. Except as contained in this notice, the name of Tavmjong Bah shall not be used in advertising or otherwise to promote the sale, use or other dealings in this Font Software without prior written authorization from Tavmjong Bah. For further information, contact: tavmjong @ free . fr.Fonts are (c) Bitstream (see below). DejaVu changes are in public domain. Glyphs imported from Arev fonts are (c) Tavmjung Bah (see below) Bitstream Vera Fonts Copyright ------------------------------ Copyright (c) 2003 by Bitstream, Inc. All Rights Reserved. Bitstream Vera is a trademark of Bitstream, Inc. Permission is hereby granted, free of charge, to any person obtaining a copy of the fonts accompanying this license ("Fonts") and associated documentation files (the "Font Software"), to reproduce and distribute the Font Software, including without limitation the rights to use, copy, merge, publish, distribute, and/or sell copies of the Font Software, and to permit persons to whom the Font Software is furnished to do so, subject to the following conditions: The above copyright and trademark notices and this permission notice shall be included in all copies of one or more of the Font Software typefaces. The Font Software may be modified, altered, or added to, and in particular the designs of glyphs or characters in the Fonts may be modified and additional glyphs or characters may be added to the Fonts, only if the fonts are renamed to names not containing either the words "Bitstream" or the word "Vera". This License becomes null and void to the extent applicable to Fonts or Font Software that has been modified and is distributed under the "Bitstream Vera" names. The Font Software may be sold as part of a larger software package but no copy of one or more of the Font Software typefaces may be sold by itself. THE FONT SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT OF COPYRIGHT, PATENT, TRADEMARK, OR OTHER RIGHT. IN NO EVENT SHALL BITSTREAM OR THE GNOME FOUNDATION BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, INCLUDING ANY GENERAL, SPECIAL, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL DAMAGES, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF THE USE OR INABILITY TO USE THE FONT SOFTWARE OR FROM OTHER DEALINGS IN THE FONT SOFTWARE. Except as contained in this notice, the names of Gnome, the Gnome Foundation, and Bitstream Inc., shall not be used in advertising or otherwise to promote the sale, use or other dealings in this Font Software without prior written authorization from the Gnome Foundation or Bitstream Inc., respectively. For further information, contact: fonts at gnome dot org. Arev Fonts Copyright ------------------------------ Copyright (c) 2006 by Tavmjong Bah. All Rights Reserved. Permission is hereby granted, free of charge, to any person obtaining a copy of the fonts accompanying this license ("Fonts") and associated documentation files (the "Font Software"), to reproduce and distribute the modifications to the Bitstream Vera Font Software, including without limitation the rights to use, copy, merge, publish, distribute, and/or sell copies of the Font Software, and to permit persons to whom the Font Software is furnished to do so, subject to the following conditions: The above copyright and trademark notices and this permission notice shall be included in all copies of one or more of the Font Software typefaces. The Font Software may be modified, altered, or added to, and in particular the designs of glyphs or characters in the Fonts may be modified and additional glyphs or characters may be added to the Fonts, only if the fonts are renamed to names not containing either the words "Tavmjong Bah" or the word "Arev". This License becomes null and void to the extent applicable to Fonts or Font Software that has been modified and is distributed under the "Tavmjong Bah Arev" names. The Font Software may be sold as part of a larger software package but no copy of one or more of the Font Software typefaces may be sold by itself. THE FONT SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT OF COPYRIGHT, PATENT, TRADEMARK, OR OTHER RIGHT. IN NO EVENT SHALL TAVMJONG BAH BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, INCLUDING ANY GENERAL, SPECIAL, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL DAMAGES, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF THE USE OR INABILITY TO USE THE FONT SOFTWARE OR FROM OTHER DEALINGS IN THE FONT SOFTWARE. Except as contained in this notice, the name of Tavmjong Bah shall not be used in advertising or otherwise to promote the sale, use or other dealings in this Font Software without prior written authorization from Tavmjong Bah. For further information, contact: tavmjong @ free . fr.http://dejavu.sourceforge.net/wiki/index.php/Licensehttp://dejavu.sourceforge.net/wiki/index.php/LicenseDejaVu SansDejaVu SansBookBookÿ~Za  !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`a¬£„…½–膎‹©¤ŠÚƒ“òó—ˆÃÞñžªõôö¢­ÉÇ®bcdËeÈÊÏÌÍÎéfÓÐѯgð‘ÖÔÕhëí‰jikmln oqprsutvwêxzy{}|¸¡~€ìîºýþ    ÿ øù !"#$%&'()*+ú×,-./0123456789:âã;<=>?@ABCDEFGHI°±JKLMNOPQRSûüäåTUVWXYZ[\]^_`abcdefghi»jklmæçnopqrstuvwxyz{|}~€¦‚ƒ„…†‡ˆ‰Š‹ŒŽ‘’“”•–—˜™š›œžŸ ¡¢£¤¥¦§¨©ª«¬­®¯°±²³´µ¶·¸¹º»¼½¾¿ÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏÐÑÒÓÔÕÖרÙÚÛÜÝÞßàáâãäåæçèéêëìíîïðñòóôõö÷øùúûüýþÿ      !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~€‚ƒ„…†‡ˆ‰Š‹ŒŽ‘’“”•–—˜™š›œžŸ ¡¢£¤¥¦§¨©ª«¬­®¯°±²³Øá´µ¶·¸¹º»¼½¾¿ÀÁÂÃÛÜÝàÙßÄÅÆÇÈÉÊËÌÍÎÏÐÑÒÓÔÕÖרÙÚÛÜÝÞßàáâãäåæçèéêëìíîïðñòóôõö÷øùúûüýþÿ      !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`Ÿabcdefghijklmnopqrstuv›wxyz{|}~€‚ƒ„…†‡ˆ‰Š‹ŒŽ‘’“”•–—˜™š›œžŸ ¡¢£¤¥¦§¨©ª«¬­®¯°±²³´µ¶·¸¹º»¼½¾¿ÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏÐÑÒÓÔÕÖרÙÚÛÜÝÞßàáâãäåæçèéêëìíîïðñòóôõö÷øùúûüýþÿ      !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~€‚ƒ„…†‡ˆ‰Š‹ŒŽ‘’“”•–—˜™š›œžŸ ¡¢£¤¥¦§¨©ª«¬­®¯°±²³´µ¶·¸¹º»¼½¾¿ÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏÐÑÒÓÔÕÖרÙÚÛÜÝÞßàáâãäåæçèéêëìíîïðñòóôõö÷øùúûüýþÿ      !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~€‚ƒ„…†‡ˆ‰Š‹ŒŽ‘’“”•–—˜™š›œžŸ ¡¢£¤¥¦§¨©ª«¬­®¯°±²³´µ¶·¸¹º»¼½¾¿ÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏÐÑÒÓÔÕÖרÙÚÛÜÝÞßàáâãäåæçèéêëìíîïðñòóôõö÷øùúûüýþÿ      !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~€‚ƒ„…†‡ˆ‰Š‹ŒŽ‘’“”•–—˜™š›œžŸ ¡¢£¤¥¦§¨©ª«¬­®¯°±²³´µ¶·¸¹º»¼½¾¿ÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏÐÑÒÓÔÕÖרÙÚÛÜÝÞßàáâãäåæçèéêëìíîïðñòóôõö÷øùúûüýþÿ      !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~€‚ƒ„…†‡ˆ‰Š‹ŒŽ‘’“”•–—˜™š›œžŸ ¡¢£¤¥¦§¨©ª«¬­®¯°±²³´µ¶·¸¹º»¼½¾¿ÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏÐÑÒÓÔÕÖרÙÚÛÜÝÞßàáâãäåæçèéêëìíîïðñòóôõö÷øùúûüýþÿ      !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~€‚ƒ„…†‡ˆ‰Š‹ŒŽ‘’“”•–—˜™š›œžŸ ¡¢£¤¥¦§¨©ª«¬­®¯°±²³´µ¶·¸¹º»¼½¾¿ÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏÐÑÒÓÔÕÖרÙÚÛÜÝÞßàáâãäåæçèéêëìíîïðñòóôõö÷øùúûüýþÿ                           ! " # $ % & ' ( ) * + , - . / 0 1 2 3 4 5 6 7 8 9 : ; < = > ? @ A B C D E F G H I J K L M N O P Q R S T U V W X Y Z [ \ ] ^ _ ` a b c d e f g h i j k l m n o p q r s t u v w x y z { | } ~  € ‚ ƒ „ … † ‡ ˆ ‰ Š ‹ Œ Ž ‘ ’ “ ” • – — ˜ ™ š › œ ž Ÿ   ¡ ¢ £ ¤ ¥ ¦ § ¨ © ª « ¬ ­ ® ¯ ° ± ² ³ ´ µ ¶ · ¸ ¹ º » ¼ ½ ¾ ¿ À Á Â Ã Ä Å Æ Ç È É Ê Ë Ì Í Î Ï Ð Ñ Ò Ó Ô Õ Ö × Ø Ù Ú Û Ü Ý Þ ß à á â ã ä å æ ç è é ê ë ì í î ï ð ñ ò ó ô õ ö ÷ ø ù ú û ü ý þ ÿ                           ! " # $ % & ' ( ) * + , - . / 0 1 2 3 4 5 6 7 8 9 : ; < = > ? @ A B C D E F G H I J K L M N O P Q R S T U V W X Y Z [ \ ] ^ _ ` a b c d e f g h i j k l m n o p q r s t u v w x y z { | } ~  € ‚ ƒ „ … † ‡ ˆ ‰ Š ‹ Œ Ž ‘ ’ “ ” • – — ˜ ™ š › œ ž Ÿ   ¡ ¢ £ ¤ ¥ ¦ § ¨ © ª « ¬ ­ ® ¯ ° ± ² ³ ´ µ ¶ · ¸ ¹ º » ¼ ½ ¾ ¿ À Á Â Ã Ä Å Æ Ç È É Ê Ë Ì Í Î Ï Ð Ñ Ò Ó Ô Õ Ö × Ø Ù Ú Û Ü Ý Þ ß à á â ã ä å æ ç è é ê ë ì í î ï ð ñ ò ó ô õ ö ÷ ø ù ú û ü ý þ ÿ                 ²³   ¶·Ä ´µÅ ‚‡   «  ! " # $ % & 'Æ ( ) * + , - . /¾¿ 0 1 2 3 4 5 6 7 8¼ 9 : ; < = > ? @ A B C D E F G H I J K L M N O P Q R S T U V W X Y Z [ \ ] ^ _ ` a b c d e f g h i j k l m n o p q r s t u v w x y z { | } ~  € ‚ ƒ „ … † ‡ ˆ ‰ Š ‹÷ Œ Ž ‘ ’ “ ” • – — ˜ ™ š › œ ž Ÿ   ¡ ¢ £ ¤ ¥ ¦ § ¨ © ª « ¬ ­ ® ¯ ° ± ² ³ ´ µ ¶ · ¸ ¹ º » ¼ ½ ¾ ¿ À Á Â Ã Ä Å Æ Ç È ÉŒ Ê Ë Ì Í Î Ï Ð Ñ Ò Ó Ô Õ Ö × Ø Ù Ú Û Ü Ý Þ ß à á â ã ä å æ ç è é ê ë ì í î ï ð ñ ò ó ô õ ö ÷ ø ù ú û ü ý þ ÿ                           ! " # $ % & ' ( ) * + , - . / 0 1 2 3 4 5 6 7 8 9 : ; < = > ? @ A B C D E F G H I J K L M N O P Q R S T U V W X Y Z [ \ ] ^ _ ` a b c d e f g h i j k l m n o p q r s t u v w x y z { | } ~  € ‚ ƒ „ … † ‡ ˆ ‰ Š ‹ Œ Ž ‘ ’ “ ” • – — ˜ ™ š ›˜ œ ž¨ Ÿ   ¡ ¢ £ ¤ ¥ ¦š §™ï ¨ © ª « ¬ ­ ®¥ ¯ ° ±’ ² ³ ´ µ ¶ · ¸ ¹ º » ¼ ½œ ¾ ¿ À Á Â Ã Ä Å Æ Ç È É Ê Ë Ì Í Î Ï Ð Ñ Ò Ó Ô Õ Ö × Ø Ù§ Ú Û Ü Ý Þ ß à á â ã ä å æ ç è é ê ë ì í î ï ð ñ ò ó”• ô õ ö ÷ ø ù ú û ü ý þ ÿ                           ! " # $ % & ' ( ) * + , - . / 0 1 2 3 4 5 6 7 8 9 : ; < = > ? @ A B C D E F G H I J K L M N O P Q R S T U V W X Y Z [ \ ] ^ _ ` a b c d e f g h i j k l m n o p q r s t u v w x y z { | } ~  € ‚ ƒ „ … † ‡ ˆ ‰ Š ‹ Œ Ž ‘ ’ “ ” • – — ˜ ™ š › œ ž Ÿ   ¡ ¢ £ ¤ ¥ ¦ § ¨ © ª « ¬ ­ ® ¯ ° ± ² ³ ´ µ ¶ · ¸ ¹ º » ¼ ½ ¾ ¿ À Á Â Ã Ä Å Æ Ç È É Ê Ë Ì Í Î Ï Ð Ñ Ò Ó Ô Õ Ö × Ø Ù Ú Û Ü Ý Þ ß à á â ã ä å æ ç è é ê ë ì í î ï ð ñ ò ó ô õ ö ÷ ø ù ú û ü ý þ ÿ      !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~€‚ƒ„…†‡ˆ‰Š‹ŒŽ‘’“”•–—˜™š›œžŸ ¡¢£¤¹¥¦§¨©ª«¬­®¯°±²³´µ¶·¸¹º»¼½¾¿ÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏÐÑÒÓÔÕÖרÙÚÛÜÝÞßàáâãäåæçèéêëìíîïðñòóôõö÷øùúûüýþÿ      !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~€‚ƒ„…†‡ˆ‰Š‹ŒŽ‘’“”•–—˜™š›œžŸ ¡¢£¤¥¦§¨©ª«¬­®¯°±²³´µ¶·¸¹º»¼½¾¿ÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏÐÑÒÓÔÕÖרÙÚÛÜÝÞßàáâãäåæçèéêëìíîïðñòóôõö÷øùúûüýþÿ      !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~€‚ƒ„…†‡ˆ‰Š‹ŒŽ‘’“”•–—˜™š›œžŸ ¡¢£¤¥¦§¨©ª«¬­®¯°±²³´µ¶·¸¹º»¼½¾¿ÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏÐÑÒÓÔÕÖרÙÚÛÜÝÞßàáâãäåæçèéêëìíîïðñòóôõö÷øùúûüýþÿ      !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~€‚ƒ„…†‡ˆ‰Š‹ŒŽ‘’“”•–—˜™š›œžŸ ¡¢£¤¥¦§¨©ª«¬­®¯°±²³´µ¶·¸¹º»¼½¾¿ÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏÐÑÒÓÔÕÖרÙÚÛÜÝÞßàáâãäåæçèéêëìíîïðñòóôõö÷øùúûüýþÿ      !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~€‚ƒ„…†‡ˆ‰Š‹ŒŽ‘’“”•–—˜™š›œžŸ ¡¢£¤¥¦§¨©ª«¬­®¯°±²³´µ¶·¸¹º»¼½¾¿ÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏÐÑÒÓÔÕÖרÙÚÛÜÝÞßàáâãäåæçèéêëìíîïðñòóôõö÷øùúûüýþÿ      !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~€‚ƒ„…†‡ˆ‰Š‹ŒŽ‘’“”•–—˜™š›œžŸ ¡¢£¤¥¦§¨©ª«¬­®¯°±ÀÁ²³´µ¶·¸¹º»¼½¾¿ÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏÐÑÒÓÔÕÖרÙÚÛÜÝÞßàáâãäåæçèéêëìíîïðñòóôõö÷øùúûüýþÿ      !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~€‚ƒ„…†‡ˆ‰Š‹ŒŽ‘’“”•–—˜™š›œžŸ ¡¢£¤¥¦§¨©ª«¬­®¯°±²³´µ¶·¸¹º»¼½¾¿ÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏÐÑÒÓÔÕÖרÙÚÛÜÝÞßàáâãäåæçèéêëìíîïðñòóôõö÷øùúûüýþÿ      !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~€‚ƒ„…†‡ˆ‰Š‹ŒŽ‘’“”•–—˜™š›œžŸ ¡¢£¤¥¦§¨©ª«¬­®¯°±²³´µ¶·¸¹º»¼½¾¿ÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏÐÑÒÓÔÕÖרÙÚÛÜÝÞßàáâãäåæçèéêëìíîïðñòóôõö÷øùúûüýþÿ      !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~€‚ƒ„…†‡ˆ‰Š‹ŒŽ‘’“”•–—˜™š›œžŸ ¡¢£¤¥¦§¨©ª«¬­®¯°±²³´µ¶·¸¹º»¼½¾¿ÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏÐÑÒÓÔÕÖרÙÚÛÜÝÞßàáâãäåæçèéêëìíîïðñòóôõö÷øùúûüýþÿ      !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~€‚ƒ„…†‡ˆ‰Š‹ŒŽ‘’“”•–—˜™š›œžŸ ¡¢£¤¥¦§¨©ª«¬­®¯°±²³´µ¶·¸¹º»¼½¾¿ÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏÐÑÒÓÔÕÖרÙÚÛÜÝÞßàáâãäåæçèéêëìíîïðñòóôõö÷øùúûüýþÿ      !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`a sfthyphenAmacronamacronAbreveabreveAogonekaogonek Ccircumflex ccircumflex Cdotaccent cdotaccentDcarondcaronDcroatEmacronemacronEbreveebreve Edotaccent edotaccentEogonekeogonekEcaronecaron Gcircumflex gcircumflex Gdotaccent gdotaccent Gcommaaccent gcommaaccent Hcircumflex hcircumflexHbarhbarItildeitildeImacronimacronIbreveibreveIogonekiogonekIJij Jcircumflex jcircumflex Kcommaaccent kcommaaccent kgreenlandicLacutelacute Lcommaaccent lcommaaccentLcaronlcaronLdotldotNacutenacute Ncommaaccent ncommaaccentNcaronncaron napostropheEngengOmacronomacronObreveobreve Ohungarumlaut ohungarumlautRacuteracute Rcommaaccent rcommaaccentRcaronrcaronSacutesacute Scircumflex scircumflex Tcommaaccent tcommaaccentTcarontcaronTbartbarUtildeutildeUmacronumacronUbreveubreveUringuring Uhungarumlaut uhungarumlautUogonekuogonek Wcircumflex wcircumflex Ycircumflex ycircumflexZacutezacute Zdotaccent zdotaccentlongsuni0180uni0181uni0182uni0183uni0184uni0185uni0186uni0187uni0188uni0189uni018Auni018Buni018Cuni018Duni018Euni018Funi0190uni0191uni0193uni0194uni0195uni0196uni0197uni0198uni0199uni019Auni019Buni019Cuni019Duni019Euni019FOhornohornuni01A2uni01A3uni01A4uni01A5uni01A6uni01A7uni01A8uni01A9uni01AAuni01ABuni01ACuni01ADuni01AEUhornuhornuni01B1uni01B2uni01B3uni01B4uni01B5uni01B6uni01B7uni01B8uni01B9uni01BAuni01BBuni01BCuni01BDuni01BEuni01BFuni01C0uni01C1uni01C2uni01C3uni01C4uni01C5uni01C6uni01C7uni01C8uni01C9uni01CAuni01CBuni01CCuni01CDuni01CEuni01CFuni01D0uni01D1uni01D2uni01D3uni01D4uni01D5uni01D6uni01D7uni01D8uni01D9uni01DAuni01DBuni01DCuni01DDuni01DEuni01DFuni01E0uni01E1uni01E2uni01E3uni01E4uni01E5Gcarongcaronuni01E8uni01E9uni01EAuni01EBuni01ECuni01EDuni01EEuni01EFuni01F0uni01F1uni01F2uni01F3uni01F4uni01F5uni01F6uni01F7uni01F8uni01F9 Aringacute aringacuteAEacuteaeacute Oslashacute oslashacuteuni0200uni0201uni0202uni0203uni0204uni0205uni0206uni0207uni0208uni0209uni020Auni020Buni020Cuni020Duni020Euni020Funi0210uni0211uni0212uni0213uni0214uni0215uni0216uni0217 Scommaaccent scommaaccentuni021Auni021Buni021Cuni021Duni021Euni021Funi0220uni0221uni0222uni0223uni0224uni0225uni0226uni0227uni0228uni0229uni022Auni022Buni022Cuni022Duni022Euni022Funi0230uni0231uni0232uni0233uni0234uni0235uni0236dotlessjuni0238uni0239uni023Auni023Buni023Cuni023Duni023Euni023Funi0240uni0241uni0242uni0243uni0244uni0245uni0246uni0247uni0248uni0249uni024Auni024Buni024Cuni024Duni024Euni024Funi0250uni0251uni0252uni0253uni0254uni0255uni0256uni0257uni0258uni0259uni025Auni025Buni025Cuni025Duni025Euni025Funi0260uni0261uni0262uni0263uni0264uni0265uni0266uni0267uni0268uni0269uni026Auni026Buni026Cuni026Duni026Euni026Funi0270uni0271uni0272uni0273uni0274uni0275uni0276uni0277uni0278uni0279uni027Auni027Buni027Cuni027Duni027Euni027Funi0280uni0281uni0282uni0283uni0284uni0285uni0286uni0287uni0288uni0289uni028Auni028Buni028Cuni028Duni028Euni028Funi0290uni0291uni0292uni0293uni0294uni0295uni0296uni0297uni0298uni0299uni029Auni029Buni029Cuni029Duni029Euni029Funi02A0uni02A1uni02A2uni02A3uni02A4uni02A5uni02A6uni02A7uni02A8uni02A9uni02AAuni02ABuni02ACuni02ADuni02AEuni02AFuni02B0uni02B1uni02B2uni02B3uni02B4uni02B5uni02B6uni02B7uni02B8uni02B9uni02BAuni02BBuni02BCuni02BDuni02BEuni02BFuni02C0uni02C1uni02C2uni02C3uni02C4uni02C5uni02C8uni02C9uni02CAuni02CBuni02CCuni02CDuni02CEuni02CFuni02D0uni02D1uni02D2uni02D3uni02D4uni02D5uni02D6uni02D7uni02DEuni02DFuni02E0uni02E1uni02E2uni02E3uni02E4uni02E5uni02E6uni02E7uni02E8uni02E9uni02ECuni02EDuni02EEuni02F3uni02F7 gravecomb acutecombuni0302 tildecombuni0304uni0305uni0306uni0307uni0308 hookabovecombuni030Auni030Buni030Cuni030Duni030Euni030Funi0310uni0311uni0312uni0313uni0314uni0315uni0316uni0317uni0318uni0319uni031Auni031Buni031Cuni031Duni031Euni031Funi0320uni0321uni0322 dotbelowcombuni0324uni0325uni0326uni0327uni0328uni0329uni032Auni032Buni032Cuni032Duni032Euni032Funi0330uni0331uni0332uni0333uni0334uni0335uni0336uni0337uni0338uni0339uni033Auni033Buni033Cuni033Duni033Euni033Funi0340uni0341uni0342uni0343uni0344uni0345uni0346uni0347uni0348uni0349uni034Auni034Buni034Cuni034Duni034Euni034Funi0351uni0352uni0353uni0357uni0358uni035Auni035Cuni035Duni035Euni035Funi0360uni0361uni0362uni0370uni0371uni0372uni0373uni0374uni0375uni0376uni0377uni037Auni037Buni037Cuni037Duni037Etonos dieresistonos Alphatonos anoteleia EpsilontonosEtatonos Iotatonos Omicrontonos Upsilontonos OmegatonosiotadieresistonosAlphaBetaGammauni0394EpsilonZetaEtaThetaIotaKappaLambdaMuNuXiOmicronPiRhoSigmaTauUpsilonPhiChiPsi IotadieresisUpsilondieresis alphatonos epsilontonosetatonos iotatonosupsilondieresistonosalphabetagammadeltaepsilonzetaetathetaiotakappalambdauni03BCnuxiomicronrhosigma1sigmatauupsilonphichipsiomega iotadieresisupsilondieresis omicrontonos upsilontonos omegatonosuni03CFuni03D0theta1Upsilon1uni03D3uni03D4phi1omega1uni03D7uni03D8uni03D9uni03DAuni03DBuni03DCuni03DDuni03DEuni03DFuni03E0uni03E1uni03E2uni03E3uni03E4uni03E5uni03E6uni03E7uni03E8uni03E9uni03EAuni03EBuni03ECuni03EDuni03EEuni03EFuni03F0uni03F1uni03F2uni03F3uni03F4uni03F5uni03F6uni03F7uni03F8uni03F9uni03FAuni03FBuni03FCuni03FDuni03FEuni03FFuni0400uni0401uni0402uni0403uni0404uni0405uni0406uni0407uni0408uni0409uni040Auni040Buni040Cuni040Duni040Euni040Funi0410uni0411uni0412uni0413uni0414uni0415uni0416uni0417uni0418uni0419uni041Auni041Buni041Cuni041Duni041Euni041Funi0420uni0421uni0422uni0423uni0424uni0425uni0426uni0427uni0428uni0429uni042Auni042Buni042Cuni042Duni042Euni042Funi0430uni0431uni0432uni0433uni0434uni0435uni0436uni0437uni0438uni0439uni043Auni043Buni043Cuni043Duni043Euni043Funi0440uni0441uni0442uni0443uni0444uni0445uni0446uni0447uni0448uni0449uni044Auni044Buni044Cuni044Duni044Euni044Funi0450uni0451uni0452uni0453uni0454uni0455uni0456uni0457uni0458uni0459uni045Auni045Buni045Cuni045Duni045Euni045Funi0460uni0461uni0462uni0463uni0464uni0465uni0466uni0467uni0468uni0469uni046Auni046Buni046Cuni046Duni046Euni046Funi0470uni0471uni0472uni0473uni0474uni0475uni0476uni0477uni0478uni0479uni047Auni047Buni047Cuni047Duni047Euni047Funi0480uni0481uni0482uni0483uni0484uni0485uni0486uni0487uni0488uni0489uni048Auni048Buni048Cuni048Duni048Euni048Funi0490uni0491uni0492uni0493uni0494uni0495uni0496uni0497uni0498uni0499uni049Auni049Buni049Cuni049Duni049Euni049Funi04A0uni04A1uni04A2uni04A3uni04A4uni04A5uni04A6uni04A7uni04A8uni04A9uni04AAuni04ABuni04ACuni04ADuni04AEuni04AFuni04B0uni04B1uni04B2uni04B3uni04B4uni04B5uni04B6uni04B7uni04B8uni04B9uni04BAuni04BBuni04BCuni04BDuni04BEuni04BFuni04C0uni04C1uni04C2uni04C3uni04C4uni04C5uni04C6uni04C7uni04C8uni04C9uni04CAuni04CBuni04CCuni04CDuni04CEuni04CFuni04D0uni04D1uni04D2uni04D3uni04D4uni04D5uni04D6uni04D7uni04D8uni04D9uni04DAuni04DBuni04DCuni04DDuni04DEuni04DFuni04E0uni04E1uni04E2uni04E3uni04E4uni04E5uni04E6uni04E7uni04E8uni04E9uni04EAuni04EBuni04ECuni04EDuni04EEuni04EFuni04F0uni04F1uni04F2uni04F3uni04F4uni04F5uni04F6uni04F7uni04F8uni04F9uni04FAuni04FBuni04FCuni04FDuni04FEuni04FFuni0500uni0501uni0502uni0503uni0504uni0505uni0506uni0507uni0508uni0509uni050Auni050Buni050Cuni050Duni050Euni050Funi0510uni0511uni0512uni0513uni0514uni0515uni0516uni0517uni0518uni0519uni051Auni051Buni051Cuni051Duni051Euni051Funi0520uni0521uni0522uni0523uni0524uni0525uni0531uni0532uni0533uni0534uni0535uni0536uni0537uni0538uni0539uni053Auni053Buni053Cuni053Duni053Euni053Funi0540uni0541uni0542uni0543uni0544uni0545uni0546uni0547uni0548uni0549uni054Auni054Buni054Cuni054Duni054Euni054Funi0550uni0551uni0552uni0553uni0554uni0555uni0556uni0559uni055Auni055Buni055Cuni055Duni055Euni055Funi0561uni0562uni0563uni0564uni0565uni0566uni0567uni0568uni0569uni056Auni056Buni056Cuni056Duni056Euni056Funi0570uni0571uni0572uni0573uni0574uni0575uni0576uni0577uni0578uni0579uni057Auni057Buni057Cuni057Duni057Euni057Funi0580uni0581uni0582uni0583uni0584uni0585uni0586uni0587uni0589uni058Auni05B0uni05B1uni05B2uni05B3uni05B4uni05B5uni05B6uni05B7uni05B8uni05B9uni05BAuni05BBuni05BCuni05BDuni05BEuni05BFuni05C0uni05C1uni05C2uni05C3uni05C6uni05C7uni05D0uni05D1uni05D2uni05D3uni05D4uni05D5uni05D6uni05D7uni05D8uni05D9uni05DAuni05DBuni05DCuni05DDuni05DEuni05DFuni05E0uni05E1uni05E2uni05E3uni05E4uni05E5uni05E6uni05E7uni05E8uni05E9uni05EAuni05F0uni05F1uni05F2uni05F3uni05F4uni0606uni0607uni0609uni060Auni060Cuni0615uni061Buni061Funi0621uni0622uni0623uni0624uni0625uni0626uni0627uni0628uni0629uni062Auni062Buni062Cuni062Duni062Euni062Funi0630uni0631uni0632uni0633uni0634uni0635uni0636uni0637uni0638uni0639uni063Auni0640uni0641uni0642uni0643uni0644uni0645uni0646uni0647uni0648uni0649uni064Auni064Buni064Cuni064Duni064Euni064Funi0650uni0651uni0652uni0653uni0654uni0655uni0657uni065Auni0660uni0661uni0662uni0663uni0664uni0665uni0666uni0667uni0668uni0669uni066Auni066Buni066Cuni066Duni066Euni066Funi0670uni0674uni0679uni067Auni067Buni067Cuni067Duni067Euni067Funi0680uni0681uni0682uni0683uni0684uni0685uni0686uni0687uni0688uni0689uni068Auni068Buni068Cuni068Duni068Euni068Funi0690uni0691uni0692uni0693uni0694uni0695uni0696uni0697uni0698uni0699uni069Auni069Buni069Cuni069Duni069Euni069Funi06A0uni06A1uni06A2uni06A3uni06A4uni06A5uni06A6uni06A7uni06A8uni06A9uni06AAuni06ABuni06ACuni06ADuni06AEuni06AFuni06B0uni06B1uni06B2uni06B3uni06B4uni06B5uni06B6uni06B7uni06B8uni06B9uni06BAuni06BBuni06BCuni06BDuni06BEuni06BFuni06C6uni06C7uni06C8uni06CBuni06CCuni06CEuni06D0uni06D5uni06F0uni06F1uni06F2uni06F3uni06F4uni06F5uni06F6uni06F7uni06F8uni06F9uni07C0uni07C1uni07C2uni07C3uni07C4uni07C5uni07C6uni07C7uni07C8uni07C9uni07CAuni07CBuni07CCuni07CDuni07CEuni07CFuni07D0uni07D1uni07D2uni07D3uni07D4uni07D5uni07D6uni07D7uni07D8uni07D9uni07DAuni07DBuni07DCuni07DDuni07DEuni07DFuni07E0uni07E1uni07E2uni07E3uni07E4uni07E5uni07E6uni07E7uni07EBuni07ECuni07EDuni07EEuni07EFuni07F0uni07F1uni07F2uni07F3uni07F4uni07F5uni07F8uni07F9uni07FAuni0E3Funi0E81uni0E82uni0E84uni0E87uni0E88uni0E8Auni0E8Duni0E94uni0E95uni0E96uni0E97uni0E99uni0E9Auni0E9Buni0E9Cuni0E9Duni0E9Euni0E9Funi0EA1uni0EA2uni0EA3uni0EA5uni0EA7uni0EAAuni0EABuni0EADuni0EAEuni0EAFuni0EB0uni0EB1uni0EB2uni0EB3uni0EB4uni0EB5uni0EB6uni0EB7uni0EB8uni0EB9uni0EBBuni0EBCuni0EBDuni0EC0uni0EC1uni0EC2uni0EC3uni0EC4uni0EC6uni0EC8uni0EC9uni0ECAuni0ECBuni0ECCuni0ECDuni0ED0uni0ED1uni0ED2uni0ED3uni0ED4uni0ED5uni0ED6uni0ED7uni0ED8uni0ED9uni0EDCuni0EDDuni10A0uni10A1uni10A2uni10A3uni10A4uni10A5uni10A6uni10A7uni10A8uni10A9uni10AAuni10ABuni10ACuni10ADuni10AEuni10AFuni10B0uni10B1uni10B2uni10B3uni10B4uni10B5uni10B6uni10B7uni10B8uni10B9uni10BAuni10BBuni10BCuni10BDuni10BEuni10BFuni10C0uni10C1uni10C2uni10C3uni10C4uni10C5uni10D0uni10D1uni10D2uni10D3uni10D4uni10D5uni10D6uni10D7uni10D8uni10D9uni10DAuni10DBuni10DCuni10DDuni10DEuni10DFuni10E0uni10E1uni10E2uni10E3uni10E4uni10E5uni10E6uni10E7uni10E8uni10E9uni10EAuni10EBuni10ECuni10EDuni10EEuni10EFuni10F0uni10F1uni10F2uni10F3uni10F4uni10F5uni10F6uni10F7uni10F8uni10F9uni10FAuni10FBuni10FCuni1401uni1402uni1403uni1404uni1405uni1406uni1407uni1409uni140Auni140Buni140Cuni140Duni140Euni140Funi1410uni1411uni1412uni1413uni1414uni1415uni1416uni1417uni1418uni1419uni141Auni141Buni141Duni141Euni141Funi1420uni1421uni1422uni1423uni1424uni1425uni1426uni1427uni1428uni1429uni142Auni142Buni142Cuni142Duni142Euni142Funi1430uni1431uni1432uni1433uni1434uni1435uni1437uni1438uni1439uni143Auni143Buni143Cuni143Duni143Euni143Funi1440uni1441uni1442uni1443uni1444uni1445uni1446uni1447uni1448uni1449uni144Auni144Cuni144Duni144Euni144Funi1450uni1451uni1452uni1454uni1455uni1456uni1457uni1458uni1459uni145Auni145Buni145Cuni145Duni145Euni145Funi1460uni1461uni1462uni1463uni1464uni1465uni1466uni1467uni1468uni1469uni146Auni146Buni146Cuni146Duni146Euni146Funi1470uni1471uni1472uni1473uni1474uni1475uni1476uni1477uni1478uni1479uni147Auni147Buni147Cuni147Duni147Euni147Funi1480uni1481uni1482uni1483uni1484uni1485uni1486uni1487uni1488uni1489uni148Auni148Buni148Cuni148Duni148Euni148Funi1490uni1491uni1492uni1493uni1494uni1495uni1496uni1497uni1498uni1499uni149Auni149Buni149Cuni149Duni149Euni149Funi14A0uni14A1uni14A2uni14A3uni14A4uni14A5uni14A6uni14A7uni14A8uni14A9uni14AAuni14ABuni14ACuni14ADuni14AEuni14AFuni14B0uni14B1uni14B2uni14B3uni14B4uni14B5uni14B6uni14B7uni14B8uni14B9uni14BAuni14BBuni14BCuni14BDuni14C0uni14C1uni14C2uni14C3uni14C4uni14C5uni14C6uni14C7uni14C8uni14C9uni14CAuni14CBuni14CCuni14CDuni14CEuni14CFuni14D0uni14D1uni14D2uni14D3uni14D4uni14D5uni14D6uni14D7uni14D8uni14D9uni14DAuni14DBuni14DCuni14DDuni14DEuni14DFuni14E0uni14E1uni14E2uni14E3uni14E4uni14E5uni14E6uni14E7uni14E8uni14E9uni14EAuni14ECuni14EDuni14EEuni14EFuni14F0uni14F1uni14F2uni14F3uni14F4uni14F5uni14F6uni14F7uni14F8uni14F9uni14FAuni14FBuni14FCuni14FDuni14FEuni14FFuni1500uni1501uni1502uni1503uni1504uni1505uni1506uni1507uni1510uni1511uni1512uni1513uni1514uni1515uni1516uni1517uni1518uni1519uni151Auni151Buni151Cuni151Duni151Euni151Funi1520uni1521uni1522uni1523uni1524uni1525uni1526uni1527uni1528uni1529uni152Auni152Buni152Cuni152Duni152Euni152Funi1530uni1531uni1532uni1533uni1534uni1535uni1536uni1537uni1538uni1539uni153Auni153Buni153Cuni153Duni153Euni1540uni1541uni1542uni1543uni1544uni1545uni1546uni1547uni1548uni1549uni154Auni154Buni154Cuni154Duni154Euni154Funi1550uni1552uni1553uni1554uni1555uni1556uni1557uni1558uni1559uni155Auni155Buni155Cuni155Duni155Euni155Funi1560uni1561uni1562uni1563uni1564uni1565uni1566uni1567uni1568uni1569uni156Auni1574uni1575uni1576uni1577uni1578uni1579uni157Auni157Buni157Cuni157Duni157Euni157Funi1580uni1581uni1582uni1583uni1584uni1585uni158Auni158Buni158Cuni158Duni158Euni158Funi1590uni1591uni1592uni1593uni1594uni1595uni1596uni15A0uni15A1uni15A2uni15A3uni15A4uni15A5uni15A6uni15A7uni15A8uni15A9uni15AAuni15ABuni15ACuni15ADuni15AEuni15AFuni15DEuni15E1uni1646uni1647uni166Euni166Funi1670uni1671uni1672uni1673uni1674uni1675uni1676uni1680uni1681uni1682uni1683uni1684uni1685uni1686uni1687uni1688uni1689uni168Auni168Buni168Cuni168Duni168Euni168Funi1690uni1691uni1692uni1693uni1694uni1695uni1696uni1697uni1698uni1699uni169Auni169Buni169Cuni1D00uni1D01uni1D02uni1D03uni1D04uni1D05uni1D06uni1D07uni1D08uni1D09uni1D0Auni1D0Buni1D0Cuni1D0Duni1D0Euni1D0Funi1D10uni1D11uni1D12uni1D13uni1D14uni1D16uni1D17uni1D18uni1D19uni1D1Auni1D1Buni1D1Cuni1D1Duni1D1Euni1D1Funi1D20uni1D21uni1D22uni1D23uni1D26uni1D27uni1D28uni1D29uni1D2Auni1D2Buni1D2Cuni1D2Duni1D2Euni1D30uni1D31uni1D32uni1D33uni1D34uni1D35uni1D36uni1D37uni1D38uni1D39uni1D3Auni1D3Buni1D3Cuni1D3Duni1D3Euni1D3Funi1D40uni1D41uni1D42uni1D43uni1D44uni1D45uni1D46uni1D47uni1D48uni1D49uni1D4Auni1D4Buni1D4Cuni1D4Duni1D4Euni1D4Funi1D50uni1D51uni1D52uni1D53uni1D54uni1D55uni1D56uni1D57uni1D58uni1D59uni1D5Auni1D5Buni1D5Duni1D5Euni1D5Funi1D60uni1D61uni1D62uni1D63uni1D64uni1D65uni1D66uni1D67uni1D68uni1D69uni1D6Auni1D77uni1D78uni1D7Buni1D7Duni1D85uni1D9Buni1D9Cuni1D9Duni1D9Euni1D9Funi1DA0uni1DA1uni1DA2uni1DA3uni1DA4uni1DA5uni1DA6uni1DA7uni1DA8uni1DA9uni1DAAuni1DABuni1DACuni1DADuni1DAEuni1DAFuni1DB0uni1DB1uni1DB2uni1DB3uni1DB4uni1DB5uni1DB6uni1DB7uni1DB8uni1DB9uni1DBAuni1DBBuni1DBCuni1DBDuni1DBEuni1DBFuni1DC4uni1DC5uni1DC6uni1DC7uni1DC8uni1DC9uni1E00uni1E01uni1E02uni1E03uni1E04uni1E05uni1E06uni1E07uni1E08uni1E09uni1E0Auni1E0Buni1E0Cuni1E0Duni1E0Euni1E0Funi1E10uni1E11uni1E12uni1E13uni1E14uni1E15uni1E16uni1E17uni1E18uni1E19uni1E1Auni1E1Buni1E1Cuni1E1Duni1E1Euni1E1Funi1E20uni1E21uni1E22uni1E23uni1E24uni1E25uni1E26uni1E27uni1E28uni1E29uni1E2Auni1E2Buni1E2Cuni1E2Duni1E2Euni1E2Funi1E30uni1E31uni1E32uni1E33uni1E34uni1E35uni1E36uni1E37uni1E38uni1E39uni1E3Auni1E3Buni1E3Cuni1E3Duni1E3Euni1E3Funi1E40uni1E41uni1E42uni1E43uni1E44uni1E45uni1E46uni1E47uni1E48uni1E49uni1E4Auni1E4Buni1E4Cuni1E4Duni1E4Euni1E4Funi1E50uni1E51uni1E52uni1E53uni1E54uni1E55uni1E56uni1E57uni1E58uni1E59uni1E5Auni1E5Buni1E5Cuni1E5Duni1E5Euni1E5Funi1E60uni1E61uni1E62uni1E63uni1E64uni1E65uni1E66uni1E67uni1E68uni1E69uni1E6Auni1E6Buni1E6Cuni1E6Duni1E6Euni1E6Funi1E70uni1E71uni1E72uni1E73uni1E74uni1E75uni1E76uni1E77uni1E78uni1E79uni1E7Auni1E7Buni1E7Cuni1E7Duni1E7Euni1E7FWgravewgraveWacutewacute Wdieresis wdieresisuni1E86uni1E87uni1E88uni1E89uni1E8Auni1E8Buni1E8Cuni1E8Duni1E8Euni1E8Funi1E90uni1E91uni1E92uni1E93uni1E94uni1E95uni1E96uni1E97uni1E98uni1E99uni1E9Auni1E9Buni1E9Cuni1E9Duni1E9Euni1E9Funi1EA0uni1EA1uni1EA2uni1EA3uni1EA4uni1EA5uni1EA6uni1EA7uni1EA8uni1EA9uni1EAAuni1EABuni1EACuni1EADuni1EAEuni1EAFuni1EB0uni1EB1uni1EB2uni1EB3uni1EB4uni1EB5uni1EB6uni1EB7uni1EB8uni1EB9uni1EBAuni1EBBuni1EBCuni1EBDuni1EBEuni1EBFuni1EC0uni1EC1uni1EC2uni1EC3uni1EC4uni1EC5uni1EC6uni1EC7uni1EC8uni1EC9uni1ECAuni1ECBuni1ECCuni1ECDuni1ECEuni1ECFuni1ED0uni1ED1uni1ED2uni1ED3uni1ED4uni1ED5uni1ED6uni1ED7uni1ED8uni1ED9uni1EDAuni1EDBuni1EDCuni1EDDuni1EDEuni1EDFuni1EE0uni1EE1uni1EE2uni1EE3uni1EE4uni1EE5uni1EE6uni1EE7uni1EE8uni1EE9uni1EEAuni1EEBuni1EECuni1EEDuni1EEEuni1EEFuni1EF0uni1EF1Ygraveygraveuni1EF4uni1EF5uni1EF6uni1EF7uni1EF8uni1EF9uni1EFAuni1EFBuni1F00uni1F01uni1F02uni1F03uni1F04uni1F05uni1F06uni1F07uni1F08uni1F09uni1F0Auni1F0Buni1F0Cuni1F0Duni1F0Euni1F0Funi1F10uni1F11uni1F12uni1F13uni1F14uni1F15uni1F18uni1F19uni1F1Auni1F1Buni1F1Cuni1F1Duni1F20uni1F21uni1F22uni1F23uni1F24uni1F25uni1F26uni1F27uni1F28uni1F29uni1F2Auni1F2Buni1F2Cuni1F2Duni1F2Euni1F2Funi1F30uni1F31uni1F32uni1F33uni1F34uni1F35uni1F36uni1F37uni1F38uni1F39uni1F3Auni1F3Buni1F3Cuni1F3Duni1F3Euni1F3Funi1F40uni1F41uni1F42uni1F43uni1F44uni1F45uni1F48uni1F49uni1F4Auni1F4Buni1F4Cuni1F4Duni1F50uni1F51uni1F52uni1F53uni1F54uni1F55uni1F56uni1F57uni1F59uni1F5Buni1F5Duni1F5Funi1F60uni1F61uni1F62uni1F63uni1F64uni1F65uni1F66uni1F67uni1F68uni1F69uni1F6Auni1F6Buni1F6Cuni1F6Duni1F6Euni1F6Funi1F70uni1F71uni1F72uni1F73uni1F74uni1F75uni1F76uni1F77uni1F78uni1F79uni1F7Auni1F7Buni1F7Cuni1F7Duni1F80uni1F81uni1F82uni1F83uni1F84uni1F85uni1F86uni1F87uni1F88uni1F89uni1F8Auni1F8Buni1F8Cuni1F8Duni1F8Euni1F8Funi1F90uni1F91uni1F92uni1F93uni1F94uni1F95uni1F96uni1F97uni1F98uni1F99uni1F9Auni1F9Buni1F9Cuni1F9Duni1F9Euni1F9Funi1FA0uni1FA1uni1FA2uni1FA3uni1FA4uni1FA5uni1FA6uni1FA7uni1FA8uni1FA9uni1FAAuni1FABuni1FACuni1FADuni1FAEuni1FAFuni1FB0uni1FB1uni1FB2uni1FB3uni1FB4uni1FB6uni1FB7uni1FB8uni1FB9uni1FBAuni1FBBuni1FBCuni1FBDuni1FBEuni1FBFuni1FC0uni1FC1uni1FC2uni1FC3uni1FC4uni1FC6uni1FC7uni1FC8uni1FC9uni1FCAuni1FCBuni1FCCuni1FCDuni1FCEuni1FCFuni1FD0uni1FD1uni1FD2uni1FD3uni1FD6uni1FD7uni1FD8uni1FD9uni1FDAuni1FDBuni1FDDuni1FDEuni1FDFuni1FE0uni1FE1uni1FE2uni1FE3uni1FE4uni1FE5uni1FE6uni1FE7uni1FE8uni1FE9uni1FEAuni1FEBuni1FECuni1FEDuni1FEEuni1FEFuni1FF2uni1FF3uni1FF4uni1FF6uni1FF7uni1FF8uni1FF9uni1FFAuni1FFBuni1FFCuni1FFDuni1FFEuni2000uni2001uni2002uni2003uni2004uni2005uni2006uni2007uni2008uni2009uni200Auni200Buni200Cuni200Duni200Euni200Funi2010uni2011 figuredashuni2015uni2016 underscoredbl quotereverseduni201Funi2023onedotenleadertwodotenleaderuni2027uni2028uni2029uni202Auni202Buni202Cuni202Duni202Euni202Funi2031minuteseconduni2034uni2035uni2036uni2037uni2038uni203B exclamdbluni203Duni203Euni203Funi2040uni2041uni2042uni2043uni2045uni2046uni2047uni2048uni2049uni204Auni204Buni204Cuni204Duni204Euni204Funi2050uni2051uni2052uni2053uni2054uni2055uni2056uni2057uni2058uni2059uni205Auni205Buni205Cuni205Duni205Euni205Funi2060uni2061uni2062uni2063uni2064uni206Auni206Buni206Cuni206Duni206Euni206Funi2070uni2071uni2074uni2075uni2076uni2077uni2078uni2079uni207Auni207Buni207Cuni207Duni207Euni207Funi2080uni2081uni2082uni2083uni2084uni2085uni2086uni2087uni2088uni2089uni208Auni208Buni208Cuni208Duni208Euni2090uni2091uni2092uni2093uni2094uni2095uni2096uni2097uni2098uni2099uni209Auni209Buni209Cuni20A0 colonmonetaryuni20A2lirauni20A5uni20A6pesetauni20A8uni20A9uni20AAdongEurouni20ADuni20AEuni20AFuni20B0uni20B1uni20B2uni20B3uni20B4uni20B5uni20B8uni20B9uni20BAuni20BDuni20D0uni20D1uni20D6uni20D7uni20DBuni20DCuni20E1uni2100uni2101uni2102uni2103uni2104uni2105uni2106uni2107uni2108uni2109uni210Buni210Cuni210Duni210Euni210Funi2110Ifrakturuni2112uni2113uni2114uni2115uni2116uni2117 weierstrassuni2119uni211Auni211BRfrakturuni211D prescriptionuni211Funi2120uni2121uni2123uni2124uni2125uni2126uni2127uni2128uni2129uni212Auni212Buni212Cuni212D estimateduni212Funi2130uni2131uni2132uni2133uni2134alephuni2136uni2137uni2138uni2139uni213Auni213Buni213Cuni213Duni213Euni213Funi2140uni2141uni2142uni2143uni2144uni2145uni2146uni2147uni2148uni2149uni214Buni214Euni2150uni2151uni2152onethird twothirdsuni2155uni2156uni2157uni2158uni2159uni215A oneeighth threeeighths fiveeighths seveneighthsuni215Funi2160uni2161uni2162uni2163uni2164uni2165uni2166uni2167uni2168uni2169uni216Auni216Buni216Cuni216Duni216Euni216Funi2170uni2171uni2172uni2173uni2174uni2175uni2176uni2177uni2178uni2179uni217Auni217Buni217Cuni217Duni217Euni217Funi2180uni2181uni2182uni2183uni2184uni2185uni2189 arrowleftarrowup arrowright arrowdown arrowboth arrowupdnuni2196uni2197uni2198uni2199uni219Auni219Buni219Cuni219Duni219Euni219Funi21A0uni21A1uni21A2uni21A3uni21A4uni21A5uni21A6uni21A7 arrowupdnbseuni21A9uni21AAuni21ABuni21ACuni21ADuni21AEuni21AFuni21B0uni21B1uni21B2uni21B3uni21B4carriagereturnuni21B6uni21B7uni21B8uni21B9uni21BAuni21BBuni21BCuni21BDuni21BEuni21BFuni21C0uni21C1uni21C2uni21C3uni21C4uni21C5uni21C6uni21C7uni21C8uni21C9uni21CAuni21CBuni21CCuni21CDuni21CEuni21CF arrowdblleft arrowdblup arrowdblright arrowdbldown arrowdblbothuni21D5uni21D6uni21D7uni21D8uni21D9uni21DAuni21DBuni21DCuni21DDuni21DEuni21DFuni21E0uni21E1uni21E2uni21E3uni21E4uni21E5uni21E6uni21E7uni21E8uni21E9uni21EAuni21EBuni21ECuni21EDuni21EEuni21EFuni21F0uni21F1uni21F2uni21F3uni21F4uni21F5uni21F6uni21F7uni21F8uni21F9uni21FAuni21FBuni21FCuni21FDuni21FEuni21FF universaluni2201 existentialuni2204emptysetgradientelement notelementuni220Asuchthatuni220Cuni220Duni220Euni2210uni2213uni2214uni2215uni2216 asteriskmathuni2218uni2219uni221Buni221C proportional orthogonalangleuni2221uni2222uni2223uni2224uni2225uni2226 logicaland logicalor intersectionunionuni222Cuni222Duni222Euni222Funi2230uni2231uni2232uni2233 thereforeuni2235uni2236uni2237uni2238uni2239uni223Auni223Bsimilaruni223Duni223Euni223Funi2240uni2241uni2242uni2243uni2244 congruentuni2246uni2247uni2249uni224Auni224Buni224Cuni224Duni224Euni224Funi2250uni2251uni2252uni2253uni2254uni2255uni2256uni2257uni2258uni2259uni225Auni225Buni225Cuni225Duni225Euni225F equivalenceuni2262uni2263uni2266uni2267uni2268uni2269uni226Auni226Buni226Cuni226Duni226Euni226Funi2270uni2271uni2272uni2273uni2274uni2275uni2276uni2277uni2278uni2279uni227Auni227Buni227Cuni227Duni227Euni227Funi2280uni2281 propersubsetpropersuperset notsubsetuni2285 reflexsubsetreflexsupersetuni2288uni2289uni228Auni228Buni228Cuni228Duni228Euni228Funi2290uni2291uni2292uni2293uni2294 circleplusuni2296circlemultiplyuni2298uni2299uni229Auni229Buni229Cuni229Duni229Euni229Funi22A0uni22A1uni22A2uni22A3uni22A4 perpendicularuni22A6uni22A7uni22A8uni22A9uni22AAuni22ABuni22ACuni22ADuni22AEuni22AFuni22B0uni22B1uni22B2uni22B3uni22B4uni22B5uni22B6uni22B7uni22B8uni22B9uni22BAuni22BBuni22BCuni22BDuni22BEuni22BFuni22C0uni22C1uni22C2uni22C3uni22C4dotmathuni22C6uni22C7uni22C8uni22C9uni22CAuni22CBuni22CCuni22CDuni22CEuni22CFuni22D0uni22D1uni22D2uni22D3uni22D4uni22D5uni22D6uni22D7uni22D8uni22D9uni22DAuni22DBuni22DCuni22DDuni22DEuni22DFuni22E0uni22E1uni22E2uni22E3uni22E4uni22E5uni22E6uni22E7uni22E8uni22E9uni22EAuni22EBuni22ECuni22EDuni22EEuni22EFuni22F0uni22F1uni22F2uni22F3uni22F4uni22F5uni22F6uni22F7uni22F8uni22F9uni22FAuni22FBuni22FCuni22FDuni22FEuni22FFuni2300uni2301houseuni2303uni2304uni2305uni2306uni2307uni2308uni2309uni230Auni230Buni230Cuni230Duni230Euni230F revlogicalnotuni2311uni2318uni2319uni231Cuni231Duni231Euni231F integraltp integralbtuni2324uni2325uni2326uni2327uni2328uni232Buni232Cuni2373uni2374uni2375uni237Auni237Duni2387uni2394uni239Buni239Cuni239Duni239Euni239Funi23A0uni23A1uni23A2uni23A3uni23A4uni23A5uni23A6uni23A7uni23A8uni23A9uni23AAuni23ABuni23ACuni23ADuni23AEuni23CEuni23CFuni23E3uni23E5uni23E8uni2422uni2423uni2460uni2461uni2462uni2463uni2464uni2465uni2466uni2467uni2468uni2469SF100000uni2501SF110000uni2503uni2504uni2505uni2506uni2507uni2508uni2509uni250Auni250BSF010000uni250Duni250Euni250FSF030000uni2511uni2512uni2513SF020000uni2515uni2516uni2517SF040000uni2519uni251Auni251BSF080000uni251Duni251Euni251Funi2520uni2521uni2522uni2523SF090000uni2525uni2526uni2527uni2528uni2529uni252Auni252BSF060000uni252Duni252Euni252Funi2530uni2531uni2532uni2533SF070000uni2535uni2536uni2537uni2538uni2539uni253Auni253BSF050000uni253Duni253Euni253Funi2540uni2541uni2542uni2543uni2544uni2545uni2546uni2547uni2548uni2549uni254Auni254Buni254Cuni254Duni254Euni254FSF430000SF240000SF510000SF520000SF390000SF220000SF210000SF250000SF500000SF490000SF380000SF280000SF270000SF260000SF360000SF370000SF420000SF190000SF200000SF230000SF470000SF480000SF410000SF450000SF460000SF400000SF540000SF530000SF440000uni256Duni256Euni256Funi2570uni2571uni2572uni2573uni2574uni2575uni2576uni2577uni2578uni2579uni257Auni257Buni257Cuni257Duni257Euni257Fupblockuni2581uni2582uni2583dnblockuni2585uni2586uni2587blockuni2589uni258Auni258Blfblockuni258Duni258Euni258Frtblockltshadeshadedkshadeuni2594uni2595uni2596uni2597uni2598uni2599uni259Auni259Buni259Cuni259Duni259Euni259F filledboxH22073uni25A2uni25A3uni25A4uni25A5uni25A6uni25A7uni25A8uni25A9H18543H18551 filledrectuni25ADuni25AEuni25AFuni25B0uni25B1triagupuni25B3uni25B4uni25B5uni25B6uni25B7uni25B8uni25B9triagrtuni25BBtriagdnuni25BDuni25BEuni25BFuni25C0uni25C1uni25C2uni25C3triaglfuni25C5uni25C6uni25C7uni25C8uni25C9circleuni25CCuni25CDuni25CEH18533uni25D0uni25D1uni25D2uni25D3uni25D4uni25D5uni25D6uni25D7 invbullet invcircleuni25DAuni25DBuni25DCuni25DDuni25DEuni25DFuni25E0uni25E1uni25E2uni25E3uni25E4uni25E5 openbulletuni25E7uni25E8uni25E9uni25EAuni25EBuni25ECuni25EDuni25EEuni25EFuni25F0uni25F1uni25F2uni25F3uni25F4uni25F5uni25F6uni25F7uni25F8uni25F9uni25FAuni25FBuni25FCuni25FDuni25FEuni25FFuni2600uni2601uni2602uni2603uni2604uni2605uni2606uni2607uni2608uni2609uni260Auni260Buni260Cuni260Duni260Euni260Funi2610uni2611uni2612uni2613uni2614uni2615uni2616uni2617uni2618uni2619uni261Auni261Buni261Cuni261Duni261Euni261Funi2620uni2621uni2622uni2623uni2624uni2625uni2626uni2627uni2628uni2629uni262Auni262Buni262Cuni262Duni262Euni262Funi2630uni2631uni2632uni2633uni2634uni2635uni2636uni2637uni2638uni2639 smileface invsmilefacesununi263Duni263Euni263Ffemaleuni2641maleuni2643uni2644uni2645uni2646uni2647uni2648uni2649uni264Auni264Buni264Cuni264Duni264Euni264Funi2650uni2651uni2652uni2653uni2654uni2655uni2656uni2657uni2658uni2659uni265Auni265Buni265Cuni265Duni265Euni265Fspadeuni2661uni2662clubuni2664heartdiamonduni2667uni2668uni2669 musicalnotemusicalnotedbluni266Cuni266Duni266Euni266Funi2670uni2671uni2672uni2673uni2674uni2675uni2676uni2677uni2678uni2679uni267Auni267Buni267Cuni267Duni267Euni267Funi2680uni2681uni2682uni2683uni2684uni2685uni2686uni2687uni2688uni2689uni268Auni268Buni268Cuni268Duni268Euni268Funi2690uni2691uni2692uni2693uni2694uni2695uni2696uni2697uni2698uni2699uni269Auni269Buni269Cuni269Euni269Funi26A0uni26A1uni26A2uni26A3uni26A4uni26A5uni26A6uni26A7uni26A8uni26A9uni26AAuni26ABuni26ACuni26ADuni26AEuni26AFuni26B0uni26B1uni26B2uni26B3uni26B4uni26B5uni26B6uni26B7uni26B8uni26C0uni26C1uni26C2uni26C3uni26E2uni2701uni2702uni2703uni2704uni2706uni2707uni2708uni2709uni270Cuni270Duni270Euni270Funi2710uni2711uni2712uni2713uni2714uni2715uni2716uni2717uni2718uni2719uni271Auni271Buni271Cuni271Duni271Euni271Funi2720uni2721uni2722uni2723uni2724uni2725uni2726uni2727uni2729uni272Auni272Buni272Cuni272Duni272Euni272Funi2730uni2731uni2732uni2733uni2734uni2735uni2736uni2737uni2738uni2739uni273Auni273Buni273Cuni273Duni273Euni273Funi2740uni2741uni2742uni2743uni2744uni2745uni2746uni2747uni2748uni2749uni274Auni274Buni274Duni274Funi2750uni2751uni2752uni2756uni2758uni2759uni275Auni275Buni275Cuni275Duni275Euni2761uni2762uni2763uni2764uni2765uni2766uni2767uni2768uni2769uni276Auni276Buni276Cuni276Duni276Euni276Funi2770uni2771uni2772uni2773uni2774uni2775uni2776uni2777uni2778uni2779uni277Auni277Buni277Cuni277Duni277Euni277Funi2780uni2781uni2782uni2783uni2784uni2785uni2786uni2787uni2788uni2789uni278Auni278Buni278Cuni278Duni278Euni278Funi2790uni2791uni2792uni2793uni2794uni2798uni2799uni279Auni279Buni279Cuni279Duni279Euni279Funi27A0uni27A1uni27A2uni27A3uni27A4uni27A5uni27A6uni27A7uni27A8uni27A9uni27AAuni27ABuni27ACuni27ADuni27AEuni27AFuni27B1uni27B2uni27B3uni27B4uni27B5uni27B6uni27B7uni27B8uni27B9uni27BAuni27BBuni27BCuni27BDuni27BEuni27C5uni27C6uni27E0uni27E6uni27E7uni27E8uni27E9uni27EAuni27EBuni27F0uni27F1uni27F2uni27F3uni27F4uni27F5uni27F6uni27F7uni27F8uni27F9uni27FAuni27FBuni27FCuni27FDuni27FEuni27FFuni2800uni2801uni2802uni2803uni2804uni2805uni2806uni2807uni2808uni2809uni280Auni280Buni280Cuni280Duni280Euni280Funi2810uni2811uni2812uni2813uni2814uni2815uni2816uni2817uni2818uni2819uni281Auni281Buni281Cuni281Duni281Euni281Funi2820uni2821uni2822uni2823uni2824uni2825uni2826uni2827uni2828uni2829uni282Auni282Buni282Cuni282Duni282Euni282Funi2830uni2831uni2832uni2833uni2834uni2835uni2836uni2837uni2838uni2839uni283Auni283Buni283Cuni283Duni283Euni283Funi2840uni2841uni2842uni2843uni2844uni2845uni2846uni2847uni2848uni2849uni284Auni284Buni284Cuni284Duni284Euni284Funi2850uni2851uni2852uni2853uni2854uni2855uni2856uni2857uni2858uni2859uni285Auni285Buni285Cuni285Duni285Euni285Funi2860uni2861uni2862uni2863uni2864uni2865uni2866uni2867uni2868uni2869uni286Auni286Buni286Cuni286Duni286Euni286Funi2870uni2871uni2872uni2873uni2874uni2875uni2876uni2877uni2878uni2879uni287Auni287Buni287Cuni287Duni287Euni287Funi2880uni2881uni2882uni2883uni2884uni2885uni2886uni2887uni2888uni2889uni288Auni288Buni288Cuni288Duni288Euni288Funi2890uni2891uni2892uni2893uni2894uni2895uni2896uni2897uni2898uni2899uni289Auni289Buni289Cuni289Duni289Euni289Funi28A0uni28A1uni28A2uni28A3uni28A4uni28A5uni28A6uni28A7uni28A8uni28A9uni28AAuni28ABuni28ACuni28ADuni28AEuni28AFuni28B0uni28B1uni28B2uni28B3uni28B4uni28B5uni28B6uni28B7uni28B8uni28B9uni28BAuni28BBuni28BCuni28BDuni28BEuni28BFuni28C0uni28C1uni28C2uni28C3uni28C4uni28C5uni28C6uni28C7uni28C8uni28C9uni28CAuni28CBuni28CCuni28CDuni28CEuni28CFuni28D0uni28D1uni28D2uni28D3uni28D4uni28D5uni28D6uni28D7uni28D8uni28D9uni28DAuni28DBuni28DCuni28DDuni28DEuni28DFuni28E0uni28E1uni28E2uni28E3uni28E4uni28E5uni28E6uni28E7uni28E8uni28E9uni28EAuni28EBuni28ECuni28EDuni28EEuni28EFuni28F0uni28F1uni28F2uni28F3uni28F4uni28F5uni28F6uni28F7uni28F8uni28F9uni28FAuni28FBuni28FCuni28FDuni28FEuni28FFuni2906uni2907uni290Auni290Buni2940uni2941uni2983uni2984uni29CEuni29CFuni29D0uni29D1uni29D2uni29D3uni29D4uni29D5uni29EBuni29FAuni29FBuni2A00uni2A01uni2A02uni2A0Cuni2A0Duni2A0Euni2A0Funi2A10uni2A11uni2A12uni2A13uni2A14uni2A15uni2A16uni2A17uni2A18uni2A19uni2A1Auni2A1Buni2A1Cuni2A2Funi2A6Auni2A6Buni2A7Duni2A7Euni2A7Funi2A80uni2A81uni2A82uni2A83uni2A84uni2A85uni2A86uni2A87uni2A88uni2A89uni2A8Auni2A8Buni2A8Cuni2A8Duni2A8Euni2A8Funi2A90uni2A91uni2A92uni2A93uni2A94uni2A95uni2A96uni2A97uni2A98uni2A99uni2A9Auni2A9Buni2A9Cuni2A9Duni2A9Euni2A9Funi2AA0uni2AAEuni2AAFuni2AB0uni2AB1uni2AB2uni2AB3uni2AB4uni2AB5uni2AB6uni2AB7uni2AB8uni2AB9uni2ABAuni2AF9uni2AFAuni2B00uni2B01uni2B02uni2B03uni2B04uni2B05uni2B06uni2B07uni2B08uni2B09uni2B0Auni2B0Buni2B0Cuni2B0Duni2B0Euni2B0Funi2B10uni2B11uni2B12uni2B13uni2B14uni2B15uni2B16uni2B17uni2B18uni2B19uni2B1Auni2B1Funi2B20uni2B21uni2B22uni2B23uni2B24uni2B53uni2B54uni2C60uni2C61uni2C62uni2C63uni2C64uni2C65uni2C66uni2C67uni2C68uni2C69uni2C6Auni2C6Buni2C6Cuni2C6Duni2C6Euni2C6Funi2C70uni2C71uni2C72uni2C73uni2C74uni2C75uni2C76uni2C77uni2C79uni2C7Auni2C7Buni2C7Cuni2C7Duni2C7Euni2C7Funi2D00uni2D01uni2D02uni2D03uni2D04uni2D05uni2D06uni2D07uni2D08uni2D09uni2D0Auni2D0Buni2D0Cuni2D0Duni2D0Euni2D0Funi2D10uni2D11uni2D12uni2D13uni2D14uni2D15uni2D16uni2D17uni2D18uni2D19uni2D1Auni2D1Buni2D1Cuni2D1Duni2D1Euni2D1Funi2D20uni2D21uni2D22uni2D23uni2D24uni2D25uni2D30uni2D31uni2D32uni2D33uni2D34uni2D35uni2D36uni2D37uni2D38uni2D39uni2D3Auni2D3Buni2D3Cuni2D3Duni2D3Euni2D3Funi2D40uni2D41uni2D42uni2D43uni2D44uni2D45uni2D46uni2D47uni2D48uni2D49uni2D4Auni2D4Buni2D4Cuni2D4Duni2D4Euni2D4Funi2D50uni2D51uni2D52uni2D53uni2D54uni2D55uni2D56uni2D57uni2D58uni2D59uni2D5Auni2D5Buni2D5Cuni2D5Duni2D5Euni2D5Funi2D60uni2D61uni2D62uni2D63uni2D64uni2D65uni2D6Funi2E18uni2E1Funi2E22uni2E23uni2E24uni2E25uni2E2Euni4DC0uni4DC1uni4DC2uni4DC3uni4DC4uni4DC5uni4DC6uni4DC7uni4DC8uni4DC9uni4DCAuni4DCBuni4DCCuni4DCDuni4DCEuni4DCFuni4DD0uni4DD1uni4DD2uni4DD3uni4DD4uni4DD5uni4DD6uni4DD7uni4DD8uni4DD9uni4DDAuni4DDBuni4DDCuni4DDDuni4DDEuni4DDFuni4DE0uni4DE1uni4DE2uni4DE3uni4DE4uni4DE5uni4DE6uni4DE7uni4DE8uni4DE9uni4DEAuni4DEBuni4DECuni4DEDuni4DEEuni4DEFuni4DF0uni4DF1uni4DF2uni4DF3uni4DF4uni4DF5uni4DF6uni4DF7uni4DF8uni4DF9uni4DFAuni4DFBuni4DFCuni4DFDuni4DFEuni4DFFuniA4D0uniA4D1uniA4D2uniA4D3uniA4D4uniA4D5uniA4D6uniA4D7uniA4D8uniA4D9uniA4DAuniA4DBuniA4DCuniA4DDuniA4DEuniA4DFuniA4E0uniA4E1uniA4E2uniA4E3uniA4E4uniA4E5uniA4E6uniA4E7uniA4E8uniA4E9uniA4EAuniA4EBuniA4ECuniA4EDuniA4EEuniA4EFuniA4F0uniA4F1uniA4F2uniA4F3uniA4F4uniA4F5uniA4F6uniA4F7uniA4F8uniA4F9uniA4FAuniA4FBuniA4FCuniA4FDuniA4FEuniA4FFuniA644uniA645uniA646uniA647uniA64CuniA64DuniA650uniA651uniA654uniA655uniA656uniA657uniA662uniA663uniA664uniA665uniA666uniA667uniA668uniA669uniA66AuniA66BuniA66CuniA66DuniA66EuniA68AuniA68BuniA68CuniA68DuniA694uniA695uniA708uniA709uniA70AuniA70BuniA70CuniA70DuniA70EuniA70FuniA710uniA711uniA712uniA713uniA714uniA715uniA716uniA71BuniA71CuniA71DuniA71EuniA71FuniA722uniA723uniA724uniA725uniA726uniA727uniA728uniA729uniA72AuniA72BuniA730uniA731uniA732uniA733uniA734uniA735uniA736uniA737uniA738uniA739uniA73AuniA73BuniA73CuniA73DuniA73EuniA73FuniA740uniA741uniA746uniA747uniA748uniA749uniA74AuniA74BuniA74EuniA74FuniA750uniA751uniA752uniA753uniA756uniA757uniA764uniA765uniA766uniA767uniA780uniA781uniA782uniA783uniA789uniA78AuniA78BuniA78CuniA78DuniA78EuniA790uniA791uniA7A0uniA7A1uniA7A2uniA7A3uniA7A4uniA7A5uniA7A6uniA7A7uniA7A8uniA7A9uniA7AAuniA7F8uniA7F9uniA7FAuniA7FBuniA7FCuniA7FDuniA7FEuniA7FF uni02E5.5 uni02E6.5 uni02E7.5 uni02E8.5 uni02E9.5 uni02E5.4 uni02E6.4 uni02E7.4 uni02E8.4 uni02E9.4 uni02E5.3 uni02E6.3 uni02E7.3 uni02E8.3 uni02E9.3 uni02E5.2 uni02E6.2 uni02E7.2 uni02E8.2 uni02E9.2 uni02E5.1 uni02E6.1 uni02E7.1 uni02E8.1 uni02E9.1stemuniF000uniF001uniF002uniF003uniF400uniF401uniF402uniF403uniF404uniF405uniF406uniF407uniF408uniF409uniF40AuniF40BuniF40CuniF40DuniF40EuniF40FuniF410uniF411uniF412uniF413uniF414uniF415uniF416uniF417uniF418uniF419uniF41AuniF41BuniF41CuniF41DuniF41EuniF41FuniF420uniF421uniF422uniF423uniF424uniF425uniF426uniF428uniF429uniF42AuniF42BuniF42CuniF42DuniF42EuniF42FuniF430uniF431uniF432uniF433uniF434uniF435uniF436uniF437uniF438uniF439uniF43AuniF43BuniF43CuniF43DuniF43EuniF43FuniF440uniF441uniF6C5uniFB00uniFB03uniFB04uniFB05uniFB06uniFB13uniFB14uniFB15uniFB16uniFB17uniFB1DuniFB1EuniFB1FuniFB20uniFB21uniFB22uniFB23uniFB24uniFB25uniFB26uniFB27uniFB28uniFB29uniFB2AuniFB2BuniFB2CuniFB2DuniFB2EuniFB2FuniFB30uniFB31uniFB32uniFB33uniFB34uniFB35uniFB36uniFB38uniFB39uniFB3AuniFB3BuniFB3CuniFB3EuniFB40uniFB41uniFB43uniFB44uniFB46uniFB47uniFB48uniFB49uniFB4AuniFB4BuniFB4CuniFB4DuniFB4EuniFB4FuniFB52uniFB53uniFB54uniFB55uniFB56uniFB57uniFB58uniFB59uniFB5AuniFB5BuniFB5CuniFB5DuniFB5EuniFB5FuniFB60uniFB61uniFB62uniFB63uniFB64uniFB65uniFB66uniFB67uniFB68uniFB69uniFB6AuniFB6BuniFB6CuniFB6DuniFB6EuniFB6FuniFB70uniFB71uniFB72uniFB73uniFB74uniFB75uniFB76uniFB77uniFB78uniFB79uniFB7AuniFB7BuniFB7CuniFB7DuniFB7EuniFB7FuniFB80uniFB81uniFB82uniFB83uniFB84uniFB85uniFB86uniFB87uniFB88uniFB89uniFB8AuniFB8BuniFB8CuniFB8DuniFB8EuniFB8FuniFB90uniFB91uniFB92uniFB93uniFB94uniFB95uniFB96uniFB97uniFB98uniFB99uniFB9AuniFB9BuniFB9CuniFB9DuniFB9EuniFB9FuniFBA0uniFBA1uniFBA2uniFBA3uniFBAAuniFBABuniFBACuniFBADuniFBD3uniFBD4uniFBD5uniFBD6uniFBD7uniFBD8uniFBD9uniFBDAuniFBDBuniFBDCuniFBDEuniFBDFuniFBE4uniFBE5uniFBE6uniFBE7uniFBE8uniFBE9uniFBFCuniFBFDuniFBFEuniFBFFuniFE00uniFE01uniFE02uniFE03uniFE04uniFE05uniFE06uniFE07uniFE08uniFE09uniFE0AuniFE0BuniFE0CuniFE0DuniFE0EuniFE0FuniFE20uniFE21uniFE22uniFE23uniFE70uniFE71uniFE72uniFE73uniFE74uniFE76uniFE77uniFE78uniFE79uniFE7AuniFE7BuniFE7CuniFE7DuniFE7EuniFE7FuniFE80uniFE81uniFE82uniFE83uniFE84uniFE85uniFE86uniFE87uniFE88uniFE89uniFE8AuniFE8BuniFE8CuniFE8DuniFE8EuniFE8FuniFE90uniFE91uniFE92uniFE93uniFE94uniFE95uniFE96uniFE97uniFE98uniFE99uniFE9AuniFE9BuniFE9CuniFE9DuniFE9EuniFE9FuniFEA0uniFEA1uniFEA2uniFEA3uniFEA4uniFEA5uniFEA6uniFEA7uniFEA8uniFEA9uniFEAAuniFEABuniFEACuniFEADuniFEAEuniFEAFuniFEB0uniFEB1uniFEB2uniFEB3uniFEB4uniFEB5uniFEB6uniFEB7uniFEB8uniFEB9uniFEBAuniFEBBuniFEBCuniFEBDuniFEBEuniFEBFuniFEC0uniFEC1uniFEC2uniFEC3uniFEC4uniFEC5uniFEC6uniFEC7uniFEC8uniFEC9uniFECAuniFECBuniFECCuniFECDuniFECEuniFECFuniFED0uniFED1uniFED2uniFED3uniFED4uniFED5uniFED6uniFED7uniFED8uniFED9uniFEDAuniFEDBuniFEDCuniFEDDuniFEDEuniFEDFuniFEE0uniFEE1uniFEE2uniFEE3uniFEE4uniFEE5uniFEE6uniFEE7uniFEE8uniFEE9uniFEEAuniFEEBuniFEECuniFEEDuniFEEEuniFEEFuniFEF0uniFEF1uniFEF2uniFEF3uniFEF4uniFEF5uniFEF6uniFEF7uniFEF8uniFEF9uniFEFAuniFEFBuniFEFCuniFEFFuniFFF9uniFFFAuniFFFBuniFFFCuniFFFDu10300u10301u10302u10303u10304u10305u10306u10307u10308u10309u1030Au1030Bu1030Cu1030Du1030Eu1030Fu10310u10311u10312u10313u10314u10315u10316u10317u10318u10319u1031Au1031Bu1031Cu1031Du1031Eu10320u10321u10322u10323u1D300u1D301u1D302u1D303u1D304u1D305u1D306u1D307u1D308u1D309u1D30Au1D30Bu1D30Cu1D30Du1D30Eu1D30Fu1D310u1D311u1D312u1D313u1D314u1D315u1D316u1D317u1D318u1D319u1D31Au1D31Bu1D31Cu1D31Du1D31Eu1D31Fu1D320u1D321u1D322u1D323u1D324u1D325u1D326u1D327u1D328u1D329u1D32Au1D32Bu1D32Cu1D32Du1D32Eu1D32Fu1D330u1D331u1D332u1D333u1D334u1D335u1D336u1D337u1D338u1D339u1D33Au1D33Bu1D33Cu1D33Du1D33Eu1D33Fu1D340u1D341u1D342u1D343u1D344u1D345u1D346u1D347u1D348u1D349u1D34Au1D34Bu1D34Cu1D34Du1D34Eu1D34Fu1D350u1D351u1D352u1D353u1D354u1D355u1D356u1D538u1D539u1D53Bu1D53Cu1D53Du1D53Eu1D540u1D541u1D542u1D543u1D544u1D546u1D54Au1D54Bu1D54Cu1D54Du1D54Eu1D54Fu1D550u1D552u1D553u1D554u1D555u1D556u1D557u1D558u1D559u1D55Au1D55Bu1D55Cu1D55Du1D55Eu1D55Fu1D560u1D561u1D562u1D563u1D564u1D565u1D566u1D567u1D568u1D569u1D56Au1D56Bu1D5A0u1D5A1u1D5A2u1D5A3u1D5A4u1D5A5u1D5A6u1D5A7u1D5A8u1D5A9u1D5AAu1D5ABu1D5ACu1D5ADu1D5AEu1D5AFu1D5B0u1D5B1u1D5B2u1D5B3u1D5B4u1D5B5u1D5B6u1D5B7u1D5B8u1D5B9u1D5BAu1D5BBu1D5BCu1D5BDu1D5BEu1D5BFu1D5C0u1D5C1u1D5C2u1D5C3u1D5C4u1D5C5u1D5C6u1D5C7u1D5C8u1D5C9u1D5CAu1D5CBu1D5CCu1D5CDu1D5CEu1D5CFu1D5D0u1D5D1u1D5D2u1D5D3u1D7D8u1D7D9u1D7DAu1D7DBu1D7DCu1D7DDu1D7DEu1D7DFu1D7E0u1D7E1u1D7E2u1D7E3u1D7E4u1D7E5u1D7E6u1D7E7u1D7E8u1D7E9u1D7EAu1D7EBu1EE00u1EE01u1EE02u1EE03u1EE05u1EE06u1EE07u1EE08u1EE09u1EE0Au1EE0Bu1EE0Cu1EE0Du1EE0Eu1EE0Fu1EE10u1EE11u1EE12u1EE13u1EE14u1EE15u1EE16u1EE17u1EE18u1EE19u1EE1Au1EE1Bu1EE1Cu1EE1Du1EE1Eu1EE1Fu1EE21u1EE22u1EE24u1EE27u1EE29u1EE2Au1EE2Bu1EE2Cu1EE2Du1EE2Eu1EE2Fu1EE30u1EE31u1EE32u1EE34u1EE35u1EE36u1EE37u1EE39u1EE3Bu1EE61u1EE62u1EE64u1EE67u1EE68u1EE69u1EE6Au1EE6Cu1EE6Du1EE6Eu1EE6Fu1EE70u1EE71u1EE72u1EE74u1EE75u1EE76u1EE77u1EE79u1EE7Au1EE7Bu1EE7Cu1EE7Eu1F030u1F031u1F032u1F033u1F034u1F035u1F036u1F037u1F038u1F039u1F03Au1F03Bu1F03Cu1F03Du1F03Eu1F03Fu1F040u1F041u1F042u1F043u1F044u1F045u1F046u1F047u1F048u1F049u1F04Au1F04Bu1F04Cu1F04Du1F04Eu1F04Fu1F050u1F051u1F052u1F053u1F054u1F055u1F056u1F057u1F058u1F059u1F05Au1F05Bu1F05Cu1F05Du1F05Eu1F05Fu1F060u1F061u1F062u1F063u1F064u1F065u1F066u1F067u1F068u1F069u1F06Au1F06Bu1F06Cu1F06Du1F06Eu1F06Fu1F070u1F071u1F072u1F073u1F074u1F075u1F076u1F077u1F078u1F079u1F07Au1F07Bu1F07Cu1F07Du1F07Eu1F07Fu1F080u1F081u1F082u1F083u1F084u1F085u1F086u1F087u1F088u1F089u1F08Au1F08Bu1F08Cu1F08Du1F08Eu1F08Fu1F090u1F091u1F092u1F093u1F0A0u1F0A1u1F0A2u1F0A3u1F0A4u1F0A5u1F0A6u1F0A7u1F0A8u1F0A9u1F0AAu1F0ABu1F0ACu1F0ADu1F0AEu1F0B1u1F0B2u1F0B3u1F0B4u1F0B5u1F0B6u1F0B7u1F0B8u1F0B9u1F0BAu1F0BBu1F0BCu1F0BDu1F0BEu1F0C1u1F0C2u1F0C3u1F0C4u1F0C5u1F0C6u1F0C7u1F0C8u1F0C9u1F0CAu1F0CBu1F0CCu1F0CDu1F0CEu1F0CFu1F0D1u1F0D2u1F0D3u1F0D4u1F0D5u1F0D6u1F0D7u1F0D8u1F0D9u1F0DAu1F0DBu1F0DCu1F0DDu1F0DEu1F0DFu1F42Du1F42Eu1F431u1F435u1F600u1F601u1F602u1F603u1F604u1F605u1F606u1F607u1F608u1F609u1F60Au1F60Bu1F60Cu1F60Du1F60Eu1F60Fu1F610u1F611u1F612u1F613u1F614u1F615u1F616u1F617u1F618u1F619u1F61Au1F61Bu1F61Cu1F61Du1F61Eu1F61Fu1F620u1F621u1F622u1F623u1F625u1F626u1F627u1F628u1F629u1F62Au1F62Bu1F62Du1F62Eu1F62Fu1F630u1F631u1F632u1F633u1F634u1F635u1F636u1F637u1F638u1F639u1F63Au1F63Bu1F63Cu1F63Du1F63Eu1F63Fu1F640 dlLtcaronDieresisAcuteTildeGrave CircumflexCaron uni0311.caseBreve Dotaccent Hungarumlaut Doublegrave arabic_dot arabic_2dots arabic_3dotsarabic_3dots_aarabic_2dots_a arabic_4dots uni066E.fina uni066E.init uni066E.medi uni06A1.fina uni06A1.init uni06A1.medi uni066F.fina uni066F.init uni066F.medi uni06BA.init uni06BA.medi arabic_ring uni067C.fina uni067C.init uni067C.medi uni067D.fina uni067D.init uni067D.medi uni0681.fina uni0681.init uni0681.medi uni0682.fina uni0682.init uni0682.medi uni0685.fina uni0685.init uni0685.medi uni06BF.fina uni06BF.init uni06BF.mediarabic_gaf_barEng.altuni0268.dotlessuni029D.dotless uni03080304 uni03040308 uni03070304 uni03080301 uni03080300 uni03040301 uni03040300 uni03030304 uni0308030C uni03030308 uni030C0307 uni03030301 uni03020301 uni03020300 uni03020303 uni03060303 uni03060301 uni03060300 uni03060309 uni03020309 uni03010307 brailledotJ.alt uni0695.finauniFEAE.fina.longstart uni06B5.fina uni06B5.init uni06B5.medi uni06CE.fina uni06CE.init uni06CE.medi uni0692.final.alt uni06D5.finauni0478.monographuni0479.monographiogonek.dotlessuni2148.dotlessuni2149.dotlessuni1E2D.dotlessuni1ECB.dotlessdcoI.alt arrow.base uni0651064B uni0651064C uni064B0651 uni0651064E uni0651064F uni064E0651 uni0654064E uni0654064F uni07CA.fina uni07CA.medi uni07CA.init uni07CB.fina uni07CB.medi uni07CB.init uni07CC.fina uni07CC.medi uni07CC.init uni07CD.fina uni07CD.medi uni07CD.init uni07CE.fina uni07CE.medi uni07CE.init uni07CF.fina uni07CF.medi uni07CF.init uni07D0.fina uni07D0.medi uni07D0.init uni07D1.fina uni07D1.medi uni07D1.init uni07D2.fina uni07D2.medi uni07D2.init uni07D3.fina uni07D3.medi uni07D3.init uni07D4.fina uni07D4.medi uni07D4.init uni07D5.fina uni07D5.medi uni07D5.init uni07D6.fina uni07D6.medi uni07D6.init uni07D7.fina uni07D7.medi uni07D7.init uni07D8.fina uni07D8.medi uni07D8.init uni07D9.fina uni07D9.medi uni07D9.init uni07DA.fina uni07DA.medi uni07DA.init uni07DB.fina uni07DB.medi uni07DB.init uni07DC.fina uni07DC.medi uni07DC.init uni07DD.fina uni07DD.medi uni07DD.init uni07DE.fina uni07DE.medi uni07DE.init uni07DF.fina uni07DF.medi uni07DF.init uni07E0.fina uni07E0.medi uni07E0.init uni07E1.fina uni07E1.medi uni07E1.init uni07E2.fina uni07E2.medi uni07E2.init uni07E3.fina uni07E3.medi uni07E3.init uni07E4.fina uni07E4.medi uni07E4.init uni07E5.fina uni07E5.medi uni07E5.init uni07E6.fina uni07E6.medi uni07E6.init uni07E7.fina uni07E7.medi uni07E7.init Ringabove uni2630.alt uni2631.alt uni2632.alt uni2633.alt uni2634.alt uni2635.alt uni2636.alt uni2637.alt uni047E.diacuni048A.brevelessuni048B.brevelessy.alt uni0689.fina uni068A.fina uni068B.fina uni068F.fina uni0690.fina uni0693.fina uni0694.fina uni0696.fina uni0697.fina uni0699.fina uni069A.fina uni069A.init uni069A.medi uni069B.fina uni069B.init uni069B.medi uni069C.fina uni069C.init uni069C.medi uni069D.fina uni069D.init uni069D.medi uni069E.fina uni069E.init uni069E.medi uni069F.fina uni069F.init uni069F.medi uni06A0.fina uni06A0.init uni06A0.medi uni06A2.fina uni06A2.init uni06A2.medi uni06A3.fina uni06A3.init uni06A3.medi uni06A5.fina uni06A5.init uni06A5.medi uni06A7.fina uni06A7.init uni06A7.medi uni06A8.fina uni06A8.init uni06A8.medi uni06AA.fina uni06AA.init uni06AA.medi uni06AB.fina uni06AB.init uni06AB.medi uni06AC.fina uni06AC.init uni06AC.medi uni06AE.fina uni06AE.init uni06AE.medi uni06B0.fina uni06B0.init uni06B0.medi uni06B2.fina uni06B2.init uni06B2.medi uni06B4.fina uni06B4.init uni06B4.medi uni06B6.fina uni06B6.init uni06B6.medi uni06B7.fina uni06B7.init uni06B7.medi uni06B8.fina uni06B8.init uni06B8.medi uni06B9.fina uni06B9.init uni06B9.medi uni06BC.fina uni06BC.init uni06BC.medi uni06BD.fina uni06BD.init uni06BD.mediexclamdown.casequestiondown.case uni2E18.caseuni066E.init.mathproduct.displayuni2210.displaysummation.displayintegral.displayuni222C.displayuni222D.displayuni222E.displayuni222F.displayuni2230.displayuni2231.displayuni2232.displayuni2233.displayuni22C0.displayuni22C1.displayuni22C2.displayuni22C3.displayuni2A00.displayuni2A01.displayuni2A02.displayuni2A0C.displayuni2A0D.displayuni2A0E.displayuni2A0F.displayuni2A10.displayuni2A11.displayuni2A12.displayuni2A13.displayuni2A14.displayuni2A15.displayuni2A16.displayuni2A17.displayuni2A18.displayuni2A19.displayuni2A1A.displayuni2A1B.displayuni2A1C.display¸€@ÿûþúù%ø2÷–öõþôþó%òñ–ð%ïŠAïþî–í–ìúëúêþé:èBçþæ2åäSå–äŠAäSãâ/ãúâ/áþàþß2ÞÝ–ÜþÛÚ}Ù»ØþÖŠAÖ}ÕÔGÕ}ÔGÓÒÓþÒÑþÐþÏþÎþÍ–ÌËÌþËÊ2ÉþÆ…ÆÅÄþÃþÂþÁþÀþ¿þ¾þ½þ¼þ»þº¹†%¹þ¸·»¸þ·¶]·»·€¶µ%¶]@ÿ¶@µ%´þ³–²þ±þ°þ¯þ®d­¬«%¬d«ª«%ª©ŠA©ú¨þ§þ¦þ¥¤þ£¢£2¢¡d ŠA –Ÿþž žþ œ›œd›š›š™ ˜þ—– —þ– •ŠA•–”“”(“’ú‘»‘þ]»€Ž%]@Ž%þŒ‹.Œþ‹.І%ŠA‰ˆ ‰ˆ ‡†%‡d†…†%…„þƒ‚ƒþ‚þ€þþ@ÿ~}}~þ}}|d{T{%zþyþxw v uþtúsúrúqúpþoþnþl!kþjBjSiþh}gBfþeþdþcþbþa:`ú^ ]þ[þZþYX YúX WW2VþUTUBTSSRQJQþP OþNMNþMLþKJKþJIJI IH GþF–E–DþC-CúB»AK@þ?þ>=>=<=<; <@ÿ; :þ9þ878ú76765 65 43 21 2þ1 0/ 0 / .- .- ,2+*%+d*)*%)('%(A'%&% &% $þ#þ"!! dú d BþúBBþdþþþþBþ-B}dþ  þ   þ  þ-þdþ@-þ-þ¸d…++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++pygame_sdl2-2.1.0-for-renpy-6.99.14.1/src/pygame_sdl2/error.pyx0000664000175000017500000000246512651171710023146 0ustar tomtom00000000000000# Copyright 2014 Tom Rothamel # # This software is provided 'as-is', without any express or implied # warranty. In no event will the authors be held liable for any damages # arising from the use of this software. # # Permission is granted to anyone to use this software for any purpose, # including commercial applications, and to alter it and redistribute it # freely, subject to the following restrictions: # # 1. The origin of this software must not be misrepresented; you must not # claim that you wrote the original software. If you use this software # in a product, an acknowledgment in the product documentation would be # appreciated but is not required. # 2. Altered source versions must be plainly marked as such, and must not be # misrepresented as being the original software. # 3. This notice may not be removed or altered from any source distribution. from sdl2 cimport * class error(RuntimeError): def __init__(self, message=None): if message is None: message = str(SDL_GetError()) RuntimeError.__init__(self, message) def get_error(): cdef const char *message = SDL_GetError() if message: return str(message) else: return '' def set_error(message): message = bytes(message) SDL_SetError("%s", message) pygame_sdl2-2.1.0-for-renpy-6.99.14.1/src/pygame_sdl2/key.pyx0000664000175000017500000000627112507776671022625 0ustar tomtom00000000000000# Copyright 2014 Patrick Dawson # # This software is provided 'as-is', without any express or implied # warranty. In no event will the authors be held liable for any damages # arising from the use of this software. # # Permission is granted to anyone to use this software for any purpose, # including commercial applications, and to alter it and redistribute it # freely, subject to the following restrictions: # # 1. The origin of this software must not be misrepresented; you must not # claim that you wrote the original software. If you use this software # in a product, an acknowledgment in the product documentation would be # appreciated but is not required. # 2. Altered source versions must be plainly marked as such, and must not be # misrepresented as being the original software. # 3. This notice may not be removed or altered from any source distribution. from sdl2 cimport * from libc.stdlib cimport malloc, free from libc.string cimport memcpy from pygame_sdl2.display cimport Window, main_window from pygame_sdl2.rect cimport to_sdl_rect from pygame_sdl2.error import error cdef class KeyboardState: # Allow weak references. cdef object __weakref__ cdef uint8_t *data cdef int numkeys def __cinit__(self): self.data = NULL def __dealloc__(self): if self.data != NULL: free(self.data) def __init__(self): cdef uint8_t *state = SDL_GetKeyboardState(&self.numkeys) if state == NULL: raise error() # Take a snapshot of the current state, rather than saving the pointer. self.data = malloc(self.numkeys) memcpy(self.data, state, self.numkeys) def __getitem__(self, int key): if SDLK_DELETE < key < SDLK_CAPSLOCK: raise IndexError("Out of range.") cdef int sc = SDL_GetScancodeFromKey(key) if sc > self.numkeys: raise IndexError("Out of range.") return self.data[sc] def get_focused(): return SDL_GetKeyboardFocus() != NULL def get_pressed(): """ No longer returns a tuple. Use the returned object to check for individual keys, but don't loop through it. """ return KeyboardState() def get_mods(): return SDL_GetModState() def set_mods(state): SDL_SetModState(state) def set_repeat(delay=0, interval=0): # Not possible with SDL2. pass def get_repeat(): # Not possible with SDL2. return (0,0) def name(key): return SDL_GetKeyName(key) text_input = False def start_text_input(): global text_input text_input = True if SDL_HasScreenKeyboardSupport(): SDL_StartTextInput() def stop_text_input(): global text_input text_input = False if SDL_HasScreenKeyboardSupport(): SDL_StopTextInput() def set_text_input_rect(rect): cdef SDL_Rect sdl_rect; if rect is not None: to_sdl_rect(rect, &sdl_rect) SDL_SetTextInputRect(&sdl_rect) else: SDL_SetTextInputRect(NULL) def has_screen_keyboard_support(): return SDL_HasScreenKeyboardSupport() def is_screen_keyboard_shown(Window window=None): if window is None: window = main_window return SDL_IsScreenKeyboardShown(window.window) pygame_sdl2-2.1.0-for-renpy-6.99.14.1/src/pygame_sdl2/pygame_sdl2.h0000664000175000017500000000075112432026574023632 0ustar tomtom00000000000000#ifndef PYGAME_SDL2_H #define PYGAME_SDL2_H #include "pygame_sdl2/pygame_sdl2.rwobject_api.h" #include "pygame_sdl2/pygame_sdl2.surface_api.h" #include "pygame_sdl2/pygame_sdl2.display_api.h" /** * This imports the pygame_sdl2 C api. It returns 0 if the import succeeds, or * 1 if it fails. */ static int import_pygame_sdl2(void) { int rv = 0; rv |= import_pygame_sdl2__rwobject(); rv |= import_pygame_sdl2__surface(); rv |= import_pygame_sdl2__display(); return rv; } #endif pygame_sdl2-2.1.0-for-renpy-6.99.14.1/src/pygame_sdl2/scrap.pyx0000664000175000017500000000327512507777465023150 0ustar tomtom00000000000000# Copyright 2014 Patrick Dawson # # This software is provided 'as-is', without any express or implied # warranty. In no event will the authors be held liable for any damages # arising from the use of this software. # # Permission is granted to anyone to use this software for any purpose, # including commercial applications, and to alter it and redistribute it # freely, subject to the following restrictions: # # 1. The origin of this software must not be misrepresented; you must not # claim that you wrote the original software. If you use this software # in a product, an acknowledgment in the product documentation would be # appreciated but is not required. # 2. Altered source versions must be plainly marked as such, and must not be # misrepresented as being the original software. # 3. This notice may not be removed or altered from any source distribution. from sdl2 cimport * from pygame_sdl2.error import error from pygame_sdl2.locals import SCRAP_TEXT from pygame_sdl2.compat import bytes_ def init(): pass def get(type): cdef char *text = NULL if type == SCRAP_TEXT: text = SDL_GetClipboardText() if text == NULL: raise error() rv = bytes_(text) SDL_free(text) return rv else: raise error("Not implemented.") def get_types(): return [SCRAP_TEXT] def put(type, data): if type != SCRAP_TEXT: raise error("Not implemented.") data = bytes_(data) if SDL_SetClipboardText(data) != 0: raise error() def contains(type): if type != SCRAP_TEXT: return False return SDL_HasClipboardText() == SDL_TRUE def lost(): return False def set_mode(mode): pass pygame_sdl2-2.1.0-for-renpy-6.99.14.1/src/pygame_sdl2/threads/0000755000175000017500000000000013235720531022674 5ustar tomtom00000000000000pygame_sdl2-2.1.0-for-renpy-6.99.14.1/src/pygame_sdl2/threads/__init__.py0000664000175000017500000002100512426024513025003 0ustar tomtom00000000000000""" * Experimental * Like the map function, but can use a pool of threads. Really easy to use threads. eg. tmap(f, alist) If you know how to use the map function, you can use threads. """ __author__ = "Rene Dudfield" __version__ = "0.3.0" __license__ = 'Python license' import traceback, sys from pygame.compat import geterror if sys.version_info[0] == 3: from queue import Queue from queue import Empty elif (sys.version_info[0] == 2 and sys.version_info[1] < 5): from Py25Queue import Queue from Py25Queue import Empty else: # use up to date version from Queue import Queue from Queue import Empty import threading Thread = threading.Thread STOP = object() FINISH = object() # DONE_ONE = object() # DONE_TWO = object() # a default worker queue. _wq = None # if we are using threads or not. This is the number of workers. _use_workers = 0 # Set this to the maximum for the amount of Cores/CPUs # Note, that the tests early out. # So it should only test the best number of workers +2 MAX_WORKERS_TO_TEST = 64 def init(number_of_workers = 0): """ Does a little test to see if threading is worth it. Sets up a global worker queue if it's worth it. Calling init() is not required, but is generally better to do. """ global _wq, _use_workers if number_of_workers: _use_workers = number_of_workers else: _use_workers = benchmark_workers() # if it is best to use zero workers, then use that. _wq = WorkerQueue(_use_workers) def quit(): """ cleans up everything. """ global _wq, _use_workers _wq.stop() _wq = None _use_workers = False def benchmark_workers(a_bench_func = None, the_data = None): """ does a little test to see if workers are at all faster. Returns the number of workers which works best. Takes a little bit of time to run, so you should only really call it once. You can pass in benchmark data, and functions if you want. a_bench_func - f(data) the_data - data to work on. """ global _use_workers #TODO: try and make this scale better with slower/faster cpus. # first find some variables so that using 0 workers takes about 1.0 seconds. # then go from there. # note, this will only work with pygame 1.8rc3+ # replace the doit() and the_data with something that releases the GIL import pygame import pygame.transform import time if not a_bench_func: def doit(x): return pygame.transform.scale(x, (544, 576)) else: doit = a_bench_func if not the_data: thedata = [] for x in range(10): thedata.append(pygame.Surface((155,155), 0, 32)) else: thedata = the_data best = time.time() + 100000000 best_number = 0 last_best = -1 for num_workers in range(0, MAX_WORKERS_TO_TEST): wq = WorkerQueue(num_workers) t1 = time.time() for xx in range(20): print ("active count:%s" % threading.activeCount()) results = tmap(doit, thedata, worker_queue = wq) t2 = time.time() wq.stop() total_time = t2 - t1 print ("total time num_workers:%s: time:%s:" % (num_workers, total_time)) if total_time < best: last_best = best_number best_number =num_workers best = total_time if num_workers - best_number > 1: # We tried to add more, but it didn't like it. # so we stop with testing at this number. break return best_number class WorkerQueue(object): def __init__(self, num_workers = 20): self.queue = Queue() self.pool = [] self._setup_workers(num_workers) def _setup_workers(self, num_workers): """ Sets up the worker threads NOTE: undefined behaviour if you call this again. """ self.pool = [] for _ in range(num_workers): self.pool.append(Thread(target=self.threadloop)) for a_thread in self.pool: a_thread.setDaemon(True) a_thread.start() def do(self, f, *args, **kwArgs): """ puts a function on a queue for running later. """ self.queue.put((f, args, kwArgs)) def stop(self): """ Stops the WorkerQueue, waits for all of the threads to finish up. """ self.queue.put(STOP) for thread in self.pool: thread.join() def threadloop(self): #, finish = False): """ Loops until all of the tasks are finished. """ while True: args = self.queue.get() if args is STOP: self.queue.put(STOP) self.queue.task_done() break else: try: args[0](*args[1], **args[2]) finally: # clean up the queue, raise the exception. self.queue.task_done() #raise def wait(self): """ waits until all tasks are complete. """ self.queue.join() class FuncResult: """ Used for wrapping up a function call so that the results are stored inside the instances result attribute. """ def __init__(self, f, callback = None, errback = None): """ f - is the function we that we call callback(result) - this is called when the function(f) returns errback(exception) - this is called when the function(f) raises an exception. """ self.f = f self.exception = None self.callback = callback self.errback = errback def __call__(self, *args, **kwargs): #we try to call the function here. If it fails we store the exception. try: self.result = self.f(*args, **kwargs) if self.callback: self.callback(self.result) except Exception: self.exception = geterror() if self.errback: self.errback(self.exception) def tmap(f, seq_args, num_workers = 20, worker_queue = None, wait = True, stop_on_error = True): """ like map, but uses a thread pool to execute. num_workers - the number of worker threads that will be used. If pool is passed in, then the num_workers arg is ignored. worker_queue - you can optionally pass in an existing WorkerQueue. wait - True means that the results are returned when everything is finished. False means that we return the [worker_queue, results] right away instead. results, is returned as a list of FuncResult instances. stop_on_error - """ if worker_queue: wq = worker_queue else: # see if we have a global queue to work with. if _wq: wq = _wq else: if num_workers == 0: return map(f, seq_args) wq = WorkerQueue(num_workers) # we short cut it here if the number of workers is 0. # normal map should be faster in this case. if len(wq.pool) == 0: return map(f, seq_args) #print ("queue size:%s" % wq.queue.qsize()) #TODO: divide the data (seq_args) into even chunks and # then pass each thread a map(f, equal_part(seq_args)) # That way there should be less locking, and overhead. results = [] for sa in seq_args: results.append(FuncResult(f)) wq.do(results[-1], sa) #wq.stop() if wait: #print ("wait") wq.wait() #print ("after wait") #print ("queue size:%s" % wq.queue.qsize()) if wq.queue.qsize(): raise Exception("buggy threadmap") # if we created a worker queue, we need to stop it. if not worker_queue and not _wq: #print ("stoping") wq.stop() if wq.queue.qsize(): um = wq.queue.get() if not um is STOP: raise Exception("buggy threadmap") # see if there were any errors. If so raise the first one. This matches map behaviour. # TODO: the traceback doesn't show up nicely. # NOTE: TODO: we might want to return the results anyway? This should be an option. if stop_on_error: error_ones = list(filter(lambda x:x.exception, results)) if error_ones: raise error_ones[0].exception return map(lambda x:x.result, results) else: return [wq, results] pygame_sdl2-2.1.0-for-renpy-6.99.14.1/src/pygame_sdl2/threads/Py25Queue.py0000664000175000017500000001711712426024513025021 0ustar tomtom00000000000000"""A multi-producer, multi-consumer queue.""" from time import time as _time from collections import deque __all__ = ['Empty', 'Full', 'Queue'] class Empty(Exception): "Exception raised by Queue.get(block=0)/get_nowait()." pass class Full(Exception): "Exception raised by Queue.put(block=0)/put_nowait()." pass class Queue: """Create a queue object with a given maximum size. If maxsize is <= 0, the queue size is infinite. """ def __init__(self, maxsize=0): try: import threading except ImportError: import dummy_threading as threading self._init(maxsize) # mutex must be held whenever the queue is mutating. All methods # that acquire mutex must release it before returning. mutex # is shared between the three conditions, so acquiring and # releasing the conditions also acquires and releases mutex. self.mutex = threading.Lock() # Notify not_empty whenever an item is added to the queue; a # thread waiting to get is notified then. self.not_empty = threading.Condition(self.mutex) # Notify not_full whenever an item is removed from the queue; # a thread waiting to put is notified then. self.not_full = threading.Condition(self.mutex) # Notify all_tasks_done whenever the number of unfinished tasks # drops to zero; thread waiting to join() is notified to resume self.all_tasks_done = threading.Condition(self.mutex) self.unfinished_tasks = 0 def task_done(self): """Indicate that a formerly enqueued task is complete. Used by Queue consumer threads. For each get() used to fetch a task, a subsequent call to task_done() tells the queue that the processing on the task is complete. If a join() is currently blocking, it will resume when all items have been processed (meaning that a task_done() call was received for every item that had been put() into the queue). Raises a ValueError if called more times than there were items placed in the queue. """ self.all_tasks_done.acquire() try: unfinished = self.unfinished_tasks - 1 if unfinished <= 0: if unfinished < 0: raise ValueError('task_done() called too many times') self.all_tasks_done.notifyAll() self.unfinished_tasks = unfinished finally: self.all_tasks_done.release() def join(self): """Blocks until all items in the Queue have been gotten and processed. The count of unfinished tasks goes up whenever an item is added to the queue. The count goes down whenever a consumer thread calls task_done() to indicate the item was retrieved and all work on it is complete. When the count of unfinished tasks drops to zero, join() unblocks. """ self.all_tasks_done.acquire() try: while self.unfinished_tasks: self.all_tasks_done.wait() finally: self.all_tasks_done.release() def qsize(self): """Return the approximate size of the queue (not reliable!).""" self.mutex.acquire() n = self._qsize() self.mutex.release() return n def empty(self): """Return True if the queue is empty, False otherwise (not reliable!).""" self.mutex.acquire() n = self._empty() self.mutex.release() return n def full(self): """Return True if the queue is full, False otherwise (not reliable!).""" self.mutex.acquire() n = self._full() self.mutex.release() return n def put(self, item, block=True, timeout=None): """Put an item into the queue. If optional args 'block' is true and 'timeout' is None (the default), block if necessary until a free slot is available. If 'timeout' is a positive number, it blocks at most 'timeout' seconds and raises the Full exception if no free slot was available within that time. Otherwise ('block' is false), put an item on the queue if a free slot is immediately available, else raise the Full exception ('timeout' is ignored in that case). """ self.not_full.acquire() try: if not block: if self._full(): raise Full elif timeout is None: while self._full(): self.not_full.wait() else: if timeout < 0: raise ValueError("'timeout' must be a positive number") endtime = _time() + timeout while self._full(): remaining = endtime - _time() if remaining <= 0.0: raise Full self.not_full.wait(remaining) self._put(item) self.unfinished_tasks += 1 self.not_empty.notify() finally: self.not_full.release() def put_nowait(self, item): """Put an item into the queue without blocking. Only enqueue the item if a free slot is immediately available. Otherwise raise the Full exception. """ return self.put(item, False) def get(self, block=True, timeout=None): """Remove and return an item from the queue. If optional args 'block' is true and 'timeout' is None (the default), block if necessary until an item is available. If 'timeout' is a positive number, it blocks at most 'timeout' seconds and raises the Empty exception if no item was available within that time. Otherwise ('block' is false), return an item if one is immediately available, else raise the Empty exception ('timeout' is ignored in that case). """ self.not_empty.acquire() try: if not block: if self._empty(): raise Empty elif timeout is None: while self._empty(): self.not_empty.wait() else: if timeout < 0: raise ValueError("'timeout' must be a positive number") endtime = _time() + timeout while self._empty(): remaining = endtime - _time() if remaining <= 0.0: raise Empty self.not_empty.wait(remaining) item = self._get() self.not_full.notify() return item finally: self.not_empty.release() def get_nowait(self): """Remove and return an item from the queue without blocking. Only get an item if one is immediately available. Otherwise raise the Empty exception. """ return self.get(False) # Override these methods to implement other queue organizations # (e.g. stack or priority queue). # These will only be called with appropriate locks held # Initialize the queue representation def _init(self, maxsize): self.maxsize = maxsize self.queue = deque() def _qsize(self): return len(self.queue) # Check whether the queue is empty def _empty(self): return not self.queue # Check whether the queue is full def _full(self): return self.maxsize > 0 and len(self.queue) == self.maxsize # Put a new item in the queue def _put(self, item): self.queue.append(item) # Get an item from the queue def _get(self): return self.queue.popleft() pygame_sdl2-2.1.0-for-renpy-6.99.14.1/src/pygame_sdl2/joystick.pyx0000664000175000017500000001020612612740672023652 0ustar tomtom00000000000000# Copyright 2014 Patrick Dawson # # This software is provided 'as-is', without any express or implied # warranty. In no event will the authors be held liable for any damages # arising from the use of this software. # # Permission is granted to anyone to use this software for any purpose, # including commercial applications, and to alter it and redistribute it # freely, subject to the following restrictions: # # 1. The origin of this software must not be misrepresented; you must not # claim that you wrote the original software. If you use this software # in a product, an acknowledgment in the product documentation would be # appreciated but is not required. # 2. Altered source versions must be plainly marked as such, and must not be # misrepresented as being the original software. # 3. This notice may not be removed or altered from any source distribution. from sdl2 cimport * from pygame_sdl2.error import error import pygame_sdl2 @pygame_sdl2.register_init def init(): pygame_sdl2.display.sdl_main_init() if SDL_InitSubSystem(SDL_INIT_JOYSTICK): raise error() @pygame_sdl2.register_quit def quit(): # @ReservedAssignment SDL_QuitSubSystem(SDL_INIT_JOYSTICK) def get_init(): return SDL_WasInit(SDL_INIT_JOYSTICK) != 0 def get_count(): return SDL_NumJoysticks() cdef class Joystick: # Allow weak references. cdef object __weakref__ cdef SDL_Joystick *joystick cdef int joyid def __cinit__(self): self.joystick = NULL def __init__(self, id): self.joyid = id def init(self): if self.joystick == NULL: self.joystick = SDL_JoystickOpen(self.joyid) if self.joystick == NULL: raise error() def quit(self): # @ReservedAssignment if self.joystick != NULL: SDL_JoystickClose(self.joystick) self.joystick = NULL def get_init(self): if self.joystick: return True else: return False def get_id(self): if self.joystick == NULL: raise error("joystick not initialized") return SDL_JoystickInstanceID(self.joystick) def get_name(self): cdef char *rv if self.joystick == NULL: raise error("joystick not initialized") rv = SDL_JoystickName(self.joystick) if rv: return rv else: return None def get_numaxes(self): if self.joystick == NULL: raise error("joystick not initialized") return SDL_JoystickNumAxes(self.joystick) def get_numballs(self): if self.joystick == NULL: raise error("joystick not initialized") return SDL_JoystickNumBalls(self.joystick) def get_numbuttons(self): if self.joystick == NULL: raise error("joystick not initialized") return SDL_JoystickNumButtons(self.joystick) def get_numhats(self): if self.joystick == NULL: raise error("joystick not initialized") return SDL_JoystickNumHats(self.joystick) def get_axis(self, axis_number): if self.joystick == NULL: raise error("joystick not initialized") return SDL_JoystickGetAxis(self.joystick, axis_number) / 32768.0 def get_ball(self, ball_number): cdef int dx, dy if self.joystick == NULL: raise error("joystick not initialized") if SDL_JoystickGetBall(self.joystick, ball_number, &dx, &dy) == 0: return (dx, dy) else: raise error() def get_button(self, button): if self.joystick == NULL: raise error("joystick not initialized") return SDL_JoystickGetButton(self.joystick, button) == 1 def get_hat(self, hat_number): if self.joystick == NULL: raise error("joystick not initialized") state = SDL_JoystickGetHat(self.joystick, hat_number) hx = hy = 0 if state & SDL_HAT_LEFT: hx = -1 elif state & SDL_HAT_RIGHT: hx = 1 if state & SDL_HAT_UP: hy = 1 elif state & SDL_HAT_DOWN: hy = -1 return (hx, hy) pygame_sdl2-2.1.0-for-renpy-6.99.14.1/src/pygame_sdl2/sysfont.py0000664000175000017500000006356512650051100023327 0ustar tomtom00000000000000## pygame - Python Game Library ## Copyright (C) 2000-2003 Pete Shinners ## ## This library is free software; you can redistribute it and/or ## modify it under the terms of the GNU Library General Public ## License as published by the Free Software Foundation; either ## version 2 of the License, or (at your option) any later version. ## ## This library is distributed in the hope that it will be useful, ## but WITHOUT ANY WARRANTY; without even the implied warranty of ## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU ## Library General Public License for more details. ## ## You should have received a copy of the GNU Library General Public ## License along with this library; if not, write to the Free ## Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA ## ## Pete Shinners ## pete@shinners.org import glob "sysfont, used in the font module to find system fonts" import os, sys #Python 3 compatibility try: bytes except NameError: def toascii(raw): return raw.decode('ascii', 'ignore').encode('ascii') else: def toascii(raw): return raw.decode('ascii', 'ignore') #create simple version of the font name def _simplename(name): return ''.join([c.lower() for c in name if c.isalnum()]) #insert a font and style into the font dictionary def _addfont(name, bold, italic, font, fontdict): if name not in fontdict: fontdict[name] = {} fontdict[name][bold, italic] = font #read the fonts on windows # Info taken from: # http://www.microsoft.com/typography/fonts/winxp.htm # with extra files added from: # http://www.ampsoft.net/webdesign-l/windows-fonts-by-version.html # File name, family, (Bold, Italic) _XP_default_font_files = [ ('ahronbd.ttf', 'Aharoni', True, False), ('andlso.ttf', 'Andalus', False, False), ('angsa.ttf', 'Angsana New', False, False), ('angsab.ttf', 'Angsana New', True, False), ('angsai.ttf', 'Angsana New', False, True), ('angsaz.ttf', 'Angsana New', True, True), ('angsau.ttf', 'AngsanaUPC', False, False), ('angsaub.ttf', 'AngsanaUPC', True, False), ('angsaui.ttf', 'AngsanaUPC', False, True), ('angsauz.ttf', 'AngsanaUPC', True, True), ('artro.ttf', 'Arabic Transparent', False, False), ('artrbdo.ttf', 'Arabic Transparent', True, False), ('agatha.ttf', 'Agatha', False, False), ('arial.ttf', 'Arial', False, False), ('arialbd.ttf', 'Arial', True, False), ('ariali.ttf', 'Arial', False, True), ('arialbi.ttf', 'Arial', True, True), ('ariblk.ttf', 'Arial Black', False, False), ('browa.ttf', 'Browallia New', False, False), ('browab.ttf', 'Browallia New', True, False), ('browai.ttf', 'Browallia New', False, True), ('browaz.ttf', 'Browallia New', True, True), ('browau.ttf', 'BrowalliaUPC', False, False), ('browaub.ttf', 'BrowalliaUPC', True, False), ('browaui.ttf', 'BrowalliaUPC', False, True), ('browauz.ttf', 'BrowalliaUPC', True, True), ('comic.ttf', 'Comic Sans MS', False, False), ('comicbd.ttf', 'Comic Sans MS', True, False), ('cordia.ttf', 'Cordia New', False, False), ('cordiab.ttf', 'Cordia New', True, False), ('cordiai.ttf', 'Cordia New', False, True), ('cordiaz.ttf', 'Cordia New', True, True), ('cordiau.ttf', 'CordiaUPC', False, False), ('cordiaub.ttf', 'CordiaUPC', True, False), ('cordiaui.ttf', 'CordiaUPC', False, True), ('cordiauz.ttf', 'CordiaUPC', True, True), ('cour.ttf', 'Courier New', False, False), ('courbd.ttf', 'Courier New', True, False), ('couri.ttf', 'Courier New', False, True), ('courbi.ttf', 'Courier New', True, True), ('david.ttf', 'David', False, False), ('davidbd.ttf', 'David', True, False), ('davidtr.ttf', 'David Transparent', False, False), ('upcdl.ttf', 'DilleniaUPC', False, False), ('upcdb.ttf', 'DilleniaUPC', True, False), ('upcdi.ttf', 'DilleniaUPC', False, True), ('upcdbi.ttf', 'DilleniaUPC', True, True), ('estre.ttf', 'Estrangelo Edessa', False, False), ('upcel.ttf', 'EucrosialUPC', False, False), ('upceb.ttf', 'EucrosialUPC', True, False), ('upcei.ttf', 'EucrosialUPC', False, True), ('upcebi.ttf', 'EucrosialUPC', True, True), ('mriamfx.ttf', 'Fixed Miriam Transparent', False, False), ('framd.ttf', 'Franklin Gothic Medium', False, False), ('framdit.ttf', 'Franklin Gothic Medium', False, True), ('frank.ttf', 'FrankRuehl', False, False), ('upcfl.ttf', 'FreesialUPC', False, False), ('upcfb.ttf', 'FreesialUPC', True, False), ('upcfi.ttf', 'FreesialUPC', False, True), ('upcfbi.ttf', 'FreesialUPC', True, True), ('gautami.ttf', 'Gautami', False, False), ('georgia.ttf', 'Georgia', False, False), ('georgiab.ttf', 'Georgia', True, False), ('georgiai.ttf', 'Georgia', False, True), ('georgiaz.ttf', 'Georgia', True, True), ('impact.ttf', 'Impact', False, False), ('upcil.ttf', 'IrisUPC', False, False), ('upcib.ttf', 'IrisUPC', True, False), ('upcii.ttf', 'IrisUPC', False, True), ('upcibi.ttf', 'IrisUPC', True, True), ('upcjl.ttf', 'JasmineUPC', False, False), ('upcjb.ttf', 'JasmineUPC', True, False), ('upcji.ttf', 'JasmineUPC', False, True), ('upcjbi.ttf', 'JasmineUPC', True, True), ('upckl.ttf', 'KodchiangUPC', False, False), ('upckb.ttf', 'KodchiangUPC', True, False), ('upcki.ttf', 'KodchiangUPC', False, True), ('upckbi.ttf', 'KodchiangUPC', True, True), ('latha.ttf', 'Latha', False, False), ('lvnm.ttf', 'Levenim MT', False, False), ('lvnmbd.ttf', 'Levenim MT', True, False), ('upcll.ttf', 'LilyUPC', False, False), ('upclb.ttf', 'LilyUPC', True, False), ('upcli.ttf', 'LilyUPC', False, True), ('upclbi.ttf', 'LilyUPC', True, True), ('lucon.ttf', 'Lucida Console', False, False), ('l_10646.ttf', 'Lucida Sans Unicode', False, False), ('mangal.ttf', 'Mangal', False, False), ('marlett.ttf', 'Marlett', False, False), ('micross.ttf', 'Microsoft Sans Serif', False, False), ('mriam.ttf', 'Miriam', False, False), ('mriamc.ttf', 'Miriam Fixed', False, False), ('mriamtr.ttf', 'Miriam Transparent', False, False), ('mvboli.ttf', 'MV Boli', False, False), ('nrkis.ttf', 'Narkisim', False, False), ('pala.ttf', 'Falatino Linotype', False, False), ('palab.ttf', 'Falatino Linotype', True, False), ('palai.ttf', 'Falatino Linotype', False, True), ('palabi.ttf', 'Falatino Linotype', True, True), ('raavi.ttf', 'Raavi', False, False), ('rod.ttf', 'Rod', False, False), ('rodtr.ttf', 'Rod Transparent', False, False), ('shruti.ttf', 'Shruti', False, False), ('simpo.ttf', 'Simplified Arabic', False, False), ('simpbdo.ttf', 'Simplified Arabic', True, False), ('simpfxo.ttf', 'Simplified Arabic Fixed', False, False), ('sylfaen.ttf', 'Sylfaen', False, False), ('symbol.ttf', 'Symbol', False, False), ('tahoma.ttf', 'Tahoma', False, False), ('tahomabd.ttf', 'Tahoma', True, False), ('times.ttf', 'Times New Roman', False, False), ('timesbd.ttf', 'Times New Roman', True, False), ('timesi.ttf', 'Times New Roman', False, True), ('timesbi.ttf', 'Times New Roman', True, True), ('trado.ttf', 'Traditional Arabic', False, False), ('tradbdo.ttf', 'Traditional Arabic', True, False), ('Trebuc.ttf', 'Trebuchet MS', False, False), ('Trebucbd.ttf', 'Trebuchet MS', True, False), ('Trebucit.ttf', 'Trebuchet MS', False, True), ('Trebucbi.ttf', 'Trebuchet MS', True, True), ('tunga.ttf', 'Tunga', False, False), ('verdana.ttf', 'Verdana', False, False), ('verdanab.ttf', 'Verdana', True, False), ('verdanai.ttf', 'Verdana', False, True), ('verdanaz.ttf', 'Verdana', True, True), ('webdings.ttf', 'Webdings', False, False), ('wingding.ttf', 'Wingdings', False, False), ('simhei.ttf', 'SimHei', False, False), ('simfang.ttf', 'FangSong_GB2312', False, False), ('kaiu.ttf', 'DFKai-SB', False, False), ('simkai.ttf', 'KaiTi_GB2312', False, False), ('msgothic.ttc', 'MS Gothic', False, False), ('msmincho.ttc', 'MS Mincho', False, False), ('gulim.ttc', 'Gulim', False, False), ('mingliu.ttc', 'Mingliu', False, False), ('simsun.ttc', 'Simsun', False, False), ('batang.ttc', 'Batang', False, False), ] def initsysfonts_win32(): try: import _winreg except ImportError: import winreg as _winreg if 'WINDIR' in os.environ: windir = os.environ['WINDIR'] elif 'windir' in os.environ: windir = os.environ['windir'] else: windir = "C:\\Windows\\" fonts = {} mods = 'demibold', 'narrow', 'light', 'unicode', 'bt', 'mt' fontdir = os.path.join(windir, "Fonts") #this is a list of registry keys containing information #about fonts installed on the system. keys = [] #add recognized fonts from the fonts directory because the default #fonts may not be entered in the registry. win_font_files_mapping = dict( [(file_name.lower(), (_simplename(name), bold, italic)) for file_name, name, bold, italic in _XP_default_font_files]) font_dir_path = os.path.join(windir, 'fonts') try: font_file_paths = glob.glob(os.path.join(font_dir_path, '*.tt?')) except Exception: pass else: for font in font_file_paths: file_name = os.path.basename(font) try: name, bold, italic = win_font_files_mapping[file_name] except KeyError: pass else: _addfont(name, bold, italic, font, fonts) #add additional fonts entered in the registry. #find valid registry keys containing font information. possible_keys = [ r"SOFTWARE\Microsoft\Windows\CurrentVersion\Fonts", r"SOFTWARE\Microsoft\Windows NT\CurrentVersion\Fonts", r"SOFTWARE\Microsoft\Windows[NT]\CurrentVersion\Fonts", ] for key_name in possible_keys: try: key = _winreg.OpenKey(_winreg.HKEY_LOCAL_MACHINE, key_name) keys.append(key) except WindowsError: # @UndefinedVariable pass for key in keys: fontdict = {} for i in range(_winreg.QueryInfoKey(key)[1]): try: name, font, t = _winreg.EnumValue(key,i) except EnvironmentError: break # try and handle windows unicode strings for some file names. # here are two documents with some information about it: # http://www.python.org/peps/pep-0277.html # https://www.microsoft.com/technet/archive/interopmigration/linux/mvc/lintowin.mspx#ECAA try: font = str(font) except UnicodeEncodeError: # MBCS is the windows encoding for unicode file names. try: font = font.encode('MBCS') except: # no goodness with str or MBCS encoding... skip this font. continue if font[-4:].lower() not in [".ttf", ".ttc", ".otf"]: continue if os.sep not in font: font = os.path.join(fontdir, font) if name[-10:] == '(TrueType)': name = name[:-11] name = name.lower().split() bold = italic = 0 for m in mods: if m in name: name.remove(m) if 'bold' in name: name.remove('bold') bold = 1 if 'italic' in name: name.remove('italic') italic = 1 name = ''.join(name) name=_simplename(name) _addfont(name, bold, italic, font, fonts) return fonts _OSX_default_font_files = { 'albayan': {(False, False): '/Library/Fonts/AlBayan.ttf', (True, False): '/Library/Fonts/AlBayanBold.ttf'}, 'andalemono': {(False, False): '/Library/Fonts/Andale Mono.ttf'}, 'applebraille': {(False, False): '/System/Library/Fonts/Apple Braille Outline 6 Dot.ttf'}, 'applegothic': {(False, False): '/System/Library/Fonts/AppleGothic.ttf'}, 'applesymbols': {(False, False): '/System/Library/Fonts/Apple Symbols.ttf'}, 'arial': {(False, False): '/Library/Fonts/Arial.ttf', (False, True): '/Library/Fonts/Arial Italic.ttf', (True, False): '/Library/Fonts/Arial Bold.ttf', (True, True): '/Library/Fonts/Arial Bold Italic.ttf'}, 'arialblack': {(False, False): '/Library/Fonts/Arial Black.ttf'}, 'arialhebrew': {(False, False): '/Library/Fonts/ArialHB.ttf', (True, False): '/Library/Fonts/ArialHBBold.ttf'}, 'arialnarrow': {(False, False): '/Library/Fonts/Arial Narrow.ttf', (False, True): '/Library/Fonts/Arial Narrow Italic.ttf', (True, False): '/Library/Fonts/Arial Narrow Bold.ttf', (True, True): '/Library/Fonts/Arial Narrow Bold Italic.ttf'}, 'arialroundedmtbold': {(False, False): '/Library/Fonts/Arial Rounded Bold.ttf'}, 'arialunicodems': {(False, False): '/Library/Fonts/Arial Unicode.ttf'}, 'ayuthaya': {(False, False): '/Library/Fonts/Ayuthaya.ttf'}, 'baghdad': {(False, False): '/Library/Fonts/Baghdad.ttf'}, 'brushscriptmt': {(False, True): '/Library/Fonts/Brush Script.ttf'}, 'chalkboard': {(False, False): '/Library/Fonts/Chalkboard.ttf', (True, False): '/Library/Fonts/ChalkboardBold.ttf'}, 'comicsansms': {(False, False): '/Library/Fonts/Comic Sans MS.ttf', (True, False): '/Library/Fonts/Comic Sans MS Bold.ttf'}, 'corsivahebrew': {(False, False): '/Library/Fonts/Corsiva.ttf', (True, False): '/Library/Fonts/CorsivaBold.ttf'}, 'couriernew': {(False, False): '/Library/Fonts/Courier New.ttf', (False, True): '/Library/Fonts/Courier New Italic.ttf', (True, False): '/Library/Fonts/Courier New Bold.ttf', (True, True): '/Library/Fonts/Courier New Bold Italic.ttf'}, 'decotypenaskh': {(False, False): '/Library/Fonts/DecoTypeNaskh.ttf'}, 'devanagarimt': {(False, False): '/Library/Fonts/DevanagariMT.ttf', (True, False): '/Library/Fonts/DevanagariMTBold.ttf'}, 'euphemiaucas': {(False, False): '/Library/Fonts/EuphemiaCASRegular.ttf', (False, True): '/Library/Fonts/EuphemiaCASItalic.ttf', (True, False): '/Library/Fonts/EuphemiaCASBold.ttf'}, 'gb18030bitmap': {(False, False): '/Library/Fonts/NISC18030.ttf'}, 'geezapro': {(False, False): '/System/Library/Fonts/Geeza Pro.ttf', (True, False): '/System/Library/Fonts/Geeza Pro Bold.ttf'}, 'georgia': {(False, False): '/Library/Fonts/Georgia.ttf', (False, True): '/Library/Fonts/Georgia Italic.ttf', (True, False): '/Library/Fonts/Georgia Bold.ttf', (True, True): '/Library/Fonts/Georgia Bold Italic.ttf'}, 'gujaratimt': {(False, False): '/Library/Fonts/GujaratiMT.ttf', (True, False): '/Library/Fonts/GujaratiMTBold.ttf'}, 'gurmukhimt': {(False, False): '/Library/Fonts/Gurmukhi.ttf'}, 'impact': {(False, False): '/Library/Fonts/Impact.ttf'}, 'inaimathi': {(False, False): '/Library/Fonts/InaiMathi.ttf'}, 'kailasa': {(False, False): '/Library/Fonts/Kailasa.ttf'}, 'kokonor': {(False, False): '/Library/Fonts/Kokonor.ttf'}, 'krungthep': {(False, False): '/Library/Fonts/Krungthep.ttf'}, 'kufistandardgk': {(False, False): '/Library/Fonts/KufiStandardGK.ttf'}, 'liheipro': {(False, False): '/System/Library/Fonts/ Pro.ttf'}, 'lisongpro': {(False, False): '/Library/Fonts/ Pro.ttf'}, 'microsoftsansserif': {(False, False): '/Library/Fonts/Microsoft Sans Serif.ttf'}, 'mshtakan': {(False, False): '/Library/Fonts/MshtakanRegular.ttf', (False, True): '/Library/Fonts/MshtakanOblique.ttf', (True, False): '/Library/Fonts/MshtakanBold.ttf', (True, True): '/Library/Fonts/MshtakanBoldOblique.ttf'}, 'nadeem': {(False, False): '/Library/Fonts/Nadeem.ttf'}, 'newpeninimmt': {(False, False): '/Library/Fonts/NewPeninimMT.ttf', (True, False): '/Library/Fonts/NewPeninimMTBoldInclined.ttf'}, 'plantagenetcherokee': {(False, False): '/Library/Fonts/PlantagenetCherokee.ttf'}, 'raanana': {(False, False): '/Library/Fonts/Raanana.ttf', (True, False): '/Library/Fonts/RaananaBold.ttf'}, 'sathu': {(False, False): '/Library/Fonts/Sathu.ttf'}, 'silom': {(False, False): '/Library/Fonts/Silom.ttf'}, 'stfangsong': {(False, False): '/Library/Fonts/.ttf'}, 'stheiti': {(False, False): '/System/Library/Fonts/.ttf'}, 'stkaiti': {(False, False): '/Library/Fonts/.ttf'}, 'stsong': {(False, False): '/Library/Fonts/.ttf'}, 'tahoma': {(False, False): '/Library/Fonts/Tahoma.ttf', (True, False): '/Library/Fonts/Tahoma Bold.ttf'}, 'thonburi': {(False, False): '/System/Library/Fonts/Thonburi.ttf', (True, False): '/System/Library/Fonts/ThonburiBold.ttf'}, 'timesnewroman': {(False, False): '/Library/Fonts/Times New Roman.ttf', (False, True): '/Library/Fonts/Times New Roman Italic.ttf', (True, False): '/Library/Fonts/Times New Roman Bold.ttf', (True, True): '/Library/Fonts/Times New Roman Bold Italic.ttf'}, 'trebuchetms': {(False, False): '/Library/Fonts/Trebuchet MS.ttf', (False, True): '/Library/Fonts/Trebuchet MS Italic.ttf', (True, False): '/Library/Fonts/Trebuchet MS Bold.ttf', (True, True): '/Library/Fonts/Trebuchet MS Bold Italic.ttf'}, 'verdana': {(False, False): '/Library/Fonts/Verdana.ttf', (False, True): '/Library/Fonts/Verdana Italic.ttf', (True, False): '/Library/Fonts/Verdana Bold.ttf', (True, True): '/Library/Fonts/Verdana Bold Italic.ttf'}, 'webdings': {(False, False): '/Library/Fonts/Webdings.ttf'}, 'wingdings': {(False, False): '/Library/Fonts/Wingdings.ttf'}, 'wingdings2': {(False, False): '/Library/Fonts/Wingdings 2.ttf'}, 'wingdings3': {(False, False): '/Library/Fonts/Wingdings 3.ttf'}} def _search_osx_font_paths(fonts): for name, details in _OSX_default_font_files.items(): for k, apath in details.items(): if os.path.exists(apath): bold, italic = k _addfont(name, bold, italic, apath, fonts) def initsysfonts_darwin(): """ read the fonts on OSX. """ # if the X11 binary exists... try and use that. # Not likely to be there on pre 10.4.x ... # so still need to do other OSX specific method below. # if os.path.exists("/usr/X11/bin/fc-list"): # fonts = initsysfonts_unix("/usr/X11/bin/fc-list") # else: # On recent OSX, the above code will ask the user to install X11. Since # that's crazy, we disable it, and use the default font list. fonts = {} # we look for the default paths. _search_osx_font_paths(fonts) return fonts paths = ['/Library/Fonts', '~/Library/Fonts', '/Local/Library/Fonts', '/Network/Library/Fonts'] fonts = {} for p in paths: if os.path.isdir(p): pass #os.path.walk(p, _fontwalk, fonts) return fonts #read the fonts on unix def initsysfonts_unix(path = "fc-list"): import subprocess fonts = {} # we use the fc-list from fontconfig to get a list of fonts. try: # note, we capture stderr so if fc-list isn't there to stop stderr printing. flout, flerr = subprocess.Popen('%s : file family style' % path, shell=True, stdout=subprocess.PIPE, stderr=subprocess.PIPE, close_fds=True).communicate() except Exception: return fonts entries = toascii(flout) try: for line in entries.split('\n'): try: filename, family, style = line.split(':', 2) if filename[-4:].lower() in ['.ttf', '.ttc', '.otf']: bold = style.find('Bold') >= 0 italic = style.find('Italic') >= 0 oblique = style.find('Oblique') >= 0 for name in family.split(','): if name: break else: name = os.path.splitext(os.path.basename(filename))[0] _addfont(_simplename(name), bold, italic or oblique, filename, fonts) except Exception: # try the next one. pass except Exception: pass return fonts #create alias entries def create_aliases(): aliases = ( ('monospace', 'misc-fixed', 'courier', 'couriernew', 'console', 'fixed', 'mono', 'freemono', 'bitstreamverasansmono', 'verasansmono', 'monotype', 'lucidaconsole'), ('sans', 'arial', 'helvetica', 'swiss', 'freesans', 'bitstreamverasans', 'verasans', 'verdana', 'tahoma'), ('serif', 'times', 'freeserif', 'bitstreamveraserif', 'roman', 'timesroman', 'timesnewroman', 'dutch', 'veraserif', 'georgia'), ('wingdings', 'wingbats'), ) for set in aliases: found = None fname = None for name in set: if name in Sysfonts: found = Sysfonts[name] fname = name break if not found: continue for name in set: if name not in Sysfonts: Sysalias[name] = found Sysfonts = {} Sysalias = {} #initialize it all, called once def initsysfonts(): if sys.platform == 'win32': fonts = initsysfonts_win32() elif sys.platform == 'darwin': fonts = initsysfonts_darwin() else: fonts = initsysfonts_unix() Sysfonts.update(fonts) create_aliases() if not Sysfonts: #dummy so we don't try to reinit Sysfonts[None] = None # pygame.font specific declarations def font_constructor(fontpath, size, bold, italic): import pygame_sdl2.font font = pygame_sdl2.font.Font(fontpath, size) if bold: font.set_bold(1) if italic: font.set_italic(1) return font #the exported functions def SysFont(name, size, bold=False, italic=False, constructor=None): """pygame.font.SysFont(name, size, bold=False, italic=False, constructor=None) -> Font create a pygame Font from system font resources This will search the system fonts for the given font name. You can also enable bold or italic styles, and the appropriate system font will be selected if available. This will always return a valid Font object, and will fallback on the builtin pygame font if the given font is not found. Name can also be a comma separated list of names, in which case set of names will be searched in order. Pygame uses a small set of common font aliases, if the specific font you ask for is not available, a reasonable alternative may be used. if optional contructor is provided, it must be a function with signature constructor(fontpath, size, bold, italic) which returns a Font instance. If None, a pygame.font.Font object is created. """ if constructor is None: constructor = font_constructor if not Sysfonts: initsysfonts() gotbold = gotitalic = False fontname = None if name: allnames = name for name in allnames.split(','): name = _simplename(name) styles = Sysfonts.get(name) if not styles: styles = Sysalias.get(name) if styles: plainname = styles.get((False, False)) fontname = styles.get((bold, italic)) if not fontname and not plainname: # Neither requested style, nor plain font exists, so # return a font with the name requested, but an # arbitrary style. (style, fontname) = list(styles.items())[0] # Attempt to style it as requested. This can't # unbold or unitalicize anything, but it can # fake bold and/or fake italicize. if bold and style[0]: gotbold = True if italic and style[1]: gotitalic = True elif not fontname: fontname = plainname elif plainname != fontname: gotbold = bold gotitalic = italic if fontname: break set_bold = set_italic = False if bold and not gotbold: set_bold = True if italic and not gotitalic: set_italic = True return constructor(fontname, size, set_bold, set_italic) def get_fonts(): """pygame.font.get_fonts() -> list get a list of system font names Returns the list of all found system fonts. Note that the names of the fonts will be all lowercase with spaces removed. This is how pygame internally stores the font names for matching. """ if not Sysfonts: initsysfonts() return list(Sysfonts.keys()) def match_font(name, bold=0, italic=0): """pygame.font.match_font(name, bold=0, italic=0) -> name find the filename for the named system font This performs the same font search as the SysFont() function, only it returns the path to the TTF file that would be loaded. The font name can be a comma separated list of font names to try. If no match is found, None is returned. """ if not Sysfonts: initsysfonts() fontname = None allnames = name for name in allnames.split(','): name = _simplename(name) styles = Sysfonts.get(name) if not styles: styles = Sysalias.get(name) if styles: while not fontname: fontname = styles.get((bold, italic)) if italic: italic = 0 elif bold: bold = 0 elif not fontname: fontname = list(styles.values())[0] if fontname: break return fontname pygame_sdl2-2.1.0-for-renpy-6.99.14.1/src/pygame_sdl2/event.pyx0000644000175000017500000003434013203747337023141 0ustar tomtom00000000000000# Copyright 2014 Patrick Dawson # Copyright 2014 Tom Rothamel # # This software is provided 'as-is', without any express or implied # warranty. In no event will the authors be held liable for any damages # arising from the use of this software. # # Permission is granted to anyone to use this software for any purpose, # including commercial applications, and to alter it and redistribute it # freely, subject to the following restrictions: # # 1. The origin of this software must not be misrepresented; you must not # claim that you wrote the original software. If you use this software # in a product, an acknowledgment in the product documentation would be # appreciated but is not required. # 2. Altered source versions must be plainly marked as such, and must not be # misrepresented as being the original software. # 3. This notice may not be removed or altered from any source distribution. from cpython.ref cimport Py_INCREF, Py_DECREF from sdl2 cimport * from pygame_sdl2.display cimport Window, main_window import threading import pygame_sdl2 import sys if sys.version_info[0] >= 3: unichr = chr include "event_names.pxi" # Add events to emulate SDL 1.2. These also need to be added in locals. ACTIVEEVENT = SDL_LASTEVENT - 1 VIDEORESIZE = SDL_LASTEVENT - 2 VIDEOEXPOSE = SDL_LASTEVENT - 3 event_names[ACTIVEEVENT] = "ACTIVEEVENT" event_names[VIDEORESIZE] = "VIDEORESIZE" event_names[VIDEOEXPOSE] = "VIDEOEXPOSE" # This is used for events posted to the event queue. This won't be returned # to the user - it's just used internally, with the event object itself # giving the type. cdef int POSTEDEVENT POSTEDEVENT = SDL_LASTEVENT - 4 # The maximum number of a user-defined event. USEREVENT_MAX = SDL_LASTEVENT - 5 # If true, the mousewheel is mapped to buttons 4 and 5. Otherwise, a # MOUSEWHEEL event is created. cdef bint mousewheel_buttons = 1 class EventType(object): def __init__(self, type, dict=None, **kwargs): self._type = type if dict: self.__dict__.update(dict) self.__dict__.update(kwargs) def __repr__(self): if SDL_USEREVENT <= self.type < VIDEOEXPOSE: ename = "UserEvent%d" % (self.type - SDL_USEREVENT) else: try: ename = event_names[self.type] except KeyError: ename = "UNKNOWN" d = self.__dict__.copy() del d['_type'] return '' % (self.type, ename, d) @property def dict(self): return self.__dict__ @property def type(self): return self._type def __eq__(self, other): return self.__dict__ == other.__dict__ def __ne__(self, other): return not (self == other) def __nonzero__(self): return self.type != 0 Event = EventType cdef get_textinput(): cdef SDL_Event evt SDL_PumpEvents() if SDL_PeepEvents(&evt, 1, SDL_GETEVENT, SDL_TEXTINPUT, SDL_TEXTINPUT) > 0: return evt.text.text.decode('utf-8') return u'' cdef make_keyboard_event(SDL_KeyboardEvent *e): dargs = { 'scancode' : e.keysym.scancode, 'key' : e.keysym.sym, 'mod' : e.keysym.mod, 'unicode' : '', 'repeat' : e.repeat, } if not pygame_sdl2.key.text_input: if e.type == SDL_KEYDOWN: # Be careful to only check for a TEXTINPUT event when you know that # there will be one associated with this KEYDOWN event. if e.keysym.sym < 0x20: dargs['unicode'] = unichr(e.keysym.sym) elif e.keysym.sym <= 0xFFFF: dargs['unicode'] = get_textinput() return EventType(e.type, dict=dargs, repeat=e.repeat) cdef make_mousemotion_event(SDL_MouseMotionEvent *e): buttons = (1 if e.state & SDL_BUTTON_LMASK else 0, 1 if e.state & SDL_BUTTON_MMASK else 0, 1 if e.state & SDL_BUTTON_RMASK else 0) return EventType(e.type, pos=(e.x, e.y), rel=(e.xrel, e.yrel), which=e.which, buttons=buttons) cdef make_mousebtn_event(SDL_MouseButtonEvent *e): btn = e.button # SDL 1.x maps wheel to buttons 4/5 if mousewheel_buttons and btn >= 4: btn += 2 return EventType(e.type, button=btn, pos=(e.x, e.y), which=e.which) cdef make_mousewheel_event(SDL_MouseWheelEvent *e): cdef int x, y # SDL2-style, if the user has opted-in. if not mousewheel_buttons: return EventType(e.type, which=e.which, x=e.x, y=e.y) # Otherwise, follow the SDL1 approach. y = e.y # TODO: Implement when 2.0.4 becomes widespread. # if e.direction == SDL_MOUSEWHEEL_FLIPPED: # y = -y if y > 0: btn = 4 elif y < 0: btn = 5 else: return EventType(0) # x axis scrolling produces no event in pygame # This is not the mouse position at the time of the event SDL_GetMouseState(&x, &y) # MOUSEBUTTONUP event should follow immediately after event_queue.insert(0, EventType(SDL_MOUSEBUTTONUP, button=btn, pos=(x,y))) return EventType(SDL_MOUSEBUTTONDOWN, button=btn, pos=(x,y)) cdef make_mousewheel_event_sdl2(SDL_MouseWheelEvent *e): return EventType(e.type, x=e.x, y=e.y) cdef make_joyaxis_event(SDL_JoyAxisEvent *e): return EventType(e.type, joy=e.which, axis=e.axis, value=e.value/32768.0) cdef make_joyball_event(SDL_JoyBallEvent *e): return EventType(e.type, joy=e.which, ball=e.ball, rel=(e.xrel, e.yrel)) cdef make_joyhat_event(SDL_JoyHatEvent *e): return EventType(e.type, joy=e.which, hat=e.hat, value=e.value) cdef make_joybtn_event(SDL_JoyButtonEvent *e): return EventType(e.type, joy=e.which, button=e.button) cdef make_textinput_event(SDL_TextInputEvent *e): return EventType(e.type, text=e.text.decode("utf-8")) cdef make_textediting_event(SDL_TextEditingEvent *e): return EventType(e.type, text=e.text.decode("utf-8"), start=e.start, length=e.length) cdef make_window_event(SDL_WindowEvent *e): # SDL_APPMOUSEFOCUS if e.event == SDL_WINDOWEVENT_ENTER: return EventType(ACTIVEEVENT, state=1, gain=1) elif e.event == SDL_WINDOWEVENT_LEAVE: return EventType(ACTIVEEVENT, state=1, gain=0) # SDL_APPINPUTFOCUS elif e.event == SDL_WINDOWEVENT_FOCUS_GAINED: return EventType(ACTIVEEVENT, state=2, gain=1) elif e.event == SDL_WINDOWEVENT_FOCUS_LOST: return EventType(ACTIVEEVENT, state=2, gain=0) # SDL_APPACTIVE elif e.event == SDL_WINDOWEVENT_RESTORED: return EventType(ACTIVEEVENT, state=4, gain=1) elif e.event == SDL_WINDOWEVENT_MINIMIZED: return EventType(ACTIVEEVENT, state=4, gain=0) elif e.event == SDL_WINDOWEVENT_RESIZED: return EventType(VIDEORESIZE, size=(e.data1, e.data2), w=e.data1, h=e.data2) elif e.event == SDL_WINDOWEVENT_EXPOSED: return EventType(VIDEOEXPOSE) return EventType(SDL_WINDOWEVENT, event=e.event, data1=e.data1, data2=e.data2) cdef make_event(SDL_Event *e): cdef object o if e.type == SDL_MOUSEMOTION: return make_mousemotion_event(e) elif e.type in (SDL_MOUSEBUTTONDOWN, SDL_MOUSEBUTTONUP): return make_mousebtn_event(e) elif e.type == SDL_MOUSEWHEEL: return make_mousewheel_event(e) elif e.type in (SDL_KEYDOWN, SDL_KEYUP): return make_keyboard_event(e) elif e.type == SDL_JOYAXISMOTION: return make_joyaxis_event(e) elif e.type == SDL_JOYBALLMOTION: return make_joyball_event(e) elif e.type == SDL_JOYHATMOTION: return make_joyhat_event(e) elif e.type in (SDL_JOYBUTTONDOWN, SDL_JOYBUTTONUP): return make_joybtn_event(e) elif e.type in (SDL_JOYDEVICEADDED, SDL_JOYDEVICEREMOVED): return EventType(e.type, which=e.jdevice.which) elif e.type == SDL_WINDOWEVENT: return make_window_event(e) elif e.type == SDL_TEXTINPUT: return make_textinput_event( e) elif e.type == SDL_TEXTEDITING: return make_textediting_event( e) elif e.type == SDL_CONTROLLERAXISMOTION: return EventType(e.type, which=e.caxis.which, axis=e.caxis.axis, value=e.caxis.value) elif e.type in (SDL_CONTROLLERBUTTONDOWN, SDL_CONTROLLERBUTTONUP): return EventType(e.type, which=e.cbutton.which, button=e.cbutton.button, state=e.cbutton.state) elif e.type in (SDL_CONTROLLERDEVICEADDED, SDL_CONTROLLERDEVICEREMOVED, SDL_CONTROLLERDEVICEREMAPPED): return EventType(e.type, which=e.cdevice.which) elif e.type in (SDL_FINGERMOTION, SDL_FINGERDOWN, SDL_FINGERUP): return EventType(e.type, touchId=e.tfinger.touchId, fingerId=e.tfinger.fingerId, x=e.tfinger.x, y=e.tfinger.y, dx=e.tfinger.dx, dy=e.tfinger.dy, pressure=e.tfinger.pressure) elif e.type == SDL_MULTIGESTURE: return EventType(e.type, touchId=e.mgesture.touchId, dTheta=e.mgesture.dTheta, dDist=e.mgesture.dDist, x=e.mgesture.x, y=e.mgesture.y, numFingers=e.mgesture.numFingers) elif e.type == POSTEDEVENT: o = e.user.data1 Py_DECREF(o) return o elif e.type >= SDL_USEREVENT: # Can't do anything useful with data1 and data2 here. return EventType(e.type, code=e.user.code) return EventType(e.type) # The event queue - a list of pending events from oldest to newest. cdef public event_queue = list() # The lock that protects the event queue. lock = threading.RLock() # This is the object that is returned when no event exists. NOEVENT_EVENT = EventType(0) cdef bint has_event(kinds): """ Returns true if at least one event in the queue has a type in `kinds`, which must support the in operator. The lock must be held when calling this function """ for i in event_queue: if i._type in kinds: return True cdef object get_events(kinds): """ Returns a list containing all events in the event queue with type `kinds`. Removes those events from the event queue. The lock must be held when calling this function. """ if isinstance(kinds, (int, long)): kinds = [ kinds ] global event_queue cdef list rv = [ ] cdef list new_queue = [ ] for i in event_queue: if i._type in kinds: rv.append(i) else: new_queue.append(i) event_queue = new_queue return rv cdef int poll_sdl() except 1: """ Polls SDL for pending events, and places those events onto the event q queue. """ cdef SDL_Event evt with lock: while SDL_PollEvent(&evt): event_queue.append(make_event(&evt)) return 0 def pump(): with lock: poll_sdl() def get(t=None): global event_queue with lock: poll_sdl() if t is None: rv = event_queue event_queue = [ ] elif isinstance(t, int): rv = get_events(( t, )) else: rv = get_events(t) return rv def poll(): with lock: poll_sdl() if event_queue: return event_queue.pop(0) return NOEVENT_EVENT def wait(): cdef SDL_Event evt cdef int result with lock: poll_sdl() if event_queue: return event_queue.pop(0) with nogil: result = SDL_WaitEvent(&evt) if result: return make_event(&evt) else: return NOEVENT_EVENT def peek(t=None): with lock: poll_sdl() if t is None: return len(event_queue) != 0 elif isinstance(t, int): return has_event(( t, )) else: return has_event(t) def clear(t=None): # Clear is implemented in terms of get. get(t) def get_standard_events(): """ Returns a list of standard events that pygame_sdl2 knows about. """ return [ i for i in event_names.keys() if (i < SDL_USEREVENT) or (i > USEREVENT_MAX) ] def event_name(t): try: return event_names[t] except KeyError: return "UNKNOWN" def set_blocked(t=None): if t == None: for et in event_names.keys(): SDL_EventState(et, SDL_ENABLE) elif isinstance(t, (int, long)): SDL_EventState(t, SDL_IGNORE) else: for et in t: SDL_EventState(et, SDL_IGNORE) def set_allowed(t=None): if t == None: for et in event_names.keys(): SDL_EventState(et, SDL_IGNORE) elif isinstance(t, (int, long)): SDL_EventState(t, SDL_ENABLE) else: for et in t: SDL_EventState(et, SDL_ENABLE) def get_blocked(t): return SDL_EventState(t, SDL_QUERY) == SDL_IGNORE def set_grab(on): SDL_SetWindowGrab(main_window.window, on) def get_grab(): return SDL_GetWindowGrab(main_window.window) def set_mousewheel_buttons(flag): """ If true (the default), the mousewheel will generate events involving mouse buttons 4 and 5, and mousebuttons 4 and higher will be mapped to 6 and higher. If false, MOUSEWHEEL events are generated, and the mousebuttons are not remapped. """ global mousewheel_buttons mousewheel_buttons = flag def get_mousewheel_buttons(): """ Returns the value set by mousehweel buttons,. """ return mousewheel_buttons def post(e): """ Posts event object `e` to the event queue. """ cdef SDL_Event event; if not isinstance(e, EventType): raise pygame_sdl2.error("event.post must be called with an Event.") if get_blocked(e.type): return Py_INCREF(e) event.type = POSTEDEVENT event.user.data1 = e SDL_PushEvent(&event) def register(name): """ Registers a unique event number and returns that number. `name` A string name for the event. This is used when calling `repr` on the event. """ rv = SDL_RegisterEvents(1) event_names[rv] = name return rv def copy_event_queue(): """ Returns a copy of the event queue. The copy cannot be used for modifying the event queue. """ return event_queue[:] # Usually called by display.init. def init(): if not SDL_WasInit(SDL_INIT_EVENTS): pygame_sdl2.display.sdl_main_init() if SDL_InitSubSystem(SDL_INIT_EVENTS): raise pygame_sdl2.error.error() pygame_sdl2-2.1.0-for-renpy-6.99.14.1/src/pygame_sdl2/rwobject.pyx0000664000175000017500000001636412764142600023640 0ustar tomtom00000000000000# Copyright 2014 Tom Rothamel # # This software is provided 'as-is', without any express or implied # warranty. In no event will the authors be held liable for any damages # arising from the use of this software. # # Permission is granted to anyone to use this software for any purpose, # including commercial applications, and to alter it and redistribute it # freely, subject to the following restrictions: # # 1. The origin of this software must not be misrepresented; you must not # claim that you wrote the original software. If you use this software # in a product, an acknowledgment in the product documentation would be # appreciated but is not required. # 2. Altered source versions must be plainly marked as such, and must not be # misrepresented as being the original software. # 3. This notice may not be removed or altered from any source distribution. from sdl2 cimport * from cpython.ref cimport Py_INCREF, Py_DECREF from libc.string cimport memcpy from libc.stdio cimport FILE, fopen, fclose, fseek, ftell, fread, SEEK_SET, SEEK_CUR, SEEK_END from libc.stdlib cimport calloc, free from pygame_sdl2.compat import file_type, bytes_, unicode_ import sys # The fsencoding. fsencoding = sys.getfilesystemencoding() or "utf-8" cdef extern from "SDL.h" nogil: Sint64 SDL_RWtell(SDL_RWops* context) Sint64 SDL_RWseek(SDL_RWops* context, Sint64 offset, int whence) size_t SDL_RWread(SDL_RWops* context, void* ptr, size_t size, size_t maxnum) size_t SDL_RWwrite(SDL_RWops* context, const void* ptr, size_t size, size_t num) int SDL_RWclose(SDL_RWops* context) cdef extern from "Python.h": void PyEval_InitThreads() cdef set_error(e): cdef char *msg e = str(e) msg = e SDL_SetError("%s", msg) cdef Sint64 python_size(SDL_RWops *context) with gil: f = context.hidden.unknown.data1 try: cur = f.tell() f.seek(0, 2) rv = f.tell() f.seek(cur, 0) except: return -1 return rv cdef Sint64 python_seek(SDL_RWops *context, Sint64 seek, int whence) with gil: f = context.hidden.unknown.data1 try: f.seek(seek, whence) rv = f.tell() except Exception as e: set_error(e) return -1 return rv cdef size_t python_read(SDL_RWops *context, void *ptr, size_t size, size_t maxnum) with gil: f = context.hidden.unknown.data1 try: data = f.read(size * maxnum) except Exception as e: set_error(e) return -1 memcpy(ptr, data, len(data)) return len(data) cdef size_t python_write(SDL_RWops *context, const void *ptr, size_t size, size_t maxnum) with gil: f = context.hidden.unknown.data1 data = ( ptr)[:size * maxnum] try: f.write(data) except Exception as e: set_error(e) return -1 return len(data) cdef int python_close(SDL_RWops *context) with gil: f = context.hidden.unknown.data1 try: f.close() except Exception as e: set_error(e) return -1 Py_DECREF(f) SDL_FreeRW(context) return 0 cdef struct SubFile: SDL_RWops *rw Sint64 base Sint64 length Sint64 tell cdef Sint64 subfile_size(SDL_RWops *context) nogil: cdef SubFile *sf = context.hidden.unknown.data1 return sf.length cdef Sint64 subfile_seek(SDL_RWops *context, Sint64 seek, int whence) nogil: cdef SubFile *sf = context.hidden.unknown.data1 if whence == RW_SEEK_SET: sf.tell = SDL_RWseek(sf.rw, seek + sf.base, RW_SEEK_SET) - sf.base elif whence == RW_SEEK_CUR: sf.tell = SDL_RWseek(sf.rw, seek, RW_SEEK_CUR) - sf.base elif whence == RW_SEEK_END: sf.tell = SDL_RWseek(sf.rw, sf.base + sf.length + seek, RW_SEEK_SET) - sf.base return sf.tell cdef size_t subfile_read(SDL_RWops *context, void *ptr, size_t size, size_t maxnum) nogil: cdef SubFile *sf = context.hidden.unknown.data1 cdef Sint64 left = sf.length - sf.tell cdef size_t rv; if size * maxnum > left: maxnum = left // size if maxnum == 0: return 0 rv = SDL_RWread(sf.rw, ptr, size, maxnum) if rv > 0: sf.tell += size * rv return rv cdef int subfile_close(SDL_RWops *context) nogil: cdef SubFile *sf = context.hidden.unknown.data1 SDL_RWclose(sf.rw) free(sf) SDL_FreeRW(context) cdef SDL_RWops *to_rwops(filelike, mode="rb") except NULL: cdef FILE *f cdef SubFile *sf cdef SDL_RWops *rv cdef SDL_RWops *rw cdef char *cname cdef char *cmode if not isinstance(mode, bytes_): mode = mode.encode("ascii") if isinstance(filelike, file_type) and mode == b"rb": filelike = filelike.name # Try to open as a file. if isinstance(filelike, bytes_): name = filelike.decode(fsencoding) elif isinstance(filelike, unicode_): name = filelike else: name = None if name: dname = name.encode("utf-8") cname = dname cmode = mode with nogil: rv = SDL_RWFromFile(cname, cmode) if rv == NULL: raise IOError("Could not open {!r}: {}".format(filelike, SDL_GetError())) return rv if mode == b"rb": try: # If we have these properties, we're either an APK asset or a Ren'Py-style # subfile, so use an optimized path. name = filelike.name base = filelike.base length = filelike.length if name is not None: if not isinstance(name, unicode_): name = name.decode(fsencoding) dname = name.encode("utf-8") cname = dname with nogil: rw = SDL_RWFromFile(cname, b"rb") if not rw: raise IOError("Could not open {!r}.".format(name)) SDL_RWseek(rw, base, RW_SEEK_SET); sf = calloc(sizeof(SubFile), 1) sf.rw = rw sf.base = base sf.length = length sf.tell = 0; rv = SDL_AllocRW() rv.size = subfile_size rv.seek = subfile_seek rv.read = subfile_read rv.write = NULL rv.close = subfile_close rv.type = 0 rv.hidden.unknown.data1 = sf return rv except AttributeError: pass if not (hasattr(filelike, "read") or hasattr(filelike, "write")): raise IOError("{!r} is not a filename or file-like object.".format(filelike)) Py_INCREF(filelike) rv = SDL_AllocRW() rv.size = python_size rv.seek = python_seek rv.read = python_read rv.write = python_write rv.close = python_close rv.type = 0 rv.hidden.unknown.data1 = filelike return rv cdef api SDL_RWops *RWopsFromPython(filelike) except NULL: return to_rwops(filelike) PyEval_InitThreads() pygame_sdl2-2.1.0-for-renpy-6.99.14.1/src/pygame_sdl2/locals.pyx0000644000175000017500000000640113201701200023243 0ustar tomtom00000000000000from sdl2 cimport * cimport sdl2 from pygame_sdl2.rect import Rect from pygame_sdl2.color import Color include "event_list.pxi" ACTIVEEVENT = SDL_LASTEVENT - 1 VIDEORESIZE = SDL_LASTEVENT - 2 VIDEOEXPOSE = SDL_LASTEVENT - 3 include "keycode_list.pxi" include "glattr.pxi" GL_SWAP_CONTROL = -1 RLEACCEL = SDL_RLEACCEL SRCCOLORKEY = 0 # Surface flags. SRCALPHA = 0x80000000 HWSURFACE = 0x40000000 SWSURFACE = 0 # Window flags. FULLSCREEN = SDL_WINDOW_FULLSCREEN OPENGL = SDL_WINDOW_OPENGL NOFRAME = SDL_WINDOW_BORDERLESS RESIZABLE = SDL_WINDOW_RESIZABLE DOUBLEBUF = 0 WINDOW_FULLSCREEN = SDL_WINDOW_FULLSCREEN WINDOW_SHOWN = SDL_WINDOW_SHOWN WINDOW_HIDDEN = SDL_WINDOW_HIDDEN WINDOW_OPENGL = SDL_WINDOW_OPENGL WINDOW_NOFRAME = SDL_WINDOW_BORDERLESS WINDOW_BORDERLESS = SDL_WINDOW_BORDERLESS WINDOW_RESIZABLE = SDL_WINDOW_RESIZABLE WINDOW_MINIMIZED = SDL_WINDOW_MINIMIZED WINDOW_MAXIMIZED = SDL_WINDOW_MAXIMIZED WINDOW_INPUT_GRABBED = SDL_WINDOW_INPUT_GRABBED WINDOW_INPUT_FOCUS = SDL_WINDOW_MOUSE_FOCUS WINDOW_FULLSCREEN_DESKTOP = SDL_WINDOW_FULLSCREEN_DESKTOP WINDOW_FOREIGN = SDL_WINDOW_FOREIGN WINDOW_ALLOW_HIGHDPI = SDL_WINDOW_ALLOW_HIGHDPI WINDOWPOS_CENTERED = SDL_WINDOWPOS_CENTERED WINDOWPOS_UNDEFINED = SDL_WINDOWPOS_UNDEFINED # Blend modes BLEND_RGB_ADD = BLEND_ADD = 0x1 BLEND_RGB_SUB = BLEND_SUB = 0x2 BLEND_RGB_MULT = BLEND_MULT = 0x3 BLEND_RGB_MIN = BLEND_MIN = 0x4 BLEND_RGB_MAX = BLEND_MAX = 0x5 BLEND_RGBA_ADD = 0x6 BLEND_RGBA_SUB = 0x7 BLEND_RGBA_MULT = 0x8 BLEND_RGBA_MIN = 0x9 BLEND_RGBA_MAX = 0x10 BLEND_PREMULTIPLIED = 0x11 # Scrap types. SCRAP_TEXT = "text/plain" BYTEORDER = SDL_BYTEORDER LIL_ENDIAN = SDL_LIL_ENDIAN BIG_ENDIAN = SDL_BIG_ENDIAN SDL_VERSION_TUPLE = (SDL_MAJOR_VERSION, SDL_MINOR_VERSION, SDL_PATCHLEVEL) globals().update(dict( KMOD_NONE = sdl2.KMOD_NONE, KMOD_LSHIFT = sdl2.KMOD_LSHIFT, KMOD_RSHIFT = sdl2.KMOD_RSHIFT, KMOD_SHIFT = sdl2.KMOD_SHIFT, KMOD_LCTRL = sdl2.KMOD_LCTRL, KMOD_RCTRL = sdl2.KMOD_RCTRL, KMOD_CTRL = sdl2.KMOD_CTRL, KMOD_LALT = sdl2.KMOD_LALT, KMOD_RALT = sdl2.KMOD_RALT, KMOD_ALT = sdl2.KMOD_ALT, KMOD_LGUI = sdl2.KMOD_LGUI, KMOD_RGUI = sdl2.KMOD_RGUI, KMOD_GUI = sdl2.KMOD_GUI, KMOD_LMETA = sdl2.KMOD_LGUI, KMOD_RMETA = sdl2.KMOD_RGUI, KMOD_META = sdl2.KMOD_GUI, KMOD_NUM = sdl2.KMOD_NUM, KMOD_CAPS = sdl2.KMOD_CAPS, KMOD_MODE = sdl2.KMOD_MODE, K_FIRST = 0, K_LAST = sdl2.SDLK_SLEEP, K_BREAK = sdl2.SDLK_PAUSE, K_EURO = sdl2.SDLK_CURRENCYUNIT, K_KP0 = sdl2.SDLK_KP_0, K_KP1 = sdl2.SDLK_KP_1, K_KP2 = sdl2.SDLK_KP_2, K_KP3 = sdl2.SDLK_KP_3, K_KP4 = sdl2.SDLK_KP_4, K_KP5 = sdl2.SDLK_KP_5, K_KP6 = sdl2.SDLK_KP_6, K_KP7 = sdl2.SDLK_KP_7, K_KP8 = sdl2.SDLK_KP_8, K_KP9 = sdl2.SDLK_KP_9, K_LMETA = sdl2.SDLK_LGUI, K_LSUPER = sdl2.SDLK_LGUI, K_RMETA = sdl2.SDLK_RGUI, K_RSUPER = sdl2.SDLK_RGUI, K_NUMLOCK = sdl2.SDLK_NUMLOCKCLEAR, K_SCROLLOCK = sdl2.SDLK_SCROLLLOCK, K_PRINT = sdl2.SDLK_PRINTSCREEN, )) TOUCH_MOUSEID = -1 include "controller.pxi" POWERSTATE_UNKNOWN = SDL_POWERSTATE_UNKNOWN POWERSTATE_ON_BATTERY = SDL_POWERSTATE_ON_BATTERY POWERSTATE_NO_BATTERY = SDL_POWERSTATE_NO_BATTERY POWERSTATE_CHARGING = SDL_POWERSTATE_CHARGING POWERSTATE_CHARGED = SDL_POWERSTATE_CHARGED pygame_sdl2-2.1.0-for-renpy-6.99.14.1/src/pygame_sdl2/color.pyx0000644000175000017500000003074513110653614023132 0ustar tomtom00000000000000# Copyright 2014 Tom Rothamel # Copyright 2014 Patrick Dawson # # This software is provided 'as-is', without any express or implied # warranty. In no event will the authors be held liable for any damages # arising from the use of this software. # # Permission is granted to anyone to use this software for any purpose, # including commercial applications, and to alter it and redistribute it # freely, subject to the following restrictions: # # 1. The origin of this software must not be misrepresented; you must not # claim that you wrote the original software. If you use this software # in a product, an acknowledgment in the product documentation would be # appreciated but is not required. # 2. Altered source versions must be plainly marked as such, and must not be # misrepresented as being the original software. # 3. This notice may not be removed or altered from any source distribution. from sdl2 cimport * import binascii import struct include "color_dict.pxi" cdef Uint32 map_color(SDL_Surface *surface, color) except? 0xaabbccdd: """ Maps `color` into an RGBA color value that can be used with `surface`. """ cdef Uint8 r, g, b, a if isinstance(color, (tuple, list, Color)) and len(color) == 4: r, g, b, a = color elif isinstance(color, (tuple, list, Color)) and len(color) == 3: r, g, b = color a = 255 elif isinstance(color, int): return color else: raise TypeError("Expected a color.") return SDL_MapRGBA(surface.format, r, g, b, a) cdef object get_color(Uint32 pixel, SDL_Surface *surface): cdef Uint8 r cdef Uint8 g cdef Uint8 b cdef Uint8 a SDL_GetRGBA(pixel, surface.format, &r, &g, &b, &a) return Color(r, g, b, a) cdef to_sdl_color(color, SDL_Color *out): if not isinstance(color, Color): color = Color(color) out.r = color.r out.g = color.g out.b = color.b out.a = color.a cdef class Color: cdef from_rgba(self, Uint8 r, Uint8 g, Uint8 b, Uint8 a): self.r = r self.g = g self.b = b self.a = a cdef from_hex(self, c): # Handle short hex strings. if len(c) == 3 or len(c) == 4: c = "".join(map(lambda x: x*2, c)) try: if len(c) == 6: r, g, b = struct.unpack('BBB', binascii.unhexlify(c)) a = 255 elif len(c) == 8: r, g, b, a = struct.unpack('BBBB', binascii.unhexlify(c)) else: raise ValueError(c) except TypeError as e: raise ValueError(c) self.from_rgba(r, g, b, a) cdef from_name(self, c): # Remove all whitespace. c = "".join(c.split()).lower() try: r, g, b = colors[c] except KeyError as e: raise ValueError(c) self.from_rgba(r, g, b, 255) def __richcmp__(Color x, y, int op): if op == 3: return not (x == y) if isinstance(y, tuple): y = Color(y) if not isinstance(y, Color): return False if op == 2: return x.r == y.r and x.g == y.g and x.b == y.b and x.a == y.a def __cinit__(self): self.length = 4 self.r = 0 self.g = 0 self.b = 0 self.a = 255 def __init__(self, *args): self.length = 4 if len(args) == 1: c = args[0] if isinstance(c, basestring): if c.startswith('#'): self.from_hex(c[1:]) elif c.startswith('0x'): self.from_hex(c[2:]) else: self.from_name(c) elif isinstance(c, (tuple, list, Color)): if len(c) == 4: self.from_rgba(c[0], c[1], c[2], c[3]) elif len(c) == 3: self.from_rgba(c[0], c[1], c[2], 255) else: raise ValueError(c) else: self.from_hex("%08x" % c) elif len(args) == 3: r, g, b = args self.from_rgba(r, g, b, 255) elif len(args) == 4: r, g, b, a = args self.from_rgba(r, g, b, a) def __repr__(self): return str((self.r, self.g, self.b, self.a)) def __int__(self): packed = struct.pack('BBBB', self.r, self.g, self.b, self.a) return struct.unpack('>L', packed)[0] def __hex__(self): return hex(int(self)) def __oct__(self): return oct(int(self)) def __float__(self): return float(int(self)) def __reduce__(self): d = {} d['rgba'] = (self.r, self.g, self.b, self.a) return (Color, (), d) def __setstate__(self, d): self.r, self.g, self.b, self.a = d['rgba'] def __setitem__(self, key, val): if not isinstance(val, int): raise ValueError(val) if key >= self.length: raise IndexError(key) if val < 0 or val > 255: raise ValueError(val) if key == 0: self.r = val elif key == 1: self.g = val elif key == 2: self.b = val elif key == 3: self.a = val else: raise IndexError(key) def __getitem__(self, key): if isinstance(key, slice): return tuple(self)[key] if key >= self.length: raise IndexError(key) if key == 0: return self.r elif key == 1: return self.g elif key == 2: return self.b elif key == 3: return self.a else: raise IndexError(key) def __len__(self): return self.length def __mul__(self not None, Color rhs not None): # Multiplying this way doesn't make much sense, # but it's how pygame does it. r = min(255, self.r * rhs.r) g = min(255, self.g * rhs.g) b = min(255, self.b * rhs.b) a = min(255, self.a * rhs.a) return type(self)(r, g, b, a) def __add__(self not None, Color rhs not None): r = min(255, self.r + rhs.r) g = min(255, self.g + rhs.g) b = min(255, self.b + rhs.b) a = min(255, self.a + rhs.a) return type(self)(r, g, b, a) def __sub__(self not None, Color rhs not None): r = max(0, self.r - rhs.r) g = max(0, self.g - rhs.g) b = max(0, self.b - rhs.b) a = max(0, self.a - rhs.a) return type(self)(r, g, b, a) def __mod__(self not None, Color rhs not None): def mod(l, r): if r == 0: return 0 return l % r r = mod(self.r, rhs.r) g = mod(self.g, rhs.g) b = mod(self.b, rhs.b) a = mod(self.a, rhs.a) return type(self)(r, g, b, a) def __div__(self not None, Color rhs not None): r = min(255, self.r / rhs.r) g = min(255, self.g / rhs.g) b = min(255, self.b / rhs.b) a = min(255, self.a / rhs.a) return type(self)(r, g, b, a) def __floordiv__(self not None, Color rhs not None): def div(a, b): if b == 0: return b return min(255, a // b) r = div(self.r, rhs.r) g = div(self.g, rhs.g) b = div(self.b, rhs.b) a = div(self.a, rhs.a) return type(self)(r, g, b, a) property cmy: def __get__(self): return 1 - (self.r / 255.0), 1 - (self.g / 255.0), 1 - (self.b / 255.0) def __set__(self, val): c, m, y = val self.r = (1 - c) * 255 self.g = (1 - m) * 255 self.b = (1 - y) * 255 property hsva: def __get__(self): cdef double r = self.r / 255.0 cdef double g = self.g / 255.0 cdef double b = self.b / 255.0 cdef double cmax = max(r, g, b) cdef double cmin = min(r, g, b) cdef double delta = cmax - cmin cdef double h, s, v, a if r == g == b: h = 0.0 s = 0.0 else: if cmax == r: h = 60.0 * ((g - b) / delta % 6) elif cmax == g: h = 60.0 * ((b - r) / delta + 2) else: h = 60.0 * ((r - g) / delta + 4) if cmax == 0.0: s = 0.0 else: s = delta / cmax * 100 v = cmax * 100 a = self.a / 255.0 * 100 return h, s, v, a def __set__(self, val): cdef double h, s, v, a if len(val) == 3: h, s, v = val a = 0.0 else: h, s, v, a = val h = h % 360.0 # These should be in a range of [0.0, 1.0] s /= 100.0 v /= 100.0 a /= 100.0 cdef double c = v * s cdef double x = c * (1 - abs((h / 60.0) % 2 - 1)) cdef double m = v - c cdef double r, g, b if 0 <= h < 60: r, g, b = c, x, 0 elif 60 <= h < 120: r, g, b = x, c, 0 elif 120 <= h < 180: r, g, b = 0, c, x elif 180 <= h < 240: r, g, b = 0, x, c elif 240 <= h < 300: r, g, b = x, 0, c elif 300 <= h < 360: r, g, b = c, 0, x else: raise ValueError() self.r = int(255 * (r + m)) self.g = int(255 * (g + m)) self.b = int(255 * (b + m)) self.a = int(255 * a) property hsla: def __get__(self): cdef double h, s, l, a cdef double r, g, b cdef double cmin, cmax, delta h = self.hsva[0] % 360.0 r = self.r / 255.0 g = self.g / 255.0 b = self.b / 255.0 cmin = min(r, g, b) cmax = max(r, g, b) delta = cmax - cmin l = (cmax + cmin) / 2.0 if delta == 0: s = 0.0 else: s = delta / (1 - abs(2 * l - 1)) a = self.a / 255.0 * 100 s = min(100.0, s * 100) l = min(100.0, l * 100) return h, s, l, a def __set__(self, val): cdef double h, s, l, a if len(val) == 3: h, s, l = val a = 0.0 else: h, s, l, a = val s /= 100.0 l /= 100.0 a /= 100.0 cdef double c = (1 - abs(2*l - 1)) * s cdef double x = c * (1 - abs((h / 60.0) % 2 - 1)) cdef double m = l - c / 2.0 cdef double r, g, b if 0 <= h < 60: r, g, b = c, x, 0 elif 60 <= h < 120: r, g, b = x, c, 0 elif 120 <= h < 180: r, g, b = 0, c, x elif 180 <= h < 240: r, g, b = 0, x, c elif 240 <= h < 300: r, g, b = x, 0, c elif 300 <= h < 360: r, g, b = c, 0, x else: raise ValueError() self.r = int(255 * (r + m)) self.g = int(255 * (g + m)) self.b = int(255 * (b + m)) self.a = int(255 * a) property i1i2i3: def __get__(self): # Take the dot product as described here: # http://de.wikipedia.org/wiki/I1I2I3-Farbraum cdef double i1, i2, i3 cdef double r, g, b r = self.r / 255.0 g = self.g / 255.0 b = self.b / 255.0 i1 = (r + g + b) / 3.0 i2 = (r - b) / 2.0 i3 = (2*g - r - b) / 4.0 return i1, i2, i3 def __set__(self, val): # Dot product with the inverted matrix. cdef double i1, i2, i3 cdef double r, g, b i1, i2, i3 = val r = i1 + i2 - (2.0/3.0 * i3) g = i1 + (4.0/3.0 * i3) b = i1 - i2 - (2.0/3.0 * i3) # Don't change alpha. self.r = int(r * 255) self.g = int(g * 255) self.b = int(b * 255) def normalize(self): return self.r / 255.0, self.g / 255.0, self.b / 255.0, self.a / 255.0 def correct_gamma(self, gamma): m = map(lambda x: int(round(pow(x / 255.0, gamma) * 255)), tuple(self)) c = type(self)(tuple(m)) return c def set_length(self, n): if n > 4 or n < 1: raise ValueError(n) self.length = n pygame_sdl2-2.1.0-for-renpy-6.99.14.1/src/pygame_sdl2/rect.pyx0000664000175000017500000002573613042556050022757 0ustar tomtom00000000000000# Copyright 2014 Tom Rothamel # Copyright 2014 Patrick Dawson # # This software is provided 'as-is', without any express or implied # warranty. In no event will the authors be held liable for any damages # arising from the use of this software. # # Permission is granted to anyone to use this software for any purpose, # including commercial applications, and to alter it and redistribute it # freely, subject to the following restrictions: # # 1. The origin of this software must not be misrepresented; you must not # claim that you wrote the original software. If you use this software # in a product, an acknowledgment in the product documentation would be # appreciated but is not required. # 2. Altered source versions must be plainly marked as such, and must not be # misrepresented as being the original software. # 3. This notice may not be removed or altered from any source distribution. import collections def flatten(*args): if len(args) == 1: return args[0] else: return args cdef class Rect: def __init__(self, *args): cdef int x, y, w, h cdef int len_args cdef Rect rect len_args = len(args) if len_args == 1 and isinstance(args[0], Rect): rect = args[0] x = rect.x y = rect.y w = rect.w h = rect.h elif len_args == 1 and len(args[0]) == 4: x, y, w, h = args[0] elif len_args == 1 and len(args[0]) == 2: x, y = args[0] w = 0 h = 0 elif len_args == 2: x, y = args[0] w, h = args[1] elif len_args == 4: x, y, w, h = args else: raise TypeError("Argument must be a rect style object.") self.x = x self.y = y self.w = w self.h = h def __reduce__(self): return (Rect, (self.x, self.y, self.w, self.h)) def __repr__(self): return "" % (self.x, self.y, self.w, self.h) def __len__(self): return 4 def __iter__(self): return iter((self.x, self.y, self.w, self.h)) def __richcmp__(Rect a, b, int op): if not isinstance(b, Rect): b = Rect(b) if op == 2: return a.x == b.x and a.y == b.y and a.w == b.w and a.h == b.h def __getitem__(self, key): return (self.x, self.y, self.w, self.h)[key] def __setitem__(self, key, val): if key == 0: self.x = val elif key == 1: self.y = val elif key == 2: self.w = val elif key == 3: self.h = val else: raise IndexError(key) property left: def __get__(self): return self.x def __set__(self, val): self.x = val property top: def __get__(self): return self.y def __set__(self, val): self.y = val property width: def __get__(self): return self.w def __set__(self, val): self.w = val property height: def __get__(self): return self.h def __set__(self, val): self.h = val property right: def __get__(self): return self.x + self.width def __set__(self, val): self.x += val - self.right property bottom: def __get__(self): return self.y + self.height def __set__(self, val): self.y += val - self.bottom property size: def __get__(self): return (self.w, self.h) def __set__(self, val): self.w, self.h = val property topleft: def __get__(self): return (self.left, self.top) def __set__(self, val): self.left, self.top = val property topright: def __get__(self): return (self.right, self.top) def __set__(self, val): self.right, self.top = val property bottomright: def __get__(self): return (self.right, self.bottom) def __set__(self, val): self.right, self.bottom = val property bottomleft: def __get__(self): return (self.left, self.bottom) def __set__(self, val): self.left, self.bottom = val property centerx: def __get__(self): return self.x + (self.w / 2) def __set__(self, val): self.x += val - self.centerx property centery: def __get__(self): return self.y + (self.h / 2) def __set__(self, val): self.y += val - self.centery property center: def __get__(self): return (self.centerx, self.centery) def __set__(self, val): self.centerx, self.centery = val property midtop: def __get__(self): return (self.centerx, self.top) def __set__(self, val): self.centerx, self.top = val property midleft: def __get__(self): return (self.left, self.centery) def __set__(self, val): self.left, self.centery = val property midbottom: def __get__(self): return (self.centerx, self.bottom) def __set__(self, val): self.centerx, self.bottom = val property midright: def __get__(self): return (self.right, self.centery) def __set__(self, val): self.right, self.centery = val def copy(self): return Rect(self) def move(self, *args): r = self.copy() r.move_ip(*args) return r def move_ip(self, *args): x, y = flatten(args) self.x += x self.y += y def inflate(self, *args): r = self.copy() r.inflate_ip(*args) return r def inflate_ip(self, *args): x, y = flatten(args) c = self.center self.w += x self.h += y self.center = c def clamp(self, other): r = self.copy() r.clamp_ip(other) return r def clamp_ip(self, other): if not isinstance(other, Rect): other = Rect(other) if self.w > other.w or self.h > other.h: self.center = other.center else: if self.left < other.left: self.left = other.left elif self.right > other.right: self.right = other.right if self.top < other.top: self.top = other.top elif self.bottom > other.bottom: self.bottom = other.bottom def clip(self, other, y=None, w=None, h=None): if type(other) == int: other = Rect(other, y, w, h) if not isinstance(other, Rect): other = Rect(other) if not self.colliderect(other): return Rect(0,0,0,0) r = self.copy() # Remember that (0,0) is the top left. if r.left < other.left: d = other.left - r.left r.left += d r.width -= d if r.right > other.right: d = r.right - other.right r.width -=d if r.top < other.top: d = other.top - r.top r.top += d r.height -= d if r.bottom > other.bottom: d = r.bottom - other.bottom r.height -= d return r def union(self, other): r = self.copy() r.union_ip(other) return r def union_ip(self, other): if not isinstance(other, Rect): other = Rect(other) x = min(self.x, other.x) y = min(self.y, other.y) self.w = max(self.right, other.right) - x self.h = max(self.bottom, other.bottom) - y self.x = x self.y = y def unionall(self, other_seq): r = self.copy() r.unionall_ip(other_seq) return r def unionall_ip(self, other_seq): for other in other_seq: self.union_ip(other) def fit(self, other): if not isinstance(other, Rect): other = Rect(other) # Not sure if this is entirely correct. Docs and tests are ambiguous. r = self.copy() r.topleft = other.topleft w_ratio = other.w / float(r.w) h_ratio = other.h / float(r.h) factor = min(w_ratio, h_ratio) r.w *= factor r.h *= factor return r def normalize(self): if self.w < 0: self.x += self.w self.w = -self.w if self.h < 0: self.y += self.h self.h = -self.h def contains(self, other): if not isinstance(other, Rect): other = Rect(other) return other.x >= self.x and other.right <= self.right and \ other.y >= self.y and other.bottom <= self.bottom and \ other.left < self.right and other.top < self.bottom def collidepoint(self, x, y=None): if type(x) == tuple: x, y = x return x >= self.x and y >= self.y and \ x < self.right and y < self.bottom def colliderect(self, other): if not isinstance(other, Rect): other = Rect(other) return self.left < other.right and self.top < other.bottom and \ self.right > other.left and self.bottom > other.top def collidelist(self, other_list): for n, other in zip(range(len(other_list)), other_list): if self.colliderect(other): return n return -1 def collidelistall(self, other_list): ret = [] for n, other in zip(range(len(other_list)), other_list): if self.colliderect(other): ret.append(n) return ret def collidedict(self, other_dict, rects_values=0): # What is rects_values supposed to do? Not in docs. for key, val in other_dict.iteritems(): if self.colliderect(val): return key, val return None def collidedictall(self, other_dict, rects_values=0): ret = [] for key, val in other_dict.iteritems(): if self.colliderect(val): ret.append((key,val)) return ret cdef int to_sdl_rect(rectlike, SDL_Rect *rect, argname=None) except -1: """ Converts `rectlike` to the SDL_Rect `rect`. `rectlike` may be a Rect or a (x, y, w, h) tuple. """ cdef int x, y, w, h cdef Rect rl try: if isinstance(rectlike, Rect): rl = rectlike rect.x = rl.x rect.y = rl.y rect.w = rl.w rect.h = rl.h return 0 elif len(rectlike) == 4: rect.x, rect.y, rect.w, rect.h = rectlike return 0 elif len(rectlike) == 2: rect.x, rect.y = rectlike rect.w, rect.h = rectlike return 0 except: pass if argname: raise TypeError("Argument {} must be a rect style object.".format(argname)) else: raise TypeError("Argument must be a rect style object.") pygame_sdl2-2.1.0-for-renpy-6.99.14.1/src/pygame_sdl2/draw.pyx0000664000175000017500000001041012510003366022732 0ustar tomtom00000000000000# Copyright 2014 Patrick Dawson # # This software is provided 'as-is', without any express or implied # warranty. In no event will the authors be held liable for any damages # arising from the use of this software. # # Permission is granted to anyone to use this software for any purpose, # including commercial applications, and to alter it and redistribute it # freely, subject to the following restrictions: # # 1. The origin of this software must not be misrepresented; you must not # claim that you wrote the original software. If you use this software # in a product, an acknowledgment in the product documentation would be # appreciated but is not required. # 2. Altered source versions must be plainly marked as such, and must not be # misrepresented as being the original software. # 3. This notice may not be removed or altered from any source distribution. from sdl2 cimport * from pygame_sdl2.surface cimport Surface import pygame_sdl2.gfxdraw as gfxdraw from pygame_sdl2.rect import Rect from pygame_sdl2.error import error def rect(Surface surface, color, rect, width=0): if not isinstance(rect, Rect): rect = Rect(rect) if width == 0: gfxdraw.box(surface, rect, color) else: gfxdraw.rectangle(surface, rect, color) n = 1 while n < width: r = Rect(rect.x - n, rect.y - n, rect.w + (n*2), rect.h + (n*2)) gfxdraw.rectangle(surface, r, color) r = Rect(rect.x + n, rect.y + n, rect.w - (n*2), rect.h - (n*2)) gfxdraw.rectangle(surface, r, color) n += 1 dirty = Rect(rect.x - width, rect.y - width, rect.w + (width*2), rect.h + (width*2)) return dirty.clip(surface.get_rect()) def polygon(Surface surface, color, pointlist, width=0): if width == 0: gfxdraw.filled_polygon(surface, pointlist, color) dirty = Rect(pointlist[0], (1, 1)) n = 1 while n < len(pointlist): dirty.union_ip(Rect(pointlist[n], (1,1))) n += 1 return dirty.clip(surface.get_rect()) else: return lines(surface, color, True, pointlist, width) def circle(Surface surface, color, pos, radius, width=0): x, y = pos if width == 0: gfxdraw.filled_circle(surface, x, y, radius, color) dirty = Rect((x - radius, y - radius), (radius*2, radius*2)) return dirty.clip(surface.get_rect()) else: gfxdraw.circle(surface, x, y, radius, color) n = 1 while n < width: gfxdraw.circle(surface, x, y, radius - 1, color) gfxdraw.circle(surface, x, y, radius + 1, color) n += 1 dirty = Rect(x - radius - width, y - radius - width, (radius*2) + width, (radius*2) + width) return dirty.clip(surface.get_rect()) def ellipse(Surface surface, color, rect, width=0): raise error("Not implemented.") def arc(Surface surface, color, rect, start_angle, stop_angle, width=1): raise error("Not implemented.") def line(Surface surface, color, start_pos, end_pos, width=1): gfxdraw.thick_line(surface, start_pos[0], start_pos[1], end_pos[0], end_pos[1], width, color) dirty = Rect(start_pos, (width, width)) dirty.union_ip(Rect(end_pos, (width, width))) return dirty.clip(surface.get_rect()) def lines(Surface surface, color, closed, pointlist, width=1): n = 0 dirty = Rect(pointlist[0], (width, width)) while n < len(pointlist) - 1: line(surface, color, pointlist[n], pointlist[n+1], width) dirty.union_ip(Rect(pointlist[n+1], (width, width))) n += 1 if closed: line(surface, color, pointlist[n], pointlist[0], width) return dirty.clip(surface.get_rect()) def aaline(Surface surface, color, startpos, endpos, blend=1): x1, y1 = startpos x2, y2 = endpos gfxdraw.aaline(surface, x1, y1, x2, y2, color) dirty = Rect(x1, y1, x2 - x1, y2 - y1) return dirty.clip(surface.get_rect()) def aalines(Surface surface, color, closed, pointlist, blend=1): n = 0 dirty = Rect(pointlist[0], (1,1)) while n < len(pointlist) - 1: r = aaline(surface, color, pointlist[n], pointlist[n+1]) dirty.union_ip(r) n += 1 if closed: aaline(surface, color, pointlist[n], pointlist[0]) return dirty.clip(surface.get_rect()) pygame_sdl2-2.1.0-for-renpy-6.99.14.1/src/pygame_sdl2/time.py0000664000175000017500000000226012443172541022556 0ustar tomtom00000000000000# Copyright 2014 Tom Rothamel # # This software is provided 'as-is', without any express or implied # warranty. In no event will the authors be held liable for any damages # arising from the use of this software. # # Permission is granted to anyone to use this software for any purpose, # including commercial applications, and to alter it and redistribute it # freely, subject to the following restrictions: # # 1. The origin of this software must not be misrepresented; you must not # claim that you wrote the original software. If you use this software # in a product, an acknowledgment in the product documentation would be # appreciated but is not required. # 2. Altered source versions must be plainly marked as such, and must not be # misrepresented as being the original software. # 3. This notice may not be removed or altered from any source distribution. # This file exists because this file must be python, and not cython. That's # because the init function time.pyx is inittime, which conflicts with the # built-in inittime function (used by the time module) when everything is # statically linked, as it is on iOS. from pygame_sdl2.pygame_time import * pygame_sdl2-2.1.0-for-renpy-6.99.14.1/src/pygame_sdl2/mixer_music.pyx0000664000175000017500000000515212507776726024357 0ustar tomtom00000000000000# Copyright 2014 Patrick Dawson # # This software is provided 'as-is', without any express or implied # warranty. In no event will the authors be held liable for any damages # arising from the use of this software. # # Permission is granted to anyone to use this software for any purpose, # including commercial applications, and to alter it and redistribute it # freely, subject to the following restrictions: # # 1. The origin of this software must not be misrepresented; you must not # claim that you wrote the original software. If you use this software # in a product, an acknowledgment in the product documentation would be # appreciated but is not required. # 2. Altered source versions must be plainly marked as such, and must not be # misrepresented as being the original software. # 3. This notice may not be removed or altered from any source distribution. from sdl2 cimport * from sdl2_mixer cimport * from pygame_sdl2.rwobject cimport to_rwops from libc.string cimport memset from pygame_sdl2.error import error cdef Mix_Music *current_music = NULL cdef object queued_music = None cdef int endevent = 0 cdef void music_finished(): global queued_music if queued_music: load(queued_music) play() queued_music = None cdef SDL_Event e if endevent != 0: memset(&e, 0, sizeof(SDL_Event)) e.type = endevent SDL_PushEvent(&e) def load(fi): global current_music # Free any previously loaded music. if current_music != NULL: Mix_FreeMusic(current_music) current_music = Mix_LoadMUS_RW(to_rwops(fi), 1) if current_music == NULL: raise error() def play(loops=0, double start=0.0): Mix_FadeInMusicPos(current_music, loops, 0, start) def rewind(): Mix_RewindMusic() def stop(): Mix_HaltMusic() def pause(): Mix_PauseMusic() def unpause(): Mix_ResumeMusic() def fadeout(time): Mix_FadeOutMusic(time) def set_volume(double value): Mix_VolumeMusic((MIX_MAX_VOLUME * value)) def get_volume(): return Mix_VolumeMusic(-1) / MIX_MAX_VOLUME def get_busy(): return Mix_PlayingMusic() def set_pos(double pos): Mix_SetMusicPosition(pos) def get_pos(): # TODO: Use a Mix_SetPostMix callback to track position. raise error("Not implemented.") def queue(fi): Mix_HookMusicFinished(music_finished) if get_busy(): global queued_music queued_music = fi else: load(fi) play() def set_endevent(type=None): Mix_HookMusicFinished(music_finished) global endevent endevent = type or 0 def get_endevent(): return endevent pygame_sdl2-2.1.0-for-renpy-6.99.14.1/src/pygame_sdl2/__init__.py0000644000175000017500000001042713201701200023340 0ustar tomtom00000000000000# Copyright 2014 Tom Rothamel # Copyright 2014 Patrick Dawson # # This software is provided 'as-is', without any express or implied # warranty. In no event will the authors be held liable for any damages # arising from the use of this software. # # Permission is granted to anyone to use this software for any purpose, # including commercial applications, and to alter it and redistribute it # freely, subject to the following restrictions: # # 1. The origin of this software must not be misrepresented; you must not # claim that you wrote the original software. If you use this software # in a product, an acknowledgment in the product documentation would be # appreciated but is not required. # 2. Altered source versions must be plainly marked as such, and must not be # misrepresented as being the original software. # 3. This notice may not be removed or altered from any source distribution. from __future__ import division, print_function, absolute_import import sys import importlib class MissingModule(object): def __init__(self, name, reason): self.__name__ = name self.reason = reason def __getattr__(self, attr): raise NotImplementedError(self.reason) def try_import(name): full_name = "pygame_sdl2." + name try: module = importlib.import_module(full_name) except (IOError, ImportError) as e: module = MissingModule(full_name, "Could not import {}: {}".format(full_name, str(e))) globals()[name] = module sys.modules[full_name] = module # Lists of functions that are called on init and quit. init_functions = [ ] quit_functions = [ ] def register_init(fn): init_functions.append(fn) return fn def register_quit(fn): quit_functions.append(fn) return fn def init(): numpass = 0 numfail = 0 for i in init_functions: try: i() numpass += 1 except: numfail += 1 return numpass, numfail def quit(): # @ReservedAssignment for i in quit_functions: try: i() except: pass # Import core modules. from pygame_sdl2.error import * from pygame_sdl2.surface import Surface from pygame_sdl2.rect import Rect import pygame_sdl2.color import pygame_sdl2.display import pygame_sdl2.event import pygame_sdl2.key import pygame_sdl2.locals # @ReservedAssignment import pygame_sdl2.time import pygame_sdl2.version import pygame_sdl2.locals as constants # Import optional modules. try_import("controller") try_import("draw") try_import("font") try_import("image") try_import("joystick") try_import("mixer") try_import("mouse") try_import("power") try_import("transform") try_import("scrap") try_import("sprite") try_import("sysfont") # Optional imports should be included in this function, so they show up # in packaging tools (like py2exe). def _optional_imports(): import pygame_sdl2.compat import pygame_sdl2.controller import pygame_sdl2.rwobject import pygame_sdl2.gfxdraw import pygame_sdl2.draw import pygame_sdl2.font import pygame_sdl2.image import pygame_sdl2.joystick import pygame_sdl2.mixer import pygame_sdl2.mouse import pygame_sdl2.power import pygame_sdl2.transform import pygame_sdl2.scrap import pygame_sdl2.sprite import pygame_sdl2.sysfont # Fill this module with locals. from pygame_sdl2.locals import * def import_as_pygame(): """ Imports pygame_sdl2 as pygame, so that running the 'import pygame.whatever' statement will import pygame_sdl2.whatever instead. """ import os import warnings if "PYGAME_SDL2_USE_PYGAME" in os.environ: return if "pygame" in sys.modules: warnings.warn("Pygame has already been imported, import_as_pygame may not work.", stacklevel=2) for name, mod in list(sys.modules.items()): name = name.split('.') if name[0] != 'pygame_sdl2': continue name[0] = 'pygame' name = ".".join(name) sys.modules[name] = mod sys.modules['pygame.constants'] = constants def get_sdl_byteorder(): return BYTEORDER def get_sdl_version(): return SDL_VERSION_TUPLE get_platform = pygame_sdl2.display.get_platform # We have new-style buffers, but not the pygame.newbuffer module. HAVE_NEWBUF = False pygame_sdl2-2.1.0-for-renpy-6.99.14.1/src/pygame_sdl2/transform.pyx0000664000175000017500000001404612562762535024042 0ustar tomtom00000000000000# Copyright 2014 Patrick Dawson # Tom Rothamel # # This software is provided 'as-is', without any express or implied # warranty. In no event will the authors be held liable for any damages # arising from the use of this software. # # Permission is granted to anyone to use this software for any purpose, # including commercial applications, and to alter it and redistribute it # freely, subject to the following restrictions: # # 1. The origin of this software must not be misrepresented; you must not # claim that you wrote the original software. If you use this software # in a product, an acknowledgment in the product documentation would be # appreciated but is not required. # 2. Altered source versions must be plainly marked as such, and must not be # misrepresented as being the original software. # 3. This notice may not be removed or altered from any source distribution. from sdl2 cimport * from sdl2_gfx cimport * from pygame_sdl2.surface cimport * from pygame_sdl2.error import error def flip(Surface surface, bint xbool, bint ybool): cdef Surface rv = Surface(surface.get_size(), surface.get_flags(), surface) cdef SDL_Surface *src = surface.surface cdef SDL_Surface *dest = rv.surface cdef Uint32 *src_pixel cdef Uint32 *src_end cdef Uint32 *dest_pixel cdef int dest_delta cdef int y with nogil: for 0 <= y < src.h: src_pixel = (( src.pixels) + y * src.pitch) src_end = src_pixel + src.w if ybool: dest_pixel = (( dest.pixels) + (dest.h - y - 1) * dest.pitch) else: dest_pixel = (( dest.pixels) + y * dest.pitch) if xbool: dest_pixel += (src.w - 1) dest_delta = -1 else: dest_delta = 1 while src_pixel < src_end: dest_pixel[0] = src_pixel[0] src_pixel += 1 dest_pixel += dest_delta return rv def scale(Surface surface, size, Surface DestSurface=None): cdef Surface surf_out cdef int err = -1 if DestSurface == None: surf_out = Surface(size, 0, surface) else: surf_out = DestSurface with nogil: SDL_SetSurfaceBlendMode(surface.surface, SDL_BLENDMODE_NONE) err = SDL_UpperBlitScaled(surface.surface, NULL, surf_out.surface, NULL) if err != 0: raise error() return surf_out def rotate(Surface surface, angle): # rotateSurface90Degrees always returns NULL without setting an error?? # cdef SDL_Surface *rsurf # if angle % 90 == 0: # rsurf = rotateSurface90Degrees(surface.surface, angle / 90) # if rsurf == NULL: # raise error() return rotozoom(surface, angle, 1.0, SMOOTHING_OFF) def rotozoom(Surface surface, double angle, double scale, int smooth=1): cdef SDL_Surface *rsurf = NULL cdef Surface rv with nogil: rsurf = rotozoomSurface(surface.surface, angle, scale, smooth) if rsurf == NULL: raise error() rv = Surface(()) rv.take_surface(rsurf) return rv cdef uint32_t get_at(SDL_Surface *surf, int x, int y) nogil: if x < 0: x = 0 elif x >= surf.w: x = surf.w - 1 if y < 0: y = 0 elif y >= surf.h: y = surf.h - 1 cdef uint32_t *p = surf.pixels p += y * (surf.pitch // sizeof(uint32_t)) p += x return p[0] cdef void set_at(SDL_Surface *surf, int x, int y, uint32_t color) nogil: cdef uint32_t *p = surf.pixels p += y * (surf.pitch // sizeof(uint32_t)) p += x p[0] = color def scale2x(Surface surface, Surface DestSurface=None): cdef int x, y cdef uint32_t a, b, c, d, e, f, g, h, i cdef uint32_t e0, e1, e2, e3 if surface.get_bytesize() != 4: raise error("Surface has unsupported bytesize.") cdef Surface surf_out = DestSurface if surf_out == None: surf_out = Surface((surface.get_width()*2, surface.get_height()*2), 0, surface) surface.lock() surf_out.lock() cdef int width, height width, height = surface.get_size() with nogil: for x in range(width): for y in range(height): # Get the surrounding 9 pixels. a = get_at(surface.surface, x - 1, y - 1) b = get_at(surface.surface, x, y - 1) c = get_at(surface.surface, x + 1, y - 1) d = get_at(surface.surface, x - 1, y) e = get_at(surface.surface, x, y) f = get_at(surface.surface, x + 1, y) g = get_at(surface.surface, x - 1, y + 1) h = get_at(surface.surface, x, y + 1) i = get_at(surface.surface, x + 1, y + 1) # Expand the center pixel. if b != h and d != f: e0 = d if d == b else e e1 = f if b == f else e e2 = d if d == h else e e3 = f if h == f else e else: e0 = e1 = e2 = e3 = e set_at(surf_out.surface, x*2, y*2, e0) set_at(surf_out.surface, (x*2)+1, y*2, e1) set_at(surf_out.surface, x*2, (y*2)+1, e2) set_at(surf_out.surface, (x*2)+1, (y*2)+1, e3) surf_out.unlock() surface.unlock() return surf_out def smoothscale(Surface surface, size, Surface DestSurface=None): cdef double scale_x = size[0] / surface.surface.w cdef double scale_y = size[1] / surface.surface.h cdef SDL_Surface *rsurf = NULL cdef Surface rv with nogil: rsurf = rotozoomSurfaceXY(surface.surface, 0.0, scale_x, scale_y, SMOOTHING_ON) if rsurf == NULL: raise error() rv = Surface(()) rv.take_surface(rsurf) # This is inefficient. if DestSurface: with nogil: SDL_SetSurfaceBlendMode(rv.surface, SDL_BLENDMODE_NONE) SDL_UpperBlit(rv.surface, NULL, DestSurface.surface, NULL) return rv pygame_sdl2-2.1.0-for-renpy-6.99.14.1/src/pygame_sdl2/mixer.pyx0000664000175000017500000002036613025652641023144 0ustar tomtom00000000000000# Copyright 2014 Patrick Dawson # # This software is provided 'as-is', without any express or implied # warranty. In no event will the authors be held liable for any damages # arising from the use of this software. # # Permission is granted to anyone to use this software for any purpose, # including commercial applications, and to alter it and redistribute it # freely, subject to the following restrictions: # # 1. The origin of this software must not be misrepresented; you must not # claim that you wrote the original software. If you use this software # in a product, an acknowledgment in the product documentation would be # appreciated but is not required. # 2. Altered source versions must be plainly marked as such, and must not be # misrepresented as being the original software. # 3. This notice may not be removed or altered from any source distribution. from sdl2 cimport * from sdl2_mixer cimport * from pygame_sdl2.rwobject cimport to_rwops from libc.string cimport memset import sys import threading from pygame_sdl2.error import error import pygame_sdl2.mixer_music as music import pygame_sdl2 cdef object preinit_args = None cdef object output_spec = None cdef dict channel_events = {} cdef dict channel_queued = {} cdef dict current_sounds = {} # The lock protects channel_queued and current_sounds. _lock = threading.Lock() def _play_current(int channel): """ Caled by channel_callback to play the next sound. This has to be called from a different thread, as the channel callback isn't allowed to call MIX functions. """ cdef Sound next_sound with _lock: next_sound = channel_queued[channel] current_sounds[channel] = next_sound channel_queued[channel] = None if next_sound: with nogil: Mix_PlayChannelTimed(channel, next_sound.chunk, 0, -1) cdef void channel_callback(int channel) with gil: cdef int etype = 0 cdef SDL_Event e etype = channel_events.get(channel, 0) if etype != 0: memset(&e, 0, sizeof(SDL_Event)) e.type = etype SDL_PushEvent(&e) with _lock: next_sound = channel_queued.get(channel) if next_sound: threading.Thread(target=_play_current, args=(channel,)).start() # A list of errors that occured during mixer initialization. errors = [ ] @pygame_sdl2.register_init def init(frequency=22050, size=MIX_DEFAULT_FORMAT, channels=2, buffer=4096): if get_init() is not None: return for flag in (MIX_INIT_FLAC, MIX_INIT_MOD, MIX_INIT_MODPLUG, MIX_INIT_MP3, MIX_INIT_OGG, MIX_INIT_FLUIDSYNTH): if Mix_Init(flag) != flag: errors.append("{}\n".format(SDL_GetError())) if preinit_args: frequency, size, channels, buffer = preinit_args if Mix_OpenAudio(frequency, size, channels, buffer) != 0: raise error() global output_spec output_spec = get_init() Mix_ChannelFinished(channel_callback) def pre_init(frequency=22050, size=MIX_DEFAULT_FORMAT, channels=2, buffersize=4096): global preinit_args preinit_args = (frequency, size, channels, buffersize) @pygame_sdl2.register_quit def quit(): # @ReservedAssignment Mix_CloseAudio() Mix_Quit() def get_init(): cdef int frequency cdef Uint16 format cdef int channels if Mix_QuerySpec(&frequency, &format, &channels) == 0: return None else: return frequency, format, channels def stop(): with nogil: Mix_HaltChannel(-1) def pause(): with nogil: Mix_Pause(-1) def unpause(): with nogil: Mix_Resume(-1) def fadeout(time): cdef int ms = time with nogil: Mix_FadeOutChannel(-1, ms) def set_num_channels(count): Mix_AllocateChannels(count) def get_num_channels(): return Mix_AllocateChannels(-1) def set_reserved(count): Mix_ReserveChannels(count) def find_channel(force=False): cdef int chan chan = Mix_GroupAvailable(-1) if chan == -1: if not force: return None chan = Mix_GroupOldest(-1) if chan == -1: raise error() return Channel(chan) def get_busy(): return Mix_GroupNewer(-1) != -1 cdef class Sound: cdef Mix_Chunk *chunk def __cinit__(self): self.chunk = NULL def __dealloc__(self): if self.chunk: Mix_FreeChunk(self.chunk) def __init__(self, fi): self.chunk = Mix_LoadWAV_RW(to_rwops(fi), 1) if self.chunk == NULL: raise error() def play(self, loops=0, maxtime=-1, fade_ms=0): cdef int cid cdef int _loops = loops cdef int _maxtime = maxtime cdef int _fade_ms = fade_ms with nogil: if _fade_ms != 0: cid = Mix_FadeInChannelTimed(-1, self.chunk, _loops, _fade_ms, _maxtime) else: cid = Mix_PlayChannelTimed(-1, self.chunk, _loops, _maxtime) if cid == -1: raise error() return Channel(cid) def stop(self): cdef int i = 0 while i < Mix_AllocateChannels(-1): if Mix_GetChunk(i) == self.chunk: with nogil: Mix_HaltChannel(i) i += 1 def pause(self): cdef int i = 0 while i < Mix_AllocateChannels(-1): if Mix_GetChunk(i) == self.chunk: with nogil: Mix_Pause(i) i += 1 def unpause(self): cdef int i = 0 while i < Mix_AllocateChannels(-1): if Mix_GetChunk(i) == self.chunk: with nogil: Mix_Resume(i) i += 1 def fadeout(self, time): cdef int i = 0 cdef int ms = time while i < Mix_AllocateChannels(-1): if Mix_GetChunk(i) == self.chunk: with nogil: Mix_FadeOutChannel(i, ms) i += 1 def set_volume(self, value): Mix_VolumeChunk(self.chunk, MIX_MAX_VOLUME * value) def get_volume(self): return Mix_VolumeChunk(self.chunk, -1) def get_num_channels(self): cdef int i = 0 cdef int n = 0 while i < Mix_AllocateChannels(-1): if Mix_GetChunk(i) == self.chunk: n += 1 i += 1 return n def get_length(self): # TODO: Adjust for actual format, rather than assuming 16-bit. return self.chunk.alen / output_spec[0] / 2 / output_spec[2] def get_raw(self): # return self.chunk.abuf raise error("Not implemented.") cdef class Channel(object): cdef int cid def __init__(self, cid): self.cid = cid def play(self, Sound sound not None, loops=0, maxtime=-1, fade_ms=0): cdef int _loops = loops cdef int _maxtime = maxtime cdef int _fade_ms = fade_ms with nogil: if _fade_ms != 0: cid = Mix_FadeInChannelTimed(self.cid, sound.chunk, _loops, _fade_ms, _maxtime) else: cid = Mix_PlayChannelTimed(self.cid, sound.chunk, _loops, _maxtime) if cid == -1: raise error() with _lock: current_sounds[self.cid] = sound def stop(self): with nogil: Mix_HaltChannel(self.cid) def pause(self): with nogil: Mix_Pause(self.cid) def unpause(self): with nogil: Mix_Resume(self.cid) def fadeout(self, time): cdef int ms = time with nogil: Mix_FadeOutChannel(self.cid, ms) def set_volume(self, volume): Mix_Volume(self.cid, int(MIX_MAX_VOLUME * volume)) def get_volume(self): cdef int vol = Mix_Volume(self.cid, -1) return vol / MIX_MAX_VOLUME def get_busy(self): return Mix_Playing(self.cid) != 0 def get_sound(self): with _lock: return current_sounds.get(self.cid) def queue(self, Sound sound): if self.get_busy(): with _lock: channel_queued[self.cid] = sound else: self.play(sound) def get_queue(self): with _lock: return channel_queued.get(self.cid) def set_endevent(self, type=None): channel_events[self.cid] = type or 0 def get_endevent(self): return channel_events.get(self.cid, 0) pygame_sdl2-2.1.0-for-renpy-6.99.14.1/src/pygame_sdl2/power.pyx0000644000175000017500000000337313205033243023140 0ustar tomtom00000000000000# Copyright 2017 Tom Rothamel # # This software is provided 'as-is', without any express or implied # warranty. In no event will the authors be held liable for any damages # arising from the use of this software. # # Permission is granted to anyone to use this software for any purpose, # including commercial applications, and to alter it and redistribute it # freely, subject to the following restrictions: # # 1. The origin of this software must not be misrepresented; you must not # claim that you wrote the original software. If you use this software # in a product, an acknowledgment in the product documentation would be # appreciated but is not required. # 2. Altered source versions must be plainly marked as such, and must not be # misrepresented as being the original software. # 3. This notice may not be removed or altered from any source distribution. from pygame_sdl2.locals import POWERSTATE_UNKNOWN, POWERSTATE_ON_BATTERY, POWERSTATE_NO_BATTERY, POWERSTATE_CHARGING, POWERSTATE_CHARGED from sdl2 cimport * powerstate_to_name = { POWERSTATE_UNKNOWN : "POWERSTATE_UNKNOWN", POWERSTATE_ON_BATTERY : "POWERSTATE_ON_BATTERY", POWERSTATE_NO_BATTERY : "POWERSTATE_NO_BATTERY", POWERSTATE_CHARGING : "POWERSTATE_CHARGING", POWERSTATE_CHARGED : "POWERSTATE_CHARGED", } class PowerInfo(object): def __repr__(self): return "".format( powerstate_to_name.get(self.state, "INVALID"), self.seconds, self.percent) def get_power_info(): cdef int seconds cdef int percent state = SDL_GetPowerInfo(&seconds, &percent) rv = PowerInfo() rv.state = state rv.seconds = seconds rv.percent = percent return rv pygame_sdl2-2.1.0-for-renpy-6.99.14.1/src/pygame_sdl2/rect.pxd0000664000175000017500000000220012426424312022707 0ustar tomtom00000000000000# Copyright 2014 Tom Rothamel # # This software is provided 'as-is', without any express or implied # warranty. In no event will the authors be held liable for any damages # arising from the use of this software. # # Permission is granted to anyone to use this software for any purpose, # including commercial applications, and to alter it and redistribute it # freely, subject to the following restrictions: # # 1. The origin of this software must not be misrepresented; you must not # claim that you wrote the original software. If you use this software # in a product, an acknowledgment in the product documentation would be # appreciated but is not required. # 2. Altered source versions must be plainly marked as such, and must not be # misrepresented as being the original software. # 3. This notice may not be removed or altered from any source distribution. from sdl2 cimport * cdef class Rect: # Allow weak references. cdef object __weakref__ cdef public int x cdef public int y cdef public int w cdef public int h cdef int to_sdl_rect(rectlike, SDL_Rect *rect, argname=*) except -1 pygame_sdl2-2.1.0-for-renpy-6.99.14.1/src/pygame_sdl2/sprite.py0000664000175000017500000015450712426307605023144 0ustar tomtom00000000000000## pygame - Python Game Library ## Copyright (C) 2000-2003, 2007 Pete Shinners ## (C) 2004 Joe Wreschnig ## This library is free software; you can redistribute it and/or ## modify it under the terms of the GNU Library General Public ## License as published by the Free Software Foundation; either ## version 2 of the License, or (at your option) any later version. ## ## This library is distributed in the hope that it will be useful, ## but WITHOUT ANY WARRANTY; without even the implied warranty of ## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU ## Library General Public License for more details. ## ## You should have received a copy of the GNU Library General Public ## License along with this library; if not, write to the Free ## Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA ## ## Pete Shinners ## pete@shinners.org """pygame module with basic game object classes This module contains several simple classes to be used within games. There are the main Sprite class and several Group classes that contain Sprites. The use of these classes is entirely optional when using Pygame. The classes are fairly lightweight and only provide a starting place for the code that is common to most games. The Sprite class is intended to be used as a base class for the different types of objects in the game. There is also a base Group class that simply stores sprites. A game could create new types of Group classes that operate on specially customized Sprite instances they contain. The basic Sprite class can draw the Sprites it contains to a Surface. The Group.draw() method requires that each Sprite have a Surface.image attribute and a Surface.rect. The Group.clear() method requires these same attributes and can be used to erase all the Sprites with background. There are also more advanced Groups: pygame.sprite.RenderUpdates() and pygame.sprite.OrderedUpdates(). Lastly, this module contains several collision functions. These help find sprites inside multiple groups that have intersecting bounding rectangles. To find the collisions, the Sprites are required to have a Surface.rect attribute assigned. The groups are designed for high efficiency in removing and adding Sprites to them. They also allow cheap testing to see if a Sprite already exists in a Group. A given Sprite can exist in any number of groups. A game could use some groups to control object rendering, and a completely separate set of groups to control interaction or player movement. Instead of adding type attributes or bools to a derived Sprite class, consider keeping the Sprites inside organized Groups. This will allow for easier lookup later in the game. Sprites and Groups manage their relationships with the add() and remove() methods. These methods can accept a single or multiple group arguments for membership. The default initializers for these classes also take a single group or list of groups as argments for initial membership. It is safe to repeatedly add and remove the same Sprite from a Group. While it is possible to design sprite and group classes that don't derive from the Sprite and AbstractGroup classes below, it is strongly recommended that you extend those when you create a new Sprite or Group class. Sprites are not thread safe, so lock them yourself if using threads. """ ##todo ## a group that holds only the 'n' most recent elements. ## sort of like the GroupSingle class, but holding more ## than one sprite ## ## drawing groups that can 'automatically' store the area ## underneath so they can "clear" without needing a background ## function. obviously a little slower than normal, but nice ## to use in many situations. (also remember it must "clear" ## in the reverse order that it draws :]) ## ## the drawing groups should also be able to take a background ## function, instead of just a background surface. the function ## would take a surface and a rectangle on that surface to erase. ## ## perhaps more types of collision functions? the current two ## should handle just about every need, but perhaps more optimized ## specific ones that aren't quite so general but fit into common ## specialized cases. import pygame_sdl2 from pygame_sdl2 import Rect from pygame_sdl2.time import get_ticks from operator import truth # Python 3 does not have the callable function, but an equivalent can be made # with the hasattr function. if 'callable' not in dir(__builtins__): callable = lambda obj: hasattr(obj, '__call__') # Don't depend on pygame_sdl2.mask if it's not there... try: from pygame_sdl2.mask import from_surface except: pass class Sprite(object): """simple base class for visible game objects pygame.sprite.Sprite(*groups): return Sprite The base class for visible game objects. Derived classes will want to override the Sprite.update() method and assign Sprite.image and Sprite.rect attributes. The initializer can accept any number of Group instances that the Sprite will become a member of. When subclassing the Sprite class, be sure to call the base initializer before adding the Sprite to Groups. """ def __init__(self, *groups): self.__g = {} # The groups the sprite is in if groups: self.add(*groups) def add(self, *groups): """add the sprite to groups Sprite.add(*groups): return None Any number of Group instances can be passed as arguments. The Sprite will be added to the Groups it is not already a member of. """ has = self.__g.__contains__ for group in groups: if hasattr(group, '_spritegroup'): if not has(group): group.add_internal(self) self.add_internal(group) else: self.add(*group) def remove(self, *groups): """remove the sprite from groups Sprite.remove(*groups): return None Any number of Group instances can be passed as arguments. The Sprite will be removed from the Groups it is currently a member of. """ has = self.__g.__contains__ for group in groups: if hasattr(group, '_spritegroup'): if has(group): group.remove_internal(self) self.remove_internal(group) else: self.remove(*group) def add_internal(self, group): self.__g[group] = 0 def remove_internal(self, group): del self.__g[group] def update(self, *args): """method to control sprite behavior Sprite.update(*args): The default implementation of this method does nothing; it's just a convenient "hook" that you can override. This method is called by Group.update() with whatever arguments you give it. There is no need to use this method if not using the convenience method by the same name in the Group class. """ pass def kill(self): """remove the Sprite from all Groups Sprite.kill(): return None The Sprite is removed from all the Groups that contain it. This won't change anything about the state of the Sprite. It is possible to continue to use the Sprite after this method has been called, including adding it to Groups. """ for c in self.__g: c.remove_internal(self) self.__g.clear() def groups(self): """list of Groups that contain this Sprite Sprite.groups(): return group_list Returns a list of all the Groups that contain this Sprite. """ return list(self.__g) def alive(self): """does the sprite belong to any groups Sprite.alive(): return bool Returns True when the Sprite belongs to one or more Groups. """ return truth(self.__g) def __repr__(self): return "<%s sprite(in %d groups)>" % (self.__class__.__name__, len(self.__g)) class DirtySprite(Sprite): """a more featureful subclass of Sprite with more attributes pygame.sprite.DirtySprite(*groups): return DirtySprite Extra DirtySprite attributes with their default values: dirty = 1 If set to 1, it is repainted and then set to 0 again. If set to 2, it is always dirty (repainted each frame; flag is not reset). If set to 0, it is not dirty and therefore not repainted again. blendmode = 0 It's the special_flags argument of Surface.blit; see the blendmodes in the Surface.blit documentation source_rect = None This is the source rect to use. Remember that it is relative to the top left corner (0, 0) of self.image. visible = 1 Normally this is 1. If set to 0, it will not be repainted. (If you change visible to 1, you must set dirty to 1 for it to be erased from the screen.) _layer = 0 A READ ONLY value, it is read when adding it to the LayeredUpdates group. For details see documentation of sprite.LayeredUpdates. """ def __init__(self, *groups): self.dirty = 1 self.blendmode = 0 # pygame 1.8, referred to as special_flags in # the documentation of Surface.blit self._visible = 1 self._layer = 0 # READ ONLY by LayeredUpdates or LayeredDirty self.source_rect = None Sprite.__init__(self, *groups) def _set_visible(self, val): """set the visible value (0 or 1) and makes the sprite dirty""" self._visible = val if self.dirty < 2: self.dirty = 1 def _get_visible(self): """return the visible value of that sprite""" return self._visible visible = property(lambda self: self._get_visible(), lambda self, value: self._set_visible(value), doc="you can make this sprite disappear without " "removing it from the group,\n" "assign 0 for invisible and 1 for visible") def __repr__(self): return "<%s DirtySprite(in %d groups)>" % \ (self.__class__.__name__, len(self.groups())) class AbstractGroup(object): """base class for containers of sprites AbstractGroup does everything needed to behave as a normal group. You can easily subclass a new group class from this or the other groups below if you want to add more features. Any AbstractGroup-derived sprite groups act like sequences and support iteration, len, and so on. """ # dummy val to identify sprite groups, and avoid infinite recursion _spritegroup = True def __init__(self): self.spritedict = {} self.lostsprites = [] def sprites(self): """get a list of sprites in the group Group.sprite(): return list Returns an object that can be looped over with a 'for' loop. (For now, it is always a list, but this could change in a future version of pygame.) Alternatively, you can get the same information by iterating directly over the sprite group, e.g. 'for sprite in group'. """ return list(self.spritedict) def add_internal(self, sprite): self.spritedict[sprite] = 0 def remove_internal(self, sprite): r = self.spritedict[sprite] if r: self.lostsprites.append(r) del self.spritedict[sprite] def has_internal(self, sprite): return sprite in self.spritedict def copy(self): """copy a group with all the same sprites Group.copy(): return Group Returns a copy of the group that is an instance of the same class and has the same sprites in it. """ return self.__class__(self.sprites()) def __iter__(self): return iter(self.sprites()) def __contains__(self, sprite): return self.has(sprite) def add(self, *sprites): """add sprite(s) to group Group.add(sprite, list, group, ...): return None Adds a sprite or sequence of sprites to a group. """ for sprite in sprites: # It's possible that some sprite is also an iterator. # If this is the case, we should add the sprite itself, # and not the iterator object. if isinstance(sprite, Sprite): if not self.has_internal(sprite): self.add_internal(sprite) sprite.add_internal(self) else: try: # See if sprite is an iterator, like a list or sprite # group. self.add(*sprite) except (TypeError, AttributeError): # Not iterable. This is probably a sprite that is not an # instance of the Sprite class or is not an instance of a # subclass of the Sprite class. Alternately, it could be an # old-style sprite group. if hasattr(sprite, '_spritegroup'): for spr in sprite.sprites(): if not self.has_internal(spr): self.add_internal(spr) spr.add_internal(self) elif not self.has_internal(sprite): self.add_internal(sprite) sprite.add_internal(self) def remove(self, *sprites): """remove sprite(s) from group Group.remove(sprite, list, or group, ...): return None Removes a sprite or sequence of sprites from a group. """ # This function behaves essentially the same as Group.add. It first # tries to handle each argument as an instance of the Sprite class. If # that failes, then it tries to handle the argument as an iterable # object. If that failes, then it tries to handle the argument as an # old-style sprite group. Lastly, if that fails, it assumes that the # normal Sprite methods should be used. for sprite in sprites: if isinstance(sprite, Sprite): if self.has_internal(sprite): self.remove_internal(sprite) sprite.remove_internal(self) else: try: self.remove(*sprite) except (TypeError, AttributeError): if hasattr(sprite, '_spritegroup'): for spr in sprite.sprites(): if self.has_internal(spr): self.remove_internal(spr) spr.remove_internal(self) elif self.has_internal(sprite): self.remove_internal(sprite) sprite.remove_internal(self) def has(self, *sprites): """ask if group has a sprite or sprites Group.has(sprite or group, ...): return bool Returns True if the given sprite or sprites are contained in the group. Alternatively, you can get the same information using the 'in' operator, e.g. 'sprite in group', 'subgroup in group'. """ return_value = False for sprite in sprites: if isinstance(sprite, Sprite): # Check for Sprite instance's membership in this group if self.has_internal(sprite): return_value = True else: return False else: try: if self.has(*sprite): return_value = True else: return False except (TypeError, AttributeError): if hasattr(sprite, '_spritegroup'): for spr in sprite.sprites(): if self.has_internal(spr): return_value = True else: return False else: if self.has_internal(sprite): return_value = True else: return False return return_value def update(self, *args): """call the update method of every member sprite Group.update(*args): return None Calls the update method of every member sprite. All arguments that were passed to this method are passed to the Sprite update function. """ for s in self.sprites(): s.update(*args) def draw(self, surface): """draw all sprites onto the surface Group.draw(surface): return None Draws all of the member sprites onto the given surface. """ sprites = self.sprites() surface_blit = surface.blit for spr in sprites: self.spritedict[spr] = surface_blit(spr.image, spr.rect) self.lostsprites = [] def clear(self, surface, bgd): """erase the previous position of all sprites Group.clear(surface, bgd): return None Clears the area under every drawn sprite in the group. The bgd argument should be Surface which is the same dimensions as the screen surface. The bgd could also be a function which accepts the given surface and the area to be cleared as arguments. """ if callable(bgd): for r in self.lostsprites: bgd(surface, r) for r in self.spritedict.values(): if r: bgd(surface, r) else: surface_blit = surface.blit for r in self.lostsprites: surface_blit(bgd, r, r) for r in self.spritedict.values(): if r: surface_blit(bgd, r, r) def empty(self): """remove all sprites Group.empty(): return None Removes all the sprites from the group. """ for s in self.sprites(): self.remove_internal(s) s.remove_internal(self) def __nonzero__(self): return truth(self.sprites()) def __len__(self): """return number of sprites in group Group.len(group): return int Returns the number of sprites contained in the group. """ return len(self.sprites()) def __repr__(self): return "<%s(%d sprites)>" % (self.__class__.__name__, len(self)) class Group(AbstractGroup): """container class for many Sprites pygame.sprite.Group(*sprites): return Group A simple container for Sprite objects. This class can be subclassed to create containers with more specific behaviors. The constructor takes any number of Sprite arguments to add to the Group. The group supports the following standard Python operations: in test if a Sprite is contained len the number of Sprites contained bool test if any Sprites are contained iter iterate through all the Sprites The Sprites in the Group are not ordered, so the Sprites are drawn and iterated over in no particular order. """ def __init__(self, *sprites): AbstractGroup.__init__(self) self.add(*sprites) RenderPlain = Group RenderClear = Group class RenderUpdates(Group): """Group class that tracks dirty updates pygame.sprite.RenderUpdates(*sprites): return RenderUpdates This class is derived from pygame.sprite.Group(). It has an enhanced draw method that tracks the changed areas of the screen. """ def draw(self, surface): spritedict = self.spritedict surface_blit = surface.blit dirty = self.lostsprites self.lostsprites = [] dirty_append = dirty.append for s in self.sprites(): r = spritedict[s] newrect = surface_blit(s.image, s.rect) if r: if newrect.colliderect(r): dirty_append(newrect.union(r)) else: dirty_append(newrect) dirty_append(r) else: dirty_append(newrect) spritedict[s] = newrect return dirty class OrderedUpdates(RenderUpdates): """RenderUpdates class that draws Sprites in order of addition pygame.sprite.OrderedUpdates(*spites): return OrderedUpdates This class derives from pygame.sprite.RenderUpdates(). It maintains the order in which the Sprites were added to the Group for rendering. This makes adding and removing Sprites from the Group a little slower than regular Groups. """ def __init__(self, *sprites): self._spritelist = [] RenderUpdates.__init__(self, *sprites) def sprites(self): return list(self._spritelist) def add_internal(self, sprite): RenderUpdates.add_internal(self, sprite) self._spritelist.append(sprite) def remove_internal(self, sprite): RenderUpdates.remove_internal(self, sprite) self._spritelist.remove(sprite) class LayeredUpdates(AbstractGroup): """LayeredUpdates Group handles layers, which are drawn like OrderedUpdates pygame.sprite.LayeredUpdates(*spites, **kwargs): return LayeredUpdates This group is fully compatible with pygame.sprite.Sprite. New in pygame 1.8.0 """ _init_rect = Rect(0, 0, 0, 0) def __init__(self, *sprites, **kwargs): """initialize an instance of LayeredUpdates with the given attributes You can set the default layer through kwargs using 'default_layer' and an integer for the layer. The default layer is 0. If the sprite you add has an attribute _layer, then that layer will be used. If **kwarg contains 'layer', then the passed sprites will be added to that layer (overriding the sprite._layer attribute). If neither the sprite nor **kwarg has a 'layer', then the default layer is used to add the sprites. """ self._spritelayers = {} self._spritelist = [] AbstractGroup.__init__(self) self._default_layer = kwargs.get('default_layer', 0) self.add(*sprites, **kwargs) def add_internal(self, sprite, layer=None): """Do not use this method directly. It is used by the group to add a sprite internally. """ self.spritedict[sprite] = self._init_rect if layer is None: try: layer = sprite._layer except AttributeError: layer = sprite._layer = self._default_layer elif hasattr(sprite, '_layer'): sprite._layer = layer sprites = self._spritelist # speedup sprites_layers = self._spritelayers sprites_layers[sprite] = layer # add the sprite at the right position # bisect algorithmus leng = len(sprites) low = mid = 0 high = leng - 1 while low <= high: mid = low + (high - low) // 2 if sprites_layers[sprites[mid]] <= layer: low = mid + 1 else: high = mid - 1 # linear search to find final position while mid < leng and sprites_layers[sprites[mid]] <= layer: mid += 1 sprites.insert(mid, sprite) def add(self, *sprites, **kwargs): """add a sprite or sequence of sprites to a group LayeredUpdates.add(*sprites, **kwargs): return None If the sprite you add has an attribute _layer, then that layer will be used. If **kwarg contains 'layer', then the passed sprites will be added to that layer (overriding the sprite._layer attribute). If neither the sprite nor **kwarg has a 'layer', then the default layer is used to add the sprites. """ if not sprites: return if 'layer' in kwargs: layer = kwargs['layer'] else: layer = None for sprite in sprites: # It's possible that some sprite is also an iterator. # If this is the case, we should add the sprite itself, # and not the iterator object. if isinstance(sprite, Sprite): if not self.has_internal(sprite): self.add_internal(sprite, layer) sprite.add_internal(self) else: try: # See if sprite is an iterator, like a list or sprite # group. self.add(*sprite, **kwargs) except (TypeError, AttributeError): # Not iterable. This is probably a sprite that is not an # instance of the Sprite class or is not an instance of a # subclass of the Sprite class. Alternately, it could be an # old-style sprite group. if hasattr(sprite, '_spritegroup'): for spr in sprite.sprites(): if not self.has_internal(spr): self.add_internal(spr, layer) spr.add_internal(self) elif not self.has_internal(sprite): self.add_internal(sprite, layer) sprite.add_internal(self) def remove_internal(self, sprite): """Do not use this method directly. The group uses it to add a sprite. """ self._spritelist.remove(sprite) # these dirty rects are suboptimal for one frame r = self.spritedict[sprite] if r is not self._init_rect: self.lostsprites.append(r) # dirty rect if hasattr(sprite, 'rect'): self.lostsprites.append(sprite.rect) # dirty rect del self.spritedict[sprite] del self._spritelayers[sprite] def sprites(self): """return a ordered list of sprites (first back, last top). LayeredUpdates.sprites(): return sprites """ return list(self._spritelist) def draw(self, surface): """draw all sprites in the right order onto the passed surface LayeredUpdates.draw(surface): return Rect_list """ spritedict = self.spritedict surface_blit = surface.blit dirty = self.lostsprites self.lostsprites = [] dirty_append = dirty.append init_rect = self._init_rect for spr in self.sprites(): rec = spritedict[spr] newrect = surface_blit(spr.image, spr.rect) if rec is init_rect: dirty_append(newrect) else: if newrect.colliderect(rec): dirty_append(newrect.union(rec)) else: dirty_append(newrect) dirty_append(rec) spritedict[spr] = newrect return dirty def get_sprites_at(self, pos): """return a list with all sprites at that position LayeredUpdates.get_sprites_at(pos): return colliding_sprites Bottom sprites are listed first; the top ones are listed last. """ _sprites = self._spritelist rect = Rect(pos, (0, 0)) colliding_idx = rect.collidelistall(_sprites) colliding = [_sprites[i] for i in colliding_idx] return colliding def get_sprite(self, idx): """return the sprite at the index idx from the groups sprites LayeredUpdates.get_sprite(idx): return sprite Raises IndexOutOfBounds if the idx is not within range. """ return self._spritelist[idx] def remove_sprites_of_layer(self, layer_nr): """remove all sprites from a layer and return them as a list LayeredUpdates.remove_sprites_of_layer(layer_nr): return sprites """ sprites = self.get_sprites_from_layer(layer_nr) self.remove(*sprites) return sprites #---# layer methods def layers(self): """return a list of unique defined layers defined. LayeredUpdates.layers(): return layers """ return sorted(set(self._spritelayers.values())) def change_layer(self, sprite, new_layer): """change the layer of the sprite LayeredUpdates.change_layer(sprite, new_layer): return None The sprite must have been added to the renderer already. This is not checked. """ sprites = self._spritelist # speedup sprites_layers = self._spritelayers # speedup sprites.remove(sprite) sprites_layers.pop(sprite) # add the sprite at the right position # bisect algorithmus leng = len(sprites) low = mid = 0 high = leng - 1 while low <= high: mid = low + (high - low) // 2 if sprites_layers[sprites[mid]] <= new_layer: low = mid + 1 else: high = mid - 1 # linear search to find final position while mid < leng and sprites_layers[sprites[mid]] <= new_layer: mid += 1 sprites.insert(mid, sprite) if hasattr(sprite, 'layer'): sprite.layer = new_layer # add layer info sprites_layers[sprite] = new_layer def get_layer_of_sprite(self, sprite): """return the layer that sprite is currently in If the sprite is not found, then it will return the default layer. """ return self._spritelayers.get(sprite, self._default_layer) def get_top_layer(self): """return the top layer LayeredUpdates.get_top_layer(): return layer """ return self._spritelayers[self._spritelist[-1]] def get_bottom_layer(self): """return the bottom layer LayeredUpdates.get_bottom_layer(): return layer """ return self._spritelayers[self._spritelist[0]] def move_to_front(self, sprite): """bring the sprite to front layer LayeredUpdates.move_to_front(sprite): return None Brings the sprite to front by changing the sprite layer to the top-most layer. The sprite is added at the end of the list of sprites in that top-most layer. """ self.change_layer(sprite, self.get_top_layer()) def move_to_back(self, sprite): """move the sprite to the bottom layer LayeredUpdates.move_to_back(sprite): return None Moves the sprite to the bottom layer by moving it to a new layer below the current bottom layer. """ self.change_layer(sprite, self.get_bottom_layer() - 1) def get_top_sprite(self): """return the topmost sprite LayeredUpdates.get_top_sprite(): return Sprite """ return self._spritelist[-1] def get_sprites_from_layer(self, layer): """return all sprites from a layer ordered as they where added LayeredUpdates.get_sprites_from_layer(layer): return sprites Returns all sprites from a layer. The sprites are ordered in the sequence that they where added. (The sprites are not removed from the layer. """ sprites = [] sprites_append = sprites.append sprite_layers = self._spritelayers for spr in self._spritelist: if sprite_layers[spr] == layer: sprites_append(spr) elif sprite_layers[spr] > layer:# break after because no other will # follow with same layer break return sprites def switch_layer(self, layer1_nr, layer2_nr): """switch the sprites from layer1_nr to layer2_nr LayeredUpdates.switch_layer(layer1_nr, layer2_nr): return None The layers number must exist. This method does not check for the existence of the given layers. """ sprites1 = self.remove_sprites_of_layer(layer1_nr) for spr in self.get_sprites_from_layer(layer2_nr): self.change_layer(spr, layer1_nr) self.add(layer=layer2_nr, *sprites1) class LayeredDirty(LayeredUpdates): """LayeredDirty Group is for DirtySprites; subclasses LayeredUpdates pygame.sprite.LayeredDirty(*spites, **kwargs): return LayeredDirty This group requires pygame.sprite.DirtySprite or any sprite that has the following attributes: image, rect, dirty, visible, blendmode (see doc of DirtySprite). It uses the dirty flag technique and is therefore faster than pygame.sprite.RenderUpdates if you have many static sprites. It also switches automatically between dirty rect updating and full screen drawing, so you do no have to worry which would be faster. As with the pygame.sprite.Group, you can specify some additional attributes through kwargs: _use_update: True/False (default is False) _default_layer: default layer where the sprites without a layer are added _time_threshold: treshold time for switching between dirty rect mode and fullscreen mode; defaults to updating at 80 frames per second, which is equal to 1000.0 / 80.0 New in pygame 1.8.0 """ def __init__(self, *sprites, **kwargs): """initialize group. pygame.sprite.LayeredDirty(*spites, **kwargs): return LayeredDirty You can specify some additional attributes through kwargs: _use_update: True/False (default is False) _default_layer: default layer where the sprites without a layer are added _time_threshold: treshold time for switching between dirty rect mode and fullscreen mode; defaults to updating at 80 frames per second, which is equal to 1000.0 / 80.0 """ LayeredUpdates.__init__(self, *sprites, **kwargs) self._clip = None self._use_update = False self._time_threshold = 1000.0 / 80.0 # 1000.0 / fps self._bgd = None for key, val in kwargs.items(): if key in ['_use_update', '_time_threshold', '_default_layer']: if hasattr(self, key): setattr(self, key, val) def add_internal(self, sprite, layer=None): """Do not use this method directly. It is used by the group to add a sprite internally. """ # check if all needed attributes are set if not hasattr(sprite, 'dirty'): raise AttributeError() if not hasattr(sprite, 'visible'): raise AttributeError() if not hasattr(sprite, 'blendmode'): raise AttributeError() if not isinstance(sprite, DirtySprite): raise TypeError() if sprite.dirty == 0: # set it dirty if it is not sprite.dirty = 1 LayeredUpdates.add_internal(self, sprite, layer) def draw(self, surface, bgd=None): """draw all sprites in the right order onto the given surface LayeredDirty.draw(surface, bgd=None): return Rect_list You can pass the background too. If a self.bgd is already set to some value that is not None, then the bgd argument has no effect. """ # speedups _orig_clip = surface.get_clip() _clip = self._clip if _clip is None: _clip = _orig_clip _surf = surface _sprites = self._spritelist _old_rect = self.spritedict _update = self.lostsprites _update_append = _update.append _ret = None _surf_blit = _surf.blit _rect = Rect if bgd is not None: self._bgd = bgd _bgd = self._bgd init_rect = self._init_rect _surf.set_clip(_clip) # ------- # 0. decide whether to render with update or flip start_time = get_ticks() if self._use_update: # dirty rects mode # 1. find dirty area on screen and put the rects into _update # still not happy with that part for spr in _sprites: if 0 < spr.dirty: # chose the right rect if spr.source_rect: _union_rect = _rect(spr.rect.topleft, spr.source_rect.size) else: _union_rect = _rect(spr.rect) _union_rect_collidelist = _union_rect.collidelist _union_rect_union_ip = _union_rect.union_ip i = _union_rect_collidelist(_update) while -1 < i: _union_rect_union_ip(_update[i]) del _update[i] i = _union_rect_collidelist(_update) _update_append(_union_rect.clip(_clip)) if _old_rect[spr] is not init_rect: _union_rect = _rect(_old_rect[spr]) _union_rect_collidelist = _union_rect.collidelist _union_rect_union_ip = _union_rect.union_ip i = _union_rect_collidelist(_update) while -1 < i: _union_rect_union_ip(_update[i]) del _update[i] i = _union_rect_collidelist(_update) _update_append(_union_rect.clip(_clip)) # can it be done better? because that is an O(n**2) algorithm in # worst case # clear using background if _bgd is not None: for rec in _update: _surf_blit(_bgd, rec, rec) # 2. draw for spr in _sprites: if 1 > spr.dirty: if spr._visible: # sprite not dirty; blit only the intersecting part _spr_rect = spr.rect if spr.source_rect is not None: _spr_rect = Rect(spr.rect.topleft, spr.source_rect.size) _spr_rect_clip = _spr_rect.clip for idx in _spr_rect.collidelistall(_update): # clip clip = _spr_rect_clip(_update[idx]) _surf_blit(spr.image, clip, (clip[0] - _spr_rect[0], clip[1] - _spr_rect[1], clip[2], clip[3]), spr.blendmode) else: # dirty sprite if spr._visible: _old_rect[spr] = _surf_blit(spr.image, spr.rect, spr.source_rect, spr.blendmode) if spr.dirty == 1: spr.dirty = 0 _ret = list(_update) else: # flip, full screen mode if _bgd is not None: _surf_blit(_bgd, (0, 0)) for spr in _sprites: if spr._visible: _old_rect[spr] = _surf_blit(spr.image, spr.rect, spr.source_rect, spr.blendmode) _ret = [_rect(_clip)] # return only the part of the screen changed # timing for switching modes # How may a good threshold be found? It depends on the hardware. end_time = get_ticks() if end_time-start_time > self._time_threshold: self._use_update = False else: self._use_update = True ## # debug ## print " check: using dirty rects:", self._use_update # emtpy dirty rects list _update[:] = [] # ------- # restore original clip _surf.set_clip(_orig_clip) return _ret def clear(self, surface, bgd): """use to set background Group.clear(surface, bgd): return None """ self._bgd = bgd def repaint_rect(self, screen_rect): """repaint the given area LayeredDirty.repaint_rect(screen_rect): return None screen_rect is in screen coordinates. """ if self._clip: self.lostsprites.append(screen_rect.clip(self._clip)) else: self.lostsprites.append(Rect(screen_rect)) def set_clip(self, screen_rect=None): """clip the area where to draw; pass None (default) to reset the clip LayeredDirty.set_clip(screen_rect=None): return None """ if screen_rect is None: self._clip = pygame_sdl2.display.get_surface().get_rect() else: self._clip = screen_rect self._use_update = False def get_clip(self): """get the area where drawing will occur LayeredDirty.get_clip(): return Rect """ return self._clip def change_layer(self, sprite, new_layer): """change the layer of the sprite LayeredUpdates.change_layer(sprite, new_layer): return None The sprite must have been added to the renderer already. This is not checked. """ LayeredUpdates.change_layer(self, sprite, new_layer) if sprite.dirty == 0: sprite.dirty = 1 def set_timing_treshold(self, time_ms): """set the treshold in milliseconds set_timing_treshold(time_ms): return None Defaults to 1000.0 / 80.0. This means that the screen will be painted using the flip method rather than the update method if the update method is taking so long to update the screen that the frame rate falls below 80 frames per second. """ self._time_threshold = time_ms class GroupSingle(AbstractGroup): """A group container that holds a single most recent item. This class works just like a regular group, but it only keeps a single sprite in the group. Whatever sprite has been added to the group last will be the only sprite in the group. You can access its one sprite as the .sprite attribute. Assigning to this attribute will properly remove the old sprite and then add the new one. """ def __init__(self, sprite=None): AbstractGroup.__init__(self) self.__sprite = None if sprite is not None: self.add(sprite) def copy(self): return GroupSingle(self.__sprite) def sprites(self): if self.__sprite is not None: return [self.__sprite] else: return [] def add_internal(self, sprite): if self.__sprite is not None: self.__sprite.remove_internal(self) self.remove_internal(self.__sprite) self.__sprite = sprite def __nonzero__(self): return self.__sprite is not None def _get_sprite(self): return self.__sprite def _set_sprite(self, sprite): self.add_internal(sprite) sprite.add_internal(self) return sprite sprite = property(_get_sprite, _set_sprite, None, "The sprite contained in this group") def remove_internal(self, sprite): if sprite is self.__sprite: self.__sprite = None if sprite in self.spritedict: AbstractGroup.remove_internal(self, sprite) def has_internal(self, sprite): return self.__sprite is sprite # Optimizations... def __contains__(self, sprite): return self.__sprite is sprite # Some different collision detection functions that could be used. def collide_rect(left, right): """collision detection between two sprites, using rects. pygame.sprite.collide_rect(left, right): return bool Tests for collision between two sprites. Uses the pygame.Rect colliderect function to calculate the collision. It is intended to be passed as a collided callback function to the *collide functions. Sprites must have "rect" attributes. New in pygame 1.8.0 """ return left.rect.colliderect(right.rect) class collide_rect_ratio: """A callable class that checks for collisions using scaled rects The class checks for collisions between two sprites using a scaled version of the sprites' rects. Is created with a ratio; the instance is then intended to be passed as a collided callback function to the *collide functions. New in pygame 1.8.1 """ def __init__(self, ratio): """create a new collide_rect_ratio callable Ratio is expected to be a floating point value used to scale the underlying sprite rect before checking for collisions. """ self.ratio = ratio def __call__(self, left, right): """detect collision between two sprites using scaled rects pygame.sprite.collide_rect_ratio(ratio)(left, right): return bool Tests for collision between two sprites. Uses the pygame.Rect colliderect function to calculate the collision after scaling the rects by the stored ratio. Sprites must have "rect" attributes. """ ratio = self.ratio leftrect = left.rect width = leftrect.width height = leftrect.height leftrect = leftrect.inflate(width * ratio - width, height * ratio - height) rightrect = right.rect width = rightrect.width height = rightrect.height rightrect = rightrect.inflate(width * ratio - width, height * ratio - height) return leftrect.colliderect(rightrect) def collide_circle(left, right): """detect collision between two sprites using circles pygame.sprite.collide_circle(left, right): return bool Tests for collision between two sprites by testing whether two circles centered on the sprites overlap. If the sprites have a "radius" attribute, then that radius is used to create the circle; otherwise, a circle is created that is big enough to completely enclose the sprite's rect as given by the "rect" attribute. This function is intended to be passed as a collided callback function to the *collide functions. Sprites must have a "rect" and an optional "radius" attribute. New in pygame 1.8.0 """ xdistance = left.rect.centerx - right.rect.centerx ydistance = left.rect.centery - right.rect.centery distancesquared = xdistance ** 2 + ydistance ** 2 if hasattr(left, 'radius'): leftradius = left.radius else: leftrect = left.rect # approximating the radius of a square by using half of the diagonal, # might give false positives (especially if its a long small rect) leftradius = 0.5 * ((leftrect.width ** 2 + leftrect.height ** 2) ** 0.5) # store the radius on the sprite for next time setattr(left, 'radius', leftradius) if hasattr(right, 'radius'): rightradius = right.radius else: rightrect = right.rect # approximating the radius of a square by using half of the diagonal # might give false positives (especially if its a long small rect) rightradius = 0.5 * ((rightrect.width ** 2 + rightrect.height ** 2) ** 0.5) # store the radius on the sprite for next time setattr(right, 'radius', rightradius) return distancesquared <= (leftradius + rightradius) ** 2 class collide_circle_ratio(object): """detect collision between two sprites using scaled circles This callable class checks for collisions between two sprites using a scaled version of a sprite's radius. It is created with a ratio as the argument to the constructor. The instance is then intended to be passed as a collided callback function to the *collide functions. New in pygame 1.8.1 """ def __init__(self, ratio): """creates a new collide_circle_ratio callable instance The given ratio is expected to be a floating point value used to scale the underlying sprite radius before checking for collisions. When the ratio is ratio=1.0, then it behaves exactly like the collide_circle method. """ self.ratio = ratio def __call__(self, left, right): """detect collision between two sprites using scaled circles pygame.sprite.collide_circle_radio(ratio)(left, right): return bool Tests for collision between two sprites by testing whether two circles centered on the sprites overlap after scaling the circle's radius by the stored ratio. If the sprites have a "radius" attribute, that is used to create the circle; otherwise, a circle is created that is big enough to completely enclose the sprite's rect as given by the "rect" attribute. Intended to be passed as a collided callback function to the *collide functions. Sprites must have a "rect" and an optional "radius" attribute. """ ratio = self.ratio xdistance = left.rect.centerx - right.rect.centerx ydistance = left.rect.centery - right.rect.centery distancesquared = xdistance ** 2 + ydistance ** 2 if hasattr(left, "radius"): leftradius = left.radius * ratio else: leftrect = left.rect leftradius = ratio * 0.5 * ((leftrect.width ** 2 + leftrect.height ** 2) ** 0.5) # store the radius on the sprite for next time setattr(left, 'radius', leftradius) if hasattr(right, "radius"): rightradius = right.radius * ratio else: rightrect = right.rect rightradius = ratio * 0.5 * ((rightrect.width ** 2 + rightrect.height ** 2) ** 0.5) # store the radius on the sprite for next time setattr(right, 'radius', rightradius) return distancesquared <= (leftradius + rightradius) ** 2 def collide_mask(left, right): """collision detection between two sprites, using masks. pygame.sprite.collide_mask(SpriteLeft, SpriteRight): bool Tests for collision between two sprites by testing if their bitmasks overlap. If the sprites have a "mask" attribute, that is used as the mask; otherwise, a mask is created from the sprite image. Intended to be passed as a collided callback function to the *collide functions. Sprites must have a "rect" and an optional "mask" attribute. New in pygame 1.8.0 """ xoffset = right.rect[0] - left.rect[0] yoffset = right.rect[1] - left.rect[1] try: leftmask = left.mask except AttributeError: leftmask = from_surface(left.image) try: rightmask = right.mask except AttributeError: rightmask = from_surface(right.image) return leftmask.overlap(rightmask, (xoffset, yoffset)) def spritecollide(sprite, group, dokill, collided=None): """find Sprites in a Group that intersect another Sprite pygame.sprite.spritecollide(sprite, group, dokill, collided=None): return Sprite_list Return a list containing all Sprites in a Group that intersect with another Sprite. Intersection is determined by comparing the Sprite.rect attribute of each Sprite. The dokill argument is a bool. If set to True, all Sprites that collide will be removed from the Group. The collided argument is a callback function used to calculate if two sprites are colliding. it should take two sprites as values, and return a bool value indicating if they are colliding. If collided is not passed, all sprites must have a "rect" value, which is a rectangle of the sprite area, which will be used to calculate the collision. """ if dokill: crashed = [] append = crashed.append if collided: for s in group.sprites(): if collided(sprite, s): s.kill() append(s) else: spritecollide = sprite.rect.colliderect for s in group.sprites(): if spritecollide(s.rect): s.kill() append(s) return crashed elif collided: return [s for s in group if collided(sprite, s)] else: spritecollide = sprite.rect.colliderect return [s for s in group if spritecollide(s.rect)] def groupcollide(groupa, groupb, dokilla, dokillb, collided=None): """detect collision between a group and another group pygame.sprite.groupcollide(groupa, groupb, dokilla, dokillb): return dict Given two groups, this will find the intersections between all sprites in each group. It returns a dictionary of all sprites in the first group that collide. The value for each item in the dictionary is a list of the sprites in the second group it collides with. The two dokill arguments control if the sprites from either group will be automatically removed from all groups. Collided is a callback function used to calculate if two sprites are colliding. it should take two sprites as values, and return a bool value indicating if they are colliding. If collided is not passed, all sprites must have a "rect" value, which is a rectangle of the sprite area that will be used to calculate the collision. """ crashed = {} SC = spritecollide if dokilla: for s in groupa.sprites(): c = SC(s, groupb, dokillb, collided) if c: crashed[s] = c s.kill() else: for s in groupa: c = SC(s, groupb, dokillb, collided) if c: crashed[s] = c return crashed def spritecollideany(sprite, group, collided=None): """finds any sprites in a group that collide with the given sprite pygame.sprite.spritecollideany(sprite, group): return sprite Given a sprite and a group of sprites, this will return return any single sprite that collides with with the given sprite. If there are no collisions, then this returns None. If you don't need all the features of the spritecollide function, this function will be a bit quicker. Collided is a callback function used to calculate if two sprites are colliding. It should take two sprites as values and return a bool value indicating if they are colliding. If collided is not passed, then all sprites must have a "rect" value, which is a rectangle of the sprite area, which will be used to calculate the collision. """ if collided: for s in group: if collided(sprite, s): return s else: # Special case old behaviour for speed. spritecollide = sprite.rect.colliderect for s in group: if spritecollide(s.rect): return s return None pygame_sdl2-2.1.0-for-renpy-6.99.14.1/src/pygame_sdl2/surface.pxd0000664000175000017500000000354512657310527023427 0ustar tomtom00000000000000# Copyright 2014 Patrick Dawson # Copyright 2014 Tom Rothamel # # This software is provided 'as-is', without any express or implied # warranty. In no event will the authors be held liable for any damages # arising from the use of this software. # # Permission is granted to anyone to use this software for any purpose, # including commercial applications, and to alter it and redistribute it # freely, subject to the following restrictions: # # 1. The origin of this software must not be misrepresented; you must not # claim that you wrote the original software. If you use this software # in a product, an acknowledgment in the product documentation would be # appreciated but is not required. # 2. Altered source versions must be plainly marked as such, and must not be # misrepresented as being the original software. # 3. This notice may not be removed or altered from any source distribution. from sdl2 cimport SDL_Surface cdef class Surface: # Allow weak references. cdef object __weakref__ # The SDL surface that corresponds to this surface. cdef SDL_Surface* surface # True if we own our surface. False if some other Surface owns our # surface. cdef bint owns_surface # True if this surface is owned by a window. cdef bint window_surface # A list of locks involving the surface. cdef object locklist # If this surface is a subsurface, the surface this surface is a subsurface # of. cdef Surface parent # If this surface has no parent, self. Otherwise, self.parent.root. The # ultimate parent. cdef Surface root # The offset of this surface within its parent. cdef int offset_x cdef int offset_y # If not None, a function that returns the window flags. cdef object get_window_flags cdef void take_surface(self, SDL_Surface *) cdef bint has_alpha pygame_sdl2-2.1.0-for-renpy-6.99.14.1/src/pygame_sdl2/mouse.pyx0000664000175000017500000000327312447670300023145 0ustar tomtom00000000000000# Copyright 2014 Patrick Dawson # # This software is provided 'as-is', without any express or implied # warranty. In no event will the authors be held liable for any damages # arising from the use of this software. # # Permission is granted to anyone to use this software for any purpose, # including commercial applications, and to alter it and redistribute it # freely, subject to the following restrictions: # # 1. The origin of this software must not be misrepresented; you must not # claim that you wrote the original software. If you use this software # in a product, an acknowledgment in the product documentation would be # appreciated but is not required. # 2. Altered source versions must be plainly marked as such, and must not be # misrepresented as being the original software. # 3. This notice may not be removed or altered from any source distribution. from sdl2 cimport * def init(): pass def quit(): pass def get_pressed(): cdef Uint32 state = SDL_GetMouseState(NULL, NULL) return (1 if state & SDL_BUTTON_LMASK else 0, 1 if state & SDL_BUTTON_MMASK else 0, 1 if state & SDL_BUTTON_RMASK else 0) def get_pos(): cdef int x, y SDL_GetMouseState(&x, &y) return (x, y) def get_rel(): cdef int x,y SDL_GetRelativeMouseState(&x, &y) return (x, y) def set_pos(pos): (x, y) = pos SDL_WarpMouseInWindow(NULL, x, y) def set_visible(visible): SDL_ShowCursor(1 if visible else 0) def get_focused(): return SDL_GetMouseFocus() != NULL def set_cursor(size, hotspot, xormasks, andmasks): # Does anyone use this? SDL2 has much improved custom cursor support. pass def get_cursor(): return None pygame_sdl2-2.1.0-for-renpy-6.99.14.1/src/pygame_sdl2/compat.py0000664000175000017500000000550012507774730023114 0ustar tomtom00000000000000"""Python 2.x/3.x compatibility tools""" import sys __all__ = ['geterror', 'long_', 'xrange_', 'ord_', 'unichr_', 'unicode_', 'raw_input_', 'as_bytes', 'as_unicode', 'file_type' ] if sys.version_info[0] >= 3: import io file_type = io.FileIO else: file_type = file def geterror (): return sys.exc_info()[1] try: long_ = long except NameError: long_ = int try: xrange_ = xrange except NameError: xrange_ = range def get_BytesIO(): try: from cStringIO import StringIO as BytesIO except ImportError: from io import BytesIO return BytesIO def get_StringIO(): try: from cStringIO import StringIO except ImportError: from io import StringIO return StringIO def ord_(o): try: return ord(o) except TypeError: return o try: unichr_ = unichr except NameError: unichr_ = chr try: unicode_ = unicode except NameError: unicode_ = str try: bytes_ = bytes except NameError: bytes_ = str try: raw_input_ = raw_input except NameError: raw_input_ = input if sys.platform == 'win32': filesystem_errors = "replace" elif sys.version_info >= (3, 0, 0): filesystem_errors = "surrogateescape" else: filesystem_errors = "strict" def filesystem_encode(u): return u.encode(sys.getfilesystemencoding(), filesystem_errors) # Represent escaped bytes and strings in a portable way. # # as_bytes: Allow a Python 3.x string to represent a bytes object. # e.g.: as_bytes("a\x01\b") == b"a\x01b" # Python 3.x # as_bytes("a\x01\b") == "a\x01b" # Python 2.x # as_unicode: Allow a Python "r" string to represent a unicode string. # e.g.: as_unicode(r"Bo\u00F6tes") == u"Bo\u00F6tes" # Python 2.x # as_unicode(r"Bo\u00F6tes") == "Bo\u00F6tes" # Python 3.x try: unicode def as_bytes(string): """ '' => '' """ return string def as_unicode(rstring): """ r'' => u'' """ return rstring.decode('unicode_escape', 'strict') except NameError: def as_bytes(string): """ '' => b'' """ return string.encode('latin-1', 'strict') def as_unicode(rstring): """ r'' => '' """ return rstring.encode('ascii', 'strict').decode('unicode_escape', 'stict') # Include a next compatible function for Python versions < 2.6 try: next_ = next except NameError: def next_(i, *args): try: return i.next() except StopIteration: if args: return args[0] raise # itertools.imap is missing in 3.x try: import itertools.imap as imap_ except ImportError: imap_ = map pygame_sdl2-2.1.0-for-renpy-6.99.14.1/src/pygame_sdl2/image.pyx0000664000175000017500000001010112673650446023075 0ustar tomtom00000000000000# Copyright 2014 Patrick Dawson # # This software is provided 'as-is', without any express or implied # warranty. In no event will the authors be held liable for any damages # arising from the use of this software. # # Permission is granted to anyone to use this software for any purpose, # including commercial applications, and to alter it and redistribute it # freely, subject to the following restrictions: # # 1. The origin of this software must not be misrepresented; you must not # claim that you wrote the original software. If you use this software # in a product, an acknowledgment in the product documentation would be # appreciated but is not required. # 2. Altered source versions must be plainly marked as such, and must not be # misrepresented as being the original software. # 3. This notice may not be removed or altered from any source distribution. from sdl2 cimport * from sdl2_image cimport * from pygame_sdl2.surface cimport * from pygame_sdl2.rwobject cimport to_rwops from pygame_sdl2.error import error from pygame_sdl2.compat import bytes_, unicode_, filesystem_encode import os import pygame_sdl2 cdef int image_formats = 0 def init(): global image_formats image_formats = IMG_Init(IMG_INIT_JPG | IMG_INIT_PNG | IMG_INIT_TIF | IMG_INIT_WEBP) if image_formats == 0: raise error() init() def quit(): # @ReservedAssignment IMG_Quit() cdef process_namehint(namehint): # Accepts "foo.png", ".png", or "png" if not isinstance(namehint, bytes_): namehint = namehint.encode("ascii", "replace") if not namehint: return b'' ext = os.path.splitext(namehint)[1] if not ext: ext = namehint if ext[0] == b'.': ext = ext[1:] return ext.upper() def load(fi, namehint=""): cdef SDL_Surface *img cdef SDL_RWops *rwops cdef char *ftype # IMG_Load_RW can't load TGA images. if isinstance(fi, str): if fi.lower().endswith('.tga'): namehint = "TGA" rwops = to_rwops(fi) if namehint == "": with nogil: img = IMG_Load_RW(rwops, 1) else: namehint = process_namehint(namehint) ftype = namehint with nogil: img = IMG_LoadTyped_RW(rwops, 1, ftype) if img == NULL: raise error() cdef Surface surf = Surface(()) surf.take_surface(img) if img.format.BitsPerPixel == 32: return surf cdef int n = 0 has_alpha = False if img.format.Amask: has_alpha = True elif (img.format.format >> 24) & SDL_PIXELTYPE_INDEX1: has_alpha = True elif img.format.palette != NULL: # Check for non-opaque palette colors. while n < img.format.palette.ncolors: if img.format.palette.colors[n].a != 255: has_alpha = True break n += 1 try: if has_alpha: return surf.convert_alpha() else: return surf.convert() except error: return surf cdef extern from "write_jpeg.h": int Pygame_SDL2_SaveJPEG(SDL_Surface *, char *, int) nogil cdef extern from "write_png.h": int Pygame_SDL2_SavePNG(const char *, SDL_Surface *, int) nogil def save(Surface surface not None, filename, compression=-1): if isinstance(filename, unicode_): filename = filesystem_encode(filename) ext = os.path.splitext(filename)[1] ext = ext.upper() err = 0 cdef char *fn = filename cdef SDL_RWops *rwops cdef int compression_level = compression if ext == b'.PNG': with nogil: err = Pygame_SDL2_SavePNG(fn, surface.surface, compression_level) elif ext == b'.BMP': rwops = to_rwops(filename, "wb") with nogil: err = SDL_SaveBMP_RW(surface.surface, rwops, 1) elif ext == b".JPG" or ext == b".JPEG": with nogil: err = Pygame_SDL2_SaveJPEG(surface.surface, fn, compression_level) else: raise ValueError("Unsupported format: %s" % ext) if err != 0: raise error() def get_extended(): # This may be called before init. return True pygame_sdl2-2.1.0-for-renpy-6.99.14.1/src/pygame_sdl2/font.pyx0000664000175000017500000001030412651177122022755 0ustar tomtom00000000000000# Copyright 2014 Patrick Dawson # # This software is provided 'as-is', without any express or implied # warranty. In no event will the authors be held liable for any damages # arising from the use of this software. # # Permission is granted to anyone to use this software for any purpose, # including commercial applications, and to alter it and redistribute it # freely, subject to the following restrictions: # # 1. The origin of this software must not be misrepresented; you must not # claim that you wrote the original software. If you use this software # in a product, an acknowledgment in the product documentation would be # appreciated but is not required. # 2. Altered source versions must be plainly marked as such, and must not be # misrepresented as being the original software. # 3. This notice may not be removed or altered from any source distribution. from sdl2 cimport * from sdl2_ttf cimport * from pygame_sdl2.surface cimport * from pygame_sdl2.color cimport * from pygame_sdl2.rwobject cimport to_rwops from pygame_sdl2.sysfont import SysFont, match_font, get_fonts from pygame_sdl2.error import error import pygame_sdl2 @pygame_sdl2.register_init def init(): TTF_Init() @pygame_sdl2.register_quit def quit(): # @ReservedAssignment TTF_Quit() def get_init(): return TTF_WasInit() != 0 def get_default_font(): import os default = os.path.join(os.path.dirname(__file__), "DejaVuSans.ttf") if os.path.exists(default): return default return match_font("sans") cdef class Font: cdef TTF_Font *font cdef int style def __cinit__(self): self.font = NULL self.style = TTF_STYLE_NORMAL def __dealloc__(self): if self.font: TTF_CloseFont(self.font) def __init__(self, fi, size): if fi is None: fi = get_default_font() self.font = TTF_OpenFontRW(to_rwops(fi), 1, size) if self.font == NULL: raise error() def render(self, text, antialias, color, background=None): cdef SDL_Surface *surf cdef SDL_Color fg if not text: w, h = self.size(" ") return Surface((0, h)) to_sdl_color(color, &fg) TTF_SetFontStyle(self.font, self.style) if antialias: surf = TTF_RenderUTF8_Blended(self.font, text.encode('utf-8'), fg) else: surf = TTF_RenderUTF8_Solid(self.font, text.encode('utf-8'), fg) if surf == NULL: raise error() cdef Surface rv = Surface(()) rv.take_surface(surf) if rv.surface.format.BitsPerPixel != 32: rv = rv.convert() if background is not None: bgsurf = rv.copy() bgsurf.fill(background) bgsurf.blit(rv, (0,0)) return bgsurf return rv def size(self, text): cdef int w, h if TTF_SizeUTF8(self.font, text.encode('utf-8'), &w, &h) != 0: raise error() return w, h cdef set_style(self, flag, on): if on: self.style |= flag else: self.style &= ~flag def set_underline(self, on): self.set_style(TTF_STYLE_UNDERLINE, on) def get_underline(self): return self.style & TTF_STYLE_UNDERLINE def set_bold(self, on): self.set_style(TTF_STYLE_BOLD, on) def get_bold(self): return self.style & TTF_STYLE_BOLD def set_italic(self, on): self.set_style(TTF_STYLE_ITALIC, on) def get_italic(self): return self.style & TTF_STYLE_ITALIC def get_linesize(self): return TTF_FontLineSkip(self.font) def get_height(self): return TTF_FontHeight(self.font) def get_ascent(self): return TTF_FontAscent(self.font) def get_descent(self): return TTF_FontDescent(self.font) def metrics(self, text not None): cdef int minx, maxx, miny, maxy, advance cdef uint16_t chnum rv = [] for ch in text: chnum = ord(ch) if TTF_GlyphMetrics(self.font, chnum, &minx, &maxx, &miny, &maxy, &advance) == 0: rv.append((minx, maxx, miny, maxy, advance)) else: rv.append(None) return rv pygame_sdl2-2.1.0-for-renpy-6.99.14.1/src/pygame_sdl2/controller.pyx0000664000175000017500000001516012565231651024201 0ustar tomtom00000000000000# Copyright 2015 Tom Rothamel # # This software is provided 'as-is', without any express or implied # warranty. In no event will the authors be held liable for any damages # arising from the use of this software. # # Permission is granted to anyone to use this software for any purpose, # including commercial applications, and to alter it and redistribute it # freely, subject to the following restrictions: # # 1. The origin of this software must not be misrepresented; you must not # claim that you wrote the original software. If you use this software # in a product, an acknowledgment in the product documentation would be # appreciated but is not required. # 2. Altered source versions must be plainly marked as such, and must not be # misrepresented as being the original software. # 3. This notice may not be removed or altered from any source distribution. from sdl2 cimport * from pygame_sdl2.error import error import pygame_sdl2 from pygame_sdl2.rwobject cimport to_rwops @pygame_sdl2.register_init def init(): """ Initializes game controller support. """ pygame_sdl2.display.sdl_main_init() if SDL_InitSubSystem(SDL_INIT_GAMECONTROLLER): raise error() @pygame_sdl2.register_quit def quit(): # @ReservedAssignment """ Shuts down game controller support. """ SDL_QuitSubSystem(SDL_INIT_GAMECONTROLLER) def get_init(): """ Returns true if game controller support has been initialized. """ return SDL_WasInit(SDL_INIT_GAMECONTROLLER) != 0 def get_count(): """ Returns the number of joysticks and game controllers connected to the system. This is one more than the maximum index that can be passed to Controller. While every game controller is a joystick, not every joystick is a game controller. To check that index `i` corresponds to a game controller, use code such as:: if pygame_sdl2.controller.Controller(i).is_controller(): ... """ return SDL_NumJoysticks() def add_mapping(mapping): """ Adds a game controller mapping from the string in `mapping`. """ if SDL_GameControllerAddMapping(mapping) == -1: raise error() def add_mappings(mapping_file): """ Adds game controller mappings from `mapping_file`, which can be a string filename or a file-like object. This file should be gamecontrollerdb.txt, downloaded from: https://raw.githubusercontent.com/gabomdq/SDL_GameControllerDB/master/gamecontrollerdb.txt This should be called before creating a Controller object. It can be called multiple times to add multiple database files. """ cdef SDL_RWops *rwops = to_rwops(mapping_file) if SDL_GameControllerAddMappingsFromRW(rwops, 1) == -1: raise error() def get_axis_from_string(name): """ Returns the axis number of the controller axis with `name`, or pygame.CONTROLLER_AXIS_INVALID if `name` is not known. """ return SDL_GameControllerGetAxisFromString(name) def get_button_from_string(name): """ Returns the button number of the controller button with `name`, or pygame.CONTROLLER_BUTTON_INVALID if `name` is not known. """ return SDL_GameControllerGetButtonFromString(name) def get_string_for_axis(axis): """ Returns a string describing the controller axis `axis`, which must be an integer. Returns None if the axis is not known. """ cdef const char *rv = SDL_GameControllerGetStringForAxis(axis) if rv != NULL: return rv else: return None def get_string_for_button(button): """ Returns a string describing the controller button `button`, which must be an integer. Returns None if the button is not known. """ cdef const char *rv = SDL_GameControllerGetStringForButton(button) if rv != NULL: return rv else: return None cdef class Controller: # Allow weak references. cdef object __weakref__ cdef SDL_GameController *controller cdef int index def __cinit__(self): self.controller = NULL def __init__(self, index): """ Represents a game controller object corresponding to the joystick with `index`. """ self.index = index def init(self): """ Opens the game controller, causing it to begin sending events. """ if self.controller == NULL: self.controller = SDL_GameControllerOpen(self.index) if self.controller == NULL: raise error() def quit(self): # @ReservedAssignment """ Closes the game controller, preventing it from sending events. """ if self.controller and SDL_GameControllerGetAttached(self.controller): SDL_GameControllerClose(self.controller) self.controller = NULL def get_init(self): """ Returns true if the controller has been initialized, false otherwise. """ if self.controller: return True else: return False def get_axis(self, axis): """ Returns the value of `axis`, which is one of the pygame.CONTROLLER_AXIS constants. Axes return values from -32768 to 32678, triggers return 0 to 32768. 0 is returned on failure. """ if self.controller == NULL: raise error("controller not initialized.") return SDL_GameControllerGetAxis(self.controller, axis) def get_button(self, button): """ Returns the value of `button`, which must be one of the pygame.CONTROLLER_BUTTON constants. Returns 1 if the button is pressed, 0 if not or the button does not exist. """ if self.controller == NULL: raise error("controller not initialized.") return SDL_GameControllerGetButton(self.controller, button) def get_name(self): """ Returns an implementation-dependent name for this game controller, or None if no name could be found. """ cdef const char *rv = SDL_GameControllerNameForIndex(self.index) if rv == NULL: return None return rv def is_controller(self): """ Returns true if this Controller object corresponds to a supported game controller, or False otherwise. """ return SDL_IsGameController(self.index) def get_guid_string(self): """ Returns the guid string corresponding to this controller. """ cdef SDL_JoystickGUID guid cdef char s[33] guid = SDL_JoystickGetDeviceGUID(self.index) SDL_JoystickGetGUIDString(guid, s, 33) return s pygame_sdl2-2.1.0-for-renpy-6.99.14.1/src/pygame_sdl2/pygame_time.pyx0000664000175000017500000000676312544374773024341 0ustar tomtom00000000000000# Copyright 2014 Patrick Dawson # # This software is provided 'as-is', without any express or implied # warranty. In no event will the authors be held liable for any damages # arising from the use of this software. # # Permission is granted to anyone to use this software for any purpose, # including commercial applications, and to alter it and redistribute it # freely, subject to the following restrictions: # # 1. The origin of this software must not be misrepresented; you must not # claim that you wrote the original software. If you use this software # in a product, an acknowledgment in the product documentation would be # appreciated but is not required. # 2. Altered source versions must be plainly marked as such, and must not be # misrepresented as being the original software. # 3. This notice may not be removed or altered from any source distribution. import cython import math from sdl2 cimport * from pygame_sdl2.error import error import pygame_sdl2 cdef int timer_id = 0 @pygame_sdl2.register_init def init(): pygame_sdl2.display.sdl_main_init() if SDL_InitSubSystem(SDL_INIT_TIMER): raise error() @pygame_sdl2.register_quit def quit(): # @ReservedAssignment SDL_QuitSubSystem(SDL_INIT_TIMER) def get_ticks(): return SDL_GetTicks() def wait(int milliseconds): cdef int start start = SDL_GetTicks() with nogil: SDL_Delay(milliseconds) return SDL_GetTicks() - start def delay(milliseconds): # SDL_Delay() should be accurate enough. return wait(milliseconds) cdef Uint32 timer_callback(Uint32 interval, void *param): cdef SDL_Event e e.type = param e.user.code = 0 e.user.data1 = NULL e.user.data2 = NULL SDL_PushEvent(&e) return interval # A map from eventid to SDL_Timer_ID. cdef dict timer_by_event = { } def set_timer(eventid, milliseconds): cdef int timer_id = timer_by_event.get(eventid, 0) if timer_id != 0: SDL_RemoveTimer(timer_id) timer_id = 0 if milliseconds > 0: timer_id = SDL_AddTimer(milliseconds, timer_callback, eventid) if timer_id == 0: raise error() timer_by_event[eventid] = timer_id class Clock: def __init__(self): self.last = SDL_GetTicks() self.last_frames = [] self.frametime = 0 self.raw_frametime = 0 def tick(self, framerate=0): cdef int now = SDL_GetTicks() self.raw_frametime = now - self.last while len(self.last_frames) > 9: self.last_frames.pop(0) if framerate == 0: self.last = now self.last_frames.append(self.raw_frametime) return self.raw_frametime cdef int frame_duration = 1.0 / framerate * 1000 if self.raw_frametime < frame_duration: delay(frame_duration - self.raw_frametime) now = SDL_GetTicks() self.frametime = now - self.last self.last = now self.last_frames.append(self.frametime) return self.frametime def tick_busy_loop(self, framerate=0): return self.tick(framerate) def get_time(self): return self.frametime def get_rawtime(self): return self.raw_frametime @cython.cdivision(True) def get_fps(self): cdef int total_time = sum(self.last_frames) cdef float average_time = total_time / 1000.0 / len(self.last_frames) cdef float average_fps = 1.0 / average_time return 0 if math.isnan(average_fps) else average_fps pygame_sdl2-2.1.0-for-renpy-6.99.14.1/src/pygame_sdl2/surface.pyx0000664000175000017500000005350213231545000023433 0ustar tomtom00000000000000# Copyright 2014 Patrick Dawson # Copyright 2014 Tom Rothamel # # This software is provided 'as-is', without any express or implied # warranty. In no event will the authors be held liable for any damages # arising from the use of this software. # # Permission is granted to anyone to use this software for any purpose, # including commercial applications, and to alter it and redistribute it # freely, subject to the following restrictions: # # 1. The origin of this software must not be misrepresented; you must not # claim that you wrote the original software. If you use this software # in a product, an acknowledgment in the product documentation would be # appreciated but is not required. # 2. Altered source versions must be plainly marked as such, and must not be # misrepresented as being the original software. # 3. This notice may not be removed or altered from any source distribution. from libc.string cimport memmove from sdl2 cimport * from pygame_sdl2.color cimport map_color, get_color from pygame_sdl2.rect cimport to_sdl_rect from pygame_sdl2.rect import Rect from pygame_sdl2.error import error from pygame_sdl2.locals import SRCALPHA import pygame_sdl2 import warnings cdef extern from "src/surface.h" nogil: int pygame_Blit (SDL_Surface * src, SDL_Rect * srcrect, SDL_Surface * dst, SDL_Rect * dstrect, int the_args); cdef void move_pixels(Uint8 *src, Uint8 *dst, int h, int span, int srcpitch, int dstpitch) nogil: if src < dst: src += (h - 1) * srcpitch; dst += (h - 1) * dstpitch; srcpitch = -srcpitch; dstpitch = -dstpitch; while h: h -= 1 memmove(dst, src, span); src += srcpitch; dst += dstpitch; # The total size of all allocated surfaces total_size = 0 cdef class Surface: def __cinit__(self): self.surface = NULL self.owns_surface = False self.window_surface = False self.has_alpha = False def __dealloc__(self): global total_size if self.surface and self.owns_surface: if total_size: total_size -= self.surface.pitch * self.surface.h SDL_FreeSurface(self.surface) return elif self.window_surface: return elif self.parent: SDL_FreeSurface(self.surface) return warnings.warn("Memory leak via Surface in pygame_sdl2.") def __sizeof__(self): if self.surface and self.owns_surface: return self.surface.pitch * self.surface.h else: return 0 def __init__(self, size, flags=0, depth=32, masks=None): self.locklist = None self.parent = None self.offset_x = 0 self.offset_y = 0 self.get_window_flags = None # When size is an empty tuple, we do not create a surface, and # expect our caller to set this object up. if size == (): return cdef int w cdef int h w, h = size assert w >= 0 assert h >= 0 cdef Uint32 Rmask, Gmask, Bmask, Amask cdef SDL_Surface *sample cdef Surface pysample cdef int depth_int if masks is not None: Rmask, Gmask, Bmask, Amask = masks depth_int = depth elif isinstance(depth, Surface): pysample = depth sample = pysample.surface Rmask = sample.format.Rmask Gmask = sample.format.Gmask Bmask = sample.format.Bmask Amask = sample.format.Amask depth_int = sample.format.BitsPerPixel else: pysample = pygame_sdl2.display.get_surface() if pysample and pysample.surface.format.BitsPerPixel == 32: sample = pysample.surface Rmask = sample.format.Rmask Gmask = sample.format.Gmask Bmask = sample.format.Bmask Amask = sample.format.Amask else: # RGB(A) if SDL_BYTEORDER == SDL_BIG_ENDIAN: Rmask = 0xff000000 Gmask = 0x00ff0000 Bmask = 0x0000ff00 Amask = 0 else: Rmask = 0x000000ff Gmask = 0x0000ff00 Bmask = 0x00ff0000 Amask = 0 if (flags & SRCALPHA): if not Amask: Amask = 0xffffffff & ~(Rmask | Gmask | Bmask) else: Amask = 0 depth_int = 32 cdef SDL_Surface *surface with nogil: surface = SDL_CreateRGBSurface(0, w, h, depth_int, Rmask, Gmask, Bmask, Amask) if not surface: raise error() self.take_surface(surface) cdef void take_surface(self, SDL_Surface *surface): self.surface = surface self.owns_surface = True global total_size total_size += self.surface.pitch * self.surface.h def __repr__(self): return "".format(self.surface.w, self.surface.h, self.surface.format.BitsPerPixel) def blit(self, Surface source, dest, area=None, int special_flags=0): cdef SDL_Rect dest_rect cdef SDL_Rect area_rect cdef SDL_Rect *area_ptr = NULL cdef Surface temp cdef int err cdef Uint32 key cdef Uint8 alpha cdef bint colorkey colorkey = (SDL_GetColorKey(source.surface, &key) == 0) if not source.surface.format.Amask: if SDL_GetSurfaceAlphaMod(source.surface, &alpha): raise error() if alpha != 255 and (self.surface.format.Amask or colorkey): if area: source = source.subsurface(area) area = None SDL_SetSurfaceBlendMode(source.surface, SDL_BLENDMODE_NONE) temp = Surface(source.get_size(), SRCALPHA) with nogil: SDL_UpperBlit(source.surface, NULL, temp.surface, NULL) source = temp colorkey = False if colorkey: SDL_SetSurfaceBlendMode(source.surface, SDL_BLENDMODE_NONE) else: SDL_SetSurfaceBlendMode(source.surface, SDL_BLENDMODE_BLEND) to_sdl_rect(dest, &dest_rect, "dest") if area is not None: to_sdl_rect(area, &area_rect, "area") area_ptr = &area_rect with nogil: if source.surface.format.Amask or special_flags: err = pygame_Blit(source.surface, area_ptr, self.surface, &dest_rect, special_flags) else: err = SDL_UpperBlit(source.surface, area_ptr, self.surface, &dest_rect) if err: raise error() dirty = Rect(dest[0], dest[1], source.surface.w, source.surface.h) return dirty.clip(self.get_rect()) def convert(self, surface=None): if not isinstance(surface, Surface): surface = pygame_sdl2.display.get_surface() if surface is None: raise error("No video mode has been set.") cdef SDL_PixelFormat *sample_format = ( surface).surface.format cdef Uint32 amask cdef Uint32 rmask cdef Uint32 gmask cdef Uint32 bmask cdef Uint32 pixel_format cdef SDL_Surface *new_surface # If the sample surface has alpha, use it. if not sample_format.Amask: use_format = sample_format with nogil: new_surface = SDL_ConvertSurface(self.surface, sample_format, 0) else: rmask = sample_format.Rmask gmask = sample_format.Gmask bmask = sample_format.Bmask amask = 0 pixel_format = SDL_MasksToPixelFormatEnum(32, rmask, gmask, bmask, amask) with nogil: new_surface = SDL_ConvertSurfaceFormat(self.surface, pixel_format, 0) cdef Surface rv = Surface(()) rv.take_surface(new_surface) return rv def convert_alpha(self, Surface surface=None): if surface is None: surface = pygame_sdl2.display.get_surface() if surface is None: raise error("No video mode has been set.") cdef SDL_PixelFormat *sample_format = surface.surface.format cdef Uint32 amask = 0xff000000 cdef Uint32 rmask = 0x00ff0000 cdef Uint32 gmask = 0x0000ff00 cdef Uint32 bmask = 0x000000ff cdef Uint32 pixel_format cdef SDL_Surface *new_surface # If the sample surface has alpha, use it. if sample_format.Amask: use_format = sample_format with nogil: new_surface = SDL_ConvertSurface(self.surface, sample_format, 0) else: if sample_format.BytesPerPixel == 4: rmask = sample_format.Rmask gmask = sample_format.Gmask bmask = sample_format.Bmask amask = 0xffffffff & ~(rmask | gmask | bmask) pixel_format = SDL_MasksToPixelFormatEnum(32, rmask, gmask, bmask, amask) with nogil: new_surface = SDL_ConvertSurfaceFormat(self.surface, pixel_format, 0) cdef Surface rv = Surface(()) rv.take_surface(new_surface) return rv def copy(self): if self.surface.format.Amask: return self.convert_alpha(self) else: return self.convert(self) def fill(self, color, rect=None, special_flags=0): cdef SDL_Rect sdl_rect cdef Uint32 pixel = map_color(self.surface, color) cdef int err if rect is not None: to_sdl_rect(rect, &sdl_rect) if sdl_rect.x < 0: sdl_rect.w = sdl_rect.w + sdl_rect.x sdl_rect.x = 0 if sdl_rect.y < 0: sdl_rect.w = sdl_rect.h + sdl_rect.y sdl_rect.y = 0 if sdl_rect.w <= 0 or sdl_rect.h <= 0: return Rect(0, 0, 0, 0) with nogil: err = SDL_FillRect(self.surface, &sdl_rect, pixel) if err: raise error() return Rect(sdl_rect.x, sdl_rect.y, sdl_rect.w, sdl_rect.h) else: with nogil: err = SDL_FillRect(self.surface, NULL, pixel) if err: raise error() return Rect(0, 0, self.surface.w, self.surface.h) def scroll(self, int dx=0, int dy=0): cdef int srcx, destx, move_width cdef int srcy, desty, move_height cdef int width = self.surface.w cdef int height = self.surface.h cdef int per_pixel = self.surface.format.BytesPerPixel if dx >= 0: srcx = 0 destx = dx move_width = width - dx else: srcx = -dx destx = 0 move_width = width + dx if dy >= 0: srcy = 0 desty = dy move_height = height - dy else: srcy = -dy desty = 0 move_height = height + dy cdef Uint8 *srcptr = self.surface.pixels cdef Uint8 *destptr = self.surface.pixels srcptr += srcy * self.surface.pitch + srcx * per_pixel destptr += desty * self.surface.pitch + destx * per_pixel self.lock() with nogil: move_pixels( srcptr, destptr, move_height, move_width * per_pixel, self.surface.pitch, self.surface.pitch) self.unlock() def set_colorkey(self, color, flags=0): if color is None: if SDL_SetColorKey(self.surface, SDL_FALSE, 0): raise error() else: if SDL_SetColorKey(self.surface, SDL_TRUE, map_color(self.surface, color)): raise error() def get_colorkey(self): cdef Uint32 key if SDL_GetColorKey(self.surface, &key): return None return get_color(key, self.surface) def set_alpha(self, value, flags=0): if value is None: value = 255 self.has_alpha = False else: self.has_alpha = True if SDL_SetSurfaceAlphaMod(self.surface, value): raise error() def get_alpha(self): cdef Uint8 rv if self.has_alpha or self.surface.format.Amask: if SDL_GetSurfaceAlphaMod(self.surface, &rv): raise error() return rv else: return None def lock(self, lock=None): cdef Surface root = self while root.parent: root = root.parent if lock is None: lock = self if root.locklist is None: root.locklist = [ ] root.locklist.append(lock) SDL_LockSurface(root.surface) def unlock(self, lock=None): cdef Surface root = self while root.parent: root = root.parent if lock is None: lock = self if root.locklist is None: root.locklist = [ ] root.locklist.remove(lock) SDL_UnlockSurface(root.surface) def mustlock(self): cdef Surface root = self while root.parent: root = root.parent return SDL_MUSTLOCK(root.surface) def get_locked(self): if self.locklist: return True def get_locks(self): cdef Surface root = self while root.parent: root = root.parent if root.locklist is None: root.locklist = [ ] return root.locklist def get_at(self, pos): cdef int x, y cdef Uint8 *p x, y = pos if not (0 <= x < self.surface.w) or not (0 <= y < self.surface.h): raise IndexError("Position outside surface.") if self.surface.format.BytesPerPixel != 4: raise error("Surface has unsupported bytesize.") self.lock() p = self.surface.pixels p += y * self.surface.pitch p += x * 4 cdef Uint32 pixel = ( p)[0] self.unlock() return get_color(pixel, self.surface) def set_at(self, pos, color): cdef int x, y cdef Uint8 *p cdef Uint32 pixel x, y = pos if not (0 <= x < self.surface.w) or not (0 <= y < self.surface.h): raise ValueError("Position outside surface.") if self.surface.format.BytesPerPixel != 4: raise error("Surface has unsupported bytesize.") pixel = map_color(self.surface, color) self.lock() p = self.surface.pixels p += y * self.surface.pitch p += x * 4 ( p)[0] = pixel self.unlock() def get_at_mapped(self, pos): cdef int x, y cdef Uint8 *p x, y = pos if not (0 <= x < self.surface.w) or not (0 <= y < self.surface.h): raise ValueError("Position outside surface.") if self.surface.format.BytesPerPixel != 4: raise error("Surface has unsupported bytesize.") self.lock() p = self.surface.pixels p += y * self.surface.pitch p += x * 4 cdef Uint32 pixel = ( p)[0] self.unlock() return pixel def map_rgb(self, color): return map_color(self.surface, color) def unmap_rgb(self, pixel): return get_color(pixel, self.surface) def set_clip(self, rect): cdef SDL_Rect sdl_rect if rect is None: SDL_SetClipRect(self.surface, NULL) else: to_sdl_rect(rect, &sdl_rect) SDL_SetClipRect(self.surface, &sdl_rect) def get_clip(self): cdef SDL_Rect sdl_rect SDL_GetClipRect(self.surface, &sdl_rect) return (sdl_rect.x, sdl_rect.y, sdl_rect.w, sdl_rect.h) def subsurface(self, *args): cdef SDL_Rect sdl_rect if len(args) == 1: to_sdl_rect(args[0], &sdl_rect) else: to_sdl_rect(args, &sdl_rect) if sdl_rect.w < 0 or sdl_rect.h < 0: raise error("subsurface size must be non-negative.") if ((sdl_rect.x < 0) or (sdl_rect.y < 0) or (sdl_rect.x + sdl_rect.w > self.surface.w) or (sdl_rect.y + sdl_rect.h > self.surface.h)): raise error("subsurface rectangle outside surface area.") cdef Uint8 *pixels = self.surface.pixels pixels += sdl_rect.y * self.surface.pitch pixels += sdl_rect.x * self.surface.format.BytesPerPixel cdef SDL_Surface *new_surface = SDL_CreateRGBSurfaceFrom( pixels, sdl_rect.w, sdl_rect.h, self.surface.format.BitsPerPixel, self.surface.pitch, self.surface.format.Rmask, self.surface.format.Gmask, self.surface.format.Bmask, self.surface.format.Amask) cdef Surface rv = Surface(()) rv.surface = new_surface rv.parent = self rv.offset_x = sdl_rect.x rv.offset_y = sdl_rect.y if self.has_alpha: rv.set_alpha(self.get_alpha()) return rv def get_parent(self): return self.parent def get_abs_parent(self): rv = self while rv.parent: rv = rv.parent return rv def get_offset(self): return (self.offset_x, self.offset_y) def get_abs_offset(self): cdef Surface surf = self cdef int offset_x = 0 cdef int offset_y = 0 while surf: offset_x += surf.offset_x offset_y += surf.offset_y surf = surf.parent return (offset_x, offset_y) def get_size(self): return self.surface.w, self.surface.h def get_width(self): return self.surface.w def get_height(self): return self.surface.h def get_rect(self, **kwargs): rv = Rect((0, 0, self.surface.w, self.surface.h)) for k, v in kwargs.items(): setattr(rv, k, v) return rv def get_bitsize(self): return self.surface.format.BitsPerPixel def get_bytesize(self): return self.surface.format.BytesPerPixel def get_flags(self): if self.get_window_flags: rv = self.get_window_flags() else: rv = 0 if self.surface.format.Amask or self.has_alpha: rv = rv | SRCALPHA return rv def get_pitch(self): return self.surface.pitch def get_masks(self): cdef SDL_PixelFormat *format = self.surface.format return (format.Rmask, format.Gmask, format.Bmask, format.Amask) def set_masks(self, masks): warnings.warn("Surface.set_masks is not supported.") def get_shifts(self): cdef SDL_PixelFormat *format = self.surface.format return (format.Rshift, format.Gshift, format.Bshift, format.Ashift) def set_shifts(self, shifts): warnings.warn("Surface.set_shifts is not supported.") def get_shifts(self): cdef SDL_PixelFormat *format = self.surface.format return (format.Rshift, format.Gshift, format.Bshift, format.Ashift) def get_losses(self): cdef SDL_PixelFormat *format = self.surface.format return (format.Rloss, format.Gloss, format.Bloss, format.Aloss) def get_bounding_rect(self, min_alpha=1): cdef Uint32 amask = self.surface.format.Amask cdef Uint32 amin = (0x01010101 * min_alpha) & amask cdef int x cdef int y cdef int w cdef int h cdef int minx = self.surface.w - 1 cdef int maxx = 0 cdef int miny = self.surface.h - 1 cdef int maxy = 0 cdef Uint32 *row cdef Uint32 topleft cdef Uint32 botright if (not amask) or (self.surface.w == 0) or (self.surface.h == 0): return Rect((0, 0, self.surface.w, self.surface.h)) self.lock() cdef Uint8 *pixels = self.surface.pixels with nogil: topleft = ( pixels)[0] botright = ( (pixels + self.surface.pitch * (self.surface.h - 1)))[self.surface.w - 1] if ((topleft & amask) > amin) and ((botright & amask) > amin): # Bounding box covers image. minx = 0 miny = 0 maxx = self.surface.w - 1 maxy = self.surface.h - 1 else: # Bounding box is smaller than image. for 0 <= y < self.surface.h: row = (pixels + self.surface.pitch * y) for 0 <= x < self.surface.w: if (row[x] & amask) >= amin: if minx > x: minx = x if miny > y: miny = y if maxx < x: maxx = x if maxy < y: maxy = y self.unlock() # Totally empty surface. if minx > maxx: return Rect((0, 0, 0, 0)) x = minx y = miny w = min(maxx - minx + 1, self.surface.w - x) h = min(maxy - miny + 1, self.surface.h - y) return Rect((x, y, w, h)) def get_view(self, kind='2'): raise error("Surface.get_view is not supported.") def get_buffer(self): cdef Uint8 *pixels = self.surface.pixels return pixels[self.surface.h * self.surface.pitch] property _pixels_address: def __get__(self): return self.surface.pixels cdef api SDL_Surface *PySurface_AsSurface(surface): return ( surface).surface cdef api object PySurface_New(SDL_Surface *surf): cdef Surface rv = Surface(()) rv.take_surface(surf) return rv pygame_sdl2-2.1.0-for-renpy-6.99.14.1/src/SDL_gfxPrimitives.c0000664000175000017500000047204013053465306022557 0ustar tomtom00000000000000/* SDL_gfxPrimitives - Graphics primitives for SDL surfaces LGPL (c) A. Schiffler */ #include #include #include #include #include "SDL_gfxPrimitives.h" //#include "SDL_rotozoom.h" #include "SDL_gfxPrimitives_font.h" /* -===================- */ #define DEFAULT_ALPHA_PIXEL_ROUTINE #undef EXPERIMENTAL_ALPHA_PIXEL_ROUTINE /* ---- Structures */ /*! \brief The structure passed to the internal Bresenham iterator. */ typedef struct { Sint16 x, y; int dx, dy, s1, s2, swapdir, error; Uint32 count; } SDL_gfxBresenhamIterator; /*! \brief The structure passed to the internal Murphy iterator. */ typedef struct { Uint32 color; SDL_Surface *dst; int u, v; /* delta x , delta y */ int ku, kt, kv, kd; /* loop constants */ int oct2; int quad4; Sint16 last1x, last1y, last2x, last2y, first1x, first1y, first2x, first2y, tempx, tempy; } SDL_gfxMurphyIterator; /* ----- Defines for pixel clipping tests */ #define clip_xmin(surface) surface->clip_rect.x #define clip_xmax(surface) surface->clip_rect.x+surface->clip_rect.w-1 #define clip_ymin(surface) surface->clip_rect.y #define clip_ymax(surface) surface->clip_rect.y+surface->clip_rect.h-1 /*! \brief Internal pixel drawing - fast, no blending, no locking, clipping. \param dst The surface to draw on. \param x The horizontal coordinate of the pixel. \param y The vertical position of the pixel. \param color The color value of the pixel to draw. \returns Returns 0 on success, -1 on failure. */ int fastPixelColorNolock(SDL_Surface * dst, Sint16 x, Sint16 y, Uint32 color) { int bpp; Uint8 *p; /* * Honor clipping setup at pixel level */ if ((x >= clip_xmin(dst)) && (x <= clip_xmax(dst)) && (y >= clip_ymin(dst)) && (y <= clip_ymax(dst))) { /* * Get destination format */ bpp = dst->format->BytesPerPixel; p = (Uint8 *) dst->pixels + y * dst->pitch + x * bpp; switch (bpp) { case 1: *p = color; break; case 2: *(Uint16 *) p = color; break; case 3: if (SDL_BYTEORDER == SDL_BIG_ENDIAN) { p[0] = (color >> 16) & 0xff; p[1] = (color >> 8) & 0xff; p[2] = color & 0xff; } else { p[0] = color & 0xff; p[1] = (color >> 8) & 0xff; p[2] = (color >> 16) & 0xff; } break; case 4: *(Uint32 *) p = color; break; } /* switch */ } return (0); } /*! \brief Internal pixel drawing - fast, no blending, no locking, no clipping. Function is faster but dangerous since no clipping check is done. Code needs to make sure we stay in surface bounds before calling. \param dst The surface to draw on. \param x The horizontal coordinate of the pixel. \param y The vertical position of the pixel. \param color The color value of the pixel to draw. \returns Returns 0 on success, -1 on failure. */ int fastPixelColorNolockNoclip(SDL_Surface * dst, Sint16 x, Sint16 y, Uint32 color) { int bpp; Uint8 *p; /* * Get destination format */ bpp = dst->format->BytesPerPixel; p = (Uint8 *) dst->pixels + y * dst->pitch + x * bpp; switch (bpp) { case 1: *p = color; break; case 2: *(Uint16 *) p = color; break; case 3: if (SDL_BYTEORDER == SDL_BIG_ENDIAN) { p[0] = (color >> 16) & 0xff; p[1] = (color >> 8) & 0xff; p[2] = color & 0xff; } else { p[0] = color & 0xff; p[1] = (color >> 8) & 0xff; p[2] = (color >> 16) & 0xff; } break; case 4: *(Uint32 *) p = color; break; } /* switch */ return (0); } /*! \brief Internal pixel drawing - fast, no blending, locking, clipping. \param dst The surface to draw on. \param x The horizontal coordinate of the pixel. \param y The vertical position of the pixel. \param color The color value of the pixel to draw. \returns Returns 0 on success, -1 on failure. */ int fastPixelColor(SDL_Surface * dst, Sint16 x, Sint16 y, Uint32 color) { int result; /* * Lock the surface */ if (SDL_MUSTLOCK(dst)) { if (SDL_LockSurface(dst) < 0) { return (-1); } } result = fastPixelColorNolock(dst, x, y, color); /* * Unlock surface */ if (SDL_MUSTLOCK(dst)) { SDL_UnlockSurface(dst); } return (result); } /*! \brief Internal pixel drawing - fast, no blending, locking, RGB input. \param dst The surface to draw on. \param x The horizontal coordinate of the pixel. \param y The vertical position of the pixel. \param r The red value of the pixel to draw. \param g The green value of the pixel to draw. \param b The blue value of the pixel to draw. \param a The alpha value of the pixel to draw. \returns Returns 0 on success, -1 on failure. */ int fastPixelRGBA(SDL_Surface * dst, Sint16 x, Sint16 y, Uint8 r, Uint8 g, Uint8 b, Uint8 a) { Uint32 color; /* * Setup color */ color = SDL_MapRGBA(dst->format, r, g, b, a); /* * Draw */ return (fastPixelColor(dst, x, y, color)); } /*! \brief Internal pixel drawing - fast, no blending, no locking RGB input. \param dst The surface to draw on. \param x The horizontal coordinate of the pixel. \param y The vertical position of the pixel. \param r The red value of the pixel to draw. \param g The green value of the pixel to draw. \param b The blue value of the pixel to draw. \param a The alpha value of the pixel to draw. \returns Returns 0 on success, -1 on failure. */ int fastPixelRGBANolock(SDL_Surface * dst, Sint16 x, Sint16 y, Uint8 r, Uint8 g, Uint8 b, Uint8 a) { Uint32 color; /* * Setup color */ color = SDL_MapRGBA(dst->format, r, g, b, a); /* * Draw */ return (fastPixelColorNolock(dst, x, y, color)); } /*! \brief Internal pixel drawing function with alpha blending where input color in in destination format. Contains two alternative 32 bit alpha blending routines which can be enabled at the source level with the defines DEFAULT_ALPHA_PIXEL_ROUTINE or EXPERIMENTAL_ALPHA_PIXEL_ROUTINE. Only the bits up to the surface depth are significant in the color value. \param dst The surface to draw on. \param x The horizontal coordinate of the pixel. \param y The vertical position of the pixel. \param color The color value of the pixel to draw. \param alpha The blend factor to apply while drawing. \returns Returns 0 on success, -1 on failure. */ int _putPixelAlpha(SDL_Surface *dst, Sint16 x, Sint16 y, Uint32 color, Uint8 alpha) { SDL_PixelFormat *format; Uint32 Rmask, Gmask, Bmask, Amask; Uint32 Rshift, Gshift, Bshift, Ashift; Uint32 R, G, B, A; if (dst == NULL) { return (-1); } if (x >= clip_xmin(dst) && x <= clip_xmax(dst) && y >= clip_ymin(dst) && y <= clip_ymax(dst)) { format = dst->format; switch (format->BytesPerPixel) { case 1: { /* Assuming 8-bpp */ if (alpha == 255) { *((Uint8 *) dst->pixels + y * dst->pitch + x) = color; } else { Uint8 *pixel = (Uint8 *) dst->pixels + y * dst->pitch + x; SDL_Palette *palette = format->palette; SDL_Color *colors = palette->colors; SDL_Color dColor = colors[*pixel]; SDL_Color sColor = colors[color]; Uint8 dR = dColor.r; Uint8 dG = dColor.g; Uint8 dB = dColor.b; Uint8 sR = sColor.r; Uint8 sG = sColor.g; Uint8 sB = sColor.b; dR = dR + ((sR - dR) * alpha >> 8); dG = dG + ((sG - dG) * alpha >> 8); dB = dB + ((sB - dB) * alpha >> 8); *pixel = SDL_MapRGB(format, dR, dG, dB); } } break; case 2: { /* Probably 15-bpp or 16-bpp */ if (alpha == 255) { *((Uint16 *) dst->pixels + y * dst->pitch / 2 + x) = color; } else { Uint16 *pixel = (Uint16 *) dst->pixels + y * dst->pitch / 2 + x; Uint32 dc = *pixel; Rmask = format->Rmask; Gmask = format->Gmask; Bmask = format->Bmask; Amask = format->Amask; R = ((dc & Rmask) + (((color & Rmask) - (dc & Rmask)) * alpha >> 8)) & Rmask; G = ((dc & Gmask) + (((color & Gmask) - (dc & Gmask)) * alpha >> 8)) & Gmask; B = ((dc & Bmask) + (((color & Bmask) - (dc & Bmask)) * alpha >> 8)) & Bmask; *pixel = R | G | B; if (Amask!=0) { A = ((dc & Amask) + (((color & Amask) - (dc & Amask)) * alpha >> 8)) & Amask; *pixel |= A; } } } break; case 3: { /* Slow 24-bpp mode, usually not used */ Uint8 Rshift8, Gshift8, Bshift8, Ashift8; Uint8 *pixel = (Uint8 *) dst->pixels + y * dst->pitch + x * 3; Rshift = format->Rshift; Gshift = format->Gshift; Bshift = format->Bshift; Ashift = format->Ashift; Rshift8 = Rshift / 8; Gshift8 = Gshift / 8; Bshift8 = Bshift / 8; Ashift8 = Ashift / 8; if (alpha == 255) { *(pixel + Rshift8) = color >> Rshift; *(pixel + Gshift8) = color >> Gshift; *(pixel + Bshift8) = color >> Bshift; *(pixel + Ashift8) = color >> Ashift; } else { Uint8 dR, dG, dB, dA = 0; Uint8 sR, sG, sB, sA = 0; dR = *((pixel) + Rshift8); dG = *((pixel) + Gshift8); dB = *((pixel) + Bshift8); dA = *((pixel) + Ashift8); sR = (color >> Rshift) & 0xff; sG = (color >> Gshift) & 0xff; sB = (color >> Bshift) & 0xff; sA = (color >> Ashift) & 0xff; dR = dR + ((sR - dR) * alpha >> 8); dG = dG + ((sG - dG) * alpha >> 8); dB = dB + ((sB - dB) * alpha >> 8); dA = dA + ((sA - dA) * alpha >> 8); *((pixel) + Rshift8) = dR; *((pixel) + Gshift8) = dG; *((pixel) + Bshift8) = dB; *((pixel) + Ashift8) = dA; } } break; #ifdef DEFAULT_ALPHA_PIXEL_ROUTINE case 4: { /* Probably :-) 32-bpp */ if (alpha == 255) { *((Uint32 *) dst->pixels + y * dst->pitch / 4 + x) = color; } else { Uint32 *pixel = (Uint32 *) dst->pixels + y * dst->pitch / 4 + x; Uint32 dc = *pixel; Rmask = format->Rmask; Gmask = format->Gmask; Bmask = format->Bmask; Amask = format->Amask; Rshift = format->Rshift; Gshift = format->Gshift; Bshift = format->Bshift; Ashift = format->Ashift; R = ((dc & Rmask) + (((((color & Rmask) - (dc & Rmask)) >> Rshift) * alpha >> 8) << Rshift)) & Rmask; G = ((dc & Gmask) + (((((color & Gmask) - (dc & Gmask)) >> Gshift) * alpha >> 8) << Gshift)) & Gmask; B = ((dc & Bmask) + (((((color & Bmask) - (dc & Bmask)) >> Bshift) * alpha >> 8) << Bshift)) & Bmask; *pixel = R | G | B; if (Amask!=0) { A = ((dc & Amask) + (((((color & Amask) - (dc & Amask)) >> Ashift) * alpha >> 8) << Ashift)) & Amask; *pixel |= A; } } } break; #endif #ifdef EXPERIMENTAL_ALPHA_PIXEL_ROUTINE case 4:{ /* Probably :-) 32-bpp */ if (alpha == 255) { *((Uint32 *) dst->pixels + y * dst->pitch / 4 + x) = color; } else { Uint32 *pixel = (Uint32 *) dst->pixels + y * dst->pitch / 4 + x; Uint32 dR, dG, dB, dA; Uint32 dc = *pixel; Uint32 surfaceAlpha, preMultR, preMultG, preMultB; Uint32 aTmp; Rmask = format->Rmask; Gmask = format->Gmask; Bmask = format->Bmask; Amask = format->Amask; dR = (color & Rmask); dG = (color & Gmask); dB = (color & Bmask); dA = (color & Amask); Rshift = format->Rshift; Gshift = format->Gshift; Bshift = format->Bshift; Ashift = format->Ashift; preMultR = (alpha * (dR >> Rshift)); preMultG = (alpha * (dG >> Gshift)); preMultB = (alpha * (dB >> Bshift)); surfaceAlpha = ((dc & Amask) >> Ashift); aTmp = (255 - alpha); if (A = 255 - ((aTmp * (255 - surfaceAlpha)) >> 8 )) { aTmp *= surfaceAlpha; R = (preMultR + ((aTmp * ((dc & Rmask) >> Rshift)) >> 8)) / A << Rshift & Rmask; G = (preMultG + ((aTmp * ((dc & Gmask) >> Gshift)) >> 8)) / A << Gshift & Gmask; B = (preMultB + ((aTmp * ((dc & Bmask) >> Bshift)) >> 8)) / A << Bshift & Bmask; } *pixel = R | G | B | (A << Ashift & Amask); } } break; #endif } } return (0); } /*! \brief Pixel draw with blending enabled if a<255. \param dst The surface to draw on. \param x X (horizontal) coordinate of the pixel. \param y Y (vertical) coordinate of the pixel. \param color The color value of the pixel to draw (0xRRGGBBAA). \returns Returns 0 on success, -1 on failure. */ int pixelColor(SDL_Surface * dst, Sint16 x, Sint16 y, Uint32 color) { Uint8 alpha; Uint32 mcolor; int result = 0; /* * Lock the surface */ if (SDL_MUSTLOCK(dst)) { if (SDL_LockSurface(dst) < 0) { return (-1); } } /* * Setup color */ alpha = color & 0x000000ff; mcolor = SDL_MapRGBA(dst->format, (color & 0xff000000) >> 24, (color & 0x00ff0000) >> 16, (color & 0x0000ff00) >> 8, alpha); /* * Draw */ result = _putPixelAlpha(dst, x, y, mcolor, alpha); /* * Unlock the surface */ if (SDL_MUSTLOCK(dst)) { SDL_UnlockSurface(dst); } return (result); } /*! \brief Pixel draw with blending enabled if a<255 - no surface locking. \param dst The surface to draw on. \param x X (horizontal) coordinate of the pixel. \param y Y (vertical) coordinate of the pixel. \param color The color value of the pixel to draw (0xRRGGBBAA). \returns Returns 0 on success, -1 on failure. */ int pixelColorNolock(SDL_Surface * dst, Sint16 x, Sint16 y, Uint32 color) { Uint8 alpha; Uint32 mcolor; int result = 0; /* * Setup color */ alpha = color & 0x000000ff; mcolor = SDL_MapRGBA(dst->format, (color & 0xff000000) >> 24, (color & 0x00ff0000) >> 16, (color & 0x0000ff00) >> 8, alpha); /* * Draw */ result = _putPixelAlpha(dst, x, y, mcolor, alpha); return (result); } /*! \brief Internal function to draw filled rectangle with alpha blending. Assumes color is in destination format. \param dst The surface to draw on. \param x1 X coordinate of the first corner (upper left) of the rectangle. \param y1 Y coordinate of the first corner (upper left) of the rectangle. \param x2 X coordinate of the second corner (lower right) of the rectangle. \param y2 Y coordinate of the second corner (lower right) of the rectangle. \param color The color value of the rectangle to draw (0xRRGGBBAA). \param alpha Alpha blending amount for pixels. \returns Returns 0 on success, -1 on failure. */ int _filledRectAlpha(SDL_Surface * dst, Sint16 x1, Sint16 y1, Sint16 x2, Sint16 y2, Uint32 color, Uint8 alpha) { SDL_PixelFormat *format; Uint32 Rmask, Bmask, Gmask, Amask; Uint32 Rshift, Bshift, Gshift, Ashift; Uint8 sR, sG, sB, sA; Uint32 R, G, B, A; Sint16 x, y; format = dst->format; switch (format->BytesPerPixel) { case 1: { /* Assuming 8-bpp */ Uint8 *row, *pixel; Uint8 dR, dG, dB; SDL_Palette *palette = format->palette; SDL_Color *colors = palette->colors; sR = colors[color].r; sG = colors[color].g; sB = colors[color].b; for (y = y1; y <= y2; y++) { row = (Uint8 *) dst->pixels + y * dst->pitch; for (x = x1; x <= x2; x++) { pixel = row + x; dR = colors[*pixel].r; dG = colors[*pixel].g; dB = colors[*pixel].b; dR = dR + ((sR - dR) * alpha >> 8); dG = dG + ((sG - dG) * alpha >> 8); dB = dB + ((sB - dB) * alpha >> 8); *pixel = SDL_MapRGB(format, dR, dG, dB); } } } break; case 2: { /* Probably 15-bpp or 16-bpp */ Uint16 *row, *pixel; Uint32 dR, dG, dB, dA; Rmask = format->Rmask; Gmask = format->Gmask; Bmask = format->Bmask; Amask = format->Amask; dR = (color & Rmask); dG = (color & Gmask); dB = (color & Bmask); dA = (color & Amask); for (y = y1; y <= y2; y++) { row = (Uint16 *) dst->pixels + y * dst->pitch / 2; for (x = x1; x <= x2; x++) { pixel = row + x; R = ((*pixel & Rmask) + ((dR - (*pixel & Rmask)) * alpha >> 8)) & Rmask; G = ((*pixel & Gmask) + ((dG - (*pixel & Gmask)) * alpha >> 8)) & Gmask; B = ((*pixel & Bmask) + ((dB - (*pixel & Bmask)) * alpha >> 8)) & Bmask; *pixel = R | G | B; if (Amask!=0) { A = ((*pixel & Amask) + ((dA - (*pixel & Amask)) * alpha >> 8)) & Amask; *pixel |= A; } } } } break; case 3: { /* Slow 24-bpp mode, usually not used */ Uint8 *row, *pix; Uint8 dR, dG, dB, dA; Uint8 Rshift8, Gshift8, Bshift8, Ashift8; Rshift = format->Rshift; Gshift = format->Gshift; Bshift = format->Bshift; Ashift = format->Ashift; Rshift8 = Rshift / 8; Gshift8 = Gshift / 8; Bshift8 = Bshift / 8; Ashift8 = Ashift / 8; sR = (color >> Rshift) & 0xff; sG = (color >> Gshift) & 0xff; sB = (color >> Bshift) & 0xff; sA = (color >> Ashift) & 0xff; for (y = y1; y <= y2; y++) { row = (Uint8 *) dst->pixels + y * dst->pitch; for (x = x1; x <= x2; x++) { pix = row + x * 3; dR = *((pix) + Rshift8); dG = *((pix) + Gshift8); dB = *((pix) + Bshift8); dA = *((pix) + Ashift8); dR = dR + ((sR - dR) * alpha >> 8); dG = dG + ((sG - dG) * alpha >> 8); dB = dB + ((sB - dB) * alpha >> 8); dA = dA + ((sA - dA) * alpha >> 8); *((pix) + Rshift8) = dR; *((pix) + Gshift8) = dG; *((pix) + Bshift8) = dB; *((pix) + Ashift8) = dA; } } } break; #ifdef DEFAULT_ALPHA_PIXEL_ROUTINE case 4: { /* Probably :-) 32-bpp */ Uint32 *row, *pixel; Uint32 dR, dG, dB, dA; Rmask = format->Rmask; Gmask = format->Gmask; Bmask = format->Bmask; Amask = format->Amask; Rshift = format->Rshift; Gshift = format->Gshift; Bshift = format->Bshift; Ashift = format->Ashift; dR = (color & Rmask); dG = (color & Gmask); dB = (color & Bmask); dA = (color & Amask); for (y = y1; y <= y2; y++) { row = (Uint32 *) dst->pixels + y * dst->pitch / 4; for (x = x1; x <= x2; x++) { pixel = row + x; R = ((*pixel & Rmask) + ((((dR - (*pixel & Rmask)) >> Rshift) * alpha >> 8) << Rshift)) & Rmask; G = ((*pixel & Gmask) + ((((dG - (*pixel & Gmask)) >> Gshift) * alpha >> 8) << Gshift)) & Gmask; B = ((*pixel & Bmask) + ((((dB - (*pixel & Bmask)) >> Bshift) * alpha >> 8) << Bshift)) & Bmask; *pixel = R | G | B; if (Amask!=0) { A = ((*pixel & Amask) + ((((dA - (*pixel & Amask)) >> Ashift) * alpha >> 8) << Ashift)) & Amask; *pixel |= A; } } } } break; #endif #ifdef EXPERIMENTAL_ALPHA_PIXEL_ROUTINE case 4:{ /* Probably :-) 32-bpp */ Uint32 *row, *pixel; Uint32 dR, dG, dB, dA; Uint32 dc; Uint32 surfaceAlpha, preMultR, preMultG, preMultB; Uint32 aTmp; Rmask = format->Rmask; Gmask = format->Gmask; Bmask = format->Bmask; Amask = format->Amask; dR = (color & Rmask); dG = (color & Gmask); dB = (color & Bmask); dA = (color & Amask); Rshift = format->Rshift; Gshift = format->Gshift; Bshift = format->Bshift; Ashift = format->Ashift; preMultR = (alpha * (dR >> Rshift)); preMultG = (alpha * (dG >> Gshift)); preMultB = (alpha * (dB >> Bshift)); for (y = y1; y <= y2; y++) { row = (Uint32 *) dst->pixels + y * dst->pitch / 4; for (x = x1; x <= x2; x++) { pixel = row + x; dc = *pixel; surfaceAlpha = ((dc & Amask) >> Ashift); aTmp = (255 - alpha); if (A = 255 - ((aTmp * (255 - surfaceAlpha)) >> 8 )) { aTmp *= surfaceAlpha; R = (preMultR + ((aTmp * ((dc & Rmask) >> Rshift)) >> 8)) / A << Rshift & Rmask; G = (preMultG + ((aTmp * ((dc & Gmask) >> Gshift)) >> 8)) / A << Gshift & Gmask; B = (preMultB + ((aTmp * ((dc & Bmask) >> Bshift)) >> 8)) / A << Bshift & Bmask; } *pixel = R | G | B | (A << Ashift & Amask); } } } break; #endif } return (0); } /*! \brief Draw filled rectangle of RGBA color with alpha blending. \param dst The surface to draw on. \param x1 X coordinate of the first corner (upper left) of the rectangle. \param y1 Y coordinate of the first corner (upper left) of the rectangle. \param x2 X coordinate of the second corner (lower right) of the rectangle. \param y2 Y coordinate of the second corner (lower right) of the rectangle. \param color The color value of the rectangle to draw (0xRRGGBBAA). \returns Returns 0 on success, -1 on failure. */ int filledRectAlpha(SDL_Surface * dst, Sint16 x1, Sint16 y1, Sint16 x2, Sint16 y2, Uint32 color) { Uint8 alpha; Uint32 mcolor; int result = 0; /* * Lock the surface */ if (SDL_MUSTLOCK(dst)) { if (SDL_LockSurface(dst) < 0) { return (-1); } } /* * Setup color */ alpha = color & 0x000000ff; mcolor = SDL_MapRGBA(dst->format, (color & 0xff000000) >> 24, (color & 0x00ff0000) >> 16, (color & 0x0000ff00) >> 8, alpha); /* * Draw */ result = _filledRectAlpha(dst, x1, y1, x2, y2, mcolor, alpha); /* * Unlock the surface */ if (SDL_MUSTLOCK(dst)) { SDL_UnlockSurface(dst); } return (result); } /*! \brief Internal function to draw horizontal line of RGBA color with alpha blending. \param dst The surface to draw on. \param x1 X coordinate of the first point (i.e. left) of the line. \param x2 X coordinate of the second point (i.e. right) of the line. \param y Y coordinate of the points of the line. \param color The color value of the line to draw (0xRRGGBBAA). \returns Returns 0 on success, -1 on failure. */ int _HLineAlpha(SDL_Surface * dst, Sint16 x1, Sint16 x2, Sint16 y, Uint32 color) { return (filledRectAlpha(dst, x1, y, x2, y, color)); } /*! \brief Internal function to draw vertical line of RGBA color with alpha blending. \param dst The surface to draw on. \param x X coordinate of the points of the line. \param y1 Y coordinate of the first point (top) of the line. \param y2 Y coordinate of the second point (bottom) of the line. \param color The color value of the line to draw (0xRRGGBBAA). \returns Returns 0 on success, -1 on failure. */ int _VLineAlpha(SDL_Surface * dst, Sint16 x, Sint16 y1, Sint16 y2, Uint32 color) { return (filledRectAlpha(dst, x, y1, x, y2, color)); } /*! \brief Pixel draw with blending enabled and using alpha weight on color. \param dst The surface to draw on. \param x The horizontal coordinate of the pixel. \param y The vertical position of the pixel. \param color The color value of the pixel to draw (0xRRGGBBAA). \param weight The weight multiplied into the alpha value of the pixel. \returns Returns 0 on success, -1 on failure. */ int pixelColorWeight(SDL_Surface * dst, Sint16 x, Sint16 y, Uint32 color, Uint32 weight) { Uint32 a; /* * Get alpha */ a = (color & (Uint32) 0x000000ff); /* * Modify Alpha by weight */ a = ((a * weight) >> 8); return (pixelColor(dst, x, y, (color & (Uint32) 0xffffff00) | (Uint32) a)); } /*! \brief Pixel draw with blending enabled and using alpha weight on color - no locking. \param dst The surface to draw on. \param x The horizontal coordinate of the pixel. \param y The vertical position of the pixel. \param color The color value of the pixel to draw (0xRRGGBBAA). \param weight The weight multiplied into the alpha value of the pixel. \returns Returns 0 on success, -1 on failure. */ int pixelColorWeightNolock(SDL_Surface * dst, Sint16 x, Sint16 y, Uint32 color, Uint32 weight) { Uint32 a; /* * Get alpha */ a = (color & (Uint32) 0x000000ff); /* * Modify Alpha by weight */ a = ((a * weight) >> 8); return (pixelColorNolock(dst, x, y, (color & (Uint32) 0xffffff00) | (Uint32) a)); } /*! \brief Pixel draw with blending enabled if a<255. \param dst The surface to draw on. \param x X (horizontal) coordinate of the pixel. \param y Y (vertical) coordinate of the pixel. \param r The red color value of the pixel to draw. \param g The green color value of the pixel to draw. \param b The blue color value of the pixel to draw. \param a The alpha value of the pixel to draw. \returns Returns 0 on success, -1 on failure. */ int pixelRGBA(SDL_Surface * dst, Sint16 x, Sint16 y, Uint8 r, Uint8 g, Uint8 b, Uint8 a) { Uint32 color; /* * Check Alpha */ if (a == 255) { /* * No alpha blending required */ /* * Setup color */ color = SDL_MapRGBA(dst->format, r, g, b, a); /* * Draw */ return (fastPixelColor(dst, x, y, color)); } else { /* * Alpha blending required */ /* * Draw */ return (pixelColor(dst, x, y, ((Uint32) r << 24) | ((Uint32) g << 16) | ((Uint32) b << 8) | (Uint32) a)); } } /*! \brief Draw horizontal line without blending; Just stores the color value (including the alpha component) without blending. Only the same number of bits of the destination surface are transfered from the input color value. \param dst The surface to draw on. \param x1 X coordinate of the first point (i.e. left) of the line. \param x2 X coordinate of the second point (i.e. right) of the line. \param y Y coordinate of the points of the line. \param color The color value of the line to draw. \returns Returns 0 on success, -1 on failure. */ int hlineColorStore(SDL_Surface * dst, Sint16 x1, Sint16 x2, Sint16 y, Uint32 color) { Sint16 left, right, top, bottom; Uint8 *pixel, *pixellast; int dx; int pixx, pixy; Sint16 w; Sint16 xtmp; int result = -1; /* * Check visibility of clipping rectangle */ if ((dst->clip_rect.w==0) || (dst->clip_rect.h==0)) { return(0); } /* * Swap x1, x2 if required to ensure x1<=x2 */ if (x1 > x2) { xtmp = x1; x1 = x2; x2 = xtmp; } /* * Get clipping boundary and * check visibility of hline */ left = dst->clip_rect.x; if (x2clip_rect.x + dst->clip_rect.w - 1; if (x1>right) { return(0); } top = dst->clip_rect.y; bottom = dst->clip_rect.y + dst->clip_rect.h - 1; if ((ybottom)) { return (0); } /* * Clip x */ if (x1 < left) { x1 = left; } if (x2 > right) { x2 = right; } /* * Calculate width */ w = x2 - x1; /* * Lock the surface */ if (SDL_MUSTLOCK(dst)) { if (SDL_LockSurface(dst) < 0) { return (-1); } } /* * More variable setup */ dx = w; pixx = dst->format->BytesPerPixel; pixy = dst->pitch; pixel = ((Uint8 *) dst->pixels) + pixx * (int) x1 + pixy * (int) y; /* * Draw */ switch (dst->format->BytesPerPixel) { case 1: memset(pixel, color, dx+1); break; case 2: pixellast = pixel + dx + dx; for (; pixel <= pixellast; pixel += pixx) { *(Uint16 *) pixel = color; } break; case 3: pixellast = pixel + dx + dx + dx; for (; pixel <= pixellast; pixel += pixx) { if (SDL_BYTEORDER == SDL_BIG_ENDIAN) { pixel[0] = (color >> 16) & 0xff; pixel[1] = (color >> 8) & 0xff; pixel[2] = color & 0xff; } else { pixel[0] = color & 0xff; pixel[1] = (color >> 8) & 0xff; pixel[2] = (color >> 16) & 0xff; } } break; default: /* case 4 */ dx = dx + dx; pixellast = pixel + dx + dx; for (; pixel <= pixellast; pixel += pixx) { *(Uint32 *) pixel = color; } break; } /* * Unlock surface */ if (SDL_MUSTLOCK(dst)) { SDL_UnlockSurface(dst); } /* * Set result code */ result = 0; return (result); } /*! \brief Draw horizontal line without blending Just stores the color value (including the alpha component) without blending. Function should only be used for 32 bit target surfaces. \param dst The surface to draw on. \param x1 X coordinate of the first point (i.e. left) of the line. \param x2 X coordinate of the second point (i.e. right) of the line. \param y Y coordinate of the points of the line. \param r The red value of the line to draw. \param g The green value of the line to draw. \param b The blue value of the line to draw. \param a The alpha value of the line to draw. \returns Returns 0 on success, -1 on failure. */ int hlineRGBAStore(SDL_Surface * dst, Sint16 x1, Sint16 x2, Sint16 y, Uint8 r, Uint8 g, Uint8 b, Uint8 a) { /* * Draw */ return (hlineColorStore(dst, x1, x2, y, ((Uint32) r << 24) | ((Uint32) g << 16) | ((Uint32) b << 8) | (Uint32) a)); } /*! \brief Draw horizontal line with blending. \param dst The surface to draw on. \param x1 X coordinate of the first point (i.e. left) of the line. \param x2 X coordinate of the second point (i.e. right) of the line. \param y Y coordinate of the points of the line. \param color The color value of the line to draw (0xRRGGBBAA). \returns Returns 0 on success, -1 on failure. */ int hlineColor(SDL_Surface * dst, Sint16 x1, Sint16 x2, Sint16 y, Uint32 color) { Sint16 left, right, top, bottom; Uint8 *pixel, *pixellast; int dx; int pixx, pixy; Sint16 xtmp; int result = -1; Uint8 *colorptr; Uint8 color3[3]; /* * Check visibility of clipping rectangle */ if ((dst->clip_rect.w==0) || (dst->clip_rect.h==0)) { return(0); } /* * Swap x1, x2 if required to ensure x1<=x2 */ if (x1 > x2) { xtmp = x1; x1 = x2; x2 = xtmp; } /* * Get clipping boundary and * check visibility of hline */ left = dst->clip_rect.x; if (x2clip_rect.x + dst->clip_rect.w - 1; if (x1>right) { return(0); } top = dst->clip_rect.y; bottom = dst->clip_rect.y + dst->clip_rect.h - 1; if ((ybottom)) { return (0); } /* * Clip x */ if (x1 < left) { x1 = left; } if (x2 > right) { x2 = right; } /* * Calculate width difference */ dx = x2 - x1; /* * Alpha check */ if ((color & 255) == 255) { /* * No alpha-blending required */ /* * Setup color */ colorptr = (Uint8 *) & color; if (SDL_BYTEORDER == SDL_BIG_ENDIAN) { color = SDL_MapRGBA(dst->format, colorptr[0], colorptr[1], colorptr[2], colorptr[3]); } else { color = SDL_MapRGBA(dst->format, colorptr[3], colorptr[2], colorptr[1], colorptr[0]); } /* * Lock the surface */ if (SDL_MUSTLOCK(dst)) { if (SDL_LockSurface(dst) < 0) { return (-1); } } /* * More variable setup */ pixx = dst->format->BytesPerPixel; pixy = dst->pitch; pixel = ((Uint8 *) dst->pixels) + pixx * (int) x1 + pixy * (int) y; /* * Draw */ switch (dst->format->BytesPerPixel) { case 1: memset(pixel, color, dx + 1); break; case 2: pixellast = pixel + dx + dx; for (; pixel <= pixellast; pixel += pixx) { *(Uint16 *) pixel = color; } break; case 3: pixellast = pixel + dx + dx + dx; if (SDL_BYTEORDER == SDL_BIG_ENDIAN) { color3[0] = (color >> 16) & 0xff; color3[1] = (color >> 8) & 0xff; color3[2] = color & 0xff; } else { color3[0] = color & 0xff; color3[1] = (color >> 8) & 0xff; color3[2] = (color >> 16) & 0xff; } for (; pixel <= pixellast; pixel += pixx) { memcpy(pixel, color3, 3); } break; default: /* case 4 */ dx = dx + dx; pixellast = pixel + dx + dx; for (; pixel <= pixellast; pixel += pixx) { *(Uint32 *) pixel = color; } break; } /* * Unlock surface */ if (SDL_MUSTLOCK(dst)) { SDL_UnlockSurface(dst); } /* * Set result code */ result = 0; } else { /* * Alpha blending blit */ result = _HLineAlpha(dst, x1, x1 + dx, y, color); } return (result); } /*! \brief Draw horizontal line with blending. \param dst The surface to draw on. \param x1 X coordinate of the first point (i.e. left) of the line. \param x2 X coordinate of the second point (i.e. right) of the line. \param y Y coordinate of the points of the line. \param r The red value of the line to draw. \param g The green value of the line to draw. \param b The blue value of the line to draw. \param a The alpha value of the line to draw. \returns Returns 0 on success, -1 on failure. */ int hlineRGBA(SDL_Surface * dst, Sint16 x1, Sint16 x2, Sint16 y, Uint8 r, Uint8 g, Uint8 b, Uint8 a) { /* * Draw */ return (hlineColor(dst, x1, x2, y, ((Uint32) r << 24) | ((Uint32) g << 16) | ((Uint32) b << 8) | (Uint32) a)); } /*! \brief Draw vertical line with blending. \param dst The surface to draw on. \param x X coordinate of the points of the line. \param y1 Y coordinate of the first point (i.e. top) of the line. \param y2 Y coordinate of the second point (i.e. bottom) of the line. \param color The color value of the line to draw (0xRRGGBBAA). \returns Returns 0 on success, -1 on failure. */ int vlineColor(SDL_Surface * dst, Sint16 x, Sint16 y1, Sint16 y2, Uint32 color) { Sint16 left, right, top, bottom; Uint8 *pixel, *pixellast; int dy; int pixx, pixy; Sint16 h; Sint16 ytmp; int result = -1; Uint8 *colorptr; /* * Check visibility of clipping rectangle */ if ((dst->clip_rect.w==0) || (dst->clip_rect.h==0)) { return(0); } /* * Swap y1, y2 if required to ensure y1<=y2 */ if (y1 > y2) { ytmp = y1; y1 = y2; y2 = ytmp; } /* * Get clipping boundary and * check visibility of vline */ left = dst->clip_rect.x; right = dst->clip_rect.x + dst->clip_rect.w - 1; if ((xright)) { return (0); } top = dst->clip_rect.y; if (y2clip_rect.y + dst->clip_rect.h - 1; if (y1>bottom) { return(0); } /* * Clip x */ if (y1 < top) { y1 = top; } if (y2 > bottom) { y2 = bottom; } /* * Calculate height */ h = y2 - y1; /* * Alpha check */ if ((color & 255) == 255) { /* * No alpha-blending required */ /* * Setup color */ colorptr = (Uint8 *) & color; if (SDL_BYTEORDER == SDL_BIG_ENDIAN) { color = SDL_MapRGBA(dst->format, colorptr[0], colorptr[1], colorptr[2], colorptr[3]); } else { color = SDL_MapRGBA(dst->format, colorptr[3], colorptr[2], colorptr[1], colorptr[0]); } /* * Lock the surface */ if (SDL_MUSTLOCK(dst)) { if (SDL_LockSurface(dst) < 0) { return (-1); } } /* * More variable setup */ dy = h; pixx = dst->format->BytesPerPixel; pixy = dst->pitch; pixel = ((Uint8 *) dst->pixels) + pixx * (int) x + pixy * (int) y1; pixellast = pixel + pixy * dy; /* * Draw */ switch (dst->format->BytesPerPixel) { case 1: for (; pixel <= pixellast; pixel += pixy) { *(Uint8 *) pixel = color; } break; case 2: for (; pixel <= pixellast; pixel += pixy) { *(Uint16 *) pixel = color; } break; case 3: for (; pixel <= pixellast; pixel += pixy) { if (SDL_BYTEORDER == SDL_BIG_ENDIAN) { pixel[0] = (color >> 16) & 0xff; pixel[1] = (color >> 8) & 0xff; pixel[2] = color & 0xff; } else { pixel[0] = color & 0xff; pixel[1] = (color >> 8) & 0xff; pixel[2] = (color >> 16) & 0xff; } } break; default: /* case 4 */ for (; pixel <= pixellast; pixel += pixy) { *(Uint32 *) pixel = color; } break; } /* Unlock surface */ if (SDL_MUSTLOCK(dst)) { SDL_UnlockSurface(dst); } /* * Set result code */ result = 0; } else { /* * Alpha blending blit */ result = _VLineAlpha(dst, x, y1, y1 + h, color); } return (result); } /*! \brief Draw vertical line with blending. \param dst The surface to draw on. \param x X coordinate of the points of the line. \param y1 Y coordinate of the first point (i.e. top) of the line. \param y2 Y coordinate of the second point (i.e. bottom) of the line. \param r The red value of the line to draw. \param g The green value of the line to draw. \param b The blue value of the line to draw. \param a The alpha value of the line to draw. \returns Returns 0 on success, -1 on failure. */ int vlineRGBA(SDL_Surface * dst, Sint16 x, Sint16 y1, Sint16 y2, Uint8 r, Uint8 g, Uint8 b, Uint8 a) { /* * Draw */ return (vlineColor(dst, x, y1, y2, ((Uint32) r << 24) | ((Uint32) g << 16) | ((Uint32) b << 8) | (Uint32) a)); } /*! \brief Draw rectangle with blending. \param dst The surface to draw on. \param x1 X coordinate of the first point (i.e. top right) of the rectangle. \param y1 Y coordinate of the first point (i.e. top right) of the rectangle. \param x2 X coordinate of the second point (i.e. bottom left) of the rectangle. \param y2 Y coordinate of the second point (i.e. bottom left) of the rectangle. \param color The color value of the rectangle to draw (0xRRGGBBAA). \returns Returns 0 on success, -1 on failure. */ int rectangleColor(SDL_Surface * dst, Sint16 x1, Sint16 y1, Sint16 x2, Sint16 y2, Uint32 color) { int result; Sint16 tmp; /* Check destination surface */ if (dst == NULL) { return -1; } /* * Check visibility of clipping rectangle */ if ((dst->clip_rect.w==0) || (dst->clip_rect.h==0)) { return 0; } /* * Test for special cases of straight lines or single point */ if (x1 == x2) { if (y1 == y2) { return (pixelColor(dst, x1, y1, color)); } else { return (vlineColor(dst, x1, y1, y2, color)); } } else { if (y1 == y2) { return (hlineColor(dst, x1, x2, y1, color)); } } /* * Swap x1, x2 if required */ if (x1 > x2) { tmp = x1; x1 = x2; x2 = tmp; } /* * Swap y1, y2 if required */ if (y1 > y2) { tmp = y1; y1 = y2; y2 = tmp; } /* * Draw rectangle */ result = 0; result |= hlineColor(dst, x1, x2, y1, color); result |= hlineColor(dst, x1, x2, y2, color); y1 += 1; y2 -= 1; if (y1 <= y2) { result |= vlineColor(dst, x1, y1, y2, color); result |= vlineColor(dst, x2, y1, y2, color); } return (result); } /*! \brief Draw rectangle with blending. \param dst The surface to draw on. \param x1 X coordinate of the first point (i.e. top right) of the rectangle. \param y1 Y coordinate of the first point (i.e. top right) of the rectangle. \param x2 X coordinate of the second point (i.e. bottom left) of the rectangle. \param y2 Y coordinate of the second point (i.e. bottom left) of the rectangle. \param r The red value of the rectangle to draw. \param g The green value of the rectangle to draw. \param b The blue value of the rectangle to draw. \param a The alpha value of the rectangle to draw. \returns Returns 0 on success, -1 on failure. */ int rectangleRGBA(SDL_Surface * dst, Sint16 x1, Sint16 y1, Sint16 x2, Sint16 y2, Uint8 r, Uint8 g, Uint8 b, Uint8 a) { /* * Draw */ return (rectangleColor (dst, x1, y1, x2, y2, ((Uint32) r << 24) | ((Uint32) g << 16) | ((Uint32) b << 8) | (Uint32) a)); } /*! \brief Draw rounded-corner rectangle with blending. \param dst The surface to draw on. \param x1 X coordinate of the first point (i.e. top right) of the rectangle. \param y1 Y coordinate of the first point (i.e. top right) of the rectangle. \param x2 X coordinate of the second point (i.e. bottom left) of the rectangle. \param y2 Y coordinate of the second point (i.e. bottom left) of the rectangle. \param rad The radius of the corner arc. \param color The color value of the rectangle to draw (0xRRGGBBAA). \returns Returns 0 on success, -1 on failure. */ int roundedRectangleColor(SDL_Surface * dst, Sint16 x1, Sint16 y1, Sint16 x2, Sint16 y2, Sint16 rad, Uint32 color) { int result; Sint16 w, h, tmp; Sint16 xx1, xx2, yy1, yy2; /* * Check destination surface */ if (dst == NULL) { return -1; } /* * Check radius vor valid range */ if (rad < 0) { return -1; } /* * Special case - no rounding */ if (rad == 0) { return rectangleColor(dst, x1, y1, x2, y2, color); } /* * Check visibility of clipping rectangle */ if ((dst->clip_rect.w==0) || (dst->clip_rect.h==0)) { return 0; } /* * Test for special cases of straight lines or single point */ if (x1 == x2) { if (y1 == y2) { return (pixelColor(dst, x1, y1, color)); } else { return (vlineColor(dst, x1, y1, y2, color)); } } else { if (y1 == y2) { return (hlineColor(dst, x1, x2, y1, color)); } } /* * Swap x1, x2 if required */ if (x1 > x2) { tmp = x1; x1 = x2; x2 = tmp; } /* * Swap y1, y2 if required */ if (y1 > y2) { tmp = y1; y1 = y2; y2 = tmp; } /* * Calculate width&height */ w = x2 - x1; h = y2 - y1; /* * Maybe adjust radius */ if ((rad * 2) > w) { rad = w / 2; } if ((rad * 2) > h) { rad = h / 2; } /* * Draw corners */ result = 0; xx1 = x1 + rad; xx2 = x2 - rad; yy1 = y1 + rad; yy2 = y2 - rad; result |= arcColor(dst, xx1, yy1, rad, 180, 270, color); result |= arcColor(dst, xx2, yy1, rad, 270, 360, color); result |= arcColor(dst, xx1, yy2, rad, 90, 180, color); result |= arcColor(dst, xx2, yy2, rad, 0, 90, color); /* * Draw lines */ if (xx1 <= xx2) { result |= hlineColor(dst, xx1, xx2, y1, color); result |= hlineColor(dst, xx1, xx2, y2, color); } if (yy1 <= yy2) { result |= vlineColor(dst, x1, yy1, yy2, color); result |= vlineColor(dst, x2, yy1, yy2, color); } return result; } /*! \brief Draw rounded-corner rectangle with blending. \param dst The surface to draw on. \param x1 X coordinate of the first point (i.e. top right) of the rectangle. \param y1 Y coordinate of the first point (i.e. top right) of the rectangle. \param x2 X coordinate of the second point (i.e. bottom left) of the rectangle. \param y2 Y coordinate of the second point (i.e. bottom left) of the rectangle. \param rad The radius of the corner arc. \param r The red value of the rectangle to draw. \param g The green value of the rectangle to draw. \param b The blue value of the rectangle to draw. \param a The alpha value of the rectangle to draw. \returns Returns 0 on success, -1 on failure. */ int roundedRectangleRGBA(SDL_Surface * dst, Sint16 x1, Sint16 y1, Sint16 x2, Sint16 y2, Sint16 rad, Uint8 r, Uint8 g, Uint8 b, Uint8 a) { /* * Draw */ return (roundedRectangleColor (dst, x1, y1, x2, y2, rad, ((Uint32) r << 24) | ((Uint32) g << 16) | ((Uint32) b << 8) | (Uint32) a)); } /*! \brief Draw rounded-corner box (filled rectangle) with blending. \param dst The surface to draw on. \param x1 X coordinate of the first point (i.e. top right) of the box. \param y1 Y coordinate of the first point (i.e. top right) of the box. \param x2 X coordinate of the second point (i.e. bottom left) of the box. \param y2 Y coordinate of the second point (i.e. bottom left) of the box. \param rad The radius of the corner arcs of the box. \param color The color value of the box to draw (0xRRGGBBAA). \returns Returns 0 on success, -1 on failure. */ int roundedBoxColor(SDL_Surface * dst, Sint16 x1, Sint16 y1, Sint16 x2, Sint16 y2, Sint16 rad, Uint32 color) { int result; Sint16 w, h, tmp; Sint16 xx1, xx2, yy1, yy2; /* * Check destination surface */ if (dst == NULL) { return -1; } /* * Check radius vor valid range */ if (rad < 0) { return -1; } /* * Special case - no rounding */ if (rad == 0) { return rectangleColor(dst, x1, y1, x2, y2, color); } /* * Check visibility of clipping rectangle */ if ((dst->clip_rect.w==0) || (dst->clip_rect.h==0)) { return 0; } /* * Test for special cases of straight lines or single point */ if (x1 == x2) { if (y1 == y2) { return (pixelColor(dst, x1, y1, color)); } else { return (vlineColor(dst, x1, y1, y2, color)); } } else { if (y1 == y2) { return (hlineColor(dst, x1, x2, y1, color)); } } /* * Swap x1, x2 if required */ if (x1 > x2) { tmp = x1; x1 = x2; x2 = tmp; } /* * Swap y1, y2 if required */ if (y1 > y2) { tmp = y1; y1 = y2; y2 = tmp; } /* * Calculate width&height */ w = x2 - x1; h = y2 - y1; /* * Maybe adjust radius */ if ((rad * 2) > w) { rad = w / 2; } if ((rad * 2) > h) { rad = h / 2; } /* * Draw corners */ result = 0; xx1 = x1 + rad; xx2 = x2 - rad; yy1 = y1 + rad; yy2 = y2 - rad; result |= filledPieColor(dst, xx1, yy1, rad, 180, 270, color); result |= filledPieColor(dst, xx2, yy1, rad, 270, 360, color); result |= filledPieColor(dst, xx1, yy2, rad, 90, 180, color); result |= filledPieColor(dst, xx2, yy2, rad, 0, 90, color); /* * Draw body */ xx1++; xx2--; yy1++; yy2--; if (xx1 <= xx2) { result |= boxColor(dst, xx1, y1, xx2, y2, color); } if (yy1 <= yy2) { result |= boxColor(dst, x1, yy1, xx1-1, yy2, color); result |= boxColor(dst, xx2+1, yy1, x2, yy2, color); } return result; } /*! \brief Draw rounded-corner box (filled rectangle) with blending. \param dst The surface to draw on. \param x1 X coordinate of the first point (i.e. top right) of the box. \param y1 Y coordinate of the first point (i.e. top right) of the box. \param x2 X coordinate of the second point (i.e. bottom left) of the box. \param y2 Y coordinate of the second point (i.e. bottom left) of the box. \param rad The radius of the corner arcs of the box. \param r The red value of the box to draw. \param g The green value of the box to draw. \param b The blue value of the box to draw. \param a The alpha value of the box to draw. \returns Returns 0 on success, -1 on failure. */ int roundedBoxRGBA(SDL_Surface * dst, Sint16 x1, Sint16 y1, Sint16 x2, Sint16 y2, Sint16 rad, Uint8 r, Uint8 g, Uint8 b, Uint8 a) { /* * Draw */ return (roundedBoxColor (dst, x1, y1, x2, y2, rad, ((Uint32) r << 24) | ((Uint32) g << 16) | ((Uint32) b << 8) | (Uint32) a)); } /* --------- Clipping routines for line */ /* Clipping based heavily on code from */ /* http://www.ncsa.uiuc.edu/Vis/Graphics/src/clipCohSuth.c */ #define CLIP_LEFT_EDGE 0x1 #define CLIP_RIGHT_EDGE 0x2 #define CLIP_BOTTOM_EDGE 0x4 #define CLIP_TOP_EDGE 0x8 #define CLIP_INSIDE(a) (!a) #define CLIP_REJECT(a,b) (a&b) #define CLIP_ACCEPT(a,b) (!(a|b)) /*! \brief Internal clip-encoding routine. Calculates a segement-based clipping encoding for a point against a rectangle. \param x X coordinate of point. \param y Y coordinate of point. \param left X coordinate of left edge of the rectangle. \param top Y coordinate of top edge of the rectangle. \param right X coordinate of right edge of the rectangle. \param bottom Y coordinate of bottom edge of the rectangle. */ static int _clipEncode(Sint16 x, Sint16 y, Sint16 left, Sint16 top, Sint16 right, Sint16 bottom) { int code = 0; if (x < left) { code |= CLIP_LEFT_EDGE; } else if (x > right) { code |= CLIP_RIGHT_EDGE; } if (y < top) { code |= CLIP_TOP_EDGE; } else if (y > bottom) { code |= CLIP_BOTTOM_EDGE; } return code; } /*! \brief Clip line to a the clipping rectangle of a surface. \param dst Target surface to draw on. \param x1 Pointer to X coordinate of first point of line. \param y1 Pointer to Y coordinate of first point of line. \param x2 Pointer to X coordinate of second point of line. \param y2 Pointer to Y coordinate of second point of line. */ static int _clipLine(SDL_Surface * dst, Sint16 * x1, Sint16 * y1, Sint16 * x2, Sint16 * y2) { Sint16 left, right, top, bottom; int code1, code2; int draw = 0; Sint16 swaptmp; float m; /* * Get clipping boundary */ left = dst->clip_rect.x; right = dst->clip_rect.x + dst->clip_rect.w - 1; top = dst->clip_rect.y; bottom = dst->clip_rect.y + dst->clip_rect.h - 1; while (1) { code1 = _clipEncode(*x1, *y1, left, top, right, bottom); code2 = _clipEncode(*x2, *y2, left, top, right, bottom); if (CLIP_ACCEPT(code1, code2)) { draw = 1; break; } else if (CLIP_REJECT(code1, code2)) break; else { if (CLIP_INSIDE(code1)) { swaptmp = *x2; *x2 = *x1; *x1 = swaptmp; swaptmp = *y2; *y2 = *y1; *y1 = swaptmp; swaptmp = code2; code2 = code1; code1 = swaptmp; } if (*x2 != *x1) { m = (float)(*y2 - *y1) / (float)(*x2 - *x1); } else { m = 1.0f; } if (code1 & CLIP_LEFT_EDGE) { *y1 += (Sint16) ((left - *x1) * m); *x1 = left; } else if (code1 & CLIP_RIGHT_EDGE) { *y1 += (Sint16) ((right - *x1) * m); *x1 = right; } else if (code1 & CLIP_BOTTOM_EDGE) { if (*x2 != *x1) { *x1 += (Sint16) ((bottom - *y1) / m); } *y1 = bottom; } else if (code1 & CLIP_TOP_EDGE) { if (*x2 != *x1) { *x1 += (Sint16) ((top - *y1) / m); } *y1 = top; } } } return draw; } /*! \brief Draw box (filled rectangle) with blending. \param dst The surface to draw on. \param x1 X coordinate of the first point (i.e. top right) of the box. \param y1 Y coordinate of the first point (i.e. top right) of the box. \param x2 X coordinate of the second point (i.e. bottom left) of the box. \param y2 Y coordinate of the second point (i.e. bottom left) of the box. \param color The color value of the box to draw (0xRRGGBBAA). \returns Returns 0 on success, -1 on failure. */ int boxColor(SDL_Surface * dst, Sint16 x1, Sint16 y1, Sint16 x2, Sint16 y2, Uint32 color) { Sint16 left, right, top, bottom; Uint8 *pixel, *pixellast; int x, dx; int dy; int pixx, pixy; Sint16 w, h, tmp; int result; Uint8 *colorptr; /* * Check visibility of clipping rectangle */ if ((dst->clip_rect.w==0) || (dst->clip_rect.h==0)) { return(0); } /* * Order coordinates to ensure that * x1<=x2 and y1<=y2 */ if (x1 > x2) { tmp = x1; x1 = x2; x2 = tmp; } if (y1 > y2) { tmp = y1; y1 = y2; y2 = tmp; } /* * Get clipping boundary and * check visibility */ left = dst->clip_rect.x; if (x2clip_rect.x + dst->clip_rect.w - 1; if (x1>right) { return(0); } top = dst->clip_rect.y; if (y2clip_rect.y + dst->clip_rect.h - 1; if (y1>bottom) { return(0); } /* Clip all points */ if (x1right) { x1=right; } if (x2right) { x2=right; } if (y1bottom) { y1=bottom; } if (y2bottom) { y2=bottom; } /* * Test for special cases of straight line or single point */ if (x1 == x2) { if (y1 == y2) { return (pixelColor(dst, x1, y1, color)); } else { return (vlineColor(dst, x1, y1, y2, color)); } } if (y1 == y2) { return (hlineColor(dst, x1, x2, y1, color)); } /* * Calculate width&height */ w = x2 - x1; h = y2 - y1; /* * Alpha check */ if ((color & 255) == 255) { /* * No alpha-blending required */ /* * Setup color */ colorptr = (Uint8 *) & color; if (SDL_BYTEORDER == SDL_BIG_ENDIAN) { color = SDL_MapRGBA(dst->format, colorptr[0], colorptr[1], colorptr[2], colorptr[3]); } else { color = SDL_MapRGBA(dst->format, colorptr[3], colorptr[2], colorptr[1], colorptr[0]); } /* * Lock the surface */ if (SDL_MUSTLOCK(dst)) { if (SDL_LockSurface(dst) < 0) { return (-1); } } /* * More variable setup */ dx = w; dy = h; pixx = dst->format->BytesPerPixel; pixy = dst->pitch; pixel = ((Uint8 *) dst->pixels) + pixx * (int) x1 + pixy * (int) y1; pixellast = pixel + pixx * dx + pixy * dy; dx++; /* * Draw */ switch (dst->format->BytesPerPixel) { case 1: for (; pixel <= pixellast; pixel += pixy) { memset(pixel, (Uint8) color, dx); } break; case 2: pixy -= (pixx * dx); for (; pixel <= pixellast; pixel += pixy) { for (x = 0; x < dx; x++) { *(Uint16*) pixel = color; pixel += pixx; } } break; case 3: pixy -= (pixx * dx); for (; pixel <= pixellast; pixel += pixy) { for (x = 0; x < dx; x++) { if (SDL_BYTEORDER == SDL_BIG_ENDIAN) { pixel[0] = (color >> 16) & 0xff; pixel[1] = (color >> 8) & 0xff; pixel[2] = color & 0xff; } else { pixel[0] = color & 0xff; pixel[1] = (color >> 8) & 0xff; pixel[2] = (color >> 16) & 0xff; } pixel += pixx; } } break; default: /* case 4 */ pixy -= (pixx * dx); for (; pixel <= pixellast; pixel += pixy) { for (x = 0; x < dx; x++) { *(Uint32 *) pixel = color; pixel += pixx; } } break; } /* Unlock surface */ if (SDL_MUSTLOCK(dst)) { SDL_UnlockSurface(dst); } result = 0; } else { result = filledRectAlpha(dst, x1, y1, x1 + w, y1 + h, color); } return (result); } /*! \brief Draw box (filled rectangle) with blending. \param dst The surface to draw on. \param x1 X coordinate of the first point (i.e. top right) of the box. \param y1 Y coordinate of the first point (i.e. top right) of the box. \param x2 X coordinate of the second point (i.e. bottom left) of the box. \param y2 Y coordinate of the second point (i.e. bottom left) of the box. \param r The red value of the box to draw. \param g The green value of the box to draw. \param b The blue value of the box to draw. \param a The alpha value of the box to draw. \returns Returns 0 on success, -1 on failure. */ int boxRGBA(SDL_Surface * dst, Sint16 x1, Sint16 y1, Sint16 x2, Sint16 y2, Uint8 r, Uint8 g, Uint8 b, Uint8 a) { /* * Draw */ return (boxColor(dst, x1, y1, x2, y2, ((Uint32) r << 24) | ((Uint32) g << 16) | ((Uint32) b << 8) | (Uint32) a)); } /* ----- Line */ /* Non-alpha line drawing code adapted from routine */ /* by Pete Shinners, pete@shinners.org */ /* Originally from pygame, http://pygame.seul.org */ #define ABS(a) (((a)<0) ? -(a) : (a)) /*! \brief Draw line with alpha blending. \param dst The surface to draw on. \param x1 X coordinate of the first point of the line. \param y1 Y coordinate of the first point of the line. \param x2 X coordinate of the second point of the line. \param y2 Y coordinate of the second point of the line. \param color The color value of the line to draw (0xRRGGBBAA). \returns Returns 0 on success, -1 on failure. */ int lineColor(SDL_Surface * dst, Sint16 x1, Sint16 y1, Sint16 x2, Sint16 y2, Uint32 color) { int pixx, pixy; int x, y; int dx, dy; int ax, ay; int sx, sy; int swaptmp; Uint8 *pixel; Uint8 *colorptr; /* * Clip line and test if we have to draw */ if (!(_clipLine(dst, &x1, &y1, &x2, &y2))) { return (0); } /* * Test for special cases of straight lines or single point */ if (x1 == x2) { if (y1 < y2) { return (vlineColor(dst, x1, y1, y2, color)); } else if (y1 > y2) { return (vlineColor(dst, x1, y2, y1, color)); } else { return (pixelColor(dst, x1, y1, color)); } } if (y1 == y2) { if (x1 < x2) { return (hlineColor(dst, x1, x2, y1, color)); } else if (x1 > x2) { return (hlineColor(dst, x2, x1, y1, color)); } } /* * Variable setup */ dx = x2 - x1; dy = y2 - y1; sx = (dx >= 0) ? 1 : -1; sy = (dy >= 0) ? 1 : -1; /* Lock surface */ if (SDL_MUSTLOCK(dst)) { if (SDL_LockSurface(dst) < 0) { return (-1); } } /* * Check for alpha blending */ if ((color & 255) == 255) { /* * No alpha blending - use fast pixel routines */ /* * Setup color */ colorptr = (Uint8 *) & color; if (SDL_BYTEORDER == SDL_BIG_ENDIAN) { color = SDL_MapRGBA(dst->format, colorptr[0], colorptr[1], colorptr[2], colorptr[3]); } else { color = SDL_MapRGBA(dst->format, colorptr[3], colorptr[2], colorptr[1], colorptr[0]); } /* * More variable setup */ dx = sx * dx + 1; dy = sy * dy + 1; pixx = dst->format->BytesPerPixel; pixy = dst->pitch; pixel = ((Uint8 *) dst->pixels) + pixx * (int) x1 + pixy * (int) y1; pixx *= sx; pixy *= sy; if (dx < dy) { swaptmp = dx; dx = dy; dy = swaptmp; swaptmp = pixx; pixx = pixy; pixy = swaptmp; } /* * Draw */ x = 0; y = 0; switch (dst->format->BytesPerPixel) { case 1: for (; x < dx; x++, pixel += pixx) { *pixel = color; y += dy; if (y >= dx) { y -= dx; pixel += pixy; } } break; case 2: for (; x < dx; x++, pixel += pixx) { *(Uint16 *) pixel = color; y += dy; if (y >= dx) { y -= dx; pixel += pixy; } } break; case 3: for (; x < dx; x++, pixel += pixx) { if (SDL_BYTEORDER == SDL_BIG_ENDIAN) { pixel[0] = (color >> 16) & 0xff; pixel[1] = (color >> 8) & 0xff; pixel[2] = color & 0xff; } else { pixel[0] = color & 0xff; pixel[1] = (color >> 8) & 0xff; pixel[2] = (color >> 16) & 0xff; } y += dy; if (y >= dx) { y -= dx; pixel += pixy; } } break; default: /* case 4 */ for (; x < dx; x++, pixel += pixx) { *(Uint32 *) pixel = color; y += dy; if (y >= dx) { y -= dx; pixel += pixy; } } break; } } else { /* * Alpha blending required - use single-pixel blits */ ax = ABS(dx) << 1; ay = ABS(dy) << 1; x = x1; y = y1; if (ax > ay) { int d = ay - (ax >> 1); while (x != x2) { pixelColorNolock (dst, x, y, color); if (d > 0 || (d == 0 && sx == 1)) { y += sy; d -= ax; } x += sx; d += ay; } } else { int d = ax - (ay >> 1); while (y != y2) { pixelColorNolock (dst, x, y, color); if (d > 0 || ((d == 0) && (sy == 1))) { x += sx; d -= ay; } y += sy; d += ax; } } pixelColorNolock (dst, x, y, color); } /* Unlock surface */ if (SDL_MUSTLOCK(dst)) { SDL_UnlockSurface(dst); } return (0); } /*! \brief Draw line with alpha blending. \param dst The surface to draw on. \param x1 X coordinate of the first point of the line. \param y1 Y coordinate of the first point of the line. \param x2 X coordinate of the second point of the line. \param y2 Y coordinate of the second point of the line. \param r The red value of the line to draw. \param g The green value of the line to draw. \param b The blue value of the line to draw. \param a The alpha value of the line to draw. \returns Returns 0 on success, -1 on failure. */ int lineRGBA(SDL_Surface * dst, Sint16 x1, Sint16 y1, Sint16 x2, Sint16 y2, Uint8 r, Uint8 g, Uint8 b, Uint8 a) { /* * Draw */ return (lineColor(dst, x1, y1, x2, y2, ((Uint32) r << 24) | ((Uint32) g << 16) | ((Uint32) b << 8) | (Uint32) a)); } /* AA Line */ #define AAlevels 256 #define AAbits 8 /*! \brief Internal function to draw anti-aliased line with alpha blending and endpoint control. This implementation of the Wu antialiasing code is based on Mike Abrash's DDJ article which was reprinted as Chapter 42 of his Graphics Programming Black Book, but has been optimized to work with SDL and utilizes 32-bit fixed-point arithmetic by A. Schiffler. The endpoint control allows the supression to draw the last pixel useful for rendering continous aa-lines with alpha<255. \param dst The surface to draw on. \param x1 X coordinate of the first point of the aa-line. \param y1 Y coordinate of the first point of the aa-line. \param x2 X coordinate of the second point of the aa-line. \param y2 Y coordinate of the second point of the aa-line. \param color The color value of the aa-line to draw (0xRRGGBBAA). \param draw_endpoint Flag indicating if the endpoint should be drawn; draw if non-zero. \returns Returns 0 on success, -1 on failure. */ int _aalineColor(SDL_Surface * dst, Sint16 x1, Sint16 y1, Sint16 x2, Sint16 y2, Uint32 color, int draw_endpoint) { Sint32 xx0, yy0, xx1, yy1; int result; Uint32 intshift, erracc, erradj; Uint32 erracctmp, wgt, wgtcompmask; int dx, dy, tmp, xdir, y0p1, x0pxdir; /* * Check visibility of clipping rectangle */ if ((dst->clip_rect.w==0) || (dst->clip_rect.h==0)) { return(0); } /* * Clip line and test if we have to draw */ if (!(_clipLine(dst, &x1, &y1, &x2, &y2))) { return (0); } /* * Keep on working with 32bit numbers */ xx0 = x1; yy0 = y1; xx1 = x2; yy1 = y2; /* * Reorder points if required */ if (yy0 > yy1) { tmp = yy0; yy0 = yy1; yy1 = tmp; tmp = xx0; xx0 = xx1; xx1 = tmp; } /* * Calculate distance */ dx = xx1 - xx0; dy = yy1 - yy0; /* * Check for special cases */ if (dx == 0) { /* * Vertical line */ if (draw_endpoint) { return (vlineColor(dst, x1, y1, y2, color)); } else { if (dy>0) { return (vlineColor(dst, x1, yy0, yy0+dy, color)); } else { return (pixelColor(dst, x1, y1, color)); } } } else if (dy == 0) { /* * Horizontal line */ if (draw_endpoint) { return (hlineColor(dst, x1, x2, y1, color)); } else { if (dx>0) { return (hlineColor(dst, xx0, xx0+dx, y1, color)); } else { return (pixelColor(dst, x1, y1, color)); } } } else if ((dx == dy) && (draw_endpoint)) { /* * Diagonal line (with endpoint) */ return (lineColor(dst, x1, y1, x2, y2, color)); } /* * Adjust for negative dx and set xdir */ if (dx >= 0) { xdir = 1; } else { xdir = -1; dx = (-dx); } /* * Line is not horizontal, vertical or diagonal (with endpoint) */ result = 0; /* * Zero accumulator */ erracc = 0; /* * # of bits by which to shift erracc to get intensity level */ intshift = 32 - AAbits; /* * Mask used to flip all bits in an intensity weighting */ wgtcompmask = AAlevels - 1; /* Lock surface */ if (SDL_MUSTLOCK(dst)) { if (SDL_LockSurface(dst) < 0) { return (-1); } } /* * Draw the initial pixel in the foreground color */ result |= pixelColorNolock(dst, x1, y1, color); /* * x-major or y-major? */ if (dy > dx) { /* * y-major. Calculate 16-bit fixed point fractional part of a pixel that * X advances every time Y advances 1 pixel, truncating the result so that * we won't overrun the endpoint along the X axis */ /* * Not-so-portable version: erradj = ((Uint64)dx << 32) / (Uint64)dy; */ erradj = ((dx << 16) / dy) << 16; /* * draw all pixels other than the first and last */ x0pxdir = xx0 + xdir; while (--dy) { erracctmp = erracc; erracc += erradj; if (erracc <= erracctmp) { /* * rollover in error accumulator, x coord advances */ xx0 = x0pxdir; x0pxdir += xdir; } yy0++; /* y-major so always advance Y */ /* * the AAbits most significant bits of erracc give us the intensity * weighting for this pixel, and the complement of the weighting for * the paired pixel. */ wgt = (erracc >> intshift) & 255; result |= pixelColorWeightNolock (dst, xx0, yy0, color, 255 - wgt); result |= pixelColorWeightNolock (dst, x0pxdir, yy0, color, wgt); } } else { /* * x-major line. Calculate 16-bit fixed-point fractional part of a pixel * that Y advances each time X advances 1 pixel, truncating the result so * that we won't overrun the endpoint along the X axis. */ /* * Not-so-portable version: erradj = ((Uint64)dy << 32) / (Uint64)dx; */ erradj = ((dy << 16) / dx) << 16; /* * draw all pixels other than the first and last */ y0p1 = yy0 + 1; while (--dx) { erracctmp = erracc; erracc += erradj; if (erracc <= erracctmp) { /* * Accumulator turned over, advance y */ yy0 = y0p1; y0p1++; } xx0 += xdir; /* x-major so always advance X */ /* * the AAbits most significant bits of erracc give us the intensity * weighting for this pixel, and the complement of the weighting for * the paired pixel. */ wgt = (erracc >> intshift) & 255; result |= pixelColorWeightNolock (dst, xx0, yy0, color, 255 - wgt); result |= pixelColorWeightNolock (dst, xx0, y0p1, color, wgt); } } /* * Do we have to draw the endpoint */ if (draw_endpoint) { /* * Draw final pixel, always exactly intersected by the line and doesn't * need to be weighted. */ result |= pixelColorNolock (dst, x2, y2, color); } /* Unlock surface */ if (SDL_MUSTLOCK(dst)) { SDL_UnlockSurface(dst); } return (result); } /*! \brief Ddraw anti-aliased line with alpha blending. \param dst The surface to draw on. \param x1 X coordinate of the first point of the aa-line. \param y1 Y coordinate of the first point of the aa-line. \param x2 X coordinate of the second point of the aa-line. \param y2 Y coordinate of the second point of the aa-line. \param color The color value of the aa-line to draw (0xRRGGBBAA). \returns Returns 0 on success, -1 on failure. */ int aalineColor(SDL_Surface * dst, Sint16 x1, Sint16 y1, Sint16 x2, Sint16 y2, Uint32 color) { return (_aalineColor(dst, x1, y1, x2, y2, color, 1)); } /*! \brief Draw anti-aliased line with alpha blending. \param dst The surface to draw on. \param x1 X coordinate of the first point of the aa-line. \param y1 Y coordinate of the first point of the aa-line. \param x2 X coordinate of the second point of the aa-line. \param y2 Y coordinate of the second point of the aa-line. \param r The red value of the aa-line to draw. \param g The green value of the aa-line to draw. \param b The blue value of the aa-line to draw. \param a The alpha value of the aa-line to draw. \returns Returns 0 on success, -1 on failure. */ int aalineRGBA(SDL_Surface * dst, Sint16 x1, Sint16 y1, Sint16 x2, Sint16 y2, Uint8 r, Uint8 g, Uint8 b, Uint8 a) { return (_aalineColor (dst, x1, y1, x2, y2, ((Uint32) r << 24) | ((Uint32) g << 16) | ((Uint32) b << 8) | (Uint32) a, 1)); } /* ----- Circle */ /*! \brief Draw circle with blending. Note: Circle drawing routine is based on an algorithms from the sge library, but modified by A. Schiffler for multiple pixel-draw removal and other minor speedup changes. \param dst The surface to draw on. \param x X coordinate of the center of the circle. \param y Y coordinate of the center of the circle. \param rad Radius in pixels of the circle. \param color The color value of the circle to draw (0xRRGGBBAA). \returns Returns 0 on success, -1 on failure. */ int circleColor(SDL_Surface * dst, Sint16 x, Sint16 y, Sint16 rad, Uint32 color) { Sint16 left, right, top, bottom; int result; Sint16 x1, y1, x2, y2; Sint16 cx = 0; Sint16 cy = rad; Sint16 df = 1 - rad; Sint16 d_e = 3; Sint16 d_se = -2 * rad + 5; Sint16 xpcx, xmcx, xpcy, xmcy; Sint16 ypcy, ymcy, ypcx, ymcx; Uint8 *colorptr; /* * Check visibility of clipping rectangle */ if ((dst->clip_rect.w==0) || (dst->clip_rect.h==0)) { return(0); } /* * Sanity check radius */ if (rad < 0) { return (-1); } /* * Special case for rad=0 - draw a point */ if (rad == 0) { return (pixelColor(dst, x, y, color)); } /* * Get circle and clipping boundary and * test if bounding box of circle is visible */ x2 = x + rad; left = dst->clip_rect.x; if (x2clip_rect.x + dst->clip_rect.w - 1; if (x1>right) { return(0); } y2 = y + rad; top = dst->clip_rect.y; if (y2clip_rect.y + dst->clip_rect.h - 1; if (y1>bottom) { return(0); } /* * Draw circle */ result = 0; /* Lock surface */ if (SDL_MUSTLOCK(dst)) { if (SDL_LockSurface(dst) < 0) { return (-1); } } /* * Alpha Check */ if ((color & 255) == 255) { /* * No Alpha - direct memory writes */ /* * Setup color */ colorptr = (Uint8 *) & color; if (SDL_BYTEORDER == SDL_BIG_ENDIAN) { color = SDL_MapRGBA(dst->format, colorptr[0], colorptr[1], colorptr[2], colorptr[3]); } else { color = SDL_MapRGBA(dst->format, colorptr[3], colorptr[2], colorptr[1], colorptr[0]); } /* * Draw */ do { ypcy = y + cy; ymcy = y - cy; if (cx > 0) { xpcx = x + cx; xmcx = x - cx; result |= fastPixelColorNolock(dst, xmcx, ypcy, color); result |= fastPixelColorNolock(dst, xpcx, ypcy, color); result |= fastPixelColorNolock(dst, xmcx, ymcy, color); result |= fastPixelColorNolock(dst, xpcx, ymcy, color); } else { result |= fastPixelColorNolock(dst, x, ymcy, color); result |= fastPixelColorNolock(dst, x, ypcy, color); } xpcy = x + cy; xmcy = x - cy; if ((cx > 0) && (cx != cy)) { ypcx = y + cx; ymcx = y - cx; result |= fastPixelColorNolock(dst, xmcy, ypcx, color); result |= fastPixelColorNolock(dst, xpcy, ypcx, color); result |= fastPixelColorNolock(dst, xmcy, ymcx, color); result |= fastPixelColorNolock(dst, xpcy, ymcx, color); } else if (cx == 0) { result |= fastPixelColorNolock(dst, xmcy, y, color); result |= fastPixelColorNolock(dst, xpcy, y, color); } /* * Update */ if (df < 0) { df += d_e; d_e += 2; d_se += 2; } else { df += d_se; d_e += 2; d_se += 4; cy--; } cx++; } while (cx <= cy); /* * Unlock surface */ SDL_UnlockSurface(dst); } else { /* * Using Alpha - blended pixel blits */ do { /* * Draw */ ypcy = y + cy; ymcy = y - cy; if (cx > 0) { xpcx = x + cx; xmcx = x - cx; result |= pixelColorNolock (dst, xmcx, ypcy, color); result |= pixelColorNolock (dst, xpcx, ypcy, color); result |= pixelColorNolock (dst, xmcx, ymcy, color); result |= pixelColorNolock (dst, xpcx, ymcy, color); } else { result |= pixelColorNolock (dst, x, ymcy, color); result |= pixelColorNolock (dst, x, ypcy, color); } xpcy = x + cy; xmcy = x - cy; if ((cx > 0) && (cx != cy)) { ypcx = y + cx; ymcx = y - cx; result |= pixelColorNolock (dst, xmcy, ypcx, color); result |= pixelColorNolock (dst, xpcy, ypcx, color); result |= pixelColorNolock (dst, xmcy, ymcx, color); result |= pixelColorNolock (dst, xpcy, ymcx, color); } else if (cx == 0) { result |= pixelColorNolock (dst, xmcy, y, color); result |= pixelColorNolock (dst, xpcy, y, color); } /* * Update */ if (df < 0) { df += d_e; d_e += 2; d_se += 2; } else { df += d_se; d_e += 2; d_se += 4; cy--; } cx++; } while (cx <= cy); } /* Alpha check */ /* Unlock surface */ if (SDL_MUSTLOCK(dst)) { SDL_UnlockSurface(dst); } return (result); } /*! \brief Draw circle with blending. \param dst The surface to draw on. \param x X coordinate of the center of the circle. \param y Y coordinate of the center of the circle. \param rad Radius in pixels of the circle. \param r The red value of the circle to draw. \param g The green value of the circle to draw. \param b The blue value of the circle to draw. \param a The alpha value of the circle to draw. \returns Returns 0 on success, -1 on failure. */ int circleRGBA(SDL_Surface * dst, Sint16 x, Sint16 y, Sint16 rad, Uint8 r, Uint8 g, Uint8 b, Uint8 a) { /* * Draw */ return (circleColor(dst, x, y, rad, ((Uint32) r << 24) | ((Uint32) g << 16) | ((Uint32) b << 8) | (Uint32) a)); } /* ----- Arc */ /*! \brief Arc with blending. Note Arc drawing is based on circle algorithm by A. Schiffler and written by D. Raber. Calculates which octants arc goes through and renders pixels accordingly. \param dst The surface to draw on. \param x X coordinate of the center of the arc. \param y Y coordinate of the center of the arc. \param rad Radius in pixels of the arc. \param start Starting radius in degrees of the arc. 0 degrees is down, increasing counterclockwise. \param end Ending radius in degrees of the arc. 0 degrees is down, increasing counterclockwise. \param color The color value of the arc to draw (0xRRGGBBAA). \returns Returns 0 on success, -1 on failure. */ int arcColor(SDL_Surface * dst, Sint16 x, Sint16 y, Sint16 rad, Sint16 start, Sint16 end, Uint32 color) { Sint16 left, right, top, bottom; int result; Sint16 x1, y1, x2, y2; Sint16 cx = 0; Sint16 cy = rad; Sint16 df = 1 - rad; Sint16 d_e = 3; Sint16 d_se = -2 * rad + 5; Sint16 xpcx, xmcx, xpcy, xmcy; Sint16 ypcy, ymcy, ypcx, ymcx; Uint8 *colorptr; Uint8 drawoct; int startoct, endoct, oct, stopval_start = 0, stopval_end = 0; double dstart, dend, temp = 0.; /* * Check visibility of clipping rectangle */ if ((dst->clip_rect.w==0) || (dst->clip_rect.h==0)) { return(0); } /* * Sanity check radius */ if (rad < 0) { return (-1); } /* * Special case for rad=0 - draw a point */ if (rad == 0) { return (pixelColor(dst, x, y, color)); } /* * Get arc's circle and clipping boundary and * test if bounding box of circle is visible */ x2 = x + rad; left = dst->clip_rect.x; if (x2clip_rect.x + dst->clip_rect.w - 1; if (x1>right) { return(0); } y2 = y + rad; top = dst->clip_rect.y; if (y2clip_rect.y + dst->clip_rect.h - 1; if (y1>bottom) { return(0); } // Octant labelling // // \ 5 | 6 / // \ | / // 4 \ | / 7 // \|/ //------+------ +x // /|\ // 3 / | \ 0 // / | \ // / 2 | 1 \ // +y // Initially reset bitmask to 0x00000000 // the set whether or not to keep drawing a given octant. // For example: 0x00111100 means we're drawing in octants 2-5 drawoct = 0; /* * Fixup angles */ start %= 360; end %= 360; // 0 <= start & end < 360; note that sometimes start > end - if so, arc goes back through 0. while (start < 0) start += 360; while (end < 0) end += 360; start %= 360; end %= 360; // now, we find which octants we're drawing in. startoct = start / 45; endoct = end / 45; oct = startoct - 1; // we increment as first step in loop // stopval_start, stopval_end; // what values of cx to stop at. do { oct = (oct + 1) % 8; if (oct == startoct) { // need to compute stopval_start for this octant. Look at picture above if this is unclear dstart = (double)start; switch (oct) { case 0: case 3: temp = sin(dstart * M_PI / 180.); break; case 1: case 6: temp = cos(dstart * M_PI / 180.); break; case 2: case 5: temp = -cos(dstart * M_PI / 180.); break; case 4: case 7: temp = -sin(dstart * M_PI / 180.); break; } temp *= rad; stopval_start = (int)temp; // always round down. // This isn't arbitrary, but requires graph paper to explain well. // The basic idea is that we're always changing drawoct after we draw, so we // stop immediately after we render the last sensible pixel at x = ((int)temp). // and whether to draw in this octant initially if (oct % 2) drawoct |= (1 << oct); // this is basically like saying drawoct[oct] = true, if drawoct were a bool array else drawoct &= 255 - (1 << oct); // this is basically like saying drawoct[oct] = false } if (oct == endoct) { // need to compute stopval_end for this octant dend = (double)end; switch (oct) { case 0: case 3: temp = sin(dend * M_PI / 180); break; case 1: case 6: temp = cos(dend * M_PI / 180); break; case 2: case 5: temp = -cos(dend * M_PI / 180); break; case 4: case 7: temp = -sin(dend * M_PI / 180); break; } temp *= rad; stopval_end = (int)temp; // and whether to draw in this octant initially if (startoct == endoct) { // note: we start drawing, stop, then start again in this case // otherwise: we only draw in this octant, so initialize it to false, it will get set back to true if (start > end) { // unfortunately, if we're in the same octant and need to draw over the whole circle, // we need to set the rest to true, because the while loop will end at the bottom. drawoct = 255; } else { drawoct &= 255 - (1 << oct); } } else if (oct % 2) drawoct &= 255 - (1 << oct); else drawoct |= (1 << oct); } else if (oct != startoct) { // already verified that it's != endoct drawoct |= (1 << oct); // draw this entire segment } } while (oct != endoct); // so now we have what octants to draw and when to draw them. all that's left is the actual raster code. /* Lock surface */ if (SDL_MUSTLOCK(dst)) { if (SDL_LockSurface(dst) < 0) { return (-1); } } /* * Draw arc */ result = 0; /* * Alpha Check */ if ((color & 255) == 255) { /* * No Alpha - direct memory writes */ /* * Setup color */ colorptr = (Uint8 *) & color; if (SDL_BYTEORDER == SDL_BIG_ENDIAN) { color = SDL_MapRGBA(dst->format, colorptr[0], colorptr[1], colorptr[2], colorptr[3]); } else { color = SDL_MapRGBA(dst->format, colorptr[3], colorptr[2], colorptr[1], colorptr[0]); } /* * Draw */ do { ypcy = y + cy; ymcy = y - cy; if (cx > 0) { xpcx = x + cx; xmcx = x - cx; // always check if we're drawing a certain octant before adding a pixel to that octant. if (drawoct & 4) result |= fastPixelColorNolock(dst, xmcx, ypcy, color); // drawoct & 4 = 22; drawoct[2] if (drawoct & 2) result |= fastPixelColorNolock(dst, xpcx, ypcy, color); if (drawoct & 32) result |= fastPixelColorNolock(dst, xmcx, ymcy, color); if (drawoct & 64) result |= fastPixelColorNolock(dst, xpcx, ymcy, color); } else { if (drawoct & 6) result |= fastPixelColorNolock(dst, x, ypcy, color); // 4 + 2; drawoct[2] || drawoct[1] if (drawoct & 96) result |= fastPixelColorNolock(dst, x, ymcy, color); // 32 + 64 } xpcy = x + cy; xmcy = x - cy; if (cx > 0 && cx != cy) { ypcx = y + cx; ymcx = y - cx; if (drawoct & 8) result |= fastPixelColorNolock(dst, xmcy, ypcx, color); if (drawoct & 1) result |= fastPixelColorNolock(dst, xpcy, ypcx, color); if (drawoct & 16) result |= fastPixelColorNolock(dst, xmcy, ymcx, color); if (drawoct & 128) result |= fastPixelColorNolock(dst, xpcy, ymcx, color); } else if (cx == 0) { if (drawoct & 24) result |= fastPixelColorNolock(dst, xmcy, y, color); // 8 + 16 if (drawoct & 129) result |= fastPixelColorNolock(dst, xpcy, y, color); // 1 + 128 } /* * Update whether we're drawing an octant */ if (stopval_start == cx) { // works like an on-off switch because start & end may be in the same octant. if (drawoct & (1 << startoct)) drawoct &= 255 - (1 << startoct); else drawoct |= (1 << startoct); } if (stopval_end == cx) { if (drawoct & (1 << endoct)) drawoct &= 255 - (1 << endoct); else drawoct |= (1 << endoct); } /* * Update pixels */ if (df < 0) { df += d_e; d_e += 2; d_se += 2; } else { df += d_se; d_e += 2; d_se += 4; cy--; } cx++; } while (cx <= cy); /* * Unlock surface */ SDL_UnlockSurface(dst); } else { /* * Using Alpha - blended pixel blits */ do { ypcy = y + cy; ymcy = y - cy; if (cx > 0) { xpcx = x + cx; xmcx = x - cx; // always check if we're drawing a certain octant before adding a pixel to that octant. if (drawoct & 4) result |= pixelColorNolock(dst, xmcx, ypcy, color); if (drawoct & 2) result |= pixelColorNolock(dst, xpcx, ypcy, color); if (drawoct & 32) result |= pixelColorNolock(dst, xmcx, ymcy, color); if (drawoct & 64) result |= pixelColorNolock(dst, xpcx, ymcy, color); } else { if (drawoct & 96) result |= pixelColorNolock(dst, x, ymcy, color); if (drawoct & 6) result |= pixelColorNolock(dst, x, ypcy, color); } xpcy = x + cy; xmcy = x - cy; if (cx > 0 && cx != cy) { ypcx = y + cx; ymcx = y - cx; if (drawoct & 8) result |= pixelColorNolock(dst, xmcy, ypcx, color); if (drawoct & 1) result |= pixelColorNolock(dst, xpcy, ypcx, color); if (drawoct & 16) result |= pixelColorNolock(dst, xmcy, ymcx, color); if (drawoct & 128) result |= pixelColorNolock(dst, xpcy, ymcx, color); } else if (cx == 0) { if (drawoct & 24) result |= pixelColorNolock(dst, xmcy, y, color); if (drawoct & 129) result |= pixelColorNolock(dst, xpcy, y, color); } /* * Update whether we're drawing an octant */ if (stopval_start == cx) { // works like an on-off switch. // This is just in case start & end are in the same octant. if (drawoct & (1 << startoct)) drawoct &= 255 - (1 << startoct); else drawoct |= (1 << startoct); } if (stopval_end == cx) { if (drawoct & (1 << endoct)) drawoct &= 255 - (1 << endoct); else drawoct |= (1 << endoct); } /* * Update pixels */ if (df < 0) { df += d_e; d_e += 2; d_se += 2; } else { df += d_se; d_e += 2; d_se += 4; cy--; } cx++; } while (cx <= cy); } /* Alpha check */ /* Unlock surface */ if (SDL_MUSTLOCK(dst)) { SDL_UnlockSurface(dst); } return (result); } /*! \brief Arc with blending. \param dst The surface to draw on. \param x X coordinate of the center of the arc. \param y Y coordinate of the center of the arc. \param rad Radius in pixels of the arc. \param start Starting radius in degrees of the arc. 0 degrees is down, increasing counterclockwise. \param end Ending radius in degrees of the arc. 0 degrees is down, increasing counterclockwise. \param r The red value of the arc to draw. \param g The green value of the arc to draw. \param b The blue value of the arc to draw. \param a The alpha value of the arc to draw. \returns Returns 0 on success, -1 on failure. */ int arcRGBA(SDL_Surface * dst, Sint16 x, Sint16 y, Sint16 rad, Sint16 start, Sint16 end, Uint8 r, Uint8 g, Uint8 b, Uint8 a) { /* * Draw */ return (arcColor(dst, x, y, rad, start, end, ((Uint32) r << 24) | ((Uint32) g << 16) | ((Uint32) b << 8) | (Uint32) a)); } /* ----- AA Circle */ /*! \brief Draw anti-aliased circle with blending. Note: The AA-circle routine is based on AA-ellipse with identical radii. \param dst The surface to draw on. \param x X coordinate of the center of the aa-circle. \param y Y coordinate of the center of the aa-circle. \param rad Radius in pixels of the aa-circle. \param color The color value of the aa-circle to draw (0xRRGGBBAA). \returns Returns 0 on success, -1 on failure. */ int aacircleColor(SDL_Surface * dst, Sint16 x, Sint16 y, Sint16 rad, Uint32 color) { return (aaellipseColor(dst, x, y, rad, rad, color)); } /*! \brief Draw anti-aliased circle with blending. \param dst The surface to draw on. \param x X coordinate of the center of the aa-circle. \param y Y coordinate of the center of the aa-circle. \param rad Radius in pixels of the aa-circle. \param r The red value of the aa-circle to draw. \param g The green value of the aa-circle to draw. \param b The blue value of the aa-circle to draw. \param a The alpha value of the aa-circle to draw. \returns Returns 0 on success, -1 on failure. */ int aacircleRGBA(SDL_Surface * dst, Sint16 x, Sint16 y, Sint16 rad, Uint8 r, Uint8 g, Uint8 b, Uint8 a) { /* * Draw */ return (aaellipseColor (dst, x, y, rad, rad, ((Uint32) r << 24) | ((Uint32) g << 16) | ((Uint32) b << 8) | (Uint32) a)); } /* ----- Filled Circle */ /*! \brief Draw filled circle with blending. Note: Based on algorithms from sge library with modifications by A. Schiffler for multiple-hline draw removal and other minor speedup changes. \param dst The surface to draw on. \param x X coordinate of the center of the filled circle. \param y Y coordinate of the center of the filled circle. \param rad Radius in pixels of the filled circle. \param color The color value of the filled circle to draw (0xRRGGBBAA). \returns Returns 0 on success, -1 on failure. */ int filledCircleColor(SDL_Surface * dst, Sint16 x, Sint16 y, Sint16 rad, Uint32 color) { Sint16 left, right, top, bottom; int result; Sint16 x1, y1, x2, y2; Sint16 cx = 0; Sint16 cy = rad; Sint16 ocx = (Sint16) 0xffff; Sint16 ocy = (Sint16) 0xffff; Sint16 df = 1 - rad; Sint16 d_e = 3; Sint16 d_se = -2 * rad + 5; Sint16 xpcx, xmcx, xpcy, xmcy; Sint16 ypcy, ymcy, ypcx, ymcx; /* * Check visibility of clipping rectangle */ if ((dst->clip_rect.w==0) || (dst->clip_rect.h==0)) { return(0); } /* * Sanity check radius */ if (rad < 0) { return (-1); } /* * Special case for rad=0 - draw a point */ if (rad == 0) { return (pixelColor(dst, x, y, color)); } /* * Get circle and clipping boundary and * test if bounding box of circle is visible */ x2 = x + rad; left = dst->clip_rect.x; if (x2clip_rect.x + dst->clip_rect.w - 1; if (x1>right) { return(0); } y2 = y + rad; top = dst->clip_rect.y; if (y2clip_rect.y + dst->clip_rect.h - 1; if (y1>bottom) { return(0); } /* * Draw */ result = 0; do { xpcx = x + cx; xmcx = x - cx; xpcy = x + cy; xmcy = x - cy; if (ocy != cy) { if (cy > 0) { ypcy = y + cy; ymcy = y - cy; result |= hlineColor(dst, xmcx, xpcx, ypcy, color); result |= hlineColor(dst, xmcx, xpcx, ymcy, color); } else { result |= hlineColor(dst, xmcx, xpcx, y, color); } ocy = cy; } if (ocx != cx) { if (cx != cy) { if (cx > 0) { ypcx = y + cx; ymcx = y - cx; result |= hlineColor(dst, xmcy, xpcy, ymcx, color); result |= hlineColor(dst, xmcy, xpcy, ypcx, color); } else { result |= hlineColor(dst, xmcy, xpcy, y, color); } } ocx = cx; } /* * Update */ if (df < 0) { df += d_e; d_e += 2; d_se += 2; } else { df += d_se; d_e += 2; d_se += 4; cy--; } cx++; } while (cx <= cy); return (result); } /*! \brief Draw filled circle with blending. \param dst The surface to draw on. \param x X coordinate of the center of the filled circle. \param y Y coordinate of the center of the filled circle. \param rad Radius in pixels of the filled circle. \param r The red value of the filled circle to draw. \param g The green value of the filled circle to draw. \param b The blue value of the filled circle to draw. \param a The alpha value of the filled circle to draw. \returns Returns 0 on success, -1 on failure. */ int filledCircleRGBA(SDL_Surface * dst, Sint16 x, Sint16 y, Sint16 rad, Uint8 r, Uint8 g, Uint8 b, Uint8 a) { /* * Draw */ return (filledCircleColor (dst, x, y, rad, ((Uint32) r << 24) | ((Uint32) g << 16) | ((Uint32) b << 8) | (Uint32) a)); } /* ----- Ellipse */ /*! \brief Draw ellipse with blending. Note: Based on algorithms from sge library with modifications by A. Schiffler for multiple-pixel draw removal and other minor speedup changes. \param dst The surface to draw on. \param x X coordinate of the center of the ellipse. \param y Y coordinate of the center of the ellipse. \param rx Horizontal radius in pixels of the ellipse. \param ry Vertical radius in pixels of the ellipse. \param color The color value of the ellipse to draw (0xRRGGBBAA). \returns Returns 0 on success, -1 on failure. */ int ellipseColor(SDL_Surface * dst, Sint16 x, Sint16 y, Sint16 rx, Sint16 ry, Uint32 color) { Sint16 left, right, top, bottom; int result; Sint16 x1, y1, x2, y2; int ix, iy; int h, i, j, k; int oh, oi, oj, ok; int xmh, xph, ypk, ymk; int xmi, xpi, ymj, ypj; int xmj, xpj, ymi, ypi; int xmk, xpk, ymh, yph; Uint8 *colorptr; /* * Check visibility of clipping rectangle */ if ((dst->clip_rect.w==0) || (dst->clip_rect.h==0)) { return(0); } /* * Sanity check radii */ if ((rx < 0) || (ry < 0)) { return (-1); } /* * Special case for rx=0 - draw a vline */ if (rx == 0) { return (vlineColor(dst, x, y - ry, y + ry, color)); } /* * Special case for ry=0 - draw a hline */ if (ry == 0) { return (hlineColor(dst, x - rx, x + rx, y, color)); } /* * Get circle and clipping boundary and * test if bounding box of circle is visible */ x2 = x + rx; left = dst->clip_rect.x; if (x2clip_rect.x + dst->clip_rect.w - 1; if (x1>right) { return(0); } y2 = y + ry; top = dst->clip_rect.y; if (y2clip_rect.y + dst->clip_rect.h - 1; if (y1>bottom) { return(0); } /* * Init vars */ oh = oi = oj = ok = 0xFFFF; /* * Draw */ result = 0; /* Lock surface */ if (SDL_MUSTLOCK(dst)) { if (SDL_LockSurface(dst) < 0) { return (-1); } } /* * Check alpha */ if ((color & 255) == 255) { /* * No Alpha - direct memory writes */ /* * Setup color */ colorptr = (Uint8 *) & color; if (SDL_BYTEORDER == SDL_BIG_ENDIAN) { color = SDL_MapRGBA(dst->format, colorptr[0], colorptr[1], colorptr[2], colorptr[3]); } else { color = SDL_MapRGBA(dst->format, colorptr[3], colorptr[2], colorptr[1], colorptr[0]); } if (rx > ry) { ix = 0; iy = rx * 64; do { h = (ix + 32) >> 6; i = (iy + 32) >> 6; j = (h * ry) / rx; k = (i * ry) / rx; if (((ok != k) && (oj != k)) || ((oj != j) && (ok != j)) || (k != j)) { xph = x + h; xmh = x - h; if (k > 0) { ypk = y + k; ymk = y - k; result |= fastPixelColorNolock(dst, xmh, ypk, color); result |= fastPixelColorNolock(dst, xph, ypk, color); result |= fastPixelColorNolock(dst, xmh, ymk, color); result |= fastPixelColorNolock(dst, xph, ymk, color); } else { result |= fastPixelColorNolock(dst, xmh, y, color); result |= fastPixelColorNolock(dst, xph, y, color); } ok = k; xpi = x + i; xmi = x - i; if (j > 0) { ypj = y + j; ymj = y - j; result |= fastPixelColorNolock(dst, xmi, ypj, color); result |= fastPixelColorNolock(dst, xpi, ypj, color); result |= fastPixelColorNolock(dst, xmi, ymj, color); result |= fastPixelColorNolock(dst, xpi, ymj, color); } else { result |= fastPixelColorNolock(dst, xmi, y, color); result |= fastPixelColorNolock(dst, xpi, y, color); } oj = j; } ix = ix + iy / rx; iy = iy - ix / rx; } while (i > h); } else { ix = 0; iy = ry * 64; do { h = (ix + 32) >> 6; i = (iy + 32) >> 6; j = (h * rx) / ry; k = (i * rx) / ry; if (((oi != i) && (oh != i)) || ((oh != h) && (oi != h) && (i != h))) { xmj = x - j; xpj = x + j; if (i > 0) { ypi = y + i; ymi = y - i; result |= fastPixelColorNolock(dst, xmj, ypi, color); result |= fastPixelColorNolock(dst, xpj, ypi, color); result |= fastPixelColorNolock(dst, xmj, ymi, color); result |= fastPixelColorNolock(dst, xpj, ymi, color); } else { result |= fastPixelColorNolock(dst, xmj, y, color); result |= fastPixelColorNolock(dst, xpj, y, color); } oi = i; xmk = x - k; xpk = x + k; if (h > 0) { yph = y + h; ymh = y - h; result |= fastPixelColorNolock(dst, xmk, yph, color); result |= fastPixelColorNolock(dst, xpk, yph, color); result |= fastPixelColorNolock(dst, xmk, ymh, color); result |= fastPixelColorNolock(dst, xpk, ymh, color); } else { result |= fastPixelColorNolock(dst, xmk, y, color); result |= fastPixelColorNolock(dst, xpk, y, color); } oh = h; } ix = ix + iy / ry; iy = iy - ix / ry; } while (i > h); } } else { if (rx > ry) { ix = 0; iy = rx * 64; do { h = (ix + 32) >> 6; i = (iy + 32) >> 6; j = (h * ry) / rx; k = (i * ry) / rx; if (((ok != k) && (oj != k)) || ((oj != j) && (ok != j)) || (k != j)) { xph = x + h; xmh = x - h; if (k > 0) { ypk = y + k; ymk = y - k; result |= pixelColorNolock (dst, xmh, ypk, color); result |= pixelColorNolock (dst, xph, ypk, color); result |= pixelColorNolock (dst, xmh, ymk, color); result |= pixelColorNolock (dst, xph, ymk, color); } else { result |= pixelColorNolock (dst, xmh, y, color); result |= pixelColorNolock (dst, xph, y, color); } ok = k; xpi = x + i; xmi = x - i; if (j > 0) { ypj = y + j; ymj = y - j; result |= pixelColorNolock (dst, xmi, ypj, color); result |= pixelColorNolock (dst, xpi, ypj, color); result |= pixelColorNolock (dst, xmi, ymj, color); result |= pixelColor(dst, xpi, ymj, color); } else { result |= pixelColorNolock (dst, xmi, y, color); result |= pixelColorNolock (dst, xpi, y, color); } oj = j; } ix = ix + iy / rx; iy = iy - ix / rx; } while (i > h); } else { ix = 0; iy = ry * 64; do { h = (ix + 32) >> 6; i = (iy + 32) >> 6; j = (h * rx) / ry; k = (i * rx) / ry; if (((oi != i) && (oh != i)) || ((oh != h) && (oi != h) && (i != h))) { xmj = x - j; xpj = x + j; if (i > 0) { ypi = y + i; ymi = y - i; result |= pixelColorNolock (dst, xmj, ypi, color); result |= pixelColorNolock (dst, xpj, ypi, color); result |= pixelColorNolock (dst, xmj, ymi, color); result |= pixelColorNolock (dst, xpj, ymi, color); } else { result |= pixelColorNolock (dst, xmj, y, color); result |= pixelColorNolock (dst, xpj, y, color); } oi = i; xmk = x - k; xpk = x + k; if (h > 0) { yph = y + h; ymh = y - h; result |= pixelColorNolock (dst, xmk, yph, color); result |= pixelColorNolock (dst, xpk, yph, color); result |= pixelColorNolock (dst, xmk, ymh, color); result |= pixelColorNolock (dst, xpk, ymh, color); } else { result |= pixelColorNolock (dst, xmk, y, color); result |= pixelColorNolock (dst, xpk, y, color); } oh = h; } ix = ix + iy / ry; iy = iy - ix / ry; } while (i > h); } } /* Alpha check */ /* Unlock surface */ if (SDL_MUSTLOCK(dst)) { SDL_UnlockSurface(dst); } return (result); } /*! \brief Draw ellipse with blending. \param dst The surface to draw on. \param x X coordinate of the center of the ellipse. \param y Y coordinate of the center of the ellipse. \param rx Horizontal radius in pixels of the ellipse. \param ry Vertical radius in pixels of the ellipse. \param r The red value of the ellipse to draw. \param g The green value of the ellipse to draw. \param b The blue value of the ellipse to draw. \param a The alpha value of the ellipse to draw. \returns Returns 0 on success, -1 on failure. */ int ellipseRGBA(SDL_Surface * dst, Sint16 x, Sint16 y, Sint16 rx, Sint16 ry, Uint8 r, Uint8 g, Uint8 b, Uint8 a) { /* * Draw */ return (ellipseColor(dst, x, y, rx, ry, ((Uint32) r << 24) | ((Uint32) g << 16) | ((Uint32) b << 8) | (Uint32) a)); } /* ----- AA Ellipse */ /* Windows targets do not have lrint, so provide a local inline version */ #if defined(_MSC_VER) /* Detect 64bit and use intrinsic version */ #ifdef _M_X64 #include static __inline long lrint(float f) { return _mm_cvtss_si32(_mm_load_ss(&f)); } #elif defined(_M_IX86) __inline long int lrint (double flt) { int intgr; _asm { fld flt fistp intgr }; return intgr; } #elif defined(_M_ARM) #include #pragma warning(push) #pragma warning(disable: 4716) __declspec(naked) long int lrint (double flt) { __emit(0xEC410B10); // fmdrr d0, r0, r1 __emit(0xEEBD0B40); // ftosid s0, d0 __emit(0xEE100A10); // fmrs r0, s0 __emit(0xE12FFF1E); // bx lr } #pragma warning(pop) #else #error lrint needed for MSVC on non X86/AMD64/ARM targets. #endif #endif /*! \brief Draw anti-aliased ellipse with blending. Note: Based on code from Anders Lindstroem, which is based on code from sge library, which is based on code from TwinLib. \param dst The surface to draw on. \param x X coordinate of the center of the aa-ellipse. \param y Y coordinate of the center of the aa-ellipse. \param rx Horizontal radius in pixels of the aa-ellipse. \param ry Vertical radius in pixels of the aa-ellipse. \param color The color value of the aa-ellipse to draw (0xRRGGBBAA). \returns Returns 0 on success, -1 on failure. */ int aaellipseColor(SDL_Surface * dst, Sint16 x, Sint16 y, Sint16 rx, Sint16 ry, Uint32 color) { Sint16 left, right, top, bottom; Sint16 x1,y1,x2,y2; int i; int a2, b2, ds, dt, dxt, t, s, d; Sint16 xp, yp, xs, ys, dyt, od, xx, yy, xc2, yc2; float cp; double sab; Uint8 weight, iweight; int result; /* * Check visibility of clipping rectangle */ if ((dst->clip_rect.w==0) || (dst->clip_rect.h==0)) { return(0); } /* * Sanity check radii */ if ((rx < 0) || (ry < 0)) { return (-1); } /* * Special case for rx=0 - draw a vline */ if (rx == 0) { return (vlineColor(dst, x, y - ry, y + ry, color)); } /* * Special case for ry=0 - draw an hline */ if (ry == 0) { return (hlineColor(dst, x - rx, x + rx, y, color)); } /* * Get circle and clipping boundary and * test if bounding box of circle is visible */ x2 = x + rx; left = dst->clip_rect.x; if (x2clip_rect.x + dst->clip_rect.w - 1; if (x1>right) { return(0); } y2 = y + ry; top = dst->clip_rect.y; if (y2clip_rect.y + dst->clip_rect.h - 1; if (y1>bottom) { return(0); } /* Variable setup */ a2 = rx * rx; b2 = ry * ry; ds = 2 * a2; dt = 2 * b2; xc2 = 2 * x; yc2 = 2 * y; sab = sqrt((double)(a2 + b2)); od = (Sint16)lrint(sab*0.01) + 1; /* introduce some overdraw */ dxt = (Sint16)lrint((double)a2 / sab) + od; t = 0; s = -2 * a2 * ry; d = 0; xp = x; yp = y - ry; /* Lock surface */ if (SDL_MUSTLOCK(dst)) { if (SDL_LockSurface(dst) < 0) { return (-1); } } /* Draw */ result = 0; /* "End points" */ result |= pixelColorNolock(dst, xp, yp, color); result |= pixelColorNolock(dst, xc2 - xp, yp, color); result |= pixelColorNolock(dst, xp, yc2 - yp, color); result |= pixelColorNolock(dst, xc2 - xp, yc2 - yp, color); for (i = 1; i <= dxt; i++) { xp--; d += t - b2; if (d >= 0) ys = yp - 1; else if ((d - s - a2) > 0) { if ((2 * d - s - a2) >= 0) ys = yp + 1; else { ys = yp; yp++; d -= s + a2; s += ds; } } else { yp++; ys = yp + 1; d -= s + a2; s += ds; } t -= dt; /* Calculate alpha */ if (s != 0) { cp = (float) abs(d) / (float) abs(s); if (cp > 1.0) { cp = 1.0; } } else { cp = 1.0; } /* Calculate weights */ weight = (Uint8) (cp * 255); iweight = 255 - weight; /* Upper half */ xx = xc2 - xp; result |= pixelColorWeightNolock(dst, xp, yp, color, iweight); result |= pixelColorWeightNolock(dst, xx, yp, color, iweight); result |= pixelColorWeightNolock(dst, xp, ys, color, weight); result |= pixelColorWeightNolock(dst, xx, ys, color, weight); /* Lower half */ yy = yc2 - yp; result |= pixelColorWeightNolock(dst, xp, yy, color, iweight); result |= pixelColorWeightNolock(dst, xx, yy, color, iweight); yy = yc2 - ys; result |= pixelColorWeightNolock(dst, xp, yy, color, weight); result |= pixelColorWeightNolock(dst, xx, yy, color, weight); } /* Replaces original approximation code dyt = abs(yp - yc); */ dyt = (Sint16)lrint((double)b2 / sab ) + od; for (i = 1; i <= dyt; i++) { yp++; d -= s + a2; if (d <= 0) xs = xp + 1; else if ((d + t - b2) < 0) { if ((2 * d + t - b2) <= 0) xs = xp - 1; else { xs = xp; xp--; d += t - b2; t -= dt; } } else { xp--; xs = xp - 1; d += t - b2; t -= dt; } s += ds; /* Calculate alpha */ if (t != 0) { cp = (float) abs(d) / (float) abs(t); if (cp > 1.0) { cp = 1.0; } } else { cp = 1.0; } /* Calculate weight */ weight = (Uint8) (cp * 255); iweight = 255 - weight; /* Left half */ xx = xc2 - xp; yy = yc2 - yp; result |= pixelColorWeightNolock(dst, xp, yp, color, iweight); result |= pixelColorWeightNolock(dst, xx, yp, color, iweight); result |= pixelColorWeightNolock(dst, xp, yy, color, iweight); result |= pixelColorWeightNolock(dst, xx, yy, color, iweight); /* Right half */ xx = xc2 - xs; result |= pixelColorWeightNolock(dst, xs, yp, color, weight); result |= pixelColorWeightNolock(dst, xx, yp, color, weight); result |= pixelColorWeightNolock(dst, xs, yy, color, weight); result |= pixelColorWeightNolock(dst, xx, yy, color, weight); } /* Unlock surface */ if (SDL_MUSTLOCK(dst)) { SDL_UnlockSurface(dst); } return (result); } /*! \brief Draw anti-aliased ellipse with blending. \param dst The surface to draw on. \param x X coordinate of the center of the aa-ellipse. \param y Y coordinate of the center of the aa-ellipse. \param rx Horizontal radius in pixels of the aa-ellipse. \param ry Vertical radius in pixels of the aa-ellipse. \param r The red value of the aa-ellipse to draw. \param g The green value of the aa-ellipse to draw. \param b The blue value of the aa-ellipse to draw. \param a The alpha value of the aa-ellipse to draw. \returns Returns 0 on success, -1 on failure. */ int aaellipseRGBA(SDL_Surface * dst, Sint16 x, Sint16 y, Sint16 rx, Sint16 ry, Uint8 r, Uint8 g, Uint8 b, Uint8 a) { /* * Draw */ return (aaellipseColor (dst, x, y, rx, ry, ((Uint32) r << 24) | ((Uint32) g << 16) | ((Uint32) b << 8) | (Uint32) a)); } /* ---- Filled Ellipse */ /* Note: */ /* Based on algorithm from sge library with multiple-hline draw removal */ /* and other speedup changes. */ /*! \brief Draw filled ellipse with blending. Note: Based on algorithm from sge library with multiple-hline draw removal and other speedup changes. \param dst The surface to draw on. \param x X coordinate of the center of the filled ellipse. \param y Y coordinate of the center of the filled ellipse. \param rx Horizontal radius in pixels of the filled ellipse. \param ry Vertical radius in pixels of the filled ellipse. \param color The color value of the filled ellipse to draw (0xRRGGBBAA). \returns Returns 0 on success, -1 on failure. */ int filledEllipseColor(SDL_Surface * dst, Sint16 x, Sint16 y, Sint16 rx, Sint16 ry, Uint32 color) { Sint16 left, right, top, bottom; int result; Sint16 x1, y1, x2, y2; int ix, iy; int h, i, j, k; int oh, oi, oj, ok; int xmh, xph; int xmi, xpi; int xmj, xpj; int xmk, xpk; /* * Check visibility of clipping rectangle */ if ((dst->clip_rect.w==0) || (dst->clip_rect.h==0)) { return(0); } /* * Sanity check radii */ if ((rx < 0) || (ry < 0)) { return (-1); } /* * Special case for rx=0 - draw a vline */ if (rx == 0) { return (vlineColor(dst, x, y - ry, y + ry, color)); } /* * Special case for ry=0 - draw a hline */ if (ry == 0) { return (hlineColor(dst, x - rx, x + rx, y, color)); } /* * Get circle and clipping boundary and * test if bounding box of circle is visible */ x2 = x + rx; left = dst->clip_rect.x; if (x2clip_rect.x + dst->clip_rect.w - 1; if (x1>right) { return(0); } y2 = y + ry; top = dst->clip_rect.y; if (y2clip_rect.y + dst->clip_rect.h - 1; if (y1>bottom) { return(0); } /* * Init vars */ oh = oi = oj = ok = 0xFFFF; /* * Draw */ result = 0; if (rx > ry) { ix = 0; iy = rx * 64; do { h = (ix + 32) >> 6; i = (iy + 32) >> 6; j = (h * ry) / rx; k = (i * ry) / rx; if ((ok != k) && (oj != k)) { xph = x + h; xmh = x - h; if (k > 0) { result |= hlineColor(dst, xmh, xph, y + k, color); result |= hlineColor(dst, xmh, xph, y - k, color); } else { result |= hlineColor(dst, xmh, xph, y, color); } ok = k; } if ((oj != j) && (ok != j) && (k != j)) { xmi = x - i; xpi = x + i; if (j > 0) { result |= hlineColor(dst, xmi, xpi, y + j, color); result |= hlineColor(dst, xmi, xpi, y - j, color); } else { result |= hlineColor(dst, xmi, xpi, y, color); } oj = j; } ix = ix + iy / rx; iy = iy - ix / rx; } while (i > h); } else { ix = 0; iy = ry * 64; do { h = (ix + 32) >> 6; i = (iy + 32) >> 6; j = (h * rx) / ry; k = (i * rx) / ry; if ((oi != i) && (oh != i)) { xmj = x - j; xpj = x + j; if (i > 0) { result |= hlineColor(dst, xmj, xpj, y + i, color); result |= hlineColor(dst, xmj, xpj, y - i, color); } else { result |= hlineColor(dst, xmj, xpj, y, color); } oi = i; } if ((oh != h) && (oi != h) && (i != h)) { xmk = x - k; xpk = x + k; if (h > 0) { result |= hlineColor(dst, xmk, xpk, y + h, color); result |= hlineColor(dst, xmk, xpk, y - h, color); } else { result |= hlineColor(dst, xmk, xpk, y, color); } oh = h; } ix = ix + iy / ry; iy = iy - ix / ry; } while (i > h); } return (result); } /*! \brief Draw filled ellipse with blending. \param dst The surface to draw on. \param x X coordinate of the center of the filled ellipse. \param y Y coordinate of the center of the filled ellipse. \param rx Horizontal radius in pixels of the filled ellipse. \param ry Vertical radius in pixels of the filled ellipse. \param r The red value of the filled ellipse to draw. \param g The green value of the filled ellipse to draw. \param b The blue value of the filled ellipse to draw. \param a The alpha value of the filled ellipse to draw. \returns Returns 0 on success, -1 on failure. */ int filledEllipseRGBA(SDL_Surface * dst, Sint16 x, Sint16 y, Sint16 rx, Sint16 ry, Uint8 r, Uint8 g, Uint8 b, Uint8 a) { /* * Draw */ return (filledEllipseColor (dst, x, y, rx, ry, ((Uint32) r << 24) | ((Uint32) g << 16) | ((Uint32) b << 8) | (Uint32) a)); } /* ----- pie */ /*! \brief Internal float (low-speed) pie-calc implementation by drawing polygons. Note: Determines vertex array and uses polygon or filledPolygon drawing routines to render. \param dst The surface to draw on. \param x X coordinate of the center of the pie. \param y Y coordinate of the center of the pie. \param rad Radius in pixels of the pie. \param start Starting radius in degrees of the pie. \param end Ending radius in degrees of the pie. \param color The color value of the pie to draw (0xRRGGBBAA). \param filled Flag indicating if the pie should be filled (=1) or not (=0). \returns Returns 0 on success, -1 on failure. */ int _pieColor(SDL_Surface * dst, Sint16 x, Sint16 y, Sint16 rad, Sint16 start, Sint16 end, Uint32 color, Uint8 filled) { Sint16 left, right, top, bottom; Sint16 x1, y1, x2, y2; int result; double angle, start_angle, end_angle; double deltaAngle; double dr; int numpoints, i; Sint16 *vx, *vy; /* * Check visibility of clipping rectangle */ if ((dst->clip_rect.w==0) || (dst->clip_rect.h==0)) { return(0); } /* * Sanity check radii */ if (rad < 0) { return (-1); } /* * Fixup angles */ start = start % 360; end = end % 360; /* * Special case for rad=0 - draw a point */ if (rad == 0) { return (pixelColor(dst, x, y, color)); } /* * Clip against circle, not pie (not 100% optimal). * Get pie's circle and clipping boundary and * test if bounding box of circle is visible */ x2 = x + rad; left = dst->clip_rect.x; if (x2clip_rect.x + dst->clip_rect.w - 1; if (x1>right) { return(0); } y2 = y + rad; top = dst->clip_rect.y; if (y2clip_rect.y + dst->clip_rect.h - 1; if (y1>bottom) { return(0); } /* * Variable setup */ dr = (double) rad; deltaAngle = 3.0 / dr; start_angle = (double) start *(2.0 * M_PI / 360.0); end_angle = (double) end *(2.0 * M_PI / 360.0); if (start > end) { end_angle += (2.0 * M_PI); } /* We will always have at least 2 points */ numpoints = 2; /* Count points (rather than calculating it) */ angle = start_angle; while (angle < end_angle) { angle += deltaAngle; numpoints++; } /* Allocate combined vertex array */ vx = vy = (Sint16 *) malloc(2 * sizeof(Uint16) * numpoints); if (vx == NULL) { return (-1); } /* Update point to start of vy */ vy += numpoints; /* Center */ vx[0] = x; vy[0] = y; /* First vertex */ angle = start_angle; vx[1] = x + (int) (dr * cos(angle)); vy[1] = y + (int) (dr * sin(angle)); if (numpoints<3) { result = lineColor(dst, vx[0], vy[0], vx[1], vy[1], color); } else { /* Calculate other vertices */ i = 2; angle = start_angle; while (angle < end_angle) { angle += deltaAngle; if (angle>end_angle) { angle = end_angle; } vx[i] = x + (int) (dr * cos(angle)); vy[i] = y + (int) (dr * sin(angle)); i++; } /* Draw */ if (filled) { result = filledPolygonColor(dst, vx, vy, numpoints, color); } else { result = polygonColor(dst, vx, vy, numpoints, color); } } /* Free combined vertex array */ free(vx); return (result); } /*! \brief Draw pie (outline) with alpha blending. \param dst The surface to draw on. \param x X coordinate of the center of the pie. \param y Y coordinate of the center of the pie. \param rad Radius in pixels of the pie. \param start Starting radius in degrees of the pie. \param end Ending radius in degrees of the pie. \param color The color value of the pie to draw (0xRRGGBBAA). \returns Returns 0 on success, -1 on failure. */ int pieColor(SDL_Surface * dst, Sint16 x, Sint16 y, Sint16 rad, Sint16 start, Sint16 end, Uint32 color) { return (_pieColor(dst, x, y, rad, start, end, color, 0)); } /*! \brief Draw pie (outline) with alpha blending. \param dst The surface to draw on. \param x X coordinate of the center of the pie. \param y Y coordinate of the center of the pie. \param rad Radius in pixels of the pie. \param start Starting radius in degrees of the pie. \param end Ending radius in degrees of the pie. \param r The red value of the pie to draw. \param g The green value of the pie to draw. \param b The blue value of the pie to draw. \param a The alpha value of the pie to draw. \returns Returns 0 on success, -1 on failure. */ int pieRGBA(SDL_Surface * dst, Sint16 x, Sint16 y, Sint16 rad, Sint16 start, Sint16 end, Uint8 r, Uint8 g, Uint8 b, Uint8 a) { return (_pieColor(dst, x, y, rad, start, end, ((Uint32) r << 24) | ((Uint32) g << 16) | ((Uint32) b << 8) | (Uint32) a, 0)); } /*! \brief Draw filled pie with alpha blending. \param dst The surface to draw on. \param x X coordinate of the center of the filled pie. \param y Y coordinate of the center of the filled pie. \param rad Radius in pixels of the filled pie. \param start Starting radius in degrees of the filled pie. \param end Ending radius in degrees of the filled pie. \param color The color value of the filled pie to draw (0xRRGGBBAA). \returns Returns 0 on success, -1 on failure. */ int filledPieColor(SDL_Surface * dst, Sint16 x, Sint16 y, Sint16 rad, Sint16 start, Sint16 end, Uint32 color) { return (_pieColor(dst, x, y, rad, start, end, color, 1)); } /*! \brief Draw filled pie with alpha blending. \param dst The surface to draw on. \param x X coordinate of the center of the filled pie. \param y Y coordinate of the center of the filled pie. \param rad Radius in pixels of the filled pie. \param start Starting radius in degrees of the filled pie. \param end Ending radius in degrees of the filled pie. \param r The red value of the filled pie to draw. \param g The green value of the filled pie to draw. \param b The blue value of the filled pie to draw. \param a The alpha value of the filled pie to draw. \returns Returns 0 on success, -1 on failure. */ int filledPieRGBA(SDL_Surface * dst, Sint16 x, Sint16 y, Sint16 rad, Sint16 start, Sint16 end, Uint8 r, Uint8 g, Uint8 b, Uint8 a) { return (_pieColor(dst, x, y, rad, start, end, ((Uint32) r << 24) | ((Uint32) g << 16) | ((Uint32) b << 8) | (Uint32) a, 1)); } /* ------ Trigon */ /*! \brief Draw trigon (triangle outline) with alpha blending. Note: Creates vertex array and uses polygon routine to render. \param dst The surface to draw on. \param x1 X coordinate of the first point of the trigon. \param y1 Y coordinate of the first point of the trigon. \param x2 X coordinate of the second point of the trigon. \param y2 Y coordinate of the second point of the trigon. \param x3 X coordinate of the third point of the trigon. \param y3 Y coordinate of the third point of the trigon. \param color The color value of the trigon to draw (0xRRGGBBAA). \returns Returns 0 on success, -1 on failure. */ int trigonColor(SDL_Surface * dst, Sint16 x1, Sint16 y1, Sint16 x2, Sint16 y2, Sint16 x3, Sint16 y3, Uint32 color) { Sint16 vx[3]; Sint16 vy[3]; vx[0]=x1; vx[1]=x2; vx[2]=x3; vy[0]=y1; vy[1]=y2; vy[2]=y3; return(polygonColor(dst,vx,vy,3,color)); } /*! \brief Draw trigon (triangle outline) with alpha blending. \param dst The surface to draw on. \param x1 X coordinate of the first point of the trigon. \param y1 Y coordinate of the first point of the trigon. \param x2 X coordinate of the second point of the trigon. \param y2 Y coordinate of the second point of the trigon. \param x3 X coordinate of the third point of the trigon. \param y3 Y coordinate of the third point of the trigon. \param r The red value of the trigon to draw. \param g The green value of the trigon to draw. \param b The blue value of the trigon to draw. \param a The alpha value of the trigon to draw. \returns Returns 0 on success, -1 on failure. */ int trigonRGBA(SDL_Surface * dst, Sint16 x1, Sint16 y1, Sint16 x2, Sint16 y2, Sint16 x3, Sint16 y3, Uint8 r, Uint8 g, Uint8 b, Uint8 a) { Sint16 vx[3]; Sint16 vy[3]; vx[0]=x1; vx[1]=x2; vx[2]=x3; vy[0]=y1; vy[1]=y2; vy[2]=y3; return(polygonRGBA(dst,vx,vy,3,r,g,b,a)); } /* ------ AA-Trigon */ /*! \brief Draw anti-aliased trigon (triangle outline) with alpha blending. Note: Creates vertex array and uses aapolygon routine to render. \param dst The surface to draw on. \param x1 X coordinate of the first point of the aa-trigon. \param y1 Y coordinate of the first point of the aa-trigon. \param x2 X coordinate of the second point of the aa-trigon. \param y2 Y coordinate of the second point of the aa-trigon. \param x3 X coordinate of the third point of the aa-trigon. \param y3 Y coordinate of the third point of the aa-trigon. \param color The color value of the aa-trigon to draw (0xRRGGBBAA). \returns Returns 0 on success, -1 on failure. */ int aatrigonColor(SDL_Surface * dst, Sint16 x1, Sint16 y1, Sint16 x2, Sint16 y2, Sint16 x3, Sint16 y3, Uint32 color) { Sint16 vx[3]; Sint16 vy[3]; vx[0]=x1; vx[1]=x2; vx[2]=x3; vy[0]=y1; vy[1]=y2; vy[2]=y3; return(aapolygonColor(dst,vx,vy,3,color)); } /*! \brief Draw anti-aliased trigon (triangle outline) with alpha blending. \param dst The surface to draw on. \param x1 X coordinate of the first point of the aa-trigon. \param y1 Y coordinate of the first point of the aa-trigon. \param x2 X coordinate of the second point of the aa-trigon. \param y2 Y coordinate of the second point of the aa-trigon. \param x3 X coordinate of the third point of the aa-trigon. \param y3 Y coordinate of the third point of the aa-trigon. \param r The red value of the aa-trigon to draw. \param g The green value of the aa-trigon to draw. \param b The blue value of the aa-trigon to draw. \param a The alpha value of the aa-trigon to draw. \returns Returns 0 on success, -1 on failure. */ int aatrigonRGBA(SDL_Surface * dst, Sint16 x1, Sint16 y1, Sint16 x2, Sint16 y2, Sint16 x3, Sint16 y3, Uint8 r, Uint8 g, Uint8 b, Uint8 a) { Sint16 vx[3]; Sint16 vy[3]; vx[0]=x1; vx[1]=x2; vx[2]=x3; vy[0]=y1; vy[1]=y2; vy[2]=y3; return(aapolygonRGBA(dst,vx,vy,3,r,g,b,a)); } /* ------ Filled Trigon */ /*! \brief Draw filled trigon (triangle) with alpha blending. Note: Creates vertex array and uses aapolygon routine to render. \param dst The surface to draw on. \param x1 X coordinate of the first point of the filled trigon. \param y1 Y coordinate of the first point of the filled trigon. \param x2 X coordinate of the second point of the filled trigon. \param y2 Y coordinate of the second point of the filled trigon. \param x3 X coordinate of the third point of the filled trigon. \param y3 Y coordinate of the third point of the filled trigon. \param color The color value of the filled trigon to draw (0xRRGGBBAA). \returns Returns 0 on success, -1 on failure. */ int filledTrigonColor(SDL_Surface * dst, Sint16 x1, Sint16 y1, Sint16 x2, Sint16 y2, Sint16 x3, Sint16 y3, Uint32 color) { Sint16 vx[3]; Sint16 vy[3]; vx[0]=x1; vx[1]=x2; vx[2]=x3; vy[0]=y1; vy[1]=y2; vy[2]=y3; return(filledPolygonColor(dst,vx,vy,3,color)); } /*! \brief Draw filled trigon (triangle) with alpha blending. Note: Creates vertex array and uses aapolygon routine to render. \param dst The surface to draw on. \param x1 X coordinate of the first point of the filled trigon. \param y1 Y coordinate of the first point of the filled trigon. \param x2 X coordinate of the second point of the filled trigon. \param y2 Y coordinate of the second point of the filled trigon. \param x3 X coordinate of the third point of the filled trigon. \param y3 Y coordinate of the third point of the filled trigon. \param r The red value of the filled trigon to draw. \param g The green value of the filled trigon to draw. \param b The blue value of the filled trigon to draw. \param a The alpha value of the filled trigon to draw. \returns Returns 0 on success, -1 on failure. */ int filledTrigonRGBA(SDL_Surface * dst, Sint16 x1, Sint16 y1, Sint16 x2, Sint16 y2, Sint16 x3, Sint16 y3, Uint8 r, Uint8 g, Uint8 b, Uint8 a) { Sint16 vx[3]; Sint16 vy[3]; vx[0]=x1; vx[1]=x2; vx[2]=x3; vy[0]=y1; vy[1]=y2; vy[2]=y3; return(filledPolygonRGBA(dst,vx,vy,3,r,g,b,a)); } /* ---- Polygon */ /*! \brief Draw polygon with alpha blending. \param dst The surface to draw on. \param vx Vertex array containing X coordinates of the points of the polygon. \param vy Vertex array containing Y coordinates of the points of the polygon. \param n Number of points in the vertex array. Minimum number is 3. \param color The color value of the polygon to draw (0xRRGGBBAA). \returns Returns 0 on success, -1 on failure. */ int polygonColor(SDL_Surface * dst, const Sint16 * vx, const Sint16 * vy, int n, Uint32 color) { int result; int i; const Sint16 *x1, *y1, *x2, *y2; /* * Check visibility of clipping rectangle */ if ((dst->clip_rect.w==0) || (dst->clip_rect.h==0)) { return(0); } /* * Vertex array NULL check */ if (vx == NULL) { return (-1); } if (vy == NULL) { return (-1); } /* * Sanity check */ if (n < 3) { return (-1); } /* * Pointer setup */ x1 = x2 = vx; y1 = y2 = vy; x2++; y2++; /* * Draw */ result = 0; for (i = 1; i < n; i++) { result |= lineColor(dst, *x1, *y1, *x2, *y2, color); x1 = x2; y1 = y2; x2++; y2++; } result |= lineColor(dst, *x1, *y1, *vx, *vy, color); return (result); } /*! \brief Draw polygon with alpha blending. \param dst The surface to draw on. \param vx Vertex array containing X coordinates of the points of the polygon. \param vy Vertex array containing Y coordinates of the points of the polygon. \param n Number of points in the vertex array. Minimum number is 3. \param r The red value of the polygon to draw. \param g The green value of the polygon to draw. \param b The blue value of the polygon to draw. \param a The alpha value of the polygon to draw. \returns Returns 0 on success, -1 on failure. */ int polygonRGBA(SDL_Surface * dst, const Sint16 * vx, const Sint16 * vy, int n, Uint8 r, Uint8 g, Uint8 b, Uint8 a) { /* * Draw */ return (polygonColor(dst, vx, vy, n, ((Uint32) r << 24) | ((Uint32) g << 16) | ((Uint32) b << 8) | (Uint32) a)); } /* ---- AA-Polygon */ /*! \brief Draw anti-aliased polygon with alpha blending. \param dst The surface to draw on. \param vx Vertex array containing X coordinates of the points of the aa-polygon. \param vy Vertex array containing Y coordinates of the points of the aa-polygon. \param n Number of points in the vertex array. Minimum number is 3. \param color The color value of the aa-polygon to draw (0xRRGGBBAA). \returns Returns 0 on success, -1 on failure. */ int aapolygonColor(SDL_Surface * dst, const Sint16 * vx, const Sint16 * vy, int n, Uint32 color) { int result; int i; const Sint16 *x1, *y1, *x2, *y2; /* * Check visibility of clipping rectangle */ if ((dst->clip_rect.w==0) || (dst->clip_rect.h==0)) { return(0); } /* * Vertex array NULL check */ if (vx == NULL) { return (-1); } if (vy == NULL) { return (-1); } /* * Sanity check */ if (n < 3) { return (-1); } /* * Pointer setup */ x1 = x2 = vx; y1 = y2 = vy; x2++; y2++; /* * Draw */ result = 0; for (i = 1; i < n; i++) { result |= _aalineColor(dst, *x1, *y1, *x2, *y2, color, 0); x1 = x2; y1 = y2; x2++; y2++; } result |= _aalineColor(dst, *x1, *y1, *vx, *vy, color, 0); return (result); } /*! \brief Draw anti-aliased polygon with alpha blending. \param dst The surface to draw on. \param vx Vertex array containing X coordinates of the points of the aa-polygon. \param vy Vertex array containing Y coordinates of the points of the aa-polygon. \param n Number of points in the vertex array. Minimum number is 3. \param r The red value of the aa-polygon to draw. \param g The green value of the aa-polygon to draw. \param b The blue value of the aa-polygon to draw. \param a The alpha value of the aa-polygon to draw. \returns Returns 0 on success, -1 on failure. */ int aapolygonRGBA(SDL_Surface * dst, const Sint16 * vx, const Sint16 * vy, int n, Uint8 r, Uint8 g, Uint8 b, Uint8 a) { /* * Draw */ return (aapolygonColor(dst, vx, vy, n, ((Uint32) r << 24) | ((Uint32) g << 16) | ((Uint32) b << 8) | (Uint32) a)); } /* ---- Filled Polygon */ /*! \brief Internal helper qsort callback functions used in filled polygon drawing. \param a The surface to draw on. \param b Vertex array containing X coordinates of the points of the polygon. \returns Returns 0 if a==b, a negative number if ab. */ int _gfxPrimitivesCompareInt(const void *a, const void *b) { return (*(const int *) a) - (*(const int *) b); } /*! \brief Global vertex array to use if optional parameters are not given in filledPolygonMT calls. Note: Used for non-multithreaded (default) operation of filledPolygonMT. */ static int *gfxPrimitivesPolyIntsGlobal = NULL; /*! \brief Flag indicating if global vertex array was already allocated. Note: Used for non-multithreaded (default) operation of filledPolygonMT. */ static int gfxPrimitivesPolyAllocatedGlobal = 0; /*! \brief Draw filled polygon with alpha blending (multi-threaded capable). Note: The last two parameters are optional; but are required for multithreaded operation. \param dst The surface to draw on. \param vx Vertex array containing X coordinates of the points of the filled polygon. \param vy Vertex array containing Y coordinates of the points of the filled polygon. \param n Number of points in the vertex array. Minimum number is 3. \param color The color value of the filled polygon to draw (0xRRGGBBAA). \param polyInts Preallocated, temporary vertex array used for sorting vertices. Required for multithreaded operation; set to NULL otherwise. \param polyAllocated Flag indicating if temporary vertex array was allocated. Required for multithreaded operation; set to NULL otherwise. \returns Returns 0 on success, -1 on failure. */ int filledPolygonColorMT(SDL_Surface * dst, const Sint16 * vx, const Sint16 * vy, int n, Uint32 color, int **polyInts, int *polyAllocated) { int result; int i; int y, xa, xb; int miny, maxy; int x1, y1; int x2, y2; int ind1, ind2; int ints; int *gfxPrimitivesPolyInts = NULL; int *gfxPrimitivesPolyIntsNew = NULL; int gfxPrimitivesPolyAllocated = 0; /* * Check visibility of clipping rectangle */ if ((dst->clip_rect.w==0) || (dst->clip_rect.h==0)) { return(0); } /* * Vertex array NULL check */ if (vx == NULL) { return (-1); } if (vy == NULL) { return (-1); } /* * Sanity check number of edges */ if (n < 3) { return -1; } /* * Map polygon cache */ if ((polyInts==NULL) || (polyAllocated==NULL)) { /* Use global cache */ gfxPrimitivesPolyInts = gfxPrimitivesPolyIntsGlobal; gfxPrimitivesPolyAllocated = gfxPrimitivesPolyAllocatedGlobal; } else { /* Use local cache */ gfxPrimitivesPolyInts = *polyInts; gfxPrimitivesPolyAllocated = *polyAllocated; } /* * Allocate temp array, only grow array */ if (!gfxPrimitivesPolyAllocated) { gfxPrimitivesPolyInts = (int *) malloc(sizeof(int) * n); gfxPrimitivesPolyAllocated = n; } else { if (gfxPrimitivesPolyAllocated < n) { gfxPrimitivesPolyIntsNew = (int *) realloc(gfxPrimitivesPolyInts, sizeof(int) * n); if (!gfxPrimitivesPolyIntsNew) { if (!gfxPrimitivesPolyInts) { free(gfxPrimitivesPolyInts); gfxPrimitivesPolyInts = NULL; } gfxPrimitivesPolyAllocated = 0; } else { gfxPrimitivesPolyInts = gfxPrimitivesPolyIntsNew; gfxPrimitivesPolyAllocated = n; } } } /* * Check temp array */ if (gfxPrimitivesPolyInts==NULL) { gfxPrimitivesPolyAllocated = 0; } /* * Update cache variables */ if ((polyInts==NULL) || (polyAllocated==NULL)) { gfxPrimitivesPolyIntsGlobal = gfxPrimitivesPolyInts; gfxPrimitivesPolyAllocatedGlobal = gfxPrimitivesPolyAllocated; } else { *polyInts = gfxPrimitivesPolyInts; *polyAllocated = gfxPrimitivesPolyAllocated; } /* * Check temp array again */ if (gfxPrimitivesPolyInts==NULL) { return(-1); } /* * Determine Y maxima */ miny = vy[0]; maxy = vy[0]; for (i = 1; (i < n); i++) { if (vy[i] < miny) { miny = vy[i]; } else if (vy[i] > maxy) { maxy = vy[i]; } } /* * Draw, scanning y */ result = 0; for (y = miny; (y <= maxy); y++) { ints = 0; for (i = 0; (i < n); i++) { if (!i) { ind1 = n - 1; ind2 = 0; } else { ind1 = i - 1; ind2 = i; } y1 = vy[ind1]; y2 = vy[ind2]; if (y1 < y2) { x1 = vx[ind1]; x2 = vx[ind2]; } else if (y1 > y2) { y2 = vy[ind1]; y1 = vy[ind2]; x2 = vx[ind1]; x1 = vx[ind2]; } else { continue; } if ( ((y >= y1) && (y < y2)) || ((y == maxy) && (y > y1) && (y <= y2)) ) { gfxPrimitivesPolyInts[ints++] = ((65536 * (y - y1)) / (y2 - y1)) * (x2 - x1) + (65536 * x1); } } qsort(gfxPrimitivesPolyInts, ints, sizeof(int), _gfxPrimitivesCompareInt); for (i = 0; (i < ints); i += 2) { xa = gfxPrimitivesPolyInts[i] + 1; xa = (xa >> 16) + ((xa & 32768) >> 15); xb = gfxPrimitivesPolyInts[i+1] - 1; xb = (xb >> 16) + ((xb & 32768) >> 15); result |= hlineColor(dst, xa, xb, y, color); } } return (result); } /*! \brief Draw filled polygon with alpha blending (multi-threaded capable). Note: The last two parameters are optional; but are required for multithreaded operation. \param dst The surface to draw on. \param vx Vertex array containing X coordinates of the points of the filled polygon. \param vy Vertex array containing Y coordinates of the points of the filled polygon. \param n Number of points in the vertex array. Minimum number is 3. \param r The red value of the filled polygon to draw. \param g The green value of the filled polygon to draw. \param b The blue value of the filed polygon to draw. \param a The alpha value of the filled polygon to draw. \param polyInts Preallocated, temporary vertex array used for sorting vertices. Required for multithreaded operation; set to NULL otherwise. \param polyAllocated Flag indicating if temporary vertex array was allocated. Required for multithreaded operation; set to NULL otherwise. \returns Returns 0 on success, -1 on failure. */ int filledPolygonRGBAMT(SDL_Surface * dst, const Sint16 * vx, const Sint16 * vy, int n, Uint8 r, Uint8 g, Uint8 b, Uint8 a, int **polyInts, int *polyAllocated) { /* * Draw */ return (filledPolygonColorMT(dst, vx, vy, n, ((Uint32) r << 24) | ((Uint32) g << 16) | ((Uint32) b << 8) | (Uint32) a, polyInts, polyAllocated)); } /*! \brief Draw filled polygon with alpha blending. Note: Standard filledPolygon function is calling multithreaded version with NULL parameters to use the global vertex cache. \param dst The surface to draw on. \param vx Vertex array containing X coordinates of the points of the filled polygon. \param vy Vertex array containing Y coordinates of the points of the filled polygon. \param n Number of points in the vertex array. Minimum number is 3. \param color The color value of the filled polygon to draw (0xRRGGBBAA). \returns Returns 0 on success, -1 on failure. */ int filledPolygonColor(SDL_Surface * dst, const Sint16 * vx, const Sint16 * vy, int n, Uint32 color) { /* * Draw */ return (filledPolygonColorMT(dst, vx, vy, n, color, NULL, NULL)); } /*! \brief Draw filled polygon with alpha blending. \param dst The surface to draw on. \param vx Vertex array containing X coordinates of the points of the filled polygon. \param vy Vertex array containing Y coordinates of the points of the filled polygon. \param n Number of points in the vertex array. Minimum number is 3. \param r The red value of the filled polygon to draw. \param g The green value of the filled polygon to draw. \param b The blue value of the filed polygon to draw. \param a The alpha value of the filled polygon to draw. \returns Returns 0 on success, -1 on failure. */ int filledPolygonRGBA(SDL_Surface * dst, const Sint16 * vx, const Sint16 * vy, int n, Uint8 r, Uint8 g, Uint8 b, Uint8 a) { /* * Draw */ return (filledPolygonColorMT(dst, vx, vy, n, ((Uint32) r << 24) | ((Uint32) g << 16) | ((Uint32) b << 8) | (Uint32) a, NULL, NULL)); } /*! \brief Internal function to draw a textured horizontal line. \param dst The surface to draw on. \param x1 X coordinate of the first point (i.e. left) of the line. \param x2 X coordinate of the second point (i.e. right) of the line. \param y Y coordinate of the points of the line. \param texture The texture surface to retrieve color information from. \param texture_dx The X offset for the texture lookup. \param texture_dy The Y offset for the textured lookup. \returns Returns 0 on success, -1 on failure. */ int _HLineTextured(SDL_Surface * dst, Sint16 x1, Sint16 x2, Sint16 y, SDL_Surface *texture, int texture_dx, int texture_dy) { Sint16 left, right, top, bottom; Sint16 w; Sint16 xtmp; int result = 0; int texture_x_walker; int texture_y_start; SDL_Rect source_rect,dst_rect; int pixels_written,write_width; /* * Check visibility of clipping rectangle */ if ((dst->clip_rect.w==0) || (dst->clip_rect.h==0)) { return(0); } /* * Swap x1, x2 if required to ensure x1<=x2 */ if (x1 > x2) { xtmp = x1; x1 = x2; x2 = xtmp; } /* * Get clipping boundary and * check visibility of hline */ left = dst->clip_rect.x; if (x2clip_rect.x + dst->clip_rect.w - 1; if (x1>right) { return(0); } top = dst->clip_rect.y; bottom = dst->clip_rect.y + dst->clip_rect.h - 1; if ((ybottom)) { return (0); } /* * Clip x */ if (x1 < left) { x1 = left; } if (x2 > right) { x2 = right; } /* * Calculate width to draw */ w = x2 - x1 + 1; /* * Determine where in the texture we start drawing */ texture_x_walker = (x1 - texture_dx) % texture->w; if (texture_x_walker < 0){ texture_x_walker = texture->w + texture_x_walker ; } texture_y_start = (y + texture_dy) % texture->h; if (texture_y_start < 0){ texture_y_start = texture->h + texture_y_start; } // setup the source rectangle; we are only drawing one horizontal line source_rect.y = texture_y_start; source_rect.x = texture_x_walker; source_rect.h = 1; // we will draw to the current y dst_rect.y = y; // if there are enough pixels left in the current row of the texture // draw it all at once if (w <= texture->w -texture_x_walker){ source_rect.w = w; source_rect.x = texture_x_walker; dst_rect.x= x1; result = (SDL_BlitSurface (texture, &source_rect , dst, &dst_rect) == 0); } else { // we need to draw multiple times // draw the first segment pixels_written = texture->w - texture_x_walker; source_rect.w = pixels_written; source_rect.x = texture_x_walker; dst_rect.x= x1; result |= (SDL_BlitSurface (texture, &source_rect , dst, &dst_rect) == 0); write_width = texture->w; // now draw the rest // set the source x to 0 source_rect.x = 0; while (pixels_written < w){ if (write_width >= w - pixels_written) { write_width = w - pixels_written; } source_rect.w = write_width; dst_rect.x = x1 + pixels_written; result |= (SDL_BlitSurface (texture,&source_rect , dst, &dst_rect) == 0); pixels_written += write_width; } } return result; } /*! \brief Draws a polygon filled with the given texture (Multi-Threading Capable). This operation use internally SDL_BlitSurface for lines of the source texture. It supports alpha drawing. To get the best performance of this operation you need to make sure the texture and the dst surface have the same format (see http://docs.mandragor.org/files/Common_libs_documentation/SDL/SDL_Documentation_project_en/sdlblitsurface.html). The last two parameters are optional, but required for multithreaded operation. When set to NULL, uses global static temp array. \param dst the destination surface, \param vx array of x vector components \param vy array of x vector components \param n the amount of vectors in the vx and vy array \param texture the sdl surface to use to fill the polygon \param texture_dx the offset of the texture relative to the screeen. if you move the polygon 10 pixels to the left and want the texture to apear the same you need to increase the texture_dx value \param texture_dy see texture_dx \param polyInts preallocated temp array storage for vertex sorting (used for multi-threaded operation) \param polyAllocated flag indicating oif the temp array was allocated (used for multi-threaded operation) \returns Returns 0 on success, -1 on failure. */ int texturedPolygonMT(SDL_Surface * dst, const Sint16 * vx, const Sint16 * vy, int n, SDL_Surface * texture, int texture_dx, int texture_dy, int **polyInts, int *polyAllocated) { int result; int i; int y, xa, xb; int minx,maxx,miny, maxy; int x1, y1; int x2, y2; int ind1, ind2; int ints; int *gfxPrimitivesPolyInts = NULL; int gfxPrimitivesPolyAllocated = 0; /* * Check visibility of clipping rectangle */ if ((dst->clip_rect.w==0) || (dst->clip_rect.h==0)) { return(0); } /* * Sanity check number of edges */ if (n < 3) { return -1; } /* * Map polygon cache */ if ((polyInts==NULL) || (polyAllocated==NULL)) { /* Use global cache */ gfxPrimitivesPolyInts = gfxPrimitivesPolyIntsGlobal; gfxPrimitivesPolyAllocated = gfxPrimitivesPolyAllocatedGlobal; } else { /* Use local cache */ gfxPrimitivesPolyInts = *polyInts; gfxPrimitivesPolyAllocated = *polyAllocated; } /* * Allocate temp array, only grow array */ if (!gfxPrimitivesPolyAllocated) { gfxPrimitivesPolyInts = (int *) malloc(sizeof(int) * n); gfxPrimitivesPolyAllocated = n; } else { if (gfxPrimitivesPolyAllocated < n) { gfxPrimitivesPolyInts = (int *) realloc(gfxPrimitivesPolyInts, sizeof(int) * n); gfxPrimitivesPolyAllocated = n; } } /* * Check temp array */ if (gfxPrimitivesPolyInts==NULL) { gfxPrimitivesPolyAllocated = 0; } /* * Update cache variables */ if ((polyInts==NULL) || (polyAllocated==NULL)) { gfxPrimitivesPolyIntsGlobal = gfxPrimitivesPolyInts; gfxPrimitivesPolyAllocatedGlobal = gfxPrimitivesPolyAllocated; } else { *polyInts = gfxPrimitivesPolyInts; *polyAllocated = gfxPrimitivesPolyAllocated; } /* * Check temp array again */ if (gfxPrimitivesPolyInts==NULL) { return(-1); } /* * Determine X,Y minima,maxima */ miny = vy[0]; maxy = vy[0]; minx = vx[0]; maxx = vx[0]; for (i = 1; (i < n); i++) { if (vy[i] < miny) { miny = vy[i]; } else if (vy[i] > maxy) { maxy = vy[i]; } if (vx[i] < minx) { minx = vx[i]; } else if (vx[i] > maxx) { maxx = vx[i]; } } if (maxx <0 || minx > dst->w){ return -1; } if (maxy <0 || miny > dst->h){ return -1; } /* * Draw, scanning y */ result = 0; for (y = miny; (y <= maxy); y++) { ints = 0; for (i = 0; (i < n); i++) { if (!i) { ind1 = n - 1; ind2 = 0; } else { ind1 = i - 1; ind2 = i; } y1 = vy[ind1]; y2 = vy[ind2]; if (y1 < y2) { x1 = vx[ind1]; x2 = vx[ind2]; } else if (y1 > y2) { y2 = vy[ind1]; y1 = vy[ind2]; x2 = vx[ind1]; x1 = vx[ind2]; } else { continue; } if ( ((y >= y1) && (y < y2)) || ((y == maxy) && (y > y1) && (y <= y2)) ) { gfxPrimitivesPolyInts[ints++] = ((65536 * (y - y1)) / (y2 - y1)) * (x2 - x1) + (65536 * x1); } } qsort(gfxPrimitivesPolyInts, ints, sizeof(int), _gfxPrimitivesCompareInt); for (i = 0; (i < ints); i += 2) { xa = gfxPrimitivesPolyInts[i] + 1; xa = (xa >> 16) + ((xa & 32768) >> 15); xb = gfxPrimitivesPolyInts[i+1] - 1; xb = (xb >> 16) + ((xb & 32768) >> 15); result |= _HLineTextured(dst, xa, xb, y, texture, texture_dx, texture_dy); } } return (result); } /*! \brief Draws a polygon filled with the given texture. This standard version is calling multithreaded versions with NULL cache parameters. \param dst the destination surface, \param vx array of x vector components \param vy array of x vector components \param n the amount of vectors in the vx and vy array \param texture the sdl surface to use to fill the polygon \param texture_dx the offset of the texture relative to the screeen. if you move the polygon 10 pixels to the left and want the texture to apear the same you need to increase the texture_dx value \param texture_dy see texture_dx \returns Returns 0 on success, -1 on failure. */ int texturedPolygon(SDL_Surface * dst, const Sint16 * vx, const Sint16 * vy, int n, SDL_Surface *texture, int texture_dx, int texture_dy) { /* * Draw */ return (texturedPolygonMT(dst, vx, vy, n, texture, texture_dx, texture_dy, NULL, NULL)); } /* For now, do not compile the font stuff, as it's not used by pygame. */ #if 0 /* ---- Character */ /*! \brief Global cache for NxM pixel font surfaces created at runtime. */ static SDL_Surface *gfxPrimitivesFont[256]; /*! \brief Global cache of the color used for the font surfaces created at runtime. */ static Uint32 gfxPrimitivesFontColor[256]; /*! \brief Pointer to the current font data. Default is a 8x8 pixel internal font. */ static const unsigned char *currentFontdata = gfxPrimitivesFontdata; /*! \brief Width of the current font. Default is 8. */ static Uint32 charWidth = 8; /*! \brief Height of the current font. Default is 8. */ static Uint32 charHeight = 8; /*! \brief Width for rendering. Autocalculated. */ static Uint32 charWidthLocal = 8; /*! \brief Height for rendering. Autocalculated. */ static Uint32 charHeightLocal = 8; /*! \brief Pitch of the current font in bytes. Default is 1. */ static Uint32 charPitch = 1; /*! \brief Characters 90deg clockwise rotations. Default is 0. Max is 3. */ static Uint32 charRotation = 0; /*! \brief Character data size in bytes of the current font. Default is 8. */ static Uint32 charSize = 8; /*! \brief Sets or resets the current global font data. The font data array is organized in follows: [fontdata] = [character 0][character 1]...[character 255] where [character n] = [byte 1 row 1][byte 2 row 1]...[byte {pitch} row 1][byte 1 row 2] ...[byte {pitch} row height] where [byte n] = [bit 0]...[bit 7] where [bit n] = [0 for transparent pixel|1 for colored pixel] \param fontdata Pointer to array of font data. Set to NULL, to reset global font to the default 8x8 font. \param cw Width of character in bytes. Ignored if fontdata==NULL. \param ch Height of character in bytes. Ignored if fontdata==NULL. */ void gfxPrimitivesSetFont(const void *fontdata, Uint32 cw, Uint32 ch) { int i; if ((fontdata) && (cw) && (ch)) { currentFontdata = fontdata; charWidth = cw; charHeight = ch; } else { currentFontdata = gfxPrimitivesFontdata; charWidth = 8; charHeight = 8; } charPitch = (charWidth+7)/8; charSize = charPitch * charHeight; /* Maybe flip width/height for rendering */ if ((charRotation==1) || (charRotation==3)) { charWidthLocal = charHeight; charHeightLocal = charWidth; } else { charWidthLocal = charWidth; charHeightLocal = charHeight; } /* Clear character cache */ for (i = 0; i < 256; i++) { if (gfxPrimitivesFont[i]) { SDL_FreeSurface(gfxPrimitivesFont[i]); gfxPrimitivesFont[i] = NULL; } } } /*! \brief Sets current global font character rotation steps. Default is 0 (no rotation). 1 = 90deg clockwise. 2 = 180deg clockwise. 3 = 270deg clockwise. Changing the rotation, will reset the character cache. \param rotation Number of 90deg clockwise steps to rotate */ void gfxPrimitivesSetFontRotation(Uint32 rotation) { int i; rotation = rotation & 3; if (charRotation != rotation) { /* Store rotation */ charRotation = rotation; /* Maybe flip width/height for rendering */ if ((charRotation==1) || (charRotation==3)) { charWidthLocal = charHeight; charHeightLocal = charWidth; } else { charWidthLocal = charWidth; charHeightLocal = charHeight; } /* Clear character cache */ for (i = 0; i < 256; i++) { if (gfxPrimitivesFont[i]) { SDL_FreeSurface(gfxPrimitivesFont[i]); gfxPrimitivesFont[i] = NULL; } } } } /*! \brief Draw a character of the currently set font. On first call for a particular character and color combination, the function needs to generate the character surface (slower. Subsequent calls blit a cached surface (fast). Uses alpha blending if A<255 in color. \param dst The surface to draw on. \param x X (horizontal) coordinate of the upper left corner of the character. \param y Y (vertical) coordinate of the upper left corner of the character. \param c The character to draw. \param color The color value of the character to draw (0xRRGGBBAA). \returns Returns 0 on success, -1 on failure. */ int characterColor(SDL_Surface * dst, Sint16 x, Sint16 y, char c, Uint32 color) { Sint16 left, right, top, bottom; Sint16 x1, y1, x2, y2; SDL_Rect srect; SDL_Rect drect; int result; Uint32 ix, iy; const unsigned char *charpos; Uint8 *curpos; int forced_redraw; Uint8 patt, mask; Uint8 *linepos; Uint32 pitch; SDL_Surface *rotatedCharacter; Uint32 ci; /* * Check visibility of clipping rectangle */ if ((dst->clip_rect.w==0) || (dst->clip_rect.h==0)) { return(0); } /* * Get text and clipping boundary and * test if bounding box of character is visible */ left = dst->clip_rect.x; x2 = x + charWidthLocal; if (x2clip_rect.x + dst->clip_rect.w - 1; x1 = x; if (x1>right) { return(0); } top = dst->clip_rect.y; y2 = y + charHeightLocal; if (y2clip_rect.y + dst->clip_rect.h - 1; y1 = y; if (y1>bottom) { return(0); } /* * Setup source rectangle */ srect.x = 0; srect.y = 0; srect.w = charWidthLocal; srect.h = charHeightLocal; /* * Setup destination rectangle */ drect.x = x; drect.y = y; drect.w = charWidthLocal; drect.h = charHeightLocal; /* Character index in cache */ ci = (unsigned char) c; /* * Create new charWidth x charHeight bitmap surface if not already present. * Might get rotated later. */ if (gfxPrimitivesFont[ci] == NULL) { gfxPrimitivesFont[ci] = SDL_CreateRGBSurface(SDL_SWSURFACE | SDL_SRCALPHA, charWidth, charHeight, 32, 0xFF000000, 0x00FF0000, 0x0000FF00, 0x000000FF); /* * Check pointer */ if (gfxPrimitivesFont[ci] == NULL) { return (-1); } /* * Definitely redraw */ forced_redraw = 1; } else { forced_redraw = 0; } /* * Check if color has changed */ if ((gfxPrimitivesFontColor[ci] != color) || (forced_redraw)) { /* * Redraw character */ SDL_SetAlpha(gfxPrimitivesFont[ci], SDL_SRCALPHA, 255); gfxPrimitivesFontColor[ci] = color; /* Lock font-surface */ if (SDL_LockSurface(gfxPrimitivesFont[ci]) != 0) return (-1); /* * Variable setup */ charpos = currentFontdata + ci * charSize; linepos = (Uint8 *) gfxPrimitivesFont[ci]->pixels; pitch = gfxPrimitivesFont[ci]->pitch; /* * Drawing loop */ patt = 0; for (iy = 0; iy < charHeight; iy++) { mask = 0x00; curpos = linepos; for (ix = 0; ix < charWidth; ix++) { if (!(mask >>= 1)) { patt = *charpos++; mask = 0x80; } if (patt & mask) *(Uint32 *)curpos = color; else *(Uint32 *)curpos = 0; curpos += 4; } linepos += pitch; } /* Unlock font-surface */ SDL_UnlockSurface(gfxPrimitivesFont[ci]); /* Maybe rotate and replace cached image */ if (charRotation>0) { // XXX: NOTE: To drop dependency on the rotateSurface90Degrees call. //rotatedCharacter = rotateSurface90Degrees(gfxPrimitivesFont[ci], charRotation); //SDL_FreeSurface(gfxPrimitivesFont[ci]); //gfxPrimitivesFont[ci] = rotatedCharacter; } } /* * Draw bitmap onto destination surface */ result = SDL_BlitSurface(gfxPrimitivesFont[ci], &srect, dst, &drect); return (result); } /*! \brief Draw a character of the currently set font. \param dst The surface to draw on. \param x X (horizontal) coordinate of the upper left corner of the character. \param y Y (vertical) coordinate of the upper left corner of the character. \param c The character to draw. \param r The red value of the character to draw. \param g The green value of the character to draw. \param b The blue value of the character to draw. \param a The alpha value of the character to draw. \returns Returns 0 on success, -1 on failure. */ int characterRGBA(SDL_Surface * dst, Sint16 x, Sint16 y, char c, Uint8 r, Uint8 g, Uint8 b, Uint8 a) { /* * Draw */ return (characterColor(dst, x, y, c, ((Uint32) r << 24) | ((Uint32) g << 16) | ((Uint32) b << 8) | (Uint32) a)); } /*! \brief Draw a string in the currently set font. The spacing between consequtive characters in the string is the fixed number of pixels of the character width of the current global font. \param dst The surface to draw on. \param x X (horizontal) coordinate of the upper left corner of the string. \param y Y (vertical) coordinate of the upper left corner of the string. \param s The string to draw. \param color The color value of the string to draw (0xRRGGBBAA). \returns Returns 0 on success, -1 on failure. */ int stringColor(SDL_Surface * dst, Sint16 x, Sint16 y, const char *s, Uint32 color) { int result = 0; Sint16 curx = x; Sint16 cury = y; const char *curchar = s; while (*curchar && !result) { result |= characterColor(dst, curx, cury, *curchar, color); switch (charRotation) { case 0: curx += charWidthLocal; break; case 2: curx -= charWidthLocal; break; case 1: cury += charHeightLocal; break; case 3: cury -= charHeightLocal; break; } curchar++; } return (result); } /*! \brief Draw a string in the currently set font. \param dst The surface to draw on. \param x X (horizontal) coordinate of the upper left corner of the string. \param y Y (vertical) coordinate of the upper left corner of the string. \param s The string to draw. \param r The red value of the string to draw. \param g The green value of the string to draw. \param b The blue value of the string to draw. \param a The alpha value of the string to draw. \returns Returns 0 on success, -1 on failure. */ int stringRGBA(SDL_Surface * dst, Sint16 x, Sint16 y, const char *s, Uint8 r, Uint8 g, Uint8 b, Uint8 a) { /* * Draw */ return (stringColor(dst, x, y, s, ((Uint32) r << 24) | ((Uint32) g << 16) | ((Uint32) b << 8) | (Uint32) a)); } #endif /* ---- Bezier curve */ /*! \brief Internal function to calculate bezier interpolator of data array with ndata values at position 't'. \param data Array of values. \param ndata Size of array. \param t Position for which to calculate interpolated value. t should be between [0, ndata]. \returns Interpolated value at position t, value[0] when t<0, value[n-1] when t>n. */ double _evaluateBezier (double *data, int ndata, double t) { double mu, result; int n,k,kn,nn,nkn; double blend,muk,munk; /* Sanity check bounds */ if (t<0.0) { return(data[0]); } if (t>=(double)ndata) { return(data[ndata-1]); } /* Adjust t to the range 0.0 to 1.0 */ mu=t/(double)ndata; /* Calculate interpolate */ n=ndata-1; result=0.0; muk = 1; munk = pow(1-mu,(double)n); for (k=0;k<=n;k++) { nn = n; kn = k; nkn = n - k; blend = muk * munk; muk *= mu; munk /= (1-mu); while (nn >= 1) { blend *= nn; nn--; if (kn > 1) { blend /= (double)kn; kn--; } if (nkn > 1) { blend /= (double)nkn; nkn--; } } result += data[k] * blend; } return (result); } /*! \brief Draw a bezier curve with alpha blending. \param dst The surface to draw on. \param vx Vertex array containing X coordinates of the points of the bezier curve. \param vy Vertex array containing Y coordinates of the points of the bezier curve. \param n Number of points in the vertex array. Minimum number is 3. \param s Number of steps for the interpolation. Minimum number is 2. \param color The color value of the bezier curve to draw (0xRRGGBBAA). \returns Returns 0 on success, -1 on failure. */ int bezierColor(SDL_Surface * dst, const Sint16 * vx, const Sint16 * vy, int n, int s, Uint32 color) { int result; int i; double *x, *y, t, stepsize; Sint16 x1, y1, x2, y2; /* * Sanity check */ if (n < 3) { return (-1); } if (s < 2) { return (-1); } /* * Variable setup */ stepsize=(double)1.0/(double)s; /* Transfer vertices into float arrays */ if ((x=(double *)malloc(sizeof(double)*(n+1)))==NULL) { return(-1); } if ((y=(double *)malloc(sizeof(double)*(n+1)))==NULL) { free(x); return(-1); } for (i=0; ix = x1; b->y = y1; /* dx = abs(x2-x1), s1 = sign(x2-x1) */ if ((b->dx = x2 - x1) != 0) { if (b->dx < 0) { b->dx = -b->dx; b->s1 = -1; } else { b->s1 = 1; } } else { b->s1 = 0; } /* dy = abs(y2-y1), s2 = sign(y2-y1) */ if ((b->dy = y2 - y1) != 0) { if (b->dy < 0) { b->dy = -b->dy; b->s2 = -1; } else { b->s2 = 1; } } else { b->s2 = 0; } if (b->dy > b->dx) { temp = b->dx; b->dx = b->dy; b->dy = temp; b->swapdir = 1; } else { b->swapdir = 0; } b->count = (b->dx<0) ? 0 : (unsigned int)b->dx; b->dy <<= 1; b->error = b->dy - b->dx; b->dx <<= 1; return(0); } /*! \brief Internal function to move Bresenham line iterator to the next position. Maybe updates the x and y coordinates of the iterator struct. \param b Pointer to struct for bresenham line drawing state. \returns Returns 0 on success, 1 if last point was reached, 2 if moving past end-of-line, -1 on failure. */ int _bresenhamIterate(SDL_gfxBresenhamIterator *b) { if (b==NULL) { return (-1); } /* last point check */ if (b->count==0) { return (2); } while (b->error >= 0) { if (b->swapdir) { b->x += b->s1; } else { b->y += b->s2; } b->error -= b->dx; } if (b->swapdir) { b->y += b->s2; } else { b->x += b->s1; } b->error += b->dy; b->count--; /* count==0 indicates "end-of-line" */ return ((b->count) ? 0 : 1); } /*! \brief Internal function to to draw parallel lines with Murphy algorithm. \param m Pointer to struct for murphy iterator. \param x X coordinate of point. \param y Y coordinate of point. \param d1 Direction square/diagonal. */ void _murphyParaline(SDL_gfxMurphyIterator *m, Sint16 x, Sint16 y, int d1) { int p; d1 = -d1; /* * Lock the surface */ if (SDL_MUSTLOCK(m->dst)) { SDL_LockSurface(m->dst); } for (p = 0; p <= m->u; p++) { pixelColorNolock(m->dst, x, y, m->color); if (d1 <= m->kt) { if (m->oct2 == 0) { x++; } else { if (m->quad4 == 0) { y++; } else { y--; } } d1 += m->kv; } else { x++; if (m->quad4 == 0) { y++; } else { y--; } d1 += m->kd; } } /* Unlock surface */ if (SDL_MUSTLOCK(m->dst)) { SDL_UnlockSurface(m->dst); } m->tempx = x; m->tempy = y; } /*! \brief Internal function to to draw one iteration of the Murphy algorithm. \param m Pointer to struct for murphy iterator. \param miter Iteration count. \param ml1bx X coordinate of a point. \param ml1by Y coordinate of a point. \param ml2bx X coordinate of a point. \param ml2by Y coordinate of a point. \param ml1x X coordinate of a point. \param ml1y Y coordinate of a point. \param ml2x X coordinate of a point. \param ml2y Y coordinate of a point. */ void _murphyIteration(SDL_gfxMurphyIterator *m, Uint8 miter, Uint16 ml1bx, Uint16 ml1by, Uint16 ml2bx, Uint16 ml2by, Uint16 ml1x, Uint16 ml1y, Uint16 ml2x, Uint16 ml2y) { int atemp1, atemp2; int ftmp1, ftmp2; Uint16 m1x, m1y, m2x, m2y; Uint16 fix, fiy, lax, lay, curx, cury; Uint16 px[4], py[4]; SDL_gfxBresenhamIterator b; if (miter > 1) { if (m->first1x != -32768) { fix = (m->first1x + m->first2x) / 2; fiy = (m->first1y + m->first2y) / 2; lax = (m->last1x + m->last2x) / 2; lay = (m->last1y + m->last2y) / 2; curx = (ml1x + ml2x) / 2; cury = (ml1y + ml2y) / 2; atemp1 = (fix - curx); atemp2 = (fiy - cury); ftmp1 = atemp1 * atemp1 + atemp2 * atemp2; atemp1 = (lax - curx); atemp2 = (lay - cury); ftmp2 = atemp1 * atemp1 + atemp2 * atemp2; if (ftmp1 <= ftmp2) { m1x = m->first1x; m1y = m->first1y; m2x = m->first2x; m2y = m->first2y; } else { m1x = m->last1x; m1y = m->last1y; m2x = m->last2x; m2y = m->last2y; } atemp1 = (m2x - ml2x); atemp2 = (m2y - ml2y); ftmp1 = atemp1 * atemp1 + atemp2 * atemp2; atemp1 = (m2x - ml2bx); atemp2 = (m2y - ml2by); ftmp2 = atemp1 * atemp1 + atemp2 * atemp2; if (ftmp2 >= ftmp1) { ftmp1 = ml2bx; ftmp2 = ml2by; ml2bx = ml2x; ml2by = ml2y; ml2x = ftmp1; ml2y = ftmp2; ftmp1 = ml1bx; ftmp2 = ml1by; ml1bx = ml1x; ml1by = ml1y; ml1x = ftmp1; ml1y = ftmp2; } /* * Lock the surface */ if (SDL_MUSTLOCK(m->dst)) { SDL_LockSurface(m->dst); } _bresenhamInitialize(&b, m2x, m2y, m1x, m1y); do { pixelColorNolock(m->dst, b.x, b.y, m->color); } while (_bresenhamIterate(&b)==0); _bresenhamInitialize(&b, m1x, m1y, ml1bx, ml1by); do { pixelColorNolock(m->dst, b.x, b.y, m->color); } while (_bresenhamIterate(&b)==0); _bresenhamInitialize(&b, ml1bx, ml1by, ml2bx, ml2by); do { pixelColorNolock(m->dst, b.x, b.y, m->color); } while (_bresenhamIterate(&b)==0); _bresenhamInitialize(&b, ml2bx, ml2by, m2x, m2y); do { pixelColorNolock(m->dst, b.x, b.y, m->color); } while (_bresenhamIterate(&b)==0); /* Unlock surface */ if (SDL_MUSTLOCK(m->dst)) { SDL_UnlockSurface(m->dst); } px[0] = m1x; px[1] = m2x; px[2] = ml1bx; px[3] = ml2bx; py[0] = m1y; py[1] = m2y; py[2] = ml1by; py[3] = ml2by; polygonColor(m->dst, px, py, 4, m->color); } } m->last1x = ml1x; m->last1y = ml1y; m->last2x = ml2x; m->last2y = ml2y; m->first1x = ml1bx; m->first1y = ml1by; m->first2x = ml2bx; m->first2y = ml2by; } #define HYPOT(x,y) sqrt((double)(x)*(double)(x)+(double)(y)*(double)(y)) /*! \brief Internal function to to draw wide lines with Murphy algorithm. Draws lines parallel to ideal line. \param m Pointer to struct for murphy iterator. \param x1 X coordinate of first point. \param y1 Y coordinate of first point. \param x2 X coordinate of second point. \param y2 Y coordinate of second point. \param width Width of line. \param miter Iteration count. */ void _murphyWideline(SDL_gfxMurphyIterator *m, Sint16 x1, Sint16 y1, Sint16 x2, Sint16 y2, Uint8 width, Uint8 miter) { float offset = (float)width / 2.f; Sint16 temp; Sint16 ptx, pty, ptxx, ptxy, ml1x, ml1y, ml2x, ml2y, ml1bx, ml1by, ml2bx, ml2by; int d0, d1; /* difference terms d0=perpendicular to line, d1=along line */ int q; /* pel counter,q=perpendicular to line */ int tmp; int dd; /* distance along line */ int tk; /* thickness threshold */ double ang; /* angle for initial point calculation */ double sang, cang; /* Initialisation */ m->u = x2 - x1; /* delta x */ m->v = y2 - y1; /* delta y */ if (m->u < 0) { /* swap to make sure we are in quadrants 1 or 4 */ temp = x1; x1 = x2; x2 = temp; temp = y1; y1 = y2; y2 = temp; m->u *= -1; m->v *= -1; } if (m->v < 0) { /* swap to 1st quadrant and flag */ m->v *= -1; m->quad4 = 1; } else { m->quad4 = 0; } if (m->v > m->u) { /* swap things if in 2 octant */ tmp = m->u; m->u = m->v; m->v = tmp; m->oct2 = 1; } else { m->oct2 = 0; } m->ku = m->u + m->u; /* change in l for square shift */ m->kv = m->v + m->v; /* change in d for square shift */ m->kd = m->kv - m->ku; /* change in d for diagonal shift */ m->kt = m->u - m->kv; /* diag/square decision threshold */ d0 = 0; d1 = 0; dd = 0; ang = atan((double) m->v / (double) m->u); /* calc new initial point - offset both sides of ideal */ sang = sin(ang); cang = cos(ang); if (m->oct2 == 0) { ptx = x1 + (Sint16)lrint(offset * sang); if (m->quad4 == 0) { pty = y1 - (Sint16)lrint(offset * cang); } else { pty = y1 + (Sint16)lrint(offset * cang); } } else { ptx = x1 - (Sint16)lrint(offset * cang); if (m->quad4 == 0) { pty = y1 + (Sint16)lrint(offset * sang); } else { pty = y1 - (Sint16)lrint(offset * sang); } } /* used here for constant thickness line */ tk = (int) (4. * HYPOT(ptx - x1, pty - y1) * HYPOT(m->u, m->v)); if (miter == 0) { m->first1x = -32768; m->first1y = -32768; m->first2x = -32768; m->first2y = -32768; m->last1x = -32768; m->last1y = -32768; m->last2x = -32768; m->last2y = -32768; } ptxx = ptx; ptxy = pty; for (q = 0; dd <= tk; q++) { /* outer loop, stepping perpendicular to line */ _murphyParaline(m, ptx, pty, d1); /* call to inner loop - right edge */ if (q == 0) { ml1x = ptx; ml1y = pty; ml1bx = m->tempx; ml1by = m->tempy; } else { ml2x = ptx; ml2y = pty; ml2bx = m->tempx; ml2by = m->tempy; } if (d0 < m->kt) { /* square move */ if (m->oct2 == 0) { if (m->quad4 == 0) { pty++; } else { pty--; } } else { ptx++; } } else { /* diagonal move */ dd += m->kv; d0 -= m->ku; if (d1 < m->kt) { /* normal diagonal */ if (m->oct2 == 0) { ptx--; if (m->quad4 == 0) { pty++; } else { pty--; } } else { ptx++; if (m->quad4 == 0) { pty--; } else { pty++; } } d1 += m->kv; } else { /* double square move, extra parallel line */ if (m->oct2 == 0) { ptx--; } else { if (m->quad4 == 0) { pty--; } else { pty++; } } d1 += m->kd; if (dd > tk) { _murphyIteration(m, miter, ml1bx, ml1by, ml2bx, ml2by, ml1x, ml1y, ml2x, ml2y); return; /* breakout on the extra line */ } _murphyParaline(m, ptx, pty, d1); if (m->oct2 == 0) { if (m->quad4 == 0) { pty++; } else { pty--; } } else { ptx++; } } } dd += m->ku; d0 += m->kv; } _murphyIteration(m, miter, ml1bx, ml1by, ml2bx, ml2by, ml1x, ml1y, ml2x, ml2y); } /*! \brief Draw a thick line with alpha blending. \param dst The surface to draw on. \param x1 X coordinate of the first point of the line. \param y1 Y coordinate of the first point of the line. \param x2 X coordinate of the second point of the line. \param y2 Y coordinate of the second point of the line. \param width Width of the line in pixels. Must be >0. \param color The color value of the line to draw (0xRRGGBBAA). \returns Returns 0 on success, -1 on failure. */ int thickLineColor(SDL_Surface * dst, Sint16 x1, Sint16 y1, Sint16 x2, Sint16 y2, Uint8 width, Uint32 color) { SDL_gfxMurphyIterator m; if (dst == NULL) return -1; if (width < 1) return -1; m.dst = dst; m.color = color; _murphyWideline(&m, x1, y1, x2, y2, width, 0); _murphyWideline(&m, x1, y1, x2, y2, width, 1); return(0); } /*! \brief Draw a thick line with alpha blending. \param dst The surface to draw on. \param x1 X coordinate of the first point of the line. \param y1 Y coordinate of the first point of the line. \param x2 X coordinate of the second point of the line. \param y2 Y coordinate of the second point of the line. \param width Width of the line in pixels. Must be >0. \param r The red value of the character to draw. \param g The green value of the character to draw. \param b The blue value of the character to draw. \param a The alpha value of the character to draw. \returns Returns 0 on success, -1 on failure. */ int thickLineRGBA(SDL_Surface * dst, Sint16 x1, Sint16 y1, Sint16 x2, Sint16 y2, Uint8 width, Uint8 r, Uint8 g, Uint8 b, Uint8 a) { return (thickLineColor(dst, x1, y1, x2, y2, width, ((Uint32) r << 24) | ((Uint32) g << 16) | ((Uint32) b << 8) | (Uint32) a)); } pygame_sdl2-2.1.0-for-renpy-6.99.14.1/src/SDL2_rotozoom.h0000644000175000017500000000567012513730173021672 0ustar tomtom00000000000000/* SDL2_rotozoom.c: rotozoomer, zoomer and shrinker for 32bit or 8bit surfaces Copyright (C) 2001-2012 Andreas Schiffler This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages arising from the use of this software. Permission is granted to anyone to use this software for any purpose, including commercial applications, and to alter it and redistribute it freely, subject to the following restrictions: 1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required. 2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software. 3. This notice may not be removed or altered from any source distribution. Andreas Schiffler -- aschiffler at ferzkopp dot net */ #ifndef _SDL2_rotozoom_h #define _SDL2_rotozoom_h #include /* Set up for C function definitions, even when using C++ */ #ifdef __cplusplus extern "C" { #endif #ifndef M_PI #define M_PI 3.1415926535897932384626433832795 #endif #include "SDL.h" /* ---- Defines */ /*! \brief Disable anti-aliasing (no smoothing). */ #define SMOOTHING_OFF 0 /*! \brief Enable anti-aliasing (smoothing). */ #define SMOOTHING_ON 1 /* ---- Function Prototypes */ #ifdef _MSC_VER # if defined(DLL_EXPORT) && !defined(LIBSDL2_GFX_DLL_IMPORT) # define SDL2_ROTOZOOM_SCOPE __declspec(dllexport) # else # ifdef LIBSDL2_GFX_DLL_IMPORT # define SDL2_ROTOZOOM_SCOPE __declspec(dllimport) # endif # endif #endif #ifndef SDL2_ROTOZOOM_SCOPE # define SDL2_ROTOZOOM_SCOPE extern #endif /* Rotozoom functions */ SDL2_ROTOZOOM_SCOPE SDL_Surface *rotozoomSurface(SDL_Surface * src, double angle, double zoom, int smooth); SDL2_ROTOZOOM_SCOPE SDL_Surface *rotozoomSurfaceXY (SDL_Surface * src, double angle, double zoomx, double zoomy, int smooth); SDL2_ROTOZOOM_SCOPE void rotozoomSurfaceSize(int width, int height, double angle, double zoom, int *dstwidth, int *dstheight); SDL2_ROTOZOOM_SCOPE void rotozoomSurfaceSizeXY (int width, int height, double angle, double zoomx, double zoomy, int *dstwidth, int *dstheight); /* Zooming functions */ SDL2_ROTOZOOM_SCOPE SDL_Surface *zoomSurface(SDL_Surface * src, double zoomx, double zoomy, int smooth); SDL2_ROTOZOOM_SCOPE void zoomSurfaceSize(int width, int height, double zoomx, double zoomy, int *dstwidth, int *dstheight); /* Shrinking functions */ SDL2_ROTOZOOM_SCOPE SDL_Surface *shrinkSurface(SDL_Surface * src, int factorx, int factory); /* Specialized rotation functions */ SDL2_ROTOZOOM_SCOPE SDL_Surface* rotateSurface90Degrees(SDL_Surface* src, int numClockwiseTurns); /* Ends C function definitions when using C++ */ #ifdef __cplusplus } #endif #endif /* _SDL2_rotozoom_h */ pygame_sdl2-2.1.0-for-renpy-6.99.14.1/src/surface.h0000664000175000017500000003257412501377724020661 0ustar tomtom00000000000000/* pygame - Python Game Library Copyright (C) 2000-2001 Pete Shinners Copyright (C) 2007 Marcus von Appen This library is free software; you can redistribute it and/or modify it under the terms of the GNU Library General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public License for more details. You should have received a copy of the GNU Library General Public License along with this library; if not, write to the Free Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA Pete Shinners pete@shinners.org */ #ifndef SURFACE_H #define SURFACE_H /* This is defined in SDL.h */ #if defined(_POSIX_C_SOURCE) #undef _POSIX_C_SOURCE #endif #include #define PYGAME_BLEND_ADD 0x1 #define PYGAME_BLEND_SUB 0x2 #define PYGAME_BLEND_MULT 0x3 #define PYGAME_BLEND_MIN 0x4 #define PYGAME_BLEND_MAX 0x5 #define PYGAME_BLEND_RGB_ADD 0x1 #define PYGAME_BLEND_RGB_SUB 0x2 #define PYGAME_BLEND_RGB_MULT 0x3 #define PYGAME_BLEND_RGB_MIN 0x4 #define PYGAME_BLEND_RGB_MAX 0x5 #define PYGAME_BLEND_RGBA_ADD 0x6 #define PYGAME_BLEND_RGBA_SUB 0x7 #define PYGAME_BLEND_RGBA_MULT 0x8 #define PYGAME_BLEND_RGBA_MIN 0x9 #define PYGAME_BLEND_RGBA_MAX 0x10 #define PYGAME_BLEND_PREMULTIPLIED 0x11 #if SDL_BYTEORDER == SDL_LIL_ENDIAN #define GET_PIXEL_24(b) (b[0] + (b[1] << 8) + (b[2] << 16)) #else #define GET_PIXEL_24(b) (b[2] + (b[1] << 8) + (b[0] << 16)) #endif #define GET_PIXEL(pxl, bpp, source) \ switch (bpp) \ { \ case 2: \ pxl = *((Uint16 *) (source)); \ break; \ case 4: \ pxl = *((Uint32 *) (source)); \ break; \ default: \ { \ Uint8 *b = (Uint8 *) source; \ pxl = GET_PIXEL_24(b); \ } \ break; \ } #define GET_PIXELVALS(_sR, _sG, _sB, _sA, px, fmt, ppa) \ _sR = ((px & fmt->Rmask) >> fmt->Rshift); \ _sR = (_sR << fmt->Rloss) + (_sR >> (8 - (fmt->Rloss << 1))); \ _sG = ((px & fmt->Gmask) >> fmt->Gshift); \ _sG = (_sG << fmt->Gloss) + (_sG >> (8 - (fmt->Gloss << 1))); \ _sB = ((px & fmt->Bmask) >> fmt->Bshift); \ _sB = (_sB << fmt->Bloss) + (_sB >> (8 - (fmt->Bloss << 1))); \ if (ppa) \ { \ _sA = ((px & fmt->Amask) >> fmt->Ashift); \ _sA = (_sA << fmt->Aloss) + (_sA >> (8 - (fmt->Aloss << 1))); \ } \ else \ { \ _sA = 255; \ } #define GET_PIXELVALS_1(sr, sg, sb, sa, _src, _fmt) \ sr = _fmt->palette->colors[*((Uint8 *) (_src))].r; \ sg = _fmt->palette->colors[*((Uint8 *) (_src))].g; \ sb = _fmt->palette->colors[*((Uint8 *) (_src))].b; \ sa = 255; #if SDL_BYTEORDER == SDL_LIL_ENDIAN #define SET_OFFSETS_24(or, og, ob, fmt) \ { \ or = (fmt->Rshift == 0 ? 0 : \ fmt->Rshift == 8 ? 1 : \ 2 ); \ og = (fmt->Gshift == 0 ? 0 : \ fmt->Gshift == 8 ? 1 : \ 2 ); \ ob = (fmt->Bshift == 0 ? 0 : \ fmt->Bshift == 8 ? 1 : \ 2 ); \ } #define SET_OFFSETS_32(or, og, ob, fmt) \ { \ or = (fmt->Rshift == 0 ? 0 : \ fmt->Rshift == 8 ? 1 : \ fmt->Rshift == 16 ? 2 : \ 3 ); \ og = (fmt->Gshift == 0 ? 0 : \ fmt->Gshift == 8 ? 1 : \ fmt->Gshift == 16 ? 2 : \ 3 ); \ ob = (fmt->Bshift == 0 ? 0 : \ fmt->Bshift == 8 ? 1 : \ fmt->Bshift == 16 ? 2 : \ 3 ); \ } #else #define SET_OFFSETS_24(or, og, ob, fmt) \ { \ or = (fmt->Rshift == 0 ? 2 : \ fmt->Rshift == 8 ? 1 : \ 0 ); \ og = (fmt->Gshift == 0 ? 2 : \ fmt->Gshift == 8 ? 1 : \ 0 ); \ ob = (fmt->Bshift == 0 ? 2 : \ fmt->Bshift == 8 ? 1 : \ 0 ); \ } #define SET_OFFSETS_32(or, og, ob, fmt) \ { \ or = (fmt->Rshift == 0 ? 3 : \ fmt->Rshift == 8 ? 2 : \ fmt->Rshift == 16 ? 1 : \ 0 ); \ og = (fmt->Gshift == 0 ? 3 : \ fmt->Gshift == 8 ? 2 : \ fmt->Gshift == 16 ? 1 : \ 0 ); \ ob = (fmt->Bshift == 0 ? 3 : \ fmt->Bshift == 8 ? 2 : \ fmt->Bshift == 16 ? 1 : \ 0 ); \ } #endif #define CREATE_PIXEL(buf, r, g, b, a, bp, ft) \ switch (bp) \ { \ case 2: \ *((Uint16 *) (buf)) = \ ((r >> ft->Rloss) << ft->Rshift) | \ ((g >> ft->Gloss) << ft->Gshift) | \ ((b >> ft->Bloss) << ft->Bshift) | \ ((a >> ft->Aloss) << ft->Ashift); \ break; \ case 4: \ *((Uint32 *) (buf)) = \ ((r >> ft->Rloss) << ft->Rshift) | \ ((g >> ft->Gloss) << ft->Gshift) | \ ((b >> ft->Bloss) << ft->Bshift) | \ ((a >> ft->Aloss) << ft->Ashift); \ break; \ } /* Pretty good idea from Tom Duff :-). */ #define LOOP_UNROLLED4(code, n, width) \ n = (width + 3) / 4; \ switch (width & 3) \ { \ case 0: do { code; \ case 3: code; \ case 2: code; \ case 1: code; \ } while (--n > 0); \ } /* Used in the srcbpp == dstbpp == 1 blend functions */ #define REPEAT_3(code) \ code; \ code; \ code; #define REPEAT_4(code) \ code; \ code; \ code; \ code; #define BLEND_ADD(tmp, sR, sG, sB, sA, dR, dG, dB, dA) \ tmp = dR + sR; dR = (tmp <= 255 ? tmp : 255); \ tmp = dG + sG; dG = (tmp <= 255 ? tmp : 255); \ tmp = dB + sB; dB = (tmp <= 255 ? tmp : 255); #define BLEND_SUB(tmp, sR, sG, sB, sA, dR, dG, dB, dA) \ tmp = dR - sR; dR = (tmp >= 0 ? tmp : 0); \ tmp = dG - sG; dG = (tmp >= 0 ? tmp : 0); \ tmp = dB - sB; dB = (tmp >= 0 ? tmp : 0); #define BLEND_MULT(sR, sG, sB, sA, dR, dG, dB, dA) \ dR = (dR && sR) ? (dR * sR) >> 8 : 0; \ dG = (dG && sG) ? (dG * sG) >> 8 : 0; \ dB = (dB && sB) ? (dB * sB) >> 8 : 0; #define BLEND_MIN(sR, sG, sB, sA, dR, dG, dB, dA) \ if(sR < dR) { dR = sR; } \ if(sG < dG) { dG = sG; } \ if(sB < dB) { dB = sB; } #define BLEND_MAX(sR, sG, sB, sA, dR, dG, dB, dA) \ if(sR > dR) { dR = sR; } \ if(sG > dG) { dG = sG; } \ if(sB > dB) { dB = sB; } #define BLEND_RGBA_ADD(tmp, sR, sG, sB, sA, dR, dG, dB, dA) \ tmp = dR + sR; dR = (tmp <= 255 ? tmp : 255); \ tmp = dG + sG; dG = (tmp <= 255 ? tmp : 255); \ tmp = dB + sB; dB = (tmp <= 255 ? tmp : 255); \ tmp = dA + sA; dA = (tmp <= 255 ? tmp : 255); #define BLEND_RGBA_SUB(tmp, sR, sG, sB, sA, dR, dG, dB, dA) \ tmp = dR - sR; dR = (tmp >= 0 ? tmp : 0); \ tmp = dG - sG; dG = (tmp >= 0 ? tmp : 0); \ tmp = dB - sB; dB = (tmp >= 0 ? tmp : 0); \ tmp = dA - sA; dA = (tmp >= 0 ? tmp : 0); #define BLEND_RGBA_MULT(sR, sG, sB, sA, dR, dG, dB, dA) \ dR = (dR && sR) ? (dR * sR) >> 8 : 0; \ dG = (dG && sG) ? (dG * sG) >> 8 : 0; \ dB = (dB && sB) ? (dB * sB) >> 8 : 0; \ dA = (dA && sA) ? (dA * sA) >> 8 : 0; #define BLEND_RGBA_MIN(sR, sG, sB, sA, dR, dG, dB, dA) \ if(sR < dR) { dR = sR; } \ if(sG < dG) { dG = sG; } \ if(sB < dB) { dB = sB; } \ if(sA < dA) { dA = sA; } #define BLEND_RGBA_MAX(sR, sG, sB, sA, dR, dG, dB, dA) \ if(sR > dR) { dR = sR; } \ if(sG > dG) { dG = sG; } \ if(sB > dB) { dB = sB; } \ if(sA > dA) { dA = sA; } #if 1 /* Choose an alpha blend equation. If the sign is preserved on a right shift * then use a specialized, faster, equation. Otherwise a more general form, * where all additions are done before the shift, is needed. */ #if (-1 >> 1) < 0 #define ALPHA_BLEND_COMP(sC, dC, sA) ((((sC - dC) * sA + sC) >> 8) + dC) #else #define ALPHA_BLEND_COMP(sC, dC, sA) (((dC << 8) + (sC - dC) * sA + sC) >> 8) #endif #define ALPHA_BLEND(sR, sG, sB, sA, dR, dG, dB, dA) \ do { \ if (dA) \ { \ dR = ALPHA_BLEND_COMP(sR, dR, sA); \ dG = ALPHA_BLEND_COMP(sG, dG, sA); \ dB = ALPHA_BLEND_COMP(sB, dB, sA); \ dA = sA + dA - ((sA * dA) / 255); \ } \ else \ { \ dR = sR; \ dG = sG; \ dB = sB; \ dA = sA; \ } \ } while(0) #define ALPHA_BLEND_PREMULTIPLIED_COMP(sC, dC, sA) (sC + dC - ((dC * sA) >> 8)) #define ALPHA_BLEND_PREMULTIPLIED(tmp, sR, sG, sB, sA, dR, dG, dB, dA) \ do { \ tmp = ALPHA_BLEND_PREMULTIPLIED_COMP(sR, dR, sA); dR = (tmp > 255 ? 255 : tmp); \ tmp = ALPHA_BLEND_PREMULTIPLIED_COMP(sG, dG, sA); dG = (tmp > 255 ? 255 : tmp); \ tmp = ALPHA_BLEND_PREMULTIPLIED_COMP(sB, dB, sA); dB = (tmp > 255 ? 255 : tmp); \ dA = sA + dA - ((sA * dA) / 255); \ } while(0) #elif 0 #define ALPHA_BLEND(sR, sG, sB, sA, dR, dG, dB, dA) \ do { \ if(sA){ \ if(dA && sA < 255){ \ int dContrib = dA*(255 - sA)/255; \ dA = sA+dA - ((sA*dA)/255); \ dR = (dR*dContrib + sR*sA)/dA; \ dG = (dG*dContrib + sG*sA)/dA; \ dB = (dB*dContrib + sB*sA)/dA; \ }else{ \ dR = sR; \ dG = sG; \ dB = sB; \ dA = sA; \ } \ } \ } while(0) #endif int surface_fill_blend (SDL_Surface *surface, SDL_Rect *rect, Uint32 color, int blendargs); void surface_respect_clip_rect (SDL_Surface *surface, SDL_Rect *rect); int pygame_AlphaBlit (SDL_Surface * src, SDL_Rect * srcrect, SDL_Surface * dst, SDL_Rect * dstrect, int the_args); int pygame_Blit (SDL_Surface * src, SDL_Rect * srcrect, SDL_Surface * dst, SDL_Rect * dstrect, int the_args); #endif /* SURFACE_H */ pygame_sdl2-2.1.0-for-renpy-6.99.14.1/src/SDL_gfxPrimitives.h0000664000175000017500000002353512513724350022562 0ustar tomtom00000000000000/* SDL_gfxPrimitives: graphics primitives for SDL LGPL (c) A. Schiffler */ #ifndef _SDL_gfxPrimitives_h #define _SDL_gfxPrimitives_h #include #ifndef M_PI #define M_PI 3.1415926535897932384626433832795 #endif #include "SDL.h" /* Set up for C function definitions, even when using C++ */ #ifdef __cplusplus extern "C" { #endif /* ----- Versioning */ #define SDL_GFXPRIMITIVES_MAJOR 2 #define SDL_GFXPRIMITIVES_MINOR 0 #define SDL_GFXPRIMITIVES_MICRO 23 /* ---- Function Prototypes */ #ifdef _MSC_VER # if defined(DLL_EXPORT) && !defined(LIBSDL_GFX_DLL_IMPORT) # define SDL_GFXPRIMITIVES_SCOPE __declspec(dllexport) # else # ifdef LIBSDL_GFX_DLL_IMPORT # define SDL_GFXPRIMITIVES_SCOPE __declspec(dllimport) # endif # endif #endif #ifndef SDL_GFXPRIMITIVES_SCOPE # define SDL_GFXPRIMITIVES_SCOPE extern #endif /* Note: all ___Color routines expect the color to be in format 0xRRGGBBAA */ /* Pixel */ SDL_GFXPRIMITIVES_SCOPE int pixelColor(SDL_Surface * dst, Sint16 x, Sint16 y, Uint32 color); SDL_GFXPRIMITIVES_SCOPE int pixelRGBA(SDL_Surface * dst, Sint16 x, Sint16 y, Uint8 r, Uint8 g, Uint8 b, Uint8 a); /* Horizontal line */ SDL_GFXPRIMITIVES_SCOPE int hlineColor(SDL_Surface * dst, Sint16 x1, Sint16 x2, Sint16 y, Uint32 color); SDL_GFXPRIMITIVES_SCOPE int hlineRGBA(SDL_Surface * dst, Sint16 x1, Sint16 x2, Sint16 y, Uint8 r, Uint8 g, Uint8 b, Uint8 a); /* Vertical line */ SDL_GFXPRIMITIVES_SCOPE int vlineColor(SDL_Surface * dst, Sint16 x, Sint16 y1, Sint16 y2, Uint32 color); SDL_GFXPRIMITIVES_SCOPE int vlineRGBA(SDL_Surface * dst, Sint16 x, Sint16 y1, Sint16 y2, Uint8 r, Uint8 g, Uint8 b, Uint8 a); /* Rectangle */ SDL_GFXPRIMITIVES_SCOPE int rectangleColor(SDL_Surface * dst, Sint16 x1, Sint16 y1, Sint16 x2, Sint16 y2, Uint32 color); SDL_GFXPRIMITIVES_SCOPE int rectangleRGBA(SDL_Surface * dst, Sint16 x1, Sint16 y1, Sint16 x2, Sint16 y2, Uint8 r, Uint8 g, Uint8 b, Uint8 a); /* Rounded-Corner Rectangle */ SDL_GFXPRIMITIVES_SCOPE int roundedRectangleColor(SDL_Surface * dst, Sint16 x1, Sint16 y1, Sint16 x2, Sint16 y2, Sint16 rad, Uint32 color); SDL_GFXPRIMITIVES_SCOPE int roundedRectangleRGBA(SDL_Surface * dst, Sint16 x1, Sint16 y1, Sint16 x2, Sint16 y2, Sint16 rad, Uint8 r, Uint8 g, Uint8 b, Uint8 a); /* Filled rectangle (Box) */ SDL_GFXPRIMITIVES_SCOPE int boxColor(SDL_Surface * dst, Sint16 x1, Sint16 y1, Sint16 x2, Sint16 y2, Uint32 color); SDL_GFXPRIMITIVES_SCOPE int boxRGBA(SDL_Surface * dst, Sint16 x1, Sint16 y1, Sint16 x2, Sint16 y2, Uint8 r, Uint8 g, Uint8 b, Uint8 a); /* Rounded-Corner Filled rectangle (Box) */ SDL_GFXPRIMITIVES_SCOPE int roundedBoxColor(SDL_Surface * dst, Sint16 x1, Sint16 y1, Sint16 x2, Sint16 y2, Sint16 rad, Uint32 color); SDL_GFXPRIMITIVES_SCOPE int roundedBoxRGBA(SDL_Surface * dst, Sint16 x1, Sint16 y1, Sint16 x2, Sint16 y2, Sint16 rad, Uint8 r, Uint8 g, Uint8 b, Uint8 a); /* Line */ SDL_GFXPRIMITIVES_SCOPE int lineColor(SDL_Surface * dst, Sint16 x1, Sint16 y1, Sint16 x2, Sint16 y2, Uint32 color); SDL_GFXPRIMITIVES_SCOPE int lineRGBA(SDL_Surface * dst, Sint16 x1, Sint16 y1, Sint16 x2, Sint16 y2, Uint8 r, Uint8 g, Uint8 b, Uint8 a); /* AA Line */ SDL_GFXPRIMITIVES_SCOPE int aalineColor(SDL_Surface * dst, Sint16 x1, Sint16 y1, Sint16 x2, Sint16 y2, Uint32 color); SDL_GFXPRIMITIVES_SCOPE int aalineRGBA(SDL_Surface * dst, Sint16 x1, Sint16 y1, Sint16 x2, Sint16 y2, Uint8 r, Uint8 g, Uint8 b, Uint8 a); /* Thick Line */ SDL_GFXPRIMITIVES_SCOPE int thickLineColor(SDL_Surface * dst, Sint16 x1, Sint16 y1, Sint16 x2, Sint16 y2, Uint8 width, Uint32 color); SDL_GFXPRIMITIVES_SCOPE int thickLineRGBA(SDL_Surface * dst, Sint16 x1, Sint16 y1, Sint16 x2, Sint16 y2, Uint8 width, Uint8 r, Uint8 g, Uint8 b, Uint8 a); /* Circle */ SDL_GFXPRIMITIVES_SCOPE int circleColor(SDL_Surface * dst, Sint16 x, Sint16 y, Sint16 rad, Uint32 color); SDL_GFXPRIMITIVES_SCOPE int circleRGBA(SDL_Surface * dst, Sint16 x, Sint16 y, Sint16 rad, Uint8 r, Uint8 g, Uint8 b, Uint8 a); /* Arc */ SDL_GFXPRIMITIVES_SCOPE int arcColor(SDL_Surface * dst, Sint16 x, Sint16 y, Sint16 rad, Sint16 start, Sint16 end, Uint32 color); SDL_GFXPRIMITIVES_SCOPE int arcRGBA(SDL_Surface * dst, Sint16 x, Sint16 y, Sint16 rad, Sint16 start, Sint16 end, Uint8 r, Uint8 g, Uint8 b, Uint8 a); /* AA Circle */ SDL_GFXPRIMITIVES_SCOPE int aacircleColor(SDL_Surface * dst, Sint16 x, Sint16 y, Sint16 rad, Uint32 color); SDL_GFXPRIMITIVES_SCOPE int aacircleRGBA(SDL_Surface * dst, Sint16 x, Sint16 y, Sint16 rad, Uint8 r, Uint8 g, Uint8 b, Uint8 a); /* Filled Circle */ SDL_GFXPRIMITIVES_SCOPE int filledCircleColor(SDL_Surface * dst, Sint16 x, Sint16 y, Sint16 r, Uint32 color); SDL_GFXPRIMITIVES_SCOPE int filledCircleRGBA(SDL_Surface * dst, Sint16 x, Sint16 y, Sint16 rad, Uint8 r, Uint8 g, Uint8 b, Uint8 a); /* Ellipse */ SDL_GFXPRIMITIVES_SCOPE int ellipseColor(SDL_Surface * dst, Sint16 x, Sint16 y, Sint16 rx, Sint16 ry, Uint32 color); SDL_GFXPRIMITIVES_SCOPE int ellipseRGBA(SDL_Surface * dst, Sint16 x, Sint16 y, Sint16 rx, Sint16 ry, Uint8 r, Uint8 g, Uint8 b, Uint8 a); /* AA Ellipse */ SDL_GFXPRIMITIVES_SCOPE int aaellipseColor(SDL_Surface * dst, Sint16 x, Sint16 y, Sint16 rx, Sint16 ry, Uint32 color); SDL_GFXPRIMITIVES_SCOPE int aaellipseRGBA(SDL_Surface * dst, Sint16 x, Sint16 y, Sint16 rx, Sint16 ry, Uint8 r, Uint8 g, Uint8 b, Uint8 a); /* Filled Ellipse */ SDL_GFXPRIMITIVES_SCOPE int filledEllipseColor(SDL_Surface * dst, Sint16 x, Sint16 y, Sint16 rx, Sint16 ry, Uint32 color); SDL_GFXPRIMITIVES_SCOPE int filledEllipseRGBA(SDL_Surface * dst, Sint16 x, Sint16 y, Sint16 rx, Sint16 ry, Uint8 r, Uint8 g, Uint8 b, Uint8 a); /* Pie */ SDL_GFXPRIMITIVES_SCOPE int pieColor(SDL_Surface * dst, Sint16 x, Sint16 y, Sint16 rad, Sint16 start, Sint16 end, Uint32 color); SDL_GFXPRIMITIVES_SCOPE int pieRGBA(SDL_Surface * dst, Sint16 x, Sint16 y, Sint16 rad, Sint16 start, Sint16 end, Uint8 r, Uint8 g, Uint8 b, Uint8 a); /* Filled Pie */ SDL_GFXPRIMITIVES_SCOPE int filledPieColor(SDL_Surface * dst, Sint16 x, Sint16 y, Sint16 rad, Sint16 start, Sint16 end, Uint32 color); SDL_GFXPRIMITIVES_SCOPE int filledPieRGBA(SDL_Surface * dst, Sint16 x, Sint16 y, Sint16 rad, Sint16 start, Sint16 end, Uint8 r, Uint8 g, Uint8 b, Uint8 a); /* Trigon */ SDL_GFXPRIMITIVES_SCOPE int trigonColor(SDL_Surface * dst, Sint16 x1, Sint16 y1, Sint16 x2, Sint16 y2, Sint16 x3, Sint16 y3, Uint32 color); SDL_GFXPRIMITIVES_SCOPE int trigonRGBA(SDL_Surface * dst, Sint16 x1, Sint16 y1, Sint16 x2, Sint16 y2, Sint16 x3, Sint16 y3, Uint8 r, Uint8 g, Uint8 b, Uint8 a); /* AA-Trigon */ SDL_GFXPRIMITIVES_SCOPE int aatrigonColor(SDL_Surface * dst, Sint16 x1, Sint16 y1, Sint16 x2, Sint16 y2, Sint16 x3, Sint16 y3, Uint32 color); SDL_GFXPRIMITIVES_SCOPE int aatrigonRGBA(SDL_Surface * dst, Sint16 x1, Sint16 y1, Sint16 x2, Sint16 y2, Sint16 x3, Sint16 y3, Uint8 r, Uint8 g, Uint8 b, Uint8 a); /* Filled Trigon */ SDL_GFXPRIMITIVES_SCOPE int filledTrigonColor(SDL_Surface * dst, Sint16 x1, Sint16 y1, Sint16 x2, Sint16 y2, Sint16 x3, Sint16 y3, Uint32 color); SDL_GFXPRIMITIVES_SCOPE int filledTrigonRGBA(SDL_Surface * dst, Sint16 x1, Sint16 y1, Sint16 x2, Sint16 y2, Sint16 x3, Sint16 y3, Uint8 r, Uint8 g, Uint8 b, Uint8 a); /* Polygon */ SDL_GFXPRIMITIVES_SCOPE int polygonColor(SDL_Surface * dst, const Sint16 * vx, const Sint16 * vy, int n, Uint32 color); SDL_GFXPRIMITIVES_SCOPE int polygonRGBA(SDL_Surface * dst, const Sint16 * vx, const Sint16 * vy, int n, Uint8 r, Uint8 g, Uint8 b, Uint8 a); /* AA-Polygon */ SDL_GFXPRIMITIVES_SCOPE int aapolygonColor(SDL_Surface * dst, const Sint16 * vx, const Sint16 * vy, int n, Uint32 color); SDL_GFXPRIMITIVES_SCOPE int aapolygonRGBA(SDL_Surface * dst, const Sint16 * vx, const Sint16 * vy, int n, Uint8 r, Uint8 g, Uint8 b, Uint8 a); /* Filled Polygon */ SDL_GFXPRIMITIVES_SCOPE int filledPolygonColor(SDL_Surface * dst, const Sint16 * vx, const Sint16 * vy, int n, Uint32 color); SDL_GFXPRIMITIVES_SCOPE int filledPolygonRGBA(SDL_Surface * dst, const Sint16 * vx, const Sint16 * vy, int n, Uint8 r, Uint8 g, Uint8 b, Uint8 a); SDL_GFXPRIMITIVES_SCOPE int texturedPolygon(SDL_Surface * dst, const Sint16 * vx, const Sint16 * vy, int n, SDL_Surface * texture,int texture_dx,int texture_dy); /* (Note: These MT versions are required for multi-threaded operation.) */ SDL_GFXPRIMITIVES_SCOPE int filledPolygonColorMT(SDL_Surface * dst, const Sint16 * vx, const Sint16 * vy, int n, Uint32 color, int **polyInts, int *polyAllocated); SDL_GFXPRIMITIVES_SCOPE int filledPolygonRGBAMT(SDL_Surface * dst, const Sint16 * vx, const Sint16 * vy, int n, Uint8 r, Uint8 g, Uint8 b, Uint8 a, int **polyInts, int *polyAllocated); SDL_GFXPRIMITIVES_SCOPE int texturedPolygonMT(SDL_Surface * dst, const Sint16 * vx, const Sint16 * vy, int n, SDL_Surface * texture,int texture_dx,int texture_dy, int **polyInts, int *polyAllocated); /* Bezier */ SDL_GFXPRIMITIVES_SCOPE int bezierColor(SDL_Surface * dst, const Sint16 * vx, const Sint16 * vy, int n, int s, Uint32 color); SDL_GFXPRIMITIVES_SCOPE int bezierRGBA(SDL_Surface * dst, const Sint16 * vx, const Sint16 * vy, int n, int s, Uint8 r, Uint8 g, Uint8 b, Uint8 a); /* Characters/Strings */ SDL_GFXPRIMITIVES_SCOPE void gfxPrimitivesSetFont(const void *fontdata, Uint32 cw, Uint32 ch); SDL_GFXPRIMITIVES_SCOPE void gfxPrimitivesSetFontRotation(Uint32 rotation); SDL_GFXPRIMITIVES_SCOPE int characterColor(SDL_Surface * dst, Sint16 x, Sint16 y, char c, Uint32 color); SDL_GFXPRIMITIVES_SCOPE int characterRGBA(SDL_Surface * dst, Sint16 x, Sint16 y, char c, Uint8 r, Uint8 g, Uint8 b, Uint8 a); SDL_GFXPRIMITIVES_SCOPE int stringColor(SDL_Surface * dst, Sint16 x, Sint16 y, const char *s, Uint32 color); SDL_GFXPRIMITIVES_SCOPE int stringRGBA(SDL_Surface * dst, Sint16 x, Sint16 y, const char *s, Uint8 r, Uint8 g, Uint8 b, Uint8 a); /* Ends C function definitions when using C++ */ #ifdef __cplusplus } #endif #endif /* _SDL_gfxPrimitives_h */ pygame_sdl2-2.1.0-for-renpy-6.99.14.1/src/SDL2_rotozoom.c0000644000175000017500000011724512513730173021667 0ustar tomtom00000000000000/* SDL2_rotozoom.c: rotozoomer, zoomer and shrinker for 32bit or 8bit surfaces Copyright (C) 2012 Andreas Schiffler This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages arising from the use of this software. Permission is granted to anyone to use this software for any purpose, including commercial applications, and to alter it and redistribute it freely, subject to the following restrictions: 1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required. 2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software. 3. This notice may not be removed or altered from any source distribution. Andreas Schiffler -- aschiffler at ferzkopp dot net */ #ifdef WIN32 #include #endif #include #include #include "SDL2_rotozoom.h" /* ---- Internally used structures */ /*! \brief A 32 bit RGBA pixel. */ typedef struct tColorRGBA { Uint8 r; Uint8 g; Uint8 b; Uint8 a; } tColorRGBA; /*! \brief A 8bit Y/palette pixel. */ typedef struct tColorY { Uint8 y; } tColorY; /*! \brief Returns maximum of two numbers a and b. */ #define MAX(a,b) (((a) > (b)) ? (a) : (b)) /*! \brief Number of guard rows added to destination surfaces. This is a simple but effective workaround for observed issues. These rows allocate extra memory and are then hidden from the surface. Rows are added to the end of destination surfaces when they are allocated. This catches any potential overflows which seem to happen with just the right src image dimensions and scale/rotation and can lead to a situation where the program can segfault. */ #define GUARD_ROWS (2) /*! \brief Lower limit of absolute zoom factor or rotation degrees. */ #define VALUE_LIMIT 0.001 /*! \brief Returns colorkey info for a surface */ Uint32 _colorkey(SDL_Surface *src) { Uint32 key = 0; SDL_GetColorKey(src, &key); return key; } /*! \brief Internal 32 bit integer-factor averaging Shrinker. Shrinks 32 bit RGBA/ABGR 'src' surface to 'dst' surface. Averages color and alpha values values of src pixels to calculate dst pixels. Assumes src and dst surfaces are of 32 bit depth. Assumes dst surface was allocated with the correct dimensions. \param src The surface to shrink (input). \param dst The shrunken surface (output). \param factorx The horizontal shrinking ratio. \param factory The vertical shrinking ratio. \return 0 for success or -1 for error. */ int _shrinkSurfaceRGBA(SDL_Surface * src, SDL_Surface * dst, int factorx, int factory) { int x, y, dx, dy, dgap, ra, ga, ba, aa; int n_average; tColorRGBA *sp, *osp, *oosp; tColorRGBA *dp; /* * Averaging integer shrink */ /* Precalculate division factor */ n_average = factorx*factory; /* * Scan destination */ sp = (tColorRGBA *) src->pixels; dp = (tColorRGBA *) dst->pixels; dgap = dst->pitch - dst->w * 4; for (y = 0; y < dst->h; y++) { osp=sp; for (x = 0; x < dst->w; x++) { /* Trace out source box and accumulate */ oosp=sp; ra=ga=ba=aa=0; for (dy=0; dy < factory; dy++) { for (dx=0; dx < factorx; dx++) { ra += sp->r; ga += sp->g; ba += sp->b; aa += sp->a; sp++; } /* src dx loop */ sp = (tColorRGBA *)((Uint8*)sp + (src->pitch - 4*factorx)); // next y } /* src dy loop */ /* next box-x */ sp = (tColorRGBA *)((Uint8*)oosp + 4*factorx); /* Store result in destination */ dp->r = ra/n_average; dp->g = ga/n_average; dp->b = ba/n_average; dp->a = aa/n_average; /* * Advance destination pointer */ dp++; } /* dst x loop */ /* next box-y */ sp = (tColorRGBA *)((Uint8*)osp + src->pitch*factory); /* * Advance destination pointers */ dp = (tColorRGBA *) ((Uint8 *) dp + dgap); } /* dst y loop */ return (0); } /*! \brief Internal 8 bit integer-factor averaging shrinker. Shrinks 8bit Y 'src' surface to 'dst' surface. Averages color (brightness) values values of src pixels to calculate dst pixels. Assumes src and dst surfaces are of 8 bit depth. Assumes dst surface was allocated with the correct dimensions. \param src The surface to shrink (input). \param dst The shrunken surface (output). \param factorx The horizontal shrinking ratio. \param factory The vertical shrinking ratio. \return 0 for success or -1 for error. */ int _shrinkSurfaceY(SDL_Surface * src, SDL_Surface * dst, int factorx, int factory) { int x, y, dx, dy, dgap, a; int n_average; Uint8 *sp, *osp, *oosp; Uint8 *dp; /* * Averaging integer shrink */ /* Precalculate division factor */ n_average = factorx*factory; /* * Scan destination */ sp = (Uint8 *) src->pixels; dp = (Uint8 *) dst->pixels; dgap = dst->pitch - dst->w; for (y = 0; y < dst->h; y++) { osp=sp; for (x = 0; x < dst->w; x++) { /* Trace out source box and accumulate */ oosp=sp; a=0; for (dy=0; dy < factory; dy++) { for (dx=0; dx < factorx; dx++) { a += (*sp); /* next x */ sp++; } /* end src dx loop */ /* next y */ sp = (Uint8 *)((Uint8*)sp + (src->pitch - factorx)); } /* end src dy loop */ /* next box-x */ sp = (Uint8 *)((Uint8*)oosp + factorx); /* Store result in destination */ *dp = a/n_average; /* * Advance destination pointer */ dp++; } /* end dst x loop */ /* next box-y */ sp = (Uint8 *)((Uint8*)osp + src->pitch*factory); /* * Advance destination pointers */ dp = (Uint8 *)((Uint8 *)dp + dgap); } /* end dst y loop */ return (0); } /*! \brief Internal 32 bit Zoomer with optional anti-aliasing by bilinear interpolation. Zooms 32 bit RGBA/ABGR 'src' surface to 'dst' surface. Assumes src and dst surfaces are of 32 bit depth. Assumes dst surface was allocated with the correct dimensions. \param src The surface to zoom (input). \param dst The zoomed surface (output). \param flipx Flag indicating if the image should be horizontally flipped. \param flipy Flag indicating if the image should be vertically flipped. \param smooth Antialiasing flag; set to SMOOTHING_ON to enable. \return 0 for success or -1 for error. */ int _zoomSurfaceRGBA(SDL_Surface * src, SDL_Surface * dst, int flipx, int flipy, int smooth) { int x, y, sx, sy, ssx, ssy, *sax, *say, *csax, *csay, *salast, csx, csy, ex, ey, cx, cy, sstep, sstepx, sstepy; tColorRGBA *c00, *c01, *c10, *c11; tColorRGBA *sp, *csp, *dp; int spixelgap, spixelw, spixelh, dgap, t1, t2; /* * Allocate memory for row/column increments */ if ((sax = (int *) malloc((dst->w + 1) * sizeof(Uint32))) == NULL) { return (-1); } if ((say = (int *) malloc((dst->h + 1) * sizeof(Uint32))) == NULL) { free(sax); return (-1); } /* * Precalculate row increments */ spixelw = (src->w - 1); spixelh = (src->h - 1); if (smooth) { sx = (int) (65536.0 * (float) spixelw / (float) (dst->w - 1)); sy = (int) (65536.0 * (float) spixelh / (float) (dst->h - 1)); } else { sx = (int) (65536.0 * (float) (src->w) / (float) (dst->w)); sy = (int) (65536.0 * (float) (src->h) / (float) (dst->h)); } /* Maximum scaled source size */ ssx = (src->w << 16) - 1; ssy = (src->h << 16) - 1; /* Precalculate horizontal row increments */ csx = 0; csax = sax; for (x = 0; x <= dst->w; x++) { *csax = csx; csax++; csx += sx; /* Guard from overflows */ if (csx > ssx) { csx = ssx; } } /* Precalculate vertical row increments */ csy = 0; csay = say; for (y = 0; y <= dst->h; y++) { *csay = csy; csay++; csy += sy; /* Guard from overflows */ if (csy > ssy) { csy = ssy; } } sp = (tColorRGBA *) src->pixels; dp = (tColorRGBA *) dst->pixels; dgap = dst->pitch - dst->w * 4; spixelgap = src->pitch/4; if (flipx) sp += spixelw; if (flipy) sp += (spixelgap * spixelh); /* * Switch between interpolating and non-interpolating code */ if (smooth) { /* * Interpolating Zoom */ csay = say; for (y = 0; y < dst->h; y++) { csp = sp; csax = sax; for (x = 0; x < dst->w; x++) { /* * Setup color source pointers */ ex = (*csax & 0xffff); ey = (*csay & 0xffff); cx = (*csax >> 16); cy = (*csay >> 16); sstepx = cx < spixelw; sstepy = cy < spixelh; c00 = sp; c01 = sp; c10 = sp; if (sstepy) { if (flipy) { c10 -= spixelgap; } else { c10 += spixelgap; } } c11 = c10; if (sstepx) { if (flipx) { c01--; c11--; } else { c01++; c11++; } } /* * Draw and interpolate colors */ t1 = ((((c01->r - c00->r) * ex) >> 16) + c00->r) & 0xff; t2 = ((((c11->r - c10->r) * ex) >> 16) + c10->r) & 0xff; dp->r = (((t2 - t1) * ey) >> 16) + t1; t1 = ((((c01->g - c00->g) * ex) >> 16) + c00->g) & 0xff; t2 = ((((c11->g - c10->g) * ex) >> 16) + c10->g) & 0xff; dp->g = (((t2 - t1) * ey) >> 16) + t1; t1 = ((((c01->b - c00->b) * ex) >> 16) + c00->b) & 0xff; t2 = ((((c11->b - c10->b) * ex) >> 16) + c10->b) & 0xff; dp->b = (((t2 - t1) * ey) >> 16) + t1; t1 = ((((c01->a - c00->a) * ex) >> 16) + c00->a) & 0xff; t2 = ((((c11->a - c10->a) * ex) >> 16) + c10->a) & 0xff; dp->a = (((t2 - t1) * ey) >> 16) + t1; /* * Advance source pointer x */ salast = csax; csax++; sstep = (*csax >> 16) - (*salast >> 16); if (flipx) { sp -= sstep; } else { sp += sstep; } /* * Advance destination pointer x */ dp++; } /* * Advance source pointer y */ salast = csay; csay++; sstep = (*csay >> 16) - (*salast >> 16); sstep *= spixelgap; if (flipy) { sp = csp - sstep; } else { sp = csp + sstep; } /* * Advance destination pointer y */ dp = (tColorRGBA *) ((Uint8 *) dp + dgap); } } else { /* * Non-Interpolating Zoom */ csay = say; for (y = 0; y < dst->h; y++) { csp = sp; csax = sax; for (x = 0; x < dst->w; x++) { /* * Draw */ *dp = *sp; /* * Advance source pointer x */ salast = csax; csax++; sstep = (*csax >> 16) - (*salast >> 16); if (flipx) sstep = -sstep; sp += sstep; /* * Advance destination pointer x */ dp++; } /* * Advance source pointer y */ salast = csay; csay++; sstep = (*csay >> 16) - (*salast >> 16); sstep *= spixelgap; if (flipy) sstep = -sstep; sp = csp + sstep; /* * Advance destination pointer y */ dp = (tColorRGBA *) ((Uint8 *) dp + dgap); } } /* * Remove temp arrays */ free(sax); free(say); return (0); } /*! \brief Internal 8 bit Zoomer without smoothing. Zooms 8bit palette/Y 'src' surface to 'dst' surface. Assumes src and dst surfaces are of 8 bit depth. Assumes dst surface was allocated with the correct dimensions. \param src The surface to zoom (input). \param dst The zoomed surface (output). \param flipx Flag indicating if the image should be horizontally flipped. \param flipy Flag indicating if the image should be vertically flipped. \return 0 for success or -1 for error. */ int _zoomSurfaceY(SDL_Surface * src, SDL_Surface * dst, int flipx, int flipy) { int x, y; Uint32 *sax, *say, *csax, *csay; int csx, csy; Uint8 *sp, *dp, *csp; int dgap; /* * Allocate memory for row increments */ if ((sax = (Uint32 *) malloc((dst->w + 1) * sizeof(Uint32))) == NULL) { return (-1); } if ((say = (Uint32 *) malloc((dst->h + 1) * sizeof(Uint32))) == NULL) { free(sax); return (-1); } /* * Pointer setup */ sp = csp = (Uint8 *) src->pixels; dp = (Uint8 *) dst->pixels; dgap = dst->pitch - dst->w; if (flipx) csp += (src->w-1); if (flipy) csp = ( (Uint8*)csp + src->pitch*(src->h-1) ); /* * Precalculate row increments */ csx = 0; csax = sax; for (x = 0; x < dst->w; x++) { csx += src->w; *csax = 0; while (csx >= dst->w) { csx -= dst->w; (*csax)++; } (*csax) = (*csax) * (flipx ? -1 : 1); csax++; } csy = 0; csay = say; for (y = 0; y < dst->h; y++) { csy += src->h; *csay = 0; while (csy >= dst->h) { csy -= dst->h; (*csay)++; } (*csay) = (*csay) * (flipy ? -1 : 1); csay++; } /* * Draw */ csay = say; for (y = 0; y < dst->h; y++) { csax = sax; sp = csp; for (x = 0; x < dst->w; x++) { /* * Draw */ *dp = *sp; /* * Advance source pointers */ sp += (*csax); csax++; /* * Advance destination pointer */ dp++; } /* * Advance source pointer (for row) */ csp += ((*csay) * src->pitch); csay++; /* * Advance destination pointers */ dp += dgap; } /* * Remove temp arrays */ free(sax); free(say); return (0); } /*! \brief Internal 32 bit rotozoomer with optional anti-aliasing. Rotates and zooms 32 bit RGBA/ABGR 'src' surface to 'dst' surface based on the control parameters by scanning the destination surface and applying optionally anti-aliasing by bilinear interpolation. Assumes src and dst surfaces are of 32 bit depth. Assumes dst surface was allocated with the correct dimensions. \param src Source surface. \param dst Destination surface. \param cx Horizontal center coordinate. \param cy Vertical center coordinate. \param isin Integer version of sine of angle. \param icos Integer version of cosine of angle. \param flipx Flag indicating horizontal mirroring should be applied. \param flipy Flag indicating vertical mirroring should be applied. \param smooth Flag indicating anti-aliasing should be used. */ void _transformSurfaceRGBA(SDL_Surface * src, SDL_Surface * dst, int cx, int cy, int isin, int icos, int flipx, int flipy, int smooth) { int x, y, t1, t2, dx, dy, xd, yd, sdx, sdy, ax, ay, ex, ey, sw, sh; tColorRGBA c00, c01, c10, c11, cswap; tColorRGBA *pc, *sp; int gap; /* * Variable setup */ xd = ((src->w - dst->w) << 15); yd = ((src->h - dst->h) << 15); ax = (cx << 16) - (icos * cx); ay = (cy << 16) - (isin * cx); sw = src->w - 1; sh = src->h - 1; pc = (tColorRGBA*) dst->pixels; gap = dst->pitch - dst->w * 4; /* * Switch between interpolating and non-interpolating code */ if (smooth) { for (y = 0; y < dst->h; y++) { dy = cy - y; sdx = (ax + (isin * dy)) + xd; sdy = (ay - (icos * dy)) + yd; for (x = 0; x < dst->w; x++) { dx = (sdx >> 16); dy = (sdy >> 16); if (flipx) dx = sw - dx; if (flipy) dy = sh - dy; if ((dx > -1) && (dy > -1) && (dx < (src->w-1)) && (dy < (src->h-1))) { sp = (tColorRGBA *)src->pixels;; sp += ((src->pitch/4) * dy); sp += dx; c00 = *sp; sp += 1; c01 = *sp; sp += (src->pitch/4); c11 = *sp; sp -= 1; c10 = *sp; if (flipx) { cswap = c00; c00=c01; c01=cswap; cswap = c10; c10=c11; c11=cswap; } if (flipy) { cswap = c00; c00=c10; c10=cswap; cswap = c01; c01=c11; c11=cswap; } /* * Interpolate colors */ ex = (sdx & 0xffff); ey = (sdy & 0xffff); t1 = ((((c01.r - c00.r) * ex) >> 16) + c00.r) & 0xff; t2 = ((((c11.r - c10.r) * ex) >> 16) + c10.r) & 0xff; pc->r = (((t2 - t1) * ey) >> 16) + t1; t1 = ((((c01.g - c00.g) * ex) >> 16) + c00.g) & 0xff; t2 = ((((c11.g - c10.g) * ex) >> 16) + c10.g) & 0xff; pc->g = (((t2 - t1) * ey) >> 16) + t1; t1 = ((((c01.b - c00.b) * ex) >> 16) + c00.b) & 0xff; t2 = ((((c11.b - c10.b) * ex) >> 16) + c10.b) & 0xff; pc->b = (((t2 - t1) * ey) >> 16) + t1; t1 = ((((c01.a - c00.a) * ex) >> 16) + c00.a) & 0xff; t2 = ((((c11.a - c10.a) * ex) >> 16) + c10.a) & 0xff; pc->a = (((t2 - t1) * ey) >> 16) + t1; } sdx += icos; sdy += isin; pc++; } pc = (tColorRGBA *) ((Uint8 *) pc + gap); } } else { for (y = 0; y < dst->h; y++) { dy = cy - y; sdx = (ax + (isin * dy)) + xd; sdy = (ay - (icos * dy)) + yd; for (x = 0; x < dst->w; x++) { dx = (short) (sdx >> 16); dy = (short) (sdy >> 16); if (flipx) dx = (src->w-1)-dx; if (flipy) dy = (src->h-1)-dy; if ((dx >= 0) && (dy >= 0) && (dx < src->w) && (dy < src->h)) { sp = (tColorRGBA *) ((Uint8 *) src->pixels + src->pitch * dy); sp += dx; *pc = *sp; } sdx += icos; sdy += isin; pc++; } pc = (tColorRGBA *) ((Uint8 *) pc + gap); } } } /*! \brief Rotates and zooms 8 bit palette/Y 'src' surface to 'dst' surface without smoothing. Rotates and zooms 8 bit RGBA/ABGR 'src' surface to 'dst' surface based on the control parameters by scanning the destination surface. Assumes src and dst surfaces are of 8 bit depth. Assumes dst surface was allocated with the correct dimensions. \param src Source surface. \param dst Destination surface. \param cx Horizontal center coordinate. \param cy Vertical center coordinate. \param isin Integer version of sine of angle. \param icos Integer version of cosine of angle. \param flipx Flag indicating horizontal mirroring should be applied. \param flipy Flag indicating vertical mirroring should be applied. */ void transformSurfaceY(SDL_Surface * src, SDL_Surface * dst, int cx, int cy, int isin, int icos, int flipx, int flipy) { int x, y, dx, dy, xd, yd, sdx, sdy, ax, ay; tColorY *pc, *sp; int gap; /* * Variable setup */ xd = ((src->w - dst->w) << 15); yd = ((src->h - dst->h) << 15); ax = (cx << 16) - (icos * cx); ay = (cy << 16) - (isin * cx); pc = (tColorY*) dst->pixels; gap = dst->pitch - dst->w; /* * Clear surface to colorkey */ memset(pc, (int)(_colorkey(src) & 0xff), dst->pitch * dst->h); /* * Iterate through destination surface */ for (y = 0; y < dst->h; y++) { dy = cy - y; sdx = (ax + (isin * dy)) + xd; sdy = (ay - (icos * dy)) + yd; for (x = 0; x < dst->w; x++) { dx = (short) (sdx >> 16); dy = (short) (sdy >> 16); if (flipx) dx = (src->w-1)-dx; if (flipy) dy = (src->h-1)-dy; if ((dx >= 0) && (dy >= 0) && (dx < src->w) && (dy < src->h)) { sp = (tColorY *) (src->pixels); sp += (src->pitch * dy + dx); *pc = *sp; } sdx += icos; sdy += isin; pc++; } pc += gap; } } /*! \brief Rotates a 8/16/24/32 bit surface in increments of 90 degrees. Specialized 90 degree rotator which rotates a 'src' surface in 90 degree increments clockwise returning a new surface. Faster than rotozoomer since no scanning or interpolation takes place. Input surface must be 8/16/24/32 bit. (code contributed by J. Schiller, improved by C. Allport and A. Schiffler) \param src Source surface to rotate. \param numClockwiseTurns Number of clockwise 90 degree turns to apply to the source. \returns The new, rotated surface; or NULL for surfaces with incorrect input format. */ SDL_Surface* rotateSurface90Degrees(SDL_Surface* src, int numClockwiseTurns) { int row, col, newWidth, newHeight; int bpp, bpr; SDL_Surface* dst; Uint8* srcBuf; Uint8* dstBuf; int normalizedClockwiseTurns; /* Has to be a valid surface pointer and be a Nbit surface where n is divisible by 8 */ if (!src || !src->format) { SDL_SetError("NULL source surface or source surface format"); return NULL; } if ((src->format->BitsPerPixel % 8) != 0) { SDL_SetError("Invalid source surface bit depth"); return NULL; } /* normalize numClockwiseTurns */ normalizedClockwiseTurns = (numClockwiseTurns % 4); if (normalizedClockwiseTurns < 0) { normalizedClockwiseTurns += 4; } /* If turns are even, our new width/height will be the same as the source surface */ if (normalizedClockwiseTurns % 2) { newWidth = src->h; newHeight = src->w; } else { newWidth = src->w; newHeight = src->h; } dst = SDL_CreateRGBSurface( src->flags, newWidth, newHeight, src->format->BitsPerPixel, src->format->Rmask, src->format->Gmask, src->format->Bmask, src->format->Amask); if(!dst) { SDL_SetError("Could not create destination surface"); return NULL; } if (SDL_MUSTLOCK(src)) { SDL_LockSurface(src); } if (SDL_MUSTLOCK(dst)) { SDL_LockSurface(dst); } /* Calculate byte-per-pixel */ bpp = src->format->BitsPerPixel / 8; switch(normalizedClockwiseTurns) { case 0: /* Make a copy of the surface */ { /* Unfortunately SDL_BlitSurface cannot be used to make a copy of the surface since it does not preserve alpha. */ if (src->pitch == dst->pitch) { /* If the pitch is the same for both surfaces, the memory can be copied all at once. */ memcpy(dst->pixels, src->pixels, (src->h * src->pitch)); } else { /* If the pitch differs, copy each row separately */ srcBuf = (Uint8*)(src->pixels); dstBuf = (Uint8*)(dst->pixels); bpr = src->w * bpp; for (row = 0; row < src->h; row++) { memcpy(dstBuf, srcBuf, bpr); srcBuf += src->pitch; dstBuf += dst->pitch; } } } break; /* rotate clockwise */ case 1: /* rotated 90 degrees clockwise */ { for (row = 0; row < src->h; ++row) { srcBuf = (Uint8*)(src->pixels) + (row * src->pitch); dstBuf = (Uint8*)(dst->pixels) + (dst->w - row - 1) * bpp; for (col = 0; col < src->w; ++col) { memcpy (dstBuf, srcBuf, bpp); srcBuf += bpp; dstBuf += dst->pitch; } } } break; case 2: /* rotated 180 degrees clockwise */ { for (row = 0; row < src->h; ++row) { srcBuf = (Uint8*)(src->pixels) + (row * src->pitch); dstBuf = (Uint8*)(dst->pixels) + ((dst->h - row - 1) * dst->pitch) + (dst->w - 1) * bpp; for (col = 0; col < src->w; ++col) { memcpy (dstBuf, srcBuf, bpp); srcBuf += bpp; dstBuf -= bpp; } } } break; case 3: /* rotated 270 degrees clockwise */ { for (row = 0; row < src->h; ++row) { srcBuf = (Uint8*)(src->pixels) + (row * src->pitch); dstBuf = (Uint8*)(dst->pixels) + (row * bpp) + (dst->h * dst->pitch); for (col = 0; col < src->w; ++col) { memcpy (dstBuf, srcBuf, bpp); srcBuf += bpp; dstBuf -= dst->pitch; } } } break; } /* end switch */ if (SDL_MUSTLOCK(src)) { SDL_UnlockSurface(src); } if (SDL_MUSTLOCK(dst)) { SDL_UnlockSurface(dst); } return dst; } /*! \brief Internal target surface sizing function for rotozooms with trig result return. \param width The source surface width. \param height The source surface height. \param angle The angle to rotate in degrees. \param zoomx The horizontal scaling factor. \param zoomy The vertical scaling factor. \param dstwidth The calculated width of the destination surface. \param dstheight The calculated height of the destination surface. \param canglezoom The sine of the angle adjusted by the zoom factor. \param sanglezoom The cosine of the angle adjusted by the zoom factor. */ void _rotozoomSurfaceSizeTrig(int width, int height, double angle, double zoomx, double zoomy, int *dstwidth, int *dstheight, double *canglezoom, double *sanglezoom) { double x, y, cx, cy, sx, sy; double radangle; int dstwidthhalf, dstheighthalf; /* * Determine destination width and height by rotating a centered source box */ radangle = angle * (M_PI / 180.0); *sanglezoom = sin(radangle); *canglezoom = cos(radangle); *sanglezoom *= zoomx; *canglezoom *= zoomx; x = (double)(width / 2); y = (double)(height / 2); cx = *canglezoom * x; cy = *canglezoom * y; sx = *sanglezoom * x; sy = *sanglezoom * y; dstwidthhalf = MAX((int) ceil(MAX(MAX(MAX(fabs(cx + sy), fabs(cx - sy)), fabs(-cx + sy)), fabs(-cx - sy))), 1); dstheighthalf = MAX((int) ceil(MAX(MAX(MAX(fabs(sx + cy), fabs(sx - cy)), fabs(-sx + cy)), fabs(-sx - cy))), 1); *dstwidth = 2 * dstwidthhalf; *dstheight = 2 * dstheighthalf; } /*! \brief Returns the size of the resulting target surface for a rotozoomSurfaceXY() call. \param width The source surface width. \param height The source surface height. \param angle The angle to rotate in degrees. \param zoomx The horizontal scaling factor. \param zoomy The vertical scaling factor. \param dstwidth The calculated width of the rotozoomed destination surface. \param dstheight The calculated height of the rotozoomed destination surface. */ void rotozoomSurfaceSizeXY(int width, int height, double angle, double zoomx, double zoomy, int *dstwidth, int *dstheight) { double dummy_sanglezoom, dummy_canglezoom; _rotozoomSurfaceSizeTrig(width, height, angle, zoomx, zoomy, dstwidth, dstheight, &dummy_sanglezoom, &dummy_canglezoom); } /*! \brief Returns the size of the resulting target surface for a rotozoomSurface() call. \param width The source surface width. \param height The source surface height. \param angle The angle to rotate in degrees. \param zoom The scaling factor. \param dstwidth The calculated width of the rotozoomed destination surface. \param dstheight The calculated height of the rotozoomed destination surface. */ void rotozoomSurfaceSize(int width, int height, double angle, double zoom, int *dstwidth, int *dstheight) { double dummy_sanglezoom, dummy_canglezoom; _rotozoomSurfaceSizeTrig(width, height, angle, zoom, zoom, dstwidth, dstheight, &dummy_sanglezoom, &dummy_canglezoom); } /*! \brief Rotates and zooms a surface and optional anti-aliasing. Rotates and zoomes a 32bit or 8bit 'src' surface to newly created 'dst' surface. 'angle' is the rotation in degrees and 'zoom' a scaling factor. If 'smooth' is set then the destination 32bit surface is anti-aliased. If the surface is not 8bit or 32bit RGBA/ABGR it will be converted into a 32bit RGBA format on the fly. \param src The surface to rotozoom. \param angle The angle to rotate in degrees. \param zoom The scaling factor. \param smooth Antialiasing flag; set to SMOOTHING_ON to enable. \return The new rotozoomed surface. */ SDL_Surface *rotozoomSurface(SDL_Surface * src, double angle, double zoom, int smooth) { return rotozoomSurfaceXY(src, angle, zoom, zoom, smooth); } /*! \brief Rotates and zooms a surface with different horizontal and vertival scaling factors and optional anti-aliasing. Rotates and zooms a 32bit or 8bit 'src' surface to newly created 'dst' surface. 'angle' is the rotation in degrees, 'zoomx and 'zoomy' scaling factors. If 'smooth' is set then the destination 32bit surface is anti-aliased. If the surface is not 8bit or 32bit RGBA/ABGR it will be converted into a 32bit RGBA format on the fly. \param src The surface to rotozoom. \param angle The angle to rotate in degrees. \param zoomx The horizontal scaling factor. \param zoomy The vertical scaling factor. \param smooth Antialiasing flag; set to SMOOTHING_ON to enable. \return The new rotozoomed surface. */ SDL_Surface *rotozoomSurfaceXY(SDL_Surface * src, double angle, double zoomx, double zoomy, int smooth) { SDL_Surface *rz_src; SDL_Surface *rz_dst; double zoominv; double sanglezoom, canglezoom, sanglezoominv, canglezoominv; int dstwidthhalf, dstwidth, dstheighthalf, dstheight; int is32bit; int i, src_converted; int flipx,flipy; /* * Sanity check */ if (src == NULL) { return (NULL); } /* * Determine if source surface is 32bit or 8bit */ is32bit = (src->format->BitsPerPixel == 32); if ((is32bit) || (src->format->BitsPerPixel == 8)) { /* * Use source surface 'as is' */ rz_src = src; src_converted = 0; } else { /* * New source surface is 32bit with a defined RGBA ordering */ rz_src = SDL_CreateRGBSurface(SDL_SWSURFACE, src->w, src->h, 32, #if SDL_BYTEORDER == SDL_LIL_ENDIAN 0x000000ff, 0x0000ff00, 0x00ff0000, 0xff000000 #else 0xff000000, 0x00ff0000, 0x0000ff00, 0x000000ff #endif ); SDL_BlitSurface(src, NULL, rz_src, NULL); src_converted = 1; is32bit = 1; } /* * Sanity check zoom factor */ flipx = (zoomx<0.0); if (flipx) zoomx=-zoomx; flipy = (zoomy<0.0); if (flipy) zoomy=-zoomy; if (zoomx < VALUE_LIMIT) zoomx = VALUE_LIMIT; if (zoomy < VALUE_LIMIT) zoomy = VALUE_LIMIT; zoominv = 65536.0 / (zoomx * zoomx); /* * Check if we have a rotozoom or just a zoom */ if (fabs(angle) > VALUE_LIMIT) { /* * Angle!=0: full rotozoom */ /* * ----------------------- */ /* Determine target size */ _rotozoomSurfaceSizeTrig(rz_src->w, rz_src->h, angle, zoomx, zoomy, &dstwidth, &dstheight, &canglezoom, &sanglezoom); /* * Calculate target factors from sin/cos and zoom */ sanglezoominv = sanglezoom; canglezoominv = canglezoom; sanglezoominv *= zoominv; canglezoominv *= zoominv; /* Calculate half size */ dstwidthhalf = dstwidth / 2; dstheighthalf = dstheight / 2; /* * Alloc space to completely contain the rotated surface */ rz_dst = NULL; if (is32bit) { /* * Target surface is 32bit with source RGBA/ABGR ordering */ rz_dst = SDL_CreateRGBSurface(SDL_SWSURFACE, dstwidth, dstheight + GUARD_ROWS, 32, rz_src->format->Rmask, rz_src->format->Gmask, rz_src->format->Bmask, rz_src->format->Amask); } else { /* * Target surface is 8bit */ rz_dst = SDL_CreateRGBSurface(SDL_SWSURFACE, dstwidth, dstheight + GUARD_ROWS, 8, 0, 0, 0, 0); } /* Check target */ if (rz_dst == NULL) return NULL; /* Adjust for guard rows */ rz_dst->h = dstheight; /* * Lock source surface */ if (SDL_MUSTLOCK(rz_src)) { SDL_LockSurface(rz_src); } /* * Check which kind of surface we have */ if (is32bit) { /* * Call the 32bit transformation routine to do the rotation (using alpha) */ _transformSurfaceRGBA(rz_src, rz_dst, dstwidthhalf, dstheighthalf, (int) (sanglezoominv), (int) (canglezoominv), flipx, flipy, smooth); } else { /* * Copy palette and colorkey info */ for (i = 0; i < rz_src->format->palette->ncolors; i++) { rz_dst->format->palette->colors[i] = rz_src->format->palette->colors[i]; } rz_dst->format->palette->ncolors = rz_src->format->palette->ncolors; /* * Call the 8bit transformation routine to do the rotation */ transformSurfaceY(rz_src, rz_dst, dstwidthhalf, dstheighthalf, (int) (sanglezoominv), (int) (canglezoominv), flipx, flipy); } /* * Unlock source surface */ if (SDL_MUSTLOCK(rz_src)) { SDL_UnlockSurface(rz_src); } } else { /* * Angle=0: Just a zoom */ /* * -------------------- */ /* * Calculate target size */ zoomSurfaceSize(rz_src->w, rz_src->h, zoomx, zoomy, &dstwidth, &dstheight); /* * Alloc space to completely contain the zoomed surface */ rz_dst = NULL; if (is32bit) { /* * Target surface is 32bit with source RGBA/ABGR ordering */ rz_dst = SDL_CreateRGBSurface(SDL_SWSURFACE, dstwidth, dstheight + GUARD_ROWS, 32, rz_src->format->Rmask, rz_src->format->Gmask, rz_src->format->Bmask, rz_src->format->Amask); } else { /* * Target surface is 8bit */ rz_dst = SDL_CreateRGBSurface(SDL_SWSURFACE, dstwidth, dstheight + GUARD_ROWS, 8, 0, 0, 0, 0); } /* Check target */ if (rz_dst == NULL) return NULL; /* Adjust for guard rows */ rz_dst->h = dstheight; /* * Lock source surface */ if (SDL_MUSTLOCK(rz_src)) { SDL_LockSurface(rz_src); } /* * Check which kind of surface we have */ if (is32bit) { /* * Call the 32bit transformation routine to do the zooming (using alpha) */ _zoomSurfaceRGBA(rz_src, rz_dst, flipx, flipy, smooth); } else { /* * Copy palette and colorkey info */ for (i = 0; i < rz_src->format->palette->ncolors; i++) { rz_dst->format->palette->colors[i] = rz_src->format->palette->colors[i]; } rz_dst->format->palette->ncolors = rz_src->format->palette->ncolors; /* * Call the 8bit transformation routine to do the zooming */ _zoomSurfaceY(rz_src, rz_dst, flipx, flipy); } /* * Unlock source surface */ if (SDL_MUSTLOCK(rz_src)) { SDL_UnlockSurface(rz_src); } } /* * Cleanup temp surface */ if (src_converted) { SDL_FreeSurface(rz_src); } /* * Return destination surface */ return (rz_dst); } /*! \brief Calculates the size of the target surface for a zoomSurface() call. The minimum size of the target surface is 1. The input factors can be positive or negative. \param width The width of the source surface to zoom. \param height The height of the source surface to zoom. \param zoomx The horizontal zoom factor. \param zoomy The vertical zoom factor. \param dstwidth Pointer to an integer to store the calculated width of the zoomed target surface. \param dstheight Pointer to an integer to store the calculated height of the zoomed target surface. */ void zoomSurfaceSize(int width, int height, double zoomx, double zoomy, int *dstwidth, int *dstheight) { /* * Make zoom factors positive */ int flipx, flipy; flipx = (zoomx<0.0); if (flipx) zoomx = -zoomx; flipy = (zoomy<0.0); if (flipy) zoomy = -zoomy; /* * Sanity check zoom factors */ if (zoomx < VALUE_LIMIT) { zoomx = VALUE_LIMIT; } if (zoomy < VALUE_LIMIT) { zoomy = VALUE_LIMIT; } /* * Calculate target size */ *dstwidth = (int) floor(((double) width * zoomx) + 0.5); *dstheight = (int) floor(((double) height * zoomy) + 0.5); if (*dstwidth < 1) { *dstwidth = 1; } if (*dstheight < 1) { *dstheight = 1; } } /*! \brief Zoom a surface by independent horizontal and vertical factors with optional smoothing. Zooms a 32bit or 8bit 'src' surface to newly created 'dst' surface. 'zoomx' and 'zoomy' are scaling factors for width and height. If 'smooth' is on then the destination 32bit surface is anti-aliased. If the surface is not 8bit or 32bit RGBA/ABGR it will be converted into a 32bit RGBA format on the fly. If zoom factors are negative, the image is flipped on the axes. \param src The surface to zoom. \param zoomx The horizontal zoom factor. \param zoomy The vertical zoom factor. \param smooth Antialiasing flag; set to SMOOTHING_ON to enable. \return The new, zoomed surface. */ SDL_Surface *zoomSurface(SDL_Surface * src, double zoomx, double zoomy, int smooth) { SDL_Surface *rz_src; SDL_Surface *rz_dst; int dstwidth, dstheight; int is32bit; int i, src_converted; int flipx, flipy; /* * Sanity check */ if (src == NULL) return (NULL); /* * Determine if source surface is 32bit or 8bit */ is32bit = (src->format->BitsPerPixel == 32); if ((is32bit) || (src->format->BitsPerPixel == 8)) { /* * Use source surface 'as is' */ rz_src = src; src_converted = 0; } else { /* * New source surface is 32bit with a defined RGBA ordering */ rz_src = SDL_CreateRGBSurface(SDL_SWSURFACE, src->w, src->h, 32, #if SDL_BYTEORDER == SDL_LIL_ENDIAN 0x000000ff, 0x0000ff00, 0x00ff0000, 0xff000000 #else 0xff000000, 0x00ff0000, 0x0000ff00, 0x000000ff #endif ); if (rz_src == NULL) { return NULL; } SDL_BlitSurface(src, NULL, rz_src, NULL); src_converted = 1; is32bit = 1; } flipx = (zoomx<0.0); if (flipx) zoomx = -zoomx; flipy = (zoomy<0.0); if (flipy) zoomy = -zoomy; /* Get size if target */ zoomSurfaceSize(rz_src->w, rz_src->h, zoomx, zoomy, &dstwidth, &dstheight); /* * Alloc space to completely contain the zoomed surface */ rz_dst = NULL; if (is32bit) { /* * Target surface is 32bit with source RGBA/ABGR ordering */ rz_dst = SDL_CreateRGBSurface(SDL_SWSURFACE, dstwidth, dstheight + GUARD_ROWS, 32, rz_src->format->Rmask, rz_src->format->Gmask, rz_src->format->Bmask, rz_src->format->Amask); } else { /* * Target surface is 8bit */ rz_dst = SDL_CreateRGBSurface(SDL_SWSURFACE, dstwidth, dstheight + GUARD_ROWS, 8, 0, 0, 0, 0); } /* Check target */ if (rz_dst == NULL) { /* * Cleanup temp surface */ if (src_converted) { SDL_FreeSurface(rz_src); } return NULL; } /* Adjust for guard rows */ rz_dst->h = dstheight; /* * Lock source surface */ if (SDL_MUSTLOCK(rz_src)) { SDL_LockSurface(rz_src); } /* * Check which kind of surface we have */ if (is32bit) { /* * Call the 32bit transformation routine to do the zooming (using alpha) */ _zoomSurfaceRGBA(rz_src, rz_dst, flipx, flipy, smooth); } else { /* * Copy palette and colorkey info */ for (i = 0; i < rz_src->format->palette->ncolors; i++) { rz_dst->format->palette->colors[i] = rz_src->format->palette->colors[i]; } rz_dst->format->palette->ncolors = rz_src->format->palette->ncolors; /* * Call the 8bit transformation routine to do the zooming */ _zoomSurfaceY(rz_src, rz_dst, flipx, flipy); } /* * Unlock source surface */ if (SDL_MUSTLOCK(rz_src)) { SDL_UnlockSurface(rz_src); } /* * Cleanup temp surface */ if (src_converted) { SDL_FreeSurface(rz_src); } /* * Return destination surface */ return (rz_dst); } /*! \brief Shrink a surface by an integer ratio using averaging. Shrinks a 32bit or 8bit 'src' surface to a newly created 'dst' surface. 'factorx' and 'factory' are the shrinking ratios (i.e. 2=1/2 the size, 3=1/3 the size, etc.) The destination surface is antialiased by averaging the source box RGBA or Y information. If the surface is not 8bit or 32bit RGBA/ABGR it will be converted into a 32bit RGBA format on the fly. The input surface is not modified. The output surface is newly allocated. \param src The surface to shrink. \param factorx The horizontal shrinking ratio. \param factory The vertical shrinking ratio. \return The new, shrunken surface. */ /*@null@*/ SDL_Surface *shrinkSurface(SDL_Surface *src, int factorx, int factory) { int result; SDL_Surface *rz_src; SDL_Surface *rz_dst = NULL; int dstwidth, dstheight; int is32bit; int i, src_converted; int haveError = 0; /* * Sanity check */ if (src == NULL) { return (NULL); } /* * Determine if source surface is 32bit or 8bit */ is32bit = (src->format->BitsPerPixel == 32); if ((is32bit) || (src->format->BitsPerPixel == 8)) { /* * Use source surface 'as is' */ rz_src = src; src_converted = 0; } else { /* * New source surface is 32bit with a defined RGBA ordering */ rz_src = SDL_CreateRGBSurface(SDL_SWSURFACE, src->w, src->h, 32, #if SDL_BYTEORDER == SDL_LIL_ENDIAN 0x000000ff, 0x0000ff00, 0x00ff0000, 0xff000000 #else 0xff000000, 0x00ff0000, 0x0000ff00, 0x000000ff #endif ); if (rz_src==NULL) { haveError = 1; goto exitShrinkSurface; } SDL_BlitSurface(src, NULL, rz_src, NULL); src_converted = 1; is32bit = 1; } /* * Lock the surface */ if (SDL_MUSTLOCK(rz_src)) { if (SDL_LockSurface(rz_src) < 0) { haveError = 1; goto exitShrinkSurface; } } /* Get size for target */ dstwidth=rz_src->w/factorx; while (dstwidth*factorx>rz_src->w) { dstwidth--; } dstheight=rz_src->h/factory; while (dstheight*factory>rz_src->h) { dstheight--; } /* * Alloc space to completely contain the shrunken surface * (with added guard rows) */ if (is32bit==1) { /* * Target surface is 32bit with source RGBA/ABGR ordering */ rz_dst = SDL_CreateRGBSurface(SDL_SWSURFACE, dstwidth, dstheight + GUARD_ROWS, 32, rz_src->format->Rmask, rz_src->format->Gmask, rz_src->format->Bmask, rz_src->format->Amask); } else { /* * Target surface is 8bit */ rz_dst = SDL_CreateRGBSurface(SDL_SWSURFACE, dstwidth, dstheight + GUARD_ROWS, 8, 0, 0, 0, 0); } /* Check target */ if (rz_dst == NULL) { haveError = 1; goto exitShrinkSurface; } /* Adjust for guard rows */ rz_dst->h = dstheight; /* * Check which kind of surface we have */ if (is32bit==1) { /* * Call the 32bit transformation routine to do the shrinking (using alpha) */ result = _shrinkSurfaceRGBA(rz_src, rz_dst, factorx, factory); if ((result!=0) || (rz_dst==NULL)) { haveError = 1; goto exitShrinkSurface; } } else { /* * Copy palette and colorkey info */ for (i = 0; i < rz_src->format->palette->ncolors; i++) { rz_dst->format->palette->colors[i] = rz_src->format->palette->colors[i]; } rz_dst->format->palette->ncolors = rz_src->format->palette->ncolors; /* * Call the 8bit transformation routine to do the shrinking */ result = _shrinkSurfaceY(rz_src, rz_dst, factorx, factory); if (result!=0) { haveError = 1; goto exitShrinkSurface; } } exitShrinkSurface: if (rz_src!=NULL) { /* * Unlock source surface */ if (SDL_MUSTLOCK(rz_src)) { SDL_UnlockSurface(rz_src); } /* * Cleanup temp surface */ if (src_converted==1) { SDL_FreeSurface(rz_src); } } /* Check error state; maybe need to cleanup destination */ if (haveError==1) { if (rz_dst!=NULL) { SDL_FreeSurface(rz_dst); } rz_dst=NULL; } /* * Return destination surface */ return (rz_dst); } pygame_sdl2-2.1.0-for-renpy-6.99.14.1/pygame_sdl2.egg-info/0000755000175000017500000000000013235720531022145 5ustar tomtom00000000000000pygame_sdl2-2.1.0-for-renpy-6.99.14.1/pygame_sdl2.egg-info/PKG-INFO0000664000175000017500000000043113235720531023242 0ustar tomtom00000000000000Metadata-Version: 1.0 Name: pygame-sdl2 Version: 2.1.0-for-renpy-6.99.14.1 Summary: UNKNOWN Home-page: https://github.com/renpy/pygame_sdl2 Author: Tom Rothamel Author-email: tom@rothamel.us License: UNKNOWN Description-Content-Type: UNKNOWN Description: UNKNOWN Platform: UNKNOWN pygame_sdl2-2.1.0-for-renpy-6.99.14.1/pygame_sdl2.egg-info/top_level.txt0000664000175000017500000000001413235720531024674 0ustar tomtom00000000000000pygame_sdl2 pygame_sdl2-2.1.0-for-renpy-6.99.14.1/pygame_sdl2.egg-info/dependency_links.txt0000664000175000017500000000000113235720531026215 0ustar tomtom00000000000000 pygame_sdl2-2.1.0-for-renpy-6.99.14.1/pygame_sdl2.egg-info/SOURCES.txt0000664000175000017500000000570713235720531024044 0ustar tomtom00000000000000COPYING.LGPL21 COPYING.ZLIB MANIFEST.in README.rst fix_virtualenv.py setup.py setuplib.py gen/pygame_sdl2.color.c gen/pygame_sdl2.controller.c gen/pygame_sdl2.display.c gen/pygame_sdl2.draw.c gen/pygame_sdl2.error.c gen/pygame_sdl2.event.c gen/pygame_sdl2.font.c gen/pygame_sdl2.gfxdraw.c gen/pygame_sdl2.image.c gen/pygame_sdl2.joystick.c gen/pygame_sdl2.key.c gen/pygame_sdl2.locals.c gen/pygame_sdl2.mixer.c gen/pygame_sdl2.mixer_music.c gen/pygame_sdl2.mouse.c gen/pygame_sdl2.power.c gen/pygame_sdl2.pygame_time.c gen/pygame_sdl2.rect.c gen/pygame_sdl2.render.c gen/pygame_sdl2.rwobject.c gen/pygame_sdl2.scrap.c gen/pygame_sdl2.surface.c gen/pygame_sdl2.transform.c gen3/pygame_sdl2.color.c gen3/pygame_sdl2.controller.c gen3/pygame_sdl2.display.c gen3/pygame_sdl2.draw.c gen3/pygame_sdl2.error.c gen3/pygame_sdl2.event.c gen3/pygame_sdl2.font.c gen3/pygame_sdl2.gfxdraw.c gen3/pygame_sdl2.image.c gen3/pygame_sdl2.joystick.c gen3/pygame_sdl2.key.c gen3/pygame_sdl2.locals.c gen3/pygame_sdl2.mixer.c gen3/pygame_sdl2.mixer_music.c gen3/pygame_sdl2.mouse.c gen3/pygame_sdl2.power.c gen3/pygame_sdl2.pygame_time.c gen3/pygame_sdl2.rect.c gen3/pygame_sdl2.render.c gen3/pygame_sdl2.rwobject.c gen3/pygame_sdl2.scrap.c gen3/pygame_sdl2.surface.c gen3/pygame_sdl2.transform.c include/color_dict.pxi include/controller.pxi include/event_enum.pxi include/event_list.pxi include/event_names.pxi include/glattr.pxi include/keycode_list.pxi include/sdl2.pxd include/sdl2_gfx.pxd include/sdl2_image.pxd include/sdl2_mixer.pxd include/sdl2_ttf.pxd pygame_sdl2.egg-info/PKG-INFO pygame_sdl2.egg-info/SOURCES.txt pygame_sdl2.egg-info/dependency_links.txt pygame_sdl2.egg-info/not-zip-safe pygame_sdl2.egg-info/top_level.txt src/SDL2_rotozoom.c src/SDL2_rotozoom.h src/SDL_gfxPrimitives.c src/SDL_gfxPrimitives.h src/SDL_gfxPrimitives_font.h src/alphablit.c src/surface.h src/write_jpeg.c src/write_jpeg.h src/write_png.c src/write_png.h src/pygame_sdl2/DejaVuSans.ttf src/pygame_sdl2/DejaVuSans.txt src/pygame_sdl2/__init__.py src/pygame_sdl2/color.pxd src/pygame_sdl2/color.pyx src/pygame_sdl2/compat.py src/pygame_sdl2/controller.pyx src/pygame_sdl2/display.pxd src/pygame_sdl2/display.pyx src/pygame_sdl2/draw.pyx src/pygame_sdl2/error.pyx src/pygame_sdl2/event.pyx src/pygame_sdl2/font.pyx src/pygame_sdl2/gfxdraw.pyx src/pygame_sdl2/image.pyx src/pygame_sdl2/joystick.pyx src/pygame_sdl2/key.pyx src/pygame_sdl2/locals.pyx src/pygame_sdl2/mixer.pyx src/pygame_sdl2/mixer_music.pyx src/pygame_sdl2/mouse.pyx src/pygame_sdl2/power.pyx src/pygame_sdl2/pygame_sdl2.h src/pygame_sdl2/pygame_time.pyx src/pygame_sdl2/rect.pxd src/pygame_sdl2/rect.pyx src/pygame_sdl2/render.pyx src/pygame_sdl2/rwobject.pxd src/pygame_sdl2/rwobject.pyx src/pygame_sdl2/scrap.pyx src/pygame_sdl2/sprite.py src/pygame_sdl2/surface.pxd src/pygame_sdl2/surface.pyx src/pygame_sdl2/sysfont.py src/pygame_sdl2/time.py src/pygame_sdl2/transform.pyx src/pygame_sdl2/version.py src/pygame_sdl2/threads/Py25Queue.py src/pygame_sdl2/threads/__init__.pypygame_sdl2-2.1.0-for-renpy-6.99.14.1/pygame_sdl2.egg-info/not-zip-safe0000664000175000017500000000000112651015052024371 0ustar tomtom00000000000000 pygame_sdl2-2.1.0-for-renpy-6.99.14.1/COPYING.LGPL210000644000175000017500000006347612431262574020225 0ustar tomtom00000000000000 GNU LESSER GENERAL PUBLIC LICENSE Version 2.1, February 1999 Copyright (C) 1991, 1999 Free Software Foundation, Inc. 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA Everyone is permitted to copy and distribute verbatim copies of this license document, but changing it is not allowed. [This is the first released version of the Lesser GPL. It also counts as the successor of the GNU Library Public License, version 2, hence the version number 2.1.] Preamble The licenses for most software are designed to take away your freedom to share and change it. By contrast, the GNU General Public Licenses are intended to guarantee your freedom to share and change free software--to make sure the software is free for all its users. This license, the Lesser General Public License, applies to some specially designated software packages--typically libraries--of the Free Software Foundation and other authors who decide to use it. You can use it too, but we suggest you first think carefully about whether this license or the ordinary General Public License is the better strategy to use in any particular case, based on the explanations below. When we speak of free software, we are referring to freedom of use, not price. Our General Public Licenses are designed to make sure that you have the freedom to distribute copies of free software (and charge for this service if you wish); that you receive source code or can get it if you want it; that you can change the software and use pieces of it in new free programs; and that you are informed that you can do these things. To protect your rights, we need to make restrictions that forbid distributors to deny you these rights or to ask you to surrender these rights. These restrictions translate to certain responsibilities for you if you distribute copies of the library or if you modify it. For example, if you distribute copies of the library, whether gratis or for a fee, you must give the recipients all the rights that we gave you. You must make sure that they, too, receive or can get the source code. If you link other code with the library, you must provide complete object files to the recipients, so that they can relink them with the library after making changes to the library and recompiling it. And you must show them these terms so they know their rights. We protect your rights with a two-step method: (1) we copyright the library, and (2) we offer you this license, which gives you legal permission to copy, distribute and/or modify the library. To protect each distributor, we want to make it very clear that there is no warranty for the free library. Also, if the library is modified by someone else and passed on, the recipients should know that what they have is not the original version, so that the original author's reputation will not be affected by problems that might be introduced by others. Finally, software patents pose a constant threat to the existence of any free program. We wish to make sure that a company cannot effectively restrict the users of a free program by obtaining a restrictive license from a patent holder. Therefore, we insist that any patent license obtained for a version of the library must be consistent with the full freedom of use specified in this license. Most GNU software, including some libraries, is covered by the ordinary GNU General Public License. This license, the GNU Lesser General Public License, applies to certain designated libraries, and is quite different from the ordinary General Public License. We use this license for certain libraries in order to permit linking those libraries into non-free programs. When a program is linked with a library, whether statically or using a shared library, the combination of the two is legally speaking a combined work, a derivative of the original library. The ordinary General Public License therefore permits such linking only if the entire combination fits its criteria of freedom. The Lesser General Public License permits more lax criteria for linking other code with the library. We call this license the "Lesser" General Public License because it does Less to protect the user's freedom than the ordinary General Public License. It also provides other free software developers Less of an advantage over competing non-free programs. These disadvantages are the reason we use the ordinary General Public License for many libraries. However, the Lesser license provides advantages in certain special circumstances. For example, on rare occasions, there may be a special need to encourage the widest possible use of a certain library, so that it becomes a de-facto standard. To achieve this, non-free programs must be allowed to use the library. A more frequent case is that a free library does the same job as widely used non-free libraries. In this case, there is little to gain by limiting the free library to free software only, so we use the Lesser General Public License. In other cases, permission to use a particular library in non-free programs enables a greater number of people to use a large body of free software. For example, permission to use the GNU C Library in non-free programs enables many more people to use the whole GNU operating system, as well as its variant, the GNU/Linux operating system. Although the Lesser General Public License is Less protective of the users' freedom, it does ensure that the user of a program that is linked with the Library has the freedom and the wherewithal to run that program using a modified version of the Library. The precise terms and conditions for copying, distribution and modification follow. Pay close attention to the difference between a "work based on the library" and a "work that uses the library". The former contains code derived from the library, whereas the latter must be combined with the library in order to run. GNU LESSER GENERAL PUBLIC LICENSE TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION 0. This License Agreement applies to any software library or other program which contains a notice placed by the copyright holder or other authorized party saying it may be distributed under the terms of this Lesser General Public License (also called "this License"). Each licensee is addressed as "you". A "library" means a collection of software functions and/or data prepared so as to be conveniently linked with application programs (which use some of those functions and data) to form executables. The "Library", below, refers to any such software library or work which has been distributed under these terms. A "work based on the Library" means either the Library or any derivative work under copyright law: that is to say, a work containing the Library or a portion of it, either verbatim or with modifications and/or translated straightforwardly into another language. (Hereinafter, translation is included without limitation in the term "modification".) "Source code" for a work means the preferred form of the work for making modifications to it. For a library, complete source code means all the source code for all modules it contains, plus any associated interface definition files, plus the scripts used to control compilation and installation of the library. Activities other than copying, distribution and modification are not covered by this License; they are outside its scope. The act of running a program using the Library is not restricted, and output from such a program is covered only if its contents constitute a work based on the Library (independent of the use of the Library in a tool for writing it). Whether that is true depends on what the Library does and what the program that uses the Library does. 1. You may copy and distribute verbatim copies of the Library's complete source code as you receive it, in any medium, provided that you conspicuously and appropriately publish on each copy an appropriate copyright notice and disclaimer of warranty; keep intact all the notices that refer to this License and to the absence of any warranty; and distribute a copy of this License along with the Library. You may charge a fee for the physical act of transferring a copy, and you may at your option offer warranty protection in exchange for a fee. 2. You may modify your copy or copies of the Library or any portion of it, thus forming a work based on the Library, and copy and distribute such modifications or work under the terms of Section 1 above, provided that you also meet all of these conditions: a) The modified work must itself be a software library. b) You must cause the files modified to carry prominent notices stating that you changed the files and the date of any change. c) You must cause the whole of the work to be licensed at no charge to all third parties under the terms of this License. d) If a facility in the modified Library refers to a function or a table of data to be supplied by an application program that uses the facility, other than as an argument passed when the facility is invoked, then you must make a good faith effort to ensure that, in the event an application does not supply such function or table, the facility still operates, and performs whatever part of its purpose remains meaningful. (For example, a function in a library to compute square roots has a purpose that is entirely well-defined independent of the application. Therefore, Subsection 2d requires that any application-supplied function or table used by this function must be optional: if the application does not supply it, the square root function must still compute square roots.) These requirements apply to the modified work as a whole. If identifiable sections of that work are not derived from the Library, and can be reasonably considered independent and separate works in themselves, then this License, and its terms, do not apply to those sections when you distribute them as separate works. But when you distribute the same sections as part of a whole which is a work based on the Library, the distribution of the whole must be on the terms of this License, whose permissions for other licensees extend to the entire whole, and thus to each and every part regardless of who wrote it. Thus, it is not the intent of this section to claim rights or contest your rights to work written entirely by you; rather, the intent is to exercise the right to control the distribution of derivative or collective works based on the Library. In addition, mere aggregation of another work not based on the Library with the Library (or with a work based on the Library) on a volume of a storage or distribution medium does not bring the other work under the scope of this License. 3. You may opt to apply the terms of the ordinary GNU General Public License instead of this License to a given copy of the Library. To do this, you must alter all the notices that refer to this License, so that they refer to the ordinary GNU General Public License, version 2, instead of to this License. (If a newer version than version 2 of the ordinary GNU General Public License has appeared, then you can specify that version instead if you wish.) Do not make any other change in these notices. Once this change is made in a given copy, it is irreversible for that copy, so the ordinary GNU General Public License applies to all subsequent copies and derivative works made from that copy. This option is useful when you wish to copy part of the code of the Library into a program that is not a library. 4. You may copy and distribute the Library (or a portion or derivative of it, under Section 2) in object code or executable form under the terms of Sections 1 and 2 above provided that you accompany it with the complete corresponding machine-readable source code, which must be distributed under the terms of Sections 1 and 2 above on a medium customarily used for software interchange. If distribution of object code is made by offering access to copy from a designated place, then offering equivalent access to copy the source code from the same place satisfies the requirement to distribute the source code, even though third parties are not compelled to copy the source along with the object code. 5. A program that contains no derivative of any portion of the Library, but is designed to work with the Library by being compiled or linked with it, is called a "work that uses the Library". Such a work, in isolation, is not a derivative work of the Library, and therefore falls outside the scope of this License. However, linking a "work that uses the Library" with the Library creates an executable that is a derivative of the Library (because it contains portions of the Library), rather than a "work that uses the library". The executable is therefore covered by this License. Section 6 states terms for distribution of such executables. When a "work that uses the Library" uses material from a header file that is part of the Library, the object code for the work may be a derivative work of the Library even though the source code is not. Whether this is true is especially significant if the work can be linked without the Library, or if the work is itself a library. The threshold for this to be true is not precisely defined by law. If such an object file uses only numerical parameters, data structure layouts and accessors, and small macros and small inline functions (ten lines or less in length), then the use of the object file is unrestricted, regardless of whether it is legally a derivative work. (Executables containing this object code plus portions of the Library will still fall under Section 6.) Otherwise, if the work is a derivative of the Library, you may distribute the object code for the work under the terms of Section 6. Any executables containing that work also fall under Section 6, whether or not they are linked directly with the Library itself. 6. As an exception to the Sections above, you may also combine or link a "work that uses the Library" with the Library to produce a work containing portions of the Library, and distribute that work under terms of your choice, provided that the terms permit modification of the work for the customer's own use and reverse engineering for debugging such modifications. You must give prominent notice with each copy of the work that the Library is used in it and that the Library and its use are covered by this License. You must supply a copy of this License. If the work during execution displays copyright notices, you must include the copyright notice for the Library among them, as well as a reference directing the user to the copy of this License. Also, you must do one of these things: a) Accompany the work with the complete corresponding machine-readable source code for the Library including whatever changes were used in the work (which must be distributed under Sections 1 and 2 above); and, if the work is an executable linked with the Library, with the complete machine-readable "work that uses the Library", as object code and/or source code, so that the user can modify the Library and then relink to produce a modified executable containing the modified Library. (It is understood that the user who changes the contents of definitions files in the Library will not necessarily be able to recompile the application to use the modified definitions.) b) Use a suitable shared library mechanism for linking with the Library. A suitable mechanism is one that (1) uses at run time a copy of the library already present on the user's computer system, rather than copying library functions into the executable, and (2) will operate properly with a modified version of the library, if the user installs one, as long as the modified version is interface-compatible with the version that the work was made with. c) Accompany the work with a written offer, valid for at least three years, to give the same user the materials specified in Subsection 6a, above, for a charge no more than the cost of performing this distribution. d) If distribution of the work is made by offering access to copy from a designated place, offer equivalent access to copy the above specified materials from the same place. e) Verify that the user has already received a copy of these materials or that you have already sent this user a copy. For an executable, the required form of the "work that uses the Library" must include any data and utility programs needed for reproducing the executable from it. However, as a special exception, the materials to be distributed need not include anything that is normally distributed (in either source or binary form) with the major components (compiler, kernel, and so on) of the operating system on which the executable runs, unless that component itself accompanies the executable. It may happen that this requirement contradicts the license restrictions of other proprietary libraries that do not normally accompany the operating system. Such a contradiction means you cannot use both them and the Library together in an executable that you distribute. 7. You may place library facilities that are a work based on the Library side-by-side in a single library together with other library facilities not covered by this License, and distribute such a combined library, provided that the separate distribution of the work based on the Library and of the other library facilities is otherwise permitted, and provided that you do these two things: a) Accompany the combined library with a copy of the same work based on the Library, uncombined with any other library facilities. This must be distributed under the terms of the Sections above. b) Give prominent notice with the combined library of the fact that part of it is a work based on the Library, and explaining where to find the accompanying uncombined form of the same work. 8. You may not copy, modify, sublicense, link with, or distribute the Library except as expressly provided under this License. Any attempt otherwise to copy, modify, sublicense, link with, or distribute the Library is void, and will automatically terminate your rights under this License. However, parties who have received copies, or rights, from you under this License will not have their licenses terminated so long as such parties remain in full compliance. 9. You are not required to accept this License, since you have not signed it. However, nothing else grants you permission to modify or distribute the Library or its derivative works. These actions are prohibited by law if you do not accept this License. Therefore, by modifying or distributing the Library (or any work based on the Library), you indicate your acceptance of this License to do so, and all its terms and conditions for copying, distributing or modifying the Library or works based on it. 10. Each time you redistribute the Library (or any work based on the Library), the recipient automatically receives a license from the original licensor to copy, distribute, link with or modify the Library subject to these terms and conditions. You may not impose any further restrictions on the recipients' exercise of the rights granted herein. You are not responsible for enforcing compliance by third parties with this License. 11. If, as a consequence of a court judgment or allegation of patent infringement or for any other reason (not limited to patent issues), conditions are imposed on you (whether by court order, agreement or otherwise) that contradict the conditions of this License, they do not excuse you from the conditions of this License. If you cannot distribute so as to satisfy simultaneously your obligations under this License and any other pertinent obligations, then as a consequence you may not distribute the Library at all. For example, if a patent license would not permit royalty-free redistribution of the Library by all those who receive copies directly or indirectly through you, then the only way you could satisfy both it and this License would be to refrain entirely from distribution of the Library. If any portion of this section is held invalid or unenforceable under any particular circumstance, the balance of the section is intended to apply, and the section as a whole is intended to apply in other circumstances. It is not the purpose of this section to induce you to infringe any patents or other property right claims or to contest validity of any such claims; this section has the sole purpose of protecting the integrity of the free software distribution system which is implemented by public license practices. Many people have made generous contributions to the wide range of software distributed through that system in reliance on consistent application of that system; it is up to the author/donor to decide if he or she is willing to distribute software through any other system and a licensee cannot impose that choice. This section is intended to make thoroughly clear what is believed to be a consequence of the rest of this License. 12. If the distribution and/or use of the Library is restricted in certain countries either by patents or by copyrighted interfaces, the original copyright holder who places the Library under this License may add an explicit geographical distribution limitation excluding those countries, so that distribution is permitted only in or among countries not thus excluded. In such case, this License incorporates the limitation as if written in the body of this License. 13. The Free Software Foundation may publish revised and/or new versions of the Lesser General Public License from time to time. Such new versions will be similar in spirit to the present version, but may differ in detail to address new problems or concerns. Each version is given a distinguishing version number. If the Library specifies a version number of this License which applies to it and "any later version", you have the option of following the terms and conditions either of that version or of any later version published by the Free Software Foundation. If the Library does not specify a license version number, you may choose any version ever published by the Free Software Foundation. 14. If you wish to incorporate parts of the Library into other free programs whose distribution conditions are incompatible with these, write to the author to ask for permission. For software which is copyrighted by the Free Software Foundation, write to the Free Software Foundation; we sometimes make exceptions for this. Our decision will be guided by the two goals of preserving the free status of all derivatives of our free software and of promoting the sharing and reuse of software generally. NO WARRANTY 15. BECAUSE THE LIBRARY IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY FOR THE LIBRARY, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES PROVIDE THE LIBRARY "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE LIBRARY IS WITH YOU. SHOULD THE LIBRARY PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION. 16. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR REDISTRIBUTE THE LIBRARY AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE LIBRARY (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A FAILURE OF THE LIBRARY TO OPERATE WITH ANY OTHER SOFTWARE), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. END OF TERMS AND CONDITIONS How to Apply These Terms to Your New Libraries If you develop a new library, and you want it to be of the greatest possible use to the public, we recommend making it free software that everyone can redistribute and change. You can do so by permitting redistribution under these terms (or, alternatively, under the terms of the ordinary General Public License). To apply these terms, attach the following notices to the library. It is safest to attach them to the start of each source file to most effectively convey the exclusion of warranty; and each file should have at least the "copyright" line and a pointer to where the full notice is found. Copyright (C) This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA Also add information on how to contact you by electronic and paper mail. You should also get your employer (if you work as a programmer) or your school, if any, to sign a "copyright disclaimer" for the library, if necessary. Here is a sample; alter the names: Yoyodyne, Inc., hereby disclaims all copyright interest in the library `Frob' (a library for tweaking knobs) written by James Random Hacker. , 1 April 1990 Ty Coon, President of Vice That's all there is to it! pygame_sdl2-2.1.0-for-renpy-6.99.14.1/setup.cfg0000644000175000017500000000007213235720531020065 0ustar tomtom00000000000000[egg_info] tag_build = -for-renpy-6.99.14.1 tag_date = 0 pygame_sdl2-2.1.0-for-renpy-6.99.14.1/setup.py0000755000175000017500000001173413201701200017751 0ustar tomtom00000000000000#!/usr/bin/env python # Copyright 2014 Tom Rothamel # # This software is provided 'as-is', without any express or implied # warranty. In no event will the authors be held liable for any damages # arising from the use of this software. # # Permission is granted to anyone to use this software for any purpose, # including commercial applications, and to alter it and redistribute it # freely, subject to the following restrictions: # # 1. The origin of this software must not be misrepresented; you must not # claim that you wrote the original software. If you use this software # in a product, an acknowledgment in the product documentation would be # appreciated but is not required. # 2. Altered source versions must be plainly marked as such, and must not be # misrepresented as being the original software. # 3. This notice may not be removed or altered from any source distribution. from __future__ import division, absolute_import, print_function # The version of pygame_sdl2. This should also be updated in version.py VERSION="2.1.0" from setuplib import android, ios, windows, cython, pymodule, setup, parse_cflags, parse_libs, find_unnecessary_gen, gen import setuplib import os import platform import shutil import sys def setup_env(name): # If PYGAME_SDL2_CC or PYGAME_SDL2_LD are in the environment, and CC or LD are not, use them. renpy_name = "PYGAME_SDL2_" + name if (renpy_name in os.environ) and (name not in os.environ): os.environ[name] = os.environ[renpy_name] setup_env("CC") setup_env("LD") setup_env("CXX") temporary_package_data = [ ] if android or ios: sdl_libs = [ 'SDL2' ] else: setuplib.package_data.extend([ "DejaVuSans.ttf", "DejaVuSans.txt", ]) try: parse_cflags([ "sh", "-c", "sdl2-config --cflags" ]) sdl_libs = parse_libs([ "sh", "-c", "sdl2-config --libs" ]) except: if not windows: raise windeps = os.path.join(os.path.dirname(__file__), "pygame_sdl2_windeps") if not os.path.isdir(windeps): raise sdl_libs = [ 'SDL2' ] setuplib.include_dirs.append(os.path.join(windeps, "include")) if sys.version_info[0] < 3: setuplib.include_dirs.append(os.path.join(windeps, "include27")) if platform.architecture()[0] == "32bit": libdir = os.path.join(windeps, "lib/x86") else: libdir = os.path.join(windeps, "lib/x64") setuplib.library_dirs.append(libdir) for i in os.listdir(libdir): if i.lower().endswith(".dll"): shutil.copy( os.path.join(libdir, i), os.path.join(os.path.dirname(__file__), "src", "pygame_sdl2", i), ) temporary_package_data.append(i) setuplib.package_data.extend(temporary_package_data) if android: png = "png16" else: png = "png" pymodule("pygame_sdl2.__init__") pymodule("pygame_sdl2.compat") pymodule("pygame_sdl2.threads.__init__") pymodule("pygame_sdl2.threads.Py25Queue") pymodule("pygame_sdl2.sprite") pymodule("pygame_sdl2.sysfont") pymodule("pygame_sdl2.time") pymodule("pygame_sdl2.version") cython("pygame_sdl2.error", libs=sdl_libs) cython("pygame_sdl2.color", libs=sdl_libs) cython("pygame_sdl2.controller", libs=sdl_libs) cython("pygame_sdl2.rect", libs=sdl_libs) cython("pygame_sdl2.rwobject", libs=sdl_libs) cython("pygame_sdl2.surface", source=[ "src/alphablit.c" ], libs=sdl_libs) cython("pygame_sdl2.display", libs=sdl_libs) cython("pygame_sdl2.event", libs=sdl_libs) cython("pygame_sdl2.locals", libs=sdl_libs) cython("pygame_sdl2.key", libs=sdl_libs) cython("pygame_sdl2.mouse", libs=sdl_libs) cython("pygame_sdl2.joystick", libs=sdl_libs) cython("pygame_sdl2.power", libs=sdl_libs) cython("pygame_sdl2.pygame_time", libs=sdl_libs) cython("pygame_sdl2.image", source=[ "src/write_jpeg.c", "src/write_png.c" ], libs=[ 'SDL2_image', "jpeg", png ] + sdl_libs) cython("pygame_sdl2.transform", source=[ "src/SDL2_rotozoom.c" ], libs=sdl_libs) cython("pygame_sdl2.gfxdraw", source=[ "src/SDL_gfxPrimitives.c" ], libs=sdl_libs) cython("pygame_sdl2.draw", libs=sdl_libs) cython("pygame_sdl2.font", libs=['SDL2_ttf'] + sdl_libs) cython("pygame_sdl2.mixer", libs=['SDL2_mixer'] + sdl_libs) cython("pygame_sdl2.mixer_music", libs=['SDL2_mixer'] + sdl_libs) cython("pygame_sdl2.scrap", libs=sdl_libs) cython("pygame_sdl2.render", libs=['SDL2_image'] + sdl_libs) headers = [ "src/pygame_sdl2/pygame_sdl2.h", gen + "/pygame_sdl2.rwobject_api.h", gen + "/pygame_sdl2.surface_api.h", gen + "/pygame_sdl2.display_api.h", ] if __name__ == "__main__": setup( "pygame_sdl2", VERSION, headers=headers, url="https://github.com/renpy/pygame_sdl2", maintainer="Tom Rothamel", maintainer_email="tom@rothamel.us", ) find_unnecessary_gen() for i in temporary_package_data: os.unlink(os.path.join(os.path.dirname(__file__), "src", "pygame_sdl2", i))